mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-06 20:16:37 +00:00
nv2a: Fix SET_ANTI_ALIASING_CONTROL
- Rename from SET_SMOOTHING_CONTROL - Use correct register
This commit is contained in:
parent
5cd1e3cbca
commit
bb05a4f181
@ -517,7 +517,6 @@ static const VMStateDescription vmstate_nv2a = {
|
||||
VMSTATE_INT32_ARRAY(pgraph.gl_draw_arrays_start, NV2AState, 1250),
|
||||
VMSTATE_INT32_ARRAY(pgraph.gl_draw_arrays_count, NV2AState, 1250),
|
||||
VMSTATE_UINT32_ARRAY(pgraph.regs, NV2AState, 0x2000),
|
||||
VMSTATE_BOOL(pgraph.smoothing_enabled, NV2AState),
|
||||
VMSTATE_UINT32(pmc.pending_interrupts, NV2AState),
|
||||
VMSTATE_UINT32(pmc.enabled_interrupts, NV2AState),
|
||||
VMSTATE_UINT32(pfifo.pending_interrupts, NV2AState),
|
||||
|
@ -360,8 +360,6 @@ typedef struct PGRAPHState {
|
||||
bool ltc1_dirty[NV2A_LTC1_COUNT];
|
||||
|
||||
float material_alpha;
|
||||
// FIXME: Find the correct register for this.
|
||||
bool smoothing_enabled;
|
||||
|
||||
// should figure out where these are in lighting context
|
||||
float light_infinite_half_vector[NV2A_MAX_LIGHTS][3];
|
||||
|
@ -335,6 +335,8 @@
|
||||
# define NV_PGRAPH_CHEOPS_OFFSET_PROG_LD_PTR 0x000000FF
|
||||
# define NV_PGRAPH_CHEOPS_OFFSET_CONST_LD_PTR 0x0000FF00
|
||||
#define NV_PGRAPH_DMA_STATE 0x00001034
|
||||
#define NV_PGRAPH_ANTIALIASING 0x00001800
|
||||
# define NV_PGRAPH_ANTIALIASING_ENABLE (1 << 0)
|
||||
#define NV_PGRAPH_BLEND 0x00001804
|
||||
# define NV_PGRAPH_BLEND_EQN 0x00000007
|
||||
# define NV_PGRAPH_BLEND_EN (1 << 3)
|
||||
@ -1220,8 +1222,8 @@
|
||||
# define NV097_SET_ZMIN_MAX_CONTROL_ZCLAMP_EN 0x000000F0
|
||||
# define NV097_SET_ZMIN_MAX_CONTROL_ZCLAMP_EN_CULL 0
|
||||
# define NV097_SET_ZMIN_MAX_CONTROL_ZCLAMP_EN_CLAMP 1
|
||||
# define NV097_SET_SMOOTHING_CONTROL 0x00001D7C
|
||||
# define NV097_SET_SMOOTHING_CONTROL_DISABLE 0x00000001
|
||||
# define NV097_SET_ANTI_ALIASING_CONTROL 0x00001D7C
|
||||
# define NV097_SET_ANTI_ALIASING_CONTROL_ENABLE (1 << 0)
|
||||
# define NV097_SET_ZSTENCIL_CLEAR_VALUE 0x00001D8C
|
||||
# define NV097_SET_COLOR_CLEAR_VALUE 0x00001D90
|
||||
# define NV097_CLEAR_SURFACE 0x00001D94
|
||||
|
@ -3048,17 +3048,17 @@ DEF_METHOD(NV097, SET_BEGIN_END)
|
||||
|
||||
glEnable(GL_PROGRAM_POINT_SIZE);
|
||||
|
||||
bool anti_aliasing = GET_MASK(pg->regs[NV_PGRAPH_ANTIALIASING], NV_PGRAPH_ANTIALIASING_ENABLE);
|
||||
|
||||
/* Edge Antialiasing */
|
||||
if (pg->smoothing_enabled
|
||||
&& pg->regs[NV_PGRAPH_SETUPRASTER] &
|
||||
NV_PGRAPH_SETUPRASTER_LINESMOOTHENABLE) {
|
||||
if (!anti_aliasing && pg->regs[NV_PGRAPH_SETUPRASTER] &
|
||||
NV_PGRAPH_SETUPRASTER_LINESMOOTHENABLE) {
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
} else {
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
}
|
||||
if (pg->smoothing_enabled
|
||||
&& pg->regs[NV_PGRAPH_SETUPRASTER] &
|
||||
NV_PGRAPH_SETUPRASTER_POLYSMOOTHENABLE) {
|
||||
if (!anti_aliasing && pg->regs[NV_PGRAPH_SETUPRASTER] &
|
||||
NV_PGRAPH_SETUPRASTER_POLYSMOOTHENABLE) {
|
||||
glEnable(GL_POLYGON_SMOOTH);
|
||||
} else {
|
||||
glDisable(GL_POLYGON_SMOOTH);
|
||||
@ -3459,11 +3459,10 @@ DEF_METHOD(NV097, SET_ZMIN_MAX_CONTROL)
|
||||
}
|
||||
}
|
||||
|
||||
DEF_METHOD(NV097, SET_SMOOTHING_CONTROL)
|
||||
DEF_METHOD(NV097, SET_ANTI_ALIASING_CONTROL)
|
||||
{
|
||||
// FIXME: Find the correct register for this.
|
||||
pg->smoothing_enabled = !GET_MASK(parameter,
|
||||
NV097_SET_SMOOTHING_CONTROL_DISABLE);
|
||||
SET_MASK(pg->regs[NV_PGRAPH_ANTIALIASING], NV_PGRAPH_ANTIALIASING_ENABLE,
|
||||
GET_MASK(parameter, NV097_SET_ANTI_ALIASING_CONTROL_ENABLE));
|
||||
// FIXME: Handle the remaining bits (observed values 0xFFFF0000, 0xFFFF0001)
|
||||
}
|
||||
|
||||
@ -4037,7 +4036,6 @@ void pgraph_init(NV2AState *d)
|
||||
shader_cache_init(pg);
|
||||
|
||||
pg->material_alpha = 0.0f;
|
||||
pg->smoothing_enabled = false;
|
||||
SET_MASK(pg->regs[NV_PGRAPH_CONTROL_3], NV_PGRAPH_CONTROL_3_SHADEMODE,
|
||||
NV_PGRAPH_CONTROL_3_SHADEMODE_SMOOTH);
|
||||
pg->primitive_mode = PRIM_TYPE_INVALID;
|
||||
|
@ -169,7 +169,7 @@ DEF_METHOD_RANGE(NV097, SET_VERTEX_DATA4S_M, 32)
|
||||
DEF_METHOD(NV097, SET_SEMAPHORE_OFFSET)
|
||||
DEF_METHOD(NV097, BACK_END_WRITE_SEMAPHORE_RELEASE)
|
||||
DEF_METHOD(NV097, SET_ZMIN_MAX_CONTROL)
|
||||
DEF_METHOD(NV097, SET_SMOOTHING_CONTROL)
|
||||
DEF_METHOD(NV097, SET_ANTI_ALIASING_CONTROL)
|
||||
DEF_METHOD(NV097, SET_ZSTENCIL_CLEAR_VALUE)
|
||||
DEF_METHOD(NV097, SET_COLOR_CLEAR_VALUE)
|
||||
DEF_METHOD(NV097, CLEAR_SURFACE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user