Merge pull request #424 from DizzyEggg/decompile_pokemon_menu

decompile pokemon menu
This commit is contained in:
Cameron Hall 2017-09-08 19:11:14 -05:00 committed by GitHub
commit 4e64934d5f
17 changed files with 1283 additions and 3581 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
gLastFieldPokeMenuOpened
gUnknown_03005CE4

View File

@ -1,82 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gPokemonMenuActions:: @ 839F494
.4byte OtherText_Summary, PokemonMenu_Summary
.4byte OtherText_Switch2, PokemonMenu_Switch
.4byte OtherText_Item, PokemonMenu_Item
.4byte gOtherText_CancelNoTerminator, PokemonMenu_Cancel
.4byte OtherText_Give2, PokemonMenu_GiveItem
.4byte OtherText_Take2, PokemonMenu_TakeItem
.4byte OtherText_Take, PokemonMenu_TakeMail
.4byte OtherText_Mail, PokemonMenu_Mail
.4byte OtherText_Read2, PokemonMenu_ReadMail
.4byte gOtherText_CancelNoTerminator, PokemonMenu_CancelSubmenu
.4byte gMoveNames + 13 * MOVE_CUT, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_FLASH, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_ROCK_SMASH, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_STRENGTH, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_SURF, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_FLY, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_DIVE, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_WATERFALL, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_TELEPORT, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_DIG, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_SECRET_POWER, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_MILK_DRINK, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_SOFT_BOILED, PokemonMenu_FieldMove
.4byte gMoveNames + 13 * MOVE_SWEET_SCENT, PokemonMenu_FieldMove
.align 1
gUnknown_0839F554:: @ 839F554
.2byte MOVE_CUT
.2byte MOVE_FLASH
.2byte MOVE_ROCK_SMASH
.2byte MOVE_STRENGTH
.2byte MOVE_SURF
.2byte MOVE_FLY
.2byte MOVE_DIVE
.2byte MOVE_WATERFALL
.2byte MOVE_TELEPORT
.2byte MOVE_DIG
.2byte MOVE_SECRET_POWER
.2byte MOVE_MILK_DRINK
.2byte MOVE_SOFT_BOILED
.2byte MOVE_SWEET_SCENT
.2byte 0xFF
Unknown_39F572: @ 839F572
.byte 4, 5, 9, 0
.align 2
gUnknown_0839F578:: @ 839F578
.byte 3, 6, 0, 0
.4byte Unknown_39F572
Unknown_39F580: @ 839F580
.byte 8, 6, 9, 0
.align 2
gUnknown_0839F584:: @ 839F584
.byte 3, 9, 0, 0
.4byte Unknown_39F580
.align 2
gFieldMoveFuncs:: @ 839F58C
.4byte SetUpFieldMove_Cut, 0x6
.4byte SetUpFieldMove_Flash, 0x9
.4byte SetUpFieldMove_RockSmash, 0x9
.4byte SetUpFieldMove_Strength, 0x9
.4byte SetUpFieldMove_Surf, 0x7
.4byte SetUpFieldMove_Fly, 0x9
.4byte SetUpFieldMove_Dive, 0x9
.4byte SetUpFieldMove_Waterfall, 0x9
.4byte SetUpFieldMove_Teleport, 0x9
.4byte SetUpFieldMove_Dig, 0x9
.4byte SetUpFieldMove_SecretPower, 0x9
.4byte SetUpFieldMove_SoftBoiled, 0x10
.4byte SetUpFieldMove_SoftBoiled, 0x10
.4byte SetUpFieldMove_SweetScent, 0x9

View File

@ -2,6 +2,7 @@
#define GUARD_BRAILLEPUZZLES_H
bool8 ShouldDoBrailleStrengthEffect(void);
bool8 ShouldDoBrailleFlyEffect(void);
void DoBrailleStrengthEffect(void);
void UseFlyAncientTomb_Callback(void);
void UseFlyAncientTomb_Finish(void);
@ -10,5 +11,6 @@ bool32 BrailleWait_CheckButtonPress(void);
void SealedChamberShakingEffect(u8 taskId);
bool8 ShouldDoBrailleDigEffect(void);
void DoBrailleDigEffect(void);
void DoBrailleFlyEffect(void);
#endif

