diff options
| author | Tal Hayon <talhayon1@gmail.com> | 2022-08-15 21:36:29 +0300 |
|---|---|---|
| committer | Tal Hayon <talhayon1@gmail.com> | 2022-08-15 21:36:29 +0300 |
| commit | 52e3382791186d899e130fcf185e56e0bbdc377b (patch) | |
| tree | 801da75e5414ec008eb3dde4300a0138592ca04c /src | |
| parent | 031d37c712e6b99c547f5fd132a7f88b91ed979f (diff) | |
Match sub_0801AFE4
Diffstat (limited to 'src')
| -rw-r--r-- | src/beanstalkSubtask.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/beanstalkSubtask.c b/src/beanstalkSubtask.c index 56ef2349..b9bf1dc9 100644 --- a/src/beanstalkSubtask.c +++ b/src/beanstalkSubtask.c @@ -594,7 +594,28 @@ void DeleteLoadedTileEntity(u32 position, s32 layer) { ptr[t] = ptr[count]; } -ASM_FUNC("asm/non_matching/beanstalkSubtask/sub_0801AFE4.inc", void sub_0801AFE4(void)) +void sub_0801AFE4(void) { + const u16* ptr; + u8* collisionData; + u32 x; + u32 y; + u32 width; + u32 height; + + collisionData = gMapBottom.collisionData; + width = gRoomControls.width >> 4; + height = gRoomControls.height >> 4; + for (y = 0; y < height; collisionData = collisionData + (0x40 - width), y++) { + for (x = 0; x < width; collisionData++, x++) { + for (ptr = gUnk_080B44D0; ptr[0] != 0; ptr += 2) { + if (ptr[0] == *collisionData) { + SetTile(ptr[1], y * 0x40 + x, 1); + break; + } + } + } + } +} void UpdateBgAnimations(void) { bool32 alreadyUploadedGfx = FALSE; |
