From 8a30fdb89264ff0fd83b99500d6681eebeb89df1 Mon Sep 17 00:00:00 2001 From: red031000 Date: Thu, 11 May 2023 00:30:21 +0100 Subject: [PATCH] ScrCmd_Unk0191 --- arm9/asm/scrcmd_asm.s | 23 ----------------------- arm9/src/scrcmd.c | 10 ++++++++++ include/scrcmd.h | 1 + 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/arm9/asm/scrcmd_asm.s b/arm9/asm/scrcmd_asm.s index fd629b5ae..eead65ce1 100644 --- a/arm9/asm/scrcmd_asm.s +++ b/arm9/asm/scrcmd_asm.s @@ -14,29 +14,6 @@ UNK_021C5A0C: ; 0x021C5A0C .text - thumb_func_start ScrCmd_Unk0191 -ScrCmd_Unk0191: ; 0x0203B8E4 - push {r3-r5, lr} - add r5, r0, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - mov r1, #0x13 - bl FUN_02039438 - add r1, r5, #0x0 - add r1, #0x80 - add r4, r0, #0x0 - ldr r1, [r1, #0x0] - mov r0, #0x20 - bl FUN_020379F8 - str r0, [r4, #0x0] - ldr r1, _0203B910 ; =FUN_0203BC04 - add r0, r5, #0x0 - bl SetupNativeScript - mov r0, #0x1 - pop {r3-r5, pc} - nop -_0203B910: .word FUN_0203BC04 - thumb_func_start ScrCmd_Unk02A5 ScrCmd_Unk02A5: ; 0x0203B914 push {r3-r5, lr} diff --git a/arm9/src/scrcmd.c b/arm9/src/scrcmd.c index 02f227274..ef19d4ce3 100644 --- a/arm9/src/scrcmd.c +++ b/arm9/src/scrcmd.c @@ -92,6 +92,7 @@ extern void FUN_02058EB0(struct Vecx32 *vector, u32 param1); extern u16 FUN_02029E0C(struct SealCase *sealCase); extern u16 FUN_02029E2C(struct SealCase *sealCase, u16 sealId); extern void FUN_02029D44(struct SealCase *sealCase, u16 sealId, s16 amount); +extern u32 FUN_020379F8(u32 param0, struct FieldSystem *fieldSystem); extern u8 UNK_021C5A0C[4]; @@ -118,6 +119,8 @@ static void FUN_0203B174(struct FieldSystem *fieldSystem, u32 param1, void *para static void FUN_0203B1A8(u32 param0, UnkStruct_0203B174 *param1); static BOOL FUN_0203B218(struct ScriptContext *ctx); +extern BOOL FUN_0203BC04(struct ScriptContext *ctx); + extern u8 sScriptConditionTable[6][3]; THUMB_FUNC BOOL ScrCmd_Nop(struct ScriptContext *ctx) //0000 @@ -1810,3 +1813,10 @@ THUMB_FUNC BOOL ScrCmd_GetPokemonForme(struct ScriptContext *ctx) //0095 return FALSE; } +THUMB_FUNC BOOL ScrCmd_Unk0191(struct ScriptContext *ctx) //0191 +{ + u32 *unk = FUN_02039438(ctx->fieldSystem, 0x13); + *unk = FUN_020379F8(0x20, ctx->fieldSystem); + SetupNativeScript(ctx, FUN_0203BC04); + return TRUE; +} diff --git a/include/scrcmd.h b/include/scrcmd.h index 7da94c61c..52ac26c15 100644 --- a/include/scrcmd.h +++ b/include/scrcmd.h @@ -138,6 +138,7 @@ BOOL ScrCmd_Unk02AB(struct ScriptContext *ctx); BOOL ScrCmd_GetSealCountFromId(struct ScriptContext *ctx); BOOL ScrCmd_GiveSeals(struct ScriptContext *ctx); BOOL ScrCmd_GetPokemonForme(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0191(struct ScriptContext *ctx); // scrcmd_mart.c BOOL ScrCmd_NormalMart(struct ScriptContext * ctx);