Skip to content

Commit

Permalink
Merge pull request #139 from Kermalis/kermalis-friend_rescue
Browse files Browse the repository at this point in the history
Complete friend_rescue
  • Loading branch information
AnonymousRandomPerson authored Jul 19, 2023
2 parents abeeecd + facd617 commit c8f46ac
Show file tree
Hide file tree
Showing 10 changed files with 2,643 additions and 4,041 deletions.
1,914 changes: 0 additions & 1,914 deletions asm/friend_rescue.s

This file was deleted.

14 changes: 8 additions & 6 deletions include/code_8094F88.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#include "item.h"

// size: 0x30
struct unkStruct_203B480
{
// size: 0x30
/* 0x0 */ u8 mailType;
/* 0x1 */ u8 missionType;
/* 0x4 */ struct DungeonLocation dungeon;
Expand All @@ -21,21 +21,23 @@ struct unkStruct_203B480
struct Item unk20;
u32 unk24;
u32 unk28;
s8 rescuesAllowed;
/* 0x2C */ s8 rescuesAllowed;
u8 unk2D;
u8 padding4[0x30 - 0x2E];
};

// size: 0x5C
struct unkStruct_203B484
{
u32 unk0;
struct PokemonStruct unk4;
/* 0x0 */ u32 unk0;
/* 0x4 */ struct PokemonStruct unk4;
};

// size: 0x84
struct unkStruct_203B48C
{
s32 unk0;
s32 unk4[0x20];
/* 0x0 */ s32 unk0;
/* 0x4 */ s32 unk4[0x20];
};

extern struct unkStruct_203B480 *gUnknown_203B480;
Expand Down
14 changes: 7 additions & 7 deletions include/friend_rescue.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
#include "wonder_mail.h"
#include "menu.h"

// size: 0x568
struct WonderMailStruct_203B33C
{
// size: 0x568
u32 state;
u32 fallbackState;
u8 passwordBuffer[0x36];
/* 0x0 */ u32 state;
/* 0x4 */ u32 fallbackState;
/* 0x8 */ u8 passwordBuffer[0x36];
u32 unk40;
u32 status;
/* 0x44 */ u32 status;
struct unkStruct_203B480 unk48;
struct unkStruct_203B480 unk78;
struct WonderMailStruct_203B2C0_sub unkA8;
Expand All @@ -25,7 +25,7 @@ struct WonderMailStruct_203B33C
struct MenuStruct unk21C[4];
struct UnkTextStruct2 unk35C[4];
struct UnkTextStruct2 unk3BC[4];
struct Item item;
/* 0x41C */ struct Item item;
u32 unk420; // Is this supposed to be a File like 203B2C4?
u8 unk424[0x100];
s32 unk524;
Expand All @@ -35,7 +35,7 @@ struct WonderMailStruct_203B33C
u8 fill52E;
u32 unk530;
u32 unk534;
s16 speciesNum; // A7 << 3
/* 0x538 */ s16 speciesNum; // A7 << 3
struct unkStruct_802F204 unk53C;
s32 unk564;
};
Expand Down
22 changes: 14 additions & 8 deletions include/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "constants/item.h"
#include "code_8092334.h"

// size: 0x20
struct ItemDataEntry
{
/* 0x0 */ u8 *name;
Expand All @@ -24,24 +25,29 @@ struct ItemDataEntry
/* 0x1E */ u8 actionType;
};

// size: 0x4
struct Item
{
u8 flags;
u8 quantity;
u8 id;
/* 0x0 */ u8 flags;
/* 0x1 */ u8 quantity;
/* 0x2 */ u8 id;
};

