summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorred031000 <rubenru09@aol.com>2021-08-16 14:51:17 +0100
committerred031000 <rubenru09@aol.com>2021-08-16 14:51:17 +0100
commit496ab2d25dd76329ef5bb95090291e237a56f474 (patch)
tree2f3691e35912629516b8576751a40f28f73b0d74
parentd3a9506d773546cf353440448cee7fd9d447bc1d (diff)
literally one single random scrcmd func in a mod04 PR
-rw-r--r--arm9/asm/scrcmd_asm.s26
-rw-r--r--arm9/src/scrcmd.c22
-rw-r--r--include/scrcmd.h8
3 files changed, 27 insertions, 29 deletions
diff --git a/arm9/asm/scrcmd_asm.s b/arm9/asm/scrcmd_asm.s
index 8dcbdf20..29106585 100644
--- a/arm9/asm/scrcmd_asm.s
+++ b/arm9/asm/scrcmd_asm.s
@@ -14,32 +14,6 @@ UNK_021C5A0C: ; 0x021C5A0C
.text
- thumb_func_start FUN_0203B174
-FUN_0203B174: ; 0x0203B174
- push {r3-r7, lr}
- add r5, r0, #0x0
- add r6, r1, #0x0
- mov r0, #0x4
- mov r1, #0x10
- add r7, r2, #0x0
- bl AllocFromHeap
- add r4, r0, #0x0
- bne _0203B18E
- bl GF_AssertFail
- pop {r3-r7, pc}
-_0203B18E:
- str r5, [r4, #0xc]
- str r6, [r4, #0x4]
- ldr r0, _0203B1A4 ; =FUN_0203B1A8
- add r1, r4, #0x0
- mov r2, #0x0
- str r7, [r4, #0x8]
- bl FUN_0200CA44
- str r0, [r4, #0x0]
- pop {r3-r7, pc}
- nop
-_0203B1A4: .word FUN_0203B1A8
-
thumb_func_start FUN_0203B1A8
FUN_0203B1A8: ; 0x0203B1A8
push {r3-r5, lr}
diff --git a/arm9/src/scrcmd.c b/arm9/src/scrcmd.c
index c79684a0..ceb1a1cf 100644
--- a/arm9/src/scrcmd.c
+++ b/arm9/src/scrcmd.c
@@ -1,4 +1,5 @@
#include "scrcmd.h"
+#include "unk_0200CA44.h"
#include "unk_0204639C.h"
#include "main.h"
#include "options.h"
@@ -54,11 +55,11 @@ extern void MOD05_021E26CC(u32 param0, u8 param1);
extern void MOD05_021E2B80(u32 param0, u8 param1);
extern void MOD05_021E2B9C(u32 param0, u8 param1);
extern u32 FUN_0205AEA4(u32 param0, const void *ptr);
-extern void FUN_0203B174(struct UnkSavStruct80 *arg, u32 param1, void *param2);
extern u32 FUN_02058B2C(u32 param0);
extern u32 FUN_02058B4C(u32 param0);
extern u32 FUN_020580B4(u32 param0, u32 param1);
extern u32 FUN_02058060(u32 param0, u32 param1);
+extern void FUN_0203B1A8(u32 param0, void *param1);
extern u8 *UNK_020F34E0;
@@ -79,6 +80,7 @@ static BOOL FUN_0203AD2C(struct ScriptContext *ctx);
static BOOL FUN_0203AD78(struct ScriptContext *ctx);
static u32 FUN_0203B120(struct UnkSavStruct80 *arg, u16 param1);
static BOOL FUN_0203B158(struct ScriptContext *ctx);
+static void FUN_0203B174(struct UnkSavStruct80 *arg, u32 param1, void *param2);
extern u8 sScriptConditionTable[6][3];
@@ -1355,13 +1357,13 @@ THUMB_FUNC BOOL ScrCmd_Unk02A1(struct ScriptContext *ctx)
if (unk6 < unk2)
{
unk4[pos * 2] = 12;
- unk4[pos * 2 + 1] = unk2 - unk6;
+ unk4[pos * 2 + 1] = (u16)(unk2 - unk6);
pos++;
}
else if (unk6 > unk2)
{
unk4[pos * 2] = 13;
- unk4[pos * 2 + 1] = unk6 - unk2;
+ unk4[pos * 2 + 1] = (u16)(unk6 - unk2);
pos++;
}
@@ -1405,3 +1407,17 @@ THUMB_FUNC static BOOL FUN_0203B158(struct ScriptContext *ctx)
u8 *unk = FUN_02039438(ctx->unk80, 4);
return *unk == 0 ? TRUE : FALSE;
}
+
+THUMB_FUNC static void FUN_0203B174(struct UnkSavStruct80 *arg, u32 param1, void *param2)
+{
+ UnkStruct_0203B174 *unkStruct = (UnkStruct_0203B174 *)AllocFromHeap(4, sizeof(UnkStruct_0203B174));
+ if (unkStruct == NULL)
+ {
+ GF_AssertFail();
+ return;
+ }
+ unkStruct->Unk0C = arg;
+ unkStruct->Unk04 = param1;
+ unkStruct->Unk08 = param2;
+ unkStruct->Unk00 = FUN_0200CA44(FUN_0203B1A8, unkStruct, 0);
+}
diff --git a/include/scrcmd.h b/include/scrcmd.h
index 8c89e230..7a0ab21e 100644
--- a/include/scrcmd.h
+++ b/include/scrcmd.h
@@ -15,6 +15,14 @@ struct UnkStruct_0203A288 {
u8 padding[1];
};
+typedef struct UnkStruct_0203B174
+{
+ BOOL Unk00;
+ u32 Unk04;
+ void *Unk08;
+ struct UnkSavStruct80 *Unk0C;
+} UnkStruct_0203B174;
+
//scrcmd.c
BOOL ScrCmd_Nop(struct ScriptContext* ctx);
BOOL ScrCmd_Dummy(struct ScriptContext* ctx);