mirror of
https://github.com/pret/pmd-red.git
synced 2026-08-28 03:34:22 -05:00
start others menu
This commit is contained in:
@@ -5,201 +5,6 @@
|
||||
|
||||
.text
|
||||
|
||||
|
||||
thumb_func_start ShowDungeonOthersMenu
|
||||
ShowDungeonOthersMenu:
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
ldr r0, _08064C94
|
||||
ldr r0, [r0]
|
||||
movs r1, 0xCB
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
movs r1, 0x4
|
||||
mov r9, r1
|
||||
cmp r0, 0
|
||||
beq _08064C02
|
||||
movs r0, 0x5
|
||||
mov r9, r0
|
||||
_08064C02:
|
||||
ldr r1, _08064C98
|
||||
movs r0, 0
|
||||
str r0, [r1]
|
||||
mov r10, r0
|
||||
ldr r6, _08064C9C
|
||||
ldr r7, _08064CA0
|
||||
movs r1, 0x2A
|
||||
adds r1, r6
|
||||
mov r8, r1
|
||||
_08064C14:
|
||||
movs r5, 0
|
||||
bl sub_8065250
|
||||
_08064C1A:
|
||||
adds r0, r6, 0
|
||||
bl AddMenuCursorSprite
|
||||
movs r0, 0x24
|
||||
bl DungeonRunFrameActions
|
||||
ldrh r1, [r7, 0x4]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08064C3E
|
||||
movs r0, 0x1
|
||||
bl PlayDungeonCursorSE
|
||||
adds r0, r6, 0
|
||||
movs r1, 0x1
|
||||
bl MoveMenuCursorDownWrapAround
|
||||
_08064C3E:
|
||||
ldrh r1, [r7, 0x4]
|
||||
movs r0, 0x40
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08064C56
|
||||
movs r0, 0x1
|
||||
bl PlayDungeonCursorSE
|
||||
adds r0, r6, 0
|
||||
movs r1, 0x1
|
||||
bl MoveMenuCursorUpWrapAround
|
||||
_08064C56:
|
||||
ldrh r1, [r7, 0x2]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08064C6A
|
||||
adds r0, r6, 0
|
||||
adds r0, 0x29
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _08064CAA
|
||||
_08064C6A:
|
||||
movs r1, 0x18
|
||||
ldrsh r0, [r6, r1]
|
||||
cmp r0, 0x4
|
||||
bne _08064C8C
|
||||
ldr r0, _08064C94
|
||||
ldr r0, [r0]
|
||||
movs r1, 0xCB
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _08064CA4
|
||||
bl IsBossFight
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08064CA4
|
||||
_08064C8C:
|
||||
bl PlayDungeonConfirmationSE
|
||||
b _08064CC0
|
||||
.align 2, 0
|
||||
_08064C94: .4byte gDungeon
|
||||
_08064C98: .4byte gUnknown_202F2E0
|
||||
_08064C9C: .4byte gDungeonMenu
|
||||
_08064CA0: .4byte gRealInputs
|
||||
_08064CA4:
|
||||
bl PlayDungeonCancelSE
|
||||
b _08064CC0
|
||||
_08064CAA:
|
||||
movs r0, 0x2
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08064CBA
|
||||
mov r1, r8
|
||||
ldrb r0, [r1]
|
||||
cmp r0, 0
|
||||
beq _08064C1A
|
||||
_08064CBA:
|
||||
bl PlayDungeonCancelSE
|
||||
movs r5, 0x1
|
||||
_08064CC0:
|
||||
ldr r4, _08064D68
|
||||
adds r0, r4, 0
|
||||
bl AddMenuCursorSprite
|
||||
movs r0, 0x24
|
||||
bl DungeonRunFrameActions
|
||||
mov r0, r10
|
||||
cmp r0, 0
|
||||
bne _08064C14
|
||||
cmp r5, 0
|
||||
bne _08064D4C
|
||||
ldr r5, _08064D6C
|
||||
movs r1, 0x18
|
||||
ldrsh r0, [r4, r1]
|
||||
str r0, [r5]
|
||||
cmp r0, 0
|
||||
bne _08064CE8
|
||||
bl sub_8064D74
|
||||
_08064CE8:
|
||||
ldr r0, [r5]
|
||||
cmp r0, 0x1
|
||||
bne _08064CF2
|
||||
bl sub_80650C0
|
||||
_08064CF2:
|
||||
ldr r0, [r5]
|
||||
cmp r0, 0x2
|
||||
bne _08064CFC
|
||||
bl DisplayMessageLog
|
||||
_08064CFC:
|
||||
ldr r0, [r5]
|
||||
cmp r0, 0x3
|
||||
bne _08064D06
|
||||
bl sub_806519C
|
||||
_08064D06:
|
||||
ldr r0, _08064D70
|
||||
ldr r0, [r0]
|
||||
movs r1, 0xCB
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _08064D2A
|
||||
bl IsBossFight
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08064D2A
|
||||
ldr r0, [r5]
|
||||
cmp r0, 0x4
|
||||
bne _08064D2A
|
||||
bl sub_8065FB4
|
||||
_08064D2A:
|
||||
ldr r0, _08064D6C
|
||||
ldr r0, [r0]
|
||||
cmp r0, r9
|
||||
bne _08064D36
|
||||
bl sub_8065BF4
|
||||
_08064D36:
|
||||
ldr r0, _08064D70
|
||||
ldr r0, [r0]
|
||||
ldrb r0, [r0, 0x4]
|
||||
cmp r0, 0
|
||||
bne _08064D4C
|
||||
bl GetLeaderActionId
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
bne _08064D4C
|
||||
b _08064C14
|
||||
_08064D4C:
|
||||
bl sub_8040A84
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl sub_803EAF0
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08064D68: .4byte gDungeonMenu
|
||||
_08064D6C: .4byte gUnknown_202F2E0
|
||||
_08064D70: .4byte gDungeon
|
||||
thumb_func_end ShowDungeonOthersMenu
|
||||
|
||||
thumb_func_start sub_8064D74
|
||||
sub_8064D74:
|
||||
push {r4-r7,lr}
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
.section .rodata
|
||||
|
||||
|
||||
@ CreateFieldItemMenu - sub_8062CA8
|
||||
|
||||
|
||||
|
||||
@ CreateFieldDungeonMenu - CreateFieldOthersMenu
|
||||
.align 2,0
|
||||
.string "pksdir0\0"
|
||||
|
||||
.align 2,0
|
||||
|
||||
.global gUnknown_8106CE8
|
||||
|
||||
6
include/dungeon_menu_others.h
Normal file
6
include/dungeon_menu_others.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef GUARD_DUNGEON_MENU_OTHERS_H
|
||||
#define GUARD_DUNGEON_MENU_OTHERS_H
|
||||
|
||||
void ShowDungeonOthersMenu(void);
|
||||
|
||||
#endif
|
||||
@@ -233,6 +233,7 @@ SECTIONS {
|
||||
src/dungeon_menu_moves.o(.text);
|
||||
src/dungeon_menu_tile.o(.text);
|
||||
src/dungeon_menu_stairs.o(.text);
|
||||
src/dungeon_menu_others.o(.text);
|
||||
asm/code_805D8C8.o(.text);
|
||||
src/code_8066D04.o(.text);
|
||||
src/code_805D8C8.o(.text);
|
||||
@@ -554,6 +555,7 @@ SECTIONS {
|
||||
src/dungeon_menu_moves.o(.rodata);
|
||||
src/dungeon_menu_tile.o(.rodata);
|
||||
src/dungeon_menu_stairs.o(.rodata);
|
||||
src/dungeon_menu_others.o(.rodata);
|
||||
data/data_8106A4C.o(.rodata);
|
||||
src/code_8066D04.o(.rodata);
|
||||
data/data_8106A4C_2.o(.rodata);
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "dungeon_menu_moves.h"
|
||||
#include "dungeon_menu_tile.h"
|
||||
#include "dungeon_menu_stairs.h"
|
||||
#include "dungeon_menu_others.h"
|
||||
#include "constants/dungeon.h"
|
||||
#include "constants/status.h"
|
||||
#include "constants/tactic.h"
|
||||
@@ -74,7 +75,6 @@ void sub_806A2BC(Entity *a0, u8 a1);
|
||||
bool8 sub_80701A4(Entity *a0);
|
||||
void sub_803E708(s32 a0, s32 a1);
|
||||
void sub_8040A78(void);
|
||||
void ShowDungeonOthersMenu(void);
|
||||
void sub_8075680(u32);
|
||||
void sub_8094C88(void);
|
||||
void sub_8040A84(void);
|
||||
|
||||
118
src/dungeon_menu_others.c
Normal file
118
src/dungeon_menu_others.c
Normal file
@@ -0,0 +1,118 @@
|
||||
#include "global.h"
|
||||
#include "globaldata.h"
|
||||
#include "dungeon_menu_others.h"
|
||||
#include "dungeon_submenu.h"
|
||||
#include "dungeon.h"
|
||||
#include "text.h"
|
||||
#include "menu_input.h"
|
||||
#include "input.h"
|
||||
#include "code_8044CC8.h"
|
||||
#include "dungeon_action.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "code_8045A00.h"
|
||||
#include "code_8097DD0.h"
|
||||
#include "dungeon_message.h"
|
||||
|
||||
extern void PlayDungeonStartButtonSE(void);
|
||||
extern void PlayDungeonCancelSE(void);
|
||||
extern void PlayDungeonConfirmationSE(void);
|
||||
extern void PlayDungeonCursorSE(u8 param_1);
|
||||
extern void sub_803EAF0(u32, u8 *);
|
||||
extern bool8 CanSubMenuItemBeChosen(s32 param_1);
|
||||
extern void DungeonRunFrameActions(u32 a0);
|
||||
extern void DungeonShowWindows(WindowTemplates *a0, bool8 a1);
|
||||
extern void AddActionToDungeonSubMenu(u16 actionId, u8 param_2);
|
||||
extern void sub_8045064(void);
|
||||
extern void sub_8040A84(void);
|
||||
extern bool8 IsBossFight(void);
|
||||
extern u16 GetLeaderActionId(void);
|
||||
|
||||
extern MenuInputStruct gDungeonMenu;
|
||||
extern s32 gDungeonSubMenuItemsCount;
|
||||
extern s32 gUnknown_202F2E0;
|
||||
|
||||
void sub_8065250(void);
|
||||
void sub_8064D74(void);
|
||||
void sub_80650C0(void);
|
||||
void sub_806519C(void);
|
||||
void sub_8065FB4(void);
|
||||
void sub_8065BF4(void);
|
||||
|
||||
void ShowDungeonOthersMenu(void)
|
||||
{
|
||||
bool8 unkAlwaysFalse;
|
||||
s32 lastId = (gDungeon->unk644.unk14) ? 5 : 4;
|
||||
|
||||
gUnknown_202F2E0 = 0;
|
||||
unkAlwaysFalse = FALSE;
|
||||
while (1) {
|
||||
bool8 bPress = FALSE;
|
||||
|
||||
sub_8065250();
|
||||
while (1) {
|
||||
AddMenuCursorSprite(&gDungeonMenu);
|
||||
DungeonRunFrameActions(0x24);
|
||||
if (gRealInputs.repeated & DPAD_DOWN) {
|
||||
PlayDungeonCursorSE(TRUE);
|
||||
MoveMenuCursorDownWrapAround(&gDungeonMenu, TRUE);
|
||||
}
|
||||
if (gRealInputs.repeated & DPAD_UP) {
|
||||
PlayDungeonCursorSE(TRUE);
|
||||
MoveMenuCursorUpWrapAround(&gDungeonMenu, TRUE);
|
||||
}
|
||||
|
||||
if ((gRealInputs.pressed & A_BUTTON) || gDungeonMenu.unk28.a_button) {
|
||||
if (gDungeonMenu.menuIndex != 4 || (gDungeon->unk644.unk14 && !IsBossFight())) {
|
||||
PlayDungeonConfirmationSE();
|
||||
}
|
||||
else {
|
||||
PlayDungeonCancelSE();
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if ((gRealInputs.pressed & B_BUTTON) || gDungeonMenu.unk28.b_button) {
|
||||
PlayDungeonCancelSE();
|
||||
bPress = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
AddMenuCursorSprite(&gDungeonMenu);
|
||||
DungeonRunFrameActions(0x24);
|
||||
if (unkAlwaysFalse)
|
||||
continue;
|
||||
if (bPress)
|
||||
break;
|
||||
|
||||
gUnknown_202F2E0 = gDungeonMenu.menuIndex;
|
||||
if (gUnknown_202F2E0 == 0) {
|
||||
sub_8064D74();
|
||||
}
|
||||
if (gUnknown_202F2E0 == 1) {
|
||||
sub_80650C0();
|
||||
}
|
||||
if (gUnknown_202F2E0 == 2) {
|
||||
DisplayMessageLog();
|
||||
}
|
||||
if (gUnknown_202F2E0 == 3) {
|
||||
sub_806519C();
|
||||
}
|
||||
if (gDungeon->unk644.unk14 && !IsBossFight() && gUnknown_202F2E0 == 4) {
|
||||
sub_8065FB4();
|
||||
}
|
||||
if (gUnknown_202F2E0 == lastId) {
|
||||
sub_8065BF4();
|
||||
}
|
||||
|
||||
if (gDungeon->unk4)
|
||||
break;
|
||||
if (GetLeaderActionId() != ACTION_NOTHING)
|
||||
break;
|
||||
}
|
||||
|
||||
sub_8040A84();
|
||||
sub_803EAF0(0, NULL);
|
||||
}
|
||||
|
||||
//
|
||||
Reference in New Issue
Block a user