]> Chaos Git - corbenik/ctrulib.git/commitdiff
Synchronize GPU register names with the 3dbrew Wiki, again
authorfincs <fincs.alt1@gmail.com>
Sat, 5 Dec 2015 12:27:02 +0000 (13:27 +0100)
committerfincs <fincs.alt1@gmail.com>
Sat, 5 Dec 2015 12:27:02 +0000 (13:27 +0100)
libctru/include/3ds/gpu/registers.h
libctru/source/gpu/gpu-old.c

index a17f0c25c99d5706cf3c131a5f99c8004ba24f08..3a0fe94ed5cb7afc4735e79920312fd9126faccb 100644 (file)
 \r
 ///@name Framebuffer registers (0x100-0x13F)\r
 ///@{\r
-#define GPUREG_BLEND_ENABLE 0x0100           ///< Blend toggle.\r
-#define GPUREG_BLEND_CONFIG 0x0101           ///< Blend configuration.\r
-#define GPUREG_LOGICOP_CONFIG 0x0102         ///< Logical operator configuration.\r
+#define GPUREG_COLOR_OPERATION 0x0100        ///< Configures fragment operation and blend mode.\r
+#define GPUREG_BLEND_FUNC 0x0101             ///< Blend function configuration.\r
+#define GPUREG_LOGIC_OP 0x0102               ///< Logical operator configuration.\r
 #define GPUREG_BLEND_COLOR 0x0103            ///< Blend color.\r
-#define GPUREG_ALPHATEST_CONFIG 0x0104       ///< Alpha test configuration.\r
+#define GPUREG_FRAGOP_ALPHA_TEST 0x0104      ///< Alpha test configuration.\r
 #define GPUREG_STENCIL_TEST 0x0105           ///< Stencil test configuration.\r
-#define GPUREG_STENCIL_ACTION 0x0106         ///< Stencil test action.\r
-#define GPUREG_DEPTHTEST_CONFIG 0x0107       ///< Depth test configuration.\r
+#define GPUREG_STENCIL_OP 0x0106             ///< Stencil test operation.\r
+#define GPUREG_DEPTH_COLOR_MASK 0x0107       ///< Depth test and color mask configuration.\r
 #define GPUREG_0108 0x0108                   ///< Unknown.\r
 #define GPUREG_0109 0x0109                   ///< Unknown.\r
 #define GPUREG_010A 0x010A                   ///< Unknown.\r
index 25089c3dd994f3c87df152dd793f98c923ff3925..5e8f47b0c4cd228c6058ffdb73b59586727f5538 100644 (file)
@@ -97,7 +97,7 @@ void GPU_DepthMap(float zScale, float zOffset)
 
 void GPU_SetAlphaTest(bool enable, GPU_TESTFUNC function, u8 ref)
 {
-       GPUCMD_AddWrite(GPUREG_ALPHATEST_CONFIG, (enable&1)|((function&7)<<4)|(ref<<8));
+       GPUCMD_AddWrite(GPUREG_FRAGOP_ALPHA_TEST, (enable&1)|((function&7)<<4)|(ref<<8));
 }
 
 void GPU_SetStencilTest(bool enable, GPU_TESTFUNC function, u8 ref, u8 input_mask, u8 write_mask)
@@ -107,26 +107,26 @@ void GPU_SetStencilTest(bool enable, GPU_TESTFUNC function, u8 ref, u8 input_mas
 
 void GPU_SetStencilOp(GPU_STENCILOP sfail, GPU_STENCILOP dfail, GPU_STENCILOP pass)
 {
-       GPUCMD_AddWrite(GPUREG_STENCIL_ACTION, sfail | (dfail << 4) | (pass << 8));
+       GPUCMD_AddWrite(GPUREG_STENCIL_OP, sfail | (dfail << 4) | (pass << 8));
 }
 
 void GPU_SetDepthTestAndWriteMask(bool enable, GPU_TESTFUNC function, GPU_WRITEMASK writemask)
 {
-       GPUCMD_AddWrite(GPUREG_DEPTHTEST_CONFIG, (enable&1)|((function&7)<<4)|(writemask<<8));
+       GPUCMD_AddWrite(GPUREG_DEPTH_COLOR_MASK, (enable&1)|((function&7)<<4)|(writemask<<8));
 }
 
 void GPU_SetAlphaBlending(GPU_BLENDEQUATION colorEquation, GPU_BLENDEQUATION alphaEquation,
        GPU_BLENDFACTOR colorSrc, GPU_BLENDFACTOR colorDst,
        GPU_BLENDFACTOR alphaSrc, GPU_BLENDFACTOR alphaDst)
 {
-       GPUCMD_AddWrite(GPUREG_BLEND_CONFIG, colorEquation | (alphaEquation<<8) | (colorSrc<<16) | (colorDst<<20) | (alphaSrc<<24) | (alphaDst<<28));
-       GPUCMD_AddMaskedWrite(GPUREG_BLEND_ENABLE, 0x2, 0x00000100);
+       GPUCMD_AddWrite(GPUREG_BLEND_FUNC, colorEquation | (alphaEquation<<8) | (colorSrc<<16) | (colorDst<<20) | (alphaSrc<<24) | (alphaDst<<28));
+       GPUCMD_AddMaskedWrite(GPUREG_COLOR_OPERATION, 0x2, 0x00000100);
 }
 
 void GPU_SetColorLogicOp(GPU_LOGICOP op)
 {
-       GPUCMD_AddWrite(GPUREG_LOGICOP_CONFIG, op);
-       GPUCMD_AddMaskedWrite(GPUREG_BLEND_ENABLE, 0x2, 0x00000000);
+       GPUCMD_AddWrite(GPUREG_LOGIC_OP, op);
+       GPUCMD_AddMaskedWrite(GPUREG_COLOR_OPERATION, 0x2, 0x00000000);
 }
 
 void GPU_SetBlendingColor(u8 r, u8 g, u8 b, u8 a)