.. _pgraph-xf-ctx:

===============
XF context RAMs
===============

.. contents::


XFCTX
=====

.. todo:: intro?

===== ===== ===== ========================
NV10  NV20  NV30  Name
===== ===== ===== ========================
0x08+ 0x00+ 0x3c+ MATRIX_PROJ
\-    0x04+ 0x40+ MATRIX_UNK440
0x00+ 0x08+ 0x44+ MATRIX_MV0
0x04+ 0x0c+ 0x48+ MATRIX_IMV0
0x0c+ 0x10+ 0x4c+ MATRIX_MV1
0x10+ 0x14+ 0x50+ MATRIX_IMV1
\-    0x18+ 0x54+ MATRIX_MV2
\-    0x1c+ 0x58+ MATRIX_IMV2
\-    0x20+ 0x5c+ MATRIX_MV3
\-    0x24+ 0x60+ MATRIX_IMV3
0x24  0x28  0x64  LIGHT_0_POSITION
0x25  0x29  0x65  LIGHT_1_POSITION
0x26  0x2a  0x66  LIGHT_2_POSITION
0x27  0x2b  0x67  LIGHT_3_POSITION
0x28  0x2c  0x68  LIGHT_4_POSITION
0x29  0x2d  0x69  LIGHT_5_POSITION
0x2a  0x2e  0x6a  LIGHT_6_POSITION
0x2b  0x2f  0x6b  LIGHT_7_POSITION
0x2c  0x30  0x6c  LIGHT_0_SPOT_DIRECTION
0x2d  0x31  0x6d  LIGHT_1_SPOT_DIRECTION
0x2e  0x32  0x6e  LIGHT_2_SPOT_DIRECTION
0x2f  0x33  0x6f  LIGHT_3_SPOT_DIRECTION
0x30  0x34  0x70  LIGHT_4_SPOT_DIRECTION
0x31  0x35  0x71  LIGHT_5_SPOT_DIRECTION
0x32  0x36  0x72  LIGHT_6_SPOT_DIRECTION
0x33  0x37  0x73  LIGHT_7_SPOT_DIRECTION
0x34  0x38  0x74  LIGHT_EYE_POSITION
0x35  \-    \-    CONST_REFLECT_TWO
0x36  \-    \-    CONST_SPHERE_Z_ONE
0x37  \-    \-    CONST_SPHERE_XY_HALF
0x38  0x39  0x75  FOG_PLANE
\-    0x3a  0x76  VIEWPORT_SCALE
0x39  0x3b  0x77  VIEWPORT_TRANSLATE
0x3a  \-    \-    CONST_WEIGHT_ONE
\-    0x3c  0x78  KELVIN_UNK16E0
\-    0x3d  0x79  KELVIN_UNK16F0
\-    0x3e  0x7a  KELVIN_UNK1700
\-    0x3f  0x7b  KELVIN_UNK16D0
0x14  0x40  0x7c  TEX_0_GEN_S
0x15  0x41  0x7d  TEX_0_GEN_T
0x16  0x42  0x7e  TEX_0_GEN_R
0x17  0x43  0x7f  TEX_0_GEN_Q
0x18+ 0x44+ 0x80+ MATRIX_TX0
0x1c  0x48  0x84  TEX_1_GEN_S
0x1d  0x49  0x85  TEX_1_GEN_T
0x1e  0x4a  0x86  TEX_1_GEN_R
0x1f  0x4b  0x87  TEX_1_GEN_Q
0x20+ 0x4c+ 0x88+ MATRIX_TX1
\-    0x50  0x8c  TEX_2_GEN_S
\-    0x51  0x8d  TEX_2_GEN_T
\-    0x52  0x8e  TEX_2_GEN_R
\-    0x53  0x8f  TEX_2_GEN_Q
\-    0x54+ 0x90+ MATRIX_TX2
\-    0x58  0x94  TEX_3_GEN_S
\-    0x59  0x95  TEX_3_GEN_T
\-    0x5a  0x96  TEX_3_GEN_R
\-    0x5b  0x97  TEX_3_GEN_Q
\-    0x5c+ 0x98+ MATRIX_TX3
\-    0x60+ 0x9c+ USER
\-    \-    0x00  TEX_4_GEN_S
\-    \-    0x01  TEX_4_GEN_T
\-    \-    0x02  TEX_4_GEN_R
\-    \-    0x03  TEX_4_GEN_Q
\-    \-    0x04+ MATRIX_TX4
\-    \-    0x08  TEX_5_GEN_S
\-    \-    0x09  TEX_5_GEN_T
\-    \-    0x0a  TEX_5_GEN_R
\-    \-    0x0b  TEX_5_GEN_Q
\-    \-    0x0c+ MATRIX_TX5
\-    \-    0x10  TEX_6_GEN_S
\-    \-    0x11  TEX_6_GEN_T
\-    \-    0x12  TEX_6_GEN_R
\-    \-    0x13  TEX_6_GEN_Q
\-    \-    0x14+ MATRIX_TX6
\-    \-    0x18  TEX_7_GEN_S
\-    \-    0x19  TEX_7_GEN_T
\-    \-    0x1a  TEX_7_GEN_R
\-    \-    0x1b  TEX_7_GEN_Q
\-    \-    0x1c+ MATRIX_TX7
\-    \-    0x20  USER_CLIP_PLANE_0
\-    \-    0x21  USER_CLIP_PLANE_1
\-    \-    0x22  USER_CLIP_PLANE_2
\-    \-    0x23  USER_CLIP_PLANE_3
\-    \-    0x24  USER_CLIP_PLANE_4
\-    \-    0x25  USER_CLIP_PLANE_5
\-    \-    0x26  POINT_PARAMS_A
\-    \-    0x27  {x: POINT_PARAMS_B[0], y: POINT_PARAMS_C, z: POINT_PARAMS_D}
\-    \-    0x28  LIGHT_0_DIRECTION
\-    \-    0x29  LIGHT_1_DIRECTION
\-    \-    0x2a  LIGHT_2_DIRECTION
\-    \-    0x2b  LIGHT_3_DIRECTION
\-    \-    0x2c  LIGHT_4_DIRECTION
\-    \-    0x2d  LIGHT_5_DIRECTION
\-    \-    0x2e  LIGHT_6_DIRECTION
\-    \-    0x2f  LIGHT_7_DIRECTION
\-    \-    0x30  LIGHT_0_HALF_VECTOR_ATTENUATION
\-    \-    0x31  LIGHT_1_HALF_VECTOR_ATTENUATION
\-    \-    0x32  LIGHT_2_HALF_VECTOR_ATTENUATION
\-    \-    0x33  LIGHT_3_HALF_VECTOR_ATTENUATION
\-    \-    0x34  LIGHT_4_HALF_VECTOR_ATTENUATION
\-    \-    0x35  LIGHT_5_HALF_VECTOR_ATTENUATION
\-    \-    0x36  LIGHT_6_HALF_VECTOR_ATTENUATION
\-    \-    0x37  LIGHT_7_HALF_VECTOR_ATTENUATION
\-    \-    0x38  LT_UNK17E0
\-    \-    0x39  ???
\-    \-    0x3a  ???
\-    \-    0x3b  ???
0x3b  \-    \-    [unused]
===== ===== ===== ========================


