diff options
| author | Tal Hayon <talhayon1@gmail.com> | 2022-07-29 11:21:15 +0300 |
|---|---|---|
| committer | Tal Hayon <talhayon1@gmail.com> | 2022-07-29 11:21:15 +0300 |
| commit | 33307f0b92bb0950a64df753d46fda2a7b87e12a (patch) | |
| tree | 1f21c01c459470942331ba3e3271b825b39c576b /src/playerUtils.c | |
| parent | b6c1671203f4a0928587b319c5d0772ecd5490e9 (diff) | |
Match sub_0807C4F8
Diffstat (limited to 'src/playerUtils.c')
| -rw-r--r-- | src/playerUtils.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/playerUtils.c b/src/playerUtils.c index d44abfa5..87c1b326 100644 --- a/src/playerUtils.c +++ b/src/playerUtils.c @@ -59,6 +59,7 @@ u32 sub_0807A094(u32); SurfaceType GetSurfaceCalcType(Entity*, s32, s32); void sub_0807AAF8(Entity*, u32); +extern u32 gUnk_02022830[]; extern struct_0811BE48 gUnk_0811BE48[]; extern void (*const gUnk_0811C27C[])(Entity*); extern void (*const gUnk_0811C284[])(PlayerEntity*); @@ -3120,7 +3121,34 @@ void sub_0807C460(void) { } } -ASM_FUNC("asm/non_matching/playerUtils/sub_0807C4F8.inc", void sub_0807C4F8()) +void sub_0807C4F8(void) { + u32* puVar1; + u32* ptr; + + if (gRoomControls.area != 0x71) { + MemClear(gMapDataBottomSpecial, 0x8000); + MemClear(&gMapDataTopSpecial, 0x8000); + ptr = gUnk_02022830; + puVar1 = (u32*)(gArea.pCurrentRoomInfo)->map; + puVar1 -= 3; + do { + puVar1 += 3; + if (((u16*)puVar1[1] == gMapDataBottomSpecial) || ((u16*)puVar1[1] == (u16*)&gMapDataTopSpecial)) { + ptr[0] = puVar1[0] & 0x7fffffff; + ptr[1] = puVar1[1]; + ptr[2] = puVar1[2]; + sub_080197D4(ptr); + } + } while ((s32)*puVar1 < 0); + MemCopy(gMapDataBottomSpecial, gMapDataBottomSpecial + 0x2000, 0x4000); + sub_0807C5F4(gMapDataBottomSpecial, gMapDataBottomSpecial + 0x2000); + + MemClear(gMapDataBottomSpecial + 0x2000, 0x4000); + MemCopy(gMapDataTopSpecial, gMapDataTopSpecial + 0x2000, 0x4000); + sub_0807C5F4(gMapDataTopSpecial, gMapDataTopSpecial + 0x2000); + MemClear(gMapDataTopSpecial + 0x2000, 0x4000); + } +} void sub_0807C5B0(void) { u8 colTop; |
