Merge pull request #454 from golemgalvanize/decompile_party_menu

Decompile party menu
This commit is contained in:
Diegoisawesome 2018-12-19 19:57:31 -06:00 committed by GitHub
commit 48d7c0a7a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 7324 additions and 18101 deletions

File diff suppressed because it is too large Load Diff

View File

@ -725,7 +725,7 @@ _080777B8:
b _08077B22
.pool
_080777E8:
bl sub_81B5D30
bl LoadHeldItemIcons
ldr r0, =gUnknown_0203229C
ldr r1, [r0]
adds r0, r1, 0
@ -1343,7 +1343,7 @@ _08077D80:
b _080780D8
.pool
_08077DB0:
bl sub_81B5D30
bl LoadHeldItemIcons
ldr r0, =gUnknown_0203229C
ldr r1, [r0]
adds r0, r1, 0

View File

@ -69,11 +69,11 @@ gUnknown_086156B8:: @ 86156B8
.align 2
gUnknown_086156C4:: @ 86156C4
.4byte sub_81B2658, 0x0d280b18, 0x08201420, 0x08081440, 0x08182526, 0x08182535, 0x03302318, 0x1040220c
.4byte BlitBitmapToPartyWindow_Default1, 0x0d280b18, 0x08201420, 0x08081440, 0x08182526, 0x08182535, 0x03302318, 0x1040220c
.align 2
gUnknown_086156E4:: @ 86156E4
.4byte sub_81B26BC, 0x0d280316, 0x08200c1e, 0x08080c3e, 0x08180c66, 0x08180c75, 0x03300a58, 0x1040044d
.4byte BlitBitmapToPartyWindow_Default2, 0x0d280316, 0x08200c1e, 0x08080c3e, 0x08180c66, 0x08180c75, 0x03300a58, 0x1040044d
.align 2
gUnknown_08615704:: @ 8615704

View File

@ -7,6 +7,20 @@ struct TrainerMoney
u8 value;
};
struct UnknownPokemonStruct4
{
/*0x00*/ u16 species;
/*0x02*/ u16 heldItem;
/*0x04*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
/*0x0F*/ u8 level;
/*0x10*/ u16 hp;
/*0x12*/ u16 maxhp;
/*0x14*/ u32 status;
/*0x18*/ u32 personality;
/*0x1C*/ u8 gender;
/*0x1D*/ u8 language;
};
#define TYPE_NAME_LENGTH 6
#define ABILITY_NAME_LENGTH 12
@ -70,6 +84,8 @@ void RunBattleScriptCommands_PopCallbacksStack(void);
void RunBattleScriptCommands(void);
bool8 TryRunFromBattle(u8 battlerId);
extern struct UnknownPokemonStruct4 gUnknown_02022FF8[3];
extern const u8 gTypeEffectiveness[336];
extern const u8 gTypeNames[][TYPE_NAME_LENGTH + 1];
extern const struct TrainerMoney gTrainerMoneyTable[];

View File

@ -432,6 +432,7 @@ bool8 Contest_IsMonsTurnDisabled(u8 a);
bool8 sub_80DE1E8(u8 a);
void SetStartledString(u8 a, u8 b);
s8 Contest_GetMoveExcitement(u16);
u8 sub_80DAE0C(struct Pokemon *);
void sub_80DEDA8(u8);
#endif //GUARD_CONTEST_H

View File

@ -1,6 +1,8 @@
#ifndef GUARD_EASYCHAT_H
#define GUARD_EASYCHAT_H
#include "main.h"
void InitEasyChatPhrases(void);
void easy_chat_input_maybe(void);
u8 * CopyEasyChatWord(u8 *dest, u16 word);
@ -12,5 +14,6 @@ u16 sub_811EE38(u16 group);
u16 sub_811F01C(void);
bool16 EasyChat_GetNumWordsInGroup(u8);
u16 sub_811EE90(u16);
void sub_811A20C(u8 kind, u16 *words, MainCallback callback, u8 sizeParam);
#endif // GUARD_EASYCHAT_H

