summaryrefslogtreecommitdiff
path: root/arm9/src/scrcmd_24.c
diff options
context:
space:
mode:
authorAkira Akashi <rubenru09@aol.com>2021-06-10 22:42:43 +0100
committerGitHub <noreply@github.com>2021-06-10 22:42:43 +0100
commitaa185f6be5696ae4bd6c9f8093eb13a06cb2cc79 (patch)
tree8f56e977e7e4f69c1c48249118074f500857f195 /arm9/src/scrcmd_24.c
parent6bede5a9393e2796c110e6304f455293a240cd7b (diff)
parente8d0b49a6864d6077a5d7b1c123c49481fe14bfe (diff)
Merge branch 'master' into unkk_020851B8
Diffstat (limited to 'arm9/src/scrcmd_24.c')
-rw-r--r--arm9/src/scrcmd_24.c140
1 files changed, 19 insertions, 121 deletions
diff --git a/arm9/src/scrcmd_24.c b/arm9/src/scrcmd_24.c
index 9c8f8d4b..b38ed05a 100644
--- a/arm9/src/scrcmd_24.c
+++ b/arm9/src/scrcmd_24.c
@@ -25,11 +25,13 @@ THUMB_FUNC BOOL ScrCmd_Unk01C6(struct ScriptContext* ctx)
return TRUE;
}
-#ifdef NONMATCHING
THUMB_FUNC BOOL ScrCmd_Unk01C7(struct ScriptContext* ctx)
{
- u16* ret_ptr = GetVarPointer(ctx->unk80, ScriptReadHalfword(ctx));
- struct UnkStruct_02037CF0** unk_ptr = FUN_02039438(ctx->unk80, 19);
+ struct UnkStruct_02037CF0** unk_ptr;
+ u16* ret_ptr;
+
+ ret_ptr = GetVarPointer(ctx->unk80, ScriptReadHalfword(ctx));
+ unk_ptr = FUN_02039438(ctx->unk80, 19);
GF_ASSERT(*unk_ptr != NULL);
*ret_ptr = FUN_02037D5C(*unk_ptr);
@@ -42,44 +44,6 @@ THUMB_FUNC BOOL ScrCmd_Unk01C7(struct ScriptContext* ctx)
*unk_ptr = NULL;
return FALSE;
}
-#else
-THUMB_FUNC asm BOOL ScrCmd_Unk01C7(struct ScriptContext* ctx)
-{
- push {r3-r5, lr}
- add r4, r0, #0x0
- bl ScriptReadHalfword
- add r1, r0, #0x0
- add r0, r4, #0x0
- add r0, #0x80
- ldr r0, [r0, #0x0]
- bl GetVarPointer
- add r4, #0x80
- add r5, r0, #0x0
- ldr r0, [r4, #0x0]
- mov r1, #0x13
- bl FUN_02039438
- add r4, r0, #0x0
- ldr r0, [r4, #0x0]
- cmp r0, #0x0
- bne _02045DFC
- bl GF_AssertFail
-_02045DFC:
- ldr r0, [r4, #0x0]
- bl FUN_02037D5C
- strh r0, [r5, #0x0]
- ldrh r0, [r5, #0x0]
- cmp r0, #0x4
- bne _02045E0E
- mov r0, #0xff
- strh r0, [r5, #0x0]
-_02045E0E:
- ldr r0, [r4, #0x0]
- bl FreeToHeap
- mov r0, #0x0
- str r0, [r4, #0x0]
- pop {r3-r5, pc}
-}
-#endif
THUMB_FUNC BOOL ScrCmd_Unk021E(struct ScriptContext* ctx)
{
@@ -159,12 +123,15 @@ THUMB_FUNC BOOL ScrCmd_Unk0222(struct ScriptContext* ctx)
return FALSE;
}
-#ifdef NONMATCHING
THUMB_FUNC BOOL ScrCmd_Unk0223(struct ScriptContext* ctx)
{
- u16* ret_ptr = GetVarPointer(ctx->unk80, ScriptReadHalfword(ctx));
- struct UnkStruct_02037CF0** unk = FUN_02039438(ctx->unk80, 19);
- struct UnkStruct_02037CF0* unk_sub = *unk;
+ struct UnkStruct_02037CF0** unk;
+ struct UnkStruct_02037CF0* unk_sub;
+ u16* ret_ptr;
+
+ ret_ptr = GetVarPointer(ctx->unk80, ScriptReadHalfword(ctx));
+ unk = FUN_02039438(ctx->unk80, 19);
+ unk_sub = *unk;
GF_ASSERT(unk_sub != NULL);
@@ -180,49 +147,16 @@ THUMB_FUNC BOOL ScrCmd_Unk0223(struct ScriptContext* ctx)
FUN_02088DF0(unk_sub);
return FALSE;
}
-#else
-THUMB_FUNC asm BOOL ScrCmd_Unk0223(struct ScriptContext* ctx)
-{
- push {r3-r5, lr}
- add r4, r0, #0x0
- bl ScriptReadHalfword
- add r1, r0, #0x0
- add r0, r4, #0x0
- add r0, #0x80
- ldr r0, [r0, #0x0]
- bl GetVarPointer
- add r4, #0x80
- add r5, r0, #0x0
- ldr r0, [r4, #0x0]
- mov r1, #0x13
- bl FUN_02039438
- ldr r4, [r0, #0x0]
- cmp r4, #0x0
- bne _02045FB2
- bl GF_AssertFail
-_02045FB2:
- ldrb r0, [r4, #0x16]
- cmp r0, #0x0
- bne _02045FBC
- mov r0, #0x0
- b _02045FBE
-_02045FBC:
- mov r0, #0xff
-_02045FBE:
- strh r0, [r5, #0x0]
- add r0, r4, #0x0
- bl FUN_02088DF0
- mov r0, #0x0
- pop {r3-r5, pc}
-}
-#endif
-#ifdef NONMATCHING
THUMB_FUNC BOOL ScrCmd_Unk0225(struct ScriptContext* ctx)
{
- u16* ret_ptr = GetVarPointer(ctx->unk80, ScriptReadHalfword(ctx));
- struct UnkStruct_02037CF0** unk = FUN_02039438(ctx->unk80, 19);
- struct UnkStruct_02037CF0* unk_sub = *unk;
+ struct UnkStruct_02037CF0** unk;
+ struct UnkStruct_02037CF0* unk_sub;
+ u16* ret_ptr;
+
+ ret_ptr = GetVarPointer(ctx->unk80, ScriptReadHalfword(ctx));
+ unk = FUN_02039438(ctx->unk80, 19);
+ unk_sub = *unk;
GF_ASSERT(unk_sub != NULL);
@@ -238,39 +172,3 @@ THUMB_FUNC BOOL ScrCmd_Unk0225(struct ScriptContext* ctx)
FUN_02088DF0(unk_sub);
return FALSE;
}
-#else
-THUMB_FUNC asm BOOL ScrCmd_Unk0225(struct ScriptContext* ctx)
-{
- push {r3-r5, lr}
- add r4, r0, #0x0
- bl ScriptReadHalfword
- add r1, r0, #0x0
- add r0, r4, #0x0
- add r0, #0x80
- ldr r0, [r0, #0x0]
- bl GetVarPointer
- add r4, #0x80
- add r5, r0, #0x0
- ldr r0, [r4, #0x0]
- mov r1, #0x13
- bl FUN_02039438
- ldr r4, [r0, #0x0]
- cmp r4, #0x0
- bne _02045FB2
- bl GF_AssertFail
-_02045FB2:
- ldrb r0, [r4, #0x16]
- cmp r0, #0x0
- bne _02045FBC
- mov r0, #0x0
- b _02045FBE
-_02045FBC:
- mov r0, #0xff
-_02045FBE:
- strh r0, [r5, #0x0]
- add r0, r4, #0x0
- bl FUN_02088DF0
- mov r0, #0x0
- pop {r3-r5, pc}
-}
-#endif