mirror of
https://github.com/holub/mame
synced 2025-04-20 23:42:22 +03:00
chihiro.cpp: "enum" -> "enum class" (nw)
This commit is contained in:
parent
85cc00aad3
commit
4a017f48c8
@ -179,6 +179,172 @@ most methods set parameters, others actually draw
|
||||
class nv2a_renderer : public poly_manager<float, nvidia_object_data, 13, 8192>
|
||||
{
|
||||
public:
|
||||
enum class VERTEX_PARAMETER {
|
||||
PARAM_COLOR_B = 0,
|
||||
PARAM_COLOR_G = 1,
|
||||
PARAM_COLOR_R = 2,
|
||||
PARAM_COLOR_A = 3,
|
||||
PARAM_TEXTURE0_U = 4,
|
||||
PARAM_TEXTURE0_V = 5,
|
||||
PARAM_TEXTURE1_U = 6,
|
||||
PARAM_TEXTURE1_V = 7,
|
||||
PARAM_TEXTURE2_U = 8,
|
||||
PARAM_TEXTURE2_V = 9,
|
||||
PARAM_TEXTURE3_U = 10,
|
||||
PARAM_TEXTURE3_V = 11,
|
||||
PARAM_Z = 12
|
||||
};
|
||||
enum class NV2A_BEGIN_END {
|
||||
STOP = 0,
|
||||
POINTS = 1,
|
||||
LINES = 2,
|
||||
LINE_LOOP = 3,
|
||||
LINE_STRIP = 4,
|
||||
TRIANGLES = 5,
|
||||
TRIANGLE_STRIP = 6,
|
||||
TRIANGLE_FAN = 7,
|
||||
QUADS = 8,
|
||||
QUAD_STRIP = 9,
|
||||
POLYGON = 10
|
||||
};
|
||||
enum class NV2A_VERTEX_ATTR {
|
||||
POS = 0,
|
||||
WEIGHT = 1,
|
||||
NORMAL = 2,
|
||||
COLOR0 = 3, // diffuse
|
||||
COLOR1 = 4, // specular
|
||||
FOG = 5,
|
||||
BACKCOLOR0 = 7, // diffuse
|
||||
BACKCOLOR1 = 8, // specular
|
||||
TEX0 = 9,
|
||||
TEX1 = 10,
|
||||
TEX2 = 11,
|
||||
TEX3 = 12
|
||||
};
|
||||
enum class NV2A_VTXBUF_TYPE {
|
||||
UBYTE2 = 0, // what is the difference with UBYTE ?
|
||||
FLOAT = 2,
|
||||
UBYTE = 4,
|
||||
USHORT = 5,
|
||||
UNKNOWN_6 = 6 // used for vertex color
|
||||
};
|
||||
enum class NV2A_TEX_FORMAT {
|
||||
L8 = 0x0,
|
||||
I8 = 0x1,
|
||||
A1R5G5B5 = 0x2,
|
||||
A4R4G4B4 = 0x4,
|
||||
R5G6B5 = 0x5,
|
||||
A8R8G8B8 = 0x6,
|
||||
X8R8G8B8 = 0x7,
|
||||
INDEX8 = 0xb,
|
||||
DXT1 = 0xc,
|
||||
DXT3 = 0xe,
|
||||
DXT5 = 0xf,
|
||||
A1R5G5B5_RECT = 0x10,
|
||||
R5G6B5_RECT = 0x11,
|
||||
A8R8G8B8_RECT = 0x12,
|
||||
L8_RECT = 0x13,
|
||||
DSDT8_RECT = 0x17,
|
||||
A8L8 = 0x1a,
|
||||
I8_RECT = 0x1b,
|
||||
A4R4G4B4_RECT = 0x1d,
|
||||
R8G8B8_RECT = 0x1e,
|
||||
A8L8_RECT = 0x20,
|
||||
Z24 = 0x2a,
|
||||
Z24_RECT = 0x2b,
|
||||
Z16 = 0x2c,
|
||||
Z16_RECT = 0x2d,
|
||||
DSDT8 = 0x28,
|
||||
HILO16 = 0x33,
|
||||
HILO16_RECT = 0x36,
|
||||
HILO8 = 0x44,
|
||||
SIGNED_HILO8 = 0x45,
|
||||
HILO8_RECT = 0x46,
|
||||
SIGNED_HILO8_RECT = 0x47
|
||||
};
|
||||
enum class NV2A_LOGIC_OP {
|
||||
CLEAR = 0x1500,
|
||||
AND = 0x1501,
|
||||
AND_REVERSE = 0x1502,
|
||||
COPY = 0x1503,
|
||||
AND_INVERTED = 0x1504,
|
||||
NOOP = 0x1505,
|
||||
XOR = 0x1506,
|
||||
OR = 0x1507,
|
||||
NOR = 0x1508,
|
||||
EQUIV = 0x1509,
|
||||
INVERT = 0x150a,
|
||||
OR_REVERSE = 0x150b,
|
||||
COPY_INVERTED = 0x150c,
|
||||
OR_INVERTED = 0x150d,
|
||||
NAND = 0x150e,
|
||||
SET = 0x150f
|
||||
};
|
||||
enum class NV2A_BLEND_EQUATION {
|
||||
FUNC_ADD = 0x8006,
|
||||
MIN = 0x8007,
|
||||
MAX = 0x8008,
|
||||
FUNC_SUBTRACT = 0x800a,
|
||||
FUNC_REVERSE_SUBTRACT = 0x80b
|
||||
};
|
||||
enum class NV2A_BLEND_FACTOR {
|
||||
ZERO = 0x0000,
|
||||
ONE = 0x0001,
|
||||
SRC_COLOR = 0x0300,
|
||||
ONE_MINUS_SRC_COLOR = 0x0301,
|
||||
SRC_ALPHA = 0x0302,
|
||||
ONE_MINUS_SRC_ALPHA = 0x0303,
|
||||
DST_ALPHA = 0x0304,
|
||||
ONE_MINUS_DST_ALPHA = 0x0305,
|
||||
DST_COLOR = 0x0306,
|
||||
ONE_MINUS_DST_COLOR = 0x0307,
|
||||
SRC_ALPHA_SATURATE = 0x0308,
|
||||
CONSTANT_COLOR = 0x8001,
|
||||
ONE_MINUS_CONSTANT_COLOR = 0x8002,
|
||||
CONSTANT_ALPHA = 0x8003,
|
||||
ONE_MINUS_CONSTANT_ALPHA = 0x8004
|
||||
};
|
||||
enum class NV2A_COMPARISON_OP {
|
||||
NEVER = 0x0200,
|
||||
LESS = 0x0201,
|
||||
EQUAL = 0x0202,
|
||||
LEQUAL = 0x0203,
|
||||
GREATER = 0x0204,
|
||||
NOTEQUAL = 0x0205,
|
||||
GEQUAL = 0x0206,
|
||||
ALWAYS = 0x0207
|
||||
};
|
||||
enum class NV2A_STENCIL_OP {
|
||||
ZEROOP = 0x0000,
|
||||
INVERTOP = 0x150a,
|
||||
KEEP = 0x1e00,
|
||||
REPLACE = 0x1e01,
|
||||
INCR = 0x1e02,
|
||||
DECR = 0x1e03,
|
||||
INCR_WRAP = 0x8507,
|
||||
DECR_WRAP = 0x8508
|
||||
};
|
||||
enum class NV2A_RT_TYPE {
|
||||
LINEAR = 1,
|
||||
SWIZZLED = 2
|
||||
};
|
||||
enum class NV2A_RT_DEPTH_FORMAT {
|
||||
Z16 = 0x0001,
|
||||
Z24S8 = 0x0002
|
||||
};
|
||||
enum class NV2A_COLOR_FORMAT {
|
||||
X1R5G5B5_Z1R5G5B5 = 1,
|
||||
X1R5G5B5_X1R5G5B5 = 2,
|
||||
R5G6B5 = 3,
|
||||
X8R8G8B8_Z8R8G8B8 = 4,
|
||||
X8R8G8B8_X8R8G8B8 = 5,
|
||||
X1A7R8G8B8_Z1A7R8G8B8 = 6,
|
||||
X1A7R8G8B8_X1A7R8G8B8 = 7,
|
||||
A8R8G8B8 = 8,
|
||||
B8 = 9,
|
||||
G8B8 = 10
|
||||
};
|
||||
|
||||
nv2a_renderer(running_machine &machine) : poly_manager<float, nvidia_object_data, 13, 8192>(machine)
|
||||
{
|
||||
memset(channel, 0, sizeof(channel));
|
||||
@ -198,24 +364,24 @@ public:
|
||||
color_mask = 0xffffffff;
|
||||
alpha_test_enabled = false;
|
||||
alpha_reference = 0;
|
||||
alpha_func = nv2a_renderer::ALWAYS;
|
||||
alpha_func = NV2A_COMPARISON_OP::ALWAYS;
|
||||
depth_test_enabled = false;
|
||||
depth_function = nv2a_renderer::LESS;
|
||||
depth_function = NV2A_COMPARISON_OP::LESS;
|
||||
depth_write_enabled = false;
|
||||
stencil_test_enabled = false;
|
||||
stencil_func = nv2a_renderer::ALWAYS;
|
||||
stencil_func = NV2A_COMPARISON_OP::ALWAYS;
|
||||
stencil_ref = 0;
|
||||
stencil_mask = -1;
|
||||
stencil_op_fail = nv2a_renderer::KEEP;
|
||||
stencil_op_zfail = nv2a_renderer::KEEP;
|
||||
stencil_op_zpass = nv2a_renderer::KEEP;
|
||||
stencil_op_fail = NV2A_STENCIL_OP::KEEP;
|
||||
stencil_op_zfail = NV2A_STENCIL_OP::KEEP;
|
||||
stencil_op_zpass = NV2A_STENCIL_OP::KEEP;
|
||||
blending_enabled = false;
|
||||
blend_equation = nv2a_renderer::FUNC_ADD;
|
||||
blend_equation = NV2A_BLEND_EQUATION::FUNC_ADD;
|
||||
blend_color = 0;
|
||||
blend_function_destination = nv2a_renderer::ZERO;
|
||||
blend_function_source = nv2a_renderer::ONE;
|
||||
blend_function_destination = NV2A_BLEND_FACTOR::ZERO;
|
||||
blend_function_source = NV2A_BLEND_FACTOR::ONE;
|
||||
logical_operation_enabled = false;
|
||||
logical_operation = nv2a_renderer::COPY;
|
||||
logical_operation = NV2A_LOGIC_OP::COPY;
|
||||
limits_rendertarget.set(0, 0, 640, 480);
|
||||
pitch_rendertarget = 0;
|
||||
pitch_depthbuffer = 0;
|
||||
@ -223,9 +389,9 @@ public:
|
||||
log2width_rendertarget = 0;
|
||||
dilate_rendertarget = 0;
|
||||
antialiasing_rendertarget = 0;
|
||||
type_rendertarget = nv2a_renderer::LINEAR;
|
||||
depthformat_rendertarget = nv2a_renderer::NV2A_RT_DEPTH_FORMAT_Z24S8;
|
||||
colorformat_rendertarget = nv2a_renderer::NV2A_COLOR_FORMAT_A8R8G8B8;
|
||||
type_rendertarget = NV2A_RT_TYPE::LINEAR;
|
||||
depthformat_rendertarget = NV2A_RT_DEPTH_FORMAT::Z24S8;
|
||||
colorformat_rendertarget = NV2A_COLOR_FORMAT::A8R8G8B8;
|
||||
bytespixel_rendertarget = 4;
|
||||
antialias_control = 0;
|
||||
rendertarget = nullptr;
|
||||
@ -324,9 +490,9 @@ public:
|
||||
int log2width_rendertarget;
|
||||
int dilate_rendertarget;
|
||||
int antialiasing_rendertarget;
|
||||
int type_rendertarget;
|
||||
int depthformat_rendertarget;
|
||||
int colorformat_rendertarget;
|
||||
NV2A_RT_TYPE type_rendertarget;
|
||||
NV2A_RT_DEPTH_FORMAT depthformat_rendertarget;
|
||||
NV2A_COLOR_FORMAT colorformat_rendertarget;
|
||||
int bytespixel_rendertarget;
|
||||
UINT32 antialias_control;
|
||||
UINT32 *rendertarget;
|
||||
@ -334,7 +500,7 @@ public:
|
||||
UINT32 *displayedtarget;
|
||||
UINT32 vertexbuffer_address[16];
|
||||
int vertexbuffer_stride[16];
|
||||
int vertexbuffer_kind[16];
|
||||
NV2A_VTXBUF_TYPE vertexbuffer_kind[16];
|
||||
int vertexbuffer_size[16];
|
||||
struct {
|
||||
int enabled;
|
||||
@ -342,7 +508,7 @@ public:
|
||||
int sizev;
|
||||
int sizew;
|
||||
int dilate;
|
||||
int format;
|
||||
NV2A_TEX_FORMAT format;
|
||||
int rectangle_pitch;
|
||||
void *buffer;
|
||||
} texture[4];
|
||||
@ -455,25 +621,25 @@ public:
|
||||
} combiner;
|
||||
UINT32 color_mask;
|
||||
bool alpha_test_enabled;
|
||||
int alpha_func;
|
||||
NV2A_COMPARISON_OP alpha_func;
|
||||
int alpha_reference;
|
||||
bool depth_test_enabled;
|
||||
int depth_function;
|
||||
NV2A_COMPARISON_OP depth_function;
|
||||
bool depth_write_enabled;
|
||||
bool stencil_test_enabled;
|
||||
int stencil_func;
|
||||
NV2A_COMPARISON_OP stencil_func;
|
||||
int stencil_ref;
|
||||
int stencil_mask;
|
||||
int stencil_op_fail;
|
||||
int stencil_op_zfail;
|
||||
int stencil_op_zpass;
|
||||
NV2A_STENCIL_OP stencil_op_fail;
|
||||
NV2A_STENCIL_OP stencil_op_zfail;
|
||||
NV2A_STENCIL_OP stencil_op_zpass;
|
||||
bool blending_enabled;
|
||||
int blend_equation;
|
||||
int blend_function_source;
|
||||
int blend_function_destination;
|
||||
NV2A_BLEND_EQUATION blend_equation;
|
||||
NV2A_BLEND_FACTOR blend_function_source;
|
||||
NV2A_BLEND_FACTOR blend_function_destination;
|
||||
UINT32 blend_color;
|
||||
bool logical_operation_enabled;
|
||||
int logical_operation;
|
||||
NV2A_LOGIC_OP logical_operation;
|
||||
struct {
|
||||
float modelview[16];
|
||||
float modelview_inverse[16];
|
||||
@ -505,170 +671,4 @@ public:
|
||||
int debug_grab_texttype;
|
||||
char *debug_grab_textfile;
|
||||
int waitvblank_used;
|
||||
|
||||
enum VERTEX_PARAMETER {
|
||||
PARAM_COLOR_B = 0,
|
||||
PARAM_COLOR_G = 1,
|
||||
PARAM_COLOR_R = 2,
|
||||
PARAM_COLOR_A = 3,
|
||||
PARAM_TEXTURE0_U = 4,
|
||||
PARAM_TEXTURE0_V = 5,
|
||||
PARAM_TEXTURE1_U = 6,
|
||||
PARAM_TEXTURE1_V = 7,
|
||||
PARAM_TEXTURE2_U = 8,
|
||||
PARAM_TEXTURE2_V = 9,
|
||||
PARAM_TEXTURE3_U = 10,
|
||||
PARAM_TEXTURE3_V = 11,
|
||||
PARAM_Z = 12
|
||||
};
|
||||
enum NV2A_BEGIN_END {
|
||||
STOP = 0,
|
||||
POINTS = 1,
|
||||
LINES = 2,
|
||||
LINE_LOOP = 3,
|
||||
LINE_STRIP = 4,
|
||||
TRIANGLES = 5,
|
||||
TRIANGLE_STRIP = 6,
|
||||
TRIANGLE_FAN = 7,
|
||||
QUADS = 8,
|
||||
QUAD_STRIP = 9,
|
||||
POLYGON = 10
|
||||
};
|
||||
enum NV2A_VERTEX_ATTR {
|
||||
POS = 0,
|
||||
WEIGHT = 1,
|
||||
NORMAL = 2,
|
||||
COLOR0 = 3, // diffuse
|
||||
COLOR1 = 4, // specular
|
||||
FOG = 5,
|
||||
BACKCOLOR0 = 7, // diffuse
|
||||
BACKCOLOR1 = 8, // specular
|
||||
TEX0 = 9,
|
||||
TEX1 = 10,
|
||||
TEX2 = 11,
|
||||
TEX3 = 12
|
||||
};
|
||||
enum NV2A_VTXBUF_TYPE {
|
||||
NV2A_VTXBUF_TYPE_UBYTE2 = 0, // what is the difference with UBYTE ?
|
||||
NV2A_VTXBUF_TYPE_FLOAT = 2,
|
||||
NV2A_VTXBUF_TYPE_UBYTE = 4,
|
||||
NV2A_VTXBUF_TYPE_USHORT = 5,
|
||||
NV2A_VTXBUF_TYPE_UNKNOWN_6 = 6 // used for vertex color
|
||||
};
|
||||
enum NV2A_TEX_FORMAT {
|
||||
L8 = 0x0,
|
||||
I8 = 0x1,
|
||||
A1R5G5B5 = 0x2,
|
||||
A4R4G4B4 = 0x4,
|
||||
R5G6B5 = 0x5,
|
||||
A8R8G8B8 = 0x6,
|
||||
X8R8G8B8 = 0x7,
|
||||
INDEX8 = 0xb,
|
||||
DXT1 = 0xc,
|
||||
DXT3 = 0xe,
|
||||
DXT5 = 0xf,
|
||||
A1R5G5B5_RECT = 0x10,
|
||||
R5G6B5_RECT = 0x11,
|
||||
A8R8G8B8_RECT = 0x12,
|
||||
L8_RECT = 0x13,
|
||||
DSDT8_RECT = 0x17,
|
||||
A8L8 = 0x1a,
|
||||
I8_RECT = 0x1b,
|
||||
A4R4G4B4_RECT = 0x1d,
|
||||
R8G8B8_RECT = 0x1e,
|
||||
A8L8_RECT = 0x20,
|
||||
Z24 = 0x2a,
|
||||
Z24_RECT = 0x2b,
|
||||
Z16 = 0x2c,
|
||||
Z16_RECT = 0x2d,
|
||||
DSDT8 = 0x28,
|
||||
HILO16 = 0x33,
|
||||
HILO16_RECT = 0x36,
|
||||
HILO8 = 0x44,
|
||||
SIGNED_HILO8 = 0x45,
|
||||
HILO8_RECT = 0x46,
|
||||
SIGNED_HILO8_RECT = 0x47
|
||||
};
|
||||
enum NV2A_LOGIC_OP {
|
||||
CLEAR = 0x1500,
|
||||
AND = 0x1501,
|
||||
AND_REVERSE = 0x1502,
|
||||
COPY = 0x1503,
|
||||
AND_INVERTED = 0x1504,
|
||||
NOOP = 0x1505,
|
||||
XOR = 0x1506,
|
||||
OR = 0x1507,
|
||||
NOR = 0x1508,
|
||||
EQUIV = 0x1509,
|
||||
INVERT = 0x150a,
|
||||
OR_REVERSE = 0x150b,
|
||||
COPY_INVERTED = 0x150c,
|
||||
OR_INVERTED = 0x150d,
|
||||
NAND = 0x150e,
|
||||
SET = 0x150f
|
||||
};
|
||||
enum NV2A_BLEND_EQUATION {
|
||||
FUNC_ADD = 0x8006,
|
||||
MIN = 0x8007,
|
||||
MAX = 0x8008,
|
||||
FUNC_SUBTRACT = 0x800a,
|
||||
FUNC_REVERSE_SUBTRACT = 0x80b
|
||||
};
|
||||
enum NV2A_BLEND_FACTOR {
|
||||
ZERO = 0x0000,
|
||||
ONE = 0x0001,
|
||||
SRC_COLOR = 0x0300,
|
||||
ONE_MINUS_SRC_COLOR = 0x0301,
|
||||
SRC_ALPHA = 0x0302,
|
||||
ONE_MINUS_SRC_ALPHA = 0x0303,
|
||||
DST_ALPHA = 0x0304,
|
||||
ONE_MINUS_DST_ALPHA = 0x0305,
|
||||
DST_COLOR = 0x0306,
|
||||
ONE_MINUS_DST_COLOR = 0x0307,
|
||||
SRC_ALPHA_SATURATE = 0x0308,
|
||||
CONSTANT_COLOR = 0x8001,
|
||||
ONE_MINUS_CONSTANT_COLOR = 0x8002,
|
||||
CONSTANT_ALPHA = 0x8003,
|
||||
ONE_MINUS_CONSTANT_ALPHA = 0x8004
|
||||
};
|
||||
enum NV2A_COMPARISON_OP {
|
||||
NEVER = 0x0200,
|
||||
LESS = 0x0201,
|
||||
EQUAL = 0x0202,
|
||||
LEQUAL = 0x0203,
|
||||
GREATER = 0x0204,
|
||||
NOTEQUAL = 0x0205,
|
||||
GEQUAL = 0x0206,
|
||||
ALWAYS = 0x0207
|
||||
};
|
||||
enum NV2A_STENCIL_OP {
|
||||
ZEROOP = 0x0000,
|
||||
INVERTOP = 0x150a,
|
||||
KEEP = 0x1e00,
|
||||
REPLACE = 0x1e01,
|
||||
INCR = 0x1e02,
|
||||
DECR = 0x1e03,
|
||||
INCR_WRAP = 0x8507,
|
||||
DECR_WRAP = 0x8508
|
||||
};
|
||||
enum NV2A_RT_TYPE {
|
||||
LINEAR = 1,
|
||||
SWIZZLED = 2
|
||||
};
|
||||
enum NV2A_RT_DEPTH_FORMAT {
|
||||
NV2A_RT_DEPTH_FORMAT_Z16 = 0x0001,
|
||||
NV2A_RT_DEPTH_FORMAT_Z24S8 = 0x0002
|
||||
};
|
||||
enum NV2A_COLOR_FORMAT {
|
||||
NV2A_COLOR_FORMAT_X1R5G5B5_Z1R5G5B5 = 1,
|
||||
NV2A_COLOR_FORMAT_X1R5G5B5_X1R5G5B5 = 2,
|
||||
NV2A_COLOR_FORMAT_R5G6B5 = 3,
|
||||
NV2A_COLOR_FORMAT_X8R8G8B8_Z8R8G8B8 = 4,
|
||||
NV2A_COLOR_FORMAT_X8R8G8B8_X8R8G8B8 = 5,
|
||||
NV2A_COLOR_FORMAT_X1A7R8G8B8_Z1A7R8G8B8 = 6,
|
||||
NV2A_COLOR_FORMAT_X1A7R8G8B8_X1A7R8G8B8 = 7,
|
||||
NV2A_COLOR_FORMAT_A8R8G8B8 = 8,
|
||||
NV2A_COLOR_FORMAT_B8 = 9,
|
||||
NV2A_COLOR_FORMAT_G8B8 = 10
|
||||
};
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user