7
include/fldeff_softboiled.h Executable file
View File

@ -0,0 +1,7 @@
#ifndef GUARD_FLDEFF_SOFTBOILED_H
#define GUARD_FLDEFF_SOFTBOILED_H
void sub_81615A8(u8 taskId);
void sub_8161560(u8 taskId);
#endif // GUARD_FLDEFF_SOFTBOILED_H

View File

@ -3911,6 +3911,11 @@ extern const u16 gIntro2BrendanNoTurnPal[];
extern const u16 gIntro2FlygonPal[];
extern const u32 gIntro2FlygonGfx[];
// party menu graphics
extern const u32 gPartyMenuMisc_Gfx[];
extern const u32 gPartyMenuMisc_Tilemap[];
extern const u8 gPartyMenuMisc_Pal[];
// berry pics
extern const u32 gBerryPic_Cheri[];
extern const u32 gBerryPalette_Cheri[];

View File

@ -77,5 +77,6 @@ void CB2_BagMenuFromStartMenu(void);
u8 GetItemListPosition(u8 pocketId);
bool8 UseRegisteredKeyItemOnField(void);
void CB2_GoToSellMenu(void);
void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *postExitMenuMainCallback2)());
#endif //GUARD_item_menu_H

View File

@ -2,6 +2,7 @@
#define GUARD_LINK_RFU_H
#include "librfu.h"
#include "link.h"
// Exported type declarations

View File

@ -91,5 +91,8 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo
void sub_8197AE8(bool8 copyToVram);
void sub_81997AC(u8 windowId, u8 a4, u8 a6, u8 a7, const struct MenuAction *strs);
s8 Menu_ProcessInputGridLayout(void);
u8 InitMenuInUpperLeftCorner(u8 windowId, u8 itemCount, u8 initialCursorPos, bool8 APressMuted);
s8 Menu_ProcessInputNoWrapAround_other(void);
void sub_8199CBC(u8 bgId, u16 *dest, u8 left, u8 top, u8 width, u8 height);
#endif // GUARD_MENU_H

View File