View File

@ -44,7 +44,7 @@ extern u8 gEnemyMonElevation[];
extern const u8 gTrainerClassNames[][13];
extern const struct Trainer gTrainers[];
extern u8 gSpeciesNames[][11];
extern u8 gMoveNames[][13];
extern const u8 gMoveNames[][13];
extern const u8 gAbilityNames[][13];
extern const u8 gTypeNames[][7];
extern const struct UnknownStructD2 gUnknown_081F9674;

View File

@ -49,5 +49,6 @@ void ItemUseInBattle_Escape(u8);
void ItemUseOutOfBattle_EnigmaBerry(u8);
void ItemUseInBattle_EnigmaBerry(u8);
void ItemUseOutOfBattle_CannotUse(u8);
u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId);
#endif // GUARD_ITEM_USE_H

View File

@ -59,7 +59,7 @@ void sub_807274C(u8, u8, u8, u8, const struct MenuAction[], u8, u32);
s8 sub_80727CC(void);
u8 sub_807288C(u8);
void PrintMenuItems(u8, u8, u8, const struct MenuAction[]);
void PrintMenuItemsReordered(u8, u8, u8, const struct MenuAction[], const u8*);
void PrintMenuItemsReordered(u8 left, u8 top, u8 menuItemCount, const struct MenuAction menuItems[], const u8 *order);
void InitYesNoMenu(u8, u8, u8);
void DisplayYesNoMenu(u8, u8, u32);
s8 ProcessMenuInputNoWrap_(void);

View File

@ -53,38 +53,55 @@ struct Struct201B000
u16 unk282;
};
struct Unk2001000
{
u8 unk0;
u8 unk1;
u8 unk2;
u8 unk3;
u8 unk4;
u8 unk5;
u8 unk6;
u8 unk7;
u8 unk8;
u8 unk9;
u8 unkA;
u8 unkB;
void* unkC;
u16 array[53561];
};
extern u8 ewram[];
#define ewram01000 (*(struct Unk2001000 *)(ewram + 0x01000))
#define ewram1B000 (*(struct Unk201B000 *)(ewram + 0x1B000))
#define ewram1B000_alt (*(struct Struct201B000 *)(ewram + 0x1B000))
#define EWRAM_1B000 ewram1B000_alt
void sub_806AEDC(void);
void sub_806AF4C();
void sub_806AF4C(u8 arg0, u8 arg1, void* arg2, u8 arg3);
void OpenPartyMenu(u8, u8);
void OpenPartyMenu();
u8 sub_806B124(void);
bool8 sub_806B124(void);
u8 IsLinkDoubleBattle(void);
u8 sub_806B58C(u8);
u8 sub_806B58C(u8);
void sub_806BC3C(u8, u8);
u8 sub_806BD58(u8, u8);
u8 sub_806BD58(u8, u8);
u16 sub_806BD80(); // undefined args in battle_party_menu.c
u16 sub_806BD80(u8);
void task_pc_turn_off();
void sub_806BF74();
void sub_806C994();
u8 sub_806CA38(u8);
void sub_806BF74(u8 arg0, u8 arg1);
void sub_806C994(u8 arg0, u8 arg1);
u8 sub_806CA38(u8 taskID);
void sub_806CB74(u8 taskId);
void sub_806CCE4(void);
void sub_806CD44(u8 taskId);
void sub_806D538();
void sub_806D538();
void sub_806D538();
void sub_806D538(u8 arg0, u8 arg1);
void sub_806D5A4(void);
void SetMonIconAnim();
void TryCreatePartyMenuMonIcon(u8, u8, struct Pokemon *);
void LoadHeldItemIconGraphics(void);
void LoadHeldItemIconGraphics(void);
void PartyMenuTryGiveMonHeldItem(u8 taskId, u16 newItem, TaskFunc c);
void CreateHeldItemIcons_806DC34(); // undefined args
void CreateHeldItemIcons_806DC34();
u8 GetMonIconSpriteId_maybe();
@ -151,5 +168,13 @@ void DoRareCandyItemEffect(u8, u16, TaskFunc);
void Task_RareCandy1(u8);
void Task_RareCandy2(u8);
void sub_8070848(u8 taskId);
void sub_806CA60(u8 taskId);
void sub_806CD5C(u8 taskId);
void DoTakeMail(u8 taskId, TaskFunc func);
void PartyMenuTryGiveMonHeldItem_806ECE8(u8 taskId, TaskFunc func);
void PartyMenuTryGiveMonMail(u8 taskId, TaskFunc func);
void sub_806D668(u8 partyID);
void TaughtMove(u8 taskId);
void StopTryingToTeachMove_806F588(u8 taskId);
#endif // GUARD_PARTY_MENU_H

