mirror of
https://github.com/pret/pmd-red.git
synced 2026-07-18 16:53:54 -05:00
more dungeon menu others
This commit is contained in:
parent
9c2e1b2aa4
commit
5a972144b9
|
|
@ -6,157 +6,6 @@
|
|||
.text
|
||||
|
||||
|
||||
thumb_func_start sub_8065948
|
||||
sub_8065948:
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0xCC
|
||||
add r0, sp, 0x64
|
||||
mov r10, r0
|
||||
movs r1, 0
|
||||
movs r2, 0x60
|
||||
bl memset
|
||||
movs r0, 0x6
|
||||
str r0, [sp, 0x68]
|
||||
add r0, sp, 0x6C
|
||||
movs r4, 0
|
||||
movs r5, 0
|
||||
movs r1, 0x2
|
||||
mov r9, r1
|
||||
mov r2, r9
|
||||
strh r2, [r0]
|
||||
strh r2, [r0, 0x2]
|
||||
add r1, sp, 0x70
|
||||
movs r0, 0x12
|
||||
strh r0, [r1]
|
||||
mov r0, sp
|
||||
adds r0, 0x72
|
||||
movs r6, 0x10
|
||||
strh r6, [r0]
|
||||
add r0, sp, 0x74
|
||||
strh r6, [r0]
|
||||
add r3, sp, 0xC4
|
||||
mov r8, r3
|
||||
str r3, [sp, 0x78]
|
||||
movs r1, 0x3
|
||||
str r1, [sp, 0x80]
|
||||
add r0, sp, 0x94
|
||||
str r1, [r0, 0x4]
|
||||
add r0, sp, 0xAC
|
||||
str r1, [r0, 0x4]
|
||||
add r0, sp, 0x4
|
||||
mov r1, r10
|
||||
movs r2, 0x60
|
||||
bl memcpy
|
||||
mov r1, r10
|
||||
ldr r0, _08065A78
|
||||
ldm r0!, {r2,r3,r7}
|
||||
stm r1!, {r2,r3,r7}
|
||||
movs r0, 0x1
|
||||
mov r7, r8
|
||||
strb r0, [r7]
|
||||
strb r4, [r7, 0x1]
|
||||
strb r4, [r7, 0x3]
|
||||
ldr r4, _08065A7C
|
||||
strh r0, [r4, 0x1A]
|
||||
strh r0, [r4, 0x1C]
|
||||
strh r5, [r4, 0x1E]
|
||||
strh r5, [r4, 0x20]
|
||||
strh r5, [r4, 0x4]
|
||||
strh r6, [r4, 0x6]
|
||||
strh r5, [r4, 0xC]
|
||||
strh r5, [r4, 0xE]
|
||||
strh r5, [r4, 0x14]
|
||||
str r5, [r4]
|
||||
adds r0, r4, 0
|
||||
adds r0, 0x28
|
||||
bl sub_801317C
|
||||
add r1, sp, 0x4
|
||||
movs r0, 0x18
|
||||
strh r0, [r1, 0xC]
|
||||
movs r0, 0x1
|
||||
movs r1, 0xC
|
||||
bl sub_80095E4
|
||||
add r2, sp, 0x4
|
||||
adds r1, r2, 0
|
||||
adds r0, 0x2
|
||||
strh r0, [r1, 0x10]
|
||||
strh r0, [r2, 0xE]
|
||||
movs r0, 0xA
|
||||
strb r0, [r7, 0x2]
|
||||
adds r0, r1, 0
|
||||
mov r1, r9
|
||||
strh r1, [r0, 0x8]
|
||||
movs r1, 0x1
|
||||
bl DungeonShowWindows
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
bl sub_80137B0
|
||||
movs r4, 0
|
||||
mov r7, r10
|
||||
add r6, sp, 0xC8
|
||||
adds r5, r6, 0
|
||||
_08065A0A:
|
||||
ldr r0, _08065A7C
|
||||
adds r1, r4, 0
|
||||
bl GetMenuEntryYCoord
|
||||
stm r5!, {r0}
|
||||
adds r4, 0x1
|
||||
cmp r4, 0
|
||||
ble _08065A0A
|
||||
movs r0, 0
|
||||
bl sub_80073B8
|
||||
ldr r0, _08065A80
|
||||
ldr r2, [r0]
|
||||
movs r4, 0
|
||||
str r4, [sp]
|
||||
movs r0, 0x10
|
||||
movs r1, 0
|
||||
movs r3, 0
|
||||
bl PrintFormattedStringOnWindow
|
||||
ldr r1, [r6]
|
||||
ldr r0, _08065A84
|
||||
ldr r2, [r0]
|
||||
str r4, [sp]
|
||||
movs r0, 0x8
|
||||
movs r3, 0
|
||||
bl PrintFormattedStringOnWindow
|
||||
ldr r0, _08065A88
|
||||
ldrb r1, [r0, 0x8]
|
||||
lsls r3, r1, 2
|
||||
adds r1, r3, r1
|
||||
lsls r1, 3
|
||||
adds r1, 0x50
|
||||
add r0, sp, 0xC8
|
||||
ldr r2, [r0]
|
||||
adds r2, 0xA
|
||||
adds r3, r7, r3
|
||||
ldr r3, [r3]
|
||||
movs r0, 0x7
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
bl AddDoubleUnderScoreHighlight
|
||||
movs r0, 0
|
||||
bl sub_80073E0
|
||||
add sp, 0xCC
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08065A78: .4byte gUnknown_8106CF4
|
||||
_08065A7C: .4byte gDungeonMenu
|
||||
_08065A80: .4byte gOptionsOthersTextPtr
|
||||
_08065A84: .4byte gOptionsWindowColorPtr
|
||||
_08065A88: .4byte gUnknown_202F2E8
|
||||
thumb_func_end sub_8065948
|
||||
|
||||
thumb_func_start sub_8065A8C
|
||||
sub_8065A8C:
|
||||
push {lr}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,6 @@
|
|||
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8106CF4
|
||||
gUnknown_8106CF4: @ 8106CF4
|
||||
.byte 0x13, 0x00, 0x00, 0x00
|
||||
.byte 0x11, 0x00, 0x00, 0x00
|
||||
.byte 0x19, 0x00, 0x00, 0x00
|
||||
|
||||
@ sub_8065FB4 - sub_8066358
|
||||
.string "pksdir0\0"
|
||||
.align 2,0
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ typedef struct Window
|
|||
{
|
||||
s16 x;
|
||||
s16 y;
|
||||
s16 unk4;
|
||||
s16 unk6;
|
||||
s16 width;
|
||||
s16 height;
|
||||
s16 unk8;
|
||||
u32 unkC;
|
||||
s32 type;
|
||||
u32 unk10;
|
||||
u32 unk14;
|
||||
u32 *unk18;
|
||||
|
|
@ -56,7 +56,9 @@ typedef struct WindowTemplate
|
|||
|
||||
#define WINDOW_TYPE_0 0
|
||||
#define WINDOW_TYPE_WITHOUT_BORDER 1
|
||||
#define WINDOW_TYPE_2 2
|
||||
#define WINDOW_TYPE_NORMAL 3
|
||||
#define WINDOW_TYPE_4 4
|
||||
#define WINDOW_TYPE_FILL_TRANSPARENT 5
|
||||
#define WINDOW_TYPE_WITH_HEADER 6
|
||||
#define WINDOW_TYPE_7 7
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ extern const u8 *const gUnknown_80FE7C0;
|
|||
extern const u8 *const gUnknown_80FE788;
|
||||
extern const u8 *const gUnknown_80FE7A8;
|
||||
extern const u8 *const gUnknown_80FE7E4;
|
||||
extern const u8 *const gOptionsOthersTextPtr;
|
||||
extern const u8 *const gOptionsWindowColorPtr;
|
||||
|
||||
void PrintOthersMenuOptions(void);
|
||||
void ShowGameOptionsMenu(void);
|
||||
|
|
@ -75,7 +77,7 @@ void TrySetNewGameOptions(bool8 bPressed);
|
|||
void AskToResetToDefault(void);
|
||||
void PrintGameOptions(void);
|
||||
void PrintDungeonOptions(void);
|
||||
void sub_8065948(void);
|
||||
void PrintOthersOptions(void);
|
||||
void sub_8065A8C(s32 optionId);
|
||||
void sub_8065B3C(s32 optionId);
|
||||
bool8 sub_8065BEC(void);
|
||||
|
|
@ -234,9 +236,11 @@ enum {
|
|||
OPTION_GRIDS,
|
||||
OPTION_MAP,
|
||||
OPTION_WINDOWS,
|
||||
OPTION_COUNT
|
||||
};
|
||||
|
||||
#define DUNGEON_OPTIONS_COUNT OPTION_WINDOWS
|
||||
#define OTHERS_OPTIONS_COUNT (OPTION_COUNT - DUNGEON_OPTIONS_COUNT)
|
||||
|
||||
bool8 ShowDungeonOptions(void)
|
||||
{
|
||||
|
|
@ -309,7 +313,7 @@ bool8 ShowOthersOptions(void)
|
|||
bPress = FALSE;
|
||||
dpadMoved = FALSE;
|
||||
|
||||
sub_8065948();
|
||||
PrintOthersOptions();
|
||||
while (1) {
|
||||
AddMenuCursorSprite(&gDungeonMenu);
|
||||
DungeonRunFrameActions(0x24);
|
||||
|
|
@ -669,7 +673,7 @@ void PrintDungeonOptions(void)
|
|||
[3] = WINDOW_DUMMY,
|
||||
}
|
||||
};
|
||||
s32 arr[] = {16, 25, 27};
|
||||
s32 mapOptionUnderscoreWidths[] = {16, 25, 27};
|
||||
|
||||
header.count = 1;
|
||||
header.currId = 0;
|
||||
|
|
@ -734,7 +738,64 @@ void PrintDungeonOptions(void)
|
|||
AddDoubleUnderScoreHighlight(0, 80, y[3] + 10, 16, 7);
|
||||
}
|
||||
|
||||
AddDoubleUnderScoreHighlight(0, 80 + (gUnknown_202F2E8.mapOption * 40), y[4] + 10, arr[gUnknown_202F2E8.mapOption], 7);
|
||||
AddDoubleUnderScoreHighlight(0, 80 + (gUnknown_202F2E8.mapOption * 40), y[4] + 10, mapOptionUnderscoreWidths[gUnknown_202F2E8.mapOption], 7);
|
||||
|
||||
sub_80073E0(0);
|
||||
}
|
||||
|
||||
void PrintOthersOptions(void)
|
||||
{
|
||||
s32 i;
|
||||
s32 y[OTHERS_OPTIONS_COUNT];
|
||||
WindowHeader header;
|
||||
WindowTemplates windows = {
|
||||
.id = {
|
||||
[0] = {
|
||||
.type = WINDOW_TYPE_WITH_HEADER,
|
||||
.pos = {2, 2},
|
||||
.width = 18,
|
||||
.height = 16,
|
||||
.unk10 = 16,
|
||||
.unk12 = 0,
|
||||
.header = &header,
|
||||
},
|
||||
[1] = WINDOW_DUMMY,
|
||||
[2] = WINDOW_DUMMY,
|
||||
[3] = WINDOW_DUMMY,
|
||||
}
|
||||
};
|
||||
s32 underscoreWidths[] = {19, 17, 25};
|
||||
|
||||
header.count = 1;
|
||||
header.currId = 0;
|
||||
header.f3 = 0;
|
||||
|
||||
gDungeonMenu.unk1A = OTHERS_OPTIONS_COUNT;
|
||||
gDungeonMenu.unk1C = OTHERS_OPTIONS_COUNT;
|
||||
gDungeonMenu.unk1E = 0;
|
||||
gDungeonMenu.unk20 = 0;
|
||||
gDungeonMenu.unk4 = 0;
|
||||
gDungeonMenu.firstEntryY = 16;
|
||||
gDungeonMenu.unkC = 0;
|
||||
gDungeonMenu.unkE = 0;
|
||||
gDungeonMenu.unk14.x = 0;
|
||||
gDungeonMenu.unk0 = 0;
|
||||
sub_801317C(&gDungeonMenu.unk28);
|
||||
windows.id[0].width = 24;
|
||||
windows.id[0].height = windows.id[0].unk10 = sub_80095E4(OTHERS_OPTIONS_COUNT, 12) + 2;
|
||||
header.width = 10;
|
||||
windows.id[0].pos.x = 2;
|
||||
DungeonShowWindows(&windows, TRUE);
|
||||
sub_80137B0(&gDungeonMenu, 0);
|
||||
|
||||
for (i = 0; i < OTHERS_OPTIONS_COUNT; i++) {
|
||||
y[i] = GetMenuEntryYCoord(&gDungeonMenu, i);
|
||||
}
|
||||
sub_80073B8(0);
|
||||
|
||||
PrintFormattedStringOnWindow(16, 0, gOptionsOthersTextPtr, 0, '\0');
|
||||
PrintFormattedStringOnWindow(8, y[0], gOptionsWindowColorPtr, 0, '\0');
|
||||
AddDoubleUnderScoreHighlight(0, 80 + (gUnknown_202F2E8.windowColor * 40), y[0] + 10, underscoreWidths[gUnknown_202F2E8.windowColor], 7);
|
||||
|
||||
sub_80073E0(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -386,21 +386,20 @@ void sub_8012EBC(MenuStruct *param_1)
|
|||
const u32 *colorArray;
|
||||
s32 counter;
|
||||
s32 index;
|
||||
WindowTemplates textStack;
|
||||
WindowTemplates winTemplates;
|
||||
u8 buffer[256];
|
||||
Window *ptr_text;
|
||||
WindowTemplate *ptr_text2;
|
||||
Window *window;
|
||||
|
||||
if (param_1->unk4D) {
|
||||
sub_80073B8(param_1->index);
|
||||
index = param_1->index;
|
||||
ptr_text = &gWindows[index];
|
||||
window = &gWindows[index];
|
||||
|
||||
if (ptr_text->unkC == 6) {
|
||||
ptr_text2 = &textStack.id[index];
|
||||
RestoreUnkTextStruct_8006518(&textStack);
|
||||
if (window->type == WINDOW_TYPE_WITH_HEADER) {
|
||||
WindowTemplate *windowTemplate = &winTemplates.id[index];
|
||||
RestoreUnkTextStruct_8006518(&winTemplates);
|
||||
x = sub_8008ED0(param_1->unk0);
|
||||
PrintFormattedStringOnWindow(((ptr_text2->header->width * 8 - x) / 2) + 8, 0, param_1->unk0, param_1->index, 0);
|
||||
PrintFormattedStringOnWindow(((windowTemplate->header->width * 8 - x) / 2) + 8, 0, param_1->unk0, param_1->index, 0);
|
||||
}
|
||||
|
||||
colorArray = param_1->menuTextColorArray;
|
||||
|
|
@ -538,20 +537,18 @@ bool8 sub_8013114(MenuStruct *param_1, s32 *menuAction)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static void sub_8013134(MenuInputStruct *param_1, u32 menuItemCounter, u32 index)
|
||||
static void sub_8013134(MenuInputStruct *param_1, u32 menuItemCounter, u32 windowId)
|
||||
{
|
||||
Window *temp;
|
||||
Window *window = &gWindows[windowId];
|
||||
|
||||
temp = &gWindows[index];
|
||||
|
||||
param_1->unk0 = index;
|
||||
param_1->unk0 = windowId;
|
||||
param_1->menuIndex = 0;
|
||||
param_1->unk1A = menuItemCounter;
|
||||
param_1->unk1C = menuItemCounter;
|
||||
param_1->unk1E = 0;
|
||||
param_1->unk4 = 0;
|
||||
|
||||
if (temp->unkC == 6)
|
||||
if (window->type == WINDOW_TYPE_WITH_HEADER)
|
||||
param_1->firstEntryY = 16;
|
||||
else
|
||||
param_1->firstEntryY = 2;
|
||||
|
|
@ -798,12 +795,12 @@ void sub_80137B0(MenuInputStruct *param_1, s32 param_2)
|
|||
iVar2 = param_2 << 8;
|
||||
}
|
||||
else {
|
||||
if (gWindows[param_1->unk0].unkC == 6)
|
||||
if (gWindows[param_1->unk0].type == WINDOW_TYPE_WITH_HEADER)
|
||||
iVar1 = 16;
|
||||
else
|
||||
iVar1 = 0;
|
||||
|
||||
iVar2 = (gWindows[param_1->unk0].unk6 * 8 - iVar1) << 8;
|
||||
iVar2 = (gWindows[param_1->unk0].height * 8 - iVar1) << 8;
|
||||
}
|
||||
|
||||
param_1->unk10 = iVar2 / param_1->unk1C;
|
||||
|
|
@ -957,7 +954,7 @@ void sub_8013984(MenuInputStruct *param_1)
|
|||
|
||||
param_1->unk4 = 0;
|
||||
|
||||
if (window->unkC == 6)
|
||||
if (window->type== WINDOW_TYPE_WITH_HEADER)
|
||||
param_1->firstEntryY = 16;
|
||||
else
|
||||
param_1->firstEntryY = 0;
|
||||
|
|
@ -965,7 +962,7 @@ void sub_8013984(MenuInputStruct *param_1)
|
|||
if (param_1->unk20 < 2)
|
||||
param_1->unkC = 0;
|
||||
else
|
||||
param_1->unkC = (window->x + window->unk4 - 2) * 8;
|
||||
param_1->unkC = (window->x + window->width - 2) * 8;
|
||||
|
||||
param_1->unkE = (window->y + 1) * 8 - 2;
|
||||
}
|
||||
|
|
|
|||
590
src/text.c
590
src/text.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user