Add const to JSystem mtx src params, fixing a regalloc

This commit is contained in:
LagoLunatic
2026-09-28 18:32:12 -04:00
parent f18cb581a6
commit b946ec975f
7 changed files with 12 additions and 14 deletions
+2 -2
View File
@@ -38,8 +38,8 @@ void J3DGetTextureMtxMayaOld(const J3DTextureSRTInfo&, Mtx);
void J3DScaleNrmMtx(Mtx, const Vec&);
void J3DScaleNrmMtx33(Mtx33, const Vec&);
void J3DMtxProjConcat(Mtx, Mtx, Mtx);
void J3DPSMtx33Copy(Mtx3P src, Mtx3P dst);
void J3DPSMtx33CopyFrom34(MtxP src, Mtx3P dst);
void J3DPSMtx33Copy(const Mtx3P src, Mtx3P dst);
void J3DPSMtx33CopyFrom34(const MtxP src, Mtx3P dst);
void J3DPSMtxArrayConcat(Mtx, Mtx, Mtx, u32);
inline void J3DPSMulMtxVec(__REGISTER MtxP mtx, __REGISTER Vec* vec, __REGISTER Vec* dst) {
-1
View File
@@ -131,7 +131,6 @@ public:
static void copyMemory(void* dst, void* src, u32 size);
static void fillMemory(void* dst, u32 size, u8 value); // NOTE: never used
static bool checkMemoryFilled(void* src, u32 size, u8 value);
static JKRErrorHandler setErrorHandler(JKRErrorHandler errorHandler);
+2 -2
View File
@@ -212,10 +212,10 @@ public:
u8 getGlobalAlpha() { return mGlobalPrmColor.a; }
void setGlobalAlpha(u8 alpha) { mGlobalPrmColor.a = alpha; }
void setGlobalRTMatrix(MtxP mtx) {
void setGlobalRTMatrix(const MtxP mtx) {
JPASetRMtxTVecfromMtx(mtx, mGlobalRotation, mGlobalTranslation);
}
void setGlobalSRTMatrix(MtxP mtx) {
void setGlobalSRTMatrix(const MtxP mtx) {
JPASetRMtxSTVecfromMtx(mtx, mGlobalRotation, mGlobalDynamicsScale, mGlobalTranslation);
}
void setGlobalRotation(const JGeometry::TVec3<s16>& rot) {
+3 -3
View File
@@ -8,9 +8,9 @@
void JPAGetYZRotateMtx(s16, s16, Mtx);
void JPAGetXYZRotateMtx(s16, s16, s16, Mtx);
void JPAGetDirMtx(const JGeometry::TVec3<f32>&, Mtx);
void JPASetSVecfromMtx(Mtx, JGeometry::TVec3<f32>&);
void JPASetRMtxTVecfromMtx(Mtx, Mtx, JGeometry::TVec3<f32>&);
void JPASetRMtxSTVecfromMtx(Mtx, Mtx, JGeometry::TVec3<f32>&, JGeometry::TVec3<f32>&);
void JPASetSVecfromMtx(const MtxP, JGeometry::TVec3<f32>&);
void JPASetRMtxTVecfromMtx(const MtxP, Mtx, JGeometry::TVec3<f32>&);
void JPASetRMtxSTVecfromMtx(const MtxP, Mtx, JGeometry::TVec3<f32>&, JGeometry::TVec3<f32>&);
f32 JPAGetKeyFrameValue(f32, u16, const f32*);
void JPAGetUnitVec(s16, s16, JGeometry::TVec3<f32>&);
+2 -2
View File
@@ -470,7 +470,7 @@ void J3DMtxProjConcat(__REGISTER Mtx a, __REGISTER Mtx b, __REGISTER Mtx dst) {
}
/* 802DACE0-802DAD0C .text J3DPSMtx33Copy__FPA3_fPA3_f */
void J3DPSMtx33Copy(__REGISTER Mtx3P src, __REGISTER Mtx3P dst) {
void J3DPSMtx33Copy(__REGISTER const Mtx3P src, __REGISTER Mtx3P dst) {
__REGISTER f32 x1_y1;
__REGISTER f32 z1_x2;
__REGISTER f32 y2_z2;
@@ -494,7 +494,7 @@ asm {
}
/* 802DAD0C-802DAD40 .text J3DPSMtx33CopyFrom34__FPA4_fPA3_f */
void J3DPSMtx33CopyFrom34(__REGISTER MtxP src, __REGISTER Mtx3P dst) {
void J3DPSMtx33CopyFrom34(__REGISTER const MtxP src, __REGISTER Mtx3P dst) {
#ifdef __MWERKS__
asm {
psq_l f0, 0(src), 0, 0
+3 -3
View File
@@ -94,7 +94,7 @@ void JPAGetDirMtx(const JGeometry::TVec3<f32>& dir, Mtx dst) {
}
/* 80259B6C-80259C90 .text JPASetSVecfromMtx__FPA4_fRQ29JGeometry8TVec3<f> */
void JPASetSVecfromMtx(Mtx mtx, JGeometry::TVec3<f32>& scale) {
void JPASetSVecfromMtx(const MtxP mtx, JGeometry::TVec3<f32>& scale) {
f32 m00 = mtx[0][0], m10 = mtx[1][0], m20 = mtx[2][0];
scale.x = JGeometry::TUtil<f32>::sqrt(m00*m00 + m10*m10 + m20*m20);
@@ -106,13 +106,13 @@ void JPASetSVecfromMtx(Mtx mtx, JGeometry::TVec3<f32>& scale) {
}
/* 80259C90-80259CB8 .text JPASetRMtxTVecfromMtx__FPA4_fPA4_fRQ29JGeometry8TVec3<f> */
void JPASetRMtxTVecfromMtx(Mtx src, Mtx dst, JGeometry::TVec3<f32>& translate) {
void JPASetRMtxTVecfromMtx(const MtxP src, Mtx dst, JGeometry::TVec3<f32>& translate) {
JGeometry::TVec3<f32> scale;
JPASetRMtxSTVecfromMtx(src, dst, scale, translate);
}
/* 80259CB8-80259DD0 .text JPASetRMtxSTVecfromMtx__FPA4_fPA4_fRQ29JGeometry8TVec3<f>RQ29JGeometry8TVec3<f> */
void JPASetRMtxSTVecfromMtx(Mtx src, Mtx dst, JGeometry::TVec3<f32>& scale, JGeometry::TVec3<f32>& translate) {
void JPASetRMtxSTVecfromMtx(const MtxP src, Mtx dst, JGeometry::TVec3<f32>& scale, JGeometry::TVec3<f32>& translate) {
JPASetSVecfromMtx(src, scale);
MTXIdentity(dst);
if (scale.x != 0.0f) {
-1
View File
@@ -181,7 +181,6 @@ static void asi_hamon_set(bgn2_class* i_this) {
/* 00000D88-00000FA8 .text attack_eff_set__FP10bgn2_class4cXyz */
static void attack_eff_set(bgn2_class* i_this, cXyz param_2) {
/* Nonmatching - retail-only regalloc */
#if VERSION == VERSION_DEMO
fopAc_ac_c* actor = &i_this->actor;
#endif