file splits

This commit is contained in:
DizzyEggg 2025-03-01 23:49:41 +01:00
parent 7ad89f101d
commit ee1abc1836
14 changed files with 2494 additions and 2273 deletions

View File

@ -1,67 +1,10 @@
.section .rodata
@ sub_8048E04 - sub_805FC30
.align 2,0
.string "pksdir0\0"
.global gUnknown_8106A4C
gUnknown_8106A4C: @ 8106A4C
.4byte 0
.global gUnknown_8106A50
gUnknown_8106A50: @ 8106A50
.4byte 1
.global gUnknown_8106A54
gUnknown_8106A54: @ 8106A54
.byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00
.byte 0x80, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00
.byte 0x80, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00
.byte 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00
.global gUnknown_8106A8C
gUnknown_8106A8C: @ 8106A8C
.byte 0x06, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
.byte 0x18, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64
.byte 0x69, 0x72, 0x30, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00, 0x70, 0x6b, 0x73, 0x64
.byte 0x69, 0x72, 0x30, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00
.global gUnknown_8106AC8
gUnknown_8106AC8: @ 8106AC8
.byte 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00
.byte 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00
.global gUnknown_8106AE8
gUnknown_8106AE8: @ 8106AE8
.byte 0x00, 0x00, 0x01, 0x00
.byte 0x12, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x13, 0x02, 0x00, 0x00
.byte 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x01, 0x00, 0xff, 0xff, 0x13, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff
.byte 0x12, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x13, 0x02, 0x00, 0x00
.byte 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00
.byte 0xff, 0xff, 0x01, 0x00, 0x13, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64
.byte 0x69, 0x72, 0x30, 0x00
.global gUnknown_8106B50
gUnknown_8106B50: @ 8106B50
.string "{COLOR}%c%s\0"
@ CreateFieldItemMenu - sub_8062CA8
.align 2,0
.string "pksdir0\0"
.align 2,0
.global gUnknown_8106B60
gUnknown_8106B60: @ 8106B60
.byte 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x50, 0x00, 0x01, 0x00, 0x00, 0x00
.global gUnknown_8106B6C
gUnknown_8106B6C: @ 8106B6C
.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00
.byte 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00
.global gUnknown_8106B8C
gUnknown_8106B8C: @ 8106B8C

44
data/data_8106A4C_0.s Normal file
View File

@ -0,0 +1,44 @@
.section .rodata
@ sub_8048E04 - sub_805FC30
.align 2,0
.string "pksdir0\0"
.global gUnknown_8106A4C
gUnknown_8106A4C: @ 8106A4C
.4byte 0
.global gUnknown_8106A50
gUnknown_8106A50: @ 8106A50
.4byte 1
.global gUnknown_8106A54
gUnknown_8106A54: @ 8106A54
.byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00
.byte 0x80, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00
.byte 0x80, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00
.align 2,0
.string "pksdir0\0"
.align 2,0
.align 2,0
.string "pksdir0\0"
.align 2,0
.global gUnknown_8106A8C
gUnknown_8106A8C: @ 8106A8C
.byte 0x06, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
.byte 0x18, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x70, 0x6b, 0x73, 0x64
.byte 0x69, 0x72, 0x30, 0x00
.align 2,0
.string "pksdir0\0"
.align 2,0
.align 2,0
.string "pksdir0\0"
.align 2,0

View File

@ -2,6 +2,14 @@
#define GUARD_DUNGEON_MAIN_H
#include "structs/str_text.h"
#include "structs/dungeon_entity.h"
struct UnkMenuBitsStruct {
u8 a0_8;
u8 a0_16;
u8 a0_24;
u8 a0_32;
};
void DungeonHandlePlayerInput(void);
void sub_805E804(void);
@ -10,7 +18,7 @@ void sub_805EFB4(Entity *a0, bool8 a1);
void sub_805F02C(void);
ActionContainer *GetLeaderActionContainer(void);
u16 GetLeaderActionId(void);
bool8 sub_805FBE8(u8 *a0);
bool8 DungeonGiveNameToRecruitedMon(u8 *a0);
void CreateDungeonMenuSubWindow(Window *mainWindow, s32 subWindowX);
#endif

