gfxd_sys/
arg_type.rs

1/* SPDX-FileCopyrightText: © 2025 Decompollaborate */
2/* SPDX-License-Identifier: MIT */
3
4//! Argument types
5
6/// generic word
7pub const gfxd_Word: ArgType = ArgType::gfxd_Word;
8/// command opcode (G_*)
9pub const gfxd_Opcode: ArgType = ArgType::gfxd_Opcode;
10/// integer coordinate
11pub const gfxd_Coordi: ArgType = ArgType::gfxd_Coordi;
12/// fractional (q10.2) coordinate
13pub const gfxd_Coordq: ArgType = ArgType::gfxd_Coordq;
14/// palette index
15pub const gfxd_Pal: ArgType = ArgType::gfxd_Pal;
16/// tlut pointer
17pub const gfxd_Tlut: ArgType = ArgType::gfxd_Tlut;
18/// texture image pointer
19pub const gfxd_Timg: ArgType = ArgType::gfxd_Timg;
20/// tmem address
21pub const gfxd_Tmem: ArgType = ArgType::gfxd_Tmem;
22/// tile index
23pub const gfxd_Tile: ArgType = ArgType::gfxd_Tile;
24/// texture format
25pub const gfxd_Fmt: ArgType = ArgType::gfxd_Fmt;
26/// texture pixel size
27pub const gfxd_Siz: ArgType = ArgType::gfxd_Siz;
28/// integer dimension (width / height)
29pub const gfxd_Dim: ArgType = ArgType::gfxd_Dim;
30/// clamp and mirror flags
31pub const gfxd_Cm: ArgType = ArgType::gfxd_Cm;
32/// tile mask
33pub const gfxd_Tm: ArgType = ArgType::gfxd_Tm;
34/// tile shift
35pub const gfxd_Ts: ArgType = ArgType::gfxd_Ts;
36/// texture dxt
37pub const gfxd_Dxt: ArgType = ArgType::gfxd_Dxt;
38/// generic tag
39pub const gfxd_Tag: ArgType = ArgType::gfxd_Tag;
40/// pipeline mode
41pub const gfxd_Pm: ArgType = ArgType::gfxd_Pm;
42/// color component
43pub const gfxd_Colorpart: ArgType = ArgType::gfxd_Colorpart;
44/// color
45pub const gfxd_Color: ArgType = ArgType::gfxd_Color;
46/// lod fraction (q0.8)
47pub const gfxd_Lodfrac: ArgType = ArgType::gfxd_Lodfrac;
48/// color image pointer
49pub const gfxd_Cimg: ArgType = ArgType::gfxd_Cimg;
50/// depth image pointer
51pub const gfxd_Zimg: ArgType = ArgType::gfxd_Zimg;
52/// alpha compare mode
53pub const gfxd_Ac: ArgType = ArgType::gfxd_Ac;
54/// alpha dither mode
55pub const gfxd_Ad: ArgType = ArgType::gfxd_Ad;
56/// color dither mode
57pub const gfxd_Cd: ArgType = ArgType::gfxd_Cd;
58/// color combiner preset index
59pub const gfxd_Ccpre: ArgType = ArgType::gfxd_Ccpre;
60/// color mux operand (a)
61pub const gfxd_Ccmuxa: ArgType = ArgType::gfxd_Ccmuxa;
62/// color mux operand (b)
63pub const gfxd_Ccmuxb: ArgType = ArgType::gfxd_Ccmuxb;
64/// color mux operand (c)
65pub const gfxd_Ccmuxc: ArgType = ArgType::gfxd_Ccmuxc;
66/// color mux operand (d)
67pub const gfxd_Ccmuxd: ArgType = ArgType::gfxd_Ccmuxd;
68/// alpha mux operand (a, b, or d)
69pub const gfxd_Acmuxabd: ArgType = ArgType::gfxd_Acmuxabd;
70/// alpha mux operand (c)
71pub const gfxd_Acmuxc: ArgType = ArgType::gfxd_Acmuxc;
72/// color convert operand
73pub const gfxd_Cv: ArgType = ArgType::gfxd_Cv;
74/// texture convert mode
75pub const gfxd_Tc: ArgType = ArgType::gfxd_Tc;
76/// cycle type
77pub const gfxd_Cyc: ArgType = ArgType::gfxd_Cyc;
78/// depth source mode
79pub const gfxd_Zs: ArgType = ArgType::gfxd_Zs;
80/// combine key mode
81pub const gfxd_Ck: ArgType = ArgType::gfxd_Ck;
82/// combine key scale
83pub const gfxd_Keyscale: ArgType = ArgType::gfxd_Keyscale;
84/// combine key width
85pub const gfxd_Keywidth: ArgType = ArgType::gfxd_Keywidth;
86/// integer depth
87pub const gfxd_Zi: ArgType = ArgType::gfxd_Zi;
88/// cycle 1 render mode
89pub const gfxd_Rm1: ArgType = ArgType::gfxd_Rm1;
90/// cycle 2 render mode
91pub const gfxd_Rm2: ArgType = ArgType::gfxd_Rm2;
92/// scissor mode
93pub const gfxd_Sc: ArgType = ArgType::gfxd_Sc;
94/// texture detail mode
95pub const gfxd_Td: ArgType = ArgType::gfxd_Td;
96/// texture filter mode
97pub const gfxd_Tf: ArgType = ArgType::gfxd_Tf;
98/// texture LOD mode
99pub const gfxd_Tl: ArgType = ArgType::gfxd_Tl;
100/// textuure LUT mode
101pub const gfxd_Tt: ArgType = ArgType::gfxd_Tt;
102/// texture perspective mode
103pub const gfxd_Tp: ArgType = ArgType::gfxd_Tp;
104/// texture line size
105pub const gfxd_Line: ArgType = ArgType::gfxd_Line;
106/// vertex index
107pub const gfxd_Vtx: ArgType = ArgType::gfxd_Vtx;
108/// vertex flag
109pub const gfxd_Vtxflag: ArgType = ArgType::gfxd_Vtxflag;
110/// display list pointer
111pub const gfxd_Dl: ArgType = ArgType::gfxd_Dl;
112/// raw depth value (q16.16)
113pub const gfxd_Zraw: ArgType = ArgType::gfxd_Zraw;
114/// display list flag
115pub const gfxd_Dlflag: ArgType = ArgType::gfxd_Dlflag;
116/// clip ratio
117pub const gfxd_Cr: ArgType = ArgType::gfxd_Cr;
118/// element count
119pub const gfxd_Num: ArgType = ArgType::gfxd_Num;
120/// fog factor
121pub const gfxd_Fogz: ArgType = ArgType::gfxd_Fogz;
122/// fog position (0 - 1000)
123pub const gfxd_Fogp: ArgType = ArgType::gfxd_Fogp;
124/// matrix pointer
125pub const gfxd_Mtxptr: ArgType = ArgType::gfxd_Mtxptr;
126/// geometry mode
127pub const gfxd_Gm: ArgType = ArgType::gfxd_Gm;
128/// matrix moveword offset
129pub const gfxd_Mwo_matrix: ArgType = ArgType::gfxd_Mwo_matrix;
130/// line width (1.5 + q7.1)
131pub const gfxd_Linewd: ArgType = ArgType::gfxd_Linewd;
132/// microcode text pointer
133pub const gfxd_Uctext: ArgType = ArgType::gfxd_Uctext;
134/// microcode data pointer
135pub const gfxd_Ucdata: ArgType = ArgType::gfxd_Ucdata;
136/// data size
137pub const gfxd_Size: ArgType = ArgType::gfxd_Size;
138/// lookat pointer
139pub const gfxd_Lookatptr: ArgType = ArgType::gfxd_Lookatptr;
140/// matrix param
141pub const gfxd_Mtxparam: ArgType = ArgType::gfxd_Mtxparam;
142/// matrix param (stack select only)
143pub const gfxd_Mtxstack: ArgType = ArgType::gfxd_Mtxstack;
144/// vertex moveword offset
145pub const gfxd_Mwo_point: ArgType = ArgType::gfxd_Mwo_point;
146/// w-component scale (perspnorm)
147pub const gfxd_Wscale: ArgType = ArgType::gfxd_Wscale;
148/// segment number
149pub const gfxd_Seg: ArgType = ArgType::gfxd_Seg;
150/// segment pointer
151pub const gfxd_Segptr: ArgType = ArgType::gfxd_Segptr;
152/// dereferenced LightsM (0-7 or n) pointer
153pub const gfxd_Lightsn: ArgType = ArgType::gfxd_Lightsn;
154/// light count (NUMLIGHTS_*)
155pub const gfxd_Numlights: ArgType = ArgType::gfxd_Numlights;
156/// light number (LIGHT_*)
157pub const gfxd_Lightnum: ArgType = ArgType::gfxd_Lightnum;
158/// diffuse or ambient light pointer
159pub const gfxd_Lightptr: ArgType = ArgType::gfxd_Lightptr;
160/// texture coordinate scale
161pub const gfxd_Tcscale: ArgType = ArgType::gfxd_Tcscale;
162/// on-off value
163pub const gfxd_Switch: ArgType = ArgType::gfxd_Switch;
164/// vertex coordinate (q10.5)
165pub const gfxd_St: ArgType = ArgType::gfxd_St;
166/// vertex coordinate delta (q5.10)
167pub const gfxd_Stdelta: ArgType = ArgType::gfxd_Stdelta;
168/// vertex pointer
169pub const gfxd_Vtxptr: ArgType = ArgType::gfxd_Vtxptr;
170/// viewport pointer
171pub const gfxd_Vpptr: ArgType = ArgType::gfxd_Vpptr;
172/// generic dram address
173pub const gfxd_Dram: ArgType = ArgType::gfxd_Dram;
174/// othermode lo shift
175pub const gfxd_Sftlo: ArgType = ArgType::gfxd_Sftlo;
176/// othermode lo value
177pub const gfxd_Othermodelo: ArgType = ArgType::gfxd_Othermodelo;
178/// othermode hi shift
179pub const gfxd_Sfthi: ArgType = ArgType::gfxd_Sfthi;
180/// othermode hi value
181pub const gfxd_Othermodehi: ArgType = ArgType::gfxd_Othermodehi;
182/// moveword index
183pub const gfxd_Mw: ArgType = ArgType::gfxd_Mw;
184/// moveword offset
185pub const gfxd_Mwo: ArgType = ArgType::gfxd_Mwo;
186/// clip ratio moveword offset
187pub const gfxd_Mwo_clip: ArgType = ArgType::gfxd_Mwo_clip;
188/// light color moveword offset
189pub const gfxd_Mwo_lightcol: ArgType = ArgType::gfxd_Mwo_lightcol;
190/// movemem index
191pub const gfxd_Mv: ArgType = ArgType::gfxd_Mv;
192/// movemem offset
193pub const gfxd_Mvo: ArgType = ArgType::gfxd_Mvo;
194/// dmem address
195pub const gfxd_Dmem: ArgType = ArgType::gfxd_Dmem;
196/// dma io flag
197pub const gfxd_Dmaflag: ArgType = ArgType::gfxd_Dmaflag;
198
199#[repr(u32)]
200#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
201pub enum ArgType {
202    /// generic word
203    gfxd_Word = 0,
204    /// command opcode (G_*)
205    gfxd_Opcode = 1,
206    /// integer coordinate
207    gfxd_Coordi = 2,
208    /// fractional (q10.2) coordinate
209    gfxd_Coordq = 3,
210    /// palette index
211    gfxd_Pal = 4,
212    /// tlut pointer
213    gfxd_Tlut = 5,
214    /// texture image pointer
215    gfxd_Timg = 6,
216    /// tmem address
217    gfxd_Tmem = 7,
218    /// tile index
219    gfxd_Tile = 8,
220    /// texture format
221    gfxd_Fmt = 9,
222    /// texture pixel size
223    gfxd_Siz = 10,
224    /// integer dimension (width / height)
225    gfxd_Dim = 11,
226    /// clamp and mirror flags
227    gfxd_Cm = 12,
228    /// tile mask
229    gfxd_Tm = 13,
230    /// tile shift
231    gfxd_Ts = 14,
232    /// texture dxt
233    gfxd_Dxt = 15,
234    /// generic tag
235    gfxd_Tag = 16,
236    /// pipeline mode
237    gfxd_Pm = 17,
238    /// color component
239    gfxd_Colorpart = 18,
240    /// color
241    gfxd_Color = 19,
242    /// lod fraction (q0.8)
243    gfxd_Lodfrac = 20,
244    /// color image pointer
245    gfxd_Cimg = 21,
246    /// depth image pointer
247    gfxd_Zimg = 22,
248    /// alpha compare mode
249    gfxd_Ac = 23,
250    /// alpha dither mode
251    gfxd_Ad = 24,
252    /// color dither mode
253    gfxd_Cd = 25,
254    /// color combiner preset index
255    gfxd_Ccpre = 26,
256    /// color mux operand (a)
257    gfxd_Ccmuxa = 27,
258    /// color mux operand (b)
259    gfxd_Ccmuxb = 28,
260    /// color mux operand (c)
261    gfxd_Ccmuxc = 29,
262    /// color mux operand (d)
263    gfxd_Ccmuxd = 30,
264    /// alpha mux operand (a, b, or d)
265    gfxd_Acmuxabd = 31,
266    /// alpha mux operand (c)
267    gfxd_Acmuxc = 32,
268    /// color convert operand
269    gfxd_Cv = 33,
270    /// texture convert mode
271    gfxd_Tc = 34,
272    /// cycle type
273    gfxd_Cyc = 35,
274    /// depth source mode
275    gfxd_Zs = 36,
276    /// combine key mode
277    gfxd_Ck = 37,
278    /// combine key scale
279    gfxd_Keyscale = 38,
280    /// combine key width
281    gfxd_Keywidth = 39,
282    /// integer depth
283    gfxd_Zi = 40,
284    /// cycle 1 render mode
285    gfxd_Rm1 = 41,
286    /// cycle 2 render mode
287    gfxd_Rm2 = 42,
288    /// scissor mode
289    gfxd_Sc = 43,
290    /// texture detail mode
291    gfxd_Td = 44,
292    /// texture filter mode
293    gfxd_Tf = 45,
294    /// texture LOD mode
295    gfxd_Tl = 46,
296    /// textuure LUT mode
297    gfxd_Tt = 47,
298    /// texture perspective mode
299    gfxd_Tp = 48,
300    /// texture line size
301    gfxd_Line = 49,
302    /// vertex index
303    gfxd_Vtx = 50,
304    /// vertex flag
305    gfxd_Vtxflag = 51,
306    /// display list pointer
307    gfxd_Dl = 52,
308    /// raw depth value (q16.16)
309    gfxd_Zraw = 53,
310    /// display list flag
311    gfxd_Dlflag = 54,
312    /// clip ratio
313    gfxd_Cr = 55,
314    /// element count
315    gfxd_Num = 56,
316    /// fog factor
317    gfxd_Fogz = 57,
318    /// fog position (0 - 1000)
319    gfxd_Fogp = 58,
320    /// matrix pointer
321    gfxd_Mtxptr = 59,
322    /// geometry mode
323    gfxd_Gm = 60,
324    /// matrix moveword offset
325    gfxd_Mwo_matrix = 61,
326    /// line width (1.5 + q7.1)
327    gfxd_Linewd = 62,
328    /// microcode text pointer
329    gfxd_Uctext = 63,
330    /// microcode data pointer
331    gfxd_Ucdata = 64,
332    /// data size
333    gfxd_Size = 65,
334    /// lookat pointer
335    gfxd_Lookatptr = 66,
336    /// matrix param
337    gfxd_Mtxparam = 67,
338    /// matrix param (stack select only)
339    gfxd_Mtxstack = 68,
340    /// vertex moveword offset
341    gfxd_Mwo_point = 69,
342    /// w-component scale (perspnorm)
343    gfxd_Wscale = 70,
344    /// segment number
345    gfxd_Seg = 71,
346    /// segment pointer
347    gfxd_Segptr = 72,
348    /// dereferenced LightsM (0-7 or n) pointer
349    gfxd_Lightsn = 73,
350    /// light count (NUMLIGHTS_*)
351    gfxd_Numlights = 74,
352    /// light number (LIGHT_*)
353    gfxd_Lightnum = 75,
354    /// diffuse or ambient light pointer
355    gfxd_Lightptr = 76,
356    /// texture coordinate scale
357    gfxd_Tcscale = 77,
358    /// on-off value
359    gfxd_Switch = 78,
360    /// vertex coordinate (q10.5)
361    gfxd_St = 79,
362    /// vertex coordinate delta (q5.10)
363    gfxd_Stdelta = 80,
364    /// vertex pointer
365    gfxd_Vtxptr = 81,
366    /// viewport pointer
367    gfxd_Vpptr = 82,
368    /// generic dram address
369    gfxd_Dram = 83,
370    /// othermode lo shift
371    gfxd_Sftlo = 84,
372    /// othermode lo value
373    gfxd_Othermodelo = 85,
374    /// othermode hi shift
375    gfxd_Sfthi = 86,
376    /// othermode hi value
377    gfxd_Othermodehi = 87,
378    /// moveword index
379    gfxd_Mw = 88,
380    /// moveword offset
381    gfxd_Mwo = 89,
382    /// clip ratio moveword offset
383    gfxd_Mwo_clip = 90,
384    /// light color moveword offset
385    gfxd_Mwo_lightcol = 91,
386    /// movemem index
387    gfxd_Mv = 92,
388    /// movemem offset
389    gfxd_Mvo = 93,
390    /// dmem address
391    gfxd_Dmem = 94,
392    /// dma io flag
393    gfxd_Dmaflag = 95,
394}