Add sin/cos support

This commit is contained in:
Jaby
2024-01-31 21:29:57 -05:00
committed by Jaby
parent df59d26900
commit 8aeb3a6c31
5 changed files with 79 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ namespace JabyEngine {
output: Output vector
flag: flag output
*/
void rot_trans(const SVECTOR& input, VECTOR& output, int32_t& flag) {
static void rot_trans(const SVECTOR& input, VECTOR& output, int32_t& flag) {
ldv0(input);
rt();
stlvnl(output);
@@ -28,7 +28,7 @@ namespace JabyEngine {
Sets a 3x3 matrix m as a constant rotation matrix.
matrix: The rotation matrix to set
*/
void set_rot_matrix(const MATRIX& matrix) {
static void set_rot_matrix(const MATRIX& matrix) {
__asm__ volatile("lw $12, 0(%0)" :: "r"(&matrix) : "$12", "$13", "$14");
__asm__ volatile("lw $13, 4(%0)" :: "r"(&matrix) : "$12", "$13", "$14");
__asm__ volatile("ctc2 $12, $0" :: "r"(&matrix) : "$12", "$13", "$14");
@@ -46,7 +46,7 @@ namespace JabyEngine {
Sets a constant parallel transfer vector specified by m
*/
void set_trans_matrix(const MATRIX& matrix) {
static void set_trans_matrix(const MATRIX& matrix) {
__asm__ volatile("lw $12, 20(%0)" :: "r"(&matrix) : "$12", "$13", "$14");
__asm__ volatile("lw $13, 24(%0)" :: "r"(&matrix) : "$12", "$13", "$14");
__asm__ volatile("ctc2 $12, $5" :: "r"(&matrix) : "$12", "$13", "$14");
@@ -73,7 +73,7 @@ namespace JabyEngine {
Load GTE-offset.
*/
void set_geom_offset(int32_t off_x, int32_t off_y) {
static void set_geom_offset(int32_t off_x, int32_t off_y) {
__asm__ volatile("sll $12, %0, 16" :: "r"(off_x), "r"(off_y) : "$12", "$13");
__asm__ volatile("sll $13, %1, 16" :: "r"(off_x), "r"(off_y) : "$12", "$13");
__asm__ volatile("ctc2 $12, $24" :: "r"(off_x), "r"(off_y) : "$12", "$13");
@@ -85,7 +85,7 @@ namespace JabyEngine {
Load distance from viewpoint to screen.
*/
void set_geom_screen(int32_t h) {
static void set_geom_screen(int32_t h) {
__asm__ volatile("ctc2 %0, $26" :: "r"(h));
}
}