mirror of
https://github.com/pret/pmd-red.git
synced 2026-08-23 17:24:26 -05:00
more menus
This commit is contained in:
@@ -1647,7 +1647,7 @@ _080644D0:
|
||||
movs r4, 0
|
||||
b _0806452A
|
||||
.align 2, 0
|
||||
_08064508: .4byte gUnknown_202EE44
|
||||
_08064508: .4byte gDungeonSubMenu
|
||||
_0806450C:
|
||||
bl PlayDungeonCancelSE
|
||||
_08064510:
|
||||
@@ -2174,7 +2174,7 @@ _08064914:
|
||||
movs r4, 0
|
||||
b _0806496E
|
||||
.align 2, 0
|
||||
_0806494C: .4byte gUnknown_202EE44
|
||||
_0806494C: .4byte gDungeonSubMenu
|
||||
_08064950:
|
||||
bl PlayDungeonCancelSE
|
||||
_08064954:
|
||||
@@ -5384,7 +5384,7 @@ _0806633E:
|
||||
.align 2, 0
|
||||
_08066348: .4byte gUnknown_8106D8C
|
||||
_0806634C: .4byte gFormatBuffer_Monsters
|
||||
_08066350: .4byte gIwramTextFunc2
|
||||
_08066350: .4byte ScrollUpWindowFunc
|
||||
_08066354: .4byte gUnknown_202F2F8
|
||||
thumb_func_end sub_8066288
|
||||
|
||||
@@ -5486,7 +5486,7 @@ _0806641A:
|
||||
.align 2, 0
|
||||
_08066424: .4byte gUnknown_8106D8C
|
||||
_08066428: .4byte gFormatBuffer_Monsters
|
||||
_0806642C: .4byte gIwramTextFunc1
|
||||
_0806642C: .4byte ScrollDownWindowFunc
|
||||
_08066430: .4byte gUnknown_202F2F8
|
||||
thumb_func_end sub_8066358
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
// size: 0x4
|
||||
typedef struct unkStruct_202EE44
|
||||
{
|
||||
u16 unk0;
|
||||
u16 actionId;
|
||||
u8 unk2;
|
||||
bool8 unk3;
|
||||
bool8 canBeChosen;
|
||||
} unkStruct_202EE44;
|
||||
|
||||
extern unkStruct_202EE44 gUnknown_202EE44[10];
|
||||
extern unkStruct_202EE44 gDungeonSubMenu[10];
|
||||
|
||||
#endif // GUARD_CODE_8044CC8_H
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
#define GUARD_DUNGEON_MENU_TEAM_H
|
||||
|
||||
#include "structs/dungeon_entity.h"
|
||||
#include "structs/subStruct_203B240.h"
|
||||
|
||||
bool8 ShowDungeonTeamMenu(Entity *a0);
|
||||
void ShowDungeonTacticsMenu(ActionContainer *a0);
|
||||
void ShowDungeonSummaryOrIQMenu(ActionContainer *a0, bool8 a1);
|
||||
void sub_8062500(void);
|
||||
void sub_80625A4(s32 count, struct subStruct_203B240 **strings);
|
||||
#define WHICH_MENU_MOVES 1
|
||||
#define WHICH_MENU_ITEMS 2
|
||||
Entity *ShowDungeonToWhichMonMenu(s32 *teamId, s32 caseId);
|
||||
|
||||
@@ -42,6 +42,11 @@ static inline void InlineStrncpy(u8 *dst, const u8 *src, s32 n)
|
||||
strncpy(dst, src, n);
|
||||
}
|
||||
|
||||
static inline bool8 AreStringsDifferent(const u8 *str1, const u8 *str2)
|
||||
{
|
||||
return strcmp(str1, str2) != 0;
|
||||
}
|
||||
|
||||
// Sometimes incrementing and decrementing a variable changes how registers are allocated, which helps with matching functions. Functionality-wise this doesn't do anything.
|
||||
#ifdef NONMATCHING
|
||||
#define ASM_MATCH_TRICK(a) {;}
|
||||
|
||||
@@ -53,8 +53,8 @@ extern UnkTextStruct1 gUnknown_2027370[4];
|
||||
extern u8 gUnknown_202749A[11];
|
||||
extern bool8 gUnknown_20274A5;
|
||||
extern u16 gUnknown_202B038[4][32][32]; // Usage points to these dimensions
|
||||
extern void (*gIwramTextFunc1)(s32 a0);
|
||||
extern void (*gIwramTextFunc2)(s32 a0);
|
||||
extern void (*ScrollDownWindowFunc)(s32 windowId);
|
||||
extern void (*ScrollUpWindowFunc)(s32 windowId);
|
||||
extern void (*gIwramTextFunc3)(s32 a0);
|
||||
extern void (*gIwramTextFunc4)(s32 a0);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "constants/dungeon_action.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "dungeon_generation.h"
|
||||
#include "code_8044CC8.h"
|
||||
#include "items.h"
|
||||
|
||||
@@ -15,13 +16,13 @@ typedef struct ItemText
|
||||
// size: 0x8
|
||||
typedef struct unkStr_80F7C54
|
||||
{
|
||||
u32 unk0;
|
||||
s32 unk0;
|
||||
u8 *text;
|
||||
} unkStr_80F7C54;
|
||||
|
||||
|
||||
|
||||
EWRAM_DATA unkStruct_202EE44 gUnknown_202EE44[10] = {0};
|
||||
EWRAM_DATA unkStruct_202EE44 gDungeonSubMenu[10] = {0};
|
||||
|
||||
extern s32 gDungeonSubMenuItemsCount;
|
||||
|
||||
@@ -161,36 +162,27 @@ void sub_8044E24(Entity *entity,int index,u32 unused)
|
||||
// Similar to sub_8044BA8
|
||||
u8 *GetDungeonSubMenuItemString(s32 param_1)
|
||||
{
|
||||
u16 uVar1;
|
||||
u32 uVar3;
|
||||
u32 uVar4;
|
||||
u16 actionId = gDungeonSubMenu[param_1].actionId;
|
||||
|
||||
uVar1 = gUnknown_202EE44[param_1].unk0;
|
||||
|
||||
if ((uVar1 == 0x26) && (GetFloorType() == 2)) {
|
||||
if (actionId == ACTION_STAIRS && GetFloorType() == FLOOR_TYPE_RESCUE) {
|
||||
return *gUnknown_80F91EC;
|
||||
}
|
||||
else {
|
||||
uVar3 = uVar4 = strcmp(gUnknown_80F7C50[uVar1 << 1], gUnknown_80F697C);
|
||||
if (uVar3 != 0) {
|
||||
uVar4 = 1;
|
||||
if (!AreStringsDifferent(gUnknown_80F7C50[actionId << 1], gUnknown_80F697C)) {
|
||||
return gActions[GetItemActionType(gDungeonSubMenu[param_1].unk2)].useText;
|
||||
}
|
||||
if ((u8)(uVar4) == 0) {
|
||||
return gActions[GetItemActionType(gUnknown_202EE44[param_1].unk2)].useText;
|
||||
}
|
||||
else
|
||||
{
|
||||
return gUnknown_80F7C50[uVar1 << 1];
|
||||
else {
|
||||
return gUnknown_80F7C50[actionId << 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool8 CanSubMenuItemBeChosen(s32 param_1)
|
||||
bool8 CanSubMenuItemBeChosen(s32 itemId)
|
||||
{
|
||||
if(param_1 < 0)
|
||||
if (itemId < 0)
|
||||
return FALSE;
|
||||
else
|
||||
return gUnknown_202EE44[param_1].unk3;
|
||||
return gDungeonSubMenu[itemId].canBeChosen;
|
||||
}
|
||||
|
||||
void sub_8044F5C(u16 param_1, u8 param_2)
|
||||
@@ -200,13 +192,13 @@ void sub_8044F5C(u16 param_1, u8 param_2)
|
||||
if (gDungeonSubMenuItemsCount < 10) {
|
||||
for(index = 0; index < gDungeonSubMenuItemsCount; index++)
|
||||
{
|
||||
if (gUnknown_202EE44[index].unk0 == param_1) {
|
||||
if (gDungeonSubMenu[index].actionId == param_1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
gUnknown_202EE44[gDungeonSubMenuItemsCount].unk0 = param_1;
|
||||
gUnknown_202EE44[gDungeonSubMenuItemsCount].unk2 = param_2;
|
||||
gUnknown_202EE44[gDungeonSubMenuItemsCount].unk3 = TRUE;
|
||||
gDungeonSubMenu[gDungeonSubMenuItemsCount].actionId = param_1;
|
||||
gDungeonSubMenu[gDungeonSubMenuItemsCount].unk2 = param_2;
|
||||
gDungeonSubMenu[gDungeonSubMenuItemsCount].canBeChosen = TRUE;
|
||||
gDungeonSubMenuItemsCount++;
|
||||
}
|
||||
}
|
||||
@@ -217,7 +209,7 @@ s32 sub_8044FB4(u16 param_1)
|
||||
|
||||
for(index = 0; index < gDungeonSubMenuItemsCount; index++)
|
||||
{
|
||||
if (gUnknown_202EE44[index].unk0 == param_1) {
|
||||
if (gDungeonSubMenu[index].actionId == param_1) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
@@ -230,8 +222,8 @@ void sub_8044FF0(u16 param_1)
|
||||
|
||||
for(index = 0; index < gDungeonSubMenuItemsCount; index++)
|
||||
{
|
||||
if (gUnknown_202EE44[index].unk0 == param_1) {
|
||||
gUnknown_202EE44[index].unk3 = FALSE;
|
||||
if (gDungeonSubMenu[index].actionId == param_1) {
|
||||
gDungeonSubMenu[index].canBeChosen = FALSE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -263,20 +255,16 @@ bool8 IsNotAttacking(Entity *param_1, bool8 param_2)
|
||||
|
||||
void sub_8045064(void)
|
||||
{
|
||||
s32 i;
|
||||
s32 j;
|
||||
unkStruct_202EE44 *iPtr;
|
||||
unkStruct_202EE44 *jPtr;
|
||||
unkStruct_202EE44 temp;
|
||||
s32 i, j;
|
||||
|
||||
for (i = 0; i < gDungeonSubMenuItemsCount; i++) {
|
||||
for (j = i + 1; j < gDungeonSubMenuItemsCount; j++) {
|
||||
iPtr = &gUnknown_202EE44[i];
|
||||
jPtr = &gUnknown_202EE44[j];
|
||||
if ((s32)gUnknown_80F7C54[iPtr->unk0].unk0 > (s32)gUnknown_80F7C54[jPtr->unk0].unk0) {
|
||||
temp = *iPtr;
|
||||
*iPtr = *jPtr;
|
||||
*jPtr = temp;
|
||||
unkStruct_202EE44 temp;
|
||||
unkStruct_202EE44 *iPtr = &gDungeonSubMenu[i];
|
||||
unkStruct_202EE44 *jPtr = &gDungeonSubMenu[j];
|
||||
|
||||
if (gUnknown_80F7C54[iPtr->actionId].unk0 > gUnknown_80F7C54[jPtr->actionId].unk0) {
|
||||
SWAP(*iPtr, *jPtr, temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3)
|
||||
if (a2 - gUnknown_202F30C > 8) {
|
||||
s32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc1(0);
|
||||
ScrollDownWindowFunc(0);
|
||||
DungeonRunFrameActions(0x37);
|
||||
}
|
||||
gUnknown_202F30C++;
|
||||
@@ -1031,7 +1031,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3)
|
||||
if (a2 - gUnknown_202F30C > 8) {
|
||||
s32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc1(0);
|
||||
ScrollDownWindowFunc(0);
|
||||
DungeonRunFrameActions(0x37);
|
||||
}
|
||||
gUnknown_202F30C++;
|
||||
@@ -1047,7 +1047,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3)
|
||||
if (gUnknown_202F30C != 0) {
|
||||
s32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc2(0);
|
||||
ScrollUpWindowFunc(0);
|
||||
DungeonRunFrameActions(0x37);
|
||||
}
|
||||
gUnknown_202F30C--;
|
||||
@@ -1062,7 +1062,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3)
|
||||
if (gUnknown_202F30C != 0) {
|
||||
s32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc2(0);
|
||||
ScrollUpWindowFunc(0);
|
||||
DungeonRunFrameActions(0x37);
|
||||
}
|
||||
gUnknown_202F30C--;
|
||||
@@ -1334,7 +1334,7 @@ void sub_806806C(PokemonStruct1 *a0)
|
||||
|
||||
PlayDungeonCursorSE(0);
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc1(0);
|
||||
ScrollDownWindowFunc(0);
|
||||
DungeonRunFrameActions(0x1C);
|
||||
}
|
||||
unkStruct.unk40++;
|
||||
@@ -1345,7 +1345,7 @@ void sub_806806C(PokemonStruct1 *a0)
|
||||
|
||||
PlayDungeonCursorSE(0);
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc2(0);
|
||||
ScrollUpWindowFunc(0);
|
||||
DungeonRunFrameActions(0x1C);
|
||||
}
|
||||
unkStruct.unk40--;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "structs/str_dungeon.h"
|
||||
#include "dungeon_leader.h"
|
||||
#include "dungeon_movement.h"
|
||||
#include "dungeon_generation.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
#include "pokemon.h"
|
||||
@@ -194,27 +195,19 @@ bool8 sub_8044B84(void)
|
||||
}
|
||||
}
|
||||
|
||||
u8 *sub_8044BA8(u16 param_1, u8 id)
|
||||
u8 *sub_8044BA8(u16 actionId, u8 id)
|
||||
{
|
||||
u32 uVar3;
|
||||
u32 uVar4;
|
||||
|
||||
if ((param_1 == 0x26) && (GetFloorType() == 2)) {
|
||||
return *gUnknown_80F91EC;
|
||||
}
|
||||
else {
|
||||
uVar3 = uVar4 = strcmp(gUnknown_80F7C50[param_1 << 1], gUnknown_80F697C);
|
||||
if (uVar3 != 0) {
|
||||
uVar4 = 1;
|
||||
if (actionId == ACTION_STAIRS && GetFloorType() == FLOOR_TYPE_RESCUE) {
|
||||
return *gUnknown_80F91EC;
|
||||
}
|
||||
if ((u8)(uVar4) == 0) {
|
||||
return gActions[GetItemActionType(id)].useText;
|
||||
else {
|
||||
if (!AreStringsDifferent(gUnknown_80F7C50[actionId << 1], gUnknown_80F697C)) {
|
||||
return gActions[GetItemActionType(id)].useText;
|
||||
}
|
||||
else {
|
||||
return gUnknown_80F7C50[actionId << 1];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return gUnknown_80F7C50[param_1 << 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetLeaderActionToNothing(bool8 clearActionFields)
|
||||
|
||||
@@ -90,16 +90,13 @@ bool8 sub_8044B28(void);
|
||||
bool8 IsNotAttacking(Entity *param_1, bool8 param_2);
|
||||
s32 GetTeamMemberEntityIndex(Entity *pokemon);
|
||||
bool8 sub_8070F80(Entity * pokemon, s32 direction);
|
||||
bool8 ShowDungeonTeamMenu(Entity *a0);
|
||||
void sub_80637E8(ActionContainer *a0);
|
||||
void sub_8063B54(ActionContainer *a0);
|
||||
void sub_8063BB4(ActionContainer *a0);
|
||||
void sub_806752C(ActionContainer *a0);
|
||||
void sub_8061A38(ActionContainer *a0, bool8 a1);
|
||||
void sub_8063A70(ActionContainer *a0, bool8 a1);
|
||||
void sub_8063CF0(ActionContainer *a0, bool8 a1);
|
||||
void sub_8067768(ActionContainer *a0);
|
||||
void ShowTacticsMenu(ActionContainer *a0);
|
||||
void ChangeDungeonCameraPos(DungeonPos *pos, s32 a1, u8 a2, u8 a3);
|
||||
extern bool8 sub_8071A8C(Entity *pokemon);
|
||||
extern void sub_80643AC(Entity *pokemon);
|
||||
@@ -1313,7 +1310,7 @@ static void ShowMainMenu(bool8 fromBPress, bool8 a1)
|
||||
}
|
||||
|
||||
if (GetLeaderActionId() == ACTION_CHECK_SUMMARY) {
|
||||
sub_8061A38(GetLeaderActionContainer(), FALSE);
|
||||
ShowDungeonSummaryOrIQMenu(GetLeaderActionContainer(), FALSE);
|
||||
SetLeaderActionToNothing(1);
|
||||
}
|
||||
else if (GetLeaderActionId() == ACTION_TALK_MENU) {
|
||||
@@ -1325,11 +1322,11 @@ static void ShowMainMenu(bool8 fromBPress, bool8 a1)
|
||||
SetLeaderActionToNothing(1);
|
||||
}
|
||||
else if (GetLeaderActionId() == ACTION_CHANGE_TACTICS) {
|
||||
ShowTacticsMenu(GetLeaderActionContainer());
|
||||
ShowDungeonTacticsMenu(GetLeaderActionContainer());
|
||||
SetLeaderActionToNothing(1);
|
||||
}
|
||||
else if (GetLeaderActionId() == ACTION_VIEW_IQ) {
|
||||
sub_8061A38(GetLeaderActionContainer(), TRUE);
|
||||
ShowDungeonSummaryOrIQMenu(GetLeaderActionContainer(), TRUE);
|
||||
SetLeaderActionToNothing(1);
|
||||
}
|
||||
else if (GetLeaderActionId() == ACTION_CHECK_MOVES) {
|
||||
|
||||
@@ -787,7 +787,7 @@ static void sub_8060900(Entity *a0)
|
||||
|
||||
static void ChosenSubMenuToAction(ActionContainer *a0)
|
||||
{
|
||||
SetMonsterActionFields(a0, gUnknown_202EE44[gDungeonMenu.menuIndex].unk0);
|
||||
SetMonsterActionFields(a0, gDungeonSubMenu[gDungeonMenu.menuIndex].actionId);
|
||||
a0->actionParameters[0] = sUnknownActionUnk4;
|
||||
a0->actionParameters[1].actionUseIndex = 0;
|
||||
a0->actionParameters[1].itemPos.x = 0;
|
||||
|
||||
@@ -46,7 +46,7 @@ extern void sub_80637E8(ActionContainer *a0);
|
||||
extern void sub_8063B54(ActionContainer *a0);
|
||||
extern void sub_8063BB4(ActionContainer *a0);
|
||||
extern void sub_806752C(ActionContainer *a0);
|
||||
extern void sub_8061A38(ActionContainer *a0, bool8 a1);
|
||||
extern void ShowDungeonSummaryOrIQMenu(ActionContainer *a0, bool8 a1);
|
||||
extern void sub_8063A70(ActionContainer *a0, bool8 a1);
|
||||
extern void sub_8063CF0(ActionContainer *a0, bool8 a1);
|
||||
extern void sub_8067768(ActionContainer *a0);
|
||||
@@ -580,7 +580,7 @@ void sub_80637A4(ActionContainer *a0, s32 a1)
|
||||
|
||||
void sub_80637BC(ActionContainer *a0, s32 a1, s32 a2)
|
||||
{
|
||||
SetMonsterActionFields(a0, gUnknown_202EE44[a1].unk0);
|
||||
SetMonsterActionFields(a0, gDungeonSubMenu[a1].actionId);
|
||||
a0->actionParameters[0].actionUseIndex = a2;
|
||||
a0->actionParameters[1].actionUseIndex = gUnknown_202F2D8;
|
||||
}
|
||||
|
||||
@@ -89,11 +89,9 @@ void sub_80637E8(ActionContainer *a0);
|
||||
void sub_8063B54(ActionContainer *a0);
|
||||
void sub_8063BB4(ActionContainer *a0);
|
||||
void sub_806752C(ActionContainer *a0);
|
||||
void sub_8061A38(ActionContainer *a0, bool8 a1);
|
||||
void sub_8063A70(ActionContainer *a0, bool8 a1);
|
||||
void sub_8063CF0(ActionContainer *a0, bool8 a1);
|
||||
void sub_8067768(ActionContainer *a0);
|
||||
void ShowTacticsMenu(ActionContainer *a0);
|
||||
void ChangeDungeonCameraPos(DungeonPos *pos, s32 a1, u8 a2, u8 a3);
|
||||
extern void sub_80643AC(Entity *pokemon);
|
||||
extern bool8 ShowDungeonMovesMenu(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4);
|
||||
@@ -126,6 +124,8 @@ extern u32 sub_8014140(s32 a0, const void *a1);
|
||||
extern char* sub_808E4FC(s32 a1);
|
||||
extern char* sub_808E51C(s32 a1);
|
||||
extern void sub_8045C18(u8 *buffer, Item *item);
|
||||
extern bool32 sub_8069D18(DungeonPos *a0, Entity *a1);
|
||||
extern void sub_80639E4(struct subStruct_203B240 *strings, MenuInputStructSub *menuSub);
|
||||
|
||||
extern u8 gUnknown_202EE00;
|
||||
extern Entity *gLeaderPointer;
|
||||
@@ -157,17 +157,15 @@ struct UnkFieldTeamMenuStruct
|
||||
u8 unk14[MAX_TEAM_MEMBERS];
|
||||
};
|
||||
|
||||
void PrintMonTactics(s32 a0, u8 *tacticIds, EntityInfo *mon, s32 windowId);
|
||||
void PrintOnDungeonTeamMenu(struct UnkFieldTeamMenuStruct *a0, Windows *a1, bool8 a2);
|
||||
void sub_806145C(struct UnkFieldTeamMenuStruct *a0);
|
||||
void sub_80615B4(ActionContainer *a0, struct UnkFieldTeamMenuStruct *a1);
|
||||
void sub_80623B0(void);
|
||||
void sub_8062230(void);
|
||||
void sub_8062748(u8 a0);
|
||||
bool32 sub_8069D18(DungeonPos *a0, Entity *a1);
|
||||
void sub_806285C(s32 a0);
|
||||
void sub_806262C(u8 iqSkillId);
|
||||
void sub_80639E4(struct subStruct_203B240 *strings, MenuInputStructSub *menuSub);
|
||||
static void PrintOnDungeonTeamMenu(struct UnkFieldTeamMenuStruct *a0, Windows *windows, bool8 a2);
|
||||
static void sub_806145C(struct UnkFieldTeamMenuStruct *a0);
|
||||
static void ChosenSubMenuToAction(ActionContainer *a0, struct UnkFieldTeamMenuStruct *a1);
|
||||
static void PrintMonTactics(s32 firstId, u8 *tacticIds, EntityInfo *mon, s32 windowId);
|
||||
static void sub_8062230(void);
|
||||
static void sub_80623B0(void);
|
||||
static void ShowIqDescriptionWindow(u8 iqSkillId);
|
||||
static void ShowTacticDescriptionWindow(u8 tacticId);
|
||||
static void sub_806285C(s32 a0);
|
||||
static void PrintMoveNamesOnBottomWindow(Entity *entity);
|
||||
static void PrintItemNameOnBottomWindow(Entity *entity);
|
||||
static void ResetDungeonMenu(void);
|
||||
@@ -296,7 +294,7 @@ bool8 ShowDungeonTeamMenu(Entity *a0)
|
||||
}
|
||||
if ((gRealInputs.pressed & A_BUTTON) || gDungeonMenu.unk28.a_button) {
|
||||
if (CanSubMenuItemBeChosen(gDungeonMenu.menuIndex)) {
|
||||
sub_80615B4(&GetEntInfo(a0)->action, &sp);
|
||||
ChosenSubMenuToAction(&GetEntInfo(a0)->action, &sp);
|
||||
PlayDungeonConfirmationSE();
|
||||
r4 = FALSE;
|
||||
break;
|
||||
@@ -324,7 +322,7 @@ bool8 ShowDungeonTeamMenu(Entity *a0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void PrintOnDungeonTeamMenu(struct UnkFieldTeamMenuStruct *a0, Windows *windows, bool8 a2)
|
||||
static void PrintOnDungeonTeamMenu(struct UnkFieldTeamMenuStruct *a0, Windows *windows, bool8 a2)
|
||||
{
|
||||
s32 r0;
|
||||
DungeonPos pos;
|
||||
@@ -450,7 +448,7 @@ void PrintOnDungeonTeamMenu(struct UnkFieldTeamMenuStruct *a0, Windows *windows,
|
||||
sub_80073E0(0);
|
||||
}
|
||||
|
||||
void sub_806145C(struct UnkFieldTeamMenuStruct *a0)
|
||||
static void sub_806145C(struct UnkFieldTeamMenuStruct *a0)
|
||||
{
|
||||
Entity *teamMon;
|
||||
EntityInfo *monInfo;
|
||||
@@ -504,13 +502,13 @@ void sub_806145C(struct UnkFieldTeamMenuStruct *a0)
|
||||
sub_8045064();
|
||||
}
|
||||
|
||||
void sub_80615B4(ActionContainer *a0, struct UnkFieldTeamMenuStruct *a1)
|
||||
static void ChosenSubMenuToAction(ActionContainer *a0, struct UnkFieldTeamMenuStruct *a1)
|
||||
{
|
||||
SetMonsterActionFields(a0, gUnknown_202EE44[gDungeonMenu.menuIndex].unk0);
|
||||
SetMonsterActionFields(a0, gDungeonSubMenu[gDungeonMenu.menuIndex].actionId);
|
||||
a0->actionParameters[0].actionUseIndex = a1->unk4[a1->unk0];
|
||||
}
|
||||
|
||||
void ShowTacticsMenu(ActionContainer *a0)
|
||||
void ShowDungeonTacticsMenu(ActionContainer *a0)
|
||||
{
|
||||
Windows windows = {
|
||||
.id = {
|
||||
@@ -582,7 +580,7 @@ void ShowTacticsMenu(ActionContainer *a0)
|
||||
if (gDungeonMenu.menuIndex == 7) {
|
||||
if (tacticIds[8] != TACTIC_UNUSED) {
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc1(0);
|
||||
ScrollDownWindowFunc(0);
|
||||
DungeonRunFrameActions(0x3D);
|
||||
}
|
||||
scrollFirstId++;
|
||||
@@ -597,7 +595,7 @@ void ShowTacticsMenu(ActionContainer *a0)
|
||||
if (gDungeonMenu.menuIndex == 0) {
|
||||
if (scrollFirstId != 0) {
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc2(0);
|
||||
ScrollUpWindowFunc(0);
|
||||
DungeonRunFrameActions(0x3D);
|
||||
}
|
||||
scrollFirstId--;
|
||||
@@ -611,7 +609,7 @@ void ShowTacticsMenu(ActionContainer *a0)
|
||||
u32 tacticId = tacticIds[gDungeonMenu.menuIndex];
|
||||
menuIndex = gDungeonMenu.menuIndex;
|
||||
PlayDungeonStartButtonSE();
|
||||
sub_8062748(tacticId);
|
||||
ShowTacticDescriptionWindow(tacticId);
|
||||
loopBreak = FALSE;
|
||||
break;
|
||||
}
|
||||
@@ -668,7 +666,7 @@ void ShowTacticsMenu(ActionContainer *a0)
|
||||
}
|
||||
}
|
||||
else {
|
||||
sub_8062748(tacticId);
|
||||
ShowTacticDescriptionWindow(tacticId);
|
||||
addCursor = FALSE;
|
||||
}
|
||||
}
|
||||
@@ -692,7 +690,7 @@ void ShowTacticsMenu(ActionContainer *a0)
|
||||
sub_803EAF0(0, NULL);
|
||||
}
|
||||
|
||||
void PrintMonTactics(s32 firstId, u8 *tacticIds, EntityInfo *mon, s32 windowId)
|
||||
static void PrintMonTactics(s32 firstId, u8 *tacticIds, EntityInfo *mon, s32 windowId)
|
||||
{
|
||||
u8 tacticsBuffer[NUM_TACTICS];
|
||||
u32 tactic;
|
||||
@@ -731,7 +729,7 @@ void PrintMonTactics(s32 firstId, u8 *tacticIds, EntityInfo *mon, s32 windowId)
|
||||
sub_80073E0(windowId);
|
||||
}
|
||||
|
||||
void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
void ShowDungeonSummaryOrIQMenu(ActionContainer *a0, bool8 showIq)
|
||||
{
|
||||
s32 spArr[6];
|
||||
struct unkStruct_808FF20 unkMonStruct;
|
||||
@@ -755,7 +753,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
s32 r8;
|
||||
Entity *entity;
|
||||
s32 var_3C;
|
||||
s32 var_38;
|
||||
s32 totalWindows;
|
||||
EntityInfo *entityInfo;
|
||||
|
||||
var_3C = 0;
|
||||
@@ -770,16 +768,16 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
spArr[3] = 0;
|
||||
spArr[4] = 0;
|
||||
spArr[5] = 0;
|
||||
var_38 = 1;
|
||||
totalWindows = 1;
|
||||
}
|
||||
else if (a1) {
|
||||
else if (showIq) {
|
||||
spArr[0] = 4;
|
||||
spArr[1] = 0;
|
||||
spArr[2] = 0;
|
||||
spArr[3] = 0;
|
||||
spArr[4] = 0;
|
||||
spArr[5] = 0;
|
||||
var_38 = 1;
|
||||
totalWindows = 1;
|
||||
}
|
||||
else {
|
||||
spArr[0] = 2;
|
||||
@@ -788,7 +786,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
spArr[3] = 5;
|
||||
spArr[4] = 0;
|
||||
spArr[5] = 0;
|
||||
var_38 = 4;
|
||||
totalWindows = 4;
|
||||
}
|
||||
|
||||
unkMonStruct.unk40 = 0;
|
||||
@@ -802,7 +800,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
s32 var_28 = 1;
|
||||
UnkTextStruct1 *unkTxtStr1Ptr = &gUnknown_2027370[0];
|
||||
|
||||
sTeamWindowHeader.f0 = var_38;
|
||||
sTeamWindowHeader.f0 = totalWindows;
|
||||
sTeamWindowHeader.f1 = var_3C;
|
||||
sTeamWindowHeader.f2 = 10;
|
||||
sTeamWindowHeader.f3 = 0;
|
||||
@@ -810,7 +808,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
sub_8069844(&unkMonStruct, entity);
|
||||
CreatePokemonInfoTabScreen(spArr[var_3C], var_3C, &unkMonStruct, &unkInfoTabStruct, 0);
|
||||
gDungeonMenu.unk1E = var_3C;
|
||||
gDungeonMenu.unk20 = var_38;
|
||||
gDungeonMenu.unk20 = totalWindows;
|
||||
gDungeonMenu.unkC = (unkTxtStr1Ptr->unk0 + 15) * 8;
|
||||
gDungeonMenu.unkE = ((unkTxtStr1Ptr->unk2 + 1) * 8) - 2;
|
||||
gDungeonMenu.unk14.x = 0;
|
||||
@@ -915,7 +913,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
if (unkInfoTabStruct.unkC[8] != 0) {
|
||||
s32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc1(0);
|
||||
ScrollDownWindowFunc(0);
|
||||
DungeonRunFrameActions(28);
|
||||
}
|
||||
unkMonStruct.unk56++;
|
||||
@@ -929,7 +927,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
if (unkInfoTabStruct.unkC[8] != 0) {
|
||||
s32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc1(0);
|
||||
ScrollDownWindowFunc(0);
|
||||
DungeonRunFrameActions(28);
|
||||
}
|
||||
unkMonStruct.unk56++;
|
||||
@@ -946,7 +944,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
if (unkMonStruct.unk56 != 0) {
|
||||
s32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc2(0);
|
||||
ScrollUpWindowFunc(0);
|
||||
DungeonRunFrameActions(28);
|
||||
}
|
||||
unkMonStruct.unk56--;
|
||||
@@ -960,7 +958,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
if (unkMonStruct.unk56 != 0) {
|
||||
s32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc2(0);
|
||||
ScrollUpWindowFunc(0);
|
||||
DungeonRunFrameActions(28);
|
||||
}
|
||||
unkMonStruct.unk56--;
|
||||
@@ -978,7 +976,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
if (unkInfoTabStruct.unk0[8] != 0) {
|
||||
s32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc1(0);
|
||||
ScrollDownWindowFunc(0);
|
||||
DungeonRunFrameActions(28);
|
||||
}
|
||||
unkMonStruct.unk40++;
|
||||
@@ -992,7 +990,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
if (unkInfoTabStruct.unk0[8] != 0) {
|
||||
s32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc1(0);
|
||||
ScrollDownWindowFunc(0);
|
||||
DungeonRunFrameActions(28);
|
||||
}
|
||||
unkMonStruct.unk40++;
|
||||
@@ -1009,7 +1007,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
if (unkMonStruct.unk40 != 0) {
|
||||
s32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc2(0);
|
||||
ScrollUpWindowFunc(0);
|
||||
DungeonRunFrameActions(28);
|
||||
}
|
||||
unkMonStruct.unk40--;
|
||||
@@ -1023,7 +1021,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
if (unkMonStruct.unk40 != 0) {
|
||||
s32 i;
|
||||
for (i = 0; i < 6; i++) {
|
||||
gIwramTextFunc2(0);
|
||||
ScrollUpWindowFunc(0);
|
||||
DungeonRunFrameActions(28);
|
||||
}
|
||||
unkMonStruct.unk40--;
|
||||
@@ -1052,11 +1050,11 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
break;
|
||||
}
|
||||
else if (var_30) {
|
||||
s32 var = unkInfoTabStruct.unk0[gDungeonMenu.menuIndex];
|
||||
s32 iqSkillId = unkInfoTabStruct.unk0[gDungeonMenu.menuIndex];
|
||||
|
||||
r8 = gDungeonMenu.menuIndex;
|
||||
PlayDungeonStartButtonSE();
|
||||
sub_806262C(var);
|
||||
ShowIqDescriptionWindow(iqSkillId);
|
||||
var_28 = 0;
|
||||
loopBreak = FALSE;
|
||||
break;
|
||||
@@ -1147,7 +1145,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
ToggleIQSkill(&entityInfo->IQSkillMenuFlags, var);
|
||||
}
|
||||
else {
|
||||
sub_806262C(var);
|
||||
ShowIqDescriptionWindow(var);
|
||||
var_28 = 0;
|
||||
}
|
||||
loopBreak = FALSE;
|
||||
@@ -1184,7 +1182,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1)
|
||||
}
|
||||
|
||||
// The same as sub_8068344
|
||||
void sub_8062230(void)
|
||||
static void sub_8062230(void)
|
||||
{
|
||||
if ((gUnknown_202EDCC & 8) != 0) {
|
||||
UnkTextStruct1 *txtStrPtr = &gUnknown_2027370[0];
|
||||
@@ -1209,7 +1207,7 @@ void sub_8062230(void)
|
||||
}
|
||||
|
||||
// The same as sub_80684C4
|
||||
void sub_80623B0(void)
|
||||
static void sub_80623B0(void)
|
||||
{
|
||||
if ((gUnknown_202EDCC & 8) != 0) {
|
||||
UnkTextStruct1 *ptr = &gUnknown_2027370[0];
|
||||
@@ -1280,7 +1278,7 @@ void sub_80625A4(s32 count, struct subStruct_203B240 **strings)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_806262C(u8 iqSkillId)
|
||||
static void ShowIqDescriptionWindow(u8 iqSkillId)
|
||||
{
|
||||
MenuInputStructSub menuSub;
|
||||
Windows windows;
|
||||
@@ -1333,7 +1331,7 @@ void sub_806262C(u8 iqSkillId)
|
||||
sub_803E708(4, 0x3E);
|
||||
}
|
||||
|
||||
void sub_8062748(u8 tacticId)
|
||||
static void ShowTacticDescriptionWindow(u8 tacticId)
|
||||
{
|
||||
MenuInputStructSub menuSub;
|
||||
Windows windows;
|
||||
@@ -1386,7 +1384,7 @@ void sub_8062748(u8 tacticId)
|
||||
sub_803E708(4, 0x3E);
|
||||
}
|
||||
|
||||
void sub_806285C(s32 a0)
|
||||
static void sub_806285C(s32 a0)
|
||||
{
|
||||
const u8 *str;
|
||||
MenuInputStructSub menuSub;
|
||||
|
||||
@@ -986,7 +986,7 @@ static bool8 TryScrollLogUp(s32 a0)
|
||||
DungeonRunFrameActions(0xD);
|
||||
|
||||
for (i = 0; i < 7; i++) {
|
||||
gIwramTextFunc2(0);
|
||||
ScrollUpWindowFunc(0);
|
||||
DungeonRunFrameActions(0xD);
|
||||
}
|
||||
|
||||
@@ -1036,7 +1036,7 @@ static bool8 TryScrollLogDown(s32 a0)
|
||||
DungeonRunFrameActions(0xD);
|
||||
|
||||
for (i = 0; i < 7; i++) {
|
||||
gIwramTextFunc1(0);
|
||||
ScrollDownWindowFunc(0);
|
||||
DungeonRunFrameActions(0xD);
|
||||
}
|
||||
|
||||
|
||||
28
src/text.c
28
src/text.c
@@ -44,17 +44,17 @@ EWRAM_DATA ALIGNED(4) u16 gUnknown_202B038[4][32][32] = {0};
|
||||
IWRAM_DATA static s16 gUnknown_3000E94[161] = {0};
|
||||
|
||||
// These text-related functions were deemed important as they're copied and run from IWRAM for improved performance.
|
||||
static void sub_8272774(UnkTextStruct1 *txtStructs, s32 id);
|
||||
static void sub_8272884(UnkTextStruct1 *txtStructs, s32 id);
|
||||
static void ScrollDownWindowInternal(UnkTextStruct1 *txtStructs, s32 id);
|
||||
static void ScrollUpWindowInternal(UnkTextStruct1 *txtStructs, s32 id);
|
||||
static void sub_82729B8(UnkTextStruct1 *txtStructs, s32 id);
|
||||
static void sub_8272A8C(UnkTextStruct1 *txtStructs, s32 id);
|
||||
void sub_8272760(s32 id);
|
||||
void sub_8272870(s32 id);
|
||||
void ScrollDownWindow(s32 windowId);
|
||||
void ScrollUpWindow(s32 windowId);
|
||||
void sub_82729A4(s32 id);
|
||||
void sub_8272A78(s32 id);
|
||||
|
||||
EWRAM_INIT void (*gIwramTextFunc1)(s32 a0) = sub_8272760;
|
||||
EWRAM_INIT void (*gIwramTextFunc2)(s32 a0) = sub_8272870;
|
||||
EWRAM_INIT void (*ScrollDownWindowFunc)(s32 windowId) = ScrollDownWindow;
|
||||
EWRAM_INIT void (*ScrollUpWindowFunc)(s32 windowId) = ScrollUpWindow;
|
||||
EWRAM_INIT void (*gIwramTextFunc3)(s32 a0) = sub_82729A4;
|
||||
EWRAM_INIT void (*gIwramTextFunc4)(s32 a0) = sub_8272A78;
|
||||
|
||||
@@ -3643,14 +3643,14 @@ void InitGraphics(void)
|
||||
}
|
||||
|
||||
// These functions run from IWRAM for improved performance.
|
||||
IWRAM_INIT void sub_8272760(s32 id)
|
||||
IWRAM_INIT void ScrollDownWindow(s32 windowId)
|
||||
{
|
||||
sub_8272774(gUnknown_2027370, id);
|
||||
ScrollDownWindowInternal(gUnknown_2027370, windowId);
|
||||
}
|
||||
|
||||
IWRAM_INIT static void sub_8272774(UnkTextStruct1 *txtStructs, s32 id)
|
||||
IWRAM_INIT static void ScrollDownWindowInternal(UnkTextStruct1 *txtStructs, s32 windowId)
|
||||
{
|
||||
UnkTextStruct1 *txtStructPtr = &txtStructs[id];
|
||||
UnkTextStruct1 *txtStructPtr = &txtStructs[windowId];
|
||||
|
||||
if (txtStructPtr->unk8 > 0) {
|
||||
s32 i, j;
|
||||
@@ -3706,14 +3706,14 @@ IWRAM_INIT static void sub_8272774(UnkTextStruct1 *txtStructs, s32 id)
|
||||
}
|
||||
}
|
||||
|
||||
IWRAM_INIT void sub_8272870(s32 id)
|
||||
IWRAM_INIT void ScrollUpWindow(s32 windowId)
|
||||
{
|
||||
sub_8272884(gUnknown_2027370, id);
|
||||
ScrollUpWindowInternal(gUnknown_2027370, windowId);
|
||||
}
|
||||
|
||||
IWRAM_INIT static void sub_8272884(UnkTextStruct1 *txtStructs, s32 id)
|
||||
IWRAM_INIT static void ScrollUpWindowInternal(UnkTextStruct1 *txtStructs, s32 windowId)
|
||||
{
|
||||
UnkTextStruct1 *txtStructPtr = &txtStructs[id];
|
||||
UnkTextStruct1 *txtStructPtr = &txtStructs[windowId];
|
||||
|
||||
if (txtStructPtr->unk8 > 0) {
|
||||
s32 i, j;
|
||||
|
||||
@@ -134,7 +134,7 @@ gUnknown_202EE39: /* 202EE39 (sub_8060E38) */
|
||||
gUnknown_202EE3A: /* 202EE3A (sub_8060E38 - sub_8065DBC) */
|
||||
.space 0xA
|
||||
|
||||
gUnknown_202EE44: /* 202EE44 (sub_8044EC8 - sub_80647F0) */
|
||||
gDungeonSubMenu: /* 202EE44 (sub_8044EC8 - sub_80647F0) */
|
||||
.space 0x28
|
||||
gDungeonSubMenuItemsCount: /* 202EE6C (sub_8044F5C - sub_8067A80) */
|
||||
.space 0x4
|
||||
|
||||
Reference in New Issue
Block a user