View File

@ -1,15 +1,47 @@
#ifndef GUARD_POKEMON_MENU_H
#define GUARD_POKEMON_MENU_H
#define POKEMENU_FIRST_FIELD_MOVE_ID 10
enum
{
POKEMENU_SUMMARY, // 0
POKEMENU_SWITCH, // 1
POKEMENU_ITEM, // 2
POKEMENU_CANCEL, // 3
POKEMENU_GIVE_ITEM, // 4
POKEMENU_TAKE_ITEM, // 5
POKEMENU_TAKE_MAIL, // 6
POKEMENU_MAIL, // 7
POKEMENU_READ_MAIL, // 8
POKEMENU_CANCEL_SUBMENU, // 9
POKEMENU_CUT, // 10
POKEMENU_FLASH, // 11
POKEMENU_ROCK_SMASH, // 12
POKEMENU_STRENGTH, // 13
POKEMENU_SURF, // 14
POKEMENU_FLY, // 15
POKEMENU_DIVE, // 16
POKEMENU_WATERFALL, // 17
POKEMENU_TELEPORT, // 18
POKEMENU_DIG, // 19
POKEMENU_SECRET_POWER, // 20
POKEMENU_MILK_DRINK, // 21
POKEMENU_SOFT_BOILED, // 22
POKEMENU_SWEET_SCENT, // 23
};
extern u8 gLastFieldPokeMenuOpened;
extern void (*gUnknown_03005CE4)(void);
void sub_808B5B4(u32 taskID);
void sub_8089A70(void);
void sub_808A004();
void sub_808AB90(void);
void sub_808AB90(void); // unknown args
void sub_808A004(u8 taskID);
void sub_808AB90(void);
void sub_808AD58(void);
void sub_808B020(void);
void sub_808B0C0(u8);
void sub_808B0C0(u8 taskID);
void sub_808B508(u8);
void sub_808B564();
void sub_808B564(void);
#endif // GUARD_POKEMON_MENU_H

View File

