18extern QWORD GsPrimWorkArea[];
23void GsOverridePrimAttributes(s8
override, s8 iip, s8 tme, s8 fge, s8 abe, s8 aa1, s8 fst, s8 ctxt, s8 fix)
27 p=UNCACHED_SEG(GsPrimWorkArea);
40 gs_setR_PRMODE(((
GS_R_PRMODE *)&p[2]), iip,tme,fge,abe,aa1,fst,ctxt,fix);
42 GsDmaSend(GsPrimWorkArea, 3);
46void GsEnableDithering(u8 enable,
int mode)
52 p=UNCACHED_SEG(GsPrimWorkArea);
57 gs_setR_DIMX(((
GS_R_DIMX *)&p[2]), 4,2,5,3,0,6,1,7,5,3,4,2,1,7,0,6);
60 GsDmaSend(GsPrimWorkArea, 4);
66 gs_setR_DIMX(((
GS_R_DIMX *)&p[2]), 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
68 GsDmaSend(GsPrimWorkArea, 3);
74void GsEnableAlphaTransparency1(u16 enable,u16 method,u8 alpha_ref,u16 fail_method)
78 p=UNCACHED_SEG(GsPrimWorkArea);
79 GSGLOBAL_TEST1.atest_enable = enable;
80 GSGLOBAL_TEST1.atest_method = method;
81 GSGLOBAL_TEST1.atest_reference = alpha_ref;
82 GSGLOBAL_TEST1.atest_fail_method = fail_method;
84 GsSetPixelTest1(GSGLOBAL_TEST1.atest_enable, GSGLOBAL_TEST1.atest_method, GSGLOBAL_TEST1.atest_reference, GSGLOBAL_TEST1.atest_fail_method,
85 GSGLOBAL_TEST1.datest_enable, GSGLOBAL_TEST1.datest_mode,
86 GSGLOBAL_TEST1.ztest_enable, GSGLOBAL_TEST1.ztest_method);
90 gs_setR_TEXA(((
GS_R_TEXA *)&p[1]), 0x80, 0, 0x00);
92 GsDmaSend(GsPrimWorkArea, 2);
96void GsEnableAlphaTransparency2(u16 enable,u16 method,u8 alpha_ref,u16 fail_method)
100 p=UNCACHED_SEG(GsPrimWorkArea);
101 GSGLOBAL_TEST2.atest_enable = enable;
102 GSGLOBAL_TEST2.atest_method = method;
103 GSGLOBAL_TEST2.atest_reference = alpha_ref;
104 GSGLOBAL_TEST2.atest_fail_method = fail_method;
106 GsSetPixelTest2(GSGLOBAL_TEST2.atest_enable, GSGLOBAL_TEST2.atest_method, GSGLOBAL_TEST2.atest_reference, GSGLOBAL_TEST2.atest_fail_method,
107 GSGLOBAL_TEST2.datest_enable, GSGLOBAL_TEST2.datest_mode,
108 GSGLOBAL_TEST2.ztest_enable, GSGLOBAL_TEST2.ztest_method);
112 gs_setR_TEXA(((
GS_R_TEXA *)&p[1]), 0x80, 0, 0x00);
114 GsDmaSend(GsPrimWorkArea, 2);
118void GsEnableZbuffer1(u16 enable,u16 test_method)
120 GSGLOBAL_TEST1.ztest_enable = enable;
121 GSGLOBAL_TEST1.ztest_method = test_method;
123 GsSetPixelTest1(GSGLOBAL_TEST1.atest_enable, GSGLOBAL_TEST1.atest_method, GSGLOBAL_TEST1.atest_reference, GSGLOBAL_TEST1.atest_fail_method,
124 GSGLOBAL_TEST1.datest_enable, GSGLOBAL_TEST1.datest_mode,
125 GSGLOBAL_TEST1.ztest_enable, GSGLOBAL_TEST1.ztest_method);
128void GsEnableZbuffer2(u16 enable,u16 test_method)
130 GSGLOBAL_TEST2.ztest_enable = enable;
131 GSGLOBAL_TEST2.ztest_method = test_method;
133 GsSetPixelTest2(GSGLOBAL_TEST2.atest_enable, GSGLOBAL_TEST2.atest_method, GSGLOBAL_TEST2.atest_reference, GSGLOBAL_TEST2.atest_fail_method,
134 GSGLOBAL_TEST2.datest_enable, GSGLOBAL_TEST2.datest_mode,
135 GSGLOBAL_TEST2.ztest_enable, GSGLOBAL_TEST2.ztest_method);
139void GsEnableAlphaBlending1(u16 enable)
143 p=UNCACHED_SEG(GsPrimWorkArea);
148 gs_setR_ALPHA_1(((
GS_R_ALPHA *)&p[1]), 0,1,0,1,0x00);
152 gs_setR_ALPHA_1(((
GS_R_ALPHA *)&p[1]), 0,0,0,0,0x80);
155 gs_setR_FBA_1(((
GS_R_FBA *)&p[3]), 0);
156 gs_setR_TEXA(((
GS_R_TEXA *)&p[4]), 0x80, 0, 0x00);
158 GsDmaSend(GsPrimWorkArea, 5);
162void GsEnableAlphaBlending2(u16 enable)
166 p=UNCACHED_SEG(GsPrimWorkArea);
171 gs_setR_ALPHA_2(((
GS_R_ALPHA*)&p[1]), 0,1,0,1,0x00);
175 gs_setR_ALPHA_2(((
GS_R_ALPHA *)&p[1]), 0,0,0,0,0x80);
178 gs_setR_FBA_2(((
GS_R_FBA *)&p[3]), 0);
179 gs_setR_TEXA(((
GS_R_TEXA *)&p[4]), 0x80, 0, 0x00);
181 GsDmaSend(GsPrimWorkArea, 5);