LTCTX
=====

.. todo:: intro?

==== ==== ==== ========================
NV10 NV20 NV30 Name
==== ==== ==== ========================
0x00 0x00 0x00 LIGHT_0_AMBIENT_COLOR
0x01 0x01 0x01 LIGHT_0_DIFFUSE_COLOR
0x02 0x02 0x02 LIGHT_0_SPECULAR_COLOR
0x03 0x03 \-   LIGHT_0_HALF_VECTOR_ATTENUATION
0x04 0x04 \-   LIGHT_0_DIRECTION
\-   0x05 0x03 LIGHT_0_BACK_AMBIENT_COLOR
\-   0x06 0x04 LIGHT_0_BACK_DIFFUSE_COLOR
\-   0x07 0x05 LIGHT_0_BACK_SPECULAR_COLOR
0x05 0x08 0x06 LIGHT_1_AMBIENT_COLOR
0x06 0x09 0x07 LIGHT_1_DIFFUSE_COLOR
0x07 0x0a 0x08 LIGHT_1_SPECULAR_COLOR
0x08 0x0b \-   LIGHT_1_HALF_VECTOR_ATTENUATION
0x09 0x0c \-   LIGHT_1_DIRECTION
\-   0x0d 0x09 LIGHT_1_BACK_AMBIENT_COLOR
\-   0x0e 0x0a LIGHT_1_BACK_DIFFUSE_COLOR
\-   0x0f 0x0b LIGHT_1_BACK_SPECULAR_COLOR
0x0a 0x10 0x0c LIGHT_2_AMBIENT_COLOR
0x0b 0x11 0x0d LIGHT_2_DIFFUSE_COLOR
0x0c 0x12 0x0e LIGHT_2_SPECULAR_COLOR
0x0d 0x13 \-   LIGHT_2_HALF_VECTOR_ATTENUATION
0x0e 0x14 \-   LIGHT_2_DIRECTION
\-   0x15 0x0f LIGHT_2_BACK_AMBIENT_COLOR
\-   0x16 0x10 LIGHT_2_BACK_DIFFUSE_COLOR
\-   0x17 0x11 LIGHT_2_BACK_SPECULAR_COLOR
0x0f 0x18 0x12 LIGHT_3_AMBIENT_COLOR
0x10 0x19 0x13 LIGHT_3_DIFFUSE_COLOR
0x11 0x1a 0x14 LIGHT_3_SPECULAR_COLOR
0x12 0x1b \-   LIGHT_3_HALF_VECTOR_ATTENUATION
0x13 0x1c \-   LIGHT_3_DIRECTION
\-   0x1d 0x15 LIGHT_3_BACK_AMBIENT_COLOR
\-   0x1e 0x16 LIGHT_3_BACK_DIFFUSE_COLOR
\-   0x1f 0x17 LIGHT_3_BACK_SPECULAR_COLOR
0x14 0x20 0x18 LIGHT_4_AMBIENT_COLOR
0x15 0x21 0x19 LIGHT_4_DIFFUSE_COLOR
0x16 0x22 0x1a LIGHT_4_SPECULAR_COLOR
0x17 0x23 \-   LIGHT_4_HALF_VECTOR_ATTENUATION
0x18 0x24 \-   LIGHT_4_DIRECTION
\-   0x25 0x1b LIGHT_4_BACK_AMBIENT_COLOR
\-   0x26 0x1c LIGHT_4_BACK_DIFFUSE_COLOR
\-   0x27 0x1d LIGHT_4_BACK_SPECULAR_COLOR
0x19 0x28 0x1e LIGHT_5_AMBIENT_COLOR
0x1a 0x29 0x1f LIGHT_5_DIFFUSE_COLOR
0x1b 0x2a 0x20 LIGHT_5_SPECULAR_COLOR
0x1c 0x2b \-   LIGHT_5_HALF_VECTOR_ATTENUATION
0x1d 0x2c \-   LIGHT_5_DIRECTION
\-   0x2d 0x21 LIGHT_5_BACK_AMBIENT_COLOR
\-   0x2e 0x22 LIGHT_5_BACK_DIFFUSE_COLOR
\-   0x2f 0x23 LIGHT_5_BACK_SPECULAR_COLOR
0x1e 0x30 0x24 LIGHT_6_AMBIENT_COLOR
0x1f 0x31 0x25 LIGHT_6_DIFFUSE_COLOR
0x20 0x32 0x26 LIGHT_6_SPECULAR_COLOR
0x21 0x33 \-   LIGHT_6_HALF_VECTOR_ATTENUATION
0x22 0x34 \-   LIGHT_6_DIRECTION
\-   0x35 0x27 LIGHT_6_BACK_AMBIENT_COLOR
\-   0x36 0x28 LIGHT_6_BACK_DIFFUSE_COLOR
\-   0x37 0x29 LIGHT_6_BACK_SPECULAR_COLOR
0x23 0x38 0x2a LIGHT_7_AMBIENT_COLOR
0x24 0x39 0x2b LIGHT_7_DIFFUSE_COLOR
0x25 0x3a 0x2c LIGHT_7_SPECULAR_COLOR
0x26 0x3b \-   LIGHT_7_HALF_VECTOR_ATTENUATION
0x27 0x3c \-   LIGHT_7_DIRECTION
\-   0x3d 0x2d LIGHT_7_BACK_AMBIENT_COLOR
\-   0x3e 0x2e LIGHT_7_BACK_DIFFUSE_COLOR
\-   0x3f 0x2f LIGHT_7_BACK_SPECULAR_COLOR
0x28 \-   \-   ???
\-   0x40 \-   LT_UNK17E0
0x29 0x41 0x30 LIGHT_MODEL_AMBIENT_COLOR
\-   0x42 0x31 LIGHT_MODEL_BACK_AMBIENT_COLOR
0x2a 0x43 0x32 MATERIAL_FACTOR_RGB
\-   0x44 0x33 MATERIAL_FACTOR_BACK_RGB
0x2b 0x45 \-   FOG_COEFF
0x2c \-   \-   CONST_ZERO
\-   0x46 0x34 LT_UNK17D4
0x2d 0x47 \-   POINT_PARAMS_A
0x2e 0x48 \-   POINT_PARAMS_B
0x2f \-   \-   [unused]
\-   0x49 \-   LT_UNK17EC
\-   \-   0x35 ???
\-   \-   0x36 VIEWPORT_TRANSLATE
\-   \-   0x37 VIEWPORT_SCALE
==== ==== ==== ========================


