From 8a88429b8781f3d2a8d36882fd7eb27d6a914e16 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 2 Nov 2024 21:25:27 +0100 Subject: [PATCH 01/48] start work on sub_806EAF4 --- include/structs/dungeon_entity.h | 60 +++---- src/code_8069D4C.c | 8 +- src/code_806E8B0.c | 294 +++++++++++++++++++++++++++++++ src/code_80718D8.c | 48 ++--- src/code_8077274_1.c | 24 +-- src/dungeon_ai_item_weight.c | 8 +- src/dungeon_move.c | 1 - src/dungeon_music.c | 8 +- src/trap_1.c | 8 +- 9 files changed, 375 insertions(+), 84 deletions(-) diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index f395a81e5..92cf0a06b 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -38,9 +38,9 @@ typedef struct ActionContainer /* 0x0 */ u16 action; /* 0x2 */ u8 direction; u8 fill3; - // Additional parameter alongside actionIndex. Used for things like indicating which move a PokĂ©mon should use from its moveset. + // Additional parameter alongside actionIndex. Used for things like indicating which move a Pokémon should use from its moveset. /* 0x4 */ unkStruct_8044CC8 unk4[2]; - // Position of the target that the PokĂ©mon wants throw an item at. + // Position of the target that the Pokémon wants throw an item at. /* 0x14 */ Position itemTargetPosition; } ActionContainer; @@ -101,7 +101,7 @@ typedef struct Charging { /* 0x0 */ u8 chargingStatus; /* 0x1 */ u8 chargingStatusTurns; - /* 0x2 */ u8 chargingStatusMoveIndex; // The position of the move in the PokĂ©mon's moveset that triggered the status. + /* 0x2 */ u8 chargingStatusMoveIndex; // The position of the move in the Pokémon's moveset that triggered the status. } Charging; typedef struct Protection @@ -113,7 +113,7 @@ typedef struct Protection typedef struct Waiting { /* 0xC8 */ u8 waitingStatus; - /* 0xC9 */ bool8 enemyDecoy; // True if the PokĂ©mon is a decoy and a wild PokĂ©mon (i.e., not an allied PokĂ©mon). + /* 0xC9 */ bool8 enemyDecoy; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon). u8 unkCA; /* 0xCB */ u8 waitingStatusTurns; /* 0xCC */ u8 curseDamageCountdown; @@ -162,10 +162,10 @@ typedef struct Unk_Entity_x184 { /* 0x184 - 0x0 */ Position previousTargetMovePosition1; /* 0x188 - 0x4 */ Position32 previousTargetMovePosition2; - /* 0x190 - 0xC */ s32 lastMoveDirection; // The last direction that the PokĂ©mon moved in. - // Number of tiles that the PokĂ©mon moved last, multiplied by 0x100. + /* 0x190 - 0xC */ s32 lastMoveDirection; // The last direction that the Pokémon moved in. + // Number of tiles that the Pokémon moved last, multiplied by 0x100. /* 0x194 - 0x10*/ Position32 lastMoveIncrement; - /* 0x19C - 0x18 */ s16 walkAnimFramesLeft; // Set when the PokĂ©mon starts moving, and counts down until the PokĂ©mon's walk animation stops. + /* 0x19C - 0x18 */ s16 walkAnimFramesLeft; // Set when the Pokémon starts moving, and counts down until the Pokémon's walk animation stops. /* 0x19e - 0x1a */ u8 unk1A; } Unk_Entity_x184 ; @@ -178,14 +178,14 @@ typedef struct Moves // size: 0x208 typedef struct EntityInfo { - // This has different purposes for PokĂ©mon, items, and traps. + // This has different purposes for Pokémon, items, and traps. // Pokemon: MovementFlag // Items: ItemFlag // Traps: TrapType /* 0x0 */ u16 flags; - /* 0x2 */ s16 id; // PokĂ©mon species or item ID. - // Everything from here on only applies to PokĂ©mon. - /* 0x4 */ s16 apparentID; // Shows a different PokĂ©mon when using Transform. + /* 0x2 */ s16 id; // Pokémon species or item ID. + // Everything from here on only applies to Pokémon. + /* 0x4 */ s16 apparentID; // Shows a different Pokémon when using Transform. /* 0x6 */ bool8 isNotTeamMember; /* 0x7 */ bool8 isTeamLeader; /* 0x8 */ u8 shopkeeper; @@ -196,10 +196,8 @@ typedef struct EntityInfo /* 0x10 */ s16 maxHPStat; // Bosses have higher HP than normal for their level. This is the max HP they would normally have given their level. /* 0x12 */ s16 originalHP; - /* 0x14 */ u8 atk; - /* 0x15 */ u8 spAtk; - /* 0x16 */ u8 def; - /* 0x17 */ u8 spDef; + /* 0x14 */ u8 atk[2]; // Index 0 is Attack. Index 1 is Special Attack. + /* 0x16 */ u8 def[2]; // Index 0 is Defense. Index 1 is Special Defense. /* 0x18 */ u32 exp; // Temporary stat boosts/drops from effects like Growl or Swords Dance. // These start at 10 and are in the range [1, 19]. @@ -209,7 +207,7 @@ typedef struct EntityInfo /* 0x20 */ s16 defensiveStages[2]; // Index 0 is accuracy. Index 1 is evasion. /* 0x24 */ s16 hitChanceStages[2]; - // // When a Fire-type move is used on a PokĂ©mon with Flash Fire, this value increases the power of the PokĂ©mon's Fire-type moves. + // // When a Fire-type move is used on a Pokémon with Flash Fire, this value increases the power of the Pokémon's Fire-type moves. /* 0x28 */ s16 flashFireBoost; // These start at 0x1000, and are halved by certain moves like Screech to lower the corresponding stat. // Index 0 is Attack. Index 1 is Special Attack. @@ -260,32 +258,32 @@ typedef struct EntityInfo /* 0xF7 */ bool8 bossFlag; /* 0xF8 */ bool8 speedStageChanged; // Toggled when pokemon is movement speed is sped up /* 0xF9 */ u8 unkF9; - /* 0xFA */ u8 terrifiedTurns; // Doubles as a bool for whether the PokĂ©mon is terrified. + /* 0xFA */ u8 terrifiedTurns; // Doubles as a bool for whether the Pokémon is terrified. /* 0xFB */ u8 expMultiplier; // Set to true if the player makes a teammate use their held item. // This is done by going to the teammate's held item in the toolbox and selecting "Use". /* 0xFC */ bool8 useHeldItem; - /* 0xFD */ u8 perishSongTurns; // When this reaches 0, the PokĂ©mon faints from Perish Song. Doubles as a bool for whether the PokĂ©mon is afflicted by Perish Song. + /* 0xFD */ u8 perishSongTurns; // When this reaches 0, the Pokémon faints from Perish Song. Doubles as a bool for whether the Pokémon is afflicted by Perish Song. u8 unkFE; u8 unkFF; - /* 0x100 */ u8 targetingDecoy; // If the PokĂ©mon is targeting a decoy, this indicates whether the decoy target is a team or wild PokĂ©mon. + /* 0x100 */ u8 targetingDecoy; // If the Pokémon is targeting a decoy, this indicates whether the decoy target is a team or wild Pokémon. /* 0x104 */ s32 speedStage; - // The turn counter for movement speed up/down is split into five timers each. Multiple timers are used if the PokĂ©mon is affected by multiple + // The turn counter for movement speed up/down is split into five timers each. Multiple timers are used if the Pokémon is affected by multiple // speed-up/slow effects at once, like using Agility twice. /* 0x108 */ u8 speedUpCounters[NUM_SPEED_COUNTERS]; /* 0x10D */ u8 speedDownCounters[NUM_SPEED_COUNTERS]; /* 0x112 */ u8 stockpileStage; /* 0x113 */ u8 unk113; - // When non-zero, an AI PokĂ©mon will move in a random direction every turn when it is a room. - // There is a chance of this flag being set when a wild PokĂ©mon spawns. The chance depends on the dungeon's randomMovementChance. + // When non-zero, an AI Pokémon will move in a random direction every turn when it is a room. + // There is a chance of this flag being set when a wild Pokémon spawns. The chance depends on the dungeon's randomMovementChance. /* 0x114 */ u32 moveRandomly; /* 0x118 */ Moves moves; /* 0x13C */ FixedPoint belly; /* 0x140 */ FixedPoint maxBelly; - /* 0x144 */ bool8 aiNextToTarget; // True if an AI PokĂ©mon is following another PokĂ©mon and is already adjacent to them. - /* 0x145 */ bool8 recalculateFollow; // Used by the AI to defer a movement decision until after all other PokĂ©mon have moved. + /* 0x144 */ bool8 aiNextToTarget; // True if an AI Pokémon is following another Pokémon and is already adjacent to them. + /* 0x145 */ bool8 recalculateFollow; // Used by the AI to defer a movement decision until after all other Pokémon have moved. /* 0x146 */ u8 unk146; - /* 0x147 */ bool8 waiting; // True if an AI PokĂ©mon decided to do nothing this turn. + /* 0x147 */ bool8 waiting; // True if an AI Pokémon decided to do nothing this turn. /* 0x148 */ bool8 attacking; /* 0x149 */ u8 unk149; /* 0x14A */ u8 unk14A; @@ -326,13 +324,13 @@ typedef struct EntityInfo /* 0x1F4 */ s16 numMoveTiles; // Number of tiles to move in a turn. Can be greater than 1 if the user's movement speed is boosted. /* 0x1F6 */ s16 notMoving; /* 0x1F8 */ s16 unk1F8; - /* 0x1FA */ s16 mobileTurnTimer; // When a PokĂ©mon can pass through walls in a hallway, this counts up to 200 before the PokĂ©mon turns in a random direction. + /* 0x1FA */ s16 mobileTurnTimer; // When a Pokémon can pass through walls in a hallway, this counts up to 200 before the Pokémon turns in a random direction. /* 0x1FC */ u32 expGainedInTurn; // Used to accumulate experience when multiple enemies are defeated in one turn. /* 0x200 */ u32 statusIcons; u8 unk204; } EntityInfo; -// size: 0x74 | Used for PokĂ©mon, items, and traps. +// size: 0x74 | Used for Pokémon, items, and traps. typedef struct Entity { /* 0x0 */ u32 type; @@ -343,13 +341,13 @@ typedef struct Entity /* 0xC */ Position32 pixelPos; /* 0x14 */ Position32 prevPixelPos; s32 unk1C; - /* 0x20 */ bool8 isVisible; // Turned off when a PokĂ©mon faints. + /* 0x20 */ bool8 isVisible; // Turned off when a Pokémon faints. u8 fill21; u8 unk22; u8 fill23; u8 unk24; /* 0x25 */ u8 room; - // The global spawn index counter starts at 10. Each PokĂ©mon that spawns increments the counter and + // The global spawn index counter starts at 10. Each Pokémon that spawns increments the counter and // gets assigned the current counter value as its spawn index. /* 0x26 */ u16 spawnGenID; /* 0x28 */ struct axObject axObj; @@ -370,7 +368,7 @@ enum MovementFlag MOVEMENT_FLAG_SWAPPING_PLACES = 1 << 5, MOVEMENT_FLAG_WALKING = 1 << 9, MOVEMENT_FLAG_UNK_14 = 1 << 14, - MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY = 1 << 15 // Set if the PokĂ©mon is petrified and the leader cures them by swapping places. + MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY = 1 << 15 // Set if the Pokémon is petrified and the leader cures them by swapping places. }; enum AbilityEffectFlags @@ -421,7 +419,7 @@ enum ClientType enum VisualFlag { // Set if Run Away's visual effect (green smoke cloud) has been triggered on this floor. - // Prevents the effect from showing again if the PokĂ©mon stops running away and then starts running away again. + // Prevents the effect from showing again if the Pokémon stops running away and then starts running away again. VISUAL_FLAG_RUN_AWAY = 2 }; diff --git a/src/code_8069D4C.c b/src/code_8069D4C.c index 2ef7cdac6..08a1a25e5 100644 --- a/src/code_8069D4C.c +++ b/src/code_8069D4C.c @@ -33,10 +33,10 @@ void sub_8069D4C(struct unkStruct_8069D4C *r0, Entity *target) GetPokemonLevelData(&leveldata, info->id, info->level); r0->exp = leveldata.expRequired; - r0->offense.att[0] = info->atk; - r0->offense.att[1] = info->spAtk; - r0->offense.def[0] = info->def; - r0->offense.def[1] = info->spDef; + r0->offense.att[0] = info->atk[0]; + r0->offense.att[1] = info->atk[1]; + r0->offense.def[0] = info->def[0]; + r0->offense.def[1] = info->def[1]; r0->heldItem = info->heldItem; memcpy(r0->moves.moves, info->moves.moves, sizeof(r0->moves)); r0->belly = info->belly; diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index c00a53ce3..2eef6af38 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -5,6 +5,21 @@ #include "status_checks_1.h" #include "text_util.h" #include "dungeon_message.h" +#include "string_format.h" +#include "type_effectiveness.h" +#include "constants/move_id.h" +#include "constants/monster.h" +#include "constants/status.h" +#include "constants/type.h" +#include "constants/iq_skill.h" +#include "math.h" +#include "number_util.h" +#include "status.h" +#include "type_chart.h" +#include "dungeon_random.h" +#include "code_8045A00.h" +#include "dungeon_items.h" +#include "structs/str_damage.h" extern u8 *gUnknown_80FEE04[]; extern u8 *gUnknown_80FEE2C[]; @@ -121,3 +136,282 @@ void sub_806E8B0(Entity * pokemon, Entity * target, u8 param_3, s32 *param_4, s3 *param_5 = *param_5 / sp_0x8; } } + +extern void sub_806F500(void); +extern void sub_800A020(struct unkStruct_80943A8 *param_1, u32 param_2); +extern void sub_800A3F0(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, struct unkStruct_80943A8 *); +extern void sub_800A6D0(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, struct unkStruct_80943A8 *); +extern void sub_800A34C(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, const struct unkStruct_80943A8 *param3); +extern void sub_800A6F0(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, struct unkStruct_80943A8 *param3); +extern void sub_800A088(struct unkStruct_80943A8 *param_1, u32 param_2); +extern u32 sub_800A048(struct unkStruct_80943A8 *param_1); +extern bool8 sub_800A2F0(const struct unkStruct_80943A8*, struct unkStruct_80943A8*); +extern bool8 sub_806E100(struct unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u8 type, struct DamageStruct *dmgStruct); +extern void sub_8041B74(Entity *pokemon); +extern void sub_8041B5C(Entity *pokemon); + +extern const s32 gUnknown_80F504C[]; +extern const s16 gUnknown_810AC60; +extern const s16 gUnknown_810AC68; +extern const s16 gUnknown_810AC64; +extern const s16 gUnknown_810AC66; +extern const s16 gUnknown_810AC68; +extern const s16 gUnknown_810AC62; +extern const s16 gUnknown_80F4DAE; +extern const s16 gUnknown_80F4DB0; +extern const struct unkStruct_80943A8 gUnknown_8106F24; +extern const struct unkStruct_80943A8 gUnknown_8106F04; +extern const struct unkStruct_80943A8 gUnknown_8106F1C; +extern const struct unkStruct_80943A8 gUnknown_8106F14; +extern const u8 *const gUnknown_80FAE00; +extern const u8 *const gUnknown_80FADD8; + +void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u32 critChance, struct DamageStruct *dmgStruct, u32 arg_8, u16 moveId, bool8 arg_10) +{ + EntityInfo *attackerInfo = GetEntInfo(attacker); + EntityInfo *targetInfo = GetEntInfo(target); + bool32 physicalMove = (IsTypePhysical(moveType) != FALSE); + + sub_806F500(); + if (!attackerInfo->isTeamLeader && FixedPointToInt(attackerInfo->belly) == 0) { + dmgStruct->dmg = 1; + dmgStruct->residualDmgType = 0; + dmgStruct->typeEffectiveness = EFFECTIVENESS_NEUTRAL; + dmgStruct->type = moveType; + dmgStruct->isCrit = FALSE; + dmgStruct->unkE = 0; + dmgStruct->unkF = 0; + } + else if (moveId == MOVE_REGULAR_ATTACK && HasAbility(target, ABILITY_WONDER_GUARD)) { + dmgStruct->dmg = 1; + dmgStruct->residualDmgType = 0; + dmgStruct->typeEffectiveness = EFFECTIVENESS_NEUTRAL; + dmgStruct->type = moveType; + dmgStruct->isCrit = FALSE; + dmgStruct->unkE = 0; + dmgStruct->unkF = 0; + } + else { + s32 atkStatStage, defStatStage; + s32 atkStatCalc, defStatCalc; + s32 atkStat, defStat; + s32 rand; + struct unkStruct_80943A8 unkSp1; + struct unkStruct_80943A8 unkSp2; + struct unkStruct_80943A8 unkSp3; + s32 r6; + s32 unkAtkStat2, unkDefStat2; + struct unkStruct_80943A8 unkSp4; + struct unkStruct_80943A8 unkSp5; + struct unkStruct_80943A8 unkSp6; + struct unkStruct_80943A8 unkSp7; + struct unkStruct_80943A8 unkSp8; + struct unkStruct_80943A8 unkSp9; + struct unkStruct_80943A8 unkSp10; + struct unkStruct_80943A8 unkSp11; + bool8 r5; + + dmgStruct->type = moveType; + gDungeon->unk134.unk134 = moveType; + gDungeon->unk134.unk138 = physicalMove; + + atkStatStage = attackerInfo->offensiveStages[physicalMove]; + if (arg_10 && moveType == TYPE_FIRE) { + atkStatStage += attackerInfo->flashFireBoost; + gDungeon->unk134.unk140[2] = attackerInfo->flashFireBoost; + } + if (attackerInfo->apparentID == MONSTER_DEOXYS_ATTACK) { + atkStatStage += 2; + } + if (attackerInfo->apparentID == MONSTER_DEOXYS_DEFENSE) { + atkStatStage -= 2; + } + if (attackerInfo->apparentID == MONSTER_DEOXYS_SPEED) { + atkStatStage -= 2; + } + + if (atkStatStage < 0) atkStatStage = 0; + if (atkStatStage > 20) atkStatStage = 20; + + gDungeon->unk134.unk13E[0] = atkStatStage; + gDungeon->unk134.unk140[0] = attackerInfo->atk[physicalMove] + movePower; + atkStatCalc = s24_8_mul((attackerInfo->atk[physicalMove] + movePower) * 256, gUnknown_80F504C[atkStatStage]); + atkStatCalc = s24_8_mul(atkStatCalc, attackerInfo->offensiveMultipliers[physicalMove]); + atkStat = atkStatCalc / 8; + + defStatStage = targetInfo->defensiveStages[physicalMove]; + if (targetInfo->charging.chargingStatus == STATUS_SKULL_BASH) { + gDungeon->unk134.unk17A = 1; + defStatStage++; + } + if (targetInfo->apparentID == MONSTER_DEOXYS_ATTACK) { + defStatStage -= 2; + } + if (targetInfo->apparentID == MONSTER_DEOXYS_DEFENSE) { + defStatStage += 2; + } + if (attackerInfo->apparentID == MONSTER_DEOXYS_SPEED) { + defStatStage -= 2; + } + + if (defStatStage < 0) defStatStage = 0; + if (defStatStage > 20) defStatStage = 20; + + gDungeon->unk134.unk13E[1] = defStatStage; + gDungeon->unk134.unk140[1] = targetInfo->def[physicalMove]; + defStatCalc = s24_8_mul((targetInfo->def[physicalMove]) * 256, gUnknown_80F504C[defStatStage]); + defStatCalc = s24_8_mul(defStatCalc, targetInfo->defensiveMultipliers[physicalMove]); + defStat = defStatCalc / 8; + + rand = DungeonRandInt(100); + if (physicalMove) { + if (HasHeldItem(attacker, ITEM_POWER_BAND)) { + atkStat += gUnknown_810AC60; + gDungeon->unk134.unk160 += gUnknown_810AC60; + } + if (HasHeldItem(attacker, ITEM_MUNCH_BELT)) { + atkStat += gUnknown_810AC68; + gDungeon->unk134.unk160 += gUnknown_810AC68; + } + if (arg_10 && HasHeldItem(target, ITEM_DEF_SCARF)) { + defStat += gUnknown_810AC64; + gDungeon->unk134.unk162 += gUnknown_810AC64; + } + } + else { + if (arg_10 && HasHeldItem(target, ITEM_ZINC_BAND)) { + defStat += gUnknown_810AC66; + gDungeon->unk134.unk163 += gUnknown_810AC66; + } + if (HasHeldItem(attacker, ITEM_SPECIAL_BAND)) { + atkStat += gUnknown_810AC62; + gDungeon->unk134.unk161 += gUnknown_810AC62; + } + if (HasHeldItem(attacker, ITEM_MUNCH_BELT)) { + atkStat += gUnknown_810AC68; + gDungeon->unk134.unk161 += gUnknown_810AC68; + } + } + + gDungeon->unk134.unk140[3] = atkStat; + gDungeon->unk134.unk140[4] = defStat; + if (atkStat < 0) atkStat = 0; + if (atkStat >= 999) atkStat = 999; + + attackerInfo->previousVisualFlags &= ~(0x100); + attackerInfo->visualFlags &= ~(0x100); + sub_806E8B0(attacker, target, moveType, &atkStat, &defStat, rand); + sub_800A020(&unkSp1, atkStat - defStat); + sub_800A020(&unkSp2, 8); + sub_800A3F0(&unkSp1, &unkSp1, &unkSp2); + if (attackerInfo->isNotTeamMember) { + sub_800A020(&unkSp2, attackerInfo->teamIndex); + unkSp3.s0 = 0; + unkSp3.s4 = 0xAAAA; + sub_800A34C(&unkSp2, &unkSp2, &unkSp3); + r6 = (attackerInfo->teamIndex * 2) / 3; + } + else { + unkAtkStat2 = attackerInfo->atk[physicalMove]; + unkDefStat2 = 1; + sub_806E8B0(attacker, target, moveType, &unkAtkStat2, &unkDefStat2, rand); + sub_800A020(&unkSp2, unkAtkStat2); + sub_800A020(&unkSp3, 3); + sub_800A3F0(&unkSp2, &unkSp2, &unkSp3); + r6 = unkAtkStat2 / 3; + } + sub_800A6D0(&unkSp4, &unkSp1, &unkSp2); + gDungeon->unk134.unk140[5] = r6; + gDungeon->unk134.unk140[6] = sub_800A048(&unkSp1); + unkSp5 = unkSp4; + unkSp7 = unkSp4; + sub_800A34C(&unkSp5, &unkSp5, &unkSp5); + unkSp6.s0 = 0; + unkSp6.s4 = 0xCCC; + sub_800A34C(&unkSp5, &unkSp5, &unkSp6); + sub_800A020(&unkSp6, 2); + sub_800A34C(&unkSp7, &unkSp7, &unkSp6); + sub_800A020(&unkSp6, defStat); + sub_800A6F0(&unkSp7, &unkSp7, &unkSp6); + sub_800A020(&unkSp6, 10); + sub_800A6D0(&unkSp8, &unkSp5, &unkSp6); + if (sub_800A2F0(&gUnknown_8106F24, &unkSp8)) { + unkSp8 = gUnknown_8106F24; + } + if (sub_800A2F0(&gUnknown_8106F04, &unkSp8)) { + unkSp8 = gUnknown_8106F04; + } + r5 = sub_806E100(&unkSp9, attacker, target, moveType, dmgStruct); + + if (moveType == TYPE_FIRE) { + s32 flashFireStatus = GetFlashFireStatus(target); + if (flashFireStatus != FLASH_FIRE_STATUS_NONE && targetInfo->unk152 == 0 && arg_10) { + targetInfo->unk152 = 1; + SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) { + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FAE00); // Fire moves won't become stronger! + } + else { + TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FADD8); // m1 used Flash Fire to absorb fire! + } + } + } + if (arg_10 && !physicalMove && targetInfo->protection.protectionStatus == STATUS_REFLECT) { + sub_8041B74(target); + sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F1C); + gDungeon->unk134.unk166 = 1; + } + if (arg_10 && physicalMove == TRUE && targetInfo->protection.protectionStatus == STATUS_LIGHT_SCREEN) { + sub_8041B5C(target); + sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F1C); + gDungeon->unk134.unk167 = 1; + } + // Check crit + if (!HasAbility(target, ABILITY_BATTLE_ARMOR) && !HasAbility(target, ABILITY_SHELL_ARMOR)) { + s32 critOdds = (attackerInfo->isNotTeamMember) ? critChance : 0; + if (attackerInfo->moveStatus.moveStatus == STATUS_FOCUS_ENERGY) { + critOdds = 999; + gDungeon->unk134.unk168 = 1; + } + else { + if (HasHeldItem(attacker, ITEM_SCOPE_LENS)) { + critOdds += gUnknown_80F4DAE; + gDungeon->unk134.unk164 = 1; + } + if (HasHeldItem(attacker, ITEM_PATSY_BAND)) { + critOdds += gUnknown_80F4DAE; + gDungeon->unk134.unk165 = 1; + } + if (r5 && IQSkillIsEnabled(attacker, IQ_TYPE_ADVANTAGE_MASTER)) { + critOdds += gUnknown_80F4DB0; + gDungeon->unk134.unk169 = 1; + } + } + if (DungeonRandInt(100) < critOdds) { + sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F14); + dmgStruct->isCrit = TRUE; + } + } + + gDungeon->unk134.unk154 = sub_800A048(&unkSp8); + sub_800A34C(&unkSp8, &unkSp8, &unkSp9); + gDungeon->unk134.unk15C = arg_8; + sub_800A088(&unkSp10, arg_8); + sub_800A34C(&unkSp8, &unkSp8, &unkSp10); + gDungeon->unk134.unk150 = sub_800A048(&unkSp8); + { + s32 rnd = DungeonRandInt(0x4000); + unkSp9.s0 = 0; + unkSp9.s4 = 0xE000 + rnd; + } + sub_800A34C(&unkSp8, &unkSp8, &unkSp9); + sub_800A020(&unkSp11, 100); + sub_800A34C(&unkSp9, &unkSp11, &unkSp9); + gDungeon->unk134.unk158 = sub_800A048(&unkSp9); + dmgStruct->dmg = sub_800A048(&unkSp8); + dmgStruct->residualDmgType = 0; + if (dmgStruct->dmg == 0) { + dmgStruct->isCrit = FALSE; + } + } +} diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 4865f5e23..264fefc83 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -514,10 +514,10 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para GetAvailTacticsforLvl_Bool(tacticsBuffer1,info->level); } maxHP = info->maxHPStat; - atk[0] = info->atk; - atk[1] = info->spAtk; - def[0] = info->def; - def[1] = info->spDef; + atk[0] = info->atk[0]; + atk[1] = info->atk[1]; + def[0] = info->def[0]; + def[1] = info->def[1]; if (!IsClientOrTeamBase(info->joinedAt.joinedAt)) { newLevel = info->level + level; if (99 < newLevel) { @@ -529,10 +529,10 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para flag |= (sub_80723D0(pokemon,target,param_4,param_5)); if ((flag != 0) && (!info->isNotTeamMember)) { gFormatArgs[0] = info->maxHPStat - maxHP; - gFormatArgs[1] = info->atk - atk[0]; - gFormatArgs[2] = info->def - def[0]; - gFormatArgs[3] = info->spAtk - atk[1]; - gFormatArgs[4] = info->spDef - def[1]; + gFormatArgs[1] = info->atk[0] - atk[0]; + gFormatArgs[2] = info->def[0] - def[0]; + gFormatArgs[3] = info->atk[1] - atk[1]; + gFormatArgs[4] = info->def[1] - def[1]; if (param_4 != 0) { sub_807218C(target); } @@ -734,10 +734,10 @@ bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4) info->HP = info->maxHPStat; } - gUnknown_202F31C[0] = info->atk; - gUnknown_202F31C[1] = info->spAtk; - gUnknown_202F324[0] = info->def; - gUnknown_202F324[1] = info->spDef; + gUnknown_202F31C[0] = info->atk[0]; + gUnknown_202F31C[1] = info->atk[1]; + gUnknown_202F324[0] = info->def[0]; + gUnknown_202F324[1] = info->def[1]; gUnknown_202F31C[0] += leveldata.gainAtt; gUnknown_202F31C[1] += leveldata.gainSPAtt; @@ -757,10 +757,10 @@ bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4) LoadIQSkills(target); sub_8079764(target); - info->atk = gUnknown_202F31C[0]; - info->spAtk = gUnknown_202F31C[1]; - info->def = gUnknown_202F324[0]; - info->spDef = gUnknown_202F324[1]; + info->atk[0] = gUnknown_202F31C[0]; + info->atk[1] = gUnknown_202F31C[1]; + info->def[0] = gUnknown_202F324[0]; + info->def[1] = gUnknown_202F324[1]; sub_8072778(pokemon, target, param_3, param_4); } @@ -828,10 +828,10 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target) info->HP = info->maxHPStat; } - gUnknown_202F31C[0] = info->atk; - gUnknown_202F31C[1] = info->spAtk; - gUnknown_202F324[0] = info->def; - gUnknown_202F324[1] = info->spDef; + gUnknown_202F31C[0] = info->atk[0]; + gUnknown_202F31C[1] = info->atk[1]; + gUnknown_202F324[0] = info->def[0]; + gUnknown_202F324[1] = info->def[1]; gUnknown_202F31C[0] -= leveldata.gainAtt; gUnknown_202F31C[1] -= leveldata.gainSPAtt; @@ -851,10 +851,10 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target) LoadIQSkills(target); sub_8079764(target); - info->atk = gUnknown_202F31C[0]; - info->spAtk = gUnknown_202F31C[1]; - info->def = gUnknown_202F324[0]; - info->spDef = gUnknown_202F324[1]; + info->atk[0] = gUnknown_202F31C[0]; + info->atk[1] = gUnknown_202F31C[1]; + info->def[0] = gUnknown_202F324[0]; + info->def[1] = gUnknown_202F324[1]; } } diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index e05731587..85b2235c4 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -508,14 +508,14 @@ void RaiseAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) SetMessageArgument(gFormatBuffer_Monsters[0],target,0); entityInfo = GetEntInfo(target); - oldStat = entityInfo->atk; + oldStat = entityInfo->atk[0]; oldStat1 = oldStat; - newStat = entityInfo->atk + increment; + newStat = entityInfo->atk[0] + increment; if (0xfe < newStat) { newStat = 0xff; } - entityInfo->atk = newStat; + entityInfo->atk[0] = newStat; if (oldStat1 < (u8)newStat) { sub_8041E60(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC33C); @@ -538,14 +538,14 @@ void RaiseSpAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) SetMessageArgument(gFormatBuffer_Monsters[0],target,0); entityInfo = GetEntInfo(target); - oldStat = entityInfo->spAtk; + oldStat = entityInfo->atk[1]; oldStat1 = oldStat; - newStat = entityInfo->spAtk + increment; + newStat = entityInfo->atk[1] + increment; if (0xfe < newStat) { newStat = 0xff; } - entityInfo->spAtk = newStat; + entityInfo->atk[1] = newStat; if (oldStat1 < (u8)newStat) { sub_8041E74(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC388); @@ -568,14 +568,14 @@ void RaiseDefStatTarget(Entity * pokemon, Entity *target, s32 increment) SetMessageArgument(gFormatBuffer_Monsters[0],target,0); entityInfo = GetEntInfo(target); - oldStat = entityInfo->def; + oldStat = entityInfo->def[0]; oldStat1 = oldStat; - newStat = entityInfo->def + increment; + newStat = entityInfo->def[0] + increment; if (0xfe < newStat) { newStat = 0xff; } - entityInfo->def = newStat; + entityInfo->def[0] = newStat; if (oldStat1 < (u8)newStat) { sub_8041E84(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC3D8); @@ -598,14 +598,14 @@ void RaiseSpDefStatTarget(Entity * pokemon, Entity *target, s32 increment) SetMessageArgument(gFormatBuffer_Monsters[0],target,0); entityInfo = GetEntInfo(target); - oldStat = entityInfo->spDef; + oldStat = entityInfo->def[1]; oldStat1 = oldStat; - newStat = entityInfo->spDef + increment; + newStat = entityInfo->def[1] + increment; if (0xfe < newStat) { newStat = 0xff; } - entityInfo->spDef = newStat; + entityInfo->def[1] = newStat; if (oldStat1 < (u8)newStat) { sub_8041E94(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC428); diff --git a/src/dungeon_ai_item_weight.c b/src/dungeon_ai_item_weight.c index be795c30b..7c2a404fe 100644 --- a/src/dungeon_ai_item_weight.c +++ b/src/dungeon_ai_item_weight.c @@ -111,7 +111,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_PROTEIN: - if (pokemonInfo->atk > 249) + if (pokemonInfo->atk[0] > 249) { itemWeight = 0; } @@ -121,7 +121,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_CALCIUM: - if (pokemonInfo->spAtk > 249) + if (pokemonInfo->atk[1] > 249) { itemWeight = 0; } @@ -131,7 +131,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_IRON: - if (pokemonInfo->def > 249) + if (pokemonInfo->def[0] > 249) { itemWeight = 0; } @@ -141,7 +141,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_ZINC: - if (pokemonInfo->spDef > 249) + if (pokemonInfo->def[1] > 249) { itemWeight = 0; } diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 7c3e23925..59dda3312 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -622,7 +622,6 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move case MOVE_JUMP_KICK: sub_8059E54(attacker, currTarget, move, itemId, 1); break; - } if (sub_8044B28()) diff --git a/src/dungeon_music.c b/src/dungeon_music.c index d81f044c7..2ddedd72b 100644 --- a/src/dungeon_music.c +++ b/src/dungeon_music.c @@ -58,10 +58,10 @@ void sub_8083AB0(s16 param_0, Entity * target, Entity * entity) temp->exp = entityInfo->exp; temp->level = entityInfo->level; temp->maxHPStat = entityInfo->maxHPStat; - temp->atk = entityInfo->atk; - temp->spAtk = entityInfo->spAtk; - temp->def = entityInfo->def; - temp->spDef = entityInfo->spDef; + temp->atk = entityInfo->atk[0]; + temp->spAtk = entityInfo->atk[1]; + temp->def = entityInfo->def[0]; + temp->spDef = entityInfo->def[1]; temp->dungeonLocation = gDungeon->dungeonLocation; attackPtr = &temp->attBoost; *attackPtr = 0; diff --git a/src/trap_1.c b/src/trap_1.c index 26f7f947b..4f0357931 100644 --- a/src/trap_1.c +++ b/src/trap_1.c @@ -333,10 +333,10 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) sub_8083048(param_1,info->HP); sub_8083048(param_1,info->maxHPStat); sub_8083048(param_1,info->originalHP); - sub_8083060(param_1,info->atk); - sub_8083060(param_1,info->spAtk); - sub_8083060(param_1,info->def); - sub_8083060(param_1,info->spDef); + sub_8083060(param_1,info->atk[0]); + sub_8083060(param_1,info->atk[1]); + sub_8083060(param_1,info->def[0]); + sub_8083060(param_1,info->def[1]); sub_8083078(param_1,info->exp); sub_8083048(param_1,info->offensiveStages[0]); sub_8083048(param_1,info->offensiveStages[1]); From 5f02fed1c5a8836db169e6e2e688bcb54746471e Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Mon, 4 Nov 2024 18:48:18 -0500 Subject: [PATCH 02/48] 600 lines of math.s --- asm/math.s | 628 --------------------------------------- include/math.h | 65 +--- include/number_util.h | 6 +- src/code_800558C.c | 5 +- src/code_8073CF0.c | 8 +- src/code_809D148.c | 2 +- src/math.c | 393 ++++++++++++++++++++++-- src/number_util.c | 2 +- src/type_effectiveness.c | 66 ++-- 9 files changed, 421 insertions(+), 754 deletions(-) diff --git a/asm/math.s b/asm/math.s index 03bf69661..b74ecdb99 100644 --- a/asm/math.s +++ b/asm/math.s @@ -5,634 +5,6 @@ .text - thumb_func_start sub_800A088 -sub_800A088: - push {lr} - adds r2, r0, 0 - lsls r0, r1, 8 - str r0, [r2, 0x4] - asrs r1, 24 - str r1, [r2] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0800A0A4 - movs r0, 0x80 - negs r0, r0 - orrs r1, r0 - b _0800A0A8 -_0800A0A4: - movs r0, 0x7F - ands r1, r0 -_0800A0A8: - str r1, [r2] - pop {r0} - bx r0 - thumb_func_end sub_800A088 - - thumb_func_start sub_800A0B0 -sub_800A0B0: - push {lr} - ldr r2, [r0, 0x4] - ldr r3, [r0] - cmp r2, 0 - bne _0800A0C2 - cmp r3, 0 - bne _0800A0C2 - movs r0, 0 - b _0800A254 -_0800A0C2: - cmp r2, 0 - ble _0800A18C - cmp r3, 0 - ble _0800A124 - cmp r2, r3 - bge _0800A0F0 - asrs r1, r3, 8 - cmp r1, 0 - beq _0800A0FE - adds r0, r2, 0 - bl __divsi3 - adds r2, r0, 0 - cmp r2, 0xFF - ble _0800A0E2 - movs r2, 0xFF -_0800A0E2: - ldr r0, _0800A0EC - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - b _0800A252 - .align 2, 0 -_0800A0EC: .4byte gFastUnknownFn1Lookup -_0800A0F0: - adds r1, r2, 0 - cmp r2, 0 - bge _0800A0F8 - adds r1, 0xFF -_0800A0F8: - asrs r1, 8 - cmp r1, 0 - bne _0800A104 -_0800A0FE: - movs r0, 0x80 - lsls r0, 2 - b _0800A254 -_0800A104: - adds r0, r3, 0 - bl __divsi3 - adds r2, r0, 0 - cmp r2, 0xFF - ble _0800A112 - movs r2, 0xFF -_0800A112: - ldr r1, _0800A120 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x40 - b _0800A250 - .align 2, 0 -_0800A120: .4byte gFastUnknownFn1Lookup -_0800A124: - negs r3, r3 - cmp r2, r3 - bge _0800A158 - adds r1, r3, 0 - cmp r3, 0 - bge _0800A132 - adds r1, 0xFF -_0800A132: - asrs r1, 8 - cmp r1, 0 - beq _0800A166 - adds r0, r2, 0 - bl __divsi3 - adds r2, r0, 0 - cmp r2, 0xFF - ble _0800A146 - movs r2, 0xFF -_0800A146: - ldr r1, _0800A154 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x80 - b _0800A250 - .align 2, 0 -_0800A154: .4byte gFastUnknownFn1Lookup -_0800A158: - adds r1, r2, 0 - cmp r2, 0 - bge _0800A160 - adds r1, 0xFF -_0800A160: - asrs r1, 8 - cmp r1, 0 - bne _0800A16C -_0800A166: - movs r0, 0xC0 - lsls r0, 3 - b _0800A254 -_0800A16C: - adds r0, r3, 0 - bl __divsi3 - adds r2, r0, 0 - cmp r2, 0xFF - ble _0800A17A - movs r2, 0xFF -_0800A17A: - ldr r0, _0800A188 - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - adds r0, 0x40 - b _0800A252 - .align 2, 0 -_0800A188: .4byte gFastUnknownFn1Lookup -_0800A18C: - negs r2, r2 - cmp r3, 0 - ble _0800A1F0 - cmp r2, r3 - bge _0800A1BC - asrs r1, r3, 8 - cmp r1, 0 - beq _0800A1CA - adds r0, r2, 0 - bl __divsi3 - adds r2, r0, 0 - cmp r2, 0xFF - ble _0800A1AA - movs r2, 0xFF -_0800A1AA: - ldr r1, _0800A1B8 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 1 - b _0800A250 - .align 2, 0 -_0800A1B8: .4byte gFastUnknownFn1Lookup -_0800A1BC: - adds r1, r2, 0 - cmp r2, 0 - bge _0800A1C4 - adds r1, 0xFF -_0800A1C4: - asrs r1, 8 - cmp r1, 0 - bne _0800A1D0 -_0800A1CA: - movs r0, 0xE0 - lsls r0, 4 - b _0800A254 -_0800A1D0: - adds r0, r3, 0 - bl __divsi3 - adds r2, r0, 0 - cmp r2, 0xFF - ble _0800A1DE - movs r2, 0xFF -_0800A1DE: - ldr r0, _0800A1EC - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - adds r0, 0xC0 - b _0800A252 - .align 2, 0 -_0800A1EC: .4byte gFastUnknownFn1Lookup -_0800A1F0: - negs r3, r3 - cmp r2, r3 - bge _0800A224 - adds r1, r3, 0 - cmp r3, 0 - bge _0800A1FE - adds r1, 0xFF -_0800A1FE: - asrs r1, 8 - cmp r1, 0 - beq _0800A232 - adds r0, r2, 0 - bl __divsi3 - adds r2, r0, 0 - cmp r2, 0xFF - ble _0800A212 - movs r2, 0xFF -_0800A212: - ldr r0, _0800A220 - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - adds r0, 0x80 - b _0800A252 - .align 2, 0 -_0800A220: .4byte gFastUnknownFn1Lookup -_0800A224: - adds r0, r2, 0 - cmp r0, 0 - bge _0800A22C - adds r0, 0xFF -_0800A22C: - asrs r1, r0, 8 - cmp r1, 0 - bne _0800A238 -_0800A232: - movs r0, 0xA0 - lsls r0, 4 - b _0800A254 -_0800A238: - adds r0, r3, 0 - bl __divsi3 - adds r2, r0, 0 - cmp r2, 0xFF - ble _0800A246 - movs r2, 0xFF -_0800A246: - ldr r1, _0800A258 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, [r0] - movs r0, 0xC0 -_0800A250: - subs r0, r1 -_0800A252: - lsls r0, 4 -_0800A254: - pop {r1} - bx r1 - .align 2, 0 -_0800A258: .4byte gFastUnknownFn1Lookup - thumb_func_end sub_800A0B0 - -// invert signed lex pair - thumb_func_start sub_800A25C -sub_800A25C: - push {lr} - adds r1, r0, 0 - ldr r0, [r1] - mvns r2, r0 - str r2, [r1] - ldr r0, [r1, 0x4] - mvns r0, r0 - adds r0, 0x1 - str r0, [r1, 0x4] - cmp r0, 0 - bne _0800A276 - adds r0, r2, 0x1 - str r0, [r1] -_0800A276: - pop {r0} - bx r0 - thumb_func_end sub_800A25C - -// absolute value of signed lex pair - thumb_func_start sub_800A27C -sub_800A27C: - push {lr} - adds r1, r0, 0 - ldr r0, [r1] - cmp r0, 0 - bge _0800A29A - mvns r2, r0 - str r2, [r1] - ldr r0, [r1, 0x4] - mvns r0, r0 - adds r0, 0x1 - str r0, [r1, 0x4] - cmp r0, 0 - bne _0800A29A - adds r0, r2, 0x1 - str r0, [r1] -_0800A29A: - pop {r0} - bx r0 - thumb_func_end sub_800A27C - - thumb_func_start sub_800A2A0 -sub_800A2A0: - push {lr} - adds r1, r0, 0 - ldr r0, [r1] - cmp r0, 0 - bne _0800A2B4 - ldr r0, [r1, 0x4] - cmp r0, 0 - bne _0800A2B4 - movs r0, 0x1 - b _0800A2B6 -_0800A2B4: - movs r0, 0 -_0800A2B6: - pop {r1} - bx r1 - thumb_func_end sub_800A2A0 - - thumb_func_start sub_800A2BC -sub_800A2BC: - push {lr} - adds r2, r0, 0 - adds r3, r1, 0 - ldr r1, [r2] - ldr r0, [r3] - cmp r1, r0 - bne _0800A2D6 - ldr r1, [r2, 0x4] - ldr r0, [r3, 0x4] - cmp r1, r0 - bne _0800A2D6 - movs r0, 0x1 - b _0800A2D8 -_0800A2D6: - movs r0, 0 -_0800A2D8: - pop {r1} - bx r1 - thumb_func_end sub_800A2BC - - thumb_func_start sub_800A2DC -sub_800A2DC: - push {lr} - ldr r0, [r0] - cmp r0, 0 - blt _0800A2E8 - movs r0, 0 - b _0800A2EA -_0800A2E8: - movs r0, 0x1 -_0800A2EA: - pop {r1} - bx r1 - thumb_func_end sub_800A2DC - - thumb_func_start sub_800A2F0 -sub_800A2F0: - push {r4,r5,lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldr r4, [r3] - lsrs r1, r4, 31 - ldr r5, [r2] - cmp r5, 0 - bge _0800A304 - movs r0, 0x2 - orrs r1, r0 -_0800A304: - cmp r1, 0x1 - beq _0800A326 - cmp r1, 0x1 - ble _0800A314 - cmp r1, 0x2 - beq _0800A32A - cmp r1, 0x3 - beq _0800A32E -_0800A314: - ldr r1, [r3, 0x4] - ldr r3, [r2, 0x4] - adds r0, r4, 0 - adds r2, r5, 0 - bl u32_pair_less_than - lsls r0, 24 - lsrs r0, 24 - b _0800A346 -_0800A326: - movs r0, 0x1 - b _0800A346 -_0800A32A: - movs r0, 0 - b _0800A346 -_0800A32E: - ldr r1, [r3, 0x4] - ldr r3, [r2, 0x4] - adds r0, r4, 0 - adds r2, r5, 0 - bl u32_pair_less_than - movs r1, 0 - lsls r0, 24 - cmp r0, 0 - bne _0800A344 - movs r1, 0x1 -_0800A344: - adds r0, r1, 0 -_0800A346: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_800A2F0 - - thumb_func_start sub_800A34C -sub_800A34C: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r6, r0, 0 - ldr r0, [r1] - str r0, [sp] - ldr r0, [r1, 0x4] - str r0, [sp, 0x4] - ldr r0, [r2] - str r0, [sp, 0x8] - ldr r0, [r2, 0x4] - add r5, sp, 0x8 - str r0, [r5, 0x4] - mov r0, sp - bl sub_800A2DC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r10, r8 - adds r0, r5, 0 - bl sub_800A2DC - lsls r0, 24 - lsrs r7, r0, 24 - mov r9, r7 - mov r0, sp - bl sub_800A2A0 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0800A39A - movs r0, 0 - str r0, [r6] - b _0800A3DE -_0800A39A: - adds r0, r5, 0 - bl sub_800A2A0 - lsls r0, 24 - cmp r0, 0 - beq _0800A3AC - str r4, [r6] - str r4, [r6, 0x4] - b _0800A3E0 -_0800A3AC: - mov r0, r8 - cmp r0, 0 - beq _0800A3B8 - mov r0, sp - bl sub_800A25C -_0800A3B8: - cmp r7, 0 - beq _0800A3C2 - adds r0, r5, 0 - bl sub_800A25C -_0800A3C2: - add r4, sp, 0x10 - adds r0, r4, 0 - mov r1, sp - adds r2, r5, 0 - bl sub_800A4E4 - cmp r10, r9 - beq _0800A3D8 - adds r0, r4, 0 - bl sub_800A25C -_0800A3D8: - ldr r0, [sp, 0x10] - str r0, [r6] - ldr r0, [r4, 0x4] -_0800A3DE: - str r0, [r6, 0x4] -_0800A3E0: - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_800A34C - - thumb_func_start sub_800A3F0 -sub_800A3F0: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r6, r0, 0 - ldr r0, [r1] - str r0, [sp] - ldr r0, [r1, 0x4] - str r0, [sp, 0x4] - ldr r0, [r2] - str r0, [sp, 0x8] - ldr r0, [r2, 0x4] - add r5, sp, 0x8 - str r0, [r5, 0x4] - mov r0, sp - bl sub_800A2DC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r10, r8 - adds r0, r5, 0 - bl sub_800A2DC - lsls r0, 24 - lsrs r7, r0, 24 - mov r9, r7 - adds r0, r5, 0 - bl sub_800A2A0 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0800A448 - ldr r0, _0800A444 - str r0, [r6] - movs r0, 0x1 - negs r0, r0 - b _0800A48C - .align 2, 0 -_0800A444: .4byte 0x7fffffff -_0800A448: - mov r0, sp - bl sub_800A2A0 - lsls r0, 24 - cmp r0, 0 - beq _0800A45A - str r4, [r6] - str r4, [r6, 0x4] - b _0800A48E -_0800A45A: - mov r0, r8 - cmp r0, 0 - beq _0800A466 - mov r0, sp - bl sub_800A25C -_0800A466: - cmp r7, 0 - beq _0800A470 - adds r0, r5, 0 - bl sub_800A25C -_0800A470: - add r4, sp, 0x10 - adds r0, r4, 0 - mov r1, sp - adds r2, r5, 0 - bl sub_800A5A4 - cmp r10, r9 - beq _0800A486 - adds r0, r4, 0 - bl sub_800A25C -_0800A486: - ldr r0, [sp, 0x10] - str r0, [r6] - ldr r0, [r4, 0x4] -_0800A48C: - str r0, [r6, 0x4] -_0800A48E: - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_800A3F0 - - thumb_func_start sub_800A4A0 -sub_800A4A0: - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - ldr r0, [r5] - str r0, [sp] - ldr r0, [r5, 0x4] - str r0, [sp, 0x4] - mov r0, sp - bl sub_800A2A0 - lsls r0, 24 - cmp r0, 0 - beq _0800A4C0 - movs r0, 0 - str r0, [r5] - b _0800A4D8 -_0800A4C0: - mov r0, sp - bl sub_800A27C - add r4, sp, 0x8 - adds r0, r4, 0 - mov r1, sp - mov r2, sp - bl sub_800A4E4 - ldr r0, [sp, 0x8] - str r0, [r5] - ldr r0, [r4, 0x4] -_0800A4D8: - str r0, [r5, 0x4] - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_800A4A0 - thumb_func_start sub_800A4E4 sub_800A4E4: push {r4-r7,lr} diff --git a/include/math.h b/include/math.h index dc3b96a63..e7984eae1 100644 --- a/include/math.h +++ b/include/math.h @@ -2,6 +2,7 @@ #define GUARD_MATH_H #include "gba/types.h" +#include "number_util.h" /** * This type represents a signed 24.8 fixed-point number, where the 24 most @@ -17,19 +18,6 @@ typedef s32 s24_8; */ typedef u32 u24_8; -/** - * This function computes a value modulo 3, using a lookup table for values less - * than 0x100. - * - * @warning This function performs an invalid memory access if x < 0. - * Hopefully it's never actually used. - * - * @param[in] x The value to get modulo 3. Must be non-negative. - * - * @return The value of x modulo 3. - */ -u32 fast_mod_3(s32 x); - /** * This function computes the sine of the absolute value of `x` using a lookup * table. The period of the function is `4096`, and the range is `[-256, 256]`. @@ -52,23 +40,6 @@ s32 sin_abs_4096(s32 x); */ s32 cos_4096(s32 x); -/** - * This function lexicographically compares two pairs of u32s. - * - * @note The call signature of this might change if it makes sense to pack the - * inputs into a struct representing, say, a 64-bit unsigned integer. Doing - * so does affect the generated assembly; the current approach is the simplest - * match. - * - * @param[in] x_hi The high 32 bits of the first pair. - * @param[in] x_lo The low 32 bits of the first pair. - * @param[in] y_hi The high 32 bits of the second pair. - * @param[in] y_lo The low 32 bits of the second pair. - * - * @return `TRUE` if `x < y`, `FALSE` otherwise. - */ -bool8 u32_pair_less_than(u32 x_hi, u32 x_lo, u32 y_hi, u32 y_lo); - /** * This function multiplies two signed 24.8 fixed-point numbers. * @@ -79,35 +50,9 @@ bool8 u32_pair_less_than(u32 x_hi, u32 x_lo, u32 y_hi, u32 y_lo); */ s24_8 s24_8_mul(s24_8 x, s24_8 y); -/** - * This function divides two signed 24.8 fixed-point numbers. - * - * @param[in] x The dividend. - * @param[in] y The divisor. - * - * @returns The quotient `x/y` as a signed 24.8 fixed-point number. - */ -s32 s24_8_div(s32 x, s32 y); - -/** - * This function multiplies two unsigned 24.8 fixed-point numbers. - * - * @param[in] x The first factor. - * @param[in] y The second factor. - * - * @return The product `x*y` as an unsigned 24.8 fixed-point number. - */ -u24_8 u24_8_mul(u24_8 x, u24_8 y); - -/** - * This function divides two unsigned 24.8 fixed-point numbers. - * - * @param[in] x The first factor. - * @param[in] y The second factor. - * - * @return The quotient `x/y` as an unsigned 24.8 fixed-point number. - */ -u24_8 u24_8_div(u24_8 x, u24_8 y); - +s32 sub_8009FB8(s32 x, s32 y); +void sub_800A020(unkStruct_80943A8 *, u32); +bool8 sub_800A2A0(unkStruct_80943A8 *a); +void sub_800A34C(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b); #endif // GUARD_MATH_H diff --git a/include/number_util.h b/include/number_util.h index e3e7b4a1a..484cfda5c 100644 --- a/include/number_util.h +++ b/include/number_util.h @@ -7,7 +7,7 @@ typedef struct FixedPoint s16 unk2; } FixedPoint; -struct unkStruct_80943A8 +typedef struct unkStruct_80943A8 { s32 s0; s32 s4; @@ -19,8 +19,8 @@ FixedPoint FixedPoint_Min(FixedPoint a, FixedPoint b); FixedPoint FixedPoint_Max(FixedPoint a, FixedPoint b); FixedPoint sub_8094370(FixedPoint param_1, FixedPoint param_2); FixedPoint IntToFixedPoint(s32 a); -FixedPoint FixedPoint_SetFromUnk(struct unkStruct_80943A8* param_1); +FixedPoint FixedPoint_SetFromUnk(unkStruct_80943A8* param_1); FixedPoint FixedPoint_Div(FixedPoint a, FixedPoint b); s32 FixedPointToInt(FixedPoint a); // Always rounded up -#endif +#endif \ No newline at end of file diff --git a/src/code_800558C.c b/src/code_800558C.c index b62d47d72..0fb2ad381 100644 --- a/src/code_800558C.c +++ b/src/code_800558C.c @@ -3,6 +3,7 @@ #include "bg_palette_buffer.h" #include "code_800558C.h" #include "cpu.h" +#include "math.h" #include "sprite.h" extern u8 gUnknown_2026E38; @@ -27,10 +28,6 @@ extern const s16 gUnknown_80B816A[16 * 10]; extern const s16 gUnknown_80B82AA[16 * 10]; extern const s16 gUnknown_80B83EA[16 * 10]; -// code_8009804.s -extern s32 sin_abs_4096(s32); -extern s32 cos_4096(s32); - static void sub_800561C(struct axMapSprite *, s32, s32, const RGB *); const RGB *sub_8005674(struct axMapSprite *, s32); diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 07f3b9dae..d77590a29 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -32,6 +32,7 @@ #include "dungeon_message.h" #include "code_8077274_1.h" #include "dungeon_pokemon_attributes.h" +#include "math.h" extern bool8 sub_8044B28(void); extern void sub_8075708(Entity *entity); @@ -45,7 +46,6 @@ extern void sub_805229C(void); extern void sub_807E8F0(Entity *); extern void sub_80444F4(Entity *pokemon); extern void sub_807D148(Entity *pokemon, Entity *r1, u32 r2, Position *r3); -extern void sub_800A34C(struct unkStruct_80943A8 *, struct unkStruct_80943A8 *, const u8 *); extern void sub_80420B8(Entity *pokemon); extern void sub_8041C4C(Entity *pokemon, u32 r1); extern void sub_805E804(void); @@ -105,7 +105,7 @@ extern const s16 gUnknown_80F4F74; extern const s16 gUnknown_80F4FC2; extern const s16 gUnknown_80F4F76; extern const s16 gUnknown_80F4F36; -extern const u8 gUnknown_80F54F4[][8]; +extern unkStruct_80943A8 gUnknown_80F54F4[8]; extern const s32 gUnknown_80F60DC[]; extern const Position gUnknown_80F4D44[]; @@ -309,7 +309,7 @@ void sub_8074094(Entity *entity) } if (entityInfo->isTeamLeader) { - struct unkStruct_80943A8 sp8, sp10; + unkStruct_80943A8 sp8, sp10; FixedPoint var_38; FixedPoint bellyBefore; bool8 sound; @@ -336,7 +336,7 @@ void sub_8074094(Entity *entity) sp8.s0 = 0; sp8.s4 = 6554; - sub_800A34C(&sp10, &sp8, gUnknown_80F54F4[r4]); + sub_800A34C(&sp10, &sp8, &gUnknown_80F54F4[r4]); if (entityInfo->unk153 > 1) sp10.s4 += (gUnknown_80F60DC[entityInfo->unk153] << 0x10); entityInfo->unk153 = 0; diff --git a/src/code_809D148.c b/src/code_809D148.c index 40766ab76..4de71dd82 100644 --- a/src/code_809D148.c +++ b/src/code_809D148.c @@ -1,5 +1,6 @@ #include "global.h" #include "other_random.h" +#include "math.h" #include "memory.h" struct unkStruct_809D158 @@ -261,7 +262,6 @@ extern s32 sub_80AC448(s16 a0, struct unkStruct_809D158 *a1); extern s32 sub_80AD360(s16 a0, struct unkStruct_809D158 *a1); extern void sub_800290C(struct unkStruct_809D158 *a0, s32 a1); extern void sub_8002934(struct unkStruct_809D158 *a0, struct unkStruct_809D158 *a1, struct unkStruct_809D158 *a2, u32 a3, u32 a4); -extern s32 sub_8009FB8(s32 a0, s32 a1); extern bool8 sub_80A579C(struct unkStruct_809D158 *a0, struct unkStruct_809D158 *a1); void sub_809D25C(void) diff --git a/src/math.c b/src/math.c index 4bec769f8..701db6667 100644 --- a/src/math.c +++ b/src/math.c @@ -4,14 +4,34 @@ #include "data/math.h" -u32 fast_mod_3(s32 x) { +u24_8 u24_8_div(u24_8, u24_8); +u24_8 u24_8_mul(u24_8, u24_8); +bool8 u32_pair_less_than(u32, u32, u32, u32); + +void sub_800A5A4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); +void sub_800A4E4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); + +/** + * This function computes a value modulo 3, using a lookup table for values less + * than 0x100. + * + * @warning This function performs an invalid memory access if x < 0. + * Hopefully it's never actually used. + * + * @param[in] x The value to get modulo 3. Must be non-negative. + * + * @return The value of x modulo 3. + */ +UNUSED u32 fast_mod_3(s32 x) +{ if (x < 0x100) { return gFastMod3Lookup[x]; } return x % 3; } -s32 sin_abs_4096(s32 x) { +s32 sin_abs_4096(s32 x) +{ switch (x & 0xc00) { case 0x000: return gFastSinLookup[x & 0x3ff]; @@ -25,7 +45,8 @@ s32 sin_abs_4096(s32 x) { return 0; } -s32 cos_4096(s32 x) { +s32 cos_4096(s32 x) +{ switch (x & 0xc00) { case 0x000: return gFastSinLookup[0x3ff - (x & 0x3ff)]; @@ -39,19 +60,34 @@ s32 cos_4096(s32 x) { return 0; } -bool8 u32_pair_less_than(u32 x_hi, u32 x_lo, u32 y_hi, u32 y_lo) { - if ((u32)x_hi < (u32)y_hi) { +/** + * This function lexicographically compares two pairs of u32s. + * + * @note The call signature of this might change if it makes sense to pack the + * inputs into a struct representing, say, a 64-bit unsigned integer. Doing + * so does affect the generated assembly; the current approach is the simplest + * match. + * + * @param[in] x_hi The high 32 bits of the first pair. + * @param[in] x_lo The low 32 bits of the first pair. + * @param[in] y_hi The high 32 bits of the second pair. + * @param[in] y_lo The low 32 bits of the second pair. + * + * @return `TRUE` if `x < y`, `FALSE` otherwise. + */ +bool8 u32_pair_less_than(u32 x_hi, u32 x_lo, u32 y_hi, u32 y_lo) +{ + if (x_hi < y_hi) return TRUE; - } else if ((u32)x_hi > (u32)y_hi) { + if (x_hi > y_hi) return FALSE; - } else if (x_lo >= y_lo) { + if (x_lo >= y_lo) return FALSE; - } else { - return TRUE; - } + return TRUE; } -s24_8 s24_8_mul(s24_8 x, s24_8 y) { +s24_8 s24_8_mul(s24_8 x, s24_8 y) +{ s24_8 ret; bool8 sgn0 = x < 0; bool8 sgn1 = y < 0; @@ -76,7 +112,16 @@ s24_8 s24_8_mul(s24_8 x, s24_8 y) { return ret; } -s24_8 s24_8_div(s24_8 x, s24_8 y) { // signed division +/** + * This function divides two signed 24.8 fixed-point numbers. + * + * @param[in] x The dividend. + * @param[in] y The divisor. + * + * @returns The quotient `x/y` as a signed 24.8 fixed-point number. + */ +s24_8 s24_8_div(s24_8 x, s24_8 y) +{ s24_8 ret; bool8 sgn0 = x < 0; bool8 sgn1 = y < 0; @@ -101,7 +146,16 @@ s24_8 s24_8_div(s24_8 x, s24_8 y) { // signed division return ret; } -u24_8 u24_8_mul(u24_8 x, u24_8 y) { +/** + * This function multiplies two unsigned 24.8 fixed-point numbers. + * + * @param[in] x The first factor. + * @param[in] y The second factor. + * + * @return The product `x*y` as an unsigned 24.8 fixed-point number. + */ +u24_8 u24_8_mul(u24_8 x, u24_8 y) +{ // We need 64 bits for intermediate steps of the multiplication. u32 x_h, x_l; u32 y_h, y_l; @@ -158,6 +212,14 @@ u24_8 u24_8_mul(u24_8 x, u24_8 y) { return out_l; } +/** + * This function divides two unsigned 24.8 fixed-point numbers. + * + * @param[in] x The first factor. + * @param[in] y The second factor. + * + * @return The quotient `x/y` as an unsigned 24.8 fixed-point number. + */ u24_8 u24_8_div(u24_8 x, u24_8 y) { bool8 bVar1; @@ -174,7 +236,7 @@ u24_8 u24_8_div(u24_8 x, u24_8 y) s32 save; if (y == 0) { - return 0x7fffffff; + return INT32_MAX; } else if (x == 0) { return 0; @@ -228,7 +290,7 @@ u24_8 u24_8_div(u24_8 x, u24_8 y) return r9; } -s32 sub_8009F68(s32 x, s32 y) +UNUSED s32 sub_8009F68(s32 x, s32 y) { s32 uVar1; s32 sVar1; @@ -286,7 +348,7 @@ s32 sub_8009FB8(s32 x, s32 y) return r5; } -void sub_800A020(s32 *param_1, u32 param_2) +void sub_800A020(unkStruct_80943A8 *param_1, u32 param_2) { #ifndef NONMATCHING register u32 temp asm("r4"); @@ -295,10 +357,10 @@ void sub_800A020(s32 *param_1, u32 param_2) #endif temp = 0xffff0000; - param_1[0] = param_2 >> 0x10; - param_1[1] = param_2 << 0x10; + param_1->s0 = param_2 >> 0x10; + param_1->s4 = param_2 << 0x10; if ((param_2 & 0x8000) != 0) { - param_1[0] |= temp; + param_1->s0 |= temp; } } @@ -323,3 +385,296 @@ UNUSED u32 sub_800A068(u32 *param_1) } return uVar1; } + +void sub_800A088(u32 *a, s32 b) +{ + a[1] = b << 8; + a[0] = b >> 24; + + if (a[0] & 0x80) + a[0] |= ~0x7F; + else + a[0] &= 0x7f; +} + +s32 sub_800A0B0(unkStruct_80943A8 *a) +{ + s32 r2; + s32 r3; + s32 idx; + s32 divi; + + r2 = a->s4; + r3 = a->s0; + if (r2 == 0 && r3 == 0) + return 0; + + if (r2 > 0) { + if (r3 > 0) { + if (r2 < r3) { + divi = r3 / 256; + if (divi == 0) + return 0x200; + + idx = r2 / divi; + if (idx > 0xFF) + idx = 0xFF; + + return gFastUnknownFn1Lookup[idx] << 4; + } + else { // r2 >= r3 + divi = r2 / 256; + if (divi == 0) + return 0x200; + + idx = r3 / divi; + if (idx > 0xFF) + idx = 0xFF; + + return (0x40 - gFastUnknownFn1Lookup[idx]) << 4; + } + } + else { // r3 <= 0 + r3 = -r3; + if (r2 < r3) { + divi = r3 / 256; + if (divi == 0) + return 0x600; + + idx = r2 / divi; + if (idx > 0xFF) + idx = 0xFF; + + return (0x80 - gFastUnknownFn1Lookup[idx]) << 4; + } + else { // r2 >= r3 + divi = r2 / 256; + if (divi == 0) + return 0x600; + + idx = r3 / divi; + if (idx > 0xFF) + idx = 0xFF; + + return (gFastUnknownFn1Lookup[idx] + 0x40) << 4; + } + } + } + else { // r2 <= 0 + r2 = -r2; + if (r3 > 0) { + if (r2 < r3) { + divi = r3 / 256; + if (divi == 0) + return 0xE00; + + idx = r2 / divi; + if (idx > 0xFF) + idx = 0xFF; + + return (0x100 - gFastUnknownFn1Lookup[idx]) << 4; + } + else { // r2 >= r3 + divi = r2 / 256; + if (divi == 0) + return 0xE00; + + idx = r3 / divi; + if (idx > 0xFF) + idx = 0xFF; + + return (gFastUnknownFn1Lookup[idx] + 0xC0) << 4; + } + } + else { // r3 <= 0 + r3 = -r3; + if (r2 < r3) { + divi = r3 / 256; + if (divi == 0) + return 0xA00; + + idx = r2 / divi; + if (idx > 0xFF) + idx = 0xFF; + + return (gFastUnknownFn1Lookup[idx] + 0x80) << 4; + } + else { // r2 >= r3 + divi = r2 / 256; + if (divi == 0) + return 0xA00; + + idx = r3 / divi; + if (idx > 0xFF) + idx = 0xFF; + + return (0xC0 - gFastUnknownFn1Lookup[idx]) << 4; + } + } + } +} + +static void sub_800A25C(unkStruct_80943A8 *a) +{ + a->s0 = ~a->s0; + a->s4 = ~a->s4 + 1; + if (a->s4 == 0) { + a->s0++; + } +} + +void sub_800A27C(unkStruct_80943A8 *a) +{ + if (a->s0 < 0) { + a->s0 = ~a->s0; + a->s4 = ~a->s4 + 1; + if (a->s4 == 0) { + a->s0++; + } + } +} + +bool8 sub_800A2A0(unkStruct_80943A8 *a) +{ + if (a->s0 == 0 && a->s4 == 0) + return TRUE; + return FALSE; +} + +UNUSED bool8 F48_16_AreEqual(unkStruct_80943A8 *a, unkStruct_80943A8 *b) +{ + if (a->s0 == b->s0 && a->s4 == b->s4) + return TRUE; + return FALSE; +} + +static bool8 sub_800A2DC(unkStruct_80943A8 *a) +{ + if (a->s0 < 0) + return TRUE; + return FALSE; +} + +bool8 sub_800A2F0(unkStruct_80943A8 *a, unkStruct_80943A8 *b) +{ + s32 r1; + u32 a0; + s32 b0; + + a0 = a->s0; + r1 = a0 >> 31; + + b0 = b->s0; + if (b0 < 0) + r1 |= 2; + + switch (r1) { + case 0: + default: + return u32_pair_less_than(a0, a->s4, b0, b->s4); + case 1: + return TRUE; + case 2: + return FALSE; + case 3: + return !u32_pair_less_than(a0, a->s4, b0, b->s4); + } +} + +void sub_800A34C(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +{ + bool8 aIsNegative; + bool8 bIsNegative; + unkStruct_80943A8 aa; + unkStruct_80943A8 bb; + unkStruct_80943A8 res; + + aa.s0 = a->s0; + aa.s4 = a->s4; + bb.s0 = b->s0; + bb.s4 = b->s4; + aIsNegative = sub_800A2DC(&aa); + bIsNegative = sub_800A2DC(&bb); + + if (sub_800A2A0(&aa)) { + dst->s0 = 0; + dst->s4 = 0; + } + else if (sub_800A2A0(&bb)) { + dst->s0 = 0; + dst->s4 = 0; + } + else { + if (aIsNegative) + sub_800A25C(&aa); + + if (bIsNegative) + sub_800A25C(&bb); + + sub_800A4E4(&res, &aa, &bb); + if (aIsNegative != bIsNegative) + sub_800A25C(&res); + + dst->s0 = res.s0; + dst->s4 = res.s4; + } +} + +void sub_800A3F0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +{ + bool8 aIsNegative; + bool8 bIsNegative; + unkStruct_80943A8 aa; + unkStruct_80943A8 bb; + unkStruct_80943A8 res; + + aa.s0 = a->s0; + aa.s4 = a->s4; + bb.s0 = b->s0; + bb.s4 = b->s4; + aIsNegative = sub_800A2DC(&aa); + bIsNegative = sub_800A2DC(&bb); + + if (sub_800A2A0(&bb)) { + dst->s0 = INT32_MAX; + dst->s4 = -1; + } + else if (sub_800A2A0(&aa)) { + dst->s0 = 0; + dst->s4 = 0; + } + else { + if (aIsNegative) + sub_800A25C(&aa); + + if (bIsNegative) + sub_800A25C(&bb); + + sub_800A5A4(&res, &aa, &bb); + if (aIsNegative != bIsNegative) + sub_800A25C(&res); + + dst->s0 = res.s0; + dst->s4 = res.s4; + } +} + +void sub_800A4A0(unkStruct_80943A8 *a) +{ + unkStruct_80943A8 aa; + unkStruct_80943A8 res; + + aa.s0 = a->s0; + aa.s4 = a->s4; + + if (sub_800A2A0(&aa)) { + a->s0 = 0; + a->s4 = 0; + } + else { + sub_800A27C(&aa); + sub_800A4E4(&res, &aa, &aa); + a->s0 = res.s0; + a->s4 = res.s4; + } +} \ No newline at end of file diff --git a/src/number_util.c b/src/number_util.c index 6e693455c..185774045 100644 --- a/src/number_util.c +++ b/src/number_util.c @@ -84,7 +84,7 @@ FixedPoint IntToFixedPoint(s32 a) return p; } -FixedPoint FixedPoint_SetFromUnk(struct unkStruct_80943A8* param_1) +FixedPoint FixedPoint_SetFromUnk(unkStruct_80943A8* param_1) { FixedPoint s; diff --git a/src/type_effectiveness.c b/src/type_effectiveness.c index 5cfd3cf60..e86858dfd 100644 --- a/src/type_effectiveness.c +++ b/src/type_effectiveness.c @@ -8,37 +8,38 @@ #include "dungeon_message.h" #include "dungeon_pokemon_attributes.h" #include "dungeon_util.h" +#include "math.h" #include "status.h" #include "type_chart.h" #include "weather.h" u32 gUnknown_8106EFC[] = { 0x00, 0x00 }; -u8 gUnknown_8106F04[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 }; -u8 gUnknown_8106F0C[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00 }; -u8 gUnknown_8106F14[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00 }; -u8 gUnknown_8106F1C[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00 }; +unkStruct_80943A8 gUnknown_8106F04 = { 0x0, 0x10000 }; +unkStruct_80943A8 gUnknown_8106F0C = { 0x0, 0x20000 }; +unkStruct_80943A8 gUnknown_8106F14 = { 0x0, 0x18000 }; +unkStruct_80943A8 gUnknown_8106F1C = { 0x0, 0x8000 }; u8 gUnknown_8106F24[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x01, 0x00 }; -u8 gUnknown_8106F3C[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00}; -u8 gUnknown_8106F44[] = {0x00, 0x00, 0x00, 0x00, 0x66, 0xe6, 0x00, 0x00}; -u8 gUnknown_8106F4C[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00}; +unkStruct_80943A8 gUnknown_8106F3C = {0x0, 0x8000}; +unkStruct_80943A8 gUnknown_8106F44 = {0x0, 0xE666}; +unkStruct_80943A8 gUnknown_8106F4C = {0x0, 0x18000}; struct dumb_struct { - u8 *unk0[NUM_EFFECTIVENESS]; + unkStruct_80943A8 *unk0[NUM_EFFECTIVENESS]; }; struct dumb_struct gUnknown_8106F54 = { - gUnknown_8106F3C, // IMMUNE - gUnknown_8106F44, // RESIST - gUnknown_8106F04, // NEUTRAL - gUnknown_8106F4C, // SUPER + &gUnknown_8106F3C, // IMMUNE + &gUnknown_8106F44, // RESIST + &gUnknown_8106F04, // NEUTRAL + &gUnknown_8106F4C, // SUPER }; -u8 gUnknown_8106F64[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00}; +unkStruct_80943A8 gUnknown_8106F64 = {0x0, 0xC000}; u32 gTypeEffectivenessMultipliers[] = {0, 1, 2, 4}; @@ -63,12 +64,9 @@ extern const s32 gUnknown_80F54B4[NUM_EFFECTIVENESS][NUM_EFFECTIVENESS]; void sub_80428D8(Entity *); void sub_8042978(Entity *); void sub_804298C(Entity *); -bool8 sub_800A2A0(s32 *); -void sub_800A34C(s32 *, s32 *, const u8 *); -void sub_800A020(s32 *, u32); void sub_80428EC(Entity *); -bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct unkStruct_806D010 *param_5) +bool8 sub_806E100(unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u8 type, struct unkStruct_806D010 *param_5) { bool8 torrentFlag; bool8 overgrowFlag; @@ -94,7 +92,7 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct normalOrFightingType = FALSE; pokemonInfo = GetEntInfo(pokemon); targetInfo = GetEntInfo(target); - sub_800A020(param_1,1); + sub_800A020(param_1, 1); param_5->unkD = 0; param_5->unkE = 0; hasWonderGuard = FALSE; @@ -130,13 +128,13 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct bVar4 = TRUE; if ((param_5->effectiveness != EFFECTIVENESS_SUPER) && (bVar4 = FALSE, hasWonderGuard)) { temp = gUnknown_8106EFC[1]; - param_1[0] = gUnknown_8106EFC[0]; - param_1[1] = temp; + param_1->s0 = gUnknown_8106EFC[0]; + param_1->s4 = temp; } if (((type == TYPE_FIRE) || (type == TYPE_ICE)) && (HasAbility(target,ABILITY_THICK_FAT))) { gDungeon->unk134.unk16D = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F1C); + sub_800A34C(param_1,param_1, &gUnknown_8106F1C); } if ((type == TYPE_FIRE) && (GetFlashFireStatus(target) != FLASH_FIRE_STATUS_NONE)) { gDungeon->unk134.fill16E[0] = TRUE; @@ -159,7 +157,7 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct torrentVisualFlag = SetVisualFlags(pokemonInfo,0x80,torrentFlag); if (torrentFlag) { gDungeon->unk134.fill16E[2] = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F0C); + sub_800A34C(param_1,param_1, &gUnknown_8106F0C); } if (torrentVisualFlag) { sub_80428EC(pokemon); @@ -171,7 +169,7 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct overgrowVisualFlag = SetVisualFlags(pokemonInfo,2,overgrowFlag); if (overgrowFlag) { gDungeon->unk134.fill16E[3] = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F0C); + sub_800A34C(param_1,param_1, &gUnknown_8106F0C); } if (overgrowVisualFlag) { sub_80428D8(pokemon); @@ -183,7 +181,7 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct swarmVisualFlag = SetVisualFlags(pokemonInfo,0x10,swarmFlag); if (swarmFlag) { gDungeon->unk134.fill16E[4] = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F0C); + sub_800A34C(param_1,param_1, &gUnknown_8106F0C); } if (swarmVisualFlag) { sub_8042978(pokemon); @@ -195,7 +193,7 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct blazeVisualFlag = SetVisualFlags(pokemonInfo,0x20,blazeFlag); if (blazeFlag) { gDungeon->unk134.fill16E[5] = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F0C); + sub_800A34C(param_1,param_1, &gUnknown_8106F0C); } if (blazeVisualFlag) { sub_804298C(pokemon); @@ -204,44 +202,44 @@ bool8 sub_806E100(s32 *param_1, Entity *pokemon, Entity *target, u8 type, struct } if (!(sub_800A2A0(param_1)) && (MonsterIsType(pokemon, type))) { gDungeon->unk134.fill16E[6] = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F14); + sub_800A34C(param_1,param_1, &gUnknown_8106F14); } weather = GetApparentWeather(pokemon); if (weather == WEATHER_SUNNY) { if (type == TYPE_FIRE) { gDungeon->unk134.unk16C = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F14); + sub_800A34C(param_1,param_1, &gUnknown_8106F14); } else if (type == TYPE_WATER) { gDungeon->unk134.unk16C = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F1C); + sub_800A34C(param_1,param_1, &gUnknown_8106F1C); } } if (weather == WEATHER_RAIN) { if (type == TYPE_FIRE) { gDungeon->unk134.unk16B = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F1C); + sub_800A34C(param_1,param_1, &gUnknown_8106F1C); } else if (type == TYPE_WATER) { gDungeon->unk134.unk16B = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F14); + sub_800A34C(param_1,param_1, &gUnknown_8106F14); } } if ((weather == WEATHER_CLOUDY) && (type != TYPE_NORMAL)) { - sub_800A34C(param_1,param_1, gUnknown_8106F64); + sub_800A34C(param_1,param_1, &gUnknown_8106F64); gDungeon->unk134.unk16A = TRUE; } if (((gDungeon->weather.mudSportTurns != 0) || (weather == WEATHER_FOG)) && (type == TYPE_ELECTRIC)) { gDungeon->unk134.fill16E[7] = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F1C); + sub_800A34C(param_1,param_1, &gUnknown_8106F1C); } if ((gDungeon->weather.waterSportTurns != 0) && (type == TYPE_FIRE)) { gDungeon->unk134.fill16E[8] = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F1C); + sub_800A34C(param_1,param_1, &gUnknown_8106F1C); } if ((type == TYPE_ELECTRIC) && (pokemonInfo->charging.chargingStatus == STATUS_CHARGING)) { gDungeon->unk134.fill16E[9] = TRUE; - sub_800A34C(param_1,param_1,gUnknown_8106F0C); + sub_800A34C(param_1,param_1, &gUnknown_8106F0C); } } return bVar4; From 3dc536c92cb1fb29e49591eeebb6c56d2ca286d2 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 5 Nov 2024 10:54:24 +0100 Subject: [PATCH 03/48] sub_806F370 --- asm/code_806E8B0.s | 1160 -------------------------------------------- ld_script.txt | 1 - src/code_806E8B0.c | 220 ++++++--- 3 files changed, 163 insertions(+), 1218 deletions(-) delete mode 100644 asm/code_806E8B0.s diff --git a/asm/code_806E8B0.s b/asm/code_806E8B0.s deleted file mode 100644 index a155a5157..000000000 --- a/asm/code_806E8B0.s +++ /dev/null @@ -1,1160 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start sub_806EAF4 -sub_806EAF4: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8C - str r0, [sp, 0x70] - mov r9, r1 - adds r7, r3, 0 - ldr r0, [sp, 0xB8] - ldr r1, [sp, 0xBC] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x74] - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x78] - ldr r0, [sp, 0x70] - ldr r0, [r0, 0x70] - mov r10, r0 - mov r1, r9 - ldr r1, [r1, 0x70] - str r1, [sp, 0x7C] - adds r0, r2, 0 - bl IsTypePhysical - movs r2, 0 - str r2, [sp, 0x80] - lsls r0, 24 - cmp r0, 0 - bne _0806EB3A - movs r3, 0x1 - str r3, [sp, 0x80] -_0806EB3A: - bl sub_806F500 - mov r6, r10 - ldrb r0, [r6, 0x7] - cmp r0, 0 - bne _0806EB72 - movs r0, 0x9E - lsls r0, 1 - add r0, r10 - ldr r0, [r0] - bl FixedPointToInt - adds r1, r0, 0 - cmp r1, 0 - bne _0806EB72 - movs r0, 0x1 - ldr r2, [sp, 0xB0] - str r0, [r2] - str r1, [r2, 0x4] - movs r0, 0x2 - str r0, [r2, 0x8] - add r3, sp, 0x74 - ldrb r3, [r3] - strb r3, [r2, 0xC] - strb r1, [r2, 0xD] - strb r1, [r2, 0xE] - strb r1, [r2, 0xF] - b _0806F294 -_0806EB72: - ldr r0, _0806EBA4 - cmp r4, r0 - bne _0806EBA8 - mov r0, r9 - movs r1, 0x35 - bl HasAbility - lsls r0, 24 - cmp r0, 0 - beq _0806EBA8 - movs r0, 0x1 - ldr r6, [sp, 0xB0] - str r0, [r6] - movs r1, 0 - str r1, [r6, 0x4] - movs r0, 0x2 - str r0, [r6, 0x8] - add r0, sp, 0x74 - ldrb r0, [r0] - strb r0, [r6, 0xC] - strb r1, [r6, 0xD] - strb r1, [r6, 0xE] - strb r1, [r6, 0xF] - b _0806F294 - .align 2, 0 -_0806EBA4: .4byte 0x00000163 -_0806EBA8: - add r1, sp, 0x74 - ldrb r2, [r1] - ldr r1, [sp, 0xB0] - strb r2, [r1, 0xC] - ldr r1, _0806EDA4 - ldr r0, [r1] - movs r2, 0x9A - lsls r2, 1 - adds r0, r2 - add r3, sp, 0x74 - ldrb r3, [r3] - strb r3, [r0] - ldr r2, [r1] - movs r6, 0x9C - lsls r6, 1 - adds r0, r2, r6 - ldr r1, [sp, 0x80] - str r1, [r0] - lsls r1, 1 - mov r0, r10 - adds r0, 0x1C - adds r0, r1 - movs r3, 0 - ldrsh r4, [r0, r3] - mov r8, r1 - ldr r6, [sp, 0x78] - cmp r6, 0 - beq _0806EBF8 - ldr r0, [sp, 0x74] - cmp r0, 0x2 - bne _0806EBF8 - mov r1, r10 - movs r3, 0x28 - ldrsh r0, [r1, r3] - adds r4, r0 - ldrh r1, [r1, 0x28] - movs r6, 0xA2 - lsls r6, 1 - adds r0, r2, r6 - strh r1, [r0] -_0806EBF8: - mov r0, r10 - movs r2, 0x4 - ldrsh r1, [r0, r2] - ldr r0, _0806EDA8 - cmp r1, r0 - bne _0806EC06 - adds r4, 0x2 -_0806EC06: - movs r0, 0xD1 - lsls r0, 1 - cmp r1, r0 - bne _0806EC10 - subs r4, 0x2 -_0806EC10: - ldr r0, _0806EDAC - cmp r1, r0 - bne _0806EC18 - subs r4, 0x2 -_0806EC18: - cmp r4, 0 - bge _0806EC1E - movs r4, 0 -_0806EC1E: - cmp r4, 0x14 - ble _0806EC24 - movs r4, 0x14 -_0806EC24: - ldr r6, _0806EDA4 - ldr r0, [r6] - movs r3, 0x9F - lsls r3, 1 - adds r0, r3 - strb r4, [r0] - ldr r1, [r6] - mov r5, r10 - adds r5, 0x14 - ldr r0, [sp, 0x80] - adds r2, r5, r0 - ldrb r0, [r2] - adds r0, r7 - adds r3, 0x2 - adds r1, r3 - strh r0, [r1] - ldrb r0, [r2] - adds r0, r7 - lsls r0, 8 - ldr r2, _0806EDB0 - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - bl s24_8_mul - adds r2, r0, 0 - ldr r0, [sp, 0x80] - lsls r4, r0, 2 - mov r0, r10 - adds r0, 0x2C - adds r0, r4 - ldr r1, [r0] - adds r0, r2, 0 - bl s24_8_mul - adds r2, r0, 0 - str r5, [sp, 0x88] - cmp r2, 0 - bge _0806EC74 - adds r0, 0xFF -_0806EC74: - asrs r0, 8 - str r0, [sp, 0x8] - ldr r0, [sp, 0x7C] - adds r0, 0x20 - add r0, r8 - movs r1, 0 - ldrsh r3, [r0, r1] - ldr r2, [sp, 0x80] - cmp r2, 0 - bne _0806ECA0 - ldr r0, [sp, 0x7C] - adds r0, 0xC0 - ldrb r0, [r0] - cmp r0, 0x6 - bne _0806ECA0 - ldr r0, [r6] - movs r6, 0xBD - lsls r6, 1 - adds r1, r0, r6 - movs r0, 0x1 - strb r0, [r1] - adds r3, 0x1 -_0806ECA0: - ldr r0, [sp, 0x7C] - movs r2, 0x4 - ldrsh r1, [r0, r2] - ldr r0, _0806EDA8 - cmp r1, r0 - bne _0806ECAE - subs r3, 0x2 -_0806ECAE: - movs r0, 0xD1 - lsls r0, 1 - cmp r1, r0 - bne _0806ECB8 - adds r3, 0x2 -_0806ECB8: - ldr r0, _0806EDAC - cmp r1, r0 - bne _0806ECC0 - subs r3, 0x2 -_0806ECC0: - cmp r3, 0 - bge _0806ECC6 - movs r3, 0 -_0806ECC6: - cmp r3, 0x14 - ble _0806ECCC - movs r3, 0x14 -_0806ECCC: - ldr r5, _0806EDA4 - ldr r0, [r5] - ldr r6, _0806EDB4 - adds r0, r6 - strb r3, [r0] - ldr r2, [r5] - ldr r0, [sp, 0x7C] - adds r0, 0x16 - ldr r1, [sp, 0x80] - adds r0, r1 - ldrb r1, [r0] - adds r6, 0x3 - adds r2, r6 - strh r1, [r2] - ldrb r0, [r0] - lsls r0, 8 - ldr r2, _0806EDB8 - lsls r1, r3, 2 - adds r1, r2 - ldr r1, [r1] - bl s24_8_mul - adds r2, r0, 0 - ldr r0, [sp, 0x7C] - adds r0, 0x34 - adds r0, r4 - ldr r1, [r0] - adds r0, r2, 0 - bl s24_8_mul - cmp r0, 0 - bge _0806ED0E - adds r0, 0xFF -_0806ED0E: - asrs r0, 8 - str r0, [sp, 0xC] - movs r0, 0x64 - bl DungeonRandInt - str r0, [sp, 0x84] - ldr r0, [sp, 0x80] - cmp r0, 0 - bne _0806EDC8 - ldr r0, [sp, 0x70] - movs r1, 0x13 - bl HasHeldItem - lsls r0, 24 - cmp r0, 0 - beq _0806ED4A - ldr r2, _0806EDBC - movs r3, 0 - ldrsh r1, [r2, r3] - ldr r0, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x8] - ldr r1, [r5] - movs r6, 0xB0 - lsls r6, 1 - adds r1, r6 - ldrb r0, [r2] - ldrb r2, [r1] - adds r0, r2 - strb r0, [r1] -_0806ED4A: - ldr r0, [sp, 0x70] - movs r1, 0x2B - bl HasHeldItem - lsls r0, 24 - cmp r0, 0 - beq _0806ED74 - ldr r2, _0806EDC0 - movs r3, 0 - ldrsh r1, [r2, r3] - ldr r0, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x8] - ldr r1, [r5] - movs r6, 0xB0 - lsls r6, 1 - adds r1, r6 - ldrb r0, [r2] - ldrb r2, [r1] - adds r0, r2 - strb r0, [r1] -_0806ED74: - ldr r3, [sp, 0x78] - cmp r3, 0 - beq _0806EE4A - mov r0, r9 - movs r1, 0x1E - bl HasHeldItem - lsls r0, 24 - cmp r0, 0 - beq _0806EE4A - ldr r2, _0806EDC4 - movs r6, 0 - ldrsh r1, [r2, r6] - ldr r0, [sp, 0xC] - adds r0, r1 - str r0, [sp, 0xC] - ldr r0, [r5] - movs r3, 0xB1 - lsls r3, 1 - adds r1, r0, r3 - ldrb r0, [r2] - ldrb r6, [r1] - adds r0, r6 - b _0806EE48 - .align 2, 0 -_0806EDA4: .4byte gDungeon -_0806EDA8: .4byte 0x000001a1 -_0806EDAC: .4byte 0x000001a3 -_0806EDB0: .4byte gUnknown_80F504C -_0806EDB4: .4byte 0x0000013f -_0806EDB8: .4byte gUnknown_80F50A0 -_0806EDBC: .4byte gUnknown_810AC60 -_0806EDC0: .4byte gUnknown_810AC68 -_0806EDC4: .4byte gUnknown_810AC64 -_0806EDC8: - ldr r0, [sp, 0x78] - cmp r0, 0 - beq _0806EDF6 - mov r0, r9 - movs r1, 0x22 - bl HasHeldItem - lsls r0, 24 - cmp r0, 0 - beq _0806EDF6 - ldr r2, _0806EEF8 - movs r3, 0 - ldrsh r1, [r2, r3] - ldr r0, [sp, 0xC] - adds r0, r1 - str r0, [sp, 0xC] - ldr r0, [r5] - ldr r6, _0806EEFC - adds r1, r0, r6 - ldrb r0, [r2] - ldrb r2, [r1] - adds r0, r2 - strb r0, [r1] -_0806EDF6: - ldr r0, [sp, 0x70] - movs r1, 0x21 - bl HasHeldItem - lsls r0, 24 - cmp r0, 0 - beq _0806EE20 - ldr r2, _0806EF00 - movs r3, 0 - ldrsh r1, [r2, r3] - ldr r0, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x8] - ldr r0, _0806EF04 - ldr r0, [r0] - ldr r6, _0806EF08 - adds r1, r0, r6 - ldrb r0, [r2] - ldrb r2, [r1] - adds r0, r2 - strb r0, [r1] -_0806EE20: - ldr r0, [sp, 0x70] - movs r1, 0x2B - bl HasHeldItem - lsls r0, 24 - cmp r0, 0 - beq _0806EE4A - ldr r2, _0806EF0C - movs r3, 0 - ldrsh r1, [r2, r3] - ldr r0, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x8] - ldr r0, _0806EF04 - ldr r0, [r0] - ldr r6, _0806EF08 - adds r1, r0, r6 - ldrb r0, [r2] - ldrb r2, [r1] - adds r0, r2 -_0806EE48: - strb r0, [r1] -_0806EE4A: - ldr r0, _0806EF04 - ldr r2, [r0] - movs r3, 0xA3 - lsls r3, 1 - adds r1, r2, r3 - add r0, sp, 0x8 - ldrh r0, [r0] - strh r0, [r1] - movs r6, 0xA4 - lsls r6, 1 - adds r1, r2, r6 - add r4, sp, 0xC - ldrh r0, [r4] - strh r0, [r1] - ldr r0, [sp, 0x8] - cmp r0, 0 - bge _0806EE70 - movs r0, 0 - str r0, [sp, 0x8] -_0806EE70: - ldr r1, _0806EF10 - ldr r0, [sp, 0x8] - cmp r0, r1 - ble _0806EE7C - ldr r0, _0806EF14 - str r0, [sp, 0x8] -_0806EE7C: - movs r3, 0xA8 - lsls r3, 1 - add r3, r10 - ldrh r2, [r3] - ldr r1, _0806EF18 - adds r0, r1, 0 - ands r0, r2 - strh r0, [r3] - movs r2, 0xA7 - lsls r2, 1 - add r2, r10 - ldrh r0, [r2] - ands r1, r0 - strh r1, [r2] - str r4, [sp] - ldr r0, [sp, 0x84] - str r0, [sp, 0x4] - ldr r0, [sp, 0x70] - mov r1, r9 - ldr r2, [sp, 0x74] - add r3, sp, 0x8 - bl sub_806E8B0 - add r5, sp, 0x10 - ldr r1, [sp, 0x8] - ldr r0, [sp, 0xC] - subs r1, r0 - adds r0, r5, 0 - bl sub_800A020 - add r4, sp, 0x18 - adds r0, r4, 0 - movs r1, 0x8 - bl sub_800A020 - adds r0, r5, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_800A3F0 - mov r1, r10 - ldrb r6, [r1, 0x6] - mov r8, r5 - adds r7, r4, 0 - cmp r6, 0 - bne _0806EF20 - ldrb r1, [r1, 0x9] - adds r0, r7, 0 - bl sub_800A020 - str r6, [sp, 0x20] - ldr r0, _0806EF1C - add r2, sp, 0x20 - str r0, [r2, 0x4] - adds r0, r7, 0 - adds r1, r7, 0 - bl sub_800A34C - mov r2, r10 - ldrb r0, [r2, 0x9] - lsls r0, 1 - b _0806EF60 - .align 2, 0 -_0806EEF8: .4byte gUnknown_810AC66 -_0806EEFC: .4byte 0x00000163 -_0806EF00: .4byte gUnknown_810AC62 -_0806EF04: .4byte gDungeon -_0806EF08: .4byte 0x00000161 -_0806EF0C: .4byte gUnknown_810AC68 -_0806EF10: .4byte 0x000003e6 -_0806EF14: .4byte 0x000003e7 -_0806EF18: .4byte 0x0000feff -_0806EF1C: .4byte 0x0000aaaa -_0806EF20: - ldr r3, [sp, 0x88] - ldr r6, [sp, 0x80] - adds r0, r3, r6 - ldrb r0, [r0] - str r0, [sp, 0x28] - movs r0, 0x1 - str r0, [sp, 0x2C] - add r3, sp, 0x28 - add r0, sp, 0x2C - str r0, [sp] - ldr r0, [sp, 0x84] - str r0, [sp, 0x4] - ldr r0, [sp, 0x70] - mov r1, r9 - ldr r2, [sp, 0x74] - bl sub_806E8B0 - ldr r1, [sp, 0x28] - adds r0, r7, 0 - bl sub_800A020 - add r4, sp, 0x20 - adds r0, r4, 0 - movs r1, 0x3 - bl sub_800A020 - adds r0, r7, 0 - adds r1, r7, 0 - adds r2, r4, 0 - bl sub_800A3F0 - ldr r0, [sp, 0x28] -_0806EF60: - movs r1, 0x3 - bl __divsi3 - adds r6, r0, 0 - add r5, sp, 0x30 - adds r0, r5, 0 - mov r1, r8 - adds r2, r7, 0 - bl sub_800A6D0 - ldr r4, _0806F098 - ldr r0, [r4] - movs r1, 0xA5 - lsls r1, 1 - adds r0, r1 - movs r2, 0 - mov r8, r2 - strh r6, [r0] - adds r0, r5, 0 - bl sub_800A048 - ldr r1, [r4] - movs r3, 0xA6 - lsls r3, 1 - adds r1, r3 - strh r0, [r1] - ldr r0, [sp, 0x30] - ldr r1, [sp, 0x34] - str r0, [sp, 0x38] - str r1, [sp, 0x3C] - str r0, [sp, 0x48] - str r1, [sp, 0x4C] - add r6, sp, 0x38 - adds r0, r6, 0 - adds r1, r6, 0 - adds r2, r6, 0 - bl sub_800A34C - mov r0, r8 - str r0, [sp, 0x40] - ldr r0, _0806F09C - add r5, sp, 0x40 - str r0, [r5, 0x4] - adds r0, r6, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_800A34C - adds r0, r5, 0 - movs r1, 0x2 - bl sub_800A020 - add r4, sp, 0x48 - adds r0, r4, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_800A34C - ldr r1, [sp, 0xC] - adds r0, r5, 0 - bl sub_800A020 - adds r0, r4, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_800A6F0 - adds r0, r5, 0 - movs r1, 0xA - bl sub_800A020 - adds r0, r4, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_800A6D0 - add r5, sp, 0x50 - adds r0, r5, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_800A6D0 - ldr r4, _0806F0A0 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_800A2F0 - lsls r0, 24 - mov r8, r5 - cmp r0, 0 - beq _0806F01E - ldr r0, [r4] - ldr r1, [r4, 0x4] - str r0, [sp, 0x50] - str r1, [sp, 0x54] -_0806F01E: - ldr r4, _0806F0A4 - mov r0, r8 - adds r1, r4, 0 - bl sub_800A2F0 - lsls r0, 24 - cmp r0, 0 - beq _0806F036 - ldr r0, [r4] - ldr r1, [r4, 0x4] - str r0, [sp, 0x50] - str r1, [sp, 0x54] -_0806F036: - add r4, sp, 0x58 - ldr r1, [sp, 0xB0] - str r1, [sp] - adds r0, r4, 0 - ldr r1, [sp, 0x70] - mov r2, r9 - ldr r3, [sp, 0x74] - bl sub_806E100 - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r4, 0 - ldr r2, [sp, 0x74] - cmp r2, 0x2 - bne _0806F0BC - mov r0, r9 - bl GetFlashFireStatus - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0806F0BC - ldr r3, [sp, 0x7C] - movs r6, 0xA9 - lsls r6, 1 - adds r1, r3, r6 - ldrb r0, [r1] - cmp r0, 0 - bne _0806F0BC - ldr r0, [sp, 0x78] - cmp r0, 0 - beq _0806F118 - movs r0, 0x1 - strb r0, [r1] - ldr r0, _0806F0A8 - mov r1, r9 - movs r2, 0 - bl SetMessageArgument - cmp r4, 0x1 - bne _0806F0B0 - ldr r0, _0806F0AC - ldr r2, [r0] - ldr r0, [sp, 0x70] - mov r1, r9 - bl TryDisplayDungeonLoggableMessage3 - b _0806F0BC - .align 2, 0 -_0806F098: .4byte gDungeon -_0806F09C: .4byte 0x00000ccc -_0806F0A0: .4byte gUnknown_8106F24 -_0806F0A4: .4byte gUnknown_8106F04 -_0806F0A8: .4byte gFormatBuffer_Monsters + 0x50 -_0806F0AC: .4byte gUnknown_80FAE00 -_0806F0B0: - ldr r0, _0806F15C - ldr r2, [r0] - ldr r0, [sp, 0x70] - mov r1, r9 - bl TryDisplayDungeonLoggableMessage3 -_0806F0BC: - ldr r1, [sp, 0x78] - cmp r1, 0 - beq _0806F118 - ldr r2, [sp, 0x80] - cmp r2, 0 - bne _0806F0EE - ldr r0, [sp, 0x7C] - adds r0, 0xC4 - ldrb r4, [r0] - cmp r4, 0x1 - bne _0806F0EE - mov r0, r9 - bl sub_8041B74 - ldr r2, _0806F160 - adds r0, r7, 0 - adds r1, r7, 0 - bl sub_800A34C - ldr r0, _0806F164 - ldr r0, [r0] - movs r3, 0xB3 - lsls r3, 1 - adds r0, r3 - strb r4, [r0] -_0806F0EE: - ldr r6, [sp, 0x80] - cmp r6, 0x1 - bne _0806F118 - ldr r0, [sp, 0x7C] - adds r0, 0xC4 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0806F118 - mov r0, r9 - bl sub_8041B5C - ldr r2, _0806F160 - adds r0, r7, 0 - adds r1, r7, 0 - bl sub_800A34C - ldr r0, _0806F164 - ldr r0, [r0] - ldr r1, _0806F168 - adds r0, r1 - strb r6, [r0] -_0806F118: - mov r0, r9 - movs r1, 0xC - bl HasAbility - lsls r0, 24 - cmp r0, 0 - bne _0806F1F4 - mov r0, r9 - movs r1, 0x13 - bl HasAbility - lsls r0, 24 - cmp r0, 0 - bne _0806F1F4 - mov r3, r10 - ldrb r0, [r3, 0x6] - ldr r4, [sp, 0xAC] - cmp r0, 0 - beq _0806F140 - movs r4, 0 -_0806F140: - mov r0, r10 - adds r0, 0xDC - ldrb r0, [r0] - cmp r0, 0x4 - bne _0806F170 - ldr r4, _0806F16C - ldr r0, _0806F164 - ldr r0, [r0] - movs r6, 0xB4 - lsls r6, 1 - adds r0, r6 - movs r1, 0x1 - strb r1, [r0] - b _0806F1DA - .align 2, 0 -_0806F15C: .4byte gUnknown_80FADD8 -_0806F160: .4byte gUnknown_8106F1C -_0806F164: .4byte gDungeon -_0806F168: .4byte 0x00000167 -_0806F16C: .4byte 0x000003e7 -_0806F170: - ldr r0, [sp, 0x70] - movs r1, 0xC - bl HasHeldItem - lsls r0, 24 - cmp r0, 0 - beq _0806F194 - ldr r0, _0806F2A4 - movs r1, 0 - ldrsh r0, [r0, r1] - adds r4, r0 - ldr r0, _0806F2A8 - ldr r0, [r0] - movs r2, 0xB2 - lsls r2, 1 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] -_0806F194: - mov r0, r9 - movs r1, 0xD - bl HasHeldItem - lsls r0, 24 - cmp r0, 0 - beq _0806F1B6 - ldr r0, _0806F2A4 - movs r3, 0 - ldrsh r0, [r0, r3] - adds r4, r0 - ldr r0, _0806F2A8 - ldr r0, [r0] - ldr r6, _0806F2AC - adds r1, r0, r6 - movs r0, 0x1 - strb r0, [r1] -_0806F1B6: - cmp r5, 0 - beq _0806F1DA - ldr r0, [sp, 0x70] - movs r1, 0x1 - bl IQSkillIsEnabled - lsls r0, 24 - cmp r0, 0 - beq _0806F1DA - ldr r0, _0806F2B0 - movs r1, 0 - ldrsh r4, [r0, r1] - ldr r0, _0806F2A8 - ldr r0, [r0] - ldr r2, _0806F2B4 - adds r1, r0, r2 - movs r0, 0x1 - strb r0, [r1] -_0806F1DA: - movs r0, 0x64 - bl DungeonRandInt - cmp r0, r4 - bge _0806F1F4 - ldr r2, _0806F2B8 - adds r0, r7, 0 - adds r1, r7, 0 - bl sub_800A34C - movs r0, 0x1 - ldr r3, [sp, 0xB0] - strb r0, [r3, 0xD] -_0806F1F4: - mov r0, r8 - bl sub_800A048 - ldr r5, _0806F2A8 - ldr r1, [r5] - movs r6, 0xAA - lsls r6, 1 - adds r1, r6 - str r0, [r1] - mov r0, r8 - mov r1, r8 - adds r2, r7, 0 - bl sub_800A34C - ldr r0, [r5] - movs r1, 0xAE - lsls r1, 1 - adds r0, r1 - ldr r2, [sp, 0xB4] - str r2, [r0] - add r4, sp, 0x60 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_800A088 - mov r0, r8 - mov r1, r8 - adds r2, r4, 0 - bl sub_800A34C - mov r0, r8 - bl sub_800A048 - ldr r1, [r5] - movs r3, 0xA8 - lsls r3, 1 - adds r1, r3 - str r0, [r1] - movs r0, 0x80 - lsls r0, 7 - bl DungeonRandInt - movs r6, 0 - str r6, [sp, 0x58] - movs r1, 0xE0 - lsls r1, 8 - adds r0, r1 - str r0, [r7, 0x4] - mov r0, r8 - mov r1, r8 - adds r2, r7, 0 - bl sub_800A34C - add r4, sp, 0x68 - adds r0, r4, 0 - movs r1, 0x64 - bl sub_800A020 - adds r0, r7, 0 - adds r1, r4, 0 - adds r2, r7, 0 - bl sub_800A34C - adds r0, r7, 0 - bl sub_800A048 - ldr r1, [r5] - movs r2, 0xAC - lsls r2, 1 - adds r1, r2 - str r0, [r1] - mov r0, r8 - bl sub_800A048 - ldr r3, [sp, 0xB0] - str r0, [r3] - str r6, [r3, 0x4] - cmp r0, 0 - bne _0806F294 - strb r0, [r3, 0xD] -_0806F294: - add sp, 0x8C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_0806F2A4: .4byte gUnknown_80F4DAE -_0806F2A8: .4byte gDungeon -_0806F2AC: .4byte 0x00000165 -_0806F2B0: .4byte gUnknown_80F4DB0 -_0806F2B4: .4byte 0x00000169 -_0806F2B8: .4byte gUnknown_8106F14 - thumb_func_end sub_806EAF4 - - thumb_func_start sub_806F2BC -sub_806F2BC: - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r5, r0, 0 - mov r12, r1 - ldr r7, [sp, 0x2C] - lsls r2, 24 - lsrs r4, r2, 24 - adds r6, r3, 0 - cmp r6, 0 - bgt _0806F2D6 - movs r6, 0x1 -_0806F2D6: - ldr r0, _0806F320 - cmp r6, r0 - ble _0806F2DE - adds r6, r0, 0 -_0806F2DE: - movs r0, 0 - mov r8, r0 - strb r4, [r7, 0xC] - str r7, [sp] - add r0, sp, 0x4 - adds r1, r5, 0 - mov r2, r12 - adds r3, r4, 0 - bl sub_806E100 - add r4, sp, 0xC - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_800A020 - adds r0, r4, 0 - adds r1, r4, 0 - add r2, sp, 0x4 - bl sub_800A34C - adds r0, r4, 0 - bl sub_800A048 - str r0, [r7] - mov r0, r8 - str r0, [r7, 0x4] - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_0806F320: .4byte 0x000003e7 - thumb_func_end sub_806F2BC - - thumb_func_start DealDamageToEntity -DealDamageToEntity: - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x94 - mov r8, r0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, r3, 16 - asrs r4, 16 - add r0, sp, 0x10 - bl sub_80457DC - add r2, sp, 0x84 - str r5, [sp, 0x84] - movs r0, 0x2 - str r0, [r2, 0x8] - movs r0, 0 - strb r0, [r2, 0xC] - str r6, [r2, 0x4] - strb r0, [r2, 0xD] - strb r0, [r2, 0xE] - strb r0, [r2, 0xF] - str r0, [sp] - str r4, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - add r0, sp, 0x10 - mov r1, r8 - movs r3, 0 - bl HandleDealingDamage - add sp, 0x94 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end DealDamageToEntity - - thumb_func_start sub_806F370 -sub_806F370: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - mov r10, r0 - adds r7, r1, 0 - mov r9, r3 - ldr r0, [sp, 0x50] - ldr r1, [sp, 0x54] - ldr r3, [sp, 0x58] - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - asrs r1, 16 - mov r8, r1 - adds r5, r2, 0 - movs r0, 0x2 - str r0, [sp, 0x18] - str r3, [sp, 0x14] - add r0, sp, 0x10 - movs r1, 0 - strb r4, [r0, 0xC] - strb r1, [r0, 0xD] - strb r1, [r0, 0xE] - cmp r4, 0 - beq _0806F3FC - ldr r1, [r7, 0x70] - movs r2, 0 - lsls r0, r4, 3 - mov r3, sp - adds r3, 0x20 - str r3, [sp, 0x28] - ldr r6, _0806F408 - mov r12, r6 - adds r1, 0x5C - adds r0, r4 - lsls r3, r0, 2 - ldr r4, [sp, 0x28] -_0806F3C0: - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r3 - add r0, r12 - movs r6, 0 - ldrsh r0, [r0, r6] - stm r4!, {r0} - adds r2, 0x1 - cmp r2, 0x1 - ble _0806F3C0 - adds r0, r7, 0 - movs r1, 0x35 - bl HasAbility - lsls r0, 24 - cmp r0, 0 - beq _0806F3FC - ldr r2, _0806F40C - ldr r1, [sp, 0x28] - ldr r0, [r1, 0x4] - lsls r0, 2 - ldr r1, [sp, 0x20] - lsls r1, 4 - adds r0, r1 - adds r0, r2 - ldr r0, [r0] - cmp r0, 0x3 - beq _0806F3FC - movs r5, 0 -_0806F3FC: - str r5, [sp, 0x10] - cmp r5, 0 - bne _0806F410 - add r1, sp, 0x10 - movs r0, 0x1 - b _0806F414 - .align 2, 0 -_0806F408: .4byte gTypeEffectivenessChart -_0806F40C: .4byte gUnknown_80F54B4 -_0806F410: - add r1, sp, 0x10 - movs r0, 0 -_0806F414: - strb r0, [r1, 0xF] - mov r3, r9 - str r3, [sp] - mov r6, r8 - str r6, [sp, 0x4] - ldr r0, [sp, 0x5C] - str r0, [sp, 0x8] - ldr r0, [sp, 0x60] - str r0, [sp, 0xC] - mov r0, r10 - adds r1, r7, 0 - add r2, sp, 0x10 - movs r3, 0 - bl HandleDealingDamage - ldr r0, [sp, 0x4C] - cmp r0, 0 - beq _0806F440 - add r0, sp, 0x10 - ldrb r0, [r0, 0xF] - ldr r1, [sp, 0x4C] - strb r0, [r1] -_0806F440: - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_806F370 - - .align 2,0 diff --git a/ld_script.txt b/ld_script.txt index 77ff0e155..37b242d81 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -249,7 +249,6 @@ SECTIONS { src/code_806CD90.o(.text); src/type_effectiveness.o(.text); src/code_806E8B0.o(.text); - asm/code_806E8B0.o(.text); src/code_806FDF4.o(.text); src/status_checks.o(.text); src/dungeon_movement.o(.text); diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index 2eef6af38..ca1870596 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -145,12 +145,15 @@ extern void sub_800A34C(struct unkStruct_80943A8 *param_1, struct unkStruct_8094 extern void sub_800A6F0(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, struct unkStruct_80943A8 *param3); extern void sub_800A088(struct unkStruct_80943A8 *param_1, u32 param_2); extern u32 sub_800A048(struct unkStruct_80943A8 *param_1); -extern bool8 sub_800A2F0(const struct unkStruct_80943A8*, struct unkStruct_80943A8*); +extern bool8 sub_800A2F0(const struct unkStruct_80943A8*, const struct unkStruct_80943A8*); extern bool8 sub_806E100(struct unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u8 type, struct DamageStruct *dmgStruct); extern void sub_8041B74(Entity *pokemon); extern void sub_8041B5C(Entity *pokemon); +extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC); +extern void sub_80457DC(Entity *); extern const s32 gUnknown_80F504C[]; +extern const s32 gUnknown_80F50A0[]; extern const s16 gUnknown_810AC60; extern const s16 gUnknown_810AC68; extern const s16 gUnknown_810AC64; @@ -166,41 +169,39 @@ extern const struct unkStruct_80943A8 gUnknown_8106F14; extern const u8 *const gUnknown_80FAE00; extern const u8 *const gUnknown_80FADD8; -void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u32 critChance, struct DamageStruct *dmgStruct, u32 arg_8, u16 moveId, bool8 arg_10) +static inline void SetDamageOne(struct DamageStruct *dmgStruct, u8 moveType) +{ + dmgStruct->dmg = 1; + dmgStruct->residualDmgType = 0; + dmgStruct->typeEffectiveness = EFFECTIVENESS_NEUTRAL; + dmgStruct->type = moveType; + dmgStruct->isCrit = FALSE; + dmgStruct->unkE = 0; + dmgStruct->unkF = 0; +} + +void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s32 critChance, struct DamageStruct *dmgStruct, s32 arg8, u16 moveId, bool8 arg_10) { EntityInfo *attackerInfo = GetEntInfo(attacker); EntityInfo *targetInfo = GetEntInfo(target); - bool32 physicalMove = (IsTypePhysical(moveType) != FALSE); + s32 splitIndex = (!IsTypePhysical(moveType)) ? 1 : 0; sub_806F500(); if (!attackerInfo->isTeamLeader && FixedPointToInt(attackerInfo->belly) == 0) { - dmgStruct->dmg = 1; - dmgStruct->residualDmgType = 0; - dmgStruct->typeEffectiveness = EFFECTIVENESS_NEUTRAL; - dmgStruct->type = moveType; - dmgStruct->isCrit = FALSE; - dmgStruct->unkE = 0; - dmgStruct->unkF = 0; + SetDamageOne(dmgStruct, moveType); } else if (moveId == MOVE_REGULAR_ATTACK && HasAbility(target, ABILITY_WONDER_GUARD)) { - dmgStruct->dmg = 1; - dmgStruct->residualDmgType = 0; - dmgStruct->typeEffectiveness = EFFECTIVENESS_NEUTRAL; - dmgStruct->type = moveType; - dmgStruct->isCrit = FALSE; - dmgStruct->unkE = 0; - dmgStruct->unkF = 0; + SetDamageOne(dmgStruct, moveType); } else { s32 atkStatStage, defStatStage; - s32 atkStatCalc, defStatCalc; + s32 statCalc; s32 atkStat, defStat; s32 rand; + s32 r6; struct unkStruct_80943A8 unkSp1; struct unkStruct_80943A8 unkSp2; struct unkStruct_80943A8 unkSp3; - s32 r6; - s32 unkAtkStat2, unkDefStat2; struct unkStruct_80943A8 unkSp4; struct unkStruct_80943A8 unkSp5; struct unkStruct_80943A8 unkSp6; @@ -213,9 +214,9 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u dmgStruct->type = moveType; gDungeon->unk134.unk134 = moveType; - gDungeon->unk134.unk138 = physicalMove; + gDungeon->unk134.unk138 = splitIndex; - atkStatStage = attackerInfo->offensiveStages[physicalMove]; + atkStatStage = attackerInfo->offensiveStages[splitIndex]; if (arg_10 && moveType == TYPE_FIRE) { atkStatStage += attackerInfo->flashFireBoost; gDungeon->unk134.unk140[2] = attackerInfo->flashFireBoost; @@ -234,13 +235,13 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u if (atkStatStage > 20) atkStatStage = 20; gDungeon->unk134.unk13E[0] = atkStatStage; - gDungeon->unk134.unk140[0] = attackerInfo->atk[physicalMove] + movePower; - atkStatCalc = s24_8_mul((attackerInfo->atk[physicalMove] + movePower) * 256, gUnknown_80F504C[atkStatStage]); - atkStatCalc = s24_8_mul(atkStatCalc, attackerInfo->offensiveMultipliers[physicalMove]); - atkStat = atkStatCalc / 8; + gDungeon->unk134.unk140[0] = attackerInfo->atk[splitIndex] + movePower; + statCalc = s24_8_mul((attackerInfo->atk[splitIndex] + movePower) * 256, gUnknown_80F504C[atkStatStage]); + statCalc = s24_8_mul(statCalc, attackerInfo->offensiveMultipliers[splitIndex]); + atkStat = statCalc / 256; - defStatStage = targetInfo->defensiveStages[physicalMove]; - if (targetInfo->charging.chargingStatus == STATUS_SKULL_BASH) { + defStatStage = targetInfo->defensiveStages[splitIndex]; + if (splitIndex == 0 && targetInfo->charging.chargingStatus == STATUS_SKULL_BASH) { gDungeon->unk134.unk17A = 1; defStatStage++; } @@ -250,7 +251,7 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u if (targetInfo->apparentID == MONSTER_DEOXYS_DEFENSE) { defStatStage += 2; } - if (attackerInfo->apparentID == MONSTER_DEOXYS_SPEED) { + if (targetInfo->apparentID == MONSTER_DEOXYS_SPEED) { defStatStage -= 2; } @@ -258,13 +259,13 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u if (defStatStage > 20) defStatStage = 20; gDungeon->unk134.unk13E[1] = defStatStage; - gDungeon->unk134.unk140[1] = targetInfo->def[physicalMove]; - defStatCalc = s24_8_mul((targetInfo->def[physicalMove]) * 256, gUnknown_80F504C[defStatStage]); - defStatCalc = s24_8_mul(defStatCalc, targetInfo->defensiveMultipliers[physicalMove]); - defStat = defStatCalc / 8; + gDungeon->unk134.unk140[1] = targetInfo->def[splitIndex]; + statCalc = s24_8_mul((targetInfo->def[splitIndex]) * 256, gUnknown_80F50A0[defStatStage]); + statCalc = s24_8_mul(statCalc, targetInfo->defensiveMultipliers[splitIndex]); + defStat = statCalc / 256; rand = DungeonRandInt(100); - if (physicalMove) { + if (splitIndex == 0) { if (HasHeldItem(attacker, ITEM_POWER_BAND)) { atkStat += gUnknown_810AC60; gDungeon->unk134.unk160 += gUnknown_810AC60; @@ -304,16 +305,16 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u sub_800A020(&unkSp1, atkStat - defStat); sub_800A020(&unkSp2, 8); sub_800A3F0(&unkSp1, &unkSp1, &unkSp2); - if (attackerInfo->isNotTeamMember) { - sub_800A020(&unkSp2, attackerInfo->teamIndex); + if (!attackerInfo->isNotTeamMember) { + sub_800A020(&unkSp2, attackerInfo->level); unkSp3.s0 = 0; unkSp3.s4 = 0xAAAA; sub_800A34C(&unkSp2, &unkSp2, &unkSp3); - r6 = (attackerInfo->teamIndex * 2) / 3; + r6 = (attackerInfo->level * 2) / 3; } else { - unkAtkStat2 = attackerInfo->atk[physicalMove]; - unkDefStat2 = 1; + s32 unkAtkStat2 = attackerInfo->atk[splitIndex]; + s32 unkDefStat2 = 1; sub_806E8B0(attacker, target, moveType, &unkAtkStat2, &unkDefStat2, rand); sub_800A020(&unkSp2, unkAtkStat2); sub_800A020(&unkSp3, 3); @@ -322,7 +323,7 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u } sub_800A6D0(&unkSp4, &unkSp1, &unkSp2); gDungeon->unk134.unk140[5] = r6; - gDungeon->unk134.unk140[6] = sub_800A048(&unkSp1); + gDungeon->unk134.unk140[6] = sub_800A048(&unkSp4); unkSp5 = unkSp4; unkSp7 = unkSp4; sub_800A34C(&unkSp5, &unkSp5, &unkSp5); @@ -334,11 +335,12 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u sub_800A020(&unkSp6, defStat); sub_800A6F0(&unkSp7, &unkSp7, &unkSp6); sub_800A020(&unkSp6, 10); - sub_800A6D0(&unkSp8, &unkSp5, &unkSp6); + sub_800A6D0(&unkSp7, &unkSp7, &unkSp6); + sub_800A6D0(&unkSp8, &unkSp5, &unkSp7); if (sub_800A2F0(&gUnknown_8106F24, &unkSp8)) { unkSp8 = gUnknown_8106F24; } - if (sub_800A2F0(&gUnknown_8106F04, &unkSp8)) { + if (sub_800A2F0(&unkSp8, &gUnknown_8106F04)) { unkSp8 = gUnknown_8106F04; } r5 = sub_806E100(&unkSp9, attacker, target, moveType, dmgStruct); @@ -356,19 +358,30 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u } } } - if (arg_10 && !physicalMove && targetInfo->protection.protectionStatus == STATUS_REFLECT) { - sub_8041B74(target); - sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F1C); - gDungeon->unk134.unk166 = 1; - } - if (arg_10 && physicalMove == TRUE && targetInfo->protection.protectionStatus == STATUS_LIGHT_SCREEN) { - sub_8041B5C(target); - sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F1C); - gDungeon->unk134.unk167 = 1; + if (arg_10) { + if (splitIndex == 0 && targetInfo->protection.protectionStatus == STATUS_REFLECT) { + sub_8041B74(target); + sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F1C); + gDungeon->unk134.unk166 = 1; + } + if (splitIndex == 1 && targetInfo->protection.protectionStatus == STATUS_LIGHT_SCREEN) { + sub_8041B5C(target); + sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F1C); + gDungeon->unk134.unk167 = 1; + } } + // Check crit if (!HasAbility(target, ABILITY_BATTLE_ARMOR) && !HasAbility(target, ABILITY_SHELL_ARMOR)) { - s32 critOdds = (attackerInfo->isNotTeamMember) ? critChance : 0; + s32 critOdds; + + if (attackerInfo->isNotTeamMember) { + critOdds = 0; + } + else { + critOdds = critChance; + } + if (attackerInfo->moveStatus.moveStatus == STATUS_FOCUS_ENERGY) { critOdds = 999; gDungeon->unk134.unk168 = 1; @@ -378,12 +391,12 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u critOdds += gUnknown_80F4DAE; gDungeon->unk134.unk164 = 1; } - if (HasHeldItem(attacker, ITEM_PATSY_BAND)) { + if (HasHeldItem(target, ITEM_PATSY_BAND)) { critOdds += gUnknown_80F4DAE; gDungeon->unk134.unk165 = 1; } if (r5 && IQSkillIsEnabled(attacker, IQ_TYPE_ADVANTAGE_MASTER)) { - critOdds += gUnknown_80F4DB0; + critOdds = gUnknown_80F4DB0; gDungeon->unk134.unk169 = 1; } } @@ -395,9 +408,22 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u gDungeon->unk134.unk154 = sub_800A048(&unkSp8); sub_800A34C(&unkSp8, &unkSp8, &unkSp9); - gDungeon->unk134.unk15C = arg_8; - sub_800A088(&unkSp10, arg_8); - sub_800A34C(&unkSp8, &unkSp8, &unkSp10); + { + // Ugly hack needed to match + #ifdef NONMATCHING + s32 arg8_Match; + #else + register s32 arg8_Match asm("r2"); + #endif // NONMATCHING + + gDungeon->unk134.unk15C = arg8_Match = arg8; + ASM_MATCH_TRICK(arg8); + sub_800A088(&unkSp10, arg8_Match); + sub_800A34C(&unkSp8, &unkSp8, &unkSp10); + } + + // ALSO needed to match. unk694 chosen randomly and it worked with matching. + ASM_MATCH_TRICK(gDungeon->unk694); gDungeon->unk134.unk150 = sub_800A048(&unkSp8); { s32 rnd = DungeonRandInt(0x4000); @@ -406,8 +432,10 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u } sub_800A34C(&unkSp8, &unkSp8, &unkSp9); sub_800A020(&unkSp11, 100); + sub_800A34C(&unkSp9, &unkSp11, &unkSp9); gDungeon->unk134.unk158 = sub_800A048(&unkSp9); + dmgStruct->dmg = sub_800A048(&unkSp8); dmgStruct->residualDmgType = 0; if (dmgStruct->dmg == 0) { @@ -415,3 +443,81 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, u32 movePower, u } } } + +void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct DamageStruct *dmgStruct) +{ + struct unkStruct_80943A8 unkSp1; + struct unkStruct_80943A8 unkSp2; + s32 a2New = a2; + + if (a2New <= 0) a2New = 1; + if (a2New > 999) a2New = 999; + + dmgStruct->type = moveType; + sub_806E100(&unkSp1, attacker, target, moveType, dmgStruct); + sub_800A020(&unkSp2, a2New); + sub_800A34C(&unkSp2, &unkSp2, &unkSp1); + dmgStruct->dmg = sub_800A048(&unkSp2); + dmgStruct->residualDmgType = 0; +} + +void DealDamageToEntity(Entity *entity, s32 dmg, s32 r6, s16 r4) +{ + Entity spEntity; + struct DamageStruct dmgStruct; + s32 r4_ = r4; + + sub_80457DC(&spEntity); + dmgStruct.dmg = dmg; + dmgStruct.typeEffectiveness = EFFECTIVENESS_NEUTRAL; + dmgStruct.type = TYPE_NONE; + dmgStruct.residualDmgType = r6; + dmgStruct.isCrit = FALSE; + dmgStruct.unkE = 0; + dmgStruct.unkF = 0; + HandleDealingDamage(&spEntity, entity, &dmgStruct, FALSE, FALSE, r4_, FALSE, 0); +} + +extern const s32 gUnknown_80F54B4[NUM_EFFECTIVENESS][NUM_EFFECTIVENESS]; + +void sub_806F370(Entity *pokemon, Entity *target, s32 dmg, s32 r9, u8 *arg_0, u8 moveType, s16 arg_8, s32 arg_C, s32 arg_10, s32 arg_14) +{ + s32 i; + struct DamageStruct dmgStruct; + s32 arg_8_ = arg_8; + s32 dmgNew = dmg; + + dmgStruct.typeEffectiveness = EFFECTIVENESS_NEUTRAL; + dmgStruct.residualDmgType = arg_C; + dmgStruct.type = moveType; + dmgStruct.isCrit = FALSE; + dmgStruct.unkE = 0; + + if (moveType != TYPE_NONE) { + s32 typeEffectiveness[2]; + EntityInfo *targetInfo = GetEntInfo(target); + for (i = 0; i < 2; i++) { + s32 effectiv = gTypeEffectivenessChart[moveType][targetInfo->types[i]]; + typeEffectiveness[i] = effectiv; + } + if (HasAbility(target, ABILITY_WONDER_GUARD)) { + if (gUnknown_80F54B4[typeEffectiveness[0]][typeEffectiveness[1]] != EFFECTIVENESS_SUPER) { + dmgNew = 0; + } + } + } + + dmgStruct.dmg = dmgNew; + if (dmgNew == 0) { + dmgStruct.unkF = 1; + } + else { + dmgStruct.unkF = 0; + } + + HandleDealingDamage(pokemon, target, &dmgStruct, FALSE, r9, arg_8_, arg_10, arg_14); + if (arg_0 != NULL) { + *arg_0 = dmgStruct.unkF; + } +} +// From a9daef337faad7341869e0ce6c27408eb40637e5 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 5 Nov 2024 11:58:44 +0100 Subject: [PATCH 04/48] decompile code_806E8B0 --- src/code_806E8B0.c | 214 ++++++++++++++++++++------------------------- src/dungeon_move.c | 6 +- src/move_actions.c | 8 +- 3 files changed, 103 insertions(+), 125 deletions(-) diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index ca1870596..b69effc7b 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -21,122 +21,10 @@ #include "dungeon_items.h" #include "structs/str_damage.h" -extern u8 *gUnknown_80FEE04[]; -extern u8 *gUnknown_80FEE2C[]; -extern u8 *gUnknown_80FEE54[]; - void sub_8042940(Entity *r0); void sub_80428B0(Entity *r0); void sub_80428C4(Entity *r0); -void sub_806E8B0(Entity * pokemon, Entity * target, u8 param_3, s32 *param_4, s32 *param_5, s32 param_6) -{ - bool8 hasNegStatus_pokemon; - bool8 visFlags_pokemon_1; - bool8 visFlags_pokemon_2; - bool8 hasNegStatus_target; - bool8 visFlags_target; - s32 iVar3; - bool32 isNotEnemy; - EntityInfo * entityInfo; - EntityInfo * entityInfo_1; - s32 r7; - s32 r8; - s32 r10; - s32 sp_0x4; - s32 sp_0x8; - - r7 = 1; - r8 = 1; - sp_0x4 = 1; - sp_0x8 = 1; - r10 = IsTypePhysical(param_3) == 0; - - - if (HasAbility(pokemon, ABILITY_GUTS)) { - entityInfo = GetEntInfo(pokemon); - hasNegStatus_pokemon = HasNegativeStatus(pokemon); - visFlags_pokemon_1 = SetVisualFlags(entityInfo,1,hasNegStatus_pokemon); - if (hasNegStatus_pokemon) { - r7 = 2; - } - if (visFlags_pokemon_1) { - sub_80428B0(pokemon); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEE04); // Guts boosted its power - } - } - - if ((HasAbility(pokemon, ABILITY_HUGE_POWER)) || (HasAbility(pokemon, ABILITY_PURE_POWER))) { - entityInfo_1 = GetEntInfo(pokemon); - iVar3 = 0; - if ((param_6 < 0x21) && (!r10)) { - iVar3 = 1; - } - visFlags_pokemon_2 = SetVisualFlags(entityInfo_1,0x100,iVar3); - if (iVar3 != 0) { - r7 *= 3; - r8 <<= 1; - } - if (visFlags_pokemon_2) { - sub_80428C4(pokemon); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEE2C); // It's special ability boosted Attack - } - } - - if ((HasAbility(pokemon, ABILITY_HUSTLE)) && (!r10)) { - r7 *= 3; - r8 <<= 1; - } - - if(GetEntInfo(pokemon)->isNotTeamMember) - { - isNotEnemy = FALSE; - } - else - { - isNotEnemy = TRUE; - } - - if ((HasAbility(pokemon, ABILITY_PLUS)) && (r10 == 1) && gDungeon->minusIsActive[isNotEnemy]) { - r7 *= 15; - r8 *= 10; - } - - // ABILITY_MINUS - if ((HasAbility(pokemon, ABILITY_MINUS)) && (r10 == 1) && gDungeon->plusIsActive[isNotEnemy]) { - r7 *= 15; - r8 *= 10; - } - - if (HasAbility(target, ABILITY_INTIMIDATE) && (!r10)) { - r7 <<= 2; - r8 *= 5; - } - - if ((HasAbility(target, ABILITY_MARVEL_SCALE)) && (!r10)) { - entityInfo = GetEntInfo(target); - hasNegStatus_target = HasNegativeStatus(target); - visFlags_target = SetVisualFlags(entityInfo, 8, hasNegStatus_target); - if (hasNegStatus_target) { - sp_0x4 *= 3; - sp_0x8 <<= 1; - } - if (visFlags_target) { - sub_8042940(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEE54); // Its special ability quickened attacks! - } - } - - *param_4 *= r7; - *param_5 *= sp_0x4; - if (r8 != 1) { - *param_4 = *param_4 / r8; - } - if (sp_0x8 != 1) { - *param_5 = *param_5 / sp_0x8; - } -} - extern void sub_806F500(void); extern void sub_800A020(struct unkStruct_80943A8 *param_1, u32 param_2); extern void sub_800A3F0(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, struct unkStruct_80943A8 *); @@ -152,6 +40,7 @@ extern void sub_8041B5C(Entity *pokemon); extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC); extern void sub_80457DC(Entity *); +extern const s32 gUnknown_80F54B4[NUM_EFFECTIVENESS][NUM_EFFECTIVENESS]; extern const s32 gUnknown_80F504C[]; extern const s32 gUnknown_80F50A0[]; extern const s16 gUnknown_810AC60; @@ -168,6 +57,98 @@ extern const struct unkStruct_80943A8 gUnknown_8106F1C; extern const struct unkStruct_80943A8 gUnknown_8106F14; extern const u8 *const gUnknown_80FAE00; extern const u8 *const gUnknown_80FADD8; +extern const u8 *const gUnknown_80FEE04; +extern const u8 *const gUnknown_80FEE2C; +extern const u8 *const gUnknown_80FEE54; + +static void ApplyAtkDefStatBoosts(Entity *attacker, Entity *target, u8 moveType, s32 *atkStat, s32 *defStat, s32 rand) +{ + bool32 isNotEnemy; + s32 atkMultiplier = 1; + s32 atkDivisor = 1; + s32 defMultiplier = 1; + s32 defDivisor = 1; + s32 splitIndex = (!IsTypePhysical(moveType)) ? 1 : 0; + + if (HasAbility(attacker, ABILITY_GUTS)) { + EntityInfo *entInfo = GetEntInfo(attacker); + bool8 gutsBoost = HasNegativeStatus(attacker); + bool8 visFlags_attacker_1 = SetVisualFlags(entInfo,1,gutsBoost); + + if (gutsBoost) { + atkMultiplier = 2; + } + if (visFlags_attacker_1) { + sub_80428B0(attacker); + TryDisplayDungeonLoggableMessage3(attacker,target, gUnknown_80FEE04); // Guts boosted its power + } + } + + if ((HasAbility(attacker, ABILITY_HUGE_POWER)) || (HasAbility(attacker, ABILITY_PURE_POWER))) { + EntityInfo *entInfo = GetEntInfo(attacker); + bool32 hugePowerBoost = (rand < 33 && splitIndex == 0); + bool8 visFlags_attacker_2 = SetVisualFlags(entInfo,0x100,hugePowerBoost); + + if (hugePowerBoost) { + atkMultiplier *= 3; + atkDivisor *= 2; + } + if (visFlags_attacker_2) { + sub_80428C4(attacker); + TryDisplayDungeonLoggableMessage3(attacker,target, gUnknown_80FEE2C); // It's special ability boosted Attack + } + } + + if ((HasAbility(attacker, ABILITY_HUSTLE)) && (splitIndex == 0)) { + atkMultiplier *= 3; + atkDivisor *= 2; + } + + if (GetEntInfo(attacker)->isNotTeamMember) { + isNotEnemy = FALSE; + } + else { + isNotEnemy = TRUE; + } + + if ((HasAbility(attacker, ABILITY_PLUS)) && (splitIndex == 1) && gDungeon->minusIsActive[isNotEnemy]) { + atkMultiplier *= 15; + atkDivisor *= 10; + } + if ((HasAbility(attacker, ABILITY_MINUS)) && (splitIndex == 1) && gDungeon->plusIsActive[isNotEnemy]) { + atkMultiplier *= 15; + atkDivisor *= 10; + } + + if (HasAbility(target, ABILITY_INTIMIDATE) && (splitIndex == 0)) { + atkMultiplier *= 4; + atkDivisor *= 5; + } + + if ((HasAbility(target, ABILITY_MARVEL_SCALE)) && (splitIndex == 0)) { + EntityInfo *targetInfo = GetEntInfo(target); + bool8 hasNegStatus_target = HasNegativeStatus(target); + bool8 visFlags_target = SetVisualFlags(targetInfo, 8, hasNegStatus_target); + + if (hasNegStatus_target) { + defMultiplier *= 3; + defDivisor *= 2; + } + if (visFlags_target) { + sub_8042940(target); + TryDisplayDungeonLoggableMessage3(attacker,target, gUnknown_80FEE54); // Its special ability quickened attacks! + } + } + + *atkStat *= atkMultiplier; + *defStat *= defMultiplier; + if (atkDivisor != 1) { + *atkStat = *atkStat / atkDivisor; + } + if (defDivisor != 1) { + *defStat = *defStat / defDivisor; + } +} static inline void SetDamageOne(struct DamageStruct *dmgStruct, u8 moveType) { @@ -180,7 +161,7 @@ static inline void SetDamageOne(struct DamageStruct *dmgStruct, u8 moveType) dmgStruct->unkF = 0; } -void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s32 critChance, struct DamageStruct *dmgStruct, s32 arg8, u16 moveId, bool8 arg_10) +void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s32 critChance, struct DamageStruct *dmgStruct, s32 arg8, u16 moveId, bool8 arg_10) { EntityInfo *attackerInfo = GetEntInfo(attacker); EntityInfo *targetInfo = GetEntInfo(target); @@ -301,7 +282,7 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s attackerInfo->previousVisualFlags &= ~(0x100); attackerInfo->visualFlags &= ~(0x100); - sub_806E8B0(attacker, target, moveType, &atkStat, &defStat, rand); + ApplyAtkDefStatBoosts(attacker, target, moveType, &atkStat, &defStat, rand); sub_800A020(&unkSp1, atkStat - defStat); sub_800A020(&unkSp2, 8); sub_800A3F0(&unkSp1, &unkSp1, &unkSp2); @@ -315,7 +296,7 @@ void sub_806EAF4(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s else { s32 unkAtkStat2 = attackerInfo->atk[splitIndex]; s32 unkDefStat2 = 1; - sub_806E8B0(attacker, target, moveType, &unkAtkStat2, &unkDefStat2, rand); + ApplyAtkDefStatBoosts(attacker, target, moveType, &unkAtkStat2, &unkDefStat2, rand); sub_800A020(&unkSp2, unkAtkStat2); sub_800A020(&unkSp3, 3); sub_800A3F0(&unkSp2, &unkSp2, &unkSp3); @@ -478,8 +459,6 @@ void DealDamageToEntity(Entity *entity, s32 dmg, s32 r6, s16 r4) HandleDealingDamage(&spEntity, entity, &dmgStruct, FALSE, FALSE, r4_, FALSE, 0); } -extern const s32 gUnknown_80F54B4[NUM_EFFECTIVENESS][NUM_EFFECTIVENESS]; - void sub_806F370(Entity *pokemon, Entity *target, s32 dmg, s32 r9, u8 *arg_0, u8 moveType, s16 arg_8, s32 arg_C, s32 arg_10, s32 arg_14) { s32 i; @@ -520,4 +499,3 @@ void sub_806F370(Entity *pokemon, Entity *target, s32 dmg, s32 r9, u8 *arg_0, u8 *arg_0 = dmgStruct.unkF; } } -// diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 59dda3312..21c5ad0e7 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -42,7 +42,7 @@ extern void sub_80429C8(Entity *r0); extern u8 sub_803F428(Position *); extern bool8 sub_8045888(Entity *r0); extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC); -extern void sub_806EAF4(Entity *, Entity *, u8, u32, u32, struct DamageStruct *dmgStruct, u32, u16, u32); +extern void CalcDamage(Entity *, Entity *, u8, u32, u32, struct DamageStruct *dmgStruct, u32, u16, u32); extern s16 sub_8057600(Move *move, s32 itemID); extern void sub_803ED30(s32, Entity *r0, u8, s32); extern void sub_8042238(Entity *pokemon, Entity *target); @@ -1666,7 +1666,7 @@ s32 HandleDamagingMove(Entity *attacker, Entity *target, Move *move, s32 r9, s32 s32 movePower = GetMovePower(attacker, move); s32 critChance = GetMoveCritChance(move); - sub_806EAF4(attacker, target, moveType, movePower, critChance, &dmgStruct, r9, move->id, 1); + CalcDamage(attacker, target, moveType, movePower, critChance, &dmgStruct, r9, move->id, 1); unk = sub_8057600(move, itemId); return TryHitTarget(attacker, target, move, &dmgStruct, unk); } @@ -1678,7 +1678,7 @@ s32 sub_80556BC(Entity *attacker, Entity *target, u8 moveType, Move *move, s32 r s32 movePower = GetMovePower(attacker, move); s32 critChance = GetMoveCritChance(move); - sub_806EAF4(attacker, target, moveType, movePower, critChance, &dmgStruct, r9, move->id, 1); + CalcDamage(attacker, target, moveType, movePower, critChance, &dmgStruct, r9, move->id, 1); unk = sub_8057600(move, itemId); return TryHitTarget(attacker, target, move, &dmgStruct, unk); } diff --git a/src/move_actions.c b/src/move_actions.c index 10e706752..ebe52f36a 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -184,11 +184,11 @@ extern u8 sub_803F428(Position *pos); extern void sub_807EC28(bool8); extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); extern void sub_804652C(Entity *, Entity *, Item *, u32, Position *); -extern void sub_806EAF4(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); +extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); extern void sub_8045C28(Item *, u8 , u8); extern void sub_805A7D4(Entity *, Entity *, Item *, Position *); extern void MudWaterSportEffect(u32); -extern void sub_806EAF4(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); +extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); extern void sub_806A6E8(Entity *); extern void sub_806ABAC(Entity *, Entity *); @@ -2171,7 +2171,7 @@ bool8 sub_8059E54(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa moveType = GetMoveTypeForMonster(pokemon,move); movePower = GetMovePower(pokemon,move); moveCritChance = GetMoveCritChance(move); - sub_806EAF4(pokemon,target,moveType,movePower,moveCritChance,local_30,0x100,move->id,0); + CalcDamage(pokemon,target,moveType,movePower,moveCritChance,local_30,0x100,move->id,0); SetMessageArgument_2(gFormatBuffer_Monsters[0],GetEntInfo(pokemon),0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC7C8); local_30[0] = local_30[0] / 2; @@ -2221,7 +2221,7 @@ bool8 sub_8059FC8(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa moveType = GetMoveTypeForMonster(pokemon,move); movePower = GetMovePower(pokemon,move); moveCritChance = GetMoveCritChance(move); - sub_806EAF4(pokemon,target,moveType,movePower,moveCritChance,local_30,0x200,move->id,0); + CalcDamage(pokemon,target,moveType,movePower,moveCritChance,local_30,0x200,move->id,0); SetMessageArgument_2(gFormatBuffer_Monsters[0],GetEntInfo(pokemon),0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC7C8); local_30[0] = local_30[0] / 2; From 419ea066ded7a1454567d0b938e0abccc10e8dd9 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 5 Nov 2024 12:00:21 +0100 Subject: [PATCH 05/48] encoding --- include/structs/dungeon_entity.h | 54 ++++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 92cf0a06b..0575a7d55 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -38,9 +38,9 @@ typedef struct ActionContainer /* 0x0 */ u16 action; /* 0x2 */ u8 direction; u8 fill3; - // Additional parameter alongside actionIndex. Used for things like indicating which move a Pokémon should use from its moveset. + // Additional parameter alongside actionIndex. Used for things like indicating which move a PokĂ©mon should use from its moveset. /* 0x4 */ unkStruct_8044CC8 unk4[2]; - // Position of the target that the Pokémon wants throw an item at. + // Position of the target that the PokĂ©mon wants throw an item at. /* 0x14 */ Position itemTargetPosition; } ActionContainer; @@ -101,7 +101,7 @@ typedef struct Charging { /* 0x0 */ u8 chargingStatus; /* 0x1 */ u8 chargingStatusTurns; - /* 0x2 */ u8 chargingStatusMoveIndex; // The position of the move in the Pokémon's moveset that triggered the status. + /* 0x2 */ u8 chargingStatusMoveIndex; // The position of the move in the PokĂ©mon's moveset that triggered the status. } Charging; typedef struct Protection @@ -113,7 +113,7 @@ typedef struct Protection typedef struct Waiting { /* 0xC8 */ u8 waitingStatus; - /* 0xC9 */ bool8 enemyDecoy; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon). + /* 0xC9 */ bool8 enemyDecoy; // True if the PokĂ©mon is a decoy and a wild PokĂ©mon (i.e., not an allied PokĂ©mon). u8 unkCA; /* 0xCB */ u8 waitingStatusTurns; /* 0xCC */ u8 curseDamageCountdown; @@ -162,10 +162,10 @@ typedef struct Unk_Entity_x184 { /* 0x184 - 0x0 */ Position previousTargetMovePosition1; /* 0x188 - 0x4 */ Position32 previousTargetMovePosition2; - /* 0x190 - 0xC */ s32 lastMoveDirection; // The last direction that the Pokémon moved in. - // Number of tiles that the Pokémon moved last, multiplied by 0x100. + /* 0x190 - 0xC */ s32 lastMoveDirection; // The last direction that the PokĂ©mon moved in. + // Number of tiles that the PokĂ©mon moved last, multiplied by 0x100. /* 0x194 - 0x10*/ Position32 lastMoveIncrement; - /* 0x19C - 0x18 */ s16 walkAnimFramesLeft; // Set when the Pokémon starts moving, and counts down until the Pokémon's walk animation stops. + /* 0x19C - 0x18 */ s16 walkAnimFramesLeft; // Set when the PokĂ©mon starts moving, and counts down until the PokĂ©mon's walk animation stops. /* 0x19e - 0x1a */ u8 unk1A; } Unk_Entity_x184 ; @@ -178,14 +178,14 @@ typedef struct Moves // size: 0x208 typedef struct EntityInfo { - // This has different purposes for Pokémon, items, and traps. + // This has different purposes for PokĂ©mon, items, and traps. // Pokemon: MovementFlag // Items: ItemFlag // Traps: TrapType /* 0x0 */ u16 flags; - /* 0x2 */ s16 id; // Pokémon species or item ID. - // Everything from here on only applies to Pokémon. - /* 0x4 */ s16 apparentID; // Shows a different Pokémon when using Transform. + /* 0x2 */ s16 id; // PokĂ©mon species or item ID. + // Everything from here on only applies to PokĂ©mon. + /* 0x4 */ s16 apparentID; // Shows a different PokĂ©mon when using Transform. /* 0x6 */ bool8 isNotTeamMember; /* 0x7 */ bool8 isTeamLeader; /* 0x8 */ u8 shopkeeper; @@ -207,7 +207,7 @@ typedef struct EntityInfo /* 0x20 */ s16 defensiveStages[2]; // Index 0 is accuracy. Index 1 is evasion. /* 0x24 */ s16 hitChanceStages[2]; - // // When a Fire-type move is used on a Pokémon with Flash Fire, this value increases the power of the Pokémon's Fire-type moves. + // // When a Fire-type move is used on a PokĂ©mon with Flash Fire, this value increases the power of the PokĂ©mon's Fire-type moves. /* 0x28 */ s16 flashFireBoost; // These start at 0x1000, and are halved by certain moves like Screech to lower the corresponding stat. // Index 0 is Attack. Index 1 is Special Attack. @@ -258,32 +258,32 @@ typedef struct EntityInfo /* 0xF7 */ bool8 bossFlag; /* 0xF8 */ bool8 speedStageChanged; // Toggled when pokemon is movement speed is sped up /* 0xF9 */ u8 unkF9; - /* 0xFA */ u8 terrifiedTurns; // Doubles as a bool for whether the Pokémon is terrified. + /* 0xFA */ u8 terrifiedTurns; // Doubles as a bool for whether the PokĂ©mon is terrified. /* 0xFB */ u8 expMultiplier; // Set to true if the player makes a teammate use their held item. // This is done by going to the teammate's held item in the toolbox and selecting "Use". /* 0xFC */ bool8 useHeldItem; - /* 0xFD */ u8 perishSongTurns; // When this reaches 0, the Pokémon faints from Perish Song. Doubles as a bool for whether the Pokémon is afflicted by Perish Song. + /* 0xFD */ u8 perishSongTurns; // When this reaches 0, the PokĂ©mon faints from Perish Song. Doubles as a bool for whether the PokĂ©mon is afflicted by Perish Song. u8 unkFE; u8 unkFF; - /* 0x100 */ u8 targetingDecoy; // If the Pokémon is targeting a decoy, this indicates whether the decoy target is a team or wild Pokémon. + /* 0x100 */ u8 targetingDecoy; // If the PokĂ©mon is targeting a decoy, this indicates whether the decoy target is a team or wild PokĂ©mon. /* 0x104 */ s32 speedStage; - // The turn counter for movement speed up/down is split into five timers each. Multiple timers are used if the Pokémon is affected by multiple + // The turn counter for movement speed up/down is split into five timers each. Multiple timers are used if the PokĂ©mon is affected by multiple // speed-up/slow effects at once, like using Agility twice. /* 0x108 */ u8 speedUpCounters[NUM_SPEED_COUNTERS]; /* 0x10D */ u8 speedDownCounters[NUM_SPEED_COUNTERS]; /* 0x112 */ u8 stockpileStage; /* 0x113 */ u8 unk113; - // When non-zero, an AI Pokémon will move in a random direction every turn when it is a room. - // There is a chance of this flag being set when a wild Pokémon spawns. The chance depends on the dungeon's randomMovementChance. + // When non-zero, an AI PokĂ©mon will move in a random direction every turn when it is a room. + // There is a chance of this flag being set when a wild PokĂ©mon spawns. The chance depends on the dungeon's randomMovementChance. /* 0x114 */ u32 moveRandomly; /* 0x118 */ Moves moves; /* 0x13C */ FixedPoint belly; /* 0x140 */ FixedPoint maxBelly; - /* 0x144 */ bool8 aiNextToTarget; // True if an AI Pokémon is following another Pokémon and is already adjacent to them. - /* 0x145 */ bool8 recalculateFollow; // Used by the AI to defer a movement decision until after all other Pokémon have moved. + /* 0x144 */ bool8 aiNextToTarget; // True if an AI PokĂ©mon is following another PokĂ©mon and is already adjacent to them. + /* 0x145 */ bool8 recalculateFollow; // Used by the AI to defer a movement decision until after all other PokĂ©mon have moved. /* 0x146 */ u8 unk146; - /* 0x147 */ bool8 waiting; // True if an AI Pokémon decided to do nothing this turn. + /* 0x147 */ bool8 waiting; // True if an AI PokĂ©mon decided to do nothing this turn. /* 0x148 */ bool8 attacking; /* 0x149 */ u8 unk149; /* 0x14A */ u8 unk14A; @@ -324,13 +324,13 @@ typedef struct EntityInfo /* 0x1F4 */ s16 numMoveTiles; // Number of tiles to move in a turn. Can be greater than 1 if the user's movement speed is boosted. /* 0x1F6 */ s16 notMoving; /* 0x1F8 */ s16 unk1F8; - /* 0x1FA */ s16 mobileTurnTimer; // When a Pokémon can pass through walls in a hallway, this counts up to 200 before the Pokémon turns in a random direction. + /* 0x1FA */ s16 mobileTurnTimer; // When a PokĂ©mon can pass through walls in a hallway, this counts up to 200 before the PokĂ©mon turns in a random direction. /* 0x1FC */ u32 expGainedInTurn; // Used to accumulate experience when multiple enemies are defeated in one turn. /* 0x200 */ u32 statusIcons; u8 unk204; } EntityInfo; -// size: 0x74 | Used for Pokémon, items, and traps. +// size: 0x74 | Used for PokĂ©mon, items, and traps. typedef struct Entity { /* 0x0 */ u32 type; @@ -341,13 +341,13 @@ typedef struct Entity /* 0xC */ Position32 pixelPos; /* 0x14 */ Position32 prevPixelPos; s32 unk1C; - /* 0x20 */ bool8 isVisible; // Turned off when a Pokémon faints. + /* 0x20 */ bool8 isVisible; // Turned off when a PokĂ©mon faints. u8 fill21; u8 unk22; u8 fill23; u8 unk24; /* 0x25 */ u8 room; - // The global spawn index counter starts at 10. Each Pokémon that spawns increments the counter and + // The global spawn index counter starts at 10. Each PokĂ©mon that spawns increments the counter and // gets assigned the current counter value as its spawn index. /* 0x26 */ u16 spawnGenID; /* 0x28 */ struct axObject axObj; @@ -368,7 +368,7 @@ enum MovementFlag MOVEMENT_FLAG_SWAPPING_PLACES = 1 << 5, MOVEMENT_FLAG_WALKING = 1 << 9, MOVEMENT_FLAG_UNK_14 = 1 << 14, - MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY = 1 << 15 // Set if the Pokémon is petrified and the leader cures them by swapping places. + MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY = 1 << 15 // Set if the PokĂ©mon is petrified and the leader cures them by swapping places. }; enum AbilityEffectFlags @@ -419,7 +419,7 @@ enum ClientType enum VisualFlag { // Set if Run Away's visual effect (green smoke cloud) has been triggered on this floor. - // Prevents the effect from showing again if the Pokémon stops running away and then starts running away again. + // Prevents the effect from showing again if the PokĂ©mon stops running away and then starts running away again. VISUAL_FLAG_RUN_AWAY = 2 }; From 9ae9b85c758a0995be948c217a07f53be61c0b98 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Tue, 5 Nov 2024 07:02:02 -0500 Subject: [PATCH 06/48] register match sub_800A4E4 --- asm/math.s | 106 ----------------------------------------------------- src/math.c | 72 +++++++++++++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 107 deletions(-) diff --git a/asm/math.s b/asm/math.s index b74ecdb99..752203551 100644 --- a/asm/math.s +++ b/asm/math.s @@ -5,112 +5,6 @@ .text - thumb_func_start sub_800A4E4 -sub_800A4E4: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r0 - adds r5, r1, 0 - adds r6, r2, 0 - adds r0, r5, 0 - bl sub_800A2A0 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0800A50C - movs r0, 0 - mov r1, r8 - str r0, [r1] - str r0, [r1, 0x4] - b _0800A596 -_0800A50C: - adds r0, r6, 0 - bl sub_800A2A0 - lsls r0, 24 - cmp r0, 0 - beq _0800A520 - mov r7, r8 - str r4, [r7] - str r4, [r7, 0x4] - b _0800A596 -_0800A520: - ldr r1, [r5] - ldr r4, [r5, 0x4] - ldr r0, [r6] - mov r10, r0 - ldr r2, [r6, 0x4] - movs r6, 0 - movs r5, 0 - movs r7, 0x80 - lsls r7, 24 - mov r9, r7 - movs r0, 0x3F - mov r12, r0 -_0800A538: - adds r3, r5, 0 - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _0800A54C - adds r5, r4 - adds r6, r1 - cmp r3, r5 - bls _0800A54C - adds r6, 0x1 -_0800A54C: - lsrs r2, 1 - movs r3, 0x1 - mov r0, r10 - ands r0, r3 - cmp r0, 0 - beq _0800A55C - mov r7, r9 - orrs r2, r7 -_0800A55C: - mov r0, r10 - lsrs r0, 1 - mov r10, r0 - lsls r1, 1 - adds r0, r4, 0 - mov r7, r9 - ands r0, r7 - cmp r0, 0 - beq _0800A570 - orrs r1, r3 -_0800A570: - lsls r4, 1 - movs r0, 0x1 - negs r0, r0 - add r12, r0 - mov r7, r12 - cmp r7, 0 - bge _0800A538 - lsrs r1, r5, 15 - ands r1, r3 - lsrs r5, 16 - lsls r0, r6, 16 - orrs r5, r0 - lsrs r6, 16 - cmp r1, 0 - beq _0800A590 - adds r5, 0x1 -_0800A590: - mov r0, r8 - str r6, [r0] - str r5, [r0, 0x4] -_0800A596: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_800A4E4 - thumb_func_start sub_800A5A4 sub_800A5A4: push {r4-r7,lr} diff --git a/src/math.c b/src/math.c index 701db6667..b1cb1b217 100644 --- a/src/math.c +++ b/src/math.c @@ -9,7 +9,7 @@ u24_8 u24_8_mul(u24_8, u24_8); bool8 u32_pair_less_than(u32, u32, u32, u32); void sub_800A5A4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); -void sub_800A4E4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); +static void sub_800A4E4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); /** * This function computes a value modulo 3, using a lookup table for values less @@ -677,4 +677,74 @@ void sub_800A4A0(unkStruct_80943A8 *a) a->s0 = res.s0; a->s4 = res.s4; } +} + +// Regswap https://decomp.me/scratch/HNmlz +static void sub_800A4E4(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +{ + u32 sl; + u32 r1; + u32 r2; + u32 r3; + u32 r4; + #ifdef NONMATCHING + u32 r5; + #else + register u32 r5 asm("r5"); + #endif + u32 r6; + s32 i; + + if (sub_800A2A0(a)) { + dst->s0 = 0; + dst->s4 = 0; + } + else if (sub_800A2A0(b)) { + dst->s0 = 0; + dst->s4 = 0; + } + else { + r1 = a->s0; + r4 = a->s4; + sl = b->s0; + r2 = b->s4; + r6 = 0; + r5 = 0; + + for (i = 0; i < 64; i++) { + r3 = r5; + + if (r2 & 1) { + r5 += r4; + r6 += r1; + + if (r3 > r5) + r6++; + } + + r2 >>= 1; + + if (sl & 1) + r2 |= 0x80000000; + + sl >>= 1; + r1 <<= 1; + + if (r4 & 0x80000000) + r1 |= 1; + + r4 <<= 1; + } + + r1 = (r5 >> 15) & 1; + r5 >>= 16; + r5 |= (r6 << 16); + r6 >>= 16; + + if (r1 != 0) + r5++; + + dst->s0 = r6; + dst->s4 = r5; + } } \ No newline at end of file From e22f8ea6a853bdf2b19c5c24cf34c1caf71e2056 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Tue, 5 Nov 2024 08:26:09 -0500 Subject: [PATCH 07/48] sub_800A5A4 --- asm/math.s | 160 ------------------------------------------ include/number_util.h | 2 +- src/math.c | 150 +++++++++++++++++++++++++++++---------- 3 files changed, 113 insertions(+), 199 deletions(-) diff --git a/asm/math.s b/asm/math.s index 752203551..d6a14e917 100644 --- a/asm/math.s +++ b/asm/math.s @@ -5,166 +5,6 @@ .text - thumb_func_start sub_800A5A4 -sub_800A5A4: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - str r0, [sp] - adds r5, r1, 0 - mov r8, r2 - mov r0, r8 - bl sub_800A2A0 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0800A5D8 - ldr r0, _0800A5D4 - ldr r1, [sp] - str r0, [r1] - movs r0, 0x1 - negs r0, r0 - str r0, [r1, 0x4] - b _0800A6BE - .align 2, 0 -_0800A5D4: .4byte 0x7fffffff -_0800A5D8: - adds r0, r5, 0 - bl sub_800A2A0 - lsls r0, 24 - cmp r0, 0 - beq _0800A5EC - ldr r2, [sp] - str r4, [r2] - str r4, [r2, 0x4] - b _0800A6BE -_0800A5EC: - ldr r0, [r5] - lsls r7, r0, 16 - ldr r1, [r5, 0x4] - lsrs r0, r1, 16 - orrs r7, r0 - lsls r6, r1, 16 - movs r0, 0x80 - lsls r0, 8 - orrs r6, r0 - mov r0, r8 - ldr r0, [r0] - str r0, [sp, 0x4] - mov r1, r8 - ldr r1, [r1, 0x4] - str r1, [sp, 0x8] - movs r2, 0 - str r2, [sp, 0xC] - mov r9, r2 - movs r5, 0 - movs r4, 0 - movs r0, 0x80 - lsls r0, 24 - mov r10, r0 - movs r1, 0x1 - mov r8, r1 - movs r2, 0x3F - str r2, [sp, 0x10] -_0800A622: - lsls r5, 1 - adds r0, r4, 0 - mov r1, r10 - ands r0, r1 - cmp r0, 0 - beq _0800A632 - mov r2, r8 - orrs r5, r2 -_0800A632: - movs r1, 0x2 - negs r1, r1 - lsls r4, 1 - adds r0, r7, 0 - mov r2, r10 - ands r0, r2 - cmp r0, 0 - beq _0800A646 - mov r0, r8 - orrs r4, r0 -_0800A646: - lsls r7, 1 - adds r0, r6, 0 - mov r2, r10 - ands r0, r2 - cmp r0, 0 - beq _0800A656 - mov r0, r8 - orrs r7, r0 -_0800A656: - lsls r6, 1 - ands r6, r1 - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, [sp, 0x4] - ldr r3, [sp, 0x8] - bl u32_pair_less_than - lsls r0, 24 - cmp r0, 0 - bne _0800A680 - adds r0, r4, 0 - movs r1, 0x1 - ldr r2, [sp, 0x8] - subs r4, r2 - ldr r2, [sp, 0x4] - subs r5, r2 - cmp r0, r4 - bcs _0800A682 - subs r5, 0x1 - b _0800A682 -_0800A680: - movs r1, 0 -_0800A682: - ldr r0, [sp, 0xC] - lsls r0, 1 - str r0, [sp, 0xC] - mov r0, r9 - mov r2, r10 - ands r0, r2 - cmp r0, 0 - beq _0800A69A - ldr r0, [sp, 0xC] - mov r2, r8 - orrs r0, r2 - str r0, [sp, 0xC] -_0800A69A: - mov r0, r9 - lsls r0, 1 - mov r9, r0 - cmp r1, 0 - beq _0800A6AA - mov r1, r8 - orrs r0, r1 - mov r9, r0 -_0800A6AA: - ldr r2, [sp, 0x10] - subs r2, 0x1 - str r2, [sp, 0x10] - cmp r2, 0 - bge _0800A622 - ldr r0, [sp, 0xC] - ldr r1, [sp] - str r0, [r1] - mov r2, r9 - str r2, [r1, 0x4] -_0800A6BE: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_800A5A4 - thumb_func_start sub_800A6D0 sub_800A6D0: push {r4,lr} diff --git a/include/number_util.h b/include/number_util.h index 484cfda5c..8f85eedef 100644 --- a/include/number_util.h +++ b/include/number_util.h @@ -10,7 +10,7 @@ typedef struct FixedPoint typedef struct unkStruct_80943A8 { s32 s0; - s32 s4; + u32 s4; // sub_800A5A4 requires this to be a u32, but other funcs check if it's negative... } unkStruct_80943A8; FixedPoint FixedPoint_Add(FixedPoint a, FixedPoint b); diff --git a/src/math.c b/src/math.c index b1cb1b217..6194c4294 100644 --- a/src/math.c +++ b/src/math.c @@ -4,11 +4,11 @@ #include "data/math.h" -u24_8 u24_8_div(u24_8, u24_8); -u24_8 u24_8_mul(u24_8, u24_8); -bool8 u32_pair_less_than(u32, u32, u32, u32); +static u24_8 u24_8_div(u24_8, u24_8); +static u24_8 u24_8_mul(u24_8, u24_8); +static bool8 u32_pair_less_than(u32, u32, u32, u32); -void sub_800A5A4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); +static void sub_800A5A4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); static void sub_800A4E4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); /** @@ -75,7 +75,7 @@ s32 cos_4096(s32 x) * * @return `TRUE` if `x < y`, `FALSE` otherwise. */ -bool8 u32_pair_less_than(u32 x_hi, u32 x_lo, u32 y_hi, u32 y_lo) +static bool8 u32_pair_less_than(u32 x_hi, u32 x_lo, u32 y_hi, u32 y_lo) { if (x_hi < y_hi) return TRUE; @@ -154,7 +154,7 @@ s24_8 s24_8_div(s24_8 x, s24_8 y) * * @return The product `x*y` as an unsigned 24.8 fixed-point number. */ -u24_8 u24_8_mul(u24_8 x, u24_8 y) +static u24_8 u24_8_mul(u24_8 x, u24_8 y) { // We need 64 bits for intermediate steps of the multiplication. u32 x_h, x_l; @@ -220,7 +220,7 @@ u24_8 u24_8_mul(u24_8 x, u24_8 y) * * @return The quotient `x/y` as an unsigned 24.8 fixed-point number. */ -u24_8 u24_8_div(u24_8 x, u24_8 y) +static u24_8 u24_8_div(u24_8 x, u24_8 y) { bool8 bVar1; u32 r9; @@ -351,39 +351,40 @@ s32 sub_8009FB8(s32 x, s32 y) void sub_800A020(unkStruct_80943A8 *param_1, u32 param_2) { #ifndef NONMATCHING - register u32 temp asm("r4"); + register u32 temp asm("r4"); #else - u32 temp; + u32 temp; #endif - - temp = 0xffff0000; - param_1->s0 = param_2 >> 0x10; - param_1->s4 = param_2 << 0x10; - if ((param_2 & 0x8000) != 0) { - param_1->s0 |= temp; - } + + temp = 0xFFFF0000; + param_1->s0 = param_2 >> 16; + param_1->s4 = param_2 << 16; + + if (param_2 & 0x8000) + param_1->s0 |= temp; + } -u32 sub_800A048(u32 *param_1) +u32 sub_800A048(u32 *a) { - u32 uVar1; - - uVar1 = ((u16)param_1[0] << 0x10) | (param_1[1] >> 0x10); - if ((param_1[1] & 0x8000) != 0) { - uVar1++; - } - return uVar1; + u32 uVar1; + + uVar1 = ((u16)a[0] << 16) | (a[1] >> 16); + if (a[1] & 0x8000) + uVar1++; + + return uVar1; } -UNUSED u32 sub_800A068(u32 *param_1) +UNUSED u32 sub_800A068(u32 *a) { - u32 uVar1; - - uVar1 = ((u8)param_1[0] << 0x18) | param_1[1] >> 8; - if ((param_1[1] & 0x8000) != 0) { - uVar1++; - } - return uVar1; + u32 uVar1; + + uVar1 = ((u8)a[0] << 24) | a[1] >> 8; + if (a[1] & 0x8000) + uVar1++; + + return uVar1; } void sub_800A088(u32 *a, s32 b) @@ -518,9 +519,9 @@ static void sub_800A25C(unkStruct_80943A8 *a) { a->s0 = ~a->s0; a->s4 = ~a->s4 + 1; - if (a->s4 == 0) { + + if (a->s4 == 0) a->s0++; - } } void sub_800A27C(unkStruct_80943A8 *a) @@ -528,9 +529,9 @@ void sub_800A27C(unkStruct_80943A8 *a) if (a->s0 < 0) { a->s0 = ~a->s0; a->s4 = ~a->s4 + 1; - if (a->s4 == 0) { + + if (a->s4 == 0) a->s0++; - } } } @@ -566,7 +567,7 @@ bool8 sub_800A2F0(unkStruct_80943A8 *a, unkStruct_80943A8 *b) b0 = b->s0; if (b0 < 0) - r1 |= 2; + r1 |= 0x2; switch (r1) { case 0: @@ -637,7 +638,7 @@ void sub_800A3F0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 if (sub_800A2A0(&bb)) { dst->s0 = INT32_MAX; - dst->s4 = -1; + dst->s4 = UINT32_MAX; } else if (sub_800A2A0(&aa)) { dst->s0 = 0; @@ -747,4 +748,77 @@ static void sub_800A4E4(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ dst->s0 = r6; dst->s4 = r5; } +} + +static void sub_800A5A4(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +{ + s32 temp; + bool8 r1; + u32 r4; + u32 r5; + u32 r6; + u32 r7; + u32 r9; + s32 sp4; + u32 sp8; + u32 spC; + s32 i; + + if (sub_800A2A0(b)) { + dst->s0 = INT32_MAX; + dst->s4 = UINT32_MAX; + } + else if (sub_800A2A0(a)) { + dst->s0 = 0; + dst->s4 = 0; + } + else { + r7 = (a->s0 << 16) | (a->s4 >> 16); + r6 = (a->s4 << 16) | 0x8000; + sp4 = b->s0; + sp8 = b->s4; + spC = 0; // Effectively unused + r9 = 0; + r5 = 0; + r4 = 0; + + for (i = 0; i < 64; i++) { + r5 <<= 1; + if (r4 & 0x80000000) + r5 |= 0x1; + + r4 = (r4 << 1) & ~0x1; + if (r7 & 0x80000000) + r4 |= 0x1; + + r7 <<= 1; + if (r6 & 0x80000000) + r7 |= 0x1; + + r6 = (r6 << 1) & ~0x1; + + if (!u32_pair_less_than(r5, r4, sp4, sp8)) { + temp = r4; + r1 = TRUE; + r4 -= sp8; + r5 -= sp4; + + if (temp < r4) + r5--; + } + else + r1 = FALSE; + + spC <<= 1; + if (r9 & 0x80000000) + spC |= 0x1; + + r9 = (r9 << 1) & ~0x1; + if (r1) + r9 |= 0x1; + } + + dst->s0 = spC; + dst->s4 = r9; + } } \ No newline at end of file From 25efe1ca671ad4cb59ad6f80abd1cd263af79836 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Tue, 5 Nov 2024 09:43:47 -0500 Subject: [PATCH 08/48] Finish math.s --- asm/math.s | 251 ----------------------------- include/number_util.h | 2 +- ld_script.txt | 1 - src/ground_script_1.c | 2 +- src/math.c | 366 ++++++++++++++++++++++++++++-------------- 5 files changed, 245 insertions(+), 377 deletions(-) delete mode 100644 asm/math.s diff --git a/asm/math.s b/asm/math.s deleted file mode 100644 index d6a14e917..000000000 --- a/asm/math.s +++ /dev/null @@ -1,251 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start sub_800A6D0 -sub_800A6D0: - push {r4,lr} - adds r4, r0, 0 - ldr r3, [r1] - ldr r0, [r2] - adds r3, r0 - ldr r1, [r1, 0x4] - ldr r0, [r2, 0x4] - adds r0, r1, r0 - cmp r0, r1 - bcs _0800A6E6 - adds r3, 0x1 -_0800A6E6: - str r3, [r4] - str r0, [r4, 0x4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_800A6D0 - - thumb_func_start sub_800A6F0 -sub_800A6F0: - push {r4,lr} - adds r4, r0, 0 - ldr r3, [r1] - ldr r0, [r2] - subs r3, r0 - ldr r1, [r1, 0x4] - ldr r0, [r2, 0x4] - subs r0, r1, r0 - cmp r0, r1 - bls _0800A706 - subs r3, 0x1 -_0800A706: - str r3, [r4] - str r0, [r4, 0x4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_800A6F0 - - thumb_func_start sub_800A710 -sub_800A710: - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - mov r8, r0 - adds r6, r2, 0 - ldr r0, [r1] - str r0, [sp] - ldr r0, [r1, 0x4] - str r0, [sp, 0x4] - adds r4, r6, 0 - cmp r6, 0 - bge _0800A72C - negs r4, r6 -_0800A72C: - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0x80 - lsls r1, 9 - add r0, sp, 0x8 - str r1, [r0, 0x4] - adds r7, r0, 0 - cmp r4, 0 - beq _0800A75E - adds r5, r7, 0 -_0800A740: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0800A752 - adds r0, r5, 0 - adds r1, r5, 0 - mov r2, sp - bl sub_800A34C -_0800A752: - mov r0, sp - bl sub_800A4A0 - asrs r4, 1 - cmp r4, 0 - bne _0800A740 -_0800A75E: - cmp r6, 0 - bge _0800A776 - movs r0, 0 - str r0, [sp, 0x10] - movs r0, 0x80 - lsls r0, 9 - add r1, sp, 0x10 - str r0, [r1, 0x4] - adds r0, r7, 0 - adds r2, r7, 0 - bl sub_800A3F0 -_0800A776: - ldr r0, [sp, 0x8] - mov r1, r8 - str r0, [r1] - ldr r0, [r7, 0x4] - str r0, [r1, 0x4] - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_800A710 - - thumb_func_start sub_800A78C -sub_800A78C: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - mov r10, r0 - ldr r0, [r1] - ldr r1, [r1, 0x4] - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, [r2] - ldr r1, [r2, 0x4] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - mov r0, sp - bl sub_800A27C - add r4, sp, 0x8 - adds r0, r4, 0 - bl sub_800A27C - mov r0, sp - adds r1, r4, 0 - bl sub_800A2F0 - lsls r0, 24 - mov r8, r4 - cmp r0, 0 - beq _0800A7DC - ldr r2, [sp] - ldr r3, [sp, 0x4] - str r2, [sp, 0x10] - str r3, [sp, 0x14] - ldr r0, [sp, 0x8] - ldr r1, [sp, 0xC] - str r0, [sp] - str r1, [sp, 0x4] - str r2, [sp, 0x8] - str r3, [sp, 0xC] -_0800A7DC: - mov r0, r8 - bl sub_800A2A0 - lsls r0, 24 - cmp r0, 0 - bne _0800A878 - movs r0, 0 - mov r9, r0 - add r7, sp, 0x10 - add r6, sp, 0x18 - b _0800A800 -_0800A7F2: - mov r0, r8 - mov r1, r8 - adds r2, r7, 0 - bl sub_800A34C - movs r2, 0x1 - add r9, r2 -_0800A800: - adds r4, r7, 0 - mov r1, r8 - adds r0, r4, 0 - mov r2, sp - bl sub_800A3F0 - adds r0, r4, 0 - bl sub_800A4A0 - ldr r0, [sp, 0x10] - str r0, [sp, 0x18] - ldr r1, [r4, 0x4] - movs r0, 0x80 - lsls r0, 11 - adds r1, r0 - adds r5, r6, 0 - str r1, [r5, 0x4] - ldr r0, [r4, 0x4] - cmp r1, r0 - bcs _0800A82E - ldr r0, [sp, 0x18] - adds r0, 0x1 - str r0, [sp, 0x18] -_0800A82E: - adds r0, r4, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_800A3F0 - adds r0, r5, 0 - mov r1, sp - adds r2, r4, 0 - bl sub_800A34C - ldr r0, [sp, 0x18] - lsls r1, r0, 1 - str r1, [sp, 0x18] - ldr r0, [r5, 0x4] - cmp r0, 0 - bge _0800A854 - movs r0, 0x1 - orrs r1, r0 - str r1, [sp, 0x18] -_0800A854: - ldr r0, [r6, 0x4] - lsls r0, 1 - str r0, [r6, 0x4] - ldr r2, [sp, 0x4] - ldr r1, [sp] - ldr r0, [sp, 0x18] - adds r1, r0 - str r1, [sp] - ldr r0, [r6, 0x4] - adds r0, r2, r0 - str r0, [sp, 0x4] - cmp r2, r0 - bls _0800A872 - adds r0, r1, 0x1 - str r0, [sp] -_0800A872: - mov r2, r9 - cmp r2, 0x2 - bne _0800A7F2 -_0800A878: - ldr r0, [sp] - ldr r1, [sp, 0x4] - mov r2, r10 - str r0, [r2] - str r1, [r2, 0x4] - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_800A78C - - .align 2, 0 @ Don't pad with nop. diff --git a/include/number_util.h b/include/number_util.h index 8f85eedef..468aae34b 100644 --- a/include/number_util.h +++ b/include/number_util.h @@ -10,7 +10,7 @@ typedef struct FixedPoint typedef struct unkStruct_80943A8 { s32 s0; - u32 s4; // sub_800A5A4 requires this to be a u32, but other funcs check if it's negative... + u32 s4; // some math.c funcs require this to be a u32, but other funcs check if it's negative (aka >= INT32_MAX) } unkStruct_80943A8; FixedPoint FixedPoint_Add(FixedPoint a, FixedPoint b); diff --git a/ld_script.txt b/ld_script.txt index 77ff0e155..bac993ca0 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -69,7 +69,6 @@ SECTIONS { src/code_8009804.o(.text); asm/code_8009804.o(.text); src/math.o(.text); - asm/math.o(.text); src/file_system.o(.text); src/decompress.o(.text); src/main.o(.text); diff --git a/src/ground_script_1.c b/src/ground_script_1.c index 412efd5ea..502fad518 100644 --- a/src/ground_script_1.c +++ b/src/ground_script_1.c @@ -12,6 +12,7 @@ #include "code_8097670.h" #include "exclusive_pokemon.h" #include "items.h" +#include "math.h" #ifndef NONMATCHING #define GROUND_SCRIPT_INCOMPLETE_DECLARATIONS @@ -52,7 +53,6 @@ char sub_8002984(s32, u8); u32 VecDirection8Radial(); u32 SizedDeltaDirection4(); u8 SizedDeltaDirection8(Position32*, Position32*, Position32*, Position32*); -s32 sub_8009FB8(); bool8 sub_8021700(s32); bool8 sub_802FCF0(void); diff --git a/src/math.c b/src/math.c index 6194c4294..8ab0ee17b 100644 --- a/src/math.c +++ b/src/math.c @@ -6,7 +6,6 @@ static u24_8 u24_8_div(u24_8, u24_8); static u24_8 u24_8_mul(u24_8, u24_8); -static bool8 u32_pair_less_than(u32, u32, u32, u32); static void sub_800A5A4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); static void sub_800A4E4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); @@ -24,9 +23,9 @@ static void sub_800A4E4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_8094 */ UNUSED u32 fast_mod_3(s32 x) { - if (x < 0x100) { + if (x < 0x100) return gFastMod3Lookup[x]; - } + return x % 3; } @@ -42,6 +41,7 @@ s32 sin_abs_4096(s32 x) case 0xc00: return -gFastSinLookup[0x3ff - (x & 0x3ff)]; } + return 0; } @@ -57,6 +57,7 @@ s32 cos_4096(s32 x) case 0xc00: return gFastSinLookup[x & 0x3ff]; } + return 0; } @@ -89,26 +90,29 @@ static bool8 u32_pair_less_than(u32 x_hi, u32 x_lo, u32 y_hi, u32 y_lo) s24_8 s24_8_mul(s24_8 x, s24_8 y) { s24_8 ret; - bool8 sgn0 = x < 0; - bool8 sgn1 = y < 0; + bool8 sgn0; + bool8 sgn1; - if (x == 0) { - return 0; - } - if (y == 0) { - return 0; - } + sgn0 = x < 0; + sgn1 = y < 0; - if (sgn0) { + if (x == 0) + return 0; + + if (y == 0) + return 0; + + if (sgn0) x = -x; - } - if (sgn1) { + + if (sgn1) y = -y; - } + ret = u24_8_mul(x, y); - if (sgn0 != sgn1) { + + if (sgn0 != sgn1) ret = -ret; - } + return ret; } @@ -120,29 +124,32 @@ s24_8 s24_8_mul(s24_8 x, s24_8 y) * * @returns The quotient `x/y` as a signed 24.8 fixed-point number. */ -s24_8 s24_8_div(s24_8 x, s24_8 y) +static s24_8 s24_8_div(s24_8 x, s24_8 y) { s24_8 ret; - bool8 sgn0 = x < 0; - bool8 sgn1 = y < 0; + bool8 sgn0; + bool8 sgn1; - if (y == 0) { + sgn0 = x < 0; + sgn1 = y < 0; + + if (y == 0) return INT32_MAX; - } - if (x == 0) { - return 0; - } - if (sgn0) { + if (x == 0) + return 0; + + if (sgn0) x = -x; - } - if (sgn1) { + + if (sgn1) y = -y; - } + ret = u24_8_div(x, y); - if (sgn0 != sgn1) { + + if (sgn0 != sgn1) ret = -ret; - } + return ret; } @@ -165,9 +172,8 @@ static u24_8 u24_8_mul(u24_8 x, u24_8 y) u32 high_bit_mask; u32 round_up; - if (x == 0 || y == 0) { + if (x == 0 || y == 0) return 0; - } x_h = 0; x_l = x; @@ -175,35 +181,36 @@ static u24_8 u24_8_mul(u24_8 x, u24_8 y) y_l = y; out_h = 0; out_l = 0; - high_bit_mask = 0x80 << 0x18; // high bit of u32 + high_bit_mask = 0x80 << 24; // high bit of u32 for (i = 0; i < 64; ++i) { u32 prev_out_l = out_l; u32 y_bit = 1; y_bit &= y_l; + if (y_bit) { out_l += x_l; out_h += x_h; - if (prev_out_l > out_l) { + + if (prev_out_l > out_l) ++out_h; - } } y_l >>= 1; - if (y_h & 1) { + if (y_h & 1) y_l |= high_bit_mask; - } + y_h >>= 1; x_h <<= 1; - if (x_l & high_bit_mask) { + if (x_l & high_bit_mask) x_h |= 1; - } - do {x_l <<= 1;} while(0); // wtf moment + + do {x_l <<= 1;} while(0); // Fakematch? } - round_up = (out_l >> 0x7) & 1; - out_l = (out_l >> 0x8) | (out_h << 0x18); + round_up = (out_l >> 7) & 1; + out_l = (out_l >> 8) | (out_h << 24); if (round_up) { ++out_l; @@ -222,27 +229,25 @@ static u24_8 u24_8_mul(u24_8 x, u24_8 y) */ static u24_8 u24_8_div(u24_8 x, u24_8 y) { - bool8 bVar1; - u32 r9; - u32 r2; - u32 r4; - u32 r5; - u32 r6; - u32 r7; - u32 r8; - int counter; - s32 sl; - s32 flag; - s32 save; - - if (y == 0) { - return INT32_MAX; - } - else if (x == 0) { - return 0; - } - else { - r7 = x >> 0x18; + bool8 bVar1; + u32 r9; + u32 r2; + u32 r4; + u32 r5; + u32 r6; + u32 r7; + u32 r8; + s32 i; + s32 sl; + s32 temp; + + if (y == 0) + return INT32_MAX; + + if (x == 0) + return 0; + + r7 = x >> 24; r6 = x << 8; sl = y; r9 = 0; @@ -251,43 +256,38 @@ static u24_8 u24_8_div(u24_8 x, u24_8 y) r2 = 0; r8 = 1; - - for(counter = 0x3f; counter >= 0; counter--) - { - r5 <<= 1; - if ((r4 & 0x80000000) != 0) { - r5 |= r8; - } - flag = -2; - r4 <<= 1; - if ((r7 & 0x80000000) != 0) { - r4 |= r8; - } - r7 <<= 1; - if ((r6 & 0x80000000) != 0) { - r7 |= r8; - } - r6 <<= 1; - r6 &= flag; - if (u32_pair_less_than(r5,r4,0,sl) == 0) { - save = r4; - bVar1 = 1; - r4 = r4 - sl; - r5 = r5 - r2; // WHY???? - if (save < r4) { - r5--; + for (i = 0; i < 64; i++) { + r5 <<= 1; + if (r4 & 0x80000000) + r5 |= r8; + + r4 = (r4 << 1) & ~0x1; + if (r7 & 0x80000000) + r4 |= r8; + + r7 <<= 1; + if (r6 & 0x80000000) + r7 |= r8; + + r6 = (r6 << 1) & ~0x1; + + if (!u32_pair_less_than(r5, r4, 0, sl)) { + temp = r4; + bVar1 = TRUE; + r4 -= sl; + r5 -= r2; + if (temp < r4) + r5--; } - } - else { - bVar1 = 0; - } - r9 <<= 1; - if (bVar1) { - r9 |= r8; - } + else + bVar1 = FALSE; + + r9 <<= 1; + if (bVar1) + r9 |= r8; } - } - return r9; + + return r9; } UNUSED s32 sub_8009F68(s32 x, s32 y) @@ -296,55 +296,56 @@ UNUSED s32 sub_8009F68(s32 x, s32 y) s32 sVar1; uVar1 = y; - if (y < 0) { - uVar1 = -y; - } + if (uVar1 < 0) + uVar1 = -uVar1; + sVar1 = 0x100; + for (; uVar1 != 0; uVar1 >>= 1) { - if ((uVar1 & 1) != 0) { + if (uVar1 & 1) sVar1 = s24_8_mul(sVar1, x); - } + x = s24_8_mul(x, x); } - if (y >= 0) { + + if (y >= 0) return sVar1; - } - else - return s24_8_div(0x100,sVar1); + + return s24_8_div(0x100, sVar1); } s32 sub_8009FB8(s32 x, s32 y) { s32 r4; - s32 counter; - + s32 i; s32 r5; s32 r6; r5 = x; r6 = y; - if (r5 < 0) { + if (r5 < 0) r5 = -r5; - } - if (r6 < 0) { + + if (r6 < 0) r6 = -r6; - } + if (r5 < r6) { r4 = r5; r5 = r6; r6 = r4; } + if (r6 != 0) { - for(counter = 2; counter >= 0; counter--) - { - r4 = s24_8_div(r6,r5); - r4 = s24_8_mul(r4,r4); - r4 = s24_8_div(r4,r4 + 0x400); - r5 = r5 + s24_8_mul(r5,r4) * 2; - r6 = s24_8_mul(r6,r4); + for (i = 2; i >= 0; i--) { + r4 = s24_8_div(r6, r5); + r4 = s24_8_mul(r4, r4); + r4 = s24_8_div(r4, r4 + 0x400); + r5 += s24_8_mul(r5, r4) * 2; + r6 = s24_8_mul(r6, r4); } } + return r5; } @@ -524,7 +525,7 @@ static void sub_800A25C(unkStruct_80943A8 *a) a->s0++; } -void sub_800A27C(unkStruct_80943A8 *a) +static void sub_800A27C(unkStruct_80943A8 *a) { if (a->s0 < 0) { a->s0 = ~a->s0; @@ -660,7 +661,7 @@ void sub_800A3F0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 } } -void sub_800A4A0(unkStruct_80943A8 *a) +static void sub_800A4A0(unkStruct_80943A8 *a) { unkStruct_80943A8 aa; unkStruct_80943A8 res; @@ -750,6 +751,7 @@ static void sub_800A4E4(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ } } +// Similar to u24_8_div static void sub_800A5A4(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) { s32 temp; @@ -821,4 +823,122 @@ static void sub_800A5A4(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ dst->s0 = spC; dst->s4 = r9; } +} + +void sub_800A6D0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +{ + s32 s0; + u32 s4; + + s0 = a->s0 + b->s0; + s4 = a->s4 + b->s4; + if (s4 < a->s4) + s0++; + + dst->s0 = s0; + dst->s4 = s4; +} + +void sub_800A6F0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +{ + s32 s0; + u32 s4; + + s0 = a->s0 - b->s0; + s4 = a->s4 - b->s4; + if (s4 > a->s4) + s0--; + + dst->s0 = s0; + dst->s4 = s4; +} + +// Similar to sub_8009F68 +UNUSED void sub_800A710(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, s32 b) +{ + unkStruct_80943A8 aa; + s32 bb; + unkStruct_80943A8 res; + + aa.s0 = a->s0; + aa.s4 = a->s4; + bb = b; + if (bb < 0) + bb = -bb; + + res.s0 = 0; + res.s4 = 0x10000; + + for (; bb != 0; bb >>= 1) { + if (bb & 1) + sub_800A34C(&res, &res, &aa); + + sub_800A4A0(&aa); + } + + if (b < 0) { + unkStruct_80943A8 idk; + idk.s0 = 0; + idk.s4 = 0x10000; + sub_800A3F0(&res, &idk, &res); + } + + dst->s0 = res.s0; + dst->s4 = res.s4; +} + +// Similar to sub_8009FB8 +UNUSED void sub_800A78C(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +{ + u32 temp; + s32 i; + unkStruct_80943A8 sp0; + unkStruct_80943A8 sp8; + unkStruct_80943A8 sp10; + unkStruct_80943A8 sp18; + + sp0 = *a; + sp8 = *b; + sub_800A27C(&sp0); + sub_800A27C(&sp8); + + if (sub_800A2F0(&sp0, &sp8)) { + sp10 = sp0; + sp0 = sp8; + sp8 = sp10; + } + + if (!sub_800A2A0(&sp8)) { + i = 0; + goto deez; // Fakematch cuz ya (https://decomp.me/scratch/2TCrJ) + + while (i != 2) { + sub_800A34C(&sp8, &sp8, &sp10); + i++; +deez: + + sub_800A3F0(&sp10, &sp8, &sp0); + sub_800A4A0(&sp10); + sp18.s0 = sp10.s0; + sp18.s4 = sp10.s4 + 0x40000; + + if (sp18.s4 < sp10.s4) + sp18.s0++; + + sub_800A3F0(&sp10, &sp10, &sp18); + sub_800A34C(&sp18, &sp0, &sp10); + sp18.s0 <<= 1; + if ((s32)sp18.s4 < 0) + sp18.s0 |= 0x1; + + sp18.s4 <<= 1; + temp = sp0.s4; + sp0.s0 += sp18.s0; + sp0.s4 = temp + sp18.s4; + if (temp > sp0.s4) + sp0.s0++; + } + } + + *dst = sp0; } \ No newline at end of file From 3aee3628f47697f58aefb3e7436436620dab0a6c Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Tue, 5 Nov 2024 09:57:30 -0500 Subject: [PATCH 09/48] Use mateon's func names --- asm/code_806E8B0.s | 28 ++++++------ include/math.h | 25 ++++++----- src/code_8073CF0.c | 2 +- src/math.c | 95 ++++++++++++++++++++-------------------- src/type_effectiveness.c | 34 +++++++------- 5 files changed, 92 insertions(+), 92 deletions(-) diff --git a/asm/code_806E8B0.s b/asm/code_806E8B0.s index a155a5157..2e242047e 100644 --- a/asm/code_806E8B0.s +++ b/asm/code_806E8B0.s @@ -496,7 +496,7 @@ _0806EE7C: adds r0, r5, 0 adds r1, r5, 0 adds r2, r4, 0 - bl sub_800A3F0 + bl F48_16_SDiv mov r1, r10 ldrb r6, [r1, 0x6] mov r8, r5 @@ -512,7 +512,7 @@ _0806EE7C: str r0, [r2, 0x4] adds r0, r7, 0 adds r1, r7, 0 - bl sub_800A34C + bl F48_16_SMul mov r2, r10 ldrb r0, [r2, 0x9] lsls r0, 1 @@ -555,7 +555,7 @@ _0806EF20: adds r0, r7, 0 adds r1, r7, 0 adds r2, r4, 0 - bl sub_800A3F0 + bl F48_16_SDiv ldr r0, [sp, 0x28] _0806EF60: movs r1, 0x3 @@ -591,7 +591,7 @@ _0806EF60: adds r0, r6, 0 adds r1, r6, 0 adds r2, r6, 0 - bl sub_800A34C + bl F48_16_SMul mov r0, r8 str r0, [sp, 0x40] ldr r0, _0806F09C @@ -600,7 +600,7 @@ _0806EF60: adds r0, r6, 0 adds r1, r6, 0 adds r2, r5, 0 - bl sub_800A34C + bl F48_16_SMul adds r0, r5, 0 movs r1, 0x2 bl sub_800A020 @@ -608,7 +608,7 @@ _0806EF60: adds r0, r4, 0 adds r1, r4, 0 adds r2, r5, 0 - bl sub_800A34C + bl F48_16_SMul ldr r1, [sp, 0xC] adds r0, r5, 0 bl sub_800A020 @@ -727,7 +727,7 @@ _0806F0BC: ldr r2, _0806F160 adds r0, r7, 0 adds r1, r7, 0 - bl sub_800A34C + bl F48_16_SMul ldr r0, _0806F164 ldr r0, [r0] movs r3, 0xB3 @@ -748,7 +748,7 @@ _0806F0EE: ldr r2, _0806F160 adds r0, r7, 0 adds r1, r7, 0 - bl sub_800A34C + bl F48_16_SMul ldr r0, _0806F164 ldr r0, [r0] ldr r1, _0806F168 @@ -855,7 +855,7 @@ _0806F1DA: ldr r2, _0806F2B8 adds r0, r7, 0 adds r1, r7, 0 - bl sub_800A34C + bl F48_16_SMul movs r0, 0x1 ldr r3, [sp, 0xB0] strb r0, [r3, 0xD] @@ -871,7 +871,7 @@ _0806F1F4: mov r0, r8 mov r1, r8 adds r2, r7, 0 - bl sub_800A34C + bl F48_16_SMul ldr r0, [r5] movs r1, 0xAE lsls r1, 1 @@ -885,7 +885,7 @@ _0806F1F4: mov r0, r8 mov r1, r8 adds r2, r4, 0 - bl sub_800A34C + bl F48_16_SMul mov r0, r8 bl sub_800A048 ldr r1, [r5] @@ -905,7 +905,7 @@ _0806F1F4: mov r0, r8 mov r1, r8 adds r2, r7, 0 - bl sub_800A34C + bl F48_16_SMul add r4, sp, 0x68 adds r0, r4, 0 movs r1, 0x64 @@ -913,7 +913,7 @@ _0806F1F4: adds r0, r7, 0 adds r1, r4, 0 adds r2, r7, 0 - bl sub_800A34C + bl F48_16_SMul adds r0, r7, 0 bl sub_800A048 ldr r1, [r5] @@ -984,7 +984,7 @@ _0806F2DE: adds r0, r4, 0 adds r1, r4, 0 add r2, sp, 0x4 - bl sub_800A34C + bl F48_16_SMul adds r0, r4, 0 bl sub_800A048 str r0, [r7] diff --git a/include/math.h b/include/math.h index e7984eae1..f0a452739 100644 --- a/include/math.h +++ b/include/math.h @@ -18,16 +18,6 @@ typedef s32 s24_8; */ typedef u32 u24_8; -/** - * This function computes the sine of the absolute value of `x` using a lookup - * table. The period of the function is `4096`, and the range is `[-256, 256]`. - * - * @param[in] x The value to get the sine of. - * - * @return `floor(256 * sin(pi * abs(x) / 2048))` as a signed 32-bit integer. - */ -s32 sin_abs_4096(s32 x); - /** * This function computes the cosine of of `x` using a lookup table. The period of * the function is `4096`, and the range is `[-256, 256]`. @@ -40,6 +30,16 @@ s32 sin_abs_4096(s32 x); */ s32 cos_4096(s32 x); +/** + * This function computes the sine of the absolute value of `x` using a lookup + * table. The period of the function is `4096`, and the range is `[-256, 256]`. + * + * @param[in] x The value to get the sine of. + * + * @return `floor(256 * sin(pi * abs(x) / 2048))` as a signed 32-bit integer. + */ +s32 sin_abs_4096(s32 x); + /** * This function multiplies two signed 24.8 fixed-point numbers. * @@ -50,9 +50,10 @@ s32 cos_4096(s32 x); */ s24_8 s24_8_mul(s24_8 x, s24_8 y); +bool8 F48_16_IsZero(unkStruct_80943A8 *a); +void F48_16_SMul(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b); + s32 sub_8009FB8(s32 x, s32 y); void sub_800A020(unkStruct_80943A8 *, u32); -bool8 sub_800A2A0(unkStruct_80943A8 *a); -void sub_800A34C(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b); #endif // GUARD_MATH_H diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index d77590a29..3986ec9fb 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -336,7 +336,7 @@ void sub_8074094(Entity *entity) sp8.s0 = 0; sp8.s4 = 6554; - sub_800A34C(&sp10, &sp8, &gUnknown_80F54F4[r4]); + F48_16_SMul(&sp10, &sp8, &gUnknown_80F54F4[r4]); if (entityInfo->unk153 > 1) sp10.s4 += (gUnknown_80F60DC[entityInfo->unk153] << 0x10); entityInfo->unk153 = 0; diff --git a/src/math.c b/src/math.c index 8ab0ee17b..f5cc33057 100644 --- a/src/math.c +++ b/src/math.c @@ -4,12 +4,11 @@ #include "data/math.h" +static void F48_16_UDiv(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); +static void F48_16_UMul(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); static u24_8 u24_8_div(u24_8, u24_8); static u24_8 u24_8_mul(u24_8, u24_8); -static void sub_800A5A4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); -static void sub_800A4E4(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); - /** * This function computes a value modulo 3, using a lookup table for values less * than 0x100. @@ -516,7 +515,7 @@ s32 sub_800A0B0(unkStruct_80943A8 *a) } } -static void sub_800A25C(unkStruct_80943A8 *a) +static void F48_16_Negate(unkStruct_80943A8 *a) { a->s0 = ~a->s0; a->s4 = ~a->s4 + 1; @@ -525,7 +524,7 @@ static void sub_800A25C(unkStruct_80943A8 *a) a->s0++; } -static void sub_800A27C(unkStruct_80943A8 *a) +static void F48_16_Abs(unkStruct_80943A8 *a) { if (a->s0 < 0) { a->s0 = ~a->s0; @@ -536,21 +535,21 @@ static void sub_800A27C(unkStruct_80943A8 *a) } } -bool8 sub_800A2A0(unkStruct_80943A8 *a) +bool8 F48_16_IsZero(unkStruct_80943A8 *a) { if (a->s0 == 0 && a->s4 == 0) return TRUE; return FALSE; } -UNUSED bool8 F48_16_AreEqual(unkStruct_80943A8 *a, unkStruct_80943A8 *b) +UNUSED bool8 F48_16_IsEqual(unkStruct_80943A8 *a, unkStruct_80943A8 *b) { if (a->s0 == b->s0 && a->s4 == b->s4) return TRUE; return FALSE; } -static bool8 sub_800A2DC(unkStruct_80943A8 *a) +static bool8 F48_16_IsNegative(unkStruct_80943A8 *a) { if (a->s0 < 0) return TRUE; @@ -583,7 +582,7 @@ bool8 sub_800A2F0(unkStruct_80943A8 *a, unkStruct_80943A8 *b) } } -void sub_800A34C(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +void F48_16_SMul(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) { bool8 aIsNegative; bool8 bIsNegative; @@ -595,34 +594,34 @@ void sub_800A34C(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 aa.s4 = a->s4; bb.s0 = b->s0; bb.s4 = b->s4; - aIsNegative = sub_800A2DC(&aa); - bIsNegative = sub_800A2DC(&bb); + aIsNegative = F48_16_IsNegative(&aa); + bIsNegative = F48_16_IsNegative(&bb); - if (sub_800A2A0(&aa)) { + if (F48_16_IsZero(&aa)) { dst->s0 = 0; dst->s4 = 0; } - else if (sub_800A2A0(&bb)) { + else if (F48_16_IsZero(&bb)) { dst->s0 = 0; dst->s4 = 0; } else { if (aIsNegative) - sub_800A25C(&aa); + F48_16_Negate(&aa); if (bIsNegative) - sub_800A25C(&bb); + F48_16_Negate(&bb); - sub_800A4E4(&res, &aa, &bb); + F48_16_UMul(&res, &aa, &bb); if (aIsNegative != bIsNegative) - sub_800A25C(&res); + F48_16_Negate(&res); dst->s0 = res.s0; dst->s4 = res.s4; } } -void sub_800A3F0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +void F48_16_SDiv(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) { bool8 aIsNegative; bool8 bIsNegative; @@ -634,34 +633,34 @@ void sub_800A3F0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 aa.s4 = a->s4; bb.s0 = b->s0; bb.s4 = b->s4; - aIsNegative = sub_800A2DC(&aa); - bIsNegative = sub_800A2DC(&bb); + aIsNegative = F48_16_IsNegative(&aa); + bIsNegative = F48_16_IsNegative(&bb); - if (sub_800A2A0(&bb)) { + if (F48_16_IsZero(&bb)) { dst->s0 = INT32_MAX; dst->s4 = UINT32_MAX; } - else if (sub_800A2A0(&aa)) { + else if (F48_16_IsZero(&aa)) { dst->s0 = 0; dst->s4 = 0; } else { if (aIsNegative) - sub_800A25C(&aa); + F48_16_Negate(&aa); if (bIsNegative) - sub_800A25C(&bb); + F48_16_Negate(&bb); - sub_800A5A4(&res, &aa, &bb); + F48_16_UDiv(&res, &aa, &bb); if (aIsNegative != bIsNegative) - sub_800A25C(&res); + F48_16_Negate(&res); dst->s0 = res.s0; dst->s4 = res.s4; } } -static void sub_800A4A0(unkStruct_80943A8 *a) +static void F48_16_Square(unkStruct_80943A8 *a) { unkStruct_80943A8 aa; unkStruct_80943A8 res; @@ -669,20 +668,20 @@ static void sub_800A4A0(unkStruct_80943A8 *a) aa.s0 = a->s0; aa.s4 = a->s4; - if (sub_800A2A0(&aa)) { + if (F48_16_IsZero(&aa)) { a->s0 = 0; a->s4 = 0; } else { - sub_800A27C(&aa); - sub_800A4E4(&res, &aa, &aa); + F48_16_Abs(&aa); + F48_16_UMul(&res, &aa, &aa); a->s0 = res.s0; a->s4 = res.s4; } } // Regswap https://decomp.me/scratch/HNmlz -static void sub_800A4E4(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +static void F48_16_UMul(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) { u32 sl; u32 r1; @@ -697,11 +696,11 @@ static void sub_800A4E4(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ u32 r6; s32 i; - if (sub_800A2A0(a)) { + if (F48_16_IsZero(a)) { dst->s0 = 0; dst->s4 = 0; } - else if (sub_800A2A0(b)) { + else if (F48_16_IsZero(b)) { dst->s0 = 0; dst->s4 = 0; } @@ -752,7 +751,7 @@ static void sub_800A4E4(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ } // Similar to u24_8_div -static void sub_800A5A4(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +static void F48_16_UDiv(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) { s32 temp; bool8 r1; @@ -766,11 +765,11 @@ static void sub_800A5A4(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ u32 spC; s32 i; - if (sub_800A2A0(b)) { + if (F48_16_IsZero(b)) { dst->s0 = INT32_MAX; dst->s4 = UINT32_MAX; } - else if (sub_800A2A0(a)) { + else if (F48_16_IsZero(a)) { dst->s0 = 0; dst->s4 = 0; } @@ -854,7 +853,7 @@ void sub_800A6F0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 } // Similar to sub_8009F68 -UNUSED void sub_800A710(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, s32 b) +UNUSED void F48_16_Pow(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, s32 b) { unkStruct_80943A8 aa; s32 bb; @@ -871,16 +870,16 @@ UNUSED void sub_800A710(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, s32 b) for (; bb != 0; bb >>= 1) { if (bb & 1) - sub_800A34C(&res, &res, &aa); + F48_16_SMul(&res, &res, &aa); - sub_800A4A0(&aa); + F48_16_Square(&aa); } if (b < 0) { unkStruct_80943A8 idk; idk.s0 = 0; idk.s4 = 0x10000; - sub_800A3F0(&res, &idk, &res); + F48_16_SDiv(&res, &idk, &res); } dst->s0 = res.s0; @@ -899,8 +898,8 @@ UNUSED void sub_800A78C(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ sp0 = *a; sp8 = *b; - sub_800A27C(&sp0); - sub_800A27C(&sp8); + F48_16_Abs(&sp0); + F48_16_Abs(&sp8); if (sub_800A2F0(&sp0, &sp8)) { sp10 = sp0; @@ -908,25 +907,25 @@ UNUSED void sub_800A78C(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ sp8 = sp10; } - if (!sub_800A2A0(&sp8)) { + if (!F48_16_IsZero(&sp8)) { i = 0; goto deez; // Fakematch cuz ya (https://decomp.me/scratch/2TCrJ) while (i != 2) { - sub_800A34C(&sp8, &sp8, &sp10); + F48_16_SMul(&sp8, &sp8, &sp10); i++; deez: - sub_800A3F0(&sp10, &sp8, &sp0); - sub_800A4A0(&sp10); + F48_16_SDiv(&sp10, &sp8, &sp0); + F48_16_Square(&sp10); sp18.s0 = sp10.s0; sp18.s4 = sp10.s4 + 0x40000; if (sp18.s4 < sp10.s4) sp18.s0++; - sub_800A3F0(&sp10, &sp10, &sp18); - sub_800A34C(&sp18, &sp0, &sp10); + F48_16_SDiv(&sp10, &sp10, &sp18); + F48_16_SMul(&sp18, &sp0, &sp10); sp18.s0 <<= 1; if ((s32)sp18.s4 < 0) sp18.s0 |= 0x1; diff --git a/src/type_effectiveness.c b/src/type_effectiveness.c index e86858dfd..a22bef924 100644 --- a/src/type_effectiveness.c +++ b/src/type_effectiveness.c @@ -109,7 +109,7 @@ bool8 sub_806E100(unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u param_5->effectiveness = EFFECTIVENESS_NEUTRAL; for (index = 0; index < 2; index++) { local_48 = gUnknown_8106F54; - if (sub_800A2A0(param_1)) break; + if (F48_16_IsZero(param_1)) break; if (((normalOrFightingType) && (targetInfo->types[index] == TYPE_GHOST)) && (targetInfo->exposed == FALSE)) { effectiveness = EFFECTIVENESS_IMMUNE; gDungeon->unk134.pokemonExposed = TRUE; @@ -118,7 +118,7 @@ bool8 sub_806E100(unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u effectiveness = gTypeEffectivenessChart[type][targetInfo->types[index]]; } if (effectiveness != EFFECTIVENESS_NEUTRAL) { - sub_800A34C(param_1,param_1,local_48.unk0[effectiveness]); + F48_16_SMul(param_1,param_1,local_48.unk0[effectiveness]); } local_38[index] = effectiveness; gDungeon->unk134.unk13C[index] = effectiveness; @@ -134,7 +134,7 @@ bool8 sub_806E100(unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u if (((type == TYPE_FIRE) || (type == TYPE_ICE)) && (HasAbility(target,ABILITY_THICK_FAT))) { gDungeon->unk134.unk16D = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F1C); + F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); } if ((type == TYPE_FIRE) && (GetFlashFireStatus(target) != FLASH_FIRE_STATUS_NONE)) { gDungeon->unk134.fill16E[0] = TRUE; @@ -157,7 +157,7 @@ bool8 sub_806E100(unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u torrentVisualFlag = SetVisualFlags(pokemonInfo,0x80,torrentFlag); if (torrentFlag) { gDungeon->unk134.fill16E[2] = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F0C); + F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); } if (torrentVisualFlag) { sub_80428EC(pokemon); @@ -169,7 +169,7 @@ bool8 sub_806E100(unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u overgrowVisualFlag = SetVisualFlags(pokemonInfo,2,overgrowFlag); if (overgrowFlag) { gDungeon->unk134.fill16E[3] = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F0C); + F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); } if (overgrowVisualFlag) { sub_80428D8(pokemon); @@ -181,7 +181,7 @@ bool8 sub_806E100(unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u swarmVisualFlag = SetVisualFlags(pokemonInfo,0x10,swarmFlag); if (swarmFlag) { gDungeon->unk134.fill16E[4] = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F0C); + F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); } if (swarmVisualFlag) { sub_8042978(pokemon); @@ -193,53 +193,53 @@ bool8 sub_806E100(unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u blazeVisualFlag = SetVisualFlags(pokemonInfo,0x20,blazeFlag); if (blazeFlag) { gDungeon->unk134.fill16E[5] = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F0C); + F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); } if (blazeVisualFlag) { sub_804298C(pokemon); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEDE8); } } - if (!(sub_800A2A0(param_1)) && (MonsterIsType(pokemon, type))) { + if (!(F48_16_IsZero(param_1)) && (MonsterIsType(pokemon, type))) { gDungeon->unk134.fill16E[6] = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F14); + F48_16_SMul(param_1,param_1, &gUnknown_8106F14); } weather = GetApparentWeather(pokemon); if (weather == WEATHER_SUNNY) { if (type == TYPE_FIRE) { gDungeon->unk134.unk16C = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F14); + F48_16_SMul(param_1,param_1, &gUnknown_8106F14); } else if (type == TYPE_WATER) { gDungeon->unk134.unk16C = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F1C); + F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); } } if (weather == WEATHER_RAIN) { if (type == TYPE_FIRE) { gDungeon->unk134.unk16B = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F1C); + F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); } else if (type == TYPE_WATER) { gDungeon->unk134.unk16B = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F14); + F48_16_SMul(param_1,param_1, &gUnknown_8106F14); } } if ((weather == WEATHER_CLOUDY) && (type != TYPE_NORMAL)) { - sub_800A34C(param_1,param_1, &gUnknown_8106F64); + F48_16_SMul(param_1,param_1, &gUnknown_8106F64); gDungeon->unk134.unk16A = TRUE; } if (((gDungeon->weather.mudSportTurns != 0) || (weather == WEATHER_FOG)) && (type == TYPE_ELECTRIC)) { gDungeon->unk134.fill16E[7] = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F1C); + F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); } if ((gDungeon->weather.waterSportTurns != 0) && (type == TYPE_FIRE)) { gDungeon->unk134.fill16E[8] = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F1C); + F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); } if ((type == TYPE_ELECTRIC) && (pokemonInfo->charging.chargingStatus == STATUS_CHARGING)) { gDungeon->unk134.fill16E[9] = TRUE; - sub_800A34C(param_1,param_1, &gUnknown_8106F0C); + F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); } } return bVar4; From 723475af058b7d0ecaf2ce161bb848f8d3215076 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:41:40 -0500 Subject: [PATCH 10/48] Fix fakematch cuz Mateon --- src/math.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/math.c b/src/math.c index f5cc33057..ef484d695 100644 --- a/src/math.c +++ b/src/math.c @@ -909,13 +909,8 @@ UNUSED void sub_800A78C(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ if (!F48_16_IsZero(&sp8)) { i = 0; - goto deez; // Fakematch cuz ya (https://decomp.me/scratch/2TCrJ) - - while (i != 2) { - F48_16_SMul(&sp8, &sp8, &sp10); - i++; -deez: + do { F48_16_SDiv(&sp10, &sp8, &sp0); F48_16_Square(&sp10); sp18.s0 = sp10.s0; @@ -936,7 +931,13 @@ deez: sp0.s4 = temp + sp18.s4; if (temp > sp0.s4) sp0.s0++; - } + + if (i == 2) + break; + + F48_16_SMul(&sp8, &sp8, &sp10); + i++; + } while (TRUE); } *dst = sp0; From c0872f639c28f8bf39e42a3a4124a2c2fb337303 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:50:03 -0500 Subject: [PATCH 11/48] Finish code_8044CC8.s --- asm/code_8044CC8.s | 75 ------------------------------------------ include/code_8044CC8.h | 7 ++-- ld_script.txt | 1 - src/code_8044CC8.c | 52 ++++++++++++++++++++++++----- 4 files changed, 47 insertions(+), 88 deletions(-) delete mode 100644 asm/code_8044CC8.s diff --git a/asm/code_8044CC8.s b/asm/code_8044CC8.s deleted file mode 100644 index f169b0a97..000000000 --- a/asm/code_8044CC8.s +++ /dev/null @@ -1,75 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start sub_8045064 -sub_8045064: - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r1, 0 - ldr r0, _080450D4 - mov r8, r0 - ldr r0, [r0] - cmp r1, r0 - bge _080450C8 - mov r7, r8 - ldr r2, _080450D8 - mov r9, r2 - ldr r0, _080450DC - mov r12, r0 -_08045082: - adds r4, r1, 0x1 - ldr r0, [r7] - adds r5, r4, 0 - cmp r5, r0 - bge _080450BE - lsls r0, r1, 2 - mov r1, r12 - adds r3, r0, r1 - mov r6, r9 - lsls r0, r5, 2 - adds r2, r0, r1 -_08045098: - ldrh r1, [r3] - lsls r1, 3 - adds r1, r6 - ldrh r0, [r2] - lsls r0, 3 - adds r0, r6 - ldr r1, [r1] - ldr r0, [r0] - cmp r1, r0 - ble _080450B4 - ldr r1, [r3] - ldr r0, [r2] - str r0, [r3] - str r1, [r2] -_080450B4: - adds r2, 0x4 - adds r4, 0x1 - ldr r0, [r7] - cmp r4, r0 - blt _08045098 -_080450BE: - adds r1, r5, 0 - mov r2, r8 - ldr r0, [r2] - cmp r1, r0 - blt _08045082 -_080450C8: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080450D4: .4byte gUnknown_202EE6C -_080450D8: .4byte gUnknown_80F7C54 -_080450DC: .4byte gUnknown_202EE44 - thumb_func_end sub_8045064 diff --git a/include/code_8044CC8.h b/include/code_8044CC8.h index 0c40f5685..1931c4c0a 100644 --- a/include/code_8044CC8.h +++ b/include/code_8044CC8.h @@ -1,13 +1,14 @@ #ifndef GUARD_CODE_8044CC8_H #define GUARD_CODE_8044CC8_H -struct unkStruct_202EE44 +// size: 0x4 +typedef struct unkStruct_202EE44 { u16 unk0; u8 unk2; bool8 unk3; -}; +} unkStruct_202EE44; -extern struct unkStruct_202EE44 gUnknown_202EE44[10]; +extern unkStruct_202EE44 gUnknown_202EE44[10]; #endif // GUARD_CODE_8044CC8_H diff --git a/ld_script.txt b/ld_script.txt index bac993ca0..023f7fda6 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -215,7 +215,6 @@ SECTIONS { asm/code_8044210.o(.text); src/dungeon_action.o(.text); src/code_8044CC8.o(.text); - asm/code_8044CC8.o(.text); src/dungeon_util.o(.text); asm/code_80450F8.o(.text); src/dungeon_visibility.o(.text); diff --git a/src/code_8044CC8.c b/src/code_8044CC8.c index 0b2c75b9e..c55f1638b 100644 --- a/src/code_8044CC8.c +++ b/src/code_8044CC8.c @@ -5,26 +5,39 @@ #include "code_8044CC8.h" #include "items.h" +// size: 0x8 typedef struct ItemText { u8 *desc; u8 *useText; } ItemText; -extern const ItemText gActions[]; -extern u16 gUnknown_80F6964[NUM_ITEM_CATEGORIES]; -extern u8 gUnknown_80F697C[]; -extern u8 *gUnknown_80F91EC[]; -extern u8 *gUnknown_80F7C50[10]; +// size: 0x8 +typedef struct unkStr_80F7C54 +{ + u32 unk0; + u8 *text; +} unkStr_80F7C54; + + + +EWRAM_DATA unkStruct_202EE44 gUnknown_202EE44[10] = {0}; extern s32 gUnknown_202EE6C; -bool8 sub_80461C8(Position *, u32); -void sub_80460F8(Position *, Item *, u32); + + +extern const ItemText gActions[]; +extern u16 gUnknown_80F6964[NUM_ITEM_CATEGORIES]; +extern u8 gUnknown_80F697C[]; +extern u8 *gUnknown_80F7C50[10]; +extern const unkStr_80F7C54 gUnknown_80F7C54[65]; +extern u8 *gUnknown_80F91EC[]; + extern u8 sub_8043D10(void); extern bool8 sub_8045888(Entity *); - -EWRAM_DATA struct unkStruct_202EE44 gUnknown_202EE44[10] = {0}; +void sub_80460F8(Position *, Item *, u32); +bool8 sub_80461C8(Position *, u32); Item * sub_8044CC8(Entity *param_1, unkStruct_8044CC8 *param_2) { @@ -249,3 +262,24 @@ bool8 IsNotAttacking(Entity *param_1, bool8 param_2) return TRUE; } } + +void sub_8045064(void) +{ + s32 i; + s32 j; + unkStruct_202EE44 *iPtr; + unkStruct_202EE44 *jPtr; + unkStruct_202EE44 temp; + + for (i = 0; i < gUnknown_202EE6C; i++) { + for (j = i + 1; j < gUnknown_202EE6C; j++) { + iPtr = &gUnknown_202EE44[i]; + jPtr = &gUnknown_202EE44[j]; + if ((s32)gUnknown_80F7C54[iPtr->unk0].unk0 > (s32)gUnknown_80F7C54[jPtr->unk0].unk0) { + temp = *iPtr; + *iPtr = *jPtr; + *jPtr = temp; + } + } + } +} \ No newline at end of file From 5623e4e028863ced454e76a23149d94d65893285 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Wed, 6 Nov 2024 05:17:28 -0500 Subject: [PATCH 12/48] Merge with huevo --- include/math.h | 8 +++++++- src/code_806E8B0.c | 44 ++++++++++++++++++-------------------------- src/math.c | 18 +++++++++--------- 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/include/math.h b/include/math.h index f0a452739..08d1bab23 100644 --- a/include/math.h +++ b/include/math.h @@ -51,9 +51,15 @@ s32 sin_abs_4096(s32 x); s24_8 s24_8_mul(s24_8 x, s24_8 y); bool8 F48_16_IsZero(unkStruct_80943A8 *a); +void F48_16_SDiv(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b); void F48_16_SMul(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b); s32 sub_8009FB8(s32 x, s32 y); -void sub_800A020(unkStruct_80943A8 *, u32); +void sub_800A020(unkStruct_80943A8 *dst, u32); +u32 sub_800A048(unkStruct_80943A8 *a); +void sub_800A088(unkStruct_80943A8 *a, s32 b); +bool8 sub_800A2F0(unkStruct_80943A8 *a, unkStruct_80943A8 *b); +void sub_800A6D0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b); +void sub_800A6F0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b); #endif // GUARD_MATH_H diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index b69effc7b..ed32b8460 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -26,14 +26,6 @@ void sub_80428B0(Entity *r0); void sub_80428C4(Entity *r0); extern void sub_806F500(void); -extern void sub_800A020(struct unkStruct_80943A8 *param_1, u32 param_2); -extern void sub_800A3F0(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, struct unkStruct_80943A8 *); -extern void sub_800A6D0(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, struct unkStruct_80943A8 *); -extern void sub_800A34C(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, const struct unkStruct_80943A8 *param3); -extern void sub_800A6F0(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, struct unkStruct_80943A8 *param3); -extern void sub_800A088(struct unkStruct_80943A8 *param_1, u32 param_2); -extern u32 sub_800A048(struct unkStruct_80943A8 *param_1); -extern bool8 sub_800A2F0(const struct unkStruct_80943A8*, const struct unkStruct_80943A8*); extern bool8 sub_806E100(struct unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u8 type, struct DamageStruct *dmgStruct); extern void sub_8041B74(Entity *pokemon); extern void sub_8041B5C(Entity *pokemon); @@ -51,10 +43,10 @@ extern const s16 gUnknown_810AC68; extern const s16 gUnknown_810AC62; extern const s16 gUnknown_80F4DAE; extern const s16 gUnknown_80F4DB0; -extern const struct unkStruct_80943A8 gUnknown_8106F24; -extern const struct unkStruct_80943A8 gUnknown_8106F04; -extern const struct unkStruct_80943A8 gUnknown_8106F1C; -extern const struct unkStruct_80943A8 gUnknown_8106F14; +extern struct unkStruct_80943A8 gUnknown_8106F24; +extern struct unkStruct_80943A8 gUnknown_8106F04; +extern struct unkStruct_80943A8 gUnknown_8106F1C; +extern struct unkStruct_80943A8 gUnknown_8106F14; extern const u8 *const gUnknown_80FAE00; extern const u8 *const gUnknown_80FADD8; extern const u8 *const gUnknown_80FEE04; @@ -285,12 +277,12 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 ApplyAtkDefStatBoosts(attacker, target, moveType, &atkStat, &defStat, rand); sub_800A020(&unkSp1, atkStat - defStat); sub_800A020(&unkSp2, 8); - sub_800A3F0(&unkSp1, &unkSp1, &unkSp2); + F48_16_SDiv(&unkSp1, &unkSp1, &unkSp2); if (!attackerInfo->isNotTeamMember) { sub_800A020(&unkSp2, attackerInfo->level); unkSp3.s0 = 0; unkSp3.s4 = 0xAAAA; - sub_800A34C(&unkSp2, &unkSp2, &unkSp3); + F48_16_SMul(&unkSp2, &unkSp2, &unkSp3); r6 = (attackerInfo->level * 2) / 3; } else { @@ -299,7 +291,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 ApplyAtkDefStatBoosts(attacker, target, moveType, &unkAtkStat2, &unkDefStat2, rand); sub_800A020(&unkSp2, unkAtkStat2); sub_800A020(&unkSp3, 3); - sub_800A3F0(&unkSp2, &unkSp2, &unkSp3); + F48_16_SDiv(&unkSp2, &unkSp2, &unkSp3); r6 = unkAtkStat2 / 3; } sub_800A6D0(&unkSp4, &unkSp1, &unkSp2); @@ -307,12 +299,12 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 gDungeon->unk134.unk140[6] = sub_800A048(&unkSp4); unkSp5 = unkSp4; unkSp7 = unkSp4; - sub_800A34C(&unkSp5, &unkSp5, &unkSp5); + F48_16_SMul(&unkSp5, &unkSp5, &unkSp5); unkSp6.s0 = 0; unkSp6.s4 = 0xCCC; - sub_800A34C(&unkSp5, &unkSp5, &unkSp6); + F48_16_SMul(&unkSp5, &unkSp5, &unkSp6); sub_800A020(&unkSp6, 2); - sub_800A34C(&unkSp7, &unkSp7, &unkSp6); + F48_16_SMul(&unkSp7, &unkSp7, &unkSp6); sub_800A020(&unkSp6, defStat); sub_800A6F0(&unkSp7, &unkSp7, &unkSp6); sub_800A020(&unkSp6, 10); @@ -342,12 +334,12 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 if (arg_10) { if (splitIndex == 0 && targetInfo->protection.protectionStatus == STATUS_REFLECT) { sub_8041B74(target); - sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F1C); + F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F1C); gDungeon->unk134.unk166 = 1; } if (splitIndex == 1 && targetInfo->protection.protectionStatus == STATUS_LIGHT_SCREEN) { sub_8041B5C(target); - sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F1C); + F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F1C); gDungeon->unk134.unk167 = 1; } } @@ -382,13 +374,13 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 } } if (DungeonRandInt(100) < critOdds) { - sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F14); + F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F14); dmgStruct->isCrit = TRUE; } } gDungeon->unk134.unk154 = sub_800A048(&unkSp8); - sub_800A34C(&unkSp8, &unkSp8, &unkSp9); + F48_16_SMul(&unkSp8, &unkSp8, &unkSp9); { // Ugly hack needed to match #ifdef NONMATCHING @@ -400,7 +392,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 gDungeon->unk134.unk15C = arg8_Match = arg8; ASM_MATCH_TRICK(arg8); sub_800A088(&unkSp10, arg8_Match); - sub_800A34C(&unkSp8, &unkSp8, &unkSp10); + F48_16_SMul(&unkSp8, &unkSp8, &unkSp10); } // ALSO needed to match. unk694 chosen randomly and it worked with matching. @@ -411,10 +403,10 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 unkSp9.s0 = 0; unkSp9.s4 = 0xE000 + rnd; } - sub_800A34C(&unkSp8, &unkSp8, &unkSp9); + F48_16_SMul(&unkSp8, &unkSp8, &unkSp9); sub_800A020(&unkSp11, 100); - sub_800A34C(&unkSp9, &unkSp11, &unkSp9); + F48_16_SMul(&unkSp9, &unkSp11, &unkSp9); gDungeon->unk134.unk158 = sub_800A048(&unkSp9); dmgStruct->dmg = sub_800A048(&unkSp8); @@ -437,7 +429,7 @@ void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct D dmgStruct->type = moveType; sub_806E100(&unkSp1, attacker, target, moveType, dmgStruct); sub_800A020(&unkSp2, a2New); - sub_800A34C(&unkSp2, &unkSp2, &unkSp1); + F48_16_SMul(&unkSp2, &unkSp2, &unkSp1); dmgStruct->dmg = sub_800A048(&unkSp2); dmgStruct->residualDmgType = 0; } diff --git a/src/math.c b/src/math.c index ef484d695..755316248 100644 --- a/src/math.c +++ b/src/math.c @@ -365,12 +365,12 @@ void sub_800A020(unkStruct_80943A8 *param_1, u32 param_2) } -u32 sub_800A048(u32 *a) +u32 sub_800A048(unkStruct_80943A8 *a) { u32 uVar1; - uVar1 = ((u16)a[0] << 16) | (a[1] >> 16); - if (a[1] & 0x8000) + uVar1 = ((u16)a->s0 << 16) | (a->s4 >> 16); + if (a->s4 & 0x8000) uVar1++; return uVar1; @@ -387,15 +387,15 @@ UNUSED u32 sub_800A068(u32 *a) return uVar1; } -void sub_800A088(u32 *a, s32 b) +void sub_800A088(unkStruct_80943A8 *a, s32 b) { - a[1] = b << 8; - a[0] = b >> 24; + a->s4 = b << 8; + a->s0 = b >> 24; - if (a[0] & 0x80) - a[0] |= ~0x7F; + if (a->s0 & 0x80) + a->s0 |= ~0x7F; else - a[0] &= 0x7f; + a->s0 &= 0x7f; } s32 sub_800A0B0(unkStruct_80943A8 *a) From e6f00864bd8eaa23f63caee01cc9dc9e9c476368 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:54:01 -0500 Subject: [PATCH 13/48] sin_abs_4096 -> sin_4096 --- asm/code_8045A00.s | 4 ++-- asm/code_8046CE4.s | 2 +- asm/code_807CD9C.s | 2 +- asm/code_807E5AC.s | 2 +- include/math.h | 4 ++-- src/code_800558C.c | 2 +- src/code_807CD9C.c | 2 +- src/dungeon_move.c | 2 +- src/math.c | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/asm/code_8045A00.s b/asm/code_8045A00.s index 77143e088..74b7efc43 100644 --- a/asm/code_8045A00.s +++ b/asm/code_8045A00.s @@ -1297,7 +1297,7 @@ _080467BE: adds r0, r7 str r0, [r2, 0x4] ldr r0, [sp, 0x10] - bl sin_abs_4096 + bl sin_4096 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 @@ -1809,7 +1809,7 @@ _08046BAA: adds r0, r4, 0 bl IncreaseEntityPixelPos mov r0, r10 - bl sin_abs_4096 + bl sin_4096 add r2, sp, 0x20 adds r2, r5 lsls r1, r0, 1 diff --git a/asm/code_8046CE4.s b/asm/code_8046CE4.s index e7544cb38..270377982 100644 --- a/asm/code_8046CE4.s +++ b/asm/code_8046CE4.s @@ -755,7 +755,7 @@ _08047726: adds r0, 0xFF _08047732: asrs r0, 8 - bl sin_abs_4096 + bl sin_4096 ldr r2, [sp, 0x30] adds r1, r0, 0 muls r1, r2 diff --git a/asm/code_807CD9C.s b/asm/code_807CD9C.s index 391f34e32..bc96db041 100644 --- a/asm/code_807CD9C.s +++ b/asm/code_807CD9C.s @@ -485,7 +485,7 @@ _0807D8B0: adds r0, r4, 0 bl IncreaseEntityPixelPos mov r0, r10 - bl sin_abs_4096 + bl sin_4096 add r2, sp, 0x20 adds r2, r5 lsls r1, r0, 1 diff --git a/asm/code_807E5AC.s b/asm/code_807E5AC.s index af8aa17e5..be82e0ed6 100644 --- a/asm/code_807E5AC.s +++ b/asm/code_807E5AC.s @@ -2173,7 +2173,7 @@ _0807F794: cmp r0, 0 beq _0807F7E6 ldr r0, [sp, 0x100] - bl sin_abs_4096 + bl sin_4096 lsls r0, 5 mov r3, r8 str r0, [r3, 0x1C] diff --git a/include/math.h b/include/math.h index 08d1bab23..243e67539 100644 --- a/include/math.h +++ b/include/math.h @@ -22,7 +22,7 @@ typedef u32 u24_8; * This function computes the cosine of of `x` using a lookup table. The period of * the function is `4096`, and the range is `[-256, 256]`. * - * @note Mathematically, `cos(abs(t)) = cos(t)`, unlike the case in `sin_abs_4096()` above. + * @note Mathematically, `cos(abs(t)) = cos(t)`, unlike the case in `sin_4096()` above. * * @param[in] x The value to get the cosine of. * @@ -38,7 +38,7 @@ s32 cos_4096(s32 x); * * @return `floor(256 * sin(pi * abs(x) / 2048))` as a signed 32-bit integer. */ -s32 sin_abs_4096(s32 x); +s32 sin_4096(s32 x); /** * This function multiplies two signed 24.8 fixed-point numbers. diff --git a/src/code_800558C.c b/src/code_800558C.c index 0fb2ad381..8c54dff9e 100644 --- a/src/code_800558C.c +++ b/src/code_800558C.c @@ -536,7 +536,7 @@ void sub_8005838(s32 *a0, u8 kind) k = iVar11; j = iVar11; for (sp10 = 0; sp10 < 0x400; sp10 += spC) { - s32 tmp1 = sin_abs_4096(sp10) * val3 / 256; + s32 tmp1 = sin_4096(sp10) * val3 / 256; sp14 = (val2 + tmp1) / 256; r8 = (val2 - tmp1) / 256; diff --git a/src/code_807CD9C.c b/src/code_807CD9C.c index de204c76b..99f295bbd 100644 --- a/src/code_807CD9C.c +++ b/src/code_807CD9C.c @@ -200,7 +200,7 @@ void sub_807D068(Entity *pokemon, Position *pos) pixelY += incrementY; local_34.x = pixelX; local_34.y = pixelY; - pokemon->unk1C = sin_abs_4096(iVar8) * 0xc; + pokemon->unk1C = sin_4096(iVar8) * 0xc; sub_804535C(pokemon, &local_34); if (sub_8045888(pokemon)) { sub_803E46C(0x1a); diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 21c5ad0e7..850f2c1b1 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -2642,7 +2642,7 @@ void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 s32 r2; if (a3 != 0) { - r3 = sin_abs_4096(r9 / 256) * var_3C; + r3 = sin_4096(r9 / 256) * var_3C; } else { r3 = 0; diff --git a/src/math.c b/src/math.c index 755316248..972407be5 100644 --- a/src/math.c +++ b/src/math.c @@ -28,7 +28,7 @@ UNUSED u32 fast_mod_3(s32 x) return x % 3; } -s32 sin_abs_4096(s32 x) +s32 sin_4096(s32 x) { switch (x & 0xc00) { case 0x000: From d96bb4a9aa3f13b1e42a7d3016dfce8f61ea827e Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Thu, 7 Nov 2024 13:06:53 -0500 Subject: [PATCH 14/48] Names --- asm/code_80718D8.s | 2 +- include/move_util.h | 2 +- include/structs/str_damage.h | 2 +- src/code_8042B34.c | 12 ++++++------ src/code_805D8C8_1.c | 4 ++-- src/code_806CD90.c | 18 +++++++++--------- src/code_806E8B0.c | 18 +++++++++--------- src/code_8092334.c | 1 + src/dungeon_move.c | 22 +++++++++++----------- src/move_actions.c | 30 +++++++++++++++--------------- src/pokemon_mid.c | 20 ++++++++++---------- src/status_actions.c | 10 +++++----- src/tile_types.c | 4 ++-- 13 files changed, 73 insertions(+), 72 deletions(-) diff --git a/asm/code_80718D8.s b/asm/code_80718D8.s index 32972ad78..7563ca795 100644 --- a/asm/code_80718D8.s +++ b/asm/code_80718D8.s @@ -39,7 +39,7 @@ _080727A8: movs r4, 0xC ldrsh r3, [r0, r4] mov r0, sp - bl sub_808E0AC + bl GetMovesLearnedAtLevel adds r7, r0, 0 add r4, sp, 0x20 movs r1, 0x8C diff --git a/include/move_util.h b/include/move_util.h index 931fef8ab..579992309 100644 --- a/include/move_util.h +++ b/include/move_util.h @@ -6,7 +6,7 @@ u32 sub_8057144(Entity * pokemon); bool8 sub_80571F0(Entity * pokemon, Move *move); bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance); -bool8 sub_8057308(Entity *pokemon, s32 chance); +bool8 RollSecondaryEffect(Entity *pokemon, s32 chance); bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker); bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker); diff --git a/include/structs/str_damage.h b/include/structs/str_damage.h index 438ebf86f..6003f0dfc 100644 --- a/include/structs/str_damage.h +++ b/include/structs/str_damage.h @@ -9,7 +9,7 @@ struct DamageStruct u8 type; bool8 isCrit; u8 unkE; - u8 unkF; + bool8 tookNoDamage; }; #endif diff --git a/src/code_8042B34.c b/src/code_8042B34.c index 5fdc960d7..db3fd315c 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -376,8 +376,8 @@ extern void sub_8046F84(s32 itemFlag); extern bool8 sub_8083C50(void); extern void sub_8068FE0(Entity *, u32, Entity *r2); extern void sub_806BFC0(EntityInfo *, u32); -extern s32 sub_808E0AC(u16* a1, s16 species, s32 a3, s32 IQPoints); -extern s32 sub_808E0AC(u16* a1, s16 species, s32 a3, s32 IQPoints); +extern s32 GetMovesLearnedAtLevel(u16* a1, s16 species, s32 a3, s32 IQPoints); +extern s32 GetMovesLearnedAtLevel(u16* a1, s16 species, s32 a3, s32 IQPoints); extern bool8 IsKeepMoney(u8 dungeon); extern void sub_8042B0C(Entity *); @@ -387,7 +387,7 @@ extern u8 gUnknown_202F1A8; extern s32 gDungeonBrightness; extern Entity *gLeaderPointer; -void sub_8044124(void); +void EnforceMaxItemsAndMoney(void); void sub_8043FD0(void); void sub_806B404(void); u8 sub_8043D10(void); @@ -489,7 +489,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) } gDungeon->unk674 = 0; - sub_8044124(); + EnforceMaxItemsAndMoney(); } if (!r6) { if (gDungeon->unk678 == 1) { @@ -1163,7 +1163,7 @@ void sub_8043FD0(void) monStruct->offense.def[0] = def; monStruct->offense.def[1] = spDef; - movesCount = sub_808E0AC(learnedMoves, monStruct->speciesNum, monStruct->level, 999); + movesCount = GetMovesLearnedAtLevel(learnedMoves, monStruct->speciesNum, monStruct->level, 999); if (movesCount == 0) continue; @@ -1181,7 +1181,7 @@ void sub_8043FD0(void) } } -void sub_8044124(void) +void EnforceMaxItemsAndMoney(void) { s32 i; diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index d8ce51ea0..8d0a9ccc9 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -3088,7 +3088,7 @@ void sub_8060D24(UNUSED ActionContainer *a0) sub_803EAF0(0, NULL); } -extern bool8 sub_804ACE4(Position *pos); +extern bool8 PosHasItem(Position *pos); s32 sub_8060D64(s16 *a0, bool8 a1, bool8 a2, bool8 a3, Entity *a4) { @@ -3104,7 +3104,7 @@ s32 sub_8060D64(s16 *a0, bool8 a1, bool8 a2, bool8 a3, Entity *a4) } } - if (a2 && sub_804ACE4(&a4->pos)) { + if (a2 && PosHasItem(&a4->pos)) { a0[count++] = 2; } diff --git a/src/code_806CD90.c b/src/code_806CD90.c index 5003b230e..bfa7ca71b 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -334,7 +334,7 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * if (HandleDealingDamageInternal(attacker, target, dmgStruct, isFalseSwipe, giveExp, r10, argC)) return; - if (dmgStruct->unkF) + if (dmgStruct->tookNoDamage) return; if (!EntityExists(attacker) || !EntityExists(target)) return; @@ -392,7 +392,7 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * sp.typeEffectiveness = 2; sp.isCrit = FALSE; sp.unkE = 0; - sp.unkF = 0; + sp.tookNoDamage = FALSE; HandleDealingDamageInternal(target, attacker, &sp, FALSE, giveExp, r10, argC); } } @@ -503,9 +503,9 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc s32 r8 = 0; Tile *unkTile = NULL; - dmgStruct->unkF = 0; + dmgStruct->tookNoDamage = FALSE; if (GetEntityType(target) != ENTITY_MONSTER) { - dmgStruct->unkF = 1; + dmgStruct->tookNoDamage = TRUE; return FALSE; } @@ -523,14 +523,14 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FCA90); sub_8042238(attacker, target); - dmgStruct->unkF = 1; + dmgStruct->tookNoDamage = TRUE; return FALSE; } if (targetData->immobilize.immobilizeStatus == STATUS_FROZEN) { SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9600); sub_8042238(attacker, target); - dmgStruct->unkF = 1; + dmgStruct->tookNoDamage = TRUE; return FALSE; } @@ -542,12 +542,12 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc if ((HasAbility(target, ABILITY_VOLT_ABSORB) && dmgStruct->type == TYPE_ELECTRIC)) { HealTargetHP(attacker, target, dmgStruct->dmg, 0, 0); - dmgStruct->unkF = 1; + dmgStruct->tookNoDamage = TRUE; return FALSE; } else if (HasAbility(target, ABILITY_WATER_ABSORB) && dmgStruct->type == TYPE_WATER) { HealTargetHP(attacker, target, dmgStruct->dmg, 0, 0); - dmgStruct->unkF = 1; + dmgStruct->tookNoDamage = TRUE; return FALSE; } @@ -583,7 +583,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } sub_803E708(0x1E, 0x18); } - dmgStruct->unkF = 1; + dmgStruct->tookNoDamage = TRUE; return FALSE; } else if (dmgStruct->dmg == 9999) { diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index ed32b8460..275e963f6 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -150,7 +150,7 @@ static inline void SetDamageOne(struct DamageStruct *dmgStruct, u8 moveType) dmgStruct->type = moveType; dmgStruct->isCrit = FALSE; dmgStruct->unkE = 0; - dmgStruct->unkF = 0; + dmgStruct->tookNoDamage = FALSE; } void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s32 critChance, struct DamageStruct *dmgStruct, s32 arg8, u16 moveId, bool8 arg_10) @@ -447,11 +447,11 @@ void DealDamageToEntity(Entity *entity, s32 dmg, s32 r6, s16 r4) dmgStruct.residualDmgType = r6; dmgStruct.isCrit = FALSE; dmgStruct.unkE = 0; - dmgStruct.unkF = 0; + dmgStruct.tookNoDamage = FALSE; HandleDealingDamage(&spEntity, entity, &dmgStruct, FALSE, FALSE, r4_, FALSE, 0); } -void sub_806F370(Entity *pokemon, Entity *target, s32 dmg, s32 r9, u8 *arg_0, u8 moveType, s16 arg_8, s32 arg_C, s32 arg_10, s32 arg_14) +void sub_806F370(Entity *pokemon, Entity *target, s32 dmg, s32 giveExp, bool8 *tookNoDamage, u8 moveType, s16 arg_8, s32 residualDmgType, s32 arg_10, s32 arg_14) { s32 i; struct DamageStruct dmgStruct; @@ -459,7 +459,7 @@ void sub_806F370(Entity *pokemon, Entity *target, s32 dmg, s32 r9, u8 *arg_0, u8 s32 dmgNew = dmg; dmgStruct.typeEffectiveness = EFFECTIVENESS_NEUTRAL; - dmgStruct.residualDmgType = arg_C; + dmgStruct.residualDmgType = residualDmgType; dmgStruct.type = moveType; dmgStruct.isCrit = FALSE; dmgStruct.unkE = 0; @@ -480,14 +480,14 @@ void sub_806F370(Entity *pokemon, Entity *target, s32 dmg, s32 r9, u8 *arg_0, u8 dmgStruct.dmg = dmgNew; if (dmgNew == 0) { - dmgStruct.unkF = 1; + dmgStruct.tookNoDamage = TRUE; } else { - dmgStruct.unkF = 0; + dmgStruct.tookNoDamage = FALSE; } - HandleDealingDamage(pokemon, target, &dmgStruct, FALSE, r9, arg_8_, arg_10, arg_14); - if (arg_0 != NULL) { - *arg_0 = dmgStruct.unkF; + HandleDealingDamage(pokemon, target, &dmgStruct, FALSE, giveExp, arg_8_, arg_10, arg_14); + if (tookNoDamage != NULL) { + *tookNoDamage = dmgStruct.tookNoDamage; } } diff --git a/src/code_8092334.c b/src/code_8092334.c index ee35b2102..5dfe4e39c 100644 --- a/src/code_8092334.c +++ b/src/code_8092334.c @@ -36,6 +36,7 @@ void xxx_init_struct_8094924_save_809486C(struct unkStruct_8094924 *r0, u8 *r1, MemoryClear8(r1, size); } +// Related to reading/writing bits void nullsub_102(struct unkStruct_8094924 *r0) { diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 850f2c1b1..5a828de6b 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -61,13 +61,13 @@ extern s32 sub_800E710(s16 a0, u16 a1); extern void sub_800E3AC(s32 a0, Position *pos, s32 a2); extern void sub_8041168(Entity *entity, Entity *entity2, Move *,Position *); extern Entity *sub_80696A8(Entity *a0); -extern Entity *sub_804AD0C(Position *pos); +extern Entity *GetMonsterAtPos(Position *pos); extern Entity *sub_80696FC(Entity *); extern Entity *sub_806977C(Entity *); extern void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct DamageStruct *dmgStruct); extern void sub_806ACE8(Entity *entity, Move *move); extern s32 sub_8057070(Move *move); -extern bool8 sub_805755C(Entity* pokemon,u16 param_2); +extern bool8 MoveRequiresCharging(Entity* pokemon,u16 param_2); extern s32 sub_800ED20(u16 param_1); extern bool32 sub_8058F04(Entity *pokemon, Entity *target, Move *move, s32 param_4); extern void sub_8042930(Entity *r0); @@ -514,7 +514,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move TrySendImmobilizeSleepEndMsg(attacker, currTarget); r4 = FALSE; if (!MoveMatchesChargingStatus(attacker, move)) { - r4 = (sub_805755C(attacker, move->id) != 0); + r4 = (MoveRequiresCharging(attacker, move->id) != 0); } if (!lightRodRedirect) { @@ -1621,7 +1621,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move } } else { - if (MoveCausesPaused(move) && sub_8057308(attacker, 0)) { + if (MoveCausesPaused(move) && RollSecondaryEffect(attacker, 0)) { gUnknown_202F222 = 1; } } @@ -1707,10 +1707,10 @@ static s32 TryHitTarget(Entity *attacker, Entity *target, Move *move, struct Dam else { TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9688); // It took no damage! } - dmgStruct->unkF = 1; + dmgStruct->tookNoDamage = TRUE; } - if (dmgStruct->unkF != 0) { + if (dmgStruct->tookNoDamage) { return 0; } @@ -1728,7 +1728,7 @@ s32 sub_8055864(Entity *attacker, Entity *target, Move *move, s32 param_4, s32 i sub_806F2BC(attacker, target, moveType, param_4, &dmgStruct); HandleDealingDamage(attacker, target, &dmgStruct, FALSE, TRUE, sub_8057600(move, itemId), TRUE, 0); - if (dmgStruct.unkF != 0) { + if (dmgStruct.tookNoDamage) { return 0; } @@ -2592,7 +2592,7 @@ void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 break; } - if (sub_805755C(attacker, move->id) && !MoveMatchesChargingStatus(attacker, move)) { + if (MoveRequiresCharging(attacker, move->id) && !MoveMatchesChargingStatus(attacker, move)) { var_34 = -1; } else { @@ -2833,7 +2833,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov direction &= DIRECTION_MASK; unkPositon.x = attacker->pos.x + gAdjacentTileOffsets[direction].x ; unkPositon.y = attacker->pos.y + gAdjacentTileOffsets[direction].y; - targetEntity = sub_804AD0C(&unkPositon); + targetEntity = GetMonsterAtPos(&unkPositon); if (targetEntity != NULL) { arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, targetEntity, move, canHitPartner); } @@ -3087,7 +3087,7 @@ u32 sub_8057144(Entity * pokemon) for (j = 0; j < MAX_MON_MOVES; j++) { if (moves[j].moveFlags & MOVE_FLAG_EXISTS - && !sub_805755C(pokemon, moves[j].id) + && !MoveRequiresCharging(pokemon, moves[j].id) && moves[j].id != MOVE_SKETCH && nMoves < 80) { moveStack[nMoves++] = &moves[j]; @@ -3175,7 +3175,7 @@ bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance) return uVar2; } -bool8 sub_8057308(Entity *pokemon, s32 chance) +bool8 RollSecondaryEffect(Entity *pokemon, s32 chance) { if(!EntityExists(pokemon)) return FALSE; diff --git a/src/move_actions.c b/src/move_actions.c index ebe52f36a..f245bb2a0 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -201,19 +201,19 @@ extern s32 sub_80556BC(Entity *, Entity *, u8, Move *, u32, u32); // move_util.h extern bool8 sub_805727C(Entity *, Entity *, s16); -bool8 sub_8057308(Entity *pokemon, s32 chance); +bool8 RollSecondaryEffect(Entity *pokemon, s32 chance); bool8 sub_80571F0(Entity * pokemon, Move *move); extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); extern u32 HandleDamagingMove(Entity *, Entity *, Move *, u32, u32); -u8 sub_8057620(u32 param_1); +u8 ToItemID(u32 param_1); extern s16 sub_8094828(u16, u8); extern void DealDamageToEntity(Entity *, s32, u32, u32); extern s16 gUnknown_80F4DB4; extern u32 gUnknown_8106A4C; -bool8 sub_805755C(Entity* pokemon, u16 moveID) +bool8 MoveRequiresCharging(Entity* pokemon, u16 moveID) { if ((moveID == MOVE_SOLARBEAM) && (GetApparentWeather(pokemon) == WEATHER_SUNNY)) { return FALSE; @@ -261,10 +261,10 @@ void sub_8057588(Entity * pokemon, u8 param_2) s16 sub_8057600(Move *move, s32 itemID) { - return sub_8094828(move->id, sub_8057620(itemID)); + return sub_8094828(move->id, ToItemID(itemID)); } -u8 sub_8057620(u32 itemID) +u8 ToItemID(u32 itemID) { if(itemID == ITEM_NOTHING) return ITEM_NOTHING; @@ -664,7 +664,7 @@ bool8 sub_8057E6C(Entity *pokemon, Entity *target, Move *move, u32 param_4) SendThawedMessage(pokemon,target); if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; - if (sub_8057308(pokemon, 0)) { + if (RollSecondaryEffect(pokemon, 0)) { entityInfo->unk155 = 1; } } @@ -1062,7 +1062,7 @@ bool8 sub_80586DC(Entity * pokemon, Entity * target, Move * move, u32 param_4) hasLiquidOoze = HasAbility(target, ABILITY_LIQUID_OOZE); uVar3 = HandleDamagingMove(pokemon,target,move,0x100,param_4); flag = uVar3 != 0 ? TRUE : FALSE; - if (flag && sub_8057308(pokemon, 0)) { + if (flag && RollSecondaryEffect(pokemon, 0)) { newHP = uVar3 / 2; entityInfo = GetEntInfo(pokemon); flag = TRUE; @@ -1151,7 +1151,7 @@ bool8 sub_80588B8(Entity *pokemon, Entity *target, Move *move, u32 param_4) if(HandleDamagingMove(pokemon, target, move, 0x80 << 1, param_4) != 0) { flag = TRUE; - if(sub_8057308(pokemon, 0)) + if(RollSecondaryEffect(pokemon, 0)) { gUnknown_202F219 = 1; } @@ -1178,7 +1178,7 @@ bool8 sub_8058930(Entity *pokemon, Entity *target, Move *move, u32 param_4) if(HandleDamagingMove(pokemon, target, move, 0x80 << 1, param_4) != 0) { flag = TRUE; - if(sub_8057308(pokemon, gUnknown_80F4DD6)) + if(RollSecondaryEffect(pokemon, gUnknown_80F4DD6)) { entityInfo = GetEntInfo(pokemon); RaiseMovementSpeedTarget(pokemon, pokemon, 0, TRUE); @@ -1212,7 +1212,7 @@ bool8 sub_8058A18(Entity *pokemon, Entity *target, Move *move, u32 param_4) if(HandleDamagingMove(pokemon, target, move, 0x80 << 1, param_4) != 0) { flag = TRUE; - if(sub_8057308(pokemon, 0)) + if(RollSecondaryEffect(pokemon, 0)) { gUnknown_202F21A = 1; } @@ -1351,7 +1351,7 @@ bool8 sub_8058CEC(Entity *pokemon, Entity *target, Move *move, u32 param_4) if(HandleDamagingMove(pokemon, target, move, 0x80 << 1, param_4) != 0) { flag = TRUE; - if(sub_8057308(pokemon, 0)) + if(RollSecondaryEffect(pokemon, 0)) { LowerAttackStageTarget(pokemon, pokemon, gUnknown_8106A50, 2, 0, FALSE); } @@ -1432,7 +1432,7 @@ bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4) iVar3 = 1; } flag = TRUE; - if ((!HasAbility(pokemon, ABILITY_ROCK_HEAD)) && sub_8057308(pokemon, 0)) { + if ((!HasAbility(pokemon, ABILITY_ROCK_HEAD)) && RollSecondaryEffect(pokemon, 0)) { sub_806F370(pokemon,pokemon,iVar3,0,0,0,0x1fd,0x14,1,0); } } @@ -1601,7 +1601,7 @@ bool8 sub_80591E4(Entity *pokemon, Entity *target, Move *move, s32 param_4) EntityInfo *entityInfo = GetEntInfo(pokemon); flag = TRUE; SetExpMultplier(entityInfo); - if (sub_8057308(pokemon,0)) { + if (RollSecondaryEffect(pokemon,0)) { if (hasLiquidOoze) { DealDamageToEntity(pokemon,iVar4,0xd,0x1fa); } @@ -1707,7 +1707,7 @@ bool8 sub_805946C(Entity * pokemon,Entity * target,Move * move,u32 param_4) flag = FALSE; if (HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; - if ((!HasAbility(pokemon, ABILITY_ROCK_HEAD)) && (sub_8057308(pokemon,0) != 0)) { + if ((!HasAbility(pokemon, ABILITY_ROCK_HEAD)) && (RollSecondaryEffect(pokemon,0) != 0)) { HP = GetEntInfo(pokemon)->maxHPStat; if (HP < 0) { HP = HP + 7; @@ -2464,7 +2464,7 @@ bool8 sub_805A464(Entity *pokemon, Entity *target, Move *move, u32 param_4) flag = FALSE; if (HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; - if (sub_8057308(pokemon, 0) != 0) { + if (RollSecondaryEffect(pokemon, 0) != 0) { if (!EntityExists(target)) { pos.x = 0; pos.y = 0; diff --git a/src/pokemon_mid.c b/src/pokemon_mid.c index eb2ad96b5..003357e91 100644 --- a/src/pokemon_mid.c +++ b/src/pokemon_mid.c @@ -696,7 +696,7 @@ const u8* DecompressMoveID(const u8* src, u16* moveID) return src; } -s32 sub_808E0AC(u16* a1, s16 species, s32 a3, s32 IQPoints) +s32 GetMovesLearnedAtLevel(u16* dst, s16 species, s32 level, s32 IQPoints) { const u8* stream; u16 moveID; // moveID @@ -720,20 +720,20 @@ s32 sub_808E0AC(u16* a1, s16 species, s32 a3, s32 IQPoints) stream = DecompressMoveID(stream, &moveID); v12 = *stream++; - if (v12 > a3) + if (v12 > level) break; - if (v12 == a3) { - bool8 cond = 1; + if (v12 == level) { + bool8 cond = TRUE; // NOTE: these moves require IQ to be > 333 - if ((moveID == MOVE_FRENZY_PLANT) && (IQPoints < gFrenzyPlantIQReq)) cond = 0; - if ((moveID == MOVE_HYDRO_CANNON) && (IQPoints < gHydroCannonIQReq)) cond = 0; - if ((moveID == MOVE_BLAST_BURN) && (IQPoints < gBlastBurnIQReq)) cond = 0; - if ((moveID == MOVE_VOLT_TACKLE) && (IQPoints < gVoltTackleIQReq)) cond = 0; + if ((moveID == MOVE_FRENZY_PLANT) && (IQPoints < gFrenzyPlantIQReq)) cond = FALSE; + if ((moveID == MOVE_HYDRO_CANNON) && (IQPoints < gHydroCannonIQReq)) cond = FALSE; + if ((moveID == MOVE_BLAST_BURN) && (IQPoints < gBlastBurnIQReq)) cond = FALSE; + if ((moveID == MOVE_VOLT_TACKLE) && (IQPoints < gVoltTackleIQReq)) cond = FALSE; if (cond) { if (count < 16) { - *a1++ = moveID; + *dst++ = moveID; ++count; } } @@ -928,7 +928,7 @@ void sub_808E490(Move* a1, s16 species) { u16 buffer[0x10]; // of moveIDs s32 i; - s32 count = sub_808E0AC(buffer, species, 1, 999); + s32 count = GetMovesLearnedAtLevel(buffer, species, 1, 999); if (count == 0) { count = 1; buffer[0] = MOVE_ITEM_TOSS; diff --git a/src/status_actions.c b/src/status_actions.c index 993926568..03f4418f8 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -79,7 +79,7 @@ extern void SqueezedStatusTarget(Entity *, Entity *, s32, bool32); extern void sub_8075C58(Entity *, Entity *, s32, s32); extern void DealDamageToEntity(Entity *, s32, u32, u32); -extern bool8 sub_805755C(Entity* pokemon,u16 moveID); +extern bool8 MoveRequiresCharging(Entity* pokemon,u16 moveID); extern void sub_80783C4(Entity *, Entity *, u32); @@ -431,7 +431,7 @@ bool8 MimicMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4 for(moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) { movePtr = &targetEntityInfo->moves.moves[moveIndex]; - if (((movePtr->moveFlags & MOVE_FLAG_EXISTS)) && !sub_805755C(pokemon,movePtr->id)) { + if (((movePtr->moveFlags & MOVE_FLAG_EXISTS)) && !MoveRequiresCharging(pokemon,movePtr->id)) { if ((movePtr->id != MOVE_MIMIC) && (movePtr->id != MOVE_ASSIST) && (movePtr->id != MOVE_SKETCH) && (movePtr->id != MOVE_MIRROR_MOVE) && (movePtr->id != MOVE_ENCORE) && ((movePtr->moveFlags & MOVE_FLAG_LAST_USED))) { entityInfo->mimicMoveIDs[moveCounter] = movePtr->id; @@ -517,9 +517,9 @@ bool8 sub_805B668(Entity * pokemon, Entity * target, Move *move, s32 param_4) if (newHP < 1) { newHP = 1; } - if (sub_8057308(pokemon,0) != 0) { + if (RollSecondaryEffect(pokemon,0) != 0) { SetExpMultplier(GetEntInfo(pokemon)); - if (sub_8057308(pokemon,0) != 0) { + if (RollSecondaryEffect(pokemon,0) != 0) { if (hasLiquidOoze) { DealDamageToEntity(pokemon,newHP,0xd,0x1fa); } @@ -637,7 +637,7 @@ bool8 sub_805B968(Entity * pokemon, Entity * target, Move * move, s32 param_4) flag = FALSE; if (HandleDamagingMove(pokemon,target,move,0x100,param_4) != 0) { flag = TRUE; - if (sub_8057308(pokemon,0) != 0) { + if (RollSecondaryEffect(pokemon,0) != 0) { entityHP = GetEntInfo(pokemon)->maxHPStat; if (entityHP < 0) { entityHP = entityHP + 3; diff --git a/src/tile_types.c b/src/tile_types.c index 81692b41f..a0277f8fd 100644 --- a/src/tile_types.c +++ b/src/tile_types.c @@ -90,7 +90,7 @@ extern void sub_8049BB0(s32, s32); void sub_8042A14(Position *); extern void sub_8049ED4(void); -bool8 sub_804ACE4(Position *pos) +bool8 PosHasItem(Position *pos) { struct Tile *tile; Entity *entity; @@ -103,7 +103,7 @@ bool8 sub_804ACE4(Position *pos) return FALSE; } -Entity *sub_804AD0C(Position *pos) +Entity *GetMonsterAtPos(Position *pos) { struct Tile *tile; Entity *entity; From ddcf8f59a285ea32692e44509ce49a715db8a467 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Thu, 7 Nov 2024 13:14:54 -0500 Subject: [PATCH 15/48] Update code_8042B34.c --- src/code_8042B34.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/code_8042B34.c b/src/code_8042B34.c index db3fd315c..b5bcc97f2 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -376,8 +376,7 @@ extern void sub_8046F84(s32 itemFlag); extern bool8 sub_8083C50(void); extern void sub_8068FE0(Entity *, u32, Entity *r2); extern void sub_806BFC0(EntityInfo *, u32); -extern s32 GetMovesLearnedAtLevel(u16* a1, s16 species, s32 a3, s32 IQPoints); -extern s32 GetMovesLearnedAtLevel(u16* a1, s16 species, s32 a3, s32 IQPoints); +extern s32 GetMovesLearnedAtLevel(u16* dst, s16 species, s32 level, s32 IQPoints); extern bool8 IsKeepMoney(u8 dungeon); extern void sub_8042B0C(Entity *); From dbb9f3983d8a35caeb79956facc17f5f08411af6 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sat, 9 Nov 2024 02:31:15 -0500 Subject: [PATCH 16/48] Fix this annoying bs --- asmdiff.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/asmdiff.sh b/asmdiff.sh index 3b92ab5be..886d54f3f 100755 --- a/asmdiff.sh +++ b/asmdiff.sh @@ -1,10 +1,6 @@ #!/bin/bash -if [[ -d "$DEVKITARM/bin/" ]]; then - OBJDUMP_BIN="$DEVKITARM/bin/arm-none-eabi-objdump" -else - OBJDUMP_BIN="arm-none-eabi-objdump" -fi +OBJDUMP_BIN="arm-none-eabi-objdump" OBJDUMP="$OBJDUMP_BIN -D -bbinary -marmv4t -Mforce-thumb" From c6d89036bbcf1aedaa2cd670acbfa212c73c0625 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sat, 9 Nov 2024 02:53:48 -0500 Subject: [PATCH 17/48] Fix GetBaseSpeciesNoUnown fakematch --- src/pokemon_3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 48986b1f0..a42ebf95d 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -189,7 +189,7 @@ s16 GetBaseSpecies(s16 index) { } s16 GetBaseSpeciesNoUnown(s16 index) { - register s32 a1_ asm("r2") = index; + s32 a1_ = SpeciesId(index); if (index == MONSTER_CASTFORM_SNOWY) { return MONSTER_CASTFORM; } From 15b4b39ff7953357b36901aed7ccb747e865dc58 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sat, 9 Nov 2024 03:22:29 -0500 Subject: [PATCH 18/48] Match sub_80948E4 --- asm/code_8080CF0.s | 188 +++--- asm/code_8098468.s | 2 +- asm/ground_script.s | 12 +- data/data_8107010.s | 2 +- include/code_8092334.h | 26 +- include/code_8094F88.h | 4 +- include/code_80958E8.h | 4 +- include/code_8097670.h | 84 ++- include/constants/move_id.h | 2 + include/exclusive_pokemon.h | 4 +- include/items.h | 8 +- include/moves.h | 8 +- include/pokemon.h | 12 +- include/structs/dungeon_entity.h | 10 +- include/structs/str_dungeon.h | 15 +- include/structs/str_pokemon.h | 6 +- include/structs/str_wonder_mail.h | 4 +- src/adventure_log.c | 56 +- src/code_803D0D8.c | 32 +- src/code_8042B34.c | 24 +- src/code_806FDF4.c | 4 +- src/code_8083288.c | 439 +++++++------ src/code_8092334.c | 189 +++--- src/code_809447C.c | 12 +- src/code_8094F88.c | 243 ++++---- src/code_80958E8.c | 122 ++-- src/code_8097670.c | 407 ++++++------ src/debug_menu1.c | 6 +- src/dungeon.c | 16 +- src/event_flag.c | 24 +- src/exclusive_pokemon.c | 24 +- src/friend_area.c | 16 +- src/game_options.c | 44 +- src/ground_script_1.c | 2 +- src/items.c | 86 +-- src/luminous_cave.c | 2 +- src/moves.c | 62 +- src/play_time.c | 20 +- src/pokemon_3.c | 344 ++++++----- src/rescue_team_info.c | 24 +- src/save.c | 34 +- src/trap_1.c | 993 +++++++++++++++--------------- src/wonder_mail_2.c | 2 +- sym_ewram2.txt | 4 +- 44 files changed, 1866 insertions(+), 1756 deletions(-) diff --git a/asm/code_8080CF0.s b/asm/code_8080CF0.s index 454206a52..00c92aa91 100644 --- a/asm/code_8080CF0.s +++ b/asm/code_8080CF0.s @@ -5,8 +5,8 @@ .text - thumb_func_start sub_8082280 -sub_8082280: + thumb_func_start RestoreDungeonEntity +RestoreDungeonEntity: push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -25,25 +25,25 @@ sub_8082280: movs r1, 0 bl memset adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x214] add r4, sp, 0x208 adds r0, r5, 0 adds r1, r4, 0 - bl sub_80831F8 + bl ReadPosition8 adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x218] adds r0, r5, 0 - bl sub_8083158 + bl ReadU16 lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x21C] @@ -51,7 +51,7 @@ sub_8082280: movs r0, 0 str r0, [r1] adds r0, r5, 0 - bl sub_8083158 + bl ReadU16 mov r1, sp strh r0, [r1] adds r0, r5, 0 @@ -63,89 +63,89 @@ sub_8082280: mov r1, sp strh r0, [r1, 0x2] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 mov r1, sp strb r0, [r1, 0x6] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 mov r1, sp strb r0, [r1, 0x7] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 mov r1, sp strb r0, [r1, 0x8] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 mov r1, sp strb r0, [r1, 0x9] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 mov r1, sp strb r0, [r1, 0xA] add r1, sp, 0x40 adds r0, r5, 0 - bl sub_8082F64 + bl ReadJoinedAt adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 mov r1, sp strh r0, [r1, 0xC] adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 mov r1, sp strh r0, [r1, 0xE] adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 mov r1, sp strh r0, [r1, 0x10] adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 mov r1, sp strh r0, [r1, 0x12] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 mov r1, sp strb r0, [r1, 0x14] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 mov r1, sp strb r0, [r1, 0x15] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 mov r1, sp strb r0, [r1, 0x16] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 mov r1, sp strb r0, [r1, 0x17] adds r0, r5, 0 bl sub_80831A0 str r0, [sp, 0x18] adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 mov r1, sp strh r0, [r1, 0x1C] adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 mov r1, sp strh r0, [r1, 0x1E] adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 mov r1, sp strh r0, [r1, 0x20] adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 mov r1, sp strh r0, [r1, 0x22] adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 mov r1, sp strh r0, [r1, 0x24] adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 mov r1, sp strh r0, [r1, 0x26] adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 mov r1, sp strh r0, [r1, 0x28] adds r0, r5, 0 @@ -162,7 +162,7 @@ sub_8082280: str r0, [sp, 0x38] add r1, sp, 0x44 adds r0, r5, 0 - bl sub_8082CBC + bl ReadActionContainer adds r0, r5, 0 bl sub_8082BFC add r1, sp, 0x5C @@ -269,20 +269,20 @@ sub_8082280: _080824DC: adds r0, r5, 0 adds r1, r4, 0 - bl sub_80831F8 + bl ReadPosition8 adds r4, 0x4 subs r6, 0x1 cmp r6, 0 bge _080824DC adds r0, r5, 0 adds r1, r7, 0 - bl sub_8082CE4 + bl ReadAITarget adds r0, r5, 0 mov r1, r8 - bl sub_8082D28 + bl Read3Bytes adds r0, r5, 0 mov r1, r9 - bl sub_8082D28 + bl Read3Bytes adds r0, r5, 0 bl sub_8082C84 movs r4, 0 @@ -290,7 +290,7 @@ _080824DC: strb r0, [r3] adds r0, r5, 0 ldr r1, [sp, 0x270] - bl sub_8082F80 + bl ReadHiddenPower adds r0, r5, 0 bl sub_80831A0 ldr r1, [sp, 0x274] @@ -305,93 +305,93 @@ _080824DC: str r0, [r3] adds r0, r5, 0 ldr r1, [sp, 0x284] - bl sub_8082D34 + bl ReadSleep adds r0, r5, 0 ldr r1, [sp, 0x288] - bl sub_8082D50 + bl ReadNonVolatile adds r0, r5, 0 ldr r1, [sp, 0x28C] - bl sub_8082D7C + bl ReadImmobilize adds r0, r5, 0 ldr r1, [sp, 0x290] - bl sub_8082DA8 + bl ReadVolatileStatus adds r0, r5, 0 ldr r1, [sp, 0x294] - bl sub_8082DC4 + bl ReadCharging adds r0, r5, 0 ldr r1, [sp, 0x298] - bl sub_8082DE8 + bl ReadProtection adds r0, r5, 0 ldr r1, [sp, 0x29C] - bl sub_8082E04 + bl ReadWaiting adds r0, r5, 0 ldr r1, [sp, 0x220] - bl sub_8082E38 + bl ReadLinked adds r0, r5, 0 ldr r1, [sp, 0x224] - bl sub_8082E6C + bl ReadMoveStatus adds r0, r5, 0 ldr r1, [sp, 0x228] bl sub_8082E88 adds r0, r5, 0 ldr r1, [sp, 0x22C] - bl sub_8082E94 + bl ReadTransformStatus adds r0, r5, 0 ldr r1, [sp, 0x230] - bl sub_8082EB0 + bl ReadEyesightStatus adds r0, r5, 0 ldr r1, [sp, 0x234] - bl sub_8082ECC + bl ReadMuzzled adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r1, [sp, 0x238] strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r2, [sp, 0x23C] strb r0, [r2] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r3, [sp, 0x240] strb r0, [r3] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r1, [sp, 0x244] strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r2, [sp, 0x248] strb r0, [r2] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 ldr r3, [sp, 0x25C] strb r0, [r3] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r1, [sp, 0x24C] strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r2, [sp, 0x250] strb r0, [r2] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r3, [sp, 0x254] strb r0, [r3] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 ldr r1, [sp, 0x258] strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r2, [sp, 0x260] strb r0, [r2] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 ldr r3, [sp, 0x264] strb r0, [r3] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 ldr r1, [sp, 0x268] strb r0, [r1] adds r0, r5, 0 @@ -409,20 +409,20 @@ _080824DC: add r1, sp, 0x108 adds r0, r5, 0 movs r2, 0x5 - bl sub_8083288 + bl xxx_ReadBytes ldr r1, _08082674 add r1, sp adds r0, r5, 0 movs r2, 0x5 - bl sub_8083288 + bl xxx_ReadBytes adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 movs r1, 0x89 lsls r1, 1 add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 b _08082678 .align 2, 0 _0808266C: .4byte 0xfffffd60 @@ -433,14 +433,14 @@ _08082678: add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 add r1, sp, 0x114 lsls r0, 24 lsrs r0, 24 str r0, [r1] add r1, sp, 0x118 adds r0, r5, 0 - bl sub_8082F1C + bl ReadMoves add r1, sp, 0x13C adds r0, r5, 0 bl sub_8082F48 @@ -448,131 +448,131 @@ _08082678: adds r0, r5, 0 bl sub_8082F48 adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 add r1, sp, 0x144 strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r1, _0808281C add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r1, _08082820 add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 movs r1, 0xA3 lsls r1, 1 add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 add r1, sp, 0x148 strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r1, _08082824 add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 movs r1, 0xA5 lsls r1, 1 add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r1, _08082828 add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 add r1, sp, 0x14C strb r0, [r1] adds r0, r5, 0 - bl sub_8083158 + bl ReadU16 movs r1, 0xA7 lsls r1, 1 add r1, sp strh r0, [r1] adds r0, r5, 0 - bl sub_8083158 + bl ReadU16 add r1, sp, 0x150 strh r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 movs r1, 0xA9 lsls r1, 1 add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 ldr r1, _0808282C add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 add r1, sp, 0x154 strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 ldr r1, _08082830 add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_80831DC + bl ReadBool8 movs r1, 0xAB lsls r1, 1 add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 add r1, sp, 0x164 strb r0, [r1] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 ldr r1, _08082834 add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 movs r1, 0xB3 lsls r1, 1 add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 ldr r1, _08082838 add r1, sp strb r0, [r1] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 add r1, sp, 0x168 strb r0, [r1] adds r0, r5, 0 - bl sub_8083188 + bl ReadU8 ldr r1, _0808283C add r1, sp strb r0, [r1] add r1, sp, 0x16C adds r0, r5, 0 - bl sub_80831F8 + bl ReadPosition8 adds r0, r5, 0 bl sub_80831C8 add r1, sp, 0x174 str r0, [r1] adds r0, r5, 0 - bl sub_8083158 + bl ReadU16 add r1, sp, 0x178 strh r0, [r1] adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 add r1, sp, 0x1F8 strh r0, [r1] adds r0, r5, 0 - bl sub_8083170 + bl ReadS16 movs r1, 0xFD lsls r1, 1 add r1, sp @@ -688,7 +688,7 @@ _080828BE: _080828D4: .4byte 0x0000020a _080828D8: .4byte gLeaderPointer _080828DC: .4byte gUnknown_203B410 - thumb_func_end sub_8082280 + thumb_func_end RestoreDungeonEntity thumb_func_start sub_80828E0 sub_80828E0: diff --git a/asm/code_8098468.s b/asm/code_8098468.s index 3f61e4154..e775a7b4a 100644 --- a/asm/code_8098468.s +++ b/asm/code_8098468.s @@ -400,7 +400,7 @@ _080987C0: bl DeleteGroundEffects bl sub_809C658 bl nullsub_16 - bl sub_8097944 + bl UpdateAdventureAchievements cmp r7, r4 beq _08098848 adds r0, r7, 0 diff --git a/asm/ground_script.s b/asm/ground_script.s index 23f75bf91..eccbf5a19 100644 --- a/asm/ground_script.s +++ b/asm/ground_script.s @@ -487,7 +487,7 @@ _080A195A: movs r2, 0xA bl sub_80922B4 _080A1968: - bl sub_8097848 + bl IncrementAdventureNumJoined bl _080A236A .align 2, 0 _080A1970: .4byte gUnknown_8116710 @@ -526,7 +526,7 @@ _080A1988: bne _080A19C2 b _080A1EBE _080A19C2: - bl sub_8097848 + bl IncrementAdventureNumJoined ldrh r1, [r4] movs r0, 0x2 orrs r0, r1 @@ -626,7 +626,7 @@ _080A1A70: bl sub_808D2E8 cmp r0, 0 beq _080A1A9A - bl sub_8097848 + bl IncrementAdventureNumJoined _080A1A9A: movs r0, 0x92 movs r1, 0 @@ -641,7 +641,7 @@ _080A1A9A: bl sub_808D2E8 cmp r0, 0 beq _080A1ABC - bl sub_8097848 + bl IncrementAdventureNumJoined _080A1ABC: movs r0, 0x90 movs r1, 0 @@ -660,7 +660,7 @@ _080A1ACC: bne _080A1AE2 bl _080A236A _080A1AE2: - bl sub_8097848 + bl IncrementAdventureNumJoined bl _080A236A .align 2, 0 _080A1AEC: .4byte gUnknown_8116788 @@ -1121,7 +1121,7 @@ _080A1EAC: adds r2, 0x1 cmp r2, 0x9 ble _080A1EAC - bl sub_8097848 + bl IncrementAdventureNumJoined _080A1EBE: movs r0, 0x1 b _080A236C diff --git a/data/data_8107010.s b/data/data_8107010.s index 71b51f094..ffa26cedf 100644 --- a/data/data_8107010.s +++ b/data/data_8107010.s @@ -89,7 +89,7 @@ gUnknown_8107178: @ 8107178 .string "pksdir0\0" @ ??? .string "pksdir0\0" -@ sub_8080B30 - sub_808217C +@ WriteDungeonState - sub_808217C .string "pksdir0\0" .global gYayoiSan diff --git a/include/code_8092334.h b/include/code_8092334.h index b07336fbb..3a2fe8e51 100644 --- a/include/code_8092334.h +++ b/include/code_8092334.h @@ -1,21 +1,19 @@ #ifndef GUARD_CODE_8092334_H #define GUARD_CODE_8092334_H -// size: 0x10? -typedef struct unkStruct_8094924 +// size: 0x10 +typedef struct DataSerializer { - u8 *unk0; // head? - u8 *unk4; // tail? - u32 unk8; - u32 unkC; -} unkStruct_8094924; + u8 *stream; + u8 *end; // exclusive end of the stream + u32 count; // Used to count bits between ReadBits functions, or count bytes between ReadBytes functions + u32 unkC; // Seems to be a temporary 32 bit storage +} DataSerializer; -void nullsub_102(unkStruct_8094924 *); -void RestoreIntegerBits(unkStruct_8094924 *, void *, s32 size); -void SaveIntegerBits(unkStruct_8094924 *, void *, s32 size); -void xxx_init_struct_8094924_restore_809485C(unkStruct_8094924 *, u8 *, s32 size); -void xxx_init_struct_8094924_save_809486C(unkStruct_8094924 *, u8 *, s32 size); - -void sub_80948E4(unkStruct_8094924 *, u8 *, s32 size); +void nullsub_102(DataSerializer *seri); +void ReadBits(DataSerializer *seri, void *dst, s32 numBits); +void WriteBits(DataSerializer *seri, void *src, s32 numBits); +void InitBitReader(DataSerializer *seri, u8 *buffer, s32 bufLen); +void InitBitWriter(DataSerializer *seri, u8 *buffer, s32 bufLen); #endif // GUARD_CODE_8092334_H \ No newline at end of file diff --git a/include/code_8094F88.h b/include/code_8094F88.h index dd204cd53..08818a50a 100644 --- a/include/code_8094F88.h +++ b/include/code_8094F88.h @@ -46,7 +46,7 @@ u32 CountAllMail(void); s32 sub_8095374(void); s32 GetMailIndex(u8 mailType, u32); s32 GetFirstIndexofMailType(u8 mailType); -void sub_8095824(struct unkStruct_8094924 *a, unkStruct_203B480 *b); -void sub_8095774(struct unkStruct_8094924 *a, unkStruct_203B480 *b); +void sub_8095824(DataSerializer *a, unkStruct_203B480 *b); +void sub_8095774(DataSerializer *a, unkStruct_203B480 *b); #endif // GUARD_CODE_8094F88_H \ No newline at end of file diff --git a/include/code_80958E8.h b/include/code_80958E8.h index 0a1f0717f..1f6df94e5 100644 --- a/include/code_80958E8.h +++ b/include/code_80958E8.h @@ -68,7 +68,7 @@ u8 *sub_8096DD8(void); u8 *sub_8096DE8(void); u8 sub_8096E2C(void); void sub_8096EEC(WonderMail *mail); -void SaveWonderMail(unkStruct_8094924 *a, WonderMail *b); -void RestoreWonderMail(unkStruct_8094924 *a, WonderMail *b); +void WriteWonderMailBits(DataSerializer *a, WonderMail *b); +void ReadWonderMailBits(DataSerializer *a, WonderMail *b); #endif // GUARD_CODE_80958E8_H diff --git a/include/code_8097670.h b/include/code_8097670.h index 3e75505c0..34f15dbab 100644 --- a/include/code_8097670.h +++ b/include/code_8097670.h @@ -3,21 +3,59 @@ #include "structs/str_dungeon.h" +// See gAdventureLogText +enum AdventureAchievement +{ + AA_HILL_OF_ANCIENTS, + AA_FUGITIVE, + AA_PREVENT_METEOR, + AA_BROKE_CURSE, + AA_TEAM_BASE_DONE, + AA_SMEARGLE, + AA_SPOTTED_MUNCHLAX, + AA_NUM_MOVES_LEARNED, + AA_NUM_FRIEND_RESCUE_SUCCESSES, + AA_NUM_POKEMON_EVOLVED, + AA_NUM_POKEMON_JOINED, + AA_NUM_THIEVING_SUCCESSES, + AA_NUM_FLOORS_EXPLORED, + AA_ALL_FRIEND_AREAS, + AA_ALL_POKEMON_LEADERS, + AA_ALL_POKEMON_JOINED, + AA_RECRUIT_MOLTRES, + AA_RECRUIT_ZAPDOS, + AA_RECRUIT_ARTICUNO, + AA_RECRUIT_DEOXYS, + AA_RECRUIT_ENTEI, + AA_RECRUIT_RAIKOU, + AA_RECRUIT_SUICUNE, + AA_RECRUIT_HO_OH, + AA_RECRUIT_KYOGRE, + AA_RECRUIT_GROUDON, + AA_RECRUIT_RAYQUAZA, + AA_RECRUIT_LUGIA, + AA_RECRUIT_CELEBI, + AA_RECRUIT_MEW, + AA_RECRUIT_MEWTWO, + AA_RECRUIT_JIRACHI, + AA_MAX +}; + // size: 0xC4 struct unkStruct_203B494 { - u32 unk0; // 32 bit bitfield, I think + /* 0x4 */ u32 achievements; // Adventure achievement flags /* 0x4 */ s32 numAdventures; - s32 unk8; - s32 unkC; + /* 0x8 */ s32 friendRescueSuccesses; + /* 0xC */ s32 numEvolved; /* 0x10 */ DungeonLocation dungeonLocation; - s16 unk14; - s16 unk16; - s16 unk18; + /* 0x14 */ s16 thievingSuccesses; + /* 0x16 */ s16 numJoined; + /* 0x18 */ s16 adventureMovesLearned; u32 unk1C[14]; u32 unk54[14]; - u32 unk8C[13]; - s32 unkC0; + /* 0x8C */ u32 learnedMoves[13]; // Get with `learnedMoves[move / 32] & 1 << move % 32` ... Set with `learnedMoves[move / 32] |= 1 << move % 32` + /* 0xC0 */ s32 numFloorsExplored; }; extern struct unkStruct_203B494 *gUnknown_203B494; @@ -29,20 +67,20 @@ void ResetNumAdventures(void); void sub_8097670(void); struct unkStruct_203B494 *sub_8097680(void); -void sub_80976A8(void); -void sub_80976F8(u8); -bool8 sub_8097710(u8); -void sub_8097790(void); -s32 sub_80977B8(void); -void sub_80977D0(void); -s32 sub_80977F8(void); -s16 sub_8097838(void); -void sub_8097848(void); -s16 sub_8097870(void); -s16 sub_8097880(void); -s16 sub_80978B8(void); -void sub_8097944(void); -u32 sub_8097D60(u8 *r0, u32 size); -u32 sub_8097D98(u8 *r0, u32 size); +void ResetAdventureInfo(void); +void SetAdventureAchievement(u8); +bool8 GetAdventureAchievement(u8); +void IncrementFriendRescueSuccesses(void); +s32 GetFriendRescueSuccesses(void); +void IncrementNumEvolved(void); +s32 GetAdventureNumEvolved(void); +s16 GetThievingSuccesses(void); +void IncrementAdventureNumJoined(void); +s16 GetAdventureNumJoined(void); +s16 GetAdventureMovesLearned(void); +s16 GetAdventureFloorsExplored(void); +void UpdateAdventureAchievements(void); +u32 SaveAdventureData(u8 *r0, u32 size); +u32 RestoreAdventureData(u8 *r0, u32 size); #endif // GUARD_CODE_8097670_H diff --git a/include/constants/move_id.h b/include/constants/move_id.h index b20521c92..01c376a7c 100644 --- a/include/constants/move_id.h +++ b/include/constants/move_id.h @@ -418,4 +418,6 @@ #define MOVE_MD1_2 0x19B // Unused #define MOVE_PIERCE 0x19C +#define NUM_MOVE_IDS (MOVE_PIERCE + 1) + #endif diff --git a/include/exclusive_pokemon.h b/include/exclusive_pokemon.h index 4b5f6ef2f..e4818501f 100644 --- a/include/exclusive_pokemon.h +++ b/include/exclusive_pokemon.h @@ -57,7 +57,7 @@ void SetTutorialFlag(s32 param_1); bool32 GetTutorialFlag(s32 param_1); bool8 IsExclusivePokemonUnlocked(s16 pokeID); void UnlockExclusivePokemon(s16 pokeID); -void WriteExclusivePokemon(struct unkStruct_8094924 *r0); -void ReadExclusivePokemon(struct unkStruct_8094924 *r0); +void WriteExclusivePokemon(DataSerializer *r0); +void ReadExclusivePokemon(DataSerializer *r0); #endif // GUARD_EXCLUSIVE_POKEMON_H diff --git a/include/items.h b/include/items.h index a57805e82..bdae533f7 100644 --- a/include/items.h +++ b/include/items.h @@ -68,10 +68,10 @@ bool8 IsInvalidItemReward(u8 itemID); bool8 HasGummiItem(void); void GetGummiItemStatBoost(PokemonStruct1* pokemon, u8 id, bool8 checkBoostFlags, Gummi *gummi); -void RestoreHeldItem(unkStruct_8094924 *, BulkItem *); -void SaveHeldItem(unkStruct_8094924 *, BulkItem *); -void RestoreItemSlot(unkStruct_8094924 *, Item *); -void SaveItemSlot(unkStruct_8094924 *, Item *); +void ReadHeldItemBits(DataSerializer *, BulkItem *); +void WriteHeldItemBits(DataSerializer *, BulkItem *); +void ReadItemSlotBits(DataSerializer *, Item *); +void WriteItemSlotBits(DataSerializer *, Item *); s32 RestoreTeamInventory(u8 *, u32 size); s32 SaveTeamInventory(u8 *, u32 size); diff --git a/include/moves.h b/include/moves.h index 30e87ce5e..18e3a6035 100644 --- a/include/moves.h +++ b/include/moves.h @@ -51,8 +51,8 @@ void LoadWazaParameters(void); bool8 MoveCannotHitFrozen(Move *move); bool8 MoveIgnoresTaunted(Move *move); void RemoveLinkSequenceFromMoves8(Move *moves, s32 index); -void RestorePokemonMoves(struct unkStruct_8094924 *, Move *moveSet); -void SavePokemonMoves(struct unkStruct_8094924 *, Move *moveSet); +void ReadPoke1MovesBits(DataSerializer *, Move *moveSet); +void WritePoke1MovesBits(DataSerializer *, Move *moveSet); bool8 ToggleMoveEnabled(s32 index, Move *moves); bool8 ToggleSetMove(s32 index, Move *moves); bool8 TryLinkMovesAfter(s32 index, Move *moves); @@ -86,8 +86,8 @@ bool8 sub_8093318(s32, Move *moves); bool8 sub_809333C(s32, Move *moves); s32 sub_80935B8(Move *moves, s32 index); void sub_8094060(Move *srcMoves, Move *destMoves); -void sub_8094184(struct unkStruct_8094924 *, struct Moves *); -void sub_80941FC(struct unkStruct_8094924 *, struct Moves *); +void WritePoke2MovesBits(DataSerializer *, struct Moves *); +void ReadPoke2MovesBits(DataSerializer *, struct Moves *); static inline bool8 MoveFlagExists(Move *move) { diff --git a/include/pokemon.h b/include/pokemon.h index 0d10e72a7..2424fb24e 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -11,7 +11,9 @@ enum PokemonUnk0Flags { - FLAG_ON_TEAM = 2, + FLAG_NONE = 0, + FLAG_UNK_1 = 1, + FLAG_ON_TEAM = 2, // Mon is not on "standby" }; // size: 0x1A4 @@ -83,8 +85,8 @@ s32 GetUnownIndex(s16 index); void GenerateHiddenPower(HiddenPower *); s32 GetEvolutionSequence(PokemonStruct1 *pokemon, EvolveStage *); void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 *, PokemonStruct1 *, s32); -void SavePokemonStruct(unkStruct_8094924 *, PokemonStruct1 *pokemon); -void RestorePokemonStruct(unkStruct_8094924 *, PokemonStruct1 *); +void WritePoke1Bits(DataSerializer *, PokemonStruct1 *pokemon); +void ReadPoke1Bits(DataSerializer *, PokemonStruct1 *); s32 sub_808E218(unkStruct_808E218_arg *, PokemonStruct1 *pokemon); void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID); void sub_808D0D8(PokemonStruct1 *pokemon); @@ -100,12 +102,12 @@ extern s32 sub_808D580(s32 *); static inline bool8 PokemonFlag1(PokemonStruct1 *mon) { - return ((mon->unk0 & 1)); + return (mon->unk0 & FLAG_UNK_1); } static inline bool8 PokemonFlag2(PokemonStruct1 *mon) { - return (((mon->unk0 >> (FLAG_ON_TEAM - 1)) & 1)); + return ((mon->unk0 >> (FLAG_ON_TEAM - 1)) & 1); } static inline void SetPokemonFlag2(PokemonStruct1 *mon) diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 0575a7d55..8bed713aa 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -26,6 +26,8 @@ #define STAT_STAGE_ACCURACY 0 #define STAT_STAGE_EVASION 1 +#define NUM_PICKED_IQ_SKILLS 3 + typedef struct unkStruct_8044CC8 { u8 actionUseIndex; @@ -37,7 +39,7 @@ typedef struct ActionContainer { /* 0x0 */ u16 action; /* 0x2 */ u8 direction; - u8 fill3; + u8 unk3; // Additional parameter alongside actionIndex. Used for things like indicating which move a PokĂ©mon should use from its moveset. /* 0x4 */ unkStruct_8044CC8 unk4[2]; // Position of the target that the PokĂ©mon wants throw an item at. @@ -224,8 +226,10 @@ typedef struct EntityInfo /* 0x68 */ Position prevPos[NUM_PREV_POS]; /* 0x78 */ AITarget aiTarget; // Bitwise flags corresponding to selected IQ skills. - /* 0x8C */ u8 IQSkillMenuFlags[4]; // IQ skills selected in the IQ skills menu. - /* 0x90 */ u8 IQSkillFlags[4]; + /* 0x8C */ u8 IQSkillMenuFlags[NUM_PICKED_IQ_SKILLS]; // IQ skills selected in the IQ skills menu. + u8 padding8F; + /* 0x90 */ u8 IQSkillFlags[NUM_PICKED_IQ_SKILLS]; + u8 padding93; /* 0x94 */ u8 tactic; u8 fill95[0x98 - 0x95]; /* 0x98 */ u32 unk98; diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index c7daddb1b..590f23722 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -264,6 +264,8 @@ typedef struct Dungeon /* 0x5C0 */ s32 unk5C0; /* 0x5C4 */ struct unkStruct_Dungeon5C4_sub unk5C4[3]; /* 0x5F4 */ u8 faintStringBuffer[80]; + + // TODO: This is the start of a struct that is 0x58 bytes (dungeon data that persists between save/reload). See sub_8080B90 and sub_8081C50 /* 0x644 */ DungeonLocation dungeonLocation; /* 0x648 */ DungeonLocation dungeonLocation2; struct unkStruct_Dungeon64C unk64C; @@ -277,7 +279,7 @@ typedef struct Dungeon u8 unk65B; u8 unk65C; u8 unk65D; - u8 fill65e[0x660 - 0x65e]; + u8 fill65e[2]; /* 0x660 */ s16 fractionalTurn; // Handles turn order when PokĂ©mon have different movement speeds. s16 unk662; s16 unk664; @@ -312,7 +314,8 @@ typedef struct Dungeon s32 unk694; u8 unk698; u8 unk699; - u8 fill69A[0x69C - 0x69A]; + u8 fill69A[2]; + EntityInfo unk69C[4]; EntityInfo unkEBC[1]; // Unsure about the size... See sub_8082A08() u8 fill10C4[0x343C - 0x10C4]; @@ -350,11 +353,9 @@ typedef struct Dungeon Position unkE218; Position unkE21C; // stair location? Position unkE220[8]; - u32 unkE240; - u8 fillE244[0xE250 - 0xE244]; - u32 unkE250; - u8 fillE254[0xE260 - 0xE254]; - u32 unkE260; + u32 unkE240[4]; + u32 unkE250[4]; + u16 unkE260[2]; /* 0xE264 */ Weather weather; // Uses the weather constants in weather.h. /* 0xE27C */ Tile unkE27C[8][8]; /* 0xE87C */ u8 unkE87C[8][8]; diff --git a/include/structs/str_pokemon.h b/include/structs/str_pokemon.h index 9f601e689..4c8a2d40d 100644 --- a/include/structs/str_pokemon.h +++ b/include/structs/str_pokemon.h @@ -23,7 +23,7 @@ typedef struct unkPokeSubStruct_C // size: 0x58 typedef struct PokemonStruct1 { - u16 unk0; // Probably a union: Sometimes ldrh and sometimes ldrb. Recruited?? + u16 unk0; // Probably a union: Sometimes ldrh and sometimes ldrb. Recruited?? "sub_80954CC" only loads 2 bits of info /* 0x2 */ bool8 isTeamLeader; /* 0x3 */ u8 level; /* 0x4 */ DungeonLocation dungeonLocation; @@ -71,8 +71,8 @@ typedef struct PokemonStruct2 /* 0x18 */ u32 currExp; /* 0x1C */ Moves moves; /* 0x40 */ Item itemSlot; // heldItem - FixedPoint belly; // some struct - FixedPoint maxBelly; // some struct (same type as 44) + /* 0x44 */ FixedPoint belly; + /* 0x48 */ FixedPoint maxBelly; /* 0x4C */ u32 IQSkills; // unk20 /* 0x50 */ u8 tacticIndex; /* 0x54 */ HiddenPower hiddenPower; diff --git a/include/structs/str_wonder_mail.h b/include/structs/str_wonder_mail.h index fcf48db54..101e96928 100644 --- a/include/structs/str_wonder_mail.h +++ b/include/structs/str_wonder_mail.h @@ -64,8 +64,8 @@ typedef struct unkStruct_203B480 u32 unk10; u16 unk10_u16; } unk10; - /* 0x14 */ u8 playerName[0x20 - 0x14]; - Item item; + /* 0x14 */ u8 playerName[10]; + /* 0x20 */ Item item; u32 unk24; u32 unk28; /* 0x2C */ s8 rescuesAllowed; diff --git a/src/adventure_log.c b/src/adventure_log.c index 84c6be48f..427af9730 100644 --- a/src/adventure_log.c +++ b/src/adventure_log.c @@ -87,8 +87,7 @@ static void DisplayAdventureLog(void) s32 i; s32 r4; // r4 s32 r6; // r6 - u8 temp; - s32 v1, v2, v3, v4, v5, v6; + u8 aa; CallPrepareTextbox_8008C54(sAdventureLog->s0.unk34); sub_80073B8(sAdventureLog->s0.unk34); @@ -102,42 +101,49 @@ static void DisplayAdventureLog(void) sub_8012BC4(r6, 0, sAdventureLog->s0.input.unk1E + 1, 1, 7, sAdventureLog->s0.unk34); for (i = 0; i < sAdventureLog->s0.input.unk1A; i++) { - temp = (sAdventureLog->s0.input.unk1E * sAdventureLog->s0.input.unk1C) + i; + aa = (sAdventureLog->s0.input.unk1E * sAdventureLog->s0.input.unk1C) + i; - if (sub_8097710(temp)) { - switch (temp) { - case 12: - v1 = sub_80978B8(); + if (GetAdventureAchievement(aa)) { + switch (aa) { + case AA_NUM_FLOORS_EXPLORED: { + s32 v1 = GetAdventureFloorsExplored(); gFormatArgs[0] = (s16)v1; - PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(temp), sAdventureLog->s0.unk34, 0); + PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(aa), sAdventureLog->s0.unk34, 0); break; - case 7: - v2 = sub_8097880(); + } + case AA_NUM_MOVES_LEARNED: { + s32 v2 = GetAdventureMovesLearned(); gFormatArgs[0] = (s16)v2; - PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(temp), sAdventureLog->s0.unk34, 0); + PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(aa), sAdventureLog->s0.unk34, 0); break; - case 11: - v3 = sub_8097838(); + } + case AA_NUM_THIEVING_SUCCESSES: { + s32 v3 = GetThievingSuccesses(); gFormatArgs[0] = (s16)v3; - PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(temp), sAdventureLog->s0.unk34, 0); + PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(aa), sAdventureLog->s0.unk34, 0); break; - case 8: - v4 = sub_80977B8(); + } + case AA_NUM_FRIEND_RESCUE_SUCCESSES: { + s32 v4 = GetFriendRescueSuccesses(); gFormatArgs[0] = v4; - PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(temp), sAdventureLog->s0.unk34, 0); + PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(aa), sAdventureLog->s0.unk34, 0); break; - case 9: - v5 = sub_80977F8(); + } + case AA_NUM_POKEMON_EVOLVED: { + s32 v5 = GetAdventureNumEvolved(); gFormatArgs[0] = v5; - PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(temp), sAdventureLog->s0.unk34, 0); + PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(aa), sAdventureLog->s0.unk34, 0); break; - case 10: - v6 = sub_8097870(); + } + case AA_NUM_POKEMON_JOINED: { + s32 v6 = GetAdventureNumJoined(); gFormatArgs[0] = (s16)v6; // fallthrough - default: - PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(temp), sAdventureLog->s0.unk34, 0); + } + default: { + PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(aa), sAdventureLog->s0.unk34, 0); break; + } } } else @@ -145,4 +151,4 @@ static void DisplayAdventureLog(void) } sub_80073E0(sAdventureLog->s0.unk34); -} +} \ No newline at end of file diff --git a/src/code_803D0D8.c b/src/code_803D0D8.c index 3c424f85d..03f37c8af 100644 --- a/src/code_803D0D8.c +++ b/src/code_803D0D8.c @@ -36,7 +36,7 @@ u8 sub_803D110(u8 *param_1, u8 *param_2, s32 size) s32 index1; s32 newSize; s32 save; - unkStruct_8094924 auStack_88; + DataSerializer auStack_88; u8 local_78 [56]; u8 auStack_40 [36]; @@ -62,11 +62,11 @@ u8 sub_803D110(u8 *param_1, u8 *param_2, s32 size) newSize >>= 3; save = newSize; - xxx_init_struct_8094924_save_809486C(&auStack_88,auStack_40, save); + InitBitWriter(&auStack_88,auStack_40, save); for(index1 = 0; index1 < size; index1++) { - SaveIntegerBits(&auStack_88, &local_78[index1], 5); + WriteBits(&auStack_88, &local_78[index1], 5); } nullsub_102(&auStack_88); MemoryCopy8(param_2, auStack_40, save); @@ -77,7 +77,7 @@ void sub_803D1A8(u8 *param_1, u8 *param_2, s32 size) { s32 index; s32 newSize; - unkStruct_8094924 auStack_5c; + DataSerializer auStack_5c; u8 local_4c [56]; newSize = size * 5 + 5; @@ -85,10 +85,10 @@ void sub_803D1A8(u8 *param_1, u8 *param_2, s32 size) newSize = size * 5 + 0xc; } newSize >>= 3; - xxx_init_struct_8094924_restore_809485C(&auStack_5c, param_2, newSize); + InitBitReader(&auStack_5c, param_2, newSize); for(index = 0; index < size; index++) { - RestoreIntegerBits(&auStack_5c, &local_4c[index], 5); + ReadBits(&auStack_5c, &local_4c[index], 5); } nullsub_102(&auStack_5c); @@ -105,7 +105,7 @@ bool8 sub_803D204(u8 *buffer,unkStruct_203B480 *param_2) u8 local_c4 [34]; u8 translateBuffer [PASSWORD_BUFFER_SIZE]; u8 localBuffer [PASSWORD_BUFFER_SIZE]; - unkStruct_8094924 uStack_30; + DataSerializer uStack_30; s32 index; checksum = 0; @@ -127,7 +127,7 @@ bool8 sub_803D204(u8 *buffer,unkStruct_203B480 *param_2) checksum += local_c4[index] + index; } if (local_c4[0] == checksum) { - xxx_init_struct_8094924_restore_809485C(&uStack_30,&local_c4[1],33); + InitBitReader(&uStack_30,&local_c4[1],33); sub_8095774(&uStack_30,param_2); nullsub_102(&uStack_30); return TRUE; @@ -143,7 +143,7 @@ void sub_803D2C0(u8 *buffer, unkStruct_203B480 *mail) u8 local_c0 [34]; u8 buffer1 [PASSWORD_BUFFER_SIZE]; u8 buffer2 [PASSWORD_BUFFER_SIZE]; - unkStruct_8094924 auStack_2c; + DataSerializer auStack_2c; checksum = 0; @@ -152,7 +152,7 @@ void sub_803D2C0(u8 *buffer, unkStruct_203B480 *mail) local_c0[index] = 0; } - xxx_init_struct_8094924_save_809486C(&auStack_2c,&local_c0[1],33); + InitBitWriter(&auStack_2c,&local_c0[1],33); sub_8095824(&auStack_2c,mail); nullsub_102(&auStack_2c); for(index = 1; index < 34; index++) @@ -176,7 +176,7 @@ bool8 DecodeWonderMailPassword(u8* buffer, WonderMail *mail) u8 local_70 [16]; u8 local_60 [24]; u8 password [24]; - unkStruct_8094924 puVar1; + DataSerializer puVar1; checksum = 0; MemoryCopy8(password,buffer,24); @@ -199,8 +199,8 @@ bool8 DecodeWonderMailPassword(u8* buffer, WonderMail *mail) checksum += (local_70[index] + index); } if (local_70[0] == checksum) { - xxx_init_struct_8094924_restore_809485C(&puVar1,&local_70[1],0xc); - RestoreWonderMail(&puVar1,mail); + InitBitReader(&puVar1,&local_70[1],0xc); + ReadWonderMailBits(&puVar1,mail); nullsub_102(&puVar1); return TRUE; } @@ -215,7 +215,7 @@ void sub_803D414(u8 *buffer,WonderMail *mail) u8 local_6c [15]; u8 local_5c [24]; u8 auStack_44 [24]; - unkStruct_8094924 uStack_2c; + DataSerializer uStack_2c; checksum = 0; for(index = 0; index < 0xF; index++) @@ -223,8 +223,8 @@ void sub_803D414(u8 *buffer,WonderMail *mail) local_6c[index] = 0; } - xxx_init_struct_8094924_save_809486C(&uStack_2c,&local_6c[1],12); - SaveWonderMail(&uStack_2c,mail); + InitBitWriter(&uStack_2c,&local_6c[1],12); + WriteWonderMailBits(&uStack_2c,mail); nullsub_102(&uStack_2c); for(index = 1; index < 0xF; index++) diff --git a/src/code_8042B34.c b/src/code_8042B34.c index b5bcc97f2..aa684d283 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -298,7 +298,7 @@ extern void sub_8047104(void); extern void sub_8068F28(void); extern void sub_806C1D8(void); extern void sub_804700C(void); -extern void sub_8097810(void); +extern void IncrementThievingSuccesses(void); extern void sub_803E13C(void); extern void sub_80841EC(void); extern void sub_8084424(void); @@ -315,7 +315,7 @@ extern void sub_8068614(void); extern void sub_80840A4(void); extern void sub_803E178(void); extern void sub_80848F0(void); -extern void sub_8097890(void); +extern void IncrementAdventureFloorsExplored(void); extern void sub_806AB2C(void); extern void DisplayPreFightDialogue(void); extern void sub_8071DA4(Entity *); @@ -332,7 +332,7 @@ extern void sub_80521D0(void); extern void sub_803F27C(u8); extern void sub_807E7FC(u8); extern void sub_80095CC(u32, u32); -extern void sub_8081BF4(u8 *r0, u32 r1); +extern void ReadDungeonState(u8 *r0, u32 r1); extern bool8 IsLevelResetTo1(u8 dungeon); extern void sub_8068A84(PokemonStruct1 *pokemon); extern void sub_807EAA0(u32, u32); @@ -371,7 +371,7 @@ extern void sub_803EAF0(u32, u32); extern void sub_806A914(u8 a0, u8 a1, u8 a2); extern void sub_803F4A0(Entity *a0); extern void sub_8083AB0(s16 param_0, Entity * target, Entity * entity); -extern void sub_8080B30(u8 *param_1,u32 param_2); +extern void WriteDungeonState(u8 *param_1,u32 param_2); extern void sub_8046F84(s32 itemFlag); extern bool8 sub_8083C50(void); extern void sub_8068FE0(Entity *, u32, Entity *r2); @@ -469,7 +469,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) sub_8042E98(); gUnknown_202F32C = 0; if (r6) { - sub_8081BF4(gSerializedData_203B41C, 0x4800); + ReadDungeonState(gSerializedData_203B41C, 0x4800); sub_8049840(); } if (r9) { @@ -686,7 +686,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) if (!r6) { sub_80848F0(); - sub_8097890(); + IncrementAdventureFloorsExplored(); } gUnknown_203B40C = 1; @@ -824,7 +824,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) gUnknown_203B40C = 0; if (gDungeon->unk3 != 0) { - sub_8080B30(gSerializedData_203B41C, 0x4800); + WriteDungeonState(gSerializedData_203B41C, 0x4800); r8->unk7C = 3; r8->unk80 = gDungeon->dungeonLocation; check = FALSE; @@ -834,7 +834,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) s16 var; if (gDungeon->unk6 != 0) { - sub_8080B30(gSerializedData_203B41C, 0x4800); + WriteDungeonState(gSerializedData_203B41C, 0x4800); } else { sub_8046F84(ITEM_FLAG_IN_SHOP); @@ -854,14 +854,14 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) else if (gDungeon->unk11 == 2) { sub_8083AB0(0x229, NULL, GetLeader()); if (gDungeon->unk66E != 0) { - sub_8097810(); + IncrementThievingSuccesses(); } check = TRUE; } else if (gDungeon->unk11 == 3) { sub_8083AB0(0x22A, NULL, GetLeader()); if (gDungeon->unk66E != 0) { - sub_8097810(); + IncrementThievingSuccesses(); } check = TRUE; } @@ -873,13 +873,13 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) else if (gDungeon->unk678 == 1 && sub_8043D10() == 2 && gDungeon->unk654 == 2) { sub_8083AB0(0x228, NULL, GetLeader()); if (gDungeon->unk66E != 0) { - sub_8097810(); + IncrementThievingSuccesses(); } check = TRUE; } else { if (gDungeon->unk66E != 0) { - sub_8097810(); + IncrementThievingSuccesses(); } if (gDungeon->dungeonLocation.floor + 1 < gDungeon->unk1CEC8) { gDungeon->dungeonLocation.floor++; diff --git a/src/code_806FDF4.c b/src/code_806FDF4.c index 2e45d797e..a3d1775a7 100644 --- a/src/code_806FDF4.c +++ b/src/code_806FDF4.c @@ -797,7 +797,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa pokeStruct2->itemSlot = param_3->heldItem; BoundedCopyStringtoBuffer(pokeStruct2->name,GetMonSpecies(param_3->id),10); - sub_8097848(); + IncrementAdventureNumJoined(); if (sub_806B8CC(param_3->id,param_3->pos.x,param_3->pos.y,pokeStruct2,&local_2c,0,1) == 0) { TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA058); @@ -1061,7 +1061,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr) UnlockFriendArea(friendArea); flag = TRUE; } - sub_8097848(); + IncrementAdventureNumJoined(); sub_8068FE0(entity2,500,entity1); if (sub_806B8CC(local_74.id,local_74.pos.x,local_74.pos.y,pokeStruct2,&local_2c,0,0) == 0) { pokeStruct2->unk0 = 0; diff --git a/src/code_8083288.c b/src/code_8083288.c index 39d64988c..28df14231 100644 --- a/src/code_8083288.c +++ b/src/code_8083288.c @@ -10,13 +10,13 @@ #include "structs/str_position.h" -u16 sub_8083158(unkStruct_8094924 *param_1); -s16 sub_8083170(unkStruct_8094924 *param_1); -u8 sub_8083188(unkStruct_8094924 *param_1); -u32 sub_80831A0(unkStruct_8094924 *param_1); -bool8 sub_80831DC(unkStruct_8094924 *param_1); -void sub_8082FE0(unkStruct_8094924 *param_1, u8 *param_2, s32 size); -void sub_80831F8(unkStruct_8094924 *param_1,Position *param_2); +u16 ReadU16(DataSerializer *param_1); +s16 ReadS16(DataSerializer *param_1); +u8 ReadU8(DataSerializer *param_1); +u32 sub_80831A0(DataSerializer *param_1); +bool8 ReadBool8(DataSerializer *param_1); +void ReadBytes(DataSerializer *param_1, void *param_2, s32 size); +void ReadPosition8(DataSerializer *param_1,Position *param_2); void AddPokemonDungeonSprite(u32, s16, Position *, u32); @@ -41,471 +41,508 @@ void sub_8082B40(void) } } -s16 sub_8082BC0(unkStruct_8094924 *param_1) + + + + + + + +// Seems to be a new file (regarding serialization) starting here + + + + + + + + +s16 sub_8082BC0(DataSerializer *param_1) { s16 temp[2]; temp[0] = 0; - sub_8082FE0(param_1, (u8 *)temp, 2); + ReadBytes(param_1, temp, 2); return temp[0]; } - -u8 sub_8082BE0(unkStruct_8094924 *param_1) +u8 sub_8082BE0(DataSerializer *param_1) { u8 temp[4]; temp[0] = 0; - sub_8082FE0(param_1, temp, 1); + ReadBytes(param_1, temp, 1); return temp[0]; } - -u8 sub_8082BFC(unkStruct_8094924 *param_1) +u8 sub_8082BFC(DataSerializer *param_1) { u8 temp[4]; temp[0] = 0; - sub_8082FE0(param_1, temp, 1); + ReadBytes(param_1, temp, 1); return temp[0]; } -u8 sub_8082C18(unkStruct_8094924 *param_1) +u8 sub_8082C18(DataSerializer *param_1) { u8 temp[4]; temp[0] = 0; - sub_8082FE0(param_1, temp, 1); + ReadBytes(param_1, temp, 1); return temp[0]; } -u8 sub_8082C34(unkStruct_8094924 *param_1) +u8 sub_8082C34(DataSerializer *param_1) { u8 temp[4]; temp[0] = 0; - sub_8082FE0(param_1, temp, 1); + ReadBytes(param_1, temp, 1); return temp[0]; } -u8 sub_8082C50(unkStruct_8094924 *param_1) +u8 sub_8082C50(DataSerializer *param_1) { u8 temp[4]; temp[0] = 0; - sub_8082FE0(param_1, temp, 1); + ReadBytes(param_1, temp, 1); return temp[0]; } -u32 sub_8082C6C(unkStruct_8094924 *param_1) +// Read some enum ? +u32 sub_8082C6C(DataSerializer *param_1) { u32 temp; temp = 0; - sub_8082FE0(param_1, (u8 *)&temp, 4); + ReadBytes(param_1, &temp, 4); return temp; } -u8 sub_8082C84(unkStruct_8094924 *param_1) +u8 sub_8082C84(DataSerializer *param_1) { u8 temp[4]; temp[0] = 0; - sub_8082FE0(param_1, temp, 1); + ReadBytes(param_1, temp, 1); return temp[0]; } -u8 sub_8082CA0(unkStruct_8094924 *param_1) +u8 sub_8082CA0(DataSerializer *param_1) { u8 temp[4]; temp[0] = 0; - sub_8082FE0(param_1, temp, 1); + ReadBytes(param_1, temp, 1); return temp[0]; } -void sub_8082CBC(unkStruct_8094924 *param_1, ActionContainer *action) +void ReadActionContainer(DataSerializer *param_1, ActionContainer *action) { action->action = ACTION_NOTHING; - sub_8082FE0(param_1, &action->direction, 1); - action->fill3 = 7; - sub_80831F8(param_1, &action->itemTargetPosition); + ReadBytes(param_1, &action->direction, 1); + action->unk3 = 7; + ReadPosition8(param_1, &action->itemTargetPosition); } -void sub_8082CE4(unkStruct_8094924 *param_1, AITarget *aitarget) +void ReadAITarget(DataSerializer *param_1, AITarget *aitarget) { - sub_8082FE0(param_1, (u8 *)&aitarget->aiObjective, 1); - aitarget->aiNotNextToTarget = sub_80831DC(param_1); - aitarget->aiTargetingEnemy = sub_80831DC(param_1); - aitarget->aiTurningAround = sub_80831DC(param_1); - aitarget->aiTargetSpawnGenID = sub_8083158(param_1); + ReadBytes(param_1, &aitarget->aiObjective, 1); + aitarget->aiNotNextToTarget = ReadBool8(param_1); + aitarget->aiTargetingEnemy = ReadBool8(param_1); + aitarget->aiTurningAround = ReadBool8(param_1); + aitarget->aiTargetSpawnGenID = ReadU16(param_1); aitarget->aiTarget = NULL; aitarget->unkC = 0; - sub_80831F8(param_1, &aitarget->aiTargetPos); + ReadPosition8(param_1, &aitarget->aiTargetPos); } -void sub_8082D28(unkStruct_8094924 *param_1, u8 *param_2) +void Read3Bytes(DataSerializer *param_1, u8 *dst) { - sub_8082FE0(param_1, param_2, 3); + ReadBytes(param_1, dst, 3); } -void sub_8082D34(unkStruct_8094924 *param_1, Sleep *sleep) +void ReadSleep(DataSerializer *param_1, Sleep *sleep) { - sub_8082FE0(param_1, &sleep->sleep, 1); - sleep->sleepTurns = sub_8083188(param_1); + ReadBytes(param_1, &sleep->sleep, 1); + sleep->sleepTurns = ReadU8(param_1); } -void sub_8082D50(unkStruct_8094924 *param_1, NonVolatile *nonvoltaile) +void ReadNonVolatile(DataSerializer *param_1, NonVolatile *nonvolatile) { - sub_8082FE0(param_1, &nonvoltaile->nonVolatileStatus, 1); - nonvoltaile->nonVolatileStatusTurns = sub_8083188(param_1); - nonvoltaile->nonVolatileStatusDamageCountdown = sub_8083188(param_1); - nonvoltaile->unk4 = sub_8083188(param_1); + ReadBytes(param_1, &nonvolatile->nonVolatileStatus, 1); + nonvolatile->nonVolatileStatusTurns = ReadU8(param_1); + nonvolatile->nonVolatileStatusDamageCountdown = ReadU8(param_1); + nonvolatile->unk4 = ReadU8(param_1); } -void sub_8082D7C(unkStruct_8094924 *param_1, Immobilize *immobilze) +void ReadImmobilize(DataSerializer *param_1, Immobilize *immobilize) { - sub_8082FE0(param_1, &immobilze->immobilizeStatus, 1); - immobilze->immobilizeStatusTurns = sub_8083188(param_1); - immobilze->immobilizeStatusDamageCountdown = sub_8083188(param_1); - immobilze->unk4 = sub_80831A0(param_1); + ReadBytes(param_1, &immobilize->immobilizeStatus, 1); + immobilize->immobilizeStatusTurns = ReadU8(param_1); + immobilize->immobilizeStatusDamageCountdown = ReadU8(param_1); + immobilize->unk4 = sub_80831A0(param_1); } -void sub_8082DA8(unkStruct_8094924 *param_1, Volatile *volatileStatus) +void ReadVolatileStatus(DataSerializer *param_1, Volatile *volatileStatus) { - sub_8082FE0(param_1, &volatileStatus->volatileStatus, 1); - volatileStatus->volatileStatusTurns = sub_8083188(param_1); + ReadBytes(param_1, &volatileStatus->volatileStatus, 1); + volatileStatus->volatileStatusTurns = ReadU8(param_1); } -void sub_8082DC4(unkStruct_8094924 *param_1, Charging *charging) +void ReadCharging(DataSerializer *param_1, Charging *charging) { - sub_8082FE0(param_1, &charging->chargingStatus, 1); - charging->chargingStatusTurns = sub_8083188(param_1); - charging->chargingStatusMoveIndex = sub_8083188(param_1); + ReadBytes(param_1, &charging->chargingStatus, 1); + charging->chargingStatusTurns = ReadU8(param_1); + charging->chargingStatusMoveIndex = ReadU8(param_1); } -void sub_8082DE8(unkStruct_8094924 *param_1, Protection *protect) +void ReadProtection(DataSerializer *param_1, Protection *protect) { - sub_8082FE0(param_1, &protect->protectionStatus, 1); - protect->protectionStatusTurns = sub_8083188(param_1); + ReadBytes(param_1, &protect->protectionStatus, 1); + protect->protectionStatusTurns = ReadU8(param_1); } -void sub_8082E04(unkStruct_8094924 *param_1, Waiting *waiting) +void ReadWaiting(DataSerializer *param_1, Waiting *waiting) { - sub_8082FE0(param_1, &waiting->waitingStatus, 1); - waiting->enemyDecoy = sub_80831DC(param_1); - waiting->unkCA = sub_80831DC(param_1); - waiting->waitingStatusTurns = sub_8083188(param_1); - waiting->curseDamageCountdown = sub_8083188(param_1); + ReadBytes(param_1, &waiting->waitingStatus, 1); + waiting->enemyDecoy = ReadBool8(param_1); + waiting->unkCA = ReadBool8(param_1); + waiting->waitingStatusTurns = ReadU8(param_1); + waiting->curseDamageCountdown = ReadU8(param_1); } -void sub_8082E38(unkStruct_8094924 *param_1, Linked *linked) +void ReadLinked(DataSerializer *param_1, Linked *linked) { - sub_8082FE0(param_1, &linked->linkedStatus, 1); + ReadBytes(param_1, &linked->linkedStatus, 1); linked->unkD4 = sub_80831A0(param_1); - linked->unkD8 = sub_8083188(param_1); - linked->linkedStatusTurns = sub_8083188(param_1); - linked->linkedStatusDamageCountdown = sub_8083188(param_1); + linked->unkD8 = ReadU8(param_1); + linked->linkedStatusTurns = ReadU8(param_1); + linked->linkedStatusDamageCountdown = ReadU8(param_1); } -void sub_8082E6C(unkStruct_8094924 *param_1, MoveStatus *moveStatus) +void ReadMoveStatus(DataSerializer *param_1, MoveStatus *moveStatus) { - sub_8082FE0(param_1, &moveStatus->moveStatus, 1); - moveStatus->moveStatusTurns = sub_8083188(param_1); + ReadBytes(param_1, &moveStatus->moveStatus, 1); + moveStatus->moveStatusTurns = ReadU8(param_1); } -void sub_8082E88(unkStruct_8094924 *param_1, u8 *param_2, s32 size) +void sub_8082E88(DataSerializer *param_1, void *dst, s32 param_3) { - sub_8082FE0(param_1, param_2, 1); + ReadBytes(param_1, dst, 1); } -void sub_8082E94(unkStruct_8094924 *param_1, TransformStatus *transform) +void ReadTransformStatus(DataSerializer *param_1, TransformStatus *transform) { - sub_8082FE0(param_1, &transform->transformStatus, 1); - transform->transformStatusTurns = sub_8083188(param_1); + ReadBytes(param_1, &transform->transformStatus, 1); + transform->transformStatusTurns = ReadU8(param_1); } -void sub_8082EB0(unkStruct_8094924 *param_1, EyesightStatus *eyesight) +void ReadEyesightStatus(DataSerializer *param_1, EyesightStatus *eyesight) { - sub_8082FE0(param_1, &eyesight->eyesightStatus, 1); - eyesight->eyesightStatusTurns = sub_8083188(param_1); + ReadBytes(param_1, &eyesight->eyesightStatus, 1); + eyesight->eyesightStatusTurns = ReadU8(param_1); } -void sub_8082ECC(unkStruct_8094924 *param_1, Muzzled *muzzle) +void ReadMuzzled(DataSerializer *param_1, Muzzled *muzzle) { - sub_8082FE0(param_1, (u8 *)&muzzle->muzzled, 1); - muzzle->muzzledTurns = sub_8083188(param_1); + ReadBytes(param_1, &muzzle->muzzled, 1); + muzzle->muzzledTurns = ReadU8(param_1); } -void RestoreDungeonPokemonMove(unkStruct_8094924 *param_1, Move *move) +void RestoreDungeonPokemonMove(DataSerializer *param_1, Move *move) { - move->moveFlags = sub_8083188(param_1); - move->moveFlags2 = sub_8083188(param_1); - sub_8082FE0(param_1, (u8 *)&move->id, 2); - move->PP = sub_8083188(param_1); - move->ginseng = sub_8083188(param_1); + move->moveFlags = ReadU8(param_1); + move->moveFlags2 = ReadU8(param_1); + ReadBytes(param_1, &move->id, 2); + move->PP = ReadU8(param_1); + move->ginseng = ReadU8(param_1); } -void sub_8082F1C(unkStruct_8094924 *param_1,Move *moves) +void ReadMoves(DataSerializer *param_1, Moves *moves) { s32 index; Move *move; - for(index = 0; index < MAX_MON_MOVES; index++) - { - move = &moves[index]; + + for (index = 0; index < MAX_MON_MOVES; index++) { + move = &moves->moves[index]; RestoreDungeonPokemonMove(param_1, move); } - *(u8 *)(moves + 4) = sub_8083188(param_1); // TODO: struggleMoveFlags again + + moves->struggleMoveFlags = ReadU8(param_1); } - -void sub_8082F48(unkStruct_8094924 *param_1, u16 *r1) +// TODO: R1 struct +void sub_8082F48(DataSerializer *param_1, u16 *r1) { - r1[0] = sub_8083170(param_1); - r1[1] = sub_8083170(param_1); + r1[0] = ReadS16(param_1); + r1[1] = ReadS16(param_1); } -void sub_8082F64(unkStruct_8094924 *param_1, JoinedAt *joined) +void ReadJoinedAt(DataSerializer *param_1, JoinedAt *joined) { - joined->joinedAt = sub_8083188(param_1); - joined->unk1 = sub_8083188(param_1); + joined->joinedAt = ReadU8(param_1); + joined->unk1 = ReadU8(param_1); } -void sub_8082F80(unkStruct_8094924 *param_1, HiddenPower *hidden) +void ReadHiddenPower(DataSerializer *param_1, HiddenPower *hidden) { - hidden->hiddenPowerBasePower = sub_8083170(param_1); + hidden->hiddenPowerBasePower = ReadS16(param_1); hidden->hiddenPowerType = sub_8082BFC(param_1); } -void sub_8082F9C(unkStruct_8094924 *param_1, u8 *r1, u32 r2) +void InitByteWriter(DataSerializer *param_1, u8 *dst, u32 capacity) { - param_1->unk0 = r1; - param_1->unk8 = 0; - param_1->unk4 = r1 + r2; + param_1->stream = dst; + param_1->count = 0; + param_1->end = dst + capacity; } -void sub_8082FA8(unkStruct_8094924 *param_1, u8 *param_2, s32 size) +void WriteBytes(DataSerializer *param_1, void *src, s32 numBytes) { - while (size != 0) { - *(param_1->unk0) = *param_2; - param_1->unk0++; - param_2++; - size--; - param_1->unk8++; + u8 *curByte; + + curByte = src; + + while (numBytes != 0) { + *param_1->stream = *curByte; + param_1->stream++; + curByte++; + numBytes--; + param_1->count++; } } -void sub_8082FD4(unkStruct_8094924 *param_1, u8 *r1, u32 r2) +void InitByteReader(DataSerializer *param_1, u8 *src, u32 length) { - param_1->unk0 = r1; - param_1->unk8 = 0; - param_1->unk4 = r1 + r2; + param_1->stream = src; + param_1->count = 0; + param_1->end = src + length; } -void sub_8082FE0(unkStruct_8094924 *param_1, u8 *param_2, s32 size) +void ReadBytes(DataSerializer *param_1, void *dst, s32 numBytes) { - while (size != 0) { - *param_2 = *(param_1->unk0); - param_1->unk0++; - param_2++; - size--; - param_1->unk8++; + u8 *curByte; + + curByte = dst; + + while (numBytes != 0) { + *curByte = *param_1->stream; + param_1->stream++; + curByte++; + numBytes--; + param_1->count++; } } -void nullsub_98(unkStruct_8094924 *param_1) -{} - -void sub_808300C(unkStruct_8094924 *param_1, u8 *param_2) +// Finished reading/writing dungeon +void nullsub_98(DataSerializer *param_1) { - sub_8082FA8(param_1, param_2, 8); } -void sub_8083018(unkStruct_8094924 *param_1) +void Write8Bytes(DataSerializer *param_1, u8 *src) +{ + WriteBytes(param_1, src, 8); +} + +void sub_8083018(DataSerializer *param_1) { u8 auStack_10 [12]; - sub_8082FE0(param_1,auStack_10,8); + ReadBytes(param_1, auStack_10, 8); auStack_10[8] = 0; } -void sub_8083030(unkStruct_8094924 *param_1, u16 param_2) +void WriteU16(DataSerializer *param_1, u16 value) { u16 uStack_8; - uStack_8 = param_2; - sub_8082FA8(param_1,(u8 *)&uStack_8,2); + uStack_8 = value; + + WriteBytes(param_1, &uStack_8, 2); } -void sub_8083048(unkStruct_8094924 *param_1, u32 param_2) +void WriteS16(DataSerializer *param_1, u32 value) { u16 uStack_8; - uStack_8 = param_2; - sub_8082FA8(param_1,(u8 *)&uStack_8,2); + uStack_8 = value; + + WriteBytes(param_1, &uStack_8, 2); } -void sub_8083060(unkStruct_8094924 *param_1, u32 param_2) +void WriteU8(DataSerializer *param_1, u32 value) { u8 uStack_8; - uStack_8 = param_2; - sub_8082FA8(param_1,&uStack_8,1); + uStack_8 = value; + + WriteBytes(param_1, &uStack_8, 1); } -void sub_8083078(unkStruct_8094924 *param_1, u32 param_2) +void WriteU32(DataSerializer *param_1, u32 value) { u32 uStack_8; - uStack_8 = param_2; - sub_8082FA8(param_1,(u8 *)&uStack_8,4); + uStack_8 = value; + + WriteBytes(param_1, &uStack_8, 4); } -void sub_808308C(unkStruct_8094924 *param_1, u32 param_2) +UNUSED void sub_808308C(DataSerializer *param_1, u32 value) { u32 uStack_8; - uStack_8 = param_2; - sub_8082FA8(param_1,(u8 *)&uStack_8,4); + uStack_8 = value; + + WriteBytes(param_1, &uStack_8, 4); } -void sub_80830A0(unkStruct_8094924 *param_1, u32 param_2) +void WriteS32(DataSerializer *param_1, u32 value) { u32 uStack_8; - uStack_8 = param_2; - sub_8082FA8(param_1,(u8 *)&uStack_8,4); + uStack_8 = value; + + WriteBytes(param_1, &uStack_8, 4); } -void sub_80830B4(unkStruct_8094924 *param_1, u8 param_2) +void WriteBool8(DataSerializer *param_1, bool8 value) { u8 local_8; - local_8 = (param_2 != 0) ? -1 : 0; - sub_8082FA8(param_1,&local_8,1); + local_8 = value ? -1 : 0; + + WriteBytes(param_1, &local_8, 1); } -void SavePosition(unkStruct_8094924 *param_1, Position *param_2) +void WritePosition8(DataSerializer *param_1, Position *param_2) { - sub_8082FA8(param_1, (u8 *)¶m_2->x, 1); - sub_8082FA8(param_1, (u8 *)¶m_2->y, 1); + WriteBytes(param_1, ¶m_2->x, 1); + WriteBytes(param_1, ¶m_2->y, 1); } -void sub_80830F8(unkStruct_8094924 *param_1, u32 *param_2) +// TODO: param_2 struct +void sub_80830F8(DataSerializer *param_1, u32 *param_2) { - sub_8082FA8(param_1, (u8 *)¶m_2[0], 1); - sub_8082FA8(param_1, (u8 *)¶m_2[1], 1); - sub_8082FA8(param_1, (u8 *)¶m_2[2], 1); - sub_8082FA8(param_1, (u8 *)¶m_2[3], 1); + WriteBytes(param_1, ¶m_2[0], 1); + WriteBytes(param_1, ¶m_2[1], 1); + WriteBytes(param_1, ¶m_2[2], 1); + WriteBytes(param_1, ¶m_2[3], 1); } -void sub_808312C(unkStruct_8094924 *param_1, u16 *param_2) +// TODO: param_2 struct +void sub_808312C(DataSerializer *param_1, u16 *param_2) { - sub_8082FA8(param_1, (u8 *)¶m_2[0], 1); - sub_8082FA8(param_1, (u8 *)¶m_2[1], 1); + WriteBytes(param_1, ¶m_2[0], 1); + WriteBytes(param_1, ¶m_2[1], 1); } -void SaveSpeedCounters(unkStruct_8094924 *param_1, u32 *speedCounters, u32 numCounters) +void xxx_WriteBytes(DataSerializer *param_1, void *src, u32 numBytes) { - sub_8082FA8(param_1, (u8 *)speedCounters, numCounters); + WriteBytes(param_1, src, numBytes); } -u16 sub_8083158(unkStruct_8094924 *param_1) +u16 ReadU16(DataSerializer *param_1) { u16 local_8; - sub_8082FE0(param_1,(u8 *)&local_8,2); + ReadBytes(param_1, &local_8, 2); return local_8; } -s16 sub_8083170(unkStruct_8094924 *param_1) +s16 ReadS16(DataSerializer *param_1) { s16 local_8; - sub_8082FE0(param_1,(u8 *)&local_8,2); + ReadBytes(param_1, &local_8, 2); return local_8; } -u8 sub_8083188(unkStruct_8094924 *param_1) +u8 ReadU8(DataSerializer *param_1) { u8 local_8; - sub_8082FE0(param_1,&local_8,1); + ReadBytes(param_1, &local_8, 1); return local_8; } -u32 sub_80831A0(unkStruct_8094924 *param_1) +// ReadS32 or ReadU32 ? +u32 sub_80831A0(DataSerializer *param_1) { u32 local_8; - sub_8082FE0(param_1,(u8 *)&local_8,4); + ReadBytes(param_1, &local_8, 4); return local_8; } -u32 sub_80831B4(unkStruct_8094924 *param_1) +UNUSED u32 sub_80831B4(DataSerializer *param_1) { u32 local_8; - sub_8082FE0(param_1,(u8 *)&local_8,4); + ReadBytes(param_1, &local_8, 4); return local_8; } -u32 sub_80831C8(unkStruct_8094924 *param_1) +// ? +u32 sub_80831C8(DataSerializer *param_1) { u32 local_8; - sub_8082FE0(param_1,(u8 *)&local_8,4); + ReadBytes(param_1, &local_8, 4); return local_8; } -bool8 sub_80831DC(unkStruct_8094924 *param_1) +bool8 ReadBool8(DataSerializer *param_1) { u8 local_8; - sub_8082FE0(param_1,&local_8,1); + ReadBytes(param_1, &local_8, 1); return local_8 != 0; } -void sub_80831F8(unkStruct_8094924 *param_1,Position *param_2) +void ReadPosition8(DataSerializer *param_1, Position *param_2) { param_2->x = 0; param_2->y = 0; - sub_8082FE0(param_1,(u8 *)¶m_2->x,1); - sub_8082FE0(param_1,(u8 *)¶m_2->y,1); + ReadBytes(param_1, ¶m_2->x, 1); + ReadBytes(param_1, ¶m_2->y, 1); } - -void sub_8083220(unkStruct_8094924 *param_1,u32 *param_2) +// TODO: param_2 struct +void sub_8083220(DataSerializer *param_1, u32 *param_2) { param_2[0] = 0; param_2[1] = 0; param_2[2] = 0; param_2[3] = 0; - sub_8082FE0(param_1,(u8 *)¶m_2[0],1); - sub_8082FE0(param_1,(u8 *)¶m_2[1],1); - sub_8082FE0(param_1,(u8 *)¶m_2[2],1); - sub_8082FE0(param_1,(u8 *)¶m_2[3],1); + ReadBytes(param_1, ¶m_2[0], 1); + ReadBytes(param_1, ¶m_2[1], 1); + ReadBytes(param_1, ¶m_2[2], 1); + ReadBytes(param_1, ¶m_2[3], 1); } -void sub_8083260(unkStruct_8094924 *param_1,u16 *param_2) +// TODO: param_2 struct +void sub_8083260(DataSerializer *param_1, u16 *param_2) { param_2[0] = 0; param_2[1] = 0; - sub_8082FE0(param_1,(u8 *)¶m_2[0],1); - sub_8082FE0(param_1,(u8 *)¶m_2[1],1); + ReadBytes(param_1, ¶m_2[0], 1); + ReadBytes(param_1, ¶m_2[1], 1); } -void sub_8083288(unkStruct_8094924 *r0, u16 *r1, u32 size) +void xxx_ReadBytes(DataSerializer *r0, u8 *dst, u32 numBytes) { - sub_8082FE0(r0, (u8 *)r1, size); -} - + ReadBytes(r0, dst, numBytes); +} \ No newline at end of file diff --git a/src/code_8092334.c b/src/code_8092334.c index 5dfe4e39c..ea4aed815 100644 --- a/src/code_8092334.c +++ b/src/code_8092334.c @@ -19,136 +19,109 @@ s16 sub_8094828(u16 moveID, u8 id) } } -void xxx_init_struct_8094924_restore_809485C(struct unkStruct_8094924 *r0, u8 *r1, s32 size) + + +// New file here + + +void InitBitReader(DataSerializer *r0, u8 *buffer, s32 bufLen) { - r0->unk0 = r1; - r0->unk8 = 0; + r0->stream = buffer; + r0->count = 0; r0->unkC = 0; - r0->unk4 = &r1[size]; + r0->end = buffer + bufLen; } -void xxx_init_struct_8094924_save_809486C(struct unkStruct_8094924 *r0, u8 *r1, s32 size) +void InitBitWriter(DataSerializer *r0, u8 *buffer, s32 bufLen) { - r0->unk0 = r1; - r0->unk8 = 0; + r0->stream = buffer; + r0->count = 0; r0->unkC = 0; - r0->unk4 = &r1[size]; - MemoryClear8(r1, size); + r0->end = buffer + bufLen; + MemoryClear8(buffer, bufLen); } -// Related to reading/writing bits -void nullsub_102(struct unkStruct_8094924 *r0) +// Finish reading/writing bits +void nullsub_102(DataSerializer *r0) { } -void SaveIntegerBits(struct unkStruct_8094924 *r0, void *r1, s32 size) +void WriteBits(DataSerializer *r0, void *src, s32 numBits) { - s32 r5; - u8 *r6; + s32 curBit; + u8 *curByte; - r5 = 0; - r6 = r1; + curBit = 0; + curByte = src; + while (numBits != 0) { + if ((*curByte >> curBit) & 1) + *r0->stream |= (1 << r0->count); - if(size != 0) - { - while(size != 0) - { - if(( *(r6) >> r5) & 1) - { - *r0->unk0 |= (1 << r0->unk8); - } - r5++; - if(r5 == 8) - { - r6++; - r5 = 0; - } - r0->unk8++; - if(r0->unk8 == 8) - { - r0->unk0++; - r0->unk8 = 0; - } - r0->unkC++; - size--; + curBit++; + if (curBit == 8) { + curByte++; + curBit = 0; } + + r0->count++; + if (r0->count == 8) { + r0->stream++; + r0->count = 0; + } + + r0->unkC++; + numBits--; } } -// Unused -NAKED -void sub_80948E4(struct unkStruct_8094924 *r0, u8 *r1, s32 size) +UNUSED void sub_80948E4(DataSerializer *seri, void *src, s32 numBytes) { - asm_unified("\tpush {r4-r6,lr}\n" - "\tadds r4, r0, 0\n" - "\tadds r5, r2, 0\n" - "\tadds r6, r1, 0\n" - "\tcmp r5, 0\n" - "\tbeq _0809491C\n" -"_080948F0:\n" - "\tldrb r1, [r6]\n" - "\tldr r0, [r4, 0x8]\n" - "\tlsls r1, r0\n" - "\tldr r3, [r4]\n" - "\tldrb r2, [r3]\n" - "\tadds r0, r1, 0\n" - "\torrs r0, r2\n" - "\tstrb r0, [r3]\n" - "\tldr r2, [r4]\n" - "\tadds r0, r2, 0x1\n" - "\tstr r0, [r4]\n" - "\tasrs r1, 8\n" - "\tldrb r0, [r2, 0x1]\n" - "\torrs r1, r0\n" - "\tstrb r1, [r2, 0x1]\n" - "\tadds r6, 0x1\n" - "\tldr r0, [r4, 0xC]\n" - "\tadds r0, 0x8\n" - "\tstr r0, [r4, 0xC]\n" - "\tsubs r5, 0x1\n" - "\tcmp r5, 0\n" - "\tbne _080948F0\n" -"_0809491C:\n" - "\tpop {r4-r6}\n" - "\tpop {r0}\n" - "\tbx r0"); -} + s32 iVar1; + u8 *curByte; -void RestoreIntegerBits(struct unkStruct_8094924 *r0, void *r1, s32 size) -{ - s32 r6; - u8 *r2; + curByte = src; - r6 = 0; - r2 = r1; - - - if(size != 0) - { - while(size != 0) - { - if(r6 == 0) - *r2 = 0; - if(( *(r0->unk0) >> r0->unk8) & 1) - { - *r2 |= (1 << r6); - } - r6++; - if(r6 == 8) - { - r2++; - r6 = 0; - } - r0->unk8++; - if(r0->unk8 == 8) - { - r0->unk0++; - r0->unk8 = 0; - } - r0->unkC++; - size--; - } + while (numBytes != 0) { + iVar1 = (*curByte << seri->count); + *seri->stream |= iVar1; + seri->stream++; + *seri->stream |= iVar1 >> 8; + curByte++; + seri->unkC += 8; + numBytes--; } } + +void ReadBits(DataSerializer *r0, void *dst, s32 numBits) +{ + s32 curBit; + u8 *curByte; + + curBit = 0; + curByte = dst; + + while (numBits != 0) { + if (curBit == 0) + *curByte = 0; + + if ((*r0->stream >> r0->count) & 1) + *curByte |= (1 << curBit); + + curBit++; + if (curBit == 8) { + curByte++; + curBit = 0; + } + + r0->count++; + if (r0->count == 8) { + r0->stream++; + r0->count = 0; + } + + r0->unkC++; + numBits--; + } +} \ No newline at end of file diff --git a/src/code_809447C.c b/src/code_809447C.c index fcfc4cfae..f9836398c 100644 --- a/src/code_809447C.c +++ b/src/code_809447C.c @@ -35,16 +35,16 @@ extern const u8 *gUnknown_8113870[]; extern struct unkStruct_8113080 gUnknown_8113080[]; -void sub_809447C(struct unkStruct_8094924 *r0, u8 *r1) +void ReadBellyBits(DataSerializer *r0, FixedPoint *dst) { - RestoreIntegerBits(r0, r1, 0x10); - RestoreIntegerBits(r0, r1 + 2, 0x10); + ReadBits(r0, &dst->unk0, 16); + ReadBits(r0, &dst->unk2, 16); } -void sub_809449C(struct unkStruct_8094924 *r0, u8 *r1) +void WriteBellyBits(DataSerializer *r0, FixedPoint *src) { - SaveIntegerBits(r0, r1, 0x10); - SaveIntegerBits(r0, r1 + 2, 0x10); + WriteBits(r0, &src->unk0, 16); + WriteBits(r0, &src->unk2, 16); } static void sub_80944BC(s16 moveID, u8 *buffer) diff --git a/src/code_8094F88.c b/src/code_8094F88.c index 830496891..dd2ea1294 100644 --- a/src/code_8094F88.c +++ b/src/code_8094F88.c @@ -21,10 +21,10 @@ EWRAM_DATA UNUSED static u32 fill0 = {0}; // 203B484 is size 0x5C and I need to EWRAM_DATA u32 gUnknown_20392E8[0x36] = {0}; EWRAM_DATA unkStruct_203B48C gUnknown_20393C0 = {0}; -extern void SaveDungeonLocation(struct unkStruct_8094924*, DungeonLocation*); -extern void RestoreDungeonLocation(struct unkStruct_8094924*, DungeonLocation*); -extern void xxx_save_poke_sub_c_808F41C(struct unkStruct_8094924* a1, struct unkPokeSubStruct_C* unkC); -extern void xxx_restore_poke_sub_c_808F410(struct unkStruct_8094924*, struct unkPokeSubStruct_C*); +extern void WriteDungeonLocationBits(DataSerializer*, DungeonLocation*); +extern void ReadDungeonLocationBits(DataSerializer*, DungeonLocation*); +extern void WritePoke1LevelBits(DataSerializer* a1, struct unkPokeSubStruct_C* unkC); +extern void ReadPoke1LevelBits(DataSerializer*, struct unkPokeSubStruct_C*); void sub_80950BC(void) { @@ -78,11 +78,11 @@ void sub_8095118(void) } } -void nullsub_206(void) +UNUSED static void nullsub_206(void) { } -void nullsub_207(void) +UNUSED static void nullsub_207(void) { } @@ -308,141 +308,164 @@ u32 sub_80954B4(void) return 0; } -u32 sub_80954CC(u8 *a, u32 b) + + + + + +// New file? + + + + + + + + + +u32 sub_80954CC(u8 *buffer, u32 size) { - struct unkStruct_8094924 backup; - PokemonStruct1 *temp; - s32 index; + DataSerializer backup; + PokemonStruct1 *mon; + s32 i; - xxx_init_struct_8094924_restore_809485C(&backup, a, b); - for(index = 0; index < 0x20; index++) - { - sub_8095774(&backup, &gUnknown_203B480[index]); - } - RestoreIntegerBits(&backup, &gUnknown_203B484->unk0, 0x20); - temp = &gUnknown_203B484->unk4; - memset(temp, 0, sizeof(PokemonStruct1)); - RestoreIntegerBits(&backup, &temp->unk0, 2); - RestoreIntegerBits(&backup, &temp->isTeamLeader, 1); - RestoreIntegerBits(&backup, &temp->level, 7); - RestoreDungeonLocation(&backup, &temp->dungeonLocation); - RestoreIntegerBits(&backup, &temp->speciesNum, 9); - xxx_restore_poke_sub_c_808F410(&backup, &temp->unkC[0]); - xxx_restore_poke_sub_c_808F410(&backup, &temp->unkC[1]); - RestoreIntegerBits(&backup, &temp->IQ, 0xA); - RestoreIntegerBits(&backup, &temp->pokeHP, 0xA); - RestoreIntegerBits(&backup, &temp->offense.att[0], 8); - RestoreIntegerBits(&backup, &temp->offense.att[1], 8); - RestoreIntegerBits(&backup, &temp->offense.def[0], 8); - RestoreIntegerBits(&backup, &temp->offense.def[1], 8); - RestoreIntegerBits(&backup, &temp->currExp, 0x18); - RestoreIntegerBits(&backup, &temp->IQSkills, 0x18); - RestoreIntegerBits(&backup, &temp->tacticIndex, 4); - RestoreHeldItem(&backup, &temp->heldItem); - RestorePokemonMoves(&backup, temp->moves); - RestoreIntegerBits(&backup, temp->name, 0x50); + InitBitReader(&backup, buffer, size); - RestoreIntegerBits(&backup, &gUnknown_203B48C->unk0, 0x20); - for(index = 0; index < 0x20; index++) - { - RestoreIntegerBits(&backup, &gUnknown_203B48C->unk4[index], 0x20); + for (i = 0; i < 32; i++) { + sub_8095774(&backup, &gUnknown_203B480[i]); } + + ReadBits(&backup, &gUnknown_203B484->unk0, 32); + + mon = &gUnknown_203B484->unk4; + memset(mon, 0, sizeof(PokemonStruct1)); + + ReadBits(&backup, &mon->unk0, 2); + ReadBits(&backup, &mon->isTeamLeader, 1); + ReadBits(&backup, &mon->level, 7); + ReadDungeonLocationBits(&backup, &mon->dungeonLocation); + ReadBits(&backup, &mon->speciesNum, 9); + ReadPoke1LevelBits(&backup, &mon->unkC[0]); + ReadPoke1LevelBits(&backup, &mon->unkC[1]); + ReadBits(&backup, &mon->IQ, 10); + ReadBits(&backup, &mon->pokeHP, 10); + ReadBits(&backup, &mon->offense.att[0], 8); + ReadBits(&backup, &mon->offense.att[1], 8); + ReadBits(&backup, &mon->offense.def[0], 8); + ReadBits(&backup, &mon->offense.def[1], 8); + ReadBits(&backup, &mon->currExp, 24); + ReadBits(&backup, &mon->IQSkills, 24); + ReadBits(&backup, &mon->tacticIndex, 4); + ReadHeldItemBits(&backup, &mon->heldItem); + ReadPoke1MovesBits(&backup, mon->moves); + ReadBits(&backup, mon->name, 10 * 8); + + ReadBits(&backup, &gUnknown_203B48C->unk0, 32); + for (i = 0; i < 32; i++) { + ReadBits(&backup, &gUnknown_203B48C->unk4[i], 32); + } + nullsub_102(&backup); - return backup.unk8; + return backup.count; } -u32 sub_8095624(u8 *a, u32 b) +u32 sub_8095624(u8 *buffer, u32 b) { - struct unkStruct_8094924 backup; - PokemonStruct1 *temp; - s32 index; + DataSerializer backup; + PokemonStruct1 *mon; + s32 i; - xxx_init_struct_8094924_save_809486C(&backup, a, b); - for(index = 0; index < 0x20; index++) - { - sub_8095824(&backup, &gUnknown_203B480[index]); - } - SaveIntegerBits(&backup, &gUnknown_203B484->unk0, 0x20); - temp = &gUnknown_203B484->unk4; - SaveIntegerBits(&backup, &temp->unk0, 2); - SaveIntegerBits(&backup, &temp->isTeamLeader, 1); - SaveIntegerBits(&backup, &temp->level, 7); - SaveDungeonLocation(&backup, &temp->dungeonLocation); - SaveIntegerBits(&backup, &temp->speciesNum, 9); - xxx_save_poke_sub_c_808F41C(&backup, &temp->unkC[0]); - xxx_save_poke_sub_c_808F41C(&backup, &temp->unkC[1]); - SaveIntegerBits(&backup, &temp->IQ, 0xA); - SaveIntegerBits(&backup, &temp->pokeHP, 0xA); - SaveIntegerBits(&backup, &temp->offense.att[0], 8); - SaveIntegerBits(&backup, &temp->offense.att[1], 8); - SaveIntegerBits(&backup, &temp->offense.def[0], 8); - SaveIntegerBits(&backup, &temp->offense.def[1], 8); - SaveIntegerBits(&backup, &temp->currExp, 0x18); - SaveIntegerBits(&backup, &temp->IQSkills, 0x18); - SaveIntegerBits(&backup, &temp->tacticIndex, 4); - SaveHeldItem(&backup, &temp->heldItem); - SavePokemonMoves(&backup, temp->moves); - SaveIntegerBits(&backup, temp->name, 0x50); + InitBitWriter(&backup, buffer, b); - SaveIntegerBits(&backup, &gUnknown_203B48C->unk0, 0x20); - for(index = 0; index < 0x20; index++) - { - SaveIntegerBits(&backup, &gUnknown_203B48C->unk4[index], 0x20); + for (i = 0; i < 32; i++) { + sub_8095824(&backup, &gUnknown_203B480[i]); } + + WriteBits(&backup, &gUnknown_203B484->unk0, 32); + + mon = &gUnknown_203B484->unk4; + + WriteBits(&backup, &mon->unk0, 2); + WriteBits(&backup, &mon->isTeamLeader, 1); + WriteBits(&backup, &mon->level, 7); + WriteDungeonLocationBits(&backup, &mon->dungeonLocation); + WriteBits(&backup, &mon->speciesNum, 9); + WritePoke1LevelBits(&backup, &mon->unkC[0]); + WritePoke1LevelBits(&backup, &mon->unkC[1]); + WriteBits(&backup, &mon->IQ, 10); + WriteBits(&backup, &mon->pokeHP, 10); + WriteBits(&backup, &mon->offense.att[0], 8); + WriteBits(&backup, &mon->offense.att[1], 8); + WriteBits(&backup, &mon->offense.def[0], 8); + WriteBits(&backup, &mon->offense.def[1], 8); + WriteBits(&backup, &mon->currExp, 24); + WriteBits(&backup, &mon->IQSkills, 24); + WriteBits(&backup, &mon->tacticIndex, 4); + WriteHeldItemBits(&backup, &mon->heldItem); + WritePoke1MovesBits(&backup, mon->moves); + WriteBits(&backup, mon->name, 10 * 8); + + WriteBits(&backup, &gUnknown_203B48C->unk0, 32); + + for (i = 0; i < 32; i++) { + WriteBits(&backup, &gUnknown_203B48C->unk4[i], 32); + } + nullsub_102(&backup); - return backup.unk8; + return backup.count; } -void sub_8095774(struct unkStruct_8094924 * a, unkStruct_203B480 *b) +void sub_8095774(DataSerializer * a, unkStruct_203B480 *b) { u8 temp; - RestoreIntegerBits(a, &b->mailType, 4); - RestoreDungeonLocation(a, &b->unk4.dungeon); - RestoreIntegerBits(a, &b->unk4.seed, 0x18); - RestoreIntegerBits(a, &b->clientSpecies, 0x9); - RestoreIntegerBits(a, &b->unk10.unk10, 0x20); - RestoreIntegerBits(a, &b->playerName, 0x50); - RestoreIntegerBits(a, &b->item.flags, 0x8); - RestoreIntegerBits(a, &b->item.quantity, 0x8); - RestoreIntegerBits(a, &b->item.id, 0x8); - RestoreIntegerBits(a, &b->unk24, 0x20); - RestoreIntegerBits(a, &b->unk28, 0x20); - RestoreIntegerBits(a, &b->rescuesAllowed, 0x8); + ReadBits(a, &b->mailType, 4); + ReadDungeonLocationBits(a, &b->unk4.dungeon); + ReadBits(a, &b->unk4.seed, 24); + ReadBits(a, &b->clientSpecies, 9); + ReadBits(a, &b->unk10.unk10, 32); + ReadBits(a, &b->playerName, 10 * 8); + ReadBits(a, &b->item.flags, 8); + ReadBits(a, &b->item.quantity, 8); + ReadBits(a, &b->item.id, 8); + ReadBits(a, &b->unk24, 32); + ReadBits(a, &b->unk28, 32); + ReadBits(a, &b->rescuesAllowed, 8); - RestoreIntegerBits(a, &temp, 1); + ReadBits(a, &temp, 1); b->unk2D = temp & 1; } -void sub_8095824(struct unkStruct_8094924 * a, unkStruct_203B480 *b) +void sub_8095824(DataSerializer * a, unkStruct_203B480 *b) { u8 neg1; u8 zero; - u8 *puVar2; + u8 *ptr; + neg1 = -1; zero = 0; - SaveIntegerBits(a, &b->mailType, 4); - SaveDungeonLocation(a, &b->unk4.dungeon); - SaveIntegerBits(a, &b->unk4.seed, 0x18); - SaveIntegerBits(a, &b->clientSpecies, 0x9); - SaveIntegerBits(a, &b->unk10.unk10, 0x20); - SaveIntegerBits(a, &b->playerName, 0x50); - SaveIntegerBits(a, &b->item.flags, 0x8); - SaveIntegerBits(a, &b->item.quantity, 0x8); - SaveIntegerBits(a, &b->item.id, 0x8); - SaveIntegerBits(a, &b->unk24, 0x20); - SaveIntegerBits(a, &b->unk28, 0x20); - SaveIntegerBits(a, &b->rescuesAllowed, 0x8); + WriteBits(a, &b->mailType, 4); + WriteDungeonLocationBits(a, &b->unk4.dungeon); + WriteBits(a, &b->unk4.seed, 24); + WriteBits(a, &b->clientSpecies, 9); + WriteBits(a, &b->unk10.unk10, 32); + WriteBits(a, &b->playerName, 10 * 8); + WriteBits(a, &b->item.flags, 8); + WriteBits(a, &b->item.quantity, 8); + WriteBits(a, &b->item.id, 8); + WriteBits(a, &b->unk24, 32); + WriteBits(a, &b->unk28, 32); + WriteBits(a, &b->rescuesAllowed, 8); - if(b->unk2D != 0) - puVar2 = &neg1; + if (b->unk2D != 0) + ptr = &neg1; else - puVar2 = &zero; - SaveIntegerBits(a, puVar2, 1); + ptr = &zero; + WriteBits(a, ptr, 1); } void sub_80958E4(u32 *a, u32 b) { *a = b; -} +} \ No newline at end of file diff --git a/src/code_80958E8.c b/src/code_80958E8.c index a79a62320..84fa8e336 100644 --- a/src/code_80958E8.c +++ b/src/code_80958E8.c @@ -30,8 +30,8 @@ u8 sub_8095E78(void); bool8 sub_80963B4(void); s32 CalculateMailChecksum(WonderMail *mail); -extern void SaveDungeonLocation(unkStruct_8094924*, DungeonLocation*); -extern void RestoreDungeonLocation(unkStruct_8094924*, DungeonLocation*); +extern void WriteDungeonLocationBits(DataSerializer*, DungeonLocation*); +extern void ReadDungeonLocationBits(DataSerializer*, DungeonLocation*); extern void sub_803C4F0(WonderMail *); extern void sub_803C3E0(WonderMail *); extern void sub_803C45C(WonderMail *); @@ -1289,13 +1289,13 @@ s32 CalculateMailChecksum(WonderMail *mail) sum += mail->unk4.dungeon.id; sum += mail->unk4.dungeon.floor; - sum += mail->unk4.seed << 0x8; + sum += mail->unk4.seed << 8; - sum += mail->clientSpecies << 0xC; + sum += mail->clientSpecies << 12; - sum += mail->targetSpecies << 0x10; + sum += mail->targetSpecies << 16; - sum += mail->targetItem << 0x18; + sum += mail->targetItem << 24; sum += mail->rewardType; @@ -1310,10 +1310,10 @@ void sub_8096EEC(WonderMail *mail) { s32 index; - for(index = 15; index > 0; index--) - { + for (index = 16 - 1; index > 0; index--) { gUnknown_203B490->unk230[index] = gUnknown_203B490->unk230[index - 1]; } + gUnknown_203B490->unk230[0].sub = mail->unk4; gUnknown_203B490->unk230[0].checksum = CalculateMailChecksum(mail); } @@ -1326,7 +1326,7 @@ bool8 sub_8096F50(WonderMail *mail) checksum = CalculateMailChecksum(mail); - for (index = 0; index < 0x10; index++) { + for (index = 0; index < 16; index++) { temp = &gUnknown_203B490->unk230[index]; if (temp->sub.dungeon.id == mail->unk4.dungeon.id) if (temp->sub.dungeon.floor == mail->unk4.dungeon.floor) @@ -1341,66 +1341,66 @@ bool8 sub_8096F50(WonderMail *mail) u32 RestoreMailInfo(u8 *r0, u32 size) { s32 index; - unkStruct_8094924 backup; + DataSerializer backup; u32 temp; - xxx_init_struct_8094924_restore_809485C(&backup, r0, size); + InitBitReader(&backup, r0, size); for(index = 0; index < NUM_MAILBOX_SLOTS; index++) { - RestoreWonderMail(&backup, &gUnknown_203B490->mailboxSlots[index]); + ReadWonderMailBits(&backup, &gUnknown_203B490->mailboxSlots[index]); } for(index = 0; index < MAX_ACCEPTED_JOBS; index++) { - RestoreWonderMail(&backup, &gUnknown_203B490->pelipperBoardJobs[index]); + ReadWonderMailBits(&backup, &gUnknown_203B490->pelipperBoardJobs[index]); } for(index = 0; index < MAX_ACCEPTED_JOBS; index++) { - RestoreWonderMail(&backup, &gUnknown_203B490->jobSlots[index]); + ReadWonderMailBits(&backup, &gUnknown_203B490->jobSlots[index]); } - for(index = 0; index < 0x38; index++) + for(index = 0; index < 56; index++) { - RestoreIntegerBits(&backup, &temp, 1); + ReadBits(&backup, &temp, 1); if(temp & 1) gUnknown_203B490->PKMNNewsReceived[index] = TRUE; else gUnknown_203B490->PKMNNewsReceived[index] = FALSE; } - RestoreIntegerBits(&backup, &temp, 1); + ReadBits(&backup, &temp, 1); if(temp & 1) gUnknown_203B490->unk328 = TRUE; else gUnknown_203B490->unk328 = FALSE; - RestoreIntegerBits(&backup, gUnknown_203B490->unk190, 0x140); - RestoreIntegerBits(&backup, gUnknown_203B490->unk1B8, 0x3C0); - for(index = 0; index < 0x10; index++) + ReadBits(&backup, gUnknown_203B490->unk190, 40 * 8); + ReadBits(&backup, gUnknown_203B490->unk1B8, 120 * 8); + for (index = 0; index < 16; index++) { - RestoreIntegerBits(&backup, &gUnknown_203B490->unk230[index].checksum, 0x20); - RestoreIntegerBits(&backup, &gUnknown_203B490->unk230[index].sub.seed, 0x18); - RestoreDungeonLocation(&backup, &gUnknown_203B490->unk230[index].sub.dungeon); + ReadBits(&backup, &gUnknown_203B490->unk230[index].checksum, 32); + ReadBits(&backup, &gUnknown_203B490->unk230[index].sub.seed, 24); + ReadDungeonLocationBits(&backup, &gUnknown_203B490->unk230[index].sub.dungeon); } nullsub_102(&backup); - return backup.unk8; + return backup.count; } u32 SaveMailInfo(u8 *r0, u32 size) { s32 index; - unkStruct_8094924 backup; + DataSerializer backup; u32 temp; - xxx_init_struct_8094924_save_809486C(&backup, r0, size); + InitBitWriter(&backup, r0, size); for(index = 0; index < NUM_MAILBOX_SLOTS; index++) { - SaveWonderMail(&backup, &gUnknown_203B490->mailboxSlots[index]); + WriteWonderMailBits(&backup, &gUnknown_203B490->mailboxSlots[index]); } for(index = 0; index < MAX_ACCEPTED_JOBS; index++) { - SaveWonderMail(&backup, &gUnknown_203B490->pelipperBoardJobs[index]); + WriteWonderMailBits(&backup, &gUnknown_203B490->pelipperBoardJobs[index]); } for(index = 0; index < MAX_ACCEPTED_JOBS; index++) { - SaveWonderMail(&backup, &gUnknown_203B490->jobSlots[index]); + WriteWonderMailBits(&backup, &gUnknown_203B490->jobSlots[index]); } for(index = 0; index < 0x38; index++) { @@ -1408,51 +1408,51 @@ u32 SaveMailInfo(u8 *r0, u32 size) temp = -1; else temp = 0; - SaveIntegerBits(&backup, &temp, 1); + WriteBits(&backup, &temp, 1); } if(gUnknown_203B490->unk328) temp = -1; else temp = 0; - SaveIntegerBits(&backup, &temp, 1); - SaveIntegerBits(&backup, gUnknown_203B490->unk190, 0x140); - SaveIntegerBits(&backup, gUnknown_203B490->unk1B8, 0x3C0); + WriteBits(&backup, &temp, 1); + WriteBits(&backup, gUnknown_203B490->unk190, 0x140); + WriteBits(&backup, gUnknown_203B490->unk1B8, 0x3C0); for(index = 0; index < 0x10; index++) { - SaveIntegerBits(&backup, &gUnknown_203B490->unk230[index].checksum, 0x20); - SaveIntegerBits(&backup, &gUnknown_203B490->unk230[index].sub.seed, 0x18); - SaveDungeonLocation(&backup, &gUnknown_203B490->unk230[index].sub.dungeon); + WriteBits(&backup, &gUnknown_203B490->unk230[index].checksum, 0x20); + WriteBits(&backup, &gUnknown_203B490->unk230[index].sub.seed, 0x18); + WriteDungeonLocationBits(&backup, &gUnknown_203B490->unk230[index].sub.dungeon); } nullsub_102(&backup); - return backup.unk8; + return backup.count; } -void RestoreWonderMail(unkStruct_8094924 *a, WonderMail *b) +void ReadWonderMailBits(DataSerializer *a, WonderMail *b) { - RestoreIntegerBits(a, &b->mailType, 4); - RestoreIntegerBits(a, &b->missionType, 3); - RestoreIntegerBits(a, &b->unk2, 4); - RestoreIntegerBits(a, &b->clientSpecies, 9); - RestoreIntegerBits(a, &b->targetSpecies, 9); - RestoreIntegerBits(a, &b->targetItem, 8); - RestoreIntegerBits(a, &b->rewardType, 4); - RestoreIntegerBits(a, &b->itemReward, 8); - RestoreIntegerBits(a, &b->friendAreaReward, 6); - RestoreIntegerBits(a, &b->unk4.seed, 0x18); - RestoreDungeonLocation(a, &b->unk4.dungeon); + ReadBits(a, &b->mailType, 4); + ReadBits(a, &b->missionType, 3); + ReadBits(a, &b->unk2, 4); + ReadBits(a, &b->clientSpecies, 9); + ReadBits(a, &b->targetSpecies, 9); + ReadBits(a, &b->targetItem, 8); + ReadBits(a, &b->rewardType, 4); + ReadBits(a, &b->itemReward, 8); + ReadBits(a, &b->friendAreaReward, 6); + ReadBits(a, &b->unk4.seed, 24); + ReadDungeonLocationBits(a, &b->unk4.dungeon); } -void SaveWonderMail(unkStruct_8094924 *a, WonderMail *b) +void WriteWonderMailBits(DataSerializer *a, WonderMail *b) { - SaveIntegerBits(a, &b->mailType, 4); - SaveIntegerBits(a, &b->missionType, 3); - SaveIntegerBits(a, &b->unk2, 4); - SaveIntegerBits(a, &b->clientSpecies, 9); - SaveIntegerBits(a, &b->targetSpecies, 9); - SaveIntegerBits(a, &b->targetItem, 8); - SaveIntegerBits(a, &b->rewardType, 4); - SaveIntegerBits(a, &b->itemReward, 8); - SaveIntegerBits(a, &b->friendAreaReward, 6); - SaveIntegerBits(a, &b->unk4.seed, 0x18); - SaveDungeonLocation(a, &b->unk4.dungeon); + WriteBits(a, &b->mailType, 4); + WriteBits(a, &b->missionType, 3); + WriteBits(a, &b->unk2, 4); + WriteBits(a, &b->clientSpecies, 9); + WriteBits(a, &b->targetSpecies, 9); + WriteBits(a, &b->targetItem, 8); + WriteBits(a, &b->rewardType, 4); + WriteBits(a, &b->itemReward, 8); + WriteBits(a, &b->friendAreaReward, 6); + WriteBits(a, &b->unk4.seed, 24); + WriteDungeonLocationBits(a, &b->unk4.dungeon); } diff --git a/src/code_8097670.c b/src/code_8097670.c index 5f028c526..cb31e4c1b 100644 --- a/src/code_8097670.c +++ b/src/code_8097670.c @@ -13,12 +13,12 @@ EWRAM_DATA_2 struct unkStruct_203B494 *gUnknown_203B494 = {0}; // data_810AE24.s extern const u8 *gAdventureLogText[]; -extern void SaveDungeonLocation(struct unkStruct_8094924*, DungeonLocation*); -extern void RestoreDungeonLocation(struct unkStruct_8094924*, DungeonLocation*); -void ReadGameOptions(struct unkStruct_8094924 *param_1); -void ReadPlayTime(struct unkStruct_8094924 *r0); -void WriteGameOptions(struct unkStruct_8094924 *param_1); -void WritePlayTime(struct unkStruct_8094924 *r0); +extern void WriteDungeonLocationBits(DataSerializer*, DungeonLocation*); +extern void ReadDungeonLocationBits(DataSerializer*, DungeonLocation*); +void ReadGameOptionsBits(DataSerializer *param_1); +void ReadPlayTimeBits(DataSerializer *r0); +void WriteGameOptionsBits(DataSerializer *param_1); +void WritePlayTimeBits(DataSerializer *r0); void sub_8097670(void) { @@ -30,10 +30,10 @@ struct unkStruct_203B494 *sub_8097680(void) return &sUnknown_2039778; } -void SetDungeonLocationInfo(DungeonLocation *r0) +void SetDungeonLocationInfo(DungeonLocation *dl) { - gUnknown_203B494->dungeonLocation.id = r0->id; - gUnknown_203B494->dungeonLocation.floor = r0->floor; + gUnknown_203B494->dungeonLocation.id = dl->id; + gUnknown_203B494->dungeonLocation.floor = dl->floor; } DungeonLocation *GetDungeonLocationInfo(void) @@ -41,40 +41,40 @@ DungeonLocation *GetDungeonLocationInfo(void) return &gUnknown_203B494->dungeonLocation; } -void sub_80976A8(void) +void ResetAdventureInfo(void) { s32 index; - gUnknown_203B494->unk0 = 0; - gUnknown_203B494->unk14 = 0; - gUnknown_203B494->unk16 = 0; - gUnknown_203B494->unk18 = 0; - gUnknown_203B494->unkC0 = 0; - gUnknown_203B494->unk8 = 0; - gUnknown_203B494->unkC = 0; + gUnknown_203B494->achievements = 0; + gUnknown_203B494->thievingSuccesses = 0; + gUnknown_203B494->numJoined = 0; + gUnknown_203B494->adventureMovesLearned = 0; + gUnknown_203B494->numFloorsExplored = 0; + gUnknown_203B494->friendRescueSuccesses = 0; + gUnknown_203B494->numEvolved = 0; for (index = 0; index < 14; index++) gUnknown_203B494->unk1C[index] = 0; - for (index = 0; index < 13; index++) - gUnknown_203B494->unk8C[index] = 0; + for (index = 0; index < (s32)ARRAY_COUNT(gUnknown_203B494->learnedMoves); index++) + gUnknown_203B494->learnedMoves[index] = 0; } -void sub_80976F8(u8 r0) +void SetAdventureAchievement(u8 x) { - gUnknown_203B494->unk0 |= (1 << r0); + gUnknown_203B494->achievements |= (1 << x); } -bool8 sub_8097710(u8 r0) +bool8 GetAdventureAchievement(u8 x) { - if (gUnknown_203B494->unk0 & (1 << r0)) + if (gUnknown_203B494->achievements & (1 << x)) return TRUE; return FALSE; } -const u8 *GetAdventureLogLine(u8 index) +const u8 *GetAdventureLogLine(u8 achievement) { - return gAdventureLogText[index]; + return gAdventureLogText[achievement]; } void ResetNumAdventures(void) @@ -99,86 +99,86 @@ UNUSED static void SetNumAdventures(s32 numAdventures) gUnknown_203B494->numAdventures = numAdventures; } -void sub_8097790(void) +void IncrementFriendRescueSuccesses(void) { - gUnknown_203B494->unk8++; - if (gUnknown_203B494->unk8 > 99999) - gUnknown_203B494->unk8 = 99999; + gUnknown_203B494->friendRescueSuccesses++; + if (gUnknown_203B494->friendRescueSuccesses > 99999) + gUnknown_203B494->friendRescueSuccesses = 99999; - sub_80976F8(8); + SetAdventureAchievement(AA_NUM_FRIEND_RESCUE_SUCCESSES); } -s32 sub_80977B8(void) +s32 GetFriendRescueSuccesses(void) { - return gUnknown_203B494->unk8; + return gUnknown_203B494->friendRescueSuccesses; } -UNUSED static void sub_80977C4(s32 r0) +UNUSED static void SetFriendRescueSuccess(s32 numSuccess) { - gUnknown_203B494->unk8 = r0; + gUnknown_203B494->friendRescueSuccesses = numSuccess; } -void sub_80977D0(void) +void IncrementNumEvolved(void) { - gUnknown_203B494->unkC++; - if (gUnknown_203B494->unkC > 99999) - gUnknown_203B494->unkC = 99999; + gUnknown_203B494->numEvolved++; + if (gUnknown_203B494->numEvolved > 99999) + gUnknown_203B494->numEvolved = 99999; - sub_80976F8(9); + SetAdventureAchievement(AA_NUM_POKEMON_EVOLVED); } -s32 sub_80977F8(void) +s32 GetAdventureNumEvolved(void) { - return gUnknown_203B494->unkC; + return gUnknown_203B494->numEvolved; } -UNUSED static void sub_8097804(s32 r0) +UNUSED static void SetAdventureNumEvolved(s32 numEvolved) { - gUnknown_203B494->unkC = r0; + gUnknown_203B494->numEvolved = numEvolved; } -void sub_8097810(void) +void IncrementThievingSuccesses(void) { - if (gUnknown_203B494->unk14 < 9999) - gUnknown_203B494->unk14++; + if (gUnknown_203B494->thievingSuccesses < 9999) + gUnknown_203B494->thievingSuccesses++; - sub_80976F8(11); + SetAdventureAchievement(AA_NUM_THIEVING_SUCCESSES); } -s16 sub_8097838(void) +s16 GetThievingSuccesses(void) { - return gUnknown_203B494->unk14; + return gUnknown_203B494->thievingSuccesses; } -void sub_8097848(void) +void IncrementAdventureNumJoined(void) { - if (gUnknown_203B494->unk16 < 9999) - gUnknown_203B494->unk16++; + if (gUnknown_203B494->numJoined < 9999) + gUnknown_203B494->numJoined++; - sub_80976F8(10); + SetAdventureAchievement(AA_NUM_POKEMON_JOINED); } -s16 sub_8097870(void) +s16 GetAdventureNumJoined(void) { - return gUnknown_203B494->unk16; + return gUnknown_203B494->numJoined; } -s16 sub_8097880(void) +s16 GetAdventureMovesLearned(void) { - return gUnknown_203B494->unk18; + return gUnknown_203B494->adventureMovesLearned; } -void sub_8097890(void) +void IncrementAdventureFloorsExplored(void) { - if (gUnknown_203B494->unkC0 < 99999) - gUnknown_203B494->unkC0++; + if (gUnknown_203B494->numFloorsExplored < 99999) + gUnknown_203B494->numFloorsExplored++; - sub_80976F8(12); + SetAdventureAchievement(AA_NUM_FLOORS_EXPLORED); } -s16 sub_80978B8(void) +s16 GetAdventureFloorsExplored(void) { - return gUnknown_203B494->unkC0; + return gUnknown_203B494->numFloorsExplored; } void sub_80978C8(s16 pokeIndex) @@ -191,9 +191,9 @@ void sub_80978C8(s16 pokeIndex) preload = gUnknown_203B494; iVar2 = baseSpecies; if (baseSpecies < 0) - iVar2 = baseSpecies + 0x1F; // 0x1F == MONSTER_NIDOQUEEN + iVar2 = baseSpecies + 0x1F; // 0b11111 - preload->unk54[iVar2 >> 5] |= 1 << (baseSpecies + (iVar2 >> 5) * -0x20); + preload->unk54[iVar2 >> 5] |= 1 << (baseSpecies + (iVar2 >> 5) * -32); } bool8 sub_8097900(s16 pokeIndex) @@ -206,45 +206,42 @@ bool8 sub_8097900(s16 pokeIndex) preload = gUnknown_203B494; iVar2 = baseSpecies; if (baseSpecies < 0) - iVar2 = baseSpecies + 0x1F; // 0x1F == MONSTER_NIDOQUEEN + iVar2 = baseSpecies + 0x1F; // 0b11111 - if (preload->unk1C[iVar2 >> 5] & (1 << (baseSpecies + (iVar2 >> 5) * -0x20))) + if (preload->unk1C[iVar2 >> 5] & (1 << (baseSpecies + (iVar2 >> 5) * -32))) return TRUE; return FALSE; } -void sub_8097944(void) +void UpdateAdventureAchievements(void) { - bool8 bVar2; - bool8 bVar3; + bool8 allJoined; + bool8 allLeaders; s32 i, j; - s32 counter; + s32 moveCount; Move *move; - bVar2 = 1; - bVar3 = 1; - if (!sub_8097710(0xd) && (HasAllFriendAreas())) { - sub_80976F8(0xd); - } + allJoined = TRUE; + allLeaders = TRUE; - for(i = 0; i < NUM_MONSTERS; i++) - { + if (!GetAdventureAchievement(AA_ALL_FRIEND_AREAS) && HasAllFriendAreas()) + SetAdventureAchievement(AA_ALL_FRIEND_AREAS); + + for (i = 0; i < NUM_MONSTERS; i++) { if (PokemonFlag1(&gRecruitedPokemonRef->pokemon[i])) { s32 species = gRecruitedPokemonRef->pokemon[i].speciesNum; gUnknown_203B494->unk1C[species / 32] |= 1 << species % 32; - for(j = 0; j < MAX_MON_MOVES; j++) - { + for (j = 0; j < MAX_MON_MOVES; j++) { move = &gRecruitedPokemonRef->pokemon[i].moves[j]; - if (MoveFlagExists(move)) { - gUnknown_203B494->unk8C[move->id / 32] |= 1 << move->id % 32; - } + + if (MoveFlagExists(move)) + gUnknown_203B494->learnedMoves[move->id / 32] |= 1 << move->id % 32; } } } - for(i = 0; i < MONSTER_MAX; i++) - { + for (i = 0; i < MONSTER_MAX; i++) { if (i == MONSTER_NONE) continue; if (i == MONSTER_CASTFORM_SNOWY) continue; if (i == MONSTER_CASTFORM_SUNNY) continue; @@ -258,141 +255,141 @@ void sub_8097944(void) if (i == MONSTER_RAYQUAZA_CUTSCENE) continue; if ((gUnknown_203B494->unk54[i / 32] & 1 << i % 32) == 0) - { - bVar3 = 0; - } - if ((gUnknown_203B494->unk1C[i / 32] & 1 << i % 32) != 0) - { - if (i == MONSTER_MOLTRES) { - sub_80976F8(0x10); - } - if (i == MONSTER_ZAPDOS) { - sub_80976F8(0x11); - } - if (i == MONSTER_ARTICUNO) { - sub_80976F8(0x12); - } - if (i == MONSTER_DEOXYS_NORMAL) { - sub_80976F8(0x13); - } - if (i == MONSTER_ENTEI) { - sub_80976F8(0x14); - } - if (i == MONSTER_RAIKOU) { - sub_80976F8(0x15); - } - if (i == MONSTER_SUICUNE) { - sub_80976F8(0x16); - } - if (i == MONSTER_HO_OH) { - sub_80976F8(0x17); - } - if (i == MONSTER_KYOGRE) { - sub_80976F8(0x18); - } - if (i == MONSTER_GROUDON) { - sub_80976F8(0x19); - } - if (i == MONSTER_RAYQUAZA) { - sub_80976F8(0x1a); - } - if (i == MONSTER_LUGIA) { - sub_80976F8(0x1b); - } - if (i == MONSTER_CELEBI) { - sub_80976F8(0x1c); - } - if (i == MONSTER_MEW) { - sub_80976F8(0x1d); - } - if (i == MONSTER_MEWTWO) { - sub_80976F8(0x1e); - } - if (i == MONSTER_JIRACHI) { - sub_80976F8(0x1f); - } + allLeaders = FALSE; + + if ((gUnknown_203B494->unk1C[i / 32] & 1 << i % 32) != 0) { + if (i == MONSTER_MOLTRES) + SetAdventureAchievement(AA_RECRUIT_MOLTRES); + + if (i == MONSTER_ZAPDOS) + SetAdventureAchievement(AA_RECRUIT_ZAPDOS); + + if (i == MONSTER_ARTICUNO) + SetAdventureAchievement(AA_RECRUIT_ARTICUNO); + + if (i == MONSTER_DEOXYS_NORMAL) + SetAdventureAchievement(AA_RECRUIT_DEOXYS); + + if (i == MONSTER_ENTEI) + SetAdventureAchievement(AA_RECRUIT_ENTEI); + + if (i == MONSTER_RAIKOU) + SetAdventureAchievement(AA_RECRUIT_RAIKOU); + + if (i == MONSTER_SUICUNE) + SetAdventureAchievement(AA_RECRUIT_SUICUNE); + + if (i == MONSTER_HO_OH) + SetAdventureAchievement(AA_RECRUIT_HO_OH); + + if (i == MONSTER_KYOGRE) + SetAdventureAchievement(AA_RECRUIT_KYOGRE); + + if (i == MONSTER_GROUDON) + SetAdventureAchievement(AA_RECRUIT_GROUDON); + + if (i == MONSTER_RAYQUAZA) + SetAdventureAchievement(AA_RECRUIT_RAYQUAZA); + + if (i == MONSTER_LUGIA) + SetAdventureAchievement(AA_RECRUIT_LUGIA); + + if (i == MONSTER_CELEBI) + SetAdventureAchievement(AA_RECRUIT_CELEBI); + + if (i == MONSTER_MEW) + SetAdventureAchievement(AA_RECRUIT_MEW); + + if (i == MONSTER_MEWTWO) + SetAdventureAchievement(AA_RECRUIT_MEWTWO); + + if (i == MONSTER_JIRACHI) + SetAdventureAchievement(AA_RECRUIT_JIRACHI); } else - { - bVar2 = 0; - } + allJoined = FALSE; } - if (bVar2) { - sub_80976F8(0xf); + if (allJoined) + SetAdventureAchievement(AA_ALL_POKEMON_JOINED); + + if (allLeaders) + SetAdventureAchievement(AA_ALL_POKEMON_LEADERS); + + moveCount = 0; + for (i = 0; i < NUM_MOVE_IDS; i++) { + if (i == MOVE_NOTHING || i == MOVE_REGULAR_ATTACK || i == MOVE_IS_WATCHING || i == MOVE_BIDE_2) + continue; + + if (gUnknown_203B494->learnedMoves[i / 32] & 1 << i % 32) + moveCount++; } - if (bVar3) { - sub_80976F8(0xe); - } - counter = 0; - for(i = 0; i < NUM_MONSTERS; i++) - { - if (i == MONSTER_NONE || i == MONSTER_FLYGON || i == MONSTER_CACNEA || i == MONSTER_CACTURNE) continue; - if (gUnknown_203B494->unk8C[i / 32] & 1 << i % 32) { - counter++; - } - } - if (counter != 0) { - gUnknown_203B494->unk18 = counter; - sub_80976F8(7); + + if (moveCount != 0) { + gUnknown_203B494->adventureMovesLearned = moveCount; + SetAdventureAchievement(AA_NUM_MOVES_LEARNED); } } -void sub_8097C18(struct unkStruct_8094924 *r0) +static void WriteAdventureBits(DataSerializer *r0) { - sub_8097944(); - SaveIntegerBits(r0, &gUnknown_203B494->numAdventures, 0x11); - SaveIntegerBits(r0, &gUnknown_203B494->unk8, 0x11); - SaveIntegerBits(r0, &gUnknown_203B494->unkC, 0x11); - SaveIntegerBits(r0, &gUnknown_203B494->unk0, 0x20); - SaveIntegerBits(r0, &gUnknown_203B494->unk14, 0xE); - SaveIntegerBits(r0, &gUnknown_203B494->unk16, 0xE); - SaveIntegerBits(r0, &gUnknown_203B494->unk18, 0x9); - SaveIntegerBits(r0, &gUnknown_203B494->unkC0, 0x11); - SaveIntegerBits(r0, gUnknown_203B494->unk1C, 0xE0 << 1); - SaveIntegerBits(r0, gUnknown_203B494->unk54, 0xE0 << 1); - SaveIntegerBits(r0, gUnknown_203B494->unk8C, 0xD0 << 1); - SaveDungeonLocation(r0, &gUnknown_203B494->dungeonLocation); + UpdateAdventureAchievements(); + WriteBits(r0, &gUnknown_203B494->numAdventures, 17); + WriteBits(r0, &gUnknown_203B494->friendRescueSuccesses, 17); + WriteBits(r0, &gUnknown_203B494->numEvolved, 17); + WriteBits(r0, &gUnknown_203B494->achievements, 32); + WriteBits(r0, &gUnknown_203B494->thievingSuccesses, 14); + WriteBits(r0, &gUnknown_203B494->numJoined, 14); + WriteBits(r0, &gUnknown_203B494->adventureMovesLearned, 9); + WriteBits(r0, &gUnknown_203B494->numFloorsExplored, 17); + WriteBits(r0, gUnknown_203B494->unk1C, 14 * 32); + WriteBits(r0, gUnknown_203B494->unk54, 14 * 32); + WriteBits(r0, gUnknown_203B494->learnedMoves, (s32)ARRAY_COUNT(gUnknown_203B494->learnedMoves) * 32); + WriteDungeonLocationBits(r0, &gUnknown_203B494->dungeonLocation); } -void sub_8097CC0(struct unkStruct_8094924 *r0) +static void ReadAdventureBits(DataSerializer *r0) { - RestoreIntegerBits(r0, &gUnknown_203B494->numAdventures, 0x11); - RestoreIntegerBits(r0, &gUnknown_203B494->unk8, 0x11); - RestoreIntegerBits(r0, &gUnknown_203B494->unkC, 0x11); - RestoreIntegerBits(r0, &gUnknown_203B494->unk0, 0x20); - RestoreIntegerBits(r0, &gUnknown_203B494->unk14, 0xE); - RestoreIntegerBits(r0, &gUnknown_203B494->unk16, 0xE); - RestoreIntegerBits(r0, &gUnknown_203B494->unk18, 0x9); - RestoreIntegerBits(r0, &gUnknown_203B494->unkC0, 0x11); - RestoreIntegerBits(r0, gUnknown_203B494->unk1C, 0xE0 << 1); - RestoreIntegerBits(r0, gUnknown_203B494->unk54, 0xE0 << 1); - RestoreIntegerBits(r0, gUnknown_203B494->unk8C, 0xD0 << 1); - RestoreDungeonLocation(r0, &gUnknown_203B494->dungeonLocation); + ReadBits(r0, &gUnknown_203B494->numAdventures, 17); + ReadBits(r0, &gUnknown_203B494->friendRescueSuccesses, 17); + ReadBits(r0, &gUnknown_203B494->numEvolved, 17); + ReadBits(r0, &gUnknown_203B494->achievements, 32); + ReadBits(r0, &gUnknown_203B494->thievingSuccesses, 14); + ReadBits(r0, &gUnknown_203B494->numJoined, 14); + ReadBits(r0, &gUnknown_203B494->adventureMovesLearned, 9); + ReadBits(r0, &gUnknown_203B494->numFloorsExplored, 17); + ReadBits(r0, gUnknown_203B494->unk1C, 14 * 32); + ReadBits(r0, gUnknown_203B494->unk54, 14 * 32); + ReadBits(r0, gUnknown_203B494->learnedMoves, (s32)ARRAY_COUNT(gUnknown_203B494->learnedMoves) * 32); + ReadDungeonLocationBits(r0, &gUnknown_203B494->dungeonLocation); } -// Save something... -u32 sub_8097D60(u8 *r0, u32 size) +u32 SaveAdventureData(u8 *buffer, u32 bufLen) { - struct unkStruct_8094924 backup; - xxx_init_struct_8094924_save_809486C(&backup, r0, size); - WriteGameOptions(&backup); - WritePlayTime(&backup); - sub_8097C18(&backup); - WriteExclusivePokemon(&backup); - nullsub_102(&backup); - return backup.unk8; + DataSerializer seri; + + InitBitWriter(&seri, buffer, bufLen); + + WriteGameOptionsBits(&seri); + WritePlayTimeBits(&seri); + WriteAdventureBits(&seri); + WriteExclusivePokemon(&seri); + + nullsub_102(&seri); + return seri.count; } -// Read something... -u32 sub_8097D98(u8 *r0, u32 size) +u32 RestoreAdventureData(u8 *buffer, u32 bufLen) { - struct unkStruct_8094924 backup; - xxx_init_struct_8094924_restore_809485C(&backup, r0, size); - ReadGameOptions(&backup); - ReadPlayTime(&backup); - sub_8097CC0(&backup); - ReadExclusivePokemon(&backup); - nullsub_102(&backup); - return backup.unk8; -} + DataSerializer seri; + + InitBitReader(&seri, buffer, bufLen); + + ReadGameOptionsBits(&seri); + ReadPlayTimeBits(&seri); + ReadAdventureBits(&seri); + ReadExclusivePokemon(&seri); + + nullsub_102(&seri); + return seri.count; +} \ No newline at end of file diff --git a/src/debug_menu1.c b/src/debug_menu1.c index 04de91a30..519cf62af 100644 --- a/src/debug_menu1.c +++ b/src/debug_menu1.c @@ -66,7 +66,7 @@ void DeleteDebugMenu(void) u32 UpdateDebugMenu(void) { u32 nextMenu; - s32 counter; + s32 i; s32 debugMenuAction; nextMenu = MENU_NO_SCREEN_CHANGE; @@ -99,8 +99,8 @@ u32 UpdateDebugMenu(void) nextMenu = MENU_MAIN_SCREEN; break; case MENU_DEBUG_MENU_H_OPEN: - for (counter = 0; counter < 0x20; counter++) - sub_80976F8(counter); + for (i = 0; i < AA_MAX; i++) + SetAdventureAchievement(i); nextMenu = MENU_MAIN_SCREEN; break; diff --git a/src/dungeon.c b/src/dungeon.c index 2a9b81f85..cb29437dd 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -145,18 +145,18 @@ u8 sub_80902C8(u8 dungeon) return gUnknown_81077E8[dungeon]; } -void SaveDungeonLocation(struct unkStruct_8094924* r0, DungeonLocation* r1) +void WriteDungeonLocationBits(DataSerializer* r0, DungeonLocation* src) { - SaveIntegerBits(r0, &r1->id, 0x7); - SaveIntegerBits(r0, &r1->floor, 0x7); + WriteBits(r0, &src->id, 7); + WriteBits(r0, &src->floor, 7); } -void RestoreDungeonLocation(struct unkStruct_8094924* r0, DungeonLocation* r1) +void ReadDungeonLocationBits(DataSerializer* r0, DungeonLocation* dst) { - r1->id = 0; - r1->floor = 0; - RestoreIntegerBits(r0, &r1->id, 0x7); - RestoreIntegerBits(r0, &r1->floor, 0x7); + dst->id = 0; + dst->floor = 0; + ReadBits(r0, &dst->id, 7); + ReadBits(r0, &dst->floor, 7); } bool8 DoEnemiesEvolveWhenKOed(u8 dungeon) diff --git a/src/event_flag.c b/src/event_flag.c index e3c81f650..4b7680007 100644 --- a/src/event_flag.c +++ b/src/event_flag.c @@ -149,29 +149,29 @@ void ScenarioCalc(s16 param_1,s32 param_2,s32 param_3) switch(param_1_s32) { case 3: - if (((u32)(param_2 - 1) < 0x1b)) { + if (param_2 > 0 && param_2 < 28) { if (ScriptVarScenarioAfter(SCENARIO_MAIN,8,-1)) { - sub_80976F8(0); + SetAdventureAchievement(AA_HILL_OF_ANCIENTS); } - if (ScriptVarScenarioAfter(SCENARIO_MAIN,0xb,3)) { - sub_80976F8(1); + if (ScriptVarScenarioAfter(SCENARIO_MAIN,11,3)) { + SetAdventureAchievement(AA_FUGITIVE); } - if (ScriptVarScenarioAfter(SCENARIO_MAIN,0x11,0)) { - sub_80976F8(2); + if (ScriptVarScenarioAfter(SCENARIO_MAIN,17,0)) { + SetAdventureAchievement(AA_PREVENT_METEOR); } } break; case 4: - if (ScriptVarScenarioBefore(SCENARIO_SUB1,0x1f,0) == 0) { - sub_80976F8(4); + if (ScriptVarScenarioBefore(SCENARIO_SUB1,31,0) == 0) { + SetAdventureAchievement(AA_TEAM_BASE_DONE); } - if (ScriptVarScenarioBefore(SCENARIO_SUB1,0x20,0) == 0) { - sub_80976F8(5); + if (ScriptVarScenarioBefore(SCENARIO_SUB1,32,0) == 0) { + SetAdventureAchievement(AA_SMEARGLE); } break; case 0xC: - if(ScriptVarScenarioBefore(SCENARIO_SUB9,0x37,2) == 0) { - sub_80976F8(3); + if(ScriptVarScenarioBefore(SCENARIO_SUB9,55,2) == 0) { + SetAdventureAchievement(AA_BROKE_CURSE); } break; } diff --git a/src/exclusive_pokemon.c b/src/exclusive_pokemon.c index a342b6936..536f07b50 100644 --- a/src/exclusive_pokemon.c +++ b/src/exclusive_pokemon.c @@ -197,7 +197,7 @@ void UnlockExclusivePokemon(s16 pokeID) } } -void WriteExclusivePokemon(struct unkStruct_8094924 *r0) +void WriteExclusivePokemon(DataSerializer *r0) { s32 index; u8 *puVar2; @@ -212,21 +212,21 @@ void WriteExclusivePokemon(struct unkStruct_8094924 *r0) zero = 0; - SaveIntegerBits(r0, gUnknown_203B498, 1); + WriteBits(r0, gUnknown_203B498, 1); for(index = 0; index < MONSTER_MAX; index++) { stack_0 = sub_8098134(index); - SaveIntegerBits(r0, &stack_0, 1); + WriteBits(r0, &stack_0, 1); } for(index = 0; index < 64; index++) { stack_1 = sub_8098100(index); - SaveIntegerBits(r0, &stack_1, 1); + WriteBits(r0, &stack_1, 1); } for(index = 0; index < 31; index++) { stack_2 = GetTutorialFlag(index); - SaveIntegerBits(r0, &stack_2, 1); + WriteBits(r0, &stack_2, 1); } for(index = 0; index < NUM_EXCLUSIVE_POKEMON; index++) { @@ -234,11 +234,11 @@ void WriteExclusivePokemon(struct unkStruct_8094924 *r0) puVar2 = &neg_1; else puVar2 = &zero; - SaveIntegerBits(r0, puVar2, 1); + WriteBits(r0, puVar2, 1); } } -void ReadExclusivePokemon(struct unkStruct_8094924 *r0) +void ReadExclusivePokemon(DataSerializer *r0) { s32 index; u8 stack_0; @@ -247,28 +247,28 @@ void ReadExclusivePokemon(struct unkStruct_8094924 *r0) u8 stack_3; memset(gUnknown_203B498, 0, sizeof(struct ExclusivePokemonData)); - RestoreIntegerBits(r0, gUnknown_203B498, 1); + ReadBits(r0, gUnknown_203B498, 1); for(index = 0; index < MONSTER_MAX; index++) { - RestoreIntegerBits(r0, &stack_0, 1); + ReadBits(r0, &stack_0, 1); if(stack_0) sub_80980B4(index); } for(index = 0; index < 64; index++) { - RestoreIntegerBits(r0, &stack_1, 1); + ReadBits(r0, &stack_1, 1); if(stack_1) sub_8097FA8(index); } for(index = 0; index < 31; index++) { - RestoreIntegerBits(r0, &stack_2, 1); + ReadBits(r0, &stack_2, 1); if(stack_2) SetTutorialFlag(index); } for(index = 0; index < NUM_EXCLUSIVE_POKEMON; index++) { - RestoreIntegerBits(r0, &stack_3, 1); + ReadBits(r0, &stack_3, 1); do; while(0); // do/while needed for matching - jiang diff --git a/src/friend_area.c b/src/friend_area.c index 7f760f6fd..776e6dc5e 100644 --- a/src/friend_area.c +++ b/src/friend_area.c @@ -227,34 +227,34 @@ void sub_80926F8(u8 a0, unkStruct_8092638 *a1, u8 a2) u32 SaveFriendAreas(u8 *r0, u32 size) { - struct unkStruct_8094924 unk; + DataSerializer unk; u32 temp; s32 i; - xxx_init_struct_8094924_save_809486C(&unk, r0, size); + InitBitWriter(&unk, r0, size); for (i = 0; i < NUM_FRIEND_AREAS; i++) { if (gFriendAreas[i] != 0) temp = -1; else temp = 0; - SaveIntegerBits(&unk, (u8*)&temp, 1); + WriteBits(&unk, (u8*)&temp, 1); } nullsub_102(&unk); - return unk.unk8; + return unk.count; } u32 ReadSavedFriendAreas(u8 *r0, s32 size) { - struct unkStruct_8094924 unk; + DataSerializer unk; u32 temp; s32 i; - xxx_init_struct_8094924_restore_809485C(&unk, r0, size); + InitBitReader(&unk, r0, size); for (i = 0; i < NUM_FRIEND_AREAS; i++) { - RestoreIntegerBits(&unk, &temp, 1); + ReadBits(&unk, &temp, 1); // It's setting whether we have the friend area or not if (temp & 1) gFriendAreas[i] = TRUE; @@ -263,5 +263,5 @@ u32 ReadSavedFriendAreas(u8 *r0, s32 size) } nullsub_102(&unk); - return unk.unk8; + return unk.count; } diff --git a/src/game_options.c b/src/game_options.c index e39fd6cf2..cefcd194d 100644 --- a/src/game_options.c +++ b/src/game_options.c @@ -67,7 +67,7 @@ bool8 GameOptionsNotChange(GameOptions *r0) return TRUE; } -void WriteGameOptions(struct unkStruct_8094924 *param_1) +void WriteGameOptionsBits(DataSerializer *param_1) { u8 zero; u8 neg_1; @@ -77,7 +77,7 @@ void WriteGameOptions(struct unkStruct_8094924 *param_1) neg_1 = -1; zero = 0; - SaveIntegerBits(param_1, &gGameOptionsRef->windowColor, 2); + WriteBits(param_1, &gGameOptionsRef->windowColor, 2); if(gGameOptionsRef->unk9 != 0) { @@ -87,7 +87,7 @@ void WriteGameOptions(struct unkStruct_8094924 *param_1) { puVar2 = &zero; } - SaveIntegerBits(param_1, puVar2, 1); + WriteBits(param_1, puVar2, 1); if(gGameOptionsRef->unkA != 0) { @@ -97,7 +97,7 @@ void WriteGameOptions(struct unkStruct_8094924 *param_1) { puVar2 = &zero; } - SaveIntegerBits(param_1, puVar2, 1); + WriteBits(param_1, puVar2, 1); if(gGameOptionsRef->playerGender != MALE) { @@ -107,7 +107,7 @@ void WriteGameOptions(struct unkStruct_8094924 *param_1) { puVar2 = &zero; } - SaveIntegerBits(param_1, puVar2, 1); + WriteBits(param_1, puVar2, 1); if(gGameOptionsRef->dungeonSpeed != DUNGEON_SPEED_SLOW) { @@ -117,7 +117,7 @@ void WriteGameOptions(struct unkStruct_8094924 *param_1) { puVar2 = &zero; } - SaveIntegerBits(param_1, puVar2, 1); + WriteBits(param_1, puVar2, 1); if(gGameOptionsRef->FarOffPals != FAROFFPALS_SELF) { @@ -127,7 +127,7 @@ void WriteGameOptions(struct unkStruct_8094924 *param_1) { puVar2 = &zero; } - SaveIntegerBits(param_1, puVar2, 1); + WriteBits(param_1, puVar2, 1); if(gGameOptionsRef->damageTurn) { @@ -137,7 +137,7 @@ void WriteGameOptions(struct unkStruct_8094924 *param_1) { puVar2 = &zero; } - SaveIntegerBits(param_1, puVar2, 1); + WriteBits(param_1, puVar2, 1); if(gGameOptionsRef->gridEnable) { @@ -147,43 +147,43 @@ void WriteGameOptions(struct unkStruct_8094924 *param_1) { puVar2 = &zero; } - SaveIntegerBits(param_1, puVar2, 1); + WriteBits(param_1, puVar2, 1); - SaveIntegerBits(param_1, &gGameOptionsRef->mapOption, NUM_GBA_MAP_OPTIONS); - SaveIntegerBits(param_1, &gGameOptionsRef->unkC, 2); + WriteBits(param_1, &gGameOptionsRef->mapOption, NUM_GBA_MAP_OPTIONS); + WriteBits(param_1, &gGameOptionsRef->unkC, 2); } -void ReadGameOptions(struct unkStruct_8094924 *param_1) +void ReadGameOptionsBits(DataSerializer *param_1) { u8 byteArray[4]; - RestoreIntegerBits(param_1, byteArray, 2); + ReadBits(param_1, byteArray, 2); gGameOptionsRef->windowColor = byteArray[0] & NUM_WINDOW_COLORS; - RestoreIntegerBits(param_1, byteArray, 1); + ReadBits(param_1, byteArray, 1); gGameOptionsRef->unk9 = byteArray[0] & 1; - RestoreIntegerBits(param_1, byteArray, 1); + ReadBits(param_1, byteArray, 1); gGameOptionsRef->unkA = byteArray[0] & 1; - RestoreIntegerBits(param_1, byteArray, 1); + ReadBits(param_1, byteArray, 1); gGameOptionsRef->playerGender = byteArray[0] & 1; - RestoreIntegerBits(param_1, byteArray, 1); + ReadBits(param_1, byteArray, 1); gGameOptionsRef->dungeonSpeed = byteArray[0] & 1; - RestoreIntegerBits(param_1, byteArray, 1); + ReadBits(param_1, byteArray, 1); gGameOptionsRef->FarOffPals = byteArray[0] & 1; - RestoreIntegerBits(param_1, byteArray, 1); + ReadBits(param_1, byteArray, 1); gGameOptionsRef->damageTurn = byteArray[0] & 1; - RestoreIntegerBits(param_1, byteArray, 1); + ReadBits(param_1, byteArray, 1); gGameOptionsRef->gridEnable = byteArray[0] & 1; - RestoreIntegerBits(param_1, byteArray, 3); + ReadBits(param_1, byteArray, 3); gGameOptionsRef->mapOption = byteArray[0] & NUM_DS_MAP_OPTIONS; - RestoreIntegerBits(param_1, byteArray, 2); + ReadBits(param_1, byteArray, 2); gGameOptionsRef->unkC = byteArray[0] & 3; SetWindowBGColor(); diff --git a/src/ground_script_1.c b/src/ground_script_1.c index 502fad518..5c8578624 100644 --- a/src/ground_script_1.c +++ b/src/ground_script_1.c @@ -1479,7 +1479,7 @@ s32 ExecuteScriptCommand(Action *action) { break; } case 0xb2: { - sub_80976F8(curCmd.argShort); + SetAdventureAchievement(curCmd.argShort); break; } case 0xb3: { diff --git a/src/items.c b/src/items.c index 81b32bdaa..06a83266a 100644 --- a/src/items.c +++ b/src/items.c @@ -1108,76 +1108,78 @@ bool8 AddKecleonWareItem(u8 itemIndex) { s32 SaveTeamInventory(u8* unk0, u32 size) { - struct unkStruct_8094924 unk; + DataSerializer unk; s32 i; - xxx_init_struct_8094924_save_809486C(&unk, unk0, size); + InitBitWriter(&unk, unk0, size); for (i = 0; i < INVENTORY_SIZE; i++) { - SaveItemSlot(&unk, &gTeamInventoryRef->teamItems[i]); + WriteItemSlotBits(&unk, &gTeamInventoryRef->teamItems[i]); } for (i = 0; i < STORAGE_SIZE; i++) { - SaveIntegerBits(&unk, &gTeamInventoryRef->teamStorage[i], 10); + WriteBits(&unk, &gTeamInventoryRef->teamStorage[i], 10); } for (i = 0; i < MAX_KECLEON_ITEM_SHOP_ITEMS; i++) { - SaveHeldItem(&unk, &gTeamInventoryRef->kecleonShopItems[i]); + WriteHeldItemBits(&unk, &gTeamInventoryRef->kecleonShopItems[i]); } for (i = 0; i < MAX_KECLEON_WARE_SHOP_ITEMS; i++) { - SaveHeldItem(&unk, &gTeamInventoryRef->kecleonWareItems[i]); + WriteHeldItemBits(&unk, &gTeamInventoryRef->kecleonWareItems[i]); } - SaveIntegerBits(&unk, &gTeamInventoryRef->teamMoney, 24); - SaveIntegerBits(&unk, &gTeamInventoryRef->teamSavings, 24); + WriteBits(&unk, &gTeamInventoryRef->teamMoney, 24); + WriteBits(&unk, &gTeamInventoryRef->teamSavings, 24); + nullsub_102(&unk); - return unk.unk8; + return unk.count; } s32 RestoreTeamInventory(u8 *unk0, u32 size) { - struct unkStruct_8094924 unk; - s32 i; + DataSerializer unk; + s32 i; - xxx_init_struct_8094924_restore_809485C(&unk, unk0, size); - for (i = 0; i < INVENTORY_SIZE; i++) { - RestoreItemSlot(&unk, &gTeamInventoryRef->teamItems[i]); - } - for (i = 0; i < STORAGE_SIZE; i++) { - RestoreIntegerBits(&unk, &gTeamInventoryRef->teamStorage[i], 10); - } - for (i = 0; i < MAX_KECLEON_ITEM_SHOP_ITEMS; i++) { - RestoreHeldItem(&unk, &gTeamInventoryRef->kecleonShopItems[i]); - } - for (i = 0; i < MAX_KECLEON_WARE_SHOP_ITEMS; i++) { - RestoreHeldItem(&unk, &gTeamInventoryRef->kecleonWareItems[i]); - } - RestoreIntegerBits(&unk, &gTeamInventoryRef->teamMoney, 24); - RestoreIntegerBits(&unk, &gTeamInventoryRef->teamSavings, 24); - nullsub_102(&unk); - return unk.unk8; + InitBitReader(&unk, unk0, size); + for (i = 0; i < INVENTORY_SIZE; i++) { + ReadItemSlotBits(&unk, &gTeamInventoryRef->teamItems[i]); + } + for (i = 0; i < STORAGE_SIZE; i++) { + ReadBits(&unk, &gTeamInventoryRef->teamStorage[i], 10); + } + for (i = 0; i < MAX_KECLEON_ITEM_SHOP_ITEMS; i++) { + ReadHeldItemBits(&unk, &gTeamInventoryRef->kecleonShopItems[i]); + } + for (i = 0; i < MAX_KECLEON_WARE_SHOP_ITEMS; i++) { + ReadHeldItemBits(&unk, &gTeamInventoryRef->kecleonWareItems[i]); + } + ReadBits(&unk, &gTeamInventoryRef->teamMoney, 24); + ReadBits(&unk, &gTeamInventoryRef->teamSavings, 24); + + nullsub_102(&unk); + return unk.count; } -void RestoreHeldItem(struct unkStruct_8094924 *a1, BulkItem *item) +void ReadHeldItemBits(DataSerializer *a1, BulkItem *item) { - RestoreIntegerBits(a1, &item->id, 8); - RestoreIntegerBits(a1, &item->quantity, 7); + ReadBits(a1, &item->id, 8); + ReadBits(a1, &item->quantity, 7); } -void SaveHeldItem(struct unkStruct_8094924 *a1, BulkItem *item) +void WriteHeldItemBits(DataSerializer *a1, BulkItem *item) { - SaveIntegerBits(a1, &item->id, 8); - SaveIntegerBits(a1, &item->quantity, 7); + WriteBits(a1, &item->id, 8); + WriteBits(a1, &item->quantity, 7); } -void RestoreItemSlot(struct unkStruct_8094924 *a1, Item *slot) +void ReadItemSlotBits(DataSerializer *a1, Item *slot) { - RestoreIntegerBits(a1, &slot->flags, 8); - RestoreIntegerBits(a1, &slot->quantity, 7); - RestoreIntegerBits(a1, &slot->id, 8); + ReadBits(a1, &slot->flags, 8); + ReadBits(a1, &slot->quantity, 7); + ReadBits(a1, &slot->id, 8); } -void SaveItemSlot(struct unkStruct_8094924 *a1, Item *slot) +void WriteItemSlotBits(DataSerializer *a1, Item *slot) { - SaveIntegerBits(a1, &slot->flags, 8); - SaveIntegerBits(a1, &slot->quantity, 7); - SaveIntegerBits(a1, &slot->id, 8); + WriteBits(a1, &slot->flags, 8); + WriteBits(a1, &slot->quantity, 7); + WriteBits(a1, &slot->id, 8); } const char *sub_8091E50(u8 index) diff --git a/src/luminous_cave.c b/src/luminous_cave.c index 0861d3b3a..ba2b86f06 100644 --- a/src/luminous_cave.c +++ b/src/luminous_cave.c @@ -313,7 +313,7 @@ static void UpdateLuminousCaveDialogue(void) monName = GetMonSpecies(sLuminousCaveWork->evolveStatus.targetEvolveSpecies); strcpy(gFormatBuffer_Monsters[1],monName); sLuminousCaveWork->evolutionComplete = TRUE; - sub_80977D0(); + IncrementNumEvolved(); sub_808F734(sLuminousCaveWork->pokeStruct,sLuminousCaveWork->evolveStatus.targetEvolveSpecies); nullsub_104(); sLuminousCaveWork->pokeStruct = GetPlayerPokemonStruct(); diff --git a/src/moves.c b/src/moves.c index ee1cd2ecb..51575a94a 100644 --- a/src/moves.c +++ b/src/moves.c @@ -1515,74 +1515,74 @@ void sub_8094060(Move *srcMoves, Move *destMoves) destMoves[j++].moveFlags = 0; } -static void SavePokemonMove(struct unkStruct_8094924 *r0, Move *move) +static void WritePoke1MoveBits(DataSerializer *r0, Move *move) { - SaveIntegerBits(r0, &move->moveFlags, 4); - SaveIntegerBits(r0, &move->id, 9); - SaveIntegerBits(r0, &move->PP, 7); + WriteBits(r0, &move->moveFlags, 4); + WriteBits(r0, &move->id, 9); + WriteBits(r0, &move->PP, 7); } -static void RestorePokemonMove(struct unkStruct_8094924 *r0, Move *move) +static void ReadPoke1MoveBits(DataSerializer *r0, Move *move) { - RestoreIntegerBits(r0, &move->moveFlags, 4); - RestoreIntegerBits(r0, &move->id, 9); - RestoreIntegerBits(r0, &move->PP, 7); + ReadBits(r0, &move->moveFlags, 4); + ReadBits(r0, &move->id, 9); + ReadBits(r0, &move->PP, 7); } -void SavePokemonMoves(struct unkStruct_8094924 *r0, Move *moveSet) +void WritePoke1MovesBits(DataSerializer *r0, Move *moveSet) { s32 i; for (i = 0; i < MAX_MON_MOVES; i++) - SavePokemonMove(r0, &moveSet[i]); + WritePoke1MoveBits(r0, &moveSet[i]); } -void RestorePokemonMoves(struct unkStruct_8094924 *r0, Move *moveSet) +void ReadPoke1MovesBits(DataSerializer *r0, Move *moveSet) { s32 i; for (i = 0; i < MAX_MON_MOVES; i++) - RestorePokemonMove(r0, &moveSet[i]); + ReadPoke1MoveBits(r0, &moveSet[i]); } -static void sub_8094148(struct unkStruct_8094924 *r0, Move *move) +static void WritePoke2MoveBits(DataSerializer *r0, Move *move) { - SaveIntegerBits(r0, &move->moveFlags, 4); - SaveIntegerBits(r0, &move->moveFlags2, 1); - SaveIntegerBits(r0, &move->id, 9); - SaveIntegerBits(r0, &move->PP, 7); - SaveIntegerBits(r0, &move->ginseng, 7); + WriteBits(r0, &move->moveFlags, 4); + WriteBits(r0, &move->moveFlags2, 1); + WriteBits(r0, &move->id, 9); + WriteBits(r0, &move->PP, 7); + WriteBits(r0, &move->ginseng, 7); } -void sub_8094184(struct unkStruct_8094924 *r0, struct Moves *r1) +void WritePoke2MovesBits(DataSerializer *r0, struct Moves *r1) { s32 i; for (i = 0; i < MAX_MON_MOVES; i++) - sub_8094148(r0, &r1->moves[i]); + WritePoke2MoveBits(r0, &r1->moves[i]); - SaveIntegerBits(r0, &r1->struggleMoveFlags, 8); + WriteBits(r0, &r1->struggleMoveFlags, 8); } -static void sub_80941B0(struct unkStruct_8094924 *r0, Move *move) +static void ReadPoke2MoveBits(DataSerializer *r0, Move *move) { memset(move, 0, sizeof(Move)); - RestoreIntegerBits(r0, &move->moveFlags, 4); - RestoreIntegerBits(r0, &move->moveFlags2, 1); - RestoreIntegerBits(r0, &move->id, 9); - RestoreIntegerBits(r0, &move->PP, 7); - RestoreIntegerBits(r0, &move->ginseng, 7); + ReadBits(r0, &move->moveFlags, 4); + ReadBits(r0, &move->moveFlags2, 1); + ReadBits(r0, &move->id, 9); + ReadBits(r0, &move->PP, 7); + ReadBits(r0, &move->ginseng, 7); } -void sub_80941FC(struct unkStruct_8094924 *r0, struct Moves*r1) +void ReadPoke2MovesBits(DataSerializer *r0, struct Moves*r1) { s32 i; for (i = 0; i < MAX_MON_MOVES; i++) - sub_80941B0(r0, &r1->moves[i]); + ReadPoke2MoveBits(r0, &r1->moves[i]); - r1->struggleMoveFlags= 0; - RestoreIntegerBits(r0, &r1->struggleMoveFlags, 8); + r1->struggleMoveFlags = 0; + ReadBits(r0, &r1->struggleMoveFlags, 8); } bool8 DoesMoveCharge(u16 move) diff --git a/src/play_time.c b/src/play_time.c index ce531c552..893a53892 100644 --- a/src/play_time.c +++ b/src/play_time.c @@ -75,18 +75,18 @@ void DeconstructPlayTime(struct PlayTimeStruct *r0, u32 *outHours, u32 *outMinut } } -void WritePlayTime(struct unkStruct_8094924 *r0) +void WritePlayTimeBits(DataSerializer *r0) { - SaveIntegerBits(r0, &gPlayTimeRef->frames, 6); - SaveIntegerBits(r0, &gPlayTimeRef->seconds, 6); - SaveIntegerBits(r0, &gPlayTimeRef->minutes, 6); - SaveIntegerBits(r0, &gPlayTimeRef->hours, 14); + WriteBits(r0, &gPlayTimeRef->frames, 6); + WriteBits(r0, &gPlayTimeRef->seconds, 6); + WriteBits(r0, &gPlayTimeRef->minutes, 6); + WriteBits(r0, &gPlayTimeRef->hours, 14); } -void ReadPlayTime(struct unkStruct_8094924 *r0) +void ReadPlayTimeBits(DataSerializer *r0) { - RestoreIntegerBits(r0, &gPlayTimeRef->frames, 6); - RestoreIntegerBits(r0, &gPlayTimeRef->seconds, 6); - RestoreIntegerBits(r0, &gPlayTimeRef->minutes, 6); - RestoreIntegerBits(r0, &gPlayTimeRef->hours, 14); + ReadBits(r0, &gPlayTimeRef->frames, 6); + ReadBits(r0, &gPlayTimeRef->seconds, 6); + ReadBits(r0, &gPlayTimeRef->minutes, 6); + ReadBits(r0, &gPlayTimeRef->hours, 14); } diff --git a/src/pokemon_3.c b/src/pokemon_3.c index a42ebf95d..b91091d50 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -46,15 +46,15 @@ extern s32 gUnknown_810AC90[10]; #include "data/pokemon_3.h" -extern void SaveDungeonLocation(struct unkStruct_8094924*, DungeonLocation*); -extern void xxx_save_poke_sub_c_808F41C(struct unkStruct_8094924*, struct unkPokeSubStruct_C*); -void RestoreDungeonLocation(struct unkStruct_8094924*, DungeonLocation*); -void xxx_restore_poke_sub_c_808F410(struct unkStruct_8094924*, struct unkPokeSubStruct_C*); +extern void WriteDungeonLocationBits(DataSerializer*, DungeonLocation*); +extern void WritePoke1LevelBits(DataSerializer*, struct unkPokeSubStruct_C*); +void ReadDungeonLocationBits(DataSerializer*, DungeonLocation*); +void ReadPoke1LevelBits(DataSerializer*, struct unkPokeSubStruct_C*); -extern void sub_809449C(struct unkStruct_8094924*, void*); -extern void SavePokemonHiddenPower(struct unkStruct_8094924*, HiddenPower*); -extern void sub_809447C(struct unkStruct_8094924*, void*); -extern void RestorePokemonHiddenPower(struct unkStruct_8094924*, HiddenPower*); +extern void WriteBellyBits(DataSerializer*, FixedPoint *src); +extern void WriteHiddenPowerBits(DataSerializer*, HiddenPower*); +extern void ReadBellyBits(DataSerializer*, FixedPoint *dst); +extern void ReadHiddenPowerBits(DataSerializer*, HiddenPower*); s16 GetPokemonEvolveConditions(s16 index, unkEvolve *r1); u32 sub_808F798(PokemonStruct1 *, s16); @@ -644,266 +644,274 @@ void sub_808ED00() { } for (; i < MAX_TEAM_MEMBERS; i++) { - gRecruitedPokemonRef->team[i].unk0 = 0; + gRecruitedPokemonRef->team[i].unk0 = FLAG_NONE; } } s32 SaveRecruitedPokemon(u8 *a1, s32 a2) { - u16 buffer[6]; - struct unkStruct_8094924 backup; + u16 sixMons[6]; + DataSerializer backup; u8 data_u8; - s16 data_s16; + s16 teamLeader; s32 count; s32 i; PokemonStruct1 *pokemon; - xxx_init_struct_8094924_save_809486C(&backup, a1, a2); + InitBitWriter(&backup, a1, a2); - for (i = 0; i < 6; i++) { - buffer[i] = -1; - } + for (i = 0; i < 6; i++) + sixMons[i] = -1; - data_s16 = 1; - data_s16 = -data_s16; + teamLeader = 1; // Maybe fakematch, should be -1 + teamLeader = -teamLeader; count = 0; + for (i = 0; i < NUM_MONSTERS; i++) { - // Some check was optimized out. Needed for matching. Thanks kaz + // Fakematch, probably need the PokemonFlag2 inline if (i) { u8 unk = -unk; } pokemon = &gRecruitedPokemonRef->pokemon[i]; - if (pokemon->unk0 & 1) { - if (pokemon->unk0 & FLAG_ON_TEAM) { - buffer[count++] = i; - } - if (pokemon->isTeamLeader) { - data_s16 = i; - } + if (PokemonFlag1(pokemon)) { + if (pokemon->unk0 & FLAG_ON_TEAM) + sixMons[count++] = i; + + if (IsMonTeamLeader(pokemon)) + teamLeader = i; } - else { + else pokemon->level = 0; - } - SavePokemonStruct(&backup, pokemon); + + WritePoke1Bits(&backup, pokemon); } + // Team members for (i = 0; i < MAX_TEAM_MEMBERS; i++) { - if ((u8)i[gRecruitedPokemonRef->team].unk0 & 1) { - data_u8 = 0xff; - } - else { + if (PokemonFlag1(&gRecruitedPokemonRef->team[i])) + data_u8 = 0xFF; + else data_u8 = 0; - } - SaveIntegerBits(&backup, &data_u8, 1); - SavePokemonStruct(&backup, &gRecruitedPokemonRef->team[i]); + + WriteBits(&backup, &data_u8, 1); + WritePoke1Bits(&backup, &gRecruitedPokemonRef->team[i]); } - for (i = 0; i < 6; i++) { - SaveIntegerBits(&backup, (u8*)&buffer[i], 16); - } - SaveIntegerBits(&backup, (u8*)&data_s16, 16); + // ??? + for (i = 0; i < 6; i++) + WriteBits(&backup, &sixMons[i], 16); + + // Team leader + WriteBits(&backup, &teamLeader, 16); + nullsub_102(&backup); - return backup.unk8; + return backup.count; } s32 RestoreRecruitedPokemon(u8 *a1, s32 a2) { - struct unkStruct_8094924 backup; - u8 data_u8; // same as saverecruitedpokemon - s16 data_s16; // same as saverecruitedpokemon + DataSerializer backup; + u8 data_u8; + s16 data_s16; s32 i; - xxx_init_struct_8094924_restore_809485C(&backup, a1, a2); + InitBitReader(&backup, a1, a2); + for (i = 0; i < NUM_MONSTERS; i++) { - RestorePokemonStruct(&backup, &gRecruitedPokemonRef->pokemon[i]); + ReadPoke1Bits(&backup, &gRecruitedPokemonRef->pokemon[i]); } + // Team members for (i = 0; i < MAX_TEAM_MEMBERS; i++) { - RestoreIntegerBits(&backup, &data_u8, 1); - RestorePokemonStruct(&backup, &gRecruitedPokemonRef->team[i]); - if (data_u8 & 1) { - gRecruitedPokemonRef->team[i].unk0 = 3; // FLAG_ON_TEAM (2) + ??? (1) - } - else { - gRecruitedPokemonRef->team[i].unk0 = 0; - } + ReadBits(&backup, &data_u8, 1); + ReadPoke1Bits(&backup, &gRecruitedPokemonRef->team[i]); + if (data_u8 & 1) + gRecruitedPokemonRef->team[i].unk0 = FLAG_ON_TEAM | FLAG_UNK_1; + else + gRecruitedPokemonRef->team[i].unk0 = FLAG_NONE; } + // ??? for (i = 0; i < 6; i++) { - RestoreIntegerBits(&backup, &data_s16, 16); - if ((u16)data_s16 < NUM_MONSTERS) { + ReadBits(&backup, &data_s16, 16); + if ((u16)data_s16 < NUM_MONSTERS) gRecruitedPokemonRef->pokemon[data_s16].unk0 |= FLAG_ON_TEAM; - } } - RestoreIntegerBits(&backup, &data_s16, 16); - if ((u16)data_s16 < NUM_MONSTERS) { + + // Team leader + ReadBits(&backup, &data_s16, 16); + if ((u16)data_s16 < NUM_MONSTERS) gRecruitedPokemonRef->pokemon[data_s16].isTeamLeader = TRUE; - } + nullsub_102(&backup); - return backup.unk8; + return backup.count; } -void SavePokemonStruct(struct unkStruct_8094924* a1, PokemonStruct1* pokemon) +void WritePoke1Bits(DataSerializer* a1, PokemonStruct1* pokemon) { - SaveIntegerBits(a1, &pokemon->level, 7); - SaveIntegerBits(a1, &pokemon->speciesNum, 9); - SaveDungeonLocation(a1, &pokemon->dungeonLocation); - xxx_save_poke_sub_c_808F41C(a1, &pokemon->unkC[0]); - xxx_save_poke_sub_c_808F41C(a1, &pokemon->unkC[1]); - SaveIntegerBits(a1, &pokemon->IQ, 10); - SaveIntegerBits(a1, &pokemon->pokeHP, 10); - SaveIntegerBits(a1, &pokemon->offense.att[0], 8); - SaveIntegerBits(a1, &pokemon->offense.att[1], 8); - SaveIntegerBits(a1, &pokemon->offense.def[0], 8); - SaveIntegerBits(a1, &pokemon->offense.def[1], 8); - SaveIntegerBits(a1, &pokemon->currExp, 24); - SaveIntegerBits(a1, &pokemon->IQSkills, 24); - SaveIntegerBits(a1, &pokemon->tacticIndex, 4); - SaveHeldItem(a1, &pokemon->heldItem); - SavePokemonMoves(a1, pokemon->moves); - SaveIntegerBits(a1, pokemon->name, 80); + WriteBits(a1, &pokemon->level, 7); + WriteBits(a1, &pokemon->speciesNum, 9); + WriteDungeonLocationBits(a1, &pokemon->dungeonLocation); + WritePoke1LevelBits(a1, &pokemon->unkC[0]); + WritePoke1LevelBits(a1, &pokemon->unkC[1]); + WriteBits(a1, &pokemon->IQ, 10); + WriteBits(a1, &pokemon->pokeHP, 10); + WriteBits(a1, &pokemon->offense.att[0], 8); + WriteBits(a1, &pokemon->offense.att[1], 8); + WriteBits(a1, &pokemon->offense.def[0], 8); + WriteBits(a1, &pokemon->offense.def[1], 8); + WriteBits(a1, &pokemon->currExp, 24); + WriteBits(a1, &pokemon->IQSkills, 24); + WriteBits(a1, &pokemon->tacticIndex, 4); + WriteHeldItemBits(a1, &pokemon->heldItem); + WritePoke1MovesBits(a1, pokemon->moves); + WriteBits(a1, pokemon->name, 10 * 8); } -void RestorePokemonStruct(struct unkStruct_8094924* a1, PokemonStruct1* pokemon) +void ReadPoke1Bits(DataSerializer* a1, PokemonStruct1* pokemon) { - memset(pokemon, 0, sizeof(PokemonStruct1)); - pokemon->unk0 = 0; - pokemon->isTeamLeader = 0; - RestoreIntegerBits(a1, &pokemon->level, 7); - if (pokemon->level) { - pokemon->unk0 |= 1; - } - RestoreIntegerBits(a1, &pokemon->speciesNum, 9); - RestoreDungeonLocation(a1, &pokemon->dungeonLocation); - xxx_restore_poke_sub_c_808F410(a1, &pokemon->unkC[0]); - xxx_restore_poke_sub_c_808F410(a1, &pokemon->unkC[1]); - RestoreIntegerBits(a1, &pokemon->IQ, 10); - RestoreIntegerBits(a1, &pokemon->pokeHP, 10); - RestoreIntegerBits(a1, &pokemon->offense.att[0], 8); - RestoreIntegerBits(a1, &pokemon->offense.att[1], 8); - RestoreIntegerBits(a1, &pokemon->offense.def[0], 8); - RestoreIntegerBits(a1, &pokemon->offense.def[1], 8); - RestoreIntegerBits(a1, &pokemon->currExp, 24); - RestoreIntegerBits(a1, &pokemon->IQSkills, 24); - RestoreIntegerBits(a1, &pokemon->tacticIndex, 4); - RestoreHeldItem(a1, &pokemon->heldItem); - RestorePokemonMoves(a1, pokemon->moves); - RestoreIntegerBits(a1, pokemon->name, 80); + memset(pokemon, 0, sizeof(PokemonStruct1)); + + pokemon->unk0 = FLAG_NONE; + pokemon->isTeamLeader = FALSE; + + ReadBits(a1, &pokemon->level, 7); + if (pokemon->level) + pokemon->unk0 |= FLAG_UNK_1; + + ReadBits(a1, &pokemon->speciesNum, 9); + ReadDungeonLocationBits(a1, &pokemon->dungeonLocation); + ReadPoke1LevelBits(a1, &pokemon->unkC[0]); + ReadPoke1LevelBits(a1, &pokemon->unkC[1]); + ReadBits(a1, &pokemon->IQ, 10); + ReadBits(a1, &pokemon->pokeHP, 10); + ReadBits(a1, &pokemon->offense.att[0], 8); + ReadBits(a1, &pokemon->offense.att[1], 8); + ReadBits(a1, &pokemon->offense.def[0], 8); + ReadBits(a1, &pokemon->offense.def[1], 8); + ReadBits(a1, &pokemon->currExp, 24); + ReadBits(a1, &pokemon->IQSkills, 24); + ReadBits(a1, &pokemon->tacticIndex, 4); + ReadHeldItemBits(a1, &pokemon->heldItem); + ReadPoke1MovesBits(a1, pokemon->moves); + ReadBits(a1, pokemon->name, 10 * 8); } -s32 SavePokemonStruct2(u8* a1, s32 size) +s32 SavePoke2s(u8* buffer, s32 size) { - struct unkStruct_8094924 backup; + DataSerializer backup; s32 i; u8 data_u8_neg1; u8 data_u8_zero; - xxx_init_struct_8094924_save_809486C(&backup, a1, size); + InitBitWriter(&backup, buffer, size); data_u8_neg1 = -1; data_u8_zero = 0; for (i = 0; i < 4; i++) { PokemonStruct2* pokemon2 = &gRecruitedPokemonRef->pokemon2[i]; - SaveIntegerBits(&backup, &pokemon2->unk0, 2); + WriteBits(&backup, &pokemon2->unk0, 2); - SaveIntegerBits(&backup, pokemon2->isTeamLeader ? &data_u8_neg1 : &data_u8_zero, 1); - SaveIntegerBits(&backup, &pokemon2->level, 7); + WriteBits(&backup, pokemon2->isTeamLeader ? &data_u8_neg1 : &data_u8_zero, 1); + WriteBits(&backup, &pokemon2->level, 7); - SaveDungeonLocation(&backup, &pokemon2->dungeonLocation); - SaveIntegerBits(&backup, &pokemon2->IQ, 10); - SaveIntegerBits(&backup, &pokemon2->unkA, 16); - SaveIntegerBits(&backup, &pokemon2->unkC, 16); - SaveIntegerBits(&backup, &pokemon2->speciesNum, 9); - SaveIntegerBits(&backup, &pokemon2->unk10, 10); - SaveIntegerBits(&backup, &pokemon2->unk12, 10); - SaveIntegerBits(&backup, &pokemon2->offense.att[0], 8); - SaveIntegerBits(&backup, &pokemon2->offense.att[1], 8); - SaveIntegerBits(&backup, &pokemon2->offense.def[0], 8); - SaveIntegerBits(&backup, &pokemon2->offense.def[1], 8); - SaveIntegerBits(&backup, &pokemon2->currExp, 24); - sub_8094184(&backup, &pokemon2->moves); - SaveItemSlot(&backup, &pokemon2->itemSlot); - sub_809449C(&backup, &pokemon2->belly); - sub_809449C(&backup, &pokemon2->maxBelly); - SaveIntegerBits(&backup, &pokemon2->IQSkills, 24); - SaveIntegerBits(&backup, &pokemon2->tacticIndex, 4); - SavePokemonHiddenPower(&backup, &pokemon2->hiddenPower); - SaveIntegerBits(&backup, &pokemon2->name, 80); + WriteDungeonLocationBits(&backup, &pokemon2->dungeonLocation); + WriteBits(&backup, &pokemon2->IQ, 10); + WriteBits(&backup, &pokemon2->unkA, 16); + WriteBits(&backup, &pokemon2->unkC, 16); + WriteBits(&backup, &pokemon2->speciesNum, 9); + WriteBits(&backup, &pokemon2->unk10, 10); + WriteBits(&backup, &pokemon2->unk12, 10); + WriteBits(&backup, &pokemon2->offense.att[0], 8); + WriteBits(&backup, &pokemon2->offense.att[1], 8); + WriteBits(&backup, &pokemon2->offense.def[0], 8); + WriteBits(&backup, &pokemon2->offense.def[1], 8); + WriteBits(&backup, &pokemon2->currExp, 24); + WritePoke2MovesBits(&backup, &pokemon2->moves); + WriteItemSlotBits(&backup, &pokemon2->itemSlot); + WriteBellyBits(&backup, &pokemon2->belly); + WriteBellyBits(&backup, &pokemon2->maxBelly); + WriteBits(&backup, &pokemon2->IQSkills, 24); + WriteBits(&backup, &pokemon2->tacticIndex, 4); + WriteHiddenPowerBits(&backup, &pokemon2->hiddenPower); + WriteBits(&backup, &pokemon2->name, 10 * 8); } + nullsub_102(&backup); - return backup.unk8; + return backup.count; } -s32 RestorePokemonStruct2(u8* a1, s32 size) +s32 RestorePoke2s(u8* a1, s32 size) { - struct unkStruct_8094924 backup; + DataSerializer backup; s32 i; - xxx_init_struct_8094924_restore_809485C(&backup, a1, size); + InitBitReader(&backup, a1, size); for (i = 0; i < 4; i++) { PokemonStruct2* pokemon2 = &gRecruitedPokemonRef->pokemon2[i]; u8 unk2; memset(pokemon2, 0, sizeof(PokemonStruct2)); - RestoreIntegerBits(&backup, &pokemon2->unk0, 2); + ReadBits(&backup, &pokemon2->unk0, 2); - RestoreIntegerBits(&backup, &unk2, 1); + ReadBits(&backup, &unk2, 1); if (unk2 & 1) { pokemon2->isTeamLeader = TRUE; } else { pokemon2->isTeamLeader = FALSE; } - RestoreIntegerBits(&backup, &pokemon2->level, 7); + ReadBits(&backup, &pokemon2->level, 7); - RestoreDungeonLocation(&backup, &pokemon2->dungeonLocation); - RestoreIntegerBits(&backup, &pokemon2->IQ, 10); - RestoreIntegerBits(&backup, &pokemon2->unkA, 16); - RestoreIntegerBits(&backup, &pokemon2->unkC, 16); - RestoreIntegerBits(&backup, &pokemon2->speciesNum, 9); - RestoreIntegerBits(&backup, &pokemon2->unk10, 10); - RestoreIntegerBits(&backup, &pokemon2->unk12, 10); - RestoreIntegerBits(&backup, &pokemon2->offense.att[0], 8); - RestoreIntegerBits(&backup, &pokemon2->offense.att[1], 8); - RestoreIntegerBits(&backup, &pokemon2->offense.def[0], 8); - RestoreIntegerBits(&backup, &pokemon2->offense.def[1], 8); - RestoreIntegerBits(&backup, &pokemon2->currExp, 24); - sub_80941FC(&backup, &pokemon2->moves); - RestoreItemSlot(&backup, &pokemon2->itemSlot); - sub_809447C(&backup, &pokemon2->belly); - sub_809447C(&backup, &pokemon2->maxBelly); - RestoreIntegerBits(&backup, &pokemon2->IQSkills, 24); - RestoreIntegerBits(&backup, &pokemon2->tacticIndex, 4); - RestorePokemonHiddenPower(&backup, &pokemon2->hiddenPower); - RestoreIntegerBits(&backup, &pokemon2->name, 80); + ReadDungeonLocationBits(&backup, &pokemon2->dungeonLocation); + ReadBits(&backup, &pokemon2->IQ, 10); + ReadBits(&backup, &pokemon2->unkA, 16); + ReadBits(&backup, &pokemon2->unkC, 16); + ReadBits(&backup, &pokemon2->speciesNum, 9); + ReadBits(&backup, &pokemon2->unk10, 10); + ReadBits(&backup, &pokemon2->unk12, 10); + ReadBits(&backup, &pokemon2->offense.att[0], 8); + ReadBits(&backup, &pokemon2->offense.att[1], 8); + ReadBits(&backup, &pokemon2->offense.def[0], 8); + ReadBits(&backup, &pokemon2->offense.def[1], 8); + ReadBits(&backup, &pokemon2->currExp, 24); + ReadPoke2MovesBits(&backup, &pokemon2->moves); + ReadItemSlotBits(&backup, &pokemon2->itemSlot); + ReadBellyBits(&backup, &pokemon2->belly); + ReadBellyBits(&backup, &pokemon2->maxBelly); + ReadBits(&backup, &pokemon2->IQSkills, 24); + ReadBits(&backup, &pokemon2->tacticIndex, 4); + ReadHiddenPowerBits(&backup, &pokemon2->hiddenPower); + ReadBits(&backup, &pokemon2->name, 80); } + nullsub_102(&backup); - return backup.unk8; + return backup.count; } -void xxx_restore_poke_sub_c_808F410(struct unkStruct_8094924* a1, struct unkPokeSubStruct_C* unkC) +void ReadPoke1LevelBits(DataSerializer* a1, struct unkPokeSubStruct_C* unkC) { - RestoreIntegerBits(a1, &unkC->level, 7); + ReadBits(a1, &unkC->level, 7); } -void xxx_save_poke_sub_c_808F41C(struct unkStruct_8094924* a1, struct unkPokeSubStruct_C* unkC) +void WritePoke1LevelBits(DataSerializer* a1, struct unkPokeSubStruct_C* unkC) { - SaveIntegerBits(a1, &unkC->level, 7); + WriteBits(a1, &unkC->level, 7); } -void RestorePokemonHiddenPower(unkStruct_8094924* a1, HiddenPower* a2) +void ReadHiddenPowerBits(DataSerializer* a1, HiddenPower* a2) { - RestoreIntegerBits(a1, &a2->hiddenPowerBasePower, 10); - RestoreIntegerBits(a1, &a2->hiddenPowerType, 5); + ReadBits(a1, &a2->hiddenPowerBasePower, 10); + ReadBits(a1, &a2->hiddenPowerType, 5); } -void SavePokemonHiddenPower(unkStruct_8094924* a1, HiddenPower* a2) +void WriteHiddenPowerBits(DataSerializer* a1, HiddenPower* a2) { - SaveIntegerBits(a1, &a2->hiddenPowerBasePower, 10); - SaveIntegerBits(a1, &a2->hiddenPowerType, 5); + WriteBits(a1, &a2->hiddenPowerBasePower, 10); + WriteBits(a1, &a2->hiddenPowerType, 5); } void sub_808F468(PokemonStruct1 *param_1, EvolveStatus *evolveStatus, u8 param_3) @@ -1108,7 +1116,7 @@ u32 sub_808F734(PokemonStruct1 *pokemon, s16 _species) iVar3 = sub_808F798(&pokeStruct,MONSTER_SHEDINJA); } if (iVar3 != 0) { - sub_8097848(); + IncrementAdventureNumJoined(); } return uVar1; } diff --git a/src/rescue_team_info.c b/src/rescue_team_info.c index 64bb35509..13e8b9887 100644 --- a/src/rescue_team_info.c +++ b/src/rescue_team_info.c @@ -112,7 +112,7 @@ bool8 GetIsTeamRenamed(void) u32 SaveRescueTeamInfo(u8 *param_1, u32 size) { - struct unkStruct_8094924 auStack36; + DataSerializer auStack36; u8 neg1; u8 zero; u8 *puVar2; @@ -120,9 +120,9 @@ u32 SaveRescueTeamInfo(u8 *param_1, u32 size) neg1 = -1; zero = 0; - xxx_init_struct_8094924_save_809486C(&auStack36, param_1, size); - SaveIntegerBits(&auStack36, gRescueTeamInfoRef->teamName, 0x58); - SaveIntegerBits(&auStack36, (u8 *)&gRescueTeamInfoRef->teamRankPts, 0x20); + InitBitWriter(&auStack36, param_1, size); + WriteBits(&auStack36, gRescueTeamInfoRef->teamName, 0x58); + WriteBits(&auStack36, (u8 *)&gRescueTeamInfoRef->teamRankPts, 0x20); gRescueTeamInfoRef->isTeamRenamed = sub_80023E4(0); if (gRescueTeamInfoRef->isTeamRenamed) @@ -133,21 +133,21 @@ u32 SaveRescueTeamInfo(u8 *param_1, u32 size) { puVar2 = &zero; } - SaveIntegerBits(&auStack36,puVar2,1); + WriteBits(&auStack36,puVar2,1); nullsub_102(&auStack36); - return auStack36.unk8; + return auStack36.count; } u32 ReadRescueTeamInfo(u8 *param_1, u32 size) { - struct unkStruct_8094924 auStack32; + DataSerializer auStack32; u8 byteArray[4]; - xxx_init_struct_8094924_restore_809485C(&auStack32, param_1, size); - RestoreIntegerBits(&auStack32, gRescueTeamInfoRef->teamName, 0x58); - RestoreIntegerBits(&auStack32, &gRescueTeamInfoRef->teamRankPts, 0x20); - RestoreIntegerBits(&auStack32, byteArray, 1); + InitBitReader(&auStack32, param_1, size); + ReadBits(&auStack32, gRescueTeamInfoRef->teamName, 0x58); + ReadBits(&auStack32, &gRescueTeamInfoRef->teamRankPts, 0x20); + ReadBits(&auStack32, byteArray, 1); gRescueTeamInfoRef->isTeamRenamed = byteArray[0] & 1; nullsub_102(&auStack32); - return auStack32.unk8; + return auStack32.count; } diff --git a/src/save.c b/src/save.c index b4b1f8233..b1d07b944 100644 --- a/src/save.c +++ b/src/save.c @@ -42,8 +42,8 @@ extern bool8 sub_800DAB4(u16, u8*, s32); extern bool8 sub_800DAB8(void); extern u32 SaveRecruitedPokemon(u8 *, u32); extern u32 RestoreRecruitedPokemon(void* a, s32 b); -extern u32 SavePokemonStruct2(u8 *, u32); -extern u32 RestorePokemonStruct2(void* a, s32 b); +extern u32 SavePoke2s(u8 *, u32); +extern u32 RestorePoke2s(void* a, s32 b); extern u32 sub_80954CC(void* a, s32 b); extern u32 sub_8095624(u8 *, u32); extern u32 RestoreMailInfo(void* a, s32 b); @@ -57,9 +57,9 @@ u32 sub_8011C1C(void) return gUnknown_203B17C; } -void sub_8011C28(u32 in) +void sub_8011C28(u32 x) { - gUnknown_203B17C = in; + gUnknown_203B17C = x; } s32 sub_8011C34(void) @@ -67,9 +67,9 @@ s32 sub_8011C34(void) return gUnknown_202DE28; } -void sub_8011C40(s32 in) +void sub_8011C40(s32 x) { - gUnknown_202DE28 = in; + gUnknown_202DE28 = x; } char *GetGameInternalName(void) @@ -232,11 +232,11 @@ u32 ReadSaveFromPak(u32 *a) saveStatus = 3; } r4 += 0x4650; - r1 = RestorePokemonStruct2(r4, 0x258); + r1 = RestorePoke2s(r4, 150 * 4); if (r1 != playerSave->unk428) { saveStatus = 3; } - r4 += 0x258; + r4 += 150 * 4; r1 = RestoreTeamInventory(r4, 0x1D8); if (r1 != playerSave->savedTeamInventory) { saveStatus = 3; @@ -252,7 +252,7 @@ u32 ReadSaveFromPak(u32 *a) saveStatus = 3; } r4 += 0x8; - r1 = sub_8097D98(r4, 0x100); + r1 = RestoreAdventureData(r4, 0x100); if (r1 != playerSave->unk43C) { saveStatus = 3; } @@ -350,22 +350,22 @@ u32 WriteSavetoPak(s32 *param_1, u32 param_2) playerSave->savedRecruitedPokemon = SaveRecruitedPokemon(array_ptr,0x4650); array_ptr += 0x4650; - playerSave->unk428 = SavePokemonStruct2(array_ptr,0x258); - array_ptr += 0x258; + playerSave->unk428 = SavePoke2s(array_ptr, 150 * 4); + array_ptr += 150 * 4; playerSave->savedTeamInventory = SaveTeamInventory(array_ptr,0x1D8); array_ptr += 0x1D8; playerSave->savedRescueTeamInfo = SaveRescueTeamInfo(array_ptr,0x10); array_ptr += 0x10; playerSave->savedFriendAreas = SaveFriendAreas(array_ptr,8); array_ptr += 8; - playerSave->unk43C = sub_8097D60(array_ptr,0x100); + playerSave->unk43C = SaveAdventureData(array_ptr, 0x100); array_ptr += 0x100; playerSave->unk440 = sub_8095624(array_ptr,0x594); array_ptr += 0x594; playerSave->savedMailInfo = SaveMailInfo(array_ptr,0x221); - saveStatus1 = WriteSaveSector(param_1,(u8 *)playerSave,sizeof(struct UnkStruct_sub_8011DAC)); - saveStatus2 = WriteSaveSector(param_1,(u8 *)playerSave,sizeof(struct UnkStruct_sub_8011DAC)); + saveStatus1 = WriteSaveSector(param_1, (u8 *)playerSave, sizeof(struct UnkStruct_sub_8011DAC)); + saveStatus2 = WriteSaveSector(param_1, (u8 *)playerSave, sizeof(struct UnkStruct_sub_8011DAC)); MemoryFree(playerSave); if (saveStatus1 != SAVE_COMPLETED) @@ -410,7 +410,7 @@ u32 sub_8012240(void) status = WriteFlashData(0x1F, (u8 *)r5, sizeof(struct unk_struct)); xxx_call_start_bg_music(); MemoryFree(r5); - if(status != 0) + if (status != 0) return SAVE_FAILED; else return SAVE_COMPLETED; @@ -423,12 +423,14 @@ void sub_8012284(void) InitializePlayerData(); } +// Is this the new game func? void sub_8012298(void) { - sub_80976A8(); + ResetAdventureInfo(); sub_80122A8(); } +// Init new game? void sub_80122A8(void) { sub_80122D0(); diff --git a/src/trap_1.c b/src/trap_1.c index 4f0357931..42e8a4692 100644 --- a/src/trap_1.c +++ b/src/trap_1.c @@ -14,88 +14,88 @@ extern u8 gMisakiSan[]; extern u8 gYayoiSan[]; -extern void sub_8082FA8(unkStruct_8094924 *, void *, s32); +extern void WriteBytes(DataSerializer *, void *, s32); -void SaveTile(unkStruct_8094924 *r0, Tile *tile); +static void WriteDungeonTile(DataSerializer *r0, Tile *tile); void sub_80830F8(void * , u32*); -void sub_808312C(void *, u32 *); -void SaveDungeonWeather(unkStruct_8094924 *r0, Weather *weather); -void sub_8083078(void *, u32); -void sub_80830B4(void *, u8); -void sub_8083030(void *, u16); -void SaveEntity(unkStruct_8094924 *param_1, Entity *); -void sub_808300C(unkStruct_8094924 *param_1, u8 *); -void sub_8081788(unkStruct_8094924 *param_1, Item *param_2); -void sub_8080B90(unkStruct_8094924 *param_1); -void SaveItemData(unkStruct_8094924 *param_1); -void sub_8081454(unkStruct_8094924 *param_1); -void sub_808165C(unkStruct_8094924 *param_1); -void SaveDungeonMusic(unkStruct_8094924 *param_1); -void SaveTrapData(unkStruct_8094924 *param_1); -void sub_8080CF0(unkStruct_8094924 *param_1); -void nullsub_98(unkStruct_8094924 *param_1); -void sub_8082F9C(unkStruct_8094924 *param_1, u32, u32); +void sub_808312C(void *, u16 *); +static void WriteDungeonWeather(DataSerializer *r0, Weather *weather); +void WriteU32(void *, u32); +void WriteBool8(void *, u8); +void WriteU16(void *, u16); +void SaveEntity(DataSerializer *param_1, Entity *); +void Write8Bytes(DataSerializer *param_1, u8 *); +void WriteDungeonItem(DataSerializer *param_1, Item *param_2); +void sub_8080B90(DataSerializer *param_1); +void WriteDungeonItems(DataSerializer *param_1); +void sub_8081454(DataSerializer *param_1); +void sub_808165C(DataSerializer *param_1); +void SaveDungeonMusic(DataSerializer *param_1); +void SaveTrapData(DataSerializer *param_1); +void sub_8080CF0(DataSerializer *param_1); +void nullsub_98(DataSerializer *param_1); +void InitByteWriter(DataSerializer *param_1, u8*, u32); void sub_8049ED4(void); -void sub_8083060(unkStruct_8094924 *param_1, u32); -void sub_80817F4(unkStruct_8094924 *param_1, u32 param_2); -void sub_80830A0(unkStruct_8094924 *param_1, u32); -void sub_808180C(unkStruct_8094924 *param_1, u32 param_2); -void sub_8083048(unkStruct_8094924 *param_1, u32); -void sub_80818C8(unkStruct_8094924 *param_1, JoinedAt *param_2); -void SaveActionContainer(unkStruct_8094924 *param_1, ActionContainer *param_2); -void sub_8081B34(unkStruct_8094924 *r0, s16 *r1); -void SaveEntityMoves(unkStruct_8094924 *r0, Moves *move); -void sub_8081824(unkStruct_8094924 *param_1, u32 param_2); -void sub_80817B0(unkStruct_8094924 *param_1, u32 param_2); -void SavePosition(void*, Position *); -void SaveAITargetStatus(unkStruct_8094924 *param_1, AITarget* param_2); -void SaveIQFlags(unkStruct_8094924 *r0, u8 *r1); -void SaveSpeedStage(unkStruct_8094924 *param_1, s32 param_2); -void sub_8081854(unkStruct_8094924 *param_1, s32 param_2); -void sub_808183C(unkStruct_8094924 *param_1, s32 param_2); -void SaveMuzzledStatus(unkStruct_8094924 *param_1, Muzzled *param_2); -void SaveEyesightStatus(unkStruct_8094924 *param_1, EyesightStatus *param_2); -void SaveTransformStatus(unkStruct_8094924 *param_1, TransformStatus *param_2); -void SaveItemStatus(unkStruct_8094924 *param_1, ItemStatus *param_2); -void SaveMoveStatus(unkStruct_8094924 *param_1, MoveStatus* param_2); -void SaveLinkedStatus(unkStruct_8094924 *param_1, Linked *param_2); -void SaveVolatileStatus(unkStruct_8094924 *param_1, Volatile *param_2); -void SaveImmobilizeStatus(unkStruct_8094924 *param_1, Immobilize *param_2); -void SaveNonVolatileStatus(unkStruct_8094924 *param_1, NonVolatile *param_2); -void SaveEntitySleep(unkStruct_8094924 *param_1, Sleep* param_2); -void SaveTactic(unkStruct_8094924 *param_1, u8 param_2); -void SaveDungeonHiddenPower(unkStruct_8094924 *param_1, HiddenPower *param_2); -void SaveChargingStatus(unkStruct_8094924 *param_1, Charging *param_2); -void SaveProtectionStatus(unkStruct_8094924 *param_1, Protection *param_2); -void SaveWaitingStatus(unkStruct_8094924 *param_1, Waiting *param_2); -void SaveSpeedCounters(unkStruct_8094924 *param_1, u8 *speedCounters, u32 numCounters); -void SaveClientType(unkStruct_8094924 *param_1, u8 param_2); +void WriteU8(DataSerializer *param_1, u32); +void sub_80817F4(DataSerializer *param_1, u32 param_2); +void WriteS32(DataSerializer *param_1, u32); +void sub_808180C(DataSerializer *param_1, u32 param_2); +void WriteS16(DataSerializer *param_1, u32); +static void WriteJoinedAt(DataSerializer *param_1, JoinedAt *param_2); +void SaveActionContainer(DataSerializer *param_1, ActionContainer *param_2); +void sub_8081B34(DataSerializer *r0, s16 *r1); +void SaveEntityMoves(DataSerializer *r0, Moves *move); +void sub_8081824(DataSerializer *param_1, u32 param_2); +void sub_80817B0(DataSerializer *param_1, u32 param_2); +void WritePosition8(void*, Position *); +void SaveAITargetStatus(DataSerializer *param_1, AITarget* param_2); +void SaveIQFlags(DataSerializer *r0, u8 *r1); +void SaveSpeedStage(DataSerializer *param_1, s32 param_2); +void sub_8081854(DataSerializer *param_1, s32 param_2); +void sub_808183C(DataSerializer *param_1, s32 param_2); +void SaveMuzzledStatus(DataSerializer *param_1, Muzzled *param_2); +void SaveEyesightStatus(DataSerializer *param_1, EyesightStatus *param_2); +void SaveTransformStatus(DataSerializer *param_1, TransformStatus *param_2); +void SaveItemStatus(DataSerializer *param_1, ItemStatus *param_2); +void SaveMoveStatus(DataSerializer *param_1, MoveStatus* param_2); +void SaveLinkedStatus(DataSerializer *param_1, Linked *param_2); +void SaveVolatileStatus(DataSerializer *param_1, Volatile *param_2); +void SaveImmobilizeStatus(DataSerializer *param_1, Immobilize *param_2); +void SaveNonVolatileStatus(DataSerializer *param_1, NonVolatile *param_2); +void SaveEntitySleep(DataSerializer *param_1, Sleep* param_2); +void SaveTactic(DataSerializer *param_1, u8 param_2); +void SaveDungeonHiddenPower(DataSerializer *param_1, HiddenPower *param_2); +void SaveChargingStatus(DataSerializer *param_1, Charging *param_2); +void SaveProtectionStatus(DataSerializer *param_1, Protection *param_2); +void SaveWaitingStatus(DataSerializer *param_1, Waiting *param_2); +void xxx_WriteBytes(DataSerializer *param_1, u8 *speedCounters, u32 numCounters); +void SaveClientType(DataSerializer *param_1, u8 param_2); void sub_80421C0(Entity *, u16); void sub_804687C(Entity *, Position *, Position *, Item *, u32); -extern void sub_8083018(unkStruct_8094924 *, u8 *); -extern void sub_8081C50(unkStruct_8094924 *); -extern void sub_8081C7C(unkStruct_8094924 *); -extern void sub_8081F2C(unkStruct_8094924 *); -extern void RestoreDungeonMusic(unkStruct_8094924 *); -extern void RestoreItemData(unkStruct_8094924 *); -extern void RestoreTrapData(unkStruct_8094924 *); -extern void sub_808217C(unkStruct_8094924 *); -extern void sub_8082FD4(unkStruct_8094924 *param_1, u8 *r1, u32 r2); -extern void sub_8082FE0(unkStruct_8094924 *, u32 *, u32); -u8 sub_80831DC(unkStruct_8094924 *r0); -u8 sub_8083188(unkStruct_8094924 *r0); -s16 sub_8083170(unkStruct_8094924 *r0); -void sub_80831F8(unkStruct_8094924 *r0, Position *); -void RestoreDungeonWeather(unkStruct_8094924 *r0, Weather *); -void sub_8083220(unkStruct_8094924 *r0, u32 *); -void sub_8083260(unkStruct_8094924 *r0, u32 *); -void RestoreTile(unkStruct_8094924 *r0, Tile *); -extern u16 sub_8083158(unkStruct_8094924 *param_1); -void sub_80820A8(unkStruct_8094924 *r0, Item *); +extern void sub_8083018(DataSerializer *, u8 *); +extern void sub_8081C50(DataSerializer *); +extern void sub_8081C7C(DataSerializer *); +extern void sub_8081F2C(DataSerializer *); +extern void RestoreDungeonMusic(DataSerializer *); +extern void RestoreItemData(DataSerializer *); +extern void RestoreTrapData(DataSerializer *); +extern void sub_808217C(DataSerializer *); +extern void InitByteReader(DataSerializer *param_1, u8 *r1, u32 r2); +extern void ReadBytes(DataSerializer *, void *, u32); +u8 ReadBool8(DataSerializer *r0); +u8 ReadU8(DataSerializer *r0); +s16 ReadS16(DataSerializer *r0); +void ReadPosition8(DataSerializer *r0, Position *); +void RestoreDungeonWeather(DataSerializer *r0, Weather *); +void sub_8083220(DataSerializer *r0, u32 *); +void sub_8083260(DataSerializer *r0, u16 *); +void RestoreTile(DataSerializer *r0, Tile *); +extern u16 ReadU16(DataSerializer *param_1); +void sub_80820A8(DataSerializer *r0, Item *); void sub_80460F8(Position *, Item *, u32); Entity *sub_8045684(u8, Position *, u8); -u32 sub_80831A0(unkStruct_8094924 *param_1); -void sub_8082280(unkStruct_8094924 *param_1,bool8 isTeamMember,s32 index); +u32 sub_80831A0(DataSerializer *param_1); +void RestoreDungeonEntity(DataSerializer *param_1,bool8 isTeamMember,s32 index); extern u8 gYayoiSan[]; @@ -139,62 +139,74 @@ void SetTrap(Tile *tile, u8 id) } } -void sub_8080B30(u32 param_1,u32 param_2) -{ - unkStruct_8094924 uStack_14; - sub_8082F9C(&uStack_14,param_1,param_2); - uStack_14.unkC = 0; - sub_8082FA8(&uStack_14,&uStack_14.unkC,4); - sub_8080B90(&uStack_14); - sub_8081454(&uStack_14); - sub_808165C(&uStack_14); - SaveDungeonMusic(&uStack_14); - SaveItemData(&uStack_14); - SaveTrapData(&uStack_14); - sub_8080CF0(&uStack_14); - sub_808300C(&uStack_14,gYayoiSan); - nullsub_98(&uStack_14); + + + +// TODO: New file here + + + + + +void WriteDungeonState(u8 *buffer, u32 bufLen) +{ + DataSerializer seri; + + InitByteWriter(&seri, buffer, bufLen); + + seri.unkC = 0; + WriteBytes(&seri, &seri.unkC, 4); + + sub_8080B90(&seri); + sub_8081454(&seri); + sub_808165C(&seri); + SaveDungeonMusic(&seri); + WriteDungeonItems(&seri); + SaveTrapData(&seri); + sub_8080CF0(&seri); + + Write8Bytes(&seri, gYayoiSan); + nullsub_98(&seri); } -void sub_8080B90(unkStruct_8094924 *param_1) +void sub_8080B90(DataSerializer *param_1) { - sub_808300C(param_1,gMisakiSan); - sub_8082FA8(param_1,&gDungeon->dungeonLocation,0x58); + Write8Bytes(param_1, gMisakiSan); + WriteBytes(param_1, &gDungeon->dungeonLocation, 0x58); } -void SaveItemData(unkStruct_8094924 *param_1) +void WriteDungeonItems(DataSerializer *param_1) { - bool8 flag; + bool8 notEmpty; Item *item; Entity *entity; int counter; - u8 local_1c [5]; + u8 emptyItem [5]; - for(counter = 0; counter < 5; counter++) - { - local_1c[counter] = 0; - } - sub_808300C(param_1,gMisakiSan); + for (counter = 0; counter < 5; counter++) + emptyItem[counter] = 0; - for(counter = 0; counter < DUNGEON_MAX_ITEMS; counter++) - { + Write8Bytes(param_1, gMisakiSan); + + for (counter = 0; counter < DUNGEON_MAX_ITEMS; counter++) { entity = gDungeon->items[counter]; - flag = FALSE; - if ((entity != NULL) && (GetEntityType(entity) == ENTITY_ITEM)) { + notEmpty = FALSE; + + if (entity != NULL && GetEntityType(entity) == ENTITY_ITEM) { item = GetItemData(entity); - sub_8081788(param_1,item); - sub_8082FA8(param_1,&entity->pos.x,1); - sub_8082FA8(param_1,&entity->pos.y,1); - flag = TRUE; - } - if (!flag) { - sub_8082FA8(param_1,local_1c,5); + WriteDungeonItem(param_1, item); // 3 bytes + WriteBytes(param_1, &entity->pos.x, 1); // 1 byte + WriteBytes(param_1, &entity->pos.y, 1); // 1 byte + notEmpty = TRUE; } + + if (!notEmpty) + WriteBytes(param_1, emptyItem, 5); } } -void SaveTrapData(unkStruct_8094924 *param_1) +void SaveTrapData(DataSerializer *param_1) { bool8 flag; Trap *trap; @@ -206,7 +218,7 @@ void SaveTrapData(unkStruct_8094924 *param_1) { local_1c[counter] = -1; } - sub_808300C(param_1,gMisakiSan); + Write8Bytes(param_1,gMisakiSan); for(counter = 0; counter < DUNGEON_MAX_TRAPS; counter++) { @@ -214,35 +226,35 @@ void SaveTrapData(unkStruct_8094924 *param_1) flag = FALSE; if ((entity != NULL) && (GetEntityType(entity) == ENTITY_TRAP)) { trap = GetTrapData(entity); - sub_8082FA8(param_1,&trap->id,1); - sub_8082FA8(param_1,&trap->unk1,1); - sub_8082FA8(param_1,&entity->isVisible,1); - sub_8082FA8(param_1,&entity->pos.x,1); - sub_8082FA8(param_1,&entity->pos.y,1); + WriteBytes(param_1,&trap->id,1); + WriteBytes(param_1,&trap->unk1,1); + WriteBytes(param_1,&entity->isVisible,1); + WriteBytes(param_1,&entity->pos.x,1); + WriteBytes(param_1,&entity->pos.y,1); flag = TRUE; } if (!flag) { - sub_8082FA8(param_1,local_1c,5); + WriteBytes(param_1,local_1c,5); } } } -void sub_8080CF0(unkStruct_8094924 *param_1) +void sub_8080CF0(DataSerializer *param_1) { s32 counter; - sub_808300C(param_1,gMisakiSan); - sub_8083078(param_1,gDungeon->unk37F0); - sub_8083078(param_1,gDungeon->unk37F4); - sub_80830B4(param_1,gDungeon->plusIsActive[0]); - sub_80830B4(param_1,gDungeon->plusIsActive[1]); - sub_80830B4(param_1,gDungeon->minusIsActive[0]); - sub_80830B4(param_1,gDungeon->minusIsActive[1]); - sub_80830B4(param_1,gDungeon->decoyActive); - sub_80830B4(param_1,gDungeon->unk37FD); - sub_80830B4(param_1,gDungeon->deoxysDefeat); - sub_80830B4(param_1,gDungeon->unk37FF); - sub_8083030(param_1,gDungeon->unk3800); + Write8Bytes(param_1,gMisakiSan); + WriteU32(param_1,gDungeon->unk37F0); + WriteU32(param_1,gDungeon->unk37F4); + WriteBool8(param_1,gDungeon->plusIsActive[0]); + WriteBool8(param_1,gDungeon->plusIsActive[1]); + WriteBool8(param_1,gDungeon->minusIsActive[0]); + WriteBool8(param_1,gDungeon->minusIsActive[1]); + WriteBool8(param_1,gDungeon->decoyActive); + WriteBool8(param_1,gDungeon->unk37FD); + WriteBool8(param_1,gDungeon->deoxysDefeat); + WriteBool8(param_1,gDungeon->unk37FF); + WriteU16(param_1,gDungeon->unk3800); for(counter = 0; counter < MAX_TEAM_MEMBERS; counter++) { SaveEntity(param_1,gDungeon->teamPokemon[counter]); @@ -253,7 +265,7 @@ void sub_8080CF0(unkStruct_8094924 *param_1) } } -void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) +void SaveEntity(DataSerializer *param_1, Entity *param_2) { Position *pos; EntityInfo *info; @@ -301,60 +313,60 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) uStack_a8 = 0; uStack_ac = 1; - sub_8083060(param_1,0xaa); - sub_8083060(param_1,0x55); + WriteU8(param_1,0xaa); + WriteU8(param_1,0x55); if (EntityExists(param_2)) { info = GetEntInfo(param_2); - sub_8082FA8(param_1,&uStack_ac,1); - sub_8082FA8(param_1,¶m_2->pos.x,1); - sub_8082FA8(param_1,¶m_2->pos.y,1); - sub_8082FA8(param_1,¶m_2->isVisible,1); - sub_8082FA8(param_1,¶m_2->spawnGenID,2); + WriteBytes(param_1,&uStack_ac,1); + WriteBytes(param_1,¶m_2->pos.x,1); + WriteBytes(param_1,¶m_2->pos.y,1); + WriteBytes(param_1,¶m_2->isVisible,1); + WriteBytes(param_1,¶m_2->spawnGenID,2); } else { memset(&info2,0,sizeof(EntityInfo)); info = &info2; - sub_8082FA8(param_1,&uStack_a8,1); - sub_8082FA8(param_1,&uStack_a8,1); - sub_8082FA8(param_1,&uStack_a8,1); - sub_8082FA8(param_1,&uStack_a8,1); - sub_8082FA8(param_1,&uStack_a8,2); + WriteBytes(param_1,&uStack_a8,1); + WriteBytes(param_1,&uStack_a8,1); + WriteBytes(param_1,&uStack_a8,1); + WriteBytes(param_1,&uStack_a8,1); + WriteBytes(param_1,&uStack_a8,2); } - sub_8083030(param_1,info->flags); + WriteU16(param_1,info->flags); sub_80817F4(param_1,info->apparentID); sub_80817F4(param_1,info->id); - sub_80830B4(param_1,info->isNotTeamMember); - sub_80830B4(param_1,info->isTeamLeader); - sub_8083060(param_1,info->shopkeeper); - sub_8083060(param_1,info->level); - sub_8083060(param_1,info->teamIndex); - sub_80818C8(param_1,&info->joinedAt); - sub_8083048(param_1,info->IQ); - sub_8083048(param_1,info->HP); - sub_8083048(param_1,info->maxHPStat); - sub_8083048(param_1,info->originalHP); - sub_8083060(param_1,info->atk[0]); - sub_8083060(param_1,info->atk[1]); - sub_8083060(param_1,info->def[0]); - sub_8083060(param_1,info->def[1]); - sub_8083078(param_1,info->exp); - sub_8083048(param_1,info->offensiveStages[0]); - sub_8083048(param_1,info->offensiveStages[1]); - sub_8083048(param_1,info->defensiveStages[0]); - sub_8083048(param_1,info->defensiveStages[1]); - sub_8083048(param_1,info->hitChanceStages[0]); - sub_8083048(param_1,info->hitChanceStages[1]); - sub_8083048(param_1,info->flashFireBoost); - sub_80830A0(param_1,info->offensiveMultipliers[0]); - sub_80830A0(param_1,info->offensiveMultipliers[1]); - sub_80830A0(param_1,info->defensiveMultipliers[0]); - sub_80830A0(param_1,info->defensiveMultipliers[1]); + WriteBool8(param_1,info->isNotTeamMember); + WriteBool8(param_1,info->isTeamLeader); + WriteU8(param_1,info->shopkeeper); + WriteU8(param_1,info->level); + WriteU8(param_1,info->teamIndex); + WriteJoinedAt(param_1,&info->joinedAt); + WriteS16(param_1,info->IQ); + WriteS16(param_1,info->HP); + WriteS16(param_1,info->maxHPStat); + WriteS16(param_1,info->originalHP); + WriteU8(param_1,info->atk[0]); + WriteU8(param_1,info->atk[1]); + WriteU8(param_1,info->def[0]); + WriteU8(param_1,info->def[1]); + WriteU32(param_1,info->exp); + WriteS16(param_1,info->offensiveStages[0]); + WriteS16(param_1,info->offensiveStages[1]); + WriteS16(param_1,info->defensiveStages[0]); + WriteS16(param_1,info->defensiveStages[1]); + WriteS16(param_1,info->hitChanceStages[0]); + WriteS16(param_1,info->hitChanceStages[1]); + WriteS16(param_1,info->flashFireBoost); + WriteS32(param_1,info->offensiveMultipliers[0]); + WriteS32(param_1,info->offensiveMultipliers[1]); + WriteS32(param_1,info->defensiveMultipliers[0]); + WriteS32(param_1,info->defensiveMultipliers[1]); SaveActionContainer(param_1,&info->action); sub_808180C(param_1,info->types[0]); sub_808180C(param_1,info->types[1]); sub_8081824(param_1,info->abilities[0]); sub_8081824(param_1,info->abilities[1]); - sub_8081788(param_1,&info->heldItem); + WriteDungeonItem(param_1,&info->heldItem); sub_80817B0(param_1,info->unk64); temp3 = &info->aiTarget; temp2 = info->IQSkillMenuFlags; @@ -396,7 +408,7 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) pos = info->prevPos; for(counter = 0; counter < NUM_PREV_POS; counter++) { - SavePosition(param_1,pos); + WritePosition8(param_1,pos); pos++; } @@ -405,9 +417,9 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) SaveIQFlags(param_1,temp1); SaveTactic(param_1,*puStack_a0); SaveDungeonHiddenPower(param_1,psStack_a4); - sub_8083078(param_1,*puStack_9c); - sub_8083078(param_1,*puStack_98); - sub_8083078(param_1,*puStack_94); + WriteU32(param_1,*puStack_9c); + WriteU32(param_1,*puStack_98); + WriteU32(param_1,*puStack_94); SaveEntitySleep(param_1,puStack_8c); SaveNonVolatileStatus(param_1,puStack_88); SaveImmobilizeStatus(param_1,puStack_84); @@ -421,416 +433,420 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) SaveTransformStatus(param_1,puStack_64); SaveEyesightStatus(param_1,puStack_60); SaveMuzzledStatus(param_1,pbStack_5c); - sub_80830B4(param_1,*pbStack_58); - sub_80830B4(param_1,*pbStack_54); - sub_80830B4(param_1,*pbStack_50); - sub_80830B4(param_1,*puStack_4c); - sub_80830B4(param_1,*pbStack_48); - sub_8083060(param_1,*puStack_34); - sub_80830B4(param_1,*pbStack_44); - sub_80830B4(param_1,*pbStack_40); - sub_80830B4(param_1,*pbStack_3c); - sub_8083060(param_1,*puStack_38); - sub_80830B4(param_1,*pbStack_30); - sub_8083060(param_1,*puStack_2c); - sub_8083060(param_1,*puStack_28); + WriteBool8(param_1,*pbStack_58); + WriteBool8(param_1,*pbStack_54); + WriteBool8(param_1,*pbStack_50); + WriteBool8(param_1,*puStack_4c); + WriteBool8(param_1,*pbStack_48); + WriteU8(param_1,*puStack_34); + WriteBool8(param_1,*pbStack_44); + WriteBool8(param_1,*pbStack_40); + WriteBool8(param_1,*pbStack_3c); + WriteU8(param_1,*puStack_38); + WriteBool8(param_1,*pbStack_30); + WriteU8(param_1,*puStack_2c); + WriteU8(param_1,*puStack_28); sub_808183C(param_1,*puStack_24); sub_8081854(param_1,info->targetingDecoy); SaveSpeedStage(param_1,info->speedStage); - SaveSpeedCounters(param_1,info->speedUpCounters,NUM_SPEED_COUNTERS); - SaveSpeedCounters(param_1,info->speedDownCounters,NUM_SPEED_COUNTERS); - sub_8083060(param_1,info->stockpileStage); - sub_8083060(param_1,info->unk113); - sub_8083060(param_1,(u8)info->moveRandomly); + xxx_WriteBytes(param_1,info->speedUpCounters,NUM_SPEED_COUNTERS); + xxx_WriteBytes(param_1,info->speedDownCounters,NUM_SPEED_COUNTERS); + WriteU8(param_1,info->stockpileStage); + WriteU8(param_1,info->unk113); + WriteU8(param_1,(u8)info->moveRandomly); SaveEntityMoves(param_1,&info->moves); sub_8081B34(param_1,(s16 *)&info->belly); sub_8081B34(param_1,(s16 *)&info->maxBelly); - sub_80830B4(param_1,info->aiNextToTarget); - sub_80830B4(param_1,info->recalculateFollow); - sub_80830B4(param_1,info->waiting); - sub_80830B4(param_1,info->unk146); - sub_80830B4(param_1,info->attacking); - sub_80830B4(param_1,info->unk149); - sub_80830B4(param_1,info->unk14A); - sub_80830B4(param_1,info->unk14B); - sub_80830B4(param_1,info->unk14C); - sub_8083030(param_1,info->visualFlags); - sub_8083030(param_1,info->previousVisualFlags); - sub_80830B4(param_1,info->unk152); - sub_8083060(param_1,info->unk153); - sub_80830B4(param_1,info->unk154); - sub_80830B4(param_1,info->unk155); - sub_80830B4(param_1,info->unk156); - sub_8083060(param_1,info->unk164); - sub_8083060(param_1,info->unk165); - sub_8083060(param_1,info->unk166); - sub_8083060(param_1,info->unk167); - sub_8083060(param_1,info->unk168); - sub_8083060(param_1,info->turnsSinceWarpScarfActivation); - SavePosition(param_1,&(info->targetPos)); - sub_80830A0(param_1,info->unk174); - sub_8083030(param_1,info->abilityEffectFlags); - sub_8083048(param_1,info->unk1F8); - sub_8083048(param_1,info->mobileTurnTimer); - sub_8083078(param_1,info->expGainedInTurn); + WriteBool8(param_1,info->aiNextToTarget); + WriteBool8(param_1,info->recalculateFollow); + WriteBool8(param_1,info->waiting); + WriteBool8(param_1,info->unk146); + WriteBool8(param_1,info->attacking); + WriteBool8(param_1,info->unk149); + WriteBool8(param_1,info->unk14A); + WriteBool8(param_1,info->unk14B); + WriteBool8(param_1,info->unk14C); + WriteU16(param_1,info->visualFlags); + WriteU16(param_1,info->previousVisualFlags); + WriteBool8(param_1,info->unk152); + WriteU8(param_1,info->unk153); + WriteBool8(param_1,info->unk154); + WriteBool8(param_1,info->unk155); + WriteBool8(param_1,info->unk156); + WriteU8(param_1,info->unk164); + WriteU8(param_1,info->unk165); + WriteU8(param_1,info->unk166); + WriteU8(param_1,info->unk167); + WriteU8(param_1,info->unk168); + WriteU8(param_1,info->turnsSinceWarpScarfActivation); + WritePosition8(param_1,&(info->targetPos)); + WriteS32(param_1,info->unk174); + WriteU16(param_1,info->abilityEffectFlags); + WriteS16(param_1,info->unk1F8); + WriteS16(param_1,info->mobileTurnTimer); + WriteU32(param_1,info->expGainedInTurn); SaveClientType(param_1,*puStack_90); } -void sub_8081454(unkStruct_8094924 *param_1) +void sub_8081454(DataSerializer *param_1) { int iVar1; int iVar2; int iVar4; - sub_808300C(param_1,gMisakiSan); - sub_80830B4(param_1, gDungeon->unk3A08); - sub_80830B4(param_1, gDungeon->unk3A09); - sub_80830B4(param_1, gDungeon->unk3A0A); - sub_80830B4(param_1, gDungeon->unk3A0B); - sub_8083060(param_1, gDungeon->unk3A0C); - sub_8083060(param_1, gDungeon->unk3A0D); - sub_8083048(param_1, gDungeon->tileset); - sub_8083048(param_1,gDungeon->unk3A10); - sub_8083048(param_1, gDungeon->unk3A12); - sub_8083048(param_1, gDungeon->bossBattleIndex); - sub_8083048(param_1, gDungeon->unk3A16); + Write8Bytes(param_1,gMisakiSan); + WriteBool8(param_1, gDungeon->unk3A08); + WriteBool8(param_1, gDungeon->unk3A09); + WriteBool8(param_1, gDungeon->unk3A0A); + WriteBool8(param_1, gDungeon->unk3A0B); + WriteU8(param_1, gDungeon->unk3A0C); + WriteU8(param_1, gDungeon->unk3A0D); + WriteS16(param_1, gDungeon->tileset); + WriteS16(param_1,gDungeon->unk3A10); + WriteS16(param_1, gDungeon->unk3A12); + WriteS16(param_1, gDungeon->bossBattleIndex); + WriteS16(param_1, gDungeon->unk3A16); for(iVar1 = 0; iVar1 < DUNGEON_MAX_SIZE_Y; iVar1++) { for(iVar2 = 0; iVar2 < DUNGEON_MAX_SIZE_X; iVar2++) { - SaveTile(param_1,&gDungeon->tiles[iVar1][iVar2]); + WriteDungeonTile(param_1,&gDungeon->tiles[iVar1][iVar2]); } } - SavePosition(param_1,&gDungeon->unkE218); - SavePosition(param_1,&gDungeon->unkE21C); + WritePosition8(param_1,&gDungeon->unkE218); + WritePosition8(param_1,&gDungeon->unkE21C); for(iVar4 = 0; iVar4 < 8; iVar4++) { - SavePosition(param_1,&gDungeon->unkE220[iVar4]); + WritePosition8(param_1,&gDungeon->unkE220[iVar4]); } - sub_80830F8(param_1,&gDungeon->unkE240); - sub_80830F8(param_1,&gDungeon->unkE250); - sub_808312C(param_1,&gDungeon->unkE260); + sub_80830F8(param_1, gDungeon->unkE240); + sub_80830F8(param_1, gDungeon->unkE250); + sub_808312C(param_1, gDungeon->unkE260); for(iVar1 = 0; iVar1 < 8; iVar1++) { for(iVar2 = 0; iVar2 < 8; iVar2++) { - SaveTile(param_1, &gDungeon->unkE27C[iVar1][iVar2]); - sub_8083060(param_1, gDungeon->unkE87C[iVar1][iVar2]); + WriteDungeonTile(param_1, &gDungeon->unkE27C[iVar1][iVar2]); + WriteU8(param_1, gDungeon->unkE87C[iVar1][iVar2]); } } - SaveDungeonWeather(param_1,&gDungeon->weather); + WriteDungeonWeather(param_1,&gDungeon->weather); } -void sub_808165C(unkStruct_8094924 *param_1) +void sub_808165C(DataSerializer *param_1) { - sub_808300C(param_1,gMisakiSan); - sub_8083060(param_1, gDungeon->unk181e8.unk18208); - sub_8083060(param_1, gDungeon->unk181e8.visibilityRange); - sub_80830B4(param_1, gDungeon->unk181e8.blinded); - sub_80830B4(param_1, gDungeon->unk181e8.unk1820B); - sub_80830B4(param_1, gDungeon->unk181e8.unk1820C); - sub_80830B4(param_1, gDungeon->unk181e8.unk1820D); - sub_80830B4(param_1, gDungeon->unk181e8.unk1820E); - sub_80830B4(param_1, gDungeon->unk181e8.unk1820F); - sub_80830B4(param_1, gDungeon->unk181e8.hallucinating); - sub_80830B4(param_1, gDungeon->unk181e8.unk18211); - sub_80830B4(param_1, gDungeon->unk181e8.unk18213); + Write8Bytes(param_1,gMisakiSan); + WriteU8(param_1, gDungeon->unk181e8.unk18208); + WriteU8(param_1, gDungeon->unk181e8.visibilityRange); + WriteBool8(param_1, gDungeon->unk181e8.blinded); + WriteBool8(param_1, gDungeon->unk181e8.unk1820B); + WriteBool8(param_1, gDungeon->unk181e8.unk1820C); + WriteBool8(param_1, gDungeon->unk181e8.unk1820D); + WriteBool8(param_1, gDungeon->unk181e8.unk1820E); + WriteBool8(param_1, gDungeon->unk181e8.unk1820F); + WriteBool8(param_1, gDungeon->unk181e8.hallucinating); + WriteBool8(param_1, gDungeon->unk181e8.unk18211); + WriteBool8(param_1, gDungeon->unk181e8.unk18213); } // NOTE: forcing this s16 for now - Seth -void SaveDungeonMusic(unkStruct_8094924 *param_1) +void SaveDungeonMusic(DataSerializer *param_1) { - sub_8083048(param_1, (s16)gDungeon->musPlayer.songIndex); - sub_8083048(param_1, (s16)gDungeon->musPlayer.pastSongIndex); - sub_8083048(param_1, (s16)gDungeon->musPlayer.queuedSongIndex); + WriteS16(param_1, (s16)gDungeon->musPlayer.songIndex); + WriteS16(param_1, (s16)gDungeon->musPlayer.pastSongIndex); + WriteS16(param_1, (s16)gDungeon->musPlayer.queuedSongIndex); } -void sub_8081788(unkStruct_8094924 *param_1, Item *param_2) +void WriteDungeonItem(DataSerializer *param_1, Item *param_2) { - sub_8082FA8(param_1, ¶m_2->flags, 1); - sub_8082FA8(param_1, ¶m_2->quantity, 1); - sub_8082FA8(param_1, ¶m_2->id, 1); + WriteBytes(param_1, ¶m_2->flags, 1); + WriteBytes(param_1, ¶m_2->quantity, 1); + WriteBytes(param_1, ¶m_2->id, 1); } -void sub_80817B0(unkStruct_8094924 *param_1, u32 param_2) +void sub_80817B0(DataSerializer *param_1, u32 param_2) { u8 stack; stack = param_2; - sub_8082FA8(param_1, &stack, 1); + WriteBytes(param_1, &stack, 1); } -void SaveActionContainer(unkStruct_8094924 *param_1, ActionContainer *param_2) +void SaveActionContainer(DataSerializer *param_1, ActionContainer *param_2) { - sub_8082FA8(param_1, ¶m_2->direction, 1); - sub_8082FA8(param_1, ¶m_2->itemTargetPosition.x, 1); - sub_8082FA8(param_1, ¶m_2->itemTargetPosition.y, 1); + WriteBytes(param_1, ¶m_2->direction, 1); + WriteBytes(param_1, ¶m_2->itemTargetPosition.x, 1); + WriteBytes(param_1, ¶m_2->itemTargetPosition.y, 1); } -void sub_80817F4(unkStruct_8094924 *param_1, u32 param_2) +void sub_80817F4(DataSerializer *param_1, u32 param_2) { u16 stack; stack = param_2; - sub_8082FA8(param_1, &stack, 2); + WriteBytes(param_1, &stack, 2); } -void sub_808180C(unkStruct_8094924 *param_1, u32 param_2) +void sub_808180C(DataSerializer *param_1, u32 param_2) { u8 stack; stack = param_2; - sub_8082FA8(param_1, &stack, 1); + WriteBytes(param_1, &stack, 1); } -void sub_8081824(unkStruct_8094924 *param_1, u32 param_2) +void sub_8081824(DataSerializer *param_1, u32 param_2) { u8 stack; stack = param_2; - sub_8082FA8(param_1, &stack, 1); + WriteBytes(param_1, &stack, 1); } -void sub_808183C(unkStruct_8094924 *param_1, s32 param_2) +void sub_808183C(DataSerializer *param_1, s32 param_2) { u8 stack; stack = param_2; - sub_8082FA8(param_1, &stack, 1); + WriteBytes(param_1, &stack, 1); } -void sub_8081854(unkStruct_8094924 *param_1, s32 param_2) +void sub_8081854(DataSerializer *param_1, s32 param_2) { u8 stack; stack = param_2; - sub_8082FA8(param_1, &stack, 1); + WriteBytes(param_1, &stack, 1); } -void SaveSpeedStage(unkStruct_8094924 *param_1, s32 param_2) +void SaveSpeedStage(DataSerializer *param_1, s32 param_2) { - sub_8082FA8(param_1, ¶m_2, 4); + WriteBytes(param_1, ¶m_2, 4); } -void SaveTactic(unkStruct_8094924 *param_1, u8 param_2) +void SaveTactic(DataSerializer *param_1, u8 param_2) { - sub_8082FA8(param_1, ¶m_2, 1); + WriteBytes(param_1, ¶m_2, 1); } -void SaveDungeonHiddenPower(unkStruct_8094924 *param_1, HiddenPower *param_2) +void SaveDungeonHiddenPower(DataSerializer *param_1, HiddenPower *param_2) { - sub_8083048(param_1, param_2->hiddenPowerBasePower); + WriteS16(param_1, param_2->hiddenPowerBasePower); sub_808180C(param_1, param_2->hiddenPowerType); } -void SaveClientType(unkStruct_8094924 *param_1, u8 param_2) +void SaveClientType(DataSerializer *param_1, u8 param_2) { - sub_8083060(param_1, param_2); + WriteU8(param_1, param_2); } -void sub_80818C8(unkStruct_8094924 *param_1, JoinedAt *param_2) +static void WriteJoinedAt(DataSerializer *param_1, JoinedAt *param_2) { - sub_8083060(param_1, param_2->joinedAt); - sub_8083060(param_1, param_2->unk1); + WriteU8(param_1, param_2->joinedAt); + WriteU8(param_1, param_2->unk1); } -void SaveAITargetStatus(unkStruct_8094924 *param_1, AITarget* param_2) +void SaveAITargetStatus(DataSerializer *param_1, AITarget* param_2) { - sub_8082FA8(param_1, ¶m_2->aiObjective, 1); - sub_80830B4(param_1, param_2->aiNotNextToTarget); - sub_80830B4(param_1, param_2->aiTargetingEnemy); - sub_80830B4(param_1, param_2->aiTurningAround); - sub_8083030(param_1, param_2->aiTargetSpawnGenID); - SavePosition(param_1, ¶m_2->aiTargetPos); + WriteBytes(param_1, ¶m_2->aiObjective, 1); + WriteBool8(param_1, param_2->aiNotNextToTarget); + WriteBool8(param_1, param_2->aiTargetingEnemy); + WriteBool8(param_1, param_2->aiTurningAround); + WriteU16(param_1, param_2->aiTargetSpawnGenID); + WritePosition8(param_1, ¶m_2->aiTargetPos); } -void SaveEntitySleep(unkStruct_8094924 *param_1, Sleep* param_2) +void SaveEntitySleep(DataSerializer *param_1, Sleep* param_2) { - sub_8082FA8(param_1, ¶m_2->sleep, 1); - sub_8083060(param_1, param_2->sleepTurns); + WriteBytes(param_1, ¶m_2->sleep, 1); + WriteU8(param_1, param_2->sleepTurns); } -void SaveNonVolatileStatus(unkStruct_8094924 *param_1, NonVolatile *param_2) +void SaveNonVolatileStatus(DataSerializer *param_1, NonVolatile *param_2) { - sub_8082FA8(param_1, ¶m_2->nonVolatileStatus, 1); - sub_8083060(param_1, param_2->nonVolatileStatusTurns); - sub_8083060(param_1, param_2->nonVolatileStatusDamageCountdown); - sub_8083060(param_1, param_2->unk4); + WriteBytes(param_1, ¶m_2->nonVolatileStatus, 1); + WriteU8(param_1, param_2->nonVolatileStatusTurns); + WriteU8(param_1, param_2->nonVolatileStatusDamageCountdown); + WriteU8(param_1, param_2->unk4); } -void SaveImmobilizeStatus(unkStruct_8094924 *param_1, Immobilize *param_2) +void SaveImmobilizeStatus(DataSerializer *param_1, Immobilize *param_2) { - sub_8082FA8(param_1, ¶m_2->immobilizeStatus, 1); - sub_8083060(param_1, param_2->immobilizeStatusTurns); - sub_8083060(param_1, param_2->immobilizeStatusDamageCountdown); - sub_8083078(param_1, param_2->unk4); + WriteBytes(param_1, ¶m_2->immobilizeStatus, 1); + WriteU8(param_1, param_2->immobilizeStatusTurns); + WriteU8(param_1, param_2->immobilizeStatusDamageCountdown); + WriteU32(param_1, param_2->unk4); } -void SaveVolatileStatus(unkStruct_8094924 *param_1, Volatile *param_2) +void SaveVolatileStatus(DataSerializer *param_1, Volatile *param_2) { - sub_8082FA8(param_1, ¶m_2->volatileStatus, 1); - sub_8083060(param_1, param_2->volatileStatusTurns); + WriteBytes(param_1, ¶m_2->volatileStatus, 1); + WriteU8(param_1, param_2->volatileStatusTurns); } -void SaveChargingStatus(unkStruct_8094924 *param_1, Charging *param_2) +void SaveChargingStatus(DataSerializer *param_1, Charging *param_2) { - sub_8082FA8(param_1, ¶m_2->chargingStatus, 1); - sub_8083060(param_1, param_2->chargingStatusTurns); - sub_8083060(param_1, param_2->chargingStatusMoveIndex); + WriteBytes(param_1, ¶m_2->chargingStatus, 1); + WriteU8(param_1, param_2->chargingStatusTurns); + WriteU8(param_1, param_2->chargingStatusMoveIndex); } -void SaveProtectionStatus(unkStruct_8094924 *param_1, Protection *param_2) +void SaveProtectionStatus(DataSerializer *param_1, Protection *param_2) { - sub_8082FA8(param_1, ¶m_2->protectionStatus, 1); - sub_8083060(param_1, param_2->protectionStatusTurns); + WriteBytes(param_1, ¶m_2->protectionStatus, 1); + WriteU8(param_1, param_2->protectionStatusTurns); } -void SaveWaitingStatus(unkStruct_8094924 *param_1, Waiting *param_2) +void SaveWaitingStatus(DataSerializer *param_1, Waiting *param_2) { - sub_8082FA8(param_1, ¶m_2->waitingStatus, 1); - sub_80830B4(param_1, param_2->enemyDecoy); - sub_80830B4(param_1, param_2->unkCA); - sub_8083060(param_1, param_2->waitingStatusTurns); - sub_8083060(param_1, param_2->curseDamageCountdown); + WriteBytes(param_1, ¶m_2->waitingStatus, 1); + WriteBool8(param_1, param_2->enemyDecoy); + WriteBool8(param_1, param_2->unkCA); + WriteU8(param_1, param_2->waitingStatusTurns); + WriteU8(param_1, param_2->curseDamageCountdown); } -void SaveLinkedStatus(unkStruct_8094924 *param_1, Linked *param_2) +void SaveLinkedStatus(DataSerializer *param_1, Linked *param_2) { - sub_8082FA8(param_1, ¶m_2->linkedStatus, 1); - sub_8083078(param_1, param_2->unkD4); - sub_8083060(param_1, param_2->unkD8); - sub_8083060(param_1, param_2->linkedStatusTurns); - sub_8083060(param_1, param_2->linkedStatusDamageCountdown); + WriteBytes(param_1, ¶m_2->linkedStatus, 1); + WriteU32(param_1, param_2->unkD4); + WriteU8(param_1, param_2->unkD8); + WriteU8(param_1, param_2->linkedStatusTurns); + WriteU8(param_1, param_2->linkedStatusDamageCountdown); } -void SaveMoveStatus(unkStruct_8094924 *param_1, MoveStatus* param_2) +void SaveMoveStatus(DataSerializer *param_1, MoveStatus* param_2) { - sub_8082FA8(param_1, ¶m_2->moveStatus, 1); - sub_8083060(param_1, param_2->moveStatusTurns); + WriteBytes(param_1, ¶m_2->moveStatus, 1); + WriteU8(param_1, param_2->moveStatusTurns); } -void SaveItemStatus(unkStruct_8094924 *param_1, ItemStatus *param_2) +void SaveItemStatus(DataSerializer *param_1, ItemStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->itemStatus, 1); + WriteBytes(param_1, ¶m_2->itemStatus, 1); } -void SaveTransformStatus(unkStruct_8094924 *param_1, TransformStatus *param_2) +void SaveTransformStatus(DataSerializer *param_1, TransformStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->transformStatus, 1); - sub_8083060(param_1, param_2->transformStatusTurns); + WriteBytes(param_1, ¶m_2->transformStatus, 1); + WriteU8(param_1, param_2->transformStatusTurns); } -void SaveEyesightStatus(unkStruct_8094924 *param_1, EyesightStatus *param_2) +void SaveEyesightStatus(DataSerializer *param_1, EyesightStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->eyesightStatus, 1); - sub_8083060(param_1, param_2->eyesightStatusTurns); + WriteBytes(param_1, ¶m_2->eyesightStatus, 1); + WriteU8(param_1, param_2->eyesightStatusTurns); } -void SaveMuzzledStatus(unkStruct_8094924 *param_1, Muzzled *param_2) +void SaveMuzzledStatus(DataSerializer *param_1, Muzzled *param_2) { - sub_8082FA8(param_1, ¶m_2->muzzled, 1); - sub_8083060(param_1, param_2->muzzledTurns); + WriteBytes(param_1, ¶m_2->muzzled, 1); + WriteU8(param_1, param_2->muzzledTurns); } -void SaveEntityMove(unkStruct_8094924 *r0, Move *r1) +void SaveEntityMove(DataSerializer *r0, Move *r1) { - sub_8083060(r0, r1->moveFlags); - sub_8083060(r0, r1->moveFlags2); - sub_8082FA8(r0, &r1->id, 2); - sub_8083060(r0, r1->PP); - sub_8083060(r0, r1->ginseng); + WriteU8(r0, r1->moveFlags); + WriteU8(r0, r1->moveFlags2); + WriteBytes(r0, &r1->id, 2); + WriteU8(r0, r1->PP); + WriteU8(r0, r1->ginseng); } -void SaveEntityMoves(unkStruct_8094924 *r0, Moves *move) +void SaveEntityMoves(DataSerializer *r0, Moves *move) { - s32 index; - for(index = 0; index < MAX_MON_MOVES; index++) - { - SaveEntityMove(r0, &move->moves[index]); + s32 i; + + for (i = 0; i < MAX_MON_MOVES; i++) + SaveEntityMove(r0, &move->moves[i]); + + WriteU8(r0, move->struggleMoveFlags); +} + +void sub_8081B34(DataSerializer *r0, s16 *r1) +{ + WriteS16(r0, r1[0]); + WriteS16(r0, r1[1]); +} + +void SaveIQFlags(DataSerializer *r0, u8 *r1) +{ + WriteBytes(r0, r1, NUM_PICKED_IQ_SKILLS); +} + +static void WriteDungeonTile(DataSerializer *r0, Tile *tile) +{ + WriteU16(r0, tile->terrainType); + WriteU16(r0, tile->unk4); + WriteBytes(r0, &tile->room, 1); + WriteBytes(r0, &tile->unkE, 1); +} + +static void WriteDungeonWeather(DataSerializer *r0, Weather *weather) +{ + s32 i; + + WriteBytes(r0, &weather->weather, 1); + WriteBytes(r0, &weather->unkE265, 1); + + for (i = 0; i < 8; i++) { + WriteU8(r0, weather->unkE267[i]); + WriteU8(r0, weather->naturalWeather[i]); } - sub_8083060(r0, move->struggleMoveFlags); // Struggle Move flags? + + WriteU8(r0, weather->weatherDamageCounter); + WriteU8(r0, weather->mudSportTurns); + WriteU8(r0, weather->waterSportTurns); + WriteBool8(r0, weather->nullifyWeather); } -void sub_8081B34(unkStruct_8094924 *r0, s16 *r1) +// Read func + +void ReadDungeonState(u8 *buffer, u32 bufLen) { - sub_8083048(r0, r1[0]); - sub_8083048(r0, r1[1]); + DataSerializer seri; + + InitByteReader(&seri, buffer, bufLen); + + ReadBytes(&seri, &seri.unkC, 4); + sub_8081C50(&seri); + sub_8081C7C(&seri); + sub_8081F2C(&seri); + RestoreDungeonMusic(&seri); + RestoreItemData(&seri); + RestoreTrapData(&seri); + sub_808217C(&seri); + + sub_8083018(&seri, gYayoiSan); + nullsub_98(&seri); } -void SaveIQFlags(unkStruct_8094924 *r0, u8 *r1) -{ - sub_8082FA8(r0, r1, 3); -} - -void SaveTile(unkStruct_8094924 *r0, Tile *tile) -{ - sub_8083030(r0, tile->terrainType); - sub_8083030(r0, tile->unk4); - sub_8082FA8(r0, &tile->room, 1); - sub_8082FA8(r0, &tile->unkE, 1); -} - -void SaveDungeonWeather(unkStruct_8094924 *r0, Weather *weather) -{ - s32 index; - sub_8082FA8(r0, &weather->weather, 1); - sub_8082FA8(r0, &weather->unkE265, 1); - for(index = 0; index < 8; index++) - { - sub_8083060(r0, weather->unkE267[index]); - sub_8083060(r0, weather->naturalWeather[index]); - } - sub_8083060(r0, weather->weatherDamageCounter); - sub_8083060(r0, weather->mudSportTurns); - sub_8083060(r0, weather->waterSportTurns); - sub_80830B4(r0, weather->nullifyWeather); -} - -void sub_8081BF4(u8 *r0, u32 r1) -{ - unkStruct_8094924 uStack_14; - - sub_8082FD4(&uStack_14, r0, r1); - - sub_8082FE0(&uStack_14, &uStack_14.unkC, 4); - sub_8081C50(&uStack_14); - sub_8081C7C(&uStack_14); - sub_8081F2C(&uStack_14); - RestoreDungeonMusic(&uStack_14); - RestoreItemData(&uStack_14); - RestoreTrapData(&uStack_14); - sub_808217C(&uStack_14); - - sub_8083018(&uStack_14, gYayoiSan); - nullsub_98(&uStack_14); -} - -void sub_8081C50(unkStruct_8094924 *r0) +void sub_8081C50(DataSerializer *r0) { sub_8083018(r0, gMisakiSan); - sub_8082FE0(r0, (u32 *)&gDungeon->dungeonLocation, 0x58); + ReadBytes(r0, &gDungeon->dungeonLocation, 0x58); } -void sub_8081C7C(unkStruct_8094924 *r0) +void sub_8081C7C(DataSerializer *r0) { int x; int y; s32 iVar7; sub_8083018(r0,gMisakiSan); - gDungeon->unk3A08 = sub_80831DC(r0); - gDungeon->unk3A09 = sub_80831DC(r0); - gDungeon->unk3A0A = sub_80831DC(r0); - gDungeon->unk3A0B = sub_80831DC(r0); - gDungeon->unk3A0C = sub_8083188(r0); - gDungeon->unk3A0D = sub_8083188(r0); - gDungeon->tileset = sub_8083170(r0); - gDungeon->unk3A10 = sub_8083170(r0); - gDungeon->unk3A12 = sub_8083170(r0); - gDungeon->bossBattleIndex = sub_8083170(r0); - gDungeon->unk3A16 = sub_8083170(r0); + gDungeon->unk3A08 = ReadBool8(r0); + gDungeon->unk3A09 = ReadBool8(r0); + gDungeon->unk3A0A = ReadBool8(r0); + gDungeon->unk3A0B = ReadBool8(r0); + gDungeon->unk3A0C = ReadU8(r0); + gDungeon->unk3A0D = ReadU8(r0); + gDungeon->tileset = ReadS16(r0); + gDungeon->unk3A10 = ReadS16(r0); + gDungeon->unk3A12 = ReadS16(r0); + gDungeon->bossBattleIndex = ReadS16(r0); + gDungeon->unk3A16 = ReadS16(r0); for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { @@ -839,16 +855,16 @@ void sub_8081C7C(unkStruct_8094924 *r0) RestoreTile(r0,&gDungeon->tiles[y][x]); } } - sub_80831F8(r0,&gDungeon->unkE218); - sub_80831F8(r0,&gDungeon->unkE21C); + ReadPosition8(r0,&gDungeon->unkE218); + ReadPosition8(r0,&gDungeon->unkE21C); for(iVar7 = 0; iVar7 < 8; iVar7++) { - sub_80831F8(r0,&gDungeon->unkE220[iVar7]); + ReadPosition8(r0,&gDungeon->unkE220[iVar7]); } - sub_8083220(r0,&gDungeon->unkE240); - sub_8083220(r0,&gDungeon->unkE240 + 0x4); - sub_8083260(r0,&gDungeon->unkE240 + 0x8); + sub_8083220(r0, gDungeon->unkE240); + sub_8083220(r0, gDungeon->unkE250); + sub_8083260(r0, gDungeon->unkE260); for(y = 0; y < 8; y++) @@ -856,67 +872,67 @@ void sub_8081C7C(unkStruct_8094924 *r0) for(x = 0; x < 8; x++) { RestoreTile(r0,&gDungeon->unkE27C[y][x]); - gDungeon->unkE87C[y][x] = sub_8083188(r0); + gDungeon->unkE87C[y][x] = ReadU8(r0); } } RestoreDungeonWeather(r0,&gDungeon->weather); } -void RestoreTile(unkStruct_8094924 *r0, Tile *tile) +void RestoreTile(DataSerializer *r0, Tile *tile) { memset(tile, 0, sizeof(Tile)); - tile->terrainType = sub_8083158(r0); - tile->unk4 = sub_8083158(r0); + tile->terrainType = ReadU16(r0); + tile->unk4 = ReadU16(r0); - sub_8082FE0(r0, (u32 *)&tile->room, 1); - sub_8082FE0(r0, (u32 *)&tile->unkE, 1); + ReadBytes(r0, (u32 *)&tile->room, 1); + ReadBytes(r0, (u32 *)&tile->unkE, 1); tile->monster = NULL; tile->object = NULL; } -void RestoreDungeonWeather(unkStruct_8094924 *r0, Weather *weather) +void RestoreDungeonWeather(DataSerializer *r0, Weather *weather) { s32 index; memset(weather, 0, sizeof(Weather)); - sub_8082FE0(r0, (u32 *)&weather->weather, 1); - sub_8082FE0(r0, (u32 *)&weather->unkE265, 1); + ReadBytes(r0, (u32 *)&weather->weather, 1); + ReadBytes(r0, (u32 *)&weather->unkE265, 1); for(index = 0; index < 8; index++) { - weather->unkE267[index] = sub_8083188(r0); - weather->naturalWeather[index] = sub_8083188(r0); + weather->unkE267[index] = ReadU8(r0); + weather->naturalWeather[index] = ReadU8(r0); } - weather->weatherDamageCounter = sub_8083188(r0); - weather->mudSportTurns = sub_8083188(r0); - weather->waterSportTurns = sub_8083188(r0); - weather->nullifyWeather = sub_80831DC(r0); + weather->weatherDamageCounter = ReadU8(r0); + weather->mudSportTurns = ReadU8(r0); + weather->waterSportTurns = ReadU8(r0); + weather->nullifyWeather = ReadBool8(r0); } -void sub_8081F2C(unkStruct_8094924 *param_1) +void sub_8081F2C(DataSerializer *param_1) { sub_8083018(param_1,gMisakiSan); gDungeon->unk181e8.cameraTarget = NULL; - gDungeon->unk181e8.unk18208 = sub_8083188(param_1); - gDungeon->unk181e8.visibilityRange = sub_8083188(param_1); - gDungeon->unk181e8.blinded = sub_80831DC(param_1); - gDungeon->unk181e8.unk1820B = sub_80831DC(param_1); - gDungeon->unk181e8.unk1820C = sub_80831DC(param_1); - gDungeon->unk181e8.unk1820D = sub_80831DC(param_1); - gDungeon->unk181e8.unk1820E = sub_80831DC(param_1); - gDungeon->unk181e8.unk1820F = sub_80831DC(param_1); - gDungeon->unk181e8.hallucinating = sub_80831DC(param_1); - gDungeon->unk181e8.unk18211 = sub_80831DC(param_1); - gDungeon->unk181e8.unk18213 = sub_80831DC(param_1); + gDungeon->unk181e8.unk18208 = ReadU8(param_1); + gDungeon->unk181e8.visibilityRange = ReadU8(param_1); + gDungeon->unk181e8.blinded = ReadBool8(param_1); + gDungeon->unk181e8.unk1820B = ReadBool8(param_1); + gDungeon->unk181e8.unk1820C = ReadBool8(param_1); + gDungeon->unk181e8.unk1820D = ReadBool8(param_1); + gDungeon->unk181e8.unk1820E = ReadBool8(param_1); + gDungeon->unk181e8.unk1820F = ReadBool8(param_1); + gDungeon->unk181e8.hallucinating = ReadBool8(param_1); + gDungeon->unk181e8.unk18211 = ReadBool8(param_1); + gDungeon->unk181e8.unk18213 = ReadBool8(param_1); } -void RestoreDungeonMusic(unkStruct_8094924 *r0) +void RestoreDungeonMusic(DataSerializer *r0) { - gDungeon->musPlayer.songIndex = sub_8083170(r0); - gDungeon->musPlayer.pastSongIndex = sub_8083170(r0); - gDungeon->musPlayer.queuedSongIndex = sub_8083170(r0); + gDungeon->musPlayer.songIndex = ReadS16(r0); + gDungeon->musPlayer.pastSongIndex = ReadS16(r0); + gDungeon->musPlayer.queuedSongIndex = ReadS16(r0); } -void RestoreItemData(unkStruct_8094924 *r0) { +void RestoreItemData(DataSerializer *r0) { s32 index; Item item; Position pos; @@ -924,22 +940,22 @@ void RestoreItemData(unkStruct_8094924 *r0) { for(index = 0; index < DUNGEON_MAX_ITEMS; index++) { sub_80820A8(r0, &item); - sub_80831F8(r0, &pos); + ReadPosition8(r0, &pos); if(item.flags & ITEM_FLAG_EXISTS) sub_80460F8(&pos, &item, 0); } } -void sub_80820A8(unkStruct_8094924 *param_1, Item *item) +void sub_80820A8(DataSerializer *param_1, Item *item) { memset(item, 0, sizeof(Item)); - sub_8082FE0(param_1,(u32 *)&item->flags,1); - sub_8082FE0(param_1,(u32 *)&item->quantity,1); - sub_8082FE0(param_1,(u32 *)&item->id,1); + ReadBytes(param_1,(u32 *)&item->flags,1); + ReadBytes(param_1,(u32 *)&item->quantity,1); + ReadBytes(param_1,(u32 *)&item->id,1); } -void RestoreTrapData(unkStruct_8094924 *param_1) +void RestoreTrapData(DataSerializer *param_1) { int counter; Tile *tile; @@ -955,10 +971,10 @@ void RestoreTrapData(unkStruct_8094924 *param_1) { trapID = 6; unk1 = 0; - sub_8082FE0(param_1,(u32 *)&trapID,1); - sub_8082FE0(param_1,(u32 *)&unk1,1); - isVisible = sub_80831DC(param_1); - sub_80831F8(param_1, &pos); + ReadBytes(param_1,(u32 *)&trapID,1); + ReadBytes(param_1,(u32 *)&unk1,1); + isVisible = ReadBool8(param_1); + ReadPosition8(param_1, &pos); if(trapID != 0xFF) { @@ -973,29 +989,30 @@ void RestoreTrapData(unkStruct_8094924 *param_1) } } -void sub_808217C(unkStruct_8094924 *param_1) +void sub_808217C(DataSerializer *param_1) { s32 counter; sub_8083018(param_1,gMisakiSan); gDungeon->unk37F0 = sub_80831A0(param_1); gDungeon->unk37F4 = sub_80831A0(param_1); - gDungeon->plusIsActive[0] = sub_80831DC(param_1); - gDungeon->plusIsActive[1] = sub_80831DC(param_1); - gDungeon->minusIsActive[0] = sub_80831DC(param_1); - gDungeon->minusIsActive[1] = sub_80831DC(param_1); - gDungeon->decoyActive = sub_80831DC(param_1); - gDungeon->unk37FD = sub_80831DC(param_1); - gDungeon->deoxysDefeat = sub_80831DC(param_1); - gDungeon->unk37FF = sub_80831DC(param_1); - gDungeon->unk3800 = sub_8083158(param_1); + gDungeon->plusIsActive[0] = ReadBool8(param_1); + gDungeon->plusIsActive[1] = ReadBool8(param_1); + gDungeon->minusIsActive[0] = ReadBool8(param_1); + gDungeon->minusIsActive[1] = ReadBool8(param_1); + gDungeon->decoyActive = ReadBool8(param_1); + gDungeon->unk37FD = ReadBool8(param_1); + gDungeon->deoxysDefeat = ReadBool8(param_1); + gDungeon->unk37FF = ReadBool8(param_1); + gDungeon->unk3800 = ReadU16(param_1); for(counter = 0; counter < MAX_TEAM_MEMBERS; counter++) { - sub_8082280(param_1, TRUE, counter); + RestoreDungeonEntity(param_1, TRUE, counter); } for(counter = 0; counter < DUNGEON_MAX_WILD_POKEMON; counter++) { - sub_8082280(param_1, FALSE, counter); + RestoreDungeonEntity(param_1, FALSE, counter); } } +// RestoreDungeonEntity should be here \ No newline at end of file diff --git a/src/wonder_mail_2.c b/src/wonder_mail_2.c index 7cf6654df..1c42ffa9d 100644 --- a/src/wonder_mail_2.c +++ b/src/wonder_mail_2.c @@ -167,7 +167,7 @@ void sub_802B3E0(void) sUnknown_203B2C8->unk114.clientSpecies = MONSTER_PELIPPER; sUnknown_203B2C8->unk114.unk16 = 2; sUnknown_203B2C8->unk114.moneyReward = 0; - sub_8097790(); + IncrementFriendRescueSuccesses(); mail = GetMailatIndex(sUnknown_203B2C8->unk1); sub_803C37C(&mail->unk4.dungeon, 0, sUnknown_203B2C8->unk114.itemRewards); sUnknown_203B2C8->unk114.teamRankPtsReward = GetDungeonTeamRankPts(&mail->unk4.dungeon, 0); diff --git a/sym_ewram2.txt b/sym_ewram2.txt index 369fb39f6..4bebc1662 100644 --- a/sym_ewram2.txt +++ b/sym_ewram2.txt @@ -225,7 +225,7 @@ gUnknown_203B40C: /* 203B40C (sub_803E46C - PrintFieldMessage) */ gUnknown_203B40D: /* 203B40D (sub_803E250 - sub_807E698) */ .space 0x3 -gUnknown_203B410: /* 203B410 (sub_8040150 - sub_8082280) */ +gUnknown_203B410: /* 203B410 (sub_8040150 - RestoreDungeonEntity) */ .space 0x4 .include "src/code_8042B34.o" @@ -258,7 +258,7 @@ gUnknown_203B43C: /* 203B43C (sub_8065FB4) */ gUnknown_203B444: /* 203B444 (sub_807DF38) */ .space 0xC -gLeaderPointer: /* 203B450 (xxx_dungeon_8042F6C - sub_8082280) */ +gLeaderPointer: /* 203B450 (xxx_dungeon_8042F6C - RestoreDungeonEntity) */ .space 0x4 .include "src/dungeon_random.o" From ab90cf05001889cad6ea77aecf2286fd61331188 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sat, 9 Nov 2024 10:35:16 -0500 Subject: [PATCH 19/48] gDungeon->unk644 --- include/structs/str_dungeon.h | 118 ++++++++++++------------ src/code_803D110.c | 20 ++--- src/code_803E724.c | 4 +- src/code_8041AD0.c | 2 +- src/code_804267C.c | 2 +- src/code_8042B34.c | 164 +++++++++++++++++----------------- src/code_8048480.c | 6 +- src/code_805D8C8_1.c | 46 +++++----- src/code_806CD90.c | 20 ++--- src/code_806E8B0.c | 2 +- src/code_806FDF4.c | 16 ++-- src/code_80718D8.c | 24 ++--- src/code_8073CF0.c | 16 ++-- src/code_8077274_1.c | 4 +- src/code_807E1A0.c | 30 +++---- src/code_8084778.c | 2 +- src/code_80848F0.c | 4 +- src/dungeon_action.c | 12 +-- src/dungeon_ai.c | 4 +- src/dungeon_ai_leader.c | 2 +- src/dungeon_ai_targeting.c | 2 +- src/dungeon_cutscenes.c | 10 +-- src/dungeon_engine.c | 16 ++-- src/dungeon_items.c | 2 +- src/dungeon_message.c | 6 +- src/dungeon_move.c | 2 +- src/dungeon_movement.c | 2 +- src/dungeon_music.c | 30 +++---- src/status_actions.c | 2 +- src/trap_1.c | 4 +- 30 files changed, 287 insertions(+), 287 deletions(-) diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index 590f23722..3ea209bee 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -196,12 +196,13 @@ struct unkStruct_Dungeon5C4_sub Entity *unkC; }; -struct unkStruct_Dungeon64C +// size: 0x8 +typedef struct unkStruct_Dungeon64C { u8 unk0; u8 unk1; u32 unk4; -}; +} unkStruct_Dungeon64C; #define UNK_1BBD4_STR_COUNT 10 @@ -230,6 +231,56 @@ struct MessageLogString u8 str[MESSAGE_LOG_BUFFER_SIZE]; }; +// size: 0x58 +typedef struct unkDungeon644 +{ + /* 0x0 */ DungeonLocation dungeonLocation; + /* 0x4 */ DungeonLocation dungeonLocation2; + /* 0x8 */ unkStruct_Dungeon64C unk8; + /* 0x10 */ u8 unk10; + /* 0x11 */ u8 fill11[3]; + /* 0x14 */ u8 unk14; + /* 0x15 */ u8 unk15; + /* 0x16 */ u8 unk16; + /* 0x17 */ u8 unk17; + /* 0x18 */ u8 unk18; + /* 0x19 */ u8 unk19; + /* 0x1A */ u8 fill1A[2]; + /* 0x1C */ s16 fractionalTurn; // Handles turn order when PokĂ©mon have different movement speeds. + /* 0x1E */ s16 unk1E; + /* 0x20 */ s16 unk20; + /* 0x22 */ s16 windTurns; // Turns remaining before getting swept out of the dungeon. + /* 0x24 */ u16 unk24; + /* 0x26 */ u16 bossSongIndex; + /* 0x28 */ u8 unk28; + /* 0x29 */ u8 unk29; + /* 0x2A */ u8 unk2A; + /* 0x2B */ u8 unk2B; + /* 0x2C */ u8 unk2C; + /* 0x2D */ bool8 monsterHouseTriggered; + /* 0x2E */ bool8 monsterHouseTriggeredEvent; + /* 0x2F */ u8 unk2F; + /* 0x30 */ u8 unk30; + /* 0x31 */ u8 unk31; + /* 0x32 */ bool8 itemHoldersIdentified; + /* 0x33 */ u8 fill33; + /* 0x34 */ u8 unk34; + /* 0x35 */ u8 unk35; + /* 0x36 */ u8 unk36; + /* 0x37 */ s8 unk37; + /* 0x38 */ u32 unk38; + /* 0x3C */ u32 unk3C; + /* 0x40 */ s16 unk40; + /* 0x42 */ s16 unk42; + /* 0x44 */ s16 unk44; + /* 0x46 */ u8 unk46; + /* 0x48 */ s32 unk48; + /* 0x4C */ s32 unk4C; + /* 0x50 */ s32 unk50; + /* 0x54 */ u8 unk54; + /* 0x55 */ u8 unk55; +} unkDungeon644; + // size: 0x1CEDC typedef struct Dungeon { @@ -264,61 +315,10 @@ typedef struct Dungeon /* 0x5C0 */ s32 unk5C0; /* 0x5C4 */ struct unkStruct_Dungeon5C4_sub unk5C4[3]; /* 0x5F4 */ u8 faintStringBuffer[80]; - - // TODO: This is the start of a struct that is 0x58 bytes (dungeon data that persists between save/reload). See sub_8080B90 and sub_8081C50 - /* 0x644 */ DungeonLocation dungeonLocation; - /* 0x648 */ DungeonLocation dungeonLocation2; - struct unkStruct_Dungeon64C unk64C; - u8 unk654; - u8 fill655; - u8 fill656; - u8 fill657; - u8 unk658; - u8 unk659; - u8 unk65A; - u8 unk65B; - u8 unk65C; - u8 unk65D; - u8 fill65e[2]; - /* 0x660 */ s16 fractionalTurn; // Handles turn order when PokĂ©mon have different movement speeds. - s16 unk662; - s16 unk664; - /* 0x666 */ s16 windTurns; // Turns remaining before getting swept out of the dungeon. - /* 0x668 */ u16 unk668; - u16 bossSongIndex; - u8 unk66C; - u8 unk66D; - /* 0x66E */ u8 unk66E; - u8 unk66F; - u8 unk670; - /* 0x671 */ bool8 monsterHouseTriggered; - /* 0x672 */ bool8 monsterHouseTriggeredEvent; - u8 unk673; - u8 unk674; - u8 unk675; - /* 0x676 */ bool8 itemHoldersIdentified; - u8 unk677; - u8 unk678; - u8 unk679; - u8 unk67A; - s8 unk67B; - u32 unk67C; - u32 unk680; - s16 unk684; - s16 unk686; - s16 unk688; - /* 0x68A */ u8 unk68A; - u8 fill68B; - s32 unk68C; - s32 unk690; - s32 unk694; - u8 unk698; - u8 unk699; - u8 fill69A[2]; - - EntityInfo unk69C[4]; - EntityInfo unkEBC[1]; // Unsure about the size... See sub_8082A08() - u8 fill10C4[0x343C - 0x10C4]; + unkDungeon644 unk644; // This data persists between save/reload. See sub_8080B90 and sub_8081C50 + EntityInfo unk69C[MAX_TEAM_MEMBERS]; + EntityInfo unkEBC[DUNGEON_MAX_WILD_POKEMON_BODY_SIZE]; + u8 fill2F3C[0x343C - 0x2F3C]; /* 0x343C */ UnkDungeonGlobal_unk1CD98 unk343C[32]; u8 fill353C[0x363c-0x353c]; /* 0x363C */ u8 expYieldRankings[NUM_MONSTERS]; @@ -335,9 +335,9 @@ typedef struct Dungeon /* 0x37FE */ bool8 deoxysDefeat; // Flag set for deoxys in Meteor Cave /* 0x37FE */ u8 unk37FF; s16 unk3800; - u8 fill3802[0x3904 - 0x3802]; + EntityInfo *unk3804[DUNGEON_MAX_ITEMS]; /* 0x3904 */ s16 unk3904; - u8 fill3906[0x3A08 - 0x3906]; + EntityInfo *unk3908[DUNGEON_MAX_TRAPS]; /* 0x3A08 */ u8 unk3A08; /* 0x3A09 */ u8 unk3A09; /* 0x3A0A */ u8 unk3A0A; diff --git a/src/code_803D110.c b/src/code_803D110.c index 937591752..126b5a68d 100644 --- a/src/code_803D110.c +++ b/src/code_803D110.c @@ -83,17 +83,17 @@ void sub_803D4D0(void) OpenedFile *file; struct UnkDungeonFileData *strPtr; - sub_80901D8(&gDungeon->dungeonLocation2, &gDungeon->dungeonLocation); - if (gDungeon->unk1C570.id == gDungeon->dungeonLocation2.id && gDungeon->unk1C570.floor == gDungeon->dungeonLocation2.floor) + sub_80901D8(&gDungeon->unk644.dungeonLocation2, &gDungeon->unk644.dungeonLocation); + if (gDungeon->unk1C570.id == gDungeon->unk644.dungeonLocation2.id && gDungeon->unk1C570.floor == gDungeon->unk644.dungeonLocation2.floor) return; - gDungeon->unk1C570 = gDungeon->dungeonLocation2; + gDungeon->unk1C570 = gDungeon->unk644.dungeonLocation2; file = OpenFileAndGetFileDataPtr(gUnknown_80F4D8C, &gDungeonFileArchive); strPtr = &file->data.dungData->unk0[gDungeon->unk1C570.id][gDungeon->unk1C570.floor]; - gDungeon->unk1CEC8 = GetDungeonFloorCount(gDungeon->dungeonLocation.id); - gDungeon->unk14 = sub_80902C8(gDungeon->dungeonLocation.id); + gDungeon->unk1CEC8 = GetDungeonFloorCount(gDungeon->unk644.dungeonLocation.id); + gDungeon->unk14 = sub_80902C8(gDungeon->unk644.dungeonLocation.id); gDungeon->unk1C574 = file->data.dungData->unk4[strPtr->unk0]; @@ -564,8 +564,8 @@ void ShowDungeonNameBanner(void) } CpuClear((void *)(VRAM + 0x140), 0x1C00); if (sub_80848EC()) { - s32 r8 = gDungeon->dungeonLocation.floor + gDungeon->unk14; - const u8 *dungName = GetDungeonName2(gDungeon->dungeonLocation.id); + s32 r8 = gDungeon->unk644.dungeonLocation.floor + gDungeon->unk14; + const u8 *dungName = GetDungeonName2(gDungeon->unk644.dungeonLocation.id); s32 r5 = 10; for (r7 = 0; r7 < 8; r7++) { @@ -579,7 +579,7 @@ void ShowDungeonNameBanner(void) } var = sub_803DC14(dungName, (224 - CalcStringWidth(dungName)) / 2, 0); - if (IsStairDirectionUp(gDungeon->dungeonLocation.id)) + if (IsStairDirectionUp(gDungeon->unk644.dungeonLocation.id)) r6 = gUnknown_80F6108; else r6 = gUnknown_80F610C; @@ -1069,11 +1069,11 @@ void sub_803E178(void) s32 val = sub_8043D10(); if (val == 0) { - if (gDungeon->dungeonLocation.id == DUNGEON_METEOR_CAVE && !gDungeon->deoxysDefeat) { + if (gDungeon->unk644.dungeonLocation.id == DUNGEON_METEOR_CAVE && !gDungeon->deoxysDefeat) { gDungeon->unk3A12 = 28; } else { - gDungeon->unk3A12 = (IsStairDirectionUp(gDungeon->dungeonLocation.id) != FALSE) ? 23 : 22; + gDungeon->unk3A12 = (IsStairDirectionUp(gDungeon->unk644.dungeonLocation.id) != FALSE) ? 23 : 22; } } else if (val == 1) { diff --git a/src/code_803E724.c b/src/code_803E724.c index 0a5f9dfab..e8c45e0ab 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -1313,10 +1313,10 @@ void sub_803FB74(void) } arrPtr = gUnknown_202B038[0][0]; - unkFloor = gDungeon->unk14 + gDungeon->dungeonLocation.floor; + unkFloor = gDungeon->unk14 + gDungeon->unk644.dungeonLocation.floor; if (strPtr->unk3A != unkFloor) { strPtr->unk3A = unkFloor; - if (IsStairDirectionUp(gDungeon->dungeonLocation.id)) { + if (IsStairDirectionUp(gDungeon->unk644.dungeonLocation.id)) { arrPtr[1] = 0; } else { diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index ad6964532..c9f2733cc 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -221,7 +221,7 @@ void EntityUpdateStatusSprites(Entity *entity) spriteStatus = spriteStatus | STATUS_SPRITE_LOWHP; } } - if ((gDungeon->itemHoldersIdentified) && (entityInfo->heldItem.flags & ITEM_FLAG_EXISTS)) { + if ((gDungeon->unk644.itemHoldersIdentified) && (entityInfo->heldItem.flags & ITEM_FLAG_EXISTS)) { spriteStatus = spriteStatus | STATUS_SPRITE_LOWHP; } if ( (entityInfo->offensiveMultipliers[0] < DEFAULT_STAT_MULTIPLIER) || diff --git a/src/code_804267C.c b/src/code_804267C.c index 9983217bb..6af03624f 100644 --- a/src/code_804267C.c +++ b/src/code_804267C.c @@ -42,7 +42,7 @@ void PlayStairsSound(void) switch (sub_8043D10()) { case 0: default: - songIndex = IsStairDirectionUp(gDungeon->dungeonLocation.id) ? 340 : 341; + songIndex = IsStairDirectionUp(gDungeon->unk644.dungeonLocation.id) ? 340 : 341; break; case 1: case 2: diff --git a/src/code_8042B34.c b/src/code_8042B34.c index aa684d283..84f43a339 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -266,7 +266,7 @@ struct UnkStruct_xxx_dungeon_8042F6C u8 unkF; u8 unk10; u8 unk11; - struct unkStruct_Dungeon64C unk14; + unkStruct_Dungeon64C unk14; PokemonStruct1 unk1C; u8 *unk74; Dungeon *unk78; @@ -437,20 +437,20 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) gUnknown_203B410 = 100; if (!r6) { - gDungeon->unk678 = r8->unkF; - gDungeon->unk64C = r8->unk14; - gDungeon->windTurns = GetTurnLimit(r8->unk4.id); - gDungeon->unk67A = 0; - gDungeon->unk67B = GetRescuesAllowed(r8->unk4.id); + gDungeon->unk644.unk34 = r8->unkF; + gDungeon->unk644.unk8 = r8->unk14; + gDungeon->unk644.windTurns = GetTurnLimit(r8->unk4.id); + gDungeon->unk644.unk36 = 0; + gDungeon->unk644.unk37 = GetRescuesAllowed(r8->unk4.id); } - gDungeon->unk698 = 0; - gDungeon->unk699 = 0; - gDungeon->unk65C = r8->unk9; - gDungeon->unk65A = r8->unkC; - gDungeon->unk658 = r8->unkA; - gDungeon->unk659 = r8->unkB; - gDungeon->unk65B = r8->unkD; - gDungeon->unk65D = r8->unkE; + gDungeon->unk644.unk54 = 0; + gDungeon->unk644.unk55 = 0; + gDungeon->unk644.unk18 = r8->unk9; + gDungeon->unk644.unk16 = r8->unkC; + gDungeon->unk644.unk14 = r8->unkA; + gDungeon->unk644.unk15 = r8->unkB; + gDungeon->unk644.unk17 = r8->unkD; + gDungeon->unk644.unk19 = r8->unkE; StopDungeonBGM(); sub_803D4AC(); sub_804513C(); @@ -479,35 +479,35 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) if (!r6) { gDungeon->unk181e8.unk1820B = 1; gDungeon->unk181e8.unk1820C = 1; - if (gDungeon->unk678 == 1) { - gDungeon->dungeonLocation.id = r8->unk14.unk0; - gDungeon->dungeonLocation.floor = 1; + if (gDungeon->unk644.unk34 == 1) { + gDungeon->unk644.dungeonLocation.id = r8->unk14.unk0; + gDungeon->unk644.dungeonLocation.floor = 1; } else { - gDungeon->dungeonLocation = r8->unk4; + gDungeon->unk644.dungeonLocation = r8->unk4; } - gDungeon->unk674 = 0; + gDungeon->unk644.unk30 = 0; EnforceMaxItemsAndMoney(); } if (!r6) { - if (gDungeon->unk678 == 1) { - gDungeon->unk67C = r8->unk14.unk4; + if (gDungeon->unk644.unk34 == 1) { + gDungeon->unk644.unk38 = r8->unk14.unk4; } else { - gDungeon->unk67C = Rand32Bit() & 0xFFFFFF; + gDungeon->unk644.unk38 = Rand32Bit() & 0xFFFFFF; } - sub_808408C(gDungeon->unk67C); + sub_808408C(gDungeon->unk644.unk38); } if (!r6) { - if (!sub_80980A4() && gDungeon->dungeonLocation.id == DUNGEON_TINY_WOODS) { + if (!sub_80980A4() && gDungeon->unk644.dungeonLocation.id == DUNGEON_TINY_WOODS) { sub_8043FD0(); } sub_806890C(); } if (r9) { - gFormatArgs[0] = gDungeon->unk67B; + gFormatArgs[0] = gDungeon->unk644.unk37; if (gFormatArgs[0] != 0) { DisplayDungeonMessage(0, gUnknown_80FEC48, 1); } @@ -518,7 +518,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) if (r10) { r8->unk1C.heldItem.id = 0; - if (IsLevelResetTo1(gDungeon->dungeonLocation.id)) { + if (IsLevelResetTo1(gDungeon->unk644.dungeonLocation.id)) { sub_808D0D8(&r8->unk1C); } sub_8068A84(&r8->unk1C); @@ -528,7 +528,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) } sub_8068614(); - if (!r6 && gDungeon->unk678 == 1) { + if (!r6 && gDungeon->unk644.unk34 == 1) { if (sub_8099394(&sp)) { unkStruct_203B480 *mailStr = GetMailatIndex(sp); if (mailStr->rescuesAllowed) { @@ -553,9 +553,9 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) gLeaderPointer = NULL; gDungeon->unk0 = 0; if (!r6) { - gDungeon->unk680 = YetAnotherRandom24(); - gDungeon->unk668 = 10; - InitDungeonRNG(gDungeon->unk680); + gDungeon->unk644.unk3C = YetAnotherRandom24(); + gDungeon->unk644.unk24 = 10; + InitDungeonRNG(gDungeon->unk644.unk3C); } gDungeon->unk37EC = 0; if (!r6) { @@ -567,7 +567,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) gDungeon->deoxysDefeat = FALSE; gDungeon->unk3800 = gUnknown_80F6850[rnd]; gDungeon->unk37FF = 0; - gDungeon->unk675 = 0; + gDungeon->unk644.unk31 = 0; } sub_803D4D0(); gDungeon->unk1 = 0; @@ -588,23 +588,23 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) gDungeon->unkE = 0; gDungeon->unk1BDD4.unk1C05E = 0; if (!r6) { - gDungeon->unk679 = 0; - gDungeon->unk68C = 0; - gDungeon->unk690 = 0; - gDungeon->unk694 = 0; - gDungeon->fractionalTurn = 0; - gDungeon->unk662 = 0; - gDungeon->unk66E = 0; - gDungeon->unk66F = 0; - gDungeon->unk670 = 0; - gDungeon->itemHoldersIdentified = 0; - gDungeon->monsterHouseTriggered = 0; - gDungeon->monsterHouseTriggeredEvent = 0; - gDungeon->bossSongIndex = 999; - gDungeon->unk688 = 0; - gDungeon->unk68A = 0; - gDungeon->unk684 = 99; - gDungeon->unk686 = 99; + gDungeon->unk644.unk35 = 0; + gDungeon->unk644.unk48 = 0; + gDungeon->unk644.unk4C = 0; + gDungeon->unk644.unk50 = 0; + gDungeon->unk644.fractionalTurn = 0; + gDungeon->unk644.unk1E = 0; + gDungeon->unk644.unk2A = 0; + gDungeon->unk644.unk2B = 0; + gDungeon->unk644.unk2C = 0; + gDungeon->unk644.itemHoldersIdentified = 0; + gDungeon->unk644.monsterHouseTriggered = 0; + gDungeon->unk644.monsterHouseTriggeredEvent = 0; + gDungeon->unk644.bossSongIndex = 999; + gDungeon->unk644.unk44 = 0; + gDungeon->unk644.unk46 = 0; + gDungeon->unk644.unk40 = 99; + gDungeon->unk644.unk42 = 99; gDungeon->weather.weather = 0; gDungeon->tileset = gDungeon->unk1C574.unk2; gDungeon->unk3A10 = gDungeon->unk1C574.unk3; @@ -639,8 +639,8 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) if (!r6) { sub_804AFAC(); - gDungeon->windTurns = GetTurnLimit(gDungeon->dungeonLocation.id); - gDungeon->unk67A = 0; + gDungeon->unk644.windTurns = GetTurnLimit(gDungeon->unk644.dungeonLocation.id); + gDungeon->unk644.unk36 = 0; } sub_804AAD4(); sub_8049B8C(); @@ -663,8 +663,8 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) if (!r6) { sub_807FA18(); sub_8045CB0(); - gDungeon->unk694 = gDungeon->unk68C; - gDungeon->unk690 = 0; + gDungeon->unk644.unk50 = gDungeon->unk644.unk48; + gDungeon->unk644.unk4C = 0; sub_8051E3C(); sub_804AAAC(); } @@ -706,8 +706,8 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) sub_8040150(r6); sub_8040A84(); gDungeon->unkB8 = NULL; - gDungeon->unk66C = 0; - gDungeon->unk66D = 0; + gDungeon->unk644.unk28 = 0; + gDungeon->unk644.unk29 = 0; gDungeon->unk12 = 99; gDungeon->unk0 = 1; @@ -757,7 +757,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) if (gDungeon->unk5 == 0) { bool8 param = TRUE; - gDungeon->unk654 = 0; + gDungeon->unk644.unk10 = 0; gDungeon->unk181e8.unk18218 = 0; gDungeon->unk181e8.unk18219 = 1; do { @@ -771,12 +771,12 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) sub_8071DA4(leader); } - if (gDungeon->unk654 != 1) { + if (gDungeon->unk644.unk10 != 1) { if (sub_8043ED0(TRUE)) { - gDungeon->unk654 = 1; + gDungeon->unk644.unk10 = 1; } } - if (gDungeon->unk654 == 1 || gDungeon->unk11 != 0) { + if (gDungeon->unk644.unk10 == 1 || gDungeon->unk11 != 0) { if (gDungeon->unk6 == 0) { sub_806AA70(); } @@ -794,7 +794,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) if (gDungeon->unk3 == 0 && gDungeon->unk6 == 0 && gDungeon->musPlayer.queuedSongIndex == 0x72 - && gDungeon->dungeonLocation.id == DUNGEON_BURIED_RELIC) + && gDungeon->unk644.dungeonLocation.id == DUNGEON_BURIED_RELIC) { DungeonFadeOutBGM(60); } @@ -826,7 +826,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) if (gDungeon->unk3 != 0) { WriteDungeonState(gSerializedData_203B41C, 0x4800); r8->unk7C = 3; - r8->unk80 = gDungeon->dungeonLocation; + r8->unk80 = gDungeon->unk644.dungeonLocation; check = FALSE; } else @@ -841,8 +841,8 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) } sub_806C1D8(); - if (gDungeon->unk654 == 1) { - if (gDungeon->unk66E != 0) { + if (gDungeon->unk644.unk10 == 1) { + if (gDungeon->unk644.unk2A != 0) { sub_804700C(); } check = TRUE; @@ -853,14 +853,14 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) } else if (gDungeon->unk11 == 2) { sub_8083AB0(0x229, NULL, GetLeader()); - if (gDungeon->unk66E != 0) { + if (gDungeon->unk644.unk2A != 0) { IncrementThievingSuccesses(); } check = TRUE; } else if (gDungeon->unk11 == 3) { sub_8083AB0(0x22A, NULL, GetLeader()); - if (gDungeon->unk66E != 0) { + if (gDungeon->unk644.unk2A != 0) { IncrementThievingSuccesses(); } check = TRUE; @@ -870,21 +870,21 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) sub_8083AB0(var, NULL, GetLeader()); check = TRUE; } - else if (gDungeon->unk678 == 1 && sub_8043D10() == 2 && gDungeon->unk654 == 2) { + else if (gDungeon->unk644.unk34 == 1 && sub_8043D10() == 2 && gDungeon->unk644.unk10 == 2) { sub_8083AB0(0x228, NULL, GetLeader()); - if (gDungeon->unk66E != 0) { + if (gDungeon->unk644.unk2A != 0) { IncrementThievingSuccesses(); } check = TRUE; } else { - if (gDungeon->unk66E != 0) { + if (gDungeon->unk644.unk2A != 0) { IncrementThievingSuccesses(); } - if (gDungeon->dungeonLocation.floor + 1 < gDungeon->unk1CEC8) { - gDungeon->dungeonLocation.floor++; - if (gDungeon->dungeonLocation.id == DUNGEON_FROSTY_FOREST - && gDungeon->dungeonLocation.floor == 6 + if (gDungeon->unk644.dungeonLocation.floor + 1 < gDungeon->unk1CEC8) { + gDungeon->unk644.dungeonLocation.floor++; + if (gDungeon->unk644.dungeonLocation.id == DUNGEON_FROSTY_FOREST + && gDungeon->unk644.dungeonLocation.floor == 6 && !sub_8098100(0x1F)) { sub_8097FA8(0x1F); @@ -917,7 +917,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) sub_80095CC(1, 0x14); sub_803E13C(); sub_800CDA8(4); - if (gDungeon->unk6 == 0 && sub_8083C88(gDungeon->unk678)) { + if (gDungeon->unk6 == 0 && sub_8083C88(gDungeon->unk644.unk34)) { sub_80841EC(); } @@ -925,9 +925,9 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) if (gDungeon->unk6 != 0) { r8->unk7C = -2; memset(&r8->unk84, 0, sizeof(r8->unk84)); - r8->unk80 = gDungeon->dungeonLocation; - r8->unk84.a0 = gDungeon->dungeonLocation; - r8->unk84.a4 = gDungeon->unk67C; + r8->unk80 = gDungeon->unk644.dungeonLocation; + r8->unk84.a0 = gDungeon->unk644.dungeonLocation; + r8->unk84.a4 = gDungeon->unk644.unk38; } else { @@ -935,10 +935,10 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) } } else if (sub_8083C50()) { - if (gDungeon->unk678 == 1) { + if (gDungeon->unk644.unk34 == 1) { r8->unk7C = 4; } - else if (gDungeon->unk678 == 0) { + else if (gDungeon->unk644.unk34 == 0) { r8->unk7C = 1; sub_8084424(); } @@ -946,7 +946,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) r8->unk7C = 1; sub_8084424(); } - r8->unk7E = gDungeon->unk674; + r8->unk7E = gDungeon->unk644.unk30; } else { r8->unk7C = 2; @@ -994,7 +994,7 @@ bool8 sub_8043CE4(s32 dungeonId) u8 sub_8043D10(void) { - if (gDungeon->unk678 == 1 && gDungeon->unk64C.unk1 == gDungeon->dungeonLocation.floor) + if (gDungeon->unk644.unk34 == 1 && gDungeon->unk644.unk8.unk1 == gDungeon->unk644.dungeonLocation.floor) return 2; else if (IsBossFight()) return 1; @@ -1042,7 +1042,7 @@ void sub_8043D60(void) monInfo = GetEntInfo(mon); monInfo->HP = monInfo->maxHPStat; monInfo->belly = monInfo->maxBelly; - gDungeon->itemHoldersIdentified = FALSE; + gDungeon->unk644.itemHoldersIdentified = FALSE; sub_806BFC0(monInfo, 0); monInfo->apparentID = monInfo->id; monInfo->perishSongTurns = 0; @@ -1184,7 +1184,7 @@ void EnforceMaxItemsAndMoney(void) { s32 i; - if (GetMaxItemsAllowed(gDungeon->dungeonLocation.id) == 0) + if (GetMaxItemsAllowed(gDungeon->unk644.dungeonLocation.id) == 0) { for (i = 0; i < INVENTORY_SIZE; i++) { ZeroOutItem(&gTeamInventoryRef->teamItems[i]); @@ -1197,7 +1197,7 @@ void EnforceMaxItemsAndMoney(void) } } - if (!IsKeepMoney(gDungeon->dungeonLocation.id)) { + if (!IsKeepMoney(gDungeon->unk644.dungeonLocation.id)) { gTeamInventoryRef->teamMoney = 0; } } diff --git a/src/code_8048480.c b/src/code_8048480.c index 18379e717..50a17f16f 100644 --- a/src/code_8048480.c +++ b/src/code_8048480.c @@ -687,7 +687,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) if (param_3 != 0) { entityInfo = GetEntInfo(target); entityInfo_1 = entityInfo; - if (gDungeon->unk675 != 0) { + if (gDungeon->unk644.unk31 != 0) { uVar1 = gUnknown_80F4FA8; TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FEAE8); } @@ -710,7 +710,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) else { entityInfo = GetEntInfo(entity); - if (gDungeon->unk675 != 0) { + if (gDungeon->unk644.unk31 != 0) { uVar1 = gUnknown_80F4FAA; TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FEAE8); } @@ -870,7 +870,7 @@ bool8 sub_8048A68(Entity *param_1,Item *item) } else { - if (gDungeon->unk65C == 0) { + if (gDungeon->unk644.unk18 == 0) { DisplayDungeonMessage(0,*gUnknown_80F9BD8,1); return FALSE; } diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index 8d0a9ccc9..ee7b804a5 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -171,7 +171,7 @@ void DungeonHandlePlayerInput(void) return; } - gDungeon->unk673 = 0; + gDungeon->unk644.unk2F = 0; sub_8040A78(); if (gDungeon->unk1 != 0) { gDungeon->unk1 = 0; @@ -193,7 +193,7 @@ void DungeonHandlePlayerInput(void) EntityInfo *leaderInfo = GetEntInfo(leader); sub_80978C8(leaderInfo->id); - if (gDungeon->unk66C != 0) { + if (gDungeon->unk644.unk28 != 0) { if (sub_805E874() != 0) { leaderInfo->action.action = 2; leaderInfo->action.unk4[0].actionUseIndex = 0; @@ -248,7 +248,7 @@ void DungeonHandlePlayerInput(void) if (gRealInputs.held & A_BUTTON && gRealInputs.held & B_BUTTON && FixedPointToInt(leaderInfo->belly) != 0) { sub_8044C50(1); - gDungeon->unk673 = 1; + gDungeon->unk644.unk2F = 1; break; } @@ -259,14 +259,14 @@ void DungeonHandlePlayerInput(void) if (gRealInputs.held & B_BUTTON) { if (FixedPointToInt(leaderInfo->belly) != 0) { sub_8044C50(1); - gDungeon->unk673 = 1; + gDungeon->unk644.unk2F = 1; break; } } else if (ShouldMonsterRunAwayAndShowEffect(leader, TRUE)) { TryDisplayDungeonLoggableMessage(leader, gUnknown_80FD4B0); sub_8044C50(1); - gDungeon->unk673 = 1; + gDungeon->unk644.unk2F = 1; break; } else if (gRealInputs.held & L_BUTTON) { @@ -460,7 +460,7 @@ void DungeonHandlePlayerInput(void) sub_803E46C(0x2F); } - if (gDungeon->unk66D != 0 && !sInDiagonalMode) { + if (gDungeon->unk644.unk29 != 0 && !sInDiagonalMode) { dpadDiagonal = dpadSimple = gRealInputs.pressed; } else { @@ -532,13 +532,13 @@ void DungeonHandlePlayerInput(void) TryDisplayDungeonLoggableMessage(leader, immobilizedMsg); } sub_8044C50(1); - gDungeon->unk673 = 1; + gDungeon->unk644.unk2F = 1; } else { sub_8044C50(2); if ((gRealInputs.held & B_BUTTON || bPress) && FixedPointToInt(leaderInfo->belly) != 0) { if (GetEntInfo(leader)->volatileStatus.volatileStatus != STATUS_CONFUSED) { - gDungeon->unk66C = 1; + gDungeon->unk644.unk28 = 1; } leaderInfo->action.unk4[0].actionUseIndex = 0; } @@ -568,7 +568,7 @@ void DungeonHandlePlayerInput(void) sub_8044C50(0); } else if ((r6.a0_8) == 0) { - gDungeon->unk66D = 0; + gDungeon->unk644.unk29 = 0; if (leaderInfo->action.action != 0) { if (!IsNotAttacking(leader, FALSE)) { sub_803E46C(0xF); @@ -1380,9 +1380,9 @@ void sub_805E738(Entity *a0) void sub_805E804(void) { - gDungeon->unk66D |= gDungeon->unk66C; - gDungeon->unk66C = 0; - while (gDungeon->unk66D != 0 && gRealInputs.held & R_BUTTON) { + gDungeon->unk644.unk29 |= gDungeon->unk644.unk28; + gDungeon->unk644.unk28 = 0; + while (gDungeon->unk644.unk29 != 0 && gRealInputs.held & R_BUTTON) { sub_803E46C(0x54); } } @@ -1406,7 +1406,7 @@ bool8 sub_805E874(void) s32 yAdjacent = y + gAdjacentTileOffsets[direction].y; s32 room; - if (dungeon->unk66C == 0) + if (dungeon->unk644.unk28 == 0) return FALSE; if (leaderTile->object != NULL) return FALSE; @@ -1719,11 +1719,11 @@ void sub_805F02C(void) else if (sub_8047084(ITEM_FLAG_IN_SHOP) || sub_807EF48()) { DisplayDungeonLoggableMessageTrue(r7, gUnknown_80F9C08); } - else if (gDungeon->unk66E) { + else if (gDungeon->unk644.unk2A) { DisplayDungeonLoggableMessageTrue(r7, gUnknown_80F9C2C); } else { - gDungeon->unk679 = 0; + gDungeon->unk644.unk35 = 0; r8->isTeamLeader = TRUE; leaderInfo->isTeamLeader = FALSE; for (i = 0; i < 4; i++) { @@ -2891,7 +2891,7 @@ void sub_8060900(Entity *a0) sub_8044F5C(9, item->id); if (GetItemCategory(item->id) != CATEGORY_POKE) { bool32 r2 = 0; - if (gDungeon->unk65B != 0) { + if (gDungeon->unk644.unk17 != 0) { if (gTeamInventoryRef->teamItems[INVENTORY_SIZE - 1].flags & ITEM_FLAG_EXISTS) { r2 = TRUE; } @@ -2905,7 +2905,7 @@ void sub_8060900(Entity *a0) } } } - if (sUnknownActionUnk4.actionUseIndex == 128 && gDungeon->unk65B != 0) { + if (sUnknownActionUnk4.actionUseIndex == 128 && gDungeon->unk644.unk17 != 0) { sub_8044F5C(10, item->id); } val_sub8044DC8 = sub_8044DC8(item); @@ -2965,7 +2965,7 @@ void sub_8060900(Entity *a0) } } } - else if (gDungeon->unk65B) { + else if (gDungeon->unk644.unk17) { if (gTeamInventoryRef->teamItems[INVENTORY_SIZE - 1].flags & ITEM_FLAG_EXISTS) { sub_8044F5C(0x3E, item->id); } @@ -3026,7 +3026,7 @@ void sub_8060900(Entity *a0) if (GetItemCategory(item->id) == CATEGORY_TMS_HMS) r5 = TRUE; if (GetItemCategory(item->id) == CATEGORY_ORBS) r5 = TRUE; - if (gDungeon->unk65B) { + if (gDungeon->unk644.unk17) { if (r4) { sub_8044F5C(0x3E, item->id); } @@ -3095,7 +3095,7 @@ s32 sub_8060D64(s16 *a0, bool8 a1, bool8 a2, bool8 a3, Entity *a4) s32 i; s32 count = 0; - if (gDungeon->unk65B && !a1) { + if (gDungeon->unk644.unk17 && !a1) { if (gTeamInventoryRef->teamItems[0].flags & ITEM_FLAG_EXISTS) { a0[count++] = 0; } @@ -3161,7 +3161,7 @@ bool8 sub_8060E38(Entity *a0) } } - if (!gDungeon->unk65B) { + if (!gDungeon->unk644.unk17) { var_84.a0[0].unk4 = 3; var_84.a0[0].unk8.unk0.arr[1]++; } @@ -3438,7 +3438,7 @@ void sub_806145C(struct UnkFieldTeamMenuStruct *a0) sub_8044F5C(0x1B, 0); sub_8044F5C(0x19, 0); if (!monInfo->isTeamLeader) { - if (!gDungeon->unk65D && (monInfo->joinedAt.joinedAt != DUNGEON_JOIN_LOCATION_PARTNER || gDungeon->unk65C)) { + if (!gDungeon->unk644.unk19 && (monInfo->joinedAt.joinedAt != DUNGEON_JOIN_LOCATION_PARTNER || gDungeon->unk644.unk18)) { sub_8044F5C(0x34, 0); } sub_8044F5C(0x1C, 0); @@ -3447,7 +3447,7 @@ void sub_806145C(struct UnkFieldTeamMenuStruct *a0) if (!monInfo->isTeamLeader) { sub_8044F5C(0x1A, 0); } - if (!monInfo->isTeamLeader && gDungeon->unk65C && CanLeaderSwitch(gDungeon->dungeonLocation.id)) { + if (!monInfo->isTeamLeader && gDungeon->unk644.unk18 && CanLeaderSwitch(gDungeon->unk644.dungeonLocation.id)) { bool32 r5; sub_8044F5C(0x3B, 0); diff --git a/src/code_806CD90.c b/src/code_806CD90.c index bfa7ca71b..a0414a9c0 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -736,7 +736,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } else { PokemonStruct2 *recruitedMon = &gRecruitedPokemonRef->pokemon2[targetData->teamIndex]; - if (targetData->isTeamLeader || (targetData->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER && gDungeon->unk65C == 0)) { + if (targetData->isTeamLeader || (targetData->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER && gDungeon->unk644.unk18 == 0)) { DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9CEC[r8]); } else if (IsClientOrTeamBase(targetData->joinedAt.joinedAt)) { @@ -746,7 +746,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); } else if (sub_806A58C(recruitedMon->unkA)) { - if (gDungeon->unk65D != 0) { + if (gDungeon->unk644.unk19 != 0) { DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9D8C[r8]); } else { @@ -775,8 +775,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc targetData->unk14C = 1; targetData->belly = targetData->maxBelly; if (targetData->isTeamLeader) { - gDungeon->unk679 = 0; - gDungeon->itemHoldersIdentified = 0; + gDungeon->unk644.unk35 = 0; + gDungeon->unk644.itemHoldersIdentified = 0; } ZeroOutItem(&targetData->heldItem); if (targetData->waitingStruct.waitingStatus == STATUS_SNATCH) { @@ -832,8 +832,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc targetData->unk14C = 1; targetData->belly = targetData->maxBelly; if (targetData->isTeamLeader) { - gDungeon->unk679 = 0; - gDungeon->itemHoldersIdentified = 0; + gDungeon->unk644.unk35 = 0; + gDungeon->unk644.itemHoldersIdentified = 0; } ZeroOutItem(heldItem); if (targetData->waitingStruct.waitingStatus == STATUS_SNATCH) { @@ -887,8 +887,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc targetData->unk14C = 1; targetData->belly = targetData->maxBelly; if (targetData->isTeamLeader) { - gDungeon->unk679 = 0; - gDungeon->itemHoldersIdentified = 0; + gDungeon->unk644.unk35 = 0; + gDungeon->unk644.itemHoldersIdentified = 0; } if (targetData->waitingStruct.waitingStatus == STATUS_SNATCH) { SendWaitingEndMessage(attacker, target, STATUS_SNATCH); @@ -914,7 +914,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc ZeroOutItem(&targetData->heldItem); } if (targetData->bossFlag) { - gDungeon->bossSongIndex = 999; + gDungeon->unk644.bossSongIndex = 999; } // Give exp @@ -956,7 +956,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } } else { - if (DoEnemiesEvolveWhenKOed(gDungeon->dungeonLocation.id)) { + if (DoEnemiesEvolveWhenKOed(gDungeon->unk644.dungeonLocation.id)) { attackerData->unk149 = 1; gDungeon->unkD = 1; } diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index 275e963f6..0d8e7b0a3 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -396,7 +396,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 } // ALSO needed to match. unk694 chosen randomly and it worked with matching. - ASM_MATCH_TRICK(gDungeon->unk694); + ASM_MATCH_TRICK(gDungeon->unk644.unk50); gDungeon->unk134.unk150 = sub_800A048(&unkSp8); { s32 rnd = DungeonRandInt(0x4000); diff --git a/src/code_806FDF4.c b/src/code_806FDF4.c index a3d1775a7..b75499187 100644 --- a/src/code_806FDF4.c +++ b/src/code_806FDF4.c @@ -198,12 +198,12 @@ bool8 sub_806F660(Entity *pokemon,Entity *target) size = GetBodySize(targetInfo->apparentID); if ((1 < ((u16)(gDungeon->bossBattleIndex - 4))) && (gDungeon->bossBattleIndex != 9) && (gDungeon->bossBattleIndex != 0xf)) { if ((u16)(gDungeon->bossBattleIndex - 0x2cU) < 5) { - if (gDungeon->unk65C == 0) { + if (gDungeon->unk644.unk18 == 0) { return FALSE; } } else if (gDungeon->bossBattleIndex == 0x31) { - if (gDungeon->fill655[4] == 0) { + if (gDungeon->unk644.unk15 == 0) { return FALSE; } if (sub_8097900(0x19e) == 0) { @@ -212,12 +212,12 @@ bool8 sub_806F660(Entity *pokemon,Entity *target) } else { - if (IsRecruitingEnabled((gDungeon->dungeonLocation).id) == 0) { + if (IsRecruitingEnabled((gDungeon->unk644.dungeonLocation).id) == 0) { return FALSE; } } } - if (gDungeon->unk65D == 0) + if (gDungeon->unk644.unk19 == 0) { if ((( (2 < (u16)(targetInfo->id - 0x90)) && @@ -689,8 +689,8 @@ bool8 sub_806F9BC(s16 species) unkStruct_8092638 auStack_18; id = species; - if (((gDungeon->unk658 == 0) || (sub_808529C(id) == 0)) || - ((id == MONSTER_MEW && (gDungeon->unk678 == 1)))) { + if (((gDungeon->unk644.unk14 == 0) || (sub_808529C(id) == 0)) || + ((id == MONSTER_MEW && (gDungeon->unk644.unk34 == 1)))) { return FALSE; } else if (id == MONSTER_LATIAS) @@ -779,7 +779,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa pokeStruct2->unkA = -1; pokeStruct2->unkC = pokeIndex; pokeStruct2->speciesNum = param_3->id; - (pokeStruct2->dungeonLocation) = gDungeon->dungeonLocation; + (pokeStruct2->dungeonLocation) = gDungeon->unk644.dungeonLocation; pokeStruct2->unk10 = param_3->HP; pokeStruct2->unk12 = param_3->HP; pokeStruct2->belly = param_3->belly; @@ -1039,7 +1039,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr) pokeStruct2->unkA = -1; pokeStruct2->unkC = index; pokeStruct2->speciesNum = local_74.id; - pokeStruct2->dungeonLocation = gDungeon->dungeonLocation; + pokeStruct2->dungeonLocation = gDungeon->unk644.dungeonLocation; pokeStruct2->unk10 = local_74.HP; pokeStruct2->unk12 = local_74.HP; pokeStruct2->belly = local_74.belly; diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 264fefc83..93d57df0a 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -82,21 +82,21 @@ void sub_8071B48(void) entityPtr = NULL; dungeon = gDungeon; - if ((dungeon->unk664 != 0) && - ((dungeon->dungeonLocation.id != DUNGEON_METEOR_CAVE || (dungeon->unk37FD == 0)))) { - dungeon->unk662++; - if (dungeon->unk66E == 0) { - if ( dungeon->unk662 < gUnknown_80F4DAA) { + if ((dungeon->unk644.unk20 != 0) && + ((dungeon->unk644.dungeonLocation.id != DUNGEON_METEOR_CAVE || (dungeon->unk37FD == 0)))) { + dungeon->unk644.unk1E++; + if (dungeon->unk644.unk2A == 0) { + if ( dungeon->unk644.unk1E < gUnknown_80F4DAA) { return; } } else { - if ( dungeon->unk662 < gUnknown_80F4DAC) { + if ( dungeon->unk644.unk1E < gUnknown_80F4DAC) { return; } } - if (dungeon->unk662 > 900) { + if (dungeon->unk644.unk1E > 900) { entity2 = dungeon->unk17B34; if ((EntityExists(entity2)) && (entity2->spawnGenID == dungeon->unk17B40)) { SetMessageArgument(gFormatBuffer_Monsters[0],entity2,0); @@ -104,7 +104,7 @@ void sub_8071B48(void) } } - dungeon->unk662 = 0; + dungeon->unk644.unk1E = 0; dungeon->unk17B34 = NULL; counter = 0; @@ -117,7 +117,7 @@ void sub_8071B48(void) counter++; } } - if (dungeon->unk66E == 0) { + if (dungeon->unk644.unk2A == 0) { if (gDungeon->unk3A0C == 0xff) { if (counter >= gUnknown_80F4DA6) { return; @@ -135,7 +135,7 @@ void sub_8071B48(void) DisplayDungeonLoggableMessageTrue(0,*gUnknown_80FED68); sub_8042920(entityPtr); } - if (dungeon->unk66E != 0) { + if (dungeon->unk644.unk2A != 0) { index1 = 0x17c; } else { @@ -150,7 +150,7 @@ void sub_8071B48(void) local_2c.species = index1; local_2c.level = level; local_2c.unk2 = 0; - if(DungeonRandInt(100) < GetRandomMovementChance(gDungeon->dungeonLocation.id)) + if(DungeonRandInt(100) < GetRandomMovementChance(gDungeon->unk644.dungeonLocation.id)) { local_2c.unk4 = 1; } @@ -586,7 +586,7 @@ void sub_807218C(Entity *pokemon) } else if(info->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER) { - if(gDungeon->unk65C == 0) + if(gDungeon->unk644.unk18 == 0) r3 = 1; } sub_806A3D4(buffer, r1, 3, r3); diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 3986ec9fb..8d5df8ffc 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -177,7 +177,7 @@ void sub_8073D14(Entity *entity) Item *carriedItems[INVENTORY_SIZE + 1]; // plus held s32 newQuantity; - if (gDungeon->unk65B && !_entityInfo->isNotTeamMember) { + if (gDungeon->unk644.unk17 && !_entityInfo->isNotTeamMember) { for (i = 0; i < INVENTORY_SIZE; i++) { carriedItems[i] = &gTeamInventoryRef->teamItems[i]; inventoryIds[i] = i; @@ -361,13 +361,13 @@ void sub_8074094(Entity *entity) UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - if (gDungeon->unk679 < 10) - gDungeon->unk679++; - if (gDungeon->unk679 == 1) + if (gDungeon->unk644.unk35 < 10) + gDungeon->unk644.unk35++; + if (gDungeon->unk644.unk35 == 1) str = gUnknown_80FD5DC; - if (gDungeon->unk679 == 2) + if (gDungeon->unk644.unk35 == 2) str = gUnknown_80FD608, sound = FALSE; - if (gDungeon->unk679 == 3) + if (gDungeon->unk644.unk35 == 3) str = gUnknown_80FD628, sound = FALSE; TrySendImmobilizeSleepEndMsg(entity, entity); @@ -377,7 +377,7 @@ void sub_8074094(Entity *entity) str = NULL; } else { - gDungeon->unk679 = 0; + gDungeon->unk644.unk35 = 0; } if (str != NULL) { @@ -930,7 +930,7 @@ bool8 UseAttack(Entity *a0) savedEntityPtr = gDungeon->unkB8; gDungeon->unkB8 = a0; - if (gDungeon->unk66C == 0 && r9) { + if (gDungeon->unk644.unk28 == 0 && r9) { sub_80526D0(0x35); for (loop = 0; loop < 24 / gUnknown_202F378; loop++) { sub_803E46C(7); diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index 85b2235c4..4c42d26ac 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -365,9 +365,9 @@ void IdentityItemHolders(Entity *pokemon, Entity *target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { entityInfo = GetEntInfo(target); - if (!gDungeon->itemHoldersIdentified) { + if (!gDungeon->unk644.itemHoldersIdentified) { nullsub_89(target); - gDungeon->itemHoldersIdentified = TRUE; + gDungeon->unk644.itemHoldersIdentified = TRUE; EntityUpdateStatusSprites(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC028); } diff --git a/src/code_807E1A0.c b/src/code_807E1A0.c index a1d17e4a3..18f4244bd 100644 --- a/src/code_807E1A0.c +++ b/src/code_807E1A0.c @@ -123,56 +123,56 @@ void sub_807E378(void) leader = GetLeader(); if (EntityExists(leader)) { - uVar2 = gDungeon->windTurns; - if ((gDungeon->windTurns < 1) || - (gDungeon->windTurns--, ((uVar2 - 1) << 0x10) < 1)) { - gDungeon->unk67A = 3; + uVar2 = gDungeon->unk644.windTurns; + if ((gDungeon->unk644.windTurns < 1) || + (gDungeon->unk644.windTurns--, ((uVar2 - 1) << 0x10) < 1)) { + gDungeon->unk644.unk36 = 3; } - if (gDungeon->unk67A == 0) { - if (gDungeon->windTurns < 0xfa) { + if (gDungeon->unk644.unk36 == 0) { + if (gDungeon->unk644.windTurns < 0xfa) { sub_805E804(); sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C4C); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0); - gDungeon->unk67A = 1; + gDungeon->unk644.unk36 = 1; } } } - else if (gDungeon->unk67A == 1) { - if (gDungeon->windTurns < 0x96) { + else if (gDungeon->unk644.unk36 == 1) { + if (gDungeon->unk644.windTurns < 0x96) { sub_805E804(); sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C70); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1); - gDungeon->unk67A = 2; + gDungeon->unk644.unk36 = 2; } } } - else if (gDungeon->unk67A == 2) { - if (gDungeon->windTurns < 0x32) { + else if (gDungeon->unk644.unk36 == 2) { + if (gDungeon->unk644.windTurns < 0x32) { sub_805E804(); sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C8C); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2); - gDungeon->unk67A = 3; + gDungeon->unk644.unk36 = 3; } } } - else if (gDungeon->windTurns < 1) { + else if (gDungeon->unk644.windTurns < 1) { sub_805E804(); sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9CBC); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3); - gDungeon->unk67A = 4; + gDungeon->unk644.unk36 = 4; sub_8068FE0(leader,0x21e,leader); } } diff --git a/src/code_8084778.c b/src/code_8084778.c index 5fdf19ed1..1941474cd 100644 --- a/src/code_8084778.c +++ b/src/code_8084778.c @@ -17,7 +17,7 @@ void sub_8084778(void) for (i = 0; i < MAX_ACCEPTED_JOBS; i++) { wm = GetJobSlotInfo(i); - if (wm->mailType == MAIL_TYPE_TAKEN_JOB && gDungeon->dungeonLocation.id == wm->unk4.dungeon.id && wm->missionType == WONDER_MAIL_MISSION_TYPE_ESCORT_CLIENT) { + if (wm->mailType == MAIL_TYPE_TAKEN_JOB && gDungeon->unk644.dungeonLocation.id == wm->unk4.dungeon.id && wm->missionType == WONDER_MAIL_MISSION_TYPE_ESCORT_CLIENT) { CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[3], wm->targetSpecies); break; } diff --git a/src/code_80848F0.c b/src/code_80848F0.c index 7499d8597..a285e2572 100644 --- a/src/code_80848F0.c +++ b/src/code_80848F0.c @@ -42,7 +42,7 @@ void sub_80847D4(void) void sub_8084854(struct unkData_8107234 *param_1) { - if (gDungeon->unk678 != 0) { + if (gDungeon->unk644.unk34 != 0) { gDungeon->unk3A0D = param_1->unk0[5]; } else @@ -64,7 +64,7 @@ void sub_8084854(struct unkData_8107234 *param_1) } } } - gDungeon->unk675 = 1; + gDungeon->unk644.unk31 = 1; sub_807E5E4(WEATHER_CLEAR); } diff --git a/src/dungeon_action.c b/src/dungeon_action.c index 436c0fd25..6f63974a6 100644 --- a/src/dungeon_action.c +++ b/src/dungeon_action.c @@ -64,7 +64,7 @@ void sub_8044820(void) { entityInfo->aiNextToTarget = FALSE; movSpeed = CalcSpeedStage(entity); - if (gSpeedTurns[movSpeed][gDungeon->fractionalTurn] != 0) { + if (gSpeedTurns[movSpeed][gDungeon->unk644.fractionalTurn] != 0) { if (!entityInfo->attacking) { entityInfo->flags &= ~(MOVEMENT_FLAG_UNK_14 | MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY); entityInfo->recalculateFollow = FALSE; @@ -107,7 +107,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void) u32 isNotEnemy; s32 index; - if (gSpeedTurns[1][gDungeon->fractionalTurn] != 0) { + if (gSpeedTurns[1][gDungeon->unk644.fractionalTurn] != 0) { sub_8071B48(); gDungeon->plusIsActive[0] = FALSE; gDungeon->plusIsActive[1] = FALSE; @@ -151,7 +151,7 @@ void sub_8044AB4(void) { s32 index; - if (gSpeedTurns[1][gDungeon->fractionalTurn + 1] != 0) { + if (gSpeedTurns[1][gDungeon->unk644.fractionalTurn + 1] != 0) { for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { if (EntityExists(gDungeon->allPokemon[index])) { UseAttack(0); @@ -168,16 +168,16 @@ bool8 sub_8044B28(void) { if (gDungeon->unk4 == 0) { if (GetLeader() == NULL) { - gDungeon->unk654 = 1; + gDungeon->unk644.unk10 = 1; } else if (gDungeon->unk2 == 1) { - gDungeon->unk654 = 2; + gDungeon->unk644.unk10 = 2; } else if (gDungeon->unk2 != 2) { return FALSE; } else { - gDungeon->unk654 = 2; + gDungeon->unk644.unk10 = 2; } } return TRUE; diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index 298cfc4bc..c1a6c04a5 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -51,13 +51,13 @@ void sub_8075900(Entity *pokemon, u8 r1) { if(!sub_8044B28()) { - if(!gDungeon->monsterHouseTriggered) + if(!gDungeon->unk644.monsterHouseTriggered) { if((GetTileAtEntitySafe(pokemon)->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE)) { // It's a monster house! TryDisplayDungeonLoggableMessage(GetLeader(), gPtrItsaMonsterHouseMessage); - gDungeon->monsterHouseTriggeredEvent = TRUE; + gDungeon->unk644.monsterHouseTriggeredEvent = TRUE; sub_807AB38(pokemon, r1); sub_8041888(0); if(sub_803F428(&pokemon->pos.x) != 0) diff --git a/src/dungeon_ai_leader.c b/src/dungeon_ai_leader.c index 57dd17a06..d4a3f893f 100644 --- a/src/dungeon_ai_leader.c +++ b/src/dungeon_ai_leader.c @@ -223,7 +223,7 @@ bool8 sub_8072CF4(Entity *entity) HandleUseMoveAIAction(entity); break; case ACTION_STAIRS: - if ((gDungeon->dungeonLocation.id == DUNGEON_METEOR_CAVE) && (!gDungeon->deoxysDefeat)) { + if ((gDungeon->unk644.dungeonLocation.id == DUNGEON_METEOR_CAVE) && (!gDungeon->deoxysDefeat)) { TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FA5B4); // It's impossible to go down the stairs now! } else diff --git a/src/dungeon_ai_targeting.c b/src/dungeon_ai_targeting.c index b29de7390..cfb750cc7 100644 --- a/src/dungeon_ai_targeting.c +++ b/src/dungeon_ai_targeting.c @@ -274,7 +274,7 @@ bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemon return FALSE; } if (frontTile->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE && - !gDungeon->monsterHouseTriggered && + !gDungeon->unk644.monsterHouseTriggered && IQSkillIsEnabled(pokemon, IQ_HOUSE_AVOIDER)) { return FALSE; diff --git a/src/dungeon_cutscenes.c b/src/dungeon_cutscenes.c index 84e3eb41a..71e761cba 100644 --- a/src/dungeon_cutscenes.c +++ b/src/dungeon_cutscenes.c @@ -485,7 +485,7 @@ void SetupBossFightHP(Entity *pokemon, s32 newHP, u16 songIndex) entityInfo->HP = newHP; } - gDungeon->bossSongIndex = songIndex; + gDungeon->unk644.bossSongIndex = songIndex; SetDefaultIQSkills(entityInfo->IQSkillMenuFlags, entityInfo->bossFlag); LoadIQSkills(pokemon); } @@ -501,7 +501,7 @@ u8 sub_8086AE4(s16 _index) { s32 pokeIndex = _index; - if(gDungeon->unk65C == 0) + if(gDungeon->unk644.unk18 == 0) return 1; else return HasRecruitedMon(pokeIndex); @@ -3816,8 +3816,8 @@ void sub_808B1CC(u8 itemID) Position pos; Item item; - pos.x = gDungeon->unk684; - pos.y = gDungeon->unk686; + pos.x = gDungeon->unk644.unk40; + pos.y = gDungeon->unk644.unk42; if ((pos.x < 0) || (pos.y < 0)) { entity = GetLeader(); if (entity == NULL) { @@ -4164,7 +4164,7 @@ void JirachiWish(void) sub_803E708(10,0x46); DisplayDungeonDialogue(&gUnknown_8105D9C); sub_803E708(10,0x46); - gDungeon->unk674 = 1; + gDungeon->unk644.unk30 = 1; } break; } diff --git a/src/dungeon_engine.c b/src/dungeon_engine.c index 572789b5d..d90461c5b 100644 --- a/src/dungeon_engine.c +++ b/src/dungeon_engine.c @@ -52,7 +52,7 @@ bool8 IsCurrentFixedRoomBossFight() bool8 IsMakuhitaTrainingMaze(void) { - if( (u8)(gDungeon->dungeonLocation.id - DUNGEON_NORMAL_MAZE_2) < NUM_DUNGEON_MAZE) + if( (u8)(gDungeon->unk644.dungeonLocation.id - DUNGEON_NORMAL_MAZE_2) < NUM_DUNGEON_MAZE) return TRUE; else return FALSE; @@ -79,9 +79,9 @@ void RunFractionalTurn(bool8 param_1) sub_8044820(); if (!sub_8044B28()) { sub_8044AB4(); - gDungeon->fractionalTurn++; - if (gDungeon->fractionalTurn == 24) { - gDungeon->fractionalTurn = 0; + gDungeon->unk644.fractionalTurn++; + if (gDungeon->unk644.fractionalTurn == 24) { + gDungeon->unk644.fractionalTurn = 0; } } } @@ -105,7 +105,7 @@ static bool8 xxx_dungeon_80442D0(bool8 param_1) { TriggerWeatherAbilities(); movSpeed = CalcSpeedStage(entity); - if (gSpeedTurns[movSpeed][gDungeon->fractionalTurn] == 0) { + if (gSpeedTurns[movSpeed][gDungeon->unk644.fractionalTurn] == 0) { return FALSE; } else @@ -123,8 +123,8 @@ static bool8 xxx_dungeon_80442D0(bool8 param_1) else { if ((UseAttack(0) == 0) && - ((gDungeon->unk66C != 0 || - (gDungeon->unk673 != 0)))) { + ((gDungeon->unk644.unk28 != 0 || + (gDungeon->unk644.unk2F != 0)))) { sub_803E46C(0xc); } GetEntInfo(entity)->speedStageChanged = FALSE; @@ -161,7 +161,7 @@ static bool8 xxx_dungeon_80442D0(bool8 param_1) } else { if (!GetEntInfo(entity)->speedStageChanged) break; - gDungeon->fractionalTurn = 0; + gDungeon->unk644.fractionalTurn = 0; } } } diff --git a/src/dungeon_items.c b/src/dungeon_items.c index 35f307da5..27a7cb2bb 100644 --- a/src/dungeon_items.c +++ b/src/dungeon_items.c @@ -83,7 +83,7 @@ void sub_8046D20(void) u8 sub_8046D70(void) { - if(gDungeon->unk68A) + if(gDungeon->unk644.unk46) return 0; else return 0; diff --git a/src/dungeon_message.c b/src/dungeon_message.c index 3d331311b..718378551 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -698,7 +698,7 @@ void TryDisplayGeneralTutorialMessage(void) if (DislayTutorialMsg(leader, &gUnknown_80FF020, TRUE)) return; if (DislayTutorialMsg(leader, &gUnknown_80FF080, TRUE)) return; if (DislayTutorialMsg(leader, &gUnknown_80FF0D8, TRUE)) return; - if (gDungeon->dungeonLocation.id == DUNGEON_THUNDERWAVE_CAVE) { + if (gDungeon->unk644.dungeonLocation.id == DUNGEON_THUNDERWAVE_CAVE) { if (DislayTutorialMsg(leader, &gUnknown_80FF13C, TRUE)) return; if (DislayTutorialMsg(leader, &gUnknown_80FF1B4, TRUE)) return; if (DislayTutorialMsg(leader, &gMovementTutorial, TRUE)) return; @@ -834,11 +834,11 @@ void sub_8052FB8(const u8 *str) const u8 *GetCurrentDungeonName(void) { - if (gDungeon->unk678 == 1) { + if (gDungeon->unk644.unk34 == 1) { return GetDungeonName1(DUNGEON_OUT_ON_RESCUE); } else { - return GetDungeonName1(gDungeon->dungeonLocation.id); + return GetDungeonName1(gDungeon->unk644.dungeonLocation.id); } } diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 5a828de6b..59976e5db 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -1690,7 +1690,7 @@ static s32 TryHitTarget(Entity *attacker, Entity *target, Move *move, struct Dam bool32 isFalseSwipe = (move->id == MOVE_FALSE_SWIPE); if (HasAbility(target, ABILITY_ILLUMINATE)) { - gDungeon->unk662 = 999; + gDungeon->unk644.unk1E = 999; gDungeon->unk17B34 = target; gDungeon->unk17B40 = target->spawnGenID; } diff --git a/src/dungeon_movement.c b/src/dungeon_movement.c index 9a199d3ad..c72b6951d 100644 --- a/src/dungeon_movement.c +++ b/src/dungeon_movement.c @@ -330,7 +330,7 @@ s32 CalcSpeedStage(Entity *pokemon) speed++; } if ((entityInfo->id == MONSTER_KECLEON) && entityInfo->isNotTeamMember && - gDungeon->unk66E) { + gDungeon->unk644.unk2A) { speed++; } if (speed < 0) { diff --git a/src/dungeon_music.c b/src/dungeon_music.c index 2ddedd72b..7a55256cf 100644 --- a/src/dungeon_music.c +++ b/src/dungeon_music.c @@ -62,7 +62,7 @@ void sub_8083AB0(s16 param_0, Entity * target, Entity * entity) temp->spAtk = entityInfo->atk[1]; temp->def = entityInfo->def[0]; temp->spDef = entityInfo->def[1]; - temp->dungeonLocation = gDungeon->dungeonLocation; + temp->dungeonLocation = gDungeon->unk644.dungeonLocation; attackPtr = &temp->attBoost; *attackPtr = 0; spAttPtr = &temp->spAttBoost; @@ -128,8 +128,8 @@ bool8 sub_8083C88(u8 param_1) temp = &gDungeon->unk1CE98; - if ((!HasCheckpoint(gDungeon->dungeonLocation.id) && - ((gDungeon->unk65C != 0) || (param_1 != 0))) || + if ((!HasCheckpoint(gDungeon->unk644.dungeonLocation.id) && + ((gDungeon->unk644.unk18 != 0) || (param_1 != 0))) || (temp->moveID != 0x227)) { return TRUE; } @@ -188,19 +188,19 @@ void sub_8083D88(void) void PlayDungeonFailBGM(void) { DungeonStartNewBGM(MUS_DUNGEON_FAIL); - gDungeon->unk66F = 0; - gDungeon->monsterHouseTriggeredEvent = FALSE; - gDungeon->unk699 = 0; - gDungeon->bossSongIndex = STOP_BGM; + gDungeon->unk644.unk2B = 0; + gDungeon->unk644.monsterHouseTriggeredEvent = FALSE; + gDungeon->unk644.unk55 = 0; + gDungeon->unk644.bossSongIndex = STOP_BGM; } void PlayDungeonCompleteBGM(void) { DungeonStartNewBGM(MUS_DUNGEON_COMPLETE); - gDungeon->unk66F = 0; - gDungeon->monsterHouseTriggeredEvent = FALSE; - gDungeon->unk699 = 0; - gDungeon->bossSongIndex = STOP_BGM; + gDungeon->unk644.unk2B = 0; + gDungeon->unk644.monsterHouseTriggeredEvent = FALSE; + gDungeon->unk644.unk55 = 0; + gDungeon->unk644.bossSongIndex = STOP_BGM; } void sub_8083E28(void) @@ -282,16 +282,16 @@ void UpdateDungeonMusic(void) musPlayer = &gDungeon->musPlayer; - bossSongIndex = &gDungeon->bossSongIndex; + bossSongIndex = &gDungeon->unk644.bossSongIndex; newSongIndex = *bossSongIndex; if (newSongIndex == STOP_BGM) { - if (gDungeon->unk66F != 0) { + if (gDungeon->unk644.unk2B != 0) { newSongIndex = MUS_STOP_THIEF; } - else if (gDungeon->monsterHouseTriggeredEvent) { + else if (gDungeon->unk644.monsterHouseTriggeredEvent) { newSongIndex = MUS_MONSTER_HOUSE; } - else if (gDungeon->unk699 != 0) { + else if (gDungeon->unk644.unk55 != 0) { newSongIndex = MUS_KECLEON_SHOP; } else { diff --git a/src/status_actions.c b/src/status_actions.c index 03f4418f8..2a1fb4171 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -922,7 +922,7 @@ bool8 sub_805BEC8(Entity * pokemon, Entity * target, Move *move, s32 param_4) bool8 EscapeOrbAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); - if (gDungeon->unk66E != 0) { + if (gDungeon->unk644.unk2A != 0) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD4DC); // $m0 can't escape! } else { diff --git a/src/trap_1.c b/src/trap_1.c index 42e8a4692..63a8161d6 100644 --- a/src/trap_1.c +++ b/src/trap_1.c @@ -173,7 +173,7 @@ void WriteDungeonState(u8 *buffer, u32 bufLen) void sub_8080B90(DataSerializer *param_1) { Write8Bytes(param_1, gMisakiSan); - WriteBytes(param_1, &gDungeon->dungeonLocation, 0x58); + WriteBytes(param_1, &gDungeon->unk644, sizeof(unkDungeon644)); } void WriteDungeonItems(DataSerializer *param_1) @@ -826,7 +826,7 @@ void ReadDungeonState(u8 *buffer, u32 bufLen) void sub_8081C50(DataSerializer *r0) { sub_8083018(r0, gMisakiSan); - ReadBytes(r0, &gDungeon->dungeonLocation, 0x58); + ReadBytes(r0, &gDungeon->unk644, sizeof(unkDungeon644)); } void sub_8081C7C(DataSerializer *r0) From 30194203182a3224fdd14fa6baecec82beab7550 Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Sun, 10 Nov 2024 17:07:35 +0100 Subject: [PATCH 20/48] charmap --- charmap.txt | 264 +++++++++-- src/data/iq_skill_list_menu.h | 4 +- src/data/pokemon_mail.h | 870 +++++++++------------------------- src/data/pokemon_mail_pre.h | 4 +- 4 files changed, 449 insertions(+), 693 deletions(-) diff --git a/charmap.txt b/charmap.txt index b0918f42d..bff098f11 100644 --- a/charmap.txt +++ b/charmap.txt @@ -221,61 +221,259 @@ @ Shift JIS ' ' = 81 40 +'ă€' = 81 41 +'。' = 81 42 +',' = 81 43 +'.' = 81 44 +'ă»' = 81 45 +':' = 81 46 +';' = 81 47 '?' = 81 48 +'ďĽ' = 81 49 'ă‚›' = 81 4A '゜' = 81 4B +'ăĽ' = 81 5B +'/' = 81 5E '〜' = 81 60 -'♪' = 81 F4 -'A' = 82 60 -'B' = 82 61 -'C' = 82 62 -'ă†' = 82 A4 -'ă‹' = 82 A9 -'ăŚ' = 82 AA -'ă—' = 82 B5 -'ă™' = 82 B7 -'ăŞ' = 82 C8 -'ă«' = 82 C9 -'ă‚‚' = 82 CC -'ăż' = 82 DC -'ăľ' = 82 DD -'ă®' = 82 E0 -'ă‚' = 82 E6 -'ă‚‹' = 82 E9 -'ă‚’' = 82 F0 -'ă‚“' = 82 F1 -'ă‚«' = 83 4A -'ăŠ' = 83 69 - -UNK_ICON_81_69 = 81 69 -UNK_ICON_81_6A = 81 6A -RIGHT_ARROW = 81 A8 -LEFT_ARROW = 81 A9 -UP_ARROW = 81 AA +'…' = 81 63 +'‥' = 81 64 +@'’' = 81 66 - same char as 92 +@'“' = 81 67 - same char as ~93 +@'”' = 81 68 - same char as ~94 +'ďĽ' = 81 69 +')' = 81 6A +'「' = 81 75 +'」' = 81 76 +'『' = 81 77 +'』' = 81 78 +'+' = 81 7B +'â’' = 81 7C +@'Ă—' = 81 7E - same char as D7 +'=' = 81 81 +'<' = 81 83 +'>' = 81 84 +'âž' = 81 87 +@'♂' = 81 89 - same char as BD +@'♀' = 81 8A - same char as BE +'$' = 81 90 +'%' = 81 93 +'ďĽ' = 81 94 +'&' = 81 95 +'*' = 81 96 +'@' = 81 97 +'â—‹' = 81 9B '→' = 81 A8 'â†' = 81 A9 '↑' = 81 AA '↓' = 81 AB +'♪' = 81 F4 +@ Inverted font block +'ďĽ' = 82 4F +'1' = 82 50 +'2' = 82 51 +'3' = 82 52 +'4' = 82 53 +'5' = 82 54 +'6' = 82 55 +'7' = 82 56 +'ďĽ' = 82 57 +'9' = 82 58 + +'A' = 82 60 @ Not standard shift-jis +'B' = 82 61 +'C' = 82 62 + +'ă‚' = 82 A0 +'ă„' = 82 A2 +'ă†' = 82 A4 +'ă' = 82 A6 +'ăŠ' = 82 A8 +'ă‹' = 82 A9 +'ăŚ' = 82 AA +'ăŤ' = 82 AB +'ăŽ' = 82 AC +'ăŹ' = 82 AD +'ă' = 82 AE +'ă‘' = 82 AF +'ă’' = 82 B0 +'ă“' = 82 B1 +'ă”' = 82 B2 +'ă•' = 82 B3 +'ă–' = 82 B4 +'ă—' = 82 B5 +'ă' = 82 B6 +'ă™' = 82 B7 +'ăš' = 82 B8 +'ă›' = 82 B9 +'ăś' = 82 BA +'ăť' = 82 BB +'ăž' = 82 BC +'ăź' = 82 BD +'ă ' = 82 BE +'ăˇ' = 82 BF +'ă˘' = 82 C0 +'ă¤' = 82 C2 +'ăĄ' = 82 C3 +'ă¦' = 82 C4 +'ă§' = 82 C5 +'ă¨' = 82 C6 +'ă©' = 82 C7 +'ăŞ' = 82 C8 +'ă«' = 82 C9 +'ă¬' = 82 CA +'ă­' = 82 CB +'ă®' = 82 CC +'ăŻ' = 82 CD +'ă°' = 82 CE +'ă±' = 82 CF +'ă˛' = 82 D0 +'ăł' = 82 D1 +'ă´' = 82 D2 +'ăµ' = 82 D3 +'ă¶' = 82 D4 +'ă·' = 82 D5 +'ă¸' = 82 D6 +'ăą' = 82 D7 +'ăş' = 82 D8 +'ă»' = 82 D9 +'ăĽ' = 82 DA +'ă˝' = 82 DB +'ăľ' = 82 DC +'ăż' = 82 DD +'ă‚€' = 82 DE +'ă‚' = 82 DF +'ă‚‚' = 82 E0 +'ă‚„' = 82 E2 +'ゆ' = 82 E4 +'ă‚' = 82 E6 +'ら' = 82 E7 +'り' = 82 E8 +'ă‚‹' = 82 E9 +'れ' = 82 EA +'ろ' = 82 EB +'わ' = 82 ED +'ă‚’' = 82 F0 +'ă‚“' = 82 F1 +'ア' = 83 41 +'イ' = 83 43 +'ウ' = 83 45 +'エ' = 83 47 +'オ' = 83 49 +'ă‚«' = 83 4A +'ガ' = 83 4B +'ă‚­' = 83 4C +'ă‚®' = 83 4D +'ク' = 83 4E +'ă‚°' = 83 4F +'ケ' = 83 50 +'ゲ' = 83 51 +'コ' = 83 52 +'ă‚´' = 83 53 +'サ' = 83 54 +'ă‚¶' = 83 55 +'ă‚·' = 83 56 +'ジ' = 83 57 +'ス' = 83 58 +'ズ' = 83 59 +'ă‚»' = 83 5A +'ゼ' = 83 5B +'ă‚˝' = 83 5C +'ゾ' = 83 5D +'タ' = 83 5E +'ă€' = 83 5F +'ă' = 83 60 +'ă‚' = 83 61 +'ă' = 83 62 +'ă„' = 83 63 +'ă…' = 83 64 +'ă†' = 83 65 +'ă‡' = 83 66 +'ă' = 83 67 +'ă‰' = 83 68 +'ăŠ' = 83 69 +'ă‹' = 83 6A +'ăŚ' = 83 6B +'ăŤ' = 83 6C +'ăŽ' = 83 6D +'ăŹ' = 83 6E +'ă' = 83 6F +'ă‘' = 83 70 +'ă’' = 83 71 +'ă“' = 83 72 +'ă”' = 83 73 +'ă•' = 83 74 +'ă–' = 83 75 +'ă—' = 83 76 +'ă' = 83 77 +'ă™' = 83 78 +'ăš' = 83 79 +'ă›' = 83 7A +'ăś' = 83 7B +'ăť' = 83 7C +'ăž' = 83 7D +'ăź' = 83 7E +'ă ' = 83 80 +'ăˇ' = 83 81 +'ă˘' = 83 82 +'ă¤' = 83 84 +'ă¦' = 83 86 +'ă¨' = 83 88 +'ă©' = 83 89 +'ăŞ' = 83 8A +'ă«' = 83 8B +'ă¬' = 83 8C +'ă­' = 83 8D +'ăŻ' = 83 8F +'ă˛' = 83 92 +'ăł' = 83 93 +@'Α' = 83 9F @ inverted narrow fixedwidth 0-9 +@'Î’' = 83 A0 +@'Γ' = 83 A1 +@'Δ' = 83 A2 +@'Ε' = 83 A3 +@'Ζ' = 83 A4 +@'Η' = 83 A5 +@'Î' = 83 A6 +@'Ι' = 83 A7 +@'Κ' = 83 A8 +@ Symbol block, replaces greek +@'α' = 83 BF @ Po +@'β' = 83 C0 @ Opened mail +@'Îł' = 83 C1 @ ? +@'δ' = 83 C2 @ Go +@'ε' = 83 C3 @ News +@'ζ' = 83 C4 @ Ke +@'η' = 83 C5 @ White dash? +@'θ' = 83 C6 @ X button +@'Îą' = 83 C7 @ Y button +'Îş' = 83 C8 @ Kappa wasn't replaced :P POKE = 83 BF 83 C4 @ This is actually two characters which can render separately; may need to be split eventually. -UNK_ICON_83_C0 = 83 C0 -UNK_ICON_83_C1 = 83 C1 -UNK_ICON_83_C2 = 83 C2 -UNK_ICON_83_C3 = 83 C3 +ENVELOPE_OPEN = 83 C0 +THANK_YOU_MAIL = 83 C1 +ICON_GO = 83 C2 +ICON_NEWS = 83 C3 NDS_Y_BUTTON = 83 C7 R_BUTTON = 84 86 -UNK_ICON_84_87 = 84 87 +ENVELOPE_CLOSED = 84 87 -UNK_ICON_40 = 87 40 +ICON_BLANK = 87 40 +@ = 87 41 @ E STAR_BULLET = 87 42 +@ = 87 43 @ Star with E +ICON_STICKY = 87 44 SPEECH_BUBBLE = 87 45 +@ 87 46..49 - red hearts +@ 87 4a..4d - yellow hearts - appears in team list TM = 87 4E ORB = 87 4F A_BUTTON = 87 50 B_BUTTON = 87 51 DPAD = 87 52 START_BUTTON = 87 53 87 71 +@ 87 54 placeholder, some kanji character +@ 87 5F ????? SELECT_BUTTON = 87 72 87 73 L_BUTTON = 87 74 diff --git a/src/data/iq_skill_list_menu.h b/src/data/iq_skill_list_menu.h index a3182b376..0ea4a139c 100644 --- a/src/data/iq_skill_list_menu.h +++ b/src/data/iq_skill_list_menu.h @@ -18,5 +18,5 @@ static const UnkTextStruct2 sUnknown_80DBDF0 = { ALIGNED(4) static const u8 sIQSkills[] = _("IQ Skills"); ALIGNED(4) static const u8 sStarBullet[] = _("{STAR_BULLET}"); -ALIGNED(4) static const u8 sUnknown_80DBE18[] = _("{UNK_ICON_40}"); -ALIGNED(4) static const u8 sFmt01[] = _("{MOVE_ITEM_0}{MOVE_ITEM_1}"); \ No newline at end of file +ALIGNED(4) static const u8 sUnknown_80DBE18[] = _("{ICON_BLANK}"); +ALIGNED(4) static const u8 sFmt01[] = _("{MOVE_ITEM_0}{MOVE_ITEM_1}"); diff --git a/src/data/pokemon_mail.h b/src/data/pokemon_mail.h index 0634bf717..7f6814d4c 100644 --- a/src/data/pokemon_mail.h +++ b/src/data/pokemon_mail.h @@ -1,428 +1,164 @@ -// TODO: Find a way to #define the text and insert them in arrays without declarations - -static const u8 sUnknown_80E8BB0[]; -static const u8 sUnknown_80E8BB4[]; -static const u8 sUnknown_80E8BB8[]; -static const u8 sUnknown_80E8BBC[]; -static const u8 sUnknown_80E8BC0[]; -static const u8 sUnknown_80E8BC4[]; -static const u8 sUnknown_80E8BC8[]; - static const u8 * const sUnknown_80E8B94[7] = { - sUnknown_80E8BC8, - sUnknown_80E8BC4, - sUnknown_80E8BC0, - sUnknown_80E8BBC, - sUnknown_80E8BB8, - sUnknown_80E8BB4, - sUnknown_80E8BB0 + _(" "), + _("{ENVELOPE_CLOSED}"), + _("{ICON_BLANK}"), + _("{ENVELOPE_OPEN}"), + _("{THANK_YOU_MAIL}"), + _("{ICON_GO}"), + _("{ICON_NEWS}"), }; -ALIGNED(4) static const u8 sUnknown_80E8BB0[] = _("{UNK_ICON_83_C3}"); -ALIGNED(4) static const u8 sUnknown_80E8BB4[] = _("{UNK_ICON_83_C2}"); -ALIGNED(4) static const u8 sUnknown_80E8BB8[] = _("{UNK_ICON_83_C1}"); -ALIGNED(4) static const u8 sUnknown_80E8BBC[] = _("{UNK_ICON_83_C0}"); -ALIGNED(4) static const u8 sUnknown_80E8BC0[] = _("{UNK_ICON_40}"); -ALIGNED(4) static const u8 sUnknown_80E8BC4[] = _("{UNK_ICON_84_87}"); -ALIGNED(4) static const u8 sUnknown_80E8BC8[] = _(" "); - static const u8 * const sUnknown_80E8BCC[4] = { - sUnknown_80E8BC8, - "Suspend", - "Take Job", - "Done" + _(" "), + _("Suspend"), + _("Take Job"), + _("Done"), }; -static const u8 sUnknown_80E8C14[]; -static const u8 sUnknown_80E8C18[]; -static const u8 sUnknown_80E8C20[]; -static const u8 sUnknown_80E8C28[]; -static const u8 sUnknown_80E8C30[]; -static const u8 sUnknown_80E8C38[]; -static const u8 sUnknown_80E8C40[]; - // Used in sub_803C1F0 for some reason const u8 * const gUnknown_80E8BF8[7] = { - sUnknown_80E8C40, - sUnknown_80E8C38, - sUnknown_80E8C30, - sUnknown_80E8C28, - sUnknown_80E8C20, - sUnknown_80E8C18, - sUnknown_80E8C14 + _("{COLOR DEFAULT}E{RESET}"), + _("{COLOR GREEN}D{RESET}"), + _("{COLOR GREEN}C{RESET}"), + _("{COLOR CYAN}B{RESET}"), + _("{COLOR CYAN}A{RESET}"), + _("{COLOR RED}S{RESET}"), + _("{STAR_BULLET}"), }; -ALIGNED(4) static const u8 sUnknown_80E8C14[] = _("{STAR_BULLET}"); -ALIGNED(4) static const u8 sUnknown_80E8C18[] = _("{COLOR RED}S{RESET}"); -ALIGNED(4) static const u8 sUnknown_80E8C20[] = _("{COLOR CYAN}A{RESET}"); -ALIGNED(4) static const u8 sUnknown_80E8C28[] = _("{COLOR CYAN}B{RESET}"); -ALIGNED(4) static const u8 sUnknown_80E8C30[] = _("{COLOR GREEN}C{RESET}"); -ALIGNED(4) static const u8 sUnknown_80E8C38[] = _("{COLOR GREEN}D{RESET}"); -ALIGNED(4) static const u8 sUnknown_80E8C40[] = _("{COLOR DEFAULT}E{RESET}"); - -static const u8 sUnknown_80E8C60[]; -static const u8 sUnknown_80E8C64[]; -static const u8 sUnknown_80E8C70[]; -static const u8 sUnknown_80E8C7C[]; -static const u8 sUnknown_80E8C84[]; -static const u8 sUnknown_80E8C90[]; - static const u8 * const gMissionRewardText[6] = { - sUnknown_80E8C90, - sUnknown_80E8C84, - sUnknown_80E8C7C, - sUnknown_80E8C70, - sUnknown_80E8C64, - sUnknown_80E8C60 + _("%d {POKE}"), + _("%d {POKE} + ?"), + _("{COLOR GREEN}%s{RESET}"), + _("{COLOR GREEN}%s{RESET} + ?"), + _("Friend Area"), + _("???"), }; -ALIGNED(4) static const u8 sUnknown_80E8C60[] = _("???"); -ALIGNED(4) static const u8 sUnknown_80E8C64[] = _("Friend Area"); -ALIGNED(4) static const u8 sUnknown_80E8C70[] = _("{COLOR GREEN}%s{RESET} + ?"); -ALIGNED(4) static const u8 sUnknown_80E8C7C[] = _("{COLOR GREEN}%s{RESET}"); -ALIGNED(4) static const u8 sUnknown_80E8C84[] = _("%d {POKE} + ?"); -ALIGNED(4) static const u8 sUnknown_80E8C90[] = _("%d {POKE}"); - -static const u8 sUnknown_80E8CD4[]; -static const u8 sUnknown_80E8CE0[]; -static const u8 sUnknown_80E8CF4[]; -static const u8 sUnknown_80E8D0C[]; -static const u8 sUnknown_80E8D18[]; -static const u8 sUnknown_80E8D28[]; -static const u8 sUnknown_80E8D44[]; -static const u8 sUnknown_80E8D5C[]; -static const u8 sUnknown_80E8D6C[]; -static const u8 sUnknown_80E8D7C[]; -static const u8 sUnknown_80E8D88[]; -static const u8 sUnknown_80E8DA4[]; -static const u8 sUnknown_80E8DB4[]; -static const u8 sUnknown_80E8DC8[]; -static const u8 sUnknown_80E8DDC[]; - static const u8 * const gUnknown_80E8C98[15] = { - sUnknown_80E8DDC, - sUnknown_80E8DC8, - sUnknown_80E8DB4, - sUnknown_80E8DA4, - sUnknown_80E8D88, - sUnknown_80E8D7C, - sUnknown_80E8D6C, - sUnknown_80E8D5C, - sUnknown_80E8D44, - sUnknown_80E8D28, - sUnknown_80E8D18, - sUnknown_80E8D0C, - sUnknown_80E8CF4, - sUnknown_80E8CE0, - sUnknown_80E8CD4 + _("Help!"), + _("I can't get out!"), + _("I'm in trouble..."), + _("I'm scared!"), + _("I can't seem to get out."), + _("I'm lost."), + _("I was attacked!"), + _("I fainted..."), + _("I'm not a fighter..."), + _("I'm too tired to move."), + _("I was KO'd..."), + _("Where am I?"), + _("I'm sad and lonely."), + _("I can't get home!"), + _("Help me!"), }; -ALIGNED(4) static const u8 sUnknown_80E8CD4[] = _("Help me!"); -ALIGNED(4) static const u8 sUnknown_80E8CE0[] = _("I can't get home!"); -ALIGNED(4) static const u8 sUnknown_80E8CF4[] = _("I'm sad and lonely."); -ALIGNED(4) static const u8 sUnknown_80E8D0C[] = _("Where am I?"); -ALIGNED(4) static const u8 sUnknown_80E8D18[] = _("I was KO'd..."); -ALIGNED(4) static const u8 sUnknown_80E8D28[] = _("I'm too tired to move."); -ALIGNED(4) static const u8 sUnknown_80E8D44[] = _("I'm not a fighter..."); -ALIGNED(4) static const u8 sUnknown_80E8D5C[] = _("I fainted..."); -ALIGNED(4) static const u8 sUnknown_80E8D6C[] = _("I was attacked!"); -ALIGNED(4) static const u8 sUnknown_80E8D7C[] = _("I'm lost."); -ALIGNED(4) static const u8 sUnknown_80E8D88[] = _("I can't seem to get out."); -ALIGNED(4) static const u8 sUnknown_80E8DA4[] = _("I'm scared!"); -ALIGNED(4) static const u8 sUnknown_80E8DB4[] = _("I'm in trouble..."); -ALIGNED(4) static const u8 sUnknown_80E8DC8[] = _("I can't get out!"); -ALIGNED(4) static const u8 sUnknown_80E8DDC[] = _("Help!"); - -static const u8 sUnknown_80E8E18[]; -static const u8 sUnknown_80E8E2C[]; -static const u8 sUnknown_80E8E4C[]; -static const u8 sUnknown_80E8E6C[]; -static const u8 sUnknown_80E8E80[]; -static const u8 sUnknown_80E8E98[]; -static const u8 sUnknown_80E8EB4[]; -static const u8 sUnknown_80E8ED0[]; -static const u8 sUnknown_80E8EF8[]; -static const u8 sUnknown_80E8F10[]; -static const u8 sUnknown_80E8F2C[]; -static const u8 sUnknown_80E8F50[]; -static const u8 sUnknown_80E8F7C[]; - static const u8 * const gUnknown_80E8DE4[13] = { - sUnknown_80E8F7C, - sUnknown_80E8F50, - sUnknown_80E8F2C, - sUnknown_80E8F10, - sUnknown_80E8EF8, - sUnknown_80E8ED0, - sUnknown_80E8EB4, - sUnknown_80E8E98, - sUnknown_80E8E80, - sUnknown_80E8E6C, - sUnknown_80E8E4C, - sUnknown_80E8E2C, - sUnknown_80E8E18 + _("I don't know how I did it, but I can't exit!"), + _("I was attacked when I was sitting still!"), + _("I'm simply no good at fighting."), + _("I got lost in this dungeon!"), + _("This dungeon is scary!"), + _("Fighting the tough foe was a mistake..."), + _("I've reached my limit..."), + _("I'm close to fainting..."), + _("I lost in a battle..."), + _("I was done in..."), + _("Whoa! It's too rough here..."), + _("I can't move another step."), + _("I'm famished..."), }; -ALIGNED(4) static const u8 sUnknown_80E8E18[] = _("I'm famished..."); -ALIGNED(4) static const u8 sUnknown_80E8E2C[] = _("I can't move another step."); -ALIGNED(4) static const u8 sUnknown_80E8E4C[] = _("Whoa! It's too rough here..."); -ALIGNED(4) static const u8 sUnknown_80E8E6C[] = _("I was done in..."); -ALIGNED(4) static const u8 sUnknown_80E8E80[] = _("I lost in a battle..."); -ALIGNED(4) static const u8 sUnknown_80E8E98[] = _("I'm close to fainting..."); -ALIGNED(4) static const u8 sUnknown_80E8EB4[] = _("I've reached my limit..."); -ALIGNED(4) static const u8 sUnknown_80E8ED0[] = _("Fighting the tough foe was a mistake..."); -ALIGNED(4) static const u8 sUnknown_80E8EF8[] = _("This dungeon is scary!"); -ALIGNED(4) static const u8 sUnknown_80E8F10[] = _("I got lost in this dungeon!"); -ALIGNED(4) static const u8 sUnknown_80E8F2C[] = _("I'm simply no good at fighting."); -ALIGNED(4) static const u8 sUnknown_80E8F50[] = _("I was attacked when I was sitting still!"); -ALIGNED(4) static const u8 sUnknown_80E8F7C[] = _("I don't know how I did it, but I can't exit!"); - -static const u8 sUnknown_80E8FE4[]; -static const u8 sUnknown_80E8FF4[]; -static const u8 sUnknown_80E900C[]; -static const u8 sUnknown_80E9024[]; -static const u8 sUnknown_80E903C[]; -static const u8 sUnknown_80E9064[]; -static const u8 sUnknown_80E907C[]; -static const u8 sUnknown_80E9090[]; -static const u8 sUnknown_80E90B4[]; -static const u8 sUnknown_80E90D4[]; -static const u8 sUnknown_80E90E8[]; -static const u8 sUnknown_80E90F4[]; - static const u8 * const gUnknown_80E8FB0[13] = { - sUnknown_80E90F4, - sUnknown_80E90E8, - sUnknown_80E90D4, - sUnknown_80E90B4, - sUnknown_80E9090, - sUnknown_80E907C, - sUnknown_80E9064, - sUnknown_80E903C, - sUnknown_80E9024, - sUnknown_80E900C, - sUnknown_80E8DDC, - sUnknown_80E8FF4, - sUnknown_80E8FE4 + _("Please, I need help!"), + _("Someone!"), + _("Someone, help!"), + _("I feel faint... Please help..."), + _("Why? Why is everyone attacking me?"), + _("Where am I? Help!"), + _("Wroooooaaar! Someone!"), + _("My consciousness is slipping... Help..."), + _("Rescue is requested!"), + _("Someone, please help!"), + _("Help!"), + _("...Gasp! Waaaaaaaah!"), + _("Aiyeeeeeeeeh!"), }; -ALIGNED(4) static const u8 sUnknown_80E8FE4[] = _("Aiyeeeeeeeeh!"); -ALIGNED(4) static const u8 sUnknown_80E8FF4[] = _("...Gasp! Waaaaaaaah!"); -ALIGNED(4) static const u8 sUnknown_80E900C[] = _("Someone, please help!"); -ALIGNED(4) static const u8 sUnknown_80E9024[] = _("Rescue is requested!"); -ALIGNED(4) static const u8 sUnknown_80E903C[] = _("My consciousness is slipping... Help..."); -ALIGNED(4) static const u8 sUnknown_80E9064[] = _("Wroooooaaar! Someone!"); -ALIGNED(4) static const u8 sUnknown_80E907C[] = _("Where am I? Help!"); -ALIGNED(4) static const u8 sUnknown_80E9090[] = _("Why? Why is everyone attacking me?"); -ALIGNED(4) static const u8 sUnknown_80E90B4[] = _("I feel faint... Please help..."); -ALIGNED(4) static const u8 sUnknown_80E90D4[] = _("Someone, help!"); -ALIGNED(4) static const u8 sUnknown_80E90E8[] = _("Someone!"); -ALIGNED(4) static const u8 sUnknown_80E90F4[] = _("Please, I need help!"); - -static const u8 sUnknown_80E9134[]; -static const u8 sUnknown_80E9144[]; -static const u8 sUnknown_80E914C[]; -static const u8 sUnknown_80E9160[]; -static const u8 sUnknown_80E9170[]; -static const u8 sUnknown_80E917C[]; -static const u8 sUnknown_80E9190[]; -static const u8 sUnknown_80E91A8[]; -static const u8 sUnknown_80E91BC[]; - static const u8 * const gUnknown_80E910C[10] = { - sUnknown_80E91BC, - sUnknown_80E91A8, - sUnknown_80E9190, - sUnknown_80E917C, - sUnknown_80E8DDC, - sUnknown_80E9170, - sUnknown_80E9160, - sUnknown_80E914C, - sUnknown_80E9144, - sUnknown_80E9134 + _("Please help {COLOR YELLOW}%s{RESET}!"), + _("{COLOR YELLOW}%s{RESET} needs help!"), + _("Hurry, save {COLOR YELLOW}%s{RESET}!"), + _("Failed to return."), + _("Help!"), + _("Somebody!"), + _("I'm worried."), + _("Hasn't come back."), + _("Hurry!"), + _("Disappearance!"), }; -ALIGNED(4) static const u8 sUnknown_80E9134[] = _("Disappearance!"); -ALIGNED(4) static const u8 sUnknown_80E9144[] = _("Hurry!"); -ALIGNED(4) static const u8 sUnknown_80E914C[] = _("Hasn't come back."); -ALIGNED(4) static const u8 sUnknown_80E9160[] = _("I'm worried."); -ALIGNED(4) static const u8 sUnknown_80E9170[] = _("Somebody!"); -ALIGNED(4) static const u8 sUnknown_80E917C[] = _("Failed to return."); -ALIGNED(4) static const u8 sUnknown_80E9190[] = _("Hurry, save {COLOR YELLOW}%s{RESET}!"); -ALIGNED(4) static const u8 sUnknown_80E91A8[] = _("{COLOR YELLOW}%s{RESET} needs help!"); -ALIGNED(4) static const u8 sUnknown_80E91BC[] = _("Please help {COLOR YELLOW}%s{RESET}!"); - -static const u8 sUnknown_80E9288[]; -static const u8 sUnknown_80E92A4[]; -static const u8 sUnknown_80E92C4[]; -static const u8 sUnknown_80E92E0[]; -static const u8 sUnknown_80E9300[]; -static const u8 sUnknown_80E9328[]; -static const u8 sUnknown_80E9344[]; -static const u8 sUnknown_80E9358[]; -static const u8 sUnknown_80E9378[]; -static const u8 sUnknown_80E9394[]; -static const u8 sUnknown_80E93B8[]; -static const u8 sUnknown_80E93E0[]; -static const u8 sUnknown_80E9400[]; -static const u8 sUnknown_80E9420[]; -static const u8 sUnknown_80E9440[]; -static const u8 sUnknown_80E9460[]; -static const u8 sUnknown_80E9480[]; -static const u8 sUnknown_80E94A0[]; -static const u8 sUnknown_80E94C0[]; -static const u8 sUnknown_80E94E0[]; -static const u8 sUnknown_80E94FC[]; -static const u8 sUnknown_80E951C[]; -static const u8 sUnknown_80E9538[]; -static const u8 sUnknown_80E955C[]; -static const u8 sUnknown_80E9588[]; -static const u8 sUnknown_80E95AC[]; -static const u8 sUnknown_80E95C8[]; -static const u8 sUnknown_80E95EC[]; -static const u8 sUnknown_80E9608[]; -static const u8 sUnknown_80E9628[]; -static const u8 sUnknown_80E9650[]; -static const u8 sUnknown_80E9668[]; -static const u8 sUnknown_80E9688[]; -static const u8 sUnknown_80E96A8[]; -static const u8 sUnknown_80E96C4[]; -static const u8 sUnknown_80E96E4[]; -static const u8 sUnknown_80E9708[]; -static const u8 sUnknown_80E9728[]; -static const u8 sUnknown_80E9748[]; -static const u8 sUnknown_80E976C[]; -static const u8 sUnknown_80E9788[]; -static const u8 sUnknown_80E97A0[]; -static const u8 sUnknown_80E97C4[]; -static const u8 sUnknown_80E97E0[]; -static const u8 sUnknown_80E97FC[]; - static const u8 * const gUnknown_80E91D4[45] = { - sUnknown_80E97FC, - sUnknown_80E97E0, - sUnknown_80E97C4, - sUnknown_80E97A0, - sUnknown_80E9788, - sUnknown_80E976C, - sUnknown_80E9748, - sUnknown_80E9728, - sUnknown_80E9708, - sUnknown_80E96E4, - sUnknown_80E96C4, - sUnknown_80E96A8, - sUnknown_80E9688, - sUnknown_80E9668, - sUnknown_80E9650, - sUnknown_80E9628, - sUnknown_80E9608, - sUnknown_80E95EC, - sUnknown_80E95C8, - sUnknown_80E95AC, - sUnknown_80E9588, - sUnknown_80E955C, - sUnknown_80E9538, - sUnknown_80E951C, - sUnknown_80E94FC, - sUnknown_80E94E0, - sUnknown_80E94C0, - sUnknown_80E94A0, - sUnknown_80E9480, - sUnknown_80E9460, - sUnknown_80E9440, - sUnknown_80E9420, - sUnknown_80E9400, - sUnknown_80E93E0, - sUnknown_80E93B8, - sUnknown_80E9394, - sUnknown_80E9378, - sUnknown_80E9358, - sUnknown_80E9344, - sUnknown_80E9328, - sUnknown_80E9300, - sUnknown_80E92E0, - sUnknown_80E92C4, - sUnknown_80E92A4, - sUnknown_80E9288 + _("{COLOR YELLOW}%s{RESET} passed out from the heat!"), + _("{COLOR YELLOW}%s{RESET} may be endangered!"), + _("{COLOR YELLOW}%s{RESET} is still missing."), + _("{COLOR YELLOW}%s{RESET} hasn't been heard from!"), + _("{COLOR YELLOW}%s{RESET} can't swim!"), + _("{COLOR YELLOW}%s{RESET} hasn't come back!"), + _("{COLOR YELLOW}%s{RESET} might be unable to return."), + _("{COLOR YELLOW}%s{RESET} may be facing danger!"), + _("{COLOR YELLOW}%s{RESET} appears to be injured!"), + _("{COLOR YELLOW}%s{RESET} went missing this morning!"), + _("{COLOR YELLOW}%s{RESET} is too scared to move!"), + _("{COLOR YELLOW}%s{RESET} may be confused!"), + _("{COLOR YELLOW}%s{RESET} appears to be freezing!"), + _("Trouble may have found {COLOR YELLOW}%s{RESET}!"), + _("{COLOR YELLOW}%s{RESET} was paralyzed!"), + _("{COLOR YELLOW}%s{RESET}'s whereabouts are unknown!"), + _("I'm worried about {COLOR YELLOW}%s{RESET}!"), + _("{COLOR YELLOW}%s{RESET} has been cornered!"), + _("{COLOR YELLOW}%s{RESET}'s been gone a long time!"), + _("{COLOR YELLOW}%s{RESET} is about to faint!"), + _("{COLOR YELLOW}%s{RESET} may have fainted already!"), + _("It appears as if {COLOR YELLOW}%s{RESET} can't escape!"), + _("{COLOR YELLOW}%s{RESET} was attacked by assailants!"), + _("{COLOR YELLOW}%s{RESET} hasn't reemerged!"), + _("{COLOR YELLOW}%s{RESET} appears to be helpless!"), + _("{COLOR YELLOW}%s{RESET} is stuck in a cave!"), + _("{COLOR YELLOW}%s{RESET} appears to be trapped!"), + _("Something happened to {COLOR YELLOW}%s{RESET}!"), + _("{COLOR YELLOW}%s{RESET} was attacked, maybe!"), + _("{COLOR YELLOW}%s{RESET} is running out of time!"), + _("I got separated from {COLOR YELLOW}%s{RESET}."), + _("Hurry, bring back {COLOR YELLOW}%s{RESET}."), + _("{COLOR YELLOW}%s{RESET} is too hungry to move!"), + _("{COLOR YELLOW}%s{RESET} is fighting all alone!"), + _("I'm worried for {COLOR YELLOW}%s{RESET}'s safety!"), + _("{COLOR YELLOW}%s{RESET} may have had an accident!"), + _("{COLOR YELLOW}%s{RESET} appears to be lost!"), + _("{COLOR YELLOW}%s{RESET} appears to be stuck!"), + _("{COLOR YELLOW}%s{RESET} is lost!"), + _("{COLOR YELLOW}%s{RESET} went the wrong way!"), + _("{COLOR YELLOW}%s{RESET}'s been missing three days!"), + _("{COLOR YELLOW}%s{RESET} can't walk anymore!"), + _("I can't contact {COLOR YELLOW}%s{RESET}!"), + _("I lost contact with {COLOR YELLOW}%s{RESET}!"), + _("{COLOR YELLOW}%s{RESET} fell into a trap!"), }; -ALIGNED(4) static const u8 sUnknown_80E9288[] = _("{COLOR YELLOW}%s{RESET} fell into a trap!"); -ALIGNED(4) static const u8 sUnknown_80E92A4[] = _("I lost contact with {COLOR YELLOW}%s{RESET}!"); -ALIGNED(4) static const u8 sUnknown_80E92C4[] = _("I can't contact {COLOR YELLOW}%s{RESET}!"); -ALIGNED(4) static const u8 sUnknown_80E92E0[] = _("{COLOR YELLOW}%s{RESET} can't walk anymore!"); -ALIGNED(4) static const u8 sUnknown_80E9300[] = _("{COLOR YELLOW}%s{RESET}'s been missing three days!"); -ALIGNED(4) static const u8 sUnknown_80E9328[] = _("{COLOR YELLOW}%s{RESET} went the wrong way!"); -ALIGNED(4) static const u8 sUnknown_80E9344[] = _("{COLOR YELLOW}%s{RESET} is lost!"); -ALIGNED(4) static const u8 sUnknown_80E9358[] = _("{COLOR YELLOW}%s{RESET} appears to be stuck!"); -ALIGNED(4) static const u8 sUnknown_80E9378[] = _("{COLOR YELLOW}%s{RESET} appears to be lost!"); -ALIGNED(4) static const u8 sUnknown_80E9394[] = _("{COLOR YELLOW}%s{RESET} may have had an accident!"); -ALIGNED(4) static const u8 sUnknown_80E93B8[] = _("I'm worried for {COLOR YELLOW}%s{RESET}'s safety!"); -ALIGNED(4) static const u8 sUnknown_80E93E0[] = _("{COLOR YELLOW}%s{RESET} is fighting all alone!"); -ALIGNED(4) static const u8 sUnknown_80E9400[] = _("{COLOR YELLOW}%s{RESET} is too hungry to move!"); -ALIGNED(4) static const u8 sUnknown_80E9420[] = _("Hurry, bring back {COLOR YELLOW}%s{RESET}."); -ALIGNED(4) static const u8 sUnknown_80E9440[] = _("I got separated from {COLOR YELLOW}%s{RESET}."); -ALIGNED(4) static const u8 sUnknown_80E9460[] = _("{COLOR YELLOW}%s{RESET} is running out of time!"); -ALIGNED(4) static const u8 sUnknown_80E9480[] = _("{COLOR YELLOW}%s{RESET} was attacked, maybe!"); -ALIGNED(4) static const u8 sUnknown_80E94A0[] = _("Something happened to {COLOR YELLOW}%s{RESET}!"); -ALIGNED(4) static const u8 sUnknown_80E94C0[] = _("{COLOR YELLOW}%s{RESET} appears to be trapped!"); -ALIGNED(4) static const u8 sUnknown_80E94E0[] = _("{COLOR YELLOW}%s{RESET} is stuck in a cave!"); -ALIGNED(4) static const u8 sUnknown_80E94FC[] = _("{COLOR YELLOW}%s{RESET} appears to be helpless!"); -ALIGNED(4) static const u8 sUnknown_80E951C[] = _("{COLOR YELLOW}%s{RESET} hasn't reemerged!"); -ALIGNED(4) static const u8 sUnknown_80E9538[] = _("{COLOR YELLOW}%s{RESET} was attacked by assailants!"); -ALIGNED(4) static const u8 sUnknown_80E955C[] = _("It appears as if {COLOR YELLOW}%s{RESET} can't escape!"); -ALIGNED(4) static const u8 sUnknown_80E9588[] = _("{COLOR YELLOW}%s{RESET} may have fainted already!"); -ALIGNED(4) static const u8 sUnknown_80E95AC[] = _("{COLOR YELLOW}%s{RESET} is about to faint!"); -ALIGNED(4) static const u8 sUnknown_80E95C8[] = _("{COLOR YELLOW}%s{RESET}'s been gone a long time!"); -ALIGNED(4) static const u8 sUnknown_80E95EC[] = _("{COLOR YELLOW}%s{RESET} has been cornered!"); -ALIGNED(4) static const u8 sUnknown_80E9608[] = _("I'm worried about {COLOR YELLOW}%s{RESET}!"); -ALIGNED(4) static const u8 sUnknown_80E9628[] = _("{COLOR YELLOW}%s{RESET}'s whereabouts are unknown!"); -ALIGNED(4) static const u8 sUnknown_80E9650[] = _("{COLOR YELLOW}%s{RESET} was paralyzed!"); -ALIGNED(4) static const u8 sUnknown_80E9668[] = _("Trouble may have found {COLOR YELLOW}%s{RESET}!"); -ALIGNED(4) static const u8 sUnknown_80E9688[] = _("{COLOR YELLOW}%s{RESET} appears to be freezing!"); -ALIGNED(4) static const u8 sUnknown_80E96A8[] = _("{COLOR YELLOW}%s{RESET} may be confused!"); -ALIGNED(4) static const u8 sUnknown_80E96C4[] = _("{COLOR YELLOW}%s{RESET} is too scared to move!"); -ALIGNED(4) static const u8 sUnknown_80E96E4[] = _("{COLOR YELLOW}%s{RESET} went missing this morning!"); -ALIGNED(4) static const u8 sUnknown_80E9708[] = _("{COLOR YELLOW}%s{RESET} appears to be injured!"); -ALIGNED(4) static const u8 sUnknown_80E9728[] = _("{COLOR YELLOW}%s{RESET} may be facing danger!"); -ALIGNED(4) static const u8 sUnknown_80E9748[] = _("{COLOR YELLOW}%s{RESET} might be unable to return."); -ALIGNED(4) static const u8 sUnknown_80E976C[] = _("{COLOR YELLOW}%s{RESET} hasn't come back!"); -ALIGNED(4) static const u8 sUnknown_80E9788[] = _("{COLOR YELLOW}%s{RESET} can't swim!"); -ALIGNED(4) static const u8 sUnknown_80E97A0[] = _("{COLOR YELLOW}%s{RESET} hasn't been heard from!"); -ALIGNED(4) static const u8 sUnknown_80E97C4[] = _("{COLOR YELLOW}%s{RESET} is still missing."); -ALIGNED(4) static const u8 sUnknown_80E97E0[] = _("{COLOR YELLOW}%s{RESET} may be endangered!"); -ALIGNED(4) static const u8 sUnknown_80E97FC[] = _("{COLOR YELLOW}%s{RESET} passed out from the heat!"); - -static const u8 sUnknown_80E9848[]; -static const u8 sUnknown_80E985C[]; -static const u8 sUnknown_80E987C[]; -static const u8 sUnknown_80E9898[]; -static const u8 sUnknown_80E98B4[]; -static const u8 sUnknown_80E98DC[]; -static const u8 sUnknown_80E98F0[]; -static const u8 sUnknown_80E9908[]; - static const u8 * const gUnknown_80E9820[10] = { - sUnknown_80E9908, - sUnknown_80E98F0, - sUnknown_80E98DC, - sUnknown_80E98B4, - sUnknown_80E8CD4, - sUnknown_80E9898, - sUnknown_80E90D4, - sUnknown_80E987C, - sUnknown_80E985C, - sUnknown_80E9848 + _("Please! Someone help!"), + _("Please! I need help!"), + _("Someone! Anyone?"), + _("I don't care who it is! Please help!"), + _("Help me!"), + _("I'm pleading for help!"), + _("Someone, help!"), + _("Please send a rescue team!"), + _("A rescue is urgently needed!"), + _("Reward upon rescue!"), }; -ALIGNED(4) static const u8 sUnknown_80E9848[] = _("Reward upon rescue!"); -ALIGNED(4) static const u8 sUnknown_80E985C[] = _("A rescue is urgently needed!"); -ALIGNED(4) static const u8 sUnknown_80E987C[] = _("Please send a rescue team!"); -ALIGNED(4) static const u8 sUnknown_80E9898[] = _("I'm pleading for help!"); -ALIGNED(4) static const u8 sUnknown_80E98B4[] = _("I don't care who it is! Please help!"); -ALIGNED(4) static const u8 sUnknown_80E98DC[] = _("Someone! Anyone?"); -ALIGNED(4) static const u8 sUnknown_80E98F0[] = _("Please! I need help!"); -ALIGNED(4) static const u8 sUnknown_80E9908[] = _("Please! Someone help!"); - static const u8 sUnknown_80E99C8[]; static const u8 sUnknown_80E9A0C[]; static const u8 sUnknown_80E9A54[]; @@ -845,293 +581,115 @@ ALIGNED(4) static const u8 sUnknown_80EADFC[] = _( ALIGNED(4) static const u8 sUnknown_80EAE44[] = _("Please save my friend!"); -static const u8 EscortMe_Text[]; -static const u8 TakeMeWith_Text[]; -static const u8 WantToSee_Text[]; -static const u8 TakeMe_Text[]; - // Escort Mission Text static const u8 * const gUnknown_80EAE5C[4] = { - TakeMe_Text, - WantToSee_Text, - TakeMeWith_Text, - EscortMe_Text + _("Take me!"), + _("I want to see {COLOR YELLOW}%s{RESET}."), + _("Please take me with you!"), + _("Escort me!"), }; -ALIGNED(4) static const u8 EscortMe_Text[] = _("Escort me!"); -ALIGNED(4) static const u8 TakeMeWith_Text[] = _("Please take me with you!"); -ALIGNED(4) static const u8 WantToSee_Text[] = _("I want to see {COLOR YELLOW}%s{RESET}."); -ALIGNED(4) static const u8 TakeMe_Text[] = _("Take me!"); - -static const u8 CloseFriends_80EAF08[]; -static const u8 Apologize_80EAF2C[]; -static const u8 MustMeet_80EAF4C[]; -static const u8 HaveToMeet_80EAF70[]; -static const u8 HaveToGo_80EAF94[]; -static const u8 LongTime_80EAFA4[]; -static const u8 SickWorry_80EAFD4[]; -static const u8 FaintedInside_80EAFF0[]; -static const u8 HasntReturned_80EB014[]; -static const u8 WantToHelp_80EB030[]; -static const u8 InTrouble_80EB048[]; -static const u8 WaitingForever_80EB06C[]; -static const u8 WaitingInDungeon_80EB090[]; -static const u8 TooWeak_80EB0B4[]; -static const u8 OwnPower_80EB0DC[]; -static const u8 GoMyself_80EB0FC[]; -static const u8 WorriedAbout_80EB118[]; -static const u8 WantMeet_80EB138[]; -static const u8 PromisedMeet_80EB158[]; -static const u8 WaitingForMe_80EB17C[]; - static const u8 * const gUnknown_80EAEB8[20] = { - WaitingForMe_80EB17C, - PromisedMeet_80EB158, - WantMeet_80EB138, - WorriedAbout_80EB118, - GoMyself_80EB0FC, - OwnPower_80EB0DC, - TooWeak_80EB0B4, - WaitingInDungeon_80EB090, - WaitingForever_80EB06C, - InTrouble_80EB048, - WantToHelp_80EB030, - HasntReturned_80EB014, - FaintedInside_80EAFF0, - SickWorry_80EAFD4, - LongTime_80EAFA4, - HaveToGo_80EAF94, - HaveToMeet_80EAF70, - MustMeet_80EAF4C, - Apologize_80EAF2C, - CloseFriends_80EAF08 + _("{COLOR YELLOW}%s{RESET} is waiting for me!"), + _("We promised to meet in the dungeon!"), + _("I want to meet with {COLOR YELLOW}%s{RESET}."), + _("I'm worried about {COLOR YELLOW}%s{RESET}..."), + _("I can't go by myself..."), + _("I can't go on my own power..."), + _("I'm too weak. It's not possible."), + _("{COLOR YELLOW}%s{RESET} is waiting in the dungeon."), + _("{COLOR YELLOW}%s{RESET} has been waiting forever..."), + _("Hurry, {COLOR YELLOW}%s{RESET} is in trouble..."), + _("I want to help {COLOR YELLOW}%s{RESET}!"), + _("{COLOR YELLOW}%s{RESET} hasn't returned!"), + _("{COLOR YELLOW}%s{RESET} may have fainted inside..."), + _("I'm sick with worry..."), + _("We haven't seen each other in a long time."), + _("I have to go!"), + _("We have to meet--whatever it takes!"), + _("I don't care how--we must meet!"), + _("I want to apologize to {COLOR YELLOW}%s{RESET}."), + _("I'm close friends with {COLOR YELLOW}%s{RESET}!"), }; -ALIGNED(4) static const u8 CloseFriends_80EAF08[] = _("I'm close friends with {COLOR YELLOW}%s{RESET}!"); -ALIGNED(4) static const u8 Apologize_80EAF2C[] = _("I want to apologize to {COLOR YELLOW}%s{RESET}."); -ALIGNED(4) static const u8 MustMeet_80EAF4C[] = _("I don't care how--we must meet!"); -ALIGNED(4) static const u8 HaveToMeet_80EAF70[] = _("We have to meet--whatever it takes!"); -ALIGNED(4) static const u8 HaveToGo_80EAF94[] = _("I have to go!"); -ALIGNED(4) static const u8 LongTime_80EAFA4[] = _("We haven't seen each other in a long time."); -ALIGNED(4) static const u8 SickWorry_80EAFD4[] = _("I'm sick with worry..."); -ALIGNED(4) static const u8 FaintedInside_80EAFF0[] = _("{COLOR YELLOW}%s{RESET} may have fainted inside..."); -ALIGNED(4) static const u8 HasntReturned_80EB014[] = _("{COLOR YELLOW}%s{RESET} hasn't returned!"); -ALIGNED(4) static const u8 WantToHelp_80EB030[] = _("I want to help {COLOR YELLOW}%s{RESET}!"); -ALIGNED(4) static const u8 InTrouble_80EB048[] = _("Hurry, {COLOR YELLOW}%s{RESET} is in trouble..."); -ALIGNED(4) static const u8 WaitingForever_80EB06C[] = _("{COLOR YELLOW}%s{RESET} has been waiting forever..."); -ALIGNED(4) static const u8 WaitingInDungeon_80EB090[] = _("{COLOR YELLOW}%s{RESET} is waiting in the dungeon."); -ALIGNED(4) static const u8 TooWeak_80EB0B4[] = _("I'm too weak. It's not possible."); -ALIGNED(4) static const u8 OwnPower_80EB0DC[] = _("I can't go on my own power..."); -ALIGNED(4) static const u8 GoMyself_80EB0FC[] = _("I can't go by myself..."); -ALIGNED(4) static const u8 WorriedAbout_80EB118[] = _("I'm worried about {COLOR YELLOW}%s{RESET}..."); -ALIGNED(4) static const u8 WantMeet_80EB138[] = _("I want to meet with {COLOR YELLOW}%s{RESET}."); -ALIGNED(4) static const u8 PromisedMeet_80EB158[] = _("We promised to meet in the dungeon!"); -ALIGNED(4) static const u8 WaitingForMe_80EB17C[] = _("{COLOR YELLOW}%s{RESET} is waiting for me!"); - -static const u8 SomeonePleaseEscort[]; -static const u8 PleaseEscortMe[]; -static const u8 PleaseTakeMeThere[]; -static const u8 PleaseTakeMeToSee[]; - static const u8 * const gUnknown_80EB198[4] = { - PleaseTakeMeToSee, - PleaseTakeMeThere, - PleaseEscortMe, - SomeonePleaseEscort + _("Please take me to see {COLOR YELLOW}%s{RESET}!"), + _("Please take me there with you!"), + _("Please escort me there!"), + _("Someone, please escort me!"), }; -ALIGNED(4) static const u8 SomeonePleaseEscort[] = _("Someone, please escort me!"); -ALIGNED(4) static const u8 PleaseEscortMe[] = _("Please escort me there!"); -ALIGNED(4) static const u8 PleaseTakeMeThere[] = _("Please take me there with you!"); -ALIGNED(4) static const u8 PleaseTakeMeToSee[] = _("Please take me to see {COLOR YELLOW}%s{RESET}!"); - -static const u8 Without_80EB238[]; -static const u8 Worried_80EB250[]; -static const u8 WantMeet_80EB274[]; -static const u8 HelpMeet_80EB294[]; -static const u8 Escort_80EB2AC[]; -static const u8 TakeMeet_80EB2CC[]; static const u8 * const gUnknown_80EB220[6] = { - TakeMeet_80EB2CC, - Escort_80EB2AC, - HelpMeet_80EB294, - WantMeet_80EB274, - Worried_80EB250, - Without_80EB238 + _("Please! Take me to meet {COLOR YELLOW}%s{RESET}!"), + _("Please escort me to my {COLOR YELLOW}%s{RESET}!"), + _("Help me meet {COLOR YELLOW}%s{RESET}!"), + _("I really want to meet {COLOR YELLOW}%s{RESET}!"), + _("I'm so worried about {COLOR YELLOW}%s{RESET}..."), + _("Without {COLOR YELLOW}%s{RESET}, I..."), }; -ALIGNED(4) static const u8 Without_80EB238[] = _("Without {COLOR YELLOW}%s{RESET}, I..."); -ALIGNED(4) static const u8 Worried_80EB250[] = _("I'm so worried about {COLOR YELLOW}%s{RESET}..."); -ALIGNED(4) static const u8 WantMeet_80EB274[] = _("I really want to meet {COLOR YELLOW}%s{RESET}!"); -ALIGNED(4) static const u8 HelpMeet_80EB294[] = _("Help me meet {COLOR YELLOW}%s{RESET}!"); -ALIGNED(4) static const u8 Escort_80EB2AC[] = _("Please escort me to my {COLOR YELLOW}%s{RESET}!"); -ALIGNED(4) static const u8 TakeMeet_80EB2CC[] = _("Please! Take me to meet {COLOR YELLOW}%s{RESET}!"); - -static const u8 Lonely_80EB308[]; -static const u8 NoGood_80EB334[]; -static const u8 MeansEverything_80EB35C[]; -static const u8 WePromised_80EB37C[]; -static const u8 WeBelong_80EB3A4[]; -static const u8 WeInLove_80EB3CC[]; - static const u8 * const gUnknown_80EB2F0[6] = { - WeInLove_80EB3CC, - WeBelong_80EB3A4, - WePromised_80EB37C, - MeansEverything_80EB35C, - NoGood_80EB334, - Lonely_80EB308 + _("We're in love! Please, take me there!"), + _("We belong together! Please escort me!"), + _("We've promised our futures together."), + _("This means everything to me!"), + _("It's no good if we're not together!"), + _("I'm very lonely! Please take me with you!"), }; -ALIGNED(4) static const u8 Lonely_80EB308[] = _("I'm very lonely! Please take me with you!"); -ALIGNED(4) static const u8 NoGood_80EB334[] = _("It's no good if we're not together!"); -ALIGNED(4) static const u8 MeansEverything_80EB35C[] = _("This means everything to me!"); -ALIGNED(4) static const u8 WePromised_80EB37C[] = _("We've promised our futures together."); -ALIGNED(4) static const u8 WeBelong_80EB3A4[] = _("We belong together! Please escort me!"); -ALIGNED(4) static const u8 WeInLove_80EB3CC[] = _("We're in love! Please, take me there!"); - -static const u8 sUnknown_80EB450[]; -static const u8 sUnknown_80EB470[]; -static const u8 sUnknown_80EB494[]; -static const u8 sUnknown_80EB4AC[]; -static const u8 sUnknown_80EB4C0[]; -static const u8 sUnknown_80EB4E0[]; -static const u8 sUnknown_80EB500[]; -static const u8 sUnknown_80EB524[]; -static const u8 sUnknown_80EB54C[]; -static const u8 sUnknown_80EB568[]; -static const u8 sUnknown_80EB590[]; -static const u8 sUnknown_80EB5B4[]; -static const u8 sUnknown_80EB5D4[]; -static const u8 sUnknown_80EB5F8[]; -static const u8 sUnknown_80EB618[]; -static const u8 sUnknown_80EB638[]; -static const u8 sUnknown_80EB654[]; -static const u8 sUnknown_80EB67C[]; -static const u8 sUnknown_80EB6A0[]; -static const u8 sUnknown_80EB6C0[]; -static const u8 sUnknown_80EB6E4[]; -static const u8 sUnknown_80EB708[]; - // Item Delivery Mission Text static const u8 * const gUnknown_80EB3F8[22] = { - sUnknown_80EB708, - sUnknown_80EB6E4, - sUnknown_80EB6C0, - sUnknown_80EB6A0, - sUnknown_80EB67C, - sUnknown_80EB654, - sUnknown_80EB638, - sUnknown_80EB618, - sUnknown_80EB5F8, - sUnknown_80EB5D4, - sUnknown_80EB5B4, - sUnknown_80EB590, - sUnknown_80EB568, - sUnknown_80EB54C, - sUnknown_80EB524, - sUnknown_80EB500, - sUnknown_80EB4E0, - sUnknown_80EB4C0, - sUnknown_80EB4AC, - sUnknown_80EB494, - sUnknown_80EB470, - sUnknown_80EB450 + _("Having one {COLOR GREEN}%s{RESET} is reassuring."), + _("{COLOR GREEN}%s{RESET}--it's convenient to have."), + _("{COLOR GREEN}%s{RESET} wanted after long search."), + _("{COLOR GREEN}%s{RESET} wanted for exploration."), + _("{COLOR GREEN}%s{RESET}--I'd love to utilize one!"), + _("{COLOR GREEN}%s{RESET}--I can't leave without it."), + _("{COLOR GREEN}%s{RESET} wanted as a charm."), + _("{COLOR GREEN}%s{RESET}! Seeking in quantity!"), + _("Help this {COLOR GREEN}%s{RESET} collector!"), + _("I can't find one more {COLOR GREEN}%s{RESET}."), + _("Hard-to-find {COLOR GREEN}%s{RESET} sought."), + _("{COLOR GREEN}%s{RESET}--I get scared without it!"), + _("I can't sleep without it: {COLOR GREEN}%s{RESET}."), + _("{COLOR GREEN}%s{RESET} makes me strong."), + _("{COLOR GREEN}%s{RESET}--it's my mom's favorite."), + _("{COLOR GREEN}%s{RESET}'s texture is comforting."), + _("{COLOR GREEN}%s{RESET} wanted to test effects."), + _("{COLOR GREEN}%s{RESET} wanted for nostalgia."), + _("I lost my {COLOR GREEN}%s{RESET}."), + _("Wanted: my own {COLOR GREEN}%s{RESET}."), + _("The item {COLOR GREEN}%s{RESET} is the in thing!"), + _("Is it true about the {COLOR GREEN}%s{RESET}?"), }; -ALIGNED(4) static const u8 sUnknown_80EB450[] = _("Is it true about the {COLOR GREEN}%s{RESET}?"); -ALIGNED(4) static const u8 sUnknown_80EB470[] = _("The item {COLOR GREEN}%s{RESET} is the in thing!"); -ALIGNED(4) static const u8 sUnknown_80EB494[] = _("Wanted: my own {COLOR GREEN}%s{RESET}."); -ALIGNED(4) static const u8 sUnknown_80EB4AC[] = _("I lost my {COLOR GREEN}%s{RESET}."); -ALIGNED(4) static const u8 sUnknown_80EB4C0[] = _("{COLOR GREEN}%s{RESET} wanted for nostalgia."); -ALIGNED(4) static const u8 sUnknown_80EB4E0[] = _("{COLOR GREEN}%s{RESET} wanted to test effects."); -ALIGNED(4) static const u8 sUnknown_80EB500[] = _("{COLOR GREEN}%s{RESET}'s texture is comforting."); -ALIGNED(4) static const u8 sUnknown_80EB524[] = _("{COLOR GREEN}%s{RESET}--it's my mom's favorite."); -ALIGNED(4) static const u8 sUnknown_80EB54C[] = _("{COLOR GREEN}%s{RESET} makes me strong."); -ALIGNED(4) static const u8 sUnknown_80EB568[] = _("I can't sleep without it: {COLOR GREEN}%s{RESET}."); -ALIGNED(4) static const u8 sUnknown_80EB590[] = _("{COLOR GREEN}%s{RESET}--I get scared without it!"); -ALIGNED(4) static const u8 sUnknown_80EB5B4[] = _("Hard-to-find {COLOR GREEN}%s{RESET} sought."); -ALIGNED(4) static const u8 sUnknown_80EB5D4[] = _("I can't find one more {COLOR GREEN}%s{RESET}."); -ALIGNED(4) static const u8 sUnknown_80EB5F8[] = _("Help this {COLOR GREEN}%s{RESET} collector!"); -ALIGNED(4) static const u8 sUnknown_80EB618[] = _("{COLOR GREEN}%s{RESET}! Seeking in quantity!"); -ALIGNED(4) static const u8 sUnknown_80EB638[] = _("{COLOR GREEN}%s{RESET} wanted as a charm."); -ALIGNED(4) static const u8 sUnknown_80EB654[] = _("{COLOR GREEN}%s{RESET}--I can't leave without it."); -ALIGNED(4) static const u8 sUnknown_80EB67C[] = _("{COLOR GREEN}%s{RESET}--I'd love to utilize one!"); -ALIGNED(4) static const u8 sUnknown_80EB6A0[] = _("{COLOR GREEN}%s{RESET} wanted for exploration."); -ALIGNED(4) static const u8 sUnknown_80EB6C0[] = _("{COLOR GREEN}%s{RESET} wanted after long search."); -ALIGNED(4) static const u8 sUnknown_80EB6E4[] = _("{COLOR GREEN}%s{RESET}--it's convenient to have."); -ALIGNED(4) static const u8 sUnknown_80EB708[] = _("Having one {COLOR GREEN}%s{RESET} is reassuring."); - -static const u8 sUnknown_80EB784[]; -static const u8 sUnknown_80EB7A8[]; -static const u8 sUnknown_80EB7D8[]; -static const u8 sUnknown_80EB800[]; -static const u8 sUnknown_80EB818[]; -static const u8 sUnknown_80EB82C[]; -static const u8 sUnknown_80EB850[]; -static const u8 sUnknown_80EB86C[]; -static const u8 sUnknown_80EB890[]; -static const u8 sUnknown_80EB8AC[]; -static const u8 sUnknown_80EB8D0[]; -static const u8 sUnknown_80EB8E8[]; -static const u8 sUnknown_80EB90C[]; -static const u8 sUnknown_80EB930[]; -static const u8 sUnknown_80EB95C[]; -static const u8 sUnknown_80EB97C[]; -static const u8 sUnknown_80EB9A0[]; -static const u8 sUnknown_80EB9BC[]; -static const u8 sUnknown_80EB9D0[]; -static const u8 sUnknown_80EB9E8[]; -static const u8 sUnknown_80EBA00[]; static const u8 * const gUnknown_80EB72C[22] = { - sUnknown_80EBA00, - sUnknown_80EB9E8, - sUnknown_80EB9D0, - sUnknown_80EB9BC, - sUnknown_80EB9A0, - sUnknown_80EB97C, - sUnknown_80EB95C, - sUnknown_80EB930, - sUnknown_80EB90C, - sUnknown_80EB8E8, - sUnknown_80EB8D0, - sUnknown_80EB8AC, - sUnknown_80EB890, - sUnknown_80EB86C, - sUnknown_80EB850, - sUnknown_80EB9A0, - sUnknown_80EB82C, - sUnknown_80EB818, - sUnknown_80EB800, - sUnknown_80EB7D8, - sUnknown_80EB7A8, - sUnknown_80EB784 + _("Please! May I have one?"), + _("Please trade me one!"), + _("Please find one for me!"), + _("Please give me one!"), + _("Please share one with me!"), + _("Please! I must have one delivered!"), + _("Please help! Reward offered!"), + _("Please! I'm offering a generous reward!"), + _("I'm looking forward to your help!"), + _("Please let me know if you find one!"), + _("Please search for it!"), + _("Please help! I'm counting on you!"), + _("Please! I need your help!"), + _("Please help! You're my only hope!"), + _("Please share a little bit!"), + _("Please share one with me!"), + _("Please! I need some cooperation!"), + _("Please help me out!"), + _("Please! Please help me!"), + _("Please help! I'm offering a reward!"), + _("Please help! I'll make it worth your time!"), + _("Please contact me if you find it!"), }; -ALIGNED(4) static const u8 sUnknown_80EB784[] = _("Please contact me if you find it!"); -ALIGNED(4) static const u8 sUnknown_80EB7A8[] = _("Please help! I'll make it worth your time!"); -ALIGNED(4) static const u8 sUnknown_80EB7D8[] = _("Please help! I'm offering a reward!"); -ALIGNED(4) static const u8 sUnknown_80EB800[] = _("Please! Please help me!"); -ALIGNED(4) static const u8 sUnknown_80EB818[] = _("Please help me out!"); -ALIGNED(4) static const u8 sUnknown_80EB82C[] = _("Please! I need some cooperation!"); -ALIGNED(4) static const u8 sUnknown_80EB850[] = _("Please share a little bit!"); -ALIGNED(4) static const u8 sUnknown_80EB86C[] = _("Please help! You're my only hope!"); -ALIGNED(4) static const u8 sUnknown_80EB890[] = _("Please! I need your help!"); -ALIGNED(4) static const u8 sUnknown_80EB8AC[] = _("Please help! I'm counting on you!"); -ALIGNED(4) static const u8 sUnknown_80EB8D0[] = _("Please search for it!"); -ALIGNED(4) static const u8 sUnknown_80EB8E8[] = _("Please let me know if you find one!"); -ALIGNED(4) static const u8 sUnknown_80EB90C[] = _("I'm looking forward to your help!"); -ALIGNED(4) static const u8 sUnknown_80EB930[] = _("Please! I'm offering a generous reward!"); -ALIGNED(4) static const u8 sUnknown_80EB95C[] = _("Please help! Reward offered!"); -ALIGNED(4) static const u8 sUnknown_80EB97C[] = _("Please! I must have one delivered!"); -ALIGNED(4) static const u8 sUnknown_80EB9A0[] = _("Please share one with me!"); -ALIGNED(4) static const u8 sUnknown_80EB9BC[] = _("Please give me one!"); -ALIGNED(4) static const u8 sUnknown_80EB9D0[] = _("Please find one for me!"); -ALIGNED(4) static const u8 sUnknown_80EB9E8[] = _("Please trade me one!"); -ALIGNED(4) static const u8 sUnknown_80EBA00[] = _("Please! May I have one?"); - static const u8 sNewFriendAreasText[]; static const u8 sNewFriendAreasHeadline[]; static const u8 sLucarioRankText[]; diff --git a/src/data/pokemon_mail_pre.h b/src/data/pokemon_mail_pre.h index 2d9cbecb4..3dfef368f 100644 --- a/src/data/pokemon_mail_pre.h +++ b/src/data/pokemon_mail_pre.h @@ -558,7 +558,7 @@ ALIGNED(4) const u8 gUnknown_80E8A7C[] = _( "Send your thanks to your friend!"); ALIGNED(4) const u8 gUnknown_80E8AC8[] = _("Client:"); -ALIGNED(4) const u8 gUnknown_80E8AD0[] = _("%s{COLOR GREEN}{UNK_ICON_81_69}%s{UNK_ICON_81_6A}{RESET}"); +ALIGNED(4) const u8 gUnknown_80E8AD0[] = _("%s{COLOR GREEN}ďĽ%s){RESET}"); ALIGNED(4) const u8 gUnknown_80E8AE0[] = _("Objective:"); ALIGNED(4) const u8 gUnknown_80E8AEC[] = _("Friend Rescue"); ALIGNED(4) const u8 gUnknown_80E8AFC[] = _("Deliver {COLOR GREEN}%s{RESET}."); @@ -570,4 +570,4 @@ ALIGNED(4) const u8 gSpecialMissionText[] = _("Special mission"); ALIGNED(4) const u8 gPlaceText[] = _("Place:"); ALIGNED(4) const u8 gDifficultyText[] = _("Difficulty:"); ALIGNED(4) const u8 gRewardText[] = _("Reward:"); -ALIGNED(4) const u8 gUnknown_80E8B7C[] = _("Wonder Mail:"); \ No newline at end of file +ALIGNED(4) const u8 gUnknown_80E8B7C[] = _("Wonder Mail:"); From 484e6b126d3df078a722133bfbd6db7932ffd9ef Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Sun, 10 Nov 2024 18:30:12 +0100 Subject: [PATCH 21/48] Unswap incorrect kana --- data/move/move_names.s | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/move/move_names.s b/data/move/move_names.s index e6e227771..80b5b704a 100644 --- a/data/move/move_names.s +++ b/data/move/move_names.s @@ -275,7 +275,7 @@ MoveUseTextBide: .global MoveNameBide2 MoveNameBide2: -.string "ăŚăżă‚“\0" +.string "ăŚăľă‚“\0" .align 2,0 .global MoveDescriptionIsWatching @@ -285,7 +285,7 @@ MoveDescriptionIsWatching: .global MoveNameIsWatching MoveNameIsWatching: -.string "ă‚ă†ă™ă‚’ăľă‚‹\0" +.string "ă‚ă†ă™ă‚’ăżă‚‹\0" .align 2,0 .global MoveUseTextRegularAttack @@ -3280,5 +3280,5 @@ MoveDescriptionNone: .global MoveNameNone MoveNameNone: -.string "ăŞă«ă®ă‚‚?\0" +.string "ăŞă«ă‚‚ă®ďĽź\0" .align 2,0 From ad9688cebfb4a98555df33282b0c01026efc7ad8 Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Sun, 10 Nov 2024 19:04:13 +0100 Subject: [PATCH 22/48] Fix inconsistent rebuilding --- data_monster.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_monster.mk b/data_monster.mk index e91069287..091f40baa 100644 --- a/data_monster.mk +++ b/data_monster.mk @@ -29,7 +29,7 @@ $(LEARNSET_DATA): $(LEARNSET_DIR)/learnset_data.json $(DUNGEONJSON) learnset pmd-red $< data_learnset_ptrs: ${LEARNSET_DATA}; - echo '.4byte 0' >> $(LEARNSET_PTRS) + echo '.4byte 0' > $(LEARNSET_PTRS) echo '.4byte 0' >> $(LEARNSET_PTRS) cat $(LEARNSET_DATA) | grep .global >> $(LEARNSET_PTRS) ifeq ($(shell uname -s), Darwin) From fa08c0e69119612aea64e72695f9d9e69f946a4d Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sun, 10 Nov 2024 15:11:07 -0500 Subject: [PATCH 23/48] dungeon_serializer.c --- asm/code_80450F8.s | 8 +- asm/code_8069E0C.s | 2 +- asm/code_807E5AC.s | 2 +- asm/code_8080CF0.s | 1010 ----------------- charmap.txt | 9 +- data/data_80F4E2C.s | 9 +- data/data_80F59C8.s | 3 +- data/data_8107010.s | 1534 +------------------------ data/data_8107224.s | 1523 +++++++++++++++++++++++++ data/move/move_names.s | 4 +- include/code_800F958.h | 8 + include/code_8041AD0.h | 5 +- include/code_8045A00.h | 4 +- include/code_8092334.h | 9 +- include/data_serializer.h | 13 + include/dungeon_map_access.h | 4 +- include/dungeon_serializer.h | 11 + include/pokemon.h | 2 +- include/structs/dungeon_entity.h | 70 +- include/structs/str_damage.h | 7 +- include/structs/str_dungeon.h | 77 +- ld_script.txt | 5 +- src/code_800F958.c | 4 +- src/code_803E724.c | 1 - src/code_8040094.c | 1 - src/code_8041AD0.c | 1 - src/code_804267C.c | 3 +- src/code_8042B34.c | 19 +- src/code_8048480.c | 2 +- src/code_805D8C8.c | 34 +- src/code_805D8C8_1.c | 1 - src/code_8069E0C.c | 25 +- src/code_806CD90.c | 6 +- src/code_80718D8.c | 2 +- src/code_8073CF0.c | 4 +- src/code_8075708.c | 1 - src/code_8077274_1.c | 10 +- src/code_807CD9C.c | 2 +- src/code_8083288.c | 548 --------- src/data/dungeon_serializer.h | 10 + src/dungeon_cutscenes.c | 3 +- src/dungeon_items.c | 2 +- src/dungeon_move.c | 2 +- src/dungeon_serializer.c | 1816 ++++++++++++++++++++++++++++++ src/status.c | 18 +- src/status_actions.c | 5 +- src/tile_types.c | 1 - src/trap.c | 3 +- src/trap_1.c | 977 +--------------- sym_ewram2.txt | 4 +- 50 files changed, 3602 insertions(+), 4222 deletions(-) delete mode 100644 asm/code_8080CF0.s create mode 100644 data/data_8107224.s create mode 100644 include/code_800F958.h create mode 100644 include/data_serializer.h create mode 100644 include/dungeon_serializer.h delete mode 100644 src/code_8083288.c create mode 100644 src/data/dungeon_serializer.h create mode 100644 src/dungeon_serializer.c diff --git a/asm/code_80450F8.s b/asm/code_80450F8.s index 924630560..afbd0fef8 100644 --- a/asm/code_80450F8.s +++ b/asm/code_80450F8.s @@ -87,7 +87,7 @@ _0804540C: strh r2, [r0, 0x2] movs r0, 0 mov r1, r8 - bl sub_8069F54 + bl GetMonsterApparentID ldr r1, [r4, 0x70] strh r0, [r1, 0x4] ldr r0, [r4, 0x70] @@ -95,7 +95,7 @@ _0804540C: strb r5, [r0, 0x6] movs r0, 0 mov r1, r8 - bl sub_8069F54 + bl GetMonsterApparentID lsls r0, 16 asrs r0, 16 bl GetSpriteData @@ -280,7 +280,7 @@ _0804557A: strh r2, [r0, 0x2] movs r0, 0 mov r1, r8 - bl sub_8069F54 + bl GetMonsterApparentID ldr r1, [r4, 0x70] strh r0, [r1, 0x4] ldr r0, [r4, 0x70] @@ -288,7 +288,7 @@ _0804557A: strb r3, [r0, 0x6] movs r0, 0 mov r1, r8 - bl sub_8069F54 + bl GetMonsterApparentID lsls r0, 16 asrs r0, 16 bl GetSpriteData diff --git a/asm/code_8069E0C.s b/asm/code_8069E0C.s index fc6d11927..28075ac1e 100644 --- a/asm/code_8069E0C.s +++ b/asm/code_8069E0C.s @@ -3136,7 +3136,7 @@ sub_806BB6C: str r6, [sp, 0xC] movs r0, 0 adds r1, r4, 0 - bl sub_8069F54 + bl GetMonsterApparentID lsls r0, 16 adds r1, r7, 0 adds r1, 0x22 diff --git a/asm/code_807E5AC.s b/asm/code_807E5AC.s index be82e0ed6..10d05dfe9 100644 --- a/asm/code_807E5AC.s +++ b/asm/code_807E5AC.s @@ -421,7 +421,7 @@ _0807E9A4: movs r0, 0x2 ldrsh r1, [r4, r0] adds r0, r5, 0 - bl sub_8069F54 + bl GetMonsterApparentID b _0807E9D8 .align 2, 0 _0807E9D0: .4byte 0xfffffe88 diff --git a/asm/code_8080CF0.s b/asm/code_8080CF0.s deleted file mode 100644 index 00c92aa91..000000000 --- a/asm/code_8080CF0.s +++ /dev/null @@ -1,1010 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start RestoreDungeonEntity -RestoreDungeonEntity: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, _0808266C - add sp, r4 - adds r5, r0, 0 - str r2, [sp, 0x210] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x20C] - movs r2, 0x82 - lsls r2, 2 - mov r0, sp - movs r1, 0 - bl memset - adds r0, r5, 0 - bl ReadU8 - adds r0, r5, 0 - bl ReadU8 - adds r0, r5, 0 - bl ReadU8 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x214] - add r4, sp, 0x208 - adds r0, r5, 0 - adds r1, r4, 0 - bl ReadPosition8 - adds r0, r5, 0 - bl ReadBool8 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x218] - adds r0, r5, 0 - bl ReadU16 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x21C] - ldr r1, _08082670 - movs r0, 0 - str r0, [r1] - adds r0, r5, 0 - bl ReadU16 - mov r1, sp - strh r0, [r1] - adds r0, r5, 0 - bl sub_8082BC0 - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r5, 0 - bl sub_8082BC0 - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r5, 0 - bl ReadBool8 - mov r1, sp - strb r0, [r1, 0x6] - adds r0, r5, 0 - bl ReadBool8 - mov r1, sp - strb r0, [r1, 0x7] - adds r0, r5, 0 - bl ReadU8 - mov r1, sp - strb r0, [r1, 0x8] - adds r0, r5, 0 - bl ReadU8 - mov r1, sp - strb r0, [r1, 0x9] - adds r0, r5, 0 - bl ReadU8 - mov r1, sp - strb r0, [r1, 0xA] - add r1, sp, 0x40 - adds r0, r5, 0 - bl ReadJoinedAt - adds r0, r5, 0 - bl ReadS16 - mov r1, sp - strh r0, [r1, 0xC] - adds r0, r5, 0 - bl ReadS16 - mov r1, sp - strh r0, [r1, 0xE] - adds r0, r5, 0 - bl ReadS16 - mov r1, sp - strh r0, [r1, 0x10] - adds r0, r5, 0 - bl ReadS16 - mov r1, sp - strh r0, [r1, 0x12] - adds r0, r5, 0 - bl ReadU8 - mov r1, sp - strb r0, [r1, 0x14] - adds r0, r5, 0 - bl ReadU8 - mov r1, sp - strb r0, [r1, 0x15] - adds r0, r5, 0 - bl ReadU8 - mov r1, sp - strb r0, [r1, 0x16] - adds r0, r5, 0 - bl ReadU8 - mov r1, sp - strb r0, [r1, 0x17] - adds r0, r5, 0 - bl sub_80831A0 - str r0, [sp, 0x18] - adds r0, r5, 0 - bl ReadS16 - mov r1, sp - strh r0, [r1, 0x1C] - adds r0, r5, 0 - bl ReadS16 - mov r1, sp - strh r0, [r1, 0x1E] - adds r0, r5, 0 - bl ReadS16 - mov r1, sp - strh r0, [r1, 0x20] - adds r0, r5, 0 - bl ReadS16 - mov r1, sp - strh r0, [r1, 0x22] - adds r0, r5, 0 - bl ReadS16 - mov r1, sp - strh r0, [r1, 0x24] - adds r0, r5, 0 - bl ReadS16 - mov r1, sp - strh r0, [r1, 0x26] - adds r0, r5, 0 - bl ReadS16 - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r5, 0 - bl sub_80831C8 - str r0, [sp, 0x2C] - adds r0, r5, 0 - bl sub_80831C8 - str r0, [sp, 0x30] - adds r0, r5, 0 - bl sub_80831C8 - str r0, [sp, 0x34] - adds r0, r5, 0 - bl sub_80831C8 - str r0, [sp, 0x38] - add r1, sp, 0x44 - adds r0, r5, 0 - bl ReadActionContainer - adds r0, r5, 0 - bl sub_8082BFC - add r1, sp, 0x5C - strb r0, [r1] - adds r0, r5, 0 - bl sub_8082BFC - mov r1, sp - adds r1, 0x5D - strb r0, [r1] - adds r0, r5, 0 - bl sub_8082C18 - mov r1, sp - adds r1, 0x5E - strb r0, [r1] - adds r0, r5, 0 - bl sub_8082C18 - mov r1, sp - adds r1, 0x5F - strb r0, [r1] - add r1, sp, 0x60 - adds r0, r5, 0 - bl sub_80820A8 - adds r0, r5, 0 - bl sub_8082BE0 - add r1, sp, 0x64 - strb r0, [r1] - add r7, sp, 0x78 - add r0, sp, 0x8C - mov r8, r0 - add r1, sp, 0x90 - mov r9, r1 - add r2, sp, 0x94 - mov r10, r2 - mov r3, sp - adds r3, 0x3C - str r3, [sp, 0x270] - mov r0, sp - adds r0, 0x98 - str r0, [sp, 0x274] - mov r1, sp - adds r1, 0x9C - str r1, [sp, 0x278] - mov r2, sp - adds r2, 0xA0 - str r2, [sp, 0x27C] - adds r3, 0x6C - str r3, [sp, 0x284] - adds r0, 0x14 - str r0, [sp, 0x288] - adds r1, 0x14 - str r1, [sp, 0x28C] - adds r2, 0x1C - str r2, [sp, 0x290] - adds r3, 0x18 - str r3, [sp, 0x294] - adds r0, 0x18 - str r0, [sp, 0x298] - adds r1, 0x18 - str r1, [sp, 0x29C] - adds r2, 0x14 - str r2, [sp, 0x220] - adds r3, 0x1C - str r3, [sp, 0x224] - adds r0, 0x1C - str r0, [sp, 0x228] - adds r1, 0x1C - str r1, [sp, 0x22C] - adds r2, 0x18 - str r2, [sp, 0x230] - adds r3, 0x10 - str r3, [sp, 0x234] - adds r0, 0x10 - str r0, [sp, 0x238] - adds r1, 0xD - str r1, [sp, 0x23C] - adds r2, 0xA - str r2, [sp, 0x240] - adds r3, 0x7 - str r3, [sp, 0x244] - adds r0, 0x4 - str r0, [sp, 0x248] - adds r1, 0xA - str r1, [sp, 0x25C] - adds r2, 0x3 - str r2, [sp, 0x24C] - adds r3, 0x3 - str r3, [sp, 0x250] - adds r0, 0x3 - str r0, [sp, 0x254] - subs r1, 0x1 - str r1, [sp, 0x258] - adds r2, 0x7 - str r2, [sp, 0x260] - adds r3, 0x7 - str r3, [sp, 0x264] - adds r0, 0x7 - str r0, [sp, 0x268] - adds r1, 0x5 - str r1, [sp, 0x26C] - subs r2, 0x58 - str r2, [sp, 0x280] - add r4, sp, 0x68 - movs r6, 0x3 -_080824DC: - adds r0, r5, 0 - adds r1, r4, 0 - bl ReadPosition8 - adds r4, 0x4 - subs r6, 0x1 - cmp r6, 0 - bge _080824DC - adds r0, r5, 0 - adds r1, r7, 0 - bl ReadAITarget - adds r0, r5, 0 - mov r1, r8 - bl Read3Bytes - adds r0, r5, 0 - mov r1, r9 - bl Read3Bytes - adds r0, r5, 0 - bl sub_8082C84 - movs r4, 0 - mov r3, r10 - strb r0, [r3] - adds r0, r5, 0 - ldr r1, [sp, 0x270] - bl ReadHiddenPower - adds r0, r5, 0 - bl sub_80831A0 - ldr r1, [sp, 0x274] - str r0, [r1] - adds r0, r5, 0 - bl sub_80831A0 - ldr r2, [sp, 0x278] - str r0, [r2] - adds r0, r5, 0 - bl sub_80831A0 - ldr r3, [sp, 0x27C] - str r0, [r3] - adds r0, r5, 0 - ldr r1, [sp, 0x284] - bl ReadSleep - adds r0, r5, 0 - ldr r1, [sp, 0x288] - bl ReadNonVolatile - adds r0, r5, 0 - ldr r1, [sp, 0x28C] - bl ReadImmobilize - adds r0, r5, 0 - ldr r1, [sp, 0x290] - bl ReadVolatileStatus - adds r0, r5, 0 - ldr r1, [sp, 0x294] - bl ReadCharging - adds r0, r5, 0 - ldr r1, [sp, 0x298] - bl ReadProtection - adds r0, r5, 0 - ldr r1, [sp, 0x29C] - bl ReadWaiting - adds r0, r5, 0 - ldr r1, [sp, 0x220] - bl ReadLinked - adds r0, r5, 0 - ldr r1, [sp, 0x224] - bl ReadMoveStatus - adds r0, r5, 0 - ldr r1, [sp, 0x228] - bl sub_8082E88 - adds r0, r5, 0 - ldr r1, [sp, 0x22C] - bl ReadTransformStatus - adds r0, r5, 0 - ldr r1, [sp, 0x230] - bl ReadEyesightStatus - adds r0, r5, 0 - ldr r1, [sp, 0x234] - bl ReadMuzzled - adds r0, r5, 0 - bl ReadBool8 - ldr r1, [sp, 0x238] - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - ldr r2, [sp, 0x23C] - strb r0, [r2] - adds r0, r5, 0 - bl ReadBool8 - ldr r3, [sp, 0x240] - strb r0, [r3] - adds r0, r5, 0 - bl ReadBool8 - ldr r1, [sp, 0x244] - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - ldr r2, [sp, 0x248] - strb r0, [r2] - adds r0, r5, 0 - bl ReadU8 - ldr r3, [sp, 0x25C] - strb r0, [r3] - adds r0, r5, 0 - bl ReadBool8 - ldr r1, [sp, 0x24C] - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - ldr r2, [sp, 0x250] - strb r0, [r2] - adds r0, r5, 0 - bl ReadBool8 - ldr r3, [sp, 0x254] - strb r0, [r3] - adds r0, r5, 0 - bl ReadU8 - ldr r1, [sp, 0x258] - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - ldr r2, [sp, 0x260] - strb r0, [r2] - adds r0, r5, 0 - bl ReadU8 - ldr r3, [sp, 0x264] - strb r0, [r3] - adds r0, r5, 0 - bl ReadU8 - ldr r1, [sp, 0x268] - strb r0, [r1] - adds r0, r5, 0 - bl sub_8082C34 - ldr r2, [sp, 0x26C] - strb r0, [r2] - adds r0, r5, 0 - bl sub_8082C50 - add r1, sp, 0x100 - strb r0, [r1] - adds r0, r5, 0 - bl sub_8082C6C - add r1, sp, 0x104 - str r0, [r1] - add r1, sp, 0x108 - adds r0, r5, 0 - movs r2, 0x5 - bl xxx_ReadBytes - ldr r1, _08082674 - add r1, sp - adds r0, r5, 0 - movs r2, 0x5 - bl xxx_ReadBytes - adds r0, r5, 0 - bl ReadU8 - movs r1, 0x89 - lsls r1, 1 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadU8 - b _08082678 - .align 2, 0 -_0808266C: .4byte 0xfffffd60 -_08082670: .4byte gLeaderPointer -_08082674: .4byte 0x0000010d -_08082678: - ldr r1, _08082818 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadU8 - add r1, sp, 0x114 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - add r1, sp, 0x118 - adds r0, r5, 0 - bl ReadMoves - add r1, sp, 0x13C - adds r0, r5, 0 - bl sub_8082F48 - add r1, sp, 0x140 - adds r0, r5, 0 - bl sub_8082F48 - adds r0, r5, 0 - bl ReadBool8 - add r1, sp, 0x144 - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - ldr r1, _0808281C - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - ldr r1, _08082820 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - movs r1, 0xA3 - lsls r1, 1 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - add r1, sp, 0x148 - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - ldr r1, _08082824 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - movs r1, 0xA5 - lsls r1, 1 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - ldr r1, _08082828 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - add r1, sp, 0x14C - strb r0, [r1] - adds r0, r5, 0 - bl ReadU16 - movs r1, 0xA7 - lsls r1, 1 - add r1, sp - strh r0, [r1] - adds r0, r5, 0 - bl ReadU16 - add r1, sp, 0x150 - strh r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - movs r1, 0xA9 - lsls r1, 1 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadU8 - ldr r1, _0808282C - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - add r1, sp, 0x154 - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - ldr r1, _08082830 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadBool8 - movs r1, 0xAB - lsls r1, 1 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadU8 - add r1, sp, 0x164 - strb r0, [r1] - adds r0, r5, 0 - bl ReadU8 - ldr r1, _08082834 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadU8 - movs r1, 0xB3 - lsls r1, 1 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadU8 - ldr r1, _08082838 - add r1, sp - strb r0, [r1] - adds r0, r5, 0 - bl ReadU8 - add r1, sp, 0x168 - strb r0, [r1] - adds r0, r5, 0 - bl ReadU8 - ldr r1, _0808283C - add r1, sp - strb r0, [r1] - add r1, sp, 0x16C - adds r0, r5, 0 - bl ReadPosition8 - adds r0, r5, 0 - bl sub_80831C8 - add r1, sp, 0x174 - str r0, [r1] - adds r0, r5, 0 - bl ReadU16 - add r1, sp, 0x178 - strh r0, [r1] - adds r0, r5, 0 - bl ReadS16 - add r1, sp, 0x1F8 - strh r0, [r1] - adds r0, r5, 0 - bl ReadS16 - movs r1, 0xFD - lsls r1, 1 - add r1, sp - strh r0, [r1] - adds r0, r5, 0 - bl sub_80831A0 - add r1, sp, 0x1FC - str r0, [r1] - adds r0, r5, 0 - bl sub_8082CA0 - ldr r3, [sp, 0x280] - strb r0, [r3] - ldr r0, _08082840 - str r4, [r0] - ldr r0, [sp, 0x214] - cmp r0, 0 - beq _080828BE - ldr r1, [sp, 0x20C] - cmp r1, 0 - beq _08082844 - mov r0, sp - movs r2, 0x2 - ldrsh r0, [r0, r2] - mov r1, sp - movs r3, 0x4 - ldrsh r1, [r1, r3] - ldr r2, [sp, 0x210] - bl sub_80828E0 - b _08082856 - .align 2, 0 -_08082818: .4byte 0x00000113 -_0808281C: .4byte 0x00000145 -_08082820: .4byte 0x00000147 -_08082824: .4byte 0x00000149 -_08082828: .4byte 0x0000014b -_0808282C: .4byte 0x00000153 -_08082830: .4byte 0x00000155 -_08082834: .4byte 0x00000165 -_08082838: .4byte 0x00000167 -_0808283C: .4byte 0x00000169 -_08082840: .4byte gLeaderPointer -_08082844: - mov r0, sp - movs r1, 0x2 - ldrsh r0, [r0, r1] - mov r1, sp - movs r2, 0x4 - ldrsh r1, [r1, r2] - ldr r2, [sp, 0x210] - bl sub_8082A08 -_08082856: - adds r7, r0, 0 - cmp r7, 0 - beq _080828BE - ldr r6, [r7, 0x70] - movs r5, 0x82 - lsls r5, 2 - mov r3, sp - adds r4, r3, r5 - movs r1, 0 - ldrsh r0, [r4, r1] - ldr r3, _080828D4 - add r3, sp - movs r2, 0 - ldrsh r1, [r3, r2] - bl GetTileSafe - ldr r1, [r4] - str r1, [r7, 0x8] - ldr r1, [r4] - str r1, [r7, 0x4] - str r7, [r0, 0x10] - adds r0, r7, 0 - adds r0, 0x20 - movs r4, 0 - add r1, sp, 0x218 - ldrb r1, [r1] - strb r1, [r0] - add r2, sp, 0x21C - ldrh r2, [r2] - strh r2, [r7, 0x26] - adds r0, r6, 0 - mov r1, sp - adds r2, r5, 0 - bl memcpy - ldr r0, _080828D8 - str r4, [r0] - ldrb r0, [r6, 0x7] - cmp r0, 0 - beq _080828B0 - ldr r0, _080828DC - ldrh r1, [r7, 0x4] - strh r1, [r0] - ldrh r1, [r7, 0x6] - strh r1, [r0, 0x2] -_080828B0: - adds r0, r7, 0 - bl LoadIQSkills - adds r0, r7, 0 - movs r1, 0 - bl sub_804535C -_080828BE: - movs r3, 0xA8 - lsls r3, 2 - add sp, r3 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080828D4: .4byte 0x0000020a -_080828D8: .4byte gLeaderPointer -_080828DC: .4byte gUnknown_203B410 - thumb_func_end RestoreDungeonEntity - - thumb_func_start sub_80828E0 -sub_80828E0: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r5, r2, 0 - lsls r0, 16 - asrs r0, 16 - mov r10, r0 - lsls r1, 16 - asrs r1, 16 - mov r8, r1 - movs r4, 0x1 - negs r4, r4 - mov r0, r8 - bl GetBodySize - lsls r0, 24 - lsrs r6, r0, 24 - movs r3, 0 - movs r0, 0x6 - subs r7, r0, r6 - ldr r0, _08082914 - mov r9, r0 - b _0808291A - .align 2, 0 -_08082914: .4byte gUnknown_202EE70 -_08082918: - adds r3, 0x1 -_0808291A: - cmp r3, r7 - bgt _0808293E - movs r2, 0 - cmp r2, r6 - bge _08082938 - mov r0, r9 - adds r1, r3, r0 - b _08082932 -_0808292A: - adds r1, 0x1 - adds r2, 0x1 - cmp r2, r6 - bge _08082938 -_08082932: - ldrb r0, [r1] - cmp r0, 0 - beq _0808292A -_08082938: - cmp r2, r6 - bne _08082918 - adds r4, r3, 0 -_0808293E: - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - bne _0808294A - movs r0, 0 - b _080829E6 -_0808294A: - ldr r2, _080829F4 - ldr r0, [r2] - lsls r1, r5, 2 - ldr r3, _080829F8 - adds r0, r3 - adds r0, r1 - ldr r7, [r0] - movs r0, 0x1 - mov r9, r0 - str r0, [r7] - adds r0, r7, 0 - adds r0, 0x24 - strb r5, [r0] - lsls r0, r5, 6 - adds r0, r5 - lsls r0, 3 - ldr r1, _080829FC - adds r0, r1 - ldr r1, [r2] - adds r1, r0 - str r1, [r7, 0x70] - movs r5, 0 - mov r3, r10 - strh r3, [r1, 0x2] - ldr r0, [r7, 0x70] - mov r1, r8 - strh r1, [r0, 0x4] - ldr r0, [r7, 0x70] - strb r5, [r0, 0x6] - mov r0, r8 - bl GetSpriteData - str r0, [r7, 0x64] - lsls r0, r4, 4 - adds r0, 0x40 - adds r1, r7, 0 - adds r1, 0x68 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x7 - strb r0, [r1] - adds r0, r7, 0 - adds r0, 0x6C - strb r5, [r0] - adds r1, 0x1 - movs r0, 0xFF - strb r0, [r1] - adds r0, r7, 0 - adds r0, 0x6D - mov r3, r9 - strb r3, [r0] - adds r0, 0x2 - strb r3, [r0] - movs r0, 0 - str r0, [r7, 0x1C] - bl sub_8045ACC - ldr r0, [r7, 0x70] - ldr r1, _08082A00 - adds r0, r1 - strb r4, [r0] - ldr r0, [r7, 0x70] - movs r3, 0xB4 - lsls r3, 1 - adds r0, r3 - strb r6, [r0] - cmp r6, 0 - beq _080829E4 - ldr r3, _08082A04 - movs r2, 0x1 - adds r1, r6, 0 -_080829D8: - adds r0, r4, r3 - strb r2, [r0] - adds r4, 0x1 - subs r1, 0x1 - cmp r1, 0 - bne _080829D8 -_080829E4: - adds r0, r7, 0 -_080829E6: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_080829F4: .4byte gDungeon -_080829F8: .4byte 0x0001357c -_080829FC: .4byte 0x0000069c -_08082A00: .4byte 0x00000167 -_08082A04: .4byte gUnknown_202EE70 - thumb_func_end sub_80828E0 - - thumb_func_start sub_8082A08 -sub_8082A08: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r5, r2, 0 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - lsls r1, 16 - asrs r1, 16 - mov r9, r1 - movs r0, 0x1 - negs r0, r0 - mov r8, r0 - mov r0, r9 - bl GetBodySize - lsls r0, 24 - lsrs r6, r0, 24 - movs r3, 0 - movs r0, 0x10 - subs r4, r0, r6 - ldr r7, _08082A3C - b _08082A42 - .align 2, 0 -_08082A3C: .4byte gUnknown_202EE76 -_08082A40: - adds r3, 0x1 -_08082A42: - cmp r3, r4 - bgt _08082A64 - movs r2, 0 - cmp r2, r6 - bge _08082A5E - adds r1, r3, r7 - b _08082A58 -_08082A50: - adds r1, 0x1 - adds r2, 0x1 - cmp r2, r6 - bge _08082A5E -_08082A58: - ldrb r0, [r1] - cmp r0, 0 - beq _08082A50 -_08082A5E: - cmp r2, r6 - bne _08082A40 - mov r8, r3 -_08082A64: - movs r0, 0x1 - negs r0, r0 - cmp r8, r0 - bne _08082A70 - movs r0, 0 - b _08082B1C -_08082A70: - ldr r2, _08082B2C - ldr r0, [r2] - lsls r1, r5, 2 - ldr r3, _08082B30 - adds r0, r3 - adds r0, r1 - ldr r7, [r0] - movs r4, 0x1 - str r4, [r7] - adds r0, r7, 0 - adds r0, 0x24 - movs r1, 0 - mov r10, r1 - strb r5, [r0] - subs r0, 0x2 - mov r3, r10 - strb r3, [r0] - lsls r0, r5, 6 - adds r0, r5 - lsls r0, 3 - ldr r1, _08082B34 - adds r0, r1 - ldr r1, [r2] - adds r1, r0 - str r1, [r7, 0x70] - movs r5, 0 - mov r2, sp - ldrh r2, [r2] - strh r2, [r1, 0x2] - ldr r0, [r7, 0x70] - mov r3, r9 - strh r3, [r0, 0x4] - ldr r0, [r7, 0x70] - strb r4, [r0, 0x6] - mov r0, r9 - bl GetSpriteData - str r0, [r7, 0x64] - mov r1, r8 - lsls r0, r1, 4 - adds r0, 0xA0 - adds r1, r7, 0 - adds r1, 0x68 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x7 - strb r0, [r1] - adds r0, r7, 0 - adds r0, 0x6C - strb r5, [r0] - adds r1, 0x1 - movs r0, 0xFF - strb r0, [r1] - adds r0, r7, 0 - adds r0, 0x6D - strb r4, [r0] - adds r0, 0x2 - strb r4, [r0] - mov r2, r10 - str r2, [r7, 0x1C] - ldr r0, [r7, 0x70] - ldr r3, _08082B38 - adds r0, r3 - mov r4, r8 - strb r4, [r0] - ldr r0, [r7, 0x70] - movs r1, 0xB4 - lsls r1, 1 - adds r0, r1 - strb r6, [r0] - cmp r6, 0 - beq _08082B16 - ldr r3, _08082B3C - movs r2, 0x1 - adds r1, r6, 0 -_08082B06: - mov r4, r8 - adds r0, r4, r3 - strb r2, [r0] - movs r0, 0x1 - add r8, r0 - subs r1, 0x1 - cmp r1, 0 - bne _08082B06 -_08082B16: - bl sub_8045ACC - adds r0, r7, 0 -_08082B1C: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08082B2C: .4byte gDungeon -_08082B30: .4byte 0x0001358c -_08082B34: .4byte 0x00000ebc -_08082B38: .4byte 0x00000167 -_08082B3C: .4byte gUnknown_202EE76 - thumb_func_end sub_8082A08 - - .align 2,0 diff --git a/charmap.txt b/charmap.txt index b0918f42d..b5fd5ca5d 100644 --- a/charmap.txt +++ b/charmap.txt @@ -115,6 +115,7 @@ '”' = 7E 39 34 '•' = 95 @ 96, 97 are not hyphens, 'er', and 're' superscripts in kanji_a +INVALID_SEQUENCE_976C = 97 6C 'Ëś' = 98 '™' = 99 'š' = 9A @@ -229,17 +230,21 @@ 'A' = 82 60 'B' = 82 61 'C' = 82 62 +'ă„' = 82 A2 'ă†' = 82 A4 'ă‹' = 82 A9 'ăŚ' = 82 AA +'ăŤ' = 82 AB +'ă•' = 82 B3 'ă—' = 82 B5 'ă™' = 82 B7 'ăŞ' = 82 C8 'ă«' = 82 C9 'ă‚‚' = 82 CC -'ăż' = 82 DC -'ăľ' = 82 DD +'ăľ' = 82 DC +'ăż' = 82 DD 'ă®' = 82 E0 +'ă‚„' = 82 E2 'ă‚' = 82 E6 'ă‚‹' = 82 E9 'ă‚’' = 82 F0 diff --git a/data/data_80F4E2C.s b/data/data_80F4E2C.s index a13859592..a95b7e466 100644 --- a/data/data_80F4E2C.s +++ b/data/data_80F4E2C.s @@ -812,5 +812,12 @@ gUnknown_80F51EC: @ 80F51EC .global gUnknown_80F520C gUnknown_80F520C: @ 80F520C @ replacing .incbin "baserom.gba", 0x000f520c, 0x20 -.byte 0x01, 0x00, 0x78, 0x01, 0x02, 0x00, 0x7a, 0x01, 0x01, 0x00, 0x78, 0x01, 0x01, 0x00, 0x78, 0x01, 0x03, 0x00, 0x7b, 0x01, 0x06, 0x00, 0x79, 0x01, 0x03, 0x00, 0x7b, 0x01, 0x06, 0x00, 0x79, 0x01 +.byte 0x01, 0x00, 0x78, 0x01 +.byte 0x02, 0x00, 0x7a, 0x01 +.byte 0x01, 0x00, 0x78, 0x01 +.byte 0x01, 0x00, 0x78, 0x01 +.byte 0x03, 0x00, 0x7b, 0x01 +.byte 0x06, 0x00, 0x79, 0x01 +.byte 0x03, 0x00, 0x7b, 0x01 +.byte 0x06, 0x00, 0x79, 0x01 diff --git a/data/data_80F59C8.s b/data/data_80F59C8.s index 99c6433b4..df0cd8276 100644 --- a/data/data_80F59C8.s +++ b/data/data_80F59C8.s @@ -465,7 +465,8 @@ gUnknown_80F683C: @ 80F683C .global gUnknown_80F6850 gUnknown_80F6850: @ 80F6850 @ replacing .incbin "baserom.gba", 0xF6850, 0x10 -.byte 0x9e, 0x01, 0xa1, 0x01, 0xa2, 0x01, 0xa3, 0x01, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 +.byte 0x9e, 0x01, 0xa1, 0x01, 0xa2, 0x01, 0xa3, 0x01 +.byte 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 .global gSpeedTurns gSpeedTurns: @ 80F6860 diff --git a/data/data_8107010.s b/data/data_8107010.s index ffa26cedf..90934e658 100644 --- a/data/data_8107010.s +++ b/data/data_8107010.s @@ -1,4 +1,5 @@ .section .rodata + @ ??? .string "pksdir0\0" @ sub_807218C @@ -89,1535 +90,4 @@ gUnknown_8107178: @ 8107178 .string "pksdir0\0" @ ??? .string "pksdir0\0" -@ WriteDungeonState - sub_808217C -.string "pksdir0\0" - -.global gYayoiSan -gYayoiSan: @ 81071D4 -.byte 0x82, 0xe2, 0x82, 0xe6, 0x82, 0xa2, 0x97, 0x6c, 0x00, 0x00, 0x00, 0x00 - -.global gMisakiSan -gMisakiSan: @ 81071E0 -.byte 0x82, 0xdd, 0x82, 0xb3, 0x82, 0xab, 0x97, 0x6c, 0x00, 0x00, 0x00, 0x00 -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ START code_808417C #1 -.string "pksdir0\0" - -.string "pksdir0\0" - -.global gUnknown_8107224 -gUnknown_8107224: @ 8107224 -@ replacing .incbin "baserom.gba", 0x107224, 0x10 -.string "??????\0" -.align 2, 0 -@ END code_808417C #1 -@ code_8085B0C -.string "pksdir0\0" - -.global gUnknown_8107234 -gUnknown_8107234: @ 8107234 -.byte 0x01, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00, 0x00, 0x02, 0x04, 0x02, 0x05, 0x03, 0x06, 0x00, 0x00 -.byte 0x03, 0x07, 0x04, 0x08, 0x05, 0x09, 0x00, 0x00, 0x04, 0x0a, 0x06, 0x0b, 0x07, 0x0c, 0x00, 0x00 -.byte 0x05, 0x0d, 0x08, 0x0e, 0x09, 0x0f, 0x00, 0x00, 0x06, 0x10, 0x0a, 0x11, 0x0a, 0x11, 0x00, 0x00 -.byte 0x07, 0x12, 0x0b, 0x13, 0x0c, 0x14, 0x00, 0x00, 0x14, 0x15, 0x0d, 0x16, 0x0d, 0x16, 0x00, 0x00 -.byte 0x08, 0x17, 0x0e, 0x18, 0x0f, 0x19, 0x00, 0x00, 0x0b, 0x1a, 0x10, 0x1b, 0x11, 0x1c, 0x00, 0x00 -.byte 0x09, 0x1d, 0x12, 0x1e, 0x13, 0x1f, 0x00, 0x00, 0x0c, 0x20, 0x14, 0x21, 0x15, 0x22, 0x00, 0x00 -.byte 0x0d, 0x23, 0x16, 0x24, 0x17, 0x25, 0x00, 0x00, 0x0e, 0x26, 0x18, 0x27, 0x19, 0x28, 0x00, 0x00 -.byte 0x0f, 0x29, 0x40, 0x29, 0x1a, 0x2a, 0x00, 0x00, 0x10, 0x2b, 0x1b, 0x2c, 0x1c, 0x2d, 0x00, 0x00 -.byte 0x11, 0x2e, 0x40, 0x2e, 0x40, 0x2e, 0x00, 0x00, 0x12, 0x2f, 0x40, 0x2f, 0x40, 0x2f, 0x00, 0x00 -.byte 0x13, 0x30, 0x40, 0x30, 0x40, 0x30, 0x00, 0x00, 0x0a, 0x31, 0x40, 0x31, 0x1e, 0x32, 0x00, 0x00 -.byte 0x15, 0x33, 0x40, 0x33, 0x40, 0x33, 0x00, 0x00, 0x16, 0x34, 0x40, 0x34, 0x40, 0x34, 0x00, 0x00 -.byte 0x17, 0x35, 0x40, 0x35, 0x40, 0x35, 0x00, 0x00, 0x19, 0x36, 0x40, 0x36, 0x40, 0x36, 0x00, 0x00 -.byte 0x1b, 0x37, 0x40, 0x37, 0x40, 0x37, 0x00, 0x00, 0x1a, 0x38, 0x20, 0x39, 0x20, 0x39, 0x00, 0x00 -.byte 0x18, 0x3a, 0x21, 0x3b, 0x21, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_8107314 -gUnknown_8107314: @ 8107314 -.byte 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff -.byte 0x02, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff -.byte 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff -.byte 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff -.byte 0x04, 0x00, 0x00, 0x00 - -.global gUnknown_8107358 -gUnknown_8107358: @ 8107358 -.byte 0x04, 0x03, 0x02, 0x03, 0x04, 0x05, 0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x04, 0x05, 0x06, 0x05 -.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_8107374 -gUnknown_8107374: @ 8107374 -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_8107380 -gUnknown_8107380: @ 8107380 -.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -@ ??? -.string "pksdir0\0" -@ code_8086A3C #1 -.string "pksdir0\0" - -.global gUnknown_810739C -gUnknown_810739C: @ 810739C -.byte 0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00 -.byte 0x04, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, 0x05, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00 -.byte 0x06, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x00, 0x00 - -.global gUnknown_81073D4 -gUnknown_81073D4: @ 81073D4 -.byte 0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00 -.byte 0x04, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, 0x05, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00 -.byte 0x06, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x00 - -.global gUnknown_810740C -gUnknown_810740C: @ 810740C -.byte 0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00 -.byte 0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x00, 0x00 -@ code_8086A3C #2 -.string "pksdir0\0" - -.global gUnknown_810744C -gUnknown_810744C: @ 810744C -.byte 0x01, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x09, 0x00, 0x09, 0x00, 0x00, 0x00 - -.global gUnknown_8107464 -gUnknown_8107464: @ 8107464 -.byte 0x05, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00 -.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00 -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" - -.global gUnknown_81074FC -gUnknown_81074FC: @ 81074FC -.byte 0x4e, 0x4f, 0x50, 0x51, 0x4a, 0x49, 0x3e, 0x38 - -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" - -.global gUnknown_8107544 -gUnknown_8107544: @ 8107544 -.byte 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x07, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x0d, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x17, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x12, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x0d, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x17, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 -@ pokemon -.string "pksdir0\0" - -.global gUnknown_81075F4 -gUnknown_81075F4: @ 81075F4 -.string "monspara\0" -.align 2,0 - -.global gUnknown_8107600 -gUnknown_8107600: @ 8107600 -.string "{color YELLOW_RAW}%s{reset}" -.align 2,0 - -.global gUnknown_8107608 -gUnknown_8107608: @ 8107608 -.string "{color CYAN_RAW}%s{reset}" -.align 2,0 - -.global gUnownLetters -gUnownLetters: @ 8107610 -.string "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?\0" -.align 2,0 - -.global gUnknown_8107630 -gUnknown_8107630: @ 8107630 -.string "%s%c\0" -.align 2,0 - -.global gUnknown_8107638 -gUnknown_8107638: @ 8107638 -.string "%s\0" -.align 2,0 - -.global gUnknown_810763C -gUnknown_810763C: @ 810763C -.string "{color}%c%s{reset}\0" - -.global gUnknown_8107645 -gUnknown_8107645: @ 8107645 -.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_8107654 -gUnknown_8107654: @ 8107654 -.byte 0x9d, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00 -.byte 0x33, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_8107684 -gUnknown_8107684: @ 8107684 -.string "kao%03d\0" -.align 2,0 - -.global gUnknown_810768C -gUnknown_810768C: @ 810768C -.string "lvmp%03d\0" -.align 2,0 - -.global gShadowSpriteSizeFlags_8107698 -gShadowSpriteSizeFlags_8107698: @ 8107698 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 -.byte 0x03, 0x00, 0x00, 0x00 - -.global gUnknown_81076BC -gUnknown_81076BC: @ 81076BC -.string "etcfont\0" -.align 2,0 - -.global gUnknown_81076C4 -gUnknown_81076C4: @ 81076C4 -.4byte -4 -.4byte -8 -.4byte -16 -.4byte -4 -.4byte -8 -.4byte -16 -@ pokemon_3 #1 -.string "pksdir0\0" - -.global gIQSkillGroups -gIQSkillGroups: @ 81076E4 -.4byte 9999 -.4byte 4 -.4byte 1 -.4byte 2 -.4byte 4 -.4byte 4 -.4byte 6 -.4byte 7 -.4byte 8 -.4byte 9 -.4byte 9 -.4byte 9 -.4byte 10 -.4byte 10 -.4byte 11 -.4byte 11 -.4byte 14 -.4byte 14 -.4byte 14 -.4byte 16 -.4byte 16 -.4byte 9 -.4byte 17 -.4byte 6 -@ pokemon_3 #2 -.string "pksdir0\0" -@ pokemon_3 #3 -.string "pksdir0\0" - -.global gUnknown_8107754 -gUnknown_8107754: @ 8107754 -.string "Stats\0" -.align 2,0 - -.global gUnknown_810775C -gUnknown_810775C: @ 810775C -.string "Features\0" -.align 2,0 - -.global gUnknown_8107768 -gUnknown_8107768: @ 8107768 -.string "Type:\0" -.align 2,0 - -.global gUnknown_8107770 -gUnknown_8107770: @ 8107770 -.string "Special Abilities:\0" -.align 2,0 - -.global gUnknown_8107784 -gUnknown_8107784: @ 8107784 -.string "{MOVE_ITEM_1}\0" -.align 2,0 - -.global gUnknown_8107788 -gUnknown_8107788: @ 8107788 -.byte 0x87, 0x42, 0x00, 0x00 - -.global gUnknown_810778C -gUnknown_810778C: @ 810778C -.byte 0x87, 0x40, 0x00, 0x00 - -.global gUnknown_8107790 -gUnknown_8107790: @ 8107790 -.string "{MOVE_ITEM_0}{MOVE_ITEM_1}\0" -.align 2,0 - -.global gUnknown_8107798 -gUnknown_8107798: @ 8107798 -.string "Info\0" -.align 2,0 -@ dungeon -.string "pksdir0\0" -.align 2,0 - -.global gDungeonFloorCount -gDungeonFloorCount: @ 81077A8 -@ replacing .incbin "baserom.gba", 0x1077A8, 0x40 -.byte 0x04, 0x06, 0x0a, 0x0e, 0x0a, 0x0b, 0x04, 0x0d, 0x0f, 0x0d, 0x04, 0x0a, 0x06, 0x10, 0x06, 0x18 -.byte 0x04, 0x1a, 0x0a, 0x29, 0x64, 0x15, 0x05, 0x64, 0x15, 0x0c, 0x64, 0x64, 0x1a, 0x1a, 0x0d, 0x15 -.byte 0x33, 0x1f, 0x1f, 0x1f, 0x15, 0x1f, 0x10, 0x0d, 0x14, 0x1f, 0x0b, 0x10, 0x15, 0x15, 0x1f, 0x05 -.byte 0x05, 0x0b, 0x03, 0x33, 0x46, 0x10, 0x1f, 0x14, 0x14, 0x0c, 0x64, 0x4c, 0x29, 0x64, 0x64, 0x02 - -.global gUnknown_81077E8 -gUnknown_81077E8: @ 81077E8 -@ replacing .incbin "baserom.gba", 0x1077E8, 0x40 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_8107828 -gUnknown_8107828: @ 8107828 -@ replacing .incbin "baserom.gba", 0x107828, 0x85C -.byte 0x02, 0x09, 0x00, 0x00, 0x03, 0x0d, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x0a, 0x03, 0x00, 0x00 -.byte 0x0c, 0x05, 0x00, 0x00, 0x0e, 0x05, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00 -.byte 0x12, 0x09, 0x00, 0x00, 0x13, 0x28, 0x00, 0x00, 0x14, 0x63, 0x00, 0x00, 0x15, 0x14, 0x00, 0x00 -.byte 0x17, 0x3b, 0x00, 0x00, 0x17, 0x63, 0x00, 0x00, 0x1a, 0x14, 0x00, 0x00, 0x1a, 0x32, 0x00, 0x00 -.byte 0x1a, 0x63, 0x00, 0x00, 0x1b, 0x0f, 0x00, 0x00, 0x1b, 0x19, 0x00, 0x00, 0x1b, 0x23, 0x00, 0x00 -.byte 0x1b, 0x2d, 0x00, 0x00, 0x1b, 0x3c, 0x00, 0x00, 0x1b, 0x46, 0x00, 0x00, 0x1b, 0x50, 0x00, 0x00 -.byte 0x1d, 0x19, 0x00, 0x00, 0x21, 0x14, 0x00, 0x00, 0x21, 0x1e, 0x00, 0x00, 0x22, 0x1e, 0x00, 0x00 -.byte 0x23, 0x14, 0x00, 0x00, 0x23, 0x1e, 0x00, 0x00, 0x24, 0x0a, 0x00, 0x00, 0x24, 0x0f, 0x00, 0x00 -.byte 0x24, 0x14, 0x00, 0x00, 0x25, 0x1e, 0x00, 0x00, 0x29, 0x0f, 0x00, 0x00, 0x29, 0x19, 0x00, 0x00 -.byte 0x2a, 0x0a, 0x00, 0x00, 0x31, 0x01, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0x31, 0x03, 0x00, 0x00 -.byte 0x31, 0x04, 0x00, 0x00, 0x31, 0x05, 0x00, 0x00, 0x31, 0x06, 0x00, 0x00, 0x31, 0x07, 0x00, 0x00 -.byte 0x31, 0x08, 0x00, 0x00, 0x31, 0x09, 0x00, 0x00, 0x31, 0x0a, 0x00, 0x00, 0x34, 0x03, 0x00, 0x00 -.byte 0x34, 0x06, 0x00, 0x00, 0x34, 0x09, 0x00, 0x00, 0x34, 0x0c, 0x00, 0x00, 0x34, 0x0f, 0x00, 0x00 -.byte 0x34, 0x12, 0x00, 0x00, 0x34, 0x15, 0x00, 0x00, 0x34, 0x18, 0x00, 0x00, 0x34, 0x1b, 0x00, 0x00 -.byte 0x34, 0x1e, 0x00, 0x00, 0x34, 0x21, 0x00, 0x00, 0x34, 0x24, 0x00, 0x00, 0x34, 0x27, 0x00, 0x00 -.byte 0x34, 0x2a, 0x00, 0x00, 0x34, 0x2d, 0x00, 0x00, 0x34, 0x30, 0x00, 0x00, 0x34, 0x33, 0x00, 0x00 -.byte 0x34, 0x36, 0x00, 0x00, 0x34, 0x39, 0x00, 0x00, 0x34, 0x3c, 0x00, 0x00, 0x34, 0x3f, 0x00, 0x00 -.byte 0x34, 0x42, 0x00, 0x00, 0x34, 0x45, 0x00, 0x00, 0x35, 0x0f, 0x00, 0x00, 0x3b, 0x32, 0x00, 0x00 -.byte 0x3b, 0x48, 0x00, 0x00, 0x3c, 0x1e, 0x00, 0x00, 0x3c, 0x28, 0x00, 0x00, 0x3e, 0x63, 0x00, 0x00 -.byte 0x3f, 0xff, 0x00, 0x00 - -.global gUnknown_810795C -gUnknown_810795C: @ 810795C -.byte 0x00, 0x01, 0x01, 0x01 - -.global gUnknown_8107960 -gUnknown_8107960: @ 8107960 -.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107966 -gUnknown_8107966: @ 8107966 -.byte 0x00, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107970 -gUnknown_8107970: @ 8107970 -.byte 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 -.byte 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 - -.global gUnknown_810797E -gUnknown_810797E: @ 810797E -.byte 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03 - -.global gUnknown_8107988 -gUnknown_8107988: @ 8107988 -.byte 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 - -.global gUnknown_8107993 -gUnknown_8107993: @ 8107993 -.byte 0x00, 0x03, 0x03, 0x03 - -.global gUnknown_8107997 -gUnknown_8107997: @ 8107997 -.byte 0x00 -.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 - -.global gUnknown_81079A4 -gUnknown_81079A4: @ 81079A4 -.byte 0x00, 0x04, 0x04, 0x04 -.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 - -.global gUnknown_81079B3 -gUnknown_81079B3: @ 81079B3 -.byte 0x00, 0x04, 0x04, 0x04, 0x04 -.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 - -.global gUnknown_81079C0 -gUnknown_81079C0: @ 81079C0 -.byte 0x00, 0x04, 0x04, 0x04 - -.global gUnknown_81079C4 -gUnknown_81079C4: @ 81079C4 -.byte 0x00, 0x04, 0x04, 0x04 -.byte 0x04, 0x04, 0x05, 0x05, 0x05, 0x05 - -.global gUnknown_81079CE -gUnknown_81079CE: @ 81079CE -.byte 0x00, 0x05, 0x05, 0x05, 0x05, 0x05 - -.global gUnknown_81079D4 -gUnknown_81079D4: @ 81079D4 -.byte 0x00, 0x05, 0x05, 0x05 -.byte 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 - -.global gUnknown_81079E4 -gUnknown_81079E4: @ 81079E4 -.byte 0x00, 0x05, 0x05, 0x05 -.byte 0x05, 0x05 - -.global gUnknown_81079EA -gUnknown_81079EA: @ 81079EA -.byte 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 -.byte 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 - -.global gUnknown_8107A02 -gUnknown_8107A02: @ 8107A02 -.byte 0x00, 0x06, 0x06, 0x06 - -.global gUnknown_8107A06 -gUnknown_8107A06: @ 8107A06 -.byte 0x00, 0x06 -.byte 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 -.byte 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 - -.global gUnknown_8107A20 -gUnknown_8107A20: @ 8107A20 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07 - -.global gUnknown_8107A2A -gUnknown_8107A2A: @ 8107A2A -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 - -.global gUnknown_8107A53 -gUnknown_8107A53: @ 8107A53 -.byte 0x00, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b - -.global gUnknown_8107AB7 -gUnknown_8107AB7: @ 8107AB7 -.byte 0x00 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08 - -.global gUnknown_8107ACC -gUnknown_8107ACC: @ 8107ACC -.byte 0x00, 0x05, 0x05, 0x05, 0x05 - -.global gUnknown_8107AD1 -gUnknown_8107AD1: @ 8107AD1 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c - -.global gUnknown_8107B35 -gUnknown_8107B35: @ 8107B35 -.byte 0x00, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08 - -.global gUnknown_8107B4A -gUnknown_8107B4A: @ 8107B4A -.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107B56 -gUnknown_8107B56: @ 8107B56 -.byte 0x00, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09 -.byte 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c - -.global gUnknown_8107BBA -gUnknown_8107BBA: @ 8107BBA -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c - -.global gUnknown_8107C1E -gUnknown_8107C1E: @ 8107C1E -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 - -.global gUnknown_8107C38 -gUnknown_8107C38: @ 8107C38 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 - -.global gUnknown_8107C52 -gUnknown_8107C52: @ 8107C52 -.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107C5F -gUnknown_8107C5F: @ 8107C5F -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 - -.global gUnknown_8107C74 -gUnknown_8107C74: @ 8107C74 -.byte 0x00, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 -.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 - -.global gUnknown_8107CA7 -gUnknown_8107CA7: @ 8107CA7 -.byte 0x00 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 - -.global gUnknown_8107CC6 -gUnknown_8107CC6: @ 8107CC6 -.byte 0x00, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 - -.global gUnknown_8107CE5 -gUnknown_8107CE5: @ 8107CE5 -.byte 0x00, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 - -.global gUnknown_8107D04 -gUnknown_8107D04: @ 8107D04 -.byte 0x00, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08 - -.global gUnknown_8107D19 -gUnknown_8107D19: @ 8107D19 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 - -.global gUnknown_8107D38 -gUnknown_8107D38: @ 8107D38 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 - -.global gUnknown_8107D48 -gUnknown_8107D48: @ 8107D48 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08 - -.global gUnknown_8107D55 -gUnknown_8107D55: @ 8107D55 -.byte 0x00, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08 - -.global gUnknown_8107D69 -gUnknown_8107D69: @ 8107D69 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 - -.global gUnknown_8107D88 -gUnknown_8107D88: @ 8107D88 -.byte 0x00, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 - -.global gUnknown_8107D93 -gUnknown_8107D93: @ 8107D93 -.byte 0x00, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 - -.global gUnknown_8107DA3 -gUnknown_8107DA3: @ 8107DA3 -.byte 0x00, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 - -.global gUnknown_8107DB8 -gUnknown_8107DB8: @ 8107DB8 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x08 - -.global gUnknown_8107DCD -gUnknown_8107DCD: @ 8107DCD -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x09 - -.global gUnknown_8107DEC -gUnknown_8107DEC: @ 8107DEC -.byte 0x00, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107DF1 -gUnknown_8107DF1: @ 8107DF1 -.byte 0x00, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107DF6 -gUnknown_8107DF6: @ 8107DF6 -.byte 0x00, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107E01 -gUnknown_8107E01: @ 8107E01 -.byte 0x00, 0x01, 0x01 - -.global gUnknown_8107E04 -gUnknown_8107E04: @ 8107E04 -.byte 0x00, 0x0f, 0x0f, 0x0f -.byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f -.byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f -.byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f - -.global gUnknown_8107E37 -gUnknown_8107E37: @ 8107E37 -.byte 0x00 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107E7D -gUnknown_8107E7D: @ 8107E7D -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07 - -.global gUnknown_8107E8D -gUnknown_8107E8D: @ 8107E8D -.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107EAC -gUnknown_8107EAC: @ 8107EAC -.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 -.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - -.global gUnknown_8107EC0 -gUnknown_8107EC0: @ 8107EC0 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 - -.global gUnknown_8107ED4 -gUnknown_8107ED4: @ 8107ED4 -.byte 0x00, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 - -.global gUnknown_8107EE0 -gUnknown_8107EE0: @ 8107EE0 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c - -.global gUnknown_8107F44 -gUnknown_8107F44: @ 8107F44 -.byte 0x00, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c - -.global gUnknown_8107F90 -gUnknown_8107F90: @ 8107F90 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a - -.global gUnknown_8107FB9 -gUnknown_8107FB9: @ 8107FB9 -.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 -.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 -.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c - -.global gUnknown_810801D -gUnknown_810801D: @ 810801D -.byte 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a -.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b -.byte 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c -.byte 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e -.byte 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e - -.global gUnknown_8108081 -gUnknown_8108081: @ 8108081 -.byte 0x00, 0x07, 0x00 - -.global gUnknown_8108084 -gUnknown_8108084: @ 8108084 -@ replacing .incbin "baserom.gba", 0x108084, 0xDD4 -.4byte gUnknown_810795C -.4byte gUnknown_8107960 -.4byte gUnknown_8107966 -.4byte gUnknown_8107970 -.4byte gUnknown_810797E -.4byte gUnknown_8107988 -.4byte gUnknown_8107993 -.4byte gUnknown_8107997 -.4byte gUnknown_81079A4 -.4byte gUnknown_81079B3 -.4byte gUnknown_81079C0 -.4byte gUnknown_81079C4 -.4byte gUnknown_81079CE -.4byte gUnknown_81079D4 -.4byte gUnknown_81079E4 -.4byte gUnknown_81079EA -.4byte gUnknown_8107A02 -.4byte gUnknown_8107A06 -.4byte gUnknown_8107A20 -.4byte gUnknown_8107A2A -.4byte gUnknown_8107A53 -.4byte gUnknown_8107AB7 -.4byte gUnknown_8107ACC -.4byte gUnknown_8107AD1 -.4byte gUnknown_8107B35 -.4byte gUnknown_8107B4A -.4byte gUnknown_8107B56 -.4byte gUnknown_8107BBA -.4byte gUnknown_8107C1E -.4byte gUnknown_8107C38 -.4byte gUnknown_8107C52 -.4byte gUnknown_8107C5F -.4byte gUnknown_8107C74 -.4byte gUnknown_8107CA7 -.4byte gUnknown_8107CC6 -.4byte gUnknown_8107CE5 -.4byte gUnknown_8107D04 -.4byte gUnknown_8107D19 -.4byte gUnknown_8107D38 -.4byte gUnknown_8107D48 -.4byte gUnknown_8107D55 -.4byte gUnknown_8107D69 -.4byte gUnknown_8107D88 -.4byte gUnknown_8107D93 -.4byte gUnknown_8107DA3 -.4byte gUnknown_8107DB8 -.4byte gUnknown_8107DCD -.4byte gUnknown_8107DEC -.4byte gUnknown_8107DF1 -.4byte gUnknown_8107DF6 -.4byte gUnknown_8107E01 -.4byte gUnknown_8107E04 -.4byte gUnknown_8107E37 -.4byte gUnknown_8107E7D -.4byte gUnknown_8107E8D -.4byte gUnknown_8107EAC -.4byte gUnknown_8107EC0 -.4byte gUnknown_8107ED4 -.4byte gUnknown_8107EE0 -.4byte gUnknown_8107F44 -.4byte gUnknown_8107F90 -.4byte gUnknown_8107FB9 -.4byte gUnknown_810801D -.4byte gUnknown_8108081 - -.global gUnknown_8108184 -gUnknown_8108184: @ 8108184 -.byte 0x31, 0x75, 0xa0, 0x0f, 0x10, 0x27, 0x40, 0x75, 0x10, 0x27, 0x62, 0x75, 0xa0, 0x0f, 0x38, 0x75 -.byte 0x70, 0x17, 0x39, 0x75, 0x10, 0x27, 0xd2, 0x75 - -.global gUnknown_810819C -gUnknown_810819C: @ 810819C -.byte 0x31, 0x75, 0x98, 0x04, 0x62, 0x12, 0x2b, 0x20 -.byte 0x10, 0x27, 0x3e, 0x75, 0x10, 0x27, 0x3b, 0x75, 0x05, 0x0d, 0x0b, 0x1a, 0x3c, 0x75, 0x10, 0x27 -.byte 0x43, 0x75, 0xd0, 0x07, 0x34, 0x75, 0xa0, 0x0f, 0x38, 0x75, 0x70, 0x17, 0x39, 0x75, 0x10, 0x27 -.byte 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10 -.byte 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22 -.byte 0xc4, 0x24, 0x10, 0x27, 0xb9, 0x75 - -.global gUnknown_81081EA -gUnknown_81081EA: @ 81081EA -.byte 0x31, 0x75, 0x20, 0x03, 0x80, 0x0c, 0x40, 0x1f, 0xf0, 0x23 -.byte 0x10, 0x27, 0x3d, 0x75, 0x10, 0x27, 0x3a, 0x75, 0xc4, 0x09, 0x88, 0x13, 0x4c, 0x1d, 0x3c, 0x75 -.byte 0x10, 0x27, 0x43, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75 -.byte 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12 -.byte 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24 -.byte 0x10, 0x27, 0x49, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75 -.byte 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10 -.byte 0x32, 0x75, 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16, 0xb7, 0x17 -.byte 0x36, 0x75, 0x82, 0x1a, 0x4c, 0x1d, 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x75, 0x75 - -.global gUnknown_8108274 -gUnknown_8108274: @ 8108274 -.byte 0x31, 0x75, 0x01, 0x03, 0x05, 0x0c, 0x0c, 0x1e, 0x8e, 0x22, 0x10, 0x27, 0x3d, 0x75, 0x10, 0x27 -.byte 0x3a, 0x75, 0xd0, 0x07, 0xa0, 0x0f, 0x70, 0x17, 0x3c, 0x75, 0x40, 0x1f, 0x3b, 0x75, 0x10, 0x27 -.byte 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02 -.byte 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14 -.byte 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27 -.byte 0x49, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75, 0x29, 0x0b -.byte 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10, 0x32, 0x75 -.byte 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16, 0xb7, 0x17, 0x36, 0x75 -.byte 0x82, 0x1a, 0x4c, 0x1d, 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x75, 0x75 - -.global gUnknown_8108302 -gUnknown_8108302: @ 8108302 -.byte 0x32, 0x75 -.byte 0xd0, 0x07, 0x70, 0x17, 0x40, 0x1f, 0x10, 0x27, 0x40, 0x75, 0x83, 0x06, 0x37, 0x75, 0x05, 0x0d -.byte 0x88, 0x13, 0x0b, 0x1a, 0x3c, 0x75, 0x8d, 0x20, 0x3b, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d -.byte 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06 -.byte 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19 -.byte 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x49, 0x75, 0x65, 0x01 -.byte 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75, 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75 -.byte 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10, 0x32, 0x75, 0x23, 0x12, 0x88, 0x13 -.byte 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16, 0xb7, 0x17, 0x36, 0x75, 0x82, 0x1a, 0x4c, 0x1d -.byte 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x75, 0x75 - -.global gUnknown_810838E -gUnknown_810838E: @ 810838E -.byte 0x32, 0x75, 0x04, 0x09, 0x09, 0x15 -.byte 0x0c, 0x1e, 0x10, 0x27, 0x40, 0x75, 0x83, 0x06, 0x37, 0x75, 0x05, 0x0d, 0x88, 0x13, 0x0b, 0x1a -.byte 0x3c, 0x75, 0x8d, 0x20, 0x3b, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a -.byte 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b -.byte 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d -.byte 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01 -.byte 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b -.byte 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75 -.byte 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15 -.byte 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19 -.byte 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x75, 0x75 - -.global gUnknown_8108432 -gUnknown_8108432: @ 8108432 -.byte 0x32, 0x75 -.byte 0xc4, 0x09, 0x88, 0x13, 0x4c, 0x1d, 0x10, 0x27, 0x40, 0x75, 0x83, 0x06, 0x37, 0x75, 0x05, 0x0d -.byte 0x88, 0x13, 0x0b, 0x1a, 0x3c, 0x75, 0x8d, 0x20, 0x3b, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d -.byte 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06 -.byte 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19 -.byte 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00 -.byte 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75 -.byte 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e -.byte 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13 -.byte 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19 -.byte 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27 -.byte 0x75, 0x75 - -.global gUnknown_81084D6 -gUnknown_81084D6: @ 81084D6 -.byte 0x32, 0x75, 0xc4, 0x09, 0x88, 0x13, 0x4c, 0x1d, 0x10, 0x27, 0x40, 0x75, 0x95, 0x05 -.byte 0x37, 0x75, 0x29, 0x0b, 0xbe, 0x10, 0x52, 0x16, 0x3c, 0x75, 0xe7, 0x1b, 0x33, 0x75, 0x7b, 0x21 -.byte 0x37, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27 -.byte 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10 -.byte 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22 -.byte 0xc4, 0x24, 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04 -.byte 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d -.byte 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75 -.byte 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16 -.byte 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e -.byte 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x75, 0x75 - -.global gUnknown_810857E -gUnknown_810857E: @ 810857E -.byte 0x32, 0x75, 0xc4, 0x09, 0x88, 0x13 -.byte 0x4c, 0x1d, 0x10, 0x27, 0x40, 0x75, 0x57, 0x04, 0x37, 0x75, 0xae, 0x08, 0x05, 0x0d, 0x5c, 0x11 -.byte 0x39, 0x75, 0xb4, 0x15, 0x32, 0x75, 0x0b, 0x1a, 0x62, 0x1e, 0x32, 0x75, 0xb9, 0x22, 0x37, 0x75 -.byte 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75 -.byte 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12 -.byte 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24 -.byte 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75 -.byte 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75 -.byte 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10 -.byte 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17 -.byte 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20 -.byte 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x75, 0x75 - -.global gUnknown_810862C -gUnknown_810862C: @ 810862C -.byte 0x32, 0x75, 0x56, 0x0c, 0x31, 0x75, 0xac, 0x18 -.byte 0x02, 0x25, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75, 0x57, 0x04, 0x37, 0x75, 0xae, 0x08, 0x05, 0x0d -.byte 0x5c, 0x11, 0x39, 0x75, 0xb4, 0x15, 0x32, 0x75, 0x0b, 0x1a, 0x62, 0x1e, 0x32, 0x75, 0xb9, 0x22 -.byte 0x37, 0x75, 0x10, 0x27, 0x37, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d -.byte 0x32, 0x75, 0x10, 0x27, 0x5f, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04 -.byte 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d -.byte 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75 -.byte 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16 -.byte 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e -.byte 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e -.byte 0x10, 0x27, 0x34, 0x75 - -.global gUnknown_81086C8 -gUnknown_81086C8: @ 81086C8 -.byte 0x32, 0x75, 0x56, 0x0c, 0x31, 0x75, 0xac, 0x18, 0x02, 0x25, 0x34, 0x75 -.byte 0x10, 0x27, 0x3b, 0x75, 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13 -.byte 0x38, 0x75, 0x70, 0x17, 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75 -.byte 0x10, 0x27, 0x37, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d, 0x32, 0x75 -.byte 0x10, 0x27, 0x5f, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75 -.byte 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75 -.byte 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10 -.byte 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17 -.byte 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20 -.byte 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27 -.byte 0x34, 0x75 - -.global gUnknown_8108766 -gUnknown_8108766: @ 8108766 -.byte 0x32, 0x75, 0x35, 0x05, 0x31, 0x75, 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27 -.byte 0x3b, 0x75, 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75 -.byte 0x70, 0x17, 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27 -.byte 0x37, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d, 0x32, 0x75, 0x10, 0x27 -.byte 0x5f, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05 -.byte 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d -.byte 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11 -.byte 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18 -.byte 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22 -.byte 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 - -.global gUnknown_8108804 -gUnknown_8108804: @ 8108804 -.byte 0x32, 0x75, 0x35, 0x05, 0x31, 0x75, 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75 -.byte 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75, 0x70, 0x17 -.byte 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27, 0x37, 0x75 -.byte 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d, 0x32, 0x75, 0x10, 0x27, 0x5f, 0x75 -.byte 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08 -.byte 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d -.byte 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13 -.byte 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75 -.byte 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24 -.byte 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 - -.global gUnknown_81088A2 -gUnknown_81088A2: @ 81088A2 -.byte 0x32, 0x75 -.byte 0x35, 0x05, 0x31, 0x75, 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75, 0xe8, 0x03 -.byte 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75, 0x70, 0x17, 0x32, 0x75 -.byte 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27, 0x4c, 0x75, 0xd0, 0x07 -.byte 0x33, 0x75, 0xa0, 0x0f, 0x70, 0x17, 0x40, 0x1f, 0x10, 0x27, 0x5b, 0x75, 0x4f, 0x00, 0x32, 0x75 -.byte 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a -.byte 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f -.byte 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13 -.byte 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75 -.byte 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75 -.byte 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 - -.global gUnknown_810893E -gUnknown_810893E: @ 810893E -.byte 0x32, 0x75, 0x35, 0x05, 0x31, 0x75 -.byte 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75, 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07 -.byte 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75, 0x70, 0x17, 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f -.byte 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27, 0x4c, 0x75, 0xd0, 0x07, 0x33, 0x75, 0xa0, 0x0f -.byte 0x70, 0x17, 0x40, 0x1f, 0x10, 0x27, 0x5b, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04 -.byte 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75 -.byte 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10 -.byte 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75 -.byte 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b -.byte 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75 -.byte 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 - -.global gUnknown_81089DA -gUnknown_81089DA: @ 81089DA -.byte 0x31, 0x75, 0xe2, 0x04, 0x6a, 0x18, 0x10, 0x27, 0x3f, 0x75 -.byte 0x10, 0x27, 0x5f, 0x75, 0x83, 0x06, 0x32, 0x75, 0xa6, 0x0e, 0x34, 0x75, 0xe7, 0x11, 0x32, 0x75 -.byte 0x29, 0x15, 0x6a, 0x18, 0x31, 0x75, 0xab, 0x1b, 0x31, 0x75, 0x4c, 0x1d, 0x8d, 0x20, 0x33, 0x75 -.byte 0xcf, 0x23, 0x10, 0x27, 0x34, 0x75, 0x88, 0x13, 0x10, 0x27, 0xcc, 0x75 - -.global gUnknown_8108A10 -gUnknown_8108A10: @ 8108A10 -.byte 0x35, 0x75, 0xc4, 0x09 -.byte 0x33, 0x75, 0x10, 0x27, 0xb2, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08 -.byte 0x31, 0x75, 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75 -.byte 0xbe, 0x10, 0x32, 0x75, 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16 -.byte 0xb7, 0x17, 0x36, 0x75, 0x82, 0x1a, 0x4c, 0x1d, 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27 -.byte 0x3b, 0x75, 0xca, 0x02, 0x5f, 0x08, 0x29, 0x0b, 0x34, 0x75, 0xf3, 0x0d, 0x3a, 0x75, 0xe7, 0x1b -.byte 0xb1, 0x1e, 0x7b, 0x21, 0x3f, 0x75, 0x10, 0x27, 0x45, 0x75 - -.global gUnknown_8108A6E -gUnknown_8108A6E: @ 8108A6E -.byte 0xe8, 0x03, 0xd0, 0x07, 0x70, 0x17 -.byte 0x28, 0x23, 0x10, 0x27, 0x39, 0x75, 0x8d, 0x20, 0x10, 0x27, 0x33, 0x75, 0x10, 0x27, 0x32, 0x75 -.byte 0x95, 0x05, 0x36, 0x75, 0x29, 0x0b, 0xbe, 0x10, 0x52, 0x16, 0xe7, 0x1b, 0x7b, 0x21, 0x39, 0x75 -.byte 0x10, 0x27, 0x45, 0x75, 0x95, 0x05, 0x34, 0x75, 0xbe, 0x10, 0x38, 0x75, 0x52, 0x16, 0x31, 0x75 -.byte 0xe7, 0x1b, 0x31, 0x75, 0x7b, 0x21, 0x35, 0x75, 0x10, 0x27, 0x37, 0x75, 0x10, 0x27, 0xca, 0x75 - -.global gUnknown_8108AB4 -gUnknown_8108AB4: @ 8108AB4 -.byte 0x35, 0x75, 0xc4, 0x09, 0x33, 0x75, 0x10, 0x27, 0xb2, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75 -.byte 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75, 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75 -.byte 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10, 0x32, 0x75, 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14 -.byte 0x71, 0x02, 0x52, 0x16, 0xb7, 0x17, 0x34, 0x75, 0xe2, 0x04, 0x31, 0x75, 0x82, 0x1a, 0x4c, 0x1d -.byte 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x3b, 0x75, 0x53, 0x07, 0x35, 0x0c, 0xa6, 0x0e -.byte 0x34, 0x75, 0x17, 0x11, 0x3a, 0x75, 0x4c, 0x1d, 0xbd, 0x1f, 0x2e, 0x22, 0x3f, 0x75, 0x10, 0x27 -.byte 0x45, 0x75 - -.global gUnknown_8108B16 -gUnknown_8108B16: @ 8108B16 -.byte 0xe8, 0x03, 0xd0, 0x07, 0x70, 0x17, 0x28, 0x23, 0x10, 0x27, 0x39, 0x75, 0x8d, 0x20 -.byte 0x10, 0x27, 0x33, 0x75, 0x10, 0x27, 0x32, 0x75, 0x95, 0x05, 0x36, 0x75, 0x29, 0x0b, 0xbe, 0x10 -.byte 0x52, 0x16, 0xe7, 0x1b, 0x7b, 0x21, 0x39, 0x75, 0x10, 0x27, 0x45, 0x75, 0x95, 0x05, 0x34, 0x75 -.byte 0xbe, 0x10, 0x38, 0x75, 0x52, 0x16, 0x31, 0x75, 0xe7, 0x1b, 0x31, 0x75, 0x7b, 0x21, 0x35, 0x75 -.byte 0x10, 0x27, 0x37, 0x75, 0x10, 0x27, 0xca, 0x75 - -.global gUnknown_8108B5C -gUnknown_8108B5C: @ 8108B5C -.byte 0x35, 0x75, 0x6a, 0x18, 0x33, 0x75, 0x10, 0x27 -.byte 0xb2, 0x75, 0x59, 0x01, 0x0a, 0x04, 0x33, 0x75, 0x63, 0x05, 0x15, 0x08, 0x31, 0x75, 0xc7, 0x0a -.byte 0x1f, 0x0c, 0x32, 0x75, 0x78, 0x0d, 0x34, 0x75, 0xd1, 0x0e, 0x32, 0x75, 0x2a, 0x10, 0x32, 0x75 -.byte 0x83, 0x11, 0xdc, 0x12, 0x32, 0x75, 0x34, 0x14, 0x71, 0x02, 0x8d, 0x15, 0xe6, 0x16, 0x3f, 0x18 -.byte 0x33, 0x75, 0xe2, 0x04, 0x31, 0x75, 0xf1, 0x1a, 0xa2, 0x1d, 0x54, 0x20, 0xad, 0x21, 0x5e, 0x24 -.byte 0x10, 0x27, 0x3b, 0x75, 0x53, 0x07, 0x35, 0x0c, 0xa6, 0x0e, 0x34, 0x75, 0x17, 0x11, 0x3a, 0x75 -.byte 0x4c, 0x1d, 0xbd, 0x1f, 0x2e, 0x22, 0x3f, 0x75, 0x10, 0x27, 0x45, 0x75 - -.global gUnknown_8108BC0 -gUnknown_8108BC0: @ 8108BC0 -.byte 0xe8, 0x03, 0xd0, 0x07 -.byte 0x58, 0x1b, 0x28, 0x23, 0x10, 0x27, 0x39, 0x75, 0x8d, 0x20, 0x10, 0x27, 0x33, 0x75, 0x10, 0x27 -.byte 0x32, 0x75, 0x57, 0x04, 0x36, 0x75, 0xae, 0x08, 0x05, 0x0d, 0x5c, 0x11, 0xb4, 0x15, 0x0b, 0x1a -.byte 0x62, 0x1e, 0x3a, 0x75, 0xb9, 0x22, 0x3a, 0x75, 0xe4, 0x24, 0x10, 0x27, 0x37, 0x75, 0xe5, 0x02 -.byte 0x34, 0x75, 0xae, 0x08, 0x34, 0x75, 0x78, 0x0e, 0x41, 0x14, 0x32, 0x75, 0x0b, 0x1a, 0x36, 0x75 -.byte 0x7d, 0x1b, 0x31, 0x75, 0x47, 0x21, 0x10, 0x27, 0x37, 0x75, 0x10, 0x27, 0xca, 0x75 - -.global gUnknown_8108C12 -gUnknown_8108C12: @ 8108C12 -.byte 0x35, 0x75 -.byte 0x88, 0x13, 0x33, 0x75, 0x10, 0x27, 0xb2, 0x75, 0x59, 0x01, 0x0a, 0x04, 0x31, 0x75, 0xa1, 0x01 -.byte 0x31, 0x75, 0x63, 0x05, 0x15, 0x08, 0x41, 0x03, 0xc7, 0x0a, 0x1f, 0x0c, 0x32, 0x75, 0x78, 0x0d -.byte 0x31, 0x75, 0xe2, 0x04, 0x32, 0x75, 0xd1, 0x0e, 0x32, 0x75, 0x2a, 0x10, 0x32, 0x75, 0x83, 0x11 -.byte 0xdc, 0x12, 0x32, 0x75, 0x34, 0x14, 0x83, 0x06, 0x8d, 0x15, 0xe6, 0x16, 0x3f, 0x18, 0x31, 0x75 -.byte 0x23, 0x08, 0x31, 0x75, 0xc4, 0x09, 0x31, 0x75, 0xf1, 0x1a, 0xa2, 0x1d, 0x54, 0x20, 0xad, 0x21 -.byte 0x5e, 0x24, 0x10, 0x27, 0x38, 0x75, 0x65, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x47, 0x10, 0xe7, 0x11 -.byte 0x88, 0x13, 0x33, 0x75, 0x29, 0x15, 0x35, 0x75, 0x6a, 0x18, 0xab, 0x1b, 0x34, 0x75, 0x4c, 0x1d -.byte 0xed, 0x1e, 0x8d, 0x20, 0x2e, 0x22, 0xcf, 0x23, 0x3c, 0x75, 0x10, 0x27, 0x45, 0x75 - -.global gUnknown_8108C92 -gUnknown_8108C92: @ 8108C92 -.byte 0x01, 0x03 -.byte 0x02, 0x06, 0x0a, 0x18, 0x0b, 0x1b, 0x0c, 0x1e, 0x34, 0x75, 0x10, 0x27, 0x33, 0x75, 0xb6, 0x16 -.byte 0x56, 0x24, 0x10, 0x27, 0x33, 0x75, 0x58, 0x1b, 0x10, 0x27, 0x40, 0x75, 0x10, 0x27, 0x50, 0x75 -.byte 0x88, 0x13, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09 -.byte 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b -.byte 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x7c, 0x75, 0x81, 0x01, 0x32, 0x75 -.byte 0x01, 0x03, 0x02, 0x06, 0x83, 0x07, 0x04, 0x09, 0x84, 0x0a, 0x31, 0x75, 0x86, 0x0d, 0x06, 0x0f -.byte 0x87, 0x10, 0x88, 0x13, 0x33, 0x75, 0x89, 0x16, 0x8a, 0x19, 0x8c, 0x1c, 0x31, 0x75, 0x0c, 0x1e -.byte 0x31, 0x75, 0x8d, 0x1f, 0x0e, 0x21, 0x34, 0x75, 0x8e, 0x22, 0x33, 0x75, 0x0f, 0x24, 0x36, 0x75 -.byte 0x10, 0x27, 0x45, 0x75 - -.global gUnknown_8108D18 -gUnknown_8108D18: @ 8108D18 -.byte 0x56, 0x0c, 0x31, 0x75, 0x81, 0x12, 0x9d, 0x16, 0xba, 0x1a, 0xd7, 0x1e -.byte 0x33, 0x75, 0xf3, 0x22, 0x10, 0x27, 0x35, 0x75, 0x05, 0x0d, 0x0b, 0x1a, 0x10, 0x27, 0x33, 0x75 -.byte 0xb3, 0x01, 0x66, 0x03, 0x31, 0x75, 0x18, 0x05, 0xcb, 0x06, 0x32, 0x75, 0x7e, 0x08, 0x31, 0x0a -.byte 0xe3, 0x0b, 0x96, 0x0d, 0x49, 0x0f, 0xfc, 0x10, 0x36, 0x75, 0xaf, 0x12, 0x61, 0x14, 0x14, 0x16 -.byte 0xc7, 0x17, 0x7a, 0x19, 0x2d, 0x1b, 0x33, 0x75, 0xdf, 0x1c, 0x92, 0x1e, 0x45, 0x20, 0xf8, 0x21 -.byte 0xaa, 0x23, 0x31, 0x75, 0x5d, 0x25, 0x10, 0x27, 0x3c, 0x75, 0x05, 0x0d, 0x3f, 0x75, 0x0b, 0x1a -.byte 0x32, 0x75, 0x10, 0x27, 0x49, 0x75, 0x10, 0x27, 0x45, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01 -.byte 0x08, 0x04, 0x57, 0x04, 0xc4, 0x00, 0x31, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x88, 0x01, 0x8a, 0x0a -.byte 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x31, 0x75, 0x4c, 0x02, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e -.byte 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13 -.byte 0xd7, 0x13, 0x15, 0x15, 0x10, 0x03, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x31, 0x75, 0xd4, 0x03 -.byte 0x1d, 0x19, 0x98, 0x04, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24 -.byte 0x10, 0x27, 0x32, 0x75, 0x5d, 0x05, 0x35, 0x75, 0x21, 0x06, 0xe5, 0x06, 0xa9, 0x07, 0x6d, 0x08 -.byte 0xf5, 0x09, 0xb9, 0x0a, 0x7d, 0x0b, 0x41, 0x0c, 0x05, 0x0d, 0x8d, 0x0e, 0x52, 0x0f, 0x16, 0x10 -.byte 0x9e, 0x11, 0x62, 0x12, 0x26, 0x13, 0x31, 0x75, 0xae, 0x14, 0x36, 0x16, 0xbe, 0x17, 0x83, 0x18 -.byte 0x47, 0x19, 0x0b, 0x1a, 0xcf, 0x1a, 0x93, 0x1b, 0x57, 0x1c, 0x1b, 0x1d, 0xdf, 0x1d, 0x31, 0x75 -.byte 0xa3, 0x1e, 0x33, 0x75, 0x67, 0x1f, 0x2b, 0x20, 0xef, 0x20, 0xb3, 0x21, 0x78, 0x22, 0x32, 0x75 -.byte 0x00, 0x24, 0xc4, 0x24, 0x31, 0x75, 0x88, 0x25, 0x4c, 0x26, 0x10, 0x27, 0x38, 0x75, 0x10, 0x27 -.byte 0x37, 0x75 - -.global gUnknown_8108E36 -gUnknown_8108E36: @ 8108E36 -.byte 0x33, 0x75, 0x83, 0x06, 0x34, 0x75, 0x8d, 0x20, 0x10, 0x27, 0x99, 0x75, 0x10, 0x27 -.byte 0x34, 0x75, 0xc4, 0x09, 0x32, 0x75, 0x88, 0x13, 0x4c, 0x1d, 0x3a, 0x75, 0x10, 0x27, 0x89, 0x75 -.byte 0x10, 0x27, 0x4a, 0x75 - -.global gUnknown_8108E58 -gUnknown_8108E58: @ 8108E58 -@ replacing .incbin "baserom.gba", 0x00108e58, 0x68 -@ u16*s -.4byte gUnknown_8108184 -.4byte gUnknown_810819C -.4byte gUnknown_81081EA -.4byte gUnknown_8108274 -.4byte gUnknown_8108302 -.4byte gUnknown_810838E -.4byte gUnknown_8108432 -.4byte gUnknown_81084D6 -.4byte gUnknown_810857E -.4byte gUnknown_810862C -.4byte gUnknown_81086C8 -.4byte gUnknown_8108766 -.4byte gUnknown_8108804 -.4byte gUnknown_81088A2 -.4byte gUnknown_810893E -.4byte gUnknown_81089DA -.4byte gUnknown_8108A10 -.4byte gUnknown_8108A6E -.4byte gUnknown_8108AB4 -.4byte gUnknown_8108B16 -.4byte gUnknown_8108B5C -.4byte gUnknown_8108BC0 -.4byte gUnknown_8108C12 -.4byte gUnknown_8108C92 -.4byte gUnknown_8108D18 -.4byte gUnknown_8108E36 - -.global gUnknown_8108EC0 -gUnknown_8108EC0: @ 8108EC0 -@ replacing .incbin "baserom.gba", 0x108EC0, 0x50 -.byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f -.byte 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x10, 0x17, 0x18, 0x19, 0x14, 0x17, 0x1c, 0x1d, 0x1e, 0x1f -.byte 0x20, 0x21, 0x1c, 0x23, 0x24, 0x25, 0x1e, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f -.byte 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x2d, 0x2d, 0x3b, 0x3c, 0x30, 0x3e, 0x3f -.byte 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f - -.global gUnknown_8108F10 -gUnknown_8108F10: @ 8108F10 -.string "{color YELLOW_D}%s{reset}\0" -.align 2,0 - -.global gUnknown_8108F18 -gUnknown_8108F18: @ 8108F18 -.string "{color YELLOW_D}%s{reset} {color CYAN}%d{reset}F\0" -.align 2,0 - -.global gUnknown_8108F2C -gUnknown_8108F2C: @ 8108F2C -.string "{color YELLOW_D}%s{reset} B{color CYAN}%d{reset}F\0" -.align 2,0 - -.global gUnknown_8108F40 -gUnknown_8108F40: @ 8108F40 -.byte 0x00, 0x00 - -.global gUnknown_8108F42 -gUnknown_8108F42: @ 8108F42 -.byte 0x99, 0x00, 0x9c, 0x00, 0x9e, 0x00, 0xdb, 0x00 - -.global gUnknown_8108F4A -gUnknown_8108F4A: @ 8108F4A -.byte 0xe1, 0xe7, 0xe6, 0xe2, 0x00, 0x00 - -.global gUnknown_8108F50 -gUnknown_8108F50: @ 8108F50 -.string "No problem.\0" -.align 2,0 -@ items.c -.string "pksdir0\0" -.align 2,0 - -.global gUnknown_8108F64 -gUnknown_8108F64: @ 8108F64 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x2c, 0x01, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0c, 0x21, 0x40, 0x10, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x21, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x84, 0x0c, 0x21, 0x44, 0xff, 0x03, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x11, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x08, 0x00, 0x02, 0x00, 0x80, 0x80, 0x0c, 0x21, 0xc4, 0x55, 0x1d, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x08, 0x02, 0x02, 0x00, 0x80, 0x00, 0x0c, 0x21, 0xc4, 0xfd, 0x25, 0x02, 0x00, 0x00 -.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x21, 0xc0, 0xfe, 0x44, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x08, 0x00, 0x02, 0x00, 0x80, 0x80, 0x0c, 0x21, 0xc4, 0xfc, 0x45, 0x02, 0x00, 0x00 -.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x80, 0x00, 0x18, 0x82, 0x00, 0x00, 0x80, 0x00, 0x0c, 0x21, 0xc4, 0xfd, 0x45, 0x02, 0x00, 0x00 -.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x80, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x70, 0x64, 0x02, 0x00, 0x00 -.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x18, 0x80, 0x02, 0x00, 0x80, 0x00, 0x0c, 0x21, 0x44, 0xfd, 0x61, 0x02, 0x00, 0x00 -.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x20, 0x00, 0x09, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x84, 0x04, 0x38, 0x80, 0x02, 0x00, 0x80, 0x04, 0x0c, 0x21, 0x44, 0xfd, 0x7d, 0x02, 0x00, 0x00 -.byte 0x66, 0x83, 0x93, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x20, 0x40, 0xfd, 0x45, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x8c, 0x14, 0x7e, 0xa2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x64, 0x02, 0x00, 0x20 -.byte 0x66, 0x81, 0xd7, 0xcd, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x0c, 0x14, 0x7e, 0xa2, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xa8, 0x0c, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xef, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 -.byte 0x00, 0x14, 0x7f, 0xa0, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xef, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x3c, 0x7e, 0xc2, 0x08, 0x10, 0xa0, 0x20, 0xbe, 0x21, 0xc0, 0xff, 0x7f, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8c, 0x3c, 0x7e, 0xc2, 0x08, 0x10, 0xa0, 0x80, 0xbc, 0x20, 0x10, 0x01, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x20, 0x40, 0xfd, 0x45, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x84, 0x3c, 0xe1, 0x03, 0x00, 0x00, 0x02, 0x00, 0x08 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0x02, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x21, 0x9a, 0x21, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0x02, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x21, 0x9a, 0x21, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xbe, 0x7e, 0xe9, 0x4e, 0x3c, 0xa0, 0xa7, 0xbf, 0x39, 0x20, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xfc, 0x27, 0xfc, 0xff, 0xbb, 0x9f, 0x79, 0xec, 0x00, 0x01, 0x00, 0x00 -.byte 0x8e, 0xfe, 0x7e, 0xe9, 0x4e, 0x34, 0xa0, 0xa7, 0xbf, 0x39, 0x04, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xfc, 0x27, 0xfc, 0xff, 0xbb, 0x9f, 0x59, 0xec, 0x00, 0x01, 0x00, 0x00 -.byte 0x8c, 0x14, 0x7f, 0xe2, 0x00, 0x00, 0xa0, 0x84, 0x0f, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 -.byte 0x8c, 0x14, 0x7f, 0xe2, 0x00, 0x00, 0xa0, 0x84, 0x0f, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x04, 0x38, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x28 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x02, 0x08, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x10, 0xa0, 0xae, 0xbf, 0x39, 0x08, 0x00, 0x00, 0x02, 0x20, 0x60 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0xae, 0xbf, 0xf9, 0x07, 0x00, 0x00, 0x02, 0x02, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0xae, 0xbf, 0xf9, 0x07, 0x00, 0x00, 0x02, 0x04, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x82, 0x3c, 0x06, 0xc0, 0x0c, 0x30, 0xa0, 0x00, 0x0d, 0x21, 0x00, 0x00, 0x00, 0x82, 0x01, 0x28 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 -.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0xae, 0xbf, 0xf9, 0x07, 0x00, 0x00, 0x12, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xfd, 0x7f, 0xe9, 0xcf, 0x37, 0xa0, 0x84, 0x3c, 0x21, 0x10, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xef, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x35, 0x7b, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x0c, 0x01, 0x04, 0x02, 0x02, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x08, 0x40, 0x06, 0x00, 0xa0, 0x80, 0x0c, 0x21, 0xc4, 0x55, 0x1d, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x08, 0x40, 0x06, 0x00, 0xa0, 0x80, 0x0c, 0x21, 0xc4, 0x55, 0x1d, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x35, 0xfb, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x35, 0xfb, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x0d, 0x21, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x0d, 0x21, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8c, 0x14, 0x7f, 0xe2, 0x00, 0x00, 0xa0, 0x84, 0x0f, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0x34, 0xfb, 0xab, 0xc9, 0x01, 0xa0, 0xad, 0xbf, 0x39, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x04, 0x8c, 0x21, 0xc4, 0xff, 0x7f, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xac, 0x1c, 0x19, 0x04, 0x56, 0x02, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x8c, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xc5, 0x7f, 0x88, 0x8e, 0x1b, 0xa0, 0xad, 0xbf, 0xe5, 0x2b, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0xef, 0xd3, 0xd7, 0xff, 0xfe, 0x07, 0xf4, 0xff, 0xb9, 0xff, 0xf9, 0xee, 0x00, 0x01, 0x00, 0x00 -.byte 0x80, 0x35, 0xfb, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x62, 0x00, 0x28 -.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x39, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 -.byte 0x8e, 0xfd, 0xff, 0xeb, 0xef, 0x3f, 0xa0, 0xfb, 0xbf, 0x3f, 0x1c, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0xef, 0xd3, 0xd7, 0xff, 0xfe, 0x27, 0xfc, 0xff, 0xfb, 0xff, 0xf9, 0xee, 0x00, 0x01, 0x00, 0x00 -.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x7f, 0xa0, 0xfb, 0xbf, 0x3f, 0x1c, 0x00, 0x00, 0x02, 0x00, 0x20 -.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 - -.global gItemParaFileName -gItemParaFileName: @ 8109764 -.string "itempara\0" -.align 2,0 - -.global gUnknown_8109770 -gUnknown_8109770: @ 8109770 -.string "%s %d\0" -.align 2,0 - -.global gUnknown_8109778 -gUnknown_8109778: @ 8109778 -.string "%s\0" -.align 2,0 - -.global gUnknown_810977C -gUnknown_810977C: @ 810977C -@ replacing .incbin "baserom.gba", 0x0010977c, 0x8 -.string "%d {POKE}\0" - -.global gUnknown_8109784 -gUnknown_8109784: @ 8109784 -@ replacing .incbin "baserom.gba", 0x00109784, 0x8 -.byte 0x87, 0x44 -.asciz "%s\0" -.align 2,0 - -.global gUnknown_810978C -gUnknown_810978C: @ 810978C -@ replacing .incbin "baserom.gba", 0x0010978c, 0x8 -.byte 0x87, 0x41 -.asciz "%s\0" -.align 2,0 - -.global gUnknown_8109794 -gUnknown_8109794: @ 8109794 -@ replacing .incbin "baserom.gba", 0x00109794, 0x10 -.string "%s{UNK_MACRO_3D}%c{COLOR GREEN_RAW}%s{RESET}\0" -.align 2, 0 - -.global gUnknown_81097A4 -gUnknown_81097A4: @ 81097A4 -@ replacing .incbin "baserom.gba", 0x001097a4, 0xc -.string "%s{COLOR GREEN_RAW}%s{RESET}\0" -.align 2, 0 - -.global gPowersOfTen -gPowersOfTen: @ 81097B0 -@ replacing .incbin "baserom.gba", 0x001097b0, 0x14 -.byte 0xa0, 0x86, 0x01, 0x00, 0x10, 0x27, 0x00, 0x00, 0xe8, 0x03, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00 - -.global gHighDigits -gHighDigits: @ 81097C4 -.byte 0x83 - -.global gUnknown_81097C5 -gUnknown_81097C5: @ 81097C5 -.byte 0x9f, 0x83, 0xa0, 0x83, 0xa1, 0x83, 0xa2, 0x83, 0xa3, 0x83, 0xa4, 0x83, 0xa5, 0x83, 0xa6, 0x83, 0xa7, 0x83, 0xa8, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x97, 0x10, 0x08 - -.global gGummiStatBoostLUT -gGummiStatBoostLUT: @ 81097E0 -.2byte 1 -.2byte 2 -.2byte 4 -.2byte 8 - -.global gUnknown_81097E8 -gUnknown_81097E8: @ 81097E8 -.byte 0x10, 0x00, 0x00, 0x00 -.byte 0x12, 0x00, 0x00, 0x00 -.byte 0x14, 0x00, 0x00, 0x00 -.byte 0x16, 0x00, 0x00, 0x00 - -.global gUnknown_81097F8 -gUnknown_81097F8: @ 81097F8 -.byte 0x11, 0x00, 0x00, 0x00 -.byte 0x13, 0x00, 0x00, 0x00 -.byte 0x15, 0x00, 0x00, 0x00 -.byte 0x17, 0x00, 0x00, 0x00 -@ START rescue_team_info.c -.string "pksdir0\0" - -.global gRescueRankMaxPoints -gRescueRankMaxPoints: @ 8109810 -.4byte 50 -.4byte 500 -.4byte 1500 -.4byte 3000 -.4byte 7500 -.4byte 15000 -.4byte 100000000 - -.global gTeamNamePlaceholder -gTeamNamePlaceholder: @ 810982C -.string "PokĂ©mon\0" -@ END rescue_team_info.c -@ text_util -.string "pksdir0\0" - -.global gUnknown_810983C -gUnknown_810983C: @ 810983C -.4byte gUnknown_8109888 -.4byte gUnknown_8109884 -.4byte gUnknown_8109880 -.4byte gUnknown_810987C -.4byte gUnknown_8109878 -.4byte gUnknown_8109874 -.4byte gUnknown_8109870 -.4byte gUnknown_810986C -.4byte gUnknown_8109868 -.4byte gUnknown_8109864 - -.global gUnknown_8109864 -gUnknown_8109864: @ 8109864 -.byte 0x82, 0x58, 0x00, 0x00 - -.global gUnknown_8109868 -gUnknown_8109868: @ 8109868 -.byte 0x82, 0x57, 0x00, 0x00 - -.global gUnknown_810986C -gUnknown_810986C: @ 810986C -.byte 0x82, 0x56, 0x00, 0x00 - -.global gUnknown_8109870 -gUnknown_8109870: @ 8109870 -.byte 0x82, 0x55, 0x00, 0x00 - -.global gUnknown_8109874 -gUnknown_8109874: @ 8109874 -.byte 0x82, 0x54, 0x00, 0x00 - -.global gUnknown_8109878 -gUnknown_8109878: @ 8109878 -.byte 0x82, 0x53, 0x00, 0x00 - -.global gUnknown_810987C -gUnknown_810987C: @ 810987C -.byte 0x82, 0x52, 0x00, 0x00 - -.global gUnknown_8109880 -gUnknown_8109880: @ 8109880 -.byte 0x82, 0x51, 0x00, 0x00 - -.global gUnknown_8109884 -gUnknown_8109884: @ 8109884 -.byte 0x82, 0x50, 0x00, 0x00 - -.global gUnknown_8109888 -gUnknown_8109888: @ 8109888 -.byte 0x82, 0x4f, 0x00, 0x00 -@ ??? -.string "pksdir0\0" -@ ??? -.string "pksdir0\0" -@ START friend_area.c -.string "pksdir0\0" - -.global sUnknown_81098A4 -sUnknown_81098A4: @ 81098A4 -.string "{color GREEN_RAW}%s{reset}\0" -.align 2,0 - -.global sUnknown_81098AC -sUnknown_81098AC: @ 81098AC -.string "%s{UNK_MACRO_3D}%c{COLOR GREEN_RAW}%s{RESET}\0" -.align 2,0 -@ END friend_area.c -@ moves.c -.string "pksdir0" -.align 2,0 - -.global gUnknown_81098C4 -gUnknown_81098C4: @ 81098C4 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -.global gUnknown_81098D0 -gUnknown_81098D0: @ 81098D0 -.string "wazapara\0" -.align 2,0 - -.global gUnknown_81098DC -gUnknown_81098DC: @ 81098DC -.string "%+d\0" - -.global gUnknown_81098E0 -gUnknown_81098E0: @ 81098E0 -.string "{color}%c%s%s{reset}\0" -.align 2,0 - -.global gUnknown_81098EC -gUnknown_81098EC: @ 81098EC -.string "{color}%c#:%s%s%s#;%c%2d/%2d{reset}\0" -.align 2,0 - -.global gUnknown_8109908 -gUnknown_8109908: @ 8109908 -.byte 0x87, 0x41, 0x00, 0x00 @ apparently shows A in memory viewer - -.global gUnknown_810990C -gUnknown_810990C: @ 810990C -.byte 0x87, 0x40, 0x00, 0x00 @ apparently shows @ in memory viewer - -.global gUnknown_8109910 -gUnknown_8109910: @ 8109910 -.string "{color}%c%s%s%s{UNK_MACRO_3D}%c%2d/%2d{reset}\0" -.align 2,0 - -.global gUnknown_8109928 -gUnknown_8109928: @ 8109928 -.byte 0x87, 0x42, 0x00 @ apparently shows B in memory viewer - -.global gUnknown_810992B -gUnknown_810992B: @ 810992B -.byte 0x00 - -.global gUnknown_810992C -gUnknown_810992C: @ 810992C -.string "%s\0" -.align 2,0 - -.global gUnknown_8109930 -gUnknown_8109930: @ 8109930 -.string "{POKEMON_0}\0" -.align 2,0 -@ ??? -.string "pksdir0\0" -.align 2,0 -@ ??? -.string "pksdir0\0" -.align 2,0 -@ ??? -.string "pksdir0\0" -.align 2,0 +.align 2,0 \ No newline at end of file diff --git a/data/data_8107224.s b/data/data_8107224.s new file mode 100644 index 000000000..4574e5be7 --- /dev/null +++ b/data/data_8107224.s @@ -0,0 +1,1523 @@ +.section .rodata + +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" +@ START code_808417C #1 +.string "pksdir0\0" + +.string "pksdir0\0" + +.global gUnknown_8107224 +gUnknown_8107224: @ 8107224 +.string "??????\0" +.align 2, 0 +@ END code_808417C #1 +@ code_8085B0C +.string "pksdir0\0" + +.global gUnknown_8107234 +gUnknown_8107234: @ 8107234 +.byte 0x01, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00, 0x00, 0x02, 0x04, 0x02, 0x05, 0x03, 0x06, 0x00, 0x00 +.byte 0x03, 0x07, 0x04, 0x08, 0x05, 0x09, 0x00, 0x00, 0x04, 0x0a, 0x06, 0x0b, 0x07, 0x0c, 0x00, 0x00 +.byte 0x05, 0x0d, 0x08, 0x0e, 0x09, 0x0f, 0x00, 0x00, 0x06, 0x10, 0x0a, 0x11, 0x0a, 0x11, 0x00, 0x00 +.byte 0x07, 0x12, 0x0b, 0x13, 0x0c, 0x14, 0x00, 0x00, 0x14, 0x15, 0x0d, 0x16, 0x0d, 0x16, 0x00, 0x00 +.byte 0x08, 0x17, 0x0e, 0x18, 0x0f, 0x19, 0x00, 0x00, 0x0b, 0x1a, 0x10, 0x1b, 0x11, 0x1c, 0x00, 0x00 +.byte 0x09, 0x1d, 0x12, 0x1e, 0x13, 0x1f, 0x00, 0x00, 0x0c, 0x20, 0x14, 0x21, 0x15, 0x22, 0x00, 0x00 +.byte 0x0d, 0x23, 0x16, 0x24, 0x17, 0x25, 0x00, 0x00, 0x0e, 0x26, 0x18, 0x27, 0x19, 0x28, 0x00, 0x00 +.byte 0x0f, 0x29, 0x40, 0x29, 0x1a, 0x2a, 0x00, 0x00, 0x10, 0x2b, 0x1b, 0x2c, 0x1c, 0x2d, 0x00, 0x00 +.byte 0x11, 0x2e, 0x40, 0x2e, 0x40, 0x2e, 0x00, 0x00, 0x12, 0x2f, 0x40, 0x2f, 0x40, 0x2f, 0x00, 0x00 +.byte 0x13, 0x30, 0x40, 0x30, 0x40, 0x30, 0x00, 0x00, 0x0a, 0x31, 0x40, 0x31, 0x1e, 0x32, 0x00, 0x00 +.byte 0x15, 0x33, 0x40, 0x33, 0x40, 0x33, 0x00, 0x00, 0x16, 0x34, 0x40, 0x34, 0x40, 0x34, 0x00, 0x00 +.byte 0x17, 0x35, 0x40, 0x35, 0x40, 0x35, 0x00, 0x00, 0x19, 0x36, 0x40, 0x36, 0x40, 0x36, 0x00, 0x00 +.byte 0x1b, 0x37, 0x40, 0x37, 0x40, 0x37, 0x00, 0x00, 0x1a, 0x38, 0x20, 0x39, 0x20, 0x39, 0x00, 0x00 +.byte 0x18, 0x3a, 0x21, 0x3b, 0x21, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +.global gUnknown_8107314 +gUnknown_8107314: @ 8107314 +.byte 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff +.byte 0x02, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff +.byte 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff +.byte 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff +.byte 0x04, 0x00, 0x00, 0x00 + +.global gUnknown_8107358 +gUnknown_8107358: @ 8107358 +.byte 0x04, 0x03, 0x02, 0x03, 0x04, 0x05, 0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x04, 0x05, 0x06, 0x05 +.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00 + +.global gUnknown_8107374 +gUnknown_8107374: @ 8107374 +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +.global gUnknown_8107380 +gUnknown_8107380: @ 8107380 +.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +@ ??? +.string "pksdir0\0" +@ code_8086A3C #1 +.string "pksdir0\0" + +.global gUnknown_810739C +gUnknown_810739C: @ 810739C +.byte 0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00 +.byte 0x04, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, 0x05, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00 +.byte 0x06, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x00, 0x00 + +.global gUnknown_81073D4 +gUnknown_81073D4: @ 81073D4 +.byte 0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00 +.byte 0x04, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, 0x05, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00 +.byte 0x06, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x00 + +.global gUnknown_810740C +gUnknown_810740C: @ 810740C +.byte 0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00 +.byte 0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00 +.byte 0x03, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x00, 0x00 +@ code_8086A3C #2 +.string "pksdir0\0" + +.global gUnknown_810744C +gUnknown_810744C: @ 810744C +.byte 0x01, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x09, 0x00, 0x09, 0x00, 0x00, 0x00 + +.global gUnknown_8107464 +gUnknown_8107464: @ 8107464 +.byte 0x05, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00 +.byte 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00 +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" + +.global gUnknown_81074FC +gUnknown_81074FC: @ 81074FC +.byte 0x4e, 0x4f, 0x50, 0x51, 0x4a, 0x49, 0x3e, 0x38 + +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" + +.global gUnknown_8107544 +gUnknown_8107544: @ 8107544 +.byte 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00 +.byte 0x07, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00 +.byte 0x0d, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00 +.byte 0x17, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00 +.byte 0x12, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00 +.byte 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00 +.byte 0x0d, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00 +.byte 0x17, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00 +.byte 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 +@ pokemon +.string "pksdir0\0" + +.global gUnknown_81075F4 +gUnknown_81075F4: @ 81075F4 +.string "monspara\0" +.align 2,0 + +.global gUnknown_8107600 +gUnknown_8107600: @ 8107600 +.string "{color YELLOW_RAW}%s{reset}" +.align 2,0 + +.global gUnknown_8107608 +gUnknown_8107608: @ 8107608 +.string "{color CYAN_RAW}%s{reset}" +.align 2,0 + +.global gUnownLetters +gUnownLetters: @ 8107610 +.string "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?\0" +.align 2,0 + +.global gUnknown_8107630 +gUnknown_8107630: @ 8107630 +.string "%s%c\0" +.align 2,0 + +.global gUnknown_8107638 +gUnknown_8107638: @ 8107638 +.string "%s\0" +.align 2,0 + +.global gUnknown_810763C +gUnknown_810763C: @ 810763C +.string "{color}%c%s{reset}\0" + +.global gUnknown_8107645 +gUnknown_8107645: @ 8107645 +.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +.global gUnknown_8107654 +gUnknown_8107654: @ 8107654 +.byte 0x9d, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00 +.byte 0x33, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +.global gUnknown_8107684 +gUnknown_8107684: @ 8107684 +.string "kao%03d\0" +.align 2,0 + +.global gUnknown_810768C +gUnknown_810768C: @ 810768C +.string "lvmp%03d\0" +.align 2,0 + +.global gShadowSpriteSizeFlags_8107698 +gShadowSpriteSizeFlags_8107698: @ 8107698 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 +.byte 0x03, 0x00, 0x00, 0x00 + +.global gUnknown_81076BC +gUnknown_81076BC: @ 81076BC +.string "etcfont\0" +.align 2,0 + +.global gUnknown_81076C4 +gUnknown_81076C4: @ 81076C4 +.4byte -4 +.4byte -8 +.4byte -16 +.4byte -4 +.4byte -8 +.4byte -16 +@ pokemon_3 #1 +.string "pksdir0\0" + +.global gIQSkillGroups +gIQSkillGroups: @ 81076E4 +.4byte 9999 +.4byte 4 +.4byte 1 +.4byte 2 +.4byte 4 +.4byte 4 +.4byte 6 +.4byte 7 +.4byte 8 +.4byte 9 +.4byte 9 +.4byte 9 +.4byte 10 +.4byte 10 +.4byte 11 +.4byte 11 +.4byte 14 +.4byte 14 +.4byte 14 +.4byte 16 +.4byte 16 +.4byte 9 +.4byte 17 +.4byte 6 +@ pokemon_3 #2 +.string "pksdir0\0" +@ pokemon_3 #3 +.string "pksdir0\0" + +.global gUnknown_8107754 +gUnknown_8107754: @ 8107754 +.string "Stats\0" +.align 2,0 + +.global gUnknown_810775C +gUnknown_810775C: @ 810775C +.string "Features\0" +.align 2,0 + +.global gUnknown_8107768 +gUnknown_8107768: @ 8107768 +.string "Type:\0" +.align 2,0 + +.global gUnknown_8107770 +gUnknown_8107770: @ 8107770 +.string "Special Abilities:\0" +.align 2,0 + +.global gUnknown_8107784 +gUnknown_8107784: @ 8107784 +.string "{MOVE_ITEM_1}\0" +.align 2,0 + +.global gUnknown_8107788 +gUnknown_8107788: @ 8107788 +.byte 0x87, 0x42, 0x00, 0x00 + +.global gUnknown_810778C +gUnknown_810778C: @ 810778C +.byte 0x87, 0x40, 0x00, 0x00 + +.global gUnknown_8107790 +gUnknown_8107790: @ 8107790 +.string "{MOVE_ITEM_0}{MOVE_ITEM_1}\0" +.align 2,0 + +.global gUnknown_8107798 +gUnknown_8107798: @ 8107798 +.string "Info\0" +.align 2,0 +@ dungeon +.string "pksdir0\0" +.align 2,0 + +.global gDungeonFloorCount +gDungeonFloorCount: @ 81077A8 +@ replacing .incbin "baserom.gba", 0x1077A8, 0x40 +.byte 0x04, 0x06, 0x0a, 0x0e, 0x0a, 0x0b, 0x04, 0x0d, 0x0f, 0x0d, 0x04, 0x0a, 0x06, 0x10, 0x06, 0x18 +.byte 0x04, 0x1a, 0x0a, 0x29, 0x64, 0x15, 0x05, 0x64, 0x15, 0x0c, 0x64, 0x64, 0x1a, 0x1a, 0x0d, 0x15 +.byte 0x33, 0x1f, 0x1f, 0x1f, 0x15, 0x1f, 0x10, 0x0d, 0x14, 0x1f, 0x0b, 0x10, 0x15, 0x15, 0x1f, 0x05 +.byte 0x05, 0x0b, 0x03, 0x33, 0x46, 0x10, 0x1f, 0x14, 0x14, 0x0c, 0x64, 0x4c, 0x29, 0x64, 0x64, 0x02 + +.global gUnknown_81077E8 +gUnknown_81077E8: @ 81077E8 +@ replacing .incbin "baserom.gba", 0x1077E8, 0x40 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +.global gUnknown_8107828 +gUnknown_8107828: @ 8107828 +@ replacing .incbin "baserom.gba", 0x107828, 0x85C +.byte 0x02, 0x09, 0x00, 0x00, 0x03, 0x0d, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x0a, 0x03, 0x00, 0x00 +.byte 0x0c, 0x05, 0x00, 0x00, 0x0e, 0x05, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00 +.byte 0x12, 0x09, 0x00, 0x00, 0x13, 0x28, 0x00, 0x00, 0x14, 0x63, 0x00, 0x00, 0x15, 0x14, 0x00, 0x00 +.byte 0x17, 0x3b, 0x00, 0x00, 0x17, 0x63, 0x00, 0x00, 0x1a, 0x14, 0x00, 0x00, 0x1a, 0x32, 0x00, 0x00 +.byte 0x1a, 0x63, 0x00, 0x00, 0x1b, 0x0f, 0x00, 0x00, 0x1b, 0x19, 0x00, 0x00, 0x1b, 0x23, 0x00, 0x00 +.byte 0x1b, 0x2d, 0x00, 0x00, 0x1b, 0x3c, 0x00, 0x00, 0x1b, 0x46, 0x00, 0x00, 0x1b, 0x50, 0x00, 0x00 +.byte 0x1d, 0x19, 0x00, 0x00, 0x21, 0x14, 0x00, 0x00, 0x21, 0x1e, 0x00, 0x00, 0x22, 0x1e, 0x00, 0x00 +.byte 0x23, 0x14, 0x00, 0x00, 0x23, 0x1e, 0x00, 0x00, 0x24, 0x0a, 0x00, 0x00, 0x24, 0x0f, 0x00, 0x00 +.byte 0x24, 0x14, 0x00, 0x00, 0x25, 0x1e, 0x00, 0x00, 0x29, 0x0f, 0x00, 0x00, 0x29, 0x19, 0x00, 0x00 +.byte 0x2a, 0x0a, 0x00, 0x00, 0x31, 0x01, 0x00, 0x00, 0x31, 0x02, 0x00, 0x00, 0x31, 0x03, 0x00, 0x00 +.byte 0x31, 0x04, 0x00, 0x00, 0x31, 0x05, 0x00, 0x00, 0x31, 0x06, 0x00, 0x00, 0x31, 0x07, 0x00, 0x00 +.byte 0x31, 0x08, 0x00, 0x00, 0x31, 0x09, 0x00, 0x00, 0x31, 0x0a, 0x00, 0x00, 0x34, 0x03, 0x00, 0x00 +.byte 0x34, 0x06, 0x00, 0x00, 0x34, 0x09, 0x00, 0x00, 0x34, 0x0c, 0x00, 0x00, 0x34, 0x0f, 0x00, 0x00 +.byte 0x34, 0x12, 0x00, 0x00, 0x34, 0x15, 0x00, 0x00, 0x34, 0x18, 0x00, 0x00, 0x34, 0x1b, 0x00, 0x00 +.byte 0x34, 0x1e, 0x00, 0x00, 0x34, 0x21, 0x00, 0x00, 0x34, 0x24, 0x00, 0x00, 0x34, 0x27, 0x00, 0x00 +.byte 0x34, 0x2a, 0x00, 0x00, 0x34, 0x2d, 0x00, 0x00, 0x34, 0x30, 0x00, 0x00, 0x34, 0x33, 0x00, 0x00 +.byte 0x34, 0x36, 0x00, 0x00, 0x34, 0x39, 0x00, 0x00, 0x34, 0x3c, 0x00, 0x00, 0x34, 0x3f, 0x00, 0x00 +.byte 0x34, 0x42, 0x00, 0x00, 0x34, 0x45, 0x00, 0x00, 0x35, 0x0f, 0x00, 0x00, 0x3b, 0x32, 0x00, 0x00 +.byte 0x3b, 0x48, 0x00, 0x00, 0x3c, 0x1e, 0x00, 0x00, 0x3c, 0x28, 0x00, 0x00, 0x3e, 0x63, 0x00, 0x00 +.byte 0x3f, 0xff, 0x00, 0x00 + +.global gUnknown_810795C +gUnknown_810795C: @ 810795C +.byte 0x00, 0x01, 0x01, 0x01 + +.global gUnknown_8107960 +gUnknown_8107960: @ 8107960 +.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107966 +gUnknown_8107966: @ 8107966 +.byte 0x00, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107970 +gUnknown_8107970: @ 8107970 +.byte 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 +.byte 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 + +.global gUnknown_810797E +gUnknown_810797E: @ 810797E +.byte 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03 + +.global gUnknown_8107988 +gUnknown_8107988: @ 8107988 +.byte 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 + +.global gUnknown_8107993 +gUnknown_8107993: @ 8107993 +.byte 0x00, 0x03, 0x03, 0x03 + +.global gUnknown_8107997 +gUnknown_8107997: @ 8107997 +.byte 0x00 +.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 + +.global gUnknown_81079A4 +gUnknown_81079A4: @ 81079A4 +.byte 0x00, 0x04, 0x04, 0x04 +.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 + +.global gUnknown_81079B3 +gUnknown_81079B3: @ 81079B3 +.byte 0x00, 0x04, 0x04, 0x04, 0x04 +.byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 + +.global gUnknown_81079C0 +gUnknown_81079C0: @ 81079C0 +.byte 0x00, 0x04, 0x04, 0x04 + +.global gUnknown_81079C4 +gUnknown_81079C4: @ 81079C4 +.byte 0x00, 0x04, 0x04, 0x04 +.byte 0x04, 0x04, 0x05, 0x05, 0x05, 0x05 + +.global gUnknown_81079CE +gUnknown_81079CE: @ 81079CE +.byte 0x00, 0x05, 0x05, 0x05, 0x05, 0x05 + +.global gUnknown_81079D4 +gUnknown_81079D4: @ 81079D4 +.byte 0x00, 0x05, 0x05, 0x05 +.byte 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 + +.global gUnknown_81079E4 +gUnknown_81079E4: @ 81079E4 +.byte 0x00, 0x05, 0x05, 0x05 +.byte 0x05, 0x05 + +.global gUnknown_81079EA +gUnknown_81079EA: @ 81079EA +.byte 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 +.byte 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 + +.global gUnknown_8107A02 +gUnknown_8107A02: @ 8107A02 +.byte 0x00, 0x06, 0x06, 0x06 + +.global gUnknown_8107A06 +gUnknown_8107A06: @ 8107A06 +.byte 0x00, 0x06 +.byte 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 +.byte 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 + +.global gUnknown_8107A20 +gUnknown_8107A20: @ 8107A20 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07 + +.global gUnknown_8107A2A +gUnknown_8107A2A: @ 8107A2A +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 + +.global gUnknown_8107A53 +gUnknown_8107A53: @ 8107A53 +.byte 0x00, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b + +.global gUnknown_8107AB7 +gUnknown_8107AB7: @ 8107AB7 +.byte 0x00 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08 + +.global gUnknown_8107ACC +gUnknown_8107ACC: @ 8107ACC +.byte 0x00, 0x05, 0x05, 0x05, 0x05 + +.global gUnknown_8107AD1 +gUnknown_8107AD1: @ 8107AD1 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c + +.global gUnknown_8107B35 +gUnknown_8107B35: @ 8107B35 +.byte 0x00, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08 + +.global gUnknown_8107B4A +gUnknown_8107B4A: @ 8107B4A +.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107B56 +gUnknown_8107B56: @ 8107B56 +.byte 0x00, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09 +.byte 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c + +.global gUnknown_8107BBA +gUnknown_8107BBA: @ 8107BBA +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c + +.global gUnknown_8107C1E +gUnknown_8107C1E: @ 8107C1E +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 + +.global gUnknown_8107C38 +gUnknown_8107C38: @ 8107C38 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 + +.global gUnknown_8107C52 +gUnknown_8107C52: @ 8107C52 +.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107C5F +gUnknown_8107C5F: @ 8107C5F +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 + +.global gUnknown_8107C74 +gUnknown_8107C74: @ 8107C74 +.byte 0x00, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 +.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 + +.global gUnknown_8107CA7 +gUnknown_8107CA7: @ 8107CA7 +.byte 0x00 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 + +.global gUnknown_8107CC6 +gUnknown_8107CC6: @ 8107CC6 +.byte 0x00, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 + +.global gUnknown_8107CE5 +gUnknown_8107CE5: @ 8107CE5 +.byte 0x00, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 + +.global gUnknown_8107D04 +gUnknown_8107D04: @ 8107D04 +.byte 0x00, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08 + +.global gUnknown_8107D19 +gUnknown_8107D19: @ 8107D19 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 + +.global gUnknown_8107D38 +gUnknown_8107D38: @ 8107D38 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 + +.global gUnknown_8107D48 +gUnknown_8107D48: @ 8107D48 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08 + +.global gUnknown_8107D55 +gUnknown_8107D55: @ 8107D55 +.byte 0x00, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08 + +.global gUnknown_8107D69 +gUnknown_8107D69: @ 8107D69 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 + +.global gUnknown_8107D88 +gUnknown_8107D88: @ 8107D88 +.byte 0x00, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 + +.global gUnknown_8107D93 +gUnknown_8107D93: @ 8107D93 +.byte 0x00, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 + +.global gUnknown_8107DA3 +gUnknown_8107DA3: @ 8107DA3 +.byte 0x00, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 + +.global gUnknown_8107DB8 +gUnknown_8107DB8: @ 8107DB8 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x08 + +.global gUnknown_8107DCD +gUnknown_8107DCD: @ 8107DCD +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x09 + +.global gUnknown_8107DEC +gUnknown_8107DEC: @ 8107DEC +.byte 0x00, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107DF1 +gUnknown_8107DF1: @ 8107DF1 +.byte 0x00, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107DF6 +gUnknown_8107DF6: @ 8107DF6 +.byte 0x00, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107E01 +gUnknown_8107E01: @ 8107E01 +.byte 0x00, 0x01, 0x01 + +.global gUnknown_8107E04 +gUnknown_8107E04: @ 8107E04 +.byte 0x00, 0x0f, 0x0f, 0x0f +.byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f +.byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f +.byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f + +.global gUnknown_8107E37 +gUnknown_8107E37: @ 8107E37 +.byte 0x00 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107E7D +gUnknown_8107E7D: @ 8107E7D +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07 + +.global gUnknown_8107E8D +gUnknown_8107E8D: @ 8107E8D +.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107EAC +gUnknown_8107EAC: @ 8107EAC +.byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 +.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + +.global gUnknown_8107EC0 +gUnknown_8107EC0: @ 8107EC0 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 + +.global gUnknown_8107ED4 +gUnknown_8107ED4: @ 8107ED4 +.byte 0x00, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 + +.global gUnknown_8107EE0 +gUnknown_8107EE0: @ 8107EE0 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c + +.global gUnknown_8107F44 +gUnknown_8107F44: @ 8107F44 +.byte 0x00, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09 +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c + +.global gUnknown_8107F90 +gUnknown_8107F90: @ 8107F90 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a + +.global gUnknown_8107FB9 +gUnknown_8107FB9: @ 8107FB9 +.byte 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 +.byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09 +.byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0c, 0x0c, 0x0c, 0x0c, 0x0c + +.global gUnknown_810801D +gUnknown_810801D: @ 810801D +.byte 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +.byte 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x0a +.byte 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b +.byte 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c +.byte 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e +.byte 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e + +.global gUnknown_8108081 +gUnknown_8108081: @ 8108081 +.byte 0x00, 0x07, 0x00 + +.global gUnknown_8108084 +gUnknown_8108084: @ 8108084 +@ replacing .incbin "baserom.gba", 0x108084, 0xDD4 +.4byte gUnknown_810795C +.4byte gUnknown_8107960 +.4byte gUnknown_8107966 +.4byte gUnknown_8107970 +.4byte gUnknown_810797E +.4byte gUnknown_8107988 +.4byte gUnknown_8107993 +.4byte gUnknown_8107997 +.4byte gUnknown_81079A4 +.4byte gUnknown_81079B3 +.4byte gUnknown_81079C0 +.4byte gUnknown_81079C4 +.4byte gUnknown_81079CE +.4byte gUnknown_81079D4 +.4byte gUnknown_81079E4 +.4byte gUnknown_81079EA +.4byte gUnknown_8107A02 +.4byte gUnknown_8107A06 +.4byte gUnknown_8107A20 +.4byte gUnknown_8107A2A +.4byte gUnknown_8107A53 +.4byte gUnknown_8107AB7 +.4byte gUnknown_8107ACC +.4byte gUnknown_8107AD1 +.4byte gUnknown_8107B35 +.4byte gUnknown_8107B4A +.4byte gUnknown_8107B56 +.4byte gUnknown_8107BBA +.4byte gUnknown_8107C1E +.4byte gUnknown_8107C38 +.4byte gUnknown_8107C52 +.4byte gUnknown_8107C5F +.4byte gUnknown_8107C74 +.4byte gUnknown_8107CA7 +.4byte gUnknown_8107CC6 +.4byte gUnknown_8107CE5 +.4byte gUnknown_8107D04 +.4byte gUnknown_8107D19 +.4byte gUnknown_8107D38 +.4byte gUnknown_8107D48 +.4byte gUnknown_8107D55 +.4byte gUnknown_8107D69 +.4byte gUnknown_8107D88 +.4byte gUnknown_8107D93 +.4byte gUnknown_8107DA3 +.4byte gUnknown_8107DB8 +.4byte gUnknown_8107DCD +.4byte gUnknown_8107DEC +.4byte gUnknown_8107DF1 +.4byte gUnknown_8107DF6 +.4byte gUnknown_8107E01 +.4byte gUnknown_8107E04 +.4byte gUnknown_8107E37 +.4byte gUnknown_8107E7D +.4byte gUnknown_8107E8D +.4byte gUnknown_8107EAC +.4byte gUnknown_8107EC0 +.4byte gUnknown_8107ED4 +.4byte gUnknown_8107EE0 +.4byte gUnknown_8107F44 +.4byte gUnknown_8107F90 +.4byte gUnknown_8107FB9 +.4byte gUnknown_810801D +.4byte gUnknown_8108081 + +.global gUnknown_8108184 +gUnknown_8108184: @ 8108184 +.byte 0x31, 0x75, 0xa0, 0x0f, 0x10, 0x27, 0x40, 0x75, 0x10, 0x27, 0x62, 0x75, 0xa0, 0x0f, 0x38, 0x75 +.byte 0x70, 0x17, 0x39, 0x75, 0x10, 0x27, 0xd2, 0x75 + +.global gUnknown_810819C +gUnknown_810819C: @ 810819C +.byte 0x31, 0x75, 0x98, 0x04, 0x62, 0x12, 0x2b, 0x20 +.byte 0x10, 0x27, 0x3e, 0x75, 0x10, 0x27, 0x3b, 0x75, 0x05, 0x0d, 0x0b, 0x1a, 0x3c, 0x75, 0x10, 0x27 +.byte 0x43, 0x75, 0xd0, 0x07, 0x34, 0x75, 0xa0, 0x0f, 0x38, 0x75, 0x70, 0x17, 0x39, 0x75, 0x10, 0x27 +.byte 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10 +.byte 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22 +.byte 0xc4, 0x24, 0x10, 0x27, 0xb9, 0x75 + +.global gUnknown_81081EA +gUnknown_81081EA: @ 81081EA +.byte 0x31, 0x75, 0x20, 0x03, 0x80, 0x0c, 0x40, 0x1f, 0xf0, 0x23 +.byte 0x10, 0x27, 0x3d, 0x75, 0x10, 0x27, 0x3a, 0x75, 0xc4, 0x09, 0x88, 0x13, 0x4c, 0x1d, 0x3c, 0x75 +.byte 0x10, 0x27, 0x43, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75 +.byte 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12 +.byte 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24 +.byte 0x10, 0x27, 0x49, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75 +.byte 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10 +.byte 0x32, 0x75, 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16, 0xb7, 0x17 +.byte 0x36, 0x75, 0x82, 0x1a, 0x4c, 0x1d, 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x75, 0x75 + +.global gUnknown_8108274 +gUnknown_8108274: @ 8108274 +.byte 0x31, 0x75, 0x01, 0x03, 0x05, 0x0c, 0x0c, 0x1e, 0x8e, 0x22, 0x10, 0x27, 0x3d, 0x75, 0x10, 0x27 +.byte 0x3a, 0x75, 0xd0, 0x07, 0xa0, 0x0f, 0x70, 0x17, 0x3c, 0x75, 0x40, 0x1f, 0x3b, 0x75, 0x10, 0x27 +.byte 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02 +.byte 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14 +.byte 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27 +.byte 0x49, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75, 0x29, 0x0b +.byte 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10, 0x32, 0x75 +.byte 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16, 0xb7, 0x17, 0x36, 0x75 +.byte 0x82, 0x1a, 0x4c, 0x1d, 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x75, 0x75 + +.global gUnknown_8108302 +gUnknown_8108302: @ 8108302 +.byte 0x32, 0x75 +.byte 0xd0, 0x07, 0x70, 0x17, 0x40, 0x1f, 0x10, 0x27, 0x40, 0x75, 0x83, 0x06, 0x37, 0x75, 0x05, 0x0d +.byte 0x88, 0x13, 0x0b, 0x1a, 0x3c, 0x75, 0x8d, 0x20, 0x3b, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d +.byte 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06 +.byte 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19 +.byte 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x49, 0x75, 0x65, 0x01 +.byte 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75, 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75 +.byte 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10, 0x32, 0x75, 0x23, 0x12, 0x88, 0x13 +.byte 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16, 0xb7, 0x17, 0x36, 0x75, 0x82, 0x1a, 0x4c, 0x1d +.byte 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x75, 0x75 + +.global gUnknown_810838E +gUnknown_810838E: @ 810838E +.byte 0x32, 0x75, 0x04, 0x09, 0x09, 0x15 +.byte 0x0c, 0x1e, 0x10, 0x27, 0x40, 0x75, 0x83, 0x06, 0x37, 0x75, 0x05, 0x0d, 0x88, 0x13, 0x0b, 0x1a +.byte 0x3c, 0x75, 0x8d, 0x20, 0x3b, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a +.byte 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b +.byte 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d +.byte 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01 +.byte 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b +.byte 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75 +.byte 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15 +.byte 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19 +.byte 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x75, 0x75 + +.global gUnknown_8108432 +gUnknown_8108432: @ 8108432 +.byte 0x32, 0x75 +.byte 0xc4, 0x09, 0x88, 0x13, 0x4c, 0x1d, 0x10, 0x27, 0x40, 0x75, 0x83, 0x06, 0x37, 0x75, 0x05, 0x0d +.byte 0x88, 0x13, 0x0b, 0x1a, 0x3c, 0x75, 0x8d, 0x20, 0x3b, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d +.byte 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06 +.byte 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19 +.byte 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00 +.byte 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75 +.byte 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e +.byte 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13 +.byte 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19 +.byte 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27 +.byte 0x75, 0x75 + +.global gUnknown_81084D6 +gUnknown_81084D6: @ 81084D6 +.byte 0x32, 0x75, 0xc4, 0x09, 0x88, 0x13, 0x4c, 0x1d, 0x10, 0x27, 0x40, 0x75, 0x95, 0x05 +.byte 0x37, 0x75, 0x29, 0x0b, 0xbe, 0x10, 0x52, 0x16, 0x3c, 0x75, 0xe7, 0x1b, 0x33, 0x75, 0x7b, 0x21 +.byte 0x37, 0x75, 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27 +.byte 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10 +.byte 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22 +.byte 0xc4, 0x24, 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04 +.byte 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d +.byte 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75 +.byte 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16 +.byte 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e +.byte 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x75, 0x75 + +.global gUnknown_810857E +gUnknown_810857E: @ 810857E +.byte 0x32, 0x75, 0xc4, 0x09, 0x88, 0x13 +.byte 0x4c, 0x1d, 0x10, 0x27, 0x40, 0x75, 0x57, 0x04, 0x37, 0x75, 0xae, 0x08, 0x05, 0x0d, 0x5c, 0x11 +.byte 0x39, 0x75, 0xb4, 0x15, 0x32, 0x75, 0x0b, 0x1a, 0x62, 0x1e, 0x32, 0x75, 0xb9, 0x22, 0x37, 0x75 +.byte 0x10, 0x27, 0x37, 0x75, 0x05, 0x0d, 0x34, 0x75, 0x0b, 0x1a, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75 +.byte 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09, 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12 +.byte 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b, 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24 +.byte 0x10, 0x27, 0x46, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75 +.byte 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75 +.byte 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10 +.byte 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17 +.byte 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20 +.byte 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x75, 0x75 + +.global gUnknown_810862C +gUnknown_810862C: @ 810862C +.byte 0x32, 0x75, 0x56, 0x0c, 0x31, 0x75, 0xac, 0x18 +.byte 0x02, 0x25, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75, 0x57, 0x04, 0x37, 0x75, 0xae, 0x08, 0x05, 0x0d +.byte 0x5c, 0x11, 0x39, 0x75, 0xb4, 0x15, 0x32, 0x75, 0x0b, 0x1a, 0x62, 0x1e, 0x32, 0x75, 0xb9, 0x22 +.byte 0x37, 0x75, 0x10, 0x27, 0x37, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d +.byte 0x32, 0x75, 0x10, 0x27, 0x5f, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04 +.byte 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d +.byte 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75 +.byte 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16 +.byte 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e +.byte 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e +.byte 0x10, 0x27, 0x34, 0x75 + +.global gUnknown_81086C8 +gUnknown_81086C8: @ 81086C8 +.byte 0x32, 0x75, 0x56, 0x0c, 0x31, 0x75, 0xac, 0x18, 0x02, 0x25, 0x34, 0x75 +.byte 0x10, 0x27, 0x3b, 0x75, 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13 +.byte 0x38, 0x75, 0x70, 0x17, 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75 +.byte 0x10, 0x27, 0x37, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d, 0x32, 0x75 +.byte 0x10, 0x27, 0x5f, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75 +.byte 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75 +.byte 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10 +.byte 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17 +.byte 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20 +.byte 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27 +.byte 0x34, 0x75 + +.global gUnknown_8108766 +gUnknown_8108766: @ 8108766 +.byte 0x32, 0x75, 0x35, 0x05, 0x31, 0x75, 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27 +.byte 0x3b, 0x75, 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75 +.byte 0x70, 0x17, 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27 +.byte 0x37, 0x75, 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d, 0x32, 0x75, 0x10, 0x27 +.byte 0x5f, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05 +.byte 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d +.byte 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11 +.byte 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18 +.byte 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22 +.byte 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 + +.global gUnknown_8108804 +gUnknown_8108804: @ 8108804 +.byte 0x32, 0x75, 0x35, 0x05, 0x31, 0x75, 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75 +.byte 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75, 0x70, 0x17 +.byte 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27, 0x37, 0x75 +.byte 0xc4, 0x09, 0x34, 0x75, 0x88, 0x13, 0x3f, 0x75, 0x4c, 0x1d, 0x32, 0x75, 0x10, 0x27, 0x5f, 0x75 +.byte 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08 +.byte 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d +.byte 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13 +.byte 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75 +.byte 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24 +.byte 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 + +.global gUnknown_81088A2 +gUnknown_81088A2: @ 81088A2 +.byte 0x32, 0x75 +.byte 0x35, 0x05, 0x31, 0x75, 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75, 0xe8, 0x03 +.byte 0x37, 0x75, 0xd0, 0x07, 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75, 0x70, 0x17, 0x32, 0x75 +.byte 0x58, 0x1b, 0x40, 0x1f, 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27, 0x4c, 0x75, 0xd0, 0x07 +.byte 0x33, 0x75, 0xa0, 0x0f, 0x70, 0x17, 0x40, 0x1f, 0x10, 0x27, 0x5b, 0x75, 0x4f, 0x00, 0x32, 0x75 +.byte 0x8d, 0x01, 0x08, 0x04, 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a +.byte 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f +.byte 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13 +.byte 0x15, 0x15, 0x31, 0x75, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75 +.byte 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75 +.byte 0xb4, 0x15, 0x31, 0x75, 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 + +.global gUnknown_810893E +gUnknown_810893E: @ 810893E +.byte 0x32, 0x75, 0x35, 0x05, 0x31, 0x75 +.byte 0xd5, 0x14, 0x75, 0x24, 0x34, 0x75, 0x10, 0x27, 0x3b, 0x75, 0xe8, 0x03, 0x37, 0x75, 0xd0, 0x07 +.byte 0xb8, 0x0b, 0xa0, 0x0f, 0x88, 0x13, 0x38, 0x75, 0x70, 0x17, 0x32, 0x75, 0x58, 0x1b, 0x40, 0x1f +.byte 0x32, 0x75, 0x28, 0x23, 0x37, 0x75, 0x10, 0x27, 0x4c, 0x75, 0xd0, 0x07, 0x33, 0x75, 0xa0, 0x0f +.byte 0x70, 0x17, 0x40, 0x1f, 0x10, 0x27, 0x5b, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01, 0x08, 0x04 +.byte 0x57, 0x04, 0x32, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x31, 0x75, 0x8a, 0x0a, 0xc8, 0x0b, 0x32, 0x75 +.byte 0x05, 0x0d, 0x32, 0x75, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e, 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10 +.byte 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13, 0xd7, 0x13, 0x15, 0x15, 0x31, 0x75 +.byte 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x32, 0x75, 0x1d, 0x19, 0x31, 0x75, 0x6c, 0x19, 0xe7, 0x1b +.byte 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24, 0x10, 0x27, 0x6d, 0x75, 0xb4, 0x15, 0x31, 0x75 +.byte 0x62, 0x1e, 0x10, 0x27, 0x34, 0x75 + +.global gUnknown_81089DA +gUnknown_81089DA: @ 81089DA +.byte 0x31, 0x75, 0xe2, 0x04, 0x6a, 0x18, 0x10, 0x27, 0x3f, 0x75 +.byte 0x10, 0x27, 0x5f, 0x75, 0x83, 0x06, 0x32, 0x75, 0xa6, 0x0e, 0x34, 0x75, 0xe7, 0x11, 0x32, 0x75 +.byte 0x29, 0x15, 0x6a, 0x18, 0x31, 0x75, 0xab, 0x1b, 0x31, 0x75, 0x4c, 0x1d, 0x8d, 0x20, 0x33, 0x75 +.byte 0xcf, 0x23, 0x10, 0x27, 0x34, 0x75, 0x88, 0x13, 0x10, 0x27, 0xcc, 0x75 + +.global gUnknown_8108A10 +gUnknown_8108A10: @ 8108A10 +.byte 0x35, 0x75, 0xc4, 0x09 +.byte 0x33, 0x75, 0x10, 0x27, 0xb2, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75, 0x95, 0x05, 0x5f, 0x08 +.byte 0x31, 0x75, 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75, 0x59, 0x0f, 0x32, 0x75 +.byte 0xbe, 0x10, 0x32, 0x75, 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14, 0x31, 0x75, 0x52, 0x16 +.byte 0xb7, 0x17, 0x36, 0x75, 0x82, 0x1a, 0x4c, 0x1d, 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27 +.byte 0x3b, 0x75, 0xca, 0x02, 0x5f, 0x08, 0x29, 0x0b, 0x34, 0x75, 0xf3, 0x0d, 0x3a, 0x75, 0xe7, 0x1b +.byte 0xb1, 0x1e, 0x7b, 0x21, 0x3f, 0x75, 0x10, 0x27, 0x45, 0x75 + +.global gUnknown_8108A6E +gUnknown_8108A6E: @ 8108A6E +.byte 0xe8, 0x03, 0xd0, 0x07, 0x70, 0x17 +.byte 0x28, 0x23, 0x10, 0x27, 0x39, 0x75, 0x8d, 0x20, 0x10, 0x27, 0x33, 0x75, 0x10, 0x27, 0x32, 0x75 +.byte 0x95, 0x05, 0x36, 0x75, 0x29, 0x0b, 0xbe, 0x10, 0x52, 0x16, 0xe7, 0x1b, 0x7b, 0x21, 0x39, 0x75 +.byte 0x10, 0x27, 0x45, 0x75, 0x95, 0x05, 0x34, 0x75, 0xbe, 0x10, 0x38, 0x75, 0x52, 0x16, 0x31, 0x75 +.byte 0xe7, 0x1b, 0x31, 0x75, 0x7b, 0x21, 0x35, 0x75, 0x10, 0x27, 0x37, 0x75, 0x10, 0x27, 0xca, 0x75 + +.global gUnknown_8108AB4 +gUnknown_8108AB4: @ 8108AB4 +.byte 0x35, 0x75, 0xc4, 0x09, 0x33, 0x75, 0x10, 0x27, 0xb2, 0x75, 0x65, 0x01, 0x2f, 0x04, 0x33, 0x75 +.byte 0x95, 0x05, 0x5f, 0x08, 0x31, 0x75, 0x29, 0x0b, 0x8e, 0x0c, 0x32, 0x75, 0xf3, 0x0d, 0x34, 0x75 +.byte 0x59, 0x0f, 0x32, 0x75, 0xbe, 0x10, 0x32, 0x75, 0x23, 0x12, 0x88, 0x13, 0x32, 0x75, 0xed, 0x14 +.byte 0x71, 0x02, 0x52, 0x16, 0xb7, 0x17, 0x34, 0x75, 0xe2, 0x04, 0x31, 0x75, 0x82, 0x1a, 0x4c, 0x1d +.byte 0x16, 0x20, 0x7b, 0x21, 0x46, 0x24, 0x10, 0x27, 0x3b, 0x75, 0x53, 0x07, 0x35, 0x0c, 0xa6, 0x0e +.byte 0x34, 0x75, 0x17, 0x11, 0x3a, 0x75, 0x4c, 0x1d, 0xbd, 0x1f, 0x2e, 0x22, 0x3f, 0x75, 0x10, 0x27 +.byte 0x45, 0x75 + +.global gUnknown_8108B16 +gUnknown_8108B16: @ 8108B16 +.byte 0xe8, 0x03, 0xd0, 0x07, 0x70, 0x17, 0x28, 0x23, 0x10, 0x27, 0x39, 0x75, 0x8d, 0x20 +.byte 0x10, 0x27, 0x33, 0x75, 0x10, 0x27, 0x32, 0x75, 0x95, 0x05, 0x36, 0x75, 0x29, 0x0b, 0xbe, 0x10 +.byte 0x52, 0x16, 0xe7, 0x1b, 0x7b, 0x21, 0x39, 0x75, 0x10, 0x27, 0x45, 0x75, 0x95, 0x05, 0x34, 0x75 +.byte 0xbe, 0x10, 0x38, 0x75, 0x52, 0x16, 0x31, 0x75, 0xe7, 0x1b, 0x31, 0x75, 0x7b, 0x21, 0x35, 0x75 +.byte 0x10, 0x27, 0x37, 0x75, 0x10, 0x27, 0xca, 0x75 + +.global gUnknown_8108B5C +gUnknown_8108B5C: @ 8108B5C +.byte 0x35, 0x75, 0x6a, 0x18, 0x33, 0x75, 0x10, 0x27 +.byte 0xb2, 0x75, 0x59, 0x01, 0x0a, 0x04, 0x33, 0x75, 0x63, 0x05, 0x15, 0x08, 0x31, 0x75, 0xc7, 0x0a +.byte 0x1f, 0x0c, 0x32, 0x75, 0x78, 0x0d, 0x34, 0x75, 0xd1, 0x0e, 0x32, 0x75, 0x2a, 0x10, 0x32, 0x75 +.byte 0x83, 0x11, 0xdc, 0x12, 0x32, 0x75, 0x34, 0x14, 0x71, 0x02, 0x8d, 0x15, 0xe6, 0x16, 0x3f, 0x18 +.byte 0x33, 0x75, 0xe2, 0x04, 0x31, 0x75, 0xf1, 0x1a, 0xa2, 0x1d, 0x54, 0x20, 0xad, 0x21, 0x5e, 0x24 +.byte 0x10, 0x27, 0x3b, 0x75, 0x53, 0x07, 0x35, 0x0c, 0xa6, 0x0e, 0x34, 0x75, 0x17, 0x11, 0x3a, 0x75 +.byte 0x4c, 0x1d, 0xbd, 0x1f, 0x2e, 0x22, 0x3f, 0x75, 0x10, 0x27, 0x45, 0x75 + +.global gUnknown_8108BC0 +gUnknown_8108BC0: @ 8108BC0 +.byte 0xe8, 0x03, 0xd0, 0x07 +.byte 0x58, 0x1b, 0x28, 0x23, 0x10, 0x27, 0x39, 0x75, 0x8d, 0x20, 0x10, 0x27, 0x33, 0x75, 0x10, 0x27 +.byte 0x32, 0x75, 0x57, 0x04, 0x36, 0x75, 0xae, 0x08, 0x05, 0x0d, 0x5c, 0x11, 0xb4, 0x15, 0x0b, 0x1a +.byte 0x62, 0x1e, 0x3a, 0x75, 0xb9, 0x22, 0x3a, 0x75, 0xe4, 0x24, 0x10, 0x27, 0x37, 0x75, 0xe5, 0x02 +.byte 0x34, 0x75, 0xae, 0x08, 0x34, 0x75, 0x78, 0x0e, 0x41, 0x14, 0x32, 0x75, 0x0b, 0x1a, 0x36, 0x75 +.byte 0x7d, 0x1b, 0x31, 0x75, 0x47, 0x21, 0x10, 0x27, 0x37, 0x75, 0x10, 0x27, 0xca, 0x75 + +.global gUnknown_8108C12 +gUnknown_8108C12: @ 8108C12 +.byte 0x35, 0x75 +.byte 0x88, 0x13, 0x33, 0x75, 0x10, 0x27, 0xb2, 0x75, 0x59, 0x01, 0x0a, 0x04, 0x31, 0x75, 0xa1, 0x01 +.byte 0x31, 0x75, 0x63, 0x05, 0x15, 0x08, 0x41, 0x03, 0xc7, 0x0a, 0x1f, 0x0c, 0x32, 0x75, 0x78, 0x0d +.byte 0x31, 0x75, 0xe2, 0x04, 0x32, 0x75, 0xd1, 0x0e, 0x32, 0x75, 0x2a, 0x10, 0x32, 0x75, 0x83, 0x11 +.byte 0xdc, 0x12, 0x32, 0x75, 0x34, 0x14, 0x83, 0x06, 0x8d, 0x15, 0xe6, 0x16, 0x3f, 0x18, 0x31, 0x75 +.byte 0x23, 0x08, 0x31, 0x75, 0xc4, 0x09, 0x31, 0x75, 0xf1, 0x1a, 0xa2, 0x1d, 0x54, 0x20, 0xad, 0x21 +.byte 0x5e, 0x24, 0x10, 0x27, 0x38, 0x75, 0x65, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x47, 0x10, 0xe7, 0x11 +.byte 0x88, 0x13, 0x33, 0x75, 0x29, 0x15, 0x35, 0x75, 0x6a, 0x18, 0xab, 0x1b, 0x34, 0x75, 0x4c, 0x1d +.byte 0xed, 0x1e, 0x8d, 0x20, 0x2e, 0x22, 0xcf, 0x23, 0x3c, 0x75, 0x10, 0x27, 0x45, 0x75 + +.global gUnknown_8108C92 +gUnknown_8108C92: @ 8108C92 +.byte 0x01, 0x03 +.byte 0x02, 0x06, 0x0a, 0x18, 0x0b, 0x1b, 0x0c, 0x1e, 0x34, 0x75, 0x10, 0x27, 0x33, 0x75, 0xb6, 0x16 +.byte 0x56, 0x24, 0x10, 0x27, 0x33, 0x75, 0x58, 0x1b, 0x10, 0x27, 0x40, 0x75, 0x10, 0x27, 0x50, 0x75 +.byte 0x88, 0x13, 0x42, 0x75, 0x10, 0x27, 0x38, 0x75, 0x4c, 0x02, 0x98, 0x04, 0xe5, 0x06, 0x31, 0x09 +.byte 0x7d, 0x0b, 0xc9, 0x0d, 0x16, 0x10, 0x62, 0x12, 0xae, 0x14, 0xfa, 0x16, 0x47, 0x19, 0x93, 0x1b +.byte 0xdf, 0x1d, 0x2b, 0x20, 0x78, 0x22, 0xc4, 0x24, 0x10, 0x27, 0x7c, 0x75, 0x81, 0x01, 0x32, 0x75 +.byte 0x01, 0x03, 0x02, 0x06, 0x83, 0x07, 0x04, 0x09, 0x84, 0x0a, 0x31, 0x75, 0x86, 0x0d, 0x06, 0x0f +.byte 0x87, 0x10, 0x88, 0x13, 0x33, 0x75, 0x89, 0x16, 0x8a, 0x19, 0x8c, 0x1c, 0x31, 0x75, 0x0c, 0x1e +.byte 0x31, 0x75, 0x8d, 0x1f, 0x0e, 0x21, 0x34, 0x75, 0x8e, 0x22, 0x33, 0x75, 0x0f, 0x24, 0x36, 0x75 +.byte 0x10, 0x27, 0x45, 0x75 + +.global gUnknown_8108D18 +gUnknown_8108D18: @ 8108D18 +.byte 0x56, 0x0c, 0x31, 0x75, 0x81, 0x12, 0x9d, 0x16, 0xba, 0x1a, 0xd7, 0x1e +.byte 0x33, 0x75, 0xf3, 0x22, 0x10, 0x27, 0x35, 0x75, 0x05, 0x0d, 0x0b, 0x1a, 0x10, 0x27, 0x33, 0x75 +.byte 0xb3, 0x01, 0x66, 0x03, 0x31, 0x75, 0x18, 0x05, 0xcb, 0x06, 0x32, 0x75, 0x7e, 0x08, 0x31, 0x0a +.byte 0xe3, 0x0b, 0x96, 0x0d, 0x49, 0x0f, 0xfc, 0x10, 0x36, 0x75, 0xaf, 0x12, 0x61, 0x14, 0x14, 0x16 +.byte 0xc7, 0x17, 0x7a, 0x19, 0x2d, 0x1b, 0x33, 0x75, 0xdf, 0x1c, 0x92, 0x1e, 0x45, 0x20, 0xf8, 0x21 +.byte 0xaa, 0x23, 0x31, 0x75, 0x5d, 0x25, 0x10, 0x27, 0x3c, 0x75, 0x05, 0x0d, 0x3f, 0x75, 0x0b, 0x1a +.byte 0x32, 0x75, 0x10, 0x27, 0x49, 0x75, 0x10, 0x27, 0x45, 0x75, 0x4f, 0x00, 0x32, 0x75, 0x8d, 0x01 +.byte 0x08, 0x04, 0x57, 0x04, 0xc4, 0x00, 0x31, 0x75, 0x95, 0x05, 0x0f, 0x08, 0x88, 0x01, 0x8a, 0x0a +.byte 0xc8, 0x0b, 0x32, 0x75, 0x05, 0x0d, 0x31, 0x75, 0x4c, 0x02, 0x55, 0x0d, 0xa4, 0x0d, 0xe2, 0x0e +.byte 0x31, 0x0f, 0x31, 0x75, 0x6e, 0x10, 0x31, 0x75, 0xbe, 0x10, 0xfb, 0x11, 0x39, 0x13, 0x88, 0x13 +.byte 0xd7, 0x13, 0x15, 0x15, 0x10, 0x03, 0x52, 0x16, 0x90, 0x17, 0xcd, 0x18, 0x31, 0x75, 0xd4, 0x03 +.byte 0x1d, 0x19, 0x98, 0x04, 0x6c, 0x19, 0xe7, 0x1b, 0x62, 0x1e, 0xdd, 0x20, 0x1a, 0x22, 0x95, 0x24 +.byte 0x10, 0x27, 0x32, 0x75, 0x5d, 0x05, 0x35, 0x75, 0x21, 0x06, 0xe5, 0x06, 0xa9, 0x07, 0x6d, 0x08 +.byte 0xf5, 0x09, 0xb9, 0x0a, 0x7d, 0x0b, 0x41, 0x0c, 0x05, 0x0d, 0x8d, 0x0e, 0x52, 0x0f, 0x16, 0x10 +.byte 0x9e, 0x11, 0x62, 0x12, 0x26, 0x13, 0x31, 0x75, 0xae, 0x14, 0x36, 0x16, 0xbe, 0x17, 0x83, 0x18 +.byte 0x47, 0x19, 0x0b, 0x1a, 0xcf, 0x1a, 0x93, 0x1b, 0x57, 0x1c, 0x1b, 0x1d, 0xdf, 0x1d, 0x31, 0x75 +.byte 0xa3, 0x1e, 0x33, 0x75, 0x67, 0x1f, 0x2b, 0x20, 0xef, 0x20, 0xb3, 0x21, 0x78, 0x22, 0x32, 0x75 +.byte 0x00, 0x24, 0xc4, 0x24, 0x31, 0x75, 0x88, 0x25, 0x4c, 0x26, 0x10, 0x27, 0x38, 0x75, 0x10, 0x27 +.byte 0x37, 0x75 + +.global gUnknown_8108E36 +gUnknown_8108E36: @ 8108E36 +.byte 0x33, 0x75, 0x83, 0x06, 0x34, 0x75, 0x8d, 0x20, 0x10, 0x27, 0x99, 0x75, 0x10, 0x27 +.byte 0x34, 0x75, 0xc4, 0x09, 0x32, 0x75, 0x88, 0x13, 0x4c, 0x1d, 0x3a, 0x75, 0x10, 0x27, 0x89, 0x75 +.byte 0x10, 0x27, 0x4a, 0x75 + +.global gUnknown_8108E58 +gUnknown_8108E58: @ 8108E58 +@ replacing .incbin "baserom.gba", 0x00108e58, 0x68 +@ u16*s +.4byte gUnknown_8108184 +.4byte gUnknown_810819C +.4byte gUnknown_81081EA +.4byte gUnknown_8108274 +.4byte gUnknown_8108302 +.4byte gUnknown_810838E +.4byte gUnknown_8108432 +.4byte gUnknown_81084D6 +.4byte gUnknown_810857E +.4byte gUnknown_810862C +.4byte gUnknown_81086C8 +.4byte gUnknown_8108766 +.4byte gUnknown_8108804 +.4byte gUnknown_81088A2 +.4byte gUnknown_810893E +.4byte gUnknown_81089DA +.4byte gUnknown_8108A10 +.4byte gUnknown_8108A6E +.4byte gUnknown_8108AB4 +.4byte gUnknown_8108B16 +.4byte gUnknown_8108B5C +.4byte gUnknown_8108BC0 +.4byte gUnknown_8108C12 +.4byte gUnknown_8108C92 +.4byte gUnknown_8108D18 +.4byte gUnknown_8108E36 + +.global gUnknown_8108EC0 +gUnknown_8108EC0: @ 8108EC0 +@ replacing .incbin "baserom.gba", 0x108EC0, 0x50 +.byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f +.byte 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x10, 0x17, 0x18, 0x19, 0x14, 0x17, 0x1c, 0x1d, 0x1e, 0x1f +.byte 0x20, 0x21, 0x1c, 0x23, 0x24, 0x25, 0x1e, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f +.byte 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x2d, 0x2d, 0x3b, 0x3c, 0x30, 0x3e, 0x3f +.byte 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f + +.global gUnknown_8108F10 +gUnknown_8108F10: @ 8108F10 +.string "{color YELLOW_D}%s{reset}\0" +.align 2,0 + +.global gUnknown_8108F18 +gUnknown_8108F18: @ 8108F18 +.string "{color YELLOW_D}%s{reset} {color CYAN}%d{reset}F\0" +.align 2,0 + +.global gUnknown_8108F2C +gUnknown_8108F2C: @ 8108F2C +.string "{color YELLOW_D}%s{reset} B{color CYAN}%d{reset}F\0" +.align 2,0 + +.global gUnknown_8108F40 +gUnknown_8108F40: @ 8108F40 +.byte 0x00, 0x00 + +.global gUnknown_8108F42 +gUnknown_8108F42: @ 8108F42 +.byte 0x99, 0x00, 0x9c, 0x00, 0x9e, 0x00, 0xdb, 0x00 + +.global gUnknown_8108F4A +gUnknown_8108F4A: @ 8108F4A +.byte 0xe1, 0xe7, 0xe6, 0xe2, 0x00, 0x00 + +.global gUnknown_8108F50 +gUnknown_8108F50: @ 8108F50 +.string "No problem.\0" +.align 2,0 +@ items.c +.string "pksdir0\0" +.align 2,0 + +.global gUnknown_8108F64 +gUnknown_8108F64: @ 8108F64 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x2c, 0x01, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0c, 0x21, 0x40, 0x10, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x21, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x84, 0x0c, 0x21, 0x44, 0xff, 0x03, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x11, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x08, 0x00, 0x02, 0x00, 0x80, 0x80, 0x0c, 0x21, 0xc4, 0x55, 0x1d, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x08, 0x02, 0x02, 0x00, 0x80, 0x00, 0x0c, 0x21, 0xc4, 0xfd, 0x25, 0x02, 0x00, 0x00 +.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x21, 0xc0, 0xfe, 0x44, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x08, 0x00, 0x02, 0x00, 0x80, 0x80, 0x0c, 0x21, 0xc4, 0xfc, 0x45, 0x02, 0x00, 0x00 +.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x80, 0x00, 0x18, 0x82, 0x00, 0x00, 0x80, 0x00, 0x0c, 0x21, 0xc4, 0xfd, 0x45, 0x02, 0x00, 0x00 +.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x80, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x70, 0x64, 0x02, 0x00, 0x00 +.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x18, 0x80, 0x02, 0x00, 0x80, 0x00, 0x0c, 0x21, 0x44, 0xfd, 0x61, 0x02, 0x00, 0x00 +.byte 0x66, 0x81, 0x83, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x20, 0x00, 0x09, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x84, 0x04, 0x38, 0x80, 0x02, 0x00, 0x80, 0x04, 0x0c, 0x21, 0x44, 0xfd, 0x7d, 0x02, 0x00, 0x00 +.byte 0x66, 0x83, 0x93, 0x4d, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x20, 0x40, 0xfd, 0x45, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x8c, 0x14, 0x7e, 0xa2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x64, 0x02, 0x00, 0x20 +.byte 0x66, 0x81, 0xd7, 0xcd, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x0c, 0x14, 0x7e, 0xa2, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xa8, 0x0c, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xef, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 +.byte 0x00, 0x14, 0x7f, 0xa0, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xef, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x3c, 0x7e, 0xc2, 0x08, 0x10, 0xa0, 0x20, 0xbe, 0x21, 0xc0, 0xff, 0x7f, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8c, 0x3c, 0x7e, 0xc2, 0x08, 0x10, 0xa0, 0x80, 0xbc, 0x20, 0x10, 0x01, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x08, 0x20, 0x40, 0xfd, 0x45, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x84, 0x3c, 0xe1, 0x03, 0x00, 0x00, 0x02, 0x00, 0x08 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0x02, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x21, 0x9a, 0x21, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0x02, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x21, 0x9a, 0x21, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xbe, 0x7e, 0xe9, 0x4e, 0x3c, 0xa0, 0xa7, 0xbf, 0x39, 0x20, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xfc, 0x27, 0xfc, 0xff, 0xbb, 0x9f, 0x79, 0xec, 0x00, 0x01, 0x00, 0x00 +.byte 0x8e, 0xfe, 0x7e, 0xe9, 0x4e, 0x34, 0xa0, 0xa7, 0xbf, 0x39, 0x04, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xfc, 0x27, 0xfc, 0xff, 0xbb, 0x9f, 0x59, 0xec, 0x00, 0x01, 0x00, 0x00 +.byte 0x8c, 0x14, 0x7f, 0xe2, 0x00, 0x00, 0xa0, 0x84, 0x0f, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 +.byte 0x8c, 0x14, 0x7f, 0xe2, 0x00, 0x00, 0xa0, 0x84, 0x0f, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x04, 0x38, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x28 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x00, 0x02, 0x08, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x10, 0xa0, 0xae, 0xbf, 0x39, 0x08, 0x00, 0x00, 0x02, 0x20, 0x60 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0xae, 0xbf, 0xf9, 0x07, 0x00, 0x00, 0x02, 0x02, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0xae, 0xbf, 0xf9, 0x07, 0x00, 0x00, 0x02, 0x04, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x82, 0x3c, 0x06, 0xc0, 0x0c, 0x30, 0xa0, 0x00, 0x0d, 0x21, 0x00, 0x00, 0x00, 0x82, 0x01, 0x28 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 +.byte 0x8e, 0xc0, 0x03, 0x69, 0x46, 0x00, 0xa0, 0xae, 0xbf, 0xf9, 0x07, 0x00, 0x00, 0x12, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xfd, 0x7f, 0xe9, 0xcf, 0x37, 0xa0, 0x84, 0x3c, 0x21, 0x10, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xef, 0xf4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x35, 0x7b, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x0c, 0x01, 0x04, 0x02, 0x02, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x08, 0x40, 0x06, 0x00, 0xa0, 0x80, 0x0c, 0x21, 0xc4, 0x55, 0x1d, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x08, 0x40, 0x06, 0x00, 0xa0, 0x80, 0x0c, 0x21, 0xc4, 0x55, 0x1d, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x35, 0xfb, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x35, 0xfb, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x0d, 0x21, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x0d, 0x21, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8c, 0x14, 0x7f, 0xe2, 0x00, 0x00, 0xa0, 0x84, 0x0f, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0x34, 0xfb, 0xab, 0xc9, 0x01, 0xa0, 0xad, 0xbf, 0x39, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x04, 0x8c, 0x21, 0xc4, 0xff, 0x7f, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xac, 0x1c, 0x19, 0x04, 0x56, 0x02, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x8c, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xc5, 0x7f, 0x88, 0x8e, 0x1b, 0xa0, 0xad, 0xbf, 0xe5, 0x2b, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0xef, 0xd3, 0xd7, 0xff, 0xfe, 0x07, 0xf4, 0xff, 0xb9, 0xff, 0xf9, 0xee, 0x00, 0x01, 0x00, 0x00 +.byte 0x80, 0x35, 0xfb, 0xab, 0xc9, 0x01, 0x20, 0x28, 0x38, 0x00, 0x00, 0x00, 0x00, 0x62, 0x00, 0x28 +.byte 0x67, 0x93, 0xd7, 0x7f, 0xf0, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x39, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x77, 0xa0, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 +.byte 0x8e, 0xfd, 0xff, 0xeb, 0xef, 0x3f, 0xa0, 0xfb, 0xbf, 0x3f, 0x1c, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0xef, 0xd3, 0xd7, 0xff, 0xfe, 0x27, 0xfc, 0xff, 0xfb, 0xff, 0xf9, 0xee, 0x00, 0x01, 0x00, 0x00 +.byte 0x8e, 0xff, 0xff, 0xeb, 0xef, 0x7f, 0xa0, 0xfb, 0xbf, 0x3f, 0x1c, 0x00, 0x00, 0x02, 0x00, 0x20 +.byte 0x67, 0x93, 0xd7, 0xff, 0xf4, 0x07, 0xd0, 0xa1, 0x03, 0x37, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00 + +.global gItemParaFileName +gItemParaFileName: @ 8109764 +.string "itempara\0" +.align 2,0 + +.global gUnknown_8109770 +gUnknown_8109770: @ 8109770 +.string "%s %d\0" +.align 2,0 + +.global gUnknown_8109778 +gUnknown_8109778: @ 8109778 +.string "%s\0" +.align 2,0 + +.global gUnknown_810977C +gUnknown_810977C: @ 810977C +@ replacing .incbin "baserom.gba", 0x0010977c, 0x8 +.string "%d {POKE}\0" + +.global gUnknown_8109784 +gUnknown_8109784: @ 8109784 +@ replacing .incbin "baserom.gba", 0x00109784, 0x8 +.byte 0x87, 0x44 +.asciz "%s\0" +.align 2,0 + +.global gUnknown_810978C +gUnknown_810978C: @ 810978C +@ replacing .incbin "baserom.gba", 0x0010978c, 0x8 +.byte 0x87, 0x41 +.asciz "%s\0" +.align 2,0 + +.global gUnknown_8109794 +gUnknown_8109794: @ 8109794 +@ replacing .incbin "baserom.gba", 0x00109794, 0x10 +.string "%s{UNK_MACRO_3D}%c{COLOR GREEN_RAW}%s{RESET}\0" +.align 2, 0 + +.global gUnknown_81097A4 +gUnknown_81097A4: @ 81097A4 +@ replacing .incbin "baserom.gba", 0x001097a4, 0xc +.string "%s{COLOR GREEN_RAW}%s{RESET}\0" +.align 2, 0 + +.global gPowersOfTen +gPowersOfTen: @ 81097B0 +@ replacing .incbin "baserom.gba", 0x001097b0, 0x14 +.byte 0xa0, 0x86, 0x01, 0x00, 0x10, 0x27, 0x00, 0x00, 0xe8, 0x03, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00 + +.global gHighDigits +gHighDigits: @ 81097C4 +.byte 0x83 + +.global gUnknown_81097C5 +gUnknown_81097C5: @ 81097C5 +.byte 0x9f, 0x83, 0xa0, 0x83, 0xa1, 0x83, 0xa2, 0x83, 0xa3, 0x83, 0xa4, 0x83, 0xa5, 0x83, 0xa6, 0x83, 0xa7, 0x83, 0xa8, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x97, 0x10, 0x08 + +.global gGummiStatBoostLUT +gGummiStatBoostLUT: @ 81097E0 +.2byte 1 +.2byte 2 +.2byte 4 +.2byte 8 + +.global gUnknown_81097E8 +gUnknown_81097E8: @ 81097E8 +.byte 0x10, 0x00, 0x00, 0x00 +.byte 0x12, 0x00, 0x00, 0x00 +.byte 0x14, 0x00, 0x00, 0x00 +.byte 0x16, 0x00, 0x00, 0x00 + +.global gUnknown_81097F8 +gUnknown_81097F8: @ 81097F8 +.byte 0x11, 0x00, 0x00, 0x00 +.byte 0x13, 0x00, 0x00, 0x00 +.byte 0x15, 0x00, 0x00, 0x00 +.byte 0x17, 0x00, 0x00, 0x00 +@ START rescue_team_info.c +.string "pksdir0\0" + +.global gRescueRankMaxPoints +gRescueRankMaxPoints: @ 8109810 +.4byte 50 +.4byte 500 +.4byte 1500 +.4byte 3000 +.4byte 7500 +.4byte 15000 +.4byte 100000000 + +.global gTeamNamePlaceholder +gTeamNamePlaceholder: @ 810982C +.string "PokĂ©mon\0" +@ END rescue_team_info.c +@ text_util +.string "pksdir0\0" + +.global gUnknown_810983C +gUnknown_810983C: @ 810983C +.4byte gUnknown_8109888 +.4byte gUnknown_8109884 +.4byte gUnknown_8109880 +.4byte gUnknown_810987C +.4byte gUnknown_8109878 +.4byte gUnknown_8109874 +.4byte gUnknown_8109870 +.4byte gUnknown_810986C +.4byte gUnknown_8109868 +.4byte gUnknown_8109864 + +.global gUnknown_8109864 +gUnknown_8109864: @ 8109864 +.byte 0x82, 0x58, 0x00, 0x00 + +.global gUnknown_8109868 +gUnknown_8109868: @ 8109868 +.byte 0x82, 0x57, 0x00, 0x00 + +.global gUnknown_810986C +gUnknown_810986C: @ 810986C +.byte 0x82, 0x56, 0x00, 0x00 + +.global gUnknown_8109870 +gUnknown_8109870: @ 8109870 +.byte 0x82, 0x55, 0x00, 0x00 + +.global gUnknown_8109874 +gUnknown_8109874: @ 8109874 +.byte 0x82, 0x54, 0x00, 0x00 + +.global gUnknown_8109878 +gUnknown_8109878: @ 8109878 +.byte 0x82, 0x53, 0x00, 0x00 + +.global gUnknown_810987C +gUnknown_810987C: @ 810987C +.byte 0x82, 0x52, 0x00, 0x00 + +.global gUnknown_8109880 +gUnknown_8109880: @ 8109880 +.byte 0x82, 0x51, 0x00, 0x00 + +.global gUnknown_8109884 +gUnknown_8109884: @ 8109884 +.byte 0x82, 0x50, 0x00, 0x00 + +.global gUnknown_8109888 +gUnknown_8109888: @ 8109888 +.byte 0x82, 0x4f, 0x00, 0x00 +@ ??? +.string "pksdir0\0" +@ ??? +.string "pksdir0\0" +@ START friend_area.c +.string "pksdir0\0" + +.global sUnknown_81098A4 +sUnknown_81098A4: @ 81098A4 +.string "{color GREEN_RAW}%s{reset}\0" +.align 2,0 + +.global sUnknown_81098AC +sUnknown_81098AC: @ 81098AC +.string "%s{UNK_MACRO_3D}%c{COLOR GREEN_RAW}%s{RESET}\0" +.align 2,0 +@ END friend_area.c +@ moves.c +.string "pksdir0" +.align 2,0 + +.global gUnknown_81098C4 +gUnknown_81098C4: @ 81098C4 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +.global gUnknown_81098D0 +gUnknown_81098D0: @ 81098D0 +.string "wazapara\0" +.align 2,0 + +.global gUnknown_81098DC +gUnknown_81098DC: @ 81098DC +.string "%+d\0" + +.global gUnknown_81098E0 +gUnknown_81098E0: @ 81098E0 +.string "{color}%c%s%s{reset}\0" +.align 2,0 + +.global gUnknown_81098EC +gUnknown_81098EC: @ 81098EC +.string "{color}%c#:%s%s%s#;%c%2d/%2d{reset}\0" +.align 2,0 + +.global gUnknown_8109908 +gUnknown_8109908: @ 8109908 +.byte 0x87, 0x41, 0x00, 0x00 @ apparently shows A in memory viewer + +.global gUnknown_810990C +gUnknown_810990C: @ 810990C +.byte 0x87, 0x40, 0x00, 0x00 @ apparently shows @ in memory viewer + +.global gUnknown_8109910 +gUnknown_8109910: @ 8109910 +.string "{color}%c%s%s%s{UNK_MACRO_3D}%c%2d/%2d{reset}\0" +.align 2,0 + +.global gUnknown_8109928 +gUnknown_8109928: @ 8109928 +.byte 0x87, 0x42, 0x00 @ apparently shows B in memory viewer + +.global gUnknown_810992B +gUnknown_810992B: @ 810992B +.byte 0x00 + +.global gUnknown_810992C +gUnknown_810992C: @ 810992C +.string "%s\0" +.align 2,0 + +.global gUnknown_8109930 +gUnknown_8109930: @ 8109930 +.string "{POKEMON_0}\0" +.align 2,0 +@ ??? +.string "pksdir0\0" +.align 2,0 +@ ??? +.string "pksdir0\0" +.align 2,0 +@ ??? +.string "pksdir0\0" +.align 2,0 diff --git a/data/move/move_names.s b/data/move/move_names.s index e6e227771..de1baa257 100644 --- a/data/move/move_names.s +++ b/data/move/move_names.s @@ -275,7 +275,7 @@ MoveUseTextBide: .global MoveNameBide2 MoveNameBide2: -.string "ăŚăżă‚“\0" +.string "ăŚăľă‚“\0" .align 2,0 .global MoveDescriptionIsWatching @@ -285,7 +285,7 @@ MoveDescriptionIsWatching: .global MoveNameIsWatching MoveNameIsWatching: -.string "ă‚ă†ă™ă‚’ăľă‚‹\0" +.string "ă‚ă†ă™ă‚’ăżă‚‹\0" .align 2,0 .global MoveUseTextRegularAttack diff --git a/include/code_800F958.h b/include/code_800F958.h new file mode 100644 index 000000000..884e9a7f9 --- /dev/null +++ b/include/code_800F958.h @@ -0,0 +1,8 @@ +#ifndef GUARD_CODE_800F958_H +#define GUARD_CODE_800F958_H + +#include "structs/str_position.h" + +void AddPokemonDungeonSprite(s32 id, s16 species, Position *pos, u32); + +#endif // GUARD_CODE_800F958_H \ No newline at end of file diff --git a/include/code_8041AD0.h b/include/code_8041AD0.h index 626fe14ba..0a0a1ac18 100644 --- a/include/code_8041AD0.h +++ b/include/code_8041AD0.h @@ -4,6 +4,7 @@ #include "structs/dungeon_entity.h" #include "structs/str_damage.h" -void sub_80420E8(Entity *pokemon, struct DamageStruct *dmgStruct); +void sub_80420E8(Entity *pokemon, DamageStruct *dmgStruct); +void sub_80421C0(Entity *pokemon, u16); -#endif +#endif // GUARD_CODE_8041AD0_H \ No newline at end of file diff --git a/include/code_8045A00.h b/include/code_8045A00.h index df17445c2..7649e9970 100644 --- a/include/code_8045A00.h +++ b/include/code_8045A00.h @@ -5,4 +5,6 @@ void SetMessageArgument(u8 *buffer, Entity *entity, u32 param_3); -#endif // GUARD_CODE_8045A00_H +void sub_8045ACC(void); + +#endif // GUARD_CODE_8045A00_H \ No newline at end of file diff --git a/include/code_8092334.h b/include/code_8092334.h index 3a2fe8e51..3c7e6c1e5 100644 --- a/include/code_8092334.h +++ b/include/code_8092334.h @@ -1,14 +1,7 @@ #ifndef GUARD_CODE_8092334_H #define GUARD_CODE_8092334_H -// size: 0x10 -typedef struct DataSerializer -{ - u8 *stream; - u8 *end; // exclusive end of the stream - u32 count; // Used to count bits between ReadBits functions, or count bytes between ReadBytes functions - u32 unkC; // Seems to be a temporary 32 bit storage -} DataSerializer; +#include "data_serializer.h" void nullsub_102(DataSerializer *seri); void ReadBits(DataSerializer *seri, void *dst, s32 numBits); diff --git a/include/data_serializer.h b/include/data_serializer.h new file mode 100644 index 000000000..4398a28d0 --- /dev/null +++ b/include/data_serializer.h @@ -0,0 +1,13 @@ +#ifndef GUARD_DATA_SERIALIZER_H +#define GUARD_DATA_SERIALIZER_H + +// size: 0x10 +typedef struct DataSerializer +{ + u8 *stream; + u8 *end; // Exclusive end of the stream + u32 count; // Used to count bits between ReadBits functions, or count bytes between ReadBytes functions + u32 unkC; // Seems to be a temporary 32 bit storage +} DataSerializer; + +#endif // GUARD_DATA_SERIALIZER_H \ No newline at end of file diff --git a/include/dungeon_map_access.h b/include/dungeon_map_access.h index 45ea6a242..d95b12019 100644 --- a/include/dungeon_map_access.h +++ b/include/dungeon_map_access.h @@ -10,6 +10,8 @@ typedef struct unkStruct_202F190 Tile *GetTile(s32 x, s32 y); Tile *GetTileSafe(s32 x, s32 y); + +void sub_8049ED4(void); void sub_804AC20(Position *pos); -#endif +#endif // GUARD_DUNGEON_MAP_ACCESS_H \ No newline at end of file diff --git a/include/dungeon_serializer.h b/include/dungeon_serializer.h new file mode 100644 index 000000000..93955b4df --- /dev/null +++ b/include/dungeon_serializer.h @@ -0,0 +1,11 @@ +#ifndef GUARD_DUNGEON_SERIALIZER_H +#define GUARD_DUNGEON_SERIALIZER_H + +#include "data_serializer.h" + +void ReadDungeonState(u8 *buffer, u32 bufLen); +void SaveDungeonState(u8 *buffer, u32 bufLen); + +void sub_8082B40(void); + +#endif // GUARD_DUNGEON_SERIALIZER_H \ No newline at end of file diff --git a/include/pokemon.h b/include/pokemon.h index 2424fb24e..ec99ed9f0 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -36,7 +36,7 @@ void LoadMonsterParameters(void); unkStruct_203B45C *GetRecruitedPokemon(void); void InitializeRecruitedPokemon(void); -// These two need to be overridden in status_actions.c +// This needs to be overridden in status_actions.c // Uncomment when fixed //u8 GetBodySize(s16 index); diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 8bed713aa..712807bb5 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -2,6 +2,7 @@ #define GUARD_DUNGEON_ENTITY_H #include "constants/global.h" +#include "constants/dungeon_action.h" #include "structs/str_position.h" #include "sprite.h" #include "structs/str_items.h" @@ -28,10 +29,11 @@ #define NUM_PICKED_IQ_SKILLS 3 +// size: 0x8 typedef struct unkStruct_8044CC8 { - u8 actionUseIndex; - Position lastItemThrowPosition; + /* 0x0 */ u8 actionUseIndex; + /* 0x4 */ Position lastItemThrowPosition; } unkStruct_8044CC8; // size: 0x18 @@ -46,18 +48,21 @@ typedef struct ActionContainer /* 0x14 */ Position itemTargetPosition; } ActionContainer; +// size: 0x4 typedef struct HiddenPower { /* 0x0 */ s16 hiddenPowerBasePower; /* 0x2 */ u8 hiddenPowerType; } HiddenPower; +// size: 0x4 typedef struct JoinedAt { /* 0x0 */ u8 joinedAt; /* 0x1 */ u8 unk1; } JoinedAt; +// size: 0x14 typedef struct AITarget { /* 0x0 */ u8 aiObjective; @@ -68,15 +73,16 @@ typedef struct AITarget /* 0x8 */ struct Entity *aiTarget; /* 0xC */ u32 unkC; /* 0x10 */ Position aiTargetPos; - } AITarget; +// size: 0x4 typedef struct Sleep { /* 0x0 */ u8 sleep; /* 0x1 */ u8 sleepTurns; } Sleep; +// size: 0x4 typedef struct NonVolatile { /* 0x0 */ u8 nonVolatileStatus; @@ -85,6 +91,7 @@ typedef struct NonVolatile /* 0x3 */ u8 unk4; } NonVolatile; +// size: 0xC typedef struct Immobilize { /* 0x0 */ u8 immobilizeStatus; @@ -93,12 +100,14 @@ typedef struct Immobilize /* 0x9 */ u8 immobilizeStatusDamageCountdown; } Immobilize; +// size: 0x4 typedef struct Volatile { /* 0x0 */ u8 volatileStatus; /* 0x1 */ u8 volatileStatusTurns; } Volatile; +// size: 0x4 typedef struct Charging { /* 0x0 */ u8 chargingStatus; @@ -106,60 +115,68 @@ typedef struct Charging /* 0x2 */ u8 chargingStatusMoveIndex; // The position of the move in the PokĂ©mon's moveset that triggered the status. } Charging; +// size: 0x4 typedef struct Protection { /* 0x0 */ u8 protectionStatus; /* 0x1 */ u8 protectionStatusTurns; } Protection; +// size: 0x8 typedef struct Waiting { - /* 0xC8 */ u8 waitingStatus; - /* 0xC9 */ bool8 enemyDecoy; // True if the PokĂ©mon is a decoy and a wild PokĂ©mon (i.e., not an allied PokĂ©mon). - u8 unkCA; - /* 0xCB */ u8 waitingStatusTurns; - /* 0xCC */ u8 curseDamageCountdown; + /* 0x0 */ u8 waitingStatus; + /* 0x1 */ bool8 enemyDecoy; // True if the PokĂ©mon is a decoy and a wild PokĂ©mon (i.e., not an allied PokĂ©mon). + /* 0x2 */ bool8 unk2; + /* 0x3 */ u8 waitingStatusTurns; + /* 0x4 */ u8 curseDamageCountdown; } Waiting; +// size: 0xC typedef struct Linked { - /* 0xD0 */ u8 linkedStatus; - /* 0xD4 */ u32 unkD4; - /* 0xD8 */ u8 unkD8; - /* 0xD9 */ u8 linkedStatusTurns; - /* 0xDA */ u8 linkedStatusDamageCountdown; + /* 0x0 */ u8 linkedStatus; + /* 0x4 */ u32 unk4; + /* 0x8 */ u8 unk8; + /* 0x9 */ u8 linkedStatusTurns; + /* 0xA */ u8 linkedStatusDamageCountdown; } Linked; - +// size: 0x4 typedef struct MoveStatus { - /* 0xDC */ u8 moveStatus; - /* 0xDD */ u8 moveStatusTurns; + /* 0x0 */ u8 moveStatus; + /* 0x0 */ u8 moveStatusTurns; } MoveStatus; +// size: 0x4 typedef struct ItemStatus { - /* 0xE0 */ u8 itemStatus; + /* 0x0 */ u8 itemStatus; } ItemStatus; +// size: 0x4 typedef struct TransformStatus { - /* 0xE4 */ u8 transformStatus; - /* 0xE5 */ u8 transformStatusTurns; + /* 0x0 */ u8 transformStatus; + /* 0x0 */ u8 transformStatusTurns; } TransformStatus; +// size: 0x4 typedef struct EyesightStatus { - /* 0xE8 */ u8 eyesightStatus; - /* 0xE9 */ u8 eyesightStatusTurns; + /* 0x0 */ u8 eyesightStatus; + /* 0x0 */ u8 eyesightStatusTurns; } EyesightStatus; +// size: 0x4 typedef struct Muzzled { - /* 0xEC */ bool8 muzzled; - /* 0xED */ u8 muzzledTurns; + /* 0x0 */ bool8 muzzled; + /* 0x1 */ u8 muzzledTurns; } Muzzled; +// size: 0x1C typedef struct Unk_Entity_x184 { /* 0x184 - 0x0 */ Position previousTargetMovePosition1; @@ -169,12 +186,13 @@ typedef struct Unk_Entity_x184 /* 0x194 - 0x10*/ Position32 lastMoveIncrement; /* 0x19C - 0x18 */ s16 walkAnimFramesLeft; // Set when the PokĂ©mon starts moving, and counts down until the PokĂ©mon's walk animation stops. /* 0x19e - 0x1a */ u8 unk1A; -} Unk_Entity_x184 ; +} Unk_Entity_x184; +// size: 0x24 typedef struct Moves { - /* 0x118 */ Move moves[MAX_MON_MOVES]; - /* 0x138 */ u8 struggleMoveFlags; + /* 0x0 */ Move moves[MAX_MON_MOVES]; + /* 0x20 */ u8 struggleMoveFlags; } Moves; // size: 0x208 diff --git a/include/structs/str_damage.h b/include/structs/str_damage.h index 6003f0dfc..571d4d76d 100644 --- a/include/structs/str_damage.h +++ b/include/structs/str_damage.h @@ -1,7 +1,8 @@ #ifndef GUARD_STR_DAMAGE_H #define GUARD_STR_DAMAGE_H -struct DamageStruct +// size: 0x10 +typedef struct DamageStruct { s32 dmg; s32 residualDmgType; @@ -10,6 +11,6 @@ struct DamageStruct bool8 isCrit; u8 unkE; bool8 tookNoDamage; -}; +} DamageStruct; -#endif +#endif // GUARD_STR_DAMAGE_H \ No newline at end of file diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index 3ea209bee..08200e67d 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -24,17 +24,17 @@ typedef struct DungeonLocation /* 0x1 */ u8 floor; } DungeonLocation; +// size: 0x18 typedef struct Weather { - /* 0xE264 */ u8 weather; // Uses the weather constants in weather.h. - u8 unkE265; // Uses the weather constants in weather.h - /* 0xE266 */ u8 weatherDamageCounter; // Timer for applying sandstorm/hail damage periodically. - /* 0xE267 */ u8 unkE267[8]; - /* 0xE26F */ u8 naturalWeather[8]; // The weather at the start of the floor. If the weather changes, then expires, revert back to the starting weather. - /* 0xE277 */ u8 mudSportTurns; - /* 0xE278 */ u8 waterSportTurns; - /* 0xE279 */ bool8 nullifyWeather; // Air Lock and Cloud Nine toggle this to disable weather effects - + /* 0x0 */ u8 weather; // Uses the weather constants in weather.h. + /* 0x1 */ u8 unkE265; // Uses the weather constants in weather.h + /* 0x2 */ u8 weatherDamageCounter; // Timer for applying sandstorm/hail damage periodically. + /* 0x3 */ u8 unkE267[8]; + /* 0xB */ u8 naturalWeather[8]; // The weather at the start of the floor. If the weather changes, then expires, revert back to the starting weather. + /* 0x13 */ u8 mudSportTurns; + /* 0x14 */ u8 waterSportTurns; + /* 0x15 */ bool8 nullifyWeather; // Air Lock and Cloud Nine toggle this to disable weather effects } Weather; // size: 0x30 @@ -66,6 +66,8 @@ typedef struct DungeonMusicPlayer /* 0x0 */ u32 state; /* 0x4 */ u32 fadeOutSpeed; /* 0x8 */ u16 fadeInSpeed; + + // dungeon_serializer.c refers to these 3 as s16, but they are almost always handled as u16 /* 0xA */ u16 songIndex; /* 0xC */ u16 pastSongIndex; /* 0xE */ u16 queuedSongIndex; @@ -85,15 +87,15 @@ typedef struct UnkDungeonGlobal_unk181E8_sub u8 unk18208; // x20 /* 0x18209 */ u8 visibilityRange; // x21 Dungeon light level. /* 0x1820A */ bool8 blinded; // x22 Blacks out the screen when the player has the Blinker status. - u8 unk1820B; // x23 - u8 unk1820C; // x24 - u8 unk1820D; // x25 - u8 unk1820E; // x26 - u8 unk1820F; // x27 + bool8 unk1820B; // x23 + bool8 unk1820C; // x24 + bool8 unk1820D; // x25 + bool8 unk1820E; // x26 + bool8 unk1820F; // x27 /* 0x18210 */ bool8 hallucinating; // x28 Displays Substitute and flower sprites when the player has the Cross-Eyed status. - u8 unk18211; // x29 + bool8 unk18211; // x29 u8 unk18212; // x2A - u8 unk18213; // x2B + bool8 unk18213; // x2B u8 unk18214; // x2C u8 unk18215; // x2D u8 unk18216; // x2E @@ -281,6 +283,22 @@ typedef struct unkDungeon644 /* 0x55 */ u8 unk55; } unkDungeon644; +// size: 0x10 +typedef struct unkDungeonE240 +{ + /* 0x0 */ u32 unk0; + /* 0x4 */ u32 unk4; + /* 0x8 */ u32 unk8; + /* 0xC */ u32 unkC; +} unkDungeonE240; + +// size: 0x4 +typedef struct unkDungeonE260 +{ + /* 0x0 */ u16 unk0; + /* 0x2 */ u16 unk2; +} unkDungeonE260; + // size: 0x1CEDC typedef struct Dungeon { @@ -315,7 +333,7 @@ typedef struct Dungeon /* 0x5C0 */ s32 unk5C0; /* 0x5C4 */ struct unkStruct_Dungeon5C4_sub unk5C4[3]; /* 0x5F4 */ u8 faintStringBuffer[80]; - unkDungeon644 unk644; // This data persists between save/reload. See sub_8080B90 and sub_8081C50 + unkDungeon644 unk644; EntityInfo unk69C[MAX_TEAM_MEMBERS]; EntityInfo unkEBC[DUNGEON_MAX_WILD_POKEMON_BODY_SIZE]; u8 fill2F3C[0x343C - 0x2F3C]; @@ -331,17 +349,18 @@ typedef struct Dungeon /* 0x37F8 */ bool8 plusIsActive[2]; // Index 0: Enemy , Index 1: Team /* 0x37FA */ bool8 minusIsActive[2]; // Index 0: Enemy , Index 1: Team /* 0x37FC */ bool8 decoyActive; - /* 0x37FD */ u8 unk37FD; + /* 0x37FD */ bool8 unk37FD; /* 0x37FE */ bool8 deoxysDefeat; // Flag set for deoxys in Meteor Cave - /* 0x37FE */ u8 unk37FF; - s16 unk3800; - EntityInfo *unk3804[DUNGEON_MAX_ITEMS]; + /* 0x37FE */ bool8 unk37FF; + // dungeon_serializer.c refers to this as a u16 but elsewhere it's handled as a s16 + /* 0x3800 */ s16 deoxysForm; + EntityInfo *unk3804[DUNGEON_MAX_ITEMS]; // TODO: ItemInfo[DUNGEON_MAX_ITEMS] /* 0x3904 */ s16 unk3904; - EntityInfo *unk3908[DUNGEON_MAX_TRAPS]; - /* 0x3A08 */ u8 unk3A08; - /* 0x3A09 */ u8 unk3A09; - /* 0x3A0A */ u8 unk3A0A; - /* 0x3A0B */ u8 unk3A0B; + EntityInfo *unk3908[DUNGEON_MAX_TRAPS]; // TODO: TrapInfo[DUNGEON_MAX_TRAPS] + /* 0x3A08 */ bool8 unk3A08; + /* 0x3A09 */ bool8 unk3A09; + /* 0x3A0A */ bool8 unk3A0A; + /* 0x3A0B */ bool8 unk3A0B; u8 unk3A0C; /* 0x3A0D */ u8 unk3A0D; /* 0x3A0E */ s16 tileset; @@ -353,9 +372,9 @@ typedef struct Dungeon Position unkE218; Position unkE21C; // stair location? Position unkE220[8]; - u32 unkE240[4]; - u32 unkE250[4]; - u16 unkE260[2]; + unkDungeonE240 unkE240; + unkDungeonE240 unkE250; + unkDungeonE260 unkE260; /* 0xE264 */ Weather weather; // Uses the weather constants in weather.h. /* 0xE27C */ Tile unkE27C[8][8]; /* 0xE87C */ u8 unkE87C[8][8]; diff --git a/ld_script.txt b/ld_script.txt index 19b2ea34e..ab9d054e3 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -278,8 +278,7 @@ SECTIONS { src/trap.o(.text); asm/code_807FCD4.o(.text); src/trap_1.o(.text); - asm/code_8080CF0.o(.text); - src/code_8083288.o(.text); + src/dungeon_serializer.o(.text); src/dungeon_range.o(.text); src/code_808333C.o(.text); src/dungeon_leader.o(.text); @@ -557,6 +556,8 @@ SECTIONS { src/dungeon_capabilities.o(.rodata); src/dungeon_ai_targeting.o(.rodata); data/data_8107010.o(.rodata); + src/dungeon_serializer.o(.rodata); + data/data_8107224.o(.rodata); src/game_options.o(.rodata); data/data_8109964.o(.rodata); src/code_80972F4.o(.rodata); diff --git a/src/code_800F958.c b/src/code_800F958.c index fbce67483..1538ea514 100644 --- a/src/code_800F958.c +++ b/src/code_800F958.c @@ -1,4 +1,5 @@ #include "global.h" +#include "code_800F958.h" #include "dungeon_pokemon_sprites.h" #include "memory.h" @@ -7,7 +8,8 @@ extern DungeonPokemonSprite* GetDungeonPokemonSprite(s32 id); extern Position gUnknown_80D3564; -void AddPokemonDungeonSprite(s32 id, s16 species, Position *pos, u32 r3) { +void AddPokemonDungeonSprite(s32 id, s16 species, Position *pos, u32 r3) +{ DungeonPokemonSprite *dSprite; DungeonPokemonSprite *newSprite; Position newPos; diff --git a/src/code_803E724.c b/src/code_803E724.c index e8c45e0ab..7c9233200 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -64,7 +64,6 @@ extern u32 gUnknown_3001018[]; extern void sub_8040A84(); extern void sub_8083D44(void); -extern void sub_8049ED4(void); extern void sub_8040A84(void); extern void sub_80400D4(void); extern void sub_8041888(u8 param_1); diff --git a/src/code_8040094.c b/src/code_8040094.c index e54661ade..d59122eb5 100644 --- a/src/code_8040094.c +++ b/src/code_8040094.c @@ -19,7 +19,6 @@ extern OpenedFile *gUnknown_202EE04; extern void sub_803F7BC(void); extern void sub_803F580(u32); -extern void sub_8049ED4(); extern void sub_8040A84(); extern const char *gUnknown_80FD040; // It became brighter on the floor diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index c9f2733cc..9a0baa45a 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -37,7 +37,6 @@ extern void PlaySoundEffect(u32); extern u8 sub_803F428(Position *pos); extern void sub_8041550(Entity *pokemon, u32, u32, u32, u32, u32); -void sub_80421C0(Entity *pokemon, u16 r1); void EntityUpdateStatusSprites(Entity *entity); extern s32 gDungeonBrightness; diff --git a/src/code_804267C.c b/src/code_804267C.c index 6af03624f..20379e4e0 100644 --- a/src/code_804267C.c +++ b/src/code_804267C.c @@ -1,6 +1,6 @@ #include "global.h" +#include "code_8041AD0.h" #include "code_804267C.h" - #include "code_803E46C.h" #include "code_803E668.h" #include "code_8045A00.h" @@ -24,7 +24,6 @@ extern void sub_8040238(void); extern void sub_804151C(Entity *pokemon, u32 r1, u8 r2); extern void sub_804178C(u32); extern void sub_80416A4(Position *r0, u32 r1, bool8 r2); -extern void sub_80421C0(Entity *pokemon, u16 r1); extern void sub_80429A0(Entity *); extern void sub_8042B34(u32, u32, u32); extern bool8 sub_8042CC0(void); diff --git a/src/code_8042B34.c b/src/code_8042B34.c index 84f43a339..ddc1fe7cf 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -35,6 +35,7 @@ #include "constants/dungeon.h" #include "constants/monster.h" #include "constants/trap.h" +#include "dungeon_serializer.h" extern void sub_800EE5C(s32); extern void sub_800EF64(void); @@ -243,7 +244,7 @@ void sub_8042EC8(Entity *a0, s32 a1) } extern u8 gUnknown_203B40C; -extern u16 gUnknown_203B410; +extern Position gUnknown_203B410; extern u8 *gSerializedData_203B41C; struct Substruct_xxx_dungeon_8042F6C @@ -332,13 +333,11 @@ extern void sub_80521D0(void); extern void sub_803F27C(u8); extern void sub_807E7FC(u8); extern void sub_80095CC(u32, u32); -extern void ReadDungeonState(u8 *r0, u32 r1); extern bool8 IsLevelResetTo1(u8 dungeon); extern void sub_8068A84(PokemonStruct1 *pokemon); extern void sub_807EAA0(u32, u32); extern void sub_803D4D0(void); extern void sub_80842F0(void); -extern void sub_8082B40(void); extern void sub_80427AC(void); extern void sub_806AA70(void); extern void sub_803D8F0(void); @@ -357,7 +356,6 @@ extern void sub_8045CB0(void); extern void sub_807FA18(void); extern void sub_806A974(void); extern void sub_806CF60(void); -extern void sub_8049ED4(void); extern void sub_8049884(void); extern void sub_8068F80(void); extern bool8 sub_8044B28(void); @@ -371,7 +369,6 @@ extern void sub_803EAF0(u32, u32); extern void sub_806A914(u8 a0, u8 a1, u8 a2); extern void sub_803F4A0(Entity *a0); extern void sub_8083AB0(s16 param_0, Entity * target, Entity * entity); -extern void WriteDungeonState(u8 *param_1,u32 param_2); extern void sub_8046F84(s32 itemFlag); extern bool8 sub_8083C50(void); extern void sub_8068FE0(Entity *, u32, Entity *r2); @@ -400,7 +397,7 @@ extern const u8 *const gUnknown_80F89B4; extern const u8 *const gUnknown_80F89D4; extern const u8 *const gUnknown_80F89D8; -extern const s16 gUnknown_80F6850[]; +extern const s16 gUnknown_80F6850[4]; extern const s16 gDungeonMusic[]; extern OpenedFile *gDungeonNameBannerPalette; @@ -433,8 +430,8 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) dungeonPtr[i] = 0; } - gUnknown_203B410 = 0; // Needed to match - gUnknown_203B410 = 100; + gUnknown_203B410.x = 0; // Needed to match + gUnknown_203B410.x = 100; if (!r6) { gDungeon->unk644.unk34 = r8->unkF; @@ -565,7 +562,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) rnd = DungeonRandInt(4); gDungeon->unk37FD = 0; gDungeon->deoxysDefeat = FALSE; - gDungeon->unk3800 = gUnknown_80F6850[rnd]; + gDungeon->deoxysForm = gUnknown_80F6850[rnd]; gDungeon->unk37FF = 0; gDungeon->unk644.unk31 = 0; } @@ -824,7 +821,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) gUnknown_203B40C = 0; if (gDungeon->unk3 != 0) { - WriteDungeonState(gSerializedData_203B41C, 0x4800); + SaveDungeonState(gSerializedData_203B41C, 0x4800); r8->unk7C = 3; r8->unk80 = gDungeon->unk644.dungeonLocation; check = FALSE; @@ -834,7 +831,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) s16 var; if (gDungeon->unk6 != 0) { - WriteDungeonState(gSerializedData_203B41C, 0x4800); + SaveDungeonState(gSerializedData_203B41C, 0x4800); } else { sub_8046F84(ITEM_FLAG_IN_SHOP); diff --git a/src/code_8048480.c b/src/code_8048480.c index 50a17f16f..0ebdbd508 100644 --- a/src/code_8048480.c +++ b/src/code_8048480.c @@ -1,5 +1,6 @@ #include "global.h" #include "code_803E668.h" +#include "code_8041AD0.h" #include "code_8045A00.h" #include "dungeon_message.h" #include "code_8077274_1.h" @@ -85,7 +86,6 @@ extern u8 *gUnknown_80F9BD8[]; #include "data/code_8048480.h" -extern void sub_80421C0(Entity *r0, u16 r1); extern void sub_8078B5C(Entity *, Entity *, u32, u32, u32); extern u8 sub_806A538(s32); extern void sub_8051E7C(Entity *pokemon); diff --git a/src/code_805D8C8.c b/src/code_805D8C8.c index f1fe58cc7..c81938b65 100644 --- a/src/code_805D8C8.c +++ b/src/code_805D8C8.c @@ -2,6 +2,7 @@ #include "code_805D8C8.h" #include "structs/str_dungeon.h" #include "dungeon_util.h" +#include "pokemon.h" // monster_sbin.s extern const struct FileArchive gMonsterFileArchive; @@ -35,14 +36,14 @@ void sub_80687AC(void) OpenedFile *GetSpriteData(s16 species) { - s32 species32 = species; + s32 species32 = SpeciesId(species); return gDungeon->sprites[species32]; } -static void EnsureSpriteLoaded(s32 _id) +static void EnsureSpriteLoaded(s32 _id) // TODO: Should this param be s16? If so, the castform part of LoadPokemonSprite is preventing us { - u8 name [12]; - s32 id = (s16)_id; + u8 name[12]; + s32 id = SpeciesId(_id); if (gDungeon->sprites[id] == NULL) { sprintf(name, gUnknown_8106EA0, id); @@ -52,20 +53,35 @@ static void EnsureSpriteLoaded(s32 _id) void LoadPokemonSprite(s16 id, bool32 a1) { - s32 id_s32 = id; + s32 id_s32 = SpeciesId(id); bool8 param_2 = a1; - if (!param_2 && - (id_s32 == MONSTER_DEOXYS_NORMAL || id_s32 == MONSTER_DEOXYS_ATTACK || id_s32 == MONSTER_DEOXYS_DEFENSE || id_s32 == MONSTER_DEOXYS_SPEED)) { + if (!param_2 && (id_s32 == MONSTER_DEOXYS_NORMAL || id_s32 == MONSTER_DEOXYS_ATTACK || id_s32 == MONSTER_DEOXYS_DEFENSE || id_s32 == MONSTER_DEOXYS_SPEED)) { EnsureDeoxysLoaded(); } else { EnsureSpriteLoaded(id_s32); - // >= MONSTER_CASTFORM && <= MONSTER_CASTFORM_RAINY + if ((u16)(id_s32 - MONSTER_CASTFORM) < 4) EnsureCastformLoaded(); } } +/*void LoadPokemonSprite(s16 id, bool8 a1) +{ + s32 id_s32 = SpeciesId(id); + + if (!a1 && (id_s32 == MONSTER_DEOXYS_NORMAL || id_s32 == MONSTER_DEOXYS_ATTACK || id_s32 == MONSTER_DEOXYS_DEFENSE || id_s32 == MONSTER_DEOXYS_SPEED)) { + EnsureDeoxysLoaded(); + } + else { + EnsureSpriteLoaded(id); + + // TODO: >= MONSTER_CASTFORM && <= MONSTER_CASTFORM_RAINY + if (id_s32 == MONSTER_CASTFORM || id_s32 == MONSTER_CASTFORM_SNOWY || id_s32 == MONSTER_CASTFORM_SUNNY || id_s32 == MONSTER_CASTFORM_RAINY) + //if ((u16)(id_s32 - MONSTER_CASTFORM) < 4) + EnsureCastformLoaded(); + } +}*/ static void EnsureCastformLoaded(void) { @@ -77,7 +93,7 @@ static void EnsureCastformLoaded(void) static void EnsureDeoxysLoaded(void) { - EnsureSpriteLoaded(gDungeon->unk3800); + EnsureSpriteLoaded(gDungeon->deoxysForm); } void CloseAllSpriteFiles(void) diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index ee7b804a5..bc9c07e90 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -79,7 +79,6 @@ void sub_805E738(Entity *a0); void sub_803E708(s32 a0, s32 a1); void sub_8040A78(void); void sub_805E804(void); -void sub_8049ED4(void); void sub_8064BE0(void); void sub_8075680(u32); void sub_8094C88(void); diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 20741ab54..3b228e59f 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -23,12 +23,13 @@ struct unkStruct_80F520C { - u8 unk0; - u8 unk1; - s16 unk2; + u8 unk0; // types0 + u8 unk1; // Most likely just padding and should be removed + s16 unk2; // monsterID }; -extern struct unkStruct_80F520C gUnknown_80F520C[]; +// Castform Forecast ability data +extern struct unkStruct_80F520C gUnknown_80F520C[WEATHER_RANDOM]; extern u8 gUnknown_80F51E4[]; extern u8 *gUnknown_80FCC7C[]; @@ -93,17 +94,15 @@ void TriggerWeatherAbilities(void) } } -s32 sub_8069F54(Entity *pokemon, s16 param_2) +s32 GetMonsterApparentID(Entity *pokemon, s16 id) { - if ((((param_2 * 0x10000) + 0xfe880000U) >> 0x10) < 4) { - if (HasAbility(pokemon, ABILITY_FORECAST)) { - return gUnknown_80F520C[GetApparentWeather(pokemon)].unk2; + if (id == MONSTER_CASTFORM || id == MONSTER_CASTFORM_SNOWY || id == MONSTER_CASTFORM_SUNNY || id == MONSTER_CASTFORM_RAINY) { + if (HasAbility(pokemon, ABILITY_FORECAST)) + return gUnknown_80F520C[GetApparentWeather(pokemon)].unk2; + return MONSTER_CASTFORM; } - else { - return 0x178; - } - } - return param_2; + + return id; } static inline u8 sub_8069F9C_sub(Entity *pokemon) diff --git a/src/code_806CD90.c b/src/code_806CD90.c index a0414a9c0..c0cea7dca 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -35,6 +35,7 @@ #include "code_8041AD0.h" #include "type_chart.h" #include "dungeon_message.h" +#include "dungeon_map_access.h" extern u8 gUnknown_202F221; @@ -288,7 +289,6 @@ extern bool8 DoEnemiesEvolveWhenKOed(u8 dungeon); extern bool8 sub_806FA5C(Entity *, Entity *, struct unkStruct_8069D4C *); extern void EntityUpdateStatusSprites(Entity *); extern bool8 sub_8045888(Entity *r0); -extern void sub_8049ED4(void); extern const s32 gUnknown_8106A4C; extern const s16 gUnknown_80F4E10; @@ -473,11 +473,11 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * if (r9) { EntityInfo *targetInfo = GetEntInfo(target); if (targetInfo->linked.linkedStatus == STATUS_DESTINY_BOND) { - Entity *destBondTarget = gDungeon->allPokemon[targetInfo->linked.unkD8]; + Entity *destBondTarget = gDungeon->allPokemon[targetInfo->linked.unk8]; if (destBondTarget == NULL) { targetInfo->linked.linkedStatus = 0; } - else if (GetEntInfo(destBondTarget)->unk98 != targetInfo->linked.unkD4) { + else if (GetEntInfo(destBondTarget)->unk98 != targetInfo->linked.unk4) { targetInfo->linked.linkedStatus = 0; } else { diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 93d57df0a..c84022775 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -4,6 +4,7 @@ #include "dungeon_pokemon_attributes.h" #include "dungeon_leader.h" #include "dungeon_message.h" +#include "code_8041AD0.h" #include "code_8045A00.h" #include "code_8077274_1.h" #include "constants/dungeon.h" @@ -50,7 +51,6 @@ extern u8 *gUnknown_80FF730[]; extern u8 gUnknown_8107010[8]; extern u8 *gUnknown_8107018[3]; -extern void sub_80421C0(Entity *pokemon, u16 r1); void sub_8083D58(void); void sub_8072778(Entity *, Entity *, u8, u8); bool8 sub_80725A4(Entity *, Entity *); diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 8d5df8ffc..a924f102d 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -529,7 +529,7 @@ void sub_8074094(Entity *entity) if (entityInfo->linked.linkedStatus == STATUS_LEECH_SEED) { if (entityInfo->linked.linkedStatusDamageCountdown == 0 || --entityInfo->linked.linkedStatusDamageCountdown == 0) { s32 hp = gUnknown_80F4FB4; - Entity *target = gDungeon->allPokemon[entityInfo->linked.unkD8]; + Entity *target = gDungeon->allPokemon[entityInfo->linked.unk8]; entityInfo->linked.linkedStatusDamageCountdown = gUnknown_80F4F40; if (target == NULL) { @@ -537,7 +537,7 @@ void sub_8074094(Entity *entity) } else { EntityInfo *targetInfo = GetEntInfo(target); - if (targetInfo->unk98 != entityInfo->linked.unkD4) { + if (targetInfo->unk98 != entityInfo->linked.unk4) { entityInfo->linked.linkedStatus = 0; } else { diff --git a/src/code_8075708.c b/src/code_8075708.c index c4afc842b..6f4d959e3 100644 --- a/src/code_8075708.c +++ b/src/code_8075708.c @@ -17,7 +17,6 @@ #include "position_util.h" #include "trap.h" -extern void sub_8049ED4(void); extern void sub_8073D14(Entity *); void sub_8075680(void) diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index 4c42d26ac..502961be6 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -22,6 +22,7 @@ #include "status_checks_1.h" #include "structs/dungeon_entity.h" #include "structs/str_dungeon.h" +#include "dungeon_map_access.h" extern u8 *gUnknown_80FA8BC[]; extern u8 *gUnknown_80FA824[]; @@ -165,12 +166,11 @@ extern s16 gUnknown_80F4F1C[]; extern u8 *gUnknown_80FBF68[]; extern u8 *gUnknown_80FBF84[]; -extern void sub_8049ED4(); extern void sub_8040A84(); extern void EntityUpdateStatusSprites(Entity *); extern void sub_8042A74(Entity *r0); extern void sub_807EC28(bool8); -extern s32 sub_8069F54(Entity *param_1, s16 param_2); +extern s32 GetMonsterApparentID(Entity *param_1, s16 param_2); extern void sub_806A898(Entity *, u32, u32); extern void HealTargetHP(Entity *pokemon, Entity *r1, s16, s16, u32); extern void DealDamageToEntity(Entity *, s16, u32, u32); @@ -260,7 +260,7 @@ void TransformStatusTarget(Entity * pokemon, Entity * target) for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { species = ExtractSpeciesIndex(&auStack544[DungeonRandInt(iVar5) * 2]); - apparentID_s16 = sub_8069F54(target, species); + apparentID_s16 = GetMonsterApparentID(target, species); apparentID = apparentID_s16; if (apparentID != entityInfo->apparentID && sub_806AA0C(apparentID, 1)) { @@ -1427,7 +1427,7 @@ void SendLinkedEndMessage(Entity * pokemon, Entity * target) break; } entityInfo->linked.linkedStatus = STATUS_NONE; - entityInfo->linked.unkD8 = 0xff; + entityInfo->linked.unk8 = 0xff; EntityUpdateStatusSprites(target); } } @@ -1486,7 +1486,7 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target) TryDisplayDungeonLoggableMessage(target,*gUnknown_80FABBC); break; case STATUS_TRANSFORMED: - entityInfo->apparentID = sub_8069F54(target, entityInfo->id); + entityInfo->apparentID = GetMonsterApparentID(target, entityInfo->id); target->axObj.spriteFile = GetSpriteData(entityInfo->apparentID); uVar3 = sub_806CEBC(target); sub_806CCB4(target,uVar3); diff --git a/src/code_807CD9C.c b/src/code_807CD9C.c index 99f295bbd..b6e987989 100644 --- a/src/code_807CD9C.c +++ b/src/code_807CD9C.c @@ -18,6 +18,7 @@ #include "move_effects_target.h" #include "moves.h" #include "move_util.h" +#include "code_8041AD0.h" extern u32 gUnknown_202EDCC; @@ -38,7 +39,6 @@ bool8 ExposeTrap(s32 x, s32 y); void sub_8040A84(); void sub_8049ED4(); void sub_806A5B8(Entity *); -void sub_80421C0(Entity *, u32); u8 sub_8045888(Entity *); void sub_807EC28(u32); void sub_80694C0(Entity *, s32, s32, s32); diff --git a/src/code_8083288.c b/src/code_8083288.c deleted file mode 100644 index 28df14231..000000000 --- a/src/code_8083288.c +++ /dev/null @@ -1,548 +0,0 @@ -#include "global.h" -#include "constants/dungeon_action.h" -#include "code_805D8C8.h" -#include "code_806CD90.h" -#include "code_8092334.h" -#include "dungeon_map_access.h" -#include "dungeon_util.h" -#include "structs/dungeon_entity.h" -#include "structs/str_dungeon.h" -#include "structs/str_position.h" - - -u16 ReadU16(DataSerializer *param_1); -s16 ReadS16(DataSerializer *param_1); -u8 ReadU8(DataSerializer *param_1); -u32 sub_80831A0(DataSerializer *param_1); -bool8 ReadBool8(DataSerializer *param_1); -void ReadBytes(DataSerializer *param_1, void *param_2, s32 size); -void ReadPosition8(DataSerializer *param_1,Position *param_2); - -void AddPokemonDungeonSprite(u32, s16, Position *, u32); - -void sub_8082B40(void) -{ - EntityInfo *info; - Entity *entity; - int index; - Position pos; - - for(index = 0; index < DUNGEON_MAX_POKEMON; index++) - { - entity = gDungeon->allPokemon[index]; - if (EntityExists(entity)) { - info = GetEntInfo(entity); - entity->axObj.spriteFile = GetSpriteData(info->apparentID); - sub_806CCB4(entity,sub_806CEBC(entity)); - pos = entity->pos; - AddPokemonDungeonSprite(info->unk98,info->apparentID,&pos,3); - entity->room = GetTileSafe(entity->pos.x,entity->pos.y)->room; - } - } -} - - - - - - - - -// Seems to be a new file (regarding serialization) starting here - - - - - - - - -s16 sub_8082BC0(DataSerializer *param_1) -{ - s16 temp[2]; - - temp[0] = 0; - - ReadBytes(param_1, temp, 2); - return temp[0]; -} - -u8 sub_8082BE0(DataSerializer *param_1) -{ - u8 temp[4]; - - temp[0] = 0; - - ReadBytes(param_1, temp, 1); - return temp[0]; -} - -u8 sub_8082BFC(DataSerializer *param_1) -{ - u8 temp[4]; - - temp[0] = 0; - - ReadBytes(param_1, temp, 1); - return temp[0]; -} - -u8 sub_8082C18(DataSerializer *param_1) -{ - u8 temp[4]; - - temp[0] = 0; - - ReadBytes(param_1, temp, 1); - return temp[0]; -} - -u8 sub_8082C34(DataSerializer *param_1) -{ - u8 temp[4]; - - temp[0] = 0; - - ReadBytes(param_1, temp, 1); - return temp[0]; -} - -u8 sub_8082C50(DataSerializer *param_1) -{ - u8 temp[4]; - - temp[0] = 0; - - ReadBytes(param_1, temp, 1); - return temp[0]; -} - -// Read some enum ? -u32 sub_8082C6C(DataSerializer *param_1) -{ - u32 temp; - - temp = 0; - - ReadBytes(param_1, &temp, 4); - return temp; -} - -u8 sub_8082C84(DataSerializer *param_1) -{ - u8 temp[4]; - - temp[0] = 0; - - ReadBytes(param_1, temp, 1); - return temp[0]; -} - -u8 sub_8082CA0(DataSerializer *param_1) -{ - u8 temp[4]; - - temp[0] = 0; - - ReadBytes(param_1, temp, 1); - return temp[0]; -} - -void ReadActionContainer(DataSerializer *param_1, ActionContainer *action) -{ - action->action = ACTION_NOTHING; - ReadBytes(param_1, &action->direction, 1); - action->unk3 = 7; - ReadPosition8(param_1, &action->itemTargetPosition); -} - -void ReadAITarget(DataSerializer *param_1, AITarget *aitarget) -{ - ReadBytes(param_1, &aitarget->aiObjective, 1); - aitarget->aiNotNextToTarget = ReadBool8(param_1); - aitarget->aiTargetingEnemy = ReadBool8(param_1); - aitarget->aiTurningAround = ReadBool8(param_1); - aitarget->aiTargetSpawnGenID = ReadU16(param_1); - aitarget->aiTarget = NULL; - aitarget->unkC = 0; - ReadPosition8(param_1, &aitarget->aiTargetPos); -} - -void Read3Bytes(DataSerializer *param_1, u8 *dst) -{ - ReadBytes(param_1, dst, 3); -} - -void ReadSleep(DataSerializer *param_1, Sleep *sleep) -{ - ReadBytes(param_1, &sleep->sleep, 1); - sleep->sleepTurns = ReadU8(param_1); -} - -void ReadNonVolatile(DataSerializer *param_1, NonVolatile *nonvolatile) -{ - ReadBytes(param_1, &nonvolatile->nonVolatileStatus, 1); - nonvolatile->nonVolatileStatusTurns = ReadU8(param_1); - nonvolatile->nonVolatileStatusDamageCountdown = ReadU8(param_1); - nonvolatile->unk4 = ReadU8(param_1); -} - -void ReadImmobilize(DataSerializer *param_1, Immobilize *immobilize) -{ - ReadBytes(param_1, &immobilize->immobilizeStatus, 1); - immobilize->immobilizeStatusTurns = ReadU8(param_1); - immobilize->immobilizeStatusDamageCountdown = ReadU8(param_1); - immobilize->unk4 = sub_80831A0(param_1); -} - -void ReadVolatileStatus(DataSerializer *param_1, Volatile *volatileStatus) -{ - ReadBytes(param_1, &volatileStatus->volatileStatus, 1); - volatileStatus->volatileStatusTurns = ReadU8(param_1); -} - -void ReadCharging(DataSerializer *param_1, Charging *charging) -{ - ReadBytes(param_1, &charging->chargingStatus, 1); - charging->chargingStatusTurns = ReadU8(param_1); - charging->chargingStatusMoveIndex = ReadU8(param_1); -} - -void ReadProtection(DataSerializer *param_1, Protection *protect) -{ - ReadBytes(param_1, &protect->protectionStatus, 1); - protect->protectionStatusTurns = ReadU8(param_1); -} - -void ReadWaiting(DataSerializer *param_1, Waiting *waiting) -{ - ReadBytes(param_1, &waiting->waitingStatus, 1); - waiting->enemyDecoy = ReadBool8(param_1); - waiting->unkCA = ReadBool8(param_1); - waiting->waitingStatusTurns = ReadU8(param_1); - waiting->curseDamageCountdown = ReadU8(param_1); -} - -void ReadLinked(DataSerializer *param_1, Linked *linked) -{ - ReadBytes(param_1, &linked->linkedStatus, 1); - linked->unkD4 = sub_80831A0(param_1); - linked->unkD8 = ReadU8(param_1); - linked->linkedStatusTurns = ReadU8(param_1); - linked->linkedStatusDamageCountdown = ReadU8(param_1); -} - -void ReadMoveStatus(DataSerializer *param_1, MoveStatus *moveStatus) -{ - ReadBytes(param_1, &moveStatus->moveStatus, 1); - moveStatus->moveStatusTurns = ReadU8(param_1); -} - -void sub_8082E88(DataSerializer *param_1, void *dst, s32 param_3) -{ - ReadBytes(param_1, dst, 1); -} - -void ReadTransformStatus(DataSerializer *param_1, TransformStatus *transform) -{ - ReadBytes(param_1, &transform->transformStatus, 1); - transform->transformStatusTurns = ReadU8(param_1); -} - -void ReadEyesightStatus(DataSerializer *param_1, EyesightStatus *eyesight) -{ - ReadBytes(param_1, &eyesight->eyesightStatus, 1); - eyesight->eyesightStatusTurns = ReadU8(param_1); -} - -void ReadMuzzled(DataSerializer *param_1, Muzzled *muzzle) -{ - ReadBytes(param_1, &muzzle->muzzled, 1); - muzzle->muzzledTurns = ReadU8(param_1); -} - -void RestoreDungeonPokemonMove(DataSerializer *param_1, Move *move) -{ - move->moveFlags = ReadU8(param_1); - move->moveFlags2 = ReadU8(param_1); - ReadBytes(param_1, &move->id, 2); - move->PP = ReadU8(param_1); - move->ginseng = ReadU8(param_1); -} - -void ReadMoves(DataSerializer *param_1, Moves *moves) -{ - s32 index; - Move *move; - - for (index = 0; index < MAX_MON_MOVES; index++) { - move = &moves->moves[index]; - RestoreDungeonPokemonMove(param_1, move); - } - - moves->struggleMoveFlags = ReadU8(param_1); -} - -// TODO: R1 struct -void sub_8082F48(DataSerializer *param_1, u16 *r1) -{ - r1[0] = ReadS16(param_1); - r1[1] = ReadS16(param_1); -} - -void ReadJoinedAt(DataSerializer *param_1, JoinedAt *joined) -{ - joined->joinedAt = ReadU8(param_1); - joined->unk1 = ReadU8(param_1); -} - -void ReadHiddenPower(DataSerializer *param_1, HiddenPower *hidden) -{ - hidden->hiddenPowerBasePower = ReadS16(param_1); - hidden->hiddenPowerType = sub_8082BFC(param_1); -} - -void InitByteWriter(DataSerializer *param_1, u8 *dst, u32 capacity) -{ - param_1->stream = dst; - param_1->count = 0; - param_1->end = dst + capacity; -} - -void WriteBytes(DataSerializer *param_1, void *src, s32 numBytes) -{ - u8 *curByte; - - curByte = src; - - while (numBytes != 0) { - *param_1->stream = *curByte; - param_1->stream++; - curByte++; - numBytes--; - param_1->count++; - } -} - -void InitByteReader(DataSerializer *param_1, u8 *src, u32 length) -{ - param_1->stream = src; - param_1->count = 0; - param_1->end = src + length; -} - -void ReadBytes(DataSerializer *param_1, void *dst, s32 numBytes) -{ - u8 *curByte; - - curByte = dst; - - while (numBytes != 0) { - *curByte = *param_1->stream; - param_1->stream++; - curByte++; - numBytes--; - param_1->count++; - } -} - -// Finished reading/writing dungeon -void nullsub_98(DataSerializer *param_1) -{ -} - -void Write8Bytes(DataSerializer *param_1, u8 *src) -{ - WriteBytes(param_1, src, 8); -} - -void sub_8083018(DataSerializer *param_1) -{ - u8 auStack_10 [12]; - - ReadBytes(param_1, auStack_10, 8); - auStack_10[8] = 0; -} - -void WriteU16(DataSerializer *param_1, u16 value) -{ - u16 uStack_8; - - uStack_8 = value; - - WriteBytes(param_1, &uStack_8, 2); -} - -void WriteS16(DataSerializer *param_1, u32 value) -{ - u16 uStack_8; - - uStack_8 = value; - - WriteBytes(param_1, &uStack_8, 2); -} - -void WriteU8(DataSerializer *param_1, u32 value) -{ - u8 uStack_8; - - uStack_8 = value; - - WriteBytes(param_1, &uStack_8, 1); -} - -void WriteU32(DataSerializer *param_1, u32 value) -{ - u32 uStack_8; - - uStack_8 = value; - - WriteBytes(param_1, &uStack_8, 4); -} - -UNUSED void sub_808308C(DataSerializer *param_1, u32 value) -{ - u32 uStack_8; - - uStack_8 = value; - - WriteBytes(param_1, &uStack_8, 4); -} - -void WriteS32(DataSerializer *param_1, u32 value) -{ - u32 uStack_8; - - uStack_8 = value; - - WriteBytes(param_1, &uStack_8, 4); -} - -void WriteBool8(DataSerializer *param_1, bool8 value) -{ - u8 local_8; - - local_8 = value ? -1 : 0; - - WriteBytes(param_1, &local_8, 1); -} - -void WritePosition8(DataSerializer *param_1, Position *param_2) -{ - WriteBytes(param_1, ¶m_2->x, 1); - WriteBytes(param_1, ¶m_2->y, 1); -} - -// TODO: param_2 struct -void sub_80830F8(DataSerializer *param_1, u32 *param_2) -{ - WriteBytes(param_1, ¶m_2[0], 1); - WriteBytes(param_1, ¶m_2[1], 1); - WriteBytes(param_1, ¶m_2[2], 1); - WriteBytes(param_1, ¶m_2[3], 1); -} - -// TODO: param_2 struct -void sub_808312C(DataSerializer *param_1, u16 *param_2) -{ - WriteBytes(param_1, ¶m_2[0], 1); - WriteBytes(param_1, ¶m_2[1], 1); -} - -void xxx_WriteBytes(DataSerializer *param_1, void *src, u32 numBytes) -{ - WriteBytes(param_1, src, numBytes); -} - -u16 ReadU16(DataSerializer *param_1) -{ - u16 local_8; - - ReadBytes(param_1, &local_8, 2); - return local_8; -} - -s16 ReadS16(DataSerializer *param_1) -{ - s16 local_8; - - ReadBytes(param_1, &local_8, 2); - return local_8; -} - -u8 ReadU8(DataSerializer *param_1) -{ - u8 local_8; - - ReadBytes(param_1, &local_8, 1); - return local_8; -} - -// ReadS32 or ReadU32 ? -u32 sub_80831A0(DataSerializer *param_1) -{ - u32 local_8; - - ReadBytes(param_1, &local_8, 4); - return local_8; -} - -UNUSED u32 sub_80831B4(DataSerializer *param_1) -{ - u32 local_8; - - ReadBytes(param_1, &local_8, 4); - return local_8; -} - -// ? -u32 sub_80831C8(DataSerializer *param_1) -{ - u32 local_8; - - ReadBytes(param_1, &local_8, 4); - return local_8; -} - -bool8 ReadBool8(DataSerializer *param_1) -{ - u8 local_8; - - ReadBytes(param_1, &local_8, 1); - return local_8 != 0; -} - -void ReadPosition8(DataSerializer *param_1, Position *param_2) -{ - param_2->x = 0; - param_2->y = 0; - ReadBytes(param_1, ¶m_2->x, 1); - ReadBytes(param_1, ¶m_2->y, 1); -} - -// TODO: param_2 struct -void sub_8083220(DataSerializer *param_1, u32 *param_2) -{ - param_2[0] = 0; - param_2[1] = 0; - param_2[2] = 0; - param_2[3] = 0; - ReadBytes(param_1, ¶m_2[0], 1); - ReadBytes(param_1, ¶m_2[1], 1); - ReadBytes(param_1, ¶m_2[2], 1); - ReadBytes(param_1, ¶m_2[3], 1); -} - -// TODO: param_2 struct -void sub_8083260(DataSerializer *param_1, u16 *param_2) -{ - param_2[0] = 0; - param_2[1] = 0; - ReadBytes(param_1, ¶m_2[0], 1); - ReadBytes(param_1, ¶m_2[1], 1); -} - -void xxx_ReadBytes(DataSerializer *r0, u8 *dst, u32 numBytes) -{ - ReadBytes(r0, dst, numBytes); -} \ No newline at end of file diff --git a/src/data/dungeon_serializer.h b/src/data/dungeon_serializer.h new file mode 100644 index 000000000..e7d1d0fda --- /dev/null +++ b/src/data/dungeon_serializer.h @@ -0,0 +1,10 @@ +// The code assumes these two strings are the same size: + +ALIGNED(4) static const u8 sYayoiSan[] = _("ă‚„ă‚ă„{INVALID_SEQUENCE_976C}"); // 0x82, 0xE2, 0x82, 0xE6, 0x82, 0xA2, 0x97, 0x6C, 0x00 +ALIGNED(4) static const u8 sMisakiSan[] = _("ăżă•ăŤ{INVALID_SEQUENCE_976C}"); // 0x82, 0xDD, 0x82, 0xB3, 0x82, 0xAB, 0x97, 0x6C, 0x00 + +// -1 because of the trailing "\0" +#define BLAME_SIZE (sizeof(sYayoiSan) - 1) + +// Should be aligned to 4 bytes. Default blame size is 8, stack size 12. If blame size was 11, stack size should still be 12 +#define BLAME_STACK_SIZE (BLAME_SIZE - (BLAME_SIZE % 4) + 4) \ No newline at end of file diff --git a/src/dungeon_cutscenes.c b/src/dungeon_cutscenes.c index 71e761cba..65b406f98 100644 --- a/src/dungeon_cutscenes.c +++ b/src/dungeon_cutscenes.c @@ -3,6 +3,7 @@ #include "code_800E9A8.h" #include "code_803E46C.h" #include "code_803E668.h" +#include "code_8041AD0.h" #include "code_804267C.h" #include "code_8045A00.h" #include "code_80861A8.h" @@ -377,7 +378,6 @@ extern void DeoxysScreenFlash(void); extern void sub_8085EB0(void); extern void sub_8049884(void); extern void sub_8049B8C(void); -extern void sub_8049ED4(void); extern void sub_8040A84(void); extern void sub_8086A54(Entity *); extern void sub_806BFC0(EntityInfo *, u32); @@ -386,7 +386,6 @@ extern void sub_8041888(u32); extern u32 sub_80861F8(u32, Entity *, u32); extern u8 sub_80860A8(u32); extern void sub_8052D44(s16 *, Entity *, Entity *); -extern void sub_80421C0(Entity *, u32); extern void sub_80464C8(Entity *, Position *, Item *); extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32); extern u32 sub_8085EC8(u32, u32, u32, Position *, u32); diff --git a/src/dungeon_items.c b/src/dungeon_items.c index 27a7cb2bb..b89e71097 100644 --- a/src/dungeon_items.c +++ b/src/dungeon_items.c @@ -2,6 +2,7 @@ #include "dungeon_items.h" #include "code_803E668.h" +#include "code_8041AD0.h" #include "code_8045A00.h" #include "code_80861A8.h" #include "code_80869E4.h" @@ -20,7 +21,6 @@ extern u8 *gUnknown_81053A8[]; extern u8 *gUnknown_8105434[]; extern void sub_80416E0(Position32 *r0, u32, bool8); -extern void sub_80421C0(Entity *, u32); extern void sub_80855E4(void *); extern void PlaySoundEffect(u32); extern void sub_804178C(u32); diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 59976e5db..89e241c0c 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -37,6 +37,7 @@ #include "code_8045A00.h" #include "code_803E668.h" #include "code_803E46C.h" +#include "code_8041AD0.h" extern void sub_80429C8(Entity *r0); extern u8 sub_803F428(Position *); @@ -74,7 +75,6 @@ extern void sub_8042930(Entity *r0); extern void sub_8041B48(Entity *pokemon); extern void sub_8041BA8(Entity *pokemon); extern void sub_8042950(Entity *r0); -extern void sub_80421C0(Entity *pokemon, u16 r1); extern bool8 sub_8057634(Entity *pokemon, Entity *target, Move *move, s32 param_4); extern bool8 YawnMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); extern bool8 NightmareMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); diff --git a/src/dungeon_serializer.c b/src/dungeon_serializer.c new file mode 100644 index 000000000..c83df6003 --- /dev/null +++ b/src/dungeon_serializer.c @@ -0,0 +1,1816 @@ +#include "global.h" +#include "globaldata.h" +#include "code_800F958.h" +#include "code_8045A00.h" +#include "code_805D8C8.h" +#include "code_806CD90.h" +#include "dungeon_map_access.h" +#include "dungeon_pokemon_attributes.h" +#include "dungeon_serializer.h" +#include "dungeon_util.h" +#include "structs/str_dungeon.h" + +extern u8 gUnknown_202EE70[MAX_TEAM_BODY_SIZE]; +extern u8 gUnknown_202EE76[DUNGEON_MAX_WILD_POKEMON_BODY_SIZE]; + +extern Position gUnknown_203B410; +extern Entity *gLeaderPointer; // 203B450 + +#include "data/dungeon_serializer.h" + +static void InitReader(DataSerializer *seri, u8 *buffer, u32 bufLen); +static void InitWriter(DataSerializer *seri, u8 *buffer, u32 bufLen); +static void FinishSerializer(DataSerializer *seri); + +static u8 ReadAbility(DataSerializer *seri); +static void ReadActionContainer(DataSerializer *seri, ActionContainer *dst); +static void ReadAITarget(DataSerializer *seri, AITarget *dst); +static void ReadBelly(DataSerializer *seri, FixedPoint *dst); +static void ReadBlame(DataSerializer *seri, const u8 *expected); +static bool8 ReadBool8(DataSerializer *seri); +static void ReadBytes(DataSerializer *seri, void *dst, s32 numBytes); +static void ReadCharging(DataSerializer *seri, Charging *dst); +static u8 ReadClientType(DataSerializer *seri); +static void ReadDungeonFloor(DataSerializer *seri); +static void ReadDungeonItems(DataSerializer *seri); +static void ReadDungeonMonsters(DataSerializer *seri); +static void ReadDungeonMusic(DataSerializer *seri); +static void ReadDungeonTraps(DataSerializer *seri); +static void ReadDungeonUnk644(DataSerializer *seri); +static void ReadDungeonUnkE240(DataSerializer *seri, unkDungeonE240 *dst); +static void ReadDungeonUnkE260(DataSerializer *seri, unkDungeonE260 *dst); +static void ReadDungeonVisibility(DataSerializer *seri); +static void ReadEyesightStatus(DataSerializer *seri, EyesightStatus *dst); +static void ReadHiddenPower(DataSerializer *seri, HiddenPower *dst); +static void ReadImmobilize(DataSerializer *seri, Immobilize *dst); +static void ReadIQSkills(DataSerializer *seri, u8 *dst); +static void ReadItem(DataSerializer *seri, Item *dst); +static void ReadItemStatus(DataSerializer *seri, ItemStatus *dst); +static void ReadJoinedAt(DataSerializer *seri, JoinedAt *dst); +static void ReadLinked(DataSerializer *seri, Linked *dst); +static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index); +static s16 ReadMonsterID(DataSerializer *seri); +static u8 ReadMonsterUnk64(DataSerializer *seri); +static u8 ReadMonsterUnkFF(DataSerializer *seri); +static void ReadMoves(DataSerializer *seri, Moves *dst); +static void ReadMoveStatus(DataSerializer *seri, MoveStatus *dst); +static void ReadMuzzled(DataSerializer *seri, Muzzled *dst); +static void ReadNonVolatile(DataSerializer *seri, NonVolatile *dst); +static void ReadProtection(DataSerializer *seri, Protection *dst); +static s16 ReadS16(DataSerializer *seri); +static s32 ReadS32(DataSerializer *seri); +static void ReadSleep(DataSerializer *seri, Sleep *dst); +static void ReadSpeedCounters(DataSerializer *seri, u8 *dst, u32 numCounters); +static s32 ReadSpeedStage(DataSerializer *seri); +static u8 ReadTactic(DataSerializer *seri); +static u8 ReadTargetingDecoy(DataSerializer *seri); +static void ReadTile(DataSerializer *seri, Tile *dst); +static void ReadTilePos(DataSerializer *seri, Position *dst); +static void ReadTransformStatus(DataSerializer *seri, TransformStatus *dst); +static u8 ReadType(DataSerializer *seri); +static u16 ReadU16(DataSerializer *seri); +static u32 ReadU32(DataSerializer *seri); +static u8 ReadU8(DataSerializer *seri); +static void ReadVolatileStatus(DataSerializer *seri, Volatile *dst); +static void ReadWaiting(DataSerializer *seri, Waiting *dst); +static void ReadWeather(DataSerializer *seri, Weather *dst); + +static void WriteAbility(DataSerializer *seri, u8 value); +static void WriteActionContainer(DataSerializer *seri, ActionContainer *src); +static void WriteAITarget(DataSerializer *seri, AITarget* src); +static void WriteBelly(DataSerializer *seri, FixedPoint *src); +static void WriteBlame(DataSerializer *seri, const u8 *blame); +static void WriteBool8(DataSerializer *seri, bool8 value); +static void WriteBytes(DataSerializer *seri, void *src, s32 numBytes); +static void WriteCharging(DataSerializer *seri, Charging *src); +static void WriteClientType(DataSerializer *seri, u8 value); +static void WriteDungeonFloor(DataSerializer *seri); +static void WriteDungeonItems(DataSerializer *seri); +static void WriteDungeonMonsters(DataSerializer *seri); +static void WriteDungeonMusic(DataSerializer *seri); +static void WriteDungeonTraps(DataSerializer *seri); +static void WriteDungeonUnk644(DataSerializer *seri); +static void WriteDungeonUnkE240(DataSerializer *seri, unkDungeonE240 *src); +static void WriteDungeonUnkE260(DataSerializer *seri, unkDungeonE260 *src); +static void WriteDungeonVisibility(DataSerializer *seri); +static void WriteEyesightStatus(DataSerializer *seri, EyesightStatus *src); +static void WriteHiddenPower(DataSerializer *seri, HiddenPower *src); +static void WriteImmobilize(DataSerializer *seri, Immobilize *src); +static void WriteIQSkills(DataSerializer *seri, u8 *src); +static void WriteItem(DataSerializer *seri, Item *src); +static void WriteItemStatus(DataSerializer *seri, ItemStatus *src); +static void WriteJoinedAt(DataSerializer *seri, JoinedAt *src); +static void WriteLinked(DataSerializer *seri, Linked *src); +static void WriteMonster(DataSerializer *seri, Entity *src); +static void WriteMonsterID(DataSerializer *seri, s16 value); +static void WriteMonsterUnk64(DataSerializer *seri, u8 value); +static void WriteMonsterUnkFF(DataSerializer *seri, u8 value); +static void WriteMoves(DataSerializer *seri, Moves *src); +static void WriteMoveStatus(DataSerializer *seri, MoveStatus* src); +static void WriteMuzzled(DataSerializer *seri, Muzzled *src); +static void WriteNonVolatile(DataSerializer *seri, NonVolatile *src); +static void WriteProtection(DataSerializer *seri, Protection *src); +static void WriteTilePos(DataSerializer *seri, Position *src); +static void WriteS16(DataSerializer *seri, s16 value); +static void WriteS32(DataSerializer *seri, s32 value); +static void WriteSleep(DataSerializer *seri, Sleep* src); +static void WriteSpeedCounters(DataSerializer *seri, u8 *src, u32 numCounters); +static void WriteSpeedStage(DataSerializer *seri, s32 value); +static void WriteTactic(DataSerializer *seri, u8 value); +static void WriteTargetingDecoy(DataSerializer *seri, u8 value); +static void WriteTile(DataSerializer *seri, Tile *src); +static void WriteTransformStatus(DataSerializer *seri, TransformStatus *src); +static void WriteType(DataSerializer *seri, u8 value); +static void WriteU16(DataSerializer *seri, u16 value); +static void WriteU32(DataSerializer *seri, u32 value); +static void WriteU8(DataSerializer *seri, u8 value); +static void WriteVolatile(DataSerializer *seri, Volatile *src); +static void WriteWaiting(DataSerializer *seri, Waiting *src); +static void WriteWeather(DataSerializer *seri, Weather *src); + +static Entity* sub_80828E0(s16 id, s16 apparentID, s32 index); +static Entity* sub_8082A08(s16 id, s16 apparentID, s32 index); + +// These externs are from other files +extern u8 GetBodySize(s16 index); +extern Entity *sub_8045684(u8, Position *, u8); +extern void sub_80460F8(Position *, Item *, u32); + +void SaveDungeonState(u8 *buffer, u32 bufLen) +{ + DataSerializer seri; + + InitWriter(&seri, buffer, bufLen); + + seri.unkC = 0; + WriteBytes(&seri, &seri.unkC, 4); + + WriteDungeonUnk644(&seri); + WriteDungeonFloor(&seri); + WriteDungeonVisibility(&seri); + WriteDungeonMusic(&seri); + WriteDungeonItems(&seri); + WriteDungeonTraps(&seri); + WriteDungeonMonsters(&seri); + + WriteBlame(&seri, sYayoiSan); + FinishSerializer(&seri); +} + +static void WriteDungeonUnk644(DataSerializer *seri) +{ + WriteBlame(seri, sMisakiSan); + WriteBytes(seri, &gDungeon->unk644, sizeof(unkDungeon644)); +} + +static void WriteDungeonItems(DataSerializer *seri) +{ + bool8 notEmpty; + Item *item; + Entity *entity; + s32 i; + u8 emptyItem[5]; + + for (i = 0; i < 5; i++) + emptyItem[i] = 0; + + WriteBlame(seri, sMisakiSan); + + for (i = 0; i < DUNGEON_MAX_ITEMS; i++) { + entity = gDungeon->items[i]; + notEmpty = FALSE; + + if (entity != NULL && GetEntityType(entity) == ENTITY_ITEM) { + item = GetItemData(entity); + WriteItem(seri, item); // 3 bytes + WriteBytes(seri, &entity->pos.x, 1); // 1 byte + WriteBytes(seri, &entity->pos.y, 1); // 1 byte + notEmpty = TRUE; + } + + if (!notEmpty) + WriteBytes(seri, emptyItem, 5); + } +} + +static void WriteDungeonTraps(DataSerializer *seri) +{ + bool8 notEmpty; + Trap *trap; + Entity *entity; + s32 i; + u8 emptyTrap[5]; + + for (i = 0; i < 5; i++) + emptyTrap[i] = -1; + + WriteBlame(seri, sMisakiSan); + + for (i = 0; i < DUNGEON_MAX_TRAPS; i++) { + entity = gDungeon->traps[i]; + notEmpty = FALSE; + + if (entity != NULL && GetEntityType(entity) == ENTITY_TRAP) { + trap = GetTrapData(entity); + WriteBytes(seri, &trap->id, 1); + WriteBytes(seri, &trap->unk1, 1); + WriteBytes(seri, &entity->isVisible, 1); + WriteBytes(seri, &entity->pos.x, 1); + WriteBytes(seri, &entity->pos.y, 1); + notEmpty = TRUE; + } + + if (!notEmpty) + WriteBytes(seri, emptyTrap, 5); + } +} + +static void WriteDungeonMonsters(DataSerializer *seri) +{ + s32 i; + + WriteBlame(seri, sMisakiSan); + WriteU32(seri, gDungeon->unk37F0); + WriteU32(seri, gDungeon->unk37F4); + WriteBool8(seri, gDungeon->plusIsActive[0]); + WriteBool8(seri, gDungeon->plusIsActive[1]); + WriteBool8(seri, gDungeon->minusIsActive[0]); + WriteBool8(seri, gDungeon->minusIsActive[1]); + WriteBool8(seri, gDungeon->decoyActive); + WriteBool8(seri, gDungeon->unk37FD); + WriteBool8(seri, gDungeon->deoxysDefeat); + WriteBool8(seri, gDungeon->unk37FF); + WriteU16(seri, gDungeon->deoxysForm); // Should be S16 + + for (i = 0; i < MAX_TEAM_MEMBERS; i++) + WriteMonster(seri, gDungeon->teamPokemon[i]); + + for (i = 0; i < DUNGEON_MAX_WILD_POKEMON; i++) + WriteMonster(seri, gDungeon->wildPokemon[i]); +} + +// TODO: Rewrite like ReadMonster +static void WriteMonster(DataSerializer *seri, Entity *src) +{ + Position *pos; + EntityInfo *info; + s32 counter; + EntityInfo info2; + u32 uStack_ac; + u32 uStack_a8; + HiddenPower *psStack_a4; + u8 *temp1; + u8 *temp2; + AITarget *temp3; + u8 *puStack_a0; + u32 *puStack_9c; + u32 *puStack_98; + u32 *puStack_94; + u8 *puStack_90; + Sleep *puStack_8c; + NonVolatile *puStack_88; + Immobilize *puStack_84; + Volatile *puStack_80; + Charging *puStack_7c; + Protection *puStack_78; + Waiting *puStack_74; + Linked *puStack_70; + MoveStatus *puStack_6c; + ItemStatus *puStack_68; + TransformStatus *puStack_64; + EyesightStatus *puStack_60; + Muzzled *pbStack_5c; + bool8 *pbStack_58; + bool8 *pbStack_54; + bool8 *pbStack_50; + bool8 *puStack_4c; + bool8 *pbStack_48; + bool8 *pbStack_44; + bool8 *pbStack_40; + bool8 *pbStack_3c; + u8 *puStack_38; + u8 *puStack_34; + bool8 *pbStack_30; + u8 *puStack_2c; + u8 *puStack_28; + u8 *puStack_24; + + + uStack_a8 = 0; + uStack_ac = 1; + WriteU8(seri,0xaa); + WriteU8(seri,0x55); + if (EntityExists(src)) { + info = GetEntInfo(src); + WriteBytes(seri,&uStack_ac,1); + WriteBytes(seri,&src->pos.x,1); + WriteBytes(seri,&src->pos.y,1); + WriteBytes(seri,&src->isVisible,1); + WriteBytes(seri,&src->spawnGenID,2); + } + else { + memset(&info2,0,sizeof(EntityInfo)); + info = &info2; + WriteBytes(seri,&uStack_a8,1); + WriteBytes(seri,&uStack_a8,1); + WriteBytes(seri,&uStack_a8,1); + WriteBytes(seri,&uStack_a8,1); + WriteBytes(seri,&uStack_a8,2); + } + WriteU16(seri,info->flags); + WriteMonsterID(seri,info->apparentID); + WriteMonsterID(seri,info->id); + WriteBool8(seri,info->isNotTeamMember); + WriteBool8(seri,info->isTeamLeader); + WriteU8(seri,info->shopkeeper); + WriteU8(seri,info->level); + WriteU8(seri,info->teamIndex); + WriteJoinedAt(seri,&info->joinedAt); + WriteS16(seri,info->IQ); + WriteS16(seri,info->HP); + WriteS16(seri,info->maxHPStat); + WriteS16(seri,info->originalHP); + WriteU8(seri,info->atk[0]); + WriteU8(seri,info->atk[1]); + WriteU8(seri,info->def[0]); + WriteU8(seri,info->def[1]); + WriteU32(seri,info->exp); + WriteS16(seri,info->offensiveStages[0]); + WriteS16(seri,info->offensiveStages[1]); + WriteS16(seri,info->defensiveStages[0]); + WriteS16(seri,info->defensiveStages[1]); + WriteS16(seri,info->hitChanceStages[0]); + WriteS16(seri,info->hitChanceStages[1]); + WriteS16(seri,info->flashFireBoost); + WriteS32(seri,info->offensiveMultipliers[0]); + WriteS32(seri,info->offensiveMultipliers[1]); + WriteS32(seri,info->defensiveMultipliers[0]); + WriteS32(seri,info->defensiveMultipliers[1]); + WriteActionContainer(seri,&info->action); + WriteType(seri,info->types[0]); + WriteType(seri,info->types[1]); + WriteAbility(seri,info->abilities[0]); + WriteAbility(seri,info->abilities[1]); + WriteItem(seri,&info->heldItem); + WriteMonsterUnk64(seri, info->unk64); + temp3 = &info->aiTarget; + temp2 = info->IQSkillMenuFlags; + temp1 = info->IQSkillFlags; + puStack_a0 = &info->tactic; + psStack_a4 = &info->hiddenPower; + puStack_9c = &info->unk98; + puStack_98 = &info->unk9C; + puStack_94 = &info->unkA0; + puStack_8c = &info->sleep; + puStack_88 = &info->nonVolatile; + puStack_84 = &info->immobilize; + puStack_80 = &info->volatileStatus; + puStack_7c = &info->charging; + puStack_78 = &info->protection; + puStack_74 = &info->waitingStruct; + puStack_70 = &info->linked; + puStack_6c = &info->moveStatus; + puStack_68 = &info->itemStatus; + puStack_64 = &info->transformStatus; + puStack_60 = &info->eyesightStatus; + pbStack_5c = &info->muzzled; + pbStack_58 = &info->powerEars; + pbStack_54 = &info->scanning; + pbStack_50 = &info->stairSpotter; + puStack_4c = &info->unkF3; + pbStack_48 = &info->grudge; + puStack_34 = &info->expMultiplier; + pbStack_44 = &info->exposed; + pbStack_40 = &info->isColorChanged; + pbStack_3c = &info->bossFlag; + puStack_38 = &info->terrifiedTurns; + pbStack_30 = &info->useHeldItem; + puStack_2c = &info->perishSongTurns; + puStack_28 = &info->unkFE; + puStack_24 = &info->unkFF; + puStack_90 = &info->clientType; + + pos = info->prevPos; + for (counter = 0; counter < NUM_PREV_POS; counter++) { + WriteTilePos(seri, pos); + pos++; + } + + WriteAITarget(seri,temp3); + WriteIQSkills(seri,temp2); + WriteIQSkills(seri,temp1); + WriteTactic(seri,*puStack_a0); + WriteHiddenPower(seri,psStack_a4); + WriteU32(seri,*puStack_9c); + WriteU32(seri,*puStack_98); + WriteU32(seri,*puStack_94); + WriteSleep(seri,puStack_8c); + WriteNonVolatile(seri,puStack_88); + WriteImmobilize(seri,puStack_84); + WriteVolatile(seri,puStack_80); + WriteCharging(seri,puStack_7c); + WriteProtection(seri,puStack_78); + WriteWaiting(seri,puStack_74); + WriteLinked(seri,puStack_70); + WriteMoveStatus(seri,puStack_6c); + WriteItemStatus(seri,puStack_68); + WriteTransformStatus(seri,puStack_64); + WriteEyesightStatus(seri,puStack_60); + WriteMuzzled(seri,pbStack_5c); + WriteBool8(seri,*pbStack_58); + WriteBool8(seri,*pbStack_54); + WriteBool8(seri,*pbStack_50); + WriteBool8(seri,*puStack_4c); + WriteBool8(seri,*pbStack_48); + WriteU8(seri,*puStack_34); + WriteBool8(seri,*pbStack_44); + WriteBool8(seri,*pbStack_40); + WriteBool8(seri,*pbStack_3c); + WriteU8(seri,*puStack_38); + WriteBool8(seri,*pbStack_30); + WriteU8(seri,*puStack_2c); + WriteU8(seri,*puStack_28); + WriteMonsterUnkFF(seri,*puStack_24); + WriteTargetingDecoy(seri,info->targetingDecoy); + WriteSpeedStage(seri,info->speedStage); + WriteSpeedCounters(seri,info->speedUpCounters,NUM_SPEED_COUNTERS); + WriteSpeedCounters(seri,info->speedDownCounters,NUM_SPEED_COUNTERS); + WriteU8(seri, info->stockpileStage); + WriteU8(seri, info->unk113); + WriteU8(seri, info->moveRandomly); + WriteMoves(seri, &info->moves); + WriteBelly(seri, &info->belly); + WriteBelly(seri, &info->maxBelly); + WriteBool8(seri,info->aiNextToTarget); + WriteBool8(seri,info->recalculateFollow); + WriteBool8(seri,info->waiting); + WriteBool8(seri,info->unk146); + WriteBool8(seri,info->attacking); + WriteBool8(seri,info->unk149); + WriteBool8(seri,info->unk14A); + WriteBool8(seri,info->unk14B); + WriteBool8(seri,info->unk14C); + WriteU16(seri,info->visualFlags); + WriteU16(seri,info->previousVisualFlags); + WriteBool8(seri,info->unk152); + WriteU8(seri,info->unk153); + WriteBool8(seri,info->unk154); + WriteBool8(seri,info->unk155); + WriteBool8(seri,info->unk156); + WriteU8(seri,info->unk164); + WriteU8(seri,info->unk165); + WriteU8(seri,info->unk166); + WriteU8(seri,info->unk167); + WriteU8(seri,info->unk168); + WriteU8(seri,info->turnsSinceWarpScarfActivation); + WriteTilePos(seri,&(info->targetPos)); + WriteS32(seri, info->unk174); + WriteU16(seri, info->abilityEffectFlags); + WriteS16(seri, info->unk1F8); + WriteS16(seri, info->mobileTurnTimer); + WriteU32(seri, info->expGainedInTurn); + WriteClientType(seri, *puStack_90); +} + +static void WriteDungeonFloor(DataSerializer *seri) +{ + s32 x; + s32 y; + s32 i; + + WriteBlame(seri, sMisakiSan); + WriteBool8(seri, gDungeon->unk3A08); + WriteBool8(seri, gDungeon->unk3A09); + WriteBool8(seri, gDungeon->unk3A0A); + WriteBool8(seri, gDungeon->unk3A0B); + WriteU8(seri, gDungeon->unk3A0C); + WriteU8(seri, gDungeon->unk3A0D); + WriteS16(seri, gDungeon->tileset); + WriteS16(seri,gDungeon->unk3A10); + WriteS16(seri, gDungeon->unk3A12); + WriteS16(seri, gDungeon->bossBattleIndex); + WriteS16(seri, gDungeon->unk3A16); + + for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { + for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) { + WriteTile(seri, &gDungeon->tiles[y][x]); + } + } + + WriteTilePos(seri, &gDungeon->unkE218); + WriteTilePos(seri, &gDungeon->unkE21C); + + for (i = 0; i < 8; i++) + WriteTilePos(seri, &gDungeon->unkE220[i]); + + WriteDungeonUnkE240(seri, &gDungeon->unkE240); + WriteDungeonUnkE240(seri, &gDungeon->unkE250); + WriteDungeonUnkE260(seri, &gDungeon->unkE260); + + for (y = 0; y < 8; y++) { + for (x = 0; x < 8; x++) { + WriteTile(seri, &gDungeon->unkE27C[y][x]); + WriteU8(seri, gDungeon->unkE87C[y][x]); + } + } + + WriteWeather(seri, &gDungeon->weather); +} + +static void WriteDungeonVisibility(DataSerializer *seri) +{ + WriteBlame(seri, sMisakiSan); + + WriteU8(seri, gDungeon->unk181e8.unk18208); + WriteU8(seri, gDungeon->unk181e8.visibilityRange); + WriteBool8(seri, gDungeon->unk181e8.blinded); + WriteBool8(seri, gDungeon->unk181e8.unk1820B); + WriteBool8(seri, gDungeon->unk181e8.unk1820C); + WriteBool8(seri, gDungeon->unk181e8.unk1820D); + WriteBool8(seri, gDungeon->unk181e8.unk1820E); + WriteBool8(seri, gDungeon->unk181e8.unk1820F); + WriteBool8(seri, gDungeon->unk181e8.hallucinating); + WriteBool8(seri, gDungeon->unk181e8.unk18211); + WriteBool8(seri, gDungeon->unk181e8.unk18213); +} + +static void WriteDungeonMusic(DataSerializer *seri) +{ + WriteS16(seri, gDungeon->musPlayer.songIndex); + WriteS16(seri, gDungeon->musPlayer.pastSongIndex); + WriteS16(seri, gDungeon->musPlayer.queuedSongIndex); +} + +static void WriteItem(DataSerializer *seri, Item *src) +{ + WriteBytes(seri, &src->flags, 1); + WriteBytes(seri, &src->quantity, 1); + WriteBytes(seri, &src->id, 1); +} + +static void WriteMonsterUnk64(DataSerializer *seri, u8 value) +{ + u8 stack; + + stack = value; + + WriteBytes(seri, &stack, 1); +} + +static void WriteActionContainer(DataSerializer *seri, ActionContainer *src) +{ + WriteBytes(seri, &src->direction, 1); + WriteBytes(seri, &src->itemTargetPosition.x, 1); + WriteBytes(seri, &src->itemTargetPosition.y, 1); +} + +static void WriteMonsterID(DataSerializer *seri, s16 value) +{ + s16 stack; + + stack = value; + + WriteBytes(seri, &stack, 2); +} + +static void WriteType(DataSerializer *seri, u8 value) +{ + u8 stack; + + stack = value; + + WriteBytes(seri, &stack, 1); +} + +static void WriteAbility(DataSerializer *seri, u8 value) +{ + u8 stack; + + stack = value; + + WriteBytes(seri, &stack, 1); +} + +static void WriteMonsterUnkFF(DataSerializer *seri, u8 value) +{ + u8 stack; + + stack = value; + + WriteBytes(seri, &stack, 1); +} + +static void WriteTargetingDecoy(DataSerializer *seri, u8 value) +{ + u8 stack; + + stack = value; + + WriteBytes(seri, &stack, 1); +} + +static void WriteSpeedStage(DataSerializer *seri, s32 value) +{ + WriteBytes(seri, &value, 4); +} + +static void WriteTactic(DataSerializer *seri, u8 value) +{ + WriteBytes(seri, &value, 1); +} + +static void WriteHiddenPower(DataSerializer *seri, HiddenPower *src) +{ + WriteS16(seri, src->hiddenPowerBasePower); + WriteType(seri, src->hiddenPowerType); +} + +static void WriteClientType(DataSerializer *seri, u8 value) +{ + WriteU8(seri, value); +} + +static void WriteJoinedAt(DataSerializer *seri, JoinedAt *src) +{ + WriteU8(seri, src->joinedAt); + WriteU8(seri, src->unk1); +} + +static void WriteAITarget(DataSerializer *seri, AITarget* src) +{ + WriteBytes(seri, &src->aiObjective, 1); + WriteBool8(seri, src->aiNotNextToTarget); + WriteBool8(seri, src->aiTargetingEnemy); + WriteBool8(seri, src->aiTurningAround); + WriteU16(seri, src->aiTargetSpawnGenID); + WriteTilePos(seri, &src->aiTargetPos); +} + +static void WriteSleep(DataSerializer *seri, Sleep* src) +{ + WriteBytes(seri, &src->sleep, 1); + WriteU8(seri, src->sleepTurns); +} + +static void WriteNonVolatile(DataSerializer *seri, NonVolatile *src) +{ + WriteBytes(seri, &src->nonVolatileStatus, 1); + WriteU8(seri, src->nonVolatileStatusTurns); + WriteU8(seri, src->nonVolatileStatusDamageCountdown); + WriteU8(seri, src->unk4); +} + +static void WriteImmobilize(DataSerializer *seri, Immobilize *src) +{ + WriteBytes(seri, &src->immobilizeStatus, 1); + WriteU8(seri, src->immobilizeStatusTurns); + WriteU8(seri, src->immobilizeStatusDamageCountdown); + WriteU32(seri, src->unk4); +} + +static void WriteVolatile(DataSerializer *seri, Volatile *src) +{ + WriteBytes(seri, &src->volatileStatus, 1); + WriteU8(seri, src->volatileStatusTurns); +} + +static void WriteCharging(DataSerializer *seri, Charging *src) +{ + WriteBytes(seri, &src->chargingStatus, 1); + WriteU8(seri, src->chargingStatusTurns); + WriteU8(seri, src->chargingStatusMoveIndex); +} + +static void WriteProtection(DataSerializer *seri, Protection *src) +{ + WriteBytes(seri, &src->protectionStatus, 1); + WriteU8(seri, src->protectionStatusTurns); +} + +static void WriteWaiting(DataSerializer *seri, Waiting *src) +{ + WriteBytes(seri, &src->waitingStatus, 1); + WriteBool8(seri, src->enemyDecoy); + WriteBool8(seri, src->unk2); + WriteU8(seri, src->waitingStatusTurns); + WriteU8(seri, src->curseDamageCountdown); +} + +static void WriteLinked(DataSerializer *seri, Linked *src) +{ + WriteBytes(seri, &src->linkedStatus, 1); + WriteU32(seri, src->unk4); + WriteU8(seri, src->unk8); + WriteU8(seri, src->linkedStatusTurns); + WriteU8(seri, src->linkedStatusDamageCountdown); +} + +static void WriteMoveStatus(DataSerializer *seri, MoveStatus* src) +{ + WriteBytes(seri, &src->moveStatus, 1); + WriteU8(seri, src->moveStatusTurns); +} + +static void WriteItemStatus(DataSerializer *seri, ItemStatus *src) +{ + WriteBytes(seri, &src->itemStatus, 1); +} + +static void WriteTransformStatus(DataSerializer *seri, TransformStatus *src) +{ + WriteBytes(seri, &src->transformStatus, 1); + WriteU8(seri, src->transformStatusTurns); +} + +static void WriteEyesightStatus(DataSerializer *seri, EyesightStatus *src) +{ + WriteBytes(seri, &src->eyesightStatus, 1); + WriteU8(seri, src->eyesightStatusTurns); +} + +static void WriteMuzzled(DataSerializer *seri, Muzzled *src) +{ + WriteBytes(seri, &src->muzzled, 1); + WriteU8(seri, src->muzzledTurns); +} + +static void WriteMove(DataSerializer *seri, Move *src) +{ + WriteU8(seri, src->moveFlags); + WriteU8(seri, src->moveFlags2); + WriteBytes(seri, &src->id, 2); + WriteU8(seri, src->PP); + WriteU8(seri, src->ginseng); +} + +static void WriteMoves(DataSerializer *seri, Moves *src) +{ + s32 i; + + for (i = 0; i < MAX_MON_MOVES; i++) + WriteMove(seri, &src->moves[i]); + + WriteU8(seri, src->struggleMoveFlags); +} + +static void WriteBelly(DataSerializer *seri, FixedPoint *src) +{ + WriteS16(seri, src->unk0); + WriteS16(seri, src->unk2); +} + +static void WriteIQSkills(DataSerializer *seri, u8 *src) +{ + WriteBytes(seri, src, NUM_PICKED_IQ_SKILLS); +} + +static void WriteTile(DataSerializer *seri, Tile *src) +{ + WriteU16(seri, src->terrainType); + WriteU16(seri, src->unk4); + WriteBytes(seri, &src->room, 1); + WriteBytes(seri, &src->unkE, 1); +} + +static void WriteWeather(DataSerializer *seri, Weather *src) +{ + s32 i; + + WriteBytes(seri, &src->weather, 1); + WriteBytes(seri, &src->unkE265, 1); + + for (i = 0; i < 8; i++) { + WriteU8(seri, src->unkE267[i]); + WriteU8(seri, src->naturalWeather[i]); + } + + WriteU8(seri, src->weatherDamageCounter); + WriteU8(seri, src->mudSportTurns); + WriteU8(seri, src->waterSportTurns); + WriteBool8(seri, src->nullifyWeather); +} + + + + + + + +// Read funcs + + + + + + + + + + +void ReadDungeonState(u8 *buffer, u32 bufLen) +{ + DataSerializer seri; + + InitReader(&seri, buffer, bufLen); + + ReadBytes(&seri, &seri.unkC, 4); + + ReadDungeonUnk644(&seri); + ReadDungeonFloor(&seri); + ReadDungeonVisibility(&seri); + ReadDungeonMusic(&seri); + ReadDungeonItems(&seri); + ReadDungeonTraps(&seri); + ReadDungeonMonsters(&seri); + + ReadBlame(&seri, sYayoiSan); + FinishSerializer(&seri); +} + +static void ReadDungeonUnk644(DataSerializer *seri) +{ + ReadBlame(seri, sMisakiSan); + ReadBytes(seri, &gDungeon->unk644, sizeof(unkDungeon644)); +} + +static void ReadDungeonFloor(DataSerializer *seri) +{ + s32 x; + s32 y; + s32 i; + + ReadBlame(seri, sMisakiSan); + + gDungeon->unk3A08 = ReadBool8(seri); + gDungeon->unk3A09 = ReadBool8(seri); + gDungeon->unk3A0A = ReadBool8(seri); + gDungeon->unk3A0B = ReadBool8(seri); + gDungeon->unk3A0C = ReadU8(seri); + gDungeon->unk3A0D = ReadU8(seri); + gDungeon->tileset = ReadS16(seri); + gDungeon->unk3A10 = ReadS16(seri); + gDungeon->unk3A12 = ReadS16(seri); + gDungeon->bossBattleIndex = ReadS16(seri); + gDungeon->unk3A16 = ReadS16(seri); + + for (y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { + for (x = 0; x < DUNGEON_MAX_SIZE_X; x++) { + ReadTile(seri, &gDungeon->tiles[y][x]); + } + } + + ReadTilePos(seri, &gDungeon->unkE218); + ReadTilePos(seri, &gDungeon->unkE21C); + + for (i = 0; i < 8; i++) + ReadTilePos(seri, &gDungeon->unkE220[i]); + + ReadDungeonUnkE240(seri, &gDungeon->unkE240); + ReadDungeonUnkE240(seri, &gDungeon->unkE250); + ReadDungeonUnkE260(seri, &gDungeon->unkE260); + + for (y = 0; y < 8; y++) { + for (x = 0; x < 8; x++) { + ReadTile(seri,&gDungeon->unkE27C[y][x]); + gDungeon->unkE87C[y][x] = ReadU8(seri); + } + } + + ReadWeather(seri, &gDungeon->weather); +} + +static void ReadTile(DataSerializer *seri, Tile *dst) +{ + memset(dst, 0, sizeof(Tile)); + + dst->terrainType = ReadU16(seri); + dst->unk4 = ReadU16(seri); + + ReadBytes(seri, &dst->room, 1); + ReadBytes(seri, &dst->unkE, 1); + + dst->monster = NULL; + dst->object = NULL; +} + +static void ReadWeather(DataSerializer *seri, Weather *dst) +{ + s32 i; + + memset(dst, 0, sizeof(Weather)); + + ReadBytes(seri, &dst->weather, 1); + ReadBytes(seri, &dst->unkE265, 1); + + for (i = 0; i < 8; i++) { + dst->unkE267[i] = ReadU8(seri); + dst->naturalWeather[i] = ReadU8(seri); + } + + dst->weatherDamageCounter = ReadU8(seri); + dst->mudSportTurns = ReadU8(seri); + dst->waterSportTurns = ReadU8(seri); + dst->nullifyWeather = ReadBool8(seri); +} + +static void ReadDungeonVisibility(DataSerializer *seri) +{ + ReadBlame(seri, sMisakiSan); + + gDungeon->unk181e8.cameraTarget = NULL; + gDungeon->unk181e8.unk18208 = ReadU8(seri); + gDungeon->unk181e8.visibilityRange = ReadU8(seri); + gDungeon->unk181e8.blinded = ReadBool8(seri); + gDungeon->unk181e8.unk1820B = ReadBool8(seri); + gDungeon->unk181e8.unk1820C = ReadBool8(seri); + gDungeon->unk181e8.unk1820D = ReadBool8(seri); + gDungeon->unk181e8.unk1820E = ReadBool8(seri); + gDungeon->unk181e8.unk1820F = ReadBool8(seri); + gDungeon->unk181e8.hallucinating = ReadBool8(seri); + gDungeon->unk181e8.unk18211 = ReadBool8(seri); + gDungeon->unk181e8.unk18213 = ReadBool8(seri); +} + +static void ReadDungeonMusic(DataSerializer *seri) +{ + gDungeon->musPlayer.songIndex = ReadS16(seri); + gDungeon->musPlayer.pastSongIndex = ReadS16(seri); + gDungeon->musPlayer.queuedSongIndex = ReadS16(seri); +} + +static void ReadDungeonItems(DataSerializer *seri) +{ + s32 i; + Item item; + Position pos; + + ReadBlame(seri, sMisakiSan); + + for (i = 0; i < DUNGEON_MAX_ITEMS; i++) { + ReadItem(seri, &item); + ReadTilePos(seri, &pos); + + if (item.flags & ITEM_FLAG_EXISTS) + sub_80460F8(&pos, &item, 0); + } +} + +static void ReadItem(DataSerializer *seri, Item *dst) +{ + memset(dst, 0, sizeof(Item)); + ReadBytes(seri, &dst->flags, 1); + ReadBytes(seri, &dst->quantity, 1); + ReadBytes(seri, &dst->id, 1); +} + +static void ReadDungeonTraps(DataSerializer *seri) +{ + s32 counter; + Tile *tile; + Entity *entity; + Position pos; + u8 isVisible; + u8 unk1; + u8 trapID; + + ReadBlame(seri, sMisakiSan); + + for (counter = 0; counter < DUNGEON_MAX_TRAPS; counter++) { + trapID = TRAP_WARP_TRAP; + unk1 = 0; + ReadBytes(seri, &trapID, 1); + ReadBytes(seri, &unk1, 1); + isVisible = ReadBool8(seri); + ReadTilePos(seri, &pos); + + if (trapID != 0xFF) { + tile = GetTileSafe(pos.x, pos.y); + entity = sub_8045684(trapID, &pos, unk1); + if (entity) { + tile->object = entity; + entity->isVisible = isVisible; + } + } + } +} + +static void ReadDungeonMonsters(DataSerializer *seri) +{ + s32 i; + + ReadBlame(seri, sMisakiSan); + + gDungeon->unk37F0 = ReadU32(seri); + gDungeon->unk37F4 = ReadU32(seri); + gDungeon->plusIsActive[0] = ReadBool8(seri); + gDungeon->plusIsActive[1] = ReadBool8(seri); + gDungeon->minusIsActive[0] = ReadBool8(seri); + gDungeon->minusIsActive[1] = ReadBool8(seri); + gDungeon->decoyActive = ReadBool8(seri); + gDungeon->unk37FD = ReadBool8(seri); + gDungeon->deoxysDefeat = ReadBool8(seri); + gDungeon->unk37FF = ReadBool8(seri); + gDungeon->deoxysForm = ReadU16(seri); // Should be S16 + + for (i = 0; i < MAX_TEAM_MEMBERS; i++) + ReadMonster(seri, TRUE, i); + + for (i = 0; i < DUNGEON_MAX_WILD_POKEMON; i++) + ReadMonster(seri, FALSE, i); +} + +static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index) +{ + Entity *mon; + Tile *tile; + s32 i; + EntityInfo *monEntInfo; + EntityInfo entInfo = {0}; + Position monPos; + bool8 shouldSpawnMon; + u32 monIsVisible; + u32 spawnGenID; + + ReadU8(seri); // 0xAA + ReadU8(seri); // 0x55 + shouldSpawnMon = ReadU8(seri); + ReadTilePos(seri, &monPos); + monIsVisible = ReadBool8(seri); + spawnGenID = ReadU16(seri); + gLeaderPointer = NULL; + + entInfo.flags = ReadU16(seri); + entInfo.apparentID = ReadMonsterID(seri); + entInfo.id = ReadMonsterID(seri); + entInfo.isNotTeamMember = ReadBool8(seri); + entInfo.isTeamLeader = ReadBool8(seri); + entInfo.shopkeeper = ReadU8(seri); + entInfo.level = ReadU8(seri); + entInfo.teamIndex = ReadU8(seri); + ReadJoinedAt(seri, &entInfo.joinedAt); + entInfo.IQ = ReadS16(seri); + entInfo.HP = ReadS16(seri); + entInfo.maxHPStat = ReadS16(seri); + entInfo.originalHP = ReadS16(seri); + entInfo.atk[0] = ReadU8(seri); + entInfo.atk[1] = ReadU8(seri); + entInfo.def[0] = ReadU8(seri); + entInfo.def[1] = ReadU8(seri); + entInfo.exp = ReadU32(seri); + entInfo.offensiveStages[0] = ReadS16(seri); + entInfo.offensiveStages[1] = ReadS16(seri); + entInfo.defensiveStages[0] = ReadS16(seri); + entInfo.defensiveStages[1] = ReadS16(seri); + entInfo.hitChanceStages[0] = ReadS16(seri); + entInfo.hitChanceStages[1] = ReadS16(seri); + entInfo.flashFireBoost = ReadS16(seri); + entInfo.offensiveMultipliers[0] = ReadS32(seri); + entInfo.offensiveMultipliers[1] = ReadS32(seri); + entInfo.defensiveMultipliers[0] = ReadS32(seri); + entInfo.defensiveMultipliers[1] = ReadS32(seri); + ReadActionContainer(seri, &entInfo.action); + entInfo.types[0] = ReadType(seri); + entInfo.types[1] = ReadType(seri); + entInfo.abilities[0] = ReadAbility(seri); + entInfo.abilities[1] = ReadAbility(seri); + ReadItem(seri, &entInfo.heldItem); + entInfo.unk64 = ReadMonsterUnk64(seri); + + for (i = 0; i < NUM_PREV_POS; i++) + ReadTilePos(seri, &entInfo.prevPos[i]); + + ReadAITarget(seri, &entInfo.aiTarget); + ReadIQSkills(seri, entInfo.IQSkillMenuFlags); + ReadIQSkills(seri, entInfo.IQSkillFlags); + entInfo.tactic = ReadTactic(seri); + ReadHiddenPower(seri, &entInfo.hiddenPower); + entInfo.unk98 = ReadU32(seri); + entInfo.unk9C = ReadU32(seri); + entInfo.unkA0 = ReadU32(seri); + ReadSleep(seri, &entInfo.sleep); + ReadNonVolatile(seri,&entInfo. nonVolatile); + ReadImmobilize(seri, &entInfo.immobilize); + ReadVolatileStatus(seri, &entInfo.volatileStatus); + ReadCharging(seri, &entInfo.charging); + ReadProtection(seri, &entInfo.protection); + ReadWaiting(seri, &entInfo.waitingStruct); + ReadLinked(seri, &entInfo.linked); + ReadMoveStatus(seri, &entInfo.moveStatus); + ReadItemStatus(seri, &entInfo.itemStatus); + ReadTransformStatus(seri, &entInfo.transformStatus); + ReadEyesightStatus(seri, &entInfo.eyesightStatus); + ReadMuzzled(seri, &entInfo.muzzled); + entInfo.powerEars = ReadBool8(seri); + entInfo.scanning = ReadBool8(seri); + entInfo.stairSpotter = ReadBool8(seri); + entInfo.unkF3 = ReadBool8(seri); + entInfo.grudge = ReadBool8(seri); + entInfo.expMultiplier = ReadU8(seri); + entInfo.exposed = ReadBool8(seri); + entInfo.isColorChanged = ReadBool8(seri); + entInfo.bossFlag = ReadBool8(seri); + entInfo.terrifiedTurns = ReadU8(seri); + entInfo.useHeldItem = ReadBool8(seri); + entInfo.perishSongTurns = ReadU8(seri); + entInfo.unkFE = ReadU8(seri); + entInfo.unkFF = ReadMonsterUnkFF(seri); + + entInfo.targetingDecoy = ReadTargetingDecoy(seri); + entInfo.speedStage = ReadSpeedStage(seri); + ReadSpeedCounters(seri, entInfo.speedUpCounters, NUM_SPEED_COUNTERS); + ReadSpeedCounters(seri, entInfo.speedDownCounters, NUM_SPEED_COUNTERS); + entInfo.stockpileStage = ReadU8(seri); + entInfo.unk113 = ReadU8(seri); + entInfo.moveRandomly = ReadU8(seri); + ReadMoves(seri, &entInfo.moves); + ReadBelly(seri, &entInfo.belly); + ReadBelly(seri, &entInfo.maxBelly); + entInfo.aiNextToTarget = ReadBool8(seri); + entInfo.recalculateFollow = ReadBool8(seri); + entInfo.waiting = ReadBool8(seri); + entInfo.unk146 = ReadBool8(seri); + entInfo.attacking = ReadBool8(seri); + entInfo.unk149 = ReadBool8(seri); + entInfo.unk14A = ReadBool8(seri); + entInfo.unk14B = ReadBool8(seri); + entInfo.unk14C = ReadBool8(seri); + entInfo.visualFlags = ReadU16(seri); + entInfo.previousVisualFlags = ReadU16(seri); + entInfo.unk152 = ReadBool8(seri); + entInfo.unk153 = ReadU8(seri); + entInfo.unk154 = ReadBool8(seri); + entInfo.unk155 = ReadBool8(seri); + entInfo.unk156 = ReadBool8(seri); + entInfo.unk164 = ReadU8(seri); + entInfo.unk165 = ReadU8(seri); + entInfo.unk166 = ReadU8(seri); + entInfo.unk167 = ReadU8(seri); + entInfo.unk168 = ReadU8(seri); + entInfo.turnsSinceWarpScarfActivation = ReadU8(seri); + ReadTilePos(seri, &entInfo.targetPos); + entInfo.unk174 = ReadS32(seri); + entInfo.abilityEffectFlags = ReadU16(seri); + entInfo.unk1F8 = ReadS16(seri); + entInfo.mobileTurnTimer = ReadS16(seri); + entInfo.expGainedInTurn = ReadU32(seri); + entInfo.clientType = ReadClientType(seri); + + gLeaderPointer = NULL; + if (shouldSpawnMon) { + if (isTeamMember) + mon = sub_80828E0(entInfo.id, entInfo.apparentID, index); + else + mon = sub_8082A08(entInfo.id, entInfo.apparentID, index); + + if (mon != NULL) { + monEntInfo = GetEntInfo(mon); + tile = GetTileSafe(monPos.x, monPos.y); + mon->prevPos = monPos; + mon->pos = monPos; + tile->monster = mon; + mon->isVisible = monIsVisible; + mon->spawnGenID = spawnGenID; + memcpy(monEntInfo, &entInfo, sizeof(EntityInfo)); + gLeaderPointer = NULL; + + if (monEntInfo->isTeamLeader) { + gUnknown_203B410.x = mon->pos.x; + gUnknown_203B410.y = mon->pos.y; + } + + LoadIQSkills(mon); + sub_804535C(mon, NULL); + } + } +} + +// Related to sub_80453AC +static Entity* sub_80828E0(s16 id, s16 apparentID, s32 index) +{ + s32 r1; + s32 r2; + s32 r3; + s32 r4; + u8 apparentBodySize; + Entity *entity; + s32 appID; + s32 id_; + + id_ = id; // SpeciesId() ? + appID = apparentID; // SpeciesId() ? + r4 = -1; + apparentBodySize = GetBodySize(appID); + + for (r3 = 0; r3 <= MAX_TEAM_BODY_SIZE - apparentBodySize; r3++) { + for (r2 = 0; r2 < apparentBodySize; r2++) { + if (gUnknown_202EE70[r3 + r2] != 0) + break; + } + + if (r2 == apparentBodySize) { + r4 = r3; + break; + } + } + + if (r4 == -1) + return NULL; + + entity = gDungeon->teamPokemon[index]; + entity->type = ENTITY_MONSTER; + entity->unk24 = index; + entity->axObj.info = &gDungeon->unk69C[index]; + entity->axObj.info->id = id_; + entity->axObj.info->apparentID = appID; + entity->axObj.info->isNotTeamMember = FALSE; + + entity->axObj.spriteFile = GetSpriteData(appID); + entity->axObj.unk40_maybeAnimTimer = (r4 * 0x10) + 0x40; + entity->axObj.unk42_animId1 = 7; + entity->axObj.unk44_direction1 = 0; + entity->axObj.unk43_animId2 = 0xFF; + entity->axObj.unk45_orientation = 1; + entity->axObj.unk47 = 1; + + entity->unk1C = 0; + sub_8045ACC(); + entity->axObj.info->unk167 = r4; + entity->axObj.info->unk168 = apparentBodySize; + + for (r1 = 0; r1 < apparentBodySize; r1++) { + gUnknown_202EE70[r4] = 1; + r4++; + } + + return entity; +} + +// Related to sub_804550C +// Fakematch with registers. See https://decomp.me/scratch/KpZyK +static Entity* sub_8082A08(s16 id, s16 apparentID, s32 index) +{ + s32 r1; + s32 r2; + s32 r3; + u8 apparentBodySize; // r6 + Entity *entity; // r7 + #ifdef NONMATCHING + s32 r8; + s32 appID; // r9 + #else + register s32 r8 asm("r8"); + register s32 appID asm("r9"); // r9 + #endif + s32 id_; // sp + + id_ = id; // SpeciesId() ? + appID = apparentID; // SpeciesId() ? + r8 = -1; + apparentBodySize = GetBodySize(appID); + + for (r3 = 0; r3 <= DUNGEON_MAX_WILD_POKEMON_BODY_SIZE - apparentBodySize; r3++) { + for (r2 = 0; r2 < apparentBodySize; r2++) { + if (gUnknown_202EE76[r3 + r2] != 0) + break; + } + + if (r2 == apparentBodySize) { + r8 = r3; + break; + } + } + + if (r8 == -1) + return NULL; + + entity = gDungeon->wildPokemon[index]; + entity->type = ENTITY_MONSTER; + entity->unk24 = index; + entity->unk22 = 0; + entity->axObj.info = &gDungeon->unkEBC[index]; + entity->axObj.info->id = id_; + entity->axObj.info->apparentID = appID; + entity->axObj.info->isNotTeamMember = TRUE; + + entity->axObj.spriteFile = GetSpriteData(appID); + entity->axObj.unk40_maybeAnimTimer = (r8 * 0x10) + 0xA0; + entity->axObj.unk42_animId1 = 7; + entity->axObj.unk44_direction1 = 0; + entity->axObj.unk43_animId2 = 0xFF; + entity->axObj.unk45_orientation = 1; + entity->axObj.unk47 = 1; + + entity->unk1C = 0; + entity->axObj.info->unk167 = r8; + entity->axObj.info->unk168 = apparentBodySize; + + for (r1 = 0; r1 < apparentBodySize; r1++) { + gUnknown_202EE76[r8] = 1; + r8++; + } + + sub_8045ACC(); + + return entity; +} + +void sub_8082B40(void) +{ + EntityInfo *info; + Entity *entity; + s32 i; + Position pos; + + for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { + entity = gDungeon->allPokemon[i]; + if (EntityExists(entity)) { + info = GetEntInfo(entity); + entity->axObj.spriteFile = GetSpriteData(info->apparentID); + sub_806CCB4(entity, sub_806CEBC(entity)); + pos = entity->pos; + AddPokemonDungeonSprite(info->unk98, info->apparentID, &pos, 3); + entity->room = GetTileSafe(entity->pos.x, entity->pos.y)->room; + } + } +} + +static s16 ReadMonsterID(DataSerializer *seri) +{ + s16 temp[2]; + + temp[0] = 0; + + ReadBytes(seri, temp, 2); + return temp[0]; +} + +static u8 ReadMonsterUnk64(DataSerializer *seri) +{ + u8 temp[4]; + + temp[0] = 0; + + ReadBytes(seri, temp, 1); + return temp[0]; +} + +static u8 ReadType(DataSerializer *seri) +{ + u8 temp[4]; + + temp[0] = 0; + + ReadBytes(seri, temp, 1); + return temp[0]; +} + +static u8 ReadAbility(DataSerializer *seri) +{ + u8 temp[4]; + + temp[0] = 0; + + ReadBytes(seri, temp, 1); + return temp[0]; +} + +static u8 ReadMonsterUnkFF(DataSerializer *seri) +{ + u8 temp[4]; + + temp[0] = 0; + + ReadBytes(seri, temp, 1); + return temp[0]; +} + +static u8 ReadTargetingDecoy(DataSerializer *seri) +{ + u8 temp[4]; + + temp[0] = 0; + + ReadBytes(seri, temp, 1); + return temp[0]; +} + +static s32 ReadSpeedStage(DataSerializer *seri) +{ + s32 temp; + + temp = 0; + + ReadBytes(seri, &temp, 4); + return temp; +} + +static u8 ReadTactic(DataSerializer *seri) +{ + u8 temp[4]; + + temp[0] = 0; + + ReadBytes(seri, temp, 1); + return temp[0]; +} + +static u8 ReadClientType(DataSerializer *seri) +{ + u8 temp[4]; + + temp[0] = 0; + + ReadBytes(seri, temp, 1); + return temp[0]; +} + +static void ReadActionContainer(DataSerializer *seri, ActionContainer *dst) +{ + dst->action = ACTION_NOTHING; + ReadBytes(seri, &dst->direction, 1); + dst->unk3 = 7; + ReadTilePos(seri, &dst->itemTargetPosition); +} + +static void ReadAITarget(DataSerializer *seri, AITarget *dst) +{ + ReadBytes(seri, &dst->aiObjective, 1); + dst->aiNotNextToTarget = ReadBool8(seri); + dst->aiTargetingEnemy = ReadBool8(seri); + dst->aiTurningAround = ReadBool8(seri); + dst->aiTargetSpawnGenID = ReadU16(seri); + dst->aiTarget = NULL; + dst->unkC = 0; + ReadTilePos(seri, &dst->aiTargetPos); +} + +static void ReadIQSkills(DataSerializer *seri, u8 *dst) +{ + ReadBytes(seri, dst, NUM_PICKED_IQ_SKILLS); +} + +static void ReadSleep(DataSerializer *seri, Sleep *dst) +{ + ReadBytes(seri, &dst->sleep, 1); + dst->sleepTurns = ReadU8(seri); +} + +static void ReadNonVolatile(DataSerializer *seri, NonVolatile *dst) +{ + ReadBytes(seri, &dst->nonVolatileStatus, 1); + dst->nonVolatileStatusTurns = ReadU8(seri); + dst->nonVolatileStatusDamageCountdown = ReadU8(seri); + dst->unk4 = ReadU8(seri); +} + +static void ReadImmobilize(DataSerializer *seri, Immobilize *dst) +{ + ReadBytes(seri, &dst->immobilizeStatus, 1); + dst->immobilizeStatusTurns = ReadU8(seri); + dst->immobilizeStatusDamageCountdown = ReadU8(seri); + dst->unk4 = ReadU32(seri); +} + +static void ReadVolatileStatus(DataSerializer *seri, Volatile *dst) +{ + ReadBytes(seri, &dst->volatileStatus, 1); + dst->volatileStatusTurns = ReadU8(seri); +} + +static void ReadCharging(DataSerializer *seri, Charging *dst) +{ + ReadBytes(seri, &dst->chargingStatus, 1); + dst->chargingStatusTurns = ReadU8(seri); + dst->chargingStatusMoveIndex = ReadU8(seri); +} + +static void ReadProtection(DataSerializer *seri, Protection *dst) +{ + ReadBytes(seri, &dst->protectionStatus, 1); + dst->protectionStatusTurns = ReadU8(seri); +} + +static void ReadWaiting(DataSerializer *seri, Waiting *dst) +{ + ReadBytes(seri, &dst->waitingStatus, 1); + dst->enemyDecoy = ReadBool8(seri); + dst->unk2 = ReadBool8(seri); + dst->waitingStatusTurns = ReadU8(seri); + dst->curseDamageCountdown = ReadU8(seri); +} + +static void ReadLinked(DataSerializer *seri, Linked *dst) +{ + ReadBytes(seri, &dst->linkedStatus, 1); + dst->unk4 = ReadU32(seri); + dst->unk8 = ReadU8(seri); + dst->linkedStatusTurns = ReadU8(seri); + dst->linkedStatusDamageCountdown = ReadU8(seri); +} + +static void ReadMoveStatus(DataSerializer *seri, MoveStatus *dst) +{ + ReadBytes(seri, &dst->moveStatus, 1); + dst->moveStatusTurns = ReadU8(seri); +} + +static void ReadItemStatus(DataSerializer *seri, ItemStatus *dst) +{ + ReadBytes(seri, &dst->itemStatus, 1); +} + +static void ReadTransformStatus(DataSerializer *seri, TransformStatus *dst) +{ + ReadBytes(seri, &dst->transformStatus, 1); + dst->transformStatusTurns = ReadU8(seri); +} + +static void ReadEyesightStatus(DataSerializer *seri, EyesightStatus *dst) +{ + ReadBytes(seri, &dst->eyesightStatus, 1); + dst->eyesightStatusTurns = ReadU8(seri); +} + +static void ReadMuzzled(DataSerializer *seri, Muzzled *dst) +{ + ReadBytes(seri, &dst->muzzled, 1); + dst->muzzledTurns = ReadU8(seri); +} + +static void ReadMove(DataSerializer *seri, Move *dst) +{ + dst->moveFlags = ReadU8(seri); + dst->moveFlags2 = ReadU8(seri); + ReadBytes(seri, &dst->id, 2); + dst->PP = ReadU8(seri); + dst->ginseng = ReadU8(seri); +} + +static void ReadMoves(DataSerializer *seri, Moves *dst) +{ + s32 i; + Move *move; + + for (i = 0; i < MAX_MON_MOVES; i++) { + move = &dst->moves[i]; + ReadMove(seri, move); + } + + dst->struggleMoveFlags = ReadU8(seri); +} + +static void ReadBelly(DataSerializer *seri, FixedPoint *dst) +{ + dst->unk0 = ReadS16(seri); + dst->unk2 = ReadS16(seri); +} + +static void ReadJoinedAt(DataSerializer *seri, JoinedAt *dst) +{ + dst->joinedAt = ReadU8(seri); + dst->unk1 = ReadU8(seri); +} + +static void ReadHiddenPower(DataSerializer *seri, HiddenPower *dst) +{ + dst->hiddenPowerBasePower = ReadS16(seri); + dst->hiddenPowerType = ReadType(seri); +} + +static void InitWriter(DataSerializer *seri, u8 *buffer, u32 bufLen) +{ + seri->stream = buffer; + seri->count = 0; + seri->end = buffer + bufLen; +} + +static void WriteBytes(DataSerializer *seri, void *src, s32 numBytes) +{ + u8 *curByte; + + curByte = src; + + while (numBytes != 0) { + *seri->stream = *curByte; + seri->stream++; + curByte++; + numBytes--; + seri->count++; + } +} + +static void InitReader(DataSerializer *seri, u8 *buffer, u32 bufLen) +{ + seri->stream = buffer; + seri->count = 0; + seri->end = buffer + bufLen; +} + +static void ReadBytes(DataSerializer *seri, void *dst, s32 numBytes) +{ + u8 *curByte; + + curByte = dst; + + while (numBytes != 0) { + *curByte = *seri->stream; + seri->stream++; + curByte++; + numBytes--; + seri->count++; + } +} + +static void FinishSerializer(DataSerializer *seri) +{ +} + +static void WriteBlame(DataSerializer *seri, const u8 *blame) +{ + WriteBytes(seri, (u8 *)blame, BLAME_SIZE); +} + +static void ReadBlame(DataSerializer *seri, const u8 *expected) +{ + u8 auStack_10[BLAME_STACK_SIZE]; + + ReadBytes(seri, auStack_10, BLAME_SIZE); + auStack_10[BLAME_SIZE] = 0; +} + +static void WriteU16(DataSerializer *seri, u16 value) +{ + u16 uStack_8; + + uStack_8 = value; + + WriteBytes(seri, &uStack_8, 2); +} + +static void WriteS16(DataSerializer *seri, s16 value) +{ + s16 uStack_8; + + uStack_8 = value; + + WriteBytes(seri, &uStack_8, 2); +} + +static void WriteU8(DataSerializer *seri, u8 value) +{ + u8 uStack_8; + + uStack_8 = value; + + WriteBytes(seri, &uStack_8, 1); +} + +static void WriteU32(DataSerializer *seri, u32 value) +{ + u32 uStack_8; + + uStack_8 = value; + + WriteBytes(seri, &uStack_8, 4); +} + +UNUSED static void sub_808308C(DataSerializer *seri, u32 value) +{ + u32 uStack_8; + + uStack_8 = value; + + WriteBytes(seri, &uStack_8, 4); +} + +static void WriteS32(DataSerializer *seri, s32 value) +{ + s32 uStack_8; + + uStack_8 = value; + + WriteBytes(seri, &uStack_8, 4); +} + +static void WriteBool8(DataSerializer *seri, bool8 value) +{ + u8 local_8; + + local_8 = value ? -1 : 0; + + WriteBytes(seri, &local_8, 1); +} + +static void WriteTilePos(DataSerializer *seri, Position *src) +{ + WriteBytes(seri, &src->x, 1); + WriteBytes(seri, &src->y, 1); +} + +static void WriteDungeonUnkE240(DataSerializer *seri, unkDungeonE240 *src) +{ + WriteBytes(seri, &src->unk0, 1); + WriteBytes(seri, &src->unk4, 1); + WriteBytes(seri, &src->unk8, 1); + WriteBytes(seri, &src->unkC, 1); +} + +static void WriteDungeonUnkE260(DataSerializer *seri, unkDungeonE260 *src) +{ + WriteBytes(seri, &src->unk0, 1); + WriteBytes(seri, &src->unk2, 1); +} + +static void WriteSpeedCounters(DataSerializer *seri, u8 *src, u32 numCounters) +{ + WriteBytes(seri, src, numCounters); +} + +static u16 ReadU16(DataSerializer *seri) +{ + u16 local_8; + + ReadBytes(seri, &local_8, 2); + return local_8; +} + +static s16 ReadS16(DataSerializer *seri) +{ + s16 local_8; + + ReadBytes(seri, &local_8, 2); + return local_8; +} + +static u8 ReadU8(DataSerializer *seri) +{ + u8 local_8; + + ReadBytes(seri, &local_8, 1); + return local_8; +} + +static u32 ReadU32(DataSerializer *seri) +{ + u32 local_8; + + ReadBytes(seri, &local_8, 4); + return local_8; +} + +UNUSED static u32 sub_80831B4(DataSerializer *seri) +{ + u32 local_8; + + ReadBytes(seri, &local_8, 4); + return local_8; +} + +static s32 ReadS32(DataSerializer *seri) +{ + s32 local_8; + + ReadBytes(seri, &local_8, 4); + return local_8; +} + +static bool8 ReadBool8(DataSerializer *seri) +{ + u8 local_8; + + ReadBytes(seri, &local_8, 1); + return local_8 != 0; +} + +static void ReadTilePos(DataSerializer *seri, Position *dst) +{ + dst->x = 0; + dst->y = 0; + ReadBytes(seri, &dst->x, 1); + ReadBytes(seri, &dst->y, 1); +} + +static void ReadDungeonUnkE240(DataSerializer *seri, unkDungeonE240 *dst) +{ + dst->unk0 = 0; + dst->unk4 = 0; + dst->unk8 = 0; + dst->unkC = 0; + ReadBytes(seri, &dst->unk0, 1); + ReadBytes(seri, &dst->unk4, 1); + ReadBytes(seri, &dst->unk8, 1); + ReadBytes(seri, &dst->unkC, 1); +} + +static void ReadDungeonUnkE260(DataSerializer *seri, unkDungeonE260 *dst) +{ + dst->unk0 = 0; + dst->unk2 = 0; + ReadBytes(seri, &dst->unk0, 1); + ReadBytes(seri, &dst->unk2, 1); +} + +static void ReadSpeedCounters(DataSerializer *seri, u8 *dst, u32 numCounters) +{ + ReadBytes(seri, dst, numCounters); +} \ No newline at end of file diff --git a/src/status.c b/src/status.c index 781895657..a53e7fabe 100644 --- a/src/status.c +++ b/src/status.c @@ -816,7 +816,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) entityInfo->linked.linkedStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EB0, TRUE) + 1; entityInfo->linked.linkedStatusDamageCountdown = 0; nullsub_78(target); - entityInfo->linked.unkD8 = 0xff; + entityInfo->linked.unk8 = 0xff; break; case STATUS_LEECH_SEED: TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE7C); @@ -825,9 +825,9 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { if (pokemon == gDungeon->allPokemon[index]) { - entityInfo->linked.unkD8 = index; + entityInfo->linked.unk8 = index; entityInfo2 = GetEntInfo(pokemon); - entityInfo->linked.unkD4 = entityInfo2->unk98; + entityInfo->linked.unk4 = entityInfo2->unk98; } } TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE58); @@ -852,7 +852,7 @@ void sub_8078084(Entity * pokemon) entityInfo2 = GetEntInfo(target); if((u8)(entityInfo2->linked.linkedStatus - 1) <= 1) { - if(entityInfo2->linked.unkD4 == entityInfo->unk98) + if(entityInfo2->linked.unk4 == entityInfo->unk98) { entityInfo2->linked.linkedStatus = STATUS_NONE; EntityUpdateStatusSprites(target); @@ -884,7 +884,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) entityInfo->linked.linkedStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EF0,TRUE) + 1; entityInfo->linked.linkedStatusDamageCountdown = zero; nullsub_74(target); - entityInfo->linked.unkD8 = 0xff; + entityInfo->linked.unk8 = 0xff; } else { @@ -894,9 +894,9 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { if (target == gDungeon->allPokemon[index]) { - entityInfo->linked.unkD8 = index; + entityInfo->linked.unk8 = index; entityInfo2 = GetEntInfo(target); - entityInfo->linked.unkD4 = entityInfo2->unk98; + entityInfo->linked.unk4 = entityInfo2->unk98; } } TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB4C); @@ -984,7 +984,7 @@ void FocusEnergyStatusTarget(Entity *pokemon, Entity * target) } } -void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) +void sub_80783C4(Entity * pokemon, Entity * target, bool8 param_3) { EntityInfo *targetEntityInfo; EntityInfo *entityInfo; @@ -1016,7 +1016,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) } targetEntityInfo->waitingStruct.waitingStatus = STATUS_DECOY; targetEntityInfo->waitingStruct.enemyDecoy = GetEntInfo(pokemon)->isNotTeamMember; - targetEntityInfo->waitingStruct.unkCA = param_3; + targetEntityInfo->waitingStruct.unk2 = param_3; targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED0,TRUE) + 1; targetEntityInfo->waitingStruct.curseDamageCountdown = 0; sub_806CCB4(target,sub_806CEBC(target)); diff --git a/src/status_actions.c b/src/status_actions.c index 2a1fb4171..c9e9e9ee4 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -45,7 +45,6 @@ extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u3 extern void sub_807FC3C(Position *, u32, u32); extern void sub_8042A64(Position *); extern void sub_8040A84(void); -extern void sub_8049ED4(void); extern void sub_80498A8(s32, s32); extern void sub_8042A54(Position *); extern void sub_8049BB0(s32, s32); @@ -80,7 +79,7 @@ extern void sub_8075C58(Entity *, Entity *, s32, s32); extern void DealDamageToEntity(Entity *, s32, u32, u32); extern bool8 MoveRequiresCharging(Entity* pokemon,u16 moveID); -extern void sub_80783C4(Entity *, Entity *, u32); +extern void sub_80783C4(Entity *, Entity *, bool8); // NOTE: Override pokemon.c types for these two funcs @@ -342,7 +341,7 @@ bool8 sub_805B2FC(Entity * pokemon,Entity * target,Move *move, s32 param_4) bool8 sub_805B314(Entity * pokemon,Entity * target,Move *move, s32 param_4) { - sub_80783C4(pokemon, target, 1); + sub_80783C4(pokemon, target, TRUE); return TRUE; } diff --git a/src/tile_types.c b/src/tile_types.c index a0277f8fd..078eee7b8 100644 --- a/src/tile_types.c +++ b/src/tile_types.c @@ -88,7 +88,6 @@ extern void sub_80498A8(s32, s32); extern void sub_80402AC(s32, s32); extern void sub_8049BB0(s32, s32); void sub_8042A14(Position *); -extern void sub_8049ED4(void); bool8 PosHasItem(Position *pos) { diff --git a/src/trap.c b/src/trap.c index 54f96b19e..fcd798538 100644 --- a/src/trap.c +++ b/src/trap.c @@ -2,6 +2,7 @@ #include "trap.h" #include "code_803E668.h" +#include "code_8041AD0.h" #include "code_8045A00.h" #include "dungeon_message.h" #include "code_8077274_1.h" @@ -79,12 +80,10 @@ void sub_8045C28(Item *, u8 , u8); void sub_8045BF8(u8 *, Item *); void DealDamageToEntity(Entity *,s16,u32,u32); void sub_806F480(Entity *, u32); -extern void sub_80421C0(Entity *, u32); void sub_804225C(Entity *, Position *, u8); void sub_8071DA4(Entity *); extern u8 sub_803F428(Position *pos); void sub_806A1E8(Entity *pokemon); -void sub_8049ED4(void); u8 sub_803D6FC(void); Entity *sub_8045684(u8, Position *, u8); extern void sub_807DF38(Entity *pokemon, Entity *target, Position *pos, u32, u8 moveType, s16); diff --git a/src/trap_1.c b/src/trap_1.c index 63a8161d6..58285376a 100644 --- a/src/trap_1.c +++ b/src/trap_1.c @@ -1,103 +1,14 @@ #include "global.h" -#include "structs/dungeon_entity.h" -#include "structs/map.h" -#include "trap.h" #include "code_803E668.h" +#include "code_8041AD0.h" #include "code_806CD90.h" -#include "code_8092334.h" #include "dungeon_map_access.h" -#include "items.h" #include "dungeon_util.h" -#include "structs/str_dungeon.h" -#include "structs/str_traps.h" +#include "items.h" -extern u8 gMisakiSan[]; -extern u8 gYayoiSan[]; +// TODO: Merge this file with trap.c after "HandlePokemonTrap" is in c -extern void WriteBytes(DataSerializer *, void *, s32); - -static void WriteDungeonTile(DataSerializer *r0, Tile *tile); -void sub_80830F8(void * , u32*); -void sub_808312C(void *, u16 *); -static void WriteDungeonWeather(DataSerializer *r0, Weather *weather); -void WriteU32(void *, u32); -void WriteBool8(void *, u8); -void WriteU16(void *, u16); -void SaveEntity(DataSerializer *param_1, Entity *); -void Write8Bytes(DataSerializer *param_1, u8 *); -void WriteDungeonItem(DataSerializer *param_1, Item *param_2); -void sub_8080B90(DataSerializer *param_1); -void WriteDungeonItems(DataSerializer *param_1); -void sub_8081454(DataSerializer *param_1); -void sub_808165C(DataSerializer *param_1); -void SaveDungeonMusic(DataSerializer *param_1); -void SaveTrapData(DataSerializer *param_1); -void sub_8080CF0(DataSerializer *param_1); -void nullsub_98(DataSerializer *param_1); -void InitByteWriter(DataSerializer *param_1, u8*, u32); -void sub_8049ED4(void); -void WriteU8(DataSerializer *param_1, u32); -void sub_80817F4(DataSerializer *param_1, u32 param_2); -void WriteS32(DataSerializer *param_1, u32); -void sub_808180C(DataSerializer *param_1, u32 param_2); -void WriteS16(DataSerializer *param_1, u32); -static void WriteJoinedAt(DataSerializer *param_1, JoinedAt *param_2); -void SaveActionContainer(DataSerializer *param_1, ActionContainer *param_2); -void sub_8081B34(DataSerializer *r0, s16 *r1); -void SaveEntityMoves(DataSerializer *r0, Moves *move); -void sub_8081824(DataSerializer *param_1, u32 param_2); -void sub_80817B0(DataSerializer *param_1, u32 param_2); -void WritePosition8(void*, Position *); -void SaveAITargetStatus(DataSerializer *param_1, AITarget* param_2); -void SaveIQFlags(DataSerializer *r0, u8 *r1); -void SaveSpeedStage(DataSerializer *param_1, s32 param_2); -void sub_8081854(DataSerializer *param_1, s32 param_2); -void sub_808183C(DataSerializer *param_1, s32 param_2); -void SaveMuzzledStatus(DataSerializer *param_1, Muzzled *param_2); -void SaveEyesightStatus(DataSerializer *param_1, EyesightStatus *param_2); -void SaveTransformStatus(DataSerializer *param_1, TransformStatus *param_2); -void SaveItemStatus(DataSerializer *param_1, ItemStatus *param_2); -void SaveMoveStatus(DataSerializer *param_1, MoveStatus* param_2); -void SaveLinkedStatus(DataSerializer *param_1, Linked *param_2); -void SaveVolatileStatus(DataSerializer *param_1, Volatile *param_2); -void SaveImmobilizeStatus(DataSerializer *param_1, Immobilize *param_2); -void SaveNonVolatileStatus(DataSerializer *param_1, NonVolatile *param_2); -void SaveEntitySleep(DataSerializer *param_1, Sleep* param_2); -void SaveTactic(DataSerializer *param_1, u8 param_2); -void SaveDungeonHiddenPower(DataSerializer *param_1, HiddenPower *param_2); -void SaveChargingStatus(DataSerializer *param_1, Charging *param_2); -void SaveProtectionStatus(DataSerializer *param_1, Protection *param_2); -void SaveWaitingStatus(DataSerializer *param_1, Waiting *param_2); -void xxx_WriteBytes(DataSerializer *param_1, u8 *speedCounters, u32 numCounters); -void SaveClientType(DataSerializer *param_1, u8 param_2); -void sub_80421C0(Entity *, u16); -void sub_804687C(Entity *, Position *, Position *, Item *, u32); -extern void sub_8083018(DataSerializer *, u8 *); -extern void sub_8081C50(DataSerializer *); -extern void sub_8081C7C(DataSerializer *); -extern void sub_8081F2C(DataSerializer *); -extern void RestoreDungeonMusic(DataSerializer *); -extern void RestoreItemData(DataSerializer *); -extern void RestoreTrapData(DataSerializer *); -extern void sub_808217C(DataSerializer *); -extern void InitByteReader(DataSerializer *param_1, u8 *r1, u32 r2); -extern void ReadBytes(DataSerializer *, void *, u32); -u8 ReadBool8(DataSerializer *r0); -u8 ReadU8(DataSerializer *r0); -s16 ReadS16(DataSerializer *r0); -void ReadPosition8(DataSerializer *r0, Position *); -void RestoreDungeonWeather(DataSerializer *r0, Weather *); -void sub_8083220(DataSerializer *r0, u32 *); -void sub_8083260(DataSerializer *r0, u16 *); -void RestoreTile(DataSerializer *r0, Tile *); -extern u16 ReadU16(DataSerializer *param_1); -void sub_80820A8(DataSerializer *r0, Item *); -void sub_80460F8(Position *, Item *, u32); -Entity *sub_8045684(u8, Position *, u8); -u32 sub_80831A0(DataSerializer *param_1); -void RestoreDungeonEntity(DataSerializer *param_1,bool8 isTeamMember,s32 index); - -extern u8 gYayoiSan[]; +extern void sub_804687C(Entity *, Position *, Position *, Item *, u32); void HandleTripTrap(Entity *pokemon, Entity *target) { @@ -137,882 +48,4 @@ void SetTrap(Tile *tile, u8 id) } sub_8049ED4(); } -} - - - - - -// TODO: New file here - - - - - -void WriteDungeonState(u8 *buffer, u32 bufLen) -{ - DataSerializer seri; - - InitByteWriter(&seri, buffer, bufLen); - - seri.unkC = 0; - WriteBytes(&seri, &seri.unkC, 4); - - sub_8080B90(&seri); - sub_8081454(&seri); - sub_808165C(&seri); - SaveDungeonMusic(&seri); - WriteDungeonItems(&seri); - SaveTrapData(&seri); - sub_8080CF0(&seri); - - Write8Bytes(&seri, gYayoiSan); - nullsub_98(&seri); -} - -void sub_8080B90(DataSerializer *param_1) -{ - Write8Bytes(param_1, gMisakiSan); - WriteBytes(param_1, &gDungeon->unk644, sizeof(unkDungeon644)); -} - -void WriteDungeonItems(DataSerializer *param_1) -{ - bool8 notEmpty; - Item *item; - Entity *entity; - int counter; - u8 emptyItem [5]; - - for (counter = 0; counter < 5; counter++) - emptyItem[counter] = 0; - - Write8Bytes(param_1, gMisakiSan); - - for (counter = 0; counter < DUNGEON_MAX_ITEMS; counter++) { - entity = gDungeon->items[counter]; - notEmpty = FALSE; - - if (entity != NULL && GetEntityType(entity) == ENTITY_ITEM) { - item = GetItemData(entity); - WriteDungeonItem(param_1, item); // 3 bytes - WriteBytes(param_1, &entity->pos.x, 1); // 1 byte - WriteBytes(param_1, &entity->pos.y, 1); // 1 byte - notEmpty = TRUE; - } - - if (!notEmpty) - WriteBytes(param_1, emptyItem, 5); - } -} - -void SaveTrapData(DataSerializer *param_1) -{ - bool8 flag; - Trap *trap; - Entity *entity; - int counter; - u8 local_1c [5]; - - for(counter = 0; counter < 5; counter++) - { - local_1c[counter] = -1; - } - Write8Bytes(param_1,gMisakiSan); - - for(counter = 0; counter < DUNGEON_MAX_TRAPS; counter++) - { - entity = gDungeon->traps[counter]; - flag = FALSE; - if ((entity != NULL) && (GetEntityType(entity) == ENTITY_TRAP)) { - trap = GetTrapData(entity); - WriteBytes(param_1,&trap->id,1); - WriteBytes(param_1,&trap->unk1,1); - WriteBytes(param_1,&entity->isVisible,1); - WriteBytes(param_1,&entity->pos.x,1); - WriteBytes(param_1,&entity->pos.y,1); - flag = TRUE; - } - if (!flag) { - WriteBytes(param_1,local_1c,5); - } - } -} - -void sub_8080CF0(DataSerializer *param_1) -{ - s32 counter; - - Write8Bytes(param_1,gMisakiSan); - WriteU32(param_1,gDungeon->unk37F0); - WriteU32(param_1,gDungeon->unk37F4); - WriteBool8(param_1,gDungeon->plusIsActive[0]); - WriteBool8(param_1,gDungeon->plusIsActive[1]); - WriteBool8(param_1,gDungeon->minusIsActive[0]); - WriteBool8(param_1,gDungeon->minusIsActive[1]); - WriteBool8(param_1,gDungeon->decoyActive); - WriteBool8(param_1,gDungeon->unk37FD); - WriteBool8(param_1,gDungeon->deoxysDefeat); - WriteBool8(param_1,gDungeon->unk37FF); - WriteU16(param_1,gDungeon->unk3800); - for(counter = 0; counter < MAX_TEAM_MEMBERS; counter++) - { - SaveEntity(param_1,gDungeon->teamPokemon[counter]); - } - for(counter = 0; counter < DUNGEON_MAX_WILD_POKEMON; counter++) - { - SaveEntity(param_1,gDungeon->wildPokemon[counter]); - } -} - -void SaveEntity(DataSerializer *param_1, Entity *param_2) -{ - Position *pos; - EntityInfo *info; - int counter; - EntityInfo info2; - u32 uStack_ac; - u32 uStack_a8; - HiddenPower *psStack_a4; - u8 *temp1; - u8 *temp2; - AITarget *temp3; - u8 *puStack_a0; - u32 *puStack_9c; - u32 *puStack_98; - u32 *puStack_94; - u8 *puStack_90; - Sleep *puStack_8c; - NonVolatile *puStack_88; - Immobilize *puStack_84; - Volatile *puStack_80; - Charging *puStack_7c; - Protection *puStack_78; - Waiting *puStack_74; - Linked *puStack_70; - MoveStatus *puStack_6c; - ItemStatus *puStack_68; - TransformStatus *puStack_64; - EyesightStatus *puStack_60; - Muzzled *pbStack_5c; - bool8 *pbStack_58; - bool8 *pbStack_54; - bool8 *pbStack_50; - bool8 *puStack_4c; - bool8 *pbStack_48; - bool8 *pbStack_44; - bool8 *pbStack_40; - bool8 *pbStack_3c; - u8 *puStack_38; - u8 *puStack_34; - bool8 *pbStack_30; - u8 *puStack_2c; - u8 *puStack_28; - u8 *puStack_24; - - - uStack_a8 = 0; - uStack_ac = 1; - WriteU8(param_1,0xaa); - WriteU8(param_1,0x55); - if (EntityExists(param_2)) { - info = GetEntInfo(param_2); - WriteBytes(param_1,&uStack_ac,1); - WriteBytes(param_1,¶m_2->pos.x,1); - WriteBytes(param_1,¶m_2->pos.y,1); - WriteBytes(param_1,¶m_2->isVisible,1); - WriteBytes(param_1,¶m_2->spawnGenID,2); - } - else { - memset(&info2,0,sizeof(EntityInfo)); - info = &info2; - WriteBytes(param_1,&uStack_a8,1); - WriteBytes(param_1,&uStack_a8,1); - WriteBytes(param_1,&uStack_a8,1); - WriteBytes(param_1,&uStack_a8,1); - WriteBytes(param_1,&uStack_a8,2); - } - WriteU16(param_1,info->flags); - sub_80817F4(param_1,info->apparentID); - sub_80817F4(param_1,info->id); - WriteBool8(param_1,info->isNotTeamMember); - WriteBool8(param_1,info->isTeamLeader); - WriteU8(param_1,info->shopkeeper); - WriteU8(param_1,info->level); - WriteU8(param_1,info->teamIndex); - WriteJoinedAt(param_1,&info->joinedAt); - WriteS16(param_1,info->IQ); - WriteS16(param_1,info->HP); - WriteS16(param_1,info->maxHPStat); - WriteS16(param_1,info->originalHP); - WriteU8(param_1,info->atk[0]); - WriteU8(param_1,info->atk[1]); - WriteU8(param_1,info->def[0]); - WriteU8(param_1,info->def[1]); - WriteU32(param_1,info->exp); - WriteS16(param_1,info->offensiveStages[0]); - WriteS16(param_1,info->offensiveStages[1]); - WriteS16(param_1,info->defensiveStages[0]); - WriteS16(param_1,info->defensiveStages[1]); - WriteS16(param_1,info->hitChanceStages[0]); - WriteS16(param_1,info->hitChanceStages[1]); - WriteS16(param_1,info->flashFireBoost); - WriteS32(param_1,info->offensiveMultipliers[0]); - WriteS32(param_1,info->offensiveMultipliers[1]); - WriteS32(param_1,info->defensiveMultipliers[0]); - WriteS32(param_1,info->defensiveMultipliers[1]); - SaveActionContainer(param_1,&info->action); - sub_808180C(param_1,info->types[0]); - sub_808180C(param_1,info->types[1]); - sub_8081824(param_1,info->abilities[0]); - sub_8081824(param_1,info->abilities[1]); - WriteDungeonItem(param_1,&info->heldItem); - sub_80817B0(param_1,info->unk64); - temp3 = &info->aiTarget; - temp2 = info->IQSkillMenuFlags; - temp1 = info->IQSkillFlags; - puStack_a0 = &info->tactic; - psStack_a4 = &info->hiddenPower; - puStack_9c = &info->unk98; - puStack_98 = &info->unk9C; - puStack_94 = &info->unkA0; - puStack_8c = &info->sleep; - puStack_88 = &info->nonVolatile; - puStack_84 = &info->immobilize; - puStack_80 = &info->volatileStatus; - puStack_7c = &info->charging; - puStack_78 = &info->protection; - puStack_74 = &info->waitingStruct; - puStack_70 = &info->linked; - puStack_6c = &info->moveStatus; - puStack_68 = &info->itemStatus; - puStack_64 = &info->transformStatus; - puStack_60 = &info->eyesightStatus; - pbStack_5c = &info->muzzled; - pbStack_58 = &info->powerEars; - pbStack_54 = &info->scanning; - pbStack_50 = &info->stairSpotter; - puStack_4c = &info->unkF3; - pbStack_48 = &info->grudge; - puStack_34 = &info->expMultiplier; - pbStack_44 = &info->exposed; - pbStack_40 = &info->isColorChanged; - pbStack_3c = &info->bossFlag; - puStack_38 = &info->terrifiedTurns; - pbStack_30 = &info->useHeldItem; - puStack_2c = &info->perishSongTurns; - puStack_28 = &info->unkFE; - puStack_24 = &info->unkFF; - puStack_90 = &info->clientType; - - pos = info->prevPos; - for(counter = 0; counter < NUM_PREV_POS; counter++) - { - WritePosition8(param_1,pos); - pos++; - } - - SaveAITargetStatus(param_1,temp3); - SaveIQFlags(param_1,temp2); - SaveIQFlags(param_1,temp1); - SaveTactic(param_1,*puStack_a0); - SaveDungeonHiddenPower(param_1,psStack_a4); - WriteU32(param_1,*puStack_9c); - WriteU32(param_1,*puStack_98); - WriteU32(param_1,*puStack_94); - SaveEntitySleep(param_1,puStack_8c); - SaveNonVolatileStatus(param_1,puStack_88); - SaveImmobilizeStatus(param_1,puStack_84); - SaveVolatileStatus(param_1,puStack_80); - SaveChargingStatus(param_1,puStack_7c); - SaveProtectionStatus(param_1,puStack_78); - SaveWaitingStatus(param_1,puStack_74); - SaveLinkedStatus(param_1,puStack_70); - SaveMoveStatus(param_1,puStack_6c); - SaveItemStatus(param_1,puStack_68); - SaveTransformStatus(param_1,puStack_64); - SaveEyesightStatus(param_1,puStack_60); - SaveMuzzledStatus(param_1,pbStack_5c); - WriteBool8(param_1,*pbStack_58); - WriteBool8(param_1,*pbStack_54); - WriteBool8(param_1,*pbStack_50); - WriteBool8(param_1,*puStack_4c); - WriteBool8(param_1,*pbStack_48); - WriteU8(param_1,*puStack_34); - WriteBool8(param_1,*pbStack_44); - WriteBool8(param_1,*pbStack_40); - WriteBool8(param_1,*pbStack_3c); - WriteU8(param_1,*puStack_38); - WriteBool8(param_1,*pbStack_30); - WriteU8(param_1,*puStack_2c); - WriteU8(param_1,*puStack_28); - sub_808183C(param_1,*puStack_24); - sub_8081854(param_1,info->targetingDecoy); - SaveSpeedStage(param_1,info->speedStage); - xxx_WriteBytes(param_1,info->speedUpCounters,NUM_SPEED_COUNTERS); - xxx_WriteBytes(param_1,info->speedDownCounters,NUM_SPEED_COUNTERS); - WriteU8(param_1,info->stockpileStage); - WriteU8(param_1,info->unk113); - WriteU8(param_1,(u8)info->moveRandomly); - SaveEntityMoves(param_1,&info->moves); - sub_8081B34(param_1,(s16 *)&info->belly); - sub_8081B34(param_1,(s16 *)&info->maxBelly); - WriteBool8(param_1,info->aiNextToTarget); - WriteBool8(param_1,info->recalculateFollow); - WriteBool8(param_1,info->waiting); - WriteBool8(param_1,info->unk146); - WriteBool8(param_1,info->attacking); - WriteBool8(param_1,info->unk149); - WriteBool8(param_1,info->unk14A); - WriteBool8(param_1,info->unk14B); - WriteBool8(param_1,info->unk14C); - WriteU16(param_1,info->visualFlags); - WriteU16(param_1,info->previousVisualFlags); - WriteBool8(param_1,info->unk152); - WriteU8(param_1,info->unk153); - WriteBool8(param_1,info->unk154); - WriteBool8(param_1,info->unk155); - WriteBool8(param_1,info->unk156); - WriteU8(param_1,info->unk164); - WriteU8(param_1,info->unk165); - WriteU8(param_1,info->unk166); - WriteU8(param_1,info->unk167); - WriteU8(param_1,info->unk168); - WriteU8(param_1,info->turnsSinceWarpScarfActivation); - WritePosition8(param_1,&(info->targetPos)); - WriteS32(param_1,info->unk174); - WriteU16(param_1,info->abilityEffectFlags); - WriteS16(param_1,info->unk1F8); - WriteS16(param_1,info->mobileTurnTimer); - WriteU32(param_1,info->expGainedInTurn); - SaveClientType(param_1,*puStack_90); -} - -void sub_8081454(DataSerializer *param_1) -{ - int iVar1; - int iVar2; - int iVar4; - - Write8Bytes(param_1,gMisakiSan); - WriteBool8(param_1, gDungeon->unk3A08); - WriteBool8(param_1, gDungeon->unk3A09); - WriteBool8(param_1, gDungeon->unk3A0A); - WriteBool8(param_1, gDungeon->unk3A0B); - WriteU8(param_1, gDungeon->unk3A0C); - WriteU8(param_1, gDungeon->unk3A0D); - WriteS16(param_1, gDungeon->tileset); - WriteS16(param_1,gDungeon->unk3A10); - WriteS16(param_1, gDungeon->unk3A12); - WriteS16(param_1, gDungeon->bossBattleIndex); - WriteS16(param_1, gDungeon->unk3A16); - for(iVar1 = 0; iVar1 < DUNGEON_MAX_SIZE_Y; iVar1++) - { - - for(iVar2 = 0; iVar2 < DUNGEON_MAX_SIZE_X; iVar2++) - { - WriteDungeonTile(param_1,&gDungeon->tiles[iVar1][iVar2]); - } - } - - - WritePosition8(param_1,&gDungeon->unkE218); - WritePosition8(param_1,&gDungeon->unkE21C); - - - - for(iVar4 = 0; iVar4 < 8; iVar4++) - { - WritePosition8(param_1,&gDungeon->unkE220[iVar4]); - } - sub_80830F8(param_1, gDungeon->unkE240); - sub_80830F8(param_1, gDungeon->unkE250); - sub_808312C(param_1, gDungeon->unkE260); - - for(iVar1 = 0; iVar1 < 8; iVar1++) - { - for(iVar2 = 0; iVar2 < 8; iVar2++) - { - WriteDungeonTile(param_1, &gDungeon->unkE27C[iVar1][iVar2]); - WriteU8(param_1, gDungeon->unkE87C[iVar1][iVar2]); - } - } - WriteDungeonWeather(param_1,&gDungeon->weather); -} - -void sub_808165C(DataSerializer *param_1) -{ - - Write8Bytes(param_1,gMisakiSan); - WriteU8(param_1, gDungeon->unk181e8.unk18208); - WriteU8(param_1, gDungeon->unk181e8.visibilityRange); - WriteBool8(param_1, gDungeon->unk181e8.blinded); - WriteBool8(param_1, gDungeon->unk181e8.unk1820B); - WriteBool8(param_1, gDungeon->unk181e8.unk1820C); - WriteBool8(param_1, gDungeon->unk181e8.unk1820D); - WriteBool8(param_1, gDungeon->unk181e8.unk1820E); - WriteBool8(param_1, gDungeon->unk181e8.unk1820F); - WriteBool8(param_1, gDungeon->unk181e8.hallucinating); - WriteBool8(param_1, gDungeon->unk181e8.unk18211); - WriteBool8(param_1, gDungeon->unk181e8.unk18213); -} - -// NOTE: forcing this s16 for now - Seth -void SaveDungeonMusic(DataSerializer *param_1) -{ - WriteS16(param_1, (s16)gDungeon->musPlayer.songIndex); - WriteS16(param_1, (s16)gDungeon->musPlayer.pastSongIndex); - WriteS16(param_1, (s16)gDungeon->musPlayer.queuedSongIndex); -} - -void WriteDungeonItem(DataSerializer *param_1, Item *param_2) -{ - WriteBytes(param_1, ¶m_2->flags, 1); - WriteBytes(param_1, ¶m_2->quantity, 1); - WriteBytes(param_1, ¶m_2->id, 1); -} - -void sub_80817B0(DataSerializer *param_1, u32 param_2) -{ - u8 stack; - stack = param_2; - WriteBytes(param_1, &stack, 1); -} - -void SaveActionContainer(DataSerializer *param_1, ActionContainer *param_2) -{ - WriteBytes(param_1, ¶m_2->direction, 1); - WriteBytes(param_1, ¶m_2->itemTargetPosition.x, 1); - WriteBytes(param_1, ¶m_2->itemTargetPosition.y, 1); -} - -void sub_80817F4(DataSerializer *param_1, u32 param_2) -{ - u16 stack; - stack = param_2; - WriteBytes(param_1, &stack, 2); -} - -void sub_808180C(DataSerializer *param_1, u32 param_2) -{ - u8 stack; - stack = param_2; - WriteBytes(param_1, &stack, 1); -} - -void sub_8081824(DataSerializer *param_1, u32 param_2) -{ - u8 stack; - stack = param_2; - WriteBytes(param_1, &stack, 1); -} - -void sub_808183C(DataSerializer *param_1, s32 param_2) -{ - u8 stack; - stack = param_2; - WriteBytes(param_1, &stack, 1); -} - -void sub_8081854(DataSerializer *param_1, s32 param_2) -{ - u8 stack; - stack = param_2; - WriteBytes(param_1, &stack, 1); -} - -void SaveSpeedStage(DataSerializer *param_1, s32 param_2) -{ - WriteBytes(param_1, ¶m_2, 4); -} - -void SaveTactic(DataSerializer *param_1, u8 param_2) -{ - WriteBytes(param_1, ¶m_2, 1); -} - -void SaveDungeonHiddenPower(DataSerializer *param_1, HiddenPower *param_2) -{ - WriteS16(param_1, param_2->hiddenPowerBasePower); - sub_808180C(param_1, param_2->hiddenPowerType); -} - -void SaveClientType(DataSerializer *param_1, u8 param_2) -{ - WriteU8(param_1, param_2); -} - -static void WriteJoinedAt(DataSerializer *param_1, JoinedAt *param_2) -{ - WriteU8(param_1, param_2->joinedAt); - WriteU8(param_1, param_2->unk1); -} - -void SaveAITargetStatus(DataSerializer *param_1, AITarget* param_2) -{ - WriteBytes(param_1, ¶m_2->aiObjective, 1); - WriteBool8(param_1, param_2->aiNotNextToTarget); - WriteBool8(param_1, param_2->aiTargetingEnemy); - WriteBool8(param_1, param_2->aiTurningAround); - WriteU16(param_1, param_2->aiTargetSpawnGenID); - WritePosition8(param_1, ¶m_2->aiTargetPos); -} - -void SaveEntitySleep(DataSerializer *param_1, Sleep* param_2) -{ - WriteBytes(param_1, ¶m_2->sleep, 1); - WriteU8(param_1, param_2->sleepTurns); -} - -void SaveNonVolatileStatus(DataSerializer *param_1, NonVolatile *param_2) -{ - WriteBytes(param_1, ¶m_2->nonVolatileStatus, 1); - WriteU8(param_1, param_2->nonVolatileStatusTurns); - WriteU8(param_1, param_2->nonVolatileStatusDamageCountdown); - WriteU8(param_1, param_2->unk4); -} - -void SaveImmobilizeStatus(DataSerializer *param_1, Immobilize *param_2) -{ - WriteBytes(param_1, ¶m_2->immobilizeStatus, 1); - WriteU8(param_1, param_2->immobilizeStatusTurns); - WriteU8(param_1, param_2->immobilizeStatusDamageCountdown); - WriteU32(param_1, param_2->unk4); -} - -void SaveVolatileStatus(DataSerializer *param_1, Volatile *param_2) -{ - WriteBytes(param_1, ¶m_2->volatileStatus, 1); - WriteU8(param_1, param_2->volatileStatusTurns); -} - -void SaveChargingStatus(DataSerializer *param_1, Charging *param_2) -{ - WriteBytes(param_1, ¶m_2->chargingStatus, 1); - WriteU8(param_1, param_2->chargingStatusTurns); - WriteU8(param_1, param_2->chargingStatusMoveIndex); -} - -void SaveProtectionStatus(DataSerializer *param_1, Protection *param_2) -{ - WriteBytes(param_1, ¶m_2->protectionStatus, 1); - WriteU8(param_1, param_2->protectionStatusTurns); -} - -void SaveWaitingStatus(DataSerializer *param_1, Waiting *param_2) -{ - WriteBytes(param_1, ¶m_2->waitingStatus, 1); - WriteBool8(param_1, param_2->enemyDecoy); - WriteBool8(param_1, param_2->unkCA); - WriteU8(param_1, param_2->waitingStatusTurns); - WriteU8(param_1, param_2->curseDamageCountdown); -} - -void SaveLinkedStatus(DataSerializer *param_1, Linked *param_2) -{ - WriteBytes(param_1, ¶m_2->linkedStatus, 1); - WriteU32(param_1, param_2->unkD4); - WriteU8(param_1, param_2->unkD8); - WriteU8(param_1, param_2->linkedStatusTurns); - WriteU8(param_1, param_2->linkedStatusDamageCountdown); -} - -void SaveMoveStatus(DataSerializer *param_1, MoveStatus* param_2) -{ - WriteBytes(param_1, ¶m_2->moveStatus, 1); - WriteU8(param_1, param_2->moveStatusTurns); -} - -void SaveItemStatus(DataSerializer *param_1, ItemStatus *param_2) -{ - WriteBytes(param_1, ¶m_2->itemStatus, 1); -} - -void SaveTransformStatus(DataSerializer *param_1, TransformStatus *param_2) -{ - WriteBytes(param_1, ¶m_2->transformStatus, 1); - WriteU8(param_1, param_2->transformStatusTurns); -} - -void SaveEyesightStatus(DataSerializer *param_1, EyesightStatus *param_2) -{ - WriteBytes(param_1, ¶m_2->eyesightStatus, 1); - WriteU8(param_1, param_2->eyesightStatusTurns); -} - -void SaveMuzzledStatus(DataSerializer *param_1, Muzzled *param_2) -{ - WriteBytes(param_1, ¶m_2->muzzled, 1); - WriteU8(param_1, param_2->muzzledTurns); -} - -void SaveEntityMove(DataSerializer *r0, Move *r1) -{ - WriteU8(r0, r1->moveFlags); - WriteU8(r0, r1->moveFlags2); - WriteBytes(r0, &r1->id, 2); - WriteU8(r0, r1->PP); - WriteU8(r0, r1->ginseng); -} - -void SaveEntityMoves(DataSerializer *r0, Moves *move) -{ - s32 i; - - for (i = 0; i < MAX_MON_MOVES; i++) - SaveEntityMove(r0, &move->moves[i]); - - WriteU8(r0, move->struggleMoveFlags); -} - -void sub_8081B34(DataSerializer *r0, s16 *r1) -{ - WriteS16(r0, r1[0]); - WriteS16(r0, r1[1]); -} - -void SaveIQFlags(DataSerializer *r0, u8 *r1) -{ - WriteBytes(r0, r1, NUM_PICKED_IQ_SKILLS); -} - -static void WriteDungeonTile(DataSerializer *r0, Tile *tile) -{ - WriteU16(r0, tile->terrainType); - WriteU16(r0, tile->unk4); - WriteBytes(r0, &tile->room, 1); - WriteBytes(r0, &tile->unkE, 1); -} - -static void WriteDungeonWeather(DataSerializer *r0, Weather *weather) -{ - s32 i; - - WriteBytes(r0, &weather->weather, 1); - WriteBytes(r0, &weather->unkE265, 1); - - for (i = 0; i < 8; i++) { - WriteU8(r0, weather->unkE267[i]); - WriteU8(r0, weather->naturalWeather[i]); - } - - WriteU8(r0, weather->weatherDamageCounter); - WriteU8(r0, weather->mudSportTurns); - WriteU8(r0, weather->waterSportTurns); - WriteBool8(r0, weather->nullifyWeather); -} - -// Read func - -void ReadDungeonState(u8 *buffer, u32 bufLen) -{ - DataSerializer seri; - - InitByteReader(&seri, buffer, bufLen); - - ReadBytes(&seri, &seri.unkC, 4); - sub_8081C50(&seri); - sub_8081C7C(&seri); - sub_8081F2C(&seri); - RestoreDungeonMusic(&seri); - RestoreItemData(&seri); - RestoreTrapData(&seri); - sub_808217C(&seri); - - sub_8083018(&seri, gYayoiSan); - nullsub_98(&seri); -} - -void sub_8081C50(DataSerializer *r0) -{ - sub_8083018(r0, gMisakiSan); - ReadBytes(r0, &gDungeon->unk644, sizeof(unkDungeon644)); -} - -void sub_8081C7C(DataSerializer *r0) -{ - int x; - int y; - s32 iVar7; - - sub_8083018(r0,gMisakiSan); - gDungeon->unk3A08 = ReadBool8(r0); - gDungeon->unk3A09 = ReadBool8(r0); - gDungeon->unk3A0A = ReadBool8(r0); - gDungeon->unk3A0B = ReadBool8(r0); - gDungeon->unk3A0C = ReadU8(r0); - gDungeon->unk3A0D = ReadU8(r0); - gDungeon->tileset = ReadS16(r0); - gDungeon->unk3A10 = ReadS16(r0); - gDungeon->unk3A12 = ReadS16(r0); - gDungeon->bossBattleIndex = ReadS16(r0); - gDungeon->unk3A16 = ReadS16(r0); - - for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) - { - for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) - { - RestoreTile(r0,&gDungeon->tiles[y][x]); - } - } - ReadPosition8(r0,&gDungeon->unkE218); - ReadPosition8(r0,&gDungeon->unkE21C); - - for(iVar7 = 0; iVar7 < 8; iVar7++) - { - ReadPosition8(r0,&gDungeon->unkE220[iVar7]); - } - sub_8083220(r0, gDungeon->unkE240); - sub_8083220(r0, gDungeon->unkE250); - sub_8083260(r0, gDungeon->unkE260); - - - for(y = 0; y < 8; y++) - { - for(x = 0; x < 8; x++) - { - RestoreTile(r0,&gDungeon->unkE27C[y][x]); - gDungeon->unkE87C[y][x] = ReadU8(r0); - } - } - RestoreDungeonWeather(r0,&gDungeon->weather); -} - -void RestoreTile(DataSerializer *r0, Tile *tile) -{ - memset(tile, 0, sizeof(Tile)); - tile->terrainType = ReadU16(r0); - tile->unk4 = ReadU16(r0); - - ReadBytes(r0, (u32 *)&tile->room, 1); - ReadBytes(r0, (u32 *)&tile->unkE, 1); - - tile->monster = NULL; - tile->object = NULL; -} - -void RestoreDungeonWeather(DataSerializer *r0, Weather *weather) -{ - s32 index; - memset(weather, 0, sizeof(Weather)); - ReadBytes(r0, (u32 *)&weather->weather, 1); - ReadBytes(r0, (u32 *)&weather->unkE265, 1); - for(index = 0; index < 8; index++) - { - weather->unkE267[index] = ReadU8(r0); - weather->naturalWeather[index] = ReadU8(r0); - } - weather->weatherDamageCounter = ReadU8(r0); - weather->mudSportTurns = ReadU8(r0); - weather->waterSportTurns = ReadU8(r0); - weather->nullifyWeather = ReadBool8(r0); -} - -void sub_8081F2C(DataSerializer *param_1) -{ - sub_8083018(param_1,gMisakiSan); - gDungeon->unk181e8.cameraTarget = NULL; - gDungeon->unk181e8.unk18208 = ReadU8(param_1); - gDungeon->unk181e8.visibilityRange = ReadU8(param_1); - gDungeon->unk181e8.blinded = ReadBool8(param_1); - gDungeon->unk181e8.unk1820B = ReadBool8(param_1); - gDungeon->unk181e8.unk1820C = ReadBool8(param_1); - gDungeon->unk181e8.unk1820D = ReadBool8(param_1); - gDungeon->unk181e8.unk1820E = ReadBool8(param_1); - gDungeon->unk181e8.unk1820F = ReadBool8(param_1); - gDungeon->unk181e8.hallucinating = ReadBool8(param_1); - gDungeon->unk181e8.unk18211 = ReadBool8(param_1); - gDungeon->unk181e8.unk18213 = ReadBool8(param_1); -} - -void RestoreDungeonMusic(DataSerializer *r0) -{ - gDungeon->musPlayer.songIndex = ReadS16(r0); - gDungeon->musPlayer.pastSongIndex = ReadS16(r0); - gDungeon->musPlayer.queuedSongIndex = ReadS16(r0); -} - -void RestoreItemData(DataSerializer *r0) { - s32 index; - Item item; - Position pos; - sub_8083018(r0, gMisakiSan); - for(index = 0; index < DUNGEON_MAX_ITEMS; index++) - { - sub_80820A8(r0, &item); - ReadPosition8(r0, &pos); - if(item.flags & ITEM_FLAG_EXISTS) - sub_80460F8(&pos, &item, 0); - } -} - -void sub_80820A8(DataSerializer *param_1, Item *item) -{ - memset(item, 0, sizeof(Item)); - ReadBytes(param_1,(u32 *)&item->flags,1); - ReadBytes(param_1,(u32 *)&item->quantity,1); - ReadBytes(param_1,(u32 *)&item->id,1); -} - - -void RestoreTrapData(DataSerializer *param_1) -{ - int counter; - Tile *tile; - Entity *entity; - Position pos; - u8 isVisible; - u8 unk1; - u8 trapID; - - sub_8083018(param_1, gMisakiSan); - - for(counter = 0; counter < DUNGEON_MAX_TRAPS; counter++) - { - trapID = 6; - unk1 = 0; - ReadBytes(param_1,(u32 *)&trapID,1); - ReadBytes(param_1,(u32 *)&unk1,1); - isVisible = ReadBool8(param_1); - ReadPosition8(param_1, &pos); - - if(trapID != 0xFF) - { - tile = GetTileSafe(pos.x, pos.y); - entity = sub_8045684(trapID, &pos, unk1); - if(entity) - { - tile->object = entity; - entity->isVisible = isVisible; - } - } - } -} - -void sub_808217C(DataSerializer *param_1) -{ - s32 counter; - - sub_8083018(param_1,gMisakiSan); - gDungeon->unk37F0 = sub_80831A0(param_1); - gDungeon->unk37F4 = sub_80831A0(param_1); - gDungeon->plusIsActive[0] = ReadBool8(param_1); - gDungeon->plusIsActive[1] = ReadBool8(param_1); - gDungeon->minusIsActive[0] = ReadBool8(param_1); - gDungeon->minusIsActive[1] = ReadBool8(param_1); - gDungeon->decoyActive = ReadBool8(param_1); - gDungeon->unk37FD = ReadBool8(param_1); - gDungeon->deoxysDefeat = ReadBool8(param_1); - gDungeon->unk37FF = ReadBool8(param_1); - gDungeon->unk3800 = ReadU16(param_1); - for(counter = 0; counter < MAX_TEAM_MEMBERS; counter++) - { - RestoreDungeonEntity(param_1, TRUE, counter); - } - for(counter = 0; counter < DUNGEON_MAX_WILD_POKEMON; counter++) - { - RestoreDungeonEntity(param_1, FALSE, counter); - } -} - -// RestoreDungeonEntity should be here \ No newline at end of file +} \ No newline at end of file diff --git a/sym_ewram2.txt b/sym_ewram2.txt index 4bebc1662..d92c28e28 100644 --- a/sym_ewram2.txt +++ b/sym_ewram2.txt @@ -225,7 +225,7 @@ gUnknown_203B40C: /* 203B40C (sub_803E46C - PrintFieldMessage) */ gUnknown_203B40D: /* 203B40D (sub_803E250 - sub_807E698) */ .space 0x3 -gUnknown_203B410: /* 203B410 (sub_8040150 - RestoreDungeonEntity) */ +gUnknown_203B410: /* 203B410 (sub_8040150 - ReadMonster) */ .space 0x4 .include "src/code_8042B34.o" @@ -258,7 +258,7 @@ gUnknown_203B43C: /* 203B43C (sub_8065FB4) */ gUnknown_203B444: /* 203B444 (sub_807DF38) */ .space 0xC -gLeaderPointer: /* 203B450 (xxx_dungeon_8042F6C - RestoreDungeonEntity) */ +gLeaderPointer: /* 203B450 (xxx_dungeon_8042F6C - ReadMonster) */ .space 0x4 .include "src/dungeon_random.o" From c3cd344ad92b90f1de320f6d7a68839fb8514a3a Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sun, 10 Nov 2024 18:33:47 -0500 Subject: [PATCH 24/48] Fix WriteMonster weirdmatch --- src/dungeon_serializer.c | 320 +++++++++++++++------------------------ 1 file changed, 123 insertions(+), 197 deletions(-) diff --git a/src/dungeon_serializer.c b/src/dungeon_serializer.c index c83df6003..384165657 100644 --- a/src/dungeon_serializer.c +++ b/src/dungeon_serializer.c @@ -249,227 +249,153 @@ static void WriteDungeonMonsters(DataSerializer *seri) WriteMonster(seri, gDungeon->wildPokemon[i]); } -// TODO: Rewrite like ReadMonster static void WriteMonster(DataSerializer *seri, Entity *src) { - Position *pos; EntityInfo *info; - s32 counter; - EntityInfo info2; - u32 uStack_ac; - u32 uStack_a8; - HiddenPower *psStack_a4; - u8 *temp1; - u8 *temp2; - AITarget *temp3; - u8 *puStack_a0; - u32 *puStack_9c; - u32 *puStack_98; - u32 *puStack_94; - u8 *puStack_90; - Sleep *puStack_8c; - NonVolatile *puStack_88; - Immobilize *puStack_84; - Volatile *puStack_80; - Charging *puStack_7c; - Protection *puStack_78; - Waiting *puStack_74; - Linked *puStack_70; - MoveStatus *puStack_6c; - ItemStatus *puStack_68; - TransformStatus *puStack_64; - EyesightStatus *puStack_60; - Muzzled *pbStack_5c; - bool8 *pbStack_58; - bool8 *pbStack_54; - bool8 *pbStack_50; - bool8 *puStack_4c; - bool8 *pbStack_48; - bool8 *pbStack_44; - bool8 *pbStack_40; - bool8 *pbStack_3c; - u8 *puStack_38; - u8 *puStack_34; - bool8 *pbStack_30; - u8 *puStack_2c; - u8 *puStack_28; - u8 *puStack_24; + s32 i; + EntityInfo blankInfo; + u32 one; + u32 zero; + zero = 0; + one = 1; + + WriteU8(seri, 0xAA); + WriteU8(seri, 0x55); - uStack_a8 = 0; - uStack_ac = 1; - WriteU8(seri,0xaa); - WriteU8(seri,0x55); if (EntityExists(src)) { info = GetEntInfo(src); - WriteBytes(seri,&uStack_ac,1); - WriteBytes(seri,&src->pos.x,1); - WriteBytes(seri,&src->pos.y,1); - WriteBytes(seri,&src->isVisible,1); - WriteBytes(seri,&src->spawnGenID,2); + WriteBytes(seri, &one, 1); + WriteBytes(seri, &src->pos.x, 1); + WriteBytes(seri, &src->pos.y, 1); + WriteBytes(seri, &src->isVisible, 1); + WriteBytes(seri, &src->spawnGenID, 2); } else { - memset(&info2,0,sizeof(EntityInfo)); - info = &info2; - WriteBytes(seri,&uStack_a8,1); - WriteBytes(seri,&uStack_a8,1); - WriteBytes(seri,&uStack_a8,1); - WriteBytes(seri,&uStack_a8,1); - WriteBytes(seri,&uStack_a8,2); + memset(&blankInfo, 0, sizeof(EntityInfo)); + + info = &blankInfo; + WriteBytes(seri, &zero, 1); + WriteBytes(seri, &zero, 1); + WriteBytes(seri, &zero, 1); + WriteBytes(seri, &zero, 1); + WriteBytes(seri, &zero, 2); } - WriteU16(seri,info->flags); - WriteMonsterID(seri,info->apparentID); - WriteMonsterID(seri,info->id); - WriteBool8(seri,info->isNotTeamMember); - WriteBool8(seri,info->isTeamLeader); - WriteU8(seri,info->shopkeeper); - WriteU8(seri,info->level); - WriteU8(seri,info->teamIndex); - WriteJoinedAt(seri,&info->joinedAt); - WriteS16(seri,info->IQ); - WriteS16(seri,info->HP); - WriteS16(seri,info->maxHPStat); - WriteS16(seri,info->originalHP); - WriteU8(seri,info->atk[0]); - WriteU8(seri,info->atk[1]); - WriteU8(seri,info->def[0]); - WriteU8(seri,info->def[1]); - WriteU32(seri,info->exp); - WriteS16(seri,info->offensiveStages[0]); - WriteS16(seri,info->offensiveStages[1]); - WriteS16(seri,info->defensiveStages[0]); - WriteS16(seri,info->defensiveStages[1]); - WriteS16(seri,info->hitChanceStages[0]); - WriteS16(seri,info->hitChanceStages[1]); - WriteS16(seri,info->flashFireBoost); - WriteS32(seri,info->offensiveMultipliers[0]); - WriteS32(seri,info->offensiveMultipliers[1]); - WriteS32(seri,info->defensiveMultipliers[0]); - WriteS32(seri,info->defensiveMultipliers[1]); - WriteActionContainer(seri,&info->action); - WriteType(seri,info->types[0]); - WriteType(seri,info->types[1]); - WriteAbility(seri,info->abilities[0]); - WriteAbility(seri,info->abilities[1]); - WriteItem(seri,&info->heldItem); + + WriteU16(seri, info->flags); + WriteMonsterID(seri, info->apparentID); + WriteMonsterID(seri, info->id); + WriteBool8(seri, info->isNotTeamMember); + WriteBool8(seri, info->isTeamLeader); + WriteU8(seri, info->shopkeeper); + WriteU8(seri, info->level); + WriteU8(seri, info->teamIndex); + WriteJoinedAt(seri, &info->joinedAt); + WriteS16(seri, info->IQ); + WriteS16(seri, info->HP); + WriteS16(seri, info->maxHPStat); + WriteS16(seri, info->originalHP); + WriteU8(seri, info->atk[0]); + WriteU8(seri, info->atk[1]); + WriteU8(seri, info->def[0]); + WriteU8(seri, info->def[1]); + WriteU32(seri, info->exp); + WriteS16(seri, info->offensiveStages[0]); + WriteS16(seri, info->offensiveStages[1]); + WriteS16(seri, info->defensiveStages[0]); + WriteS16(seri, info->defensiveStages[1]); + WriteS16(seri, info->hitChanceStages[0]); + WriteS16(seri, info->hitChanceStages[1]); + WriteS16(seri, info->flashFireBoost); + WriteS32(seri, info->offensiveMultipliers[0]); + WriteS32(seri, info->offensiveMultipliers[1]); + WriteS32(seri, info->defensiveMultipliers[0]); + WriteS32(seri, info->defensiveMultipliers[1]); + WriteActionContainer(seri, &info->action); + WriteType(seri, info->types[0]); + WriteType(seri, info->types[1]); + WriteAbility(seri, info->abilities[0]); + WriteAbility(seri, info->abilities[1]); + WriteItem(seri, &info->heldItem); WriteMonsterUnk64(seri, info->unk64); - temp3 = &info->aiTarget; - temp2 = info->IQSkillMenuFlags; - temp1 = info->IQSkillFlags; - puStack_a0 = &info->tactic; - psStack_a4 = &info->hiddenPower; - puStack_9c = &info->unk98; - puStack_98 = &info->unk9C; - puStack_94 = &info->unkA0; - puStack_8c = &info->sleep; - puStack_88 = &info->nonVolatile; - puStack_84 = &info->immobilize; - puStack_80 = &info->volatileStatus; - puStack_7c = &info->charging; - puStack_78 = &info->protection; - puStack_74 = &info->waitingStruct; - puStack_70 = &info->linked; - puStack_6c = &info->moveStatus; - puStack_68 = &info->itemStatus; - puStack_64 = &info->transformStatus; - puStack_60 = &info->eyesightStatus; - pbStack_5c = &info->muzzled; - pbStack_58 = &info->powerEars; - pbStack_54 = &info->scanning; - pbStack_50 = &info->stairSpotter; - puStack_4c = &info->unkF3; - pbStack_48 = &info->grudge; - puStack_34 = &info->expMultiplier; - pbStack_44 = &info->exposed; - pbStack_40 = &info->isColorChanged; - pbStack_3c = &info->bossFlag; - puStack_38 = &info->terrifiedTurns; - pbStack_30 = &info->useHeldItem; - puStack_2c = &info->perishSongTurns; - puStack_28 = &info->unkFE; - puStack_24 = &info->unkFF; - puStack_90 = &info->clientType; - pos = info->prevPos; - for (counter = 0; counter < NUM_PREV_POS; counter++) { - WriteTilePos(seri, pos); - pos++; - } + for (i = 0; i < NUM_PREV_POS; i++) + WriteTilePos(seri, &info->prevPos[i]); - WriteAITarget(seri,temp3); - WriteIQSkills(seri,temp2); - WriteIQSkills(seri,temp1); - WriteTactic(seri,*puStack_a0); - WriteHiddenPower(seri,psStack_a4); - WriteU32(seri,*puStack_9c); - WriteU32(seri,*puStack_98); - WriteU32(seri,*puStack_94); - WriteSleep(seri,puStack_8c); - WriteNonVolatile(seri,puStack_88); - WriteImmobilize(seri,puStack_84); - WriteVolatile(seri,puStack_80); - WriteCharging(seri,puStack_7c); - WriteProtection(seri,puStack_78); - WriteWaiting(seri,puStack_74); - WriteLinked(seri,puStack_70); - WriteMoveStatus(seri,puStack_6c); - WriteItemStatus(seri,puStack_68); - WriteTransformStatus(seri,puStack_64); - WriteEyesightStatus(seri,puStack_60); - WriteMuzzled(seri,pbStack_5c); - WriteBool8(seri,*pbStack_58); - WriteBool8(seri,*pbStack_54); - WriteBool8(seri,*pbStack_50); - WriteBool8(seri,*puStack_4c); - WriteBool8(seri,*pbStack_48); - WriteU8(seri,*puStack_34); - WriteBool8(seri,*pbStack_44); - WriteBool8(seri,*pbStack_40); - WriteBool8(seri,*pbStack_3c); - WriteU8(seri,*puStack_38); - WriteBool8(seri,*pbStack_30); - WriteU8(seri,*puStack_2c); - WriteU8(seri,*puStack_28); - WriteMonsterUnkFF(seri,*puStack_24); - WriteTargetingDecoy(seri,info->targetingDecoy); - WriteSpeedStage(seri,info->speedStage); - WriteSpeedCounters(seri,info->speedUpCounters,NUM_SPEED_COUNTERS); - WriteSpeedCounters(seri,info->speedDownCounters,NUM_SPEED_COUNTERS); + WriteAITarget(seri, &info->aiTarget); + WriteIQSkills(seri, info->IQSkillMenuFlags); + WriteIQSkills(seri, info->IQSkillFlags); + WriteTactic(seri, info->tactic); + WriteHiddenPower(seri, &info->hiddenPower); + WriteU32(seri, info->unk98); + WriteU32(seri, info->unk9C); + WriteU32(seri, info->unkA0); + WriteSleep(seri, &info->sleep); + WriteNonVolatile(seri, &info->nonVolatile); + WriteImmobilize(seri, &info->immobilize); + WriteVolatile(seri, &info->volatileStatus); + WriteCharging(seri, &info->charging); + WriteProtection(seri, &info->protection); + WriteWaiting(seri, &info->waitingStruct); + WriteLinked(seri, &info->linked); + WriteMoveStatus(seri, &info->moveStatus); + WriteItemStatus(seri, &info->itemStatus); + WriteTransformStatus(seri, &info->transformStatus); + WriteEyesightStatus(seri, &info->eyesightStatus); + WriteMuzzled(seri, &info->muzzled); + WriteBool8(seri, info->powerEars); + WriteBool8(seri, info->scanning); + WriteBool8(seri, info->stairSpotter); + WriteBool8(seri, info->unkF3); + WriteBool8(seri, info->grudge); + WriteU8(seri, info->expMultiplier); + WriteBool8(seri, info->exposed); + WriteBool8(seri, info->isColorChanged); + WriteBool8(seri, info->bossFlag); + WriteU8(seri, info->terrifiedTurns); + WriteBool8(seri, info->useHeldItem); + WriteU8(seri, info->perishSongTurns); + WriteU8(seri, info->unkFE); + WriteMonsterUnkFF(seri, info->unkFF); + WriteTargetingDecoy(seri, info->targetingDecoy); + WriteSpeedStage(seri, info->speedStage); + WriteSpeedCounters(seri, info->speedUpCounters, NUM_SPEED_COUNTERS); + WriteSpeedCounters(seri, info->speedDownCounters, NUM_SPEED_COUNTERS); WriteU8(seri, info->stockpileStage); WriteU8(seri, info->unk113); WriteU8(seri, info->moveRandomly); WriteMoves(seri, &info->moves); WriteBelly(seri, &info->belly); WriteBelly(seri, &info->maxBelly); - WriteBool8(seri,info->aiNextToTarget); - WriteBool8(seri,info->recalculateFollow); - WriteBool8(seri,info->waiting); - WriteBool8(seri,info->unk146); - WriteBool8(seri,info->attacking); - WriteBool8(seri,info->unk149); - WriteBool8(seri,info->unk14A); - WriteBool8(seri,info->unk14B); - WriteBool8(seri,info->unk14C); - WriteU16(seri,info->visualFlags); - WriteU16(seri,info->previousVisualFlags); - WriteBool8(seri,info->unk152); - WriteU8(seri,info->unk153); - WriteBool8(seri,info->unk154); - WriteBool8(seri,info->unk155); - WriteBool8(seri,info->unk156); - WriteU8(seri,info->unk164); - WriteU8(seri,info->unk165); - WriteU8(seri,info->unk166); - WriteU8(seri,info->unk167); - WriteU8(seri,info->unk168); - WriteU8(seri,info->turnsSinceWarpScarfActivation); - WriteTilePos(seri,&(info->targetPos)); + WriteBool8(seri, info->aiNextToTarget); + WriteBool8(seri, info->recalculateFollow); + WriteBool8(seri, info->waiting); + WriteBool8(seri, info->unk146); + WriteBool8(seri, info->attacking); + WriteBool8(seri, info->unk149); + WriteBool8(seri, info->unk14A); + WriteBool8(seri, info->unk14B); + WriteBool8(seri, info->unk14C); + WriteU16(seri, info->visualFlags); + WriteU16(seri, info->previousVisualFlags); + WriteBool8(seri, info->unk152); + WriteU8(seri, info->unk153); + WriteBool8(seri, info->unk154); + WriteBool8(seri, info->unk155); + WriteBool8(seri, info->unk156); + WriteU8(seri, info->unk164); + WriteU8(seri, info->unk165); + WriteU8(seri, info->unk166); + WriteU8(seri, info->unk167); + WriteU8(seri, info->unk168); + WriteU8(seri, info->turnsSinceWarpScarfActivation); + WriteTilePos(seri, &info->targetPos); WriteS32(seri, info->unk174); WriteU16(seri, info->abilityEffectFlags); WriteS16(seri, info->unk1F8); WriteS16(seri, info->mobileTurnTimer); WriteU32(seri, info->expGainedInTurn); - WriteClientType(seri, *puStack_90); + WriteClientType(seri, info->clientType); } static void WriteDungeonFloor(DataSerializer *seri) From 2ec9296cc5c635fa62ffa0a58e4bcb2c3111e6b6 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sun, 10 Nov 2024 19:03:09 -0500 Subject: [PATCH 25/48] Rename nullsub_102 --- include/code_8092334.h | 6 +++--- src/code_803D0D8.c | 12 ++++++------ src/code_8092334.c | 4 +--- src/code_8094F88.c | 4 ++-- src/code_80958E8.c | 4 ++-- src/code_8097670.c | 4 ++-- src/friend_area.c | 4 ++-- src/items.c | 4 ++-- src/pokemon_3.c | 8 ++++---- src/rescue_team_info.c | 4 ++-- 10 files changed, 26 insertions(+), 28 deletions(-) diff --git a/include/code_8092334.h b/include/code_8092334.h index 3c7e6c1e5..afe08ee4e 100644 --- a/include/code_8092334.h +++ b/include/code_8092334.h @@ -3,10 +3,10 @@ #include "data_serializer.h" -void nullsub_102(DataSerializer *seri); -void ReadBits(DataSerializer *seri, void *dst, s32 numBits); -void WriteBits(DataSerializer *seri, void *src, s32 numBits); +void FinishBitSerializer(DataSerializer *seri); void InitBitReader(DataSerializer *seri, u8 *buffer, s32 bufLen); void InitBitWriter(DataSerializer *seri, u8 *buffer, s32 bufLen); +void ReadBits(DataSerializer *seri, void *dst, s32 numBits); +void WriteBits(DataSerializer *seri, void *src, s32 numBits); #endif // GUARD_CODE_8092334_H \ No newline at end of file diff --git a/src/code_803D0D8.c b/src/code_803D0D8.c index 03f37c8af..bafa162e1 100644 --- a/src/code_803D0D8.c +++ b/src/code_803D0D8.c @@ -68,7 +68,7 @@ u8 sub_803D110(u8 *param_1, u8 *param_2, s32 size) { WriteBits(&auStack_88, &local_78[index1], 5); } - nullsub_102(&auStack_88); + FinishBitSerializer(&auStack_88); MemoryCopy8(param_2, auStack_40, save); return 1; } @@ -91,7 +91,7 @@ void sub_803D1A8(u8 *param_1, u8 *param_2, s32 size) ReadBits(&auStack_5c, &local_4c[index], 5); } - nullsub_102(&auStack_5c); + FinishBitSerializer(&auStack_5c); for(index = 0; index < size; index++) { *param_1++ = sub_803D100(local_4c[index]); @@ -129,7 +129,7 @@ bool8 sub_803D204(u8 *buffer,unkStruct_203B480 *param_2) if (local_c4[0] == checksum) { InitBitReader(&uStack_30,&local_c4[1],33); sub_8095774(&uStack_30,param_2); - nullsub_102(&uStack_30); + FinishBitSerializer(&uStack_30); return TRUE; } } @@ -154,7 +154,7 @@ void sub_803D2C0(u8 *buffer, unkStruct_203B480 *mail) InitBitWriter(&auStack_2c,&local_c0[1],33); sub_8095824(&auStack_2c,mail); - nullsub_102(&auStack_2c); + FinishBitSerializer(&auStack_2c); for(index = 1; index < 34; index++) { checksum += + local_c0[index] + index; @@ -201,7 +201,7 @@ bool8 DecodeWonderMailPassword(u8* buffer, WonderMail *mail) if (local_70[0] == checksum) { InitBitReader(&puVar1,&local_70[1],0xc); ReadWonderMailBits(&puVar1,mail); - nullsub_102(&puVar1); + FinishBitSerializer(&puVar1); return TRUE; } } @@ -225,7 +225,7 @@ void sub_803D414(u8 *buffer,WonderMail *mail) InitBitWriter(&uStack_2c,&local_6c[1],12); WriteWonderMailBits(&uStack_2c,mail); - nullsub_102(&uStack_2c); + FinishBitSerializer(&uStack_2c); for(index = 1; index < 0xF; index++) { diff --git a/src/code_8092334.c b/src/code_8092334.c index ea4aed815..c335e247a 100644 --- a/src/code_8092334.c +++ b/src/code_8092334.c @@ -41,10 +41,8 @@ void InitBitWriter(DataSerializer *r0, u8 *buffer, s32 bufLen) MemoryClear8(buffer, bufLen); } -// Finish reading/writing bits -void nullsub_102(DataSerializer *r0) +void FinishBitSerializer(DataSerializer *seri) { - } void WriteBits(DataSerializer *r0, void *src, s32 numBits) diff --git a/src/code_8094F88.c b/src/code_8094F88.c index dd2ea1294..6faf9805f 100644 --- a/src/code_8094F88.c +++ b/src/code_8094F88.c @@ -365,7 +365,7 @@ u32 sub_80954CC(u8 *buffer, u32 size) ReadBits(&backup, &gUnknown_203B48C->unk4[i], 32); } - nullsub_102(&backup); + FinishBitSerializer(&backup); return backup.count; } @@ -411,7 +411,7 @@ u32 sub_8095624(u8 *buffer, u32 b) WriteBits(&backup, &gUnknown_203B48C->unk4[i], 32); } - nullsub_102(&backup); + FinishBitSerializer(&backup); return backup.count; } diff --git a/src/code_80958E8.c b/src/code_80958E8.c index 84fa8e336..25847f048 100644 --- a/src/code_80958E8.c +++ b/src/code_80958E8.c @@ -1379,7 +1379,7 @@ u32 RestoreMailInfo(u8 *r0, u32 size) ReadBits(&backup, &gUnknown_203B490->unk230[index].sub.seed, 24); ReadDungeonLocationBits(&backup, &gUnknown_203B490->unk230[index].sub.dungeon); } - nullsub_102(&backup); + FinishBitSerializer(&backup); return backup.count; } @@ -1423,7 +1423,7 @@ u32 SaveMailInfo(u8 *r0, u32 size) WriteBits(&backup, &gUnknown_203B490->unk230[index].sub.seed, 0x18); WriteDungeonLocationBits(&backup, &gUnknown_203B490->unk230[index].sub.dungeon); } - nullsub_102(&backup); + FinishBitSerializer(&backup); return backup.count; } diff --git a/src/code_8097670.c b/src/code_8097670.c index cb31e4c1b..c1ff0c248 100644 --- a/src/code_8097670.c +++ b/src/code_8097670.c @@ -375,7 +375,7 @@ u32 SaveAdventureData(u8 *buffer, u32 bufLen) WriteAdventureBits(&seri); WriteExclusivePokemon(&seri); - nullsub_102(&seri); + FinishBitSerializer(&seri); return seri.count; } @@ -390,6 +390,6 @@ u32 RestoreAdventureData(u8 *buffer, u32 bufLen) ReadAdventureBits(&seri); ReadExclusivePokemon(&seri); - nullsub_102(&seri); + FinishBitSerializer(&seri); return seri.count; } \ No newline at end of file diff --git a/src/friend_area.c b/src/friend_area.c index 776e6dc5e..5bdb0c9bb 100644 --- a/src/friend_area.c +++ b/src/friend_area.c @@ -241,7 +241,7 @@ u32 SaveFriendAreas(u8 *r0, u32 size) WriteBits(&unk, (u8*)&temp, 1); } - nullsub_102(&unk); + FinishBitSerializer(&unk); return unk.count; } @@ -262,6 +262,6 @@ u32 ReadSavedFriendAreas(u8 *r0, s32 size) gFriendAreas[i] = FALSE; } - nullsub_102(&unk); + FinishBitSerializer(&unk); return unk.count; } diff --git a/src/items.c b/src/items.c index 06a83266a..ab06357de 100644 --- a/src/items.c +++ b/src/items.c @@ -1127,7 +1127,7 @@ s32 SaveTeamInventory(u8* unk0, u32 size) WriteBits(&unk, &gTeamInventoryRef->teamMoney, 24); WriteBits(&unk, &gTeamInventoryRef->teamSavings, 24); - nullsub_102(&unk); + FinishBitSerializer(&unk); return unk.count; } @@ -1152,7 +1152,7 @@ s32 RestoreTeamInventory(u8 *unk0, u32 size) ReadBits(&unk, &gTeamInventoryRef->teamMoney, 24); ReadBits(&unk, &gTeamInventoryRef->teamSavings, 24); - nullsub_102(&unk); + FinishBitSerializer(&unk); return unk.count; } diff --git a/src/pokemon_3.c b/src/pokemon_3.c index b91091d50..95d31bba1 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -706,7 +706,7 @@ s32 SaveRecruitedPokemon(u8 *a1, s32 a2) // Team leader WriteBits(&backup, &teamLeader, 16); - nullsub_102(&backup); + FinishBitSerializer(&backup); return backup.count; } @@ -745,7 +745,7 @@ s32 RestoreRecruitedPokemon(u8 *a1, s32 a2) if ((u16)data_s16 < NUM_MONSTERS) gRecruitedPokemonRef->pokemon[data_s16].isTeamLeader = TRUE; - nullsub_102(&backup); + FinishBitSerializer(&backup); return backup.count; } @@ -839,7 +839,7 @@ s32 SavePoke2s(u8* buffer, s32 size) WriteBits(&backup, &pokemon2->name, 10 * 8); } - nullsub_102(&backup); + FinishBitSerializer(&backup); return backup.count; } @@ -888,7 +888,7 @@ s32 RestorePoke2s(u8* a1, s32 size) ReadBits(&backup, &pokemon2->name, 80); } - nullsub_102(&backup); + FinishBitSerializer(&backup); return backup.count; } diff --git a/src/rescue_team_info.c b/src/rescue_team_info.c index 13e8b9887..7f0789c9f 100644 --- a/src/rescue_team_info.c +++ b/src/rescue_team_info.c @@ -134,7 +134,7 @@ u32 SaveRescueTeamInfo(u8 *param_1, u32 size) puVar2 = &zero; } WriteBits(&auStack36,puVar2,1); - nullsub_102(&auStack36); + FinishBitSerializer(&auStack36); return auStack36.count; } @@ -148,6 +148,6 @@ u32 ReadRescueTeamInfo(u8 *param_1, u32 size) ReadBits(&auStack32, &gRescueTeamInfoRef->teamRankPts, 0x20); ReadBits(&auStack32, byteArray, 1); gRescueTeamInfoRef->isTeamRenamed = byteArray[0] & 1; - nullsub_102(&auStack32); + FinishBitSerializer(&auStack32); return auStack32.count; } From afa4b04abcdf1f9562dc8300e5949889b68c592a Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sun, 10 Nov 2024 19:43:27 -0500 Subject: [PATCH 26/48] axObject info union --- asm/code_80450F8.s | 644 ------------------------------- include/code_80450F8.h | 10 + include/structs/axdata.h | 7 +- include/structs/dungeon_entity.h | 19 +- include/structs/str_dungeon.h | 4 +- include/tile_types.h | 4 +- ld_script.txt | 1 + src/code_80450F8.c | 491 +++++++++++++++++++++++ src/code_805D8C8_1.c | 9 +- src/code_806E8B0.c | 2 +- src/code_80718D8.c | 1 + src/dungeon_serializer.c | 26 +- src/dungeon_util_1.c | 2 +- src/move_actions.c | 6 +- src/tile_types.c | 2 +- src/trap.c | 2 +- 16 files changed, 551 insertions(+), 679 deletions(-) create mode 100644 include/code_80450F8.h create mode 100644 src/code_80450F8.c diff --git a/asm/code_80450F8.s b/asm/code_80450F8.s index afbd0fef8..84d2e416b 100644 --- a/asm/code_80450F8.s +++ b/asm/code_80450F8.s @@ -5,650 +5,6 @@ .text - thumb_func_start sub_80453AC -sub_80453AC: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - asrs r0, 16 - mov r8, r0 - movs r0, 0x1 - negs r0, r0 - mov r9, r0 - mov r0, r8 - bl GetBodySize - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - movs r0, 0x6 - subs r3, r0, r6 - ldr r4, _080453D8 - b _080453DE - .align 2, 0 -_080453D8: .4byte gUnknown_202EE70 -_080453DC: - adds r5, 0x1 -_080453DE: - cmp r5, r3 - bgt _08045400 - movs r2, 0 - cmp r2, r6 - bge _080453FA - adds r1, r5, r4 - b _080453F4 -_080453EC: - adds r1, 0x1 - adds r2, 0x1 - cmp r2, r6 - bge _080453FA -_080453F4: - ldrb r0, [r1] - cmp r0, 0 - beq _080453EC -_080453FA: - cmp r2, r6 - bne _080453DC - mov r9, r5 -_08045400: - movs r0, 0x1 - negs r0, r0 - cmp r9, r0 - beq _080454FC - movs r5, 0 - ldr r7, _080454DC -_0804540C: - ldr r1, _080454E0 - ldr r0, [r1] - lsls r1, r5, 2 - ldr r2, _080454E4 - adds r0, r2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl EntityExists - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0 - bne _080454F0 - movs r0, 0x1 - str r0, [r4] - adds r0, r4, 0 - adds r0, 0x24 - strb r5, [r0] - ldr r1, _080454E0 - ldr r0, [r1] - adds r0, r7 - str r0, [r4, 0x70] - mov r2, r8 - strh r2, [r0, 0x2] - movs r0, 0 - mov r1, r8 - bl GetMonsterApparentID - ldr r1, [r4, 0x70] - strh r0, [r1, 0x4] - ldr r0, [r4, 0x70] - movs r5, 0 - strb r5, [r0, 0x6] - movs r0, 0 - mov r1, r8 - bl GetMonsterApparentID - lsls r0, 16 - asrs r0, 16 - bl GetSpriteData - str r0, [r4, 0x64] - mov r1, r9 - lsls r0, r1, 4 - adds r0, 0x40 - adds r1, r4, 0 - adds r1, 0x68 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x7 - strb r0, [r1] - adds r0, r4, 0 - adds r0, 0x6C - movs r2, 0 - strb r2, [r0] - adds r1, 0x1 - movs r0, 0xFF - strb r0, [r1] - adds r0, r4, 0 - adds r0, 0x6D - movs r5, 0x1 - strb r5, [r0] - adds r0, 0x2 - strb r5, [r0] - mov r0, r10 - str r0, [r4, 0x1C] - bl sub_8045ACC - ldr r0, [r4, 0x70] - ldr r1, _080454E8 - adds r0, r1 - mov r2, r9 - strb r2, [r0] - ldr r0, [r4, 0x70] - movs r5, 0xB4 - lsls r5, 1 - adds r0, r5 - strb r6, [r0] - cmp r6, 0 - beq _080454C6 - ldr r3, _080454EC - movs r2, 0x1 - adds r1, r6, 0 -_080454B6: - mov r5, r9 - adds r0, r5, r3 - strb r2, [r0] - movs r0, 0x1 - add r9, r0 - subs r1, 0x1 - cmp r1, 0 - bne _080454B6 -_080454C6: - ldr r1, _080454E0 - ldr r0, [r1] - movs r2, 0xCD - lsls r2, 3 - adds r0, r2 - ldrh r2, [r0] - adds r1, r2, 0x1 - strh r1, [r0] - strh r2, [r4, 0x26] - adds r0, r4, 0 - b _080454FE - .align 2, 0 -_080454DC: .4byte 0x0000069c -_080454E0: .4byte gDungeon -_080454E4: .4byte 0x0001357c -_080454E8: .4byte 0x00000167 -_080454EC: .4byte gUnknown_202EE70 -_080454F0: - movs r0, 0x82 - lsls r0, 2 - adds r7, r0 - adds r5, 0x1 - cmp r5, 0x3 - ble _0804540C -_080454FC: - movs r0, 0 -_080454FE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80453AC - - thumb_func_start sub_804550C -sub_804550C: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 16 - asrs r0, 16 - mov r8, r0 - movs r0, 0x1 - negs r0, r0 - mov r9, r0 - mov r0, r8 - bl GetBodySize - lsls r0, 24 - lsrs r7, r0, 24 - movs r5, 0 - movs r0, 0x10 - subs r3, r0, r7 - ldr r4, _08045538 - b _0804553E - .align 2, 0 -_08045538: .4byte gUnknown_202EE76 -_0804553C: - adds r5, 0x1 -_0804553E: - cmp r5, r3 - bgt _08045560 - movs r2, 0 - cmp r2, r7 - bge _0804555A - adds r1, r5, r4 - b _08045554 -_0804554C: - adds r1, 0x1 - adds r2, 0x1 - cmp r2, r7 - bge _0804555A -_08045554: - ldrb r0, [r1] - cmp r0, 0 - beq _0804554C -_0804555A: - cmp r2, r7 - bne _0804553C - mov r9, r5 -_08045560: - movs r0, 0x1 - negs r0, r0 - cmp r9, r0 - bne _0804556A - b _08045670 -_0804556A: - movs r5, 0 - movs r1, 0x1 - mov r10, r1 - ldr r2, _08045650 - mov r3, r9 - lsls r0, r3, 4 - adds r0, 0xA0 - str r0, [sp] -_0804557A: - ldr r1, _08045654 - ldr r0, [r1] - lsls r1, r5, 2 - ldr r3, _08045658 - adds r0, r3 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - str r2, [sp, 0x4] - bl EntityExists - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, [sp, 0x4] - cmp r6, 0 - bne _08045664 - mov r0, r10 - str r0, [r4] - adds r0, r4, 0 - adds r0, 0x24 - strb r5, [r0] - subs r0, 0x2 - strb r6, [r0] - ldr r1, _08045654 - ldr r0, [r1] - adds r0, r2 - str r0, [r4, 0x70] - mov r2, r8 - strh r2, [r0, 0x2] - movs r0, 0 - mov r1, r8 - bl GetMonsterApparentID - ldr r1, [r4, 0x70] - strh r0, [r1, 0x4] - ldr r0, [r4, 0x70] - mov r3, r10 - strb r3, [r0, 0x6] - movs r0, 0 - mov r1, r8 - bl GetMonsterApparentID - lsls r0, 16 - asrs r0, 16 - bl GetSpriteData - str r0, [r4, 0x64] - adds r0, r4, 0 - adds r0, 0x68 - mov r5, sp - ldrh r5, [r5] - strh r5, [r0] - adds r1, r4, 0 - adds r1, 0x6A - movs r0, 0x7 - strb r0, [r1] - adds r0, r4, 0 - adds r0, 0x6C - movs r1, 0 - strb r1, [r0] - adds r1, r4, 0 - adds r1, 0x6B - movs r0, 0xFF - strb r0, [r1] - adds r0, r4, 0 - adds r0, 0x6D - mov r2, r10 - strb r2, [r0] - adds r0, 0x2 - strb r2, [r0] - str r6, [r4, 0x1C] - ldr r0, [r4, 0x70] - ldr r3, _0804565C - adds r0, r3 - mov r5, r9 - strb r5, [r0] - ldr r0, [r4, 0x70] - movs r1, 0xB4 - lsls r1, 1 - adds r0, r1 - strb r7, [r0] - cmp r7, 0 - beq _08045636 - ldr r3, _08045660 - movs r2, 0x1 - adds r1, r7, 0 -_08045626: - mov r5, r9 - adds r0, r5, r3 - strb r2, [r0] - movs r0, 0x1 - add r9, r0 - subs r1, 0x1 - cmp r1, 0 - bne _08045626 -_08045636: - bl sub_8045ACC - ldr r1, _08045654 - ldr r0, [r1] - movs r2, 0xCD - lsls r2, 3 - adds r0, r2 - ldrh r2, [r0] - adds r1, r2, 0x1 - strh r1, [r0] - strh r2, [r4, 0x26] - adds r0, r4, 0 - b _08045672 - .align 2, 0 -_08045650: .4byte 0x00000ebc -_08045654: .4byte gDungeon -_08045658: .4byte 0x0001358c -_0804565C: .4byte 0x00000167 -_08045660: .4byte gUnknown_202EE76 -_08045664: - movs r3, 0x82 - lsls r3, 2 - adds r2, r3 - adds r5, 0x1 - cmp r5, 0xF - ble _0804557A -_08045670: - movs r0, 0 -_08045672: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_804550C - - thumb_func_start sub_8045684 -sub_8045684: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - movs r5, 0 - ldr r7, _080456E4 - ldr r6, _080456E8 -_080456A2: - ldr r0, [r7] - lsls r1, r5, 2 - ldr r2, _080456EC - adds r0, r2 - adds r0, r1 - ldr r4, [r0] - adds r0, r4, 0 - bl EntityExists - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080456F0 - movs r0, 0x2 - str r0, [r4] - ldr r0, [r7] - adds r0, r6 - str r0, [r4, 0x70] - mov r2, r8 - strb r2, [r0] - ldr r0, [r4, 0x70] - mov r2, r9 - strb r2, [r0, 0x1] - str r1, [r4, 0x1C] - adds r0, r4, 0 - adds r0, 0x22 - strb r1, [r0] - mov r2, r10 - ldr r0, [r2] - str r0, [r4, 0x4] - strh r1, [r4, 0x26] - adds r0, r4, 0 - b _080456FA - .align 2, 0 -_080456E4: .4byte gDungeon -_080456E8: .4byte 0x00003908 -_080456EC: .4byte 0x0001371c -_080456F0: - adds r6, 0x4 - adds r5, 0x1 - cmp r5, 0x3F - ble _080456A2 - movs r0, 0 -_080456FA: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8045684 - - thumb_func_start sub_8045708 -sub_8045708: - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r8, r0 - ldr r1, _08045744 - ldr r0, _08045748 - ldr r0, [r0] - ldr r2, _0804574C - adds r0, r2 - movs r3, 0 - ldrsh r0, [r0, r3] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0804579C - mov r1, r8 - movs r2, 0 - ldrsh r0, [r1, r2] - movs r3, 0x2 - ldrsh r1, [r1, r3] - bl GetTileSafe - ldrh r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - bne _0804579C - b _080457C4 - .align 2, 0 -_08045744: .4byte gDungeonWaterType -_08045748: .4byte gDungeon -_0804574C: .4byte 0x00003a0e -_08045750: - movs r0, 0x3 - str r0, [r4] - ldr r0, _08045798 - adds r1, r6, r0 - mov r2, r9 - ldr r0, [r2] - adds r0, r1 - str r0, [r4, 0x70] - mov r3, r8 - ldr r0, [r3] - str r0, [r4, 0x4] - movs r1, 0 - ldrsh r0, [r3, r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - adds r1, 0x4 - lsls r1, 8 - movs r2, 0x2 - ldrsh r0, [r3, r2] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 3 - adds r2, 0x4 - lsls r2, 8 - adds r0, r4, 0 - bl SetEntityPixelPos - movs r0, 0 - strh r7, [r4, 0x26] - adds r1, r4, 0 - adds r1, 0x22 - strb r0, [r1] - str r7, [r4, 0x1C] - adds r0, r4, 0 - b _080457C6 - .align 2, 0 -_08045798: .4byte 0x00003804 -_0804579C: - movs r5, 0 - ldr r3, _080457D4 - mov r9, r3 -_080457A2: - mov r1, r9 - ldr r0, [r1] - lsls r6, r5, 2 - ldr r2, _080457D8 - adds r0, r2 - adds r0, r6 - ldr r4, [r0] - adds r0, r4, 0 - bl EntityExists - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - beq _08045750 - adds r5, 0x1 - cmp r5, 0x3F - ble _080457A2 -_080457C4: - movs r0, 0 -_080457C6: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_080457D4: .4byte gDungeon -_080457D8: .4byte 0x0001361c - thumb_func_end sub_8045708 - - thumb_func_start sub_80457DC -sub_80457DC: - push {r4-r6,lr} - adds r4, r0, 0 - movs r0, 0x5 - str r0, [r4] - movs r6, 0 - movs r5, 0 - strh r5, [r4, 0x4] - strh r5, [r4, 0x6] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl SetEntityPixelPos - strh r5, [r4, 0x26] - adds r4, 0x22 - strb r6, [r4] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80457DC - - thumb_func_start sub_8045804 -sub_8045804: - push {r4-r6,lr} - adds r4, r0, 0 - bl GetEntityType - cmp r0, 0x1 - beq _0804581C - cmp r0, 0x1 - bcc _08045880 - cmp r0, 0x5 - beq _08045880 -_08045818: - movs r0, 0x1 - b _08045882 -_0804581C: - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08045880 - ldr r0, _08045874 - ldr r1, [r0] - ldr r0, _08045878 - adds r2, r1, r0 - ldr r5, [r2, 0x10] - ldr r3, [r4, 0x70] - ldrb r0, [r3, 0x6] - cmp r0, 0 - beq _08045818 - ldr r6, _0804587C - adds r0, r1, r6 - ldrb r0, [r0] - cmp r0, 0 - bne _0804584C - adds r0, r3, 0 - adds r0, 0xE4 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08045880 -_0804584C: - adds r0, r2, 0 - adds r0, 0x23 - ldrb r0, [r0] - cmp r0, 0 - bne _08045818 - adds r0, r2, 0 - adds r0, 0x25 - ldrb r0, [r0] - cmp r0, 0 - bne _08045818 - cmp r5, 0 - beq _08045880 - adds r1, r4, 0x4 - adds r0, r2, 0 - bl IsPositionActuallyInSight - lsls r0, 24 - lsrs r0, 24 - b _08045882 - .align 2, 0 -_08045874: .4byte gDungeon -_08045878: .4byte 0x000181e8 -_0804587C: .4byte 0x0001820f -_08045880: - movs r0, 0 -_08045882: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8045804 - thumb_func_start sub_8045888 sub_8045888: push {r4,r5,lr} diff --git a/include/code_80450F8.h b/include/code_80450F8.h new file mode 100644 index 000000000..abf7c7d92 --- /dev/null +++ b/include/code_80450F8.h @@ -0,0 +1,10 @@ +#ifndef GUARD_CODE_80227B8_H +#define GUARD_CODE_80227B8_H + +#include "structs/dungeon_entity.h" + +Entity *sub_8045684(u8 a, Position *pos, u8 c); +Entity *sub_8045708(Position *pos); +void sub_80457DC(Entity* ent); + +#endif // GUARD_CODE_80227B8_H \ No newline at end of file diff --git a/include/structs/axdata.h b/include/structs/axdata.h index 8719322ad..cbc027b1f 100644 --- a/include/structs/axdata.h +++ b/include/structs/axdata.h @@ -84,7 +84,12 @@ struct axObject u8 unk45_orientation; u8 unk46; u8 unk47; - /* 0x48 */ struct EntityInfo* info; + /* 0x48 */ union + { + struct Item* item; + struct EntityInfo* monster; + struct EntTrapInfo* trap; + } info; }; // size: 0x80? (assuming it's the last sub-struct of GroundLives) diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 712807bb5..579c6e3f9 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -1,15 +1,15 @@ #ifndef GUARD_DUNGEON_ENTITY_H #define GUARD_DUNGEON_ENTITY_H -#include "constants/global.h" #include "constants/dungeon_action.h" -#include "structs/str_position.h" -#include "sprite.h" +#include "constants/global.h" +#include "constants/status.h" +#include "structs/axdata.h" #include "structs/str_items.h" #include "structs/str_moves.h" -#include "structs/axdata.h" - +#include "structs/str_position.h" #include "number_util.h" +#include "sprite.h" #define MAX_STAT_STAGE 20 #define STAT_MULTIPLIER_THRESHOLD 63 @@ -352,6 +352,13 @@ typedef struct EntityInfo u8 unk204; } EntityInfo; +// size: 0x4 +typedef struct EntTrapInfo +{ + /* 0x0 */ u8 unk0; + /* 0x0 */ u8 unk1; +} EntTrapInfo; + // size: 0x74 | Used for PokĂ©mon, items, and traps. typedef struct Entity { @@ -472,7 +479,7 @@ static inline void SetExpMultplier(EntityInfo *info) static inline EntityInfo *GetEntInfo(Entity *ent) { - return ent->axObj.info; + return ent->axObj.info.monster; } #endif diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index 08200e67d..66642c31b 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -354,9 +354,9 @@ typedef struct Dungeon /* 0x37FE */ bool8 unk37FF; // dungeon_serializer.c refers to this as a u16 but elsewhere it's handled as a s16 /* 0x3800 */ s16 deoxysForm; - EntityInfo *unk3804[DUNGEON_MAX_ITEMS]; // TODO: ItemInfo[DUNGEON_MAX_ITEMS] + Item unk3804[DUNGEON_MAX_ITEMS]; /* 0x3904 */ s16 unk3904; - EntityInfo *unk3908[DUNGEON_MAX_TRAPS]; // TODO: TrapInfo[DUNGEON_MAX_TRAPS] + EntTrapInfo unk3908[DUNGEON_MAX_TRAPS]; /* 0x3A08 */ bool8 unk3A08; /* 0x3A09 */ bool8 unk3A09; /* 0x3A0A */ bool8 unk3A0A; diff --git a/include/tile_types.h b/include/tile_types.h index ef99fbdab..78ce34014 100644 --- a/include/tile_types.h +++ b/include/tile_types.h @@ -7,10 +7,10 @@ #define DUNGEON_WATER_TYPE_LAVA 1 #define DUNGEON_WATER_TYPE_WATER 2 -extern const u8 gDungeonWaterType[]; +extern const u8 gDungeonWaterType[76]; void sub_804AE84(Position *pos); bool8 IsTileGround(Tile *tile); bool8 IsWaterTileset(); -#endif +#endif // GUARD_TILE_TYPES_H \ No newline at end of file diff --git a/ld_script.txt b/ld_script.txt index ab9d054e3..7c02dd494 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -216,6 +216,7 @@ SECTIONS { src/dungeon_action.o(.text); src/code_8044CC8.o(.text); src/dungeon_util.o(.text); + src/code_80450F8.o(.text); asm/code_80450F8.o(.text); src/dungeon_visibility.o(.text); src/code_8045A00.o(.text); diff --git a/src/code_80450F8.c b/src/code_80450F8.c new file mode 100644 index 000000000..243bb1e9f --- /dev/null +++ b/src/code_80450F8.c @@ -0,0 +1,491 @@ +#include "global.h" +#include "structs/str_dungeon.h" +#include "code_80450F8.h" +#include "dungeon_map_access.h" +#include "dungeon_range.h" +#include "dungeon_util.h" +#include "tile_types.h" + +// Related to sub_80828E0 +// 93.08% https://decomp.me/scratch/AYGBN +NAKED +Entity *sub_80453AC(s16 id) +{ + asm_unified( +" push {r4-r7,lr}\n" +" mov r7, r10\n" +" mov r6, r9\n" +" mov r5, r8\n" +" push {r5-r7}\n" +" lsls r0, 16\n" +" asrs r0, 16\n" +" mov r8, r0\n" +" movs r0, 0x1\n" +" negs r0, r0\n" +" mov r9, r0\n" +" mov r0, r8\n" +" bl GetBodySize\n" +" lsls r0, 24\n" +" lsrs r6, r0, 24\n" +" movs r5, 0\n" +" movs r0, 0x6\n" +" subs r3, r0, r6\n" +" ldr r4, _080453D8\n" +" b _080453DE\n" +" .align 2, 0\n" +"_080453D8: .4byte gUnknown_202EE70\n" +"_080453DC:\n" +" adds r5, 0x1\n" +"_080453DE:\n" +" cmp r5, r3\n" +" bgt _08045400\n" +" movs r2, 0\n" +" cmp r2, r6\n" +" bge _080453FA\n" +" adds r1, r5, r4\n" +" b _080453F4\n" +"_080453EC:\n" +" adds r1, 0x1\n" +" adds r2, 0x1\n" +" cmp r2, r6\n" +" bge _080453FA\n" +"_080453F4:\n" +" ldrb r0, [r1]\n" +" cmp r0, 0\n" +" beq _080453EC\n" +"_080453FA:\n" +" cmp r2, r6\n" +" bne _080453DC\n" +" mov r9, r5\n" +"_08045400:\n" +" movs r0, 0x1\n" +" negs r0, r0\n" +" cmp r9, r0\n" +" beq _080454FC\n" +" movs r5, 0\n" +" ldr r7, _080454DC\n" +"_0804540C:\n" +" ldr r1, _080454E0\n" +" ldr r0, [r1]\n" +" lsls r1, r5, 2\n" +" ldr r2, _080454E4\n" +" adds r0, r2\n" +" adds r0, r1\n" +" ldr r4, [r0]\n" +" adds r0, r4, 0\n" +" bl EntityExists\n" +" lsls r0, 24\n" +" lsrs r0, 24\n" +" mov r10, r0\n" +" cmp r0, 0\n" +" bne _080454F0\n" +" movs r0, 0x1\n" +" str r0, [r4]\n" +" adds r0, r4, 0\n" +" adds r0, 0x24\n" +" strb r5, [r0]\n" +" ldr r1, _080454E0\n" +" ldr r0, [r1]\n" +" adds r0, r7\n" +" str r0, [r4, 0x70]\n" +" mov r2, r8\n" +" strh r2, [r0, 0x2]\n" +" movs r0, 0\n" +" mov r1, r8\n" +" bl GetMonsterApparentID\n" +" ldr r1, [r4, 0x70]\n" +" strh r0, [r1, 0x4]\n" +" ldr r0, [r4, 0x70]\n" +" movs r5, 0\n" +" strb r5, [r0, 0x6]\n" +" movs r0, 0\n" +" mov r1, r8\n" +" bl GetMonsterApparentID\n" +" lsls r0, 16\n" +" asrs r0, 16\n" +" bl GetSpriteData\n" +" str r0, [r4, 0x64]\n" +" mov r1, r9\n" +" lsls r0, r1, 4\n" +" adds r0, 0x40\n" +" adds r1, r4, 0\n" +" adds r1, 0x68\n" +" strh r0, [r1]\n" +" adds r1, 0x2\n" +" movs r0, 0x7\n" +" strb r0, [r1]\n" +" adds r0, r4, 0\n" +" adds r0, 0x6C\n" +" movs r2, 0\n" +" strb r2, [r0]\n" +" adds r1, 0x1\n" +" movs r0, 0xFF\n" +" strb r0, [r1]\n" +" adds r0, r4, 0\n" +" adds r0, 0x6D\n" +" movs r5, 0x1\n" +" strb r5, [r0]\n" +" adds r0, 0x2\n" +" strb r5, [r0]\n" +" mov r0, r10\n" +" str r0, [r4, 0x1C]\n" +" bl sub_8045ACC\n" +" ldr r0, [r4, 0x70]\n" +" ldr r1, _080454E8\n" +" adds r0, r1\n" +" mov r2, r9\n" +" strb r2, [r0]\n" +" ldr r0, [r4, 0x70]\n" +" movs r5, 0xB4\n" +" lsls r5, 1\n" +" adds r0, r5\n" +" strb r6, [r0]\n" +" cmp r6, 0\n" +" beq _080454C6\n" +" ldr r3, _080454EC\n" +" movs r2, 0x1\n" +" adds r1, r6, 0\n" +"_080454B6:\n" +" mov r5, r9\n" +" adds r0, r5, r3\n" +" strb r2, [r0]\n" +" movs r0, 0x1\n" +" add r9, r0\n" +" subs r1, 0x1\n" +" cmp r1, 0\n" +" bne _080454B6\n" +"_080454C6:\n" +" ldr r1, _080454E0\n" +" ldr r0, [r1]\n" +" movs r2, 0xCD\n" +" lsls r2, 3\n" +" adds r0, r2\n" +" ldrh r2, [r0]\n" +" adds r1, r2, 0x1\n" +" strh r1, [r0]\n" +" strh r2, [r4, 0x26]\n" +" adds r0, r4, 0\n" +" b _080454FE\n" +" .align 2, 0\n" +"_080454DC: .4byte 0x0000069c\n" +"_080454E0: .4byte gDungeon\n" +"_080454E4: .4byte 0x0001357c\n" +"_080454E8: .4byte 0x00000167\n" +"_080454EC: .4byte gUnknown_202EE70\n" +"_080454F0:\n" +" movs r0, 0x82\n" +" lsls r0, 2\n" +" adds r7, r0\n" +" adds r5, 0x1\n" +" cmp r5, 0x3\n" +" ble _0804540C\n" +"_080454FC:\n" +" movs r0, 0\n" +"_080454FE:\n" +" pop {r3-r5}\n" +" mov r8, r3\n" +" mov r9, r4\n" +" mov r10, r5\n" +" pop {r4-r7}\n" +" pop {r1}\n" +" bx r1" +); +} + +// Related to sub_8082A08 +// 91.51% https://decomp.me/scratch/Fp0Kw +NAKED +Entity *sub_804550C(s16 a) +{ + asm_unified( +" push {r4-r7,lr}\n" +" mov r7, r10\n" +" mov r6, r9\n" +" mov r5, r8\n" +" push {r5-r7}\n" +" sub sp, 0x8\n" +" lsls r0, 16\n" +" asrs r0, 16\n" +" mov r8, r0\n" +" movs r0, 0x1\n" +" negs r0, r0\n" +" mov r9, r0\n" +" mov r0, r8\n" +" bl GetBodySize\n" +" lsls r0, 24\n" +" lsrs r7, r0, 24\n" +" movs r5, 0\n" +" movs r0, 0x10\n" +" subs r3, r0, r7\n" +" ldr r4, _08045538\n" +" b _0804553E\n" +" .align 2, 0\n" +"_08045538: .4byte gUnknown_202EE76\n" +"_0804553C:\n" +" adds r5, 0x1\n" +"_0804553E:\n" +" cmp r5, r3\n" +" bgt _08045560\n" +" movs r2, 0\n" +" cmp r2, r7\n" +" bge _0804555A\n" +" adds r1, r5, r4\n" +" b _08045554\n" +"_0804554C:\n" +" adds r1, 0x1\n" +" adds r2, 0x1\n" +" cmp r2, r7\n" +" bge _0804555A\n" +"_08045554:\n" +" ldrb r0, [r1]\n" +" cmp r0, 0\n" +" beq _0804554C\n" +"_0804555A:\n" +" cmp r2, r7\n" +" bne _0804553C\n" +" mov r9, r5\n" +"_08045560:\n" +" movs r0, 0x1\n" +" negs r0, r0\n" +" cmp r9, r0\n" +" bne _0804556A\n" +" b _08045670\n" +"_0804556A:\n" +" movs r5, 0\n" +" movs r1, 0x1\n" +" mov r10, r1\n" +" ldr r2, _08045650\n" +" mov r3, r9\n" +" lsls r0, r3, 4\n" +" adds r0, 0xA0\n" +" str r0, [sp]\n" +"_0804557A:\n" +" ldr r1, _08045654\n" +" ldr r0, [r1]\n" +" lsls r1, r5, 2\n" +" ldr r3, _08045658\n" +" adds r0, r3\n" +" adds r0, r1\n" +" ldr r4, [r0]\n" +" adds r0, r4, 0\n" +" str r2, [sp, 0x4]\n" +" bl EntityExists\n" +" lsls r0, 24\n" +" lsrs r6, r0, 24\n" +" ldr r2, [sp, 0x4]\n" +" cmp r6, 0\n" +" bne _08045664\n" +" mov r0, r10\n" +" str r0, [r4]\n" +" adds r0, r4, 0\n" +" adds r0, 0x24\n" +" strb r5, [r0]\n" +" subs r0, 0x2\n" +" strb r6, [r0]\n" +" ldr r1, _08045654\n" +" ldr r0, [r1]\n" +" adds r0, r2\n" +" str r0, [r4, 0x70]\n" +" mov r2, r8\n" +" strh r2, [r0, 0x2]\n" +" movs r0, 0\n" +" mov r1, r8\n" +" bl GetMonsterApparentID\n" +" ldr r1, [r4, 0x70]\n" +" strh r0, [r1, 0x4]\n" +" ldr r0, [r4, 0x70]\n" +" mov r3, r10\n" +" strb r3, [r0, 0x6]\n" +" movs r0, 0\n" +" mov r1, r8\n" +" bl GetMonsterApparentID\n" +" lsls r0, 16\n" +" asrs r0, 16\n" +" bl GetSpriteData\n" +" str r0, [r4, 0x64]\n" +" adds r0, r4, 0\n" +" adds r0, 0x68\n" +" mov r5, sp\n" +" ldrh r5, [r5]\n" +" strh r5, [r0]\n" +" adds r1, r4, 0\n" +" adds r1, 0x6A\n" +" movs r0, 0x7\n" +" strb r0, [r1]\n" +" adds r0, r4, 0\n" +" adds r0, 0x6C\n" +" movs r1, 0\n" +" strb r1, [r0]\n" +" adds r1, r4, 0\n" +" adds r1, 0x6B\n" +" movs r0, 0xFF\n" +" strb r0, [r1]\n" +" adds r0, r4, 0\n" +" adds r0, 0x6D\n" +" mov r2, r10\n" +" strb r2, [r0]\n" +" adds r0, 0x2\n" +" strb r2, [r0]\n" +" str r6, [r4, 0x1C]\n" +" ldr r0, [r4, 0x70]\n" +" ldr r3, _0804565C\n" +" adds r0, r3\n" +" mov r5, r9\n" +" strb r5, [r0]\n" +" ldr r0, [r4, 0x70]\n" +" movs r1, 0xB4\n" +" lsls r1, 1\n" +" adds r0, r1\n" +" strb r7, [r0]\n" +" cmp r7, 0\n" +" beq _08045636\n" +" ldr r3, _08045660\n" +" movs r2, 0x1\n" +" adds r1, r7, 0\n" +"_08045626:\n" +" mov r5, r9\n" +" adds r0, r5, r3\n" +" strb r2, [r0]\n" +" movs r0, 0x1\n" +" add r9, r0\n" +" subs r1, 0x1\n" +" cmp r1, 0\n" +" bne _08045626\n" +"_08045636:\n" +" bl sub_8045ACC\n" +" ldr r1, _08045654\n" +" ldr r0, [r1]\n" +" movs r2, 0xCD\n" +" lsls r2, 3\n" +" adds r0, r2\n" +" ldrh r2, [r0]\n" +" adds r1, r2, 0x1\n" +" strh r1, [r0]\n" +" strh r2, [r4, 0x26]\n" +" adds r0, r4, 0\n" +" b _08045672\n" +" .align 2, 0\n" +"_08045650: .4byte 0x00000ebc\n" +"_08045654: .4byte gDungeon\n" +"_08045658: .4byte 0x0001358c\n" +"_0804565C: .4byte 0x00000167\n" +"_08045660: .4byte gUnknown_202EE76\n" +"_08045664:\n" +" movs r3, 0x82\n" +" lsls r3, 2\n" +" adds r2, r3\n" +" adds r5, 0x1\n" +" cmp r5, 0xF\n" +" ble _0804557A\n" +"_08045670:\n" +" movs r0, 0\n" +"_08045672:\n" +" add sp, 0x8\n" +" pop {r3-r5}\n" +" mov r8, r3\n" +" mov r9, r4\n" +" mov r10, r5\n" +" pop {r4-r7}\n" +" pop {r1}\n" +" bx r1" +); +} + +Entity *sub_8045684(u8 a, Position *pos, u8 c) +{ + Entity *entity; + s32 i; + + for (i = 0; i < DUNGEON_MAX_TRAPS; i++) { + entity = gDungeon->traps[i]; + if (!EntityExists(entity)) { + entity->type = ENTITY_TRAP; + entity->axObj.info.trap = &gDungeon->unk3908[i]; + entity->axObj.info.trap->unk0 = a; + entity->axObj.info.trap->unk1 = c; + + entity->unk1C = 0; + entity->unk22 = 0; + entity->pos = *pos; + entity->spawnGenID = 0; + return entity; + } + } + + return NULL; +} + +Entity *sub_8045708(Position *pos) +{ + s32 i; + Entity *ent; + + if (gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA + && (GetTileSafe(pos->x, pos->y)->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == TERRAIN_TYPE_SECONDARY) { + return NULL; + } + + for (i = 0; i < DUNGEON_MAX_ITEMS; i++) { + ent = gDungeon->items[i]; + if (!EntityExists(ent)) { + ent->type = ENTITY_ITEM; + ent->axObj.info.item = &gDungeon->unk3804[i]; + + ent->pos = *pos; + SetEntityPixelPos(ent, ((pos->x * 24) + 4) * 0x100, ((pos->y * 24) + 4) * 0x100); + ent->spawnGenID = 0; + ent->unk22 = 0; + ent->unk1C = 0; + return ent; + } + } + + return NULL; +} + +void sub_80457DC(Entity* ent) +{ + ent->type = ENTITY_UNK_5; + ent->pos.x = 0; + ent->pos.y = 0; + SetEntityPixelPos(ent, 0, 0); + ent->spawnGenID = 0; + ent->unk22 = 0; +} + +bool8 sub_8045804(Entity *ent) +{ + UnkDungeonGlobal_unk181E8_sub* saveTyping; + Entity* camTarget; + EntityInfo *entInfo; + + switch (GetEntityType(ent)) { + case ENTITY_MONSTER: { + if (ent->isVisible) { + saveTyping = &gDungeon->unk181e8; + camTarget = saveTyping->cameraTarget; + entInfo = GetEntInfo(ent); + + if (!entInfo->isNotTeamMember) + return TRUE; + + if (!saveTyping->unk1820F && entInfo->transformStatus.transformStatus == STATUS_INVISIBLE) + return FALSE; + + if (saveTyping->unk1820B || saveTyping->unk1820D) + return TRUE; + + if (camTarget != NULL) + return IsPositionActuallyInSight(&saveTyping->cameraPos, &ent->pos); + } + return FALSE; + } + default: { + return TRUE; + } + case ENTITY_NOTHING: + case ENTITY_UNK_5: { + return FALSE; + } + } +} \ No newline at end of file diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index bc9c07e90..a20dc29d6 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -2297,7 +2297,7 @@ typedef struct UnkTextStruct3 { } UnkTextStruct3; extern void sub_803ECB4(UnkTextStruct3 *a0, u8 a1); -void CreateFieldItemMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, UnkTextStruct3 *a4, UnkTextStruct2_sub2 *a5); +static void CreateFieldItemMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, UnkTextStruct3 *a4, UnkTextStruct2_sub2 *a5); // Inline needed to (fake?)match. static inline void sub_805FC30_SetUpTxtStruct(UnkTextStruct3 *src) @@ -2660,7 +2660,7 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1) extern const struct UnkTextStruct2 gUnknown_8106B6C; extern const struct unkStruct_8090F58 gUnknown_8106B60; -void CreateFieldItemMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, UnkTextStruct3 *a4, UnkTextStruct2_sub2 *a5) +static void CreateFieldItemMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, UnkTextStruct3 *a4, UnkTextStruct2_sub2 *a5) { s32 i, x, y; s32 r10; @@ -2785,8 +2785,9 @@ void CreateFieldItemMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, UnkTextStruct3 default: { Entity *chosenTeamMember = gDungeon->teamPokemon[sUnknown_202F248[a0] - MAX_TEAM_MEMBERS]; if (EntityExists(chosenTeamMember)) { - Item *item = &GetEntInfo(chosenTeamMember)->heldItem; - SetMessageArgument_2(gFormatBuffer_Monsters[0], chosenTeamMember->axObj.info, 0); + EntityInfo *monInfo = GetEntInfo(chosenTeamMember); + Item *item = &monInfo->heldItem; + SetMessageArgument_2(gFormatBuffer_Monsters[0], monInfo, 0); PrintFormattedStringOnWindow(x, 0, gUnknown_80FE940, 0, 0); if (item->flags & ITEM_FLAG_EXISTS) { gUnknown_202EE10.unk1A++; diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index 0d8e7b0a3..8da4a347b 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -17,6 +17,7 @@ #include "status.h" #include "type_chart.h" #include "dungeon_random.h" +#include "code_80450F8.h" #include "code_8045A00.h" #include "dungeon_items.h" #include "structs/str_damage.h" @@ -30,7 +31,6 @@ extern bool8 sub_806E100(struct unkStruct_80943A8 *param_1, Entity *pokemon, Ent extern void sub_8041B74(Entity *pokemon); extern void sub_8041B5C(Entity *pokemon); extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC); -extern void sub_80457DC(Entity *); extern const s32 gUnknown_80F54B4[NUM_EFFECTIVENESS][NUM_EFFECTIVENESS]; extern const s32 gUnknown_80F504C[]; diff --git a/src/code_80718D8.c b/src/code_80718D8.c index c84022775..fda3037bd 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -5,6 +5,7 @@ #include "dungeon_leader.h" #include "dungeon_message.h" #include "code_8041AD0.h" +#include "code_80450F8.h" #include "code_8045A00.h" #include "code_8077274_1.h" #include "constants/dungeon.h" diff --git a/src/dungeon_serializer.c b/src/dungeon_serializer.c index 384165657..9016fd767 100644 --- a/src/dungeon_serializer.c +++ b/src/dungeon_serializer.c @@ -1,6 +1,7 @@ #include "global.h" #include "globaldata.h" #include "code_800F958.h" +#include "code_80450F8.h" #include "code_8045A00.h" #include "code_805D8C8.h" #include "code_806CD90.h" @@ -133,7 +134,6 @@ static Entity* sub_8082A08(s16 id, s16 apparentID, s32 index); // These externs are from other files extern u8 GetBodySize(s16 index); -extern Entity *sub_8045684(u8, Position *, u8); extern void sub_80460F8(Position *, Item *, u32); void SaveDungeonState(u8 *buffer, u32 bufLen) @@ -1145,10 +1145,10 @@ static Entity* sub_80828E0(s16 id, s16 apparentID, s32 index) entity = gDungeon->teamPokemon[index]; entity->type = ENTITY_MONSTER; entity->unk24 = index; - entity->axObj.info = &gDungeon->unk69C[index]; - entity->axObj.info->id = id_; - entity->axObj.info->apparentID = appID; - entity->axObj.info->isNotTeamMember = FALSE; + entity->axObj.info.monster = &gDungeon->unk69C[index]; + entity->axObj.info.monster->id = id_; + entity->axObj.info.monster->apparentID = appID; + entity->axObj.info.monster->isNotTeamMember = FALSE; entity->axObj.spriteFile = GetSpriteData(appID); entity->axObj.unk40_maybeAnimTimer = (r4 * 0x10) + 0x40; @@ -1160,8 +1160,8 @@ static Entity* sub_80828E0(s16 id, s16 apparentID, s32 index) entity->unk1C = 0; sub_8045ACC(); - entity->axObj.info->unk167 = r4; - entity->axObj.info->unk168 = apparentBodySize; + entity->axObj.info.monster->unk167 = r4; + entity->axObj.info.monster->unk168 = apparentBodySize; for (r1 = 0; r1 < apparentBodySize; r1++) { gUnknown_202EE70[r4] = 1; @@ -1213,10 +1213,10 @@ static Entity* sub_8082A08(s16 id, s16 apparentID, s32 index) entity->type = ENTITY_MONSTER; entity->unk24 = index; entity->unk22 = 0; - entity->axObj.info = &gDungeon->unkEBC[index]; - entity->axObj.info->id = id_; - entity->axObj.info->apparentID = appID; - entity->axObj.info->isNotTeamMember = TRUE; + entity->axObj.info.monster = &gDungeon->unkEBC[index]; + entity->axObj.info.monster->id = id_; + entity->axObj.info.monster->apparentID = appID; + entity->axObj.info.monster->isNotTeamMember = TRUE; entity->axObj.spriteFile = GetSpriteData(appID); entity->axObj.unk40_maybeAnimTimer = (r8 * 0x10) + 0xA0; @@ -1227,8 +1227,8 @@ static Entity* sub_8082A08(s16 id, s16 apparentID, s32 index) entity->axObj.unk47 = 1; entity->unk1C = 0; - entity->axObj.info->unk167 = r8; - entity->axObj.info->unk168 = apparentBodySize; + entity->axObj.info.monster->unk167 = r8; + entity->axObj.info.monster->unk168 = apparentBodySize; for (r1 = 0; r1 < apparentBodySize; r1++) { gUnknown_202EE76[r8] = 1; diff --git a/src/dungeon_util_1.c b/src/dungeon_util_1.c index 423c50056..677a040b2 100644 --- a/src/dungeon_util_1.c +++ b/src/dungeon_util_1.c @@ -3,6 +3,7 @@ #include "code_803E46C.h" #include "code_803E668.h" +#include "code_80450F8.h" #include "code_806CD90.h" #include "constants/direction.h" #include "constants/dungeon.h" @@ -21,7 +22,6 @@ extern void sub_803F4A0(u32); extern void sub_803F878(s32, s32); extern void sub_8068FE0(Entity *, u32, Entity*); -extern void sub_80457DC(Entity *); extern void sub_80694C0(Entity *, s32, s32, u32); diff --git a/src/move_actions.c b/src/move_actions.c index f245bb2a0..479362d3e 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -186,7 +186,7 @@ extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u3 extern void sub_804652C(Entity *, Entity *, Item *, u32, Position *); extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); extern void sub_8045C28(Item *, u8 , u8); -extern void sub_805A7D4(Entity *, Entity *, Item *, Position *); +static void sub_805A7D4(Entity *, Entity *, Item *, Position *); extern void MudWaterSportEffect(u32); extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); extern void sub_806A6E8(Entity *); @@ -2632,7 +2632,7 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ } } -void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, Position *pos) +static void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, Position *pos) { Entity stackEntity; @@ -2640,7 +2640,7 @@ void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, Position *pos) stackEntity.unk24 = 0; stackEntity.isVisible = TRUE; stackEntity.unk22 = 0; - stackEntity.axObj.info = (EntityInfo*) item; + stackEntity.axObj.info.item = item; stackEntity.pos.x = target->pos.x + pos->x; stackEntity.pos.y = target->pos.y + pos->y; SetEntityPixelPos(&stackEntity,(target->pos.x * 0x18 + 4) * 0x100, diff --git a/src/tile_types.c b/src/tile_types.c index 078eee7b8..fc0f64d2c 100644 --- a/src/tile_types.c +++ b/src/tile_types.c @@ -5,7 +5,7 @@ #include "dungeon_map_access.h" #include "dungeon_util.h" -const u8 gDungeonWaterType[] = { +const u8 gDungeonWaterType[76] = { DUNGEON_WATER_TYPE_NONE, DUNGEON_WATER_TYPE_NONE, DUNGEON_WATER_TYPE_NONE, diff --git a/src/trap.c b/src/trap.c index fcd798538..abc60d817 100644 --- a/src/trap.c +++ b/src/trap.c @@ -2,6 +2,7 @@ #include "trap.h" #include "code_803E668.h" +#include "code_80450F8.h" #include "code_8041AD0.h" #include "code_8045A00.h" #include "dungeon_message.h" @@ -85,7 +86,6 @@ void sub_8071DA4(Entity *); extern u8 sub_803F428(Position *pos); void sub_806A1E8(Entity *pokemon); u8 sub_803D6FC(void); -Entity *sub_8045684(u8, Position *, u8); extern void sub_807DF38(Entity *pokemon, Entity *target, Position *pos, u32, u8 moveType, s16); void sub_807FC3C(Position *pos, u32 trapID, u32 param_3) From 0df055bcc6fc09fd67ae7c0a802e7d2280ae404b Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sun, 10 Nov 2024 22:51:33 -0500 Subject: [PATCH 27/48] Replace EntTrapInfo with Trap --- include/code_80450F8.h | 2 +- include/dungeon_util.h | 15 ++++++++++----- include/structs/axdata.h | 2 +- include/structs/dungeon_entity.h | 12 ------------ include/structs/str_dungeon.h | 3 ++- include/structs/str_traps.h | 5 +++-- src/code_803E724.c | 12 ++++++------ src/code_80450F8.c | 15 +++++++++------ src/code_806E8B0.c | 1 + src/code_8072B78.c | 4 ++-- src/code_80861A8.c | 1 + src/dungeon_util.c | 8 ++++---- src/status_checks.c | 2 +- 13 files changed, 41 insertions(+), 41 deletions(-) diff --git a/include/code_80450F8.h b/include/code_80450F8.h index abf7c7d92..82374dd0c 100644 --- a/include/code_80450F8.h +++ b/include/code_80450F8.h @@ -3,7 +3,7 @@ #include "structs/dungeon_entity.h" -Entity *sub_8045684(u8 a, Position *pos, u8 c); +Entity *sub_8045684(u8 trapID, Position *pos, u8 c); Entity *sub_8045708(Position *pos); void sub_80457DC(Entity* ent); diff --git a/include/dungeon_util.h b/include/dungeon_util.h index b28f72e31..e2b1d27e2 100644 --- a/include/dungeon_util.h +++ b/include/dungeon_util.h @@ -11,13 +11,18 @@ extern const Position gAdjacentTileOffsets[NUM_DIRECTIONS]; bool8 EntityExists(Entity *pokemon); u32 GetEntityType(Entity *entity); u8 GetEntityRoom(Entity *entity); -Trap *GetTrapData(Entity *entity); -Trap* GetTrapData_1(Entity *entity); -Item *GetItemData(Entity *entity); struct Tile *GetTileAtEntitySafe(Entity *entity); -Item *GetItemData_1(Entity *entity); void sub_804535C(Entity *entity, Position32 *pos); void SetEntityPixelPos(Entity *entity, s32 x, s32 y); void IncreaseEntityPixelPos(Entity *entity, s32 x, s32 y); -#endif +static inline EntityInfo *GetEntInfo(Entity *entity) +{ + return entity->axObj.info.monster; +} +Item *GetItemData(Entity *entity); +Item *GetItemData_1(Entity *entity); +Trap *GetTrapData(Entity *entity); +Trap* GetTrapData_1(Entity *entity); + +#endif // GUARD_DUNGEON_UTIL_H \ No newline at end of file diff --git a/include/structs/axdata.h b/include/structs/axdata.h index cbc027b1f..a08151b7b 100644 --- a/include/structs/axdata.h +++ b/include/structs/axdata.h @@ -88,7 +88,7 @@ struct axObject { struct Item* item; struct EntityInfo* monster; - struct EntTrapInfo* trap; + struct Trap* trap; } info; }; diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 579c6e3f9..0bf034ef3 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -352,13 +352,6 @@ typedef struct EntityInfo u8 unk204; } EntityInfo; -// size: 0x4 -typedef struct EntTrapInfo -{ - /* 0x0 */ u8 unk0; - /* 0x0 */ u8 unk1; -} EntTrapInfo; - // size: 0x74 | Used for PokĂ©mon, items, and traps. typedef struct Entity { @@ -477,9 +470,4 @@ static inline void SetExpMultplier(EntityInfo *info) SetRegularExpMultiplier(info); } -static inline EntityInfo *GetEntInfo(Entity *ent) -{ - return ent->axObj.info.monster; -} - #endif diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index 66642c31b..5f20fad1b 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -7,6 +7,7 @@ #include "structs/map.h" #include "structs/rgb.h" #include "structs/str_position.h" +#include "structs/str_traps.h" #include "sprite.h" #define DUNGEON_MAX_SIZE_X 56 @@ -356,7 +357,7 @@ typedef struct Dungeon /* 0x3800 */ s16 deoxysForm; Item unk3804[DUNGEON_MAX_ITEMS]; /* 0x3904 */ s16 unk3904; - EntTrapInfo unk3908[DUNGEON_MAX_TRAPS]; + Trap unk3908[DUNGEON_MAX_TRAPS]; /* 0x3A08 */ bool8 unk3A08; /* 0x3A09 */ bool8 unk3A09; /* 0x3A0A */ bool8 unk3A0A; diff --git a/include/structs/str_traps.h b/include/structs/str_traps.h index 1c3d4f9e4..8727333da 100644 --- a/include/structs/str_traps.h +++ b/include/structs/str_traps.h @@ -3,10 +3,11 @@ #include "constants/trap.h" -typedef struct Trap +// size: 0x4 +typedef struct Trap { /* 0x0 */ u8 id; /* 0x1 */ u8 unk1; } Trap; -#endif // GUARD_STR_TRAPS_H +#endif // GUARD_STR_TRAPS_H \ No newline at end of file diff --git a/src/code_803E724.c b/src/code_803E724.c index 7c9233200..f33a118a8 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -849,9 +849,9 @@ void sub_803F27C(bool8 a0) strPtr->blinded = 0; strPtr->hallucinating = 0; strPtr->unk1820F = 0; - strPtr->unk1820D = 0; + strPtr->unk1820D = FALSE; strPtr->unk18211 = 0; - strPtr->unk1820E = 0; + strPtr->unk1820E = FALSE; strPtr->unk1820B = 0; strPtr->unk1820C = 0; } @@ -979,8 +979,8 @@ void sub_803F580(u8 a0) strPtr->cameraPixelPos.y = (cameraTarget->pixelPos.y / 256) - 96; if (HasHeldItem(cameraTarget, ITEM_X_RAY_SPECS) && info->isTeamLeader) { - strPtr->unk1820D = 1; - strPtr->unk1820E = 1; + strPtr->unk1820D = TRUE; + strPtr->unk1820E = TRUE; } else { strPtr->unk1820D = info->powerEars; @@ -1112,8 +1112,8 @@ void sub_803F878(s32 a0, s32 a1) strPtr->cameraPixelPos.y = (a1 / 256) - 96; strPtr->cameraPos.x = a0 / 6144; strPtr->cameraPos.y = a1 / 6144; - strPtr->unk1820D = 0; - strPtr->unk1820E = 0; + strPtr->unk1820D = FALSE; + strPtr->unk1820E = FALSE; strPtr->unk18211 = 0; strPtr->unk18216 = 0; diff --git a/src/code_80450F8.c b/src/code_80450F8.c index 243bb1e9f..6e1b42eb3 100644 --- a/src/code_80450F8.c +++ b/src/code_80450F8.c @@ -391,7 +391,7 @@ Entity *sub_804550C(s16 a) ); } -Entity *sub_8045684(u8 a, Position *pos, u8 c) +Entity *sub_8045684(u8 trapID, Position *pos, u8 c) { Entity *entity; s32 i; @@ -401,7 +401,7 @@ Entity *sub_8045684(u8 a, Position *pos, u8 c) if (!EntityExists(entity)) { entity->type = ENTITY_TRAP; entity->axObj.info.trap = &gDungeon->unk3908[i]; - entity->axObj.info.trap->unk0 = a; + entity->axObj.info.trap->id = trapID; entity->axObj.info.trap->unk1 = c; entity->unk1C = 0; @@ -457,19 +457,19 @@ bool8 sub_8045804(Entity *ent) { UnkDungeonGlobal_unk181E8_sub* saveTyping; Entity* camTarget; - EntityInfo *entInfo; + EntityInfo *monInfo; switch (GetEntityType(ent)) { case ENTITY_MONSTER: { if (ent->isVisible) { saveTyping = &gDungeon->unk181e8; camTarget = saveTyping->cameraTarget; - entInfo = GetEntInfo(ent); + monInfo = GetEntInfo(ent); - if (!entInfo->isNotTeamMember) + if (!monInfo->isNotTeamMember) return TRUE; - if (!saveTyping->unk1820F && entInfo->transformStatus.transformStatus == STATUS_INVISIBLE) + if (!saveTyping->unk1820F && monInfo->transformStatus.transformStatus == STATUS_INVISIBLE) return FALSE; if (saveTyping->unk1820B || saveTyping->unk1820D) @@ -480,6 +480,9 @@ bool8 sub_8045804(Entity *ent) } return FALSE; } + /*case ENTITY_TRAP: + case ENTITY_ITEM: + case ENTITY_UNK_4:*/ default: { return TRUE; } diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index 8da4a347b..c1862ccea 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -21,6 +21,7 @@ #include "code_8045A00.h" #include "dungeon_items.h" #include "structs/str_damage.h" +#include "dungeon_util.h" void sub_8042940(Entity *r0); void sub_80428B0(Entity *r0); diff --git a/src/code_8072B78.c b/src/code_8072B78.c index 12a3b08da..d3b1eddb1 100644 --- a/src/code_8072B78.c +++ b/src/code_8072B78.c @@ -2,9 +2,10 @@ #include "code_805D8C8.h" #include "code_806CD90.h" #include "dungeon_map_access.h" +#include "dungeon_message.h" #include "dungeon_movement.h" #include "dungeon_random.h" -#include "dungeon_message.h" +#include "dungeon_util.h" #include "moves.h" #include "pokemon_mid.h" #include "pokemon_mid.h" @@ -13,7 +14,6 @@ #include "structs/map.h" #include "structs/str_pokemon.h" -extern Position gAdjacentTileOffsets[]; extern u8 *gUnknown_80FE2EC[]; struct unkStruct_806B7F8 diff --git a/src/code_80861A8.c b/src/code_80861A8.c index df08b8531..e53b058e0 100644 --- a/src/code_80861A8.c +++ b/src/code_80861A8.c @@ -5,6 +5,7 @@ #include "code_803E668.h" #include "code_806CD90.h" #include "dungeon_music.h" +#include "dungeon_util.h" extern const unkStruct_2039DB0 gUnknown_8107380; diff --git a/src/dungeon_util.c b/src/dungeon_util.c index 56885cb0b..4db47a0a0 100644 --- a/src/dungeon_util.c +++ b/src/dungeon_util.c @@ -47,22 +47,22 @@ u8 GetEntityRoom(Entity *entity) Trap* GetTrapData(Entity *entity) { - return (Trap *) GetEntInfo(entity); + return entity->axObj.info.trap; } Item* GetItemData(Entity *entity) { - return (Item *) GetEntInfo(entity); + return entity->axObj.info.item; } Trap* GetTrapData_1(Entity *entity) { - return (Trap *) GetEntInfo(entity); + return entity->axObj.info.trap; } Item* GetItemData_1(Entity *entity) { - return (Item*) GetEntInfo(entity); + return entity->axObj.info.item; } Tile *GetTileAtEntity(Entity *entity) diff --git a/src/status_checks.c b/src/status_checks.c index e7643e2f6..14d05b60c 100644 --- a/src/status_checks.c +++ b/src/status_checks.c @@ -1,6 +1,6 @@ #include "global.h" #include "status_checks.h" - +#include "dungeon_util.h" #include "charge_move.h" #include "code_8045A00.h" #include "dungeon_message.h" From 875e3fefa1407981c62749611022b6245481ec2d Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Mon, 11 Nov 2024 10:13:58 -0500 Subject: [PATCH 28/48] Complete code_80450F8.s --- asm/code_80450F8.s | 141 ----------------------------------------- include/code_803E724.h | 8 +++ ld_script.txt | 1 - src/code_803E724.c | 1 + src/code_8041AD0.c | 4 +- src/code_80450F8.c | 50 +++++++++++++++ src/dungeon_ai.c | 4 +- src/dungeon_message.c | 4 +- src/dungeon_move.c | 2 +- src/move_actions.c | 6 +- src/trap.c | 6 +- 11 files changed, 72 insertions(+), 155 deletions(-) delete mode 100644 asm/code_80450F8.s create mode 100644 include/code_803E724.h diff --git a/asm/code_80450F8.s b/asm/code_80450F8.s deleted file mode 100644 index 84d2e416b..000000000 --- a/asm/code_80450F8.s +++ /dev/null @@ -1,141 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start sub_8045888 -sub_8045888: - push {r4,r5,lr} - adds r4, r0, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08045988 - ldr r1, [r4, 0xC] - cmp r1, 0 - bge _0804589C - adds r1, 0xFF -_0804589C: - asrs r1, 8 - ldr r0, _080458F0 - ldr r2, [r0] - ldr r3, _080458F4 - adds r0, r2, r3 - movs r5, 0 - ldrsh r0, [r0, r5] - subs r3, r1, r0 - ldr r0, [r4, 0x10] - cmp r0, 0 - bge _080458B4 - adds r0, 0xFF -_080458B4: - asrs r0, 8 - ldr r5, _080458F8 - adds r1, r2, r5 - movs r5, 0 - ldrsh r1, [r1, r5] - subs r1, r0, r1 - movs r0, 0x20 - negs r0, r0 - cmp r3, r0 - blt _08045988 - cmp r1, r0 - blt _08045988 - movs r0, 0x88 - lsls r0, 1 - cmp r3, r0 - bgt _08045988 - cmp r1, 0xC0 - bgt _08045988 - ldr r0, _080458FC - adds r5, r2, r0 - adds r0, r4, 0 - bl GetEntityType - cmp r0, 0x5 - bhi _08045984 - lsls r0, 2 - ldr r1, _08045900 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_080458F0: .4byte gDungeon -_080458F4: .4byte 0x000181f0 -_080458F8: .4byte 0x000181f2 -_080458FC: .4byte 0x000181e8 -_08045900: .4byte _08045904 - .align 2, 0 -_08045904: - .4byte _08045988 - .4byte _08045934 - .4byte _08045964 - .4byte _0804591C - .4byte _08045984 - .4byte _08045988 -_0804591C: - adds r0, r5, 0 - adds r0, 0x26 -_08045920: - ldrb r0, [r0] - cmp r0, 0 - bne _08045984 - adds r0, r4, 0x4 - bl sub_803F428 - lsls r0, 24 -_0804592E: - cmp r0, 0 - bne _08045984 - b _08045988 -_08045934: - ldr r1, [r4, 0x70] - ldrb r0, [r1, 0x6] - cmp r0, 0 - beq _08045984 - ldr r0, _0804595C - ldr r0, [r0] - ldr r2, _08045960 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _08045954 - adds r0, r1, 0 - adds r0, 0xE4 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08045988 -_08045954: - adds r0, r5, 0 - adds r0, 0x25 - b _08045920 - .align 2, 0 -_0804595C: .4byte gDungeon -_08045960: .4byte 0x0001820f -_08045964: - ldr r0, _0804597C - ldr r0, [r0] - ldr r3, _08045980 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _08045984 - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - b _0804592E - .align 2, 0 -_0804597C: .4byte gDungeon -_08045980: .4byte 0x0001820f -_08045984: - movs r0, 0x1 - b _0804598A -_08045988: - movs r0, 0 -_0804598A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8045888 - - .align 2, 0 diff --git a/include/code_803E724.h b/include/code_803E724.h new file mode 100644 index 000000000..a72345f17 --- /dev/null +++ b/include/code_803E724.h @@ -0,0 +1,8 @@ +#ifndef GUARD_CODE_803E724_H +#define GUARD_CODE_803E724_H + +#include "structs/str_position.h" + +bool8 sub_803F428(Position *pos); + +#endif // GUARD_CODE_803E724_H \ No newline at end of file diff --git a/ld_script.txt b/ld_script.txt index 7c02dd494..33ff81de7 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -217,7 +217,6 @@ SECTIONS { src/code_8044CC8.o(.text); src/dungeon_util.o(.text); src/code_80450F8.o(.text); - asm/code_80450F8.o(.text); src/dungeon_visibility.o(.text); src/code_8045A00.o(.text); asm/code_8045A00.o(.text); diff --git a/src/code_803E724.c b/src/code_803E724.c index f33a118a8..58a187058 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -22,6 +22,7 @@ #include "dungeon_items.h" #include "constants/item.h" #include "constants/status.h" +#include "code_803E724.h" extern s32 gDungeonBrightness; extern u32 gUnknown_202EDD0; diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index 9a0baa45a..a7be0fc28 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -1,6 +1,7 @@ #include "global.h" #include "code_800E9A8.h" #include "code_803E46C.h" +#include "code_803E724.h" #include "code_804267C.h" #include "code_806CD90.h" #include "code_8041AD0.h" @@ -34,7 +35,6 @@ extern void sub_803ED30(u8, Entity *pokemon, u8, u8); extern void sub_804151C(Entity *pokemon, u32 r1, u8 r2); extern u32 sub_806F62C(u32); extern void PlaySoundEffect(u32); -extern u8 sub_803F428(Position *pos); extern void sub_8041550(Entity *pokemon, u32, u32, u32, u32, u32); void EntityUpdateStatusSprites(Entity *entity); @@ -869,7 +869,7 @@ void sub_80421C0(Entity *pokemon, u16 r1) void sub_80421EC(Position *pos, u16 r1) { - if(sub_803F428(pos) != 0) + if(sub_803F428(pos)) PlaySoundEffect(r1); } diff --git a/src/code_80450F8.c b/src/code_80450F8.c index 6e1b42eb3..6c87acccd 100644 --- a/src/code_80450F8.c +++ b/src/code_80450F8.c @@ -1,5 +1,6 @@ #include "global.h" #include "structs/str_dungeon.h" +#include "code_803E724.h" #include "code_80450F8.h" #include "dungeon_map_access.h" #include "dungeon_range.h" @@ -491,4 +492,53 @@ bool8 sub_8045804(Entity *ent) return FALSE; } } +} + +bool8 sub_8045888(Entity *ent) +{ + if (ent->isVisible) { + s32 x = (ent->pixelPos.x / 256) - gDungeon->unk181e8.cameraPixelPos.x; + s32 y = (ent->pixelPos.y / 256) - gDungeon->unk181e8.cameraPixelPos.y; + + if (x >= -32 && y >= -32 && x <= 272 && y <= 192) { + UnkDungeonGlobal_unk181E8_sub *saveTyping = &gDungeon->unk181e8; + + switch (GetEntityType(ent)) { + case ENTITY_ITEM: { + if (!saveTyping->unk1820E && !sub_803F428(&ent->pos)) + return FALSE; + break; + } + case ENTITY_MONSTER: { + EntityInfo *monInfo = GetEntInfo(ent); + + if (monInfo->isNotTeamMember) { + if (!gDungeon->unk181e8.unk1820F && monInfo->transformStatus.transformStatus == STATUS_INVISIBLE) + return FALSE; + + if (!saveTyping->unk1820D && !sub_803F428(&ent->pos)) + return FALSE; + } + break; + } + case ENTITY_TRAP: { + if (!gDungeon->unk181e8.unk1820F && !ent->isVisible) + return FALSE; + break; + } + case ENTITY_NOTHING: + case ENTITY_UNK_5: { + return FALSE; + } + case ENTITY_UNK_4: + default: { + break; + } + } + + return TRUE; + } + } + + return FALSE; } \ No newline at end of file diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index c1a6c04a5..fa05e9021 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -2,6 +2,7 @@ #include "dungeon_ai.h" #include "code_803E668.h" +#include "code_803E724.h" #include "code_8045A00.h" #include "dungeon_message.h" #include "code_8077274_1.h" @@ -41,7 +42,6 @@ extern char *gPtrItsaMonsterHouseMessage; extern u8 sub_8044B28(void); extern void sub_807AB38(Entity *, u32); extern void sub_8041888(u32); -extern u8 sub_803F428(s16 *); void sub_8075900(Entity *pokemon, u8 r1) { @@ -60,7 +60,7 @@ void sub_8075900(Entity *pokemon, u8 r1) gDungeon->unk644.monsterHouseTriggeredEvent = TRUE; sub_807AB38(pokemon, r1); sub_8041888(0); - if(sub_803F428(&pokemon->pos.x) != 0) + if(sub_803F428(&pokemon->pos)) sub_803E708(0x78, 0x39); } } diff --git a/src/dungeon_message.c b/src/dungeon_message.c index 718378551..026ef5362 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -3,6 +3,7 @@ #include "dungeon.h" #include "structs/dungeon_entity.h" #include "code_803E46C.h" +#include "code_803E724.h" #include "string_format.h" #include "code_800E9E4.h" #include "menu_input.h" @@ -30,7 +31,6 @@ static void DisplayMessageAddToLog(Entity *pokemon, const u8 *str, u8 r2); static bool8 sub_8052DC0(Entity *); extern bool8 sub_8045888(Entity *pokemon); -extern u8 sub_803F428(Position *); extern void sub_805E804(void); extern void sub_803EAF0(s32, s32); extern void sub_8040238(void); @@ -171,7 +171,7 @@ void TryDisplayDungeonLoggableMessage5(Entity *pokemon, Position *pos, const u8 { u8 flag; flag = sub_8045888(pokemon) ? TRUE : FALSE; - if(sub_803F428(pos) != 0) + if(sub_803F428(pos)) { flag = TRUE; } diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 89e241c0c..0f7f3bebf 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -36,11 +36,11 @@ #include "status_actions.h" #include "code_8045A00.h" #include "code_803E668.h" +#include "code_803E724.h" #include "code_803E46C.h" #include "code_8041AD0.h" extern void sub_80429C8(Entity *r0); -extern u8 sub_803F428(Position *); extern bool8 sub_8045888(Entity *r0); extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC); extern void CalcDamage(Entity *, Entity *, u8, u32, u32, struct DamageStruct *dmgStruct, u32, u16, u32); diff --git a/src/move_actions.c b/src/move_actions.c index 479362d3e..7bf1aee60 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -1,6 +1,7 @@ #include "global.h" #include "charge_move.h" #include "code_803E46C.h" +#include "code_803E724.h" #include "code_8045A00.h" #include "code_806CD90.h" #include "code_8077274_1.h" @@ -180,7 +181,6 @@ extern void sub_806A5B8(Entity *entity); extern void sub_80694C0(Entity *, s32, s32, u32); void sub_8075900(Entity *pokemon, u8 r1); extern u8 sub_8044B28(void); -extern u8 sub_803F428(Position *pos); extern void sub_807EC28(bool8); extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); extern void sub_804652C(Entity *, Entity *, Item *, u32, Position *); @@ -2695,7 +2695,7 @@ _0805A8C2: pos2.y = ((temp2 - target->pixelPos.y) / 0xc); - if (((check = sub_803F428(&target->pos), r9 = &target->pos, check != 0)) || (sub_803F428(&pos1) != 0)) { + if (((check = sub_803F428(&target->pos), r9 = &target->pos, check)) || (sub_803F428(&pos1))) { for(counter = 0; counter < 0xC; counter++) { IncreaseEntityPixelPos(target,pos2.x,pos2.y); @@ -2718,7 +2718,7 @@ _0805A8C2: else { _0805A9FE: if (EntityExists(target)) { - if ((sub_803F428(r9) != 0) || (sub_803F428(&pos1) != 0)) { + if ((sub_803F428(r9)) || (sub_803F428(&pos1))) { for(counter = 0; counter < 0xC; counter++) { IncreaseEntityPixelPos(target, -pos2.x,-pos2.y); diff --git a/src/trap.c b/src/trap.c index abc60d817..fe730421d 100644 --- a/src/trap.c +++ b/src/trap.c @@ -2,6 +2,7 @@ #include "trap.h" #include "code_803E668.h" +#include "code_803E724.h" #include "code_80450F8.h" #include "code_8041AD0.h" #include "code_8045A00.h" @@ -83,7 +84,6 @@ void DealDamageToEntity(Entity *,s16,u32,u32); void sub_806F480(Entity *, u32); void sub_804225C(Entity *, Position *, u8); void sub_8071DA4(Entity *); -extern u8 sub_803F428(Position *pos); void sub_806A1E8(Entity *pokemon); u8 sub_803D6FC(void); extern void sub_807DF38(Entity *pokemon, Entity *target, Position *pos, u32, u8 moveType, s16); @@ -265,7 +265,7 @@ void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4) text = *gUnknown_80FDB7C; } if (text != NULL) { - if (sub_803F428(pos) != '\0') { + if (sub_803F428(pos)) { sub_8049ED4(); } TryDisplayDungeonLoggableMessage3(pokemon,target,text); @@ -274,7 +274,7 @@ void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4) } } } - if (sub_803F428(pos) != '\0') { + if (sub_803F428(pos)) { sub_80421C0(0,0x15c); sub_8049ED4(); sub_804225C(pokemon,pos,trapData->id); From 248d1c633c6470a0fefa34fbbb419a3fb553326d Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Mon, 11 Nov 2024 10:16:38 -0500 Subject: [PATCH 29/48] Update code_80450F8.c --- src/code_80450F8.c | 132 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/src/code_80450F8.c b/src/code_80450F8.c index 6c87acccd..88ad322bc 100644 --- a/src/code_80450F8.c +++ b/src/code_80450F8.c @@ -9,6 +9,70 @@ // Related to sub_80828E0 // 93.08% https://decomp.me/scratch/AYGBN +/*Entity *sub_80453AC(s16 id) +{ + s32 something; // r1 + s32 uVar8; // r2 + Entity *entity; // r4 + s32 r5; + u8 bodySize; // r6 + s32 id_; // r8 + //register s32 id_ asm("r8"); // r8 + s32 r9; + + id_ = id; // SpeciesId() ? + r9 = -1; + bodySize = GetBodySize(id_); + + for (r5 = 0; r5 <= MAX_TEAM_BODY_SIZE - bodySize; r5++) { + for (uVar8 = 0; uVar8 < bodySize; uVar8++) { + if (gUnknown_202EE70[r5 + uVar8] != 0) + break; + } + + if (uVar8 == bodySize) { + r9 = r5; + break; + } + } + + if (r9 != -1) { + for (r5 = 0; r5 < MAX_TEAM_MEMBERS; r5++) { + entity = gDungeon->teamPokemon[r5]; + if (!EntityExists(entity)) { + entity->type = ENTITY_MONSTER; + entity->unk24 = r5; + entity->axObj.info = &gDungeon->unk69C[r5]; + entity->axObj.info->id = id_; + entity->axObj.info->apparentID = sub_8069F54(NULL, id_); + entity->axObj.info->isNotTeamMember = FALSE; + + entity->axObj.spriteFile = GetSpriteData(sub_8069F54(NULL, id_)); + entity->axObj.unk40_maybeAnimTimer = (r9 * 0x10) + 0x40; + entity->axObj.unk42_animId1 = 7; + entity->axObj.unk44_direction1 = 0; + entity->axObj.unk43_animId2 = 0xFF; + entity->axObj.unk45_orientation = 1; + entity->axObj.unk47 = 1; + + entity->unk1C = 0; + sub_8045ACC(); + entity->axObj.info->unk167 = r9; + entity->axObj.info->unk168 = bodySize; + + for (something = 0; something < bodySize; something++) { + gUnknown_202EE70[r9] = 1; + r9++; + } + + entity->spawnGenID = gDungeon->unk668++; + return entity; + } + } + } + + return NULL; +}*/ NAKED Entity *sub_80453AC(s16 id) { @@ -195,6 +259,74 @@ Entity *sub_80453AC(s16 id) // Related to sub_8082A08 // 91.51% https://decomp.me/scratch/Fp0Kw +/*Entity *sub_804550C(s16 a) +{ + s32 something; // r1 + s32 uVar8; // r2 + Entity *entity; // r4 + s32 r5; + u8 r6; + s32 id; // r8 + s32 r9; + s32 timer; // sp0 + + id = a; + r9 = -1; + r6 = GetBodySize(id); + + for (r5 = 0; r5 <= DUNGEON_MAX_WILD_POKEMON_BODY_SIZE - r6; r5++) { + for (uVar8 = 0; uVar8 < r6; uVar8++) { + if (gUnknown_202EE76[r5 + uVar8] != 0) + break; + } + + if (uVar8 == r6) { + r9 = r5; + break; + } + } + + if (r9 != -1) { + for (r5 = 0; r5 < DUNGEON_MAX_WILD_POKEMON_BODY_SIZE; r5++) { + timer = (r9 * 0x10) + 0xA0; + entity = gDungeon->wildPokemon[r5]; + if (!EntityExists(entity)) { + entity->type = ENTITY_MONSTER; + entity->unk24 = r5; + entity->unk22 = 0; + entity->axObj.info = &gDungeon->unkEBC[r5]; + entity->axObj.info->id = id; + entity->axObj.info->apparentID = sub_8069F54(NULL, id); + entity->axObj.info->isNotTeamMember = TRUE; + + entity->axObj.spriteFile = GetSpriteData(sub_8069F54(NULL, id)); + entity->axObj.unk40_maybeAnimTimer = timer; + entity->axObj.unk42_animId1 = 7; + entity->axObj.unk44_direction1 = 0; + entity->axObj.unk43_animId2 = 0xFF; + entity->axObj.unk45_orientation = 1; + entity->axObj.unk47 = 1; + + entity->unk1C = 0; + + entity->axObj.info->unk167 = r9; + entity->axObj.info->unk168 = r6; + + for (something = 0; something < r6; something++) { + gUnknown_202EE76[r9] = 1; + r9++; + } + + sub_8045ACC(); + + entity->spawnGenID = gDungeon->unk668++; + return entity; + } + } + } + + return NULL; +}*/ NAKED Entity *sub_804550C(s16 a) { From 5f48654c207f7d8c7961cf7b6ba260a14a8d8a2c Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Sun, 3 Nov 2024 14:37:41 -0500 Subject: [PATCH 30/48] Sync some dungeon vars names with Sky --- asm/code_2.s | 6 +- asm/code_8040094.s | 2 +- asm/code_8045A00.s | 24 +-- asm/code_8046CE4.s | 8 +- asm/code_804FD30.s | 6 +- asm/code_805D8C8.s | 16 +- asm/code_805D8C8_1.s | 8 +- asm/code_8066D04.s | 26 +-- asm/code_8069E0C.s | 12 +- asm/code_80718D8.s | 4 +- asm/code_8072CF4.s | 10 +- asm/code_807CD9C.s | 22 +-- asm/code_807E5AC.s | 18 +- asm/code_807FCD4.s | 4 +- asm/code_808417C.s | 10 +- asm/ground_lives.s | 2 +- asm/ground_script.s | 2 +- asm/pokemon_3.s | 2 +- include/code_8045A00.h | 2 +- include/code_8077274_1.h | 2 +- include/constants/targeting.h | 6 +- include/dungeon_ai_attack.h | 2 +- include/dungeon_ai_movement.h | 2 +- include/dungeon_message.h | 2 +- include/dungeon_util_1.h | 4 +- include/pokemon.h | 4 +- include/status_checks.h | 2 +- include/structs/dungeon_entity.h | 52 ++++- include/structs/str_dungeon.h | 4 +- src/code_803E724.c | 2 +- src/code_8040094.c | 2 +- src/code_8041AD0.c | 2 +- src/code_804267C.c | 4 +- src/code_8042B34.c | 4 +- src/code_8045A00.c | 8 +- src/code_8048480.c | 34 ++-- src/code_805D8C8.c | 2 +- src/code_805D8C8_1.c | 22 +-- src/code_8066D04.c | 56 +++--- src/code_8069E0C.c | 10 +- src/code_806CD90.c | 34 ++-- src/code_806E8B0.c | 2 +- src/code_806FDF4.c | 16 +- src/code_80718D8.c | 10 +- src/code_8073CF0.c | 40 ++-- src/code_8075708.c | 2 +- src/code_8077274_1.c | 150 +++++++------- src/code_807CD9C.c | 10 +- src/code_807E1A0.c | 12 +- src/code_8083288.c | 10 +- src/debug_menu1.c | 2 +- src/dungeon_action.c | 24 +-- src/dungeon_ai.c | 46 ++--- src/dungeon_ai_attack.c | 28 +-- src/dungeon_ai_items.c | 6 +- src/dungeon_ai_leader.c | 14 +- src/dungeon_ai_movement.c | 24 +-- src/dungeon_ai_targeting.c | 28 +-- src/dungeon_capabilities.c | 2 +- src/dungeon_cutscenes.c | 326 +++++++++++++++---------------- src/dungeon_engine.c | 4 +- src/dungeon_items.c | 2 +- src/dungeon_message.c | 6 +- src/dungeon_move.c | 74 +++---- src/dungeon_pokemon_attributes.c | 8 +- src/dungeon_util.c | 4 +- src/dungeon_util_1.c | 92 ++++----- src/move_actions.c | 26 +-- src/move_checks.c | 2 +- src/move_effects_target.c | 44 ++--- src/personality_test1.c | 2 +- src/pokemon.c | 12 +- src/pokemon_mid.c | 4 +- src/status.c | 100 +++++----- src/status_actions.c | 22 +-- src/status_checks.c | 36 ++-- src/status_checks_1.c | 6 +- src/tile_types.c | 14 +- src/trap.c | 14 +- src/trap_1.c | 12 +- 80 files changed, 856 insertions(+), 824 deletions(-) diff --git a/asm/code_2.s b/asm/code_2.s index 499f7d72c..96cb0c1b1 100644 --- a/asm/code_2.s +++ b/asm/code_2.s @@ -3,7 +3,7 @@ .syntax unified - .text + .text thumb_func_start LoadTitleScreen LoadTitleScreen: @@ -1262,7 +1262,7 @@ sub_8001064: movs r0, 0x4 ldrsh r1, [r5, r0] adds r0, r4, 0 - bl CopyMonsterNametoBuffer + bl CopyMonsterNameToBuffer mov r0, sp adds r1, r4, 0 bl CopyStringtoBuffer @@ -1293,7 +1293,7 @@ _080010AE: movs r0, 0x6 ldrsh r1, [r5, r0] adds r0, r4, 0 - bl CopyMonsterNametoBuffer + bl CopyMonsterNameToBuffer mov r0, sp adds r1, r4, 0 bl CopyStringtoBuffer diff --git a/asm/code_8040094.s b/asm/code_8040094.s index 50633499f..8a8f947bc 100644 --- a/asm/code_8040094.s +++ b/asm/code_8040094.s @@ -1728,7 +1728,7 @@ _08040E6E: ldr r0, _08040ECC ldr r1, [r0] adds r0, r6, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r1, 0xD2 lsls r1, 1 adds r0, r6, 0 diff --git a/asm/code_8045A00.s b/asm/code_8045A00.s index 74b7efc43..5f79ba4d4 100644 --- a/asm/code_8045A00.s +++ b/asm/code_8045A00.s @@ -65,7 +65,7 @@ _08045E1E: ldr r0, _08045E38 adds r1, r7, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08045E3C b _08046048 .align 2, 0 @@ -278,7 +278,7 @@ _08045FAC: _08045FD0: ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08045FF2 .align 2, 0 _08045FDC: .4byte 0x00ff0008 @@ -288,7 +288,7 @@ _08045FE8: ldr r0, _08045FFC ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _08045FF2: ldrb r0, [r5, 0x2] bl TryDisplayItemPickupTutorialMessage @@ -331,12 +331,12 @@ _0804602E: ldr r0, _08046058 adds r1, r7, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0804605C _08046048: ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _080460E0 .align 2, 0 _08046054: .4byte gFormatBuffer_Items @@ -374,12 +374,12 @@ _08046094: ldr r0, _080460B8 adds r1, r7, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _080460BC _080460AC: ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _080460DA .align 2, 0 _080460B8: .4byte gFormatBuffer_Monsters @@ -394,7 +394,7 @@ _080460C0: ldr r0, _080460F4 ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _080460DA: ldrb r0, [r5, 0x2] bl TryDisplayItemPickupTutorialMessage @@ -996,7 +996,7 @@ sub_804652C: ldr r0, _080465A4 ldr r1, [r0] mov r0, r10 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser mov r0, r9 ldrb r1, [r0] movs r0, 0x1 @@ -1721,7 +1721,7 @@ _08046B0A: ldr r4, _08046B38 add r4, sp ldr r0, [r4] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08046C7C .align 2, 0 _08046B2C: .4byte 0x0000052c @@ -1734,7 +1734,7 @@ _08046B3C: ldr r5, _08046B50 add r5, sp ldr r0, [r5] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08046C7C .align 2, 0 _08046B4C: .4byte gItemLost @@ -1748,7 +1748,7 @@ _08046B54: ldr r2, _08046C94 add r2, sp ldr r0, [r2] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _08046B68: movs r3, 0 mov r9, r3 diff --git a/asm/code_8046CE4.s b/asm/code_8046CE4.s index 270377982..daa8afec3 100644 --- a/asm/code_8046CE4.s +++ b/asm/code_8046CE4.s @@ -410,7 +410,7 @@ _08047462: ldr r0, _080474C4 adds r1, r4, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _080474C8 ldr r1, [sp, 0x214] bl sub_8045C08 @@ -463,7 +463,7 @@ _080474E2: ldr r0, _0804750C adds r1, r4, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08047510 ldr r1, [sp, 0x214] bl sub_8045BF8 @@ -552,7 +552,7 @@ _08047596: ldr r0, _080475C0 ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _080475A8: movs r3, 0x90 lsls r3, 2 @@ -913,7 +913,7 @@ _0804786E: ldr r0, _080478D4 adds r1, r5, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags lsls r0, r6, 24 cmp r0, 0 beq _080478DC diff --git a/asm/code_804FD30.s b/asm/code_804FD30.s index e8517f86b..19dec61b2 100644 --- a/asm/code_804FD30.s +++ b/asm/code_804FD30.s @@ -4118,7 +4118,7 @@ sub_8051E7C: ldr r0, _08051EB4 ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _080520F6 .align 2, 0 _08051EB4: .4byte gUnknown_80FDDF0 @@ -4378,7 +4378,7 @@ _0805207A: ldr r0, _080520E8 ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r0, 0x14 movs r1, 0x3C bl sub_803E708 @@ -4399,7 +4399,7 @@ _080520EC: ldr r0, _08052108 ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _080520F6: add sp, 0x14 pop {r3-r5} diff --git a/asm/code_805D8C8.s b/asm/code_805D8C8.s index a4d028c38..da22012a1 100644 --- a/asm/code_805D8C8.s +++ b/asm/code_805D8C8.s @@ -2171,7 +2171,7 @@ sub_8062B74: ldr r0, _08062BD0 mov r1, r10 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08062BD4 ldr r2, [r0] movs r0, 0 @@ -2322,7 +2322,7 @@ sub_8062CA8: ldr r0, _08062CF8 adds r1, r4, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08062CFC ldr r2, [r0] movs r0, 0 @@ -3429,7 +3429,7 @@ sub_8063578: ldr r0, _080635FC ldr r1, [sp, 0x14] movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags lsls r4, 3 adds r4, 0xA ldr r0, _08063600 @@ -4122,7 +4122,7 @@ _08063AEC: ldr r0, _08063B2C ldr r1, [r0] adds r0, r6, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08063B3A .align 2, 0 _08063B1C: .4byte gDungeon @@ -4134,7 +4134,7 @@ _08063B30: ldr r0, _08063B50 ldr r1, [r0] adds r0, r6, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _08063B3A: movs r0, 0x78 movs r1, 0x1F @@ -4442,7 +4442,7 @@ _08063D70: ldr r0, _08063DAC ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08063DBA .align 2, 0 _08063D98: .4byte gDungeon @@ -4455,7 +4455,7 @@ _08063DB0: ldr r0, _08063DD0 ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _08063DBA: movs r0, 0x78 movs r1, 0x1F @@ -5474,7 +5474,7 @@ sub_806455C: ldr r1, [r4, 0x14] add r0, sp, 0x4 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags str r5, [sp] movs r0, 0x8 movs r1, 0x12 diff --git a/asm/code_805D8C8_1.s b/asm/code_805D8C8_1.s index c8b821026..f06cb8e2d 100644 --- a/asm/code_805D8C8_1.s +++ b/asm/code_805D8C8_1.s @@ -1010,7 +1010,7 @@ _080690A2: adds r0, r2 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags b _08069484 .align 2, 0 _080690E4: .4byte gDungeon @@ -1283,7 +1283,7 @@ _0806930A: adds r0, r2 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags b _08069352 .align 2, 0 _0806932C: .4byte gUnknown_202EE70 @@ -1301,7 +1301,7 @@ _08069338: adds r0, r3 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags _08069352: bl GetLeader cmp r0, 0 @@ -1515,7 +1515,7 @@ _080694FC: _0806950A: adds r0, r4, 0 adds r1, r4, 0 - bl SendImmobilizeEndMessage + bl EndFrozenClassStatus _08069512: movs r0, 0x4 ldrsh r2, [r4, r0] diff --git a/asm/code_8066D04.s b/asm/code_8066D04.s index 1bce6405c..4535c860c 100644 --- a/asm/code_8066D04.s +++ b/asm/code_8066D04.s @@ -135,7 +135,7 @@ _08066ECC: _08066F1E: ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08066F7E .align 2, 0 _08066F28: .4byte 0xffffff00 @@ -167,7 +167,7 @@ _08066F46: ldr r0, _08066F98 ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser ldr r0, _08066F9C ldr r0, [r0] ldr r2, _08066FA0 @@ -314,7 +314,7 @@ _08067040: _0806709E: ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _080670EE .align 2, 0 _080670A8: .4byte gFormatBuffer_Items + 0x50 @@ -339,7 +339,7 @@ _080670CA: ldr r0, _08067104 ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser ldr r0, _08067108 ldr r0, [r0] ldr r1, _0806710C @@ -390,7 +390,7 @@ sub_8067110: bl sub_80464AC adds r1, r0, 0 adds r0, r5, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser ldr r0, [r6] str r0, [sp, 0x8] adds r0, r5, 0 @@ -498,7 +498,7 @@ _08067220: _08067230: ldr r1, [r0] adds r0, r6, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r0, 0x14 movs r1, 0x4C bl sub_803E708 @@ -677,7 +677,7 @@ _08067384: ldr r0, _080673B8 ldr r1, [r0] adds r0, r6, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _080673C6 .align 2, 0 _080673B0: .4byte gFormatBuffer_Items @@ -687,7 +687,7 @@ _080673BC: ldr r0, _080673F8 ldr r1, [r0] adds r0, r6, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _080673C6: add r0, sp, 0x4 ldrb r0, [r0, 0x2] @@ -1198,7 +1198,7 @@ _080677B4: ldr r0, _080677F0 adds r1, r7, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _080677F4 ldr r5, [r0] ldr r0, _080677F8 @@ -1380,7 +1380,7 @@ sub_8067904: ldr r0, _08067944 adds r1, r5, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08067948 b _08067962 .align 2, 0 @@ -1396,12 +1396,12 @@ _0806794C: ldr r0, _0806796C adds r1, r5, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08067970 _08067962: ldr r1, [r0] adds r0, r5, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08067A56 .align 2, 0 _0806796C: .4byte gFormatBuffer_Monsters @@ -1477,7 +1477,7 @@ _080679DE: ldr r0, _08067A70 ldr r1, [r0] adds r0, r5, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _08067A04: ldrb r0, [r6, 0x7] cmp r0, 0 diff --git a/asm/code_8069E0C.s b/asm/code_8069E0C.s index fc6d11927..0f955d488 100644 --- a/asm/code_8069E0C.s +++ b/asm/code_8069E0C.s @@ -306,7 +306,7 @@ _0806A5CE: bne _0806A608 adds r0, r6, 0 adds r1, r6, 0 - bl SendImmobilizeEndMessage + bl EndFrozenClassStatus _0806A608: movs r1, 0x2 ldrsh r0, [r4, r1] @@ -399,7 +399,7 @@ _0806A6C4: beq _0806A6D2 adds r0, r6, 0 mov r1, r8 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0806A6D2: add sp, 0x4 pop {r3} @@ -663,7 +663,7 @@ sub_806A898: b _0806A8C8 _0806A8C2: adds r0, r4, 0 - bl MoveIfPossible + bl AIMovement _0806A8C8: movs r0, 0xB6 lsls r0, 1 @@ -817,7 +817,7 @@ _0806A9E0: _0806A9E6: ldr r1, [r0] adds r0, r4, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0806AA02 .align 2, 0 _0806A9F0: .4byte gPtrLinkMoveOneUseWarningMessage @@ -827,7 +827,7 @@ _0806A9F4: ldr r0, _0806AA08 ldr r1, [r0] adds r0, r4, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0806AA02: pop {r4,r5} pop {r0} @@ -1162,7 +1162,7 @@ _0806AC72: bne _0806AC92 adds r0, r6, 0 adds r1, r4, 0 - bl SendImmobilizeEndMessage + bl EndFrozenClassStatus _0806AC92: adds r0, r4, 0 movs r1, 0x45 diff --git a/asm/code_80718D8.s b/asm/code_80718D8.s index 7563ca795..d709a307d 100644 --- a/asm/code_80718D8.s +++ b/asm/code_80718D8.s @@ -359,7 +359,7 @@ _08072A0C: ldr r0, _08072A44 mov r1, r9 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08072A48 add r1, sp, 0x40 bl strcpy @@ -417,7 +417,7 @@ _08072A92: ldr r0, _08072AC0 mov r1, r9 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08072AC4 ldr r1, [r0] mov r0, r9 diff --git a/asm/code_8072CF4.s b/asm/code_8072CF4.s index b1f3b13b7..d2ebe183e 100644 --- a/asm/code_8072CF4.s +++ b/asm/code_8072CF4.s @@ -4,7 +4,7 @@ .syntax unified .text - + thumb_func_start sub_80732F0 sub_80732F0: push {r4-r7,lr} @@ -148,11 +148,11 @@ _080733FC: ldr r0, _08073438 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0807343C ldr r1, [r0] mov r0, r8 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r0, 0x7 mov r1, r9 ands r1, r0 @@ -360,11 +360,11 @@ _0807359C: ldr r0, _08073600 adds r1, r7, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08073604 ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r0, 0x7 mov r1, r8 ands r1, r0 diff --git a/asm/code_807CD9C.s b/asm/code_807CD9C.s index bc96db041..358e4db4c 100644 --- a/asm/code_807CD9C.s +++ b/asm/code_807CD9C.s @@ -165,7 +165,7 @@ _0807D634: ldr r2, _0807D650 add r2, sp ldr r0, [r2] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0807D9F4 .align 2, 0 _0807D650: .4byte 0x00000d08 @@ -585,7 +585,7 @@ _0807D996: ldr r2, _0807D9C4 add r2, sp ldr r0, [r2] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0807D9EE .align 2, 0 _0807D9B4: .4byte gUnknown_80F4468 @@ -605,7 +605,7 @@ _0807D9E0: ldr r3, _0807DA0C add r3, sp ldr r0, [r3] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0807D9EE: movs r0, 0x1 bl sub_807EC28 @@ -647,7 +647,7 @@ sub_807DA14: ldr r0, _0807DA48 adds r1, r6, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0807DA4C b _0807DA5C .align 2, 0 @@ -818,7 +818,7 @@ _0807DB94: _0807DBA0: ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0807DC54 .align 2, 0 _0807DBAC: .4byte gUnknown_80FD08C @@ -878,7 +878,7 @@ _0807DBF4: ldr r0, _0807DC2C ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0807DC3A .align 2, 0 _0807DC24: .4byte 0x0000fffc @@ -888,7 +888,7 @@ _0807DC30: ldr r0, _0807DC60 ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0807DC3A: ldr r0, _0807DC64 ldr r0, [r0] @@ -953,7 +953,7 @@ _0807DCAC: _0807DCB8: ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0807DF0E .align 2, 0 _0807DCC4: .4byte gUnknown_80FD3D0 @@ -1192,7 +1192,7 @@ _0807DE74: ldr r0, _0807DF30 ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r0, 0x28 movs r1, 0x2B bl sub_803E708 @@ -1316,7 +1316,7 @@ _0807DF8E: ldr r0, _0807DFB0 mov r1, r10 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags b _0807DFC2 .align 2, 0 _0807DFA8: .4byte gDungeon @@ -1346,7 +1346,7 @@ _0807DFD4: ldr r0, _0807E184 mov r1, r10 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0807E188 ldr r2, [r0] ldr r0, [sp, 0x8] diff --git a/asm/code_807E5AC.s b/asm/code_807E5AC.s index be82e0ed6..f48f277b1 100644 --- a/asm/code_807E5AC.s +++ b/asm/code_807E5AC.s @@ -228,7 +228,7 @@ _0807E816: ldr r0, _0807E884 ldr r1, [r0] adds r0, r5, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0807E844: movs r5, 0 _0807E846: @@ -494,7 +494,7 @@ MudWaterSportEffect: bl GetLeader ldr r1, _0807EA68 ldr r1, [r1] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0807EA8C .align 2, 0 _0807EA5C: .4byte gUnknown_80F4EAC @@ -514,7 +514,7 @@ _0807EA6C: bl GetLeader ldr r1, _0807EA9C ldr r1, [r1] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0807EA8C: pop {r0} bx r0 @@ -677,7 +677,7 @@ _0807EBA6: bl GetLeader ldr r1, _0807EC1C ldr r1, [r1] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0807EBD4: ldr r4, _0807EC14 ldr r0, [r4] @@ -697,7 +697,7 @@ _0807EBD4: bl GetLeader ldr r1, _0807EC24 ldr r1, [r1] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0807EC00: ldr r0, [sp, 0x8] add sp, 0xC @@ -1621,7 +1621,7 @@ sub_807F33C: bl GetLeader ldr r1, _0807F428 ldr r1, [r1] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r6, 0 _0807F360: movs r5, 0 @@ -1748,7 +1748,7 @@ sub_807F43C: ldr r0, _0807F468 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0807F46C b _0807F694 .align 2, 0 @@ -1761,7 +1761,7 @@ _0807F470: ldr r0, _0807F488 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0807F48C ldr r2, [r0] mov r0, r8 @@ -2046,7 +2046,7 @@ _0807F6A8: ldr r0, _0807F860 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0807F864 ldr r2, [r0] ldr r0, [sp, 0xEC] diff --git a/asm/code_807FCD4.s b/asm/code_807FCD4.s index e871f643d..b7100db21 100644 --- a/asm/code_807FCD4.s +++ b/asm/code_807FCD4.s @@ -206,7 +206,7 @@ _08080A26: _08080A2E: ldr r1, [r0] ldr r0, [sp, 0x14] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08080A46 .align 2, 0 _08080A38: .4byte gUnknown_80FDACC @@ -214,7 +214,7 @@ _08080A3C: ldr r0, _08080A58 ldr r1, [r0] ldr r0, [sp, 0x14] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _08080A46: add sp, 0x30 pop {r3-r5} diff --git a/asm/code_808417C.s b/asm/code_808417C.s index f105d3a3f..e23e6dcab 100644 --- a/asm/code_808417C.s +++ b/asm/code_808417C.s @@ -322,12 +322,12 @@ sub_8084448: adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags adds r4, 0x50 adds r0, r4, 0 adds r1, r5, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags adds r0, r5, 0 bl sub_8070BC0 lsls r0, 24 @@ -516,12 +516,12 @@ sub_80845E0: adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags adds r4, 0x50 adds r0, r4, 0 adds r1, r6, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags adds r0, r6, 0 bl sub_8070BC0 lsls r0, 24 @@ -585,7 +585,7 @@ _08084680: ldr r0, _0808469C adds r1, r7, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags adds r0, r7, 0 bl sub_8070BC0 lsls r0, 24 diff --git a/asm/ground_lives.s b/asm/ground_lives.s index 3a313dec8..6bde62e41 100644 --- a/asm/ground_lives.s +++ b/asm/ground_lives.s @@ -3103,7 +3103,7 @@ _080A8F30: ldrsh r1, [r0, r2] _080A8F34: adds r0, r4, 0 - bl CopyMonsterNametoBuffer + bl CopyMonsterNameToBuffer b _080A8F44 _080A8F3C: ldr r1, _080A8F4C diff --git a/asm/ground_script.s b/asm/ground_script.s index 23f75bf91..b4ed75cbd 100644 --- a/asm/ground_script.s +++ b/asm/ground_script.s @@ -355,7 +355,7 @@ _080A184C: bl sub_80A8BFC lsls r0, 16 asrs r0, 16 - bl CanMove + bl GetCanMoveFlag b _080A171E _080A185E: lsls r0, r5, 16 diff --git a/asm/pokemon_3.s b/asm/pokemon_3.s index efd9f6d7e..5a3b14ddf 100644 --- a/asm/pokemon_3.s +++ b/asm/pokemon_3.s @@ -753,7 +753,7 @@ _0808FDB0: movs r3, 0 ldrsh r1, [r2, r3] adds r0, r6, 0 - bl CopyMonsterNametoBuffer + bl CopyMonsterNameToBuffer ldr r1, _0808FEF4 mov r2, r10 movs r3, 0 diff --git a/include/code_8045A00.h b/include/code_8045A00.h index df17445c2..15dc82383 100644 --- a/include/code_8045A00.h +++ b/include/code_8045A00.h @@ -3,6 +3,6 @@ #include "structs/dungeon_entity.h" -void SetMessageArgument(u8 *buffer, Entity *entity, u32 param_3); +void SubstitutePlaceholderStringTags(u8 *buffer, Entity *entity, u32 param_3); #endif // GUARD_CODE_8045A00_H diff --git a/include/code_8077274_1.h b/include/code_8077274_1.h index f1466b173..cc9712be4 100644 --- a/include/code_8077274_1.h +++ b/include/code_8077274_1.h @@ -37,7 +37,7 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4); void sub_807A0CC(Entity * pokemon, Entity * target); void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4); void SendNonVolatileEndMessage(Entity * pokemon, Entity * target); -void SendImmobilizeEndMessage(Entity * pokemon, Entity *target); +void EndFrozenClassStatus(Entity * pokemon, Entity *target); void SendVolatileEndMessage(Entity * pokemon, Entity *target); void SendProtectionEndMessage(Entity * pokemon, Entity *target); void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus); diff --git a/include/constants/targeting.h b/include/constants/targeting.h index 956e30584..cce44ee4e 100644 --- a/include/constants/targeting.h +++ b/include/constants/targeting.h @@ -1,9 +1,9 @@ #ifndef GUARD_CONSTANTS_TARGETING_H #define GUARD_CONSTANTS_TARGETING_H -#define TARGETING_DECOY_NONE 0 -#define TARGETING_DECOY_TEAM 1 -#define TARGETING_DECOY_WILD 2 +#define DECOY_AI_NONE 0 +#define DECOY_AI_TEAM 1 +#define DECOY_AI_WILD 2 #define TREATMENT_TREAT_AS_ALLY 0 #define TREATMENT_TREAT_AS_ENEMY 1 diff --git a/include/dungeon_ai_attack.h b/include/dungeon_ai_attack.h index 95a5f84ab..8f5b31c83 100644 --- a/include/dungeon_ai_attack.h +++ b/include/dungeon_ai_attack.h @@ -13,7 +13,7 @@ struct AIPossibleMove s32 weight; }; -void DecideAttack(Entity *pokemon); +void ChooseAIMove(Entity *pokemon); s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move *move); bool8 IsTargetInLineRange(Entity *user, Entity *target, s32 range); s32 TryAddTargetToAITargetList(s32 numPotentialTargets, s32 targetingFlags, Entity *user, Entity *target, Move *move, u32 hasStatusChecker); diff --git a/include/dungeon_ai_movement.h b/include/dungeon_ai_movement.h index 5324a3f3c..1b7df916f 100644 --- a/include/dungeon_ai_movement.h +++ b/include/dungeon_ai_movement.h @@ -3,7 +3,7 @@ #include "structs/dungeon_entity.h" -void MoveIfPossible(Entity *pokemon, bool8 showRunAwayEffect); +void AIMovement(Entity *pokemon, bool8 showRunAwayEffect); bool8 CanTakeItem(Entity *pokemon); bool8 ChooseTargetPosition(Entity *pokemon); void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect); diff --git a/include/dungeon_message.h b/include/dungeon_message.h index 0a8ceb0cd..693673b27 100644 --- a/include/dungeon_message.h +++ b/include/dungeon_message.h @@ -24,7 +24,7 @@ void sub_80521D0(void); void sub_8052210(bool8 a0); // These functions display the string if certain conditions are met. The conditions differ depending on the function. The string is then saved to the message log. -void TryDisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str); +void LogMessageByIdWithPopupCheckUser(Entity *pokemon, const u8 *str); void TryDisplayDungeonLoggableMessage2(Entity *pokemon, const u8 *str); void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u8 *str); void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u8 *str); diff --git a/include/dungeon_util_1.h b/include/dungeon_util_1.h index 3196747eb..943647813 100644 --- a/include/dungeon_util_1.h +++ b/include/dungeon_util_1.h @@ -16,7 +16,7 @@ Entity *GetPartnerEntity(void); void sub_80854D4(void); void sub_80855E4(DungeonCallback func); void sub_808563C(DungeonCallback func); -Entity *GetEntityFromClientType(u8 entityType); +Entity *GetEntityFromMonsterBehavior(u8 entityType); void sub_80856C8(Entity * pokemon, s32 x, s32 y); void sub_80856E0(Entity * pokemon, s32 direction); void sub_8085764(void); @@ -26,7 +26,7 @@ void ShiftCameraToPosition(Position32 *posStruct, s32 cameraSteps); void SetFacingDirection(Entity *pokemon, s32 direction); void sub_8085930(s32 direction); void sub_80859F0(s32 direction); -bool8 IsMovingClient(Entity *entity); +bool8 ShouldRunMonsterAI(Entity *entity); void sub_8085B0C(Entity *pokemon); void sub_8085B4C(struct_8085B80 a0[], s16 *a1[], Entity *a2[], s32 a3); void sub_80857B8(void); diff --git a/include/pokemon.h b/include/pokemon.h index 0d10e72a7..3f1eb0981 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -39,7 +39,7 @@ void InitializeRecruitedPokemon(void); //u8 GetBodySize(s16 index); -void CopyMonsterNametoBuffer(u8 * buffer, s16 index); +void CopyMonsterNameToBuffer(u8 * buffer, s16 index); void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index); void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum); void sub_808D930(u8 *buffer, s32 index); @@ -56,7 +56,7 @@ char * GetMonSpecies(s16 index); s32 GetMovementSpeed(s16 index); u8 GetMovementType(s16 index); u8 GetRegenSpeed(s16 index); -bool8 CanMove(s16 index); +bool8 GetCanMoveFlag(s16 index); u8 GetChanceAsleep(s16 index); u32 GetWeight(s16 index); u32 GetSize(s16 index); diff --git a/include/status_checks.h b/include/status_checks.h index 3bf06b6ef..22bd90d4a 100644 --- a/include/status_checks.h +++ b/include/status_checks.h @@ -5,6 +5,6 @@ extern const s16 gConfusedAttackChance; -bool8 HasStatusAffectingActions(Entity *pokemon); +bool8 HasStatusThatPreventsActing(Entity *pokemon); #endif diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 0575a7d55..24bdda795 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -113,7 +113,7 @@ typedef struct Protection typedef struct Waiting { /* 0xC8 */ u8 waitingStatus; - /* 0xC9 */ bool8 enemyDecoy; // True if the PokĂ©mon is a decoy and a wild PokĂ©mon (i.e., not an allied PokĂ©mon). + /* 0xC9 */ bool8 decoyApplierNonTeamMemberFlag; // True if the PokĂ©mon is a decoy and a wild PokĂ©mon (i.e., not an allied PokĂ©mon). u8 unkCA; /* 0xCB */ u8 waitingStatusTurns; /* 0xCC */ u8 curseDamageCountdown; @@ -231,7 +231,7 @@ typedef struct EntityInfo /* 0x98 */ u32 unk98; /* 0x9C */ u32 unk9C; /* 0xA0 */ s32 unkA0; - /* 0xA4 */ u8 clientType; + /* 0xA4 */ u8 monsterBehavior; u8 fillA5[0xA8 - 0xA5]; // Statuses are split into groups based on which ones can't overlap. // See status.h for which statuses are in each group. @@ -266,7 +266,7 @@ typedef struct EntityInfo /* 0xFD */ u8 perishSongTurns; // When this reaches 0, the PokĂ©mon faints from Perish Song. Doubles as a bool for whether the PokĂ©mon is afflicted by Perish Song. u8 unkFE; u8 unkFF; - /* 0x100 */ u8 targetingDecoy; // If the PokĂ©mon is targeting a decoy, this indicates whether the decoy target is a team or wild PokĂ©mon. + /* 0x100 */ u8 decoyAITracker; // If the PokĂ©mon is targeting a decoy, this indicates whether the decoy target is a team or wild PokĂ©mon. /* 0x104 */ s32 speedStage; // The turn counter for movement speed up/down is split into five timers each. Multiple timers are used if the PokĂ©mon is affected by multiple // speed-up/slow effects at once, like using Agility twice. @@ -280,7 +280,7 @@ typedef struct EntityInfo /* 0x118 */ Moves moves; /* 0x13C */ FixedPoint belly; /* 0x140 */ FixedPoint maxBelly; - /* 0x144 */ bool8 aiNextToTarget; // True if an AI PokĂ©mon is following another PokĂ©mon and is already adjacent to them. + /* 0x144 */ bool8 aiAllySkip; // True if an AI PokĂ©mon is following another PokĂ©mon and is already adjacent to them. /* 0x145 */ bool8 recalculateFollow; // Used by the AI to defer a movement decision until after all other PokĂ©mon have moved. /* 0x146 */ u8 unk146; /* 0x147 */ bool8 waiting; // True if an AI PokĂ©mon decided to do nothing this turn. @@ -407,13 +407,45 @@ enum AIObjective AI_TAKE_ITEM }; -enum ClientType +enum MonsterBehavior { - CLIENT_TYPE_NONE, - CLIENT_TYPE_CLIENT, // Used for mission clients that need rescuing. - CLIENT_TYPE_PARTNER, - // 3 - CLIENT_TYPE_DONT_MOVE = 4 // Used for Diglett in the Skarmory boss fight. + BEHAVIOR_FIXED_ENEMY, + BEHAVIOR_RESCUE_TARGET, // Used for mission clients that need rescuing. + BEHAVIOR_ALLY, + BEHAVIOR_SKARMORY, + BEHAVIOR_DIGLETT, // Used for Diglett in the Skarmory boss fight. + BEHAVIOR_5, // 5 and 6 are probably Gengar and Ekans, but not sure which is which. + BEHAVIOR_6, + BEHAVIOR_MEDICHAM, + BEHAVIOR_ZAPDOS, + BEHAVIOR_MOLTRES, + BEHAVIOR_ALAKAZAM_1, + BEHAVIOR_GROUDON_1, + BEHAVIOR_ALAKAZAM_2, + BEHAVIOR_ARTICUNO, + BEHAVIOR_GROUDON_2, + BEHAVIOR_RAYQUAZA, + BEHAVIOR_16, + BEHAVIOR_MEWTWO, + BEHAVIOR_ENTEI, + BEHAVIOR_RAIKOU, + BEHAVIOR_SUICUNE, + BEHAVIOR_HO_OH, + BEHAVIOR_LATIOS, + BEHAVIOR_REGIROCK, + BEHAVIOR_REGICE, + BEHAVIOR_REGISTEEL, + BEHAVIOR_JIRACHI, + BEHAVIOR_LUGIA, + BEHAVIOR_KYOGRE, + BEHAVIOR_29, + BEHAVIOR_CELEBI, + BEHAVIOR_SMEARGLE, + BEHAVIOR_32, + BEHAVIOR_33, + BEHAVIOR_34, + BEHAVIOR_35, + BEHAVIOR_36, }; enum VisualFlag diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index c7daddb1b..c663aebc2 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -327,7 +327,7 @@ typedef struct Dungeon /* 0x37F4 */ s32 unk37F4; /* 0x37F8 */ bool8 plusIsActive[2]; // Index 0: Enemy , Index 1: Team /* 0x37FA */ bool8 minusIsActive[2]; // Index 0: Enemy , Index 1: Team - /* 0x37FC */ bool8 decoyActive; + /* 0x37FC */ bool8 decoyIsActive; /* 0x37FD */ u8 unk37FD; /* 0x37FE */ bool8 deoxysDefeat; // Flag set for deoxys in Meteor Cave /* 0x37FE */ u8 unk37FF; @@ -383,7 +383,7 @@ typedef struct Dungeon u8 fill1357A[0x1357C - 0x1357A]; /* 0x1357C */ Entity *teamPokemon[MAX_TEAM_MEMBERS]; /* 0x1358C */ Entity *wildPokemon[DUNGEON_MAX_WILD_POKEMON]; - /* 0x135CC */ Entity *allPokemon[DUNGEON_MAX_POKEMON]; // Contains both team and wild PokĂ©mon + /* 0x135CC */ Entity *activeMonsterPtrs[DUNGEON_MAX_POKEMON]; // Contains both team and wild PokĂ©mon /* 0x1361C */ Entity *items[DUNGEON_MAX_ITEMS]; /* 0x1371C */ Entity *traps[DUNGEON_MAX_TRAPS]; /* 0x1381C */ Entity teamPokemonEntities[MAX_TEAM_MEMBERS]; diff --git a/src/code_803E724.c b/src/code_803E724.c index 0a5f9dfab..4845e54c4 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -1066,7 +1066,7 @@ void sub_803F580(u8 a0) if (strPtr->cameraPos.x != strPtr->cameraPosMirror.x || strPtr->cameraPos.y != strPtr->cameraPosMirror.y) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->allPokemon[i]; + Entity *mon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(mon)) { sub_80402AC(mon->pos.x, mon->pos.y); } diff --git a/src/code_8040094.c b/src/code_8040094.c index e54661ade..d36e51d46 100644 --- a/src/code_8040094.c +++ b/src/code_8040094.c @@ -44,7 +44,7 @@ void HandleLuminousOrbAction(Entity *pokemon) sub_803F580(0); sub_8049ED4(); sub_8040A84(); - TryDisplayDungeonLoggableMessage(pokemon, gUnknown_80FD040); + LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FD040); } void sub_8040094(u8 r0) diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index ad6964532..38142228b 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -155,7 +155,7 @@ void sub_8041888(u8 param_1) EntityInfo *entityInfo; for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if(EntityExists(entity)) { entityInfo = GetEntInfo(entity); diff --git a/src/code_804267C.c b/src/code_804267C.c index 9983217bb..845a20266 100644 --- a/src/code_804267C.c +++ b/src/code_804267C.c @@ -104,14 +104,14 @@ void sub_80427AC(void) s32 i; for (i = 0; i < 20; i++) { - entity = gDungeon->allPokemon[i]; + entity = gDungeon->activeMonsterPtrs[i]; if (EntityExists(entity)) { enInfo = GetEntInfo(entity); if (enInfo->unkF3) { enInfo->unkF3 = FALSE; sub_80429A0(entity); if (!enInfo->isNotTeamMember) { - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); DisplayDungeonLoggableMessageTrue(entity, *gPtrFeralFoundItemMessage); } } diff --git a/src/code_8042B34.c b/src/code_8042B34.c index b5bcc97f2..d55d8096a 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -561,7 +561,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) if (!r6) { s32 rnd; - gDungeon->decoyActive = FALSE; + gDungeon->decoyIsActive = FALSE; rnd = DungeonRandInt(4); gDungeon->unk37FD = 0; gDungeon->deoxysDefeat = FALSE; @@ -1022,7 +1022,7 @@ void sub_8043D60(void) unk = FALSE; if (IsClientOrTeamBase(monInfo->joinedAt.joinedAt)) unk = FALSE; - if (monInfo->clientType == CLIENT_TYPE_CLIENT) + if (monInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) unk = FALSE; if (unk) { diff --git a/src/code_8045A00.c b/src/code_8045A00.c index 5afb1a738..943820e42 100644 --- a/src/code_8045A00.c +++ b/src/code_8045A00.c @@ -32,7 +32,7 @@ void sub_8045ACC(void) { entity = gDungeon->teamPokemon[index]; if (EntityExists(entity)) { - gDungeon->allPokemon[pokeCount] = entity; + gDungeon->activeMonsterPtrs[pokeCount] = entity; pokeCount++; } } @@ -41,12 +41,12 @@ void sub_8045ACC(void) { entity = gDungeon->wildPokemon[index]; if (EntityExists(entity)) { - gDungeon->allPokemon[pokeCount] = entity; + gDungeon->activeMonsterPtrs[pokeCount] = entity; pokeCount++; } } for (; pokeCount < DUNGEON_MAX_POKEMON; pokeCount++) { - gDungeon->allPokemon[pokeCount] = NULL; + gDungeon->activeMonsterPtrs[pokeCount] = NULL; } } @@ -64,7 +64,7 @@ s32 GetTeamMemberEntityIndex(Entity *pokemon) return -1; } -void SetMessageArgument(u8 *buffer, Entity *entity, u32 param_3) +void SubstitutePlaceholderStringTags(u8 *buffer, Entity *entity, u32 param_3) { switch(GetEntityType(entity)) { diff --git a/src/code_8048480.c b/src/code_8048480.c index 18379e717..2759d2cde 100644 --- a/src/code_8048480.c +++ b/src/code_8048480.c @@ -163,7 +163,7 @@ bool8 sub_8047930(Entity *pokemon, Entity *target) bool8 flag; if (((GetEntInfo(target)->shopkeeper == TRUE) || - (GetEntInfo(target)->clientType == CLIENT_TYPE_DONT_MOVE)) || (GetEntInfo(target)->clientType == CLIENT_TYPE_CLIENT)) { + (GetEntInfo(target)->monsterBehavior == BEHAVIOR_DIGLETT)) || (GetEntInfo(target)->monsterBehavior == BEHAVIOR_RESCUE_TARGET)) { return FALSE; } else { @@ -220,7 +220,7 @@ void sub_80479B8(char param_1, char param_2, u8 param_3, Entity *pokemon, Entity } PlaySoundEffect(0x14d); sub_8045BF8(gFormatBuffer_Items[0],item); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDBB8); // $m0 caught the $i0 info->heldItem = *item; sub_806A6E8(target); @@ -596,7 +596,7 @@ void RawstBerryItemAction(Entity *pokemon, Entity *target) SendNonVolatileEndMessage(pokemon, target); else { - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); // Pointer to "But nothing happened!" TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FB580); } @@ -610,7 +610,7 @@ void HungerSeedItemAction(Entity *pokemon, Entity * target) else { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); if (IQSkillIsEnabled(target, IQ_SELF_CURER)) TryDisplayDungeonLoggableMessage3(pokemon, target, *gPtrSelfHealPreventedHungerMessage); else @@ -695,7 +695,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) uVar1 = gUnknown_80F4FA4; } if (entityInfo_1->immobilize.immobilizeStatus == STATUS_FROZEN) { - SendImmobilizeEndMessage(pokemon, target); + EndFrozenClassStatus(pokemon, target); } sub_806F370(pokemon, target, uVar1, 1, auStack28, 0, 0x216, 0, 0, 0); } @@ -718,7 +718,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) uVar1 = gUnknown_80F4FA6; } if (entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) { - SendImmobilizeEndMessage(pokemon, entity); + EndFrozenClassStatus(pokemon, entity); } sub_806F370(pokemon, entity, uVar1, 1, auStack28, 0, 0x216, 0, 0, 0); } @@ -832,7 +832,7 @@ bool8 sub_8048950(Entity *param_1,Item *item) if (CheckVariousStatuses2(entity, FALSE)) { flag = FALSE; } - if (entityInfo->clientType == CLIENT_TYPE_CLIENT) { + if (entityInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { flag = FALSE; } if (IsClientOrTeamBase(entityInfo->joinedAt.joinedAt)) { @@ -894,7 +894,7 @@ bool8 sub_8048A68(Entity *param_1,Item *item) if (CheckVariousStatuses2(entity, FALSE)) { flag = FALSE; } - if (pEVar6->clientType == CLIENT_TYPE_CLIENT) { + if (pEVar6->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { flag = FALSE; } if (IsClientOrTeamBase(pEVar6->joinedAt.joinedAt)) { @@ -956,7 +956,7 @@ bool32 sub_8048B9C(Entity *entity,Item *param_2) { flag = FALSE; } - if(entity1Info->clientType == CLIENT_TYPE_CLIENT) + if(entity1Info->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { flag = FALSE; } @@ -1034,14 +1034,14 @@ bool8 sub_8048D50(Entity * pokemon, Item *item) if ((item->flags & ITEM_FLAG_STICKY) != 0) { sub_8045BF8(gFormatBuffer_Items[0], item); - TryDisplayDungeonLoggableMessage(pokemon,*gItemStickyDoesntWorkText); + LogMessageByIdWithPopupCheckUser(pokemon,*gItemStickyDoesntWorkText); return FALSE; } else { if ((entityInfo->muzzled.muzzled == TRUE) && (IsEdibleItem(item->id))) { - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FDCA4); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FDCA4); return FALSE; } } @@ -1083,27 +1083,27 @@ void GrimyFoodItemAction(Entity *pokemon, Entity * target) void IcePartItemAction(Entity *pokemon, Entity *target, u8 r2) { - TryDisplayDungeonLoggableMessage(pokemon, *gPtrIcePartCrumbledMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrIcePartCrumbledMessage); } void RockPartItemAction(Entity *pokemon, Entity *target, u8 r2) { - TryDisplayDungeonLoggableMessage(pokemon, *gPtrRockPartCrumbledMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrRockPartCrumbledMessage); } void SteelPartItemAction(Entity *pokemon, Entity *target, u8 r2) { - TryDisplayDungeonLoggableMessage(pokemon, *gPtrSteelPartCrumbledMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrSteelPartCrumbledMessage); } void WishStoneItemAction(Entity *pokemon, Entity *target, u8 r2) { - TryDisplayDungeonLoggableMessage(pokemon, *gPtrWishStoneCrumbledMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrWishStoneCrumbledMessage); } void MusicBoxItemAction(Entity *pokemon, Entity *target, u8 r2) { sub_80421C0(pokemon, 0xD6); - TryDisplayDungeonLoggableMessage(pokemon, *gPtrMusicBoxPlayedCrumbledMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrMusicBoxPlayedCrumbledMessage); sub_803E708(0x3C, 0x46); } diff --git a/src/code_805D8C8.c b/src/code_805D8C8.c index f1fe58cc7..771fc0e69 100644 --- a/src/code_805D8C8.c +++ b/src/code_805D8C8.c @@ -20,7 +20,7 @@ void sub_8068768(void) s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->allPokemon[i]; + entity = gDungeon->activeMonsterPtrs[i]; if (entity != NULL && EntityExists(entity)) LoadPokemonSprite(GetEntInfo(entity)->apparentID, FALSE); diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index 8d0a9ccc9..0c6b6cb95 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -264,7 +264,7 @@ void DungeonHandlePlayerInput(void) } } else if (ShouldMonsterRunAwayAndShowEffect(leader, TRUE)) { - TryDisplayDungeonLoggableMessage(leader, gUnknown_80FD4B0); + LogMessageByIdWithPopupCheckUser(leader, gUnknown_80FD4B0); sub_8044C50(1); gDungeon->unk673 = 1; break; @@ -279,7 +279,7 @@ void DungeonHandlePlayerInput(void) } } if (i == MAX_MON_MOVES) { - TryDisplayDungeonLoggableMessage(leader, gUnknown_80F8A28); + LogMessageByIdWithPopupCheckUser(leader, gUnknown_80F8A28); break; } @@ -305,7 +305,7 @@ void DungeonHandlePlayerInput(void) } } if (!canUseMove) { - TryDisplayDungeonLoggableMessage(leader, gUnknown_80F8A4C); + LogMessageByIdWithPopupCheckUser(leader, gUnknown_80F8A4C); } else { SetMonsterActionFields(&leaderInfo->action, ACTION_USE_MOVE_PLAYER); @@ -529,7 +529,7 @@ void DungeonHandlePlayerInput(void) if (!(canMoveFlags & 2)) { if (canMoveFlags & 1) { if (immobilizedMsg != NULL) { - TryDisplayDungeonLoggableMessage(leader, immobilizedMsg); + LogMessageByIdWithPopupCheckUser(leader, immobilizedMsg); } sub_8044C50(1); gDungeon->unk673 = 1; @@ -1545,7 +1545,7 @@ bool8 sub_805EC4C(Entity *a0, u8 a1) if (tileMonsterInfo->isNotTeamMember && (tileMonsterInfo->shopkeeper != 1 && tileMonsterInfo->shopkeeper != 2) && !IsClientOrTeamBase(tileMonsterInfo->joinedAt.joinedAt) - && tileMonsterInfo->clientType != CLIENT_TYPE_CLIENT) { + && tileMonsterInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET) { return FALSE; } @@ -1668,7 +1668,7 @@ bool8 sub_805EF60(Entity *a0, EntityInfo *a1) return FALSE; if (!sub_8070BC0(a0)) return FALSE; - if (GetEntInfo(r4)->isNotTeamMember && GetEntInfo(r4)->clientType != CLIENT_TYPE_CLIENT && GetEntInfo(r4)->shopkeeper != 1) + if (GetEntInfo(r4)->isNotTeamMember && GetEntInfo(r4)->monsterBehavior != BEHAVIOR_RESCUE_TARGET && GetEntInfo(r4)->shopkeeper != 1) return FALSE; SetMonsterActionFields(&a1->action, ACTION_TALK_FIELD); @@ -1753,8 +1753,8 @@ void sub_805F02C(void) sub_803F508(r7); sub_8041AD0(leader); sub_8041AE0(GetLeader()); - SetMessageArgument(gFormatBuffer_Monsters[0], r7, 0); - TryDisplayDungeonLoggableMessage(r7, gUnknown_80F9BB0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], r7, 0); + LogMessageByIdWithPopupCheckUser(r7, gUnknown_80F9BB0); sub_807EC28(FALSE); r8->unk64 = 0; leaderInfo->unk64 = 0; @@ -2116,7 +2116,7 @@ void ShowFieldMenu(u8 a0_, bool8 a1) break; } else { - SetMessageArgument(gFormatBuffer_Monsters[0], GetLeader(), 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], GetLeader(), 0); DisplayDungeonMessage(0, gUnknown_80FDE18, 1); } } @@ -2252,7 +2252,7 @@ void DrawFieldMenu(u8 a0) Entity *teamMon = gDungeon->teamPokemon[i]; if (EntityExists(teamMon)) { EntityInfo *monInfo = GetEntInfo(teamMon); - SetMessageArgument(gFormatBuffer_Monsters[0], teamMon, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], teamMon, 0); gFormatArgs[0] = monInfo->HP; gFormatArgs[1] = monInfo->maxHPStat; PrintFormattedStringOnWindow(4, yLoop, gUnknown_80F91E0, 2, 0); @@ -3652,7 +3652,7 @@ void ShowTacticsMenu(ActionContainer *a0) monInfo->aiTarget.unkC = 0; monInfo->aiTarget.aiTargetSpawnGenID = 0; if (!monInfo->isTeamLeader) { - MoveIfPossible(teamMon, TRUE); + AIMovement(teamMon, TRUE); } } else { diff --git a/src/code_8066D04.c b/src/code_8066D04.c index a618531a9..916169ae5 100644 --- a/src/code_8066D04.c +++ b/src/code_8066D04.c @@ -54,7 +54,7 @@ void HandleSetItemAction(Entity *param_1, bool8 param_2) if (((itemPtr->flags & ITEM_FLAG_EXISTS)) && ((itemPtr->flags & ITEM_FLAG_SET))) { if ((itemPtr->flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatBuffer_Items[0],itemPtr); - TryDisplayDungeonLoggableMessage(param_1,*gItemStickyCannotEquip); + LogMessageByIdWithPopupCheckUser(param_1,*gItemStickyCannotEquip); return; } itemPtr->flags &= ~(ITEM_FLAG_SET); @@ -64,22 +64,22 @@ void HandleSetItemAction(Entity *param_1, bool8 param_2) PlaySoundEffect(0x133); if (param_2 != 0) { if ((item->flags & ITEM_FLAG_STICKY)) { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D04); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D04); } else { if (GetItemCategory(item->id) == CATEGORY_THROWN_LINE) { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8CE4); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8CE4); } else { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8CE8); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8CE8); } } } item->flags |= ITEM_FLAG_SET; if (((item->flags & ITEM_FLAG_STICKY)) && (param_2 != 0)) { sub_8045BF8(gFormatBuffer_Items[0],item); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); } } @@ -95,14 +95,14 @@ void HandleUnsetItemAction(Entity *entity,bool8 enableMessage) if (((item->flags & ITEM_FLAG_EXISTS)) && ((item->flags & ITEM_FLAG_SET))) { if ((item->flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatBuffer_Items[0],item); - TryDisplayDungeonLoggableMessage(entity,*gItemStickyCannotEquip); + LogMessageByIdWithPopupCheckUser(entity,*gItemStickyCannotEquip); return; } item->flags &= ~(ITEM_FLAG_SET); sub_8045BF8(gFormatBuffer_Items[0],item); PlaySoundEffect(0x133); if (enableMessage) { - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8D20); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8D20); } } } @@ -132,15 +132,15 @@ void HandleGiveItemAction(Entity *param_1) if ((!bVar3) && ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET))) { sub_8045BF8(gFormatBuffer_Items[1],item); - TryDisplayDungeonLoggableMessage(param_1,*gItemStickyCannotMove2); + LogMessageByIdWithPopupCheckUser(param_1,*gItemStickyCannotMove2); } else { - SetMessageArgument(gFormatBuffer_Monsters[1],entity,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],entity,0); if (((info2->heldItem).flags & ITEM_FLAG_EXISTS)) { if (((info2->heldItem).flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatBuffer_Items[1],&info2->heldItem); - TryDisplayDungeonLoggableMessage(param_1,*gItemStickyCannotMove1); + LogMessageByIdWithPopupCheckUser(param_1,*gItemStickyCannotMove1); return; } item1 = (info2->heldItem); @@ -158,9 +158,9 @@ void HandleGiveItemAction(Entity *param_1) sub_8045BF8(gFormatBuffer_Items[0],&item2); sub_8045BF8(gFormatBuffer_Items[1],&item1); PlaySoundEffect(0x14d); - TryDisplayDungeonLoggableMessage(param_1,*gMonTookAndReturnedItem); + LogMessageByIdWithPopupCheckUser(param_1,*gMonTookAndReturnedItem); if ((item2.flags & ITEM_FLAG_STICKY)) { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); } } else { @@ -170,9 +170,9 @@ void HandleGiveItemAction(Entity *param_1) info2->heldItem = item3; sub_8045BF8(gFormatBuffer_Items[0],&item3); PlaySoundEffect(0x14d); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D44); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D44); if ((item3.flags & ITEM_FLAG_STICKY)) { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); } } sub_806A6E8(entity); @@ -198,24 +198,24 @@ void HandleTakeItemAction(Entity *param_1) info = GetEntInfo(entity); heldItem = &info->heldItem; if (ItemExists(&gTeamInventoryRef->teamItems[ITEM_POWER_BAND])) { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D60); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D60); } else { if (ItemSticky(heldItem)) { sub_8045BF8(gFormatBuffer_Items[0],heldItem); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); } else { item = *heldItem; item.flags &= ~(ITEM_FLAG_SET); sub_8045BF8(gFormatBuffer_Items[0],&item); - SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); ZeroOutItem(heldItem); AddItemToInventory(&item); PlaySoundEffect(0x14d); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D7C); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D7C); sub_806A6E8(entity); if (sub_80706A4(entity,&entity->pos) != 0) { sub_807D148(param_1,entity,0,0); @@ -243,11 +243,11 @@ void sub_8066BD4(Entity *param_1) if (heldItem->flags & ITEM_FLAG_STICKY) { sub_8045BF8(gFormatBuffer_Items[0],heldItem); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); } else if ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) { sub_8045BF8(gFormatBuffer_Items[0],item); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); } else { @@ -255,12 +255,12 @@ void sub_8066BD4(Entity *param_1) item->flags &= ~(ITEM_FLAG_SET); sub_8045BF8(gFormatBuffer_Items[0],heldItem); sub_8045BF8(gFormatBuffer_Items[1],item); - SetMessageArgument(gFormatBuffer_Monsters[1],entity,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],entity,0); temp = info->heldItem; info->heldItem = *item; *item = temp; PlaySoundEffect(0x14d); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8DB4); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8DB4); if (sub_80706A4(entity,&entity->pos) != 0) { sub_807D148(param_1,entity,0,0); } @@ -296,13 +296,13 @@ void HandlePlaceItemAction(Entity *param_1) item = sub_8044D90(entity,0,4); sub_8045BF8(gFormatBuffer_Items[0],item); if (info->action.unk4[0].actionUseIndex == 0x80) { - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8DE0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8DE0); } else if ((info->action.unk4[0].actionUseIndex < 0x15) && ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET))) { - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8BE0); } else if ((info->action.unk4[0].actionUseIndex == 0x81) && ((item->flags & ITEM_FLAG_STICKY))) { - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8BE0); } else { tile = GetTile(entity->pos.x, entity->pos.y); @@ -314,7 +314,7 @@ void HandlePlaceItemAction(Entity *param_1) sub_8045BF8(gFormatBuffer_Items[0],item); if (sub_80460F8(&entity->pos,item,1) == 0) { _message: - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8E04); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8E04); } else { @@ -323,8 +323,8 @@ void HandlePlaceItemAction(Entity *param_1) item->flags = 0; FillInventoryGaps(); PlaySoundEffect(0x14d); - SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8E28); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8E28); sub_807AB38(entity,gDungeon->unk3A08); } } diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 20741ab54..7abdbc1dd 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -74,7 +74,7 @@ void TriggerWeatherAbilities(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { if (HasAbility(entity, ABILITY_DRIZZLE)) { gDungeon->weather.naturalWeather[WEATHER_RAIN] = 1; @@ -172,7 +172,7 @@ void sub_8069F9C(Entity *pokemon,Entity * target,Move *move) } iVar6->abilities[abilityIndex] = local_20[randomIndex]; gDungeon->unkC = 1; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC7C); sub_8042900(target); sub_806ABAC(pokemon,target); @@ -190,7 +190,7 @@ _0806A068: iVar6->types[0] = type; iVar6->types[1] = TYPE_NONE; iVar6->isColorChanged = TRUE; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); __src = GetUnformattedTypeString(iVar6->types[0]); strcpy(gFormatBuffer_Items[0],__src); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCAC); @@ -215,7 +215,7 @@ void sub_806A120(Entity * pokemon, Entity * target, Move* move) entityInfo->types[0] = uVar2_u32; entityInfo->types[1] = 0; sub_8041BBC(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); typeString = GetUnformattedTypeString(uVar2_u32); strcpy(gFormatBuffer_Items[0],typeString); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCC8); @@ -301,7 +301,7 @@ void sub_806A338(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity) && (GetEntInfo(entity)->waitingStruct.waitingStatus == STATUS_SNATCH)) { gDungeon->snatchPokemon = entity; diff --git a/src/code_806CD90.c b/src/code_806CD90.c index bfa7ca71b..965c30a08 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -49,7 +49,7 @@ void sub_806CC10(void) s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->allPokemon[i]; + entity = gDungeon->activeMonsterPtrs[i]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); @@ -69,7 +69,7 @@ void sub_806CC70(void) Entity *entity; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->allPokemon[i]; + entity = gDungeon->activeMonsterPtrs[i]; if (EntityExists(entity)) sub_806CCB4(entity, sub_806CEBC(entity)); @@ -116,7 +116,7 @@ void sub_806CD90(void) Entity *entity; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->allPokemon[i]; + entity = gDungeon->activeMonsterPtrs[i]; if (EntityExists(entity)) sub_806CCB4(entity, sub_806CEBC(entity)); @@ -227,7 +227,7 @@ void sub_806CF60(void) s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->allPokemon[i]; + entity = gDungeon->activeMonsterPtrs[i]; if (EntityExists(entity)) sub_806CF98(entity); @@ -473,7 +473,7 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * if (r9) { EntityInfo *targetInfo = GetEntInfo(target); if (targetInfo->linked.linkedStatus == STATUS_DESTINY_BOND) { - Entity *destBondTarget = gDungeon->allPokemon[targetInfo->linked.unkD8]; + Entity *destBondTarget = gDungeon->activeMonsterPtrs[targetInfo->linked.unkD8]; if (destBondTarget == NULL) { targetInfo->linked.linkedStatus = 0; } @@ -520,14 +520,14 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } if (arg4 != 0x20E && HasAbility(target, ABILITY_STURDY) && dmgStruct->dmg == 9999) { - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FCA90); sub_8042238(attacker, target); dmgStruct->tookNoDamage = TRUE; return FALSE; } if (targetData->immobilize.immobilizeStatus == STATUS_FROZEN) { - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9600); sub_8042238(attacker, target); dmgStruct->tookNoDamage = TRUE; @@ -568,8 +568,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } } - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); if (dmgStruct->dmg == 0) { if (sub_8045888(attacker) && sub_8045888(target)) { if (targetData->unk152 == 0) { @@ -715,8 +715,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc r8 = 0; targetData->unk14C = 0; - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); if (dmgStruct->residualDmgType == 19 || dmgStruct->residualDmgType == 20) { if (targetData->isNotTeamMember) { TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9E44); @@ -727,7 +727,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } else if (targetData->isNotTeamMember) { - if (targetData->clientType == CLIENT_TYPE_CLIENT) { + if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); } else { @@ -742,7 +742,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc else if (IsClientOrTeamBase(targetData->joinedAt.joinedAt)) { DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DAC[r8]); } - else if (targetData->clientType == CLIENT_TYPE_CLIENT) { + else if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); } else if (sub_806A58C(recruitedMon->unkA)) { @@ -791,7 +791,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_806A390(target); sub_806CCB4(target, sub_806CEBC(target)); EntityUpdateStatusSprites(target); - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); sub_806F63C(target); return FALSE; @@ -848,8 +848,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_806A390(target); sub_806CCB4(target, sub_806CEBC(target)); EntityUpdateStatusSprites(target); - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); - SetMessageArgument(gFormatBuffer_Monsters[1], teamMember, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], teamMember, 0); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD484); sub_806F63C(target); return FALSE; @@ -902,7 +902,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_806A390(target); sub_806CCB4(target, sub_806CEBC(target)); EntityUpdateStatusSprites(target); - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); sub_806F63C(target); return FALSE; diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index 275e963f6..c045dc576 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -322,7 +322,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 s32 flashFireStatus = GetFlashFireStatus(target); if (flashFireStatus != FLASH_FIRE_STATUS_NONE && targetInfo->unk152 == 0 && arg_10) { targetInfo->unk152 = 1; - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) { TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FAE00); // Fire moves won't become stronger! } diff --git a/src/code_806FDF4.c b/src/code_806FDF4.c index 2e45d797e..2ac2f5684 100644 --- a/src/code_806FDF4.c +++ b/src/code_806FDF4.c @@ -229,7 +229,7 @@ bool8 sub_806F660(Entity *pokemon,Entity *target) (targetInfo->id != MONSTER_JIRACHI) && (targetInfo->id != MONSTER_RAYQUAZA) && (targetInfo->id != MONSTER_DEOXYS_NORMAL) && - (targetInfo->id != 0MONSTER_REGIROCK && + (targetInfo->id != MONSTER_REGIROCK && (targetInfo->id != MONSTER_REGICE) && (targetInfo->id != MONSTER_REGISTEEL)) || (HasRecruitedMon(targetInfo->id) == 0)) && (sub_806F9BC(targetInfo->id) != 0)) { @@ -243,7 +243,7 @@ bool8 sub_806F660(Entity *pokemon,Entity *target) iVar5 = -iVar5; } if (((iVar5 < 2) && (targetInfo->joinedAt.joinedAt != 0x4A)) && - (targetInfo->clientType != 1 && (CanSeeTarget(target,pokemon)) + (targetInfo->monsterBehavior != 1 && (CanSeeTarget(target,pokemon)) )) { sub_806F910(); iVar4 = DungeonRandInt(1000); @@ -746,7 +746,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa if (DisplayDungeonYesNoMessage(0,*gUnknown_80F9FE8,1) == 0) { if (param_3->id != MONSTER_JIRACHI) { - TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA004); + LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA004); } return 0; } @@ -759,7 +759,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa } if (pokeIndex == MAX_TEAM_MEMBERS) { - TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA030); + LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA030); return FALSE; } else { @@ -800,7 +800,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa sub_8097848(); if (sub_806B8CC(param_3->id,param_3->pos.x,param_3->pos.y,pokeStruct2,&local_2c,0,1) == 0) { - TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA058); + LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA058); pokeStruct2->unk0 = 0; } else { @@ -812,10 +812,10 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa } } sub_808D9DC(gFormatBuffer_Monsters[0],pokeStruct2,0); - TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA0F0); + LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA0F0); if (flag) { leader = xxx_call_GetLeader(); - SetMessageArgument(gFormatBuffer_Monsters[0],leader,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0); sub_8092558(gFormatBuffer_FriendArea,friendArea); PlaySound(0xce); DisplayDungeonMessage(0,*gUnknown_80FA120,1); @@ -1074,7 +1074,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr) } if (flag) { leader = xxx_call_GetLeader(); - SetMessageArgument(gFormatBuffer_Monsters[0],leader,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0); sub_8092558(gFormatBuffer_FriendArea,friendArea); PlaySound(0xce); DisplayDungeonMessage(0,*gUnknown_80FA120,1); diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 264fefc83..c30e65242 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -99,7 +99,7 @@ void sub_8071B48(void) if (dungeon->unk662 > 900) { entity2 = dungeon->unk17B34; if ((EntityExists(entity2)) && (entity2->spawnGenID == dungeon->unk17B40)) { - SetMessageArgument(gFormatBuffer_Monsters[0],entity2,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity2,0); entityPtr = entity2; } } @@ -449,7 +449,7 @@ void sub_8071DA4(Entity *entity) " ldr r0, _08071FF8\n" " mov r1, r8\n" " movs r2, 0\n" -" bl SetMessageArgument\n" +" bl SubstitutePlaceholderStringTags\n" " lsls r1, r4, 24\n" " lsrs r1, 24\n" " ldr r0, _08071FFC\n" @@ -544,7 +544,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para for(tacticIndex = 0; tacticIndex < NUM_TACTICS; tacticIndex++) { if ((tacticsBuffer1[tacticIndex] == 0) && (tacticsBuffer2[tacticIndex] == 1)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); CopyTacticsNameToBuffer(gFormatBuffer_Items[0],tacticIndex); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF730); } @@ -553,7 +553,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para info->expGainedInTurn = 0; info->unk149 = 0; if ((flag == 0) && (param_4 != 0)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F9B74); } } @@ -668,7 +668,7 @@ void LevelDownTarget(Entity *pokemon, Entity *target, u32 level) if(!flag) { - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F9B94); } } diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 3986ec9fb..2ca957fd4 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -138,14 +138,14 @@ void sub_8073D14(Entity *entity) return; if (sub_8044B28()) return; - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); if (entityInfo->isTeamLeader) return; if (entityInfo->shopkeeper == 1) return; if (IsClientOrTeamBase(entityInfo->joinedAt.joinedAt)) return; - if (entityInfo->clientType == CLIENT_TYPE_CLIENT) + if (entityInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) return; _entityInfo = GetEntInfo(entity); // Reloaded as a new variable for some reason. @@ -155,7 +155,7 @@ void sub_8073D14(Entity *entity) if (ShouldMonsterRunAwayAndShowEffect(entity, TRUE)) { sub_8045BF8(gFormatBuffer_Items[0], groundItem); - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); DisplayDungeonLoggableMessageTrue(entity, gMonTerrifiedCouldntPickUpItem); } else if (!_entityInfo->isNotTeamMember && GetItemCategory(groundItem->id) == CATEGORY_POKE) { @@ -265,7 +265,7 @@ void sub_8073D14(Entity *entity) DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem2); } else if (AddItemToInventory(groundItem)) { - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); DisplayDungeonLoggableMessageTrue(entity, gMonCouldntPickUpItem); } else { @@ -383,7 +383,7 @@ void sub_8074094(Entity *entity) if (str != NULL) { if (sound) PlaySoundEffect(0x153); - TryDisplayDungeonLoggableMessage(entity, str); + LogMessageByIdWithPopupCheckUser(entity, str); sub_803E708(0x1E, 0x32); } } @@ -529,7 +529,7 @@ void sub_8074094(Entity *entity) if (entityInfo->linked.linkedStatus == STATUS_LEECH_SEED) { if (entityInfo->linked.linkedStatusDamageCountdown == 0 || --entityInfo->linked.linkedStatusDamageCountdown == 0) { s32 hp = gUnknown_80F4FB4; - Entity *target = gDungeon->allPokemon[entityInfo->linked.unkD8]; + Entity *target = gDungeon->activeMonsterPtrs[entityInfo->linked.unkD8]; entityInfo->linked.linkedStatusDamageCountdown = gUnknown_80F4F40; if (target == NULL) { @@ -571,11 +571,11 @@ void sub_8074094(Entity *entity) UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - SetMessageArgument(gFormatBuffer_Monsters[1], entity, 0); - TryDisplayDungeonLoggableMessage(entity, gUnknown_80FEB30); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], entity, 0); + LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FEB30); TrySendImmobilizeSleepEndMsg(entity, entity); if (entityInfo->protection.protectionStatus == STATUS_PROTECT) { - TryDisplayDungeonLoggableMessage(entity, gPtrProtectSavedItMessage); + LogMessageByIdWithPopupCheckUser(entity, gPtrProtectSavedItMessage); } else { DealDamageToEntity(entity, 0x270F, 0xB, 0x20E); @@ -611,8 +611,8 @@ void sub_8074094(Entity *entity) if (entityInfo->charging.chargingStatusTurns == 0) { entityInfo->charging.chargingStatus = 0; entityInfo->unk14A = 0; - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); - TryDisplayDungeonLoggableMessage(entity, gUnknown_80FABD8); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); + LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FABD8); } } @@ -686,7 +686,7 @@ void TickStatusHeal(Entity *entity) if (entityInfo->immobilize.immobilizeStatus != 0) { sub_80838EC(&entityInfo->immobilize.immobilizeStatusTurns); if (entityInfo->immobilize.immobilizeStatusTurns == 0) { - SendImmobilizeEndMessage(entity, entity); + EndFrozenClassStatus(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) @@ -767,8 +767,8 @@ void TickStatusHeal(Entity *entity) if (entityInfo->terrifiedTurns != 0) { sub_80838EC(&entityInfo->terrifiedTurns); if (entityInfo->terrifiedTurns == 0) { - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); - TryDisplayDungeonLoggableMessage(entity, gPtrStenchWavedOffMessage); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); + LogMessageByIdWithPopupCheckUser(entity, gPtrStenchWavedOffMessage); } } @@ -791,8 +791,8 @@ void TickStatusHeal(Entity *entity) s32 newSpdStage = CalcSpeedStage(entity); if (oldSpdStage != newSpdStage) { - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); - TryDisplayDungeonLoggableMessage(entity, gUnknown_80FA124[newSpdStage]); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); + LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FA124[newSpdStage]); } } } @@ -893,7 +893,7 @@ bool8 UseAttack(Entity *a0) gUnknown_202F378 = 1; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->allPokemon[i]; + Entity *mon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(mon)) { EntityInfo *monInfo = GetEntInfo(mon); if (monInfo->numMoveTiles == 0) { @@ -935,7 +935,7 @@ bool8 UseAttack(Entity *a0) for (loop = 0; loop < 24 / gUnknown_202F378; loop++) { sub_803E46C(7); for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->allPokemon[i]; + Entity *mon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(mon)) { EntityInfo *monInfo = GetEntInfo(mon); Unk_Entity_x184 *strPtr = &monInfo->unk184[monInfo->notMoving]; @@ -963,7 +963,7 @@ bool8 UseAttack(Entity *a0) } for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->allPokemon[i]; + Entity *mon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(mon)) { EntityInfo *monInfo = GetEntInfo(mon); monInfo->numMoveTiles = 0; @@ -979,7 +979,7 @@ bool8 UseAttack(Entity *a0) for (loop = 0; loop < DUNGEON_MAX_POKEMON; loop++) { Position monPosBefore; EntityInfo *monInfo; - Entity *mon = gDungeon->allPokemon[loop]; + Entity *mon = gDungeon->activeMonsterPtrs[loop]; if (!EntityExists(mon)) continue; diff --git a/src/code_8075708.c b/src/code_8075708.c index c4afc842b..b1aa63c29 100644 --- a/src/code_8075708.c +++ b/src/code_8075708.c @@ -30,7 +30,7 @@ void sub_8075680(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if ((EntityExists(entity)) && (info = GetEntInfo(entity), !info->isTeamLeader)) { targetPos = &(info->targetPos); diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index 85b2235c4..16538c997 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -216,7 +216,7 @@ void MuzzleTarget(Entity *pokemon, Entity *target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->muzzled.muzzled != TRUE) { entityInfo->muzzled.muzzled = TRUE; entityInfo->muzzled.muzzledTurns = CalculateStatusTurns(target,gUnknown_80F4F1C, TRUE) + 1; @@ -250,7 +250,7 @@ void TransformStatusTarget(Entity * pokemon, Entity * target) if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF04); else { - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); iVar5 = sub_803D870(auStack544, 0); if (iVar5 == 0) @@ -299,7 +299,7 @@ void MobileStatusTarget(Entity * pokemon, Entity * target) if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) { SendTransformEndMessage(pokemon,target); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->transformStatus.transformStatus != STATUS_MOBILE) { entityInfo->transformStatus.transformStatus = STATUS_MOBILE; entityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F04, FALSE) + 1; @@ -328,7 +328,7 @@ void ExposeStatusTarget(Entity * pokemon, Entity * target, s16 param_3) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->hitChanceStages[1] > 10) { entityInfo->hitChanceStages[1] = 10; flag = TRUE; @@ -384,7 +384,7 @@ void BlindTarget(Entity *pokemon, Entity *target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->eyesightStatus.eyesightStatus != STATUS_BLINKER) { entityInfo->eyesightStatus.eyesightStatus = STATUS_BLINKER; entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F08, TRUE) + 1; @@ -411,7 +411,7 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target) if(!HasSafeguardStatus(pokemon, target, TRUE)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->eyesightStatus.eyesightStatus != STATUS_CROSS_EYED) { sub_8041E1C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB834); @@ -437,7 +437,7 @@ void RestoreVisionTarget(Entity *pokemon, Entity *target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->eyesightStatus.eyesightStatus != STATUS_EYEDROPS) { entityInfo->eyesightStatus.eyesightStatus = STATUS_EYEDROPS; entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F10, FALSE) + 1; @@ -505,7 +505,7 @@ void RaiseAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) EntityInfo *entityInfo; if (EntityExists(target)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); entityInfo = GetEntInfo(target); oldStat = entityInfo->atk[0]; @@ -535,7 +535,7 @@ void RaiseSpAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) EntityInfo *entityInfo; if (EntityExists(target)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); entityInfo = GetEntInfo(target); oldStat = entityInfo->atk[1]; @@ -565,7 +565,7 @@ void RaiseDefStatTarget(Entity * pokemon, Entity *target, s32 increment) EntityInfo *entityInfo; if (EntityExists(target)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); entityInfo = GetEntInfo(target); oldStat = entityInfo->def[0]; @@ -595,7 +595,7 @@ void RaiseSpDefStatTarget(Entity * pokemon, Entity *target, s32 increment) EntityInfo *entityInfo; if (EntityExists(target)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); entityInfo = GetEntInfo(target); oldStat = entityInfo->def[1]; @@ -622,7 +622,7 @@ void LongTossStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); if (entityInfo->itemStatus.itemStatus != STATUS_LONG_TOSS) { entityInfo->itemStatus.itemStatus = STATUS_LONG_TOSS; sub_8041EA4(target); @@ -639,7 +639,7 @@ void PierceStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); if (entityInfo->itemStatus.itemStatus != STATUS_PIERCE) { entityInfo->itemStatus.itemStatus = STATUS_PIERCE; sub_8041EB4(target); @@ -663,7 +663,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if ((entityInfo->charging.chargingStatus == newStatus) && (newStatus == STATUS_ENRAGED)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC074); } @@ -738,7 +738,7 @@ void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus == newStatus) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB10C); } @@ -760,7 +760,7 @@ void SafeguardStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_SAFEGUARD) { entityInfo->protection.protectionStatus = STATUS_SAFEGUARD; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E88, FALSE) + 1; @@ -780,7 +780,7 @@ void MistStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_MIST) { entityInfo->protection.protectionStatus = STATUS_MIST; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E8C, FALSE) + 1; @@ -800,7 +800,7 @@ void WishStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_WISH) { entityInfo->protection.protectionStatus = STATUS_WISH; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EB4, FALSE) + 1; @@ -820,7 +820,7 @@ void MagicCoatStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_MAGIC_COAT) { entityInfo->protection.protectionStatus = STATUS_MAGIC_COAT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E90, FALSE) + 1; @@ -840,7 +840,7 @@ void LightScreenStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_LIGHT_SCREEN) { entityInfo->protection.protectionStatus = STATUS_LIGHT_SCREEN; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E84, FALSE) + 1; @@ -860,7 +860,7 @@ void ReflectStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_REFLECT) { entityInfo->protection.protectionStatus = STATUS_REFLECT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E80, FALSE) + 1; @@ -884,11 +884,11 @@ void ProtectStatusTarget(Entity * pokemon, Entity * target) if (entityInfo->protection.protectionStatus != STATUS_PROTECT) { entityInfo->protection.protectionStatus = STATUS_PROTECT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4ED4, FALSE) + 1; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9B0); } else { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9D8); } EntityUpdateStatusSprites(target); @@ -901,7 +901,7 @@ void MirrorCoatStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_MIRROR_COAT) { entityInfo->protection.protectionStatus = STATUS_MIRROR_COAT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EE8, FALSE) + 1; @@ -921,7 +921,7 @@ void EndureStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_ENDURING) { entityInfo->protection.protectionStatus = STATUS_ENDURING; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EF8, FALSE) + 1; @@ -941,7 +941,7 @@ void MirrorMoveStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_MIRROR_MOVE) { entityInfo->protection.protectionStatus = STATUS_MIRROR_MOVE; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F18, FALSE) + 1; @@ -966,7 +966,7 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target) TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsConversion2Message); else { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_CONVERSION2) { entityInfo->protection.protectionStatus = STATUS_CONVERSION2; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F20, FALSE) + 1; @@ -987,7 +987,7 @@ void VitalThrowStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_VITAL_THROW) { entityInfo->protection.protectionStatus = STATUS_VITAL_THROW; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F24, FALSE) + 1; @@ -1040,7 +1040,7 @@ void sub_8079E34(Entity * pokemon, Entity * target, bool8 param_3) else if (param_3 != 0) { sub_80420C8(target); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (statChanged) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD18); } @@ -1071,7 +1071,7 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4) return; } SendNonVolatileEndMessage(pokemon,target); - SendImmobilizeEndMessage(pokemon,target); + EndFrozenClassStatus(pokemon,target); SendVolatileEndMessage(pokemon,target); SendWaitingEndMessage(pokemon,target,0); SendLinkedEndMessage(pokemon,target); @@ -1157,7 +1157,7 @@ void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->sleep.sleep) { case STATUS_NONE: case 6: @@ -1207,7 +1207,7 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->nonVolatile.nonVolatileStatus) { case STATUS_NONE: case 5: @@ -1228,7 +1228,7 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target) EntityUpdateStatusSprites(target); } -void SendImmobilizeEndMessage(Entity * pokemon, Entity *target) +void EndFrozenClassStatus(Entity * pokemon, Entity *target) { bool8 isFrozen; EntityInfo *entityInfo; @@ -1238,7 +1238,7 @@ void SendImmobilizeEndMessage(Entity * pokemon, Entity *target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->immobilize.immobilizeStatus) { case STATUS_NONE: case 8: @@ -1278,7 +1278,7 @@ void SendVolatileEndMessage(Entity * pokemon, Entity *target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->volatileStatus.volatileStatus) { case STATUS_NONE: case 8: @@ -1318,50 +1318,50 @@ void SendProtectionEndMessage(Entity * pokemon, Entity *target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->protection.protectionStatus) { case STATUS_NONE: case 0xF: break; case STATUS_REFLECT: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA638); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA638); break; case STATUS_SAFEGUARD: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA69C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA69C); break; case STATUS_LIGHT_SCREEN: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA658); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA658); break; case STATUS_COUNTER: case STATUS_MINI_COUNTER: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA67C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA67C); break; case STATUS_MAGIC_COAT: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA6BC); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA6BC); break; case STATUS_WISH: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA6D4); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA6D4); break; case STATUS_PROTECT: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA9C0); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9C0); break; case STATUS_MIRROR_COAT: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA68); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA68); break; case STATUS_ENDURING: - TryDisplayDungeonLoggableMessage(target, *gPtrMonStoppedEnduringMessage); + LogMessageByIdWithPopupCheckUser(target, *gPtrMonStoppedEnduringMessage); break; case STATUS_MIRROR_MOVE: - TryDisplayDungeonLoggableMessage(target,*gPtrMonMirrorMoveFadedMessage); + LogMessageByIdWithPopupCheckUser(target,*gPtrMonMirrorMoveFadedMessage); break; case STATUS_CONVERSION2: - TryDisplayDungeonLoggableMessage(target, *gPtrMonConversion2FailedMessage); + LogMessageByIdWithPopupCheckUser(target, *gPtrMonConversion2FailedMessage); break; case STATUS_VITAL_THROW: - TryDisplayDungeonLoggableMessage(target, *gPtrMonGaveUpVitalThrowMessage); + LogMessageByIdWithPopupCheckUser(target, *gPtrMonGaveUpVitalThrowMessage); break; case STATUS_MIST: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAB40); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAB40); break; } entityInfo->protection.protectionStatus = STATUS_NONE; @@ -1375,19 +1375,19 @@ void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->waitingStruct.waitingStatus) { case STATUS_NONE: case 4: break; case STATUS_CURSED: if (waitingStatus != STATUS_CURSED) { - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA7BC); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA7BC); } break; case STATUS_SNATCH: if (waitingStatus != STATUS_SNATCH) { - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA7DC); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA7DC); } gDungeon->snatchPokemon = NULL; gDungeon->unk17B3C = 0; @@ -1396,10 +1396,10 @@ void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus) entityInfo->waitingStruct.waitingStatus = STATUS_NONE; uVar3 = sub_806CEBC(target); sub_806CCB4(target,uVar3); - gDungeon->decoyActive = FALSE; + gDungeon->decoyIsActive = FALSE; if (waitingStatus != STATUS_DECOY) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA9A0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9A0); } break; } @@ -1414,16 +1414,16 @@ void SendLinkedEndMessage(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->linked.linkedStatus) { case STATUS_NONE: break; case STATUS_LEECH_SEED: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA79C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA79C); break; case STATUS_DESTINY_BOND: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA8C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA8C); break; } entityInfo->linked.linkedStatus = STATUS_NONE; @@ -1440,22 +1440,22 @@ void SendMoveEndMessage(Entity * pokemon, Entity * target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->moveStatus.moveStatus) { case STATUS_NONE: case 5: break; case STATUS_SURE_SHOT: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA8E0); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA8E0); break; case STATUS_WHIFFER: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA90C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA90C); break; case STATUS_SET_DAMAGE: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA934); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA934); break; case STATUS_FOCUS_ENERGY: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA95C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA95C); break; } entityInfo->moveStatus.moveStatus = STATUS_NONE; @@ -1473,24 +1473,24 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->transformStatus.transformStatus) { case STATUS_NONE: case 4: break; case STATUS_INVISIBLE: isInvisible = TRUE; - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA9F4); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9F4); break; case STATUS_MOBILE: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FABBC); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FABBC); break; case STATUS_TRANSFORMED: entityInfo->apparentID = sub_8069F54(target, entityInfo->id); target->axObj.spriteFile = GetSpriteData(entityInfo->apparentID); uVar3 = sub_806CEBC(target); sub_806CCB4(target,uVar3); - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAB6C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAB6C); break; } entityInfo->transformStatus.transformStatus = STATUS_NONE; @@ -1508,19 +1508,19 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->eyesightStatus.eyesightStatus) { case STATUS_NONE: case 4: break; case STATUS_BLINKER: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA0C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA0C); break; case STATUS_CROSS_EYED: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA2C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA2C); break; case STATUS_EYEDROPS: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA48); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA48); break; } entityInfo->eyesightStatus.eyesightStatus = STATUS_NONE; @@ -1540,13 +1540,13 @@ void SendMuzzledEndMessage(Entity * pokemon, Entity * target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->muzzled.muzzled) { case FALSE: case 2: break; case TRUE: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FABC0); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FABC0); break; } entityInfo->muzzled.muzzled = FALSE; @@ -1559,7 +1559,7 @@ bool8 TrySendImmobilizeSleepEndMsg(Entity * pokemon, Entity * target) bool32 msg = FALSE; if (entityInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) { - SendImmobilizeEndMessage(pokemon, target); + EndFrozenClassStatus(pokemon, target); msg = TRUE; } if (entityInfo->sleep.sleep == STATUS_SLEEP && entityInfo->sleep.sleepTurns == 0x7f) { @@ -1590,7 +1590,7 @@ void SendThawedMessage(Entity *pokemon, Entity *target) entityInfo->immobilize.immobilizeStatus = STATUS_NONE; entityInfo->immobilize.immobilizeStatusTurns = 0; entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA8BC); // $m0 thawed out! EntityUpdateStatusSprites(target); } diff --git a/src/code_807CD9C.c b/src/code_807CD9C.c index 99f295bbd..4fc5f9988 100644 --- a/src/code_807CD9C.c +++ b/src/code_807CD9C.c @@ -70,11 +70,11 @@ void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction) else { if (pokemon == target) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA10); // {POKEMON_0} couldn't be knocked flying! return; } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (HasAbility(target,ABILITY_SUCTION_CUPS)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBCC); // {POKEMON_0} is anchored! It can't be knocked flying! return; @@ -226,7 +226,7 @@ void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos) info = GetEntInfo(target); flag = FALSE; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (HasAbility(target,ABILITY_SUCTION_CUPS)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAE8); return; @@ -358,12 +358,12 @@ void sub_807D3CC(Entity *param_1) } } if (flag) { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80FD2F8); // All traps were exposed + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80FD2F8); // All traps were exposed sub_8040A84(); sub_8049ED4(); } else { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80FD320); // There appears to be no hidden traps. + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80FD320); // There appears to be no hidden traps. } } diff --git a/src/code_807E1A0.c b/src/code_807E1A0.c index a1d17e4a3..2e3f69b73 100644 --- a/src/code_807E1A0.c +++ b/src/code_807E1A0.c @@ -74,12 +74,12 @@ void sub_807E254(Entity *pokemon,Entity *target) if (HasAbility(pokemon, ABILITY_SUCTION_CUPS)) { - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places } else if(HasAbility(target, ABILITY_SUCTION_CUPS)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places } else @@ -135,7 +135,7 @@ void sub_807E378(void) sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { - TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C4C); + LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9C4C); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0); gDungeon->unk67A = 1; } @@ -147,7 +147,7 @@ void sub_807E378(void) sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { - TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C70); + LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9C70); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1); gDungeon->unk67A = 2; } @@ -159,7 +159,7 @@ void sub_807E378(void) sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { - TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C8C); + LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9C8C); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2); gDungeon->unk67A = 3; } @@ -170,7 +170,7 @@ void sub_807E378(void) sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { - TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9CBC); + LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9CBC); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3); gDungeon->unk67A = 4; sub_8068FE0(leader,0x21e,leader); diff --git a/src/code_8083288.c b/src/code_8083288.c index 39d64988c..25277b261 100644 --- a/src/code_8083288.c +++ b/src/code_8083288.c @@ -26,10 +26,10 @@ void sub_8082B40(void) Entity *entity; int index; Position pos; - + for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { info = GetEntInfo(entity); entity->axObj.spriteFile = GetSpriteData(info->apparentID); @@ -202,7 +202,7 @@ void sub_8082DE8(unkStruct_8094924 *param_1, Protection *protect) void sub_8082E04(unkStruct_8094924 *param_1, Waiting *waiting) { sub_8082FE0(param_1, &waiting->waitingStatus, 1); - waiting->enemyDecoy = sub_80831DC(param_1); + waiting->decoyApplierNonTeamMemberFlag = sub_80831DC(param_1); waiting->unkCA = sub_80831DC(param_1); waiting->waitingStatusTurns = sub_8083188(param_1); waiting->curseDamageCountdown = sub_8083188(param_1); @@ -301,7 +301,7 @@ void sub_8082FA8(unkStruct_8094924 *param_1, u8 *param_2, s32 size) param_2++; size--; param_1->unk8++; - } + } } void sub_8082FD4(unkStruct_8094924 *param_1, u8 *r1, u32 r2) @@ -319,7 +319,7 @@ void sub_8082FE0(unkStruct_8094924 *param_1, u8 *param_2, s32 size) param_2++; size--; param_1->unk8++; - } + } } void nullsub_98(unkStruct_8094924 *param_1) diff --git a/src/debug_menu1.c b/src/debug_menu1.c index 04de91a30..d4977eff6 100644 --- a/src/debug_menu1.c +++ b/src/debug_menu1.c @@ -157,7 +157,7 @@ static void sub_803A3BC(void) speciesIndex = index * 0x10000 >> 0x10; // TODO: dumb way to force s16. Temp var may fix the regswap memset(moves, 0, sizeof(moves)); moves[0] = MOVE_DOUBLESLAP; - CopyMonsterNametoBuffer(buffer, speciesIndex); + CopyMonsterNameToBuffer(buffer, speciesIndex); CopyStringtoBuffer(buffer, buffer); buffer[0] = 0x40; sub_808CFD0(&pokemon, speciesIndex, buffer, ITEM_CHERI_BERRY, (DungeonLocation *)&loc, moves); diff --git a/src/dungeon_action.c b/src/dungeon_action.c index 436c0fd25..7a4a7d439 100644 --- a/src/dungeon_action.c +++ b/src/dungeon_action.c @@ -48,7 +48,7 @@ void sub_8044820(void) Entity * entity; Entity * entity2; s32 index; - + for (index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) { entity = gDungeon->wildPokemon[index]; if (EntityExists(entity)) { @@ -62,7 +62,7 @@ void sub_8044820(void) } else { - entityInfo->aiNextToTarget = FALSE; + entityInfo->aiAllySkip = FALSE; movSpeed = CalcSpeedStage(entity); if (gSpeedTurns[movSpeed][gDungeon->fractionalTurn] != 0) { if (!entityInfo->attacking) { @@ -88,12 +88,12 @@ void sub_8044820(void) for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) { entity2 = gDungeon->wildPokemon[index]; - if ((EntityExists(entity2)) && (entityInfo2 = GetEntInfo(entity2), entityInfo2->aiNextToTarget)) + if ((EntityExists(entity2)) && (entityInfo2 = GetEntInfo(entity2), entityInfo2->aiAllySkip)) { sub_8074094(entity2); if (EntityExists(entity2)) { sub_8071DA4(entity2); - entityInfo2->aiNextToTarget = FALSE; + entityInfo2->aiAllySkip = FALSE; } } } @@ -106,7 +106,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void) Entity *entity; u32 isNotEnemy; s32 index; - + if (gSpeedTurns[1][gDungeon->fractionalTurn] != 0) { sub_8071B48(); gDungeon->plusIsActive[0] = FALSE; @@ -118,7 +118,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); entityInfo->attacking = FALSE; @@ -137,7 +137,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void) } if (HasAbility(entity, ABILITY_MINUS)) { gDungeon->minusIsActive[isNotEnemy] = TRUE; - } + } if (HasAbility(entity, ABILITY_PLUS)) { gDungeon->plusIsActive[isNotEnemy] = TRUE; } @@ -150,10 +150,10 @@ void TrySpawnMonsterAndActivatePlusMinus(void) void sub_8044AB4(void) { s32 index; - + if (gSpeedTurns[1][gDungeon->fractionalTurn + 1] != 0) { for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (EntityExists(gDungeon->allPokemon[index])) { + if (EntityExists(gDungeon->activeMonsterPtrs[index])) { UseAttack(0); break; } @@ -182,7 +182,7 @@ bool8 sub_8044B28(void) } return TRUE; } - + bool8 sub_8044B84(void) { if(gDungeon->unk10 != 0) @@ -198,7 +198,7 @@ u8 *sub_8044BA8(u16 param_1, u8 id) { u32 uVar3; u32 uVar4; - + if ((param_1 == 0x26) && (sub_8043D10() == 2)) { return *gUnknown_80F91EC; } @@ -260,7 +260,7 @@ void SetMonsterActionFields(ActionContainer *actionPointer, u16 action) void SetActionPassTurnOrWalk(ActionContainer *actionPointer, s16 species) { - if (CanMove(species)) + if (GetCanMoveFlag(species)) { actionPointer->action = ACTION_WALK; } diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index 298cfc4bc..80684cf92 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -56,7 +56,7 @@ void sub_8075900(Entity *pokemon, u8 r1) if((GetTileAtEntitySafe(pokemon)->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE)) { // It's a monster house! - TryDisplayDungeonLoggableMessage(GetLeader(), gPtrItsaMonsterHouseMessage); + LogMessageByIdWithPopupCheckUser(GetLeader(), gPtrItsaMonsterHouseMessage); gDungeon->monsterHouseTriggeredEvent = TRUE; sub_807AB38(pokemon, r1); sub_8041888(0); @@ -76,21 +76,21 @@ void RunMonsterAI(Entity *pokemon, u32 unused) { if (pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) { - SendImmobilizeEndMessage(pokemon, pokemon); + EndFrozenClassStatus(pokemon, pokemon); } } else { - pokemonInfo->targetingDecoy = TARGETING_DECOY_NONE; - if (pokemonInfo->clientType == CLIENT_TYPE_NONE || IsMovingClient(pokemon)) + pokemonInfo->decoyAITracker = DECOY_AI_NONE; + if (pokemonInfo->monsterBehavior == BEHAVIOR_FIXED_ENEMY || ShouldRunMonsterAI(pokemon)) { - if (pokemonInfo->clientType != CLIENT_TYPE_CLIENT && pokemonInfo->useHeldItem) + if (pokemonInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET && pokemonInfo->useHeldItem) { if (CheckVariousConditions(pokemon)) { pokemonInfo->useHeldItem = FALSE; - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); - TryDisplayDungeonLoggableMessage(pokemon, gPtrCouldntBeUsedMessage); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + LogMessageByIdWithPopupCheckUser(pokemon, gPtrCouldntBeUsedMessage); return; } AIDecideUseItem(pokemon); @@ -99,32 +99,32 @@ void RunMonsterAI(Entity *pokemon, u32 unused) return; } } - if (!HasStatusAffectingActions(pokemon)) + if (!HasStatusThatPreventsActing(pokemon)) { - if (gDungeon->decoyActive) + if (gDungeon->decoyIsActive) { s32 i; Entity *target; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - target = gDungeon->allPokemon[i]; + target = gDungeon->activeMonsterPtrs[i]; if (EntityExists(target) && GetEntInfo(target)->waitingStruct.waitingStatus == STATUS_DECOY && CanSeeTarget(pokemon, target)) { - bool8 enemyDecoy = GetEntInfo(target)->waitingStruct.enemyDecoy; - u8 targetingDecoy = TARGETING_DECOY_TEAM; - if (enemyDecoy) + bool8 decoyApplierNonTeamMemberFlag = GetEntInfo(target)->waitingStruct.decoyApplierNonTeamMemberFlag; + u8 decoyAITracker = DECOY_AI_TEAM; + if (decoyApplierNonTeamMemberFlag) { - targetingDecoy = TARGETING_DECOY_WILD; + decoyAITracker = DECOY_AI_WILD; } - pokemonInfo->targetingDecoy = targetingDecoy; + pokemonInfo->decoyAITracker = decoyAITracker; break; } } } ClearMonsterActionFields(&pokemonInfo->action); - if (pokemonInfo->clientType == CLIENT_TYPE_CLIENT) + if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); pokemonInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); @@ -138,7 +138,7 @@ void RunMonsterAI(Entity *pokemon, u32 unused) { if (!IQSkillIsEnabled(pokemon, IQ_DEDICATED_TRAVELER)) { - DecideAttack(pokemon); + ChooseAIMove(pokemon); if (pokemonInfo->action.action != ACTION_NOTHING) { return; @@ -149,11 +149,11 @@ void RunMonsterAI(Entity *pokemon, u32 unused) } else { - if (!CanMove(pokemonInfo->id)) + if (!GetCanMoveFlag(pokemonInfo->id)) { return; } - MoveIfPossible(pokemon, TRUE); + AIMovement(pokemon, TRUE); } } else @@ -164,21 +164,21 @@ void RunMonsterAI(Entity *pokemon, u32 unused) } else { - if (CanMove(pokemonInfo->id)) + if (GetCanMoveFlag(pokemonInfo->id)) { - MoveIfPossible(pokemon, TRUE); + AIMovement(pokemon, TRUE); } if (pokemonInfo->action.action > ACTION_PASS_TURN) { return; } - DecideAttack(pokemon); + ChooseAIMove(pokemon); if (pokemonInfo->action.action <= ACTION_PASS_TURN) { return; } pokemonInfo->aiTarget.aiNotNextToTarget = FALSE; - pokemonInfo->aiNextToTarget = FALSE; + pokemonInfo->aiAllySkip = FALSE; pokemonInfo->waiting = FALSE; } } diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c index 3b9d68433..5fc15e1f1 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -65,7 +65,7 @@ extern void sub_804AC20(struct Position *); extern void sub_807EC28(bool8); extern void sub_806A5B8(struct Entity *entity); -void DecideAttack(Entity *pokemon) +void ChooseAIMove(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); s32 i; @@ -422,7 +422,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *target = gDungeon->allPokemon[i]; + Entity *target = gDungeon->activeMonsterPtrs[i]; if (EntityExists(target) && CanSeeTarget(pokemon, target)) { numPotentialTargets = TryAddTargetToAITargetList(numPotentialTargets, targetingFlags, pokemon, target, move, hasStatusChecker); @@ -467,7 +467,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move } for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *target = gDungeon->allPokemon[i]; + Entity *target = gDungeon->activeMonsterPtrs[i]; if (EntityExists(target) && pokemon != target) { s32 direction = GetDirectionTowardsPosition(&pokemon->pos, &target->pos); @@ -491,7 +491,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *target = gDungeon->allPokemon[i]; + Entity *target = gDungeon->activeMonsterPtrs[i]; if (EntityExists(target)) { numPotentialTargets = TryAddTargetToAITargetList(numPotentialTargets, targetingFlags, pokemon, target, move, hasStatusChecker); @@ -674,8 +674,8 @@ bool8 IsAITargetEligible(s32 targetingFlags, Entity *user, Entity *target, Move checkThirdParty: hasTarget = TRUE; if (targetData->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || - targetData->clientType == CLIENT_TYPE_DONT_MOVE || - targetData->clientType == CLIENT_TYPE_CLIENT) + targetData->monsterBehavior == BEHAVIOR_DIGLETT || + targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { returnFalse: return FALSE; @@ -988,14 +988,14 @@ void HandleUseOrbAction(Entity *pokemon) if (item->flags & ITEM_FLAG_STICKY) { sub_8045BF8(gFormatBuffer_Items[0], item); - TryDisplayDungeonLoggableMessage(pokemon, *gItemStickyDoesntWorkText); + LogMessageByIdWithPopupCheckUser(pokemon, *gItemStickyDoesntWorkText); return; } act = entityInfo->action; if (IsBossFight()) { - TryDisplayDungeonLoggableMessage(pokemon, *gPtrMysteriousPowerPreventedUseMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrMysteriousPowerPreventedUseMessage); r4 = TRUE; } else { @@ -1014,21 +1014,21 @@ void HandleUseOrbAction(Entity *pokemon) } if (entityInfo->volatileStatus.volatileStatus == 1) { - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); - TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FC714); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC714); r4 = FALSE; r8 = FALSE; } else if (entityInfo->volatileStatus.volatileStatus == 7) { - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); - TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FC718); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC718); r4 = FALSE; r8 = FALSE; } else if (entityInfo->nonVolatile.nonVolatileStatus == 4) { - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); - TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FC6A8); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC6A8); r4 = FALSE; r8 = FALSE; } diff --git a/src/dungeon_ai_items.c b/src/dungeon_ai_items.c index bec094616..974d90f1a 100644 --- a/src/dungeon_ai_items.c +++ b/src/dungeon_ai_items.c @@ -49,7 +49,7 @@ void sub_807360C(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if(EntityExists(entity)) { if(GetEntInfo(entity)->unk152 != 0) @@ -281,7 +281,7 @@ void GetPossibleAIThrownItemDirections(Entity *pokemon, s32 thrownAIFlag, Item * } for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *targetPokemon = gDungeon->allPokemon[i]; + Entity *targetPokemon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(targetPokemon) && pokemon != targetPokemon) { s32 targetingFlags; @@ -318,7 +318,7 @@ void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, Position potential gAIThrowItemActionChoiceCount = 0; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *targetPokemon = gDungeon->allPokemon[i]; + Entity *targetPokemon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(targetPokemon) && pokemon != targetPokemon && CanSeeTarget(pokemon, targetPokemon) && GetTreatmentBetweenMonsters(pokemon, targetPokemon, FALSE, TRUE) == TREATMENT_TREAT_AS_ENEMY) { diff --git a/src/dungeon_ai_leader.c b/src/dungeon_ai_leader.c index 57dd17a06..15d34b63c 100644 --- a/src/dungeon_ai_leader.c +++ b/src/dungeon_ai_leader.c @@ -224,7 +224,7 @@ bool8 sub_8072CF4(Entity *entity) break; case ACTION_STAIRS: if ((gDungeon->dungeonLocation.id == DUNGEON_METEOR_CAVE) && (!gDungeon->deoxysDefeat)) { - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FA5B4); // It's impossible to go down the stairs now! + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FA5B4); // It's impossible to go down the stairs now! } else { @@ -282,8 +282,8 @@ bool8 sub_8072CF4(Entity *entity) sub_80671A0(entity); break; } - SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FE6D4); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FE6D4); break; case ACTION_TALK_FIELD: HandleTalkFieldAction(entity); @@ -310,8 +310,8 @@ bool8 sub_8072CF4(Entity *entity) HandleThrowItemAIAction(entity); break; case ACTION_SECOND_THOUGHTS: - SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FE478); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FE478); break; default: info->action.action = ACTION_PASS_TURN; @@ -339,7 +339,7 @@ bool8 sub_8072CF4(Entity *entity) } } if (bVar4) { - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FD2CC); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FD2CC); } } sub_807360C(); @@ -358,7 +358,7 @@ bool8 sub_8072CF4(Entity *entity) sub_8046D20(); } sub_8041888(0); - if (((EntityExists(entity)) && (!info->aiNextToTarget)) && (!bVar14)) { + if (((EntityExists(entity)) && (!info->aiAllySkip)) && (!bVar14)) { if (sub_80706A4(entity,&entity->pos) != '\0') { sub_807D148(entity,entity,0,0); } diff --git a/src/dungeon_ai_movement.c b/src/dungeon_ai_movement.c index 1fd34a972..c4d14e44b 100644 --- a/src/dungeon_ai_movement.c +++ b/src/dungeon_ai_movement.c @@ -43,7 +43,7 @@ struct CanMoveInDirectionInfo const s32 gFaceDirectionIncrements[] = {0, 1, -1, 2, -2, 3, -3, 4, 0, -1, 1, -2, 2, -3, 3, 4}; -void MoveIfPossible(Entity *pokemon, bool8 showRunAwayEffect) +void AIMovement(Entity *pokemon, bool8 showRunAwayEffect) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); pokemonInfo->aiTarget.aiNotNextToTarget = FALSE; @@ -67,7 +67,7 @@ void MoveIfPossible(Entity *pokemon, bool8 showRunAwayEffect) { pokemonInfo->action.action = ACTION_NOTHING; } - else if (pokemonInfo->clientType == CLIENT_TYPE_CLIENT) + else if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); pokemonInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); @@ -148,9 +148,9 @@ bool8 ChooseTargetPosition(Entity *pokemon) bool8 canCrossWalls; s32 targetDistance; s32 i; - if (gDungeon->decoyActive) + if (gDungeon->decoyIsActive) { - possibleTargets = gDungeon->allPokemon; + possibleTargets = gDungeon->activeMonsterPtrs; maxPossibleTargets = DUNGEON_MAX_POKEMON; } else if (pokemonInfo->isNotTeamMember) @@ -169,9 +169,9 @@ bool8 ChooseTargetPosition(Entity *pokemon) for (i = 0; i < maxPossibleTargets; i++) { Entity *target = possibleTargets[i]; - if (EntityExists(target) && GetEntInfo(target)->clientType == CLIENT_TYPE_NONE) + if (EntityExists(target) && GetEntInfo(target)->monsterBehavior == BEHAVIOR_FIXED_ENEMY) { - if (gDungeon->decoyActive) + if (gDungeon->decoyIsActive) { if (GetTreatmentBetweenMonsters(pokemon, target, FALSE, TRUE) != TREATMENT_TREAT_AS_ENEMY) { @@ -405,7 +405,7 @@ void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect) if (!pokemonInfo->isNotTeamMember && !pokemonInfo->recalculateFollow) { pokemonInfo->aiTarget.aiNotNextToTarget = TRUE; - pokemonInfo->aiNextToTarget = TRUE; + pokemonInfo->aiAllySkip = TRUE; SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); pokemonInfo->waiting = TRUE; return; @@ -492,11 +492,11 @@ void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect) if (pokemonInfo->isTeamLeader) { pokemonInfo->aiTarget.aiNotNextToTarget = FALSE; - pokemonInfo->aiNextToTarget = FALSE; + pokemonInfo->aiAllySkip = FALSE; } else if (pokemonInfo->aiTarget.aiNotNextToTarget) { - pokemonInfo->aiNextToTarget = TRUE; + pokemonInfo->aiAllySkip = TRUE; } } @@ -511,9 +511,9 @@ bool8 AvoidEnemies(Entity *pokemon) Entity **possibleTargets; s32 numPossibleTargets; s32 i; - if (gDungeon->decoyActive) + if (gDungeon->decoyIsActive) { - possibleTargets = gDungeon->allPokemon; + possibleTargets = gDungeon->activeMonsterPtrs; numPossibleTargets = DUNGEON_MAX_POKEMON; } else if (pokemonInfo->isNotTeamMember) @@ -534,7 +534,7 @@ bool8 AvoidEnemies(Entity *pokemon) if (EntityExists(target) && CanSeeTarget(pokemon, target)) { s32 distance; - if (gDungeon->decoyActive && GetTreatmentBetweenMonsters(pokemon, target, FALSE, TRUE) != TREATMENT_TREAT_AS_ENEMY) + if (gDungeon->decoyIsActive && GetTreatmentBetweenMonsters(pokemon, target, FALSE, TRUE) != TREATMENT_TREAT_AS_ENEMY) { continue; } diff --git a/src/dungeon_ai_targeting.c b/src/dungeon_ai_targeting.c index b29de7390..0b2372c0c 100644 --- a/src/dungeon_ai_targeting.c +++ b/src/dungeon_ai_targeting.c @@ -462,7 +462,7 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign { EntityInfo *pokemonInfo = GetEntInfo(pokemon); EntityInfo *targetData = GetEntInfo(targetPokemon); - u8 targetingDecoy; + u8 decoyAITracker; u8 pokemonTargetingDecoy; bool8 pokemonIsEnemy; bool8 targetIsEnemy; @@ -473,23 +473,23 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign } if (pokemonInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || targetData->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || - pokemonInfo->clientType == CLIENT_TYPE_DONT_MOVE || - targetData->clientType == CLIENT_TYPE_DONT_MOVE || - pokemonInfo->clientType == CLIENT_TYPE_CLIENT || - targetData->clientType == CLIENT_TYPE_CLIENT || + pokemonInfo->monsterBehavior == BEHAVIOR_DIGLETT || + targetData->monsterBehavior == BEHAVIOR_DIGLETT || + pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET || + targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET || (checkPetrified && !pokemonInfo->isNotTeamMember && targetData->immobilize.immobilizeStatus == STATUS_PETRIFIED) || (!ignoreInvisible && targetData->transformStatus.transformStatus == STATUS_INVISIBLE && !CanSeeInvisibleMonsters(pokemon))) { return TREATMENT_IGNORE; } - pokemonTargetingDecoy = pokemonInfo->targetingDecoy; - targetingDecoy = TARGETING_DECOY_NONE; - if (pokemonTargetingDecoy != TARGETING_DECOY_NONE) + pokemonTargetingDecoy = pokemonInfo->decoyAITracker; + decoyAITracker = DECOY_AI_NONE; + if (pokemonTargetingDecoy != DECOY_AI_NONE) { - targetingDecoy = TARGETING_DECOY_WILD; - if (pokemonTargetingDecoy == TARGETING_DECOY_TEAM) + decoyAITracker = DECOY_AI_WILD; + if (pokemonTargetingDecoy == DECOY_AI_TEAM) { - targetingDecoy = TARGETING_DECOY_TEAM; + decoyAITracker = DECOY_AI_TEAM; } } if (pokemonInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL) @@ -521,7 +521,7 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign { targetIsDecoy = TRUE; } - return gTreatmentData[targetingDecoy][pokemonIsEnemy][targetIsEnemy][targetIsDecoy]; + return gTreatmentData[decoyAITracker][pokemonIsEnemy][targetIsEnemy][targetIsDecoy]; } u8 sub_807167C(Entity * pokemon, Entity * target) @@ -532,9 +532,9 @@ u8 sub_807167C(Entity * pokemon, Entity * target) pokemonEntityData = GetEntInfo(pokemon); targetEntityInfo = GetEntInfo(target); - if (pokemonEntityData->clientType != CLIENT_TYPE_CLIENT) { + if (pokemonEntityData->monsterBehavior != BEHAVIOR_RESCUE_TARGET) { cannotUseItems = IsClientOrTeamBase(pokemonEntityData->joinedAt.joinedAt); - if (!cannotUseItems && (pokemonEntityData->shopkeeper == SHOPKEEPER_MODE_NORMAL) && (targetEntityInfo->clientType != CLIENT_TYPE_CLIENT)) { + if (!cannotUseItems && (pokemonEntityData->shopkeeper == SHOPKEEPER_MODE_NORMAL) && (targetEntityInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET)) { cannotUseItems = IsClientOrTeamBase(targetEntityInfo->joinedAt.joinedAt); if (cannotUseItems || (targetEntityInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL)) { error: diff --git a/src/dungeon_capabilities.c b/src/dungeon_capabilities.c index f7b9c2ba3..8e4a6873c 100644 --- a/src/dungeon_capabilities.c +++ b/src/dungeon_capabilities.c @@ -80,7 +80,7 @@ bool8 CheckVariousConditions(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if (pokemonInfo->clientType == CLIENT_TYPE_CLIENT + if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET || IsClientOrTeamBase(pokemonInfo->joinedAt.joinedAt) || (!pokemonInfo->isTeamLeader && ShouldMonsterRunAway(pokemon)) || CheckVariousStatuses2(pokemon, FALSE) diff --git a/src/dungeon_cutscenes.c b/src/dungeon_cutscenes.c index 84e3eb41a..262cb432c 100644 --- a/src/dungeon_cutscenes.c +++ b/src/dungeon_cutscenes.c @@ -514,8 +514,8 @@ void sub_8086B14(void) Entity * skarmoryEntity; leaderEntity = xxx_call_GetLeader(); - diglettEntity = GetEntityFromClientType(4); - skarmoryEntity = GetEntityFromClientType(3); + diglettEntity = GetEntityFromMonsterBehavior(BEHAVIOR_DIGLETT); + skarmoryEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SKARMORY); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_8085374(); sub_80854D4(); @@ -524,8 +524,8 @@ void sub_8086B14(void) sub_8086A3C(skarmoryEntity); GetEntInfo(diglettEntity)->unk15C = 1; sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 2); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_DIGLETT); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_SKARMORY); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_DIGLETT); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_SKARMORY); } void sub_8086B94(void) @@ -535,8 +535,8 @@ void sub_8086B94(void) Entity * skarmoryEntity; leaderEntity = xxx_call_GetLeader(); - diglettEntity = GetEntityFromClientType(4); - skarmoryEntity = GetEntityFromClientType(3); + diglettEntity = GetEntityFromMonsterBehavior(BEHAVIOR_DIGLETT); + skarmoryEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SKARMORY); sub_8068FE0(skarmoryEntity,0x21c,0); sub_8068FE0(diglettEntity,0x21c,0); @@ -566,8 +566,8 @@ void SkarmoryPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); // Player partnerEntity = GetPartnerEntity(); // Partner - diglettEntity = GetEntityFromClientType(4); // Diglett - skarmoryEntity = GetEntityFromClientType(3); // Skarmory + diglettEntity = GetEntityFromMonsterBehavior(BEHAVIOR_DIGLETT); // Diglett + skarmoryEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SKARMORY); // Skarmory pos1.x = diglettEntity->pixelPos.x; pos1.y = diglettEntity->pixelPos.y + 0x3000; @@ -621,7 +621,7 @@ void SkarmoryReFightDialogue(void) Position32 pos; leaderEntity = xxx_call_GetLeader(); - skarmoryEntity = GetEntityFromClientType(3); + skarmoryEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SKARMORY); pos.x = skarmoryEntity->pixelPos.x; pos.y = skarmoryEntity->pixelPos.y + 0x2000; sub_8086448(); @@ -668,9 +668,9 @@ void sub_8086E9C(void) sub_80855E4(sub_8086A3C); sub_808563C(sub_8086A3C); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_METAPOD); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_GENGAR); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[4], MONSTER_CATERPIE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_METAPOD); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_GENGAR); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[4], MONSTER_CATERPIE); } void sub_8086F00(void) @@ -682,9 +682,9 @@ void sub_8086F00(void) sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_METAPOD); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_GENGAR); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[4], MONSTER_CATERPIE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_METAPOD); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_GENGAR); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[4], MONSTER_CATERPIE); } // From @jiangzhengwenjz: @@ -704,7 +704,7 @@ void sub_8086F54(u8 param_1, u8 param_2) for(index = 0; index < 0x10; index++) { entity = gDungeon->wildPokemon[index]; - if ((EntityExists(entity)) && (GetEntInfo(entity)->clientType != param_1)) { + if ((EntityExists(entity)) && (GetEntInfo(entity)->monsterBehavior != param_1)) { return; } } @@ -791,9 +791,9 @@ void sub_8087144(void) Entity *pEStack_58[3]; struct_8085B80 auStack_4c[3]; - iVar2 = GetEntityFromClientType(5); - iVar3 = GetEntityFromClientType(6); - iVar4 = GetEntityFromClientType(7); + iVar2 = GetEntityFromMonsterBehavior(BEHAVIOR_5); + iVar3 = GetEntityFromMonsterBehavior(BEHAVIOR_6); + iVar4 = GetEntityFromMonsterBehavior(BEHAVIOR_MEDICHAM); memcpy(auStack_10c,gUnknown_810739C, 0x38); memcpy(puStack_60, gUnknown_81073D4, 0x38); memcpy(puStack_5c, gUnknown_810740C, 0x38); @@ -826,7 +826,7 @@ void sub_8087230(void) Entity *zapdosEntity; leaderEntity = xxx_call_GetLeader(); - zapdosEntity = GetEntityFromClientType(0x8); + zapdosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ZAPDOS); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_8085374(); sub_80854D4(); @@ -835,8 +835,8 @@ void sub_8087230(void) SetFacingDirection(zapdosEntity, DIRECTION_SOUTH); sub_8086A3C(zapdosEntity); sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SHIFTRY); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ZAPDOS); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SHIFTRY); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ZAPDOS); } void sub_808729C(void) @@ -845,7 +845,7 @@ void sub_808729C(void) Entity *zapdosEntity; leaderEntity = xxx_call_GetLeader(); - zapdosEntity = GetEntityFromClientType(8); + zapdosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ZAPDOS); sub_80854D4(); sub_8085930(4); sub_80855E4(sub_8086A3C); @@ -858,8 +858,8 @@ void sub_808729C(void) sub_8086A3C(zapdosEntity); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SHIFTRY); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ZAPDOS); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SHIFTRY); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ZAPDOS); } void sub_8087334(u8 param_1, u8 param_2) @@ -886,7 +886,7 @@ void ZapdosPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - zapdosEntity = GetEntityFromClientType(8); + zapdosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ZAPDOS); sub_8086448(); sub_803E708(10,0x46); SpriteLookAroundEffect(partnerEntity); @@ -959,7 +959,7 @@ void ZapdosReFightDialogue(void) Entity *zapdosEntity; leaderEntity = xxx_call_GetLeader(); - zapdosEntity = GetEntityFromClientType(8); + zapdosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ZAPDOS); sub_8086448(); sub_803E708(10,0x46); DisplayDungeonDialogue(&gZapdosReFightDialogue_1); @@ -984,7 +984,7 @@ void ZapdosPostStoryPreFightDialogue(void) Entity * zapdosEntity; leaderEntity = xxx_call_GetLeader(); - zapdosEntity = GetEntityFromClientType(8); + zapdosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ZAPDOS); sub_8086448(); if (sub_8086AE4(MONSTER_ZAPDOS)) { sub_80866C4(&gZapdosPostStoryPreFightDialogue_6); @@ -1057,7 +1057,7 @@ void sub_80877E8(void) Entity * moltresEntity; leaderEntity = xxx_call_GetLeader(); - moltresEntity = GetEntityFromClientType(9); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); DungeonStartNewBGM(MUS_THE_MOUNTAIN_OF_FIRE); sub_8085374(); sub_80854D4(); @@ -1066,7 +1066,7 @@ void sub_80877E8(void) SetFacingDirection(moltresEntity, DIRECTION_SOUTH); sub_8086A3C(moltresEntity); sub_8085860(leaderEntity->pos.x + -3,leaderEntity->pos.y + -2); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_MOLTRES); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_MOLTRES); } void sub_8087848(void) @@ -1078,7 +1078,7 @@ void sub_8087848(void) s32 YPos; leaderEntity = xxx_call_GetLeader(); - moltresEntity = GetEntityFromClientType(9); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); DungeonStartNewBGM(MUS_THE_MOUNTAIN_OF_FIRE); sub_80854D4(); sub_8085930(DIRECTION_WEST); @@ -1095,7 +1095,7 @@ void sub_8087848(void) XPos = GetCameraXPos(); YPos = GetCameraYPos(); sub_803F878(XPos, YPos + -0x1000); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_MOLTRES); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_MOLTRES); } void sub_80878F4(u8 param_1, u8 param_2) @@ -1114,7 +1114,7 @@ void MoltresPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - moltresEntity = GetEntityFromClientType(9); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); MoltresScreenFlash1(0xc,5); sub_8086500(); sub_803E708(10,0x46); @@ -1184,7 +1184,7 @@ void MoltresReFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - moltresEntity = GetEntityFromClientType(9); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); MoltresScreenFlash1(10,5); sub_8086500(); sub_803E708(10,0x46); @@ -1224,7 +1224,7 @@ void MoltresPostStoryPreFightDialogue(void) Entity * moltresEntity; leaderEntity = xxx_call_GetLeader(); - moltresEntity = GetEntityFromClientType(9); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); MoltresScreenFlash1(0xc,5); sub_808654C(); if (sub_8086AE4(MONSTER_MOLTRES)) { @@ -1466,7 +1466,7 @@ void sub_8087F54(void) Entity *articunoEntity; leaderEntity = xxx_call_GetLeader(); - articunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_8085374(); sub_80854D4(); @@ -1475,21 +1475,21 @@ void sub_8087F54(void) SetFacingDirection(articunoEntity, DIRECTION_SOUTH); sub_8086A3C(articunoEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); } void sub_8087FB4(void) { Entity *articunoEntity; - articunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_8085374(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(articunoEntity, DIRECTION_SOUTH); sub_806CDD4(articunoEntity, 0xF, DIRECTION_SOUTH); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); } void sub_8087FF8(void) @@ -1498,7 +1498,7 @@ void sub_8087FF8(void) Entity *articunoEntity; leaderEntity = xxx_call_GetLeader(); - articunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); sub_8085374(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -1512,7 +1512,7 @@ void sub_8087FF8(void) sub_8086A3C(articunoEntity); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); } void sub_8088088(u8 param_1, u8 param_2) @@ -1531,7 +1531,7 @@ void ArticunoPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - articunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); sub_8086448(); SpriteLookAroundEffect(partnerEntity); DisplayDungeonDialogue(&gArticunoPreFightDialogue_1); @@ -1607,7 +1607,7 @@ void ArticunoReFightDialogue(void) Entity *articunoEntity; leaderEntity = xxx_call_GetLeader(); - articunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); gDungeon->weather.unkE265 = WEATHER_SNOW; sub_807EAA0(0,1); sub_803E708(10,0x46); @@ -1629,7 +1629,7 @@ void ArticunoPostStoryPreFightDialogue(void) Entity *articunoEntity; leaderEntity = xxx_call_GetLeader(); - articunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); sub_8086448(); if (sub_8086AE4(MONSTER_ARTICUNO)) { sub_80866C4(&gUnknown_8102A9C); @@ -1755,8 +1755,8 @@ void sub_808862C(void) Entity * groudonEntity; leaderEntity = xxx_call_GetLeader(); - alakazamEntity = GetEntityFromClientType(10); - groudonEntity = GetEntityFromClientType(0xe); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_1); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80867F4(); sub_8085374(); @@ -1768,8 +1768,8 @@ void sub_808862C(void) SetFacingDirection(groudonEntity, DIRECTION_SOUTH); sub_8086A3C(groudonEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y -3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); } void sub_80886C4(void) @@ -1782,8 +1782,8 @@ void sub_80886C4(void) s32 YPos; leaderEntity = xxx_call_GetLeader(); - alakazamEntity = GetEntityFromClientType(10); - groudonEntity = GetEntityFromClientType(0xe); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_1); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); PlaySoundEffect(0x3e5); sub_80867F4(); sub_8085374(); @@ -1796,8 +1796,8 @@ void sub_80886C4(void) XPos = GetCameraXPos(); YPos = GetCameraYPos(); sub_803F878(XPos,YPos + -0x1000); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); } void sub_808875C(void) @@ -1807,8 +1807,8 @@ void sub_808875C(void) Entity * groudonEntity; leaderEntity = xxx_call_GetLeader(); - alakazamEntity = GetEntityFromClientType(10); - groudonEntity = GetEntityFromClientType(0xe); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_1); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); sub_80867F4(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -1823,8 +1823,8 @@ void sub_808875C(void) sub_80861D4(groudonEntity,0xf,DIRECTION_SOUTH); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); } void sub_8088818(u8 param_1, u8 param_2) @@ -1849,8 +1849,8 @@ void GroudonPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - alakazamEntity = GetEntityFromClientType(10); - groudonEntity = GetEntityFromClientType(0xe); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_1); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); sub_8086448(); DisplayDungeonDialogue(&GroudonPreFightDialogue_1); sub_803E708(10,0x46); @@ -1928,7 +1928,7 @@ void GroudonReFightDialogue(void) Entity * groudonEntity; leaderEntity = xxx_call_GetLeader(); - groudonEntity = GetEntityFromClientType(0xe); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); sub_8086838(1,1,1); sub_808680C(); sub_803E708(0x3c,0x46); @@ -1960,7 +1960,7 @@ void GroudonPostStoryPreFightDialogue(void) Entity * groudonEntity; leaderEntity = xxx_call_GetLeader(); - groudonEntity = GetEntityFromClientType(0xe); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); sub_8086448(); if (sub_8086AE4(MONSTER_GROUDON)) { sub_80866C4(&gUnknown_8103488); @@ -2072,8 +2072,8 @@ void sub_8088DC0(void) Entity * alakazamEntity; leaderEntity = xxx_call_GetLeader(); - groudonEntity = GetEntityFromClientType(0xb); - alakazamEntity = GetEntityFromClientType(0xc); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_1); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_2); sub_80867F4(); sub_8086838(0,1,0); sub_8085374(); @@ -2085,8 +2085,8 @@ void sub_8088DC0(void) sub_8086A3C(alakazamEntity); sub_806CDD4(alakazamEntity,0xe,DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); } void sub_8088E5C(void) @@ -2096,8 +2096,8 @@ void sub_8088E5C(void) Entity * alakazamEntity; leaderEntity = xxx_call_GetLeader(); - groudonEntity = GetEntityFromClientType(0xb); - alakazamEntity = GetEntityFromClientType(0xc); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_1); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_2); sub_80867F4(); sub_8086838(0,1,0); sub_80854D4(); @@ -2106,8 +2106,8 @@ void sub_8088E5C(void) sub_8068FE0(groudonEntity,0x21c,0); sub_8068FE0(alakazamEntity,0x21c,0); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); } void sub_8088EE8(void) @@ -2127,8 +2127,8 @@ void MagmaCavernMidDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - groudonEntity = GetEntityFromClientType(0xb); - alakazamEntity = GetEntityFromClientType(0xc); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_1); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_2); sub_8052D44(IDStack,leaderEntity,partnerEntity); sub_8086448(); SpriteLookAroundEffect(partnerEntity); @@ -2342,7 +2342,7 @@ void sub_80892C8(void) Entity * RayquazaEntity; leaderEntity = xxx_call_GetLeader(); - RayquazaEntity = GetEntityFromClientType(0xf); + RayquazaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAYQUAZA); DungeonStartNewBGM(MUS_RAYQUAZAS_DOMAIN); sub_8085374(); sub_80854D4(); @@ -2351,7 +2351,7 @@ void sub_80892C8(void) SetFacingDirection(RayquazaEntity, DIRECTION_SOUTH); sub_8086A3C(RayquazaEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_RAYQUAZA); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_RAYQUAZA); } void sub_8089328(void) @@ -2360,7 +2360,7 @@ void sub_8089328(void) Entity * rayquazaEntity; leaderEntity = xxx_call_GetLeader(); - rayquazaEntity = GetEntityFromClientType(0xf); + rayquazaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAYQUAZA); DungeonStartNewBGM(MUS_RAYQUAZAS_DOMAIN); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -2373,7 +2373,7 @@ void sub_8089328(void) sub_8086A3C(rayquazaEntity); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_RAYQUAZA); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_RAYQUAZA); } void sub_80893B4(u8 param_1, u8 param_2) @@ -2392,7 +2392,7 @@ void RayquazaPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - rayquazaEntity = GetEntityFromClientType(0xf); + rayquazaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAYQUAZA); sub_8086448(); DisplayDungeonDialogue(&gRayquazaPreFightDialogue_1); RayquazaScreenFlash(); @@ -2431,7 +2431,7 @@ void RayquazaReFightDialogue(void) Entity *rayquazaEntity; leaderEntity = xxx_call_GetLeader(); - rayquazaEntity = GetEntityFromClientType(0xf); + rayquazaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAYQUAZA); sub_8086448(); RayquazaScreenFlash(); PlaySoundEffect(0x1da); // Rayquaza Cry @@ -2455,7 +2455,7 @@ void RayquazaPostStoryPreFightDialogue(void) Entity *rayquazaEntity; leaderEntity = xxx_call_GetLeader(); - rayquazaEntity = GetEntityFromClientType(0xf); + rayquazaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAYQUAZA); sub_8086448(); if (sub_8086AE4(MONSTER_RAYQUAZA)) { sub_80866C4(&gRayquazaPostStoryPreFightDialogue_6); @@ -2562,7 +2562,7 @@ void sub_8089788(Entity *entity, u8 param_2, u8 param_3) for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) { monEntity = gDungeon->wildPokemon[index]; - if ((EntityExists(monEntity)) && (monEntity != entity) && (GetEntInfo(monEntity)->clientType == param_2)) { + if ((EntityExists(monEntity)) && (monEntity != entity) && (GetEntInfo(monEntity)->monsterBehavior == param_2)) { return; } } @@ -2651,7 +2651,7 @@ void sub_8089914(void) Entity *MewtwoEntity; leaderEntity = xxx_call_GetLeader(); - MewtwoEntity = GetEntityFromClientType(0x11); + MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); DungeonStopBGM(); gDungeon->unk7 = 1; sub_80854D4(); @@ -2660,7 +2660,7 @@ void sub_8089914(void) SetFacingDirection(MewtwoEntity, DIRECTION_SOUTH); sub_8086A3C(MewtwoEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_MEWTWO); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_MEWTWO); } void sub_8089978(void) @@ -2669,7 +2669,7 @@ void sub_8089978(void) Entity *MewtwoEntity; leaderEntity = xxx_call_GetLeader(); - MewtwoEntity = GetEntityFromClientType(0x11); + MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); DungeonStopBGM(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -2684,7 +2684,7 @@ void sub_8089978(void) sub_8086A3C(MewtwoEntity); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_MEWTWO); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_MEWTWO); } void sub_8089A00(u8 param_1, u8 param_2) @@ -2701,7 +2701,7 @@ void MewtwoPreFightDialogue(void) Entity *MewtwoEntity; leaderEntity = xxx_call_GetLeader(); - MewtwoEntity = GetEntityFromClientType(0x11); + MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); sub_8086448(); DisplayDungeonDialogue(&gMewtwoPreFightDialogue_1); sub_803E708(10,0x46); @@ -2728,7 +2728,7 @@ void MewtwoReFightDialogue(void) Entity *MewtwoEntity; leaderEntity = xxx_call_GetLeader(); - MewtwoEntity = GetEntityFromClientType(0x11); + MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); sub_8086448(); if(HasRecruitedMon(MONSTER_MEWTWO)) { sub_80866C4(&gMewtwoReFightDialogue_5); @@ -2803,13 +2803,13 @@ void sub_8089C44(void) Entity * EnteiEntity; leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromClientType(0x12); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(EnteiEntity, DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_ENTEI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ENTEI); } @@ -2819,7 +2819,7 @@ void sub_8089C90(void) Entity * EnteiEntity; leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromClientType(0x12); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -2830,7 +2830,7 @@ void sub_8089C90(void) SetFacingDirection(EnteiEntity, DIRECTION_SOUTH); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_ENTEI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ENTEI); } void sub_8089CFC(u8 param_1, u8 param_2) @@ -2847,7 +2847,7 @@ void EnteiPreFightDialogue(void) Entity * EnteiEntity; leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromClientType(0x12); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); EnteiScreenFlash(); DisplayDungeonDialogue(&gEnteiPreFightDialogue_1); EnteiScreenFlash(); @@ -2865,7 +2865,7 @@ void EnteiReFightDialogue(void) Entity * EnteiEntity; leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromClientType(0x12); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); EnteiScreenFlash(); DisplayDungeonDialogue(&gEnteiReFightDialogue_1); EnteiScreenFlash(); @@ -2883,7 +2883,7 @@ void EnteiPostStoryPreFightDialogue(void) Entity * EnteiEntity; leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromClientType(0x12); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); if (HasRecruitedMon(MONSTER_ENTEI)) { sub_80866C4(&gEnteiPostStoryPreFightDialogue_4); } @@ -2932,13 +2932,13 @@ void sub_8089EFC(void) Entity * RaikouEntity; leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromClientType(0x13); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); } @@ -2948,13 +2948,13 @@ void sub_8089F44(void) Entity * RaikouEntity; leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromClientType(0x13); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); } @@ -2964,7 +2964,7 @@ void sub_8089F8C(void) Entity * RaikouEntity; leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromClientType(0x13); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -2975,7 +2975,7 @@ void sub_8089F8C(void) SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); } void sub_8089FF0(u8 param_1, u8 param_2) @@ -2992,7 +2992,7 @@ void RaikouPreFightDialogue(void) Entity * RaikouEntity; leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromClientType(0x13); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); DisplayDungeonDialogue(&gRaikouPreFightDialogue_1); RaikouScreenFlash(); DisplayDungeonDialogue(&gRaikouPreFightDialogue_2); @@ -3017,7 +3017,7 @@ void RaikouReFightDialogue(void) Entity * RaikouEntity; leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromClientType(0x13); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); gDungeon->weather.unkE265 = WEATHER_RAIN; sub_807EAA0(0,1); RaikouScreenFlash(); @@ -3037,7 +3037,7 @@ void RaikouPostStoryPreFightDialogue(void) Entity * RaikouEntity; leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromClientType(0x13); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); if (HasRecruitedMon(MONSTER_RAIKOU)) { sub_80866C4(&gRaikouPostStoryPreFightDialogue_4); } @@ -3087,7 +3087,7 @@ void sub_808A264(void) Entity * SuicuneEntity; leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromClientType(0x14); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -3095,7 +3095,7 @@ void sub_808A264(void) SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); sub_8086A3C(SuicuneEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); } void sub_808A2C0(void) @@ -3104,13 +3104,13 @@ void sub_808A2C0(void) Entity * SuicuneEntity; leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromClientType(0x14); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); } void sub_808A308(void) @@ -3119,7 +3119,7 @@ void sub_808A308(void) Entity * SuicuneEntity; leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromClientType(0x14); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -3130,7 +3130,7 @@ void sub_808A308(void) SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); } void sub_808A36C(u8 param_1, u8 param_2) @@ -3147,7 +3147,7 @@ void SuicunePreFightDialogue(void) Entity * SuicuneEntity; leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromClientType(0x14); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); sub_8086448(); DisplayDungeonDialogue(&gSuicunePreFightDialogue_1); sub_803E708(10,70); @@ -3175,7 +3175,7 @@ void SuicuneReFightDialogue(void) Entity * SuicuneEntity; leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromClientType(0x14); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); DisplayDungeonDialogue(&gSuicuneReFightDialogue_1); SuicuneScreenFlash(); DisplayDungeonDialogue(&gSuicuneReFightDialogue_2); @@ -3192,7 +3192,7 @@ void SuicunePostStoryPreFightDialogue(void) Entity * SuicuneEntity; leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromClientType(0x14); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); if (HasRecruitedMon(MONSTER_SUICUNE)) { sub_80866C4(&gSuicunePostStoryPreFightDialogue_4); } @@ -3262,7 +3262,7 @@ void sub_808A608(void) Entity * HoOhEntity; leaderEntity = xxx_call_GetLeader(); - HoOhEntity = GetEntityFromClientType(0x15); + HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); DungeonStartNewBGM(MUS_FRIEND_AREA_RAINBOW_PEAK); sub_80867F4(); sub_8086838(0,0,0); @@ -3271,7 +3271,7 @@ void sub_808A608(void) SetFacingDirection(HoOhEntity, DIRECTION_SOUTH); sub_8086A3C(HoOhEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -6); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_HO_OH); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_HO_OH); } void sub_808A668(void) @@ -3280,7 +3280,7 @@ void sub_808A668(void) Entity * HoOhEntity; leaderEntity = xxx_call_GetLeader(); - HoOhEntity = GetEntityFromClientType(0x15); + HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); DungeonStartNewBGM(MUS_FRIEND_AREA_RAINBOW_PEAK); sub_80867F4(); sub_8086838(0,0,0); @@ -3294,7 +3294,7 @@ void sub_808A668(void) sub_8086A3C(HoOhEntity); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 6); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_HO_OH); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_HO_OH); } void sub_808A6E8(u8 param_1, u8 param_2) @@ -3317,7 +3317,7 @@ void HoOhPreFightDialogue(void) Position32 local_14; leaderEntity = xxx_call_GetLeader(); - HoOhEntity = GetEntityFromClientType(0x15); + HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); local_14.x = leaderEntity->pixelPos.x; local_14.y = leaderEntity->pixelPos.y + -0x1000; ShiftCameraToPosition(&local_14,0x88); @@ -3356,7 +3356,7 @@ void HoOhReFightDialogue(void) Position32 local_14; leaderEntity = xxx_call_GetLeader(); - HoOhEntity = GetEntityFromClientType(0x15); + HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); local_14.x = leaderEntity->pixelPos.x; local_14.y = leaderEntity->pixelPos.y + -0x1000; @@ -3440,14 +3440,14 @@ void sub_808A9E4(void) Entity * LatiosEntity; leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromClientType(0x16); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); SetFacingDirection(LatiosEntity, DIRECTION_NORTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 4); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); } void sub_808AA3C(void) @@ -3456,14 +3456,14 @@ void sub_808AA3C(void) Entity * LatiosEntity; leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromClientType(0x16); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); SetFacingDirection(LatiosEntity, DIRECTION_NORTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); } void sub_808AA94(void) @@ -3472,14 +3472,14 @@ void sub_808AA94(void) Entity * LatiosEntity; leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromClientType(0x16); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); sub_8068FE0(LatiosEntity,0x21c,0); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); } void sub_808AAF0(u8 param_1, u8 param_2) @@ -3498,7 +3498,7 @@ void LatiosPreFightDialogue(void) Position local_19; leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromClientType(0x16); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); local_18.x = LatiosEntity->pixelPos.x; local_18.y = LatiosEntity->pixelPos.y + (0x80 << 6); @@ -3529,7 +3529,7 @@ void LatiosReFightDialogue(void) Entity * LatiosEntity; leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromClientType(0x16); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); sub_8086448(); sub_808692C(); DisplayDungeonDialogue(&gLatiosReFightDialogue_1); @@ -3575,7 +3575,7 @@ void sub_808ACC0(void) Entity * entity; if (HasRecruitedMon(MONSTER_REGIROCK)) { - entity = GetEntityFromClientType(0x17); + entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGIROCK); sub_8068FE0(entity,0x21c,0); sub_8097FA8(0x22); sub_8097FA8(0x1d); @@ -3593,7 +3593,7 @@ void sub_808ACC0(void) sub_8098044(0x22); sub_8098044(0x1d); sub_80855E4(SetupRegiFacingDirection); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_REGIROCK); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_REGIROCK); } } @@ -3602,7 +3602,7 @@ void sub_808AD48(void) Entity * entity; if (HasRecruitedMon(MONSTER_REGICE)) { - entity = GetEntityFromClientType(0x18); + entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGICE); sub_8068FE0(entity,0x21c,0); sub_8097FA8(0x22); sub_8097FA8(0x1d); @@ -3620,7 +3620,7 @@ void sub_808AD48(void) sub_8098044(0x22); sub_8098044(0x1d); sub_80855E4(SetupRegiFacingDirection); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_REGICE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_REGICE); } } @@ -3630,7 +3630,7 @@ void sub_808ADCC(void) Entity * entity; if (HasRecruitedMon(MONSTER_REGISTEEL)) { - entity = GetEntityFromClientType(0x19); + entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGISTEEL); sub_8068FE0(entity,0x21c,0); sub_8097FA8(0x22); sub_8097FA8(0x1d); @@ -3648,7 +3648,7 @@ void sub_808ADCC(void) sub_8098044(0x22); sub_8098044(0x1d); sub_80855E4(SetupRegiFacingDirection); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_REGISTEEL); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_REGISTEEL); } } @@ -3728,7 +3728,7 @@ void sub_808AFB0(u8 param_1) sub_8052D44(IDStack,leaderEntity,0); if (!sub_8098100(0x22) && (param_1 == 0x2E) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_ROCK_PART) != 0)) { sub_8097FD0(0x1d); - SetMessageArgument(gFormatBuffer_Monsters[0],GetLeader(),0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],GetLeader(),0); // {POKEMON_0} obtained the Rock Part that Regirock was guarding DisplayDungeonDialogue(&gRegirockPostFightDialogue_2); sub_80421C0(0,0xd4); @@ -3746,7 +3746,7 @@ void sub_808B030(u8 param_1) sub_8052D44(IDStack,leaderEntity,0); if (!sub_8098100(0x22) && (param_1 == 0x2F) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_ICE_PART) != 0)) { sub_8097FD0(0x1d); - SetMessageArgument(gFormatBuffer_Monsters[0],GetLeader(),0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],GetLeader(),0); // {POKEMON_0} obtained the Ice Part that Regice was guarding DisplayDungeonDialogue(&gRegicePostFightDialogue_2); sub_80421C0(0,0xd4); @@ -3764,7 +3764,7 @@ void sub_808B0B0(u8 param_1) sub_8052D44(IDStack,leaderEntity,0); if (!sub_8098100(0x22) && (param_1 == 0x30) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_STEEL_PART) != 0)) { sub_8097FD0(0x1d); - SetMessageArgument(gFormatBuffer_Monsters[0], GetLeader(), 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], GetLeader(), 0); // {POKEMON_0} obtained the Steel Part that Registeel was guarding DisplayDungeonDialogue(&gRegisteelPostFightDialogue_2); sub_80421C0(0,0xd4); @@ -3870,7 +3870,7 @@ void sub_808B2F4(void) Entity * jirachiEntity; leaderEntity = xxx_call_GetLeader(); - jirachiEntity = GetEntityFromClientType(0x1a); + jirachiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_JIRACHI); DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST); CreateJirachiWishWarpTile(); sub_8049ED4(); @@ -3880,7 +3880,7 @@ void sub_808B2F4(void) SetFacingDirection(jirachiEntity, DIRECTION_SOUTH); sub_8086A3C(jirachiEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); } void sub_808B35C(void) @@ -3889,7 +3889,7 @@ void sub_808B35C(void) Entity * jirachiEntity; leaderEntity = xxx_call_GetLeader(); - jirachiEntity = GetEntityFromClientType(0x1a); + jirachiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_JIRACHI); DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -3905,7 +3905,7 @@ void sub_808B35C(void) } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); } void sub_808B3E4(u8 param_1, u8 param_2, u8 param_3) @@ -3939,7 +3939,7 @@ void JirachiPreFightDialogue(void) Entity * jirachiEntity; leaderEntity = xxx_call_GetLeader(); - jirachiEntity = GetEntityFromClientType(0x1a); + jirachiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_JIRACHI); sub_8086448(); sub_803E708(0x40,70); DisplayDungeonDialogue(&gJirachiPreFightDialogue_1); @@ -3964,8 +3964,8 @@ void sub_808B50C(void) { Entity * jirachiEntity; - jirachiEntity = GetEntityFromClientType(0x1a); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); + jirachiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_JIRACHI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); sub_80855E4(sub_808BBA8); sub_808BBA8(jirachiEntity); sub_8041888(0); @@ -4005,8 +4005,8 @@ void JirachiWish(void) Position pos2; Position pos3; - jirachiEntity = GetEntityFromClientType(0x1a); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); + jirachiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_JIRACHI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); sub_80855E4(sub_808BBA8); sub_808BBA8(jirachiEntity); sub_8041888(0); @@ -4117,7 +4117,7 @@ void JirachiWish(void) UnlockFriendArea(friendArea); PlaySoundEffect(0xd4); leaderEntity = GetLeader(); - SetMessageArgument(gFormatBuffer_Monsters[0],leaderEntity,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leaderEntity,0); WriteFriendAreaName(gFormatBuffer_Items[0],friendArea,FALSE); // Obtained the friend area! DisplayDungeonDialogue(&gUnknown_8105B68); @@ -4370,7 +4370,7 @@ void sub_808BDEC(void) Entity * lugiaEntity; leaderEntity = xxx_call_GetLeader(); - lugiaEntity = GetEntityFromClientType(0x1b); + lugiaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LUGIA); DungeonStopBGM(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -4384,7 +4384,7 @@ void sub_808BDEC(void) SetFacingDirection(lugiaEntity, DIRECTION_SOUTH); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_LUGIA); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LUGIA); } void sub_808BE70(u8 param_1,u8 param_2,u8 param_3) @@ -4401,7 +4401,7 @@ void LugiaPreFightDialogue(void) Entity * lugiaEntity; leaderEntity = xxx_call_GetLeader(); - lugiaEntity = GetEntityFromClientType(0x1b); + lugiaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LUGIA); if (HasRecruitedMon(MONSTER_LUGIA)) { sub_8086448(); sub_80866C4(&gLugiaPreFightDialogue_8); @@ -4510,7 +4510,7 @@ void sub_808C10C(void) s32 YPos; leaderEntity = xxx_call_GetLeader(); - kyogreEntity = GetEntityFromClientType(0x1c); + kyogreEntity = GetEntityFromMonsterBehavior(BEHAVIOR_KYOGRE); DungeonStopBGM(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -4525,8 +4525,8 @@ void sub_808C10C(void) XPos = GetCameraXPos(); YPos = GetCameraYPos(); sub_803F878(XPos,YPos + -0x1000); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_KYOGRE); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_GROUDON); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_KYOGRE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_GROUDON); } void sub_808C1A4(u8 param_1,u8 param_2,u8 param_3) @@ -4543,7 +4543,7 @@ void KyogrePreFightDialogue(void) Entity *KyogreEntity; leaderEntity = xxx_call_GetLeader(); - KyogreEntity = GetEntityFromClientType(0x1c); + KyogreEntity = GetEntityFromMonsterBehavior(BEHAVIOR_KYOGRE); DungeonStopBGM(); if (HasRecruitedMon(MONSTER_KYOGRE)) { DungeonFadeInNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE,0x3c); @@ -4639,7 +4639,7 @@ void sub_808C3A0(void) sub_808563C(SetupDeoxysFacingDirection); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_DEOXYS_NORMAL); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_DEOXYS_NORMAL); } void sub_808C414(u8 param_1,u8 param_2,u8 param_3) @@ -4733,7 +4733,7 @@ void sub_808C5C0(void) s32 YPos; leaderEntity = xxx_call_GetLeader(); - celebiEntity = GetEntityFromClientType(0x1e); + celebiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_CELEBI); DungeonStartNewBGM(MUS_FRIEND_AREA_HEALING_FOREST); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -4742,7 +4742,7 @@ void sub_808C5C0(void) XPos = GetCameraXPos(); YPos = GetCameraYPos(); sub_803F878(XPos,YPos - 0x1000); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_CELEBI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_CELEBI); } void nullsub_100(u8 r0, u8 r1, u8 r3) @@ -4757,7 +4757,7 @@ void CelebiJoinDialogue(void) Entity *celebiEntity; leaderEntity = xxx_call_GetLeader(); - celebiEntity = GetEntityFromClientType(0x1e); + celebiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_CELEBI); if ((HasRecruitedMon(MONSTER_CELEBI)) || (!sub_806FD18(celebiEntity))) { sub_8068FE0(celebiEntity,0x21c,0); @@ -4937,14 +4937,14 @@ void sub_808C9C4(void) Entity *medichamEntity; leaderEntity = xxx_call_GetLeader(); - medichamEntity = GetEntityFromClientType(7); + medichamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEDICHAM); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); SetFacingDirection(medichamEntity, DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_MEDICHAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_MEDICHAM); } void MedichamRescueDialogue(void) @@ -4952,7 +4952,7 @@ void MedichamRescueDialogue(void) Entity *medichamEntity; s32 counter; - medichamEntity = GetEntityFromClientType(7); + medichamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEDICHAM); SpriteLookAroundEffect(medichamEntity); sub_803E708(0xA, 0x46); // Oh my I can't seem to find a way out... @@ -5005,13 +5005,13 @@ void sub_808CB5C(void) Entity *medichamEntity; leaderEntity = xxx_call_GetLeader(); - medichamEntity = GetEntityFromClientType(7); + medichamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEDICHAM); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_8068FE0(medichamEntity, 0x21C, 0); sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_MEDICHAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_MEDICHAM); } void DummyFightDialogue(void) @@ -5024,14 +5024,14 @@ void sub_808CBB0(void) Entity *smeargleEntity; leaderEntity = xxx_call_GetLeader(); - smeargleEntity = GetEntityFromClientType(0x1F); + smeargleEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SMEARGLE); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); SetFacingDirection(smeargleEntity, DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SMEARGLE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SMEARGLE); } void SmeargleRescueDialogue(void) @@ -5039,7 +5039,7 @@ void SmeargleRescueDialogue(void) Entity *smeargleEntity; s32 counter; - smeargleEntity = GetEntityFromClientType(0x1F); + smeargleEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SMEARGLE); SpriteLookAroundEffect(smeargleEntity); sub_803E708(0xA, 0x46); // Ohhh... @@ -5095,14 +5095,14 @@ void sub_808CD44(void) Entity *smeargleEntity; leaderEntity = xxx_call_GetLeader(); - smeargleEntity = GetEntityFromClientType(0x1F); + smeargleEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SMEARGLE); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); sub_8068FE0(smeargleEntity, 540, 0); sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SMEARGLE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SMEARGLE); } void sub_808CD9C(void) diff --git a/src/dungeon_engine.c b/src/dungeon_engine.c index 572789b5d..75c8a423b 100644 --- a/src/dungeon_engine.c +++ b/src/dungeon_engine.c @@ -182,7 +182,7 @@ static void sub_8044454(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if ((EntityExists(entity)) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) { if (sub_8044B28()) break; TickStatusHeal(entity); @@ -210,7 +210,7 @@ void sub_80444F4(Entity *pokemon) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if ((EntityExists(entity)) && (pokemon != entity) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) { if (sub_8044B28()) break; RunMonsterAI(entity, 0); diff --git a/src/dungeon_items.c b/src/dungeon_items.c index 35f307da5..6ea1ed6c1 100644 --- a/src/dungeon_items.c +++ b/src/dungeon_items.c @@ -149,7 +149,7 @@ void MusicBoxCreation(void) sub_80416E0(&entity->pixelPos,0x10c,FALSE); sub_80421C0(entity,0xd7); sub_803E708(0x3c,0x41); - SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); DisplayDungeonMessage(0,*gUnknown_81053A8,1); sub_803E708(10,0x41); PlaySoundEffect(0xd4); diff --git a/src/dungeon_message.c b/src/dungeon_message.c index 3d331311b..6d3672937 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -120,7 +120,7 @@ void sub_805229C(void) return sub_80526D0(0x50); } -void TryDisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str) +void LogMessageByIdWithPopupCheckUser(Entity *pokemon, const u8 *str) { if (sub_8045888(pokemon)){ DisplayMessageAddToLog(pokemon, str, TRUE); @@ -624,7 +624,7 @@ s32 DisplayDungeonMenuMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const void sub_8052D44(s16 *ids, Entity *leader, Entity *partner) { if (EntityExists(leader)) { - SetMessageArgument(gFormatBuffer_Monsters[0], leader, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], leader, 0); ids[0] = GetEntInfo(leader)->apparentID; } else { @@ -633,7 +633,7 @@ void sub_8052D44(s16 *ids, Entity *leader, Entity *partner) } if (EntityExists(partner)) { - SetMessageArgument(gFormatBuffer_Monsters[1], partner, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], partner, 0); ids[1] = GetEntInfo(partner)->apparentID; } else { diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 5a828de6b..8b4a89317 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -552,7 +552,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move s16 targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); s32 targetFlagsAnd = targetFlags & 0xF; if ((targetFlagsAnd == 0 || targetFlagsAnd == 4 || targetFlagsAnd == 5 || targetFlagsAnd == 2) && !r4) { - SetMessageArgument(gFormatBuffer_Monsters[1], currTarget, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], currTarget, 0); TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FC574); // protected itself! moveHits = FALSE; } @@ -565,7 +565,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move if (moveHits) { if (HasAbility(currTarget, ABILITY_SOUNDPROOF) && IsSoundMove(move)) { - SetMessageArgument(gFormatBuffer_Monsters[1], currTarget, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], currTarget, 0); TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_8100524); // Soundproof suppressed the sound move! moveHits = FALSE; } @@ -1805,18 +1805,18 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 attackerInfo->abilityEffectFlags = 0; attackerInfo->unk159 = 0; if (attackerInfo->volatileStatus.volatileStatus == STATUS_CRINGE) { - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC714); // is cringing! + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC714); // is cringing! return FALSE; } else if (attackerInfo->volatileStatus.volatileStatus == STATUS_INFATUATED) { - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC718); // is infatuated! + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC718); // is infatuated! return FALSE; } else if (attackerInfo->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) { - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6A8); // is paralyzed! + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6A8); // is paralyzed! return FALSE; } @@ -1870,7 +1870,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 else { if (!statusMoveMatch) { sub_80928C0(gFormatBuffer_Items[0], currMove, NULL); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80F93C8); // The move can't be used! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80F93C8); // The move can't be used! moveUsable = FALSE; } } @@ -1885,7 +1885,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 assistMove.id = sub_8057144(attacker); sub_80928C0(gFormatBuffer_Items[0], &assistMove, NULL); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FD2DC); // Assist: + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FD2DC); // Assist: moveWasUsed = TryUseChosenMove(attacker, var_34, itemId, arg_0, isLinkedMove, &assistMove); } else { @@ -1903,10 +1903,10 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 if (unkBefore == gUnknown_202F208) { if (itemId == 0) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC690); // The currMove failed! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC690); // The currMove failed! } else { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6A4); // The Orb failed! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6A4); // The Orb failed! } } } @@ -1935,7 +1935,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 assistMove.id = sub_8057144(attacker); movePtr = &assistMove; sub_80928C0(gFormatBuffer_Items[0], &assistMove, NULL); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FD2DC); // Assist: + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FD2DC); // Assist: } TryUseChosenMove(attacker, 0, itemId, arg_0, isLinkedMove, movePtr); } @@ -1966,48 +1966,48 @@ static void TriggerTargetAbilityEffect(Entity *attacker) EntityInfo *entInfo = GetEntInfo(attacker); if (entInfo->abilityEffectFlags & ABILITY_FLAG_ARENA_TRAP) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEEA4); // Arena Trap prevents movement! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEEA4); // Arena Trap prevents movement! ImmobilizedStatusTarget(attacker, attacker); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_SHADOW_TAG) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEEC8); // Shadow Tag prevents movement! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEEC8); // Shadow Tag prevents movement! ImmobilizedStatusTarget(attacker, attacker); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_MAGNET_PULL) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEEEC); // Magnet Pull prevents movement! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEEEC); // Magnet Pull prevents movement! ImmobilizedStatusTarget(attacker, attacker); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_STATIC) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF0C); // Static caused paralysis! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF0C); // Static caused paralysis! ParalyzeStatusTarget(attacker, attacker, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PRLZ) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF30); // Effect Spore scattered spores + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF30); // Effect Spore scattered spores ParalyzeStatusTarget(attacker, attacker, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_POISON_POINT) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF4C); // Poison Point struck! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF4C); // Poison Point struck! PoisonedStatusTarget(attacker, attacker, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PSN) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF50); // Effect Spore scattered spores! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF50); // Effect Spore scattered spores! PoisonedStatusTarget(attacker, attacker, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_SLP) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF54); // Effect Spore scattered spores! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF54); // Effect Spore scattered spores! sub_8075C58(attacker, attacker, CalculateStatusTurns(attacker, gUnknown_80F4E74, TRUE), TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_FLAME_BODY) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF74); // Flame Body caused a burn! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF74); // Flame Body caused a burn! BurnedStatusTarget(attacker, attacker, TRUE, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_CUTE_CHARM) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF98); // Cute Charm caused infatuation + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF98); // Cute Charm caused infatuation InfatuateStatusTarget(attacker, attacker, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_STENCH) { - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEFD0); // A horrid stench billowed out + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEFD0); // A horrid stench billowed out sub_80428A0(attacker); entInfo->terrifiedTurns = gUnknown_80F5004; } @@ -2096,25 +2096,25 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, } if (GetEntInfo(attacker)->muzzled.muzzled == TRUE && FailsWhileMuzzled(move->id)) { - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage(attacker, msg); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, msg); sub_803E708(0xA, 0x3F); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC710); // is muzzled! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC710); // is muzzled! return FALSE; } else if (!moveUsable) { SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(attacker), 0); if (itemId == 0) { sub_80928C0(gFormatBuffer_Items[0], move, NULL); - TryDisplayDungeonLoggableMessage(attacker, msg); + LogMessageByIdWithPopupCheckUser(attacker, msg); sub_803E708(0xA, 0x3F); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6D0); // But the move couldn't be used! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6D0); // But the move couldn't be used! } else { BufferItemName(gFormatBuffer_Items[0], itemId, NULL); - TryDisplayDungeonLoggableMessage(attacker, msg); + LogMessageByIdWithPopupCheckUser(attacker, msg); sub_803E708(0xA, 0x3F); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6FC); // But Orbs are prevented from being used! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6FC); // But Orbs are prevented from being used! } return FALSE; } @@ -2197,7 +2197,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, if (gUnknown_202F21A != 0) { - SendImmobilizeEndMessage(attacker, attacker); + EndFrozenClassStatus(attacker, attacker); SendLinkedEndMessage(attacker, attacker); } @@ -2842,7 +2842,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov else if (targetFlagsAnd == 0x30) { s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->allPokemon[i]; + Entity *dungeonMon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(dungeonMon) && sub_8045A70(attacker, dungeonMon)) { if (dungeonMon == attacker) { arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, attacker, move, canHitSelf); @@ -2880,7 +2880,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov else if (targetFlagsAnd == 0x60) { s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->allPokemon[i]; + Entity *dungeonMon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(dungeonMon)) { arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, dungeonMon, move, canHitPartner); } @@ -2908,7 +2908,7 @@ static s32 SetNewTarget(s32 targetArrId, Entity **targetsArray, s32 targetFlags_ return targetArrId; if (targetInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER) return targetArrId; - if (targetInfo->clientType == CLIENT_TYPE_DONT_MOVE || targetInfo->clientType == CLIENT_TYPE_CLIENT) + if (targetInfo->monsterBehavior == BEHAVIOR_DIGLETT || targetInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) return targetArrId; if (canHitAnyone) { @@ -3081,7 +3081,7 @@ u32 sub_8057144(Entity * pokemon) nMoves = 0; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->allPokemon[i]; + Entity *dungeonMon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(dungeonMon)) { Move *moves = GetEntInfo(dungeonMon)->moves.moves; for (j = 0; j < MAX_MON_MOVES; j++) diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c index 0c8b51edb..814c08b5b 100644 --- a/src/dungeon_pokemon_attributes.c +++ b/src/dungeon_pokemon_attributes.c @@ -28,7 +28,7 @@ bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage { if (GetEntInfo(target)->protection.protectionStatus == STATUS_SAFEGUARD) { if (displayMessage) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2FC); } return TRUE; @@ -40,7 +40,7 @@ bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage) { if (GetEntInfo(target)->protection.protectionStatus == STATUS_MIST) { if (displayMessage) { - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FC31C); } return TRUE; @@ -48,7 +48,7 @@ bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage) else { if (HasAbility(target, ABILITY_CLEAR_BODY) || HasAbility(target, ABILITY_WHITE_SMOKE)) { if (displayMessage) { - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FCEFC); } return TRUE; @@ -252,7 +252,7 @@ bool8 sub_8071A8C(Entity *pokemon) if(EntityExists(pokemon)) { pokemonInfo = GetEntInfo(pokemon); - if(pokemonInfo->clientType != CLIENT_TYPE_CLIENT) + if(pokemonInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET) { if(!sub_8071A8C_sub(pokemonInfo)) return TRUE; diff --git a/src/dungeon_util.c b/src/dungeon_util.c index 56885cb0b..2999379a1 100644 --- a/src/dungeon_util.c +++ b/src/dungeon_util.c @@ -103,7 +103,7 @@ void sub_804513C(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - gDungeon->allPokemon[index] = NULL; + gDungeon->activeMonsterPtrs[index] = NULL; } for (index = 0; index < DUNGEON_MAX_ITEMS; index++) @@ -132,7 +132,7 @@ void sub_804522C(void) { { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if(EntityExists(entity)) { if(entity == gDungeon->unk181e8.cameraTarget) diff --git a/src/dungeon_util_1.c b/src/dungeon_util_1.c index 423c50056..5398c2c34 100644 --- a/src/dungeon_util_1.c +++ b/src/dungeon_util_1.c @@ -42,7 +42,7 @@ Entity *GetPartnerEntity(void) return entity; } } - return GetEntityFromClientType(CLIENT_TYPE_PARTNER); + return GetEntityFromMonsterBehavior(BEHAVIOR_ALLY); } void sub_80854D4(void) @@ -150,15 +150,15 @@ void sub_808563C(DungeonCallback func) } } -Entity *GetEntityFromClientType(u8 entityType) +Entity *GetEntityFromMonsterBehavior(u8 entityType) { Entity * entity; s32 index; for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; - if ((EntityExists(entity)) && (GetEntInfo(entity)->clientType == entityType)) return entity; + entity = gDungeon->activeMonsterPtrs[index]; + if ((EntityExists(entity)) && (GetEntInfo(entity)->monsterBehavior == entityType)) return entity; } return NULL; } @@ -204,7 +204,7 @@ void sub_8085764(void) for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) { entity = gDungeon->wildPokemon[index]; - if ((EntityExists(entity)) && (GetEntInfo(entity)->clientType == CLIENT_TYPE_PARTNER)) { + if ((EntityExists(entity)) && (GetEntInfo(entity)->monsterBehavior == BEHAVIOR_ALLY)) { sub_8068FE0(entity,0x207,&stackEntity); } } @@ -219,7 +219,7 @@ void sub_80857B8(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); if ((gDungeon->unk4 == 0) && (gDungeon->unk2 == 0)) { @@ -303,7 +303,7 @@ void sub_8085930(s32 direction) entity = gDungeon->wildPokemon[index]; if(EntityExists(entity)) { - if(GetEntInfo(entity)->clientType == CLIENT_TYPE_PARTNER) + if(GetEntInfo(entity)->monsterBehavior == BEHAVIOR_ALLY) { if(direction >= NUM_DIRECTIONS) { @@ -341,49 +341,49 @@ void sub_80859F0(s32 direction) } } -bool8 IsMovingClient(Entity *pokemon) +bool8 ShouldRunMonsterAI(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - switch (pokemonInfo->clientType) + switch (pokemonInfo->monsterBehavior) { - case CLIENT_TYPE_CLIENT: - case 0x3: - case 0x5: - case 0x6: - case 0x7: - case 0x8: - case 0x9: - case 0xD: - case 0xE: - case 0xF: - case 0x10: - case 0x11: - case 0x12: - case 0x13: - case 0x14: - case 0x15: - case 0x16: - case 0x17: - case 0x18: - case 0x19: - case 0x1A: - case 0x1B: - case 0x1C: - case 0x1D: - case 0x1E: - case 0x1F: - case 0x20: - case 0x21: - case 0x22: - case 0x23: - case 0x24: + case BEHAVIOR_RESCUE_TARGET: + case BEHAVIOR_SKARMORY: + case BEHAVIOR_5: + case BEHAVIOR_6: + case BEHAVIOR_MEDICHAM: + case BEHAVIOR_ZAPDOS: + case BEHAVIOR_MOLTRES: + case BEHAVIOR_ARTICUNO: + case BEHAVIOR_GROUDON_2: + case BEHAVIOR_RAYQUAZA: + case BEHAVIOR_16: + case BEHAVIOR_MEWTWO: + case BEHAVIOR_ENTEI: + case BEHAVIOR_RAIKOU: + case BEHAVIOR_SUICUNE: + case BEHAVIOR_HO_OH: + case BEHAVIOR_LATIOS: + case BEHAVIOR_REGIROCK: + case BEHAVIOR_REGICE: + case BEHAVIOR_REGISTEEL: + case BEHAVIOR_JIRACHI: + case BEHAVIOR_LUGIA: + case BEHAVIOR_KYOGRE: + case BEHAVIOR_29: + case BEHAVIOR_CELEBI: + case BEHAVIOR_SMEARGLE: + case BEHAVIOR_32: + case BEHAVIOR_33: + case BEHAVIOR_34: + case BEHAVIOR_35: + case BEHAVIOR_36: return TRUE; - case CLIENT_TYPE_NONE: - case CLIENT_TYPE_PARTNER: - case CLIENT_TYPE_DONT_MOVE: - case 0xA: - case 0xB: - case 0xC: + case BEHAVIOR_FIXED_ENEMY: + case BEHAVIOR_ALLY: + case BEHAVIOR_DIGLETT: + case BEHAVIOR_ALAKAZAM_1: + case BEHAVIOR_GROUDON_1: + case BEHAVIOR_ALAKAZAM_2: default: return FALSE; } diff --git a/src/move_actions.c b/src/move_actions.c index f245bb2a0..6d0994dc4 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -451,8 +451,8 @@ bool8 PainSplitMoveAction(Entity *attacker, Entity *target, Move *move, s32 para if (targetInfo->HP > targetInfo->maxHPStat) { targetInfo->HP = targetInfo->maxHPStat; } - SetMessageArgument(gFormatBuffer_Monsters[0],attacker,0); - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],attacker,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); SetExpMultplier(attackerInfo); // $m0 and $m1 shared their HP @@ -624,7 +624,7 @@ bool8 sub_8057D9C(Entity * pokemon, Entity * target, Move *move, s32 param_4) } } - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); if (flag) { TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD350); } @@ -728,7 +728,7 @@ bool8 sub_8057FF4(Entity *pokemon, Entity *target, Move *move, s32 param_4) if (flashFireStatus != FLASH_FIRE_STATUS_NONE) { if (GetEntInfo(target)->unk152 == 0) { GetEntInfo(target)->unk152 = 1; - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE00); // Fire moves won't become stronger } @@ -780,7 +780,7 @@ bool8 GrudgeMoveAction(Entity *pokemon, Entity * target, Move *move, s32 param_4 hasGrudge = FALSE; entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); if (entityInfo->grudge) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD2B4); } @@ -1409,7 +1409,7 @@ bool8 PsychUpMoveAction(Entity * pokemon, Entity * target, Move * move, u32 para iVar4->offensiveMultipliers[index] = iVar3->offensiveMultipliers[index]; iVar4->defensiveMultipliers[index] = iVar3->defensiveMultipliers[index]; } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD58); // It psyched itself up! SetExpMultplier(iVar4); return TRUE; @@ -2278,8 +2278,8 @@ bool8 sub_805A120(Entity * pokemon,Entity * target, Move *move, u32 param_4) r8 = GetEntInfo(target); sp = r8; - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); if (HasAbility(target, ABILITY_STICKY_HOLD)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE4); return FALSE; @@ -2596,8 +2596,8 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ entityInfo = GetEntInfo(pokemon); targetEntityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); if (HasAbility(target, ABILITY_STICKY_HOLD)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE8); @@ -2646,7 +2646,7 @@ void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, Position *pos) SetEntityPixelPos(&stackEntity,(target->pos.x * 0x18 + 4) * 0x100, (target->pos.y * 0x18 + 4) * 0x100); stackEntity.spawnGenID = 0; - SetMessageArgument(gFormatBuffer_Items[0],&stackEntity,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Items[0],&stackEntity,0); sub_804652C(pokemon,&stackEntity,item,1,0); } @@ -2774,7 +2774,7 @@ bool8 BellyDrumMoveAction(Entity * pokemon,Entity * target, Move *move, u32 para flag = TRUE; } else { - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC5CC); } return flag; @@ -2887,7 +2887,7 @@ bool32 sub_805AD54(Entity * pokemon, Entity * target, Move *move, u32 param_4) && GetTreatmentBetweenMonsters(pokemon,targetEntity,FALSE,FALSE) == TREATMENT_TREAT_AS_ALLY) { EntityInfo *targetInfo = GetEntInfo(targetEntity); - if (targetInfo->clientType != CLIENT_TYPE_CLIENT && !IsClientOrTeamBase(targetInfo->joinedAt.joinedAt)) { + if (targetInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET && !IsClientOrTeamBase(targetInfo->joinedAt.joinedAt)) { sub_807D148(pokemon,targetEntity,2,&target->pos); flag = TRUE; SetExpMultplier(info); diff --git a/src/move_checks.c b/src/move_checks.c index 3089166a5..b6138a831 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -395,7 +395,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) case MOVE_DECOY_MAKER: case MOVE_FOLLOW_ME: case MOVE_SUBSTITUTE: - if (gDungeon->decoyActive) + if (gDungeon->decoyIsActive) { return FALSE; } diff --git a/src/move_effects_target.c b/src/move_effects_target.c index 49857bd97..34a43fb88 100644 --- a/src/move_effects_target.c +++ b/src/move_effects_target.c @@ -226,7 +226,7 @@ void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, u8 displayMessage bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMessage) { if ((!EntityExists(target)) || - ((SetMessageArgument(gFormatBuffer_Monsters[0],target,0), param_3 != 0 && + ((SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0), param_3 != 0 && (HasSafeguardStatus(pokemon,target,displayMessage))))) { return TRUE; } @@ -375,7 +375,7 @@ void SleeplessStatusTarget(Entity * pokemon, Entity * target) if ((entityInfo->sleep.sleep == STATUS_SLEEP) || (entityInfo->sleep.sleep == STATUS_NAPPING) || (entityInfo->sleep.sleep == STATUS_NIGHTMARE)) { isAsleep = TRUE; } - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); if (entityInfo->sleep.sleep != STATUS_SLEEPLESS) { @@ -440,7 +440,7 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa entityInfo = GetEntInfo(target); if (!HasSafeguardStatus(pokemon,target,displayMessage)) { if (HasAbility(target,ABILITY_OBLIVIOUS)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (displayMessage) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC4C); } @@ -731,7 +731,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) return; } - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); entityInfo = GetEntInfo(target); if ((entityInfo->immobilize.immobilizeStatus != STATUS_FROZEN) && !HasSafeguardStatus(pokemon,target,displayMessage)) { @@ -782,10 +782,10 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s16 param_3, bool32 sub_8076CB4(entityInfo->unk9C); } else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->immobilize.immobilizeStatus != STATUS_CONSTRICTION) { entityInfo->immobilize.immobilizeStatus = STATUS_CONSTRICTION; entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E58,TRUE) + 1; @@ -812,10 +812,10 @@ void ImmobilizedStatusTarget(Entity * pokemon, Entity * target) sub_8076CB4(entityInfo->unk9C); } else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->immobilize.immobilizeStatus != STATUS_SHADOW_HOLD) { entityInfo->immobilize.immobilizeStatus = STATUS_SHADOW_HOLD; entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E54,TRUE) + 1; @@ -840,7 +840,7 @@ void IngrainedStatusTarget(Entity * pokemon, Entity * target) if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP || entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { sub_8076CB4(entityInfo->unk9C); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->immobilize.immobilizeStatus != STATUS_INGRAIN) { entityInfo->immobilize.immobilizeStatus = STATUS_INGRAIN; entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E60,TRUE) + 1; @@ -887,7 +887,7 @@ void WrapTarget(Entity * pokemon, Entity * target) targetEntityInfo->unk9C = *piVar3; *piVar3 +=1; nullsub_69(pokemon, target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6D8); sub_806CE94(target,8); goto _08076C98; @@ -895,19 +895,19 @@ void WrapTarget(Entity * pokemon, Entity * target) } } if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAP) { - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); } if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAP) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); } if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAPPED) { - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); } if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); } _08076C98: @@ -922,7 +922,7 @@ void sub_8076CB4(s32 param_1) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); if (entityInfo->unk9C == param_1) { @@ -949,7 +949,7 @@ void PetrifiedStatusTarget(Entity * pokemon, Entity * target) if ((u8)(targetEntityInfo->immobilize.immobilizeStatus - 3U) < 2) { sub_8076CB4(targetEntityInfo->unk9C); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (targetEntityInfo->immobilize.immobilizeStatus != STATUS_PETRIFIED) { targetEntityInfo->immobilize.immobilizeStatus = STATUS_PETRIFIED; if (targetEntityInfo->isTeamLeader) { @@ -1003,19 +1003,19 @@ void LowerAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 de return; } if (HasHeldItem(target, ITEM_TWIST_BAND)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550); } else { if ((!HasAbility(target, ABILITY_HYPER_CUTTER)) || (index != STAT_STAGE_ATK)) goto _08076EE4; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60); } } else { _08076EE4: entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8041F28(target,index); if (decrement == 1) { strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0E4); @@ -1055,7 +1055,7 @@ void LowerDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 d } if (!param_5 || !sub_8071728(pokemon,target,displayMessage)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8041F4C(target,index); if (decrement == 1) { strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0E4); @@ -1088,7 +1088,7 @@ void RaiseAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 in return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8041F70(target,index); if (index != STAT_STAGE_ATK) { strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0C8); @@ -1128,7 +1128,7 @@ void RaiseDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 i return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8041F94(target,index); if (index != STAT_STAGE_DEF) { strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0AC); diff --git a/src/personality_test1.c b/src/personality_test1.c index 499895066..8726a6d4a 100644 --- a/src/personality_test1.c +++ b/src/personality_test1.c @@ -376,7 +376,7 @@ static void PromptNewQuestion(void) static void PrintPersonalityTypeDescription(void) { - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[0], sPersonalityTestTracker->StarterID); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[0], sPersonalityTestTracker->StarterID); CreateDialogueBoxAndPortrait(sPersonalityTypeDescriptionTable[sPersonalityTestTracker->playerNature], 0, 0, 0x101); } diff --git a/src/pokemon.c b/src/pokemon.c index b807570cd..868926230 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -33,7 +33,7 @@ unkStruct_203B45C *GetRecruitedPokemon(void) void InitializeRecruitedPokemon(void) { s32 index; - + for(index = 0; index < NUM_MONSTERS; index++) { gRecruitedPokemonRef->pokemon[index].unk0 = 0; @@ -51,7 +51,7 @@ void InitializeRecruitedPokemon(void) } } -// https://decomp.me/scratch/wQbZB +// https://decomp.me/scratch/wQbZB NAKED void sub_808CE74(s16 species, bool8 isLeader, u8 *name) @@ -140,7 +140,7 @@ void sub_808CE74(s16 species, bool8 isLeader, u8 *name) "\tadd r4, sp, 0x58\n" "\tadds r0, r4, 0\n" "\tadds r1, r7, 0\n" - "\tbl CopyMonsterNametoBuffer\n" + "\tbl CopyMonsterNameToBuffer\n" "\tadd r0, sp, 0x4C\n" "\tadds r1, r4, 0\n" "\tmovs r2, 0xA\n" @@ -228,7 +228,7 @@ void sub_808CE74(s16 species, bool8 isLeader, u8 *name) "_0808CFCC: .4byte gRecruitedPokemonRef"); } -void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID) +void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID) { u8 name_buffer[20]; s32 i; @@ -276,7 +276,7 @@ void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, D if (name == NULL) { // HACK register u8 *buffer asm("r0") = name_buffer; - CopyMonsterNametoBuffer(buffer, species); + CopyMonsterNameToBuffer(buffer, species); BoundedCopyStringtoBuffer(pokemon->name, name_buffer, POKEMON_NAME_LENGTH); } else { @@ -353,6 +353,6 @@ void sub_808D144(PokemonStruct1 *pokemon, struct unkStruct_808D144 *r1) for(i = 0; i < POKEMON_NAME_LENGTH; i++) { pokemon->name[i] = r1->name[i]; - } + } } diff --git a/src/pokemon_mid.c b/src/pokemon_mid.c index 003357e91..ff52568b0 100644 --- a/src/pokemon_mid.c +++ b/src/pokemon_mid.c @@ -269,7 +269,7 @@ bool8 ComparePokemonNames(s16 a1, s16 a2) return FALSE; } -void CopyMonsterNametoBuffer(u8 * buffer, s16 index) +void CopyMonsterNameToBuffer(u8 * buffer, s16 index) { strncpy(buffer, gMonsterParameters[index].species, 0x14); } @@ -397,7 +397,7 @@ u8 GetRegenSpeed(s16 index) return ((u8)(gMonsterParameters[index].regenSpeed) << 25) >> 24; } -bool8 CanMove(s16 index) +bool8 GetCanMoveFlag(s16 index) { return gMonsterParameters[index].canMove; } diff --git a/src/status.c b/src/status.c index 781895657..920d89ec7 100644 --- a/src/status.c +++ b/src/status.c @@ -213,7 +213,7 @@ void UpdateFlashFireBoost(Entity * pokemon, Entity *target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); flashFireBoost = UpdateFlashFireBoost_sub(entityInfo); if (entityInfo->flashFireBoost != flashFireBoost) { entityInfo->flashFireBoost = flashFireBoost; @@ -243,21 +243,21 @@ void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage } if ((HasHeldItem(target,ITEM_TWIST_BAND)) && (param_4 < 0x100)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550); return; } if (HasAbility(target, ABILITY_HYPER_CUTTER) && (statStage == STAT_STAGE_ATK) && (param_4 < 0x100)) { if (displayMessage) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60); } return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); oldMulti = entityInfo->offensiveMultipliers[statStage]; if (param_4 < 0x100) { @@ -308,7 +308,7 @@ void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStag } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); oldMulti = entityInfo->defensiveMultipliers[statStage]; if (param_4 < 0x100) { @@ -345,7 +345,7 @@ void RaiseAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8042040(target,statStage); if (statStage != STAT_STAGE_ACCURACY) { strcpy(gFormatBuffer_Items[0],*gUnknown_80FC090); @@ -379,13 +379,13 @@ void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage, if (HasAbility(target, ABILITY_KEEN_EYE) && (statStage == STAT_STAGE_ACCURACY)){ if(displayMessage) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA64); } } else { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8042060(target,statStage); if (entityInfo->hitChanceStages[statStage] != 0) { entityInfo->hitChanceStages[statStage]--; @@ -407,13 +407,13 @@ void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage) if (EntityExists(target)) { if (!HasSafeguardStatus(pokemon, target, displayMessage)) { if (HasAbility(target, ABILITY_INNER_FOCUS)){ - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if(displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC18); } else { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if(entityInfo->volatileStatus.volatileStatus != STATUS_CRINGE) { entityInfo->volatileStatus.volatileStatus = STATUS_CRINGE; @@ -442,7 +442,7 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) { if (HasAbility(target, ABILITY_LIMBER)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (displayMessage) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBF8); } @@ -451,7 +451,7 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag { bVar6 = TRUE; entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->nonVolatile.nonVolatileStatus != STATUS_PARALYSIS) { entityInfo->nonVolatile.nonVolatileStatus = STATUS_PARALYSIS; entityInfo->nonVolatile.nonVolatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E50,TRUE) + 1; @@ -503,7 +503,7 @@ void RaiseMovementSpeedTarget(Entity * pokemon, Entity * target, s32 turns, bool turns = CalculateStatusTurns(target,gUnknown_80F4E40,FALSE) + 1; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); movSpeed = CalcSpeedStage(target); if (movSpeed == MAX_SPEED_STAGE) { if (displayMessage) @@ -548,7 +548,7 @@ void LowerMovementSpeedTarget(Entity * pokemon, Entity * target, s32 levels, boo return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); movSpeed = CalcSpeedStage(target); if (movSpeed == 0) { if (displayMessage) @@ -591,7 +591,7 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage return; } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (HasHeldItem(target,ITEM_PERSIM_BAND)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD500); @@ -625,7 +625,7 @@ void CowerStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->volatileStatus.volatileStatus != STATUS_COWERING) { entityInfo->volatileStatus.volatileStatus = STATUS_COWERING; entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ECC,TRUE) + 1; @@ -682,7 +682,7 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo EntityUpdateStatusSprites(target); gFormatArgs[0] = HP; gFormatArgs[1] = maxHPStat; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if ((HP == 0) && (maxHPStat == 0)) { if (displayMessage_u8) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB204); // $m0's HP remained unchanged @@ -729,7 +729,7 @@ void HandleScannerOrb(Entity* pokemon, Entity* target) { GetEntInfo(target)->scanning = TRUE; nullsub_75(target); - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEA0); // Item locations became evident sub_803F580(0); sub_8040A84(); @@ -754,7 +754,7 @@ void HandleStairsOrb(Entity* pokemon, Entity* target) { GetEntInfo(target)->stairSpotter = TRUE; nullsub_76(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEC8); sub_803F580(0); sub_8040A84(); @@ -774,7 +774,7 @@ void HandleRadarOrb(Entity* pokemon, Entity* target) { GetEntInfo(target)->powerEars = TRUE; nullsub_77(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAFAC); sub_803F580(0); sub_8040A84(); @@ -800,7 +800,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) if (HasSafeguardStatus(pokemon,target,displayMessage)) { return; } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (MonsterIsType(target, TYPE_GRASS)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrCantLeechSeedMonMessage); @@ -824,7 +824,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) } for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (pokemon == gDungeon->allPokemon[index]) { + if (pokemon == gDungeon->activeMonsterPtrs[index]) { entityInfo->linked.unkD8 = index; entityInfo2 = GetEntInfo(pokemon); entityInfo->linked.unkD4 = entityInfo2->unk98; @@ -847,7 +847,7 @@ void sub_8078084(Entity * pokemon) entityInfo = GetEntInfo(pokemon); for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - target = gDungeon->allPokemon[index]; + target = gDungeon->activeMonsterPtrs[index]; if (EntityExists(target)) { entityInfo2 = GetEntInfo(target); if((u8)(entityInfo2->linked.linkedStatus - 1) <= 1) @@ -873,7 +873,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) if (((EntityExists(target)) && (GetEntityType(pokemon) == ENTITY_MONSTER)) && (GetEntityType(target) == ENTITY_MONSTER)) { entityInfo = GetEntInfo(pokemon); - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); linkedStatus = &entityInfo->linked.linkedStatus; if (entityInfo->linked.linkedStatus != STATUS_DESTINY_BOND) { @@ -893,7 +893,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) } for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (target == gDungeon->allPokemon[index]) { + if (target == gDungeon->activeMonsterPtrs[index]) { entityInfo->linked.unkD8 = index; entityInfo2 = GetEntInfo(target); entityInfo->linked.unkD4 = entityInfo2->unk98; @@ -910,7 +910,7 @@ void SureShotStatusTarget(Entity *pokemon, Entity * target, s32 turns) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->moveStatus.moveStatus != STATUS_SURE_SHOT) { entityInfo->moveStatus.moveStatus = STATUS_SURE_SHOT; entityInfo->moveStatus.moveStatusTurns = turns + 1; @@ -930,7 +930,7 @@ void WhifferStatusTarget(Entity *pokemon, Entity * target, s32 turns) if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->moveStatus.moveStatus != STATUS_WHIFFER) { entityInfo->moveStatus.moveStatus = STATUS_WHIFFER; entityInfo->moveStatus.moveStatusTurns = turns + 1; @@ -950,7 +950,7 @@ void FixedDamageStatusTarget(Entity *pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->moveStatus.moveStatus != STATUS_SET_DAMAGE) { entityInfo->moveStatus.moveStatus = STATUS_SET_DAMAGE; entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC4, FALSE) + 1; @@ -970,7 +970,7 @@ void FocusEnergyStatusTarget(Entity *pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->moveStatus.moveStatus != STATUS_FOCUS_ENERGY) { entityInfo->moveStatus.moveStatus = STATUS_FOCUS_ENERGY; entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC8, FALSE) + 1; @@ -995,14 +995,14 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { targetEntityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (targetEntityInfo->waitingStruct.waitingStatus == STATUS_DECOY) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB994); } else { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if ((((EntityExists(entity)) && (target != entity)) && (u8)(GetEntInfo(entity)->waitingStruct.waitingStatus - 2U) < 2)) { SendWaitingEndMessage(pokemon,entity,STATUS_NONE); @@ -1010,22 +1010,22 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) } } sub_8041D38(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (targetEntityInfo->waitingStruct.waitingStatus != STATUS_NONE) { SendWaitingEndMessage(pokemon,target, STATUS_DECOY); } targetEntityInfo->waitingStruct.waitingStatus = STATUS_DECOY; - targetEntityInfo->waitingStruct.enemyDecoy = GetEntInfo(pokemon)->isNotTeamMember; + targetEntityInfo->waitingStruct.decoyApplierNonTeamMemberFlag = GetEntInfo(pokemon)->isNotTeamMember; targetEntityInfo->waitingStruct.unkCA = param_3; targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED0,TRUE) + 1; targetEntityInfo->waitingStruct.curseDamageCountdown = 0; sub_806CCB4(target,sub_806CEBC(target)); - gDungeon->decoyActive = TRUE; + gDungeon->decoyIsActive = TRUE; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB978); for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity2 = gDungeon->allPokemon[index]; + entity2 = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity2)) { entityInfo = GetEntInfo(entity2); entityInfo->aiTarget.aiObjective = AI_STAND_STILL; @@ -1033,7 +1033,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) entityInfo->aiTarget.aiTargetSpawnGenID = 0; if (!entityInfo->isTeamLeader) { action = entityInfo->action; - MoveIfPossible(entity2, TRUE); + AIMovement(entity2, TRUE); entityInfo->action = action; } } @@ -1070,7 +1070,7 @@ void CurseStatusTarget(Entity *pokemon, Entity * target) targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EA4,TRUE) + 1; targetEntityInfo->waitingStruct.curseDamageCountdown = 0; } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB004); } else { @@ -1094,7 +1094,7 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if ((EntityExists(entity)) && (GetEntInfo(entity)->waitingStruct.waitingStatus == STATUS_SNATCH)) { SendWaitingEndMessage(pokemon, entity, STATUS_NONE); } @@ -1110,7 +1110,7 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target) gDungeon->snatchPokemon = target; gDungeon->unk17B3C = targetEntityInfo->unk98; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB01C); EntityUpdateStatusSprites(target); } @@ -1122,7 +1122,7 @@ void TauntStatusTarget(Entity * pokemon, Entity * target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->volatileStatus.volatileStatus != STATUS_TAUNTED) { entityInfo->volatileStatus.volatileStatus = STATUS_TAUNTED; entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED8,TRUE) + 1; @@ -1142,7 +1142,7 @@ void HandleStockpile(Entity * pokemon, Entity * target) if ((EntityExists(target))) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->stockpileStage < MAX_STOCKPILE_STAGE) { entityInfo->stockpileStage++; sub_804178C(1); @@ -1166,7 +1166,7 @@ void InvisibleStatusTarget(Entity * pokemon, Entity * target) if (targetEntityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) { SendTransformEndMessage(pokemon,target); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (targetEntityInfo->transformStatus.transformStatus != STATUS_INVISIBLE) { targetEntityInfo->transformStatus.transformStatus = STATUS_INVISIBLE; targetEntityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EE4,FALSE) + 1; @@ -1187,7 +1187,7 @@ void PerishSongTarget(Entity * pokemon, Entity * target) if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) { nullsub_82(target); entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->perishSongTurns == 0) { entityInfo->perishSongTurns = CalculateStatusTurns(target,gUnknown_80F4EEC,FALSE) + 1; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB04); @@ -1213,11 +1213,11 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target) if ((EntityInfo->moves.moves[index].moveFlags & MOVE_FLAG_EXISTS) && (movePtr->moveFlags & MOVE_FLAG_LAST_USED)) break; } if ((index == MAX_MON_MOVES) && ((EntityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBBD4); } else { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (EntityInfo->volatileStatus.volatileStatus != STATUS_ENCORE) { EntityInfo->volatileStatus.volatileStatus = STATUS_ENCORE; EntityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EF4,TRUE) + 1; @@ -1247,7 +1247,7 @@ void sub_8078A58(Entity *pokemon, Entity *target, s32 param_3, s32 param_4) bellyBefore = targetInfo->maxBelly; targetInfo->maxBelly = FixedPoint_Subtract(bellyBefore, sp0); targetInfo->belly = FixedPoint_Min(targetInfo->belly, targetInfo->maxBelly); - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); if (FixedPointToInt(bellyBefore) != FixedPointToInt(targetInfo->maxBelly)) { sub_8041D9C(target); @@ -1261,7 +1261,7 @@ void sub_8078A58(Entity *pokemon, Entity *target, s32 param_3, s32 param_4) bellyBefore = targetInfo->belly; targetInfo->belly = FixedPoint_Subtract(bellyBefore, sp8); - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); if (FixedPointToInt(bellyBefore) != FixedPointToInt(targetInfo->belly)) { nullsub_84(target); @@ -1323,12 +1323,12 @@ void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBel TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBE64); // $m0's belly filled up full! } if (FixedPointToInt(sp_0x20) == FixedPointToInt(targetInfo->maxBelly)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBDF0); // $m0's belly won't get any bigger! } else { sub_8041DB0(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBDC4); // m0's max belly size increased! } } @@ -1345,7 +1345,7 @@ void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBel *bellyPtr = *puVar8; } nullsub_85(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (FixedPointToInt(oldBelly) == FixedPointToInt(*bellyPtr)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBE14); // $m0's belly didn't change! } diff --git a/src/status_actions.c b/src/status_actions.c index 03f4418f8..b43d8805f 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -226,7 +226,7 @@ bool8 HandleColorChange(Entity * pokemon, Entity * target) entityInfo->types[0] = newType; entityInfo->types[1] = TYPE_NONE; entityInfo->isColorChanged = TRUE; - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); typeString = GetUnformattedTypeString(newType); strcpy(gFormatBuffer_Items[0], typeString); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEB08); @@ -439,7 +439,7 @@ bool8 MimicMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4 } } } - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); if (moveCounter != 0) { SetExpMultplier(entityInfo); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCE4); @@ -697,8 +697,8 @@ bool8 sub_805BA50(Entity * pokemon, Entity * target, Move *move, s32 param_4) iVar3 = GetEntInfo(pokemon); iVar5 = GetEntInfo(target); iVar6 = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); if (HasAbility(target, ABILITY_STICKY_HOLD)) { return TRUE; } @@ -858,8 +858,8 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_ entityInfo = GetEntInfo(target); targetID = entityInfo->id; oldID = entityInfo->id; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->clientType != CLIENT_TYPE_NONE) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->monsterBehavior != BEHAVIOR_FIXED_ENEMY) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450); return FALSE; } @@ -883,7 +883,7 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_ } } else { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450); } return didTransfer; @@ -921,7 +921,7 @@ bool8 sub_805BEC8(Entity * pokemon, Entity * target, Move *move, s32 param_4) bool8 EscapeOrbAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); if (gDungeon->unk66E != 0) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD4DC); // $m0 can't escape! } @@ -952,7 +952,7 @@ bool8 TrapbustOrbAction(Entity * pokemon,Entity * target, Move *move, s32 param_ bool8 foundTrap = FALSE; tile = GetTileAtEntitySafe(target); if (IsBossFight()) { - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD1EC); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD1EC); return FALSE; } else @@ -1105,7 +1105,7 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4) filledInTile = FALSE; targetInfo = GetEntInfo(target); if (IsBossFight()) { - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD0B8); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD0B8); return FALSE; } else @@ -1156,7 +1156,7 @@ bool8 sub_805C3F8(Entity *pokemon, Entity *target, Move *move, s32 param_4) Item stack; Position posStruct = target->pos; - if(GetEntInfo(target)->clientType != CLIENT_TYPE_NONE) + if(GetEntInfo(target)->monsterBehavior != BEHAVIOR_FIXED_ENEMY) { TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FF678); return FALSE; diff --git a/src/status_checks.c b/src/status_checks.c index e7643e2f6..43b6893b7 100644 --- a/src/status_checks.c +++ b/src/status_checks.c @@ -24,10 +24,10 @@ extern const char *gPtrInfatuatedMessage[]; extern u8 *gUnknown_80F95EC[]; extern char *gPtrMoveInterruptedMessage[]; -bool8 HasStatusAffectingActions(Entity *pokemon) +bool8 HasStatusThatPreventsActing(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); switch (pokemonInfo->sleep.sleep) { @@ -39,13 +39,13 @@ bool8 HasStatusAffectingActions(Entity *pokemon) switch (pokemonInfo->immobilize.immobilizeStatus) { case STATUS_FROZEN: - TryDisplayDungeonLoggableMessage(pokemon, *gPtrFrozenMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrFrozenMessage); return TRUE; case STATUS_WRAP: - TryDisplayDungeonLoggableMessage(pokemon, *gPtrWrappedAroundMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrWrappedAroundMessage); return TRUE; case STATUS_WRAPPED: - TryDisplayDungeonLoggableMessage(pokemon, *gPtrWrappedByMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrWrappedByMessage); return TRUE; case STATUS_PETRIFIED: return TRUE; @@ -53,15 +53,15 @@ bool8 HasStatusAffectingActions(Entity *pokemon) switch (pokemonInfo->volatileStatus.volatileStatus) { case STATUS_PAUSED: - TryDisplayDungeonLoggableMessage(pokemon, *gPtrPausedMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrPausedMessage); return TRUE; case STATUS_INFATUATED: - TryDisplayDungeonLoggableMessage(pokemon, *gPtrInfatuatedMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrInfatuatedMessage); return TRUE; } if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) { - TryDisplayDungeonLoggableMessage(pokemon, *gPtrBideMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrBideMessage); return TRUE; } if (pokemonInfo->waitingStruct.waitingStatus == STATUS_DECOY) @@ -93,7 +93,7 @@ bool8 HasStatusAffectingActions(Entity *pokemon) SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); return TRUE; } - DecideAttack(pokemon); + ChooseAIMove(pokemon); return TRUE; } if (pokemonInfo->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED) @@ -117,27 +117,27 @@ bool8 sub_80701A4(Entity *pokemon) pokemonInfo = GetEntInfo(pokemon); flag = FALSE; - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); switch(pokemonInfo->sleep.sleep) { case STATUS_SLEEP: case STATUS_NIGHTMARE: case STATUS_NAPPING: - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80F95EC); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80F95EC); return TRUE; } switch(pokemonInfo->immobilize.immobilizeStatus) { case STATUS_FROZEN: - TryDisplayDungeonLoggableMessage(pokemon,*gPtrFrozenMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrFrozenMessage); return TRUE; case STATUS_WRAP: - TryDisplayDungeonLoggableMessage(pokemon,*gPtrWrappedAroundMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrWrappedAroundMessage); return TRUE; case STATUS_WRAPPED: - TryDisplayDungeonLoggableMessage(pokemon,*gPtrWrappedByMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrWrappedByMessage); return TRUE; case STATUS_PETRIFIED: return TRUE; @@ -148,10 +148,10 @@ bool8 sub_80701A4(Entity *pokemon) flag = TRUE; goto _0807026C; case STATUS_PAUSED: - TryDisplayDungeonLoggableMessage(pokemon,*gPtrPausedMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrPausedMessage); return TRUE; case STATUS_INFATUATED: - TryDisplayDungeonLoggableMessage(pokemon,*gPtrInfatuatedMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrInfatuatedMessage); return TRUE; default: case STATUS_NONE: @@ -159,12 +159,12 @@ bool8 sub_80701A4(Entity *pokemon) case 8: _0807026C: if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) { - TryDisplayDungeonLoggableMessage(pokemon,*gPtrBideMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrBideMessage); return TRUE; } else if (((pokemonInfo->charging.chargingStatus != STATUS_NONE) && (pokemonInfo->charging.chargingStatus != STATUS_CHARGING)) && (pokemonInfo->charging.chargingStatus != STATUS_ENRAGED)) { if (flag) { - TryDisplayDungeonLoggableMessage(pokemon,*gPtrMoveInterruptedMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrMoveInterruptedMessage); } else { for(index = 0, move = pokemonInfo->moves.moves; index < MAX_MON_MOVES; move++, index++) { diff --git a/src/status_checks_1.c b/src/status_checks_1.c index 7cfe3022a..89efecdce 100644 --- a/src/status_checks_1.c +++ b/src/status_checks_1.c @@ -44,7 +44,7 @@ s32 sub_8070828(Entity *pokemon, bool8 displayMessage) } if (displayMessage && SetVisualFlags(GetEntInfo(pokemon), 0x40, flag)) { sub_80429B4(pokemon); - TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FEE80); + LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FEE80); } if (flag) { return 2; @@ -72,7 +72,7 @@ void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum) else { if (param_2->isNotTeamMember) { - if ((param_2->joinedAt.joinedAt == 0x4A) || (param_2->clientType == CLIENT_TYPE_CLIENT)) { + if ((param_2->joinedAt.joinedAt == 0x4A) || (param_2->monsterBehavior == BEHAVIOR_RESCUE_TARGET)) { CopyYellowMonsterNametoBuffer(buffer, param_2->apparentID); } else @@ -116,7 +116,7 @@ void sub_80709C8(u8 *buffer, EntityInfo *entityInfo) else { if (entityInfo->isNotTeamMember) { - CopyMonsterNametoBuffer(buffer, entityInfo->apparentID); + CopyMonsterNameToBuffer(buffer, entityInfo->apparentID); } else { diff --git a/src/tile_types.c b/src/tile_types.c index a0277f8fd..a4ff0bd23 100644 --- a/src/tile_types.c +++ b/src/tile_types.c @@ -94,7 +94,7 @@ bool8 PosHasItem(Position *pos) { struct Tile *tile; Entity *entity; - + tile = GetTile(pos->x,pos->y); entity = tile->object; if ((entity != NULL) && (GetEntityType(entity) == ENTITY_ITEM)) { @@ -107,7 +107,7 @@ Entity *GetMonsterAtPos(Position *pos) { struct Tile *tile; Entity *entity; - + tile = GetTile(pos->x,pos->y); entity = tile->monster; if ((entity != NULL) && (entity->type == ENTITY_MONSTER)) { @@ -124,7 +124,7 @@ bool8 sub_804AD34(Position *pos) s32 y; bool8 iVar8; s32 index; - + iVar8 = 0; tile = GetTileSafe(pos->x,pos->y); if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) @@ -145,7 +145,7 @@ bool8 sub_804AD34(Position *pos) if (iVar8 != 0) { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { sub_806CF98(entity); } @@ -162,7 +162,7 @@ bool8 sub_804AE08(Position *pos) s32 x; s32 y; bool8 uVar6; - + uVar6 = FALSE; tile = GetTileSafe(pos->x,pos->y); @@ -190,7 +190,7 @@ void sub_804AE84(Position *pos) Entity * entity; s32 index; s32 y; - + tile = GetTileSafe(pos->x,pos->y); if ((tile->unk4 & 0x10) != 0) { tile->unk4 = tile->unk4 & 0xffef; @@ -206,7 +206,7 @@ void sub_804AE84(Position *pos) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { sub_806CF98(entity); } diff --git a/src/trap.c b/src/trap.c index 54f96b19e..897b9714d 100644 --- a/src/trap.c +++ b/src/trap.c @@ -280,10 +280,10 @@ void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4) sub_8049ED4(); sub_804225C(pokemon,pos,trapData->id); if (gDungeon->unk181e8.blinded) { - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD7F4); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD7F4); } else { - TryDisplayDungeonLoggableMessage(pokemon,(gUnknown_80FD7F8)[trapData->id]); + LogMessageByIdWithPopupCheckUser(pokemon,(gUnknown_80FD7F8)[trapData->id]); } } if (target != NULL) { @@ -539,7 +539,7 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile) flag = FALSE; if (target != NULL) { if (IsBossFight()) { - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FED0C); // But nothing happened... + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FED0C); // But nothing happened... } else { @@ -559,11 +559,11 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile) gDungeon->unk2 = 2; return; } - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80F9728); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80F9728); } else { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (info->isNotTeamMember) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F970C); // $m0 fell into the pitfall! } @@ -620,11 +620,11 @@ void HandleSummonTrap(Entity *pokemon,Position *pos) sub_80421EC(pos,0x194); if (pokemonSummonCount == 0) { _ret: - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FED04); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FED04); } else { - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FED00); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FED00); } } } diff --git a/src/trap_1.c b/src/trap_1.c index 4f0357931..1d0fb49d4 100644 --- a/src/trap_1.c +++ b/src/trap_1.c @@ -238,7 +238,7 @@ void sub_8080CF0(unkStruct_8094924 *param_1) sub_80830B4(param_1,gDungeon->plusIsActive[1]); sub_80830B4(param_1,gDungeon->minusIsActive[0]); sub_80830B4(param_1,gDungeon->minusIsActive[1]); - sub_80830B4(param_1,gDungeon->decoyActive); + sub_80830B4(param_1,gDungeon->decoyIsActive); sub_80830B4(param_1,gDungeon->unk37FD); sub_80830B4(param_1,gDungeon->deoxysDefeat); sub_80830B4(param_1,gDungeon->unk37FF); @@ -391,7 +391,7 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) puStack_2c = &info->perishSongTurns; puStack_28 = &info->unkFE; puStack_24 = &info->unkFF; - puStack_90 = &info->clientType; + puStack_90 = &info->monsterBehavior; pos = info->prevPos; for(counter = 0; counter < NUM_PREV_POS; counter++) @@ -435,7 +435,7 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) sub_8083060(param_1,*puStack_2c); sub_8083060(param_1,*puStack_28); sub_808183C(param_1,*puStack_24); - sub_8081854(param_1,info->targetingDecoy); + sub_8081854(param_1,info->decoyAITracker); SaveSpeedStage(param_1,info->speedStage); SaveSpeedCounters(param_1,info->speedUpCounters,NUM_SPEED_COUNTERS); SaveSpeedCounters(param_1,info->speedDownCounters,NUM_SPEED_COUNTERS); @@ -445,7 +445,7 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) SaveEntityMoves(param_1,&info->moves); sub_8081B34(param_1,(s16 *)&info->belly); sub_8081B34(param_1,(s16 *)&info->maxBelly); - sub_80830B4(param_1,info->aiNextToTarget); + sub_80830B4(param_1,info->aiAllySkip); sub_80830B4(param_1,info->recalculateFollow); sub_80830B4(param_1,info->waiting); sub_80830B4(param_1,info->unk146); @@ -690,7 +690,7 @@ void SaveProtectionStatus(unkStruct_8094924 *param_1, Protection *param_2) void SaveWaitingStatus(unkStruct_8094924 *param_1, Waiting *param_2) { sub_8082FA8(param_1, ¶m_2->waitingStatus, 1); - sub_80830B4(param_1, param_2->enemyDecoy); + sub_80830B4(param_1, param_2->decoyApplierNonTeamMemberFlag); sub_80830B4(param_1, param_2->unkCA); sub_8083060(param_1, param_2->waitingStatusTurns); sub_8083060(param_1, param_2->curseDamageCountdown); @@ -984,7 +984,7 @@ void sub_808217C(unkStruct_8094924 *param_1) gDungeon->plusIsActive[1] = sub_80831DC(param_1); gDungeon->minusIsActive[0] = sub_80831DC(param_1); gDungeon->minusIsActive[1] = sub_80831DC(param_1); - gDungeon->decoyActive = sub_80831DC(param_1); + gDungeon->decoyIsActive = sub_80831DC(param_1); gDungeon->unk37FD = sub_80831DC(param_1); gDungeon->deoxysDefeat = sub_80831DC(param_1); gDungeon->unk37FF = sub_80831DC(param_1); From de1e9dcb0828e8dd68baced5b00c90d7d4e2ee65 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:13:01 -0500 Subject: [PATCH 31/48] Clean common strings and personality test 1 --- include/common_strings.h | 2 +- include/constants/common_strings_hints.h | 10 +- .../common_strings_kangaskhan_storage.h | 6 +- include/constants/personality_test.h | 5 +- ld_script.txt | 6 + src/code_80450F8.c | 2 +- src/code_80972F4.c | 4 +- src/common_strings.c | 358 ++- src/data/code_80140DC.h | 22 +- src/data/code_80227B8.h | 4 +- src/data/common_strings_felicity_bank.h | 224 -- src/data/common_strings_gulpin_shop.h | 457 ---- src/data/common_strings_hints.h | 67 - src/data/common_strings_kangaskhan_storage.h | 276 --- src/data/common_strings_kecleon_bros.h | 656 ------ src/data/common_strings_makuhita_dojo.h | 202 -- src/data/common_strings_wigglytuff_shop.h | 320 --- src/data/debug_menu1.h | 35 +- src/data/friend_rescue_menus.h | 369 ++- src/data/ground_main.h | 4 +- src/data/locale/felicity_bank_usa.h | 157 ++ src/data/locale/gulpin_shop_usa.h | 352 +++ src/data/locale/hints_usa.h | 60 + src/data/locale/kangaskhan_storage_usa.h | 189 ++ src/data/locale/kecleon_bros_usa.h | 470 ++++ src/data/locale/makuhita_dojo_usa.h | 155 ++ src/data/locale/personality_test1_usa.h | 769 ++++++ src/data/locale/wigglytuff_shop_usa.h | 246 ++ src/data/main_menu2.h | 268 +-- src/data/other_menus1.h | 262 +-- src/data/personality_test1.h | 2064 ++++++----------- src/data/post_office_guide1.h | 69 +- src/data/story_missions.h | 125 +- src/data/trade_items_menu.h | 32 +- src/data/wonder_mail_1.h | 104 +- src/data/wonder_mail_main_menu.h | 36 +- src/debug_menu1.c | 1 + src/debug_unused1.c | 2 + src/debug_unused2.c | 2 + src/debug_unused3.c | 2 + src/debug_unused4.c | 2 + src/debug_unused5.c | 2 + src/debug_unused6.c | 2 + src/hints_menu1.c | 2 +- src/kangaskhan_storage1.c | 6 +- src/personality_test1.c | 2 +- 46 files changed, 3966 insertions(+), 4444 deletions(-) delete mode 100644 src/data/common_strings_felicity_bank.h delete mode 100644 src/data/common_strings_gulpin_shop.h delete mode 100644 src/data/common_strings_hints.h delete mode 100644 src/data/common_strings_kangaskhan_storage.h delete mode 100644 src/data/common_strings_kecleon_bros.h delete mode 100644 src/data/common_strings_makuhita_dojo.h delete mode 100644 src/data/common_strings_wigglytuff_shop.h create mode 100644 src/data/locale/felicity_bank_usa.h create mode 100644 src/data/locale/gulpin_shop_usa.h create mode 100644 src/data/locale/hints_usa.h create mode 100644 src/data/locale/kangaskhan_storage_usa.h create mode 100644 src/data/locale/kecleon_bros_usa.h create mode 100644 src/data/locale/makuhita_dojo_usa.h create mode 100644 src/data/locale/personality_test1_usa.h create mode 100644 src/data/locale/wigglytuff_shop_usa.h create mode 100644 src/debug_unused1.c create mode 100644 src/debug_unused2.c create mode 100644 src/debug_unused3.c create mode 100644 src/debug_unused4.c create mode 100644 src/debug_unused5.c create mode 100644 src/debug_unused6.c diff --git a/include/common_strings.h b/include/common_strings.h index 3c6e34f29..8022d3201 100644 --- a/include/common_strings.h +++ b/include/common_strings.h @@ -33,6 +33,6 @@ extern const u8* const gCommonKecleonBros[KECLEON_BROS_MODE_COUNT][KECLEON_DLG_M extern const u8* const gCommonWigglytuff[WIGGLYTUFF_SHOP_MODE_COUNT][WIGGLY_DLG_MAX]; extern const u8* const gCommonGulpin[GULPIN_SHOP_MODE_DIALOGUE_COUNT][GULPIN_DLG_MAX]; extern const u8* const gCommonMakuhita[MAKUHITA_DOJO_MODE_COUNT][MAKUHITA_DLG_MAX]; -extern const Hints gCommonHints[NUM_HINTS]; +extern const Hints gCommonHints[HINT_MAX]; #endif // GUARD_COMMON_STRINGS_H \ No newline at end of file diff --git a/include/constants/common_strings_hints.h b/include/constants/common_strings_hints.h index 7e319f47f..f4eb50bad 100644 --- a/include/constants/common_strings_hints.h +++ b/include/constants/common_strings_hints.h @@ -8,6 +8,14 @@ typedef struct Hints const u8 *body; } Hints; -#define NUM_HINTS 5 +enum HintKind +{ + HINT_TOWN_CONTROLS_1, + HINT_TOWN_CONTROLS_2, + HINT_SAVING, + HINT_ADVENTURES_WITH_FRIENDS, + HINT_BUILDING_A_TEAM, + HINT_MAX +}; #endif // GUARD_COMMON_STRINGS_HINTS_H \ No newline at end of file diff --git a/include/constants/common_strings_kangaskhan_storage.h b/include/constants/common_strings_kangaskhan_storage.h index d286b406e..a09b69436 100644 --- a/include/constants/common_strings_kangaskhan_storage.h +++ b/include/constants/common_strings_kangaskhan_storage.h @@ -24,9 +24,9 @@ enum KangaskhanStorageDialogue KANG_DLG_WITHDRAW_CONFIRMATION, KANG_DLG_YOU_HAVE_NOTHING, KANG_DLG_YOU_ARE_FULL, - KANG_DLG_STORAGE_HAS_NOTHING, - KANG_DLG_DEPOSIT__INVALID_ITEM, - KANG_DLG_DEPOSIT__TOO_MANY_OF_ITEM, + KANG_DLG_STORAGE_EMPTY, + KANG_DLG_DEPOSIT_INVALID_ITEM, + KANG_DLG_DEPOSIT_TOO_MANY_OF_ITEM, KANG_DLG_STORAGE_FULL, KANG_DLG_HOW_IT_WORKS, KANG_DLG_MAX diff --git a/include/constants/personality_test.h b/include/constants/personality_test.h index 0bd9f6025..56129599a 100644 --- a/include/constants/personality_test.h +++ b/include/constants/personality_test.h @@ -17,15 +17,14 @@ enum NaturePersonalities LONELY, QUIRKY, MISC, - }; #define NUM_PARTNERS 10 #define NUM_QUIZ_QUESTIONS 55 #define MAX_ASKED_QUESTIONS 8 #define NUM_PERSONALITIES MISC -#define NUM_PERSONALITY_TEST_EFFECTS (NUM_PERSONALITIES+3) +#define NUM_PERSONALITY_TEST_EFFECTS (NUM_PERSONALITIES + 3) #define BRAVE_2B_TRIGGER 99 -#endif // GUARD_CONSTANTS_PERSONALITY_TEST_H +#endif // GUARD_CONSTANTS_PERSONALITY_TEST_H \ No newline at end of file diff --git a/ld_script.txt b/ld_script.txt index 33ff81de7..cfc2ea804 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -523,6 +523,12 @@ SECTIONS { src/load_screen.o(.rodata); src/wonder_mail_main_menu.o(.rodata); src/debug_menu1.o(.rodata); + src/debug_unused1.o(.rodata); + src/debug_unused2.o(.rodata); + src/debug_unused3.o(.rodata); + src/debug_unused4.o(.rodata); + src/debug_unused5.o(.rodata); + src/debug_unused6.o(.rodata); src/debug_menu2.o(.rodata); src/debug_menu3.o(.rodata); src/debug_menu4.o(.rodata); diff --git a/src/code_80450F8.c b/src/code_80450F8.c index 88ad322bc..ce3f400d1 100644 --- a/src/code_80450F8.c +++ b/src/code_80450F8.c @@ -270,7 +270,7 @@ Entity *sub_80453AC(s16 id) s32 r9; s32 timer; // sp0 - id = a; + id = a; // SpeciesId() ? r9 = -1; r6 = GetBodySize(id); diff --git a/src/code_80972F4.c b/src/code_80972F4.c index 149fb4e6e..7765d413b 100644 --- a/src/code_80972F4.c +++ b/src/code_80972F4.c @@ -125,7 +125,7 @@ void sub_8097418(s16 index,bool32 param_2) bool8 param_2_u8 = param_2; if (index_s32 != 0xd) { if ((param_2_u8) && (SetScriptVarArrayValue(NULL,RESCUE_SCENARIO_JOB_LIST,index_s32,0), index_s32 < 0x1f)) { - const MissionText *mt = &gStoryMissionText[index_s32]; + const MissionText *mt = &sStoryMissionText[index_s32]; if (mt->unk4 != 0xFF) { sub_8097FA8(mt->unk4); } @@ -169,7 +169,7 @@ const u8 *GetCurrentMissionText(s16 index) { if(index < 0x1F) { - const MissionText *mt = &gStoryMissionText[index]; + const MissionText *mt = &sStoryMissionText[index]; return mt->text; } else diff --git a/src/common_strings.c b/src/common_strings.c index f31059c59..0c88c5ac0 100644 --- a/src/common_strings.c +++ b/src/common_strings.c @@ -2,7 +2,22 @@ #include "globaldata.h" #include "common_strings.h" -// Probably had many entries per ptr because of languages, but USA release is english-only. Check other roms +// The structure of this file seems to be completely different in the EU version. +// Not sure about the JP version though - Kermalis + +#define REGION_USA TRUE // For now + +#if REGION_USA + +#include "data/locale/felicity_bank_usa.h" +#include "data/locale/gulpin_shop_usa.h" +#include "data/locale/hints_usa.h" +#include "data/locale/kangaskhan_storage_usa.h" +#include "data/locale/kecleon_bros_usa.h" +#include "data/locale/makuhita_dojo_usa.h" +#include "data/locale/wigglytuff_shop_usa.h" + +#endif ALIGNED(4) static const u8 sYes0[] = _("Yes"); ALIGNED(4) const u8* const gCommonYes[] = { sYes0 }; @@ -55,10 +70,337 @@ ALIGNED(4) const u8* const gCommonDepositPrompt[] = { sDepositPrompt0 }; ALIGNED(4) static const u8 sWithdrawPrompt0[] = _("Withdraw?"); ALIGNED(4) const u8* const gCommonWithdrawPrompt[] = { sWithdrawPrompt0 }; -#include "data/common_strings_felicity_bank.h" -#include "data/common_strings_kangaskhan_storage.h" -#include "data/common_strings_kecleon_bros.h" -#include "data/common_strings_wigglytuff_shop.h" -#include "data/common_strings_gulpin_shop.h" -#include "data/common_strings_makuhita_dojo.h" -#include "data/common_strings_hints.h" \ No newline at end of file + + +ALIGNED(4) const u8* const gCommonFelicity[FEL_MODE_COUNT][FEL_DLG_MAX] = +{ + [FEL_MODE_AWAKE] = { + [FEL_DLG_WELCOME] = FEL_AWAKE_WELCOME, + [FEL_DLG_HOW_MAY_I_SERVE__NO_MONEY] = FEL_AWAKE_HOW_MAY_I_SERVE__NO_MONEY, + [FEL_DLG_HOW_MAY_I_SERVE__HAS_MONEY] = FEL_AWAKE_HOW_MAY_I_SERVE__HAS_MONEY, + [FEL_DLG_VERY_WELL] = FEL_AWAKE_VERY_WELL, + [FEL_DLG_BYE__NO_MONEY] = FEL_AWAKE_BYE__NO_MONEY, + [FEL_DLG_BYE__HAS_MONEY] = FEL_AWAKE_BYE__HAS_MONEY, + [FEL_DLG_DEPOSIT__HOW_MUCH] = FEL_AWAKE_DEPOSIT__HOW_MUCH, + [FEL_DLG_DEPOSIT__NO_MONEY] = FEL_AWAKE_DEPOSIT__NO_MONEY, + [FEL_DLG_DEPOSIT__BANK_FULL] = FEL_AWAKE_DEPOSIT__BANK_FULL, + [FEL_DLG_DEPOSIT__RECEIPT] = FEL_AWAKE_DEPOSIT__RECEIPT, + [FEL_DLG_WITHDRAW__HOW_MUCH] = FEL_AWAKE_WITHDRAW__HOW_MUCH, + [FEL_DLG_WITHDRAW__NO_MONEY] = FEL_AWAKE_WITHDRAW__NO_MONEY, + [FEL_DLG_WITHDRAW__WALLET_FULL] = FEL_AWAKE_WITHDRAW__WALLET_FULL, + [FEL_DLG_WITHDRAW__RECEIPT] = FEL_AWAKE_WITHDRAW__RECEIPT, + [FEL_DLG_HOW_IT_WORKS] = FEL_AWAKE_HOW_IT_WORKS + }, + [FEL_MODE_ASLEEP] = { + [FEL_DLG_WELCOME] = FEL_ASLEEP_WELCOME, + [FEL_DLG_HOW_MAY_I_SERVE__NO_MONEY] = FEL_ASLEEP_HOW_MAY_I_SERVE__NO_MONEY, + [FEL_DLG_HOW_MAY_I_SERVE__HAS_MONEY] = FEL_ASLEEP_HOW_MAY_I_SERVE__HAS_MONEY, + [FEL_DLG_VERY_WELL] = FEL_ASLEEP_VERY_WELL, + [FEL_DLG_BYE__NO_MONEY] = FEL_ASLEEP_BYE__NO_MONEY, + [FEL_DLG_BYE__HAS_MONEY] = FEL_ASLEP_BYE__HAS_MONEY, + [FEL_DLG_DEPOSIT__HOW_MUCH] = FEL_ASLEEP_DEPOSIT__HOW_MUCH, + [FEL_DLG_DEPOSIT__NO_MONEY] = FEL_ASLEEP_DEPOSIT__NO_MONEY, + [FEL_DLG_DEPOSIT__BANK_FULL] = FEL_ASLEEP_DEPOSIT__BANK_FULL, + [FEL_DLG_DEPOSIT__RECEIPT] = FEL_ASLEEP_DEPOSIT__RECEIPT, + [FEL_DLG_WITHDRAW__HOW_MUCH] = FEL_ASLEEP_WITHDRAW__HOW_MUCH, + [FEL_DLG_WITHDRAW__NO_MONEY] = FEL_ASLEEP_WITHDRAW__NO_MONEY, + [FEL_DLG_WITHDRAW__WALLET_FULL] = FEL_ASLEEP_WITHDRAW__WALLET_FULL, + [FEL_DLG_WITHDRAW__RECEIPT] = FEL_ASLEEP_WITHDRAW__RECEIPT, + [FEL_DLG_HOW_IT_WORKS] = FEL_ASLEEP_HOW_IT_WORKS + } +}; + +ALIGNED(4) const u8* const gCommonKangStorage[KANG_MODE_COUNT][KANG_DLG_MAX] = +{ + [KANG_MODE_AWAKE] = { + [KANG_DLG_WELCOME] = KANG_AWAKE_WELCOME, + [KANG_DLG_ANYTHING_ELSE] = KANG_AWAKE_ANYTHING_ELSE, + [KANG_DLG_BYE] = KANG_AWAKE_BYE, + [KANG_DLG_STORE_WHAT] = KANG_AWAKE_STORE_WHAT, + [KANG_DLG_STORE_MORE] = KANG_AWAKE_STORE_MORE, + [KANG_DLG_DEPOSIT_ONE_PROMPT] = KANG_AWAKE_DEPOSIT_ONE_PROMPT, + [KANG_DLG_DEPOSIT_MANY_PROMPT] = KANG_AWAKE_DEPOSIT_MANY_PROMPT, + [KANG_DLG_DEPOSIT_CONFIRMATION] = KANG_AWAKE_DEPOSIT_CONFIRMATION, + [KANG_DLG_TAKE_WHAT] = KANG_AWAKE_TAKE_WHAT, + [KANG_DLG_TAKE_MORE] = KANG_AWAKE_TAKE_MORE, + [KANG_DLG_WITHDRAW_ONE_PROMPT] = KANG_AWAKE_WITHDRAW_ONE_PROMPT, + [KANG_DLG_WITHDRAW_MANY_PROMPT] = KANG_AWAKE_WITHDRAW_MANY_PROMPT, + [KANG_DLG_WITHDRAW_CONFIRMATION] = KANG_AWAKE_WITHDRAW_CONFIRMATION, + [KANG_DLG_YOU_HAVE_NOTHING] = KANG_AWAKE_YOU_HAVE_NOTHING, + [KANG_DLG_YOU_ARE_FULL] = KANG_AWAKE_YOU_ARE_FULL, + [KANG_DLG_STORAGE_EMPTY] = KANG_AWAKE_STORAGE_HAS_NOTHING, + [KANG_DLG_DEPOSIT_INVALID_ITEM] = KANG_AWAKE_DEPOSIT_INVALID_ITEM, + [KANG_DLG_DEPOSIT_TOO_MANY_OF_ITEM] = KANG_AWAKE_DEPOSIT_TOO_MANY_OF_ITEM, + [KANG_DLG_STORAGE_FULL] = KANG_AWAKE_STORAGE_FULL, + [KANG_DLG_HOW_IT_WORKS] = KANG_AWAKE_HOW_IT_WORKS + }, + [KANG_MODE_ASLEEP] = { + [KANG_DLG_WELCOME] = KANG_ASLEEP_WELCOME, + [KANG_DLG_ANYTHING_ELSE] = KANG_ASLEEP_ANYTHING_ELSE, + [KANG_DLG_BYE] = KANG_ASLEEP_BYE, + [KANG_DLG_STORE_WHAT] = KANG_ASLEEP_STORE_WHAT, + [KANG_DLG_STORE_MORE] = KANG_ASLEEP_STORE_MORE, + [KANG_DLG_DEPOSIT_ONE_PROMPT] = KANG_ASLEEP_DEPOSIT_ONE_PROMPT, + [KANG_DLG_DEPOSIT_MANY_PROMPT] = KANG_ASLEEP_DEPOSIT_MANY_PROMPT, + [KANG_DLG_DEPOSIT_CONFIRMATION] = KANG_ASLEEP_DEPOSIT_CONFIRMATION, + [KANG_DLG_TAKE_WHAT] = KANG_ASLEEP_TAKE_WHAT, + [KANG_DLG_TAKE_MORE] = KANG_ASLEEP_TAKE_MORE, + [KANG_DLG_WITHDRAW_ONE_PROMPT] = KANG_ASLEEP_WITHDRAW_ONE_PROMPT, + [KANG_DLG_WITHDRAW_MANY_PROMPT] = KANG_ASLEEP_WITHDRAW_MANY_PROMPT, + [KANG_DLG_WITHDRAW_CONFIRMATION] = KANG_ASLEEP_WITHDRAW_CONFIRMATION, + [KANG_DLG_YOU_HAVE_NOTHING] = KANG_ASLEEP_YOU_HAVE_NOTHING, + [KANG_DLG_YOU_ARE_FULL] = KANG_ASLEEP_YOU_ARE_FULL, + [KANG_DLG_STORAGE_EMPTY] = KANG_ASLEEP_STORAGE_EMPTY, + [KANG_DLG_DEPOSIT_INVALID_ITEM] = KANG_ASLEEP_DEPOSIT_INVALID_ITEM, + [KANG_DLG_DEPOSIT_TOO_MANY_OF_ITEM] = KANG_ASLEEP_DEPOSIT_TOO_MANY_OF_ITEM, + [KANG_DLG_STORAGE_FULL] = KANG_ASLEEP_STORAGE_FULL, + [KANG_DLG_HOW_IT_WORKS] = KANG_ASLEEP_HOW_IT_WORKS + } +}; + +ALIGNED(4) const u8* const gCommonKecleonBros[KECLEON_BROS_MODE_COUNT][KECLEON_DLG_MAX] = +{ + [KECLEON_BROS_MODE_ITEMS_AWAKE] = { + [KECLEON_DLG_00] = KEC_ITEMS_AWAKE_DLG_00, + [KECLEON_DLG_01] = KEC_ITEMS_AWAKE_DLG_01, + [KECLEON_DLG_02] = KEC_ITEMS_AWAKE_DLG_02, + [KECLEON_DLG_03] = KEC_ITEMS_AWAKE_DLG_03, + [KECLEON_DLG_04] = KEC_ITEMS_AWAKE_DLG_04, + [KECLEON_DLG_05] = KEC_ITEMS_AWAKE_DLG_05, + [KECLEON_DLG_06] = KEC_ITEMS_AWAKE_DLG_06, + [KECLEON_DLG_07] = KEC_ITEMS_AWAKE_DLG_07, + [KECLEON_DLG_08] = KEC_ITEMS_AWAKE_DLG_08, + [KECLEON_DLG_09] = KEC_ITEMS_AWAKE_DLG_09, + [KECLEON_DLG_10] = KEC_ITEMS_AWAKE_DLG_10, + [KECLEON_DLG_11] = KEC_ITEMS_AWAKE_DLG_11, + [KECLEON_DLG_12] = KEC_ITEMS_AWAKE_DLG_12, + [KECLEON_DLG_13] = KEC_ITEMS_AWAKE_DLG_13, + [KECLEON_DLG_14] = KEC_ITEMS_AWAKE_DLG_14, + [KECLEON_DLG_15] = KEC_ITEMS_AWAKE_DLG_15, + [KECLEON_DLG_16] = KEC_ITEMS_AWAKE_DLG_16, + [KECLEON_DLG_17] = KEC_ITEMS_AWAKE_DLG_17, + [KECLEON_DLG_18] = KEC_ITEMS_AWAKE_DLG_18, + [KECLEON_DLG_19] = KEC_ITEMS_AWAKE_DLG_19, + [KECLEON_DLG_20] = KEC_ITEMS_AWAKE_DLG_20, + [KECLEON_DLG_21] = KEC_ITEMS_AWAKE_DLG_21, + [KECLEON_DLG_22] = KEC_ITEMS_AWAKE_DLG_22 + }, + [KECLEON_BROS_MODE_ITEMS_ASLEEP] = { + [KECLEON_DLG_00] = KEC_ITEMS_ASLEEP_DLG_00, + [KECLEON_DLG_01] = KEC_ITEMS_ASLEEP_DLG_01, + [KECLEON_DLG_02] = KEC_ITEMS_ASLEEP_DLG_02, + [KECLEON_DLG_03] = KEC_ITEMS_ASLEEP_DLG_03, + [KECLEON_DLG_04] = KEC_ITEMS_ASLEEP_DLG_04, + [KECLEON_DLG_05] = KEC_ITEMS_ASLEEP_DLG_05, + [KECLEON_DLG_06] = KEC_ITEMS_ASLEEP_DLG_06, + [KECLEON_DLG_07] = KEC_ITEMS_ASLEEP_DLG_07, + [KECLEON_DLG_08] = KEC_ITEMS_ASLEEP_DLG_08, + [KECLEON_DLG_09] = KEC_ITEMS_ASLEEP_DLG_09, + [KECLEON_DLG_10] = KEC_ITEMS_ASLEEP_DLG_10, + [KECLEON_DLG_11] = KEC_ITEMS_ASLEEP_DLG_11, + [KECLEON_DLG_12] = KEC_ITEMS_ASLEEP_DLG_12, + [KECLEON_DLG_13] = KEC_ITEMS_ASLEEP_DLG_13, + [KECLEON_DLG_14] = KEC_ITEMS_ASLEEP_DLG_14, + [KECLEON_DLG_15] = KEC_ITEMS_ASLEEP_DLG_15, + [KECLEON_DLG_16] = KEC_ITEMS_ASLEEP_DLG_16, + [KECLEON_DLG_17] = KEC_ITEMS_ASLEEP_DLG_17, + [KECLEON_DLG_18] = KEC_ITEMS_ASLEEP_DLG_18, + [KECLEON_DLG_19] = KEC_ITEMS_ASLEEP_DLG_19, + [KECLEON_DLG_20] = KEC_ITEMS_ASLEEP_DLG_20, + [KECLEON_DLG_21] = KEC_ITEMS_ASLEEP_DLG_21, + [KECLEON_DLG_22] = KEC_ITEMS_ASLEEP_DLG_22 + }, + [KECLEON_BROS_MODE_WARES_AWAKE] = { + [KECLEON_DLG_00] = KEC_WARES_AWAKE_DLG_00, + [KECLEON_DLG_01] = KEC_WARES_AWAKE_DLG_01, + [KECLEON_DLG_02] = KEC_WARES_AWAKE_DLG_02, + [KECLEON_DLG_03] = KEC_WARES_AWAKE_DLG_03, + [KECLEON_DLG_04] = KEC_WARES_AWAKE_DLG_04, + [KECLEON_DLG_05] = KEC_WARES_AWAKE_DLG_05, + [KECLEON_DLG_06] = KEC_WARES_AWAKE_DLG_06, + [KECLEON_DLG_07] = KEC_WARES_AWAKE_DLG_07, + [KECLEON_DLG_08] = KEC_WARES_AWAKE_DLG_08, + [KECLEON_DLG_09] = KEC_WARES_AWAKE_DLG_09, + [KECLEON_DLG_10] = KEC_WARES_AWAKE_DLG_10, + [KECLEON_DLG_11] = KEC_WARES_AWAKE_DLG_11, + [KECLEON_DLG_12] = KEC_WARES_AWAKE_DLG_12, + [KECLEON_DLG_13] = KEC_WARES_AWAKE_DLG_13, + [KECLEON_DLG_14] = KEC_WARES_AWAKE_DLG_14, + [KECLEON_DLG_15] = KEC_WARES_AWAKE_DLG_15, + [KECLEON_DLG_16] = KEC_WARES_AWAKE_DLG_16, + [KECLEON_DLG_17] = KEC_WARES_AWAKE_DLG_17, + [KECLEON_DLG_18] = KEC_WARES_AWAKE_DLG_18, + [KECLEON_DLG_19] = KEC_WARES_AWAKE_DLG_19, + [KECLEON_DLG_20] = KEC_WARES_AWAKE_DLG_20, + [KECLEON_DLG_21] = KEC_WARES_AWAKE_DLG_21, + [KECLEON_DLG_22] = KEC_WARES_AWAKE_DLG_22 + }, + [KECLEON_BROS_MODE_WARES_ASLEEP] = { + [KECLEON_DLG_00] = KEC_WARES_ASLEEP_DLG_00, + [KECLEON_DLG_01] = KEC_WARES_ASLEEP_DLG_01, + [KECLEON_DLG_02] = KEC_WARES_ASLEEP_DLG_02, + [KECLEON_DLG_03] = KEC_WARES_ASLEEP_DLG_03, + [KECLEON_DLG_04] = KEC_WARES_ASLEEP_DLG_04, + [KECLEON_DLG_05] = KEC_WARES_ASLEEP_DLG_05, + [KECLEON_DLG_06] = KEC_WARES_ASLEEP_DLG_06, + [KECLEON_DLG_07] = KEC_WARES_ASLEEP_DLG_07, + [KECLEON_DLG_08] = KEC_WARES_ASLEEP_DLG_08, + [KECLEON_DLG_09] = KEC_WARES_ASLEEP_DLG_09, + [KECLEON_DLG_10] = KEC_WARES_ASLEEP_DLG_10, + [KECLEON_DLG_11] = KEC_WARES_ASLEEP_DLG_11, + [KECLEON_DLG_12] = KEC_WARES_ASLEEP_DLG_12, + [KECLEON_DLG_13] = KEC_WARES_ASLEEP_DLG_13, + [KECLEON_DLG_14] = KEC_WARES_ASLEEP_DLG_14, + [KECLEON_DLG_15] = KEC_WARES_ASLEEP_DLG_15, + [KECLEON_DLG_16] = KEC_WARES_ASLEEP_DLG_16, + [KECLEON_DLG_17] = KEC_WARES_ASLEEP_DLG_17, + [KECLEON_DLG_18] = KEC_WARES_ASLEEP_DLG_18, + [KECLEON_DLG_19] = KEC_WARES_ASLEEP_DLG_19, + [KECLEON_DLG_20] = KEC_WARES_ASLEEP_DLG_20, + [KECLEON_DLG_21] = KEC_WARES_ASLEEP_DLG_21, + [KECLEON_DLG_22] = KEC_WARES_ASLEEP_DLG_22 + } +}; + +ALIGNED(4) const u8* const gCommonWigglytuff[WIGGLYTUFF_SHOP_MODE_COUNT][WIGGLY_DLG_MAX] = +{ + [WIGGLYTUFF_SHOP_MODE_AWAKE] = { + [WIGGLY_DLG_00] = WIGGLY_AWAKE_DLG_00, + [WIGGLY_DLG_01] = WIGGLY_AWAKE_DLG_01, + [WIGGLY_DLG_02] = WIGGLY_AWAKE_DLG_02, + [WIGGLY_DLG_03] = WIGGLY_AWAKE_DLG_03, + [WIGGLY_DLG_04] = WIGGLY_AWAKE_DLG_04, + [WIGGLY_DLG_05] = WIGGLY_AWAKE_DLG_05, + [WIGGLY_DLG_06] = WIGGLY_AWAKE_DLG_06, + [WIGGLY_DLG_07] = WIGGLY_AWAKE_DLG_07, + [WIGGLY_DLG_08] = WIGGLY_AWAKE_DLG_08, + [WIGGLY_DLG_09] = WIGGLY_AWAKE_DLG_09, + [WIGGLY_DLG_10] = WIGGLY_AWAKE_DLG_10, + [WIGGLY_DLG_11] = WIGGLY_AWAKE_DLG_11, + [WIGGLY_DLG_12] = WIGGLY_AWAKE_DLG_12, + [WIGGLY_DLG_13] = WIGGLY_AWAKE_DLG_13, + [WIGGLY_DLG_14] = WIGGLY_AWAKE_DLG_14, + [WIGGLY_DLG_15] = WIGGLY_AWAKE_DLG_15, + [WIGGLY_DLG_16] = WIGGLY_AWAKE_DLG_16, + [WIGGLY_DLG_17] = WIGGLY_AWAKE_DLG_17, + [WIGGLY_DLG_18] = WIGGLY_AWAKE_DLG_18, + [WIGGLY_DLG_19] = WIGGLY_AWAKE_DLG_19 + }, + [WIGGLYTUFF_SHOP_MODE_ASLEEP] = { + [WIGGLY_DLG_00] = WIGGLY_ASLEEP_DLG_00, + [WIGGLY_DLG_01] = WIGGLY_ASLEEP_DLG_01, + [WIGGLY_DLG_02] = WIGGLY_ASLEEP_DLG_02, + [WIGGLY_DLG_03] = WIGGLY_ASLEEP_DLG_03, + [WIGGLY_DLG_04] = WIGGLY_ASLEEP_DLG_04, + [WIGGLY_DLG_05] = WIGGLY_ASLEEP_DLG_05, + [WIGGLY_DLG_06] = WIGGLY_ASLEEP_DLG_06, + [WIGGLY_DLG_07] = WIGGLY_ASLEEP_DLG_07, + [WIGGLY_DLG_08] = WIGGLY_ASLEEP_DLG_08, + [WIGGLY_DLG_09] = WIGGLY_ASLEEP_DLG_09, + [WIGGLY_DLG_10] = WIGGLY_ASLEEP_DLG_10, + [WIGGLY_DLG_11] = WIGGLY_ASLEEP_DLG_11, + [WIGGLY_DLG_12] = WIGGLY_ASLEEP_DLG_12, + [WIGGLY_DLG_13] = WIGGLY_ASLEEP_DLG_13, + [WIGGLY_DLG_14] = WIGGLY_ASLEEP_DLG_14, + [WIGGLY_DLG_15] = WIGGLY_ASLEEP_DLG_15, + [WIGGLY_DLG_16] = WIGGLY_ASLEEP_DLG_16, + [WIGGLY_DLG_17] = WIGGLY_ASLEEP_DLG_17, + [WIGGLY_DLG_18] = WIGGLY_ASLEEP_DLG_18, + [WIGGLY_DLG_19] = WIGGLY_ASLEEP_DLG_19 + } +}; + +ALIGNED(4) const u8* const gCommonGulpin[GULPIN_SHOP_MODE_DIALOGUE_COUNT][GULPIN_DLG_MAX] = +{ + [GULPIN_SHOP_MODE_AWAKE] = { + [GULPIN_DLG_00] = GULP_AWAKE_DLG_00, + [GULPIN_DLG_01] = GULP_AWAKE_DLG_01, + [GULPIN_DLG_02] = GULP_AWAKE_DLG_02, + [GULPIN_DLG_03] = GULP_AWAKE_DLG_03, + [GULPIN_DLG_04] = GULP_AWAKE_DLG_04, + [GULPIN_DLG_05] = GULP_AWAKE_DLG_05, + [GULPIN_DLG_06] = GULP_AWAKE_DLG_06, + [GULPIN_DLG_07] = GULP_AWAKE_DLG_07, + [GULPIN_DLG_08] = GULP_AWAKE_DLG_08, + [GULPIN_DLG_09] = GULP_AWAKE_DLG_09, + [GULPIN_DLG_10] = GULP_AWAKE_DLG_10, + [GULPIN_DLG_11] = GULP_AWAKE_DLG_11, + [GULPIN_DLG_12] = GULP_AWAKE_DLG_12, + [GULPIN_DLG_13] = GULP_AWAKE_DLG_13, + [GULPIN_DLG_14] = GULP_AWAKE_DLG_14, + [GULPIN_DLG_15] = GULP_AWAKE_DLG_15, + [GULPIN_DLG_16] = GULP_AWAKE_DLG_16, + [GULPIN_DLG_17] = GULP_AWAKE_DLG_17, + [GULPIN_DLG_18] = GULP_AWAKE_DLG_18, + [GULPIN_DLG_19] = GULP_AWAKE_DLG_19, + [GULPIN_DLG_20] = GULP_AWAKE_DLG_20, + [GULPIN_DLG_21] = GULP_AWAKE_DLG_21, + [GULPIN_DLG_22] = GULP_AWAKE_DLG_22, + [GULPIN_DLG_23] = GULP_AWAKE_DLG_23, + [GULPIN_DLG_24] = GULP_AWAKE_DLG_24 + }, + [GULPIN_SHOP_MODE_ASLEEP] = { + [GULPIN_DLG_00] = GULP_ASLEEP_DLG_00, + [GULPIN_DLG_01] = GULP_ASLEEP_DLG_01, + [GULPIN_DLG_02] = GULP_ASLEEP_DLG_02, + [GULPIN_DLG_03] = GULP_ASLEEP_DLG_03, + [GULPIN_DLG_04] = GULP_ASLEEP_DLG_04, + [GULPIN_DLG_05] = GULP_ASLEEP_DLG_05, + [GULPIN_DLG_06] = GULP_ASLEEP_DLG_06, + [GULPIN_DLG_07] = GULP_ASLEEP_DLG_07, + [GULPIN_DLG_08] = GULP_ASLEEP_DLG_08, + [GULPIN_DLG_09] = GULP_ASLEEP_DLG_09, + [GULPIN_DLG_10] = GULP_ASLEEP_DLG_10, + [GULPIN_DLG_11] = GULP_ASLEEP_DLG_11, + [GULPIN_DLG_12] = GULP_ASLEEP_DLG_12, + [GULPIN_DLG_13] = GULP_ASLEEP_DLG_13, + [GULPIN_DLG_14] = GULP_ASLEEP_DLG_14, + [GULPIN_DLG_15] = GULP_ASLEEP_DLG_15, + [GULPIN_DLG_16] = GULP_ASLEEP_DLG_16, + [GULPIN_DLG_17] = GULP_ASLEEP_DLG_17, + [GULPIN_DLG_18] = GULP_ASLEEP_DLG_18, + [GULPIN_DLG_19] = GULP_ASLEEP_DLG_19, + [GULPIN_DLG_20] = GULP_ASLEEP_DLG_20, + [GULPIN_DLG_21] = GULP_ASLEEP_DLG_21, + [GULPIN_DLG_22] = GULP_ASLEEP_DLG_22, + [GULPIN_DLG_23] = GULP_ASLEEP_DLG_23, + [GULPIN_DLG_24] = GULP_ASLEEP_DLG_24 + } +}; + +ALIGNED(4) const u8* const gCommonMakuhita[MAKUHITA_DOJO_MODE_COUNT][MAKUHITA_DLG_MAX] = +{ + [MAKUHITA_DOJO_MODE_AWAKE] = { + [MAKUHITA_DLG_0] = MAKU_AWAKE_DLG_0, + [MAKUHITA_DLG_1] = MAKU_AWAKE_DLG_1, + [MAKUHITA_DLG_2] = MAKU_AWAKE_DLG_2, + [MAKUHITA_DLG_3] = MAKU_AWAKE_DLG_3, + [MAKUHITA_DLG_4] = MAKU_AWAKE_DLG_4, + [MAKUHITA_DLG_5] = MAKU_AWAKE_DLG_5, + [MAKUHITA_DLG_6] = MAKU_AWAKE_DLG_6, + [MAKUHITA_DLG_7] = MAKU_AWAKE_DLG_7, + [MAKUHITA_DLG_8] = MAKU_AWAKE_DLG_8, + [MAKUHITA_DLG_9] = MAKU_AWAKE_DLG_9 + }, + [MAKUHITA_DOJO_MODE_ASLEEP] = { + [MAKUHITA_DLG_0] = MAKU_ASLEEP_DLG_0, + [MAKUHITA_DLG_1] = MAKU_ASLEEP_DLG_1, + [MAKUHITA_DLG_2] = MAKU_ASLEEP_DLG_2, + [MAKUHITA_DLG_3] = MAKU_ASLEEP_DLG_3, + [MAKUHITA_DLG_4] = MAKU_ASLEEP_DLG_4, + [MAKUHITA_DLG_5] = MAKU_ASLEEP_DLG_5, + [MAKUHITA_DLG_6] = MAKU_ASLEEP_DLG_6, + [MAKUHITA_DLG_7] = MAKU_ASLEEP_DLG_7, + [MAKUHITA_DLG_8] = MAKU_ASLEEP_DLG_8, + [MAKUHITA_DLG_9] = MAKU_ASLEEP_DLG_9 + } +}; + +ALIGNED(4) const Hints gCommonHints[HINT_MAX] = +{ + [HINT_TOWN_CONTROLS_1] = {HINTHEADING_TOWN_CONTROLS_1, HINTBODY_TOWN_CONTROLS_1}, + [HINT_TOWN_CONTROLS_2] = {HINTHEADING_TOWN_CONTROLS_2, HINTBODY_TOWN_CONTROLS_2}, + [HINT_SAVING] = {HINTHEADING_SAVING, HINTBODY_SAVING}, + [HINT_ADVENTURES_WITH_FRIENDS] = {HINTHEADING_ADVENTURES_WITH_FRIENDS, HINTBODY_ADVENTURES_WITH_FRIENDS}, + [HINT_BUILDING_A_TEAM] = {HINTHEADING_BUILDING_A_TEAM, HINTBODY_BUILDING_A_TEAM} +}; \ No newline at end of file diff --git a/src/data/code_80140DC.h b/src/data/code_80140DC.h index 7d06ba8b1..a19639132 100644 --- a/src/data/code_80140DC.h +++ b/src/data/code_80140DC.h @@ -1,25 +1,13 @@ -const u8 Yes_80D4878[]; -const u8 No_80D4874[]; - const MenuItem gUnknown_80D485C[] = { - {Yes_80D4878, 1}, - {No_80D4874, 0}, + {_("*Yes"), 1}, + {_("No"), 0}, {NULL, -1} }; -ALIGNED(4) const u8 No_80D4874[] = "No"; -ALIGNED(4) const u8 Yes_80D4878[] = "*Yes"; - -const u8 Yes_80D489C[]; -const u8 No_80D4898[]; - const MenuItem gUnknown_80D4880[] = { - {Yes_80D489C, 1}, - {No_80D4898, 0}, + {_("Yes"), 1}, + {_("*No"), 0}, {NULL, -1} -}; - -ALIGNED(4) const u8 No_80D4898[] = "*No"; -ALIGNED(4) const u8 Yes_80D489C[] = "Yes"; +}; \ No newline at end of file diff --git a/src/data/code_80227B8.h b/src/data/code_80227B8.h index 7098910af..f2709ada2 100644 --- a/src/data/code_80227B8.h +++ b/src/data/code_80227B8.h @@ -1,7 +1,7 @@ static const MenuItem sUnknown_80DC584[3] = { - {"Yes", 2}, - {"No", 3}, + {_("Yes"), 2}, + {_("No"), 3}, {NULL, 1}, }; diff --git a/src/data/common_strings_felicity_bank.h b/src/data/common_strings_felicity_bank.h deleted file mode 100644 index bcf5f8fc0..000000000 --- a/src/data/common_strings_felicity_bank.h +++ /dev/null @@ -1,224 +0,0 @@ -// TODO: The strings are in reverse-order if you insert them in-line with the array creation. -// Our preprocessor doesn't ALIGNED(4) for _("") strings. It does ALIGNED(1). This is why we do it this way for now until that's fixed - -static const u8 sUnknown_80D4A58[]; -static const u8 sUnknown_80D4C14[]; -static const u8 sUnknown_80D4C50[]; -static const u8 sUnknown_80D4CC0[]; -static const u8 sUnknown_80D4D20[]; -static const u8 sUnknown_80D4D44[]; -static const u8 sUnknown_80D4D8C[]; -static const u8 sUnknown_80D4E28[]; -static const u8 sUnknown_80D4E84[]; -static const u8 sUnknown_80D4EB0[]; -static const u8 sUnknown_80D4EDC[]; -static const u8 sUnknown_80D4F08[]; -static const u8 sUnknown_80D4F24[]; -static const u8 sUnknown_80D4F74[]; -static const u8 sUnknown_80D4F94[]; -static const u8 sUnknown_80D4FC8[]; -static const u8 sUnknown_80D5158[]; -static const u8 sUnknown_80D5184[]; -static const u8 sUnknown_80D51DC[]; -static const u8 sUnknown_80D5224[]; -static const u8 sUnknown_80D5244[]; -static const u8 sUnknown_80D527C[]; -static const u8 sUnknown_80D52F8[]; -static const u8 sUnknown_80D5340[]; -static const u8 sUnknown_80D5364[]; -static const u8 sUnknown_80D5380[]; -static const u8 sUnknown_80D538C[]; -static const u8 sUnknown_80D53C8[]; -static const u8 sUnknown_80D53E0[]; - -ALIGNED(4) const u8* const gCommonFelicity[FEL_MODE_COUNT][FEL_DLG_MAX] = -{ - [FEL_MODE_AWAKE] = { - [FEL_DLG_WELCOME] = sUnknown_80D53E0, - [FEL_DLG_HOW_MAY_I_SERVE__NO_MONEY] = sUnknown_80D53C8, - [FEL_DLG_HOW_MAY_I_SERVE__HAS_MONEY] = sUnknown_80D538C, - [FEL_DLG_VERY_WELL] = sUnknown_80D5380, - [FEL_DLG_BYE__NO_MONEY] = sUnknown_80D5364, - [FEL_DLG_BYE__HAS_MONEY] = sUnknown_80D5364, - [FEL_DLG_DEPOSIT__HOW_MUCH] = sUnknown_80D5340, - [FEL_DLG_DEPOSIT__NO_MONEY] = sUnknown_80D52F8, - [FEL_DLG_DEPOSIT__BANK_FULL] = sUnknown_80D527C, - [FEL_DLG_DEPOSIT__RECEIPT] = sUnknown_80D5244, - [FEL_DLG_WITHDRAW__HOW_MUCH] = sUnknown_80D5224, - [FEL_DLG_WITHDRAW__NO_MONEY] = sUnknown_80D51DC, - [FEL_DLG_WITHDRAW__WALLET_FULL] = sUnknown_80D5184, - [FEL_DLG_WITHDRAW__RECEIPT] = sUnknown_80D5158, - [FEL_DLG_HOW_IT_WORKS] = sUnknown_80D4FC8 - }, - [FEL_MODE_ASLEEP] = { - [FEL_DLG_WELCOME] = sUnknown_80D4F94, - [FEL_DLG_HOW_MAY_I_SERVE__NO_MONEY] = sUnknown_80D4F74, - [FEL_DLG_HOW_MAY_I_SERVE__HAS_MONEY] = sUnknown_80D4F24, - [FEL_DLG_VERY_WELL] = sUnknown_80D4F08, - [FEL_DLG_BYE__NO_MONEY] = sUnknown_80D4EDC, - [FEL_DLG_BYE__HAS_MONEY] = sUnknown_80D4EB0, - [FEL_DLG_DEPOSIT__HOW_MUCH] = sUnknown_80D4E84, - [FEL_DLG_DEPOSIT__NO_MONEY] = sUnknown_80D4E28, - [FEL_DLG_DEPOSIT__BANK_FULL] = sUnknown_80D4D8C, - [FEL_DLG_DEPOSIT__RECEIPT] = sUnknown_80D4D44, - [FEL_DLG_WITHDRAW__HOW_MUCH] = sUnknown_80D4D20, - [FEL_DLG_WITHDRAW__NO_MONEY] = sUnknown_80D4CC0, - [FEL_DLG_WITHDRAW__WALLET_FULL] = sUnknown_80D4C50, - [FEL_DLG_WITHDRAW__RECEIPT] = sUnknown_80D4C14, - [FEL_DLG_HOW_IT_WORKS] = sUnknown_80D4A58 - } -}; - -ALIGNED(4) static const u8 sUnknown_80D4A58[] = _( - " Sssnore...\n" - "Ah, you wish to know how the bank\n" - "operates... Very well...{EXTRA_MSG}" - " Zzz...\n" - "If you're defeated in a dungeon,\n" - "you'll lose all your money. Did you know?{EXTRA_MSG}" - " Purr...\n" - "But, you've nothing to fear if you leave\n" - "your money with Felicity Bank...{EXTRA_MSG}" - " Meow... Even if you\n" - "return defeated from a dungeon, your\n" - "money will be safe with me...{EXTRA_MSG}" - " Sssnore...\n" - "I assure you, my bank will keep your\n" - "money safe...{EXTRA_MSG}" - " Zzz...\n" - "Simple, isn't it...?"); - -ALIGNED(4) static const u8 sUnknown_80D4C14[] = _( - " {POKE}... Purr...\n" - "Very well, {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" - "Here you are."); - -ALIGNED(4) static const u8 sUnknown_80D4C50[] = _( - " Fnarf? Hunh...?{EXTRA_MSG}" - " Purr... I so do apologize,\n" - "but you couldn't possibly carry any more\n" - "money with you..."); - -ALIGNED(4) static const u8 sUnknown_80D4CC0[] = _( - " Fnarf? Meow...?{EXTRA_MSG}" - " Purr...\n" - "I so hate to disappoint, but you have no\n" - "money saved with me..."); - -ALIGNED(4) static const u8 sUnknown_80D4D20[] = _( - " Zzz...\n" - "How much will you withdraw?"); - -ALIGNED(4) static const u8 sUnknown_80D4D44[] = _( - " Zzz...\n" - "{COLOR CYAN}{VALUE_0}{RESET} {POKE}... Very well...{WAIT_PRESS}\n" - "I will guard it jealously..."); - -ALIGNED(4) static const u8 sUnknown_80D4D8C[] = _( - " Fnarf? Purr...\n" - "Meow! All this money...{WAIT_PRESS}\n" - "Our safe is about to burst...{EXTRA_MSG}" - " Purr...\n" - "I am so sorry to say, but I can't accept\n" - "any more of your money..."); - -ALIGNED(4) static const u8 sUnknown_80D4E28[] = _( - " Sssnore... Hmm?{EXTRA_MSG}" - " Zzz...\n" - "I'm so sorry to say, but you appear not\n" - "to have any money..."); - -ALIGNED(4) static const u8 sUnknown_80D4E84[] = _( - " Purr...\n" - "How much do you wish to deposit?"); - -ALIGNED(4) static const u8 sUnknown_80D4EB0[] = _( - " Zzz... Meow...\n" - "I await your next visit..."); - -ALIGNED(4) static const u8 sUnknown_80D4EDC[] = _( - " Zzz... Purr...\n" - "I await your next visit..."); - -ALIGNED(4) static const u8 sUnknown_80D4F08[] = _( - " Sssnore...\n" - "Very well..."); - -ALIGNED(4) static const u8 sUnknown_80D4F24[] = _( - " Sssnore... Purr...\n" - "Your account contains {COLOR CYAN}{VALUE_0}{RESET} {POKE}...\n" - "How may I serve you?"); - -ALIGNED(4) static const u8 sUnknown_80D4F74[] = _( - " Zzz...\n" - "How may I serve you?"); - -ALIGNED(4) static const u8 sUnknown_80D4F94[] = _( - " Ssssnore... Welcome...\n" - "This is Felicity Bank..."); - -ALIGNED(4) static const u8 sUnknown_80D4FC8[] = _( - " Ah, you wish to know how\n" - "the bank operates. Very well.{EXTRA_MSG}" - " If you are defeated\n" - "in a dungeon, you'll lose all your money.\n" - "Did you know that?{EXTRA_MSG}" - " But you can avoid that!{WAIT_PRESS}\n" - "You've nothing to fear if you leave your\n" - "money with Felicity Bank.{EXTRA_MSG}" - " Even if you return\n" - "defeated from a dungeon, your money will\n" - "be safe with me!{EXTRA_MSG}" - " I assure you, my bank\n" - "will keep your money safe.{EXTRA_MSG}" - " Simple, isn't it?"); - -ALIGNED(4) static const u8 sUnknown_80D5158[] = _( - " Very well, {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" - "Here you are."); - -ALIGNED(4) static const u8 sUnknown_80D5184[] = _( - " Oh?{WAIT_PRESS} I do so apologize,\n" - "but you couldn't possibly carry any more\n" - "money with you."); - -ALIGNED(4) static const u8 sUnknown_80D51DC[] = _( - " Oh?{WAIT_PRESS} I so hate to disappoint,\n" - "but you have no money saved with me."); - -ALIGNED(4) static const u8 sUnknown_80D5224[] = _( - " How much will you\n" - "withdraw?"); - -ALIGNED(4) static const u8 sUnknown_80D5244[] = _( - " {COLOR CYAN}{VALUE_0}{RESET} {POKE}. Very well.{WAIT_PRESS}\n" - "I will guard it jealously."); - -ALIGNED(4) static const u8 sUnknown_80D527C[] = _( - " Meow! All this money!{WAIT_PRESS}\n" - "Our safe is about to burst!{EXTRA_MSG}" - " I am so sorry to say, but\n" - "I can't accept any more of your money!"); - -ALIGNED(4) static const u8 sUnknown_80D52F8[] = _( - " Oh?{WAIT_PRESS} I'm so sorry to say,\n" - "but you appear not to have any money."); - -ALIGNED(4) static const u8 sUnknown_80D5340[] = _( - " How much do you wish to\n" - "deposit?"); - -ALIGNED(4) static const u8 sUnknown_80D5364[] = _(" I await your next visit."); - -ALIGNED(4) static const u8 sUnknown_80D5380[] = _(" Very well."); - -ALIGNED(4) static const u8 sUnknown_80D538C[] = _( - " Your account contains\n" - "{COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" - "How may I serve you?"); - -ALIGNED(4) static const u8 sUnknown_80D53C8[] = _(" How may I serve you?"); - -ALIGNED(4) static const u8 sUnknown_80D53E0[] = _( - " Welcome.\n" - "This is Felicity Bank."); \ No newline at end of file diff --git a/src/data/common_strings_gulpin_shop.h b/src/data/common_strings_gulpin_shop.h deleted file mode 100644 index b23d162c6..000000000 --- a/src/data/common_strings_gulpin_shop.h +++ /dev/null @@ -1,457 +0,0 @@ -static const u8 sUnknown_80D8950[]; -static const u8 sUnknown_80D8AB8[]; -static const u8 sUnknown_80D8BD4[]; -static const u8 sUnknown_80D8C98[]; -static const u8 sUnknown_80D8CC8[]; -static const u8 sUnknown_80D8D64[]; -static const u8 sUnknown_80D8DE8[]; -static const u8 sUnknown_80D8E28[]; -static const u8 sUnknown_80D8E48[]; -static const u8 sUnknown_80D8E9C[]; -static const u8 sUnknown_80D8EC4[]; -static const u8 sUnknown_80D8F98[]; -static const u8 sUnknown_80D9034[]; -static const u8 sUnknown_80D9080[]; -static const u8 sUnknown_80D90BC[]; -static const u8 sUnknown_80D9168[]; -static const u8 sUnknown_80D9194[]; -static const u8 sUnknown_80D91C4[]; -static const u8 sUnknown_80D91E4[]; -static const u8 sUnknown_80D9204[]; -static const u8 sUnknown_80D9234[]; -static const u8 sUnknown_80D9268[]; -static const u8 sUnknown_80D9290[]; -static const u8 sUnknown_80D92B4[]; -static const u8 sUnknown_80D92EC[]; -static const u8 sUnknown_80D9328[]; -static const u8 sUnknown_80D9498[]; -static const u8 sUnknown_80D972C[]; -static const u8 sUnknown_80D98D4[]; -static const u8 sUnknown_80D9904[]; -static const u8 sUnknown_80D9988[]; -static const u8 sUnknown_80D99F0[]; -static const u8 sUnknown_80D9A2C[]; -static const u8 sUnknown_80D9A50[]; -static const u8 sUnknown_80D9ACC[]; -static const u8 sUnknown_80D9B1C[]; -static const u8 sUnknown_80D9BD8[]; -static const u8 sUnknown_80D9C68[]; -static const u8 sUnknown_80D9CC0[]; -static const u8 sUnknown_80D9D00[]; -static const u8 sUnknown_80D9DA4[]; -static const u8 sUnknown_80D9DCC[]; -static const u8 sUnknown_80D9DF4[]; -static const u8 sUnknown_80D9E34[]; -static const u8 sUnknown_80D9E48[]; -static const u8 sUnknown_80D9E88[]; -static const u8 sUnknown_80D9EC0[]; -static const u8 sUnknown_80D9EF4[]; -static const u8 sUnknown_80D9F24[]; -static const u8 sUnknown_80D9F74[]; - -ALIGNED(4) const u8* const gCommonGulpin[GULPIN_SHOP_MODE_DIALOGUE_COUNT][GULPIN_DLG_MAX] = -{ - [GULPIN_SHOP_MODE_AWAKE] = { - [GULPIN_DLG_00] = sUnknown_80D9F74, - [GULPIN_DLG_01] = sUnknown_80D9F24, - [GULPIN_DLG_02] = sUnknown_80D9EF4, - [GULPIN_DLG_03] = sUnknown_80D9EC0, - [GULPIN_DLG_04] = sUnknown_80D9E88, - [GULPIN_DLG_05] = sUnknown_80D9E48, - [GULPIN_DLG_06] = sUnknown_80D9E34, - [GULPIN_DLG_07] = sUnknown_80D9DF4, - [GULPIN_DLG_08] = sUnknown_80D9DCC, - [GULPIN_DLG_09] = sUnknown_80D9DA4, - [GULPIN_DLG_10] = sUnknown_80D9D00, - [GULPIN_DLG_11] = sUnknown_80D9CC0, - [GULPIN_DLG_12] = sUnknown_80D9C68, - [GULPIN_DLG_13] = sUnknown_80D9BD8, - [GULPIN_DLG_14] = sUnknown_80D9B1C, - [GULPIN_DLG_15] = sUnknown_80D9ACC, - [GULPIN_DLG_16] = sUnknown_80D9A50, - [GULPIN_DLG_17] = sUnknown_80D9A2C, - [GULPIN_DLG_18] = sUnknown_80D99F0, - [GULPIN_DLG_19] = sUnknown_80D9988, - [GULPIN_DLG_20] = sUnknown_80D9904, - [GULPIN_DLG_21] = sUnknown_80D98D4, - [GULPIN_DLG_22] = sUnknown_80D972C, - [GULPIN_DLG_23] = sUnknown_80D9498, - [GULPIN_DLG_24] = sUnknown_80D9328 - }, - [GULPIN_SHOP_MODE_ASLEEP] = { - [GULPIN_DLG_00] = sUnknown_80D92EC, - [GULPIN_DLG_01] = sUnknown_80D92B4, - [GULPIN_DLG_02] = sUnknown_80D9290, - [GULPIN_DLG_03] = sUnknown_80D9268, - [GULPIN_DLG_04] = sUnknown_80D9234, - [GULPIN_DLG_05] = sUnknown_80D9204, - [GULPIN_DLG_06] = sUnknown_80D91E4, - [GULPIN_DLG_07] = sUnknown_80D91C4, - [GULPIN_DLG_08] = sUnknown_80D9194, - [GULPIN_DLG_09] = sUnknown_80D9168, - [GULPIN_DLG_10] = sUnknown_80D90BC, - [GULPIN_DLG_11] = sUnknown_80D9080, - [GULPIN_DLG_12] = sUnknown_80D9034, - [GULPIN_DLG_13] = sUnknown_80D8F98, - [GULPIN_DLG_14] = sUnknown_80D8EC4, - [GULPIN_DLG_15] = sUnknown_80D8E9C, - [GULPIN_DLG_16] = sUnknown_80D8E48, - [GULPIN_DLG_17] = sUnknown_80D8E28, - [GULPIN_DLG_18] = sUnknown_80D8DE8, - [GULPIN_DLG_19] = sUnknown_80D8D64, - [GULPIN_DLG_20] = sUnknown_80D8CC8, - [GULPIN_DLG_21] = sUnknown_80D8C98, - [GULPIN_DLG_22] = sUnknown_80D8BD4, - [GULPIN_DLG_23] = sUnknown_80D8AB8, - [GULPIN_DLG_24] = sUnknown_80D8950 - } -}; - -ALIGNED(4) static const u8 sUnknown_80D8950[] = _( - " Zzz... Snuffle...\n" - "I'd go broke if it weren't for those\n" - "forgetful PokĂ©mon...{EXTRA_MSG}" - " Zzz... Gwaaah...\n" - "Especially that {COLOR CYAN}{POKEMON_4}{RESET}...\n" - "It seems to be forgetful...{EXTRA_MSG}" - " Sssnore...\n" - "I hope it forgets more moves...\n" - "So it needs to see me...{EXTRA_MSG}" - " Zzz... Mumble...\n" - "But we decided to get rid of that\n" - "{COLOR CYAN}{POKEMON_4}{RESET}...{EXTRA_MSG}" - " Gwaaaah... Gweh...\n" - "{COLOR CYAN}{POKEMON_4}{RESET} won't be coming around\n" - "anymore... "); - -ALIGNED(4) static const u8 sUnknown_80D8AB8[] = _( - " Zzznork...{WAIT_PRESS}\n" - "Link moves to use them all in\n" - "one turn...{EXTRA_MSG}" - " Zzz... Fnurf...?\n" - "Linked moves...\n" - "Top one goes first...{EXTRA_MSG}" - " Zzz... Hah...?\n" - "Delink moves to break links...{EXTRA_MSG}" - " Zzzzz... Fwaaah...\n" - "Change order of moves with {R_BUTTON}...\n" - "And up and down on {DPAD}...{EXTRA_MSG}" - " Gwaaah... Gweh...\n" - "Make your own links..."); - -ALIGNED(4) static const u8 sUnknown_80D8BD4[] = _( - " Zzz... Zzz...\n" - "A set move can be used...\n" - "Press {L_BUTTON} and {A_BUTTON}...{EXTRA_MSG}" - " Sssnort... Set the move...{WAIT_PRESS}\n" - "Press {L_BUTTON} and {A_BUTTON}...{WAIT_PRESS} Use move!{WAIT_PRESS}\n" - "Convenient...{EXTRA_MSG}" - " Sssnore...\n" - "Switch the set move in a dungeon, too..."); - -ALIGNED(4) static const u8 sUnknown_80D8C98[] = _( - " Zzznork... Fnurfle?\n" - "What do you want to know?"); - -ALIGNED(4) static const u8 sUnknown_80D8CC8[] = _( - " Fgwaaah...\n" - "Here goes...{EXTRA_MSG}" - " Zzznort...\n" - "Gggggggg...{WAIT_PRESS} Pwah!{EXTRA_MSG}" - " Fwaaah hah!\n" - "There...{EXTRA_MSG}" - " Zzz... Mutter...\n" - "{COLOR CYAN}{POKEMON_5}{RESET} forgot...\n" - "{COLOR GREEN}{POKEMON_1}{RESET} and moves linked to it..."); - -ALIGNED(4) static const u8 sUnknown_80D8D64[] = _( - " Fgwaaah...\n" - "Here goes...{EXTRA_MSG}" - " Zzznort...\n" - "Gggggggg...{WAIT_PRESS} Pwah!{EXTRA_MSG}" - " Fwaaah hah!\n" - "There...{EXTRA_MSG}" - " Zzz... Mumble...\n" - "{COLOR CYAN}{POKEMON_5}{RESET} forgot...\n" - "{COLOR GREEN}{POKEMON_1}{RESET}..."); - -ALIGNED(4) static const u8 sUnknown_80D8DE8[] = _( - " Zzz... Fwaah? Forget...?\n" - "{COLOR GREEN}{POKEMON_1}{RESET} and any moves\n" - "linked to it?"); - -ALIGNED(4) static const u8 sUnknown_80D8E28[] = _( - " Zzz... Forget...?\n" - "{COLOR GREEN}{POKEMON_1}{RESET}?"); - -ALIGNED(4) static const u8 sUnknown_80D8E48[] = _( - " Zzznork...? Hunh?\n" - "You're a special PokĂ©mon...{EXTRA_MSG}" - " Mumble...\n" - "I can't help you..."); - -ALIGNED(4) static const u8 sUnknown_80D8E9C[] = _( - " Zzz... Fwaah?\n" - "No moves to remember..."); - -ALIGNED(4) static const u8 sUnknown_80D8EC4[] = _( - " Fgwaaah...\n" - "Here goes...{EXTRA_MSG}" - " Zzznort...\n" - "Gggggggg...{WAIT_PRESS} Pwah! Gulpin!{EXTRA_MSG}" - " Fwaaah hah!\n" - "There...{EXTRA_MSG}" - " Zzz... Mumble...\n" - "{COLOR CYAN_M}{POKEMON_5}{RESET}'s OK...{EXTRA_MSG}" - " Sssnork... Forgotten...\n" - "{COLOR GREEN}{POKEMON_1}{RESET} and moves linked to it...\n" - "Remembered {COLOR CYAN}{POKEMON_0}{RESET}..."); - -ALIGNED(4) static const u8 sUnknown_80D8F98[] = _( - " Fgwaah...\n" - "Here goes...{EXTRA_MSG}" - " Zzznort...\n" - "Gggggggg...{WAIT_PRESS} Pwah! Gulpin!{EXTRA_MSG}" - " Fwaah hah!\n" - "There...{EXTRA_MSG}" - " Zzz... Zzz... {COLOR CYAN_M}{POKEMON_5}{RESET}\n" - "forgot {COLOR GREEN}{POKEMON_1}{RESET}...\n" - "Remembered {COLOR CYAN}{POKEMON_0}{RESET}..."); - -ALIGNED(4) static const u8 sUnknown_80D9034[] = _( - " Zzz? Fnurf? \n" - "Forget {COLOR GREEN}{POKEMON_1}{RESET}...and moves linked\n" - "to it? Remember {COLOR CYAN}{POKEMON_0}{RESET}?"); - -ALIGNED(4) static const u8 sUnknown_80D9080[] = _( - " Zzznort... Grumble...\n" - "Forget {COLOR GREEN}{POKEMON_1}{RESET}?\n" - "Remember {COLOR CYAN}{POKEMON_0}{RESET}?"); - -ALIGNED(4) static const u8 sUnknown_80D90BC[] = _( - " Zzzznort... Move...?\n" - "Remember {COLOR CYAN}{POKEMON_0}{RESET}?{EXTRA_MSG}" - " Fwaah...\n" - "Gggggggggggg...{WAIT_PRESS} Gulpin!{EXTRA_MSG}" - " Fgwaah...\n" - "There...{EXTRA_MSG}" - " Zzz... Zzz...\n" - "{COLOR CYAN_M}{POKEMON_5}{RESET} remembered...\n" - "Hunh? That move, {COLOR CYAN}{POKEMON_0}{RESET}..."); - -ALIGNED(4) static const u8 sUnknown_80D9168[] = _( - " Zzz... Fgwah...?\n" - "Remember what? What move?"); - -ALIGNED(4) static const u8 sUnknown_80D9194[] = _( - " Gwaah... Gwaah...\n" - "Who's gonna link moves?"); - -ALIGNED(4) static const u8 sUnknown_80D91C4[] = _( - " Zzz... Zzz...\n" - "Come again..."); - -ALIGNED(4) static const u8 sUnknown_80D91E4[] = _( - " Zzz... Zzz...\n" - "Keep going...?"); - -ALIGNED(4) static const u8 sUnknown_80D9204[] = _( - " Zzznort... Zzznnort...\n" - "Can't forget that..."); - -ALIGNED(4) static const u8 sUnknown_80D9234[] = _( - " Sssnork... Sssnork...\n" - "Nothing to be delinked..."); - -ALIGNED(4) static const u8 sUnknown_80D9268[] = _( - " Zzz... Grumph...\n" - "Nothing to link..."); - -ALIGNED(4) static const u8 sUnknown_80D9290[] = _( - " Zzz... Grunt?\n" - "Not enough money..."); - -ALIGNED(4) static const u8 sUnknown_80D92B4[] = _( - " Zzz... Gulpin Link Shop...\n" - "Link for just 150 {POKE}..."); - -ALIGNED(4) static const u8 sUnknown_80D92EC[] = _( - " Zzz... Hello...\n" - "Gulpin Link Shop...\n" - "Link for 150 {POKE}..."); - -ALIGNED(4) static const u8 sUnknown_80D9328[] = _( - " What if you had to forget\n" - "a move, but you wanted it back?{WAIT_PRESS}\n" - "Ever face that situation?{EXTRA_MSG}" - " I can help!{WAIT_PRESS}\n" - "Come to me, and I can make you instantly\n" - "remember forgotten moves!{EXTRA_MSG}" - " I...{WAIT_PRESS}\n" - "Well, when PokĂ©mon remember...{WAIT_PRESS}\n" - "I love seeing that instant!{EXTRA_MSG}" - " That look of enlightenment!{WAIT_PRESS}\n" - "That amazed look of pleasure!{EXTRA_MSG}" - " I run this business because\n" - "I live to see that moment!"); - -ALIGNED(4) static const u8 sUnknown_80D9498[] = _( - " When moves are linked...{WAIT_PRESS}\n" - "Two or more moves can be used one after\n" - "another in one turn!{EXTRA_MSG}" - " For example, if the moves\n" - "{COLOR CYAN}Scratch{RESET} and {COLOR CYAN}Growl{RESET} are\n" - "linked...{EXTRA_MSG}" - " Both {COLOR CYAN}Scratch{RESET} and {COLOR CYAN}Growl{RESET} are\n" - "used in one turn!{WAIT_PRESS}\n" - "See? Amazing, huh?{EXTRA_MSG}" - " Using links, heheh...{WAIT_PRESS}\n" - "Well, depending on the moves you link,\n" - "you can get incredible results!{EXTRA_MSG}" - " Oh, yes.\n" - "When moves are linked, they are used in\n" - "sequence from the top one first.{EXTRA_MSG}" - " You can also separate linked\n" - "moves by selecting the Delink command.{EXTRA_MSG}" - " The sequence of moves can\n" - "be changed by pressing {R_BUTTON},\n" - "then pressing up or down on {DPAD}.{EXTRA_MSG}" - " Try to innovate with links.{WAIT_PRESS}\n" - "Try creating links of your very own!"); - -ALIGNED(4) static const u8 sUnknown_80D972C[] = _( - " When you're in a dungeon\n" - "and you're about to use a move...{WAIT_PRESS}\n" - "Isn't it a pain to open a window each time?{EXTRA_MSG}" - " You can avoid that!{WAIT_PRESS}\n" - "You can just conveniently “Set”\n" - "a move for instant use!{EXTRA_MSG}" - " A set move can be instantly\n" - "used with {L_BUTTON} and {A_BUTTON}!{WAIT_PRESS}\n" - "See? Isn't it easy?{EXTRA_MSG}" - " Just set the move...{WAIT_PRESS}\n" - "Hold {L_BUTTON} and then press {A_BUTTON} to use it!{WAIT_PRESS}\n" - "It's very convenient!{EXTRA_MSG}" - " You can also switch the set\n" - "move in a dungeon.\n" - "Do try it out!\n"); - -ALIGNED(4) static const u8 sUnknown_80D98D4[] = _( - " Sure thing!\n" - "What do you need information on?"); - -ALIGNED(4) static const u8 sUnknown_80D9904[] = _( - " OK, here goes!{EXTRA_MSG}" - " Gggggggg...{WAIT_PRESS} Poof!{EXTRA_MSG}" - " There!\n" - "Success!{EXTRA_MSG}" - " {COLOR CYAN}{POKEMON_5}{RESET} has forgotten\n" - "the move {COLOR GREEN}{POKEMON_1}{RESET} and any moves\n" - "linked to it!"); - -ALIGNED(4) static const u8 sUnknown_80D9988[] = _( - " OK, here goes!{EXTRA_MSG}" - " Gggggggg...{WAIT_PRESS} Poof!{EXTRA_MSG}" - " There!\n" - "Success!{EXTRA_MSG}" - " {COLOR CYAN}{POKEMON_5}{RESET} has forgotten\n" - "the move {COLOR GREEN}{POKEMON_1}{RESET}!"); - -ALIGNED(4) static const u8 sUnknown_80D99F0[] = _( - " So, forget the move\n" - "{COLOR GREEN}{POKEMON_1}{RESET} and any moves linked to it?"); - -ALIGNED(4) static const u8 sUnknown_80D9A2C[] = _( - " So, forget the move\n" - "{COLOR GREEN}{POKEMON_1}{RESET}?"); - -ALIGNED(4) static const u8 sUnknown_80D9A50[] = _( - " Uh... Huh?{WAIT_PRESS}\n" - "You appear to be a special PokĂ©mon.{EXTRA_MSG}" - " I can't help you remember\n" - "any moves, I don't think.\n" - "I'm sorry."); - -ALIGNED(4) static const u8 sUnknown_80D9ACC[] = _( - " Uh... Hello?{WAIT_PRESS}\n" - "There don't appear to be any moves that\n" - "can be remembered."); - -ALIGNED(4) static const u8 sUnknown_80D9B1C[] = _( - " OK, here goes!{EXTRA_MSG}" - " Gggggggg...{WAIT_PRESS} Pwah! Gulpin!{EXTRA_MSG}" - " There!\n" - "Success!{EXTRA_MSG}" - " {COLOR CYAN_M}{POKEMON_5}{RESET} is done!{EXTRA_MSG}" - " It's forgotten the move\n" - "{COLOR GREEN}{POKEMON_1}{RESET} and any moves linked to it,\n" - "and {COLOR CYAN}{POKEMON_0}{RESET} has been remembered!"); - -ALIGNED(4) static const u8 sUnknown_80D9BD8[] = _( - " OK, here goes!{EXTRA_MSG}" - " Gggggggg...{WAIT_PRESS} Pwah! Gulpin!{EXTRA_MSG}" - " There!\n" - "Success!{EXTRA_MSG}" - " {COLOR CYAN_M}{POKEMON_5}{RESET} has forgotten\n" - "the move {COLOR GREEN}{POKEMON_1}{RESET} and remembered\n" - "the move {COLOR CYAN}{POKEMON_0}{RESET}!"); - -ALIGNED(4) static const u8 sUnknown_80D9C68[] = _( - " So, forget {COLOR GREEN}{POKEMON_1}{RESET}\n" - "and any moves linked to it, and remember\n" - "the move {COLOR CYAN}{POKEMON_0}{RESET}?"); - -ALIGNED(4) static const u8 sUnknown_80D9CC0[] = _( - " So, forget the move\n" - "{COLOR GREEN}{POKEMON_1}{RESET} and remember the move\n" - "{COLOR CYAN}{POKEMON_0}{RESET}?"); - -ALIGNED(4) static const u8 sUnknown_80D9D00[] = _( - " So, the move {COLOR CYAN}{POKEMON_0}{RESET}\n" - "is the one to be remembered?{WAIT_PRESS}\n" - "OK, here goes!{EXTRA_MSG}" - " Gggggggggggg...{WAIT_PRESS} Gulpin!{EXTRA_MSG}" - " There!\n" - "Success!{EXTRA_MSG}" - " {COLOR CYAN_M}{POKEMON_5}{RESET} has\n" - "remembered the move {COLOR CYAN}{POKEMON_0}{RESET}!"); - -ALIGNED(4) static const u8 sUnknown_80D9DA4[] = _( - " Which move would you like\n" - "to recall?"); - -ALIGNED(4) static const u8 sUnknown_80D9DCC[] = _( - " Good!\n" - "Now, who wants to link moves?"); - -ALIGNED(4) static const u8 sUnknown_80D9DF4[] = _( - " Whenever you get the urge\n" - "to link moves, please come see me!"); - -ALIGNED(4) static const u8 sUnknown_80D9E34[] = _(" Shall we go on?"); - -ALIGNED(4) static const u8 sUnknown_80D9E48[] = _( - " If you forget that move,\n" - "you won't have any moves at all."); - -ALIGNED(4) static const u8 sUnknown_80D9E88[] = _( - " That move isn't linked,\n" - "so it can't be delinked."); - -ALIGNED(4) static const u8 sUnknown_80D9EC0[] = _( - " Too bad.\n" - "There are no moves that can be linked."); - -ALIGNED(4) static const u8 sUnknown_80D9EF4[] = _( - " Uh... Hello?\n" - "You don't have enough money?"); - -ALIGNED(4) static const u8 sUnknown_80D9F24[] = _( - " Welcome to the Gulpin\n" - "Link Shop!\n" - "Link moves all you like for just 150 {POKE}!"); - -ALIGNED(4) static const u8 sUnknown_80D9F74[] = _( - " Hello!\n" - "Welcome to the Gulpin Link Shop!\n" - "Link moves all you like for just 150 {POKE}!"); \ No newline at end of file diff --git a/src/data/common_strings_hints.h b/src/data/common_strings_hints.h deleted file mode 100644 index b8b8589af..000000000 --- a/src/data/common_strings_hints.h +++ /dev/null @@ -1,67 +0,0 @@ -static const u8 sUnknown_80DAAC0[]; -static const u8 sUnknown_80DABD8[]; -static const u8 sUnknown_80DABE8[]; -static const u8 sUnknown_80DAD28[]; -static const u8 sUnknown_80DAD40[]; -static const u8 sUnknown_80DADCC[]; -static const u8 sUnknown_80DADD4[]; -static const u8 sUnknown_80DAECC[]; -static const u8 sUnknown_80DAEE0[]; -static const u8 sUnknown_80DAF54[]; - -ALIGNED(4) const Hints gCommonHints[NUM_HINTS] = -{ - {sUnknown_80DAF54, sUnknown_80DAEE0}, - {sUnknown_80DAECC, sUnknown_80DADD4}, - {sUnknown_80DADCC, sUnknown_80DAD40}, - {sUnknown_80DAD28, sUnknown_80DABE8}, - {sUnknown_80DABD8, sUnknown_80DAAC0} -}; - -ALIGNED(4) static const u8 sUnknown_80DAAC0[] = _( - "Before leaving on an adventure, go visit\n" - "friends in their Friend Areas and pick\n" - "your mission members.\n" - "The team can include members up to\n" - "a total body size of 6{STAR_BULLET}. The body size\n" - "data is under the Info section.\n" - "Dungeons may also limit how many\n" - "members are allowed to go inside."); -ALIGNED(4) static const u8 sUnknown_80DABD8[] = _("Building a Team"); - -ALIGNED(4) static const u8 sUnknown_80DABE8[] = _( - "If new recruits join you, try to return to\n" - "your base without letting them faint.\n" - "If you get them out safely, they'll wait\n" - "for you in their Friend Areas.\n" - "Once you get them out, they'll always\n" - "return home if they faint in a dungeon.\n" - "If you faint in a dungeon, you lose all your\n" - "money and some items, too."); -ALIGNED(4) static const u8 sUnknown_80DAD28[] = _("Adventures with Friends"); - -ALIGNED(4) static const u8 sUnknown_80DAD40[] = _( - "You can save your adventure by\n" - "hopping onto your bed in your base.\n" - "Get in the habit of saving regularly as\n" - "you progress in your adventure."); -ALIGNED(4) static const u8 sUnknown_80DADCC[] = _("Saving"); - -ALIGNED(4) static const u8 sUnknown_80DADD4[] = _( - "Selecting multiple items in storage:\n" - " Select an item, then press {L_BUTTON} or {R_BUTTON}.\n" - "Moving to the Friend Area Map:\n" - " Move out from the town's west side\n" - " while pressing {L_BUTTON} or {R_BUTTON}.\n" - "Moving diagonally on the Friend Area Map:\n" - " {DPAD} while keeping {R_BUTTON} pressed."); -ALIGNED(4) static const u8 sUnknown_80DAECC[] = _("Controls in Town 2"); - -ALIGNED(4) static const u8 sUnknown_80DAEE0[] = _( - "Talk: {A_BUTTON}\n" - "Move: {DPAD}\n" - "Window: {B_BUTTON} lightly\n" - "Message scroll: {A_BUTTON} or {B_BUTTON}\n" - "Cancel: {B_BUTTON}\n" - "Description: Choose item or move, {START_BUTTON}"); -ALIGNED(4) static const u8 sUnknown_80DAF54[] = _("Controls in Town 1"); \ No newline at end of file diff --git a/src/data/common_strings_kangaskhan_storage.h b/src/data/common_strings_kangaskhan_storage.h deleted file mode 100644 index d44c40808..000000000 --- a/src/data/common_strings_kangaskhan_storage.h +++ /dev/null @@ -1,276 +0,0 @@ -static const u8 sUnknown_80D54A4[]; -static const u8 sUnknown_80D555C[]; -static const u8 sUnknown_80D5590[]; -static const u8 sUnknown_80D55C0[]; -static const u8 sUnknown_80D55F4[]; -static const u8 sUnknown_80D5630[]; -static const u8 sUnknown_80D5670[]; -static const u8 sUnknown_80D56AC[]; -static const u8 sUnknown_80D56CC[]; -static const u8 sUnknown_80D5710[]; -static const u8 sUnknown_80D574C[]; -static const u8 sUnknown_80D5774[]; -static const u8 sUnknown_80D57C4[]; -static const u8 sUnknown_80D57F4[]; -static const u8 sUnknown_80D5844[]; -static const u8 sUnknown_80D5884[]; -static const u8 sUnknown_80D58B0[]; -static const u8 sUnknown_80D5900[]; -static const u8 sUnknown_80D5934[]; -static const u8 sUnknown_80D5954[]; -static const u8 sUnknown_80D5984[]; -static const u8 sUnknown_80D5AF0[]; -static const u8 sUnknown_80D5B24[]; -static const u8 sUnknown_80D5B5C[]; -static const u8 sUnknown_80D5BAC[]; -static const u8 sUnknown_80D5BDC[]; -static const u8 sUnknown_80D5C1C[]; -static const u8 sUnknown_80D5C44[]; -static const u8 sUnknown_80D5C74[]; -static const u8 sUnknown_80D5CAC[]; -static const u8 sUnknown_80D5CE4[]; -static const u8 sUnknown_80D5D0C[]; -static const u8 sUnknown_80D5D58[]; -static const u8 sUnknown_80D5D8C[]; -static const u8 sUnknown_80D5DBC[]; -static const u8 sUnknown_80D5DE8[]; -static const u8 sUnknown_80D5E10[]; -static const u8 sUnknown_80D5E60[]; -static const u8 sUnknown_80D5E84[]; -static const u8 sUnknown_80D5E9C[]; - -ALIGNED(4) const u8* const gCommonKangStorage[KANG_MODE_COUNT][KANG_DLG_MAX] = -{ - [KANG_MODE_AWAKE] = { - [KANG_DLG_WELCOME] = sUnknown_80D5E9C, - [KANG_DLG_ANYTHING_ELSE] = sUnknown_80D5E84, - [KANG_DLG_BYE] = sUnknown_80D5E60, - [KANG_DLG_STORE_WHAT] = sUnknown_80D5E10, - [KANG_DLG_STORE_MORE] = sUnknown_80D5DE8, - [KANG_DLG_DEPOSIT_ONE_PROMPT] = sUnknown_80D5DBC, - [KANG_DLG_DEPOSIT_MANY_PROMPT] = sUnknown_80D5D8C, - [KANG_DLG_DEPOSIT_CONFIRMATION] = sUnknown_80D5D58, - [KANG_DLG_TAKE_WHAT] = sUnknown_80D5D0C, - [KANG_DLG_TAKE_MORE] = sUnknown_80D5CE4, - [KANG_DLG_WITHDRAW_ONE_PROMPT] = sUnknown_80D5CAC, - [KANG_DLG_WITHDRAW_MANY_PROMPT] = sUnknown_80D5C74, - [KANG_DLG_WITHDRAW_CONFIRMATION] = sUnknown_80D5C44, - [KANG_DLG_YOU_HAVE_NOTHING] = sUnknown_80D5C1C, - [KANG_DLG_YOU_ARE_FULL] = sUnknown_80D5BDC, - [KANG_DLG_STORAGE_HAS_NOTHING] = sUnknown_80D5BAC, - [KANG_DLG_DEPOSIT__INVALID_ITEM] = sUnknown_80D5B5C, - [KANG_DLG_DEPOSIT__TOO_MANY_OF_ITEM] = sUnknown_80D5B24, - [KANG_DLG_STORAGE_FULL] = sUnknown_80D5AF0, - [KANG_DLG_HOW_IT_WORKS] = sUnknown_80D5984 - }, - [KANG_MODE_ASLEEP] = { - [KANG_DLG_WELCOME] = sUnknown_80D5954, - [KANG_DLG_ANYTHING_ELSE] = sUnknown_80D5934, - [KANG_DLG_BYE] = sUnknown_80D5900, - [KANG_DLG_STORE_WHAT] = sUnknown_80D58B0, - [KANG_DLG_STORE_MORE] = sUnknown_80D5884, - [KANG_DLG_DEPOSIT_ONE_PROMPT] = sUnknown_80D5844, - [KANG_DLG_DEPOSIT_MANY_PROMPT] = sUnknown_80D57F4, - [KANG_DLG_DEPOSIT_CONFIRMATION] = sUnknown_80D57C4, - [KANG_DLG_TAKE_WHAT] = sUnknown_80D5774, - [KANG_DLG_TAKE_MORE] = sUnknown_80D574C, - [KANG_DLG_WITHDRAW_ONE_PROMPT] = sUnknown_80D5710, - [KANG_DLG_WITHDRAW_MANY_PROMPT] = sUnknown_80D56CC, - [KANG_DLG_WITHDRAW_CONFIRMATION] = sUnknown_80D56AC, - [KANG_DLG_YOU_HAVE_NOTHING] = sUnknown_80D5670, - [KANG_DLG_YOU_ARE_FULL] = sUnknown_80D5630, - [KANG_DLG_STORAGE_HAS_NOTHING] = sUnknown_80D55F4, - [KANG_DLG_DEPOSIT__INVALID_ITEM] = sUnknown_80D55C0, - [KANG_DLG_DEPOSIT__TOO_MANY_OF_ITEM] = sUnknown_80D5590, - [KANG_DLG_STORAGE_FULL] = sUnknown_80D555C, - [KANG_DLG_HOW_IT_WORKS] = sUnknown_80D54A4 - } -}; - -ALIGNED(4) static const u8 sUnknown_80D54A4[] = _( - " Zzz... Snork!\n" - "I can store items that you\n" - "found in dungeons...{EXTRA_MSG}" - " Snarfle...\n" - "Things in storage don't get lost...{EXTRA_MSG}" - " Zzz... Zzz...\n" - "That's why...\n" - "Keep important items in storage..."); - -ALIGNED(4) static const u8 sUnknown_80D555C[] = _( - " Zzz... Zzz... No...\n" - "The storage space is full..."); - -ALIGNED(4) static const u8 sUnknown_80D5590[] = _( - " Zzz... No...\n" - "Can't store any more of that..."); - -ALIGNED(4) static const u8 sUnknown_80D55C0[] = _( - " Zzz... Zzz...\n" - "That {COLOR GREEN}{MOVE_ITEM_0}{RESET}...\n" - "Can't store it..."); - -ALIGNED(4) static const u8 sUnknown_80D55F4[] = _( - " Snarfle? Hunh...?{WAIT_PRESS}\n" - "Zzz... Your storage space... Empty..."); - -ALIGNED(4) static const u8 sUnknown_80D5630[] = _( - " Snarfle? Hunh...?{WAIT_PRESS}\n" - "Zzz...\n" - "You don't have enough space..."); - -ALIGNED(4) static const u8 sUnknown_80D5670[] = _( - " Snarfle? Hunh...?{WAIT_PRESS}\n" - "Zzz...\n" - "You don't have anything...?"); - -ALIGNED(4) static const u8 sUnknown_80D56AC[] = _( - " Zzz... Snork!\n" - "There you go..."); - -ALIGNED(4) static const u8 sUnknown_80D56CC[] = _( - " Zzz... Zzz... Hunh...?\n" - "You want those things from storage...\n" - "OK?"); - -ALIGNED(4) static const u8 sUnknown_80D5710[] = _( - " Hunh...? Taking...?\n" - "Oh... You want your {COLOR GREEN}{MOVE_ITEM_0}{RESET}...\n" - "OK?"); - -ALIGNED(4) static const u8 sUnknown_80D574C[] = _( - " Snork! Zzz...\n" - "Taking anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D5774[] = _( - " What...? Take out...?\n" - "Uh-huh... Choose more than one using\n" - "{L_BUTTON} or {R_BUTTON}... Zzz..."); - -ALIGNED(4) static const u8 sUnknown_80D57C4[] = _( - " Zzz... Zzz...\n" - "Yup, I did... Stored away..."); - -ALIGNED(4) static const u8 sUnknown_80D57F4[] = _( - " Hunh, wha--? Storage...?\n" - "I'll put away the things you chose...\n" - "That OK?"); - -ALIGNED(4) static const u8 sUnknown_80D5844[] = _( - " Zzz... Store something?\n" - "Gonna put {COLOR GREEN}{MOVE_ITEM_0}{RESET} in storage...\n" - "OK?"); - -ALIGNED(4) static const u8 sUnknown_80D5884[] = _( - " Do you... Snork...\n" - "Store anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D58B0[] = _( - " Hunh, wha--? Store what...?\n" - "You can choose more than one using\n" - "{L_BUTTON} or {R_BUTTON}..."); - -ALIGNED(4) static const u8 sUnknown_80D5900[] = _( - " Snuffle... Mutter...\n" - "Thank you...\n" - "Come again..."); - -ALIGNED(4) static const u8 sUnknown_80D5934[] = _( - " Zzz... Snork...\n" - "Anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D5954[] = _( - " Zzz... Zzz...\n" - "Hello, there...\n" - "{POKEMON_6} Storage..."); - -ALIGNED(4) static const u8 sUnknown_80D5984[] = _( - " I can store items that you\n" - "found in dungeons, or that you\n" - "bought from shops.{EXTRA_MSG}" - " If you faint in\n" - "a dungeon, your items will be lost...{WAIT_PRESS}\n" - "But what's in storage will be safe.{EXTRA_MSG}" - " I keep guard over the\n" - "storage space, so anything you leave\n" - "with me won't ever disappear!{EXTRA_MSG}" - " If you have any items that\n" - "you can't bear to lose, be sure to leave\n" - "them with me!"); - -ALIGNED(4) static const u8 sUnknown_80D5AF0[] = _( - " Sorry, dear.\n" - "I've run out of storage space."); - -ALIGNED(4) static const u8 sUnknown_80D5B24[] = _( - " Sorry, dear.\n" - "I can't take any more of that item."); - -ALIGNED(4) static const u8 sUnknown_80D5B5C[] = _( - " Oh, dear, sorry.{WAIT_PRESS}\n" - "That {COLOR GREEN}{MOVE_ITEM_0}{RESET} is an item you\n" - "can't put in storage."); - -ALIGNED(4) static const u8 sUnknown_80D5BAC[] = _( - " Oh?\n" - "You don't have anything stored, dear."); - -ALIGNED(4) static const u8 sUnknown_80D5BDC[] = _( - " Oh? You don't have the room\n" - "to carry any more items, dear."); - -ALIGNED(4) static const u8 sUnknown_80D5C1C[] = _( - " Oh?\n" - "You don't seem to have anything?"); - -ALIGNED(4) static const u8 sUnknown_80D5C44[] = _( - " There you go!\n" - "Just like you asked, sweetie!"); - -ALIGNED(4) static const u8 sUnknown_80D5C74[] = _( - " I'll take the items you\n" - "chose out of storage. OK?"); - -ALIGNED(4) static const u8 sUnknown_80D5CAC[] = _( - " Fine, I'll take your\n" - "{COLOR GREEN}{MOVE_ITEM_0}{RESET} out of storage. OK?"); - -ALIGNED(4) static const u8 sUnknown_80D5CE4[] = _( - " Would you like to take\n" - "anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D5D0C[] = _( - " What will you take out?\n" - "You can choose more than one item using\n" - "{L_BUTTON} or {R_BUTTON}."); - -ALIGNED(4) static const u8 sUnknown_80D5D58[] = _( - " OK, stored away!\n" - "You can count on me, honey."); - -ALIGNED(4) static const u8 sUnknown_80D5D8C[] = _( - " I'll put the items you chose\n" - "in storage. OK?"); - -ALIGNED(4) static const u8 sUnknown_80D5DBC[] = _( - " I'll put your\n" - "{COLOR GREEN}{MOVE_ITEM_0}{RESET} in storage. OK?"); - -ALIGNED(4) static const u8 sUnknown_80D5DE8[] = _( - " Do you want to store\n" - "anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D5E10[] = _( - " What do you want to store?\n" - "You can choose more than one item using\n" - "{L_BUTTON} or {R_BUTTON}."); - -ALIGNED(4) static const u8 sUnknown_80D5E60[] = _( - " Thank you, sweetie.\n" - "Come again!"); - -ALIGNED(4) static const u8 sUnknown_80D5E84[] = _(" Anything else, dear?"); - -ALIGNED(4) static const u8 sUnknown_80D5E9C[] = _( - " Hello, there!\n" - "Welcome to {POKEMON_6} Storage."); \ No newline at end of file diff --git a/src/data/common_strings_kecleon_bros.h b/src/data/common_strings_kecleon_bros.h deleted file mode 100644 index 82174ef5e..000000000 --- a/src/data/common_strings_kecleon_bros.h +++ /dev/null @@ -1,656 +0,0 @@ -static const u8 sUnknown_80D6038[]; -static const u8 sUnknown_80D6128[]; -static const u8 sUnknown_80D6168[]; -static const u8 sUnknown_80D61B0[]; -static const u8 sUnknown_80D61D4[]; -static const u8 sUnknown_80D6204[]; -static const u8 sUnknown_80D6250[]; -static const u8 sUnknown_80D627C[]; -static const u8 sUnknown_80D62B0[]; -static const u8 sUnknown_80D630C[]; -static const u8 sUnknown_80D6338[]; -static const u8 sUnknown_80D6364[]; -static const u8 sUnknown_80D6394[]; -static const u8 sUnknown_80D63E8[]; -static const u8 sUnknown_80D6420[]; -static const u8 sUnknown_80D6450[]; -static const u8 sUnknown_80D6478[]; -static const u8 sUnknown_80D6494[]; -static const u8 sUnknown_80D64C0[]; -static const u8 sUnknown_80D64E8[]; -static const u8 sUnknown_80D6508[]; -static const u8 sUnknown_80D652C[]; -static const u8 sUnknown_80D6544[]; -static const u8 sUnknown_80D6564[]; -static const u8 sUnknown_80D6818[]; -static const u8 sUnknown_80D6868[]; -static const u8 sUnknown_80D68A4[]; -static const u8 sUnknown_80D68E0[]; -static const u8 sUnknown_80D6938[]; -static const u8 sUnknown_80D6980[]; -static const u8 sUnknown_80D69B0[]; -static const u8 sUnknown_80D6A04[]; -static const u8 sUnknown_80D6A74[]; -static const u8 sUnknown_80D6AAC[]; -static const u8 sUnknown_80D6B18[]; -static const u8 sUnknown_80D6B50[]; -static const u8 sUnknown_80D6BA0[]; -static const u8 sUnknown_80D6BF4[]; -static const u8 sUnknown_80D6C1C[]; -static const u8 sUnknown_80D6C48[]; -static const u8 sUnknown_80D6C90[]; -static const u8 sUnknown_80D6CB8[]; -static const u8 sUnknown_80D6D08[]; -static const u8 sUnknown_80D6D38[]; -static const u8 sUnknown_80D6D5C[]; -static const u8 sUnknown_80D6D98[]; -static const u8 sUnknown_80D6E30[]; -static const u8 sUnknown_80D6E78[]; -static const u8 sUnknown_80D6EA4[]; -static const u8 sUnknown_80D6EEC[]; -static const u8 sUnknown_80D6F18[]; -static const u8 sUnknown_80D6F4C[]; -static const u8 sUnknown_80D6F8C[]; -static const u8 sUnknown_80D6FD4[]; -static const u8 sUnknown_80D7038[]; -static const u8 sUnknown_80D7064[]; -static const u8 sUnknown_80D7090[]; -static const u8 sUnknown_80D70B4[]; -static const u8 sUnknown_80D7108[]; -static const u8 sUnknown_80D7154[]; -static const u8 sUnknown_80D7184[]; -static const u8 sUnknown_80D71B0[]; -static const u8 sUnknown_80D71CC[]; -static const u8 sUnknown_80D7204[]; -static const u8 sUnknown_80D7228[]; -static const u8 sUnknown_80D7250[]; -static const u8 sUnknown_80D7270[]; -static const u8 sUnknown_80D72A0[]; -static const u8 sUnknown_80D72B8[]; -static const u8 sUnknown_80D7480[]; -static const u8 sUnknown_80D74DC[]; -static const u8 sUnknown_80D7524[]; -static const u8 sUnknown_80D7560[]; -static const u8 sUnknown_80D75AC[]; -static const u8 sUnknown_80D75E0[]; -static const u8 sUnknown_80D7610[]; -static const u8 sUnknown_80D7640[]; -static const u8 sUnknown_80D76A8[]; -static const u8 sUnknown_80D76D4[]; -static const u8 sUnknown_80D7740[]; -static const u8 sUnknown_80D776C[]; -static const u8 sUnknown_80D77C0[]; -static const u8 sUnknown_80D780C[]; -static const u8 sUnknown_80D7830[]; -static const u8 sUnknown_80D785C[]; -static const u8 sUnknown_80D788C[]; -static const u8 sUnknown_80D78CC[]; -static const u8 sUnknown_80D78F8[]; -static const u8 sUnknown_80D7934[]; -static const u8 sUnknown_80D7958[]; -static const u8 sUnknown_80D797C[]; - -ALIGNED(4) const u8* const gCommonKecleonBros[KECLEON_BROS_MODE_COUNT][KECLEON_DLG_MAX] = -{ - [KECLEON_BROS_MODE_ITEMS_AWAKE] = { - [KECLEON_DLG_00] = sUnknown_80D797C, - [KECLEON_DLG_01] = sUnknown_80D7958, - [KECLEON_DLG_02] = sUnknown_80D7934, - [KECLEON_DLG_03] = sUnknown_80D78F8, - [KECLEON_DLG_04] = sUnknown_80D78CC, - [KECLEON_DLG_05] = sUnknown_80D788C, - [KECLEON_DLG_06] = sUnknown_80D785C, - [KECLEON_DLG_07] = sUnknown_80D7830, - [KECLEON_DLG_08] = sUnknown_80D780C, - [KECLEON_DLG_09] = sUnknown_80D77C0, - [KECLEON_DLG_10] = sUnknown_80D776C, - [KECLEON_DLG_11] = sUnknown_80D7740, - [KECLEON_DLG_12] = sUnknown_80D76D4, - [KECLEON_DLG_13] = sUnknown_80D76A8, - [KECLEON_DLG_14] = sUnknown_80D7640, - [KECLEON_DLG_15] = sUnknown_80D7610, - [KECLEON_DLG_16] = sUnknown_80D75E0, - [KECLEON_DLG_17] = sUnknown_80D75AC, - [KECLEON_DLG_18] = sUnknown_80D7560, - [KECLEON_DLG_19] = sUnknown_80D7524, - [KECLEON_DLG_20] = sUnknown_80D74DC, - [KECLEON_DLG_21] = sUnknown_80D7480, - [KECLEON_DLG_22] = sUnknown_80D72B8 - }, - [KECLEON_BROS_MODE_ITEMS_ASLEEP] = { - [KECLEON_DLG_00] = sUnknown_80D72A0, - [KECLEON_DLG_01] = sUnknown_80D7270, - [KECLEON_DLG_02] = sUnknown_80D7250, - [KECLEON_DLG_03] = sUnknown_80D7228, - [KECLEON_DLG_04] = sUnknown_80D7204, - [KECLEON_DLG_05] = sUnknown_80D71CC, - [KECLEON_DLG_06] = sUnknown_80D71B0, - [KECLEON_DLG_07] = sUnknown_80D7184, - [KECLEON_DLG_08] = sUnknown_80D7154, - [KECLEON_DLG_09] = sUnknown_80D7108, - [KECLEON_DLG_10] = sUnknown_80D70B4, - [KECLEON_DLG_11] = sUnknown_80D7090, - [KECLEON_DLG_12] = sUnknown_80D7064, - [KECLEON_DLG_13] = sUnknown_80D7038, - [KECLEON_DLG_14] = sUnknown_80D6FD4, - [KECLEON_DLG_15] = sUnknown_80D6F8C, - [KECLEON_DLG_16] = sUnknown_80D6F4C, - [KECLEON_DLG_17] = sUnknown_80D6F18, - [KECLEON_DLG_18] = sUnknown_80D6EEC, - [KECLEON_DLG_19] = sUnknown_80D6EA4, - [KECLEON_DLG_20] = sUnknown_80D6E78, - [KECLEON_DLG_21] = sUnknown_80D6E30, - [KECLEON_DLG_22] = sUnknown_80D6D98 - }, - [KECLEON_BROS_MODE_WARES_AWAKE] = { - [KECLEON_DLG_00] = sUnknown_80D6D5C, - [KECLEON_DLG_01] = sUnknown_80D6D38, - [KECLEON_DLG_02] = sUnknown_80D6D08, - [KECLEON_DLG_03] = sUnknown_80D6CB8, - [KECLEON_DLG_04] = sUnknown_80D6C90, - [KECLEON_DLG_05] = sUnknown_80D6C48, - [KECLEON_DLG_06] = sUnknown_80D6C1C, - [KECLEON_DLG_07] = sUnknown_80D7830, - [KECLEON_DLG_08] = sUnknown_80D6BF4, - [KECLEON_DLG_09] = sUnknown_80D6BA0, - [KECLEON_DLG_10] = sUnknown_80D6B50, - [KECLEON_DLG_11] = sUnknown_80D6B18, - [KECLEON_DLG_12] = sUnknown_80D6AAC, - [KECLEON_DLG_13] = sUnknown_80D6A74, - [KECLEON_DLG_14] = sUnknown_80D6A04, - [KECLEON_DLG_15] = sUnknown_80D69B0, - [KECLEON_DLG_16] = sUnknown_80D6980, - [KECLEON_DLG_17] = sUnknown_80D6938, - [KECLEON_DLG_18] = sUnknown_80D68E0, - [KECLEON_DLG_19] = sUnknown_80D68A4, - [KECLEON_DLG_20] = sUnknown_80D6868, - [KECLEON_DLG_21] = sUnknown_80D6818, - [KECLEON_DLG_22] = sUnknown_80D6564 - }, - [KECLEON_BROS_MODE_WARES_ASLEEP] = { - [KECLEON_DLG_00] = sUnknown_80D6544, - [KECLEON_DLG_01] = sUnknown_80D652C, - [KECLEON_DLG_02] = sUnknown_80D6508, - [KECLEON_DLG_03] = sUnknown_80D64E8, - [KECLEON_DLG_04] = sUnknown_80D64C0, - [KECLEON_DLG_05] = sUnknown_80D6494, - [KECLEON_DLG_06] = sUnknown_80D6478, - [KECLEON_DLG_07] = sUnknown_80D6450, - [KECLEON_DLG_08] = sUnknown_80D6420, - [KECLEON_DLG_09] = sUnknown_80D63E8, - [KECLEON_DLG_10] = sUnknown_80D6394, - [KECLEON_DLG_11] = sUnknown_80D6364, - [KECLEON_DLG_12] = sUnknown_80D6338, - [KECLEON_DLG_13] = sUnknown_80D630C, - [KECLEON_DLG_14] = sUnknown_80D62B0, - [KECLEON_DLG_15] = sUnknown_80D627C, - [KECLEON_DLG_16] = sUnknown_80D6250, - [KECLEON_DLG_17] = sUnknown_80D6204, - [KECLEON_DLG_18] = sUnknown_80D61D4, - [KECLEON_DLG_19] = sUnknown_80D61B0, - [KECLEON_DLG_20] = sUnknown_80D6168, - [KECLEON_DLG_21] = sUnknown_80D6128, - [KECLEON_DLG_22] = sUnknown_80D6038 - } -}; - -ALIGNED(4) static const u8 sUnknown_80D6038[] = _( - " Zzz... Reep reep...\n" - "Wonder Orbs are convenient...{EXTRA_MSG}" - " Zzzzzz...\n" - "They disappear after one use...{EXTRA_MSG}" - " Zzz... And moves...\n" - "They are ultimate...{EXTRA_MSG}" - " Zzz... Eep...\n" - "Learn moves with Technical Machines...{EXTRA_MSG}" - " Zzz...\n" - "My good wares...\n" - "Come buy... Reep..."); - -ALIGNED(4) static const u8 sUnknown_80D6128[] = _( - " Zzz... Eep? No, no...{WAIT_PRESS}\n" - "You cannot hold any more money..."); - -ALIGNED(4) static const u8 sUnknown_80D6168[] = _( - " Zzz... Hunh? Wha--? Whoa!{WAIT_PRESS}\n" - "I... I can't accept anything like that!"); - -ALIGNED(4) static const u8 sUnknown_80D61B0[] = _( - " Reep...? Eep!{WAIT_PRESS}\n" - "Not enough money!"); - -ALIGNED(4) static const u8 sUnknown_80D61D4[] = _( - " Zzz... Uh-oh...{WAIT_PRESS}\n" - "All gone!\n" - "I am sold out..."); - -ALIGNED(4) static const u8 sUnknown_80D6204[] = _( - " Zzz... Hunh? Oh...{WAIT_PRESS}\n" - "Reep... No room... Reep...\n" - "No room for my wares..."); - -ALIGNED(4) static const u8 sUnknown_80D6250[] = _( - " Zzzzzz... Oh?{WAIT_PRESS}\n" - "You've got nothing..."); - -ALIGNED(4) static const u8 sUnknown_80D627C[] = _( - " Zzz... Oh...?{WAIT_PRESS}\n" - "You have nothing to sell...\n" - "Hunh?"); - -ALIGNED(4) static const u8 sUnknown_80D62B0[] = _( - " Eep...? Zzz...\n" - "You have too much money!{EXTRA_MSG}" - " Zzz... Eh?\n" - "You can't hold any more money..."); - -ALIGNED(4) static const u8 sUnknown_80D630C[] = _( - " Reep eep! Oh?{WAIT_PRESS}\n" - "Eep...?\n" - "You have no money?"); - -ALIGNED(4) static const u8 sUnknown_80D6338[] = _( - " ...{WAIT_PRESS}Zzz...\n" - "I am all sold out... Sorry..."); - -ALIGNED(4) static const u8 sUnknown_80D6364[] = _( - " Fine... Reep reep...\n" - "Done deal!\n" - "Thank you..."); - -ALIGNED(4) static const u8 sUnknown_80D6394[] = _( - " Zzz... Reep, what...?\n" - "For all that I can buy, I will pay\n" - "{COLOR CYAN}{VALUE_0}{RESET} {POKE}... OK?"); - -ALIGNED(4) static const u8 sUnknown_80D63E8[] = _( - " Zzzzzz... Zzzzzz...?\n" - "{COLOR GREEN}{MOVE_ITEM_0}{RESET}?\n" - "Is {COLOR CYAN}{VALUE_0}{RESET} {POKE} OK?"); - -ALIGNED(4) static const u8 sUnknown_80D6420[] = _( - " Reep reep... Eep...\n" - "Anything else for sale?"); - -ALIGNED(4) static const u8 sUnknown_80D6450[] = _( - " Zzz... Eep...?\n" - "What will you sell...?"); - -ALIGNED(4) static const u8 sUnknown_80D6478[] = _( - " Zzz... Reep!\n" - "Thank you..."); - -ALIGNED(4) static const u8 sUnknown_80D6494[] = _( - " Zzzzzz...\n" - "{COLOR GREEN}{MOVE_ITEM_0}{RESET} is {COLOR CYAN}{VALUE_0}{RESET} {POKE}...\n" - "OK?"); - -ALIGNED(4) static const u8 sUnknown_80D64C0[] = _( - " Anything? Zzz...\n" - "Buying anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D64E8[] = _( - " Ah... Zzz...\n" - "My merchandise..."); - -ALIGNED(4) static const u8 sUnknown_80D6508[] = _( - " Thank... Reep eep...\n" - "Come again..."); - -ALIGNED(4) static const u8 sUnknown_80D652C[] = _( - " Reep...\n" - "Anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D6544[] = _( - " Zzzzzz...\n" - "This is...my shop..."); - -ALIGNED(4) static const u8 sUnknown_80D6564[] = _( - " Wonder Orbs are very,\n" - "very convenient〜♪{EXTRA_MSG}" - " However, they disappear\n" - "after one use...{WAIT_PRESS}\n" - "But they are useful in a pinch!{EXTRA_MSG}" - " Use them cleverly, and your\n" - "adventures will be made much easier〜♪{EXTRA_MSG}" - " And moves...{WAIT_PRESS}\n" - "They are the ultimate power!{EXTRA_MSG}" - " Smash rocks!{WAIT_PRESS} Fly!{WAIT_PRESS}\n" - "There are many kinds of moves, all of\n" - "them dynamic, yet elegant!{EXTRA_MSG}" - " There are even moves of\n" - "obscure rarity...{WAIT_PRESS}\n" - "Simply gorgeous, they are!{EXTRA_MSG}" - " Now, we have these moves!{WAIT_PRESS}\n" - "They can be learned using our Technical\n" - "Machines, or TMs for short!{EXTRA_MSG}" - " You see?\n" - "Isn't it exciting? Even dreamy?{EXTRA_MSG}" - " Why, it gets me so excited,\n" - "my color has turned a rosy tint!{EXTRA_MSG}" - " I do hope you will shop\n" - "with us--me and my brother next to\n" - "me!"); - -ALIGNED(4) static const u8 sUnknown_80D6818[] = _( - " Oh, no, no!{WAIT_PRESS}\n" - "My friend, you cannot add to your money!\n" - "I cannot do this."); - -ALIGNED(4) static const u8 sUnknown_80D6868[] = _( - " Whoa, whoa!{WAIT_PRESS}\n" - "I... I can't accept anything like that!"); - -ALIGNED(4) static const u8 sUnknown_80D68A4[] = _( - " Eep! Oh, dear!{WAIT_PRESS}\n" - "You're short on money, my friend!"); - -ALIGNED(4) static const u8 sUnknown_80D68E0[] = _( - " Oh? Uh-oh!{WAIT_PRESS}\n" - "My shelves are bare of wares!{EXTRA_MSG}" - " I am completely sold out,\n" - "my friend!"); - -ALIGNED(4) static const u8 sUnknown_80D6938[] = _( - " Oh, dear me!{WAIT_PRESS}\n" - "My friend, you've run out of space for\n" - "my wares!"); - -ALIGNED(4) static const u8 sUnknown_80D6980[] = _( - " Oh?{WAIT_PRESS}\n" - "My friend, you seem to have nothing?"); - -ALIGNED(4) static const u8 sUnknown_80D69B0[] = _( - " Oh, oh, oh?{WAIT_PRESS}\n" - "My friend, you seem to not have anything\n" - "that you can sell?"); - -ALIGNED(4) static const u8 sUnknown_80D6A04[] = _( - " Oh, my, my!\n" - "My friend, you have too much money!{EXTRA_MSG}" - " You can't carry any more\n" - "money than you have now."); - -ALIGNED(4) static const u8 sUnknown_80D6A74[] = _( - " Oh?{WAIT_PRESS}\n" - "My friend, you seem not to have\n" - "enough money?"); - -ALIGNED(4) static const u8 sUnknown_80D6AAC[] = _( - " ...{WAIT_PRESS}I am all out of wares...\n" - "I am so sorry, my friend...{EXTRA_MSG}" - " Tomorrow!\n" - "Tomorrow I shall have more wares!"); - -ALIGNED(4) static const u8 sUnknown_80D6B18[] = _( - " Fine, fine, we have a deal!\n" - "Thank you so much〜♪ "); - -ALIGNED(4) static const u8 sUnknown_80D6B50[] = _( - " For all that I can buy, I can\n" - "offer you {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" - "Is that acceptable?"); - -ALIGNED(4) static const u8 sUnknown_80D6BA0[] = _( - " {COLOR GREEN}{MOVE_ITEM_0}{RESET}, you say?\n" - "For that, I can offer {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" - "Is that acceptable?"); - -ALIGNED(4) static const u8 sUnknown_80D6BF4[] = _( - " Do you wish to sell me\n" - "anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D6C1C[] = _( - " Thank you so much〜♪\n" - "A very good choice!"); - -ALIGNED(4) static const u8 sUnknown_80D6C48[] = _( - " {COLOR GREEN}{MOVE_ITEM_0}{RESET}, you say?\n" - "That will be {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" - "Is that acceptable?"); - -ALIGNED(4) static const u8 sUnknown_80D6C90[] = _( - " Do you wish to purchase\n" - "anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D6CB8[] = _( - " Ah, very well!\n" - "Do examine my merchandise.\n" - "I have chosen it with pride〜♪ "); - -ALIGNED(4) static const u8 sUnknown_80D6D08[] = _( - " Thank you so much!\n" - "Please do visit again〜♪ "); - -ALIGNED(4) static const u8 sUnknown_80D6D38[] = _( - " May I assist you in any\n" - "other way?"); - -ALIGNED(4) static const u8 sUnknown_80D6D5C[] = _( - " Welcome to Kecleon Wares!\n" - "The shop for Orbs and TMs〜♪ "); - -ALIGNED(4) static const u8 sUnknown_80D6D98[] = _( - " Zzzzzz...\n" - "I sell items...{EXTRA_MSG}" - " Items... Meep meep...\n" - "Are useful in dungeons...{EXTRA_MSG}" - " Use... Zzz... Huh...?\n" - "Your imagination...and be clever...\n" - "With them..."); - -ALIGNED(4) static const u8 sUnknown_80D6E30[] = _( - " Zzz... Hunh, what...?{WAIT_PRESS}\n" - "Zzz... You can't hold any more money..."); - -ALIGNED(4) static const u8 sUnknown_80D6E78[] = _( - " Zzz... Whoa...{WAIT_PRESS}\n" - "I... I can't take that!"); - -ALIGNED(4) static const u8 sUnknown_80D6EA4[] = _( - " Zzz... Huh, my...!{WAIT_PRESS}\n" - "Meep... Meep...\n" - "You don't have enough money!"); - -ALIGNED(4) static const u8 sUnknown_80D6EEC[] = _( - " Zzz... Uh-oh?!{WAIT_PRESS}\n" - "Eep!\n" - "Sold out! All gone!"); - -ALIGNED(4) static const u8 sUnknown_80D6F18[] = _( - " Zzz... Oh, my!{WAIT_PRESS}\n" - "Meep... You have no space..."); - -ALIGNED(4) static const u8 sUnknown_80D6F4C[] = _( - " Zzz... Eep...?{WAIT_PRESS}\n" - "Meep... You don't seem to have\n" - "anything...?"); - -ALIGNED(4) static const u8 sUnknown_80D6F8C[] = _( - " Zzz... Huh?{WAIT_PRESS}\n" - "Meep meep...\n" - "You don't seem to have anything to sell?"); - -ALIGNED(4) static const u8 sUnknown_80D6FD4[] = _( - " Zzz... Oh, my!\n" - "You have so much money...!{EXTRA_MSG}" - " Zzz... Meep...\n" - "You can't carry any more money..."); - -ALIGNED(4) static const u8 sUnknown_80D7038[] = _( - " Hunh?{WAIT_PRESS}\n" - "Eep...?\n" - "You don't have money?"); - -ALIGNED(4) static const u8 sUnknown_80D7064[] = _( - " ...{WAIT_PRESS} ZZZ!\n" - "I'm sold out... Forgive me..."); - -ALIGNED(4) static const u8 sUnknown_80D7090[] = _( - " Done... Meep! Deal!\n" - "Thank you..."); - -ALIGNED(4) static const u8 sUnknown_80D70B4[] = _( - " Zzzzzz... Zzzzzz...?\n" - "I can pay you {COLOR CYAN}{VALUE_0}{RESET} {POKE}\n" - "for everything I can buy... OK?"); - -ALIGNED(4) static const u8 sUnknown_80D7108[] = _( - " Zzzzzz... Zzzzzz...?\n" - "Selling that {COLOR GREEN}{MOVE_ITEM_0}{RESET}...?\n" - "How about {COLOR CYAN}{VALUE_0}{RESET} {POKE}?"); - -ALIGNED(4) static const u8 sUnknown_80D7154[] = _( - " Zzz... Meep...\n" - "Going to sell anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D7184[] = _( - " Zzz... Zzz...?\n" - "You're selling what...?"); - -ALIGNED(4) static const u8 sUnknown_80D71B0[] = _( - " Eep! Wah...?\n" - "Thank you..."); - -ALIGNED(4) static const u8 sUnknown_80D71CC[] = _( - " Zzz... Meep meep...\n" - "{COLOR GREEN}{MOVE_ITEM_0}{RESET}...?\n" - "{COLOR CYAN}{VALUE_0}{RESET} {POKE}, OK?"); - -ALIGNED(4) static const u8 sUnknown_80D7204[] = _( - " Buy? Huh, eep?\n" - "Anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D7228[] = _( - " Zzz... Meep... Eep...\n" - "Look around..."); - -ALIGNED(4) static const u8 sUnknown_80D7250[] = _( - " Thank... Zzz...\n" - "Thank you..."); - -ALIGNED(4) static const u8 sUnknown_80D7270[] = _( - " Zzz... Meep...\n" - "Help you with anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D72A0[] = _( - " Zzzzzz...\n" - "Welcome..."); - -ALIGNED(4) static const u8 sUnknown_80D72B8[] = _( - " We, the {POKEMON_6}\n" - "Brothers, have a passion for selling\n" - "items.{EXTRA_MSG}" - " Items are useful for your\n" - "dungeon adventures.{EXTRA_MSG}" - " Use your imagination and\n" - "discover innovative uses, please.{EXTRA_MSG}" - " Ah, yes.\n" - "If my shop sells out...{EXTRA_MSG}" - " New merchandise will\n" - "arrive the following day.{EXTRA_MSG}" - " Until then, please go to\n" - "a dungeon and spend some time.\n" - "Please visit on your return〜♪{EXTRA_MSG}" - " Ah, yes. The {POKEMON_6}\n" - "Shop is a nationwide chain.{EXTRA_MSG}" - " There are shops even in\n" - "dungeons.\n" - "Please do visit〜♪ "); - -ALIGNED(4) static const u8 sUnknown_80D7480[] = _( - " Oh, my!{WAIT_PRESS}\n" - "You can't add any more to your money.\n" - "I can't complete this deal, sorry."); - -ALIGNED(4) static const u8 sUnknown_80D74DC[] = _( - " Oh, whoa, whoa!{WAIT_PRESS}\n" - "I... I couldn't possibly take that from you!"); - -ALIGNED(4) static const u8 sUnknown_80D7524[] = _( - " Oh, my!{WAIT_PRESS}\n" - "Sorry, but you don't have enough money!"); - -ALIGNED(4) static const u8 sUnknown_80D7560[] = _( - " Uh-oh?!{WAIT_PRESS}\n" - "That's it! No more merchandise!{EXTRA_MSG}" - " I'm completely sold out!"); - -ALIGNED(4) static const u8 sUnknown_80D75AC[] = _( - " Oh, my!{WAIT_PRESS}\n" - "You have no space for any more items!"); - -ALIGNED(4) static const u8 sUnknown_80D75E0[] = _( - " Oh? Oh?{WAIT_PRESS}\n" - "You don't seem to have anything?"); - -ALIGNED(4) static const u8 sUnknown_80D7610[] = _( - " Oh? Oh?{WAIT_PRESS}\n" - "You seem to have nothing to sell?"); - -ALIGNED(4) static const u8 sUnknown_80D7640[] = _( - " Oh, my goodness!\n" - "You're overflowing with money!{EXTRA_MSG}" - " You couldn't possibly carry\n" - "any more money! "); - -ALIGNED(4) static const u8 sUnknown_80D76A8[] = _( - " Huh?{WAIT_PRESS}\n" - "You don't seem to have the money?"); - -ALIGNED(4) static const u8 sUnknown_80D76D4[] = _( - " ...{WAIT_PRESS}I'm sold out...\n" - "Please, forgive me.{EXTRA_MSG}" - " I will have new merchandise\n" - "for you tomorrow, I swear!"); - -ALIGNED(4) static const u8 sUnknown_80D7740[] = _( - " Good! Done deal!\n" - "Thank you so much〜♪ "); - -ALIGNED(4) static const u8 sUnknown_80D776C[] = _( - " For everything I can buy,\n" - "I can offer {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" - "Is that acceptable to you?"); - -ALIGNED(4) static const u8 sUnknown_80D77C0[] = _( - " {COLOR GREEN}{MOVE_ITEM_0}{RESET}?\n" - "I can offer you {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" - "Will you sell it for that price?"); - -ALIGNED(4) static const u8 sUnknown_80D780C[] = _( - " Do you wish to sell\n" - "anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D7830[] = _( - " Ah, very well!\n" - "What do you wish to sell?"); - -ALIGNED(4) static const u8 sUnknown_80D785C[] = _( - " Very well! Thank you〜♪\n" - "It is yours to take!"); - -ALIGNED(4) static const u8 sUnknown_80D788C[] = _( - " {COLOR GREEN}{MOVE_ITEM_0}{RESET}?\n" - "That will be {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" - "Is that to your liking?"); - -ALIGNED(4) static const u8 sUnknown_80D78CC[] = _( - " Do you wish to buy\n" - "anything else today?"); - -ALIGNED(4) static const u8 sUnknown_80D78F8[] = _( - " Ah, very well!\n" - "Feel free to examine my merchandise〜♪"); - -ALIGNED(4) static const u8 sUnknown_80D7934[] = _( - " Thank you!\n" - "Please call again〜♪ "); - -ALIGNED(4) static const u8 sUnknown_80D7958[] = _( - " May I help you with\n" - "anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D797C[] = _( - " Hello〜♪\n" - "Welcome to the {POKEMON_6} Shop〜♪ "); \ No newline at end of file diff --git a/src/data/common_strings_makuhita_dojo.h b/src/data/common_strings_makuhita_dojo.h deleted file mode 100644 index 087995a03..000000000 --- a/src/data/common_strings_makuhita_dojo.h +++ /dev/null @@ -1,202 +0,0 @@ -static const u8 sUnknown_80DA018[]; -static const u8 sUnknown_80DA0DC[]; -static const u8 sUnknown_80DA100[]; -static const u8 sUnknown_80DA204[]; -static const u8 sUnknown_80DA248[]; -static const u8 sUnknown_80DA290[]; -static const u8 sUnknown_80DA2B4[]; -static const u8 sUnknown_80DA2D4[]; -static const u8 sUnknown_80DA2F0[]; -static const u8 sUnknown_80DA30C[]; -static const u8 sUnknown_80DA338[]; -static const u8 sUnknown_80DA62C[]; -static const u8 sUnknown_80DA688[]; -static const u8 sUnknown_80DA844[]; -static const u8 sUnknown_80DA908[]; -static const u8 sUnknown_80DA998[]; -static const u8 sUnknown_80DA9D4[]; -static const u8 sUnknown_80DA9F4[]; -static const u8 sUnknown_80DAA2C[]; -static const u8 sUnknown_80DAA44[]; - -ALIGNED(4) const u8* const gCommonMakuhita[MAKUHITA_DOJO_MODE_COUNT][MAKUHITA_DLG_MAX] = -{ - [MAKUHITA_DOJO_MODE_AWAKE] = { - [MAKUHITA_DLG_0] = sUnknown_80DAA44, - [MAKUHITA_DLG_1] = sUnknown_80DAA2C, - [MAKUHITA_DLG_2] = sUnknown_80DA9F4, - [MAKUHITA_DLG_3] = sUnknown_80DA9D4, - [MAKUHITA_DLG_4] = sUnknown_80DA998, - [MAKUHITA_DLG_5] = sUnknown_80DA908, - [MAKUHITA_DLG_6] = sUnknown_80DA844, - [MAKUHITA_DLG_7] = sUnknown_80DA688, - [MAKUHITA_DLG_8] = sUnknown_80DA62C, - [MAKUHITA_DLG_9] = sUnknown_80DA338 - }, - [MAKUHITA_DOJO_MODE_ASLEEP] = { - [MAKUHITA_DLG_0] = sUnknown_80DA30C, - [MAKUHITA_DLG_1] = sUnknown_80DA2F0, - [MAKUHITA_DLG_2] = sUnknown_80DA2D4, - [MAKUHITA_DLG_3] = sUnknown_80DA2B4, - [MAKUHITA_DLG_4] = sUnknown_80DA290, - [MAKUHITA_DLG_5] = sUnknown_80DA248, - [MAKUHITA_DLG_6] = sUnknown_80DA204, - [MAKUHITA_DLG_7] = sUnknown_80DA100, - [MAKUHITA_DLG_8] = sUnknown_80DA0DC, - [MAKUHITA_DLG_9] = sUnknown_80DA018 - } -}; - -ALIGNED(4) static const u8 sUnknown_80DA018[] = _( - " Zzznarr... Zzz...\n" - "This dojo...\n" - "Help rescue teams...{EXTRA_MSG}" - " Zzznarr... Urr...\n" - "Train in different rooms to level up...{EXTRA_MSG}" - " Zzznarr... Urr!\n" - "Make stronger rescue team...{EXTRA_MSG}" - " Urr... Zzznarr!\n" - "Don't let up!"); - -ALIGNED(4) static const u8 sUnknown_80DA0DC[] = _( - " Zzznarr... Zzz...!\n" - "Keep working..."); - -ALIGNED(4) static const u8 sUnknown_80DA100[] = _( - " Ah... Zzznarr...\n" - "Cleared it...{EXTRA_MSG}" - " Zzzznarr... Urr...\n" - "Good going... Keep going...{WAIT_PRESS}\n" - "Hunh...{WAIT_PRESS} ...{EXTRA_MSG}" - " Gwoh?{WAIT_PRESS}\n" - "Gwogwogwoh?{EXTRA_MSG}" - " Mugawah?\n" - "Cleared everything?{EXTRA_MSG}" - " Zzznarr!\n" - "Congrazzz...{EXTRA_MSG}" - " Zzznarr... Zzznarr...\n" - "Your reward...\n" - "Promised...{EXTRA_MSG}" - " Zzz... Urr!\n" - "{COLOR GREEN_I}Bonsly Doll{RESET}..."); - -ALIGNED(4) static const u8 sUnknown_80DA204[] = _( - " Ah... Zzznarr...\n" - "Cleared it...{EXTRA_MSG}" - " Congrazzz...\n" - "Keep going... Zzz..."); - -ALIGNED(4) static const u8 sUnknown_80DA248[] = _( - " Aiyah... Zzznarr...\n" - "Didn't finish...{EXTRA_MSG}" - " Zzz... Urr?\n" - "No giving up..."); - -ALIGNED(4) static const u8 sUnknown_80DA290[] = _( - " Zzz... Narr...\n" - "{POKEMON_0}? 'K, go..."); - -ALIGNED(4) static const u8 sUnknown_80DA2B4[] = _( - " Zzznarr... Zzz...\n" - "Train where?"); - -ALIGNED(4) static const u8 sUnknown_80DA2D4[] = _( - " Urr... Narr...\n" - "See you..."); - -ALIGNED(4) static const u8 sUnknown_80DA2F0[] = _( - " Zzznarr... Urr?\n" - "What else?"); - -ALIGNED(4) static const u8 sUnknown_80DA30C[] = _( - " Zzznarr... Zzznarr...\n" - "Makuhita... Dojo..."); - -ALIGNED(4) static const u8 sUnknown_80DA338[] = _( - " This dojo was founded to\n" - "support the efforts of rescue teams.{EXTRA_MSG}" - " Train in different rooms to\n" - "level up...{WAIT_PRESS}\n" - "And toughen up your rescue team.{EXTRA_MSG}" - " Also...{WAIT_PRESS}\n" - "In the {COLOR YELLOW_D}Fire Maze{RESET} you will find only\n" - "Fire-type PokĂ©mon.{EXTRA_MSG}" - " In the {COLOR YELLOW_D}Water Maze{RESET} there\n" - "will only be Water-type PokĂ©mon.{EXTRA_MSG}" - " In such ways, only one type\n" - "of PokĂ©mon will be in a given room.\n" - "Study how types match up in battle.{EXTRA_MSG}" - " The PokĂ©mon in this dojo,\n" - "by the way, are all volunteers.{EXTRA_MSG}" - " They are participating\n" - "because they want to see rescue teams\n" - "succeed.{EXTRA_MSG}" - " The only thanks they expect\n" - "is to see you become stronger.\n" - "Don't let them down!{EXTRA_MSG}" - " There's more.{WAIT_PRESS}\n" - "For a rescue team that successfully\n" - "completes all training courses...{EXTRA_MSG}" - " I have a special reward!{EXTRA_MSG}" - " Let that compel you to train\n" - "harder!"); - -ALIGNED(4) static const u8 sUnknown_80DA62C[] = _( - " Don't let up on your training!\n" - "Keep bettering yourself!{EXTRA_MSG}" - " May you never lose your\n" - "drive!"); - -ALIGNED(4) static const u8 sUnknown_80DA688[] = _( - " Ah...\n" - "You have succeeded in your training!{EXTRA_MSG}" - " You've shown your worth!{WAIT_PRESS}\n" - "Without a doubt, you have grown more\n" - "powerful from your training!{WAIT_PRESS} Wait...{WAIT_PRESS} ...{EXTRA_MSG}" - " Wuh?{WAIT_PRESS}\n" - "What, what, what?!{EXTRA_MSG}" - " Did you maybe...{WAIT_PRESS}\n" - "Conquer all the training courses?{EXTRA_MSG}" - " That's...{WAIT_PRESS} Amazing! You!{WAIT_PRESS}\n" - "Congratulations!{EXTRA_MSG}" - " I promised!{WAIT_PRESS}\n" - "I promised you a reward for completing\n" - "the training courses!{EXTRA_MSG}" - " So... Here it is!{WAIT_PRESS}\n" - "My {COLOR GREEN_I}Bonsly Doll{RESET}!{EXTRA_MSG}" - " Isn't it smashing? Hey?!"); - -ALIGNED(4) static const u8 sUnknown_80DA844[] = _( - " Ah...\n" - "You have succeeded in your training!{EXTRA_MSG}" - " You've shown your worth!{WAIT_PRESS}\n" - "Without a doubt, you have grown more\n" - "powerful from your training!{EXTRA_MSG}" - " May this success drive\n" - "you to train even harder!"); - -ALIGNED(4) static const u8 sUnknown_80DA908[] = _( - " Aiyah...{WAIT_PRESS}\n" - "You failed to reach the end...{WAIT_PRESS}\n" - "More training is what you need.{EXTRA_MSG}" - " But effort is never wasted!{EXTRA_MSG}" - " Learn from this and move\n" - "forward!"); - -ALIGNED(4) static const u8 sUnknown_80DA998[] = _( - " The {POKEMON_0}?{WAIT_PRESS}\n" - "Your decision stands!{WAIT_PRESS}\n" - "Let the training begin!"); - -ALIGNED(4) static const u8 sUnknown_80DA9D4[] = _(" Where do you wish to train?"); - -ALIGNED(4) static const u8 sUnknown_80DA9F4[] = _( - " Fine, farewell.\n" - "Return if you seek more training."); - -ALIGNED(4) static const u8 sUnknown_80DAA2C[] = _(" What else do you seek?"); - -ALIGNED(4) static const u8 sUnknown_80DAA44[] = _( - " This is the Makuhita Dojo!{WAIT_PRESS}\n" - "Through rigorous training, one begets\n" - "true power."); \ No newline at end of file diff --git a/src/data/common_strings_wigglytuff_shop.h b/src/data/common_strings_wigglytuff_shop.h deleted file mode 100644 index a3a37e054..000000000 --- a/src/data/common_strings_wigglytuff_shop.h +++ /dev/null @@ -1,320 +0,0 @@ -static const u8 sUnknown_80D7A44[]; -static const u8 sUnknown_80D7C94[]; -static const u8 sUnknown_80D7CE8[]; -static const u8 sUnknown_80D7D64[]; -static const u8 sUnknown_80D7DA0[]; -static const u8 sUnknown_80D7DE0[]; -static const u8 sUnknown_80D7E04[]; -static const u8 sUnknown_80D7E2C[]; -static const u8 sUnknown_80D7E58[]; -static const u8 sUnknown_80D7E9C[]; -static const u8 sUnknown_80D7ED0[]; -static const u8 sUnknown_80D7F10[]; -static const u8 sUnknown_80D7F7C[]; -static const u8 sUnknown_80D8000[]; -static const u8 sUnknown_80D8030[]; -static const u8 sUnknown_80D8054[]; -static const u8 sUnknown_80D8080[]; -static const u8 sUnknown_80D80B0[]; -static const u8 sUnknown_80D80D4[]; -static const u8 sUnknown_80D8104[]; -static const u8 sUnknown_80D8420[]; -static const u8 sUnknown_80D8468[]; -static const u8 sUnknown_80D84F8[]; -static const u8 sUnknown_80D8528[]; -static const u8 sUnknown_80D8550[]; -static const u8 sUnknown_80D8584[]; -static const u8 sUnknown_80D85AC[]; -static const u8 sUnknown_80D85E4[]; -static const u8 sUnknown_80D8620[]; -static const u8 sUnknown_80D8644[]; -static const u8 sUnknown_80D8674[]; -static const u8 sUnknown_80D86E4[]; -static const u8 sUnknown_80D8738[]; -static const u8 sUnknown_80D876C[]; -static const u8 sUnknown_80D8798[]; -static const u8 sUnknown_80D87E0[]; -static const u8 sUnknown_80D8818[]; -static const u8 sUnknown_80D883C[]; - -ALIGNED(4) const u8* const gCommonWigglytuff[WIGGLYTUFF_SHOP_MODE_COUNT][WIGGLY_DLG_MAX] = -{ - [WIGGLYTUFF_SHOP_MODE_AWAKE] = { - [WIGGLY_DLG_00] = sUnknown_80D883C, - [WIGGLY_DLG_01] = sUnknown_80D8818, - [WIGGLY_DLG_02] = sUnknown_80D87E0, - [WIGGLY_DLG_03] = sUnknown_80D8798, - [WIGGLY_DLG_04] = sUnknown_80D876C, - [WIGGLY_DLG_05] = sUnknown_80D8738, - [WIGGLY_DLG_06] = sUnknown_80D86E4, - [WIGGLY_DLG_07] = sUnknown_80D8674, - [WIGGLY_DLG_08] = sUnknown_80D8644, - [WIGGLY_DLG_09] = sUnknown_80D8620, - [WIGGLY_DLG_10] = sUnknown_80D85E4, - [WIGGLY_DLG_11] = sUnknown_80D85AC, - [WIGGLY_DLG_12] = sUnknown_80D8584, - [WIGGLY_DLG_13] = sUnknown_80D8550, - [WIGGLY_DLG_14] = sUnknown_80D8528, - [WIGGLY_DLG_15] = sUnknown_80D84F8, - [WIGGLY_DLG_16] = sUnknown_80D8468, - [WIGGLY_DLG_17] = sUnknown_80D8420, - [WIGGLY_DLG_18] = sUnknown_80D8420, - [WIGGLY_DLG_19] = sUnknown_80D8104 - }, - [WIGGLYTUFF_SHOP_MODE_ASLEEP] = { - [WIGGLY_DLG_00] = sUnknown_80D80D4, - [WIGGLY_DLG_01] = sUnknown_80D80B0, - [WIGGLY_DLG_02] = sUnknown_80D8080, - [WIGGLY_DLG_03] = sUnknown_80D8054, - [WIGGLY_DLG_04] = sUnknown_80D8030, - [WIGGLY_DLG_05] = sUnknown_80D8000, - [WIGGLY_DLG_06] = sUnknown_80D7F7C, - [WIGGLY_DLG_07] = sUnknown_80D7F10, - [WIGGLY_DLG_08] = sUnknown_80D7ED0, - [WIGGLY_DLG_09] = sUnknown_80D7E9C, - [WIGGLY_DLG_10] = sUnknown_80D7E58, - [WIGGLY_DLG_11] = sUnknown_80D7E2C, - [WIGGLY_DLG_12] = sUnknown_80D7E04, - [WIGGLY_DLG_13] = sUnknown_80D7DE0, - [WIGGLY_DLG_14] = sUnknown_80D7DA0, - [WIGGLY_DLG_15] = sUnknown_80D7D64, - [WIGGLY_DLG_16] = sUnknown_80D7CE8, - [WIGGLY_DLG_17] = sUnknown_80D7C94, - [WIGGLY_DLG_18] = sUnknown_80D7C94, - [WIGGLY_DLG_19] = sUnknown_80D7A44 - } -}; - -ALIGNED(4) static const u8 sUnknown_80D7A44[] = _( - " Zzz...\n" - "Want more friends?{EXTRA_MSG}" - " Zzz... Kwoo...\n" - "You need Friend Areas for friends...{EXTRA_MSG}" - " Zzz... Zzz...\n" - "A PokĂ©mon becomes your pal when it's in\n" - "the right Friend Area...{EXTRA_MSG}" - " Zzz... Dwee...\n" - "That's why you should get more Friend\n" - "Areas...{EXTRA_MSG}" - " Zzz... PokĂ©mon can only\n" - "live in the right Friend Area for\n" - "their species...{EXTRA_MSG}" - " Kwoo... Sssnore...\n" - "See what PokĂ©mon can live there by\n" - "checking {COLOR YELLOW}Info{RESET}...{EXTRA_MSG}" - " Zzz...\n" - "I don't sell some Friend Areas...{EXTRA_MSG}" - " Kwoo...\n" - "Some rescue missions reward you with\n" - "Friend Areas...{EXTRA_MSG}" - " Zzz... Dwee...\n" - "Check the Pelipper Post Office's Bulletin\n" - "Board or your Mailbox for missions..."); - -ALIGNED(4) static const u8 sUnknown_80D7C94[] = _( - " Sssnore...\n" - "{COLOR GREEN}{FRIEND_AREA}{RESET}...?\n" - "I can't get that Friend Area...{EXTRA_MSG}" - " Zzz... Zzz...\n" - "Sorry..."); - -ALIGNED(4) static const u8 sUnknown_80D7CE8[] = _( - " Zzz... Hunh...?\n" - "{COLOR GREEN}{FRIEND_AREA}{RESET}...?\n" - "I don't know... I'll check...{EXTRA_MSG}" - " Sssnore...\n" - "I'll have it for sale...\n" - "When I find out..."); - -ALIGNED(4) static const u8 sUnknown_80D7D64[] = _( - " Sssnore...\n" - "You can already go...\n" - "Friend Area {COLOR GREEN}{FRIEND_AREA}{RESET}..."); - -ALIGNED(4) static const u8 sUnknown_80D7DA0[] = _( - " Dwee... Kwoo...\n" - "{COLOR CYAN}{POKEMON_0}{RESET}'s Friend Area...\n" - "Zzz... {COLOR GREEN}{FRIEND_AREA}{RESET}..."); - -ALIGNED(4) static const u8 sUnknown_80D7DE0[] = _( - " Another PokĂ©mon...\n" - "Zzz... Check?"); - -ALIGNED(4) static const u8 sUnknown_80D7E04[] = _( - " Zzz... Kwoo...\n" - "Check which PokĂ©mon?"); - -ALIGNED(4) static const u8 sUnknown_80D7E2C[] = _( - " Zzz... Dwee...? Oops?{WAIT_PRESS}\n" - "Not enough money?"); - -ALIGNED(4) static const u8 sUnknown_80D7E58[] = _( - " Zzz... Hunh?{WAIT_PRESS}\n" - "Sssnore... Sorry...\n" - "Fresh out of Friend Areas..."); - -ALIGNED(4) static const u8 sUnknown_80D7E9C[] = _( - " Hunh...?{WAIT_PRESS}\n" - "You don't have any money...\n" - "Zzzzzz..."); - -ALIGNED(4) static const u8 sUnknown_80D7ED0[] = _( - " Zzz... Zzz?{WAIT_PRESS}\n" - "Hunh...?\n" - "You can't add to your Friend Areas..."); - -ALIGNED(4) static const u8 sUnknown_80D7F10[] = _( - " Grats... Zzz...{WAIT_PRESS}\n" - "You can go to {COLOR GREEN}{FRIEND_AREA}{RESET}...{EXTRA_MSG}" - " Dwee... Sssnore...\n" - "Make friends with PokĂ©mon in...\n" - "{COLOR GREEN}{FRIEND_AREA}{RESET}..."); - -ALIGNED(4) static const u8 sUnknown_80D7F7C[] = _( - " Zzz... Dwee... Gotcha...{WAIT_PRESS}\n" - "Zzz... Let's do it...{EXTRA_MSG}" - " Sssnore♪ Sssnore♪\n" - "{POKEMON_6}〜♪ {POKEMON_6}〜♪\n" - "Let's be friends...{EXTRA_MSG}" - " Kwoo!\n" - "Taaaaaaah!"); - -ALIGNED(4) static const u8 sUnknown_80D8000[] = _( - " Kwoo? {COLOR GREEN}{FRIEND_AREA}{RESET}?\n" - "That's {COLOR CYAN}{VALUE_0}{RESET} {POKE}...\n" - "OK?"); - -ALIGNED(4) static const u8 sUnknown_80D8030[] = _( - " Zzz... Wha--?\n" - "More Friend Areas?"); - -ALIGNED(4) static const u8 sUnknown_80D8054[] = _( - " Dwee... Hunh?\n" - "Friend Areas...?\n" - "Which one?"); - -ALIGNED(4) static const u8 sUnknown_80D8080[] = _( - " Thank... Zzz... You...\n" - "Friends, friend..."); - -ALIGNED(4) static const u8 sUnknown_80D80B0[] = _( - " Anything? Kwoo...\n" - "Anything else?"); - -ALIGNED(4) static const u8 sUnknown_80D80D4[] = _( - " Friends... Zzz...\n" - "Welcome to the {POKEMON_6} Club..."); - -ALIGNED(4) static const u8 sUnknown_80D8104[] = _( - " Would you like to get more\n" - "friends...{WAIT_PRESS}\n" - "...More members for your team?{EXTRA_MSG}" - " To add new friends, what\n" - "you need are Friend Areas.{EXTRA_MSG}" - " A PokĂ©mon can join your\n" - "rescue team only after it settles in\n" - "the right Friend Area.{EXTRA_MSG}" - " So, if you want to recruit\n" - "new members, you should add to your\n" - "Friend Areas.{EXTRA_MSG}" - " Oh, yes, PokĂ©mon can\n" - "only live in the right Friend Area for\n" - "their species.{EXTRA_MSG}" - " If you're buying a Friend\n" - "Area, you should confirm what PokĂ©mon\n" - "can live there by checking {COLOR YELLOW}Info{RESET}.{EXTRA_MSG}" - " Also, there are some Friend\n" - "Areas that I don't sell.{EXTRA_MSG}" - " I think there are some\n" - "rescue missions that give you access\n" - "to Friend Areas, too.{EXTRA_MSG}" - " You should check the\n" - "Pelipper Post Office's Bulletin Board or\n" - "your Mailbox for rescue requests.{EXTRA_MSG}" - " You know, it makes me\n" - "delighted when you make new friends!"); - -ALIGNED(4) static const u8 sUnknown_80D8420[] = _( - " {COLOR GREEN}{FRIEND_AREA}{RESET}?\n" - "I can't get that Friend Area for you.{WAIT_PRESS}\n" - "I'm really sorry."); - -ALIGNED(4) static const u8 sUnknown_80D8468[] = _( - " {COLOR GREEN}{FRIEND_AREA}{RESET}?\n" - "I don't know much about it at all.{WAIT_PRESS}\n" - "I'll check up on it.{EXTRA_MSG}" - " I'll add it to the Friend\n" - "Areas you can buy when I find out more."); - -ALIGNED(4) static const u8 sUnknown_80D84F8[] = _( - " You can already go to the\n" - "Friend Area {COLOR GREEN}{FRIEND_AREA}{RESET}."); - -ALIGNED(4) static const u8 sUnknown_80D8528[] = _( - " {COLOR CYAN}{POKEMON_0}{RESET}'s Friend Area\n" - "is {COLOR GREEN}{FRIEND_AREA}{RESET}."); - -ALIGNED(4) static const u8 sUnknown_80D8550[] = _( - " Is there another PokĂ©mon\n" - "you'd like to check?"); - -ALIGNED(4) static const u8 sUnknown_80D8584[] = _( - " Which PokĂ©mon would you\n" - "like to check?"); - -ALIGNED(4) static const u8 sUnknown_80D85AC[] = _( - " Oops?{WAIT_PRESS}\n" - "It doesn't look like you have enough\n" - "money!"); - -ALIGNED(4) static const u8 sUnknown_80D85E4[] = _( - " Oops?{WAIT_PRESS}\n" - "Oh, too bad.{WAIT_PRESS}\n" - "I'm fresh out of Friend Areas."); - -ALIGNED(4) static const u8 sUnknown_80D8620[] = _( - " Um?{WAIT_PRESS}\n" - "You don't have any money."); - -ALIGNED(4) static const u8 sUnknown_80D8644[] = _( - " Oops!{WAIT_PRESS}\n" - "You can't add to your Friend Areas."); - -ALIGNED(4) static const u8 sUnknown_80D8674[] = _( - " Congratulations!{WAIT_PRESS}\n" - "You can go to {COLOR GREEN}{FRIEND_AREA}{RESET} now!{EXTRA_MSG}" - " You can recruit\n" - "PokĂ©mon that live in the Friend Area\n" - "{COLOR GREEN}{FRIEND_AREA}{RESET}."); - -ALIGNED(4) static const u8 sUnknown_80D86E4[] = _( - " Gotcha! Let's do it!{WAIT_PRESS}\n" - "{POKEMON_6}〜♪ {POKEMON_6}〜♪{WAIT_PRESS}\n" - "Let's be friends... Yoomtaaaaaaah!"); - -ALIGNED(4) static const u8 sUnknown_80D8738[] = _( - " {COLOR GREEN}{FRIEND_AREA}{RESET}?\n" - "That will be {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" - "Is that OK?"); - -ALIGNED(4) static const u8 sUnknown_80D876C[] = _( - " Would you like to add\n" - "other Friend Areas?"); - -ALIGNED(4) static const u8 sUnknown_80D8798[] = _( - " You'd like to add to your\n" - "Friend Areas?\n" - "Which one would you like?"); - -ALIGNED(4) static const u8 sUnknown_80D87E0[] = _( - " Thank you! Come again!\n" - "We're all friends, friend!"); - -ALIGNED(4) static const u8 sUnknown_80D8818[] = _( - " Anything else I can do for\n" - "you?"); - -ALIGNED(4) static const u8 sUnknown_80D883C[] = _( - " Friends are my treasures!\n" - "Welcome to the {POKEMON_6} Club--\n" - "a circle of friends! "); \ No newline at end of file diff --git a/src/data/debug_menu1.h b/src/data/debug_menu1.h index 0a353c684..5dde96b47 100644 --- a/src/data/debug_menu1.h +++ b/src/data/debug_menu1.h @@ -1,7 +1,4 @@ -ALIGNED(4) static const u8 sFill[] = _("pksdir0"); - -static const UnkTextStruct2 sUnknown_80E7D40 = -{ +static const UnkTextStruct2 sUnknown_80E7D40 = { 0, 0, 0, 0, 3, 0, 0, @@ -9,8 +6,7 @@ static const UnkTextStruct2 sUnknown_80E7D40 = 0, 0, NULL }; -static const UnkTextStruct2 sUnknown_80E7D58 = -{ +static const UnkTextStruct2 sUnknown_80E7D58 = { 0, 0, 0, 0, 3, 2, 2, @@ -19,22 +15,13 @@ static const UnkTextStruct2 sUnknown_80E7D58 = NULL }; -static const MenuItem sDebugMenuItems[8] = -{ - {"Dungeons", MENU_DEBUG_MENU_DUNGEONS}, - {"Field", MENU_DEBUG_MENU_FIELD}, - {"Field Map", MENU_DEBUG_MENU_FIELD_MAP}, - {"Field Script", MENU_DEBUG_MENU_FIELD_SCRIPT}, - {"Debug Menu", MENU_DEBUG_MENU_DEBUG_MENU}, - {"Storage", MENU_DEBUG_MENU_STORAGE}, - {"h-open", MENU_DEBUG_MENU_H_OPEN}, +static const MenuItem sDebugMenuItems[] = { + {_("Dungeons"), MENU_DEBUG_MENU_DUNGEONS}, + {_("Field"), MENU_DEBUG_MENU_FIELD}, + {_("Field Map"), MENU_DEBUG_MENU_FIELD_MAP}, + {_("Field Script"), MENU_DEBUG_MENU_FIELD_SCRIPT}, + {_("Debug Menu"), MENU_DEBUG_MENU_DEBUG_MENU}, + {_("Storage"), MENU_DEBUG_MENU_STORAGE}, + {_("h-open"), MENU_DEBUG_MENU_H_OPEN}, {NULL, 10}, -}; - -// TODO: These belong to files after, which have no data. More stripped-out debug menus..? They'd be between debug_menu1.c and debug_menu2.c -ALIGNED(4) static const u8 sFill1[] = _("pksdir0"); -ALIGNED(4) static const u8 sFill2[] = _("pksdir0"); -ALIGNED(4) static const u8 sFill3[] = _("pksdir0"); -ALIGNED(4) static const u8 sFill4[] = _("pksdir0"); -ALIGNED(4) static const u8 sFill5[] = _("pksdir0"); -ALIGNED(4) static const u8 sFill6[] = _("pksdir0"); \ No newline at end of file +}; \ No newline at end of file diff --git a/src/data/friend_rescue_menus.h b/src/data/friend_rescue_menus.h index 4ec4366f1..250e0f916 100644 --- a/src/data/friend_rescue_menus.h +++ b/src/data/friend_rescue_menus.h @@ -1,150 +1,107 @@ -extern const u8 GoRescue_80E20AC[]; -extern const u8 GetHelp_80E20A0[]; -extern const u8 Info_80E2098[]; -extern const u8 Exit_80E2090[]; - -const MenuItem gUnknown_80E2068[5] = { - {GoRescue_80E20AC, 0x0}, - {GetHelp_80E20A0, 0x1}, - {Info_80E2098, 0x17}, - {Exit_80E2090, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E2068[] = { + {_("Go Rescue"), 0}, + {_("Get Help"), 1}, + {_("Info"), 23}, + {_("Exit"), 8}, + {NULL, 8}, }; -const u8 Exit_80E2090[] = "Exit"; -const u8 Info_80E2098[] = "Info"; -const u8 GetHelp_80E20A0[] = "Get Help"; -const u8 GoRescue_80E20AC[] = "Go Rescue"; - -const MenuItem gUnknown_80E20B8[5] = { - {GoRescue_80E20AC, 0x0}, - {GetHelp_80E20A0, -1}, - {Info_80E2098, 0x17}, - {Exit_80E2090, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E20B8[] = { + {_("Go Rescue"), 0}, + {_("Get Help"), -1}, + {_("Info"), 23}, + {_("Exit"), 8}, + {NULL, 8}, }; -const MenuItem gUnknown_80E20E0[5] = { - {GoRescue_80E20AC, -1}, - {GetHelp_80E20A0, 1}, - {Info_80E2098, 0x17}, - {Exit_80E2090, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E20E0[] = { + {_("Go Rescue"), -1}, + {_("Get Help"), 1}, + {_("Info"), 23}, + {_("Exit"), 8}, + {NULL, 8}, }; -const MenuItem gUnknown_80E2108[5] = { - {GoRescue_80E20AC, -1}, - {GetHelp_80E20A0, -1}, - {Info_80E2098, 0x17}, - {Exit_80E2090, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E2108[] = { + {_("Go Rescue"), -1}, + {_("Get Help"), -1}, + {_("Info"), 23}, + {_("Exit"), 8}, + {NULL, 8}, }; -extern const u8 ReceiveSOSMail_80E217C[]; -extern const u8 SendAOKMail_80E216C[]; -extern const u8 GetThankYouMail_80E2158[]; - -const MenuItem gUnknown_80E2130[5] = { - {ReceiveSOSMail_80E217C, 3}, - {SendAOKMail_80E216C, 4}, - {GetThankYouMail_80E2158, 0x14}, - {Exit_80E2090, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E2130[] = { + {_("Receive SOS Mail"), 3}, + {_("Send A-OK Mail"), 4}, + {_("Get Thank-You Mail"), 20}, + {_("Exit"), 8}, + {NULL, 8}, }; -const u8 GetThankYouMail_80E2158[] = "Get Thank-You Mail"; -const u8 SendAOKMail_80E216C[] = "Send A-OK Mail"; -const u8 ReceiveSOSMail_80E217C[] = "Receive SOS Mail"; - -const MenuItem gUnknown_80E2190[5] = { - {ReceiveSOSMail_80E217C, 3}, - {SendAOKMail_80E216C, -1}, - {GetThankYouMail_80E2158, 0x14}, - {Exit_80E2090, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E2190[] = { + {_("Receive SOS Mail"), 3}, + {_("Send A-OK Mail"), -1}, + {_("Get Thank-You Mail"), 20}, + {_("Exit"), 8}, + {NULL, 8}, }; -extern const u8 SendSOS_80E2208[]; -extern const u8 ReceiveAOK_80E21F4[]; -extern const u8 SendThankYou_80E21E0[]; - - -const MenuItem gUnknown_80E21B8[5] = { - {SendSOS_80E2208, 0x11}, - {ReceiveAOK_80E21F4, 0x12}, - {SendThankYou_80E21E0, 0x13}, - {Exit_80E2090, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E21B8[] = { + {_("Send SOS Mail"), 17}, + {_("Receive A-OK Mail"), 18}, + {_("Send Thank-You Mail"), 19}, + {_("Exit"), 8}, + {NULL, 8}, }; -const u8 SendThankYou_80E21E0[] = "Send Thank-You Mail"; -const u8 ReceiveAOK_80E21F4[] = "Receive A-OK Mail"; -const u8 SendSOS_80E2208[] = "Send SOS Mail"; - -const MenuItem gUnknown_80E2218[5] = { - {SendSOS_80E2208, -1}, - {ReceiveAOK_80E21F4, -1}, - {SendThankYou_80E21E0, 0x13}, - {Exit_80E2090, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E2218[] = { + {_("Send SOS Mail"), -1}, + {_("Receive A-OK Mail"), -1}, + {_("Send Thank-You Mail"), 19}, + {_("Exit"), 8}, + {NULL, 8}, }; -const MenuItem gUnknown_80E2240[5] = { - {SendSOS_80E2208, 0x11}, - {ReceiveAOK_80E21F4, 0x12}, - {SendThankYou_80E21E0, -1}, - {Exit_80E2090, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E2240[] = { + {_("Send SOS Mail"), 17}, + {_("Receive A-OK Mail"), 18}, + {_("Send Thank-You Mail"), -1}, + {_("Exit"), 8}, + {NULL, 8}, }; -const MenuItem gUnknown_80E2268[5] = { - {SendSOS_80E2208, -1}, - {ReceiveAOK_80E21F4, -1}, - {SendThankYou_80E21E0, -1}, - {Exit_80E2090, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E2268[] = { + {_("Send SOS Mail"), -1}, + {_("Receive A-OK Mail"), -1}, + {_("Send Thank-You Mail"), -1}, + {_("Exit"), 8}, + {NULL, 8}, }; -extern const u8 Yes_80E22B0[]; -extern const u8 Cancel_80E22A8[]; - - -const MenuItem gUnknown_80E2290[3] = { - {Yes_80E22B0, 6}, - {Cancel_80E22A8, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E2290[] = { + {_("Yes"), 6}, + {_("Cancel"), 8}, + {NULL, 8}, }; -const u8 Cancel_80E22A8[] = "Cancel"; -const u8 Yes_80E22B0[] = "Yes"; - - -extern const u8 No_80E22CC[]; - -const MenuItem gUnknown_80E22B4[3] = { - {Yes_80E22B0, 6}, - {No_80E22CC, 7}, - {NULL, 0x8}, +const MenuItem gUnknown_80E22B4[] = { + {_("Yes"), 6}, + {_("No"), 7}, + {NULL, 8}, }; -const u8 No_80E22CC[] = "No"; - -const MenuItem gUnknown_80E22D0[4] = { - {Yes_80E22B0, 6}, - {No_80E22CC, 7}, - {Cancel_80E22A8, 8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E22D0[] = { + {_("Yes"), 6}, + {_("No"), 7}, + {_("Cancel"), 8}, + {NULL, 8}, }; -extern const u8 SendPokemon_80E2308[]; - -const MenuItem gUnknown_80E22F0[3] = { - {SendPokemon_80E2308, 0x10}, - {Cancel_80E22A8, 8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E22F0[] = { + {_("Send w/o PokĂ©mon"), 16}, + {_("Cancel"), 8}, + {NULL, 8}, }; -const u8 SendPokemon_80E2308[] = _("Send w/o PokĂ©mon"); - const UnkTextStruct2 gUnknown_80E231C = { 0x00, 0x00, 0x00, 0x00, @@ -165,42 +122,26 @@ const UnkTextStruct2 gUnknown_80E2334 = NULL }; -extern const u8 Confirm_80E2364[]; - -const MenuItem gUnknown_80E234C[3] = { - {Confirm_80E2364, 9}, - {Info_80E2098, 10}, - {NULL, 0x8}, +const MenuItem gUnknown_80E234C[] = { + {_("Confirm"), 9}, + {_("Info"), 10}, + {NULL, 8}, }; -const u8 Confirm_80E2364[] = "Confirm"; - -extern const u8 GameLinkCable_80E2398[]; -extern const u8 Password_80E238C[]; - -const MenuItem gUnknown_80E236C[4] = { - {GameLinkCable_80E2398, 0xB}, - {Password_80E238C, 0xD}, - {Cancel_80E22A8, 8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E236C[] = { + {_("Game Link cable"), 11}, + {_("Password"), 13}, + {_("Cancel"), 8}, + {NULL, 8}, }; -const u8 Password_80E238C[] = "Password"; -const u8 GameLinkCable_80E2398[] = "Game Link cable"; - -extern const u8 SendPokemon_80E23E0[]; -extern const u8 DontSendPokemon_80E23C8[]; - -const MenuItem gUnknown_80E23A8[4] = { - {SendPokemon_80E23E0, 0xF}, - {DontSendPokemon_80E23C8, 0x10}, - {Cancel_80E22A8, 8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E23A8[] = { + {_("Send PokĂ©mon"), 15}, + {_("Don't Send PokĂ©mon"), 16}, + {_("Cancel"), 8}, + {NULL, 8}, }; -ALIGNED(4) const u8 DontSendPokemon_80E23C8[] = _("Don't Send PokĂ©mon"); -ALIGNED(4) const u8 SendPokemon_80E23E0[] = _("Send PokĂ©mon"); - const UnkTextStruct2 gUnknown_80E23F0 = { 0x00, 0x00, 0x00, 0x00, @@ -211,14 +152,14 @@ const UnkTextStruct2 gUnknown_80E23F0 = NULL }; -const MenuItem gUnknown_80E2408[4] = { - {Confirm_80E2364, 0x9}, - {Info_80E2098, 0xA}, - {Cancel_80E22A8, 5}, - {NULL, 0x8}, +const MenuItem gUnknown_80E2408[] = { + {_("Confirm"), 9}, + {_("Info"), 10}, + {_("Cancel"), 5}, + {NULL, 8}, }; -UNUSED static const UnkTextStruct2 unused_text = +UNUSED static const UnkTextStruct2 sUnused = { 0x00, 0x00, 0x00, 0x00, 0x03, @@ -228,89 +169,61 @@ UNUSED static const UnkTextStruct2 unused_text = NULL }; -const MenuItem gUnknown_80E2440[3] = { - {Yes_80E22B0, 6}, - {Cancel_80E22A8, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E2440[] = { + {_("Yes"), 6}, + {_("Cancel"), 8}, + {NULL, 8}, }; -const MenuItem gUnknown_80E2458[3] = { - {Yes_80E22B0, 6}, - {No_80E22CC, 0x7}, - {NULL, 0x8}, +const MenuItem gUnknown_80E2458[] = { + {_("Yes"), 6}, + {_("No"), 7}, + {NULL, 8}, }; -extern const u8 SendItem_80E24A4[]; -extern const u8 DontSendItem_80E2490[]; - -const MenuItem gUnknown_80E2470[4] = { - {SendItem_80E24A4, 0x15}, - {DontSendItem_80E2490, 0x16}, - {Cancel_80E22A8, 8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E2470[] = { + {_("Send Item"), 21}, + {_("Don't Send Item"), 22}, + {_("Cancel"), 8}, + {NULL, 8}, }; -const u8 DontSendItem_80E2490[] = _("Don't Send Item"); -const u8 SendItem_80E24A4[] = "Send Item"; - -extern const u8 SendwoItem_80E24C8[]; - -const MenuItem gUnknown_80E24B0[3] = { - {SendwoItem_80E24C8, 0x16}, - {Cancel_80E22A8, 8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E24B0[] = { + {_("Send w/o Item"), 22}, + {_("Cancel"), 8}, + {NULL, 8}, }; -const u8 SendwoItem_80E24C8[] = "Send w/o Item"; - -const MenuItem gUnknown_80E24D8[4] = { - {Yes_80E22B0, 6}, - {No_80E22CC, 0x7}, - {Cancel_80E22A8, 0x8}, - {NULL, 0x8}, +const MenuItem gUnknown_80E24D8[] = { + {_("Yes"), 6}, + {_("No"), 7}, + {_("Cancel"), 8}, + {NULL, 8}, }; -extern const u8 RescueInfo_80E2540[]; -extern const u8 GoRescue_80E530[]; -extern const u8 GetHelp_80E2520[]; - -const MenuItem gUnknown_80E24F8[5] = { - {RescueInfo_80E2540, 0x1A}, - {GoRescue_80E530, 0x1B}, - {GetHelp_80E2520, 0x1C}, - {Cancel_80E22A8, 0x19}, - {NULL, 0x19}, +const MenuItem gUnknown_80E24F8[] = { + {_("Friend Rescue Info"), 26}, + {_("{COLOR YELLOW}Go rescue{RESET} "), 27}, + {_("{COLOR YELLOW}Get help{RESET} "), 28}, + {_("Cancel"), 25}, + {NULL, 25}, }; -ALIGNED(4) const u8 GetHelp_80E2520[] = _("{COLOR YELLOW}Get help{RESET} "); -ALIGNED(4) const u8 GoRescue_80E530[] = _("{COLOR YELLOW}Go rescue{RESET} "); -const u8 RescueInfo_80E2540[] = "Friend Rescue Info"; - -extern const u8 RescueProcedures_80E25A0[]; -extern const u8 LeaveForRescue_80E258C[]; - -const MenuItem gUnknown_80E2554[7] = { - {RescueProcedures_80E25A0, 0x1E}, - {ReceiveSOSMail_80E217C, 0x1F}, - {LeaveForRescue_80E258C, 0x20}, - {SendAOKMail_80E216C, 0x21}, - {GetThankYouMail_80E2158, 0x22}, - {Exit_80E2090, 0x19}, - {NULL, 0x19}, +const MenuItem gUnknown_80E2554[] = { + {_("Rescue Procedures"), 30}, + {_("Receive SOS Mail"), 31}, + {_("Leave for Rescue"), 32}, + {_("Send A-OK Mail"), 33}, + {_("Get Thank-You Mail"), 34}, + {_("Exit"), 25}, + {NULL, 25}, }; -const u8 LeaveForRescue_80E258C[] = "Leave for Rescue"; -const u8 RescueProcedures_80E25A0[] = "Rescue Procedures"; - -extern const u8 GettingHelp_80E25E4[]; - -const MenuItem gUnknown_80E25B4[6] = { - {GettingHelp_80E25E4, 0x23}, - {SendSOS_80E2208, 0x24}, - {ReceiveAOK_80E21F4, 0x25}, - {SendThankYou_80E21E0, 0x26}, - {Exit_80E2090, 0x19}, - {NULL, 0x19}, -}; - -const u8 GettingHelp_80E25E4[] = "Getting Help"; +const MenuItem gUnknown_80E25B4[] = { + {_("Getting Help"), 35}, + {_("Send SOS Mail"), 36}, + {_("Receive A-OK Mail"), 37}, + {_("Send Thank-You Mail"), 38}, + {_("Exit"), 25}, + {NULL, 25}, +}; \ No newline at end of file diff --git a/src/data/ground_main.h b/src/data/ground_main.h index 65e4fe50c..13aea2fdc 100644 --- a/src/data/ground_main.h +++ b/src/data/ground_main.h @@ -3,5 +3,5 @@ ALIGNED(4) static const u8 sFmtRescueRequest[] = "GroundMain recue request %3d % ALIGNED(4) static const u8 sFmtUserRescueRequest[] = "GroundMain user rescue request %3d"; ALIGNED(4) static const u8 sFmtGameEndRequest[] = "GroundMain game end request %3d"; ALIGNED(4) static const u8 sFmtGameCancelRequest[] = "GroundMain game cancel request %3d"; -UNUSED static const u8 sFill1[] = "pksdir0"; -UNUSED static const u8 sFill2[] = "pksdir0"; \ No newline at end of file +UNUSED static const u8 sFill1[] = _("pksdir0"); +UNUSED static const u8 sFill2[] = _("pksdir0"); \ No newline at end of file diff --git a/src/data/locale/felicity_bank_usa.h b/src/data/locale/felicity_bank_usa.h new file mode 100644 index 000000000..f8fd19389 --- /dev/null +++ b/src/data/locale/felicity_bank_usa.h @@ -0,0 +1,157 @@ +#define FEL_AWAKE_WELCOME (_( \ + " Welcome.\n" \ + "This is Felicity Bank.")) + +#define FEL_AWAKE_HOW_MAY_I_SERVE__NO_MONEY (_(" How may I serve you?")) + +#define FEL_AWAKE_HOW_MAY_I_SERVE__HAS_MONEY (_( \ + " Your account contains\n" \ + "{COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" \ + "How may I serve you?")) + +#define FEL_AWAKE_VERY_WELL (_(" Very well.")) + +#define FEL_AWAKE_BYE__NO_MONEY (_(" I await your next visit.")) + +#define FEL_AWAKE_BYE__HAS_MONEY (_(" I await your next visit.")) + +#define FEL_AWAKE_DEPOSIT__HOW_MUCH (_( \ + " How much do you wish to\n" \ + "deposit?")) + +#define FEL_AWAKE_DEPOSIT__NO_MONEY (_( \ + " Oh?{WAIT_PRESS} I'm so sorry to say,\n" \ + "but you appear not to have any money.")) + +#define FEL_AWAKE_DEPOSIT__BANK_FULL (_( \ + " Meow! All this money!{WAIT_PRESS}\n" \ + "Our safe is about to burst!{EXTRA_MSG}" \ + " I am so sorry to say, but\n" \ + "I can't accept any more of your money!")) + +#define FEL_AWAKE_DEPOSIT__RECEIPT (_( \ + " {COLOR CYAN}{VALUE_0}{RESET} {POKE}. Very well.{WAIT_PRESS}\n" \ + "I will guard it jealously.")) + +#define FEL_AWAKE_WITHDRAW__HOW_MUCH (_( \ + " How much will you\n" \ + "withdraw?")) + +#define FEL_AWAKE_WITHDRAW__NO_MONEY (_( \ + " Oh?{WAIT_PRESS} I so hate to disappoint,\n" \ + "but you have no money saved with me.")) + +#define FEL_AWAKE_WITHDRAW__WALLET_FULL (_( \ + " Oh?{WAIT_PRESS} I do so apologize,\n" \ + "but you couldn't possibly carry any more\n" \ + "money with you.")) + +#define FEL_AWAKE_WITHDRAW__RECEIPT (_( \ + " Very well, {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" \ + "Here you are.")) + +#define FEL_AWAKE_HOW_IT_WORKS (_( \ + " Ah, you wish to know how\n" \ + "the bank operates. Very well.{EXTRA_MSG}" \ + " If you are defeated\n" \ + "in a dungeon, you'll lose all your money.\n" \ + "Did you know that?{EXTRA_MSG}" \ + " But you can avoid that!{WAIT_PRESS}\n" \ + "You've nothing to fear if you leave your\n" \ + "money with Felicity Bank.{EXTRA_MSG}" \ + " Even if you return\n" \ + "defeated from a dungeon, your money will\n" \ + "be safe with me!{EXTRA_MSG}" \ + " I assure you, my bank\n" \ + "will keep your money safe.{EXTRA_MSG}" \ + " Simple, isn't it?")) + + + +#define FEL_ASLEEP_WELCOME (_( \ + " Ssssnore... Welcome...\n" \ + "This is Felicity Bank...")) + +#define FEL_ASLEEP_HOW_MAY_I_SERVE__NO_MONEY (_( \ + " Zzz...\n" \ + "How may I serve you?")) + +#define FEL_ASLEEP_HOW_MAY_I_SERVE__HAS_MONEY (_( \ + " Sssnore... Purr...\n" \ + "Your account contains {COLOR CYAN}{VALUE_0}{RESET} {POKE}...\n" \ + "How may I serve you?")) + +#define FEL_ASLEEP_VERY_WELL (_( \ + " Sssnore...\n" \ + "Very well...")) + +#define FEL_ASLEEP_BYE__NO_MONEY (_( \ + " Zzz... Purr...\n" \ + "I await your next visit...")) + +#define FEL_ASLEP_BYE__HAS_MONEY (_( \ + " Zzz... Meow...\n" \ + "I await your next visit...")) + +#define FEL_ASLEEP_DEPOSIT__HOW_MUCH (_( \ + " Purr...\n" \ + "How much do you wish to deposit?")) + +#define FEL_ASLEEP_DEPOSIT__NO_MONEY (_( \ + " Sssnore... Hmm?{EXTRA_MSG}" \ + " Zzz...\n" \ + "I'm so sorry to say, but you appear not\n" \ + "to have any money...")) + +#define FEL_ASLEEP_DEPOSIT__BANK_FULL (_( \ + " Fnarf? Purr...\n" \ + "Meow! All this money...{WAIT_PRESS}\n" \ + "Our safe is about to burst...{EXTRA_MSG}" \ + " Purr...\n" \ + "I am so sorry to say, but I can't accept\n" \ + "any more of your money...")) + +#define FEL_ASLEEP_DEPOSIT__RECEIPT (_( \ + " Zzz...\n" \ + "{COLOR CYAN}{VALUE_0}{RESET} {POKE}... Very well...{WAIT_PRESS}\n" \ + "I will guard it jealously...")) + +#define FEL_ASLEEP_WITHDRAW__HOW_MUCH (_( \ + " Zzz...\n" \ + "How much will you withdraw?")) + +#define FEL_ASLEEP_WITHDRAW__NO_MONEY (_( \ + " Fnarf? Meow...?{EXTRA_MSG}" \ + " Purr...\n" \ + "I so hate to disappoint, but you have no\n" \ + "money saved with me...")) + +#define FEL_ASLEEP_WITHDRAW__WALLET_FULL (_( \ + " Fnarf? Hunh...?{EXTRA_MSG}" \ + " Purr... I so do apologize,\n" \ + "but you couldn't possibly carry any more\n" \ + "money with you...")) + +#define FEL_ASLEEP_WITHDRAW__RECEIPT (_( \ + " {POKE}... Purr...\n" \ + "Very well, {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" \ + "Here you are.")) + +#define FEL_ASLEEP_HOW_IT_WORKS (_( \ + " Sssnore...\n" \ + "Ah, you wish to know how the bank\n" \ + "operates... Very well...{EXTRA_MSG}" \ + " Zzz...\n" \ + "If you're defeated in a dungeon,\n" \ + "you'll lose all your money. Did you know?{EXTRA_MSG}" \ + " Purr...\n" \ + "But, you've nothing to fear if you leave\n" \ + "your money with Felicity Bank...{EXTRA_MSG}" \ + " Meow... Even if you\n" \ + "return defeated from a dungeon, your\n" \ + "money will be safe with me...{EXTRA_MSG}" \ + " Sssnore...\n" \ + "I assure you, my bank will keep your\n" \ + "money safe...{EXTRA_MSG}" \ + " Zzz...\n" \ + "Simple, isn't it...?")) diff --git a/src/data/locale/gulpin_shop_usa.h b/src/data/locale/gulpin_shop_usa.h new file mode 100644 index 000000000..1d93753ce --- /dev/null +++ b/src/data/locale/gulpin_shop_usa.h @@ -0,0 +1,352 @@ + + +#define GULP_AWAKE_DLG_00 (_( \ + " Hello!\n" \ + "Welcome to the Gulpin Link Shop!\n" \ + "Link moves all you like for just 150 {POKE}!")) + +#define GULP_AWAKE_DLG_01 (_( \ + " Welcome to the Gulpin\n" \ + "Link Shop!\n" \ + "Link moves all you like for just 150 {POKE}!")) + +#define GULP_AWAKE_DLG_02 (_( \ + " Uh... Hello?\n" \ + "You don't have enough money?")) + +#define GULP_AWAKE_DLG_03 (_( \ + " Too bad.\n" \ + "There are no moves that can be linked.")) + +#define GULP_AWAKE_DLG_04 (_( \ + " That move isn't linked,\n" \ + "so it can't be delinked.")) + +#define GULP_AWAKE_DLG_05 (_( \ + " If you forget that move,\n" \ + "you won't have any moves at all.")) + +#define GULP_AWAKE_DLG_06 (_(" Shall we go on?")) + +#define GULP_AWAKE_DLG_07 (_( \ + " Whenever you get the urge\n" \ + "to link moves, please come see me!")) + +#define GULP_AWAKE_DLG_08 (_( \ + " Good!\n" \ + "Now, who wants to link moves?")) + +#define GULP_AWAKE_DLG_09 (_( \ + " Which move would you like\n" \ + "to recall?")) + +#define GULP_AWAKE_DLG_10 (_( \ + " So, the move {COLOR CYAN}{POKEMON_0}{RESET}\n" \ + "is the one to be remembered?{WAIT_PRESS}\n" \ + "OK, here goes!{EXTRA_MSG}" \ + " Gggggggggggg...{WAIT_PRESS} Gulpin!{EXTRA_MSG}" \ + " There!\n" \ + "Success!{EXTRA_MSG}" \ + " {COLOR CYAN_M}{POKEMON_5}{RESET} has\n" \ + "remembered the move {COLOR CYAN}{POKEMON_0}{RESET}!")) + +#define GULP_AWAKE_DLG_11 (_( \ + " So, forget the move\n" \ + "{COLOR GREEN}{POKEMON_1}{RESET} and remember the move\n" \ + "{COLOR CYAN}{POKEMON_0}{RESET}?")) + +#define GULP_AWAKE_DLG_12 (_( \ + " So, forget {COLOR GREEN}{POKEMON_1}{RESET}\n" \ + "and any moves linked to it, and remember\n" \ + "the move {COLOR CYAN}{POKEMON_0}{RESET}?")) + +#define GULP_AWAKE_DLG_13 (_( \ + " OK, here goes!{EXTRA_MSG}" \ + " Gggggggg...{WAIT_PRESS} Pwah! Gulpin!{EXTRA_MSG}" \ + " There!\n" \ + "Success!{EXTRA_MSG}" \ + " {COLOR CYAN_M}{POKEMON_5}{RESET} has forgotten\n" \ + "the move {COLOR GREEN}{POKEMON_1}{RESET} and remembered\n" \ + "the move {COLOR CYAN}{POKEMON_0}{RESET}!")) + +#define GULP_AWAKE_DLG_14 (_( \ + " OK, here goes!{EXTRA_MSG}" \ + " Gggggggg...{WAIT_PRESS} Pwah! Gulpin!{EXTRA_MSG}" \ + " There!\n" \ + "Success!{EXTRA_MSG}" \ + " {COLOR CYAN_M}{POKEMON_5}{RESET} is done!{EXTRA_MSG}" \ + " It's forgotten the move\n" \ + "{COLOR GREEN}{POKEMON_1}{RESET} and any moves linked to it,\n" \ + "and {COLOR CYAN}{POKEMON_0}{RESET} has been remembered!")) + +#define GULP_AWAKE_DLG_15 (_( \ + " Uh... Hello?{WAIT_PRESS}\n" \ + "There don't appear to be any moves that\n" \ + "can be remembered.")) + +#define GULP_AWAKE_DLG_16 (_( \ + " Uh... Huh?{WAIT_PRESS}\n" \ + "You appear to be a special PokĂ©mon.{EXTRA_MSG}" \ + " I can't help you remember\n" \ + "any moves, I don't think.\n" \ + "I'm sorry.")) + +#define GULP_AWAKE_DLG_17 (_( \ + " So, forget the move\n" \ + "{COLOR GREEN}{POKEMON_1}{RESET}?")) + +#define GULP_AWAKE_DLG_18 (_( \ + " So, forget the move\n" \ + "{COLOR GREEN}{POKEMON_1}{RESET} and any moves linked to it?")) + +#define GULP_AWAKE_DLG_19 (_( \ + " OK, here goes!{EXTRA_MSG}" \ + " Gggggggg...{WAIT_PRESS} Poof!{EXTRA_MSG}" \ + " There!\n" \ + "Success!{EXTRA_MSG}" \ + " {COLOR CYAN}{POKEMON_5}{RESET} has forgotten\n" \ + "the move {COLOR GREEN}{POKEMON_1}{RESET}!")) + +#define GULP_AWAKE_DLG_20 (_( \ + " OK, here goes!{EXTRA_MSG}" \ + " Gggggggg...{WAIT_PRESS} Poof!{EXTRA_MSG}" \ + " There!\n" \ + "Success!{EXTRA_MSG}" \ + " {COLOR CYAN}{POKEMON_5}{RESET} has forgotten\n" \ + "the move {COLOR GREEN}{POKEMON_1}{RESET} and any moves\n" \ + "linked to it!")) + +#define GULP_AWAKE_DLG_21 (_( \ + " Sure thing!\n" \ + "What do you need information on?")) + +#define GULP_AWAKE_DLG_22 (_( \ + " When you're in a dungeon\n" \ + "and you're about to use a move...{WAIT_PRESS}\n" \ + "Isn't it a pain to open a window each time?{EXTRA_MSG}" \ + " You can avoid that!{WAIT_PRESS}\n" \ + "You can just conveniently “Set”\n" \ + "a move for instant use!{EXTRA_MSG}" \ + " A set move can be instantly\n" \ + "used with {L_BUTTON} and {A_BUTTON}!{WAIT_PRESS}\n" \ + "See? Isn't it easy?{EXTRA_MSG}" \ + " Just set the move...{WAIT_PRESS}\n" \ + "Hold {L_BUTTON} and then press {A_BUTTON} to use it!{WAIT_PRESS}\n" \ + "It's very convenient!{EXTRA_MSG}" \ + " You can also switch the set\n" \ + "move in a dungeon.\n" \ + "Do try it out!\n")) + +#define GULP_AWAKE_DLG_23 (_( \ + " When moves are linked...{WAIT_PRESS}\n" \ + "Two or more moves can be used one after\n" \ + "another in one turn!{EXTRA_MSG}" \ + " For example, if the moves\n" \ + "{COLOR CYAN}Scratch{RESET} and {COLOR CYAN}Growl{RESET} are\n" \ + "linked...{EXTRA_MSG}" \ + " Both {COLOR CYAN}Scratch{RESET} and {COLOR CYAN}Growl{RESET} are\n" \ + "used in one turn!{WAIT_PRESS}\n" \ + "See? Amazing, huh?{EXTRA_MSG}" \ + " Using links, heheh...{WAIT_PRESS}\n" \ + "Well, depending on the moves you link,\n" \ + "you can get incredible results!{EXTRA_MSG}" \ + " Oh, yes.\n" \ + "When moves are linked, they are used in\n" \ + "sequence from the top one first.{EXTRA_MSG}" \ + " You can also separate linked\n" \ + "moves by selecting the Delink command.{EXTRA_MSG}" \ + " The sequence of moves can\n" \ + "be changed by pressing {R_BUTTON},\n" \ + "then pressing up or down on {DPAD}.{EXTRA_MSG}" \ + " Try to innovate with links.{WAIT_PRESS}\n" \ + "Try creating links of your very own!")) + +#define GULP_AWAKE_DLG_24 (_( \ + " What if you had to forget\n" \ + "a move, but you wanted it back?{WAIT_PRESS}\n" \ + "Ever face that situation?{EXTRA_MSG}" \ + " I can help!{WAIT_PRESS}\n" \ + "Come to me, and I can make you instantly\n" \ + "remember forgotten moves!{EXTRA_MSG}" \ + " I...{WAIT_PRESS}\n" \ + "Well, when PokĂ©mon remember...{WAIT_PRESS}\n" \ + "I love seeing that instant!{EXTRA_MSG}" \ + " That look of enlightenment!{WAIT_PRESS}\n" \ + "That amazed look of pleasure!{EXTRA_MSG}" \ + " I run this business because\n" \ + "I live to see that moment!")) + + + +#define GULP_ASLEEP_DLG_00 (_( \ + " Zzz... Hello...\n" \ + "Gulpin Link Shop...\n" \ + "Link for 150 {POKE}...")) + +#define GULP_ASLEEP_DLG_01 (_( \ + " Zzz... Gulpin Link Shop...\n" \ + "Link for just 150 {POKE}...")) + +#define GULP_ASLEEP_DLG_02 (_( \ + " Zzz... Grunt?\n" \ + "Not enough money...")) + +#define GULP_ASLEEP_DLG_03 (_( \ + " Zzz... Grumph...\n" \ + "Nothing to link...")) + +#define GULP_ASLEEP_DLG_04 (_( \ + " Sssnork... Sssnork...\n" \ + "Nothing to be delinked...")) + +#define GULP_ASLEEP_DLG_05 (_( \ + " Zzznort... Zzznnort...\n" \ + "Can't forget that...")) + +#define GULP_ASLEEP_DLG_06 (_( \ + " Zzz... Zzz...\n" \ + "Keep going...?")) + +#define GULP_ASLEEP_DLG_07 (_( \ + " Zzz... Zzz...\n" \ + "Come again...")) + +#define GULP_ASLEEP_DLG_08 (_( \ + " Gwaah... Gwaah...\n" \ + "Who's gonna link moves?")) + +#define GULP_ASLEEP_DLG_09 (_( \ + " Zzz... Fgwah...?\n" \ + "Remember what? What move?")) + +#define GULP_ASLEEP_DLG_10 (_( \ + " Zzzznort... Move...?\n" \ + "Remember {COLOR CYAN}{POKEMON_0}{RESET}?{EXTRA_MSG}" \ + " Fwaah...\n" \ + "Gggggggggggg...{WAIT_PRESS} Gulpin!{EXTRA_MSG}" \ + " Fgwaah...\n" \ + "There...{EXTRA_MSG}" \ + " Zzz... Zzz...\n" \ + "{COLOR CYAN_M}{POKEMON_5}{RESET} remembered...\n" \ + "Hunh? That move, {COLOR CYAN}{POKEMON_0}{RESET}...")) + +#define GULP_ASLEEP_DLG_11 (_( \ + " Zzznort... Grumble...\n" \ + "Forget {COLOR GREEN}{POKEMON_1}{RESET}?\n" \ + "Remember {COLOR CYAN}{POKEMON_0}{RESET}?")) + +#define GULP_ASLEEP_DLG_12 (_( \ + " Zzz? Fnurf? \n" \ + "Forget {COLOR GREEN}{POKEMON_1}{RESET}...and moves linked\n" \ + "to it? Remember {COLOR CYAN}{POKEMON_0}{RESET}?")) + +#define GULP_ASLEEP_DLG_13 (_( \ + " Fgwaah...\n" \ + "Here goes...{EXTRA_MSG}" \ + " Zzznort...\n" \ + "Gggggggg...{WAIT_PRESS} Pwah! Gulpin!{EXTRA_MSG}" \ + " Fwaah hah!\n" \ + "There...{EXTRA_MSG}" \ + " Zzz... Zzz... {COLOR CYAN_M}{POKEMON_5}{RESET}\n" \ + "forgot {COLOR GREEN}{POKEMON_1}{RESET}...\n" \ + "Remembered {COLOR CYAN}{POKEMON_0}{RESET}...")) + +#define GULP_ASLEEP_DLG_14 (_( \ + " Fgwaaah...\n" \ + "Here goes...{EXTRA_MSG}" \ + " Zzznort...\n" \ + "Gggggggg...{WAIT_PRESS} Pwah! Gulpin!{EXTRA_MSG}" \ + " Fwaaah hah!\n" \ + "There...{EXTRA_MSG}" \ + " Zzz... Mumble...\n" \ + "{COLOR CYAN_M}{POKEMON_5}{RESET}'s OK...{EXTRA_MSG}" \ + " Sssnork... Forgotten...\n" \ + "{COLOR GREEN}{POKEMON_1}{RESET} and moves linked to it...\n" \ + "Remembered {COLOR CYAN}{POKEMON_0}{RESET}...")) + +#define GULP_ASLEEP_DLG_15 (_( \ + " Zzz... Fwaah?\n" \ + "No moves to remember...")) + +#define GULP_ASLEEP_DLG_16 (_( \ + " Zzznork...? Hunh?\n" \ + "You're a special PokĂ©mon...{EXTRA_MSG}" \ + " Mumble...\n" \ + "I can't help you...")) + +#define GULP_ASLEEP_DLG_17 (_( \ + " Zzz... Forget...?\n" \ + "{COLOR GREEN}{POKEMON_1}{RESET}?")) + +#define GULP_ASLEEP_DLG_18 (_( \ + " Zzz... Fwaah? Forget...?\n" \ + "{COLOR GREEN}{POKEMON_1}{RESET} and any moves\n" \ + "linked to it?")) + +#define GULP_ASLEEP_DLG_19 (_( \ + " Fgwaaah...\n" \ + "Here goes...{EXTRA_MSG}" \ + " Zzznort...\n" \ + "Gggggggg...{WAIT_PRESS} Pwah!{EXTRA_MSG}" \ + " Fwaaah hah!\n" \ + "There...{EXTRA_MSG}" \ + " Zzz... Mumble...\n" \ + "{COLOR CYAN}{POKEMON_5}{RESET} forgot...\n" \ + "{COLOR GREEN}{POKEMON_1}{RESET}...")) + +#define GULP_ASLEEP_DLG_20 (_( \ + " Fgwaaah...\n" \ + "Here goes...{EXTRA_MSG}" \ + " Zzznort...\n" \ + "Gggggggg...{WAIT_PRESS} Pwah!{EXTRA_MSG}" \ + " Fwaaah hah!\n" \ + "There...{EXTRA_MSG}" \ + " Zzz... Mutter...\n" \ + "{COLOR CYAN}{POKEMON_5}{RESET} forgot...\n" \ + "{COLOR GREEN}{POKEMON_1}{RESET} and moves linked to it...")) + +#define GULP_ASLEEP_DLG_21 (_( \ + " Zzznork... Fnurfle?\n" \ + "What do you want to know?")) + +#define GULP_ASLEEP_DLG_22 (_( \ + " Zzz... Zzz...\n" \ + "A set move can be used...\n" \ + "Press {L_BUTTON} and {A_BUTTON}...{EXTRA_MSG}" \ + " Sssnort... Set the move...{WAIT_PRESS}\n" \ + "Press {L_BUTTON} and {A_BUTTON}...{WAIT_PRESS} Use move!{WAIT_PRESS}\n" \ + "Convenient...{EXTRA_MSG}" \ + " Sssnore...\n" \ + "Switch the set move in a dungeon, too...")) + +#define GULP_ASLEEP_DLG_23 (_( \ + " Zzznork...{WAIT_PRESS}\n" \ + "Link moves to use them all in\n" \ + "one turn...{EXTRA_MSG}" \ + " Zzz... Fnurf...?\n" \ + "Linked moves...\n" \ + "Top one goes first...{EXTRA_MSG}" \ + " Zzz... Hah...?\n" \ + "Delink moves to break links...{EXTRA_MSG}" \ + " Zzzzz... Fwaaah...\n" \ + "Change order of moves with {R_BUTTON}...\n" \ + "And up and down on {DPAD}...{EXTRA_MSG}" \ + " Gwaaah... Gweh...\n" \ + "Make your own links...")) + +#define GULP_ASLEEP_DLG_24 (_( \ + " Zzz... Snuffle...\n" \ + "I'd go broke if it weren't for those\n" \ + "forgetful PokĂ©mon...{EXTRA_MSG}" \ + " Zzz... Gwaaah...\n" \ + "Especially that {COLOR CYAN}{POKEMON_4}{RESET}...\n" \ + "It seems to be forgetful...{EXTRA_MSG}" \ + " Sssnore...\n" \ + "I hope it forgets more moves...\n" \ + "So it needs to see me...{EXTRA_MSG}" \ + " Zzz... Mumble...\n" \ + "But we decided to get rid of that\n" \ + "{COLOR CYAN}{POKEMON_4}{RESET}...{EXTRA_MSG}" \ + " Gwaaaah... Gweh...\n" \ + "{COLOR CYAN}{POKEMON_4}{RESET} won't be coming around\n" \ + "anymore... ")) diff --git a/src/data/locale/hints_usa.h b/src/data/locale/hints_usa.h new file mode 100644 index 000000000..16ff0acc3 --- /dev/null +++ b/src/data/locale/hints_usa.h @@ -0,0 +1,60 @@ +#define HINTHEADING_TOWN_CONTROLS_1 (_("Controls in Town 1")) + +#define HINTBODY_TOWN_CONTROLS_1 (_( \ + "Talk: {A_BUTTON}\n" \ + "Move: {DPAD}\n" \ + "Window: {B_BUTTON} lightly\n" \ + "Message scroll: {A_BUTTON} or {B_BUTTON}\n" \ + "Cancel: {B_BUTTON}\n" \ + "Description: Choose item or move, {START_BUTTON}")) + + + +#define HINTHEADING_TOWN_CONTROLS_2 (_("Controls in Town 2")) + +#define HINTBODY_TOWN_CONTROLS_2 (_( \ + "Selecting multiple items in storage:\n" \ + " Select an item, then press {L_BUTTON} or {R_BUTTON}.\n" \ + "Moving to the Friend Area Map:\n" \ + " Move out from the town's west side\n" \ + " while pressing {L_BUTTON} or {R_BUTTON}.\n" \ + "Moving diagonally on the Friend Area Map:\n" \ + " {DPAD} while keeping {R_BUTTON} pressed.")) + + + +#define HINTHEADING_SAVING (_("Saving")) + +#define HINTBODY_SAVING (_( \ + "You can save your adventure by\n" \ + "hopping onto your bed in your base.\n" \ + "Get in the habit of saving regularly as\n" \ + "you progress in your adventure.")) + + + +#define HINTHEADING_ADVENTURES_WITH_FRIENDS (_("Adventures with Friends")) + +#define HINTBODY_ADVENTURES_WITH_FRIENDS (_( \ + "If new recruits join you, try to return to\n" \ + "your base without letting them faint.\n" \ + "If you get them out safely, they'll wait\n" \ + "for you in their Friend Areas.\n" \ + "Once you get them out, they'll always\n" \ + "return home if they faint in a dungeon.\n" \ + "If you faint in a dungeon, you lose all your\n" \ + "money and some items, too.")) + + + +#define HINTHEADING_BUILDING_A_TEAM (_("Building a Team")) + +#define HINTBODY_BUILDING_A_TEAM (_( \ + "Before leaving on an adventure, go visit\n" \ + "friends in their Friend Areas and pick\n" \ + "your mission members.\n" \ + "The team can include members up to\n" \ + "a total body size of 6{STAR_BULLET}. The body size\n" \ + "data is under the Info section.\n" \ + "Dungeons may also limit how many\n" \ + "members are allowed to go inside.")) diff --git a/src/data/locale/kangaskhan_storage_usa.h b/src/data/locale/kangaskhan_storage_usa.h new file mode 100644 index 000000000..d65cff87a --- /dev/null +++ b/src/data/locale/kangaskhan_storage_usa.h @@ -0,0 +1,189 @@ +#define KANG_AWAKE_WELCOME (_( \ + " Hello, there!\n" \ + "Welcome to {POKEMON_6} Storage.")) + +#define KANG_AWAKE_ANYTHING_ELSE (_(" Anything else, dear?")) + +#define KANG_AWAKE_BYE (_( \ + " Thank you, sweetie.\n" \ + "Come again!")) + +#define KANG_AWAKE_STORE_WHAT (_( \ + " What do you want to store?\n" \ + "You can choose more than one item using\n" \ + "{L_BUTTON} or {R_BUTTON}.")) + +#define KANG_AWAKE_STORE_MORE (_( \ + " Do you want to store\n" \ + "anything else?")) + +#define KANG_AWAKE_DEPOSIT_ONE_PROMPT (_( \ + " I'll put your\n" \ + "{COLOR GREEN}{MOVE_ITEM_0}{RESET} in storage. OK?")) + +#define KANG_AWAKE_DEPOSIT_MANY_PROMPT (_( \ + " I'll put the items you chose\n" \ + "in storage. OK?")) + +#define KANG_AWAKE_DEPOSIT_CONFIRMATION (_( \ + " OK, stored away!\n" \ + "You can count on me, honey.")) + +#define KANG_AWAKE_TAKE_WHAT (_( \ + " What will you take out?\n" \ + "You can choose more than one item using\n" \ + "{L_BUTTON} or {R_BUTTON}.")) + +#define KANG_AWAKE_TAKE_MORE (_( \ + " Would you like to take\n" \ + "anything else?")) + +#define KANG_AWAKE_WITHDRAW_ONE_PROMPT (_( \ + " Fine, I'll take your\n" \ + "{COLOR GREEN}{MOVE_ITEM_0}{RESET} out of storage. OK?")) + +#define KANG_AWAKE_WITHDRAW_MANY_PROMPT (_( \ + " I'll take the items you\n" \ + "chose out of storage. OK?")) + +#define KANG_AWAKE_WITHDRAW_CONFIRMATION (_( \ + " There you go!\n" \ + "Just like you asked, sweetie!")) + +#define KANG_AWAKE_YOU_HAVE_NOTHING (_( \ + " Oh?\n" \ + "You don't seem to have anything?")) + +#define KANG_AWAKE_YOU_ARE_FULL (_( \ + " Oh? You don't have the room\n" \ + "to carry any more items, dear.")) + +#define KANG_AWAKE_STORAGE_HAS_NOTHING (_( \ + " Oh?\n" \ + "You don't have anything stored, dear.")) + +#define KANG_AWAKE_DEPOSIT_INVALID_ITEM (_( \ + " Oh, dear, sorry.{WAIT_PRESS}\n" \ + "That {COLOR GREEN}{MOVE_ITEM_0}{RESET} is an item you\n" \ + "can't put in storage.")) + +#define KANG_AWAKE_DEPOSIT_TOO_MANY_OF_ITEM (_( \ + " Sorry, dear.\n" \ + "I can't take any more of that item.")) + +#define KANG_AWAKE_STORAGE_FULL (_( \ + " Sorry, dear.\n" \ + "I've run out of storage space.")) + +#define KANG_AWAKE_HOW_IT_WORKS (_( \ + " I can store items that you\n" \ + "found in dungeons, or that you\n" \ + "bought from shops.{EXTRA_MSG}" \ + " If you faint in\n" \ + "a dungeon, your items will be lost...{WAIT_PRESS}\n" \ + "But what's in storage will be safe.{EXTRA_MSG}" \ + " I keep guard over the\n" \ + "storage space, so anything you leave\n" \ + "with me won't ever disappear!{EXTRA_MSG}" \ + " If you have any items that\n" \ + "you can't bear to lose, be sure to leave\n" \ + "them with me!")) + + + +#define KANG_ASLEEP_WELCOME (_( \ + " Zzz... Zzz...\n" \ + "Hello, there...\n" \ + "{POKEMON_6} Storage...")) + +#define KANG_ASLEEP_ANYTHING_ELSE (_( \ + " Zzz... Snork...\n" \ + "Anything else?")) + +#define KANG_ASLEEP_BYE (_( \ + " Snuffle... Mutter...\n" \ + "Thank you...\n" \ + "Come again...")) + +#define KANG_ASLEEP_STORE_WHAT (_( \ + " Hunh, wha--? Store what...?\n" \ + "You can choose more than one using\n" \ + "{L_BUTTON} or {R_BUTTON}...")) + +#define KANG_ASLEEP_STORE_MORE (_( \ + " Do you... Snork...\n" \ + "Store anything else?")) + +#define KANG_ASLEEP_DEPOSIT_ONE_PROMPT (_( \ + " Zzz... Store something?\n" \ + "Gonna put {COLOR GREEN}{MOVE_ITEM_0}{RESET} in storage...\n" \ + "OK?")) + +#define KANG_ASLEEP_DEPOSIT_MANY_PROMPT (_( \ + " Hunh, wha--? Storage...?\n" \ + "I'll put away the things you chose...\n" \ + "That OK?")) + +#define KANG_ASLEEP_DEPOSIT_CONFIRMATION (_( \ + " Zzz... Zzz...\n" \ + "Yup, I did... Stored away...")) + +#define KANG_ASLEEP_TAKE_WHAT (_( \ + " What...? Take out...?\n" \ + "Uh-huh... Choose more than one using\n" \ + "{L_BUTTON} or {R_BUTTON}... Zzz...")) + +#define KANG_ASLEEP_TAKE_MORE (_( \ + " Snork! Zzz...\n" \ + "Taking anything else?")) + +#define KANG_ASLEEP_WITHDRAW_ONE_PROMPT (_( \ + " Hunh...? Taking...?\n" \ + "Oh... You want your {COLOR GREEN}{MOVE_ITEM_0}{RESET}...\n" \ + "OK?")) + +#define KANG_ASLEEP_WITHDRAW_MANY_PROMPT (_( \ + " Zzz... Zzz... Hunh...?\n" \ + "You want those things from storage...\n" \ + "OK?")) + +#define KANG_ASLEEP_WITHDRAW_CONFIRMATION (_( \ + " Zzz... Snork!\n" \ + "There you go...")) + +#define KANG_ASLEEP_YOU_HAVE_NOTHING (_( \ + " Snarfle? Hunh...?{WAIT_PRESS}\n" \ + "Zzz...\n" \ + "You don't have anything...?")) + +#define KANG_ASLEEP_YOU_ARE_FULL (_( \ + " Snarfle? Hunh...?{WAIT_PRESS}\n" \ + "Zzz...\n" \ + "You don't have enough space...")) + +#define KANG_ASLEEP_STORAGE_EMPTY (_( \ + " Snarfle? Hunh...?{WAIT_PRESS}\n" \ + "Zzz... Your storage space... Empty...")) + +#define KANG_ASLEEP_DEPOSIT_INVALID_ITEM (_( \ + " Zzz... Zzz...\n" \ + "That {COLOR GREEN}{MOVE_ITEM_0}{RESET}...\n" \ + "Can't store it...")) + +#define KANG_ASLEEP_DEPOSIT_TOO_MANY_OF_ITEM (_( \ + " Zzz... No...\n" \ + "Can't store any more of that...")) + +#define KANG_ASLEEP_STORAGE_FULL (_( \ + " Zzz... Zzz... No...\n" \ + "The storage space is full...")) + +#define KANG_ASLEEP_HOW_IT_WORKS (_( \ + " Zzz... Snork!\n" \ + "I can store items that you\n" \ + "found in dungeons...{EXTRA_MSG}" \ + " Snarfle...\n" \ + "Things in storage don't get lost...{EXTRA_MSG}" \ + " Zzz... Zzz...\n" \ + "That's why...\n" \ + "Keep important items in storage...")) diff --git a/src/data/locale/kecleon_bros_usa.h b/src/data/locale/kecleon_bros_usa.h new file mode 100644 index 000000000..eb518e3f0 --- /dev/null +++ b/src/data/locale/kecleon_bros_usa.h @@ -0,0 +1,470 @@ +#define KEC_ITEMS_AWAKE_DLG_00 (_( \ + " Hello〜♪\n" \ + "Welcome to the {POKEMON_6} Shop〜♪ ")) + +#define KEC_ITEMS_AWAKE_DLG_01 (_( \ + " May I help you with\n" \ + "anything else?")) + +#define KEC_ITEMS_AWAKE_DLG_02 (_( \ + " Thank you!\n" \ + "Please call again〜♪ ")) + +#define KEC_ITEMS_AWAKE_DLG_03 (_( \ + " Ah, very well!\n" \ + "Feel free to examine my merchandise〜♪")) + +#define KEC_ITEMS_AWAKE_DLG_04 (_( \ + " Do you wish to buy\n" \ + "anything else today?")) + +#define KEC_ITEMS_AWAKE_DLG_05 (_( \ + " {COLOR GREEN}{MOVE_ITEM_0}{RESET}?\n" \ + "That will be {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" \ + "Is that to your liking?")) + +#define KEC_ITEMS_AWAKE_DLG_06 (_( \ + " Very well! Thank you〜♪\n" \ + "It is yours to take!")) + +#define KEC_ITEMS_AWAKE_DLG_07 (_( \ + " Ah, very well!\n" \ + "What do you wish to sell?")) + +#define KEC_ITEMS_AWAKE_DLG_08 (_( \ + " Do you wish to sell\n" \ + "anything else?")) + +#define KEC_ITEMS_AWAKE_DLG_09 (_( \ + " {COLOR GREEN}{MOVE_ITEM_0}{RESET}?\n" \ + "I can offer you {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" \ + "Will you sell it for that price?")) + +#define KEC_ITEMS_AWAKE_DLG_10 (_( \ + " For everything I can buy,\n" \ + "I can offer {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" \ + "Is that acceptable to you?")) + +#define KEC_ITEMS_AWAKE_DLG_11 (_( \ + " Good! Done deal!\n" \ + "Thank you so much〜♪ ")) + +#define KEC_ITEMS_AWAKE_DLG_12 (_( \ + " ...{WAIT_PRESS}I'm sold out...\n" \ + "Please, forgive me.{EXTRA_MSG}" \ + " I will have new merchandise\n" \ + "for you tomorrow, I swear!")) + +#define KEC_ITEMS_AWAKE_DLG_13 (_( \ + " Huh?{WAIT_PRESS}\n" \ + "You don't seem to have the money?")) + +#define KEC_ITEMS_AWAKE_DLG_14 (_( \ + " Oh, my goodness!\n" \ + "You're overflowing with money!{EXTRA_MSG}" \ + " You couldn't possibly carry\n" \ + "any more money! ")) + +#define KEC_ITEMS_AWAKE_DLG_15 (_( \ + " Oh? Oh?{WAIT_PRESS}\n" \ + "You seem to have nothing to sell?")) + +#define KEC_ITEMS_AWAKE_DLG_16 (_( \ + " Oh? Oh?{WAIT_PRESS}\n" \ + "You don't seem to have anything?")) + +#define KEC_ITEMS_AWAKE_DLG_17 (_( \ + " Oh, my!{WAIT_PRESS}\n" \ + "You have no space for any more items!")) + +#define KEC_ITEMS_AWAKE_DLG_18 (_( \ + " Uh-oh?!{WAIT_PRESS}\n" \ + "That's it! No more merchandise!{EXTRA_MSG}" \ + " I'm completely sold out!")) + +#define KEC_ITEMS_AWAKE_DLG_19 (_( \ + " Oh, my!{WAIT_PRESS}\n" \ + "Sorry, but you don't have enough money!")) + +#define KEC_ITEMS_AWAKE_DLG_20 (_( \ + " Oh, whoa, whoa!{WAIT_PRESS}\n" \ + "I... I couldn't possibly take that from you!")) + +#define KEC_ITEMS_AWAKE_DLG_21 (_( \ + " Oh, my!{WAIT_PRESS}\n" \ + "You can't add any more to your money.\n" \ + "I can't complete this deal, sorry.")) + +#define KEC_ITEMS_AWAKE_DLG_22 (_( \ + " We, the {POKEMON_6}\n" \ + "Brothers, have a passion for selling\n" \ + "items.{EXTRA_MSG}" \ + " Items are useful for your\n" \ + "dungeon adventures.{EXTRA_MSG}" \ + " Use your imagination and\n" \ + "discover innovative uses, please.{EXTRA_MSG}" \ + " Ah, yes.\n" \ + "If my shop sells out...{EXTRA_MSG}" \ + " New merchandise will\n" \ + "arrive the following day.{EXTRA_MSG}" \ + " Until then, please go to\n" \ + "a dungeon and spend some time.\n" \ + "Please visit on your return〜♪{EXTRA_MSG}" \ + " Ah, yes. The {POKEMON_6}\n" \ + "Shop is a nationwide chain.{EXTRA_MSG}" \ + " There are shops even in\n" \ + "dungeons.\n" \ + "Please do visit〜♪ ")) + + + +#define KEC_ITEMS_ASLEEP_DLG_00 (_( \ + " Zzzzzz...\n" \ + "Welcome...")) + +#define KEC_ITEMS_ASLEEP_DLG_01 (_( \ + " Zzz... Meep...\n" \ + "Help you with anything else?")) + +#define KEC_ITEMS_ASLEEP_DLG_02 (_( \ + " Thank... Zzz...\n" \ + "Thank you...")) + +#define KEC_ITEMS_ASLEEP_DLG_03 (_( \ + " Zzz... Meep... Eep...\n" \ + "Look around...")) + +#define KEC_ITEMS_ASLEEP_DLG_04 (_( \ + " Buy? Huh, eep?\n" \ + "Anything else?")) + +#define KEC_ITEMS_ASLEEP_DLG_05 (_( \ + " Zzz... Meep meep...\n" \ + "{COLOR GREEN}{MOVE_ITEM_0}{RESET}...?\n" \ + "{COLOR CYAN}{VALUE_0}{RESET} {POKE}, OK?")) + +#define KEC_ITEMS_ASLEEP_DLG_06 (_( \ + " Eep! Wah...?\n" \ + "Thank you...")) + +#define KEC_ITEMS_ASLEEP_DLG_07 (_( \ + " Zzz... Zzz...?\n" \ + "You're selling what...?")) + +#define KEC_ITEMS_ASLEEP_DLG_08 (_( \ + " Zzz... Meep...\n" \ + "Going to sell anything else?")) + +#define KEC_ITEMS_ASLEEP_DLG_09 (_( \ + " Zzzzzz... Zzzzzz...?\n" \ + "Selling that {COLOR GREEN}{MOVE_ITEM_0}{RESET}...?\n" \ + "How about {COLOR CYAN}{VALUE_0}{RESET} {POKE}?")) + +#define KEC_ITEMS_ASLEEP_DLG_10 (_( \ + " Zzzzzz... Zzzzzz...?\n" \ + "I can pay you {COLOR CYAN}{VALUE_0}{RESET} {POKE}\n" \ + "for everything I can buy... OK?")) + +#define KEC_ITEMS_ASLEEP_DLG_11 (_( \ + " Done... Meep! Deal!\n" \ + "Thank you...")) + +#define KEC_ITEMS_ASLEEP_DLG_12 (_( \ + " ...{WAIT_PRESS} ZZZ!\n" \ + "I'm sold out... Forgive me...")) + +#define KEC_ITEMS_ASLEEP_DLG_13 (_( \ + " Hunh?{WAIT_PRESS}\n" \ + "Eep...?\n" \ + "You don't have money?")) + +#define KEC_ITEMS_ASLEEP_DLG_14 (_( \ + " Zzz... Oh, my!\n" \ + "You have so much money...!{EXTRA_MSG}" \ + " Zzz... Meep...\n" \ + "You can't carry any more money...")) + +#define KEC_ITEMS_ASLEEP_DLG_15 (_( \ + " Zzz... Huh?{WAIT_PRESS}\n" \ + "Meep meep...\n" \ + "You don't seem to have anything to sell?")) + +#define KEC_ITEMS_ASLEEP_DLG_16 (_( \ + " Zzz... Eep...?{WAIT_PRESS}\n" \ + "Meep... You don't seem to have\n" \ + "anything...?")) + +#define KEC_ITEMS_ASLEEP_DLG_17 (_( \ + " Zzz... Oh, my!{WAIT_PRESS}\n" \ + "Meep... You have no space...")) + +#define KEC_ITEMS_ASLEEP_DLG_18 (_( \ + " Zzz... Uh-oh?!{WAIT_PRESS}\n" \ + "Eep!\n" \ + "Sold out! All gone!")) + +#define KEC_ITEMS_ASLEEP_DLG_19 (_( \ + " Zzz... Huh, my...!{WAIT_PRESS}\n" \ + "Meep... Meep...\n" \ + "You don't have enough money!")) + +#define KEC_ITEMS_ASLEEP_DLG_20 (_( \ + " Zzz... Whoa...{WAIT_PRESS}\n" \ + "I... I can't take that!")) + +#define KEC_ITEMS_ASLEEP_DLG_21 (_( \ + " Zzz... Hunh, what...?{WAIT_PRESS}\n" \ + "Zzz... You can't hold any more money...")) + +#define KEC_ITEMS_ASLEEP_DLG_22 (_( \ + " Zzzzzz...\n" \ + "I sell items...{EXTRA_MSG}" \ + " Items... Meep meep...\n" \ + "Are useful in dungeons...{EXTRA_MSG}" \ + " Use... Zzz... Huh...?\n" \ + "Your imagination...and be clever...\n" \ + "With them...")) + + + +#define KEC_WARES_AWAKE_DLG_00 (_( \ + " Welcome to Kecleon Wares!\n" \ + "The shop for Orbs and TMs〜♪ ")) + +#define KEC_WARES_AWAKE_DLG_01 (_( \ + " May I assist you in any\n" \ + "other way?")) + +#define KEC_WARES_AWAKE_DLG_02 (_( \ + " Thank you so much!\n" \ + "Please do visit again〜♪ ")) + +#define KEC_WARES_AWAKE_DLG_03 (_( \ + " Ah, very well!\n" \ + "Do examine my merchandise.\n" \ + "I have chosen it with pride〜♪ ")) + +#define KEC_WARES_AWAKE_DLG_04 (_( \ + " Do you wish to purchase\n" \ + "anything else?")) + +#define KEC_WARES_AWAKE_DLG_05 (_( \ + " {COLOR GREEN}{MOVE_ITEM_0}{RESET}, you say?\n" \ + "That will be {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" \ + "Is that acceptable?")) + +#define KEC_WARES_AWAKE_DLG_06 (_( \ + " Thank you so much〜♪\n" \ + "A very good choice!")) + +#define KEC_WARES_AWAKE_DLG_07 (_( \ + " Ah, very well!\n" \ + "What do you wish to sell?")) + +#define KEC_WARES_AWAKE_DLG_08 (_( \ + " Do you wish to sell me\n" \ + "anything else?")) + +#define KEC_WARES_AWAKE_DLG_09 (_( \ + " {COLOR GREEN}{MOVE_ITEM_0}{RESET}, you say?\n" \ + "For that, I can offer {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" \ + "Is that acceptable?")) + +#define KEC_WARES_AWAKE_DLG_10 (_( \ + " For all that I can buy, I can\n" \ + "offer you {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" \ + "Is that acceptable?")) + +#define KEC_WARES_AWAKE_DLG_11 (_( \ + " Fine, fine, we have a deal!\n" \ + "Thank you so much〜♪ ")) + +#define KEC_WARES_AWAKE_DLG_12 (_( \ + " ...{WAIT_PRESS}I am all out of wares...\n" \ + "I am so sorry, my friend...{EXTRA_MSG}" \ + " Tomorrow!\n" \ + "Tomorrow I shall have more wares!")) + +#define KEC_WARES_AWAKE_DLG_13 (_( \ + " Oh?{WAIT_PRESS}\n" \ + "My friend, you seem not to have\n" \ + "enough money?")) + +#define KEC_WARES_AWAKE_DLG_14 (_( \ + " Oh, my, my!\n" \ + "My friend, you have too much money!{EXTRA_MSG}" \ + " You can't carry any more\n" \ + "money than you have now.")) + +#define KEC_WARES_AWAKE_DLG_15 (_( \ + " Oh, oh, oh?{WAIT_PRESS}\n" \ + "My friend, you seem to not have anything\n" \ + "that you can sell?")) + +#define KEC_WARES_AWAKE_DLG_16 (_( \ + " Oh?{WAIT_PRESS}\n" \ + "My friend, you seem to have nothing?")) + +#define KEC_WARES_AWAKE_DLG_17 (_( \ + " Oh, dear me!{WAIT_PRESS}\n" \ + "My friend, you've run out of space for\n" \ + "my wares!")) + +#define KEC_WARES_AWAKE_DLG_18 (_( \ + " Oh? Uh-oh!{WAIT_PRESS}\n" \ + "My shelves are bare of wares!{EXTRA_MSG}" \ + " I am completely sold out,\n" \ + "my friend!")) + +#define KEC_WARES_AWAKE_DLG_19 (_( \ + " Eep! Oh, dear!{WAIT_PRESS}\n" \ + "You're short on money, my friend!")) + +#define KEC_WARES_AWAKE_DLG_20 (_( \ + " Whoa, whoa!{WAIT_PRESS}\n" \ + "I... I can't accept anything like that!")) + +#define KEC_WARES_AWAKE_DLG_21 (_( \ + " Oh, no, no!{WAIT_PRESS}\n" \ + "My friend, you cannot add to your money!\n" \ + "I cannot do this.")) + +#define KEC_WARES_AWAKE_DLG_22 (_( \ + " Wonder Orbs are very,\n" \ + "very convenient〜♪{EXTRA_MSG}" \ + " However, they disappear\n" \ + "after one use...{WAIT_PRESS}\n" \ + "But they are useful in a pinch!{EXTRA_MSG}" \ + " Use them cleverly, and your\n" \ + "adventures will be made much easier〜♪{EXTRA_MSG}" \ + " And moves...{WAIT_PRESS}\n" \ + "They are the ultimate power!{EXTRA_MSG}" \ + " Smash rocks!{WAIT_PRESS} Fly!{WAIT_PRESS}\n" \ + "There are many kinds of moves, all of\n" \ + "them dynamic, yet elegant!{EXTRA_MSG}" \ + " There are even moves of\n" \ + "obscure rarity...{WAIT_PRESS}\n" \ + "Simply gorgeous, they are!{EXTRA_MSG}" \ + " Now, we have these moves!{WAIT_PRESS}\n" \ + "They can be learned using our Technical\n" \ + "Machines, or TMs for short!{EXTRA_MSG}" \ + " You see?\n" \ + "Isn't it exciting? Even dreamy?{EXTRA_MSG}" \ + " Why, it gets me so excited,\n" \ + "my color has turned a rosy tint!{EXTRA_MSG}" \ + " I do hope you will shop\n" \ + "with us--me and my brother next to\n" \ + "me!")) + + + +#define KEC_WARES_ASLEEP_DLG_00 (_( \ + " Zzzzzz...\n" \ + "This is...my shop...")) + +#define KEC_WARES_ASLEEP_DLG_01 (_( \ + " Reep...\n" \ + "Anything else?")) + +#define KEC_WARES_ASLEEP_DLG_02 (_( \ + " Thank... Reep eep...\n" \ + "Come again...")) + +#define KEC_WARES_ASLEEP_DLG_03 (_( \ + " Ah... Zzz...\n" \ + "My merchandise...")) + +#define KEC_WARES_ASLEEP_DLG_04 (_( \ + " Anything? Zzz...\n" \ + "Buying anything else?")) + +#define KEC_WARES_ASLEEP_DLG_05 (_( \ + " Zzzzzz...\n" \ + "{COLOR GREEN}{MOVE_ITEM_0}{RESET} is {COLOR CYAN}{VALUE_0}{RESET} {POKE}...\n" \ + "OK?")) + +#define KEC_WARES_ASLEEP_DLG_06 (_( \ + " Zzz... Reep!\n" \ + "Thank you...")) + +#define KEC_WARES_ASLEEP_DLG_07 (_( \ + " Zzz... Eep...?\n" \ + "What will you sell...?")) + +#define KEC_WARES_ASLEEP_DLG_08 (_( \ + " Reep reep... Eep...\n" \ + "Anything else for sale?")) + +#define KEC_WARES_ASLEEP_DLG_09 (_( \ + " Zzzzzz... Zzzzzz...?\n" \ + "{COLOR GREEN}{MOVE_ITEM_0}{RESET}?\n" \ + "Is {COLOR CYAN}{VALUE_0}{RESET} {POKE} OK?")) + +#define KEC_WARES_ASLEEP_DLG_10 (_( \ + " Zzz... Reep, what...?\n" \ + "For all that I can buy, I will pay\n" \ + "{COLOR CYAN}{VALUE_0}{RESET} {POKE}... OK?")) + +#define KEC_WARES_ASLEEP_DLG_11 (_( \ + " Fine... Reep reep...\n" \ + "Done deal!\n" \ + "Thank you...")) + +#define KEC_WARES_ASLEEP_DLG_12 (_( \ + " ...{WAIT_PRESS}Zzz...\n" \ + "I am all sold out... Sorry...")) + +#define KEC_WARES_ASLEEP_DLG_13 (_( \ + " Reep eep! Oh?{WAIT_PRESS}\n" \ + "Eep...?\n" \ + "You have no money?")) + +#define KEC_WARES_ASLEEP_DLG_14 (_( \ + " Eep...? Zzz...\n" \ + "You have too much money!{EXTRA_MSG}" \ + " Zzz... Eh?\n" \ + "You can't hold any more money...")) + +#define KEC_WARES_ASLEEP_DLG_15 (_( \ + " Zzz... Oh...?{WAIT_PRESS}\n" \ + "You have nothing to sell...\n" \ + "Hunh?")) + +#define KEC_WARES_ASLEEP_DLG_16 (_( \ + " Zzzzzz... Oh?{WAIT_PRESS}\n" \ + "You've got nothing...")) + +#define KEC_WARES_ASLEEP_DLG_17 (_( \ + " Zzz... Hunh? Oh...{WAIT_PRESS}\n" \ + "Reep... No room... Reep...\n" \ + "No room for my wares...")) + +#define KEC_WARES_ASLEEP_DLG_18 (_( \ + " Zzz... Uh-oh...{WAIT_PRESS}\n" \ + "All gone!\n" \ + "I am sold out...")) + +#define KEC_WARES_ASLEEP_DLG_19 (_( \ + " Reep...? Eep!{WAIT_PRESS}\n" \ + "Not enough money!")) + +#define KEC_WARES_ASLEEP_DLG_20 (_( \ + " Zzz... Hunh? Wha--? Whoa!{WAIT_PRESS}\n" \ + "I... I can't accept anything like that!")) + +#define KEC_WARES_ASLEEP_DLG_21 (_( \ + " Zzz... Eep? No, no...{WAIT_PRESS}\n" \ + "You cannot hold any more money...")) + +#define KEC_WARES_ASLEEP_DLG_22 (_( \ + " Zzz... Reep reep...\n" \ + "Wonder Orbs are convenient...{EXTRA_MSG}" \ + " Zzzzzz...\n" \ + "They disappear after one use...{EXTRA_MSG}" \ + " Zzz... And moves...\n" \ + "They are ultimate...{EXTRA_MSG}" \ + " Zzz... Eep...\n" \ + "Learn moves with Technical Machines...{EXTRA_MSG}" \ + " Zzz...\n" \ + "My good wares...\n" \ + "Come buy... Reep...")) diff --git a/src/data/locale/makuhita_dojo_usa.h b/src/data/locale/makuhita_dojo_usa.h new file mode 100644 index 000000000..1b456a3f2 --- /dev/null +++ b/src/data/locale/makuhita_dojo_usa.h @@ -0,0 +1,155 @@ +#define MAKU_AWAKE_DLG_0 (_( \ + " This is the Makuhita Dojo!{WAIT_PRESS}\n" \ + "Through rigorous training, one begets\n" \ + "true power.")) + +#define MAKU_AWAKE_DLG_1 (_(" What else do you seek?")) + +#define MAKU_AWAKE_DLG_2 (_( \ + " Fine, farewell.\n" \ + "Return if you seek more training.")) + +#define MAKU_AWAKE_DLG_3 (_(" Where do you wish to train?")) + +#define MAKU_AWAKE_DLG_4 (_( \ + " The {POKEMON_0}?{WAIT_PRESS}\n" \ + "Your decision stands!{WAIT_PRESS}\n" \ + "Let the training begin!")) + +#define MAKU_AWAKE_DLG_5 (_( \ + " Aiyah...{WAIT_PRESS}\n" \ + "You failed to reach the end...{WAIT_PRESS}\n" \ + "More training is what you need.{EXTRA_MSG}" \ + " But effort is never wasted!{EXTRA_MSG}" \ + " Learn from this and move\n" \ + "forward!")) + +#define MAKU_AWAKE_DLG_6 (_( \ + " Ah...\n" \ + "You have succeeded in your training!{EXTRA_MSG}" \ + " You've shown your worth!{WAIT_PRESS}\n" \ + "Without a doubt, you have grown more\n" \ + "powerful from your training!{EXTRA_MSG}" \ + " May this success drive\n" \ + "you to train even harder!")) + +#define MAKU_AWAKE_DLG_7 (_( \ + " Ah...\n" \ + "You have succeeded in your training!{EXTRA_MSG}" \ + " You've shown your worth!{WAIT_PRESS}\n" \ + "Without a doubt, you have grown more\n" \ + "powerful from your training!{WAIT_PRESS} Wait...{WAIT_PRESS} ...{EXTRA_MSG}" \ + " Wuh?{WAIT_PRESS}\n" \ + "What, what, what?!{EXTRA_MSG}" \ + " Did you maybe...{WAIT_PRESS}\n" \ + "Conquer all the training courses?{EXTRA_MSG}" \ + " That's...{WAIT_PRESS} Amazing! You!{WAIT_PRESS}\n" \ + "Congratulations!{EXTRA_MSG}" \ + " I promised!{WAIT_PRESS}\n" \ + "I promised you a reward for completing\n" \ + "the training courses!{EXTRA_MSG}" \ + " So... Here it is!{WAIT_PRESS}\n" \ + "My {COLOR GREEN_I}Bonsly Doll{RESET}!{EXTRA_MSG}" \ + " Isn't it smashing? Hey?!")) + +#define MAKU_AWAKE_DLG_8 (_( \ + " Don't let up on your training!\n" \ + "Keep bettering yourself!{EXTRA_MSG}" \ + " May you never lose your\n" \ + "drive!")) + +#define MAKU_AWAKE_DLG_9 (_( \ + " This dojo was founded to\n" \ + "support the efforts of rescue teams.{EXTRA_MSG}" \ + " Train in different rooms to\n" \ + "level up...{WAIT_PRESS}\n" \ + "And toughen up your rescue team.{EXTRA_MSG}" \ + " Also...{WAIT_PRESS}\n" \ + "In the {COLOR YELLOW_D}Fire Maze{RESET} you will find only\n" \ + "Fire-type PokĂ©mon.{EXTRA_MSG}" \ + " In the {COLOR YELLOW_D}Water Maze{RESET} there\n" \ + "will only be Water-type PokĂ©mon.{EXTRA_MSG}" \ + " In such ways, only one type\n" \ + "of PokĂ©mon will be in a given room.\n" \ + "Study how types match up in battle.{EXTRA_MSG}" \ + " The PokĂ©mon in this dojo,\n" \ + "by the way, are all volunteers.{EXTRA_MSG}" \ + " They are participating\n" \ + "because they want to see rescue teams\n" \ + "succeed.{EXTRA_MSG}" \ + " The only thanks they expect\n" \ + "is to see you become stronger.\n" \ + "Don't let them down!{EXTRA_MSG}" \ + " There's more.{WAIT_PRESS}\n" \ + "For a rescue team that successfully\n" \ + "completes all training courses...{EXTRA_MSG}" \ + " I have a special reward!{EXTRA_MSG}" \ + " Let that compel you to train\n" \ + "harder!")) + + + +#define MAKU_ASLEEP_DLG_0 (_( \ + " Zzznarr... Zzznarr...\n" \ + "Makuhita... Dojo...")) + +#define MAKU_ASLEEP_DLG_1 (_( \ + " Zzznarr... Urr?\n" \ + "What else?")) + +#define MAKU_ASLEEP_DLG_2 (_( \ + " Urr... Narr...\n" \ + "See you...")) + +#define MAKU_ASLEEP_DLG_3 (_( \ + " Zzznarr... Zzz...\n" \ + "Train where?")) + +#define MAKU_ASLEEP_DLG_4 (_( \ + " Zzz... Narr...\n" \ + "{POKEMON_0}? 'K, go...")) + +#define MAKU_ASLEEP_DLG_5 (_( \ + " Aiyah... Zzznarr...\n" \ + "Didn't finish...{EXTRA_MSG}" \ + " Zzz... Urr?\n" \ + "No giving up...")) + +#define MAKU_ASLEEP_DLG_6 (_( \ + " Ah... Zzznarr...\n" \ + "Cleared it...{EXTRA_MSG}" \ + " Congrazzz...\n" \ + "Keep going... Zzz...")) + +#define MAKU_ASLEEP_DLG_7 (_( \ + " Ah... Zzznarr...\n" \ + "Cleared it...{EXTRA_MSG}" \ + " Zzzznarr... Urr...\n" \ + "Good going... Keep going...{WAIT_PRESS}\n" \ + "Hunh...{WAIT_PRESS} ...{EXTRA_MSG}" \ + " Gwoh?{WAIT_PRESS}\n" \ + "Gwogwogwoh?{EXTRA_MSG}" \ + " Mugawah?\n" \ + "Cleared everything?{EXTRA_MSG}" \ + " Zzznarr!\n" \ + "Congrazzz...{EXTRA_MSG}" \ + " Zzznarr... Zzznarr...\n" \ + "Your reward...\n" \ + "Promised...{EXTRA_MSG}" \ + " Zzz... Urr!\n" \ + "{COLOR GREEN_I}Bonsly Doll{RESET}...")) + +#define MAKU_ASLEEP_DLG_8 (_( \ + " Zzznarr... Zzz...!\n" \ + "Keep working...")) + +#define MAKU_ASLEEP_DLG_9 (_( \ + " Zzznarr... Zzz...\n" \ + "This dojo...\n" \ + "Help rescue teams...{EXTRA_MSG}" \ + " Zzznarr... Urr...\n" \ + "Train in different rooms to level up...{EXTRA_MSG}" \ + " Zzznarr... Urr!\n" \ + "Make stronger rescue team...{EXTRA_MSG}" \ + " Urr... Zzznarr!\n" \ + "Don't let up!")) diff --git a/src/data/locale/personality_test1_usa.h b/src/data/locale/personality_test1_usa.h new file mode 100644 index 000000000..d548b2897 --- /dev/null +++ b/src/data/locale/personality_test1_usa.h @@ -0,0 +1,769 @@ +#define HARDY_Q1 (_( \ + "A test is coming up.\n" \ + "How do you study for it?")) + +#define HARDY_Q1_A0 (_("Study hard.")) +#define HARDY_Q1_A1 (_("At the last second.")) +#define HARDY_Q1_A2 (_("Ignore it and play.")) + + + +#define HARDY_Q2 (_("Can you focus on something you like?")) + +#define HARDY_Q2_A0 (_("Yes.")) +#define HARDY_Q2_A1 (_("No. ")) + + + +#define HARDY_Q3 (_( \ + "When the going gets tough, do you get\n" \ + "going?")) + +#define HARDY_Q3_A0 (_("Yes.")) +#define HARDY_Q3_A1 (_("No.")) + + + +#define HARDY_Q4 (_( \ + "There is a bucket. If you put\n" \ + "water in it, how high will you fill it?")) + +#define HARDY_Q4_A0 (_("Full.")) +#define HARDY_Q4_A1 (_("Half.")) +#define HARDY_Q4_A2 (_("A little.")) + + + +#define DOCILE_Q1 (_( \ + "You are offered a choice of two gifts.\n" \ + "Which one will you take?")) + +#define DOCILE_Q1_A0 (_("Big box.")) +#define DOCILE_Q1_A1 (_("Small box.")) + + + +#define DOCILE_Q2 (_( \ + "You broke a rotten egg in your room!\n" \ + "What will you do?")) + +#define DOCILE_Q2_A0 (_("Open a window right away.")) +#define DOCILE_Q2_A1 (_("Take a sniff first.")) + + + +#define DOCILE_Q3 (_( \ + "A friend brought over something you'd\n" \ + "forgotten.{WAIT_PRESS}\n" \ + "How do you thank your friend?")) + +#define DOCILE_Q3_A0 (_("Say thank you regularly.")) +#define DOCILE_Q3_A1 (_("Say thanks with a joke.")) +#define DOCILE_Q3_A2 (_("Say thanks, but be cool.")) + + + +#define DOCILE_Q4 (_("There is a wallet at the side of a road.")) + +#define DOCILE_Q4_A0 (_("Turn it in to the police!")) +#define DOCILE_Q4_A1 (_("Yay! Yay!")) +#define DOCILE_Q4_A2 (_("Is anyone watching...?")) + + + +#define BRAVE_Q1 (_( \ + "You're going bungee jumping for the first\n" \ + "time.{EXTRA_MSG}Since it's scary, you decide to test the\n" \ + "jump with a doll...{WAIT_PRESS}\n" \ + "And the bungee cord snaps!{EXTRA_MSG}" \ + "Will you still try to make a jump anyway?")) + +#define BRAVE_Q1_A0 (_("Yes.")) +#define BRAVE_Q1_A1 (_("No.")) + + + +#define BRAVE_Q2A (_( \ + "There is an alien invasion!\n" \ + "What will you do?")) + +#define BRAVE_Q2A_A0 (_("Fight.")) +#define BRAVE_Q2A_A1 (_("Run.")) +#define BRAVE_Q2A_A2 (_("Ignore it.")) + + + +#define BRAVE_Q2B (_( \ + "You valiantly fight the aliens...{WAIT_PRESS}\n" \ + "But, you are defeated...{EXTRA_MSG}An alien says to you...{EXTRA_MSG}“YOU HAVE IMPRESSED US.\n" \ + "IT WAS A PLEASURE TO SEE.{EXTRA_MSG}JOIN US, AND TOGETHER WE SHALL\n" \ + "RULE THE WORLD.”{WAIT_PRESS}\n" \ + "What will you do?")) + +#define BRAVE_Q2B_A0 (_("Rule with the aliens.")) +#define BRAVE_Q2B_A1 (_("Refuse.")) + + + +#define BRAVE_Q3 (_( \ + "There is a scream from behind a door!{WAIT_PRESS}\n" \ + "How will you react?")) + +#define BRAVE_Q3_A0 (_("Yank open the door.")) +#define BRAVE_Q3_A1 (_("Scream in unison.")) + + + +#define BRAVE_Q4 (_( \ + "A delinquent is hassling a girl on\n" \ + "a busy city street!{WAIT_PRESS}\n" \ + "What will you do?")) + +#define BRAVE_Q4_A0 (_("Help without hesitation.")) +#define BRAVE_Q4_A1 (_("Help, even if scared.")) +#define BRAVE_Q4_A2 (_("Call the police.")) +#define BRAVE_Q4_A3 (_("Do nothing out of fear.")) + + + +#define JOLLY_Q1 (_("Are you a cheerful personality?")) + +#define JOLLY_Q1_A0 (_("Yes.")) +#define JOLLY_Q1_A1 (_("No.")) + + + +#define JOLLY_Q2 (_( \ + "Do you like to noisily enjoy yourself\n" \ + "with others?")) + +#define JOLLY_Q2_A0 (_("Yes.")) +#define JOLLY_Q2_A1 (_("No.")) + + + +#define JOLLY_Q3 (_( \ + "It's the summer holidays!\n" \ + "Where would you like to go?")) + +#define JOLLY_Q3_A0 (_("The beach!")) +#define JOLLY_Q3_A1 (_("Spas.")) +#define JOLLY_Q3_A2 (_("Anywhere.")) + + + +#define JOLLY_Q4 (_( \ + "A foreign person has started up a\n" \ + "conversation with you.{EXTRA_MSG}" \ + "To be honest, you don't have a clue what\n" \ + "this fellow is saying.{WAIT_PRESS}\n" \ + "How do you reply?")) + +#define JOLLY_Q4_A0 (_("Haha! Yes. Very funny!")) +#define JOLLY_Q4_A1 (_("Um... Could you say that again?")) +#define JOLLY_Q4_A2 (_("Right... Well, I gotta go.")) + + + +#define IMPISH_Q1 (_("Have you ever made a pitfall trap?")) + +#define IMPISH_Q1_A0 (_("Yes.")) +#define IMPISH_Q1_A1 (_("No.")) + + + +#define IMPISH_Q2 (_("Do you like pranks?")) + +#define IMPISH_Q2_A0 (_("Yes.")) +#define IMPISH_Q2_A1 (_("No.")) + + + +#define IMPISH_Q3 (_("Are there many things that you would like\nto do?")) + +#define IMPISH_Q3_A0 (_("Yes.")) +#define IMPISH_Q3_A1 (_("No.")) + + + +#define IMPISH_Q4 (_( \ + "Your friend is being bullied!\n" \ + "What do you do?")) + +#define IMPISH_Q4_A0 (_("Face up to the bully.")) +#define IMPISH_Q4_A1 (_("Caution the bully from afar.")) +#define IMPISH_Q4_A2 (_("Heckle the bully from behind.")) + + + +#define NAIVE_Q1 (_("Do you like groan-inducing puns?")) + +#define NAIVE_Q1_A0 (_("Love them!")) +#define NAIVE_Q1_A1 (_("A little.")) +#define NAIVE_Q1_A2 (_("Spare me.")) + + + +#define NAIVE_Q2 (_("Do you tend to laugh a lot?")) + +#define NAIVE_Q2_A0 (_("Yes.")) +#define NAIVE_Q2_A1 (_("No.")) + + + +#define NAIVE_Q3 (_("Do others often call you childish?")) + +#define NAIVE_Q3_A0 (_("Yes.")) +#define NAIVE_Q3_A1 (_("No.")) + + + +#define NAIVE_Q4 (_( \ + "Do you like to imagine things for your\n" \ + "amusement?")) + +#define NAIVE_Q4_A0 (_("Yes.")) +#define NAIVE_Q4_A1 (_("No.")) + + + +#define TIMID_Q1 (_( \ + "A human hand extends out of a toilet!\n" \ + "What would you do?")) + +#define TIMID_Q1_A0 (_("Scream and run.")) +#define TIMID_Q1_A1 (_("Close the lid without a word.")) +#define TIMID_Q1_A2 (_("Shake hands with it.")) + + + +#define TIMID_Q2 (_( \ + "Grab any digit on your left hand with your\n" \ + "right hand.{WAIT_PRESS}\n" \ + "Which digit did you grab?")) + +#define TIMID_Q2_A0 (_("Thumb.")) +#define TIMID_Q2_A1 (_("Index finger.")) +#define TIMID_Q2_A2 (_("Middle finger.")) +#define TIMID_Q2_A3 (_("Ring finger.")) +#define TIMID_Q2_A4 (_("Little finger.")) + + + +#define TIMID_Q3 (_( \ + "You are suddenly locked inside a\n" \ + "pitch-black room!{WAIT_PRESS}\n" \ + "What do you do?")) + +#define TIMID_Q3_A0 (_("Kick the door.")) +#define TIMID_Q3_A1 (_("Cry.")) +#define TIMID_Q3_A2 (_("Clean it.")) + + + +#define TIMID_Q4 (_("Can you go into a haunted house?")) + +#define TIMID_Q4_A0 (_("No problem!")) +#define TIMID_Q4_A1 (_("Uh... N-no...")) +#define TIMID_Q4_A2 (_("With someone I like.")) + + + +#define HASTY_Q1 (_( \ + "You receive a gift!{WAIT_PRESS}\n" \ + "But you don't know what's in it.{WAIT_PRESS}\n" \ + "You're curious, so what do you do?")) + +#define HASTY_Q1_A0 (_("Open it now.")) +#define HASTY_Q1_A1 (_("Open it later.")) +#define HASTY_Q1_A2 (_("Get someone to open it.")) + + + +#define HASTY_Q2 (_( \ + "You win a lottery!{WAIT_PRESS}\n" \ + "What do you do with the money?")) + +#define HASTY_Q2_A0 (_("Spend it now.")) +#define HASTY_Q2_A1 (_("Save it.")) +#define HASTY_Q2_A2 (_("Give it away.")) + + + +#define HASTY_Q3 (_( \ + "You come across a treasure chest!\n" \ + "What do you do?")) + +#define HASTY_Q3_A0 (_("Open it right away!")) +#define HASTY_Q3_A1 (_("No... Could be a trap...")) +#define HASTY_Q3_A2 (_("It's going to be empty...")) + + + +#define HASTY_Q4 (_( \ + "Your friend fails to show up for a meeting\n" \ + "at the promised time.\n" \ + "What do you do?")) + +#define HASTY_Q4_A0 (_("Become irritated.")) +#define HASTY_Q4_A1 (_("Wait patiently.")) +#define HASTY_Q4_A2 (_("Get angry and bail.")) + + + +#define SASSY_Q1 (_( \ + "Your country's leader is in front of you.\n" \ + "How do you speak to him or her?")) + +#define SASSY_Q1_A0 (_("Speak calmly.")) +#define SASSY_Q1_A1 (_("Speak nervously.")) +#define SASSY_Q1_A2 (_("WHATEVER!!")) + + + +#define SASSY_Q2 (_("Do others tell you to watch what you say?")) + +#define SASSY_Q2_A0 (_("Yes.")) +#define SASSY_Q2_A1 (_("No.")) + + + +#define SASSY_Q3 (_( \ + "Do you think you are cool?\n" \ + "Be honest.")) + +#define SASSY_Q3_A0 (_("Yes.")) +#define SASSY_Q3_A1 (_("No.")) + + + +#define SASSY_Q4 (_( \ + "Can you sincerely thank someone when you\n" \ + "feel grateful?")) + +#define SASSY_Q4_A0 (_("Yes.")) +#define SASSY_Q4_A1 (_("No.")) + + + +#define CALM_Q1 (_( \ + "Do you occasionally consider yourself\n" \ + "dull and overly cautious?")) + +#define CALM_Q1_A0 (_("Yes.")) +#define CALM_Q1_A1 (_("No.")) + + + +#define CALM_Q2 (_( \ + "Do you dream of lounging around idly\n" \ + "without much excitement?")) + +#define CALM_Q2_A0 (_("Yes.")) +#define CALM_Q2_A1 (_("No.")) + + + +#define CALM_Q3 (_("Do you like to fight?")) + +#define CALM_Q3_A0 (_("Yes.")) +#define CALM_Q3_A1 (_("No.")) + + + +#define CALM_Q4 (_("Do you often yawn?")) + +#define CALM_Q4_A0 (_("Yes.")) +#define CALM_Q4_A1 (_("No.")) + + + +#define RELAXED_Q1 (_("Are you often late for school or meetings?")) + +#define RELAXED_Q1_A0 (_("Yes.")) +#define RELAXED_Q1_A1 (_("No.")) + + + +#define RELAXED_Q2 (_( \ + "Do you get the feeling that you've slowed\n" \ + "down lately?")) + +#define RELAXED_Q2_A0 (_("Yes.")) +#define RELAXED_Q2_A1 (_("No.")) + + + +#define RELAXED_Q3 (_( \ + "It is a pleasant day at the beach.\n" \ + "How do you feel?")) + +#define RELAXED_Q3_A0 (_("This feels great!")) +#define RELAXED_Q3_A1 (_("Snore...")) +#define RELAXED_Q3_A2 (_("I want to go home soon!")) + + + +#define RELAXED_Q4 (_("Do you fall asleep without noticing?")) + +#define RELAXED_Q4_A0 (_("Yes.")) +#define RELAXED_Q4_A1 (_("No.")) + + + +#define LONELY_Q1 (_("Do you feel lonesome when you are alone?")) + +#define LONELY_Q1_A0 (_("Yes.")) +#define LONELY_Q1_A1 (_("No.")) + + + +#define LONELY_Q2 (_( \ + "Do you hate to be the last person to leave\n" \ + "class at the end of a school day?")) + +#define LONELY_Q2_A0 (_("Yes.")) +#define LONELY_Q2_A1 (_("No.")) + + + +#define LONELY_Q3 (_( \ + "What do you do with your room's light\n" \ + "when you're going to bed at night?")) + +#define LONELY_Q3_A0 (_("Leave it on.")) +#define LONELY_Q3_A1 (_("Turn it off.")) + + + +#define LONELY_Q4 (_( \ + "It's a weekend, but no one will play\n" \ + "with you...\n" \ + "What do you do?")) + +#define LONELY_Q4_A0 (_("Go on a trip.")) +#define LONELY_Q4_A1 (_("Hang around vacantly.")) +#define LONELY_Q4_A2 (_("Huddle in a corner.")) + + + +#define QUIRKY_Q1 (_( \ + "Do you sometimes run out of things to do\n" \ + "all of a sudden?")) + +#define QUIRKY_Q1_A0 (_("Yes.")) +#define QUIRKY_Q1_A1 (_("No.")) + + + +#define QUIRKY_Q2 (_("How quickly do you respond to an e-mail?")) + +#define QUIRKY_Q2_A0 (_("Reply right away.")) +#define QUIRKY_Q2_A1 (_("May reply, may not.")) +#define QUIRKY_Q2_A2 (_("Too much trouble.")) + + + +#define QUIRKY_Q3 (_( \ + "There is a person you like...{WAIT_PRESS}\n" \ + "But there's no opportunity to get close.\n" \ + "What do you do?")) + +#define QUIRKY_Q3_A0 (_("Bravely declare my love.")) +#define QUIRKY_Q3_A1 (_("Might say hello...")) +#define QUIRKY_Q3_A2 (_("Pull a prank to get attention.")) +#define QUIRKY_Q3_A3 (_("Look from afar.")) + + + +#define QUIRKY_Q4 (_( \ + "The road forks to the right and left.\n" \ + "You are told there is a treasure on the\n" \ + "right side. What do you do?")) + +#define QUIRKY_Q4_A0 (_("Instantly go right.")) +#define QUIRKY_Q4_A1 (_("It's a trap! Go left.")) +#define QUIRKY_Q4_A2 (_("Choose either side.")) + + + +#define MISC_Q1 (_("On vacation outings, you want to...")) + +#define MISC_Q1_A0 (_("Go alone.")) +#define MISC_Q1_A1 (_("Go with others.")) + + + +#define MISC_Q2 (_( \ + "It's the summer festival!\n" \ + "Do you like carnivals?")) + +#define MISC_Q2_A0 (_("Love them!")) +#define MISC_Q2_A1 (_("Don't care.")) + + + +#define MISC_Q3 (_( \ + "Somebody calls you “weird but funny.”\n" \ + "How does that make you feel?")) + +#define MISC_Q3_A0 (_("Happy!")) +#define MISC_Q3_A1 (_("Not happy.")) + + + +#define DESC_HARDY (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The hardy type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You do your homework diligently,\n" \ + "{CENTER_ALIGN}and you know to eat properly.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You have strong willpower that lets\n" \ + "{CENTER_ALIGN}you complete tasks, however tough.{EXTRA_MSG}" \ + "{CENTER_ALIGN}But, you can also be stubborn to the\n" \ + "{CENTER_ALIGN}point of even feuding with friends...{EXTRA_MSG}" \ + "{CENTER_ALIGN}Nothing will go right for you when you're\n" \ + "{CENTER_ALIGN}irritated, so learn to laugh it off.{EXTRA_MSG}" \ + "{CENTER_ALIGN}A hardy person like you should be...")) + +#define DESC_DOCILE (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The docile type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You're very kindhearted.{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}Very helpful.{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}You can make friends with anyone.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You're a wonderful person.{EXTRA_MSG}" \ + "{CENTER_ALIGN}......{WAIT_PRESS}Is that going overboard?{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}I don't think so.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You yourself should be\n" \ + "{CENTER_ALIGN}the best judge of that.{EXTRA_MSG}" \ + "{CENTER_ALIGN}A docile person like you should be...")) + +#define DESC_BRAVE (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The brave type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You have a strong sense of justice.{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}You hate evil.{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}You will take on any opponent.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You are truly a hero!{EXTRA_MSG}" \ + "{CENTER_ALIGN}Go forth!{EXTRA_MSG}" \ + "{CENTER_ALIGN}For justice...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}For peace on earth...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}Fight the forces of evil!{EXTRA_MSG}" \ + "{CENTER_ALIGN}......{WAIT_PRESS}If I'm wrong...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}Work at becoming a true hero!{EXTRA_MSG}" \ + "{CENTER_ALIGN}A brave person like you should be...")) + +#define DESC_JOLLY (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The jolly type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}Always laughing and smiling,\n" \ + "{CENTER_ALIGN}you uplift everyone around you.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You love jokes!{EXTRA_MSG}" \ + "{CENTER_ALIGN}You have lots of friends, and\n" \ + "{CENTER_ALIGN}you're popular wherever you go.{EXTRA_MSG}" \ + "{CENTER_ALIGN}But sometimes you get carried away\n" \ + "{CENTER_ALIGN}and say things that get you in trouble.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You should learn to think before\n" \ + "{CENTER_ALIGN}saying or doing anything.{EXTRA_MSG}" \ + "{CENTER_ALIGN}A jolly person like you should be...")) + +#define DESC_IMPISH (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The impish type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You're playful, cheerful,\n" \ + "{CENTER_ALIGN}and you love pranks.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You're also kindhearted.{EXTRA_MSG}" \ + "{CENTER_ALIGN}That's why the people around\n" \ + "{CENTER_ALIGN}you find you so irresistible.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You must be the most\n" \ + "{CENTER_ALIGN}popular person around!{EXTRA_MSG}" \ + "{CENTER_ALIGN}Oh?{WAIT_PRESS} You're not that popular?{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}You're either being modest...\n" \ + "{CENTER_ALIGN}or you just don't notice it.{EXTRA_MSG}" \ + "{CENTER_ALIGN}I bet people are just too shy\n" \ + "{CENTER_ALIGN}to let their feelings be known.{EXTRA_MSG}" \ + "{CENTER_ALIGN}There's someone out there who's\n" \ + "{CENTER_ALIGN}afraid to declare their love for you!{EXTRA_MSG}" \ + "{CENTER_ALIGN}An impish person like you should be...")) + +#define DESC_NAIVE (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The naive type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You are highly curious,\n" \ + "{CENTER_ALIGN}and you love rare things.{EXTRA_MSG}" \ + "{CENTER_ALIGN}Your cheerful and carefree\n" \ + "{CENTER_ALIGN}attitude should make things fun\n" \ + "{CENTER_ALIGN}for the people around you.{EXTRA_MSG}" \ + "{CENTER_ALIGN}But you do have one flaw.\n" \ + "{CENTER_ALIGN}You can be childish.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You can never sit still.\n" \ + "{CENTER_ALIGN}You're always on the move.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You can also be selfish,\n" \ + "{CENTER_ALIGN}so you should watch yourself.{EXTRA_MSG}" \ + "{CENTER_ALIGN}A naive person like you should be...")) + +#define DESC_TIMID (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The timid type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You may find it hard to go\n" \ + "{CENTER_ALIGN}to the washroom at night.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You may also find it too frightening\n" \ + "{CENTER_ALIGN}to go back to school to get something\n" \ + "{CENTER_ALIGN}you left behind in class.{EXTRA_MSG}" \ + "{CENTER_ALIGN}If you're ever walking on a dark\n" \ + "{CENTER_ALIGN}street at night, you probably turn\n" \ + "{CENTER_ALIGN}around often to check behind you.{EXTRA_MSG}" \ + "{CENTER_ALIGN}But your timid nature is\n" \ + "{CENTER_ALIGN}also your good point!{EXTRA_MSG}" \ + "{CENTER_ALIGN}Because those who know fear are\n" \ + "{CENTER_ALIGN}those who know true courage.{EXTRA_MSG}" \ + "{CENTER_ALIGN}A timid person like you should be...")) + +#define DESC_HASTY (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The hasty type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You like to take charge\n" \ + "{CENTER_ALIGN}and get things done.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You're a real go-getter.{EXTRA_MSG}" \ + "{CENTER_ALIGN}But are you also stressed out?{EXTRA_MSG}" \ + "{CENTER_ALIGN}You get irritated when your\n" \ + "{CENTER_ALIGN}friends don't show up on time.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You get frustrated when things\n" \ + "{CENTER_ALIGN}don't turn out the way you expect.{EXTRA_MSG}" \ + "{CENTER_ALIGN}Maybe you jab the elevator button\n" \ + "{CENTER_ALIGN}if the elevator is slow to arrive.{EXTRA_MSG}" \ + "{CENTER_ALIGN}...Maybe you're already jabbing\n" \ + "{CENTER_ALIGN}the A Button repeatedly now.{EXTRA_MSG}" \ + "{CENTER_ALIGN}Beware--getting too easily irritated\n" \ + "{CENTER_ALIGN}just isn't good for your well-being.{EXTRA_MSG}" \ + "{CENTER_ALIGN}A hasty person like you should be...")) + +#define DESC_SASSY (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The sassy type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You tend to be somewhat cynical.{EXTRA_MSG}" \ + "{CENTER_ALIGN}Despite that, there is something\n" \ + "{CENTER_ALIGN}appealing and lovable about you.{EXTRA_MSG}" \ + "{CENTER_ALIGN}But do you occasionally say something\n" \ + "{CENTER_ALIGN}arrogant that angers others?{EXTRA_MSG}" \ + "{CENTER_ALIGN}Do you make that mistake?{EXTRA_MSG}" \ + "{CENTER_ALIGN}Or have people called you\n" \ + "{CENTER_ALIGN}conceited, vain, or selfish?{EXTRA_MSG}" \ + "{CENTER_ALIGN}Have people said that about you?{EXTRA_MSG}" \ + "{CENTER_ALIGN}Huh?{WAIT_PRESS} You're telling me to get lost?{EXTRA_MSG}" \ + "{CENTER_ALIGN}Why, you... Come here and say that!{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}......Gasp!{EXTRA_MSG}" \ + "{CENTER_ALIGN}...I'm sorry.\n" \ + "{CENTER_ALIGN}I let my feelings run away.\n" \ + "{CENTER_ALIGN}I truly regret this, really.{EXTRA_MSG}" \ + "{CENTER_ALIGN}Anyway, your cool and aloof\n" \ + "{CENTER_ALIGN}attitude is what defines you.{EXTRA_MSG}" \ + "{CENTER_ALIGN}It makes you exasperating and\n" \ + "{CENTER_ALIGN}appealing at the same time.{EXTRA_MSG}" \ + "{CENTER_ALIGN}A sassy person like you should be...")) + +#define DESC_CALM (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The calm type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You're capable of giving advice\n" \ + "{CENTER_ALIGN}to friends with worries.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You don't like to fight.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You're a warm, kindhearted\n" \ + "{CENTER_ALIGN}person who cares.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You must have many friends\n" \ + "{CENTER_ALIGN}who look up to you.{EXTRA_MSG}" \ + "{CENTER_ALIGN}However...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}You may also be somewhat gullible...{EXTRA_MSG}" \ + "{CENTER_ALIGN}As well as a little careless...{EXTRA_MSG}" \ + "{CENTER_ALIGN}And even a little sloppy.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You might want to keep\n" \ + "{CENTER_ALIGN}those points in mind.{EXTRA_MSG}" \ + "{CENTER_ALIGN}A calm person like you should be...")) + +#define DESC_RELAXED (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The relaxed type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}Do you occasionally\n" \ + "{CENTER_ALIGN}zone out and miss a bus?{EXTRA_MSG}" \ + "{CENTER_ALIGN}Or do you find yourself dozing off?{EXTRA_MSG}" \ + "{CENTER_ALIGN}Or is your reaction time\n" \ + "{CENTER_ALIGN}a little slower than others?{EXTRA_MSG}" \ + "{CENTER_ALIGN}But that's not necessarily\n" \ + "{CENTER_ALIGN}a bad thing.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You can do things at your own\n" \ + "{CENTER_ALIGN}tempo without feeling pressured.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You can live in a relaxed and\n" \ + "{CENTER_ALIGN}unhurried manner without worries.{EXTRA_MSG}" \ + "{CENTER_ALIGN}I think that's a happy\n" \ + "{CENTER_ALIGN}lifestyle to be envied, even.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You're also surprisingly popular.{EXTRA_MSG}" \ + "{CENTER_ALIGN}The way you vacantly stare\n" \ + "{CENTER_ALIGN}off into the distance...{EXTRA_MSG}" \ + "{CENTER_ALIGN}It should make that someone\n" \ + "{CENTER_ALIGN}special's pulse race.{EXTRA_MSG}" \ + "{CENTER_ALIGN}A relaxed person like you should be...")) + +#define DESC_LONELY (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The lonely type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You always act cheerful and\n" \ + "{CENTER_ALIGN}jocular around other people.{EXTRA_MSG}" \ + "{CENTER_ALIGN}But that's only because\n" \ + "{CENTER_ALIGN}you are with other people.{EXTRA_MSG}" \ + "{CENTER_ALIGN}However, when you get alone...{EXTRA_MSG}" \ + "{CENTER_ALIGN}Do you find yourself\n" \ + "{CENTER_ALIGN}feeling oddly depressed?{EXTRA_MSG}" \ + "{CENTER_ALIGN}That's why you always\n" \ + "{CENTER_ALIGN}want to be with others.{EXTRA_MSG}" \ + "{CENTER_ALIGN}But if you go around feeling\n" \ + "{CENTER_ALIGN}depressed too much...{EXTRA_MSG}" \ + "{CENTER_ALIGN}Your nutritional balance goes out\n" \ + "{CENTER_ALIGN}of wack. Eat more vegetables!{EXTRA_MSG}" \ + "{CENTER_ALIGN}However...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}It's not a bad thing\n" \ + "{CENTER_ALIGN}to feel lonely.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You know what it's like when you aren't\n" \ + "{CENTER_ALIGN}alone, so that's why you feel lonesome.{EXTRA_MSG}" \ + "{CENTER_ALIGN}And that's why you aren't really alone.{EXTRA_MSG}" \ + "{CENTER_ALIGN}A lonely person like you should be...")) + +#define DESC_QUIRKY (_( \ + "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}The quirky type.{EXTRA_MSG}" \ + "{CENTER_ALIGN}People consider you an eccentric\n" \ + "{CENTER_ALIGN}who does things at your own pace.{EXTRA_MSG}" \ + "{CENTER_ALIGN}You never break tempo.{EXTRA_MSG}" \ + "{CENTER_ALIGN}Your carefree nature makes you\n" \ + "{CENTER_ALIGN}attractive. But you also happen\n" \ + "{CENTER_ALIGN}to be somewhat childish...{EXTRA_MSG}" \ + "{CENTER_ALIGN}You are fickle and cause problems for the\n" \ + "{CENTER_ALIGN}people who have to go along with you.{EXTRA_MSG}" \ + "{CENTER_ALIGN}Maybe people are even upset\n" \ + "{CENTER_ALIGN}with you for being so fickle?{EXTRA_MSG}" \ + "{CENTER_ALIGN}If you realize how selfishly\n" \ + "{CENTER_ALIGN}you're behaving, try to think\n" \ + "{CENTER_ALIGN}before you do anything rash.{EXTRA_MSG}" \ + "{CENTER_ALIGN}A quirky person like you should be...")) + +#define GENDER_Q (_("Are you a boy or a girl?")) + +#define GENDER_A0 (_("Boy.")) +#define GENDER_A1 (_("Girl.")) + +#define STARTER_REVEAL (_( \ + "\n" \ + "{CENTER_ALIGN}The PokĂ©mon {POKEMON_0}!")) + +#define PARTNER_PROMPT (_( \ + "{CENTER_ALIGN}This is the final step.{WAIT_PRESS}\n" \ + "{CENTER_ALIGN}Who would you like to have as a partner?{EXTRA_MSG}" \ + "{CENTER_ALIGN}Choose the PokĂ©mon you want\n" \ + "{CENTER_ALIGN}as your partner from this group.")) + +#define PARTNER_NICK_PROMPT (_("{CENTER_ALIGN}What is your partner's nickname?")) + +#define END_TEXT (_( \ + "{CENTER_ALIGN}OK! We're all set!{EXTRA_MSG}" \ + "{CENTER_ALIGN}Let's get you into the\n" \ + "{CENTER_ALIGN}world of PokĂ©mon!{EXTRA_MSG}" \ + "{CENTER_ALIGN}Go for it!")) diff --git a/src/data/locale/wigglytuff_shop_usa.h b/src/data/locale/wigglytuff_shop_usa.h new file mode 100644 index 000000000..f30ad0c46 --- /dev/null +++ b/src/data/locale/wigglytuff_shop_usa.h @@ -0,0 +1,246 @@ +#define WIGGLY_AWAKE_DLG_00 (_( \ + " Friends are my treasures!\n" \ + "Welcome to the {POKEMON_6} Club--\n" \ + "a circle of friends! ")) + +#define WIGGLY_AWAKE_DLG_01 (_( \ + " Anything else I can do for\n" \ + "you?")) + +#define WIGGLY_AWAKE_DLG_02 (_( \ + " Thank you! Come again!\n" \ + "We're all friends, friend!")) + +#define WIGGLY_AWAKE_DLG_03 (_( \ + " You'd like to add to your\n" \ + "Friend Areas?\n" \ + "Which one would you like?")) + +#define WIGGLY_AWAKE_DLG_04 (_( \ + " Would you like to add\n" \ + "other Friend Areas?")) + +#define WIGGLY_AWAKE_DLG_05 (_( \ + " {COLOR GREEN}{FRIEND_AREA}{RESET}?\n" \ + "That will be {COLOR CYAN}{VALUE_0}{RESET} {POKE}.\n" \ + "Is that OK?")) + +#define WIGGLY_AWAKE_DLG_06 (_( \ + " Gotcha! Let's do it!{WAIT_PRESS}\n" \ + "{POKEMON_6}〜♪ {POKEMON_6}〜♪{WAIT_PRESS}\n" \ + "Let's be friends... Yoomtaaaaaaah!")) + +#define WIGGLY_AWAKE_DLG_07 (_( \ + " Congratulations!{WAIT_PRESS}\n" \ + "You can go to {COLOR GREEN}{FRIEND_AREA}{RESET} now!{EXTRA_MSG}" \ + " You can recruit\n" \ + "PokĂ©mon that live in the Friend Area\n" \ + "{COLOR GREEN}{FRIEND_AREA}{RESET}.")) + +#define WIGGLY_AWAKE_DLG_08 (_( \ + " Oops!{WAIT_PRESS}\n" \ + "You can't add to your Friend Areas.")) + +#define WIGGLY_AWAKE_DLG_09 (_( \ + " Um?{WAIT_PRESS}\n" \ + "You don't have any money.")) + +#define WIGGLY_AWAKE_DLG_10 (_( \ + " Oops?{WAIT_PRESS}\n" \ + "Oh, too bad.{WAIT_PRESS}\n" \ + "I'm fresh out of Friend Areas.")) + +#define WIGGLY_AWAKE_DLG_11 (_( \ + " Oops?{WAIT_PRESS}\n" \ + "It doesn't look like you have enough\n" \ + "money!")) + +#define WIGGLY_AWAKE_DLG_12 (_( \ + " Which PokĂ©mon would you\n" \ + "like to check?")) + +#define WIGGLY_AWAKE_DLG_13 (_( \ + " Is there another PokĂ©mon\n" \ + "you'd like to check?")) + +#define WIGGLY_AWAKE_DLG_14 (_( \ + " {COLOR CYAN}{POKEMON_0}{RESET}'s Friend Area\n" \ + "is {COLOR GREEN}{FRIEND_AREA}{RESET}.")) + +#define WIGGLY_AWAKE_DLG_15 (_( \ + " You can already go to the\n" \ + "Friend Area {COLOR GREEN}{FRIEND_AREA}{RESET}.")) + +#define WIGGLY_AWAKE_DLG_16 (_( \ + " {COLOR GREEN}{FRIEND_AREA}{RESET}?\n" \ + "I don't know much about it at all.{WAIT_PRESS}\n" \ + "I'll check up on it.{EXTRA_MSG}" \ + " I'll add it to the Friend\n" \ + "Areas you can buy when I find out more.")) + +#define WIGGLY_AWAKE_DLG_17 (_( \ + " {COLOR GREEN}{FRIEND_AREA}{RESET}?\n" \ + "I can't get that Friend Area for you.{WAIT_PRESS}\n" \ + "I'm really sorry.")) + +#define WIGGLY_AWAKE_DLG_18 (_( \ + " {COLOR GREEN}{FRIEND_AREA}{RESET}?\n" \ + "I can't get that Friend Area for you.{WAIT_PRESS}\n" \ + "I'm really sorry.")) + +#define WIGGLY_AWAKE_DLG_19 (_( \ + " Would you like to get more\n" \ + "friends...{WAIT_PRESS}\n" \ + "...More members for your team?{EXTRA_MSG}" \ + " To add new friends, what\n" \ + "you need are Friend Areas.{EXTRA_MSG}" \ + " A PokĂ©mon can join your\n" \ + "rescue team only after it settles in\n" \ + "the right Friend Area.{EXTRA_MSG}" \ + " So, if you want to recruit\n" \ + "new members, you should add to your\n" \ + "Friend Areas.{EXTRA_MSG}" \ + " Oh, yes, PokĂ©mon can\n" \ + "only live in the right Friend Area for\n" \ + "their species.{EXTRA_MSG}" \ + " If you're buying a Friend\n" \ + "Area, you should confirm what PokĂ©mon\n" \ + "can live there by checking {COLOR YELLOW}Info{RESET}.{EXTRA_MSG}" \ + " Also, there are some Friend\n" \ + "Areas that I don't sell.{EXTRA_MSG}" \ + " I think there are some\n" \ + "rescue missions that give you access\n" \ + "to Friend Areas, too.{EXTRA_MSG}" \ + " You should check the\n" \ + "Pelipper Post Office's Bulletin Board or\n" \ + "your Mailbox for rescue requests.{EXTRA_MSG}" \ + " You know, it makes me\n" \ + "delighted when you make new friends!")) + + +#define WIGGLY_ASLEEP_DLG_00 (_( \ + " Friends... Zzz...\n" \ + "Welcome to the {POKEMON_6} Club...")) + +#define WIGGLY_ASLEEP_DLG_01 (_( \ + " Anything? Kwoo...\n" \ + "Anything else?")) + +#define WIGGLY_ASLEEP_DLG_02 (_( \ + " Thank... Zzz... You...\n" \ + "Friends, friend...")) + +#define WIGGLY_ASLEEP_DLG_03 (_( \ + " Dwee... Hunh?\n" \ + "Friend Areas...?\n" \ + "Which one?")) + +#define WIGGLY_ASLEEP_DLG_04 (_( \ + " Zzz... Wha--?\n" \ + "More Friend Areas?")) + +#define WIGGLY_ASLEEP_DLG_05 (_( \ + " Kwoo? {COLOR GREEN}{FRIEND_AREA}{RESET}?\n" \ + "That's {COLOR CYAN}{VALUE_0}{RESET} {POKE}...\n" \ + "OK?")) + +#define WIGGLY_ASLEEP_DLG_06 (_( \ + " Zzz... Dwee... Gotcha...{WAIT_PRESS}\n" \ + "Zzz... Let's do it...{EXTRA_MSG}" \ + " Sssnore♪ Sssnore♪\n" \ + "{POKEMON_6}〜♪ {POKEMON_6}〜♪\n" \ + "Let's be friends...{EXTRA_MSG}" \ + " Kwoo!\n" \ + "Taaaaaaah!")) + +#define WIGGLY_ASLEEP_DLG_07 (_( \ + " Grats... Zzz...{WAIT_PRESS}\n" \ + "You can go to {COLOR GREEN}{FRIEND_AREA}{RESET}...{EXTRA_MSG}" \ + " Dwee... Sssnore...\n" \ + "Make friends with PokĂ©mon in...\n" \ + "{COLOR GREEN}{FRIEND_AREA}{RESET}...")) + +#define WIGGLY_ASLEEP_DLG_08 (_( \ + " Zzz... Zzz?{WAIT_PRESS}\n" \ + "Hunh...?\n" \ + "You can't add to your Friend Areas...")) + +#define WIGGLY_ASLEEP_DLG_09 (_( \ + " Hunh...?{WAIT_PRESS}\n" \ + "You don't have any money...\n" \ + "Zzzzzz...")) + +#define WIGGLY_ASLEEP_DLG_10 (_( \ + " Zzz... Hunh?{WAIT_PRESS}\n" \ + "Sssnore... Sorry...\n" \ + "Fresh out of Friend Areas...")) + +#define WIGGLY_ASLEEP_DLG_11 (_( \ + " Zzz... Dwee...? Oops?{WAIT_PRESS}\n" \ + "Not enough money?")) + +#define WIGGLY_ASLEEP_DLG_12 (_( \ + " Zzz... Kwoo...\n" \ + "Check which PokĂ©mon?")) + +#define WIGGLY_ASLEEP_DLG_13 (_( \ + " Another PokĂ©mon...\n" \ + "Zzz... Check?")) + +#define WIGGLY_ASLEEP_DLG_14 (_( \ + " Dwee... Kwoo...\n" \ + "{COLOR CYAN}{POKEMON_0}{RESET}'s Friend Area...\n" \ + "Zzz... {COLOR GREEN}{FRIEND_AREA}{RESET}...")) + +#define WIGGLY_ASLEEP_DLG_15 (_( \ + " Sssnore...\n" \ + "You can already go...\n" \ + "Friend Area {COLOR GREEN}{FRIEND_AREA}{RESET}...")) + +#define WIGGLY_ASLEEP_DLG_16 (_( \ + " Zzz... Hunh...?\n" \ + "{COLOR GREEN}{FRIEND_AREA}{RESET}...?\n" \ + "I don't know... I'll check...{EXTRA_MSG}" \ + " Sssnore...\n" \ + "I'll have it for sale...\n" \ + "When I find out...")) + +#define WIGGLY_ASLEEP_DLG_17 (_( \ + " Sssnore...\n" \ + "{COLOR GREEN}{FRIEND_AREA}{RESET}...?\n" \ + "I can't get that Friend Area...{EXTRA_MSG}" \ + " Zzz... Zzz...\n" \ + "Sorry...")) + +#define WIGGLY_ASLEEP_DLG_18 (_( \ + " Sssnore...\n" \ + "{COLOR GREEN}{FRIEND_AREA}{RESET}...?\n" \ + "I can't get that Friend Area...{EXTRA_MSG}" \ + " Zzz... Zzz...\n" \ + "Sorry...")) + +#define WIGGLY_ASLEEP_DLG_19 (_( \ + " Zzz...\n" \ + "Want more friends?{EXTRA_MSG}" \ + " Zzz... Kwoo...\n" \ + "You need Friend Areas for friends...{EXTRA_MSG}" \ + " Zzz... Zzz...\n" \ + "A PokĂ©mon becomes your pal when it's in\n" \ + "the right Friend Area...{EXTRA_MSG}" \ + " Zzz... Dwee...\n" \ + "That's why you should get more Friend\n" \ + "Areas...{EXTRA_MSG}" \ + " Zzz... PokĂ©mon can only\n" \ + "live in the right Friend Area for\n" \ + "their species...{EXTRA_MSG}" \ + " Kwoo... Sssnore...\n" \ + "See what PokĂ©mon can live there by\n" \ + "checking {COLOR YELLOW}Info{RESET}...{EXTRA_MSG}" \ + " Zzz...\n" \ + "I don't sell some Friend Areas...{EXTRA_MSG}" \ + " Kwoo...\n" \ + "Some rescue missions reward you with\n" \ + "Friend Areas...{EXTRA_MSG}" \ + " Zzz... Dwee...\n" \ + "Check the Pelipper Post Office's Bulletin\n" \ + "Board or your Mailbox for missions...")) diff --git a/src/data/main_menu2.h b/src/data/main_menu2.h index a7cb731fa..97e9b4265 100644 --- a/src/data/main_menu2.h +++ b/src/data/main_menu2.h @@ -16,11 +16,10 @@ static const UnkTextStruct2 sUnknown_80E59E0 = { NULL }; -static const MenuItem sUnknown_80E59F8[] = -{ - {"New Game", MENU_NEW_GAME}, - {"Adventure Log", MENU_ADVENTURE_LOG}, - {NULL, 0xffdd}, +static const MenuItem sUnknown_80E59F8[] = { + {_("New Game"), MENU_NEW_GAME}, + {_("Adventure Log"), MENU_ADVENTURE_LOG}, + {NULL, 0xFFDD}, }; UNUSED static const UnkTextStruct2 sUnknown_80E5A29 = { @@ -32,10 +31,9 @@ UNUSED static const UnkTextStruct2 sUnknown_80E5A29 = { NULL }; -UNUSED static const MenuItem sUnknown_80E5A44[] = -{ - {"Wonder Mail", MENU_WONDER_MAIL}, - {NULL, 0xffdd}, +UNUSED static const MenuItem sUnknown_80E5A44[] = { + {_("Wonder Mail"), MENU_WONDER_MAIL}, + {NULL, 0xFFDD}, }; static const UnkTextStruct2 sUnknown_80E5A60 = { @@ -56,25 +54,23 @@ static const UnkTextStruct2 sUnknown_80E5A78 = { NULL }; -static const MenuItem sUnknown_80E5A90[] = -{ - {"Continue", MENU_CONTINUE}, - {"Delete Save Data", MENU_DELETE_SAVE_PROMPT}, - {"Adventure Log", MENU_ADVENTURE_LOG}, - {"Friend Rescue", MENU_FRIEND_RESCUE}, - {"Trade Items", MENU_TRADE_ITEMS}, - {NULL, 0xffdd}, +static const MenuItem sUnknown_80E5A90[] = { + {_("Continue"), MENU_CONTINUE}, + {_("Delete Save Data"), MENU_DELETE_SAVE_PROMPT}, + {_("Adventure Log"), MENU_ADVENTURE_LOG}, + {_("Friend Rescue"), MENU_FRIEND_RESCUE}, + {_("Trade Items"), MENU_TRADE_ITEMS}, + {NULL, 0xFFDD}, }; -static const MenuItem sUnknown_80E5AFC[] = -{ - {"Continue", MENU_CONTINUE}, - {"Delete Save Data", MENU_DELETE_SAVE_PROMPT}, - {"Adventure Log", MENU_ADVENTURE_LOG}, - {"Friend Rescue", MENU_FRIEND_RESCUE}, - {"Trade Items", MENU_TRADE_ITEMS}, - {"Wonder Mail", MENU_WONDER_MAIL}, - {NULL, 0xffdd}, +static const MenuItem sUnknown_80E5AFC[] = { + {_("Continue"), MENU_CONTINUE}, + {_("Delete Save Data"), MENU_DELETE_SAVE_PROMPT}, + {_("Adventure Log"), MENU_ADVENTURE_LOG}, + {_("Friend Rescue"), MENU_FRIEND_RESCUE}, + {_("Trade Items"), MENU_TRADE_ITEMS}, + {_("Wonder Mail"), MENU_WONDER_MAIL}, + {NULL, 0xFFDD}, }; static const UnkTextStruct2 sUnknown_80E5B34 = { @@ -86,25 +82,23 @@ static const UnkTextStruct2 sUnknown_80E5B34 = { NULL }; -static const MenuItem sUnknown_80E5B4C[] = -{ - {"Awaiting Rescue", MENU_AWAITING_RESCUE}, - {"Delete Save Data", MENU_DELETE_SAVE_PROMPT}, - {"Adventure Log", MENU_ADVENTURE_LOG}, - {"Friend Rescue", MENU_FRIEND_RESCUE}, - {"Trade Items", MENU_TRADE_ITEMS}, - {NULL, 0xffdd}, +static const MenuItem sUnknown_80E5B4C[] = { + {_("Awaiting Rescue"), MENU_AWAITING_RESCUE}, + {_("Delete Save Data"), MENU_DELETE_SAVE_PROMPT}, + {_("Adventure Log"), MENU_ADVENTURE_LOG}, + {_("Friend Rescue"), MENU_FRIEND_RESCUE}, + {_("Trade Items"), MENU_TRADE_ITEMS}, + {NULL, 0xFFDD}, }; -static const MenuItem sUnknown_80E5B8C[] = -{ - {"Awaiting Rescue", MENU_AWAITING_RESCUE}, - {"Delete Save Data", MENU_DELETE_SAVE_PROMPT}, - {"Adventure Log", MENU_ADVENTURE_LOG}, - {"Friend Rescue", MENU_FRIEND_RESCUE}, - {"Trade Items", MENU_TRADE_ITEMS}, - {"Wonder Mail", MENU_WONDER_MAIL}, - {NULL, 0xffdd}, +static const MenuItem sUnknown_80E5B8C[] = { + {_("Awaiting Rescue"), MENU_AWAITING_RESCUE}, + {_("Delete Save Data"), MENU_DELETE_SAVE_PROMPT}, + {_("Adventure Log"), MENU_ADVENTURE_LOG}, + {_("Friend Rescue"), MENU_FRIEND_RESCUE}, + {_("Trade Items"), MENU_TRADE_ITEMS}, + {_("Wonder Mail"), MENU_WONDER_MAIL}, + {NULL, 0xFFDD}, }; static const UnkTextStruct2 sUnknown_80E5BC4 = { @@ -116,25 +110,23 @@ static const UnkTextStruct2 sUnknown_80E5BC4 = { NULL }; -static const MenuItem sUnknown_80E5BDC[] = -{ - {"Revive Team", MENU_CONTINUE}, - {"Delete Save Data", MENU_DELETE_SAVE_PROMPT}, - {"Adventure Log", MENU_ADVENTURE_LOG}, - {"Friend Rescue", MENU_FRIEND_RESCUE}, - {"Trade Items", MENU_TRADE_ITEMS}, - {NULL, 0xffdd}, +static const MenuItem sUnknown_80E5BDC[] = { + {_("Revive Team"), MENU_CONTINUE}, + {_("Delete Save Data"), MENU_DELETE_SAVE_PROMPT}, + {_("Adventure Log"), MENU_ADVENTURE_LOG}, + {_("Friend Rescue"), MENU_FRIEND_RESCUE}, + {_("Trade Items"), MENU_TRADE_ITEMS}, + {NULL, 0xFFDD}, }; -static const MenuItem sUnknown_80E5C18[] = -{ - {"Revive Team", MENU_CONTINUE}, - {"Delete Save Data", MENU_DELETE_SAVE_PROMPT}, - {"Adventure Log", MENU_ADVENTURE_LOG}, - {"Friend Rescue", MENU_FRIEND_RESCUE}, - {"Trade Items", MENU_TRADE_ITEMS}, - {"Wonder Mail", MENU_WONDER_MAIL}, - {NULL, 0xffdd}, +static const MenuItem sUnknown_80E5C18[] = { + {_("Revive Team"), MENU_CONTINUE}, + {_("Delete Save Data"), MENU_DELETE_SAVE_PROMPT}, + {_("Adventure Log"), MENU_ADVENTURE_LOG}, + {_("Friend Rescue"), MENU_FRIEND_RESCUE}, + {_("Trade Items"), MENU_TRADE_ITEMS}, + {_("Wonder Mail"), MENU_WONDER_MAIL}, + {NULL, 0xFFDD}, }; UNUSED static const UnkTextStruct2 sUnknown_80E5C50 = { @@ -146,18 +138,16 @@ UNUSED static const UnkTextStruct2 sUnknown_80E5C50 = { NULL }; -UNUSED static const MenuItem sUnknown_80E5C68[] = -{ - {"Send Items", MENU_SEND_ITEMS}, - {"Receive Items", MENU_RECEIVE_ITEMS}, - {NULL, 0xffdd}, +UNUSED static const MenuItem sUnknown_80E5C68[] = { + {_("Send Items"), MENU_SEND_ITEMS}, + {_("Receive Items"), MENU_RECEIVE_ITEMS}, + {NULL, 0xFFDD}, }; -UNUSED static const MenuItem sUnknown_80E5C9C[] = -{ - {"Send Items", -1}, - {"Receive Items", MENU_RECEIVE_ITEMS}, - {NULL, 0xffdd}, +UNUSED static const MenuItem sUnknown_80E5C9C[] = { + {_("Send Items"), -1}, + {_("Receive Items"), MENU_RECEIVE_ITEMS}, + {NULL, 0xFFDD}, }; static const UnkTextStruct2 sUnknown_80E5CB4 = { @@ -169,121 +159,69 @@ static const UnkTextStruct2 sUnknown_80E5CB4 = { NULL }; -static const u8 sUnknown_80E5CE4[]; -static const u8 sUnknown_80E5CE8[]; -static const MenuItem sUnknown_80E5CCC[] = -{ - {sUnknown_80E5CE8, 0xffde}, - {sUnknown_80E5CE4, 0xffde}, - {NULL, 0xffdd}, +static const MenuItem sUnknown_80E5CCC[] = { + {_("Start an entirely new adventure."), 0xFFDE}, + {_(" "), 0xFFDE}, + {NULL, 0xFFDD}, }; -ALIGNED(4) static const u8 sUnknown_80E5CE4[] = _(" "); -ALIGNED(4) static const u8 sUnknown_80E5CE8[] = _("Start an entirely new adventure."); -static const u8 sUnknown_80E5D24[]; -static const MenuItem sUnknown_80E5D0C[] = -{ - {sUnknown_80E5D24, 0xffde}, - {sUnknown_80E5CE4, 0xffde}, - {NULL, 0xffdd}, +static const MenuItem sUnknown_80E5D0C[] = { + {_("Check your career as an adventurer."), 0xFFDE}, + {_(" "), 0xFFDE}, + {NULL, 0xFFDD}, }; -ALIGNED(4) static const u8 sUnknown_80E5D24[] = _("Check your career as an adventurer."); -static const u8 sUnknown_80E5D60[]; -static const u8 sUnknown_80E5D88[]; -static const MenuItem sUnknown_80E5D48[] = -{ - {sUnknown_80E5D88, 0xffde}, - {sUnknown_80E5D60, 0xffde}, - {NULL, 0xffdd}, +static const MenuItem sUnknown_80E5D48[] = { + {_("This is the Debug Mode."), 0xFFDE}, + {_("It won't be in the release version."), 0xFFDE}, + {NULL, 0xFFDD}, }; -ALIGNED(4) static const u8 sUnknown_80E5D60[] = _("It won't be in the release version."); -ALIGNED(4) static const u8 sUnknown_80E5D88[] = _("This is the Debug Mode."); -static const u8 sUnknown_80E5DB8[]; -static const u8 sUnknown_80E5DCC[]; -static const MenuItem sUnknown_80E5DA0[] = -{ - {sUnknown_80E5DCC, 0xffde}, - {sUnknown_80E5DB8, 0xffde}, - {NULL, 0xffdd}, +static const MenuItem sUnknown_80E5DA0[] = { + {_("Resume your adventure from where"), 0xFFDE}, + {_("you last saved. "), 0xFFDE}, + {NULL, 0xFFDD}, }; -ALIGNED(4) static const u8 sUnknown_80E5DB8[] = _("you last saved. "); -ALIGNED(4) static const u8 sUnknown_80E5DCC[] = _("Resume your adventure from where"); -static const u8 sUnknown_80E5E08[]; -static const u8 sUnknown_80E5E34[]; -static const MenuItem sUnknown_80E5DF0[] = -{ - {sUnknown_80E5E34, 0xFFDE}, - {sUnknown_80E5E08, 0xFFDE}, - {0, 0xFFDD} +static const MenuItem sUnknown_80E5DF0[] = { + {_("This will delete your saved game data."), 0xFFDE}, + {_("{COLOR RED}Beware{RESET}! This will delete it forever!"), 0xFFDE}, + {NULL, 0xFFDD} }; -ALIGNED(4) static const u8 sUnknown_80E5E08[] = _("{COLOR RED}Beware{RESET}! This will delete it forever!"); -ALIGNED(4) static const u8 sUnknown_80E5E34[] = _("This will delete your saved game data."); -static const u8 sUnknown_80E5E74[]; -static const u8 sUnknown_80E5EA0[]; -static const MenuItem sUnknown_80E5E5C[] = -{ - {sUnknown_80E5EA0, 0xFFDE}, - {sUnknown_80E5E74, 0xFFDE}, - {0, 0xFFDD} +static const MenuItem sUnknown_80E5E5C[] = { + {_("Using a Game Link cable or"), 0xFFDE}, + {_("passwords, friends may rescue each other."), 0xFFDE}, + {NULL, 0xFFDD} }; -ALIGNED(4) static const u8 sUnknown_80E5E74[] = _("passwords, friends may rescue each other."); -ALIGNED(4) static const u8 sUnknown_80E5EA0[] = _("Using a Game Link cable or"); -static const u8 sUnknown_80E5ED4[]; -static const u8 sUnknown_80E5EF8[]; -static const MenuItem sUnknown_80E5EBC[] = -{ - {sUnknown_80E5EF8, 0xFFDE}, - {sUnknown_80E5ED4, 0xFFDE}, - {0, 0xFFDD} +static const MenuItem sUnknown_80E5EBC[] = { + {_("Using a Game Link cable, you can"), 0xFFDE}, + {_("trade stored items with a friend."), 0xFFDE}, + {NULL, 0xFFDD} }; -ALIGNED(4) static const u8 sUnknown_80E5ED4[] = _("trade stored items with a friend."); -ALIGNED(4) static const u8 sUnknown_80E5EF8[] = _("Using a Game Link cable, you can"); -static const u8 sUnknown_80E5F34[]; -static const u8 sUnknown_80E5F58[]; -static const MenuItem sUnknown_80E5F1C[] = -{ - {sUnknown_80E5F58, 0xFFDE}, - {sUnknown_80E5F34, 0xFFDE}, - {0, 0xFFDD} +static const MenuItem sUnknown_80E5F1C[] = { + {_("You are awaiting rescue by a friend."), 0xFFDE}, + {_("You can give up waiting for rescue."), 0xFFDE}, + {NULL, 0xFFDD} }; -ALIGNED(4) static const u8 sUnknown_80E5F34[] = _("You can give up waiting for rescue."); -ALIGNED(4) static const u8 sUnknown_80E5F58[] = _("You are awaiting rescue by a friend."); -static const u8 sUnknown_80E5F98[]; -static const u8 sUnknown_80E5FB0[]; static const MenuItem sUnknown_80E5F80[] = { - {sUnknown_80E5FB0, 0xFFDE}, - {sUnknown_80E5F98, 0xFFDE}, - {0, 0xFFDD} -}; -ALIGNED(4) static const u8 sUnknown_80E5F98[] = _("receive Wonder Mail."); -ALIGNED(4) static const u8 sUnknown_80E5FB0[] = _("Using passwords, you can"); - -static const u8 sUnknown_80E5FE4[]; -static const u8 sUnknown_80E6008[]; -static const MenuItem sUnknown_80E5FCC[] = -{ - {sUnknown_80E6008, 0xFFDE}, - {sUnknown_80E5FE4, 0xFFDE}, + {_("Using passwords, you can"), 0xFFDE}, + {_("receive Wonder Mail."), 0xFFDE}, {NULL, 0xFFDD} }; -ALIGNED(4) static const u8 sUnknown_80E5FE4[] = _("receive teams from your friends."); -ALIGNED(4) static const u8 sUnknown_80E6008[] = _("Using the Dual Slot function, you can"); -static const u8 sUnknown_80E6048[]; -static const u8 sUnknown_80E6070[]; -static const MenuItem sUnknown_80E6030[] = -{ - {sUnknown_80E6070, 0xFFDE}, - {sUnknown_80E6048, 0xFFDE}, +static const MenuItem sUnknown_80E5FCC[] = { + {_("Using the Dual Slot function, you can"), 0xFFDE}, + {_("receive teams from your friends."), 0xFFDE}, {NULL, 0xFFDD} }; -ALIGNED(4) static const u8 sUnknown_80E6048[] = _("go on an adventure to unknown worlds."); -ALIGNED(4) static const u8 sUnknown_80E6070[] = _("Using wireless communication, you can"); \ No newline at end of file + +static const MenuItem sUnknown_80E6030[] = { + {_("Using wireless communication, you can"), 0xFFDE}, + {_("go on an adventure to unknown worlds."), 0xFFDE}, + {NULL, 0xFFDD} +}; \ No newline at end of file diff --git a/src/data/other_menus1.h b/src/data/other_menus1.h index 094c266e8..9bfdee4bc 100644 --- a/src/data/other_menus1.h +++ b/src/data/other_menus1.h @@ -15,52 +15,40 @@ const UnkTextStruct2 sUnknown_80E6554 = { // TODO: MAKE STATIC WHEN other_menus1 NULL }; -static const u8 sUnknown_80E65C4[]; -static const u8 sUnknown_80E65AC[]; -static const u8 sUnknown_80E658C[]; -const MenuItem sUnknown_80E656C[4] = { // TODO: MAKE STATIC WHEN other_menus1.s IS DED - {sUnknown_80E65C4, 5}, - {sUnknown_80E65AC, 5}, - {sUnknown_80E658C, 5}, - {NULL, 3}, -}; -ALIGNED(4) static const u8 sUnknown_80E658C[] = _("{CENTER_ALIGN}Don't turn the power off!"); -ALIGNED(4) static const u8 sUnknown_80E65AC[] = _("{CENTER_ALIGN}Item transmitting!"); -ALIGNED(4) static const u8 sUnknown_80E65C4[] = _("{CENTER_ALIGN}{COLOR RED}Caution!{RESET} "); - -static const u8 sUnknown_80E65F8[]; -const MenuItem sUnknown_80E65D8[4] = { // TODO: MAKE STATIC WHEN other_menus1.s IS DED - {sUnknown_80E65C4, 5}, - {sUnknown_80E65F8, 5}, - {sUnknown_80E658C, 5}, - {NULL, 3}, -}; -ALIGNED(4) static const u8 sUnknown_80E65F8[] = _("{CENTER_ALIGN}Thank-You Mail in transmission!"); - -static const u8 sUnknown_80E663C[]; -const MenuItem sUnknown_80E661C[4] = { // TODO: MAKE STATIC WHEN other_menus1.s IS DED - {sUnknown_80E65C4, 5}, - {sUnknown_80E663C, 5}, - {sUnknown_80E658C, 5}, - {NULL, 3}, -}; -ALIGNED(4) static const u8 sUnknown_80E663C[] = _("{CENTER_ALIGN}A-OK Mail in transmission!"); - -const MenuItem sUnknown_80E665C[4] = { // TODO: MAKE STATIC WHEN other_menus1.s IS DED - {sUnknown_80E65C4, 5}, - {sUnknown_80E65F8, 5}, - {sUnknown_80E658C, 5}, +const MenuItem sUnknown_80E656C[] = { // TODO: MAKE STATIC WHEN other_menus1.s IS DED + {_("{CENTER_ALIGN}{COLOR RED}Caution!{RESET} "), 5}, + {_("{CENTER_ALIGN}Item transmitting!"), 5}, + {_("{CENTER_ALIGN}Don't turn the power off!"), 5}, {NULL, 3}, }; -static const u8 sUnknown_80E669C[]; -const MenuItem sUnknown_80E667C[4] = { // TODO: MAKE STATIC WHEN other_menus1.s IS DED - {sUnknown_80E65C4, 5}, - {sUnknown_80E669C, 5}, - {sUnknown_80E658C, 5}, +const MenuItem sUnknown_80E65D8[] = { // TODO: MAKE STATIC WHEN other_menus1.s IS DED + {_("{CENTER_ALIGN}{COLOR RED}Caution!{RESET} "), 5}, + {_("{CENTER_ALIGN}Thank-You Mail in transmission!"), 5}, + {_("{CENTER_ALIGN}Don't turn the power off!"), 5}, + {NULL, 3}, +}; + +const MenuItem sUnknown_80E661C[] = { // TODO: MAKE STATIC WHEN other_menus1.s IS DED + {_("{CENTER_ALIGN}{COLOR RED}Caution!{RESET} "), 5}, + {_("{CENTER_ALIGN}A-OK Mail in transmission!"), 5}, + {_("{CENTER_ALIGN}Don't turn the power off!"), 5}, + {NULL, 3}, +}; + +const MenuItem sUnknown_80E665C[] = { // TODO: MAKE STATIC WHEN other_menus1.s IS DED + {_("{CENTER_ALIGN}{COLOR RED}Caution!{RESET} "), 5}, + {_("{CENTER_ALIGN}Thank-You Mail in transmission!"), 5}, + {_("{CENTER_ALIGN}Don't turn the power off!"), 5}, + {NULL, 3}, +}; + +const MenuItem sUnknown_80E667C[] = { // TODO: MAKE STATIC WHEN other_menus1.s IS DED + {_("{CENTER_ALIGN}{COLOR RED}Caution!{RESET} "), 5}, + {_("{CENTER_ALIGN}Wonder Mail in transmission!"), 5}, + {_("{CENTER_ALIGN}Don't turn the power off!"), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E669C[] = _("{CENTER_ALIGN}Wonder Mail in transmission!"); static const UnkTextStruct2 sUnknown_80E66BC = { 0, 0, 0, 0, @@ -71,18 +59,12 @@ static const UnkTextStruct2 sUnknown_80E66BC = { NULL }; -static const u8 sUnknown_80E6734[]; -static const u8 sUnknown_80E6710[]; -static const u8 sUnknown_80E66F4[]; -static const MenuItem sUnknown_80E66D4[4] = { - {sUnknown_80E6734, 5}, - {sUnknown_80E6710, 5}, - {sUnknown_80E66F4, 5}, +static const MenuItem sUnknown_80E66D4[] = { + {_("{CENTER_ALIGN}{COLOR CYAN_G}Success!{RESET} "), 5}, + {_("{CENTER_ALIGN}Your adventure will be continued."), 5}, + {_("{CENTER_ALIGN}Please press any button."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E66F4[] = _("{CENTER_ALIGN}Please press any button."); -ALIGNED(4) static const u8 sUnknown_80E6710[] = _("{CENTER_ALIGN}Your adventure will be continued."); -ALIGNED(4) static const u8 sUnknown_80E6734[] = _("{CENTER_ALIGN}{COLOR CYAN_G}Success!{RESET} "); static const UnkTextStruct2 sUnknown_80E6748 = { 0, 0, 0, 0, @@ -93,18 +75,12 @@ static const UnkTextStruct2 sUnknown_80E6748 = { NULL }; -static const u8 sUnknown_80E6780[]; -static const u8 sUnknown_80E6794[]; -static const u8 sUnknown_80E67B4[]; -static const MenuItem sUnknown_80E6760[4] = { - {sUnknown_80E67B4, 5}, - {sUnknown_80E6794, 5}, - {sUnknown_80E6780, 5}, +static const MenuItem sUnknown_80E6760[] = { + {_("{CENTER_ALIGN}{COLOR RED}Communication error!{RESET} "), 5}, + {_("{CENTER_ALIGN}Check the Game Link cable and"), 5}, + {_("{CENTER_ALIGN}please try again."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E6780[] = _("{CENTER_ALIGN}please try again."); -ALIGNED(4) static const u8 sUnknown_80E6794[] = _("{CENTER_ALIGN}Check the Game Link cable and"); -ALIGNED(4) static const u8 sUnknown_80E67B4[] = _("{CENTER_ALIGN}{COLOR RED}Communication error!{RESET} "); static const UnkTextStruct2 sUnknown_80E67D4 = { 0, 0, 0, 0, @@ -115,14 +91,12 @@ static const UnkTextStruct2 sUnknown_80E67D4 = { NULL }; -static const u8 sUnknown_80E680C[]; -static const MenuItem sUnknown_80E67EC[4] = { - {sUnknown_80E67B4, 5}, - {sUnknown_80E680C, 5}, - {sUnknown_80E6780, 5}, +static const MenuItem sUnknown_80E67EC[] = { + {_("{CENTER_ALIGN}{COLOR RED}Communication error!{RESET} "), 5}, + {_("{CENTER_ALIGN}Check your communication mode and"), 5}, + {_("{CENTER_ALIGN}please try again."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E680C[] = _("{CENTER_ALIGN}Check your communication mode and"); static const UnkTextStruct2 sUnknown_80E6830 = { 0, 0, 0, 0, @@ -133,16 +107,12 @@ static const UnkTextStruct2 sUnknown_80E6830 = { NULL }; -static const u8 sUnknown_80E6888[]; -static const u8 sUnknown_80E6868[]; -static const MenuItem sUnknown_80E6848[4] = { - {sUnknown_80E67B4, 5}, - {sUnknown_80E6888, 5}, - {sUnknown_80E6868, 5}, +static const MenuItem sUnknown_80E6848[] = { + {_("{CENTER_ALIGN}{COLOR RED}Communication error!{RESET} "), 5}, + {_("{CENTER_ALIGN}Check sum error."), 5}, + {_("{CENTER_ALIGN}Please inform the programmer."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E6868[] = _("{CENTER_ALIGN}Please inform the programmer."); -ALIGNED(4) static const u8 sUnknown_80E6888[] = _("{CENTER_ALIGN}Check sum error."); static const UnkTextStruct2 sUnknown_80E689C = { 0, 0, 0, 0, @@ -153,18 +123,12 @@ static const UnkTextStruct2 sUnknown_80E689C = { NULL }; -static const u8 sUnknown_80E6928[]; -static const u8 sUnknown_80E68FC[]; -static const u8 sUnknown_80E68D4[]; -static const MenuItem sUnknown_80E68B4[4] = { - {sUnknown_80E6928, 5}, - {sUnknown_80E68FC, 5}, - {sUnknown_80E68D4, 5}, +static const MenuItem sUnknown_80E68B4[] = { + {_("{CENTER_ALIGN}{COLOR RED}Error!{RESET} "), 5}, + {_("{CENTER_ALIGN}An item could not be transferred because"), 5}, + {_("{CENTER_ALIGN}someone's storage space was full."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E68D4[] = _("{CENTER_ALIGN}someone's storage space was full."); -ALIGNED(4) static const u8 sUnknown_80E68FC[] = _("{CENTER_ALIGN}An item could not be transferred because"); -ALIGNED(4) static const u8 sUnknown_80E6928[] = _("{CENTER_ALIGN}{COLOR RED}Error!{RESET} "); static const UnkTextStruct2 sUnknown_80E6938 = { 0, 0, 0, 0, @@ -175,16 +139,12 @@ static const UnkTextStruct2 sUnknown_80E6938 = { NULL }; -static const u8 sUnknown_80E6988[]; -static const u8 sUnknown_80E6970[]; -static const MenuItem sUnknown_80E6950[4] = { - {sUnknown_80E6928, 5}, - {sUnknown_80E6988, 5}, - {sUnknown_80E6970, 5}, +static const MenuItem sUnknown_80E6950[] = { + {_("{CENTER_ALIGN}{COLOR RED}Error!{RESET} "), 5}, + {_("{CENTER_ALIGN}This {COLOR CYAN_G}SOS Mail{RESET} can't be used."), 5}, + {_("{CENTER_ALIGN}Please check again."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E6970[] = _("{CENTER_ALIGN}Please check again."); -ALIGNED(4) static const u8 sUnknown_80E6988[] = _("{CENTER_ALIGN}This {COLOR CYAN_G}SOS Mail{RESET} can't be used."); static const UnkTextStruct2 sUnknown_80E69B0 = { 0, 0, 0, 0, @@ -195,14 +155,12 @@ static const UnkTextStruct2 sUnknown_80E69B0 = { NULL }; -static const u8 sUnknown_80E69E8[]; -static const MenuItem sUnknown_80E69C8[4] = { - {sUnknown_80E6928, 5}, - {sUnknown_80E69E8, 5}, - {sUnknown_80E6970, 5}, +static const MenuItem sUnknown_80E69C8[] = { + {_("{CENTER_ALIGN}{COLOR RED}Error!{RESET} "), 5}, + {_("{CENTER_ALIGN}This {COLOR CYAN_G}A-OK Mail{RESET} can't be used."), 5}, + {_("{CENTER_ALIGN}Please check again."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E69E8[] = _("{CENTER_ALIGN}This {COLOR CYAN_G}A-OK Mail{RESET} can't be used."); static const UnkTextStruct2 sUnknown_80E6A10 = { 0, 0, 0, 0, @@ -213,14 +171,12 @@ static const UnkTextStruct2 sUnknown_80E6A10 = { NULL }; -static const u8 sUnknown_80E6A48[]; -static const MenuItem sUnknown_80E6A28[4] = { - {sUnknown_80E6928, 5}, - {sUnknown_80E6A48, 5}, - {sUnknown_80E6970, 5}, +static const MenuItem sUnknown_80E6A28[] = { + {_("{CENTER_ALIGN}{COLOR RED}Error!{RESET} "), 5}, + {_("{CENTER_ALIGN}This {COLOR CYAN_G}Thank-You Mail{RESET} can't be used."), 5}, + {_("{CENTER_ALIGN}Please check again."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E6A48[] = _("{CENTER_ALIGN}This {COLOR CYAN_G}Thank-You Mail{RESET} can't be used."); static const UnkTextStruct2 sUnknown_80E6A74 = { 0, 0, 0, 0, @@ -231,16 +187,12 @@ static const UnkTextStruct2 sUnknown_80E6A74 = { NULL }; -static const u8 sUnknown_80E6AC8[]; -static const u8 sUnknown_80E6AAC[]; -static const MenuItem sUnknown_80E6A8C[4] = { - {sUnknown_80E6928, 5}, - {sUnknown_80E6AC8, 5}, - {sUnknown_80E6AAC, 5}, +static const MenuItem sUnknown_80E6A8C[] = { + {_("{CENTER_ALIGN}{COLOR RED}Error!{RESET} "), 5}, + {_("{CENTER_ALIGN}There is no space for new mail."), 5}, + {_("{CENTER_ALIGN}It can't be received."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E6AAC[] = _("{CENTER_ALIGN}It can't be received."); -ALIGNED(4) static const u8 sUnknown_80E6AC8[] = _("{CENTER_ALIGN}There is no space for new mail."); UNUSED static const UnkTextStruct2 sUnknown_80E6AEC = { 0, 0, 0, 0, @@ -251,16 +203,12 @@ UNUSED static const UnkTextStruct2 sUnknown_80E6AEC = { NULL }; -static const u8 sUnknown_80E6B4C[]; -static const u8 sUnknown_80E6B24[]; -UNUSED static const MenuItem sUnknown_80E6B04[4] = { - {sUnknown_80E6928, 5}, - {sUnknown_80E6B4C, 5}, - {sUnknown_80E6B24, 5}, +UNUSED static const MenuItem sUnknown_80E6B04[] = { + {_("{CENTER_ALIGN}{COLOR RED}Error!{RESET} "), 5}, + {_("{CENTER_ALIGN}You may not go to that {COLOR CYAN_G}dungeon{RESET} yet."), 5}, + {_("{CENTER_ALIGN}You need to go further in the story."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E6B24[] = _("{CENTER_ALIGN}You need to go further in the story."); -ALIGNED(4) static const u8 sUnknown_80E6B4C[] = _("{CENTER_ALIGN}You may not go to that {COLOR CYAN_G}dungeon{RESET} yet."); static const UnkTextStruct2 sUnknown_80E6B78 = { 0, 0, 0, 0, @@ -271,16 +219,12 @@ static const UnkTextStruct2 sUnknown_80E6B78 = { NULL }; -static const u8 sUnknown_80E6BC4[]; -static const u8 sUnknown_80E6BB0[]; -static const MenuItem sUnknown_80E6B90[4] = { - {sUnknown_80E6928, 5}, - {sUnknown_80E6BC4, 5}, - {sUnknown_80E6BB0, 5}, +static const MenuItem sUnknown_80E6B90[] = { + {_("{CENTER_ALIGN}{COLOR RED}Error!{RESET} "), 5}, + {_("{CENTER_ALIGN}There was a problem on your friend's end."), 5}, + {_("{CENTER_ALIGN}Please try again."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E6BB0[] = _("{CENTER_ALIGN}Please try again."); -ALIGNED(4) static const u8 sUnknown_80E6BC4[] = _("{CENTER_ALIGN}There was a problem on your friend's end."); static const UnkTextStruct2 sUnknown_80E6BF4 = { 0, 0, 0, 0, @@ -291,14 +235,12 @@ static const UnkTextStruct2 sUnknown_80E6BF4 = { NULL }; -static const u8 sUnknown_80E6C2C[]; -static const MenuItem sUnknown_80E6C0C[4] = { - {sUnknown_80E6928, 5}, - {sUnknown_80E6C2C, 5}, - {sUnknown_80E6BB0, 5}, +static const MenuItem sUnknown_80E6C0C[] = { + {_("{CENTER_ALIGN}{COLOR RED}Error!{RESET} "), 5}, + {_("{CENTER_ALIGN}Your friend is not responding."), 5}, + {_("{CENTER_ALIGN}Please try again."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E6C2C[] = _("{CENTER_ALIGN}Your friend is not responding."); static const UnkTextStruct2 sUnknown_80E6C50 = { 0, 0, 0, 0, @@ -309,16 +251,12 @@ static const UnkTextStruct2 sUnknown_80E6C50 = { NULL }; -static const u8 sUnknown_80E6CA8[]; -static const u8 sUnknown_80E6C88[]; -static const MenuItem sUnknown_80E6C68[4] = { - {sUnknown_80E6734, 5}, - {sUnknown_80E6CA8, 5}, - {sUnknown_80E6C88, 5}, +static const MenuItem sUnknown_80E6C68[] = { + {_("{CENTER_ALIGN}{COLOR CYAN_G}Success!{RESET} "), 5}, + {_("{CENTER_ALIGN}The item exchange with your friend"), 5}, + {_("{CENTER_ALIGN}went through successfully."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E6C88[] = _("{CENTER_ALIGN}went through successfully."); -ALIGNED(4) static const u8 sUnknown_80E6CA8[] = _("{CENTER_ALIGN}The item exchange with your friend"); static const UnkTextStruct2 sUnknown_80E6CD0 = { 0, 0, 0, 0, @@ -329,16 +267,12 @@ static const UnkTextStruct2 sUnknown_80E6CD0 = { NULL }; -static const u8 sUnknown_80E6D2C[]; -static const u8 sUnknown_80E6D08[]; -static const MenuItem sUnknown_80E6CE8[4] = { - {sUnknown_80E65C4, 5}, - {sUnknown_80E6D2C, 5}, - {sUnknown_80E6D08, 5}, +static const MenuItem sUnknown_80E6CE8[] = { + {_("{CENTER_ALIGN}{COLOR RED}Caution!{RESET} "), 5}, + {_("{CENTER_ALIGN}Please communicate only after both"), 5}, + {_("{CENTER_ALIGN}you and your friend are ready."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E6D08[] = _("{CENTER_ALIGN}you and your friend are ready."); -ALIGNED(4) static const u8 sUnknown_80E6D2C[] = _("{CENTER_ALIGN}Please communicate only after both"); static const UnkTextStruct2 sUnknown_80E6D54 = { 0, 0, 0, 0, @@ -349,16 +283,12 @@ static const UnkTextStruct2 sUnknown_80E6D54 = { NULL }; -static const u8 sUnknown_80E6DB0[]; -static const u8 sUnknown_80E6D8C[]; -static const MenuItem sUnknown_80E6D6C[4] = { - {sUnknown_80E6928, 5}, - {sUnknown_80E6DB0, 5}, - {sUnknown_80E6D8C, 5}, +static const MenuItem sUnknown_80E6D6C[] = { + {_("{CENTER_ALIGN}{COLOR RED}Error!{RESET} "), 5}, + {_("{CENTER_ALIGN}An incorrect number of GBA systems are"), 5}, + {_("{CENTER_ALIGN}connected. Please check again."), 5}, {NULL, 3}, }; -ALIGNED(4) static const u8 sUnknown_80E6D8C[] = _("{CENTER_ALIGN}connected. Please check again."); -ALIGNED(4) static const u8 sUnknown_80E6DB0[] = _("{CENTER_ALIGN}An incorrect number of GBA systems are"); static const UnkTextStruct2 sUnknown_80E6DDC = { 0, 0, 0, 0, @@ -369,13 +299,9 @@ static const UnkTextStruct2 sUnknown_80E6DDC = { NULL }; -static const u8 sUnknown_80E6E30[]; -static const u8 sUnknown_80E6E14[]; -static const MenuItem sUnknown_80E6DF4[4] = { - {sUnknown_80E6928, 5}, - {sUnknown_80E6E30, 5}, - {sUnknown_80E6E14, 5}, +static const MenuItem sUnknown_80E6DF4[] = { + {_("{CENTER_ALIGN}{COLOR RED}Error!{RESET} "), 5}, + {_("{CENTER_ALIGN}Communication failed."), 5}, + {_("{CENTER_ALIGN}Please check it again."), 5}, {NULL, 3}, -}; -ALIGNED(4) static const u8 sUnknown_80E6E14[] = _("{CENTER_ALIGN}Please check it again."); -ALIGNED(4) static const u8 sUnknown_80E6E30[] = _("{CENTER_ALIGN}Communication failed."); \ No newline at end of file +}; \ No newline at end of file diff --git a/src/data/personality_test1.h b/src/data/personality_test1.h index 6755ce443..50a2d8a72 100644 --- a/src/data/personality_test1.h +++ b/src/data/personality_test1.h @@ -1,1147 +1,710 @@ -ALIGNED(4) static const PersonalityEffects HardyQuest1Points[3] = -{ - { [HARDY] = 0x02, }, - { [RELAXED] = 0x02, }, - { [IMPISH] = 0x02, } + + +#include "locale/personality_test1_usa.h" + + +ALIGNED(4) static const PersonalityEffects HardyQuest1Points[] = { + { [HARDY] = 2, }, + { [RELAXED] = 2, }, + { [IMPISH] = 2, }, }; - -static const MenuItem HardyQuest1Answers[] = -{ - {"Study hard.", 0}, - {"At the last second.", 1}, - {"Ignore it and play.", 2}, - {NULL, -1}, +static const MenuItem HardyQuest1Answers[] = { + { HARDY_Q1_A0, 0 }, + { HARDY_Q1_A1, 1 }, + { HARDY_Q1_A2, 2 }, + { NULL, -1 }, }; +static const PersonalityQuestion HardyQuest1 = { HARDY_Q1, HardyQuest1Answers, HardyQuest1Points }; -static const u8 HardyQuest1Question[]; -static const PersonalityQuestion HardyQuest1 = { HardyQuest1Question, HardyQuest1Answers, HardyQuest1Points }; -ALIGNED(4) static const u8 HardyQuest1Question[] = _( - "A test is coming up.\n" - "How do you study for it?"); - -ALIGNED(4) static const PersonalityEffects HardyQuest2Points[2] = -{ - { [HARDY] = 0x02, [DOCILE] = 0x01, }, - { [QUIRKY] = 0x02, } +ALIGNED(4) static const PersonalityEffects HardyQuest2Points[] = { + { [HARDY] = 2, [DOCILE] = 1, }, + { [QUIRKY] = 2, }, }; - -static const MenuItem HardyQuest2Answers[] = -{ - {"Yes.", 0}, - {"No. ", 1}, - {NULL, -1}, +static const MenuItem HardyQuest2Answers[] = { + { HARDY_Q2_A0, 0 }, + { HARDY_Q2_A1, 1 }, + { NULL, -1 }, }; +static const PersonalityQuestion HardyQuest2 = { HARDY_Q2, HardyQuest2Answers, HardyQuest2Points }; -static const u8 HardyQuest2Question[]; -static const PersonalityQuestion HardyQuest2 = { HardyQuest2Question, HardyQuest2Answers, HardyQuest2Points }; -ALIGNED(4) static const u8 HardyQuest2Question[] = _("Can you focus on something you like?"); - -ALIGNED(4) static const PersonalityEffects HardyQuest3Points[2] = -{ - { [HARDY] = 0x02, [BRAVE] = 0x02, }, - { [SASSY] = 0x02, [QUIRKY] = 0x02, } +ALIGNED(4) static const PersonalityEffects HardyQuest3Points[] = { + { [HARDY] = 2, [BRAVE] = 2, }, + { [SASSY] = 2, [QUIRKY] = 2, }, }; - -static const MenuItem HardyQuest3Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, +static const MenuItem HardyQuest3Answers[] = { + { HARDY_Q3_A0, 0 }, + { HARDY_Q3_A1, 1 }, + { NULL, -1 }, }; +static const PersonalityQuestion HardyQuest3 = { HARDY_Q3, HardyQuest3Answers, HardyQuest3Points }; -static const u8 HardyQuest3Question[]; -static const PersonalityQuestion HardyQuest3 = { HardyQuest3Question, HardyQuest3Answers, HardyQuest3Points }; -ALIGNED(4) static const u8 HardyQuest3Question[] = _( - "When the going gets tough, do you get\n" - "going?"); - -ALIGNED(4) static const PersonalityEffects HardyQuest4Points[3] = -{ - { [HARDY] = 0x02, }, - { [CALM] = 0x02, }, - { [QUIRKY] = 0x02, } +ALIGNED(4) static const PersonalityEffects HardyQuest4Points[] = { + { [HARDY] = 2, }, + { [CALM] = 2, }, + { [QUIRKY] = 2, }, }; - -static const MenuItem HardyQuest4Answers[] = -{ - {"Full.", 0}, - {"Half.", 1}, - {"A little.", 2}, - {NULL, -1}, +static const MenuItem HardyQuest4Answers[] = { + { HARDY_Q4_A0, 0 }, + { HARDY_Q4_A1, 1 }, + { HARDY_Q4_A2, 2 }, + { NULL, -1 }, }; +static const PersonalityQuestion HardyQuest4 = { HARDY_Q4, HardyQuest4Answers, HardyQuest4Points }; -static const u8 HardyQuest4Question[]; -static const PersonalityQuestion HardyQuest4 = { HardyQuest4Question, HardyQuest4Answers, HardyQuest4Points }; -ALIGNED(4) static const u8 HardyQuest4Question[] = _( - "There is a bucket. If you put\n" - "water in it, how high will you fill it?"); -ALIGNED(4) static const PersonalityEffects DocileQuest1Points[2] = -{ - { [DOCILE] = 0x02, [NAIVE] = 0x01, }, - { [TIMID] = 0x02, [CALM] = 0x01, } + +ALIGNED(4) static const PersonalityEffects DocileQuest1Points[] = { + { [DOCILE] = 2, [NAIVE] = 1, }, + { [TIMID] = 2, [CALM] = 1, }, }; - -static const MenuItem DocileQuest1Answers[] = -{ - {"Big box.", 0}, - {"Small box.", 1}, - {NULL, -1}, +static const MenuItem DocileQuest1Answers[] = { + { DOCILE_Q1_A0, 0 }, + { DOCILE_Q1_A1, 1 }, + { NULL, -1 }, }; +static const PersonalityQuestion DocileQuest1 = { DOCILE_Q1, DocileQuest1Answers, DocileQuest1Points }; -static const u8 DocileQuest1Question[]; -static const PersonalityQuestion DocileQuest1 = { DocileQuest1Question, DocileQuest1Answers, DocileQuest1Points }; -ALIGNED(4) static const u8 DocileQuest1Question[] = _( - "You are offered a choice of two gifts.\n" - "Which one will you take?"); - -ALIGNED(4) static const PersonalityEffects DocileQuest2Points[2] = -{ - { [DOCILE] = 0x02, [HASTY] = 0x01, }, - { [NAIVE] = 0x02, [RELAXED] = 0x01, } +ALIGNED(4) static const PersonalityEffects DocileQuest2Points[] = { + { [DOCILE] = 2, [HASTY] = 1, }, + { [NAIVE] = 2, [RELAXED] = 1, }, }; - -static const MenuItem DocileQuest2Answers[] = -{ - {"Open a window right away.", 0}, - {"Take a sniff first.", 1}, - {NULL, -1}, +static const MenuItem DocileQuest2Answers[] = { + { DOCILE_Q2_A0, 0 }, + { DOCILE_Q2_A1, 1 }, + { NULL, -1 }, }; +static const PersonalityQuestion DocileQuest2 = { DOCILE_Q2, DocileQuest2Answers, DocileQuest2Points }; -static const u8 DocileQuest2Question[]; -static const PersonalityQuestion DocileQuest2 = { DocileQuest2Question, DocileQuest2Answers, DocileQuest2Points }; -ALIGNED(4) static const u8 DocileQuest2Question[] = _( - "You broke a rotten egg in your room!\n" - "What will you do?"); - -ALIGNED(4) static const PersonalityEffects DocileQuest3Points[3] = -{ - { [DOCILE] = 0x02, }, - { [NAIVE] = 0x01, [LONELY] = 0x01, }, - { [SASSY] = 0x02, } +ALIGNED(4) static const PersonalityEffects DocileQuest3Points[] = { + { [DOCILE] = 2, }, + { [NAIVE] = 1, [LONELY] = 1, }, + { [SASSY] = 2, }, }; - -static const u8 DocileQuest3_Regular[]; -static const u8 DocileQuest3_Joke[]; -static const u8 DocileQuest3_Cool[]; -static const MenuItem DocileQuest3Answers[] = -{ - {DocileQuest3_Regular, 0}, - {DocileQuest3_Joke, 1}, - {DocileQuest3_Cool, 2}, - {NULL, -1}, +static const MenuItem DocileQuest3Answers[] = { + { DOCILE_Q3_A0, 0 }, + { DOCILE_Q3_A1, 1 }, + { DOCILE_Q3_A2, 2 }, + { NULL, -1 }, }; -ALIGNED(4) static const u8 DocileQuest3_Cool[] = _("Say thanks, but be cool."); -ALIGNED(4) static const u8 DocileQuest3_Joke[] = _("Say thanks with a joke."); -ALIGNED(4) static const u8 DocileQuest3_Regular[] = _("Say thank you regularly."); +static const PersonalityQuestion DocileQuest3 = { DOCILE_Q3, DocileQuest3Answers, DocileQuest3Points }; -static const u8 DocileQuest3Question[]; -static const PersonalityQuestion DocileQuest3 = { DocileQuest3Question, DocileQuest3Answers, DocileQuest3Points }; -ALIGNED(4) static const u8 DocileQuest3Question[] = _( - "A friend brought over something you'd\n" - "forgotten.{WAIT_PRESS}\n" - "How do you thank your friend?"); - -ALIGNED(4) static const PersonalityEffects DocileQuest4Points[3] = -{ - { [DOCILE] = 0x02, }, - { [NAIVE] = 0x02, }, - { [IMPISH] = 0x02, } +ALIGNED(4) static const PersonalityEffects DocileQuest4Points[] = { + { [DOCILE] = 2, }, + { [NAIVE] = 2, }, + { [IMPISH] = 2, }, }; - -static const MenuItem DocileQuest4Answers[] = -{ - {"Turn it in to the police!", 0}, - {"Yay! Yay!", 1}, - {"Is anyone watching...?", 2}, - {NULL, -1}, +static const MenuItem DocileQuest4Answers[] = { + { DOCILE_Q4_A0, 0 }, + { DOCILE_Q4_A1, 1 }, + { DOCILE_Q4_A2, 2 }, + { NULL, -1 }, }; +static const PersonalityQuestion DocileQuest4 = { DOCILE_Q4, DocileQuest4Answers, DocileQuest4Points }; -static const u8 DocileQuest4Question[]; -static const PersonalityQuestion DocileQuest4 = { DocileQuest4Question, DocileQuest4Answers, DocileQuest4Points }; -ALIGNED(4) static const u8 DocileQuest4Question[] = _("There is a wallet at the side of a road."); -ALIGNED(4) static const PersonalityEffects BraveQuest1Points[2] = -{ - { [BRAVE] = 0x03, [IMPISH] = 0x01, }, - { [DOCILE] = 0x02, [TIMID] = 0x01, } + +ALIGNED(4) static const PersonalityEffects BraveQuest1Points[] = { + { [BRAVE] = 3, [IMPISH] = 1, }, + { [DOCILE] = 2, [TIMID] = 1, }, }; - -static const MenuItem BraveQuest1Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, +static const MenuItem BraveQuest1Answers[] = { + { BRAVE_Q1_A0, 0 }, + { BRAVE_Q1_A1, 1 }, + { NULL, -1 }, }; +static const PersonalityQuestion BraveQuest1 = { BRAVE_Q1, BraveQuest1Answers, BraveQuest1Points }; -static const u8 BraveQuest1Question[]; -static const PersonalityQuestion BraveQuest1 = { BraveQuest1Question, BraveQuest1Answers, BraveQuest1Points }; -ALIGNED(4) static const u8 BraveQuest1Question[] = _( - "You're going bungee jumping for the first\n" - "time.{EXTRA_MSG}Since it's scary, you decide to test the\n" - "jump with a doll...{WAIT_PRESS}\n" - "And the bungee cord snaps!{EXTRA_MSG}" - "Will you still try to make a jump anyway?"); - -ALIGNED(4) static const PersonalityEffects BraveQuest2APoints[3] = -{ - { }, - { [TIMID] = 0x02, }, - { [RELAXED] = 0x02, } +ALIGNED(4) static const PersonalityEffects BraveQuest2APoints[] = { + { /* Empty */ }, + { [TIMID] = 2, }, + { [RELAXED] = 2, }, }; - -static const MenuItem BraveQuest2AAnswers[] = -{ - {"Fight.", 99}, - {"Run.", 1}, - {"Ignore it.", 2}, - {NULL, -1}, +static const MenuItem BraveQuest2AAnswers[] = { + { BRAVE_Q2A_A0, 99 }, + { BRAVE_Q2A_A1, 1 }, + { BRAVE_Q2A_A2, 2 }, + { NULL, -1 }, }; +static const PersonalityQuestion BraveQuest2A = { BRAVE_Q2A, BraveQuest2AAnswers, BraveQuest2APoints }; -static const u8 BraveQuest2AQuestion[]; -static const PersonalityQuestion BraveQuest2A = { BraveQuest2AQuestion, BraveQuest2AAnswers, BraveQuest2APoints }; -ALIGNED(4) static const u8 BraveQuest2AQuestion[] = _( - "There is an alien invasion!\n" - "What will you do?"); - -ALIGNED(4) static const PersonalityEffects BraveQuest2BPoints[2] = -{ - { [SASSY] = 0x01, [RELAXED] = 0x01, }, - { [BRAVE] = 0x04, } +ALIGNED(4) static const PersonalityEffects BraveQuest2BPoints[] = { + { [SASSY] = 1, [RELAXED] = 1, }, + { [BRAVE] = 4, }, }; - -static const MenuItem BraveQuest2BAnswers[] = -{ - {"Rule with the aliens.", 0}, - {"Refuse.", 1}, - {NULL, -1}, +static const MenuItem BraveQuest2BAnswers[] = { + { BRAVE_Q2B_A0, 0 }, + { BRAVE_Q2B_A1, 1 }, + { NULL, -1 }, }; +static const PersonalityQuestion BraveQuest2B = { BRAVE_Q2B, BraveQuest2BAnswers, BraveQuest2BPoints }; -static const u8 BraveQuest2BQuestion[]; -static const PersonalityQuestion BraveQuest2B = { BraveQuest2BQuestion, BraveQuest2BAnswers, BraveQuest2BPoints }; -ALIGNED(4) static const u8 BraveQuest2BQuestion[] = _( - "You valiantly fight the aliens...{WAIT_PRESS}\n" - "But, you are defeated...{EXTRA_MSG}An alien says to you...{EXTRA_MSG}“YOU HAVE IMPRESSED US.\n" - "IT WAS A PLEASURE TO SEE.{EXTRA_MSG}JOIN US, AND TOGETHER WE SHALL\n" - "RULE THE WORLD.”{WAIT_PRESS}\n" - "What will you do?"); - -ALIGNED(4) static const PersonalityEffects BraveQuest3Points[2] = -{ - { [HARDY] = 0x01, [BRAVE] = 0x02, }, - { [NAIVE] = 0x02, } +ALIGNED(4) static const PersonalityEffects BraveQuest3Points[] = { + { [HARDY] = 1, [BRAVE] = 2, }, + { [NAIVE] = 2, }, }; - -static const MenuItem BraveQuest3Answers[] = -{ - {"Yank open the door.", 0}, - {"Scream in unison.", 1}, - {NULL, -1}, +static const MenuItem BraveQuest3Answers[] = { + { BRAVE_Q3_A0, 0 }, + { BRAVE_Q3_A1, 1 }, + { NULL, -1 }, }; +static const PersonalityQuestion BraveQuest3 = { BRAVE_Q3, BraveQuest3Answers, BraveQuest3Points }; -static const u8 BraveQuest3Question[]; -static const PersonalityQuestion BraveQuest3 = { BraveQuest3Question, BraveQuest3Answers, BraveQuest3Points }; -ALIGNED(4) static const u8 BraveQuest3Question[] = _( - "There is a scream from behind a door!{WAIT_PRESS}\n" - "How will you react?"); - -ALIGNED(4) static const PersonalityEffects BraveQuest4Points[4] = -{ - { [BRAVE] = 0x03, }, - { [HARDY] = 0x02, [BRAVE] = 0x02, }, - { [DOCILE] = 0x01, [TIMID] = 0x01, [RELAXED] = 0x01, }, - { [TIMID] = 0x02, } +ALIGNED(4) static const PersonalityEffects BraveQuest4Points[] = { + { [BRAVE] = 3, }, + { [HARDY] = 2, [BRAVE] = 2, }, + { [DOCILE] = 1, [TIMID] = 1, [RELAXED] = 1, }, + { [TIMID] = 2, }, }; - -static const u8 BraveQuest4_Hesitation[]; -static const u8 BraveQuest4_Scared[]; -static const u8 BraveQuest4_Police[]; -static const u8 BraveQuest4_Nothing[]; static const MenuItem BraveQuest4Answers[] = { - {BraveQuest4_Hesitation, 0}, - {BraveQuest4_Scared, 1}, - {BraveQuest4_Police, 2}, - {BraveQuest4_Nothing, 3}, + { BRAVE_Q4_A0, 0 }, + { BRAVE_Q4_A1, 1 }, + { BRAVE_Q4_A2, 2 }, + { BRAVE_Q4_A3, 3 }, + { NULL, -1 }, +}; +static const PersonalityQuestion BraveQuest4 = { BRAVE_Q4, BraveQuest4Answers, BraveQuest4Points }; + + + +ALIGNED(4) static const PersonalityEffects JollyQuest1Points[] = { + { [JOLLY] = 2, [NAIVE] = 1, }, + { [SASSY] = 1, [QUIRKY] = 1, }, +}; +static const MenuItem JollyQuest1Answers[] = { + { JOLLY_Q1_A0, 0 }, + { JOLLY_Q1_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion JollyQuest1 = { JOLLY_Q1, JollyQuest1Answers, JollyQuest1Points }; + +ALIGNED(4) static const PersonalityEffects JollyQuest2Points[] = { + { [JOLLY] = 2, [LONELY] = 1, }, + { [TIMID] = 1, }, +}; +static const MenuItem JollyQuest2Answers[] = { + { JOLLY_Q2_A0, 0 }, + { JOLLY_Q2_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion JollyQuest2 = { JOLLY_Q2, JollyQuest2Answers, JollyQuest2Points }; + +ALIGNED(4) static const PersonalityEffects JollyQuest3Points[] = { + { [JOLLY] = 2, }, + { [CALM] = 2, }, + { [QUIRKY] = 2, }, +}; +static const MenuItem JollyQuest3Answers[] = { + { JOLLY_Q3_A0, 0 }, + { JOLLY_Q3_A1, 1 }, + { JOLLY_Q3_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion JollyQuest3 = { JOLLY_Q3, JollyQuest3Answers, JollyQuest3Points }; + +ALIGNED(4) static const PersonalityEffects JollyQuest4Points[] = { + { [JOLLY] = 3, }, + { [HARDY] = 2, }, + { [TIMID] = 2, }, +}; +static const MenuItem JollyQuest4Answers[] = { + { JOLLY_Q4_A0, 0 }, + { JOLLY_Q4_A1, 1 }, + { JOLLY_Q4_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion JollyQuest4 = { JOLLY_Q4, JollyQuest4Answers, JollyQuest4Points }; + + + +ALIGNED(4) static const PersonalityEffects ImpishQuest1Points[] = { + { [IMPISH] = 2, [LONELY] = 1, }, + { [CALM] = 2, }, +}; +static const MenuItem ImpishQuest1Answers[] = { + { IMPISH_Q1_A0, 0 }, + { IMPISH_Q1_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion ImpishQuest1 = { IMPISH_Q1, ImpishQuest1Answers, ImpishQuest1Points }; + +ALIGNED(4) static const PersonalityEffects ImpishQuest2Points[] = { + { [IMPISH] = 2, }, + { [DOCILE] = 1, [RELAXED] = 1, }, +}; +static const MenuItem ImpishQuest2Answers[] = { + { IMPISH_Q2_A0, 0 }, + { IMPISH_Q2_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion ImpishQuest2 = { IMPISH_Q2, ImpishQuest2Answers, ImpishQuest2Points }; + +ALIGNED(4) static const PersonalityEffects ImpishQuest3Points[] = { + { [HARDY] = 1, [IMPISH] = 2, }, + { [SASSY] = 1, [QUIRKY] = 2, }, +}; +static const MenuItem ImpishQuest3Answers[] = { + { IMPISH_Q3_A0, 0 }, + { IMPISH_Q3_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion ImpishQuest3 = { IMPISH_Q3, ImpishQuest3Answers, ImpishQuest3Points }; + +ALIGNED(4) static const PersonalityEffects ImpishQuest4Points[] = { + { [BRAVE] = 3, }, + { [TIMID] = 2, }, + { [IMPISH] = 2, }, +}; +static const MenuItem ImpishQuest4Answers[] = { + { IMPISH_Q4_A0, 0 }, + { IMPISH_Q4_A1, 1 }, + { IMPISH_Q4_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion ImpishQuest4 = { IMPISH_Q4, ImpishQuest4Answers, ImpishQuest4Points }; + + + +ALIGNED(4) static const PersonalityEffects NaiveQuest1Points[] = { + { [IMPISH] = 1, [NAIVE] = 3, }, + { [JOLLY] = 2, }, + { [SASSY] = 2, }, +}; +static const MenuItem NaiveQuest1Answers[] = { + { NAIVE_Q1_A0, 0 }, + { NAIVE_Q1_A1, 1 }, + { NAIVE_Q1_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion NaiveQuest1 = { NAIVE_Q1, NaiveQuest1Answers, NaiveQuest1Points }; + +ALIGNED(4) static const PersonalityEffects NaiveQuest2Points[] = { + { [DOCILE] = 1, [NAIVE] = 2, }, + { [QUIRKY] = 2, }, +}; +static const MenuItem NaiveQuest2Answers[] = { + { NAIVE_Q2_A0, 0 }, + { NAIVE_Q2_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion NaiveQuest2 = { NAIVE_Q2, NaiveQuest2Answers, NaiveQuest2Points }; + +ALIGNED(4) static const PersonalityEffects NaiveQuest3Points[] = { + { [JOLLY] = 1, [NAIVE] = 2, }, + { [CALM] = 2, }, +}; +static const MenuItem NaiveQuest3Answers[] = { + { NAIVE_Q3_A0, 0 }, + { NAIVE_Q3_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion NaiveQuest3 = { NAIVE_Q3, NaiveQuest3Answers, NaiveQuest3Points }; + +ALIGNED(4) static const PersonalityEffects NaiveQuest4Points[] = { + { [NAIVE] = 2, }, + { [HASTY] = 2, }, +}; +static const MenuItem NaiveQuest4Answers[] = { + { NAIVE_Q4_A0, 0 }, + { NAIVE_Q4_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion NaiveQuest4 = { NAIVE_Q4, NaiveQuest4Answers, NaiveQuest4Points }; + + + +ALIGNED(4) static const PersonalityEffects TimidQuest1Points[] = { + { [TIMID] = 2, }, + { [HARDY] = 1, [CALM] = 2, }, + { [BRAVE] = 2, [IMPISH] = 1, [NAIVE] = 1, }, +}; +static const MenuItem TimidQuest1Answers[] = { + { TIMID_Q1_A0, 0 }, + { TIMID_Q1_A1, 1 }, + { TIMID_Q1_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion TimidQuest1 = { TIMID_Q1, TimidQuest1Answers, TimidQuest1Points }; + +ALIGNED(4) static const PersonalityEffects TimidQuest2Points[] = { + { [TIMID] = 2, }, + { [HASTY] = 2, }, + { [JOLLY] = 2, }, + { [SASSY] = 2, }, + { [LONELY] = 2, }, +}; +static const MenuItem TimidQuest2Answers[] = { + { TIMID_Q2_A0, 0 }, + { TIMID_Q2_A1, 1 }, + { TIMID_Q2_A2, 2 }, + { TIMID_Q2_A3, 3 }, + { TIMID_Q2_A4, 4 }, + { NULL, -1 }, +}; +static const PersonalityQuestion TimidQuest2 = { TIMID_Q2, TimidQuest2Answers, TimidQuest2Points }; + +ALIGNED(4) static const PersonalityEffects TimidQuest3Points[] = { + { [TIMID] = 2, }, + { [LONELY] = 2, }, + { [IMPISH] = 2, [QUIRKY] = 1, }, +}; +static const MenuItem TimidQuest3Answers[] = { + { TIMID_Q3_A0, 0 }, + { TIMID_Q3_A1, 1 }, + { TIMID_Q3_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion TimidQuest3 = { TIMID_Q3, TimidQuest3Answers, TimidQuest3Points }; + +ALIGNED(4) static const PersonalityEffects TimidQuest4Points[] = { + { [BRAVE] = 3, }, + { [TIMID] = 2, }, + { [SASSY] = 2, }, +}; +static const MenuItem TimidQuest4Answers[] = { + { TIMID_Q4_A0, 0 }, + { TIMID_Q4_A1, 1 }, + { TIMID_Q4_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion TimidQuest4 = { TIMID_Q4, TimidQuest4Answers, TimidQuest4Points }; + + + +ALIGNED(4) static const PersonalityEffects HastyQuest1Points[] = { + { [HASTY] = 2, }, + { [CALM] = 2, }, + { [TIMID] = 2, }, +}; +static const MenuItem HastyQuest1Answers[] = { + { HASTY_Q1_A0, 0 }, + { HASTY_Q1_A1, 1 }, + { HASTY_Q1_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion HastyQuest1 = { HASTY_Q1, HastyQuest1Answers, HastyQuest1Points }; + +ALIGNED(4) static const PersonalityEffects HastyQuest2Points[] = { + { [JOLLY] = 2, [HASTY] = 1, }, + { [HARDY] = 1, [CALM] = 1, }, + { [BRAVE] = 2, [QUIRKY] = 2, }, +}; +static const MenuItem HastyQuest2Answers[] = { + { HASTY_Q2_A0, 0 }, + { HASTY_Q2_A1, 1 }, + { HASTY_Q2_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion HastyQuest2 = { HASTY_Q2, HastyQuest2Answers, HastyQuest2Points }; + +ALIGNED(4) static const PersonalityEffects HastyQuest3Points[] = { + { [HASTY] = 2, }, + { [TIMID] = 2, }, + { [SASSY] = 2, }, +}; +static const MenuItem HastyQuest3Answers[] = { + { HASTY_Q3_A0, 0 }, + { HASTY_Q3_A1, 1 }, + { HASTY_Q3_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion HastyQuest3 = { HASTY_Q3, HastyQuest3Answers, HastyQuest3Points }; + +ALIGNED(4) static const PersonalityEffects HastyQuest4Points[] = { + { [DOCILE] = 1, [HASTY] = 2, }, + { [RELAXED] = 2, }, + { [HASTY] = 3, }, +}; +static const MenuItem HastyQuest4Answers[] = { + { HASTY_Q4_A0, 0 }, + { HASTY_Q4_A1, 1 }, + { HASTY_Q4_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion HastyQuest4 = { HASTY_Q4, HastyQuest4Answers, HastyQuest4Points }; + + + +ALIGNED(4) static const PersonalityEffects SassyQuest1Points[] = { + { [HARDY] = 2, }, + { [DOCILE] = 2, }, + { [SASSY] = 2, }, +}; +static const MenuItem SassyQuest1Answers[] = { + { SASSY_Q1_A0, 0 }, + { SASSY_Q1_A1, 1 }, + { SASSY_Q1_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion SassyQuest1 = { SASSY_Q1, SassyQuest1Answers, SassyQuest1Points }; + +ALIGNED(4) static const PersonalityEffects SassyQuest2Points[] = { + { [IMPISH] = 1, [SASSY] = 2, }, + { [CALM] = 2, }, +}; +static const MenuItem SassyQuest2Answers[] = { + { SASSY_Q2_A0, 0 }, + { SASSY_Q2_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion SassyQuest2 = { SASSY_Q2, SassyQuest2Answers, SassyQuest2Points }; + +ALIGNED(4) static const PersonalityEffects SassyQuest3Points[] = { + { [SASSY] = 2, }, + { [RELAXED] = 2, }, +}; +static const MenuItem SassyQuest3Answers[] = { + { SASSY_Q3_A0, 0 }, + { SASSY_Q3_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion SassyQuest3 = { SASSY_Q3, SassyQuest3Answers, SassyQuest3Points }; + +ALIGNED(4) static const PersonalityEffects SassyQuest4Points[] = { + { [DOCILE] = 2, [CALM] = 1, }, + { [SASSY] = 2, [QUIRKY] = 1, }, +}; +static const MenuItem SassyQuest4Answers[] = { + { SASSY_Q4_A0, 0 }, + { SASSY_Q4_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion SassyQuest4 = { SASSY_Q4, SassyQuest4Answers, SassyQuest4Points }; + + + +ALIGNED(4) static const PersonalityEffects CalmQuest1Points[] = { + { [CALM] = 2, [LONELY] = 1, }, + { [HARDY] = 2, }, +}; +static const MenuItem CalmQuest1Answers[] = { + { CALM_Q1_A0, 0 }, + { CALM_Q1_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion CalmQuest1 = { CALM_Q1, CalmQuest1Answers, CalmQuest1Points }; + +ALIGNED(4) static const PersonalityEffects CalmQuest2Points[] = { + { [CALM] = 2, }, + { [IMPISH] = 2, }, +}; +static const MenuItem CalmQuest2Answers[] = { + { CALM_Q2_A0, 0 }, + { CALM_Q2_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion CalmQuest2 = { CALM_Q2, CalmQuest2Answers, CalmQuest2Points }; + +ALIGNED(4) static const PersonalityEffects CalmQuest3Points[] = { + { [IMPISH] = 1, [TIMID] = 2, }, + { [CALM] = 2, [LONELY] = 1, }, +}; +static const MenuItem CalmQuest3Answers[] = { + { CALM_Q3_A0, 0 }, + { CALM_Q3_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion CalmQuest3 = { CALM_Q3, CalmQuest3Answers, CalmQuest3Points }; + +ALIGNED(4) static const PersonalityEffects CalmQuest4Points[] = { + { [CALM] = 2, [RELAXED] = 1, }, + { [HARDY] = 1, [HASTY] = 2, }, +}; +static const MenuItem CalmQuest4Answers[] = { + { CALM_Q4_A0, 0 }, + { CALM_Q4_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion CalmQuest4 = { CALM_Q4, CalmQuest4Answers, CalmQuest4Points }; + + + +ALIGNED(4) static const PersonalityEffects RelaxedQuest1Points[] = { + { [SASSY] = 1, [RELAXED] = 2, }, + { [HARDY] = 2, [HASTY] = 1, }, +}; +static const MenuItem RelaxedQuest1Answers[] = { + { RELAXED_Q1_A0, 0 }, + { RELAXED_Q1_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion RelaxedQuest1 = { RELAXED_Q1, RelaxedQuest1Answers, RelaxedQuest1Points }; + +ALIGNED(4) static const PersonalityEffects RelaxedQuest2Points[] = { + { [RELAXED] = 2, }, + { [IMPISH] = 1, [HASTY] = 2, }, +}; +static const MenuItem RelaxedQuest2Answers[] = { + { RELAXED_Q2_A0, 0 }, + { RELAXED_Q2_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion RelaxedQuest2 = { RELAXED_Q2, RelaxedQuest2Answers, RelaxedQuest2Points }; + +ALIGNED(4) static const PersonalityEffects RelaxedQuest3Points[] = { + { [JOLLY] = 2, }, + { [RELAXED] = 2, }, + { [HASTY] = 2, }, +}; +static const MenuItem RelaxedQuest3Answers[] = { + { RELAXED_Q3_A0, 0 }, + { RELAXED_Q3_A1, 1 }, + { RELAXED_Q3_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion RelaxedQuest3 = { RELAXED_Q3, RelaxedQuest3Answers, RelaxedQuest3Points }; + +ALIGNED(4) static const PersonalityEffects RelaxedQuest4Points[] = { + { [CALM] = 1, [RELAXED] = 2, }, + { [HARDY] = 2, }, +}; +static const MenuItem RelaxedQuest4Answers[] = { + { RELAXED_Q4_A0, 0 }, + { RELAXED_Q4_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion RelaxedQuest4 = { RELAXED_Q4, RelaxedQuest4Answers, RelaxedQuest4Points }; + + + +ALIGNED(4) static const PersonalityEffects LonelyQuest1Points[] = { + { [TIMID] = 1, [LONELY] = 2, }, + { [SASSY] = 2, }, +}; +static const MenuItem LonelyQuest1Answers[] = { + { LONELY_Q1_A0, 0 }, + { LONELY_Q1_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion LonelyQuest1 = { LONELY_Q1, LonelyQuest1Answers, LonelyQuest1Points }; + +ALIGNED(4) static const PersonalityEffects LonelyQuest2Points[] = { + { [TIMID] = 1, [LONELY] = 2, }, + { [BRAVE] = 3, [RELAXED] = 1, }, +}; +static const MenuItem LonelyQuest2Answers[] = { + { LONELY_Q2_A0, 0 }, + { LONELY_Q2_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion LonelyQuest2 = { LONELY_Q2, LonelyQuest2Answers, LonelyQuest2Points }; + +ALIGNED(4) static const PersonalityEffects LonelyQuest3Points[] = { + { [TIMID] = 1, [LONELY] = 2, }, + { [CALM] = 2, }, +}; +static const MenuItem LonelyQuest3Answers[] = { + { LONELY_Q3_A0, 0 }, + { LONELY_Q3_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion LonelyQuest3 = { LONELY_Q3, LonelyQuest3Answers, LonelyQuest3Points }; + +ALIGNED(4) static const PersonalityEffects LonelyQuest4Points[] = { + { [JOLLY] = 1, [LONELY] = 1, }, + { [CALM] = 1, [RELAXED] = 2, }, + { [TIMID] = 1, [LONELY] = 3, }, +}; +static const MenuItem LonelyQuest4Answers[] = { + { LONELY_Q4_A0, 0 }, + { LONELY_Q4_A1, 1 }, + { LONELY_Q4_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion LonelyQuest4 = { LONELY_Q4, LonelyQuest4Answers, LonelyQuest4Points }; + + + +ALIGNED(4) static const PersonalityEffects QuirkyQuest1Points[] = { + { [QUIRKY] = 2, }, + { [HARDY] = 2, }, +}; +static const MenuItem QuirkyQuest1Answers[] = { + { QUIRKY_Q1_A0, 0 }, + { QUIRKY_Q1_A1, 1 }, + { NULL, -1 }, +}; +static const PersonalityQuestion QuirkyQuest1 = { QUIRKY_Q1, QuirkyQuest1Answers, QuirkyQuest1Points }; + +ALIGNED(4) static const PersonalityEffects QuirkyQuest2Points[] = { + { [HARDY] = 1, [HASTY] = 1, }, + { [QUIRKY] = 2, }, + { [SASSY] = 2, }, +}; +static const MenuItem QuirkyQuest2Answers[] = { + { QUIRKY_Q2_A0, 0 }, + { QUIRKY_Q2_A1, 1 }, + { QUIRKY_Q2_A2, 2 }, + { NULL, -1 }, +}; +static const PersonalityQuestion QuirkyQuest2 = { QUIRKY_Q2, QuirkyQuest2Answers, QuirkyQuest2Points }; + +ALIGNED(4) static const PersonalityEffects QuirkyQuest3Points[] = { + { [HARDY] = 1, [BRAVE] = 3, }, + { [QUIRKY] = 2, }, + { [IMPISH] = 2, }, + { [TIMID] = 2, }, +}; +static const MenuItem QuirkyQuest3Answers[] = { + { QUIRKY_Q3_A0, 0 }, + { QUIRKY_Q3_A1, 1 }, + { QUIRKY_Q3_A2, 2 }, + { QUIRKY_Q3_A3, 3 }, + { NULL, -1 }, +}; +static const PersonalityQuestion QuirkyQuest3 = { QUIRKY_Q3, QuirkyQuest3Answers, QuirkyQuest3Points }; + +ALIGNED(4) static const PersonalityEffects QuirkyQuest4Points[] = { + { [DOCILE] = 2, }, + { [SASSY] = 2, }, + { [QUIRKY] = 2, }, +}; +static const MenuItem QuirkyQuest4Answers[] = { + {QUIRKY_Q4_A0, 0}, + {QUIRKY_Q4_A1, 1}, + {QUIRKY_Q4_A2, 2}, {NULL, -1}, }; -ALIGNED(4) static const u8 BraveQuest4_Nothing[] = _("Do nothing out of fear."); -ALIGNED(4) static const u8 BraveQuest4_Police[] = _("Call the police."); -ALIGNED(4) static const u8 BraveQuest4_Scared[] = _("Help, even if scared."); -ALIGNED(4) static const u8 BraveQuest4_Hesitation[] = _("Help without hesitation."); +static const PersonalityQuestion QuirkyQuest4 = { QUIRKY_Q4, QuirkyQuest4Answers, QuirkyQuest4Points }; -static const u8 BraveQuest4Question[]; -static const PersonalityQuestion BraveQuest4 = { BraveQuest4Question, BraveQuest4Answers, BraveQuest4Points }; -ALIGNED(4) static const u8 BraveQuest4Question[] = _( - "A delinquent is hassling a girl on\n" - "a busy city street!{WAIT_PRESS}\n" - "What will you do?"); -ALIGNED(4) static const PersonalityEffects JollyQuest1Points[2] = -{ - { [JOLLY] = 0x02, [NAIVE] = 0x01, }, - { [SASSY] = 0x01, [QUIRKY] = 0x01, } -}; - -static const MenuItem JollyQuest1Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 JollyQuest1Question[]; -static const PersonalityQuestion JollyQuest1 = { JollyQuest1Question, JollyQuest1Answers, JollyQuest1Points }; -ALIGNED(4) static const u8 JollyQuest1Question[] = _("Are you a cheerful personality?"); - -ALIGNED(4) static const PersonalityEffects JollyQuest2Points[2] = -{ - { [JOLLY] = 0x02, [LONELY] = 0x01, }, - { [TIMID] = 0x01, } -}; - -static const MenuItem JollyQuest2Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 JollyQuest2Question[]; -static const PersonalityQuestion JollyQuest2 = { JollyQuest2Question, JollyQuest2Answers, JollyQuest2Points }; -ALIGNED(4) static const u8 JollyQuest2Question[] = _( - "Do you like to noisily enjoy yourself\n" - "with others?"); - -ALIGNED(4) static const PersonalityEffects JollyQuest3Points[3] = -{ - { [JOLLY] = 0x02, }, - { [CALM] = 0x02, }, - { [QUIRKY] = 0x02, } -}; - -static const MenuItem JollyQuest3Answers[] = -{ - {"The beach!", 0}, - {"Spas.", 1}, - {"Anywhere.", 2}, - {NULL, -1}, -}; - -static const u8 JollyQuest3Question[]; -static const PersonalityQuestion JollyQuest3 = { JollyQuest3Question, JollyQuest3Answers, JollyQuest3Points }; -ALIGNED(4) static const u8 JollyQuest3Question[] = _( - "It's the summer holidays!\n" - "Where would you like to go?"); - -ALIGNED(4) static const PersonalityEffects JollyQuest4Points[3] = -{ - { [JOLLY] = 0x03, }, - { [HARDY] = 0x02, }, - { [TIMID] = 0x02, } -}; - -static const u8 JollyQuest4_Funny[]; -static const u8 JollyQuest4_Again[]; -static const u8 JollyQuest4_Go[]; -static const MenuItem JollyQuest4Answers[] = -{ - {JollyQuest4_Funny, 0}, - {JollyQuest4_Again, 1}, - {JollyQuest4_Go, 2}, - {NULL, -1}, -}; -ALIGNED(4) static const u8 JollyQuest4_Go[] = _("Right... Well, I gotta go."); -ALIGNED(4) static const u8 JollyQuest4_Again[] = _("Um... Could you say that again?"); -ALIGNED(4) static const u8 JollyQuest4_Funny[] = _("Haha! Yes. Very funny!"); - -static const u8 JollyQuest4Question[]; -static const PersonalityQuestion JollyQuest4 = { JollyQuest4Question, JollyQuest4Answers, JollyQuest4Points }; -ALIGNED(4) static const u8 JollyQuest4Question[] = _( - "A foreign person has started up a\n" - "conversation with you.{EXTRA_MSG}" - "To be honest, you don't have a clue what\n" - "this fellow is saying.{WAIT_PRESS}\n" - "How do you reply?"); - -ALIGNED(4) static const PersonalityEffects ImpishQuest1Points[2] = -{ - { [IMPISH] = 0x02, [LONELY] = 0x01, }, - { [CALM] = 0x02, } -}; - -static const MenuItem ImpishQuest1Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 ImpishQuest1Question[]; -static const PersonalityQuestion ImpishQuest1 = { ImpishQuest1Question, ImpishQuest1Answers, ImpishQuest1Points }; -ALIGNED(4) static const u8 ImpishQuest1Question[] = _("Have you ever made a pitfall trap?"); - -ALIGNED(4) static const PersonalityEffects ImpishQuest2Points[2] = -{ - { [IMPISH] = 0x02, }, - { [DOCILE] = 0x01, [RELAXED] = 0x01, } -}; - -static const MenuItem ImpishQuest2Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 ImpishQuest2Question[]; -static const PersonalityQuestion ImpishQuest2 = { ImpishQuest2Question, ImpishQuest2Answers, ImpishQuest2Points }; -ALIGNED(4) static const u8 ImpishQuest2Question[] = _("Do you like pranks?"); - -ALIGNED(4) static const PersonalityEffects ImpishQuest3Points[2] = -{ - { [HARDY] = 0x01, [IMPISH] = 0x02, }, - { [SASSY] = 0x01, [QUIRKY] = 0x02, } -}; - -static const MenuItem ImpishQuest3Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 ImpishQuest3Question[]; -static const PersonalityQuestion ImpishQuest3 = { ImpishQuest3Question, ImpishQuest3Answers, ImpishQuest3Points }; -ALIGNED(4) static const u8 ImpishQuest3Question[] = _("Are there many things that you would like\nto do?"); - -ALIGNED(4) static const PersonalityEffects ImpishQuest4Points[3] = -{ - { [BRAVE] = 0x03, }, - { [TIMID] = 0x02, }, - { [IMPISH] = 0x02, } -}; - -static const MenuItem ImpishQuest4Answers[] = -{ - {"Face up to the bully.", 0}, - {"Caution the bully from afar.", 1}, - {"Heckle the bully from behind.", 2}, - {NULL, -1}, -}; - -static const u8 ImpishQuest4Question[]; -static const PersonalityQuestion ImpishQuest4 = { ImpishQuest4Question, ImpishQuest4Answers, ImpishQuest4Points }; -ALIGNED(4) static const u8 ImpishQuest4Question[] = _( - "Your friend is being bullied!\n" - "What do you do?"); - -ALIGNED(4) static const PersonalityEffects NaiveQuest1Points[3] = -{ - { [IMPISH] = 0x01, [NAIVE] = 0x03, }, - { [JOLLY] = 0x02, }, - { [SASSY] = 0x02, } -}; - -static const MenuItem NaiveQuest1Answers[] = -{ - {"Love them!", 0}, - {"A little.", 1}, - {"Spare me.", 2}, - {NULL, -1}, -}; - -static const u8 NaiveQuest1Question[]; -static const PersonalityQuestion NaiveQuest1 = { NaiveQuest1Question, NaiveQuest1Answers, NaiveQuest1Points }; -ALIGNED(4) static const u8 NaiveQuest1Question[] = _("Do you like groan-inducing puns?"); - -ALIGNED(4) static const PersonalityEffects NaiveQuest2Points[2] = -{ - { [DOCILE] = 0x01, [NAIVE] = 0x02, }, - { [QUIRKY] = 0x02, } -}; - -static const MenuItem NaiveQuest2Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 NaiveQuest2Question[]; -static const PersonalityQuestion NaiveQuest2 = { NaiveQuest2Question, NaiveQuest2Answers, NaiveQuest2Points }; -ALIGNED(4) static const u8 NaiveQuest2Question[] = _("Do you tend to laugh a lot?"); - -ALIGNED(4) static const PersonalityEffects NaiveQuest3Points[2] = -{ - { [JOLLY] = 0x01, [NAIVE] = 0x02, }, - { [CALM] = 0x02, } -}; -static const MenuItem NaiveQuest3Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, +ALIGNED(4) static const PersonalityEffects MiscQuest1Points[] = { + { [HASTY] = 1, [QUIRKY] = 1, }, + { [JOLLY] = 1, [LONELY] = 1, }, }; - -static const u8 NaiveQuest3Question[]; -static const PersonalityQuestion NaiveQuest3 = { NaiveQuest3Question, NaiveQuest3Answers, NaiveQuest3Points }; -ALIGNED(4) static const u8 NaiveQuest3Question[] = _("Do others often call you childish?"); - -ALIGNED(4) static const PersonalityEffects NaiveQuest4Points[2] = -{ - { [NAIVE] = 0x02, }, - { [HASTY] = 0x02, } -}; - -static const MenuItem NaiveQuest4Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 NaiveQuest4Question[]; -static const PersonalityQuestion NaiveQuest4 = { NaiveQuest4Question, NaiveQuest4Answers, NaiveQuest4Points }; -ALIGNED(4) static const u8 NaiveQuest4Question[] = _( - "Do you like to imagine things for your\n" - "amusement?"); - -ALIGNED(4) static const PersonalityEffects TimidQuest1Points[3] = -{ - { [TIMID] = 0x02, }, - { [HARDY] = 0x01, [CALM] = 0x02, }, - { [BRAVE] = 0x02, [IMPISH] = 0x01, [NAIVE] = 0x01, } -}; - -static const MenuItem TimidQuest1Answers[] = -{ - {"Scream and run.", 0}, - {"Close the lid without a word.", 1}, - {"Shake hands with it.", 2}, - {NULL, -1}, -}; - -static const u8 TimidQuest1Question[]; -static const PersonalityQuestion TimidQuest1 = { TimidQuest1Question, TimidQuest1Answers, TimidQuest1Points }; -ALIGNED(4) static const u8 TimidQuest1Question[] = _( - "A human hand extends out of a toilet!\n" - "What would you do?"); - -ALIGNED(4) static const PersonalityEffects TimidQuest2Points[5] = -{ - { [TIMID] = 0x02, }, - { [HASTY] = 0x02, }, - { [JOLLY] = 0x02, }, - { [SASSY] = 0x02, }, - { [LONELY] = 0x02, } -}; - -static const MenuItem TimidQuest2Answers[] = -{ - {"Thumb.", 0}, - {"Index finger.", 1}, - {"Middle finger.", 2}, - {"Ring finger.", 3}, - {"Little finger.", 4}, - {NULL, -1}, +static const MenuItem MiscQuest1Answers[] = { + { MISC_Q1_A0, 0 }, + { MISC_Q1_A1, 1 }, + { NULL, -1 }, }; +static const PersonalityQuestion MiscQuest1 = { MISC_Q1, MiscQuest1Answers, MiscQuest1Points }; -static const u8 TimidQuest2Question[]; -static const PersonalityQuestion TimidQuest2 = { TimidQuest2Question, TimidQuest2Answers, TimidQuest2Points }; -ALIGNED(4) static const u8 TimidQuest2Question[] = _( - "Grab any digit on your left hand with your\n" - "right hand.{WAIT_PRESS}\n" - "Which digit did you grab?"); - -ALIGNED(4) static const PersonalityEffects TimidQuest3Points[3] = -{ - { [TIMID] = 0x02, }, - { [LONELY] = 0x02, }, - { [IMPISH] = 0x02, [QUIRKY] = 0x01, } +ALIGNED(4) static const PersonalityEffects MiscQuest2Points[] = { + { [JOLLY] = 2, }, + { [SASSY] = 1, [QUIRKY] = 1, }, }; - -static const MenuItem TimidQuest3Answers[] = -{ - {"Kick the door.", 0}, - {"Cry.", 1}, - {"Clean it.", 2}, - {NULL, -1}, +static const MenuItem MiscQuest2Answers[] = { + { MISC_Q2_A0, 0 }, + { MISC_Q2_A1, 1 }, + { NULL, -1 }, }; +static const PersonalityQuestion MiscQuest2 = { MISC_Q2, MiscQuest2Answers, MiscQuest2Points }; -static const u8 TimidQuest3Question[]; -static const PersonalityQuestion TimidQuest3 = { TimidQuest3Question, TimidQuest3Answers, TimidQuest3Points }; -ALIGNED(4) static const u8 TimidQuest3Question[] = _( - "You are suddenly locked inside a\n" - "pitch-black room!{WAIT_PRESS}\n" - "What do you do?"); - -ALIGNED(4) static const PersonalityEffects TimidQuest4Points[3] = -{ - { [BRAVE] = 0x03, }, - { [TIMID] = 0x02, }, - { [SASSY] = 0x02, } +ALIGNED(4) static const PersonalityEffects MiscQuest3Points[] = { + { [NAIVE] = 1, [LONELY] = 1, }, + { [HASTY] = 1, [SASSY] = 1, }, }; - -static const MenuItem TimidQuest4Answers[] = -{ - {"No problem!", 0}, - {"Uh... N-no...", 1}, - {"With someone I like.", 2}, - {NULL, -1}, -}; - -static const u8 TimidQuest4Question[]; -static const PersonalityQuestion TimidQuest4 = { TimidQuest4Question, TimidQuest4Answers, TimidQuest4Points }; -ALIGNED(4) static const u8 TimidQuest4Question[] = _("Can you go into a haunted house?"); - -ALIGNED(4) static const PersonalityEffects HastyQuest1Points[3] = -{ - { [HASTY] = 0x02, }, - { [CALM] = 0x02, }, - { [TIMID] = 0x02, } -}; - -static const MenuItem HastyQuest1Answers[] = -{ - {"Open it now.", 0}, - {"Open it later.", 1}, - {"Get someone to open it.", 2}, - {NULL, -1}, -}; - -static const u8 HastyQuest1Question[]; -static const PersonalityQuestion HastyQuest1 = { HastyQuest1Question, HastyQuest1Answers, HastyQuest1Points }; -ALIGNED(4) static const u8 HastyQuest1Question[] = _( - "You receive a gift!{WAIT_PRESS}\n" - "But you don't know what's in it.{WAIT_PRESS}\n" - "You're curious, so what do you do?"); - -ALIGNED(4) static const PersonalityEffects HastyQuest2Points[3] = -{ - { [JOLLY] = 0x02, [HASTY] = 0x01, }, - { [HARDY] = 0x01, [CALM] = 0x01, }, - { [BRAVE] = 0x02, [QUIRKY] = 0x02, } -}; - -static const MenuItem HastyQuest2Answers[] = -{ - {"Spend it now.", 0}, - {"Save it.", 1}, - {"Give it away.", 2}, - {NULL, -1}, -}; - -static const u8 HastyQuest2Question[]; -static const PersonalityQuestion HastyQuest2 = { HastyQuest2Question, HastyQuest2Answers, HastyQuest2Points }; -ALIGNED(4) static const u8 HastyQuest2Question[] = _( - "You win a lottery!{WAIT_PRESS}\n" - "What do you do with the money?"); - -ALIGNED(4) static const PersonalityEffects HastyQuest3Points[3] = -{ - { [HASTY] = 0x02, }, - { [TIMID] = 0x02, }, - { [SASSY] = 0x02, } -}; - -static const u8 HastyQuest3_Open[]; -static const u8 HastyQuest3_Trap[]; -static const u8 HastyQuest3_Empty[]; -static const MenuItem HastyQuest3Answers[] = -{ - {HastyQuest3_Open, 0}, - {HastyQuest3_Trap, 1}, - {HastyQuest3_Empty, 2}, - {NULL, -1}, -}; -ALIGNED(4) static const u8 HastyQuest3_Empty[] = _("It's going to be empty..."); -ALIGNED(4) static const u8 HastyQuest3_Trap[] = _("No... Could be a trap..."); -ALIGNED(4) static const u8 HastyQuest3_Open[] = _("Open it right away!"); - -static const u8 HastyQuest3Question[]; -static const PersonalityQuestion HastyQuest3 = { HastyQuest3Question, HastyQuest3Answers, HastyQuest3Points }; -ALIGNED(4) static const u8 HastyQuest3Question[] = _( - "You come across a treasure chest!\n" - "What do you do?"); - -ALIGNED(4) static const PersonalityEffects HastyQuest4Points[3] = -{ - { [DOCILE] = 0x01, [HASTY] = 0x02, }, - { [RELAXED] = 0x02, }, - { [HASTY] = 0x03, } -}; - -static const MenuItem HastyQuest4Answers[] = -{ - {"Become irritated.", 0}, - {"Wait patiently.", 1}, - {"Get angry and bail.", 2}, - {NULL, -1}, -}; - -static const u8 HastyQuest4Question[]; -static const PersonalityQuestion HastyQuest4 = { HastyQuest4Question, HastyQuest4Answers, HastyQuest4Points }; -ALIGNED(4) static const u8 HastyQuest4Question[] = _( - "Your friend fails to show up for a meeting\n" - "at the promised time.\n" - "What do you do?"); - -ALIGNED(4) static const PersonalityEffects SassyQuest1Points[3] = -{ - { [HARDY] = 0x02, }, - { [DOCILE] = 0x02, }, - { [SASSY] = 0x02, } -}; - -static const MenuItem SassyQuest1Answers[] = -{ - {"Speak calmly.", 0}, - {"Speak nervously.", 1}, - {"WHATEVER!!", 2}, - {NULL, -1}, -}; - -static const u8 SassyQuest1Question[]; -static const PersonalityQuestion SassyQuest1 = { SassyQuest1Question, SassyQuest1Answers, SassyQuest1Points }; -ALIGNED(4) static const u8 SassyQuest1Question[] = _( - "Your country's leader is in front of you.\n" - "How do you speak to him or her?"); - -ALIGNED(4) static const PersonalityEffects SassyQuest2Points[2] = -{ - { [IMPISH] = 0x01, [SASSY] = 0x02, }, - { [CALM] = 0x02, } -}; - -static const MenuItem SassyQuest2Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 SassyQuest2Question[]; -static const PersonalityQuestion SassyQuest2 = { SassyQuest2Question, SassyQuest2Answers, SassyQuest2Points }; -ALIGNED(4) static const u8 SassyQuest2Question[] = _("Do others tell you to watch what you say?"); - -ALIGNED(4) static const PersonalityEffects SassyQuest3Points[2] = -{ - { [SASSY] = 0x02, }, - { [RELAXED] = 0x02, } +static const MenuItem MiscQuest3Answers[] = { + { MISC_Q3_A0, 0 }, + { MISC_Q3_A1, 1 }, + { NULL, -1 }, }; +static const PersonalityQuestion MiscQuest3 = { MISC_Q3, MiscQuest3Answers, MiscQuest3Points }; -static const MenuItem SassyQuest3Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 SassyQuest3Question[]; -static const PersonalityQuestion SassyQuest3 = { SassyQuest3Question, SassyQuest3Answers, SassyQuest3Points }; -ALIGNED(4) static const u8 SassyQuest3Question[] = _( - "Do you think you are cool?\n" - "Be honest."); - -ALIGNED(4) static const PersonalityEffects SassyQuest4Points[2] = -{ - { [DOCILE] = 0x02, [CALM] = 0x01, }, - { [SASSY] = 0x02, [QUIRKY] = 0x01, } -}; - -static const MenuItem SassyQuest4Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 SassyQuest4Question[]; -static const PersonalityQuestion SassyQuest4 = { SassyQuest4Question, SassyQuest4Answers, SassyQuest4Points }; -ALIGNED(4) static const u8 SassyQuest4Question[] = _( - "Can you sincerely thank someone when you\n" - "feel grateful?"); - -ALIGNED(4) static const PersonalityEffects CalmQuest1Points[2] = -{ - { [CALM] = 0x02, [LONELY] = 0x01, }, - { [HARDY] = 0x02, } -}; - -static const MenuItem CalmQuest1Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 CalmQuest1Question[]; -static const PersonalityQuestion CalmQuest1 = { CalmQuest1Question, CalmQuest1Answers, CalmQuest1Points }; -ALIGNED(4) static const u8 CalmQuest1Question[] = _( - "Do you occasionally consider yourself\n" - "dull and overly cautious?"); - -ALIGNED(4) static const PersonalityEffects CalmQuest2Points[2] = -{ - { [CALM] = 0x02, }, - { [IMPISH] = 0x02, } -}; - -static const MenuItem CalmQuest2Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 CalmQuest2Question[]; -static const PersonalityQuestion CalmQuest2 = { CalmQuest2Question, CalmQuest2Answers, CalmQuest2Points }; -ALIGNED(4) static const u8 CalmQuest2Question[] = _( - "Do you dream of lounging around idly\n" - "without much excitement?"); - -ALIGNED(4) static const PersonalityEffects CalmQuest3Points[2] = -{ - { [IMPISH] = 0x01, [TIMID] = 0x02, }, - { [CALM] = 0x02, [LONELY] = 0x01, } -}; - -static const MenuItem CalmQuest3Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 CalmQuest3Question[]; -static const PersonalityQuestion CalmQuest3 = { CalmQuest3Question, CalmQuest3Answers, CalmQuest3Points }; -ALIGNED(4) static const u8 CalmQuest3Question[] = _("Do you like to fight?"); - -ALIGNED(4) static const PersonalityEffects CalmQuest4Points[2] = -{ - { [CALM] = 0x02, [RELAXED] = 0x01, }, - { [HARDY] = 0x01, [HASTY] = 0x02, } -}; - -static const MenuItem CalmQuest4Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 CalmQuest4Question[]; -static const PersonalityQuestion CalmQuest4 = { CalmQuest4Question, CalmQuest4Answers, CalmQuest4Points }; -ALIGNED(4) static const u8 CalmQuest4Question[] = _("Do you often yawn?"); - -ALIGNED(4) static const PersonalityEffects RelaxedQuest1Points[2] = -{ - { [SASSY] = 0x01, [RELAXED] = 0x02, }, - { [HARDY] = 0x02, [HASTY] = 0x01, } -}; - -static const MenuItem RelaxedQuest1Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 RelaxedQuest1Question[]; -static const PersonalityQuestion RelaxedQuest1 = { RelaxedQuest1Question, RelaxedQuest1Answers, RelaxedQuest1Points }; -ALIGNED(4) static const u8 RelaxedQuest1Question[] = _("Are you often late for school or meetings?"); - -ALIGNED(4) static const PersonalityEffects RelaxedQuest2Points[2] = -{ - { [RELAXED] = 0x02, }, - { [IMPISH] = 0x01, [HASTY] = 0x02, } -}; - -static const MenuItem RelaxedQuest2Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 RelaxedQuest2Question[]; -static const PersonalityQuestion RelaxedQuest2 = { RelaxedQuest2Question, RelaxedQuest2Answers, RelaxedQuest2Points }; -ALIGNED(4) static const u8 RelaxedQuest2Question[] = _( - "Do you get the feeling that you've slowed\n" - "down lately?"); - -ALIGNED(4) static const PersonalityEffects RelaxedQuest3Points[3] = -{ - { [JOLLY] = 0x02, }, - { [RELAXED] = 0x02, }, - { [HASTY] = 0x02, } -}; - -static const MenuItem RelaxedQuest3Answers[] = -{ - {"This feels great!", 0}, - {"Snore...", 1}, - {"I want to go home soon!", 2}, - {NULL, -1}, -}; - -static const u8 RelaxedQuest3Question[]; -static const PersonalityQuestion RelaxedQuest3 = { RelaxedQuest3Question, RelaxedQuest3Answers, RelaxedQuest3Points }; -ALIGNED(4) static const u8 RelaxedQuest3Question[] = _( - "It is a pleasant day at the beach.\n" - "How do you feel?"); - -ALIGNED(4) static const PersonalityEffects RelaxedQuest4Points[2] = -{ - { [CALM] = 0x01, [RELAXED] = 0x02, }, - { [HARDY] = 0x02, } -}; - -static const MenuItem RelaxedQuest4Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 RelaxedQuest4Question[]; -static const PersonalityQuestion RelaxedQuest4 = { RelaxedQuest4Question, RelaxedQuest4Answers, RelaxedQuest4Points }; -ALIGNED(4) static const u8 RelaxedQuest4Question[] = _("Do you fall asleep without noticing?"); - -ALIGNED(4) static const PersonalityEffects LonelyQuest1Points[2] = -{ - { [TIMID] = 0x01, [LONELY] = 0x02, }, - { [SASSY] = 0x02, } -}; - -static const MenuItem LonelyQuest1Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 LonelyQuest1Question[]; -static const PersonalityQuestion LonelyQuest1 = { LonelyQuest1Question, LonelyQuest1Answers, LonelyQuest1Points }; -ALIGNED(4) static const u8 LonelyQuest1Question[] = _("Do you feel lonesome when you are alone?"); - -ALIGNED(4) static const PersonalityEffects LonelyQuest2Points[2] = -{ - { [TIMID] = 0x01, [LONELY] = 0x02, }, - { [BRAVE] = 0x03, [RELAXED] = 0x01, } -}; - -static const MenuItem LonelyQuest2Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 LonelyQuest2Question[]; -static const PersonalityQuestion LonelyQuest2 = { LonelyQuest2Question, LonelyQuest2Answers, LonelyQuest2Points }; -ALIGNED(4) static const u8 LonelyQuest2Question[] = _( - "Do you hate to be the last person to leave\n" - "class at the end of a school day?"); - -ALIGNED(4) static const PersonalityEffects LonelyQuest3Points[2] = -{ - { [TIMID] = 0x01, [LONELY] = 0x02, }, - { [CALM] = 0x02, } -}; - -static const MenuItem LonelyQuest3Answers[] = -{ - {"Leave it on.", 0}, - {"Turn it off.", 1}, - {NULL, -1}, -}; - -static const u8 LonelyQuest3Question[]; -static const PersonalityQuestion LonelyQuest3 = { LonelyQuest3Question, LonelyQuest3Answers, LonelyQuest3Points }; -ALIGNED(4) static const u8 LonelyQuest3Question[] = _( - "What do you do with your room's light\n" - "when you're going to bed at night?"); - -ALIGNED(4) static const PersonalityEffects LonelyQuest4Points[3] = -{ - { [JOLLY] = 0x01, [LONELY] = 0x01, }, - { [CALM] = 0x01, [RELAXED] = 0x02, }, - { [TIMID] = 0x01, [LONELY] = 0x03, } -}; - -static const MenuItem LonelyQuest4Answers[] = -{ - {"Go on a trip.", 0}, - {"Hang around vacantly.", 1}, - {"Huddle in a corner.", 2}, - {NULL, -1}, -}; - -static const u8 LonelyQuest4Question[]; -static const PersonalityQuestion LonelyQuest4 = { LonelyQuest4Question, LonelyQuest4Answers, LonelyQuest4Points }; -ALIGNED(4) static const u8 LonelyQuest4Question[] = _( - "It's a weekend, but no one will play\n" - "with you...\n" - "What do you do?"); - -ALIGNED(4) static const PersonalityEffects QuirkyQuest1Points[2] = -{ - { [QUIRKY] = 0x02, }, - { [HARDY] = 0x02, } -}; - -static const MenuItem QuirkyQuest1Answers[] = -{ - {"Yes.", 0}, - {"No.", 1}, - {NULL, -1}, -}; - -static const u8 QuirkyQuest1Question[]; -static const PersonalityQuestion QuirkyQuest1 = { QuirkyQuest1Question, QuirkyQuest1Answers, QuirkyQuest1Points }; -ALIGNED(4) static const u8 QuirkyQuest1Question[] = _( - "Do you sometimes run out of things to do\n" - "all of a sudden?"); - -ALIGNED(4) static const PersonalityEffects QuirkyQuest2Points[3] = -{ - { [HARDY] = 0x01, [HASTY] = 0x01, }, - { [QUIRKY] = 0x02, }, - { [SASSY] = 0x02, } -}; - -static const u8 QuirkyQuest2_Reply[]; -static const u8 QuirkyQuest2_MayMayNot[]; -static const u8 QuirkyQuest2_Trouble[]; -static const MenuItem QuirkyQuest2Answers[] = -{ - {QuirkyQuest2_Reply, 0}, - {QuirkyQuest2_MayMayNot, 1}, - {QuirkyQuest2_Trouble, 2}, - {NULL, -1}, -}; -ALIGNED(4) static const u8 QuirkyQuest2_Trouble[] = _("Too much trouble."); -ALIGNED(4) static const u8 QuirkyQuest2_MayMayNot[] = _("May reply, may not."); -ALIGNED(4) static const u8 QuirkyQuest2_Reply[] = _("Reply right away."); - -static const u8 QuirkyQuest2Question[]; -static const PersonalityQuestion QuirkyQuest2 = { QuirkyQuest2Question, QuirkyQuest2Answers, QuirkyQuest2Points }; -ALIGNED(4) static const u8 QuirkyQuest2Question[] = _("How quickly do you respond to an e-mail?"); - -ALIGNED(4) static const PersonalityEffects QuirkyQuest3Points[4] = -{ - { [HARDY] = 0x01, [BRAVE] = 0x03, }, - { [QUIRKY] = 0x02, }, - { [IMPISH] = 0x02, }, - { [TIMID] = 0x02, } -}; - -static const MenuItem QuirkyQuest3Answers[] = -{ - {"Bravely declare my love.", 0}, - {"Might say hello...", 1}, - {"Pull a prank to get attention.", 2}, - {"Look from afar.", 3}, - {NULL, -1}, -}; - -static const u8 QuirkyQuest3Question[]; -static const PersonalityQuestion QuirkyQuest3 = { QuirkyQuest3Question, QuirkyQuest3Answers, QuirkyQuest3Points }; -ALIGNED(4) static const u8 QuirkyQuest3Question[] = _( - "There is a person you like...{WAIT_PRESS}\n" - "But there's no opportunity to get close.\n" - "What do you do?"); - -ALIGNED(4) static const PersonalityEffects QuirkyQuest4Points[3] = -{ - { [DOCILE] = 0x02, }, - { [SASSY] = 0x02, }, - { [QUIRKY] = 0x02, } -}; - -static const u8 QuirkyQuest4_GoRight[]; -static const u8 QuirkyQuest4_GoLeft[]; -static const u8 QuirkyQuest4_EitherSide[]; -static const MenuItem QuirkyQuest4Answers[] = -{ - {QuirkyQuest4_GoRight, 0}, - {QuirkyQuest4_GoLeft, 1}, - {QuirkyQuest4_EitherSide, 2}, - {NULL, -1}, -}; -ALIGNED(4) static const u8 QuirkyQuest4_EitherSide[] = _("Choose either side."); -ALIGNED(4) static const u8 QuirkyQuest4_GoLeft[] = _("It's a trap! Go left."); -ALIGNED(4) static const u8 QuirkyQuest4_GoRight[] = _("Instantly go right."); - -static const u8 QuirkyQuest4Question[]; -static const PersonalityQuestion QuirkyQuest4 = { QuirkyQuest4Question, QuirkyQuest4Answers, QuirkyQuest4Points }; -ALIGNED(4) static const u8 QuirkyQuest4Question[] = _( - "The road forks to the right and left.\n" - "You are told there is a treasure on the\n" - "right side. What do you do?"); - -ALIGNED(4) static const PersonalityEffects MiscQuest1Points[2] = -{ - { [HASTY] = 0x01, [QUIRKY] = 0x01, }, - { [JOLLY] = 0x01, [LONELY] = 0x01, } -}; - -static const MenuItem MiscQuest1Answers[] = -{ - {"Go alone.", 0}, - {"Go with others.", 1}, - {NULL, -1}, -}; - -static const u8 MiscQuest1Question[]; -static const PersonalityQuestion MiscQuest1 = { MiscQuest1Question, MiscQuest1Answers, MiscQuest1Points }; -ALIGNED(4) static const u8 MiscQuest1Question[] = _("On vacation outings, you want to..."); - -ALIGNED(4) static const PersonalityEffects MiscQuest2Points[2] = -{ - { [JOLLY] = 0x02, }, - { [SASSY] = 0x01, [QUIRKY] = 0x01, } -}; - -static const u8 MiscQuest2_DontCare[]; -static const MenuItem MiscQuest2Answers[] = -{ - {"Love them!", 0}, - {MiscQuest2_DontCare, 1}, - {NULL, -1}, -}; -ALIGNED(4) static const u8 MiscQuest2_DontCare[] = _("Don't care."); - -static const u8 MiscQuest2Question[]; -static const PersonalityQuestion MiscQuest2 = { MiscQuest2Question, MiscQuest2Answers, MiscQuest2Points }; -ALIGNED(4) static const u8 MiscQuest2Question[] = _( - "It's the summer festival!\n" - "Do you like carnivals?"); - -ALIGNED(4) static const PersonalityEffects MiscQuest3Points[2] = -{ - { [NAIVE] = 0x01, [LONELY] = 0x01, }, - { [HASTY] = 0x01, [SASSY] = 0x01, } -}; - -static const MenuItem MiscQuest3Answers[] = -{ - {"Happy!", 0}, - {"Not happy.", 1}, - {NULL, -1}, -}; -static const u8 MiscQuest3Question[]; -static const PersonalityQuestion MiscQuest3 = { MiscQuest3Question, MiscQuest3Answers, MiscQuest3Points }; -ALIGNED(4) static const u8 MiscQuest3Question[] = _( - "Somebody calls you “weird but funny.”\n" - "How does that make you feel?"); -static const PersonalityQuestion* const gPersonalityQuestionPointerTable[NUM_QUIZ_QUESTIONS + 1] = -{ +static const PersonalityQuestion* const gPersonalityQuestionPointerTable[NUM_QUIZ_QUESTIONS + 1] = { &HardyQuest1, &HardyQuest2, &HardyQuest3, &HardyQuest4, &DocileQuest1, &DocileQuest2, &DocileQuest3, &DocileQuest4, &BraveQuest1, &BraveQuest2A, &BraveQuest3, &BraveQuest4, @@ -1160,8 +723,7 @@ static const PersonalityQuestion* const gPersonalityQuestionPointerTable[NUM_QUI }; // NOTE: 2nd Part of Brave is included at the end so it isn't actually chosen -static const u8 gNatureQuestionTable[NUM_QUIZ_QUESTIONS + 1] = -{ +static const u8 gNatureQuestionTable[NUM_QUIZ_QUESTIONS + 1] = { HARDY, HARDY, HARDY, HARDY, DOCILE, DOCILE, DOCILE, DOCILE, BRAVE, BRAVE, BRAVE, BRAVE, @@ -1179,23 +741,24 @@ static const u8 gNatureQuestionTable[NUM_QUIZ_QUESTIONS + 1] = BRAVE }; -ALIGNED(4) static const u8 gGenderText[] = _("Are you a boy or a girl?"); -UNUSED ALIGNED(4) static const u8* const gGenderTextPtr[] = { gGenderText }; -static const MenuItem gGenderMenu[] = -{ - {"Boy.", 0}, - {"Girl.", 1}, - {NULL, -1}, + +ALIGNED(4) static const u8 sGender0[] = GENDER_Q; +UNUSED ALIGNED(4) static const u8* const gGenderTextPtr[] = { sGender0 }; + +static const MenuItem gGenderMenu[] = { + { GENDER_A0, 0 }, + { GENDER_A1, 1 }, + { NULL, -1 }, }; -UNUSED static const u8 unknownPersonality[13] = -{ + + +UNUSED static const u8 unknownPersonality[NUM_PERSONALITIES] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }; -static const s16 gStarters[NUM_PERSONALITIES][2] = -{ +static const s16 gStarters[NUM_PERSONALITIES][2] = { // MALE / FEMALE [HARDY] = {MONSTER_CHARMANDER, MONSTER_PIKACHU}, [DOCILE] = {MONSTER_BULBASAUR, MONSTER_CHIKORITA}, @@ -1212,298 +775,43 @@ static const s16 gStarters[NUM_PERSONALITIES][2] = [QUIRKY] = {MONSTER_MEOWTH, MONSTER_TREECKO} }; -ALIGNED(4) static const u8 gStarterReveal[] = _( - "\n" - "{CENTER_ALIGN}The PokĂ©mon {POKEMON_0}!"); + + +ALIGNED(4) static const u8 gStarterReveal[] = STARTER_REVEAL; UNUSED ALIGNED(4) static const u8* const gStarterRevealPtr[] = { gStarterReveal }; -ALIGNED(4) static const u8 gPartnerPrompt[] = _( - "{CENTER_ALIGN}This is the final step.{WAIT_PRESS}\n" - "{CENTER_ALIGN}Who would you like to have as a partner?{EXTRA_MSG}" - "{CENTER_ALIGN}Choose the PokĂ©mon you want\n" - "{CENTER_ALIGN}as your partner from this group."); +ALIGNED(4) static const u8 gPartnerPrompt[] = PARTNER_PROMPT; UNUSED ALIGNED(4) static const u8* const gPartnerPromptPtr = gPartnerPrompt; -ALIGNED(4) static const u8 gPartnerNickPrompt[] = _("{CENTER_ALIGN}What is your partner's nickname?"); +ALIGNED(4) static const u8 gPartnerNickPrompt[] = PARTNER_NICK_PROMPT; UNUSED ALIGNED(4) static const u8* const gPartnerNickPromptPtr[] = { gPartnerNickPrompt }; -ALIGNED(4) static const u8 gEndIntroText[] = _( - "{CENTER_ALIGN}OK! We're all set!{EXTRA_MSG}" - "{CENTER_ALIGN}Let's get you into the\n" - "{CENTER_ALIGN}world of PokĂ©mon!{EXTRA_MSG}" - "{CENTER_ALIGN}Go for it!"); +ALIGNED(4) static const u8 gEndIntroText[] = END_TEXT; UNUSED ALIGNED(4) static const u8* const gEndIntroTextPtr[] = { gEndIntroText }; -static const u8 gHardyDescription[]; -static const u8 gDocileDescription[]; -static const u8 gBraveDescription[]; -static const u8 gJollyDescription[]; -static const u8 gImpishDescription[]; -static const u8 gNaiveDescription[]; -static const u8 gTimidDescription[]; -static const u8 gHastyDescription[]; -static const u8 gSassyDescription[]; -static const u8 gCalmDescription[]; -static const u8 gRelaxedDescription[]; -static const u8 gLonelyDescription[]; -static const u8 gQuirkyDescription[]; -static const u8* const sPersonalityTypeDescriptionTable[NUM_PERSONALITIES] = -{ - [HARDY] = gHardyDescription, - [DOCILE] = gDocileDescription, - [BRAVE] = gBraveDescription, - [JOLLY] = gJollyDescription, - [IMPISH] = gImpishDescription, - [NAIVE] = gNaiveDescription, - [TIMID] = gTimidDescription, - [HASTY] = gHastyDescription, - [SASSY] = gSassyDescription, - [CALM] = gCalmDescription, - [RELAXED] = gRelaxedDescription, - [LONELY] = gLonelyDescription, - [QUIRKY] = gQuirkyDescription + +static const u8* const sPersonalityTypeDescriptionTable[NUM_PERSONALITIES] = { + [HARDY] = DESC_HARDY, + [DOCILE] = DESC_DOCILE, + [BRAVE] = DESC_BRAVE, + [JOLLY] = DESC_JOLLY, + [IMPISH] = DESC_IMPISH, + [NAIVE] = DESC_NAIVE, + [TIMID] = DESC_TIMID, + [HASTY] = DESC_HASTY, + [SASSY] = DESC_SASSY, + [CALM] = DESC_CALM, + [RELAXED] = DESC_RELAXED, + [LONELY] = DESC_LONELY, + [QUIRKY] = DESC_QUIRKY }; -ALIGNED(4) static const u8 gQuirkyDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The quirky type.{EXTRA_MSG}" - "{CENTER_ALIGN}People consider you an eccentric\n" - "{CENTER_ALIGN}who does things at your own pace.{EXTRA_MSG}" - "{CENTER_ALIGN}You never break tempo.{EXTRA_MSG}" - "{CENTER_ALIGN}Your carefree nature makes you\n" - "{CENTER_ALIGN}attractive. But you also happen\n" - "{CENTER_ALIGN}to be somewhat childish...{EXTRA_MSG}" - "{CENTER_ALIGN}You are fickle and cause problems for the\n" - "{CENTER_ALIGN}people who have to go along with you.{EXTRA_MSG}" - "{CENTER_ALIGN}Maybe people are even upset\n" - "{CENTER_ALIGN}with you for being so fickle?{EXTRA_MSG}" - "{CENTER_ALIGN}If you realize how selfishly\n" - "{CENTER_ALIGN}you're behaving, try to think\n" - "{CENTER_ALIGN}before you do anything rash.{EXTRA_MSG}" - "{CENTER_ALIGN}A quirky person like you should be..."); - -ALIGNED(4) static const u8 gLonelyDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The lonely type.{EXTRA_MSG}" - "{CENTER_ALIGN}You always act cheerful and\n" - "{CENTER_ALIGN}jocular around other people.{EXTRA_MSG}" - "{CENTER_ALIGN}But that's only because\n" - "{CENTER_ALIGN}you are with other people.{EXTRA_MSG}" - "{CENTER_ALIGN}However, when you get alone...{EXTRA_MSG}" - "{CENTER_ALIGN}Do you find yourself\n" - "{CENTER_ALIGN}feeling oddly depressed?{EXTRA_MSG}" - "{CENTER_ALIGN}That's why you always\n" - "{CENTER_ALIGN}want to be with others.{EXTRA_MSG}" - "{CENTER_ALIGN}But if you go around feeling\n" - "{CENTER_ALIGN}depressed too much...{EXTRA_MSG}" - "{CENTER_ALIGN}Your nutritional balance goes out\n" - "{CENTER_ALIGN}of wack. Eat more vegetables!{EXTRA_MSG}" - "{CENTER_ALIGN}However...{WAIT_PRESS}\n" - "{CENTER_ALIGN}It's not a bad thing\n" - "{CENTER_ALIGN}to feel lonely.{EXTRA_MSG}" - "{CENTER_ALIGN}You know what it's like when you aren't\n" - "{CENTER_ALIGN}alone, so that's why you feel lonesome.{EXTRA_MSG}" - "{CENTER_ALIGN}And that's why you aren't really alone.{EXTRA_MSG}" - "{CENTER_ALIGN}A lonely person like you should be..."); - -ALIGNED(4) static const u8 gRelaxedDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The relaxed type.{EXTRA_MSG}" - "{CENTER_ALIGN}Do you occasionally\n" - "{CENTER_ALIGN}zone out and miss a bus?{EXTRA_MSG}" - "{CENTER_ALIGN}Or do you find yourself dozing off?{EXTRA_MSG}" - "{CENTER_ALIGN}Or is your reaction time\n" - "{CENTER_ALIGN}a little slower than others?{EXTRA_MSG}" - "{CENTER_ALIGN}But that's not necessarily\n" - "{CENTER_ALIGN}a bad thing.{EXTRA_MSG}" - "{CENTER_ALIGN}You can do things at your own\n" - "{CENTER_ALIGN}tempo without feeling pressured.{EXTRA_MSG}" - "{CENTER_ALIGN}You can live in a relaxed and\n" - "{CENTER_ALIGN}unhurried manner without worries.{EXTRA_MSG}" - "{CENTER_ALIGN}I think that's a happy\n" - "{CENTER_ALIGN}lifestyle to be envied, even.{EXTRA_MSG}" - "{CENTER_ALIGN}You're also surprisingly popular.{EXTRA_MSG}" - "{CENTER_ALIGN}The way you vacantly stare\n" - "{CENTER_ALIGN}off into the distance...{EXTRA_MSG}" - "{CENTER_ALIGN}It should make that someone\n" - "{CENTER_ALIGN}special's pulse race.{EXTRA_MSG}" - "{CENTER_ALIGN}A relaxed person like you should be..."); - -ALIGNED(4) static const u8 gCalmDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The calm type.{EXTRA_MSG}" - "{CENTER_ALIGN}You're capable of giving advice\n" - "{CENTER_ALIGN}to friends with worries.{EXTRA_MSG}" - "{CENTER_ALIGN}You don't like to fight.{EXTRA_MSG}" - "{CENTER_ALIGN}You're a warm, kindhearted\n" - "{CENTER_ALIGN}person who cares.{EXTRA_MSG}" - "{CENTER_ALIGN}You must have many friends\n" - "{CENTER_ALIGN}who look up to you.{EXTRA_MSG}" - "{CENTER_ALIGN}However...{WAIT_PRESS}\n" - "{CENTER_ALIGN}You may also be somewhat gullible...{EXTRA_MSG}" - "{CENTER_ALIGN}As well as a little careless...{EXTRA_MSG}" - "{CENTER_ALIGN}And even a little sloppy.{EXTRA_MSG}" - "{CENTER_ALIGN}You might want to keep\n" - "{CENTER_ALIGN}those points in mind.{EXTRA_MSG}" - "{CENTER_ALIGN}A calm person like you should be..."); - -ALIGNED(4) static const u8 gSassyDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The sassy type.{EXTRA_MSG}" - "{CENTER_ALIGN}You tend to be somewhat cynical.{EXTRA_MSG}" - "{CENTER_ALIGN}Despite that, there is something\n" - "{CENTER_ALIGN}appealing and lovable about you.{EXTRA_MSG}" - "{CENTER_ALIGN}But do you occasionally say something\n" - "{CENTER_ALIGN}arrogant that angers others?{EXTRA_MSG}" - "{CENTER_ALIGN}Do you make that mistake?{EXTRA_MSG}" - "{CENTER_ALIGN}Or have people called you\n" - "{CENTER_ALIGN}conceited, vain, or selfish?{EXTRA_MSG}" - "{CENTER_ALIGN}Have people said that about you?{EXTRA_MSG}" - "{CENTER_ALIGN}Huh?{WAIT_PRESS} You're telling me to get lost?{EXTRA_MSG}" - "{CENTER_ALIGN}Why, you... Come here and say that!{WAIT_PRESS}\n" - "{CENTER_ALIGN}......Gasp!{EXTRA_MSG}" - "{CENTER_ALIGN}...I'm sorry.\n" - "{CENTER_ALIGN}I let my feelings run away.\n" - "{CENTER_ALIGN}I truly regret this, really.{EXTRA_MSG}" - "{CENTER_ALIGN}Anyway, your cool and aloof\n" - "{CENTER_ALIGN}attitude is what defines you.{EXTRA_MSG}" - "{CENTER_ALIGN}It makes you exasperating and\n" - "{CENTER_ALIGN}appealing at the same time.{EXTRA_MSG}" - "{CENTER_ALIGN}A sassy person like you should be..."); - -ALIGNED(4) static const u8 gHastyDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The hasty type.{EXTRA_MSG}" - "{CENTER_ALIGN}You like to take charge\n" - "{CENTER_ALIGN}and get things done.{EXTRA_MSG}" - "{CENTER_ALIGN}You're a real go-getter.{EXTRA_MSG}" - "{CENTER_ALIGN}But are you also stressed out?{EXTRA_MSG}" - "{CENTER_ALIGN}You get irritated when your\n" - "{CENTER_ALIGN}friends don't show up on time.{EXTRA_MSG}" - "{CENTER_ALIGN}You get frustrated when things\n" - "{CENTER_ALIGN}don't turn out the way you expect.{EXTRA_MSG}" - "{CENTER_ALIGN}Maybe you jab the elevator button\n" - "{CENTER_ALIGN}if the elevator is slow to arrive.{EXTRA_MSG}" - "{CENTER_ALIGN}...Maybe you're already jabbing\n" - "{CENTER_ALIGN}the A Button repeatedly now.{EXTRA_MSG}" - "{CENTER_ALIGN}Beware--getting too easily irritated\n" - "{CENTER_ALIGN}just isn't good for your well-being.{EXTRA_MSG}" - "{CENTER_ALIGN}A hasty person like you should be..."); - -ALIGNED(4) static const u8 gTimidDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The timid type.{EXTRA_MSG}" - "{CENTER_ALIGN}You may find it hard to go\n" - "{CENTER_ALIGN}to the washroom at night.{EXTRA_MSG}" - "{CENTER_ALIGN}You may also find it too frightening\n" - "{CENTER_ALIGN}to go back to school to get something\n" - "{CENTER_ALIGN}you left behind in class.{EXTRA_MSG}" - "{CENTER_ALIGN}If you're ever walking on a dark\n" - "{CENTER_ALIGN}street at night, you probably turn\n" - "{CENTER_ALIGN}around often to check behind you.{EXTRA_MSG}" - "{CENTER_ALIGN}But your timid nature is\n" - "{CENTER_ALIGN}also your good point!{EXTRA_MSG}" - "{CENTER_ALIGN}Because those who know fear are\n" - "{CENTER_ALIGN}those who know true courage.{EXTRA_MSG}" - "{CENTER_ALIGN}A timid person like you should be..."); - -ALIGNED(4) static const u8 gNaiveDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The naive type.{EXTRA_MSG}" - "{CENTER_ALIGN}You are highly curious,\n" - "{CENTER_ALIGN}and you love rare things.{EXTRA_MSG}" - "{CENTER_ALIGN}Your cheerful and carefree\n" - "{CENTER_ALIGN}attitude should make things fun\n" - "{CENTER_ALIGN}for the people around you.{EXTRA_MSG}" - "{CENTER_ALIGN}But you do have one flaw.\n" - "{CENTER_ALIGN}You can be childish.{EXTRA_MSG}" - "{CENTER_ALIGN}You can never sit still.\n" - "{CENTER_ALIGN}You're always on the move.{EXTRA_MSG}" - "{CENTER_ALIGN}You can also be selfish,\n" - "{CENTER_ALIGN}so you should watch yourself.{EXTRA_MSG}" - "{CENTER_ALIGN}A naive person like you should be..."); - -ALIGNED(4) static const u8 gImpishDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The impish type.{EXTRA_MSG}" - "{CENTER_ALIGN}You're playful, cheerful,\n" - "{CENTER_ALIGN}and you love pranks.{EXTRA_MSG}" - "{CENTER_ALIGN}You're also kindhearted.{EXTRA_MSG}" - "{CENTER_ALIGN}That's why the people around\n" - "{CENTER_ALIGN}you find you so irresistible.{EXTRA_MSG}" - "{CENTER_ALIGN}You must be the most\n" - "{CENTER_ALIGN}popular person around!{EXTRA_MSG}" - "{CENTER_ALIGN}Oh?{WAIT_PRESS} You're not that popular?{WAIT_PRESS}\n" - "{CENTER_ALIGN}You're either being modest...\n" - "{CENTER_ALIGN}or you just don't notice it.{EXTRA_MSG}" - "{CENTER_ALIGN}I bet people are just too shy\n" - "{CENTER_ALIGN}to let their feelings be known.{EXTRA_MSG}" - "{CENTER_ALIGN}There's someone out there who's\n" - "{CENTER_ALIGN}afraid to declare their love for you!{EXTRA_MSG}" - "{CENTER_ALIGN}An impish person like you should be..."); - -ALIGNED(4) static const u8 gJollyDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The jolly type.{EXTRA_MSG}" - "{CENTER_ALIGN}Always laughing and smiling,\n" - "{CENTER_ALIGN}you uplift everyone around you.{EXTRA_MSG}" - "{CENTER_ALIGN}You love jokes!{EXTRA_MSG}" - "{CENTER_ALIGN}You have lots of friends, and\n" - "{CENTER_ALIGN}you're popular wherever you go.{EXTRA_MSG}" - "{CENTER_ALIGN}But sometimes you get carried away\n" - "{CENTER_ALIGN}and say things that get you in trouble.{EXTRA_MSG}" - "{CENTER_ALIGN}You should learn to think before\n" - "{CENTER_ALIGN}saying or doing anything.{EXTRA_MSG}" - "{CENTER_ALIGN}A jolly person like you should be..."); - -ALIGNED(4) static const u8 gBraveDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The brave type.{EXTRA_MSG}" - "{CENTER_ALIGN}You have a strong sense of justice.{WAIT_PRESS}\n" - "{CENTER_ALIGN}You hate evil.{WAIT_PRESS}\n" - "{CENTER_ALIGN}You will take on any opponent.{EXTRA_MSG}" - "{CENTER_ALIGN}You are truly a hero!{EXTRA_MSG}" - "{CENTER_ALIGN}Go forth!{EXTRA_MSG}" - "{CENTER_ALIGN}For justice...{WAIT_PRESS}\n" - "{CENTER_ALIGN}For peace on earth...{WAIT_PRESS}\n" - "{CENTER_ALIGN}Fight the forces of evil!{EXTRA_MSG}" - "{CENTER_ALIGN}......{WAIT_PRESS}If I'm wrong...{WAIT_PRESS}\n" - "{CENTER_ALIGN}Work at becoming a true hero!{EXTRA_MSG}" - "{CENTER_ALIGN}A brave person like you should be..."); - -ALIGNED(4) static const u8 gDocileDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The docile type.{EXTRA_MSG}" - "{CENTER_ALIGN}You're very kindhearted.{WAIT_PRESS}\n" - "{CENTER_ALIGN}Very helpful.{WAIT_PRESS}\n" - "{CENTER_ALIGN}You can make friends with anyone.{EXTRA_MSG}" - "{CENTER_ALIGN}You're a wonderful person.{EXTRA_MSG}" - "{CENTER_ALIGN}......{WAIT_PRESS}Is that going overboard?{WAIT_PRESS}\n" - "{CENTER_ALIGN}I don't think so.{EXTRA_MSG}" - "{CENTER_ALIGN}You yourself should be\n" - "{CENTER_ALIGN}the best judge of that.{EXTRA_MSG}" - "{CENTER_ALIGN}A docile person like you should be..."); - -ALIGNED(4) static const u8 gHardyDescription[] = _( - "{CENTER_ALIGN}You appear to be...{WAIT_PRESS}\n" - "{CENTER_ALIGN}The hardy type.{EXTRA_MSG}" - "{CENTER_ALIGN}You do your homework diligently,\n" - "{CENTER_ALIGN}and you know to eat properly.{EXTRA_MSG}" - "{CENTER_ALIGN}You have strong willpower that lets\n" - "{CENTER_ALIGN}you complete tasks, however tough.{EXTRA_MSG}" - "{CENTER_ALIGN}But, you can also be stubborn to the\n" - "{CENTER_ALIGN}point of even feuding with friends...{EXTRA_MSG}" - "{CENTER_ALIGN}Nothing will go right for you when you're\n" - "{CENTER_ALIGN}irritated, so learn to laugh it off.{EXTRA_MSG}" - "{CENTER_ALIGN}A hardy person like you should be..."); - -static const UnkTextStruct2 sUnknown_80F4244 = -{ +static const UnkTextStruct2 sUnknown_80F4244 = { 0, 0, 0, 0, 5, 12, 6, 5, 5, 5, 0, NULL -}; +}; \ No newline at end of file diff --git a/src/data/post_office_guide1.h b/src/data/post_office_guide1.h index de55f3702..9228950fe 100644 --- a/src/data/post_office_guide1.h +++ b/src/data/post_office_guide1.h @@ -21,68 +21,43 @@ enum PostOfficeMenuActions SEND_THANK_YOU_MAIL }; -static const u8 sPostOffice[]; -static const u8 sBulletinBoard[]; -static const u8 sDelivery[]; -static const u8 sFriendRescue[]; -static const u8 sCancel[]; - -static const MenuItem sPostOfficeHelpStartMenu[] = -{ - {sPostOffice, POST_OFFICE}, - {sBulletinBoard, BULLETIN_BOARD}, - {sDelivery, DELIVERY}, - {sFriendRescue, FRIEND_RESCUE}, - {sCancel, CANCEL}, +static const MenuItem sPostOfficeHelpStartMenu[] = { + {_("Post Office"), POST_OFFICE}, + {_("Bulletin Board"), BULLETIN_BOARD}, + {_("Delivery"), DELIVERY}, + {_("{COLOR YELLOW}Friend Rescue{RESET} "), FRIEND_RESCUE}, + {_("Cancel"), CANCEL}, {NULL, EXIT} }; -ALIGNED(4) static const u8 sCancel[] = _("Cancel"); -ALIGNED(4) static const u8 sFriendRescue[] = _("{COLOR YELLOW}Friend Rescue{RESET} "); -ALIGNED(4) static const u8 sDelivery[] = _("Delivery"); -ALIGNED(4) static const u8 sBulletinBoard[] = _("Bulletin Board"); -ALIGNED(4) static const u8 sPostOffice[] = _("Post Office"); - -static const u8 sFriendRescueInfo[]; -static const u8 sGoRescue[]; -static const u8 sGetHelp[]; -static const u8 sDeletingMailInfo[]; -static const u8 sExit[]; - static const MenuItem gPostOfficeHelpFriendRescueMenu[] = { - {sFriendRescueInfo, FRIEND_RESCUE_INFO}, - {sGoRescue, GO_RESCUE}, - {sGetHelp, GET_HELP_MENU}, - {sDeletingMailInfo, DELETING_MAIL}, - {sExit, EXIT}, + {_("Friend Rescue Info"), FRIEND_RESCUE_INFO}, + {_("{COLOR YELLOW}Go rescue{RESET} "), GO_RESCUE}, + {_("{COLOR YELLOW}Get help{RESET} "), GET_HELP_MENU}, + {_("Deleting Mail Info"), DELETING_MAIL}, + {_("Exit"), EXIT}, {NULL, EXIT} }; -ALIGNED(4) static const u8 sExit[] = _("Exit"); -ALIGNED(4) static const u8 sDeletingMailInfo[] = _("Deleting Mail Info"); -ALIGNED(4) static const u8 sGetHelp[] = _("{COLOR YELLOW}Get help{RESET} "); -ALIGNED(4) static const u8 sGoRescue[] = _("{COLOR YELLOW}Go rescue{RESET} "); -ALIGNED(4) static const u8 sFriendRescueInfo[] = _("Friend Rescue Info"); - static const MenuItem sPostOfficeHelpGoRescueMenu[] = { - {"Rescue Procedures", RESCUE_PROCEDURES}, - {"Receive SOS Mail", RECEIVE_SOS_MAIL}, - {"Leave for Rescue", LEAVE_FOR_RESCUE}, - {"Send A-OK Mail", SEND_AOK_MAIL}, - {"Get Thank-You Mail", GET_THANK_YOU_MAIL}, - {sExit, EXIT}, // Typing "Exit" as a literal will automatically point to the previous one also + {_("Rescue Procedures"), RESCUE_PROCEDURES}, + {_("Receive SOS Mail"), RECEIVE_SOS_MAIL}, + {_("Leave for Rescue"), LEAVE_FOR_RESCUE}, + {_("Send A-OK Mail"), SEND_AOK_MAIL}, + {_("Get Thank-You Mail"), GET_THANK_YOU_MAIL}, + {_("Exit"), EXIT}, {NULL, EXIT} }; static const MenuItem sPostOfficeHelpGetHelpMenu[] = { - {"Getting Help", GETTING_HELP}, - {"Send SOS Mail", SEND_SOS_MAIL}, - {"Receive A-OK Mail", RECEIVE_AOK_MAIL}, - {"Send Thank-You Mail", SEND_THANK_YOU_MAIL}, - {sExit, EXIT}, // Typing "Exit" as a literal will automatically point to the previous one also + {_("Getting Help"), GETTING_HELP}, + {_("Send SOS Mail"), SEND_SOS_MAIL}, + {_("Receive A-OK Mail"), RECEIVE_AOK_MAIL}, + {_("Send Thank-You Mail"), SEND_THANK_YOU_MAIL}, + {_("Exit"), EXIT}, {NULL, EXIT} }; diff --git a/src/data/story_missions.h b/src/data/story_missions.h index c7eae1879..a2c253169 100644 --- a/src/data/story_missions.h +++ b/src/data/story_missions.h @@ -1,94 +1,35 @@ -static const u8 gUnknown_8109C94[]; -static const u8 gUnknown_8109C80[]; -static const u8 gUnknown_8109C70[]; -static const u8 gUnknown_8109C60[]; -static const u8 gUnknown_8109C4C[]; -static const u8 gUnknown_8109C3C[]; -static const u8 gUnknown_8109C30[]; -static const u8 gUnknown_8109C24[]; -static const u8 gUnknown_8109C24[]; -static const u8 gUnknown_8109C24[]; -static const u8 gUnknown_8109C14[]; -static const u8 gUnknown_8109C00[]; -static const u8 gUnknown_8109BE8[]; -static const u8 gUnknown_8109BC8[]; -static const u8 gUnknown_8109BB4[]; -static const u8 gUnknown_8109BA0[]; -static const u8 gUnknown_8109B8C[]; -static const u8 gUnknown_8109B78[]; -static const u8 gUnknown_8109B60[]; -static const u8 gUnknown_8109C30[]; -static const u8 gUnknown_8109B4C[]; -static const u8 gUnknown_8109B38[]; -static const u8 gUnknown_8109B24[]; -static const u8 gUnknown_8109B10[]; -static const u8 gUnknown_8109AF8[]; -static const u8 gUnknown_8109AE8[]; -static const u8 gUnknown_8109AD8[]; -static const u8 gUnknown_8109AC4[]; -static const u8 gUnknown_8109AB0[]; -static const u8 gUnknown_8109C14[]; -static const u8 gUnknown_8109A94[]; -static const MissionText gStoryMissionText[] = { - { gUnknown_8109C94, -1, -1, 0, 0 }, - { gUnknown_8109C80, -1, -1, 0, 0 }, - { gUnknown_8109C70, 0, 1, 0, 0 }, - { gUnknown_8109C60, 2, 3, 0, 0 }, - { gUnknown_8109C4C, -1, -1, 0, 0 }, - { gUnknown_8109C3C, 4, 5, 0, 0 }, - { gUnknown_8109C30, -1, -1, 0, 0 }, - { gUnknown_8109C24, -1, -1, 0, 0 }, - { gUnknown_8109C24, 6, 7, 0, 0 }, - { gUnknown_8109C24, 8, 9, 0, 0 }, - { gUnknown_8109C14, -1, 10, 0, 0 }, - { gUnknown_8109C00, 11, 12, 0, 0 }, - { gUnknown_8109BE8, 14, 15, 0, 0 }, - { gUnknown_8109BC8, -1, -1, 0, 0 }, - { gUnknown_8109BB4, 16, 17, 0, 0 }, - { gUnknown_8109BA0, -1, 33, 0, 0 }, - { gUnknown_8109B8C, -1, -1, 0, 0 }, - { gUnknown_8109B78, -1, -1, 0, 0 }, - { gUnknown_8109B60, -1, -1, 0, 0 }, - { gUnknown_8109C30, -1, -1, 0, 0 }, - { gUnknown_8109B4C, 20, 21, 0, 0 }, - { gUnknown_8109B38, 22, 23, 0, 0 }, - { gUnknown_8109B24, 24, 25, 0, 0 }, - { gUnknown_8109B10, -1, 26, 0, 0 }, - { gUnknown_8109AF8, 18, 19, 0, 0 }, - { gUnknown_8109AE8, 27, 28, 0, 0 }, - { gUnknown_8109AD8, -1, -1, 0, 0 }, - { gUnknown_8109AC4, -1, -1, 0, 0 }, - { gUnknown_8109AB0, -1, 32, 0, 0 }, - { gUnknown_8109C14, -1, -1, 0, 0 }, - { gUnknown_8109A94, -1, -1, 0, 0 }, +static const MissionText sStoryMissionText[] = { + { _("Rescue Caterpie."), -1, -1, 0, 0 }, + { _("Rescue Magnemite."), -1, -1, 0, 0 }, + { _("Rescue Diglett."), 0, 1, 0, 0 }, + { _("Rescue Metapod."), 2, 3, 0, 0 }, + { _("Rescue Jumpluff."), -1, -1, 0, 0 }, + { _("Rescue Shiftry."), 4, 5, 0, 0 }, + { _("Meet Xatu."), -1, -1, 0, 0 }, + { _("Fugitive"), -1, -1, 0, 0 }, + { _("Fugitive"), 6, 7, 0, 0 }, + { _("Fugitive"), 8, 9, 0, 0 }, + { _("Meet Ninetales."), -1, 10, 0, 0 }, + { _("Rescue Alakazam."), 11, 12, 0, 0 }, + { _("Seek Rayquaza's help."), 14, 15, 0, 0 }, + { _("{COLOR YELLOW_C}Scenario Progress Dummy{RESET}"), -1, -1, 0, 0 }, + { _("Punish bad Mankey."), 16, 17, 0, 0 }, + { _("Rescue Smeargle."), -1, 33, 0, 0 }, + { _("Explore seafloor."), -1, -1, 0, 0 }, + { _("Meet sea guardian."), -1, -1, 0, 0 }, + { _("Check mystery PokĂ©mon."), -1, -1, 0, 0 }, + { _("Meet Xatu."), -1, -1, 0, 0 }, + { _("Mirage PokĂ©mon 1"), 20, 21, 0, 0 }, + { _("Mirage PokĂ©mon 2"), 22, 23, 0, 0 }, + { _("Mirage PokĂ©mon 3"), 24, 25, 0, 0 }, + { _("Mirage PokĂ©mon 4"), -1, 26, 0, 0 }, + { _("Meet toughest PokĂ©mon."), 18, 19, 0, 0 }, + { _("Catch thief."), 27, 28, 0, 0 }, + { _("Rescue Latias."), -1, -1, 0, 0 }, + { _("Investigate Relic."), -1, -1, 0, 0 }, + { _("Rescue Medicham."), -1, 32, 0, 0 }, + { _("Meet Ninetales."), -1, -1, 0, 0 }, + { _("Break Gardevoir's curse."), -1, -1, 0, 0 }, { NULL, -1, -1, 0, 0 }, -}; - -ALIGNED(4) const u8 gUnknown_8109A94[] = _("Break Gardevoir's curse."); -ALIGNED(4) const u8 gUnknown_8109AB0[] = _("Rescue Medicham."); -ALIGNED(4) const u8 gUnknown_8109AC4[] = _("Investigate Relic."); -ALIGNED(4) const u8 gUnknown_8109AD8[] = _("Rescue Latias."); -ALIGNED(4) const u8 gUnknown_8109AE8[] = _("Catch thief."); -ALIGNED(4) const u8 gUnknown_8109AF8[] = _("Meet toughest PokĂ©mon."); -ALIGNED(4) const u8 gUnknown_8109B10[] = _("Mirage PokĂ©mon 4"); -ALIGNED(4) const u8 gUnknown_8109B24[] = _("Mirage PokĂ©mon 3"); -ALIGNED(4) const u8 gUnknown_8109B38[] = _("Mirage PokĂ©mon 2"); -ALIGNED(4) const u8 gUnknown_8109B4C[] = _("Mirage PokĂ©mon 1"); -ALIGNED(4) const u8 gUnknown_8109B60[] = _("Check mystery PokĂ©mon."); -ALIGNED(4) const u8 gUnknown_8109B78[] = _("Meet sea guardian."); -ALIGNED(4) const u8 gUnknown_8109B8C[] = _("Explore seafloor."); -ALIGNED(4) const u8 gUnknown_8109BA0[] = _("Rescue Smeargle."); -ALIGNED(4) const u8 gUnknown_8109BB4[] = _("Punish bad Mankey."); -ALIGNED(4) const u8 gUnknown_8109BC8[] = _("{COLOR YELLOW_C}Scenario Progress Dummy{RESET}"); -ALIGNED(4) const u8 gUnknown_8109BE8[] = _("Seek Rayquaza's help."); -ALIGNED(4) const u8 gUnknown_8109C00[] = _("Rescue Alakazam."); -ALIGNED(4) const u8 gUnknown_8109C14[] = _("Meet Ninetales."); -ALIGNED(4) const u8 gUnknown_8109C24[] = _("Fugitive"); -ALIGNED(4) const u8 gUnknown_8109C30[] = _("Meet Xatu."); -ALIGNED(4) const u8 gUnknown_8109C3C[] = _("Rescue Shiftry."); -ALIGNED(4) const u8 gUnknown_8109C4C[] = _("Rescue Jumpluff."); -ALIGNED(4) const u8 gUnknown_8109C60[] = _("Rescue Metapod."); -ALIGNED(4) const u8 gUnknown_8109C70[] = _("Rescue Diglett."); -ALIGNED(4) const u8 gUnknown_8109C80[] = _("Rescue Magnemite."); -ALIGNED(4) const u8 gUnknown_8109C94[] = _("Rescue Caterpie."); +}; \ No newline at end of file diff --git a/src/data/trade_items_menu.h b/src/data/trade_items_menu.h index e38cf8331..e56aab7d9 100644 --- a/src/data/trade_items_menu.h +++ b/src/data/trade_items_menu.h @@ -1,12 +1,12 @@ -static const MenuItem sUnknown_80E60A0[3] = { - {"Send item", 1}, - {"Receive item", 2}, +static const MenuItem sUnknown_80E60A0[] = { + {_("Send item"), 1}, + {_("Receive item"), 2}, {NULL, 0}, }; -static const MenuItem sUnknown_80E60D4[3] = { - {"Send item", -1}, - {"Receive item", 2}, +static const MenuItem sUnknown_80E60D4[] = { + {_("Send item"), -1}, + {_("Receive item"), 2}, {NULL, 0}, }; @@ -20,10 +20,10 @@ static const UnkTextStruct2 sUnknown_80E60EC = NULL }; -static const MenuItem sUnknown_80E6104[4] = { - {"Confirm", 3}, - {"Info", 4}, - {"Cancel", 7}, +static const MenuItem sUnknown_80E6104[] = { + {_("Confirm"), 3}, + {_("Info"), 4}, + {_("Cancel"), 7}, {NULL, 0}, }; @@ -37,9 +37,9 @@ static const UnkTextStruct2 unused = NULL }; -static const MenuItem sUnknown_80E6154[3] = { - {"Yes", 5}, - {"No", 6}, +static const MenuItem sUnknown_80E6154[] = { + {_("Yes"), 5}, + {_("No"), 6}, {NULL, 0}, }; @@ -53,9 +53,9 @@ static const UnkTextStruct2 sUnknown_80E6174 = NULL }; -static const MenuItem sUnknown_80E618C[3] = { - {"Yes", 5}, - {"Cancel", 0}, +static const MenuItem sUnknown_80E618C[] = { + {_("Yes"), 5}, + {_("Cancel"), 0}, {NULL, 0}, }; diff --git a/src/data/wonder_mail_1.h b/src/data/wonder_mail_1.h index fd1d3aed6..f4df68bf9 100644 --- a/src/data/wonder_mail_1.h +++ b/src/data/wonder_mail_1.h @@ -1,55 +1,45 @@ - - -const MenuItem gUnknown_80DD970[] = -{ - {"Receive SOS Mail", 0x0}, - {"Leave for Rescue", 0x1}, - {"Send A-OK Mail", 0x2}, - {"Delete Mail", 0x3}, - {"Cancel", 0xA}, - {NULL, 0xA} +const MenuItem gUnknown_80DD970[] = { + {_("Receive SOS Mail"), 0}, + {_("Leave for Rescue"), 1}, + {_("Send A-OK Mail"), 2}, + {_("Delete Mail"), 3}, + {_("Cancel"), 10}, + {NULL, 10} }; -const MenuItem gUnknown_80DD9EC[] = -{ - {"Delete SOS Mail", 0x5}, - {"Delete A-OK Mail", 0x6}, - {"Delete All Mail", 0x7}, - {"Cancel", 0xA}, - {NULL, 0xA} +const MenuItem gUnknown_80DD9EC[] = { + {_("Delete SOS Mail"), 5}, + {_("Delete A-OK Mail"), 6}, + {_("Delete All Mail"), 7}, + {_("Cancel"), 10}, + {NULL, 10} }; -const MenuItem gUnknown_80DDA48[] = -{ - {"Yes", 0x8}, - {"Cancel", 0xA}, - {NULL, 0xA} +const MenuItem gUnknown_80DDA48[] = { + {_("Yes"), 8}, + {_("Cancel"), 10}, + {NULL, 10} }; -const MenuItem gUnknown_80DDA64[] = -{ - {"Yes", 0x8}, - {"No", 0x9}, - {NULL, 0xA} +const MenuItem gUnknown_80DDA64[] = { + {_("Yes"), 8}, + {_("No"), 9}, + {NULL, 10} }; -const MenuItem gUnknown_80DDA80[] = -{ - {"Yes", 0x8}, - {"No", 0x9}, - {"Cancel", 0xA}, - {NULL, 0xA} +const MenuItem gUnknown_80DDA80[] = { + {_("Yes"), 8}, + {_("No"), 9}, + {_("Cancel"), 10}, + {NULL, 10} }; -const MenuItem gUnknown_80DDAA0[] = -{ - {SendWOPokemon, 0x12}, - {"Cancel", 0xA}, - {NULL, 0xA}, +const MenuItem gUnknown_80DDAA0[] = { + {_("Send w/o PokĂ©mon"), 18}, + {_("Cancel"), 10}, + {NULL, 10}, }; -ALIGNED(4) const u8 SendWOPokemon[] = _("Send w/o PokĂ©mon"); - const UnkTextStruct2 gUnknown_80DDACC = { 0x00, 0x00, 0x00, 0x00, @@ -70,31 +60,27 @@ const UnkTextStruct2 gUnknown_80DDAE4 = NULL }; -const MenuItem gUnknown_80DDAFC[] = -{ - {"Confirm", 0xB}, - {"Info", 0xC}, - {NULL, 0xA}, +const MenuItem gUnknown_80DDAFC[] = { + {_("Confirm"), 11}, + {_("Info"), 12}, + {NULL, 10}, }; -const MenuItem gUnknown_80DDB24[] = -{ - {"Game Link cable", 0xD}, - {"Password", 0xF}, - {"Cancel", 0xA}, - {NULL, 0xA}, +const MenuItem gUnknown_80DDB24[] = { + {_("Game Link cable"), 13}, + {_("Password"), 15}, + {_("Cancel"), 10}, + {NULL, 10}, }; -const MenuItem gUnknown_80DDB60[] = -{ - {SendPokemon_80DDB98, 0x11}, - {DontSendPokemon_80DDB80, 0x12}, - {"Cancel", 0xA}, - {NULL, 0xA}, +const MenuItem gUnknown_80DDB60[] = { + {_("Send PokĂ©mon"), 17}, + {_("Don't Send PokĂ©mon"), 18}, + {_("Cancel"), 10}, + {NULL, 10}, }; -ALIGNED(4) const u8 DontSendPokemon_80DDB80[] = _("Don't Send PokĂ©mon"); -ALIGNED(4) const u8 SendPokemon_80DDB98[] = _("Send PokĂ©mon"); + ALIGNED(4) const char gUnknown_80DDBA8[] = _( " What you need to do is\n" diff --git a/src/data/wonder_mail_main_menu.h b/src/data/wonder_mail_main_menu.h index 18a98b928..a54d04dad 100644 --- a/src/data/wonder_mail_main_menu.h +++ b/src/data/wonder_mail_main_menu.h @@ -1,36 +1,32 @@ - - -const MenuItem gSelectWonderMailModeMainMenuItems[3] = -{ - {"Send", WONDER_MAIL_MODE_SEND}, - {"Receive", WONDER_MAIL_MODE_RECEIVE}, +const MenuItem gSelectWonderMailModeMainMenuItems[] = { + {_("Send"), WONDER_MAIL_MODE_SEND}, + {_("Receive"), WONDER_MAIL_MODE_RECEIVE}, {NULL, 0} }; -const MenuItem gSendWonderMailMainMenuItems[4] = -{ - {"Game Link cable", WONDER_MAIL_GAME_LINK}, - {"Password", -1}, - {"Cancel", 8}, +const MenuItem gSendWonderMailMainMenuItems[] = { + {_("Game Link cable"), WONDER_MAIL_GAME_LINK}, + {_("Password"), -1}, + {_("Cancel"), 8}, {NULL, 0} }; -const MenuItem gReceiveWonderMailMainMenuItems[4] = -{ - {"Game Link cable", WONDER_MAIL_GAME_LINK}, - {"Password", WONDER_MAIL_PASSWORD}, - {"Cancel", 8}, +const MenuItem gReceiveWonderMailMainMenuItems[] = { + {_("Game Link cable"), WONDER_MAIL_GAME_LINK}, + {_("Password"), WONDER_MAIL_PASSWORD}, + {_("Cancel"), 8}, {NULL, 0} }; -const MenuItem gUnknown_80E78F8[3] = -{ - {"Yes", 6}, - {"Cancel", 0}, +const MenuItem gUnknown_80E78F8[] = { + {_("Yes"), 6}, + {_("Cancel"), 0}, {NULL, 0} }; + + ALIGNED(4) const char gUnknown_80E7914[] = "There was a communication error."; ALIGNED(4) const char gUnknown_80E7938[] = "An incorrect number of GBA systems are\n" diff --git a/src/debug_menu1.c b/src/debug_menu1.c index 519cf62af..c83bb8c07 100644 --- a/src/debug_menu1.c +++ b/src/debug_menu1.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "code_8097670.h" #include "constants/friend_area.h" #include "constants/main_menu.h" diff --git a/src/debug_unused1.c b/src/debug_unused1.c new file mode 100644 index 000000000..fc285b374 --- /dev/null +++ b/src/debug_unused1.c @@ -0,0 +1,2 @@ +#include "global.h" +#include "globaldata.h" \ No newline at end of file diff --git a/src/debug_unused2.c b/src/debug_unused2.c new file mode 100644 index 000000000..fc285b374 --- /dev/null +++ b/src/debug_unused2.c @@ -0,0 +1,2 @@ +#include "global.h" +#include "globaldata.h" \ No newline at end of file diff --git a/src/debug_unused3.c b/src/debug_unused3.c new file mode 100644 index 000000000..fc285b374 --- /dev/null +++ b/src/debug_unused3.c @@ -0,0 +1,2 @@ +#include "global.h" +#include "globaldata.h" \ No newline at end of file diff --git a/src/debug_unused4.c b/src/debug_unused4.c new file mode 100644 index 000000000..fc285b374 --- /dev/null +++ b/src/debug_unused4.c @@ -0,0 +1,2 @@ +#include "global.h" +#include "globaldata.h" \ No newline at end of file diff --git a/src/debug_unused5.c b/src/debug_unused5.c new file mode 100644 index 000000000..fc285b374 --- /dev/null +++ b/src/debug_unused5.c @@ -0,0 +1,2 @@ +#include "global.h" +#include "globaldata.h" \ No newline at end of file diff --git a/src/debug_unused6.c b/src/debug_unused6.c new file mode 100644 index 000000000..fc285b374 --- /dev/null +++ b/src/debug_unused6.c @@ -0,0 +1,2 @@ +#include "global.h" +#include "globaldata.h" \ No newline at end of file diff --git a/src/hints_menu1.c b/src/hints_menu1.c index 263b4d472..45d49ce19 100644 --- a/src/hints_menu1.c +++ b/src/hints_menu1.c @@ -108,7 +108,7 @@ static void DrawHintSelectionMenu(void) sub_80073B8(sUnknown_203B264->unk34); PrintStringOnWindow(16, 0, sHints, sUnknown_203B264->unk34, 0); - for (hintIndex = 0; hintIndex < NUM_HINTS; hintIndex++) { + for (hintIndex = 0; hintIndex < HINT_MAX; hintIndex++) { y = sub_8013800(&sUnknown_203B264->input, hintIndex); PrintStringOnWindow(10, y, gCommonHints[hintIndex].heading, sUnknown_203B264->unk34, 0); } diff --git a/src/kangaskhan_storage1.c b/src/kangaskhan_storage1.c index 9bd044f20..25cf93b93 100644 --- a/src/kangaskhan_storage1.c +++ b/src/kangaskhan_storage1.c @@ -220,7 +220,7 @@ static void sub_8016FF8(void) case 7: gKangaskhanStorageWork->fallbackState = KANGASKHAN_STORAGE_MAIN_MENU; gKangaskhanStorageWork->monPortrait.spriteId = FALSE; - CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_STORAGE_HAS_NOTHING], 0, gKangaskhanStorageWork->monPortraitPtr, 0x10D); + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_STORAGE_EMPTY], 0, gKangaskhanStorageWork->monPortraitPtr, 0x10D); break; case 8: gKangaskhanStorageWork->fallbackState = KANGASKHAN_STORAGE_MAIN_MENU; @@ -231,12 +231,12 @@ static void sub_8016FF8(void) sub_8090E14(gFormatBuffer_Items[0], &gKangaskhanStorageWork->storedItem, 0); gKangaskhanStorageWork->fallbackState = 14; gKangaskhanStorageWork->monPortrait.spriteId = FALSE; - CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT__INVALID_ITEM], 0, gKangaskhanStorageWork->monPortraitPtr, 0x30D); + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT_INVALID_ITEM], 0, gKangaskhanStorageWork->monPortraitPtr, 0x30D); break; case 10: gKangaskhanStorageWork->fallbackState = 14; gKangaskhanStorageWork->monPortrait.spriteId = FALSE; - CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT__TOO_MANY_OF_ITEM], 0, gKangaskhanStorageWork->monPortraitPtr, 0x30D); + CreateDialogueBoxAndPortrait(gCommonKangStorage[gKangaskhanStorageWork->mode][KANG_DLG_DEPOSIT_TOO_MANY_OF_ITEM], 0, gKangaskhanStorageWork->monPortraitPtr, 0x30D); break; case 11: gKangaskhanStorageWork->fallbackState = 13; diff --git a/src/personality_test1.c b/src/personality_test1.c index 499895066..0af227121 100644 --- a/src/personality_test1.c +++ b/src/personality_test1.c @@ -182,7 +182,7 @@ static void GenerateNewQuestionOrGender(void) sPersonalityTestTracker->QuestionCounter++; if (sPersonalityTestTracker->QuestionCounter > MAX_ASKED_QUESTIONS) { - CreateMenuDialogueBoxAndPortrait(gGenderText, 0, 0, gGenderMenu, 0, 3, 0, 0, 257); + CreateMenuDialogueBoxAndPortrait(sGender0, 0, 0, gGenderMenu, 0, 3, 0, 0, 257); sPersonalityTestTracker->TestState = PERSONALITY_PLAYER_GENDER; } else { From 7506f05cb8999bddc06faed9ff43c2ca973db462 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:30:57 -0500 Subject: [PATCH 32/48] Update code_8097670.h --- include/code_8097670.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/code_8097670.h b/include/code_8097670.h index 34f15dbab..d712ad31e 100644 --- a/include/code_8097670.h +++ b/include/code_8097670.h @@ -44,7 +44,7 @@ enum AdventureAchievement // size: 0xC4 struct unkStruct_203B494 { - /* 0x4 */ u32 achievements; // Adventure achievement flags + /* 0x0 */ u32 achievements; // Adventure achievement flags /* 0x4 */ s32 numAdventures; /* 0x8 */ s32 friendRescueSuccesses; /* 0xC */ s32 numEvolved; From e8ae8d8b73c14903fc9a1bffb5cae7395a4d4883 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:36:14 -0500 Subject: [PATCH 33/48] Update personality_test1.h --- src/data/personality_test1.h | 44 +++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/src/data/personality_test1.h b/src/data/personality_test1.h index 50a2d8a72..5e939f674 100644 --- a/src/data/personality_test1.h +++ b/src/data/personality_test1.h @@ -754,25 +754,37 @@ static const MenuItem gGenderMenu[] = { -UNUSED static const u8 unknownPersonality[NUM_PERSONALITIES] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 +UNUSED static const u8 sUnusedLUT[NUM_PERSONALITIES] = { + [HARDY ] = HARDY + 1, + [DOCILE ] = DOCILE + 1, + [BRAVE ] = BRAVE + 1, + [JOLLY ] = JOLLY + 1, + [IMPISH ] = IMPISH + 1, + [NAIVE ] = NAIVE + 1, + [TIMID ] = TIMID + 1, + [HASTY ] = HASTY + 1, + [SASSY ] = SASSY + 1, + [CALM ] = CALM + 1, + [RELAXED] = RELAXED + 1, + [LONELY ] = LONELY + 1, + [QUIRKY ] = QUIRKY + 1, }; static const s16 gStarters[NUM_PERSONALITIES][2] = { - // MALE / FEMALE - [HARDY] = {MONSTER_CHARMANDER, MONSTER_PIKACHU}, - [DOCILE] = {MONSTER_BULBASAUR, MONSTER_CHIKORITA}, - [BRAVE] = {MONSTER_MACHOP, MONSTER_CHARMANDER}, - [JOLLY] = {MONSTER_SQUIRTLE, MONSTER_TOTODILE}, - [IMPISH] = {MONSTER_PIKACHU, MONSTER_CUBONE}, - [NAIVE] = {MONSTER_TOTODILE, MONSTER_EEVEE}, - [TIMID] = {MONSTER_CYNDAQUIL, MONSTER_MUDKIP}, - [HASTY] = {MONSTER_TORCHIC, MONSTER_SKITTY}, - [SASSY] = {MONSTER_TREECKO, MONSTER_TORCHIC}, - [CALM] = {MONSTER_MUDKIP, MONSTER_BULBASAUR}, - [RELAXED] = {MONSTER_PSYDUCK, MONSTER_SQUIRTLE}, - [LONELY] = {MONSTER_CUBONE, MONSTER_PSYDUCK}, - [QUIRKY] = {MONSTER_MEOWTH, MONSTER_TREECKO} + // MALE FEMALE + [HARDY ] = { MONSTER_CHARMANDER, MONSTER_PIKACHU }, + [DOCILE ] = { MONSTER_BULBASAUR, MONSTER_CHIKORITA }, + [BRAVE ] = { MONSTER_MACHOP, MONSTER_CHARMANDER }, + [JOLLY ] = { MONSTER_SQUIRTLE, MONSTER_TOTODILE }, + [IMPISH ] = { MONSTER_PIKACHU, MONSTER_CUBONE }, + [NAIVE ] = { MONSTER_TOTODILE, MONSTER_EEVEE }, + [TIMID ] = { MONSTER_CYNDAQUIL, MONSTER_MUDKIP }, + [HASTY ] = { MONSTER_TORCHIC, MONSTER_SKITTY }, + [SASSY ] = { MONSTER_TREECKO, MONSTER_TORCHIC }, + [CALM ] = { MONSTER_MUDKIP, MONSTER_BULBASAUR }, + [RELAXED] = { MONSTER_PSYDUCK, MONSTER_SQUIRTLE }, + [LONELY ] = { MONSTER_CUBONE, MONSTER_PSYDUCK }, + [QUIRKY ] = { MONSTER_MEOWTH, MONSTER_TREECKO } }; From d7fbd95975e88aade95275add62fe746d1144ba3 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:54:26 -0500 Subject: [PATCH 34/48] Update pokemon.h --- include/pokemon.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pokemon.h b/include/pokemon.h index ec99ed9f0..f4290ff7d 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -102,12 +102,12 @@ extern s32 sub_808D580(s32 *); static inline bool8 PokemonFlag1(PokemonStruct1 *mon) { - return (mon->unk0 & FLAG_UNK_1); + return (mon->unk0 >> (FLAG_UNK_1 - 1)) & 1; } static inline bool8 PokemonFlag2(PokemonStruct1 *mon) { - return ((mon->unk0 >> (FLAG_ON_TEAM - 1)) & 1); + return (mon->unk0 >> (FLAG_ON_TEAM - 1)) & 1; } static inline void SetPokemonFlag2(PokemonStruct1 *mon) From 04d4fb787815b2e3a6d3aa9759974be3a1002328 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:21:24 -0500 Subject: [PATCH 35/48] Fix 32bit reads/writes --- include/structs/dungeon_entity.h | 7 +++--- src/dungeon_serializer.c | 40 ++++++++++++++++---------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 0bf034ef3..df5c121c1 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -8,6 +8,7 @@ #include "structs/str_items.h" #include "structs/str_moves.h" #include "structs/str_position.h" +#include "math.h" #include "number_util.h" #include "sprite.h" @@ -231,9 +232,9 @@ typedef struct EntityInfo /* 0x28 */ s16 flashFireBoost; // These start at 0x1000, and are halved by certain moves like Screech to lower the corresponding stat. // Index 0 is Attack. Index 1 is Special Attack. - /* 0x2C */ s32 offensiveMultipliers[2]; + /* 0x2C */ s24_8 offensiveMultipliers[2]; // Index 0 is Defense. Index 1 is Special Defense. - /* 0x34 */ s32 defensiveMultipliers[2]; + /* 0x34 */ s24_8 defensiveMultipliers[2]; /* 0x3C */ HiddenPower hiddenPower; /* 0x40 */ JoinedAt joinedAt; // Uses the dungeon index in dungeon.h. /* 0x44 */ ActionContainer action; @@ -338,7 +339,7 @@ typedef struct EntityInfo /* 0x169 */ u8 turnsSinceWarpScarfActivation; /* 0x16C */ Position targetPos; /* 0x170 */ Position pixelPos; - u32 unk174; + s24_8 unk174; u16 abilityEffectFlags; // See enum AbilityEffectFlags /* 0x17A */ u16 mimicMoveIDs[MAX_MON_MOVES]; // All moves that Mimic has copied (not sure on size...) // Previous value of targetPosition for movement, 1 and 2 moves ago. diff --git a/src/dungeon_serializer.c b/src/dungeon_serializer.c index 9016fd767..7e2dbfb9b 100644 --- a/src/dungeon_serializer.c +++ b/src/dungeon_serializer.c @@ -42,6 +42,7 @@ static void ReadDungeonUnkE240(DataSerializer *seri, unkDungeonE240 *dst); static void ReadDungeonUnkE260(DataSerializer *seri, unkDungeonE260 *dst); static void ReadDungeonVisibility(DataSerializer *seri); static void ReadEyesightStatus(DataSerializer *seri, EyesightStatus *dst); +static s24_8 ReadF24_8(DataSerializer *seri); static void ReadHiddenPower(DataSerializer *seri, HiddenPower *dst); static void ReadImmobilize(DataSerializer *seri, Immobilize *dst); static void ReadIQSkills(DataSerializer *seri, u8 *dst); @@ -59,7 +60,6 @@ static void ReadMuzzled(DataSerializer *seri, Muzzled *dst); static void ReadNonVolatile(DataSerializer *seri, NonVolatile *dst); static void ReadProtection(DataSerializer *seri, Protection *dst); static s16 ReadS16(DataSerializer *seri); -static s32 ReadS32(DataSerializer *seri); static void ReadSleep(DataSerializer *seri, Sleep *dst); static void ReadSpeedCounters(DataSerializer *seri, u8 *dst, u32 numCounters); static s32 ReadSpeedStage(DataSerializer *seri); @@ -95,6 +95,7 @@ static void WriteDungeonUnkE240(DataSerializer *seri, unkDungeonE240 *src); static void WriteDungeonUnkE260(DataSerializer *seri, unkDungeonE260 *src); static void WriteDungeonVisibility(DataSerializer *seri); static void WriteEyesightStatus(DataSerializer *seri, EyesightStatus *src); +static void WriteF24_8(DataSerializer *seri, s24_8 value); static void WriteHiddenPower(DataSerializer *seri, HiddenPower *src); static void WriteImmobilize(DataSerializer *seri, Immobilize *src); static void WriteIQSkills(DataSerializer *seri, u8 *src); @@ -113,7 +114,6 @@ static void WriteNonVolatile(DataSerializer *seri, NonVolatile *src); static void WriteProtection(DataSerializer *seri, Protection *src); static void WriteTilePos(DataSerializer *seri, Position *src); static void WriteS16(DataSerializer *seri, s16 value); -static void WriteS32(DataSerializer *seri, s32 value); static void WriteSleep(DataSerializer *seri, Sleep* src); static void WriteSpeedCounters(DataSerializer *seri, u8 *src, u32 numCounters); static void WriteSpeedStage(DataSerializer *seri, s32 value); @@ -307,10 +307,10 @@ static void WriteMonster(DataSerializer *seri, Entity *src) WriteS16(seri, info->hitChanceStages[0]); WriteS16(seri, info->hitChanceStages[1]); WriteS16(seri, info->flashFireBoost); - WriteS32(seri, info->offensiveMultipliers[0]); - WriteS32(seri, info->offensiveMultipliers[1]); - WriteS32(seri, info->defensiveMultipliers[0]); - WriteS32(seri, info->defensiveMultipliers[1]); + WriteF24_8(seri, info->offensiveMultipliers[0]); + WriteF24_8(seri, info->offensiveMultipliers[1]); + WriteF24_8(seri, info->defensiveMultipliers[0]); + WriteF24_8(seri, info->defensiveMultipliers[1]); WriteActionContainer(seri, &info->action); WriteType(seri, info->types[0]); WriteType(seri, info->types[1]); @@ -390,7 +390,7 @@ static void WriteMonster(DataSerializer *seri, Entity *src) WriteU8(seri, info->unk168); WriteU8(seri, info->turnsSinceWarpScarfActivation); WriteTilePos(seri, &info->targetPos); - WriteS32(seri, info->unk174); + WriteF24_8(seri, info->unk174); WriteU16(seri, info->abilityEffectFlags); WriteS16(seri, info->unk1F8); WriteS16(seri, info->mobileTurnTimer); @@ -990,10 +990,10 @@ static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index) entInfo.hitChanceStages[0] = ReadS16(seri); entInfo.hitChanceStages[1] = ReadS16(seri); entInfo.flashFireBoost = ReadS16(seri); - entInfo.offensiveMultipliers[0] = ReadS32(seri); - entInfo.offensiveMultipliers[1] = ReadS32(seri); - entInfo.defensiveMultipliers[0] = ReadS32(seri); - entInfo.defensiveMultipliers[1] = ReadS32(seri); + entInfo.offensiveMultipliers[0] = ReadF24_8(seri); + entInfo.offensiveMultipliers[1] = ReadF24_8(seri); + entInfo.defensiveMultipliers[0] = ReadF24_8(seri); + entInfo.defensiveMultipliers[1] = ReadF24_8(seri); ReadActionContainer(seri, &entInfo.action); entInfo.types[0] = ReadType(seri); entInfo.types[1] = ReadType(seri); @@ -1074,7 +1074,7 @@ static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index) entInfo.unk168 = ReadU8(seri); entInfo.turnsSinceWarpScarfActivation = ReadU8(seri); ReadTilePos(seri, &entInfo.targetPos); - entInfo.unk174 = ReadS32(seri); + entInfo.unk174 = ReadF24_8(seri); entInfo.abilityEffectFlags = ReadU16(seri); entInfo.unk1F8 = ReadS16(seri); entInfo.mobileTurnTimer = ReadS16(seri); @@ -1600,18 +1600,18 @@ static void WriteU32(DataSerializer *seri, u32 value) WriteBytes(seri, &uStack_8, 4); } -UNUSED static void sub_808308C(DataSerializer *seri, u32 value) +UNUSED static void WriteS32(DataSerializer *seri, s32 value) { - u32 uStack_8; + s32 uStack_8; uStack_8 = value; WriteBytes(seri, &uStack_8, 4); } -static void WriteS32(DataSerializer *seri, s32 value) +static void WriteF24_8(DataSerializer *seri, s24_8 value) { - s32 uStack_8; + s24_8 uStack_8; uStack_8 = value; @@ -1684,17 +1684,17 @@ static u32 ReadU32(DataSerializer *seri) return local_8; } -UNUSED static u32 sub_80831B4(DataSerializer *seri) +UNUSED static s32 ReadS32(DataSerializer *seri) { - u32 local_8; + s32 local_8; ReadBytes(seri, &local_8, 4); return local_8; } -static s32 ReadS32(DataSerializer *seri) +static s24_8 ReadF24_8(DataSerializer *seri) { - s32 local_8; + s24_8 local_8; ReadBytes(seri, &local_8, 4); return local_8; From 583b4df5449de92411383df9db3392a8aec7bb73 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Fri, 15 Nov 2024 21:36:36 -0500 Subject: [PATCH 36/48] Rename statuses and activePokemon --- asm/code_8040094.s | 2 +- asm/code_8069E0C.s | 16 +-- data/data_80F59C8.s | 48 +++---- include/charge_move.h | 2 +- include/code_8077274_1.h | 12 +- include/constants/status.h | 24 ++-- include/move_effects_target.h | 2 +- include/structs/dungeon_entity.h | 140 +++++++++---------- include/structs/str_dungeon.h | 2 +- src/code_803E724.c | 6 +- src/code_8041AD0.c | 52 +++---- src/code_804267C.c | 2 +- src/code_8045A00.c | 6 +- src/code_8048480.c | 16 +-- src/code_805D8C8.c | 2 +- src/code_805D8C8_1.c | 52 +++---- src/code_8069E0C.c | 8 +- src/code_806CD90.c | 80 +++++------ src/code_806E8B0.c | 8 +- src/code_8073CF0.c | 172 +++++++++++------------ src/code_8075708.c | 4 +- src/code_8077274_1.c | 232 +++++++++++++++---------------- src/code_8083288.c | 92 ++++++------ src/dungeon_action.c | 4 +- src/dungeon_ai.c | 14 +- src/dungeon_ai_attack.c | 34 ++--- src/dungeon_ai_item_weight.c | 24 ++-- src/dungeon_ai_items.c | 8 +- src/dungeon_ai_leader.c | 14 +- src/dungeon_ai_movement.c | 6 +- src/dungeon_ai_targeting.c | 20 +-- src/dungeon_capabilities.c | 70 +++++----- src/dungeon_engine.c | 4 +- src/dungeon_move.c | 90 ++++++------ src/dungeon_movement.c | 12 +- src/dungeon_pokemon_attributes.c | 8 +- src/dungeon_util.c | 4 +- src/dungeon_util_1.c | 4 +- src/dungeon_visibility.c | 12 +- src/move_actions.c | 40 +++--- src/move_checks.c | 86 ++++++------ src/move_effects_target.c | 202 +++++++++++++-------------- src/status.c | 154 ++++++++++---------- src/status_actions.c | 4 +- src/status_checks.c | 28 ++-- src/status_checks_1.c | 40 +++--- src/tile_types.c | 4 +- src/trap_1.c | 180 ++++++++++++------------ src/type_effectiveness.c | 4 +- 49 files changed, 1025 insertions(+), 1025 deletions(-) diff --git a/asm/code_8040094.s b/asm/code_8040094.s index 8a8f947bc..daab66dfd 100644 --- a/asm/code_8040094.s +++ b/asm/code_8040094.s @@ -2501,7 +2501,7 @@ _080414A0: _080414A4: adds r0, r4, 0 adds r1, r5, 0 - bl MoveMatchesChargingStatus + bl MoveMatchesBideClassStatus adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 diff --git a/asm/code_8069E0C.s b/asm/code_8069E0C.s index 0f955d488..7aa4695da 100644 --- a/asm/code_8069E0C.s +++ b/asm/code_8069E0C.s @@ -346,7 +346,7 @@ _0806A650: bne _0806A6D2 adds r0, r6, 0 adds r1, r6, 0 - bl SendNonVolatileEndMessage + bl EndBurnClassStatus b _0806A6D2 _0806A664: cmp r1, 0 @@ -1072,7 +1072,7 @@ sub_806ABAC: bne _0806ABD4 adds r0, r6, 0 adds r1, r4, 0 - bl SendNonVolatileEndMessage + bl EndBurnClassStatus _0806ABD4: adds r0, r4, 0 movs r1, 0x40 @@ -1087,7 +1087,7 @@ _0806ABD4: bne _0806ABF4 adds r0, r6, 0 adds r1, r4, 0 - bl SendVolatileEndMessage + bl EndCringeClassStatus _0806ABF4: adds r0, r4, 0 movs r1, 0x42 @@ -1102,7 +1102,7 @@ _0806ABF4: bne _0806AC14 adds r0, r6, 0 adds r1, r4, 0 - bl SendNonVolatileEndMessage + bl EndBurnClassStatus _0806AC14: adds r0, r4, 0 movs r1, 0x29 @@ -1117,7 +1117,7 @@ _0806AC14: bne _0806AC34 adds r0, r6, 0 adds r1, r4, 0 - bl SendVolatileEndMessage + bl EndCringeClassStatus _0806AC34: adds r0, r4, 0 movs r1, 0x36 @@ -1147,7 +1147,7 @@ _0806AC66: adds r1, r4, 0 movs r2, 0 movs r3, 0x1 - bl SendSleepEndMessage + bl EndSleepClassStatus _0806AC72: adds r0, r4, 0 movs r1, 0x41 @@ -1180,7 +1180,7 @@ _0806AC92: bhi _0806ACB8 adds r0, r6, 0 adds r1, r4, 0 - bl SendNonVolatileEndMessage + bl EndBurnClassStatus _0806ACB8: adds r0, r4, 0 movs r1, 0x25 @@ -1199,7 +1199,7 @@ _0806ACB8: bne _0806ACE0 adds r0, r6, 0 adds r1, r4, 0 - bl SendProtectionEndMessage + bl EndReflectClassStatus _0806ACE0: pop {r4-r6} pop {r0} diff --git a/data/data_80F59C8.s b/data/data_80F59C8.s index 99c6433b4..3d35898d4 100644 --- a/data/data_80F59C8.s +++ b/data/data_80F59C8.s @@ -308,8 +308,8 @@ gUnknown_80F6624: @ 80F6624 .byte 0xb9, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 .byte 0xbb, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 -.global gStatusSpriteMasks_SleepStatus -gStatusSpriteMasks_SleepStatus: @ 80F669C +.global gStatusSpriteMasks_SleepClassStatus +gStatusSpriteMasks_SleepClassStatus: @ 80F669C .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_SLEEP @ STATUS_SLEEP .4byte STATUS_SPRITE_SLEEPLESS @ STATUS_SLEEPLESS @@ -317,16 +317,16 @@ gStatusSpriteMasks_SleepStatus: @ 80F669C .4byte 0 @ STATUS_YAWNING .4byte STATUS_SPRITE_SLEEP @ STATUS_NAPPING -.global gStatusSpriteMasks_NonVolatileStatus -gStatusSpriteMasks_NonVolatileStatus: @ 80F66B4 +.global gStatusSpriteMasks_BurnClassStatus +gStatusSpriteMasks_BurnClassStatus: @ 80F66B4 .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_BURNED @ STATUS_BURN .4byte STATUS_SPRITE_POISONED @ STATUS_POISONED .4byte STATUS_SPRITE_BADLY_POISONED @ STATUS_BADLY_POISONED .4byte 0 @ STATUS_PARALYSIS -.global gStatusSpriteMasks_ImmobilizeStatus -gStatusSpriteMasks_ImmobilizeStatus: @ 80F66C8 +.global gStatusSpriteMasks_FrozenClassStatus +gStatusSpriteMasks_FrozenClassStatus: @ 80F66C8 .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_FROZEN @ STATUS_FROZEN .4byte 0 @ STATUS_SHADOW_HOLD @@ -336,8 +336,8 @@ gStatusSpriteMasks_ImmobilizeStatus: @ 80F66C8 .4byte 0 @ STATUS_PETRIFIED .4byte 0 @ STATUS_CONSTRICTION -.global gStatusSpriteMasks_VolatileStatus -gStatusSpriteMasks_VolatileStatus: @ 80F66E8 +.global gStatusSpriteMasks_CringeClassStatus +gStatusSpriteMasks_CringeClassStatus: @ 80F66E8 .4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_CRINGE .4byte STATUS_SPRITE_CONFUSED @ STATUS_CONFUSED @@ -347,8 +347,8 @@ gStatusSpriteMasks_VolatileStatus: @ 80F66E8 .4byte STATUS_SPRITE_ENCORE @ STATUS_ENCORE .4byte 0 @ STATUS_INFATUATED -.global gStatusSpriteMasks_ChargingStatus -gStatusSpriteMasks_ChargingStatus: @ 80F6708 +.global gStatusSpriteMasks_BideClassStatus +gStatusSpriteMasks_BideClassStatus: @ 80F6708 .4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_BIDE .4byte 0 @ STATUS_SOLARBEAM @@ -363,8 +363,8 @@ gStatusSpriteMasks_ChargingStatus: @ 80F6708 .4byte 0 @ STATUS_CHARGING .4byte 0 @ STATUS_ENRAGED -.global gStatusSpriteMasks_ProtectionStatus -gStatusSpriteMasks_ProtectionStatus: @ 80F673C +.global gStatusSpriteMasks_ReflectClassStatus +gStatusSpriteMasks_ReflectClassStatus: @ 80F673C .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_SHIELD_BLUE @ STATUS_REFLECT .4byte STATUS_SPRITE_SHIELD_RED @ STATUS_SAFEGUARD @@ -381,42 +381,42 @@ gStatusSpriteMasks_ProtectionStatus: @ 80F673C .4byte STATUS_SPRITE_SHIELD_GREEN @ STATUS_VITAL_THROW .4byte STATUS_SPRITE_SHIELD_BLUE @ STATUS_MIST -.global gStatusSpriteMasks_WaitingStatus -gStatusSpriteMasks_WaitingStatus: @ 80F6778 +.global gStatusSpriteMasks_CurseClassStatus +gStatusSpriteMasks_CurseClassStatus: @ 80F6778 .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_CURSED @ STATUS_CURSED .4byte 0 @ STATUS_DECOY .4byte STATUS_SPRITE_SNATCH @ STATUS_SNATCH -.global gStatusSpriteMasks_LinkedStatus -gStatusSpriteMasks_LinkedStatus: @ 80F6788 +.global gStatusSpriteMasks_LeechSeedClassStatus +gStatusSpriteMasks_LeechSeedClassStatus: @ 80F6788 .4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_LEECH_SEED .4byte 0 @ STATUS_DESTINY_BOND -.global gStatusSpriteMasks_MoveStatus -gStatusSpriteMasks_MoveStatus: @ 80F6794 +.global gStatusSpriteMasks_SureShotClassStatus +gStatusSpriteMasks_SureShotClassStatus: @ 80F6794 .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_SURE_SHOT @ STATUS_SURE_SHOT .4byte STATUS_SPRITE_WHIFFER @ STATUS_WHIFFER .4byte STATUS_SPRITE_SET_DAMAGE @ STATUS_SET_DAMAGE .4byte STATUS_SPRITE_FOCUS_ENERGY @ STATUS_FOCUS_ENERGY -.global gStatusSpriteMasks_ItemStatus -gStatusSpriteMasks_ItemStatus: @ 80F67A8 +.global gStatusSpriteMasks_LongTossClassStatus +gStatusSpriteMasks_LongTossClassStatus: @ 80F67A8 .4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_LONG_TOSS .4byte 0 @ STATUS_PIERCE -.global gStatusSpriteMasks_TransformStatus -gStatusSpriteMasks_TransformStatus: @ 80F67B4 +.global gStatusSpriteMasks_InvisibleClassStatus +gStatusSpriteMasks_InvisibleClassStatus: @ 80F67B4 .4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_INVISIBLE .4byte 0 @ STATUS_TRANSFORMED .4byte 0 @ STATUS_MOBILE -.global gStatusSpriteMasks_EyesightStatus -gStatusSpriteMasks_EyesightStatus: @ 80F67C4 +.global gStatusSpriteMasks_BlinkerClassStatus +gStatusSpriteMasks_BlinkerClassStatus: @ 80F67C4 .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_BLINKER @ STATUS_BLINKER .4byte STATUS_SPRITE_CROSS_EYED @ STATUS_CROSS_EYED diff --git a/include/charge_move.h b/include/charge_move.h index 0fd75d5db..56c9bb8e0 100644 --- a/include/charge_move.h +++ b/include/charge_move.h @@ -3,7 +3,7 @@ #include "structs/dungeon_entity.h" -bool8 MoveMatchesChargingStatus(Entity *pokemon, Move *move); +bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move); // checkCharge = Check for the move named Charge. bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge); diff --git a/include/code_8077274_1.h b/include/code_8077274_1.h index cc9712be4..92c1882ac 100644 --- a/include/code_8077274_1.h +++ b/include/code_8077274_1.h @@ -35,13 +35,13 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target); void VitalThrowStatusTarget(Entity * pokemon, Entity * target); void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4); void sub_807A0CC(Entity * pokemon, Entity * target); -void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4); -void SendNonVolatileEndMessage(Entity * pokemon, Entity * target); +void EndSleepClassStatus(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4); +void EndBurnClassStatus(Entity * pokemon, Entity * target); void EndFrozenClassStatus(Entity * pokemon, Entity *target); -void SendVolatileEndMessage(Entity * pokemon, Entity *target); -void SendProtectionEndMessage(Entity * pokemon, Entity *target); -void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus); -void SendLinkedEndMessage(Entity * pokemon, Entity * target); +void EndCringeClassStatus(Entity * pokemon, Entity *target); +void EndReflectClassStatus(Entity * pokemon, Entity *target); +void EndCurseClassStatus(Entity * pokemon, Entity * target, u8 curseClassStatus); +void EndLeechSeedClassStatus(Entity * pokemon, Entity * target); void SendMoveEndMessage(Entity * pokemon, Entity * target); void SendTransformEndMessage(Entity * pokemon, Entity *target); void SendEyesightEndMessage(Entity * pokemon,Entity * target); diff --git a/include/constants/status.h b/include/constants/status.h index 8fb8b3b7a..32ab62db7 100644 --- a/include/constants/status.h +++ b/include/constants/status.h @@ -1,7 +1,7 @@ #ifndef GUARD_CONSTANTS_STATUS_H #define GUARD_CONSTANTS_STATUS_H -// Sleep statuses +// Sleep class statuses #define STATUS_NONE 0 #define STATUS_SLEEP 1 #define STATUS_SLEEPLESS 2 @@ -9,13 +9,13 @@ #define STATUS_YAWNING 4 #define STATUS_NAPPING 5 -// Non-volatile statuses +// Burn class statuses #define STATUS_BURN 1 #define STATUS_POISONED 2 #define STATUS_BADLY_POISONED 3 #define STATUS_PARALYSIS 4 -// Immobilize statuses +// Frozen class statuses #define STATUS_FROZEN 1 #define STATUS_SHADOW_HOLD 2 #define STATUS_WRAP 3 @@ -24,7 +24,7 @@ #define STATUS_PETRIFIED 6 #define STATUS_CONSTRICTION 7 -// Volatile statuses +// Cringe class statuses #define STATUS_CRINGE 1 #define STATUS_CONFUSED 2 #define STATUS_PAUSED 3 @@ -33,7 +33,7 @@ #define STATUS_ENCORE 6 #define STATUS_INFATUATED 7 -// Charging statuses +// Bide class statuses #define STATUS_BIDE 1 #define STATUS_SOLARBEAM 2 #define STATUS_SKY_ATTACK 3 @@ -47,7 +47,7 @@ #define STATUS_CHARGING 11 #define STATUS_ENRAGED 12 -// Protection statuses +// ReflectClassStatus statuses #define STATUS_REFLECT 1 #define STATUS_SAFEGUARD 2 #define STATUS_LIGHT_SCREEN 3 @@ -63,31 +63,31 @@ #define STATUS_VITAL_THROW 13 #define STATUS_MIST 14 -// Waiting statuses +// Curse class statuses #define STATUS_CURSED 1 #define STATUS_DECOY 2 #define STATUS_SNATCH 3 -// Linked statuses +// Leech Seed class statuses #define STATUS_LEECH_SEED 1 #define STATUS_DESTINY_BOND 2 -// Move statuses +// Sure Shot class statuses #define STATUS_SURE_SHOT 1 #define STATUS_WHIFFER 2 #define STATUS_SET_DAMAGE 3 #define STATUS_FOCUS_ENERGY 4 -// Item statuses +// Long Toss class statuses #define STATUS_LONG_TOSS 1 #define STATUS_PIERCE 2 -// Transform statuses +// Invisible class statuses #define STATUS_INVISIBLE 1 #define STATUS_TRANSFORMED 2 #define STATUS_MOBILE 3 -// Eyesight statuses +// Blinker class statuses #define STATUS_BLINKER 1 #define STATUS_CROSS_EYED 2 #define STATUS_EYEDROPS 3 diff --git a/include/move_effects_target.h b/include/move_effects_target.h index 76e7b646d..6c12cbf88 100644 --- a/include/move_effects_target.h +++ b/include/move_effects_target.h @@ -3,7 +3,7 @@ #include "structs/dungeon_entity.h" -u8 sub_8075BF4(Entity * pokemon, s32 sleepTurns); +u8 sub_8075BF4(Entity * pokemon, s32 sleepClassStatusTurns); void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, bool8 displayMessage); bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMessage); void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns); diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 24bdda795..5a5dcb0c5 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -69,93 +69,93 @@ typedef struct AITarget } AITarget; -typedef struct Sleep +typedef struct SleepClassStatus { - /* 0x0 */ u8 sleep; - /* 0x1 */ u8 sleepTurns; -} Sleep; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; +} SleepClassStatus; -typedef struct NonVolatile +typedef struct BurnClassStatus { - /* 0x0 */ u8 nonVolatileStatus; - /* 0x1 */ u8 nonVolatileStatusTurns; - /* 0x2 */ u8 nonVolatileStatusDamageCountdown; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; + /* 0x2 */ u8 damageCountdown; /* 0x3 */ u8 unk4; -} NonVolatile; +} BurnClassStatus; -typedef struct Immobilize +typedef struct FrozenClassStatus { - /* 0x0 */ u8 immobilizeStatus; + /* 0x0 */ u8 status; /* 0x4 */ s32 unk4; - /* 0x8 */ u8 immobilizeStatusTurns; - /* 0x9 */ u8 immobilizeStatusDamageCountdown; -} Immobilize; + /* 0x8 */ u8 turns; + /* 0x9 */ u8 damageCountdown; +} FrozenClassStatus; -typedef struct Volatile +typedef struct CringeClassStatus { - /* 0x0 */ u8 volatileStatus; - /* 0x1 */ u8 volatileStatusTurns; -} Volatile; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; +} CringeClassStatus; -typedef struct Charging +typedef struct BideClassStatus { - /* 0x0 */ u8 chargingStatus; - /* 0x1 */ u8 chargingStatusTurns; - /* 0x2 */ u8 chargingStatusMoveIndex; // The position of the move in the PokĂ©mon's moveset that triggered the status. -} Charging; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; + /* 0x2 */ u8 moveSlot; // The position of the move in the PokĂ©mon's moveset that triggered the status. +} BideClassStatus; -typedef struct Protection +typedef struct ReflectClassStatus { - /* 0x0 */ u8 protectionStatus; - /* 0x1 */ u8 protectionStatusTurns; -} Protection; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; +} ReflectClassStatus; -typedef struct Waiting +typedef struct CurseClassStatus { - /* 0xC8 */ u8 waitingStatus; - /* 0xC9 */ bool8 decoyApplierNonTeamMemberFlag; // True if the PokĂ©mon is a decoy and a wild PokĂ©mon (i.e., not an allied PokĂ©mon). - u8 unkCA; - /* 0xCB */ u8 waitingStatusTurns; - /* 0xCC */ u8 curseDamageCountdown; -} Waiting; + /* 0x0 */ u8 status; + /* 0x1 */ bool8 applierNonTeamMemberFlag; // True if the PokĂ©mon is a decoy and a wild PokĂ©mon (i.e., not an allied PokĂ©mon). + u8 unk2; + /* 0x3 */ u8 turns; + /* 0x4 */ u8 damageCountdown; +} CurseClassStatus; -typedef struct Linked +typedef struct LeechSeedClassStatus { - /* 0xD0 */ u8 linkedStatus; - /* 0xD4 */ u32 unkD4; - /* 0xD8 */ u8 unkD8; - /* 0xD9 */ u8 linkedStatusTurns; - /* 0xDA */ u8 linkedStatusDamageCountdown; -} Linked; + /* 0x0 */ u8 status; + /* 0x4 */ u32 unkD4; + /* 0x8 */ u8 unkD8; + /* 0x9 */ u8 turns; + /* 0xA */ u8 damageCountdown; +} LeechSeedClassStatus; -typedef struct MoveStatus +typedef struct SureShotClassStatus { - /* 0xDC */ u8 moveStatus; - /* 0xDD */ u8 moveStatusTurns; -} MoveStatus; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; +} SureShotClassStatus; -typedef struct ItemStatus +typedef struct LongTossClassStatus { - /* 0xE0 */ u8 itemStatus; -} ItemStatus; + /* 0x0 */ u8 status; +} LongTossClassStatus; -typedef struct TransformStatus +typedef struct InvisibleClassStatus { - /* 0xE4 */ u8 transformStatus; - /* 0xE5 */ u8 transformStatusTurns; -} TransformStatus; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; +} InvisibleClassStatus; -typedef struct EyesightStatus +typedef struct BlinkerClassStatus { - /* 0xE8 */ u8 eyesightStatus; - /* 0xE9 */ u8 eyesightStatusTurns; -} EyesightStatus; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; +} BlinkerClassStatus; typedef struct Muzzled { - /* 0xEC */ bool8 muzzled; - /* 0xED */ u8 muzzledTurns; + /* 0x0 */ bool8 muzzled; + /* 0x1 */ u8 turns; } Muzzled; typedef struct Unk_Entity_x184 @@ -235,18 +235,18 @@ typedef struct EntityInfo u8 fillA5[0xA8 - 0xA5]; // Statuses are split into groups based on which ones can't overlap. // See status.h for which statuses are in each group. - /* 0xA8 */ Sleep sleep; - /* 0xAC */ NonVolatile nonVolatile; - /* 0xB0 */ Immobilize immobilize; - /* 0xBC */ Volatile volatileStatus; - /* 0xC0 */ Charging charging; - /* 0xC4 */ Protection protection; - /* 0xC8 */ Waiting waitingStruct; - /* 0xD0 */ Linked linked; - /* 0xDC */ MoveStatus moveStatus; - /* 0xE0 */ ItemStatus itemStatus; - /* 0xE4 */ TransformStatus transformStatus; - /* 0xE8 */ EyesightStatus eyesightStatus; + /* 0xA8 */ SleepClassStatus sleepClassStatus; + /* 0xAC */ BurnClassStatus burnClassStatus; + /* 0xB0 */ FrozenClassStatus frozenClassStatus; + /* 0xBC */ CringeClassStatus cringeClassStatus; + /* 0xC0 */ BideClassStatus bideClassStatus; + /* 0xC4 */ ReflectClassStatus reflectClassStatus; + /* 0xC8 */ CurseClassStatus curseClassStatus; + /* 0xD0 */ LeechSeedClassStatus linked; + /* 0xDC */ SureShotClassStatus sureShotClassStatus; + /* 0xE0 */ LongTossClassStatus longTossClassStatus; + /* 0xE4 */ InvisibleClassStatus invisibleClassStatus; + /* 0xE8 */ BlinkerClassStatus blinkerClassStatus; /* 0xEC */ Muzzled muzzled; /* 0xF0 */ bool8 powerEars; /* 0xF1 */ bool8 scanning; diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index c663aebc2..0551dddee 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -383,7 +383,7 @@ typedef struct Dungeon u8 fill1357A[0x1357C - 0x1357A]; /* 0x1357C */ Entity *teamPokemon[MAX_TEAM_MEMBERS]; /* 0x1358C */ Entity *wildPokemon[DUNGEON_MAX_WILD_POKEMON]; - /* 0x135CC */ Entity *activeMonsterPtrs[DUNGEON_MAX_POKEMON]; // Contains both team and wild PokĂ©mon + /* 0x135CC */ Entity *activePokemon[DUNGEON_MAX_POKEMON]; // Contains both team and wild PokĂ©mon /* 0x1361C */ Entity *items[DUNGEON_MAX_ITEMS]; /* 0x1371C */ Entity *traps[DUNGEON_MAX_TRAPS]; /* 0x1381C */ Entity teamPokemonEntities[MAX_TEAM_MEMBERS]; diff --git a/src/code_803E724.c b/src/code_803E724.c index 4845e54c4..af89005c5 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -993,7 +993,7 @@ void sub_803F580(u8 a0) unk18214 = strPtr->unk18214; if (unk18214 == 0) { u32 unkVar; - if (info->eyesightStatus.eyesightStatus == STATUS_BLINKER) { + if (info->blinkerClassStatus.status == STATUS_BLINKER) { strPtr->blinded = 1; unkVar = 0xE; } @@ -1016,7 +1016,7 @@ void sub_803F580(u8 a0) } before = strPtr->hallucinating; - if (info->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED) { + if (info->blinkerClassStatus.status == STATUS_CROSS_EYED) { strPtr->hallucinating = 1; } else { @@ -1066,7 +1066,7 @@ void sub_803F580(u8 a0) if (strPtr->cameraPos.x != strPtr->cameraPosMirror.x || strPtr->cameraPos.y != strPtr->cameraPosMirror.y) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activeMonsterPtrs[i]; + Entity *mon = gDungeon->activePokemon[i]; if (EntityExists(mon)) { sub_80402AC(mon->pos.x, mon->pos.y); } diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index 38142228b..b11ef6530 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -15,18 +15,18 @@ #include "structs/dungeon_entity.h" #include "structs/str_dungeon.h" -extern u32 gStatusSpriteMasks_SleepStatus[]; -extern u32 gStatusSpriteMasks_NonVolatileStatus[]; -extern u32 gStatusSpriteMasks_ImmobilizeStatus[]; -extern u32 gStatusSpriteMasks_VolatileStatus[]; -extern u32 gStatusSpriteMasks_ChargingStatus[]; -extern u32 gStatusSpriteMasks_ProtectionStatus[]; -extern u32 gStatusSpriteMasks_WaitingStatus[]; -extern u32 gStatusSpriteMasks_LinkedStatus[]; -extern u32 gStatusSpriteMasks_MoveStatus[]; -extern u32 gStatusSpriteMasks_ItemStatus[]; -extern u32 gStatusSpriteMasks_TransformStatus[]; -extern u32 gStatusSpriteMasks_EyesightStatus[]; +extern u32 gStatusSpriteMasks_SleepClassStatus[]; +extern u32 gStatusSpriteMasks_BurnClassStatus[]; +extern u32 gStatusSpriteMasks_FrozenClassStatus[]; +extern u32 gStatusSpriteMasks_CringeClassStatus[]; +extern u32 gStatusSpriteMasks_BideClassStatus[]; +extern u32 gStatusSpriteMasks_ReflectClassStatus[]; +extern u32 gStatusSpriteMasks_CurseClassStatus[]; +extern u32 gStatusSpriteMasks_LeechSeedClassStatus[]; +extern u32 gStatusSpriteMasks_SureShotClassStatus[]; +extern u32 gStatusSpriteMasks_LongTossClassStatus[]; +extern u32 gStatusSpriteMasks_InvisibleClassStatus[]; +extern u32 gStatusSpriteMasks_BlinkerClassStatus[]; extern u32 gStatusSpriteMasks_MuzzledStatus[]; @@ -155,7 +155,7 @@ void sub_8041888(u8 param_1) EntityInfo *entityInfo; for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if(EntityExists(entity)) { entityInfo = GetEntInfo(entity); @@ -183,26 +183,26 @@ void EntityUpdateStatusSprites(Entity *entity) if (entityInfo->id == 0xb9) { // NOTE: clean this up sometime - temp = entityInfo->sleep.sleepTurns; + temp = entityInfo->sleepClassStatus.turns; flag = 0x7f; temp ^= flag; flag = (temp) != 0; } if (flag) { - spriteStatus = gStatusSpriteMasks_SleepStatus[entityInfo->sleep.sleep]; + spriteStatus = gStatusSpriteMasks_SleepClassStatus[entityInfo->sleepClassStatus.status]; } spriteStatus = spriteStatus | - gStatusSpriteMasks_NonVolatileStatus[entityInfo->nonVolatile.nonVolatileStatus] | - gStatusSpriteMasks_ImmobilizeStatus[entityInfo->immobilize.immobilizeStatus] | - gStatusSpriteMasks_VolatileStatus[entityInfo->volatileStatus.volatileStatus] | - gStatusSpriteMasks_ChargingStatus[entityInfo->charging.chargingStatus] | - gStatusSpriteMasks_ProtectionStatus[entityInfo->protection.protectionStatus] | - gStatusSpriteMasks_WaitingStatus[entityInfo->waitingStruct.waitingStatus] | - gStatusSpriteMasks_LinkedStatus[entityInfo->linked.linkedStatus] | - gStatusSpriteMasks_MoveStatus[entityInfo->moveStatus.moveStatus] | - gStatusSpriteMasks_ItemStatus[entityInfo->itemStatus.itemStatus] | - gStatusSpriteMasks_TransformStatus[entityInfo->transformStatus.transformStatus] | - gStatusSpriteMasks_EyesightStatus[entityInfo->eyesightStatus.eyesightStatus] | + gStatusSpriteMasks_BurnClassStatus[entityInfo->burnClassStatus.status] | + gStatusSpriteMasks_FrozenClassStatus[entityInfo->frozenClassStatus.status] | + gStatusSpriteMasks_CringeClassStatus[entityInfo->cringeClassStatus.status] | + gStatusSpriteMasks_BideClassStatus[entityInfo->bideClassStatus.status] | + gStatusSpriteMasks_ReflectClassStatus[entityInfo->reflectClassStatus.status] | + gStatusSpriteMasks_CurseClassStatus[entityInfo->curseClassStatus.status] | + gStatusSpriteMasks_LeechSeedClassStatus[entityInfo->linked.status] | + gStatusSpriteMasks_SureShotClassStatus[entityInfo->sureShotClassStatus.status] | + gStatusSpriteMasks_LongTossClassStatus[entityInfo->longTossClassStatus.status] | + gStatusSpriteMasks_InvisibleClassStatus[entityInfo->invisibleClassStatus.status] | + gStatusSpriteMasks_BlinkerClassStatus[entityInfo->blinkerClassStatus.status] | gStatusSpriteMasks_MuzzledStatus[entityInfo->muzzled.muzzled]; if (entityInfo->grudge) { diff --git a/src/code_804267C.c b/src/code_804267C.c index 845a20266..b37cc31dd 100644 --- a/src/code_804267C.c +++ b/src/code_804267C.c @@ -104,7 +104,7 @@ void sub_80427AC(void) s32 i; for (i = 0; i < 20; i++) { - entity = gDungeon->activeMonsterPtrs[i]; + entity = gDungeon->activePokemon[i]; if (EntityExists(entity)) { enInfo = GetEntInfo(entity); if (enInfo->unkF3) { diff --git a/src/code_8045A00.c b/src/code_8045A00.c index 943820e42..d6ef76284 100644 --- a/src/code_8045A00.c +++ b/src/code_8045A00.c @@ -32,7 +32,7 @@ void sub_8045ACC(void) { entity = gDungeon->teamPokemon[index]; if (EntityExists(entity)) { - gDungeon->activeMonsterPtrs[pokeCount] = entity; + gDungeon->activePokemon[pokeCount] = entity; pokeCount++; } } @@ -41,12 +41,12 @@ void sub_8045ACC(void) { entity = gDungeon->wildPokemon[index]; if (EntityExists(entity)) { - gDungeon->activeMonsterPtrs[pokeCount] = entity; + gDungeon->activePokemon[pokeCount] = entity; pokeCount++; } } for (; pokeCount < DUNGEON_MAX_POKEMON; pokeCount++) { - gDungeon->activeMonsterPtrs[pokeCount] = NULL; + gDungeon->activePokemon[pokeCount] = NULL; } } diff --git a/src/code_8048480.c b/src/code_8048480.c index 2759d2cde..38a0191c9 100644 --- a/src/code_8048480.c +++ b/src/code_8048480.c @@ -537,8 +537,8 @@ void EyedropSeedItemAction(Entity *pokemon, Entity *target) void CheriBerryItemAction(Entity *pokemon, Entity *target) { - if(GetEntInfo(target)->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) - SendNonVolatileEndMessage(pokemon, target); + if(GetEntInfo(target)->burnClassStatus.status == STATUS_PARALYSIS) + EndBurnClassStatus(pokemon, target); else // Pointer to "But nothing happened!" TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F89F4); @@ -547,8 +547,8 @@ void CheriBerryItemAction(Entity *pokemon, Entity *target) void PechaBerryItemAction(Entity *pokemon, Entity *target) { EntityInfo *entInfo = GetEntInfo(target); - if(entInfo->nonVolatile.nonVolatileStatus == STATUS_POISONED || entInfo->nonVolatile.nonVolatileStatus == STATUS_BADLY_POISONED) - SendNonVolatileEndMessage(pokemon, target); + if(entInfo->burnClassStatus.status == STATUS_POISONED || entInfo->burnClassStatus.status == STATUS_BADLY_POISONED) + EndBurnClassStatus(pokemon, target); else // Pointer to "But nothing happened!" TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F89F4); @@ -592,8 +592,8 @@ void DoomSeedItemAction(Entity *pokemon, Entity *target) void RawstBerryItemAction(Entity *pokemon, Entity *target) { - if(GetEntInfo(target)->nonVolatile.nonVolatileStatus == STATUS_BURN) - SendNonVolatileEndMessage(pokemon, target); + if(GetEntInfo(target)->burnClassStatus.status == STATUS_BURN) + EndBurnClassStatus(pokemon, target); else { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); @@ -694,7 +694,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) else { uVar1 = gUnknown_80F4FA4; } - if (entityInfo_1->immobilize.immobilizeStatus == STATUS_FROZEN) { + if (entityInfo_1->frozenClassStatus.status == STATUS_FROZEN) { EndFrozenClassStatus(pokemon, target); } sub_806F370(pokemon, target, uVar1, 1, auStack28, 0, 0x216, 0, 0, 0); @@ -717,7 +717,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) else { uVar1 = gUnknown_80F4FA6; } - if (entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) { + if (entityInfo->frozenClassStatus.status == STATUS_FROZEN) { EndFrozenClassStatus(pokemon, entity); } sub_806F370(pokemon, entity, uVar1, 1, auStack28, 0, 0x216, 0, 0, 0); diff --git a/src/code_805D8C8.c b/src/code_805D8C8.c index 771fc0e69..de3122197 100644 --- a/src/code_805D8C8.c +++ b/src/code_805D8C8.c @@ -20,7 +20,7 @@ void sub_8068768(void) s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->activeMonsterPtrs[i]; + entity = gDungeon->activePokemon[i]; if (entity != NULL && EntityExists(entity)) LoadPokemonSprite(GetEntInfo(entity)->apparentID, FALSE); diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index 0c6b6cb95..07224cc2b 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -503,19 +503,19 @@ void DungeonHandlePlayerInput(void) if (sub_805EC4C(leader, 1)) break; - if (leaderInfo->immobilize.immobilizeStatus == STATUS_SHADOW_HOLD) { + if (leaderInfo->frozenClassStatus.status == STATUS_SHADOW_HOLD) { immobilizedMsg = gUnknown_80F8A84, canMoveFlags |= 1; } - else if (leaderInfo->immobilize.immobilizeStatus == STATUS_CONSTRICTION) { + else if (leaderInfo->frozenClassStatus.status == STATUS_CONSTRICTION) { immobilizedMsg = gUnknown_80F8A6C, canMoveFlags |= 1; } - else if (leaderInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { + else if (leaderInfo->frozenClassStatus.status == STATUS_INGRAIN) { immobilizedMsg = gUnknown_80F8AB0, canMoveFlags |= 1; } - else if (leaderInfo->immobilize.immobilizeStatus == STATUS_WRAP) { + else if (leaderInfo->frozenClassStatus.status == STATUS_WRAP) { immobilizedMsg = gUnknown_80F8ADC, canMoveFlags |= 1; } - else if (leaderInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { + else if (leaderInfo->frozenClassStatus.status == STATUS_WRAPPED) { immobilizedMsg = gUnknown_80F8B0C, canMoveFlags |= 1; } @@ -537,7 +537,7 @@ void DungeonHandlePlayerInput(void) else { sub_8044C50(2); if ((gRealInputs.held & B_BUTTON || bPress) && FixedPointToInt(leaderInfo->belly) != 0) { - if (GetEntInfo(leader)->volatileStatus.volatileStatus != STATUS_CONFUSED) { + if (GetEntInfo(leader)->cringeClassStatus.status != STATUS_CONFUSED) { gDungeon->unk66C = 1; } leaderInfo->action.unk4[0].actionUseIndex = 0; @@ -1350,7 +1350,7 @@ void sub_805E738(Entity *a0) Tile *tile; s32 i, j; EntityInfo *entityInfo = GetEntInfo(a0); - if (entityInfo->eyesightStatus.eyesightStatus != 1 && entityInfo->eyesightStatus.eyesightStatus != 2) { + if (entityInfo->blinkerClassStatus.status != 1 && entityInfo->blinkerClassStatus.status != 2) { // What??? for (i = 0; i < 1; i++) { bool8 r9 = FALSE; @@ -1549,25 +1549,25 @@ bool8 sub_805EC4C(Entity *a0, u8 a1) return FALSE; } - if (entityInfo->immobilize.immobilizeStatus == STATUS_SHADOW_HOLD) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_CONSTRICTION) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_SHADOW_HOLD) return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_FROZEN) return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_CONSTRICTION) return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_INGRAIN) return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_WRAP) return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_WRAPPED) return FALSE; - if (tileMonsterInfo->immobilize.immobilizeStatus == STATUS_SHADOW_HOLD) return FALSE; - if (tileMonsterInfo->immobilize.immobilizeStatus == STATUS_FROZEN) return FALSE; - if (tileMonsterInfo->immobilize.immobilizeStatus == STATUS_CONSTRICTION) return FALSE; - if (tileMonsterInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) return FALSE; - if (tileMonsterInfo->immobilize.immobilizeStatus == STATUS_WRAP) return FALSE; - if (tileMonsterInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) return FALSE; + if (tileMonsterInfo->frozenClassStatus.status == STATUS_SHADOW_HOLD) return FALSE; + if (tileMonsterInfo->frozenClassStatus.status == STATUS_FROZEN) return FALSE; + if (tileMonsterInfo->frozenClassStatus.status == STATUS_CONSTRICTION) return FALSE; + if (tileMonsterInfo->frozenClassStatus.status == STATUS_INGRAIN) return FALSE; + if (tileMonsterInfo->frozenClassStatus.status == STATUS_WRAP) return FALSE; + if (tileMonsterInfo->frozenClassStatus.status == STATUS_WRAPPED) return FALSE; - if (entityInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) return FALSE; - if (tileMonsterInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) return FALSE; + if (entityInfo->cringeClassStatus.status == STATUS_CONFUSED) return FALSE; + if (tileMonsterInfo->cringeClassStatus.status == STATUS_CONFUSED) return FALSE; - if (tileMonsterInfo->sleep.sleep != STATUS_NONE && tileMonsterInfo->sleep.sleep != STATUS_SLEEPLESS && tileMonsterInfo->sleep.sleep != STATUS_YAWNING) return FALSE; - if (entityInfo->sleep.sleep != STATUS_NONE && entityInfo->sleep.sleep != STATUS_SLEEPLESS && entityInfo->sleep.sleep != STATUS_YAWNING) return FALSE; + if (tileMonsterInfo->sleepClassStatus.status != STATUS_NONE && tileMonsterInfo->sleepClassStatus.status != STATUS_SLEEPLESS && tileMonsterInfo->sleepClassStatus.status != STATUS_YAWNING) return FALSE; + if (entityInfo->sleepClassStatus.status != STATUS_NONE && entityInfo->sleepClassStatus.status != STATUS_SLEEPLESS && entityInfo->sleepClassStatus.status != STATUS_YAWNING) return FALSE; if (IsChargingAnyTwoTurnMove(tileMonster, FALSE)) return FALSE; if (!sub_8070F80(a0, entityInfo->action.direction)) return FALSE; @@ -1604,7 +1604,7 @@ void sub_805EE30(void) return; tile = GetTileAtEntitySafe(leader); - if (IQSkillIsEnabled(leader, IQ_SUPER_MOBILE) && GetEntInfo(leader)->transformStatus.transformStatus != STATUS_MOBILE && !HasHeldItem(leader, ITEM_MOBILE_SCARF)) + if (IQSkillIsEnabled(leader, IQ_SUPER_MOBILE) && GetEntInfo(leader)->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(leader, ITEM_MOBILE_SCARF)) sub_804AE84(&leader->pos); if (tile->terrainType & TERRAIN_TYPE_STAIRS) gDungeon->unk1 = 1; @@ -1679,11 +1679,11 @@ void sub_805EFB4(Entity *a0, bool8 a1) { s32 i; EntityInfo *leaderInfo = GetLeaderInfo(); - if (a1 && leaderInfo->volatileStatus.volatileStatus == STATUS_COWERING) { + if (a1 && leaderInfo->cringeClassStatus.status == STATUS_COWERING) { leaderInfo->action.direction += 4; leaderInfo->action.direction &= 7; } - else if (leaderInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) { + else if (leaderInfo->cringeClassStatus.status == STATUS_CONFUSED) { s32 rnd = DungeonRandInt(8); for (i = 0; i < 8; i++) { if (a1 || CanMoveInDirection(a0, rnd)) { diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 7abdbc1dd..55c0721a0 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -74,7 +74,7 @@ void TriggerWeatherAbilities(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { if (HasAbility(entity, ABILITY_DRIZZLE)) { gDungeon->weather.naturalWeather[WEATHER_RAIN] = 1; @@ -208,7 +208,7 @@ void sub_806A120(Entity * pokemon, Entity * target, Move* move) EntityInfo *entityInfo; if ((((EntityExists(pokemon)) && (EntityExists(target))) && (pokemon != target)) - && (entityInfo = GetEntInfo(target), entityInfo->protection.protectionStatus == STATUS_CONVERSION2)) { + && (entityInfo = GetEntInfo(target), entityInfo->reflectClassStatus.status == STATUS_CONVERSION2)) { moveType = GetMoveTypeForMonster(pokemon, move); uVar2_u32 = sub_8092364(moveType); if (uVar2_u32 != TYPE_NONE) { @@ -301,8 +301,8 @@ void sub_806A338(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; - if (EntityExists(entity) && (GetEntInfo(entity)->waitingStruct.waitingStatus == STATUS_SNATCH)) + entity = gDungeon->activePokemon[index]; + if (EntityExists(entity) && (GetEntInfo(entity)->curseClassStatus.status == STATUS_SNATCH)) { gDungeon->snatchPokemon = entity; ASM_MATCH_TRICK(entity); diff --git a/src/code_806CD90.c b/src/code_806CD90.c index 965c30a08..5d645ef0f 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -49,7 +49,7 @@ void sub_806CC10(void) s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->activeMonsterPtrs[i]; + entity = gDungeon->activePokemon[i]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); @@ -69,7 +69,7 @@ void sub_806CC70(void) Entity *entity; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->activeMonsterPtrs[i]; + entity = gDungeon->activePokemon[i]; if (EntityExists(entity)) sub_806CCB4(entity, sub_806CEBC(entity)); @@ -95,7 +95,7 @@ void sub_806CCB4(Entity *entity, u8 a1) entity->axObj.unk47 = 0; sVar1 = entity->axObj.unk40_maybeAnimTimer; - if (info->waitingStruct.waitingStatus != STATUS_DECOY && !flag) + if (info->curseClassStatus.status != STATUS_DECOY && !flag) AxResInitFile(&entity->axObj.axdata, entity->axObj.spriteFile, entity->axObj.unk42_animId1, entity->axObj.unk44_direction1, sVar1, @@ -116,7 +116,7 @@ void sub_806CD90(void) Entity *entity; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->activeMonsterPtrs[i]; + entity = gDungeon->activePokemon[i]; if (EntityExists(entity)) sub_806CCB4(entity, sub_806CEBC(entity)); @@ -176,19 +176,19 @@ void sub_806CE94(Entity *entity, u32 newDir) u8 sub_806CEBC(Entity *entity) { - u8 sleep; + u8 sleepClassStatus; EntityInfo *entityInfo; entityInfo = GetEntInfo(entity); - sleep = entityInfo->sleep.sleep; + sleepClassStatus = entityInfo->sleepClassStatus.status; - if (sleep == STATUS_SLEEP || sleep == STATUS_NAPPING || sleep == STATUS_NIGHTMARE) { - if (entityInfo->apparentID != MONSTER_SUDOWOODO || entityInfo->sleep.sleepTurns != 0x7F) + if (sleepClassStatus == STATUS_SLEEP || sleepClassStatus == STATUS_NAPPING || sleepClassStatus == STATUS_NIGHTMARE) { + if (entityInfo->apparentID != MONSTER_SUDOWOODO || entityInfo->sleepClassStatus.turns != 0x7F) return 5; else return 7; } - if (entityInfo->charging.chargingStatus == STATUS_BIDE) + if (entityInfo->bideClassStatus.status == STATUS_BIDE) return 11; return 7; } @@ -227,7 +227,7 @@ void sub_806CF60(void) s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->activeMonsterPtrs[i]; + entity = gDungeon->activePokemon[i]; if (EntityExists(entity)) sub_806CF98(entity); @@ -342,19 +342,19 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * return; r9 = arg8; - if (CheckVariousStatuses(target) || GetEntInfo(target)->charging.chargingStatus != 0) + if (CheckVariousStatuses(target) || GetEntInfo(target)->bideClassStatus.status != 0) r9 = FALSE; if (r9 && abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1 && attacker != target && IsTypePhysical(dmgStruct->type) - && GetEntInfo(target)->protection.protectionStatus == STATUS_VITAL_THROW) + && GetEntInfo(target)->reflectClassStatus.status == STATUS_VITAL_THROW) { sub_8042730(target, attacker); sub_807F43C(target, attacker); } - if (GetEntInfo(target)->charging.chargingStatus == STATUS_ENRAGED) { + if (GetEntInfo(target)->bideClassStatus.status == STATUS_ENRAGED) { RaiseAttackStageTarget(attacker, target, gUnknown_8106A4C, 1); } @@ -366,15 +366,15 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * && abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1) { bool32 isPhysical = IsTypePhysical(dmgStruct->type); - if (GetEntInfo(target)->protection.protectionStatus == STATUS_COUNTER && isPhysical) { + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_COUNTER && isPhysical) { sub_8041B18(target); returnDmg += 4; } - if (GetEntInfo(target)->protection.protectionStatus == STATUS_MINI_COUNTER && isPhysical) { + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_MINI_COUNTER && isPhysical) { sub_8041B18(target); returnDmg += 1; } - if (GetEntInfo(target)->protection.protectionStatus == STATUS_MIRROR_COAT && !isPhysical) { + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_MIRROR_COAT && !isPhysical) { sub_8041B90(target); returnDmg += 4; } @@ -472,13 +472,13 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * // Destiny Bond if (r9) { EntityInfo *targetInfo = GetEntInfo(target); - if (targetInfo->linked.linkedStatus == STATUS_DESTINY_BOND) { - Entity *destBondTarget = gDungeon->activeMonsterPtrs[targetInfo->linked.unkD8]; + if (targetInfo->linked.status == STATUS_DESTINY_BOND) { + Entity *destBondTarget = gDungeon->activePokemon[targetInfo->linked.unkD8]; if (destBondTarget == NULL) { - targetInfo->linked.linkedStatus = 0; + targetInfo->linked.status = 0; } else if (GetEntInfo(destBondTarget)->unk98 != targetInfo->linked.unkD4) { - targetInfo->linked.linkedStatus = 0; + targetInfo->linked.status = 0; } else { sub_8041D00(destBondTarget, target); @@ -513,7 +513,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc TrySendImmobilizeSleepEndMsg(attacker, target); SetShopkeeperAggression(attacker, target); if (GetEntityType(attacker) == ENTITY_MONSTER - && GetEntInfo(attacker)->moveStatus.moveStatus == STATUS_SET_DAMAGE + && GetEntInfo(attacker)->sureShotClassStatus.status == STATUS_SET_DAMAGE && dmgStruct->unkE == 0) { dmgStruct->dmg = gUnknown_80F4F8C; @@ -526,7 +526,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc dmgStruct->tookNoDamage = TRUE; return FALSE; } - if (targetData->immobilize.immobilizeStatus == STATUS_FROZEN) { + if (targetData->frozenClassStatus.status == STATUS_FROZEN) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9600); sub_8042238(attacker, target); @@ -534,8 +534,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc return FALSE; } - if ((targetData->sleep.sleep == STATUS_SLEEP || targetData->sleep.sleep == STATUS_NAPPING || targetData->sleep.sleep == STATUS_NIGHTMARE) - && targetData->sleep.sleepTurns == 0x7F) + if ((targetData->sleepClassStatus.status == STATUS_SLEEP || targetData->sleepClassStatus.status == STATUS_NAPPING || targetData->sleepClassStatus.status == STATUS_NIGHTMARE) + && targetData->sleepClassStatus.turns == 0x7F) { WakeUpPokemon(target); } @@ -639,7 +639,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc else { unkBool = FALSE; } - if (targetData->eyesightStatus.eyesightStatus == STATUS_BLINKER || targetData->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED) + if (targetData->blinkerClassStatus.status == STATUS_BLINKER || targetData->blinkerClassStatus.status == STATUS_CROSS_EYED) unkBool = FALSE; if (unkBool) { EntityInfo *info = GetEntInfo(target); @@ -659,7 +659,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc else targetData->HP = 0; - if (targetData->protection.protectionStatus == STATUS_ENDURING) { + if (targetData->reflectClassStatus.status == STATUS_ENDURING) { if (targetData->HP == 0) { targetData->HP = 1; TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_8100548); @@ -694,7 +694,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } // 0 HP - if (targetData->transformStatus.transformStatus == STATUS_TRANSFORMED) { + if (targetData->invisibleClassStatus.status == STATUS_TRANSFORMED) { SendTransformEndMessage(attacker, target); } @@ -758,7 +758,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } } - if (targetData->immobilize.immobilizeStatus == STATUS_WRAP || targetData->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (targetData->frozenClassStatus.status == STATUS_WRAP || targetData->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(targetData->unk9C); } @@ -779,11 +779,11 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc gDungeon->itemHoldersIdentified = 0; } ZeroOutItem(&targetData->heldItem); - if (targetData->waitingStruct.waitingStatus == STATUS_SNATCH) { - SendWaitingEndMessage(attacker, target, STATUS_SNATCH); + if (targetData->curseClassStatus.status == STATUS_SNATCH) { + EndCurseClassStatus(attacker, target, STATUS_SNATCH); } - else if (targetData->waitingStruct.waitingStatus == STATUS_DECOY) { - SendWaitingEndMessage(attacker, target, STATUS_DECOY); + else if (targetData->curseClassStatus.status == STATUS_DECOY) { + EndCurseClassStatus(attacker, target, STATUS_DECOY); } sub_8078084(target); sub_806BFC0(targetData, 0); @@ -836,11 +836,11 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc gDungeon->itemHoldersIdentified = 0; } ZeroOutItem(heldItem); - if (targetData->waitingStruct.waitingStatus == STATUS_SNATCH) { - SendWaitingEndMessage(attacker, target, STATUS_SNATCH); + if (targetData->curseClassStatus.status == STATUS_SNATCH) { + EndCurseClassStatus(attacker, target, STATUS_SNATCH); } - else if (targetData->waitingStruct.waitingStatus == STATUS_DECOY) { - SendWaitingEndMessage(attacker, target, STATUS_DECOY); + else if (targetData->curseClassStatus.status == STATUS_DECOY) { + EndCurseClassStatus(attacker, target, STATUS_DECOY); } sub_8078084(target); sub_806BFC0(targetData, 0); @@ -890,11 +890,11 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc gDungeon->unk679 = 0; gDungeon->itemHoldersIdentified = 0; } - if (targetData->waitingStruct.waitingStatus == STATUS_SNATCH) { - SendWaitingEndMessage(attacker, target, STATUS_SNATCH); + if (targetData->curseClassStatus.status == STATUS_SNATCH) { + EndCurseClassStatus(attacker, target, STATUS_SNATCH); } - else if (targetData->waitingStruct.waitingStatus == STATUS_DECOY) { - SendWaitingEndMessage(attacker, target, STATUS_DECOY); + else if (targetData->curseClassStatus.status == STATUS_DECOY) { + EndCurseClassStatus(attacker, target, STATUS_DECOY); } sub_8078084(target); sub_806BFC0(targetData, 0); diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index c045dc576..06217bd81 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -214,7 +214,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 atkStat = statCalc / 256; defStatStage = targetInfo->defensiveStages[splitIndex]; - if (splitIndex == 0 && targetInfo->charging.chargingStatus == STATUS_SKULL_BASH) { + if (splitIndex == 0 && targetInfo->bideClassStatus.status == STATUS_SKULL_BASH) { gDungeon->unk134.unk17A = 1; defStatStage++; } @@ -332,12 +332,12 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 } } if (arg_10) { - if (splitIndex == 0 && targetInfo->protection.protectionStatus == STATUS_REFLECT) { + if (splitIndex == 0 && targetInfo->reflectClassStatus.status == STATUS_REFLECT) { sub_8041B74(target); F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F1C); gDungeon->unk134.unk166 = 1; } - if (splitIndex == 1 && targetInfo->protection.protectionStatus == STATUS_LIGHT_SCREEN) { + if (splitIndex == 1 && targetInfo->reflectClassStatus.status == STATUS_LIGHT_SCREEN) { sub_8041B5C(target); F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F1C); gDungeon->unk134.unk167 = 1; @@ -355,7 +355,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 critOdds = critChance; } - if (attackerInfo->moveStatus.moveStatus == STATUS_FOCUS_ENERGY) { + if (attackerInfo->sureShotClassStatus.status == STATUS_FOCUS_ENERGY) { critOdds = 999; gDungeon->unk134.unk168 = 1; } diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 2ca957fd4..784f15a6d 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -422,19 +422,19 @@ void sub_8074094(Entity *entity) } // Statuses - if (entityInfo->sleep.sleep == STATUS_YAWNING) { + if (entityInfo->sleepClassStatus.status == STATUS_YAWNING) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; sub_80420B8(entity); } - if (entityInfo->nonVolatile.nonVolatileStatus == STATUS_BURN) { - if (entityInfo->nonVolatile.nonVolatileStatusDamageCountdown == 0 || --entityInfo->nonVolatile.nonVolatileStatusDamageCountdown == 0) { + if (entityInfo->burnClassStatus.status == STATUS_BURN) { + if (entityInfo->burnClassStatus.damageCountdown == 0 || --entityInfo->burnClassStatus.damageCountdown == 0) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = gUnknown_80F4F32; + entityInfo->burnClassStatus.damageCountdown = gUnknown_80F4F32; TrySendImmobilizeSleepEndMsg(entity, entity); DealDamageToEntity(entity, gUnknown_80F4F70, 1, 0x208); } @@ -442,24 +442,24 @@ void sub_8074094(Entity *entity) return; } - if (entityInfo->nonVolatile.nonVolatileStatus == STATUS_POISONED) { - if (entityInfo->nonVolatile.nonVolatileStatusDamageCountdown == 0 || --entityInfo->nonVolatile.nonVolatileStatusDamageCountdown == 0) { + if (entityInfo->burnClassStatus.status == STATUS_POISONED) { + if (entityInfo->burnClassStatus.damageCountdown == 0 || --entityInfo->burnClassStatus.damageCountdown == 0) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = gUnknown_80F4F34; + entityInfo->burnClassStatus.damageCountdown = gUnknown_80F4F34; TrySendImmobilizeSleepEndMsg(entity, entity); DealDamageToEntity(entity, gUnknown_80F4F72, 3, 0x20A); } if (!EntityExists(entity) || sub_8044B28()) return; } - else if (entityInfo->nonVolatile.nonVolatileStatus == STATUS_BADLY_POISONED) { - if (entityInfo->nonVolatile.nonVolatileStatusDamageCountdown == 0 || --entityInfo->nonVolatile.nonVolatileStatusDamageCountdown == 0) { - s32 turns = entityInfo->nonVolatile.unk4; - if (entityInfo->nonVolatile.unk4 < 29) - entityInfo->nonVolatile.unk4++; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = gUnknown_80F4F36; + else if (entityInfo->burnClassStatus.status == STATUS_BADLY_POISONED) { + if (entityInfo->burnClassStatus.damageCountdown == 0 || --entityInfo->burnClassStatus.damageCountdown == 0) { + s32 turns = entityInfo->burnClassStatus.unk4; + if (entityInfo->burnClassStatus.unk4 < 29) + entityInfo->burnClassStatus.unk4++; + entityInfo->burnClassStatus.damageCountdown = gUnknown_80F4F36; if (turns >= 29) turns = 29; @@ -474,47 +474,47 @@ void sub_8074094(Entity *entity) return; } - if (entityInfo->immobilize.immobilizeStatus == STATUS_CONSTRICTION) { - if (entityInfo->immobilize.immobilizeStatusDamageCountdown == 0 || --entityInfo->immobilize.immobilizeStatusDamageCountdown == 0) { + if (entityInfo->frozenClassStatus.status == STATUS_CONSTRICTION) { + if (entityInfo->frozenClassStatus.damageCountdown == 0 || --entityInfo->frozenClassStatus.damageCountdown == 0) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - entityInfo->immobilize.immobilizeStatusDamageCountdown = gUnknown_80F4F38; + entityInfo->frozenClassStatus.damageCountdown = gUnknown_80F4F38; TrySendImmobilizeSleepEndMsg(entity, entity); - sub_8041C4C(entity, entityInfo->immobilize.unk4); + sub_8041C4C(entity, entityInfo->frozenClassStatus.unk4); DealDamageToEntity(entity, gUnknown_80F4F74, 2, 0x209); } if (!EntityExists(entity) || sub_8044B28()) return; } - else if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { - if (entityInfo->immobilize.immobilizeStatusDamageCountdown == 0 || --entityInfo->immobilize.immobilizeStatusDamageCountdown == 0) { + else if (entityInfo->frozenClassStatus.status == STATUS_WRAPPED) { + if (entityInfo->frozenClassStatus.damageCountdown == 0 || --entityInfo->frozenClassStatus.damageCountdown == 0) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - entityInfo->immobilize.immobilizeStatusDamageCountdown = gUnknown_80F4F3A; + entityInfo->frozenClassStatus.damageCountdown = gUnknown_80F4F3A; TrySendImmobilizeSleepEndMsg(entity, entity); DealDamageToEntity(entity, gUnknown_80F4F76, 5, 0x20B); } if (!EntityExists(entity) || sub_8044B28()) return; } - else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { - if (entityInfo->immobilize.immobilizeStatusDamageCountdown == 0 || --entityInfo->immobilize.immobilizeStatusDamageCountdown == 0) { + else if (entityInfo->frozenClassStatus.status == STATUS_INGRAIN) { + if (entityInfo->frozenClassStatus.damageCountdown == 0 || --entityInfo->frozenClassStatus.damageCountdown == 0) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - entityInfo->immobilize.immobilizeStatusDamageCountdown = gUnknown_80F4F3C; + entityInfo->frozenClassStatus.damageCountdown = gUnknown_80F4F3C; HealTargetHP(entity, entity, gUnknown_80F4FB2, 0, TRUE); } } - if (entityInfo->waitingStruct.waitingStatus == STATUS_CURSED) { - if (entityInfo->waitingStruct.curseDamageCountdown == 0 || --entityInfo->waitingStruct.curseDamageCountdown == 0) { + if (entityInfo->curseClassStatus.status == STATUS_CURSED) { + if (entityInfo->curseClassStatus.damageCountdown == 0 || --entityInfo->curseClassStatus.damageCountdown == 0) { s32 dmg = entityInfo->maxHPStat / 4; if (dmg == 0) dmg = 1; - entityInfo->waitingStruct.curseDamageCountdown = gUnknown_80F4F3E; + entityInfo->curseClassStatus.damageCountdown = gUnknown_80F4F3E; UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; @@ -526,19 +526,19 @@ void sub_8074094(Entity *entity) return; } - if (entityInfo->linked.linkedStatus == STATUS_LEECH_SEED) { - if (entityInfo->linked.linkedStatusDamageCountdown == 0 || --entityInfo->linked.linkedStatusDamageCountdown == 0) { + if (entityInfo->linked.status == STATUS_LEECH_SEED) { + if (entityInfo->linked.damageCountdown == 0 || --entityInfo->linked.damageCountdown == 0) { s32 hp = gUnknown_80F4FB4; - Entity *target = gDungeon->activeMonsterPtrs[entityInfo->linked.unkD8]; + Entity *target = gDungeon->activePokemon[entityInfo->linked.unkD8]; - entityInfo->linked.linkedStatusDamageCountdown = gUnknown_80F4F40; + entityInfo->linked.damageCountdown = gUnknown_80F4F40; if (target == NULL) { - entityInfo->linked.linkedStatus = 0; + entityInfo->linked.status = 0; } else { EntityInfo *targetInfo = GetEntInfo(target); if (targetInfo->unk98 != entityInfo->linked.unkD4) { - entityInfo->linked.linkedStatus = 0; + entityInfo->linked.status = 0; } else { bool8 dmgUser = HasAbility(entity, ABILITY_LIQUID_OOZE); @@ -547,7 +547,7 @@ void sub_8074094(Entity *entity) if (!EntityExists(entity) || !EntityExists(target) || sub_8044B28()) return; - if (entityInfo->immobilize.immobilizeStatus != STATUS_FROZEN) { + if (entityInfo->frozenClassStatus.status != STATUS_FROZEN) { TrySendImmobilizeSleepEndMsg(entity, entity); DealDamageToEntity(entity, hp, 9, 0x20D); if (dmgUser) { @@ -574,7 +574,7 @@ void sub_8074094(Entity *entity) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], entity, 0); LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FEB30); TrySendImmobilizeSleepEndMsg(entity, entity); - if (entityInfo->protection.protectionStatus == STATUS_PROTECT) { + if (entityInfo->reflectClassStatus.status == STATUS_PROTECT) { LogMessageByIdWithPopupCheckUser(entity, gPtrProtectSavedItMessage); } else { @@ -585,10 +585,10 @@ void sub_8074094(Entity *entity) } } - if (entityInfo->charging.chargingStatus == STATUS_BIDE) { - sub_80838EC(&entityInfo->charging.chargingStatusTurns); - if (entityInfo->charging.chargingStatusTurns == 0) { - entityInfo->charging.chargingStatus = 0; + if (entityInfo->bideClassStatus.status == STATUS_BIDE) { + sub_80838EC(&entityInfo->bideClassStatus.turns); + if (entityInfo->bideClassStatus.turns == 0) { + entityInfo->bideClassStatus.status = 0; if (!CheckVariousStatuses2(entity, FALSE) && !CannotAttack(entity, FALSE) && !CheckVariousStatuses(entity)) { Move bideMove; @@ -606,10 +606,10 @@ void sub_8074094(Entity *entity) if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->charging.chargingStatus == STATUS_ENRAGED) { - sub_80838EC(&entityInfo->charging.chargingStatusTurns); - if (entityInfo->charging.chargingStatusTurns == 0) { - entityInfo->charging.chargingStatus = 0; + if (entityInfo->bideClassStatus.status == STATUS_ENRAGED) { + sub_80838EC(&entityInfo->bideClassStatus.turns); + if (entityInfo->bideClassStatus.turns == 0) { + entityInfo->bideClassStatus.status = 0; entityInfo->unk14A = 0; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FABD8); @@ -635,7 +635,7 @@ void TickStatusHeal(Entity *entity) entityInfo = GetEntInfo(entity); // HP heal - if (entityInfo->unk146 == 0 && entityInfo->nonVolatile.nonVolatileStatus != STATUS_POISONED && entityInfo->nonVolatile.nonVolatileStatus != STATUS_BADLY_POISONED) { + if (entityInfo->unk146 == 0 && entityInfo->burnClassStatus.status != STATUS_POISONED && entityInfo->burnClassStatus.status != STATUS_BADLY_POISONED) { s32 r4 = 0; if (!entityInfo->isNotTeamMember) @@ -644,7 +644,7 @@ void TickStatusHeal(Entity *entity) if (r4 != 0) { if (HasHeldItem(entity, ITEM_HEAL_RIBBON)) r4 += gUnknown_80F4FC4; - if (entityInfo->protection.protectionStatus == STATUS_WISH) + if (entityInfo->reflectClassStatus.status == STATUS_WISH) r4 += gUnknown_80F4FC0; if (HasAbility(entity, ABILITY_RAIN_DISH) && GetApparentWeather(entity) == WEATHER_RAIN) r4 += gUnknown_80F4FC2; @@ -665,90 +665,90 @@ void TickStatusHeal(Entity *entity) } } - if (entityInfo->sleep.sleep != 0) { - sub_80838EC(&entityInfo->sleep.sleepTurns); - if (entityInfo->sleep.sleepTurns == 0) { - SendSleepEndMessage(entity, entity, TRUE, TRUE); + if (entityInfo->sleepClassStatus.status != 0) { + sub_80838EC(&entityInfo->sleepClassStatus.turns); + if (entityInfo->sleepClassStatus.turns == 0) { + EndSleepClassStatus(entity, entity, TRUE, TRUE); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->nonVolatile.nonVolatileStatus != 0) { - sub_80838EC(&entityInfo->nonVolatile.nonVolatileStatusTurns); - if (entityInfo->nonVolatile.nonVolatileStatusTurns == 0) { - SendNonVolatileEndMessage(entity, entity); + if (entityInfo->burnClassStatus.status != 0) { + sub_80838EC(&entityInfo->burnClassStatus.turns); + if (entityInfo->burnClassStatus.turns == 0) { + EndBurnClassStatus(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->immobilize.immobilizeStatus != 0) { - sub_80838EC(&entityInfo->immobilize.immobilizeStatusTurns); - if (entityInfo->immobilize.immobilizeStatusTurns == 0) { + if (entityInfo->frozenClassStatus.status != 0) { + sub_80838EC(&entityInfo->frozenClassStatus.turns); + if (entityInfo->frozenClassStatus.turns == 0) { EndFrozenClassStatus(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->volatileStatus.volatileStatus != 0) { - sub_80838EC(&entityInfo->volatileStatus.volatileStatusTurns); - if (entityInfo->volatileStatus.volatileStatusTurns == 0) { - SendVolatileEndMessage(entity, entity); + if (entityInfo->cringeClassStatus.status != 0) { + sub_80838EC(&entityInfo->cringeClassStatus.turns); + if (entityInfo->cringeClassStatus.turns == 0) { + EndCringeClassStatus(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->protection.protectionStatus != 0) { - sub_80838EC(&entityInfo->protection.protectionStatusTurns); - if (entityInfo->protection.protectionStatusTurns == 0) { - SendProtectionEndMessage(entity, entity); + if (entityInfo->reflectClassStatus.status != 0) { + sub_80838EC(&entityInfo->reflectClassStatus.turns); + if (entityInfo->reflectClassStatus.turns == 0) { + EndReflectClassStatus(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->waitingStruct.waitingStatus != 0) { - sub_80838EC(&entityInfo->waitingStruct.waitingStatusTurns); - if (entityInfo->waitingStruct.waitingStatusTurns == 0) { - SendWaitingEndMessage(entity, entity, 0); + if (entityInfo->curseClassStatus.status != 0) { + sub_80838EC(&entityInfo->curseClassStatus.turns); + if (entityInfo->curseClassStatus.turns == 0) { + EndCurseClassStatus(entity, entity, 0); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->linked.linkedStatus != 0) { - sub_80838EC(&entityInfo->linked.linkedStatusTurns); - if (entityInfo->linked.linkedStatusTurns == 0) { - SendLinkedEndMessage(entity, entity); + if (entityInfo->linked.status != 0) { + sub_80838EC(&entityInfo->linked.turns); + if (entityInfo->linked.turns == 0) { + EndLeechSeedClassStatus(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->moveStatus.moveStatus != 0) { - sub_80838EC(&entityInfo->moveStatus.moveStatusTurns); - if (entityInfo->moveStatus.moveStatusTurns == 0) { + if (entityInfo->sureShotClassStatus.status != 0) { + sub_80838EC(&entityInfo->sureShotClassStatus.turns); + if (entityInfo->sureShotClassStatus.turns == 0) { SendMoveEndMessage(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->transformStatus.transformStatus != 0) { - sub_80838EC(&entityInfo->transformStatus.transformStatusTurns); - if (entityInfo->transformStatus.transformStatusTurns == 0) { + if (entityInfo->invisibleClassStatus.status != 0) { + sub_80838EC(&entityInfo->invisibleClassStatus.turns); + if (entityInfo->invisibleClassStatus.turns == 0) { SendTransformEndMessage(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->eyesightStatus.eyesightStatus != 0) { - sub_80838EC(&entityInfo->eyesightStatus.eyesightStatusTurns); - if (entityInfo->eyesightStatus.eyesightStatusTurns == 0) { + if (entityInfo->blinkerClassStatus.status != 0) { + sub_80838EC(&entityInfo->blinkerClassStatus.turns); + if (entityInfo->blinkerClassStatus.turns == 0) { SendEyesightEndMessage(entity, entity); } } @@ -756,8 +756,8 @@ void TickStatusHeal(Entity *entity) return; if (entityInfo->muzzled.muzzled != 0) { - sub_80838EC(&entityInfo->muzzled.muzzledTurns); - if (entityInfo->muzzled.muzzledTurns == 0) { + sub_80838EC(&entityInfo->muzzled.turns); + if (entityInfo->muzzled.turns == 0) { SendMuzzledEndMessage(entity, entity); } } @@ -893,7 +893,7 @@ bool8 UseAttack(Entity *a0) gUnknown_202F378 = 1; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activeMonsterPtrs[i]; + Entity *mon = gDungeon->activePokemon[i]; if (EntityExists(mon)) { EntityInfo *monInfo = GetEntInfo(mon); if (monInfo->numMoveTiles == 0) { @@ -935,7 +935,7 @@ bool8 UseAttack(Entity *a0) for (loop = 0; loop < 24 / gUnknown_202F378; loop++) { sub_803E46C(7); for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activeMonsterPtrs[i]; + Entity *mon = gDungeon->activePokemon[i]; if (EntityExists(mon)) { EntityInfo *monInfo = GetEntInfo(mon); Unk_Entity_x184 *strPtr = &monInfo->unk184[monInfo->notMoving]; @@ -963,7 +963,7 @@ bool8 UseAttack(Entity *a0) } for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activeMonsterPtrs[i]; + Entity *mon = gDungeon->activePokemon[i]; if (EntityExists(mon)) { EntityInfo *monInfo = GetEntInfo(mon); monInfo->numMoveTiles = 0; @@ -979,7 +979,7 @@ bool8 UseAttack(Entity *a0) for (loop = 0; loop < DUNGEON_MAX_POKEMON; loop++) { Position monPosBefore; EntityInfo *monInfo; - Entity *mon = gDungeon->activeMonsterPtrs[loop]; + Entity *mon = gDungeon->activePokemon[loop]; if (!EntityExists(mon)) continue; diff --git a/src/code_8075708.c b/src/code_8075708.c index b1aa63c29..1ac3a42d5 100644 --- a/src/code_8075708.c +++ b/src/code_8075708.c @@ -30,7 +30,7 @@ void sub_8075680(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if ((EntityExists(entity)) && (info = GetEntInfo(entity), !info->isTeamLeader)) { targetPos = &(info->targetPos); @@ -67,7 +67,7 @@ void sub_8075708(Entity *entity) return; } tile = GetTileAtEntitySafe(entity); - if (((IQSkillIsEnabled(entity, IQ_SUPER_MOBILE)) && (info->transformStatus.transformStatus != STATUS_MOBILE)) && + if (((IQSkillIsEnabled(entity, IQ_SUPER_MOBILE)) && (info->invisibleClassStatus.status != STATUS_MOBILE)) && (!HasHeldItem(entity, ITEM_MOBILE_SCARF))) { sub_804AE84(&entity->pos); } diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index 16538c997..4533c5b5f 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -219,7 +219,7 @@ void MuzzleTarget(Entity *pokemon, Entity *target) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->muzzled.muzzled != TRUE) { entityInfo->muzzled.muzzled = TRUE; - entityInfo->muzzled.muzzledTurns = CalculateStatusTurns(target,gUnknown_80F4F1C, TRUE) + 1; + entityInfo->muzzled.turns = CalculateStatusTurns(target,gUnknown_80F4F1C, TRUE) + 1; nullsub_86(target); TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF68); } @@ -247,7 +247,7 @@ void TransformStatusTarget(Entity * pokemon, Entity * target) entityInfo = GetEntInfo(target); - if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) + if (entityInfo->invisibleClassStatus.status == STATUS_TRANSFORMED) TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF04); else { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); @@ -275,8 +275,8 @@ void TransformStatusTarget(Entity * pokemon, Entity * target) else { entityInfo->apparentID = apparentID; target->axObj.spriteFile = sprite; - entityInfo->transformStatus.transformStatus = STATUS_TRANSFORMED; - entityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EFC, TRUE) + 1; + entityInfo->invisibleClassStatus.status = STATUS_TRANSFORMED; + entityInfo->invisibleClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4EFC, TRUE) + 1; sub_806CF98(target); nullsub_87(target); sub_806CCB4(target, sub_806CEBC(target)); @@ -296,13 +296,13 @@ void MobileStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) { + if (entityInfo->invisibleClassStatus.status == STATUS_TRANSFORMED) { SendTransformEndMessage(pokemon,target); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->transformStatus.transformStatus != STATUS_MOBILE) { - entityInfo->transformStatus.transformStatus = STATUS_MOBILE; - entityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F04, FALSE) + 1; + if (entityInfo->invisibleClassStatus.status != STATUS_MOBILE) { + entityInfo->invisibleClassStatus.status = STATUS_MOBILE; + entityInfo->invisibleClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4F04, FALSE) + 1; nullsub_88(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBF28); } @@ -385,9 +385,9 @@ void BlindTarget(Entity *pokemon, Entity *target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->eyesightStatus.eyesightStatus != STATUS_BLINKER) { - entityInfo->eyesightStatus.eyesightStatus = STATUS_BLINKER; - entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F08, TRUE) + 1; + if (entityInfo->blinkerClassStatus.status != STATUS_BLINKER) { + entityInfo->blinkerClassStatus.status = STATUS_BLINKER; + entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4F08, TRUE) + 1; sub_8041E0C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7F4); sub_803E46C(0x31); @@ -412,11 +412,11 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->eyesightStatus.eyesightStatus != STATUS_CROSS_EYED) { + if (entityInfo->blinkerClassStatus.status != STATUS_CROSS_EYED) { sub_8041E1C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB834); - entityInfo->eyesightStatus.eyesightStatus = STATUS_CROSS_EYED; - entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F0C, TRUE) + 1; + entityInfo->blinkerClassStatus.status = STATUS_CROSS_EYED; + entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4F0C, TRUE) + 1; sub_803F580(0x1); sub_8049ED4(); sub_8040A84(); @@ -438,9 +438,9 @@ void RestoreVisionTarget(Entity *pokemon, Entity *target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->eyesightStatus.eyesightStatus != STATUS_EYEDROPS) { - entityInfo->eyesightStatus.eyesightStatus = STATUS_EYEDROPS; - entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F10, FALSE) + 1; + if (entityInfo->blinkerClassStatus.status != STATUS_EYEDROPS) { + entityInfo->blinkerClassStatus.status = STATUS_EYEDROPS; + entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4F10, FALSE) + 1; sub_8041E3C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB880); sub_803E46C(0x31); @@ -623,8 +623,8 @@ void LongTossStatusTarget(Entity * pokemon, Entity * target) entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); - if (entityInfo->itemStatus.itemStatus != STATUS_LONG_TOSS) { - entityInfo->itemStatus.itemStatus = STATUS_LONG_TOSS; + if (entityInfo->longTossClassStatus.status != STATUS_LONG_TOSS) { + entityInfo->longTossClassStatus.status = STATUS_LONG_TOSS; sub_8041EA4(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD20C); } @@ -640,8 +640,8 @@ void PierceStatusTarget(Entity * pokemon, Entity * target) entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); - if (entityInfo->itemStatus.itemStatus != STATUS_PIERCE) { - entityInfo->itemStatus.itemStatus = STATUS_PIERCE; + if (entityInfo->longTossClassStatus.status != STATUS_PIERCE) { + entityInfo->longTossClassStatus.status = STATUS_PIERCE; sub_8041EB4(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD254); } @@ -664,18 +664,18 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if ((entityInfo->charging.chargingStatus == newStatus) && (newStatus == STATUS_ENRAGED)) { + if ((entityInfo->bideClassStatus.status == newStatus) && (newStatus == STATUS_ENRAGED)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC074); } else { - entityInfo->charging.chargingStatus = newStatus; + entityInfo->bideClassStatus.status = newStatus; for(index = 0; index < MAX_MON_MOVES; index++) { movePtr = &entityInfo->moves.moves[index]; if(movePtr == move) { - entityInfo->charging.chargingStatusMoveIndex = index; + entityInfo->bideClassStatus.moveSlot = index; break; } } @@ -690,11 +690,11 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * entityInfo->unkFF = 2; } if (newStatus == STATUS_BIDE) { - entityInfo->charging.chargingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E9C, FALSE) + 1; + entityInfo->bideClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E9C, FALSE) + 1; entityInfo->unkA0 = 0; } if (newStatus == STATUS_ENRAGED) { - entityInfo->charging.chargingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EA0, FALSE) + 1; + entityInfo->bideClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4EA0, FALSE) + 1; } sub_8041BD0(target,uVar5); TryDisplayDungeonLoggableMessage3(pokemon,target,message); @@ -723,8 +723,8 @@ void sub_8079764(Entity * pokemon) if (EntityExists(pokemon)) { entityInfo = GetEntInfo(pokemon); - if ((entityInfo->charging.chargingStatus != STATUS_BIDE) && (entityInfo->charging.chargingStatus != STATUS_ENRAGED)) { - entityInfo->charging.chargingStatus = STATUS_NONE; + if ((entityInfo->bideClassStatus.status != STATUS_BIDE) && (entityInfo->bideClassStatus.status != STATUS_ENRAGED)) { + entityInfo->bideClassStatus.status = STATUS_NONE; entityInfo->unk14A = 0; entityInfo->unkFF = 0; } @@ -739,15 +739,15 @@ void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus == newStatus) { + if (entityInfo->reflectClassStatus.status == newStatus) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB10C); } else { nullsub_57(target); - if ((entityInfo->protection.protectionStatus != STATUS_COUNTER) && (entityInfo->protection.protectionStatus != STATUS_MINI_COUNTER)) { - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E98, FALSE) + 1; + if ((entityInfo->reflectClassStatus.status != STATUS_COUNTER) && (entityInfo->reflectClassStatus.status != STATUS_MINI_COUNTER)) { + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E98, FALSE) + 1; } - entityInfo->protection.protectionStatus = newStatus; + entityInfo->reflectClassStatus.status = newStatus; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB0E0); EntityUpdateStatusSprites(target); } @@ -761,9 +761,9 @@ void SafeguardStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_SAFEGUARD) { - entityInfo->protection.protectionStatus = STATUS_SAFEGUARD; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E88, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_SAFEGUARD) { + entityInfo->reflectClassStatus.status = STATUS_SAFEGUARD; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E88, FALSE) + 1; nullsub_58(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB048); } @@ -781,9 +781,9 @@ void MistStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_MIST) { - entityInfo->protection.protectionStatus = STATUS_MIST; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E8C, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_MIST) { + entityInfo->reflectClassStatus.status = STATUS_MIST; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E8C, FALSE) + 1; nullsub_59(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB09C); } @@ -801,9 +801,9 @@ void WishStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_WISH) { - entityInfo->protection.protectionStatus = STATUS_WISH; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EB4, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_WISH) { + entityInfo->reflectClassStatus.status = STATUS_WISH; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4EB4, FALSE) + 1; sub_8041B34(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE1C); } @@ -821,9 +821,9 @@ void MagicCoatStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_MAGIC_COAT) { - entityInfo->protection.protectionStatus = STATUS_MAGIC_COAT; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E90, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_MAGIC_COAT) { + entityInfo->reflectClassStatus.status = STATUS_MAGIC_COAT; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E90, FALSE) + 1; nullsub_60(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAF5C); } @@ -841,9 +841,9 @@ void LightScreenStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_LIGHT_SCREEN) { - entityInfo->protection.protectionStatus = STATUS_LIGHT_SCREEN; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E84, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_LIGHT_SCREEN) { + entityInfo->reflectClassStatus.status = STATUS_LIGHT_SCREEN; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E84, FALSE) + 1; nullsub_61(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB130); } @@ -861,9 +861,9 @@ void ReflectStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_REFLECT) { - entityInfo->protection.protectionStatus = STATUS_REFLECT; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E80, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_REFLECT) { + entityInfo->reflectClassStatus.status = STATUS_REFLECT; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E80, FALSE) + 1; nullsub_62(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB17C); } @@ -881,9 +881,9 @@ void ProtectStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { nullsub_63(target); entityInfo = GetEntInfo(target); - if (entityInfo->protection.protectionStatus != STATUS_PROTECT) { - entityInfo->protection.protectionStatus = STATUS_PROTECT; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4ED4, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_PROTECT) { + entityInfo->reflectClassStatus.status = STATUS_PROTECT; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4ED4, FALSE) + 1; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9B0); } @@ -902,9 +902,9 @@ void MirrorCoatStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_MIRROR_COAT) { - entityInfo->protection.protectionStatus = STATUS_MIRROR_COAT; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EE8, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_MIRROR_COAT) { + entityInfo->reflectClassStatus.status = STATUS_MIRROR_COAT; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4EE8, FALSE) + 1; nullsub_64(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBAC0); } @@ -922,9 +922,9 @@ void EndureStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_ENDURING) { - entityInfo->protection.protectionStatus = STATUS_ENDURING; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EF8, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_ENDURING) { + entityInfo->reflectClassStatus.status = STATUS_ENDURING; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4EF8, FALSE) + 1; nullsub_65(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBBF0); } @@ -942,9 +942,9 @@ void MirrorMoveStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_MIRROR_MOVE) { - entityInfo->protection.protectionStatus = STATUS_MIRROR_MOVE; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F18, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_MIRROR_MOVE) { + entityInfo->reflectClassStatus.status = STATUS_MIRROR_MOVE; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4F18, FALSE) + 1; nullsub_66(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBC38); } @@ -967,9 +967,9 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target) else { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_CONVERSION2) { - entityInfo->protection.protectionStatus = STATUS_CONVERSION2; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F20, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_CONVERSION2) { + entityInfo->reflectClassStatus.status = STATUS_CONVERSION2; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4F20, FALSE) + 1; nullsub_67(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBC7C); } @@ -988,9 +988,9 @@ void VitalThrowStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_VITAL_THROW) { - entityInfo->protection.protectionStatus = STATUS_VITAL_THROW; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F24, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_VITAL_THROW) { + entityInfo->reflectClassStatus.status = STATUS_VITAL_THROW; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4F24, FALSE) + 1; nullsub_68(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBCC8); } @@ -1066,15 +1066,15 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4) entityInfo = GetEntInfo(target); if (HasNegativeStatus(target)) { bVar8 = TRUE; - SendSleepEndMessage(pokemon,target,0,0); + EndSleepClassStatus(pokemon,target,0,0); if (!EntityExists(target)) { return; } - SendNonVolatileEndMessage(pokemon,target); + EndBurnClassStatus(pokemon,target); EndFrozenClassStatus(pokemon,target); - SendVolatileEndMessage(pokemon,target); - SendWaitingEndMessage(pokemon,target,0); - SendLinkedEndMessage(pokemon,target); + EndCringeClassStatus(pokemon,target); + EndCurseClassStatus(pokemon,target,0); + EndLeechSeedClassStatus(pokemon,target); SendMoveEndMessage(pokemon,target); SendEyesightEndMessage(pokemon,target); SendMuzzledEndMessage(pokemon,target); @@ -1147,7 +1147,7 @@ void sub_807A0CC(Entity * pokemon, Entity * target) }; } -void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4) +void EndSleepClassStatus(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4) { EntityInfo *entityInfo; bool8 isAsleep; @@ -1158,7 +1158,7 @@ void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->sleep.sleep) { + switch(entityInfo->sleepClassStatus.status) { case STATUS_NONE: case 6: break; @@ -1180,26 +1180,26 @@ void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 isAsleep = TRUE; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA710); HealTargetHP(pokemon,target,gUnknown_80F4F7A, 0, FALSE); - entityInfo->sleep.sleep = 0; + entityInfo->sleepClassStatus.status = 0; sub_8079F20(pokemon,target,1,1); break; case STATUS_YAWNING: if (param_3) { - entityInfo->sleep.sleep = STATUS_NONE; + entityInfo->sleepClassStatus.status = STATUS_NONE; sub_8075C58(pokemon,target,CalculateStatusTurns(target, gUnknown_80F4F2C, TRUE) + 1, TRUE); return; } TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA734); break; } - entityInfo->sleep.sleep = STATUS_NONE; + entityInfo->sleepClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); if (isAsleep) { sub_806CE68(target,8); } } -void SendNonVolatileEndMessage(Entity * pokemon, Entity * target) +void EndBurnClassStatus(Entity * pokemon, Entity * target) { EntityInfo *entityInfo; @@ -1208,7 +1208,7 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->nonVolatile.nonVolatileStatus) { + switch(entityInfo->burnClassStatus.status) { case STATUS_NONE: case 5: break; @@ -1224,7 +1224,7 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target) break; } - entityInfo->nonVolatile.nonVolatileStatus = STATUS_NONE; + entityInfo->burnClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); } @@ -1239,7 +1239,7 @@ void EndFrozenClassStatus(Entity * pokemon, Entity *target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->immobilize.immobilizeStatus) { + switch(entityInfo->frozenClassStatus.status) { case STATUS_NONE: case 8: break; @@ -1263,14 +1263,14 @@ void EndFrozenClassStatus(Entity * pokemon, Entity *target) TryDisplayDungeonLoggableMessage3(pokemon,target, *gPtrMonNoLongerPetrifiedMessage); break; } - entityInfo->immobilize.immobilizeStatus = STATUS_NONE; + entityInfo->frozenClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); if (isFrozen) { sub_8042A74(target); } } -void SendVolatileEndMessage(Entity * pokemon, Entity *target) +void EndCringeClassStatus(Entity * pokemon, Entity *target) { EntityInfo *entityInfo; @@ -1279,7 +1279,7 @@ void SendVolatileEndMessage(Entity * pokemon, Entity *target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->volatileStatus.volatileStatus) { + switch(entityInfo->cringeClassStatus.status) { case STATUS_NONE: case 8: break; @@ -1305,12 +1305,12 @@ void SendVolatileEndMessage(Entity * pokemon, Entity *target) TryDisplayDungeonLoggableMessage3(pokemon,target, *gPtrMonNoLongerCringingMessage); break; } - entityInfo->volatileStatus.volatileStatus = STATUS_NONE; + entityInfo->cringeClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); CalcSpeedStage(target); } -void SendProtectionEndMessage(Entity * pokemon, Entity *target) +void EndReflectClassStatus(Entity * pokemon, Entity *target) { EntityInfo *entityInfo; @@ -1319,7 +1319,7 @@ void SendProtectionEndMessage(Entity * pokemon, Entity *target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->protection.protectionStatus) { + switch(entityInfo->reflectClassStatus.status) { case STATUS_NONE: case 0xF: break; @@ -1364,11 +1364,11 @@ void SendProtectionEndMessage(Entity * pokemon, Entity *target) LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAB40); break; } - entityInfo->protection.protectionStatus = STATUS_NONE; + entityInfo->reflectClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); } -void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus) +void EndCurseClassStatus(Entity * pokemon, Entity * target, u8 curseClassStatus) { u32 uVar3; EntityInfo *entityInfo; @@ -1376,46 +1376,46 @@ void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->waitingStruct.waitingStatus) { + switch(entityInfo->curseClassStatus.status) { case STATUS_NONE: case 4: break; case STATUS_CURSED: - if (waitingStatus != STATUS_CURSED) { + if (curseClassStatus != STATUS_CURSED) { LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA7BC); } break; case STATUS_SNATCH: - if (waitingStatus != STATUS_SNATCH) { + if (curseClassStatus != STATUS_SNATCH) { LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA7DC); } gDungeon->snatchPokemon = NULL; gDungeon->unk17B3C = 0; break; case STATUS_DECOY: - entityInfo->waitingStruct.waitingStatus = STATUS_NONE; + entityInfo->curseClassStatus.status = STATUS_NONE; uVar3 = sub_806CEBC(target); sub_806CCB4(target,uVar3); gDungeon->decoyIsActive = FALSE; - if (waitingStatus != STATUS_DECOY) { + if (curseClassStatus != STATUS_DECOY) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9A0); } break; } - entityInfo->waitingStruct.waitingStatus = STATUS_NONE; + entityInfo->curseClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); } } -void SendLinkedEndMessage(Entity * pokemon, Entity * target) +void EndLeechSeedClassStatus(Entity * pokemon, Entity * target) { EntityInfo *entityInfo; if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->linked.linkedStatus) + switch(entityInfo->linked.status) { case STATUS_NONE: break; @@ -1426,7 +1426,7 @@ void SendLinkedEndMessage(Entity * pokemon, Entity * target) LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA8C); break; } - entityInfo->linked.linkedStatus = STATUS_NONE; + entityInfo->linked.status = STATUS_NONE; entityInfo->linked.unkD8 = 0xff; EntityUpdateStatusSprites(target); } @@ -1441,7 +1441,7 @@ void SendMoveEndMessage(Entity * pokemon, Entity * target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->moveStatus.moveStatus) { + switch(entityInfo->sureShotClassStatus.status) { case STATUS_NONE: case 5: break; @@ -1458,7 +1458,7 @@ void SendMoveEndMessage(Entity * pokemon, Entity * target) LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA95C); break; } - entityInfo->moveStatus.moveStatus = STATUS_NONE; + entityInfo->sureShotClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); } @@ -1474,7 +1474,7 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->transformStatus.transformStatus) { + switch(entityInfo->invisibleClassStatus.status) { case STATUS_NONE: case 4: break; @@ -1493,7 +1493,7 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target) LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAB6C); break; } - entityInfo->transformStatus.transformStatus = STATUS_NONE; + entityInfo->invisibleClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); if (isInvisible) { sub_807EC28(TRUE); @@ -1509,7 +1509,7 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->eyesightStatus.eyesightStatus) { + switch(entityInfo->blinkerClassStatus.status) { case STATUS_NONE: case 4: break; @@ -1523,7 +1523,7 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target) LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA48); break; } - entityInfo->eyesightStatus.eyesightStatus = STATUS_NONE; + entityInfo->blinkerClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); if (entityInfo->isTeamLeader) { sub_803E46C(0x31); @@ -1558,12 +1558,12 @@ bool8 TrySendImmobilizeSleepEndMsg(Entity * pokemon, Entity * target) EntityInfo *entityInfo = GetEntInfo(target); bool32 msg = FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) { + if (entityInfo->frozenClassStatus.status == STATUS_PETRIFIED) { EndFrozenClassStatus(pokemon, target); msg = TRUE; } - if (entityInfo->sleep.sleep == STATUS_SLEEP && entityInfo->sleep.sleepTurns == 0x7f) { - SendSleepEndMessage(pokemon,target, FALSE, TRUE); + if (entityInfo->sleepClassStatus.status == STATUS_SLEEP && entityInfo->sleepClassStatus.turns == 0x7f) { + EndSleepClassStatus(pokemon,target, FALSE, TRUE); msg = TRUE; } return msg; @@ -1574,8 +1574,8 @@ void WakeUpPokemon(Entity * pokemon) EntityInfo *entityInfo; entityInfo = GetEntInfo(pokemon); - entityInfo->sleep.sleep = STATUS_NONE; - entityInfo->sleep.sleepTurns = 0; + entityInfo->sleepClassStatus.status = STATUS_NONE; + entityInfo->sleepClassStatus.turns = 0; sub_806A898(pokemon, 1, 1); EntityUpdateStatusSprites(pokemon); } @@ -1586,10 +1586,10 @@ void SendThawedMessage(Entity *pokemon, Entity *target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - if (entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) { - entityInfo->immobilize.immobilizeStatus = STATUS_NONE; - entityInfo->immobilize.immobilizeStatusTurns = 0; - entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; + if (entityInfo->frozenClassStatus.status == STATUS_FROZEN) { + entityInfo->frozenClassStatus.status = STATUS_NONE; + entityInfo->frozenClassStatus.turns = 0; + entityInfo->frozenClassStatus.damageCountdown = 0; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA8BC); // $m0 thawed out! EntityUpdateStatusSprites(target); @@ -1614,8 +1614,8 @@ void sub_807AA30(void) { wildEntity = gDungeon->wildPokemon[wildIndex]; if (EntityExists(wildEntity) && - (entityInfo = GetEntInfo(wildEntity), entityInfo->sleep.sleep == STATUS_SLEEP) && - (entityInfo->sleep.sleepTurns == 0x7F)) { + (entityInfo = GetEntInfo(wildEntity), entityInfo->sleepClassStatus.status == STATUS_SLEEP) && + (entityInfo->sleepClassStatus.turns == 0x7F)) { adjacentCheck = FALSE; forceWakeup = FALSE; room = GetEntityRoom(wildEntity); diff --git a/src/code_8083288.c b/src/code_8083288.c index 25277b261..5bfdfa0dd 100644 --- a/src/code_8083288.c +++ b/src/code_8083288.c @@ -29,7 +29,7 @@ void sub_8082B40(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { info = GetEntInfo(entity); entity->axObj.spriteFile = GetSpriteData(info->apparentID); @@ -158,69 +158,69 @@ void sub_8082D28(unkStruct_8094924 *param_1, u8 *param_2) sub_8082FE0(param_1, param_2, 3); } -void sub_8082D34(unkStruct_8094924 *param_1, Sleep *sleep) +void sub_8082D34(unkStruct_8094924 *param_1, SleepClassStatus *sleepClassStatus) { - sub_8082FE0(param_1, &sleep->sleep, 1); - sleep->sleepTurns = sub_8083188(param_1); + sub_8082FE0(param_1, &sleepClassStatus->status, 1); + sleepClassStatus->turns = sub_8083188(param_1); } -void sub_8082D50(unkStruct_8094924 *param_1, NonVolatile *nonvoltaile) +void sub_8082D50(unkStruct_8094924 *param_1, BurnClassStatus *burnClassStatus) { - sub_8082FE0(param_1, &nonvoltaile->nonVolatileStatus, 1); - nonvoltaile->nonVolatileStatusTurns = sub_8083188(param_1); - nonvoltaile->nonVolatileStatusDamageCountdown = sub_8083188(param_1); - nonvoltaile->unk4 = sub_8083188(param_1); + sub_8082FE0(param_1, &burnClassStatus->status, 1); + burnClassStatus->turns = sub_8083188(param_1); + burnClassStatus->damageCountdown = sub_8083188(param_1); + burnClassStatus->unk4 = sub_8083188(param_1); } -void sub_8082D7C(unkStruct_8094924 *param_1, Immobilize *immobilze) +void sub_8082D7C(unkStruct_8094924 *param_1, FrozenClassStatus *frozenClassStatus) { - sub_8082FE0(param_1, &immobilze->immobilizeStatus, 1); - immobilze->immobilizeStatusTurns = sub_8083188(param_1); - immobilze->immobilizeStatusDamageCountdown = sub_8083188(param_1); - immobilze->unk4 = sub_80831A0(param_1); + sub_8082FE0(param_1, &frozenClassStatus->status, 1); + frozenClassStatus->turns = sub_8083188(param_1); + frozenClassStatus->damageCountdown = sub_8083188(param_1); + frozenClassStatus->unk4 = sub_80831A0(param_1); } -void sub_8082DA8(unkStruct_8094924 *param_1, Volatile *volatileStatus) +void sub_8082DA8(unkStruct_8094924 *param_1, CringeClassStatus *cringeClassStatus) { - sub_8082FE0(param_1, &volatileStatus->volatileStatus, 1); - volatileStatus->volatileStatusTurns = sub_8083188(param_1); + sub_8082FE0(param_1, &cringeClassStatus->status, 1); + cringeClassStatus->turns = sub_8083188(param_1); } -void sub_8082DC4(unkStruct_8094924 *param_1, Charging *charging) +void sub_8082DC4(unkStruct_8094924 *param_1, BideClassStatus *bideClassStatus) { - sub_8082FE0(param_1, &charging->chargingStatus, 1); - charging->chargingStatusTurns = sub_8083188(param_1); - charging->chargingStatusMoveIndex = sub_8083188(param_1); + sub_8082FE0(param_1, &bideClassStatus->status, 1); + bideClassStatus->turns = sub_8083188(param_1); + bideClassStatus->moveSlot = sub_8083188(param_1); } -void sub_8082DE8(unkStruct_8094924 *param_1, Protection *protect) +void sub_8082DE8(unkStruct_8094924 *param_1, ReflectClassStatus *reflectClassStatus) { - sub_8082FE0(param_1, &protect->protectionStatus, 1); - protect->protectionStatusTurns = sub_8083188(param_1); + sub_8082FE0(param_1, &reflectClassStatus->status, 1); + reflectClassStatus->turns = sub_8083188(param_1); } -void sub_8082E04(unkStruct_8094924 *param_1, Waiting *waiting) +void sub_8082E04(unkStruct_8094924 *param_1, CurseClassStatus *curseClassStatus) { - sub_8082FE0(param_1, &waiting->waitingStatus, 1); - waiting->decoyApplierNonTeamMemberFlag = sub_80831DC(param_1); - waiting->unkCA = sub_80831DC(param_1); - waiting->waitingStatusTurns = sub_8083188(param_1); - waiting->curseDamageCountdown = sub_8083188(param_1); + sub_8082FE0(param_1, &curseClassStatus->status, 1); + curseClassStatus->applierNonTeamMemberFlag = sub_80831DC(param_1); + curseClassStatus->unk2 = sub_80831DC(param_1); + curseClassStatus->turns = sub_8083188(param_1); + curseClassStatus->damageCountdown = sub_8083188(param_1); } -void sub_8082E38(unkStruct_8094924 *param_1, Linked *linked) +void sub_8082E38(unkStruct_8094924 *param_1, LeechSeedClassStatus *leechSeedClassStatus) { - sub_8082FE0(param_1, &linked->linkedStatus, 1); - linked->unkD4 = sub_80831A0(param_1); - linked->unkD8 = sub_8083188(param_1); - linked->linkedStatusTurns = sub_8083188(param_1); - linked->linkedStatusDamageCountdown = sub_8083188(param_1); + sub_8082FE0(param_1, &leechSeedClassStatus->status, 1); + leechSeedClassStatus->unkD4 = sub_80831A0(param_1); + leechSeedClassStatus->unkD8 = sub_8083188(param_1); + leechSeedClassStatus->turns = sub_8083188(param_1); + leechSeedClassStatus->damageCountdown = sub_8083188(param_1); } -void sub_8082E6C(unkStruct_8094924 *param_1, MoveStatus *moveStatus) +void sub_8082E6C(unkStruct_8094924 *param_1, SureShotClassStatus *sureShotClassStatus) { - sub_8082FE0(param_1, &moveStatus->moveStatus, 1); - moveStatus->moveStatusTurns = sub_8083188(param_1); + sub_8082FE0(param_1, &sureShotClassStatus->status, 1); + sureShotClassStatus->turns = sub_8083188(param_1); } void sub_8082E88(unkStruct_8094924 *param_1, u8 *param_2, s32 size) @@ -228,22 +228,22 @@ void sub_8082E88(unkStruct_8094924 *param_1, u8 *param_2, s32 size) sub_8082FE0(param_1, param_2, 1); } -void sub_8082E94(unkStruct_8094924 *param_1, TransformStatus *transform) +void sub_8082E94(unkStruct_8094924 *param_1, InvisibleClassStatus *invisibleClassStatus) { - sub_8082FE0(param_1, &transform->transformStatus, 1); - transform->transformStatusTurns = sub_8083188(param_1); + sub_8082FE0(param_1, &invisibleClassStatus->status, 1); + invisibleClassStatus->turns = sub_8083188(param_1); } -void sub_8082EB0(unkStruct_8094924 *param_1, EyesightStatus *eyesight) +void sub_8082EB0(unkStruct_8094924 *param_1, BlinkerClassStatus *blinkerClassStatus) { - sub_8082FE0(param_1, &eyesight->eyesightStatus, 1); - eyesight->eyesightStatusTurns = sub_8083188(param_1); + sub_8082FE0(param_1, &blinkerClassStatus->status, 1); + blinkerClassStatus->turns = sub_8083188(param_1); } void sub_8082ECC(unkStruct_8094924 *param_1, Muzzled *muzzle) { sub_8082FE0(param_1, (u8 *)&muzzle->muzzled, 1); - muzzle->muzzledTurns = sub_8083188(param_1); + muzzle->turns = sub_8083188(param_1); } void RestoreDungeonPokemonMove(unkStruct_8094924 *param_1, Move *move) diff --git a/src/dungeon_action.c b/src/dungeon_action.c index 7a4a7d439..1d5debc7a 100644 --- a/src/dungeon_action.c +++ b/src/dungeon_action.c @@ -118,7 +118,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); entityInfo->attacking = FALSE; @@ -153,7 +153,7 @@ void sub_8044AB4(void) if (gSpeedTurns[1][gDungeon->fractionalTurn + 1] != 0) { for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (EntityExists(gDungeon->activeMonsterPtrs[index])) { + if (EntityExists(gDungeon->activePokemon[index])) { UseAttack(0); break; } diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index 80684cf92..aed414a2b 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -74,7 +74,7 @@ void RunMonsterAI(Entity *pokemon, u32 unused) EntityInfo *pokemonInfo = GetEntInfo(pokemon); if (pokemonInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY) { - if (pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) + if (pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED) { EndFrozenClassStatus(pokemon, pokemon); } @@ -107,14 +107,14 @@ void RunMonsterAI(Entity *pokemon, u32 unused) Entity *target; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - target = gDungeon->activeMonsterPtrs[i]; + target = gDungeon->activePokemon[i]; if (EntityExists(target) && - GetEntInfo(target)->waitingStruct.waitingStatus == STATUS_DECOY && + GetEntInfo(target)->curseClassStatus.status == STATUS_DECOY && CanSeeTarget(pokemon, target)) { - bool8 decoyApplierNonTeamMemberFlag = GetEntInfo(target)->waitingStruct.decoyApplierNonTeamMemberFlag; + bool8 applierNonTeamMemberFlag = GetEntInfo(target)->curseClassStatus.applierNonTeamMemberFlag; u8 decoyAITracker = DECOY_AI_TEAM; - if (decoyApplierNonTeamMemberFlag) + if (applierNonTeamMemberFlag) { decoyAITracker = DECOY_AI_WILD; } @@ -143,7 +143,7 @@ void RunMonsterAI(Entity *pokemon, u32 unused) { return; } - if (pokemonInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) + if (pokemonInfo->cringeClassStatus.status == STATUS_CONFUSED) { SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); } @@ -158,7 +158,7 @@ void RunMonsterAI(Entity *pokemon, u32 unused) } else { - if (pokemonInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) + if (pokemonInfo->cringeClassStatus.status == STATUS_CONFUSED) { SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); } diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c index 5fc15e1f1..d56aeb209 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -84,17 +84,17 @@ void ChooseAIMove(Entity *pokemon) if (CannotAttack(pokemon, FALSE) || ShouldMonsterRunAwayAndShowEffect(pokemon, TRUE) || HasTactic(pokemon, TACTIC_KEEP_YOUR_DISTANCE) || - (pokemonInfo->volatileStatus.volatileStatus == STATUS_CONFUSED && DungeonRandOutcome(gConfusedAttackChance))) + (pokemonInfo->cringeClassStatus.status == STATUS_CONFUSED && DungeonRandOutcome(gConfusedAttackChance))) { return; } - if (pokemonInfo->charging.chargingStatus != STATUS_NONE) + if (pokemonInfo->bideClassStatus.status != STATUS_NONE) { for (i = 0; i < MAX_MON_MOVES; i++) { if (pokemonInfo->moves.moves[i].moveFlags & MOVE_FLAG_EXISTS && - MoveMatchesChargingStatus(pokemon, &pokemonInfo->moves.moves[i]) && - pokemonInfo->charging.chargingStatusMoveIndex == i) + MoveMatchesBideClassStatus(pokemon, &pokemonInfo->moves.moves[i]) && + pokemonInfo->bideClassStatus.moveSlot == i) { s32 chosenMoveIndex; SetMonsterActionFields(&pokemonInfo->action, ACTION_USE_MOVE_AI); @@ -206,7 +206,7 @@ void ChooseAIMove(Entity *pokemon) move->moveFlags & MOVE_FLAG_ENABLED_FOR_AI) { aiPossibleMove[i].canBeUsed = TRUE; - if (pokemonInfo->charging.chargingStatus == chargeStatus) + if (pokemonInfo->bideClassStatus.status == chargeStatus) { if (move->id == MOVE_CHARGE) { @@ -235,10 +235,10 @@ void ChooseAIMove(Entity *pokemon) } } aiPossibleMove[REGULAR_ATTACK_INDEX].weight = 0; - if (!IQSkillIsEnabled(pokemon, IQ_EXCLUSIVE_MOVE_USER) && pokemonInfo->charging.chargingStatus != chargeStatus) + if (!IQSkillIsEnabled(pokemon, IQ_EXCLUSIVE_MOVE_USER) && pokemonInfo->bideClassStatus.status != chargeStatus) { aiPossibleMove[REGULAR_ATTACK_INDEX].canBeUsed = TRUE; - if (pokemonInfo->charging.chargingStatus == chargeStatus) + if (pokemonInfo->bideClassStatus.status == chargeStatus) { // Never reached? Charge already skips the regular attack in the outer block. aiPossibleMove[REGULAR_ATTACK_INDEX].weight = 1; @@ -370,7 +370,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move targetingFlags = GetMoveTargetAndRangeForPokemon(pokemon, move, TRUE); hasStatusChecker = IQSkillIsEnabled(pokemon, IQ_STATUS_CHECKER); aiPossibleMove->canBeUsed = FALSE; - if ((pokemonInfo->volatileStatus.volatileStatus == STATUS_TAUNTED && !MoveIgnoresTaunted(move)) || + if ((pokemonInfo->cringeClassStatus.status == STATUS_TAUNTED && !MoveIgnoresTaunted(move)) || (hasStatusChecker && !CanUseOnSelfWithStatusChecker(pokemon, move))) { return 1; @@ -380,7 +380,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move rangeTargetingFlags == TARGETING_FLAG_TARGET_FRONTAL_CONE || rangeTargetingFlags == TARGETING_FLAG_TARGET_AROUND) { - if (pokemonInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER) + if (pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER) { u8 direction = pokemonInfo->action.direction; i = direction; // Fixes a regswap. @@ -422,7 +422,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *target = gDungeon->activeMonsterPtrs[i]; + Entity *target = gDungeon->activePokemon[i]; if (EntityExists(target) && CanSeeTarget(pokemon, target)) { numPotentialTargets = TryAddTargetToAITargetList(numPotentialTargets, targetingFlags, pokemon, target, move, hasStatusChecker); @@ -467,7 +467,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move } for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *target = gDungeon->activeMonsterPtrs[i]; + Entity *target = gDungeon->activePokemon[i]; if (EntityExists(target) && pokemon != target) { s32 direction = GetDirectionTowardsPosition(&pokemon->pos, &target->pos); @@ -491,7 +491,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *target = gDungeon->activeMonsterPtrs[i]; + Entity *target = gDungeon->activePokemon[i]; if (EntityExists(target)) { numPotentialTargets = TryAddTargetToAITargetList(numPotentialTargets, targetingFlags, pokemon, target, move, hasStatusChecker); @@ -805,7 +805,7 @@ bool8 TargetRegularAttack(Entity *pokemon, u32 *targetDir, bool8 checkPetrified) EntityInfo *pokemonInfo = GetEntInfo(pokemon); s32 numPotentialTargets = 0; s32 direction = pokemonInfo->action.direction; - s32 faceTurnLimit = pokemonInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER ? 1 : 8; + s32 faceTurnLimit = pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER ? 1 : 8; s32 i; s32 potentialAttackTargetDirections[NUM_DIRECTIONS]; s32 potentialAttackTargetWeights[NUM_DIRECTIONS]; @@ -821,7 +821,7 @@ bool8 TargetRegularAttack(Entity *pokemon, u32 *targetDir, bool8 checkPetrified) GetEntityType(target) == ENTITY_MONSTER && CanAttackInDirection(pokemon, direction) && GetTreatmentBetweenMonsters(pokemon, target, FALSE, checkPetrified) == TREATMENT_TREAT_AS_ENEMY && - (!hasStatusChecker || GetEntInfo(target)->immobilize.immobilizeStatus != STATUS_FROZEN)) + (!hasStatusChecker || GetEntInfo(target)->frozenClassStatus.status != STATUS_FROZEN)) { potentialAttackTargetDirections[numPotentialTargets] = direction; potentialAttackTargetWeights[numPotentialTargets] = WeightMove(pokemon, TARGETING_FLAG_TARGET_OTHER, target, TYPE_NONE); @@ -1013,19 +1013,19 @@ void HandleUseOrbAction(Entity *pokemon) } } - if (entityInfo->volatileStatus.volatileStatus == 1) { + if (entityInfo->cringeClassStatus.status == 1) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC714); r4 = FALSE; r8 = FALSE; } - else if (entityInfo->volatileStatus.volatileStatus == 7) { + else if (entityInfo->cringeClassStatus.status == 7) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC718); r4 = FALSE; r8 = FALSE; } - else if (entityInfo->nonVolatile.nonVolatileStatus == 4) + else if (entityInfo->burnClassStatus.status == 4) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC6A8); diff --git a/src/dungeon_ai_item_weight.c b/src/dungeon_ai_item_weight.c index 7c2a404fe..5ee42ce9f 100644 --- a/src/dungeon_ai_item_weight.c +++ b/src/dungeon_ai_item_weight.c @@ -202,7 +202,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_ALLURE_SEED: - if (pokemonInfo->eyesightStatus.eyesightStatus != STATUS_CROSS_EYED) + if (pokemonInfo->blinkerClassStatus.status != STATUS_CROSS_EYED) { if (IsAdjacentToEnemy(targetPokemon)) { @@ -219,7 +219,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_CHERI_BERRY: - if (pokemonInfo->nonVolatile.nonVolatileStatus != STATUS_PARALYSIS) + if (pokemonInfo->burnClassStatus.status != STATUS_PARALYSIS) { return 0; } @@ -233,7 +233,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_TOTTER_SEED: - if (pokemonInfo->volatileStatus.volatileStatus != STATUS_CONFUSED) + if (pokemonInfo->cringeClassStatus.status != STATUS_CONFUSED) { if (IsAdjacentToEnemy(targetPokemon)) { @@ -250,8 +250,8 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_PECHA_BERRY: - if (pokemonInfo->nonVolatile.nonVolatileStatus != STATUS_POISONED && - pokemonInfo->nonVolatile.nonVolatileStatus != STATUS_BADLY_POISONED) + if (pokemonInfo->burnClassStatus.status != STATUS_POISONED && + pokemonInfo->burnClassStatus.status != STATUS_BADLY_POISONED) { return 0; } @@ -265,7 +265,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_BLINKER_SEED: - if (pokemonInfo->eyesightStatus.eyesightStatus != STATUS_BLINKER) + if (pokemonInfo->blinkerClassStatus.status != STATUS_BLINKER) { if (IsAdjacentToEnemy(targetPokemon)) { @@ -316,9 +316,9 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla itemWeight = 40; break; case ITEM_SLEEP_SEED: - if (pokemonInfo->sleep.sleep != STATUS_SLEEP && - pokemonInfo->sleep.sleep != STATUS_NAPPING && - pokemonInfo->sleep.sleep != STATUS_NIGHTMARE) + if (pokemonInfo->sleepClassStatus.status != STATUS_SLEEP && + pokemonInfo->sleepClassStatus.status != STATUS_NAPPING && + pokemonInfo->sleepClassStatus.status != STATUS_NIGHTMARE) { if (IsAdjacentToEnemy(targetPokemon)) { @@ -335,7 +335,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_CHESTO_BERRY: - if (pokemonInfo->sleep.sleep != STATUS_SLEEPLESS) + if (pokemonInfo->sleepClassStatus.status != STATUS_SLEEPLESS) { itemWeight = 5; } @@ -358,7 +358,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla itemWeight = 80; break; case ITEM_RAWST_BERRY: - if (pokemonInfo->nonVolatile.nonVolatileStatus == STATUS_BURN) + if (pokemonInfo->burnClassStatus.status == STATUS_BURN) { return 50; } @@ -388,7 +388,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_STUN_SEED: - if (pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) + if (pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED) { return 0; } diff --git a/src/dungeon_ai_items.c b/src/dungeon_ai_items.c index 974d90f1a..948b357fc 100644 --- a/src/dungeon_ai_items.c +++ b/src/dungeon_ai_items.c @@ -49,7 +49,7 @@ void sub_807360C(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if(EntityExists(entity)) { if(GetEntInfo(entity)->unk152 != 0) @@ -281,7 +281,7 @@ void GetPossibleAIThrownItemDirections(Entity *pokemon, s32 thrownAIFlag, Item * } for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *targetPokemon = gDungeon->activeMonsterPtrs[i]; + Entity *targetPokemon = gDungeon->activePokemon[i]; if (EntityExists(targetPokemon) && pokemon != targetPokemon) { s32 targetingFlags; @@ -318,7 +318,7 @@ void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, Position potential gAIThrowItemActionChoiceCount = 0; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *targetPokemon = gDungeon->activeMonsterPtrs[i]; + Entity *targetPokemon = gDungeon->activePokemon[i]; if (EntityExists(targetPokemon) && pokemon != targetPokemon && CanSeeTarget(pokemon, targetPokemon) && GetTreatmentBetweenMonsters(pokemon, targetPokemon, FALSE, TRUE) == TREATMENT_TREAT_AS_ENEMY) { @@ -366,7 +366,7 @@ void TargetThrownItem(Entity *pokemon, Entity *targetPokemon, Item *item, s32 ta distanceX = distanceX < 0 ? -distanceX : distanceX; distanceY = pokemon->pos.y - targetPokemon->pos.y; distanceY = distanceY < 0 ? -distanceY : distanceY; - if (GetEntInfo(pokemon)->itemStatus.itemStatus == STATUS_NONE) + if (GetEntInfo(pokemon)->longTossClassStatus.status == STATUS_NONE) { s32 distance = distanceY < distanceX ? distanceX : distanceY; if (distance > RANGED_ATTACK_RANGE) diff --git a/src/dungeon_ai_leader.c b/src/dungeon_ai_leader.c index 15d34b63c..10024ad29 100644 --- a/src/dungeon_ai_leader.c +++ b/src/dungeon_ai_leader.c @@ -96,7 +96,7 @@ Entity* GetLeaderIfVisible(Entity *pokemon) { Entity *leader = GetLeader(); if (leader && - GetEntInfo(leader)->waitingStruct.waitingStatus != STATUS_DECOY && + GetEntInfo(leader)->curseClassStatus.status != STATUS_DECOY && GetTreatmentBetweenMonsters(pokemon, leader, FALSE, FALSE) == TREATMENT_TREAT_AS_ALLY && CanTargetEntity(pokemon, leader)) { @@ -169,23 +169,23 @@ bool8 sub_8072CF4(Entity *entity) gUnknown_202F222 = 0; switch(info->action.action) { case ACTION_WALK: - if(info->immobilize.immobilizeStatus == STATUS_SHADOW_HOLD) + if(info->frozenClassStatus.status == STATUS_SHADOW_HOLD) { goto _282; } - else if(info->immobilize.immobilizeStatus == STATUS_CONSTRICTION) + else if(info->frozenClassStatus.status == STATUS_CONSTRICTION) { goto _282; } - else if(info->immobilize.immobilizeStatus == STATUS_INGRAIN) + else if(info->frozenClassStatus.status == STATUS_INGRAIN) { goto _282; } - else if(info->immobilize.immobilizeStatus == STATUS_WRAP) + else if(info->frozenClassStatus.status == STATUS_WRAP) { goto _282; } - else if(info->immobilize.immobilizeStatus == STATUS_WRAPPED) + else if(info->frozenClassStatus.status == STATUS_WRAPPED) { _282: info->action.action = ACTION_NOTHING; @@ -210,7 +210,7 @@ bool8 sub_8072CF4(Entity *entity) pos.y = entity->pos.y; sub_80694C0(entity,pos1.x,pos1.y,0); sub_8074FB0(entity,(info->action).direction,&pos); - if (((IQSkillIsEnabled(entity, IQ_SUPER_MOBILE)) && (info->transformStatus.transformStatus != STATUS_MOBILE)) && + if (((IQSkillIsEnabled(entity, IQ_SUPER_MOBILE)) && (info->invisibleClassStatus.status != STATUS_MOBILE)) && (!HasHeldItem(entity,ITEM_MOBILE_SCARF))) { sub_804AE08(&entity->pos); } diff --git a/src/dungeon_ai_movement.c b/src/dungeon_ai_movement.c index c4d14e44b..ea641c4e9 100644 --- a/src/dungeon_ai_movement.c +++ b/src/dungeon_ai_movement.c @@ -150,7 +150,7 @@ bool8 ChooseTargetPosition(Entity *pokemon) s32 i; if (gDungeon->decoyIsActive) { - possibleTargets = gDungeon->activeMonsterPtrs; + possibleTargets = gDungeon->activePokemon; maxPossibleTargets = DUNGEON_MAX_POKEMON; } else if (pokemonInfo->isNotTeamMember) @@ -178,7 +178,7 @@ bool8 ChooseTargetPosition(Entity *pokemon) continue; } } - else if (!pokemonInfo->isNotTeamMember && GetEntInfo(target)->immobilize.immobilizeStatus == STATUS_PETRIFIED) + else if (!pokemonInfo->isNotTeamMember && GetEntInfo(target)->frozenClassStatus.status == STATUS_PETRIFIED) { continue; } @@ -513,7 +513,7 @@ bool8 AvoidEnemies(Entity *pokemon) s32 i; if (gDungeon->decoyIsActive) { - possibleTargets = gDungeon->activeMonsterPtrs; + possibleTargets = gDungeon->activePokemon; numPossibleTargets = DUNGEON_MAX_POKEMON; } else if (pokemonInfo->isNotTeamMember) diff --git a/src/dungeon_ai_targeting.c b/src/dungeon_ai_targeting.c index 0b2372c0c..2139a487a 100644 --- a/src/dungeon_ai_targeting.c +++ b/src/dungeon_ai_targeting.c @@ -74,7 +74,7 @@ bool8 sub_8070F3C(Entity * pokemon, Position *pos, s32 direction) (((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))))) { if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) { terrain = CROSSABLE_TERRAIN_WALL; @@ -137,7 +137,7 @@ bool8 sub_8070F80(Entity * pokemon, s32 direction) (((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))))) { if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) { terrain = CROSSABLE_TERRAIN_WALL; @@ -183,7 +183,7 @@ bool8 sub_8071058(Entity * pokemon, s32 direction) (!GetEntInfo(tile->monster)->isNotTeamMember)))) { if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) { terrain = CROSSABLE_TERRAIN_WALL; @@ -230,7 +230,7 @@ bool8 CanAttackInDirection(Entity *pokemon, s32 direction) { if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) { crossableTerrain = CROSSABLE_TERRAIN_WALL; @@ -282,7 +282,7 @@ bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemon if (frontTile->object != NULL && IQSkillIsEnabled(pokemon, IQ_TRAP_AVOIDER) && GetEntityType(frontTile->object) == ENTITY_TRAP && - (frontTile->object->isVisible || GetEntInfo(pokemon)->eyesightStatus.eyesightStatus == STATUS_EYEDROPS)) + (frontTile->object->isVisible || GetEntInfo(pokemon)->blinkerClassStatus.status == STATUS_EYEDROPS)) { return FALSE; } @@ -294,7 +294,7 @@ bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemon } if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) { crossableTerrain = CROSSABLE_TERRAIN_WALL; @@ -337,7 +337,7 @@ bool8 IsAtJunction(Entity *pokemon) u32 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) { crossableTerrain = CROSSABLE_TERRAIN_WALL; } @@ -477,8 +477,8 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign targetData->monsterBehavior == BEHAVIOR_DIGLETT || pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET || targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET || - (checkPetrified && !pokemonInfo->isNotTeamMember && targetData->immobilize.immobilizeStatus == STATUS_PETRIFIED) || - (!ignoreInvisible && targetData->transformStatus.transformStatus == STATUS_INVISIBLE && !CanSeeInvisibleMonsters(pokemon))) + (checkPetrified && !pokemonInfo->isNotTeamMember && targetData->frozenClassStatus.status == STATUS_PETRIFIED) || + (!ignoreInvisible && targetData->invisibleClassStatus.status == STATUS_INVISIBLE && !CanSeeInvisibleMonsters(pokemon))) { return TREATMENT_IGNORE; } @@ -517,7 +517,7 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign targetIsEnemy = targetData->isNotTeamMember ? TRUE : FALSE; } targetIsDecoy = FALSE; - if (targetData->waitingStruct.waitingStatus == STATUS_DECOY) + if (targetData->curseClassStatus.status == STATUS_DECOY) { targetIsDecoy = TRUE; } diff --git a/src/dungeon_capabilities.c b/src/dungeon_capabilities.c index 8e4a6873c..94985585a 100644 --- a/src/dungeon_capabilities.c +++ b/src/dungeon_capabilities.c @@ -24,13 +24,13 @@ bool8 CheckVariousStatuses2(Entity *pokemon, bool8 checkBlinker) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if ((checkBlinker && pokemonInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER)) + if ((checkBlinker && pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER)) return TRUE; - if (pokemonInfo->sleep.sleep == STATUS_SLEEP || pokemonInfo->sleep.sleep == STATUS_NAPPING || pokemonInfo->sleep.sleep == STATUS_NIGHTMARE) + if (pokemonInfo->sleepClassStatus.status == STATUS_SLEEP || pokemonInfo->sleepClassStatus.status == STATUS_NAPPING || pokemonInfo->sleepClassStatus.status == STATUS_NIGHTMARE) return TRUE; - if (pokemonInfo->volatileStatus.volatileStatus == STATUS_PAUSED || pokemonInfo->volatileStatus.volatileStatus == STATUS_INFATUATED) + if (pokemonInfo->cringeClassStatus.status == STATUS_PAUSED || pokemonInfo->cringeClassStatus.status == STATUS_INFATUATED) return TRUE; - if (pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) + if (pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED) return TRUE; if (pokemonInfo->terrifiedTurns != 0) return TRUE; @@ -43,34 +43,34 @@ bool8 sub_8070BC0(Entity* entity) EntityInfo *entityInfo = GetEntInfo(entity); if (IsChargingAnyTwoTurnMove(entity, FALSE) - || entityInfo->sleep.sleep == STATUS_YAWNING - || entityInfo->sleep.sleep == STATUS_NIGHTMARE + || entityInfo->sleepClassStatus.status == STATUS_YAWNING + || entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE || ShouldMonsterRunAway(entity) || entityInfo->muzzled.muzzled == TRUE - || entityInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED - || entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) + || entityInfo->frozenClassStatus.status == STATUS_PETRIFIED + || entityInfo->frozenClassStatus.status == STATUS_FROZEN) return FALSE; - if (entityInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) + if (entityInfo->cringeClassStatus.status == STATUS_CONFUSED) return FALSE; - if (entityInfo->sleep.sleep == STATUS_SLEEP) + if (entityInfo->sleepClassStatus.status == STATUS_SLEEP) return FALSE; - if (entityInfo->transformStatus.transformStatus == STATUS_INVISIBLE - || entityInfo->sleep.sleep == STATUS_NAPPING) + if (entityInfo->invisibleClassStatus.status == STATUS_INVISIBLE + || entityInfo->sleepClassStatus.status == STATUS_NAPPING) return FALSE; - if (entityInfo->volatileStatus.volatileStatus == STATUS_CRINGE) + if (entityInfo->cringeClassStatus.status == STATUS_CRINGE) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP) + if (entityInfo->frozenClassStatus.status == STATUS_WRAP) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED - || entityInfo->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED) + if (entityInfo->frozenClassStatus.status == STATUS_WRAPPED + || entityInfo->blinkerClassStatus.status == STATUS_CROSS_EYED) return FALSE; - if (entityInfo->waitingStruct.waitingStatus == STATUS_DECOY) + if (entityInfo->curseClassStatus.status == STATUS_DECOY) return FALSE; - if (entityInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER) + if (entityInfo->blinkerClassStatus.status == STATUS_BLINKER) return FALSE; - if (entityInfo->volatileStatus.volatileStatus != STATUS_INFATUATED - && entityInfo->volatileStatus.volatileStatus != STATUS_PAUSED) + if (entityInfo->cringeClassStatus.status != STATUS_INFATUATED + && entityInfo->cringeClassStatus.status != STATUS_PAUSED) return TRUE; return FALSE; @@ -97,11 +97,11 @@ bool8 CheckVariousStatuses(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if ((pokemonInfo->sleep.sleep != STATUS_SLEEPLESS && pokemonInfo->sleep.sleep != STATUS_NONE)) + if ((pokemonInfo->sleepClassStatus.status != STATUS_SLEEPLESS && pokemonInfo->sleepClassStatus.status != STATUS_NONE)) return TRUE; - if (pokemonInfo->immobilize.immobilizeStatus == STATUS_FROZEN || pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) + if (pokemonInfo->frozenClassStatus.status == STATUS_FROZEN || pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED) return TRUE; - if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) + if (pokemonInfo->bideClassStatus.status == STATUS_BIDE) return TRUE; return FALSE; @@ -112,17 +112,17 @@ bool8 CannotAttack(Entity *pokemon, bool8 skipSleep) EntityInfo *pokemonInfo = GetEntInfo(pokemon); if ((skipSleep || - pokemonInfo->sleep.sleep == STATUS_SLEEPLESS || - pokemonInfo->sleep.sleep == STATUS_YAWNING || - pokemonInfo->sleep.sleep == STATUS_NONE) && - pokemonInfo->immobilize.immobilizeStatus != STATUS_FROZEN && - pokemonInfo->immobilize.immobilizeStatus != STATUS_WRAP && - pokemonInfo->immobilize.immobilizeStatus != STATUS_WRAPPED && - pokemonInfo->immobilize.immobilizeStatus != STATUS_PETRIFIED && - pokemonInfo->volatileStatus.volatileStatus != STATUS_CRINGE && - pokemonInfo->volatileStatus.volatileStatus != STATUS_PAUSED && - pokemonInfo->volatileStatus.volatileStatus != STATUS_INFATUATED && - pokemonInfo->nonVolatile.nonVolatileStatus != STATUS_PARALYSIS && + pokemonInfo->sleepClassStatus.status == STATUS_SLEEPLESS || + pokemonInfo->sleepClassStatus.status == STATUS_YAWNING || + pokemonInfo->sleepClassStatus.status == STATUS_NONE) && + pokemonInfo->frozenClassStatus.status != STATUS_FROZEN && + pokemonInfo->frozenClassStatus.status != STATUS_WRAP && + pokemonInfo->frozenClassStatus.status != STATUS_WRAPPED && + pokemonInfo->frozenClassStatus.status != STATUS_PETRIFIED && + pokemonInfo->cringeClassStatus.status != STATUS_CRINGE && + pokemonInfo->cringeClassStatus.status != STATUS_PAUSED && + pokemonInfo->cringeClassStatus.status != STATUS_INFATUATED && + pokemonInfo->burnClassStatus.status != STATUS_PARALYSIS && !ShouldMonsterRunAway(pokemon)) return FALSE; @@ -140,7 +140,7 @@ bool8 CanMoveInDirection(Entity *pokemon, u32 direction) if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) crossableTerrain = CROSSABLE_TERRAIN_WALL; else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) crossableTerrain = CROSSABLE_TERRAIN_CREVICE; diff --git a/src/dungeon_engine.c b/src/dungeon_engine.c index 75c8a423b..50d25d39c 100644 --- a/src/dungeon_engine.c +++ b/src/dungeon_engine.c @@ -182,7 +182,7 @@ static void sub_8044454(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if ((EntityExists(entity)) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) { if (sub_8044B28()) break; TickStatusHeal(entity); @@ -210,7 +210,7 @@ void sub_80444F4(Entity *pokemon) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if ((EntityExists(entity)) && (pokemon != entity) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) { if (sub_8044B28()) break; RunMonsterAI(entity, 0); diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 8b4a89317..1d21951bb 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -513,12 +513,12 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move sub_806A1E8(currTarget); TrySendImmobilizeSleepEndMsg(attacker, currTarget); r4 = FALSE; - if (!MoveMatchesChargingStatus(attacker, move)) { + if (!MoveMatchesBideClassStatus(attacker, move)) { r4 = (MoveRequiresCharging(attacker, move->id) != 0); } if (!lightRodRedirect) { - if (targetInfo->protection.protectionStatus == STATUS_MAGIC_COAT) { + if (targetInfo->reflectClassStatus.status == STATUS_MAGIC_COAT) { if (IsReflectedByMagicCoat(moveId) && sub_8055988(attacker, currTarget)) { TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FC52C); // The target~27s Magic Coat bounced it back! sub_8041B48(currTarget); @@ -529,7 +529,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move moveRedirected = TRUE; } } - else if (targetInfo->protection.protectionStatus == STATUS_MIRROR_MOVE) { + else if (targetInfo->reflectClassStatus.status == STATUS_MIRROR_MOVE) { s32 target = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); if (moveId != MOVE_REGULAR_ATTACK && moveId != MOVE_PROJECTILE @@ -548,7 +548,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move } } if (!lightRodRedirect) { - if (targetInfo->protection.protectionStatus == STATUS_PROTECT) { + if (targetInfo->reflectClassStatus.status == STATUS_PROTECT) { s16 targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); s32 targetFlagsAnd = targetFlags & 0xF; if ((targetFlagsAnd == 0 || targetFlagsAnd == 4 || targetFlagsAnd == 5 || targetFlagsAnd == 2) && !r4) { @@ -1804,17 +1804,17 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 attackerInfo->abilityEffectFlags = 0; attackerInfo->unk159 = 0; - if (attackerInfo->volatileStatus.volatileStatus == STATUS_CRINGE) { + if (attackerInfo->cringeClassStatus.status == STATUS_CRINGE) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC714); // is cringing! return FALSE; } - else if (attackerInfo->volatileStatus.volatileStatus == STATUS_INFATUATED) { + else if (attackerInfo->cringeClassStatus.status == STATUS_INFATUATED) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC718); // is infatuated! return FALSE; } - else if (attackerInfo->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) { + else if (attackerInfo->burnClassStatus.status == STATUS_PARALYSIS) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6A8); // is paralyzed! return FALSE; @@ -1860,7 +1860,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 if (MoveFlagExists(currMove)) { bool32 moveUsable = TRUE; bool32 var_28 = FALSE; - bool32 statusMoveMatch = MoveMatchesChargingStatus(attacker, currMove); + bool32 statusMoveMatch = MoveMatchesBideClassStatus(attacker, currMove); if (currMove->PP != 0) { if (!statusMoveMatch) { @@ -2068,7 +2068,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, { var_28 = 1; if ((move->id != MOVE_SOLARBEAM || GetApparentWeather(attacker) != WEATHER_SUNNY) && DoesMoveCharge(move->id)) { - if (!MoveMatchesChargingStatus(attacker, move)) { + if (!MoveMatchesBideClassStatus(attacker, move)) { var_28 = 0; } } @@ -2076,7 +2076,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(attacker), 0); sub_80928C0(gFormatBuffer_Items[0], move, NULL); - if (MoveMatchesChargingStatus(attacker, move)) { + if (MoveMatchesBideClassStatus(attacker, move)) { msg = gUnknown_80FC72C; // mon loosed move GetEntInfo(attacker)->unkFF = 0; moveUsable = sub_805744C(attacker, move, TRUE); @@ -2171,7 +2171,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, sub_806A1E8(gUnknown_203B438); } - if (GetEntInfo(attacker)->volatileStatus.volatileStatus != STATUS_CONFUSED && GetEntInfo(attacker)->volatileStatus.volatileStatus != STATUS_COWERING) { + if (GetEntInfo(attacker)->cringeClassStatus.status != STATUS_CONFUSED && GetEntInfo(attacker)->cringeClassStatus.status != STATUS_COWERING) { EntityInfo *entInfo = GetEntInfo(attacker); entInfo->targetPos.x = 0; entInfo->targetPos.y = 0; @@ -2198,7 +2198,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, if (gUnknown_202F21A != 0) { EndFrozenClassStatus(attacker, attacker); - SendLinkedEndMessage(attacker, attacker); + EndLeechSeedClassStatus(attacker, attacker); } if (gUnknown_202F219 != 0 && EntityExists(attacker)) { @@ -2592,7 +2592,7 @@ void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 break; } - if (MoveRequiresCharging(attacker, move->id) && !MoveMatchesChargingStatus(attacker, move)) { + if (MoveRequiresCharging(attacker, move->id) && !MoveMatchesBideClassStatus(attacker, move)) { var_34 = -1; } else { @@ -2672,9 +2672,9 @@ void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 bool8 canHitAnyone = FALSE; s32 targetFlags; EntityInfo *attackerInfo = GetEntInfo(attacker); - if (attackerInfo->volatileStatus.volatileStatus == STATUS_CONFUSED - || attackerInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER - || attackerInfo->volatileStatus.volatileStatus == STATUS_COWERING) + if (attackerInfo->cringeClassStatus.status == STATUS_CONFUSED + || attackerInfo->blinkerClassStatus.status == STATUS_BLINKER + || attackerInfo->cringeClassStatus.status == STATUS_COWERING) { canHitAnyone = TRUE; } @@ -2714,9 +2714,9 @@ static bool8 AccuracyCalc(Entity *attacker, Entity *target, Move *move, s32 accu return TRUE; if (move->id == MOVE_REGULAR_ATTACK && IQSkillIsEnabled(attacker, IQ_SURE_HIT_ATTACKER)) return TRUE; - if (attackerInfo->moveStatus.moveStatus == STATUS_SURE_SHOT) + if (attackerInfo->sureShotClassStatus.status == STATUS_SURE_SHOT) return TRUE; - if (attackerInfo->moveStatus.moveStatus == STATUS_WHIFFER) + if (attackerInfo->sureShotClassStatus.status == STATUS_WHIFFER) return FALSE; if (accuracy > 100) return TRUE; @@ -2786,10 +2786,10 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov s32 targetFlags; s32 targetFlagsAnd; s32 arrId = 0; - bool8 canHitPartner = (GetEntInfo(attacker)->volatileStatus.volatileStatus == STATUS_CONFUSED - || GetEntInfo(attacker)->eyesightStatus.eyesightStatus == STATUS_BLINKER - || GetEntInfo(attacker)->volatileStatus.volatileStatus == STATUS_COWERING); - bool8 canHitSelf = (GetEntInfo(attacker)->volatileStatus.volatileStatus == STATUS_CONFUSED || GetEntInfo(attacker)->volatileStatus.volatileStatus == STATUS_COWERING); + bool8 canHitPartner = (GetEntInfo(attacker)->cringeClassStatus.status == STATUS_CONFUSED + || GetEntInfo(attacker)->blinkerClassStatus.status == STATUS_BLINKER + || GetEntInfo(attacker)->cringeClassStatus.status == STATUS_COWERING); + bool8 canHitSelf = (GetEntInfo(attacker)->cringeClassStatus.status == STATUS_CONFUSED || GetEntInfo(attacker)->cringeClassStatus.status == STATUS_COWERING); if (IQSkillIsEnabled(attacker, IQ_NONTRAITOR)) { canHitSelf = FALSE; @@ -2797,7 +2797,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov } targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); if ((targetFlags & 0xF) == 4) { - bool32 usable = MoveMatchesChargingStatus(attacker, move); + bool32 usable = MoveMatchesBideClassStatus(attacker, move); if (move->id == MOVE_SOLARBEAM && GetApparentWeather(attacker) == WEATHER_SUNNY) { usable = TRUE; } @@ -2842,7 +2842,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov else if (targetFlagsAnd == 0x30) { s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->activeMonsterPtrs[i]; + Entity *dungeonMon = gDungeon->activePokemon[i]; if (EntityExists(dungeonMon) && sub_8045A70(attacker, dungeonMon)) { if (dungeonMon == attacker) { arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, attacker, move, canHitSelf); @@ -2880,7 +2880,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov else if (targetFlagsAnd == 0x60) { s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->activeMonsterPtrs[i]; + Entity *dungeonMon = gDungeon->activePokemon[i]; if (EntityExists(dungeonMon)) { arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, dungeonMon, move, canHitPartner); } @@ -2962,7 +2962,7 @@ static s32 SetNewTarget(s32 targetArrId, Entity **targetsArray, s32 targetFlags_ struct MultiTurnChargeMove { u16 moveID; - u8 chargingStatus; + u8 status; }; const struct MultiTurnChargeMove gMultiTurnChargeMoves[10] = { @@ -2978,7 +2978,7 @@ const struct MultiTurnChargeMove gMultiTurnChargeMoves[10] = { {MOVE_NOTHING, STATUS_NONE} }; -const u32 gMultiTurnChargingStatuses[10] = { +const u32 gMultiTurnBideClassStatuses[10] = { STATUS_SOLARBEAM, STATUS_SKY_ATTACK, STATUS_RAZOR_WIND, @@ -3010,7 +3010,7 @@ bool8 MoveCausesPaused(Move *move) return FALSE; } -bool8 MoveMatchesChargingStatus(Entity *pokemon, Move *move) +bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move) { if (!EntityExists(pokemon)) { @@ -3027,7 +3027,7 @@ bool8 MoveMatchesChargingStatus(Entity *pokemon, Move *move) return FALSE; } if (move->id == gMultiTurnChargeMoves[i].moveID && - pokemonInfo->charging.chargingStatus == gMultiTurnChargeMoves[i].chargingStatus) + pokemonInfo->bideClassStatus.status == gMultiTurnChargeMoves[i].status) { return TRUE; } @@ -3046,26 +3046,26 @@ bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); int i = 0; - u8 *chargingStatusPointer = &pokemonInfo->charging.chargingStatus; - u8 *chargingStatusPointer2; + u8 *bideClassStatusPointer = &pokemonInfo->bideClassStatus.status; + u8 *bideClassStatusPointer2; u8 chargeStatus = STATUS_CHARGING; for (; i < 100; i++) { - u8 currentStatus = gMultiTurnChargingStatuses[i]; - u8 chargingStatus; + u8 currentStatus = gMultiTurnBideClassStatuses[i]; + u8 bideClassStatus; if (currentStatus == STATUS_NONE) { return FALSE; } - chargingStatus = *chargingStatusPointer; - chargingStatusPointer2 = &pokemonInfo->charging.chargingStatus; - if (chargingStatus == currentStatus) + bideClassStatus = *bideClassStatusPointer; + bideClassStatusPointer2 = &pokemonInfo->bideClassStatus.status; + if (bideClassStatus == currentStatus) { return TRUE; } } - // BUG: This condition is never reached because the for loop terminates by returning FALSE at the end of the gMultiTurnChargingStatuses array. - if (checkCharge && *chargingStatusPointer2 == chargeStatus) + // BUG: This condition is never reached because the for loop terminates by returning FALSE at the end of the gMultiTurnBideClassStatuses array. + if (checkCharge && *bideClassStatusPointer2 == chargeStatus) { return TRUE; } @@ -3081,7 +3081,7 @@ u32 sub_8057144(Entity * pokemon) nMoves = 0; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->activeMonsterPtrs[i]; + Entity *dungeonMon = gDungeon->activePokemon[i]; if (EntityExists(dungeonMon)) { Move *moves = GetEntInfo(dungeonMon)->moves.moves; for (j = 0; j < MAX_MON_MOVES; j++) @@ -3120,10 +3120,10 @@ bool8 sub_80571F0(Entity * pokemon, Move *move) return TRUE; } else if (entityInfo->unkFF == 2) { - if (entityInfo->charging.chargingStatus == STATUS_DIVING) { + if (entityInfo->bideClassStatus.status == STATUS_DIVING) { if (move->id == MOVE_WHIRLPOOL || move->id == MOVE_SURF) return FALSE; } - else if (entityInfo->charging.chargingStatus == STATUS_DIGGING) { + else if (entityInfo->bideClassStatus.status == STATUS_DIGGING) { moveID = move->id; if (moveID == MOVE_EARTHQUAKE || moveID == MOVE_MAGNITUDE) return FALSE; if (moveID == MOVE_NATURE_POWER) { @@ -3227,11 +3227,11 @@ bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker) { return FALSE; } - if (pokemonInfo->volatileStatus.volatileStatus == STATUS_TAUNTED && !MoveIgnoresTaunted(move)) + if (pokemonInfo->cringeClassStatus.status == STATUS_TAUNTED && !MoveIgnoresTaunted(move)) { return FALSE; } - if (pokemonInfo->volatileStatus.volatileStatus == STATUS_ENCORE) + if (pokemonInfo->cringeClassStatus.status == STATUS_ENCORE) { if (move->id == MOVE_STRUGGLE) { @@ -3259,8 +3259,8 @@ bool8 sub_805744C(Entity * pokemon, Move *move, bool8 param_3) return FALSE; } if (param_3 != 0) { - if ((entityInfo->volatileStatus.volatileStatus == STATUS_TAUNTED) && (!MoveIgnoresTaunted(move))) return FALSE; - if (entityInfo->volatileStatus.volatileStatus == STATUS_ENCORE) { + if ((entityInfo->cringeClassStatus.status == STATUS_TAUNTED) && (!MoveIgnoresTaunted(move))) return FALSE; + if (entityInfo->cringeClassStatus.status == STATUS_ENCORE) { if (move->id == MOVE_STRUGGLE) { if((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE; } diff --git a/src/dungeon_movement.c b/src/dungeon_movement.c index 9a199d3ad..4239a27a1 100644 --- a/src/dungeon_movement.c +++ b/src/dungeon_movement.c @@ -80,7 +80,7 @@ u8 sub_80703A0(Entity *pokemon, Position *pos) if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) return TRUE; if (tile->monster == NULL && ((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) { - if ((IsCurrentFixedRoomBossFight()) || ((entityInfo->transformStatus.transformStatus != STATUS_MOBILE && (!HasHeldItem(pokemon, ITEM_MOBILE_SCARF))))) { + if ((IsCurrentFixedRoomBossFight()) || ((entityInfo->invisibleClassStatus.status != STATUS_MOBILE && (!HasHeldItem(pokemon, ITEM_MOBILE_SCARF))))) { crossableTerrain = GetCrossableTerrain(entityInfo->id); tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { @@ -113,7 +113,7 @@ u8 sub_80703A0(Entity *pokemon, Position *pos) bool8 CanCrossWalls(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if (pokemonInfo->transformStatus.transformStatus == STATUS_MOBILE) + if (pokemonInfo->invisibleClassStatus.status == STATUS_MOBILE) { return TRUE; } @@ -142,7 +142,7 @@ bool8 sub_807049C(Entity *pokemon, Position *pos) if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) return TRUE; if (((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0) && (tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))) { - if (IsCurrentFixedRoomBossFight() || (entityInfo->transformStatus.transformStatus != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { + if (IsCurrentFixedRoomBossFight() || (entityInfo->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { crossableTerrain = GetCrossableTerrain(entityInfo->id); tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { @@ -230,7 +230,7 @@ bool8 sub_80705F0(Entity *pokemon, Position *pos) if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) return TRUE; if (((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0) && (tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))) { - if (IsCurrentFixedRoomBossFight() || (entityInfo->transformStatus.transformStatus != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { + if (IsCurrentFixedRoomBossFight() || (entityInfo->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { crossableTerrain = GetCrossableTerrain(entityInfo->id); tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { @@ -271,7 +271,7 @@ bool8 sub_80706A4(Entity *pokemon, Position *pos) return TRUE; if ((((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) && (tile->monster == NULL || ((GetEntityType(tile->monster) == ENTITY_MONSTER) && (GetEntInfo(tile->monster) == entityInfo)))) { - if (IsCurrentFixedRoomBossFight() || (entityInfo->transformStatus.transformStatus != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { + if (IsCurrentFixedRoomBossFight() || (entityInfo->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { crossableTerrain = GetCrossableTerrain(entityInfo->id); tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { @@ -318,7 +318,7 @@ s32 CalcSpeedStage(Entity *pokemon) } } - if (entityInfo->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) { + if (entityInfo->burnClassStatus.status == STATUS_PARALYSIS) { speed--; } diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c index 814c08b5b..31ce41aa2 100644 --- a/src/dungeon_pokemon_attributes.c +++ b/src/dungeon_pokemon_attributes.c @@ -26,7 +26,7 @@ extern bool8 sub_805744C(Entity *, Move *, u32); bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage) { - if (GetEntInfo(target)->protection.protectionStatus == STATUS_SAFEGUARD) { + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_SAFEGUARD) { if (displayMessage) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2FC); @@ -38,7 +38,7 @@ bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage) { - if (GetEntInfo(target)->protection.protectionStatus == STATUS_MIST) { + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_MIST) { if (displayMessage) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FC31C); @@ -63,7 +63,7 @@ bool8 sub_80717A4(Entity *pokemon, u16 moveID) s32 index; entityInfo = GetEntInfo(pokemon); - if ((entityInfo->sleep.sleep != STATUS_SLEEP) && (entityInfo->sleep.sleep != STATUS_NAPPING) && (entityInfo->sleep.sleep != STATUS_NIGHTMARE)) { + if ((entityInfo->sleepClassStatus.status != STATUS_SLEEP) && (entityInfo->sleepClassStatus.status != STATUS_NAPPING) && (entityInfo->sleepClassStatus.status != STATUS_NIGHTMARE)) { return FALSE; } else @@ -126,7 +126,7 @@ bool8 MonsterIsType(Entity *pokemon, u8 type) bool8 CanSeeInvisibleMonsters(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if (pokemonInfo->eyesightStatus.eyesightStatus != STATUS_EYEDROPS) + if (pokemonInfo->blinkerClassStatus.status != STATUS_EYEDROPS) { if (!HasHeldItem(pokemon, ITEM_GOGGLE_SPECS)) return FALSE; diff --git a/src/dungeon_util.c b/src/dungeon_util.c index 2999379a1..350206f98 100644 --- a/src/dungeon_util.c +++ b/src/dungeon_util.c @@ -103,7 +103,7 @@ void sub_804513C(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - gDungeon->activeMonsterPtrs[index] = NULL; + gDungeon->activePokemon[index] = NULL; } for (index = 0; index < DUNGEON_MAX_ITEMS; index++) @@ -132,7 +132,7 @@ void sub_804522C(void) { { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if(EntityExists(entity)) { if(entity == gDungeon->unk181e8.cameraTarget) diff --git a/src/dungeon_util_1.c b/src/dungeon_util_1.c index 5398c2c34..eea943e5c 100644 --- a/src/dungeon_util_1.c +++ b/src/dungeon_util_1.c @@ -157,7 +157,7 @@ Entity *GetEntityFromMonsterBehavior(u8 entityType) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if ((EntityExists(entity)) && (GetEntInfo(entity)->monsterBehavior == entityType)) return entity; } return NULL; @@ -219,7 +219,7 @@ void sub_80857B8(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); if ((gDungeon->unk4 == 0) && (gDungeon->unk2 == 0)) { diff --git a/src/dungeon_visibility.c b/src/dungeon_visibility.c index 40fc29d26..f2c862684 100644 --- a/src/dungeon_visibility.c +++ b/src/dungeon_visibility.c @@ -16,16 +16,16 @@ bool8 CanSeeTarget(Entity *entity, Entity *targetEntity) { if (entity->type == ENTITY_MONSTER) { - if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->transformStatus.transformStatus == STATUS_INVISIBLE) + if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) { return FALSE; } - if (GetEntInfo(entity)->eyesightStatus.eyesightStatus == STATUS_BLINKER) + if (GetEntInfo(entity)->blinkerClassStatus.status == STATUS_BLINKER) { return FALSE; } } - else if (GetEntInfo(targetEntity)->transformStatus.transformStatus == STATUS_INVISIBLE) + else if (GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) { return FALSE; } @@ -43,16 +43,16 @@ bool8 CanTargetEntity(Entity *entity, Entity *targetEntity) { if (entity->type == ENTITY_MONSTER) { - if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->transformStatus.transformStatus == STATUS_INVISIBLE) + if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) { return FALSE; } - if (GetEntInfo(entity)->eyesightStatus.eyesightStatus == STATUS_BLINKER) + if (GetEntInfo(entity)->blinkerClassStatus.status == STATUS_BLINKER) { return FALSE; } } - else if (GetEntInfo(targetEntity)->transformStatus.transformStatus == STATUS_INVISIBLE) + else if (GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) { return FALSE; } diff --git a/src/move_actions.c b/src/move_actions.c index 6d0994dc4..3a77c3491 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -341,7 +341,7 @@ bool8 DigMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD14C); // It can only be used on land! } else { - if (MoveMatchesChargingStatus(pokemon,move)) { + if (MoveMatchesBideClassStatus(pokemon,move)) { HandleDamagingMove(pokemon,target,move,gUnknown_80F4F68,param_4); sub_8079764(pokemon); } @@ -505,8 +505,8 @@ bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 } if (isTormented) { - if(entityInfo->charging.chargingStatus == STATUS_BIDE) { - entityInfo->charging.chargingStatus = STATUS_NONE; + if(entityInfo->bideClassStatus.status == STATUS_BIDE) { + entityInfo->bideClassStatus.status = STATUS_NONE; } } else @@ -590,7 +590,7 @@ bool8 WhirlpoolMoveAction(Entity * pokemon, Entity * target, Move * move, u32 pa u8 chargeStatus; flag = FALSE; - chargeStatus = GetEntInfo(target)->charging.chargingStatus; + chargeStatus = GetEntInfo(target)->bideClassStatus.status; uVar3 = 0x100; if (chargeStatus == STATUS_DIVING) { uVar3 = 0x200; @@ -852,7 +852,7 @@ bool8 sub_8058270(Entity *pokemon, Entity *target, Move *move, u32 param_4) r3 = 1; targetInfo = GetEntInfo(target); - if(targetInfo->charging.chargingStatus == STATUS_FLYING || targetInfo->charging.chargingStatus == STATUS_BOUNCING) + if(targetInfo->bideClassStatus.status == STATUS_FLYING || targetInfo->bideClassStatus.status == STATUS_BOUNCING) r3 = 2; flag = HandleDamagingMove(pokemon,target,move,r3 << 8,param_4) ? TRUE : FALSE; return flag; @@ -880,7 +880,7 @@ bool8 RazorWindMoveAction(Entity * pokemon, Entity * target, Move * move, u32 pa { bool8 flag; - if (MoveMatchesChargingStatus(pokemon,move)) { + if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F50,param_4) ? TRUE : FALSE; sub_8079764(pokemon); } @@ -985,7 +985,7 @@ bool8 sub_8058548(Entity *pokemon, Entity *target, Move *move, u32 param_4) u32 r5; r5 = 0x80 << 1; - if((GetEntInfo(pokemon)->nonVolatile.nonVolatileStatus) != STATUS_NONE) + if((GetEntInfo(pokemon)->burnClassStatus.status) != STATUS_NONE) r5 = gUnknown_80F4F6C; flag = HandleDamagingMove(pokemon,target,move,r5,param_4) ? TRUE : FALSE; return flag; @@ -1011,9 +1011,9 @@ bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, u32 para bool8 flag; flag = FALSE; - if ((GetEntInfo(target)->protection.protectionStatus == STATUS_REFLECT) || (GetEntInfo(target)->protection.protectionStatus == STATUS_LIGHT_SCREEN)) { + if ((GetEntInfo(target)->reflectClassStatus.status == STATUS_REFLECT) || (GetEntInfo(target)->reflectClassStatus.status == STATUS_LIGHT_SCREEN)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD104); // The barrier was shattered - SendProtectionEndMessage(pokemon,target); + EndReflectClassStatus(pokemon,target); flag = TRUE; } @@ -1040,7 +1040,7 @@ bool8 FocusPunchMoveAction(Entity * pokemon, Entity * target, Move * move, u32 p { bool8 flag; - if (MoveMatchesChargingStatus(pokemon,move)) { + if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F54,param_4) ? TRUE : FALSE; sub_8079764(pokemon); } @@ -1109,9 +1109,9 @@ bool8 sub_80587E8(Entity * pokemon, Entity * target, Move * move, u32 param_4) { bool8 flag; - if (GetEntInfo(target)->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) { + if (GetEntInfo(target)->burnClassStatus.status == STATUS_PARALYSIS) { flag = HandleDamagingMove(pokemon,target,move,0x80 << 2,param_4) ? TRUE : FALSE; - SendNonVolatileEndMessage(pokemon, target); + EndBurnClassStatus(pokemon, target); } else { flag = HandleDamagingMove(pokemon,target,move,0x80 << 1,param_4) ? TRUE : FALSE; @@ -1237,7 +1237,7 @@ bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param { bool8 flag = FALSE; - if(MoveMatchesChargingStatus(pokemon, move)) + if(MoveMatchesBideClassStatus(pokemon, move)) { if (HandleDamagingMove(pokemon, target, move, gUnknown_80F4F4C, param_4) != 0) { flag = TRUE; @@ -1455,7 +1455,7 @@ bool32 sub_8058F04(Entity *pokemon, Entity *target, Move *move, s32 param_4) iVar3 = 1; gDungeon->unk181e8.unk18200 = 0xc; gDungeon->unk181e8.unk18204 = 0; - if (entityInfo->charging.chargingStatus == STATUS_DIGGING) { + if (entityInfo->bideClassStatus.status == STATUS_DIGGING) { iVar3 = 2; } flag = HandleDamagingMove(pokemon,target,move,iVar3 << 8,param_4); @@ -1799,7 +1799,7 @@ bool8 SolarBeamMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param s32 movePower; weather = GetApparentWeather(pokemon); - if ((weather == WEATHER_SUNNY) || (MoveMatchesChargingStatus(pokemon,move))) { + if ((weather == WEATHER_SUNNY) || (MoveMatchesBideClassStatus(pokemon,move))) { movePower = gSolarBeamMovePower; if (((weather == WEATHER_SANDSTORM) || (weather == WEATHER_RAIN)) || weather == WEATHER_HAIL) { @@ -1830,7 +1830,7 @@ bool8 FlyMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) bool8 flag; flag = FALSE; - if (MoveMatchesChargingStatus(pokemon,move)) { + if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F5C,param_4) != 0 ? TRUE : FALSE; sub_8079764(pokemon); } @@ -1855,7 +1855,7 @@ bool8 DiveMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4 if (IsTileGround(GetTileAtEntitySafe(pokemon))) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD128); } - else if (MoveMatchesChargingStatus(pokemon,move)) { + else if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F64,param_4) != 0 ? TRUE : FALSE; sub_8079764(pokemon); } @@ -1894,7 +1894,7 @@ bool8 sub_8059928(Entity * pokemon,Entity * target,Move * move,u32 param_4) iVar2 = 1; flag = FALSE; - if ((u8)(GetEntInfo(target)->charging.chargingStatus - 7) <= 1){ + if ((u8)(GetEntInfo(target)->bideClassStatus.status - 7) <= 1){ iVar2 = 2; } if (HandleDamagingMove(pokemon,target,move,iVar2 << 8,param_4) != 0) @@ -2188,7 +2188,7 @@ bool8 sub_8059F38(Entity * pokemon,Entity * target,Move * move,u32 param_4) bool8 flag; flag = FALSE; - if (MoveMatchesChargingStatus(pokemon, move)) { + if (MoveMatchesBideClassStatus(pokemon, move)) { if (HandleDamagingMove(pokemon, target, move, gUnknown_80F4F60, param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon, target, gUnknown_80F4DCC) != 0) { @@ -2378,7 +2378,7 @@ bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) u32 uVar2; flag = FALSE; - if (GetEntInfo(target)->charging.chargingStatus == STATUS_DIVING) { + if (GetEntInfo(target)->bideClassStatus.status == STATUS_DIVING) { uVar2 = 0x200; } else diff --git a/src/move_checks.c b/src/move_checks.c index b6138a831..d4f5c6555 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -114,20 +114,20 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_RAGE: - if (pokemonInfo->charging.chargingStatus == STATUS_ENRAGED) + if (pokemonInfo->bideClassStatus.status == STATUS_ENRAGED) { return FALSE; } break; case MOVE_COUNTER: case MOVE_PURSUIT: - if (pokemonInfo->protection.protectionStatus == STATUS_COUNTER) + if (pokemonInfo->reflectClassStatus.status == STATUS_COUNTER) { return FALSE; } break; case MOVE_MIRROR_MOVE: - if (pokemonInfo->protection.protectionStatus == STATUS_MIRROR_MOVE) + if (pokemonInfo->reflectClassStatus.status == STATUS_MIRROR_MOVE) { return FALSE; } @@ -159,7 +159,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) break; case MOVE_BIDE: case MOVE_REVENGE: - if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) + if (pokemonInfo->bideClassStatus.status == STATUS_BIDE) { return FALSE; } @@ -181,7 +181,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } case MOVE_LOCK_ON: case MOVE_MIND_READER: - if (pokemonInfo->moveStatus.moveStatus == STATUS_SURE_SHOT) + if (pokemonInfo->sureShotClassStatus.status == STATUS_SURE_SHOT) { return FALSE; } @@ -193,25 +193,25 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_ENDURE: - if (pokemonInfo->protection.protectionStatus == STATUS_ENDURING) + if (pokemonInfo->reflectClassStatus.status == STATUS_ENDURING) { return FALSE; } break; case MOVE_CHARGE: - if (pokemonInfo->charging.chargingStatus == STATUS_CHARGING) + if (pokemonInfo->bideClassStatus.status == STATUS_CHARGING) { return FALSE; } break; case MOVE_MIST: - if (pokemonInfo->protection.protectionStatus == STATUS_MIST) + if (pokemonInfo->reflectClassStatus.status == STATUS_MIST) { return FALSE; } break; case MOVE_LIGHT_SCREEN: - if (pokemonInfo->protection.protectionStatus == STATUS_LIGHT_SCREEN) + if (pokemonInfo->reflectClassStatus.status == STATUS_LIGHT_SCREEN) { return FALSE; } @@ -223,7 +223,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_INGRAIN: - if (pokemonInfo->immobilize.immobilizeStatus == STATUS_INGRAIN || pokemonInfo->maxHPStat / 2 < pokemonInfo->HP) + if (pokemonInfo->frozenClassStatus.status == STATUS_INGRAIN || pokemonInfo->maxHPStat / 2 < pokemonInfo->HP) { return FALSE; } @@ -242,7 +242,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) break; case MOVE_DOOM_DESIRE: case MOVE_FUTURE_SIGHT: - if (pokemonInfo->moveStatus.moveStatus == STATUS_SET_DAMAGE) + if (pokemonInfo->sureShotClassStatus.status == STATUS_SET_DAMAGE) { return FALSE; } @@ -266,19 +266,19 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_DESTINY_BOND: - if (pokemonInfo->linked.linkedStatus == STATUS_DESTINY_BOND) + if (pokemonInfo->linked.status == STATUS_DESTINY_BOND) { return FALSE; } break; case MOVE_MIRROR_COAT: - if (pokemonInfo->protection.protectionStatus == STATUS_MIRROR_COAT) + if (pokemonInfo->reflectClassStatus.status == STATUS_MIRROR_COAT) { return FALSE; } break; case MOVE_REFLECT: - if (pokemonInfo->protection.protectionStatus == STATUS_REFLECT) + if (pokemonInfo->reflectClassStatus.status == STATUS_REFLECT) { return FALSE; } @@ -290,14 +290,14 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_MAGIC_COAT: - if (pokemonInfo->protection.protectionStatus == STATUS_MAGIC_COAT) + if (pokemonInfo->reflectClassStatus.status == STATUS_MAGIC_COAT) { return FALSE; } break; case MOVE_DETECT: case MOVE_PROTECT: - if (pokemonInfo->protection.protectionStatus == STATUS_PROTECT) + if (pokemonInfo->reflectClassStatus.status == STATUS_PROTECT) { return FALSE; } @@ -321,19 +321,19 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_SAFEGUARD: - if (pokemonInfo->protection.protectionStatus == STATUS_SAFEGUARD) + if (pokemonInfo->reflectClassStatus.status == STATUS_SAFEGUARD) { return FALSE; } break; case MOVE_INVISIFY: - if (pokemonInfo->transformStatus.transformStatus == STATUS_INVISIBLE) + if (pokemonInfo->invisibleClassStatus.status == STATUS_INVISIBLE) { return FALSE; } break; case MOVE_FOCUS_ENERGY: - if (pokemonInfo->moveStatus.moveStatus == STATUS_FOCUS_ENERGY) + if (pokemonInfo->sureShotClassStatus.status == STATUS_FOCUS_ENERGY) { return FALSE; } @@ -432,13 +432,13 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_WISH: - if (pokemonInfo->isNotTeamMember || pokemonInfo->protection.protectionStatus == STATUS_WISH) + if (pokemonInfo->isNotTeamMember || pokemonInfo->reflectClassStatus.status == STATUS_WISH) { return FALSE; } break; case MOVE_TRANSFORM: - if (pokemonInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) + if (pokemonInfo->invisibleClassStatus.status == STATUS_TRANSFORMED) { return FALSE; } @@ -461,7 +461,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_SNATCH: - if (pokemonInfo->waitingStruct.waitingStatus == STATUS_SNATCH) + if (pokemonInfo->curseClassStatus.status == STATUS_SNATCH) { return FALSE; } @@ -483,7 +483,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_CONVERSION_2: - if (pokemonInfo->protection.protectionStatus == STATUS_CONVERSION2) + if (pokemonInfo->reflectClassStatus.status == STATUS_CONVERSION2) { return FALSE; } @@ -546,7 +546,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) EntityInfo *userData = GetEntInfo(user); EntityInfo *targetData = GetEntInfo(target); s32 i; - if (targetData->immobilize.immobilizeStatus == STATUS_FROZEN && MoveCannotHitFrozen(move)) + if (targetData->frozenClassStatus.status == STATUS_FROZEN && MoveCannotHitFrozen(move)) { return FALSE; } @@ -564,7 +564,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_YAWN: - if (targetData->sleep.sleep == STATUS_YAWNING) + if (targetData->sleepClassStatus.status == STATUS_YAWNING) { return FALSE; } @@ -574,7 +574,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_NIGHTMARE: - if (targetData->sleep.sleep == STATUS_NIGHTMARE) + if (targetData->sleepClassStatus.status == STATUS_NIGHTMARE) { return FALSE; } @@ -592,7 +592,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_ENCORE: - if (targetData->volatileStatus.volatileStatus == STATUS_ENCORE) + if (targetData->cringeClassStatus.status == STATUS_ENCORE) { return FALSE; } @@ -646,7 +646,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_SMOKESCREEN: - if (targetData->moveStatus.moveStatus == STATUS_WHIFFER) + if (targetData->sureShotClassStatus.status == STATUS_WHIFFER) { return FALSE; } @@ -659,7 +659,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_WILL_O_WISP: - if (targetData->nonVolatile.nonVolatileStatus == STATUS_BURN) + if (targetData->burnClassStatus.status == STATUS_BURN) { return FALSE; } @@ -682,7 +682,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) case MOVE_GLARE: case MOVE_STUN_SPORE: case MOVE_THUNDER_WAVE: - if (targetData->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) + if (targetData->burnClassStatus.status == STATUS_PARALYSIS) { return FALSE; } @@ -716,7 +716,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) case MOVE_BLOCK: case MOVE_MEAN_LOOK: case MOVE_SPIDER_WEB: - if (targetData->immobilize.immobilizeStatus == STATUS_SHADOW_HOLD) + if (targetData->frozenClassStatus.status == STATUS_SHADOW_HOLD) { return FALSE; } @@ -741,7 +741,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) break; } case MOVE_UPROAR: - if (targetData->sleep.sleep == STATUS_SLEEPLESS) + if (targetData->sleepClassStatus.status == STATUS_SLEEPLESS) { return FALSE; } @@ -774,7 +774,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_TAUNT: - if (targetData->volatileStatus.volatileStatus == STATUS_TAUNTED) + if (targetData->cringeClassStatus.status == STATUS_TAUNTED) { return FALSE; } @@ -809,7 +809,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) case MOVE_CURSE: if (MonsterIsType(user, TYPE_GHOST)) { - if (targetData->waitingStruct.waitingStatus == STATUS_CURSED) + if (targetData->curseClassStatus.status == STATUS_CURSED) { return FALSE; } @@ -825,7 +825,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) break; case MOVE_IMPRISON: case MOVE_OBSERVER: - if (targetData->volatileStatus.volatileStatus == STATUS_PAUSED) + if (targetData->cringeClassStatus.status == STATUS_PAUSED) { return FALSE; } @@ -837,7 +837,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_LEECH_SEED: - if (targetData->linked.linkedStatus == STATUS_LEECH_SEED) + if (targetData->linked.status == STATUS_LEECH_SEED) { return FALSE; } @@ -856,34 +856,34 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_ATTRACT: - if (targetData->volatileStatus.volatileStatus == STATUS_INFATUATED) + if (targetData->cringeClassStatus.status == STATUS_INFATUATED) { return FALSE; } break; case MOVE_WRAP: - if (targetData->immobilize.immobilizeStatus == STATUS_WRAP) + if (targetData->frozenClassStatus.status == STATUS_WRAP) { return FALSE; } - if (targetData->immobilize.immobilizeStatus == STATUS_WRAPPED) + if (targetData->frozenClassStatus.status == STATUS_WRAPPED) { return FALSE; } break; case MOVE_TOXIC: - if (targetData->nonVolatile.nonVolatileStatus == STATUS_BADLY_POISONED) + if (targetData->burnClassStatus.status == STATUS_BADLY_POISONED) { return FALSE; } break; case MOVE_POISON_GAS: case MOVE_POISONPOWDER: - if (targetData->nonVolatile.nonVolatileStatus == STATUS_POISONED) + if (targetData->burnClassStatus.status == STATUS_POISONED) { return FALSE; } - if (targetData->nonVolatile.nonVolatileStatus == STATUS_BADLY_POISONED) + if (targetData->burnClassStatus.status == STATUS_BADLY_POISONED) { return FALSE; } @@ -895,7 +895,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) case MOVE_SWEET_KISS: case MOVE_TEETER_DANCE: case MOVE_TOTTER: - if (targetData->volatileStatus.volatileStatus == STATUS_CONFUSED) + if (targetData->cringeClassStatus.status == STATUS_CONFUSED) { return FALSE; } diff --git a/src/move_effects_target.c b/src/move_effects_target.c index 34a43fb88..ec2624629 100644 --- a/src/move_effects_target.c +++ b/src/move_effects_target.c @@ -151,17 +151,17 @@ void sub_8075BA4(Entity *param_1, u8 param_2) { EntityInfo * entityInfo = GetEntInfo(param_1); - if ((param_2 != 0) && (entityInfo->volatileStatus.volatileStatus == STATUS_COWERING)) { + if ((param_2 != 0) && (entityInfo->cringeClassStatus.status == STATUS_COWERING)) { entityInfo->action.direction = (entityInfo->action.direction + 4) & DIRECTION_MASK; TargetTileInFront(param_1); } - else if (entityInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) { + else if (entityInfo->cringeClassStatus.status == STATUS_CONFUSED) { entityInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); TargetTileInFront(param_1); } } -u8 sub_8075BF4(Entity * pokemon, s32 sleepTurns) +u8 sub_8075BF4(Entity * pokemon, s32 sleepClassStatusTurns) { EntityInfo *entityInfo; u32 uVar4; @@ -174,18 +174,18 @@ u8 sub_8075BF4(Entity * pokemon, s32 sleepTurns) { entityInfo = GetEntInfo(pokemon); - if(entityInfo->sleep.sleep != STATUS_NIGHTMARE && entityInfo->sleep.sleep != STATUS_SLEEP) + if(entityInfo->sleepClassStatus.status != STATUS_NIGHTMARE && entityInfo->sleepClassStatus.status != STATUS_SLEEP) { - entityInfo->sleep.sleep = STATUS_SLEEP; - if ((sleepTurns != 0x7f) && HasAbility(pokemon, ABILITY_EARLY_BIRD) && - (sleepTurns = sleepTurns / 2, sleepTurns < 1)) { - sleepTurns = 1; + entityInfo->sleepClassStatus.status = STATUS_SLEEP; + if ((sleepClassStatusTurns != 0x7f) && HasAbility(pokemon, ABILITY_EARLY_BIRD) && + (sleepClassStatusTurns = sleepClassStatusTurns / 2, sleepClassStatusTurns < 1)) { + sleepClassStatusTurns = 1; } - entityInfo->sleep.sleepTurns = sleepTurns; + entityInfo->sleepClassStatus.turns = sleepClassStatusTurns; } - else if(entityInfo->sleep.sleep == STATUS_SLEEP) + else if(entityInfo->sleepClassStatus.status == STATUS_SLEEP) uVar4 = 1; - else if(entityInfo->sleep.sleep == STATUS_NIGHTMARE) + else if(entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE) uVar4 = 2; EntityUpdateStatusSprites(pokemon); } @@ -199,7 +199,7 @@ void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, u8 displayMessage if (!CannotSleep(pokemon,target,1,displayMessage)) { - sleep = GetEntInfo(target)->sleep.sleep; + sleep = GetEntInfo(target)->sleepClassStatus.status; if (sleep == STATUS_SLEEPLESS) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB380); @@ -265,19 +265,19 @@ void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns) hasNightmare = FALSE; if (!CannotSleep(pokemon, target, 1, TRUE)) { entityInfo = GetEntInfo(target); - if (entityInfo->sleep.sleep != STATUS_SLEEPLESS) { + if (entityInfo->sleepClassStatus.status != STATUS_SLEEPLESS) { sub_8041EC8(target); - if (entityInfo->sleep.sleep != STATUS_NIGHTMARE) { - entityInfo->sleep.sleepTurns = turns; - if ((HasAbility(target, ABILITY_EARLY_BIRD)) && (entityInfo->sleep.sleepTurns >>= 1, entityInfo->sleep.sleepTurns == 0)) { - entityInfo->sleep.sleepTurns = 1; + if (entityInfo->sleepClassStatus.status != STATUS_NIGHTMARE) { + entityInfo->sleepClassStatus.turns = turns; + if ((HasAbility(target, ABILITY_EARLY_BIRD)) && (entityInfo->sleepClassStatus.turns >>= 1, entityInfo->sleepClassStatus.turns == 0)) { + entityInfo->sleepClassStatus.turns = 1; } } else { hasNightmare = TRUE; } - entityInfo->sleep.sleep = STATUS_NIGHTMARE; + entityInfo->sleepClassStatus.status = STATUS_NIGHTMARE; sub_806CE68(target,8); if (hasNightmare) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3CC); @@ -302,19 +302,19 @@ void NappingStatusTarget(Entity * pokemon, Entity * target, s32 turns) isSleeping = FALSE; if (!CannotSleep(pokemon, target, 0, TRUE)) { entityInfo = GetEntInfo(target); - if (entityInfo->sleep.sleep != STATUS_SLEEPLESS) { + if (entityInfo->sleepClassStatus.status != STATUS_SLEEPLESS) { sub_8041ED8(target); - if (entityInfo->sleep.sleep == STATUS_NONE || entityInfo->sleep.sleep == STATUS_YAWNING) { - entityInfo->sleep.sleepTurns = turns; - if ((HasAbility(target, ABILITY_EARLY_BIRD)) && (entityInfo->sleep.sleepTurns >>= 1, entityInfo->sleep.sleepTurns == 0)) { - entityInfo->sleep.sleepTurns = 1; + if (entityInfo->sleepClassStatus.status == STATUS_NONE || entityInfo->sleepClassStatus.status == STATUS_YAWNING) { + entityInfo->sleepClassStatus.turns = turns; + if ((HasAbility(target, ABILITY_EARLY_BIRD)) && (entityInfo->sleepClassStatus.turns >>= 1, entityInfo->sleepClassStatus.turns == 0)) { + entityInfo->sleepClassStatus.turns = 1; } } else { isSleeping = TRUE; } - entityInfo->sleep.sleep = STATUS_NAPPING; + entityInfo->sleepClassStatus.status = STATUS_NAPPING; sub_806CE68(target, 8); if (isSleeping) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB360); @@ -339,21 +339,21 @@ void YawnedStatusTarget(Entity * pokemon, Entity * target, s32 turns) return; } entityInfo = GetEntInfo(target); - if (entityInfo->sleep.sleep == STATUS_NONE) { - entityInfo->sleep.sleep = STATUS_YAWNING; - entityInfo->sleep.sleepTurns = turns; + if (entityInfo->sleepClassStatus.status == STATUS_NONE) { + entityInfo->sleepClassStatus.status = STATUS_YAWNING; + entityInfo->sleepClassStatus.turns = turns; nullsub_91(target); sub_806CE68(target, 8); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3E0); } - else if (((entityInfo->sleep.sleep == STATUS_SLEEP) || (entityInfo->sleep.sleep == STATUS_NIGHTMARE)) || (entityInfo->sleep.sleep == STATUS_NAPPING)) { + else if (((entityInfo->sleepClassStatus.status == STATUS_SLEEP) || (entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE)) || (entityInfo->sleepClassStatus.status == STATUS_NAPPING)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB418); } - else if (entityInfo->sleep.sleep == STATUS_SLEEPLESS) { + else if (entityInfo->sleepClassStatus.status == STATUS_SLEEPLESS) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3F8); } else { - if (entityInfo->sleep.sleep == STATUS_YAWNING) + if (entityInfo->sleepClassStatus.status == STATUS_YAWNING) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB414); else TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3E0); @@ -372,15 +372,15 @@ void SleeplessStatusTarget(Entity * pokemon, Entity * target) } entityInfo = GetEntInfo(target); - if ((entityInfo->sleep.sleep == STATUS_SLEEP) || (entityInfo->sleep.sleep == STATUS_NAPPING) || (entityInfo->sleep.sleep == STATUS_NIGHTMARE)) { + if ((entityInfo->sleepClassStatus.status == STATUS_SLEEP) || (entityInfo->sleepClassStatus.status == STATUS_NAPPING) || (entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE)) { isAsleep = TRUE; } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); - if (entityInfo->sleep.sleep != STATUS_SLEEPLESS) + if (entityInfo->sleepClassStatus.status != STATUS_SLEEPLESS) { - entityInfo->sleep.sleep = STATUS_SLEEPLESS; - entityInfo->sleep.sleepTurns = CalculateStatusTurns(target, gUnknown_80F4E7C, FALSE) + 1; + entityInfo->sleepClassStatus.status = STATUS_SLEEPLESS; + entityInfo->sleepClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E7C, FALSE) + 1; entityInfo->unk165 = 0xFF; entityInfo->unk164 = 0xFF; sub_8041EE8(target); @@ -408,9 +408,9 @@ void PausedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, s32 turns return; } SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); - if (entityInfo->volatileStatus.volatileStatus != STATUS_PAUSED) { - entityInfo->volatileStatus.volatileStatus = STATUS_PAUSED; - entityInfo->volatileStatus.volatileStatusTurns = turns + 1; + if (entityInfo->cringeClassStatus.status != STATUS_PAUSED) { + entityInfo->cringeClassStatus.status = STATUS_PAUSED; + entityInfo->cringeClassStatus.turns = turns + 1; nullsub_72(target); if (turns == 1) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB480); @@ -448,9 +448,9 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa else { SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); - if (entityInfo->volatileStatus.volatileStatus != STATUS_INFATUATED) { - entityInfo->volatileStatus.volatileStatus = STATUS_INFATUATED; - entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F00,TRUE) + 1; + if (entityInfo->cringeClassStatus.status != STATUS_INFATUATED) { + entityInfo->cringeClassStatus.status = STATUS_INFATUATED; + entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4F00,TRUE) + 1; sub_8041EF8(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB50C); } @@ -501,11 +501,11 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis else { isNotBurned = TRUE; - if (entityInfo->nonVolatile.nonVolatileStatus != STATUS_BURN) { - entityInfo->nonVolatile.nonVolatileStatus = STATUS_BURN; - entityInfo->nonVolatile.nonVolatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E30,TRUE) + 1; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = 0; - entityInfo->nonVolatile.unk4 = 0; + if (entityInfo->burnClassStatus.status != STATUS_BURN) { + entityInfo->burnClassStatus.status = STATUS_BURN; + entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E30,TRUE) + 1; + entityInfo->burnClassStatus.damageCountdown = 0; + entityInfo->burnClassStatus.unk4 = 0; isNotBurned = FALSE; if (param_3 != 0) { sub_8041C34(target); @@ -587,14 +587,14 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag { isNotPoisoned = TRUE; - if(entityInfo->nonVolatile.nonVolatileStatus != STATUS_BADLY_POISONED) + if(entityInfo->burnClassStatus.status != STATUS_BADLY_POISONED) { - if(entityInfo->nonVolatile.nonVolatileStatus != STATUS_POISONED) + if(entityInfo->burnClassStatus.status != STATUS_POISONED) { - entityInfo->nonVolatile.nonVolatileStatus = STATUS_POISONED; - entityInfo->nonVolatile.nonVolatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E34,TRUE) + 1; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = 0; - entityInfo->nonVolatile.unk4 = 0; + entityInfo->burnClassStatus.status = STATUS_POISONED; + entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E34,TRUE) + 1; + entityInfo->burnClassStatus.damageCountdown = 0; + entityInfo->burnClassStatus.unk4 = 0; isNotPoisoned = FALSE; sub_8041C6C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB598); @@ -676,12 +676,12 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM { isNotBadlyPoisoned = TRUE; - if(entityInfo->nonVolatile.nonVolatileStatus != STATUS_BADLY_POISONED) + if(entityInfo->burnClassStatus.status != STATUS_BADLY_POISONED) { - entityInfo->nonVolatile.nonVolatileStatus = STATUS_BADLY_POISONED; - entityInfo->nonVolatile.nonVolatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E38,TRUE) + 1; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = 0; - entityInfo->nonVolatile.unk4 = 0; + entityInfo->burnClassStatus.status = STATUS_BADLY_POISONED; + entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E38,TRUE) + 1; + entityInfo->burnClassStatus.damageCountdown = 0; + entityInfo->burnClassStatus.unk4 = 0; isNotBadlyPoisoned = FALSE; sub_8041C7C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB5B4); @@ -734,7 +734,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); entityInfo = GetEntInfo(target); - if ((entityInfo->immobilize.immobilizeStatus != STATUS_FROZEN) && !HasSafeguardStatus(pokemon,target,displayMessage)) { + if ((entityInfo->frozenClassStatus.status != STATUS_FROZEN) && !HasSafeguardStatus(pokemon,target,displayMessage)) { if (HasAbility(target, ABILITY_MAGMA_ARMOR)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCDE0); @@ -755,13 +755,13 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) } else { - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP || entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (entityInfo->frozenClassStatus.status == STATUS_WRAP || entityInfo->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(entityInfo->unk9C); } sub_8041F08(target); - entityInfo->immobilize.immobilizeStatus = STATUS_FROZEN; - entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E2C,TRUE) + 1; - entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; + entityInfo->frozenClassStatus.status = STATUS_FROZEN; + entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E2C,TRUE) + 1; + entityInfo->frozenClassStatus.damageCountdown = 0; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB610); EntityUpdateStatusSprites(target); } @@ -778,19 +778,19 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s16 param_3, bool32 if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage_u8))) { entityInfo = GetEntInfo(target); - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP || entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (entityInfo->frozenClassStatus.status == STATUS_WRAP || entityInfo->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(entityInfo->unk9C); } - else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { + else if (entityInfo->frozenClassStatus.status == STATUS_INGRAIN) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->immobilize.immobilizeStatus != STATUS_CONSTRICTION) { - entityInfo->immobilize.immobilizeStatus = STATUS_CONSTRICTION; - entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E58,TRUE) + 1; - entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; - entityInfo->immobilize.unk4 = param_3_s32; + if (entityInfo->frozenClassStatus.status != STATUS_CONSTRICTION) { + entityInfo->frozenClassStatus.status = STATUS_CONSTRICTION; + entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E58,TRUE) + 1; + entityInfo->frozenClassStatus.damageCountdown = 0; + entityInfo->frozenClassStatus.unk4 = param_3_s32; nullsub_71(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB628); sub_806CE94(target,8); @@ -808,18 +808,18 @@ void ImmobilizedStatusTarget(Entity * pokemon, Entity * target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { entityInfo = GetEntInfo(target); - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP || entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (entityInfo->frozenClassStatus.status == STATUS_WRAP || entityInfo->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(entityInfo->unk9C); } - else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { + else if (entityInfo->frozenClassStatus.status == STATUS_INGRAIN) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->immobilize.immobilizeStatus != STATUS_SHADOW_HOLD) { - entityInfo->immobilize.immobilizeStatus = STATUS_SHADOW_HOLD; - entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E54,TRUE) + 1; - entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; + if (entityInfo->frozenClassStatus.status != STATUS_SHADOW_HOLD) { + entityInfo->frozenClassStatus.status = STATUS_SHADOW_HOLD; + entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E54,TRUE) + 1; + entityInfo->frozenClassStatus.damageCountdown = 0; nullsub_70(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB668); sub_806CE94(target,8); @@ -837,14 +837,14 @@ void IngrainedStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP || entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (entityInfo->frozenClassStatus.status == STATUS_WRAP || entityInfo->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(entityInfo->unk9C); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->immobilize.immobilizeStatus != STATUS_INGRAIN) { - entityInfo->immobilize.immobilizeStatus = STATUS_INGRAIN; - entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E60,TRUE) + 1; - entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; + if (entityInfo->frozenClassStatus.status != STATUS_INGRAIN) { + entityInfo->frozenClassStatus.status = STATUS_INGRAIN; + entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E60,TRUE) + 1; + entityInfo->frozenClassStatus.damageCountdown = 0; nullsub_90(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6A4); } @@ -871,16 +871,16 @@ void WrapTarget(Entity * pokemon, Entity * target) } pokemonEntityData = GetEntInfo(pokemon); targetEntityInfo = GetEntInfo(target); - if ((u8)(pokemonEntityData->immobilize.immobilizeStatus - 3U) > 1) { - if ((targetEntityInfo->immobilize.immobilizeStatus != STATUS_WRAP)) + if ((u8)(pokemonEntityData->frozenClassStatus.status - 3U) > 1) { + if ((targetEntityInfo->frozenClassStatus.status != STATUS_WRAP)) { - if(targetEntityInfo->immobilize.immobilizeStatus != STATUS_WRAPPED) { - pokemonEntityData->immobilize.immobilizeStatus = STATUS_WRAP; - pokemonEntityData->immobilize.immobilizeStatusTurns = 0x7f; - pokemonEntityData->immobilize.immobilizeStatusDamageCountdown = 0; - targetEntityInfo->immobilize.immobilizeStatus = STATUS_WRAPPED; - targetEntityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E5C, TRUE) + 1; - targetEntityInfo->immobilize.immobilizeStatusDamageCountdown = 0; + if(targetEntityInfo->frozenClassStatus.status != STATUS_WRAPPED) { + pokemonEntityData->frozenClassStatus.status = STATUS_WRAP; + pokemonEntityData->frozenClassStatus.turns = 0x7f; + pokemonEntityData->frozenClassStatus.damageCountdown = 0; + targetEntityInfo->frozenClassStatus.status = STATUS_WRAPPED; + targetEntityInfo->frozenClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E5C, TRUE) + 1; + targetEntityInfo->frozenClassStatus.damageCountdown = 0; iVar5 = &pokemonEntityData->unk9C; piVar3 = &gDungeon->unk37F4; *iVar5 = *piVar3; @@ -894,19 +894,19 @@ void WrapTarget(Entity * pokemon, Entity * target) } } } - if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAP) { + if (pokemonEntityData->frozenClassStatus.status == STATUS_WRAP) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); } - if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAP) { + if (targetEntityInfo->frozenClassStatus.status == STATUS_WRAP) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); } - if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (pokemonEntityData->frozenClassStatus.status == STATUS_WRAPPED) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); } - if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (targetEntityInfo->frozenClassStatus.status == STATUS_WRAPPED) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); } @@ -922,12 +922,12 @@ void sub_8076CB4(s32 param_1) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); if (entityInfo->unk9C == param_1) { - if ((u8)(entityInfo->immobilize.immobilizeStatus - 3U) < 2) { - entityInfo->immobilize.immobilizeStatus = STATUS_NONE; + if ((u8)(entityInfo->frozenClassStatus.status - 3U) < 2) { + entityInfo->frozenClassStatus.status = STATUS_NONE; } entityInfo->unk9C = 0; } @@ -946,19 +946,19 @@ void PetrifiedStatusTarget(Entity * pokemon, Entity * target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { sub_8041C08(target); targetEntityInfo = GetEntInfo(target); - if ((u8)(targetEntityInfo->immobilize.immobilizeStatus - 3U) < 2) { + if ((u8)(targetEntityInfo->frozenClassStatus.status - 3U) < 2) { sub_8076CB4(targetEntityInfo->unk9C); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (targetEntityInfo->immobilize.immobilizeStatus != STATUS_PETRIFIED) { - targetEntityInfo->immobilize.immobilizeStatus = STATUS_PETRIFIED; + if (targetEntityInfo->frozenClassStatus.status != STATUS_PETRIFIED) { + targetEntityInfo->frozenClassStatus.status = STATUS_PETRIFIED; if (targetEntityInfo->isTeamLeader) { - targetEntityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EBC,TRUE) + 1; + targetEntityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4EBC,TRUE) + 1; } else { - targetEntityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EC0,TRUE) + 1; + targetEntityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4EC0,TRUE) + 1; } - targetEntityInfo->immobilize.immobilizeStatusDamageCountdown = 0; + targetEntityInfo->frozenClassStatus.damageCountdown = 0; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7BC); } diff --git a/src/status.c b/src/status.c index 920d89ec7..e0c71b1b0 100644 --- a/src/status.c +++ b/src/status.c @@ -414,10 +414,10 @@ void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage) else { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if(entityInfo->volatileStatus.volatileStatus != STATUS_CRINGE) + if(entityInfo->cringeClassStatus.status != STATUS_CRINGE) { - entityInfo->volatileStatus.volatileStatus = STATUS_CRINGE; - entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E3C, TRUE) + 1; + entityInfo->cringeClassStatus.status = STATUS_CRINGE; + entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E3C, TRUE) + 1; sub_80420A0(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB2E0); } @@ -452,11 +452,11 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag bVar6 = TRUE; entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->nonVolatile.nonVolatileStatus != STATUS_PARALYSIS) { - entityInfo->nonVolatile.nonVolatileStatus = STATUS_PARALYSIS; - entityInfo->nonVolatile.nonVolatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E50,TRUE) + 1; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = 0; - entityInfo->nonVolatile.unk4 = 0; + if (entityInfo->burnClassStatus.status != STATUS_PARALYSIS) { + entityInfo->burnClassStatus.status = STATUS_PARALYSIS; + entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E50,TRUE) + 1; + entityInfo->burnClassStatus.damageCountdown = 0; + entityInfo->burnClassStatus.unk4 = 0; bVar6 = FALSE; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB2AC); sub_8041C1C(target); @@ -606,9 +606,9 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage { sub_8041BE8(target); entityInfo = GetEntInfo(target); - if (entityInfo->volatileStatus.volatileStatus != STATUS_CONFUSED) { - entityInfo->volatileStatus.volatileStatus = STATUS_CONFUSED; - entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E4C,TRUE) + 1; + if (entityInfo->cringeClassStatus.status != STATUS_CONFUSED) { + entityInfo->cringeClassStatus.status = STATUS_CONFUSED; + entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E4C,TRUE) + 1; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB25C); } else { @@ -626,9 +626,9 @@ void CowerStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->volatileStatus.volatileStatus != STATUS_COWERING) { - entityInfo->volatileStatus.volatileStatus = STATUS_COWERING; - entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ECC,TRUE) + 1; + if (entityInfo->cringeClassStatus.status != STATUS_COWERING) { + entityInfo->cringeClassStatus.status = STATUS_COWERING; + entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4ECC,TRUE) + 1; sub_8041BF8(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB940); } @@ -807,14 +807,14 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) } else { - switch(entityInfo->linked.linkedStatus) + switch(entityInfo->linked.status) { case STATUS_DESTINY_BOND: TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAA8C); default: - entityInfo->linked.linkedStatus = STATUS_LEECH_SEED; - entityInfo->linked.linkedStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EB0, TRUE) + 1; - entityInfo->linked.linkedStatusDamageCountdown = 0; + entityInfo->linked.status = STATUS_LEECH_SEED; + entityInfo->linked.turns = CalculateStatusTurns(target, gUnknown_80F4EB0, TRUE) + 1; + entityInfo->linked.damageCountdown = 0; nullsub_78(target); entityInfo->linked.unkD8 = 0xff; break; @@ -824,7 +824,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) } for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (pokemon == gDungeon->activeMonsterPtrs[index]) { + if (pokemon == gDungeon->activePokemon[index]) { entityInfo->linked.unkD8 = index; entityInfo2 = GetEntInfo(pokemon); entityInfo->linked.unkD4 = entityInfo2->unk98; @@ -847,14 +847,14 @@ void sub_8078084(Entity * pokemon) entityInfo = GetEntInfo(pokemon); for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - target = gDungeon->activeMonsterPtrs[index]; + target = gDungeon->activePokemon[index]; if (EntityExists(target)) { entityInfo2 = GetEntInfo(target); - if((u8)(entityInfo2->linked.linkedStatus - 1) <= 1) + if((u8)(entityInfo2->linked.status - 1) <= 1) { if(entityInfo2->linked.unkD4 == entityInfo->unk98) { - entityInfo2->linked.linkedStatus = STATUS_NONE; + entityInfo2->linked.status = STATUS_NONE; EntityUpdateStatusSprites(target); } } @@ -867,22 +867,22 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; EntityInfo *entityInfo2; s32 index; - u8 *linkedStatus; + u8 *status; s32 zero; if (((EntityExists(target)) && (GetEntityType(pokemon) == ENTITY_MONSTER)) && (GetEntityType(target) == ENTITY_MONSTER)) { entityInfo = GetEntInfo(pokemon); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); - linkedStatus = &entityInfo->linked.linkedStatus; - if (entityInfo->linked.linkedStatus != STATUS_DESTINY_BOND) + status = &entityInfo->linked.status; + if (entityInfo->linked.status != STATUS_DESTINY_BOND) { - if (entityInfo->linked.linkedStatus == STATUS_LEECH_SEED) + if (entityInfo->linked.status == STATUS_LEECH_SEED) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA79C); zero = 0; - *linkedStatus = STATUS_DESTINY_BOND; - entityInfo->linked.linkedStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EF0,TRUE) + 1; - entityInfo->linked.linkedStatusDamageCountdown = zero; + *status = STATUS_DESTINY_BOND; + entityInfo->linked.turns = CalculateStatusTurns(target,gUnknown_80F4EF0,TRUE) + 1; + entityInfo->linked.damageCountdown = zero; nullsub_74(target); entityInfo->linked.unkD8 = 0xff; } @@ -893,7 +893,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) } for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (target == gDungeon->activeMonsterPtrs[index]) { + if (target == gDungeon->activePokemon[index]) { entityInfo->linked.unkD8 = index; entityInfo2 = GetEntInfo(target); entityInfo->linked.unkD4 = entityInfo2->unk98; @@ -911,9 +911,9 @@ void SureShotStatusTarget(Entity *pokemon, Entity * target, s32 turns) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->moveStatus.moveStatus != STATUS_SURE_SHOT) { - entityInfo->moveStatus.moveStatus = STATUS_SURE_SHOT; - entityInfo->moveStatus.moveStatusTurns = turns + 1; + if (entityInfo->sureShotClassStatus.status != STATUS_SURE_SHOT) { + entityInfo->sureShotClassStatus.status = STATUS_SURE_SHOT; + entityInfo->sureShotClassStatus.turns = turns + 1; sub_8041CDC(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB73C); } @@ -931,9 +931,9 @@ void WhifferStatusTarget(Entity *pokemon, Entity * target, s32 turns) if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->moveStatus.moveStatus != STATUS_WHIFFER) { - entityInfo->moveStatus.moveStatus = STATUS_WHIFFER; - entityInfo->moveStatus.moveStatusTurns = turns + 1; + if (entityInfo->sureShotClassStatus.status != STATUS_WHIFFER) { + entityInfo->sureShotClassStatus.status = STATUS_WHIFFER; + entityInfo->sureShotClassStatus.turns = turns + 1; sub_8041CEC(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB780); } @@ -951,9 +951,9 @@ void FixedDamageStatusTarget(Entity *pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->moveStatus.moveStatus != STATUS_SET_DAMAGE) { - entityInfo->moveStatus.moveStatus = STATUS_SET_DAMAGE; - entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC4, FALSE) + 1; + if (entityInfo->sureShotClassStatus.status != STATUS_SET_DAMAGE) { + entityInfo->sureShotClassStatus.status = STATUS_SET_DAMAGE; + entityInfo->sureShotClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4EC4, FALSE) + 1; nullsub_79(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB8BC); } @@ -971,9 +971,9 @@ void FocusEnergyStatusTarget(Entity *pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->moveStatus.moveStatus != STATUS_FOCUS_ENERGY) { - entityInfo->moveStatus.moveStatus = STATUS_FOCUS_ENERGY; - entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC8, FALSE) + 1; + if (entityInfo->sureShotClassStatus.status != STATUS_FOCUS_ENERGY) { + entityInfo->sureShotClassStatus.status = STATUS_FOCUS_ENERGY; + entityInfo->sureShotClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4EC8, FALSE) + 1; nullsub_80(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB900); } @@ -996,36 +996,36 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { targetEntityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (targetEntityInfo->waitingStruct.waitingStatus == STATUS_DECOY) { + if (targetEntityInfo->curseClassStatus.status == STATUS_DECOY) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB994); } else { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if ((((EntityExists(entity)) && (target != entity)) && - (u8)(GetEntInfo(entity)->waitingStruct.waitingStatus - 2U) < 2)) { - SendWaitingEndMessage(pokemon,entity,STATUS_NONE); + (u8)(GetEntInfo(entity)->curseClassStatus.status - 2U) < 2)) { + EndCurseClassStatus(pokemon,entity,STATUS_NONE); sub_803E46C(0x2a); } } sub_8041D38(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (targetEntityInfo->waitingStruct.waitingStatus != STATUS_NONE) { - SendWaitingEndMessage(pokemon,target, STATUS_DECOY); + if (targetEntityInfo->curseClassStatus.status != STATUS_NONE) { + EndCurseClassStatus(pokemon,target, STATUS_DECOY); } - targetEntityInfo->waitingStruct.waitingStatus = STATUS_DECOY; - targetEntityInfo->waitingStruct.decoyApplierNonTeamMemberFlag = GetEntInfo(pokemon)->isNotTeamMember; - targetEntityInfo->waitingStruct.unkCA = param_3; - targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED0,TRUE) + 1; - targetEntityInfo->waitingStruct.curseDamageCountdown = 0; + targetEntityInfo->curseClassStatus.status = STATUS_DECOY; + targetEntityInfo->curseClassStatus.applierNonTeamMemberFlag = GetEntInfo(pokemon)->isNotTeamMember; + targetEntityInfo->curseClassStatus.unk2 = param_3; + targetEntityInfo->curseClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4ED0,TRUE) + 1; + targetEntityInfo->curseClassStatus.damageCountdown = 0; sub_806CCB4(target,sub_806CEBC(target)); gDungeon->decoyIsActive = TRUE; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB978); for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity2 = gDungeon->activeMonsterPtrs[index]; + entity2 = gDungeon->activePokemon[index]; if (EntityExists(entity2)) { entityInfo = GetEntInfo(entity2); entityInfo->aiTarget.aiObjective = AI_STAND_STILL; @@ -1058,17 +1058,17 @@ void CurseStatusTarget(Entity *pokemon, Entity * target) if (HasSafeguardStatus(pokemon,target, TRUE)) { return; } - SendWaitingEndMessage(pokemon,target,STATUS_CURSED); + EndCurseClassStatus(pokemon,target,STATUS_CURSED); sub_8041D48(target); HP = pokemonEntityData->HP / 2; pokemonEntityData->HP = HP; if (HP == 0) { pokemonEntityData->HP = 1; } - if (targetEntityInfo->waitingStruct.waitingStatus != STATUS_CURSED) { - targetEntityInfo->waitingStruct.waitingStatus = STATUS_CURSED; - targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EA4,TRUE) + 1; - targetEntityInfo->waitingStruct.curseDamageCountdown = 0; + if (targetEntityInfo->curseClassStatus.status != STATUS_CURSED) { + targetEntityInfo->curseClassStatus.status = STATUS_CURSED; + targetEntityInfo->curseClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4EA4,TRUE) + 1; + targetEntityInfo->curseClassStatus.damageCountdown = 0; } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB004); @@ -1090,22 +1090,22 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target) EntityInfo *targetEntityInfo; if (EntityExists(target)) { - SendWaitingEndMessage(pokemon,target,STATUS_SNATCH); + EndCurseClassStatus(pokemon,target,STATUS_SNATCH); for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; - if ((EntityExists(entity)) && (GetEntInfo(entity)->waitingStruct.waitingStatus == STATUS_SNATCH)) { - SendWaitingEndMessage(pokemon, entity, STATUS_NONE); + entity = gDungeon->activePokemon[index]; + if ((EntityExists(entity)) && (GetEntInfo(entity)->curseClassStatus.status == STATUS_SNATCH)) { + EndCurseClassStatus(pokemon, entity, STATUS_NONE); } } nullsub_81(target); targetEntityInfo = GetEntInfo(target); - if (targetEntityInfo->waitingStruct.waitingStatus != STATUS_SNATCH) { - targetEntityInfo->waitingStruct.waitingStatus = STATUS_SNATCH; - targetEntityInfo->waitingStruct.waitingStatusTurns= CalculateStatusTurns(target,gUnknown_80F4EA8,FALSE) + 1; - targetEntityInfo->waitingStruct.curseDamageCountdown = 0; + if (targetEntityInfo->curseClassStatus.status != STATUS_SNATCH) { + targetEntityInfo->curseClassStatus.status = STATUS_SNATCH; + targetEntityInfo->curseClassStatus.turns= CalculateStatusTurns(target,gUnknown_80F4EA8,FALSE) + 1; + targetEntityInfo->curseClassStatus.damageCountdown = 0; } gDungeon->snatchPokemon = target; @@ -1123,9 +1123,9 @@ void TauntStatusTarget(Entity * pokemon, Entity * target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->volatileStatus.volatileStatus != STATUS_TAUNTED) { - entityInfo->volatileStatus.volatileStatus = STATUS_TAUNTED; - entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED8,TRUE) + 1; + if (entityInfo->cringeClassStatus.status != STATUS_TAUNTED) { + entityInfo->cringeClassStatus.status = STATUS_TAUNTED; + entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4ED8,TRUE) + 1; nullsub_73(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9F0); } @@ -1163,13 +1163,13 @@ void InvisibleStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { targetEntityInfo = GetEntInfo(target); - if (targetEntityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) { + if (targetEntityInfo->invisibleClassStatus.status == STATUS_TRANSFORMED) { SendTransformEndMessage(pokemon,target); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (targetEntityInfo->transformStatus.transformStatus != STATUS_INVISIBLE) { - targetEntityInfo->transformStatus.transformStatus = STATUS_INVISIBLE; - targetEntityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EE4,FALSE) + 1; + if (targetEntityInfo->invisibleClassStatus.status != STATUS_INVISIBLE) { + targetEntityInfo->invisibleClassStatus.status = STATUS_INVISIBLE; + targetEntityInfo->invisibleClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4EE4,FALSE) + 1; sub_8041D84(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBA80); } @@ -1218,9 +1218,9 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target) } else { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (EntityInfo->volatileStatus.volatileStatus != STATUS_ENCORE) { - EntityInfo->volatileStatus.volatileStatus = STATUS_ENCORE; - EntityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EF4,TRUE) + 1; + if (EntityInfo->cringeClassStatus.status != STATUS_ENCORE) { + EntityInfo->cringeClassStatus.status = STATUS_ENCORE; + EntityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4EF4,TRUE) + 1; nullsub_83(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB94); } diff --git a/src/status_actions.c b/src/status_actions.c index b43d8805f..62587f497 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -315,7 +315,7 @@ bool8 sub_805B264(Entity * pokemon, Entity * target, Move *move, s32 param_4) gDungeon->unk181e8.unk18200 = gUnknown_8106A8C[r3]; gDungeon->unk181e8.unk18204 = 0; iVar5 = gUnknown_80F4F94[r3]; - if (entityInfo->charging.chargingStatus == STATUS_DIGGING) { + if (entityInfo->bideClassStatus.status == STATUS_DIGGING) { iVar5 *= 2; } r6 = sub_8055864(pokemon,target,move,iVar5,param_4) ? TRUE : FALSE; @@ -602,7 +602,7 @@ bool8 SkullBashMoveAction(Entity * pokemon, Entity * target, Move * move, s32 pa { bool8 flag; - if (MoveMatchesChargingStatus(pokemon,move)) { + if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F58,param_4) != 0 ? 1 : 0; sub_8079764(pokemon); } diff --git a/src/status_checks.c b/src/status_checks.c index 43b6893b7..f44553b64 100644 --- a/src/status_checks.c +++ b/src/status_checks.c @@ -29,14 +29,14 @@ bool8 HasStatusThatPreventsActing(Entity *pokemon) EntityInfo *pokemonInfo = GetEntInfo(pokemon); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); - switch (pokemonInfo->sleep.sleep) + switch (pokemonInfo->sleepClassStatus.status) { case STATUS_NIGHTMARE: case STATUS_SLEEP: case STATUS_NAPPING: return TRUE; } - switch (pokemonInfo->immobilize.immobilizeStatus) + switch (pokemonInfo->frozenClassStatus.status) { case STATUS_FROZEN: LogMessageByIdWithPopupCheckUser(pokemon, *gPtrFrozenMessage); @@ -50,7 +50,7 @@ bool8 HasStatusThatPreventsActing(Entity *pokemon) case STATUS_PETRIFIED: return TRUE; } - switch (pokemonInfo->volatileStatus.volatileStatus) + switch (pokemonInfo->cringeClassStatus.status) { case STATUS_PAUSED: LogMessageByIdWithPopupCheckUser(pokemon, *gPtrPausedMessage); @@ -59,12 +59,12 @@ bool8 HasStatusThatPreventsActing(Entity *pokemon) LogMessageByIdWithPopupCheckUser(pokemon, *gPtrInfatuatedMessage); return TRUE; } - if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) + if (pokemonInfo->bideClassStatus.status == STATUS_BIDE) { LogMessageByIdWithPopupCheckUser(pokemon, *gPtrBideMessage); return TRUE; } - if (pokemonInfo->waitingStruct.waitingStatus == STATUS_DECOY) + if (pokemonInfo->curseClassStatus.status == STATUS_DECOY) { SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); pokemonInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); @@ -76,7 +76,7 @@ bool8 HasStatusThatPreventsActing(Entity *pokemon) { return TRUE; } - if (pokemonInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER) + if (pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER) { if (!CanMoveInDirection(pokemon, pokemonInfo->action.direction)) { @@ -96,7 +96,7 @@ bool8 HasStatusThatPreventsActing(Entity *pokemon) ChooseAIMove(pokemon); return TRUE; } - if (pokemonInfo->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED) + if (pokemonInfo->blinkerClassStatus.status == STATUS_CROSS_EYED) { SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); pokemonInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); @@ -119,7 +119,7 @@ bool8 sub_80701A4(Entity *pokemon) flag = FALSE; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); - switch(pokemonInfo->sleep.sleep) + switch(pokemonInfo->sleepClassStatus.status) { case STATUS_SLEEP: case STATUS_NIGHTMARE: @@ -128,7 +128,7 @@ bool8 sub_80701A4(Entity *pokemon) return TRUE; } - switch(pokemonInfo->immobilize.immobilizeStatus) + switch(pokemonInfo->frozenClassStatus.status) { case STATUS_FROZEN: LogMessageByIdWithPopupCheckUser(pokemon,*gPtrFrozenMessage); @@ -143,7 +143,7 @@ bool8 sub_80701A4(Entity *pokemon) return TRUE; } - switch(pokemonInfo->volatileStatus.volatileStatus) { + switch(pokemonInfo->cringeClassStatus.status) { case STATUS_CONFUSED: flag = TRUE; goto _0807026C; @@ -158,19 +158,19 @@ bool8 sub_80701A4(Entity *pokemon) case STATUS_CRINGE: case 8: _0807026C: - if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) { + if (pokemonInfo->bideClassStatus.status == STATUS_BIDE) { LogMessageByIdWithPopupCheckUser(pokemon,*gPtrBideMessage); return TRUE; } - else if (((pokemonInfo->charging.chargingStatus != STATUS_NONE) && (pokemonInfo->charging.chargingStatus != STATUS_CHARGING)) && (pokemonInfo->charging.chargingStatus != STATUS_ENRAGED)) { + else if (((pokemonInfo->bideClassStatus.status != STATUS_NONE) && (pokemonInfo->bideClassStatus.status != STATUS_CHARGING)) && (pokemonInfo->bideClassStatus.status != STATUS_ENRAGED)) { if (flag) { LogMessageByIdWithPopupCheckUser(pokemon,*gPtrMoveInterruptedMessage); } else { for(index = 0, move = pokemonInfo->moves.moves; index < MAX_MON_MOVES; move++, index++) { if ((move->moveFlags & MOVE_FLAG_EXISTS) && - (MoveMatchesChargingStatus(pokemon,move)) && - (pokemonInfo->charging.chargingStatusMoveIndex == index)) { + (MoveMatchesBideClassStatus(pokemon,move)) && + (pokemonInfo->bideClassStatus.moveSlot == index)) { SetMonsterActionFields(&pokemonInfo->action, ACTION_USE_MOVE_PLAYER); index_1 = index; r7 = &pokemonInfo->action.unk4[1].actionUseIndex; diff --git a/src/status_checks_1.c b/src/status_checks_1.c index 89efecdce..f958d1afc 100644 --- a/src/status_checks_1.c +++ b/src/status_checks_1.c @@ -59,14 +59,14 @@ void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum) { if (((gDungeon->unk181e8.blinded || gDungeon->unk181e8.hallucinating) || - (param_2->transformStatus.transformStatus == STATUS_INVISIBLE)) && + (param_2->invisibleClassStatus.status == STATUS_INVISIBLE)) && (param_2->isNotTeamMember)) { strcpy(buffer, *gUnknown_80F8988); } else { - if (param_2->waitingStruct.waitingStatus == STATUS_DECOY) { + if (param_2->curseClassStatus.status == STATUS_DECOY) { strcpy(buffer, *gUnknown_80F8968); } else @@ -88,7 +88,7 @@ void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum) void sub_8070968(u8 *buffer, EntityInfo *entityInfo, s32 colorNum) { - if (entityInfo->waitingStruct.waitingStatus == STATUS_DECOY) { + if (entityInfo->curseClassStatus.status == STATUS_DECOY) { sprintfStatic(buffer, gUnknown_8106FA4, colorNum + 0x30, *gUnknown_80F8974); } else if (entityInfo->isNotTeamMember) { @@ -103,14 +103,14 @@ void sub_80709C8(u8 *buffer, EntityInfo *entityInfo) { if (((gDungeon->unk181e8.blinded || gDungeon->unk181e8.hallucinating) || - (entityInfo->transformStatus.transformStatus == STATUS_INVISIBLE)) && + (entityInfo->invisibleClassStatus.status == STATUS_INVISIBLE)) && (entityInfo->isNotTeamMember)) { strcpy(buffer, *gUnknown_80F8994); } else { - if (entityInfo->waitingStruct.waitingStatus == STATUS_DECOY) { + if (entityInfo->curseClassStatus.status == STATUS_DECOY) { strcpy(buffer, *gUnknown_80F8974); } else @@ -130,18 +130,18 @@ bool8 HasNegativeStatus(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); s32 i; - if (pokemonInfo->sleep.sleep == STATUS_SLEEP || - pokemonInfo->sleep.sleep == STATUS_NIGHTMARE || - pokemonInfo->sleep.sleep == STATUS_YAWNING || - pokemonInfo->nonVolatile.nonVolatileStatus != STATUS_NONE || - (pokemonInfo->immobilize.immobilizeStatus != STATUS_INGRAIN && pokemonInfo->immobilize.immobilizeStatus != STATUS_NONE) || - pokemonInfo->volatileStatus.volatileStatus != STATUS_NONE || - pokemonInfo->waitingStruct.waitingStatus == STATUS_CURSED || - pokemonInfo->waitingStruct.waitingStatus == STATUS_DECOY || - pokemonInfo->linked.linkedStatus == STATUS_LEECH_SEED || - pokemonInfo->moveStatus.moveStatus == STATUS_WHIFFER || - pokemonInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER || - pokemonInfo->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED || + if (pokemonInfo->sleepClassStatus.status == STATUS_SLEEP || + pokemonInfo->sleepClassStatus.status == STATUS_NIGHTMARE || + pokemonInfo->sleepClassStatus.status == STATUS_YAWNING || + pokemonInfo->burnClassStatus.status != STATUS_NONE || + (pokemonInfo->frozenClassStatus.status != STATUS_INGRAIN && pokemonInfo->frozenClassStatus.status != STATUS_NONE) || + pokemonInfo->cringeClassStatus.status != STATUS_NONE || + pokemonInfo->curseClassStatus.status == STATUS_CURSED || + pokemonInfo->curseClassStatus.status == STATUS_DECOY || + pokemonInfo->linked.status == STATUS_LEECH_SEED || + pokemonInfo->sureShotClassStatus.status == STATUS_WHIFFER || + pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER || + pokemonInfo->blinkerClassStatus.status == STATUS_CROSS_EYED || pokemonInfo->muzzled.muzzled == TRUE || pokemonInfo->exposed || pokemonInfo->perishSongTurns != 0) @@ -168,9 +168,9 @@ bool8 HasNegativeStatus(Entity *pokemon) bool8 IsSleeping(Entity *pokemon) { - if (GetEntInfo(pokemon)->sleep.sleep != STATUS_SLEEP && - GetEntInfo(pokemon)->sleep.sleep != STATUS_NAPPING && - GetEntInfo(pokemon)->sleep.sleep != STATUS_NIGHTMARE) + if (GetEntInfo(pokemon)->sleepClassStatus.status != STATUS_SLEEP && + GetEntInfo(pokemon)->sleepClassStatus.status != STATUS_NAPPING && + GetEntInfo(pokemon)->sleepClassStatus.status != STATUS_NIGHTMARE) { return FALSE; } diff --git a/src/tile_types.c b/src/tile_types.c index a4ff0bd23..e2394e43b 100644 --- a/src/tile_types.c +++ b/src/tile_types.c @@ -145,7 +145,7 @@ bool8 sub_804AD34(Position *pos) if (iVar8 != 0) { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { sub_806CF98(entity); } @@ -206,7 +206,7 @@ void sub_804AE84(Position *pos) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { sub_806CF98(entity); } diff --git a/src/trap_1.c b/src/trap_1.c index 1d0fb49d4..3802291c6 100644 --- a/src/trap_1.c +++ b/src/trap_1.c @@ -54,20 +54,20 @@ void SaveSpeedStage(unkStruct_8094924 *param_1, s32 param_2); void sub_8081854(unkStruct_8094924 *param_1, s32 param_2); void sub_808183C(unkStruct_8094924 *param_1, s32 param_2); void SaveMuzzledStatus(unkStruct_8094924 *param_1, Muzzled *param_2); -void SaveEyesightStatus(unkStruct_8094924 *param_1, EyesightStatus *param_2); -void SaveTransformStatus(unkStruct_8094924 *param_1, TransformStatus *param_2); -void SaveItemStatus(unkStruct_8094924 *param_1, ItemStatus *param_2); -void SaveMoveStatus(unkStruct_8094924 *param_1, MoveStatus* param_2); -void SaveLinkedStatus(unkStruct_8094924 *param_1, Linked *param_2); -void SaveVolatileStatus(unkStruct_8094924 *param_1, Volatile *param_2); -void SaveImmobilizeStatus(unkStruct_8094924 *param_1, Immobilize *param_2); -void SaveNonVolatileStatus(unkStruct_8094924 *param_1, NonVolatile *param_2); -void SaveEntitySleep(unkStruct_8094924 *param_1, Sleep* param_2); +void SaveBlinkerClassStatus(unkStruct_8094924 *param_1, BlinkerClassStatus *param_2); +void SaveInvisibleClassStatus(unkStruct_8094924 *param_1, InvisibleClassStatus *param_2); +void SaveLongTossClassStatus(unkStruct_8094924 *param_1, LongTossClassStatus *param_2); +void SaveSureShotClassStatus(unkStruct_8094924 *param_1, SureShotClassStatus* param_2); +void SaveLeechSeedClassStatus(unkStruct_8094924 *param_1, LeechSeedClassStatus *param_2); +void SaveCringeClassStatus(unkStruct_8094924 *param_1, CringeClassStatus *param_2); +void SaveFrozenClassStatus(unkStruct_8094924 *param_1, FrozenClassStatus *param_2); +void SaveBurnClassStatus(unkStruct_8094924 *param_1, BurnClassStatus *param_2); +void SaveSleepClassStatus(unkStruct_8094924 *param_1, SleepClassStatus* param_2); void SaveTactic(unkStruct_8094924 *param_1, u8 param_2); void SaveDungeonHiddenPower(unkStruct_8094924 *param_1, HiddenPower *param_2); -void SaveChargingStatus(unkStruct_8094924 *param_1, Charging *param_2); -void SaveProtectionStatus(unkStruct_8094924 *param_1, Protection *param_2); -void SaveWaitingStatus(unkStruct_8094924 *param_1, Waiting *param_2); +void SaveBideClassStatus(unkStruct_8094924 *param_1, BideClassStatus *param_2); +void SaveReflectClassStatus(unkStruct_8094924 *param_1, ReflectClassStatus *param_2); +void SaveCurseClassStatus(unkStruct_8094924 *param_1, CurseClassStatus *param_2); void SaveSpeedCounters(unkStruct_8094924 *param_1, u8 *speedCounters, u32 numCounters); void SaveClientType(unkStruct_8094924 *param_1, u8 param_2); void sub_80421C0(Entity *, u16); @@ -270,18 +270,18 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) u32 *puStack_98; u32 *puStack_94; u8 *puStack_90; - Sleep *puStack_8c; - NonVolatile *puStack_88; - Immobilize *puStack_84; - Volatile *puStack_80; - Charging *puStack_7c; - Protection *puStack_78; - Waiting *puStack_74; - Linked *puStack_70; - MoveStatus *puStack_6c; - ItemStatus *puStack_68; - TransformStatus *puStack_64; - EyesightStatus *puStack_60; + SleepClassStatus *puStack_8c; + BurnClassStatus *puStack_88; + FrozenClassStatus *puStack_84; + CringeClassStatus *puStack_80; + BideClassStatus *puStack_7c; + ReflectClassStatus *puStack_78; + CurseClassStatus *puStack_74; + LeechSeedClassStatus *puStack_70; + SureShotClassStatus *puStack_6c; + LongTossClassStatus *puStack_68; + InvisibleClassStatus *puStack_64; + BlinkerClassStatus *puStack_60; Muzzled *pbStack_5c; bool8 *pbStack_58; bool8 *pbStack_54; @@ -364,18 +364,18 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) puStack_9c = &info->unk98; puStack_98 = &info->unk9C; puStack_94 = &info->unkA0; - puStack_8c = &info->sleep; - puStack_88 = &info->nonVolatile; - puStack_84 = &info->immobilize; - puStack_80 = &info->volatileStatus; - puStack_7c = &info->charging; - puStack_78 = &info->protection; - puStack_74 = &info->waitingStruct; + puStack_8c = &info->sleepClassStatus; + puStack_88 = &info->burnClassStatus; + puStack_84 = &info->frozenClassStatus; + puStack_80 = &info->cringeClassStatus; + puStack_7c = &info->bideClassStatus; + puStack_78 = &info->reflectClassStatus; + puStack_74 = &info->curseClassStatus; puStack_70 = &info->linked; - puStack_6c = &info->moveStatus; - puStack_68 = &info->itemStatus; - puStack_64 = &info->transformStatus; - puStack_60 = &info->eyesightStatus; + puStack_6c = &info->sureShotClassStatus; + puStack_68 = &info->longTossClassStatus; + puStack_64 = &info->invisibleClassStatus; + puStack_60 = &info->blinkerClassStatus; pbStack_5c = &info->muzzled; pbStack_58 = &info->powerEars; pbStack_54 = &info->scanning; @@ -408,18 +408,18 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) sub_8083078(param_1,*puStack_9c); sub_8083078(param_1,*puStack_98); sub_8083078(param_1,*puStack_94); - SaveEntitySleep(param_1,puStack_8c); - SaveNonVolatileStatus(param_1,puStack_88); - SaveImmobilizeStatus(param_1,puStack_84); - SaveVolatileStatus(param_1,puStack_80); - SaveChargingStatus(param_1,puStack_7c); - SaveProtectionStatus(param_1,puStack_78); - SaveWaitingStatus(param_1,puStack_74); - SaveLinkedStatus(param_1,puStack_70); - SaveMoveStatus(param_1,puStack_6c); - SaveItemStatus(param_1,puStack_68); - SaveTransformStatus(param_1,puStack_64); - SaveEyesightStatus(param_1,puStack_60); + SaveSleepClassStatus(param_1,puStack_8c); + SaveBurnClassStatus(param_1,puStack_88); + SaveFrozenClassStatus(param_1,puStack_84); + SaveCringeClassStatus(param_1,puStack_80); + SaveBideClassStatus(param_1,puStack_7c); + SaveReflectClassStatus(param_1,puStack_78); + SaveCurseClassStatus(param_1,puStack_74); + SaveLeechSeedClassStatus(param_1,puStack_70); + SaveSureShotClassStatus(param_1,puStack_6c); + SaveLongTossClassStatus(param_1,puStack_68); + SaveInvisibleClassStatus(param_1,puStack_64); + SaveBlinkerClassStatus(param_1,puStack_60); SaveMuzzledStatus(param_1,pbStack_5c); sub_80830B4(param_1,*pbStack_58); sub_80830B4(param_1,*pbStack_54); @@ -646,92 +646,92 @@ void SaveAITargetStatus(unkStruct_8094924 *param_1, AITarget* param_2) SavePosition(param_1, ¶m_2->aiTargetPos); } -void SaveEntitySleep(unkStruct_8094924 *param_1, Sleep* param_2) +void SaveSleepClassStatus(unkStruct_8094924 *param_1, SleepClassStatus* param_2) { - sub_8082FA8(param_1, ¶m_2->sleep, 1); - sub_8083060(param_1, param_2->sleepTurns); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); } -void SaveNonVolatileStatus(unkStruct_8094924 *param_1, NonVolatile *param_2) +void SaveBurnClassStatus(unkStruct_8094924 *param_1, BurnClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->nonVolatileStatus, 1); - sub_8083060(param_1, param_2->nonVolatileStatusTurns); - sub_8083060(param_1, param_2->nonVolatileStatusDamageCountdown); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); + sub_8083060(param_1, param_2->damageCountdown); sub_8083060(param_1, param_2->unk4); } -void SaveImmobilizeStatus(unkStruct_8094924 *param_1, Immobilize *param_2) +void SaveFrozenClassStatus(unkStruct_8094924 *param_1, FrozenClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->immobilizeStatus, 1); - sub_8083060(param_1, param_2->immobilizeStatusTurns); - sub_8083060(param_1, param_2->immobilizeStatusDamageCountdown); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); + sub_8083060(param_1, param_2->damageCountdown); sub_8083078(param_1, param_2->unk4); } -void SaveVolatileStatus(unkStruct_8094924 *param_1, Volatile *param_2) +void SaveCringeClassStatus(unkStruct_8094924 *param_1, CringeClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->volatileStatus, 1); - sub_8083060(param_1, param_2->volatileStatusTurns); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); } -void SaveChargingStatus(unkStruct_8094924 *param_1, Charging *param_2) +void SaveBideClassStatus(unkStruct_8094924 *param_1, BideClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->chargingStatus, 1); - sub_8083060(param_1, param_2->chargingStatusTurns); - sub_8083060(param_1, param_2->chargingStatusMoveIndex); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); + sub_8083060(param_1, param_2->moveSlot); } -void SaveProtectionStatus(unkStruct_8094924 *param_1, Protection *param_2) +void SaveReflectClassStatus(unkStruct_8094924 *param_1, ReflectClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->protectionStatus, 1); - sub_8083060(param_1, param_2->protectionStatusTurns); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); } -void SaveWaitingStatus(unkStruct_8094924 *param_1, Waiting *param_2) +void SaveCurseClassStatus(unkStruct_8094924 *param_1, CurseClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->waitingStatus, 1); - sub_80830B4(param_1, param_2->decoyApplierNonTeamMemberFlag); - sub_80830B4(param_1, param_2->unkCA); - sub_8083060(param_1, param_2->waitingStatusTurns); - sub_8083060(param_1, param_2->curseDamageCountdown); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_80830B4(param_1, param_2->applierNonTeamMemberFlag); + sub_80830B4(param_1, param_2->unk2); + sub_8083060(param_1, param_2->turns); + sub_8083060(param_1, param_2->damageCountdown); } -void SaveLinkedStatus(unkStruct_8094924 *param_1, Linked *param_2) +void SaveLeechSeedClassStatus(unkStruct_8094924 *param_1, LeechSeedClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->linkedStatus, 1); + sub_8082FA8(param_1, ¶m_2->status, 1); sub_8083078(param_1, param_2->unkD4); sub_8083060(param_1, param_2->unkD8); - sub_8083060(param_1, param_2->linkedStatusTurns); - sub_8083060(param_1, param_2->linkedStatusDamageCountdown); + sub_8083060(param_1, param_2->turns); + sub_8083060(param_1, param_2->damageCountdown); } -void SaveMoveStatus(unkStruct_8094924 *param_1, MoveStatus* param_2) +void SaveSureShotClassStatus(unkStruct_8094924 *param_1, SureShotClassStatus* param_2) { - sub_8082FA8(param_1, ¶m_2->moveStatus, 1); - sub_8083060(param_1, param_2->moveStatusTurns); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); } -void SaveItemStatus(unkStruct_8094924 *param_1, ItemStatus *param_2) +void SaveLongTossClassStatus(unkStruct_8094924 *param_1, LongTossClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->itemStatus, 1); + sub_8082FA8(param_1, ¶m_2->status, 1); } -void SaveTransformStatus(unkStruct_8094924 *param_1, TransformStatus *param_2) +void SaveInvisibleClassStatus(unkStruct_8094924 *param_1, InvisibleClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->transformStatus, 1); - sub_8083060(param_1, param_2->transformStatusTurns); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); } -void SaveEyesightStatus(unkStruct_8094924 *param_1, EyesightStatus *param_2) +void SaveBlinkerClassStatus(unkStruct_8094924 *param_1, BlinkerClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->eyesightStatus, 1); - sub_8083060(param_1, param_2->eyesightStatusTurns); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); } void SaveMuzzledStatus(unkStruct_8094924 *param_1, Muzzled *param_2) { sub_8082FA8(param_1, ¶m_2->muzzled, 1); - sub_8083060(param_1, param_2->muzzledTurns); + sub_8083060(param_1, param_2->turns); } void SaveEntityMove(unkStruct_8094924 *r0, Move *r1) diff --git a/src/type_effectiveness.c b/src/type_effectiveness.c index a22bef924..9f5f57f7b 100644 --- a/src/type_effectiveness.c +++ b/src/type_effectiveness.c @@ -237,7 +237,7 @@ bool8 sub_806E100(unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u gDungeon->unk134.fill16E[8] = TRUE; F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); } - if ((type == TYPE_ELECTRIC) && (pokemonInfo->charging.chargingStatus == STATUS_CHARGING)) { + if ((type == TYPE_ELECTRIC) && (pokemonInfo->bideClassStatus.status == STATUS_CHARGING)) { gDungeon->unk134.fill16E[9] = TRUE; F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); } @@ -394,7 +394,7 @@ s32 WeightWeakTypePicker(Entity *user, Entity *target, u8 moveType) { return 2; } - if (moveType == TYPE_ELECTRIC && userData->charging.chargingStatus == STATUS_CHARGING) + if (moveType == TYPE_ELECTRIC && userData->bideClassStatus.status == STATUS_CHARGING) { weight *= 2; } From 8710494e40c766dc321e7f6dd08e15e451d11c6f Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Tue, 5 Nov 2024 16:47:52 +0100 Subject: [PATCH 37/48] Fix asmdiff without devkitARM --- asmdiff.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/asmdiff.sh b/asmdiff.sh index 886d54f3f..f9c776291 100755 --- a/asmdiff.sh +++ b/asmdiff.sh @@ -1,6 +1,10 @@ #!/bin/bash -OBJDUMP_BIN="arm-none-eabi-objdump" +if [[ -n "$DEVKITARM" ]]; then + OBJDUMP_BIN="$DEVKITARM/bin/arm-none-eabi-objdump" +else + OBJDUMP_BIN="arm-none-eabi-objdump" +fi OBJDUMP="$OBJDUMP_BIN -D -bbinary -marmv4t -Mforce-thumb" From 56d2e0db9a0c7888b9d2d1297873d9ed5d481320 Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Thu, 7 Nov 2024 11:14:54 +0100 Subject: [PATCH 38/48] Gitignore symbol dumps --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6af167552..9f69537f7 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ build/ *.ss[0-9] *.pyc __pycache__/ +*.syms From 2e61c49bdf53c2d8838b1d9400f2955598d42e08 Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Thu, 7 Nov 2024 11:16:47 +0100 Subject: [PATCH 39/48] Rename 8-byte fixpoint --- include/math.h | 18 +-- include/number_util.h | 12 +- src/code_806E8B0.c | 48 +++---- src/code_8073CF0.c | 10 +- src/math.c | 284 +++++++++++++++++++-------------------- src/number_util.c | 6 +- src/type_effectiveness.c | 24 ++-- tmp/fixpoint.cocci | 17 +++ 8 files changed, 218 insertions(+), 201 deletions(-) create mode 100644 tmp/fixpoint.cocci diff --git a/include/math.h b/include/math.h index 243e67539..d2fe2bd1e 100644 --- a/include/math.h +++ b/include/math.h @@ -50,16 +50,16 @@ s32 sin_4096(s32 x); */ s24_8 s24_8_mul(s24_8 x, s24_8 y); -bool8 F48_16_IsZero(unkStruct_80943A8 *a); -void F48_16_SDiv(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b); -void F48_16_SMul(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b); +bool8 F48_16_IsZero(s48_16 *a); +void F48_16_SDiv(s48_16 *dst, s48_16 *a, s48_16 *b); +void F48_16_SMul(s48_16 *dst, s48_16 *a, s48_16 *b); s32 sub_8009FB8(s32 x, s32 y); -void sub_800A020(unkStruct_80943A8 *dst, u32); -u32 sub_800A048(unkStruct_80943A8 *a); -void sub_800A088(unkStruct_80943A8 *a, s32 b); -bool8 sub_800A2F0(unkStruct_80943A8 *a, unkStruct_80943A8 *b); -void sub_800A6D0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b); -void sub_800A6F0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b); +void sub_800A020(s48_16 *dst, u32); +u32 sub_800A048(s48_16 *a); +void sub_800A088(s48_16 *a, s32 b); +bool8 sub_800A2F0(s48_16 *a, s48_16 *b); +void sub_800A6D0(s48_16 *dst, s48_16 *a, s48_16 *b); +void sub_800A6F0(s48_16 *dst, s48_16 *a, s48_16 *b); #endif // GUARD_MATH_H diff --git a/include/number_util.h b/include/number_util.h index 468aae34b..b835a5fcb 100644 --- a/include/number_util.h +++ b/include/number_util.h @@ -7,11 +7,11 @@ typedef struct FixedPoint s16 unk2; } FixedPoint; -typedef struct unkStruct_80943A8 +typedef struct s48_16 { - s32 s0; - u32 s4; // some math.c funcs require this to be a u32, but other funcs check if it's negative (aka >= INT32_MAX) -} unkStruct_80943A8; + s32 hi; + u32 lo; // some math.c funcs require this to be a u32, but other funcs check if it's negative (aka >= INT32_MAX) +} s48_16; FixedPoint FixedPoint_Add(FixedPoint a, FixedPoint b); FixedPoint FixedPoint_Subtract(FixedPoint a, FixedPoint b); @@ -19,8 +19,8 @@ FixedPoint FixedPoint_Min(FixedPoint a, FixedPoint b); FixedPoint FixedPoint_Max(FixedPoint a, FixedPoint b); FixedPoint sub_8094370(FixedPoint param_1, FixedPoint param_2); FixedPoint IntToFixedPoint(s32 a); -FixedPoint FixedPoint_SetFromUnk(unkStruct_80943A8* param_1); +FixedPoint FixedPoint_SetFromUnk(s48_16* param_1); FixedPoint FixedPoint_Div(FixedPoint a, FixedPoint b); s32 FixedPointToInt(FixedPoint a); // Always rounded up -#endif \ No newline at end of file +#endif diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index 7d0a8051c..a747c92fa 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -28,7 +28,7 @@ void sub_80428B0(Entity *r0); void sub_80428C4(Entity *r0); extern void sub_806F500(void); -extern bool8 sub_806E100(struct unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u8 type, struct DamageStruct *dmgStruct); +extern bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, struct DamageStruct *dmgStruct); extern void sub_8041B74(Entity *pokemon); extern void sub_8041B5C(Entity *pokemon); extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC); @@ -44,10 +44,10 @@ extern const s16 gUnknown_810AC68; extern const s16 gUnknown_810AC62; extern const s16 gUnknown_80F4DAE; extern const s16 gUnknown_80F4DB0; -extern struct unkStruct_80943A8 gUnknown_8106F24; -extern struct unkStruct_80943A8 gUnknown_8106F04; -extern struct unkStruct_80943A8 gUnknown_8106F1C; -extern struct unkStruct_80943A8 gUnknown_8106F14; +extern s48_16 gUnknown_8106F24; +extern s48_16 gUnknown_8106F04; +extern s48_16 gUnknown_8106F1C; +extern s48_16 gUnknown_8106F14; extern const u8 *const gUnknown_80FAE00; extern const u8 *const gUnknown_80FADD8; extern const u8 *const gUnknown_80FEE04; @@ -173,17 +173,17 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 s32 atkStat, defStat; s32 rand; s32 r6; - struct unkStruct_80943A8 unkSp1; - struct unkStruct_80943A8 unkSp2; - struct unkStruct_80943A8 unkSp3; - struct unkStruct_80943A8 unkSp4; - struct unkStruct_80943A8 unkSp5; - struct unkStruct_80943A8 unkSp6; - struct unkStruct_80943A8 unkSp7; - struct unkStruct_80943A8 unkSp8; - struct unkStruct_80943A8 unkSp9; - struct unkStruct_80943A8 unkSp10; - struct unkStruct_80943A8 unkSp11; + s48_16 unkSp1; + s48_16 unkSp2; + s48_16 unkSp3; + s48_16 unkSp4; + s48_16 unkSp5; + s48_16 unkSp6; + s48_16 unkSp7; + s48_16 unkSp8; + s48_16 unkSp9; + s48_16 unkSp10; + s48_16 unkSp11; bool8 r5; dmgStruct->type = moveType; @@ -281,8 +281,8 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 F48_16_SDiv(&unkSp1, &unkSp1, &unkSp2); if (!attackerInfo->isNotTeamMember) { sub_800A020(&unkSp2, attackerInfo->level); - unkSp3.s0 = 0; - unkSp3.s4 = 0xAAAA; + unkSp3.hi = 0; + unkSp3.lo = 0xAAAA; F48_16_SMul(&unkSp2, &unkSp2, &unkSp3); r6 = (attackerInfo->level * 2) / 3; } @@ -301,8 +301,8 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 unkSp5 = unkSp4; unkSp7 = unkSp4; F48_16_SMul(&unkSp5, &unkSp5, &unkSp5); - unkSp6.s0 = 0; - unkSp6.s4 = 0xCCC; + unkSp6.hi = 0; + unkSp6.lo = 0xCCC; F48_16_SMul(&unkSp5, &unkSp5, &unkSp6); sub_800A020(&unkSp6, 2); F48_16_SMul(&unkSp7, &unkSp7, &unkSp6); @@ -401,8 +401,8 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 gDungeon->unk134.unk150 = sub_800A048(&unkSp8); { s32 rnd = DungeonRandInt(0x4000); - unkSp9.s0 = 0; - unkSp9.s4 = 0xE000 + rnd; + unkSp9.hi = 0; + unkSp9.lo = 0xE000 + rnd; } F48_16_SMul(&unkSp8, &unkSp8, &unkSp9); sub_800A020(&unkSp11, 100); @@ -420,8 +420,8 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct DamageStruct *dmgStruct) { - struct unkStruct_80943A8 unkSp1; - struct unkStruct_80943A8 unkSp2; + s48_16 unkSp1; + s48_16 unkSp2; s32 a2New = a2; if (a2New <= 0) a2New = 1; diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index c78e7b6f3..5509a78b4 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -105,7 +105,7 @@ extern const s16 gUnknown_80F4F74; extern const s16 gUnknown_80F4FC2; extern const s16 gUnknown_80F4F76; extern const s16 gUnknown_80F4F36; -extern unkStruct_80943A8 gUnknown_80F54F4[8]; +extern s48_16 gUnknown_80F54F4[8]; extern const s32 gUnknown_80F60DC[]; extern const Position gUnknown_80F4D44[]; @@ -309,7 +309,7 @@ void sub_8074094(Entity *entity) } if (entityInfo->isTeamLeader) { - unkStruct_80943A8 sp8, sp10; + s48_16 sp8, sp10; FixedPoint var_38; FixedPoint bellyBefore; bool8 sound; @@ -334,11 +334,11 @@ void sub_8074094(Entity *entity) if (r4 > 19) r4 = 19; - sp8.s0 = 0; - sp8.s4 = 6554; + sp8.hi = 0; + sp8.lo = 6554; F48_16_SMul(&sp10, &sp8, &gUnknown_80F54F4[r4]); if (entityInfo->unk153 > 1) - sp10.s4 += (gUnknown_80F60DC[entityInfo->unk153] << 0x10); + sp10.lo += (gUnknown_80F60DC[entityInfo->unk153] << 0x10); entityInfo->unk153 = 0; bellyBefore = entityInfo->belly; diff --git a/src/math.c b/src/math.c index 972407be5..64a7e2b3d 100644 --- a/src/math.c +++ b/src/math.c @@ -4,8 +4,8 @@ #include "data/math.h" -static void F48_16_UDiv(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); -static void F48_16_UMul(unkStruct_80943A8 *, unkStruct_80943A8 *, unkStruct_80943A8 *); +static void F48_16_UDiv(s48_16 *, s48_16 *, s48_16 *); +static void F48_16_UMul(s48_16 *, s48_16 *, s48_16 *); static u24_8 u24_8_div(u24_8, u24_8); static u24_8 u24_8_mul(u24_8, u24_8); @@ -348,7 +348,7 @@ s32 sub_8009FB8(s32 x, s32 y) return r5; } -void sub_800A020(unkStruct_80943A8 *param_1, u32 param_2) +void sub_800A020(s48_16 *param_1, u32 param_2) { #ifndef NONMATCHING register u32 temp asm("r4"); @@ -357,20 +357,20 @@ void sub_800A020(unkStruct_80943A8 *param_1, u32 param_2) #endif temp = 0xFFFF0000; - param_1->s0 = param_2 >> 16; - param_1->s4 = param_2 << 16; + param_1->hi = param_2 >> 16; + param_1->lo = param_2 << 16; if (param_2 & 0x8000) - param_1->s0 |= temp; + param_1->hi |= temp; } -u32 sub_800A048(unkStruct_80943A8 *a) +u32 sub_800A048(s48_16 *a) { u32 uVar1; - uVar1 = ((u16)a->s0 << 16) | (a->s4 >> 16); - if (a->s4 & 0x8000) + uVar1 = ((u16) a->hi << 16) | (a->lo >> 16); + if (a->lo & 0x8000) uVar1++; return uVar1; @@ -387,26 +387,26 @@ UNUSED u32 sub_800A068(u32 *a) return uVar1; } -void sub_800A088(unkStruct_80943A8 *a, s32 b) +void sub_800A088(s48_16 *a, s32 b) { - a->s4 = b << 8; - a->s0 = b >> 24; + a->lo = b << 8; + a->hi = b >> 24; - if (a->s0 & 0x80) - a->s0 |= ~0x7F; + if (a->hi & 0x80) + a->hi |= ~0x7F; else - a->s0 &= 0x7f; + a->hi &= 0x7f; } -s32 sub_800A0B0(unkStruct_80943A8 *a) +s32 sub_800A0B0(s48_16 *a) { s32 r2; s32 r3; s32 idx; s32 divi; - r2 = a->s4; - r3 = a->s0; + r2 = a->lo; + r3 = a->hi; if (r2 == 0 && r3 == 0) return 0; @@ -515,95 +515,95 @@ s32 sub_800A0B0(unkStruct_80943A8 *a) } } -static void F48_16_Negate(unkStruct_80943A8 *a) +static void F48_16_Negate(s48_16 *a) { - a->s0 = ~a->s0; - a->s4 = ~a->s4 + 1; + a->hi = ~a->hi; + a->lo = ~a->lo + 1; - if (a->s4 == 0) - a->s0++; + if (a->lo == 0) + a->hi++; } -static void F48_16_Abs(unkStruct_80943A8 *a) +static void F48_16_Abs(s48_16 *a) { - if (a->s0 < 0) { - a->s0 = ~a->s0; - a->s4 = ~a->s4 + 1; + if (a->hi < 0) { + a->hi = ~a->hi; + a->lo = ~a->lo + 1; - if (a->s4 == 0) - a->s0++; + if (a->lo == 0) + a->hi++; } } -bool8 F48_16_IsZero(unkStruct_80943A8 *a) +bool8 F48_16_IsZero(s48_16 *a) { - if (a->s0 == 0 && a->s4 == 0) + if (a->hi == 0 && a->lo == 0) return TRUE; return FALSE; } -UNUSED bool8 F48_16_IsEqual(unkStruct_80943A8 *a, unkStruct_80943A8 *b) +UNUSED bool8 F48_16_IsEqual(s48_16 *a, s48_16 *b) { - if (a->s0 == b->s0 && a->s4 == b->s4) + if (a->hi == b->hi && a->lo == b->lo) return TRUE; return FALSE; } -static bool8 F48_16_IsNegative(unkStruct_80943A8 *a) +static bool8 F48_16_IsNegative(s48_16 *a) { - if (a->s0 < 0) + if (a->hi < 0) return TRUE; return FALSE; } -bool8 sub_800A2F0(unkStruct_80943A8 *a, unkStruct_80943A8 *b) +bool8 sub_800A2F0(s48_16 *a, s48_16 *b) { s32 r1; u32 a0; s32 b0; - a0 = a->s0; + a0 = a->hi; r1 = a0 >> 31; - b0 = b->s0; + b0 = b->hi; if (b0 < 0) r1 |= 0x2; switch (r1) { case 0: default: - return u32_pair_less_than(a0, a->s4, b0, b->s4); + return u32_pair_less_than(a0, a->lo, b0, b->lo); case 1: return TRUE; case 2: return FALSE; case 3: - return !u32_pair_less_than(a0, a->s4, b0, b->s4); + return !u32_pair_less_than(a0, a->lo, b0, b->lo); } } -void F48_16_SMul(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +void F48_16_SMul(s48_16 *dst, s48_16 *a, s48_16 *b) { bool8 aIsNegative; bool8 bIsNegative; - unkStruct_80943A8 aa; - unkStruct_80943A8 bb; - unkStruct_80943A8 res; + s48_16 aa; + s48_16 bb; + s48_16 res; - aa.s0 = a->s0; - aa.s4 = a->s4; - bb.s0 = b->s0; - bb.s4 = b->s4; + aa.hi = a->hi; + aa.lo = a->lo; + bb.hi = b->hi; + bb.lo = b->lo; aIsNegative = F48_16_IsNegative(&aa); bIsNegative = F48_16_IsNegative(&bb); if (F48_16_IsZero(&aa)) { - dst->s0 = 0; - dst->s4 = 0; + dst->hi = 0; + dst->lo = 0; } else if (F48_16_IsZero(&bb)) { - dst->s0 = 0; - dst->s4 = 0; + dst->hi = 0; + dst->lo = 0; } else { if (aIsNegative) @@ -616,33 +616,33 @@ void F48_16_SMul(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 if (aIsNegative != bIsNegative) F48_16_Negate(&res); - dst->s0 = res.s0; - dst->s4 = res.s4; + dst->hi = res.hi; + dst->lo = res.lo; } } -void F48_16_SDiv(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +void F48_16_SDiv(s48_16 *dst, s48_16 *a, s48_16 *b) { bool8 aIsNegative; bool8 bIsNegative; - unkStruct_80943A8 aa; - unkStruct_80943A8 bb; - unkStruct_80943A8 res; + s48_16 aa; + s48_16 bb; + s48_16 res; - aa.s0 = a->s0; - aa.s4 = a->s4; - bb.s0 = b->s0; - bb.s4 = b->s4; + aa.hi = a->hi; + aa.lo = a->lo; + bb.hi = b->hi; + bb.lo = b->lo; aIsNegative = F48_16_IsNegative(&aa); bIsNegative = F48_16_IsNegative(&bb); if (F48_16_IsZero(&bb)) { - dst->s0 = INT32_MAX; - dst->s4 = UINT32_MAX; + dst->hi = INT32_MAX; + dst->lo = UINT32_MAX; } else if (F48_16_IsZero(&aa)) { - dst->s0 = 0; - dst->s4 = 0; + dst->hi = 0; + dst->lo = 0; } else { if (aIsNegative) @@ -655,33 +655,33 @@ void F48_16_SDiv(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 if (aIsNegative != bIsNegative) F48_16_Negate(&res); - dst->s0 = res.s0; - dst->s4 = res.s4; + dst->hi = res.hi; + dst->lo = res.lo; } } -static void F48_16_Square(unkStruct_80943A8 *a) +static void F48_16_Square(s48_16 *a) { - unkStruct_80943A8 aa; - unkStruct_80943A8 res; + s48_16 aa; + s48_16 res; - aa.s0 = a->s0; - aa.s4 = a->s4; + aa.hi = a->hi; + aa.lo = a->lo; if (F48_16_IsZero(&aa)) { - a->s0 = 0; - a->s4 = 0; + a->hi = 0; + a->lo = 0; } else { F48_16_Abs(&aa); F48_16_UMul(&res, &aa, &aa); - a->s0 = res.s0; - a->s4 = res.s4; + a->hi = res.hi; + a->lo = res.lo; } } // Regswap https://decomp.me/scratch/HNmlz -static void F48_16_UMul(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +static void F48_16_UMul(s48_16 *dst, s48_16 *a, s48_16 *b) { u32 sl; u32 r1; @@ -697,18 +697,18 @@ static void F48_16_UMul(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ s32 i; if (F48_16_IsZero(a)) { - dst->s0 = 0; - dst->s4 = 0; + dst->hi = 0; + dst->lo = 0; } else if (F48_16_IsZero(b)) { - dst->s0 = 0; - dst->s4 = 0; + dst->hi = 0; + dst->lo = 0; } else { - r1 = a->s0; - r4 = a->s4; - sl = b->s0; - r2 = b->s4; + r1 = a->hi; + r4 = a->lo; + sl = b->hi; + r2 = b->lo; r6 = 0; r5 = 0; @@ -745,13 +745,13 @@ static void F48_16_UMul(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ if (r1 != 0) r5++; - dst->s0 = r6; - dst->s4 = r5; + dst->hi = r6; + dst->lo = r5; } } // Similar to u24_8_div -static void F48_16_UDiv(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +static void F48_16_UDiv(s48_16 *dst, s48_16 *a, s48_16 *b) { s32 temp; bool8 r1; @@ -766,18 +766,18 @@ static void F48_16_UDiv(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ s32 i; if (F48_16_IsZero(b)) { - dst->s0 = INT32_MAX; - dst->s4 = UINT32_MAX; + dst->hi = INT32_MAX; + dst->lo = UINT32_MAX; } else if (F48_16_IsZero(a)) { - dst->s0 = 0; - dst->s4 = 0; + dst->hi = 0; + dst->lo = 0; } else { - r7 = (a->s0 << 16) | (a->s4 >> 16); - r6 = (a->s4 << 16) | 0x8000; - sp4 = b->s0; - sp8 = b->s4; + r7 = (a->hi << 16) | (a->lo >> 16); + r6 = (a->lo << 16) | 0x8000; + sp4 = b->hi; + sp8 = b->lo; spC = 0; // Effectively unused r9 = 0; r5 = 0; @@ -819,54 +819,54 @@ static void F48_16_UDiv(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ r9 |= 0x1; } - dst->s0 = spC; - dst->s4 = r9; + dst->hi = spC; + dst->lo = r9; } } -void sub_800A6D0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +void sub_800A6D0(s48_16 *dst, s48_16 *a, s48_16 *b) { s32 s0; u32 s4; - s0 = a->s0 + b->s0; - s4 = a->s4 + b->s4; - if (s4 < a->s4) + s0 = a->hi + b->hi; + s4 = a->lo + b->lo; + if (s4 < a->lo) s0++; - dst->s0 = s0; - dst->s4 = s4; + dst->hi = s0; + dst->lo = s4; } -void sub_800A6F0(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +void sub_800A6F0(s48_16 *dst, s48_16 *a, s48_16 *b) { s32 s0; u32 s4; - s0 = a->s0 - b->s0; - s4 = a->s4 - b->s4; - if (s4 > a->s4) + s0 = a->hi - b->hi; + s4 = a->lo - b->lo; + if (s4 > a->lo) s0--; - dst->s0 = s0; - dst->s4 = s4; + dst->hi = s0; + dst->lo = s4; } // Similar to sub_8009F68 -UNUSED void F48_16_Pow(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, s32 b) +UNUSED void F48_16_Pow(s48_16 *dst, s48_16 *a, s32 b) { - unkStruct_80943A8 aa; + s48_16 aa; s32 bb; - unkStruct_80943A8 res; + s48_16 res; - aa.s0 = a->s0; - aa.s4 = a->s4; + aa.hi = a->hi; + aa.lo = a->lo; bb = b; if (bb < 0) bb = -bb; - res.s0 = 0; - res.s4 = 0x10000; + res.hi = 0; + res.lo = 0x10000; for (; bb != 0; bb >>= 1) { if (bb & 1) @@ -876,25 +876,25 @@ UNUSED void F48_16_Pow(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, s32 b) } if (b < 0) { - unkStruct_80943A8 idk; - idk.s0 = 0; - idk.s4 = 0x10000; + s48_16 idk; + idk.hi = 0; + idk.lo = 0x10000; F48_16_SDiv(&res, &idk, &res); } - dst->s0 = res.s0; - dst->s4 = res.s4; + dst->hi = res.hi; + dst->lo = res.lo; } // Similar to sub_8009FB8 -UNUSED void sub_800A78C(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_80943A8 *b) +UNUSED void sub_800A78C(s48_16 *dst, s48_16 *a, s48_16 *b) { u32 temp; s32 i; - unkStruct_80943A8 sp0; - unkStruct_80943A8 sp8; - unkStruct_80943A8 sp10; - unkStruct_80943A8 sp18; + s48_16 sp0; + s48_16 sp8; + s48_16 sp10; + s48_16 sp18; sp0 = *a; sp8 = *b; @@ -913,24 +913,24 @@ UNUSED void sub_800A78C(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ do { F48_16_SDiv(&sp10, &sp8, &sp0); F48_16_Square(&sp10); - sp18.s0 = sp10.s0; - sp18.s4 = sp10.s4 + 0x40000; + sp18.hi = sp10.hi; + sp18.lo = sp10.lo + 0x40000; - if (sp18.s4 < sp10.s4) - sp18.s0++; + if (sp18.lo < sp10.lo) + sp18.hi++; F48_16_SDiv(&sp10, &sp10, &sp18); F48_16_SMul(&sp18, &sp0, &sp10); - sp18.s0 <<= 1; - if ((s32)sp18.s4 < 0) - sp18.s0 |= 0x1; + sp18.hi <<= 1; + if ((s32) sp18.lo < 0) + sp18.hi |= 0x1; - sp18.s4 <<= 1; - temp = sp0.s4; - sp0.s0 += sp18.s0; - sp0.s4 = temp + sp18.s4; - if (temp > sp0.s4) - sp0.s0++; + sp18.lo <<= 1; + temp = sp0.lo; + sp0.hi += sp18.hi; + sp0.lo = temp + sp18.lo; + if (temp > sp0.lo) + sp0.hi++; if (i == 2) break; @@ -941,4 +941,4 @@ UNUSED void sub_800A78C(unkStruct_80943A8 *dst, unkStruct_80943A8 *a, unkStruct_ } *dst = sp0; -} \ No newline at end of file +} diff --git a/src/number_util.c b/src/number_util.c index 185774045..19c9c1bd8 100644 --- a/src/number_util.c +++ b/src/number_util.c @@ -84,12 +84,12 @@ FixedPoint IntToFixedPoint(s32 a) return p; } -FixedPoint FixedPoint_SetFromUnk(unkStruct_80943A8* param_1) +FixedPoint FixedPoint_SetFromUnk(s48_16* param_1) { FixedPoint s; - s.unk0 = param_1->s4 >> 0x10; - s.unk2 = (1000 * (param_1->s4 & 0xffff)) >> 0x10; + s.unk0 = param_1->lo >> 0x10; + s.unk2 = (1000 * (param_1->lo & 0xffff)) >> 0x10; return s; } diff --git a/src/type_effectiveness.c b/src/type_effectiveness.c index 9f5f57f7b..f332f3204 100644 --- a/src/type_effectiveness.c +++ b/src/type_effectiveness.c @@ -15,21 +15,21 @@ u32 gUnknown_8106EFC[] = { 0x00, 0x00 }; -unkStruct_80943A8 gUnknown_8106F04 = { 0x0, 0x10000 }; -unkStruct_80943A8 gUnknown_8106F0C = { 0x0, 0x20000 }; -unkStruct_80943A8 gUnknown_8106F14 = { 0x0, 0x18000 }; -unkStruct_80943A8 gUnknown_8106F1C = { 0x0, 0x8000 }; +s48_16 gUnknown_8106F04 = { 0x0, 0x10000 }; +s48_16 gUnknown_8106F0C = { 0x0, 0x20000 }; +s48_16 gUnknown_8106F14 = { 0x0, 0x18000 }; +s48_16 gUnknown_8106F1C = { 0x0, 0x8000 }; u8 gUnknown_8106F24[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x01, 0x00 }; -unkStruct_80943A8 gUnknown_8106F3C = {0x0, 0x8000}; -unkStruct_80943A8 gUnknown_8106F44 = {0x0, 0xE666}; -unkStruct_80943A8 gUnknown_8106F4C = {0x0, 0x18000}; +s48_16 gUnknown_8106F3C = {0x0, 0x8000}; +s48_16 gUnknown_8106F44 = {0x0, 0xE666}; +s48_16 gUnknown_8106F4C = {0x0, 0x18000}; struct dumb_struct { - unkStruct_80943A8 *unk0[NUM_EFFECTIVENESS]; + s48_16 *unk0[NUM_EFFECTIVENESS]; }; struct dumb_struct gUnknown_8106F54 = { @@ -39,7 +39,7 @@ struct dumb_struct gUnknown_8106F54 = { &gUnknown_8106F4C, // SUPER }; -unkStruct_80943A8 gUnknown_8106F64 = {0x0, 0xC000}; +s48_16 gUnknown_8106F64 = {0x0, 0xC000}; u32 gTypeEffectivenessMultipliers[] = {0, 1, 2, 4}; @@ -66,7 +66,7 @@ void sub_8042978(Entity *); void sub_804298C(Entity *); void sub_80428EC(Entity *); -bool8 sub_806E100(unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u8 type, struct unkStruct_806D010 *param_5) +bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, struct unkStruct_806D010 *param_5) { bool8 torrentFlag; bool8 overgrowFlag; @@ -128,8 +128,8 @@ bool8 sub_806E100(unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u bVar4 = TRUE; if ((param_5->effectiveness != EFFECTIVENESS_SUPER) && (bVar4 = FALSE, hasWonderGuard)) { temp = gUnknown_8106EFC[1]; - param_1->s0 = gUnknown_8106EFC[0]; - param_1->s4 = temp; + param_1->hi = gUnknown_8106EFC[0]; + param_1->lo = temp; } if (((type == TYPE_FIRE) || (type == TYPE_ICE)) && (HasAbility(target,ABILITY_THICK_FAT))) { diff --git a/tmp/fixpoint.cocci b/tmp/fixpoint.cocci new file mode 100644 index 000000000..1c25b8c31 --- /dev/null +++ b/tmp/fixpoint.cocci @@ -0,0 +1,17 @@ +@@ +s48_16 e; +s48_16 *ep; +@@ +( +- e.s0 ++ e.hi +| +- e.s4 ++ e.lo +| +- ep->s0 ++ ep->hi +| +- ep->s4 ++ ep->lo +) From 191282081358382e8c3e18168f40acc8b3151388 Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Sat, 9 Nov 2024 15:16:30 +0100 Subject: [PATCH 40/48] math cleanup --- include/math.h | 14 ++++++------ include/number_util.h | 2 ++ src/code_806E8B0.c | 46 ++++++++++++++++++++-------------------- src/code_809D148.c | 2 +- src/file_system.c | 2 +- src/ground_script_1.c | 12 +++++------ src/math.c | 26 +++++++++++------------ src/type_effectiveness.c | 6 +++--- tmp/renames.sed | 26 +++++++++++++++++++++++ 9 files changed, 82 insertions(+), 54 deletions(-) create mode 100644 tmp/renames.sed diff --git a/include/math.h b/include/math.h index d2fe2bd1e..00b1308a0 100644 --- a/include/math.h +++ b/include/math.h @@ -54,12 +54,12 @@ bool8 F48_16_IsZero(s48_16 *a); void F48_16_SDiv(s48_16 *dst, s48_16 *a, s48_16 *b); void F48_16_SMul(s48_16 *dst, s48_16 *a, s48_16 *b); -s32 sub_8009FB8(s32 x, s32 y); -void sub_800A020(s48_16 *dst, u32); -u32 sub_800A048(s48_16 *a); -void sub_800A088(s48_16 *a, s32 b); -bool8 sub_800A2F0(s48_16 *a, s48_16 *b); -void sub_800A6D0(s48_16 *dst, s48_16 *a, s48_16 *b); -void sub_800A6F0(s48_16 *dst, s48_16 *a, s48_16 *b); +s32 FP24_8_Hypot(s32 x, s32 y); +void FP48_16_FromS32(s48_16 *dst, u32); +u32 FP48_16_ToS32(s48_16 *a); +void FP48_16_FromF248(s48_16 *a, s24_8 b); +bool8 FP48_16_SLessThan(s48_16 *a, s48_16 *b); +void FP48_16_Add(s48_16 *dst, s48_16 *a, s48_16 *b); +void FP48_16_Subtract(s48_16 *dst, s48_16 *a, s48_16 *b); #endif // GUARD_MATH_H diff --git a/include/number_util.h b/include/number_util.h index b835a5fcb..dfdbbead2 100644 --- a/include/number_util.h +++ b/include/number_util.h @@ -1,12 +1,14 @@ #ifndef GUARD_NUMBER_UTIL_H #define GUARD_NUMBER_UTIL_H +// Fixed point with an integer part and fraction part in thousandths typedef struct FixedPoint { s16 unk0; s16 unk2; } FixedPoint; +// Binary 48.16 fixed point typedef struct s48_16 { s32 hi; diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index a747c92fa..a8986d7d6 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -276,11 +276,11 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 attackerInfo->previousVisualFlags &= ~(0x100); attackerInfo->visualFlags &= ~(0x100); ApplyAtkDefStatBoosts(attacker, target, moveType, &atkStat, &defStat, rand); - sub_800A020(&unkSp1, atkStat - defStat); - sub_800A020(&unkSp2, 8); + FP48_16_FromS32(&unkSp1, atkStat - defStat); + FP48_16_FromS32(&unkSp2, 8); F48_16_SDiv(&unkSp1, &unkSp1, &unkSp2); if (!attackerInfo->isNotTeamMember) { - sub_800A020(&unkSp2, attackerInfo->level); + FP48_16_FromS32(&unkSp2, attackerInfo->level); unkSp3.hi = 0; unkSp3.lo = 0xAAAA; F48_16_SMul(&unkSp2, &unkSp2, &unkSp3); @@ -290,31 +290,31 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 s32 unkAtkStat2 = attackerInfo->atk[splitIndex]; s32 unkDefStat2 = 1; ApplyAtkDefStatBoosts(attacker, target, moveType, &unkAtkStat2, &unkDefStat2, rand); - sub_800A020(&unkSp2, unkAtkStat2); - sub_800A020(&unkSp3, 3); + FP48_16_FromS32(&unkSp2, unkAtkStat2); + FP48_16_FromS32(&unkSp3, 3); F48_16_SDiv(&unkSp2, &unkSp2, &unkSp3); r6 = unkAtkStat2 / 3; } - sub_800A6D0(&unkSp4, &unkSp1, &unkSp2); + FP48_16_Add(&unkSp4, &unkSp1, &unkSp2); gDungeon->unk134.unk140[5] = r6; - gDungeon->unk134.unk140[6] = sub_800A048(&unkSp4); + gDungeon->unk134.unk140[6] = FP48_16_ToS32(&unkSp4); unkSp5 = unkSp4; unkSp7 = unkSp4; F48_16_SMul(&unkSp5, &unkSp5, &unkSp5); unkSp6.hi = 0; unkSp6.lo = 0xCCC; F48_16_SMul(&unkSp5, &unkSp5, &unkSp6); - sub_800A020(&unkSp6, 2); + FP48_16_FromS32(&unkSp6, 2); F48_16_SMul(&unkSp7, &unkSp7, &unkSp6); - sub_800A020(&unkSp6, defStat); - sub_800A6F0(&unkSp7, &unkSp7, &unkSp6); - sub_800A020(&unkSp6, 10); - sub_800A6D0(&unkSp7, &unkSp7, &unkSp6); - sub_800A6D0(&unkSp8, &unkSp5, &unkSp7); - if (sub_800A2F0(&gUnknown_8106F24, &unkSp8)) { + FP48_16_FromS32(&unkSp6, defStat); + FP48_16_Subtract(&unkSp7, &unkSp7, &unkSp6); + FP48_16_FromS32(&unkSp6, 10); + FP48_16_Add(&unkSp7, &unkSp7, &unkSp6); + FP48_16_Add(&unkSp8, &unkSp5, &unkSp7); + if (FP48_16_SLessThan(&gUnknown_8106F24, &unkSp8)) { unkSp8 = gUnknown_8106F24; } - if (sub_800A2F0(&unkSp8, &gUnknown_8106F04)) { + if (FP48_16_SLessThan(&unkSp8, &gUnknown_8106F04)) { unkSp8 = gUnknown_8106F04; } r5 = sub_806E100(&unkSp9, attacker, target, moveType, dmgStruct); @@ -380,7 +380,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 } } - gDungeon->unk134.unk154 = sub_800A048(&unkSp8); + gDungeon->unk134.unk154 = FP48_16_ToS32(&unkSp8); F48_16_SMul(&unkSp8, &unkSp8, &unkSp9); { // Ugly hack needed to match @@ -392,25 +392,25 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 gDungeon->unk134.unk15C = arg8_Match = arg8; ASM_MATCH_TRICK(arg8); - sub_800A088(&unkSp10, arg8_Match); + FP48_16_FromF248(&unkSp10, arg8_Match); F48_16_SMul(&unkSp8, &unkSp8, &unkSp10); } // ALSO needed to match. unk694 chosen randomly and it worked with matching. ASM_MATCH_TRICK(gDungeon->unk644.unk50); - gDungeon->unk134.unk150 = sub_800A048(&unkSp8); + gDungeon->unk134.unk150 = FP48_16_ToS32(&unkSp8); { s32 rnd = DungeonRandInt(0x4000); unkSp9.hi = 0; unkSp9.lo = 0xE000 + rnd; } F48_16_SMul(&unkSp8, &unkSp8, &unkSp9); - sub_800A020(&unkSp11, 100); + FP48_16_FromS32(&unkSp11, 100); F48_16_SMul(&unkSp9, &unkSp11, &unkSp9); - gDungeon->unk134.unk158 = sub_800A048(&unkSp9); + gDungeon->unk134.unk158 = FP48_16_ToS32(&unkSp9); - dmgStruct->dmg = sub_800A048(&unkSp8); + dmgStruct->dmg = FP48_16_ToS32(&unkSp8); dmgStruct->residualDmgType = 0; if (dmgStruct->dmg == 0) { dmgStruct->isCrit = FALSE; @@ -429,9 +429,9 @@ void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct D dmgStruct->type = moveType; sub_806E100(&unkSp1, attacker, target, moveType, dmgStruct); - sub_800A020(&unkSp2, a2New); + FP48_16_FromS32(&unkSp2, a2New); F48_16_SMul(&unkSp2, &unkSp2, &unkSp1); - dmgStruct->dmg = sub_800A048(&unkSp2); + dmgStruct->dmg = FP48_16_ToS32(&unkSp2); dmgStruct->residualDmgType = 0; } diff --git a/src/code_809D148.c b/src/code_809D148.c index 4de71dd82..5f8e51d99 100644 --- a/src/code_809D148.c +++ b/src/code_809D148.c @@ -311,7 +311,7 @@ void sub_809D25C(void) case 3: r2 = (gUnknown_20399E8.unk1C.a0 - gUnknown_20399E8.unk14.a0) / 256; r1 = (gUnknown_20399E8.unk1C.a4 - gUnknown_20399E8.unk14.a4) / 256; - gUnknown_20399E8.unk10 = ((sub_8009FB8(r2 << 8, r1 << 8) / 256) << 8) / gUnknown_20399E8.unkC; + gUnknown_20399E8.unk10 = ((FP24_8_Hypot(r2 << 8, r1 << 8) / 256) << 8) / gUnknown_20399E8.unkC; if (gUnknown_20399E8.unk10 <= 0) gUnknown_20399E8.unk10 = 1; gUnknown_20399E8.unk8 = 2; diff --git a/src/file_system.c b/src/file_system.c index 73682e6a2..396265b9b 100644 --- a/src/file_system.c +++ b/src/file_system.c @@ -12,7 +12,7 @@ static EWRAM_DATA_2 u32 sFileCacheCursorPosition = {0}; // ??? extern s32 sprintf(char *, const char *, ...); -UNUSED static void sub_800A894(UnkFileStruct *r0, s32 r1) +UNUSED static void FP48_16_Log(UnkFileStruct *r0, s32 r1) { s32 temp; diff --git a/src/ground_script_1.c b/src/ground_script_1.c index 5c8578624..cb24ea8af 100644 --- a/src/ground_script_1.c +++ b/src/ground_script_1.c @@ -1062,7 +1062,7 @@ s32 ExecuteScriptCommand(Action *action) { scriptData->pos2.x = curCmd.arg1 << 8; scriptData->pos2.y = curCmd.arg2 << 8; if (curCmd.op == 0x7d || curCmd.op == 0x83) { - scriptData->unk2A = sub_8009FB8(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; + scriptData->unk2A = FP24_8_Hypot(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; if (scriptData->unk2A <= 0) scriptData->unk2A = 1; } else { scriptData->unk2A = curCmd.argShort; @@ -1074,7 +1074,7 @@ s32 ExecuteScriptCommand(Action *action) { scriptData->pos2.x = scriptData->pos1.x + (curCmd.arg1 << 8); scriptData->pos2.y = scriptData->pos1.y + (curCmd.arg2 << 8); if (curCmd.op == 0x7e || curCmd.op == 0x84) { - scriptData->unk2A = sub_8009FB8(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; + scriptData->unk2A = FP24_8_Hypot(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; if (scriptData->unk2A <= 0) scriptData->unk2A = 1; } else { scriptData->unk2A = curCmd.argShort; @@ -1097,7 +1097,7 @@ s32 ExecuteScriptCommand(Action *action) { scriptData->pos2.y = scriptData->pos1.y + ((OtherRandInt(curCmd.arg2 * 2 + 1) - curCmd.arg2) << 8); #endif if (curCmd.op == 0x7f || curCmd.op == 0x85) { - scriptData->unk2A = sub_8009FB8(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; + scriptData->unk2A = FP24_8_Hypot(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; if (scriptData->unk2A <= 0) scriptData->unk2A = 1; } else { scriptData->unk2A = curCmd.argShort; @@ -1109,7 +1109,7 @@ s32 ExecuteScriptCommand(Action *action) { scriptData->pos2 = scriptData->pos1; GroundLink_GetPos((s16)curCmd.arg1, &scriptData->pos2); if (curCmd.op == 0x80 || curCmd.op == 0x86) { - scriptData->unk2A = sub_8009FB8(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; + scriptData->unk2A = FP24_8_Hypot(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; if (scriptData->unk2A <= 0) scriptData->unk2A = 1; } else { scriptData->unk2A = curCmd.argShort; @@ -1123,7 +1123,7 @@ s32 ExecuteScriptCommand(Action *action) { scriptData->pos2.x = scriptData->pos2.x + ((OtherRandInt(cap) - curCmd.argShort) << 8); scriptData->pos2.y = scriptData->pos2.y + ((OtherRandInt(cap) - curCmd.argShort) << 8); if (curCmd.op == 0x81 || curCmd.op == 0x87) { - scriptData->unk2A = sub_8009FB8(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; + scriptData->unk2A = FP24_8_Hypot(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; if (scriptData->unk2A <= 0) scriptData->unk2A = 1; } else { scriptData->unk2A = curCmd.argShort; @@ -1136,7 +1136,7 @@ s32 ExecuteScriptCommand(Action *action) { action->callbacks->getHitboxCenter(action->parentObject, &scriptData->pos1); sub_80A8FD8(ret, &scriptData->pos2); if (curCmd.op == 0x82 || curCmd.op == 0x88) { - scriptData->unk2A = sub_8009FB8(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; + scriptData->unk2A = FP24_8_Hypot(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; if (scriptData->unk2A <= 0) scriptData->unk2A = 1; } else { scriptData->unk2A = curCmd.argShort; diff --git a/src/math.c b/src/math.c index 64a7e2b3d..84c243b1b 100644 --- a/src/math.c +++ b/src/math.c @@ -289,7 +289,7 @@ static u24_8 u24_8_div(u24_8 x, u24_8 y) return r9; } -UNUSED s32 sub_8009F68(s32 x, s32 y) +UNUSED s32 FP24_8_Pow(s32 x, s32 y) { s32 uVar1; s32 sVar1; @@ -313,7 +313,7 @@ UNUSED s32 sub_8009F68(s32 x, s32 y) return s24_8_div(0x100, sVar1); } -s32 sub_8009FB8(s32 x, s32 y) +s32 FP24_8_Hypot(s32 x, s32 y) { s32 r4; s32 i; @@ -348,7 +348,7 @@ s32 sub_8009FB8(s32 x, s32 y) return r5; } -void sub_800A020(s48_16 *param_1, u32 param_2) +void FP48_16_FromS32(s48_16 *param_1, u32 param_2) { #ifndef NONMATCHING register u32 temp asm("r4"); @@ -365,7 +365,7 @@ void sub_800A020(s48_16 *param_1, u32 param_2) } -u32 sub_800A048(s48_16 *a) +u32 FP48_16_ToS32(s48_16 *a) { u32 uVar1; @@ -376,7 +376,7 @@ u32 sub_800A048(s48_16 *a) return uVar1; } -UNUSED u32 sub_800A068(u32 *a) +UNUSED u32 FP48_16_ToF248(u32 *a) { u32 uVar1; @@ -387,7 +387,7 @@ UNUSED u32 sub_800A068(u32 *a) return uVar1; } -void sub_800A088(s48_16 *a, s32 b) +void FP48_16_FromF248(s48_16 *a, s32 b) { a->lo = b << 8; a->hi = b >> 24; @@ -556,7 +556,7 @@ static bool8 F48_16_IsNegative(s48_16 *a) return FALSE; } -bool8 sub_800A2F0(s48_16 *a, s48_16 *b) +bool8 FP48_16_SLessThan(s48_16 *a, s48_16 *b) { s32 r1; u32 a0; @@ -824,7 +824,7 @@ static void F48_16_UDiv(s48_16 *dst, s48_16 *a, s48_16 *b) } } -void sub_800A6D0(s48_16 *dst, s48_16 *a, s48_16 *b) +void FP48_16_Add(s48_16 *dst, s48_16 *a, s48_16 *b) { s32 s0; u32 s4; @@ -838,7 +838,7 @@ void sub_800A6D0(s48_16 *dst, s48_16 *a, s48_16 *b) dst->lo = s4; } -void sub_800A6F0(s48_16 *dst, s48_16 *a, s48_16 *b) +void FP48_16_Subtract(s48_16 *dst, s48_16 *a, s48_16 *b) { s32 s0; u32 s4; @@ -852,7 +852,7 @@ void sub_800A6F0(s48_16 *dst, s48_16 *a, s48_16 *b) dst->lo = s4; } -// Similar to sub_8009F68 +// Similar to FP24_8_Pow UNUSED void F48_16_Pow(s48_16 *dst, s48_16 *a, s32 b) { s48_16 aa; @@ -886,8 +886,8 @@ UNUSED void F48_16_Pow(s48_16 *dst, s48_16 *a, s32 b) dst->lo = res.lo; } -// Similar to sub_8009FB8 -UNUSED void sub_800A78C(s48_16 *dst, s48_16 *a, s48_16 *b) +// Similar to FP24_8_Hypot +UNUSED void FP48_16_Hypot(s48_16 *dst, s48_16 *a, s48_16 *b) { u32 temp; s32 i; @@ -901,7 +901,7 @@ UNUSED void sub_800A78C(s48_16 *dst, s48_16 *a, s48_16 *b) F48_16_Abs(&sp0); F48_16_Abs(&sp8); - if (sub_800A2F0(&sp0, &sp8)) { + if (FP48_16_SLessThan(&sp0, &sp8)) { sp10 = sp0; sp0 = sp8; sp8 = sp10; diff --git a/src/type_effectiveness.c b/src/type_effectiveness.c index f332f3204..5853109dc 100644 --- a/src/type_effectiveness.c +++ b/src/type_effectiveness.c @@ -92,7 +92,7 @@ bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, str normalOrFightingType = FALSE; pokemonInfo = GetEntInfo(pokemon); targetInfo = GetEntInfo(target); - sub_800A020(param_1, 1); + FP48_16_FromS32(param_1, 1); param_5->unkD = 0; param_5->unkE = 0; hasWonderGuard = FALSE; @@ -138,7 +138,7 @@ bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, str } if ((type == TYPE_FIRE) && (GetFlashFireStatus(target) != FLASH_FIRE_STATUS_NONE)) { gDungeon->unk134.fill16E[0] = TRUE; - sub_800A020(param_1,0); + FP48_16_FromS32(param_1,0); param_5->effectiveness = EFFECTIVENESS_IMMUNE; param_5->unkD = 0; param_5->unkE = 1; @@ -146,7 +146,7 @@ bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, str } if ((type == TYPE_GROUND) && (HasAbility(target, ABILITY_LEVITATE))) { gDungeon->unk134.fill16E[1] = TRUE; - sub_800A020(param_1,0); + FP48_16_FromS32(param_1,0); param_5->effectiveness = EFFECTIVENESS_IMMUNE; param_5->unkD = 0; param_5->unkE = 1; diff --git a/tmp/renames.sed b/tmp/renames.sed new file mode 100644 index 000000000..39d202303 --- /dev/null +++ b/tmp/renames.sed @@ -0,0 +1,26 @@ +s/sub_8009DA4/FP24_8_SMul/g +s/sub_8009DD8/FP24_8_SDiv/g +s/sub_8009E14/FP24_8_UMul/g +s/sub_8009EA0/FP24_8_UDiv/g +s/sub_8009F68/FP24_8_Pow/g +s/sub_8009FB8/FP24_8_Hypot/g +s/sub_800A020/FP48_16_FromS32/g +s/sub_800A048/FP48_16_ToS32/g +s/sub_800A068/FP48_16_ToF248/g +s/sub_800A088/FP48_16_FromF248/g +s/sub_800A25C/FP48_16_Negate/g +s/sub_800A27C/FP48_16_Abs/g +s/sub_800A2A0/FP48_16_IsZero/g +s/sub_800A2BC/FP48_16_Equal/g +s/sub_800A2DC/FP48_16_IsNegative/g +s/sub_800A2F0/FP48_16_SLessThan/g +s/sub_800A34C/FP48_16_SMul/g +s/sub_800A3F0/FP48_16_SDiv/g +s/sub_800A4A0/FP48_16_Square/g +s/sub_800A4E4/FP48_16_UMul/g +s/sub_800A5A4/FP48_16_UDiv/g +s/sub_800A6D0/FP48_16_Add/g +s/sub_800A6F0/FP48_16_Subtract/g +s/sub_800A710/FP48_16_Pow/g +s/sub_800A78C/FP48_16_Hypot/g +s/sub_800A894/FP48_16_Log/g From bba6da7537075074f3fcb5c831077b87b8a38c25 Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Sun, 10 Nov 2024 11:44:46 +0100 Subject: [PATCH 41/48] Convert callers to s24_8, use struct for type safety --- include/math.h | 50 +++++++++---- include/number_util.h | 37 +++++++++- include/status.h | 5 +- include/structs/dungeon_entity.h | 3 +- include/structs/str_dungeon.h | 2 +- include/structs/str_position.h | 4 +- src/code_8041AD0.c | 9 +-- src/code_806E8B0.c | 22 +++--- src/code_806FDF4.c | 3 +- src/code_8077274_1.c | 11 +-- src/code_809D148.c | 2 +- src/dungeon_cutscenes.c | 115 +++++++++++++++--------------- src/dungeon_util_1.c | 7 +- src/ground_script_1.c | 13 ++-- src/math.c | 116 +++++++++++++++---------------- src/move_actions.c | 10 +-- src/move_checks.c | 17 ++--- src/status.c | 44 ++++++------ 18 files changed, 265 insertions(+), 205 deletions(-) diff --git a/include/math.h b/include/math.h index 00b1308a0..2fdb563ec 100644 --- a/include/math.h +++ b/include/math.h @@ -4,20 +4,6 @@ #include "gba/types.h" #include "number_util.h" -/** - * This type represents a signed 24.8 fixed-point number, where the 24 most - * significant bits are the integer part and the 8 least significant bits are - * the fractional part. - */ -typedef s32 s24_8; - -/** - * This type represents an unsigned 24.8 fixed-point number, where the 24 most - * significant bits are the integer part and the 8 least significant bits are - * the fractional part. - */ -typedef u32 u24_8; - /** * This function computes the cosine of of `x` using a lookup table. The period of * the function is `4096`, and the range is `[-256, 256]`. @@ -54,7 +40,7 @@ bool8 F48_16_IsZero(s48_16 *a); void F48_16_SDiv(s48_16 *dst, s48_16 *a, s48_16 *b); void F48_16_SMul(s48_16 *dst, s48_16 *a, s48_16 *b); -s32 FP24_8_Hypot(s32 x, s32 y); +s24_8 FP24_8_Hypot(s24_8 x, s24_8 y); void FP48_16_FromS32(s48_16 *dst, u32); u32 FP48_16_ToS32(s48_16 *a); void FP48_16_FromF248(s48_16 *a, s24_8 b); @@ -62,4 +48,38 @@ bool8 FP48_16_SLessThan(s48_16 *a, s48_16 *b); void FP48_16_Add(s48_16 *dst, s48_16 *a, s48_16 *b); void FP48_16_Subtract(s48_16 *dst, s48_16 *a, s48_16 *b); +//static inline bool8 F248Equal(s24_8 x, s24_8 y) { +// return x.raw == y.raw; +//} + +#define F248LessThanInt(x, y) (x.raw < 0x100 * y) +#define F248LessThanFloat(x, y) (x.raw < (int)(y * 0x100)) +#define FloatLessThanF248(x, y) ((int)(x * 0x100) < y.raw) +//static inline bool8 F248LessThanOne(s24_8 x) { +// return x.raw < 0x100; +//} +#define F248LessThan(x, y) (x.raw < y.raw) +#define F248GreaterThan(x, y) (x.raw > y.raw) +#define F248Equal(x, y) (x.raw == y.raw) +#define F248EqualsInt(x, y) (x.raw == 0x100 * y) + +//static inline bool8 F248LessThan(s24_8 x, s24_8 y) { +// return x.raw < y.raw; +//} + +#define F248_AddInt(x, y) ((s24_8){x.raw + 0x100 * y}) +#define F248_SubInt(x, y) ((s24_8){x.raw - 0x100 * y}) + +static inline s24_8 F248_Add(s24_8 x, s24_8 y) { + return (s24_8){x.raw + y.raw}; +} + +static inline s24_8 F248_Sub(s24_8 x, s24_8 y) { + return (s24_8){x.raw - y.raw}; +} + +static inline s24_8 F248_MulInt(s24_8 x, s32 y) { + return (s24_8){x.raw * y}; +} + #endif // GUARD_MATH_H diff --git a/include/number_util.h b/include/number_util.h index dfdbbead2..d2e6741ed 100644 --- a/include/number_util.h +++ b/include/number_util.h @@ -1,14 +1,32 @@ #ifndef GUARD_NUMBER_UTIL_H #define GUARD_NUMBER_UTIL_H -// Fixed point with an integer part and fraction part in thousandths +/** + * This type represents a decimal, signed fixed-point number, where the first + * 16-bit field is the integer part and the second 16-bit field is the fraction, + * expressed in thousandths. + */ typedef struct FixedPoint { s16 unk0; s16 unk2; } FixedPoint; -// Binary 48.16 fixed point +/** + * This type represents a signed 24.8 fixed-point number, where the 24 most + * significant bits are the integer part and the 8 least significant bits are + * the fractional part. + */ +typedef struct s24_8 { + // It's almost certainly not an actual struct, but keep it as one until we decomp all structures that include it + s32 raw; +} s24_8; + +/** + * This type represents a signed 48.16 fixed-point number, where the 48 most + * significant bits are the integer part and the 16 least significant bits are + * the fractional part. + */ typedef struct s48_16 { s32 hi; @@ -25,4 +43,19 @@ FixedPoint FixedPoint_SetFromUnk(s48_16* param_1); FixedPoint FixedPoint_Div(FixedPoint a, FixedPoint b); s32 FixedPointToInt(FixedPoint a); // Always rounded up +#define IntToF248_2(x) ((s24_8){x * 0x100}) +#define FloatToF248_2(x) ((s24_8){(int)(x * 0x100)}) +static inline s24_8 IntToF248(s32 x) { + return (s24_8){x * 256}; +} + +static inline s24_8 FloatToF248(float x) { + return (s24_8){(int)(x * 256)}; +} + +static inline s32 F248ToInt(s24_8 x) { + return x.raw / 256; +} + + #endif diff --git a/include/status.h b/include/status.h index 0526c007a..9bd8ca56f 100644 --- a/include/status.h +++ b/include/status.h @@ -2,6 +2,7 @@ #define GUARD_STATUS_H #include "structs/dungeon_entity.h" +#include "number_util.h" #define FLASH_FIRE_STATUS_NONE 0 #define FLASH_FIRE_STATUS_MAXED 1 @@ -9,8 +10,8 @@ u8 GetFlashFireStatus(Entity *pokemon); void UpdateFlashFireBoost(Entity * pokemon, Entity *target); -void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s32 param_4, bool8 displayMessage); -void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s32 param_4, bool8 displayMessage); +void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s24_8 param_4, bool8 displayMessage); +void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s24_8 param_4, bool8 displayMessage); void RaiseAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage); void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage, bool8 displayMessage); void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage); diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index dbafaa253..7bb65b928 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -13,9 +13,8 @@ #include "sprite.h" #define MAX_STAT_STAGE 20 -#define STAT_MULTIPLIER_THRESHOLD 63 +#define STAT_MULTIPLIER_THRESHOLD 0.249 // one tick less than 0.25 #define DEFAULT_STAT_STAGE 10 -#define DEFAULT_STAT_MULTIPLIER 256 #define MAX_SPEED_STAGE 4 #define MAX_STOCKPILE_STAGE 3 #define NUM_SPEED_COUNTERS 5 diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index 6296d3188..b95093631 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -170,7 +170,7 @@ struct unkStruct_Dungeon134_sub u32 unk150; u32 unk154; u32 unk158; - u32 unk15C; + s24_8 unk15C; u8 unk160; u8 unk161; u8 unk162; diff --git a/include/structs/str_position.h b/include/structs/str_position.h index cfd0f7701..a376af4bf 100644 --- a/include/structs/str_position.h +++ b/include/structs/str_position.h @@ -11,8 +11,8 @@ typedef struct Position // size: 0x8 typedef struct Position32 { - /* 0x0 */ s32 x; + /* 0x0 */ s32 x; // TODO: convert to s24_8 across the codebase /* 0x4 */ s32 y; } Position32; -#endif // GUARD_STR_POSITION_H \ No newline at end of file +#endif // GUARD_STR_POSITION_H diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index 49181d728..5788623d7 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -1,4 +1,5 @@ #include "global.h" +#include "math.h" #include "code_800E9A8.h" #include "code_803E46C.h" #include "code_803E724.h" @@ -223,10 +224,10 @@ void EntityUpdateStatusSprites(Entity *entity) if ((gDungeon->unk644.itemHoldersIdentified) && (entityInfo->heldItem.flags & ITEM_FLAG_EXISTS)) { spriteStatus = spriteStatus | STATUS_SPRITE_LOWHP; } - if ( (entityInfo->offensiveMultipliers[0] < DEFAULT_STAT_MULTIPLIER) || - (entityInfo->offensiveMultipliers[1] < DEFAULT_STAT_MULTIPLIER) || - (entityInfo->defensiveMultipliers[0] < DEFAULT_STAT_MULTIPLIER) || - (entityInfo->defensiveMultipliers[1] < DEFAULT_STAT_MULTIPLIER) || + if ((F248LessThanInt(entityInfo->offensiveMultipliers[0], 1)) || + (F248LessThanInt(entityInfo->offensiveMultipliers[1], 1)) || + (F248LessThanInt(entityInfo->defensiveMultipliers[0], 1)) || + (F248LessThanInt(entityInfo->defensiveMultipliers[1], 1)) || (entityInfo->offensiveStages[0] < DEFAULT_STAT_STAGE) || (entityInfo->offensiveStages[1] < DEFAULT_STAT_STAGE) || (entityInfo->defensiveStages[0] < DEFAULT_STAT_STAGE) || diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index a8986d7d6..ffcc4c37d 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -34,8 +34,8 @@ extern void sub_8041B5C(Entity *pokemon); extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC); extern const s32 gUnknown_80F54B4[NUM_EFFECTIVENESS][NUM_EFFECTIVENESS]; -extern const s32 gUnknown_80F504C[]; -extern const s32 gUnknown_80F50A0[]; +extern const s24_8 gUnknown_80F504C[]; +extern const s24_8 gUnknown_80F50A0[]; extern const s16 gUnknown_810AC60; extern const s16 gUnknown_810AC68; extern const s16 gUnknown_810AC64; @@ -154,7 +154,7 @@ static inline void SetDamageOne(struct DamageStruct *dmgStruct, u8 moveType) dmgStruct->tookNoDamage = FALSE; } -void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s32 critChance, struct DamageStruct *dmgStruct, s32 arg8, u16 moveId, bool8 arg_10) +void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s32 critChance, struct DamageStruct *dmgStruct, s24_8 arg8, u16 moveId, bool8 arg_10) { EntityInfo *attackerInfo = GetEntInfo(attacker); EntityInfo *targetInfo = GetEntInfo(target); @@ -169,7 +169,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 } else { s32 atkStatStage, defStatStage; - s32 statCalc; + s24_8 statCalc; s32 atkStat, defStat; s32 rand; s32 r6; @@ -210,9 +210,9 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 gDungeon->unk134.unk13E[0] = atkStatStage; gDungeon->unk134.unk140[0] = attackerInfo->atk[splitIndex] + movePower; - statCalc = s24_8_mul((attackerInfo->atk[splitIndex] + movePower) * 256, gUnknown_80F504C[atkStatStage]); + statCalc = s24_8_mul(IntToF248(attackerInfo->atk[splitIndex] + movePower), gUnknown_80F504C[atkStatStage]); statCalc = s24_8_mul(statCalc, attackerInfo->offensiveMultipliers[splitIndex]); - atkStat = statCalc / 256; + atkStat = F248ToInt(statCalc); defStatStage = targetInfo->defensiveStages[splitIndex]; if (splitIndex == 0 && targetInfo->bideClassStatus.status == STATUS_SKULL_BASH) { @@ -234,9 +234,9 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 gDungeon->unk134.unk13E[1] = defStatStage; gDungeon->unk134.unk140[1] = targetInfo->def[splitIndex]; - statCalc = s24_8_mul((targetInfo->def[splitIndex]) * 256, gUnknown_80F50A0[defStatStage]); + statCalc = s24_8_mul(IntToF248(targetInfo->def[splitIndex]), gUnknown_80F50A0[defStatStage]); statCalc = s24_8_mul(statCalc, targetInfo->defensiveMultipliers[splitIndex]); - defStat = statCalc / 256; + defStat = F248ToInt(statCalc); rand = DungeonRandInt(100); if (splitIndex == 0) { @@ -385,13 +385,13 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 { // Ugly hack needed to match #ifdef NONMATCHING - s32 arg8_Match; + s24_8 arg8_Match; #else - register s32 arg8_Match asm("r2"); + register s24_8 arg8_Match asm("r2"); #endif // NONMATCHING gDungeon->unk134.unk15C = arg8_Match = arg8; - ASM_MATCH_TRICK(arg8); + //ASM_MATCH_TRICK(arg8); FP48_16_FromF248(&unkSp10, arg8_Match); F48_16_SMul(&unkSp8, &unkSp8, &unkSp10); } diff --git a/src/code_806FDF4.c b/src/code_806FDF4.c index 7eb2ea2e6..553ffa59b 100644 --- a/src/code_806FDF4.c +++ b/src/code_806FDF4.c @@ -23,6 +23,7 @@ #include "text_util.h" #include "dungeon_util_1.h" #include "type_chart.h" +#include "math.h" extern u8 gFormatBuffer_FriendArea[]; extern u8 gUnknown_202EE70[MAX_TEAM_BODY_SIZE]; @@ -132,7 +133,7 @@ void sub_806F500(void) temp->unk140[6] = 0; temp->unk150 = 0; temp->unk158 = 0; - temp->unk15C = 0; + temp->unk15C = IntToF248(0); temp->unk160 = 0; temp->unk161 = 0; temp->unk162 = 0; diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index fadd47483..51b78451a 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -17,6 +17,7 @@ #include "dungeon_util.h" #include "move_effects_target.h" #include "moves.h" +#include "math.h" #include "pokemon.h" #include "pokemon_mid.h" #include "status_checks_1.h" @@ -704,7 +705,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * for (index = 0, iVar8 = 0xc7ff; index < 400; index++) { bVar2 = TRUE; if (entityInfo->unkFF == 1) - if(iVar7 = entityInfo->unk174, bVar2 = FALSE, iVar7 > iVar8) // unk174 -> u32 to s32 + if(iVar7 = entityInfo->unk174.raw, bVar2 = FALSE, iVar7 > iVar8) // unk174 -> u32 to s32 { bVar2 = TRUE; } @@ -1025,12 +1026,12 @@ void sub_8079E34(Entity * pokemon, Entity * target, bool8 param_3) entityInfo->hitChanceStages[index] = DEFAULT_STAT_STAGE; statChanged = TRUE; } - if (entityInfo->offensiveMultipliers[index] != DEFAULT_STAT_MULTIPLIER) { - entityInfo->offensiveMultipliers[index] = DEFAULT_STAT_MULTIPLIER; + if (!F248EqualsInt(entityInfo->offensiveMultipliers[index], 1)) { + entityInfo->offensiveMultipliers[index] = IntToF248(1); statChanged = TRUE; } - if (entityInfo->defensiveMultipliers[index] != DEFAULT_STAT_MULTIPLIER) { - entityInfo->defensiveMultipliers[index] = DEFAULT_STAT_MULTIPLIER; + if (!F248EqualsInt(entityInfo->defensiveMultipliers[index], 1)) { + entityInfo->defensiveMultipliers[index] = IntToF248(1); statChanged = TRUE; } } diff --git a/src/code_809D148.c b/src/code_809D148.c index 5f8e51d99..2224a7472 100644 --- a/src/code_809D148.c +++ b/src/code_809D148.c @@ -311,7 +311,7 @@ void sub_809D25C(void) case 3: r2 = (gUnknown_20399E8.unk1C.a0 - gUnknown_20399E8.unk14.a0) / 256; r1 = (gUnknown_20399E8.unk1C.a4 - gUnknown_20399E8.unk14.a4) / 256; - gUnknown_20399E8.unk10 = ((FP24_8_Hypot(r2 << 8, r1 << 8) / 256) << 8) / gUnknown_20399E8.unkC; + gUnknown_20399E8.unk10 = (F248ToInt(FP24_8_Hypot(IntToF248(r2), IntToF248(r1))) << 8) / gUnknown_20399E8.unkC; if (gUnknown_20399E8.unk10 <= 0) gUnknown_20399E8.unk10 = 1; gUnknown_20399E8.unk8 = 2; diff --git a/src/dungeon_cutscenes.c b/src/dungeon_cutscenes.c index 9dff6a6db..a0437d50e 100644 --- a/src/dungeon_cutscenes.c +++ b/src/dungeon_cutscenes.c @@ -30,6 +30,7 @@ #include "position_util.h" #include "exclusive_pokemon.h" #include "trap.h" +#include "math.h" extern u32 gDungeonBrightness; @@ -1013,11 +1014,11 @@ void ZapdosDropInEffect(Entity *zapdosEntity) GetEntInfo(zapdosEntity)->unk15C = 1; GetEntInfo(zapdosEntity)->unk15E = 0; - GetEntInfo(zapdosEntity)->unk174 = 200; + GetEntInfo(zapdosEntity)->unk174.raw = 200; // incorrect value? Overwritten immediately anyway PlaySoundEffect(0x1ea); for(iVar1 = 200; iVar1 >= 0; iVar1 -= 5) { - GetEntInfo(zapdosEntity)->unk174 = iVar1 * 256; + GetEntInfo(zapdosEntity)->unk174 = IntToF248_2(iVar1); sub_803E46C(0x46); } sub_803E708(0x1e,0x46); @@ -1262,11 +1263,11 @@ void MoltresDropInEffect(Entity * moltresEntity) GetEntInfo(moltresEntity)->unk15C = 1; GetEntInfo(moltresEntity)->unk15E = 0; - GetEntInfo(moltresEntity)->unk174 = 0xc800; + GetEntInfo(moltresEntity)->unk174 = IntToF248_2(200); PlaySoundEffect(0x1f8); for(iVar1 = 200; iVar1 >= 0; iVar1 -= 5) { - GetEntInfo(moltresEntity)->unk174 = iVar1 * 256; + GetEntInfo(moltresEntity)->unk174 = IntToF248_2(iVar1); sub_803E46C(0x46); } } @@ -1668,7 +1669,7 @@ void sub_8088484(Entity *param_1) PlaySoundEffect(0x1ea); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 5) { - GetEntInfo(param_1)->unk174 = iVar1 * 256; + GetEntInfo(param_1)->unk174 = IntToF248_2(iVar1); SetDungeonBGColorRGB(iVar1,iVar1,iVar1 / 2,1,0); sub_803E46C(0x46); } @@ -2477,24 +2478,24 @@ void RayquazaPostStoryPreFightDialogue(void) void RayquazaDropInEffect(Entity *rayquazaEntity) { - s32 iVar1; - s32 iVar2; + s24_8 iVar1; + s24_8 iVar2; GetEntInfo(rayquazaEntity)->unk15E = 0; - iVar2 = 51200; - iVar1 = 0x600; + iVar2 = IntToF248_2(200); + iVar1 = IntToF248_2(6); PlaySoundEffect(0x1f8); while( 1 ) { - iVar2 = iVar2 - iVar1; - iVar1 -= 0x18; - if (iVar1 < 0x14) { - iVar1 = 0x14; + iVar2.raw = iVar2.raw - iVar1.raw; // must be .raw + iVar1 = F248_Sub(iVar1, FloatToF248_2(3./32.)); + if (F248LessThanFloat(iVar1, 0.08)) { + iVar1 = FloatToF248(0.08); } - if (iVar2 < 0) break; + if (F248LessThanInt(iVar2, 0)) break; GetEntInfo(rayquazaEntity)->unk174 = iVar2; sub_803E46C(0x46); } - GetEntInfo(rayquazaEntity)->unk174 = 0; + GetEntInfo(rayquazaEntity)->unk174 = IntToF248_2(0); } void RayquazaScreenFlash(void) @@ -2750,24 +2751,24 @@ void MewtwoReFightDialogue(void) void MewtwoDropInEffect(Entity *mewtwoEntity) { - s32 iVar1; - s32 iVar2; + s24_8 iVar1; + s24_8 iVar2; GetEntInfo(mewtwoEntity)->unk15E = 0; - iVar2 = 51200; - iVar1 = 0x400; + iVar2 = IntToF248_2(200); + iVar1 = IntToF248_2(4); PlaySoundEffect(0x1f8); while( 1 ) { - iVar2 = iVar2 - iVar1; - iVar1 -= 11; - if (iVar1 < 0x1e) { - iVar1 = 0x1e; + iVar2.raw -= iVar1.raw; + iVar1 = F248_Sub(iVar1, FloatToF248_2(0.045)); + if (F248LessThanFloat(iVar1, 0.12)) { + iVar1 = FloatToF248_2(0.12); } - if (iVar2 < 0) break; + if (F248LessThanInt(iVar2, 0)) break; GetEntInfo(mewtwoEntity)->unk174 = iVar2; sub_803E46C(0x46); } - GetEntInfo(mewtwoEntity)->unk174 = 0; + GetEntInfo(mewtwoEntity)->unk174 = IntToF248_2(0); } void MewtwoScreenFlash(void) @@ -3209,24 +3210,24 @@ void SuicunePostStoryPreFightDialogue(void) void sub_808A528(Entity * param_1) { - s32 iVar1; - s32 iVar2; + s24_8 iVar1; + s24_8 iVar2; GetEntInfo(param_1)->unk15E = 0; - iVar2 = 51200; - iVar1 = 3072; + iVar2 = IntToF248(200); + iVar1 = IntToF248(12); PlaySoundEffect(0x1f8); while( 1 ) { - iVar2 = iVar2 - iVar1; - iVar1 -= 96; - if (iVar1 < 20) { - iVar1 = 20; + iVar2.raw -= iVar1.raw; + iVar1 = F248_Sub(iVar1, FloatToF248(0.375)); + if (F248LessThanFloat(iVar1, 0.08)) { + iVar1 = FloatToF248_2(0.08); } - if (iVar2 < 0) break; + if (F248LessThanInt(iVar2, 0)) break; GetEntInfo(param_1)->unk174 = iVar2; sub_803E46C(70); } - GetEntInfo(param_1)->unk174 = 0; + GetEntInfo(param_1)->unk174 = IntToF248_2(0); } void SuicuneScreenFlash(void) @@ -3387,24 +3388,24 @@ void HoOhReFightDialogue(void) void HoOhDropInEffect(Entity * param_1) { - s32 iVar1; - s32 iVar2; + s24_8 iVar1; + s24_8 iVar2; GetEntInfo(param_1)->unk15E = 0; - iVar2 = 51200; - iVar1 = 3072; + iVar2 = IntToF248(200); + iVar1 = IntToF248(12); PlaySoundEffect(0x1f8); while( 1 ) { - iVar2 = iVar2 - iVar1; - iVar1 -= 96; - if (iVar1 < 20) { - iVar1 = 20; + iVar2.raw -= iVar1.raw; + iVar1 = F248_Sub(iVar1, FloatToF248(0.375)); + if (F248LessThanFloat(iVar1, 0.08)) { + iVar1 = FloatToF248_2(0.08); } - if (iVar2 < 0) break; + if (F248LessThanInt(iVar2, 0)) break; GetEntInfo(param_1)->unk174 = iVar2; sub_803E46C(70); } - GetEntInfo(param_1)->unk174 = 0; + GetEntInfo(param_1)->unk174 = IntToF248_2(0); } void HoOhScreenFlash(void) @@ -4244,25 +4245,25 @@ void sub_808BBA8(Entity *jirachiEntity) void JirachiDropInEffect(Entity *jirachiEntity) { - s32 iVar1; - s32 iVar2; + s24_8 iVar1; + s24_8 iVar2; sub_80861F8(0x1b,jirachiEntity,0); sub_8086A54(jirachiEntity); sub_80861B8(jirachiEntity,0xe,DIRECTION_SOUTH); - iVar1 = 0xa000; - iVar2 = 0x200; + iVar1 = IntToF248(160); + iVar2 = IntToF248(2); PlaySoundEffect(0x1f8); - while( 1 ) { - iVar1 = iVar1 - iVar2; - if (iVar1 < 0x1800) { - iVar2 = 0x100; + while (1) { + iVar1.raw = iVar1.raw - iVar2.raw; // FRAGILE! Subtraction and assignment below must use .raw + if (F248LessThanInt(iVar1, 24)) { + iVar2.raw = IntToF248_2(1).raw; } - if (iVar1 < 0) break; + if (F248LessThanInt(iVar1, 0)) break; GetEntInfo(jirachiEntity)->unk174 = iVar1; sub_803E46C(0x46); } - GetEntInfo(jirachiEntity)->unk174 = 0; + GetEntInfo(jirachiEntity)->unk174 = IntToF248_2(0); } void JirachiSpinEffect(Entity * jirachiEntity) @@ -4880,11 +4881,11 @@ void sub_808C8E0(Entity *entity) PlaySoundEffect(0x1a5); sub_806CDD4(entity, 0, DIRECTION_SOUTH); for(iVar1 = 0; iVar1 < 16; iVar1++){ - GetEntInfo(entity)->unk174 = iVar1 * 256; + GetEntInfo(entity)->unk174 = IntToF248_2(iVar1); sub_803E46C(0x46); } for(iVar1 = 16; iVar1 < 200; iVar1 += 4){ - GetEntInfo(entity)->unk174 = iVar1 * 256; + GetEntInfo(entity)->unk174 = IntToF248_2(iVar1); sub_803E46C(0x46); } sub_8086A3C(entity); diff --git a/src/dungeon_util_1.c b/src/dungeon_util_1.c index ce3acb3f1..d863debc7 100644 --- a/src/dungeon_util_1.c +++ b/src/dungeon_util_1.c @@ -11,6 +11,7 @@ #include "dungeon_leader.h" #include "dungeon_util.h" #include "random.h" +#include "math.h" #include "structs/str_dungeon.h" extern s32 gUnknown_202F3D8; @@ -179,7 +180,7 @@ void sub_80856E0(Entity * pokemon, s32 direction) for(counter = 0; counter < 5; counter++) { - entityInfo->unk174 += 0x200; + entityInfo->unk174 = F248_Add(entityInfo->unk174, IntToF248(2)); sub_803E46C(0x46); } entityInfo->action.direction = direction & DIRECTION_MASK; @@ -187,10 +188,10 @@ void sub_80856E0(Entity * pokemon, s32 direction) for(counter = 0; counter < 5; counter++) { - entityInfo->unk174 -= 0x200; + entityInfo->unk174 = F248_Sub(entityInfo->unk174, IntToF248(2)); sub_803E46C(0x46); } - entityInfo->unk174 = 0; + entityInfo->unk174.raw = 0; // weird one that doesn't match with struct assignment sub_803E46C(0x46); } diff --git a/src/ground_script_1.c b/src/ground_script_1.c index cb24ea8af..f426bf597 100644 --- a/src/ground_script_1.c +++ b/src/ground_script_1.c @@ -1058,11 +1058,12 @@ s32 ExecuteScriptCommand(Action *action) { break; } case 0x71: case 0x77: case 0x7d: case 0x83: { +#define HYPOT FP24_8_Hypot((s24_8){scriptData->pos2.x - scriptData->pos1.x}, (s24_8){scriptData->pos2.y - scriptData->pos1.y}).raw / curCmd.argShort action->callbacks->getHitboxCenter(action->parentObject, &scriptData->pos1); scriptData->pos2.x = curCmd.arg1 << 8; scriptData->pos2.y = curCmd.arg2 << 8; if (curCmd.op == 0x7d || curCmd.op == 0x83) { - scriptData->unk2A = FP24_8_Hypot(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; + scriptData->unk2A = HYPOT; if (scriptData->unk2A <= 0) scriptData->unk2A = 1; } else { scriptData->unk2A = curCmd.argShort; @@ -1074,7 +1075,7 @@ s32 ExecuteScriptCommand(Action *action) { scriptData->pos2.x = scriptData->pos1.x + (curCmd.arg1 << 8); scriptData->pos2.y = scriptData->pos1.y + (curCmd.arg2 << 8); if (curCmd.op == 0x7e || curCmd.op == 0x84) { - scriptData->unk2A = FP24_8_Hypot(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; + scriptData->unk2A = HYPOT; if (scriptData->unk2A <= 0) scriptData->unk2A = 1; } else { scriptData->unk2A = curCmd.argShort; @@ -1097,7 +1098,7 @@ s32 ExecuteScriptCommand(Action *action) { scriptData->pos2.y = scriptData->pos1.y + ((OtherRandInt(curCmd.arg2 * 2 + 1) - curCmd.arg2) << 8); #endif if (curCmd.op == 0x7f || curCmd.op == 0x85) { - scriptData->unk2A = FP24_8_Hypot(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; + scriptData->unk2A = HYPOT; if (scriptData->unk2A <= 0) scriptData->unk2A = 1; } else { scriptData->unk2A = curCmd.argShort; @@ -1109,7 +1110,7 @@ s32 ExecuteScriptCommand(Action *action) { scriptData->pos2 = scriptData->pos1; GroundLink_GetPos((s16)curCmd.arg1, &scriptData->pos2); if (curCmd.op == 0x80 || curCmd.op == 0x86) { - scriptData->unk2A = FP24_8_Hypot(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; + scriptData->unk2A = HYPOT; if (scriptData->unk2A <= 0) scriptData->unk2A = 1; } else { scriptData->unk2A = curCmd.argShort; @@ -1123,7 +1124,7 @@ s32 ExecuteScriptCommand(Action *action) { scriptData->pos2.x = scriptData->pos2.x + ((OtherRandInt(cap) - curCmd.argShort) << 8); scriptData->pos2.y = scriptData->pos2.y + ((OtherRandInt(cap) - curCmd.argShort) << 8); if (curCmd.op == 0x81 || curCmd.op == 0x87) { - scriptData->unk2A = FP24_8_Hypot(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; + scriptData->unk2A = HYPOT; if (scriptData->unk2A <= 0) scriptData->unk2A = 1; } else { scriptData->unk2A = curCmd.argShort; @@ -1136,7 +1137,7 @@ s32 ExecuteScriptCommand(Action *action) { action->callbacks->getHitboxCenter(action->parentObject, &scriptData->pos1); sub_80A8FD8(ret, &scriptData->pos2); if (curCmd.op == 0x82 || curCmd.op == 0x88) { - scriptData->unk2A = FP24_8_Hypot(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort; + scriptData->unk2A = HYPOT; if (scriptData->unk2A <= 0) scriptData->unk2A = 1; } else { scriptData->unk2A = curCmd.argShort; diff --git a/src/math.c b/src/math.c index 84c243b1b..a63c1cf94 100644 --- a/src/math.c +++ b/src/math.c @@ -6,8 +6,8 @@ static void F48_16_UDiv(s48_16 *, s48_16 *, s48_16 *); static void F48_16_UMul(s48_16 *, s48_16 *, s48_16 *); -static u24_8 u24_8_div(u24_8, u24_8); -static u24_8 u24_8_mul(u24_8, u24_8); +static s24_8 u24_8_div(s24_8, s24_8); +static s24_8 u24_8_mul(s24_8, s24_8); /** * This function computes a value modulo 3, using a lookup table for values less @@ -92,25 +92,25 @@ s24_8 s24_8_mul(s24_8 x, s24_8 y) bool8 sgn0; bool8 sgn1; - sgn0 = x < 0; - sgn1 = y < 0; + sgn0 = x.raw < 0; + sgn1 = y.raw < 0; - if (x == 0) - return 0; + if (x.raw == 0) + return (s24_8){0}; - if (y == 0) - return 0; + if (y.raw == 0) + return (s24_8){0}; if (sgn0) - x = -x; + x.raw = -x.raw; if (sgn1) - y = -y; + y.raw = -y.raw; ret = u24_8_mul(x, y); if (sgn0 != sgn1) - ret = -ret; + ret.raw = -ret.raw; return ret; } @@ -129,25 +129,25 @@ static s24_8 s24_8_div(s24_8 x, s24_8 y) bool8 sgn0; bool8 sgn1; - sgn0 = x < 0; - sgn1 = y < 0; + sgn0 = x.raw < 0; + sgn1 = y.raw < 0; - if (y == 0) - return INT32_MAX; + if (y.raw == 0) + return (s24_8){INT32_MAX}; - if (x == 0) - return 0; + if (x.raw == 0) + return (s24_8){0}; if (sgn0) - x = -x; + x.raw = -x.raw; if (sgn1) - y = -y; + y.raw = -y.raw; ret = u24_8_div(x, y); if (sgn0 != sgn1) - ret = -ret; + ret.raw = -ret.raw; return ret; } @@ -160,7 +160,7 @@ static s24_8 s24_8_div(s24_8 x, s24_8 y) * * @return The product `x*y` as an unsigned 24.8 fixed-point number. */ -static u24_8 u24_8_mul(u24_8 x, u24_8 y) +static s24_8 u24_8_mul(s24_8 x, s24_8 y) { // We need 64 bits for intermediate steps of the multiplication. u32 x_h, x_l; @@ -171,13 +171,13 @@ static u24_8 u24_8_mul(u24_8 x, u24_8 y) u32 high_bit_mask; u32 round_up; - if (x == 0 || y == 0) - return 0; + if (x.raw == 0 || y.raw == 0) + return (s24_8){0}; x_h = 0; - x_l = x; + x_l = x.raw; y_h = 0; - y_l = y; + y_l = y.raw; out_h = 0; out_l = 0; high_bit_mask = 0x80 << 24; // high bit of u32 @@ -215,7 +215,7 @@ static u24_8 u24_8_mul(u24_8 x, u24_8 y) ++out_l; } - return out_l; + return (s24_8){out_l}; } /** @@ -226,7 +226,7 @@ static u24_8 u24_8_mul(u24_8 x, u24_8 y) * * @return The quotient `x/y` as an unsigned 24.8 fixed-point number. */ -static u24_8 u24_8_div(u24_8 x, u24_8 y) +static s24_8 u24_8_div(s24_8 x, s24_8 y) { bool8 bVar1; u32 r9; @@ -240,15 +240,15 @@ static u24_8 u24_8_div(u24_8 x, u24_8 y) s32 sl; s32 temp; - if (y == 0) - return INT32_MAX; + if (y.raw == 0) + return (s24_8){INT32_MAX}; - if (x == 0) - return 0; + if (x.raw == 0) + return (s24_8){0}; - r7 = x >> 24; - r6 = x << 8; - sl = y; + r7 = (u32)x.raw >> 24; + r6 = x.raw << 8; + sl = y.raw; r9 = 0; r5 = 0; r4 = 0; @@ -286,19 +286,19 @@ static u24_8 u24_8_div(u24_8 x, u24_8 y) r9 |= r8; } - return r9; + return (s24_8){r9}; } -UNUSED s32 FP24_8_Pow(s32 x, s32 y) +UNUSED s24_8 FP24_8_Pow(s24_8 x, s32 y) { s32 uVar1; - s32 sVar1; + s24_8 sVar1; uVar1 = y; if (uVar1 < 0) uVar1 = -uVar1; - sVar1 = 0x100; + sVar1 = IntToF248(1); for (; uVar1 != 0; uVar1 >>= 1) { if (uVar1 & 1) @@ -310,37 +310,37 @@ UNUSED s32 FP24_8_Pow(s32 x, s32 y) if (y >= 0) return sVar1; - return s24_8_div(0x100, sVar1); + return s24_8_div(IntToF248(1), sVar1); } -s32 FP24_8_Hypot(s32 x, s32 y) +s24_8 FP24_8_Hypot(s24_8 x, s24_8 y) { - s32 r4; + s24_8 r4; s32 i; - s32 r5; - s32 r6; + s24_8 r5; + s24_8 r6; r5 = x; r6 = y; - if (r5 < 0) - r5 = -r5; + if (r5.raw < 0) + r5.raw = -r5.raw; - if (r6 < 0) - r6 = -r6; + if (r6.raw < 0) + r6.raw = -r6.raw; - if (r5 < r6) { + if (r5.raw < r6.raw) { r4 = r5; r5 = r6; r6 = r4; } - if (r6 != 0) { + if (r6.raw != 0) { for (i = 2; i >= 0; i--) { r4 = s24_8_div(r6, r5); r4 = s24_8_mul(r4, r4); - r4 = s24_8_div(r4, r4 + 0x400); - r5 += s24_8_mul(r5, r4) * 2; + r4 = s24_8_div(r4, F248_Add(r4, IntToF248(4))); + r5 = F248_Add(r5, F248_MulInt(s24_8_mul(r5, r4), 2)); r6 = s24_8_mul(r6, r4); } } @@ -376,21 +376,21 @@ u32 FP48_16_ToS32(s48_16 *a) return uVar1; } -UNUSED u32 FP48_16_ToF248(u32 *a) +UNUSED s24_8 FP48_16_ToF248(s48_16 *a) { u32 uVar1; - uVar1 = ((u8)a[0] << 24) | a[1] >> 8; - if (a[1] & 0x8000) + uVar1 = ((u8)a->hi << 24) | a->lo >> 8; + if (a->lo & 0x8000) uVar1++; - return uVar1; + return (s24_8){uVar1}; } -void FP48_16_FromF248(s48_16 *a, s32 b) +void FP48_16_FromF248(s48_16 *a, s24_8 b) { - a->lo = b << 8; - a->hi = b >> 24; + a->lo = b.raw << 8; + a->hi = b.raw >> 24; if (a->hi & 0x80) a->hi |= ~0x7F; diff --git a/src/move_actions.c b/src/move_actions.c index 0f8b6bd9c..1a2d20ecd 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -361,7 +361,7 @@ bool32 sub_8057824(Entity *pokemon, Entity *target, Move *move, s32 param_4) bool32 sub_805783C(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C,0x80,TRUE); + ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C,FloatToF248(0.5),TRUE); return TRUE; } @@ -551,7 +551,7 @@ bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_4) bool8 sub_8057C68(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - ChangeDefenseMultiplierTarget(pokemon, target, gUnknown_8106A4C, 0x40, 1); + ChangeDefenseMultiplierTarget(pokemon, target, gUnknown_8106A4C, FloatToF248(0.25), 1); return TRUE; } @@ -680,7 +680,7 @@ bool8 sub_8057ED0(Entity *pokemon, Entity *target, Move *move, u32 param_4) flag = TRUE; if(sub_805727C(pokemon, target, gUnknown_80F4E04)) { - ChangeAttackMultiplierTarget(pokemon, target, gUnknown_8106A4C, 0x80, FALSE); + ChangeAttackMultiplierTarget(pokemon, target, gUnknown_8106A4C, FloatToF248(0.5), FALSE); } } return flag; @@ -692,8 +692,8 @@ bool8 sub_8057F24(Entity *pokemon, Entity *target, Move *move, s32 param_4) entityInfo = GetEntInfo(pokemon); entityInfo->HP = 1; - ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C,0x40,TRUE); - ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A50,0x40,TRUE); + ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C,FloatToF248(0.25),TRUE); + ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A50,FloatToF248(0.25),TRUE); entityInfo->unk154 = 1; return TRUE; } diff --git a/src/move_checks.c b/src/move_checks.c index 0e9855955..d955fc4aa 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -1,4 +1,5 @@ #include "global.h" +#include "math.h" #include "constants/status.h" #include "constants/type.h" #include "constants/weather.h" @@ -586,7 +587,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_CHARM: - if (targetData->offensiveMultipliers[STAT_STAGE_ATK] < STAT_MULTIPLIER_THRESHOLD) + if (F248LessThanFloat(targetData->offensiveMultipliers[STAT_STAGE_ATK], STAT_MULTIPLIER_THRESHOLD)) { return FALSE; } @@ -628,7 +629,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_SCREECH: - if (targetData->defensiveMultipliers[STAT_STAGE_DEF] < STAT_MULTIPLIER_THRESHOLD) + if (F248LessThanFloat(targetData->defensiveMultipliers[STAT_STAGE_DEF], STAT_MULTIPLIER_THRESHOLD)) { return FALSE; } @@ -652,8 +653,8 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_MEMENTO: - if (targetData->offensiveMultipliers[STAT_STAGE_ATK] < STAT_MULTIPLIER_THRESHOLD && - targetData->offensiveMultipliers[STAT_STAGE_SP_ATK] < STAT_MULTIPLIER_THRESHOLD) + if (F248LessThanFloat(targetData->offensiveMultipliers[STAT_STAGE_ATK], STAT_MULTIPLIER_THRESHOLD) && + F248LessThanFloat(targetData->offensiveMultipliers[STAT_STAGE_SP_ATK], STAT_MULTIPLIER_THRESHOLD)) { return FALSE; } @@ -728,8 +729,8 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) if (targetData->offensiveStages[i] < DEFAULT_STAT_STAGE) break; if (targetData->defensiveStages[i] < DEFAULT_STAT_STAGE) break; if (targetData->hitChanceStages[i] < DEFAULT_STAT_STAGE || - targetData->offensiveMultipliers[i] < DEFAULT_STAT_MULTIPLIER || - targetData->defensiveMultipliers[i] < DEFAULT_STAT_MULTIPLIER) + F248LessThanInt(targetData->offensiveMultipliers[i], 1) || + F248LessThanInt(targetData->defensiveMultipliers[i], 1)) { break; } @@ -753,8 +754,8 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) if (userData->offensiveStages[i] < targetData->offensiveStages[i]) break; if (userData->defensiveStages[i] < targetData->defensiveStages[i] || userData->hitChanceStages[i] < targetData->hitChanceStages[i] || - userData->offensiveMultipliers[i] < targetData->offensiveMultipliers[i] || - userData->defensiveMultipliers[i] < targetData->defensiveMultipliers[i]) + userData->offensiveMultipliers[i].raw < targetData->offensiveMultipliers[i].raw || + userData->defensiveMultipliers[i].raw < targetData->defensiveMultipliers[i].raw) { break; } diff --git a/src/status.c b/src/status.c index 8215879cc..4690c7e3d 100644 --- a/src/status.c +++ b/src/status.c @@ -223,10 +223,10 @@ void UpdateFlashFireBoost(Entity * pokemon, Entity *target) } } -void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s32 param_4, bool8 displayMessage) +void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s24_8 param_4, bool8 displayMessage) { EntityInfo *entityInfo; - s32 oldMulti; + s24_8 oldMulti; if (!EntityExists(target)) { return; @@ -238,17 +238,17 @@ void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage else { strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0B8); } - if ((param_4 < 0x100) && sub_8071728(pokemon,target,displayMessage)) { + if (F248LessThanInt(param_4, 1) && sub_8071728(pokemon,target,displayMessage)) { return; } - if ((HasHeldItem(target,ITEM_TWIST_BAND)) && (param_4 < 0x100)) { + if ((HasHeldItem(target,ITEM_TWIST_BAND)) && F248LessThanInt(param_4, 1)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550); return; } - if (HasAbility(target, ABILITY_HYPER_CUTTER) && (statStage == STAT_STAGE_ATK) && (param_4 < 0x100)) { + if (HasAbility(target, ABILITY_HYPER_CUTTER) && (statStage == STAT_STAGE_ATK) && F248LessThanInt(param_4, 1)) { if (displayMessage) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60); @@ -260,7 +260,7 @@ void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); oldMulti = entityInfo->offensiveMultipliers[statStage]; - if (param_4 < 0x100) { + if (F248LessThanInt(param_4, 1)) { sub_8041FD8(target,statStage); } else { @@ -269,16 +269,16 @@ void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage entityInfo->offensiveMultipliers[statStage] = s24_8_mul(entityInfo->offensiveMultipliers[statStage],param_4); - if (entityInfo->offensiveMultipliers[statStage] < 2) { - entityInfo->offensiveMultipliers[statStage] = 2; + if (F248LessThanFloat(entityInfo->offensiveMultipliers[statStage], 0.01)) { + entityInfo->offensiveMultipliers[statStage] = FloatToF248(0.01); } - if (0x63fd < entityInfo->offensiveMultipliers[statStage]) { - entityInfo->offensiveMultipliers[statStage] = 0x63fd; // 25597 + if (FloatLessThanF248(99.99, entityInfo->offensiveMultipliers[statStage])) { + entityInfo->offensiveMultipliers[statStage] = FloatToF248(99.99); } - if (oldMulti > entityInfo->offensiveMultipliers[statStage]) { + if (F248GreaterThan(oldMulti, entityInfo->offensiveMultipliers[statStage])) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC11C); } - else if (oldMulti < entityInfo->offensiveMultipliers[statStage]) { + else if (F248LessThan(oldMulti, entityInfo->offensiveMultipliers[statStage])) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC118); } else @@ -288,10 +288,10 @@ void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage EntityUpdateStatusSprites(target); } -void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s32 param_4, bool8 displayMessage) +void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s24_8 param_4, bool8 displayMessage) { EntityInfo *entityInfo; - s32 oldMulti; + s24_8 oldMulti; if (!EntityExists(target)) { return; @@ -303,7 +303,7 @@ void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStag else { strcpy(gFormatBuffer_Items[0],*gUnknown_80FC09C); } - if ((param_4 < 0x100) && sub_8071728(pokemon,target,displayMessage)) { + if (F248LessThanInt(param_4, 1) && sub_8071728(pokemon,target,displayMessage)) { return; } @@ -311,7 +311,7 @@ void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStag SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); oldMulti = entityInfo->defensiveMultipliers[statStage]; - if (param_4 < 0x100) { + if (F248LessThanInt(param_4, 1)) { sub_804201C(target,statStage); } else { @@ -320,16 +320,16 @@ void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStag entityInfo->defensiveMultipliers[statStage] = s24_8_mul(entityInfo->defensiveMultipliers[statStage],param_4); - if (entityInfo->defensiveMultipliers[statStage] < 2) { - entityInfo->defensiveMultipliers[statStage] = 2; + if (F248LessThanFloat(entityInfo->defensiveMultipliers[statStage], 0.01)) { + entityInfo->defensiveMultipliers[statStage] = FloatToF248(0.01); } - if (0x63fd < entityInfo->defensiveMultipliers[statStage]) { - entityInfo->defensiveMultipliers[statStage] = 0x63fd; // 25597 + if (FloatLessThanF248(99.99, entityInfo->defensiveMultipliers[statStage])) { + entityInfo->defensiveMultipliers[statStage] = FloatToF248(99.99); } - if (oldMulti > entityInfo->defensiveMultipliers[statStage]) { + if (F248GreaterThan(oldMulti, entityInfo->defensiveMultipliers[statStage])) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC114); } - else if (oldMulti < entityInfo->defensiveMultipliers[statStage]) { + else if (F248LessThan(oldMulti, entityInfo->defensiveMultipliers[statStage])) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC0FC); } else From f46866840cc4f9466795656c967742a37a5428c3 Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Tue, 12 Nov 2024 08:55:32 +0100 Subject: [PATCH 42/48] Move CompactPos struct to common header --- include/ground_script.h | 16 +++++----------- include/structs/str_position.h | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/include/ground_script.h b/include/ground_script.h index 678a54c25..f9e66fd9d 100644 --- a/include/ground_script.h +++ b/include/ground_script.h @@ -135,14 +135,8 @@ typedef struct ScriptRef extern const ScriptRef gFunctionScriptTable[]; -struct CompactPos { - u8 xTiles; - u8 yTiles; - u8 xFlags; - u8 yFlags; -}; struct GroundLink { - struct CompactPos pos; + CompactPos pos; u8 width; u8 height; u8 ret; @@ -153,7 +147,7 @@ typedef struct GroundLivesData { u8 unk1; u8 width; u8 height; - struct CompactPos pos; + CompactPos pos; const ScriptCommand *scripts[4]; } GroundLivesData; typedef struct GroundObjectData { @@ -161,7 +155,7 @@ typedef struct GroundObjectData { u8 unk1; u8 width; u8 height; - struct CompactPos pos; + CompactPos pos; const ScriptCommand *scripts[4]; } GroundObjectData; typedef struct GroundEffectData { @@ -169,7 +163,7 @@ typedef struct GroundEffectData { u8 unk1; u8 width; u8 height; - struct CompactPos pos; + CompactPos pos; const ScriptCommand *script; } GroundEffectData; typedef struct GroundEventData { @@ -177,7 +171,7 @@ typedef struct GroundEventData { u8 unk1; u8 width; u8 height; - struct CompactPos pos; + CompactPos pos; const ScriptRef *script; } GroundEventData; diff --git a/include/structs/str_position.h b/include/structs/str_position.h index a376af4bf..f767b80c4 100644 --- a/include/structs/str_position.h +++ b/include/structs/str_position.h @@ -8,6 +8,10 @@ typedef struct Position /* 0x2 */ s16 y; } Position; +/** + * Precise position expressed in pixel units, as s24_8 fixpoint. + * This type has subpixel precision to 1/256th of a pixel. + */ // size: 0x8 typedef struct Position32 { @@ -15,4 +19,17 @@ typedef struct Position32 /* 0x4 */ s32 y; } Position32; +/** + * Currently only used in script data, for entities and GroundLink data. + * Position expressed in terms of *graphics* tiles, 8 pixels per unit. + * Flags allow expressing half-tile offsets and allow using a current/default coordinate. + */ +// size: 0x4 +typedef struct CompactPos { + u8 xTiles; + u8 yTiles; + u8 xFlags; + u8 yFlags; +} CompactPos; + #endif // GUARD_STR_POSITION_H From 8ba2124f1e7b986f6f2dc269a7b50b1db1a3af33 Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Tue, 12 Nov 2024 16:08:43 +0100 Subject: [PATCH 43/48] Rename Positions --- include/code_800DAC0.h | 4 +- include/code_800F958.h | 2 +- include/code_803E724.h | 2 +- include/code_80450F8.h | 4 +- include/code_8069D4C.h | 2 +- include/code_807CD9C.h | 2 +- include/dungeon_ai_items.h | 2 +- include/dungeon_cutscenes.h | 6 +-- include/dungeon_map_access.h | 4 +- include/dungeon_message.h | 2 +- include/dungeon_movement.h | 10 ++-- include/dungeon_pokemon_sprites.h | 4 +- include/dungeon_range.h | 6 +-- include/dungeon_util.h | 6 +-- include/dungeon_util_1.h | 2 +- include/dungeon_visibility.h | 4 +- include/ground_script.h | 16 +++---- include/position_util.h | 4 +- include/sprite.h | 2 +- include/string_format.h | 2 +- include/structs/axdata.h | 10 ++-- include/structs/dungeon_entity.h | 26 +++++----- include/structs/map.h | 2 +- include/structs/menu.h | 6 +-- include/structs/str_dungeon.h | 18 +++---- include/structs/str_position.h | 10 ++-- include/tile_types.h | 2 +- include/trap.h | 14 +++--- src/code_800558C.c | 18 +++---- src/code_800F958.c | 10 ++-- src/code_803E46C.c | 2 +- src/code_803E724.c | 2 +- src/code_8041AD0.c | 12 ++--- src/code_804267C.c | 12 ++--- src/code_8042B34.c | 13 ++--- src/code_8044CC8.c | 6 +-- src/code_80450F8.c | 4 +- src/code_8045A00.c | 4 +- src/code_8048480.c | 2 +- src/code_805D8C8_1.c | 21 ++++---- src/code_8066D04.c | 4 +- src/code_8069D4C.c | 2 +- src/code_806CD90.c | 4 +- src/code_80718D8.c | 4 +- src/code_8072B78.c | 2 +- src/code_8073CF0.c | 14 +++--- src/code_8075708.c | 2 +- src/code_807CD9C.c | 21 ++++---- src/code_807E1A0.c | 6 +-- src/code_8085E98.c | 5 +- src/code_80861A8.c | 4 +- src/code_80869E4.c | 8 ++-- src/dungeon_ai_attack.c | 2 +- src/dungeon_ai_items.c | 10 ++-- src/dungeon_ai_leader.c | 8 ++-- src/dungeon_ai_movement.c | 6 +-- src/dungeon_ai_targeting.c | 2 +- src/dungeon_cutscenes.c | 46 +++++++++--------- src/dungeon_items.c | 2 +- src/dungeon_map_access.c | 8 ++-- src/dungeon_message.c | 5 +- src/dungeon_move.c | 32 ++++++------- src/dungeon_movement.c | 10 ++-- src/dungeon_range.c | 8 ++-- src/dungeon_serializer.c | 22 ++++----- src/dungeon_util.c | 4 +- src/dungeon_util_1.c | 2 +- src/dungeon_visibility.c | 4 +- src/ground_script_1.c | 79 ++++++++++++++++--------------- src/menu_input.c | 6 +-- src/move_actions.c | 24 +++++----- src/position_util.c | 4 +- src/sprite.c | 4 +- src/status_actions.c | 20 ++++---- src/string_format.c | 6 +-- src/tile_types.c | 12 ++--- src/trap.c | 23 ++++----- src/trap_1.c | 4 +- tmp/fixpoint.cocci | 17 ------- tmp/position.cocci | 17 +++++++ tmp/renames.sed | 26 ---------- 81 files changed, 377 insertions(+), 392 deletions(-) delete mode 100644 tmp/fixpoint.cocci create mode 100644 tmp/position.cocci delete mode 100644 tmp/renames.sed diff --git a/include/code_800DAC0.h b/include/code_800DAC0.h index 9ad99d82e..efe6a6844 100644 --- a/include/code_800DAC0.h +++ b/include/code_800DAC0.h @@ -25,7 +25,7 @@ bool8 sub_800E9A8(s32); void sub_800DAC0(u32); void sub_800DB7C(void); void sub_800DBBC(void); -void sub_800E90C(Position *); -void sub_800E8AC(s32 a0, void *a1, void *a2, s32 a3, void *a4); // a2 could be Position +void sub_800E90C(DungeonPos *); +void sub_800E8AC(s32 a0, void *a1, void *a2, s32 a3, void *a4); // a2 could be DungeonPos #endif // GUARD_CODE_800DAC0_H diff --git a/include/code_800F958.h b/include/code_800F958.h index 884e9a7f9..112b73916 100644 --- a/include/code_800F958.h +++ b/include/code_800F958.h @@ -3,6 +3,6 @@ #include "structs/str_position.h" -void AddPokemonDungeonSprite(s32 id, s16 species, Position *pos, u32); +void AddPokemonDungeonSprite(s32 id, s16 species, DungeonPos *pos, u32); #endif // GUARD_CODE_800F958_H \ No newline at end of file diff --git a/include/code_803E724.h b/include/code_803E724.h index a72345f17..026600408 100644 --- a/include/code_803E724.h +++ b/include/code_803E724.h @@ -3,6 +3,6 @@ #include "structs/str_position.h" -bool8 sub_803F428(Position *pos); +bool8 sub_803F428(DungeonPos *pos); #endif // GUARD_CODE_803E724_H \ No newline at end of file diff --git a/include/code_80450F8.h b/include/code_80450F8.h index 82374dd0c..f86f4a608 100644 --- a/include/code_80450F8.h +++ b/include/code_80450F8.h @@ -3,8 +3,8 @@ #include "structs/dungeon_entity.h" -Entity *sub_8045684(u8 trapID, Position *pos, u8 c); -Entity *sub_8045708(Position *pos); +Entity *sub_8045684(u8 trapID, DungeonPos *pos, u8 c); +Entity *sub_8045708(DungeonPos *pos); void sub_80457DC(Entity* ent); #endif // GUARD_CODE_80227B8_H \ No newline at end of file diff --git a/include/code_8069D4C.h b/include/code_8069D4C.h index 6e4ab6f9a..1a174e7e6 100644 --- a/include/code_8069D4C.h +++ b/include/code_8069D4C.h @@ -14,7 +14,7 @@ struct unkStruct_8069D4C_sub struct unkStruct_8069D4C { s16 id; - Position pos; + DungeonPos pos; s16 HP; struct unkStruct_8069D4C_sub offense; u16 level; diff --git a/include/code_807CD9C.h b/include/code_807CD9C.h index 0f3c8dafc..e61d18766 100644 --- a/include/code_807CD9C.h +++ b/include/code_807CD9C.h @@ -2,7 +2,7 @@ #define CODE_807CD9C_H void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction); -void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos); +void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, DungeonPos *pos); void sub_807D3CC(Entity *param_1); #endif /* ifndef CODE_807CD9C_H */ diff --git a/include/dungeon_ai_items.h b/include/dungeon_ai_items.h index 05d909cef..960b33009 100644 --- a/include/dungeon_ai_items.h +++ b/include/dungeon_ai_items.h @@ -6,7 +6,7 @@ void AIDecideUseItem(Entity *pokemon); void GetPossibleAIThrownItemDirections(Entity *pokemon, s32 thrownAIFlag, Item *item, bool8 ignoreRollChance); -void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, Position potentialTargets[], bool8 ignoreRollChance); +void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, DungeonPos potentialTargets[], bool8 ignoreRollChance); void TargetThrownItem(Entity *pokemon, Entity *targetPokemon, Item *item, s32 targetingFlags, bool8 ignoreRollChance); #endif diff --git a/include/dungeon_cutscenes.h b/include/dungeon_cutscenes.h index 1e8c4240a..8a190c10c 100644 --- a/include/dungeon_cutscenes.h +++ b/include/dungeon_cutscenes.h @@ -114,9 +114,9 @@ void sub_808AC3C(void); void sub_808ACC0(void); void sub_808AD48(void); void sub_808ADCC(void); -void sub_808AE54(u8, u8, Position *pos); -void sub_808AEC8(u8, u8, Position *pos); -void sub_808AF3C(u8, u8, Position *pos); +void sub_808AE54(u8, u8, DungeonPos *pos); +void sub_808AEC8(u8, u8, DungeonPos *pos); +void sub_808AF3C(u8, u8, DungeonPos *pos); void sub_808AFB0(u8); void sub_808B030(u8); void sub_808B0B0(u8); diff --git a/include/dungeon_map_access.h b/include/dungeon_map_access.h index d95b12019..adee8dc5b 100644 --- a/include/dungeon_map_access.h +++ b/include/dungeon_map_access.h @@ -12,6 +12,6 @@ Tile *GetTile(s32 x, s32 y); Tile *GetTileSafe(s32 x, s32 y); void sub_8049ED4(void); -void sub_804AC20(Position *pos); +void sub_804AC20(DungeonPos *pos); -#endif // GUARD_DUNGEON_MAP_ACCESS_H \ No newline at end of file +#endif // GUARD_DUNGEON_MAP_ACCESS_H diff --git a/include/dungeon_message.h b/include/dungeon_message.h index 693673b27..f8122c2c7 100644 --- a/include/dungeon_message.h +++ b/include/dungeon_message.h @@ -28,7 +28,7 @@ void LogMessageByIdWithPopupCheckUser(Entity *pokemon, const u8 *str); void TryDisplayDungeonLoggableMessage2(Entity *pokemon, const u8 *str); void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u8 *str); void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u8 *str); -void TryDisplayDungeonLoggableMessage5(Entity *pokemon, Position *pos, const u8 *str); +void TryDisplayDungeonLoggableMessage5(Entity *pokemon, DungeonPos *pos, const u8 *str); // As opposed to the above - these always display the string and save it in the message log. False/True stand for an unknown argument. Not sure what the practical difference is between these. void DisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str); diff --git a/include/dungeon_movement.h b/include/dungeon_movement.h index be363c333..1549f1aa6 100644 --- a/include/dungeon_movement.h +++ b/include/dungeon_movement.h @@ -8,12 +8,12 @@ extern u8 gWalkableTileToCrossableTerrain[8]; u8 GetCrossableTerrain(s16 species); u8 sub_807034C(s16 id, struct Tile *tile); -u8 sub_80703A0(Entity *pokemon, Position *pos); +u8 sub_80703A0(Entity *pokemon, DungeonPos *pos); bool8 CanCrossWalls(Entity *pokemon); -bool8 sub_807049C(Entity *pokemon, Position *pos); -bool8 sub_8070564(Entity *pokemon, Position *pos); -bool8 sub_80705F0(Entity *pokemon, Position *pos); -bool8 sub_80706A4(Entity *pokemon, Position *pos); +bool8 sub_807049C(Entity *pokemon, DungeonPos *pos); +bool8 sub_8070564(Entity *pokemon, DungeonPos *pos); +bool8 sub_80705F0(Entity *pokemon, DungeonPos *pos); +bool8 sub_80706A4(Entity *pokemon, DungeonPos *pos); s32 CalcSpeedStage(Entity *pokemon); #endif diff --git a/include/dungeon_pokemon_sprites.h b/include/dungeon_pokemon_sprites.h index 781c8af1b..b013ba9ab 100644 --- a/include/dungeon_pokemon_sprites.h +++ b/include/dungeon_pokemon_sprites.h @@ -20,8 +20,8 @@ typedef struct DungeonPokemonSprite /* 0xC */ u32 status; /* 0x10 */ u8 visible; /* 0x11 */ u8 unk11; - /* 0x14 */ Position pos; - /* 0x18 */ Position statusOffsets[2]; + /* 0x14 */ DungeonPos pos; + /* 0x18 */ DungeonPos statusOffsets[2]; /* 0x20 */ u32 unk20; /* 0x24 */ u32 unk24; /* 0x28 */ DungeonPokemonStatusSprite statusSprites[2]; diff --git a/include/dungeon_range.h b/include/dungeon_range.h index 905163fb5..9659a29a2 100644 --- a/include/dungeon_range.h +++ b/include/dungeon_range.h @@ -3,8 +3,8 @@ #include "structs/str_position.h" -bool8 IsPositionActuallyInSight(Position *pos1, Position *pos2); -bool8 IsPositionInSight(Position *pos1, Position *pos2); -bool8 IsTargetTwoTilesAway(Position *pos1, Position *pos2); +bool8 IsPositionActuallyInSight(DungeonPos *pos1, DungeonPos *pos2); +bool8 IsPositionInSight(DungeonPos *pos1, DungeonPos *pos2); +bool8 IsTargetTwoTilesAway(DungeonPos *pos1, DungeonPos *pos2); #endif diff --git a/include/dungeon_util.h b/include/dungeon_util.h index e2b1d27e2..5ecd4b111 100644 --- a/include/dungeon_util.h +++ b/include/dungeon_util.h @@ -6,13 +6,13 @@ #include "structs/str_position.h" #include "structs/str_traps.h" -extern const Position gAdjacentTileOffsets[NUM_DIRECTIONS]; +extern const DungeonPos gAdjacentTileOffsets[NUM_DIRECTIONS]; bool8 EntityExists(Entity *pokemon); u32 GetEntityType(Entity *entity); u8 GetEntityRoom(Entity *entity); struct Tile *GetTileAtEntitySafe(Entity *entity); -void sub_804535C(Entity *entity, Position32 *pos); +void sub_804535C(Entity *entity, PixelPos *pos); void SetEntityPixelPos(Entity *entity, s32 x, s32 y); void IncreaseEntityPixelPos(Entity *entity, s32 x, s32 y); @@ -25,4 +25,4 @@ Item *GetItemData_1(Entity *entity); Trap *GetTrapData(Entity *entity); Trap* GetTrapData_1(Entity *entity); -#endif // GUARD_DUNGEON_UTIL_H \ No newline at end of file +#endif // GUARD_DUNGEON_UTIL_H diff --git a/include/dungeon_util_1.h b/include/dungeon_util_1.h index 943647813..1923354fc 100644 --- a/include/dungeon_util_1.h +++ b/include/dungeon_util_1.h @@ -22,7 +22,7 @@ void sub_80856E0(Entity * pokemon, s32 direction); void sub_8085764(void); void sub_8085860(s32 x, s32 y); void sub_8085890(s32 x, s32 y); -void ShiftCameraToPosition(Position32 *posStruct, s32 cameraSteps); +void ShiftCameraToPosition(PixelPos *posStruct, s32 cameraSteps); void SetFacingDirection(Entity *pokemon, s32 direction); void sub_8085930(s32 direction); void sub_80859F0(s32 direction); diff --git a/include/dungeon_visibility.h b/include/dungeon_visibility.h index 935735e6f..0485e2080 100644 --- a/include/dungeon_visibility.h +++ b/include/dungeon_visibility.h @@ -6,7 +6,7 @@ bool8 CanSeeTarget(Entity *entity, Entity *targetEntity); bool8 CanTargetEntity(Entity *entity, Entity *targetEntity); bool8 sub_8045A70(Entity *entity, Entity *targetEntity); -bool8 sub_8045AAC(Entity *entity, Position *pos); -bool8 CanTargetPosition(Entity *entity, Position *pos); +bool8 sub_8045AAC(Entity *entity, DungeonPos *pos); +bool8 CanTargetPosition(Entity *entity, DungeonPos *pos); #endif diff --git a/include/ground_script.h b/include/ground_script.h index f9e66fd9d..50fb4d18d 100644 --- a/include/ground_script.h +++ b/include/ground_script.h @@ -57,8 +57,8 @@ typedef struct ScriptData /* 0x2C */ u16 unk2C; // padding /* 0x30 */ s32 unk30; - /* 0x34 */ Position32 pos1; - /* 0x3C */ Position32 pos2; + /* 0x34 */ PixelPos pos1; + /* 0x3C */ PixelPos pos2; /* 0x44 */ u8 unk44[4]; /* 0x48 */ s32 unk48; /* 0x4C */ u8 unk4C; @@ -78,14 +78,14 @@ typedef struct CallbackData // padding // All callbacks take the parentObject as first parameter /* 0x04 */ s16 (*getIndex)(void*); // id related - /* 0x08 */ void (*getSize)(void*, Position32 *out); - /* 0x0C */ void (*getHitboxCenter)(void*, Position32 *out); + /* 0x08 */ void (*getSize)(void*, PixelPos *out); + /* 0x0C */ void (*getHitboxCenter)(void*, PixelPos *out); /* 0x10 */ void (*getPosHeightAndUnk)(void*, u32 *height, u32 *unk); /* 0x14 */ void (*getDirection)(void*, s8 *dir); /* 0x18 */ void (*getFlags)(void*, u32 *flags); - /* 0x1C */ void (*setHitboxPos)(void*, Position32 *posOrNull); - /* 0x20 */ void (*setPositionBounds)(void*, Position32 *from, Position32 *to); - /* 0x24 */ bool8 (*moveReal)(void*, Position32*); + /* 0x1C */ void (*setHitboxPos)(void*, PixelPos *posOrNull); + /* 0x20 */ void (*setPositionBounds)(void*, PixelPos *from, PixelPos *to); + /* 0x24 */ bool8 (*moveReal)(void*, PixelPos*); /* 0x28 */ void (*setPosHeight)(void*, u32 height); /* 0x2C */ void (*setDirection)(void*, s8 dir); // direction must be signed char! /* 0x30 */ void (*setEventIndex)(void*, u16); @@ -94,7 +94,7 @@ typedef struct CallbackData /* 0x3C */ void (*setFlags)(void*, u32 bits); /* 0x40 */ void (*clearFlags)(void*, u32 bits); /* 0x44 */ void (*func44_livesOnlySpriteRelated)(void*, u32); - /* 0x48 */ void (*moveRelative)(void*, Position32*); + /* 0x48 */ void (*moveRelative)(void*, PixelPos*); /* 0x4C */ bool8 (*func4C_spriteRelatedCheck)(void*); /* 0x50 */ bool8 (*func50_spriteRelated)(void*); } CallbackData; diff --git a/include/position_util.h b/include/position_util.h index 03d5f9e29..d38e161f1 100644 --- a/include/position_util.h +++ b/include/position_util.h @@ -3,7 +3,7 @@ #include "structs/str_position.h" -s32 GetDirectionTowardsPosition(Position *originPos, Position *targetPos); -s32 GetDistance(Position *pos1, Position *pos2); +s32 GetDirectionTowardsPosition(DungeonPos *originPos, DungeonPos *targetPos); +s32 GetDistance(DungeonPos *pos1, DungeonPos *pos2); #endif diff --git a/include/sprite.h b/include/sprite.h index 09197daf1..c5369d187 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -34,7 +34,7 @@ void BlinkSavingIcon(void); void CopySpritesToOam(void); void InitSprites(void); void ResetSprites(bool8); -void SetSavingIconCoords(Position *); +void SetSavingIconCoords(DungeonPos *); void sub_8004E8C(unkStruct_2039DB0 *); void sub_8005180(void); void sub_8005304(void); diff --git a/include/string_format.h b/include/string_format.h index 0dd5e875a..3a8f24c7b 100644 --- a/include/string_format.h +++ b/include/string_format.h @@ -33,7 +33,7 @@ struct MonPortraitMsg { OpenedFile *faceFile; struct PortraitGfx *faceData; - Position pos; + DungeonPos pos; u8 spriteId; // Which mon's sprite to use. For example Kecleon has multiple sprites depending on whether it's green or purple. bool8 flip; // Whether the mon's sprite is flipped. u8 unkE; diff --git a/include/structs/axdata.h b/include/structs/axdata.h index a08151b7b..4f7002be9 100644 --- a/include/structs/axdata.h +++ b/include/structs/axdata.h @@ -14,9 +14,9 @@ typedef struct UnkSpriteMem // size: 0x20 typedef struct axdata1 { - /* 0x0 */ Position pos; - /* 0x4 */ Position offset; - /* 0x8 */ Position shadow; + /* 0x0 */ DungeonPos pos; + /* 0x4 */ DungeonPos offset; + /* 0x8 */ DungeonPos shadow; u32 unkC; u32 unk10; /* 0x14 */ s16 vramTileOrMaybeAnimTimer; @@ -43,8 +43,8 @@ typedef struct ax_anim /* 0x0 */ u8 frames; /* 0x1 */ u8 unkFlags; /* 0x2 */ s16 poseId; - /* 0x4 */ Position offset; - /* 0x8 */ Position shadow; + /* 0x4 */ DungeonPos offset; + /* 0x8 */ DungeonPos shadow; } ax_anim; // size: 0x3C diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 7bb65b928..c89a0b466 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -33,7 +33,7 @@ typedef struct unkStruct_8044CC8 { /* 0x0 */ u8 actionUseIndex; - /* 0x4 */ Position lastItemThrowPosition; + /* 0x4 */ DungeonPos lastItemThrowPosition; } unkStruct_8044CC8; // size: 0x18 @@ -45,7 +45,7 @@ typedef struct ActionContainer // Additional parameter alongside actionIndex. Used for things like indicating which move a PokĂ©mon should use from its moveset. /* 0x4 */ unkStruct_8044CC8 unk4[2]; // Position of the target that the PokĂ©mon wants throw an item at. - /* 0x14 */ Position itemTargetPosition; + /* 0x14 */ DungeonPos itemTargetPosition; } ActionContainer; // size: 0x4 @@ -72,7 +72,7 @@ typedef struct AITarget /* 0x4 */ u16 aiTargetSpawnGenID; /* 0x8 */ struct Entity *aiTarget; /* 0xC */ u32 unkC; - /* 0x10 */ Position aiTargetPos; + /* 0x10 */ DungeonPos aiTargetPos; } AITarget; // size: 0x4 @@ -179,11 +179,11 @@ typedef struct Muzzled // size: 0x1C typedef struct Unk_Entity_x184 { - /* 0x184 - 0x0 */ Position previousTargetMovePosition1; - /* 0x188 - 0x4 */ Position32 previousTargetMovePosition2; + /* 0x184 - 0x0 */ DungeonPos previousTargetMovePosition1; + /* 0x188 - 0x4 */ PixelPos previousTargetMovePosition2; /* 0x190 - 0xC */ s32 lastMoveDirection; // The last direction that the PokĂ©mon moved in. // Number of tiles that the PokĂ©mon moved last, multiplied by 0x100. - /* 0x194 - 0x10*/ Position32 lastMoveIncrement; + /* 0x194 - 0x10*/ PixelPos lastMoveIncrement; /* 0x19C - 0x18 */ s16 walkAnimFramesLeft; // Set when the PokĂ©mon starts moving, and counts down until the PokĂ©mon's walk animation stops. /* 0x19e - 0x1a */ u8 unk1A; } Unk_Entity_x184; @@ -241,7 +241,7 @@ typedef struct EntityInfo /* 0x5E */ u8 abilities[2]; /* 0x60 */ Item heldItem; /* 0x64 */ u8 unk64; - /* 0x68 */ Position prevPos[NUM_PREV_POS]; + /* 0x68 */ DungeonPos prevPos[NUM_PREV_POS]; /* 0x78 */ AITarget aiTarget; // Bitwise flags corresponding to selected IQ skills. /* 0x8C */ u8 IQSkillMenuFlags[NUM_PICKED_IQ_SKILLS]; // IQ skills selected in the IQ skills menu. @@ -336,8 +336,8 @@ typedef struct EntityInfo /* 0x167 */ u8 unk167; /* 0x168 */ u8 unk168; /* 0x169 */ u8 turnsSinceWarpScarfActivation; - /* 0x16C */ Position targetPos; - /* 0x170 */ Position pixelPos; + /* 0x16C */ DungeonPos targetPos; + /* 0x170 */ DungeonPos pixelPos; s24_8 unk174; u16 abilityEffectFlags; // See enum AbilityEffectFlags /* 0x17A */ u16 mimicMoveIDs[MAX_MON_MOVES]; // All moves that Mimic has copied (not sure on size...) @@ -356,12 +356,12 @@ typedef struct EntityInfo typedef struct Entity { /* 0x0 */ u32 type; - /* 0x4 */ Position pos; - /* 0x8 */ Position prevPos; + /* 0x4 */ DungeonPos pos; + /* 0x8 */ DungeonPos prevPos; // The center of the entity acccording to pixel-space coordinates, using the same origin as posWorld. // X = (posWorld * 24 + 16) * 256, while Y = (posWorld * 24 + 12) * 256. - /* 0xC */ Position32 pixelPos; - /* 0x14 */ Position32 prevPixelPos; + /* 0xC */ PixelPos pixelPos; + /* 0x14 */ PixelPos prevPixelPos; s32 unk1C; /* 0x20 */ bool8 isVisible; // Turned off when a PokĂ©mon faints. u8 fill21; diff --git a/include/structs/map.h b/include/structs/map.h index cda59ded2..b2127b929 100644 --- a/include/structs/map.h +++ b/include/structs/map.h @@ -56,7 +56,7 @@ typedef struct RoomData u8 unk0; u8 unk1; // All coordinates are inclusive. - // These are not aligned properly to use the Position struct. + // These are not aligned properly to use the DungeonPos struct. /* 0x2 */ s16 bottomRightCornerX; /* 0x4 */ s16 bottomRightCornerY; /* 0x6 */ s16 topLeftCornerX; diff --git a/include/structs/menu.h b/include/structs/menu.h index 96391e592..3d64a5760 100644 --- a/include/structs/menu.h +++ b/include/structs/menu.h @@ -25,11 +25,11 @@ typedef struct MenuInputStruct s32 unk0; u16 unk4; s16 unk6; - Position unk8; // Maybe Position - s16 unkC; // Maybe Position + DungeonPos unk8; // Maybe DungeonPos + s16 unkC; // Maybe DungeonPos s16 unkE; u32 unk10; - Position unk14; // Maybe Position + DungeonPos unk14; // Maybe DungeonPos /* 0x18 */ s16 menuIndex; s16 unk1A; s16 unk1C; diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index b95093631..e6866cf7c 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -77,10 +77,10 @@ typedef struct DungeonMusicPlayer // Size unknown? typedef struct UnkDungeonGlobal_unk181E8_sub { - /* 0x181E8 */ Position cameraPos; // x0 - /* 0x181EC */ Position cameraPosMirror; // x4 - /* 0x181F0 */ Position cameraPixelPos; // x8 - /* 0x181F4 */ Position cameraPixelPosMirror; // xC + /* 0x181E8 */ DungeonPos cameraPos; // x0 + /* 0x181EC */ DungeonPos cameraPosMirror; // x4 + /* 0x181F0 */ DungeonPos cameraPixelPos; // x8 + /* 0x181F4 */ DungeonPos cameraPixelPosMirror; // xC /* 0x181F8 */ Entity *cameraTarget; // x10 u32 unk181FC; // x14 u32 unk18200; // x18 @@ -370,9 +370,9 @@ typedef struct Dungeon /* 0x3A14 */ s16 bossBattleIndex; /* 0x3A16 */ s16 unk3A16; /* 0x3A18 */ Tile tiles[DUNGEON_MAX_SIZE_Y][DUNGEON_MAX_SIZE_X]; - Position unkE218; - Position unkE21C; // stair location? - Position unkE220[8]; + DungeonPos unkE218; + DungeonPos unkE21C; // stair location? + DungeonPos unkE220[8]; unkDungeonE240 unkE240; unkDungeonE240 unkE250; unkDungeonE260 unkE260; @@ -384,7 +384,7 @@ typedef struct Dungeon u8 unk104C0; /* 0x104C4 */ RoomData roomData[MAX_ROOM_COUNT]; /* 0x10844 */ s16 naturalJunctionListCounts[MAX_ROOM_COUNT]; - /* 0x10884 */ Position naturalJunctionList[MAX_ROOM_COUNT][MAX_ROOM_COUNT]; // Arrays of room exits for each room. + /* 0x10884 */ DungeonPos naturalJunctionList[MAX_ROOM_COUNT][MAX_ROOM_COUNT]; // Arrays of room exits for each room. u16 unk11884[250][9]; u16 unk12A18[20][9]; u16 unk12B80[9]; @@ -398,7 +398,7 @@ typedef struct Dungeon u8 fill1356D[0x13570 - 0x1356D]; /* 0x13570 */ u8 unk13570; u8 fill13571[0x13574 - 0x13571]; - /* 0x13574 */ Position trapPos; + /* 0x13574 */ DungeonPos trapPos; /* 0x13578 */ u8 trapID; /* 0x13579 */ u8 unk13579; u8 fill1357A[0x1357C - 0x1357A]; diff --git a/include/structs/str_position.h b/include/structs/str_position.h index f767b80c4..e56ee1d18 100644 --- a/include/structs/str_position.h +++ b/include/structs/str_position.h @@ -2,26 +2,26 @@ #define GUARD_STR_POSITION_H // size: 0x4 -typedef struct Position +typedef struct DungeonPos { /* 0x0 */ s16 x; /* 0x2 */ s16 y; -} Position; +} DungeonPos; /** * Precise position expressed in pixel units, as s24_8 fixpoint. * This type has subpixel precision to 1/256th of a pixel. */ // size: 0x8 -typedef struct Position32 +typedef struct PixelPos { /* 0x0 */ s32 x; // TODO: convert to s24_8 across the codebase /* 0x4 */ s32 y; -} Position32; +} PixelPos; /** * Currently only used in script data, for entities and GroundLink data. - * Position expressed in terms of *graphics* tiles, 8 pixels per unit. + * DungeonPos expressed in terms of *graphics* tiles, 8 pixels per unit. * Flags allow expressing half-tile offsets and allow using a current/default coordinate. */ // size: 0x4 diff --git a/include/tile_types.h b/include/tile_types.h index 78ce34014..46f765829 100644 --- a/include/tile_types.h +++ b/include/tile_types.h @@ -9,7 +9,7 @@ extern const u8 gDungeonWaterType[76]; -void sub_804AE84(Position *pos); +void sub_804AE84(DungeonPos *pos); bool8 IsTileGround(Tile *tile); bool8 IsWaterTileset(); diff --git a/include/trap.h b/include/trap.h index ba9ba7fdb..e6a6ad899 100644 --- a/include/trap.h +++ b/include/trap.h @@ -5,17 +5,17 @@ #include "structs/map.h" #include "structs/str_position.h" -bool8 CanLayTrap(Position *pos); -bool8 LayTrap(Position *pos, u8 trapID, u8 param_3); +bool8 CanLayTrap(DungeonPos *pos); +bool8 LayTrap(DungeonPos *pos, u8 trapID, u8 param_3); bool8 sub_807FD84(Entity *entity); -bool8 sub_807FE04(Position *pos, char param_2); -bool8 sub_807FE44(Position *pos, char param_2); +bool8 sub_807FE04(DungeonPos *pos, char param_2); +bool8 sub_807FE44(DungeonPos *pos, char param_2); void GetTrapName(u8 *buffer, u8 trapIndex); -void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4); +void sub_807FE9C(Entity *pokemon, DungeonPos *pos, int param_3, char param_4); void HandleMudTrap(Entity *pokemon, Entity *target); void HandleStickyTrap(Entity *pokemon, Entity *target); void HandleGrimyTrap(Entity *pokemon, Entity *target); -void HandleSummonTrap(Entity *pokemon, Position *pos); +void HandleSummonTrap(Entity *pokemon, DungeonPos *pos); void HandlePitfallTrap(Entity *pokemon,Entity *target,Tile *tile); void HandleWarpTrap(Entity *pokemon, Entity *target); void HandleSpinTrap(Entity *pokemon, Entity *target); @@ -30,7 +30,7 @@ void HandleWonderTile(Entity *pokemon, Entity *target); // code_807FCD4.s extern void HandleSealTrap(Entity *pokemon, Entity *target); extern void HandleWhirlwindTrap(Entity *entity, Entity *target); -extern void HandlePokemonTrap(Entity *pokemon, Position *pos); +extern void HandlePokemonTrap(Entity *pokemon, DungeonPos *pos); // trap_1.c void HandleTripTrap(Entity *pokemon, Entity *target); diff --git a/src/code_800558C.c b/src/code_800558C.c index 8c54dff9e..0788f765f 100644 --- a/src/code_800558C.c +++ b/src/code_800558C.c @@ -84,11 +84,11 @@ const RGB *sub_8005674(struct axMapSprite *a0, s32 vramIdx) return a0->pal; } -void sub_800569C(Position *a0, struct axObject *a1, u8 a2) +void sub_800569C(DungeonPos *a0, struct axObject *a1, u8 a2) { - Position *ptr; - Position *ptr2; - Position *ptr3; + DungeonPos *ptr; + DungeonPos *ptr2; + DungeonPos *ptr3; a0->x = 0; a0->y = 0; @@ -97,7 +97,7 @@ void sub_800569C(Position *a0, struct axObject *a1, u8 a2) return; if (a1->axdata.paletteData != NULL) { - ptr = &((Position*)a1->axdata.paletteData)[a1->axdata.sub1.poseId * 4]; + ptr = &((DungeonPos*)a1->axdata.paletteData)[a1->axdata.sub1.poseId * 4]; ptr2 = &ptr[a2]; if (*&ptr2->x == 99 && *&ptr2->y == 99) { a0->x = 99; @@ -115,16 +115,16 @@ void sub_800569C(Position *a0, struct axObject *a1, u8 a2) } } -void sub_8005700(Position *a0, struct axObject *a1) +void sub_8005700(DungeonPos *a0, struct axObject *a1) { s32 i; - Position *ptr; + DungeonPos *ptr; if (!(a1->axdata.flags >> 15)) return; if (a1->axdata.paletteData != NULL) { - ptr = &((Position*)a1->axdata.paletteData)[a1->axdata.sub1.poseId * 4]; + ptr = &((DungeonPos*)a1->axdata.paletteData)[a1->axdata.sub1.poseId * 4]; for (i = 0; i < 4; i++) { if (*&ptr[i].x == 99 && *&ptr[i].y == 99) { a0->x = 99; @@ -159,7 +159,7 @@ void sub_8005770(s32 param_1, const RGB *color, s32 brightness, const RGB *ramp) SetBGPaletteBufferColorRGB((param_1 + 0x10) * 0x10 + i, &color[i], brightness, ramp); } -// Maybe Position +// Maybe DungeonPos void nullsub_7(s16 *a0) {} diff --git a/src/code_800F958.c b/src/code_800F958.c index 1538ea514..c928442bc 100644 --- a/src/code_800F958.c +++ b/src/code_800F958.c @@ -6,13 +6,12 @@ extern DungeonPokemonSprite *NewDungeonPokemonSprite(void); extern DungeonPokemonSprite* GetDungeonPokemonSprite(s32 id); -extern Position gUnknown_80D3564; +extern DungeonPos gUnknown_80D3564; -void AddPokemonDungeonSprite(s32 id, s16 species, Position *pos, u32 r3) -{ +void AddPokemonDungeonSprite(s32 id, s16 species, DungeonPos *pos, u32 r3) { DungeonPokemonSprite *dSprite; DungeonPokemonSprite *newSprite; - Position newPos; + DungeonPos newPos; s32 species_s32; species_s32 = species; @@ -57,7 +56,8 @@ void DeletePokemonDungeonSprite(s32 id) MemoryClear8((u8 *)dSprite, sizeof(DungeonPokemonSprite)); } -void sub_800F958(s32 dungeonSpriteID, Position *pos, Position *statusOffsets, u32 a3) +void sub_800F958(s32 dungeonSpriteID, DungeonPos *pos, + DungeonPos *statusOffsets, u32 a3) { DungeonPokemonSprite *dSprite; diff --git a/src/code_803E46C.c b/src/code_803E46C.c index cf05240e0..6dc8deae5 100644 --- a/src/code_803E46C.c +++ b/src/code_803E46C.c @@ -38,7 +38,7 @@ void sub_800E90C(); void sub_8042E5C(); void sub_8040B60(); void sub_8040788(); -void sub_800F7D0(Position *); +void sub_800F7D0(DungeonPos *); void sub_803E874(s32, s32); void sub_803EAF0(s32, s32); diff --git a/src/code_803E724.c b/src/code_803E724.c index f94ef844f..475f05814 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -899,7 +899,7 @@ void sub_803F38C(void) nullsub_5(0xFF, &gFontPalette[palId].pal[15]); } -bool8 sub_803F428(Position *pos) +bool8 sub_803F428(DungeonPos *pos) { UnkDungeonGlobal_unk181E8_sub *strPtr = &gDungeon->unk181e8; Entity *cameraEntity = strPtr->cameraTarget; diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index 5788623d7..eecc28c28 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -51,18 +51,18 @@ extern void sub_800EE5C(u32); extern void sub_800EF64(void); u32 sub_8041764(unkStruct_80416E0 *param_1, bool8 param_2); -s32 sub_80416E0(Position32 *pos, u32 param_2, bool8 param_3); +s32 sub_80416E0(PixelPos *pos, u32 param_2, bool8 param_3); -s32 sub_80416A4(Position *pos_1, u32 param_2, bool8 param_3) +s32 sub_80416A4(DungeonPos *pos_1, u32 param_2, bool8 param_3) { - Position32 pos; + PixelPos pos; pos.x = pos_1->x * 0x1800 + 0xc00; pos.y = pos_1->y * 0x1800 + 0x1000; return sub_80416E0(&pos, param_2, param_3); } -s32 sub_80416E0(Position32 *pos, u32 param_2, bool8 param_3) +s32 sub_80416E0(PixelPos *pos, u32 param_2, bool8 param_3) { int counter; s32 ret; @@ -850,7 +850,7 @@ void sub_804218C(Entity *pokemon, Entity *target) sub_804151C(target, 0x2A, 1); } -void sub_804219C(Position32 *pos) +void sub_804219C(PixelPos *pos) { sub_80416E0(pos, 0x90, TRUE); } @@ -868,7 +868,7 @@ void sub_80421C0(Entity *pokemon, u16 r1) PlaySoundEffect(r1); } -void sub_80421EC(Position *pos, u16 r1) +void sub_80421EC(DungeonPos *pos, u16 r1) { if(sub_803F428(pos)) PlaySoundEffect(r1); diff --git a/src/code_804267C.c b/src/code_804267C.c index 2493588d0..36f0c9ef6 100644 --- a/src/code_804267C.c +++ b/src/code_804267C.c @@ -23,7 +23,7 @@ extern const u8 *gPtrFeralFoundItemMessage[]; extern void sub_8040238(void); extern void sub_804151C(Entity *pokemon, u32 r1, u8 r2); extern void sub_804178C(u32); -extern void sub_80416A4(Position *r0, u32 r1, bool8 r2); +extern void sub_80416A4(DungeonPos *r0, u32 r1, bool8 r2); extern void sub_80429A0(Entity *); extern void sub_8042B34(u32, u32, u32); extern bool8 sub_8042CC0(void); @@ -236,13 +236,13 @@ void sub_80429E8(Entity *r0) sub_804151C(r0, 0x11d, 1); } -void sub_80429FC(Position *r0) +void sub_80429FC(DungeonPos *r0) { sub_80416A4(r0, 0x19E, TRUE); sub_80421C0(NULL, 0xD4); } -void sub_8042A14(Position *r0) +void sub_8042A14(DungeonPos *r0) { sub_80416A4(r0, 0x36, TRUE); } @@ -252,7 +252,7 @@ void sub_8042A24(Entity *r0) sub_804151C(r0, 0x15, 1); } -void sub_8042A34(Position *r0) +void sub_8042A34(DungeonPos *r0) { sub_80416A4(r0, 0x13E, FALSE); } @@ -262,12 +262,12 @@ void sub_8042A44(Entity *r0) sub_804151C(r0, 0xDA << 1, 1); } -void sub_8042A54(Position *r0) +void sub_8042A54(DungeonPos *r0) { sub_80416A4(r0, 0x37, TRUE); } -void sub_8042A64(Position *r0) +void sub_8042A64(DungeonPos *r0) { sub_80416A4(r0, 0x29, TRUE); } diff --git a/src/code_8042B34.c b/src/code_8042B34.c index 609a30bab..234c0267a 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -41,7 +41,7 @@ extern void sub_800EE5C(s32); extern void sub_800EF64(void); extern void sub_800F15C(s32); -struct Sub_UnkStruct_203B414 // Maybe Position? +struct Sub_UnkStruct_203B414 // Maybe DungeonPos? { s16 a0; s16 a2; @@ -218,8 +218,9 @@ void sub_8042E98(void) } } -extern void sub_800569C(Position *, axdata *, u8); -extern void sub_800EB24(s32 param_1, Position *param_2, Position *param_3, s32 param_4, s32 param_5); +extern void sub_800569C(DungeonPos *, axdata *, u8); +extern void sub_800EB24(s32 param_1, DungeonPos *param_2, DungeonPos *param_3, + s32 param_4, s32 param_5); void sub_8042EC8(Entity *a0, s32 a1) { @@ -228,8 +229,8 @@ void sub_8042EC8(Entity *a0, s32 a1) for (i = 0; i < 3; i++) { struct unkStruct_Dungeon5C4_sub *strPtr = &gDungeon->unk5C4[i]; if (strPtr->unk0 >= 0 && strPtr->unkC == a0) { - Position sp8 = {a0->pixelPos.x / 256, a0->pixelPos.y / 256}; - Position sp4 = {0}; + DungeonPos sp8 = {a0->pixelPos.x / 256, a0->pixelPos.y / 256}; + DungeonPos sp4 = {0}; EntityInfo *entInfo = GetEntInfo(a0); if (strPtr->unk8 != -1) { @@ -244,7 +245,7 @@ void sub_8042EC8(Entity *a0, s32 a1) } extern u8 gUnknown_203B40C; -extern Position gUnknown_203B410; +extern DungeonPos gUnknown_203B410; extern u8 *gSerializedData_203B41C; struct Substruct_xxx_dungeon_8042F6C diff --git a/src/code_8044CC8.c b/src/code_8044CC8.c index c55f1638b..8d9ead4b3 100644 --- a/src/code_8044CC8.c +++ b/src/code_8044CC8.c @@ -36,8 +36,8 @@ extern u8 *gUnknown_80F91EC[]; extern u8 sub_8043D10(void); extern bool8 sub_8045888(Entity *); -void sub_80460F8(Position *, Item *, u32); -bool8 sub_80461C8(Position *, u32); +void sub_80460F8(DungeonPos *, Item *, u32); +bool8 sub_80461C8(DungeonPos *, u32); Item * sub_8044CC8(Entity *param_1, unkStruct_8044CC8 *param_2) { @@ -134,7 +134,7 @@ void sub_8044E24(Entity *entity,int index,u32 unused) { Item *itemPtr; EntityInfo *info; - Position *pos; + DungeonPos *pos; Item item; itemPtr = sub_8044D90(entity,index,unused); diff --git a/src/code_80450F8.c b/src/code_80450F8.c index 1bab6d720..526a34b5a 100644 --- a/src/code_80450F8.c +++ b/src/code_80450F8.c @@ -524,7 +524,7 @@ Entity *sub_804550C(s16 a) ); } -Entity *sub_8045684(u8 trapID, Position *pos, u8 c) +Entity *sub_8045684(u8 trapID, DungeonPos *pos, u8 c) { Entity *entity; s32 i; @@ -548,7 +548,7 @@ Entity *sub_8045684(u8 trapID, Position *pos, u8 c) return NULL; } -Entity *sub_8045708(Position *pos) +Entity *sub_8045708(DungeonPos *pos) { s32 i; Entity *ent; diff --git a/src/code_8045A00.c b/src/code_8045A00.c index d6ef76284..fd8662e4b 100644 --- a/src/code_8045A00.c +++ b/src/code_8045A00.c @@ -18,7 +18,7 @@ extern struct unkStruct_8090F58 gUnknown_80F6990; void sub_8045BF8(u8 *, Item *); extern u32 sub_803D73C(u32); -void sub_80460F8(Position *, Item *, u32); +void sub_80460F8(DungeonPos *, Item *, u32); void sub_8045ACC(void) { @@ -135,7 +135,7 @@ void sub_8045CB0(void) u32 uVar5; int xCounter; Item item; - Position pos; + DungeonPos pos; u32 flag; x = DungeonRandInt(DUNGEON_MAX_SIZE_X); diff --git a/src/code_8048480.c b/src/code_8048480.c index cf2989089..da8e833d2 100644 --- a/src/code_8048480.c +++ b/src/code_8048480.c @@ -154,7 +154,7 @@ void sub_80482FC(Entity *, Entity *, u32, u8); extern void sub_8071DA4(Entity *); extern void SetShopkeeperAggression(Entity *, Entity *); -extern void sub_80464C8(Entity *, Position *, Item *); +extern void sub_80464C8(Entity *, DungeonPos *, Item *); extern void sub_806A6E8(Entity *); extern void sub_8042390(Entity *, Item *); diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index b2dba0630..6e13f4d04 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -68,8 +68,9 @@ extern void sub_8083D30(void); extern void sub_8083D08(void); extern void sub_806A6E8(Entity *); extern bool8 sub_8047084(s32 itemFlag); -extern void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4); -extern void sub_8045DB4(Position *, u32); +extern void sub_807FE9C(Entity *pokemon, DungeonPos *pos, int param_3, + char param_4); +extern void sub_8045DB4(DungeonPos *, u32); bool8 sub_807EF48(void); void sub_806A2BC(Entity *a0, u8 a1); bool8 sub_805E874(void); @@ -116,7 +117,7 @@ void sub_8063A70(ActionContainer *a0, bool8 a1); void sub_8063CF0(ActionContainer *a0, bool8 a1); void sub_8067768(UNUSED ActionContainer *a0); void ShowTacticsMenu(ActionContainer *a0); -void sub_804A728(Position *pos, s32 a1, u8 a2, u8 a3); +void sub_804A728(DungeonPos *pos, s32 a1, u8 a2, u8 a3); extern bool8 sub_8071A8C(Entity *pokemon); extern void sub_80643AC(Entity *pokemon); extern u8 sub_8062F90(Entity *, u32, u32, u32, u32); @@ -1520,13 +1521,13 @@ bool8 sub_805E874(void) bool8 sub_805EC2C(Entity *a0, s32 x, s32 y) { - Position pos = {.x = x, .y = y}; + DungeonPos pos = {.x = x, .y = y}; return sub_8070564(a0, &pos); } bool8 sub_805EC4C(Entity *a0, u8 a1) { - Position pos; + DungeonPos pos; Tile *tile; EntityInfo *tileMonsterInfo; Entity *tileMonster; @@ -2378,7 +2379,7 @@ bool8 sub_805FD3C(struct UnkMenuBitsStruct *a0) s32 sub_8060D64(s16 *a0, bool8 a1, bool8 a2, bool8 a3, Entity *a4); -void sub_8060890(Position *a0); +void sub_8060890(DungeonPos *a0); bool8 sub_8060860(s32 a0); void sub_8060900(Entity *a0); s32 sub_8060800(UnkTextStruct2_sub2 *a0, s32 a1); @@ -2849,7 +2850,7 @@ bool8 sub_8060860(s32 a0) return TRUE; } -void sub_8060890(Position *a0) +void sub_8060890(DungeonPos *a0) { s32 var = sUnknown_202F248[gUnknown_202EE10.unk1E]; switch (var) @@ -3088,7 +3089,7 @@ void sub_8060D24(UNUSED ActionContainer *a0) sub_803EAF0(0, NULL); } -extern bool8 PosHasItem(Position *pos); +extern bool8 PosHasItem(DungeonPos *pos); s32 sub_8060D64(s16 *a0, bool8 a1, bool8 a2, bool8 a3, Entity *a4) { @@ -3281,7 +3282,7 @@ bool8 sub_8060E38(Entity *a0) return ret; } -bool32 sub_8069D18(Position *a0, Entity *a1); +bool32 sub_8069D18(DungeonPos *a0, Entity *a1); extern const u8 gTeamFormat[]; extern const u8 gHeartRedTiny[]; @@ -3302,7 +3303,7 @@ extern void sub_8070968(u8 *buffer, EntityInfo *entityInfo, s32 colorNum); void DrawFieldTeamMenu(struct UnkFieldTeamMenuStruct *a0, UnkTextStruct3 *a1, bool8 a2) { s32 r0; - Position pos; + DungeonPos pos; s32 i; s32 count = 0; diff --git a/src/code_8066D04.c b/src/code_8066D04.c index 916169ae5..5beb3e648 100644 --- a/src/code_8066D04.c +++ b/src/code_8066D04.c @@ -28,12 +28,12 @@ extern u8 *gUnknown_80F8E28[]; extern Item *sub_8044D90(Entity *, s32, u32); void sub_8045BF8(u8 *, Item *); -u8 sub_80460F8(Position *, Item *, u32); +u8 sub_80460F8(DungeonPos *, Item *, u32); extern void sub_807AB38(Entity *, u32); extern Entity * sub_8044DA4(Entity *param_1,int param_2); extern void sub_806A6E8(Entity *); extern void sub_8044DF0(Entity *, u32, u32); -extern void sub_8045DB4(Position *, u32); +extern void sub_8045DB4(DungeonPos *, u32); void HandlePickUpPlayerAction(Entity *entity) { diff --git a/src/code_8069D4C.c b/src/code_8069D4C.c index 08a1a25e5..48c5e9210 100644 --- a/src/code_8069D4C.c +++ b/src/code_8069D4C.c @@ -3,7 +3,7 @@ #include "dungeon_util.h" #include "code_8069D4C.h" -u32 sub_8069D18(Position *pos,Entity *entity) +u32 sub_8069D18(DungeonPos *pos,Entity *entity) { EntityInfo *info; diff --git a/src/code_806CD90.c b/src/code_806CD90.c index f93e90836..e16c9d267 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -284,7 +284,7 @@ extern void sub_806F63C(Entity *r0); extern void sub_8078084(Entity * pokemon); extern void sub_800DBBC(void); extern void sub_8045C28(Item *Item, u8 itemID, u32 param_3); -extern void sub_80464C8(Entity *, Position *, Item *); +extern void sub_80464C8(Entity *, DungeonPos *, Item *); extern bool8 DoEnemiesEvolveWhenKOed(u8 dungeon); extern bool8 sub_806FA5C(Entity *, Entity *, struct unkStruct_8069D4C *); extern void EntityUpdateStatusSprites(Entity *); @@ -817,7 +817,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } } if (i != MAX_TEAM_MEMBERS) { - Position monPos; // r4 + DungeonPos monPos; // r4 sub_8042148(target); diff --git a/src/code_80718D8.c b/src/code_80718D8.c index f2195c485..aed02349e 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -23,7 +23,7 @@ struct unkStruct_806B7F8 u32 unk4; u16 level; u8 fillA[2]; - struct Position pos; + DungeonPos pos; u8 unk10; }; @@ -65,7 +65,7 @@ extern void sub_8042920(struct Entity *r0); extern s16 sub_803D970(u32); extern s32 sub_803DA20(s32 param_1); extern bool8 sub_806AA0C(s32, u32); -extern bool8 sub_8083660(struct Position *param_1); +extern bool8 sub_8083660(DungeonPos *param_1); void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level); // TODO: change to s32 void sub_8071B48(void) diff --git a/src/code_8072B78.c b/src/code_8072B78.c index d3b1eddb1..7a96283c3 100644 --- a/src/code_8072B78.c +++ b/src/code_8072B78.c @@ -23,7 +23,7 @@ struct unkStruct_806B7F8 u32 unk4; u16 level; u8 fillA[0xC - 0xA]; - struct Position pos; + DungeonPos pos; u8 unk10; }; diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 5509a78b4..2d69cbaf7 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -41,11 +41,11 @@ extern void sub_8067110(Entity *); extern void sub_80671A0(Entity *); extern void sub_8073D14(Entity *); extern void sub_8045BF8(u8 *, Item *); -extern bool8 sub_80461C8(Position *, u32); +extern bool8 sub_80461C8(DungeonPos *, u32); extern void sub_805229C(void); extern void sub_807E8F0(Entity *); extern void sub_80444F4(Entity *pokemon); -extern void sub_807D148(Entity *pokemon, Entity *r1, u32 r2, Position *r3); +extern void sub_807D148(Entity *pokemon, Entity *r1, u32 r2, DungeonPos *r3); extern void sub_80420B8(Entity *pokemon); extern void sub_8041C4C(Entity *pokemon, u32 r1); extern void sub_805E804(void); @@ -108,7 +108,7 @@ extern const s16 gUnknown_80F4F36; extern s48_16 gUnknown_80F54F4[8]; extern const s32 gUnknown_80F60DC[]; -extern const Position gUnknown_80F4D44[]; +extern const DungeonPos gUnknown_80F4D44[]; bool8 UseAttack(Entity *a0); void sub_8075050(EntityInfo *info, Unk_Entity_x184 *strPtr); @@ -797,7 +797,7 @@ void TickStatusHeal(Entity *entity) } } -void sub_8074FB0(Entity *entity, s32 a1, Position *pos) +void sub_8074FB0(Entity *entity, s32 a1, DungeonPos *pos) { Unk_Entity_x184 *strPtr; EntityInfo *entityInfo = GetEntInfo(entity); @@ -910,7 +910,7 @@ bool8 UseAttack(Entity *a0) } } else { - Position32 pos; + PixelPos pos; monInfo->flags |= 0x2000; pos.x = (monInfo->unk184[0].previousTargetMovePosition2.x * 0x1800) + 0xC00; @@ -948,7 +948,7 @@ bool8 UseAttack(Entity *a0) monInfo->numMoveTiles = 0; } else { - Position32 pos; + PixelPos pos; pos.x = (monInfo->unk184[monInfo->notMoving].previousTargetMovePosition2.x * 0x1800) + 0xC00; pos.y = (monInfo->unk184[monInfo->notMoving].previousTargetMovePosition2.y * 0x1800) + 0x1000; @@ -977,7 +977,7 @@ bool8 UseAttack(Entity *a0) sub_807AA30(); for (j = 0; j < 2; j++) { for (loop = 0; loop < DUNGEON_MAX_POKEMON; loop++) { - Position monPosBefore; + DungeonPos monPosBefore; EntityInfo *monInfo; Entity *mon = gDungeon->activePokemon[loop]; diff --git a/src/code_8075708.c b/src/code_8075708.c index 934fdabc6..c89b02c49 100644 --- a/src/code_8075708.c +++ b/src/code_8075708.c @@ -22,7 +22,7 @@ extern void sub_8073D14(Entity *); void sub_8075680(void) { u32 direction; - Position *targetPos; + DungeonPos *targetPos; Entity *entity; EntityInfo *info; int index; diff --git a/src/code_807CD9C.c b/src/code_807CD9C.c index 4288937c1..68b97d534 100644 --- a/src/code_807CD9C.c +++ b/src/code_807CD9C.c @@ -42,25 +42,25 @@ void sub_806A5B8(Entity *); u8 sub_8045888(Entity *); void sub_807EC28(u32); void sub_80694C0(Entity *, s32, s32, s32); -void sub_807D068(Entity *, Position *); +void sub_807D068(Entity *, DungeonPos *); u8 sub_8044B28(void); extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32); void sub_80421AC(Entity * pokemon, Entity * target); void sub_807BB78(Entity *pokemon); extern void sub_803F580(u32); -bool8 sub_808384C(Position *, Position *); -u8 sub_8083660(Position *); +bool8 sub_808384C(DungeonPos *, DungeonPos *); +u8 sub_8083660(DungeonPos *); void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction) { Tile *tile; int iVar8; bool8 flag; - Position sp_0x18; + DungeonPos sp_0x18; Move move; int sp_0x24; Entity *sp_0x28; - Position32 sp_0x2C; + PixelPos sp_0x2C; sp_0x24 = 10; if (IsCurrentFixedRoomBossFight()) { @@ -162,7 +162,7 @@ void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction) } } -void sub_807D068(Entity *pokemon, Position *pos) +void sub_807D068(Entity *pokemon, DungeonPos *pos) { int pixelX; int posY; @@ -171,7 +171,7 @@ void sub_807D068(Entity *pokemon, Position *pos) int counter; int iVar8; s32 diff; - Position32 local_34; + PixelPos local_34; int incrementX; int incrementY; @@ -215,12 +215,13 @@ _0807D11E: sub_803E46C(0x1a); } -void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos) +void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, + DungeonPos *pos) { EntityInfo *info; u32 direction; - Position local_2c; - Position pos2; + DungeonPos local_2c; + DungeonPos pos2; bool8 flag; info = GetEntInfo(target); diff --git a/src/code_807E1A0.c b/src/code_807E1A0.c index a93575b0f..8aa35e672 100644 --- a/src/code_807E1A0.c +++ b/src/code_807E1A0.c @@ -19,7 +19,7 @@ extern void sub_805E804(void); void sub_806A2BC(Entity *pokemon, u8 param_2); extern u8 sub_8044B28(void); extern void sub_8068FE0(Entity *, u32, Entity *r2); -extern void nullsub_93(Position *); +extern void nullsub_93(DungeonPos *); extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32); extern void sub_80694C0(Entity *, s32, s32, u32); extern void sub_807EC28(bool8); @@ -69,8 +69,8 @@ void sub_807E1A0(Entity *pokemon,Entity *target,u8 moveType,s16 param_4,s32 para void sub_807E254(Entity *pokemon,Entity *target) { - Position pokemonPos; - Position targetPos; + DungeonPos pokemonPos; + DungeonPos targetPos; if (HasAbility(pokemon, ABILITY_SUCTION_CUPS)) { diff --git a/src/code_8085E98.c b/src/code_8085E98.c index 197679864..08d309c63 100644 --- a/src/code_8085E98.c +++ b/src/code_8085E98.c @@ -14,7 +14,7 @@ extern const unkStruct_2039DB0 gUnknown_8107374; void sub_800EF64(void); void sub_800EE5C(s32); void sub_8085F44(s32); -void sub_800E90C(Position *); +void sub_800E90C(DungeonPos *); void sub_8088EE8(void); void sub_8088848(void); void sub_808A718(void); @@ -30,7 +30,8 @@ void sub_8085EB0(void) gDungeon->unk181e8.unk18215 = 1; } -u32 sub_8085EC8(s16 param_1,u32 param_2,u32 param_3,Position *param_4,bool32 param_5) +u32 sub_8085EC8(s16 param_1,u32 param_2,u32 param_3,DungeonPos *param_4, + bool32 param_5) { u32 uVar1; unkStruct_80416E0 local_40; diff --git a/src/code_80861A8.c b/src/code_80861A8.c index e53b058e0..e0d050755 100644 --- a/src/code_80861A8.c +++ b/src/code_80861A8.c @@ -21,7 +21,7 @@ void sub_800EE5C(s32); void sub_800EF64(); void sub_803E46C(s32); s32 sub_800E700(s32); -void sub_800569C(Position *, axdata *, u8); +void sub_800569C(DungeonPos *, axdata *, u8); void sub_8085F44(void); void sub_8052FB8(const u8 *); @@ -78,7 +78,7 @@ s32 sub_80861F8(s16 param_1,Entity *param_2,bool32 param_3) EntityInfo *info; s32 uVar2; s32 uStack_38; - Position pos; + DungeonPos pos; unkStruct_80416E0 stack; #ifdef NONMATCHING diff --git a/src/code_80869E4.c b/src/code_80869E4.c index b11838214..710c0db20 100644 --- a/src/code_80869E4.c +++ b/src/code_80869E4.c @@ -44,7 +44,7 @@ void SpriteShockEffect(Entity *entity) static void sub_80862DC(Entity *entity) { - Position32 pos; + PixelPos pos; pos.x = entity->pixelPos.x; pos.y = entity->pixelPos.y + 0x3800; @@ -55,7 +55,7 @@ static void sub_80862DC(Entity *entity) static void sub_8086310(Entity *entity) { - Position32 pos; + PixelPos pos; pos.x = entity->pixelPos.x; pos.y = entity->pixelPos.y + 0x9000; @@ -67,7 +67,7 @@ static void sub_8086310(Entity *entity) static void sub_8086348(Entity *entity) { - Position32 pos; + PixelPos pos; pos.x = entity->pixelPos.x + 0x7800; pos.y = entity->pixelPos.y - 0x2000; @@ -78,7 +78,7 @@ static void sub_8086348(Entity *entity) static void sub_8086384(Entity *entity) { - Position32 pos; + PixelPos pos; pos.x = entity->pixelPos.x + 0x7800; pos.y = entity->pixelPos.y; diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c index d56aeb209..1d22cc2ba 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -61,7 +61,7 @@ extern bool8 TryUseChosenMove(struct Entity *, u32, u32, u32, u32, struct Move * extern void sub_8045BF8(u8 *, struct Item *); extern void sub_8044DF0(struct Entity *, u32, u32); extern void sub_8071DA4(struct Entity *); -extern void sub_804AC20(struct Position *); +extern void sub_804AC20(DungeonPos *); extern void sub_807EC28(bool8); extern void sub_806A5B8(struct Entity *entity); diff --git a/src/dungeon_ai_items.c b/src/dungeon_ai_items.c index 948b357fc..09a5934f7 100644 --- a/src/dungeon_ai_items.c +++ b/src/dungeon_ai_items.c @@ -110,7 +110,7 @@ void AIDecideUseItem(Entity *pokemon) } else if (itemType == CATEGORY_THROWN_ARC) { - Position potentialTargetPositions[NUM_POTENTIAL_ROCK_TARGETS]; + DungeonPos potentialTargetPositions[NUM_POTENTIAL_ROCK_TARGETS]; GetPossibleAIArcItemTargets(pokemon, item, potentialTargetPositions, TRUE); if (gAIThrowItemActionChoiceCount == 0) { @@ -233,7 +233,7 @@ void AIDecideUseItem(Entity *pokemon) u8 itemType = GetItemCategory(item->id); if (itemType == CATEGORY_THROWN_ARC) { - Position potentialTargetPositions[NUM_POTENTIAL_ROCK_TARGETS]; + DungeonPos potentialTargetPositions[NUM_POTENTIAL_ROCK_TARGETS]; GetPossibleAIArcItemTargets(pokemon, item, potentialTargetPositions, FALSE); if (gAIThrowItemActionChoiceCount != 0) { @@ -312,7 +312,9 @@ void GetPossibleAIThrownItemDirections(Entity *pokemon, s32 thrownAIFlag, Item * } } -void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, Position potentialTargets[], bool8 ignoreRollChance) +void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, + DungeonPos potentialTargets[], + bool8 ignoreRollChance) { s32 i; gAIThrowItemActionChoiceCount = 0; @@ -340,7 +342,7 @@ void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, Position potential } if (distance <= 10) { - Position *newPotentialTarget; + DungeonPos *newPotentialTarget; if (!ignoreRollChance) { u32 itemWeight = GetAIUseItemProbability(targetPokemon, item, ITEM_TARGET_OTHER); diff --git a/src/dungeon_ai_leader.c b/src/dungeon_ai_leader.c index 5717ea90c..5c1204ac1 100644 --- a/src/dungeon_ai_leader.c +++ b/src/dungeon_ai_leader.c @@ -50,7 +50,7 @@ void sub_8041888(u8 param_1); void sub_8085140(void); void sub_807360C(void); void sub_805EFB4(Entity *, u8); -void sub_8074FB0(Entity *, u8, Position *); +void sub_8074FB0(Entity *, u8, DungeonPos *); void HandlePlaceItemAction(Entity *); void HandlePickUpPlayerAction(Entity *); @@ -72,7 +72,7 @@ extern u8 sub_8044B28(void); extern u8 UseAttack(Entity *); void sub_806A1E8(Entity *pokemon); extern void sub_80694C0(Entity *, s32, s32, u32); -bool8 sub_804AE08(Position *pos); +bool8 sub_804AE08(DungeonPos *pos); void HandlePickUpAIAction(Entity *pokemon); void HandleThrowItemAIAction(Entity *pokemon); void HandleEatAIAction(Entity *pokemon); @@ -114,8 +114,8 @@ bool8 sub_8072CF4(Entity *entity) s32 index; EntityInfo *info; bool8 bVar14; - Position pos; - Position pos1; + DungeonPos pos; + DungeonPos pos1; sub_804178C(1); gUnknown_203B434 = 1; diff --git a/src/dungeon_ai_movement.c b/src/dungeon_ai_movement.c index ea641c4e9..e6e435246 100644 --- a/src/dungeon_ai_movement.c +++ b/src/dungeon_ai_movement.c @@ -556,7 +556,7 @@ bool8 AvoidEnemies(Entity *pokemon) struct Tile *tile = GetTile(pokemon->pos.x, pokemon->pos.y); if (tile->terrainType & TERRAIN_TYPE_NATURAL_JUNCTION) { - Position aiTargetPos; + DungeonPos aiTargetPos; s32 targetDir; aiTargetPos.x = pokemon->pos.x; aiTargetPos.y = pokemon->pos.y; @@ -593,7 +593,7 @@ bool8 AvoidEnemies(Entity *pokemon) // If there are any room exits that the PokĂ©mon can head towards without moving // closer to the target, head towards the furthest eligible exit. s32 naturalJunctionListCounts; - Position *naturalJunctionList = gDungeon->naturalJunctionList[room]; + DungeonPos *naturalJunctionList = gDungeon->naturalJunctionList[room]; s32 furthestTargetExitIndex; s32 furthestTargetToExitDistance; s32 distanceX; @@ -735,7 +735,7 @@ bool8 Wander(Entity *pokemon) else { s32 naturalJunctionListCounts = gDungeon->naturalJunctionListCounts[room]; - Position *naturalJunctionList = gDungeon->naturalJunctionList[room]; + DungeonPos *naturalJunctionList = gDungeon->naturalJunctionList[room]; if (pokemonInfo->moveRandomly) { s32 targetFacingDir = DungeonRandInt(NUM_DIRECTIONS); diff --git a/src/dungeon_ai_targeting.c b/src/dungeon_ai_targeting.c index 163b12173..1088795b3 100644 --- a/src/dungeon_ai_targeting.c +++ b/src/dungeon_ai_targeting.c @@ -62,7 +62,7 @@ const u8 gTreatmentData[3][2][2][2] = { } }; -bool8 sub_8070F3C(Entity * pokemon, Position *pos, s32 direction) +bool8 sub_8070F3C(Entity * pokemon, DungeonPos *pos, s32 direction) { u8 terrain; struct Tile *tile; diff --git a/src/dungeon_cutscenes.c b/src/dungeon_cutscenes.c index a0437d50e..0a08d442f 100644 --- a/src/dungeon_cutscenes.c +++ b/src/dungeon_cutscenes.c @@ -387,16 +387,16 @@ extern void sub_8041888(u32); extern u32 sub_80861F8(u32, Entity *, u32); extern u8 sub_80860A8(u32); extern void sub_8052D44(s16 *, Entity *, Entity *); -extern void sub_80464C8(Entity *, Position *, Item *); +extern void sub_80464C8(Entity *, DungeonPos *, Item *); extern void SetDungeonBGColorRGB(u32, u32, u32, u32, u32); -extern u32 sub_8085EC8(u32, u32, u32, Position *, u32); +extern u32 sub_8085EC8(u32, u32, u32, DungeonPos *, u32); extern void sub_807EAA0(u32, u32); extern void sub_8072008(Entity *, Entity *, s16, u32, u32); extern void sub_8085374(void); extern void sub_8045C28(Item *, u8 , u8 *); -extern void sub_8046860(Entity *, Position *, Item *, u32); +extern void sub_8046860(Entity *, DungeonPos *, Item *, u32); extern u32 sub_803D73C(u32); -extern void sub_80460F8(Position *, Item *, u8); +extern void sub_80460F8(DungeonPos *, Item *, u8); extern u8 sub_8044B28(void); extern bool8 sub_8085B80(struct_8085B80 *); @@ -453,7 +453,7 @@ void MoltresScreenFlash2(s32 r0, s32 r1); void MoltresScreenFlash3(void); void MoltresScreenDarken(void); void EnableJirachiWishWarpTile(void); -void sub_808BB3C(Position *pos); +void sub_808BB3C(DungeonPos *pos); void sub_8087144(); void SkarmoryEntry(Entity *); @@ -561,8 +561,8 @@ void SkarmoryPreFightDialogue(void) Entity * diglettEntity; Entity * skarmoryEntity; - Position32 pos1; - Position32 pos2; + PixelPos pos1; + PixelPos pos2; leaderEntity = xxx_call_GetLeader(); // Player partnerEntity = GetPartnerEntity(); // Partner @@ -618,7 +618,7 @@ void SkarmoryReFightDialogue(void) { Entity * leaderEntity; Entity * skarmoryEntity; - Position32 pos; + PixelPos pos; leaderEntity = xxx_call_GetLeader(); skarmoryEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SKARMORY); @@ -2123,7 +2123,7 @@ void MagmaCavernMidDialogue(void) Entity * groudonEntity; Entity * alakazamEntity; s16 IDStack [2]; - Position32 pos; + PixelPos pos; leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); @@ -3314,7 +3314,7 @@ void HoOhPreFightDialogue(void) { Entity * leaderEntity; Entity * HoOhEntity; - Position32 local_14; + PixelPos local_14; leaderEntity = xxx_call_GetLeader(); HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); @@ -3353,7 +3353,7 @@ void HoOhReFightDialogue(void) { Entity * leaderEntity; Entity * HoOhEntity; - Position32 local_14; + PixelPos local_14; leaderEntity = xxx_call_GetLeader(); HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); @@ -3494,8 +3494,8 @@ void LatiosPreFightDialogue(void) { Entity * leaderEntity; Entity * LatiosEntity; - Position32 local_18; - Position local_19; + PixelPos local_18; + DungeonPos local_19; leaderEntity = xxx_call_GetLeader(); LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); @@ -3652,7 +3652,7 @@ void sub_808ADCC(void) } } -void sub_808AE54(u8 param_1,u8 param_2,Position *param_3) +void sub_808AE54(u8 param_1,u8 param_2,DungeonPos *param_3) { Entity * leaderEntity; s16 IDStack[2]; @@ -3675,7 +3675,7 @@ void sub_808AE54(u8 param_1,u8 param_2,Position *param_3) } -void sub_808AEC8(u8 param_1,u8 param_2,Position *param_3) +void sub_808AEC8(u8 param_1,u8 param_2,DungeonPos *param_3) { Entity * leaderEntity; s16 IDStack[2]; @@ -3697,7 +3697,7 @@ void sub_808AEC8(u8 param_1,u8 param_2,Position *param_3) } } -void sub_808AF3C(u8 param_1,u8 param_2,Position *param_3) +void sub_808AF3C(u8 param_1,u8 param_2,DungeonPos *param_3) { Entity * leaderEntity; s16 IDStack[2]; @@ -3813,7 +3813,7 @@ void sub_808B1CC(u8 itemID) { Entity *entity; Tile *tile; - Position pos; + DungeonPos pos; Item item; pos.x = gDungeon->unk644.unk40; @@ -3992,7 +3992,7 @@ void JirachiWish(void) { u8 friendArea; Entity *jirachiEntity; - Position *LeaderPos; + DungeonPos *LeaderPos; Entity *leaderEntity; s32 wishChoice; s32 counter; @@ -4001,9 +4001,9 @@ void JirachiWish(void) Item auStack152 [9]; Item itemStack [9]; Item strengthItems [9]; - Position pos1; - Position pos2; - Position pos3; + DungeonPos pos1; + DungeonPos pos2; + DungeonPos pos3; jirachiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_JIRACHI); CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); @@ -4220,14 +4220,14 @@ void JirachiWishGrantFlash(void) sub_8085EB0(); } -void sub_808BB3C(Position *pos1) +void sub_808BB3C(DungeonPos *pos1) { #ifndef NONMATCHING register s32 iVar1 asm("r0"); #else s32 iVar1; #endif - Position newPos; + DungeonPos newPos; iVar1 = pos1->x * 0x1800 + 0xc00; newPos.x = iVar1 / 256; diff --git a/src/dungeon_items.c b/src/dungeon_items.c index b2eb9ffb7..84d27fab5 100644 --- a/src/dungeon_items.c +++ b/src/dungeon_items.c @@ -20,7 +20,7 @@ extern u8 *gUnknown_8105360[]; extern u8 *gUnknown_81053A8[]; extern u8 *gUnknown_8105434[]; -extern void sub_80416E0(Position32 *r0, u32, bool8); +extern void sub_80416E0(PixelPos *r0, u32, bool8); extern void sub_80855E4(void *); extern void PlaySoundEffect(u32); extern void sub_804178C(u32); diff --git a/src/dungeon_map_access.c b/src/dungeon_map_access.c index 4c377963d..98561554d 100644 --- a/src/dungeon_map_access.c +++ b/src/dungeon_map_access.c @@ -763,9 +763,9 @@ void sub_804A49C(s32 a0, s32 a1) sub_80098F8(3); } -void sub_804A728(Position *pos, s32 a1, u8 a2, u8 a3) +void sub_804A728(DungeonPos *pos, s32 a1, u8 a2, u8 a3) { - Position spArray[6]; + DungeonPos spArray[6]; u16 *src; s32 k; Entity *leader; @@ -774,7 +774,7 @@ void sub_804A728(Position *pos, s32 a1, u8 a2, u8 a3) s32 r5; s32 r10; s32 r9; - Position var_48; + DungeonPos var_48; s32 var_38, var_34; s32 x, x2, y; Dungeon *dungeon = gDungeon; @@ -983,7 +983,7 @@ void sub_804AAD4(void) gDungeon->unk104C0 = maxRooms + 1; } -void sub_804AC20(Position *pos) +void sub_804AC20(DungeonPos *pos) { s32 y; struct Tile *tile2; diff --git a/src/dungeon_message.c b/src/dungeon_message.c index 40f574d6f..610caeb7f 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -167,7 +167,8 @@ void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u } } -void TryDisplayDungeonLoggableMessage5(Entity *pokemon, Position *pos, const u8 *str) +void TryDisplayDungeonLoggableMessage5(Entity *pokemon, DungeonPos *pos, + const u8 *str) { u8 flag; flag = sub_8045888(pokemon) ? TRUE : FALSE; @@ -416,7 +417,7 @@ void DisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str) struct Struct_sub_808CDB0 { - Position pos; + DungeonPos pos; bool8 flip; }; diff --git a/src/dungeon_move.c b/src/dungeon_move.c index f82b768ed..d474afabd 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -55,14 +55,14 @@ extern void sub_80428A0(Entity *r0); extern bool8 sub_8040BB0(Entity *entity, Move *move, bool8); extern void sub_8040DA0(Entity *entity, Move *move); extern u16 sub_80412E0(u16 moveId, u8 weather, u8 a2); -extern void sub_800569C(Position *, axdata *, u8); +extern void sub_800569C(DungeonPos *, axdata *, u8); extern u8 GetBodySize(s16 index); extern void sub_800EF10(u16 r0); extern s32 sub_800E710(s16 a0, u16 a1); -extern void sub_800E3AC(s32 a0, Position *pos, s32 a2); -extern void sub_8041168(Entity *entity, Entity *entity2, Move *,Position *); +extern void sub_800E3AC(s32 a0, DungeonPos *pos, s32 a2); +extern void sub_8041168(Entity *entity, Entity *entity2, Move *,DungeonPos *); extern Entity *sub_80696A8(Entity *a0); -extern Entity *GetMonsterAtPos(Position *pos); +extern Entity *GetMonsterAtPos(DungeonPos *pos); extern Entity *sub_80696FC(Entity *); extern Entity *sub_806977C(Entity *); extern void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct DamageStruct *dmgStruct); @@ -2265,13 +2265,13 @@ struct UnkStruct_sub_800E308_1 { s16 unk0; s16 unk2; - Position unk4; - Position unk8; + DungeonPos unk4; + DungeonPos unk8; s32 unkC; s32 unk10; }; -// Maybe Position? Maybe not, sub_800E308 is called only by sub_8056564, so :shrug: +// Maybe DungeonPos? Maybe not, sub_800E308 is called only by sub_8056564, so :shrug: struct UnkStruct_sub_800E308_2 { s16 u0; @@ -2281,7 +2281,7 @@ struct UnkStruct_sub_800E308_2 extern s32 sub_800E308(struct UnkStruct_sub_800E308_1 *, struct UnkStruct_sub_800E308_2 *); #ifdef NONMATCHING // https://decomp.me/scratch/fTUsI -s32 sub_8056564(Entity *entity, Position *pos, Move *move, s32 r4) +s32 sub_8056564(Entity *entity, DungeonPos *pos, Move *move, s32 r4) { struct UnkStruct_sub_800E308_1 unkSp1; struct UnkStruct_sub_800E308_2 unkSp2; @@ -2291,7 +2291,7 @@ s32 sub_8056564(Entity *entity, Position *pos, Move *move, s32 r4) unkStruct_80BDBC4 *unkStruct = sub_800ECB8(sub_80412E0(move->id, GetApparentWeather(entity), 1)); s32 unk6 = unkStruct->unk6; // This part with unkPos doesn't match - Position32 unkPos = {pos->x * 0x1800, pos->y * 0x1800}; + PixelPos unkPos = {pos->x * 0x1800, pos->y * 0x1800}; unkPos.x += 0x1000; unkPos.y += 0xC00; @@ -2311,7 +2311,7 @@ s32 sub_8056564(Entity *entity, Position *pos, Move *move, s32 r4) someRetVal); } else { - unkSp1.unk8 = (Position) {0}; + unkSp1.unk8 = (DungeonPos) {0}; } unkSp1.unk0 = sub_80412E0(move->id, GetApparentWeather(entity), 1); unkSp1.unk2 = entInfo->apparentID; @@ -2327,7 +2327,7 @@ s32 sub_8056564(Entity *entity, Position *pos, Move *move, s32 r4) return -1; } #else -NAKED s32 sub_8056564(Entity *entity, Position *pos, Move *move, s32 r4) +NAKED s32 sub_8056564(Entity *entity, DungeonPos *pos, Move *move, s32 r4) { asm_unified("push {r4-r7,lr}\n" " mov r7, r9\n" @@ -2541,8 +2541,8 @@ static const s32 gUnknown_81069D4[NUM_DIRECTIONS] = // This function looks important, but what does it do? void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 isLinkedMove) { - Position var_68; - Position var_64; + DungeonPos var_68; + DungeonPos var_64; Entity *targetsArray[2]; // Only 2 hmm s32 var_4C, var_48; s32 i, j; @@ -2621,7 +2621,7 @@ void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 for (i = 0; i < a2; i++) { - Position var_68Before; + DungeonPos var_68Before; Tile *tile; if (var_68.x < 0 || var_68.y < 0 || var_68.x > 55 || var_68.y > 31) @@ -2631,7 +2631,7 @@ void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 var_68.x += var_4C; var_68.y += var_48; if (sub_803F428(&var_68) && !gDungeon->unk181e8.blinded) { - Position32 pos32; + PixelPos pos32; pos32.x = (var_68Before.x * 0x1800) + 0xC00; pos32.y = (var_68Before.y * 0x1800) + 0x1000; var_28 = var_30 * (var_4C << 8); @@ -2828,7 +2828,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov } for (i = 0; i < to; i++, direction++) { Entity *targetEntity; - Position unkPositon; + DungeonPos unkPositon; direction &= DIRECTION_MASK; unkPositon.x = attacker->pos.x + gAdjacentTileOffsets[direction].x ; diff --git a/src/dungeon_movement.c b/src/dungeon_movement.c index c53e8b06e..70442bfbe 100644 --- a/src/dungeon_movement.c +++ b/src/dungeon_movement.c @@ -66,7 +66,7 @@ u8 sub_807034C(s16 id, struct Tile *tile) return TRUE; } -u8 sub_80703A0(Entity *pokemon, Position *pos) +u8 sub_80703A0(Entity *pokemon, DungeonPos *pos) { struct Tile *tile; u8 crossableTerrain; @@ -128,7 +128,7 @@ bool8 CanCrossWalls(Entity *pokemon) return FALSE; } -bool8 sub_807049C(Entity *pokemon, Position *pos) +bool8 sub_807049C(Entity *pokemon, DungeonPos *pos) { s32 crossableTerrain; struct Tile *tile; @@ -170,7 +170,7 @@ bool8 sub_807049C(Entity *pokemon, Position *pos) return TRUE; } -bool8 sub_8070564(Entity *pokemon, Position *pos) +bool8 sub_8070564(Entity *pokemon, DungeonPos *pos) { u8 crossableTerrain; struct Tile *tile; @@ -216,7 +216,7 @@ bool8 sub_8070564(Entity *pokemon, Position *pos) return TRUE; } -bool8 sub_80705F0(Entity *pokemon, Position *pos) +bool8 sub_80705F0(Entity *pokemon, DungeonPos *pos) { s32 crossableTerrain; struct Tile *tile; @@ -256,7 +256,7 @@ bool8 sub_80705F0(Entity *pokemon, Position *pos) return TRUE; } -bool8 sub_80706A4(Entity *pokemon, Position *pos) +bool8 sub_80706A4(Entity *pokemon, DungeonPos *pos) { s32 crossableTerrain; struct Tile *tile; diff --git a/src/dungeon_range.c b/src/dungeon_range.c index 6cd4a3941..f06338f4a 100644 --- a/src/dungeon_range.c +++ b/src/dungeon_range.c @@ -5,7 +5,7 @@ #include "dungeon_map_access.h" #include "structs/map.h" -bool8 IsPositionActuallyInSight(Position *pos1, Position *pos2) +bool8 IsPositionActuallyInSight(DungeonPos *pos1, DungeonPos *pos2) { u8 pos1Room; u8 visibility = gDungeon->unk181e8.visibilityRange; @@ -47,7 +47,7 @@ bool8 IsPositionActuallyInSight(Position *pos1, Position *pos2) } } -bool8 IsPositionInSight(Position *pos1, Position *pos2) +bool8 IsPositionInSight(DungeonPos *pos1, DungeonPos *pos2) { struct Tile *tile; u8 pos1Room; @@ -97,7 +97,7 @@ returnFalse: return TRUE; } -void sub_80833E8(Position *param_1, s32 *param_2) +void sub_80833E8(DungeonPos *param_1, s32 *param_2) { struct Tile *tile; struct RoomData *mapRoom; @@ -125,7 +125,7 @@ void sub_80833E8(Position *param_1, s32 *param_2) } } -bool8 IsTargetTwoTilesAway(Position *pos1, Position *pos2) +bool8 IsTargetTwoTilesAway(DungeonPos *pos1, DungeonPos *pos2) { s32 i; struct Tile *tile; diff --git a/src/dungeon_serializer.c b/src/dungeon_serializer.c index 5b0a886f2..2e290f492 100644 --- a/src/dungeon_serializer.c +++ b/src/dungeon_serializer.c @@ -14,7 +14,7 @@ extern u8 gUnknown_202EE70[MAX_TEAM_BODY_SIZE]; extern u8 gUnknown_202EE76[DUNGEON_MAX_WILD_POKEMON_BODY_SIZE]; -extern Position gUnknown_203B410; +extern DungeonPos gUnknown_203B410; extern Entity *gLeaderPointer; // 203B450 #include "data/dungeon_serializer.h" @@ -66,7 +66,7 @@ static s32 ReadSpeedStage(DataSerializer *seri); static u8 ReadTactic(DataSerializer *seri); static u8 ReadDecoyAITracker(DataSerializer *seri); static void ReadTile(DataSerializer *seri, Tile *dst); -static void ReadTilePos(DataSerializer *seri, Position *dst); +static void ReadTilePos(DataSerializer *seri, DungeonPos *dst); static void ReadInvisibleClassStatus(DataSerializer *seri, InvisibleClassStatus *dst); static u8 ReadType(DataSerializer *seri); static u16 ReadU16(DataSerializer *seri); @@ -112,7 +112,7 @@ static void WriteSureShotClassStatus(DataSerializer *seri, SureShotClassStatus* static void WriteMuzzled(DataSerializer *seri, Muzzled *src); static void WriteBurnClassStatus(DataSerializer *seri, BurnClassStatus *src); static void WriteReflectClassStatus(DataSerializer *seri, ReflectClassStatus *src); -static void WriteTilePos(DataSerializer *seri, Position *src); +static void WriteTilePos(DataSerializer *seri, DungeonPos *src); static void WriteS16(DataSerializer *seri, s16 value); static void WriteSleepClassStatus(DataSerializer *seri, SleepClassStatus* src); static void WriteSpeedCounters(DataSerializer *seri, u8 *src, u32 numCounters); @@ -134,7 +134,7 @@ static Entity* sub_8082A08(s16 id, s16 apparentID, s32 index); // These externs are from other files extern u8 GetBodySize(s16 index); -extern void sub_80460F8(Position *, Item *, u32); +extern void sub_80460F8(DungeonPos *, Item *, u32); void SaveDungeonState(u8 *buffer, u32 bufLen) { @@ -868,7 +868,7 @@ static void ReadDungeonItems(DataSerializer *seri) { s32 i; Item item; - Position pos; + DungeonPos pos; ReadBlame(seri, sMisakiSan); @@ -894,7 +894,7 @@ static void ReadDungeonTraps(DataSerializer *seri) s32 counter; Tile *tile; Entity *entity; - Position pos; + DungeonPos pos; u8 isVisible; u8 unk1; u8 trapID; @@ -952,7 +952,7 @@ static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index) s32 i; EntityInfo *monEntInfo; EntityInfo entInfo = {0}; - Position monPos; + DungeonPos monPos; bool8 shouldSpawnMon; u32 monIsVisible; u32 spawnGenID; @@ -1245,7 +1245,7 @@ void sub_8082B40(void) EntityInfo *info; Entity *entity; s32 i; - Position pos; + DungeonPos pos; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { entity = gDungeon->activePokemon[i]; @@ -1627,7 +1627,7 @@ static void WriteBool8(DataSerializer *seri, bool8 value) WriteBytes(seri, &local_8, 1); } -static void WriteTilePos(DataSerializer *seri, Position *src) +static void WriteTilePos(DataSerializer *seri, DungeonPos *src) { WriteBytes(seri, &src->x, 1); WriteBytes(seri, &src->y, 1); @@ -1708,7 +1708,7 @@ static bool8 ReadBool8(DataSerializer *seri) return local_8 != 0; } -static void ReadTilePos(DataSerializer *seri, Position *dst) +static void ReadTilePos(DataSerializer *seri, DungeonPos *dst) { dst->x = 0; dst->y = 0; @@ -1739,4 +1739,4 @@ static void ReadDungeonUnkE260(DataSerializer *seri, unkDungeonE260 *dst) static void ReadSpeedCounters(DataSerializer *seri, u8 *dst, u32 numCounters) { ReadBytes(seri, dst, numCounters); -} \ No newline at end of file +} diff --git a/src/dungeon_util.c b/src/dungeon_util.c index eebc9cbdb..096b35346 100644 --- a/src/dungeon_util.c +++ b/src/dungeon_util.c @@ -15,7 +15,7 @@ void sub_806C51C(Entity *entity); extern void sub_80462AC(Entity * ,u32, u32, u32, u32); extern void sub_807FA9C(); -const Position gAdjacentTileOffsets[] = { +const DungeonPos gAdjacentTileOffsets[] = { {0, 1}, {1, 1}, {1, 0}, @@ -177,7 +177,7 @@ void sub_804522C(void) { } } -void sub_804535C(Entity *entity, Position32 *pos) +void sub_804535C(Entity *entity, PixelPos *pos) { if (pos != NULL) { diff --git a/src/dungeon_util_1.c b/src/dungeon_util_1.c index d863debc7..70b4ee48a 100644 --- a/src/dungeon_util_1.c +++ b/src/dungeon_util_1.c @@ -248,7 +248,7 @@ void sub_8085890(s32 x, s32 y) sub_803F878(x, y); } -void ShiftCameraToPosition(Position32 *posStruct, s32 cameraSteps) +void ShiftCameraToPosition(PixelPos *posStruct, s32 cameraSteps) { s32 XPos; s32 YPos; diff --git a/src/dungeon_visibility.c b/src/dungeon_visibility.c index f2c862684..9697ba396 100644 --- a/src/dungeon_visibility.c +++ b/src/dungeon_visibility.c @@ -69,12 +69,12 @@ bool8 sub_8045A70(Entity *entity, Entity *targetEntity) return FALSE; } -bool8 sub_8045AAC(Entity *entity, Position *pos) +bool8 sub_8045AAC(Entity *entity, DungeonPos *pos) { return IsPositionActuallyInSight(&entity->pos, pos); } -bool8 CanTargetPosition(Entity *entity, Position *pos) +bool8 CanTargetPosition(Entity *entity, DungeonPos *pos) { return IsPositionInSight(&entity->pos, pos); } diff --git a/src/ground_script_1.c b/src/ground_script_1.c index f426bf597..aa340e4f9 100644 --- a/src/ground_script_1.c +++ b/src/ground_script_1.c @@ -52,7 +52,7 @@ void FatalError(void* loc, char* fmt, ...) __attribute__((noreturn)); char sub_8002984(s32, u8); u32 VecDirection8Radial(); u32 SizedDeltaDirection4(); -u8 SizedDeltaDirection8(Position32*, Position32*, Position32*, Position32*); +u8 SizedDeltaDirection8(PixelPos*, PixelPos*, PixelPos*, PixelPos*); bool8 sub_8021700(s32); bool8 sub_802FCF0(void); @@ -93,13 +93,13 @@ s32 HasItemInInventory(u8); u32 sub_809CC90(); void sub_809D0BC(void); void sub_809D124(s32, s32, s32); -void sub_809D158(s32, Position32*); +void sub_809D158(s32, PixelPos*); void sub_809D170(s32, s32); -void sub_809D190(s32, Position32*, s32); +void sub_809D190(s32, PixelPos*, s32); void sub_809D1A8(s32, s32, s32); -void sub_809D1CC(s32, Position32*, s32); +void sub_809D1CC(s32, PixelPos*, s32); void sub_809D1E4(s32, s32, s32); -void sub_809D208(s32, Position32*, s32); +void sub_809D208(s32, PixelPos*, s32); void sub_809D220(s32, s32, s32); u32 sub_809D52C(); bool8 GroundCancelAllEntities(void); @@ -111,14 +111,14 @@ void sub_80A8BD8(s16, s32*); u32 sub_80A8C2C(); u32 sub_80A8C98(); char *sub_80A8D54(s16); -s16 sub_80A8FD8(s32, Position32*); -s16 sub_80A8F9C(s32, Position32*); +s16 sub_80A8FD8(s32, PixelPos*); +s16 sub_80A8F9C(s32, PixelPos*); u32 sub_80A9050(); u32 sub_80A9090(); -s16 sub_80AC448(s16, Position32*); -s32 sub_80AC49C(s16, Position32*); -s16 sub_80AD360(s16, Position32*); -s16 sub_80AD3B4(s16, Position32*); +s16 sub_80AC448(s16, PixelPos*); +s32 sub_80AC49C(s16, PixelPos*); +s16 sub_80AD360(s16, PixelPos*); +s16 sub_80AD3B4(s16, PixelPos*); u32 GroundLink_GetPos(); u32 GroundLink_GetArea(); void DeleteGroundEvents(void); @@ -139,7 +139,7 @@ extern struct { const char *unk0; s32 unk4; } gChoices[9]; extern char gUnknown_2039D98[12]; extern int gNumChoices; -extern Position32 gUnknown_81164DC; +extern PixelPos gUnknown_81164DC; extern char gUnknown_81165D4[]; extern char gUnknown_81165F4[]; extern char gUnknown_811660C[]; @@ -404,7 +404,7 @@ s32 ExecuteScriptCommand(Action *action) { case 0x19: { s8 unk[4]; GroundObjectData *obj; - Position32 pos; + PixelPos pos; s16 res; s32 group; s32 sector; @@ -431,7 +431,7 @@ s32 ExecuteScriptCommand(Action *action) { case 0x1a: { s8 unk; GroundEffectData *eff; - Position32 pos; + PixelPos pos; s16 res; s32 group; s32 sector; @@ -541,10 +541,10 @@ s32 ExecuteScriptCommand(Action *action) { case 0x21: { s32 ret; s32 unk; - Position32 pos1; - Position32 pos2; - Position32 pos3; - Position32 pos4; + PixelPos pos1; + PixelPos pos2; + PixelPos pos3; + PixelPos pos4; s32 tmp; ret = (s16)sub_80A7AE8((s16)curCmd.arg1); if (ret >= 0) { @@ -864,7 +864,7 @@ s32 ExecuteScriptCommand(Action *action) { } case 0x50: { Action *ptr; - Position32 pos; + PixelPos pos; s8 c; { Action *tmp = (Action*)sub_809D52C(action->unkC.arr); @@ -880,9 +880,9 @@ s32 ExecuteScriptCommand(Action *action) { break; } case 0x51: { - Position32 posIn; - Position32 posOut1; - Position32 posOut2; + PixelPos posIn; + PixelPos posOut1; + PixelPos posOut2; action->callbacks->getHitboxCenter(action->parentObject, &posIn); GroundLink_GetArea(curCmd.argShort, &posOut1, &posOut2, &posIn); action->callbacks->setPositionBounds(action->parentObject, &posOut1, &posOut2); @@ -920,7 +920,7 @@ s32 ExecuteScriptCommand(Action *action) { break; } case 0x58: { - Position32 unk; + PixelPos unk; unk.x = curCmd.arg1 << 8; unk.y = curCmd.arg2 << 8; action->callbacks->moveReal(action->parentObject, &unk); @@ -928,7 +928,7 @@ s32 ExecuteScriptCommand(Action *action) { return 2; } case 0x59: { - Position32 unk; + PixelPos unk; unk.x = curCmd.argShort << 8; unk.y = curCmd.arg1 << 8; action->callbacks->moveRelative(action->parentObject, &unk); @@ -939,12 +939,13 @@ s32 ExecuteScriptCommand(Action *action) { u32 unk[2]; unk[0] = OtherRandInt(curCmd.argShort) << 8; unk[1] = OtherRandInt(curCmd.arg1) << 8; - action->callbacks->moveRelative(action->parentObject, (Position32*)unk); + action->callbacks->moveRelative(action->parentObject, + (PixelPos*)unk); scriptData->unk2A = (u8)curCmd.argByte; return 2; } case 0x5b: { - Position32 unk; + PixelPos unk; action->callbacks->getHitboxCenter(action->parentObject, &unk); GroundLink_GetPos((s16)curCmd.arg1, &unk); action->callbacks->moveReal(action->parentObject, &unk); // landing end of unwanted tailmerge @@ -952,7 +953,7 @@ s32 ExecuteScriptCommand(Action *action) { return 2; } case 0x5c: { - Position32 pos, pos1, pos2; + PixelPos pos, pos1, pos2; action->callbacks->getHitboxCenter(action->parentObject, &pos); GroundLink_GetArea((s16)curCmd.arg1, &pos1, &pos2, &pos); pos.x = pos1.x + OtherRandInt(pos2.x - pos1.x); @@ -962,7 +963,7 @@ s32 ExecuteScriptCommand(Action *action) { return 2; } case 0x5d: { - Position32 unk; + PixelPos unk; s16 res = sub_80A7AE8((s16)curCmd.arg1); if (res >= 0) { sub_80A8FD8(res, &unk); @@ -973,7 +974,7 @@ s32 ExecuteScriptCommand(Action *action) { break; } case 0x5e: { - Position32 pos; + PixelPos pos; s32 height; s32 dir; pos.x = GetScriptVarArrayValue(NULL, POSITION_X, (u16)curCmd.arg1); @@ -992,7 +993,7 @@ s32 ExecuteScriptCommand(Action *action) { return 2; } case 0x5f: { - Position32 pos; + PixelPos pos; u32 height; u32 wat; s8 dir; @@ -1018,7 +1019,7 @@ s32 ExecuteScriptCommand(Action *action) { return 2; } case 0x62: case 0x6a: { - Position32 pos; + PixelPos pos; action->callbacks->getHitboxCenter(action->parentObject, &pos); scriptData->pos2.x = pos.x + (curCmd.arg1 << 8); scriptData->pos2.y = pos.y + (curCmd.arg2 << 8); @@ -1196,7 +1197,7 @@ s32 ExecuteScriptCommand(Action *action) { case 0x8e: case 0x8f: case 0x90: { bool8 flag = FALSE; s8 dir; - Position32 pos1, pos2, pos3, pos4; + PixelPos pos1, pos2, pos3, pos4; switch (curCmd.op) { case 0x8e: { s32 val = (s16)sub_80A7AE8((s16)curCmd.arg1); @@ -1282,7 +1283,7 @@ s32 ExecuteScriptCommand(Action *action) { } case 0x99: { s32 id = action->callbacks->getIndex(action->parentObject); - Position32 unk; + PixelPos unk; switch(action->unk8[0]) { case 1: sub_80A8FD8(id, &unk); @@ -1321,7 +1322,7 @@ s32 ExecuteScriptCommand(Action *action) { } case 0x9c: { s32 id = action->callbacks->getIndex(action->parentObject); - Position32 unk; + PixelPos unk; switch(action->unk8[0]) { case 1: sub_80A8FD8(id, &unk); @@ -1360,7 +1361,7 @@ s32 ExecuteScriptCommand(Action *action) { } case 0x9f: { s32 id = action->callbacks->getIndex(action->parentObject); - Position32 unk; + PixelPos unk; switch(action->unk8[0]) { case 1: sub_80A8FD8(id, &unk); @@ -1399,7 +1400,7 @@ s32 ExecuteScriptCommand(Action *action) { } case 0xa2: { s32 id = action->callbacks->getIndex(action->parentObject); - Position32 unk; + PixelPos unk; switch(action->unk8[0]) { case 1: sub_80A8FD8(id, &unk); @@ -1571,7 +1572,7 @@ s32 ExecuteScriptCommand(Action *action) { } case 0xc0 ... 0xcb: { s32 val; - Position32 pos, pos2, pos3; + PixelPos pos, pos2, pos3; switch (curCmd.op) { case 0xc0: { val = GetScriptVarValue(scriptData->localVars.buf, curCmd.argShort); @@ -1625,7 +1626,7 @@ s32 ExecuteScriptCommand(Action *action) { case 0xc8: { s16 tmp = (s16)sub_80A7AE8((s16)curCmd.arg1); if (tmp >= 0) { - Position32 pos1, pos2, pos3, pos4; + PixelPos pos1, pos2, pos3, pos4; action->callbacks->getHitboxCenter(action->parentObject, &pos1); action->callbacks->getSize(action->parentObject, &pos2); sub_80A8FD8(tmp, &pos3); @@ -1642,7 +1643,7 @@ s32 ExecuteScriptCommand(Action *action) { case 0xc9: { s16 tmp = (s16)sub_80A7AE8((s16)curCmd.arg1); if (tmp >= 0) { - Position32 pos1, pos2, pos3; + PixelPos pos1, pos2, pos3; action->callbacks->getHitboxCenter(action->parentObject, &pos1); action->callbacks->getSize(action->parentObject, &pos2); sub_80A8FD8(tmp, &pos3); diff --git a/src/menu_input.c b/src/menu_input.c index 40e1245ab..e2a867cc5 100644 --- a/src/menu_input.c +++ b/src/menu_input.c @@ -66,7 +66,7 @@ const s32 gUnknown_80D4830[9] = { extern s16 sub_8009614(u32, u32); static void sub_8013134(MenuInputStruct *, u32, u32); -static void sub_801332C(Position *a0); +static void sub_801332C(DungeonPos *a0); static void sub_8013470(MenuInputStruct *); static bool8 sub_8013DD0(unkStructFor8013AA0 *); @@ -716,8 +716,8 @@ void nullsub_34(MenuInputStructSub *a0, s32 a1) { } -// Maybe Position -static void sub_801332C(Position *a0) +// Maybe DungeonPos +static void sub_801332C(DungeonPos *a0) { SpriteOAM sp = {}; SpriteOAM* ptr; diff --git a/src/move_actions.c b/src/move_actions.c index 1a2d20ecd..3226a0a5e 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -183,17 +183,18 @@ void sub_8075900(Entity *pokemon, u8 r1); extern u8 sub_8044B28(void); extern void sub_807EC28(bool8); extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); -extern void sub_804652C(Entity *, Entity *, Item *, u32, Position *); +extern void sub_804652C(Entity *, Entity *, Item *, u32, DungeonPos *); extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); extern void sub_8045C28(Item *, u8 , u8); -static void sub_805A7D4(Entity *, Entity *, Item *, Position *); +static void sub_805A7D4(Entity *, Entity *, Item *, DungeonPos *); extern void MudWaterSportEffect(u32); extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); extern void sub_806A6E8(Entity *); extern void sub_806ABAC(Entity *, Entity *); extern u8 sub_806F4A4(Entity *, u32); -extern void sub_807DF38(Entity *pokemon, Entity *target, Position *pos, u32, u8 moveType, s16); +extern void sub_807DF38(Entity *pokemon, Entity *target, DungeonPos *pos, u32, + u8 moveType, s16); extern void nullsub_92(Entity *); extern u32 sub_8055864(Entity *pokemon, Entity *target, Move *param_3, s32 param_4, s32 param_5); extern u8 sub_807EAA0(u32, u32); @@ -2459,7 +2460,7 @@ bool8 sub_805A464(Entity *pokemon, Entity *target, Move *move, u32 param_4) { bool32 flag; Item item; - Position pos; + DungeonPos pos; flag = FALSE; if (HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { @@ -2592,7 +2593,7 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ EntityInfo *entityInfo; EntityInfo *targetEntityInfo; Item heldItem; - Position pos; + DungeonPos pos; entityInfo = GetEntInfo(pokemon); targetEntityInfo = GetEntInfo(target); @@ -2632,7 +2633,8 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ } } -static void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, Position *pos) +static void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, + DungeonPos *pos) { Entity stackEntity; @@ -2655,10 +2657,10 @@ bool8 sub_805A85C(Entity * pokemon, Entity * target, Move *move, u32 param_4) int x; int y; int counter; - Position *r9; - Position pos1; + DungeonPos *r9; + DungeonPos pos1; Move stackMove; - Position32 pos2; + PixelPos pos2; struct Tile *tile; Entity *entity; s32 temp; @@ -2735,9 +2737,9 @@ _0805A9FE: _0805AA5E: if (EntityExists(target)) { #ifndef NOMATCHING - register Position *pos asm("r1"); + register DungeonPos *pos asm("r1"); #else - Position *pos; + DungeonPos *pos; #endif sub_804535C(target, NULL); pos = r9; diff --git a/src/position_util.c b/src/position_util.c index 07fe6fb7e..159fc9aa7 100644 --- a/src/position_util.c +++ b/src/position_util.c @@ -9,7 +9,7 @@ const s32 gFacingDirMapping[3][3] = { {DIRECTION_SOUTHWEST, DIRECTION_SOUTH, DIRECTION_SOUTHEAST} }; -s32 GetDirectionTowardsPosition(Position *originPos, Position *targetPos) +s32 GetDirectionTowardsPosition(DungeonPos *originPos, DungeonPos *targetPos) { s32 direction; s32 yDiff; @@ -44,7 +44,7 @@ s32 GetDirectionTowardsPosition(Position *originPos, Position *targetPos) return direction; } -s32 GetDistance(Position *pos1, Position *pos2) +s32 GetDistance(DungeonPos *pos1, DungeonPos *pos2) { s32 distanceX = pos1->x - pos2->x; s32 distance; diff --git a/src/sprite.c b/src/sprite.c index 8d5128655..4d943836c 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -12,7 +12,7 @@ static EWRAM_DATA s16 sUnknown_2025672[8] = {0}; UNUSED // TODO: Remove the "UNUSED" attribute after AddAxSprite is done #endif static EWRAM_DATA s16 sUnknown_2025682[9] = {0}; -static EWRAM_DATA Position sUnknown_2025694 = {0}; +static EWRAM_DATA DungeonPos sUnknown_2025694 = {0}; static EWRAM_DATA u32 sUnknown_2025698 = {0}; UNUSED static EWRAM_DATA u32 sUnused1 = {0}; // 202569C static EWRAM_DATA SpriteList sUnknown_20256A0 = {0}; @@ -755,7 +755,7 @@ void CopySpritesToOam(void) sOAMSpriteCount = count; } -void SetSavingIconCoords(Position *pos) +void SetSavingIconCoords(DungeonPos *pos) { if (pos == NULL) { sUnknown_2025694.x = 0; diff --git a/src/status_actions.c b/src/status_actions.c index 57f45fb5f..8df3e799f 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -39,14 +39,14 @@ extern void sub_807F43C(Entity *, Entity *); extern void sub_807DC68(Entity *, Entity *); extern u32 sub_803D73C(u32); extern void sub_8045C28(Item *, u8 , u8); -extern void sub_80464C8(Entity *, Position *, Item *); +extern void sub_80464C8(Entity *, DungeonPos *, Item *); extern void sub_8068FE0(Entity *, u32, Entity *r2); extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); -extern void sub_807FC3C(Position *, u32, u32); -extern void sub_8042A64(Position *); +extern void sub_807FC3C(DungeonPos *, u32, u32); +extern void sub_8042A64(DungeonPos *); extern void sub_8040A84(void); extern void sub_80498A8(s32, s32); -extern void sub_8042A54(Position *); +extern void sub_8042A54(DungeonPos *); extern void sub_8049BB0(s32, s32); extern s16 sub_8057600(Move*, u32); extern u32 sub_8055864(Entity *pokemon, Entity *target, Move *param_3, s32 param_4, s32 param_5); @@ -60,8 +60,8 @@ extern void sub_806BB6C(Entity *, s32); extern void sub_807E254(Entity *, Entity *, u32); extern u32 HandleDamagingMove(Entity *, Entity *, Move *, u32, u32); extern void sub_806A6E8(Entity *); -extern u8 sub_8069D18(Position *); -extern u8 sub_804AD34(Position *); +extern u8 sub_8069D18(DungeonPos *); +extern u8 sub_804AD34(DungeonPos *); // TODO include dungeon_ai.h when SqueezedStatusTarget is figured out extern void LowerDefenseStageTarget(Entity *, Entity *, s32, s32, u8, bool8); @@ -653,7 +653,7 @@ bool8 sub_805B968(Entity * pokemon, Entity * target, Move * move, s32 param_4) bool8 RockSmashMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { - Position pos; + DungeonPos pos; bool8 flag = FALSE; if (sub_8069D18(&pos) != 0) { @@ -947,7 +947,7 @@ bool8 TrapbustOrbAction(Entity * pokemon,Entity * target, Move *move, s32 param_ s32 xCoord, yCoord; struct RoomData *room; s32 topLeftCornerX, topLeftCornerY; - Position pos; + DungeonPos pos; bool8 foundTrap = FALSE; tile = GetTileAtEntitySafe(target); if (IsBossFight()) { @@ -1099,7 +1099,7 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4) int y; bool8 filledInTile; int x; - Position tileCoords; + DungeonPos tileCoords; filledInTile = FALSE; targetInfo = GetEntInfo(target); @@ -1153,7 +1153,7 @@ bool8 TrapperOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) bool8 sub_805C3F8(Entity *pokemon, Entity *target, Move *move, s32 param_4) { Item stack; - Position posStruct = target->pos; + DungeonPos posStruct = target->pos; if(GetEntInfo(target)->monsterBehavior != BEHAVIOR_FIXED_ENEMY) { diff --git a/src/string_format.c b/src/string_format.c index 6f359eb28..522ec0052 100644 --- a/src/string_format.c +++ b/src/string_format.c @@ -34,7 +34,7 @@ void sub_80140B4(UnkTextStruct2 *a0) void sub_80140DC(void) { - Position pos; + DungeonPos pos; pos.x = 200; pos.y = 128; @@ -44,7 +44,7 @@ void sub_80140DC(void) void sub_80140F8(void) { - Position pos; + DungeonPos pos; pos.x = 188; pos.y = 64; @@ -92,7 +92,7 @@ struct UnkStruct_203B198 UnkTextStruct2 unk0; u8 unk18; u32 unk1C; - Position unk20; + DungeonPos unk20; u16 unk24; u16 unk26; u16 unk28; diff --git a/src/tile_types.c b/src/tile_types.c index 947b3f246..440a643ae 100644 --- a/src/tile_types.c +++ b/src/tile_types.c @@ -87,9 +87,9 @@ const u8 gDungeonWaterType[76] = { extern void sub_80498A8(s32, s32); extern void sub_80402AC(s32, s32); extern void sub_8049BB0(s32, s32); -void sub_8042A14(Position *); +void sub_8042A14(DungeonPos *); -bool8 PosHasItem(Position *pos) +bool8 PosHasItem(DungeonPos *pos) { struct Tile *tile; Entity *entity; @@ -102,7 +102,7 @@ bool8 PosHasItem(Position *pos) return FALSE; } -Entity *GetMonsterAtPos(Position *pos) +Entity *GetMonsterAtPos(DungeonPos *pos) { struct Tile *tile; Entity *entity; @@ -115,7 +115,7 @@ Entity *GetMonsterAtPos(Position *pos) return NULL; } -bool8 sub_804AD34(Position *pos) +bool8 sub_804AD34(DungeonPos *pos) { struct Tile *tile; s32 x; @@ -155,7 +155,7 @@ bool8 sub_804AD34(Position *pos) return iVar8; } -bool8 sub_804AE08(Position *pos) +bool8 sub_804AE08(DungeonPos *pos) { struct Tile *tile; s32 x; @@ -182,7 +182,7 @@ bool8 sub_804AE08(Position *pos) return uVar6; } -void sub_804AE84(Position *pos) +void sub_804AE84(DungeonPos *pos) { struct Tile *tile; s32 x; diff --git a/src/trap.c b/src/trap.c index 291bb642b..2d51f8b40 100644 --- a/src/trap.c +++ b/src/trap.c @@ -64,7 +64,7 @@ struct unkStruct_806B7F8 u32 unk4; u16 level; u8 fillA[2]; - struct Position pos; + DungeonPos pos; u8 unk10; }; extern Entity* sub_806B7F8(struct unkStruct_806B7F8 *, bool8); @@ -73,7 +73,7 @@ void sub_806A9B4(Entity *, u32); s16 sub_803D970(u32); bool8 sub_806AA0C(s32, s32); -void sub_80421EC(Position *, u32); +void sub_80421EC(DungeonPos *, u32); bool8 sub_8045888(Entity *); u8 sub_8043D10(void); @@ -82,13 +82,14 @@ void sub_8045C28(Item *, u8 , u8); void sub_8045BF8(u8 *, Item *); void DealDamageToEntity(Entity *,s16,u32,u32); void sub_806F480(Entity *, u32); -void sub_804225C(Entity *, Position *, u8); +void sub_804225C(Entity *, DungeonPos *, u8); void sub_8071DA4(Entity *); void sub_806A1E8(Entity *pokemon); u8 sub_803D6FC(void); -extern void sub_807DF38(Entity *pokemon, Entity *target, Position *pos, u32, u8 moveType, s16); +extern void sub_807DF38(Entity *pokemon, Entity *target, DungeonPos *pos, u32, + u8 moveType, s16); -void sub_807FC3C(Position *pos, u32 trapID, u32 param_3) +void sub_807FC3C(DungeonPos *pos, u32 trapID, u32 param_3) { gDungeon->trapPos.x = pos->x; gDungeon->trapPos.y = pos->y; @@ -97,7 +98,7 @@ void sub_807FC3C(Position *pos, u32 trapID, u32 param_3) gDungeon->unk13570 = 1; } -bool8 CanLayTrap(Position *pos) +bool8 CanLayTrap(DungeonPos *pos) { struct Tile *tile = GetTileSafe(pos->x, pos->y); if (tile->terrainType & TERRAIN_TYPE_STAIRS || @@ -118,7 +119,7 @@ bool8 CanLayTrap(Position *pos) return TRUE; } -bool8 LayTrap(Position *pos, u8 trapID, u8 param_3) +bool8 LayTrap(DungeonPos *pos, u8 trapID, u8 param_3) { Tile *tile; Entity *entity; @@ -183,7 +184,7 @@ bool8 sub_807FD84(Entity *entity) return flag; } -bool8 sub_807FE04(Position *pos, char param_2) +bool8 sub_807FE04(DungeonPos *pos, char param_2) { Tile *tile; @@ -201,7 +202,7 @@ bool8 sub_807FE04(Position *pos, char param_2) } } -bool8 sub_807FE44(Position *pos, char param_2) +bool8 sub_807FE44(DungeonPos *pos, char param_2) { Tile *tile; @@ -223,7 +224,7 @@ void GetTrapName(u8 *buffer, u8 trapIndex) strcpy(buffer, gTrapNames[trapIndex]); } -void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4) +void sub_807FE9C(Entity *pokemon, DungeonPos *pos, int param_3, char param_4) { Tile *tile; bool8 flag1; @@ -578,7 +579,7 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile) } } -void HandleSummonTrap(Entity *pokemon,Position *pos) +void HandleSummonTrap(Entity *pokemon,DungeonPos *pos) { s32 r4; u32 direction; diff --git a/src/trap_1.c b/src/trap_1.c index c16165703..0aa388a41 100644 --- a/src/trap_1.c +++ b/src/trap_1.c @@ -8,13 +8,13 @@ // TODO: Merge this file with trap.c after "HandlePokemonTrap" is in c -extern void sub_804687C(Entity *, Position *, Position *, Item *, u32); +extern void sub_804687C(Entity *, DungeonPos *, DungeonPos *, Item *, u32); void HandleTripTrap(Entity *pokemon, Entity *target) { u32 direction; EntityInfo *info; - Position pos; + DungeonPos pos; Item item; if (target != NULL) { diff --git a/tmp/fixpoint.cocci b/tmp/fixpoint.cocci deleted file mode 100644 index 1c25b8c31..000000000 --- a/tmp/fixpoint.cocci +++ /dev/null @@ -1,17 +0,0 @@ -@@ -s48_16 e; -s48_16 *ep; -@@ -( -- e.s0 -+ e.hi -| -- e.s4 -+ e.lo -| -- ep->s0 -+ ep->hi -| -- ep->s4 -+ ep->lo -) diff --git a/tmp/position.cocci b/tmp/position.cocci new file mode 100644 index 000000000..ff2de880e --- /dev/null +++ b/tmp/position.cocci @@ -0,0 +1,17 @@ +@@ +typedef Position; +@@ +- struct Position ++ Position +@@ +typedef Position32; +typedef PixelPos; +@@ +- Position32 ++ PixelPos +@@ +typedef Position; +typedef DungeonPos; +@@ +- Position ++ DungeonPos diff --git a/tmp/renames.sed b/tmp/renames.sed deleted file mode 100644 index 39d202303..000000000 --- a/tmp/renames.sed +++ /dev/null @@ -1,26 +0,0 @@ -s/sub_8009DA4/FP24_8_SMul/g -s/sub_8009DD8/FP24_8_SDiv/g -s/sub_8009E14/FP24_8_UMul/g -s/sub_8009EA0/FP24_8_UDiv/g -s/sub_8009F68/FP24_8_Pow/g -s/sub_8009FB8/FP24_8_Hypot/g -s/sub_800A020/FP48_16_FromS32/g -s/sub_800A048/FP48_16_ToS32/g -s/sub_800A068/FP48_16_ToF248/g -s/sub_800A088/FP48_16_FromF248/g -s/sub_800A25C/FP48_16_Negate/g -s/sub_800A27C/FP48_16_Abs/g -s/sub_800A2A0/FP48_16_IsZero/g -s/sub_800A2BC/FP48_16_Equal/g -s/sub_800A2DC/FP48_16_IsNegative/g -s/sub_800A2F0/FP48_16_SLessThan/g -s/sub_800A34C/FP48_16_SMul/g -s/sub_800A3F0/FP48_16_SDiv/g -s/sub_800A4A0/FP48_16_Square/g -s/sub_800A4E4/FP48_16_UMul/g -s/sub_800A5A4/FP48_16_UDiv/g -s/sub_800A6D0/FP48_16_Add/g -s/sub_800A6F0/FP48_16_Subtract/g -s/sub_800A710/FP48_16_Pow/g -s/sub_800A78C/FP48_16_Hypot/g -s/sub_800A894/FP48_16_Log/g From 4c8a8f4b301b840f50fef24d56fa3ab6c17e5fd3 Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Wed, 13 Nov 2024 12:42:24 +0100 Subject: [PATCH 44/48] GetTile -> const Tile* --- asm/code_8045A00.s | 4 +- asm/code_804AFAC.s | 164 +++++++++++++++++------------------ asm/code_804FD30.s | 74 ++++++++-------- asm/code_805D8C8_1.s | 4 +- asm/code_8069E0C.s | 2 +- asm/code_8077274_1.s | 4 +- asm/code_807CD9C.s | 10 +-- asm/code_807E5AC.s | 2 +- include/dungeon_map_access.h | 4 +- include/dungeon_movement.h | 2 +- include/dungeon_util.h | 3 +- src/code_803E724.c | 2 +- src/code_8040094.c | 4 +- src/code_8042B34.c | 2 +- src/code_8044CC8.c | 4 +- src/code_80450F8.c | 2 +- src/code_8045A00.c | 2 +- src/code_804AFAC.c | 10 +-- src/code_805D8C8_1.c | 14 +-- src/code_8066D04.c | 2 +- src/code_806CD90.c | 2 +- src/code_80718D8.c | 2 +- src/code_8072B78.c | 2 +- src/code_8075708.c | 4 +- src/code_807CD9C.c | 4 +- src/dungeon_ai_attack.c | 6 +- src/dungeon_ai_item_weight.c | 2 +- src/dungeon_ai_items.c | 2 +- src/dungeon_ai_movement.c | 8 +- src/dungeon_ai_targeting.c | 15 ++-- src/dungeon_capabilities.c | 2 +- src/dungeon_cutscenes.c | 16 ++-- src/dungeon_map_access.c | 48 +++++----- src/dungeon_move.c | 4 +- src/dungeon_movement.c | 12 +-- src/dungeon_range.c | 8 +- src/dungeon_serializer.c | 6 +- src/dungeon_util.c | 4 +- src/move_actions.c | 6 +- src/move_checks.c | 2 +- src/move_effects_target.c | 10 +-- src/status.c | 2 +- src/status_actions.c | 8 +- src/tile_types.c | 16 ++-- src/trap.c | 10 +-- tmp/gettile.cocci | 42 +++++++++ tmp/position.cocci | 17 ---- 47 files changed, 301 insertions(+), 274 deletions(-) create mode 100644 tmp/gettile.cocci delete mode 100644 tmp/position.cocci diff --git a/asm/code_8045A00.s b/asm/code_8045A00.s index 5f79ba4d4..74dd85a19 100644 --- a/asm/code_8045A00.s +++ b/asm/code_8045A00.s @@ -442,7 +442,7 @@ _08046110: ldrsh r0, [r5, r1] movs r2, 0x2 ldrsh r1, [r5, r2] - bl GetTileSafe + bl GetTileMut str r4, [r0, 0x14] ldrh r1, [r0] movs r0, 0x20 @@ -528,7 +528,7 @@ sub_80461C8: ldrsh r0, [r2, r1] movs r3, 0x2 ldrsh r1, [r2, r3] - bl GetTileSafe + bl GetTileMut adds r6, r0, 0 ldr r5, [r6, 0x14] cmp r5, 0 diff --git a/asm/code_804AFAC.s b/asm/code_804AFAC.s index c2f4a3fea..48d8e5dd8 100644 --- a/asm/code_804AFAC.s +++ b/asm/code_804AFAC.s @@ -679,7 +679,7 @@ _0804B55A: adds r0, r5, 0 adds r1, r4, 0 str r3, [sp, 0xC] - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrh r0, [r2] ldr r6, _0804B630 @@ -1196,7 +1196,7 @@ _0804B962: ldr r2, _0804B9F0 add r2, sp str r3, [r2] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] mov r2, r9 ands r1, r2 @@ -1205,7 +1205,7 @@ _0804B962: strh r1, [r0] adds r0, r4, 0 adds r1, r5, 0 - bl GetTileSafe + bl GetTileMut ldr r1, _0804B9D0 add r1, sp ldrb r1, [r1] @@ -1294,7 +1294,7 @@ _0804B9F4: strh r0, [r7, 0x6] adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r3, _0804BBF8 adds r2, r3, 0 @@ -1304,7 +1304,7 @@ _0804B9F4: strh r1, [r0] adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0xFF strb r1, [r0, 0x9] _0804BA72: @@ -1805,7 +1805,7 @@ _0804BE84: ldr r2, _0804BEFC add r2, sp str r3, [r2] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] mov r2, r8 ands r1, r2 @@ -1814,7 +1814,7 @@ _0804BE84: strh r1, [r0] adds r0, r4, 0 adds r1, r5, 0 - bl GetTileSafe + bl GetTileMut ldr r1, _0804BEE0 add r1, sp ldrb r1, [r1] @@ -1902,7 +1902,7 @@ _0804BF00: strh r0, [r7, 0x6] adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r6, _0804C090 adds r2, r6, 0 @@ -1912,7 +1912,7 @@ _0804BF00: strh r1, [r0] adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0xFF strb r1, [r0, 0x9] _0804BF88: @@ -2563,7 +2563,7 @@ _0804C4C2: _0804C4CE: adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ands r1, r7 movs r2, 0x1 @@ -3164,7 +3164,7 @@ _0804C95C: _0804C972: adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] mov r2, r8 ands r1, r2 @@ -3173,7 +3173,7 @@ _0804C972: strh r1, [r0] adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut mov r1, r9 strb r1, [r0, 0x9] adds r4, 0x1 @@ -3373,7 +3373,7 @@ _0804CB0C: lsls r2, 5 add r2, sp str r3, [r2] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] mov r2, r8 ands r1, r2 @@ -3382,7 +3382,7 @@ _0804CB0C: strh r1, [r0] adds r0, r4, 0 adds r1, r5, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0xE5 lsls r1, 5 add r1, sp @@ -3871,7 +3871,7 @@ _0804CEFA: beq _0804CF16 adds r0, r7, 0 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r3, _0804D018 adds r2, r3, 0 @@ -4544,7 +4544,7 @@ _0804D3E0: adds r0, r4, 0 adds r1, r5, 0 str r3, [sp, 0x34] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] mov r2, r9 ands r1, r2 @@ -4553,7 +4553,7 @@ _0804D3E0: strh r1, [r0] adds r0, r4, 0 adds r1, r5, 0 - bl GetTileSafe + bl GetTileMut mov r1, sp ldrb r1, [r1, 0x10] strb r1, [r0, 0x9] @@ -4680,7 +4680,7 @@ _0804D4BA: strh r0, [r7, 0x6] adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r3, _0804D530 adds r2, r3, 0 @@ -4690,7 +4690,7 @@ _0804D4BA: strh r1, [r0] adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0xFE strb r1, [r0, 0x9] _0804D508: @@ -5815,7 +5815,7 @@ _0804DCF0: adds r0, r5, 0 adds r1, r4, 0 str r3, [sp, 0x54] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r3, [sp, 0x54] ands r1, r3 @@ -5945,7 +5945,7 @@ _0804DDE0: adds r0, r5, 0 adds r1, r4, 0 str r3, [sp, 0x54] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r3, [sp, 0x54] ands r1, r3 @@ -6076,7 +6076,7 @@ _0804DED0: adds r0, r5, 0 adds r1, r4, 0 str r3, [sp, 0x54] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r3, [sp, 0x54] ands r1, r3 @@ -6195,7 +6195,7 @@ _0804DFB6: adds r0, r5, 0 adds r1, r4, 0 str r3, [sp, 0x54] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] mov r2, r9 ands r1, r2 @@ -6617,7 +6617,7 @@ _0804E2AA: bne _0804E2F0 adds r0, r7, 0 mov r1, r8 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] ldr r4, _0804E2CC adds r1, r4, 0 @@ -6723,7 +6723,7 @@ _0804E360: beq _0804E390 adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] ldr r3, _0804E38C adds r1, r3, 0 @@ -6773,7 +6773,7 @@ _0804E3BC: beq _0804E3EC adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] ldr r3, _0804E3E8 adds r1, r3, 0 @@ -6829,7 +6829,7 @@ _0804E420: beq _0804E450 adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] ldr r3, _0804E44C adds r1, r3, 0 @@ -6883,7 +6883,7 @@ _0804E482: beq _0804E4B0 adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] ldr r3, _0804E4AC adds r1, r3, 0 @@ -6930,7 +6930,7 @@ _0804E4D0: beq _0804E508 adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] ldr r3, _0804E504 adds r1, r3, 0 @@ -6979,7 +6979,7 @@ _0804E52C: beq _0804E564 adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] ldr r3, _0804E560 adds r1, r3, 0 @@ -7379,7 +7379,7 @@ _0804E848: ldrsh r0, [r6, r1] movs r2, 0x2 ldrsh r1, [r6, r2] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r3, _0804E99C adds r2, r3, 0 @@ -7494,7 +7494,7 @@ _0804E908: _0804E926: adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] ldr r3, _0804E99C adds r1, r3, 0 @@ -7628,7 +7628,7 @@ _0804EA0E: ble _0804EA4E subs r0, r5, 0x1 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrb r0, [r2, 0x9] cmp r0, 0xFF @@ -7653,7 +7653,7 @@ _0804EA4E: ble _0804EA82 subs r1, r4, 0x1 adds r0, r5, 0 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrb r0, [r2, 0x9] cmp r0, 0xFF @@ -7680,7 +7680,7 @@ _0804EA82: bgt _0804EABA adds r0, r5, 0 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrb r0, [r2, 0x9] cmp r0, 0xFF @@ -7707,7 +7707,7 @@ _0804EABA: bgt _0804EB0E mov r0, r10 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrb r0, [r2, 0x9] cmp r0, 0xFF @@ -7740,7 +7740,7 @@ _0804EAF4: bne _0804EB0E adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0xFF strb r1, [r0, 0x9] _0804EB0E: @@ -8099,7 +8099,7 @@ _0804ED98: adds r0, r5, 0 adds r1, r4, 0 str r3, [sp, 0x50] - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] movs r1, 0x20 orrs r1, r2 @@ -8185,7 +8185,7 @@ _0804EE18: _0804EE38: adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0, 0x4] movs r1, 0x10 orrs r1, r2 @@ -8466,7 +8466,7 @@ _0804F046: _0804F05A: adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] movs r1, 0x40 orrs r1, r2 @@ -8971,7 +8971,7 @@ _0804F40A: beq _0804F438 subs r0, r6, 0x1 adds r1, r5, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ands r1, r7 movs r2, 0x2 @@ -8982,7 +8982,7 @@ _0804F434: .4byte 0x0000fffc _0804F438: subs r0, r6, 0x1 adds r1, r5, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ands r1, r7 _0804F444: @@ -9057,7 +9057,7 @@ _0804F4BA: movs r7, 0 adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut mov r1, r9 mov r3, r8 lsrs r2, r3, 24 @@ -9140,7 +9140,7 @@ _0804F550: _0804F55A: adds r0, r5, 0x1 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut mov r1, r9 mov r3, r8 lsrs r2, r3, 24 @@ -9150,7 +9150,7 @@ _0804F55A: _0804F570: subs r1, r4, 0x1 adds r0, r5, 0 - bl GetTileSafe + bl GetTileMut mov r1, r9 mov r3, r8 lsrs r2, r3, 24 @@ -9160,7 +9160,7 @@ _0804F570: _0804F586: subs r0, r5, 0x1 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut mov r1, r9 mov r3, r8 lsrs r2, r3, 24 @@ -9170,7 +9170,7 @@ _0804F586: _0804F59C: adds r1, r4, 0x1 adds r0, r5, 0 - bl GetTileSafe + bl GetTileMut mov r1, r9 mov r3, r8 lsrs r2, r3, 24 @@ -9220,7 +9220,7 @@ _0804F5E2: _0804F5F0: adds r0, r6, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0, 0x4] movs r1, 0x20 orrs r1, r2 @@ -9400,7 +9400,7 @@ _0804F730: _0804F73C: mov r0, r8 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0 bl sub_804F5C4 adds r4, 0x1 @@ -9425,7 +9425,7 @@ _0804F75E: _0804F76C: adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] movs r1, 0x80 orrs r1, r2 @@ -9482,7 +9482,7 @@ _0804F7C8: _0804F7D4: adds r0, r4, 0 mov r1, r8 - bl GetTileSafe + bl GetTileMut movs r1, 0 bl sub_804F5C4 adds r4, 0x1 @@ -9507,7 +9507,7 @@ _0804F7F6: _0804F804: adds r0, r4, 0 adds r1, r5, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] movs r1, 0x80 orrs r1, r2 @@ -9568,7 +9568,7 @@ _0804F864: mov r10, r0 adds r0, r5, 0 mov r1, r10 - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 ldr r1, [sp] @@ -9576,12 +9576,12 @@ _0804F864: mov r9, r1 mov r0, r9 mov r1, r10 - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 ldr r0, [sp] mov r1, r10 - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 ldr r2, [sp] @@ -9589,118 +9589,118 @@ _0804F864: mov r8, r2 mov r0, r8 mov r1, r10 - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 ldr r6, [sp, 0x4] subs r6, 0x1 adds r0, r5, 0 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 adds r0, r5, 0 ldr r1, [sp, 0x4] - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 ldr r4, [sp, 0x4] adds r4, 0x1 adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 mov r0, r9 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 ldr r0, [sp] adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 mov r0, r8 mov r1, r10 - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 mov r0, r8 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 mov r0, r8 ldr r1, [sp, 0x4] - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 mov r0, r8 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0x4 bl sub_804F5C4 mov r0, r9 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0, 0x4] movs r1, 0x4 orrs r1, r2 strh r1, [r0, 0x4] mov r0, r9 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0, 0x4] movs r2, 0x40 orrs r1, r2 strh r1, [r0, 0x4] ldr r0, [sp] adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0, 0x4] movs r4, 0x2 orrs r1, r4 strh r1, [r0, 0x4] mov r0, r9 ldr r1, [sp, 0x4] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0, 0x4] orrs r1, r4 strh r1, [r0, 0x4] ldr r0, [sp] ldr r1, [sp, 0x4] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0, 0x4] orrs r1, r4 strh r1, [r0, 0x4] mov r0, r9 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0, 0x4] movs r4, 0x10 orrs r1, r4 strh r1, [r0, 0x4] ldr r0, [sp] adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0, 0x4] orrs r1, r4 strh r1, [r0, 0x4] mov r0, r9 ldr r1, [sp, 0x4] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0, 0x4] orrs r1, r4 strh r1, [r0, 0x4] ldr r0, [sp] ldr r1, [sp, 0x4] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0, 0x4] orrs r4, r1 strh r4, [r0, 0x4] @@ -9789,7 +9789,7 @@ _0804FA6C: _0804FA76: adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0 bl sub_804F5C4 adds r4, 0x1 @@ -9861,7 +9861,7 @@ _0804FAD4: movs r4, 0x2 ldrsh r1, [r7, r4] adds r1, r2 - bl GetTileSafe + bl GetTileMut movs r1, 0 bl sub_804F5C4 _0804FB14: @@ -9917,28 +9917,28 @@ _0804FB54: ble _0804FBAE adds r0, r5, 0x1 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0 bl sub_804F5C4 adds r1, r4, 0x1 adds r0, r5, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0 bl sub_804F5C4 subs r0, r5, 0x1 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0 bl sub_804F5C4 subs r1, r4, 0x1 adds r0, r5, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0 bl sub_804F5C4 _0804FBAE: adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0 bl sub_804F5C4 b _0804FBD2 diff --git a/asm/code_804FD30.s b/asm/code_804FD30.s index 19dec61b2..0ef076dfb 100644 --- a/asm/code_804FD30.s +++ b/asm/code_804FD30.s @@ -106,7 +106,7 @@ _0804FFAA: adds r4, r1, r0 ldrb r0, [r4] ldrb r1, [r4, 0x1] - bl GetTileSafe + bl GetTileMut adds r5, r0, 0 ldrh r1, [r5, 0x4] movs r0, 0x1 @@ -137,7 +137,7 @@ _08050002: _08050004: adds r0, r6, 0 adds r1, r5, 0 - bl GetTileSafe + bl GetTileMut adds r1, r0, 0 ldrh r2, [r1] movs r0, 0x3 @@ -245,7 +245,7 @@ _080500BC: _080500D8: ldrb r0, [r4] ldrb r1, [r4, 0x1] - bl GetTileSafe + bl GetTileMut ldrh r2, [r0, 0x4] movs r1, 0x2 orrs r1, r2 @@ -320,7 +320,7 @@ _08050128: _0805016C: ldrb r0, [r4] ldrb r1, [r4, 0x1] - bl GetTileSafe + bl GetTileMut ldrh r2, [r0, 0x4] movs r1, 0x2 orrs r1, r2 @@ -432,7 +432,7 @@ _0805024C: .4byte 0x00003a0c _08050250: .4byte gUnknown_80F4DA0 _08050254: ldrb r1, [r7, 0x1] - bl GetTileSafe + bl GetTileMut adds r4, r0, 0 movs r0, 0x2 bl DungeonRandInt @@ -549,7 +549,7 @@ _08050318: _08050334: ldrb r0, [r4] ldrb r1, [r4, 0x1] - bl GetTileSafe + bl GetTileMut ldrh r2, [r0, 0x4] movs r1, 0x4 orrs r1, r2 @@ -814,7 +814,7 @@ _0805051C: _0805053C: ldrb r0, [r4] ldrb r1, [r4, 0x1] - bl GetTileSafe + bl GetTileMut ldrh r2, [r0, 0x4] movs r1, 0x8 orrs r1, r2 @@ -969,7 +969,7 @@ _0805064E: _0805066A: ldrb r0, [r4] ldrb r1, [r4, 0x1] - bl GetTileSafe + bl GetTileMut ldrh r2, [r0, 0x4] movs r1, 0x8 orrs r1, r2 @@ -1137,7 +1137,7 @@ _080507A8: bne _080507B8 mov r0, r9 mov r1, r10 - bl GetTileSafe + bl GetTileMut bl sub_80506BC _080507B8: ldr r2, [sp, 0x68] @@ -1278,7 +1278,7 @@ _080508CC: cmp r1, 0 bne _080508DA adds r1, r5, 0 - bl GetTileSafe + bl GetTileMut bl sub_80506BC _080508DA: ldr r1, [sp, 0x7C] @@ -1446,7 +1446,7 @@ _08050A0A: bne _08050A1A ldr r0, [sp, 0x90] ldr r1, [sp, 0x94] - bl GetTileSafe + bl GetTileMut bl sub_80506BC _08050A1A: adds r5, 0x1 @@ -1650,7 +1650,7 @@ _08050B7C: subs r0, r7, 0x5 adds r1, r6, 0 str r2, [sp, 0x9C] - bl GetTileSafe + bl GetTileMut bl sub_80506BC ldr r2, [sp, 0x9C] _08050B92: @@ -1683,7 +1683,7 @@ _08050BB8: _08050BC0: mov r0, r9 mov r1, r10 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrh r3, [r2] movs r0, 0x3 @@ -1777,7 +1777,7 @@ _08050C5C: _08050C68: adds r0, r7, 0 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrh r0, [r2] movs r3, 0x3 @@ -2135,7 +2135,7 @@ _08050F00: _08050F08: adds r0, r7, 0 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrb r1, [r4] movs r0, 0x87 @@ -2374,7 +2374,7 @@ _080510D6: adds r0, r5, 0 adds r1, r4, 0 str r3, [sp, 0x38] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] mov r2, r9 ands r1, r2 @@ -2383,7 +2383,7 @@ _080510D6: strh r1, [r0] adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut mov r1, sp ldrb r1, [r1, 0x10] strb r1, [r0, 0x9] @@ -2469,7 +2469,7 @@ _08051162: strh r0, [r6, 0x6] adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r3, _080511EC adds r2, r3, 0 @@ -2479,7 +2479,7 @@ _08051162: strh r1, [r0] adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0xFF strb r1, [r0, 0x9] ldr r4, [sp, 0x14] @@ -2663,7 +2663,7 @@ _080512EE: lsrs r4, 24 adds r0, r5, 0 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut movs r1, 0x1 str r1, [sp] adds r1, r4, 0 @@ -2711,7 +2711,7 @@ _08051338: _08051350: adds r0, r5, 0 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrh r1, [r2] movs r0, 0x10 @@ -2760,7 +2760,7 @@ _080513B8: _080513BC: adds r0, r5, 0 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] movs r1, 0x10 orrs r1, r2 @@ -2788,7 +2788,7 @@ _080513EC: _080513F0: adds r0, r5, 0 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrh r1, [r2] movs r0, 0x3 @@ -2923,7 +2923,7 @@ _080514EE: lsrs r5, 24 adds r0, r7, 0 mov r1, r8 - bl GetTileSafe + bl GetTileMut adds r6, r0, 0 ldr r1, [sp, 0x4] ldr r2, _080515D0 @@ -3047,7 +3047,7 @@ _080515F6: lsrs r4, 24 adds r0, r7, 0 mov r1, r8 - bl GetTileSafe + bl GetTileMut adds r5, r0, 0 ldrb r6, [r5, 0x9] movs r0, 0x1 @@ -3154,7 +3154,7 @@ _080516CA: ldr r0, [r5] adds r1, r4, 0 str r2, [sp, 0xC] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r2, [sp, 0xC] ands r1, r2 @@ -3187,7 +3187,7 @@ _0805170A: ldr r0, [r5, 0x8] adds r1, r4, 0 str r2, [sp, 0xC] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r2, [sp, 0xC] ands r1, r2 @@ -3233,7 +3233,7 @@ _08051762: ldr r1, [r5, 0x4] adds r0, r4, 0 str r2, [sp, 0xC] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r2, [sp, 0xC] ands r1, r2 @@ -3266,7 +3266,7 @@ _080517A2: ldr r1, [r5, 0xC] adds r0, r4, 0 str r2, [sp, 0xC] - bl GetTileSafe + bl GetTileMut ldrh r1, [r0] ldr r2, [sp, 0xC] ands r1, r2 @@ -3306,7 +3306,7 @@ _080517EC: adds r0, r7, 0 adds r1, r5, 0 str r3, [sp, 0x10] - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrh r1, [r2] movs r0, 0x20 @@ -3370,7 +3370,7 @@ _08051864: adds r0, r7, 0 adds r1, r5, 0 str r3, [sp, 0x10] - bl GetTileSafe + bl GetTileMut adds r6, r0, 0 ldrh r1, [r6] movs r0, 0x20 @@ -3446,7 +3446,7 @@ sub_80518F0: _080518F8: adds r0, r5, 0 movs r1, 0x1 - bl GetTileSafe + bl GetTileMut adds r4, r0, 0 bl sub_804FD10 cmp r5, 0 @@ -3460,7 +3460,7 @@ _0805190E: _08051914: adds r0, r5, 0 movs r1, 0x1E - bl GetTileSafe + bl GetTileMut adds r4, r0, 0 bl sub_804FD10 cmp r5, 0 @@ -3614,7 +3614,7 @@ sub_8051A24: mov r8, r3 adds r0, r4, 0 adds r1, r5, 0 - bl GetTileSafe + bl GetTileMut adds r7, r0, 0 lsls r4, 16 lsls r5, 16 @@ -4067,7 +4067,7 @@ _08051E42: _08051E46: adds r0, r4, 0 adds r1, r5, 0 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrb r0, [r2, 0xE] cmp r0, 0xF @@ -4107,7 +4107,7 @@ sub_8051E7C: movs r3, 0x6 ldrsh r1, [r2, r3] subs r1, 0x1 - bl GetTileSafe + bl GetTileMut str r0, [sp, 0x8] ldrh r1, [r0] movs r0, 0x80 @@ -4207,7 +4207,7 @@ _08051F10: bge _08051FCA adds r0, r5, 0 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut adds r4, r0, 0 ldrh r0, [r4] movs r3, 0x80 diff --git a/asm/code_805D8C8_1.s b/asm/code_805D8C8_1.s index f06cb8e2d..f2259e3f7 100644 --- a/asm/code_805D8C8_1.s +++ b/asm/code_805D8C8_1.s @@ -1489,7 +1489,7 @@ sub_80694C0: mov r9, r3 adds r0, r7, 0 mov r1, r8 - bl GetTileSafe + bl GetTileMut mov r10, r0 ldr r5, [r4, 0x70] adds r6, r5, 0 @@ -1536,7 +1536,7 @@ _08069522: blt _08069552 adds r1, r0, 0 adds r0, r2, 0 - bl GetTileSafe + bl GetTileMut adds r1, r0, 0 ldr r0, [r1, 0x10] cmp r0, r4 diff --git a/asm/code_8069E0C.s b/asm/code_8069E0C.s index 97672b2e2..7e590a7a2 100644 --- a/asm/code_8069E0C.s +++ b/asm/code_8069E0C.s @@ -102,7 +102,7 @@ _0806A488: movs r2, 0x6 ldrsh r1, [r6, r2] adds r1, r7 - bl GetTileSafe + bl GetTileMut adds r4, r0, 0 ldr r0, [r4, 0x10] cmp r0, 0 diff --git a/asm/code_8077274_1.s b/asm/code_8077274_1.s index 01c3324eb..65cdb1b1b 100644 --- a/asm/code_8077274_1.s +++ b/asm/code_8077274_1.s @@ -86,7 +86,7 @@ _0807ABC6: adds r0, r4, 0 adds r1, r6, 0 str r2, [sp, 0x1A4] - bl GetTileSafe + bl GetTileMut adds r1, r0, 0 ldr r0, [r1, 0x10] ldr r2, [sp, 0x1A4] @@ -176,7 +176,7 @@ _0807AC72: adds r0, r4, 0 adds r1, r6, 0 str r2, [sp, 0x1A4] - bl GetTileSafe + bl GetTileMut adds r1, r0, 0 ldr r0, [r1, 0x10] ldr r2, [sp, 0x1A4] diff --git a/asm/code_807CD9C.s b/asm/code_807CD9C.s index 358e4db4c..604aa7cea 100644 --- a/asm/code_807CD9C.s +++ b/asm/code_807CD9C.s @@ -831,7 +831,7 @@ _0807DBB6: _0807DBB8: adds r0, r4, 0 adds r1, r5, 0 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrh r1, [r2] movs r0, 0x3 @@ -971,7 +971,7 @@ _0807DCD8: movs r6, 0 adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrh r1, [r2] ldr r3, _0807DD6C @@ -1094,7 +1094,7 @@ _0807DDC8: _0807DDCA: adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut adds r2, r0, 0 ldrh r1, [r2] movs r3, 0x80 @@ -1141,7 +1141,7 @@ _0807DE1A: beq _0807DE30 adds r0, r5, 0 adds r1, r4, 0 - bl GetTileSafe + bl GetTileMut ldrh r2, [r0] movs r1, 0x40 orrs r1, r2 @@ -1402,7 +1402,7 @@ _0807E014: bgt _0807E112 cmp r1, 0x1F bgt _0807E112 - bl GetTileSafe + bl GetTileMut mov r8, r0 ldr r0, [sp, 0x18] movs r2, 0 diff --git a/asm/code_807E5AC.s b/asm/code_807E5AC.s index 9ecbe863e..eaf80cb03 100644 --- a/asm/code_807E5AC.s +++ b/asm/code_807E5AC.s @@ -2468,7 +2468,7 @@ _0807FA1E: _0807FA22: adds r0, r5, 0 adds r1, r6, 0 - bl GetTileSafe + bl GetTileMut adds r4, r0, 0 ldrh r1, [r4, 0x4] movs r0, 0x4 diff --git a/include/dungeon_map_access.h b/include/dungeon_map_access.h index adee8dc5b..5defb8029 100644 --- a/include/dungeon_map_access.h +++ b/include/dungeon_map_access.h @@ -8,8 +8,8 @@ typedef struct unkStruct_202F190 Tile *unk0[6]; } unkStruct_202F190; -Tile *GetTile(s32 x, s32 y); -Tile *GetTileSafe(s32 x, s32 y); +const Tile *GetTile(s32 x, s32 y); +Tile *GetTileMut(s32 x, s32 y); void sub_8049ED4(void); void sub_804AC20(DungeonPos *pos); diff --git a/include/dungeon_movement.h b/include/dungeon_movement.h index 1549f1aa6..3d3973d23 100644 --- a/include/dungeon_movement.h +++ b/include/dungeon_movement.h @@ -7,7 +7,7 @@ extern u8 gWalkableTileToCrossableTerrain[8]; u8 GetCrossableTerrain(s16 species); -u8 sub_807034C(s16 id, struct Tile *tile); +u8 sub_807034C(s16 id, const Tile *tile); u8 sub_80703A0(Entity *pokemon, DungeonPos *pos); bool8 CanCrossWalls(Entity *pokemon); bool8 sub_807049C(Entity *pokemon, DungeonPos *pos); diff --git a/include/dungeon_util.h b/include/dungeon_util.h index 5ecd4b111..845a2ec51 100644 --- a/include/dungeon_util.h +++ b/include/dungeon_util.h @@ -5,13 +5,14 @@ #include "structs/dungeon_entity.h" #include "structs/str_position.h" #include "structs/str_traps.h" +#include "structs/map.h" extern const DungeonPos gAdjacentTileOffsets[NUM_DIRECTIONS]; bool8 EntityExists(Entity *pokemon); u32 GetEntityType(Entity *entity); u8 GetEntityRoom(Entity *entity); -struct Tile *GetTileAtEntitySafe(Entity *entity); +Tile *GetTileAtEntitySafe(Entity *entity); void sub_804535C(Entity *entity, PixelPos *pos); void SetEntityPixelPos(Entity *entity, s32 x, s32 y); void IncreaseEntityPixelPos(Entity *entity, s32 x, s32 y); diff --git a/src/code_803E724.c b/src/code_803E724.c index 475f05814..42be68d70 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -1081,7 +1081,7 @@ void sub_803F580(u8 a0) void sub_803F7BC(void) { UnkDungeonGlobal_unk181E8_sub *strPtr = &gDungeon->unk181e8; - Tile *tile = GetTile(strPtr->cameraPos.x, strPtr->cameraPos.y); + const Tile *tile = GetTile(strPtr->cameraPos.x, strPtr->cameraPos.y); u32 roomId = tile->room; if (strPtr->unk1820B != 0 || strPtr->unk1820C != 0 || strPtr->unk18217 != 0) { diff --git a/src/code_8040094.c b/src/code_8040094.c index 91c14d244..4386cd74c 100644 --- a/src/code_8040094.c +++ b/src/code_8040094.c @@ -26,7 +26,7 @@ extern const char *gUnknown_80FD040; // It became brighter on the floor // Luminous Orb??? void HandleLuminousOrbAction(Entity *pokemon) { - struct Tile *mapTile; + Tile *mapTile; int XCoord; int YCoord; @@ -36,7 +36,7 @@ void HandleLuminousOrbAction(Entity *pokemon) { for(XCoord = 0; XCoord < DUNGEON_MAX_SIZE_X; XCoord++) { - mapTile = GetTileSafe(XCoord, YCoord); + mapTile = GetTileMut(XCoord, YCoord); mapTile->unk4 = mapTile->unk4 | 1; } } diff --git a/src/code_8042B34.c b/src/code_8042B34.c index 234c0267a..89bbcd7c5 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -1055,7 +1055,7 @@ void sub_8043D60(void) for (y = 0; y < 32; y++) { for (x = 0; x < 56; x++) { - Entity *object = GetTileSafe(x, y)->object; + Entity *object = GetTileMut(x, y)->object; if (EntityExists(object) && GetEntityType(object) == ENTITY_TRAP) { Trap *trapData = GetTrapData(object); if (trapData->id == 27) { diff --git a/src/code_8044CC8.c b/src/code_8044CC8.c index 8d9ead4b3..826c67265 100644 --- a/src/code_8044CC8.c +++ b/src/code_8044CC8.c @@ -41,7 +41,7 @@ bool8 sub_80461C8(DungeonPos *, u32); Item * sub_8044CC8(Entity *param_1, unkStruct_8044CC8 *param_2) { - Tile *tile; + const Tile *tile; Item *item; EntityInfo *info; @@ -282,4 +282,4 @@ void sub_8045064(void) } } } -} \ No newline at end of file +} diff --git a/src/code_80450F8.c b/src/code_80450F8.c index 526a34b5a..38f2308b9 100644 --- a/src/code_80450F8.c +++ b/src/code_80450F8.c @@ -554,7 +554,7 @@ Entity *sub_8045708(DungeonPos *pos) Entity *ent; if (gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA - && (GetTileSafe(pos->x, pos->y)->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == TERRAIN_TYPE_SECONDARY) { + && (GetTileMut(pos->x, pos->y)->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == TERRAIN_TYPE_SECONDARY) { return NULL; } diff --git a/src/code_8045A00.c b/src/code_8045A00.c index fd8662e4b..28f217f54 100644 --- a/src/code_8045A00.c +++ b/src/code_8045A00.c @@ -131,7 +131,7 @@ void sub_8045CB0(void) u32 x; int y; int yCounter; - struct Tile *tile; + const Tile *tile; u32 uVar5; int xCounter; Item item; diff --git a/src/code_804AFAC.c b/src/code_804AFAC.c index 5f2549bc0..f46979a1e 100644 --- a/src/code_804AFAC.c +++ b/src/code_804AFAC.c @@ -13,7 +13,7 @@ void sub_804FBE8(void) { for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { - tile = GetTileSafe(x,y); + tile = GetTileMut(x,y); if ((tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != TERRAIN_TYPE_NORMAL) { if ((tile->terrainType & (TERRAIN_TYPE_UNK_8 | TERRAIN_TYPE_IMPASSABLE_WALL)) != 0) { tile->unk4 &= 0xfffd; @@ -42,7 +42,7 @@ void sub_804FC74(void) for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { if ((GetTile(x, y)->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == TERRAIN_TYPE_SECONDARY) { - tile = GetTileSafe(x,y); + tile = GetTileMut(x,y); tile->terrainType &= ~(TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); tile->terrainType |= (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); } @@ -61,7 +61,7 @@ void sub_804FCCC(void) for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { if ((GetTile(x, y)->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) != 0) { - tile = GetTileSafe(x,y); + tile = GetTileMut(x,y); tile->terrainType &= ~(TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); } } @@ -100,7 +100,7 @@ void sub_804FD30(void) { for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { - sub_804FD10(GetTileSafe(x,y)); + sub_804FD10(GetTileMut(x,y)); if ((boundsCheck(x, y - 1)) || (boundsCheck(x + 1, y - 1)) || @@ -111,7 +111,7 @@ void sub_804FD30(void) (boundsCheck(x - 1, y)) || (boundsCheck(x - 1, y - 1))) { - GetTileSafe(x,y)->terrainType |= TERRAIN_TYPE_IMPASSABLE_WALL; + GetTileMut(x,y)->terrainType |= TERRAIN_TYPE_IMPASSABLE_WALL; } } } diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index 6e13f4d04..e8cfceb52 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -1347,7 +1347,7 @@ NAKED static void TryCreateModeArrows(Entity *leader) void sub_805E738(Entity *a0) { - Tile *tile; + const Tile *tile; s32 i, j; EntityInfo *entityInfo = GetEntInfo(a0); if (entityInfo->blinkerClassStatus.status != 1 && entityInfo->blinkerClassStatus.status != 2) { @@ -1401,7 +1401,7 @@ bool8 sub_805E874(void) s32 direction = GetEntInfo(leader)->action.direction; s32 x = leader->pos.x; s32 y = leader->pos.y; - Tile *leaderTile = GetTile(x, y); + const Tile *leaderTile = GetTile(x, y); s32 xAdjacent = x + gAdjacentTileOffsets[direction].x; s32 yAdjacent = y + gAdjacentTileOffsets[direction].y; s32 room; @@ -1426,7 +1426,7 @@ bool8 sub_805E874(void) } for (j = -1; j < 2; j++) { - Tile *tile = GetTile(x + gAdjacentTileOffsets[(direction + j) & 7].x, y + gAdjacentTileOffsets[(direction + j) & 7].y); + const Tile *tile = GetTile(x + gAdjacentTileOffsets[(direction + j) & 7].x, y + gAdjacentTileOffsets[(direction + j) & 7].y); if (tile->monster != NULL) return FALSE; if (tile->terrainType & TERRAIN_TYPE_STAIRS) @@ -1443,7 +1443,7 @@ bool8 sub_805E874(void) for (i = -1; i < 2; i++) { for (j = -1; j < 2; j++) { - Tile *tile = GetTile(x + i, y + j); + const Tile *tile = GetTile(x + i, y + j); if (tile->object != NULL) { for (k = 0; k < 3; k++) { if (x + i == xArray[k] && y + j == yArray[k]) @@ -1528,7 +1528,7 @@ bool8 sub_805EC2C(Entity *a0, s32 x, s32 y) bool8 sub_805EC4C(Entity *a0, u8 a1) { DungeonPos pos; - Tile *tile; + const Tile *tile; EntityInfo *tileMonsterInfo; Entity *tileMonster; EntityInfo *entityInfo = GetEntInfo(a0); @@ -2054,7 +2054,7 @@ void ShowFieldMenu(u8 a0_, bool8 a1) } else if (var_28 == 4) { Entity *leader = GetLeader(); - Tile *tile = GetTile(leader->pos.x, leader->pos.y); + const Tile *tile = GetTile(leader->pos.x, leader->pos.y); Entity *tileObject = tile->object; if (tileObject != NULL) { if (GetEntityType(tileObject) == ENTITY_ITEM) { @@ -2757,7 +2757,7 @@ static void CreateFieldItemMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, UnkTextS } break; case 2: { - Tile *tile = GetTile(a1->pos.x, a1->pos.y); + const Tile *tile = GetTile(a1->pos.x, a1->pos.y); Item *item = GetItemData(tile->object); PrintFormattedStringOnWindow(x, 0, gFieldItemMenuGroundTextPtr, 0, 0); if (item->flags & ITEM_FLAG_EXISTS) { diff --git a/src/code_8066D04.c b/src/code_8066D04.c index 5beb3e648..80adc5407 100644 --- a/src/code_8066D04.c +++ b/src/code_8066D04.c @@ -282,7 +282,7 @@ void HandleUseItemAction(Entity *param_1) void HandlePlaceItemAction(Entity *param_1) { Item *item; - Tile *tile; + const Tile *tile; EntityInfo *info; #ifndef NONMATCHING register Entity *entity asm("r4"); diff --git a/src/code_806CD90.c b/src/code_806CD90.c index e16c9d267..4bfc23693 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -237,7 +237,7 @@ void sub_806CF60(void) u32 sub_806CF98(Entity *entity) { - struct Tile *mapTile; + const Tile *mapTile; u32 shadowSize; u16 terrainType; EntityInfo *entityInfo; diff --git a/src/code_80718D8.c b/src/code_80718D8.c index aed02349e..0b5b4c9f8 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -70,7 +70,7 @@ void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level); // TODO: change to void sub_8071B48(void) { - struct Tile *tile; + const Tile *tile; struct Entity *entity2; struct Entity *entity; int index; diff --git a/src/code_8072B78.c b/src/code_8072B78.c index 7a96283c3..cee32ad69 100644 --- a/src/code_8072B78.c +++ b/src/code_8072B78.c @@ -100,7 +100,7 @@ static inline void fu(EntityInfo *entityInfo, s16 id) void sub_8072B78(Entity *pokemon, Entity *target, s16 id) { OpenedFile *file; - Tile *tile; + const Tile *tile; int index; s32 id_s32; EntityInfo *entityInfo; diff --git a/src/code_8075708.c b/src/code_8075708.c index c89b02c49..5eeefe47b 100644 --- a/src/code_8075708.c +++ b/src/code_8075708.c @@ -56,7 +56,7 @@ void sub_8075708(Entity *entity) { bool8 bVar1; bool8 bVar2; - Tile *tile; + const Tile *tile; Trap *trapData; Entity *trap; EntityInfo *info; @@ -121,7 +121,7 @@ void sub_8075708(Entity *entity) u32 sub_8075818(Entity *entity) { - struct Tile *tile; + const Tile *tile; EntityInfo *entityInfo; Entity *subEntity; Item *item; diff --git a/src/code_807CD9C.c b/src/code_807CD9C.c index 68b97d534..81986f847 100644 --- a/src/code_807CD9C.c +++ b/src/code_807CD9C.c @@ -53,7 +53,7 @@ u8 sub_8083660(DungeonPos *); void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction) { - Tile *tile; + const Tile *tile; int iVar8; bool8 flag; DungeonPos sp_0x18; @@ -370,7 +370,7 @@ void sub_807D3CC(Entity *param_1) bool8 ExposeTrap(s32 x,s32 y) { - Tile *tile; + const Tile *tile; Entity *trap; tile = GetTile(x,y); diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c index 1d22cc2ba..2ed23d4f9 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -399,7 +399,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move { // Double assignment to fix a regswap. s16 rangeTargetingFlags = rangeTargetingFlags2 = targetingFlags & 0xF0; - struct Tile *adjacentTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[i].x, + const Tile *adjacentTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[i].x, pokemon->pos.y + gAdjacentTileOffsets[i].y); Entity *adjacentPokemon = adjacentTile->monster; if (adjacentPokemon != NULL && GetEntityType(adjacentPokemon) == ENTITY_MONSTER) @@ -433,7 +433,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move { for (i = 0; i < NUM_DIRECTIONS; i++) { - struct Tile *targetTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[i].x, + const Tile *targetTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[i].x, pokemon->pos.y + gAdjacentTileOffsets[i].y); if (CanAttackInDirection(pokemon, i)) { @@ -917,7 +917,7 @@ bool8 IsTargetInRange(Entity *pokemon, Entity *targetPokemon, s32 direction, s32 s32 i; for (i = 0; i <= effectiveMaxRange; i++) { - struct Tile *mapTile; + const Tile *mapTile; currentPosX += adjacentTileOffsetX; currentPosY += adjacentTileOffsetY; if (currentPosX <= 0 || currentPosY <= 0 || diff --git a/src/dungeon_ai_item_weight.c b/src/dungeon_ai_item_weight.c index 5ee42ce9f..c6b036c7b 100644 --- a/src/dungeon_ai_item_weight.c +++ b/src/dungeon_ai_item_weight.c @@ -448,7 +448,7 @@ bool8 IsAdjacentToEnemy(Entity *pokemon) s32 direction; for (direction = 0; direction < NUM_DIRECTIONS; direction++) { - struct Tile *mapTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y); + const Tile *mapTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y); Entity *adjacentPokemon = mapTile->monster; if (adjacentPokemon != NULL && GetEntityType(adjacentPokemon) != ENTITY_NOTHING && GetTreatmentBetweenMonsters(pokemon, adjacentPokemon, FALSE, TRUE) == TREATMENT_TREAT_AS_ENEMY) diff --git a/src/dungeon_ai_items.c b/src/dungeon_ai_items.c index 09a5934f7..6f1685096 100644 --- a/src/dungeon_ai_items.c +++ b/src/dungeon_ai_items.c @@ -156,7 +156,7 @@ void AIDecideUseItem(Entity *pokemon) else if (toolboxIndex == 0) { // This seems unused. toolboxIndex can never be 0. - struct Tile *mapTile = GetTile(pokemon->pos.x, pokemon->pos.y); + const Tile *mapTile = GetTile(pokemon->pos.x, pokemon->pos.y); Entity *object = mapTile->object; if (object != null) { diff --git a/src/dungeon_ai_movement.c b/src/dungeon_ai_movement.c index e6e435246..64f095c17 100644 --- a/src/dungeon_ai_movement.c +++ b/src/dungeon_ai_movement.c @@ -104,7 +104,7 @@ void AIMovement(Entity *pokemon, bool8 showRunAwayEffect) bool8 CanTakeItem(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - struct Tile *mapTile; + const Tile *mapTile; Entity *object; if (!EntityExists(pokemon) || CheckVariousConditions(pokemon)) { @@ -310,7 +310,7 @@ bool8 ChooseTargetPosition(Entity *pokemon) { for (x = minX; x <= maxX; x++) { - Entity *object = GetTileSafe(x, y)->object; + Entity *object = GetTileMut(x, y)->object; if (object && GetEntityType(object) == ENTITY_ITEM) { pokemonInfo->aiTarget.aiObjective = AI_TAKE_ITEM; @@ -553,7 +553,7 @@ bool8 AvoidEnemies(Entity *pokemon) { if (room == closestTargetRoom && room != CORRIDOR_ROOM) { - struct Tile *tile = GetTile(pokemon->pos.x, pokemon->pos.y); + const Tile *tile = GetTile(pokemon->pos.x, pokemon->pos.y); if (tile->terrainType & TERRAIN_TYPE_NATURAL_JUNCTION) { DungeonPos aiTargetPos; @@ -563,7 +563,7 @@ bool8 AvoidEnemies(Entity *pokemon) // Scan for a direction leading outside the room. for (targetDir = 0; targetDir < NUM_DIRECTIONS; targetDir++) { - struct Tile *adjacentTile; + const Tile *adjacentTile; aiTargetPos.x = pokemon->pos.x + gAdjacentTileOffsets[targetDir].x; aiTargetPos.y = pokemon->pos.y + gAdjacentTileOffsets[targetDir].y; adjacentTile = GetTile(aiTargetPos.x, aiTargetPos.y); diff --git a/src/dungeon_ai_targeting.c b/src/dungeon_ai_targeting.c index 1088795b3..760dda6e9 100644 --- a/src/dungeon_ai_targeting.c +++ b/src/dungeon_ai_targeting.c @@ -65,7 +65,7 @@ const u8 gTreatmentData[3][2][2][2] = { bool8 sub_8070F3C(Entity * pokemon, DungeonPos *pos, s32 direction) { u8 terrain; - struct Tile *tile; + const Tile *tile; terrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); @@ -109,7 +109,7 @@ bool8 sub_8070F3C(Entity * pokemon, DungeonPos *pos, s32 direction) bool8 sub_8070F14(Entity * pokemon, s32 direction) { - struct Tile *tile; + const Tile *tile; tile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y); @@ -128,7 +128,7 @@ bool8 sub_8070F14(Entity * pokemon, s32 direction) bool8 sub_8070F80(Entity * pokemon, s32 direction) { u8 terrain; - struct Tile *tile; + const Tile *tile; terrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); @@ -173,7 +173,7 @@ bool8 sub_8070F80(Entity * pokemon, s32 direction) bool8 sub_8071058(Entity * pokemon, s32 direction) { u8 terrain; - struct Tile *tile; + const Tile *tile; terrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); @@ -218,7 +218,7 @@ bool8 sub_8071058(Entity * pokemon, s32 direction) bool8 CanAttackInDirection(Entity *pokemon, s32 direction) { u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); - struct Tile *tile; + const Tile *tile; if (crossableTerrain < CROSSABLE_TERRAIN_CREVICE) { crossableTerrain = CROSSABLE_TERRAIN_CREVICE; @@ -265,7 +265,8 @@ bool8 CanAttackInDirection(Entity *pokemon, s32 direction) bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemonInFront) { u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); - struct Tile *frontTile, *currentTile; + const Tile *currentTile; + const Tile *frontTile; *pokemonInFront = FALSE; frontTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y); @@ -365,7 +366,7 @@ bool8 IsAtJunction(Entity *pokemon) } else { - struct Tile *mapTile; + const Tile *mapTile; char walkableNeighborFlags; if (gDungeonWaterType[gDungeon->tileset] == DUNGEON_WATER_TYPE_LAVA && crossableTerrain == CROSSABLE_TERRAIN_LIQUID diff --git a/src/dungeon_capabilities.c b/src/dungeon_capabilities.c index 94985585a..4c9dcc716 100644 --- a/src/dungeon_capabilities.c +++ b/src/dungeon_capabilities.c @@ -132,7 +132,7 @@ bool8 CannotAttack(Entity *pokemon, bool8 skipSleep) bool8 CanMoveInDirection(Entity *pokemon, u32 direction) { u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); - struct Tile *currentMapTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, + const Tile *currentMapTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x, pokemon->pos.y + gAdjacentTileOffsets[direction].y); if (currentMapTile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL || currentMapTile->monster != NULL) diff --git a/src/dungeon_cutscenes.c b/src/dungeon_cutscenes.c index 0a08d442f..597bf11f6 100644 --- a/src/dungeon_cutscenes.c +++ b/src/dungeon_cutscenes.c @@ -3828,7 +3828,7 @@ void sub_808B1CC(u8 itemID) pos.y = entity->pos.y; } sub_807FE04(&pos, 0); - tile = GetTileSafe(pos.x, pos.y); + tile = GetTileMut(pos.x, pos.y); tile->terrainType = tile->terrainType | TERRAIN_TYPE_STAIRS; if (((itemID != ITEM_NOTHING) && (sub_80860A8(itemID) == 0)) && (sub_80860A8(ITEM_MUSIC_BOX) == 0)) { @@ -4060,7 +4060,7 @@ void JirachiWish(void) } pos1.x = (jirachiEntity->pos.x + DungeonRandInt(3) - 1); pos1.y = (jirachiEntity->pos.y + DungeonRandInt(3) + -1); - if ((GetTileSafe(pos1.x, pos1.y)->terrainType & 3) != 0) { + if ((GetTileMut(pos1.x, pos1.y)->terrainType & 3) != 0) { PlaySoundEffect(0x14c); sub_808BB3C(&pos1); sub_8046860(jirachiEntity,&pos1,auStack152,9); @@ -4086,7 +4086,7 @@ void JirachiWish(void) pos2.x = (jirachiEntity->pos.x + DungeonRandInt(3) - 1); pos2.y = (jirachiEntity->pos.y + DungeonRandInt(3) + -1); - if ((GetTileSafe(pos2.x, pos2.y)->terrainType & 3) != 0) { + if ((GetTileMut(pos2.x, pos2.y)->terrainType & 3) != 0) { PlaySoundEffect(400); sub_808BB3C(&pos2); sub_8046860(jirachiEntity,&pos2,itemStack,9); @@ -4140,7 +4140,7 @@ void JirachiWish(void) pos3.x = (jirachiEntity->pos.x + DungeonRandInt(3) - 1); pos3.y = (jirachiEntity->pos.y + DungeonRandInt(3) + -1); - if ((GetTileSafe(pos3.x, pos3.y)->terrainType & 3) != 0) { + if ((GetTileMut(pos3.x, pos3.y)->terrainType & 3) != 0) { PlaySoundEffect(400); sub_808BB3C(&pos3); sub_8046860(jirachiEntity,&pos3,strengthItems,4); @@ -4303,9 +4303,9 @@ void JirachiWishGrantDialogue(Entity *jirachiEntity) // Warp Tile is created but not enabled until the Wish is done with EnableJirachiWishWarpTile void CreateJirachiWishWarpTile(void) { - struct Tile *tile; + Tile *tile; - tile = GetTileSafe(gDungeon->unkE220[7].x, gDungeon->unkE220[7].y); + tile = GetTileMut(gDungeon->unkE220[7].x, gDungeon->unkE220[7].y); tile->terrainType &= ~(TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); tile->terrainType |= TERRAIN_TYPE_IMPASSABLE_WALL; tile->terrainType &= ~TERRAIN_TYPE_STAIRS; @@ -4317,9 +4317,9 @@ void CreateJirachiWishWarpTile(void) void EnableJirachiWishWarpTile(void) { - struct Tile *tile; + Tile *tile; - tile = GetTileSafe(gDungeon->unkE220[7].x, gDungeon->unkE220[7].y); + tile = GetTileMut(gDungeon->unkE220[7].x, gDungeon->unkE220[7].y); tile->terrainType &= ~(TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); tile->terrainType |= TERRAIN_TYPE_NORMAL; tile->terrainType &= ~TERRAIN_TYPE_IMPASSABLE_WALL; diff --git a/src/dungeon_map_access.c b/src/dungeon_map_access.c index 98561554d..37a903e8c 100644 --- a/src/dungeon_map_access.c +++ b/src/dungeon_map_access.c @@ -16,8 +16,8 @@ #include "game_options.h" #include "dungeon_visibility.h" -extern unkStruct_202F190 gUnknown_80F69D4; -extern unkStruct_202F190 gUnknown_80F69EC; +extern const unkStruct_202F190 gUnknown_80F69D4; +extern const unkStruct_202F190 gUnknown_80F69EC; extern u8 gUnknown_80F6A04[]; extern u8 gUnknown_80F6A10[]; extern u8 gUnknown_80F6A28[]; @@ -32,9 +32,9 @@ extern const s16 gUnknown_80F6C06[]; EWRAM_DATA OpenedFile *gDungeonPaletteFile = {0}; EWRAM_DATA unkStruct_202EE8C gUnknown_202EE8C[32] = {0}; EWRAM_DATA OpenedFile *gUnknown_202F18C = {0}; -EWRAM_DATA unkStruct_202F190 gUnknown_202F190 = {0}; +EWRAM_DATA unkStruct_202F190 gOutOfBoundsTileData = {0}; -EWRAM_DATA_2 unkStruct_202F190 *gUnknown_203B430 = {0}; +EWRAM_DATA_2 const unkStruct_202F190 *gUnknown_203B430 = {0}; extern u8 sub_8043CE4(u32); extern void sub_80402AC(s32, s32); @@ -42,7 +42,7 @@ extern int sprintf(char *, const char *, ...); void sub_8049BB0(s32, s32); void sub_80498A8(s32, s32); -Tile *GetTile(s32 x, s32 y) +const Tile *GetTile(s32 x, s32 y) { if (x >= 0 && y >= 0 && x < DUNGEON_MAX_SIZE_X && y < DUNGEON_MAX_SIZE_Y) { @@ -51,12 +51,12 @@ Tile *GetTile(s32 x, s32 y) return (Tile *) gUnknown_203B430->unk0; } -Tile *GetTileSafe(s32 x, s32 y) +Tile *GetTileMut(s32 x, s32 y) { if (x < 0 || y < 0 || x >= DUNGEON_MAX_SIZE_X || y >= DUNGEON_MAX_SIZE_Y) { - Tile *tile = (Tile *) gUnknown_202F190.unk0; - gUnknown_202F190 = *gUnknown_203B430; + Tile *tile = (Tile *) gOutOfBoundsTileData.unk0; + gOutOfBoundsTileData = *gUnknown_203B430; return tile; } return gDungeon->tilePointers[y][x]; @@ -190,10 +190,10 @@ void sub_80498A8(int x,int y) sp_0x20 = GetTile(x, y)->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); if (gDungeon->tileset >= 0x40) { if ((0x17 >= x) && (0x17 >= y)) { - GetTileSafe(x,y)->unk8 = gDungeon->unk12C24[y * 0x18 + x]; + GetTileMut(x,y)->unk8 = gDungeon->unk12C24[y * 0x18 + x]; } else { - GetTileSafe(x,y)->unk8 = 0; + GetTileMut(x,y)->unk8 = 0; } } else @@ -325,7 +325,7 @@ void sub_80498A8(int x,int y) if (IsBossFight()) { r4 = 0; } - GetTileSafe(x,y)->unk8 = gDungeon->unk12C24[r4 + r7 * 3]; + GetTileMut(x,y)->unk8 = gDungeon->unk12C24[r4 + r7 * 3]; } } @@ -436,17 +436,17 @@ void sub_8049BB0(s32 x, s32 y) if (y > 29) flags[CROSSABLE_TERRAIN_WALL] &= ~(0x80 | 0x1 | 0x2); - GetTileSafe(x, y)->walkableNeighborFlags[CROSSABLE_TERRAIN_REGULAR] = flags[CROSSABLE_TERRAIN_REGULAR]; - GetTileSafe(x, y)->walkableNeighborFlags[CROSSABLE_TERRAIN_LIQUID] = flags[CROSSABLE_TERRAIN_LIQUID]; - GetTileSafe(x, y)->walkableNeighborFlags[CROSSABLE_TERRAIN_CREVICE] = flags[CROSSABLE_TERRAIN_CREVICE]; - GetTileSafe(x, y)->walkableNeighborFlags[CROSSABLE_TERRAIN_WALL] = flags[CROSSABLE_TERRAIN_WALL]; + GetTileMut(x, y)->walkableNeighborFlags[CROSSABLE_TERRAIN_REGULAR] = flags[CROSSABLE_TERRAIN_REGULAR]; + GetTileMut(x, y)->walkableNeighborFlags[CROSSABLE_TERRAIN_LIQUID] = flags[CROSSABLE_TERRAIN_LIQUID]; + GetTileMut(x, y)->walkableNeighborFlags[CROSSABLE_TERRAIN_CREVICE] = flags[CROSSABLE_TERRAIN_CREVICE]; + GetTileMut(x, y)->walkableNeighborFlags[CROSSABLE_TERRAIN_WALL] = flags[CROSSABLE_TERRAIN_WALL]; } void sub_8049ED4(void) { bool32 hallucinating, unk1820F; u16 *src; - Tile *tile; + const Tile *tile; s32 r7; s32 i; s32 r10; @@ -562,7 +562,7 @@ void sub_8049ED4(void) void sub_804A1F0(s32 a0, s32 a1) { - Tile *tile; + const Tile *tile; u16 *src; bool32 hallucinating, unk1820F; s32 xTemp, yTemp; @@ -664,7 +664,7 @@ void sub_804A1F0(s32 a0, s32 a1) void sub_804A49C(s32 a0, s32 a1) { - Tile *tile; + const Tile *tile; u16 *src; bool32 hallucinating, unk1820F; s32 xTemp, yTemp; @@ -906,12 +906,12 @@ void sub_804AAAC(void) { s32 x; s32 y; - struct Tile *tile; + Tile *tile; for(y = 0; y < DUNGEON_MAX_SIZE_Y; y++) { for(x = 0; x < DUNGEON_MAX_SIZE_X; x++) { - tile = GetTileSafe(x,y); + tile = GetTileMut(x,y); tile->unk4 = 0; } } @@ -919,7 +919,7 @@ void sub_804AAAC(void) void sub_804AAD4(void) { - struct Tile *tile; + const Tile *tile; struct RoomData *room1; struct RoomData *room2; s32 roomIndex; @@ -986,8 +986,8 @@ void sub_804AAD4(void) void sub_804AC20(DungeonPos *pos) { s32 y; - struct Tile *tile2; - struct Tile *tile; + const Tile *tile2; + Tile *tile; s32 yMax; u32 visibilityRange; s32 xMin; @@ -1023,7 +1023,7 @@ void sub_804AC20(DungeonPos *pos) } for (y = yMin; y <= yMax; y++) { for (x = xMin; x <= xMax; x++) { - tile = GetTileSafe(x,y); + tile = GetTileMut(x,y); tile->unk4 = tile->unk4 | 3; sub_80402AC(x,y); } diff --git a/src/dungeon_move.c b/src/dungeon_move.c index d474afabd..6c0898b1a 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -2577,7 +2577,7 @@ void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 var_48 = gAdjacentTileOffsets[attackerInfo->action.direction].y; for (i = 0; i < a2; i++) { - Tile *tile; + const Tile *tile; if (var_68.x < 0 || var_68.y < 0 || var_68.x > 55 || var_68.y > 31) break; @@ -2622,7 +2622,7 @@ void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 for (i = 0; i < a2; i++) { DungeonPos var_68Before; - Tile *tile; + const Tile *tile; if (var_68.x < 0 || var_68.y < 0 || var_68.x > 55 || var_68.y > 31) break; diff --git a/src/dungeon_movement.c b/src/dungeon_movement.c index 70442bfbe..bd072f1d6 100644 --- a/src/dungeon_movement.c +++ b/src/dungeon_movement.c @@ -38,7 +38,7 @@ u8 GetCrossableTerrain(s16 species) } } -u8 sub_807034C(s16 id, struct Tile *tile) +u8 sub_807034C(s16 id, const Tile *tile) { s32 crossableTerrain; u16 tileFlags; @@ -68,7 +68,7 @@ u8 sub_807034C(s16 id, struct Tile *tile) u8 sub_80703A0(Entity *pokemon, DungeonPos *pos) { - struct Tile *tile; + const Tile *tile; u8 crossableTerrain; u16 tileFlags; EntityInfo *entityInfo; @@ -131,7 +131,7 @@ bool8 CanCrossWalls(Entity *pokemon) bool8 sub_807049C(Entity *pokemon, DungeonPos *pos) { s32 crossableTerrain; - struct Tile *tile; + const Tile *tile; u16 tileFlags; EntityInfo *entityInfo; @@ -173,7 +173,7 @@ bool8 sub_807049C(Entity *pokemon, DungeonPos *pos) bool8 sub_8070564(Entity *pokemon, DungeonPos *pos) { u8 crossableTerrain; - struct Tile *tile; + const Tile *tile; u16 tileFlags; EntityInfo *entityInfo; #ifndef NONMATCHING @@ -219,7 +219,7 @@ bool8 sub_8070564(Entity *pokemon, DungeonPos *pos) bool8 sub_80705F0(Entity *pokemon, DungeonPos *pos) { s32 crossableTerrain; - struct Tile *tile; + const Tile *tile; u16 tileFlags; EntityInfo *entityInfo; @@ -259,7 +259,7 @@ bool8 sub_80705F0(Entity *pokemon, DungeonPos *pos) bool8 sub_80706A4(Entity *pokemon, DungeonPos *pos) { s32 crossableTerrain; - struct Tile *tile; + const Tile *tile; u16 tileFlags; EntityInfo *entityInfo; diff --git a/src/dungeon_range.c b/src/dungeon_range.c index f06338f4a..1c933b0b3 100644 --- a/src/dungeon_range.c +++ b/src/dungeon_range.c @@ -9,7 +9,7 @@ bool8 IsPositionActuallyInSight(DungeonPos *pos1, DungeonPos *pos2) { u8 pos1Room; u8 visibility = gDungeon->unk181e8.visibilityRange; - struct Tile *tile1; + const Tile *tile1; if (visibility == 0) { visibility = 2; @@ -49,7 +49,7 @@ bool8 IsPositionActuallyInSight(DungeonPos *pos1, DungeonPos *pos2) bool8 IsPositionInSight(DungeonPos *pos1, DungeonPos *pos2) { - struct Tile *tile; + const Tile *tile; u8 pos1Room; s32 xDiff; s32 yDiff; @@ -99,7 +99,7 @@ returnFalse: void sub_80833E8(DungeonPos *param_1, s32 *param_2) { - struct Tile *tile; + const Tile *tile; struct RoomData *mapRoom; u32 visibility; u32 room; @@ -128,7 +128,7 @@ void sub_80833E8(DungeonPos *param_1, s32 *param_2) bool8 IsTargetTwoTilesAway(DungeonPos *pos1, DungeonPos *pos2) { s32 i; - struct Tile *tile; + const Tile *tile; s32 diff; s32 x1; s32 y1; diff --git a/src/dungeon_serializer.c b/src/dungeon_serializer.c index 2e290f492..e3f42f5f6 100644 --- a/src/dungeon_serializer.c +++ b/src/dungeon_serializer.c @@ -910,7 +910,7 @@ static void ReadDungeonTraps(DataSerializer *seri) ReadTilePos(seri, &pos); if (trapID != 0xFF) { - tile = GetTileSafe(pos.x, pos.y); + tile = GetTileMut(pos.x, pos.y); entity = sub_8045684(trapID, &pos, unk1); if (entity) { tile->object = entity; @@ -1090,7 +1090,7 @@ static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index) if (mon != NULL) { monEntInfo = GetEntInfo(mon); - tile = GetTileSafe(monPos.x, monPos.y); + tile = GetTileMut(monPos.x, monPos.y); mon->prevPos = monPos; mon->pos = monPos; tile->monster = mon; @@ -1255,7 +1255,7 @@ void sub_8082B40(void) sub_806CCB4(entity, sub_806CEBC(entity)); pos = entity->pos; AddPokemonDungeonSprite(info->unk98, info->apparentID, &pos, 3); - entity->room = GetTileSafe(entity->pos.x, entity->pos.y)->room; + entity->room = GetTileMut(entity->pos.x, entity->pos.y)->room; } } } diff --git a/src/dungeon_util.c b/src/dungeon_util.c index 096b35346..b414cc1ac 100644 --- a/src/dungeon_util.c +++ b/src/dungeon_util.c @@ -65,14 +65,14 @@ Item* GetItemData_1(Entity *entity) return entity->axObj.info.item; } -Tile *GetTileAtEntity(Entity *entity) +const Tile *GetTileAtEntity(Entity *entity) { return GetTile(entity->pos.x, entity->pos.y); } Tile *GetTileAtEntitySafe(Entity *entity) { - return GetTileSafe(entity->pos.x, entity->pos.y); + return GetTileMut(entity->pos.x, entity->pos.y); } void sub_804513C(void) diff --git a/src/move_actions.c b/src/move_actions.c index 3226a0a5e..8543a2eb9 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -333,7 +333,7 @@ bool8 VitalThrowMoveAction(Entity * pokemon, Entity * target, Move *move, s32 pa bool8 DigMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { - struct Tile *tile; + Tile *tile; bool8 flag; flag = FALSE; @@ -2661,7 +2661,7 @@ bool8 sub_805A85C(Entity * pokemon, Entity * target, Move *move, u32 param_4) DungeonPos pos1; Move stackMove; PixelPos pos2; - struct Tile *tile; + Tile *tile; Entity *entity; s32 temp; s32 temp2; @@ -2704,7 +2704,7 @@ _0805A8C2: sub_803E46C(0x2c); } } - tile = GetTileSafe(pos1.x,pos1.y); + tile = GetTileMut(pos1.x,pos1.y); entity = tile->monster; if (entity != NULL) { if (GetEntityType(entity) == ENTITY_MONSTER) { diff --git a/src/move_checks.c b/src/move_checks.c index d955fc4aa..f45de8ee4 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -359,7 +359,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) break; case MOVE_DIG: { - struct Tile *tile = GetTileAtEntitySafe(pokemon); + Tile *tile = GetTileAtEntitySafe(pokemon); if (!IsTileGround(tile) || (tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != TERRAIN_TYPE_NORMAL) { return FALSE; diff --git a/src/move_effects_target.c b/src/move_effects_target.c index ec2624629..f34bd5771 100644 --- a/src/move_effects_target.c +++ b/src/move_effects_target.c @@ -468,8 +468,8 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis bool8 isNotBurned; bool8 hasSynchronized; EntityInfo *entityInfo; - struct Tile *tile_1; - struct Tile *tile_2; + const Tile *tile_1; + const Tile *tile_2; Entity *entity; s32 index; @@ -556,7 +556,7 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag bool8 isNotPoisoned; bool8 hasSynchronized; EntityInfo *entityInfo; - struct Tile *tile; + const Tile *tile; Entity *entity; s32 index; @@ -645,7 +645,7 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM bool8 isNotBadlyPoisoned; bool8 hasSynchronized; EntityInfo *entityInfo; - struct Tile *tile; + const Tile *tile; Entity *entity; s32 index; @@ -725,7 +725,7 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) { EntityInfo *entityInfo; - struct Tile *tile; + const Tile *tile; if (!EntityExists(target)) { return; diff --git a/src/status.c b/src/status.c index 4690c7e3d..03d770618 100644 --- a/src/status.c +++ b/src/status.c @@ -433,7 +433,7 @@ void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage) void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) { - struct Tile *mapTile; + const Tile *mapTile; EntityInfo *entityInfo; Entity *mapPokemonEntity; int index; diff --git a/src/status_actions.c b/src/status_actions.c index 8df3e799f..82c782218 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -940,7 +940,7 @@ bool8 sub_805BF34(Entity * pokemon, Entity * target, Move *move, s32 param_4) bool8 TrapbustOrbAction(Entity * pokemon,Entity * target, Move *move, s32 param_4) { - struct Tile *tile; + const Tile *tile; Entity *object; Trap *trapData; s32 bottomRightCornerX, bottomRightCornerY; @@ -972,7 +972,7 @@ bool8 TrapbustOrbAction(Entity * pokemon,Entity * target, Move *move, s32 param_ ++topLeftCornerY; --topLeftCornerY; for (xCoord = bottomRightCornerX; xCoord <= topLeftCornerX; xCoord++) { for (yCoord = bottomRightCornerY; yCoord <= topLeftCornerY; yCoord++) { - object = GetTileSafe(xCoord, yCoord)->object; + object = GetTileMut(xCoord, yCoord)->object; if (((object != 0) && (GetEntityType(object) == ENTITY_TRAP)) && (trapData = GetTrapData(object), trapData->id != TRAP_WONDER_TILE)) { pos.y = yCoord; @@ -1094,7 +1094,7 @@ bool8 sub_805C2A0(Entity *pokemon, Entity *target, Move *move, s32 param_4) bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4) { - struct Tile *tileToFill; + Tile *tileToFill; EntityInfo *targetInfo; int y; bool8 filledInTile; @@ -1114,7 +1114,7 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4) tileCoords.y = target->pos.y + gAdjacentTileOffsets[targetInfo->action.direction].y; sub_8042A54(&tileCoords); - tileToFill = GetTileSafe(tileCoords.x,tileCoords.y); + tileToFill = GetTileMut(tileCoords.x,tileCoords.y); if ((tileToFill->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == TERRAIN_TYPE_SECONDARY) { tileToFill->terrainType = (tileToFill->terrainType & ~(TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) | TERRAIN_TYPE_NORMAL; diff --git a/src/tile_types.c b/src/tile_types.c index 440a643ae..f489665f8 100644 --- a/src/tile_types.c +++ b/src/tile_types.c @@ -91,7 +91,7 @@ void sub_8042A14(DungeonPos *); bool8 PosHasItem(DungeonPos *pos) { - struct Tile *tile; + const Tile *tile; Entity *entity; tile = GetTile(pos->x,pos->y); @@ -104,7 +104,7 @@ bool8 PosHasItem(DungeonPos *pos) Entity *GetMonsterAtPos(DungeonPos *pos) { - struct Tile *tile; + const Tile *tile; Entity *entity; tile = GetTile(pos->x,pos->y); @@ -117,7 +117,7 @@ Entity *GetMonsterAtPos(DungeonPos *pos) bool8 sub_804AD34(DungeonPos *pos) { - struct Tile *tile; + Tile *tile; s32 x; Entity * entity; s32 y; @@ -125,7 +125,7 @@ bool8 sub_804AD34(DungeonPos *pos) s32 index; iVar8 = 0; - tile = GetTileSafe(pos->x,pos->y); + tile = GetTileMut(pos->x,pos->y); if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) if(!(tile->terrainType & (TERRAIN_TYPE_UNK_8 | TERRAIN_TYPE_IMPASSABLE_WALL))){ iVar8 = 1; @@ -157,13 +157,13 @@ bool8 sub_804AD34(DungeonPos *pos) bool8 sub_804AE08(DungeonPos *pos) { - struct Tile *tile; + Tile *tile; s32 x; s32 y; bool8 uVar6; uVar6 = FALSE; - tile = GetTileSafe(pos->x,pos->y); + tile = GetTileMut(pos->x,pos->y); if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) if(!(tile->terrainType & (TERRAIN_TYPE_UNK_8 | TERRAIN_TYPE_IMPASSABLE_WALL))) { @@ -184,13 +184,13 @@ bool8 sub_804AE08(DungeonPos *pos) void sub_804AE84(DungeonPos *pos) { - struct Tile *tile; + Tile *tile; s32 x; Entity * entity; s32 index; s32 y; - tile = GetTileSafe(pos->x,pos->y); + tile = GetTileMut(pos->x,pos->y); if ((tile->unk4 & 0x10) != 0) { tile->unk4 = tile->unk4 & 0xffef; diff --git a/src/trap.c b/src/trap.c index 2d51f8b40..71e798fdb 100644 --- a/src/trap.c +++ b/src/trap.c @@ -100,7 +100,7 @@ void sub_807FC3C(DungeonPos *pos, u32 trapID, u32 param_3) bool8 CanLayTrap(DungeonPos *pos) { - struct Tile *tile = GetTileSafe(pos->x, pos->y); + Tile *tile = GetTileMut(pos->x, pos->y); if (tile->terrainType & TERRAIN_TYPE_STAIRS || tile->room == CORRIDOR_ROOM || tile->terrainType & TERRAIN_TYPE_NATURAL_JUNCTION) @@ -126,7 +126,7 @@ bool8 LayTrap(DungeonPos *pos, u8 trapID, u8 param_3) int counter; u16 terrainType; - tile = GetTileSafe(pos->x, pos->y); + tile = GetTileMut(pos->x, pos->y); if (TRAP_SPIKE_TRAP < trapID) { counter = 0; while ((counter < 0x1e && (trapID = sub_803D6FC(), trapID == TRAP_WONDER_TILE))) { @@ -188,7 +188,7 @@ bool8 sub_807FE04(DungeonPos *pos, char param_2) { Tile *tile; - tile = GetTileSafe(pos->x,pos->y); + tile = GetTileMut(pos->x,pos->y); if ((tile->object != NULL) && (GetEntityType(tile->object) == ENTITY_TRAP)) { tile->object->type = 0; tile->object = NULL; @@ -204,7 +204,7 @@ bool8 sub_807FE04(DungeonPos *pos, char param_2) bool8 sub_807FE44(DungeonPos *pos, char param_2) { - Tile *tile; + const Tile *tile; tile = GetTile(pos->x,pos->y); if ((tile->object != NULL) && (GetEntityType(tile->object) == ENTITY_TRAP)) { @@ -236,7 +236,7 @@ void sub_807FE9C(Entity *pokemon, DungeonPos *pos, int param_3, char param_4) Entity *target; u8 *text; - tile = GetTileSafe(pos->x,pos->y); + tile = GetTileMut(pos->x,pos->y); entity = tile->object; flag1 = FALSE; if (entity == NULL) { diff --git a/tmp/gettile.cocci b/tmp/gettile.cocci new file mode 100644 index 000000000..ce7dc37b0 --- /dev/null +++ b/tmp/gettile.cocci @@ -0,0 +1,42 @@ +@ r1 disable optional_qualifier exists @ +identifier tile; +@@ +- Tile *tile; +++ const Tile *tile; + ... + tile = GetTile(...) +@ r2 disable optional_qualifier exists @ +identifier tile; +@@ +- Tile *tile +++ const Tile *tile + = GetTile(...); +@ decls disable optional_qualifier @ +identifier tile; +@@ +( + Tile *tile; +| + Tile *tile = ...; +) +@ mutated depends on decls exists @ +identifier decls.tile; +assignment operator op; +identifier f; +@@ +( + tile->f op ...; +| + f(<+... tile ...+>) +) +@ notmutated depends on decls && !mutated disable optional_qualifier @ +identifier decls.tile; +@@ +( +- Tile *tile; +++ const Tile *tile; +| +- Tile *tile +++ const Tile *tile + = ...; +) diff --git a/tmp/position.cocci b/tmp/position.cocci deleted file mode 100644 index ff2de880e..000000000 --- a/tmp/position.cocci +++ /dev/null @@ -1,17 +0,0 @@ -@@ -typedef Position; -@@ -- struct Position -+ Position -@@ -typedef Position32; -typedef PixelPos; -@@ -- Position32 -+ PixelPos -@@ -typedef Position; -typedef DungeonPos; -@@ -- Position -+ DungeonPos From 9ab3ae9aaa82fd3c80ae290fb36d99e98eeb1327 Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Wed, 13 Nov 2024 19:36:23 +0100 Subject: [PATCH 45/48] Math refactoring/cleanup --- asm/code_800F990.s | 4 +- include/math.h | 2 +- include/number_util.h | 7 ++ src/code_806FDF4.c | 2 +- src/code_8077274_1.c | 4 +- src/data/math.h | 10 ++- src/math.c | 159 +++++++++++++++++++++--------------------- tmp/gettile.cocci | 42 ----------- 8 files changed, 96 insertions(+), 134 deletions(-) delete mode 100644 tmp/gettile.cocci diff --git a/asm/code_800F990.s b/asm/code_800F990.s index 1fa0545f6..711c1a5d2 100644 --- a/asm/code_800F990.s +++ b/asm/code_800F990.s @@ -609,7 +609,7 @@ _0800FE3C: lsls r0, 8 str r0, [sp, 0x10] add r0, sp, 0xC - bl sub_800A0B0 + bl Atan2_4096 adds r2, r0, 0 ldr r0, [sp, 0xC] cmp r0, 0 @@ -1294,7 +1294,7 @@ _08010392: str r0, [sp, 0xC] str r3, [sp, 0x10] add r0, sp, 0xC - bl sub_800A0B0 + bl Atan2_4096 ldr r1, _08010474 adds r3, r0, r1 cmp r3, 0 diff --git a/include/math.h b/include/math.h index 2fdb563ec..74f659d2d 100644 --- a/include/math.h +++ b/include/math.h @@ -41,7 +41,7 @@ void F48_16_SDiv(s48_16 *dst, s48_16 *a, s48_16 *b); void F48_16_SMul(s48_16 *dst, s48_16 *a, s48_16 *b); s24_8 FP24_8_Hypot(s24_8 x, s24_8 y); -void FP48_16_FromS32(s48_16 *dst, u32); +void FP48_16_FromS32(s48_16 *dst, s32 src); u32 FP48_16_ToS32(s48_16 *a); void FP48_16_FromF248(s48_16 *a, s24_8 b); bool8 FP48_16_SLessThan(s48_16 *a, s48_16 *b); diff --git a/include/number_util.h b/include/number_util.h index d2e6741ed..ed5c06d0e 100644 --- a/include/number_util.h +++ b/include/number_util.h @@ -22,6 +22,10 @@ typedef struct s24_8 { s32 raw; } s24_8; +#define F248_ZERO ((s24_8){}) +#define F248_ONE ((s24_8){0x100}) +#define F248_MAX ((s24_8){0x7FFFFFFF}) + /** * This type represents a signed 48.16 fixed-point number, where the 48 most * significant bits are the integer part and the 16 least significant bits are @@ -32,6 +36,9 @@ typedef struct s48_16 s32 hi; u32 lo; // some math.c funcs require this to be a u32, but other funcs check if it's negative (aka >= INT32_MAX) } s48_16; +#define F4816_ZERO ((s48_16){}) +#define F4816_ONE ((s48_16){0, 0x10000}) +#define F4816_MAX ((s48_16){0x7FFFFFFF, 0xFFFFFFFF}) FixedPoint FixedPoint_Add(FixedPoint a, FixedPoint b); FixedPoint FixedPoint_Subtract(FixedPoint a, FixedPoint b); diff --git a/src/code_806FDF4.c b/src/code_806FDF4.c index 553ffa59b..134ea7ce6 100644 --- a/src/code_806FDF4.c +++ b/src/code_806FDF4.c @@ -133,7 +133,7 @@ void sub_806F500(void) temp->unk140[6] = 0; temp->unk150 = 0; temp->unk158 = 0; - temp->unk15C = IntToF248(0); + temp->unk15C = F248_ZERO; temp->unk160 = 0; temp->unk161 = 0; temp->unk162 = 0; diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index 51b78451a..98a093482 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -1027,11 +1027,11 @@ void sub_8079E34(Entity * pokemon, Entity * target, bool8 param_3) statChanged = TRUE; } if (!F248EqualsInt(entityInfo->offensiveMultipliers[index], 1)) { - entityInfo->offensiveMultipliers[index] = IntToF248(1); + entityInfo->offensiveMultipliers[index] = F248_ONE; statChanged = TRUE; } if (!F248EqualsInt(entityInfo->defensiveMultipliers[index], 1)) { - entityInfo->defensiveMultipliers[index] = IntToF248(1); + entityInfo->defensiveMultipliers[index] = F248_ONE; statChanged = TRUE; } } diff --git a/src/data/math.h b/src/data/math.h index b563999e1..fff6c880d 100644 --- a/src/data/math.h +++ b/src/data/math.h @@ -1,5 +1,3 @@ -// gFastMod3Lookup - const u8 gFastMod3Lookup[0x100] = { 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0 }; @@ -9,8 +7,8 @@ const u8 gFastDiv3Lookup[0x100] = { }; -// gFastSinLookup[i] = floor(256 * sin(iĎ€ / 2048)) -static const s16 gFastSinLookup[] = { +// sFastSinLookup[i] = floor(256 * sin(iĎ€ / 2048)) +static const s16 sFastSinLookup[] = { 0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, @@ -141,8 +139,8 @@ static const s16 gFastSinLookup[] = { 255, 255, 255, 255, 255, 255, 255, 255, }; - -const u32 gFastUnknownFn1Lookup[] = { +// sFastAtan2Lookup256[256*y/x] = atan2(x,y) for x>y>=0, in units of 2Ď€/256 +static const u32 sFastAtan2Lookup256[] = { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, diff --git a/src/math.c b/src/math.c index a63c1cf94..1f43fec47 100644 --- a/src/math.c +++ b/src/math.c @@ -3,6 +3,7 @@ #include "math.h" #include "data/math.h" +#include "structs/str_position.h" static void F48_16_UDiv(s48_16 *, s48_16 *, s48_16 *); static void F48_16_UMul(s48_16 *, s48_16 *, s48_16 *); @@ -32,13 +33,13 @@ s32 sin_4096(s32 x) { switch (x & 0xc00) { case 0x000: - return gFastSinLookup[x & 0x3ff]; + return sFastSinLookup[x & 0x3ff]; case 0x400: - return gFastSinLookup[0x3ff - (x & 0x3ff)]; + return sFastSinLookup[0x3ff - (x & 0x3ff)]; case 0x800: - return -gFastSinLookup[x & 0x3ff]; + return -sFastSinLookup[x & 0x3ff]; case 0xc00: - return -gFastSinLookup[0x3ff - (x & 0x3ff)]; + return -sFastSinLookup[0x3ff - (x & 0x3ff)]; } return 0; @@ -48,13 +49,13 @@ s32 cos_4096(s32 x) { switch (x & 0xc00) { case 0x000: - return gFastSinLookup[0x3ff - (x & 0x3ff)]; + return sFastSinLookup[0x3ff - (x & 0x3ff)]; case 0x400: - return -gFastSinLookup[x & 0x3ff]; + return -sFastSinLookup[x & 0x3ff]; case 0x800: - return -gFastSinLookup[0x3ff - (x & 0x3ff)]; + return -sFastSinLookup[0x3ff - (x & 0x3ff)]; case 0xc00: - return gFastSinLookup[x & 0x3ff]; + return sFastSinLookup[x & 0x3ff]; } return 0; @@ -172,7 +173,7 @@ static s24_8 u24_8_mul(s24_8 x, s24_8 y) u32 round_up; if (x.raw == 0 || y.raw == 0) - return (s24_8){0}; + return F248_ZERO; x_h = 0; x_l = x.raw; @@ -241,10 +242,10 @@ static s24_8 u24_8_div(s24_8 x, s24_8 y) s32 temp; if (y.raw == 0) - return (s24_8){INT32_MAX}; + return F248_MAX; if (x.raw == 0) - return (s24_8){0}; + return F248_ZERO; r7 = (u32)x.raw >> 24; r6 = x.raw << 8; @@ -298,7 +299,7 @@ UNUSED s24_8 FP24_8_Pow(s24_8 x, s32 y) if (uVar1 < 0) uVar1 = -uVar1; - sVar1 = IntToF248(1); + sVar1 = F248_ONE; for (; uVar1 != 0; uVar1 >>= 1) { if (uVar1 & 1) @@ -310,7 +311,7 @@ UNUSED s24_8 FP24_8_Pow(s24_8 x, s32 y) if (y >= 0) return sVar1; - return s24_8_div(IntToF248(1), sVar1); + return s24_8_div(F248_ONE, sVar1); } s24_8 FP24_8_Hypot(s24_8 x, s24_8 y) @@ -348,21 +349,18 @@ s24_8 FP24_8_Hypot(s24_8 x, s24_8 y) return r5; } -void FP48_16_FromS32(s48_16 *param_1, u32 param_2) +void FP48_16_FromS32(s48_16 *dst, s32 src) { -#ifndef NONMATCHING - register u32 temp asm("r4"); + dst->hi = (src & ~0xFFFFu) >> 16; + dst->lo = (src & 0xFFFFu) << 16; + + // BUG: Should be checking top bit of src, or using dst->hi here (see FP48_16_FromF248) +#ifdef BUGFIX + if (dst->hi & 0x8000) #else - u32 temp; + if (src & 0x8000) #endif - - temp = 0xFFFF0000; - param_1->hi = param_2 >> 16; - param_1->lo = param_2 << 16; - - if (param_2 & 0x8000) - param_1->hi |= temp; - + dst->hi |= ~0xFFFF; } u32 FP48_16_ToS32(s48_16 *a) @@ -398,118 +396,119 @@ void FP48_16_FromF248(s48_16 *a, s24_8 b) a->hi &= 0x7f; } -s32 sub_800A0B0(s48_16 *a) +// returns 12-bit angle +s32 Atan2_4096(PixelPos *a) { - s32 r2; - s32 r3; + s32 y; + s32 x; s32 idx; s32 divi; - r2 = a->lo; - r3 = a->hi; - if (r2 == 0 && r3 == 0) + y = a->y; + x = a->x; + if (y == 0 && x == 0) return 0; - if (r2 > 0) { - if (r3 > 0) { - if (r2 < r3) { - divi = r3 / 256; + if (y > 0) { + if (x > 0) { + if (y < x) { + divi = F248ToInt((s24_8){x}); if (divi == 0) return 0x200; - idx = r2 / divi; + idx = y / divi; if (idx > 0xFF) idx = 0xFF; - - return gFastUnknownFn1Lookup[idx] << 4; + + return sFastAtan2Lookup256[idx] << 4; } - else { // r2 >= r3 - divi = r2 / 256; + else { // y >= x + divi = F248ToInt((s24_8){y}); if (divi == 0) return 0x200; - idx = r3 / divi; + idx = x / divi; if (idx > 0xFF) idx = 0xFF; - - return (0x40 - gFastUnknownFn1Lookup[idx]) << 4; + + return (0x40 - sFastAtan2Lookup256[idx]) << 4; } } - else { // r3 <= 0 - r3 = -r3; - if (r2 < r3) { - divi = r3 / 256; + else { // x <= 0 + x = -x; + if (y < x) { + divi = F248ToInt((s24_8){x}); if (divi == 0) return 0x600; - idx = r2 / divi; + idx = y / divi; if (idx > 0xFF) idx = 0xFF; - - return (0x80 - gFastUnknownFn1Lookup[idx]) << 4; + + return (0x80 - sFastAtan2Lookup256[idx]) << 4; } - else { // r2 >= r3 - divi = r2 / 256; + else { // y >= x + divi = F248ToInt((s24_8){y}); if (divi == 0) return 0x600; - idx = r3 / divi; + idx = x / divi; if (idx > 0xFF) idx = 0xFF; - - return (gFastUnknownFn1Lookup[idx] + 0x40) << 4; + + return (sFastAtan2Lookup256[idx] + 0x40) << 4; } } } - else { // r2 <= 0 - r2 = -r2; - if (r3 > 0) { - if (r2 < r3) { - divi = r3 / 256; + else { // y <= 0 + y = -y; + if (x > 0) { + if (y < x) { + divi = F248ToInt((s24_8){x}); if (divi == 0) return 0xE00; - idx = r2 / divi; + idx = y / divi; if (idx > 0xFF) idx = 0xFF; - - return (0x100 - gFastUnknownFn1Lookup[idx]) << 4; + + return (0x100 - sFastAtan2Lookup256[idx]) << 4; } - else { // r2 >= r3 - divi = r2 / 256; + else { // y >= x + divi = F248ToInt((s24_8){y}); if (divi == 0) return 0xE00; - idx = r3 / divi; + idx = x / divi; if (idx > 0xFF) idx = 0xFF; - - return (gFastUnknownFn1Lookup[idx] + 0xC0) << 4; + + return (sFastAtan2Lookup256[idx] + 0xC0) << 4; } } - else { // r3 <= 0 - r3 = -r3; - if (r2 < r3) { - divi = r3 / 256; + else { // x <= 0 + x = -x; + if (y < x) { + divi = F248ToInt((s24_8){x}); if (divi == 0) return 0xA00; - idx = r2 / divi; + idx = y / divi; if (idx > 0xFF) idx = 0xFF; - - return (gFastUnknownFn1Lookup[idx] + 0x80) << 4; + + return (sFastAtan2Lookup256[idx] + 0x80) << 4; } - else { // r2 >= r3 - divi = r2 / 256; + else { // y >= x + divi = F248ToInt((s24_8){y}); if (divi == 0) return 0xA00; - idx = r3 / divi; + idx = x / divi; if (idx > 0xFF) idx = 0xFF; - - return (0xC0 - gFastUnknownFn1Lookup[idx]) << 4; + + return (0xC0 - sFastAtan2Lookup256[idx]) << 4; } } } diff --git a/tmp/gettile.cocci b/tmp/gettile.cocci deleted file mode 100644 index ce7dc37b0..000000000 --- a/tmp/gettile.cocci +++ /dev/null @@ -1,42 +0,0 @@ -@ r1 disable optional_qualifier exists @ -identifier tile; -@@ -- Tile *tile; -++ const Tile *tile; - ... - tile = GetTile(...) -@ r2 disable optional_qualifier exists @ -identifier tile; -@@ -- Tile *tile -++ const Tile *tile - = GetTile(...); -@ decls disable optional_qualifier @ -identifier tile; -@@ -( - Tile *tile; -| - Tile *tile = ...; -) -@ mutated depends on decls exists @ -identifier decls.tile; -assignment operator op; -identifier f; -@@ -( - tile->f op ...; -| - f(<+... tile ...+>) -) -@ notmutated depends on decls && !mutated disable optional_qualifier @ -identifier decls.tile; -@@ -( -- Tile *tile; -++ const Tile *tile; -| -- Tile *tile -++ const Tile *tile - = ...; -) From f8f076d14dc229dd6b69acd93b60811411285464 Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Thu, 14 Nov 2024 23:00:15 +0100 Subject: [PATCH 46/48] Clean up some script stuff, based on blue ROM --- asm/ground_script.s | 81 ---------------------------------------- src/event_flag.c | 67 +++++++++++++++++---------------- src/ground_script_1.c | 18 +++++---- src/ground_script_2.c | 86 ++++++++++++++++++++----------------------- 4 files changed, 86 insertions(+), 166 deletions(-) diff --git a/asm/ground_script.s b/asm/ground_script.s index 6e5c25195..808df9384 100644 --- a/asm/ground_script.s +++ b/asm/ground_script.s @@ -1710,85 +1710,4 @@ _080A236C: bx r1 thumb_func_end sub_80A14E8 - thumb_func_start GroundScript_Unlock -GroundScript_Unlock: - push {r4-r7,lr} - ldr r1, _080A241C - ldrb r0, [r1] - cmp r0, 0 - beq _080A2414 - movs r0, 0 - strb r0, [r1] - movs r6, 0 -_080A2390: - ldr r0, _080A2420 - adds r7, r6, r0 - ldrb r0, [r7] - cmp r0, 0 - beq _080A240E - movs r0, 0x1 - ldr r1, _080A2424 - adds r2, r6, 0 - bl Log - lsls r5, r6, 16 - asrs r5, 16 - adds r0, r5, 0 - bl GroundMapNotifyAll - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl GroundLivesNotifyAll - orrs r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl GroundObjectsNotifyAll - orrs r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl GroundEffectsNotifyAll - orrs r4, r0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, _080A2428 - adds r5, r6, r0 - ldrb r0, [r5] - cmp r0, 0 - beq _080A240C - cmp r4, 0 - beq _080A240E - movs r0, 0x80 - adds r4, r6, 0 - orrs r4, r0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - bl GroundMapNotifyAll - adds r0, r4, 0 - bl GroundLivesNotifyAll - adds r0, r4, 0 - bl GroundObjectsNotifyAll - adds r0, r4, 0 - bl GroundEffectsNotifyAll - movs r0, 0 - strb r0, [r5] -_080A240C: - strb r0, [r7] -_080A240E: - adds r6, 0x1 - cmp r6, 0x80 - ble _080A2390 -_080A2414: - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080A241C: .4byte gAnyScriptLocked -_080A2420: .4byte gScriptLocks -_080A2424: .4byte gUnknown_8116848 -_080A2428: .4byte gScriptLockConds - thumb_func_end GroundScript_Unlock - .align 2,0 diff --git a/src/event_flag.c b/src/event_flag.c index 4b7680007..3609feb8c 100644 --- a/src/event_flag.c +++ b/src/event_flag.c @@ -177,49 +177,54 @@ void ScenarioCalc(s16 param_1,s32 param_2,s32 param_3) } } -bool8 ScriptVarScenarioBefore(s16 param_1,u32 param_2,s32 param_3) +bool8 ScriptVarScenarioBefore(s16 varId,u32 pMain,s32 pSub) { - s32 uVar1; - s32 iVar2; - - uVar1 = GetScriptVarArrayValue(NULL,param_1,0); - iVar2 = GetScriptVarArrayValue(NULL,param_1,1); - if ((uVar1 != 0x3a) && - (uVar1 < param_2 || (param_3 >= 0 && (uVar1 == param_2) && (iVar2 < param_3)))) { + s32 sMain; + s32 sSub; + + sMain = GetScriptVarArrayValue(NULL, varId, 0); + sSub = GetScriptVarArrayValue(NULL, varId, 1); + if (sMain == 0x3a) { + // DS: Assert(FALSE, "debug mode scenario comp %3d %3d %3d", varId, pMain, pSub) + return FALSE; + } else if (sMain < pMain) { return TRUE; - } - else { + } else if (pSub >= 0 && sMain == pMain && sSub < pSub) { + return TRUE; + } else { return FALSE; } } -bool8 ScriptVarScenarioEqual(s16 param_1,u32 param_2,s32 param_3) +bool8 ScriptVarScenarioEqual(s16 varId,u32 pMain,s32 pSub) { - s32 uVar1; - s32 iVar2; - - uVar1 = GetScriptVarArrayValue(NULL, param_1, 0); - iVar2 = GetScriptVarArrayValue(NULL, param_1, 1); - if (((uVar1 == param_2 && (((param_3 < 0) || (iVar2 == param_3)))))) { - return TRUE; - } - else { - return FALSE; + s32 sMain; + s32 sSub; + + sMain = GetScriptVarArrayValue(NULL, varId, 0); + sSub = GetScriptVarArrayValue(NULL, varId, 1); + if (sMain == pMain) { + if (pSub < 0) return TRUE; + if (sSub == pSub) return TRUE; } + return FALSE; } -bool8 ScriptVarScenarioAfter(s16 param_1,u32 param_2,s32 param_3) +bool8 ScriptVarScenarioAfter(s16 varId,u32 pMain,s32 pSub) { - s32 uVar1; - s32 iVar2; - - uVar1 = GetScriptVarArrayValue(NULL, param_1, 0); - iVar2 = GetScriptVarArrayValue(NULL, param_1, 1); - if ((uVar1 != 0x3a) && - ((uVar1 > param_2 || (((param_3 >= 0 && (uVar1 == param_2)) && (iVar2 > param_3)))))) { + s32 sMain; + s32 sSub; + + sMain = GetScriptVarArrayValue(NULL, varId, 0); + sSub = GetScriptVarArrayValue(NULL, varId, 1); + if (sMain == 0x3a) { + // DS: Assert(FALSE, "debug mode scenario comp %3d %3d %3d", varId, pMain, pSub) + return FALSE; + } else if (sMain > pMain) { return TRUE; - } - else { + } else if (pSub >= 0 && sMain == pMain && sSub > pSub) { + return TRUE; + } else { return FALSE; } } diff --git a/src/ground_script_1.c b/src/ground_script_1.c index aa340e4f9..f21d6f0b9 100644 --- a/src/ground_script_1.c +++ b/src/ground_script_1.c @@ -1683,6 +1683,7 @@ s32 ExecuteScriptCommand(Action *action) { break; } case 0xd2 ... 0xd8: { + // DS: Assert(TRUE, "Script command call error SWITCH MENY") [sic] const char *out = curCmd.argPtr; gNumChoices = 0; scriptData->branchDiscriminant = 0; @@ -1765,21 +1766,21 @@ s32 ExecuteScriptCommand(Action *action) { case 0xe6: { scriptData->savedScript = scriptData->script; } //fallthrough - case 0xe7: { // ??? + case 0xe7: { scriptData->script.ptr = FindLabel(action, curCmd.argShort); break; } - case 0xe8: { // SAVE_AND_TRIGGER + case 0xe8: { scriptData->savedScript = scriptData->script; } // fallthrough - case 0xe9: { // TRIGGER + case 0xe9: { scriptData->script.ptr2 = scriptData->script.ptr = gFunctionScriptTable[curCmd.argShort].script; break; } - case 0xea: { // SAVE_AND_RUN_STATION + case 0xea: { scriptData->savedScript = scriptData->script; } // fallthrough - case 0xeb: { // RUN_STATION + case 0xeb: { ScriptInfoSmall info; u32 group, sector; u32 tmp = gUnknown_2039A34; @@ -1804,13 +1805,15 @@ s32 ExecuteScriptCommand(Action *action) { GroundMap_ExecuteEnter(gUnknown_2039A34); break; } - case 0xed: { // DELETE_SAVED + case 0xed: { + // DS: if (scriptData->savedScript.ptr == NULL) Assert(FALSE, "Script flash stack error"); scriptData->savedScript.ptr = NULL; scriptData->savedScript.ptr2 = NULL; break; } - case 0xee: { // RESTORE_SAVED + case 0xee: { if (scriptData->savedScript.ptr == NULL) { + // DS: Assert(FALSE, "Script return stack error"); return 0; } scriptData->script = scriptData->savedScript; @@ -1819,6 +1822,7 @@ s32 ExecuteScriptCommand(Action *action) { break; } case 0xef: + // DS: if (scriptData->savedScript.ptr != NULL) Assert(FALSE, "Script end stack error"); return 0; case 0xf0: return 1; diff --git a/src/ground_script_2.c b/src/ground_script_2.c index 004db16f8..2956ce789 100644 --- a/src/ground_script_2.c +++ b/src/ground_script_2.c @@ -10,51 +10,43 @@ extern u32 gUnlockBranchLabels[]; extern u8 gScriptLockConds[]; extern u8 gUnknown_8116848[]; -s32 GroundLivesNotifyAll(s16); -s32 GroundObjectsNotifyAll(s16); -s32 GroundEffectsNotifyAll(s16); +bool8 GroundLivesNotifyAll(s16); +bool8 GroundObjectsNotifyAll(s16); +bool8 GroundEffectsNotifyAll(s16); // TODO: this is still WIP -// void GroundScript_Unlock(void) -// { -// s32 index; -// u8 temp; -// s16 temp_s16; -// -// if(gAnyScriptLocked != 0) -// { -// gAnyScriptLocked = 0; -// for(index = 0; index < 0x81; index++) -// { -// if(gScriptLocks[index] != 0) -// { -// Log(1, gUnknown_8116848, index); -// temp = GroundMapNotifyAll(index); -// temp |= GroundLivesNotifyAll(index); -// temp |= GroundObjectsNotifyAll(index); -// temp |= GroundEffectsNotifyAll(index); -// -// if(gScriptLockConds[index] != 0) -// { -// if (temp != 0) -// { -// temp_s16 = index; -// temp_s16 |= 0x80; -// GroundMapNotifyAll(temp_s16); -// GroundLivesNotifyAll(temp_s16); -// GroundObjectsNotifyAll(temp_s16); -// GroundEffectsNotifyAll(temp_s16); -// gScriptLockConds[index] = 0; -// } -// } -// else { -// gScriptLocks[index] = 0; -// } -// } -// } -// } -// } +void GroundScript_Unlock(void) +{ + s32 index; + bool8 cond; + + if(gAnyScriptLocked == 0) return; + + gAnyScriptLocked = 0; + index = 0; + for (index = 0; index <= 0x80; index++) { + if(gScriptLocks[index] != 0) { + Log(1, gUnknown_8116848, index); + cond = GroundMapNotifyAll(index); + cond |= GroundLivesNotifyAll(index); + cond |= GroundObjectsNotifyAll(index); + cond |= GroundEffectsNotifyAll(index); + + if(gScriptLockConds[index] != 0) { + if (cond) { + GroundMapNotifyAll(index | 0x80); + GroundLivesNotifyAll(index | 0x80); + GroundObjectsNotifyAll(index | 0x80); + GroundEffectsNotifyAll(index | 0x80); + gScriptLocks[index] = gScriptLockConds[index] = 0; + } + } else { + gScriptLocks[index] = 0; + } + } + } +} const ScriptCommand *FindLabel(Action *action, s32 r1) { @@ -69,12 +61,12 @@ const ScriptCommand *FindLabel(Action *action, s32 r1) script = *scriptPtr; scriptPtr++; - if(script.op == 0xF4) - { - if(r1 == script.argShort) - return scriptPtr; - } + if(script.op == 0xF4 && r1 == script.argShort) break; + + // DS: Assert(script.op != 0, "script search label error %d", label) + // DS: Assert(script.op != 0xF6, "script search label error %d", label) } + return scriptPtr; } const ScriptCommand *ResolveJump(Action *action, s32 r1) From 8103f5e69394daa3acef6937d6632b0072e9f0be Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Sat, 16 Nov 2024 18:50:25 +0100 Subject: [PATCH 47/48] Address review comments --- src/code_806E8B0.c | 1 - src/ground_script_2.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index ffcc4c37d..71b55a305 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -391,7 +391,6 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 #endif // NONMATCHING gDungeon->unk134.unk15C = arg8_Match = arg8; - //ASM_MATCH_TRICK(arg8); FP48_16_FromF248(&unkSp10, arg8_Match); F48_16_SMul(&unkSp8, &unkSp8, &unkSp10); } diff --git a/src/ground_script_2.c b/src/ground_script_2.c index 2956ce789..a5b63f7d8 100644 --- a/src/ground_script_2.c +++ b/src/ground_script_2.c @@ -14,8 +14,6 @@ bool8 GroundLivesNotifyAll(s16); bool8 GroundObjectsNotifyAll(s16); bool8 GroundEffectsNotifyAll(s16); -// TODO: this is still WIP - void GroundScript_Unlock(void) { s32 index; From a9ff59b103c2e606a24212041e8221f24f8a4d99 Mon Sep 17 00:00:00 2001 From: Mateon1 Date: Sat, 16 Nov 2024 19:29:02 +0100 Subject: [PATCH 48/48] Clean up related Tile stuff --- data/data_80F59C8.s | 8 ++++---- include/dungeon_map_access.h | 5 ----- src/dungeon_map_access.c | 18 +++++++++--------- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/data/data_80F59C8.s b/data/data_80F59C8.s index 5a7191cc1..4bc061a0b 100644 --- a/data/data_80F59C8.s +++ b/data/data_80F59C8.s @@ -522,14 +522,14 @@ gUnknown_80F69A8: @ 80F69A8 .byte 0x69, 0x72, 0x30, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00, 0x70, 0x6b, 0x73, 0x64 .byte 0x69, 0x72, 0x30, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 -.global gUnknown_80F69D4 -gUnknown_80F69D4: @ 80F69D4 +.global gOtherOobTile +gOtherOobTile: @ 80F69D4 @ replacing .incbin "baserom.gba", 0xF69D4, 0x18 .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -.global gUnknown_80F69EC -gUnknown_80F69EC: @ 80F69EC +.global gWaterOobTile +gWaterOobTile: @ 80F69EC @ replacing .incbin "baserom.gba", 0xF69EC, 0x18 .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 diff --git a/include/dungeon_map_access.h b/include/dungeon_map_access.h index 5defb8029..3fe6c492e 100644 --- a/include/dungeon_map_access.h +++ b/include/dungeon_map_access.h @@ -3,11 +3,6 @@ #include "structs/map.h" -typedef struct unkStruct_202F190 -{ - Tile *unk0[6]; -} unkStruct_202F190; - const Tile *GetTile(s32 x, s32 y); Tile *GetTileMut(s32 x, s32 y); diff --git a/src/dungeon_map_access.c b/src/dungeon_map_access.c index 37a903e8c..c5d82dde6 100644 --- a/src/dungeon_map_access.c +++ b/src/dungeon_map_access.c @@ -16,8 +16,8 @@ #include "game_options.h" #include "dungeon_visibility.h" -extern const unkStruct_202F190 gUnknown_80F69D4; -extern const unkStruct_202F190 gUnknown_80F69EC; +extern const Tile gOtherOobTile; +extern const Tile gWaterOobTile; extern u8 gUnknown_80F6A04[]; extern u8 gUnknown_80F6A10[]; extern u8 gUnknown_80F6A28[]; @@ -32,9 +32,9 @@ extern const s16 gUnknown_80F6C06[]; EWRAM_DATA OpenedFile *gDungeonPaletteFile = {0}; EWRAM_DATA unkStruct_202EE8C gUnknown_202EE8C[32] = {0}; EWRAM_DATA OpenedFile *gUnknown_202F18C = {0}; -EWRAM_DATA unkStruct_202F190 gOutOfBoundsTileData = {0}; +EWRAM_DATA Tile gOutOfBoundsTileData = {0}; -EWRAM_DATA_2 const unkStruct_202F190 *gUnknown_203B430 = {0}; +EWRAM_DATA_2 const Tile *gCurTilesetOobTile = {0}; extern u8 sub_8043CE4(u32); extern void sub_80402AC(s32, s32); @@ -48,15 +48,15 @@ const Tile *GetTile(s32 x, s32 y) { return gDungeon->tilePointers[y][x]; } - return (Tile *) gUnknown_203B430->unk0; + return gCurTilesetOobTile; } Tile *GetTileMut(s32 x, s32 y) { if (x < 0 || y < 0 || x >= DUNGEON_MAX_SIZE_X || y >= DUNGEON_MAX_SIZE_Y) { - Tile *tile = (Tile *) gOutOfBoundsTileData.unk0; - gOutOfBoundsTileData = *gUnknown_203B430; + Tile *tile = &gOutOfBoundsTileData; + gOutOfBoundsTileData = *gCurTilesetOobTile; return tile; } return gDungeon->tilePointers[y][x]; @@ -139,10 +139,10 @@ void sub_8049820(void) void sub_8049840(void) { if (sub_8043CE4(gDungeon->tileset) != 0) { - gUnknown_203B430 = &gUnknown_80F69EC; + gCurTilesetOobTile = &gWaterOobTile; } else { - gUnknown_203B430 = &gUnknown_80F69D4; + gCurTilesetOobTile = &gOtherOobTile; } }