struct BulkItem {
u8 id;
u8 quantity;
// size: 0x4
struct BulkItem
{
/* 0x0 */ u8 id;
/* 0x1 */ u8 quantity;
};

// size: 0x4
struct Gummi
{
s16 boostAmount;
u16 flags;
/* 0x0 */ s16 boostAmount;
/* 0x2 */ u16 flags;
};

// size: 0xC
struct unkStruct_8090F58
{
u32 unk0;
Expand Down
107 changes: 56 additions & 51 deletions include/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,115 +10,118 @@
#define OFFENSE_NRM 0
#define OFFENSE_SP 1

struct Offense {
/* 0x18: att */
/* 0x19: spatt */
/* 0x1a: def */
/* 0x1b: spdef */

u8 att[2];
u8 def[2];
// size: 0x4
struct Offense
{
/* 0x0 */ u8 att[2]; // Atk, SpAtk
/* 0x2 */ u8 def[2]; // Def, SpDef
};

// size: 0x4
struct unkPokeSubStruct_C
{
u8 unk0;
u8 fill1[3];
};

// size: 0x58
struct PokemonStruct
{
// size: 0x58
/* 0x0 */ u16 unk0; // recruited??
u16 unk0; // recruited??
/* 0x2 */ bool8 isTeamLeader;
/* 0x3 */ u8 unkHasNextStage; // set to a random value?
/* 0x4 */ struct DungeonLocation dungeonLocation;
/* 0x8 */ s16 speciesNum; // species #
/* 0xC */ struct unkPokeSubStruct_C unkC[2];
struct unkPokeSubStruct_C unkC[2];
/* 0x14 */ s16 IQ;
/* 0x16 */ u16 pokeHP; // HP
/* 0x16 */ u16 pokeHP;
/* 0x18 */ struct Offense offense;
/* 0x1C */ u32 unk1C;
u32 unk1C;
/* 0x20 */ u32 IQSkills;
/* 0x24 */ u8 unk24;
/* 0x25 */ u8 fill25[3];
u8 unk24;
u8 fill25[3];
/* 0x28 */ struct BulkItem heldItem;
/* 0x2C */ struct Move moves[MAX_MON_MOVES];
/* 0x4C */ u8 name[POKEMON_NAME_LENGTH];
};


// size: 0x4
struct unkStruct_808E6F4
{
s16 unk0;
u8 unk2;
};

// size: 0x4
struct EvolveStage
{
s16 speciesNum;
u8 unkHasNextStage;
/* 0x0 */ s16 speciesNum;
/* 0x2 */ u8 unkHasNextStage;
};


// size: 0x24
struct unkStruct_8094184
{
struct Move moves[MAX_MON_MOVES];
/* 0x0 */ struct Move moves[MAX_MON_MOVES];
u8 unk20;
};

// size: 0x64
struct PokemonStruct2
{
// size 0x68
/* 0x0 */ u16 unk0; // corresponds to unk0 inPokemonStruct
u16 unk0; // corresponds to unk0 in PokemonStruct
/* 0x2 */ bool8 isTeamLeader; // unk2
/* 0x3 */ u8 unkHasNextStage; // unk3
/* 0x4 */ struct DungeonLocation dungeonLocation; // unk4
/* 0x8 */ u16 IQ; // IQ (other offset)
/* 0xA */ s16 unkA;
/* 0xC */ u16 unkC;
s16 unkA;
u16 unkC;
/* 0xE */ s16 speciesNum; // speciesNum (other offset)
/* 0x10 */ u16 unk10; // pokeHP
/* 0x12 */ u16 unk12; // pokeHP
u16 unk10; // pokeHP
u16 unk12; // pokeHP
/* 0x14 */ struct Offense offense; // offense (other offset)
/* 0x18 */ u32 unk18; // unk1C
u32 unk18; // unk1C
/* 0x1C */ struct unkStruct_8094184 moves;
/* 0x40 */ struct Item itemSlot; // heldItem
/* 0x44 */ u32 unk44; // some struct
/* 0x48 */ u32 unk48; // some struct (same type as 44)
u32 unk44; // some struct
u32 unk48; // some struct (same type as 44)
/* 0x4C */ u32 IQSkills; // unk20
/* 0x50 */ u8 unk50; // unk24
/* 0x51 */ u8 fill51[3];
/* 0x54 */ struct unkStruct_808E6F4 unk54;
u8 unk50; // unk24
u8 fill51[3];
struct unkStruct_808E6F4 unk54;
/* 0x58 */ u8 name[POKEMON_NAME_LENGTH]; // name (other offset)
};

// size: 0x90E8
struct unkStruct_203B45C
{
/* 0x0 */ struct PokemonStruct pokemon[NUM_MONSTERS];
/* 0x8DF8 */ struct PokemonStruct2 pokemon2[4];
/* 0x8F88 */ struct PokemonStruct team[MAX_TEAM_MEMBERS];
};

// size: 0x4
struct PreEvolution
{
/* 0x34 */ s16 evolveFrom;
/* 0x36 */ s16 evolveType;
/* 0x0 */ s16 evolveFrom;
/* 0x2 */ s16 evolveType;
};

// size: 0x4
struct EvolutionRequirements
{
/* 0x38 */ u16 mainRequirement;
/* 0x3A */ u16 additionalRequirement;
/* 0x0 */ u16 mainRequirement;
/* 0x2 */ u16 additionalRequirement;
};

// size: 0x8
struct unkEvolve
{
/* 0x0 */ struct PreEvolution preEvolution;
/* 0x4 */ struct EvolutionRequirements evolutionRequirements;
};


// size: 0x48
struct MonsterDataEntry
{
/* 0x0 */ u8* species;
Expand All @@ -127,13 +130,13 @@ struct MonsterDataEntry
/* 0x9 */ u8 bodySize;
/* 0xC */ s32 movementSpeed;
/* 0x10 */ u16 dialogueSprites; // Bitwise flags for whether a dialogue sprite/portrait is available for each emotion.
/* 0x12 */ bool8 unk12;
bool8 unk12;
/* 0x13 */ u8 types[2];
/* 0x15 */ u8 movementType;
/* 0x16 */ u8 friendArea;
/* 0x17 */ u8 abilities[2];
/* 0x19 */ u8 shadowSize;
/* 0x1A */ u8 fill1A; // 0 for all Pokémon.
u8 fill1A; // 0 for all Pokémon.
/* 0x1B */ u8 regenSpeed; // 100 for all Pokémon.
/* 0x1C */ bool8 canMove; // Set to false for Pokémon who don't move unless they're the leader, like Kakuna.
/* 0x1D */ u8 chanceAsleep;
Expand All @@ -143,9 +146,9 @@ struct MonsterDataEntry
/* 0x28 */ u16 baseDefSpDef[2];
/* 0x2C */ u16 weight;
/* 0x2E */ u16 size;
/* 0x30 */ u8 unk30; // 10 for all Pokémon.
/* 0x31 */ u8 unk31; // 10 for all Pokémon.
/* 0x32 */ u8 unk32; // 24 for all Pokémon.
u8 unk30; // 10 for all Pokémon.
u8 unk31; // 10 for all Pokémon.
u8 unk32; // 24 for all Pokémon.
/* 0x33 */ bool8 toolboxEnabled; // If false, the AI can't use items. Doesn't seem to be used, as it's true for all Pokémon.
/* 0x34 */ struct PreEvolution preEvolution;
/* 0x38 */ struct EvolutionRequirements evolutionRequirements;
Expand All @@ -155,25 +158,27 @@ struct MonsterDataEntry
};


// https://www.pokecommunity.com/showthread.php?t=407371
// size: 0xC | https://www.pokecommunity.com/showthread.php?t=407371
struct LevelData
{
s32 expRequired;
u8 gainHP;
u8 gainUnused;
u8 gainAtt;
u8 gainSPAtt;
u8 gainDef;
u8 gainSPDef;
/* 0x0 */ s32 expRequired;
/* 0x4 */ u8 gainHP;
/* 0x5 */ u8 gainUnused;
/* 0x6 */ u8 gainAtt;
/* 0x7 */ u8 gainSPAtt;
/* 0x8 */ u8 gainDef;
/* 0x9 */ u8 gainSPDef;
u16 fillA;
};

// size: 0x1A4
struct unkStruct_808E218_arg
{
u16 unk0[NUM_MONSTERS];
u32 count;
/* 0x1A0 */ u32 count;
};

// size: 0xC
struct unkStruct_808E218
{
// leveldata? (same size)
Expand Down
9 changes: 7 additions & 2 deletions include/text.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef GUARD_TEXT_H
#define GUARD_TEXT_H

struct UnkTextStruct1 {
// size: 0x48
struct UnkTextStruct1
{
s16 unk0;
s16 unk2;
s16 unk04;
Expand All @@ -13,6 +15,7 @@ struct UnkTextStruct1 {
u8 unk46;
};

// size: 0x4
struct UnkTextStruct2_sub
{
u8 unk0;
Expand All @@ -21,7 +24,9 @@ struct UnkTextStruct2_sub
u8 unk3;
};

struct UnkTextStruct2 {
// size: 0x18
struct UnkTextStruct2
{
u8 fill00[0x04];
s32 unk4;
struct UnkTextStruct2_sub unk08;
Expand Down
Loading

0 comments on commit c8f46ac

Please sign in to comment.