View File

@ -0,0 +1,8 @@
#ifndef GUARD_DUNGEON_SUBMENU_H
#define GUARD_DUNGEON_SUBMENU_H
#include "structs/str_text.h"
void CreateDungeonMenuSubWindow(Window *mainWindow, s32 subWindowX);
#endif

View File

@ -98,8 +98,8 @@ typedef struct UnkDungeonGlobal_unk181E8_sub
u8 unk18218; // x30
u8 unk18219; // x31
u8 unk1821A; // x32
u8 unk1821B; // x33
u8 unk1821C; // x34
u8 rotateModeDirection; // x33
u8 prevRotateModeDirection; // x34
u8 fill1821D; // x35
s16 unk36; // x36
s16 unk38; // x38

View File

@ -227,7 +227,9 @@ SECTIONS {
src/status_actions.o(.text);
src/move_checks.o(.text);
src/dungeon_main.o(.text);
src/dungeon_submenu.o(.text);
src/code_805D8C8_2.o(.text);
src/code_805D8C8_3.o(.text);
asm/code_805D8C8.o(.text);
src/code_8066D04.o(.text);
src/code_805D8C8.o(.text);
@ -541,6 +543,11 @@ SECTIONS {
data/data_80F59C8.o(.rodata);
src/dungeon_message.o(.rodata);
src/dungeon_move.o(.rodata);
data/data_8106A4C_0.o(.rodata);
src/dungeon_main.o(.rodata);
src/dungeon_submenu.o(.rodata);
src/code_805D8C8_2.o(.rodata);
src/code_805D8C8_3.o(.rodata);
data/data_8106A4C.o(.rodata);
src/code_8066D04.o(.rodata);
data/data_8106A4C_2.o(.rodata);

View File

@ -698,8 +698,8 @@ void sub_803F27C(bool8 a0)
strPtr->priority = 3;
strPtr->unk1821A = 0;
strPtr->unk18212 = 0;
strPtr->unk1821B = 0;
strPtr->unk1821C = 0;
strPtr->rotateModeDirection = 0;
strPtr->prevRotateModeDirection = 0;
strPtr->unk18214 = 0;
strPtr->unk18215 = 1;
sub_803F38C();

File diff suppressed because it is too large Load Diff

2253
src/code_805D8C8_3.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,7 @@ extern u8 *gUnknown_80FA090[];
void sub_8068FE0(Entity *, u32, Entity *);
u8 sub_806B8CC();
bool8 sub_805FBE8(u8 *a0);
bool8 DungeonGiveNameToRecruitedMon(u8 *a0);
void sub_8083D88();
u8 sub_808529C(s32);
void nullsub_96(Entity *pokemon,Entity *target);
@ -450,7 +450,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa
sub_8083D88();
sub_803E708(0xa0,0x46);
if (DisplayDungeonYesNoMessage(0,*gUnknown_80FA090,1) == 1) {
while (sub_805FBE8(pokeStruct2->name) == 0) {
while (DungeonGiveNameToRecruitedMon(pokeStruct2->name) == 0) {
DisplayDungeonMessage(0,*gUnknown_80FA0C8,1);
}
}
@ -583,7 +583,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr)
}
else {
if (DisplayDungeonYesNoMessage(0,*gUnknown_80FA090,1) == 1) {
while (!sub_805FBE8(buffer)) {
while (!DungeonGiveNameToRecruitedMon(buffer)) {
DisplayDungeonMessage(0,*gUnknown_80FA0C8,1);
}
}

View File

@ -1,9 +1,10 @@
#include "global.h"
#include "globaldata.h"
#include "dungeon_main.h"
#include "structs/str_dungeon.h"
#include "number_util.h"
#include "input.h"
#include "structs/map.h"
#include "dungeon_main.h"
#include "dungeon_message.h"
#include "dungeon_action.h"
#include "dungeon_ai_targeting.h"
@ -50,13 +51,6 @@
#include "structs/struct_sub80095e4.h"
#include "structs/str_text.h"
struct UnkMenuBitsStruct {
u8 a0_8;
u8 a0_16;
u8 a0_24;
u8 a0_32;
};
extern void HandleSetItemAction(Entity *,bool8);
extern void HandleUnsetItemAction(Entity *,bool8);
extern bool8 sub_8048A68(Entity *param_1,Item *item);
@ -90,6 +84,7 @@ bool8 sub_8094C48(void);
void sub_803E724(s32 a0);
void HandleTalkFieldAction(Entity *);
bool8 sub_8044B28(void);
bool8 sub_805FD3C(struct UnkMenuBitsStruct *a0);
bool8 IsNotAttacking(Entity *param_1, bool8 param_2);
s32 GetTeamMemberEntityIndex(Entity *pokemon);
bool8 sub_8070F80(Entity * pokemon, s32 direction);
@ -149,12 +144,6 @@ extern const u8 *const gUnknown_80FE954;
const u8 *GetCurrentDungeonName(void);
void GetWeatherName(u8 *dst, u8 weatherId);
extern u8 *GetDungeonSubMenuItemString(s32 param_1);
extern bool8 CanSubMenuItemBeChosen(s32 param_1);
extern s32 gDungeonSubMenuItemsCount;
extern const u8 gUnknown_8106B50[];
extern void DungeonShowWindows(Windows *a0, u8 a1);
extern bool8 sub_8070F14(Entity * pokemon, s32 direction);
extern Entity *sub_80696A8(Entity *a0);
@ -184,12 +173,11 @@ static bool8 sub_805EC4C(Entity *a0, u8 a1);
static bool8 sub_805EF60(Entity *a0, EntityInfo *a1);
static void ShowMainMenu(bool8 fromBPress, bool8 a1);
static void PrintOnMainMenu(bool8 printAll);
static bool8 sub_805FD3C(struct UnkMenuBitsStruct *a0);
void DungeonHandlePlayerInput(void)
{
struct UnkMenuBitsStruct r6;
bool8 triggers[5]; // Always FALSE, if one of these is TRUE - they can open various menus or cause an item throw. Most likely used for debugging/testing.
bool8 triggers[5]; // Always FALSE, if one of these is TRUE - they can open various menus or cause an item throw. Used in Blue's touch screen.
s32 frames;
s32 var_38;
UnkDungeonGlobal_unk181E8_sub *unkPtr;
@ -254,7 +242,7 @@ void DungeonHandlePlayerInput(void)
while (r6.a0_8 == 0) {
u32 dpadDiagonal, dpadSimple;
bool32 highlightTiles, tryItemThrow;
bool32 bPress, rPress, unkBool; // Always FALSE, might've been used as debug variables.
bool32 bPress, rPress, unkBool; // Always FALSE, might've been used in Blue.
s32 directionNew;
sArrowsFrames++;
@ -432,8 +420,8 @@ void DungeonHandlePlayerInput(void)
if (highlightTiles) {
sub_805E738(leader);
sInRotateMode = TRUE;
unkPtr->unk1821B = leaderInfo->action.direction;
unkPtr->unk1821C = 0xFF;
unkPtr->rotateModeDirection = leaderInfo->action.direction;
unkPtr->prevRotateModeDirection = 0xFF;
ResetRepeatTimers();
}
@ -525,7 +513,7 @@ void DungeonHandlePlayerInput(void)
bool32 directionChanged = (leaderInfo->action.direction != directionNew);
leaderInfo->action.direction = directionNew & DIRECTION_MASK;
if (sInRotateMode) {
unkPtr->unk1821B = directionNew;
unkPtr->rotateModeDirection = directionNew;
sub_806CDD4(leader, sub_806CEBC(leader), directionNew);
}
else {
@ -638,27 +626,42 @@ void DungeonHandlePlayerInput(void)
}
}
struct UnkStruct_8106AC8
struct DiagonalArrowInfo
{
s16 unk0;
s16 unk2;
u8 unk4;
u8 unk5;
s16 x;
s16 y;
bool8 unk4;
bool8 unk5;
};
extern const struct UnkStruct_8106AC8 gUnknown_8106AC8[];
struct UnkStruct_8106AE8
static const struct DiagonalArrowInfo sDiagonalArrowsInfo[] =
{
s16 unk0;
s16 unk2;
u32 unk4;
u8 unk8;
u8 unk9;
u8 unkA;
{-1, -1, TRUE, FALSE},
{-1, 1, TRUE, TRUE},
{1, 1, FALSE, TRUE},
{1, -1, FALSE, FALSE},
};
extern const struct UnkStruct_8106AE8 gUnknown_8106AE8[];
struct RotateArrowInfo
{
s16 x;
s16 y;
u32 tilemapNum;
bool8 unk8;
bool8 unk9;
};
static const struct RotateArrowInfo sRotateArrowsInfo[] =
{
{0, 1, 0x212, FALSE, TRUE},
{1, 1, 0x213, FALSE, TRUE},
{1, 0, 0x214, FALSE, FALSE},
{1, -1, 0x213, FALSE, FALSE},
{0, -1, 0x212, TRUE, FALSE},
{-1, -1, 0x213, TRUE, FALSE},
{-1, 0, 0x214, TRUE, TRUE},
{-1, 1, 0x213, TRUE, TRUE},
};
// Creates arrow sprites which are used when in rotate or diagonal modes.
static void TryCreateModeArrows(Entity *leader)
@ -681,9 +684,9 @@ static void TryCreateModeArrows(Entity *leader)
SpriteSetBpp(&sprite, 0);
SpriteSetShape(&sprite, 0);
matrixNum = (gUnknown_8106AC8[i].unk4 != 0) ? 8 : 0;
matrixNum = (sDiagonalArrowsInfo[i].unk4) ? 8 : 0;
if (gUnknown_8106AC8[i].unk5)
if (sDiagonalArrowsInfo[i].unk5)
matrixNum += 16;
SpriteSetMatrixNum_UseLocalVar(&sprite, matrixNum);
@ -696,14 +699,14 @@ static void TryCreateModeArrows(Entity *leader)
SpriteSetUnk6_0(&sprite, 0);
SpriteSetUnk6_1(&sprite, 0);
xMul = gUnknown_8106AC8[i].unk0 * 10;
xMul = sDiagonalArrowsInfo[i].x * 10;
x2 = (sArrowsFrames / 2) & 7;
x = (x2 * gUnknown_8106AC8[i].unk0) + xMul + 116;
x = (x2 * sDiagonalArrowsInfo[i].x) + xMul + 116;
SpriteSetX(&sprite, x);
yMul = gUnknown_8106AC8[i].unk2 * 10;
yMul = sDiagonalArrowsInfo[i].y * 10;
y2 = (sArrowsFrames / 2) & 7;
y = (y2 * gUnknown_8106AC8[i].unk2) + yMul + 82;
y = (y2 * sDiagonalArrowsInfo[i].y) + yMul + 82;
SpriteSetY(&sprite, y);
AddSprite(&sprite, 0x100, NULL, NULL);
@ -713,20 +716,20 @@ static void TryCreateModeArrows(Entity *leader)
else if (unkPtr->unk1821A) {
s32 i;
SpriteOAM sprite;
s32 var_2C = unkPtr->unk1821B;
s32 direction = unkPtr->rotateModeDirection;
if (unkPtr->unk1821B < 8) {
if (unkPtr->rotateModeDirection < NUM_DIRECTIONS) {
s32 x, xMul, x2;
s32 y, yMul, y2;
s32 to = (sShowThreeArrows2 != FALSE && sShowThreeArrows1 != FALSE) ? 3 : 1;
xMul = gUnknown_8106AE8[var_2C].unk0 * 10;
xMul = sRotateArrowsInfo[direction].x * 10;
x2 = (sArrowsFrames / 2) & 7;
x = (gUnknown_8106AE8[var_2C].unk0 * x2) + xMul + 116;
x = (sRotateArrowsInfo[direction].x * x2) + xMul + 116;
yMul = gUnknown_8106AE8[var_2C].unk2 * 10;
yMul = sRotateArrowsInfo[direction].y * 10;
y2 = (sArrowsFrames / 2) & 7;
y = (y2 * gUnknown_8106AE8[var_2C].unk2) + yMul + 82;
y = (y2 * sRotateArrowsInfo[direction].y) + yMul + 82;
for (i = 0; i < to; i++) {
u32 matrixNum;
@ -737,15 +740,15 @@ static void TryCreateModeArrows(Entity *leader)
SpriteSetBpp(&sprite, 0);
SpriteSetShape(&sprite, 0);
matrixNum = (gUnknown_8106AE8[var_2C].unk8 != 0) ? 8 : 0;
matrixNum = (sRotateArrowsInfo[direction].unk8 != 0) ? 8 : 0;
if (gUnknown_8106AE8[var_2C].unk9)
if (sRotateArrowsInfo[direction].unk9)
matrixNum += 16;
SpriteSetMatrixNum_UseLocalVar(&sprite, matrixNum);
SpriteSetSize(&sprite, 0);
SpriteSetTileNum(&sprite, gUnknown_8106AE8[var_2C].unk4);
SpriteSetTileNum(&sprite, sRotateArrowsInfo[direction].tilemapNum);
SpriteSetPriority(&sprite, 2);
SpriteSetPalNum(&sprite, 0);
@ -756,15 +759,15 @@ static void TryCreateModeArrows(Entity *leader)
SpriteSetY(&sprite, y);
AddSprite(&sprite, 0x100, NULL, NULL);
x += gUnknown_8106AE8[var_2C].unk0 * 4;
y += gUnknown_8106AE8[var_2C].unk2 * 4;
x += sRotateArrowsInfo[direction].x * 4;
y += sRotateArrowsInfo[direction].y * 4;
}
}
}
if (sInRotateMode && unkPtr->unk1821C != unkPtr->unk1821B) {
unkPtr->unk1821C = unkPtr->unk1821B;
ChangeDungeonCameraPos(&leader->pos, unkPtr->unk1821B, 0, sInRotateMode);
if (sInRotateMode && unkPtr->prevRotateModeDirection != unkPtr->rotateModeDirection) {
unkPtr->prevRotateModeDirection = unkPtr->rotateModeDirection;
ChangeDungeonCameraPos(&leader->pos, unkPtr->rotateModeDirection, 0, sInRotateMode);
}
}
@ -1654,7 +1657,7 @@ static void PrintOnMainMenu(bool8 printAll)
}
}
bool8 sub_805FBE8(u8 *a0)
bool8 DungeonGiveNameToRecruitedMon(u8 *a0)
{
s32 r4;
sub_803EAF0(8, a0);
@ -1673,76 +1676,4 @@ bool8 sub_805FBE8(u8 *a0)
return FALSE;
}
void CreateDungeonMenuSubWindow(Window *mainWindow, s32 subWindowX)
{
s32 i;
Windows windows = {
.id = {
[0] = WINDOW_DUMMY,
[1] = {
.type = WINDOW_TYPE_NORMAL,
.pos = {22, 4},
.width = 6,
.height = 4,
.unk10 = 4,
},
[2] = WINDOW_DUMMY,
[3] = WINDOW_DUMMY,
}
};
windows.id[0] = *mainWindow;
windows.id[0].unk0 = 0x80;
gDungeonMenu.menuIndex = 0;
gDungeonMenu.unk1C = gDungeonSubMenuItemsCount;
gDungeonMenu.unk1A = gDungeonSubMenuItemsCount;
gDungeonMenu.unk1E = 0;
gDungeonMenu.unk20 = 0;
gDungeonMenu.unk4 = 0;
gDungeonMenu.firstEntryY = 0;
gDungeonMenu.unk0 = 1;
gDungeonMenu.unkC = 0;
gDungeonMenu.unkE = 0;
gDungeonMenu.unk14 = gDungeonMenu.unk8;
sub_801317C(&gDungeonMenu.unk28);
windows.id[1].pos.x = subWindowX;
windows.id[1].width = 28 - subWindowX;
windows.id[1].height = windows.id[1].unk10 = sub_80095E4(gDungeonMenu.unk1C, 0);
DungeonShowWindows(&windows, FALSE);
sub_80137B0(&gDungeonMenu, windows.id[1].height * 8);
sub_80073B8(1);
for (i = 0; i < gDungeonSubMenuItemsCount; i++) {
s32 colorId, y;
u8 text[20];
colorId = (CanSubMenuItemBeChosen(i) != FALSE) ? 7 : 2;
sprintfStatic(text, gUnknown_8106B50, colorId, GetDungeonSubMenuItemString(i));
y = GetMenuEntryYCoord(&gDungeonMenu, i);
PrintStringOnWindow(8, y, text, 1, 0);
}
sub_80073E0(1);
}
static bool8 sub_805FD3C(struct UnkMenuBitsStruct *a0)
{
u16 action = GetLeaderActionId();
a0->a0_8 = 0;
a0->a0_16 = 0;
a0->a0_24 = 0;
a0->a0_32 = 0;
if (action == 0xA) {
a0->a0_8 = 1;
a0->a0_32 = 1;
}
if (action == 0x3E) {
a0->a0_8 = 1;
a0->a0_16 = 0;
a0->a0_32 = 1;
}
return a0->a0_8;
}

69
src/dungeon_submenu.c Normal file
View File

@ -0,0 +1,69 @@
#include "global.h"
#include "globaldata.h"
#include "dungeon_submenu.h"
#include "menu_input.h"
#include "text.h"
#include "code_800D090.h"
// The reason this short file(just 1 function) exists is because of the pksdir string which usually signifies the file's beginning.
extern MenuInputStruct gDungeonMenu;
extern s32 gDungeonSubMenuItemsCount;
extern u8 *GetDungeonSubMenuItemString(s32 param_1);
extern bool8 CanSubMenuItemBeChosen(s32 param_1);
extern void DungeonShowWindows(Windows *a0, u8 a1);
void CreateDungeonMenuSubWindow(Window *mainWindow, s32 subWindowX)
{
s32 i;
Windows windows = {
.id = {
[0] = WINDOW_DUMMY,
[1] = {
.type = WINDOW_TYPE_NORMAL,
.pos = {22, 4},
.width = 6,
.height = 4,
.unk10 = 4,
},
[2] = WINDOW_DUMMY,
[3] = WINDOW_DUMMY,
}
};
windows.id[0] = *mainWindow;
windows.id[0].unk0 = 0x80;
gDungeonMenu.menuIndex = 0;
gDungeonMenu.unk1C = gDungeonSubMenuItemsCount;
gDungeonMenu.unk1A = gDungeonSubMenuItemsCount;
gDungeonMenu.unk1E = 0;
gDungeonMenu.unk20 = 0;
gDungeonMenu.unk4 = 0;
gDungeonMenu.firstEntryY = 0;
gDungeonMenu.unk0 = 1;
gDungeonMenu.unkC = 0;
gDungeonMenu.unkE = 0;
gDungeonMenu.unk14 = gDungeonMenu.unk8;
sub_801317C(&gDungeonMenu.unk28);
windows.id[1].pos.x = subWindowX;
windows.id[1].width = 28 - subWindowX;
windows.id[1].height = windows.id[1].unk10 = sub_80095E4(gDungeonMenu.unk1C, 0);
DungeonShowWindows(&windows, FALSE);
sub_80137B0(&gDungeonMenu, windows.id[1].height * 8);
sub_80073B8(1);
for (i = 0; i < gDungeonSubMenuItemsCount; i++) {
s32 colorId, y;
u8 text[20];
colorId = (CanSubMenuItemBeChosen(i) != FALSE) ? 7 : 2;
sprintfStatic(text, _("{COLOR}%c%s"), colorId, GetDungeonSubMenuItemString(i));
y = GetMenuEntryYCoord(&gDungeonMenu, i);
PrintStringOnWindow(8, y, text, 1, 0);
}
sub_80073E0(1);
}

View File

@ -150,6 +150,7 @@ gUnknown_202EE76: /* 202EE76 (sub_804513C - sub_8082A08) */
.include "src/dungeon_move.o"
.include "src/dungeon_main.o"
.include "src/code_805D8C8_2.o"
.include "src/code_805D8C8_3.o"
gUnknown_202F268: /* 202F268 (sub_8062500) */
.space 0x8

View File

@ -115,7 +115,7 @@
.include "src/dungeon_message.o"
.include "src/dungeon_move.o"
.include "src/dungeon_main.o"
.include "src/code_805D8C8_2.o"
.include "src/code_805D8C8_3.o"
.include "src/dungeon_ai_items.o"
.include "src/code_807CD9C.o"
.include "src/dungeon_leader.o"