Prepare mult_matrix function

This commit is contained in:
Jaby
2024-01-28 21:23:06 -05:00
parent 99a4fa8ab1
commit 0e989ee703
2 changed files with 63 additions and 1 deletions

View File

@@ -55,6 +55,38 @@ namespace JabyEngine {
__asm__ volatile("ctc2 $14, $7" :: "r"(&matrix) : "$12", "$13", "$14");
}
/*
MulMatrix0
m0: first input
m1: second input
result: result of multiplication
returns: result
Multiplies two matrices m0 and m1.
The function destroys the constant rotation matrix
*/
static MATRIX& mult_matrix(const MATRIX& m0, const MATRIX& m1, MATRIX& result) {
/*
Jaby: Somehow this code creates stack usage.... Investigate!!
*/
set_rot_matrix(m0);
ldclmv(m1, 0);
rtir();
stclmv(result, 0);
ldclmv(m1, 1);
rtir();
stclmv(result, 1);
ldclmv(m1, 2);
rtir();
stclmv(result, 2);
return result;
}
/*
SetGeomOffset(ofx,ofy)