mirror of
https://github.com/holub/mame
synced 2025-05-03 21:13:18 +03:00
(nw) N64: Make code style consistent and make mostly const-correct.
This commit is contained in:
parent
5529a60b6c
commit
ece3a08e19
@ -662,21 +662,21 @@ READ32_MEMBER(n64_periphs::sp_reg_r)
|
||||
case 0x20/4: // DP_CMD_START
|
||||
{
|
||||
n64_state *state = machine().driver_data<n64_state>();
|
||||
ret = state->m_rdp->GetStartReg();
|
||||
ret = state->m_rdp->get_start();
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x24/4: // DP_CMD_END
|
||||
{
|
||||
n64_state *state = machine().driver_data<n64_state>();
|
||||
ret = state->m_rdp->GetEndReg();
|
||||
ret = state->m_rdp->get_end();
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x28/4: // DP_CMD_CURRENT
|
||||
{
|
||||
n64_state *state = machine().driver_data<n64_state>();
|
||||
ret = state->m_rdp->GetCurrentReg();
|
||||
ret = state->m_rdp->get_current();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -688,13 +688,13 @@ READ32_MEMBER(n64_periphs::sp_reg_r)
|
||||
case 0x2c/4: // DP_CMD_STATUS
|
||||
{
|
||||
n64_state *state = machine().driver_data<n64_state>();
|
||||
ret = state->m_rdp->GetStatusReg();
|
||||
ret = state->m_rdp->get_status();
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x30/4: // DP_CMD_CLOCK
|
||||
{
|
||||
if(!(machine().driver_data<n64_state>()->m_rdp->GetStatusReg() & DP_STATUS_FREEZE))
|
||||
if(!(machine().driver_data<n64_state>()->m_rdp->get_status() & DP_STATUS_FREEZE))
|
||||
{
|
||||
dp_clock += 13;
|
||||
ret = dp_clock;
|
||||
@ -908,24 +908,24 @@ READ32_MEMBER( n64_periphs::dp_reg_r )
|
||||
switch (offset)
|
||||
{
|
||||
case 0x00/4: // DP_START_REG
|
||||
ret = state->m_rdp->GetStartReg();
|
||||
ret = state->m_rdp->get_start();
|
||||
break;
|
||||
|
||||
case 0x04/4: // DP_END_REG
|
||||
ret = state->m_rdp->GetEndReg();
|
||||
ret = state->m_rdp->get_end();
|
||||
break;
|
||||
|
||||
case 0x08/4: // DP_CURRENT_REG
|
||||
ret = state->m_rdp->GetCurrentReg();
|
||||
ret = state->m_rdp->get_current();
|
||||
break;
|
||||
|
||||
case 0x0c/4: // DP_STATUS_REG
|
||||
ret = state->m_rdp->GetStatusReg();
|
||||
ret = state->m_rdp->get_status();
|
||||
break;
|
||||
|
||||
case 0x10/4: // DP_CLOCK_REG
|
||||
{
|
||||
if(!(state->m_rdp->GetStatusReg() & DP_STATUS_FREEZE))
|
||||
if(!(state->m_rdp->get_status() & DP_STATUS_FREEZE))
|
||||
{
|
||||
dp_clock += 13;
|
||||
ret = dp_clock;
|
||||
@ -948,20 +948,20 @@ WRITE32_MEMBER( n64_periphs::dp_reg_w )
|
||||
switch (offset)
|
||||
{
|
||||
case 0x00/4: // DP_START_REG
|
||||
state->m_rdp->SetStartReg(data);
|
||||
state->m_rdp->SetCurrentReg(state->m_rdp->GetStartReg());
|
||||
state->m_rdp->set_start(data);
|
||||
state->m_rdp->set_current(state->m_rdp->get_start());
|
||||
break;
|
||||
|
||||
case 0x04/4: // DP_END_REG
|
||||
state->m_rdp->SetEndReg(data);
|
||||
state->m_rdp->set_end(data);
|
||||
g_profiler.start(PROFILER_USER1);
|
||||
state->m_rdp->ProcessList();
|
||||
state->m_rdp->process_command_list();
|
||||
g_profiler.stop();
|
||||
break;
|
||||
|
||||
case 0x0c/4: // DP_STATUS_REG
|
||||
{
|
||||
UINT32 current_status = state->m_rdp->GetStatusReg();
|
||||
UINT32 current_status = state->m_rdp->get_status();
|
||||
if (data & 0x00000001) current_status &= ~DP_STATUS_XBUS_DMA;
|
||||
if (data & 0x00000002) current_status |= DP_STATUS_XBUS_DMA;
|
||||
if (data & 0x00000004) current_status &= ~DP_STATUS_FREEZE;
|
||||
@ -969,7 +969,7 @@ WRITE32_MEMBER( n64_periphs::dp_reg_w )
|
||||
if (data & 0x00000010) current_status &= ~DP_STATUS_FLUSH;
|
||||
if (data & 0x00000020) current_status |= DP_STATUS_FLUSH;
|
||||
if (data & 0x00000200) dp_clock = 0;
|
||||
state->m_rdp->SetStatusReg(current_status);
|
||||
state->m_rdp->set_status(current_status);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1025,7 +1025,7 @@ void n64_periphs::vi_recalculate_resolution()
|
||||
if (height > 480)
|
||||
height = 480;
|
||||
|
||||
state->m_rdp->MiscState.FBHeight = height;
|
||||
state->m_rdp->m_misc_state.m_fb_height = height;
|
||||
|
||||
visarea.max_x = width - 1;
|
||||
visarea.max_y = height - 1;
|
||||
@ -1122,7 +1122,7 @@ WRITE32_MEMBER( n64_periphs::vi_reg_w )
|
||||
vi_recalculate_resolution();
|
||||
}
|
||||
vi_width = data;
|
||||
state->m_rdp->MiscState.FBWidth = data;
|
||||
state->m_rdp->m_misc_state.m_fb_width = data;
|
||||
break;
|
||||
|
||||
case 0x0c/4: // VI_INTR_REG
|
||||
|
2077
src/mame/video/n64.c
2077
src/mame/video/n64.c
File diff suppressed because it is too large
Load Diff
@ -50,9 +50,9 @@
|
||||
#endif
|
||||
#define DWORD_XOR_DWORD_SWAP 1
|
||||
|
||||
#define GET_LOW_RGBA16_TMEM(x) (m_rdp->ReplicatedRGBA[((x) >> 1) & 0x1f])
|
||||
#define GET_MED_RGBA16_TMEM(x) (m_rdp->ReplicatedRGBA[((x) >> 6) & 0x1f])
|
||||
#define GET_HI_RGBA16_TMEM(x) (m_rdp->ReplicatedRGBA[((x) >> 11) & 0x1f])
|
||||
#define GET_LOW_RGBA16_TMEM(x) (m_rdp->m_replicated_rgba[((x) >> 1) & 0x1f])
|
||||
#define GET_MED_RGBA16_TMEM(x) (m_rdp->m_replicated_rgba[((x) >> 6) & 0x1f])
|
||||
#define GET_HI_RGBA16_TMEM(x) (m_rdp->m_replicated_rgba[((x) >> 11) & 0x1f])
|
||||
|
||||
#define MEM8_LIMIT 0x7fffff
|
||||
#define MEM16_LIMIT 0x3fffff
|
||||
@ -76,7 +76,7 @@
|
||||
#define RREADIDX32(in) ((rdp_range_check((in) << 2)) ? 0 : rdram[(in)])
|
||||
|
||||
#define RWRITEADDR8(in, val) if(rdp_range_check((in))) { printf("Write8: Address %08x out of range!\n", (in)); fflush(stdout); fatalerror("Address %08x out of range!\n", (in)); } else { ((UINT8*)rdram)[(in) ^ BYTE_ADDR_XOR] = val;}
|
||||
#define RWRITEIDX16(in, val) if(rdp_range_check((in) << 1)) { printf("Write16: Address %08x out of range!\n", ((object.MiscState.FBAddress >> 1) + curpixel) << 1); fflush(stdout); fatalerror("Address out of range\n"); } else { ((UINT16*)rdram)[(in) ^ WORD_ADDR_XOR] = val;}
|
||||
#define RWRITEIDX16(in, val) if(rdp_range_check((in) << 1)) { printf("Write16: Address %08x out of range!\n", ((object.m_misc_state.m_fb_address >> 1) + curpixel) << 1); fflush(stdout); fatalerror("Address out of range\n"); } else { ((UINT16*)rdram)[(in) ^ WORD_ADDR_XOR] = val;}
|
||||
#define RWRITEIDX32(in, val) if(rdp_range_check((in) << 2)) { printf("Write32: Address %08x out of range!\n", (in) << 2); fflush(stdout); fatalerror("Address %08x out of range!\n", (in) << 2); } else { rdram[(in)] = val;}
|
||||
#else
|
||||
#define RREADADDR8(in) (((UINT8*)rdram)[(in) ^ BYTE_ADDR_XOR])
|
||||
@ -96,8 +96,8 @@
|
||||
#define GETMEDCOL(x) (((x) & 0x7c0) >> 3)
|
||||
#define GETHICOL(x) (((x) & 0xf800) >> 8)
|
||||
|
||||
#define HREADADDR8(in) /*(((in) <= MEM8_LIMIT) ? */(HiddenBits[(in) ^ BYTE_ADDR_XOR])/* : 0)*/
|
||||
#define HWRITEADDR8(in, val) /*{if ((in) <= MEM8_LIMIT) */HiddenBits[(in) ^ BYTE_ADDR_XOR] = val;/*}*/
|
||||
#define HREADADDR8(in) /*(((in) <= MEM8_LIMIT) ? */(m_hidden_bits[(in) ^ BYTE_ADDR_XOR])/* : 0)*/
|
||||
#define HWRITEADDR8(in, val) /*{if ((in) <= MEM8_LIMIT) */m_hidden_bits[(in) ^ BYTE_ADDR_XOR] = val;/*}*/
|
||||
|
||||
//sign-extension macros
|
||||
#define SIGN22(x) (((x) & 0x200000) ? ((x) | ~0x3fffff) : ((x) & 0x3fffff))
|
||||
@ -128,17 +128,17 @@
|
||||
class n64_periphs;
|
||||
class n64_rdp;
|
||||
|
||||
struct MiscStateT;
|
||||
struct OtherModesT;
|
||||
struct CombineModesT;
|
||||
struct ColorInputsT;
|
||||
struct SpanBaseT;
|
||||
struct Rectangle;
|
||||
struct misc_state_t;
|
||||
struct other_modes_t;
|
||||
struct combine_mdoes_t;
|
||||
struct color_inputs_t;
|
||||
struct span_base_t;
|
||||
struct rectangle_t;
|
||||
|
||||
class Color
|
||||
class color_t
|
||||
{
|
||||
public:
|
||||
Color()
|
||||
color_t()
|
||||
{
|
||||
c = 0;
|
||||
}
|
||||
@ -176,95 +176,92 @@ class SpanParam
|
||||
};
|
||||
};
|
||||
|
||||
struct N64Tile
|
||||
struct n64_tile_t
|
||||
{
|
||||
int format; // Image data format: RGBA, YUV, CI, IA, I
|
||||
int size; // Size of texel element: 4b, 8b, 16b, 32b
|
||||
int line; // Size of tile line in bytes
|
||||
int tmem; // Starting tmem address for this tile in bytes
|
||||
int palette; // Palette number for 4b CI texels
|
||||
int ct, mt, cs, ms; // Clamp / mirror enable bits for S / T direction
|
||||
int mask_t, shift_t, mask_s, shift_s; // Mask values / LOD shifts
|
||||
INT32 format; // Image data format: RGBA, YUV, CI, IA, I
|
||||
INT32 size; // Size of texel element: 4b, 8b, 16b, 32b
|
||||
INT32 line; // Size of tile line in bytes
|
||||
INT32 tmem; // Starting tmem address for this tile in bytes
|
||||
INT32 palette; // Palette number for 4b CI texels
|
||||
INT32 ct, mt, cs, ms; // Clamp / mirror enable bits for S / T direction
|
||||
INT32 mask_t, shift_t, mask_s, shift_s; // Mask values / LOD shifts
|
||||
UINT16 sl, tl, sh, th; // 10.2 fixed-point, starting and ending texel row / column
|
||||
int num;
|
||||
INT32 num;
|
||||
};
|
||||
|
||||
struct SpanBaseT
|
||||
struct span_base_t
|
||||
{
|
||||
int m_span_dr;
|
||||
int m_span_dg;
|
||||
int m_span_db;
|
||||
int m_span_da;
|
||||
int m_span_ds;
|
||||
int m_span_dt;
|
||||
int m_span_dw;
|
||||
int m_span_dz;
|
||||
int m_span_dymax;
|
||||
int m_span_dzpix;
|
||||
int m_span_drdy;
|
||||
int m_span_dgdy;
|
||||
int m_span_dbdy;
|
||||
int m_span_dady;
|
||||
int m_span_dzdy;
|
||||
INT32 m_span_dr;
|
||||
INT32 m_span_dg;
|
||||
INT32 m_span_db;
|
||||
INT32 m_span_da;
|
||||
INT32 m_span_ds;
|
||||
INT32 m_span_dt;
|
||||
INT32 m_span_dw;
|
||||
INT32 m_span_dz;
|
||||
INT32 m_span_dymax;
|
||||
INT32 m_span_dzpix;
|
||||
INT32 m_span_drdy;
|
||||
INT32 m_span_dgdy;
|
||||
INT32 m_span_dbdy;
|
||||
INT32 m_span_dady;
|
||||
INT32 m_span_dzdy;
|
||||
};
|
||||
|
||||
struct MiscStateT
|
||||
struct misc_state_t
|
||||
{
|
||||
MiscStateT()
|
||||
misc_state_t()
|
||||
{
|
||||
MaxLevel = 0;
|
||||
MinLevel = 0;
|
||||
m_max_level = 0;
|
||||
m_min_level = 0;
|
||||
}
|
||||
|
||||
int FBFormat; // Framebuffer pixel format index (0 - I, 1 - IA, 2 - CI, 3 - RGBA)
|
||||
int FBSize; // Framebuffer pixel size index (0 - 4bpp, 1 - 8bpp, 2 - 16bpp, 3 - 32bpp)
|
||||
int FBWidth; // Framebuffer width, in pixels
|
||||
int FBHeight; // Framebuffer height, in scanlines
|
||||
UINT32 FBAddress; // Framebuffer source address offset (in bytes) from start of RDRAM
|
||||
INT32 m_fb_format; // Framebuffer pixel format index (0 - I, 1 - IA, 2 - CI, 3 - RGBA)
|
||||
INT32 m_fb_size; // Framebuffer pixel size index (0 - 4bpp, 1 - 8bpp, 2 - 16bpp, 3 - 32bpp)
|
||||
INT32 m_fb_width; // Framebuffer width, in pixels
|
||||
INT32 m_fb_height; // Framebuffer height, in pixels
|
||||
UINT32 m_fb_address; // Framebuffer source address offset (in bytes) from start of RDRAM
|
||||
|
||||
UINT32 ZBAddress; // Z-buffer source address offset (in bytes) from start of RDRAM
|
||||
UINT32 m_zb_address; // Z-buffer source address offset (in bytes) from start of RDRAM
|
||||
|
||||
int TIFormat; // Format for Texture Interface (TI) transfers
|
||||
int TISize; // Size (in bytes) of TI transfers
|
||||
int TIWidth; // Width (in pixels) of TI transfers
|
||||
UINT32 TIAddress; // Destination address for TI transfers
|
||||
INT32 m_ti_format; // Format for Texture Interface (TI) transfers
|
||||
INT32 m_ti_size; // Size (in bytes) of TI transfers
|
||||
INT32 m_ti_width; // Width (in pixels) of TI transfers
|
||||
UINT32 m_ti_address; // Destination address for TI transfers
|
||||
|
||||
UINT8 RandomSeed; // %HACK%, adds 19 each time it's read and is more or less random
|
||||
UINT8 m_random_seed; // %HACK%, adds 19 each time it's read and is more or less random
|
||||
|
||||
int SpecialBlendSelect0; // Special blend-mode select for cycle 0
|
||||
int SpecialBlendSelect1; // Special blend-mode select for cycle 1
|
||||
UINT32 m_max_level; // Maximum LOD level for texture filtering
|
||||
UINT32 m_min_level; // Minimum LOD level for texture filtering
|
||||
|
||||
UINT32 MaxLevel; // Maximum LOD level for texture filtering
|
||||
UINT32 MinLevel; // Minimum LOD level for texture filtering
|
||||
|
||||
UINT16 PrimitiveZ; // Forced Z value for current primitive, if applicable
|
||||
UINT16 PrimitiveDZ; // Forced Delta-Z value for current primitive, if applicable
|
||||
UINT16 m_primitive_z; // Forced Z value for current primitive, if applicable
|
||||
UINT16 m_primitive_dz; // Forced Delta-Z value for current primitive, if applicable
|
||||
};
|
||||
|
||||
struct CombineModesT
|
||||
struct combine_modes_t
|
||||
{
|
||||
int sub_a_rgb0;
|
||||
int sub_b_rgb0;
|
||||
int mul_rgb0;
|
||||
int add_rgb0;
|
||||
int sub_a_a0;
|
||||
int sub_b_a0;
|
||||
int mul_a0;
|
||||
int add_a0;
|
||||
INT32 sub_a_rgb0;
|
||||
INT32 sub_b_rgb0;
|
||||
INT32 mul_rgb0;
|
||||
INT32 add_rgb0;
|
||||
INT32 sub_a_a0;
|
||||
INT32 sub_b_a0;
|
||||
INT32 mul_a0;
|
||||
INT32 add_a0;
|
||||
|
||||
int sub_a_rgb1;
|
||||
int sub_b_rgb1;
|
||||
int mul_rgb1;
|
||||
int add_rgb1;
|
||||
int sub_a_a1;
|
||||
int sub_b_a1;
|
||||
int mul_a1;
|
||||
int add_a1;
|
||||
INT32 sub_a_rgb1;
|
||||
INT32 sub_b_rgb1;
|
||||
INT32 mul_rgb1;
|
||||
INT32 add_rgb1;
|
||||
INT32 sub_a_a1;
|
||||
INT32 sub_b_a1;
|
||||
INT32 mul_a1;
|
||||
INT32 add_a1;
|
||||
};
|
||||
|
||||
struct OtherModesT
|
||||
struct other_modes_t
|
||||
{
|
||||
int cycle_type;
|
||||
INT32 cycle_type;
|
||||
bool persp_tex_en;
|
||||
bool detail_tex_en;
|
||||
bool sharpen_tex_en;
|
||||
@ -277,64 +274,64 @@ struct OtherModesT
|
||||
bool bi_lerp1;
|
||||
bool convert_one;
|
||||
bool key_en;
|
||||
int rgb_dither_sel;
|
||||
int alpha_dither_sel;
|
||||
int blend_m1a_0;
|
||||
int blend_m1a_1;
|
||||
int blend_m1b_0;
|
||||
int blend_m1b_1;
|
||||
int blend_m2a_0;
|
||||
int blend_m2a_1;
|
||||
int blend_m2b_0;
|
||||
int blend_m2b_1;
|
||||
int tex_edge;
|
||||
int force_blend;
|
||||
int blend_shift;
|
||||
INT32 rgb_dither_sel;
|
||||
INT32 alpha_dither_sel;
|
||||
INT32 blend_m1a_0;
|
||||
INT32 blend_m1a_1;
|
||||
INT32 blend_m1b_0;
|
||||
INT32 blend_m1b_1;
|
||||
INT32 blend_m2a_0;
|
||||
INT32 blend_m2a_1;
|
||||
INT32 blend_m2b_0;
|
||||
INT32 blend_m2b_1;
|
||||
INT32 tex_edge;
|
||||
INT32 force_blend;
|
||||
INT32 blend_shift;
|
||||
bool alpha_cvg_select;
|
||||
bool cvg_times_alpha;
|
||||
int z_mode;
|
||||
int cvg_dest;
|
||||
INT32 z_mode;
|
||||
INT32 cvg_dest;
|
||||
bool color_on_cvg;
|
||||
UINT8 image_read_en;
|
||||
bool z_update_en;
|
||||
bool z_compare_en;
|
||||
bool antialias_en;
|
||||
bool z_source_sel;
|
||||
int dither_alpha_en;
|
||||
int alpha_compare_en;
|
||||
int alpha_dither_mode;
|
||||
INT32 dither_alpha_en;
|
||||
INT32 alpha_compare_en;
|
||||
INT32 alpha_dither_mode;
|
||||
};
|
||||
|
||||
struct ColorInputsT
|
||||
struct color_inputs_t
|
||||
{
|
||||
// combiner inputs
|
||||
UINT8 *combiner_rgbsub_a_r[2];
|
||||
UINT8 *combiner_rgbsub_a_g[2];
|
||||
UINT8 *combiner_rgbsub_a_b[2];
|
||||
UINT8 *combiner_rgbsub_b_r[2];
|
||||
UINT8 *combiner_rgbsub_b_g[2];
|
||||
UINT8 *combiner_rgbsub_b_b[2];
|
||||
UINT8 *combiner_rgbmul_r[2];
|
||||
UINT8 *combiner_rgbmul_g[2];
|
||||
UINT8 *combiner_rgbmul_b[2];
|
||||
UINT8 *combiner_rgbadd_r[2];
|
||||
UINT8 *combiner_rgbadd_g[2];
|
||||
UINT8 *combiner_rgbadd_b[2];
|
||||
UINT8* combiner_rgbsub_a_r[2];
|
||||
UINT8* combiner_rgbsub_a_g[2];
|
||||
UINT8* combiner_rgbsub_a_b[2];
|
||||
UINT8* combiner_rgbsub_b_r[2];
|
||||
UINT8* combiner_rgbsub_b_g[2];
|
||||
UINT8* combiner_rgbsub_b_b[2];
|
||||
UINT8* combiner_rgbmul_r[2];
|
||||
UINT8* combiner_rgbmul_g[2];
|
||||
UINT8* combiner_rgbmul_b[2];
|
||||
UINT8* combiner_rgbadd_r[2];
|
||||
UINT8* combiner_rgbadd_g[2];
|
||||
UINT8* combiner_rgbadd_b[2];
|
||||
|
||||
UINT8 *combiner_alphasub_a[2];
|
||||
UINT8 *combiner_alphasub_b[2];
|
||||
UINT8 *combiner_alphamul[2];
|
||||
UINT8 *combiner_alphaadd[2];
|
||||
UINT8* combiner_alphasub_a[2];
|
||||
UINT8* combiner_alphasub_b[2];
|
||||
UINT8* combiner_alphamul[2];
|
||||
UINT8* combiner_alphaadd[2];
|
||||
|
||||
// blender input
|
||||
UINT8 *blender1a_r[2];
|
||||
UINT8 *blender1a_g[2];
|
||||
UINT8 *blender1a_b[2];
|
||||
UINT8 *blender1b_a[2];
|
||||
UINT8 *blender2a_r[2];
|
||||
UINT8 *blender2a_g[2];
|
||||
UINT8 *blender2a_b[2];
|
||||
UINT8 *blender2b_a[2];
|
||||
UINT8* blender1a_r[2];
|
||||
UINT8* blender1a_g[2];
|
||||
UINT8* blender1a_b[2];
|
||||
UINT8* blender1b_a[2];
|
||||
UINT8* blender2a_r[2];
|
||||
UINT8* blender2a_g[2];
|
||||
UINT8* blender2a_b[2];
|
||||
UINT8* blender2b_a[2];
|
||||
};
|
||||
|
||||
// This is enormous and horrible
|
||||
@ -342,40 +339,39 @@ struct rdp_span_aux
|
||||
{
|
||||
UINT32 m_unscissored_rx;
|
||||
UINT16 m_cvg[RDP_CVG_SPAN_MAX];
|
||||
Color MemoryColor;
|
||||
Color PixelColor;
|
||||
Color InvPixelColor;
|
||||
Color BlendedPixelColor;
|
||||
Color CombinedColor;
|
||||
Color Texel0Color;
|
||||
Color Texel1Color;
|
||||
Color NextTexelColor;
|
||||
Color BlendColor; /* constant blend color */
|
||||
Color PrimColor; /* flat primitive color */
|
||||
Color EnvColor; /* generic color constant ('environment') */
|
||||
Color FogColor; /* generic color constant ('fog') */
|
||||
Color ShadeColor; /* gouraud-shaded color */
|
||||
Color KeyScale; /* color-keying constant */
|
||||
Color NoiseColor; /* noise */
|
||||
UINT8 LODFraction; /* Z-based LOD fraction for this poly */
|
||||
UINT8 PrimLODFraction; /* fixed LOD fraction for this poly */
|
||||
ColorInputsT ColorInputs;
|
||||
UINT32 CurrentPixCvg;
|
||||
UINT32 CurrentMemCvg;
|
||||
UINT32 CurrentCvgBit;
|
||||
UINT32 CurrentPixOverlap;
|
||||
INT32 ShiftA;
|
||||
INT32 ShiftB;
|
||||
color_t m_memory_color;
|
||||
color_t m_pixel_color;
|
||||
color_t m_inv_pixel_color;
|
||||
color_t m_blended_pixel_color;
|
||||
color_t m_combined_color;
|
||||
color_t m_texel0_color;
|
||||
color_t m_texel1_color;
|
||||
color_t m_next_texel_color;
|
||||
color_t m_blend_color; /* constant blend color */
|
||||
color_t m_prim_color; /* flat primitive color */
|
||||
color_t m_env_color; /* generic color constant ('environment') */
|
||||
color_t m_fog_color; /* generic color constant ('fog') */
|
||||
color_t m_shade_color; /* gouraud-shaded color */
|
||||
color_t m_key_scale; /* color-keying constant */
|
||||
color_t m_noise_color; /* noise */
|
||||
UINT8 m_lod_fraction; /* Z-based LOD fraction for this poly */
|
||||
UINT8 m_prim_lod_fraction; /* fixed LOD fraction for this poly */
|
||||
color_inputs_t m_color_inputs;
|
||||
UINT32 m_current_pix_cvg;
|
||||
UINT32 m_current_mem_cvg;
|
||||
UINT32 m_current_cvg_bit;
|
||||
INT32 m_shift_a;
|
||||
INT32 m_shift_b;
|
||||
INT32 m_precomp_s;
|
||||
INT32 m_precomp_t;
|
||||
UINT8 BlendEnable;
|
||||
bool PreWrap;
|
||||
INT32 m_blend_enable;
|
||||
bool m_pre_wrap;
|
||||
INT32 m_dzpix_enc;
|
||||
UINT8 *m_tmem; /* pointer to texture cache for this polygon */
|
||||
UINT8* m_tmem; /* pointer to texture cache for this polygon */
|
||||
bool m_start_span;
|
||||
};
|
||||
|
||||
struct Rectangle
|
||||
struct rectangle_t
|
||||
{
|
||||
UINT16 m_xl; // 10.2 fixed-point
|
||||
UINT16 m_yl; // 10.2 fixed-point
|
||||
@ -383,318 +379,289 @@ struct Rectangle
|
||||
UINT16 m_yh; // 10.2 fixed-point
|
||||
};
|
||||
|
||||
struct z_decompress_entry_t
|
||||
{
|
||||
UINT32 shift;
|
||||
UINT32 add;
|
||||
};
|
||||
|
||||
struct cv_mask_derivative_t
|
||||
{
|
||||
UINT8 cvg;
|
||||
UINT8 cvbit;
|
||||
UINT8 xoff;
|
||||
UINT8 yoff;
|
||||
};
|
||||
|
||||
struct rdp_poly_state
|
||||
{
|
||||
n64_rdp * m_rdp; /* pointer back to the RDP state */
|
||||
n64_rdp* m_rdp; /* pointer back to the RDP state */
|
||||
|
||||
MiscStateT MiscState; /* miscellaneous rasterizer bits */
|
||||
OtherModesT OtherModes; /* miscellaneous rasterizer bits (2) */
|
||||
SpanBaseT SpanBase; /* span initial values for triangle rasterization */
|
||||
Rectangle Scissor; /* screen-space scissor bounds */
|
||||
UINT32 FillColor; /* poly fill color */
|
||||
N64Tile m_tiles[8]; /* texture tile state */
|
||||
misc_state_t m_misc_state; /* miscellaneous rasterizer bits */
|
||||
other_modes_t m_other_modes; /* miscellaneous rasterizer bits (2) */
|
||||
span_base_t m_span_base; /* span initial values for triangle rasterization */
|
||||
rectangle_t m_scissor; /* screen-space scissor bounds */
|
||||
UINT32 m_fill_color; /* poly fill color */
|
||||
n64_tile_t m_tiles[8]; /* texture tile state */
|
||||
UINT8 m_tmem[0x1000]; /* texture cache */
|
||||
int tilenum; /* texture tile index */
|
||||
INT32 tilenum; /* texture tile index */
|
||||
bool flip; /* left-major / right-major flip */
|
||||
bool rect; /* primitive is rectangle (vs. triangle) */
|
||||
};
|
||||
|
||||
//class n64_state;
|
||||
typedef void (*rdp_command_t)(UINT32 w1, UINT32 w2);
|
||||
|
||||
class n64_rdp : public poly_manager<UINT32, rdp_poly_state, 8, 32000>
|
||||
{
|
||||
public:
|
||||
typedef void (n64_rdp::*Writer) (UINT32 curpixel, UINT32 r, UINT32 g, UINT32 b, rdp_span_aux *userdata, const rdp_poly_state &object);
|
||||
typedef void (n64_rdp::*Reader) (UINT32 curpixel, rdp_span_aux *userdata, const rdp_poly_state &object);
|
||||
typedef void (n64_rdp::*Copier) (UINT32 curpixel, UINT32 r, UINT32 g, UINT32 b, int CurrentPixCvg, const rdp_poly_state &object);
|
||||
typedef void (n64_rdp::*Filler) (UINT32 curpixel, const rdp_poly_state &object);
|
||||
public:
|
||||
n64_rdp(n64_state &state);
|
||||
|
||||
n64_rdp(n64_state &state);
|
||||
running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
|
||||
|
||||
running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
|
||||
void init_internal_state()
|
||||
{
|
||||
m_tmem = auto_alloc_array(machine(), UINT8, 0x1000);
|
||||
memset(m_tmem, 0, 0x1000);
|
||||
|
||||
void InitInternalState()
|
||||
UINT8* normpoint = machine().root_device().memregion("normpoint")->base();
|
||||
UINT8* normslope = machine().root_device().memregion("normslope")->base();
|
||||
|
||||
for(INT32 i = 0; i < 64; i++)
|
||||
{
|
||||
m_tmem = auto_alloc_array(machine(), UINT8, 0x1000);
|
||||
memset(m_tmem, 0, 0x1000);
|
||||
|
||||
UINT8 *normpoint = machine().root_device().memregion("normpoint")->base();
|
||||
UINT8 *normslope = machine().root_device().memregion("normslope")->base();
|
||||
|
||||
for(INT32 i = 0; i < 64; i++)
|
||||
{
|
||||
m_norm_point_rom[i] = (normpoint[(i << 1) + 1] << 8) | normpoint[i << 1];
|
||||
m_norm_slope_rom[i] = (normslope[(i << 1) + 1] << 8) | normslope[i << 1];
|
||||
}
|
||||
|
||||
memset(m_tiles, 0, 8 * sizeof(N64Tile));
|
||||
memset(m_cmd_data, 0, sizeof(m_cmd_data));
|
||||
m_norm_point_rom[i] = (normpoint[(i << 1) + 1] << 8) | normpoint[i << 1];
|
||||
m_norm_slope_rom[i] = (normslope[(i << 1) + 1] << 8) | normslope[i << 1];
|
||||
}
|
||||
|
||||
void ProcessList();
|
||||
UINT32 ReadData(UINT32 address);
|
||||
void Dasm(char *buffer);
|
||||
memset(m_tiles, 0, 8 * sizeof(n64_tile_t));
|
||||
memset(m_cmd_data, 0, sizeof(m_cmd_data));
|
||||
}
|
||||
|
||||
void SetMachine(running_machine& machine) { m_machine = &machine; }
|
||||
void process_command_list();
|
||||
UINT32 read_data(UINT32 address);
|
||||
void disassemble(char* buffer);
|
||||
|
||||
// CPU-visible registers
|
||||
void SetStartReg(UINT32 val)
|
||||
{
|
||||
m_start = val;
|
||||
}
|
||||
UINT32 GetStartReg() const { return m_start; }
|
||||
void set_machine(running_machine& machine) { m_machine = &machine; }
|
||||
|
||||
void SetEndReg(UINT32 val)
|
||||
{
|
||||
m_end = val;
|
||||
}
|
||||
UINT32 GetEndReg() const { return m_end; }
|
||||
// CPU-visible registers
|
||||
void set_start(UINT32 val) { m_start = val; }
|
||||
UINT32 get_start() const { return m_start; }
|
||||
|
||||
void SetCurrentReg(UINT32 val) { m_current = val; }
|
||||
UINT32 GetCurrentReg() const { return m_current; }
|
||||
void set_end(UINT32 val) { m_end = val; }
|
||||
UINT32 get_end() const { return m_end; }
|
||||
|
||||
void SetStatusReg(UINT32 val) { m_status = val; }
|
||||
UINT32 GetStatusReg() const { return m_status; }
|
||||
void set_current(UINT32 val) { m_current = val; }
|
||||
UINT32 get_current() const { return m_current; }
|
||||
|
||||
// Internal state
|
||||
CombineModesT* GetCombine() { return &m_combine; }
|
||||
void set_status(UINT32 val) { m_status = val; }
|
||||
UINT32 get_status() const { return m_status; }
|
||||
|
||||
// Color Combiner
|
||||
INT32 ColorCombinerEquation(INT32 a, INT32 b, INT32 c, INT32 d);
|
||||
INT32 AlphaCombinerEquation(INT32 a, INT32 b, INT32 c, INT32 d);
|
||||
void SetSubAInputRGB(UINT8 **input_r, UINT8 **input_g, UINT8 **input_b, int code, rdp_span_aux *userdata);
|
||||
void SetSubBInputRGB(UINT8 **input_r, UINT8 **input_g, UINT8 **input_b, int code, rdp_span_aux *userdata);
|
||||
void SetMulInputRGB(UINT8 **input_r, UINT8 **input_g, UINT8 **input_b, int code, rdp_span_aux *userdata);
|
||||
void SetAddInputRGB(UINT8 **input_r, UINT8 **input_g, UINT8 **input_b, int code, rdp_span_aux *userdata);
|
||||
void SetSubInputAlpha(UINT8 **input, int code, rdp_span_aux *userdata);
|
||||
void SetMulInputAlpha(UINT8 **input, int code, rdp_span_aux *userdata);
|
||||
// Color Combiner
|
||||
INT32 color_combiner_equation(INT32 a, INT32 b, INT32 c, INT32 d);
|
||||
INT32 alpha_combiner_equation(INT32 a, INT32 b, INT32 c, INT32 d);
|
||||
void set_suba_input_rgb(UINT8** input_r, UINT8** input_g, UINT8** input_b, INT32 code, rdp_span_aux* userdata);
|
||||
void set_subb_input_rgb(UINT8** input_r, UINT8** input_g, UINT8** input_b, INT32 code, rdp_span_aux* userdata);
|
||||
void set_mul_input_rgb(UINT8** input_r, UINT8** input_g, UINT8** input_b, INT32 code, rdp_span_aux* userdata);
|
||||
void set_add_input_rgb(UINT8** input_r, UINT8** input_g, UINT8** input_b, INT32 code, rdp_span_aux* userdata);
|
||||
void set_sub_input_alpha(UINT8** input, INT32 code, rdp_span_aux* userdata);
|
||||
void set_mul_input_alpha(UINT8** input, INT32 code, rdp_span_aux* userdata);
|
||||
|
||||
// Texture memory
|
||||
UINT8* GetTMEM() { return m_tmem; }
|
||||
UINT16* GetTMEM16() { return (UINT16*)m_tmem; }
|
||||
UINT32* GetTMEM32() { return (UINT32*)m_tmem; }
|
||||
UINT16* GetTLUT() { return (UINT16*)(m_tmem + 0x800); }
|
||||
// Texture memory
|
||||
UINT8* get_tmem8() { return m_tmem; }
|
||||
UINT16* get_tmem16() { return (UINT16*)m_tmem; }
|
||||
|
||||
// Emulation Accelerators
|
||||
UINT8 GetRandom() { return MiscState.RandomSeed += 0x13; }
|
||||
// Emulation Accelerators
|
||||
UINT8 get_random() { return m_misc_state.m_random_seed += 0x13; }
|
||||
|
||||
// YUV Factors
|
||||
void SetYUVFactors(INT32 k0, INT32 k1, INT32 k2, INT32 k3, INT32 k4, INT32 k5) { m_k0 = k0; m_k1 = k1; m_k2 = k2; m_k3 = k3; m_k4 = k4; m_k5 = k5; }
|
||||
INT32 GetK0() const { return m_k0; }
|
||||
INT32 GetK1() const { return m_k1; }
|
||||
INT32 GetK2() const { return m_k2; }
|
||||
INT32 GetK3() const { return m_k3; }
|
||||
INT32* GetK4() { return &m_k4; }
|
||||
INT32* GetK5() { return &m_k5; }
|
||||
// YUV Factors
|
||||
void set_yuv_factors(INT32 k0, INT32 k1, INT32 k2, INT32 k3, INT32 k4, INT32 k5) { m_k0 = k0; m_k1 = k1; m_k2 = k2; m_k3 = k3; m_k4 = k4; m_k5 = k5; }
|
||||
INT32 get_k0() const { return m_k0; }
|
||||
INT32 get_k1() const { return m_k1; }
|
||||
INT32 get_k2() const { return m_k2; }
|
||||
INT32 get_k3() const { return m_k3; }
|
||||
INT32* get_k4() { return &m_k4; }
|
||||
INT32* get_k5() { return &m_k5; }
|
||||
|
||||
// Blender-related (move into RDP::Blender)
|
||||
void SetBlenderInput(int cycle, int which, UINT8 **input_r, UINT8 **input_g, UINT8 **input_b, UINT8 **input_a, int a, int b, rdp_span_aux *userdata);
|
||||
// Blender-related (move into RDP::Blender)
|
||||
void set_blender_input(INT32 cycle, INT32 which, UINT8** input_r, UINT8** input_g, UINT8** input_b, UINT8** input_a, INT32 a, INT32 b, rdp_span_aux* userdata);
|
||||
|
||||
// Span rasterization
|
||||
void SpanDraw1Cycle(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, int threadid);
|
||||
void SpanDraw2Cycle(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, int threadid);
|
||||
void SpanDrawCopy(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, int threadid);
|
||||
void SpanDrawFill(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, int threadid);
|
||||
// Span rasterization
|
||||
void span_draw_1cycle(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid);
|
||||
void span_draw_2cycle(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid);
|
||||
void span_draw_copy(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid);
|
||||
void span_draw_fill(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid);
|
||||
|
||||
// Render-related (move into eventual drawing-related classes?)
|
||||
void TCDiv(INT32 ss, INT32 st, INT32 sw, INT32* sss, INT32* sst);
|
||||
void TCDivNoPersp(INT32 ss, INT32 st, INT32 sw, INT32* sss, INT32* sst);
|
||||
UINT32 GetLog2(UINT32 lod_clamp);
|
||||
void RenderSpans(int start, int end, int tilenum, bool flip, extent_t *Spans, bool rect, rdp_poly_state *object);
|
||||
void GetAlphaCvg(UINT8 *comb_alpha, rdp_span_aux *userdata, const rdp_poly_state &object);
|
||||
const UINT8* GetBayerMatrix() const { return s_bayer_matrix; }
|
||||
const UINT8* GetMagicMatrix() const { return s_magic_matrix; }
|
||||
int GetCurrFIFOIndex() const { return m_cmd_cur; }
|
||||
// Render-related (move into eventual drawing-related classes?)
|
||||
void tc_div(INT32 ss, INT32 st, INT32 sw, INT32* sss, INT32* sst);
|
||||
void tc_div_no_perspective(INT32 ss, INT32 st, INT32 sw, INT32* sss, INT32* sst);
|
||||
UINT32 get_log2(UINT32 lod_clamp);
|
||||
void render_spans(INT32 start, INT32 end, INT32 tilenum, bool flip, extent_t* spans, bool rect, rdp_poly_state* object);
|
||||
void get_alpha_cvg(UINT8* comb_alpha, rdp_span_aux* userdata, const rdp_poly_state &object);
|
||||
|
||||
void ZStore(const rdp_poly_state &object, UINT32 zcurpixel, UINT32 dzcurpixel, UINT32 z, UINT32 enc);
|
||||
UINT32 ZDecompress(UINT32 zcurpixel);
|
||||
UINT32 DZDecompress(UINT32 zcurpixel, UINT32 dzcurpixel);
|
||||
UINT32 DZCompress(UINT32 value);
|
||||
INT32 NormalizeDZPix(INT32 sum);
|
||||
bool ZCompare(UINT32 zcurpixel, UINT32 dzcurpixel, UINT32 sz, UINT16 dzpix, rdp_span_aux *userdata, const rdp_poly_state &object);
|
||||
void z_store(const rdp_poly_state &object, UINT32 zcurpixel, UINT32 dzcurpixel, UINT32 z, UINT32 enc);
|
||||
UINT32 z_decompress(UINT32 zcurpixel);
|
||||
UINT32 dz_decompress(UINT32 zcurpixel, UINT32 dzcurpixel);
|
||||
UINT32 dz_compress(UINT32 value);
|
||||
INT32 normalize_dzpix(INT32 sum);
|
||||
bool z_compare(UINT32 zcurpixel, UINT32 dzcurpixel, UINT32 sz, UINT16 dzpix, rdp_span_aux* userdata, const rdp_poly_state &object);
|
||||
|
||||
// Fullscreen update-related
|
||||
void VideoUpdate(n64_periphs *n64, bitmap_rgb32 &bitmap);
|
||||
// Fullscreen update-related
|
||||
void video_update(n64_periphs* n64, bitmap_rgb32 &bitmap);
|
||||
|
||||
// Commands
|
||||
void CmdInvalid(UINT32 w1, UINT32 w2);
|
||||
void CmdNoOp(UINT32 w1, UINT32 w2);
|
||||
void CmdTriangle(UINT32 w1, UINT32 w2);
|
||||
void CmdTriangleZ(UINT32 w1, UINT32 w2);
|
||||
void CmdTriangleT(UINT32 w1, UINT32 w2);
|
||||
void CmdTriangleTZ(UINT32 w1, UINT32 w2);
|
||||
void CmdTriangleS(UINT32 w1, UINT32 w2);
|
||||
void CmdTriangleSZ(UINT32 w1, UINT32 w2);
|
||||
void CmdTriangleST(UINT32 w1, UINT32 w2);
|
||||
void CmdTriangleSTZ(UINT32 w1, UINT32 w2);
|
||||
void CmdTexRect(UINT32 w1, UINT32 w2);
|
||||
void CmdTexRectFlip(UINT32 w1, UINT32 w2);
|
||||
void CmdSyncLoad(UINT32 w1, UINT32 w2);
|
||||
void CmdSyncPipe(UINT32 w1, UINT32 w2);
|
||||
void CmdSyncTile(UINT32 w1, UINT32 w2);
|
||||
void CmdSyncFull(UINT32 w1, UINT32 w2);
|
||||
void CmdSetKeyGB(UINT32 w1, UINT32 w2);
|
||||
void CmdSetKeyR(UINT32 w1, UINT32 w2);
|
||||
void CmdSetFillColor32(UINT32 w1, UINT32 w2);
|
||||
void CmdSetConvert(UINT32 w1, UINT32 w2);
|
||||
void CmdSetScissor(UINT32 w1, UINT32 w2);
|
||||
void CmdSetPrimDepth(UINT32 w1, UINT32 w2);
|
||||
void CmdSetOtherModes(UINT32 w1, UINT32 w2);
|
||||
void CmdLoadTLUT(UINT32 w1, UINT32 w2);
|
||||
void CmdSetTileSize(UINT32 w1, UINT32 w2);
|
||||
void CmdLoadBlock(UINT32 w1, UINT32 w2);
|
||||
void CmdLoadTile(UINT32 w1, UINT32 w2);
|
||||
void CmdFillRect(UINT32 w1, UINT32 w2);
|
||||
void CmdSetTile(UINT32 w1, UINT32 w2);
|
||||
void CmdSetFogColor(UINT32 w1, UINT32 w2);
|
||||
void CmdSetBlendColor(UINT32 w1, UINT32 w2);
|
||||
void CmdSetPrimColor(UINT32 w1, UINT32 w2);
|
||||
void CmdSetEnvColor(UINT32 w1, UINT32 w2);
|
||||
void CmdSetCombine(UINT32 w1, UINT32 w2);
|
||||
void CmdSetTextureImage(UINT32 w1, UINT32 w2);
|
||||
void CmdSetMaskImage(UINT32 w1, UINT32 w2);
|
||||
void CmdSetColorImage(UINT32 w1, UINT32 w2);
|
||||
// Commands
|
||||
void cmd_invalid(UINT32 w1, UINT32 w2);
|
||||
void cmd_noop(UINT32 w1, UINT32 w2);
|
||||
void cmd_triangle(UINT32 w1, UINT32 w2);
|
||||
void cmd_triangle_z(UINT32 w1, UINT32 w2);
|
||||
void cmd_triangle_t(UINT32 w1, UINT32 w2);
|
||||
void cmd_triangle_tz(UINT32 w1, UINT32 w2);
|
||||
void cmd_triangle_s(UINT32 w1, UINT32 w2);
|
||||
void cmd_triangle_sz(UINT32 w1, UINT32 w2);
|
||||
void cmd_triangle_st(UINT32 w1, UINT32 w2);
|
||||
void cmd_triangle_stz(UINT32 w1, UINT32 w2);
|
||||
void cmd_tex_rect(UINT32 w1, UINT32 w2);
|
||||
void cmd_tex_rect_flip(UINT32 w1, UINT32 w2);
|
||||
void cmd_sync_load(UINT32 w1, UINT32 w2);
|
||||
void cmd_sync_pipe(UINT32 w1, UINT32 w2);
|
||||
void cmd_sync_tile(UINT32 w1, UINT32 w2);
|
||||
void cmd_sync_full(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_key_gb(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_key_r(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_fill_color32(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_convert(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_scissor(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_prim_depth(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_other_modes(UINT32 w1, UINT32 w2);
|
||||
void cmd_load_tlut(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_tile_size(UINT32 w1, UINT32 w2);
|
||||
void cmd_load_block(UINT32 w1, UINT32 w2);
|
||||
void cmd_load_tile(UINT32 w1, UINT32 w2);
|
||||
void cmd_fill_rect(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_tile(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_fog_color(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_blend_color(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_prim_color(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_env_color(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_combine(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_texture_image(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_mask_image(UINT32 w1, UINT32 w2);
|
||||
void cmd_set_color_image(UINT32 w1, UINT32 w2);
|
||||
|
||||
void RGBAZClip(int sr, int sg, int sb, int sa, int *sz, rdp_span_aux *userdata);
|
||||
void RGBAZCorrectTriangle(INT32 offx, INT32 offy, INT32* r, INT32* g, INT32* b, INT32* a, INT32* z, rdp_span_aux *userdata, const rdp_poly_state &object);
|
||||
void rgbaz_clip(INT32 sr, INT32 sg, INT32 sb, INT32 sa, INT32* sz, rdp_span_aux* userdata);
|
||||
void rgbaz_correct_triangle(INT32 offx, INT32 offy, INT32* r, INT32* g, INT32* b, INT32* a, INT32* z, rdp_span_aux* userdata, const rdp_poly_state &object);
|
||||
|
||||
void Triangle(bool shade, bool texture, bool zbuffer);
|
||||
UINT32 AddRightCvg(UINT32 x, UINT32 k);
|
||||
UINT32 AddLeftCvg(UINT32 x, UINT32 k);
|
||||
void triangle(bool shade, bool texture, bool zbuffer);
|
||||
|
||||
void GetDitherValues(int x, int y, int* cdith, int* adith, const rdp_poly_state &object);
|
||||
void get_dither_values(INT32 x, INT32 y, INT32* cdith, INT32* adith, const rdp_poly_state &object);
|
||||
|
||||
UINT16 decompress_cvmask_frombyte(UINT8 x);
|
||||
void lookup_cvmask_derivatives(UINT32 mask, UINT8* offx, UINT8* offy, rdp_span_aux *userdata);
|
||||
UINT16 decompress_cvmask_frombyte(UINT8 x);
|
||||
void lookup_cvmask_derivatives(UINT32 mask, UINT8* offx, UINT8* offy, rdp_span_aux* userdata);
|
||||
|
||||
MiscStateT MiscState;
|
||||
misc_state_t m_misc_state;
|
||||
|
||||
// Color constants
|
||||
Color BlendColor; /* constant blend color */
|
||||
Color PrimColor; /* flat primitive color */
|
||||
Color EnvColor; /* generic color constant ('environment') */
|
||||
Color FogColor; /* generic color constant ('fog') */
|
||||
Color KeyScale; /* color-keying constant */
|
||||
UINT8 LODFraction; /* Z-based LOD fraction for this poly */
|
||||
UINT8 PrimLODFraction; /* fixed LOD fraction for this poly */
|
||||
// Color constants
|
||||
color_t m_blend_color; /* constant blend color */
|
||||
color_t m_prim_color; /* flat primitive color */
|
||||
color_t m_env_color; /* generic color constant ('environment') */
|
||||
color_t m_fog_color; /* generic color constant ('fog') */
|
||||
color_t m_key_scale; /* color-keying constant */
|
||||
UINT8 m_lod_fraction; /* Z-based LOD fraction for this poly */
|
||||
UINT8 m_prim_lod_fraction; /* fixed LOD fraction for this poly */
|
||||
|
||||
Color OneColor;
|
||||
Color ZeroColor;
|
||||
color_t m_one;
|
||||
color_t m_zero;
|
||||
|
||||
UINT32 FillColor;
|
||||
UINT32 m_fill_color;
|
||||
|
||||
OtherModesT OtherModes;
|
||||
other_modes_t m_other_modes;
|
||||
|
||||
N64BlenderT Blender;
|
||||
n64_blender_t m_blender;
|
||||
|
||||
N64TexturePipeT TexPipe;
|
||||
n64_texture_pipe_t m_tex_pipe;
|
||||
|
||||
UINT8 HiddenBits[0x800000];
|
||||
UINT8 m_hidden_bits[0x800000];
|
||||
|
||||
UINT8 ReplicatedRGBA[32];
|
||||
UINT8 m_replicated_rgba[32];
|
||||
|
||||
UINT16 m_dzpix_normalize[0x10000];
|
||||
UINT16 m_dzpix_normalize[0x10000];
|
||||
|
||||
Rectangle Scissor;
|
||||
SpanBaseT SpanBase;
|
||||
rectangle_t m_scissor;
|
||||
span_base_t m_span_base;
|
||||
|
||||
rectangle visarea;
|
||||
rectangle m_visarea;
|
||||
|
||||
void DrawTriangle(bool shade, bool texture, bool zbuffer, bool rect);
|
||||
void compute_cvg_noflip(extent_t *Spans, INT32* majorx, INT32* minorx, INT32* majorxint, INT32* minorxint, INT32 scanline, INT32 yh, INT32 yl, INT32 base);
|
||||
void compute_cvg_flip(extent_t *Spans, INT32* majorx, INT32* minorx, INT32* majorxint, INT32* minorxint, INT32 scanline, INT32 yh, INT32 yl, INT32 base);
|
||||
void draw_triangle(bool shade, bool texture, bool zbuffer, bool rect);
|
||||
void compute_cvg_noflip(extent_t* spans, INT32* majorx, INT32* minorx, INT32* majorxint, INT32* minorxint, INT32 scanline, INT32 yh, INT32 yl, INT32 base);
|
||||
void compute_cvg_flip(extent_t* spans, INT32* majorx, INT32* minorx, INT32* majorxint, INT32* minorxint, INT32 scanline, INT32 yh, INT32 yl, INT32 base);
|
||||
|
||||
void* AuxBuf;
|
||||
UINT32 AuxBufPtr;
|
||||
UINT32 AuxBufIndex;
|
||||
void* m_aux_buf;
|
||||
UINT32 m_aux_buf_ptr;
|
||||
UINT32 m_aux_buf_index;
|
||||
|
||||
void* ExtentBuf[2];
|
||||
UINT32 ExtentBufPtr[2];
|
||||
UINT32 ExtentBufIndex;
|
||||
bool rdp_range_check(UINT32 addr);
|
||||
|
||||
bool rdp_range_check(UINT32 addr);
|
||||
n64_tile_t m_tiles[8];
|
||||
|
||||
N64Tile m_tiles[8];
|
||||
private:
|
||||
void write_pixel(UINT32 curpixel, INT32 r, INT32 g, INT32 b, rdp_span_aux* userdata, const rdp_poly_state &object);
|
||||
void read_pixel(UINT32 curpixel, rdp_span_aux* userdata, const rdp_poly_state &object);
|
||||
void copy_pixel(UINT32 curpixel, INT32 r, INT32 g, INT32 b, INT32 m_current_pix_cvg, const rdp_poly_state &object);
|
||||
void fill_pixel(UINT32 curpixel, const rdp_poly_state &object);
|
||||
|
||||
protected:
|
||||
CombineModesT m_combine;
|
||||
bool m_pending_mode_block;
|
||||
bool m_pipe_clean;
|
||||
void precalc_cvmask_derivatives(void);
|
||||
void z_build_com_table(void);
|
||||
|
||||
struct CVMASKDERIVATIVE
|
||||
{
|
||||
UINT8 cvg;
|
||||
UINT8 cvbit;
|
||||
UINT8 xoff;
|
||||
UINT8 yoff;
|
||||
};
|
||||
CVMASKDERIVATIVE cvarray[(1 << 8)];
|
||||
void video_update16(n64_periphs* n64, bitmap_rgb32 &bitmap);
|
||||
void video_update32(n64_periphs* n64, bitmap_rgb32 &bitmap);
|
||||
|
||||
UINT16 z_com_table[0x40000]; //precalced table of compressed z values, 18b: 512 KB array!
|
||||
UINT32 z_complete_dec_table[0x4000]; //the same for decompressed z values, 14b
|
||||
UINT8 compressed_cvmasks[0x10000]; //16bit cvmask -> to byte
|
||||
running_machine* m_machine;
|
||||
|
||||
UINT32 m_cmd_data[0x1000];
|
||||
UINT32 m_temp_rect_data[0x1000];
|
||||
combine_modes_t m_combine;
|
||||
bool m_pending_mode_block;
|
||||
bool m_pipe_clean;
|
||||
|
||||
int m_cmd_ptr;
|
||||
int m_cmd_cur;
|
||||
cv_mask_derivative_t cvarray[(1 << 8)];
|
||||
|
||||
UINT32 m_start;
|
||||
UINT32 m_end;
|
||||
UINT32 m_current;
|
||||
UINT32 m_status;
|
||||
UINT16 m_z_com_table[0x40000]; //precalced table of compressed z values, 18b: 512 KB array!
|
||||
UINT32 m_z_complete_dec_table[0x4000]; //the same for decompressed z values, 14b
|
||||
UINT8 m_compressed_cvmasks[0x10000]; //16bit cvmask -> to byte
|
||||
|
||||
UINT8* m_tmem;
|
||||
UINT32 m_cmd_data[0x1000];
|
||||
UINT32 m_temp_rect_data[0x1000];
|
||||
|
||||
running_machine* m_machine;
|
||||
INT32 m_cmd_ptr;
|
||||
INT32 m_cmd_cur;
|
||||
|
||||
// YUV factors
|
||||
INT32 m_k0;
|
||||
INT32 m_k1;
|
||||
INT32 m_k2;
|
||||
INT32 m_k3;
|
||||
INT32 m_k4;
|
||||
INT32 m_k5;
|
||||
UINT32 m_start;
|
||||
UINT32 m_end;
|
||||
UINT32 m_current;
|
||||
UINT32 m_status;
|
||||
|
||||
// Texture perspective division
|
||||
INT32 m_norm_point_rom[64];
|
||||
INT32 m_norm_slope_rom[64];
|
||||
UINT8* m_tmem;
|
||||
|
||||
static const UINT8 s_bayer_matrix[16];
|
||||
static const UINT8 s_magic_matrix[16];
|
||||
// YUV factors
|
||||
INT32 m_k0;
|
||||
INT32 m_k1;
|
||||
INT32 m_k2;
|
||||
INT32 m_k3;
|
||||
INT32 m_k4;
|
||||
INT32 m_k5;
|
||||
|
||||
INT32 m_gamma_table[256];
|
||||
INT32 m_gamma_dither_table[0x4000];
|
||||
// Texture perspective division
|
||||
INT32 m_norm_point_rom[64];
|
||||
INT32 m_norm_slope_rom[64];
|
||||
|
||||
static UINT32 s_special_9bit_clamptable[512];
|
||||
INT32 m_gamma_table[256];
|
||||
INT32 m_gamma_dither_table[0x4000];
|
||||
|
||||
Copier _Copy[2];
|
||||
Filler _Fill[2];
|
||||
static UINT32 s_special_9bit_clamptable[512];
|
||||
static const z_decompress_entry_t m_z_dec_table[8];
|
||||
|
||||
void write_pixel(UINT32 curpixel, INT32 r, INT32 g, INT32 b, rdp_span_aux *userdata, const rdp_poly_state &object);
|
||||
void read_pixel(UINT32 curpixel, rdp_span_aux *userdata, const rdp_poly_state &object);
|
||||
void copy_pixel(UINT32 curpixel, INT32 r, INT32 g, INT32 b, int CurrentPixCvg, const rdp_poly_state &object);
|
||||
void fill_pixel(UINT32 curpixel, const rdp_poly_state &object);
|
||||
|
||||
class ZDecompressEntry
|
||||
{
|
||||
public:
|
||||
UINT32 shift;
|
||||
UINT32 add;
|
||||
};
|
||||
|
||||
void precalc_cvmask_derivatives(void);
|
||||
void z_build_com_table(void);
|
||||
static const ZDecompressEntry z_dec_table[8];
|
||||
|
||||
// Internal screen-update functions
|
||||
void VideoUpdate16(n64_periphs *n64, bitmap_rgb32 &bitmap);
|
||||
void VideoUpdate32(n64_periphs *n64, bitmap_rgb32 &bitmap);
|
||||
|
||||
typedef void (*Command)(UINT32 w1, UINT32 w2);
|
||||
|
||||
static const Command m_commands[0x40];
|
||||
static const UINT8 s_bayer_matrix[16];
|
||||
static const UINT8 s_magic_matrix[16];
|
||||
static const rdp_command_t m_commands[0x40];
|
||||
static const INT32 s_rdp_command_length[];
|
||||
static const char* s_image_format[];
|
||||
static const char* s_image_size[];
|
||||
};
|
||||
|
||||
#endif // _VIDEO_N64_H_
|
||||
|
@ -11,161 +11,3 @@
|
||||
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef _VIDEO_RDPBHELP_H_
|
||||
#define _VIDEO_RDPBHELP_H_
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/n64.h"
|
||||
#include "video/n64.h"
|
||||
|
||||
#define DITHER_A(val, dith) \
|
||||
if ((val + dith) >= 0x100) \
|
||||
{ \
|
||||
val = 0xff; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
val += dith; \
|
||||
}
|
||||
|
||||
#define DITHER_CHAN(chan, dith) \
|
||||
if ((chan & 7) > dith) \
|
||||
{ \
|
||||
chan = (chan & 0xf8) + 8; \
|
||||
if (chan > 247) \
|
||||
{ \
|
||||
chan = 255; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define DITHER_RGB(dith) \
|
||||
DITHER_CHAN(r, dith) \
|
||||
DITHER_CHAN(g, dith) \
|
||||
DITHER_CHAN(b, dith)
|
||||
|
||||
#define ALPHA_COMPARE() \
|
||||
if (((this)->*(compare[acmode]))(userdata->PixelColor.i.a, userdata, object)) \
|
||||
{ \
|
||||
return false; \
|
||||
}
|
||||
|
||||
#define CVG_COMPARE() \
|
||||
if (object.OtherModes.antialias_en ? (!userdata->CurrentPixCvg) : (!userdata->CurrentCvgBit)) \
|
||||
{ \
|
||||
return false; \
|
||||
}
|
||||
|
||||
#define TEST_REJECT() \
|
||||
ALPHA_COMPARE(); \
|
||||
CVG_COMPARE();
|
||||
|
||||
#define WRITE_OUT_NB_ND(cycle) \
|
||||
*fr = *userdata->ColorInputs.blender1a_r[cycle]; \
|
||||
*fg = *userdata->ColorInputs.blender1a_g[cycle]; \
|
||||
*fb = *userdata->ColorInputs.blender1a_b[cycle];
|
||||
|
||||
#define WRITE_OUT() \
|
||||
*fr = r; \
|
||||
*fg = g; \
|
||||
*fb = b;
|
||||
|
||||
#define WRITE_BLENDED_COLOR() \
|
||||
userdata->BlendedPixelColor.i.r = r; \
|
||||
userdata->BlendedPixelColor.i.g = g; \
|
||||
userdata->BlendedPixelColor.i.b = b; \
|
||||
userdata->BlendedPixelColor.i.a = userdata->PixelColor.i.a;
|
||||
|
||||
#define BLEND_CYCLE0(cyc) \
|
||||
userdata->InvPixelColor.i.a = 0xff - *userdata->ColorInputs.blender1b_a[cyc]; \
|
||||
((this)->*(cycle##cyc[sel##cyc]))(&r, &g, &b, userdata, object);
|
||||
#define BLEND_CYCLE1(cyc) \
|
||||
if (partialreject && userdata->PixelColor.i.a >= 0xff) \
|
||||
{ \
|
||||
ASSIGN_OUT(cyc); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
userdata->InvPixelColor.i.a = 0xff - *userdata->ColorInputs.blender1b_a[cyc]; \
|
||||
((this)->*(cycle##cyc[sel##cyc]))(&r, &g, &b, userdata, object); \
|
||||
}
|
||||
|
||||
#define BLEND_CYCLE(cyc, check_reject) \
|
||||
BLEND_CYCLE##check_reject(cyc)
|
||||
|
||||
#define BLEND_FACTORS0(cycle) \
|
||||
UINT8 blend1a = *userdata->ColorInputs.blender1b_a[cycle] >> 3; \
|
||||
UINT8 blend2a = *userdata->ColorInputs.blender2b_a[cycle] >> 3;
|
||||
|
||||
#define BLEND_FACTORS1(cycle) \
|
||||
UINT8 blend1a = (*userdata->ColorInputs.blender1b_a[cycle] >> (3 + userdata->ShiftA)) & 0x1c; \
|
||||
UINT8 blend2a = (*userdata->ColorInputs.blender2b_a[cycle] >> (3 + userdata->ShiftB)) & 0x1c;
|
||||
|
||||
#define BLEND_SUM0() ;
|
||||
|
||||
#define BLEND_SUM1() \
|
||||
UINT32 sum = ((blend1a >> 2) + (blend2a >> 2) + 1) & 0xf;
|
||||
|
||||
#define BLEND_FACTORS(cycle, special, sum) \
|
||||
BLEND_FACTORS##special(cycle); \
|
||||
BLEND_SUM##sum();
|
||||
|
||||
#define BLEND_MUL(cycle) \
|
||||
*r = (((int)(*userdata->ColorInputs.blender1a_r[cycle]) * (int)(blend1a))) + \
|
||||
(((int)(*userdata->ColorInputs.blender2a_r[cycle]) * (int)(blend2a))); \
|
||||
*g = (((int)(*userdata->ColorInputs.blender1a_g[cycle]) * (int)(blend1a))) + \
|
||||
(((int)(*userdata->ColorInputs.blender2a_g[cycle]) * (int)(blend2a))); \
|
||||
*b = (((int)(*userdata->ColorInputs.blender1a_b[cycle]) * (int)(blend1a))) + \
|
||||
(((int)(*userdata->ColorInputs.blender2a_b[cycle]) * (int)(blend2a)));
|
||||
|
||||
#define BLEND_ADD1(cycle) \
|
||||
*r += (((int)*userdata->ColorInputs.blender2a_r[cycle]) << 2); \
|
||||
*g += (((int)*userdata->ColorInputs.blender2a_g[cycle]) << 2); \
|
||||
*b += (((int)*userdata->ColorInputs.blender2a_b[cycle]) << 2);
|
||||
|
||||
#define BLEND_ADD0(cycle) \
|
||||
*r += (int)*userdata->ColorInputs.blender2a_r[cycle]; \
|
||||
*g += (int)*userdata->ColorInputs.blender2a_g[cycle]; \
|
||||
*b += (int)*userdata->ColorInputs.blender2a_b[cycle];
|
||||
|
||||
#define BLEND_ADD(cycle, special) \
|
||||
BLEND_ADD##special(cycle);
|
||||
|
||||
#define BLEND_SHIFT(shift) \
|
||||
*r >>= shift; \
|
||||
*g >>= shift; \
|
||||
*b >>= shift;
|
||||
|
||||
#define BLEND_CLAMP() \
|
||||
if (*r > 255) *r = 255; \
|
||||
if (*g > 255) *g = 255; \
|
||||
if (*b > 255) *b = 255;
|
||||
|
||||
#define BLEND_SCALE() \
|
||||
if (sum) \
|
||||
{ \
|
||||
*r /= sum; \
|
||||
*g /= sum; \
|
||||
*b /= sum; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
*r = *g = *b = 0xff; \
|
||||
}
|
||||
|
||||
#define BLEND_SCALE_CLAMP0() \
|
||||
BLEND_CLAMP();
|
||||
|
||||
#define BLEND_SCALE_CLAMP1() \
|
||||
BLEND_SCALE(); \
|
||||
BLEND_CLAMP();
|
||||
|
||||
#define BLEND_SCALE_CLAMP(sum) \
|
||||
BLEND_SCALE_CLAMP##sum();
|
||||
|
||||
#define ASSIGN_OUT(cycle) \
|
||||
r = *userdata->ColorInputs.blender1a_r[cycle]; \
|
||||
g = *userdata->ColorInputs.blender1a_g[cycle]; \
|
||||
b = *userdata->ColorInputs.blender1a_b[cycle];
|
||||
|
||||
#endif // _VIDEO_RDPBHELP_H_
|
||||
|
@ -18,25 +18,25 @@
|
||||
#include "video/n64.h"
|
||||
#include "video/rdpbhelp.h"
|
||||
|
||||
N64BlenderT::N64BlenderT()
|
||||
n64_blender_t::n64_blender_t()
|
||||
{
|
||||
blend1[0] = &N64BlenderT::Blend1CycleNoBlendNoACVGNoDither;
|
||||
blend1[1] = &N64BlenderT::Blend1CycleNoBlendNoACVGDither;
|
||||
blend1[2] = &N64BlenderT::Blend1CycleNoBlendACVGNoDither;
|
||||
blend1[3] = &N64BlenderT::Blend1CycleNoBlendACVGDither;
|
||||
blend1[4] = &N64BlenderT::Blend1CycleBlendNoACVGNoDither;
|
||||
blend1[5] = &N64BlenderT::Blend1CycleBlendNoACVGDither;
|
||||
blend1[6] = &N64BlenderT::Blend1CycleBlendACVGNoDither;
|
||||
blend1[7] = &N64BlenderT::Blend1CycleBlendACVGDither;
|
||||
blend1[0] = &n64_blender_t::cycle1_noblend_noacvg_nodither;
|
||||
blend1[1] = &n64_blender_t::cycle1_noblend_noacvg_dither;
|
||||
blend1[2] = &n64_blender_t::cycle1_noblend_acvg_nodither;
|
||||
blend1[3] = &n64_blender_t::cycle1_noblend_acvg_dither;
|
||||
blend1[4] = &n64_blender_t::cycle1_blend_noacvg_nodither;
|
||||
blend1[5] = &n64_blender_t::cycle1_blend_noacvg_dither;
|
||||
blend1[6] = &n64_blender_t::cycle1_blend_acvg_nodither;
|
||||
blend1[7] = &n64_blender_t::cycle1_blend_acvg_dither;
|
||||
|
||||
blend2[0] = &N64BlenderT::Blend2CycleNoBlendNoACVGNoDither;
|
||||
blend2[1] = &N64BlenderT::Blend2CycleNoBlendNoACVGDither;
|
||||
blend2[2] = &N64BlenderT::Blend2CycleNoBlendACVGNoDither;
|
||||
blend2[3] = &N64BlenderT::Blend2CycleNoBlendACVGDither;
|
||||
blend2[4] = &N64BlenderT::Blend2CycleBlendNoACVGNoDither;
|
||||
blend2[5] = &N64BlenderT::Blend2CycleBlendNoACVGDither;
|
||||
blend2[6] = &N64BlenderT::Blend2CycleBlendACVGNoDither;
|
||||
blend2[7] = &N64BlenderT::Blend2CycleBlendACVGDither;
|
||||
blend2[0] = &n64_blender_t::cycle2_noblend_noacvg_nodither;
|
||||
blend2[1] = &n64_blender_t::cycle2_noblend_noacvg_dither;
|
||||
blend2[2] = &n64_blender_t::cycle2_noblend_acvg_nodither;
|
||||
blend2[3] = &n64_blender_t::cycle2_noblend_acvg_dither;
|
||||
blend2[4] = &n64_blender_t::cycle2_blend_noacvg_nodither;
|
||||
blend2[5] = &n64_blender_t::cycle2_blend_noacvg_dither;
|
||||
blend2[6] = &n64_blender_t::cycle2_blend_acvg_nodither;
|
||||
blend2[7] = &n64_blender_t::cycle2_blend_acvg_dither;
|
||||
|
||||
for (int value = 0; value < 256; value++)
|
||||
{
|
||||
@ -48,12 +48,12 @@ N64BlenderT::N64BlenderT()
|
||||
}
|
||||
}
|
||||
|
||||
INT32 N64BlenderT::dither_alpha(INT32 alpha, INT32 dither)
|
||||
INT32 n64_blender_t::dither_alpha(INT32 alpha, INT32 dither)
|
||||
{
|
||||
return min(alpha + dither, 0xff);
|
||||
}
|
||||
|
||||
INT32 N64BlenderT::dither_color(INT32 color, INT32 dither)
|
||||
INT32 n64_blender_t::dither_color(INT32 color, INT32 dither)
|
||||
{
|
||||
if ((color & 7) > dither)
|
||||
{
|
||||
@ -66,104 +66,104 @@ INT32 N64BlenderT::dither_color(INT32 color, INT32 dither)
|
||||
return color;
|
||||
}
|
||||
|
||||
bool N64BlenderT::test_for_reject(rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::test_for_reject(rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
if (alpha_reject(userdata, object))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (object.OtherModes.antialias_en ? !userdata->CurrentPixCvg : !userdata->CurrentCvgBit)
|
||||
if (object.m_other_modes.antialias_en ? !userdata->m_current_pix_cvg : !userdata->m_current_cvg_bit)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool N64BlenderT::alpha_reject(rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::alpha_reject(rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
switch (object.OtherModes.alpha_dither_mode)
|
||||
switch (object.m_other_modes.alpha_dither_mode)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
return false;
|
||||
|
||||
case 2:
|
||||
return userdata->PixelColor.i.a < userdata->BlendColor.i.a;
|
||||
return userdata->m_pixel_color.i.a < userdata->m_blend_color.i.a;
|
||||
|
||||
case 3:
|
||||
return userdata->PixelColor.i.a < (rand() & 0xff);
|
||||
return userdata->m_pixel_color.i.a < (rand() & 0xff);
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend1CycleNoBlendNoACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle1_noblend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
userdata->PixelColor.i.a = m_alpha_dither[(userdata->PixelColor.i.a << 3) | adseed];
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
*fr = *userdata->ColorInputs.blender1a_r[0];
|
||||
*fg = *userdata->ColorInputs.blender1a_g[0];
|
||||
*fb = *userdata->ColorInputs.blender1a_b[0];
|
||||
*fr = *userdata->m_color_inputs.blender1a_r[0];
|
||||
*fg = *userdata->m_color_inputs.blender1a_g[0];
|
||||
*fb = *userdata->m_color_inputs.blender1a_b[0];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend1CycleNoBlendNoACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle1_noblend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
userdata->PixelColor.i.a = m_alpha_dither[(userdata->PixelColor.i.a << 3) | adseed];
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
*fr = m_color_dither[((*userdata->ColorInputs.blender1a_r[0] & 0xff) << 3) | dith];
|
||||
*fg = m_color_dither[((*userdata->ColorInputs.blender1a_g[0] & 0xff) << 3) | dith];
|
||||
*fb = m_color_dither[((*userdata->ColorInputs.blender1a_b[0] & 0xff) << 3) | dith];
|
||||
*fr = m_color_dither[((*userdata->m_color_inputs.blender1a_r[0] & 0xff) << 3) | dith];
|
||||
*fg = m_color_dither[((*userdata->m_color_inputs.blender1a_g[0] & 0xff) << 3) | dith];
|
||||
*fb = m_color_dither[((*userdata->m_color_inputs.blender1a_b[0] & 0xff) << 3) | dith];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend1CycleNoBlendACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle1_noblend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
*fr = *userdata->ColorInputs.blender1a_r[0];
|
||||
*fg = *userdata->ColorInputs.blender1a_g[0];
|
||||
*fb = *userdata->ColorInputs.blender1a_b[0];
|
||||
*fr = *userdata->m_color_inputs.blender1a_r[0];
|
||||
*fg = *userdata->m_color_inputs.blender1a_g[0];
|
||||
*fb = *userdata->m_color_inputs.blender1a_b[0];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend1CycleNoBlendACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle1_noblend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
*fr = m_color_dither[((*userdata->ColorInputs.blender1a_r[0] & 0xff) << 3) | dith];
|
||||
*fg = m_color_dither[((*userdata->ColorInputs.blender1a_g[0] & 0xff) << 3) | dith];
|
||||
*fb = m_color_dither[((*userdata->ColorInputs.blender1a_b[0] & 0xff) << 3) | dith];
|
||||
*fr = m_color_dither[((*userdata->m_color_inputs.blender1a_r[0] & 0xff) << 3) | dith];
|
||||
*fg = m_color_dither[((*userdata->m_color_inputs.blender1a_g[0] & 0xff) << 3) | dith];
|
||||
*fb = m_color_dither[((*userdata->m_color_inputs.blender1a_b[0] & 0xff) << 3) | dith];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend1CycleBlendNoACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle1_blend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
INT32 r, g, b;
|
||||
|
||||
userdata->PixelColor.i.a = m_alpha_dither[(userdata->PixelColor.i.a << 3) | adseed];
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
@ -179,12 +179,12 @@ bool N64BlenderT::Blend1CycleBlendNoACVGNoDither(INT32* fr, INT32* fg, INT32* fb
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend1CycleBlendNoACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle1_blend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
INT32 r, g, b;
|
||||
|
||||
userdata->PixelColor.i.a = m_alpha_dither[(userdata->PixelColor.i.a << 3) | adseed];
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
@ -200,11 +200,11 @@ bool N64BlenderT::Blend1CycleBlendNoACVGDither(INT32* fr, INT32* fg, INT32* fb,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend1CycleBlendACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle1_blend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
INT32 r, g, b;
|
||||
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
@ -220,11 +220,11 @@ bool N64BlenderT::Blend1CycleBlendACVGNoDither(INT32* fr, INT32* fg, INT32* fb,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend1CycleBlendACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle1_blend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
INT32 r, g, b;
|
||||
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
@ -240,127 +240,127 @@ bool N64BlenderT::Blend1CycleBlendACVGDither(INT32* fr, INT32* fg, INT32* fb, in
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend2CycleNoBlendNoACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle2_noblend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
INT32 r, g, b;
|
||||
|
||||
userdata->PixelColor.i.a = m_alpha_dither[(userdata->PixelColor.i.a << 3) | adseed];
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
userdata->InvPixelColor.i.a = 0xff - *userdata->ColorInputs.blender1b_a[0];
|
||||
userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
|
||||
blend_pipe(0, sel0, &r, &g, &b, userdata, object);
|
||||
|
||||
userdata->BlendedPixelColor.i.r = r;
|
||||
userdata->BlendedPixelColor.i.g = g;
|
||||
userdata->BlendedPixelColor.i.b = b;
|
||||
userdata->BlendedPixelColor.i.a = userdata->PixelColor.i.a;
|
||||
*fr = *userdata->ColorInputs.blender1a_r[1];
|
||||
*fg = *userdata->ColorInputs.blender1a_g[1];
|
||||
*fb = *userdata->ColorInputs.blender1a_b[1];
|
||||
userdata->m_blended_pixel_color.i.r = r;
|
||||
userdata->m_blended_pixel_color.i.g = g;
|
||||
userdata->m_blended_pixel_color.i.b = b;
|
||||
userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
|
||||
*fr = *userdata->m_color_inputs.blender1a_r[1];
|
||||
*fg = *userdata->m_color_inputs.blender1a_g[1];
|
||||
*fb = *userdata->m_color_inputs.blender1a_b[1];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend2CycleNoBlendNoACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle2_noblend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
INT32 r, g, b;
|
||||
|
||||
userdata->PixelColor.i.a = m_alpha_dither[(userdata->PixelColor.i.a << 3) | adseed];
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
userdata->InvPixelColor.i.a = 0xff - *userdata->ColorInputs.blender1b_a[0];
|
||||
userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
|
||||
blend_pipe(0, sel0, &r, &g, &b, userdata, object);
|
||||
|
||||
userdata->BlendedPixelColor.i.r = r;
|
||||
userdata->BlendedPixelColor.i.g = g;
|
||||
userdata->BlendedPixelColor.i.b = b;
|
||||
userdata->BlendedPixelColor.i.a = userdata->PixelColor.i.a;
|
||||
*fr = m_color_dither[((*userdata->ColorInputs.blender1a_r[1] & 0xff) << 3) | dith];
|
||||
*fg = m_color_dither[((*userdata->ColorInputs.blender1a_g[1] & 0xff) << 3) | dith];
|
||||
*fb = m_color_dither[((*userdata->ColorInputs.blender1a_b[1] & 0xff) << 3) | dith];
|
||||
userdata->m_blended_pixel_color.i.r = r;
|
||||
userdata->m_blended_pixel_color.i.g = g;
|
||||
userdata->m_blended_pixel_color.i.b = b;
|
||||
userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
|
||||
*fr = m_color_dither[((*userdata->m_color_inputs.blender1a_r[1] & 0xff) << 3) | dith];
|
||||
*fg = m_color_dither[((*userdata->m_color_inputs.blender1a_g[1] & 0xff) << 3) | dith];
|
||||
*fb = m_color_dither[((*userdata->m_color_inputs.blender1a_b[1] & 0xff) << 3) | dith];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend2CycleNoBlendACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle2_noblend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
INT32 r, g, b;
|
||||
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
userdata->InvPixelColor.i.a = 0xff - *userdata->ColorInputs.blender1b_a[0];
|
||||
userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
|
||||
blend_pipe(0, sel0, &r, &g, &b, userdata, object);
|
||||
|
||||
userdata->BlendedPixelColor.i.r = r;
|
||||
userdata->BlendedPixelColor.i.g = g;
|
||||
userdata->BlendedPixelColor.i.b = b;
|
||||
userdata->BlendedPixelColor.i.a = userdata->PixelColor.i.a;
|
||||
*fr = *userdata->ColorInputs.blender1a_r[1];
|
||||
*fg = *userdata->ColorInputs.blender1a_g[1];
|
||||
*fb = *userdata->ColorInputs.blender1a_b[1];
|
||||
userdata->m_blended_pixel_color.i.r = r;
|
||||
userdata->m_blended_pixel_color.i.g = g;
|
||||
userdata->m_blended_pixel_color.i.b = b;
|
||||
userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
|
||||
*fr = *userdata->m_color_inputs.blender1a_r[1];
|
||||
*fg = *userdata->m_color_inputs.blender1a_g[1];
|
||||
*fb = *userdata->m_color_inputs.blender1a_b[1];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend2CycleNoBlendACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle2_noblend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
INT32 r, g, b;
|
||||
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
userdata->InvPixelColor.i.a = 0xff - *userdata->ColorInputs.blender1b_a[0];
|
||||
userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
|
||||
blend_pipe(0, sel0, &r, &g, &b, userdata, object);
|
||||
|
||||
userdata->BlendedPixelColor.i.r = r;
|
||||
userdata->BlendedPixelColor.i.g = g;
|
||||
userdata->BlendedPixelColor.i.b = b;
|
||||
userdata->BlendedPixelColor.i.a = userdata->PixelColor.i.a;
|
||||
*fr = m_color_dither[((*userdata->ColorInputs.blender1a_r[1] & 0xff) << 3) | dith];
|
||||
*fg = m_color_dither[((*userdata->ColorInputs.blender1a_g[1] & 0xff) << 3) | dith];
|
||||
*fb = m_color_dither[((*userdata->ColorInputs.blender1a_b[1] & 0xff) << 3) | dith];
|
||||
userdata->m_blended_pixel_color.i.r = r;
|
||||
userdata->m_blended_pixel_color.i.g = g;
|
||||
userdata->m_blended_pixel_color.i.b = b;
|
||||
userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
|
||||
*fr = m_color_dither[((*userdata->m_color_inputs.blender1a_r[1] & 0xff) << 3) | dith];
|
||||
*fg = m_color_dither[((*userdata->m_color_inputs.blender1a_g[1] & 0xff) << 3) | dith];
|
||||
*fb = m_color_dither[((*userdata->m_color_inputs.blender1a_b[1] & 0xff) << 3) | dith];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend2CycleBlendNoACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle2_blend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
INT32 r, g, b;
|
||||
|
||||
userdata->PixelColor.i.a = m_alpha_dither[(userdata->PixelColor.i.a << 3) | adseed];
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
userdata->InvPixelColor.i.a = 0xff - *userdata->ColorInputs.blender1b_a[0];
|
||||
userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
|
||||
blend_pipe(0, sel0, &r, &g, &b, userdata, object);
|
||||
|
||||
userdata->BlendedPixelColor.i.r = r;
|
||||
userdata->BlendedPixelColor.i.g = g;
|
||||
userdata->BlendedPixelColor.i.b = b;
|
||||
userdata->BlendedPixelColor.i.a = userdata->PixelColor.i.a;
|
||||
userdata->m_blended_pixel_color.i.r = r;
|
||||
userdata->m_blended_pixel_color.i.g = g;
|
||||
userdata->m_blended_pixel_color.i.b = b;
|
||||
userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
|
||||
|
||||
blend_with_partial_reject(&r, &g, &b, 1, partialreject, sel1, userdata, object);
|
||||
|
||||
@ -371,25 +371,25 @@ bool N64BlenderT::Blend2CycleBlendNoACVGNoDither(INT32* fr, INT32* fg, INT32* fb
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend2CycleBlendNoACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle2_blend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
INT32 r, g, b;
|
||||
|
||||
userdata->PixelColor.i.a = m_alpha_dither[(userdata->PixelColor.i.a << 3) | adseed];
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
userdata->InvPixelColor.i.a = 0xff - *userdata->ColorInputs.blender1b_a[0];
|
||||
userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
|
||||
blend_pipe(0, sel0, &r, &g, &b, userdata, object);
|
||||
|
||||
userdata->BlendedPixelColor.i.r = r;
|
||||
userdata->BlendedPixelColor.i.g = g;
|
||||
userdata->BlendedPixelColor.i.b = b;
|
||||
userdata->BlendedPixelColor.i.a = userdata->PixelColor.i.a;
|
||||
userdata->m_blended_pixel_color.i.r = r;
|
||||
userdata->m_blended_pixel_color.i.g = g;
|
||||
userdata->m_blended_pixel_color.i.b = b;
|
||||
userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
|
||||
|
||||
blend_with_partial_reject(&r, &g, &b, 1, partialreject, sel1, userdata, object);
|
||||
|
||||
@ -400,24 +400,24 @@ bool N64BlenderT::Blend2CycleBlendNoACVGDither(INT32* fr, INT32* fg, INT32* fb,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend2CycleBlendACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle2_blend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
INT32 r, g, b;
|
||||
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
userdata->InvPixelColor.i.a = 0xff - *userdata->ColorInputs.blender1b_a[0];
|
||||
userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
|
||||
blend_pipe(0, sel0, &r, &g, &b, userdata, object);
|
||||
|
||||
userdata->BlendedPixelColor.i.r = r;
|
||||
userdata->BlendedPixelColor.i.g = g;
|
||||
userdata->BlendedPixelColor.i.b = b;
|
||||
userdata->BlendedPixelColor.i.a = userdata->PixelColor.i.a;
|
||||
userdata->m_blended_pixel_color.i.r = r;
|
||||
userdata->m_blended_pixel_color.i.g = g;
|
||||
userdata->m_blended_pixel_color.i.b = b;
|
||||
userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
|
||||
|
||||
blend_with_partial_reject(&r, &g, &b, 1, partialreject, sel1, userdata, object);
|
||||
|
||||
@ -428,24 +428,24 @@ bool N64BlenderT::Blend2CycleBlendACVGNoDither(INT32* fr, INT32* fg, INT32* fb,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool N64BlenderT::Blend2CycleBlendACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
bool n64_blender_t::cycle2_blend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
INT32 r, g, b;
|
||||
|
||||
userdata->ShadeColor.i.a = m_alpha_dither[(userdata->ShadeColor.i.a << 3) | adseed];
|
||||
userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
|
||||
|
||||
if (test_for_reject(userdata, object))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
userdata->InvPixelColor.i.a = 0xff - *userdata->ColorInputs.blender1b_a[0];
|
||||
userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
|
||||
blend_pipe(0, sel0, &r, &g, &b, userdata, object);
|
||||
|
||||
userdata->BlendedPixelColor.i.r = r;
|
||||
userdata->BlendedPixelColor.i.g = g;
|
||||
userdata->BlendedPixelColor.i.b = b;
|
||||
userdata->BlendedPixelColor.i.a = userdata->PixelColor.i.a;
|
||||
userdata->m_blended_pixel_color.i.r = r;
|
||||
userdata->m_blended_pixel_color.i.g = g;
|
||||
userdata->m_blended_pixel_color.i.b = b;
|
||||
userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
|
||||
|
||||
blend_with_partial_reject(&r, &g, &b, 1, partialreject, sel1, userdata, object);
|
||||
|
||||
@ -456,43 +456,43 @@ bool N64BlenderT::Blend2CycleBlendACVGDither(INT32* fr, INT32* fg, INT32* fb, in
|
||||
return true;
|
||||
}
|
||||
|
||||
void N64BlenderT::blend_with_partial_reject(INT32* r, INT32* g, INT32* b, INT32 cycle, INT32 partialreject, INT32 select, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
void n64_blender_t::blend_with_partial_reject(INT32* r, INT32* g, INT32* b, INT32 cycle, INT32 partialreject, INT32 select, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
if (partialreject && userdata->PixelColor.i.a >= 0xff)
|
||||
if (partialreject && userdata->m_pixel_color.i.a >= 0xff)
|
||||
{
|
||||
*r = *userdata->ColorInputs.blender1a_r[cycle];
|
||||
*g = *userdata->ColorInputs.blender1a_g[cycle];
|
||||
*b = *userdata->ColorInputs.blender1a_b[cycle];
|
||||
*r = *userdata->m_color_inputs.blender1a_r[cycle];
|
||||
*g = *userdata->m_color_inputs.blender1a_g[cycle];
|
||||
*b = *userdata->m_color_inputs.blender1a_b[cycle];
|
||||
}
|
||||
else
|
||||
{
|
||||
userdata->InvPixelColor.i.a = 0xff - *userdata->ColorInputs.blender1b_a[cycle];
|
||||
userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[cycle];
|
||||
blend_pipe(cycle, select, r, g, b, userdata, object);
|
||||
}
|
||||
}
|
||||
|
||||
void N64BlenderT::blend_pipe(const int cycle, const int special, int* r_out, int* g_out, int* b_out, rdp_span_aux *userdata, const rdp_poly_state& object)
|
||||
void n64_blender_t::blend_pipe(const int cycle, const int special, int* r_out, int* g_out, int* b_out, rdp_span_aux* userdata, const rdp_poly_state& object)
|
||||
{
|
||||
const INT32 mask = 0xff &~ (0x73 * special);
|
||||
const INT32 shift_a = 3 + userdata->ShiftA * special;
|
||||
const INT32 shift_b = 3 + userdata->ShiftB * special;
|
||||
const INT32 blend1a = (*userdata->ColorInputs.blender1b_a[cycle] >> shift_a) & mask;
|
||||
const INT32 blend2a = (*userdata->ColorInputs.blender2b_a[cycle] >> shift_b) & mask;
|
||||
const INT32 shift_a = 3 + userdata->m_shift_a * special;
|
||||
const INT32 shift_b = 3 + userdata->m_shift_b * special;
|
||||
const INT32 blend1a = (*userdata->m_color_inputs.blender1b_a[cycle] >> shift_a) & mask;
|
||||
const INT32 blend2a = (*userdata->m_color_inputs.blender2b_a[cycle] >> shift_b) & mask;
|
||||
const INT32 special_shift = special << 1;
|
||||
|
||||
INT32 r = (((int)(*userdata->ColorInputs.blender1a_r[cycle]) * (int)(blend1a))) + (((int)(*userdata->ColorInputs.blender2a_r[cycle]) * (int)(blend2a)));
|
||||
INT32 g = (((int)(*userdata->ColorInputs.blender1a_g[cycle]) * (int)(blend1a))) + (((int)(*userdata->ColorInputs.blender2a_g[cycle]) * (int)(blend2a)));
|
||||
INT32 b = (((int)(*userdata->ColorInputs.blender1a_b[cycle]) * (int)(blend1a))) + (((int)(*userdata->ColorInputs.blender2a_b[cycle]) * (int)(blend2a)));
|
||||
INT32 r = (((int)(*userdata->m_color_inputs.blender1a_r[cycle]) * (int)(blend1a))) + (((int)(*userdata->m_color_inputs.blender2a_r[cycle]) * (int)(blend2a)));
|
||||
INT32 g = (((int)(*userdata->m_color_inputs.blender1a_g[cycle]) * (int)(blend1a))) + (((int)(*userdata->m_color_inputs.blender2a_g[cycle]) * (int)(blend2a)));
|
||||
INT32 b = (((int)(*userdata->m_color_inputs.blender1a_b[cycle]) * (int)(blend1a))) + (((int)(*userdata->m_color_inputs.blender2a_b[cycle]) * (int)(blend2a)));
|
||||
|
||||
r += ((int)*userdata->ColorInputs.blender2a_r[cycle]) << special_shift;
|
||||
g += ((int)*userdata->ColorInputs.blender2a_g[cycle]) << special_shift;
|
||||
b += ((int)*userdata->ColorInputs.blender2a_b[cycle]) << special_shift;
|
||||
r += ((int)*userdata->m_color_inputs.blender2a_r[cycle]) << special_shift;
|
||||
g += ((int)*userdata->m_color_inputs.blender2a_g[cycle]) << special_shift;
|
||||
b += ((int)*userdata->m_color_inputs.blender2a_b[cycle]) << special_shift;
|
||||
|
||||
r >>= object.OtherModes.blend_shift;
|
||||
g >>= object.OtherModes.blend_shift;
|
||||
b >>= object.OtherModes.blend_shift;
|
||||
r >>= object.m_other_modes.blend_shift;
|
||||
g >>= object.m_other_modes.blend_shift;
|
||||
b >>= object.m_other_modes.blend_shift;
|
||||
|
||||
if (!object.OtherModes.force_blend)
|
||||
if (!object.m_other_modes.force_blend)
|
||||
{
|
||||
INT32 factor_sum = ((blend1a >> 2) + (blend2a >> 2) + 1) & 0xf;
|
||||
if (factor_sum)
|
||||
@ -512,7 +512,7 @@ void N64BlenderT::blend_pipe(const int cycle, const int special, int* r_out, int
|
||||
*b_out = min(b, 255);
|
||||
}
|
||||
|
||||
inline INT32 N64BlenderT::min(const INT32 x, const INT32 min)
|
||||
inline INT32 n64_blender_t::min(const INT32 x, const INT32 min)
|
||||
{
|
||||
if (x < min)
|
||||
{
|
||||
|
@ -18,57 +18,56 @@
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
struct OtherModesT;
|
||||
struct MiscStateT;
|
||||
struct other_modes_t;
|
||||
struct misc_state_t;
|
||||
class n64_rdp;
|
||||
struct rdp_span_aux;
|
||||
class Color;
|
||||
class color_t;
|
||||
struct rdp_poly_state;
|
||||
|
||||
class N64BlenderT
|
||||
class n64_blender_t
|
||||
{
|
||||
public:
|
||||
typedef bool (N64BlenderT::*Blender1)(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
typedef bool (N64BlenderT::*Blender2)(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
typedef bool (n64_blender_t::*blender1)(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
typedef bool (n64_blender_t::*blender2)(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
|
||||
N64BlenderT();
|
||||
n64_blender_t();
|
||||
|
||||
Blender1 blend1[8];
|
||||
Blender2 blend2[8];
|
||||
blender1 blend1[8];
|
||||
blender2 blend2[8];
|
||||
|
||||
void SetMachine(running_machine& machine) { m_machine = &machine; }
|
||||
void SetProcessor(n64_rdp* rdp) { m_rdp = rdp; }
|
||||
void set_machine(running_machine& machine) { m_machine = &machine; }
|
||||
void set_processor(n64_rdp* rdp) { m_rdp = rdp; }
|
||||
|
||||
running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
|
||||
|
||||
INT32 min(const INT32 x, const INT32 min);
|
||||
|
||||
private:
|
||||
running_machine* m_machine;
|
||||
n64_rdp* m_rdp;
|
||||
|
||||
bool alpha_reject(rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool test_for_reject(rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
void blend_pipe(const int cycle, const int special, int* r_out, int* g_out, int* b_out, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
void blend_with_partial_reject(INT32* r, INT32* g, INT32* b, INT32 cycle, INT32 partialreject, INT32 select, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
INT32 min(const INT32 x, const INT32 min);
|
||||
bool alpha_reject(rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool test_for_reject(rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
void blend_pipe(const int cycle, const int special, int* r_out, int* g_out, int* b_out, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
void blend_with_partial_reject(INT32* r, INT32* g, INT32* b, INT32 cycle, INT32 partialreject, INT32 select, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
|
||||
bool Blend1CycleNoBlendNoACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend1CycleNoBlendNoACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend1CycleNoBlendACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend1CycleNoBlendACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend1CycleBlendNoACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend1CycleBlendNoACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend1CycleBlendACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend1CycleBlendACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool cycle1_noblend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle1_noblend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle1_noblend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle1_noblend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle1_blend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle1_blend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle1_blend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle1_blend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
|
||||
bool Blend2CycleNoBlendNoACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend2CycleNoBlendNoACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend2CycleNoBlendACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend2CycleNoBlendACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend2CycleBlendNoACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend2CycleBlendNoACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend2CycleBlendACVGNoDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool Blend2CycleBlendACVGDither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
bool cycle2_noblend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle2_noblend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle2_noblend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle2_noblend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle2_blend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle2_blend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle2_blend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
bool cycle2_blend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
|
||||
INT32 dither_alpha(INT32 alpha, INT32 dither);
|
||||
INT32 dither_color(INT32 color, INT32 dither);
|
||||
|
@ -3,15 +3,15 @@
|
||||
INLINE void video_filter16(int *out_r, int *out_g, int *out_b, UINT16* vbuff, UINT8* hbuff, const UINT32 hres);
|
||||
INLINE void divot_filter16(UINT8* r, UINT8* g, UINT8* b, UINT16* fbuff, UINT32 fbuff_index);
|
||||
INLINE void restore_filter16(INT32* r, INT32* g, INT32* b, UINT16* fbuff, UINT32 fbuff_index, UINT32 hres);
|
||||
INLINE void divot_filter16_buffer(INT32* r, INT32* g, INT32* b, Color* vibuffer);
|
||||
INLINE void restore_filter16_buffer(INT32* r, INT32* g, INT32* b, Color* vibuff, UINT32 hres);
|
||||
INLINE void restore_two(Color* filtered, Color* neighbour);
|
||||
INLINE void divot_filter16_buffer(INT32* r, INT32* g, INT32* b, color_t* vibuffer);
|
||||
INLINE void restore_filter16_buffer(INT32* r, INT32* g, INT32* b, color_t* vibuff, UINT32 hres);
|
||||
INLINE void restore_two(color_t* filtered, color_t* neighbour);
|
||||
INLINE void video_max(UINT32* Pixels, UINT8* max, UINT32* enb);
|
||||
INLINE UINT32 ge_two(UINT32 enb);
|
||||
|
||||
INLINE void video_filter16(int *out_r, int *out_g, int *out_b, UINT16* vbuff, UINT8* hbuff, const UINT32 hres)
|
||||
{
|
||||
Color penumax, penumin, max, min;
|
||||
color_t penumax, penumin, max, min;
|
||||
UINT16 pix = *vbuff;
|
||||
const UINT8 centercvg = (*hbuff & 3) + ((pix & 1) << 2) + 1;
|
||||
UINT32 numoffull = 1;
|
||||
@ -255,11 +255,11 @@ INLINE void divot_filter16(UINT8* r, UINT8* g, UINT8* b, UINT16* fbuff, UINT32 f
|
||||
}
|
||||
}
|
||||
|
||||
INLINE void divot_filter16_buffer(int* r, int* g, int* b, Color* vibuffer)
|
||||
INLINE void divot_filter16_buffer(int* r, int* g, int* b, color_t* vibuffer)
|
||||
{
|
||||
Color leftpix = vibuffer[-1];
|
||||
Color rightpix = vibuffer[1];
|
||||
Color filtered = *vibuffer;
|
||||
color_t leftpix = vibuffer[-1];
|
||||
color_t rightpix = vibuffer[1];
|
||||
color_t filtered = *vibuffer;
|
||||
|
||||
*r = filtered.i.r;
|
||||
*g = filtered.i.g;
|
||||
@ -429,12 +429,12 @@ INLINE void restore_filter16(int* r, int* g, int* b, UINT16* fbuff, UINT32 fbuff
|
||||
}
|
||||
}
|
||||
|
||||
INLINE void restore_filter16_buffer(INT32* r, INT32* g, INT32* b, Color* vibuff, UINT32 hres)
|
||||
INLINE void restore_filter16_buffer(INT32* r, INT32* g, INT32* b, color_t* vibuff, UINT32 hres)
|
||||
{
|
||||
Color filtered;
|
||||
Color leftuppix, leftdownpix, leftpix;
|
||||
Color rightuppix, rightdownpix, rightpix;
|
||||
Color uppix, downpix;
|
||||
color_t filtered;
|
||||
color_t leftuppix, leftdownpix, leftpix;
|
||||
color_t rightuppix, rightdownpix, rightpix;
|
||||
color_t uppix, downpix;
|
||||
INT32 ihres = (INT32)hres; //can't apply unary minus to unsigned
|
||||
|
||||
leftuppix = vibuff[-ihres - 1];
|
||||
@ -473,7 +473,7 @@ INLINE void restore_filter16_buffer(INT32* r, INT32* g, INT32* b, Color* vibuff,
|
||||
}
|
||||
|
||||
// This is wrong, only the 5 upper bits are compared.
|
||||
INLINE void restore_two(Color* filtered, Color* neighbour)
|
||||
INLINE void restore_two(color_t* filtered, color_t* neighbour)
|
||||
{
|
||||
if (neighbour->i.r > filtered->i.r)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -18,19 +18,19 @@
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
struct OtherModesT;
|
||||
struct MiscStateT;
|
||||
class Color;
|
||||
struct other_modes_t;
|
||||
struct misc_state_t;
|
||||
class color_t;
|
||||
struct rdp_span_aux;
|
||||
struct rdp_poly_state;
|
||||
|
||||
class N64TexturePipeT
|
||||
class n64_texture_pipe_t
|
||||
{
|
||||
public:
|
||||
typedef UINT32 (N64TexturePipeT::*TexelFetcher) (INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
typedef void (N64TexturePipeT::*Cycler) (Color* TEX, Color* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux *userdata, const rdp_poly_state& object, INT32 *m_clamp_s_diff, INT32 *m_clamp_t_diff);
|
||||
typedef UINT32 (n64_texture_pipe_t::*texel_fetcher_t) (INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
typedef void (n64_texture_pipe_t::*texel_cycler_t) (color_t* TEX, color_t* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux* userdata, const rdp_poly_state& object, INT32* m_clamp_s_diff, INT32* m_clamp_t_diff);
|
||||
|
||||
N64TexturePipeT()
|
||||
n64_texture_pipe_t()
|
||||
{
|
||||
m_maskbits_table[0] = 0x3ff;
|
||||
for(int i = 1; i < 16; i++)
|
||||
@ -41,130 +41,129 @@ class N64TexturePipeT
|
||||
|
||||
for (int idx = 0; idx < 80; idx++)
|
||||
{
|
||||
TexelFetch[idx] = &N64TexturePipeT::_FetchNOP;
|
||||
m_texel_fetch[idx] = &n64_texture_pipe_t::fetch_nop;
|
||||
}
|
||||
|
||||
TexelFetch[ 8] = &N64TexturePipeT::_FetchRGBA_16_RAW;
|
||||
TexelFetch[ 9] = &N64TexturePipeT::_FetchRGBA_16_RAW;
|
||||
TexelFetch[10] = &N64TexturePipeT::_FetchRGBA_16_TLUT0;
|
||||
TexelFetch[11] = &N64TexturePipeT::_FetchRGBA_16_TLUT1;
|
||||
TexelFetch[12] = &N64TexturePipeT::_FetchRGBA_32_RAW;
|
||||
TexelFetch[13] = &N64TexturePipeT::_FetchRGBA_32_RAW;
|
||||
TexelFetch[14] = &N64TexturePipeT::_FetchRGBA_32_TLUT0;
|
||||
TexelFetch[15] = &N64TexturePipeT::_FetchRGBA_32_TLUT1;
|
||||
m_texel_fetch[ 8] = &n64_texture_pipe_t::fetch_rgba16_raw;
|
||||
m_texel_fetch[ 9] = &n64_texture_pipe_t::fetch_rgba16_raw;
|
||||
m_texel_fetch[10] = &n64_texture_pipe_t::fetch_rgba16_tlut0;
|
||||
m_texel_fetch[11] = &n64_texture_pipe_t::fetch_rgba16_tlut1;
|
||||
m_texel_fetch[12] = &n64_texture_pipe_t::fetch_rgba32_raw;
|
||||
m_texel_fetch[13] = &n64_texture_pipe_t::fetch_rgba32_raw;
|
||||
m_texel_fetch[14] = &n64_texture_pipe_t::fetch_rgba32_tlut0;
|
||||
m_texel_fetch[15] = &n64_texture_pipe_t::fetch_rgba32_tlut1;
|
||||
|
||||
TexelFetch[24] = &N64TexturePipeT::_FetchYUV;
|
||||
TexelFetch[25] = &N64TexturePipeT::_FetchYUV;
|
||||
TexelFetch[26] = &N64TexturePipeT::_FetchYUV;
|
||||
TexelFetch[27] = &N64TexturePipeT::_FetchYUV;
|
||||
m_texel_fetch[24] = &n64_texture_pipe_t::fetch_yuv;
|
||||
m_texel_fetch[25] = &n64_texture_pipe_t::fetch_yuv;
|
||||
m_texel_fetch[26] = &n64_texture_pipe_t::fetch_yuv;
|
||||
m_texel_fetch[27] = &n64_texture_pipe_t::fetch_yuv;
|
||||
|
||||
TexelFetch[32] = &N64TexturePipeT::_FetchCI_4_RAW;
|
||||
TexelFetch[33] = &N64TexturePipeT::_FetchCI_4_RAW;
|
||||
TexelFetch[34] = &N64TexturePipeT::_FetchCI_4_TLUT0;
|
||||
TexelFetch[35] = &N64TexturePipeT::_FetchCI_4_TLUT1;
|
||||
TexelFetch[36] = &N64TexturePipeT::_FetchCI_8_RAW;
|
||||
TexelFetch[37] = &N64TexturePipeT::_FetchCI_8_RAW;
|
||||
TexelFetch[38] = &N64TexturePipeT::_FetchCI_8_TLUT0;
|
||||
TexelFetch[39] = &N64TexturePipeT::_FetchCI_8_TLUT1;
|
||||
m_texel_fetch[32] = &n64_texture_pipe_t::fetch_ci4_raw;
|
||||
m_texel_fetch[33] = &n64_texture_pipe_t::fetch_ci4_raw;
|
||||
m_texel_fetch[34] = &n64_texture_pipe_t::fetch_ci4_tlut0;
|
||||
m_texel_fetch[35] = &n64_texture_pipe_t::fetch_ci4_tlut1;
|
||||
m_texel_fetch[36] = &n64_texture_pipe_t::fetch_ci8_raw;
|
||||
m_texel_fetch[37] = &n64_texture_pipe_t::fetch_ci8_raw;
|
||||
m_texel_fetch[38] = &n64_texture_pipe_t::fetch_ci8_tlut0;
|
||||
m_texel_fetch[39] = &n64_texture_pipe_t::fetch_ci8_tlut1;
|
||||
|
||||
TexelFetch[48] = &N64TexturePipeT::_FetchIA_4_RAW;
|
||||
TexelFetch[49] = &N64TexturePipeT::_FetchIA_4_RAW;
|
||||
TexelFetch[50] = &N64TexturePipeT::_FetchIA_4_TLUT0;
|
||||
TexelFetch[51] = &N64TexturePipeT::_FetchIA_4_TLUT1;
|
||||
TexelFetch[52] = &N64TexturePipeT::_FetchIA_8_RAW;
|
||||
TexelFetch[53] = &N64TexturePipeT::_FetchIA_8_RAW;
|
||||
TexelFetch[54] = &N64TexturePipeT::_FetchIA_8_TLUT0;
|
||||
TexelFetch[55] = &N64TexturePipeT::_FetchIA_8_TLUT1;
|
||||
TexelFetch[56] = &N64TexturePipeT::_FetchIA_16_RAW;
|
||||
TexelFetch[57] = &N64TexturePipeT::_FetchIA_16_RAW;
|
||||
TexelFetch[58] = &N64TexturePipeT::_FetchIA_16_TLUT0;
|
||||
TexelFetch[59] = &N64TexturePipeT::_FetchIA_16_TLUT1;
|
||||
m_texel_fetch[48] = &n64_texture_pipe_t::fetch_ia4_raw;
|
||||
m_texel_fetch[49] = &n64_texture_pipe_t::fetch_ia4_raw;
|
||||
m_texel_fetch[50] = &n64_texture_pipe_t::fetch_ia4_tlut0;
|
||||
m_texel_fetch[51] = &n64_texture_pipe_t::fetch_ia4_tlut1;
|
||||
m_texel_fetch[52] = &n64_texture_pipe_t::fetch_ia8_raw;
|
||||
m_texel_fetch[53] = &n64_texture_pipe_t::fetch_ia8_raw;
|
||||
m_texel_fetch[54] = &n64_texture_pipe_t::fetch_ia8_tlut0;
|
||||
m_texel_fetch[55] = &n64_texture_pipe_t::fetch_ia8_tlut1;
|
||||
m_texel_fetch[56] = &n64_texture_pipe_t::fetch_ia16_raw;
|
||||
m_texel_fetch[57] = &n64_texture_pipe_t::fetch_ia16_raw;
|
||||
m_texel_fetch[58] = &n64_texture_pipe_t::fetch_ia16_tlut0;
|
||||
m_texel_fetch[59] = &n64_texture_pipe_t::fetch_ia16_tlut1;
|
||||
|
||||
TexelFetch[64] = &N64TexturePipeT::_FetchI_4_RAW;
|
||||
TexelFetch[65] = &N64TexturePipeT::_FetchI_4_RAW;
|
||||
TexelFetch[66] = &N64TexturePipeT::_FetchI_4_TLUT0;
|
||||
TexelFetch[67] = &N64TexturePipeT::_FetchI_4_TLUT1;
|
||||
TexelFetch[68] = &N64TexturePipeT::_FetchI_8_RAW;
|
||||
TexelFetch[69] = &N64TexturePipeT::_FetchI_8_RAW;
|
||||
TexelFetch[70] = &N64TexturePipeT::_FetchI_8_TLUT0;
|
||||
TexelFetch[71] = &N64TexturePipeT::_FetchI_8_TLUT1;
|
||||
m_texel_fetch[64] = &n64_texture_pipe_t::fetch_i4_raw;
|
||||
m_texel_fetch[65] = &n64_texture_pipe_t::fetch_i4_raw;
|
||||
m_texel_fetch[66] = &n64_texture_pipe_t::fetch_i4_tlut0;
|
||||
m_texel_fetch[67] = &n64_texture_pipe_t::fetch_i4_tlut1;
|
||||
m_texel_fetch[68] = &n64_texture_pipe_t::fetch_i8_raw;
|
||||
m_texel_fetch[69] = &n64_texture_pipe_t::fetch_i8_raw;
|
||||
m_texel_fetch[70] = &n64_texture_pipe_t::fetch_i8_tlut0;
|
||||
m_texel_fetch[71] = &n64_texture_pipe_t::fetch_i8_tlut1;
|
||||
|
||||
cycle[0] = &N64TexturePipeT::CycleNearest;
|
||||
cycle[1] = &N64TexturePipeT::CycleNearestLerp;
|
||||
cycle[2] = &N64TexturePipeT::CycleLinear;
|
||||
cycle[3] = &N64TexturePipeT::CycleLinearLerp;
|
||||
m_cycle[0] = &n64_texture_pipe_t::cycle_nearest;
|
||||
m_cycle[1] = &n64_texture_pipe_t::cycle_nearest_lerp;
|
||||
m_cycle[2] = &n64_texture_pipe_t::cycle_linear;
|
||||
m_cycle[3] = &n64_texture_pipe_t::cycle_linear_lerp;
|
||||
}
|
||||
|
||||
void CycleNearest(Color* TEX, Color* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux *userdata, const rdp_poly_state& object, INT32 *m_clamp_s_diff, INT32 *m_clamp_t_diff);
|
||||
void CycleNearestLerp(Color* TEX, Color* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux *userdata, const rdp_poly_state& object, INT32 *m_clamp_s_diff, INT32 *m_clamp_t_diff);
|
||||
void CycleLinear(Color* TEX, Color* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux *userdata, const rdp_poly_state& object, INT32 *m_clamp_s_diff, INT32 *m_clamp_t_diff);
|
||||
void CycleLinearLerp(Color* TEX, Color* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux *userdata, const rdp_poly_state& object, INT32 *m_clamp_s_diff, INT32 *m_clamp_t_diff);
|
||||
void cycle_nearest(color_t* TEX, color_t* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux* userdata, const rdp_poly_state& object, INT32* m_clamp_s_diff, INT32* m_clamp_t_diff);
|
||||
void cycle_nearest_lerp(color_t* TEX, color_t* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux* userdata, const rdp_poly_state& object, INT32* m_clamp_s_diff, INT32* m_clamp_t_diff);
|
||||
void cycle_linear(color_t* TEX, color_t* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux* userdata, const rdp_poly_state& object, INT32* m_clamp_s_diff, INT32* m_clamp_t_diff);
|
||||
void cycle_linear_lerp(color_t* TEX, color_t* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux* userdata, const rdp_poly_state& object, INT32* m_clamp_s_diff, INT32* m_clamp_t_diff);
|
||||
|
||||
Cycler cycle[4];
|
||||
texel_cycler_t m_cycle[4];
|
||||
|
||||
void Copy(Color* TEX, INT32 SSS, INT32 SST, UINT32 tilenum, const rdp_poly_state& object, rdp_span_aux *userdata);
|
||||
UINT32 Fetch(INT32 SSS, INT32 SST, INT32 tile, const rdp_poly_state& object, rdp_span_aux *userdata);
|
||||
void CalculateClampDiffs(UINT32 prim_tile, rdp_span_aux *userdata, const rdp_poly_state& object, INT32 *m_clamp_s_diff, INT32 *m_clamp_t_diff);
|
||||
void LOD1Cycle(INT32* sss, INT32* sst, INT32 s, INT32 t, INT32 w, INT32 dsinc, INT32 dtinc, INT32 dwinc, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
void LOD2Cycle(INT32* sss, INT32* sst, INT32 s, INT32 t, INT32 w, INT32 dsinc, INT32 dtinc, INT32 dwinc, INT32 prim_tile, INT32* t1, INT32* t2, rdp_span_aux *userdata, const rdp_poly_state& object);
|
||||
void LOD2CycleLimited(INT32* sss, INT32* sst, INT32 s, INT32 t, INT32 w, INT32 dsinc, INT32 dtinc, INT32 dwinc, INT32 prim_tile, INT32* t1, const rdp_poly_state& object);
|
||||
void copy(color_t* TEX, INT32 SSS, INT32 SST, UINT32 tilenum, const rdp_poly_state& object, rdp_span_aux* userdata);
|
||||
UINT32 fetch(INT32 SSS, INT32 SST, INT32 tile, const rdp_poly_state& object, rdp_span_aux* userdata);
|
||||
void calculate_clamp_diffs(UINT32 prim_tile, rdp_span_aux* userdata, const rdp_poly_state& object, INT32* m_clamp_s_diff, INT32* m_clamp_t_diff);
|
||||
void lod_1cycle(INT32* sss, INT32* sst, INT32 s, INT32 t, INT32 w, INT32 dsinc, INT32 dtinc, INT32 dwinc, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
void lod_2cycle(INT32* sss, INT32* sst, INT32 s, INT32 t, INT32 w, INT32 dsinc, INT32 dtinc, INT32 dwinc, INT32 prim_tile, INT32* t1, INT32* t2, rdp_span_aux* userdata, const rdp_poly_state& object);
|
||||
void lod_2cycle_limited(INT32* sss, INT32* sst, INT32 s, INT32 t, INT32 w, INT32 dsinc, INT32 dtinc, INT32 dwinc, INT32 prim_tile, INT32* t1, const rdp_poly_state& object);
|
||||
|
||||
void SetMachine(running_machine& machine);
|
||||
void set_machine(running_machine& machine);
|
||||
|
||||
bool m_start_span;
|
||||
|
||||
private:
|
||||
UINT32 Expand16To32Table[0x10000];
|
||||
void mask(INT32* S, INT32* T, INT32 num, const rdp_poly_state& object);
|
||||
void mask_coupled(INT32* S, INT32* S1, INT32* T, INT32* T1, INT32 num, const rdp_poly_state& object);
|
||||
|
||||
void Mask(INT32* S, INT32* T, INT32 num, const rdp_poly_state& object);
|
||||
void MaskCoupled(INT32* S, INT32* S1, INT32* T, INT32* T1, INT32 num, const rdp_poly_state& object);
|
||||
void shift_cycle(INT32* S, INT32* T, INT32* maxs, INT32* maxt, UINT32 num, const rdp_poly_state& object);
|
||||
void shift_copy(INT32* S, INT32* T, UINT32 num, const rdp_poly_state& object);
|
||||
|
||||
void ShiftCycle(INT32* S, INT32* T, INT32* maxs, INT32* maxt, UINT32 num, const rdp_poly_state& object);
|
||||
void ShiftCopy(INT32* S, INT32* T, UINT32 num, const rdp_poly_state& object);
|
||||
void clamp_cycle(INT32* S, INT32* T, INT32* SFRAC, INT32* TFRAC, INT32 maxs, INT32 maxt, INT32 num, rdp_span_aux* userdata, const rdp_poly_state& object, INT32* m_clamp_s_diff, INT32* m_clamp_t_diff);
|
||||
void clamp_cycle_light(INT32* S, INT32* T, bool maxs, bool maxt, INT32 num, rdp_span_aux* userdata, const rdp_poly_state& object, INT32* m_clamp_s_diff, INT32* m_clamp_t_diff);
|
||||
|
||||
void ClampCycle(INT32* S, INT32* T, INT32* SFRAC, INT32* TFRAC, INT32 maxs, INT32 maxt, INT32 num, rdp_span_aux *userdata, const rdp_poly_state& object, INT32 *m_clamp_s_diff, INT32 *m_clamp_t_diff);
|
||||
void ClampCycleLight(INT32* S, INT32* T, bool maxs, bool maxt, INT32 num, rdp_span_aux *userdata, const rdp_poly_state& object, INT32 *m_clamp_s_diff, INT32 *m_clamp_t_diff);
|
||||
UINT32 fetch_nop(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
|
||||
UINT32 _FetchNOP(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 fetch_rgba16_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_rgba16_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_rgba16_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_rgba32_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_rgba32_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_rgba32_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
|
||||
UINT32 _FetchRGBA_16_TLUT0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchRGBA_16_TLUT1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchRGBA_16_RAW(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchRGBA_32_TLUT0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchRGBA_32_TLUT1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchRGBA_32_RAW(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 fetch_yuv(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
|
||||
UINT32 _FetchYUV(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 fetch_ci4_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ci4_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ci4_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ci8_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ci8_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ci8_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
|
||||
UINT32 _FetchCI_4_TLUT0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchCI_4_TLUT1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchCI_4_RAW(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchCI_8_TLUT0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchCI_8_TLUT1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchCI_8_RAW(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 fetch_ia4_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ia4_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ia4_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ia8_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ia8_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ia8_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ia16_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ia16_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_ia16_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
|
||||
UINT32 _FetchIA_4_TLUT0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchIA_4_TLUT1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchIA_4_RAW(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchIA_8_TLUT0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchIA_8_TLUT1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchIA_8_RAW(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchIA_16_TLUT0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchIA_16_TLUT1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchIA_16_RAW(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 fetch_i4_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_i4_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_i4_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_i8_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_i8_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
UINT32 fetch_i8_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
|
||||
|
||||
UINT32 _FetchI_4_TLUT0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchI_4_TLUT1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchI_4_RAW(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchI_8_TLUT0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchI_8_TLUT1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
UINT32 _FetchI_8_RAW(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux *userdata);
|
||||
|
||||
TexelFetcher TexelFetch[16*5];
|
||||
texel_fetcher_t m_texel_fetch[16*5];
|
||||
|
||||
n64_rdp* m_rdp;
|
||||
|
||||
INT32 m_maskbits_table[16];
|
||||
UINT32 m_expand_16to32_table[0x10000];
|
||||
};
|
||||
|
||||
#endif // _VIDEO_RDPTEXPIPE_H_
|
||||
|
Loading…
Reference in New Issue
Block a user