Merge pull request #201 from golemgalvanize/decompile_item_menu

Decompile item menu
This commit is contained in:
Diegoisawesome 2018-02-12 13:29:21 -06:00 committed by GitHub
commit 398e775d90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 2535 additions and 6614 deletions

File diff suppressed because it is too large Load Diff

1
common_syms/item_menu.txt Executable file
View File

@ -0,0 +1 @@
gFieldCallback

View File

@ -1,127 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
gUnknown_08613F90:: @ 8613F90
.4byte 0x11F0, 0x1E1, 0x21DE
@ possibly a struct
gUnknown_08613F9C:: @ 8613F9C
.4byte 0
.4byte bag_menu_change_item_callback
.4byte sub_81AB520
.4byte 0
.4byte 0x80000
.4byte 0x7003011
gUnknown_08613FB4:: @ 8613FB4
.4byte gMenuText_Use, ItemMenu_UseOutOfBattle
.4byte gMenuText_Toss, ItemMenu_Toss
.4byte gMenuText_Register, ItemMenu_Register
.4byte gMenuText_Give, ItemMenu_Give
.4byte gText_Cancel2, ItemMenu_Cancel
.4byte gMenuText_Use, ItemMenu_UseInBattle
.4byte gMenuText_Check, ItemMenu_UseOutOfBattle
.4byte gMenuText_Walk, ItemMenu_UseOutOfBattle
.4byte gMenuText_Deselect, ItemMenu_Register
.4byte gMenuText_CheckTag, ItemMenu_CheckTag
.4byte gMenuText_Confirm, unknown_ItemMenu_Confirm
.4byte gMenuText_Show, unknown_ItemMenu_Show
.4byte gMenuText_Give2, unknown_ItemMenu_Give2
.4byte gMenuText_Confirm, unknown_ItemMenu_Confirm2
.4byte gText_EmptyString2, NULL
gUnknown_0861402C:: @ 861402C
.byte 0, 3, 1, 4
gUnknown_08614030:: @ 8614030
.byte 0, 2, 14, 4
gUnknown_08614034:: @ 8614034
.byte 3, 14, 1, 4
gUnknown_08614038:: @ 8614038
.byte 0, 3, 14, 4
gUnknown_0861403C:: @ 861403C
.byte 9, 14, 0, 3, 1, 4
gUnknown_08614042:: @ 8614042
.byte 5, 4
gUnknown_08614044:: @ 8614044
.byte 3, 4
gUnknown_08614046:: @ 8614046
.byte 4
gUnknown_08614047:: @ 8614047
.byte 10, 9, 14, 4
gUnknown_0861404B:: @ 861404B
.byte 11, 4
gUnknown_0861404D:: @ 861404D
.byte 12, 4
gUnknown_0861404F:: @ 861404F
.byte 13, 4
.align 2
gUnknown_08614054:: @ 8614054
.4byte unknown_item_menu_type
.4byte unknown_item_menu_type
.4byte item_menu_type_2
.4byte display_sell_item_ask_str
.4byte unknown_ItemMenu_Confirm
.4byte unknown_item_menu_type
.4byte display_deposit_item_ask_str
.4byte unknown_item_menu_type
.4byte unknown_item_menu_type
.4byte unknown_item_menu_type
.4byte NULL
.4byte item_menu_type_b
.align 2
gUnknown_08614084:: @ 8614084
.4byte BagMenuActuallyToss
.4byte BagMenuCancelToss
gUnknown_0861408C:: @ 861408C
.4byte sub_81AD84C
.4byte sub_81AD6FC
@ probably a struct
gUnknown_08614094:: @ 8614094
.4byte 0x1101C00
.4byte 0xFFFF1064
.4byte 0x6FFFFF
.4byte 0x6F
gUnknown_086140A4:: @ 86140A4
.incbin "graphics/interface/select_button.4bpp"
gUnknown_08614164:: @ 8614164
.byte 0, 1, 3, 0, 1, 4, 0, 3, 6, 2, 1, 3, 0, 14, 10, 0
gUnknown_08614174:: @ 8614174
window_template 0, 14, 2, 15, 16, 1, 0x27
window_template 0, 0, 13, 14, 6, 1, 0x117
window_template 0, 4, 1, 8, 2, 1, 0x1A1
window_template 0, 1, 13, 5, 6, 12, 0x16B
window_template 0, 7, 13, 4, 6, 12, 0x189
window_template 1, 2, 15, 27, 4, 15, 0x1B1
null_window_template
gUnknown_086141AC:: @ 86141AC
window_template 1, 22, 17, 7, 2, 15, 0x21D
window_template 1, 22, 15, 7, 4, 15, 0x21D
window_template 1, 15, 15, 14, 4, 15, 0x21D
window_template 1, 15, 13, 14, 6, 15, 0x21D
window_template 1, 2, 15, 27, 4, 15, 0x1B1
window_template 1, 24, 15, 5, 4, 15, 0x21D
window_template 1, 21, 9, 5, 4, 15, 0x21D
window_template 1, 24, 17, 5, 2, 15, 0x21D
window_template 1, 18, 11, 10, 2, 15, 0x245
window_template 1, 1, 1, 10, 2, 15, 0x231

