through sub_80E9FB0

This commit is contained in:
PikalaxALT 2017-10-26 22:10:38 -04:00
parent ae3119a9c8
commit 68a253990d
3 changed files with 44 additions and 100 deletions

View File

@ -5,104 +5,6 @@
.text
thumb_func_start sub_80E9F20
sub_80E9F20: @ 80E9F20
push {r4-r6,lr}
mov r6, r8
push {r6}
sub sp, 0x8
lsls r0, 24
lsrs r0, 24
lsls r4, r0, 2
adds r4, r0
lsls r4, 3
ldr r6, =gTasks + 0x8
adds r5, r4, r6
ldrb r0, [r5, 0x10]
bl RemoveScrollIndicatorArrowPair
ldr r0, =gUnknown_0858D06C
ldr r1, [r0, 0xC]
ldr r0, [r0, 0x8]
str r0, [sp]
str r1, [sp, 0x4]
ldr r0, =gUnknown_0858D048
mov r8, r0
movs r1, 0x2
bl GetMaxWidthInMenuTable
lsls r0, 24
ldr r2, =0x00ffffff
ldr r1, [sp]
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
bl AddWindow
strh r0, [r5, 0xE]
lsls r0, 24
lsrs r0, 24
movs r1, 0
bl SetStandardWindowBorderStyle
ldrb r0, [r5, 0xE]
movs r1, 0x2
mov r2, r8
bl PrintMenuTable
ldrb r0, [r5, 0xE]
movs r1, 0x2
movs r2, 0
bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed
movs r0, 0
bl schedule_bg_copy_tilemap_to_vram
subs r6, 0x8
adds r4, r6
ldr r0, =sub_80E9FB0
str r0, [r4]
add sp, 0x8
pop {r3}
mov r8, r3
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_80E9F20
thumb_func_start sub_80E9FB0
sub_80E9FB0: @ 80E9FB0
push {r4-r6,lr}
lsls r0, 24
lsrs r5, r0, 24
adds r6, r5, 0
bl ProcessMenuInputNoWrapAround
lsls r0, 24
asrs r4, r0, 24
movs r0, 0x2
negs r0, r0
cmp r4, r0
beq _080E9FF2
adds r0, 0x1
cmp r4, r0
bne _080E9FDC
movs r0, 0x5
bl PlaySE
adds r0, r5, 0
bl sub_80EA18C
b _080E9FF2
_080E9FDC:
movs r0, 0x5
bl PlaySE
ldr r0, =gUnknown_0858D048
lsls r1, r4, 3
adds r0, 0x4
adds r1, r0
ldr r1, [r1]
adds r0, r6, 0
bl _call_via_r1
_080E9FF2:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_80E9FB0
thumb_func_start sub_80E9FFC
sub_80E9FFC: @ 80E9FFC
push {r4,r5,lr}

View File

@ -21,6 +21,7 @@ void PrintMenuTable(u8 idx, u8 nstrs, const struct MenuAction *strs);
void InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 idx, u8 nstrs,u8);
u8 GetMenuCursorPos(void);
s8 ProcessMenuInput(void);
s8 ProcessMenuInputNoWrapAround(void);
void blit_move_info_icon(u8 winId, u8 a2, u16 x, u16 y);
void reset_temp_tile_data_buffers(void);
int decompress_and_copy_tile_data_to_vram(u8 bg_id, const void *src, int size, u16 offset, u8 mode);

View File

@ -26,6 +26,7 @@
#include "script.h"
#include "event_scripts.h"
#include "strings.h"
#include "international_string_util.h"
#include "event_data.h"
#include "decoration.h"
#include "decoration_inventory.h"
@ -51,7 +52,9 @@ void sub_80E9E00(u8 taskId);
void sub_80E9E44(u8 taskId);
void sub_80E9E90(u8 taskId);
void sub_80E9F20(u8 taskId);
void sub_80E9FB0(u8 taskId);
void task_pc_turn_off(u8 taskId);
u8 sub_80EA18C(u8 sbId);
u8 sub_80EA20C(u8 sbId);
// .rodata
@ -63,8 +66,9 @@ extern const struct {
extern const u8 gUnknown_0858CFE8[];
extern const u8 gUnknown_0858D060[];
extern const struct WindowTemplate gUnknown_0858D06C;
extern const struct WindowTemplate gUnknown_0858D06C[];
extern const struct ListMenuTemplate gUnknown_0858D07C;
extern const struct MenuAction gUnknown_0858D048[];
// .text
@ -980,7 +984,7 @@ void sub_80E9C9C(u8 taskId)
data[2] = 0;
sub_8197434(0, 0);
gUnknown_0203A020 = calloc(1, sizeof(struct SecretBaseListMenuBuffer));
data[6] = AddWindow(&gUnknown_0858D06C);
data[6] = AddWindow(&gUnknown_0858D06C[0]);
game_continue(taskId);
sub_80E9E00(taskId);
gTasks[taskId].func = sub_80E9E90;
@ -1084,3 +1088,40 @@ void sub_80E9E90(u8 taskId)
break;
}
}
void sub_80E9F20(u8 taskId)
{
struct WindowTemplate template;
s16 *data;
data = gTasks[taskId].data;
RemoveScrollIndicatorArrowPair(data[8]);
template = gUnknown_0858D06C[1];
template.width = GetMaxWidthInMenuTable(gUnknown_0858D048, 2);
data[7] = AddWindow(&template);
SetStandardWindowBorderStyle(data[7], 0);
PrintMenuTable(data[7], 2, gUnknown_0858D048);
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(data[7], 2, 0);
schedule_bg_copy_tilemap_to_vram(0);
gTasks[taskId].func = sub_80E9FB0;
}
void sub_80E9FB0(u8 taskId)
{
s8 input;
input = ProcessMenuInputNoWrapAround();
switch (input)
{
case -1:
PlaySE(SE_SELECT);
sub_80EA18C(taskId);
break;
case -2:
break;
default:
PlaySE(SE_SELECT);
gUnknown_0858D048[input].func.void_u8(taskId);
break;
}
}