diff --git a/asm/code_0807CC3C.s b/asm/code_0807CC3C.s index 1cc3b632..a100f9de 100644 --- a/asm/code_0807CC3C.s +++ b/asm/code_0807CC3C.s @@ -1526,26 +1526,3 @@ _0807DA94: .4byte gUnk_02033280 _0807DA98: .4byte gUnk_02036570 _0807DA9C: .4byte gUnk_02022750 - thumb_func_start sub_0807DAA0 -sub_0807DAA0: @ 0x0807DAA0 - push {lr} - ldr r1, _0807DABC @ =gUnk_02036570 - movs r0, #0x90 - lsls r0, r0, #3 - adds r2, r1, r0 -_0807DAAA: - ldr r0, [r1] - cmp r0, #0 - beq _0807DAC0 - adds r1, #0x24 - cmp r1, r2 - blo _0807DAAA - movs r0, #0 - b _0807DAC2 - .align 2, 0 -_0807DABC: .4byte gUnk_02036570 -_0807DAC0: - adds r0, r1, #0 -_0807DAC2: - pop {pc} - diff --git a/src/code_0807CC3C.c b/src/code_0807CC3C.c index f84d40d1..cc65de3d 100644 --- a/src/code_0807CC3C.c +++ b/src/code_0807CC3C.c @@ -6,8 +6,10 @@ 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 +// the type is just a guess based on size and the fact that these are around a lot in this file extern ScriptExecutionContext gUnk_02022750; +// might be ScriptExecutionContext[0x20] +extern u32 gUnk_02036570; extern void CreateSpeechBubbleExclamationMark(Entity*, u32, u32); extern void CreateSpeechBubbleQuestionMark(Entity*, u32, u32); @@ -18,7 +20,19 @@ extern void _call_via_r6(Entity*, ScriptExecutionContext*); void sub_0807DB88(ScriptExecutionContext* context, u32 unk1); void sub_0807DAF0(Entity* entity, ScriptExecutionContext* context, u32 unk1); -extern u32* sub_0807DAA0(); + +u32* sub_0807DAA0(void) { + u32* puVar1; + + puVar1 = &gUnk_02036570; + do { + if (*puVar1 == 0) { + return puVar1; + } + puVar1 = puVar1 + 9; + } while (puVar1 < &gUnk_02036570 + 0x480 / 4); + return NULL; +} void sub_0807DAC4(ScriptExecutionContext* context) { _DmaZero(context, 0x24);