View File

@ -6,5 +6,6 @@ void sub_81A895C(void);
u16 sub_81A89A0(u8); u16 sub_81A89A0(u8);
void sub_81A8AF8(void); void sub_81A8AF8(void);
bool8 InBattlePike(void); bool8 InBattlePike(void);
void sub_819FA50(void);
#endif // GUARD_BATTLE_FRONTIER_2_H #endif // GUARD_BATTLE_FRONTIER_2_H

View File

@ -27,5 +27,6 @@ void sub_8098044(u8);
void UnfreezeMapObjects(void); void UnfreezeMapObjects(void);
void FreezeMapObjectsExceptOne(u8 mapObjectId); void FreezeMapObjectsExceptOne(u8 mapObjectId);
void sub_8097B78(u8, u8); void sub_8097B78(u8, u8);
void FreezeMapObjects(void);
#endif //GUARD_FIELD_MAP_OBJ_HELPERS_H #endif //GUARD_FIELD_MAP_OBJ_HELPERS_H

View File

@ -31,6 +31,8 @@ u8 CheckForFieldObjectCollision(struct MapObject *a, s16 b, s16 c, u8 d, u8 e);
u8 PlayerGetZCoord(void); u8 PlayerGetZCoord(void);
void SetPlayerAvatarTransitionFlags(u16 a); void SetPlayerAvatarTransitionFlags(u16 a);
void sub_808BCE8(void); void sub_808BCE8(void);
void sub_808B864(void);
void sub_808BCF4(void);
void sub_808D074(u8); void sub_808D074(u8);
void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr);

View File

@ -4,5 +4,6 @@
u8 GetLeadMonIndex(void); u8 GetLeadMonIndex(void);
u8 sub_813B260(void); u8 sub_813B260(void);
u16 get_unknown_box_id(void); u16 get_unknown_box_id(void);
bool8 InMultiBattleRoom(void);
#endif // GUARD_FIELD_SPECIALS_H #endif // GUARD_FIELD_SPECIALS_H

View File

@ -2719,4 +2719,10 @@ extern const u16 gFireRedMenuElements2_Pal[16];
extern const u16 gFireRedMenuElements3_Pal[16]; extern const u16 gFireRedMenuElements3_Pal[16];
extern const u8 gFireRedMenuElements_Gfx[]; extern const u8 gFireRedMenuElements_Gfx[];
//item menu graphics
extern const u8 gBagScreen_Gfx[];
extern const u16 gBagScreenFemale_Pal[];
extern const u16 gBagScreenMale_Pal[];
extern const u8 gBagMenuHMIcon_Gfx[];
#endif //GUARD_GRAPHICS_H #endif //GUARD_GRAPHICS_H

View File

@ -61,5 +61,8 @@ ItemUseFunc ItemId_GetBattleFunc(u16 itemId);
u8 ItemId_GetSecondaryId(u16 itemId); u8 ItemId_GetSecondaryId(u16 itemId);
u16 itemid_get_market_price(u16 itemId); u16 itemid_get_market_price(u16 itemId);
u16 BagGetItemIdByPocketPosition(u8 pocketId, u16 pocketPos); u16 BagGetItemIdByPocketPosition(u8 pocketId, u16 pocketPos);
void sub_80D6FB4(struct BagPocket*);
void sub_80D6F64(struct BagPocket*);
void sub_80D702C(struct ItemSlot*, s16, u16);
#endif // ITEM_H #endif // ITEM_H

View File