@ -1,6 +1,7 @@
#ifndef GUARD_PARTY_MENU_H
#define GUARD_PARTY_MENU_H
#include "main.h"
#include "task.h"
enum
@ -10,7 +11,9 @@ enum
AILMENT_PRZ,
AILMENT_SLP,
AILMENT_FRZ,
AILMENT_BRN
AILMENT_BRN,
AILMENT_PKRS,
AILMENT_FNT
};
enum
@ -23,18 +26,23 @@ enum
PARTY_GIVE_ITEM,
};
struct Struct203CEC8
{
u8 filler[0x9];
struct Struct203CEC8 {
MainCallback exitCallback;
TaskFunc unk4;
u8 unk8_0:4;
u8 mode:2;
u8 unk8_2:2;
s8 unk9;
s8 unkA;
u8 unkB;
u8 filler2[0x2];
u16 unkC;
s16 unkE;
s16 unk10;
};
extern struct Struct203CEC8 gUnknown_0203CEC8;
extern const u16 gUnknown_0861500C[];
extern const u16 gUnknown_0861500C[]; // tutor table
bool8 pokemon_has_move(struct Pokemon *, u16);
void sub_81B58A8(void);
@ -47,9 +55,9 @@ void sub_81B7F60(void);
void sub_81B0FCC(u8 partyIdx, u8 a);
void sub_81B1370(u8 taskId);
void display_pokemon_menu_message(u8 windowId);
void display_pokemon_menu_message(u32 windowId);
void sub_81B1F18(u8 taskId, u8 pokemonIdx, s8 a, s16 hp, TaskFunc func);
void sub_81B1B5C(void *a, u8 b);
u8 sub_81B1B5C(const u8 *a, u8 b);
u8 sub_81B1BD4(void);
void sub_81B8448(void);
void sub_81B8518(u8 unused);
@ -62,13 +70,13 @@ void sub_81B617C(void);
u8 sub_81B6D14(u16 a);
bool8 hm_add_c3_without_phase_2(void);
extern void dp05_ether(u8, u16, TaskFunc);
extern void dp05_pp_up(u8, u16, TaskFunc);
extern void dp05_rare_candy(u8, u16, TaskFunc);
extern void dp05_ether(u8, TaskFunc);
extern void dp05_pp_up(u8, TaskFunc);
extern void dp05_rare_candy(u8, TaskFunc);
extern void sub_81B67C8(u8, u16, TaskFunc);
extern void sub_81B79E8(u8, u16, TaskFunc);
extern void sub_81B6DC4(u8, u16, TaskFunc);
extern void sub_81B7C74(u8, u16, TaskFunc);
extern void sub_81B67C8(u8, TaskFunc);
extern void sub_81B79E8(u8, TaskFunc);
extern void sub_81B6DC4(u8, TaskFunc);
extern void sub_81B7C74(u8, TaskFunc);
#endif // GUARD_PARTY_MENU_H

View File

@ -84,5 +84,6 @@ extern const struct MenuAction gMailboxMailOptions[];
void ReshowPlayerPC(u8 taskId);
void sub_816B31C(void);
void Mailbox_ReturnToMailListAfterDeposit(void);
#endif //GUARD_PLAYER_PC_H

View File

@ -16,5 +16,7 @@ u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u
u8 UpdateMonIconFrame(struct Sprite *sprite);
void LoadMonIconPalette(u16 species);
void sub_80D328C(struct Sprite *sprite);
void sub_80D3014(struct Sprite *sprite);
void sub_80D32C8(struct Sprite *sprite, u8 animNum);
#endif // GUARD_POKEMON_ICON_H

View File

@ -84,5 +84,6 @@ u32 GetBoxMonDataFromAnyBox(u8 boxId, u8 monPosition, u32 request);
bool8 CheckFreePokemonStorageSpace(void);
u8 StorageGetCurrentBox(void);
u8 sub_80D214C(struct BoxPokemon *a, u8 b, u8 c, u8 d);
bool32 sub_80D23A8(u16 move);
#endif // GUARD_POKEMON_STORAGE_SYSTEM_H

View File

@ -1,9 +1,12 @@
#ifndef GUARD_POKEMON_SUMMARY_SCREEN_H
#define GUARD_POKEMON_SUMMARY_SCREEN_H
extern u8 gUnknown_0203CF20;
void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void));
void sub_81C4F98(u8, void(*)(void));
void ShowSelectMovePokemonSummaryScreen(struct Pokemon *, u8, u8, MainCallback, u16);
u8 sub_81C1B94(void);
// The Pokemon Summary Screen can operate in different modes. Certain features,
// such as move re-ordering, are available in the different modes.

View File

@ -36,5 +36,7 @@ u8 GetCurrentTrainerHillMapId(void);
u8 sub_81D6490(void);
const struct WarpEvent *sub_81D6120(void);
const struct WarpEvent *sub_81D6134(u8);
void sub_81D3640(u16 arg0, void* statStoreLocation1, void* statStoreLocation2, u8 arg3, u8 arg4, u8 arg5);
void sub_81D3784(u16 arg0, void* statStoreLocation1, u8 arg2, u8 arg3, u8 arg4);
#endif //GUARD_POKENAV_H

View File

@ -107,6 +107,7 @@ u8 *sub_8124610(u8 *dest, u16 mapSecId);
u16 CorrectSpecialMapSecId(u16 mapSecId);
void sub_8122D88(struct RegionMap *regionMap);
void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y);
void MCB2_FlyMap(void);
extern const struct RegionMapLocation gRegionMapEntries[];

View File

@ -5,11 +5,16 @@
// Exported RAM declarations
extern struct UnkLinkRfuStruct_02022B14Substruct gUnknown_02022C38;
extern u16 gUnknown_02022C3C;
extern u8 gUnknown_02022C3E;
// Exported ROM declarations
void sub_8018438(void);
u16 mevent_081445C0(u8);
void sub_801B990(u32, u32);
u8 sub_8013F78(void);
bool32 sub_802C908(u16);
#endif //GUARD_rom_8011DC0_H

