18extern QWORD GsPrimWorkArea[];
26 asm volatile (
"plzcw %0, %1\n":
"=r" (res) :
"r" (val));
36int GsSetXYOffset1(u16 x, u16 y)
39 p=UNCACHED_SEG(GsPrimWorkArea);
43 GsDmaSend(GsPrimWorkArea, 2);
49int GsSetXYOffset2(u16 x, u16 y)
52 p=UNCACHED_SEG(GsPrimWorkArea);
56 GsDmaSend(GsPrimWorkArea, 2);
62int GsSetScissor1(u16 upper_x, u16 upper_y, u16 lower_x, u16 lower_y)
65 p=UNCACHED_SEG(GsPrimWorkArea);
67 gs_setR_SCISSOR_1(((
GS_R_SCISSOR *)&p[1]), upper_x,lower_x,upper_y,lower_y);
69 GsDmaSend(GsPrimWorkArea, 2);
75int GsSetScissor2(u16 upper_x, u16 upper_y, u16 lower_x, u16 lower_y)
78 p=UNCACHED_SEG(GsPrimWorkArea);
80 gs_setR_SCISSOR_2(((
GS_R_SCISSOR *)&p[1]), upper_x,lower_x,upper_y,lower_y);
82 GsDmaSend(GsPrimWorkArea, 2);
88int GsSetFrame1(u16 framebuffer_addr, u8 framebuffer_width, u8 psm, u32 draw_mask)
91 p=UNCACHED_SEG(GsPrimWorkArea);
93 gs_setR_FRAME_1(((
GS_R_FRAME *)&p[1]), framebuffer_addr,framebuffer_width,psm,draw_mask);
95 GsDmaSend(GsPrimWorkArea, 2);
101int GsSetFrame2(u16 framebuffer_addr, u8 framebuffer_width, u8 psm, u32 draw_mask)
104 p=UNCACHED_SEG(GsPrimWorkArea);
106 gs_setR_FRAME_2(((
GS_R_FRAME *)&p[1]), framebuffer_addr,framebuffer_width,psm,draw_mask);
108 GsDmaSend(GsPrimWorkArea, 2);
114int GsTextureFlush(
void)
117 p=UNCACHED_SEG(GsPrimWorkArea);
121 GsDmaSend(GsPrimWorkArea,2);
127int GsSetPixelTest1(u8 enable_alpha_test, u8 alpha_test_method, u8 alpha_reference, u8 alpha_fail_method, u8 enable_dest_alpha_test, u8 dest_alpha_test_mode, u8 enable_zbuff_test, u8 alpha_zbuff_method)
130 p=UNCACHED_SEG(GsPrimWorkArea);
132 gs_setR_TEST_1(((
GS_R_TEST *)&p[1]), enable_alpha_test, alpha_test_method, alpha_reference, alpha_fail_method, enable_dest_alpha_test, dest_alpha_test_mode, enable_zbuff_test, alpha_zbuff_method);
134 GsDmaSend(GsPrimWorkArea, 2);
140int GsSetPixelTest2(u8 enable_alpha_test, u8 alpha_test_method, u8 alpha_reference, u8 alpha_fail_method, u8 enable_dest_alpha_test, u8 dest_alpha_test_mode, u8 enable_zbuff_test, u8 alpha_zbuff_method)
143 p=UNCACHED_SEG(GsPrimWorkArea);
145 gs_setR_TEST_2(((
GS_R_TEST *)&p[1]), enable_alpha_test, alpha_test_method, alpha_reference, alpha_fail_method, enable_dest_alpha_test, dest_alpha_test_mode, enable_zbuff_test, alpha_zbuff_method);
147 GsDmaSend(GsPrimWorkArea, 2);
153int GsSelectTexure1(u16 tex_addr, u8 addr_width, u8 tex_pixmode, u16 tex_width, u16 tex_height, u16 clut_addr, u8 clut_pixmode, u8 clut_storagemode,u8 clut_offset)
156 p=UNCACHED_SEG(GsPrimWorkArea);
158 gs_setR_TEX0_1(((
GS_R_TEX0 *)&p[1]), tex_addr,addr_width,tex_pixmode, twh(tex_width), twh(tex_height),1,0,clut_addr,clut_pixmode,clut_storagemode,clut_offset,4);
160 GsDmaSend(GsPrimWorkArea, 2);
166int GsSelectTexure2(u16 tex_addr, u8 addr_width, u8 tex_pixmode, u16 tex_width, u16 tex_height, u16 clut_addr, u8 clut_pixmode, u8 clut_storagemode,u8 clut_offset)
169 p=UNCACHED_SEG(GsPrimWorkArea);
171 gs_setR_TEX0_2(((
GS_R_TEX0 *)&p[1]), tex_addr, addr_width, tex_pixmode, twh(tex_width), twh(tex_height), 1, 0, clut_addr, clut_pixmode, clut_storagemode,clut_offset,5);
173 GsDmaSend(GsPrimWorkArea, 2);
179void GsSetFogColor(u8 r, u8 g, u8 b)
182 p=UNCACHED_SEG(GsPrimWorkArea);
186 GsDmaSend(GsPrimWorkArea, 2);
190void GsEnableColorClamp(u16 enable)
193 p=UNCACHED_SEG(GsPrimWorkArea);
197 GsDmaSend(GsPrimWorkArea, 2);