@ -8,5 +8,9 @@ u8 sub_80D511C(u8 a0, u8 a1, u8 a2, u8 a3);
u8 CreateBerryTagSprite(u8 id, s16 x, s16 y); u8 CreateBerryTagSprite(u8 id, s16 x, s16 y);
void FreeBerryTagSpritePalette(void); void FreeBerryTagSpritePalette(void);
u8 CreateBerryFlavorCircleSprite(s16 x); u8 CreateBerryFlavorCircleSprite(s16 x);
void sub_80D4FAC(void);
void RemoveBagItemIconObject(u8);
void sub_80D4FEC(u8);
void sub_80D4FC8(u8);
#endif // GUARD_ITEM_MENU_ICONS #endif // GUARD_ITEM_MENU_ICONS

View File

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

View File

@ -57,5 +57,6 @@ u8 ListMenuInit(struct ListMenuTemplate *template, u16 cursorPage, u16 cursorPos
s32 ListMenuHandleInputGetItemId(u8 listTaskId); s32 ListMenuHandleInputGetItemId(u8 listTaskId);
void sub_81AE860(u8 listTaskId, u16 *a1, u16 *a2); void sub_81AE860(u8 listTaskId, u16 *a1, u16 *a2);
void sub_81AE6C8(u8 listTaskId, u16 *a1, u16 *a2); void sub_81AE6C8(u8 listTaskId, u16 *a1, u16 *a2);
u8 ListMenuGetYCoordForPrintingArrowCursor(u8);
#endif //GUARD_LIST_MENU_H #endif //GUARD_LIST_MENU_H

View File

@ -62,5 +62,10 @@ u16 sub_8198AA4(u8, u8, u8, u8, u8, u8, u16);
void *malloc_and_decompress(const void *src, int *sizeOut); void *malloc_and_decompress(const void *src, int *sizeOut);
u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode); u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode);
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress); void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress);
void AddItemMenuActionTextPrinters (u8, u8, u8, u8, u8, u8, u8, const struct MenuAction*, const u8*);
void sub_8198DBC(u8, u8, u8, u8, u8, u8, u8, const struct MenuAction*, const u8*);
u8 sub_8199944(u8, u8, u8, u8, u8);
u8 sub_8199134(s8, s8);
void sub_819A2BC(u8, u8);
#endif // GUARD_MENU_H #endif // GUARD_MENU_H

View File

@ -32,5 +32,10 @@ void DisplayMessageAndContinueTask(u8 taskId, u8 arg1, u16 arg2, u8 arg3, u8 arg
void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 arg2, u8 arg3, u8 arg4, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo); void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 arg2, u8 arg3, u8 arg4, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo);
u8 GetLRKeysState(void); u8 GetLRKeysState(void);
u8 sub_812210C(void); u8 sub_812210C(void);
bool8 sub_81221EC(void);
bool8 sub_81221AC(void);
bool8 sub_8122148(u16);
bool8 AdjustQuantityAccordingToDPadInput(s16*, u16);
bool8 itemid_80BF6D8_mail_related(u16);
#endif //GUARD_MENU_HELPERS_H #endif //GUARD_MENU_HELPERS_H

View File

@ -8,5 +8,7 @@
// Exported ROM declarations // Exported ROM declarations
u8 AddScrollIndicatorArrowPairParametrized(u8, u8, u8, u8, s32, u16, u16, u16 *); u8 AddScrollIndicatorArrowPairParametrized(u8, u8, u8, u8, s32, u16, u16, u16 *);
void RemoveScrollIndicatorArrowPair(u8); void RemoveScrollIndicatorArrowPair(u8);
u8 AddScrollIndicatorArrowPair(void*, void*);
void sub_81AF15C(u8, u8, u8);
#endif //GUARD_MENU_INDICATORS_H #endif //GUARD_MENU_INDICATORS_H

View File

@ -71,6 +71,8 @@ void copy_saved_warp2_bank_and_enter_x_to_warp1(u8 unused);
void mapldr_default(void); void mapldr_default(void);
u8 get_map_light_from_warp0(void); u8 get_map_light_from_warp0(void);
bool8 is_light_level_1_2_3_5_or_6(u8 a1); bool8 is_light_level_1_2_3_5_or_6(u8 a1);
void sub_8086194(void);
void sub_80861B0(void);
bool32 sub_80875C8(void); bool32 sub_80875C8(void);
bool32 sub_8087634(void); bool32 sub_8087634(void);

View File

