added rgba only option to vu progrm
This commit is contained in:
@@ -29,7 +29,7 @@ public:
|
||||
~VifSender();
|
||||
|
||||
// TODO refactor
|
||||
void drawMesh(RenderData *t_renderData, Matrix t_perspective, u32 vertCount2, VECTOR *vertices, VECTOR *normals, VECTOR *coordinates, Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount, texbuffer_t *textureBuffer, color_t *t_color);
|
||||
void drawMesh(RenderData *t_renderData, Matrix t_perspective, u32 vertCount2, VECTOR *vertices, VECTOR *normals, VECTOR *coordinates, Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount, texbuffer_t *textureBuffer, color_t *t_color, u8 t_rgbaOnly);
|
||||
void calcMatrix(const RenderData &t_renderData, const Vector3 &t_position, const Vector3 &t_rotation);
|
||||
void drawTheSameWithOtherMatrices(const RenderData &t_renderData, Mesh **t_meshes, const u32 &t_skip, const u32 &t_count);
|
||||
void enableWait() { isDrawWaitEnabled = true; }
|
||||
@@ -37,11 +37,12 @@ public:
|
||||
|
||||
private:
|
||||
u32 lastVertCount; // needed for drawTheSameWithOtherMatrices()
|
||||
u8 isLastRGBAOnly; // needed for drawTheSameWithOtherMatrices()
|
||||
u8 isDrawWaitEnabled;
|
||||
Light *light;
|
||||
void uploadMicroProgram();
|
||||
void setDoubleBufferAddStaticData();
|
||||
void drawVertices(Mesh &t_mesh, u32 t_start, u32 t_end, VECTOR *t_vertices, VECTOR *t_coordinates, prim_t *t_prim, texbuffer_t *t_textureBuffer, u8 t_addDrawWait, color_t *t_color);
|
||||
void drawVertices(Mesh &t_mesh, u32 t_start, u32 t_end, VECTOR *t_vertices, VECTOR *t_coordinates, prim_t *t_prim, texbuffer_t *t_textureBuffer, u8 t_addDrawWait, color_t *t_color, u8 t_rgbaOnly);
|
||||
packet2_t *packets[2] __attribute__((aligned(64)));
|
||||
packet2_t *currPacket;
|
||||
/**
|
||||
|
||||
@@ -330,7 +330,7 @@ void Renderer::draw(Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount)
|
||||
Texture *tex = textureRepo.getBySpriteOrMesh(material->getId());
|
||||
changeTexture(tex);
|
||||
vertCount = t_mesh.getDrawData(i, vertices, normals, coordinates, rotatedCamera);
|
||||
vifSender->drawMesh(&renderData, perspective, vertCount, vertices, normals, coordinates, t_mesh, t_bulbs, t_bulbsCount, &textureBuffer, &material->color);
|
||||
vifSender->drawMesh(&renderData, perspective, vertCount, vertices, normals, coordinates, t_mesh, t_bulbs, t_bulbsCount, &textureBuffer, &material->color, !material->areSTsPresent());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ void VifSender::calcMatrix(const RenderData &t_renderData, const Vector3 &t_posi
|
||||
modelViewProj = *t_renderData.projection * modelViewProj;
|
||||
}
|
||||
|
||||
void VifSender::drawMesh(RenderData *t_renderData, Matrix t_perspective, u32 vertCount2, VECTOR *vertices, VECTOR *normals, VECTOR *coordinates, Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount, texbuffer_t *textureBuffer, color_t *t_color)
|
||||
void VifSender::drawMesh(RenderData *t_renderData, Matrix t_perspective, u32 vertCount2, VECTOR *vertices, VECTOR *normals, VECTOR *coordinates, Mesh &t_mesh, LightBulb *t_bulbs, u16 t_bulbsCount, texbuffer_t *textureBuffer, color_t *t_color, u8 t_rgbaOnly)
|
||||
{
|
||||
// we have to split 3D object into small parts, because of small memory of VU1
|
||||
|
||||
@@ -97,7 +97,7 @@ void VifSender::drawMesh(RenderData *t_renderData, Matrix t_perspective, u32 ver
|
||||
i -= 3;
|
||||
|
||||
const u32 endI = i + (VU1_PACKAGE_VERTS_PER_BUFF - 1) > vertCount2 ? vertCount2 : i + (VU1_PACKAGE_VERTS_PER_BUFF - 1);
|
||||
drawVertices(t_mesh, i, endI, vertices, coordinates, t_renderData->prim, textureBuffer, isDrawWaitEnabled ? endI == vertCount2 : false, t_color);
|
||||
drawVertices(t_mesh, i, endI, vertices, coordinates, t_renderData->prim, textureBuffer, isDrawWaitEnabled ? endI == vertCount2 : false, t_color, t_rgbaOnly);
|
||||
if (endI == vertCount2) // if there are no more vertices to draw, break
|
||||
{
|
||||
i = vertCount2;
|
||||
@@ -130,18 +130,22 @@ void VifSender::setDoubleBufferAddStaticData()
|
||||
}
|
||||
|
||||
/** Draw using PATH1 */
|
||||
void VifSender::drawVertices(Mesh &t_mesh, u32 t_start, u32 t_end, VECTOR *t_vertices, VECTOR *t_coordinates, prim_t *t_prim, texbuffer_t *t_texBuff, u8 t_addDrawWait, color_t *t_color)
|
||||
void VifSender::drawVertices(Mesh &t_mesh, u32 t_start, u32 t_end, VECTOR *t_vertices, VECTOR *t_coordinates, prim_t *t_prim, texbuffer_t *t_texBuff, u8 t_addDrawWait, color_t *t_color, u8 t_rgbaOnly)
|
||||
{
|
||||
const u32 vertCount = t_end - t_start;
|
||||
lastVertCount = vertCount;
|
||||
isLastRGBAOnly = t_rgbaOnly;
|
||||
packet2_utils_vu_open_unpack(currPacket, 0, true);
|
||||
packet2_add_data(currPacket, modelViewProj.data, 4);
|
||||
packet2_add_u32(currPacket, t_addDrawWait); // Draw finish?
|
||||
packet2_add_u32(currPacket, vertCount); // Vertex count
|
||||
packet2_add_u32(currPacket, vertCount / 3); // Triangles count
|
||||
packet2_add_u32(currPacket, 0); // Free
|
||||
packet2_add_u32(currPacket, t_rgbaOnly); // 0 = STQ+RGBA, 1 = RGBA
|
||||
packet2_utils_gs_add_lod(currPacket, &t_mesh.lod);
|
||||
packet2_utils_gs_add_texbuff_clut(currPacket, t_texBuff, &t_mesh.clut);
|
||||
if (t_rgbaOnly)
|
||||
packet2_utils_gs_add_prim_giftag(currPacket, t_prim, vertCount, DRAW_RGBAQ_REGLIST, 2, 0);
|
||||
else
|
||||
packet2_utils_gs_add_prim_giftag(currPacket, t_prim, vertCount, DRAW_STQ2_REGLIST, 3, 0);
|
||||
packet2_add_u32(currPacket, t_color->r);
|
||||
packet2_add_u32(currPacket, t_color->g);
|
||||
@@ -149,9 +153,11 @@ void VifSender::drawVertices(Mesh &t_mesh, u32 t_start, u32 t_end, VECTOR *t_ver
|
||||
packet2_add_u32(currPacket, t_color->a);
|
||||
u32 vif_added_bytes = packet2_utils_vu_close_unpack(currPacket);
|
||||
packet2_utils_vu_add_unpack_data(currPacket, vif_added_bytes, t_vertices + t_start, vertCount, true);
|
||||
if (!t_rgbaOnly)
|
||||
{
|
||||
vif_added_bytes += vertCount;
|
||||
packet2_utils_vu_add_unpack_data(currPacket, vif_added_bytes, t_coordinates + t_start, vertCount, true);
|
||||
vif_added_bytes += vertCount;
|
||||
}
|
||||
packet2_utils_vu_add_start_program(currPacket, 0);
|
||||
}
|
||||
|
||||
@@ -203,7 +209,7 @@ void VifSender::drawTheSameWithOtherMatrices(const RenderData &t_renderData, Mes
|
||||
packet2_add_u32(currMPacket, true); // Draw wait finish?
|
||||
packet2_add_u32(currMPacket, lastVertCount); // Vertex count
|
||||
packet2_add_u32(currMPacket, lastVertCount / 3); // Triangles count
|
||||
packet2_add_u32(currMPacket, 0); // Free
|
||||
packet2_add_u32(currMPacket, isLastRGBAOnly); // 0 = STQ+RGBA, 1 = RGBA
|
||||
}
|
||||
packet2_utils_vu_close_unpack(currMPacket);
|
||||
packet2_utils_vu_add_start_program(currMPacket, 0); // and start program
|
||||
@@ -231,7 +237,7 @@ void VifSender::drawTheSameWithOtherMatrices(const RenderData &t_renderData, Mes
|
||||
packet2_add_u32(currMPacket, true); // Draw wait finish?
|
||||
packet2_add_u32(currMPacket, lastVertCount); // Vertex count
|
||||
packet2_add_u32(currMPacket, lastVertCount / 3); // Triangles count
|
||||
packet2_add_u32(currMPacket, 0); // Free
|
||||
packet2_add_u32(currMPacket, isLastRGBAOnly); // 0 = STQ+RGBA, 1 = RGBA
|
||||
}
|
||||
packet2_utils_vu_close_unpack(currMPacket);
|
||||
packet2_utils_vu_add_start_program(currMPacket, 0);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
; TODO
|
||||
; - Add dynamic lighting (feature)
|
||||
; - Add --cont + MSCNT instead of alltime MSCAL
|
||||
; - Split this program into two (RBA/STQ), so we can get better performance
|
||||
|
||||
#include "/repos/tyra/src/engine/vu1_progs/geometry.inc"
|
||||
#include "/repos/tyra/src/engine/vu1_progs/matrix.inc"
|
||||
@@ -51,6 +52,7 @@ MatrixLoad{ matrix, 0, double_buffer }
|
||||
ilw.x do_draw_finish, 4(double_buffer) ; Add draw finish tag? (sync)
|
||||
ilw.y vertex_count, 4(double_buffer) ; Vertex count
|
||||
ilw.z triangles_count, 4(double_buffer) ; Triangles count
|
||||
ilw.w rgba_only, 4(double_buffer) ; RGBA (1) or STQ+RGBA (0)
|
||||
lq tex_gif_tag_1, 5(double_buffer) ; GIF tag - texture LOD
|
||||
lq tex_gif_tag_2, 6(double_buffer) ; GIF tag - texture buffer & CLUT
|
||||
lq prim_tag, 7(double_buffer) ; GIF tag - tell GS how many data we will send
|
||||
@@ -70,10 +72,10 @@ sqi gif_set_tag, (dest_address++) ;
|
||||
sqi tex_gif_tag_1, (dest_address++) ; texture LOD tag
|
||||
sqi gif_set_tag, (dest_address++) ;
|
||||
sqi tex_gif_tag_2, (dest_address++) ; texture buffer & CLUT tag
|
||||
iblez do_draw_finish, kick
|
||||
iblez do_draw_finish, prim_tag_l
|
||||
sqi gif_set_tag, (dest_address++) ;
|
||||
sqi gif_draw_finish_tag, (dest_address++) ; do draw_finish is needed
|
||||
kick:
|
||||
prim_tag_l:
|
||||
sqi prim_tag, (dest_address++) ; prim + tell gs how many data will be
|
||||
;////////////////////////////////////////////
|
||||
|
||||
@@ -87,52 +89,87 @@ iaddiu triangle_counter, vi00, 0 ; Reset counter
|
||||
triangle_loop: --LoopCS 1,3
|
||||
|
||||
;//////////////// VERTEX 1 //////////////////
|
||||
vec1:
|
||||
VectorLoad{ vertex, vertex_data, 0 }
|
||||
VectorLoad{ stq1, stq_data, 0 }
|
||||
MatrixXForm{ xformed_vertex, matrix, vertex }
|
||||
VectorClip{ gs_vertex, xformed_vertex }
|
||||
VectorPerspectiveDivide{ xformed_vertex }
|
||||
VectorAddGSScales{ gs_vertex, xformed_vertex, gs_scale }
|
||||
|
||||
ibgtz rgba_only, vec_1_rgba
|
||||
|
||||
vec_1_stq_rgba:
|
||||
VectorLoad{ stq1, stq_data, 0 }
|
||||
VectorTexturePerspectiveCorrection{ pers_stq, stq1 }
|
||||
VectorStore{ pers_stq, dest_address, 0 }
|
||||
VectorStore{ rgba, dest_address, 1 }
|
||||
VectorStore{ gs_vertex, dest_address, 2 }
|
||||
ibeq vi00, vi00, vec2
|
||||
|
||||
vec_1_rgba:
|
||||
VectorStore{ rgba, dest_address, 0 }
|
||||
VectorStore{ gs_vertex, dest_address, 1 }
|
||||
|
||||
;////////////////////////////////////////////
|
||||
|
||||
;//////////////// VERTEX 2 //////////////////
|
||||
vec2:
|
||||
VectorLoad{ vertex, vertex_data, 1 }
|
||||
VectorLoad{ stq2, stq_data, 1 }
|
||||
MatrixXForm{ xformed_vertex, matrix, vertex }
|
||||
VectorClip{ gs_vertex, xformed_vertex }
|
||||
VectorPerspectiveDivide{ xformed_vertex }
|
||||
VectorAddGSScales{ gs_vertex, xformed_vertex, gs_scale }
|
||||
|
||||
ibgtz rgba_only, vec_2_rgba
|
||||
|
||||
vec_2_stq_rgba:
|
||||
VectorLoad{ stq2, stq_data, 1 }
|
||||
VectorTexturePerspectiveCorrection{ pers_stq, stq2 }
|
||||
VectorStore{ pers_stq, dest_address, 3 }
|
||||
VectorStore{ rgba, dest_address, 4 }
|
||||
VectorStore{ gs_vertex, dest_address, 5 }
|
||||
ibeq vi00, vi00, vec3
|
||||
|
||||
vec_2_rgba:
|
||||
VectorStore{ rgba, dest_address, 2 }
|
||||
VectorStore{ gs_vertex, dest_address, 3 }
|
||||
|
||||
;////////////////////////////////////////////
|
||||
|
||||
;//////////////// VERTEX 3 //////////////////
|
||||
vec3:
|
||||
VectorLoad{ vertex, vertex_data, 2 }
|
||||
VectorLoad{ stq3, stq_data, 2 }
|
||||
MatrixXForm{ xformed_vertex, matrix, vertex }
|
||||
VectorClip{ gs_vertex, xformed_vertex }
|
||||
VectorPerspectiveDivide{ xformed_vertex }
|
||||
VectorAddGSScales{ gs_vertex, xformed_vertex, gs_scale }
|
||||
VectorTexturePerspectiveCorrection{ pers_stq, stq3 }
|
||||
VectorStore{ pers_stq, dest_address, 6 }
|
||||
VectorStore{ rgba, dest_address, 7 }
|
||||
|
||||
fcand vi01, 0x03FFFF
|
||||
iaddiu new_adc_bit, vi01, 0x7FFF
|
||||
mfir.w gs_vertex, new_adc_bit
|
||||
|
||||
ibgtz rgba_only, vec_3_rgba
|
||||
|
||||
vec_3_stq_rgba:
|
||||
VectorLoad{ stq3, stq_data, 2 }
|
||||
VectorTexturePerspectiveCorrection{ pers_stq, stq3 }
|
||||
VectorStore{ pers_stq, dest_address, 6 }
|
||||
VectorStore{ rgba, dest_address, 7 }
|
||||
VectorStore{ gs_vertex, dest_address, 8 }
|
||||
iaddiu dest_address, dest_address, 9 // Loop control
|
||||
ibeq vi00, vi00, loop_ctrl
|
||||
|
||||
vec_3_rgba:
|
||||
VectorStore{ rgba, dest_address, 4 }
|
||||
VectorStore{ gs_vertex, dest_address, 5 }
|
||||
iaddiu dest_address, dest_address, 6 // Loop control
|
||||
|
||||
;////////////////////////////////////////////
|
||||
|
||||
;////////////// LOOP CONTROL ////////////////
|
||||
loop_ctrl:
|
||||
iaddiu vertex_data, vertex_data, 3
|
||||
iaddiu stq_data, stq_data, 3
|
||||
iaddiu dest_address, dest_address, 9
|
||||
|
||||
iaddiu triangle_counter, triangle_counter, 1 // Incrementing this
|
||||
// by other value than 1 is causing HUGE problems, but.. why?
|
||||
|
||||
+116
-154
@@ -3,10 +3,6 @@
|
||||
;-----VCL CODE------------
|
||||
;-------------------------
|
||||
;-------------------------
|
||||
; === __LP__ EXPL_draw3D_vcl_triangle_loop__MAIN_LOOP:
|
||||
; === hDown : optimal=30 clid=0 mlid=2 size=(31)
|
||||
; === dUp : optimal=30 clid=0 mlid=2 size=(31)
|
||||
; === another : optimal=30 clid=0 mlid=2 size=(31)
|
||||
; =================================================
|
||||
; flowMon::Emit() vcl 1.4beta7 produced this code:
|
||||
.vu
|
||||
@@ -15,171 +11,137 @@
|
||||
.global VU1Draw3D_CodeEnd
|
||||
VU1Draw3D_CodeStart:
|
||||
__v_draw3D_vcl_4:
|
||||
; _LNOPT_w=[ normal2 ] 26 [26 0] 26 [__v_draw3D_vcl_4]
|
||||
NOP xtop VI05
|
||||
; _LNOPT_w=[ normal2 ] 27 [27 0] 27 [__v_draw3D_vcl_4]
|
||||
NOP xtop VI06
|
||||
NOP lq VF02,1(VI00)
|
||||
NOP lq VF01,0(VI00)
|
||||
NOP ilw.x VI01,4(VI05)
|
||||
NOP ilw.y VI07,4(VI05)
|
||||
NOP lq VF03,0(VI05)
|
||||
NOP lq VF08,5(VI05)
|
||||
NOP lq VF10,6(VI05)
|
||||
NOP lq VF04,1(VI05)
|
||||
NOP lq VF05,2(VI05)
|
||||
NOP iaddiu VI03,VI05,0x00000009
|
||||
NOP iadd VI04,VI03,VI07
|
||||
NOP lq VF06,3(VI05)
|
||||
NOP iadd VI06,VI04,VI07
|
||||
NOP ilw.x VI01,4(VI06)
|
||||
NOP ilw.y VI08,4(VI06)
|
||||
NOP lq VF03,0(VI06)
|
||||
NOP lq VF04,1(VI06)
|
||||
NOP lq VF08,5(VI06)
|
||||
NOP lq VF10,6(VI06)
|
||||
NOP lq VF05,2(VI06)
|
||||
NOP lq VF06,3(VI06)
|
||||
NOP iaddiu VI04,VI06,0x00000009
|
||||
NOP iadd VI05,VI04,VI08
|
||||
NOP ilw.z VI02,4(VI06)
|
||||
NOP iadd VI07,VI05,VI08
|
||||
NOP loi 0x44fff000
|
||||
NOP ilw.z VI02,4(VI05)
|
||||
NOP lq VF07,7(VI05)
|
||||
NOP sqi VF02,(VI06++)
|
||||
NOP sqi VF08,(VI06++)
|
||||
NOP sqi VF02,(VI06++)
|
||||
NOP lq VF08,8(VI05)
|
||||
NOP iadd VI05,VI04,VI07
|
||||
NOP ilw.w VI03,4(VI06)
|
||||
NOP lq VF07,7(VI06)
|
||||
NOP sqi VF02,(VI07++)
|
||||
NOP sqi VF08,(VI07++)
|
||||
NOP sqi VF02,(VI07++)
|
||||
NOP lq VF08,8(VI06)
|
||||
NOP iadd VI06,VI05,VI08
|
||||
addi.xy VF09,VF00,I loi 0x492aaaaa
|
||||
NOP fcset 0
|
||||
NOP iblez VI01,kick
|
||||
addi.z VF09,VF00,I sqi VF10,(VI06++)
|
||||
NOP iblez VI01,prim_tag_l
|
||||
addi.z VF09,VF00,I sqi VF10,(VI07++)
|
||||
; _LNOPT_w=[ normal2 ] 2 [2 0] 2 [__v_draw3D_vcl_5]
|
||||
NOP sqi VF02,(VI06++)
|
||||
NOP sqi VF01,(VI06++)
|
||||
kick:
|
||||
; _LNOPT_w=[ normal2 ] 27 [27 0] 32 [kick]
|
||||
NOP sqi VF07,(VI06++)
|
||||
NOP lq VF07,0(VI03)
|
||||
mulax ACC,VF03,VF07x lq VF14,1(VI03) ; STALL_LATENCY ?3
|
||||
madday ACC,VF04,VF07y sq VF08,1(VI06)
|
||||
maddaz ACC,VF05,VF07z sq VF08,7(VI06)
|
||||
maddw VF11,VF06,VF07w NOP
|
||||
mulax ACC,VF03,VF14x lq VF07,2(VI03)
|
||||
madday ACC,VF04,VF14y NOP
|
||||
maddaz ACC,VF05,VF14z NOP
|
||||
maddw VF14,VF06,VF14w div Q,VF00w,VF11w
|
||||
mulax ACC,VF03,VF07x NOP
|
||||
madday ACC,VF04,VF07y iaddiu VI07,VI00,0x00007fff
|
||||
maddaz ACC,VF05,VF07z iaddiu VI07,VI07,0x00000001
|
||||
maddw VF07,VF06,VF07w iaddiu VI08,VI00,0
|
||||
clipw.xyz VF11xyz,VF11w iaddiu VI04,VI04,0
|
||||
clipw.xyz VF14xyz,VF14w div Q,VF00w,VF14w ; STALL_THRUPUT ?1
|
||||
clipw.xyz VF07xyz,VF07w lq VF15,0(VI04)
|
||||
mulq.xyz VF02,VF11,Q sq VF08,4(VI06)
|
||||
mulaw.xyz ACC,VF09,VF00w iaddiu VI03,VI03,0
|
||||
mulq VF11,VF15,Q iaddiu VI06,VI06,0 ; STALL_LATENCY ?1
|
||||
madd.xyz VF01,VF02,VF09 lq VF02,1(VI04)
|
||||
NOP div Q,VF00w,VF07w
|
||||
mulq.xyz VF15,VF14,Q iaddiu VI08,VI08,0x00000001
|
||||
mulaw.xyz ACC,VF09,VF00w sq VF11,0(VI06)
|
||||
mulq VF14,VF02,Q mfir.w VF11,VI07
|
||||
ftoi4.xyz VF11,VF01 ibeq VI08,VI02,EXPL_draw3D_vcl_triangle_loop__EPI1
|
||||
madd.xyz VF02,VF15,VF09 lq VF15,2(VI04)
|
||||
; _LNOPT_w=[ ] 31 [29 0] 31 [EXPL_draw3D_vcl_triangle_loop__PRO1]
|
||||
NOP lq VF12,3(VI03)
|
||||
NOP sqi VF02,(VI07++)
|
||||
NOP sqi VF01,(VI07++)
|
||||
prim_tag_l:
|
||||
; _LNOPT_w=[ normal2 ] 4 [4 0] 4 [prim_tag_l]
|
||||
NOP iaddiu VI08,VI00,0x00007fff
|
||||
NOP sqi VF07,(VI07++)
|
||||
NOP iaddiu VI08,VI08,0x00000001
|
||||
NOP iaddiu VI09,VI00,0
|
||||
triangle_loop:
|
||||
; _LNOPT_w=[ normal2 ] 11 [27 0] 27 [triangle_loop]
|
||||
NOP lq VF02,0(VI04)
|
||||
mulax ACC,VF03,VF02x mfir.w VF01,VI08 ; STALL_LATENCY ?3
|
||||
madday ACC,VF04,VF02y NOP
|
||||
maddaz ACC,VF05,VF02z NOP
|
||||
maddw VF02,VF06,VF02w NOP
|
||||
clipw.xyz VF02xyz,VF02w div Q,VF00w,VF02w ; STALL_LATENCY ?3
|
||||
mulq.xyz VF02,VF02,Q waitq ; STALL_LATENCY ?6
|
||||
mulaw.xyz ACC,VF09,VF00w NOP
|
||||
madd.xyz VF02,VF02,VF09 NOP ; STALL_LATENCY ?2
|
||||
NOP ibgtz VI03,vec_1_rgba
|
||||
ftoi4.xyz VF01,VF02 NOP ; STALL_LATENCY ?2
|
||||
; _LNOPT_w=[ normal2 ] 5 [9 0] 9 [vec_1_stq_rgba]
|
||||
NOP lq VF02,0(VI05)
|
||||
mulq VF01,VF02,Q sq VF01,2(VI07) ; STALL_LATENCY ?3
|
||||
NOP sq VF08,1(VI07)
|
||||
NOP b vec2
|
||||
NOP sq VF01,0(VI07) ; STALL_LATENCY ?1
|
||||
vec_1_rgba:
|
||||
; _LNOPT_w=[ normal2 ] 4 [2 0] 4 [vec_1_rgba]
|
||||
NOP NOP
|
||||
mulq.xyz VF01,VF07,Q NOP
|
||||
mulq VF11,VF15,Q sq VF11,2(VI06)
|
||||
mulax ACC,VF03,VF12x lq VF10,4(VI03)
|
||||
madday ACC,VF04,VF12y NOP
|
||||
maddaz ACC,VF05,VF12z NOP
|
||||
maddw VF11,VF06,VF12w sq VF11,6(VI06)
|
||||
mulax ACC,VF03,VF10x lq VF07,5(VI03)
|
||||
madday ACC,VF04,VF10y sq VF14,3(VI06)
|
||||
maddaz ACC,VF05,VF10z sq VF08,10(VI06)
|
||||
maddw VF10,VF06,VF10w div Q,VF00w,VF11w
|
||||
mulax ACC,VF03,VF07x sq VF08,13(VI06)
|
||||
madday ACC,VF04,VF07y sq VF08,16(VI06)
|
||||
maddaz ACC,VF05,VF07z iaddiu VI03,VI03,0x00000006
|
||||
maddw VF07,VF06,VF07w iaddiu VI04,VI04,0x00000006
|
||||
clipw.xyz VF11xyz,VF11w lq VF12,-3(VI04)
|
||||
clipw.xyz VF10xyz,VF10w iaddiu VI06,VI06,0x00000012
|
||||
mulq.xyz VF14,VF11,Q div Q,VF00w,VF10w
|
||||
clipw.xyz VF07xyz,VF07w fcand VI01,262143
|
||||
mulq VF12,VF12,Q iaddiu VI08,VI08,0x00000001
|
||||
ftoi4.xyz VF11,VF02 iaddiu VI01,VI01,0x00007fff
|
||||
mulaw.xyz ACC,VF09,VF00w mfir.w VF11,VI07
|
||||
madd.xyz VF14,VF14,VF09 mfir.w VF10,VI01
|
||||
mulaw.xyz ACC,VF09,VF00w lq VF02,-2(VI04)
|
||||
madd.xyz VF01,VF01,VF09 div Q,VF00w,VF07w
|
||||
mulq.xyz VF10,VF10,Q lq VF15,-1(VI04)
|
||||
ftoi4.xyz VF11,VF14 sq VF11,-13(VI06)
|
||||
mulq VF14,VF02,Q sq VF12,-9(VI06)
|
||||
mulaw.xyz ACC,VF09,VF00w ibeq VI08,VI02,EXPL_draw3D_vcl_triangle_loop__EPI0
|
||||
madd.xyz VF02,VF10,VF09 mfir.w VF11,VI07
|
||||
EXPL_draw3D_vcl_triangle_loop__MAIN_LOOP:
|
||||
; _LPOPT_w=[ hDown ] 31 [30 30] 31 [EXPL_draw3D_vcl_triangle_loop__MAIN_LOOP]
|
||||
ftoi4.xyz VF10,VF01 lq VF13,0(VI03)
|
||||
NOP lq VF12,1(VI03)
|
||||
mulq.xyz VF01,VF07,Q sq VF14,-6(VI06)
|
||||
mulq VF11,VF15,Q sq VF11,-7(VI06)
|
||||
mulax ACC,VF03,VF13x sq VF10,-10(VI06)
|
||||
madday ACC,VF04,VF13y sq VF08,1(VI06)
|
||||
maddaz ACC,VF05,VF13z NOP
|
||||
maddw VF11,VF06,VF13w sq VF11,-3(VI06)
|
||||
mulax ACC,VF03,VF12x lq VF07,2(VI03)
|
||||
madday ACC,VF04,VF12y sq VF08,4(VI06)
|
||||
maddaz ACC,VF05,VF12z sq VF08,7(VI06)
|
||||
maddw VF10,VF06,VF12w div Q,VF00w,VF11w
|
||||
mulax ACC,VF03,VF07x NOP
|
||||
madday ACC,VF04,VF07y iaddiu VI03,VI03,0x00000003
|
||||
maddaz ACC,VF05,VF07z NOP
|
||||
maddw VF07,VF06,VF07w iaddiu VI04,VI04,0x00000003
|
||||
clipw.xyz VF11xyz,VF11w lq VF12,-3(VI04)
|
||||
clipw.xyz VF10xyz,VF10w iaddiu VI06,VI06,0x00000009
|
||||
mulq.xyz VF13,VF11,Q fcand VI01,262143
|
||||
clipw.xyz VF07xyz,VF07w div Q,VF00w,VF10w
|
||||
mulq VF12,VF12,Q iaddiu VI08,VI08,0x00000001
|
||||
ftoi4.xyz VF11,VF02 iaddiu VI01,VI01,0x00007fff
|
||||
mulaw.xyz ACC,VF09,VF00w mfir.w VF10,VI01
|
||||
madd.xyz VF13,VF13,VF09 mfir.w VF11,VI07
|
||||
mulaw.xyz ACC,VF09,VF00w lq VF02,-2(VI04)
|
||||
madd.xyz VF01,VF01,VF09 sq VF12,-9(VI06)
|
||||
mulq.xyz VF10,VF10,Q div Q,VF00w,VF07w
|
||||
ftoi4.xyz VF11,VF13 sq VF11,-13(VI06)
|
||||
mulq VF14,VF02,Q mfir.w VF11,VI07
|
||||
mulaw.xyz ACC,VF09,VF00w ibne VI08,VI02,EXPL_draw3D_vcl_triangle_loop__MAIN_LOOP
|
||||
madd.xyz VF02,VF10,VF09 lq VF15,-1(VI04)
|
||||
EXPL_draw3D_vcl_triangle_loop__EPI0:
|
||||
; _LNOPT_w=[ ] 13 [13 0] 15 [EXPL_draw3D_vcl_triangle_loop__EPI0]
|
||||
NOP NOP
|
||||
ftoi4.xyz VF10,VF01 fcand VI01,262143
|
||||
mulq.xyz VF01,VF07,Q sq VF14,-6(VI06)
|
||||
mulq VF11,VF15,Q sq VF11,-7(VI06)
|
||||
mulaw.xyz ACC,VF09,VF00w iaddiu VI01,VI01,0x00007fff
|
||||
madd.xyz VF01,VF01,VF09 sq VF10,-10(VI06) ; STALL_LATENCY ?1
|
||||
ftoi4.xyz VF11,VF02 sq VF11,-3(VI06)
|
||||
NOP mfir.w VF11,VI07
|
||||
NOP mfir.w VF10,VI01
|
||||
ftoi4.xyz VF10,VF01 NOP
|
||||
NOP sq VF11,-4(VI06) ; STALL_LATENCY ?1
|
||||
NOP b EXPL_draw3D_vcl_triangle_loop__EXIT_POINT
|
||||
NOP sq VF10,-1(VI06)
|
||||
EXPL_draw3D_vcl_triangle_loop__EPI1:
|
||||
; _LNOPT_w=[ ] 12 [13 0] 14 [EXPL_draw3D_vcl_triangle_loop__EPI1]
|
||||
NOP sq VF08,0(VI07)
|
||||
NOP sq VF01,1(VI07)
|
||||
vec2:
|
||||
; _LNOPT_w=[ normal2 ] 11 [27 0] 27 [vec2]
|
||||
NOP lq VF02,1(VI04)
|
||||
mulax ACC,VF03,VF02x mfir.w VF01,VI08 ; STALL_LATENCY ?3
|
||||
madday ACC,VF04,VF02y NOP
|
||||
maddaz ACC,VF05,VF02z NOP
|
||||
maddw VF02,VF06,VF02w NOP
|
||||
clipw.xyz VF02xyz,VF02w div Q,VF00w,VF02w ; STALL_LATENCY ?3
|
||||
mulq.xyz VF02,VF02,Q waitq ; STALL_LATENCY ?6
|
||||
mulaw.xyz ACC,VF09,VF00w NOP
|
||||
madd.xyz VF02,VF02,VF09 NOP ; STALL_LATENCY ?2
|
||||
NOP ibgtz VI03,vec_2_rgba
|
||||
ftoi4.xyz VF01,VF02 NOP ; STALL_LATENCY ?2
|
||||
; _LNOPT_w=[ normal2 ] 5 [9 0] 9 [vec_2_stq_rgba]
|
||||
NOP lq VF02,1(VI05)
|
||||
mulq VF01,VF02,Q sq VF01,5(VI07) ; STALL_LATENCY ?3
|
||||
NOP sq VF08,4(VI07)
|
||||
NOP b vec3
|
||||
NOP sq VF01,3(VI07) ; STALL_LATENCY ?1
|
||||
vec_2_rgba:
|
||||
; _LNOPT_w=[ normal2 ] 4 [2 0] 4 [vec_2_rgba]
|
||||
NOP NOP
|
||||
mulq.xyz VF14,VF07,Q sq VF14,3(VI06)
|
||||
NOP NOP
|
||||
mulq VF11,VF15,Q sq VF11,2(VI06)
|
||||
mulaw.xyz ACC,VF09,VF00w fcand VI01,262143
|
||||
madd.xyz VF14,VF14,VF09 iaddiu VI01,VI01,0x00007fff
|
||||
NOP mfir.w VF14,VI01
|
||||
ftoi4.xyz VF11,VF02 sq VF11,6(VI06)
|
||||
NOP mfir.w VF11,VI07
|
||||
ftoi4.xyz VF14,VF14 NOP
|
||||
NOP sq VF11,5(VI06) ; STALL_LATENCY ?2
|
||||
NOP sq VF14,8(VI06)
|
||||
EXPL_draw3D_vcl_triangle_loop__EXIT_POINT:
|
||||
; _LNOPT_w=[ ] 0 [0 0] 0 [EXPL_draw3D_vcl_triangle_loop__EXIT_POINT]
|
||||
; _LNOPT_w=[ normal2 ] 3 [1 0] 3 [__v_draw3D_vcl_9]
|
||||
NOP xgkick VI05
|
||||
NOP sq VF08,2(VI07)
|
||||
NOP sq VF01,3(VI07)
|
||||
vec3:
|
||||
; _LNOPT_w=[ normal2 ] 13 [27 0] 27 [vec3]
|
||||
NOP lq VF01,2(VI04)
|
||||
mulax ACC,VF03,VF01x NOP ; STALL_LATENCY ?3
|
||||
madday ACC,VF04,VF01y NOP
|
||||
maddaz ACC,VF05,VF01z NOP
|
||||
maddw VF01,VF06,VF01w NOP
|
||||
clipw.xyz VF01xyz,VF01w div Q,VF00w,VF01w ; STALL_LATENCY ?3
|
||||
mulq.xyz VF01,VF01,Q waitq ; STALL_LATENCY ?6
|
||||
mulaw.xyz ACC,VF09,VF00w NOP
|
||||
madd.xyz VF01,VF01,VF09 fcand VI01,262143 ; STALL_LATENCY ?2
|
||||
NOP iaddiu VI01,VI01,0x00007fff
|
||||
NOP mfir.w VF01,VI01
|
||||
NOP ibgtz VI03,vec_3_rgba
|
||||
ftoi4.xyz VF01,VF01 NOP
|
||||
; _LNOPT_w=[ normal2 ] 6 [9 0] 9 [vec_3_stq_rgba]
|
||||
NOP lq VF02,2(VI05)
|
||||
mulq VF01,VF02,Q sq VF01,8(VI07) ; STALL_LATENCY ?3
|
||||
NOP sq VF08,7(VI07)
|
||||
NOP iaddiu VI07,VI07,0x00000009
|
||||
NOP b loop_ctrl
|
||||
NOP sq VF01,-3(VI07)
|
||||
vec_3_rgba:
|
||||
; _LNOPT_w=[ normal2 ] 4 [3 0] 4 [vec_3_rgba]
|
||||
NOP NOP
|
||||
NOP sq VF08,4(VI07)
|
||||
NOP iaddiu VI07,VI07,0x00000006
|
||||
NOP sq VF01,-1(VI07)
|
||||
loop_ctrl:
|
||||
; _LNOPT_w=[ normal2 ] 4 [4 0] 4 [loop_ctrl]
|
||||
NOP iaddiu VI09,VI09,0x00000001
|
||||
NOP iaddiu VI04,VI04,0x00000003
|
||||
NOP ibne VI09,VI02,triangle_loop
|
||||
NOP iaddiu VI05,VI05,0x00000003
|
||||
; _LNOPT_w=[ normal2 ] 3 [1 0] 3 [__v_draw3D_vcl_21]
|
||||
NOP xgkick VI06
|
||||
NOP[E] NOP
|
||||
NOP NOP
|
||||
.align 4
|
||||
VU1Draw3D_CodeEnd:
|
||||
; iCount=145
|
||||
; iCount=103
|
||||
; register stats:
|
||||
; 9 VU User integer
|
||||
; 16 VU User floating point
|
||||
; 10 VU User integer
|
||||
; 11 VU User floating point
|
||||
;-------------------------
|
||||
;-------------------------
|
||||
;-------------------------
|
||||
|
||||
Reference in New Issue
Block a user