This commit is contained in:
ed
2026-06-15 22:40:28 -04:00
parent 68fd4ca791
commit 288f92ff5b
2 changed files with 44 additions and 4 deletions
+5
View File
@@ -152,6 +152,11 @@ internal MipsAtom_(set_gte_world) {
mips_yield()
};
internal MipsAtom_(cube_tri) {
mips_yield()
};
internal MipsAtom_(floor_tri) {
mac_load_tri_indices(R_T0, R_T1, R_T2),
mac_load_tri_verts( R_T0, R_T1, R_T2),
+39 -4
View File
@@ -191,7 +191,7 @@ void update(PrimitiveArena* pa, U4* ordering_buf)
S4 flag; //????
// Draw Cube
if (1)
if (0)
{
m3s2_rotation (& static_mem.cube.rot, & static_mem.tform_world);
m3s2_translation(& static_mem.tform_world, & static_mem.cube.pos);
@@ -230,6 +230,41 @@ void update(PrimitiveArena* pa, U4* ordering_buf)
// static_mem.cube.rot.z += 12;
static_mem.cube.rot.y += 30;
}
// Draw cube (tape method)
if (0)
{
m3s2_rotation (& static_mem.cube.rot, & static_mem.tform_world);
m3s2_translation(& static_mem.tform_world, & static_mem.cube.pos);
m3s2_scale (& static_mem.tform_world, & static_mem.cube.scale);
// gte_matrix_set_rotation (& static_mem.tform_world);
// gte_matrix_set_translation(& static_mem.tform_world);
U4 prim_base = u4_(pa->buf[static_mem.active_buf_id]);
U4 prim_cursor = prim_base + pa->used;
LP_ U4 mem_temp_tape[512]; FArena tape_arena; farena_init(& tape_arena, slice_ut_arr(mem_temp_tape));
TapeBuilder tb = tb_make(&tape_arena); tb_scope(& tb) {
tb_emit(& tb, code_bind_workspace);
tb_data(& tb, prim_cursor);
tb_data(& tb, u4_(static_mem.cube.faces));
tb_data(& tb, u4_(static_mem.cube.verts));
tb_data(& tb, u4_(ordering_buf));
tb_emit(& tb, code_set_gte_world);
tb_data(& tb, u4_(& static_mem.tform_world));
for (U4 i = 0; i < Cube_num_faces; i++) {
tb_emit(& tb, code_cube_tri);
}
tb_emit(& tb, code_sync_prim_cursor);
tb_data(& tb, u4_(& pa->used));
tb_data(& tb, prim_base);
}
tape_run(tb_slice(tb));
static_mem.cube.rot.y += 30;
}
// Draw Floor
if (0)
{
@@ -291,8 +326,8 @@ void update(PrimitiveArena* pa, U4* ordering_buf)
m3s2_rotation (& static_mem.floor.rot, & static_mem.tform_world);
m3s2_translation(& static_mem.tform_world, & static_mem.floor.pos);
m3s2_scale (& static_mem.tform_world, & static_mem.floor.scale);
gte_matrix_set_rotation (& static_mem.tform_world);
gte_matrix_set_translation(& static_mem.tform_world);
// gte_matrix_set_rotation (& static_mem.tform_world);
// gte_matrix_set_translation(& static_mem.tform_world);
U4 prim_base = u4_(pa->buf[static_mem.active_buf_id]);
U4 prim_cursor = prim_base + pa->used;
@@ -339,7 +374,7 @@ void update(PrimitiveArena* pa, U4* ordering_buf)
// 2. code_diag_color -> Tests OT and Prim Arena memory
// 3. code_diag_gte -> Tests Vertex arrays and GTE Math
// tb_emit(& tb, code_diag_yield);
// tb_emit(& tb, code_diag_color);
// tb_emit(& tb, code_diag_color); //TODO(Ed): Stopped working
// tb_emit(& tb, code_diag_gte);
}
}