@ -18,5 +18,6 @@ u8 pokemon_ailments_get_primary(u32 status);
u8 *GetMonNickname(struct Pokemon *mon, u8 *dst); u8 *GetMonNickname(struct Pokemon *mon, u8 *dst);
u8 GetCursorSelectionMonId(void); u8 GetCursorSelectionMonId(void);
bool8 FieldCallback_Teleport(void); bool8 FieldCallback_Teleport(void);
void sub_81B7F60(void);
#endif // GUARD_PARTY_MENU_H #endif // GUARD_PARTY_MENU_H

View File

@ -8,5 +8,6 @@
// Exported ROM declarations // Exported ROM declarations
void sub_816B060(u8 taskId); void sub_816B060(u8 taskId);
void sub_816B31C(void);
#endif //GUARD_PLAYER_PC_H #endif //GUARD_PLAYER_PC_H

View File

@ -0,0 +1,6 @@
#ifndef GUARD_POKEMON_SUMMARY_SCREEN_H
#define GUARD_POKEMON_SUMMARY_SCREEN_H
void sub_81C4F98(u8, void(*)(void));
#endif // GUARD_POKEMON_SUMMARY_SCREEN_H

View File

@ -6,5 +6,6 @@ extern EWRAM_DATA struct ItemSlot gUnknown_02039F80[3];
void CreatePokemartMenu(const u16 *); void CreatePokemartMenu(const u16 *);
void CreateDecorationShop1Menu(const u16 *); void CreateDecorationShop1Menu(const u16 *);
void CreateDecorationShop2Menu(const u16 *); void CreateDecorationShop2Menu(const u16 *);
void CB2_ExitSellMenu(void);
#endif // GUARD_SHOP_H #endif // GUARD_SHOP_H

View File

@ -139,6 +139,14 @@ extern const u8 gMenuText_Use[];
extern const u8 gMenuText_Toss[]; extern const u8 gMenuText_Toss[];
extern const u8 gMenuText_Give[]; extern const u8 gMenuText_Give[];
extern const u8 gMenuText_Give2[]; extern const u8 gMenuText_Give2[];
extern const u8 gMenuText_Register[];
extern const u8 gMenuText_Check[];
extern const u8 gMenuText_Walk[];
extern const u8 gMenuText_Deselect[];
extern const u8 gMenuText_CheckTag[];
extern const u8 gMenuText_Confirm[];
extern const u8 gMenuText_Show[];
extern const u8 gMenuText_Give2[];
extern const u8 gText_Cancel2[]; extern const u8 gText_Cancel2[];
@ -244,4 +252,30 @@ extern const u8 gText_Var1DotVar2[];
extern const u8 gText_ThreeMarks[]; extern const u8 gText_ThreeMarks[];
extern const u8 gText_FirmSlash[]; extern const u8 gText_FirmSlash[];
//item menu screen text
extern const u8 gText_CloseBag[];
extern const u8 gText_ClearTo11Var1Clear5Var2[];
extern const u8 gText_UnkF908Var1Clear7Var2[];
extern const u8 gText_xVar1[];
extern const u8 gText_ReturnToVar1[];
extern const u8 gText_SelectorArrow2[];
extern const u8 gText_MoveVar1Where[];
extern const u8 gText_Var1IsSelected[];
extern const u8 gText_TossHowManyVar1s[];
extern const u8 gText_ConfirmTossItems[];
extern const u8 gText_ThrewAwayVar2Var1s[];
extern const u8 gText_CantWriteMail[];
extern const u8 gText_NoPokemon[];
extern const u8 gText_Var1CantBeHeld[];
extern const u8 gText_Var1CantBeHeldHere[];
extern const u8 gText_CantBuyKeyItem[];
extern const u8 gText_HowManyToSell[];
extern const u8 gText_ICanPayVar1[];
extern const u8 gText_TurnedOverVar1ForVar2[];
extern const u8 gText_DepositHowManyVar1[];
extern const u8 gText_CantStoreImportantItems[];
extern const u8 gText_DepositedVar2Var1s[];
extern const u8 gText_NoRoomForItems[];
extern const u8 gText_ThreeDashes[];
#endif //GUARD_STRINGS_H #endif //GUARD_STRINGS_H

View File

