@@ -734,6 +734,101 @@ void gskit_prim_list_sprite_texture_uv_3d(GSGLOBAL *gsGlobal, const GSTEXTURE *T
734734}
735735#endif
736736
737+ #if F_gskit_prim_list_sprite_texture_uv_flat
738+ void gskit_prim_list_sprite_texture_uv_flat (GSGLOBAL * gsGlobal , const GSTEXTURE * Texture , int count , const u128 * flatContent )
739+ {
740+ u64 * p_data ;
741+ u64 * p_store ;
742+ int tw , th ;
743+
744+ int qsize = (count ) + 2 ;
745+ int bytes = count * sizeof (u128 );
746+
747+ gsKit_set_texfilter (gsGlobal , Texture -> Filter );
748+ gsKit_set_tw_th (Texture , & tw , & th );
749+
750+ p_store = p_data = gsKit_heap_alloc (gsGlobal , qsize , (qsize * 16 ), GIF_AD );
751+
752+ if (p_store == gsGlobal -> CurQueue -> last_tag )
753+ {
754+ * p_data ++ = GIF_TAG_AD (qsize );
755+ * p_data ++ = GIF_AD ;
756+ }
757+
758+ if (Texture -> VramClut == 0 )
759+ {
760+ * p_data ++ = GS_SETREG_TEX0 (Texture -> Vram /256 , Texture -> TBW , Texture -> PSM ,
761+ tw , th , gsGlobal -> PrimAlphaEnable , 0 ,
762+ 0 , 0 , 0 , 0 , GS_CLUT_STOREMODE_NOLOAD );
763+ }
764+ else
765+ {
766+ * p_data ++ = GS_SETREG_TEX0 (Texture -> Vram /256 , Texture -> TBW , Texture -> PSM ,
767+ tw , th , gsGlobal -> PrimAlphaEnable , 0 ,
768+ Texture -> VramClut /256 , Texture -> ClutPSM , 0 , 0 , GS_CLUT_STOREMODE_LOAD );
769+ }
770+ * p_data ++ = GS_TEX0_1 + gsGlobal -> PrimContext ;
771+
772+ * p_data ++ = GS_SETREG_PRIM ( GS_PRIM_PRIM_SPRITE , 0 , 1 , gsGlobal -> PrimFogEnable ,
773+ gsGlobal -> PrimAlphaEnable , gsGlobal -> PrimAAEnable ,
774+ 1 , gsGlobal -> PrimContext , 0 );
775+
776+ * p_data ++ = GS_PRIM ;
777+
778+ memcpy (p_data , flatContent , bytes );
779+ }
780+ #endif
781+
782+ #if F_gskit_prim_list_sprite_texture_uv_flat_color
783+ void gskit_prim_list_sprite_texture_uv_flat_color (GSGLOBAL * gsGlobal , const GSTEXTURE * Texture , gs_rgbaq color , int count , const GSPRIMUVPOINTFLAT * vertices )
784+ {
785+ u64 * p_data ;
786+ u64 * p_store ;
787+ int tw , th ;
788+
789+ int qsize = (count * 2 ) + 3 ;
790+ int bytes = count * sizeof (GSPRIMUVPOINTFLAT );
791+
792+ gsKit_set_texfilter (gsGlobal , Texture -> Filter );
793+ gsKit_set_tw_th (Texture , & tw , & th );
794+
795+ p_store = p_data = gsKit_heap_alloc (gsGlobal , qsize , (qsize * 16 ), GIF_AD );
796+
797+ if (p_store == gsGlobal -> CurQueue -> last_tag )
798+ {
799+ * p_data ++ = GIF_TAG_AD (qsize );
800+ * p_data ++ = GIF_AD ;
801+ }
802+
803+ if (Texture -> VramClut == 0 )
804+ {
805+ * p_data ++ = GS_SETREG_TEX0 (Texture -> Vram /256 , Texture -> TBW , Texture -> PSM ,
806+ tw , th , gsGlobal -> PrimAlphaEnable , 0 ,
807+ 0 , 0 , 0 , 0 , GS_CLUT_STOREMODE_NOLOAD );
808+ }
809+ else
810+ {
811+ * p_data ++ = GS_SETREG_TEX0 (Texture -> Vram /256 , Texture -> TBW , Texture -> PSM ,
812+ tw , th , gsGlobal -> PrimAlphaEnable , 0 ,
813+ Texture -> VramClut /256 , Texture -> ClutPSM , 0 , 0 , GS_CLUT_STOREMODE_LOAD );
814+ }
815+ * p_data ++ = GS_TEX0_1 + gsGlobal -> PrimContext ;
816+
817+ * p_data ++ = GS_SETREG_PRIM ( GS_PRIM_PRIM_SPRITE , 0 , 1 , gsGlobal -> PrimFogEnable ,
818+ gsGlobal -> PrimAlphaEnable , gsGlobal -> PrimAAEnable ,
819+ 1 , gsGlobal -> PrimContext , 0 );
820+
821+ * p_data ++ = GS_PRIM ;
822+
823+ // Copy color
824+ memcpy (p_data , & color , sizeof (gs_rgbaq ));
825+ p_data += 2 ; // Advance 2 u64, which is 16 bytes the gs_rgbaq struct size
826+ // Copy vertices
827+ memcpy (p_data , vertices , bytes );
828+ }
829+ #endif
830+
831+
737832#if F_gsKit_prim_triangle_texture_3d
738833void gsKit_prim_triangle_texture_3d (GSGLOBAL * gsGlobal , GSTEXTURE * Texture ,
739834 float x1 , float y1 , int iz1 , float u1 , float v1 ,
0 commit comments