further splitting and decomping

This commit is contained in:
Seth Barberee 2020-10-21 17:48:40 -05:00
parent 184d3819ab
commit e1f9c17e35
9 changed files with 5389 additions and 5510 deletions

View File

@ -5,6 +5,7 @@
.text
@ Unused
thumb_func_start sub_80035F8
sub_80035F8:
push {lr}

File diff suppressed because it is too large Load Diff

3385
asm/code_8040094.s Normal file

File diff suppressed because it is too large Load Diff

1757
asm/code_8041AD0.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,39 +5,6 @@
.text
thumb_func_start xxx_memory_attr_related
xxx_memory_attr_related:
push {lr}
adds r1, r0, 0
cmp r1, 0
bne _0800303C
movs r0, 0
b _08003060
_0800303C:
movs r0, 0x8
ands r0, r1
cmp r0, 0
beq _08003048
movs r0, 0x4
b _08003060
_08003048:
movs r2, 0x7
ands r2, r1
movs r0, 0x1
cmp r2, 0x7
beq _08003060
movs r0, 0x2
cmp r2, 0x1
beq _08003060
movs r0, 0x5
cmp r2, 0x3
bne _08003060
movs r0, 0x3
_08003060:
pop {r1}
bx r1
thumb_func_end xxx_memory_attr_related
thumb_func_start MemorySearchFromFront
MemorySearchFromFront:
push {r4-r7,lr}

View File

@ -91,6 +91,10 @@ SECTIONS {
asm/code_8027C84.o(.text);
src/code_8027C84.o(.text);
asm/code_803D110.o(.text);
src/code_8040094.o(.text);
asm/code_8040094.o(.text);
src/code_8041AD0.o(.text);
asm/code_8041AD0.o(.text);
src/code_80428A0.o(.text);
asm/code_80428A0.o(.text);
src/code_8048480.o(.text);

26
src/code_8040094.c Normal file
View File

@ -0,0 +1,26 @@
#include "global.h"
extern u8 *gUnknown_203B418;
extern u32 gUnknown_203B47C;
extern void sub_803F7BC(void);
extern void sub_80060EC(void);
extern void sub_8094FB4(u32);
extern void sub_800CB20(void);
extern void sub_800485C(void);
extern void xxx_call_update_bg_sound_input(void);
extern void sub_8083F58(void);
extern void sub_8011860(void);
void sub_8040094(u8 r0)
{
gUnknown_203B418[0x18217] = r0;
sub_803F7BC();
sub_80060EC();
sub_8094FB4(gUnknown_203B47C);
sub_800CB20();
sub_800485C();
xxx_call_update_bg_sound_input();
sub_8083F58();
sub_8011860();
}

183
src/code_8041AD0.c Normal file
View File

@ -0,0 +1,183 @@
#include "global.h"
extern void sub_804151C(u32 r0, u32 r1, u32 r2);
extern void sub_80421C0(u32 r0, u32 r1);
extern void sub_806CDD4(u32 r0, u8, u8);
void sub_8041AD0(u32 r0)
{
sub_804151C(r0, 0xA2 << 1, 1);
}
void sub_8041AE0(u32 r0)
{
sub_804151C(r0, 0x143, 1);
}
void sub_8041AF4(u32 r0)
{
sub_804151C(r0, 0x25, 1);
sub_80421C0(r0, 0x197);
}
void nullsub_57(void)
{
}
void sub_8041B18(u32 r0)
{
sub_804151C(r0, 0x141, 1);
}
void nullsub_58(void)
{
}
void nullsub_59(void)
{
}
void sub_8041B34(u32 r0)
{
sub_804151C(r0, 7, 1);
}
void nullsub_60(void)
{
}
void sub_8041B48(u32 r0)
{
sub_804151C(r0, 4, 0);
}
void nullsub_61(void)
{
}
void sub_8041B5C(u32 r0)
{
sub_804151C(r0, 0x171, 1);
}
void nullsub_62(void)
{
}
void sub_8041B74(u32 r0)
{
sub_804151C(r0, 0x171, 0);
}
void nullsub_63(void)
{
}
void nullsub_64(void)
{
}
void sub_8041B90(u32 r0)
{
sub_804151C(r0, 0xD6 << 1, 0);
}
void nullsub_65(void)
{
}
void nullsub_66(void)
{
}
void sub_8041BA8(u32 r0)
{
sub_804151C(r0, 4, 1);
}
void nullsub_67(void)
{
}
void sub_8041BBC(u32 r0)
{
sub_804151C(r0, 0xD4 << 1, 1);
}
void nullsub_68(void)
{
}
void sub_8041BD0(u32 r0, u8 r1)
{
if(r1 == 0)
{
return;
}
sub_80421C0(r0, 0x1a5);
}
void sub_8041BE8(u32 r0)
{
sub_80421C0(r0, 0xCB << 1);
}
void sub_8041BF8(u32 r0)
{
sub_806CDD4(r0, 0xA, 8);
}
void sub_8041C08(u32 r0)
{
sub_804151C(r0, 0x1a7, 1);
}
void sub_8041C1C(u32 r0)
{
sub_804151C(r0, 0x1a7, 1);
}
void nullsub_69(void)
{
}
void sub_8041C34(u32 r0)
{
sub_804151C(r0, 0x4C, 1);
}
void nullsub_70(void)
{
}
void nullsub_71(void)
{
}
void sub_8041C4C(u32 r0, u32 r1)
{
sub_804151C(r0, r1, 1);
}
void sub_8041C58(u32 r0)
{
sub_804151C(r0, 0x1a9, 1);
}
void sub_8041C6C(u32 r0)
{
sub_804151C(r0, 0x9D << 1, 1);
}
void sub_8041C7C(u32 r0)
{
sub_804151C(r0, 0x9D << 1, 1);
}
void nullsub_72(void)
{
}
void nullsub_73(void)
{
}

View File

@ -143,3 +143,36 @@ void InitSubHeap(struct HeapDescriptor *parentHeap, struct HeapMemoryBlock *bloc
settings.size = aligned_size;
DoInitHeap(parentHeap, &settings, freeList, freeListMax);
}
u8 xxx_memory_attr_related(u32 r0)
{
u32 temp;
u32 return_var;
if(r0 == 0)
{
return 0;
}
if((r0 & 8) != 0)
{
return 4;
}
temp = r0 & 7;
if(temp == 7)
{
return_var = 1;;
}
else if(temp == 1)
{
return_var = 2;
}
else if(temp == 3)
{
return_var = 3;
}
else
{
return_var = 5;
}
return return_var;
}