fixes, de-obufscation... still confused about formating color...

This commit is contained in:
ed
2026-07-07 22:12:06 -04:00
parent a01e724211
commit 101b07fe71
8 changed files with 73 additions and 42 deletions
+6 -6
View File
@@ -335,8 +335,8 @@ void update(PrimitiveArena* pa, U4* ordering_buf)
m3s2_translation(& smem.tform_world, & smem.floor.pos);
m3s2_scale (& smem.tform_world, & smem.floor.scale);
// TODO(Ed): This can either be in the tape or here...
gte_matrix_set_rotation (& smem.tform_world);
gte_matrix_set_translation(& smem.tform_world);
// gte_matrix_set_rotation (& smem.tform_world);
// gte_matrix_set_translation(& smem.tform_world);
U4 prim_base = u4_(pa->buf[smem.active_buf_id]);
U4 prim_cursor = prim_base + pa->used;
@@ -348,8 +348,8 @@ void update(PrimitiveArena* pa, U4* ordering_buf)
LP_ U4 mem_temp_tape[512];
TapeBuilder tb = tb_make(slice_ut_arr(mem_temp_tape)); tb_scope(& tb) {
// TODO(Ed): This is bugged.
// tb_emit(& tb, code_set_gte_world);
// tb_data(& tb, u4_(& smem.tform_world));
tb_emit(& tb, code_set_gte_world);
tb_data(& tb, u4_(& smem.tform_world));
tb_emit(& tb, code_rbind_floor_tri);
// TODO(Ed): Just use a single context struct ref
@@ -372,7 +372,7 @@ void update(PrimitiveArena* pa, U4* ordering_buf)
smem.floor.rot.y += 5;
}
// --- TAPE DIAGNOSTICS ---
if (0)
if (1)
{
LP_ U4 mem_temp_tape[512]; FArena tape_arena; farena_init(& tape_arena, slice_ut_arr(mem_temp_tape));
TapeBuilder tb = tb_make_old(& tape_arena); tb_scope(& tb) {
@@ -385,7 +385,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); //TODO(Ed): Stopped working
tb_emit(& tb, code_diag_color);
// tb_emit(& tb, code_diag_gte);
}
}
+11 -2
View File
@@ -63,9 +63,18 @@ U4 vsync(U4 mode) __asm__("VSync");
void draw_orderingtbl(U4* buf) __asm__("DrawOTag");
enum {
PolyTag_addr_bits = 24,
PolyTag_len_bits = 8,
};
typedef Struct_(PolyTag) {
U4 addr: 24;
U4 len: 8;
union {
U4 bf_addr_len;
struct {
U4 addr: 24;
U4 len: 8;
};
};
RGB8 color;
B1 code;
};
+12 -2
View File
@@ -7,10 +7,19 @@
#endif
#pragma region MACs (Mips Atom components)
// load_ui( R_AT, color_hi) \
enum fack {
ah = gcmd_poly_f3 << 8 | 0xFF,
};
void fk() {
(void*)ah;
}
/* Words: 3; High: 0x20/B, Low: G/R */
#define mac_format_f3_color(color_hi, color_lo) \
load_ui(R_AT, color_hi), or_i(R_AT, R_AT, color_lo) \
load_ui( R_AT, gcmd_poly_f3 << 8 | color_hi) \
, or_i( R_AT, R_AT, color_lo) \
, store_word(R_AT, R_PrimCursor, O_(Poly_F3,color)) \
/* Words: 3 */
@@ -192,7 +201,8 @@ MipsAtom_(floor_tri) {
nop, branch_le_zero(R_T0, atom_offset(culling, floor_tri_exit)),
nop,
/* Format Primitive */
mac_format_f3_color(0x20FF, 0xFFFF),
// mac_format_f3_color(0x20FF, 0xFFFF), // works
mac_format_f3_color(0xFF, 0xFFFF), // doesn't work
mac_gte_store_f3(),
/* Calculate Depth */
nop, nop, gte_avg_sort_z3,