move jasper's jsystem work over

This commit is contained in:
TakaRikka
2022-10-04 21:17:53 -07:00
parent a3578d0c7c
commit 74c248990c
37 changed files with 153 additions and 1292 deletions
+26
View File
@@ -19,6 +19,18 @@ struct TVec3 {
}
};
template <>
struct TVec3<s16> {
s16 x, y, z;
TVec3& operator=(const TVec3& b) {
// Force copies to use lwz/lha
*((s32*)this) = *((s32*)&b);
z = b.z;
return *this;
}
};
template <>
struct TVec3<f32> {
f32 x;
@@ -47,6 +59,20 @@ struct TVec3<f32> {
y = a.y * b.y;
z = a.z * b.z;
}
inline TVec3<f32>& operator=(const TVec3<f32>& b) {
register f32* dst = &x;
const register f32* src = &b.x;
register f32 x_y;
register f32 z;
asm {
psq_l x_y, 0(src), 0, 0
psq_st x_y, 0(dst), 0, 0
lfs z, 8(src)
stfs z, 8(dst)
};
return *this;
}
};
template <typename T>