View File

@ -399,6 +399,69 @@ extern const u8 gText_ThreeDashes[];
// party menu text
extern const u8 gText_PkmnHPRestoredByVar2[];
extern const u8 gText_CantBeUsedOnPkmn[];
extern const u8 gText_CancelParticipation[];
extern const u8 gText_PkmnWasGivenItem[];
extern const u8 gText_RecievedItemFromPkmn[];
extern const u8 gText_SwitchPkmnItem[];
extern const u8 gText_SwitchedPkmnItem[];
extern const u8 gText_BagFullCouldNotRemoveItem[];
extern const u8 gText_PkmnCantParticipate[];
extern const u8 gText_PkmnNotHolding[];
extern const u8 gText_ThrowAwayItem[];
extern const u8 gText_ItemThrownAway[];
extern const u8 gText_SendMailToPC[];
extern const u8 gText_MailSentToPC[];
extern const u8 gText_PCMailboxFull[];
extern const u8 gText_MailMessageWillBeLost[];
extern const u8 gText_MailTakenFromPkmn[];
extern const u8 gText_NoMoreThanVar1Pkmn[];
extern const u8 gText_PkmnCantBeTradedNow[];
extern const u8 gText_EggCantBeTradedNow[];
extern const u8 gText_OnlyPkmnForBattle[];
extern const u8 gJPText_PutVar1IntoSpinner[];
extern const u8 gText_PauseUntilPress[];
extern const u8 gText_CantUseUntilNewBadge[];
extern const u8 gText_ReturnToHealingSpot[];
extern const u8 gText_EscapeFromHere[];
extern const u8 gText_PkmnCuredOfPoison[];
extern const u8 gText_PkmnWokeUp2[];
extern const u8 gText_PkmnBurnHealed[];
extern const u8 gText_PkmnThawedOut[];
extern const u8 gText_PkmnCuredOfParalysis[];
extern const u8 gText_PkmnGotOverInfatuation[];
extern const u8 gText_PkmnBecameHealthy[];
extern const u8 gText_HP3[];
extern const u8 gText_SpAtk3[];
extern const u8 gText_SpDef3[];
extern const u8 gText_PkmnBaseVar2StatIncreased[];
extern const u8 gText_MovesPPIncreased[];
extern const u8 gText_PPWasRestored[];
extern const u8 gText_WontHaveEffect[];
extern const u8 gText_PkmnSnappedOutOfConfusion[];
extern const u8 gText_PkmnFriendlyBaseVar2Fell[];
extern const u8 gText_PkmnFriendlyBaseVar2CantFall[];
extern const u8 gText_PkmnAdoresBaseVar2Fell[];
extern const u8 gText_PkmnAlreadyKnows[];
extern const u8 gText_PkmnCantLearnMove[];
extern const u8 gText_PkmnNeedsToReplaceMove[];
extern const u8 gText_PkmnLearnedMove3[];
extern const u8 gText_WhichMoveToForget[];
extern const u8 gText_12PoofForgotMove[];
extern const u8 gText_StopLearningMove2[];
extern const u8 gText_MoveNotLearned[];
extern const u8 gText_PkmnElevatedToLvVar2[];
extern const u8 gText_RemoveMailBeforeItem[];
extern const u8 gText_PkmnHoldingItemCantHoldMail[];
extern const u8 gText_MailTransferredFromMailbox[];
extern const u8 gText_CancelBattle[];
extern const u8 gText_ReturnToWaitingRoom[];
extern const u8 gText_CancelChallenge[];
extern const u8 gText_CantSwitchWithAlly[];
extern const u8 gText_PkmnHasNoEnergy[];
extern const u8 gText_EggCantBattle[];
extern const u8 gText_PkmnAlreadySelected[];
extern const u8 gText_PkmnAlreadyInBattle[];
extern const u8 gText_PkmnCantSwitchOut[];
//pokedex text
extern const u8 gText_CryOf[];

View File