@ -133,7 +133,7 @@ SECTIONS {
src/wild_encounter.o(.text);
src/field_effect.o(.text);
src/unknown_task.o(.text);
asm/pokemon_menu.o(.text);
src/pokemon_menu.o(.text);
src/option_menu.o(.text);
src/pokedex.o(.text);
src/trainer_card.o(.text);
@ -384,7 +384,7 @@ SECTIONS {
src/wild_encounter.o(.rodata);
data/wild_encounter.o(.rodata);
src/field_effect.o(.rodata);
data/pokemon_menu.o(.rodata);
src/pokemon_menu.o(.rodata);
src/option_menu.o(.rodata);
src/pokedex.o(.rodata);
src/trainer_card.o(.rodata);

View File

@ -35,23 +35,16 @@ extern void PartyMenuDrawHPBars(void);
extern u8 sub_806B58C(u8);
extern u8 GetItemEffectType();
extern void sub_806E750(u8, const struct PartyPopupMenu *, const struct PartyMenuItem *, int);
extern u16 sub_806BD80();
extern u8 sub_806CA38();
extern void sub_806D5A4(void);
extern void sub_802E414(void);
extern void sub_80A6DCC(void);
extern void sub_806AF4C();
extern u8 sub_80F9344(void);
extern u8 sub_806B124(void);
extern void sub_806C994();
extern void sub_806BF74();
extern void sub_806AEDC(void);
extern TaskFunc PartyMenuGetPopupMenuFunc(u8, const struct PartyPopupMenu *, const struct PartyMenuItem *, u8);
extern void sub_806E7D0(u8, const struct PartyPopupMenu *);
extern u8 *sub_8040D08();
extern void sub_8040B8C(void);
extern void sub_806E6F0();
extern void sub_806D538();
extern void nullsub_14();
extern void OpenPartyMenu();
extern u8 sub_803FBBC(void);
@ -586,7 +579,7 @@ static void Task_809538C(void)
{
do
{
if (sub_806B124() == 1)
if (sub_806B124() == TRUE)
{
sub_806C994(EWRAM_1B000.unk260, gUnknown_020384F0);
sub_806BF74(EWRAM_1B000.unk260, 0);

View File

@ -6,6 +6,7 @@
#include "name_string_util.h"
#include "palette.h"
#include "party_menu.h"
#include "pokemon_menu.h"
#include "pokemon.h"
#include "pokemon_summary_screen.h"
#include "rom4.h"
@ -50,10 +51,8 @@ extern void PartyMenuPrintMonsLevelOrStatus(void);
extern void PrintPartyMenuMonNicknames(void);
extern void sub_806BC3C(u8, u8);
extern u8 sub_806B58C(u8);
extern void sub_806D538();
extern u16 sub_806BE38();
extern u8 sub_806CA38();
extern void sub_808B5B4();
extern TaskFunc PartyMenuGetPopupMenuFunc(u8, const struct PartyPopupMenu *, const struct PartyMenuItem *, u8);
extern u8 sub_806B124();
extern void sub_806C994();
@ -84,8 +83,6 @@ extern void PartyMenuDoPutNicknameTilemap(u16, u8, u8, u8, const u8 *);
extern void box_print(u8, int, const u8 *);
extern void sub_806BCE8(void);
extern void sub_806E750(u8, const struct PartyPopupMenu *, const struct PartyMenuItem *, int);
extern u16 sub_806BD80();
extern void sub_806BF74();
static void ClearPartySelection(void);
static bool8 IsMonAllowedInBattleTower(struct Pokemon *);

View File

@ -144,7 +144,7 @@ u8 *sub_80EB544(u8 *dst, u16 *words, u16 arg2, u16 arg3)
u16 unref_sub_80EB5E0(u16 arg0)
{
u8 *chars;
const u8 *chars;
u16 i;
u16 length;
int group, word;

View File

@ -33,15 +33,6 @@
#include "species.h"
#include "party_menu.h"
#define DATA_COUNT (6)
struct Unk2001000
{
u8 unk0;
u8 unk1;
u8 unk2;
};
struct Unk201C000
{
/*0x00*/ struct Pokemon *pokemon;
@ -68,8 +59,6 @@ struct UnknownStruct5
u16 *unk4;
};
extern u8 ewram[];
#define ewram01000 (*(struct Unk2001000 *)(ewram + 0x01000))
#define ewram1C000 (*(struct Unk201C000 *)(ewram + 0x1C000))
#define ewram1F000 (*(struct Unk201F000 *)(ewram + 0x1F000))

1197
src/pokemon_menu.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -160,14 +160,7 @@ gUnknown_03005560: @ 3005560
gUnknown_030056A0: @ 30056A0
.space 0x640
@ pokemon_menu
gLastFieldPokeMenuOpened: @ 3005CE0
.space 0x4
gUnknown_03005CE4: @ 3005CE4
.space 0x4
.include "pokemon_menu.o"
.include "pokedex.o"
@ pokemon_summary_screen

View File

@ -374,17 +374,8 @@ gUnknown_0202FF58: @ 202FF58
gUnknown_0202FFA4: @ 202FFA4
.space 0x4
@ pokemon_menu
gUnknown_0202FFA8: @ 202FFA8
.space 0x1
gUnknown_0202FFA9: @ 202FFA9
.space 0x1
gUnknown_0202FFAA: @ 202FFAA
.space 0xA
.include "src/pokemon_menu.o"
.include "src/pokedex.o"
.include "src/trainer_card.o"
.include "src/pokemon_storage_system.o"