mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Merge pull request #2937 from lioncash/enums
VideoCommon: Convert some defines into enums
This commit is contained in:
commit
66e9395d5d
@ -11,154 +11,239 @@
|
|||||||
|
|
||||||
#pragma pack(4)
|
#pragma pack(4)
|
||||||
|
|
||||||
#define BPMEM_GENMODE 0x00
|
enum
|
||||||
#define BPMEM_DISPLAYCOPYFILTER 0x01 // 0x01 + 4
|
{
|
||||||
#define BPMEM_IND_MTXA 0x06 // 0x06 + (3 * 3)
|
BPMEM_GENMODE = 0x00,
|
||||||
#define BPMEM_IND_MTXB 0x07 // 0x07 + (3 * 3)
|
BPMEM_DISPLAYCOPYFILTER = 0x01, // 0x01 + 4
|
||||||
#define BPMEM_IND_MTXC 0x08 // 0x08 + (3 * 3)
|
BPMEM_IND_MTXA = 0x06, // 0x06 + (3 * 3)
|
||||||
#define BPMEM_IND_IMASK 0x0F
|
BPMEM_IND_MTXB = 0x07, // 0x07 + (3 * 3)
|
||||||
#define BPMEM_IND_CMD 0x10 // 0x10 + 16
|
BPMEM_IND_MTXC = 0x08, // 0x08 + (3 * 3)
|
||||||
#define BPMEM_SCISSORTL 0x20
|
BPMEM_IND_IMASK = 0x0F,
|
||||||
#define BPMEM_SCISSORBR 0x21
|
BPMEM_IND_CMD = 0x10, // 0x10 + 16
|
||||||
#define BPMEM_LINEPTWIDTH 0x22
|
BPMEM_SCISSORTL = 0x20,
|
||||||
#define BPMEM_PERF0_TRI 0x23
|
BPMEM_SCISSORBR = 0x21,
|
||||||
#define BPMEM_PERF0_QUAD 0x24
|
BPMEM_LINEPTWIDTH = 0x22,
|
||||||
#define BPMEM_RAS1_SS0 0x25
|
BPMEM_PERF0_TRI = 0x23,
|
||||||
#define BPMEM_RAS1_SS1 0x26
|
BPMEM_PERF0_QUAD = 0x24,
|
||||||
#define BPMEM_IREF 0x27
|
BPMEM_RAS1_SS0 = 0x25,
|
||||||
#define BPMEM_TREF 0x28 // 0x28 + 8
|
BPMEM_RAS1_SS1 = 0x26,
|
||||||
#define BPMEM_SU_SSIZE 0x30 // 0x30 + (2 * 8)
|
BPMEM_IREF = 0x27,
|
||||||
#define BPMEM_SU_TSIZE 0x31 // 0x31 + (2 * 8)
|
BPMEM_TREF = 0x28, // 0x28 + 8
|
||||||
#define BPMEM_ZMODE 0x40
|
BPMEM_SU_SSIZE = 0x30, // 0x30 + (2 * 8)
|
||||||
#define BPMEM_BLENDMODE 0x41
|
BPMEM_SU_TSIZE = 0x31, // 0x31 + (2 * 8)
|
||||||
#define BPMEM_CONSTANTALPHA 0x42
|
BPMEM_ZMODE = 0x40,
|
||||||
#define BPMEM_ZCOMPARE 0x43
|
BPMEM_BLENDMODE = 0x41,
|
||||||
#define BPMEM_FIELDMASK 0x44
|
BPMEM_CONSTANTALPHA = 0x42,
|
||||||
#define BPMEM_SETDRAWDONE 0x45
|
BPMEM_ZCOMPARE = 0x43,
|
||||||
#define BPMEM_BUSCLOCK0 0x46
|
BPMEM_FIELDMASK = 0x44,
|
||||||
#define BPMEM_PE_TOKEN_ID 0x47
|
BPMEM_SETDRAWDONE = 0x45,
|
||||||
#define BPMEM_PE_TOKEN_INT_ID 0x48
|
BPMEM_BUSCLOCK0 = 0x46,
|
||||||
#define BPMEM_EFB_TL 0x49
|
BPMEM_PE_TOKEN_ID = 0x47,
|
||||||
#define BPMEM_EFB_BR 0x4A
|
BPMEM_PE_TOKEN_INT_ID = 0x48,
|
||||||
#define BPMEM_EFB_ADDR 0x4B
|
BPMEM_EFB_TL = 0x49,
|
||||||
#define BPMEM_MIPMAP_STRIDE 0x4D
|
BPMEM_EFB_BR = 0x4A,
|
||||||
#define BPMEM_COPYYSCALE 0x4E
|
BPMEM_EFB_ADDR = 0x4B,
|
||||||
#define BPMEM_CLEAR_AR 0x4F
|
BPMEM_MIPMAP_STRIDE = 0x4D,
|
||||||
#define BPMEM_CLEAR_GB 0x50
|
BPMEM_COPYYSCALE = 0x4E,
|
||||||
#define BPMEM_CLEAR_Z 0x51
|
BPMEM_CLEAR_AR = 0x4F,
|
||||||
#define BPMEM_TRIGGER_EFB_COPY 0x52
|
BPMEM_CLEAR_GB = 0x50,
|
||||||
#define BPMEM_COPYFILTER0 0x53
|
BPMEM_CLEAR_Z = 0x51,
|
||||||
#define BPMEM_COPYFILTER1 0x54
|
BPMEM_TRIGGER_EFB_COPY = 0x52,
|
||||||
#define BPMEM_CLEARBBOX1 0x55
|
BPMEM_COPYFILTER0 = 0x53,
|
||||||
#define BPMEM_CLEARBBOX2 0x56
|
BPMEM_COPYFILTER1 = 0x54,
|
||||||
#define BPMEM_CLEAR_PIXEL_PERF 0x57
|
BPMEM_CLEARBBOX1 = 0x55,
|
||||||
#define BPMEM_REVBITS 0x58
|
BPMEM_CLEARBBOX2 = 0x56,
|
||||||
#define BPMEM_SCISSOROFFSET 0x59
|
BPMEM_CLEAR_PIXEL_PERF = 0x57,
|
||||||
#define BPMEM_PRELOAD_ADDR 0x60
|
BPMEM_REVBITS = 0x58,
|
||||||
#define BPMEM_PRELOAD_TMEMEVEN 0x61
|
BPMEM_SCISSOROFFSET = 0x59,
|
||||||
#define BPMEM_PRELOAD_TMEMODD 0x62
|
BPMEM_PRELOAD_ADDR = 0x60,
|
||||||
#define BPMEM_PRELOAD_MODE 0x63
|
BPMEM_PRELOAD_TMEMEVEN = 0x61,
|
||||||
#define BPMEM_LOADTLUT0 0x64
|
BPMEM_PRELOAD_TMEMODD = 0x62,
|
||||||
#define BPMEM_LOADTLUT1 0x65
|
BPMEM_PRELOAD_MODE = 0x63,
|
||||||
#define BPMEM_TEXINVALIDATE 0x66
|
BPMEM_LOADTLUT0 = 0x64,
|
||||||
#define BPMEM_PERF1 0x67
|
BPMEM_LOADTLUT1 = 0x65,
|
||||||
#define BPMEM_FIELDMODE 0x68
|
BPMEM_TEXINVALIDATE = 0x66,
|
||||||
#define BPMEM_BUSCLOCK1 0x69
|
BPMEM_PERF1 = 0x67,
|
||||||
#define BPMEM_TX_SETMODE0 0x80 // 0x80 + 4
|
BPMEM_FIELDMODE = 0x68,
|
||||||
#define BPMEM_TX_SETMODE1 0x84 // 0x84 + 4
|
BPMEM_BUSCLOCK1 = 0x69,
|
||||||
#define BPMEM_TX_SETIMAGE0 0x88 // 0x88 + 4
|
BPMEM_TX_SETMODE0 = 0x80, // 0x80 + 4
|
||||||
#define BPMEM_TX_SETIMAGE1 0x8C // 0x8C + 4
|
BPMEM_TX_SETMODE1 = 0x84, // 0x84 + 4
|
||||||
#define BPMEM_TX_SETIMAGE2 0x90 // 0x90 + 4
|
BPMEM_TX_SETIMAGE0 = 0x88, // 0x88 + 4
|
||||||
#define BPMEM_TX_SETIMAGE3 0x94 // 0x94 + 4
|
BPMEM_TX_SETIMAGE1 = 0x8C, // 0x8C + 4
|
||||||
#define BPMEM_TX_SETTLUT 0x98 // 0x98 + 4
|
BPMEM_TX_SETIMAGE2 = 0x90, // 0x90 + 4
|
||||||
#define BPMEM_TX_SETMODE0_4 0xA0 // 0xA0 + 4
|
BPMEM_TX_SETIMAGE3 = 0x94, // 0x94 + 4
|
||||||
#define BPMEM_TX_SETMODE1_4 0xA4 // 0xA4 + 4
|
BPMEM_TX_SETTLUT = 0x98, // 0x98 + 4
|
||||||
#define BPMEM_TX_SETIMAGE0_4 0xA8 // 0xA8 + 4
|
BPMEM_TX_SETMODE0_4 = 0xA0, // 0xA0 + 4
|
||||||
#define BPMEM_TX_SETIMAGE1_4 0xAC // 0xA4 + 4
|
BPMEM_TX_SETMODE1_4 = 0xA4, // 0xA4 + 4
|
||||||
#define BPMEM_TX_SETIMAGE2_4 0xB0 // 0xB0 + 4
|
BPMEM_TX_SETIMAGE0_4 = 0xA8, // 0xA8 + 4
|
||||||
#define BPMEM_TX_SETIMAGE3_4 0xB4 // 0xB4 + 4
|
BPMEM_TX_SETIMAGE1_4 = 0xAC, // 0xA4 + 4
|
||||||
#define BPMEM_TX_SETTLUT_4 0xB8 // 0xB8 + 4
|
BPMEM_TX_SETIMAGE2_4 = 0xB0, // 0xB0 + 4
|
||||||
#define BPMEM_TEV_COLOR_ENV 0xC0 // 0xC0 + (2 * 16)
|
BPMEM_TX_SETIMAGE3_4 = 0xB4, // 0xB4 + 4
|
||||||
#define BPMEM_TEV_ALPHA_ENV 0xC1 // 0xC1 + (2 * 16)
|
BPMEM_TX_SETTLUT_4 = 0xB8, // 0xB8 + 4
|
||||||
#define BPMEM_TEV_COLOR_RA 0xE0 // 0xE0 + (2 * 4)
|
BPMEM_TEV_COLOR_ENV = 0xC0, // 0xC0 + (2 * 16)
|
||||||
#define BPMEM_TEV_COLOR_BG 0xE1 // 0xE1 + (2 * 4)
|
BPMEM_TEV_ALPHA_ENV = 0xC1, // 0xC1 + (2 * 16)
|
||||||
#define BPMEM_FOGRANGE 0xE8 // 0xE8 + 6
|
BPMEM_TEV_COLOR_RA = 0xE0, // 0xE0 + (2 * 4)
|
||||||
#define BPMEM_FOGPARAM0 0xEE
|
BPMEM_TEV_COLOR_BG = 0xE1, // 0xE1 + (2 * 4)
|
||||||
#define BPMEM_FOGBMAGNITUDE 0xEF
|
BPMEM_FOGRANGE = 0xE8, // 0xE8 + 6
|
||||||
#define BPMEM_FOGBEXPONENT 0xF0
|
BPMEM_FOGPARAM0 = 0xEE,
|
||||||
#define BPMEM_FOGPARAM3 0xF1
|
BPMEM_FOGBMAGNITUDE = 0xEF,
|
||||||
#define BPMEM_FOGCOLOR 0xF2
|
BPMEM_FOGBEXPONENT = 0xF0,
|
||||||
#define BPMEM_ALPHACOMPARE 0xF3
|
BPMEM_FOGPARAM3 = 0xF1,
|
||||||
#define BPMEM_BIAS 0xF4
|
BPMEM_FOGCOLOR = 0xF2,
|
||||||
#define BPMEM_ZTEX2 0xF5
|
BPMEM_ALPHACOMPARE = 0xF3,
|
||||||
#define BPMEM_TEV_KSEL 0xF6 // 0xF6 + 8
|
BPMEM_BIAS = 0xF4,
|
||||||
#define BPMEM_BP_MASK 0xFE
|
BPMEM_ZTEX2 = 0xF5,
|
||||||
|
BPMEM_TEV_KSEL = 0xF6, // 0xF6 + 8
|
||||||
|
BPMEM_BP_MASK = 0xFE,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Tev/combiner things
|
// Tev/combiner things
|
||||||
|
|
||||||
#define TEVSCALE_1 0
|
// TEV scaling type
|
||||||
#define TEVSCALE_2 1
|
enum : u32
|
||||||
#define TEVSCALE_4 2
|
{
|
||||||
#define TEVDIVIDE_2 3
|
TEVSCALE_1 = 0,
|
||||||
|
TEVSCALE_2 = 1,
|
||||||
|
TEVSCALE_4 = 2,
|
||||||
|
TEVDIVIDE_2 = 3
|
||||||
|
};
|
||||||
|
|
||||||
#define TEVCMP_R8 0
|
enum : u32
|
||||||
#define TEVCMP_GR16 1
|
{
|
||||||
#define TEVCMP_BGR24 2
|
TEVCMP_R8 = 0,
|
||||||
#define TEVCMP_RGB8 3
|
TEVCMP_GR16 = 1,
|
||||||
|
TEVCMP_BGR24 = 2,
|
||||||
|
TEVCMP_RGB8 = 3
|
||||||
|
};
|
||||||
|
|
||||||
#define TEVOP_ADD 0
|
// TEV combiner operator
|
||||||
#define TEVOP_SUB 1
|
enum : u32
|
||||||
#define TEVCMP_R8_GT 8
|
{
|
||||||
#define TEVCMP_R8_EQ 9
|
TEVOP_ADD = 0,
|
||||||
#define TEVCMP_GR16_GT 10
|
TEVOP_SUB = 1,
|
||||||
#define TEVCMP_GR16_EQ 11
|
TEVCMP_R8_GT = 8,
|
||||||
#define TEVCMP_BGR24_GT 12
|
TEVCMP_R8_EQ = 9,
|
||||||
#define TEVCMP_BGR24_EQ 13
|
TEVCMP_GR16_GT = 10,
|
||||||
#define TEVCMP_RGB8_GT 14
|
TEVCMP_GR16_EQ = 11,
|
||||||
#define TEVCMP_RGB8_EQ 15
|
TEVCMP_BGR24_GT = 12,
|
||||||
#define TEVCMP_A8_GT 14
|
TEVCMP_BGR24_EQ = 13,
|
||||||
#define TEVCMP_A8_EQ 15
|
TEVCMP_RGB8_GT = 14,
|
||||||
|
TEVCMP_RGB8_EQ = 15,
|
||||||
|
TEVCMP_A8_GT = TEVCMP_RGB8_GT,
|
||||||
|
TEVCMP_A8_EQ = TEVCMP_RGB8_EQ
|
||||||
|
};
|
||||||
|
|
||||||
#define TEVCOLORARG_CPREV 0
|
// TEV color combiner input
|
||||||
#define TEVCOLORARG_APREV 1
|
enum : u32
|
||||||
#define TEVCOLORARG_C0 2
|
{
|
||||||
#define TEVCOLORARG_A0 3
|
TEVCOLORARG_CPREV = 0,
|
||||||
#define TEVCOLORARG_C1 4
|
TEVCOLORARG_APREV = 1,
|
||||||
#define TEVCOLORARG_A1 5
|
TEVCOLORARG_C0 = 2,
|
||||||
#define TEVCOLORARG_C2 6
|
TEVCOLORARG_A0 = 3,
|
||||||
#define TEVCOLORARG_A2 7
|
TEVCOLORARG_C1 = 4,
|
||||||
#define TEVCOLORARG_TEXC 8
|
TEVCOLORARG_A1 = 5,
|
||||||
#define TEVCOLORARG_TEXA 9
|
TEVCOLORARG_C2 = 6,
|
||||||
#define TEVCOLORARG_RASC 10
|
TEVCOLORARG_A2 = 7,
|
||||||
#define TEVCOLORARG_RASA 11
|
TEVCOLORARG_TEXC = 8,
|
||||||
#define TEVCOLORARG_ONE 12
|
TEVCOLORARG_TEXA = 9,
|
||||||
#define TEVCOLORARG_HALF 13
|
TEVCOLORARG_RASC = 10,
|
||||||
#define TEVCOLORARG_KONST 14
|
TEVCOLORARG_RASA = 11,
|
||||||
#define TEVCOLORARG_ZERO 15
|
TEVCOLORARG_ONE = 12,
|
||||||
|
TEVCOLORARG_HALF = 13,
|
||||||
|
TEVCOLORARG_KONST = 14,
|
||||||
|
TEVCOLORARG_ZERO = 15
|
||||||
|
};
|
||||||
|
|
||||||
#define TEVALPHAARG_APREV 0
|
// TEV alpha combiner input
|
||||||
#define TEVALPHAARG_A0 1
|
enum : u32
|
||||||
#define TEVALPHAARG_A1 2
|
{
|
||||||
#define TEVALPHAARG_A2 3
|
TEVALPHAARG_APREV = 0,
|
||||||
#define TEVALPHAARG_TEXA 4
|
TEVALPHAARG_A0 = 1,
|
||||||
#define TEVALPHAARG_RASA 5
|
TEVALPHAARG_A1 = 2,
|
||||||
#define TEVALPHAARG_KONST 6
|
TEVALPHAARG_A2 = 3,
|
||||||
#define TEVALPHAARG_ZERO 7
|
TEVALPHAARG_TEXA = 4,
|
||||||
|
TEVALPHAARG_RASA = 5,
|
||||||
|
TEVALPHAARG_KONST = 6,
|
||||||
|
TEVALPHAARG_ZERO = 7
|
||||||
|
};
|
||||||
|
|
||||||
#define GX_TEVPREV 0
|
// TEV output registers
|
||||||
#define GX_TEVREG0 1
|
enum : u32
|
||||||
#define GX_TEVREG1 2
|
{
|
||||||
#define GX_TEVREG2 3
|
GX_TEVPREV = 0,
|
||||||
|
GX_TEVREG0 = 1,
|
||||||
|
GX_TEVREG1 = 2,
|
||||||
|
GX_TEVREG2 = 3
|
||||||
|
};
|
||||||
|
|
||||||
#define ZTEXTURE_DISABLE 0
|
// Z-texture formats
|
||||||
#define ZTEXTURE_ADD 1
|
enum : u32
|
||||||
#define ZTEXTURE_REPLACE 2
|
{
|
||||||
|
TEV_ZTEX_TYPE_U8 = 0,
|
||||||
|
TEV_ZTEX_TYPE_U16 = 1,
|
||||||
|
TEV_ZTEX_TYPE_U24 = 2
|
||||||
|
};
|
||||||
|
|
||||||
#define TevBias_ZERO 0
|
// Z texture operator
|
||||||
#define TevBias_ADDHALF 1
|
enum : u32
|
||||||
#define TevBias_SUBHALF 2
|
{
|
||||||
#define TevBias_COMPARE 3
|
ZTEXTURE_DISABLE = 0,
|
||||||
|
ZTEXTURE_ADD = 1,
|
||||||
|
ZTEXTURE_REPLACE = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
// TEV bias value
|
||||||
|
enum : u32
|
||||||
|
{
|
||||||
|
TEVBIAS_ZERO = 0,
|
||||||
|
TEVBIAS_ADDHALF = 1,
|
||||||
|
TEVBIAS_SUBHALF = 2,
|
||||||
|
TEVBIAS_COMPARE = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
// Indirect texture format
|
||||||
|
enum : u32
|
||||||
|
{
|
||||||
|
ITF_8 = 0,
|
||||||
|
ITF_5 = 1,
|
||||||
|
ITF_4 = 2,
|
||||||
|
ITF_3 = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
// Indirect texture bias
|
||||||
|
enum : u32
|
||||||
|
{
|
||||||
|
ITB_NONE = 0,
|
||||||
|
ITB_S = 1,
|
||||||
|
ITB_T = 2,
|
||||||
|
ITB_ST = 3,
|
||||||
|
ITB_U = 4,
|
||||||
|
ITB_SU = 5,
|
||||||
|
ITB_TU = 6,
|
||||||
|
ITB_STU = 7
|
||||||
|
};
|
||||||
|
|
||||||
|
// Indirect texture bump alpha
|
||||||
|
enum : u32
|
||||||
|
{
|
||||||
|
ITBA_OFF = 0,
|
||||||
|
ITBA_S = 1,
|
||||||
|
ITBA_T = 2,
|
||||||
|
ITBA_U = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
// Indirect texture wrap value
|
||||||
|
enum : u32
|
||||||
|
{
|
||||||
|
ITW_OFF = 0,
|
||||||
|
ITW_256 = 1,
|
||||||
|
ITW_128 = 2,
|
||||||
|
ITW_64 = 3,
|
||||||
|
ITW_32 = 4,
|
||||||
|
ITW_16 = 5,
|
||||||
|
ITW_0 = 6
|
||||||
|
};
|
||||||
|
|
||||||
union IND_MTXA
|
union IND_MTXA
|
||||||
{
|
{
|
||||||
@ -213,32 +298,6 @@ union IND_IMASK
|
|||||||
u32 hex;
|
u32 hex;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TEVSELCC_CPREV 0
|
|
||||||
#define TEVSELCC_APREV 1
|
|
||||||
#define TEVSELCC_C0 2
|
|
||||||
#define TEVSELCC_A0 3
|
|
||||||
#define TEVSELCC_C1 4
|
|
||||||
#define TEVSELCC_A1 5
|
|
||||||
#define TEVSELCC_C2 6
|
|
||||||
#define TEVSELCC_A2 7
|
|
||||||
#define TEVSELCC_TEXC 8
|
|
||||||
#define TEVSELCC_TEXA 9
|
|
||||||
#define TEVSELCC_RASC 10
|
|
||||||
#define TEVSELCC_RASA 11
|
|
||||||
#define TEVSELCC_ONE 12
|
|
||||||
#define TEVSELCC_HALF 13
|
|
||||||
#define TEVSELCC_KONST 14
|
|
||||||
#define TEVSELCC_ZERO 15
|
|
||||||
|
|
||||||
#define TEVSELCA_APREV 0
|
|
||||||
#define TEVSELCA_A0 1
|
|
||||||
#define TEVSELCA_A1 2
|
|
||||||
#define TEVSELCA_A2 3
|
|
||||||
#define TEVSELCA_TEXA 4
|
|
||||||
#define TEVSELCA_RASA 5
|
|
||||||
#define TEVSELCA_KONST 6
|
|
||||||
#define TEVSELCA_ZERO 7
|
|
||||||
|
|
||||||
struct TevStageCombiner
|
struct TevStageCombiner
|
||||||
{
|
{
|
||||||
union ColorCombiner
|
union ColorCombiner
|
||||||
@ -285,33 +344,6 @@ struct TevStageCombiner
|
|||||||
AlphaCombiner alphaC;
|
AlphaCombiner alphaC;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ITF_8 0
|
|
||||||
#define ITF_5 1
|
|
||||||
#define ITF_4 2
|
|
||||||
#define ITF_3 3
|
|
||||||
|
|
||||||
#define ITB_NONE 0
|
|
||||||
#define ITB_S 1
|
|
||||||
#define ITB_T 2
|
|
||||||
#define ITB_ST 3
|
|
||||||
#define ITB_U 4
|
|
||||||
#define ITB_SU 5
|
|
||||||
#define ITB_TU 6
|
|
||||||
#define ITB_STU 7
|
|
||||||
|
|
||||||
#define ITBA_OFF 0
|
|
||||||
#define ITBA_S 1
|
|
||||||
#define ITBA_T 2
|
|
||||||
#define ITBA_U 3
|
|
||||||
|
|
||||||
#define ITW_OFF 0
|
|
||||||
#define ITW_256 1
|
|
||||||
#define ITW_128 2
|
|
||||||
#define ITW_64 3
|
|
||||||
#define ITW_32 4
|
|
||||||
#define ITW_16 5
|
|
||||||
#define ITW_0 6
|
|
||||||
|
|
||||||
// several discoveries:
|
// several discoveries:
|
||||||
// GXSetTevIndBumpST(tevstage, indstage, matrixind)
|
// GXSetTevIndBumpST(tevstage, indstage, matrixind)
|
||||||
// if ( matrix == 2 ) realmat = 6; // 10
|
// if ( matrix == 2 ) realmat = 6; // 10
|
||||||
@ -513,16 +545,6 @@ union ZTex2
|
|||||||
u32 hex;
|
u32 hex;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Z-texture types (formats)
|
|
||||||
#define TEV_ZTEX_TYPE_U8 0
|
|
||||||
#define TEV_ZTEX_TYPE_U16 1
|
|
||||||
#define TEV_ZTEX_TYPE_U24 2
|
|
||||||
|
|
||||||
#define TEV_ZTEX_DISABLE 0
|
|
||||||
#define TEV_ZTEX_ADD 1
|
|
||||||
#define TEV_ZTEX_REPLACE 2
|
|
||||||
|
|
||||||
|
|
||||||
struct FourTexUnits
|
struct FourTexUnits
|
||||||
{
|
{
|
||||||
TexMode0 texMode0[4];
|
TexMode0 texMode0[4];
|
||||||
|
@ -18,6 +18,24 @@
|
|||||||
#include "VideoCommon/VideoConfig.h"
|
#include "VideoCommon/VideoConfig.h"
|
||||||
#include "VideoCommon/XFMemory.h" // for texture projection mode
|
#include "VideoCommon/XFMemory.h" // for texture projection mode
|
||||||
|
|
||||||
|
// TODO: Get rid of these
|
||||||
|
enum : u32
|
||||||
|
{
|
||||||
|
C_COLORMATRIX = 0, // 0
|
||||||
|
C_COLORS = 0, // 0
|
||||||
|
C_KCOLORS = C_COLORS + 4, // 4
|
||||||
|
C_ALPHA = C_KCOLORS + 4, // 8
|
||||||
|
C_TEXDIMS = C_ALPHA + 1, // 9
|
||||||
|
C_ZBIAS = C_TEXDIMS + 8, // 17
|
||||||
|
C_INDTEXSCALE = C_ZBIAS + 2, // 19
|
||||||
|
C_INDTEXMTX = C_INDTEXSCALE + 2, // 21
|
||||||
|
C_FOGCOLOR = C_INDTEXMTX + 6, // 27
|
||||||
|
C_FOGI = C_FOGCOLOR + 1, // 28
|
||||||
|
C_FOGF = C_FOGI + 1, // 29
|
||||||
|
C_ZSLOPE = C_FOGF + 2, // 31
|
||||||
|
C_EFBSCALE = C_ZSLOPE + 1, // 32
|
||||||
|
C_PENVCONST_END = C_EFBSCALE + 1
|
||||||
|
};
|
||||||
|
|
||||||
static const char *tevKSelTableC[] =
|
static const char *tevKSelTableC[] =
|
||||||
{
|
{
|
||||||
@ -931,7 +949,7 @@ static inline void WriteStage(T& out, pixel_shader_uid_data* uid_data, int n, AP
|
|||||||
|
|
||||||
out.Write("\t// color combine\n");
|
out.Write("\t// color combine\n");
|
||||||
out.Write("\t%s = clamp(", tevCOutputTable[cc.dest]);
|
out.Write("\t%s = clamp(", tevCOutputTable[cc.dest]);
|
||||||
if (cc.bias != TevBias_COMPARE)
|
if (cc.bias != TEVBIAS_COMPARE)
|
||||||
{
|
{
|
||||||
WriteTevRegular(out, "rgb", cc.bias, cc.op, cc.clamp, cc.shift);
|
WriteTevRegular(out, "rgb", cc.bias, cc.op, cc.clamp, cc.shift);
|
||||||
}
|
}
|
||||||
@ -961,7 +979,7 @@ static inline void WriteStage(T& out, pixel_shader_uid_data* uid_data, int n, AP
|
|||||||
|
|
||||||
out.Write("\t// alpha combine\n");
|
out.Write("\t// alpha combine\n");
|
||||||
out.Write("\t%s = clamp(", tevAOutputTable[ac.dest]);
|
out.Write("\t%s = clamp(", tevAOutputTable[ac.dest]);
|
||||||
if (ac.bias != TevBias_COMPARE)
|
if (ac.bias != TEVBIAS_COMPARE)
|
||||||
{
|
{
|
||||||
WriteTevRegular(out, "a", ac.bias, ac.op, ac.clamp, ac.shift);
|
WriteTevRegular(out, "a", ac.bias, ac.op, ac.clamp, ac.shift);
|
||||||
}
|
}
|
||||||
@ -1082,14 +1100,14 @@ static inline void SampleTexture(T& out, const char *texcoords, const char *texs
|
|||||||
|
|
||||||
static const char *tevAlphaFuncsTable[] =
|
static const char *tevAlphaFuncsTable[] =
|
||||||
{
|
{
|
||||||
"(false)", // NEVER
|
"(false)", // NEVER
|
||||||
"(prev.a < %s)", // LESS
|
"(prev.a < %s)", // LESS
|
||||||
"(prev.a == %s)", // EQUAL
|
"(prev.a == %s)", // EQUAL
|
||||||
"(prev.a <= %s)", // LEQUAL
|
"(prev.a <= %s)", // LEQUAL
|
||||||
"(prev.a > %s)", // GREATER
|
"(prev.a > %s)", // GREATER
|
||||||
"(prev.a != %s)", // NEQUAL
|
"(prev.a != %s)", // NEQUAL
|
||||||
"(prev.a >= %s)", // GEQUAL
|
"(prev.a >= %s)", // GEQUAL
|
||||||
"(true)" // ALWAYS
|
"(true)" // ALWAYS
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *tevAlphaFunclogicTable[] =
|
static const char *tevAlphaFunclogicTable[] =
|
||||||
|
@ -9,23 +9,6 @@
|
|||||||
#include "VideoCommon/ShaderGenCommon.h"
|
#include "VideoCommon/ShaderGenCommon.h"
|
||||||
#include "VideoCommon/VideoCommon.h"
|
#include "VideoCommon/VideoCommon.h"
|
||||||
|
|
||||||
// TODO: get rid of them as they aren't used
|
|
||||||
#define C_COLORMATRIX 0 // 0
|
|
||||||
#define C_COLORS 0 // 0
|
|
||||||
#define C_KCOLORS (C_COLORS + 4) // 4
|
|
||||||
#define C_ALPHA (C_KCOLORS + 4) // 8
|
|
||||||
#define C_TEXDIMS (C_ALPHA + 1) // 9
|
|
||||||
#define C_ZBIAS (C_TEXDIMS + 8) //17
|
|
||||||
#define C_INDTEXSCALE (C_ZBIAS + 2) //19
|
|
||||||
#define C_INDTEXMTX (C_INDTEXSCALE + 2) //21
|
|
||||||
#define C_FOGCOLOR (C_INDTEXMTX + 6) //27
|
|
||||||
#define C_FOGI (C_FOGCOLOR + 1) //28
|
|
||||||
#define C_FOGF (C_FOGI + 1) //29
|
|
||||||
#define C_ZSLOPE (C_FOGF + 2) //31
|
|
||||||
#define C_EFBSCALE (C_ZSLOPE + 1) //32
|
|
||||||
|
|
||||||
#define C_PENVCONST_END (C_EFBSCALE + 1)
|
|
||||||
|
|
||||||
// Different ways to achieve rendering with destination alpha
|
// Different ways to achieve rendering with destination alpha
|
||||||
enum DSTALPHA_MODE
|
enum DSTALPHA_MODE
|
||||||
{
|
{
|
||||||
|
@ -8,92 +8,126 @@
|
|||||||
#include "VideoCommon/CPMemory.h"
|
#include "VideoCommon/CPMemory.h"
|
||||||
#include "VideoCommon/DataReader.h"
|
#include "VideoCommon/DataReader.h"
|
||||||
|
|
||||||
|
|
||||||
// Lighting
|
// Lighting
|
||||||
|
|
||||||
|
// Projection
|
||||||
|
enum : u32
|
||||||
|
{
|
||||||
|
XF_TEXPROJ_ST = 0,
|
||||||
|
XF_TEXPROJ_STQ = 1
|
||||||
|
};
|
||||||
|
|
||||||
#define XF_TEXPROJ_ST 0
|
// Input form
|
||||||
#define XF_TEXPROJ_STQ 1
|
enum : u32
|
||||||
|
{
|
||||||
|
XF_TEXINPUT_AB11 = 0,
|
||||||
|
XF_TEXINPUT_ABC1 = 1
|
||||||
|
};
|
||||||
|
|
||||||
#define XF_TEXINPUT_AB11 0
|
// Texture generation type
|
||||||
#define XF_TEXINPUT_ABC1 1
|
enum : u32
|
||||||
|
{
|
||||||
|
XF_TEXGEN_REGULAR = 0,
|
||||||
|
XF_TEXGEN_EMBOSS_MAP = 1, // Used when bump mapping
|
||||||
|
XF_TEXGEN_COLOR_STRGBC0 = 2,
|
||||||
|
XF_TEXGEN_COLOR_STRGBC1 = 3
|
||||||
|
};
|
||||||
|
|
||||||
#define XF_TEXGEN_REGULAR 0
|
// Source row
|
||||||
#define XF_TEXGEN_EMBOSS_MAP 1 // used when bump mapping
|
enum : u32
|
||||||
#define XF_TEXGEN_COLOR_STRGBC0 2
|
{
|
||||||
#define XF_TEXGEN_COLOR_STRGBC1 3
|
XF_SRCGEOM_INROW = 0, // Input is abc
|
||||||
|
XF_SRCNORMAL_INROW = 1, // Input is abc
|
||||||
|
XF_SRCCOLORS_INROW = 2,
|
||||||
|
XF_SRCBINORMAL_T_INROW = 3, // Input is abc
|
||||||
|
XF_SRCBINORMAL_B_INROW = 4, // Input is abc
|
||||||
|
XF_SRCTEX0_INROW = 5,
|
||||||
|
XF_SRCTEX1_INROW = 6,
|
||||||
|
XF_SRCTEX2_INROW = 7,
|
||||||
|
XF_SRCTEX3_INROW = 8,
|
||||||
|
XF_SRCTEX4_INROW = 9,
|
||||||
|
XF_SRCTEX5_INROW = 10,
|
||||||
|
XF_SRCTEX6_INROW = 11,
|
||||||
|
XF_SRCTEX7_INROW = 12
|
||||||
|
};
|
||||||
|
|
||||||
#define XF_SRCGEOM_INROW 0 // input is abc
|
// Control source
|
||||||
#define XF_SRCNORMAL_INROW 1 // input is abc
|
enum : u32
|
||||||
#define XF_SRCCOLORS_INROW 2
|
{
|
||||||
#define XF_SRCBINORMAL_T_INROW 3 // input is abc
|
GX_SRC_REG = 0,
|
||||||
#define XF_SRCBINORMAL_B_INROW 4 // input is abc
|
GX_SRC_VTX = 1
|
||||||
#define XF_SRCTEX0_INROW 5
|
};
|
||||||
#define XF_SRCTEX1_INROW 6
|
|
||||||
#define XF_SRCTEX2_INROW 7
|
|
||||||
#define XF_SRCTEX3_INROW 8
|
|
||||||
#define XF_SRCTEX4_INROW 9
|
|
||||||
#define XF_SRCTEX5_INROW 10
|
|
||||||
#define XF_SRCTEX6_INROW 11
|
|
||||||
#define XF_SRCTEX7_INROW 12
|
|
||||||
|
|
||||||
#define GX_SRC_REG 0
|
// Light diffuse attenuation function
|
||||||
#define GX_SRC_VTX 1
|
enum : u32
|
||||||
|
{
|
||||||
|
LIGHTDIF_NONE = 0,
|
||||||
|
LIGHTDIF_SIGN = 1,
|
||||||
|
LIGHTDIF_CLAMP = 2
|
||||||
|
};
|
||||||
|
|
||||||
#define LIGHTDIF_NONE 0
|
// Light attenuation function
|
||||||
#define LIGHTDIF_SIGN 1
|
enum : u32
|
||||||
#define LIGHTDIF_CLAMP 2
|
{
|
||||||
|
LIGHTATTN_NONE = 0, // No attenuation
|
||||||
|
LIGHTATTN_SPEC = 1, // Point light attenuation
|
||||||
|
LIGHTATTN_DIR = 2, // Directional light attenuation
|
||||||
|
LIGHTATTN_SPOT = 3 // Spot light attenuation
|
||||||
|
};
|
||||||
|
|
||||||
#define LIGHTATTN_NONE 0 // no attenuation
|
// Projection type
|
||||||
#define LIGHTATTN_SPEC 1 // point light attenuation
|
enum : u32
|
||||||
#define LIGHTATTN_DIR 2 // directional light attenuation
|
{
|
||||||
#define LIGHTATTN_SPOT 3 // spot light attenuation
|
GX_PERSPECTIVE = 0,
|
||||||
|
GX_ORTHOGRAPHIC = 1
|
||||||
|
};
|
||||||
|
|
||||||
#define GX_PERSPECTIVE 0
|
// Registers and register ranges
|
||||||
#define GX_ORTHOGRAPHIC 1
|
enum
|
||||||
|
{
|
||||||
#define XFMEM_POSMATRICES 0x000
|
XFMEM_POSMATRICES = 0x000,
|
||||||
#define XFMEM_POSMATRICES_END 0x100
|
XFMEM_POSMATRICES_END = 0x100,
|
||||||
#define XFMEM_NORMALMATRICES 0x400
|
XFMEM_NORMALMATRICES = 0x400,
|
||||||
#define XFMEM_NORMALMATRICES_END 0x460
|
XFMEM_NORMALMATRICES_END = 0x460,
|
||||||
#define XFMEM_POSTMATRICES 0x500
|
XFMEM_POSTMATRICES = 0x500,
|
||||||
#define XFMEM_POSTMATRICES_END 0x600
|
XFMEM_POSTMATRICES_END = 0x600,
|
||||||
#define XFMEM_LIGHTS 0x600
|
XFMEM_LIGHTS = 0x600,
|
||||||
#define XFMEM_LIGHTS_END 0x680
|
XFMEM_LIGHTS_END = 0x680,
|
||||||
#define XFMEM_ERROR 0x1000
|
XFMEM_ERROR = 0x1000,
|
||||||
#define XFMEM_DIAG 0x1001
|
XFMEM_DIAG = 0x1001,
|
||||||
#define XFMEM_STATE0 0x1002
|
XFMEM_STATE0 = 0x1002,
|
||||||
#define XFMEM_STATE1 0x1003
|
XFMEM_STATE1 = 0x1003,
|
||||||
#define XFMEM_CLOCK 0x1004
|
XFMEM_CLOCK = 0x1004,
|
||||||
#define XFMEM_CLIPDISABLE 0x1005
|
XFMEM_CLIPDISABLE = 0x1005,
|
||||||
#define XFMEM_SETGPMETRIC 0x1006
|
XFMEM_SETGPMETRIC = 0x1006,
|
||||||
#define XFMEM_VTXSPECS 0x1008
|
XFMEM_VTXSPECS = 0x1008,
|
||||||
#define XFMEM_SETNUMCHAN 0x1009
|
XFMEM_SETNUMCHAN = 0x1009,
|
||||||
#define XFMEM_SETCHAN0_AMBCOLOR 0x100a
|
XFMEM_SETCHAN0_AMBCOLOR = 0x100a,
|
||||||
#define XFMEM_SETCHAN1_AMBCOLOR 0x100b
|
XFMEM_SETCHAN1_AMBCOLOR = 0x100b,
|
||||||
#define XFMEM_SETCHAN0_MATCOLOR 0x100c
|
XFMEM_SETCHAN0_MATCOLOR = 0x100c,
|
||||||
#define XFMEM_SETCHAN1_MATCOLOR 0x100d
|
XFMEM_SETCHAN1_MATCOLOR = 0x100d,
|
||||||
#define XFMEM_SETCHAN0_COLOR 0x100e
|
XFMEM_SETCHAN0_COLOR = 0x100e,
|
||||||
#define XFMEM_SETCHAN1_COLOR 0x100f
|
XFMEM_SETCHAN1_COLOR = 0x100f,
|
||||||
#define XFMEM_SETCHAN0_ALPHA 0x1010
|
XFMEM_SETCHAN0_ALPHA = 0x1010,
|
||||||
#define XFMEM_SETCHAN1_ALPHA 0x1011
|
XFMEM_SETCHAN1_ALPHA = 0x1011,
|
||||||
#define XFMEM_DUALTEX 0x1012
|
XFMEM_DUALTEX = 0x1012,
|
||||||
#define XFMEM_SETMATRIXINDA 0x1018
|
XFMEM_SETMATRIXINDA = 0x1018,
|
||||||
#define XFMEM_SETMATRIXINDB 0x1019
|
XFMEM_SETMATRIXINDB = 0x1019,
|
||||||
#define XFMEM_SETVIEWPORT 0x101a
|
XFMEM_SETVIEWPORT = 0x101a,
|
||||||
#define XFMEM_SETZSCALE 0x101c
|
XFMEM_SETZSCALE = 0x101c,
|
||||||
#define XFMEM_SETZOFFSET 0x101f
|
XFMEM_SETZOFFSET = 0x101f,
|
||||||
#define XFMEM_SETPROJECTION 0x1020
|
XFMEM_SETPROJECTION = 0x1020,
|
||||||
/*#define XFMEM_SETPROJECTIONB 0x1021
|
// XFMEM_SETPROJECTIONB = 0x1021,
|
||||||
#define XFMEM_SETPROJECTIONC 0x1022
|
// XFMEM_SETPROJECTIONC = 0x1022,
|
||||||
#define XFMEM_SETPROJECTIOND 0x1023
|
// XFMEM_SETPROJECTIOND = 0x1023,
|
||||||
#define XFMEM_SETPROJECTIONE 0x1024
|
// XFMEM_SETPROJECTIONE = 0x1024,
|
||||||
#define XFMEM_SETPROJECTIONF 0x1025
|
// XFMEM_SETPROJECTIONF = 0x1025,
|
||||||
#define XFMEM_SETPROJECTIONORTHO1 0x1026
|
// XFMEM_SETPROJECTIONORTHO1 = 0x1026,
|
||||||
#define XFMEM_SETPROJECTIONORTHO2 0x1027*/
|
// XFMEM_SETPROJECTIONORTHO2 = 0x1027,
|
||||||
#define XFMEM_SETNUMTEXGENS 0x103f
|
XFMEM_SETNUMTEXGENS = 0x103f,
|
||||||
#define XFMEM_SETTEXMTXINFO 0x1040
|
XFMEM_SETTEXMTXINFO = 0x1040,
|
||||||
#define XFMEM_SETPOSMTXINFO 0x1050
|
XFMEM_SETPOSMTXINFO = 0x1050,
|
||||||
|
};
|
||||||
|
|
||||||
union LitChannel
|
union LitChannel
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user