@ -1,6 +1,8 @@
#ifndef GUARD_TRADE_H
#define GUARD_TRADE_H
#include "link_rfu.h"
// Exported type declarations
// Exported RAM declarations
@ -10,5 +12,8 @@
s32 sub_807A728(void);
void sub_80773AC(void);
void sub_807AE50(void);
int sub_807A8D0(u32 /* probably wrong */, u16, u16, u8);
int sub_807A7E0(u32 /* probably wrong */, u32 /* probably wrong */, u16, u16, u16, u16, u8);
int sub_807A918(struct Pokemon*, u16);
#endif //GUARD_TRADE_H

View File

@ -277,7 +277,7 @@ SECTIONS {
src/dynamic_placeholder_text_util.o(.text);
src/save_location.o(.text);
src/item_icon.o(.text);
asm/party_menu.o(.text);
src/party_menu.o(.text);
src/battle_tent.o(.text);
src/unk_text_util_2.o(.text);
src/multiboot.o(.text);

View File

@ -4,6 +4,7 @@
#include "battle_arena.h"
#include "battle_controllers.h"
#include "battle_interface.h"
#include "battle_main.h"
#include "battle_message.h"
#include "battle_pyramid.h"
#include "battle_scripts.h"
@ -55,20 +56,6 @@
#include "constants/species.h"
#include "constants/trainers.h"
struct UnknownPokemonStruct4
{
/*0x00*/ u16 species;
/*0x02*/ u16 heldItem;
/*0x04*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
/*0x0F*/ u8 level;
/*0x10*/ u16 hp;
/*0x12*/ u16 maxhp;
/*0x14*/ u32 status;
/*0x18*/ u32 personality;
/*0x1C*/ u8 gender;
/*0x1D*/ u8 language;
};
extern struct MusicPlayerInfo gMPlayInfo_SE1;
extern struct MusicPlayerInfo gMPlayInfo_SE2;
extern u8 gUnknown_0203CF00[];

View File

@ -55,11 +55,11 @@ extern const u8* const gBattleScriptsForMoveEffects[];
extern void ShowSelectMovePokemonSummaryScreen(struct Pokemon* party, u8 monPartyId, u8 monCount, void (*callback)(void), u16 move); // pokemon summary screen
extern u8 sub_81C1B94(void); // pokemon summary screen
extern void sub_81D388C(struct Pokemon* mon, void* statStoreLocation); // pokenav.s
extern void sub_81D3640(u8 arg0, void* statStoreLocation1, void* statStoreLocation2, u8 arg3, u8 arg4, u8 arg5); // pokenav.s
extern void sub_81D3784(u8 arg0, void* statStoreLocation1, u8 arg2, u8 arg3, u8 arg4); // pokenav.s
extern void sub_81D3640(u16 arg0, void* statStoreLocation1, void* statStoreLocation2, u8 arg3, u8 arg4, u8 arg5); // pokenav.s
extern void sub_81D3784(u16 arg0, void* statStoreLocation1, u8 arg2, u8 arg3, u8 arg4); // pokenav.s
extern u8* GetMonNickname(struct Pokemon* mon, u8* dst); // party_menu
extern void sub_81B8E80(u8 battlerId, u8, u8); // party menu
extern bool8 sub_81B1250(void); // ?
extern bool8 IsMultiBattle(void); // ?
extern u8 sub_813B21C(void);
extern u16 get_unknown_box_id(void);
@ -7609,7 +7609,7 @@ static void atk8F_forcerandomswitch(void)
}
*(gBattleStruct->monToSwitchIntoId + gBattlerTarget) = i;
if (!sub_81B1250())
if (!IsMultiBattle())
sub_803BDA0(gBattlerTarget);
if ((gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)

View File

@ -103,7 +103,7 @@ static void sub_8161784(u8 taskId)
static void sub_81617B8(u8 taskId)
{
PlaySE(SE_SELECT);
sub_81B1B5C(&gText_CantBeUsedOnPkmn, 0);
sub_81B1B5C(gText_CantBeUsedOnPkmn, 0);
schedule_bg_copy_tilemap_to_vram(2);
gTasks[taskId].func = sub_8161784;
}

View File

@ -38,7 +38,7 @@
#include "constants/vars.h"
extern void(*gUnknown_0203A0F4)(u8 taskId);
extern void (*gUnknown_03006328)(u8, u16, TaskFunc);
extern void (*gUnknown_03006328)(u8, TaskFunc);
extern void unknown_ItemMenu_Confirm(u8 taskId);
extern void sub_81C5B14(u8 taskId);
extern void ScriptUnfreezeEventObjects(void);
@ -52,7 +52,7 @@ extern u8 BattleFrontier_OutsideEast_EventScript_242CFC[];
extern int sub_80247BC(void);
extern struct MapHeader* mapconnection_get_mapheader(struct MapConnection *connection);
extern void SetUpItemUseCallback(u8 taskId);
extern void ItemUseCB_Medicine(u8, u16, TaskFunc);
extern void ItemUseCB_Medicine(u8, TaskFunc);
extern void bag_menu_yes_no(u8, u8, const struct YesNoFuncTable*);
extern void sub_81C5924(void);
extern void sub_81C59BC(void);

7164
src/party_menu.c Executable file

File diff suppressed because it is too large Load Diff

View File

@ -129,7 +129,7 @@ struct UnkStruct_61CC04
};
// forward declarations
bool8 sub_81B1250(void);
bool8 IsMultiBattle(void);
static bool8 SummaryScreen_LoadGraphics(void);
static void SummaryScreen_LoadingCB2(void);
static void InitBGs(void);
@ -1500,7 +1500,7 @@ static void sub_81C0604(u8 taskId, s8 a)
}
r4_2 = sub_80D214C(pssData->monList.boxMons, pssData->curMonIndex, pssData->maxMonIndex, a);
}
else if (sub_81B1250() == 1)
else if (IsMultiBattle() == TRUE)
{
r4_2 = sub_81C09B4(a);
}
@ -3254,7 +3254,7 @@ static void PrintHeldItemName(void)
const u8 *text;
int offset;
if (pssData->summary.item == ITEM_ENIGMA_BERRY && sub_81B1250() == TRUE && (pssData->curMonIndex == 1 || pssData->curMonIndex == 4 || pssData->curMonIndex == 5))
if (pssData->summary.item == ITEM_ENIGMA_BERRY && IsMultiBattle() == TRUE && (pssData->curMonIndex == 1 || pssData->curMonIndex == 4 || pssData->curMonIndex == 5))
{
text = ItemId_GetName(ITEM_ENIGMA_BERRY);
}