@ -208,6 +208,7 @@ void DecompressGlyphTile(const u16 *src, u16 *dest);
u8 GetLastTextColor(u8 colorType); u8 GetLastTextColor(u8 colorType);
void CopyGlyphToWindow(struct TextPrinter *x); void CopyGlyphToWindow(struct TextPrinter *x);
void ClearTextSpan(struct TextPrinter *textPrinter, u32 width); void ClearTextSpan(struct TextPrinter *textPrinter, u32 width);
u8 GetMenuCursorDimensionByFont(u8, u8);
u16 Font0Func(struct TextPrinter *textPrinter); u16 Font0Func(struct TextPrinter *textPrinter);
u16 Font1Func(struct TextPrinter *textPrinter); u16 Font1Func(struct TextPrinter *textPrinter);

View File

@ -246,7 +246,7 @@ SECTIONS {
asm/battle_frontier_1.o(.text); asm/battle_frontier_1.o(.text);
src/menu.o(.text); src/menu.o(.text);
asm/battle_frontier_2.o(.text); asm/battle_frontier_2.o(.text);
asm/item_menu.o(.text); src/item_menu.o(.text);
asm/list_menu.o(.text); asm/list_menu.o(.text);
asm/menu_indicators.o(.text); asm/menu_indicators.o(.text);
src/unk_text_util.o(.text); src/unk_text_util.o(.text);
@ -520,7 +520,7 @@ SECTIONS {
data/battle_frontier_1.o(.rodata); data/battle_frontier_1.o(.rodata);
src/menu.o(.rodata); src/menu.o(.rodata);
data/battle_frontier_2.o(.rodata); data/battle_frontier_2.o(.rodata);
data/item_menu.o(.rodata); src/item_menu.o(.rodata);
data/menu_indicators.o(.rodata); data/menu_indicators.o(.rodata);
src/save_location.o(.rodata); src/save_location.o(.rodata);
data/item_icon.o(.rodata); data/item_icon.o(.rodata);

2448
src/item_menu.c Executable file

File diff suppressed because it is too large Load Diff

View File

@ -113,7 +113,7 @@ void sub_80FE024(u8 taskId);
void sub_80FE124(u8 taskId); void sub_80FE124(u8 taskId);
void sub_80FE164(u8 taskId); void sub_80FE164(u8 taskId);
void DisplayItemMessage(u8 taskId, u8 a, u8* str, void(*callback)(u8 taskId)); void DisplayItemMessage(u8 taskId, u8 a, const u8* str, void(*callback)(u8 taskId));
void DisplayItemMessageInBattlePyramid(u8 taskId, u8* str, void(*callback)(u8 taskId)); void DisplayItemMessageInBattlePyramid(u8 taskId, u8* str, void(*callback)(u8 taskId));
void DisplayItemMessageOnField(u8 taskId, u8* str, void(*callback)(u8 taskId)); void DisplayItemMessageOnField(u8 taskId, u8* str, void(*callback)(u8 taskId));
void sub_81C6714(u8 taskId); void sub_81C6714(u8 taskId);

View File

@ -43,7 +43,8 @@ gUnknown_03005DA8: @ 3005DA8
.space 0x4 .space 0x4
gFieldCallback: @ 3005DAC gFieldCallback: @ 3005DAC
.space 0x4
.include "item_menu.o"
gUnknown_03005DB0: @ 3005DB0 gUnknown_03005DB0: @ 3005DB0
.space 0x4 .space 0x4

View File

@ -959,37 +959,9 @@ gUnknown_0203CE50: @ 203CE50
.space 0x4 .space 0x4
gUnknown_0203CE54: @ 203CE54 gUnknown_0203CE54: @ 203CE54
.space 0x4 .align 2
gUnknown_0203CE58: @ 203CE58 .include "src/item_menu.o"
.space 0x5
gUnknown_0203CE5D: @ 203CE5D
.space 0x1
gUnknown_0203CE5E: @ 203CE5E
.space 0x2
gUnknown_0203CE60: @ 203CE60
.space 0xA
gUnknown_0203CE6A: @ 203CE6A
.space 0x6
gUnknown_0203CE70: @ 203CE70
.space 0x4
gUnknown_0203CE74: @ 203CE74
.space 0x4
gUnknown_0203CE78: @ 203CE78
.space 0x4
gSpecialVar_ItemId: @ 203CE7C
.space 0x4
gUnknown_0203CE80: @ 203CE80
.space 0x4
gUnknown_0203CE84: @ 203CE84 gUnknown_0203CE84: @ 203CE84
.space 0x8 .space 0x8