sub_8009900

This commit is contained in:
PikalaxALT 2017-11-08 19:58:59 -05:00
parent e68dbd6276
commit 9a9f601244
4 changed files with 39 additions and 88 deletions

View file

@ -5,92 +5,6 @@
.text
thumb_func_start sub_8009900
sub_8009900: @ 8009900
push {r4,r5,lr}
sub sp, 0x4
ldr r4, =gMain
ldrh r1, [r4, 0x2E]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _08009916
ldr r1, =gUnknown_03003144
movs r0, 0x1
strb r0, [r1]
_08009916:
ldrh r1, [r4, 0x2C]
movs r5, 0x2
adds r0, r5, 0
ands r0, r1
cmp r0, 0
beq _0800992A
ldr r0, =0x02004000
ldr r1, =0x00002004
bl sub_800A2F4
_0800992A:
ldrh r1, [r4, 0x2E]
movs r0, 0x80
lsls r0, 2
ands r0, r1
cmp r0, 0
beq _08009946
movs r0, 0x1
negs r0, r0
str r5, [sp]
movs r1, 0
movs r2, 0x10
movs r3, 0
bl BeginNormalPaletteFade
_08009946:
ldrh r1, [r4, 0x2E]
movs r0, 0x8
ands r0, r1
cmp r0, 0
beq _08009956
movs r0, 0x1
bl sub_800B330
_08009956:
ldrh r1, [r4, 0x2E]
movs r0, 0x80
lsls r0, 1
ands r0, r1
cmp r0, 0
beq _08009968
movs r0, 0x1
bl TrySavingData
_08009968:
ldrh r1, [r4, 0x2E]
movs r0, 0x4
ands r0, r1
cmp r0, 0
beq _08009976
bl sub_800AC34
_08009976:
ldr r0, =gUnknown_020223BC
ldrb r0, [r0]
cmp r0, 0
beq _08009996
ldr r2, [r4, 0x24]
ldr r0, =gUnknown_03002748
ldrb r1, [r0]
ldr r0, =gUnknown_03003140
ldr r0, [r0]
cmp r0, 0
bne _08009990
movs r0, 0x10
orrs r1, r0
_08009990:
adds r0, r2, 0
bl sub_800A994
_08009996:
add sp, 0x4
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_8009900
thumb_func_start c2_08009A8C
c2_08009A8C: @ 80099BC
push {lr}

View file

@ -196,6 +196,7 @@ void sub_800AC34(void);
void sub_800B628(void);
void sub_80097E8(void);
void sub_800A994(u32 seed, u8 flags);
extern u16 gUnknown_03003020[6];
extern u32 gUnknown_0300302C;

View file

@ -77,7 +77,7 @@ u8 GetSaveValidStatus(const struct SaveSectionLocation *location);
u8 DoReadFlashWholeSection(u8, struct SaveSection *);
u16 CalculateChecksum(void *, u16);
u8 HandleSavingData(u8 saveType);
//u8 TrySavingData(u8 saveType);
u8 TrySavingData(u8 saveType);
//u8 sub_8125D80(void);
//bool8 sub_8125DA8(void);
//u8 sub_8125DDC(void);

View file

@ -1,6 +1,8 @@
// Includes
#include "global.h"
#include "malloc.h"
#include "save.h"
#include "librfu.h"
#include "rng.h"
#include "string_util.h"
@ -97,13 +99,15 @@ void sub_8009638(void);
void sub_80096BC(void);
void c2_08009A8C(void);
void sub_800A2E0(void);
void sub_800A2F4(void *heapptr, size_t src);
void task00_link_test(u8 taskId);
u16 sub_800A648(u16 *src, u16 size);
void sub_800A6E8(u32 pos, u8 a0, u8 a1, u8 a2);
void sub_800A824(void);
void sub_800B594(void);
void sub_800B330(bool8 flag);
void sub_800B4A4(void);
void sub_800B53C(void);
void sub_800B594(void);
u32 sub_800BEC0(void);
void sub_800E700(void);
void sub_800EDD4(void);
@ -348,3 +352,35 @@ void sub_8009818(void)
}
}
}
void sub_8009900(void)
{
if (gMain.newKeys & A_BUTTON)
{
gUnknown_03003144 = TRUE;
}
if (gMain.heldKeys & B_BUTTON)
{
sub_800A2F4(gHeap + 0x4000, 0x00002004);
}
if (gMain.newKeys & L_BUTTON)
{
BeginNormalPaletteFade(-1, 0, 16, 0, 2);
}
if (gMain.newKeys & START_BUTTON)
{
sub_800B330(1);
}
if (gMain.newKeys & R_BUTTON)
{
TrySavingData(1);
}
if (gMain.newKeys & SELECT_BUTTON)
{
sub_800AC34();
}
if (gUnknown_020223BC)
{
sub_800A994(gMain.vblankCounter2, gUnknown_03003140 ? gUnknown_03002748 : gUnknown_03002748 | 0x10);
}
}