From 945a3fe944239cad64ca7b38cf018efbbedbb616 Mon Sep 17 00:00:00 2001 From: Henny022p Date: Tue, 16 Feb 2021 02:24:26 +0100 Subject: [PATCH] matched StartPlayerScript --- asm/code_0807CC3C.s | 29 ----------------------------- src/code_0807CC3C.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/asm/code_0807CC3C.s b/asm/code_0807CC3C.s index 593374d7..14036c1a 100644 --- a/asm/code_0807CC3C.s +++ b/asm/code_0807CC3C.s @@ -1610,32 +1610,3 @@ _0807DB28: pop {r4, r5, pc} .align 2, 0 - thumb_func_start StartPlayerScript -StartPlayerScript: @ 0x0807DB2C - push {r4, r5, lr} - adds r5, r0, #0 - ldr r4, _0807DB5C @ =gUnk_02022750 - adds r0, r4, #0 - movs r1, #0x24 - bl _DmaZero - str r5, [r4] - ldr r0, _0807DB60 @ =gPlayerEntity - adds r0, #0x84 - str r4, [r0] - ldr r2, _0807DB64 @ =gPlayerState - movs r1, #0 - movs r0, #0x1c - strb r0, [r2, #0xc] - adds r0, r2, #0 - adds r0, #0x3a - strb r1, [r0] - subs r0, #1 - strb r1, [r0] - subs r0, #1 - strb r1, [r0] - pop {r4, r5, pc} - .align 2, 0 -_0807DB5C: .4byte gUnk_02022750 -_0807DB60: .4byte gPlayerEntity -_0807DB64: .4byte gPlayerState - diff --git a/src/code_0807CC3C.c b/src/code_0807CC3C.c index 4309cca4..87c4775c 100644 --- a/src/code_0807CC3C.c +++ b/src/code_0807CC3C.c @@ -6,6 +6,8 @@ extern u8 gUnk_0811E514[]; extern u8 gUnk_0811E510[]; +// the type is just a guess based on size and teh fact that these are around a lot in this file +extern ScriptExecutionContext gUnk_02022750; extern void CreateSpeechBubbleExclamationMark(Entity*, u32, u32); extern void CreateSpeechBubbleQuestionMark(Entity*, u32, u32); @@ -17,6 +19,19 @@ extern void _call_via_r6(Entity*, ScriptExecutionContext*); extern u32* sub_0807DAA0(); +void StartPlayerScript(u32 unk1) { + Entity* player; + + _DmaZero(&gUnk_02022750, 0x24); + gUnk_02022750.unk_00 = (u16*)unk1; + player = &gPlayerEntity; + *(ScriptExecutionContext**)&player->cutsceneBeh = &gUnk_02022750; + gPlayerState.playerAction = 0x1c; + gPlayerState.field_0x3a = 0; + gPlayerState.field_0x39 = 0; + gPlayerState.field_0x38 = 0; +} + u32* sub_0807DB68(Entity* entity, u32 unk1) { u32* puVar1;