summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common.c57
-rw-r--r--src/object/whiteTriangleEffect.c2
2 files changed, 57 insertions, 2 deletions
diff --git a/src/common.c b/src/common.c
index 3b661be7..60461523 100644
--- a/src/common.c
+++ b/src/common.c
@@ -84,6 +84,7 @@ bool32 IsRoomVisited(TileEntity* tileEntity, u32 bank);
u32 sub_0801DF60(u32 a1, u8* p);
u32 sub_0801DF78(u32 a1, u32 a2);
void sub_0801DF28(u32 x, u32 y, s32 color);
+void sub_0801E64C(s32 param_1, s32 param_2, s32 param_3, s32 param_4, s32 param_5);
extern void* GetRoomProperty(u32, u32, u32);
@@ -794,7 +795,61 @@ void sub_0801E290(u32 param_1, u32 param_2, u32 count) {
ASM_FUNC("asm/non_matching/common/sub_0801E31C.inc", void sub_0801E31C(u32 a1, u32 a2, u32 a3, u32 a4));
-ASM_FUNC("asm/non_matching/common/sub_0801E49C.inc", void sub_0801E49C(u32 a1, u32 a2, u32 a3, u32 a4));
+void sub_0801E49C(s32 baseX, s32 baseY, s32 radius, u32 baseAngle) {
+ u8* ptr2;
+ u32* ptr1;
+ u32 angle;
+ s32 x1, x2, x3, y1, y2, y3;
+
+ MemFill16(0xffff, gUnk_02018EE0, 0x780);
+ angle = (baseAngle - 0x40) & 0xff;
+ x1 = baseX + (gSineTable[angle + 0x40] * radius >> 8);
+ y1 = baseY + (gSineTable[angle] * radius >> 8);
+ angle = (baseAngle + 0x68) & 0xff;
+ x2 = baseX + (gSineTable[angle + 0x40] * radius >> 8);
+ y2 = baseY + (gSineTable[angle] * radius >> 8);
+ angle = (baseAngle - 0xe8) & 0xff;
+ x3 = baseX + (gSineTable[angle + 0x40] * radius >> 8);
+ y3 = baseY + (gSineTable[angle] * radius >> 8);
+ sub_0801E64C(x1, y1, x2, y2, 0);
+ sub_0801E64C(x1, y1, x3, y3, 1);
+ sub_0801E64C(x2, y2, x3, y3, 2);
+ MemClear(gUnk_02017AA0[gUnk_03003DE4[0]].filler, 0xa00);
+ ptr1 = (u32*)gUnk_02018EE0;
+ ptr2 = gUnk_02017AA0[gUnk_03003DE4[0]].filler;
+ for (y1 = 0xa0; y1 > 0; y1--, ptr2 += 2) {
+ x1 = ptr1[0];
+ x2 = ptr1[1];
+ x3 = ptr1[2];
+ ptr1 += 3;
+ if (x1 > x2) {
+ SWAP(x1, x2, y2);
+ }
+ if (x1 > x3) {
+ SWAP(x1, x3, y2);
+ }
+ if (x2 > x3) {
+ SWAP(x2, x3, y2);
+ }
+ if (x1 != 0xffffffff) {
+ ptr2[0] = x3;
+ ptr2[1] = x1;
+ } else {
+ if (x2 != x1) {
+ ptr2[0] = x3;
+ ptr2[1] = x2;
+ } else {
+ if (x3 != x1) {
+ ptr2[1] = x1;
+ ptr2[0] = x1;
+ }
+ }
+ }
+ }
+ SetVBlankDMA((u16*)(gUnk_02017AA0[gUnk_03003DE4[0]].filler), (u16*)REG_ADDR_WIN0H,
+ ((DMA_ENABLE | DMA_START_HBLANK | DMA_16BIT | DMA_REPEAT | DMA_SRC_INC | DMA_DEST_RELOAD) << 16) +
+ 0x1);
+}
void sub_0801E64C(s32 param_1, s32 param_2, s32 param_3, s32 param_4, s32 param_5) {
s32 sVar1;
diff --git a/src/object/whiteTriangleEffect.c b/src/object/whiteTriangleEffect.c
index 16ba562c..ec70dab3 100644
--- a/src/object/whiteTriangleEffect.c
+++ b/src/object/whiteTriangleEffect.c
@@ -35,7 +35,7 @@ typedef struct {
u16 unk_9;
} struct_081215E8;
-extern void sub_0801E49C(u32, u32, u32, u32);
+extern void sub_0801E49C(s32 baseX, s32 baseY, s32 radius, u32 baseAngle);
extern bool32 gUnk_02036BB8;
void sub_0808C6D4(WhiteTriangleEffectEntity*);