From c14634f32397fb550ff2a1af95394fd713be2769 Mon Sep 17 00:00:00 2001 From: fincs Date: Sat, 5 Dec 2015 13:27:02 +0100 Subject: [PATCH] Synchronize GPU register names with the 3dbrew Wiki, again --- libctru/include/3ds/gpu/registers.h | 12 ++++++------ libctru/source/gpu/gpu-old.c | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libctru/include/3ds/gpu/registers.h b/libctru/include/3ds/gpu/registers.h index a17f0c2..3a0fe94 100644 --- a/libctru/include/3ds/gpu/registers.h +++ b/libctru/include/3ds/gpu/registers.h @@ -274,14 +274,14 @@ ///@name Framebuffer registers (0x100-0x13F) ///@{ -#define GPUREG_BLEND_ENABLE 0x0100 ///< Blend toggle. -#define GPUREG_BLEND_CONFIG 0x0101 ///< Blend configuration. -#define GPUREG_LOGICOP_CONFIG 0x0102 ///< Logical operator configuration. +#define GPUREG_COLOR_OPERATION 0x0100 ///< Configures fragment operation and blend mode. +#define GPUREG_BLEND_FUNC 0x0101 ///< Blend function configuration. +#define GPUREG_LOGIC_OP 0x0102 ///< Logical operator configuration. #define GPUREG_BLEND_COLOR 0x0103 ///< Blend color. -#define GPUREG_ALPHATEST_CONFIG 0x0104 ///< Alpha test configuration. +#define GPUREG_FRAGOP_ALPHA_TEST 0x0104 ///< Alpha test configuration. #define GPUREG_STENCIL_TEST 0x0105 ///< Stencil test configuration. -#define GPUREG_STENCIL_ACTION 0x0106 ///< Stencil test action. -#define GPUREG_DEPTHTEST_CONFIG 0x0107 ///< Depth test configuration. +#define GPUREG_STENCIL_OP 0x0106 ///< Stencil test operation. +#define GPUREG_DEPTH_COLOR_MASK 0x0107 ///< Depth test and color mask configuration. #define GPUREG_0108 0x0108 ///< Unknown. #define GPUREG_0109 0x0109 ///< Unknown. #define GPUREG_010A 0x010A ///< Unknown. diff --git a/libctru/source/gpu/gpu-old.c b/libctru/source/gpu/gpu-old.c index 25089c3..5e8f47b 100644 --- a/libctru/source/gpu/gpu-old.c +++ b/libctru/source/gpu/gpu-old.c @@ -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)