PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
libgs.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# (c) 2009 Lion
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#ifndef __LIBGS_H__
17#define __LIBGS_H__
18
19#include <tamtypes.h>
20
21typedef struct {
31
33#define GS_INIT_RESET 0
35#define GS_INIT_DRAW_RESET 1
36
37#define GS_NONINTERLACED 0x00
38#define GS_INTERLACED 0x01
39
41#define GS_FFMD_FIELD 0x00
43#define GS_FFMD_FRAME 0x01
44
45/* About the supported video modes:
46 As GsSetDefaultDisplayEnv() has been modified to provide functionality that is similar to the Sony sceGsSetDefDispEnv() function,
47 it will now automatically in fill in the GS_DISPENV structure with values for the video mode that is specified for GsResetGraph().
48
49 However, as with the Sony function:
50 1. Only NTSC, PAL and 480P video modes are supported.
51 2. MAGV isn't automatically calculated.
52
53 It is possible to cover these limitations by setting the relevant values after calling GsSetDefaultDisplayEnv(), but I do not know how these values are to be calculated for other video modes.
54*/
55enum GsVideoModes{
56 GS_MODE_NTSC = 0x02,
57 GS_MODE_PAL,
58
59 GS_MODE_DTV_480P = 0x50,
60};
61
62#define GS_DISABLE 0
63#define GS_ENABLE 1
64
70 GS_PRIM_TRI,
71 GS_PRIM_TRI_STRIP,
72 GS_PRIM_TRI_FAN,
74};
75
77#define GS_PIXMODE_32 0
78#define GS_PIXMODE_24 1
79#define GS_PIXMODE_16 2
80#define GS_PIXMODE_16S 10
81
83#define GS_CLUT_32 0
84#define GS_CLUT_16 2
85#define GS_CLUT_16S 10
86
88#define GS_TEX_32 0
89#define GS_TEX_24 1
90#define GS_TEX_16 2
91#define GS_TEX_16S 10
92#define GS_TEX_8 19
93#define GS_TEX_4 20
94#define GS_TEX_8H 27
95#define GS_TEX_4HL 36
96#define GS_TEX_4HH 44
97
99#define GS_ZBUFF_32 48
100#define GS_ZBUFF_24 49
101#define GS_ZBUFF_16 50
102#define GS_ZBUFF_16S 58
103
106 GS_ALPHA_NEVER =0,
107 GS_ALPHA_ALWAYS,
108 GS_ALPHA_LESS,
109 GS_ALPHA_LEQUAL,
110 GS_ALPHA_EQUAL,
111 GS_ALPHA_GEQUAL,
112 GS_ALPHA_GREATER,
113 GS_ALPHA_NOTEQUAL,
114};
115
120 GS_ALPHA_FB_ONLY,
121 GS_ALPHA_ZB_ONLY,
122 GS_ALPHA_RGB_ONLY
123};
124
127 GS_ZBUFF_NEVER =0,
128 GS_ZBUFF_ALWAYS,
129 GS_ZBUFF_GEQUAL,
130 GS_ZBUFF_GREATER
131};
132
133// Texture Details
135#define GS_TEX_CALC 0
137#define GS_TEX_FIXED 1
138
155
161 GS_TEX_NEAREST_MIPMAP_NEAREST,
162 GS_TEX_NEAREST_MIPMAP_LINEAR,
163 GS_TEX_LINEAR_MIPMAP_NEAREST,
164 GS_TEX_LINEAR_MIPMAP_LINEAR
165};
166
168#define GS_TEX_MIPMAP_DEFINE 0
170#define GS_TEX_MIPMAP_AUTO 1
171
179
181 GS_GIF_PACKED =0,
182 GS_GIF_REGLIST,
183 GS_GIF_IMAGE,
187
188/*GS Privileged Regs*/
190#define gs_p_pmode 0x12000000
192#define gs_p_smode1 0x12000010
194#define gs_p_smode2 0x12000020
196#define gs_p_dispfb1 0x12000070
198#define gs_p_display1 0x12000080
200#define gs_p_dispfb2 0x12000090
202#define gs_p_display2 0x120000a0
203#define gs_p_extbuf 0x120000b0
204#define gs_p_extdata 0x120000c0
205#define gs_p_extwrite 0x120000d0
207#define gs_p_bgcolor 0x120000e0
209#define gs_p_csr 0x12001000
211#define gs_p_imr 0x12001010
213#define gs_p_busdir 0x12001040
215#define gs_p_siglblid 0x12001080
216
217
218/*GS General Purpose Regs*/
220#define gs_g_prim 0x00
222#define gs_g_rgbaq 0x01
224#define gs_g_st 0x02
226#define gs_g_uv 0x03
228#define gs_g_xyzf2 0x04
230#define gs_g_xyz2 0x05
232#define gs_g_tex0_1 0x06
234#define gs_g_tex0_2 0x07
236#define gs_g_clamp_1 0x08
238#define gs_g_clamp_2 0x09
240#define gs_g_fog 0x0a
242#define gs_g_xyzf3 0x0c
244#define gs_g_xyz3 0x0d
245#define gs_g_tex1_1 0x14
246#define gs_g_tex1_2 0x15
248#define gs_g_tex2_1 0x16
250#define gs_g_tex2_2 0x17
252#define gs_g_xyoffset_1 0x18
254#define gs_g_xyoffset_2 0x19
256#define gs_g_prmodecont 0x1a
258#define gs_g_prmode 0x1b
259#define gs_g_texclut 0x1c
261#define gs_g_scanmsk 0x22
263#define gs_g_miptbp1_1 0x34
265#define gs_g_miptbp1_2 0x35
267#define gs_g_miptbp2_1 0x36
269#define gs_g_miptbp2_2 0x37
271#define gs_g_texa 0x3b
273#define gs_g_fogcol 0x3d
275#define gs_g_texflush 0x3f
277#define gs_g_scissor_1 0x40
279#define gs_g_scissor_2 0x41
281#define gs_g_alpha_1 0x42
283#define gs_g_alpha_2 0x43
285#define gs_g_dimx 0x44
287#define gs_g_dthe 0x45
289#define gs_g_colclamp 0x46
291#define gs_g_test_1 0x47
293#define gs_g_test_2 0x48
295#define gs_g_pabe 0x49
297#define gs_g_fba_1 0x4a
299#define gs_g_fba_2 0x4b
301#define gs_g_frame_1 0x4c
303#define gs_g_frame_2 0x4d
305#define gs_g_zbuf_1 0x4e
307#define gs_g_zbuf_2 0x4f
309#define gs_g_bitbltbuf 0x50
311#define gs_g_trxpos 0x51
313#define gs_g_trxreg 0x52
315#define gs_g_trxdir 0x53
316#define gs_g_hwreg 0x54
317#define gs_g_signal 0x60
318#define gs_g_finish 0x61
319#define gs_g_label 0x62
321#define gs_g_nop 0x7f
322
323
324/*GIF Register Descriptors (non-registers) */
326#define gif_rd_ad 0x0e
328#define gif_rd_nop 0x0f
329
330/* MISC */
331
332#ifndef QWORD
333typedef struct {
334
335 u64 lo;
336 u64 hi;
337
338}QWORD __attribute__((aligned(16)));/*aligned 128bits*/
339
340#endif/*QWORD*/
341
342/* GS Privileged Reg STRUCTs */
343
344typedef struct {
350 u32 crt_out :3;
352 u32 mmod :1;
354 u32 amod :1;
360 u32 nfld :1;
362 u32 pad1 :15;
364 u32 exvwins :10;
366 u32 exvwine :10;
368 u32 exsyncmd :1;
370 u32 pad2 :11;
371}GS_PMODE;
372
373typedef struct {
374 u64 rc :3;
375 u64 lc :7;
376 u64 t1248 :2;
377 u64 slck :1;
378 u64 cmod :2;
379 u64 ex :1;
380 u64 prst :1;
381 u64 sint :1;
382 u64 xpck :1;
383 u64 pck2 :2;
384 u64 spml :4;
385 u64 gcont :1;
386 u64 phs :1;
387 u64 pvs :1;
388 u64 pehs :1;
389 u64 pevs :1;
390 u64 clksel :2;
391 u64 nvck :1;
392 u64 slck2 :1;
393 u64 vcksel :2;
394 u64 vhp :2;
395 u64 pad :26;
396}GS_SMODE1;
397
398typedef struct {
399 u32 interlace :1;
400 u32 field_frame :1;
401 u32 vesta_dpms :2;
402 u64 pad2 :60;
403}GS_SMODE2;
404
405typedef struct {
407 u32 address :9;
409 u32 fbw :6;
411 u32 psm :5;
413 u32 pad1 :12;
415 u32 x :11;
417 u32 y :11;
419 u32 pad2 :10;
420}GS_DISPFB;
421
422typedef struct {
424 u32 display_x :12;
426 u32 display_y :11;
428 u32 magnify_h :4;
430 u32 magnify_v :2;
432 u32 pad1 :3;
434 u32 display_w :12;
436 u32 display_h :11;
438 u32 pad2 :9;
440
441typedef struct {
442 u64 exbp : 14;
443 u64 exbw : 6;
444 u64 fbin : 2;
445 u64 wffmd : 1;
446 u64 emoda : 2;
447 u64 emodc : 2;
448 u64 pad1 : 5;
449 u64 wdx : 11;
450 u64 wdy : 11;
451 u64 pad2 : 10;
452}GS_EXTBUF;
453
454typedef struct {
456 u32 x :12;
458 u32 y :11;
464 u32 pad1 :3;
466 u32 write_w :12;
468 u32 write_h :11;
470 u32 pad2 :9;
472
473typedef struct {
475 u32 write :1;
477 u32 pad1 :31;
479 u32 pad2;
481
482typedef struct {
484 u8 r;
486 u8 g;
488 u8 b;
492 float padq;
494
495typedef struct {
507 u32 exhsint :1;
509 u32 exvsint :1;
511 u32 pad1 :1;
513 u32 flush :1;
515 u32 reset :1;
517 u32 exverr :1;
519 u32 exfield :1;
521 u32 nfield :1;
529 u32 gs_id :8;
531 u32 pad2 :32;
532
533}GS_CSR;
534
535typedef struct {
537 u32 pad1 :8;
549 u32 exhs_mask :1;
551 u32 exvs_mask :1;
553 u32 pad2 :17;
555 u32 pad3;
556}GS_IMR;
557
558typedef struct {
560 u32 direction :1;
562 u32 p0 :31;
564 u32 p1;
565}GS_BUSDIR;
566
567#if 0
568typedef struct {
570 u32 id;
571 u32 p0;
572}GS_SIGLBLID;
573#endif
574
575/*
576 * GENERAL PURPOSE REG STRUCTS
577 *
578 * these structs have a size of 64 bits
579 */
580
581typedef struct {
582 u64 prim_type :3;
583 u64 iip :1;
584 u64 tme :1;
585 u64 fge :1;
586 u64 abe :1;
587 u64 aa1 :1;
588 u64 fst :1;
589 u64 ctxt :1;
590 u64 fix :1;
591 u64 pad1 :53;
592}GS_PRIM;
593
594typedef struct {
595 u8 r;
596 u8 g;
597 u8 b;
598 u8 a;
599 float q;
600}GS_RGBAQ;
601
602typedef struct {
603 float s;
604 float t;
605}GS_ST;
606
607typedef struct {
608 u64 u :14;
609 u64 pad1 :2;
610 u64 v :14;
611 u64 pad2 :34;
612}GS_UV;
613
614typedef struct {
615 u16 x;
616 u16 y;
617 u32 z:24;
618 u8 f;
619}GS_XYZF;
620
621typedef struct {
622 u16 x;
623 u16 y;
624 u32 z;
625}GS_XYZ;
626
627typedef struct {
628 u64 tb_addr :14;
629 u64 tb_width :6;
630 u64 psm :6;
631 u64 tex_width :4;
632 u64 tex_height :4;
633 u64 tex_cc :1;
634 u64 tex_funtion :2;
635 u64 cb_addr :14;
636 u64 clut_pixmode :4;
637 u64 clut_smode :1;
638 u64 clut_offset :5;
639 u64 clut_loadmode :3;
640
641}GS_TEX0;
642
643typedef struct {
644 u64 wrap_mode_s :2;
645 u64 wrap_mode_t :2;
646 u64 min_clamp_u :10;
647 u64 max_clamp_u :10;
648 u64 min_clamp_v :10;
649 u64 max_clamp_v :10;
650 u64 pad0 :20;
651}GS_CLAMP;
652
653typedef struct {
654 u64 pad1 :56;
655 u8 f;
656}GS_FOG;
657
658typedef struct {
659 u64 lcm :1;
660 u64 pad1 :1;
661 u64 mxl :3;
662 u64 mmag :1;
663 u64 mmin :3;
664 u64 mtba :1;
665 u64 pad2 :9;
666 u64 l :2;
667 u64 pad3 :11;
668 u64 k :12;
669 u64 pad4 :20;
670}GS_TEX1;
671
672typedef struct {
673 u64 pad1 :20;
674 u64 psm :6;
675 u64 pad2 :11;
676 u64 cb_addr :14;
677 u64 clut_psm :4;
678 u64 clut_smode :1;
679 u64 clut_offset :5;
680 u64 clut_loadmode :3;
681}GS_TEX2;
682
683typedef struct {
684 u64 offset_x :16;
685 u16 pad1;
686 u64 offset_y :16;
687 u16 pad2;
689
690typedef struct {
691 u64 control:1;
692 u64 pad1 :63;
694
695typedef struct {
696 u64 pad1 :3;
697 u64 iip :1;
698 u64 tme :1;
699 u64 fge :1;
700 u64 abe :1;
701 u64 aa1 :1;
702 u64 fst :1;
703 u64 ctxt :1;
704 u64 fix :1;
705 u64 pad2 :53;
706}GS_PRMODE;
707
708typedef struct {
709 u64 cb_width :6;
710 u64 clut_uoffset :6;
711 u64 clut_voffset :10;
712 u64 pad0:42;
714
715typedef struct {
716 u64 mask:2;
717 u64 pad0:62;
719
720typedef struct {
721 u64 tb_addr1 :14;
722 u64 tb_width1 :6;
723 u64 tb_addr2 :14;
724 u64 tb_width2 :6;
725 u64 tb_addr3 :14;
726 u64 tb_width3 :6;
727 u64 pad1 :4;
729
730typedef struct {
731 u64 tb_addr4 :14;
732 u64 tb_width4 :6;
733 u64 tb_addr5 :14;
734 u64 tb_width5 :6;
735 u64 tb_addr6 :14;
736 u64 tb_width6 :6;
737 u64 pad0 :4;
739
740typedef struct {
741 u64 alpha_0 : 8;
742 u64 pad1 : 7;
743 u64 alpha_method : 1;
744 u64 pad2 :16;
745 u64 alpha_1 : 8;
746 u64 pad3 :24;
747}GS_TEXA;
748
749typedef struct {
750 u64 r :8;
751 u64 g :8;
752 u64 b :8;
753 u64 pad1 :40;
755
756typedef struct {
758 u64 pad1;
760
761typedef struct {
762 u64 clip_x0 :11;
763 u64 pad1 :5;
764 u64 clip_x1 :11;
765 u64 pad2 :5;
766 u64 clip_y0 :11;
767 u64 pad3 :5;
768 u64 clip_y1 :11;
769 u64 pad4 :5;
771
772typedef struct {
773 u64 a :2;
774 u64 b :2;
775 u64 c :2;
776 u64 d :2;
777 u64 pad0 :24;
778 u64 alpha :8;
779 u64 pad1 :24;
780}GS_ALPHA;
781
782typedef struct {
783 u64 dimx00:3;
784 u64 pad0:1;
785 u64 dimx01:3;
786 u64 pad1:1;
787 u64 dimx02:3;
788 u64 pad2:1;
789 u64 dimx03:3;
790 u64 pad3:1;
791
792 u64 dimx10:3;
793 u64 pad4:1;
794 u64 dimx11:3;
795 u64 pad5:1;
796 u64 dimx12:3;
797 u64 pad6:1;
798 u64 dimx13:3;
799 u64 pad7:1;
800
801 u64 dimx20:3;
802 u64 pad8:1;
803 u64 dimx21:3;
804 u64 pad9:1;
805 u64 dimx22:3;
806 u64 pad10:1;
807 u64 dimx23:3;
808 u64 pad11:1;
809
810 u64 dimx30:3;
811 u64 pad12:1;
812 u64 dimx31:3;
813 u64 pad13:1;
814 u64 dimx32:3;
815 u64 pad14:1;
816 u64 dimx33:3;
817 u64 pad15:1;
818} GS_DIMX;
819
820typedef struct {
821 u64 enable:1;
822 u64 pad01:63;
823} GS_DTHE;
824
825typedef struct {
826 u64 clamp:1;
827 u64 pad01:63;
829
830typedef struct {
831 u64 atest_enable :1;
832 u64 atest_method :3;
833 u64 atest_reference :8;
834 u64 atest_fail_method :2;
835 u64 datest_enable :1;
836 u64 datest_mode :1;
837 u64 ztest_enable :1;
838 u64 ztest_method :2;
839 u64 pad1 :45;
840} GS_TEST;
841
842typedef struct {
843 u64 enable:1;
844 u64 pad0:63;
845}GS_PABE;
846
847typedef struct {
848 u64 alpha:1;
849 u64 pad0:63;
850}GS_FBA;
851
852typedef struct {
853 u64 fb_addr :9;
854 u64 pad1 :7;
855 u64 fb_width :6;
856 u64 pad2 :2;
857 u64 psm :6;
858 u64 pad3 :2;
859 u64 draw_mask :32;
860} GS_FRAME;
861
862typedef struct {
863 u64 fb_addr :9;
864 u64 pad1 :15;
865 u64 psm :4;
866 u64 pad2 :4;
867 u64 update_mask :1;
868 u64 pad3 :31;
869}GS_ZBUF;
870
871typedef struct {
872 u64 src_addr :14;
873 u64 pad1 :2;
874 u64 src_width :6;
875 u64 pad2 :2;
876 u64 src_pixmode :6;
877 u64 pad3 :2;
878 u64 dest_addr :14;
879 u64 pad4 :2;
880 u64 dest_width :6;
881 u64 pad5 :2;
882 u64 dest_pixmode:6;
883 u64 pad6 :2;
885
886typedef struct {
887 u64 src_x :11;
888 u64 pad1 :5;
889 u64 src_y :11;
890 u64 pad2 :5;
891 u64 dest_x :11;
892 u64 pad3 :5;
893 u64 dest_y :11;
894 u64 direction :2;
895 u64 pad4 :3;
896}GS_TRXPOS;
897
898typedef struct {
899 u64 trans_w :12;
900 u64 pad1 :20;
901 u64 trans_h :12;
902 u64 pad2 :20;
903}GS_TRXREG;
904
905
906typedef struct {
907 u64 trans_dir :2;
908 u64 pad1 :62;
909}GS_TRXDIR;
910
911typedef struct {
912 u64 data;
913}GS_HWREG;
914
915typedef struct {
916 u32 signal_id;
917 u32 update_mask;
918}GS_SIGNAL;
919
920typedef struct {
921 u64 pad0;
922}GS_FINISH;
923
924
925typedef struct {
926 u32 label_id;
927 u32 update_mask;
928}GS_LABEL;
929
930typedef struct {
931 u64 pad0;
932}GS_NOP;
933
934/*
935 * GENERAL PURPOSE REG STRUCTS 'WITH' A 64 BIT REG
936 *
937 * these structs have a size of 128 bits (1 QWORD)
938 */
939
940typedef struct {
941 GS_PRIM data;
942 u64 reg;
943}GS_R_PRIM;
944
945typedef struct {
946 GS_RGBAQ data;
947 u64 reg;
949
950typedef struct {
951 GS_ST data;
952 u64 reg;
953}GS_R_ST;
954
955typedef struct {
956 GS_UV data;
957 u64 reg;
958}GS_R_UV;
959
960typedef struct {
961 GS_XYZF data;
962 u64 reg;
963}GS_R_XYZF;
964
965typedef struct {
966 GS_XYZ data;
967 u64 reg;
968}GS_R_XYZ;
969
970typedef struct {
971 GS_TEX0 data;
972 u64 reg;
973}GS_R_TEX0;
974
975typedef struct {
976 GS_CLAMP data;
977 u64 reg;
979
980typedef struct {
981 GS_FOG data;
982 u64 reg;
983}GS_R_FOG;
984
985typedef struct {
986 GS_TEX1 data;
987 u64 reg;
988}GS_R_TEX1;
989
990typedef struct {
991 GS_TEX2 data;
992 u64 reg;
993}GS_R_TEX2;
994
995typedef struct {
996 GS_XYOFFSET data;
997 u64 reg;
999
1000typedef struct {
1001 GS_PRMODECONT data;
1002 u64 reg;
1004
1005typedef struct {
1006 GS_PRMODE data;
1007 u64 reg;
1009
1010typedef struct {
1011 GS_TEXCLUT data;
1012 u64 reg;
1014
1015typedef struct {
1016 GS_SCANMSK data;
1017 u64 reg;
1019
1020typedef struct {
1021 GS_MIPTBP1 data;
1022 u64 reg;
1023} GS_R_MIPTBP1;
1024
1025typedef struct {
1026 GS_MIPTBP2 data;
1027 u64 reg;
1029
1030typedef struct {
1031 GS_TEXA data;
1032 u64 reg;
1033}GS_R_TEXA;
1034
1035typedef struct {
1036 GS_FOGCOLOR data;
1037 u64 reg;
1039
1040typedef struct {
1041 GS_TEXFLUSH data;
1042 u64 reg;
1044
1045typedef struct {
1046 GS_SCISSOR data;
1047 u64 reg;
1049
1050typedef struct {
1051 GS_ALPHA data;
1052 u64 reg;
1053}GS_R_ALPHA;
1054
1055typedef struct {
1056 GS_DIMX data;
1057 u64 reg;
1058} GS_R_DIMX;
1059
1060typedef struct {
1061 GS_DTHE data;
1062 u64 reg;
1063} GS_R_DTHE;
1064
1065typedef struct {
1066 GS_COLCLAMP data;
1067 u64 reg;
1069
1070typedef struct {
1071 GS_TEST data;
1072 u64 reg;
1073} GS_R_TEST;
1074
1075typedef struct {
1076 GS_PABE data;
1077 u64 reg;
1078}GS_R_PABE;
1079
1080typedef struct {
1081 GS_FBA data;
1082 u64 reg;
1083}GS_R_FBA;
1084
1085typedef struct {
1086 GS_FRAME data;
1087 u64 reg;
1088} GS_R_FRAME;
1089
1090typedef struct {
1091 GS_ZBUF data;
1092 u64 reg;
1093}GS_R_ZBUF;
1094
1095typedef struct {
1096 GS_BITBLTBUF data;
1097 u64 reg;
1099
1100typedef struct {
1101 GS_TRXPOS data;
1102 u64 reg;
1104
1105typedef struct {
1106 GS_TRXREG data;
1107 u64 reg;
1109
1110typedef struct {
1111 GS_TRXDIR data;
1112 u64 reg;
1114
1115typedef struct {
1116 GS_HWREG data;
1117 u64 reg;
1118}GS_R_HWREG;
1119
1120typedef struct {
1121 GS_SIGNAL data;
1122 u64 reg;
1124
1125typedef struct {
1126 GS_FINISH data;
1127 u64 reg;
1129
1130typedef struct {
1131 GS_LABEL data;
1132 u64 reg;
1133}GS_R_LABEL;
1134
1135typedef struct {
1136 GS_NOP data;
1137 u64 reg;
1138}GS_R_NOP;
1139
1140/* Set Funtion For GS Privileged Regs */
1141
1142#define GS_SET_PMODE(enable_rc1, enable_rc2, mmod, amod, blend_style, blend_value) \
1143 *(vu64 *)gs_p_pmode = \
1144 (u64)((enable_rc1 ) & 0x00000001) << 0 | \
1145 (u64)((enable_rc2 ) & 0x00000001) << 1 | \
1146 (u64)((1 ) & 0x00000007) << 2 | \
1147 (u64)((mmod ) & 0x00000001) << 5 | \
1148 (u64)((amod ) & 0x00000001) << 6 | \
1149 (u64)((blend_style) & 0x00000001) << 7 | \
1150 (u64)((blend_value) & 0x000000FF) << 8
1151
1153#define GS_SET_SMODE1(rc, lc, t1248, slck, cmod, ex, prst, sint, xpck, \
1154 pck2, spml, gcont, phs, pvs, pehs, pevs, clksel, \
1155 nvck, slck2, vcksel, vhp) \
1156 *(vu64 *)gs_p_smode1 = \
1157 (u64)((rc ) & 0x00000007) << 0 | \
1158 (u64)((lc ) & 0x0000007F) << 3 | \
1159 (u64)((t1248 ) & 0x00000003) << 10 | \
1160 (u64)((slck ) & 0x00000001) << 12 | \
1161 (u64)((cmod ) & 0x00000003) << 13 | \
1162 (u64)((ex ) & 0x00000001) << 15 | \
1163 (u64)((prst ) & 0x00000001) << 16 | \
1164 (u64)((sint ) & 0x00000001) << 17 | \
1165 (u64)((xpck ) & 0x00000001) << 18 | \
1166 (u64)((pck2 ) & 0x00000003) << 19 | \
1167 (u64)((spml ) & 0x0000000F) << 21 | \
1168 (u64)((gcont ) & 0x00000001) << 25 | \
1169 (u64)((phs ) & 0x00000001) << 26 | \
1170 (u64)((pvs ) & 0x00000001) << 27 | \
1171 (u64)((pehs ) & 0x00000001) << 28 | \
1172 (u64)((pevs ) & 0x00000001) << 29 | \
1173 (u64)((clksel ) & 0x00000003) << 30 | \
1174 (u64)((nvck ) & 0x00000001) << 32 | \
1175 (u64)((slck2 ) & 0x00000001) << 33 | \
1176 (u64)((vcksel ) & 0x00000003) << 34 | \
1177 (u64)((vhp ) & 0x00000003) << 36
1178
1179#define GS_SET_SMODE2(interlace, field_frame, vesta_dpms) \
1180 *(vu64 *)gs_p_smode2 = \
1181 (u64)((interlace ) & 0x00000001) << 0 | \
1182 (u64)((field_frame ) & 0x00000001) << 1 | \
1183 (u64)((vesta_dpms ) & 0x00000003) << 2
1184
1185#define GS_SET_DISPFB1(address, width, psm, x, y) \
1186 *(vu64 *)gs_p_dispfb1=\
1187 (u64)((address ) & 0x000001FF) << 0 | \
1188 (u64)((width ) & 0x0000003F) << 9 | \
1189 (u64)((psm ) & 0x0000001F) << 15 | \
1190 (u64)((x ) & 0x000007FF) << 32 | \
1191 (u64)((y ) & 0x000007FF) << 43
1192
1193#define GS_SET_DISPFB2(address, width, psm, x, y) \
1194 *(vu64 *)gs_p_dispfb2=\
1195 (u64)((address ) & 0x000001FF) << 0 | \
1196 (u64)((width ) & 0x0000003F) << 9 | \
1197 (u64)((psm ) & 0x0000001F) << 15 | \
1198 (u64)((x ) & 0x000007FF) << 32 | \
1199 (u64)((y ) & 0x000007FF) << 43
1200
1201#define GS_SET_DISPLAY1(display_x, display_y,magnify_h,magnify_v,display_w,display_h) \
1202 *(vu64 *)gs_p_display1 = \
1203 (u64)((display_x) & 0x00000FFF) << 0 | \
1204 (u64)((display_y) & 0x000007FF) << 12 | \
1205 (u64)((magnify_h) & 0x0000000F) << 23 | \
1206 (u64)((magnify_v) & 0x00000003) << 27 | \
1207 (u64)((display_w) & 0x00000FFF) << 32 | \
1208 (u64)((display_h) & 0x000007FF) << 44
1209
1210#define GS_SET_DISPLAY2(display_x, display_y,magnify_h,magnify_v,display_w,display_h) \
1211 *(vu64 *)gs_p_display2 = \
1212 (u64)((display_x) & 0x00000FFF) << 0 | \
1213 (u64)((display_y) & 0x000007FF) << 12 | \
1214 (u64)((magnify_h) & 0x0000000F) << 23 | \
1215 (u64)((magnify_v) & 0x00000003) << 27 | \
1216 (u64)((display_w) & 0x00000FFF) << 32 | \
1217 (u64)((display_h) & 0x000007FF) << 44
1218
1219#define GS_SET_EXTBUF(A,B,C,D,E,F,G,H) \
1220 *(vu64 *)gs_p_extbuf = \
1221 (u64)((A) & 0x00003FFF) << 0 | \
1222 (u64)((B) & 0x0000003F) << 14 | \
1223 (u64)((C) & 0x00000003) << 20 | \
1224 (u64)((D) & 0x00000001) << 22 | \
1225 (u64)((E) & 0x00000003) << 23 | \
1226 (u64)((F) & 0x00000003) << 25 | \
1227 (u64)((G) & 0x000007FF) << 32 | \
1228 (u64)((H) & 0x000007FF) << 43
1229
1230#define GS_SET_EXTDATA(x, y, sample_r_h, sample_r_v, write_w, write_h) \
1231 *(vu64 *)gs_p_extdata = \
1232 (u64)((x ) & 0x00000FFF) << 0 | \
1233 (u64)((y ) & 0x000007FF) << 12 | \
1234 (u64)((sample_r_h ) & 0x0000000F) << 23 | \
1235 (u64)((sample_r_v ) & 0x00000003) << 27 | \
1236 (u64)((write_w ) & 0x00000FFF) << 32 | \
1237 (u64)((write_h ) & 0x000007FF) << 44
1238
1239#define GS_SET_EXTWRITE(write)\
1240 *(vu64 *)gs_p_extwrite = \
1241 (u64)((write) & 0x00000001)
1242
1243#define GS_SET_BGCOLOR(r,g,b) \
1244 *(vu64 *)gs_p_bgcolor = \
1245 (u64)((r) & 0x000000FF) << 0 | \
1246 (u64)((g) & 0x000000FF) << 8 | \
1247 (u64)((b) & 0x000000FF) << 16
1248
1249#define GS_SET_CSR(signal_evnt,finish_evnt,hsync_intrupt,vsync_intrupt,write_terminate,flush,reset,nfield,current_field,fifo_status,gs_rev_number,gs_id) \
1250 *(vu64 *)gs_p_csr = \
1251 (u64)((signal_evnt ) & 0x00000001) << 0 | \
1252 (u64)((finish_evnt ) & 0x00000001) << 1 | \
1253 (u64)((hsync_intrupt ) & 0x00000001) << 2 | \
1254 (u64)((vsync_intrupt ) & 0x00000001) << 3 | \
1255 (u64)((write_terminate) & 0x00000001) << 4 | \
1256 (u64)((flush ) & 0x00000001) << 8 | \
1257 (u64)((reset ) & 0x00000001) << 9 | \
1258 (u64)((nfield ) & 0x00000001) << 12 | \
1259 (u64)((current_field ) & 0x00000001) << 13 | \
1260 (u64)((fifo_status ) & 0x00000003) << 14 | \
1261 (u64)((gs_rev_number ) & 0x000000FF) << 16 | \
1262 (u64)((gs_id ) & 0x000000FF) << 24
1263
1264#define GS_SET_IMR(signal_mask, finish_mask, hsync_mask, vsync_mask, write_mask, exhs_mask, exvs_mask) \
1265 *(vu64 *)gs_p_imr = \
1266 (u64)((signal_mask) & 0x00000001) << 8 | \
1267 (u64)((finish_mask) & 0x00000001) << 9 | \
1268 (u64)((hsync_mask ) & 0x00000001) << 10 | \
1269 (u64)((vsync_mask ) & 0x00000001) << 11 | \
1270 (u64)((write_mask ) & 0x00000001) << 12 | \
1271 (u64)((exhs_mask ) & 0x00000001) << 13 | \
1272 (u64)((exvs_mask ) & 0x00000001) << 14
1273
1274#define GS_SET_BUSDIR(direction) \
1275 *(vu64 *)gs_p_busdir = \
1276 (u64)((direction) & 0x00000001)
1277
1278#define GS_SET_SIGLBLID(signal_id, label_id) \
1279 *(vu64 *)gs_p_siglblid = \
1280 (u64)((signal_id ) & 0xFFFFFFFF) << 0 | \
1281 (u64)((label_id ) & 0xFFFFFFFF) << 32
1282
1283/*
1284 * These are use to SET the individual values
1285 * in each of the readable Privileged registers.
1286 */
1287
1288#define GS_SET_CSR_signal_evnt(val) \
1289 GS_SET_CSR(val,0,0,0,0,0,0,0,0,0,0,0)
1290
1291#define GS_SET_CSR_finish_evnt(val) \
1292 GS_SET_CSR(0,val,0,0,0,0,0,0,0,0,0,0)
1293
1294#define GS_SET_CSR_hsync_intrupt(val) \
1295 GS_SET_CSR(0,0,val,0,0,0,0,0,0,0,0,0)
1296
1297#define GS_SET_CSR_vsync_intrupt(val) \
1298 GS_SET_CSR(0,0,0,val,0,0,0,0,0,0,0,0)
1299
1300#define GS_SET_CSR_write_terminate(val) \
1301 GS_SET_CSR(0,0,0,0,val,0,0,0,0,0,0,0)
1302
1303#define GS_SET_CSR_flush(val) \
1304 GS_SET_CSR(0,0,0,0,0,val,0,0,0,0,0,0)
1305
1306#define GS_SET_CSR_reset(val) \
1307 GS_SET_CSR(0,0,0,0,0,0,val,0,0,0,0,0)
1308
1309/*nfield (r)*/
1310/*current_field (r)*/
1311/*fifo_status (r)*/
1312/*gs_rev_number (r)*/
1313/*gs_id (r)*/
1314
1315/*
1316 * These are use to GET the individual values
1317 * in each of the readable Privileged registers.
1318 */
1319
1320#define GS_GET_CSR_signal_evnt \
1321 (*((vu64 *)(gs_p_csr)) & (0x00000001 << 0))
1322
1323#define GS_GET_CSR_finish_evnt \
1324 (*((vu64 *)(gs_p_csr)) & (0x00000001 << 1))
1325
1326#define GS_GET_CSR_hsync_intrupt \
1327 (*((vu64 *)(gs_p_csr)) & (0x00000001 << 2))
1328
1329#define GS_GET_CSR_vsync_intrupt \
1330 (*((vu64 *)(gs_p_csr)) & (0x00000001 << 3))
1331
1332#define GS_GET_CSR_write_terminate \
1333 (*((vu64 *)(gs_p_csr)) & (0x00000001 << 4))
1334/*flush (w)*/
1335
1336/*reset (w)*/
1337
1338#define GS_GET_CSR_write_nfield \
1339 (*((vu64 *)(gs_p_csr)) & (0x00000001 << 12))
1340
1341#define GS_GET_CSR_current_field \
1342 (*((vu64 *)(gs_p_csr)) & (0x00000001 << 13))
1343
1344#define GS_GET_CSR_fifo_status \
1345 (*((vu64 *)(gs_p_csr)) & (0x00000003 << 14))
1346
1347#define GS_GET_CSR_gs_rev_number \
1348 (*((vu64 *)(gs_p_csr)) & (0x000000FF << 16))
1349
1350#define GS_GET_CSR_gs_id \
1351 (*((vu64 *)(gs_p_csr)) & (0x000000FF << 24))
1352
1353/* 'SET' GENERAL PURPOSE REG STRUCTS 'WITHOUT' REG */
1354
1355#define gs_setPRIM(p, _prim_type,_iip,_tme,_fge,_abe,_aa1,_fst,_ctxt,_fix)\
1356 (p)->prim_type = _prim_type, \
1357 (p)->iip = _iip, \
1358 (p)->tme = _tme, \
1359 (p)->fge = _fge, \
1360 (p)->abe = _abe, \
1361 (p)->aa1 = _aa1, \
1362 (p)->fst = _fst, \
1363 (p)->ctxt = _ctxt, \
1364 (p)->fix = _fix
1365
1366#define gs_setRGBAQ(p, _r,_g,_b,_a,_q) \
1367 (p)->r = _r, \
1368 (p)->g = _g, \
1369 (p)->b = _b, \
1370 (p)->a = _a, \
1371 (p)->q = _q
1372
1373#define gs_setST(p, _s,_t) \
1374 (p)->s = _s, \
1375 (p)->t = _t
1376
1377#define gs_setUV(p, _u,_v) \
1378 (p)->u = _u, \
1379 (p)->v = _v
1380
1381#define gs_setXYZF2(p, _x,_y,_z,_f) \
1382 (p)->x = _x, \
1383 (p)->y = _y, \
1384 (p)->z = _z, \
1385 (p)->f = _f
1386
1387#define gs_setXYZF3(p, _x,_y,_z,_f) \
1388 (p)->x = _x, \
1389 (p)->y = _y, \
1390 (p)->z = _z, \
1391 (p)->f = _f
1392
1393#define gs_setXYZ2(p, _x,_y,_z) \
1394 (p)->x = _x, \
1395 (p)->y = _y, \
1396 (p)->z = _z
1397
1398#define gs_setXYZ3(p, _x,_y,_z) \
1399 (p)->x = _x, \
1400 (p)->y = _y, \
1401 (p)->z = _z
1402
1403#define gs_setTEX0_1(p, _tb_addr, _tb_width, _psm, _tex_width, _tex_height, _tex_cc, _tex_funtion, _cb_addr, _clut_pixmode, _clut_smode, _clut_offset, _clut_loadmode)\
1404 (p)->tb_addr = _tb_addr, \
1405 (p)->tb_width = _tb_width, \
1406 (p)->psm = _psm, \
1407 (p)->tex_width = _tex_width, \
1408 (p)->tex_height = _tex_height, \
1409 (p)->tex_cc = _tex_cc, \
1410 (p)->tex_funtion = _tex_funtion, \
1411 (p)->cb_addr = _cb_addr, \
1412 (p)->clut_pixmode = _clut_pixmode, \
1413 (p)->clut_smode = _clut_smode, \
1414 (p)->clut_offset = _clut_offset, \
1415 (p)->clut_loadmode = _clut_loadmode
1416
1417#define gs_setTEX0_2 gs_setTEX0_1
1418
1419#define gs_setCLAMP_1(p, wms,wmt,minu,maxu,minv,maxv) \
1420 (p)->wms = wms, \
1421 (p)->wmt = wmt, \
1422 (p)->minu = minu, \
1423 (p)->maxu = maxu, \
1424 (p)->minv = minv, \
1425 (p)->maxv = maxv
1426
1427#define gs_setCLAMP_2 gs_setCLAMP_1
1428
1429#define gs_setFOG(p, _f) \
1430 (p)->f = _f
1431
1432#define gs_setTEX1_1(p, _lcm,_mxl,_mmag,_mmin,_mtba,_l,_k) \
1433 (p)->lcm = _lcm, \
1434 (p)->mxl = _mxl, \
1435 (p)->mmag = _mmag, \
1436 (p)->mmin = _mmin, \
1437 (p)->mtba = _mtba, \
1438 (p)->l = _l, \
1439 (p)->k = _k
1440
1441#define gs_setTEX1_2 gs_setTEX1_1
1442
1443#define gs_setTEX2_1(p, _psm,_cbp,_cpsm,_csm,_csa,_cld) \
1444 (p)->psm = _psm, \
1445 (p)->cbp = _cbp, \
1446 (p)->cpsm = _cpsm, \
1447 (p)->csm = _csm, \
1448 (p)->csa = _csa, \
1449 (p)->cld = _cld
1450
1451#define gs_setTEX2_2 gs_setTEX2_1
1452
1453#define gs_set_XYOFFSET_1(p, _offset_x,_offset_y) \
1454 (p)->offset_x = _offset_x, \
1455 (p)->offset_y = _offset_y
1456
1457#define gs_set_XYOFFSET_2 gs_set_XYOFFSET_1
1458
1459#define gs_set_PRMODECONT(p, _control) \
1460 (p)->control = _control
1461
1462#define gs_setPRMODE(p, _iip,_tme,_fge,_abe,_aa1,_fst,_ctxt,_fix) \
1463 (p)->iip = _iip, \
1464 (p)->tme = _tme, \
1465 (p)->fge = _fge, \
1466 (p)->abe = _abe, \
1467 (p)->aa1 = _aa1, \
1468 (p)->fst = _fst, \
1469 (p)->ctxt = _ctxt, \
1470 (p)->fix = _fix
1471
1472#define gs_setTEXCLUT(p, _cbw,_cou,_cov) \
1473 (p)->cbw = _cbw, \
1474 (p)->cou = _cou, \
1475 (p)->cov = _cov
1476
1477#define gs_setSCANMSK(p, _msk) \
1478 (p)->msk = _msk
1479
1480#define gs_setMIPTBP1_1(p, _tbp1,_tbw1,_tbp2,_tbw2,_tbp3,_tbw3) \
1481 (p)->tbp1 = _tbp1, \
1482 (p)->tbw1 = _tbw1, \
1483 (p)->tbp2 = _tbp2, \
1484 (p)->tbw2 = _tbw2, \
1485 (p)->tbp3 = _tbp3, \
1486 (p)->tbw3 = _tbw3
1487
1488#define gs_setMIPTBP1_2 gs_setMIPTBP1_1
1489
1490#define gs_setMIPTBP2_1(p, _tbp4, _tbw4, _tbp5, _tbw5, _tbp6, _tbw6) \
1491 (p)->tbp4 = _tbp4, \
1492 (p)->tbw4 = _tbw4, \
1493 (p)->tbp5 = _tbp5, \
1494 (p)->tbw5 = _tbw5, \
1495 (p)->tbp6 = _tbp6, \
1496 (p)->tbw6 = _tbw6
1497
1498#define gs_setMIPTBP2_2 gs_setMIPTBP2_1
1499
1500#define gs_setTEXA(p, _alpha_0, _alpha_method, _alpha_1) \
1501 (p)->alpha_0 = _alpha_0, \
1502 (p)->alpha_method = _alpha_method, \
1503 (p)->alpha_1 = _alpha_1
1504
1505#define gs_setFOGCOLOR(p, _r,_g,_b) \
1506 (p)->r = _r, \
1507 (p)->g = _g, \
1508 (p)->b = _b
1509
1510#define gs_setTEXFLUSH(p)
1511
1512#define gs_setSCISSOR_1(p, _clip_x0,_clip_x1,_clip_y0,_clip_y1) \
1513 (p)->clip_x0 = _clip_x0, \
1514 (p)->clip_x1 = _clip_x1, \
1515 (p)->clip_y0 = _clip_y0, \
1516 (p)->clip_y1 = _clip_y1
1517
1518#define gs_setSCISSOR_2 gs_setSCISSOR_1
1519
1520#define gs_setALPHA_1(p, _a,_b,_c,_d,_alpha)\
1521 (p)->a = _a, \
1522 (p)->b = _b, \
1523 (p)->c = _c, \
1524 (p)->d = _d, \
1525 (p)->alpha = _alpha
1526
1527#define gs_setALPHA_2 gs_setALPHA_1
1528
1529#define gs_setDIMX(p, _dimx00,_dimx01,_dimx02,_dimx03,_dimx10,_dimx11,_dimx12,_dimx13,_dimx20,_dimx21,_dimx22,_dimx23,_dimx30,_dimx31,_dimx32,_dimx33) \
1530 (p)->dimx00 = _dimx00, \
1531 (p)->dimx01 = _dimx01, \
1532 (p)->dimx02 = _dimx02, \
1533 (p)->dimx03 = _dimx03, \
1534 (p)->dimx10 = _dimx10, \
1535 (p)->dimx11 = _dimx11, \
1536 (p)->dimx12 = _dimx12, \
1537 (p)->dimx13 = _dimx13, \
1538 (p)->dimx20 = _dimx20, \
1539 (p)->dimx21 = _dimx21, \
1540 (p)->dimx22 = _dimx22, \
1541 (p)->dimx23 = _dimx23, \
1542 (p)->dimx30 = _dimx30, \
1543 (p)->dimx31 = _dimx31, \
1544 (p)->dimx32 = _dimx32, \
1545 (p)->dimx33 = _dimx33
1546
1547#define gs_setDTHE(p, _enable) \
1548 (p)->enable = _enable
1549
1550#define gs_setCOLCLAMP(p, _clamp) \
1551 (p)->clamp = _clamp
1552
1553#define gs_setTEST_1(p, _atest_enable, _atest_method, _atest_reference, _atest_fail_method, _datest_enable, _datest_mode, _ztest_enable, _ztest_method) \
1554 (p)->atest_enable = _atest_enable, \
1555 (p)->atest_method = _atest_method, \
1556 (p)->atest_reference = _atest_reference, \
1557 (p)->atest_fail_method = _atest_fail_method, \
1558 (p)->datest_enable = _datest_enable, \
1559 (p)->datest_mode = _datest_mode, \
1560 (p)->ztest_enable = _ztest_enable, \
1561 (p)->ztest_method = _ztest_method
1562
1563#define gs_setTEST_2 gs_setTEST_1
1564
1565#define gs_setPABE(p, _enable) \
1566 (p)->enable = _enable
1567
1568#define gs_setFBA(p, _alpha) \
1569 (p)->alpha = _alpha
1570
1571#define gs_setFRAME_1(p, _fb_addr,_fb_width,_psm,_draw_mask) \
1572 (p)->fb_addr = _fb_addr, \
1573 (p)->fb_width = _fb_width, \
1574 (p)->psm = _psm, \
1575 (p)->draw_mask = _draw_mask
1576
1577#define gs_setFRAME_2 gs_setFRAME_1
1578
1579#define gs_setZBUF_1(p, _fb_addr,_psm,_update_mask) \
1580 (p)->fb_addr = _fb_addr, \
1581 (p)->psm = _psm, \
1582 (p)->update_mask = _update_mask
1583
1584#define gs_setZBUF_2 gs_setZBUF_1
1585
1586#define gs_setBITBLTBUF(p, _src_addr,_src_width,_src_pixmode,_dest_addr,_dest_width,_dest_pixmode) \
1587 (p)->src_addr = _src_addr, \
1588 (p)->src_width = _src_width, \
1589 (p)->src_pixmode = _src_pixmode, \
1590 (p)->dest_addr = _dest_addr, \
1591 (p)->dest_width = _dest_width, \
1592 (p)->dest_pixmode = _dest_pixmode
1593
1594#define gs_setTRXPOS(p, _src_x,_src_y,_dest_x,_dest_y,_direction) \
1595 (p)->src_x = _src_x, \
1596 (p)->src_y = _src_y, \
1597 (p)->dest_x = _dest_x, \
1598 (p)->dest_y = _dest_y, \
1599 (p)->direction = _direction
1600
1601#define gs_setTRXREG(p, _trans_w,_trans_h) \
1602 (p)->trans_w = _trans_w, \
1603 (p)->trans_h = _trans_h
1604
1605#define gs_setTRXDIR(p, _trans_dir) \
1606 (p)->trans_dir = _trans_dir
1607
1608#define gs_setHWREG(p, _data) \
1609 (p)->data = _data
1610
1611#define gs_setSIGNAL(p, _signal_id,_update_mask) \
1612 (p)->signal_id = _signal_id, \
1613 (p)->update_mask= _update_mask
1614
1615#define gs_setFINISH(p) \
1616 (p)->pad0 = 0
1617
1618#define gs_setLABEL(p, _label_id,_update_mask) \
1619 (p)->label_id = _label_id, \
1620 (p)->update_mask= _update_mask
1621
1622#define gs_setNOP(p) \
1623 (p)->pad0 = 0
1624
1625/* 'SET' GENERAL PURPOSE REG STRUCTs & REGs */
1626
1627#define gs_setR_PRIM(p, _prim_type,_iip,_tme,_fge,_abe,_aa1,_fst,_ctxt,_fix)\
1628 gs_setPRIM(&p->data, _prim_type,_iip,_tme,_fge,_abe,_aa1,_fst,_ctxt,_fix),\
1629 p->reg = gs_g_prim
1630
1631#define gs_setR_RGBAQ(p, _r,_g,_b,_a,_q) \
1632 gs_setRGBAQ(&p->data, _r,_g,_b,_a,_q),\
1633 (p)->reg = gs_g_rgbaq
1634
1635#define gs_setR_ST(p, _s,_t) \
1636 gs_setST(&p->data, _s,_t),\
1637 (p)->reg = gs_g_st
1638
1639#define gs_setR_UV(p, _u,_v) \
1640 gs_setUV(&p->data, _u,_v),\
1641 (p)->reg = gs_g_uv
1642
1643#define gs_setR_XYZF2(p, _x,_y,_z,_f) \
1644 gs_setXYZF2(&p->data, _x,_y,_z,_f),\
1645 (p)->reg = gs_g_xyzf2
1646
1647#define gs_setR_XYZF3(p, _x,_y,_z,_f) \
1648 gs_setR_XYZF3(&p->data, _x,_y,_z,_f),\
1649 (p)->reg = gs_g_xyzf3
1650
1651#define gs_setR_XYZ2(p, _x,_y,_z) \
1652 gs_setXYZ2(&p->data, _x,_y,_z),\
1653 (p)->reg = gs_g_xyz2
1654
1655#define gs_setR_XYZ3(p, _x,_y,_z) \
1656 gs_setXYZ3(&p->data, _x,_y,_z),\
1657 (p)->reg = gs_g_xyz3
1658
1659#define gs_setR_TEX0_1(p, _fb_addr,_fb_width,_psm,_tex_width,_tex_height,_col_comp,_tex_cc,_clutb_addr,_clut_pixmode,_clut_smode,_clut_offset,_cld)\
1660 gs_setTEX0_1(&p->data, _fb_addr,_fb_width,_psm,_tex_width,_tex_height,_col_comp,_tex_cc,_clutb_addr,_clut_pixmode,_clut_smode,_clut_offset,_cld),\
1661 (p)->reg = gs_g_tex0_1
1662
1663#define gs_setR_TEX0_2(p, _fb_addr,_fb_width,_psm,_tex_width,_tex_height,_col_comp,_tex_cc,_clutb_addr,_clut_pixmode,_clut_smode,_clut_offset,_cld)\
1664 gs_setTEX0_2(&p->data, _fb_addr,_fb_width,_psm,_tex_width,_tex_height,_col_comp,_tex_cc,_clutb_addr,_clut_pixmode,_clut_smode,_clut_offset,_cld),\
1665 (p)->reg = gs_g_tex0_2
1666
1667#define gs_setR_CLAMP_1(p, wms,wmt,minu,maxu,minv,maxv) \
1668 gs_setCLAMP_1(&p->data, wms,wmt,minu,maxu,minv,maxv),\
1669 (p)->reg = gs_g_clamp_1
1670
1671#define gs_setR_CLAMP_2(p, wms,wmt,minu,maxu,minv,maxv) \
1672 gs_setCLAMP_2(&p->data, wms,wmt,minu,maxu,minv,maxv),\
1673 (p)->reg = gs_g_clamp_2
1674
1675#define gs_setR_FOG(p, _f) \
1676 gs_setFOG(&p->data, _f),\
1677 (p)->reg = gs_g_fog
1678
1679#define gs_setR_TEX1_1(p, _lcm,_mxl,_mmag,_mmin,_mtba,_l,_k) \
1680 gs_setTEX1_1(&p->data, _lcm,_mxl,_mmag,_mmin,_mtba,_l,_k),\
1681 (p)->reg = gs_g_tex1_1
1682
1683#define gs_setR_TEX1_2(p, _lcm,_mxl,_mmag,_mmin,_mtba,_l,_k) \
1684 gs_setTEX1_2(&p->data, _lcm,_mxl,_mmag,_mmin,_mtba,_l,_k),\
1685 (p)->reg = gs_g_tex1_2
1686
1687#define gs_setR_TEX2_1(p, _psm,_cbp,_cpsm,_csm,_csa,_cld) \
1688 gs_setTEX2_1(&p->data, _psm,_cbp,_cpsm,_csm,_csa,_cld),\
1689 (p)->reg = gs_g_tex2_1
1690
1691#define gs_setR_TEX2_2(p, _psm,_cbp,_cpsm,_csm,_csa,_cld) \
1692 gs_setTEX2_2(&p->data, _psm,_cbp,_cpsm,_csm,_csa,_cld),\
1693 (p)->reg = gs_g_tex2_2
1694
1695#define gs_setR_XYOFFSET_1(p, _offset_x,_offset_y) \
1696 gs_set_XYOFFSET_1(&p->data, _offset_x,_offset_y),\
1697 (p)->reg = gs_g_xyoffset_1
1698
1699#define gs_setR_XYOFFSET_2(p, _offset_x,_offset_y) \
1700 gs_set_XYOFFSET_2(&p->data, _offset_x,_offset_y),\
1701 (p)->reg = gs_g_xyoffset_2
1702
1703#define gs_setR_PRMODECONT(p, _control) \
1704 gs_set_PRMODECONT(&p->data, _control),\
1705 (p)->reg = gs_g_prmodecont
1706
1707#define gs_setR_PRMODE(p, _iip,_tme,_fge,_abe,_aa1,_fst,_ctxt,_fix) \
1708 gs_setPRMODE(&p->data, _iip,_tme,_fge,_abe,_aa1,_fst,_ctxt,_fix),\
1709 (p)->reg = gs_g_prmode
1710
1711#define gs_setR_TEXCLUT(p, _cbw,_cou,_cov) \
1712 gs_setTEXCLUT(&p->data, _cbw,_cou,_cov),\
1713 (p)->reg = gs_g_texclut
1714
1715#define gs_setR_SCANMSK(p, _msk) \
1716 gs_setSCANMSK(&p->data, _msk),\
1717 (p)->reg = gs_g_scanmsk
1718
1719#define gs_setR_MIPTBP1_1(p, _tbp1,_tbw1,_tbp2,_tbw2,_tbp3,_tbw3) \
1720 gs_setMIPTBP1_1(&p->data, _tbp1,_tbw1,_tbp2,_tbw2,_tbp3,_tbw3),\
1721 (p)->reg = gs_g_miptbp1_1
1722
1723#define gs_setR_MIPTBP1_2(p, _tbp1,_tbw1,_tbp2,_tbw2,_tbp3,_tbw3) \
1724 gs_setMIPTBP1_2(&p->data, _tbp1,_tbw1,_tbp2,_tbw2,_tbp3,_tbw3),\
1725 (p)->reg = gs_g_miptbp1_2
1726
1727#define gs_setR_MIPTBP2_1(p, _tbp4,_tbw4,_tbp5,_tbw5,_tbp6,_tbw6) \
1728 gs_setR_MIPTBP2_1(&p->data, _tbp4,_tbw4,_tbp5,_tbw5,_tbp6,_tbw6),\
1729 (p)->reg = gs_g_miptbp2_1
1730
1731#define gs_setR_MIPTBP2_2(p, _tbp4,_tbw4,_tbp5,_tbw5,_tbp6,_tbw6) \
1732 gs_setMIPTBP2_2(&p->data, _tbp4,_tbw4,_tbp5,_tbw5,_tbp6,_tbw6),\
1733 (p)->reg = gs_g_miptbp2_2
1734
1735#define gs_setR_TEXA(p, _ta0,_aem,_ta1) \
1736 gs_setTEXA(&p->data, _ta0,_aem,_ta1),\
1737 (p)->reg = gs_g_texa
1738
1739#define gs_setR_FOGCOLOR(p, _r,_g,_b) \
1740 gs_setFOGCOLOR(&p->data, _r,_g,_b),\
1741 (p)->reg = gs_g_fogcol
1742
1743#define gs_setR_TEXFLUSH(p)\
1744 (p)->reg = gs_g_texflush
1745
1746#define gs_setR_SCISSOR_1(p, _clip_x0,_clip_x1,_clip_y0,_clip_y1) \
1747 gs_setSCISSOR_1(&p->data, _clip_x0,_clip_x1,_clip_y0,_clip_y1),\
1748 (p)->reg = gs_g_scissor_1
1749
1750#define gs_setR_SCISSOR_2(p, _clip_x0,_clip_x1,_clip_y0,_clip_y1) \
1751 gs_setSCISSOR_2(&p->data, _clip_x0,_clip_x1,_clip_y0,_clip_y1),\
1752 (p)->reg = gs_g_scissor_2
1753
1754#define gs_setR_ALPHA_1(p, _a,_b,_c,_d,_fix) \
1755 gs_setALPHA_1(&p->data, _a,_b,_c,_d,_fix),\
1756 (p)->reg = gs_g_alpha_1
1757
1758#define gs_setR_ALPHA_2(p, _a,_b,_c,_d,_fix) \
1759 gs_setALPHA_2(&p->data, _a,_b,_c,_d,_fix),\
1760 (p)->reg = gs_g_alpha_2
1761
1762#define gs_setR_DIMX(p, _dimx00,_dimx01,_dimx02,_dimx03,_dimx10,_dimx11,_dimx12,_dimx13,_dimx20,_dimx21,_dimx22,_dimx23,_dimx30,_dimx31,_dimx32,_dimx33) \
1763 gs_setDIMX(&p->data, _dimx00,_dimx01,_dimx02,_dimx03,_dimx10,_dimx11,_dimx12,_dimx13,_dimx20,_dimx21,_dimx22,_dimx23,_dimx30,_dimx31,_dimx32,_dimx33),\
1764 (p)->reg = gs_g_dimx
1765
1766#define gs_setR_DTHE(p, _enable) \
1767 gs_setDTHE(&p->data, _enable),\
1768 (p)->reg = gs_g_dthe
1769
1770#define gs_setR_COLCLAMP(p, _clamp) \
1771 gs_setCOLCLAMP(&p->data, _clamp),\
1772 (p)->reg = gs_g_colclamp
1773
1774#define gs_setR_TEST_1(p, _ATE,_ATST,_AREF,_AFAIL,_DATE,_DATM,_ZTE,_ZTST) \
1775 gs_setTEST_1(&p->data, _ATE,_ATST,_AREF,_AFAIL,_DATE,_DATM,_ZTE,_ZTST),\
1776 (p)->reg = gs_g_test_1
1777
1778#define gs_setR_TEST_2(p, _ATE,_ATST,_AREF,_AFAIL,_DATE,_DATM,_ZTE,_ZTST) \
1779 gs_setTEST_2(&p->data, _ATE,_ATST,_AREF,_AFAIL,_DATE,_DATM,_ZTE,_ZTST),\
1780 (p)->reg = gs_g_test_2
1781
1782#define gs_setR_PABE(p, _enable) \
1783 gs_setPABE(&p->data, _enable),\
1784 (p)->reg = gs_g_pabe
1785
1786#define gs_setR_FBA_1(p, _alpha) \
1787 gs_setFBA(&p->data, _alpha),\
1788 (p)->reg = gs_g_fba_1
1789
1790#define gs_setR_FBA_2(p, _alpha) \
1791 gs_setFBA(&p->data, _alpha),\
1792 (p)->reg = gs_g_fba_2
1793
1794#define gs_setR_FRAME_1(p, _fb_addr,_fb_width,_psm,_draw_mask) \
1795 gs_setFRAME_1(&p->data, _fb_addr,_fb_width,_psm,_draw_mask),\
1796 (p)->reg = gs_g_frame_1
1797
1798#define gs_setR_FRAME_2(p, _fb_addr,_fb_width,_psm,_draw_mask) \
1799 gs_setFRAME_2(&p->data, _fb_addr,_fb_width,_psm,_draw_mask),\
1800 (p)->reg = gs_g_frame_2
1801
1802#define gs_setR_ZBUF_1(p, _fb_addr,_psm,_update_mask) \
1803 gs_setZBUF_1(&p->data, _fb_addr,_psm,_update_mask),\
1804 (p)->reg = gs_g_zbuf_1
1805
1806#define gs_setR_ZBUF_2(p, _fb_addr,_psm,_update_mask) \
1807 gs_setZBUF_2(&p->data, _fb_addr,_psm,_update_mask),\
1808 (p)->reg = gs_g_zbuf_2
1809
1810#define gs_setR_BITBLTBUF(p, _src_addr,_src_width,_src_pixmode,_dest_addr,_dest_width,_dest_pixmode) \
1811 gs_setBITBLTBUF(&p->data, _src_addr,_src_width,_src_pixmode,_dest_addr,_dest_width,_dest_pixmode),\
1812 (p)->reg = gs_g_bitbltbuf
1813
1814#define gs_setR_TRXPOS(p, _src_x,_src_y,_dest_x,_dest_y,_direction) \
1815 gs_setTRXPOS(&p->data, _src_x,_src_y,_dest_x,_dest_y,_direction),\
1816 (p)->reg = gs_g_trxpos
1817
1818#define gs_setR_TRXREG(p, _trans_w,_trans_h) \
1819 gs_setTRXREG(&p->data, _trans_w,_trans_h),\
1820 (p)->reg = gs_g_trxreg
1821
1822#define gs_setR_TRXDIR(p, _trans_dir) \
1823 gs_setTRXDIR(&p->data, _trans_dir),\
1824 (p)->reg = gs_g_trxdir
1825
1826#define gs_setR_HWREG(p, _data) \
1827 gs_setHWREG(&p->data, _data),\
1828 (p)->reg = gs_g_hwreg
1829
1830#define gs_setR_SIGNAL(p, _signal_id,_update_mask) \
1831 gs_setSIGNAL(&p->data, _signal_id,_update_mask),\
1832 (p)->reg = gs_g_signal
1833
1834#define gs_setR_FINISH(p)\
1835 (p)->reg = gs_g_finish
1836
1837#define gs_setR_LABEL(p, _label_id,_update_mask) \
1838 gs_setLABEL(&p->data, _label_id,_update_mask),\
1839 (p)->reg = gs_g_label
1840
1841#define gs_setR_NOP(p) \
1842 gs_setNOP(&p->data),\
1843 (p)->reg = gs_g_label
1844
1845/* MISC */
1846
1849 u64 qwc :16;
1850 u64 pad1 :10;
1851 u64 pce :2;
1852 u64 id :3;
1853 u64 irq :1;
1854 u64 addr :31;
1855 u64 spr :1;
1856 u64 pad2 :64;
1857}GS_GIF_DMACHAIN_TAG __attribute__ ((aligned(16)));/*aligned 128bits*/
1858
1859typedef struct {
1860 u64 nloop :15;
1861 u64 eop :1;
1862 u64 pad1 :30;
1863 u64 pre :1;
1864 u64 prim :11;
1865 u64 flg :2;
1866 u64 nreg :4;
1867 u64 reg :64;
1868}GS_GIF_TAG;
1869
1870#define gs_setGIF_TAG(p, _nloop,_eop,_pre,_prim,_flg,_nreg,_reg)\
1871 (p)->nloop = _nloop, \
1872 (p)->eop = _eop, \
1873 (p)->pre = _pre, \
1874 (p)->prim = _prim, \
1875 (p)->flg = _flg, \
1876 (p)->nreg = _nreg, \
1877 (p)->reg = _reg
1878
1879/* MID LEVEL DEFINES */
1880
1881/* settings for GsSetCRTCSettings() */
1882
1883/*A Default setting*/
1884#define CRTC_SETTINGS_DEFAULT1 CRTC_SETTINGS_EN1|CRTC_SETTINGS_BLENDVAL|CRTC_SETTINGS_OUTRC1|CRTC_SETTINGS_STYLERC1
1885#define CRTC_SETTINGS_DEFAULT2 CRTC_SETTINGS_EN2|CRTC_SETTINGS_BLENDVAL|CRTC_SETTINGS_OUTRC1|CRTC_SETTINGS_STYLERC1
1886
1888#define CRTC_SETTINGS_EN1 ((u64)(1)<<0)
1890#define CRTC_SETTINGS_EN2 ((u64)(1)<<1)
1892#define CRTC_SETTINGS_ENBOTH CRTC_SETTINGS_EN1|CRTC_SETTINGS_EN2
1894#define CRTC_SETTINGS_BLENDRC1 ((u64)(0)<<5)
1896#define CRTC_SETTINGS_BLENDVAL ((u64)(1)<<5)
1898#define CRTC_SETTINGS_OUTRC1 ((u64)(0)<<6)
1900#define CRTC_SETTINGS_OUTRC2 ((u64)(1)<<6)
1902#define CRTC_SETTINGS_STYLERC1 ((u64)(0)<<7)
1904#define CRTC_SETTINGS_STYLEBG ((u64)(1)<<7)
1905
1906typedef struct {
1907 short x;
1908 short y;
1909 short w;
1910 short h;
1911}GS_RECT;
1912
1913typedef struct {
1914 u16 x;
1915 u16 y;
1916 u16 w;
1917 u16 h;
1918}GS_URECT;
1919
1920typedef struct {
1921 int x;
1922 int y;
1923 int w;
1924 int h;
1925}GS_RECT32;
1926
1927typedef struct {
1928 short x;
1929 short y;
1930}GS_POS;
1931
1932typedef struct
1933{
1934 u16 vram_addr;
1935 u8 psm;
1936 u8 update_mask;
1937}GS_ZENV;
1938
1940typedef struct {
1941 /* Draw offset X */
1942 u16 offset_x;
1943 /* Draw offset Y */
1944 u16 offset_y;
1945 /* Draw Clip rect */
1946 GS_URECT clip;
1947 /* Vram Address in frame buffer */
1948 u16 vram_addr;
1949 /* Width of vram (1=64) */
1950 u8 fbw;
1951 /* Pixel Mode / PSM */
1952 u8 psm;
1953 /* X offset in vram; */
1954 u16 vram_x;
1955 /* Y offset in vram; */
1956 u16 vram_y;
1957 /* Draw Mask (0=draw, 1=no draw) */
1958 u32 draw_mask;
1959 /* Set To 1 If You Want The Draw Environment's Backgroud to Clear When GsPutDrawEnv() is called */
1960 u8 auto_clear;
1961 /* Color to use to clear backgroud */
1962 GS_RGBAQ bg_color;
1963
1964}GS_DRAWENV;
1965
1967typedef struct {
1968 GS_DISPLAY disp;
1969 GS_DISPFB dispfb;
1970}GS_DISPENV __attribute__ ((aligned(8)));/* Aligned, 64bits*/
1971
1973typedef struct
1974{
1981}GS_POINT_P; /*Size= 3 QWords*/
1982
1983typedef struct
1984{
1989}GS_POINT; /*Size= 2 QWords*/
1990
1992typedef struct
1993{
2002}GS_LINE_F1_P; /*Size = 4 QWords*/
2003
2004typedef struct
2005{
2012}GS_LINE_F1; /*Size = 3 QWords*/
2013
2028
2040
2055
2067
2087
2105
2125
2143
2162
2178
2202
2224
2237
2238typedef struct
2239{
2246}GS_SPRITE_F4; /*Size= 3 QWords*/
2247
2248/*A Textured Sprite*/
2264
2278
2279#define GS_PACKET_DATA_QWORD_MAX 32000
2280
2281typedef struct
2282{
2283 GS_GIF_DMACHAIN_TAG tag;
2284 QWORD data[GS_PACKET_DATA_QWORD_MAX];
2285}GS_GIF_PACKET __attribute__ ((aligned(16)));/* Aligned, 128bits*/
2286
2287typedef struct
2288{
2289 u32 packet_count;
2290 u32 packet_offset;
2291 u32 qword_offset;
2292 GS_GIF_PACKET *packets;
2294
2295typedef struct
2296{
2298 u16 x;
2300 u16 y;
2311}GS_IMAGE;
2312
2313#if 0
2314typedef struct
2315{
2316 u8 img_psm;
2317 u16 img_width;
2318 u16 img_height;
2319 u32 *img_addr;
2320
2321 u8 clt_psm;
2322 u16 clt_csm;
2323 u16 clt_width;
2324 u16 clt_height;
2325 u32 *clt_addr;
2326}GS_EE_IMAGE;
2327#endif
2328
2329#ifdef __cplusplus
2330extern "C" {
2331#endif
2332
2333/* COMMONLY UDED, LOW LEVEL FUNCTIONS */
2334
2335/* These Use Gif-Dma To Transfer*/
2336int GsSetXYOffset1(u16 x, u16 y);
2337int GsSetXYOffset2(u16 x, u16 y);
2338int GsSetScissor1(u16 upper_x, u16 upper_y, u16 lower_x, u16 lower_y);
2339int GsSetScissor2(u16 upper_x, u16 upper_y, u16 lower_x, u16 lower_y);
2340int GsSetFrame1(u16 framebuffer_addr, u8 framebuffer_width, u8 psm, u32 draw_mask);
2341int GsSetFrame2(u16 framebuffer_addr, u8 framebuffer_width, u8 psm, u32 draw_mask);
2342int GsTextureFlush(void);
2343int 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);
2344int 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);
2345int 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);
2346int 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);
2347void GsSetFogColor(u8 r, u8 g, u8 b);
2348void GsEnableColorClamp(u16 enable);
2349
2350/* NORMAL FUNCTIONS */
2351
2352GsGParam_t *GsGetGParam(void);
2353void GsResetGraph(short int mode, short int interlace, short int omode, short int ffmode);
2354void GsResetPath(void);
2355void GsSetCRTCSettings(u64 settings, u8 alpha_value);
2356
2357/* Initialise structs with defaults Based On Input*/
2358void GsSetDefaultDrawEnv(GS_DRAWENV *drawenv, u16 psm, u16 w, u16 h);
2359void GsSetDefaultDrawEnvAddress(GS_DRAWENV *drawenv, u16 vram_addr);
2360void GsSetDefaultDisplayEnv(GS_DISPENV *dispenv, u16 psm, u16 w, u16 h, u16 dx, u16 dy);
2361void GsSetDefaultDisplayEnvAddress(GS_DISPENV *dispenv, u16 vram_addr);
2362void GsSetDefaultZBufferEnv(GS_ZENV *zenv, u8 update_mask);
2363void GsSetDefaultZBufferEnvAddress(GS_ZENV *zenv, u16 vram_addr, u8 psm);
2364
2365/* Execute struct's data (Environments)*/
2366void GsPutDrawEnv1(GS_DRAWENV *drawenv);
2367void GsPutDrawEnv2(GS_DRAWENV *drawenv);
2368void GsPutDisplayEnv1(GS_DISPENV *dispenv);
2369void GsPutDisplayEnv2(GS_DISPENV *dispenv);
2370void GsPutZBufferEnv1(GS_ZENV *zenv);
2371void GsPutZBufferEnv2(GS_ZENV *zenv);
2373void GsClearDrawEnv1(GS_DRAWENV *drawenv);
2375void GsClearDrawEnv2(GS_DRAWENV *drawenv);
2376
2377/* Gif packet execution*/
2378QWORD *GsGifPacketsAlloc(GS_PACKET_TABLE *table, u32 num_qwords);
2379void GsGifPacketsClear(GS_PACKET_TABLE *table);
2380int GsGifPacketsExecute(GS_PACKET_TABLE *table, u16 wait);
2381
2382/* Texture/Image Funtions*/
2383int GsLoadImage(const void *source_addr, GS_IMAGE *dest);
2384
2385void GsOverridePrimAttributes(s8 override, s8 iip, s8 tme, s8 fge, s8 abe, s8 aa1, s8 fst, s8 ctxt, s8 fix);
2386void GsEnableDithering(u8 enable, int mode);
2387void GsEnableAlphaTransparency1(u16 enable,u16 method,u8 alpha_ref,u16 fail_method);
2388void GsEnableAlphaTransparency2(u16 enable,u16 method,u8 alpha_ref,u16 fail_method);
2389void GsEnableZbuffer1(u16 enable,u16 test_method);
2390void GsEnableZbuffer2(u16 enable,u16 test_method);
2391void GsEnableAlphaBlending1(u16 enable);
2392void GsEnableAlphaBlending2(u16 enable);
2393
2394void GsDrawSync(int mode);
2395void GsHSync(int mode);
2396void GsVSync(int mode);
2397
2398/* Vram Allocation */
2399int GsVramAllocFrameBuffer(s16 w, s16 h, s16 psm);
2400int GsVramAllocTextureBuffer(s16 w, s16 h, s16 psm);
2403void GsVramFreeAll(void);
2404
2405/* Just used for buffer swapping*/
2406int GsDbGetDrawBuffer(void);
2407int GsDbGetDisplayBuffer(void);
2408void GsDbSwapBuffer(void);
2409
2410#ifdef __cplusplus
2411}
2412#endif
2413
2414#endif /* __LIBGS_H__ */
#define GS_PRIM_LINE
Definition gs_gp.h:153
#define GS_PRIM_LINE_STRIP
Definition gs_gp.h:155
#define GS_PRIM_SPRITE
Definition gs_gp.h:163
#define GS_PRIM_POINT
Definition gs_gp.h:151
GS_R_RGBAQ rgbaq1
Definition libgs.h:2036
GS_R_XYZ xyz1
Definition libgs.h:2099
u32 flush
Definition libgs.h:513
u32 amod
Definition libgs.h:354
GS_R_RGBAQ rgbaq0
Definition libgs.h:1986
u32 pad1
Definition libgs.h:511
GS_R_RGBAQ rgbaq0
Definition libgs.h:2254
GS_R_RGBAQ rgbaq0
Definition libgs.h:2047
u32 current_field
Definition libgs.h:523
GS_R_RGBAQ rgbaq0
Definition libgs.h:2032
u32 hsync_intrupt
Definition libgs.h:501
u32 pad3
Definition libgs.h:555
u32 exfield
Definition libgs.h:519
GS_R_PRIM prim
Definition libgs.h:2109
u32 gs_rev_number
Definition libgs.h:527
GS_R_XYZ xyz0
Definition libgs.h:2243
GS_R_PRIM prim
Definition libgs.h:2252
GS_R_RGBAQ rgbaq2
Definition libgs.h:2196
u32 display_w
Definition libgs.h:434
GS_R_RGBAQ rgbaq0
Definition libgs.h:2241
GS_R_RGBAQ rgbaq0
Definition libgs.h:2007
GsATestFailedUpdateMethods
Definition libgs.h:117
@ GS_ALPHA_NO_UPDATE
Definition libgs.h:119
u32 display_x
Definition libgs.h:424
GS_R_PRIM prim
Definition libgs.h:2071
GS_R_RGBAQ rgbaq2
Definition libgs.h:2174
GS_R_RGBAQ rgbaq0
Definition libgs.h:2059
u32 blend_value
Definition libgs.h:358
GsTexMipmaps
Definition libgs.h:139
@ GS_TEX_MIPMAP6
Definition libgs.h:153
@ GS_TEX_MIPMAP5
Definition libgs.h:151
@ GS_TEX_MIPMAP2
Definition libgs.h:145
@ GS_TEX_MIPMAP0
Definition libgs.h:141
@ GS_TEX_MIPMAP1
Definition libgs.h:143
@ GS_TEX_MIPMAP3
Definition libgs.h:147
@ GS_TEX_MIPMAP4
Definition libgs.h:149
u16 width
Definition libgs.h:2302
GS_R_XYZ xyz0
Definition libgs.h:2210
GS_R_UV uv1
Definition libgs.h:2097
GS_R_RGBAQ rgbaq0
Definition libgs.h:1978
GS_R_RGBAQ rgbaq0
Definition libgs.h:2206
u32 nfield
Definition libgs.h:521
GS_R_PRIM prim
Definition libgs.h:2229
GS_R_RGBAQ rgbaq1
Definition libgs.h:2154
u32 x
Definition libgs.h:456
u32 fbw
Definition libgs.h:409
u32 exhsint
Definition libgs.h:507
u32 pad2
Definition libgs.h:419
GS_R_RGBAQ rgbaq0
Definition libgs.h:1997
GS_R_UV uv1
Definition libgs.h:2260
GS_R_PRIM prim
Definition libgs.h:2182
u32 signal_mask
Definition libgs.h:539
u32 pad2
Definition libgs.h:438
GS_R_XYZ xyz2
Definition libgs.h:2141
u32 pad1
Definition libgs.h:464
GS_R_RGBAQ rgbaq0
Definition libgs.h:2111
u32 y
Definition libgs.h:458
GS_R_XYZ xyz1
Definition libgs.h:2063
GS_R_RGBAQ rgbaq0
Definition libgs.h:2184
GS_R_PRIM prim
Definition libgs.h:2148
GS_R_UV uv1
Definition libgs.h:2274
GsZTestMethodTypes
Definition libgs.h:126
GS_R_XYZ xyz0
Definition libgs.h:1988
void GsClearDrawEnv2(GS_DRAWENV *drawenv)
Definition draw.c:221
GS_R_RGBAQ rgbaq0
Definition libgs.h:2150
u8 version
Definition libgs.h:29
float padq
Definition libgs.h:492
u32 vsync_intrupt
Definition libgs.h:503
u32 p0
Definition libgs.h:562
u32 hsync_mask
Definition libgs.h:543
GS_R_XYZ xyz2
Definition libgs.h:2065
u32 fifo_status
Definition libgs.h:525
GsTexFunctions
Definition libgs.h:173
@ GS_TEX_HIGHLIHGT1
Definition libgs.h:176
@ GS_TEX_DECAL
Definition libgs.h:175
@ GS_TEX_HIGHLIHGT2
Definition libgs.h:177
u32 direction
Definition libgs.h:560
GS_R_XYZ xyz2
Definition libgs.h:2103
u32 pad1
Definition libgs.h:537
GS_R_RGBAQ rgbaq0
Definition libgs.h:2073
u32 write_w
Definition libgs.h:466
GS_R_XYZ xyz0
Definition libgs.h:2022
u8 interlace
Definition libgs.h:23
GS_R_XYZ xyz0
Definition libgs.h:1999
u32 vsync_mask
Definition libgs.h:545
GS_R_UV uv0
Definition libgs.h:2270
GS_R_XYZ xyz0
Definition libgs.h:2233
GS_R_XYZ xyz1
Definition libgs.h:2235
u32 pad1
Definition libgs.h:477
typedef __attribute__
Definition tlbfunc.c:60
GS_R_XYZ xyz1
Definition libgs.h:2156
GS_R_RGBAQ rgbaq0
Definition libgs.h:2020
GS_R_XYZ xyz0
Definition libgs.h:2077
u32 exvs_mask
Definition libgs.h:551
GS_R_XYZ xyz0
Definition libgs.h:2095
GS_R_XYZ xyz0
Definition libgs.h:2168
GS_R_RGBAQ rgbaq1
Definition libgs.h:2170
GS_R_XYZ xyz2
Definition libgs.h:2085
u32 write
Definition libgs.h:475
GS_R_XYZ xyz0
Definition libgs.h:2258
u32 write_h
Definition libgs.h:468
u16 vram_addr
Definition libgs.h:2306
u8 ffmode
Definition libgs.h:27
u32 pad1
Definition libgs.h:432
u32 exvwins
Definition libgs.h:364
u32 reset
Definition libgs.h:515
u32 x
Definition libgs.h:415
GS_R_UV uv0
Definition libgs.h:2256
u8 pada
Definition libgs.h:490
u32 display_y
Definition libgs.h:426
u32 exsyncmd
Definition libgs.h:368
u64 pad1
Definition libgs.h:758
u32 enable_rc2
Definition libgs.h:348
u8 omode
Definition libgs.h:25
GS_R_RGBAQ rgbaq2
Definition libgs.h:2218
GS_R_RGBAQ rgbaq0
Definition libgs.h:2268
u32 exhs_mask
Definition libgs.h:549
u32 blend_style
Definition libgs.h:356
GS_R_XYZ xyz1
Definition libgs.h:2011
u32 pad2
Definition libgs.h:479
GS_R_XYZ xyz1
Definition libgs.h:2026
u32 magnify_h
Definition libgs.h:428
GS_R_XYZ xyz1
Definition libgs.h:2038
GS_R_PRIM prim
Definition libgs.h:1976
u32 exverr
Definition libgs.h:517
GS_R_XYZ xyz1
Definition libgs.h:2051
GS_R_RGBAQ rgbaq1
Definition libgs.h:2190
GS_R_RGBAQ rgbaq0
Definition libgs.h:2166
u32 pad2
Definition libgs.h:370
GS_R_PRIM prim
Definition libgs.h:2045
u32 psm
Definition libgs.h:411
u32 y
Definition libgs.h:417
GS_R_XYZ xyz0
Definition libgs.h:2152
u32 display_h
Definition libgs.h:436
GS_R_PRIM prim
Definition libgs.h:1995
GS_R_RGBAQ rgbaq0
Definition libgs.h:2231
u8 psm
Definition libgs.h:2310
GS_R_RGBAQ rgbaq0
Definition libgs.h:2091
u32 address
Definition libgs.h:407
u32 pad1
Definition libgs.h:362
GS_R_RGBAQ rgbaq1
Definition libgs.h:2212
u32 magnify_v
Definition libgs.h:430
GS_R_XYZ xyz1
Definition libgs.h:2276
GS_R_XYZ xyz0
Definition libgs.h:2272
void GsVramFreeAllTextureBuffer(void)
Definition texture.c:206
u32 pad2
Definition libgs.h:531
u32 crt_out
Definition libgs.h:350
u32 p1
Definition libgs.h:564
u32 gs_id
Definition libgs.h:529
GS_R_XYZ xyz2
Definition libgs.h:2222
GS_R_XYZ xyz2
Definition libgs.h:2176
GsTexFilterMethods
Definition libgs.h:156
@ GS_TEX_LINEAR
Definition libgs.h:160
@ GS_TEX_NEAREST
Definition libgs.h:158
GS_R_XYZ xyz1
Definition libgs.h:2001
u32 write_mask
Definition libgs.h:547
u32 finish_mask
Definition libgs.h:541
GS_R_XYZ xyz1
Definition libgs.h:2245
GS_R_XYZ xyz0
Definition libgs.h:1980
GS_R_XYZ xyz1
Definition libgs.h:2262
GS_R_XYZ xyz0
Definition libgs.h:2061
u32 finish_evnt
Definition libgs.h:499
GS_R_XYZ xyz1
Definition libgs.h:2081
GS_R_XYZ xyz1
Definition libgs.h:2216
GsGifDataFormat
Definition libgs.h:180
@ GS_GIF_DISABLE
Definition libgs.h:185
GS_R_PRIM prim
Definition libgs.h:2018
u32 pad1
Definition libgs.h:413
GS_R_RGBAQ rgbaq2
Definition libgs.h:2158
GS_R_UV uv0
Definition libgs.h:2093
u16 y
Definition libgs.h:2300
GS_R_XYZ xyz1
Definition libgs.h:2172
GS_R_RGBAQ rgbaq1
Definition libgs.h:2024
GsATestMethods
Definition libgs.h:105
GS_R_XYZ xyz2
Definition libgs.h:2053
u32 exvsint
Definition libgs.h:509
u32 signal_evnt
Definition libgs.h:497
u32 mmod
Definition libgs.h:352
GS_R_XYZ xyz0
Definition libgs.h:2034
u32 pad2
Definition libgs.h:470
u32 sample_r_h
Definition libgs.h:460
GS_R_XYZ xyz0
Definition libgs.h:2049
GS_R_XYZ xyz0
Definition libgs.h:2009
GS_R_RGBAQ rgbaq0
Definition libgs.h:2129
u32 nfld
Definition libgs.h:360
GS_R_XYZ xyz0
Definition libgs.h:2133
u32 write_terminate
Definition libgs.h:505
u16 x
Definition libgs.h:2298
GS_R_XYZ xyz1
Definition libgs.h:2137
GS_R_UV uv2
Definition libgs.h:2101
u32 enable_rc1
Definition libgs.h:346
void GsClearDrawEnv1(GS_DRAWENV *drawenv)
Definition draw.c:184
GsPrimitiveTypes
Definition libgs.h:66
u32 sample_r_v
Definition libgs.h:462
u8 vram_width
Definition libgs.h:2308
GS_R_XYZ xyz2
Definition libgs.h:2160
u16 height
Definition libgs.h:2304
u32 pad2
Definition libgs.h:553
u32 exvwine
Definition libgs.h:366
Definition libgs.h:602
Definition libgs.h:607
Definition libgs.h:333