diff --git a/src/game/bondbike.c b/src/game/bondbike.c index 1e0ad7651..61808bbd2 100644 --- a/src/game/bondbike.c +++ b/src/game/bondbike.c @@ -43,7 +43,7 @@ u32 var80070ef4 = 0x00000000; void currentPlayerBikeInit(void) { struct hoverbikeobj *hoverbike = (struct hoverbikeobj *)g_Vars.currentplayer->hoverbike->obj; - f32 matrix[16]; + Mtxf matrix; g_Vars.currentplayer->bondmovemode = MOVEMODE_BIKE; g_Vars.currentplayer->bondvehiclemode = 0; @@ -59,10 +59,10 @@ void currentPlayerBikeInit(void) g_Vars.currentplayer->bondenterpos.y = g_Vars.currentplayer->prop->pos.y; g_Vars.currentplayer->bondenterpos.z = g_Vars.currentplayer->prop->pos.z; - func00015d54(hoverbike->base.realrot, matrix); - func00015dd4(&hoverbike->base.prop->pos, matrix); - func00015b68(matrix, &g_Vars.currentplayer->bondvehicleoffset, &g_Vars.currentplayer->bondenteraim); - func00016b58(g_Vars.currentplayer->bondentermtx, + func00015d54(hoverbike->base.realrot, &matrix); + func00015dd4(&hoverbike->base.prop->pos, &matrix); + func00015b68(&matrix, &g_Vars.currentplayer->bondvehicleoffset, &g_Vars.currentplayer->bondenteraim); + func00016b58(&g_Vars.currentplayer->bondentermtx, 0, 0, 0, -g_Vars.currentplayer->bond2.unk1c.x, -g_Vars.currentplayer->bond2.unk1c.y, -g_Vars.currentplayer->bond2.unk1c.z, g_Vars.currentplayer->bond2.unk28.x, g_Vars.currentplayer->bond2.unk28.y, g_Vars.currentplayer->bond2.unk28.z); diff --git a/src/game/bondgrab.c b/src/game/bondgrab.c index 65db5d81b..c87c97046 100644 --- a/src/game/bondgrab.c +++ b/src/game/bondgrab.c @@ -41,7 +41,7 @@ u32 var80070e98 = 0x00000000; void currentPlayerGrabInit(void) { u32 prevmode = g_Vars.currentplayer->bondmovemode; - f32 matrix[16]; + Mtxf matrix; struct prop *prop = g_Vars.currentplayer->grabbedprop; g_Vars.currentplayer->bondmovemode = MOVEMODE_GRAB; @@ -68,8 +68,8 @@ void currentPlayerGrabInit(void) g_Vars.currentplayer->gunextraaimx = 0; g_Vars.currentplayer->gunextraaimy = 0; - func00016374((g_Vars.currentplayer->vv_theta * M_BADTAU) / 360.0f, matrix); - func00015b10(matrix, &g_Vars.currentplayer->grabbedposoffset); + func00016374((g_Vars.currentplayer->vv_theta * M_BADTAU) / 360.0f, &matrix); + func00015b10(&matrix, &g_Vars.currentplayer->grabbedposoffset); g_Vars.currentplayer->bondprevtheta = g_Vars.currentplayer->vv_theta; diff --git a/src/game/bondhead.c b/src/game/bondhead.c index 127c2ccbe..436e6218a 100644 --- a/src/game/bondhead.c +++ b/src/game/bondhead.c @@ -150,7 +150,7 @@ void currentPlayerUpdateHead(f32 arg0, f32 arg1) { struct objticksp476 sp80 = {NULL, 1, 3}; - f32 sp40[16]; + Mtxf sp40; struct coord modelpos = {0, 0, 0}; bool somebool = func0001e2a8(); @@ -160,9 +160,9 @@ void currentPlayerUpdateHead(f32 arg0, f32 arg1) func0001ee18(&g_Vars.currentplayer->model, g_Vars.lvupdate240, true); func0001e29c(somebool); func0001b3bc(&g_Vars.currentplayer->model); - func000159b0(sp40); + func000159b0(&sp40); - sp80.matrix = sp40; + sp80.matrix = &sp40; sp80.model0c = &g_Vars.currentplayer->unk0510; func0001cebc(&sp80, &g_Vars.currentplayer->model); diff --git a/src/game/bondmove.c b/src/game/bondmove.c index f48d51b38..4e3d4159c 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -3041,7 +3041,7 @@ glabel var7f1ad8e4 /* f0cab10: 8e4d0284 */ lw $t5,0x284($s2) .L0f0cab14: /* f0cab14: e5a216f8 */ swc1 $f2,0x16f8($t5) -/* f0cab18: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0cab18: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0cab1c: e7a200ac */ swc1 $f2,0xac($sp) /* f0cab20: 8e4e0284 */ lw $t6,0x284($s2) /* f0cab24: 27b000a0 */ addiu $s0,$sp,0xa0 @@ -4917,7 +4917,7 @@ glabel var7f1ad8e4 // // g_Vars.currentplayer->gunzoomfovs[1] = spac; // -// func00015b68(currentPlayerGetMatrix(), &g_Vars.currentplayer->autoerasertarget->pos, &spa0); +// func00015b68(currentPlayerGetMatrix1740(), &g_Vars.currentplayer->autoerasertarget->pos, &spa0); // // func0f0b4eb8(&spa0, sp98, spac, g_Vars.currentplayer->c_perspaspect); // @@ -5552,11 +5552,11 @@ void func0f0cc19c(struct coord *arg) } } -void func0f0cc3b8(f32 arg0, f32 arg1, f32 arg2, f32 *arg3, f32 arg4) +void func0f0cc3b8(f32 arg0, f32 arg1, f32 arg2, Mtxf *arg3, f32 arg4) { f32 sp244 = 0; - f32 sp180[16]; - f32 sp116[16]; + Mtxf sp180; + Mtxf sp116; f32 sp100[4]; f32 sp84[4]; f32 sp68[4]; @@ -5580,33 +5580,33 @@ void func0f0cc3b8(f32 arg0, f32 arg1, f32 arg2, f32 *arg3, f32 arg4) } currentPlayerUpdateHead(sp244, arg2); - func000162e8(BADDEG2RAD(360 - g_Vars.currentplayer->vv_verta360), sp180); + func000162e8(BADDEG2RAD(360 - g_Vars.currentplayer->vv_verta360), &sp180); if (optionsGetHeadRoll(g_Vars.currentplayerstats->mpindex)) { - func00016d58(sp116, + func00016d58(&sp116, 0, 0, 0, -g_Vars.currentplayer->headlook.x, -g_Vars.currentplayer->headlook.y, -g_Vars.currentplayer->headlook.z, g_Vars.currentplayer->headup.x, g_Vars.currentplayer->headup.y, g_Vars.currentplayer->headup.z); - func000159fc(sp116, sp180); + func000159fc(&sp116, &sp180); } - func00016374(BADDEG2RAD(360 - g_Vars.currentplayer->vv_theta), sp116); - func000159fc(sp116, sp180); + func00016374(BADDEG2RAD(360 - g_Vars.currentplayer->vv_theta), &sp116); + func000159fc(&sp116, &sp180); if (arg3) { - func0f097044(sp180, sp100); + func0f097044(&sp180, sp100); func0f097044(arg3, sp84); func0f0976c0(sp100, sp84); func0f0972b8(sp100, sp84, arg4, sp68); - func0f096ed4(sp68, sp180); + func0f096ed4(sp68, &sp180); } - g_Vars.currentplayer->bond2.unk1c.x = sp180[8]; - g_Vars.currentplayer->bond2.unk1c.y = sp180[9]; - g_Vars.currentplayer->bond2.unk1c.z = sp180[10]; - g_Vars.currentplayer->bond2.unk28.x = sp180[4]; - g_Vars.currentplayer->bond2.unk28.y = sp180[5]; - g_Vars.currentplayer->bond2.unk28.z = sp180[6]; + g_Vars.currentplayer->bond2.unk1c.x = sp180.m[2][0]; + g_Vars.currentplayer->bond2.unk1c.y = sp180.m[2][1]; + g_Vars.currentplayer->bond2.unk1c.z = sp180.m[2][2]; + g_Vars.currentplayer->bond2.unk28.x = sp180.m[1][0]; + g_Vars.currentplayer->bond2.unk28.y = sp180.m[1][1]; + g_Vars.currentplayer->bond2.unk28.z = sp180.m[1][2]; } void func0f0cc654(f32 arg0, f32 arg1, f32 arg2) diff --git a/src/game/bondwalk.c b/src/game/bondwalk.c index 709444ed8..60a152143 100644 --- a/src/game/bondwalk.c +++ b/src/game/bondwalk.c @@ -95,7 +95,7 @@ void currentPlayerWalkInit(void) if (g_Vars.currentplayer->walkinitmove) { struct coord delta; - func00016b58(g_Vars.currentplayer->walkinitmtx, + func00016b58(&g_Vars.currentplayer->walkinitmtx, 0, 0, 0, -g_Vars.currentplayer->bond2.unk1c.x, -g_Vars.currentplayer->bond2.unk1c.y, -g_Vars.currentplayer->bond2.unk1c.z, g_Vars.currentplayer->bond2.unk28.x, g_Vars.currentplayer->bond2.unk28.y, g_Vars.currentplayer->bond2.unk28.z); diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index 609d80b05..ff743d011 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -3026,7 +3026,7 @@ glabel var7f1a879c /* f021700: c7a4013c */ lwc1 $f4,0x13c($sp) /* f021704: e4440034 */ swc1 $f4,0x34($v0) /* f021708: c7a60140 */ lwc1 $f6,0x140($sp) -/* f02170c: 0fc2d5be */ jal currentPlayerGetMatrix +/* f02170c: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f021710: e4460038 */ swc1 $f6,0x38($v0) /* f021714: 00402025 */ or $a0,$v0,$zero /* f021718: 0c0056f8 */ jal func00015be0 @@ -3628,7 +3628,7 @@ glabel var7f1a879c /* f021f78: c7a60074 */ lwc1 $f6,0x74($sp) /* f021f7c: e5a60034 */ swc1 $f6,0x34($t5) /* f021f80: c7aa0078 */ lwc1 $f10,0x78($sp) -/* f021f84: 0fc2d5be */ jal currentPlayerGetMatrix +/* f021f84: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f021f88: e5aa0038 */ swc1 $f10,0x38($t5) /* f021f8c: 00402025 */ or $a0,$v0,$zero /* f021f90: 0c0056f8 */ jal func00015be0 @@ -5349,7 +5349,7 @@ glabel var7f1a87d8 /* f023e20: 46080482 */ mul.s $f18,$f0,$f8 /* f023e24: 0c0059b7 */ jal func000166dc /* f023e28: e7b20198 */ swc1 $f18,0x198($sp) -/* f023e2c: 0fc2d5be */ jal currentPlayerGetMatrix +/* f023e2c: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f023e30: 00000000 */ nop /* f023e34: 00402025 */ or $a0,$v0,$zero /* f023e38: 0c00567f */ jal func000159fc @@ -5419,7 +5419,7 @@ glabel var7f1a87d8 /* f023f2c: 460a0102 */ mul.s $f4,$f0,$f10 /* f023f30: 0c0059b7 */ jal func000166dc /* f023f34: e7a40184 */ swc1 $f4,0x184($sp) -/* f023f38: 0fc2d5be */ jal currentPlayerGetMatrix +/* f023f38: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f023f3c: 00000000 */ nop /* f023f40: 00402025 */ or $a0,$v0,$zero /* f023f44: 0c00567f */ jal func000159fc @@ -5428,12 +5428,12 @@ glabel var7f1a87d8 /* f023f50: 10000008 */ b .L0f023f74 /* f023f54: afaa0210 */ sw $t2,0x210($sp) .L0f023f58: -/* f023f58: 0fc2d5be */ jal currentPlayerGetMatrix +/* f023f58: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f023f5c: 00000000 */ nop /* f023f60: 10000004 */ b .L0f023f74 /* f023f64: afa20210 */ sw $v0,0x210($sp) .L0f023f68: -/* f023f68: 0fc2d5be */ jal currentPlayerGetMatrix +/* f023f68: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f023f6c: 00000000 */ nop /* f023f70: afa20210 */ sw $v0,0x210($sp) .L0f023f74: @@ -6314,7 +6314,7 @@ glabel var7f1a87f8 /* f024cdc: c6280024 */ lwc1 $f8,0x24($s1) /* f024ce0: e7a80090 */ swc1 $f8,0x90($sp) .L0f024ce4: -/* f024ce4: 0fc2d5be */ jal currentPlayerGetMatrix +/* f024ce4: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f024ce8: 00000000 */ nop /* f024cec: 263500ec */ addiu $s5,$s1,0xec /* f024cf0: 02a03025 */ or $a2,$s5,$zero @@ -9550,7 +9550,7 @@ glabel func0f027994 .L0f027cb0: /* f027cb0: 5b000035 */ blezl $t8,.L0f027d88 /* f027cb4: 8fb900b8 */ lw $t9,0xb8($sp) -/* f027cb8: 0fc2d5be */ jal currentPlayerGetMatrix +/* f027cb8: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f027cbc: 00000000 */ nop /* f027cc0: c7a400dc */ lwc1 $f4,0xdc($sp) /* f027cc4: c4460008 */ lwc1 $f6,0x8($v0) diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index 072f35652..6433882aa 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -15580,7 +15580,7 @@ glabel var7f1a90b8 /* f03ffe4: 02602825 */ or $a1,$s3,$zero /* f03ffe8: 0c0056c5 */ jal func00015b14 /* f03ffec: 27a60118 */ addiu $a2,$sp,0x118 -/* f03fff0: 0fc2d5be */ jal currentPlayerGetMatrix +/* f03fff0: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f03fff4: 00000000 */ nop /* f03fff8: 00514826 */ xor $t1,$v0,$s1 /* f03fffc: 0009482b */ sltu $t1,$zero,$t1 @@ -24880,7 +24880,7 @@ bool chrCanSeeTargetWithExtraCheck(struct chrdata *chr) func0f0a0c08(&sp68, &sp56); modelGetRootPosition(model, &sp44); - func00015b64(currentPlayerGetMatrix(), &sp44); + func00015b64(currentPlayerGetMatrix1740(), &sp44); if (func0f06b39c(&sp68, &sp56, &sp44, somefloat)) { return true; diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 91aa27b9c..05e2f9a8a 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -2378,24 +2378,24 @@ bool aiObjectMoveToPad(void) u8 *cmd = g_Vars.ailist + g_Vars.aioffset; struct defaultobj *obj = objFindByTagId(cmd[2]); u16 padnum = cmd[4] | (cmd[3] << 8); - f32 matrix[16]; + Mtxf matrix; struct pad pad; s16 rooms[2]; if (obj && obj->prop) { padUnpack(padnum, PADFIELD_POS | PADFIELD_LOOK | PADFIELD_UP | PADFIELD_ROOM, &pad); - func00016d58(matrix, + func00016d58(&matrix, 0, 0, 0, -pad.look.x, -pad.look.y, -pad.look.z, pad.up.x, pad.up.y, pad.up.z); if (obj->model) { - func00015f04(obj->model->unk14, matrix); + func00015f04(obj->model->unk14, &matrix); } rooms[0] = pad.room; rooms[1] = -1; - func0f06a730(obj, &pad, matrix, rooms, &pad); + func0f06a730(obj, &pad, &matrix, rooms, &pad); } g_Vars.aioffset += 5; diff --git a/src/game/explosion.c b/src/game/explosion.c index a243b8558..3503fee4f 100644 --- a/src/game/explosion.c +++ b/src/game/explosion.c @@ -2813,9 +2813,9 @@ glabel var7f1b55a8 u32 explosionUpdateZ(struct prop *prop) { - f32 *matrix = currentPlayerGetMatrix(); + Mtxf *matrix = currentPlayerGetMatrix1740(); - prop->z = -(matrix[2] * prop->pos.x + matrix[6] * prop->pos.y + matrix[10] * prop->pos.z + matrix[14]); + prop->z = -(matrix->m[0][2] * prop->pos.x + matrix->m[1][2] * prop->pos.y + matrix->m[2][2] * prop->pos.z + matrix->m[3][2]); if (prop->z < 100) { prop->z *= 0.5f; diff --git a/src/game/game_006bd0.c b/src/game/game_006bd0.c index d855cc1ea..bb34c95c6 100644 --- a/src/game/game_006bd0.c +++ b/src/game/game_006bd0.c @@ -618,7 +618,7 @@ glabel func0f006c80 /* f0073c4: afb00040 */ sw $s0,0x40($sp) /* f0073c8: f7b60038 */ sdc1 $f22,0x38($sp) /* f0073cc: afa40150 */ sw $a0,0x150($sp) -/* f0073d0: 0fc59e66 */ jal func0f167998 +/* f0073d0: 0fc59e66 */ jal gfxAllocateMatrix /* f0073d4: afa50154 */ sw $a1,0x154($sp) /* f0073d8: 3c0f8006 */ lui $t7,%hi(var8006164c) /* f0073dc: 3c128006 */ lui $s2,%hi(var80061644) @@ -650,7 +650,7 @@ glabel func0f006c80 /* f007440: 8fa40154 */ lw $a0,0x154($sp) /* f007444: 0c0059b7 */ jal func000166dc /* f007448: 02002825 */ or $a1,$s0,$zero -/* f00744c: 0fc2d5be */ jal currentPlayerGetMatrix +/* f00744c: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f007450: 00000000 */ nop /* f007454: 00402025 */ or $a0,$v0,$zero /* f007458: 0c0056f8 */ jal func00015be0 @@ -3016,7 +3016,7 @@ glabel func0f009818 /* f009820: afb00018 */ sw $s0,0x18($sp) /* f009824: 00808025 */ or $s0,$a0,$zero /* f009828: afa50114 */ sw $a1,0x114($sp) -/* f00982c: 0fc59e66 */ jal func0f167998 +/* f00982c: 0fc59e66 */ jal gfxAllocateMatrix /* f009830: afa60118 */ sw $a2,0x118($sp) /* f009834: 3c0144fa */ lui $at,0x44fa /* f009838: 44812000 */ mtc1 $at,$f4 @@ -3081,7 +3081,7 @@ glabel func0f009818 /* f009924: 27a50088 */ addiu $a1,$sp,0x88 /* f009928: 0c005680 */ jal func00015a00 /* f00992c: 27a600c8 */ addiu $a2,$sp,0xc8 -/* f009930: 0fc2d5be */ jal currentPlayerGetMatrix +/* f009930: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f009934: 00000000 */ nop /* f009938: 00402025 */ or $a0,$v0,$zero /* f00993c: 0c0056f8 */ jal func00015be0 diff --git a/src/game/game_00c490.c b/src/game/game_00c490.c index 7a4515eba..d63058064 100644 --- a/src/game/game_00c490.c +++ b/src/game/game_00c490.c @@ -1370,8 +1370,8 @@ void setupCamera(struct cameraobj *camera, s32 cmdindex) // empty } - func00016d58(camera->camrotm, 0.0f, 0.0f, 0.0f, xdiff, ydiff, zdiff, 0.0f, 1.0f, 0.0f); - func00015f04(obj->model->unk14, camera->camrotm); + func00016d58(&camera->camrotm, 0.0f, 0.0f, 0.0f, xdiff, ydiff, zdiff, 0.0f, 1.0f, 0.0f); + func00015f04(obj->model->unk14, &camera->camrotm); camera->toleft = 0; camera->yleft = *(s32 *)&camera->yleft * M_BADTAU / 65536.0f; @@ -1460,7 +1460,7 @@ void setupSingleMonitor(struct singlemonitorobj *monitor, s32 cmdindex) struct prop *prop; f32 scale; struct coord spa4; - f32 sp64[16]; + Mtxf sp64; f32 sp24[16]; propLoad(modelnum); @@ -1490,8 +1490,8 @@ void setupSingleMonitor(struct singlemonitorobj *monitor, s32 cmdindex) } propReparent(prop, owner->prop); - func000162e8(0.3664608001709f, sp64); - func00015f04(monitor->base.model->unk14 / owner->model->unk14, sp64); + func000162e8(0.3664608001709f, &sp64); + func00015f04(monitor->base.model->unk14 / owner->model->unk14, &sp64); modelGetRootPosition(monitor->base.model, &spa4); spa4.x = -spa4.x; @@ -1499,7 +1499,7 @@ void setupSingleMonitor(struct singlemonitorobj *monitor, s32 cmdindex) spa4.z = -spa4.z; func000166dc(&spa4, sp24); - func00015be4((u32)sp64, (struct model0c *)sp24, (f32 *)&monitor->base.unk48->unk004); + func00015be4(&sp64, (struct model0c *)sp24, (Mtxf *)&monitor->base.unk48->unk004); } } else { setupGenericObject(&monitor->base, cmdindex); @@ -2974,6 +2974,10 @@ void setupParseObjects(s32 stagenum) if (withobjs && (obj->flags2 & diffflag) == 0) { struct escalatorobj *step = (struct escalatorobj *)obj; struct prop *prop; + + // TODO: There is a stack problem here that should be + // resolved. sp1a8 is really an Mtxf which doesn't fit + // in its current location in the stack. f32 sp1a8[12]; f32 sp184[9]; @@ -2990,14 +2994,14 @@ void setupParseObjects(s32 stagenum) if (obj->flags & OBJFLAG_DEACTIVATED) { step->frame = escstepy; escstepy += 40; - func00016374(4.7116389274597f, sp1a8); - func00015da0(sp1a8, sp184); + func00016374(4.7116389274597f, (Mtxf *)sp1a8); + func00015da0((Mtxf *)sp1a8, sp184); func00016110(sp184, obj->realrot); } else { step->frame = escstepx; escstepx += 40; - func00016374(M_BADPI, sp1a8); - func00015da0(sp1a8, sp184); + func00016374(M_BADPI, (Mtxf *)sp1a8); + func00015da0((Mtxf *)sp1a8, sp184); func00016110(sp184, obj->realrot); } } diff --git a/src/game/game_0601b0.c b/src/game/game_0601b0.c index 90632b348..d2ea52e21 100644 --- a/src/game/game_0601b0.c +++ b/src/game/game_0601b0.c @@ -1281,7 +1281,7 @@ glabel var7f1a9eb8 /* f061338: 24010016 */ addiu $at,$zero,0x16 /* f06133c: 1161000f */ beq $t3,$at,.L0f06137c /* f061340: 00000000 */ nop -/* f061344: 0fc2d5be */ jal currentPlayerGetMatrix +/* f061344: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f061348: 00000000 */ nop /* f06134c: 00402025 */ or $a0,$v0,$zero /* f061350: 27a50694 */ addiu $a1,$sp,0x694 diff --git a/src/game/game_097ba0.c b/src/game/game_097ba0.c index f41471839..948516e8c 100644 --- a/src/game/game_097ba0.c +++ b/src/game/game_097ba0.c @@ -10807,7 +10807,7 @@ glabel var7f1ac764 /* f0a05f8: c44606bc */ lwc1 $f6,0x6bc($v0) /* f0a05fc: e7a60098 */ swc1 $f6,0x98($sp) /* f0a0600: c44806c0 */ lwc1 $f8,0x6c0($v0) -/* f0a0604: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0a0604: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0a0608: e7a8009c */ swc1 $f8,0x9c($sp) /* f0a060c: 00402025 */ or $a0,$v0,$zero /* f0a0610: 0c0056d9 */ jal func00015b64 @@ -14279,7 +14279,7 @@ glabel func0f0a37b4 /* f0a3894: e7a40050 */ swc1 $f4,0x50($sp) /* f0a3898: e7a6003c */ swc1 $f6,0x3c($sp) /* f0a389c: e7a80040 */ swc1 $f8,0x40($sp) -/* f0a38a0: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0a38a0: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0a38a4: e7aa0044 */ swc1 $f10,0x44($sp) /* f0a38a8: 00402025 */ or $a0,$v0,$zero /* f0a38ac: 27a5003c */ addiu $a1,$sp,0x3c diff --git a/src/game/game_0abe70.c b/src/game/game_0abe70.c index ef4f04bb2..48cf4d952 100644 --- a/src/game/game_0abe70.c +++ b/src/game/game_0abe70.c @@ -253,7 +253,7 @@ glabel func0f0ac138 /* f0ac140: 27bdff88 */ addiu $sp,$sp,-120 /* f0ac144: afbf0014 */ sw $ra,0x14($sp) /* f0ac148: afa40078 */ sw $a0,0x78($sp) -/* f0ac14c: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0ac14c: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0ac150: afae0074 */ sw $t6,0x74($sp) /* f0ac154: 8fa40078 */ lw $a0,0x78($sp) /* f0ac158: 8faf0074 */ lw $t7,0x74($sp) @@ -499,7 +499,7 @@ glabel func0f0ac4b8 /* f0ac4dc: 24040002 */ addiu $a0,$zero,0x2 /* f0ac4e0: 0fc59e73 */ jal gfxAllocateColours /* f0ac4e4: 26101bb0 */ addiu $s0,$s0,7088 -/* f0ac4e8: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0ac4e8: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0ac4ec: afa200c4 */ sw $v0,0xc4($sp) /* f0ac4f0: 3c0c8007 */ lui $t4,%hi(var80070500) /* f0ac4f4: afa20080 */ sw $v0,0x80($sp) @@ -558,7 +558,7 @@ glabel func0f0ac4b8 /* f0ac5c4: e7a800e4 */ swc1 $f8,0xe4($sp) /* f0ac5c8: 46023283 */ div.s $f10,$f6,$f2 /* f0ac5cc: e7a400e8 */ swc1 $f4,0xe8($sp) -/* f0ac5d0: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0ac5d0: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0ac5d4: e7aa00ec */ swc1 $f10,0xec($sp) /* f0ac5d8: 00402025 */ or $a0,$v0,$zero /* f0ac5dc: 8fa500fc */ lw $a1,0xfc($sp) @@ -610,7 +610,7 @@ glabel func0f0ac4b8 /* f0ac680: 1000013e */ b .L0f0acb7c /* f0ac684: 8fa200f0 */ lw $v0,0xf0($sp) .L0f0ac688: -/* f0ac688: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0ac688: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0ac68c: 00000000 */ nop /* f0ac690: 00402025 */ or $a0,$v0,$zero /* f0ac694: 8fa50108 */ lw $a1,0x108($sp) @@ -737,7 +737,7 @@ glabel func0f0ac4b8 .L0f0ac854: /* f0ac854: 0fc59e59 */ jal gfxAllocateVertices /* f0ac858: 24040004 */ addiu $a0,$zero,0x4 -/* f0ac85c: 0fc59e66 */ jal func0f167998 +/* f0ac85c: 0fc59e66 */ jal gfxAllocateMatrix /* f0ac860: 00408025 */ or $s0,$v0,$zero /* f0ac864: afa200c8 */ sw $v0,0xc8($sp) /* f0ac868: 8fa400fc */ lw $a0,0xfc($sp) @@ -1069,7 +1069,7 @@ glabel var7f1accf4 /* f0acc54: 01cf6821 */ addu $t5,$t6,$t7 /* f0acc58: afad00ec */ sw $t5,0xec($sp) /* f0acc5c: e7a20124 */ swc1 $f2,0x124($sp) -/* f0acc60: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0acc60: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0acc64: e7aa00f0 */ swc1 $f10,0xf0($sp) /* f0acc68: afa200e4 */ sw $v0,0xe4($sp) /* f0acc6c: 82230001 */ lb $v1,0x1($s1) @@ -1364,7 +1364,7 @@ glabel var7f1accf4 /* f0ad0b0: 24040004 */ addiu $a0,$zero,0x4 /* f0ad0b4: 00408025 */ or $s0,$v0,$zero .L0f0ad0b8: -/* f0ad0b8: 0fc59e66 */ jal func0f167998 +/* f0ad0b8: 0fc59e66 */ jal gfxAllocateMatrix /* f0ad0bc: 00000000 */ nop /* f0ad0c0: 44807000 */ mtc1 $zero,$f14 /* f0ad0c4: c7a8012c */ lwc1 $f8,0x12c($sp) @@ -3140,7 +3140,7 @@ glabel var7f1acd6c /* f0aeacc: 26440004 */ addiu $a0,$s2,0x4 /* f0aead0: 0c005775 */ jal func00015dd4 /* f0aead4: 02002825 */ or $a1,$s0,$zero -/* f0aead8: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0aead8: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0aeadc: 00000000 */ nop /* f0aeae0: 00402025 */ or $a0,$v0,$zero /* f0aeae4: 02002825 */ or $a1,$s0,$zero @@ -3662,7 +3662,7 @@ glabel var7f1acd8c /* f0af32c: af090004 */ sw $t1,0x4($t8) /* f0af330: 0c00566c */ jal func000159b0 /* f0af334: af080000 */ sw $t0,0x0($t8) -/* f0af338: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0af338: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0af33c: 00000000 */ nop /* f0af340: 00402025 */ or $a0,$v0,$zero /* f0af344: 0c0056f8 */ jal func00015be0 @@ -3682,7 +3682,7 @@ glabel var7f1acd8c /* f0af37c: e7a00154 */ swc1 $f0,0x154($sp) /* f0af380: 0c00566c */ jal func000159b0 /* f0af384: e7a0015c */ swc1 $f0,0x15c($sp) -/* f0af388: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0af388: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0af38c: 00000000 */ nop /* f0af390: 00402025 */ or $a0,$v0,$zero /* f0af394: 0c0056f8 */ jal func00015be0 @@ -3703,7 +3703,7 @@ glabel var7f1acd8c /* f0af3d0: e7a801ac */ swc1 $f8,0x1ac($sp) /* f0af3d4: 0c0057e2 */ jal func00015f88 /* f0af3d8: e7a601e8 */ swc1 $f6,0x1e8($sp) -/* f0af3dc: 0fc59e66 */ jal func0f167998 +/* f0af3dc: 0fc59e66 */ jal gfxAllocateMatrix /* f0af3e0: 00000000 */ nop /* f0af3e4: 00408025 */ or $s0,$v0,$zero /* f0af3e8: 02202025 */ or $a0,$s1,$zero @@ -4256,7 +4256,7 @@ glabel var7f1acd90 /* f0afc18: 24a50024 */ addiu $a1,$a1,0x0024 /* f0afc1c: 0c00566c */ jal func000159b0 /* f0afc20: 27a4014c */ addiu $a0,$sp,0x14c -/* f0afc24: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0afc24: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0afc28: 00000000 */ nop /* f0afc2c: 00402025 */ or $a0,$v0,$zero /* f0afc30: 0c0056f8 */ jal func00015be0 @@ -4275,7 +4275,7 @@ glabel var7f1acd90 /* f0afc64: e7b4013c */ swc1 $f20,0x13c($sp) /* f0afc68: 0c00566c */ jal func000159b0 /* f0afc6c: e7b40144 */ swc1 $f20,0x144($sp) -/* f0afc70: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0afc70: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0afc74: 00000000 */ nop /* f0afc78: 00402025 */ or $a0,$v0,$zero /* f0afc7c: 0c0056f8 */ jal func00015be0 @@ -4293,7 +4293,7 @@ glabel var7f1acd90 /* f0afcac: e7b401d0 */ swc1 $f20,0x1d0($sp) /* f0afcb0: 0c0057e2 */ jal func00015f88 /* f0afcb4: e7a80194 */ swc1 $f8,0x194($sp) -/* f0afcb8: 0fc59e66 */ jal func0f167998 +/* f0afcb8: 0fc59e66 */ jal gfxAllocateMatrix /* f0afcbc: 00000000 */ nop /* f0afcc0: 00408025 */ or $s0,$v0,$zero /* f0afcc4: 02202025 */ or $a0,$s1,$zero diff --git a/src/game/game_0b3350.c b/src/game/game_0b3350.c index c3fad8b7f..868381072 100644 --- a/src/game/game_0b3350.c +++ b/src/game/game_0b3350.c @@ -1814,34 +1814,34 @@ glabel var7f1ad154 /* f0b4f74: 00000000 */ nop ); -void currentPlayerSetUnk1738(u32 value) +void currentPlayerSetUnk1738(void *value) { g_Vars.currentplayer->unk1738 = value; } -u32 currentPlayerGetUnk1738(void) +void *currentPlayerGetUnk1738(void) { return g_Vars.currentplayer->unk1738; } -void currentPlayerSetUnk173c(u32 value) +void currentPlayerSetUnk173c(Mtx *matrix) { - g_Vars.currentplayer->unk173c = value; + g_Vars.currentplayer->unk173c = matrix; } -u32 currentPlayerGetUnk173c(void) +Mtx *currentPlayerGetUnk173c(void) { return g_Vars.currentplayer->unk173c; } -void currentPlayerSetUnk006c(u32 value) +void currentPlayerSetUnk006c(Mtxf *matrix) { - g_Vars.currentplayer->unk006c = value; + g_Vars.currentplayer->matrix6c = matrix; } -u32 currentPlayerGetUnk006c(void) +Mtxf *currentPlayerGetUnk006c(void) { - return g_Vars.currentplayer->unk006c; + return g_Vars.currentplayer->matrix6c; } void currentPlayerSetUnk1750(void *value) @@ -1854,22 +1854,22 @@ void *currentPlayerGetUnk1750(void) return g_Vars.currentplayer->unk1750; } -void currentPlayerSetUnk1758(u32 value) +void currentPlayerSetUnk1758(Mtx *matrix) { - g_Vars.currentplayer->unk1758 = value; + g_Vars.currentplayer->unk1758 = matrix; } -u32 currentPlayerGetUnk1758(void) +Mtx *currentPlayerGetUnk1758(void) { return g_Vars.currentplayer->unk1758; } -void currentPlayerSetMatrix(f32 *matrix) +void currentPlayerSetMatrix1740(Mtxf *matrix) { struct player *player = g_Vars.currentplayer; - player->prevmatrix = player->matrix; - player->matrix = matrix; + player->prev1740 = player->matrix1740; + player->matrix1740 = matrix; player->unk1744 = var80084008; player->unk0488 = player->unk0484; player->unk0484 = var800aa59c; @@ -2361,24 +2361,24 @@ glabel func0f0b53a4 /* f0b56f4: 27bd0050 */ addiu $sp,$sp,0x50 ); -f32 *currentPlayerGetMatrix(void) +Mtxf *currentPlayerGetMatrix1740(void) { - return g_Vars.currentplayer->matrix; + return g_Vars.currentplayer->matrix1740; } -void currentPlayerSetUnk1754(u32 value) +void currentPlayerSetUnk1754(Mtxf *matrix) { - g_Vars.currentplayer->unk1754 = value; + g_Vars.currentplayer->unk1754 = matrix; } -u32 currentPlayerGetUnk1754(void) +Mtxf *currentPlayerGetUnk1754(void) { return g_Vars.currentplayer->unk1754; } -f32 *currentPlayerGetPrevMatrix(void) +Mtxf *currentPlayerGetPrevMatrix(void) { - return g_Vars.currentplayer->prevmatrix; + return g_Vars.currentplayer->prev1740; } void currentPlayerSetUnk1748(u32 value) @@ -2391,31 +2391,31 @@ u32 currentPlayerGetUnk1748(void) return g_Vars.currentplayer->unk1748; } -void currentPlayerSetUnk174c(u32 value) +void currentPlayerSetUnk174c(Mtxf *matrix) { struct player *player = g_Vars.currentplayer; player->unk1764 = player->unk1744; player->unk1768 = player->unk174c; - player->unk174c = value; + player->unk174c = matrix; } -u32 currentPlayerGetUnk174c(void) +Mtxf *currentPlayerGetUnk174c(void) { return g_Vars.currentplayer->unk174c; } -u32 currentPlayerGetUnk1768(void) +Mtxf *currentPlayerGetUnk1768(void) { return g_Vars.currentplayer->unk1768; } -void currentPlayerSetUnk175c(u32 value) +void currentPlayerSetUnk175c(void *value) { g_Vars.currentplayer->unk175c = value; } -u32 currentPlayerGetUnk175c(void) +void *currentPlayerGetUnk175c(void) { return g_Vars.currentplayer->unk175c; } diff --git a/src/game/game_0b63b0.c b/src/game/game_0b63b0.c index 37d7e96e9..acf72ee14 100644 --- a/src/game/game_0b63b0.c +++ b/src/game/game_0b63b0.c @@ -4494,13 +4494,13 @@ void func0f0baf38(void) Gfx *func0f0baf84(Gfx *gdl) { if (g_Vars.currentplayer->pausemode != PAUSEMODE_UNPAUSED) { - u32 a = func0f167998(); + f32 *a = gfxAllocateMatrix(); u16 b; func00004a24(a, &b, g_Vars.currentplayer->zoominfovy, 1.4545454978943f, 10, 300, 1); - gSPMatrix(gdl++, 0x80000000 + a, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gdl++, 0x80000000 + (u32)a, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPPerspNormalize(gdl++, b); } @@ -5195,7 +5195,7 @@ glabel func0f0bbf14 Gfx *hudRenderHealthBar(Gfx *gdl) { f32 matrix[16]; - u32 addr = func0f167998(); + f32 *addr = gfxAllocateMatrix(); func00016ae4(matrix, 0, 370, 0, 0, 0, 0, 0, 0, -1); func00016054(matrix, addr); @@ -9382,7 +9382,7 @@ void currentPlayerSetGlobalDrawCameraOffset(void) g_Vars.currentplayer->globaldrawcameraoffset.y = g_Vars.currentplayer->globaldrawworldoffset.y; g_Vars.currentplayer->globaldrawcameraoffset.z = g_Vars.currentplayer->globaldrawworldoffset.z; - func00015b10(currentPlayerGetMatrix(), &g_Vars.currentplayer->globaldrawcameraoffset); + func00015b10(currentPlayerGetMatrix1740(), &g_Vars.currentplayer->globaldrawcameraoffset); } GLOBAL_ASM( @@ -9402,20 +9402,20 @@ glabel func0f0bfc7c /* f0bfcac: e7a00070 */ swc1 $f0,0x70($sp) /* f0bfcb0: 0fc2feee */ jal currentPlayerSetGlobalDrawWorldOffset /* f0bfcb4: 8dc41ba0 */ lw $a0,0x1ba0($t6) -/* f0bfcb8: 0fc59e66 */ jal func0f167998 +/* f0bfcb8: 0fc59e66 */ jal gfxAllocateMatrix /* f0bfcbc: 00000000 */ nop /* f0bfcc0: 8e4f0284 */ lw $t7,0x284($s2) -/* f0bfcc4: 0fc59e66 */ jal func0f167998 +/* f0bfcc4: 0fc59e66 */ jal gfxAllocateMatrix /* f0bfcc8: ade2005c */ sw $v0,0x5c($t7) /* f0bfccc: 8e580284 */ lw $t8,0x284($s2) -/* f0bfcd0: 0fc59e66 */ jal func0f167998 +/* f0bfcd0: 0fc59e66 */ jal gfxAllocateMatrix /* f0bfcd4: af020060 */ sw $v0,0x60($t8) /* f0bfcd8: 8e590284 */ lw $t9,0x284($s2) -/* f0bfcdc: 0fc59e66 */ jal func0f167998 +/* f0bfcdc: 0fc59e66 */ jal gfxAllocateMatrix /* f0bfce0: af220064 */ sw $v0,0x64($t9) /* f0bfce4: 8e490284 */ lw $t1,0x284($s2) /* f0bfce8: 24040002 */ addiu $a0,$zero,0x2 -/* f0bfcec: 0fc59e6c */ jal func0f1679b0 +/* f0bfcec: 0fc59e6c */ jal gfxAllocate4Words /* f0bfcf0: ad220068 */ sw $v0,0x68($t1) /* f0bfcf4: 8fa80110 */ lw $t0,0x110($sp) /* f0bfcf8: 8e430284 */ lw $v1,0x284($s2) @@ -9519,9 +9519,9 @@ glabel func0f0bfc7c /* f0bfe80: c6280008 */ lwc1 $f8,0x8($s1) /* f0bfe84: 0c005ad6 */ jal func00016b58 /* f0bfe88: e7a80024 */ swc1 $f8,0x24($sp) -/* f0bfe8c: 0fc59e66 */ jal func0f167998 +/* f0bfe8c: 0fc59e66 */ jal gfxAllocateMatrix /* f0bfe90: 00000000 */ nop -/* f0bfe94: 0fc59e66 */ jal func0f167998 +/* f0bfe94: 0fc59e66 */ jal gfxAllocateMatrix /* f0bfe98: 00408825 */ or $s1,$v0,$zero /* f0bfe9c: 0fc2d5c6 */ jal currentPlayerGetUnk1754 /* f0bfea0: 00408025 */ or $s0,$v0,$zero @@ -9586,7 +9586,7 @@ glabel func0f0bfc7c /* f0bff7c: 0fc2d3de */ jal currentPlayerSetUnk1738 /* f0bff80: 8de40060 */ lw $a0,0x60($t7) /* f0bff84: 8e580284 */ lw $t8,0x284($s2) -/* f0bff88: 0fc2d406 */ jal currentPlayerSetMatrix +/* f0bff88: 0fc2d406 */ jal currentPlayerSetMatrix1740 /* f0bff8c: 8f040064 */ lw $a0,0x64($t8) /* f0bff90: 8e590284 */ lw $t9,0x284($s2) /* f0bff94: 0fc2d5d6 */ jal currentPlayerSetUnk174c @@ -9605,6 +9605,90 @@ glabel func0f0bfc7c /* f0bffc8: 27bd0110 */ addiu $sp,$sp,0x110 ); +// Mismatch near first call to func00016874: +// - Goal seems to have less float registers available which causes it to +// reload cam_look properties for the function call +// - Because it has to reload, it then stores cam_look in a callee-save register +//void func0f0bfc7c(struct coord *cam_pos, struct coord *cam_look, struct coord *cam_up) +//{ +// f32 spd0[16]; +// void *spcc; +// Mtxf sp8c; +// struct coord sp80; +// struct coord sp74; +// f32 scale; +// Mtxf *s0; +// Mtx *s1; +// s32 i; +// s32 j; +// +// scale = currentPlayerGetScaleBg2Gfx(); +// currentPlayerSetGlobalDrawWorldOffset(g_Vars.currentplayer->cam_room); +// +// g_Vars.currentplayer->matrix5c = gfxAllocateMatrix(); +// g_Vars.currentplayer->matrix60 = gfxAllocateMatrix(); +// g_Vars.currentplayer->matrix64 = gfxAllocateMatrix(); +// g_Vars.currentplayer->matrix68 = gfxAllocateMatrix(); +// +// spcc = gfxAllocate4Words(2); +// +// sp74.x = (cam_pos->x - g_Vars.currentplayer->globaldrawworldoffset.x) * scale; +// sp74.y = (cam_pos->y - g_Vars.currentplayer->globaldrawworldoffset.y) * scale; +// sp74.z = (cam_pos->z - g_Vars.currentplayer->globaldrawworldoffset.z) * scale; +// +// sp80.x = (cam_pos->x - g_Vars.currentplayer->globaldrawworldoffset.x) * scale + cam_look->x; +// sp80.y = (cam_pos->y - g_Vars.currentplayer->globaldrawworldoffset.y) * scale + cam_look->y; +// sp80.z = (cam_pos->z - g_Vars.currentplayer->globaldrawworldoffset.z) * scale + cam_look->z; +// +// func00016874(&sp8c, +// sp74.x, sp74.y, sp74.z, +// cam_look->x, cam_look->y, cam_look->z, +// cam_up->x, cam_up->y, cam_up->z); +// +// func0000470c(spd0, spcc, +// sp74.x, sp74.y, sp74.z, +// sp80.x, sp80.y, sp80.z, +// cam_up->x, cam_up->y, cam_up->z); +// +// func00016874(g_Vars.currentplayer->matrix64, +// cam_pos->x, cam_pos->y, cam_pos->z, +// cam_look->x, cam_look->y, cam_look->z, +// cam_up->x, cam_up->y, cam_up->z); +// +// func00016b58(g_Vars.currentplayer->matrix68, +// cam_pos->x, cam_pos->y, cam_pos->z, +// cam_look->x, cam_look->y, cam_look->z, +// cam_up->x, cam_up->y, cam_up->z); +// +// s1 = gfxAllocateMatrix(); +// s0 = gfxAllocateMatrix(); +// func00015a00(currentPlayerGetUnk1754(), &sp8c, s0); +// +// for (i = 0; i < 4; i++) { +// for (j = 0; j < 4; j++) { +// if (s0->m[i][j] > 32000.0f) { +// s0->m[i][j] = 32000.0f; +// } else if (s0->m[i][j] < -32000.0f) { +// s0->m[i][j] = -32000.0f; +// } +// } +// } +// +// currentPlayerSetUnk006c(s0); +// func0004a360(s0, s1); +// currentPlayerSetUnk1758(s1); +// func00015f04(scale, &sp8c); +// func0004a360(&sp8c, g_Vars.currentplayer->matrix5c); +// func00016820(g_Vars.currentplayer->matrix5c, g_Vars.currentplayer->matrix60); +// currentPlayerSetUnk173c(g_Vars.currentplayer->matrix5c); +// currentPlayerSetUnk1738(g_Vars.currentplayer->matrix60); +// currentPlayerSetMatrix1740(g_Vars.currentplayer->matrix64); +// currentPlayerSetUnk174c(g_Vars.currentplayer->matrix68); +// currentPlayerSetUnk175c(spcc); +// func0f0b5838(); +// currentPlayerSetGlobalDrawCameraOffset(); +//} + Gfx *currentPlayerUpdateShootRot(Gfx *gdl) { struct coord sp3c; diff --git a/src/game/game_0d4690.c b/src/game/game_0d4690.c index e3a5ecfce..344d986e1 100644 --- a/src/game/game_0d4690.c +++ b/src/game/game_0d4690.c @@ -126,9 +126,9 @@ glabel func0f0d479c /* f0d47a0: afbf002c */ sw $ra,0x2c($sp) /* f0d47a4: afb10028 */ sw $s1,0x28($sp) /* f0d47a8: 00808825 */ or $s1,$a0,$zero -/* f0d47ac: 0fc59e66 */ jal func0f167998 +/* f0d47ac: 0fc59e66 */ jal gfxAllocateMatrix /* f0d47b0: afb00024 */ sw $s0,0x24($sp) -/* f0d47b4: 0fc59e66 */ jal func0f167998 +/* f0d47b4: 0fc59e66 */ jal gfxAllocateMatrix /* f0d47b8: afa20054 */ sw $v0,0x54($sp) /* f0d47bc: 0c0059d8 */ jal func00016760 /* f0d47c0: afa20050 */ sw $v0,0x50($sp) @@ -303,7 +303,7 @@ glabel func0f0d4a3c /* f0d4a3c: 27bdff60 */ addiu $sp,$sp,-160 /* f0d4a40: afbf0024 */ sw $ra,0x24($sp) /* f0d4a44: afa400a0 */ sw $a0,0xa0($sp) -/* f0d4a48: 0fc59e66 */ jal func0f167998 +/* f0d4a48: 0fc59e66 */ jal gfxAllocateMatrix /* f0d4a4c: afa500a4 */ sw $a1,0xa4($sp) /* f0d4a50: 8fae00a0 */ lw $t6,0xa0($sp) /* f0d4a54: 8fa400a4 */ lw $a0,0xa4($sp) @@ -454,7 +454,7 @@ GLOBAL_ASM( glabel func0f0d4c80 /* f0d4c80: 27bdffa0 */ addiu $sp,$sp,-96 /* f0d4c84: afbf0014 */ sw $ra,0x14($sp) -/* f0d4c88: 0fc59e66 */ jal func0f167998 +/* f0d4c88: 0fc59e66 */ jal gfxAllocateMatrix /* f0d4c8c: afa40060 */ sw $a0,0x60($sp) /* f0d4c90: afa2001c */ sw $v0,0x1c($sp) /* f0d4c94: 0fc351a4 */ jal func0f0d4690 diff --git a/src/game/game_0e0770.c b/src/game/game_0e0770.c index 0291b923a..6fdd498ca 100644 --- a/src/game/game_0e0770.c +++ b/src/game/game_0e0770.c @@ -5200,7 +5200,7 @@ glabel func0f0e5000 /* f0e56a0: ad2c0004 */ sw $t4,0x4($t1) /* f0e56a4: 0c00566c */ jal func000159b0 /* f0e56a8: ad2b0000 */ sw $t3,0x0($t1) -/* f0e56ac: 0fc59e66 */ jal func0f167998 +/* f0e56ac: 0fc59e66 */ jal gfxAllocateMatrix /* f0e56b0: 00000000 */ nop /* f0e56b4: 00409025 */ or $s2,$v0,$zero /* f0e56b8: 02002025 */ or $a0,$s0,$zero diff --git a/src/game/game_0f09f0.c b/src/game/game_0f09f0.c index c6e57e8cf..0b71a7975 100644 --- a/src/game/game_0f09f0.c +++ b/src/game/game_0f09f0.c @@ -13922,11 +13922,11 @@ void func0f0fd494(struct coord *pos) { f32 xy[2]; struct coord coord; - f32 *matrix; + Mtxf *matrix; g_MenuData.unk5d5_04 = true; - matrix = currentPlayerGetMatrix(); + matrix = currentPlayerGetMatrix1740(); func00015b68(matrix, pos, &coord); func0f0b4d04(&coord, xy); diff --git a/src/game/game_11f000.c b/src/game/game_11f000.c index 6ff147b6b..b86ddb475 100644 --- a/src/game/game_11f000.c +++ b/src/game/game_11f000.c @@ -2158,7 +2158,7 @@ glabel var7f1b50c8 /* f120df4: 8fae0068 */ lw $t6,0x68($sp) /* f120df8: 0fc2d5c6 */ jal currentPlayerGetUnk1754 /* f120dfc: 00000000 */ nop -/* f120e00: 0fc2d5be */ jal currentPlayerGetMatrix +/* f120e00: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f120e04: 00408025 */ or $s0,$v0,$zero /* f120e08: 02002025 */ or $a0,$s0,$zero /* f120e0c: 00402825 */ or $a1,$v0,$zero @@ -3600,7 +3600,7 @@ glabel var7f1b50c8 /* f122438: af0b0004 */ sw $t3,0x4($t8) /* f12243c: 0fc2d5c6 */ jal currentPlayerGetUnk1754 /* f122440: af190000 */ sw $t9,0x0($t8) -/* f122444: 0fc2d5be */ jal currentPlayerGetMatrix +/* f122444: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f122448: 00408025 */ or $s0,$v0,$zero /* f12244c: 02002025 */ or $a0,$s0,$zero /* f122450: 00402825 */ or $a1,$v0,$zero @@ -7285,7 +7285,7 @@ glabel var7f1b5108 /* f125aa8: f7b60040 */ sdc1 $f22,0x40($sp) /* f125aac: f7b40038 */ sdc1 $f20,0x38($sp) /* f125ab0: afa40170 */ sw $a0,0x170($sp) -/* f125ab4: 0fc2d5be */ jal currentPlayerGetMatrix +/* f125ab4: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f125ab8: afa50174 */ sw $a1,0x174($sp) /* f125abc: 0fc2d5c6 */ jal currentPlayerGetUnk1754 /* f125ac0: afa2016c */ sw $v0,0x16c($sp) @@ -8467,7 +8467,7 @@ glabel func0f126c3c /* f126c54: afa40070 */ sw $a0,0x70($sp) /* f126c58: e7ac0064 */ swc1 $f12,0x64($sp) /* f126c5c: e7ae0068 */ swc1 $f14,0x68($sp) -/* f126c60: 0fc2d5be */ jal currentPlayerGetMatrix +/* f126c60: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f126c64: e7a4006c */ swc1 $f4,0x6c($sp) /* f126c68: 00402025 */ or $a0,$v0,$zero /* f126c6c: 0c0056d9 */ jal func00015b64 diff --git a/src/game/game_12f6c0.c b/src/game/game_12f6c0.c index 40bfd21d7..8b4bdfb39 100644 --- a/src/game/game_12f6c0.c +++ b/src/game/game_12f6c0.c @@ -1368,12 +1368,12 @@ glabel func0f130044 /* f130a48: 02a02025 */ or $a0,$s5,$zero /* f130a4c: 0c005775 */ jal func00015dd4 /* f130a50: 27a500d4 */ addiu $a1,$sp,0xd4 -/* f130a54: 0fc2d5be */ jal currentPlayerGetMatrix +/* f130a54: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f130a58: 00000000 */ nop /* f130a5c: 00402025 */ or $a0,$v0,$zero /* f130a60: 0c0056f8 */ jal func00015be0 /* f130a64: 27a500d4 */ addiu $a1,$sp,0xd4 -/* f130a68: 0fc59e66 */ jal func0f167998 +/* f130a68: 0fc59e66 */ jal gfxAllocateMatrix /* f130a6c: 00000000 */ nop /* f130a70: 00408825 */ or $s1,$v0,$zero /* f130a74: 27a400d4 */ addiu $a0,$sp,0xd4 diff --git a/src/game/game_135c70.c b/src/game/game_135c70.c index bffbee1fa..3077118c8 100644 --- a/src/game/game_135c70.c +++ b/src/game/game_135c70.c @@ -1174,7 +1174,7 @@ glabel var7f1b57bc /* f136c90: 02202025 */ or $a0,$s1,$zero /* f136c94: 0c00566c */ jal func000159b0 /* f136c98: e7a00154 */ swc1 $f0,0x154($sp) -/* f136c9c: 0fc2d5be */ jal currentPlayerGetMatrix +/* f136c9c: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f136ca0: 00000000 */ nop /* f136ca4: 00402025 */ or $a0,$v0,$zero /* f136ca8: 0c0056f8 */ jal func00015be0 diff --git a/src/game/game_1371b0.c b/src/game/game_1371b0.c index 7ae2f42c4..e3af93db6 100644 --- a/src/game/game_1371b0.c +++ b/src/game/game_1371b0.c @@ -4567,7 +4567,7 @@ glabel var7f1b5948 /* f13b064: 27bdff58 */ addiu $sp,$sp,-168 /* f13b068: afbf001c */ sw $ra,0x1c($sp) /* f13b06c: afb00018 */ sw $s0,0x18($sp) -/* f13b070: 0fc59e66 */ jal func0f167998 +/* f13b070: 0fc59e66 */ jal gfxAllocateMatrix /* f13b074: 00808025 */ or $s0,$a0,$zero /* f13b078: afa20064 */ sw $v0,0x64($sp) /* f13b07c: 0fc54c77 */ jal func0f1531dc @@ -4737,7 +4737,7 @@ glabel var7f1b5948 /* f13b2f8: 27a40068 */ addiu $a0,$sp,0x68 /* f13b2fc: 0c005815 */ jal func00016054 /* f13b300: 8fa50064 */ lw $a1,0x64($sp) -/* f13b304: 0fc2d406 */ jal currentPlayerSetMatrix +/* f13b304: 0fc2d406 */ jal currentPlayerSetMatrix1740 /* f13b308: 27a40068 */ addiu $a0,$sp,0x68 /* f13b30c: 3c180102 */ lui $t8,0x102 /* f13b310: 37180040 */ ori $t8,$t8,0x40 diff --git a/src/game/game_13c510.c b/src/game/game_13c510.c index 8bb6fd8a9..46801e2dc 100644 --- a/src/game/game_13c510.c +++ b/src/game/game_13c510.c @@ -1575,7 +1575,7 @@ glabel func0f13d568 /* f13dae4: 460a3481 */ sub.s $f18,$f6,$f10 /* f13dae8: 14a8ffe4 */ bne $a1,$t0,.L0f13da7c /* f13daec: e4b2fffc */ swc1 $f18,-0x4($a1) -/* f13daf0: 0fc2d5be */ jal currentPlayerGetMatrix +/* f13daf0: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f13daf4: 00000000 */ nop /* f13daf8: 00402025 */ or $a0,$v0,$zero /* f13dafc: 0c0056c4 */ jal func00015b10 diff --git a/src/game/game_150820.c b/src/game/game_150820.c index 3b1edf673..746f3b687 100644 --- a/src/game/game_150820.c +++ b/src/game/game_150820.c @@ -1163,7 +1163,7 @@ glabel func0f151780 /* f15190c: 24100001 */ addiu $s0,$zero,0x1 /* f151910: 1561013a */ bne $t3,$at,.L0f151dfc /* f151914: 00000000 */ nop -/* f151918: 0fc59e66 */ jal func0f167998 +/* f151918: 0fc59e66 */ jal gfxAllocateMatrix /* f15191c: 4600c506 */ mov.s $f20,$f24 /* f151920: 8ee30284 */ lw $v1,0x284($s7) /* f151924: 24010001 */ addiu $at,$zero,0x1 @@ -1703,7 +1703,7 @@ glabel func0f151ed0 /* f152100: 24100001 */ addiu $s0,$zero,0x1 /* f152104: 11a1013f */ beq $t5,$at,.L0f152604 /* f152108: 00000000 */ nop -/* f15210c: 0fc59e66 */ jal func0f167998 +/* f15210c: 0fc59e66 */ jal gfxAllocateMatrix /* f152110: 4600c506 */ mov.s $f20,$f24 /* f152114: 8ec30284 */ lw $v1,0x284($s6) /* f152118: 24010001 */ addiu $at,$zero,0x1 diff --git a/src/game/game_157db0.c b/src/game/game_157db0.c index 92cb8d357..24a6a64ac 100644 --- a/src/game/game_157db0.c +++ b/src/game/game_157db0.c @@ -6854,13 +6854,13 @@ bool func0f15cd90(u32 room, struct screenbox *screen) bool func0f15d08c(struct coord *a, struct coord *b) { - f32 *matrixmaybe = currentPlayerGetMatrix(); + Mtxf *matrix = currentPlayerGetMatrix1740(); b->x = a->x; b->y = a->y; b->z = a->z; - func00015b64(matrixmaybe, b); + func00015b64(matrix, b); func0f0b4d68(b, b); if (b->z > 0) { diff --git a/src/game/game_165670.c b/src/game/game_165670.c index 85a54c7af..4d8cc7b76 100644 --- a/src/game/game_165670.c +++ b/src/game/game_165670.c @@ -1229,7 +1229,7 @@ glabel func0f1666f8 /* f166738: 24020001 */ addiu $v0,$zero,0x1 /* f16673c: afa3001c */ sw $v1,0x1c($sp) .L0f166740: -/* f166740: 0fc2d5be */ jal currentPlayerGetMatrix +/* f166740: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f166744: afa40030 */ sw $a0,0x30($sp) /* f166748: 8fa3001c */ lw $v1,0x1c($sp) /* f16674c: 8fa40030 */ lw $a0,0x30($sp) diff --git a/src/game/game_166e40.c b/src/game/game_166e40.c index 37c62db3e..33c5bb68d 100644 --- a/src/game/game_166e40.c +++ b/src/game/game_166e40.c @@ -512,7 +512,7 @@ glabel gfxAllocateVertices ); GLOBAL_ASM( -glabel func0f167998 +glabel gfxAllocateMatrix /* f167998: 3c05800b */ lui $a1,%hi(var800aa59c) /* f16799c: 24a5a59c */ addiu $a1,$a1,%lo(var800aa59c) /* f1679a0: 8ca20000 */ lw $v0,0x0($a1) @@ -522,7 +522,7 @@ glabel func0f167998 ); GLOBAL_ASM( -glabel func0f1679b0 +glabel gfxAllocate4Words /* f1679b0: 3c06800b */ lui $a2,%hi(var800aa59c) /* f1679b4: 24c6a59c */ addiu $a2,$a2,%lo(var800aa59c) /* f1679b8: 8cc20000 */ lw $v0,0x0($a2) diff --git a/src/game/game_1999b0.c b/src/game/game_1999b0.c index 098ba074e..28277af3b 100644 --- a/src/game/game_1999b0.c +++ b/src/game/game_1999b0.c @@ -438,10 +438,10 @@ u32 ammotypeGetWeapon(u32 ammotype) void func0f19a37c(struct chrdata *chr) { struct coord sp228 = {0, 0, 0}; - f32 sp164[16]; + Mtxf sp164; f32 sp152[3]; struct prop *prop = chr->prop; - f32 sp84[16]; + Mtxf sp84; f32 sp80 = func0f03e5f0(chr); u32 stack; u8 sp72[] = {0, 0, 0, 0}; @@ -482,20 +482,20 @@ void func0f19a37c(struct chrdata *chr) sp228.y = sp152[1] * mult; sp228.z = sp152[2] * mult; - func000159b0(sp164); + func000159b0(&sp164); if (chr->aibot->weaponnum == WEAPON_COMBATKNIFE) { - func00016400(M_BADPI * 1.5f, sp164); - func000162e8(M_BADPI, sp84); - func000159fc(sp84, sp164); + func00016400(M_BADPI * 1.5f, &sp164); + func000162e8(M_BADPI, &sp84); + func000159fc(&sp84, &sp164); } - func000162e8(0.34901028871536f, sp84); - func00015be0(sp84, sp164); - func00016374(sp80, sp84); - func00015be0(sp84, sp164); + func000162e8(0.34901028871536f, &sp84); + func00015be0(&sp84, &sp164); + func00016374(sp80, &sp84); + func00015be0(&sp84, &sp164); - func0f09ee18(chr, sp72, &prop->pos, prop->rooms, sp164, &sp228); + func0f09ee18(chr, sp72, &prop->pos, prop->rooms, &sp164, &sp228); if (sp72[0] == WEAPON_REMOTEMINE) { chr->aibot->unk064 |= 0x1000; @@ -582,9 +582,9 @@ void aibotCreateSlayerRocket(struct chrdata *chr) struct weaponobj *rocket = func0f08b880(MODEL_CHRSKROCKETMIS, WEAPON_ROCKET2, chr); if (rocket) { - f32 sp260[16]; - f32 sp196[16]; - f32 sp132[16]; + Mtxf sp260; + Mtxf sp196; + Mtxf sp132; struct coord sp120 = {0, 0, 0}; f32 a; f32 b; @@ -597,12 +597,12 @@ void aibotCreateSlayerRocket(struct chrdata *chr) sp100[1] = sinf(b); sp100[2] = cosf(b) * cosf(a); // @bug? Should one of these be sinf? - func000162e8(b, sp196); - func00016374(a, sp132); - func00015be0(sp132, sp196); - func000159b0(sp260); + func000162e8(b, &sp196); + func00016374(a, &sp132); + func00015be0(&sp132, &sp196); + func000159b0(&sp260); - func0f09ebcc(&rocket->base, &chr->prop->pos, chr->prop->rooms, sp196, sp100, sp260, chr->prop, &chr->prop->pos); + func0f09ebcc(&rocket->base, &chr->prop->pos, chr->prop->rooms, &sp196, sp100, &sp260, chr->prop, &chr->prop->pos); if (rocket->base.hidden & OBJHFLAG_00000080) { struct prop *target = chrGetTargetProp(chr); diff --git a/src/game/propobj.c b/src/game/propobj.c index 79b4f99b2..00c61728e 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -7768,7 +7768,7 @@ glabel func0f06c8ac /* f06c9a8: c6880004 */ lwc1 $f8,0x4($s4) /* f06c9ac: e7a8008c */ swc1 $f8,0x8c($sp) /* f06c9b0: c68a0008 */ lwc1 $f10,0x8($s4) -/* f06c9b4: 0fc2d5be */ jal currentPlayerGetMatrix +/* f06c9b4: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f06c9b8: e7aa0090 */ swc1 $f10,0x90($sp) /* f06c9bc: 00402025 */ or $a0,$v0,$zero /* f06c9c0: 0c0056d9 */ jal func00015b64 @@ -7778,7 +7778,7 @@ glabel func0f06c8ac /* f06c9d0: c7b000a0 */ lwc1 $f16,0xa0($sp) /* f06c9d4: e7a6007c */ swc1 $f6,0x7c($sp) /* f06c9d8: e7b20080 */ swc1 $f18,0x80($sp) -/* f06c9dc: 0fc2d5be */ jal currentPlayerGetMatrix +/* f06c9dc: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f06c9e0: e7b00084 */ swc1 $f16,0x84($sp) /* f06c9e4: 00402025 */ or $a0,$v0,$zero /* f06c9e8: 0c0056c4 */ jal func00015b10 @@ -17770,7 +17770,7 @@ glabel var7f1aa438 /* f0758e0: 8ca5ce74 */ lw $a1,%lo(var8009ce74)($a1) /* f0758e4: 0c006973 */ jal func0001a5cc /* f0758e8: 00003025 */ or $a2,$zero,$zero -/* f0758ec: 0fc2d5be */ jal currentPlayerGetMatrix +/* f0758ec: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f0758f0: afa20184 */ sw $v0,0x184($sp) /* f0758f4: 00402025 */ or $a0,$v0,$zero /* f0758f8: 27a505e8 */ addiu $a1,$sp,0x5e8 @@ -19834,7 +19834,7 @@ glabel var7f1aa44c /* f077484: 8ed5000c */ lw $s5,0xc($s6) /* f077488: 0fc23109 */ jal func0f08c424 /* f07748c: 02a02825 */ or $a1,$s5,$zero -/* f077490: 0fc2d5be */ jal currentPlayerGetMatrix +/* f077490: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f077494: 00000000 */ nop /* f077498: 00402025 */ or $a0,$v0,$zero /* f07749c: 0c0056f8 */ jal func00015be0 @@ -21514,7 +21514,7 @@ glabel var7f1aa4ac /* f0789fc: 27a40064 */ addiu $a0,$sp,0x64 /* f078a00: 0c005775 */ jal func00015dd4 /* f078a04: 8fa50018 */ lw $a1,0x18($sp) -/* f078a08: 0fc2d5be */ jal currentPlayerGetMatrix +/* f078a08: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f078a0c: 00000000 */ nop /* f078a10: 00402025 */ or $a0,$v0,$zero /* f078a14: 0c0056f8 */ jal func00015be0 @@ -22902,7 +22902,7 @@ glabel var7f1aa588 /* f079d5c: 8df80018 */ lw $t8,0x18($t7) /* f079d60: 0c0057c1 */ jal func00015f04 /* f079d64: c70c0014 */ lwc1 $f12,0x14($t8) -/* f079d68: 0fc2d5be */ jal currentPlayerGetMatrix +/* f079d68: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f079d6c: 00000000 */ nop /* f079d70: 00402025 */ or $a0,$v0,$zero /* f079d74: 0c0056f8 */ jal func00015be0 @@ -28076,7 +28076,7 @@ glabel func0f07e2cc /* f07e314: 27a500ac */ addiu $a1,$sp,0xac /* f07e318: 0c005775 */ jal func00015dd4 /* f07e31c: 24e40008 */ addiu $a0,$a3,0x8 -/* f07e320: 0fc2d5be */ jal currentPlayerGetMatrix +/* f07e320: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f07e324: 00000000 */ nop /* f07e328: 8e0f0018 */ lw $t7,0x18($s0) /* f07e32c: 00402025 */ or $a0,$v0,$zero @@ -28348,7 +28348,7 @@ s32 objTick(struct prop *prop) } else { // In cutscene struct objticksp476 sp476 = {0, 1, 3}; - f32 sp412[16]; + Mtxf sp412; struct coord sp400; s16 sp384[8]; struct hov *hov = NULL; @@ -28375,16 +28375,16 @@ s32 objTick(struct prop *prop) sp556 = true; sp476.model0c = func0f1679f4(model->unk08->unk0e * 64); - sp476.matrix = currentPlayerGetMatrix(); + sp476.matrix = currentPlayerGetMatrix1740(); func0001cebc(&sp476, model); if (sp572) { - func00015be4(currentPlayerGetUnk174c(), model->unk0c, sp412); - func00015da0(sp412, obj->realrot); + func00015be4(currentPlayerGetUnk174c(), model->unk0c, &sp412); + func00015da0(&sp412, obj->realrot); - sp400.x = sp412[12]; - sp400.y = sp412[13]; - sp400.z = sp412[14]; + sp400.x = sp412.m[3][0]; + sp400.y = sp412.m[3][1]; + sp400.z = sp412.m[3][2]; if (obj->flags3 & OBJFLAG3_00000010) { func0f065e98(&prop->pos, prop->rooms, &sp400, sp384); @@ -28407,7 +28407,7 @@ s32 objTick(struct prop *prop) if (hov) { func0f0713e4(obj, hov, &prop->pos, prop->rooms, obj->realrot); - hoverpropSetTurnAngle(obj, func0f096750(sp412[8], sp412[10])); + hoverpropSetTurnAngle(obj, func0f096750(sp412.m[2][0], sp412.m[2][2])); hov->unk14 = 0; hov->unk1c = 0; @@ -28434,11 +28434,11 @@ s32 objTick(struct prop *prop) } } else { struct objticksp476 sp312 = {0, 1, 3}; - f32 sp248[16]; + Mtxf sp248; struct coord sp236; s16 sp220[8]; s32 numchrs; - f32 sp152[16]; + Mtxf sp152; s32 sp148; s32 sp144; s32 i; @@ -28467,13 +28467,13 @@ s32 objTick(struct prop *prop) func00016208(obj->realrot, &sp116); } - func00015d54(obj->realrot, sp248); - func00015dd4(&prop->pos, sp248); - func00015a00(currentPlayerGetMatrix(), sp248, sp152); + func00015d54(obj->realrot, &sp248); + func00015dd4(&prop->pos, &sp248); + func00015a00(currentPlayerGetMatrix1740(), &sp248, &sp152); sp556 = true; sp312.model0c = func0f1679f4(model->unk08->unk0e * 64); - sp312.matrix = sp152; + sp312.matrix = &sp152; func0001cebc(&sp312, model); if (sp572) { @@ -28490,8 +28490,8 @@ s32 objTick(struct prop *prop) if (modelGetCurAnimFrame(model) >= modelGetNumAnimFrames(model) - 1) { animTurnOff(model->anim); model->anim = NULL; - func00015be4(currentPlayerGetUnk174c(), model->unk0c, sp248); - func00015da0(sp248, obj->realrot); + func00015be4(currentPlayerGetUnk174c(), model->unk0c, &sp248); + func00015da0(&sp248, obj->realrot); tagnum = objGetTagNum(obj); if (tagnum >= 0) { @@ -30559,14 +30559,14 @@ glabel func0f080f8c /* f080fe8: 46083280 */ add.s $f10,$f6,$f8 /* f080fec: e7a40068 */ swc1 $f4,0x68($sp) /* f080ff0: e7b00070 */ swc1 $f16,0x70($sp) -/* f080ff4: 0fc59e66 */ jal func0f167998 +/* f080ff4: 0fc59e66 */ jal gfxAllocateMatrix /* f080ff8: e7aa006c */ swc1 $f10,0x6c($sp) /* f080ffc: afa2007c */ sw $v0,0x7c($sp) /* f081000: 27a40068 */ addiu $a0,$sp,0x68 /* f081004: 8fa50110 */ lw $a1,0x110($sp) /* f081008: 0c005892 */ jal func00016248 /* f08100c: 27a600c0 */ addiu $a2,$sp,0xc0 -/* f081010: 0fc2d5be */ jal currentPlayerGetMatrix +/* f081010: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f081014: 00000000 */ nop /* f081018: 00402025 */ or $a0,$v0,$zero /* f08101c: 27a500c0 */ addiu $a1,$sp,0xc0 @@ -44814,7 +44814,7 @@ void func0f08e224(struct doorobj *door) if (door->base.hidden & OBJHFLAG_00000080) { door->base.unk48->flags |= 1; - func000159b0(&door->base.unk48->unk020); + func000159b0((Mtxf *)&door->base.unk48->unk020); } } @@ -45077,7 +45077,7 @@ glabel func0f08e794 /* f08e7b8: 8c84a244 */ lw $a0,%lo(g_Vars+0x284)($a0) /* f08e7bc: afa20030 */ sw $v0,0x30($sp) /* f08e7c0: 24841bb0 */ addiu $a0,$a0,7088 -/* f08e7c4: 0fc2d5be */ jal currentPlayerGetMatrix +/* f08e7c4: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f08e7c8: afa4001c */ sw $a0,0x1c($sp) /* f08e7cc: 8fa4001c */ lw $a0,0x1c($sp) /* f08e7d0: 8fa50038 */ lw $a1,0x38($sp) diff --git a/src/game/smoke.c b/src/game/smoke.c index 46a956a30..635fb578e 100644 --- a/src/game/smoke.c +++ b/src/game/smoke.c @@ -1975,9 +1975,9 @@ glabel func0f12e848 u32 smokeUpdateZ(struct prop *prop) { - f32 *matrix = currentPlayerGetMatrix(); + Mtxf *matrix = currentPlayerGetMatrix1740(); - prop->z = -(matrix[2] * prop->pos.x + matrix[6] * prop->pos.y + matrix[10] * prop->pos.z + matrix[14]); + prop->z = -(matrix->m[0][2] * prop->pos.x + matrix->m[1][2] * prop->pos.y + matrix->m[2][2] * prop->pos.z + matrix->m[3][2]); if (prop->z < 100) { prop->z *= 0.5f; diff --git a/src/game/title.c b/src/game/title.c index 6f2c27018..0d018a59b 100644 --- a/src/game/title.c +++ b/src/game/title.c @@ -2631,7 +2631,7 @@ glabel var7f1a8468 /* f0183d8: 10000272 */ b .L0f018da4 /* f0183dc: 8fbf0034 */ lw $ra,0x34($sp) .L0f0183e0: -/* f0183e0: 0fc59e6c */ jal func0f1679b0 +/* f0183e0: 0fc59e6c */ jal gfxAllocate4Words /* f0183e4: afa30330 */ sw $v1,0x330($sp) /* f0183e8: 44809000 */ mtc1 $zero,$f18 /* f0183ec: 3c01457a */ lui $at,0x457a diff --git a/src/game/training.c b/src/game/training.c index 097eb0f0d..62d1263a7 100644 --- a/src/game/training.c +++ b/src/game/training.c @@ -1548,7 +1548,7 @@ void frInitTargets(void) struct prop *prop; struct defaultobj *obj; struct pospad pospad; - f32 sp144[16]; + Mtxf sp144; f32 sp108[9]; for (i = 0; i < ARRAYCOUNT(g_FrData.targets); i++) { @@ -1601,14 +1601,14 @@ void frInitTargets(void) } if (g_FrData.targets[i].flags & FRTARGETFLAG_SPAWNFACINGAWAY) { - func00016374(0.0f, sp144); + func00016374(0.0f, &sp144); g_FrData.targets[i].angle = M_PI; } else { - func00016374(M_PI, sp144); + func00016374(M_PI, &sp144); } - func00015f04(obj->model->unk14, sp144); - func00015da0(sp144, sp108); + func00015f04(obj->model->unk14, &sp144); + func00015da0(&sp144, sp108); func00015cd8(sp108, obj->realrot); prop->pos.x = pospad.pos.x; diff --git a/src/game/weather.c b/src/game/weather.c index ebce9dc12..228651e41 100644 --- a/src/game/weather.c +++ b/src/game/weather.c @@ -2215,7 +2215,7 @@ glabel var7f1b5780 /* f133070: afa00194 */ sw $zero,0x194($sp) /* f133074: 0c00566c */ jal func000159b0 /* f133078: 02002025 */ or $a0,$s0,$zero -/* f13307c: 0fc2d5be */ jal currentPlayerGetMatrix +/* f13307c: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f133080: 00000000 */ nop /* f133084: 00402025 */ or $a0,$v0,$zero /* f133088: 0c0056f8 */ jal func00015be0 @@ -2224,7 +2224,7 @@ glabel var7f1b5780 /* f133094: 00000000 */ nop /* f133098: e7b401f8 */ swc1 $f20,0x1f8($sp) /* f13309c: e7b401fc */ swc1 $f20,0x1fc($sp) -/* f1330a0: 0fc59e66 */ jal func0f167998 +/* f1330a0: 0fc59e66 */ jal gfxAllocateMatrix /* f1330a4: e7b40200 */ swc1 $f20,0x200($sp) /* f1330a8: 00408825 */ or $s1,$v0,$zero /* f1330ac: 02002025 */ or $a0,$s0,$zero @@ -3859,7 +3859,7 @@ glabel var7f1b5790 /* f134878: afa00198 */ sw $zero,0x198($sp) /* f13487c: 0c00566c */ jal func000159b0 /* f134880: 02002025 */ or $a0,$s0,$zero -/* f134884: 0fc2d5be */ jal currentPlayerGetMatrix +/* f134884: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* f134888: 00000000 */ nop /* f13488c: 00402025 */ or $a0,$v0,$zero /* f134890: 0c0056f8 */ jal func00015be0 @@ -3868,7 +3868,7 @@ glabel var7f1b5790 /* f13489c: 00000000 */ nop /* f1348a0: e7b401fc */ swc1 $f20,0x1fc($sp) /* f1348a4: e7b40200 */ swc1 $f20,0x200($sp) -/* f1348a8: 0fc59e66 */ jal func0f167998 +/* f1348a8: 0fc59e66 */ jal gfxAllocateMatrix /* f1348ac: e7b40204 */ swc1 $f20,0x204($sp) /* f1348b0: 00408825 */ or $s1,$v0,$zero /* f1348b4: 02002025 */ or $a0,$s0,$zero diff --git a/src/include/game/bondmove.h b/src/include/game/bondmove.h index 3e9cbec48..76a8bf104 100644 --- a/src/include/game/bondmove.h +++ b/src/include/game/bondmove.h @@ -38,7 +38,7 @@ void currentPlayerUpdateMoveInitSpeed(struct coord *newpos); void currentPlayerUpdateFootsteps(bool arg0, bool arg1, bool arg2, bool arg3); void func0f0cbf50(void); void func0f0cc19c(struct coord *arg); -void func0f0cc3b8(f32 arg0, f32 arg1, f32 arg2, f32 *arg3, f32 arg4); +void func0f0cc3b8(f32 arg0, f32 arg1, f32 arg2, Mtxf *arg3, f32 arg4); void func0f0cc654(f32 arg0, f32 arg1, f32 arg2); s32 currentPlayerGetCrouchPos(void); s32 playerGetCrouchPos(s32 playernum); diff --git a/src/include/game/game_096ca0.h b/src/include/game/game_096ca0.h index c57f4aa51..61ce8c79e 100644 --- a/src/include/game/game_096ca0.h +++ b/src/include/game/game_096ca0.h @@ -4,8 +4,8 @@ #include "types.h" u32 func0f096ca0(void); -void func0f096ed4(f32 *arg0, f32 *arg1); -void func0f097044(f32 *matrix, f32 *arg1); +void func0f096ed4(f32 *arg0, Mtxf *arg1); +void func0f097044(Mtxf *matrix, f32 *arg1); u32 func0f097264(void); void func0f0972b8(f32 *arg0, f32 *arg1, f32 arg2, f32 *arg3); u32 func0f097518(void); diff --git a/src/include/game/game_097ba0.h b/src/include/game/game_097ba0.h index f91e5db7e..5595d9e83 100644 --- a/src/include/game/game_097ba0.h +++ b/src/include/game/game_097ba0.h @@ -68,9 +68,9 @@ u32 func0f09e4e0(void); u32 func0f09ea90(void); bool func0f09eae4(void); u32 func0f09ebbc(void); -void func0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, f32 *matrix1, f32 *arg4, f32 *matrix2, struct prop *prop, struct coord *pos); +void func0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf *matrix1, f32 *arg4, Mtxf *matrix2, struct prop *prop, struct coord *pos); u32 func0f09ed2c(void); -void func0f09ee18(struct chrdata *chr, u8 *arg1, struct coord *pos, s16 *rooms, f32 *arg4, struct coord *arg5); +void func0f09ee18(struct chrdata *chr, u8 *arg1, struct coord *pos, s16 *rooms, Mtxf *arg4, struct coord *arg5); u32 func0f09f100(void); u32 func0f09f848(void); u32 func0f09f974(void); diff --git a/src/include/game/game_0b3350.h b/src/include/game/game_0b3350.h index d95efd2f0..9beac94c7 100644 --- a/src/include/game/game_0b3350.h +++ b/src/include/game/game_0b3350.h @@ -22,32 +22,32 @@ void func0f0b4d68(struct coord *in, struct coord *out); void func0f0b4dec(struct coord *in, struct coord *out); void func0f0b4e68(struct coord *in, f32 divisor, struct coord *out); void func0f0b4eb8(struct coord *arg0, f32 arg1[2], f32 zoom, f32 aspect); -void currentPlayerSetUnk1738(u32 value); -void currentPlayerSetUnk173c(u32 value); -u32 currentPlayerGetUnk173c(void); -void currentPlayerSetUnk006c(u32 value); -u32 currentPlayerGetUnk006c(void); +void currentPlayerSetUnk1738(void *matrix); +void currentPlayerSetUnk173c(Mtx *matrix); +Mtx *currentPlayerGetUnk173c(void); +void currentPlayerSetUnk006c(Mtxf *matrix); +Mtxf *currentPlayerGetUnk006c(void); void currentPlayerSetUnk1750(void *value); void *currentPlayerGetUnk1750(void); -void currentPlayerSetUnk1758(u32 value); -u32 currentPlayerGetUnk1758(void); -void currentPlayerSetMatrix(f32 *value); +void currentPlayerSetUnk1758(Mtx *matrix); +Mtx *currentPlayerGetUnk1758(void); +void currentPlayerSetMatrix1740(Mtxf *value); u32 func0f0b5050(void); u32 func0f0b53a4(void); -f32 *currentPlayerGetMatrix(void); -void currentPlayerSetUnk1754(u32 value); -u32 currentPlayerGetUnk1754(void); -void currentPlayerSetUnk174c(u32 value); -u32 currentPlayerGetUnk174c(void); -void currentPlayerSetUnk175c(u32 value); -u32 currentPlayerGetUnk175c(void); +Mtxf *currentPlayerGetMatrix1740(void); +void currentPlayerSetUnk1754(Mtxf *matrix); +Mtxf *currentPlayerGetUnk1754(void); +void currentPlayerSetUnk174c(Mtxf *matrix); +Mtxf *currentPlayerGetUnk174c(void); +void currentPlayerSetUnk175c(void *value); +void *currentPlayerGetUnk175c(void); f32 currentPlayerGetLodScaleZ(void); f32 currentPlayerGetScreenWidth(void); f32 currentPlayerGetScreenHeight(void); f32 currentPlayerGetScreenLeft(void); f32 currentPlayerGetScreenTop(void); f32 currentPlayerGetPerspAspect(void); -u32 func0f0b5838(void); +void func0f0b5838(void); u32 func0f0b5b9c(void); u32 func0f0b5d38(void); u32 func0f0b6260(void); diff --git a/src/include/game/game_166e40.h b/src/include/game/game_166e40.h index 378134128..84b810011 100644 --- a/src/include/game/game_166e40.h +++ b/src/include/game/game_166e40.h @@ -21,8 +21,8 @@ void func0f167330(void); void func0f167350(void); Gfx *func0f16793c(void); struct gfxvtx *gfxAllocateVertices(s32 count); -u32 func0f167998(void); -u32 func0f1679b0(void); +void *gfxAllocateMatrix(void); +void *gfxAllocate4Words(s32 count); u32 *gfxAllocateColours(s32 count); struct model0c *func0f1679f4(s32 arg0); void func0f167a18(void); diff --git a/src/include/game/propobj.h b/src/include/game/propobj.h index a17517dfd..98607a4a3 100644 --- a/src/include/game/propobj.h +++ b/src/include/game/propobj.h @@ -89,7 +89,7 @@ u32 func0f06a52c(void); struct prop *func0f06a550(struct singlemonitorobj *monitor); u32 func0f06a580(void); f32 func0f06a620(struct defaultobj *obj); -void func0f06a730(struct defaultobj *obj, struct pad *newpad, f32 *matrix, s16 *arg3, struct pad *arg4); +void func0f06a730(struct defaultobj *obj, struct pad *newpad, Mtxf *matrix, s16 *arg3, struct pad *arg4); u32 func0f06ab60(void); void func0f06ac40(struct defaultobj *obj); void func0f06ac90(struct prop *prop); diff --git a/src/include/lib/lib_04320.h b/src/include/lib/lib_04320.h index 8afd185b0..ed8e7184c 100644 --- a/src/include/lib/lib_04320.h +++ b/src/include/lib/lib_04320.h @@ -4,6 +4,6 @@ #include "types.h" u32 func00004320(void); -u32 func0000470c(void); +void func0000470c(f32 *matrix, void *arg1, f32 posx, f32 posy, f32 posz, f32 lookx, f32 looky, f32 lookz, f32 upx, f32 upy, f32 upz); #endif diff --git a/src/include/lib/lib_04840.h b/src/include/lib/lib_04840.h index 4023b2cb6..d4d390cf5 100644 --- a/src/include/lib/lib_04840.h +++ b/src/include/lib/lib_04840.h @@ -4,6 +4,6 @@ #include "types.h" u32 func00004840(void); -void func00004a24(u32 arg0, u16 *arg1, f32 fovy, f32 arg3, f32 arg4, f32 arg5, f32 arg6); +void func00004a24(f32 *matrix, u16 *arg1, f32 fovy, f32 arg3, f32 arg4, f32 arg5, f32 arg6); #endif diff --git a/src/include/lib/lib_159b0.h b/src/include/lib/lib_159b0.h index 6b435fb77..4a4e8573f 100644 --- a/src/include/lib/lib_159b0.h +++ b/src/include/lib/lib_159b0.h @@ -3,30 +3,30 @@ #include #include "types.h" -void func000159b0(f32 *matrix); -void func000159fc(f32 *matrix, f32 *arg1); -void func00015a00(f32 *matrix, f32 *arg1, f32 *arg2); -void func00015b10(f32 *matrix, struct coord *coord); +void func000159b0(Mtxf *matrix); +void func000159fc(Mtxf *matrix, Mtxf *arg1); +void func00015a00(Mtxf *matrix, Mtxf *arg1, Mtxf *arg2); +void func00015b10(Mtxf *matrix, struct coord *coord); void func00015b14(f32 *matrix, f32 *coord, struct coord *arg2); -void func00015b64(f32 *arg0, struct coord *coord); -void func00015b68(f32 *matrix, struct coord *arg1, struct coord *arg2); -void func00015be0(f32 *matrix1, f32 *matrix2); -void func00015be4(u32 arg0, struct model0c *model0c, f32 *arg2); +void func00015b64(Mtxf *arg0, struct coord *coord); +void func00015b68(Mtxf *matrix, struct coord *arg1, struct coord *arg2); +void func00015be0(Mtxf *matrix1, Mtxf *matrix2); +void func00015be4(Mtxf *arg0, struct model0c *model0c, Mtxf *arg2); void func00015cd8(f32 *arg0, f32 *realrot); u32 func00015d18(void); -void func00015d54(f32 *realrot, f32 *matrix); -void func00015da0(f32 *arg0, f32 *arg1); -void func00015dd4(struct coord *pos, f32 *matrix); +void func00015d54(f32 *realrot, Mtxf *matrix); +void func00015da0(Mtxf *arg0, f32 *arg1); +void func00015dd4(struct coord *pos, Mtxf *matrix); u32 func00015df0(void); void func00015e24(f32 mult, f32 *matrix); u32 func00015e4c(void); void func00015e80(f32 mult, f32 *matrix); u32 func00015ea8(void); void func00015edc(f32 mult, f32 *matrix); -void func00015f04(f32 arg0, f32 *arg1); +void func00015f04(f32 scale, Mtxf *arg1); u32 func00015f4c(void); u32 func00015f88(void); u32 func00015fd0(void); -void func00016054(f32 *matrix, u32 arg1); +void func00016054(f32 *matrix, f32 *arg1); #endif diff --git a/src/include/lib/lib_16110.h b/src/include/lib/lib_16110.h index 47285b886..9b743f075 100644 --- a/src/include/lib/lib_16110.h +++ b/src/include/lib/lib_16110.h @@ -9,9 +9,9 @@ u32 func00016140(void); void func000161b0(f32 *matrix, f32 src[3], f32 dest[3]); void func00016208(f32 *matrix, struct coord *coord); void func00016248(struct coord *coord, f32 angle, f32 *matrix); -void func000162e8(f32 angle, f32 *matrix); -void func00016374(f32 angle, f32 *matrix); -void func00016400(f32 angle, f32 *matrix); +void func000162e8(f32 angle, Mtxf *matrix); +void func00016374(f32 angle, Mtxf *matrix); +void func00016400(f32 angle, Mtxf *matrix); void func0001648c(struct coord *coord, f32 *dest); u32 func000165d8(void); u32 func000166a4(void); @@ -21,11 +21,11 @@ void func00016748(f32 arg0); u32 func00016760(void); u32 func00016784(void); u32 func00016798(void); -u32 func00016820(void); -u32 func00016874(void); +void func00016820(Mtx *arg0, Mtx *arg1); +void func00016874(Mtxf *matrix, f32 posx, f32 posy, f32 posz, f32 lookx, f32 looky, f32 lookz, f32 upx, f32 upy, f32 upz); void func00016ae4(f32 *matrix, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9); -void func00016b58(f32 *matrix, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9); -void func00016d58(f32 *matrix, f32 posx, f32 posy, f32 posz, f32 lookx, f32 looky, f32 lookz, f32 upx, f32 upy, f32 upz); +void func00016b58(Mtxf *matrix, f32 posx, f32 posy, f32 posz, f32 lookx, f32 looky, f32 lookz, f32 upx, f32 upy, f32 upz); +void func00016d58(Mtxf *matrix, f32 posx, f32 posy, f32 posz, f32 lookx, f32 looky, f32 lookz, f32 upx, f32 upy, f32 upz); u32 func00016dcc(void); u32 func00016e98(void); u32 func00017028(void); diff --git a/src/include/lib/lib_4a360.h b/src/include/lib/lib_4a360.h index cf87d6396..5ecfa3133 100644 --- a/src/include/lib/lib_4a360.h +++ b/src/include/lib/lib_4a360.h @@ -3,7 +3,7 @@ #include #include "types.h" -u32 func0004a360(void); +void func0004a360(Mtxf *arg0, Mtx *arg1); u32 func0004a460(void); f32 sqrtf(f32 value); diff --git a/src/include/types.h b/src/include/types.h index e9fc8ac3a..0fc694c9a 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -7,6 +7,15 @@ #define bool s32 #define ubool u32 +// Float version of a graphics matrix, which has higher precision than an Mtx. +// Matrices are stored as Mtxfs then converted to an Mtx when passed to the GPU. +// Mtxs use a union and a long long int to force alignments. Mtxfs are not +// aligned but still use the union for consistency with Mtx. +typedef union { + f32 m[4][4]; + s32 unused; +} Mtxf; + struct coord { f32 x; f32 y; @@ -1246,7 +1255,7 @@ struct cameraobj { // objtype 0x06 // Note y is being used as an abbreviation for yaw /*0x5c*/ s16 lookatpadnum; /*0x5e*/ s16 toleft; - /*0x60*/ f32 camrotm[16]; + /*0x60*/ Mtxf camrotm; /*0xa0*/ f32 yzero; /*0xa4*/ f32 yrot; /*0xa8*/ f32 yleft; @@ -2192,11 +2201,11 @@ struct player { /*0x0038*/ struct coord globaldrawworldoffset; /*0x0044*/ struct coord globaldrawcameraoffset; /*0x0050*/ struct coord globaldrawworldbgoffset; - /*0x005c*/ f32 *matrix5c; - /*0x0060*/ u32 unk0060; - /*0x0064*/ u32 unk0064; - /*0x0068*/ u32 unk0068; - /*0x006c*/ u32 unk006c; + /*0x005c*/ Mtx *matrix5c; + /*0x0060*/ Mtx *matrix60; + /*0x0064*/ Mtxf *matrix64; + /*0x0068*/ Mtxf *matrix68; + /*0x006c*/ Mtxf *matrix6c; /*0x0070*/ f32 sumground; /*0x0074*/ f32 vv_manground; // Feet Y value in absolute coordinates /*0x0078*/ f32 vv_ground; // Ground Y value in absolute coordinates @@ -2597,19 +2606,19 @@ struct player { /*0x172c*/ f32 c_scaley; /*0x1730*/ f32 c_recipscalex; /*0x1734*/ f32 c_recipscaley; - /*0x1738*/ u32 unk1738; - /*0x173c*/ u32 unk173c; - /*0x1740*/ f32 *matrix; + /*0x1738*/ void *unk1738; + /*0x173c*/ Mtx *unk173c; + /*0x1740*/ Mtxf *matrix1740; /*0x1744*/ u32 unk1744; /*0x1748*/ u32 unk1748; - /*0x174c*/ u32 unk174c; + /*0x174c*/ Mtxf *unk174c; /*0x1750*/ void *unk1750; - /*0x1754*/ u32 unk1754; - /*0x1758*/ u32 unk1758; - /*0x175c*/ u32 unk175c; - /*0x1760*/ f32 *prevmatrix; + /*0x1754*/ Mtxf *unk1754; + /*0x1758*/ Mtx *unk1758; + /*0x175c*/ void *unk175c; + /*0x1760*/ Mtxf *prev1740; /*0x1764*/ u32 unk1764; - /*0x1768*/ u32 unk1768; + /*0x1768*/ Mtxf *unk1768; /*0x176c*/ f32 c_scalelod60; /*0x1770*/ f32 c_scalelod; /*0x1774*/ f32 c_lodscalez; @@ -2721,7 +2730,7 @@ struct player { /*0x1a88*/ u32 bondentertheta; /*0x1a8c*/ u32 bondenterverta; /*0x1a90*/ struct coord bondenterpos; - /*0x1a9c*/ f32 bondentermtx[16]; + /*0x1a9c*/ Mtxf bondentermtx; /*0x1adc*/ struct coord bondenteraim; /*0x1ae8*/ f32 bondonground; /*0x1aec*/ u32 unk1aec; @@ -2729,7 +2738,7 @@ struct player { /*0x1af4*/ u32 unk1af4; /*0x1af8*/ s32 walkinitmove; /*0x1afc*/ struct coord walkinitpos; - /*0x1b08*/ f32 walkinitmtx[16]; + /*0x1b08*/ Mtxf walkinitmtx; /*0x1b48*/ f32 walkinitt; /*0x1b4c*/ f32 walkinitt2; /*0x1b50*/ struct coord walkinitstart; @@ -5917,7 +5926,7 @@ struct animheader { }; struct objticksp476 { - /*0x00*/ f32 *matrix; + /*0x00*/ Mtxf *matrix; /*0x04*/ u32 unk04; /*0x08*/ u32 unk08; /*0x0c*/ u32 unk0c; diff --git a/src/lib/lib_09660.c b/src/lib/lib_09660.c index f45ba7af9..55249ee89 100644 --- a/src/lib/lib_09660.c +++ b/src/lib/lib_09660.c @@ -1594,7 +1594,7 @@ glabel func0000ab78 /* abb8: e7a60014 */ swc1 $f6,0x14($sp) /* abbc: 0c001210 */ jal func00004840 /* abc0: e7a80018 */ swc1 $f8,0x18($sp) -/* abc4: 0fc2d5be */ jal currentPlayerGetMatrix +/* abc4: 0fc2d5be */ jal currentPlayerGetMatrix1740 /* abc8: 00000000 */ nop /* abcc: 00402025 */ or $a0,$v0,$zero /* abd0: 0c005746 */ jal func00015d18 @@ -1607,7 +1607,7 @@ glabel func0000ab78 /* abec: e7a000c4 */ swc1 $f0,0xc4($sp) /* abf0: 0c005680 */ jal func00015a00 /* abf4: e7a000c8 */ swc1 $f0,0xc8($sp) -/* abf8: 0fc59e66 */ jal func0f167998 +/* abf8: 0fc59e66 */ jal gfxAllocateMatrix /* abfc: 00000000 */ nop /* ac00: afa2004c */ sw $v0,0x4c($sp) /* ac04: 27a400d0 */ addiu $a0,$sp,0xd0 @@ -1615,7 +1615,7 @@ glabel func0000ab78 /* ac0c: 00402825 */ or $a1,$v0,$zero /* ac10: 0c00566c */ jal func000159b0 /* ac14: 27a40050 */ addiu $a0,$sp,0x50 -/* ac18: 0fc59e66 */ jal func0f167998 +/* ac18: 0fc59e66 */ jal gfxAllocateMatrix /* ac1c: 00000000 */ nop /* ac20: afa20048 */ sw $v0,0x48($sp) /* ac24: 27a40050 */ addiu $a0,$sp,0x50 @@ -1659,7 +1659,7 @@ glabel func0000aca4 /* acac: afb00028 */ sw $s0,0x28($sp) /* acb0: 00808025 */ or $s0,$a0,$zero /* acb4: afa5008c */ sw $a1,0x8c($sp) -/* acb8: 0fc59e66 */ jal func0f167998 +/* acb8: 0fc59e66 */ jal gfxAllocateMatrix /* acbc: afa60090 */ sw $a2,0x90($sp) /* acc0: 3c038006 */ lui $v1,%hi(g_ViData) /* acc4: 8c63d594 */ lw $v1,%lo(g_ViData)($v1) @@ -1754,7 +1754,7 @@ glabel func0000ad5c /* ae18: 0009c100 */ sll $t8,$t1,0x4 /* ae1c: 03057821 */ addu $t7,$t8,$a1 /* ae20: 01e15021 */ addu $t2,$t7,$at -/* ae24: 0fc59e66 */ jal func0f167998 +/* ae24: 0fc59e66 */ jal gfxAllocateMatrix /* ae28: ac8a0004 */ sw $t2,0x4($a0) /* ae2c: 3c088006 */ lui $t0,%hi(g_ViData) /* ae30: 3c018009 */ lui $at,%hi(var80092870) @@ -1880,7 +1880,7 @@ glabel func0000af00 /* b000: 000a6100 */ sll $t4,$t2,0x4 /* b004: 01857021 */ addu $t6,$t4,$a1 /* b008: 01c15821 */ addu $t3,$t6,$at -/* b00c: 0fc59e66 */ jal func0f167998 +/* b00c: 0fc59e66 */ jal gfxAllocateMatrix /* b010: ac8b0004 */ sw $t3,0x4($a0) /* b014: 3c088006 */ lui $t0,%hi(g_ViData) /* b018: 3c018009 */ lui $at,%hi(var80092870) @@ -1944,7 +1944,7 @@ glabel func0000b0e8 /* b0f0: afb00028 */ sw $s0,0x28($sp) /* b0f4: 00808025 */ or $s0,$a0,$zero /* b0f8: afa50084 */ sw $a1,0x84($sp) -/* b0fc: 0fc59e66 */ jal func0f167998 +/* b0fc: 0fc59e66 */ jal gfxAllocateMatrix /* b100: afa60088 */ sw $a2,0x88($sp) /* b104: 3c038006 */ lui $v1,%hi(g_ViData) /* b108: 8c63d594 */ lw $v1,%lo(g_ViData)($v1) diff --git a/src/lib/lib_16110.c b/src/lib/lib_16110.c index e793e47bb..4269464bd 100644 --- a/src/lib/lib_16110.c +++ b/src/lib/lib_16110.c @@ -147,82 +147,82 @@ void func00016248(struct coord *coord, f32 angle, f32 *matrix) matrix[15] = 1; } -void func000162e8(f32 angle, f32 *matrix) +void func000162e8(f32 angle, Mtxf *matrix) { f32 cos = cosf(angle); f32 sin = sinf(angle); - matrix[0] = 1; - matrix[1] = 0; - matrix[2] = 0; - matrix[3] = 0; + matrix->m[0][0] = 1; + matrix->m[0][1] = 0; + matrix->m[0][2] = 0; + matrix->m[0][3] = 0; - matrix[4] = 0; - matrix[5] = cos; - matrix[6] = sin; - matrix[7] = 0; + matrix->m[1][0] = 0; + matrix->m[1][1] = cos; + matrix->m[1][2] = sin; + matrix->m[1][3] = 0; - matrix[8] = 0; - matrix[9] = -sin; - matrix[10] = cos; - matrix[11] = 0; + matrix->m[2][0] = 0; + matrix->m[2][1] = -sin; + matrix->m[2][2] = cos; + matrix->m[2][3] = 0; - matrix[12] = 0; - matrix[13] = 0; - matrix[14] = 0; - matrix[15] = 1; + matrix->m[3][0] = 0; + matrix->m[3][1] = 0; + matrix->m[3][2] = 0; + matrix->m[3][3] = 1; } -void func00016374(f32 angle, f32 *matrix) +void func00016374(f32 angle, Mtxf *matrix) { f32 cos = cosf(angle); f32 sin = sinf(angle); - matrix[0] = cos; - matrix[1] = 0; - matrix[2] = -sin; - matrix[3] = 0; + matrix->m[0][0] = cos; + matrix->m[0][1] = 0; + matrix->m[0][2] = -sin; + matrix->m[0][3] = 0; - matrix[4] = 0; - matrix[5] = 1; - matrix[6] = 0; - matrix[7] = 0; + matrix->m[1][0] = 0; + matrix->m[1][1] = 1; + matrix->m[1][2] = 0; + matrix->m[1][3] = 0; - matrix[8] = sin; - matrix[9] = 0; - matrix[10] = cos; - matrix[11] = 0; + matrix->m[2][0] = sin; + matrix->m[2][1] = 0; + matrix->m[2][2] = cos; + matrix->m[2][3] = 0; - matrix[12] = 0; - matrix[13] = 0; - matrix[14] = 0; - matrix[15] = 1; + matrix->m[3][0] = 0; + matrix->m[3][1] = 0; + matrix->m[3][2] = 0; + matrix->m[3][3] = 1; } -void func00016400(f32 angle, f32 *matrix) +void func00016400(f32 angle, Mtxf *matrix) { f32 cos = cosf(angle); f32 sin = (float)sinf(angle); - matrix[0] = cos; - matrix[1] = sin; - matrix[2] = 0; - matrix[3] = 0; + matrix->m[0][0] = cos; + matrix->m[0][1] = sin; + matrix->m[0][2] = 0; + matrix->m[0][3] = 0; - matrix[4] = -sin; - matrix[5] = cos; - matrix[6] = 0; - matrix[7] = 0; + matrix->m[1][0] = -sin; + matrix->m[1][1] = cos; + matrix->m[1][2] = 0; + matrix->m[1][3] = 0; - matrix[8] = 0; - matrix[9] = 0; - matrix[10] = 1; - matrix[11] = 0; + matrix->m[2][0] = 0; + matrix->m[2][1] = 0; + matrix->m[2][2] = 1; + matrix->m[2][3] = 0; - matrix[12] = 0; - matrix[13] = 0; - matrix[14] = 0; - matrix[15] = 1; + matrix->m[3][0] = 0; + matrix->m[3][1] = 0; + matrix->m[3][2] = 0; + matrix->m[3][3] = 1; } void func0001648c(struct coord *src, f32 *dest)