Start decomp of trainer_tower
This commit is contained in:
@@ -5,72 +5,6 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_815D7BC
|
||||
sub_815D7BC: @ 815D7BC
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
adds r4, r1, 0
|
||||
movs r0, 0x1E
|
||||
bl TryCopySpecialSaveSection
|
||||
cmp r0, 0x1
|
||||
bne _0815D804
|
||||
ldr r2, _0815D800 @ =0x00000f88
|
||||
adds r0, r5, 0
|
||||
adds r1, r4, 0
|
||||
bl memcpy
|
||||
movs r0, 0x1F
|
||||
adds r1, r4, 0
|
||||
bl TryCopySpecialSaveSection
|
||||
cmp r0, 0x1
|
||||
bne _0815D804
|
||||
ldr r1, _0815D800 @ =0x00000f88
|
||||
adds r0, r5, r1
|
||||
movs r2, 0xF8
|
||||
lsls r2, 4
|
||||
adds r1, r4, 0
|
||||
bl memcpy
|
||||
adds r0, r5, 0
|
||||
bl sub_815D6B4
|
||||
cmp r0, 0
|
||||
beq _0815D804
|
||||
movs r0, 0x1
|
||||
b _0815D806
|
||||
.align 2, 0
|
||||
_0815D800: .4byte 0x00000f88
|
||||
_0815D804:
|
||||
movs r0, 0
|
||||
_0815D806:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_815D7BC
|
||||
|
||||
thumb_func_start sub_815D80C
|
||||
sub_815D80C: @ 815D80C
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
movs r0, 0x80
|
||||
lsls r0, 5
|
||||
bl AllocZeroed
|
||||
adds r5, r0, 0
|
||||
adds r0, r4, 0
|
||||
adds r1, r5, 0
|
||||
bl sub_815D7BC
|
||||
adds r4, r0, 0
|
||||
adds r0, r5, 0
|
||||
bl Free
|
||||
adds r0, r4, 0
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_815D80C
|
||||
|
||||
thumb_func_start sub_815D834
|
||||
sub_815D834: @ 815D834
|
||||
movs r0, 0
|
||||
bx lr
|
||||
thumb_func_end sub_815D834
|
||||
|
||||
thumb_func_start sub_815D838
|
||||
sub_815D838: @ 815D838
|
||||
push {r4-r7,lr}
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
#include "global.h"
|
||||
|
||||
bool32 sub_815D794(u8 *);
|
||||
u8 sub_815D6B4(u8 *);
|
||||
bool32 sub_815D6B4(u8 *);
|
||||
|
||||
#endif //GUARD_CEREADER_TOOL_H
|
||||
|
||||
@@ -266,6 +266,7 @@ SECTIONS {
|
||||
asm/unk_815C980.o(.text);
|
||||
asm/ss_anne.o(.text);
|
||||
asm/cereader_tool.o(.text);
|
||||
src/trainer_tower.o(.text);
|
||||
asm/trainer_tower.o(.text);
|
||||
asm/unk_815EDDC.o(.text);
|
||||
asm/unk_815F138.o(.text);
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#include "global.h"
|
||||
#include "malloc.h"
|
||||
#include "save.h"
|
||||
#include "cereader_tool.h"
|
||||
|
||||
bool32 sub_815D7BC(void * dest, void * buffer)
|
||||
{
|
||||
if (TryCopySpecialSaveSection(30, buffer) != 1)
|
||||
return FALSE;
|
||||
memcpy(dest + 0x000, buffer, 0xF88);
|
||||
|
||||
if (TryCopySpecialSaveSection(31, buffer) != 1)
|
||||
return FALSE;
|
||||
memcpy(dest + 0xF88, buffer, 0xF80);
|
||||
|
||||
if (!sub_815D6B4(dest))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 sub_815D80C(void * dest)
|
||||
{
|
||||
void * buffer = AllocZeroed(0x1000);
|
||||
bool32 success = sub_815D7BC(dest, buffer);
|
||||
Free(buffer);
|
||||
return success;
|
||||
}
|
||||
|
||||
bool32 sub_815D834(void)
|
||||
{
|
||||
// Stubbed out?
|
||||
return FALSE;
|
||||
}
|
||||
Reference in New Issue
Block a user