1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - GX -
3   File:     g3_util.c
4 
5   Copyright 2003-2008 Nintendo.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2008-09-18#$
14   $Rev: 8573 $
15   $Author: okubata_ryoma $
16  *---------------------------------------------------------------------------*/
17 
18 #include <nitro/gx/g3_util.h>
19 #include <nitro/gx/g3imm.h>
20 #include <nitro/gx/g3b.h>
21 #include <nitro/gx/g3c.h>
22 #include <nitro/gx/gx_vramcnt.h>
23 #include <nitro/fx/fx_cp.h>
24 #include <nitro/fx/fx_vec.h>
25 #ifdef SDK_NITRO
26 #include <nitro/hw/ARM9/mmap_global.h>
27 #else
28 #include <twl/hw/ARM9/mmap_global.h>
29 #endif
30 #include <nitro/mi/dma.h>
31 #include <nitro/mi/memory.h>
32 
33 
34 
35 /*---------------------------------------------------------------------------*
36   Name:         G3i_FrustumW_
37 
38   Description:  Computes a 4x4 perspective projection matrix from a specified
39                 view volume, and Load it to the current projection matrix if draw flag is TRUE.
40 
41   Arguments:    t            top coordinate of view volume at the near clipping plane
42                 b            bottom coordinate of view volume at the near clipping plane
43                 l            left coordinate of view volume at near clipping plane
44                 r            right coordinate of view volume at near clipping plane
45                 n            positive distance from camera to near clipping plane
46                 f            positive distance from camera to far clipping plane
47                 draw         if TRUE load to projection matrix
48                 mtx          4x4 matrix to be set if not NULL
49 
50   Returns:      none
51  *---------------------------------------------------------------------------*/
G3i_FrustumW_(fx32 t,fx32 b,fx32 l,fx32 r,fx32 n,fx32 f,fx32 scaleW,BOOL draw,MtxFx44 * mtx)52 void G3i_FrustumW_(fx32 t, fx32 b, fx32 l, fx32 r, fx32 n, fx32 f, fx32 scaleW, BOOL draw,
53                    MtxFx44 *mtx)
54 {
55     MtxFx44 tmp[1];
56     if (mtx == NULL)
57     {
58         mtx = tmp;
59     }
60     MTX_FrustumW(t, b, l, r, n, f, scaleW, mtx);
61     if (draw)
62     {
63         G3_MtxMode(GX_MTXMODE_PROJECTION);
64         G3_LoadMtx44(mtx);
65     }
66 }
67 
68 
69 /*---------------------------------------------------------------------------*
70   Name:         G3i_PerspectiveW_
71 
72   Description:  Computes a 4x4 perspective projection matrix from field of
73                 view and aspect ratio, and Load it to the current projection
74                 matrix if draw flag is TRUE.
75 
76   Arguments:    fovySin      sine value of fovy
77                 fovyCos      cosine value of fovy
78                 aspect       ratio of view window width:height (X / Y)
79                 n            positive distance from camera to near clipping plane
80                 f            positive distance from camera to far clipping plane
81                 scaleW       W scale parameter that adjust precision of view volume.
82                 draw         if TRUE load to projection matrix
83                 mtx          4x4 matrix to be set if not NULL
84 
85   Returns:      none
86  *---------------------------------------------------------------------------*/
G3i_PerspectiveW_(fx32 fovySin,fx32 fovyCos,fx32 aspect,fx32 n,fx32 f,fx32 scaleW,BOOL draw,MtxFx44 * mtx)87 void G3i_PerspectiveW_(fx32 fovySin, fx32 fovyCos, fx32 aspect, fx32 n, fx32 f, fx32 scaleW,
88                        BOOL draw, MtxFx44 *mtx)
89 {
90     MtxFx44 tmp[1];
91     if (mtx == NULL)
92     {
93         mtx = tmp;
94     }
95     MTX_PerspectiveW(fovySin, fovyCos, aspect, n, f, scaleW, mtx);
96     if (draw)
97     {
98         G3_MtxMode(GX_MTXMODE_PROJECTION);
99         G3_LoadMtx44(mtx);
100     }
101 }
102 
103 
104 /*---------------------------------------------------------------------------*
105   Name:         G3i_OrthoW_
106 
107   Description:  Computes a 4x4 orthographic projection matrix, and Load it
108                 to the current projection matrix if draw flag is TRUE.
109 
110   Arguments:    t            top coordinate of parallel view volume
111                 b            bottom coordinate of parallel view volume
112                 l            left coordinate of parallel view volume
113                 r            right coordinate of parallel view volume
114                 n            positive distance from camera to near clipping plane
115                 f            positive distance from camera to far clipping plane
116                 scaleW       W scale parameter that adjust precision of view volume.
117                 draw         if TRUE load to projection matrix
118                 mtx          4x4 matrix to be set if not NULL
119 
120   Returns:      none
121  *---------------------------------------------------------------------------*/
G3i_OrthoW_(fx32 t,fx32 b,fx32 l,fx32 r,fx32 n,fx32 f,fx32 scaleW,BOOL draw,MtxFx44 * mtx)122 void G3i_OrthoW_(fx32 t, fx32 b, fx32 l, fx32 r, fx32 n, fx32 f, fx32 scaleW, BOOL draw,
123                  MtxFx44 *mtx)
124 {
125     MtxFx44 tmp[1];
126     if (mtx == NULL)
127     {
128         mtx = tmp;
129     }
130     MTX_OrthoW(t, b, l, r, n, f, scaleW, mtx);
131     if (draw)
132     {
133         G3_MtxMode(GX_MTXMODE_PROJECTION);
134         G3_LoadMtx44(mtx);
135     }
136 }
137 
138 
139 
140 /*---------------------------------------------------------------------------*
141   Name:         G3i_LookAt_
142 
143   Description:  Computes a matrix to transform points to camera coordinates,
144                 and load it to the current position/vector matrix if draw flag is TRUE.
145 
146   Arguments:    camPos       camera position
147                 camUp        camera 'up' direction
148                 target       camera aim point
149                 draw         if TRUE load to position vector matrix
150                 mtx          a 4x3 matrix to be set if not NULL
151 
152   Returns:      none
153  *---------------------------------------------------------------------------*/
G3i_LookAt_(const VecFx32 * camPos,const VecFx32 * camUp,const VecFx32 * target,BOOL draw,MtxFx43 * mtx)154 void G3i_LookAt_(const VecFx32 *camPos, const VecFx32 *camUp, const VecFx32 *target, BOOL draw,
155                  MtxFx43 *mtx)
156 {
157     MtxFx43 tmp[1];
158     if (mtx == NULL)
159     {
160         mtx = tmp;
161     }
162     MTX_LookAt(camPos, camUp, target, mtx);
163     if (draw)
164     {
165         G3_MtxMode(GX_MTXMODE_POSITION_VECTOR);
166         G3_LoadMtx43(mtx);
167     }
168 }
169 
170 
171 /*---------------------------------------------------------------------------*
172   Name:         G3_RotX
173 
174   Description:  Multiplies the current matrix by a rotation matrix about X axis.
175 
176   Arguments:    s            sine of rotation angle
177                 c            cosine of rotation angle
178 
179   Returns:      none
180  *---------------------------------------------------------------------------*/
G3_RotX(fx32 s,fx32 c)181 void G3_RotX(fx32 s, fx32 c)
182 {
183     vs32   *p = (vs32 *)&reg_G3_MTX_MULT_3x3;
184 
185     SDK_MINMAX_ASSERT(s, -FX32_ONE, FX32_ONE);
186     SDK_MINMAX_ASSERT(c, -FX32_ONE, FX32_ONE);
187 
188     *p = FX32_ONE;                     // _00
189     *p = 0;                            // _01
190     *p = 0;                            // _02
191     *p = 0;                            // _10
192     *p = c;                            // _11
193     *p = s;                            // _12
194     *p = 0;                            // _20
195     *p = -s;                           // _21
196     *p = c;                            // _22
197 }
198 
199 
200 /*---------------------------------------------------------------------------*
201   Name:         G3_RotY
202 
203   Description:  Multiplies the current matrix by a rotation matrix about Y axis.
204 
205   Arguments:    s            sine of rotation angle
206                 c            cosine of rotation angle
207 
208   Returns:      none
209  *---------------------------------------------------------------------------*/
G3_RotY(fx32 s,fx32 c)210 void G3_RotY(fx32 s, fx32 c)
211 {
212     vs32   *p = (vs32 *)&reg_G3_MTX_MULT_3x3;
213 
214     SDK_MINMAX_ASSERT(s, -FX32_ONE, FX32_ONE);
215     SDK_MINMAX_ASSERT(c, -FX32_ONE, FX32_ONE);
216 
217     *p = c;                            // _00
218     *p = 0;                            // _01
219     *p = -s;                           // _02
220     *p = 0;                            // _10
221     *p = FX32_ONE;                     // _11
222     *p = 0;                            // _12
223     *p = s;                            // _20
224     *p = 0;                            // _21
225     *p = c;                            // _22
226 }
227 
228 
229 /*---------------------------------------------------------------------------*
230   Name:         G3_RotZ
231 
232   Description:  Multiplies the current matrix by a rotation matrix about Z axis.
233 
234   Arguments:    s            sine of rotation matrix
235                 c            cosine of rotation matrix
236 
237   Returns:      none
238  *---------------------------------------------------------------------------*/
G3_RotZ(fx32 s,fx32 c)239 void G3_RotZ(fx32 s, fx32 c)
240 {
241     vs32   *p = (vs32 *)&reg_G3_MTX_MULT_3x3;
242 
243     SDK_MINMAX_ASSERT(s, -FX32_ONE, FX32_ONE);
244     SDK_MINMAX_ASSERT(c, -FX32_ONE, FX32_ONE);
245 
246     *p = c;                            // _00
247     *p = s;                            // _01
248     *p = 0;                            // _02
249     *p = -s;                           // _10
250     *p = c;                            // _11
251     *p = 0;                            // _12
252     *p = 0;                            // _20
253     *p = 0;                            // _21
254     *p = FX32_ONE;                     // _22
255 }
256 
257 
258 /*---------------------------------------------------------------------------*
259   Name:         G3_LoadTexMtxTexCoord
260 
261   Description:  Loads a texture matrix to the current one on the geometry engine,
262                 adjusting the elements for TexCoord source.
263 
264   Arguments:    mtx          a pointer to a 4x4 matrix
265 
266   Returns:      none
267  *---------------------------------------------------------------------------*/
G3_LoadTexMtxTexCoord(const MtxFx44 * mtx)268 void G3_LoadTexMtxTexCoord(const MtxFx44 *mtx)
269 {
270     vs32   *p = (vs32 *)&reg_G3_MTX_LOAD_4x4;
271     SDK_NULL_ASSERT(mtx);
272     G3_MtxMode(GX_MTXMODE_TEXTURE);
273 
274     *p = mtx->_00;
275     *p = mtx->_01;
276     *p = mtx->_02;
277     *p = mtx->_03;
278     *p = mtx->_10;
279     *p = mtx->_11;
280     *p = mtx->_12;
281     *p = mtx->_13;
282     *p = mtx->_20 << 4;
283     *p = mtx->_21 << 4;
284     *p = mtx->_22 << 4;
285     *p = mtx->_23 << 4;
286     *p = mtx->_30 << 4;
287     *p = mtx->_31 << 4;
288     *p = mtx->_32 << 4;
289     *p = mtx->_33 << 4;
290 }
291 
292 
G3xx_LoadTexMtxTexCoord_(u32 * param,const MtxFx44 * mtx)293 static void G3xx_LoadTexMtxTexCoord_(u32 *param, const MtxFx44 *mtx)
294 {
295 #if 1
296     MI_Copy32B(&mtx->_00, (void *)(param + 2));
297 #else
298     *(param + 2) = (u32)(mtx->_00);
299     *(param + 3) = (u32)(mtx->_01);
300     *(param + 4) = (u32)(mtx->_02);
301     *(param + 5) = (u32)(mtx->_03);
302     *(param + 6) = (u32)(mtx->_10);
303     *(param + 7) = (u32)(mtx->_11);
304     *(param + 8) = (u32)(mtx->_12);
305     *(param + 9) = (u32)(mtx->_13);
306 #endif
307     *(param + 10) = (u32)(mtx->_20 << 4);
308     *(param + 11) = (u32)(mtx->_21 << 4);
309     *(param + 12) = (u32)(mtx->_22 << 4);
310     *(param + 13) = (u32)(mtx->_23 << 4);
311     *(param + 14) = (u32)(mtx->_30 << 4);
312     *(param + 15) = (u32)(mtx->_31 << 4);
313     *(param + 16) = (u32)(mtx->_32 << 4);
314     *(param + 17) = (u32)(mtx->_33 << 4);
315 }
316 
317 
318 /*---------------------------------------------------------------------------*
319   Name:         G3BS_LoadTexMtxTexCoord
320 
321   Description:  Generates a display list code without command packing,
322                 to load a texture matrix to the current one on the geometry
323                 engine, adjusting the elements for TexCoord source.
324 
325   Arguments:    info         a pointer to display list info
326                 mtx          a pointer to a 4x4 matrix
327 
328   Returns:      none
329  *---------------------------------------------------------------------------*/
G3BS_LoadTexMtxTexCoord(GXDLInfo * info,const MtxFx44 * mtx)330 void G3BS_LoadTexMtxTexCoord(GXDLInfo *info, const MtxFx44 *mtx)
331 {
332     SDK_NULL_ASSERT(mtx);
333     SDK_NULL_ASSERT(info);
334 
335     *(u32 *)info->curr_cmd = (u32)G3OP_MTX_MODE;
336     *info->curr_param = (u32)(GX_MTXMODE_TEXTURE << REG_G3_MTX_MODE_M_SHIFT);
337     *(info->curr_param + 1) = (u32)G3OP_MTX_LOAD_4x4;
338 
339     G3xx_LoadTexMtxTexCoord_(info->curr_param, mtx);
340 }
341 
342 
343 /*---------------------------------------------------------------------------*
344   Name:         G3CS_LoadTexMtxTexCoord
345 
346   Description:  Generates a display list code with command packing,
347                 to load a texture matrix to the current one on the geometry
348                 engine, adjusting the elements for TexCoord source.
349 
350   Arguments:    info         a pointer to display list info
351                 mtx          a pointer to a 4x4 matrix
352 
353   Returns:      none
354  *---------------------------------------------------------------------------*/
355 #include <nitro/code32.h>              // avoid byte access problems
G3CS_LoadTexMtxTexCoord(GXDLInfo * info,const MtxFx44 * mtx)356 void G3CS_LoadTexMtxTexCoord(GXDLInfo *info, const MtxFx44 *mtx)
357 {
358     SDK_NULL_ASSERT(info);
359     SDK_NULL_ASSERT(mtx);
360 
361     // padding(notice that info->curr_cmd and info->curr_param change)
362     switch ((u32)info->curr_cmd & 3)
363     {
364         // padding
365     case 0:
366         // DO NOTHING
367         break;
368     case 1:
369         *info->curr_cmd++ = 0;         // byte access
370     case 2:
371         *info->curr_cmd++ = 0;
372     case 3:
373         *info->curr_cmd++ = 0;
374         ++info->curr_param;
375     };
376 
377     *(u32 *)info->curr_cmd = (G3OP_MTX_LOAD_4x4 << 8) | G3OP_MTX_MODE;
378     *info->curr_param = (u32)(GX_MTXMODE_TEXTURE << REG_G3_MTX_MODE_M_SHIFT);
379     *(info->curr_param + 1) = (u32)G3OP_MTX_LOAD_4x4;
380 
381     G3xx_LoadTexMtxTexCoord_(info->curr_param, mtx);
382 }
383 
384 #include <nitro/codereset.h>
385 
386 /*---------------------------------------------------------------------------*
387   Name:         G3_LoadTexMtxEnv
388 
389   Description:  Loads a texture matrix to the current one on the geometry engine,
390                 adjusting the elements for Normal/Vertex source.
391 
392   Arguments:    mtx          a pointer to a 4x4 matrix
393 
394   Returns:      none
395  *---------------------------------------------------------------------------*/
G3_LoadTexMtxEnv(const MtxFx44 * mtx)396 void G3_LoadTexMtxEnv(const MtxFx44 *mtx)
397 {
398     vs32   *p = (vs32 *)&reg_G3_MTX_LOAD_4x4;
399     SDK_NULL_ASSERT(mtx);
400     G3_MtxMode(GX_MTXMODE_TEXTURE);
401 
402     // The input must be (x16, x16, x16) scaled when you set a texture matrix
403     *p = mtx->_00 << 4;
404     *p = mtx->_01 << 4;
405     *p = mtx->_02 << 4;
406     *p = mtx->_03 << 4;
407     *p = mtx->_10 << 4;
408     *p = mtx->_11 << 4;
409     *p = mtx->_12 << 4;
410     *p = mtx->_13 << 4;
411     *p = mtx->_20 << 4;
412     *p = mtx->_21 << 4;
413     *p = mtx->_22 << 4;
414     *p = mtx->_23 << 4;
415     *p = mtx->_30;
416     *p = mtx->_31;
417     *p = mtx->_32;
418     *p = mtx->_33;
419 }
420 
421 
422 /*---------------------------------------------------------------------------*
423   Name:         G3BS_LoadTexMtxEnv
424 
425   Description:  Generates a display list code without command packing,
426                 to load a texture matrix to the current one on the geometry
427                 engine, adjusting the elements for Normal/Vertex source.
428 
429   Arguments:    info         a pointer to display list info
430                 mtx          a pointer to a 4x4 matrix
431 
432   Returns:      none
433  *---------------------------------------------------------------------------*/
G3BS_LoadTexMtxEnv(GXDLInfo * info,const MtxFx44 * mtx)434 void G3BS_LoadTexMtxEnv(GXDLInfo *info, const MtxFx44 *mtx)
435 {
436     SDK_NULL_ASSERT(info);
437     SDK_NULL_ASSERT(mtx);
438 
439     *(u32 *)info->curr_cmd = (u32)G3OP_MTX_MODE;
440     *info->curr_param = (u32)(GX_MTXMODE_TEXTURE << REG_G3_MTX_MODE_M_SHIFT);
441     *(info->curr_param + 1) = (u32)G3OP_MTX_LOAD_4x4;
442 
443     *(info->curr_param + 2) = (u32)(mtx->_00 << 4);
444     *(info->curr_param + 3) = (u32)(mtx->_01 << 4);
445     *(info->curr_param + 4) = (u32)(mtx->_02 << 4);
446     *(info->curr_param + 5) = (u32)(mtx->_03 << 4);
447     *(info->curr_param + 6) = (u32)(mtx->_10 << 4);
448     *(info->curr_param + 7) = (u32)(mtx->_11 << 4);
449     *(info->curr_param + 8) = (u32)(mtx->_12 << 4);
450     *(info->curr_param + 9) = (u32)(mtx->_13 << 4);
451     *(info->curr_param + 10) = (u32)(mtx->_20 << 4);
452     *(info->curr_param + 11) = (u32)(mtx->_21 << 4);
453     *(info->curr_param + 12) = (u32)(mtx->_22 << 4);
454     *(info->curr_param + 13) = (u32)(mtx->_23 << 4);
455     *(info->curr_param + 14) = (u32)mtx->_30;
456     *(info->curr_param + 15) = (u32)mtx->_31;
457     *(info->curr_param + 16) = (u32)mtx->_32;
458     *(info->curr_param + 17) = (u32)mtx->_33;
459 }
460 
461 
462 /*---------------------------------------------------------------------------*
463   Name:         G3CS_LoadTexMtxEnv
464 
465   Description:  Generates a display list code with command packing,
466                 to load a texture matrix to the current one on the geometry
467                 engine, adjusting the elements for Normal/Vertex source.
468 
469   Arguments:    info         a pointer to display list info
470                 mtx          a pointer to a 4x4 matrix
471 
472   Returns:      none
473  *---------------------------------------------------------------------------*/
474 #include <nitro/code32.h>              // avoid byte access problems
G3CS_LoadTexMtxEnv(GXDLInfo * info,const MtxFx44 * mtx)475 void G3CS_LoadTexMtxEnv(GXDLInfo *info, const MtxFx44 *mtx)
476 {
477     SDK_NULL_ASSERT(info);
478     SDK_NULL_ASSERT(mtx);
479 
480     // padding(notice that info->curr_cmd and info->curr_param change)
481     switch ((u32)info->curr_cmd & 3)
482     {
483         // padding
484     case 0:
485         // DO NOTHING
486         break;
487     case 1:
488         *info->curr_cmd++ = 0;         // byte access
489     case 2:
490         *info->curr_cmd++ = 0;
491     case 3:
492         *info->curr_cmd++ = 0;
493         ++info->curr_param;
494     };
495 
496     *(u32 *)info->curr_cmd = (G3OP_MTX_LOAD_4x4 << 8) | G3OP_MTX_MODE;
497     *info->curr_param = (u32)(GX_MTXMODE_TEXTURE << REG_G3_MTX_MODE_M_SHIFT);
498     *(info->curr_param + 1) = (u32)G3OP_MTX_LOAD_4x4;
499 
500     *(info->curr_param + 2) = (u32)(mtx->_00 << 4);
501     *(info->curr_param + 3) = (u32)(mtx->_01 << 4);
502     *(info->curr_param + 4) = (u32)(mtx->_02 << 4);
503     *(info->curr_param + 5) = (u32)(mtx->_03 << 4);
504     *(info->curr_param + 6) = (u32)(mtx->_10 << 4);
505     *(info->curr_param + 7) = (u32)(mtx->_11 << 4);
506     *(info->curr_param + 8) = (u32)(mtx->_12 << 4);
507     *(info->curr_param + 9) = (u32)(mtx->_13 << 4);
508     *(info->curr_param + 10) = (u32)(mtx->_20 << 4);
509     *(info->curr_param + 11) = (u32)(mtx->_21 << 4);
510     *(info->curr_param + 12) = (u32)(mtx->_22 << 4);
511     *(info->curr_param + 13) = (u32)(mtx->_23 << 4);
512     *(info->curr_param + 14) = (u32)(mtx->_30);
513     *(info->curr_param + 15) = (u32)(mtx->_31);
514     *(info->curr_param + 16) = (u32)(mtx->_32);
515     *(info->curr_param + 17) = (u32)(mtx->_33);
516 }
517 
518 #include <nitro/codereset.h>
519 
520 /*---------------------------------------------------------------------------*
521   Name:         G3B_LoadTexMtxTexCoord
522 
523   Description:  Increments the pointer to the display list buffer
524                 after it executed G3BS_LoadTexMtxTexCoord.
525 
526   Arguments:    info         a pointer to display list info
527                 mtx          a pointer to a 4x4 matrix
528 
529   Returns:      none
530  *---------------------------------------------------------------------------*/
G3B_LoadTexMtxTexCoord(GXDLInfo * info,const MtxFx44 * mtx)531 void G3B_LoadTexMtxTexCoord(GXDLInfo *info, const MtxFx44 *mtx)
532 {
533     G3BS_LoadTexMtxTexCoord(info, mtx);
534     G3B_UpdateGXDLInfo(info, G3OP_MTX_MODE_NPARAMS + G3OP_MTX_LOAD_4x4_NPARAMS + 1);
535 }
536 
537 
538 /*---------------------------------------------------------------------------*
539   Name:         G3C_LoadTexMtxTexCoord
540 
541   Description:  Increments the pointer to the display list buffer
542                 after it executed G3CS_LoadTexMtxTexCoord.
543 
544   Arguments:    info         a pointer to display list info
545                 mtx          a pointer to a 4x4 matrix
546 
547   Returns:      none
548  *---------------------------------------------------------------------------*/
G3C_LoadTexMtxTexCoord(GXDLInfo * info,const MtxFx44 * mtx)549 void G3C_LoadTexMtxTexCoord(GXDLInfo *info, const MtxFx44 *mtx)
550 {
551     G3CS_LoadTexMtxTexCoord(info, mtx);
552     info->curr_param += G3OP_MTX_MODE_NPARAMS + G3OP_MTX_LOAD_4x4_NPARAMS + 1;
553     info->curr_cmd += 2;
554 }
555 
556 
557 /*---------------------------------------------------------------------------*
558   Name:         G3B_LoadTexMtxEnv
559 
560   Description:  Increments the pointer to the display list buffer
561                 after it executed G3BS_LoadTexMtxEnv.
562 
563   Arguments:    info         a pointer to display list info
564                 mtx          a pointer to a 4x4 matrix
565 
566   Returns:      none
567  *---------------------------------------------------------------------------*/
G3B_LoadTexMtxEnv(GXDLInfo * info,const MtxFx44 * mtx)568 void G3B_LoadTexMtxEnv(GXDLInfo *info, const MtxFx44 *mtx)
569 {
570     G3BS_LoadTexMtxEnv(info, mtx);
571     G3B_UpdateGXDLInfo(info, G3OP_MTX_MODE_NPARAMS + G3OP_MTX_LOAD_4x4_NPARAMS + 1);
572 }
573 
574 
575 /*---------------------------------------------------------------------------*
576   Name:         G3C_LoadTexMtxEnv
577 
578   Description:  Increments the pointer to the display list buffer
579                 after it executed G3CS_LoadTexMtxEnv.
580 
581   Arguments:    info         a pointer to display list info
582                 mtx          a pointer to a 4x4 matrix
583 
584   Returns:      none
585  *---------------------------------------------------------------------------*/
G3C_LoadTexMtxEnv(GXDLInfo * info,const MtxFx44 * mtx)586 void G3C_LoadTexMtxEnv(GXDLInfo *info, const MtxFx44 *mtx)
587 {
588     G3CS_LoadTexMtxEnv(info, mtx);
589     info->curr_param += G3OP_MTX_MODE_NPARAMS + G3OP_MTX_LOAD_4x4_NPARAMS + 1;
590     info->curr_cmd += 2;
591 }
592