more intiution...

This commit is contained in:
2026-07-09 13:30:13 -04:00
parent 4d177bc34d
commit ccdf1b832b
5 changed files with 64 additions and 34 deletions
+15 -5
View File
@@ -5,14 +5,24 @@
#pragma region hello_gte_tape
// --- atom: floor_tri (49 words) ---
// --- atom: cube_g4_face (87 words) ---
#define _atom_offset_culling_floor_tri_exit 15
#define _atom_offset_bounds_chk_floor_tri_exit 3
#define _atom_offset_cull_cube_g4_face_exit 48
#define _atom_offset_bounds_chk_cube_g4_face_exit 12
enum {
atom_offset_culling_floor_tri_exit = _atom_offset_culling_floor_tri_exit,
atom_offset_bounds_chk_floor_tri_exit = _atom_offset_bounds_chk_floor_tri_exit,
atom_offset_cull_cube_g4_face_exit = _atom_offset_cull_cube_g4_face_exit,
atom_offset_bounds_chk_cube_g4_face_exit = _atom_offset_bounds_chk_cube_g4_face_exit,
};
// --- atom: floor_f3_face (66 words) ---
#define _atom_offset_culling_floor_f3_face_exit 29
#define _atom_offset_bounds_chk_floor_f3_face_exit 13
enum {
atom_offset_culling_floor_f3_face_exit = _atom_offset_culling_floor_f3_face_exit,
atom_offset_bounds_chk_floor_f3_face_exit = _atom_offset_bounds_chk_floor_f3_face_exit,
};
#pragma endregion hello_gte_tape
+6 -7
View File
@@ -56,11 +56,10 @@ MipsAtom_(cube_g4_face) {
load_half_u(R_T3, R_FaceCursor, 3 * S_(S2)),
/* ── 2. Load V0, V1, V2 into GTE (parallel to mac_load_tri_verts) ── */
mac_load_tri_verts(R_T0, R_T1, R_T2),
/* ── 3. RTPT — transforms V0/V1/V2 → SXY0/SXY1/SXY2 + SZ1/SZ2/SZ3 ─── */
nop2, gte_cmdw_rtpt,
nop2, gte_cmdw_rotate_translate_perspective_triple,
/* ── 4. NCLIP — backface culling on SXY0/SXY1/SXY2 (p0,p1,p2) ──────── */
/* MUST be done BEFORE V3-RTPS overwrites SXY0 with p3. */
@@ -81,7 +80,7 @@ MipsAtom_(cube_g4_face) {
/* c3 green */ 0x00, 0xFF, 0x00),
/* ── 7. Store p0..p2 BEFORE V3-RTPS overwrites SXY0 ─────────────────── */
mac_gte_store_g4_tri(),
mac_gte_store_g4_p012_post_rtpt_pre_rtps(),
/* ── 8. Load V3 = verts[face->w] into V0 ─────────────────────────────── */
shift_lleft(R_AT, R_T3, v3s2_byteoff), add_u(R_AT, R_AT, R_VertBase),
@@ -89,11 +88,11 @@ MipsAtom_(cube_g4_face) {
gte_mv_to_data_r(R_V0, C2_VXY0), gte_mv_to_data_r(R_V1, C2_VZ0),
/* ── 9. RTPS — transforms V0 (now V3) → SXY0 (p3) + SZ3 ─────────────── */
nop2, gte_cmdw_rtps,
mac_gte_store_g4_p3(),
nop2, gte_cmdw_rotate_translate_perspective_single,
mac_gte_store_g4_p3_post_rtps(),
/* ── 10. AVSZ4 — average Z from SZ0/SZ1/SZ2/SZ3 ─────────────────────── */
nop2, gte_cmdw_avsz4,
nop2, gte_cmdw_avg_sort_z4,
nop2, gte_mv_from_data_r(R_T1, C2_OTZ),
/* ── 11. Bounds check OTZ < OrderingTbl_Len ─────────────────────────── */
@@ -154,7 +153,7 @@ MipsAtom_(floor_f3_face) {
/* Format Primitive */
// mac_format_f3_color(0x20FF, 0xFFFF), // works
mac_format_f3_color(0xFF, 0xFF, 0xFF), // RGB-form (R=FF, G=FF, B=FF = white)
mac_gte_store_f3(),
mac_gte_store_f3_post_rtpt(),
/* Calculate Depth */
nop2, gte_avg_sort_z3,
+8 -8
View File
@@ -18,10 +18,10 @@ WORD_COUNT(call_addr, 1)
WORD_COUNT(branch_le_zero, 1)
WORD_COUNT(branch_equal, 1)
WORD_COUNT(add_ui, 1)
WORD_COUNT(set_lt_u, 1)
WORD_COUNT(set_lt_s, 1)
WORD_COUNT(set_lt_si, 1)
WORD_COUNT(set_lt_ui, 1)
WORD_COUNT(set_lt_u, 1)
WORD_COUNT(set_lt_s, 1)
WORD_COUNT(set_lt_si, 1)
WORD_COUNT(set_lt_ui, 1)
WORD_COUNT(load_word, 1)
WORD_COUNT(load_half_u, 1)
WORD_COUNT(store_word, 1)
@@ -37,7 +37,7 @@ WORD_COUNT(shift_lleft_self, 1)
WORD_COUNT(shift_lright, 1)
WORD_COUNT(shift_aright, 1)
WORD_COUNT(mask_upper, 2)
WORD_COUNT(gte_mv_from_data_r, 1)
WORD_COUNT(gte_mv_from_data_r, 1)
WORD_COUNT(gte_mv_from_ctrl_r, 1)
WORD_COUNT(gte_mv_to_data_r, 1)
WORD_COUNT(gte_mv_to_ctrl_r, 1)
@@ -50,11 +50,11 @@ WORD_COUNT(nop2, 2)
WORD_COUNT(mac_load_tri_indices, 3)
WORD_COUNT(mac_load_tri_verts, 18)
WORD_COUNT(mac_format_f3_color, 3)
WORD_COUNT(mac_gte_store_f3, 3)
WORD_COUNT(mac_gte_store_f3_post_rtpt, 3)
WORD_COUNT(mac_pack_color_word, 3)
WORD_COUNT(mac_format_g4_color, 12)
WORD_COUNT(mac_gte_store_g4_tri, 3)
WORD_COUNT(mac_gte_store_g4_p3, 1)
WORD_COUNT(mac_gte_store_g4_p012_post_rtpt_pre_rtps, 3)
WORD_COUNT(mac_gte_store_g4_p3_post_rtps, 1)
WORD_COUNT(mac_insert_ot_tag, 11)
WORD_COUNT(mac_yield, 4)