finally figured out fatal error func and another func

This commit is contained in:
Seth Barberee 2020-11-05 18:11:47 -06:00
parent 1c2975874b
commit 799fa82c1a
4 changed files with 35 additions and 60 deletions

View File

@ -5,44 +5,6 @@
.text
thumb_func_start sub_80A7764
sub_80A7764:
push {r4,lr}
lsls r0, 16
asrs r4, r0, 16
bl sub_80A7784
movs r0, 0x1
negs r0, r0
cmp r4, r0
beq _080A777A
ldr r0, _080A7780
strh r4, [r0]
_080A777A:
pop {r4}
pop {r0}
bx r0
.align 2, 0
_080A7780: .4byte gUnknown_2039DE0
thumb_func_end sub_80A7764
thumb_func_start sub_80A7784
sub_80A7784:
push {lr}
ldr r2, _080A779C
movs r1, 0
ldrsh r0, [r2, r1]
movs r1, 0x1
negs r1, r1
cmp r0, r1
beq _080A7796
strh r1, [r2]
_080A7796:
pop {r0}
bx r0
.align 2, 0
_080A779C: .4byte gUnknown_2039DE0
thumb_func_end sub_80A7784
thumb_func_start sub_80A77A0
sub_80A77A0:
push {lr}

View File

@ -5,28 +5,6 @@
.text
thumb_func_start FatalErrorPrintFuncFileLine
FatalErrorPrintFuncFileLine:
push {lr}
sub sp, 0x100
adds r2, r0, 0
cmp r2, 0
beq _08011B5E
mov r0, sp
bl PrintFuncFileLine
b _08011B66
_08011B5E:
ldr r2, _08011B6C
mov r0, sp
bl PrintFuncFileLine
_08011B66:
add sp, 0x100
pop {r0}
bx r0
.align 2, 0
_08011B6C: .4byte gUnknown_80D421C
thumb_func_end FatalErrorPrintFuncFileLine
thumb_func_start FatalErrorFormatMessage
FatalErrorFormatMessage:
push {r0-r3}

View File

@ -2,6 +2,9 @@
extern u8 gUnknown_203B150;
void PrintFuncFileLine(char *r0, const char *r1, ...);
extern const char gUnknown_80D421C;
void nullsub_199(void)
{
}
@ -67,3 +70,16 @@ void nullsub_137(void)
{
}
// TODO merge with fatal_system
void FatalErrorPrintFuncFileLine(const char *r0, const char *r1)
{
char buf[0x100];
if(r0 != 0){
PrintFuncFileLine(buf, r1, r0);
}
else
{
PrintFuncFileLine(buf, r1, &gUnknown_80D421C);
}
}

View File

@ -3,6 +3,7 @@
extern void sub_80A68A0(void);
extern void sub_80A7094(u32 r0, u32 r1, u32 r2, u32 r3);
extern void sub_80A7310(u32 r0, u32 r1, u32 r2, u32 r3);
extern void sub_80A7784();
extern s16 gUnknown_2039DE0;
void sub_80A7714(void)
@ -25,3 +26,21 @@ void sub_80A7754(void)
{
gUnknown_2039DE0 = -1;
}
void sub_80A7764(s16 r0)
{
s32 temp = r0;
sub_80A7784();
if(temp != -1)
{
gUnknown_2039DE0 = temp;
}
}
void sub_80A7784(void)
{
if(gUnknown_2039DE0 != -1)
{
gUnknown_2039DE0 = -1;
}
}