Support ApplyMatrix

This commit is contained in:
2024-04-02 16:08:24 -05:00
parent 87f71a6c61
commit 57e1a17dd2
5 changed files with 52 additions and 11 deletions

View File

@@ -55,6 +55,17 @@ namespace JabyEngine {
__asm__ volatile("swc2 $27, 8(%0)" :: "r"(&out_vector) : "memory");
}
// Modify to store in VERTEX?
// Store SVECTOR from 16 bit universal register
static __always_inline void stsv(SVECTOR& out_vector) {
__asm__ volatile("mfc2 $12, $9" :: "r"(&out_vector) : "$12", "$13", "$14", "memory");
__asm__ volatile("mfc2 $13, $10" :: "r"(&out_vector) : "$12", "$13", "$14", "memory");
__asm__ volatile("mfc2 $14, $11" :: "r"(&out_vector) : "$12", "$13", "$14", "memory");
__asm__ volatile("sh $12, 0(%0)" :: "r"(&out_vector) : "$12", "$13", "$14", "memory");
__asm__ volatile("sh $13, 2(%0)" :: "r"(&out_vector) : "$12", "$13", "$14", "memory");
__asm__ volatile("sh $14, 4(%0)" :: "r"(&out_vector) : "$12", "$13", "$14", "memory");
}
/*
Kernel of RotTrans
(Transfer vector)+(Rotation Matrix)*(vertex register 0)
@@ -65,6 +76,16 @@ namespace JabyEngine {
__asm__ volatile("cop2 0x0480012");
}
/*
Variation of gte_rt
(Rotation Matrix)*(vertex register 0).
*/
static __always_inline void rtv0() {
__asm__ volatile("nop;");
__asm__ volatile("nop;");
__asm__ volatile("cop2 0x0486012;");
}
/*
Variation of gte_rt
(Rotation Matrix)*(16 bit universal vector)