LTC
===

.. todo:: intro?

====== ====== ====== ====================
NV10   NV20   NV30   Name
====== ====== ====== ====================
0.0x00 \-     \-     [const 1.0]
0.0x01 \-     \-     CONST_???
\-     0.0x00 \-     ???
\-     0.0x01 \-     ???
0.0x02 0.0x02 \-     MATERIAL_SHININESS_D
\-     0.0x03 \-     MATERIAL_BACK_SHININESS_D
1.0x00 \-     \-     [const 0.0]
\-     1.0x00 1.0x00 ???
1.0x01 1.0x01 1.0x01 MATERIAL_SHININESS_A
\-     1.0x02 1.0x02 MATERIAL_BACK_SHININESS_A
\-     \-     1.0x03 MATERIAL_SHININESS_D
\-     \-     1.0x04 MATERIAL_BACK_SHININESS_D
1.0x02 1.0x03 \-     POINT_PARAMS_C
1.0x03 1.0x04 1.0x05 LIGHT_0_LOCAL_RANGE
1.0x04 1.0x05 1.0x06 LIGHT_1_LOCAL_RANGE
1.0x05 1.0x06 1.0x07 LIGHT_2_LOCAL_RANGE
1.0x06 1.0x07 1.0x08 LIGHT_3_LOCAL_RANGE
1.0x07 1.0x08 1.0x09 LIGHT_4_LOCAL_RANGE
1.0x08 1.0x09 1.0x0a LIGHT_5_LOCAL_RANGE
1.0x09 1.0x0a 1.0x0b LIGHT_6_LOCAL_RANGE
1.0x0a 1.0x0b 1.0x0c LIGHT_7_LOCAL_RANGE
1.0x0b 1.0x0c 1.0x0d LIGHT_0_SPOT_CUTOFF_0
1.0x0c 1.0x0d 1.0x0e LIGHT_1_SPOT_CUTOFF_0
1.0x0d 1.0x0e 1.0x0f LIGHT_2_SPOT_CUTOFF_0
1.0x0e 1.0x0f 1.0x10 LIGHT_3_SPOT_CUTOFF_0
1.0x0f 1.0x10 1.0x11 LIGHT_4_SPOT_CUTOFF_0
1.0x10 1.0x11 1.0x12 LIGHT_5_SPOT_CUTOFF_0
1.0x11 1.0x12 1.0x13 LIGHT_6_SPOT_CUTOFF_0
1.0x12 1.0x13 1.0x14 LIGHT_7_SPOT_CUTOFF_0
2.0x00 \-     \-     [const 1.0]
\-     2.0x00 2.0x00 ???
2.0x01 2.0x01 2.0x01 MATERIAL_SHININESS_B
\-     2.0x02 2.0x02 MATERIAL_BACK_SHININESS_B
2.0x02 2.0x03 2.0x03 MATERIAL_SHININESS_E
\-     2.0x04 2.0x04 MATERIAL_BACK_SHININESS_E
2.0x03 2.0x05 \-     MATERIAL_SHININESS_F
\-     2.0x06 \-     MATERIAL_BACK_SHININESS_F
2.0x04 2.0x07 2.0x05 LIGHT_0_SPOT_CUTOFF_1
2.0x05 2.0x08 2.0x06 LIGHT_1_SPOT_CUTOFF_1
2.0x06 2.0x09 2.0x07 LIGHT_2_SPOT_CUTOFF_1
2.0x07 2.0x0a 2.0x08 LIGHT_3_SPOT_CUTOFF_1
2.0x08 2.0x0b 2.0x09 LIGHT_4_SPOT_CUTOFF_1
2.0x09 2.0x0c 2.0x0a LIGHT_5_SPOT_CUTOFF_1
2.0x0a 2.0x0d 2.0x0b LIGHT_6_SPOT_CUTOFF_1
2.0x0b 2.0x0e 2.0x0c LIGHT_7_SPOT_CUTOFF_1
3.0x00 \-     \-     [const 0.0]
\-     3.0x00 3.0x00 ???
3.0x01 3.0x01 \-     POINT_PARAMS_D
3.0x02 3.0x02 3.0x01 MATERIAL_SHININESS_C
\-     3.0x03 3.0x02 MATERIAL_BACK_SHININESS_C
\-     \-     3.0x03 MATERIAL_SHININESS_F
\-     \-     3.0x04 MATERIAL_BACK_SHININESS_F
3.0x03 3.0x04 3.0x05 LIGHT_0_SPOT_CUTOFF_2
3.0x04 3.0x05 3.0x06 LIGHT_1_SPOT_CUTOFF_2
3.0x05 3.0x06 3.0x07 LIGHT_2_SPOT_CUTOFF_2
3.0x06 3.0x07 3.0x08 LIGHT_3_SPOT_CUTOFF_2
3.0x07 3.0x08 3.0x09 LIGHT_4_SPOT_CUTOFF_2
3.0x08 3.0x09 3.0x0a LIGHT_5_SPOT_CUTOFF_2
3.0x09 3.0x0a 3.0x0b LIGHT_6_SPOT_CUTOFF_2
3.0x0a 3.0x0b 3.0x0c LIGHT_7_SPOT_CUTOFF_2
3.0x0b 3.0x0c 3.0x0d MATERIAL_FACTOR_A
\-     3.0x0d 3.0x0e MATERIAL_FACTOR_BACK_A
====== ====== ====== ====================


Context setting methods
=======================

.. todo:: write me
