diff --git a/assets/yaml/us/ast_7_ti_1.yaml b/assets/yaml/us/ast_7_ti_1.yaml new file mode 100644 index 00000000..75579e9a --- /dev/null +++ b/assets/yaml/us/ast_7_ti_1.yaml @@ -0,0 +1,312 @@ +:config: + segments: + - [0x07, 0xA0E340] + header: + code: + - '#include "assets/ast_7_ti_1.h"' + header: + - '#include "gfx.h"' + - '#include "sf64object.h"' + - '#include "structs.h"' + +# TODO: There are still Limbs and probably other things inside BLOBS + +# MISSING TLUT! Not clear what uses this texture yet! +D_AST_7_TI_1_7000000: + { type: TEXTURE, ctype: u8, format: CI8, width: 96, height: 28, offset: 0x07000000, symbol: D_AST_7_TI_1_7000000, tlut: 0x07001108 } + +D_7000A80: + { type: GFX, offset: 0x7000A80, symbol: D_7000A80 } + +D_7000D08: + { type: TEXTURE, ctype: u8, format: CI8, width: 32, height: 32, offset: 0x07000D08, symbol: D_7000D08, tlut: 0x07001108 } + +D_7001108: + { type: TEXTURE, ctype: u16, format: TLUT, colors: 176, offset: 0x07001108, symbol: D_7001108 } + +D_7001268: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 64, offset: 0x7001268, symbol: D_7001268, pad: 8 } + +D_7002270: + { type: GFX, offset: 0x7002270, symbol: D_7002270 } + +D_7002490: + { type: GFX, offset: 0x7002490, symbol: D_7002490 } + +D_7002730: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x07002730, symbol: D_7002730 } + +D_7002930: + { type: GFX, offset: 0x7002930, symbol: D_7002930 } + +D_7002C88: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x7002C88, symbol: D_7002C88 } + +D_7003488: + { type: TEXTURE, ctype: u8, format: CI8, width: 32, height: 32, offset: 0x07003488, symbol: D_7003488, tlut: 0x07003888 } + +D_7003888: + { type: TEXTURE, ctype: u16, format: TLUT, colors: 256, offset: 0x07003888, symbol: D_7003888, pad: 8 } + +D_7003A90: + { type: GFX, offset: 0x7003A90, symbol: D_7003A90 } + +D_7003C50: + { type: GFX, offset: 0x7003C50, symbol: D_7003C50 } + +D_7003E30: + { type: GFX, offset: 0x7003E30, symbol: D_7003E30 } + +PAD_7003FB8: + { type: BLOB, size: 8, offset: 0x7003FB8, symbol: PAD_7003FB8 } + +D_7003FC0: + { type: GFX, offset: 0x7003FC0, symbol: D_7003FC0 } + +D_7004170: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x07004170, symbol: D_7004170 } + +D_7004370: + { type: GFX, offset: 0x7004370, symbol: D_7004370 } + +D_7004560: + { type: GFX, offset: 0x7004560, symbol: D_7004560 } + +PAD_7004778: + { type: BLOB, size: 8, offset: 0x7004778, symbol: PAD_7004778 } + +D_7004780: + { type: GFX, offset: 0x7004780, symbol: D_7004780 } + +D_70049A0: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x070049A0, symbol: D_70049A0 } + +D_7004BA0: + { type: GFX, offset: 0x7004BA0, symbol: D_7004BA0 } + +D_7004E78: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x07004E78, symbol: D_7004E78 } + +D_7005078: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x07005078, symbol: D_7005078, pad: 8 } + +D_7005280: + { type: GFX, offset: 0x7005280, symbol: D_7005280 } + +PAD_7005418: + { type: BLOB, size: 8, offset: 0x7005418, symbol: PAD_7005418 } + +D_7005420: + { type: GFX, offset: 0x7005420, symbol: D_7005420 } + +PAD_7005648: + { type: BLOB, size: 8, offset: 0x7005648, symbol: PAD_7005648 } + +D_70067C4: + { type: SF64:ANIM, offset: 0x70067C4, symbol: D_70067C4 } + +BLOB_70067D0: + { type: BLOB, size: 0x200, offset: 0x70067D0, symbol: BLOB_70067D0 } + +D_7006F74: + { type: SF64:ANIM, offset: 0x7006F74, symbol: D_7006F74 } + +D_7007130: + { type: SF64:ANIM, offset: 0x7007130, symbol: D_7007130 } + +PAD_700713C: + { type: BLOB, size: 4, offset: 0x700713C, symbol: PAD_700713C } + +D_7007234: + { type: SF64:ANIM, offset: 0x7007234, symbol: D_7007234 } + +D_700733C: + { type: SF64:ANIM, offset: 0x700733C, symbol: D_700733C } + +PAD_7007348: + { type: BLOB, size: 8, offset: 0x7007348, symbol: PAD_7007348 } + +D_7007350: + { type: GFX, offset: 0x7007350, symbol: D_7007350 } + +D_7007AB0: + { type: TEXTURE, ctype: u8, format: CI8, width: 32, height: 32, offset: 0x7007AB0, symbol: D_7007AB0, tlut: 0x07007EB0 } + +D_7007EB0: + { type: TEXTURE, ctype: u16, format: TLUT, colors: 240, offset: 0x07007EB0, symbol: D_7007EB0 } + +D_7008090: + { type: TEXTURE, ctype: u8, format: CI8, width: 32, height: 32, offset: 0x07008090, symbol: D_7008090, tlut: 0x07008490 } + +D_7008490: + { type: TEXTURE, ctype: u16, format: TLUT, colors: 242, offset: 0x07008490, symbol: D_7008490 } + +BLOB_7008674: + { type: BLOB, size: 0x2BC, offset: 0x7008674, symbol: BLOB_7008674 } + +D_7008930: + { type: GFX, offset: 0x7008930, symbol: D_7008930 } + +D_7008D10: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x7008D10, symbol: D_7008D10 } + +D_7008F10: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x7008F10, symbol: D_7008F10 } + +D_7009110: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x07009110, symbol: D_7009110 } + +D_7009310: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x07009310, symbol: D_7009310 } + +D_7009510: + { type: GFX, offset: 0x7009510, symbol: D_7009510 } + +D_70096D8: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x070096D8, symbol: D_70096D8, pad: 8 } + +D_70098E0: + { type: GFX, offset: 0x70098E0, symbol: D_70098E0 } + +D_7009B58: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x07009B58, symbol: D_7009B58, pad: 8 } + +D_7009D60: + { type: GFX, offset: 0x7009D60, symbol: D_7009D60 } + +D_700A190: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x0700A190, symbol: D_700A190 } + +D_700A990: + { type: GFX, offset: 0x700A990, symbol: D_700A990 } + +D_700AAD8: + { type: TEXTURE, ctype: u8, format: CI4, width: 16, height: 16, offset: 0x700AAD8, symbol: D_700AAD8, tlut: 0x700AB58 } + +D_700AB58: + { type: TEXTURE, ctype: u16, format: TLUT, colors: 8, offset: 0x700AB58, symbol: D_700AB58, pad: 8 } + +D_700AB70: + { type: GFX, offset: 0x700AB70, symbol: D_700AB70 } + +D_700AEA8: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 8, height: 8, offset: 0x0700AEA8, symbol: D_700AEA8, pad: 8 } + +D_700AF30: + { type: GFX, offset: 0x700AF30, symbol: D_700AF30 } + +D_700B5B8: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x0700B5B8, symbol: D_700B5B8 } + +D_700B7B8: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x0700B7B8, symbol: D_700B7B8, pad: 8 } + +D_700B9C0: + { type: GFX, offset: 0x700B9C0, symbol: D_700B9C0 } + +D_700BB10: + { type: GFX, offset: 0x700BB10, symbol: D_700BB10 } + +PAD_700BDF8: + { type: BLOB, size: 8, offset: 0x700BDF8, symbol: PAD_700BDF8 } + +D_700BE00: + { type: GFX, offset: 0x700BE00, symbol: D_700BE00 } + +D_700BFB0: + { type: TEXTURE, ctype: u8, format: CI8, width: 32, height: 32, offset: 0x0700BFB0, symbol: D_700BFB0, tlut: 0x0700C3B0 } + +D_700C3B0: + { type: TEXTURE, ctype: u16, format: TLUT, colors: 128, offset: 0x0700C3B0, symbol: D_700C3B0 } + +D_700C4B0: + { type: GFX, offset: 0x700C4B0, symbol: D_700C4B0 } + +PAD_700C888: + { type: BLOB, size: 8, offset: 0x700C888, symbol: PAD_700C888 } + +D_700C8D8: + { type: SF64:ANIM, offset: 0x700C8D8, symbol: D_700C8D8 } + +BLOB_700C8E4: + { type: BLOB, size: 0x9C, offset: 0x700C8E4, symbol: BLOB_700C8E4 } + +D_700C980: + { type: GFX, offset: 0x700C980, symbol: D_700C980 } + +BLOB_700CA58: + { type: BLOB, size: 0x118, offset: 0x700CA58, symbol: BLOB_700CA58 } + +D_700D534: + { type: SF64:ANIM, offset: 0x700D534, symbol: D_700D534 } + +BLOB_700D540: + { type: BLOB, size: 0x200, offset: 0x700D540, symbol: BLOB_700D540 } + +D_700D740: + { type: GFX, offset: 0x700D740, symbol: D_700D740 } + +PAD_700D878: + { type: BLOB, size: 0x8, offset: 0x700D878, symbol: PAD_700D878 } + +D_700D880: + { type: GFX, offset: 0x700D880, symbol: D_700D880 } + +PAD_700D9A8: + { type: BLOB, size: 0x8, offset: 0x700D9A8, symbol: PAD_700D9A8 } + +D_700D9B0: + { type: GFX, offset: 0x700D9B0, symbol: D_700D9B0 } + +PAD_700DAC8: + { type: BLOB, size: 0x8, offset: 0x700DAC8, symbol: PAD_700DAC8 } + +D_700DAD0: + { type: GFX, offset: 0x700DAD0, symbol: D_700DAD0 } + +PAD_700DBA8: + { type: BLOB, size: 0x8, offset: 0x700DBA8, symbol: PAD_700DBA8 } + +D_700DBB0: + { type: GFX, offset: 0x700DBB0, symbol: D_700DBB0 } + +D_700DC50: + { type: GFX, offset: 0x700DC50, symbol: D_700DC50 } + +D_700DD68: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 8, height: 8, offset: 0x0700DD68, symbol: D_700DD68 } + +PAD_700DDE8: + { type: BLOB, size: 0x8, offset: 0x700DDE8, symbol: PAD_700DDE8 } + +D_700DDF0: + { type: GFX, offset: 0x700DDF0, symbol: D_700DDF0 } + +PAD_700DEC8: + { type: BLOB, size: 0x8, offset: 0x700DEC8, symbol: PAD_700DEC8 } + +D_700DED0: + { type: GFX, offset: 0x700DED0, symbol: D_700DED0 } + +D_700DF70: + { type: GFX, offset: 0x700DF70, symbol: D_700DF70 } + +PAD_700E028: + { type: BLOB, size: 0x8, offset: 0x700E028, symbol: PAD_700E028 } + +D_700E030: + { type: GFX, offset: 0x700E030, symbol: D_700E030 } + +D_700E1E8: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x0700E1E8, symbol: D_700E1E8, pad: 8 } + +D_700E3F0: + { type: GFX, offset: 0x700E3F0, symbol: D_700E3F0 } + +D_700E858: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x0700E858, symbol: D_700E858, pad: 8 } + +D_700EA60: + { type: GFX, offset: 0x700EA60, symbol: D_700EA60 } + +# size = 0xEDB0 \ No newline at end of file diff --git a/include/assets.h b/include/assets.h index bf813283..8455bb80 100644 --- a/include/assets.h +++ b/include/assets.h @@ -911,31 +911,30 @@ extern u8 D_7000F10[]; // fox_option extern u8 D_7001030[]; // fox_option extern u8 D_7001270[]; // fox_option extern Gfx D_7001540[]; // fox_bg -extern u8 D_7001DF0[]; -extern u8 D_7002110[]; -extern u8 D_7003650[]; -extern Gfx D_7003830[]; -extern u8 D_7003C70[]; -extern u8 D_7003E10[]; -extern u8 D_7003F10[]; -extern u8 D_7004010[]; -extern u8 D_7004050[]; -extern u16 D_7004150[]; -extern u8 D_70041F0[]; -extern u16 D_70042F0[]; -extern u8 D_7004360[]; -extern u16 D_7004460[]; -extern u8 D_70044D0[]; -extern u16 D_7004990[]; -extern Gfx D_7007350[]; -extern Gfx D_700AB70[]; -extern Gfx D_700BB10[]; -extern Gfx D_700BE00[]; -extern Animation D_700CAF4; -extern u16 D_700E9A0[]; -extern u8 D_70118E0[]; -extern u16 D_70123F8[]; -extern u16 D_70123F8[]; +extern u8 D_7001DF0[]; // fox_option +extern u8 D_7002110[]; // fox_option +extern u8 D_7003650[]; // fox_option +extern Gfx D_7003830[]; // fox_versus +extern u8 D_7003C70[]; // fox_versus +extern u8 D_7003E10[]; // fox_versus +extern u8 D_7003F10[]; // fox_versus +extern u8 D_7004010[]; // fox_option +extern u8 D_7004050[]; // fox_versus +extern u16 D_7004150[]; // fox_versus +extern u8 D_70041F0[]; // fox_versus +extern u16 D_70042F0[]; // fox_versus +extern u8 D_7004360[]; // fox_versus +extern u16 D_7004460[]; // fox_versus +extern u8 D_70044D0[]; // fox_versus +extern u16 D_7004990[]; // fox_versus +extern Gfx D_7007350[]; // fox_edisplay +extern Gfx D_700AB70[]; // fox_edata_1C +extern Gfx D_700BB10[]; // fox_edisplay +extern Gfx D_700BE00[]; // fox_edata_1C +extern Animation D_700CAF4; // fox_enmy2 +extern u16 D_700E9A0[]; // fox_option +extern u8 D_70118E0[]; // fox_versus, fox_option +extern u16 D_70123F8[]; // fox_versus, fox_option // ast_8_ti, ast_option extern u8 D_8000000[]; // option diff --git a/include/assets/ast_7_ti_1.h b/include/assets/ast_7_ti_1.h deleted file mode 100644 index 9fc9d9bc..00000000 --- a/include/assets/ast_7_ti_1.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef AST_7_TI_1_H -#define AST_7_TI_1_H - -#include "gfx.h" -#include "sf64object.h" -#include "structs.h" - -#endif diff --git a/linker_scripts/us/undefined_syms.ld b/linker_scripts/us/undefined_syms.ld index c44a7939..fe0d2589 100644 --- a/linker_scripts/us/undefined_syms.ld +++ b/linker_scripts/us/undefined_syms.ld @@ -2145,7 +2145,7 @@ D_7003650 = 0x7003650; D_7003830 = 0x7003830; D_7003C70 = 0x7003C70; D_7003E10 = 0x7003E10; -D_7003EE8 = 0x7003EE8; +D_07003EE8 = 0x7003EE8; D_7003F10 = 0x7003F10; D_7004010 = 0x7004010; D_7004050 = 0x7004050; diff --git a/src/overlays/ovl_i5/fox_ti.c b/src/overlays/ovl_i5/fox_ti.c index e37632f5..ee93dc99 100644 --- a/src/overlays/ovl_i5/fox_ti.c +++ b/src/overlays/ovl_i5/fox_ti.c @@ -1,31 +1,19 @@ #include "global.h" +#include "assets/ast_bg_planet.h" +#include "assets/ast_7_ti_1.h" -extern f32 D_6006924[]; -extern Gfx D_3007E70[]; -extern Animation D_700C8D8; -extern Limb* D_700C964[]; -extern Gfx D_700B9C0[]; -extern Gfx D_700C4B0[]; -extern Gfx D_700C980[]; -extern Gfx D_700E3F0[]; -extern Animation D_700D534; -extern Limb* D_700D700[]; -extern Gfx D_7009D60[]; -extern Gfx D_700A990[]; -extern Gfx D_7002490[]; +extern Animation D_7003EE8; +extern Gfx D_7005300[]; extern Limb* D_7006990[]; -extern Animation D_70067C4; -extern Animation D_7006F74; -extern Animation D_7007130; -extern Animation D_7007234; -extern Animation D_700733C; -extern Gfx D_70098E0[]; -extern Gfx D_7008930[]; -extern Gfx D_7009510[]; +extern Animation D_70084CC; +extern Animation D_70096EC; +extern Limb* D_700C964[]; +extern Limb* D_700D700[]; +extern Animation D_700E244; +extern Gfx D_3007E70[]; +extern f32 D_6006924[]; extern f32 D_6006C0C[]; extern f32 D_6006C28[]; -extern Gfx D_7000A80[]; -extern Gfx D_7002270[]; extern s32 D_8000FC0[]; extern Animation D_8000708; extern Animation D_8000D80; @@ -34,16 +22,10 @@ extern Animation D_A00047C; extern Animation D_A000858; extern Animation D_A000934; extern Animation D_A000D50; -extern Animation D_7003EE8; -extern Animation D_70084CC; -extern Animation D_70096EC; -extern Gfx D_7009A80[]; -extern Animation D_700E244; extern Animation D_8008FE8; extern Animation D_9004288; extern Animation D_900FC4C; extern Animation D_A009990; -extern Gfx D_7005300[]; extern Gfx D_8000D90[]; extern Limb* D_A000568[]; extern Limb* D_A000EDC[]; @@ -67,8 +49,6 @@ UnkStruct_i5_801BD738 D_i5_801BD738[3][9]; PosRot D_i5_801BDA30[10]; f32 D_i5_801BDB20[3][151]; -#include "assets/ast_bg_planet.h" - static f32 D_i5_801B7360[25][4] = { { 165.0f, 120.0f, 0.0f, 90.0f }, { 127.5f, 7.5f, 0.0f, 90.0f }, { 7.5f, -112.5f, 0.0f, 90.0f }, { 255.0f, 285.0f, -60.0f, 60.0f }, { 255.0f, 285.0f, 60.0f, 60.0f }, { 247.5f, 120.0f, -90.0f, 75.0f }, @@ -109,7 +89,6 @@ void func_i5_80188F60(Effect* effect) { } void func_i5_80188FA8(Effect* effect) { - Matrix_Scale(gGfxMatrix, effect->scale2 * 0.5f, effect->scale2, effect->scale2, 1); Matrix_RotateX(gGfxMatrix, -(M_DTOR * 90), 1); Matrix_SetGfxMtx(&gMasterDisp); @@ -175,6 +154,7 @@ void func_i5_801891F4(Actor* actor) { if ((var_fv1 < 315.0f) && (var_fv1 > 180.0f)) { var_fv1 = 315.0f; } + Math_SmoothStepToAngle(&actor->obj.rot.y, var_fv1, 0.2f, 6.0f, 0.01f); temp_fs0 = (actor->obj.pos.x + actor->fwork[0]) - gPlayer[0].pos.x; temp2 = (actor->obj.pos.y + actor->fwork[1]) - (gPlayer[0].pos.y + 30.0f); @@ -196,29 +176,39 @@ void func_i5_80189380(Actor* actor) { sp50.x = actor->fwork[0]; sp50.y = actor->fwork[1]; sp50.z = actor->fwork[2]; + sp44.x = gPlayer[0].pos.x - actor->obj.pos.x; sp44.y = gPlayer[0].pos.y - actor->obj.pos.y; sp44.z = gPlayer[0].pos.z - actor->obj.pos.z; + Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, 1); Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, 1); + Matrix_MultVec3f(gCalcMatrix, &sp44, &sp8C); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_MultVec3f(gCalcMatrix, &sp50, &sp8C); + sp80.x = actor->obj.pos.x + sp8C.x; sp80.y = actor->obj.pos.y + sp8C.y; sp80.z = actor->obj.pos.z + sp8C.z; + sp74.x = actor->fwork[5]; sp74.y = actor->obj.rot.y; sp74.z = 0.0f; + sp68.x = actor->obj.rot.x; sp68.y = actor->obj.rot.y; sp68.z = actor->obj.rot.z; + sp5C.x = 0.0f; sp5C.y = 0.0f; sp5C.z = 70.0f; + func_8007EE68(0x161, &sp80, &sp74, &sp68, &sp5C, 1.0f); sp80.y += 20.0f; func_8007EE68(0x161, &sp80, &sp74, &sp68, &sp5C, 1.0f); @@ -235,6 +225,7 @@ void func_i5_801895B8(Actor* actor) { f32 sp3C; actor->iwork[2]++; + switch (actor->state) { case 0: AUDIO_PLAY_SFX(0x31000017, actor->sfxSource, 4); @@ -250,6 +241,7 @@ void func_i5_801895B8(Actor* actor) { actor->timer_0BC = 30; } break; + case 2: if (actor->iwork[0] == 1) { actor->fwork[7] = 5.0f; @@ -267,6 +259,7 @@ void func_i5_801895B8(Actor* actor) { } break; } + func_i5_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_80177D20, &sp44, &sp3C, &sp40); actor->obj.pos.y = sp3C; @@ -283,8 +276,10 @@ void func_i5_801895B8(Actor* actor) { if (sp40 * M_RTOD < actor->obj.rot.z) { actor->obj.rot.z -= 2.0f; } + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); Matrix_Push(&gCalcMatrix); + if (!(actor->iwork[2] & 1) && ((actor->obj.pos.z + D_80177D20) > -3800.0f)) { Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); @@ -295,15 +290,20 @@ void func_i5_801895B8(Actor* actor) { func_i5_80189120(actor->obj.pos.x + sp48.x, actor->obj.pos.y + sp48.y, actor->obj.pos.z + sp48.z, actor->obj.pos.y, 1.3f); } + Math_SmoothStepToF(&actor->fwork[6], actor->fwork[7], 0.1f, 2.0f, 0.00001f); Matrix_Pop(&gCalcMatrix); + sp54.x = 0.0f; sp54.y = 0.0f; sp54.z = actor->fwork[6]; + Matrix_MultVec3f(gCalcMatrix, &sp54, &sp48); + actor->vel.x = sp48.x; actor->vel.y = sp48.y; actor->vel.z = sp48.z; + if (actor->unk_0D0 > 0) { if (Rand_ZeroOne() <= 0.25f) { actor->unk_044 = 2; @@ -321,7 +321,6 @@ void func_i5_801895B8(Actor* actor) { } void func_i5_80189AFC(Actor* actor) { - Animation_GetFrameData(&D_700C8D8, 0, actor->vwork); actor->vwork[3].z = actor->fwork[5] + 270.0f; Animation_DrawSkeleton(1, D_700C964, actor->vwork, NULL, func_i5_801891B4, actor, &gIdentityMatrix); @@ -369,6 +368,7 @@ void func_i5_80189CC8(Actor* actor) { func_8007D0E0(actor->fwork[0], actor->fwork[1], actor->fwork[2], 2.0f); } } + if (actor->timer_0BC >= 15) { sp4C.x = gPlayer[0].pos.x - actor->obj.pos.x; sp4C.y = (gPlayer[0].pos.y + 30.0f) - actor->obj.pos.y; @@ -400,10 +400,13 @@ void func_i5_80189CC8(Actor* actor) { actor->fwork[3] = 315.0f; } } + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_MultVec3f(gCalcMatrix, &D_i5_801B7550, &sp64); + sp40.x = actor->fwork[3]; sp40.y = actor->fwork[4]; sp40.z = 0.0f; @@ -435,16 +438,7 @@ void func_i5_8018A1C0(Actor* actor) { } static f32 D_i5_801B7568[7] = { 1.0f, 0.0f, 25.0f, 0.0f, 12.0f, 0.0f, 12.0f }; -extern Gfx D_700DDF0[]; -extern Gfx D_700D9B0[]; -extern Gfx D_700DF70[]; -extern Gfx D_700DC50[]; -extern Gfx D_700DED0[]; -extern Gfx D_700DAD0[]; -extern Gfx D_700DBB0[]; -extern Gfx D_700E030[]; -extern Gfx D_700D880[]; -extern Gfx D_700D740[]; + Gfx* D_i5_801B7584[10] = { D_700DDF0, D_700D9B0, D_700DF70, D_700DC50, D_700DED0, D_700DAD0, D_700DBB0, D_700E030, D_700D880, D_700D740, }; @@ -497,9 +491,11 @@ void func_i5_8018A544(Actor* actor) { s32 var_v0; actor->unk_0C9 = 1; + if ((actor->scale != 1.0f) && (actor->unk_0D0 == 3)) { Object_Kill(&actor->obj, actor->sfxSource); } + if (actor->unk_0D0 != 0) { actor->unk_0D0 = 0; actor->timer_0C6 = 15; @@ -530,6 +526,7 @@ void func_i5_8018A544(Actor* actor) { } } } + if (actor->unk_046 == 2) { actor->gravity = 0.0f; func_i5_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_80177D20, &sp4C, &sp44, &sp48); @@ -538,12 +535,14 @@ void func_i5_8018A544(Actor* actor) { actor->fwork[2] = sp48; return; } + actor->gravity = 3.0f; func_i5_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_80177D20, &sp4C, &sp44, &sp48); actor->fwork[0] = sp4C; actor->fwork[1] = sp44; actor->fwork[2] = sp48; temp_fv1 = (actor->scale * 50.0f); + if (actor->obj.pos.y > sp44 + temp_fv1) { actor->unk_046 = 0; } else { @@ -575,6 +574,7 @@ void func_i5_8018A544(Actor* actor) { } temp_fv1 = actor->scale * 314.0f; + if (actor->vel.x != 0.0f) { var_v0 = SIGN_OF(actor->vel.x); @@ -584,7 +584,9 @@ void func_i5_8018A544(Actor* actor) { actor->obj.rot.x += ((sqrtf(SQ(actor->vel.x) + SQ(actor->vel.z)) * 360.0f) / temp_fv1) * (f32) var_v0; } + actor->obj.rot.y = Math_RadToDeg(Math_Atan2F(actor->vel.x, actor->vel.z)); + if (actor->obj.rot.y >= 180.0f) { actor->obj.rot.y -= 180.0f; } @@ -620,6 +622,7 @@ void func_i5_8018AB44(Actor* actor) { actor->state++; } break; + case 1: break; } @@ -628,6 +631,7 @@ void func_i5_8018AB44(Actor* actor) { case 1: AUDIO_PLAY_SFX(0x29022086, actor->sfxSource, 4); break; + case 2: actor->unk_044 = 0; func_80066254(actor); @@ -636,6 +640,7 @@ void func_i5_8018AB44(Actor* actor) { func_8007A6F0(&actor->obj.pos, 0x2903B009); Object_Kill(&actor->obj, actor->sfxSource); break; + case 3: func_8007A6F0(&actor->obj.pos, 0x2903B009); func_8007D2C8(actor->obj.pos.x, actor->obj.pos.y + 50.0f, actor->obj.pos.z, (10.0f / 3.0f)); @@ -666,15 +671,22 @@ void func_i5_8018ADC4(Actor* actor) { actor->fwork[0] = actor->obj.rot.z; actor->fwork[1] = actor->obj.rot.x; + actor->obj.rot.z = 0.0f; actor->obj.rot.x = 0.0f; + func_i5_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_80177D20, &sp54, &sp58, &sp54); + actor->obj.pos.y = sp58; + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i5_801B75AC, &sp68[0]); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i5_801B75B8, &sp68[1]); + k = 0; actorPtr = gActors; + for (i = 0; i < 60; i++, actorPtr++) { if (actorPtr->obj.status == OBJ_FREE) { Actor_Initialize(actorPtr); @@ -689,7 +701,7 @@ void func_i5_8018ADC4(Actor* actor) { Object_SetInfo(&actorPtr->info, actorPtr->obj.id); actor->iwork[k] = (uintptr_t) actorPtr; k++; - if ((k >= 2)) { + if (k >= 2) { break; } } @@ -720,8 +732,9 @@ bool func_i5_8018AFF0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* gSPDisplayList(gMasterDisp++, *dList); RCP_SetupDL(&gMasterDisp, 0x1D); return true; + } else { + return false; } - return false; } static Vec3f D_i5_801B75C4 = { 110.0f, 0.0f, 0.0f }; @@ -759,13 +772,10 @@ void func_i5_8018B1B4(s32 limbIndex, Vec3f* rot, void* data) { } void func_i5_8018B268(Actor* actor) { - Vec3f sp4C; - Vec3f sp40; - Actor* sp3C; - Actor* sp38; - - sp3C = actor->iwork[0]; - sp38 = actor->iwork[1]; + Vec3f src; + Vec3f dest; + Actor* sp3C = actor->iwork[0]; + Actor* sp38 = actor->iwork[1]; if (actor->unk_0D0 > 0) { actor->unk_0D0 = 0; @@ -786,6 +796,7 @@ void func_i5_8018B268(Actor* actor) { actor->state++; } break; + case 1: Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); if ((actor->unk_0B6 >= 26) && (actor->unk_0B6 <= 53) && (sp3C != NULL)) { @@ -795,25 +806,26 @@ void func_i5_8018B268(Actor* actor) { sp3C->vel.y = 0.0f; sp3C->vel.z = 0.0f; } else if (actor->unk_0B6 == 53) { - sp4C.x = 0.0f; - sp4C.y = actor->fwork[1]; - sp4C.z = 20.0f; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp4C, &sp40); - sp3C->vel.x = sp40.x; - sp3C->vel.y = sp40.y; - sp3C->vel.z = sp40.z; + src.x = 0.0f; + src.y = actor->fwork[1]; + src.z = 20.0f; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + sp3C->vel.x = dest.x; + sp3C->vel.y = dest.y; + sp3C->vel.z = dest.z; sp3C->unk_046 = 0; sp3C->iwork[0] = (uintptr_t) NULL; actor->iwork[0] = (uintptr_t) NULL; } - sp4C.x = actor->fwork[3]; - sp4C.y = actor->fwork[4] + 50.0f; - sp4C.z = actor->fwork[5]; - Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); - sp3C->obj.pos.x = actor->obj.pos.x + sp40.x; - sp3C->obj.pos.y = actor->obj.pos.y + sp40.y; - sp3C->obj.pos.z = actor->obj.pos.z + sp40.z; + src.x = actor->fwork[3]; + src.y = actor->fwork[4] + 50.0f; + src.z = actor->fwork[5]; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + sp3C->obj.pos.x = actor->obj.pos.x + dest.x; + sp3C->obj.pos.y = actor->obj.pos.y + dest.y; + sp3C->obj.pos.z = actor->obj.pos.z + dest.z; } + if ((actor->unk_0B6 >= 26) && (actor->unk_0B6 <= 57) && (sp38 != NULL)) { if (actor->unk_0B6 == 26) { sp38->unk_046 = 2; @@ -822,33 +834,35 @@ void func_i5_8018B268(Actor* actor) { sp38->vel.z = 0.0f; } else if (actor->unk_0B6 == 57) { AUDIO_PLAY_SFX(0x29000028, actor->sfxSource, 4); - sp4C.x = 0.0f; - sp4C.y = actor->fwork[1]; - sp4C.z = 20.0f; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp4C, &sp40); - sp38->vel.x = sp40.x; - sp38->vel.y = sp40.y; - sp38->vel.z = sp40.z; + src.x = 0.0f; + src.y = actor->fwork[1]; + src.z = 20.0f; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + sp38->vel.x = dest.x; + sp38->vel.y = dest.y; + sp38->vel.z = dest.z; sp38->unk_046 = 0; sp38->iwork[0] = (uintptr_t) NULL; actor->iwork[1] = (uintptr_t) NULL; } - sp4C.x = actor->fwork[6]; - sp4C.y = actor->fwork[7] + 50.0f; - sp4C.z = actor->fwork[8]; - Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); - sp38->obj.pos.x = actor->obj.pos.x + sp40.x; - sp38->obj.pos.y = actor->obj.pos.y + sp40.y; - sp38->obj.pos.z = actor->obj.pos.z + sp40.z; + src.x = actor->fwork[6]; + src.y = actor->fwork[7] + 50.0f; + src.z = actor->fwork[8]; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + sp38->obj.pos.x = actor->obj.pos.x + dest.x; + sp38->obj.pos.y = actor->obj.pos.y + dest.y; + sp38->obj.pos.z = actor->obj.pos.z + dest.z; } if (++actor->unk_0B6 >= Animation_GetFrameCount(&D_700D534)) { actor->state++; } break; + case 2: break; } + if (actor->health == 0) { actor->obj.status = OBJ_DYING; Animation_GetFrameData(&D_700D534, actor->unk_0B6, actor->vwork); @@ -871,7 +885,9 @@ void func_i5_8018B720(Actor* actor) { Vec3f sp70; Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + var_s1 = SEGMENTED_TO_VIRTUAL(D_i5_801BDA30); + for (i = 0; i < 10; i++, var_s1++) { actorPtr = func_800A3608(OBJ_ACTOR_189); if (actorPtr != NULL) { @@ -894,12 +910,14 @@ void func_i5_8018B720(Actor* actor) { actorPtr->fwork[2] = RAND_FLOAT(4.0f) - 6.0f; } } + actorPtr = actor->iwork[0]; if (actorPtr != NULL) { actorPtr->iwork[0] = (uintptr_t) NULL; actor->iwork[0] = (uintptr_t) NULL; actorPtr->unk_046 = 0; } + actorPtr = actor->iwork[1]; if (actorPtr != NULL) { actorPtr->unk_046 = 0; @@ -931,15 +949,18 @@ void func_i5_8018B9D0(Actor* actor) { // FAKE var_v1 = actor->state; actor->unk_0C9 = 1; + switch (var_v1) { case 0: sp44 = gPlayer[0].pos.x - actor->obj.pos.x; sp40 = gPlayer[0].pos.y - actor->obj.pos.y; sp3C = gPlayer[0].pos.z - actor->obj.pos.z; + if (actor->timer_0BE == 7) { actor->iwork[0] = 2; AUDIO_PLAY_SFX(0x19000032, actor->sfxSource, 0); } + if (actor->timer_0BE == 0) { temp_fa1 = SQ(sp44) + SQ(sp40) + SQ(sp3C); if (temp_fa1 < 27639.062f) { @@ -957,6 +978,7 @@ void func_i5_8018B9D0(Actor* actor) { } } } + if (actor->timer_0BE == 1) { func_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); Object_Kill(&actor->obj, actor->sfxSource); @@ -971,6 +993,7 @@ void func_i5_8018B9D0(Actor* actor) { } } break; + case 1: func_i5_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_80177D20, &sp4C, &sp50, &sp48); actor->fwork[0] = sp50; @@ -994,13 +1017,16 @@ void func_i5_8018B9D0(Actor* actor) { } actor->obj.rot.z = (-var_fa0 / 130.0f) * 90.0f; + if (fabsf(actor->vel.z) > 130.0f) { var_v1 = (actor->vel.z > 0.0f) ? 1 : (actor->vel.z == 0.0f) ? 0 : -1; var_fa0 = var_v1 * 130.0f; } else { var_fa0 = actor->vel.z; } + actor->obj.rot.x = (var_fa0 / 130.0f) * 90.0f; + if (actor->unk_0D0 == 1) { AUDIO_PLAY_SFX(0x19020008, actor->sfxSource, 4); sp44 = actor->obj.pos.x - actor->unk_0D8.x; @@ -1023,16 +1049,6 @@ static s32 D_i5_801B75E4[3][3] = { { 0, 0, 0 }, }; -extern Gfx D_7005280[]; -extern Gfx D_7003C50[]; -extern Gfx D_7003E30[]; -extern Gfx D_7004370[]; -extern Gfx D_7004560[]; -extern Gfx D_7003A90[]; -extern Gfx D_7005420[]; -extern Gfx D_7003FC0[]; -extern Gfx D_7002930[]; - Gfx* D_i5_801B7608[10] = { D_7005280, D_7003C50, D_7003E30, D_7004370, D_7004560, D_7003A90, D_7005420, D_7003FC0, D_7002930, D_7002490, }; @@ -1064,6 +1080,7 @@ void func_i5_8018BFB0(Actor* actor) { break; } } + if (i == 3) { Object_Kill(&actor->obj, actor->sfxSource); return; @@ -1099,6 +1116,7 @@ bool func_i5_8018C134(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* sp50 = actor->iwork[0]; sp58 = false; + for (i = 0; i < 9; i++) { if (limbIndex == D_i5_801B7630[i * 2]) { if (!(D_i5_801BD738[sp50][i].unk_18 & 1)) { @@ -1162,6 +1180,7 @@ void func_i5_8018C3D8(s32 limbIndex, Vec3f* rot, void* data) { } actor->fwork[27] = D_i5_801BD738[actor->iwork[0]][8].unk_00.pos.y; + switch (actor->iwork[2]) { case 0: switch (limbIndex) { @@ -1179,6 +1198,7 @@ void func_i5_8018C3D8(s32 limbIndex, Vec3f* rot, void* data) { break; } break; + case 1: switch (limbIndex) { case 1: @@ -1196,7 +1216,9 @@ void func_i5_8018C3D8(s32 limbIndex, Vec3f* rot, void* data) { } break; } + var_v0_2 = actor->info.hitbox; + if (actor->iwork[8] != 0) { var_v0_2[0] = 25.0f; var_v0_2++; @@ -1335,6 +1357,7 @@ void func_i5_8018C8A8(Actor* actor) { &gIdentityMatrix); actor->state = 1; break; + case 1: func_i5_801B6E20(actor->obj.pos.x, actor->obj.pos.z + gPlayer[0].unk_144, &spA0, &sp9C, &sp98); actor->fwork[0] = sp9C; @@ -1387,6 +1410,7 @@ void func_i5_8018C8A8(Actor* actor) { actor->fwork[7] = sp8C.y; actor->fwork[8] = sp8C.z; break; + case 2: Math_SmoothStepToAngle(&actor->obj.rot.x, actor->unk_0F4.x, 0.5f, 5.0f, 0.01f); Math_SmoothStepToAngle(&actor->obj.rot.z, actor->unk_0F4.z, 0.5f, 5.0f, 0.01f); @@ -1408,6 +1432,7 @@ void func_i5_8018C8A8(Actor* actor) { } Math_SmoothStepToF(&actor->fwork[26], -60.0f, actor->fwork[15], 500.0f, 0.01f); break; + case 3: if (actor->timer_0BC == 0) { actor->state = 4; @@ -1429,6 +1454,7 @@ void func_i5_8018C8A8(Actor* actor) { actor->fwork[15] = 0.0f; } break; + case 4: func_i5_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_80177D20, &spA0, &sp9C, &sp98); actor->fwork[0] = sp9C; @@ -1465,6 +1491,7 @@ void func_i5_8018C8A8(Actor* actor) { AUDIO_PLAY_SFX(0x31030043, actor->sfxSource, 4); } } + Animation_GetFrameData(&D_70067C4, actor->unk_0B6, spA4); Math_SmoothStepToVec3fArray(spA4, actor->vwork, 1, 15, actor->fwork[15], 360.0f, 0.01f); temp_fs0 = actor->vwork[0].y; @@ -1473,6 +1500,7 @@ void func_i5_8018C8A8(Actor* actor) { &gIdentityMatrix); actor->vwork[0].y = temp_fs0; Math_SmoothStepToF(&actor->fwork[26], -60.0f, actor->fwork[15], 500.0f, 0.01f); + if (actor->health <= 0) { actor->iwork[6] = 300; actor->state = 5; @@ -1482,6 +1510,7 @@ void func_i5_8018C8A8(Actor* actor) { AUDIO_PLAY_SFX(0x29030098, actor->sfxSource, 4); } break; + case 5: Math_SmoothStepToF(&actor->fwork[15], 1.0f, 1.0f, 0.015f, 0.01f); Animation_GetFrameData(&D_7007130, actor->unk_0B6, spA4); @@ -1502,6 +1531,7 @@ void func_i5_8018C8A8(Actor* actor) { actor->fwork[15] = 0.0f; } break; + case 6: if (actor->unk_0B6 == 18) { actor->iwork[8] = 0; @@ -1533,6 +1563,7 @@ void func_i5_8018C8A8(Actor* actor) { 0xFF, 8, 0); AUDIO_PLAY_SFX(0x19030003, actor->sfxSource, 4); } + if (!(actor->timer_0BC & 7)) { Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); @@ -1553,10 +1584,12 @@ void func_i5_8018C8A8(Actor* actor) { func_i5_8018C72C(actor); } break; + case 7: Animation_GetFrameData(&D_7006F74, actor->unk_0B6, spA4); Math_SmoothStepToVec3fArray(spA4, actor->vwork, 1, 15, actor->fwork[15], 360.0f, 0.01f); break; + case 8: switch (actor->iwork[7]) { case 1: @@ -1571,6 +1604,7 @@ void func_i5_8018C8A8(Actor* actor) { Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); func_8007D2C8(actor->obj.pos.x, actor->fwork[0x1B] + actor->obj.pos.y, actor->obj.pos.z, 15.0f); var_s1 = D_i5_801BD738[actor->iwork[0]]; + for (i = 0; i < 9; i++, var_s1++) { actorPtr = func_800A3608(0xBD); if ((actorPtr != NULL) && D_i5_801B7630[2 * i + 1] == 1) { @@ -1603,6 +1637,7 @@ void func_i5_8018C8A8(Actor* actor) { } actorPtr->gravity = 0.8f; } + if (i == 8) { actorPtr = func_800A3608(0xBD); if (actorPtr != NULL) { @@ -1629,11 +1664,13 @@ void func_i5_8018C8A8(Actor* actor) { } } break; + case 4: D_80178348 = D_80178350 = D_80178354 = D_80178340 = 255; D_80178358 = 0; D_8017835C = 0x40; break; + case 5: D_i5_801B750C[actor->iwork[0]] = false; Object_Kill(&actor->obj, actor->sfxSource); @@ -1682,8 +1719,10 @@ void func_i5_8018E3CC(Actor* actor) { s32 i; func_i5_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_80177D20, &sp40, &actor->obj.pos.y, &sp40); + actor->obj.pos.y -= 20.0f; actorPtr = gActors; + for (i = 0; i < 60; i++, actorPtr++) { if (actorPtr->obj.status == OBJ_FREE) { Actor_Initialize(actorPtr); @@ -1703,6 +1742,7 @@ void func_i5_8018E3CC(Actor* actor) { break; } } + if (i == 60) { Object_Kill(&actor->obj, actor->sfxSource); } diff --git a/tools/Torch b/tools/Torch index 70800a91..62b52380 160000 --- a/tools/Torch +++ b/tools/Torch @@ -1 +1 @@ -Subproject commit 70800a914487440a7464ab826c4628f920ecc273 +Subproject commit 62b523809e7e7242ad6adc6f9a689a58f8e4bad4 diff --git a/yamls/us/assets.yaml b/yamls/us/assets.yaml index f29e17d2..fc1a9438 100644 --- a/yamls/us/assets.yaml +++ b/yamls/us/assets.yaml @@ -123,8 +123,12 @@ - name: ast_7_ti_1 exclusive_ram_id: segment_07 - type: bin + type: code + dir: assets start: 0xA0E340 + vram: 0x07000000 + subsegments: + - [0xA0E340, .data, ast_7_ti_1/ast_7_ti_1] - name: ast_sector_x exclusive_ram_id: segment_06