View File

@ -362,49 +362,7 @@ gUnknown_0203CD88: @ 203CD88
.include "src/list_menu.o"
.include "src/dynamic_placeholder_text_util.o"
.include "src/item_icon.o"
gUnknown_0203CEC4: @ 203CEC4
.space 0x4
gUnknown_0203CEC8: @ 203CEC8
.space 0xE
gUnknown_0203CED6: @ 203CED6
.space 0x6
gUnknown_0203CEDC: @ 203CEDC
.space 0x4
gUnknown_0203CEE0: @ 203CEE0
.space 0x4
gUnknown_0203CEE4: @ 203CEE4
.space 0x4
gUnknown_0203CEE8: @ 203CEE8
.space 0x1
gUnknown_0203CEE9: @ 203CEE9
.space 0x3
gPostMenuFieldCallback: @ 203CEEC
.space 0x4
gUnknown_0203CEF0: @ 203CEF0
.space 0x4
gUnknown_0203CEF4: @ 203CEF4
.space 0x4
gSelectedOrderFromParty: @ 203CEF8
.space 0x4
gUnknown_0203CEFC: @ 203CEFC
.space 0x4
gUnknown_0203CF00: @ 203CF00
.space 0x4
.include "src/party_menu.o"
.include "src/fossil_specials.o"
.include "src/fldeff_groundshake.o"
.include "src/pokemon_summary_screen.o"