Effects, includes (#589)

* effect_13

* effect_14

* most of effect_15

* clean, standardize effects

* fx_16 wip

* UnkNpcAIFunc35

* includes

* UnkPosFunc2

* UnkNpcAIFunc36

* PR comments
This commit is contained in:
Ethan Roseman 2021-12-30 00:14:55 -05:00 committed by GitHub
parent bd56f6060f
commit 5cb9183779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
385 changed files with 1781 additions and 27736 deletions

View File

@ -1965,7 +1965,7 @@ typedef struct MenuPanel {
/* 0x0C */ UNK_FUN_PTR(fpInit);
/* 0x10 */ UNK_FUN_PTR(fpHandleInput);
/* 0x14 */ UNK_FUN_PTR(fpUpdate);
/* 0x18 */ UNK_FUN_PTR(fpCleanup);
/* 0x18 */ void(*fpCleanup)(struct MenuPanel*);
} MenuPanel; // size = 0x1C
typedef struct WindowBackground {

View File

@ -64,6 +64,60 @@ typedef struct StarSpiritEffect {
/* 0x54 */ struct StarSpiritEffectUnkStruct* unk_54;
} StarSpiritEffect; // size = 0x58
typedef struct Effect1 {
/* 0x00 */ s16 unk_00;
/* 0x02 */ s16 unk_02;
/* 0x04 */ s16 unk_04;
/* 0x06 */ s16 unk_06;
/* 0x08 */ s32 unk_08;
/* 0x0C */ f32 x;
/* 0x10 */ f32 y;
/* 0x14 */ f32 z;
/* 0x18 */ f32 partX;
/* 0x1C */ f32 partY;
/* 0x20 */ f32 unk_20;
/* 0x24 */ f32 unk_24;
/* 0x28 */ char unk_28[0x4];
} Effect1; // size = 0x2C
typedef struct Effect6 {
/* 0x00 */ u16 type;
/* 0x02 */ char unk_02[0x2];
/* 0x04 */ f32 x;
/* 0x08 */ f32 y;
/* 0x0C */ f32 z;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20;
/* 0x24 */ f32 unk_24;
/* 0x28 */ f32 unk_28;
/* 0x2C */ f32 unk_2C;
/* 0x30 */ f32 unk_30;
/* 0x34 */ f32 unk_34;
/* 0x38 */ s32 unk_38;
/* 0x3C */ s32 unk_3C;
/* 0x40 */ s32 unk_40;
} Effect6; // size = 0x44
typedef struct Effect7 {
/* 0x00 */ s32 unk_00;
/* 0x04 */ u16 unk_04;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 unk_0C;
/* 0x10 */ f32 unk_10;
/* 0x14 */ char unk_14[0x44];
/* 0x58 */ f32 unk_58;
/* 0x5C */ f32 unk_5C;
/* 0x60 */ f32 unk_60;
/* 0x64 */ f32 unk_64;
/* 0x68 */ f32 unk_68;
/* 0x6C */ s32 unk_6C;
/* 0x70 */ s32 unk_70;
/* 0x74 */ s32 unk_74;
} Effect7; // size = 0x78
// Used by effects 8 and 9 (TODO: better name)
typedef struct Effect8 {
/* 0x00 */ s32 unk_00;
@ -168,6 +222,108 @@ typedef struct Effect12 {
/* 0x94 */ f32 unk_94;
} Effect12; // size = 0x98
typedef struct Effect13 {
/* 0x00 */ s32 unk_00;
/* 0x04 */ f32 unk_04;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 unk_0C;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20;
/* 0x24 */ f32 unk_24;
/* 0x28 */ f32 unk_28;
/* 0x2C */ f32 unk_2C;
/* 0x30 */ f32 unk_30;
/* 0x34 */ s32 unk_34;
/* 0x38 */ s32 unk_38;
/* 0x3C */ s32 unk_3C;
/* 0x40 */ s32 unk_40;
/* 0x44 */ s32 unk_44;
} Effect13; // size = 0x48
typedef struct Effect14 {
/* 0x00 */ f32 xPos;
/* 0x04 */ f32 yPos;
/* 0x08 */ f32 zPos;
/* 0x0C */ f32 unk_0C;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20;
/* 0x24 */ f32 unk_24;
/* 0x28 */ s32 unk_28;
} Effect14; // size = 0x2C
typedef struct Effect15 {
/* 0x000 */ s32 unk_00;
/* 0x004 */ f32 unk_04;
/* 0x008 */ f32 unk_08;
/* 0x00C */ f32 unk_0C;
/* 0x010 */ f32 unk_10;
/* 0x014 */ f32 unk_14;
/* 0x018 */ f32 unk_18;
/* 0x01C */ f32 unk_1C;
/* 0x020 */ f32 unk_20;
/* 0x024 */ f32 unk_24;
/* 0x028 */ s32 unk_28;
/* 0x02C */ f32 unk_2C;
/* 0x030 */ s32 unk_30;
/* 0x034 */ f32 unk_34;
/* 0x038 */ s32 unk_38;
/* 0x03C */ s32 unk_3C;
/* 0x040 */ Mtx unk_40[8];
/* 0x240 */ f32 unk_240;
/* 0x244 */ s32 unk_244;
/* 0x248 */ s32 unk_248;
/* 0x24C */ s32 unk_24C;
} Effect15; // size = 0x250
typedef struct Effect16 {
/* 0x00 */ s32 unk_00;
/* 0x04 */ f32 unk_04;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 unk_0C;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20;
/* 0x24 */ f32 unk_24;
/* 0x28 */ f32 unk_28;
/* 0x2C */ s32 unk_2C;
/* 0x30 */ s32 unk_30;
/* 0x34 */ s32 unk_34;
/* 0x38 */ s32 unk_38;
/* 0x3C */ s32 unk_3C;
} Effect16; // size = 0x40
typedef struct Effect73 {
/* 0x00 */ s32 unk_00;
/* 0x04 */ s32 unk_04;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 unk_0C;
/* 0x10 */ f32 unk_10;
/* 0x14 */ s32 unk_14;
/* 0x18 */ s32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ s32 unk_20;
} Effect73; // size = 0x24
typedef struct Effect75 {
/* 0x00 */ s32 unk_00;
/* 0x04 */ f32 unk_04;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 unk_0C;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 unk_18;
/* 0x1C */ s32 unk_1C;
/* 0x20 */ s32 unk_20;
} Effect75; // size = 0x24
// TODO figure out what this actually is
// playFX_4E invokes gEffectTable[78]'s entryPoint function
// playFX_6F invokes gEffectTable[111]'s entryPoint function
@ -219,8 +375,8 @@ typedef struct EffectInstance {
/* 0x00 */ s32 flags;
/* 0x04 */ s32 effectIndex;
/* 0x08 */ s32 numParts;
/* 0x0C */ void* data; // often but not always EffectInstanceData
/* 0x10 */ struct EffectGraphics* effect;
/* 0x0C */ Effect16* data; // often but not always EffectInstanceData
/* 0x10 */ struct EffectGraphics* graphics;
} EffectInstance; // size = 0x14
typedef struct EffectBlueprint {

View File

@ -10,16 +10,27 @@ void shim_remove_effect(EffectInstance*);
s32 shim_rand_int(s32);
void* shim_general_heap_malloc(s32 size);
RenderTask* shim_queue_render_task(RenderTask* task);
float shim_sqrtf(float value);
f32 shim_atan2(f32 startX, f32 startZ, f32 endX, f32 endZ);
f32 shim_sin_deg(f32 x);
f32 shim_cos_deg(f32 x);
f32 shim_clamp_angle(f32 theta);
void shim_get_background_color_blend(u8* r, u8* g, u8* b, u8* a);
void shim_guMtxF2L(float mf[4][4], Mtx *m);
void shim_guMtxCatF(float m[4][4], float n[4][4], float r[4][4]);
void shim_guScaleF(float mf[4][4], float x, float y, float z);
void shim_guRotateF(float mf[4][4], float a, float x, float y, float z);
void shim_guTranslate(Mtx *m, float x, float y, float z);
void shim_guTranslateF(float mf[4][4], float x, float y, float z);
void shim_guPositionF(float mf[4][4], float r, float p, float h, float s, float x, float y, float z);
void shim_mem_clear(void* data, s32 numBytes);
void shim_transform_point(Matrix4f mtx, f32 inX, f32 inY, f32 inZ, f32 inS, f32* outX, f32* outY, f32* outZ, f32* outS);
s32 shim_load_effect(s32 effectIndex);
s32 shim_npc_raycast_down_sides(s32, f32*, f32*, f32*, f32*);
void shim_sfx_play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY, f32 posZ);
void fx_6_main(s32 type, f32 x, f32 y, f32 z, f32 arg4);
#endif

View File

@ -14,7 +14,7 @@ extern BSS s32 filemenu_heldButtons;
extern BSS s32 filemenu_8024C090;
extern BSS s32 filemenu_loadedFileIdx;
extern BSS s32 filemenu_8024C098[2];
extern BSS s32 filemenu_cursorHudElemID;
extern BSS s32 filemenu_cursorHudElemID[1];
extern BSS s32 filemenu_8024C0A4[3];
extern BSS s32 filemenu_hudElemIDs[20];
extern BSS s32 filemenu_8024C100[8];

View File

@ -79,7 +79,7 @@ extern s8 D_800A0900;
extern f32 D_800F7B60[];
extern s16 D_800F7B80;
extern EncounterStatus gCurrentEncounter;
extern s8* D_801512F0;
extern u8* D_801512F0;
extern s16 D_80151308;
extern s32 D_80151310;
@ -378,6 +378,9 @@ extern s32 D_8029C890[12][5];
// Heap?
extern s32 D_8038F800;
extern s32 D_803B5000;
extern HeapNode heap_collisionHead;
extern HeapNode heap_generalHead;
extern HeapNode heap_battleHead;
extern s32 bMarioIdleAnims[];

View File

@ -1,4 +1,7 @@
#include "common.h"
#include "sprite.h"
extern s32 spr_allocateBtlComponentsOnWorldHeap;
typedef struct UnkSpr10 {
/* 0x00 */ s32 unk_00;

View File

@ -62,7 +62,7 @@ BSS s32 filemenu_heldButtons;
BSS s32 filemenu_8024C090;
BSS s32 filemenu_loadedFileIdx;
BSS s32 filemenu_8024C098[2];
BSS s32 filemenu_cursorHudElemID;
BSS s32 filemenu_cursorHudElemID[1];
BSS s32 filemenu_8024C0A4[3];
BSS s32 filemenu_hudElemIDs[20];
BSS s32 filemenu_8024C100[8];
@ -132,7 +132,7 @@ void filemenu_update_cursor(void) {
D_80249B94 += xDelta;
D_80249B98 += yDelta;
if (filemenu_cursorGoalAlpha == 0) {
if (filemenu_cursorGoalAlpha == 0) {
D_80249B9C -= 128;
if (D_80249B9C < 0) {
D_80249B9C = 0;
@ -143,7 +143,7 @@ void filemenu_update_cursor(void) {
D_80249B9C = 255;
}
}
for (i = 0x2C; i < ARRAY_COUNT(gWindows); i++) {
Window* window = &gWindows[i];
s8 parent = window->parent;
@ -168,7 +168,7 @@ void filemenu_update_cursor(void) {
D_80249B98 = D_80249BA4;
}
}
}
}
if (D_80249BB8 == 0) {
filemenu_cursorGoalAlpha = filemenu_cursorGoalAlpha2;
}
@ -539,9 +539,9 @@ void filemenu_draw_cursor(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32
if (temp_a1 > 255) {
temp_a1 = 255;
}
set_hud_element_alpha(filemenu_cursorHudElemID, temp_a1);
set_hud_element_render_pos(filemenu_cursorHudElemID, baseX + D_80249B94, baseY + D_80249B98);
draw_hud_element_3(filemenu_cursorHudElemID);
set_hud_element_alpha(filemenu_cursorHudElemID[0], temp_a1);
set_hud_element_render_pos(filemenu_cursorHudElemID[0], baseX + D_80249B94, baseY + D_80249B98);
draw_hud_element_3(filemenu_cursorHudElemID[0]);
}
}
@ -549,6 +549,32 @@ INCLUDE_ASM(s32, "163400", filemenu_draw_contents_copy_arrow);
INCLUDE_ASM(void, "163400", filemenu_init);
INCLUDE_ASM(s32, "163400", filemenu_cleanup);
// TODO bad match, look into
void filemenu_cleanup(void) {
MenuPanel** panelIt;
s32 i;
for (i = 0; i < ARRAY_COUNT(filemenu_cursorHudElemID); i++) {
free_hud_element(filemenu_cursorHudElemID[i]);
}
panelIt = filemenu_menus;
for (i = 0; i < ARRAY_COUNT(filemenu_menus); i++) {
if ((*panelIt)->unk_00.c.initialized) {
if ((*panelIt)->fpCleanup != NULL) {
(*panelIt)->fpCleanup(*panelIt);
}
}
panelIt++;
}
for (i = 0x2C; i < ARRAY_COUNT(gWindows); i++) {
set_window_update(i, 2);
}
set_window_update(0x18, 2);
set_window_update(0x17, 2);
func_80244BC4();
}
INCLUDE_ASM(s32, "163400", func_80244BC4);

View File

@ -9,7 +9,7 @@ extern f32 D_8024365C_ED364C[];
#include "world/common/UnkNpcAIFunc23.inc.c"
INCLUDE_ASM(s32, "ED0310", func_802404D0_ED04C0);
#include "world/common/UnkNpcAIFunc35.inc.c"
#include "world/common/UnkNpcAIFunc1.inc.c"

View File

@ -11,7 +11,7 @@ extern f32 D_802441DC_EE2B9C[];
#include "world/common/UnkNpcAIFunc23.inc.c"
INCLUDE_ASM(s32, "EDEA00", func_80240374_EDED34);
#include "world/common/UnkNpcAIFunc35.inc.c"
#include "world/common/UnkNpcAIFunc1.inc.c"

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ extern f32 D_80244070_EF1170[];
#include "world/common/UnkNpcAIFunc23.inc.c"
INCLUDE_ASM(s32, "EEDF50", func_80241000_EEE100);
#include "world/common/UnkNpcAIFunc35.inc.c"
#include "world/common/UnkNpcAIFunc1.inc.c"

View File

@ -7,7 +7,7 @@
#include "world/common/UnkNpcAIFunc23.inc.c"
INCLUDE_ASM(s32, "EF2680", func_80240220_EF2830);
#include "world/common/UnkNpcAIFunc35.inc.c"
#include "world/common/UnkNpcAIFunc1.inc.c"

View File

@ -340,16 +340,16 @@ void update_effects(void) {
EffectInstance* effectInstance = gEffectInstances[i];
if (effectInstance != NULL && (effectInstance->flags & EFFECT_INSTANCE_FLAGS_1)) {
effectInstance->effect->flags &= ~FX_GRAPHICS_FLAGS_2;
effectInstance->graphics->flags &= ~FX_GRAPHICS_FLAGS_2;
if (gGameStatusPtr->isBattle) {
if (effectInstance->flags & EFFECT_INSTANCE_FLAGS_4) {
effectInstance->effect->update(effectInstance);
effectInstance->graphics->update(effectInstance);
effectInstance->flags |= EFFECT_INSTANCE_FLAGS_8;
}
} else {
if (!(effectInstance->flags & EFFECT_INSTANCE_FLAGS_4)) {
effectInstance->effect->update(effectInstance);
effectInstance->graphics->update(effectInstance);
effectInstance->flags |= EFFECT_INSTANCE_FLAGS_8;
}
}
@ -382,11 +382,11 @@ void render_effects_world(void) {
if (gEffectInstances[i] != NULL && gEffectInstances[i]->flags & 1 && gEffectInstances[i]->flags & 8) {
if (gGameStatusPtr->isBattle) {
if (gEffectInstances[i]->flags & 4) {
gEffectInstances[i]->effect->renderWorld(gEffectInstances[i]);
gEffectInstances[i]->graphics->renderWorld(gEffectInstances[i]);
}
} else {
if (!(gEffectInstances[i]->flags & 4)) {
gEffectInstances[i]->effect->renderWorld(gEffectInstances[i]);
gEffectInstances[i]->graphics->renderWorld(gEffectInstances[i]);
}
}
}
@ -413,7 +413,7 @@ void render_effects_UI(void) {
continue;
}
renderUI = effectInstance->effect->renderUI;
renderUI = effectInstance->graphics->renderUI;
if (renderUI != stub_effect_delegate) {
if (cond) {
Camera* camera = &gCameras[gCurrentCameraID];
@ -498,7 +498,7 @@ EffectInstance* create_effect_instance(EffectBlueprint* effectBp) {
}
curEffect->instanceCounter++;
newEffectInst->effect = curEffect;
newEffectInst->graphics = curEffect;
if (effectBp->init != NULL) {
effectBp->init(newEffectInst);

View File

@ -1,33 +1,27 @@
#include "common.h"
#include "effects_internal.h"
typedef struct Effect1 {
/* 0x00 */ s16 unk_00;
/* 0x02 */ s16 unk_02;
/* 0x04 */ s16 unk_04;
/* 0x06 */ s16 unk_06;
/* 0x08 */ s32 unk_08;
/* 0x0C */ f32 x;
/* 0x10 */ f32 y;
/* 0x14 */ f32 z;
/* 0x18 */ f32 partX;
/* 0x1C */ f32 partY;
/* 0x20 */ f32 unk_20;
/* 0x24 */ f32 unk_24;
/* 0x28 */ char unk_28[0x4];
} Effect1; // size = 0x2C
static f32 D_E0002760[10] = { 10.0f, 40.0f, 80.0f, 170.0f, 140.0f, 100.0f, 25.0f, 155.0f, 60.0f, 120.0f };
static f32 D_E0002788[10] = { 2.2f, 2.7f, 3.0f, 2.2f, 2.7f, 3.0f, 1.9f, 1.9f, 1.5f, 1.5f };
static f32 sPartScales[10] = { 1.4f, 1.3f, 1.2f, 1.3f, 1.4f, 1.3f, 1.6f, 1.6f, 1.6f, 1.6f };
static f32 sPartYaws[10] = { 0.0f, 234.0f, 468.0f, 702.0f, 936.0f, 1260.0f, 1404.0f, 1638.0f, 1902.0f, 1976.0f };
static s32 sDlists[7] = { 0x09000FA0, 0x09001060, 0x09001120, 0x090011E0, 0x090012A0, 0x09001360, 0x09001420 };
extern Gfx D_09000FA0[];
extern Gfx D_09001060[];
extern Gfx D_09001120[];
extern Gfx D_090011E0[];
extern Gfx D_090012A0[];
extern Gfx D_09001360[];
extern Gfx D_09001420[];
static Gfx* sDlists[7] = {
D_09000FA0, D_09001060, D_09001120, D_090011E0, D_090012A0, D_09001360, D_09001420
};
void fx_1_init(EffectInstance* effect);
void fx_1_update(EffectInstance* effect);
void fx_1_render(EffectInstance* effect);
void fx_1_appendGfx(EffectInstance* effect);
void fx_1_appendGfx(void* effect);
void fx_1_main(f32 x, f32 y, f32 z) {
EffectBlueprint bp;
@ -124,35 +118,36 @@ void fx_1_render(EffectInstance* effect) {
retTask->renderMode |= RENDER_MODE_2;
}
void fx_1_appendGfx(EffectInstance* effect) {
Effect1* effectData = effect->data;
void fx_1_appendGfx(void* effect) {
EffectInstance* eff = (EffectInstance*)effect;
Effect1* effectData = ((EffectInstance*)effect)->data;
Matrix4f mtx;
s32 i;
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->effect->data));
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guPositionF(&mtx, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, effectData->x, effectData->y,
shim_guPositionF(mtx, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, effectData->x, effectData->y,
effectData->z);
shim_guMtxF2L(&mtx, &gDisplayContext->matrixStack[gMatrixListPos]);
shim_guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++,
&gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
for (i = 0; i < effect->numParts; i++, effectData++) {
for (i = 0; i < ((EffectInstance*)effect)->numParts; i++, effectData++) {
if (effectData->unk_02 >= 0 && effectData->unk_08 < 0) {
s32 primAlpha = effectData->unk_02;
f32 temp_f12;
s32 envAlpha;
s32 dlist;
Gfx* dlist;
if (primAlpha > 16) {
primAlpha = 16;
}
shim_guPositionF(&mtx, 0.0f, 0.0f, sPartYaws[i], sPartScales[i], effectData->partX,
shim_guPositionF(mtx, 0.0f, 0.0f, sPartYaws[i], sPartScales[i], effectData->partX,
effectData->partY, 0.0f);
shim_guMtxF2L(&mtx, &gDisplayContext->matrixStack[gMatrixListPos]);
shim_guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++,
&gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -7,7 +7,7 @@ extern Gfx D_090001B8[];
void fx_10_init(EffectInstance* effect);
void fx_10_update(EffectInstance* effect);
void fx_10_render(EffectInstance* effect);
void fx_10_appendGfx(EffectInstance* effect);
void fx_10_appendGfx(void* effect);
void fx_10_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3) {
EffectBlueprint bp;
@ -112,15 +112,15 @@ void fx_10_render(EffectInstance* effect) {
retTask->renderMode |= RENDER_MODE_2;
}
void fx_10_appendGfx(EffectInstance* effect) {
void fx_10_appendGfx(void* effect) {
EffectInstance* effectTemp = effect;
Effect10* part = effect->data;
Effect10* part = effectTemp->data;
Matrix4f sp20;
Matrix4f sp60;
s32 i;
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->effect->data));
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));
gSPDisplayList(gMasterGfxPos++, D_090000E0);
for (i = 0; i < effectTemp->numParts; i++, part++) {

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_100_appendGfx(EffectInstance* effect);
void fx_100_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_100", fx_100_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_101_appendGfx(EffectInstance* effect);
void fx_101_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_101", fx_101_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_102_appendGfx(EffectInstance* effect);
void fx_102_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_102", fx_102_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_103_appendGfx(EffectInstance* effect);
void fx_103_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_103", fx_103_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_104_appendGfx(EffectInstance* effect);
void fx_104_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_104", fx_104_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_105_appendGfx(EffectInstance* effect);
void fx_105_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_105", fx_105_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_107_appendGfx(EffectInstance* effect);
void fx_107_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_107", fx_107_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_109_appendGfx(EffectInstance* effect);
void fx_109_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_109", fx_109_main);

View File

@ -7,7 +7,7 @@ extern Gfx D_090001B8[];
void fx_11_init(EffectInstance* effect);
void fx_11_update(EffectInstance* effect);
void fx_11_render(EffectInstance* effect);
void fx_11_appendGfx(EffectInstance* effect);
void fx_11_appendGfx(void* effect);
void fx_11_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
EffectBlueprint bp;
@ -113,15 +113,15 @@ void fx_11_render(EffectInstance* effect) {
retTask->renderMode |= RENDER_MODE_2;
}
void fx_11_appendGfx(EffectInstance* effect) {
void fx_11_appendGfx(void* effect) {
EffectInstance* effectTemp = effect;
Effect11* part = effect->data;
Effect11* part = effectTemp->data;
Matrix4f sp20;
Matrix4f sp60;
s32 i;
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->effect->data));
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));
gSPDisplayList(gMasterGfxPos++, D_090000E0);
for (i = 0; i < effectTemp->numParts; i++, part++) {

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_110_appendGfx(EffectInstance* effect);
void fx_110_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_110", fx_110_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_111_appendGfx(EffectInstance* effect);
void fx_111_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_111", fx_111_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_112_appendGfx(EffectInstance* effect);
void fx_112_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_112", fx_112_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_113_appendGfx(EffectInstance* effect);
void fx_113_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_113", fx_113_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_114_appendGfx(EffectInstance* effect);
void fx_114_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_114", fx_114_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_115_appendGfx(EffectInstance* effect);
void fx_115_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_115", fx_115_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_116_appendGfx(EffectInstance* effect);
void fx_116_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_116", fx_116_main);

View File

@ -8,7 +8,7 @@ typedef struct Effect117 {
/* 0x0C */ f32 unk_0C;
} Effect117; // size = 0x??
void fx_117_appendGfx(EffectInstance* effect);
void fx_117_appendGfx(void* effect);
s32 D_E00EAA50[2] = { 0x09001A00, 0x09001A20 };

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_119_appendGfx(EffectInstance* effect);
void fx_119_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_119", fx_119_main);

View File

@ -1,13 +1,13 @@
#include "common.h"
#include "effects_internal.h"
extern Gfx* D_09000240[];
extern Gfx D_09000240[];
void func_E0018000(Effect12* part);
void fx_12_init(EffectInstance* effect);
void fx_12_update(EffectInstance* effect);
void fx_12_render(EffectInstance* effect);
void fx_12_appendGfx(EffectInstance* effect);
void fx_12_appendGfx(void* effect);
void func_E0018000(Effect12* part) {
Matrix4f sp18;
@ -114,17 +114,17 @@ void func_E00183BC(EffectInstance* effect) {
shim_remove_effect(effect);
}
void fx_12_appendGfx(EffectInstance* effect) {
void fx_12_appendGfx(void* effect) {
EffectInstance* effectTemp = effect;
Effect12* part = effect->data;
Effect12* part = effectTemp->data;
s32 i;
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->effect->data));
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));
for (i = 0; i < effectTemp->numParts; i++, part++) {
if (part->alive) {
Gfx** dlist = D_09000240;
Gfx* dlist = D_09000240;
gDisplayContext->matrixStack[gMatrixListPos] = part->mtx;

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_120_appendGfx(EffectInstance* effect);
void fx_120_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_120", fx_120_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_121_appendGfx(EffectInstance* effect);
void fx_121_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_121", func_E010E000);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_122_appendGfx(EffectInstance* effect);
void fx_122_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_122", fx_122_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_123_appendGfx(EffectInstance* effect);
void fx_123_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_123", fx_123_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_124_appendGfx(EffectInstance* effect);
void fx_124_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_124", fx_124_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_125_appendGfx(EffectInstance* effect);
void fx_125_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_125", fx_125_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_126_appendGfx(EffectInstance* effect);
void fx_126_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_126", fx_126_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_128_appendGfx(EffectInstance* effect);
void fx_128_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_128", fx_128_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_129_appendGfx(EffectInstance* effect);
void fx_129_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_129", fx_129_main);

View File

@ -1,14 +1,131 @@
#include "common.h"
#include "effects_internal.h"
void fx_13_appendGfx(EffectInstance* effect);
s32 D_E001A610 = 0;
INCLUDE_ASM(s32, "effects/effect_13", fx_13_main);
extern Gfx D_090002F0[];
void fx_13_init(void) {
void fx_13_init(EffectInstance* effect);
void fx_13_update(EffectInstance* effect);
void fx_13_render(EffectInstance* effect);
void fx_13_appendGfx(void* effect);
void fx_13_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) {
EffectBlueprint bp;
EffectInstance* effect;
Effect13* part;
s32 numParts = 1;
f32 phi_f6;
bp.unk_00 = 0;
bp.init = fx_13_init;
bp.update = fx_13_update;
bp.renderWorld = fx_13_render;
bp.unk_14 = 0;
bp.effectIndex = 13;
effect = shim_create_effect_instance(&bp);
effect->numParts = 1;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
part->unk_00 = arg0;
part->unk_04 = arg1;
part->unk_0C = arg3;
part->unk_10 = 0.0f;
part->unk_14 = 0.0f;
part->unk_18 = 0;
part->unk_08 = arg2 + 10.0f;
if (arg0 == 0) {
part->unk_18 = 0;
part->unk_24 = 0.0f;
part->unk_28 = 0.0f;
part->unk_1C = 0.12f;
part->unk_20 = -0.0152f;
part->unk_2C = 3.0f;
if (D_E001A610 != 0) {
phi_f6 = -10.0f;
} else {
phi_f6 = 10.0f;
}
part->unk_30 = phi_f6;
part->unk_34 = arg4;
} else {
part->unk_1C = 0.12f;
part->unk_20 = -0.0152f;
part->unk_24 = (shim_rand_int(1) * 30) - 15;
part->unk_28 = shim_rand_int(360);
part->unk_2C = 0;
part->unk_30 = (shim_rand_int(1) * 8) - 4;
part->unk_34 = arg4;
part->unk_38 = 0;
part->unk_44 = shim_rand_int(10);
part->unk_40 = shim_rand_int(20);
part->unk_3C = (shim_rand_int(1) * 2) - 1;
}
D_E001A610++;
if (D_E001A610 >= 2) {
D_E001A610 = 0;
}
}
INCLUDE_ASM(s32, "effects/effect_13", fx_13_update);
void fx_13_init(EffectInstance* effect) {
}
void fx_13_update(EffectInstance* effect) {
Effect13* data = effect->data;
s32 unk_00 = data->unk_00;
if (data->unk_34 < 150) {
data->unk_10 -= 0.001;
data->unk_04 += data->unk_10;
data->unk_0C += data->unk_18;
data->unk_24 += data->unk_2C;
if (unk_00 == 0) {
if (data->unk_24 < 10.0f) {
data->unk_24 = 10.0f;
data->unk_2C = -data->unk_2C;
}
if (data->unk_24 > 45.0f) {
data->unk_24 = 45.0f;
data->unk_2C = -data->unk_2C;
}
}
data->unk_28 += data->unk_30;
if (unk_00 == 0) {
data->unk_14 = 1.4f;
} else {
data->unk_14 = 1.0f;
}
} else {
data->unk_20 += 0.0007;
data->unk_1C += data->unk_20;
data->unk_14 += data->unk_1C;
if (data->unk_14 > 1.0f) {
data->unk_14 = 1.0f;
}
}
if (unk_00 == 1) {
data->unk_40 += data->unk_3C;
if (data->unk_40 >= 20) {
data->unk_40 = 20;
data->unk_3C = -1;
} else if (data->unk_40 <= 0) {
data->unk_40 = 0;
data->unk_3C = unk_00;
}
}
data->unk_08 += data->unk_14;
data->unk_34 += -1;
data->unk_38 += 1;
if (data->unk_34 < 0) {
shim_remove_effect(effect);
}
}
void fx_13_render(EffectInstance* effect) {
RenderTask renderTask;
@ -23,4 +140,31 @@ void fx_13_render(EffectInstance* effect) {
retTask->renderMode |= RENDER_MODE_2;
}
INCLUDE_ASM(s32, "effects/effect_13", fx_13_appendGfx);
void fx_13_appendGfx(void* effect) {
Matrix4f sp20, other;
EffectInstance* effectTemp = effect;
Effect13* part = effectTemp->data;
u32 alpha;
u8 rgb, a;
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));
shim_guPositionF(sp20, part->unk_24, part->unk_28, 0.0f, 1.0f, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
a = alpha = 255;
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
if (*D_801512F0 == 1) {
shim_get_background_color_blend(&rgb, &rgb, &rgb, &a);
alpha -= a;
}
if (alpha != 0) {
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, alpha);
gSPDisplayList(gMasterGfxPos++, D_090002F0);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
}
}

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_130_appendGfx(EffectInstance* effect);
void fx_130_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_130", fx_130_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_131_appendGfx(EffectInstance* effect);
void fx_131_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_131", fx_131_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_132_appendGfx(EffectInstance* effect);
void fx_132_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_132", fx_132_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_133_appendGfx(EffectInstance* effect);
void fx_133_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_133", fx_133_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_134_appendGfx(EffectInstance* effect);
void fx_134_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_134", fx_134_main);

View File

@ -1,20 +1,85 @@
#include "common.h"
#include "effects_internal.h"
typedef struct Effect14 {
/* 0x00 */ f32 xPos; //xPos
/* 0x04 */ f32 yPos; //yPos
/* 0x08 */ f32 zPos; //zPos
} Effect14; // size = 0x??
s32 D_E001C5E0 = 0;
void fx_14_appendGfx(EffectInstance* effect);
extern Gfx D_09000900[];
extern Gfx D_090009E8[];
INCLUDE_ASM(s32, "effects/effect_14", fx_14_main);
void fx_14_init(EffectInstance* effect);
void fx_14_update(EffectInstance* effect);
void fx_14_render(EffectInstance* effect);
void fx_14_appendGfx(void* effect);
void fx_14_init(void) {
void fx_14_main(f32 arg0, f32 arg1, f32 arg2, s32 arg3, s32 arg4) {
EffectBlueprint bp;
EffectInstance* effect;
Effect14* part;
s32 numParts = 1;
f32 phi_f4;
bp.unk_00 = 0;
bp.init = fx_14_init;
bp.update = fx_14_update;
bp.renderWorld = fx_14_render;
bp.unk_14 = 0;
bp.effectIndex = 14;
effect = shim_create_effect_instance(&bp);
effect->numParts = 1;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
part->xPos = arg0;
part->yPos = arg1;
part->zPos = arg2;
part->unk_0C = 0;
part->unk_14 = 0;
part->unk_18 = 0;
part->unk_1C = 0;
part->unk_10 = -3.0f;
part->unk_20 = 3.0f;
if (D_E001C5E0 != 0) {
phi_f4 = -10.0f;
} else {
phi_f4 = 10.0f;
}
part->unk_24 = phi_f4;
part->unk_28 = arg3;
D_E001C5E0++;
if (D_E001C5E0 >= 2) {
D_E001C5E0 = 0;
}
}
INCLUDE_ASM(s32, "effects/effect_14", fx_14_update);
void fx_14_init(EffectInstance* effect) {
}
void fx_14_update(EffectInstance* effect) {
Effect14* data = effect->data;
data->unk_28--;
if (data->unk_28 < 0) {
shim_remove_effect(effect);
return;
}
data->xPos += data->unk_0C;
data->yPos += data->unk_10;
data->zPos += data->unk_14;
data->unk_18 += data->unk_20;
if (data->unk_18 < 10.0f) {
data->unk_18 = 10.0f;
data->unk_20 = -data->unk_20;
}
if (data->unk_18 > 45.0f) {
data->unk_18 = 45.0f;
data->unk_20 = -data->unk_20;
}
data->unk_1C += data->unk_24;
}
void fx_14_render(EffectInstance* effect) {
PlayerStatus* playerStatus = &gPlayerStatus;
@ -24,7 +89,7 @@ void fx_14_render(EffectInstance* effect) {
RenderTask* retTask;
f32 effectPos = effect14->xPos;
f32 playerPos = playerStatus->position.x;
if (effectPos - playerPos > 200) {
effect14->xPos = effectPos - 400;
} else {
@ -52,4 +117,30 @@ void fx_14_render(EffectInstance* effect) {
retTask->renderMode |= RENDER_MODE_2;
}
INCLUDE_ASM(s32, "effects/effect_14", fx_14_appendGfx);
void fx_14_appendGfx(void* effect) {
Matrix4f sp18, sp58, sp98, spD8, sp118;
EffectInstance* effectTemp = effect;
Effect14* part = effectTemp->data;
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));
gSPDisplayList(gMasterGfxPos++, D_09000900);
shim_guTranslateF(sp18, part->xPos, part->yPos, part->zPos);
shim_guRotateF(spD8, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(spD8, sp18, sp118);
shim_guMtxF2L(sp118, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, 255);
shim_guRotateF(sp58, part->unk_18, 1.0f, 0.0f, 0.0f);
shim_guRotateF(sp98, part->unk_1C, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp98, sp118);
shim_guMtxF2L(sp118, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, D_090009E8);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
}

View File

@ -1,19 +1,182 @@
#include "common.h"
#include "effects_internal.h"
typedef struct Effect15 {
/* 0x00 */ char unk_00[0x38];
/* 0x38 */ s32 unk_38;
} Effect15; // size = 0x??
extern Gfx D_09001530[];
extern Gfx D_09001650[];
extern Gfx D_09001780[];
extern Gfx D_090017D0[];
void fx_15_appendGfx(EffectInstance* effect);
void fx_15_init(EffectInstance* effect);
void fx_15_update(EffectInstance* effect);
void fx_15_render(EffectInstance* effect);
void fx_15_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_15", fx_15_main);
EffectInstance* fx_15_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) {
EffectBlueprint bp;
Effect15* part;
EffectInstance* effect;
s32 numParts = 1;
s32 i;
void fx_15_init(void) {
f32 temp_f12;
f32 temp_f20;
f32 currentYaw;
f32 sinYaw;
f32 cosYaw;
f32 temp_f22;
f32 temp_f24;
f32 temp_f26;
f32 temp_f2;
f32 temp_f4;
s32 temp_s0;
f32 phi_f26;
bp.unk_00 = 0;
bp.init = fx_15_init;
bp.update = fx_15_update;
bp.renderWorld = fx_15_render;
bp.unk_14 = 0;
bp.effectIndex = 15;
effect = shim_create_effect_instance(&bp);
effect->numParts = 1;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
part->unk_00 = 1;
part->unk_04 = arg1;
part->unk_08 = arg2;
part->unk_0C = arg3;
part->unk_1C = 0;
part->unk_24 = 0.0f;
part->unk_28 = 0;
part->unk_38 = arg0;
if (arg0 == 3) {
part->unk_240 = 0.2f;
part->unk_244 = shim_rand_int(255);
part->unk_248 = shim_rand_int(255 - part->unk_244);
temp_s0 = (255 - part->unk_248);
part->unk_24C = temp_s0 - part->unk_244;
} else {
part->unk_244 = 210;
part->unk_248 = 186;
part->unk_24C = 90;
part->unk_240 = 0.5f;
}
temp_f24 = arg4 - arg1;
temp_f22 = arg5 - arg2;
temp_f20 = arg6 - arg3;
temp_f26 = SQ(temp_f24) + SQ(temp_f22) + SQ(temp_f20);
phi_f26 = temp_f26;
if (temp_f26 != 0.0f) {
phi_f26 = shim_sqrtf(temp_f26);
temp_f26 = arg7 / phi_f26;
}
part->unk_10 = temp_f24 * temp_f26;
part->unk_14 = temp_f22 * temp_f26;
part->unk_18 = temp_f20 * temp_f26;
currentYaw = gCameras[gCurrentCameraID].currentYaw;
cosYaw = -shim_cos_deg(currentYaw);
sinYaw = -shim_sin_deg(currentYaw);
temp_f4 = cosYaw * part->unk_10;
temp_f2 = sinYaw * part->unk_18;
temp_f12 = SQ(temp_f4) + SQ(temp_f2);
if (temp_f12 != 0.0f) {
temp_f12 = shim_sqrtf(temp_f12);
}
if ((cosYaw * part->unk_10) + (sinYaw * part->unk_18) < 0.0f) {
temp_f12 = -temp_f12;
part->unk_2C = -20.0f;
} else {
part->unk_2C = 20.0f;
}
part->unk_20 = part->unk_24 = shim_atan2(0.0f, 0.0f, -part->unk_14, -temp_f12);
part->unk_30 = phi_f26 / arg7;
part->unk_34 = -temp_f12;
shim_guTranslate(part->unk_40, part->unk_04, part->unk_08, part->unk_0C);
for (i = 1; i < ARRAY_COUNT(part->unk_40); i++) {
part->unk_40[i] = part->unk_40[0];
}
part->unk_3C = -1;
return effect;
}
INCLUDE_ASM(s32, "effects/effect_15", fx_15_update);
void fx_15_init(EffectInstance* effect) {
}
void fx_15_update(EffectInstance* effect) {
PlayerStatus* playerStatus = &gPlayerStatus;
Effect15* data = effect->data;
f32 x, y, z, length;
f32 xTemp, yTemp, zTemp;
if (data->unk_38 >= 2) {
length = SQ(data->unk_10) + SQ(data->unk_14) + SQ(data->unk_18);
if (length > 0.01f) {
length = 1.0f / shim_sqrtf(length);
}
xTemp = data->unk_10 * length * 32.0f;
yTemp = data->unk_14 * length * 32.0f;
zTemp = data->unk_18 * length * 32.0f;
x = data->unk_04 - xTemp;
y = data->unk_08 - yTemp;
z = data->unk_0C - zTemp;
length = 64.0f;
if (data->unk_00 != 0 &&
data->unk_14 < 0.0f &&
shim_npc_raycast_down_sides(0, &x, &y, &z, &length) != 0 &&
length < 42.0f)
{
data->unk_1C = data->unk_1C + 1.0f;
data->unk_14 = -data->unk_14 * 0.6;
data->unk_10 = data->unk_10 * 0.7;
data->unk_34 = data->unk_34 * 0.7;
data->unk_2C = data->unk_2C * 0.7;
shim_load_effect(6);
fx_6_main(0, data->unk_04, data->unk_08 - 5.0f, data->unk_0C, 0.0f);
if (!gGameStatusPtr->isBattle) {
shim_sfx_play_sound_at_position(0xB0000016, 0, data->unk_04, data->unk_08, data->unk_0C);
}
data->unk_00 = 0;
if (data->unk_1C >= 10.0f) {
data->unk_30 = -1;
}
}
if (data->unk_1C != 0.0f) {
data->unk_14 += -0.5;
data->unk_24 += data->unk_2C;
data->unk_20 = shim_atan2(0.0f, 0.0f, -data->unk_14, data->unk_34);
}
}
if (playerStatus->position.y - data->unk_08 > 300.0f) {
data->unk_30 = -1;
}
data->unk_04 += data->unk_10;
data->unk_08 += data->unk_14;
data->unk_0C += data->unk_18;
if (data->unk_30 < 0) {
shim_remove_effect(effect);
}
}
void fx_15_render(EffectInstance* effect) {
Effect15* effect15 = effect->data;
@ -31,7 +194,7 @@ void fx_15_render(EffectInstance* effect) {
renderModeTemp = RENDER_MODE_SURF_SOLID_AA_ZB_LAYER0;
}
renderTaskPtr->renderMode = renderModeTemp;
retTask = shim_queue_render_task(&renderTask);
}

View File

@ -1,16 +1,159 @@
#include "common.h"
#include "effects_internal.h"
void fx_16_appendGfx(EffectInstance* effect);
extern Gfx D_09002170[];
extern Gfx D_09002238[];
extern Gfx D_090022E0[];
extern Gfx D_09002308[];
extern Gfx D_090023B0[];
extern Gfx D_090023D8[];
extern Gfx D_09002480[];
extern Gfx D_090024A8[];
extern Gfx D_09002550[];
extern Gfx D_09002578[];
Gfx* D_E0020C90[] = { D_090022E0, NULL, D_090023B0, D_09002480, D_09002550 };
Gfx* D_E0020CA4[] = { D_09002238, NULL, D_09002308, D_090023D8, D_090024A8 };
s8 D_E0020CB8[40] = {
0, 0, 1, 2, 3, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-1, 0
};
s8 D_E0020CE0[28] = {
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, 0, 0, 0
};
s8 D_E0020CFC[40] = {
0, 0, 2, 1, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, -1,
0, 0
};
s8 D_E0020D24[12] = { 0, 0, 1, 1, 2, 2, 3, 3, -13, 0, 0, 0 };
s8 D_E0020D30[80] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, -1, 0
};
s8* D_E0020D80[5] = { D_E0020CB8, D_E0020CE0, D_E0020CFC, D_E0020D24, D_E0020D30 };
s8 D_E0020D94[] = {
64, 0, 0, 32, 0, 32, 0, 0, 64, 0, 32, 32, 0, 64, 0, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
void func_E0020000(Effect16* part, s32 arg1);
void fx_16_init(EffectInstance* effect);
void fx_16_update(EffectInstance* effect);
void fx_16_render(EffectInstance* effect);
void fx_16_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_16", func_E0020000);
INCLUDE_ASM(s32, "effects/effect_16", fx_16_main);
void fx_16_main(s32 arg0, s32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, s32 arg7, EffectInstance** arg8) {
EffectBlueprint bp;
EffectBlueprint* bpPtr = &bp;
Effect16* part;
EffectInstance* effect;
s32 numParts;
if (arg0 == 1) {
numParts = 3;
} else {
numParts = 1;
}
void fx_16_init(void) {
bp.unk_00 = 0;
bp.init = fx_16_init;
bp.update = fx_16_update;
bp.renderWorld = fx_16_render;
bp.unk_14 = 0;
bp.effectIndex = 16;
effect = shim_create_effect_instance(bpPtr);
effect->numParts = numParts;
part = effect->data = shim_general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data != NULL);
part->unk_3C = arg1;
part->unk_00 = arg0;
part->unk_30 = arg0;
if (arg7 <= 0) {
arg7 = 10000;
}
part->unk_2C = arg7;
part->unk_34 = 0;
if (arg0 == 1) {
s32 i;
for (i = 0; i < numParts; i++, part++) {
part->unk_10 = arg2;
part->unk_14 = arg3;
part->unk_18 = arg4;
part->unk_1C = arg6;
part->unk_20 = arg5;
part->unk_3C = arg1;
func_E0020000(part, i);
}
} else {
part->unk_10 = arg2;
part->unk_14 = arg3;
part->unk_18 = arg4;
part->unk_1C = arg6;
part->unk_20 = arg5;
part->unk_3C = arg1;
func_E0020000(part, 1);
}
*arg8 = effect;
}
INCLUDE_ASM(s32, "effects/effect_16", fx_16_update);
void fx_16_init(EffectInstance* effect) {
}
void fx_16_update(EffectInstance* effect) {
Effect16* part = effect->data;
s32 temp_a0 = D_E0020D80[part->unk_30][part->unk_34];
s32 type = part->unk_00;
part->unk_34++;
part->unk_38 = temp_a0;
if (part->unk_38 < 0) {
if (part->unk_38 != -1) {
part->unk_30 = -part->unk_38 - 10;
part->unk_34 = 0;
part->unk_38 = D_E0020D80[part->unk_30][0];
part->unk_34 = 1;
} else {
shim_remove_effect(effect);
return;
}
}
if (part->unk_2C < 10000) {
part->unk_2C--;
}
if (part->unk_2C < 0) {
shim_remove_effect(effect);
return;
}
if (part->unk_3C != 0) {
if (type == 1) {
s32 i;
for (i = 0; i < effect->numParts; i++, part++) {
func_E0020000(part, i);
}
} else {
func_E0020000(part, 1);
}
}
}
void fx_16_render(EffectInstance* effect) {
RenderTask renderTask;
@ -25,4 +168,118 @@ void fx_16_render(EffectInstance* effect) {
retTask->renderMode |= RENDER_MODE_2;
}
// lots of issues
#ifdef NON_EQUIVALENT
void fx_16_appendGfx(void* effect) {
Matrix4f sp18;
Matrix4f sp58;
EffectInstance* effectTemp = effect;
Effect16* part = effectTemp->data;
s32 idx;
s32 type;
Gfx* temp_a3;
Gfx* temp_t0;
Mtx* blah;
s32 sp9C;
s32 spA0;
s32 temp_a0_3;
s32 phi_t1;
s32 phi_s7;
s32 phi_fp;
type = part->unk_00;
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));
//phi_s7 = saved_reg_s7;
//phi_fp = saved_reg_fp;
if (type != 1) {
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos++]);
shim_guScaleF(sp58, 1.0f, 0.8f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, part->unk_24, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, D_09002170)
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
} else {
if (part->unk_38 == 0) {
s32 i;
for (i = 0; i < 3; i++, part++) {
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, part->unk_24, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, part->unk_28, part->unk_28, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 235, 28, 0, 255);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMasterGfxPos++, D_09002578);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
}
}
}
temp_a0_3 = part->unk_38;
temp_a3 = D_E0020CA4[type];
temp_t0 = D_E0020C90[type];
switch (type) {
case 2:
sp9C = 0x20;
phi_t1 = 0x30;
phi_s7 = 0x80 - (temp_a0_3 << 5);
spA0 = phi_t1;
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 220, 0, 0, 255);
phi_fp = 0;
break;
case 3:
sp9C = 0x20;
spA0 = 0x20;
idx = (part->unk_2C * 3) % 7;
gDPSetPrimColor(gMasterGfxPos++, 0, 0, D_E0020D94[idx], D_E0020D94[idx + 1], D_E0020D94[idx + 2], 255);
phi_s7 = 0x80 - (temp_a0_3 << 5);
phi_fp = 0;
break;
case 4:
sp9C = 0x20;
spA0 = 8;
phi_s7 = 0x80 - (temp_a0_3 << 5);
phi_fp = 0;
break;
default:
phi_t1 = 0x10;
if (type == 0) {
sp9C = 0x10;
phi_s7 = 0x80 - (temp_a0_3 * 0x10);
spA0 = phi_t1;
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 220, 0, 0, 255);
phi_fp = 0;
}
break;
}
if (temp_a3 != NULL) {
gSPDisplayList(gMasterGfxPos++, temp_a3);
}
gDPSetTileSize(gMasterGfxPos++, 2, phi_s7, 0, phi_s7 + sp9C, spA0);
if (temp_t0 != NULL) {
gSPDisplayList(gMasterGfxPos++, temp_t0);
}
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
}
#else
INCLUDE_ASM(s32, "effects/effect_16", fx_16_appendGfx);
#endif

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_17_appendGfx(EffectInstance* effect);
void fx_17_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_17", fx_17_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_18_appendGfx(EffectInstance* effect);
void fx_18_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_18", fx_18_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_19_appendGfx(EffectInstance* effect);
void fx_19_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_19", fx_19_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_20_appendGfx(EffectInstance* effect);
void fx_20_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_20", fx_20_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_21_appendGfx(EffectInstance* effect);
void fx_21_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_21", fx_21_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_22_appendGfx(EffectInstance* effect);
void fx_22_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_22", fx_22_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_23_appendGfx(EffectInstance* effect);
void fx_23_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_23", fx_23_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_24_appendGfx(EffectInstance* effect);
void fx_24_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_24", fx_24_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_25_appendGfx(EffectInstance* effect);
void fx_25_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_25", fx_25_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_26_appendGfx(EffectInstance* effect);
void fx_26_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_26", fx_26_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_27_appendGfx(EffectInstance* effect);
void fx_27_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_27", fx_27_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_28_appendGfx(EffectInstance* effect);
void fx_28_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_28", fx_28_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_29_appendGfx(EffectInstance* effect);
void fx_29_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_29", fx_29_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_31_appendGfx(EffectInstance* effect);
void fx_31_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_31", fx_31_main);

View File

@ -8,7 +8,7 @@ typedef struct Effect32 {
/* 0x0C */ f32 unk_0C;
} Effect32; // size = 0x??
void fx_32_appendGfx(EffectInstance* effect);
void fx_32_appendGfx(void* effect);
u32 D_E0040840[2] = { 0xFF6DFF5C, 0x66BFFF4B };

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_33_appendGfx(EffectInstance* effect);
void fx_33_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_33", fx_33_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_34_appendGfx(EffectInstance* effect);
void fx_34_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_34", fx_34_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_35_appendGfx(EffectInstance* effect);
void fx_35_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_35", fx_35_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_36_appendGfx(EffectInstance* effect);
void fx_36_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_36", fx_36_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_37_appendGfx(EffectInstance* effect);
void fx_37_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_37", fx_37_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_38_appendGfx(EffectInstance* effect);
void fx_38_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_38", fx_38_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_39_appendGfx(EffectInstance* effect);
void fx_39_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_39", fx_39_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_40_appendGfx(EffectInstance* effect);
void fx_40_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_40", fx_40_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_41_appendGfx(EffectInstance* effect);
void fx_41_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_41", fx_41_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_43_appendGfx(EffectInstance* effect);
void fx_43_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_43", fx_43_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_44_appendGfx(EffectInstance* effect);
void fx_44_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_44", fx_44_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_45_appendGfx(EffectInstance* effect);
void fx_45_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_45", fx_45_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_46_appendGfx(EffectInstance* effect);
void fx_46_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_46", fx_46_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_48_appendGfx(EffectInstance* effect);
void fx_48_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_48", fx_48_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_49_appendGfx(EffectInstance* effect);
void fx_49_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_49", fx_49_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_50_appendGfx(EffectInstance* effect);
void fx_50_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_50", fx_50_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_51_appendGfx(EffectInstance* effect);
void fx_51_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_51", fx_51_main);

View File

@ -5,7 +5,7 @@ typedef struct Effect52 {
/* 0x00 */ s32 unk_00;
} Effect52; // size = 0x??
void fx_52_appendGfx(EffectInstance* effect);
void fx_52_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_52", fx_52_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_53_appendGfx(EffectInstance* effect);
void fx_53_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_53", func_E006A000);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_54_appendGfx(EffectInstance* effect);
void fx_54_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_54", fx_54_main);

View File

@ -6,7 +6,7 @@ typedef struct Effect55 {
/* 0x14 */ f32 unk_14;
} Effect55; // size = 0x??
void fx_55_appendGfx(EffectInstance* effect);
void fx_55_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_55", fx_55_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_56_appendGfx(EffectInstance* effect);
void fx_56_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_56", fx_56_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_57_appendGfx(EffectInstance* effect);
void fx_57_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_57", fx_57_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_58_appendGfx(EffectInstance* effect);
void fx_58_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_58", fx_58_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_59_appendGfx(EffectInstance* effect);
void fx_59_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_59", fx_59_main);

View File

@ -1,29 +1,16 @@
#include "common.h"
#include "effects_internal.h"
typedef struct Effect6 {
/* 0x00 */ u16 type;
/* 0x02 */ char unk_02[0x2];
/* 0x04 */ f32 x;
/* 0x08 */ f32 y;
/* 0x0C */ f32 z;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 unk_18;
/* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20;
/* 0x24 */ f32 unk_24;
/* 0x28 */ f32 unk_28;
/* 0x2C */ f32 unk_2C;
/* 0x30 */ f32 unk_30;
/* 0x34 */ f32 unk_34;
/* 0x38 */ s32 unk_38;
/* 0x3C */ s32 unk_3C;
/* 0x40 */ s32 unk_40;
} Effect6; // size = 0x44
extern Gfx D_09002780[];
extern Gfx D_09002868[];
extern Gfx D_09002950[];
extern Gfx D_09002A38[];
extern Gfx D_09002B20[];
extern Gfx D_09002B40[];
extern Gfx D_09002B60[];
static s32 sDlists[] = { 0x09002B20, 0x09002B40, 0x09002B60, 0x09002B60, 0x09002B60 };
static s32 sDlists2[] = { 0x09002780, 0x09002868, 0x09002950, 0x09002A38, 0x09002A38 };
static Gfx* sDlists[] = { D_09002B20, D_09002B40, D_09002B60, D_09002B60, D_09002B60 };
static Gfx* sDlists2[] = { D_09002780, D_09002868, D_09002950, D_09002A38, D_09002A38 };
static s8 D_E000CC38[] = { 0x00, 0x01, 0x02, 0x1A, 0x03, 0x1B, 0x04, 0x1C, 0x05, 0x15, 0x35, 0x46, 0x46, 0x46, 0xFF,
0x00 };
@ -47,12 +34,12 @@ static s8 D_E000CCE0[] = { 0x00, 0x10, 0x20, 0x30, 0x01, 0x11, 0x21, 0x31, 0x02,
0x1E, 0x26, 0x26, 0x2E, 0x36, 0x36, 0x3E, 0x47, 0x47, 0x4F, 0x57, 0x57, 0x5F, 0x67, 0x67,
0x6F, 0x77, 0x77, 0x7F, 0xFF, 0x00, 0x00, 0x00 };
static s8* D_E000CD24[4] = { &D_E000CC38, &D_E000CC48, &D_E000CC5C, &D_E000CCE0 };
static s8* D_E000CD24[4] = { D_E000CC38, D_E000CC48, D_E000CC5C, D_E000CCE0 };
void fx_6_init(EffectInstance* effect);
void fx_6_update(EffectInstance* effect);
void fx_6_render(EffectInstance* effect);
void fx_6_appendGfx(EffectInstance* effect);
void fx_6_appendGfx(void* effect);
void func_E000C000(Effect6* part) {
part->unk_18 += part->unk_1C;
@ -270,8 +257,8 @@ void fx_6_render(EffectInstance* effect) {
retTask->renderMode |= RENDER_MODE_2;
}
void fx_6_appendGfx(EffectInstance* effect) {
Effect6* part = effect->data;
void fx_6_appendGfx(void* effect) {
Effect6* part = ((EffectInstance*)effect)->data;
s32 type = part->type;
s32 temp_t0 = part->unk_40;
Matrix4f mtx1;
@ -281,8 +268,8 @@ void fx_6_appendGfx(EffectInstance* effect) {
s32 spDC;
s32 temp_lo;
s32 envAlpha;
s32 dlist1;
s32 dlist2;
Gfx* dlist1;
Gfx* dlist2;
s32 phi_a0;
s32 temp;
s32 i;
@ -293,7 +280,7 @@ void fx_6_appendGfx(EffectInstance* effect) {
dlist2 = sDlists2[type];
gDPPipeSync(gMasterGfxPos++);
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->effect->data));
gSPSegment(gMasterGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMasterGfxPos++, dlist2);
spD8 = temp_t0 & 7;
@ -344,7 +331,7 @@ void fx_6_appendGfx(EffectInstance* effect) {
part++;
for (i = 1; i < effect->numParts; i++, part++) {
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
shim_guTranslateF(mtx1, part->x, part->y, part->z);
shim_guMtxF2L(mtx1, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],

View File

@ -5,7 +5,7 @@ typedef struct Effect60 {
/* 0x00 */ s32 unk_00;
} Effect60; // size = 0x??
void fx_60_appendGfx(EffectInstance* effect);
void fx_60_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_60", fx_60_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_61_appendGfx(EffectInstance* effect);
void fx_61_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_61", fx_61_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_62_appendGfx(EffectInstance* effect);
void fx_62_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_62", fx_62_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_63_appendGfx(EffectInstance* effect);
void fx_63_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_63", fx_63_main);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_66_appendGfx(EffectInstance* effect);
void fx_66_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_66", func_E0084000);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_68_appendGfx(EffectInstance* effect);
void fx_68_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_68", func_E0088000);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "effects_internal.h"
void fx_69_appendGfx(EffectInstance* effect);
void fx_69_appendGfx(void* effect);
INCLUDE_ASM(s32, "effects/effect_69", func_E008A000);

Some files were not shown because too many files have changed in this diff Show More