mirror of
https://github.com/pret/pmd-red.git
synced 2026-10-08 17:51:01 -04:00
Dungeon pokemon/Floor ID JSON Part 1 (#39)
* move Thunderwave and Tiny Woods pokemon to json * rule tweaking to actually build tool before parsing JSON * delete .inc pokemon for tiny Woods and Thunderwave * silence git complaining about br_ips and ips_patch * use defines for species and pass the header file for species * convert sinister woods * convert MtThunderPeak * convert silent chasm * add trial floor_id w/ tiny woods * change make rule name to fix compile * MtSteel converted and bugfix * convert few floor headers and great canyon pokemon * code cleanup * unify unkData into UnkTextStruct2 * more code cleanup and some text decomp * doc more funcs and decomp/split some stuff * document more save stuff * more save work and move some data * pika sniped UpdateNatureTotal * decomp a litle and convert a few more dungeons * better scanning for json files * mt freeze and peak
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#ifndef GUARD_DEBUG_MENU_H
|
||||
#define GUARD_DEBUG_MENU_H
|
||||
|
||||
#include "text.h"
|
||||
|
||||
enum DebugMenuOptions
|
||||
{
|
||||
MENU_DEBUG_MENU_DUNGEONS = 0,
|
||||
@@ -13,17 +15,11 @@ enum DebugMenuOptions
|
||||
MENU_DEBUG_MENU_H_OPEN = 9,
|
||||
};
|
||||
|
||||
struct unkData
|
||||
{
|
||||
u8 unk0[24];
|
||||
};
|
||||
|
||||
|
||||
struct DebugMenu
|
||||
{
|
||||
// size: 0x1A4
|
||||
u8 fill0[0x140];
|
||||
/* 0x140 */ struct unkData unk140[4];
|
||||
/* 0x140 */ struct UnkTextStruct2 unk140[4];
|
||||
u32 fill1A0;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
struct ExclusivePokemon
|
||||
{
|
||||
u16 poke_id;
|
||||
s16 poke_id;
|
||||
bool8 in_rrt; // red rescue team
|
||||
bool8 in_brt; // blue rescue team
|
||||
};
|
||||
|
||||
@@ -2,11 +2,7 @@
|
||||
#define FELICITY_BANK_H
|
||||
|
||||
#include "file_system.h"
|
||||
|
||||
struct unkData
|
||||
{
|
||||
u8 unk0[24];
|
||||
};
|
||||
#include "text.h"
|
||||
|
||||
struct unkStruct_203B204
|
||||
{
|
||||
@@ -30,7 +26,7 @@ struct unkStruct_203B204
|
||||
u8 unkA2;
|
||||
u8 unkA3;
|
||||
struct OpenedFile **unkA4;
|
||||
struct unkData unkA8[4];
|
||||
struct UnkTextStruct2 unkA8[4];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ struct FriendAreaSettings
|
||||
};
|
||||
|
||||
void LoadFriendAreas(void);
|
||||
u8 *GetBoughtFriendAreas(void);
|
||||
bool8 *GetBoughtFriendAreas(void);
|
||||
void InitializeFriendAreas(void);
|
||||
u8 sub_80923D4(s32 target);
|
||||
bool8 HasAllFriendAreas(void);
|
||||
@@ -20,5 +20,7 @@ u8 GetFriendAreaUnlockCondition(u8 index);
|
||||
u32 GetFriendAreaPrice(u8 index);
|
||||
const char *GetFriendAreaName(u8 index);
|
||||
|
||||
u32 SaveFriendAreas(u8 *r0, u32 r1);
|
||||
u32 ReadSavedFriendAreas(u8 *r0, s32 r1);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#ifndef FRIEND_AREA_ACTION_MENU_H
|
||||
#define FRIEND_AREA_ACTION_MENU_H
|
||||
|
||||
struct unkSubStruct_203B2BC
|
||||
{
|
||||
u8 fill0[0x2C];
|
||||
u32 unk2C;
|
||||
};
|
||||
|
||||
|
||||
struct unkStruct_203B2BC
|
||||
{
|
||||
// size: 0x1E0
|
||||
u32 state;
|
||||
u32 unk4;
|
||||
s16 unk8;
|
||||
u16 unkA;
|
||||
u32 unkC;
|
||||
u8 unk10;
|
||||
u8 unk11;
|
||||
u8 unk12;
|
||||
u8 unk13;
|
||||
u8 unk14;
|
||||
u8 fill15[3];
|
||||
struct unkSubStruct_203B2BC *unk18;
|
||||
u32 unk1C;
|
||||
u32 unk20;
|
||||
u32 unk24;
|
||||
u32 unk28;
|
||||
u8 fill2C[0x68 - 0x2C];
|
||||
u32 unk68;
|
||||
u32 unk6C;
|
||||
u32 unk70;
|
||||
s32 unk74;
|
||||
u32 unk78;
|
||||
u32 unk7C;
|
||||
u8 fill80[0xFD - 0x80];
|
||||
u32 unkFD;
|
||||
u8 fill101[0x11C - 0x104];
|
||||
struct MenuItem menuItems[4];
|
||||
u8 fill120[0x16C - 0x13C];
|
||||
|
||||
// Structure of some sort
|
||||
u32 unk16C;
|
||||
u8 fill170[0x180 - 0x170];
|
||||
|
||||
struct UnkTextStruct2 unk180[4];
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -55,4 +55,19 @@ enum ItemCategory
|
||||
ITEM_CATEGORY_ORBS
|
||||
};
|
||||
|
||||
void LoadItemParameters(void);
|
||||
struct unkStruct_203B460 *GetMoneyItemsInfo(void);
|
||||
void InitializeMoneyItems(void);
|
||||
u8 GetItemType(u8 index);
|
||||
s32 GetItemBuyPrice(u8 itemIndex);
|
||||
s32 GetItemSellPrice(u8 itemIndex);
|
||||
u8 GetItemOrder(u8 itemIndex);
|
||||
u8 GetItemPalette(u8 itemIndex);
|
||||
u8 GetItemCategory(u8 itemIndex);
|
||||
u32 GetItemUnkThrow(u8 itemIndex, u32 r1);
|
||||
u8 *GetItemDescription(u8 itemIndex);
|
||||
u32 GetItemUnkFood(u8 itemIndex, u32 r1);
|
||||
s32 sub_8090A34(void);
|
||||
bool8 sub_8090A60(u8 itemIndex);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
#ifndef KANGASKHAN_STORAGE_H
|
||||
#define KANGASKHAN_STORAGE_H
|
||||
|
||||
struct unkData
|
||||
{
|
||||
u8 unk0[20];
|
||||
u8 *array;
|
||||
};
|
||||
#include "text.h"
|
||||
|
||||
struct unkStruct_203B208
|
||||
{
|
||||
@@ -13,13 +9,16 @@ struct unkStruct_203B208
|
||||
u32 unk0;
|
||||
u32 currState;
|
||||
u32 unk8;
|
||||
u32 unkC;
|
||||
u16 unkC;
|
||||
u8 itemIndex;
|
||||
u8 unkF;
|
||||
u32 unk10;
|
||||
u32 unk14;
|
||||
u32 unk18;
|
||||
u32 unk1C;
|
||||
u32 unk20;
|
||||
u8 fill24[0x58 - 0x24];
|
||||
u8 fill24[0x4C - 0x24];
|
||||
u16 unk4C[5];
|
||||
u32 unk58;
|
||||
u8 unk5C[0xA8 - 0x5C];
|
||||
u32 unkA8;
|
||||
@@ -35,7 +34,7 @@ struct unkStruct_203B208
|
||||
u8 unkE6;
|
||||
u8 unkE7;
|
||||
struct OpenedFile **unkE8;
|
||||
struct unkData unkEC[4];
|
||||
struct UnkTextStruct2 unkEC[4];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,11 +2,7 @@
|
||||
#define KECLEON_ITEMS_H
|
||||
|
||||
#include "gUnknown_203B460.h"
|
||||
|
||||
struct unkData
|
||||
{
|
||||
u8 unk0[24];
|
||||
};
|
||||
#include "text.h"
|
||||
|
||||
struct unkStruct_203B210
|
||||
{
|
||||
@@ -37,7 +33,7 @@ struct unkStruct_203B210
|
||||
u8 unkE2;
|
||||
u8 unkE3;
|
||||
struct OpenedFile **unkE4;
|
||||
struct unkData unkE8[4];
|
||||
struct UnkTextStruct2 unkE8[4];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+14
-18
@@ -2,12 +2,7 @@
|
||||
#define GUARD_PERSONALITY_TEST_H
|
||||
|
||||
#include "constants/personality_test.h"
|
||||
|
||||
struct unkData
|
||||
{
|
||||
s16 unk0[10];
|
||||
u8 *unk14;
|
||||
};
|
||||
#include "text.h"
|
||||
|
||||
// Definitely wrong but need to figure out better structure later
|
||||
struct FaceData
|
||||
@@ -15,8 +10,18 @@ struct FaceData
|
||||
/* 0x0 */ u8 *unk0[5];
|
||||
};
|
||||
|
||||
struct PersonalityAnswer
|
||||
{
|
||||
const char * text;
|
||||
int effect;
|
||||
};
|
||||
|
||||
extern const struct unkData gUnknown_80F4244;
|
||||
struct PersonalityQuestion
|
||||
{
|
||||
const char * question;
|
||||
const struct PersonalityAnswer * answers;
|
||||
const u8 (*effects);
|
||||
};
|
||||
|
||||
struct PersonalityStruct_203B400
|
||||
{
|
||||
@@ -39,21 +44,12 @@ struct PersonalityStruct_203B400
|
||||
};
|
||||
extern struct PersonalityStruct_203B400 *gUnknown_203B400;
|
||||
|
||||
struct PersonalitySubStruct
|
||||
{
|
||||
u8 unkb4;
|
||||
u8 unkb5;
|
||||
u8 unkb6;
|
||||
u8 unkb7;
|
||||
};
|
||||
|
||||
struct PersonalityStruct_203B404
|
||||
{
|
||||
// Size: 0xB8
|
||||
/* 0x0 */ s16 StarterID;
|
||||
/* 0x2 */ s16 PartnerArray[NUM_PARTNERS];
|
||||
u8 unk16;
|
||||
u8 unk17;
|
||||
/* 0x18 */ struct UnkInputStruct *unk18; // something menu related (seems to be some struct)
|
||||
u8 padding[0x30 - 0x1C];
|
||||
/* 0x30 */ s16 currPartnerSelection;
|
||||
@@ -62,8 +58,8 @@ struct PersonalityStruct_203B404
|
||||
/* 0x3A */ s16 numPartners;
|
||||
u8 padding3[0x4C - 0x3C];
|
||||
u32 unk4C;
|
||||
/* 0x50 */ struct unkData *unk50;
|
||||
/* 0x54 */ struct unkData unk54[4];
|
||||
/* 0x50 */ struct UnkTextStruct2 *unk50;
|
||||
/* 0x54 */ struct UnkTextStruct2 unk54[4];
|
||||
/* 0xB4 */ u8 unkb4[4];
|
||||
};
|
||||
extern struct PersonalityStruct_203B404 *gUnknown_203B404;
|
||||
|
||||
+7
-1
@@ -2,6 +2,7 @@
|
||||
#define POKEMON_H
|
||||
|
||||
#include "file_system.h"
|
||||
#include "constants/species.h"
|
||||
|
||||
struct PokemonStruct
|
||||
{
|
||||
@@ -49,7 +50,7 @@ struct PokemonStruct3
|
||||
|
||||
struct unkStruct_203B45C
|
||||
{
|
||||
struct PokemonStruct pokemon[0x19D];
|
||||
struct PokemonStruct pokemon[NUM_SPECIES];
|
||||
struct PokemonStruct2 pokemon2[4];
|
||||
struct PokemonStruct3 pokemon3[4];
|
||||
};
|
||||
@@ -111,6 +112,11 @@ struct gPokemon
|
||||
/* 0x42 */ s16 alphabetParent[2]; // alphabetNo and parentNo
|
||||
};
|
||||
|
||||
void LoadMonsterParameters(void);
|
||||
struct unkStruct_203B45C *GetRecruitedPokemon(void);
|
||||
void InitializeRecruitedPokemon(void);
|
||||
|
||||
|
||||
void CopySpeciesNametoBuffer(u8 * buffer, s16 index);
|
||||
void CopyYellowSpeciesNametoBuffer(u8 *buffer, s16 index);
|
||||
void CopyCyanSpeciesNametoBuffer(u8 *buffer, s16 index);
|
||||
|
||||
@@ -35,7 +35,7 @@ void AddToTeamRankPts(s32 newPts);
|
||||
u8 GetRescueTeamRank(void);
|
||||
const char *GetTeamRankString(u8 index);
|
||||
u8 sub_80921B8(void);
|
||||
u32 sub_80921C4(u8 *param_1,u32 param_2);
|
||||
u32 sub_809222C(u8 *param_1, u32 param_2);
|
||||
u32 SaveRescueTeamInfo(u8 *param_1,u32 param_2);
|
||||
u32 ReadRescueTeamInfo(u8 *param_1, u32 param_2);
|
||||
|
||||
#endif // RESCUE_TEAM_INFO_H
|
||||
|
||||
+31
-21
@@ -4,6 +4,8 @@
|
||||
#include "play_time.h"
|
||||
#include "exclusive_pokemon.h"
|
||||
#include "rescue_team_info.h"
|
||||
#include "pokemon.h"
|
||||
#include "item.h"
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -12,20 +14,28 @@ enum
|
||||
SAVE_FAILED
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
READ_SAVE_VALID,
|
||||
READ_SAVE_FAILED,
|
||||
READ_SAVE_CHECKSUM_ERROR
|
||||
};
|
||||
|
||||
|
||||
struct UnkStruct_sub_8011DAC {
|
||||
// size: 0x57D4
|
||||
u8 fill000[0x4];
|
||||
u8 unk004[0x400];
|
||||
u8 unk404[0x10];
|
||||
u8 unk404[0x10]; // has "POKE_DUNGEON__05"
|
||||
u32 unk414;
|
||||
u32 unk418;
|
||||
u32 unk41C;
|
||||
u32 unk420;
|
||||
u32 unk424;
|
||||
u32 RngState;
|
||||
u32 savedRecruitedPokemon;
|
||||
u32 unk428;
|
||||
u8 fill42C[0x4];
|
||||
u32 unk430;
|
||||
u32 unk434;
|
||||
u32 savedRescueTeamInfo;
|
||||
u32 savedFriendAreas;
|
||||
u32 unk43C;
|
||||
u32 unk440;
|
||||
@@ -35,8 +45,8 @@ struct UnkStruct_sub_8011DAC {
|
||||
|
||||
|
||||
struct UnkStruct_203B184 {
|
||||
/* 0x0 */ u32 *unk0;
|
||||
/* 0x4 */ u32 *recruitedPokemon;
|
||||
/* 0x0 */ struct unkStruct_203B460 *MoneyItems;
|
||||
/* 0x4 */ struct unkStruct_203B45C *recruitedPokemon;
|
||||
/* 0x8 */ u8 *unk8;
|
||||
/* 0xC */ u8 *unkC;
|
||||
/* 0x10 */ u32 *unk10;
|
||||
@@ -45,7 +55,7 @@ struct UnkStruct_203B184 {
|
||||
/* 0x1C */ struct RescueTeamData *RescueTeamInfo;
|
||||
/* 0x20 */ u32 unk20;
|
||||
/* 0x24 */ struct ExclusivePokemonData *ExclusivePokemon;
|
||||
/* 0x28 */ u8 *BoughtFriendAreas;
|
||||
/* 0x28 */ bool8 *BoughtFriendAreas;
|
||||
/* 0x2C */ u32 gameOptions;
|
||||
/* 0x30 */ struct PlayTimeStruct *playTime;
|
||||
u32 unk34;
|
||||
@@ -57,7 +67,7 @@ struct UnkStruct_203B184 {
|
||||
u8 *unk04C;
|
||||
u32 unk050;
|
||||
u32 unk054;
|
||||
u32 unk058;
|
||||
u32 RngState;
|
||||
};
|
||||
|
||||
u32 sub_8011C1C(void);
|
||||
@@ -72,19 +82,19 @@ bool8 IsSaveCorrupted(void);
|
||||
void sub_8012284(void);
|
||||
void sub_8012298(void);
|
||||
void sub_80122A8(void);
|
||||
void sub_8012468(void);
|
||||
u8 sub_8012484(void);
|
||||
void sub_8012558(void);
|
||||
void sub_8012574(s16 PokemonID);
|
||||
bool8 sub_8012600(void);
|
||||
u32 sub_8012744(void);
|
||||
void sub_8012750(void);
|
||||
u32 sub_80127A8(void);
|
||||
u8 sub_8012828(void);
|
||||
void sub_8012834(void);
|
||||
void sub_8012850(u8 *r0, u32 r1, u8 r2);
|
||||
u32 sub_80128B0(void);
|
||||
void sub_80129FC(void);
|
||||
void PrepareSavePakRead(void);
|
||||
bool8 ReadSavePak(void);
|
||||
void FinishReadSavePak(void);
|
||||
void PrepareSavePakWrite(s16 PokemonID);
|
||||
bool8 WriteSavePak(void);
|
||||
u32 GetSavePakStatus(void);
|
||||
void FinishWriteSavePak(void);
|
||||
bool8 ReadQuickSave(void);
|
||||
bool8 IsQuickSaveValid(void);
|
||||
void FinishQuickSaveRead(void);
|
||||
void PrepareQuickSaveWrite(u8 *r0, u32 r1, u8 r2);
|
||||
u32 WriteQuickSave(void);
|
||||
void FinishQuickSaveWrite(void);
|
||||
|
||||
void sub_8012298();
|
||||
void sub_80122D0();
|
||||
|
||||
+4
-2
@@ -13,9 +13,10 @@ struct UnkTextStruct1 {
|
||||
struct UnkTextStruct2 {
|
||||
u8 fill00[0x0c];
|
||||
s16 unk0c;
|
||||
u8 fill0e[2];
|
||||
s16 unkE;
|
||||
s16 unk10;
|
||||
u8 fill12[0x06];
|
||||
s16 unk12;
|
||||
const u8 *unk14;
|
||||
};
|
||||
|
||||
void LoadCharmaps(void);
|
||||
@@ -26,4 +27,5 @@ void sub_800898C(void);
|
||||
void sub_80089AC(const struct UnkTextStruct2 *a0, void *a1);
|
||||
void sub_8009388(void);
|
||||
void sub_800641C(struct UnkTextStruct2 *a0, u8 a1, u8 a2);
|
||||
void sub_8006518(struct UnkTextStruct2 *);
|
||||
#endif
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
#ifndef GUARD_TRADE_ITEMS_MENU_H
|
||||
#define GUARD_TRADE_ITEMS_MENU_H
|
||||
|
||||
struct unkData
|
||||
{
|
||||
u8 unk0[24];
|
||||
};
|
||||
#include "text.h"
|
||||
|
||||
struct TradeSubStruct
|
||||
{
|
||||
@@ -28,7 +25,7 @@ struct TradeItemsMenu
|
||||
u32 unk20;
|
||||
u32 unk24;
|
||||
u32 unk28;
|
||||
struct unkData *unk2C;
|
||||
struct UnkTextStruct2 *unk2C;
|
||||
u32 unk30;
|
||||
u32 unk34;
|
||||
u8 fill38[0x44 - 0x38];
|
||||
@@ -36,10 +33,8 @@ struct TradeItemsMenu
|
||||
u8 fill8[0x134 - 0x48];
|
||||
u32 unk134;
|
||||
u8 fill138[0x184 - 0x138];
|
||||
struct unkData unk184[3]; // guessing the size until I know
|
||||
u8 fill188[0x1E4 - 0x1CC];
|
||||
u32 unk1E4;
|
||||
u8 fill1E8[0x244 - 0x1E8];
|
||||
struct UnkTextStruct2 unk184[4];
|
||||
struct UnkTextStruct2 unk1E4[4];
|
||||
|
||||
// TODO These might be structs...
|
||||
struct TradeSubStruct unk244;
|
||||
|
||||
+14
-14
@@ -2,28 +2,31 @@
|
||||
#define GUARD_WONDER_MAIL_H
|
||||
|
||||
#include "file_system.h"
|
||||
#include "text.h"
|
||||
|
||||
#define PASSWORD_BUFFER_SIZE 0x36
|
||||
|
||||
|
||||
struct WonderMailStruct_203B2C0
|
||||
{
|
||||
// size: 0x548
|
||||
u32 unk0;
|
||||
u32 unk4;
|
||||
u8 unk8[0x36];
|
||||
u32 state;
|
||||
u8 passwordBuffer[PASSWORD_BUFFER_SIZE];
|
||||
u8 unk3E;
|
||||
u32 unk40;
|
||||
u32 linkError;
|
||||
u16 unk48[232];
|
||||
u8 unk218;
|
||||
u8 padding7[3];
|
||||
u32 unk21C;
|
||||
u8 padding[0x7C];
|
||||
u32 unk29C;
|
||||
u8 padding6[0x6C];
|
||||
u32 unk30C;
|
||||
u8 padding8[0x4C];
|
||||
u32 unk35C;
|
||||
u8 padding5[0x5C];
|
||||
u32 unk3BC;
|
||||
u8 padding4[0x60];
|
||||
struct UnkTextStruct2 unk35C[4];
|
||||
struct UnkTextStruct2 unk3BC[4];
|
||||
u32 unkfill; // unkStruct_41C?
|
||||
struct OpenedFile *faceFile;
|
||||
u8 *faceData;
|
||||
u16 unk428;
|
||||
@@ -51,10 +54,9 @@ struct unkStruct_41C
|
||||
struct WonderMailStruct_203B2C4
|
||||
{
|
||||
// size: 0x564
|
||||
u8 unk0;
|
||||
u8 padding[3];
|
||||
u8 state;
|
||||
u32 unk4; // wonder mail link status??
|
||||
u8 unk8[0x36]; // Probably a buffer for entry
|
||||
u8 passwordBuffer[PASSWORD_BUFFER_SIZE]; // Probably a buffer for entry
|
||||
u8 unk3E;
|
||||
u32 unk40;
|
||||
u32 linkError; // another link status
|
||||
@@ -64,10 +66,8 @@ struct WonderMailStruct_203B2C4
|
||||
u8 filler220[0x30C - 0x220];
|
||||
u32 unk30C;
|
||||
u8 filler310[0x35C - 0x310];
|
||||
u32 unk35C;
|
||||
u8 filler360[0x3BC - 0x360];
|
||||
u32 unk3BC;
|
||||
u8 filler3C0[0x41C - 0x3C0];
|
||||
struct UnkTextStruct2 unk35C[4];
|
||||
struct UnkTextStruct2 unk3BC[4];
|
||||
struct unkStruct_41C unk41C;
|
||||
/* 0x420 */ struct OpenedFile *faceFile;
|
||||
/* 0x424 */ u8 *faceData;
|
||||
|
||||
Reference in New Issue
Block a user