prepping to setup gte.h with similar setup to gp.h, maybe with more lessons from color forth learnings..

This commit is contained in:
2026-05-31 23:26:43 -04:00
parent d2d47ac8a4
commit 8b5fb7a5a1
4 changed files with 79 additions and 3 deletions
+56
View File
@@ -0,0 +1,56 @@
#ifdef INTELLISENSE_DIRECTIVES
# pragma once
# include "dsl.h"
# include "math.h"
#endif
/* C2 data registers */
#define C2_VXY0 0
#define C2_VZ0 1
#define C2_VXY1 2
#define C2_VZ1 3
#define C2_VXY2 4
#define C2_VZ2 5
#define C2_RGB 6
#define C2_OTZ 7
#define C2_IR0 8
#define C2_IR1 9
#define C2_IR2 10
#define C2_IR3 11
#define C2_SXY0 12
#define C2_SXY1 13
#define C2_SXY2 14
#define C2_SXYP 15
#define C2_SZ0 16
#define C2_SZ1 17
#define C2_SZ2 18
#define C2_SZ3 19
#define C2_MAC0 24
#define C2_MAC1 25
#define C2_MAC2 26
#define C2_FLAG 31
/* C2 control registers */
#define C2_RT11RT12 0
#define C2_RT13RT21 1
#define C2_RT22RT23 2
#define C2_RT31RT32 3
#define C2_RT33_TRX 4
#define C2_TRY_TRZ 5
#define C2_OFX_OFY 18 /* (low = OFX, high = OFY) */
#define C2_H_SF 20
/* Command codes (low 6 bits) */
#define CMD_RTPS 0x01
#define CMD_RTPT 0x02
#define CMD_NCLIP 0x06
#define CMD_OP 0x0C
#define CMD_DPCS 0x10
#define CMD_INTPL 0x11
#define CMD_MVMVA 0x09
#define CMD_AVSZ3 0x2D
#define CMD_AVSZ4 0x2E
+21 -1
View File
@@ -157,6 +157,26 @@ void gp_display_frame(DoubleBuffer* screen_buf, S2* active_buf_id, U4* ordering_
void render(void) {
}
// #define gte_ldv0(r0) \
// __asm__ volatile( \
// "lwc2 $0, 0( %0 );" \
// "lwc2 $1, 4( %0 )" \
// : \
// : "r"(r0))
/**
* @brief Loads a single V3_S2 to GTE vector register V0
*
* @details Loads values from an V3_S2 struct to GTE data registers C2_VXY0
* and C2_VZ0.
*/
// #define gte_ldv0( r0 ) __asm__ volatile ( \
// "lwc2 $0, 0( %0 );" \
// "lwc2 $1, 4( %0 );" \
// : \
// : "r"( r0 ) \
// : "$t0" )
void update(PrimitiveArena* pa, U4* ordering_buf)
{
orderingtbl_clear_reverse(ordering_buf, OrderingTbl_Len);
@@ -219,7 +239,7 @@ void update(PrimitiveArena* pa, U4* ordering_buf)
// static_mem.cube.rot.x += 6;
// static_mem.cube.rot.y += 8;
// static_mem.cube.rot.z += 12;
static_mem.cube.rot.y += 20;
static_mem.cube.rot.y += 0;
}
// Draw Floor
{
+1 -1
View File
@@ -2,6 +2,6 @@
"configureme": true,
"grey": false,
"mask": 0.5,
"masktype": 2,
"masktype": 1,
"warp": 0
}