From 42562fd8dfe66b2469a4f2a71ac204b2a74ac84a Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 6 Jul 2017 18:10:03 -0500 Subject: decompile sub_80A3118 - sub_80A317C --- include/item.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/item.h b/include/item.h index 47af11940..f51ea3ae5 100644 --- a/include/item.h +++ b/include/item.h @@ -22,6 +22,14 @@ struct Item u8 secondaryId; }; +struct BagPocket +{ + struct ItemSlot *itemSlots; + u8 capacity; +}; + +extern struct BagPocket gBagPockets[5]; + void CopyItemName(u16 itemId, u8 *string); bool8 IsBagPocketNonEmpty(u8 pocket); bool8 CheckBagHasItem(u16 itemId, u16 count); -- cgit v1.2.3 From ad7a7222a538380b446f9aecde44c5222ff3b68a Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Thu, 6 Jul 2017 19:25:06 -0500 Subject: decompile sub_80A34B4 - ClearBag --- include/graphics.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index c3fe20996..fc0cc3adf 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2435,4 +2435,10 @@ extern const u8 gMonFrontPic_UnownQuestionMark[]; extern const u8 gMonBackPic_UnownQuestionMark[]; extern const u8 gMonIcon_UnownQuestionMark[]; +// data/graphics.s +extern const u8 gBagScreen_Gfx[]; +extern const u8 gBagScreenMale_Pal[]; +extern const u8 gBagScreenFemale_Pal[]; +extern const u16 gUnknown_08E77004[]; + #endif // GUARD_GRAPHICS_H -- cgit v1.2.3 From 9a57e785576c658980e7cac5d3531181ccc64d42 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 8 Jul 2017 12:16:19 -0500 Subject: decompile sub_80A3740 - swap32 --- include/graphics.h | 10 +++++++--- include/item.h | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index 4d042b3b6..12ffd16fe 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2440,12 +2440,16 @@ extern const u8 gBagScreen_Gfx[]; extern const u8 gBagScreenMale_Pal[]; extern const u8 gBagScreenFemale_Pal[]; extern const u16 gUnknown_08E77004[]; - +extern const u8 gBuyMenuFrame_Gfx[]; +extern const u8 gMenuMoneyPal[]; +extern const u8 gBuyMenuFrame_Tilemap[]; +extern const u8 gMenuMoneyGfx[]; extern const u8 gMenuPokeblock_Gfx[]; -extern const u8 gMenuPokeblock_Tilemap[]; extern const u8 gMenuPokeblock_Pal[]; - extern const u8 gMenuPokeblockDevice_Gfx[]; extern const u8 gMenuPokeblockDevice_Pal[]; +extern const u8 gMenuPokeblock_Tilemap[]; + +extern const u8 gUnknown_08E96EC8[]; #endif // GUARD_GRAPHICS_H diff --git a/include/item.h b/include/item.h index f51ea3ae5..54a252302 100644 --- a/include/item.h +++ b/include/item.h @@ -28,7 +28,9 @@ struct BagPocket u8 capacity; }; -extern struct BagPocket gBagPockets[5]; +#define NUM_BAG_POCKETS 5 + +extern const struct BagPocket gBagPockets[NUM_BAG_POCKETS]; void CopyItemName(u16 itemId, u8 *string); bool8 IsBagPocketNonEmpty(u8 pocket); -- cgit v1.2.3 From e41832e3c7afd0072216aaaf08b9e56c7bb42413 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 8 Jul 2017 18:06:19 -0500 Subject: decompile RemoveEmptyItemSlots - sub_80A444C --- include/text.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/text.h b/include/text.h index cf413644b..e9e8eb8c2 100644 --- a/include/text.h +++ b/include/text.h @@ -9,8 +9,9 @@ #define CHAR_ELLIPSIS 0xB0 #define CHAR_MALE 0xB5 #define CHAR_FEMALE 0xB6 -#define CHAR_COMMA 0xB8 #define CHAR_CURRENCY 0xB7 +#define CHAR_COMMA 0xB8 +#define CHAR_MULT_SIGN 0xB9 #define CHAR_SLASH 0xBA #define CHAR_A 0xBB #define CHAR_B 0xBC -- cgit v1.2.3 From 4a9e02772870528cc3b9653eb4028b236f3c3aa8 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 8 Jul 2017 22:01:23 -0500 Subject: get rid of TextStruct --- include/global.h | 5 ----- include/strings.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 0f5bcde6d..4d20ea4fc 100644 --- a/include/global.h +++ b/include/global.h @@ -115,11 +115,6 @@ enum BAG_KEYITEMS }; -struct TextStruct -{ - const u8 *text; -}; - struct Coords16 { s16 x; diff --git a/include/strings.h b/include/strings.h index 89a78e478..fe9cfc6ba 100755 --- a/include/strings.h +++ b/include/strings.h @@ -188,7 +188,7 @@ extern const u8 OtherText_TheField[]; extern const u8 OtherText_TheField2[]; extern const u8 OtherText_ThePC[]; -extern const struct TextStruct gUnknown_0840E740[]; +extern const u8 *const gUnknown_0840E740[7]; extern const u8 gOtherText_ReturnTo[]; extern const u8 gOtherText_WhatWillYouDo2[]; -- cgit v1.2.3 From 55db40b3302d3b83df4f764952aba94dd81eb8ad Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 9 Jul 2017 00:40:28 -0500 Subject: decompile ItemListMenu_ChangeDescription - sub_80A4F74 --- include/item.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/item.h b/include/item.h index 54a252302..80a460caa 100644 --- a/include/item.h +++ b/include/item.h @@ -51,7 +51,7 @@ u16 ItemId_GetPrice(u16 itemId); u8 ItemId_GetHoldEffect(u16 itemId); u8 ItemId_GetHoldEffectParam(u16 itemId); u8 *ItemId_GetDescription(u16 itemId); -bool8 ItemId_CopyDescription(u8 *a, u32 itemId, u32 c); +bool32 ItemId_CopyDescription(u8 *a, u32 itemId, u32 c); u8 ItemId_GetImportance(u16 itemId); u8 ItemId_GetUnknownValue(u16 itemId); u8 ItemId_GetPocket(u16 itemId); -- cgit v1.2.3 From df1eb2b49ebc2e761eb4aa138a0b42ebd5c5e15c Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 9 Jul 2017 01:09:26 -0500 Subject: completely get rid of TextStruct --- include/script_menu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/script_menu.h b/include/script_menu.h index 458aad13d..cc5c442ec 100644 --- a/include/script_menu.h +++ b/include/script_menu.h @@ -7,7 +7,7 @@ struct MultichoiceListStruct u8 count; }; -extern const struct TextStruct gUnknown_083CE048[]; +extern const u8 *const gUnknown_083CE048[]; bool8 sub_80B5054(u8 left, u8 top, u8 var3, u8 var4); bool8 sub_80B50B0(u8 left, u8 top, u8 var3, u8 var4, u8 var5); -- cgit v1.2.3 From bb096eb1367ed9a5e2acc9c68368de71a8f73a3c Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 9 Jul 2017 16:30:01 -0500 Subject: decompile sub_80A52C4 - sub_80A5B78 --- include/item_menu.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/item_menu.h b/include/item_menu.h index 301836ac8..bbe4ac94a 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -6,9 +6,11 @@ void sub_80A3684(void); void ClearBag(void); void sub_80A3E0C(void); -void sub_80A3FA0(u16 *, u32, u32, u32, u32, u32); +//void sub_80A3FA0(u16 *, u32, u32, u32, u32, u32); +void sub_80A3FA0(u16 *a, u8 b, u8 c, u8 d, u8 e, u16 f); void sub_80A4164(u8 *, u16, enum StringConvertMode, u8); -void sub_80A418C(u16, enum StringConvertMode, int, int, int); +//void sub_80A418C(u16, enum StringConvertMode, int, int, int); +void sub_80A418C(u16 a, enum StringConvertMode b, u8 c, u8 d, u8 e); void sub_80A53F8(void); void HandleItemMenuPaletteFade(u8); void sub_80A5B40(void); -- cgit v1.2.3 From 5c2c970d012d37a2b582816c6d4636b531dfe3b8 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 9 Jul 2017 22:59:49 -0500 Subject: decompile sub_80A6354 - sub_80A6D1C --- include/battle_setup.h | 2 +- include/item_menu.h | 4 +--- include/script.h | 14 +++++++------- include/songs.h | 10 +++++----- 4 files changed, 14 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/battle_setup.h b/include/battle_setup.h index e88aefe6d..c8c463f6d 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -87,7 +87,7 @@ bool32 battle_exit_is_player_defeat(u32 a1); //void sub_80822BC(void); //void TrainerBattleLoadArgs(const struct TrainerBattleSpec *specs, u8 *data); //void battle_80801F0(void); -u8 *TrainerBattleConfigure(u8 *data); +u8 *TrainerBattleConfigure(const u8 *data); void TrainerWantsBattle(u8, u8 *); bool32 GetTrainerFlagFromScriptPointer(u8 *data); //void sub_8082524(void); diff --git a/include/item_menu.h b/include/item_menu.h index bbe4ac94a..1a0050334 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -6,10 +6,8 @@ void sub_80A3684(void); void ClearBag(void); void sub_80A3E0C(void); -//void sub_80A3FA0(u16 *, u32, u32, u32, u32, u32); void sub_80A3FA0(u16 *a, u8 b, u8 c, u8 d, u8 e, u16 f); void sub_80A4164(u8 *, u16, enum StringConvertMode, u8); -//void sub_80A418C(u16, enum StringConvertMode, int, int, int); void sub_80A418C(u16 a, enum StringConvertMode b, u8 c, u8 d, u8 e); void sub_80A53F8(void); void HandleItemMenuPaletteFade(u8); @@ -21,7 +19,7 @@ void sub_80A5D04(void); void sub_80A6300(void); void sub_80A68CC(); void sub_80A6A30(void); -int sub_80A6D1C(void); +bool32 sub_80A6D1C(void); void sub_80A6DCC(void); void sub_80A7094(u8); u8 sub_80A7D8C(u8 berry, int i, int i1); diff --git a/include/script.h b/include/script.h index 5577fcb01..e35ec7608 100644 --- a/include/script.h +++ b/include/script.h @@ -12,8 +12,8 @@ struct ScriptContext u8 mode; u8 comparisonResult; u8 (*nativePtr)(void); - u8 *scriptPtr; - u8 *stack[20]; + const u8 *scriptPtr; + const u8 *stack[20]; ScrCmdFunc *cmdTable; ScrCmdFunc *cmdTableEnd; u32 data[4]; @@ -22,12 +22,12 @@ struct ScriptContext #define ScriptReadByte(ctx) (*(ctx->scriptPtr++)) void InitScriptContext(struct ScriptContext *ctx, void *cmdTable, void *cmdTableEnd); -u8 SetupBytecodeScript(struct ScriptContext *ctx, void *ptr); +u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr); void SetupNativeScript(struct ScriptContext *ctx, void *ptr); void StopScript(struct ScriptContext *ctx); u8 RunScript(struct ScriptContext *ctx); -u8 ScriptPush(struct ScriptContext *ctx, u8 *ptr); -u8 *ScriptPop(struct ScriptContext *ctx); +u8 ScriptPush(struct ScriptContext *ctx, const u8 *ptr); +const u8 *ScriptPop(struct ScriptContext *ctx); void ScriptJump(struct ScriptContext *ctx, u8 *ptr); void ScriptCall(struct ScriptContext *ctx, u8 *ptr); void ScriptReturn(struct ScriptContext *ctx); @@ -38,10 +38,10 @@ void ScriptContext2_Disable(void); bool8 ScriptContext2_IsEnabled(void); void ScriptContext1_Init(void); bool8 ScriptContext2_RunScript(void); -void ScriptContext1_SetupScript(u8 *ptr); +void ScriptContext1_SetupScript(const u8 *ptr); void ScriptContext1_Stop(void); void EnableBothScriptContexts(void); -void ScriptContext2_RunNewScript(u8 *ptr); +void ScriptContext2_RunNewScript(const u8 *ptr); u8 *mapheader_get_tagged_pointer(u8 tag); void mapheader_run_script_by_tag(u8 tag); u8 *mapheader_get_first_match_from_tagged_ptr_list(u8 tag); diff --git a/include/songs.h b/include/songs.h index a813cc785..8cf7ee5e9 100644 --- a/include/songs.h +++ b/include/songs.h @@ -94,11 +94,11 @@ enum SE_T_KAMI2, SE_ELEBETA, /*0x5A*/ SE_HINSI, - SE_EXPMAX, - SE_TAMAKORO, - SE_TAMAKORO_E, - SE_BASABASA, - SE_REGI, + /*0x5B*/ SE_EXPMAX, + /*0x5C*/ SE_TAMAKORO, + /*0x5D*/ SE_TAMAKORO_E, + /*0x5E*/ SE_BASABASA, + /*0x5F*/ SE_REGI, SE_C_GAJI, SE_C_MAKU_U, SE_C_MAKU_D, -- cgit v1.2.3 From c8bcd2e54f62756c47dfb13268613dfd4d1ec67f Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 10 Jul 2017 15:34:42 -0500 Subject: decompile sub_80A6D98 - sub_80A79B4 --- include/items.h | 3 ++- include/link.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/items.h b/include/items.h index f3c506b43..69515f18e 100644 --- a/include/items.h +++ b/include/items.h @@ -1,7 +1,8 @@ #ifndef GUARD_ITEMS_H #define GUARD_ITEMS_H -enum { +enum +{ ITEM_NONE, // 0x000 ITEM_MASTER_BALL, // 0x001 ITEM_ULTRA_BALL, // 0x002 diff --git a/include/link.h b/include/link.h index f80f2bc58..367add625 100644 --- a/include/link.h +++ b/include/link.h @@ -144,6 +144,7 @@ extern u8 deUnkValue2; extern struct LinkPlayer gLinkPlayers[]; extern u16 word_3002910[]; extern bool8 gReceivedRemoteLinkPlayers; +extern bool8 gLinkOpen; void Task_DestroySelf(u8); void sub_8007270(u8); -- cgit v1.2.3 From 24ac9f1767a988278712911d24b5cd7bad7e45ae Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 10 Jul 2017 18:14:18 -0500 Subject: finish decompiling item_menu --- include/graphics.h | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++ include/item_menu.h | 4 +-- include/sprite.h | 2 +- 3 files changed, 100 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index 12ffd16fe..fb9781147 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2436,6 +2436,9 @@ extern const u8 gMonBackPic_UnownQuestionMark[]; extern const u8 gMonIcon_UnownQuestionMark[]; // data/graphics.s +extern const u8 gBagMaleTiles[]; +extern const u8 gBagFemaleTiles[]; +extern const u8 gBagPalette[]; extern const u8 gBagScreen_Gfx[]; extern const u8 gBagScreenMale_Pal[]; extern const u8 gBagScreenFemale_Pal[]; @@ -2450,6 +2453,100 @@ extern const u8 gMenuPokeblockDevice_Gfx[]; extern const u8 gMenuPokeblockDevice_Pal[]; extern const u8 gMenuPokeblock_Tilemap[]; +extern const u8 gBerryCheck_Gfx[]; +extern const u8 gBerryCheck_Pal[]; +extern const u8 gUnknown_08E788E4[]; +extern const u8 gUnknown_08E78A84[]; +extern const u8 gBerryCheckCircle_Gfx[]; + +// data/graphics/berries/graphics.inc +extern const u8 gBerryPic_Cheri[]; +extern const u8 gBerryPic_Oran[]; +extern const u8 gBerryPic_Pecha[]; +extern const u8 gBerryPic_Rawst[]; +extern const u8 gBerryPic_Aspear[]; +extern const u8 gBerryPic_Leppa[]; +extern const u8 gBerryPic_Chesto[]; +extern const u8 gBerryPic_Persim[]; +extern const u8 gBerryPic_Lum[]; +extern const u8 gBerryPic_Sitrus[]; +extern const u8 gBerryPic_Figy[]; +extern const u8 gBerryPic_Wiki[]; +extern const u8 gBerryPic_Mago[]; +extern const u8 gBerryPic_Aguav[]; +extern const u8 gBerryPic_Iapapa[]; +extern const u8 gBerryPic_Razz[]; +extern const u8 gBerryPic_Bluk[]; +extern const u8 gBerryPic_Nanab[]; +extern const u8 gBerryPic_Wepear[]; +extern const u8 gBerryPic_Pinap[]; +extern const u8 gBerryPic_Pomeg[]; +extern const u8 gBerryPic_Kelpsy[]; +extern const u8 gBerryPic_Qualot[]; +extern const u8 gBerryPic_Hondew[]; +extern const u8 gBerryPic_Grepa[]; +extern const u8 gBerryPic_Tamato[]; +extern const u8 gBerryPic_Cornn[]; +extern const u8 gBerryPic_Magost[]; +extern const u8 gBerryPic_Rabuta[]; +extern const u8 gBerryPic_Nomel[]; +extern const u8 gBerryPic_Spelon[]; +extern const u8 gBerryPic_Pamtre[]; +extern const u8 gBerryPic_Watmel[]; +extern const u8 gBerryPic_Durin[]; +extern const u8 gBerryPic_Belue[]; +extern const u8 gBerryPic_Liechi[]; +extern const u8 gBerryPic_Ganlon[]; +extern const u8 gBerryPic_Salac[]; +extern const u8 gBerryPic_Petaya[]; +extern const u8 gBerryPic_Apicot[]; +extern const u8 gBerryPic_Lansat[]; +extern const u8 gBerryPic_Starf[]; +extern const u8 gBerryPic_Enigma[]; +extern const u8 gBerryPalette_Cheri[]; +extern const u8 gBerryPalette_Oran[]; +extern const u8 gBerryPalette_Pecha[]; +extern const u8 gBerryPalette_Rawst[]; +extern const u8 gBerryPalette_Aspear[]; +extern const u8 gBerryPalette_Leppa[]; +extern const u8 gBerryPalette_Chesto[]; +extern const u8 gBerryPalette_Persim[]; +extern const u8 gBerryPalette_Lum[]; +extern const u8 gBerryPalette_Sitrus[]; +extern const u8 gBerryPalette_Figy[]; +extern const u8 gBerryPalette_Wiki[]; +extern const u8 gBerryPalette_Mago[]; +extern const u8 gBerryPalette_Aguav[]; +extern const u8 gBerryPalette_Iapapa[]; +extern const u8 gBerryPalette_Razz[]; +extern const u8 gBerryPalette_Bluk[]; +extern const u8 gBerryPalette_Nanab[]; +extern const u8 gBerryPalette_Wepear[]; +extern const u8 gBerryPalette_Pinap[]; +extern const u8 gBerryPalette_Pomeg[]; +extern const u8 gBerryPalette_Kelpsy[]; +extern const u8 gBerryPalette_Qualot[]; +extern const u8 gBerryPalette_Hondew[]; +extern const u8 gBerryPalette_Grepa[]; +extern const u8 gBerryPalette_Tamato[]; +extern const u8 gBerryPalette_Cornn[]; +extern const u8 gBerryPalette_Magost[]; +extern const u8 gBerryPalette_Rabuta[]; +extern const u8 gBerryPalette_Nomel[]; +extern const u8 gBerryPalette_Spelon[]; +extern const u8 gBerryPalette_Pamtre[]; +extern const u8 gBerryPalette_Watmel[]; +extern const u8 gBerryPalette_Durin[]; +extern const u8 gBerryPalette_Belue[]; +extern const u8 gBerryPalette_Liechi[]; +extern const u8 gBerryPalette_Ganlon[]; +extern const u8 gBerryPalette_Salac[]; +extern const u8 gBerryPalette_Petaya[]; +extern const u8 gBerryPalette_Apicot[]; +extern const u8 gBerryPalette_Lansat[]; +extern const u8 gBerryPalette_Starf[]; +extern const u8 gBerryPalette_Enigma[]; + extern const u8 gUnknown_08E96EC8[]; #endif // GUARD_GRAPHICS_H diff --git a/include/item_menu.h b/include/item_menu.h index 1a0050334..ca2be0e72 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -22,8 +22,8 @@ void sub_80A6A30(void); bool32 sub_80A6D1C(void); void sub_80A6DCC(void); void sub_80A7094(u8); -u8 sub_80A7D8C(u8 berry, int i, int i1); +u8 CreateBerrySprite(u8, s16, s16); void sub_80A7DD4(void); -u8 sub_80A7E5C(u8); +u8 sub_80A7E5C(s16); #endif // GUARD_ITEM_MENU_H diff --git a/include/sprite.h b/include/sprite.h index a65e71bd9..733231eb5 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -19,7 +19,7 @@ struct CompressedSpriteSheet struct SpriteFrameImage { - u8 *data; + const u8 *data; u16 size; }; -- cgit v1.2.3 From cb6e1059e6267ede9bbe957cbcc55eefe6bd0085 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 10 Jul 2017 23:33:46 -0500 Subject: do some labeling --- include/item_menu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/item_menu.h b/include/item_menu.h index ca2be0e72..6950ed0ff 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -3,7 +3,7 @@ #include "string_util.h" -void sub_80A3684(void); +void ResetBagScrollPositions(void); void ClearBag(void); void sub_80A3E0C(void); void sub_80A3FA0(u16 *a, u8 b, u8 c, u8 d, u8 e, u16 f); -- cgit v1.2.3