[Project64] Convert wxUint32 to uint32_t
This commit is contained in:
parent
3406831a49
commit
dae0c8827c
|
@ -51,7 +51,7 @@ void calc_light (VERTEX *v)
|
|||
{
|
||||
float light_intensity = 0.0f;
|
||||
register float color[3] = {rdp.light[rdp.num_lights].r, rdp.light[rdp.num_lights].g, rdp.light[rdp.num_lights].b};
|
||||
for (wxUint32 l=0; l<rdp.num_lights; l++)
|
||||
for (uint32_t l=0; l<rdp.num_lights; l++)
|
||||
{
|
||||
light_intensity = DotProduct (rdp.light_vector[l], v->vec);
|
||||
|
||||
|
|
|
@ -88,9 +88,9 @@ unsigned int CRC32( unsigned int crc, void *buffer, unsigned int count )
|
|||
//*/
|
||||
|
||||
/*
|
||||
wxUint32 CRC_Calculate( wxUint32 crc, void *buffer, wxUint32 count )
|
||||
uint32_t CRC_Calculate( uint32_t crc, void *buffer, uint32_t count )
|
||||
{
|
||||
wxUint32 Crc32=crc;
|
||||
uint32_t Crc32=crc;
|
||||
__asm {
|
||||
mov esi, buffer
|
||||
mov ecx, count
|
||||
|
|
|
@ -44,10 +44,10 @@
|
|||
#define FASTSEARCH // Enable fast combine mode searching algorithm
|
||||
|
||||
float percent_org, percent, r, g, b;
|
||||
wxUint32 lod_frac;
|
||||
uint32_t lod_frac;
|
||||
|
||||
wxUint32 cc_lookup[257];
|
||||
wxUint32 ac_lookup[257];
|
||||
uint32_t cc_lookup[257];
|
||||
uint32_t ac_lookup[257];
|
||||
COMBINE cmb;
|
||||
|
||||
//****************************************************************
|
||||
|
@ -796,8 +796,8 @@ COMBINE cmb;
|
|||
#define CA_ENV() CA(rdp.env_color)
|
||||
#define CA_INVPRIM() cmb.ccolor|=0xFF-(rdp.prim_color&0xFF)
|
||||
#define CA_INVENV() cmb.ccolor|=0xFF-(rdp.env_color&0xFF)
|
||||
#define CA_ENV1MPRIM() cmb.ccolor|= (wxUint32)(((rdp.env_color&0xFF)/255.0f) * (((~(rdp.prim_color&0xFF)) & 0xff)/255.0f) * 255.0f);
|
||||
#define CA_PRIMENV() cmb.ccolor |= (wxUint32)(((rdp.env_color&0xFF)/255.0f) * ((rdp.prim_color&0xFF)/255.0f) * 255.0f);
|
||||
#define CA_ENV1MPRIM() cmb.ccolor|= (uint32_t)(((rdp.env_color&0xFF)/255.0f) * (((~(rdp.prim_color&0xFF)) & 0xff)/255.0f) * 255.0f);
|
||||
#define CA_PRIMENV() cmb.ccolor |= (uint32_t)(((rdp.env_color&0xFF)/255.0f) * ((rdp.prim_color&0xFF)/255.0f) * 255.0f);
|
||||
#define CA_PRIMLOD() cmb.ccolor |= rdp.prim_lodfrac;
|
||||
#define CA_PRIM_MUL_PRIMLOD() cmb.ccolor |= (int)(((rdp.prim_color&0xFF) * rdp.prim_lodfrac) / 255.0f);
|
||||
#define CA_ENV_MUL_PRIMLOD() cmb.ccolor |= (int)(((rdp.env_color&0xFF) * rdp.prim_lodfrac) / 255.0f);
|
||||
|
@ -876,7 +876,7 @@ static void cc_t0 ()
|
|||
{
|
||||
if ((rdp.othermode_l & 0x4000) && (rdp.cycle_mode < 2))
|
||||
{
|
||||
wxUint32 blend_mode = (rdp.othermode_l >> 16);
|
||||
uint32_t blend_mode = (rdp.othermode_l >> 16);
|
||||
if (blend_mode == 0xa500)
|
||||
{
|
||||
CCMB (GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL,
|
||||
|
@ -884,9 +884,9 @@ static void cc_t0 ()
|
|||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_TEXTURE);
|
||||
float fog = (rdp.fog_color&0xFF)/255.0f;
|
||||
wxUint32 R = (wxUint32)(((rdp.blend_color>>24)&0xFF)*fog);
|
||||
wxUint32 G = (wxUint32)(((rdp.blend_color>>16)&0xFF)*fog);
|
||||
wxUint32 B = (wxUint32)(((rdp.blend_color>> 8)&0xFF)*fog);
|
||||
uint32_t R = (uint32_t)(((rdp.blend_color>>24)&0xFF)*fog);
|
||||
uint32_t G = (uint32_t)(((rdp.blend_color>>16)&0xFF)*fog);
|
||||
uint32_t B = (uint32_t)(((rdp.blend_color>> 8)&0xFF)*fog);
|
||||
CC((R<<24)|(G<<16)|(B<<8));
|
||||
}
|
||||
else if (blend_mode == 0x55f0) //cmem*afog + cfog*1ma
|
||||
|
@ -961,7 +961,7 @@ CCMB (GR_COMBINE_FUNCTION_SCALE_OTHER,
|
|||
GR_COMBINE_FACTOR_ONE,
|
||||
GR_COMBINE_LOCAL_NONE,
|
||||
GR_COMBINE_OTHER_TEXTURE);
|
||||
wxUint32 col1 = (rdp.K5<<24) | (rdp.K5<<16) | (rdp.K5<<8);
|
||||
uint32_t col1 = (rdp.K5<<24) | (rdp.K5<<16) | (rdp.K5<<8);
|
||||
MOD_0 (TMOD_COL_INTER_TEX_USING_COL1);
|
||||
MOD_0_COL (rdp.env_color & 0xFFFFFF00);
|
||||
MOD_0_COL1 (col1 & 0xFFFFFF00);
|
||||
|
@ -1380,7 +1380,7 @@ static void cc__t0_mul_shade__add__t1_mul_shade ()
|
|||
|
||||
static void cc__t0_mul_prim__inter_env_using_enva ()
|
||||
{
|
||||
wxUint32 enva = rdp.env_color&0xFF;
|
||||
uint32_t enva = rdp.env_color&0xFF;
|
||||
if (enva == 0xFF)
|
||||
cc_env ();
|
||||
else if (enva == 0)
|
||||
|
@ -1926,16 +1926,16 @@ static void cc__prim_inter_env_using_enva__mul_shade ()
|
|||
{
|
||||
const float ea = ((float)(rdp.env_color&0xFF)) / 255.0f;
|
||||
const float ea_i = 1.0f - ea;
|
||||
wxUint32 pr = (rdp.prim_color >> 24)&0xFF;
|
||||
wxUint32 pg = (rdp.prim_color >> 16)&0xFF;
|
||||
wxUint32 pb = (rdp.prim_color >> 8)&0xFF;
|
||||
wxUint32 er = (rdp.env_color >> 24)&0xFF;
|
||||
wxUint32 eg = (rdp.env_color >> 16)&0xFF;
|
||||
wxUint32 eb = (rdp.env_color >> 8)&0xFF;
|
||||
wxUint32 r = min(255, (wxUint32)(er*ea + pr*ea_i));
|
||||
wxUint32 g = min(255, (wxUint32)(eg*ea + pg*ea_i));
|
||||
wxUint32 b = min(255, (wxUint32)(eb*ea + pb*ea_i));
|
||||
wxUint32 col = (r << 24) | (g << 16) | (b << 8) | 0xFF;
|
||||
uint32_t pr = (rdp.prim_color >> 24)&0xFF;
|
||||
uint32_t pg = (rdp.prim_color >> 16)&0xFF;
|
||||
uint32_t pb = (rdp.prim_color >> 8)&0xFF;
|
||||
uint32_t er = (rdp.env_color >> 24)&0xFF;
|
||||
uint32_t eg = (rdp.env_color >> 16)&0xFF;
|
||||
uint32_t eb = (rdp.env_color >> 8)&0xFF;
|
||||
uint32_t r = min(255, (uint32_t)(er*ea + pr*ea_i));
|
||||
uint32_t g = min(255, (uint32_t)(eg*ea + pg*ea_i));
|
||||
uint32_t b = min(255, (uint32_t)(eb*ea + pb*ea_i));
|
||||
uint32_t col = (r << 24) | (g << 16) | (b << 8) | 0xFF;
|
||||
CCMB (GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_LOCAL,
|
||||
GR_COMBINE_LOCAL_ITERATED,
|
||||
|
@ -3123,7 +3123,7 @@ static void cc__t0_add_primlod__mul_shade_add_env ()
|
|||
GR_COMBINE_FACTOR_TEXTURE_RGB,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_ITERATED);
|
||||
wxUint32 color = (lod_frac<<24) | (lod_frac<<16) | (lod_frac<<8);
|
||||
uint32_t color = (lod_frac<<24) | (lod_frac<<16) | (lod_frac<<8);
|
||||
MOD_0 (TMOD_TEX_ADD_COL);
|
||||
MOD_0_COL (color & 0xFFFFFF00);
|
||||
CC_ENV ();
|
||||
|
@ -4035,7 +4035,7 @@ static void cc__t0_mul_prima_add_t0__sub_center_mul_scale ()
|
|||
GR_CMBX_LOCAL_TEXTURE_RGB, GR_FUNC_MODE_ZERO,
|
||||
GR_CMBX_TMU_CCOLOR, 0,
|
||||
GR_CMBX_B, 0);
|
||||
wxUint32 prima = rdp.prim_color&0xFF;
|
||||
uint32_t prima = rdp.prim_color&0xFF;
|
||||
cmb.tex_ccolor = (prima<<24)|(prima<<16)|(prima<<8)|prima;
|
||||
cmb.tex |= 1;
|
||||
CCMBEXT(GR_CMBX_TEXTURE_RGB, GR_FUNC_MODE_X,
|
||||
|
@ -4776,7 +4776,7 @@ static void cc_t0_sub_k4_mul_k5_add_t0 () //Aded by Gonetz
|
|||
GR_CMBX_TEXTURE_RGB, GR_FUNC_MODE_X,
|
||||
GR_CMBX_CONSTANT_COLOR, 0,
|
||||
GR_CMBX_B, 0);
|
||||
wxUint32 temp = rdp.prim_lodfrac;
|
||||
uint32_t temp = rdp.prim_lodfrac;
|
||||
rdp.prim_lodfrac = rdp.K4;
|
||||
SETSHADE_PRIMLOD ();
|
||||
rdp.prim_lodfrac = temp;
|
||||
|
@ -4852,7 +4852,7 @@ static void cc_t0_sub_env_mul_prima_add_env () //Aded by Gonetz
|
|||
{
|
||||
MOD_0 (TMOD_COL_INTER_TEX_USING_COL1);
|
||||
MOD_0_COL (rdp.env_color & 0xFFFFFF00);
|
||||
wxUint32 prima = rdp.prim_color & 0xFF;
|
||||
uint32_t prima = rdp.prim_color & 0xFF;
|
||||
MOD_0_COL1 ((prima<<24)|(prima|16)|(prima<<8));
|
||||
USE_T0 ();
|
||||
}
|
||||
|
@ -6314,7 +6314,7 @@ static void cc__env_inter_prim_using_t0__sub_shade_mul_t0a_add_shade ()
|
|||
GR_CMBX_B, 0);
|
||||
cmb.tex_ccolor = rdp.env_color;
|
||||
cmb.tex |= 1;
|
||||
wxUint32 pse = (rdp.prim_color>>24) - (rdp.env_color>>24);
|
||||
uint32_t pse = (rdp.prim_color>>24) - (rdp.env_color>>24);
|
||||
percent = (float)(pse) / 255.0f;
|
||||
cmb.dc0_detailmax = cmb.dc1_detailmax = percent;
|
||||
}
|
||||
|
@ -7422,7 +7422,7 @@ static void cc_shade_sub_env_mul_k5_add_prim ()
|
|||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_ITERATED);
|
||||
SUBSHADE_ENV ();
|
||||
wxUint32 temp = rdp.prim_color;
|
||||
uint32_t temp = rdp.prim_color;
|
||||
rdp.prim_color = rdp.K5;
|
||||
MULSHADE_PRIMA ();
|
||||
rdp.prim_color = temp;
|
||||
|
@ -8419,7 +8419,7 @@ static void cc__prim_inter_t0_using_env__mul_shade ()
|
|||
GR_CMBX_CONSTANT_COLOR, GR_FUNC_MODE_X,
|
||||
GR_CMBX_ITRGB, 0,
|
||||
GR_CMBX_ZERO, 0);
|
||||
wxUint32 onesubenv = ~rdp.env_color;
|
||||
uint32_t onesubenv = ~rdp.env_color;
|
||||
CC_C1MULC2(rdp.prim_color, onesubenv);
|
||||
}
|
||||
else
|
||||
|
@ -8657,7 +8657,7 @@ static void cc__env_inter_t0_using_prima__mul_shade ()
|
|||
GR_COMBINE_OTHER_TEXTURE);
|
||||
MOD_0 (TMOD_COL_INTER_TEX_USING_COL1);
|
||||
MOD_0_COL (rdp.env_color & 0xFFFFFF00);
|
||||
wxUint32 prima = rdp.prim_color & 0xFF;
|
||||
uint32_t prima = rdp.prim_color & 0xFF;
|
||||
MOD_0_COL1 ((prima<<24)|(prima|16)|(prima<<8));
|
||||
USE_T0 ();
|
||||
}
|
||||
|
@ -8683,7 +8683,7 @@ static void cc_shade_mul_shadea ()
|
|||
static void cc__t0_mul_shade__inter_env_using_enva ()
|
||||
{
|
||||
// (t0-0)*shade+0, (env-cmb)*env_a+cmb ** INC **
|
||||
wxUint32 enva = rdp.env_color&0xFF;
|
||||
uint32_t enva = rdp.env_color&0xFF;
|
||||
if (enva == 0xFF)
|
||||
cc_env ();
|
||||
else if (enva == 0)
|
||||
|
@ -8786,7 +8786,7 @@ static void ac_t0 ()
|
|||
{
|
||||
if ((rdp.othermode_l & 0x4000) && (rdp.cycle_mode < 2))
|
||||
{
|
||||
wxUint32 blend_mode = (rdp.othermode_l >> 16);
|
||||
uint32_t blend_mode = (rdp.othermode_l >> 16);
|
||||
if (blend_mode == 0x0550)
|
||||
{
|
||||
ACMB (GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
|
@ -9275,7 +9275,7 @@ static void ac__t1_sub_t0_mul_primlod__mul_env_add_prim ()
|
|||
GR_CMBX_LOCAL_TEXTURE_ALPHA, GR_FUNC_MODE_NEGATIVE_X,
|
||||
GR_CMBX_TMU_CALPHA, 0,
|
||||
GR_CMBX_ZERO, 0);
|
||||
cmb.tex_ccolor = (cmb.tex_ccolor&0xFFFFFF00) | (wxUint32)((float)(rdp.env_color&0xFF)*(float)rdp.prim_lodfrac/255.0f);
|
||||
cmb.tex_ccolor = (cmb.tex_ccolor&0xFFFFFF00) | (uint32_t)((float)(rdp.env_color&0xFF)*(float)rdp.prim_lodfrac/255.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -10260,7 +10260,7 @@ static void ac_t0_mul_primlod_mul_prim () //Aded by Gonetz
|
|||
GR_COMBINE_FACTOR_LOCAL,
|
||||
GR_COMBINE_LOCAL_CONSTANT,
|
||||
GR_COMBINE_OTHER_TEXTURE);
|
||||
cmb.ccolor |= (wxUint32)(lod_frac * (rdp.prim_color&0xFF) / 255);
|
||||
cmb.ccolor |= (uint32_t)(lod_frac * (rdp.prim_color&0xFF) / 255);
|
||||
A_USE_T0 ();
|
||||
}
|
||||
|
||||
|
@ -11648,7 +11648,7 @@ static void ac_one_sub_t0_mul_primshade ()
|
|||
|
||||
typedef void (*cmb_func)();
|
||||
typedef struct {
|
||||
wxUint32 key;
|
||||
uint32_t key;
|
||||
cmb_func func;
|
||||
} COMBINER;
|
||||
|
||||
|
@ -15554,7 +15554,7 @@ void Combine ()
|
|||
|
||||
rdp.noise = RDP::noise_none;
|
||||
|
||||
wxUint32 found = TRUE;
|
||||
uint32_t found = TRUE;
|
||||
|
||||
rdp.col[0] = rdp.col[1] = rdp.col[2] = rdp.col[3] =
|
||||
rdp.coladd[0] = rdp.coladd[1] = rdp.coladd[2] = rdp.coladd[3] = 1.0f;
|
||||
|
@ -15587,8 +15587,8 @@ void Combine ()
|
|||
cmb.tex_cmb_ext_use = 0;
|
||||
}
|
||||
|
||||
wxUint32 cmb_mode_c = (rdp.cycle1 << 16) | (rdp.cycle2 & 0xFFFF);
|
||||
wxUint32 cmb_mode_a = (rdp.cycle1 & 0x0FFF0000) | ((rdp.cycle2 >> 16) & 0x00000FFF);
|
||||
uint32_t cmb_mode_c = (rdp.cycle1 << 16) | (rdp.cycle2 & 0xFFFF);
|
||||
uint32_t cmb_mode_a = (rdp.cycle1 & 0x0FFF0000) | ((rdp.cycle2 >> 16) & 0x00000FFF);
|
||||
|
||||
cmb.abf1 = GR_BLEND_SRC_ALPHA;
|
||||
cmb.abf2 = GR_BLEND_ONE_MINUS_SRC_ALPHA;
|
||||
|
@ -15596,7 +15596,7 @@ void Combine ()
|
|||
#ifdef FASTSEARCH
|
||||
// Fast, ordered search
|
||||
int current=0x7FFFFFFF, last;
|
||||
wxUint32 actual_combine, current_combine, color_combine, alpha_combine;
|
||||
uint32_t actual_combine, current_combine, color_combine, alpha_combine;
|
||||
int left, right;
|
||||
|
||||
actual_combine = current_combine = cmb_mode_c;
|
||||
|
@ -15803,7 +15803,7 @@ void Combine ()
|
|||
|
||||
void CombineBlender ()
|
||||
{
|
||||
wxUint32 blendmode = rdp.othermode_l >> 16;
|
||||
uint32_t blendmode = rdp.othermode_l >> 16;
|
||||
// Check force-blending
|
||||
if ((rdp.othermode_l & 0x4000) && (rdp.cycle_mode < 2))
|
||||
{
|
||||
|
@ -15857,9 +15857,9 @@ void CombineBlender ()
|
|||
|
||||
float percent = (rdp.fog_color & 0xFF) / 255.0f;
|
||||
cmb.ccolor =
|
||||
((wxUint32)(((cmb.ccolor >> 24) & 0xFF) * (1.0f-percent) + ((rdp.fog_color>>24) & 0xFF) * percent) << 24) |
|
||||
((wxUint32)(((cmb.ccolor >> 16) & 0xFF) * (1.0f-percent) + ((rdp.fog_color>>16) & 0xFF) * percent) << 16) |
|
||||
((wxUint32)(((cmb.ccolor >> 8) & 0xFF) * (1.0f-percent) + ((rdp.fog_color>>8) & 0xFF) * percent) << 8) |
|
||||
((uint32_t)(((cmb.ccolor >> 24) & 0xFF) * (1.0f-percent) + ((rdp.fog_color>>24) & 0xFF) * percent) << 24) |
|
||||
((uint32_t)(((cmb.ccolor >> 16) & 0xFF) * (1.0f-percent) + ((rdp.fog_color>>16) & 0xFF) * percent) << 16) |
|
||||
((uint32_t)(((cmb.ccolor >> 8) & 0xFF) * (1.0f-percent) + ((rdp.fog_color>>8) & 0xFF) * percent) << 8) |
|
||||
(cmb.ccolor & 0xFF);
|
||||
|
||||
rdp.col[0] = rdp.col[0] * (1.0f-percent) + ((rdp.fog_color>>24) & 0xFF) / 255.0f * percent;
|
||||
|
@ -15872,7 +15872,7 @@ void CombineBlender ()
|
|||
case 0xf550: //clr_fog * a_fog + clr_mem * (1-a)
|
||||
A_BLEND (GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA);
|
||||
{
|
||||
wxUint32 prim = rdp.prim_color;
|
||||
uint32_t prim = rdp.prim_color;
|
||||
rdp.prim_color = rdp.fog_color;
|
||||
cc_prim();
|
||||
ac_prim();
|
||||
|
@ -15885,7 +15885,7 @@ void CombineBlender ()
|
|||
A_BLEND (GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA);
|
||||
if (rdp.cycle_mode == 1 && rdp.cycle2 != 0x01ff1fff)
|
||||
{
|
||||
wxUint32 prim = rdp.prim_color;
|
||||
uint32_t prim = rdp.prim_color;
|
||||
rdp.prim_color = rdp.fog_color;
|
||||
ac_prim();
|
||||
rdp.prim_color = prim;
|
||||
|
@ -15894,7 +15894,7 @@ void CombineBlender ()
|
|||
|
||||
case 0xc912: //40 winks, clr_in * a_fog + clr_mem * 1
|
||||
{
|
||||
wxUint32 prim = rdp.prim_color;
|
||||
uint32_t prim = rdp.prim_color;
|
||||
rdp.prim_color = rdp.fog_color;
|
||||
ac_prim();
|
||||
rdp.prim_color = prim;
|
||||
|
@ -15920,9 +15920,9 @@ void CombineBlender ()
|
|||
|
||||
float percent = (rdp.fog_color & 0xFF) / 255.0f;
|
||||
cmb.ccolor =
|
||||
((wxUint32)(((cmb.ccolor >> 24) & 0xFF) * (1.0f-percent) + ((rdp.fog_color>>24) & 0xFF) * percent) << 24) |
|
||||
((wxUint32)(((cmb.ccolor >> 16) & 0xFF) * (1.0f-percent) + ((rdp.fog_color>>16) & 0xFF) * percent) << 16) |
|
||||
((wxUint32)(((cmb.ccolor >> 8) & 0xFF) * (1.0f-percent) + ((rdp.fog_color>>8) & 0xFF) * percent) << 8) |
|
||||
((uint32_t)(((cmb.ccolor >> 24) & 0xFF) * (1.0f-percent) + ((rdp.fog_color>>24) & 0xFF) * percent) << 24) |
|
||||
((uint32_t)(((cmb.ccolor >> 16) & 0xFF) * (1.0f-percent) + ((rdp.fog_color>>16) & 0xFF) * percent) << 16) |
|
||||
((uint32_t)(((cmb.ccolor >> 8) & 0xFF) * (1.0f-percent) + ((rdp.fog_color>>8) & 0xFF) * percent) << 8) |
|
||||
(cmb.ccolor & 0xFF);
|
||||
|
||||
rdp.col[0] = rdp.col[0] * (1.0f-percent) + ((rdp.fog_color>>24) & 0xFF) / 255.0f * percent;
|
||||
|
@ -16013,7 +16013,7 @@ void InitCombine ()
|
|||
|
||||
void ColorCombinerToExtension ()
|
||||
{
|
||||
wxUint32 ext_local, ext_local_a, ext_other, ext_other_a;
|
||||
uint32_t ext_local, ext_local_a, ext_other, ext_other_a;
|
||||
|
||||
switch (cmb.c_loc)
|
||||
{
|
||||
|
@ -16202,7 +16202,7 @@ void ColorCombinerToExtension ()
|
|||
|
||||
void AlphaCombinerToExtension ()
|
||||
{
|
||||
wxUint32 ext_local, ext_other;
|
||||
uint32_t ext_local, ext_other;
|
||||
switch (cmb.a_loc)
|
||||
{
|
||||
case GR_COMBINE_LOCAL_ITERATED:
|
||||
|
@ -16340,9 +16340,9 @@ void AlphaCombinerToExtension ()
|
|||
|
||||
void TexColorCombinerToExtension (GrChipID_t tmu)
|
||||
{
|
||||
wxUint32 tc_ext_a, tc_ext_a_mode, tc_ext_b, tc_ext_b_mode, tc_ext_c, tc_ext_d;
|
||||
uint32_t tc_ext_a, tc_ext_a_mode, tc_ext_b, tc_ext_b_mode, tc_ext_c, tc_ext_d;
|
||||
int tc_ext_c_invert, tc_ext_d_invert;
|
||||
wxUint32 tmu_func, tmu_fac;
|
||||
uint32_t tmu_func, tmu_fac;
|
||||
|
||||
if (tmu == GR_TMU0)
|
||||
{
|
||||
|
@ -16539,9 +16539,9 @@ void TexColorCombinerToExtension (GrChipID_t tmu)
|
|||
|
||||
void TexAlphaCombinerToExtension (GrChipID_t tmu)
|
||||
{
|
||||
wxUint32 ta_ext_a, ta_ext_a_mode, ta_ext_b, ta_ext_b_mode, ta_ext_c, ta_ext_d;
|
||||
uint32_t ta_ext_a, ta_ext_a_mode, ta_ext_b, ta_ext_b_mode, ta_ext_c, ta_ext_d;
|
||||
int ta_ext_c_invert, ta_ext_d_invert;
|
||||
wxUint32 tmu_a_func, tmu_a_fac;
|
||||
uint32_t tmu_a_func, tmu_a_fac;
|
||||
|
||||
if (tmu == GR_TMU0)
|
||||
{
|
||||
|
|
|
@ -69,41 +69,41 @@
|
|||
|
||||
typedef struct
|
||||
{
|
||||
wxUint32 ccolor; // constant color to set at the end, color and alpha
|
||||
wxUint32 c_fnc, c_fac, c_loc, c_oth; // grColorCombine flags
|
||||
wxUint32 a_fnc, a_fac, a_loc, a_oth; // grAlphaCombine flags
|
||||
wxUint32 tex, tmu0_func, tmu0_fac, tmu0_invert, tmu1_func, tmu1_fac, tmu1_invert;
|
||||
wxUint32 tmu0_a_func, tmu0_a_fac, tmu0_a_invert, tmu1_a_func, tmu1_a_fac, tmu1_a_invert;
|
||||
uint32_t ccolor; // constant color to set at the end, color and alpha
|
||||
uint32_t c_fnc, c_fac, c_loc, c_oth; // grColorCombine flags
|
||||
uint32_t a_fnc, a_fac, a_loc, a_oth; // grAlphaCombine flags
|
||||
uint32_t tex, tmu0_func, tmu0_fac, tmu0_invert, tmu1_func, tmu1_fac, tmu1_invert;
|
||||
uint32_t tmu0_a_func, tmu0_a_fac, tmu0_a_invert, tmu1_a_func, tmu1_a_fac, tmu1_a_invert;
|
||||
int dc0_lodbias, dc1_lodbias;
|
||||
wxUint8 dc0_detailscale, dc1_detailscale;
|
||||
float dc0_detailmax, dc1_detailmax;
|
||||
float lodbias0, lodbias1;
|
||||
wxUint32 abf1, abf2;
|
||||
wxUint32 mod_0, modcolor_0, modcolor1_0, modcolor2_0, modfactor_0;
|
||||
wxUint32 mod_1, modcolor_1, modcolor1_1, modcolor2_1, modfactor_1;
|
||||
uint32_t abf1, abf2;
|
||||
uint32_t mod_0, modcolor_0, modcolor1_0, modcolor2_0, modfactor_0;
|
||||
uint32_t mod_1, modcolor_1, modcolor1_1, modcolor2_1, modfactor_1;
|
||||
//combine extensions
|
||||
wxUint32 c_ext_a, c_ext_a_mode, c_ext_b, c_ext_b_mode, c_ext_c, c_ext_d;
|
||||
uint32_t c_ext_a, c_ext_a_mode, c_ext_b, c_ext_b_mode, c_ext_c, c_ext_d;
|
||||
int c_ext_c_invert, c_ext_d_invert;
|
||||
wxUint32 a_ext_a, a_ext_a_mode, a_ext_b, a_ext_b_mode, a_ext_c, a_ext_d;
|
||||
uint32_t a_ext_a, a_ext_a_mode, a_ext_b, a_ext_b_mode, a_ext_c, a_ext_d;
|
||||
int a_ext_c_invert, a_ext_d_invert;
|
||||
wxUint32 t0c_ext_a, t0c_ext_a_mode, t0c_ext_b, t0c_ext_b_mode, t0c_ext_c, t0c_ext_d;
|
||||
uint32_t t0c_ext_a, t0c_ext_a_mode, t0c_ext_b, t0c_ext_b_mode, t0c_ext_c, t0c_ext_d;
|
||||
int t0c_ext_c_invert, t0c_ext_d_invert;
|
||||
wxUint32 t0a_ext_a, t0a_ext_a_mode, t0a_ext_b, t0a_ext_b_mode, t0a_ext_c, t0a_ext_d;
|
||||
uint32_t t0a_ext_a, t0a_ext_a_mode, t0a_ext_b, t0a_ext_b_mode, t0a_ext_c, t0a_ext_d;
|
||||
int t0a_ext_c_invert, t0a_ext_d_invert;
|
||||
wxUint32 t1c_ext_a, t1c_ext_a_mode, t1c_ext_b, t1c_ext_b_mode, t1c_ext_c, t1c_ext_d;
|
||||
uint32_t t1c_ext_a, t1c_ext_a_mode, t1c_ext_b, t1c_ext_b_mode, t1c_ext_c, t1c_ext_d;
|
||||
int t1c_ext_c_invert, t1c_ext_d_invert;
|
||||
wxUint32 t1a_ext_a, t1a_ext_a_mode, t1a_ext_b, t1a_ext_b_mode, t1a_ext_c, t1a_ext_d;
|
||||
uint32_t t1a_ext_a, t1a_ext_a_mode, t1a_ext_b, t1a_ext_b_mode, t1a_ext_c, t1a_ext_d;
|
||||
int t1a_ext_c_invert, t1a_ext_d_invert;
|
||||
GRCOLORCOMBINEEXT grColorCombineExt;
|
||||
GRCOLORCOMBINEEXT grAlphaCombineExt;
|
||||
GRTEXCOLORCOMBINEEXT grTexColorCombineExt;
|
||||
GRTEXCOLORCOMBINEEXT grTexAlphaCombineExt;
|
||||
GRCONSTANTCOLORVALUEEXT grConstantColorValueExt;
|
||||
wxUint32 tex_ccolor;
|
||||
uint32_t tex_ccolor;
|
||||
int combine_ext;
|
||||
wxUint8 cmb_ext_use;
|
||||
wxUint8 tex_cmb_ext_use;
|
||||
wxUint32 shade_mod_hash;
|
||||
uint32_t shade_mod_hash;
|
||||
} COMBINE;
|
||||
|
||||
extern COMBINE cmb;
|
||||
|
|
|
@ -1036,7 +1036,7 @@ void Glide64ConfigDialog::do_layout()
|
|||
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
wxUint32 texfltr[] = {
|
||||
uint32_t texfltr[] = {
|
||||
NO_FILTER, //"None"
|
||||
SMOOTH_FILTER_1, //"Smooth filtering 1"
|
||||
SMOOTH_FILTER_2, //"Smooth filtering 2"
|
||||
|
@ -1046,7 +1046,7 @@ wxUint32 texfltr[] = {
|
|||
SHARP_FILTER_2, //"Sharp filtering 2"
|
||||
};
|
||||
|
||||
wxUint32 texenht[] = {
|
||||
uint32_t texenht[] = {
|
||||
NO_ENHANCEMENT, //"None"
|
||||
NO_ENHANCEMENT, //"Store"
|
||||
X2_ENHANCEMENT, //"X2"
|
||||
|
@ -1058,14 +1058,14 @@ wxUint32 texenht[] = {
|
|||
HQ4X_ENHANCEMENT, //"HQ4X"
|
||||
};
|
||||
|
||||
wxUint32 texcmpr[] = {
|
||||
uint32_t texcmpr[] = {
|
||||
//NO_COMPRESSION, //"None"
|
||||
// NCC_COMPRESSION, //"NCC"
|
||||
S3TC_COMPRESSION, //"S3TC"
|
||||
FXT1_COMPRESSION, //"FXT1"
|
||||
};
|
||||
|
||||
wxUint32 texhirs[] = {
|
||||
uint32_t texhirs[] = {
|
||||
NO_HIRESTEXTURES, //"Do not use"
|
||||
RICE_HIRESTEXTURES, //"Rice format"
|
||||
// GHQ_HIRESTEXTURES, //"GlideHQ format"
|
||||
|
|
|
@ -198,10 +198,10 @@ void debug_cacheviewer ()
|
|||
// Draw texture memory
|
||||
for (i=0; i<4; i++)
|
||||
{
|
||||
for (wxUint32 x=0; x<16; x++)
|
||||
for (uint32_t x=0; x<16; x++)
|
||||
{
|
||||
wxUint32 y = i+_debugger.tex_scroll;
|
||||
if (x+y*16 >= (wxUint32)rdp.n_cached[_debugger.tmu]) break;
|
||||
uint32_t y = i+_debugger.tex_scroll;
|
||||
if (x+y*16 >= (uint32_t)rdp.n_cached[_debugger.tmu]) break;
|
||||
CACHE_LUT * cache = voodoo.tex_UMA?rdp.cache[0]:rdp.cache[_debugger.tmu];
|
||||
|
||||
VERTEX v[4] = {
|
||||
|
@ -237,7 +237,7 @@ void debug_cacheviewer ()
|
|||
|
||||
void debug_capture ()
|
||||
{
|
||||
wxUint32 i,j;
|
||||
uint32_t i,j;
|
||||
|
||||
if (_debugger.tri_list == NULL) goto END;
|
||||
_debugger.tri_sel = _debugger.tri_list;
|
||||
|
@ -313,8 +313,8 @@ void debug_capture ()
|
|||
else
|
||||
{
|
||||
// on a texture
|
||||
_debugger.tex_sel = (((wxUint32)((pt.y-SY(512))/SY(64))+_debugger.tex_scroll)*16) +
|
||||
(wxUint32)(pt.x/SX(64));
|
||||
_debugger.tex_sel = (((uint32_t)((pt.y-SY(512))/SY(64))+_debugger.tex_scroll)*16) +
|
||||
(uint32_t)(pt.x/SX(64));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -324,8 +324,8 @@ void debug_capture ()
|
|||
|
||||
// Copy the screen capture back to the screen:
|
||||
grLfbWriteRegion(GR_BUFFER_BACKBUFFER,
|
||||
(wxUint32)rdp.offset_x,
|
||||
(wxUint32)rdp.offset_y,
|
||||
(uint32_t)rdp.offset_x,
|
||||
(uint32_t)rdp.offset_y,
|
||||
GR_LFB_SRC_FMT_565,
|
||||
settings.res_x,
|
||||
settings.res_y,
|
||||
|
@ -403,8 +403,8 @@ void debug_capture ()
|
|||
}
|
||||
|
||||
// and the selected texture
|
||||
wxUint32 t_y = ((_debugger.tex_sel & 0xFFFFFFF0) >> 4) - _debugger.tex_scroll;
|
||||
wxUint32 t_x = _debugger.tex_sel & 0xF;
|
||||
uint32_t t_y = ((_debugger.tex_sel & 0xFFFFFFF0) >> 4) - _debugger.tex_scroll;
|
||||
uint32_t t_x = _debugger.tex_sel & 0xF;
|
||||
VERTEX vt[4] = {
|
||||
{ SX(t_x*64.0f), SY(512+64.0f*t_y), 1, 1 },
|
||||
{ SX(t_x*64.0f+64.0f), SY(512+64.0f*t_y), 1, 1 },
|
||||
|
@ -615,7 +615,7 @@ void debug_capture ()
|
|||
}
|
||||
if (_debugger.page == PAGE_OTHERMODE_L && _debugger.tri_sel)
|
||||
{
|
||||
wxUint32 othermode_l = _debugger.tri_sel->othermode_l;
|
||||
uint32_t othermode_l = _debugger.tri_sel->othermode_l;
|
||||
COL_CATEGORY ();
|
||||
OUTPUT ("OTHERMODE_L: %08lx", othermode_l);
|
||||
OUTPUT_ ("AC_NONE", (othermode_l & 3) == 0);
|
||||
|
@ -655,7 +655,7 @@ void debug_capture ()
|
|||
}
|
||||
if (_debugger.page == PAGE_OTHERMODE_H && _debugger.tri_sel)
|
||||
{
|
||||
wxUint32 othermode_h = _debugger.tri_sel->othermode_h;
|
||||
uint32_t othermode_h = _debugger.tri_sel->othermode_h;
|
||||
COL_CATEGORY ();
|
||||
OUTPUT ("OTHERMODE_H: %08lx", othermode_h);
|
||||
OUTPUT_ ("CK_NONE", (othermode_h & 0x100) == 0);
|
||||
|
@ -726,7 +726,7 @@ void debug_capture ()
|
|||
OUTPUT1 ("v[%d].a: %d", j, _debugger.tri_sel->v[j].a);
|
||||
}
|
||||
}
|
||||
if (_debugger.page == PAGE_TEX_INFO && _debugger.tex_sel < (wxUint32)rdp.n_cached[_debugger.tmu])
|
||||
if (_debugger.page == PAGE_TEX_INFO && _debugger.tex_sel < (uint32_t)rdp.n_cached[_debugger.tmu])
|
||||
{
|
||||
COL_CATEGORY();
|
||||
OUTPUT ("CACHE (page 0)", 0);
|
||||
|
@ -756,9 +756,9 @@ void debug_capture ()
|
|||
output(800,(float)i,1,"crc: %08lx", cache[_debugger.tex_sel].crc);
|
||||
i-=16;
|
||||
#ifdef TEXTURE_FILTER
|
||||
output(800,(float)i,1,"RiceCrc: %08lx", (wxUint32)(rdp.cache[_debugger.tmu][_debugger.tex_sel].ricecrc&0xFFFFFFFF));
|
||||
output(800,(float)i,1,"RiceCrc: %08lx", (uint32_t)(rdp.cache[_debugger.tmu][_debugger.tex_sel].ricecrc&0xFFFFFFFF));
|
||||
i-=16;
|
||||
output(800,(float)i,1,"RicePalCrc: %08lx", (wxUint32)(rdp.cache[_debugger.tmu][_debugger.tex_sel].ricecrc>>32));
|
||||
output(800,(float)i,1,"RicePalCrc: %08lx", (uint32_t)(rdp.cache[_debugger.tmu][_debugger.tex_sel].ricecrc>>32));
|
||||
i-=16;
|
||||
#endif
|
||||
output(800,(float)i,1,"flags: %08lx", cache[_debugger.tex_sel].flags);
|
||||
|
@ -985,7 +985,7 @@ void output (float x, float y, int scale, const char *fmt, ...)
|
|||
va_end(ap);
|
||||
|
||||
wxUint8 c,r;
|
||||
for (wxUint32 i=0; i<strlen(out_buf); i++)
|
||||
for (uint32_t i=0; i<strlen(out_buf); i++)
|
||||
{
|
||||
c = ((out_buf[i]-32) & 0x1F) * 8;//<< 3;
|
||||
r = (((out_buf[i]-32) & 0xE0) >> 5) * 16;//<< 4;
|
||||
|
|
|
@ -43,10 +43,10 @@
|
|||
|
||||
typedef struct TEX_INFO_t
|
||||
{
|
||||
wxUint32 cur_cache[2]; // Current cache #
|
||||
uint32_t cur_cache[2]; // Current cache #
|
||||
wxUint8 format;
|
||||
wxUint8 size;
|
||||
wxUint32 width, height;
|
||||
uint32_t width, height;
|
||||
wxUint16 line, wid;
|
||||
wxUint8 palette;
|
||||
wxUint8 clamp_s, clamp_t;
|
||||
|
@ -61,15 +61,15 @@ typedef struct TEX_INFO_t
|
|||
|
||||
typedef struct TRI_INFO_t
|
||||
{
|
||||
wxUint32 nv; // Number of vertices
|
||||
uint32_t nv; // Number of vertices
|
||||
VERTEX *v; // Vertices (2d screen coords) of the triangle, used to outline
|
||||
wxUint32 cycle1, cycle2, cycle_mode; // Combine mode at the time of rendering
|
||||
uint32_t cycle1, cycle2, cycle_mode; // Combine mode at the time of rendering
|
||||
wxUint8 uncombined; // which is uncombined: 0x01=color 0x02=alpha 0x03=both
|
||||
wxUint32 geom_mode; // geometry mode flags
|
||||
wxUint32 othermode_h; // setothermode_h flags
|
||||
wxUint32 othermode_l; // setothermode_l flags
|
||||
wxUint32 tri_n; // Triangle number
|
||||
wxUint32 flags;
|
||||
uint32_t geom_mode; // geometry mode flags
|
||||
uint32_t othermode_h; // setothermode_h flags
|
||||
uint32_t othermode_l; // setothermode_l flags
|
||||
uint32_t tri_n; // Triangle number
|
||||
uint32_t flags;
|
||||
|
||||
int type; // 0-normal, 1-texrect, 2-fillrect
|
||||
|
||||
|
@ -77,12 +77,12 @@ typedef struct TRI_INFO_t
|
|||
TEX_INFO t[2];
|
||||
|
||||
// colors
|
||||
wxUint32 fog_color;
|
||||
wxUint32 fill_color;
|
||||
wxUint32 prim_color;
|
||||
wxUint32 blend_color;
|
||||
wxUint32 env_color;
|
||||
wxUint32 prim_lodmin, prim_lodfrac;
|
||||
uint32_t fog_color;
|
||||
uint32_t fill_color;
|
||||
uint32_t prim_color;
|
||||
uint32_t blend_color;
|
||||
uint32_t env_color;
|
||||
uint32_t prim_lodmin, prim_lodfrac;
|
||||
|
||||
TRI_INFO_t *pNext;
|
||||
} TRI_INFO;
|
||||
|
@ -91,20 +91,20 @@ typedef struct DEBUGGER_t
|
|||
{
|
||||
int capture; // Capture moment for debugging?
|
||||
|
||||
wxUint32 selected; // Selected object (see flags above)
|
||||
uint32_t selected; // Selected object (see flags above)
|
||||
TRI_INFO *tri_sel;
|
||||
|
||||
wxUint32 tex_scroll; // texture scrolling
|
||||
wxUint32 tex_sel;
|
||||
uint32_t tex_scroll; // texture scrolling
|
||||
uint32_t tex_sel;
|
||||
|
||||
// CAPTURE INFORMATION
|
||||
wxUint8 *screen; // Screen capture
|
||||
TRI_INFO *tri_list; // Triangle information list
|
||||
TRI_INFO *tri_last; // Last in the list (first in)
|
||||
|
||||
wxUint32 tmu; // tmu #
|
||||
uint32_t tmu; // tmu #
|
||||
|
||||
wxUint32 draw_mode;
|
||||
uint32_t draw_mode;
|
||||
|
||||
// Page number
|
||||
int page;
|
||||
|
|
|
@ -58,15 +58,15 @@ void ZLUT_init()
|
|||
zLUT = new wxUint16[0x40000];
|
||||
for(int i=0; i<0x40000; i++)
|
||||
{
|
||||
wxUint32 exponent = 0;
|
||||
wxUint32 testbit = 1 << 17;
|
||||
uint32_t exponent = 0;
|
||||
uint32_t testbit = 1 << 17;
|
||||
while((i & testbit) && (exponent < 7))
|
||||
{
|
||||
exponent++;
|
||||
testbit = 1 << (17 - exponent);
|
||||
}
|
||||
|
||||
wxUint32 mantissa = (i >> (6 - (6 < exponent ? 6 : exponent))) & 0x7ff;
|
||||
uint32_t mantissa = (i >> (6 - (6 < exponent ? 6 : exponent))) & 0x7ff;
|
||||
zLUT[i] = (wxUint16)(((exponent << 11) | mantissa) << 2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include "FBtoScreen.h"
|
||||
#include "TexCache.h"
|
||||
|
||||
static int SetupFBtoScreenCombiner(wxUint32 texture_size, wxUint32 opaque)
|
||||
static int SetupFBtoScreenCombiner(uint32_t texture_size, uint32_t opaque)
|
||||
{
|
||||
int tmu;
|
||||
if (voodoo.tmem_ptr[GR_TMU0]+texture_size < voodoo.tex_max_addr[0])
|
||||
|
@ -150,19 +150,19 @@ static void DrawRE2Video(FB_TO_SCREEN_INFO & fb_info, float scale)
|
|||
static void DrawRE2Video256(FB_TO_SCREEN_INFO & fb_info)
|
||||
{
|
||||
FRDP("DrawRE2Video256. ul_x=%d, ul_y=%d, lr_x=%d, lr_y=%d, size=%d, addr=%08lx\n", fb_info.ul_x, fb_info.ul_y, fb_info.lr_x, fb_info.lr_y, fb_info.size, fb_info.addr);
|
||||
wxUint32 * src = (wxUint32*)(gfx.RDRAM+fb_info.addr);
|
||||
uint32_t * src = (uint32_t*)(gfx.RDRAM+fb_info.addr);
|
||||
GrTexInfo t_info;
|
||||
t_info.smallLodLog2 = GR_LOD_LOG2_256;
|
||||
t_info.largeLodLog2 = GR_LOD_LOG2_256;
|
||||
t_info.aspectRatioLog2 = GR_ASPECT_LOG2_1x1;
|
||||
wxUint16 * tex = (wxUint16*)texture_buffer;
|
||||
wxUint16 * dst = tex;
|
||||
wxUint32 col;
|
||||
uint32_t col;
|
||||
wxUint8 r, g, b;
|
||||
fb_info.height = min(256, fb_info.height);
|
||||
for (wxUint32 h = 0; h < fb_info.height; h++)
|
||||
for (uint32_t h = 0; h < fb_info.height; h++)
|
||||
{
|
||||
for (wxUint32 w = 0; w < 256; w++)
|
||||
for (uint32_t w = 0; w < 256; w++)
|
||||
{
|
||||
col = *(src++);
|
||||
r = (wxUint8)((col >> 24)&0xFF);
|
||||
|
@ -197,40 +197,40 @@ static void DrawFrameBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
|
|||
return;
|
||||
}
|
||||
FRDP("DrawFrameBufferToScreen256. ul_x=%d, ul_y=%d, lr_x=%d, lr_y=%d, size=%d, addr=%08lx\n", fb_info.ul_x, fb_info.ul_y, fb_info.lr_x, fb_info.lr_y, fb_info.size, fb_info.addr);
|
||||
wxUint32 width = fb_info.lr_x - fb_info.ul_x + 1;
|
||||
wxUint32 height = fb_info.lr_y - fb_info.ul_y + 1;
|
||||
uint32_t width = fb_info.lr_x - fb_info.ul_x + 1;
|
||||
uint32_t height = fb_info.lr_y - fb_info.ul_y + 1;
|
||||
GrTexInfo t_info;
|
||||
wxUint8 * image = gfx.RDRAM+fb_info.addr;
|
||||
wxUint32 width256 = ((width-1) >> 8) + 1;
|
||||
wxUint32 height256 = ((height-1) >> 8) + 1;
|
||||
uint32_t width256 = ((width-1) >> 8) + 1;
|
||||
uint32_t height256 = ((height-1) >> 8) + 1;
|
||||
t_info.smallLodLog2 = t_info.largeLodLog2 = GR_LOD_LOG2_256;
|
||||
t_info.aspectRatioLog2 = GR_ASPECT_LOG2_1x1;
|
||||
t_info.format = GR_TEXFMT_ARGB_1555;
|
||||
wxUint16 * tex = (wxUint16*)texture_buffer;
|
||||
t_info.data = tex;
|
||||
wxUint32 tex_size = grTexTextureMemRequired (GR_MIPMAPLEVELMASK_BOTH, &t_info);
|
||||
uint32_t tex_size = grTexTextureMemRequired (GR_MIPMAPLEVELMASK_BOTH, &t_info);
|
||||
int tmu = SetupFBtoScreenCombiner(tex_size*width256*height256, fb_info.opaque);
|
||||
wxUint16 * src = (wxUint16*)image;
|
||||
src += fb_info.ul_x + fb_info.ul_y * fb_info.width;
|
||||
wxUint32 * src32 = (wxUint32*)image;
|
||||
uint32_t * src32 = (uint32_t*)image;
|
||||
src32 += fb_info.ul_x + fb_info.ul_y * fb_info.width;
|
||||
wxUint32 w_tail = width%256;
|
||||
wxUint32 h_tail = height%256;
|
||||
uint32_t w_tail = width%256;
|
||||
uint32_t h_tail = height%256;
|
||||
wxUint16 c;
|
||||
wxUint32 c32;
|
||||
wxUint32 idx;
|
||||
wxUint32 bound = BMASK+1-fb_info.addr;
|
||||
uint32_t c32;
|
||||
uint32_t idx;
|
||||
uint32_t bound = BMASK+1-fb_info.addr;
|
||||
bound = fb_info.size == 2 ? bound >> 1 : bound >> 2;
|
||||
wxUint8 r, g, b, a;
|
||||
wxUint32 cur_width, cur_height, cur_tail;
|
||||
wxUint32 tex_adr = voodoo.tex_min_addr[tmu]+voodoo.tmem_ptr[tmu];
|
||||
uint32_t cur_width, cur_height, cur_tail;
|
||||
uint32_t tex_adr = voodoo.tex_min_addr[tmu]+voodoo.tmem_ptr[tmu];
|
||||
if ((voodoo.tmem_ptr[tmu] < TEXMEM_2MB_EDGE) && (voodoo.tmem_ptr[tmu]+tex_size*width256*height256 > TEXMEM_2MB_EDGE))
|
||||
{
|
||||
tex_adr = TEXMEM_2MB_EDGE;
|
||||
}
|
||||
for (wxUint32 h = 0; h < height256; h++)
|
||||
for (uint32_t h = 0; h < height256; h++)
|
||||
{
|
||||
for (wxUint32 w = 0; w < width256; w++)
|
||||
for (uint32_t w = 0; w < width256; w++)
|
||||
{
|
||||
cur_width = (256*(w+1) < width) ? 256 : w_tail;
|
||||
cur_height = (256*(h+1) < height) ? 256 : h_tail;
|
||||
|
@ -238,9 +238,9 @@ static void DrawFrameBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
|
|||
wxUint16 * dst = tex;
|
||||
if (fb_info.size == 2)
|
||||
{
|
||||
for (wxUint32 y=0; y < cur_height; y++)
|
||||
for (uint32_t y=0; y < cur_height; y++)
|
||||
{
|
||||
for (wxUint32 x=0; x < cur_width; x++)
|
||||
for (uint32_t x=0; x < cur_width; x++)
|
||||
{
|
||||
idx = (x+256*w+(y+256*h)*fb_info.width)^1;
|
||||
if (idx >= bound)
|
||||
|
@ -253,9 +253,9 @@ static void DrawFrameBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
|
|||
}
|
||||
else
|
||||
{
|
||||
for (wxUint32 y=0; y < cur_height; y++)
|
||||
for (uint32_t y=0; y < cur_height; y++)
|
||||
{
|
||||
for (wxUint32 x=0; x < cur_width; x++)
|
||||
for (uint32_t x=0; x < cur_width; x++)
|
||||
{
|
||||
idx = (x+256*w+(y+256*h)*fb_info.width);
|
||||
if (idx >= bound)
|
||||
|
@ -306,10 +306,10 @@ bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
|||
{
|
||||
if (fb_info.width < 200 || fb_info.size < 2)
|
||||
return false;
|
||||
wxUint32 width = fb_info.lr_x - fb_info.ul_x + 1;
|
||||
wxUint32 height = fb_info.lr_y - fb_info.ul_y + 1;
|
||||
wxUint32 max_size = min(voodoo.max_tex_size, 512);
|
||||
if (width > (wxUint32)max_size || height > (wxUint32)max_size)
|
||||
uint32_t width = fb_info.lr_x - fb_info.ul_x + 1;
|
||||
uint32_t height = fb_info.lr_y - fb_info.ul_y + 1;
|
||||
uint32_t max_size = min(voodoo.max_tex_size, 512);
|
||||
if (width > (uint32_t)max_size || height > (uint32_t)max_size)
|
||||
{
|
||||
DrawFrameBufferToScreen256(fb_info);
|
||||
return true;
|
||||
|
@ -317,7 +317,7 @@ bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
|||
FRDP("DrawFrameBufferToScreen. ul_x=%d, ul_y=%d, lr_x=%d, lr_y=%d, size=%d, addr=%08lx\n", fb_info.ul_x, fb_info.ul_y, fb_info.lr_x, fb_info.lr_y, fb_info.size, fb_info.addr);
|
||||
GrTexInfo t_info;
|
||||
wxUint8 * image = gfx.RDRAM+fb_info.addr;
|
||||
wxUint32 texwidth;
|
||||
uint32_t texwidth;
|
||||
float scale;
|
||||
if (width <= 256)
|
||||
{
|
||||
|
@ -348,12 +348,12 @@ bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
|||
wxUint16 * src = (wxUint16*)image;
|
||||
src += fb_info.ul_x + fb_info.ul_y * fb_info.width;
|
||||
wxUint16 c;
|
||||
wxUint32 idx;
|
||||
const wxUint32 bound = (BMASK+1-fb_info.addr) >> 1;
|
||||
uint32_t idx;
|
||||
const uint32_t bound = (BMASK+1-fb_info.addr) >> 1;
|
||||
bool empty = true;
|
||||
for (wxUint32 y=0; y < height; y++)
|
||||
for (uint32_t y=0; y < height; y++)
|
||||
{
|
||||
for (wxUint32 x=0; x < width; x++)
|
||||
for (uint32_t x=0; x < width; x++)
|
||||
{
|
||||
idx = (x+y*fb_info.width)^1;
|
||||
if (idx >= bound)
|
||||
|
@ -371,16 +371,16 @@ bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
|||
}
|
||||
else
|
||||
{
|
||||
wxUint32 * tex = (wxUint32*)texture_buffer;
|
||||
wxUint32 * dst = tex;
|
||||
wxUint32 * src = (wxUint32*)image;
|
||||
uint32_t * tex = (uint32_t*)texture_buffer;
|
||||
uint32_t * dst = tex;
|
||||
uint32_t * src = (uint32_t*)image;
|
||||
src += fb_info.ul_x + fb_info.ul_y * fb_info.width;
|
||||
wxUint32 col;
|
||||
wxUint32 idx;
|
||||
const wxUint32 bound = (BMASK+1-fb_info.addr) >> 2;
|
||||
for (wxUint32 y=0; y < height; y++)
|
||||
uint32_t col;
|
||||
uint32_t idx;
|
||||
const uint32_t bound = (BMASK+1-fb_info.addr) >> 2;
|
||||
for (uint32_t y=0; y < height; y++)
|
||||
{
|
||||
for (wxUint32 x=0; x < width; x++)
|
||||
for (uint32_t x=0; x < width; x++)
|
||||
{
|
||||
idx = x+y*fb_info.width;
|
||||
if (idx >= bound)
|
||||
|
@ -431,18 +431,18 @@ bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
|||
static void DrawDepthBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
|
||||
{
|
||||
FRDP("DrawDepthBufferToScreen256. ul_x=%d, ul_y=%d, lr_x=%d, lr_y=%d, size=%d, addr=%08lx\n", fb_info.ul_x, fb_info.ul_y, fb_info.lr_x, fb_info.lr_y, fb_info.size, fb_info.addr);
|
||||
wxUint32 width = fb_info.lr_x - fb_info.ul_x + 1;
|
||||
wxUint32 height = fb_info.lr_y - fb_info.ul_y + 1;
|
||||
uint32_t width = fb_info.lr_x - fb_info.ul_x + 1;
|
||||
uint32_t height = fb_info.lr_y - fb_info.ul_y + 1;
|
||||
GrTexInfo t_info;
|
||||
wxUint8 * image = gfx.RDRAM+fb_info.addr;
|
||||
wxUint32 width256 = ((width-1) >> 8) + 1;
|
||||
wxUint32 height256 = ((height-1) >> 8) + 1;
|
||||
uint32_t width256 = ((width-1) >> 8) + 1;
|
||||
uint32_t height256 = ((height-1) >> 8) + 1;
|
||||
t_info.smallLodLog2 = t_info.largeLodLog2 = GR_LOD_LOG2_256;
|
||||
t_info.aspectRatioLog2 = GR_ASPECT_LOG2_1x1;
|
||||
t_info.format = GR_TEXFMT_ALPHA_INTENSITY_88;
|
||||
wxUint16 * tex = (wxUint16*)texture_buffer;
|
||||
t_info.data = tex;
|
||||
wxUint32 tex_size = grTexTextureMemRequired (GR_MIPMAPLEVELMASK_BOTH, &t_info);
|
||||
uint32_t tex_size = grTexTextureMemRequired (GR_MIPMAPLEVELMASK_BOTH, &t_info);
|
||||
int tmu = SetupFBtoScreenCombiner(tex_size*width256*height256, fb_info.opaque);
|
||||
grConstantColorValue (rdp.fog_color);
|
||||
grColorCombine (GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
|
@ -452,25 +452,25 @@ static void DrawDepthBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
|
|||
FXFALSE);
|
||||
wxUint16 * src = (wxUint16*)image;
|
||||
src += fb_info.ul_x + fb_info.ul_y * fb_info.width;
|
||||
wxUint32 w_tail = width%256;
|
||||
wxUint32 h_tail = height%256;
|
||||
wxUint32 cur_width, cur_height, cur_tail;
|
||||
wxUint32 tex_adr = voodoo.tex_min_addr[tmu]+voodoo.tmem_ptr[tmu];
|
||||
uint32_t w_tail = width%256;
|
||||
uint32_t h_tail = height%256;
|
||||
uint32_t cur_width, cur_height, cur_tail;
|
||||
uint32_t tex_adr = voodoo.tex_min_addr[tmu]+voodoo.tmem_ptr[tmu];
|
||||
if ((voodoo.tmem_ptr[tmu] < TEXMEM_2MB_EDGE) && (voodoo.tmem_ptr[tmu]+tex_size*width256*height256 > TEXMEM_2MB_EDGE))
|
||||
{
|
||||
tex_adr = TEXMEM_2MB_EDGE;
|
||||
}
|
||||
for (wxUint32 h = 0; h < height256; h++)
|
||||
for (uint32_t h = 0; h < height256; h++)
|
||||
{
|
||||
for (wxUint32 w = 0; w < width256; w++)
|
||||
for (uint32_t w = 0; w < width256; w++)
|
||||
{
|
||||
cur_width = (256*(w+1) < width) ? 256 : w_tail;
|
||||
cur_height = (256*(h+1) < height) ? 256 : h_tail;
|
||||
cur_tail = 256 - cur_width;
|
||||
wxUint16 * dst = tex;
|
||||
for (wxUint32 y=0; y < cur_height; y++)
|
||||
for (uint32_t y=0; y < cur_height; y++)
|
||||
{
|
||||
for (wxUint32 x=0; x < cur_width; x++)
|
||||
for (uint32_t x=0; x < cur_width; x++)
|
||||
{
|
||||
*(dst++) = rdp.pal_8[src[(x+256*w+(y+256*h)*fb_info.width)^1]>>8];
|
||||
}
|
||||
|
@ -571,9 +571,9 @@ static void DrawHiresDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
|||
|
||||
void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
||||
{
|
||||
wxUint32 width = fb_info.lr_x - fb_info.ul_x + 1;
|
||||
wxUint32 height = fb_info.lr_y - fb_info.ul_y + 1;
|
||||
if (width > (wxUint32)voodoo.max_tex_size || height > (wxUint32)voodoo.max_tex_size || width > 512)
|
||||
uint32_t width = fb_info.lr_x - fb_info.ul_x + 1;
|
||||
uint32_t height = fb_info.lr_y - fb_info.ul_y + 1;
|
||||
if (width > (uint32_t)voodoo.max_tex_size || height > (uint32_t)voodoo.max_tex_size || width > 512)
|
||||
{
|
||||
DrawDepthBufferToScreen256(fb_info);
|
||||
return;
|
||||
|
@ -586,7 +586,7 @@ void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
|||
FRDP("DrawDepthBufferToScreen. ul_x=%d, ul_y=%d, lr_x=%d, lr_y=%d, size=%d, addr=%08lx\n", fb_info.ul_x, fb_info.ul_y, fb_info.lr_x, fb_info.lr_y, fb_info.size, fb_info.addr);
|
||||
GrTexInfo t_info;
|
||||
wxUint8 * image = gfx.RDRAM+fb_info.addr;
|
||||
wxUint32 texwidth;
|
||||
uint32_t texwidth;
|
||||
float scale;
|
||||
if (width <= 256)
|
||||
{
|
||||
|
@ -614,9 +614,9 @@ void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
|||
wxUint16 * dst = tex;
|
||||
wxUint16 * src = (wxUint16*)image;
|
||||
src += fb_info.ul_x + fb_info.ul_y * fb_info.width;
|
||||
for (wxUint32 y=0; y < height; y++)
|
||||
for (uint32_t y=0; y < height; y++)
|
||||
{
|
||||
for (wxUint32 x=0; x < width; x++)
|
||||
for (uint32_t x=0; x < width; x++)
|
||||
{
|
||||
*(dst++) = rdp.pal_8[src[(x+y*fb_info.width)^1]>>8];
|
||||
}
|
||||
|
|
|
@ -46,15 +46,15 @@
|
|||
|
||||
typedef struct
|
||||
{
|
||||
wxUint32 addr; //color image address
|
||||
wxUint32 size;
|
||||
wxUint32 width;
|
||||
wxUint32 height;
|
||||
wxUint32 ul_x;
|
||||
wxUint32 ul_y;
|
||||
wxUint32 lr_x;
|
||||
wxUint32 lr_y;
|
||||
wxUint32 opaque;
|
||||
uint32_t addr; //color image address
|
||||
uint32_t size;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t ul_x;
|
||||
uint32_t ul_y;
|
||||
uint32_t lr_x;
|
||||
uint32_t lr_y;
|
||||
uint32_t opaque;
|
||||
} FB_TO_SCREEN_INFO;
|
||||
|
||||
bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info);
|
||||
|
|
|
@ -115,12 +115,12 @@ int64 perf_next;
|
|||
wxDateTime fps_last;
|
||||
wxDateTime fps_next;
|
||||
float fps = 0.0f;
|
||||
wxUint32 fps_count = 0;
|
||||
uint32_t fps_count = 0;
|
||||
|
||||
wxUint32 vi_count = 0;
|
||||
uint32_t vi_count = 0;
|
||||
float vi = 0.0f;
|
||||
|
||||
wxUint32 region = 0;
|
||||
uint32_t region = 0;
|
||||
|
||||
float ntsc_percent = 0.0f;
|
||||
float pal_percent = 0.0f;
|
||||
|
@ -128,7 +128,7 @@ float pal_percent = 0.0f;
|
|||
#endif
|
||||
|
||||
// Resolutions, MUST be in the correct order (SST1VID.H)
|
||||
wxUint32 resolutions[0x18][2] = {
|
||||
uint32_t resolutions[0x18][2] = {
|
||||
{ 320, 200 },
|
||||
{ 320, 240 },
|
||||
{ 400, 256 },
|
||||
|
@ -175,10 +175,10 @@ VOODOO voodoo = {0, 0, 0, 0,
|
|||
|
||||
GrTexInfo fontTex;
|
||||
GrTexInfo cursorTex;
|
||||
wxUint32 offset_font = 0;
|
||||
wxUint32 offset_cursor = 0;
|
||||
wxUint32 offset_textures = 0;
|
||||
wxUint32 offset_texbuf1 = 0;
|
||||
uint32_t offset_font = 0;
|
||||
uint32_t offset_cursor = 0;
|
||||
uint32_t offset_textures = 0;
|
||||
uint32_t offset_texbuf1 = 0;
|
||||
|
||||
int capture_screen = 0;
|
||||
wxString capture_path;
|
||||
|
@ -211,25 +211,25 @@ void _ChangeSize ()
|
|||
// float res_scl_x = (float)settings.res_x / 320.0f;
|
||||
float res_scl_y = (float)settings.res_y / 240.0f;
|
||||
|
||||
wxUint32 scale_x = *gfx.VI_X_SCALE_REG & 0xFFF;
|
||||
uint32_t scale_x = *gfx.VI_X_SCALE_REG & 0xFFF;
|
||||
if (!scale_x) return;
|
||||
wxUint32 scale_y = *gfx.VI_Y_SCALE_REG & 0xFFF;
|
||||
uint32_t scale_y = *gfx.VI_Y_SCALE_REG & 0xFFF;
|
||||
if (!scale_y) return;
|
||||
|
||||
float fscale_x = (float)scale_x / 1024.0f;
|
||||
float fscale_y = (float)scale_y / 2048.0f;
|
||||
|
||||
wxUint32 dwHStartReg = *gfx.VI_H_START_REG;
|
||||
wxUint32 dwVStartReg = *gfx.VI_V_START_REG;
|
||||
uint32_t dwHStartReg = *gfx.VI_H_START_REG;
|
||||
uint32_t dwVStartReg = *gfx.VI_V_START_REG;
|
||||
|
||||
wxUint32 hstart = dwHStartReg >> 16;
|
||||
wxUint32 hend = dwHStartReg & 0xFFFF;
|
||||
uint32_t hstart = dwHStartReg >> 16;
|
||||
uint32_t hend = dwHStartReg & 0xFFFF;
|
||||
|
||||
// dunno... but sometimes this happens
|
||||
if (hend == hstart) hend = (int)(*gfx.VI_WIDTH_REG / fscale_x);
|
||||
|
||||
wxUint32 vstart = dwVStartReg >> 16;
|
||||
wxUint32 vend = dwVStartReg & 0xFFFF;
|
||||
uint32_t vstart = dwVStartReg >> 16;
|
||||
uint32_t vend = dwVStartReg & 0xFFFF;
|
||||
|
||||
rdp.vi_width = (hend - hstart) * fscale_x;
|
||||
rdp.vi_height = (vend - vstart) * fscale_y * 1.0126582f;
|
||||
|
@ -257,13 +257,13 @@ void _ChangeSize ()
|
|||
//rdp.offset_x = 0;
|
||||
// rdp.offset_y = 0;
|
||||
rdp.offset_y = ((float)settings.res_y - rdp.vi_height * rdp.scale_y) * 0.5f;
|
||||
if (((wxUint32)rdp.vi_width <= (*gfx.VI_WIDTH_REG)/2) && (rdp.vi_width > rdp.vi_height))
|
||||
if (((uint32_t)rdp.vi_width <= (*gfx.VI_WIDTH_REG)/2) && (rdp.vi_width > rdp.vi_height))
|
||||
rdp.scale_y *= 0.5f;
|
||||
|
||||
rdp.scissor_o.ul_x = 0;
|
||||
rdp.scissor_o.ul_y = 0;
|
||||
rdp.scissor_o.lr_x = (wxUint32)rdp.vi_width;
|
||||
rdp.scissor_o.lr_y = (wxUint32)rdp.vi_height;
|
||||
rdp.scissor_o.lr_x = (uint32_t)rdp.vi_width;
|
||||
rdp.scissor_o.lr_y = (uint32_t)rdp.vi_height;
|
||||
|
||||
rdp.update |= UPDATE_VIEWPORT | UPDATE_SCISSOR;
|
||||
}
|
||||
|
@ -280,19 +280,19 @@ void ChangeSize ()
|
|||
case 0: //4:3
|
||||
if (settings.scr_res_x >= settings.scr_res_y * 4.0f / 3.0f) {
|
||||
settings.res_y = settings.scr_res_y;
|
||||
settings.res_x = (wxUint32)(settings.res_y * 4.0f / 3.0f);
|
||||
settings.res_x = (uint32_t)(settings.res_y * 4.0f / 3.0f);
|
||||
} else {
|
||||
settings.res_x = settings.scr_res_x;
|
||||
settings.res_y = (wxUint32)(settings.res_x / 4.0f * 3.0f);
|
||||
settings.res_y = (uint32_t)(settings.res_x / 4.0f * 3.0f);
|
||||
}
|
||||
break;
|
||||
case 1: //16:9
|
||||
if (settings.scr_res_x >= settings.scr_res_y * 16.0f / 9.0f) {
|
||||
settings.res_y = settings.scr_res_y;
|
||||
settings.res_x = (wxUint32)(settings.res_y * 16.0f / 9.0f);
|
||||
settings.res_x = (uint32_t)(settings.res_y * 16.0f / 9.0f);
|
||||
} else {
|
||||
settings.res_x = settings.scr_res_x;
|
||||
settings.res_y = (wxUint32)(settings.res_x / 16.0f * 9.0f);
|
||||
settings.res_y = (uint32_t)(settings.res_x / 16.0f * 9.0f);
|
||||
}
|
||||
break;
|
||||
default: //stretch or original
|
||||
|
@ -302,8 +302,8 @@ void ChangeSize ()
|
|||
_ChangeSize ();
|
||||
rdp.offset_x = (settings.scr_res_x - settings.res_x) / 2.0f;
|
||||
float offset_y = (settings.scr_res_y - settings.res_y) / 2.0f;
|
||||
settings.res_x += (wxUint32)rdp.offset_x;
|
||||
settings.res_y += (wxUint32)offset_y;
|
||||
settings.res_x += (uint32_t)rdp.offset_x;
|
||||
settings.res_y += (uint32_t)offset_y;
|
||||
rdp.offset_y += offset_y;
|
||||
if (settings.aspectmode == 3) // original
|
||||
{
|
||||
|
@ -328,7 +328,7 @@ void UseUnregisteredSetting (int /*SettingID*/)
|
|||
void ReadSettings ()
|
||||
{
|
||||
settings.card_id = GetSetting(Set_CardId);
|
||||
settings.res_data = (wxUint32)GetSetting(Set_Resolution);
|
||||
settings.res_data = (uint32_t)GetSetting(Set_Resolution);
|
||||
if (settings.res_data >= 24) settings.res_data = 12;
|
||||
settings.scr_res_x = settings.res_x = resolutions[settings.res_data][0];
|
||||
settings.scr_res_y = settings.res_y = resolutions[settings.res_data][1];
|
||||
|
@ -484,7 +484,7 @@ void ReadSpecialSettings (const char * name)
|
|||
settings.pal230 = GetSetting(Set_pal230) == 1 ? 1 : 0;
|
||||
settings.stipple_mode = GetSetting(Set_stipple_mode);
|
||||
int stipple_pattern = GetSetting(Set_stipple_pattern);
|
||||
settings.stipple_pattern = stipple_pattern > 0 ? (wxUint32)stipple_pattern : 0x3E0F83E0;
|
||||
settings.stipple_pattern = stipple_pattern > 0 ? (uint32_t)stipple_pattern : 0x3E0F83E0;
|
||||
settings.force_microcheck = GetSetting(Set_force_microcheck);
|
||||
settings.force_quad3d = GetSetting(Set_force_quad3d);
|
||||
settings.clip_zmin = GetSetting(Set_clip_zmin);
|
||||
|
@ -528,7 +528,7 @@ void ReadSpecialSettings (const char * name)
|
|||
int resolution = GetSetting(Set_Resolution);
|
||||
if (resolution >= 0)
|
||||
{
|
||||
settings.res_data = (wxUint32)resolution;
|
||||
settings.res_data = (uint32_t)resolution;
|
||||
if (settings.res_data >= 0x18) settings.res_data = 12;
|
||||
settings.scr_res_x = settings.res_x = resolutions[settings.res_data][0];
|
||||
settings.scr_res_y = settings.res_y = resolutions[settings.res_data][1];
|
||||
|
@ -713,8 +713,8 @@ void guLoadTextures ()
|
|||
}
|
||||
|
||||
#include "font.h"
|
||||
wxUint32 *data = (wxUint32*)font;
|
||||
wxUint32 cur;
|
||||
uint32_t *data = (uint32_t*)font;
|
||||
uint32_t cur;
|
||||
|
||||
// ** Font texture **
|
||||
wxUint8 *tex8 = (wxUint8*)malloc(256*64);
|
||||
|
@ -725,7 +725,7 @@ void guLoadTextures ()
|
|||
fontTex.data = tex8;
|
||||
|
||||
// Decompression: [1-bit inverse alpha --> 8-bit alpha]
|
||||
wxUint32 i,b;
|
||||
uint32_t i,b;
|
||||
for (i=0; i<0x200; i++)
|
||||
{
|
||||
// cur = ~*(data++), byteswapped
|
||||
|
@ -755,7 +755,7 @@ void guLoadTextures ()
|
|||
|
||||
// ** Cursor texture **
|
||||
#include "cursor.h"
|
||||
data = (wxUint32*)cursor;
|
||||
data = (uint32_t*)cursor;
|
||||
|
||||
wxUint16 *tex16 = (wxUint16*)malloc(32*32*2);
|
||||
|
||||
|
@ -874,10 +874,10 @@ int InitGfx ()
|
|||
}
|
||||
//*/
|
||||
|
||||
wxUint32 res_data = settings.res_data;
|
||||
uint32_t res_data = settings.res_data;
|
||||
if (ev_fullscreen)
|
||||
{
|
||||
wxUint32 _width, _height = 0;
|
||||
uint32_t _width, _height = 0;
|
||||
settings.res_data = grWrapperFullScreenResolutionExt((FxU32*)&_width, (FxU32*)&_height);
|
||||
settings.scr_res_x = settings.res_x = _width;
|
||||
settings.scr_res_y = settings.res_y = _height;
|
||||
|
@ -1229,9 +1229,9 @@ void CALL ReadScreen(void **dest, int *width, int *height)
|
|||
|
||||
if (!fullscreen)
|
||||
{
|
||||
for (wxUint32 y=0; y<settings.res_y; y++)
|
||||
for (uint32_t y=0; y<settings.res_y; y++)
|
||||
{
|
||||
for (wxUint32 x=0; x<settings.res_x; x++)
|
||||
for (uint32_t x=0; x<settings.res_x; x++)
|
||||
{
|
||||
line[x*3] = 0x20;
|
||||
line[x*3+1] = 0x7f;
|
||||
|
@ -1251,17 +1251,17 @@ void CALL ReadScreen(void **dest, int *width, int *height)
|
|||
FXFALSE,
|
||||
&info))
|
||||
{
|
||||
wxUint32 offset_src=info.strideInBytes*(settings.scr_res_y-1);
|
||||
uint32_t offset_src=info.strideInBytes*(settings.scr_res_y-1);
|
||||
|
||||
// Copy the screen
|
||||
wxUint8 r, g, b;
|
||||
if (info.writeMode == GR_LFBWRITEMODE_8888)
|
||||
{
|
||||
wxUint32 col;
|
||||
for (wxUint32 y=0; y<settings.res_y; y++)
|
||||
uint32_t col;
|
||||
for (uint32_t y=0; y<settings.res_y; y++)
|
||||
{
|
||||
wxUint32 *ptr = (wxUint32*)((wxUint8*)info.lfbPtr + offset_src);
|
||||
for (wxUint32 x=0; x<settings.res_x; x++)
|
||||
uint32_t *ptr = (uint32_t*)((wxUint8*)info.lfbPtr + offset_src);
|
||||
for (uint32_t x=0; x<settings.res_x; x++)
|
||||
{
|
||||
col = *(ptr++);
|
||||
r = (wxUint8)((col >> 16) & 0xFF);
|
||||
|
@ -1278,10 +1278,10 @@ void CALL ReadScreen(void **dest, int *width, int *height)
|
|||
else
|
||||
{
|
||||
wxUint16 col;
|
||||
for (wxUint32 y=0; y<settings.res_y; y++)
|
||||
for (uint32_t y=0; y<settings.res_y; y++)
|
||||
{
|
||||
wxUint16 *ptr = (wxUint16*)((wxUint8*)info.lfbPtr + offset_src);
|
||||
for (wxUint32 x=0; x<settings.res_x; x++)
|
||||
for (uint32_t x=0; x<settings.res_x; x++)
|
||||
{
|
||||
col = *(ptr++);
|
||||
r = (wxUint8)((float)(col >> 11) / 31.0f * 255.0f);
|
||||
|
@ -1688,7 +1688,7 @@ void CALL RomClosed (void)
|
|||
|
||||
static void CheckDRAMSize()
|
||||
{
|
||||
wxUint32 test;
|
||||
uint32_t test;
|
||||
GLIDE64_TRY
|
||||
{
|
||||
test = gfx.RDRAM[0x007FFFFF] + 1;
|
||||
|
@ -1819,10 +1819,10 @@ void CALL ShowCFB (void)
|
|||
void drawViRegBG()
|
||||
{
|
||||
LRDP("drawViRegBG\n");
|
||||
const wxUint32 VIwidth = *gfx.VI_WIDTH_REG;
|
||||
const uint32_t VIwidth = *gfx.VI_WIDTH_REG;
|
||||
FB_TO_SCREEN_INFO fb_info;
|
||||
fb_info.width = VIwidth;
|
||||
fb_info.height = (wxUint32)rdp.vi_height;
|
||||
fb_info.height = (uint32_t)rdp.vi_height;
|
||||
if (fb_info.height == 0)
|
||||
{
|
||||
LRDP("Image height = 0 - skipping\n");
|
||||
|
@ -1831,7 +1831,7 @@ void drawViRegBG()
|
|||
fb_info.ul_x = 0;
|
||||
|
||||
fb_info.lr_x = VIwidth - 1;
|
||||
// fb_info.lr_x = (wxUint32)rdp.vi_width - 1;
|
||||
// fb_info.lr_x = (uint32_t)rdp.vi_width - 1;
|
||||
fb_info.ul_y = 0;
|
||||
fb_info.lr_y = fb_info.height - 1;
|
||||
fb_info.opaque = 1;
|
||||
|
@ -1876,7 +1876,7 @@ set
|
|||
input: none
|
||||
output: none
|
||||
*******************************************************************/
|
||||
wxUint32 update_screen_count = 0;
|
||||
uint32_t update_screen_count = 0;
|
||||
void CALL UpdateScreen (void)
|
||||
{
|
||||
#ifdef LOG_KEY
|
||||
|
@ -1890,7 +1890,7 @@ void CALL UpdateScreen (void)
|
|||
LOG (out_buf);
|
||||
LRDP(out_buf);
|
||||
|
||||
wxUint32 width = (*gfx.VI_WIDTH_REG) << 1;
|
||||
uint32_t width = (*gfx.VI_WIDTH_REG) << 1;
|
||||
if (fullscreen && (*gfx.VI_ORIGIN_REG > width))
|
||||
update_screen_count++;
|
||||
|
||||
|
@ -1914,7 +1914,7 @@ void CALL UpdateScreen (void)
|
|||
}
|
||||
#endif
|
||||
//*
|
||||
wxUint32 limit = (settings.hacks&hack_Lego) ? 15 : 30;
|
||||
uint32_t limit = (settings.hacks&hack_Lego) ? 15 : 30;
|
||||
if ((settings.frame_buffer&fb_cpu_write_hack) && (update_screen_count > limit) && (rdp.last_bg == 0))
|
||||
{
|
||||
LRDP("DirectCPUWrite hack!\n");
|
||||
|
@ -1946,7 +1946,7 @@ void CALL UpdateScreen (void)
|
|||
|
||||
static void DrawWholeFrameBufferToScreen()
|
||||
{
|
||||
static wxUint32 toScreenCI = 0;
|
||||
static uint32_t toScreenCI = 0;
|
||||
if (rdp.ci_width < 200)
|
||||
return;
|
||||
if (rdp.cimg == toScreenCI)
|
||||
|
@ -1983,7 +1983,7 @@ static void GetGammaTable()
|
|||
}
|
||||
}
|
||||
|
||||
wxUint32 curframe = 0;
|
||||
uint32_t curframe = 0;
|
||||
void newSwapBuffers()
|
||||
{
|
||||
if (!rdp.updatescreen)
|
||||
|
@ -2129,10 +2129,10 @@ void newSwapBuffers()
|
|||
break;
|
||||
}
|
||||
|
||||
const wxUint32 offset_x = (wxUint32)rdp.offset_x;
|
||||
const wxUint32 offset_y = (wxUint32)rdp.offset_y;
|
||||
const wxUint32 image_width = settings.scr_res_x - offset_x*2;
|
||||
const wxUint32 image_height = settings.scr_res_y - offset_y*2;
|
||||
const uint32_t offset_x = (uint32_t)rdp.offset_x;
|
||||
const uint32_t offset_y = (uint32_t)rdp.offset_y;
|
||||
const uint32_t image_width = settings.scr_res_x - offset_x*2;
|
||||
const uint32_t image_height = settings.scr_res_y - offset_y*2;
|
||||
|
||||
GrLfbInfo_t info;
|
||||
info.size = sizeof(GrLfbInfo_t);
|
||||
|
@ -2145,17 +2145,17 @@ void newSwapBuffers()
|
|||
{
|
||||
wxUint8 *ssimg = (wxUint8*)malloc(image_width * image_height * 3); // will be free in wxImage destructor
|
||||
int sspos = 0;
|
||||
wxUint32 offset_src = info.strideInBytes * offset_y;
|
||||
uint32_t offset_src = info.strideInBytes * offset_y;
|
||||
|
||||
// Copy the screen
|
||||
if (info.writeMode == GR_LFBWRITEMODE_8888)
|
||||
{
|
||||
wxUint32 col;
|
||||
for (wxUint32 y = 0; y < image_height; y++)
|
||||
uint32_t col;
|
||||
for (uint32_t y = 0; y < image_height; y++)
|
||||
{
|
||||
wxUint32 *ptr = (wxUint32*)((wxUint8*)info.lfbPtr + offset_src);
|
||||
uint32_t *ptr = (uint32_t*)((wxUint8*)info.lfbPtr + offset_src);
|
||||
ptr += offset_x;
|
||||
for (wxUint32 x = 0; x < image_width; x++)
|
||||
for (uint32_t x = 0; x < image_width; x++)
|
||||
{
|
||||
col = *(ptr++);
|
||||
ssimg[sspos++] = (wxUint8)((col >> 16) & 0xFF);
|
||||
|
@ -2168,11 +2168,11 @@ void newSwapBuffers()
|
|||
else
|
||||
{
|
||||
wxUint16 col;
|
||||
for (wxUint32 y = 0; y < image_height; y++)
|
||||
for (uint32_t y = 0; y < image_height; y++)
|
||||
{
|
||||
wxUint16 *ptr = (wxUint16*)((wxUint8*)info.lfbPtr + offset_src);
|
||||
ptr += offset_x;
|
||||
for (wxUint32 x = 0; x < image_width; x++)
|
||||
for (uint32_t x = 0; x < image_width; x++)
|
||||
{
|
||||
col = *(ptr++);
|
||||
ssimg[sspos++] = (wxUint8)((float)(col >> 11) / 31.0f * 255.0f);
|
||||
|
@ -2206,17 +2206,17 @@ void newSwapBuffers()
|
|||
FXFALSE,
|
||||
&info));
|
||||
|
||||
wxUint32 offset_src=0, offset_dst=0;
|
||||
uint32_t offset_src=0, offset_dst=0;
|
||||
|
||||
// Copy the screen
|
||||
for (wxUint32 y=0; y<settings.res_y; y++)
|
||||
for (uint32_t y=0; y<settings.res_y; y++)
|
||||
{
|
||||
if (info.writeMode == GR_LFBWRITEMODE_8888)
|
||||
{
|
||||
wxUint32 *src = (wxUint32*)((wxUint8*)info.lfbPtr + offset_src);
|
||||
uint32_t *src = (uint32_t*)((wxUint8*)info.lfbPtr + offset_src);
|
||||
wxUint16 *dst = (wxUint16*)(_debugger.screen + offset_dst);
|
||||
wxUint8 r, g, b;
|
||||
wxUint32 col;
|
||||
uint32_t col;
|
||||
for (unsigned int x = 0; x < settings.res_x; x++)
|
||||
{
|
||||
col = src[x];
|
||||
|
@ -2317,8 +2317,8 @@ void newSwapBuffers()
|
|||
debugging = 1;
|
||||
|
||||
// Recalculate screen size, don't resize screen
|
||||
settings.res_x = (wxUint32)(settings.scr_res_x * 0.625f);
|
||||
settings.res_y = (wxUint32)(settings.scr_res_y * 0.625f);
|
||||
settings.res_x = (uint32_t)(settings.scr_res_x * 0.625f);
|
||||
settings.res_y = (uint32_t)(settings.scr_res_y * 0.625f);
|
||||
|
||||
ChangeSize ();
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
//****************************************************************
|
||||
#include <Common/stdtypes.h>
|
||||
#include <string.h>
|
||||
typedef uint32_t wxUint32;
|
||||
typedef uint32_t uint32_t;
|
||||
|
||||
static inline void mirror16bS(uint8_t *tex, uint8_t *start, int width, int height, int mask, int line, int full, int count)
|
||||
{
|
||||
|
@ -129,12 +129,12 @@ static inline void clamp16bS(uint8_t *tex, uint8_t *constant, int height, int li
|
|||
|
||||
//****************************************************************
|
||||
// 16-bit Horizontal Mirror
|
||||
void Mirror16bS (unsigned char * tex, wxUint32 mask, wxUint32 max_width, wxUint32 real_width, wxUint32 height)
|
||||
void Mirror16bS (unsigned char * tex, uint32_t mask, uint32_t max_width, uint32_t real_width, uint32_t height)
|
||||
{
|
||||
if (mask == 0) return;
|
||||
|
||||
wxUint32 mask_width = (1 << mask);
|
||||
wxUint32 mask_mask = (mask_width-1) << 1;
|
||||
uint32_t mask_width = (1 << mask);
|
||||
uint32_t mask_mask = (mask_width-1) << 1;
|
||||
if (mask_width >= max_width) return;
|
||||
int count = max_width - mask_width;
|
||||
if (count <= 0) return;
|
||||
|
@ -148,12 +148,12 @@ void Mirror16bS (unsigned char * tex, wxUint32 mask, wxUint32 max_width, wxUint3
|
|||
//****************************************************************
|
||||
// 16-bit Horizontal Wrap (like mirror)
|
||||
|
||||
void Wrap16bS (unsigned char * tex, wxUint32 mask, wxUint32 max_width, wxUint32 real_width, wxUint32 height)
|
||||
void Wrap16bS (unsigned char * tex, uint32_t mask, uint32_t max_width, uint32_t real_width, uint32_t height)
|
||||
{
|
||||
if (mask == 0) return;
|
||||
|
||||
wxUint32 mask_width = (1 << mask);
|
||||
wxUint32 mask_mask = (mask_width-1) >> 1;
|
||||
uint32_t mask_width = (1 << mask);
|
||||
uint32_t mask_mask = (mask_width-1) >> 1;
|
||||
if (mask_width >= max_width) return;
|
||||
int count = (max_width - mask_width) >> 1;
|
||||
if (count <= 0) return;
|
||||
|
@ -167,7 +167,7 @@ void Wrap16bS (unsigned char * tex, wxUint32 mask, wxUint32 max_width, wxUint32
|
|||
//****************************************************************
|
||||
// 16-bit Horizontal Clamp
|
||||
|
||||
void Clamp16bS (unsigned char * tex, wxUint32 width, wxUint32 clamp_to, wxUint32 real_width, wxUint32 real_height)
|
||||
void Clamp16bS (unsigned char * tex, uint32_t width, uint32_t clamp_to, uint32_t real_width, uint32_t real_height)
|
||||
{
|
||||
if (real_width <= width) return;
|
||||
|
||||
|
@ -184,18 +184,18 @@ void Clamp16bS (unsigned char * tex, wxUint32 width, wxUint32 clamp_to, wxUint32
|
|||
//****************************************************************
|
||||
// 16-bit Vertical Mirror
|
||||
|
||||
void Mirror16bT (unsigned char * tex, wxUint32 mask, wxUint32 max_height, wxUint32 real_width)
|
||||
void Mirror16bT (unsigned char * tex, uint32_t mask, uint32_t max_height, uint32_t real_width)
|
||||
{
|
||||
if (mask == 0) return;
|
||||
|
||||
wxUint32 mask_height = (1 << mask);
|
||||
wxUint32 mask_mask = mask_height-1;
|
||||
uint32_t mask_height = (1 << mask);
|
||||
uint32_t mask_mask = mask_height-1;
|
||||
if (max_height <= mask_height) return;
|
||||
int line_full = real_width << 1;
|
||||
|
||||
unsigned char * dst = tex + mask_height * line_full;
|
||||
|
||||
for (wxUint32 y=mask_height; y<max_height; y++)
|
||||
for (uint32_t y=mask_height; y<max_height; y++)
|
||||
{
|
||||
if (y & mask_height)
|
||||
{
|
||||
|
@ -215,18 +215,18 @@ void Mirror16bT (unsigned char * tex, wxUint32 mask, wxUint32 max_height, wxUint
|
|||
//****************************************************************
|
||||
// 16-bit Vertical Wrap
|
||||
|
||||
void Wrap16bT (unsigned char * tex, wxUint32 mask, wxUint32 max_height, wxUint32 real_width)
|
||||
void Wrap16bT (unsigned char * tex, uint32_t mask, uint32_t max_height, uint32_t real_width)
|
||||
{
|
||||
if (mask == 0) return;
|
||||
|
||||
wxUint32 mask_height = (1 << mask);
|
||||
wxUint32 mask_mask = mask_height-1;
|
||||
uint32_t mask_height = (1 << mask);
|
||||
uint32_t mask_mask = mask_height-1;
|
||||
if (max_height <= mask_height) return;
|
||||
int line_full = real_width << 1;
|
||||
|
||||
unsigned char * dst = tex + mask_height * line_full;
|
||||
|
||||
for (wxUint32 y=mask_height; y<max_height; y++)
|
||||
for (uint32_t y=mask_height; y<max_height; y++)
|
||||
{
|
||||
// not mirrored
|
||||
memcpy ((void*)dst, (void*)(tex + (y & mask_mask) * line_full), line_full);
|
||||
|
@ -238,13 +238,13 @@ void Wrap16bT (unsigned char * tex, wxUint32 mask, wxUint32 max_height, wxUint32
|
|||
//****************************************************************
|
||||
// 16-bit Vertical Clamp
|
||||
|
||||
void Clamp16bT (unsigned char * tex, wxUint32 height, wxUint32 real_width, wxUint32 clamp_to)
|
||||
void Clamp16bT (unsigned char * tex, uint32_t height, uint32_t real_width, uint32_t clamp_to)
|
||||
{
|
||||
int line_full = real_width << 1;
|
||||
unsigned char * dst = tex + height * line_full;
|
||||
unsigned char * const_line = dst - line_full;
|
||||
|
||||
for (wxUint32 y=height; y<clamp_to; y++)
|
||||
for (uint32_t y=height; y<clamp_to; y++)
|
||||
{
|
||||
memcpy ((void*)dst, (void*)const_line, line_full);
|
||||
dst += line_full;
|
||||
|
|
|
@ -131,12 +131,12 @@ static inline void clamp32bS(uint8_t *tex, uint8_t *constant, int height, int li
|
|||
//****************************************************************
|
||||
// 32-bit Horizontal Mirror
|
||||
|
||||
void Mirror32bS (unsigned char * tex, wxUint32 mask, wxUint32 max_width, wxUint32 real_width, wxUint32 height)
|
||||
void Mirror32bS (unsigned char * tex, uint32_t mask, uint32_t max_width, uint32_t real_width, uint32_t height)
|
||||
{
|
||||
if (mask == 0) return;
|
||||
|
||||
wxUint32 mask_width = (1 << mask);
|
||||
wxUint32 mask_mask = (mask_width-1) << 2;
|
||||
uint32_t mask_width = (1 << mask);
|
||||
uint32_t mask_mask = (mask_width-1) << 2;
|
||||
if (mask_width >= max_width) return;
|
||||
int count = max_width - mask_width;
|
||||
if (count <= 0) return;
|
||||
|
@ -150,12 +150,12 @@ void Mirror32bS (unsigned char * tex, wxUint32 mask, wxUint32 max_width, wxUint3
|
|||
//****************************************************************
|
||||
// 32-bit Horizontal Wrap
|
||||
|
||||
void Wrap32bS (unsigned char * tex, wxUint32 mask, wxUint32 max_width, wxUint32 real_width, wxUint32 height)
|
||||
void Wrap32bS (unsigned char * tex, uint32_t mask, uint32_t max_width, uint32_t real_width, uint32_t height)
|
||||
{
|
||||
if (mask == 0) return;
|
||||
|
||||
wxUint32 mask_width = (1 << mask);
|
||||
wxUint32 mask_mask = (mask_width-1);
|
||||
uint32_t mask_width = (1 << mask);
|
||||
uint32_t mask_mask = (mask_width-1);
|
||||
if (mask_width >= max_width) return;
|
||||
int count = (max_width - mask_width);
|
||||
if (count <= 0) return;
|
||||
|
@ -169,7 +169,7 @@ void Wrap32bS (unsigned char * tex, wxUint32 mask, wxUint32 max_width, wxUint32
|
|||
//****************************************************************
|
||||
// 32-bit Horizontal Clamp
|
||||
|
||||
void Clamp32bS (unsigned char * tex, wxUint32 width, wxUint32 clamp_to, wxUint32 real_width, wxUint32 real_height)
|
||||
void Clamp32bS (unsigned char * tex, uint32_t width, uint32_t clamp_to, uint32_t real_width, uint32_t real_height)
|
||||
{
|
||||
if (real_width <= width) return;
|
||||
|
||||
|
@ -186,18 +186,18 @@ void Clamp32bS (unsigned char * tex, wxUint32 width, wxUint32 clamp_to, wxUint32
|
|||
//****************************************************************
|
||||
// 32-bit Vertical Mirror
|
||||
|
||||
void Mirror32bT (unsigned char * tex, wxUint32 mask, wxUint32 max_height, wxUint32 real_width)
|
||||
void Mirror32bT (unsigned char * tex, uint32_t mask, uint32_t max_height, uint32_t real_width)
|
||||
{
|
||||
if (mask == 0) return;
|
||||
|
||||
wxUint32 mask_height = (1 << mask);
|
||||
wxUint32 mask_mask = mask_height-1;
|
||||
uint32_t mask_height = (1 << mask);
|
||||
uint32_t mask_mask = mask_height-1;
|
||||
if (max_height <= mask_height) return;
|
||||
int line_full = real_width << 2;
|
||||
|
||||
unsigned char *dst = tex + mask_height * line_full;
|
||||
|
||||
for (wxUint32 y=mask_height; y<max_height; y++)
|
||||
for (uint32_t y=mask_height; y<max_height; y++)
|
||||
{
|
||||
if (y & mask_height)
|
||||
{
|
||||
|
@ -217,18 +217,18 @@ void Mirror32bT (unsigned char * tex, wxUint32 mask, wxUint32 max_height, wxUint
|
|||
//****************************************************************
|
||||
// 32-bit Vertical Wrap
|
||||
|
||||
void Wrap32bT (unsigned char * tex, wxUint32 mask, wxUint32 max_height, wxUint32 real_width)
|
||||
void Wrap32bT (unsigned char * tex, uint32_t mask, uint32_t max_height, uint32_t real_width)
|
||||
{
|
||||
if (mask == 0) return;
|
||||
|
||||
wxUint32 mask_height = (1 << mask);
|
||||
wxUint32 mask_mask = mask_height-1;
|
||||
uint32_t mask_height = (1 << mask);
|
||||
uint32_t mask_mask = mask_height-1;
|
||||
if (max_height <= mask_height) return;
|
||||
int line_full = real_width << 2;
|
||||
|
||||
unsigned char *dst = tex + mask_height * line_full;
|
||||
|
||||
for (wxUint32 y=mask_height; y<max_height; y++)
|
||||
for (uint32_t y=mask_height; y<max_height; y++)
|
||||
{
|
||||
// not mirrored
|
||||
memcpy ((void*)dst, (void*)(tex + (y & mask_mask) * (line_full>>2)), (line_full>>2));
|
||||
|
@ -240,13 +240,13 @@ void Wrap32bT (unsigned char * tex, wxUint32 mask, wxUint32 max_height, wxUint32
|
|||
//****************************************************************
|
||||
// 32-bit Vertical Clamp
|
||||
|
||||
void Clamp32bT (unsigned char * tex, wxUint32 height, wxUint32 real_width, wxUint32 clamp_to)
|
||||
void Clamp32bT (unsigned char * tex, uint32_t height, uint32_t real_width, uint32_t clamp_to)
|
||||
{
|
||||
int line_full = real_width << 2;
|
||||
unsigned char *dst = tex + height * line_full;
|
||||
unsigned char *const_line = dst - line_full;
|
||||
|
||||
for (wxUint32 y=height; y<clamp_to; y++)
|
||||
for (uint32_t y=height; y<clamp_to; y++)
|
||||
{
|
||||
memcpy ((void*)dst, (void*)const_line, line_full);
|
||||
dst += line_full;
|
||||
|
|
|
@ -120,12 +120,12 @@ static inline void clamp8bS(uint8_t *tex, uint8_t *constant, int height, int lin
|
|||
while ( v8 );
|
||||
}
|
||||
|
||||
void Mirror8bS (unsigned char * tex, wxUint32 mask, wxUint32 max_width, wxUint32 real_width, wxUint32 height)
|
||||
void Mirror8bS (unsigned char * tex, uint32_t mask, uint32_t max_width, uint32_t real_width, uint32_t height)
|
||||
{
|
||||
if (mask == 0) return;
|
||||
|
||||
wxUint32 mask_width = (1 << mask);
|
||||
wxUint32 mask_mask = (mask_width-1);
|
||||
uint32_t mask_width = (1 << mask);
|
||||
uint32_t mask_mask = (mask_width-1);
|
||||
if (mask_width >= max_width) return;
|
||||
int count = max_width - mask_width;
|
||||
if (count <= 0) return;
|
||||
|
@ -140,12 +140,12 @@ void Mirror8bS (unsigned char * tex, wxUint32 mask, wxUint32 max_width, wxUint32
|
|||
// 8-bit Horizontal Wrap (like mirror) ** UNTESTED **
|
||||
|
||||
|
||||
void Wrap8bS (unsigned char * tex, wxUint32 mask, wxUint32 max_width, wxUint32 real_width, wxUint32 height)
|
||||
void Wrap8bS (unsigned char * tex, uint32_t mask, uint32_t max_width, uint32_t real_width, uint32_t height)
|
||||
{
|
||||
if (mask == 0) return;
|
||||
|
||||
wxUint32 mask_width = (1 << mask);
|
||||
wxUint32 mask_mask = (mask_width-1) >> 2;
|
||||
uint32_t mask_width = (1 << mask);
|
||||
uint32_t mask_mask = (mask_width-1) >> 2;
|
||||
if (mask_width >= max_width) return;
|
||||
int count = (max_width - mask_width) >> 2;
|
||||
if (count <= 0) return;
|
||||
|
@ -160,7 +160,7 @@ void Wrap8bS (unsigned char * tex, wxUint32 mask, wxUint32 max_width, wxUint32 r
|
|||
// 8-bit Horizontal Clamp
|
||||
|
||||
|
||||
void Clamp8bS (unsigned char * tex, wxUint32 width, wxUint32 clamp_to, wxUint32 real_width, wxUint32 real_height)
|
||||
void Clamp8bS (unsigned char * tex, uint32_t width, uint32_t clamp_to, uint32_t real_width, uint32_t real_height)
|
||||
{
|
||||
if (real_width <= width) return;
|
||||
|
||||
|
@ -176,18 +176,18 @@ void Clamp8bS (unsigned char * tex, wxUint32 width, wxUint32 clamp_to, wxUint32
|
|||
//****************************************************************
|
||||
// 8-bit Vertical Mirror
|
||||
|
||||
void Mirror8bT (unsigned char * tex, wxUint32 mask, wxUint32 max_height, wxUint32 real_width)
|
||||
void Mirror8bT (unsigned char * tex, uint32_t mask, uint32_t max_height, uint32_t real_width)
|
||||
{
|
||||
if (mask == 0) return;
|
||||
|
||||
wxUint32 mask_height = (1 << mask);
|
||||
wxUint32 mask_mask = mask_height-1;
|
||||
uint32_t mask_height = (1 << mask);
|
||||
uint32_t mask_mask = mask_height-1;
|
||||
if (max_height <= mask_height) return;
|
||||
int line_full = real_width;
|
||||
|
||||
unsigned char * dst = tex + mask_height * line_full;
|
||||
|
||||
for (wxUint32 y=mask_height; y<max_height; y++)
|
||||
for (uint32_t y=mask_height; y<max_height; y++)
|
||||
{
|
||||
if (y & mask_height)
|
||||
{
|
||||
|
@ -207,18 +207,18 @@ void Mirror8bT (unsigned char * tex, wxUint32 mask, wxUint32 max_height, wxUint3
|
|||
//****************************************************************
|
||||
// 8-bit Vertical Wrap
|
||||
|
||||
void Wrap8bT (unsigned char * tex, wxUint32 mask, wxUint32 max_height, wxUint32 real_width)
|
||||
void Wrap8bT (unsigned char * tex, uint32_t mask, uint32_t max_height, uint32_t real_width)
|
||||
{
|
||||
if (mask == 0) return;
|
||||
|
||||
wxUint32 mask_height = (1 << mask);
|
||||
wxUint32 mask_mask = mask_height-1;
|
||||
uint32_t mask_height = (1 << mask);
|
||||
uint32_t mask_mask = mask_height-1;
|
||||
if (max_height <= mask_height) return;
|
||||
int line_full = real_width;
|
||||
|
||||
unsigned char * dst = tex + mask_height * line_full;
|
||||
|
||||
for (wxUint32 y=mask_height; y<max_height; y++)
|
||||
for (uint32_t y=mask_height; y<max_height; y++)
|
||||
{
|
||||
// not mirrored
|
||||
memcpy ((void*)dst, (void*)(tex + (y & mask_mask) * line_full), line_full);
|
||||
|
@ -230,13 +230,13 @@ void Wrap8bT (unsigned char * tex, wxUint32 mask, wxUint32 max_height, wxUint32
|
|||
//****************************************************************
|
||||
// 8-bit Vertical Clamp
|
||||
|
||||
void Clamp8bT (unsigned char * tex, wxUint32 height, wxUint32 real_width, wxUint32 clamp_to)
|
||||
void Clamp8bT (unsigned char * tex, uint32_t height, uint32_t real_width, uint32_t clamp_to)
|
||||
{
|
||||
int line_full = real_width;
|
||||
unsigned char * dst = tex + height * line_full;
|
||||
unsigned char * const_line = dst - line_full;
|
||||
|
||||
for (wxUint32 y=height; y<clamp_to; y++)
|
||||
for (uint32_t y=height; y<clamp_to; y++)
|
||||
{
|
||||
memcpy ((void*)dst, (void*)const_line, line_full);
|
||||
dst += line_full;
|
||||
|
|
|
@ -65,7 +65,7 @@ static TBUFF_COLOR_IMAGE * AllocateTextureBuffer(COLOR_IMAGE & cimage)
|
|||
wxUint16 max_size = max((wxUint16)texbuf.scr_width, (wxUint16)texbuf.scr_height);
|
||||
if (max_size > voodoo.max_tex_size) //texture size is too large
|
||||
return 0;
|
||||
wxUint32 tex_size;
|
||||
uint32_t tex_size;
|
||||
//calculate LOD
|
||||
switch ((max_size-1) >> 6)
|
||||
{
|
||||
|
@ -154,13 +154,13 @@ static TBUFF_COLOR_IMAGE * AllocateTextureBuffer(COLOR_IMAGE & cimage)
|
|||
|
||||
FRDP("\nAllocateTextureBuffer. width: %d, height: %d, scr_width: %f, scr_height: %f, vi_width: %f, vi_height:%f, scale_x: %f, scale_y: %f, lr_u: %f, lr_v: %f, u_scale: %f, v_scale: %f\n", texbuf.width, texbuf.height, texbuf.scr_width, texbuf.scr_height, rdp.vi_width, rdp.vi_height, rdp.scale_x, rdp.scale_y, texbuf.lr_u, texbuf.lr_v, texbuf.u_scale, texbuf.v_scale);
|
||||
|
||||
wxUint32 required = grTexCalcMemRequired(texbuf.info.smallLodLog2, texbuf.info.largeLodLog2,
|
||||
uint32_t required = grTexCalcMemRequired(texbuf.info.smallLodLog2, texbuf.info.largeLodLog2,
|
||||
texbuf.info.aspectRatioLog2, texbuf.info.format);
|
||||
//find free space
|
||||
for (int i = 0; i < voodoo.num_tmu; i++)
|
||||
{
|
||||
wxUint32 available = 0;
|
||||
wxUint32 top = 0;
|
||||
uint32_t available = 0;
|
||||
uint32_t top = 0;
|
||||
if (rdp.texbufs[i].count)
|
||||
{
|
||||
TBUFF_COLOR_IMAGE & t = rdp.texbufs[i].images[rdp.texbufs[i].count - 1];
|
||||
|
@ -214,10 +214,10 @@ int OpenTextureBuffer(COLOR_IMAGE & cimage)
|
|||
|
||||
int found = FALSE, search = TRUE;
|
||||
TBUFF_COLOR_IMAGE *texbuf = 0;
|
||||
wxUint32 addr = cimage.addr;
|
||||
uint32_t addr = cimage.addr;
|
||||
if ((settings.hacks&hack_Banjo2) && cimage.status == ci_copy_self)
|
||||
addr = rdp.frame_buffers[rdp.copy_ci_index].addr;
|
||||
wxUint32 end_addr = addr + ((cimage.width*cimage.height)<<cimage.size>>1);
|
||||
uint32_t end_addr = addr + ((cimage.width*cimage.height)<<cimage.size>>1);
|
||||
if (rdp.motionblur)
|
||||
{
|
||||
// if (cimage.format != 0)
|
||||
|
@ -668,17 +668,17 @@ int SwapTextureBuffer()
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static wxUint32 CalcCRC(TBUFF_COLOR_IMAGE * pTCI)
|
||||
static uint32_t CalcCRC(TBUFF_COLOR_IMAGE * pTCI)
|
||||
{
|
||||
wxUint32 result = 0;
|
||||
uint32_t result = 0;
|
||||
if ((settings.frame_buffer&fb_ref) > 0)
|
||||
pTCI->crc = 0; //Since fb content changes each frame, crc check is meaningless.
|
||||
else if (settings.fb_crc_mode == SETTINGS::fbcrcFast)
|
||||
result = *((wxUint32*)(gfx.RDRAM + pTCI->addr + (pTCI->end_addr-pTCI->addr)/2));
|
||||
result = *((uint32_t*)(gfx.RDRAM + pTCI->addr + (pTCI->end_addr-pTCI->addr)/2));
|
||||
else if (settings.fb_crc_mode == SETTINGS::fbcrcSafe)
|
||||
{
|
||||
wxUint8 * pSrc = gfx.RDRAM + pTCI->addr;
|
||||
const wxUint32 nSize = pTCI->end_addr-pTCI->addr;
|
||||
const uint32_t nSize = pTCI->end_addr-pTCI->addr;
|
||||
result = CRC32(0xFFFFFFFF, pSrc, 32);
|
||||
result = CRC32(result, pSrc + (nSize>>1), 32);
|
||||
result = CRC32(result, pSrc + nSize - 32, 32);
|
||||
|
@ -686,13 +686,13 @@ static wxUint32 CalcCRC(TBUFF_COLOR_IMAGE * pTCI)
|
|||
return result;
|
||||
}
|
||||
|
||||
int FindTextureBuffer(wxUint32 addr, wxUint16 width)
|
||||
int FindTextureBuffer(uint32_t addr, wxUint16 width)
|
||||
{
|
||||
if (rdp.skip_drawing)
|
||||
return FALSE;
|
||||
FRDP("FindTextureBuffer. addr: %08lx, width: %d, scale_x: %f\n", addr, width, rdp.scale_x);
|
||||
int found = FALSE;
|
||||
wxUint32 shift = 0;
|
||||
uint32_t shift = 0;
|
||||
for (int i = 0; i < voodoo.num_tmu && !found; i++)
|
||||
{
|
||||
wxUint8 index = rdp.cur_tex_buf^i;
|
||||
|
|
|
@ -55,6 +55,6 @@ int CopyDepthBuffer();
|
|||
|
||||
int SwapTextureBuffer();
|
||||
|
||||
int FindTextureBuffer(wxUint32 addr, wxUint16 width);
|
||||
int FindTextureBuffer(uint32_t addr, wxUint16 width);
|
||||
|
||||
#endif // ifndef TEXBUFFER
|
||||
|
|
|
@ -71,8 +71,8 @@ typedef struct TEXINFO_t {
|
|||
int mask_width, mask_height;
|
||||
int width, height;
|
||||
int wid_64, line;
|
||||
wxUint32 crc;
|
||||
wxUint32 flags;
|
||||
uint32_t crc;
|
||||
uint32_t flags;
|
||||
int splits, splitheight;
|
||||
#ifdef TEXTURE_FILTER
|
||||
uint64 ricecrc;
|
||||
|
@ -94,7 +94,7 @@ typedef struct HIRESTEX_t {
|
|||
// List functions
|
||||
|
||||
typedef struct NODE_t {
|
||||
wxUint32 crc;
|
||||
uint32_t crc;
|
||||
wxUIntPtr data;
|
||||
int tmu;
|
||||
int number;
|
||||
|
@ -103,7 +103,7 @@ typedef struct NODE_t {
|
|||
|
||||
NODE *cachelut[65536];
|
||||
|
||||
void AddToList (NODE **list, wxUint32 crc, wxUIntPtr data, int tmu, int number)
|
||||
void AddToList (NODE **list, uint32_t crc, wxUIntPtr data, int tmu, int number)
|
||||
{
|
||||
NODE *node = new NODE;
|
||||
node->crc = crc;
|
||||
|
@ -357,7 +357,7 @@ void GetTexInfo (int id, int tile)
|
|||
line = rdp.tiles[tile].line;
|
||||
if (rdp.tiles[tile].size == 3)
|
||||
line <<= 1;
|
||||
wxUint32 crc = 0;
|
||||
uint32_t crc = 0;
|
||||
if (settings.fast_crc)
|
||||
{
|
||||
line = (line - wid_64) << 3;
|
||||
|
@ -380,7 +380,7 @@ void GetTexInfo (int id, int tile)
|
|||
{
|
||||
crc = 0xFFFFFFFF;
|
||||
wxUIntPtr addr = wxPtrToUInt(rdp.tmem) + (rdp.tiles[tile].t_mem<<3);
|
||||
wxUint32 line2 = max(line,1);
|
||||
uint32_t line2 = max(line,1);
|
||||
if (rdp.tiles[tile].size < 3)
|
||||
{
|
||||
line2 <<= 3;
|
||||
|
@ -416,7 +416,7 @@ void GetTexInfo (int id, int tile)
|
|||
|
||||
FRDP ("Done. CRC is: %08lx.\n", crc);
|
||||
|
||||
wxUint32 flags = (rdp.tiles[tile].clamp_s << 23) | (rdp.tiles[tile].mirror_s << 22) |
|
||||
uint32_t flags = (rdp.tiles[tile].clamp_s << 23) | (rdp.tiles[tile].mirror_s << 22) |
|
||||
(rdp.tiles[tile].mask_s << 18) | (rdp.tiles[tile].clamp_t << 17) |
|
||||
(rdp.tiles[tile].mirror_t << 16) | (rdp.tiles[tile].mask_t << 12);
|
||||
|
||||
|
@ -441,7 +441,7 @@ void GetTexInfo (int id, int tile)
|
|||
if (rdp.noise == RDP::noise_texture)
|
||||
return;
|
||||
|
||||
wxUint32 mod, modcolor, modcolor1, modcolor2, modfactor;
|
||||
uint32_t mod, modcolor, modcolor1, modcolor2, modfactor;
|
||||
if (id == 0)
|
||||
{
|
||||
mod = cmb.mod_0;
|
||||
|
@ -460,7 +460,7 @@ void GetTexInfo (int id, int tile)
|
|||
}
|
||||
|
||||
NODE *node = cachelut[crc>>16];
|
||||
wxUint32 mod_mask = (rdp.tiles[tile].format == 2)?0xFFFFFFFF:0xF0F0F0F0;
|
||||
uint32_t mod_mask = (rdp.tiles[tile].format == 2)?0xFFFFFFFF:0xF0F0F0F0;
|
||||
while (node)
|
||||
{
|
||||
if (node->crc == crc)
|
||||
|
@ -913,7 +913,7 @@ void TexCache ()
|
|||
|
||||
if (rdp.cur_cache[i])
|
||||
{
|
||||
wxUint32 mode_s, mode_t;
|
||||
uint32_t mode_s, mode_t;
|
||||
int clamp_s, clamp_t;
|
||||
if (rdp.force_wrap && !rdp.texrecting)
|
||||
{
|
||||
|
@ -971,15 +971,15 @@ void TexCache ()
|
|||
|
||||
#ifdef TEXTURE_FILTER
|
||||
/** cite from RiceVideo */
|
||||
inline wxUint32 CalculateDXT(wxUint32 txl2words)
|
||||
inline uint32_t CalculateDXT(uint32_t txl2words)
|
||||
{
|
||||
if( txl2words == 0 ) return 1;
|
||||
else return (2048+txl2words-1)/txl2words;
|
||||
}
|
||||
|
||||
wxUint32 sizeBytes[4] = {0,1,2,4};
|
||||
uint32_t sizeBytes[4] = {0,1,2,4};
|
||||
|
||||
inline wxUint32 Txl2Words(wxUint32 width, wxUint32 size)
|
||||
inline uint32_t Txl2Words(uint32_t width, uint32_t size)
|
||||
{
|
||||
if( size == 0 )
|
||||
return max(1, width/16);
|
||||
|
@ -987,7 +987,7 @@ inline wxUint32 Txl2Words(wxUint32 width, wxUint32 size)
|
|||
return max(1, width*sizeBytes[size]/8);
|
||||
}
|
||||
|
||||
inline wxUint32 ReverseDXT(wxUint32 val, wxUint32 /*lrs*/, wxUint32 width, wxUint32 size)
|
||||
inline uint32_t ReverseDXT(uint32_t val, uint32_t /*lrs*/, uint32_t width, uint32_t size)
|
||||
{
|
||||
if( val == 0x800 ) return 1;
|
||||
|
||||
|
@ -999,7 +999,7 @@ inline wxUint32 ReverseDXT(wxUint32 val, wxUint32 /*lrs*/, wxUint32 width, wxUin
|
|||
|
||||
for( int i=low; i<=high; i++ )
|
||||
{
|
||||
if( Txl2Words(width, size) == (wxUint32)i )
|
||||
if( Txl2Words(width, size) == (uint32_t)i )
|
||||
return i;
|
||||
}
|
||||
|
||||
|
@ -1076,8 +1076,8 @@ void LoadTex (int id, int tmu)
|
|||
cache->t_info.format = GR_TEXFMT_ARGB_1555;
|
||||
|
||||
// Calculate lod and aspect
|
||||
wxUint32 size_x = rdp.tiles[td].width;
|
||||
wxUint32 size_y = rdp.tiles[td].height;
|
||||
uint32_t size_x = rdp.tiles[td].width;
|
||||
uint32_t size_y = rdp.tiles[td].height;
|
||||
|
||||
// make size_x and size_y both powers of two
|
||||
if (!voodoo.sup_large_tex)
|
||||
|
@ -1103,7 +1103,7 @@ void LoadTex (int id, int tmu)
|
|||
|
||||
// Calculate the maximum size
|
||||
int size_max = max (size_x, size_y);
|
||||
wxUint32 real_x=size_max, real_y=size_max;
|
||||
uint32_t real_x=size_max, real_y=size_max;
|
||||
switch (size_max)
|
||||
{
|
||||
case 1:
|
||||
|
@ -1238,7 +1238,7 @@ void LoadTex (int id, int tmu)
|
|||
else cache->c_scl_y = 0.0f;
|
||||
// **
|
||||
|
||||
wxUint32 mod, modcolor, modcolor1, modcolor2, modfactor;
|
||||
uint32_t mod, modcolor, modcolor1, modcolor2, modfactor;
|
||||
if (id == 0)
|
||||
{
|
||||
mod = cmb.mod_0;
|
||||
|
@ -1279,7 +1279,7 @@ void LoadTex (int id, int tmu)
|
|||
}
|
||||
}
|
||||
|
||||
wxUint32 result = 0; // keep =0 so it doesn't mess up on the first split
|
||||
uint32_t result = 0; // keep =0 so it doesn't mess up on the first split
|
||||
|
||||
texture = tex1;
|
||||
|
||||
|
@ -1296,7 +1296,7 @@ void LoadTex (int id, int tmu)
|
|||
#ifdef TEXTURE_FILTER // Hiroshi Morii <koolsmoky@users.sourceforge.net>
|
||||
GHQTexInfo ghqTexInfo;
|
||||
memset(&ghqTexInfo, 0, sizeof(GHQTexInfo));
|
||||
wxUint32 g64_crc = cache->crc;
|
||||
uint32_t g64_crc = cache->crc;
|
||||
if (settings.ghq_use)
|
||||
{
|
||||
int bpl;
|
||||
|
@ -1325,7 +1325,7 @@ void LoadTex (int id, int tmu)
|
|||
else if (info.dxt == 0)
|
||||
bpl = rdp.tiles[td].line << 3;
|
||||
else {
|
||||
wxUint32 dxt = info.dxt;
|
||||
uint32_t dxt = info.dxt;
|
||||
if (dxt > 1)
|
||||
dxt = ReverseDXT(dxt, info.tile_width, texinfo[id].width, rdp.tiles[td].size);
|
||||
bpl = dxt << 3;
|
||||
|
@ -1356,7 +1356,7 @@ void LoadTex (int id, int tmu)
|
|||
g64_crc = CRC32( g64_crc, &cache->mod_factor, 4 );
|
||||
|
||||
cache->ricecrc = ext_ghq_checksum(addr, tile_width, tile_height, (unsigned short)(rdp.tiles[td].format << 8 | rdp.tiles[td].size), bpl, paladdr);
|
||||
FRDP("CI RICE CRC. format: %d, size: %d, CRC: %08lx, PalCRC: %08lx\n", rdp.tiles[td].format, rdp.tiles[td].size, (wxUint32)(cache->ricecrc&0xFFFFFFFF), (wxUint32)(cache->ricecrc>>32));
|
||||
FRDP("CI RICE CRC. format: %d, size: %d, CRC: %08lx, PalCRC: %08lx\n", rdp.tiles[td].format, rdp.tiles[td].size, (uint32_t)(cache->ricecrc&0xFFFFFFFF), (uint32_t)(cache->ricecrc>>32));
|
||||
if (ext_ghq_hirestex((uint64)g64_crc, cache->ricecrc, palette, &ghqTexInfo))
|
||||
{
|
||||
cache->is_hires_tex = ghqTexInfo.is_hires_tex;
|
||||
|
@ -1390,7 +1390,7 @@ void LoadTex (int id, int tmu)
|
|||
(wxPtrToUInt(texture)+start_dst, wxPtrToUInt(rdp.tmem)+(rdp.tiles[td].t_mem<<3)+start_src,
|
||||
texinfo[id].wid_64, texinfo[id].height, texinfo[id].line, real_x, td);
|
||||
|
||||
wxUint32 size = HIWORD(result);
|
||||
uint32_t size = HIWORD(result);
|
||||
// clamp so that it looks somewhat ok when wrapping
|
||||
if (size == 1)
|
||||
Clamp16bT ((texture)+start_dst, texinfo[id].height, real_x, cache->splitheight);
|
||||
|
@ -1407,7 +1407,7 @@ void LoadTex (int id, int tmu)
|
|||
(wxPtrToUInt(texture), wxPtrToUInt(rdp.tmem)+(rdp.tiles[td].t_mem<<3),
|
||||
texinfo[id].wid_64, texinfo[id].height, texinfo[id].line, real_x, td);
|
||||
|
||||
wxUint32 size = HIWORD(result);
|
||||
uint32_t size = HIWORD(result);
|
||||
|
||||
int min_x, min_y;
|
||||
if (rdp.tiles[td].mask_s != 0)
|
||||
|
@ -1796,7 +1796,7 @@ void LoadTex (int id, int tmu)
|
|||
t_info->largeLodLog2 = lod;
|
||||
t_info->aspectRatioLog2 = aspect;
|
||||
|
||||
wxUint32 texture_size = grTexTextureMemRequired (GR_MIPMAPLEVELMASK_BOTH, t_info);
|
||||
uint32_t texture_size = grTexTextureMemRequired (GR_MIPMAPLEVELMASK_BOTH, t_info);
|
||||
|
||||
// Check for 2mb boundary
|
||||
// Hiroshi Morii <koolsmoky@users.sourceforge.net> required only for V1,Rush, and V2
|
||||
|
@ -1821,7 +1821,7 @@ void LoadTex (int id, int tmu)
|
|||
// DON'T CONTINUE (already done)
|
||||
}
|
||||
|
||||
wxUint32 tex_addr = GetTexAddr(tmu, texture_size);
|
||||
uint32_t tex_addr = GetTexAddr(tmu, texture_size);
|
||||
grTexDownloadMipMap (tmu,
|
||||
tex_addr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
|
|
|
@ -42,13 +42,13 @@
|
|||
#include "TexLoad16b.h"
|
||||
#include "TexLoad32b.h"
|
||||
|
||||
wxUint32 LoadNone(wxUIntPtr /*dst*/,wxUIntPtr /*src*/,int /*wid_64*/,int /*height*/,int /*line*/,int /*real_width*/,int /*tile*/)
|
||||
uint32_t LoadNone(wxUIntPtr /*dst*/,wxUIntPtr /*src*/,int /*wid_64*/,int /*height*/,int /*line*/,int /*real_width*/,int /*tile*/)
|
||||
{
|
||||
memset (texture, 0, 4096*4);
|
||||
return (1 << 16) | GR_TEXFMT_ARGB_1555;
|
||||
}
|
||||
|
||||
typedef wxUint32 (*texfunc)(wxUIntPtr, wxUIntPtr, int, int, int, int, int);
|
||||
typedef uint32_t (*texfunc)(wxUIntPtr, wxUIntPtr, int, int, int, int, int);
|
||||
texfunc load_table [4][5] = { // [size][format]
|
||||
{ Load4bSelect,
|
||||
LoadNone,
|
||||
|
|
|
@ -166,7 +166,7 @@ static inline void load16bIA(uint8_t *src, uint8_t *dst, int wid_64, int height,
|
|||
// Size: 2, Format: 0
|
||||
//
|
||||
|
||||
wxUint32 Load16bRGBA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int /*tile*/)
|
||||
uint32_t Load16bRGBA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int /*tile*/)
|
||||
{
|
||||
if (wid_64 < 1) wid_64 = 1;
|
||||
if (height < 1) height = 1;
|
||||
|
@ -181,7 +181,7 @@ wxUint32 Load16bRGBA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int
|
|||
// Size: 2, Format: 3
|
||||
//
|
||||
|
||||
wxUint32 Load16bIA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int /*tile*/)
|
||||
uint32_t Load16bIA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int /*tile*/)
|
||||
{
|
||||
if (wid_64 < 1) wid_64 = 1;
|
||||
if (height < 1) height = 1;
|
||||
|
@ -218,13 +218,13 @@ wxUint16 yuv_to_rgb565(wxUint8 y, wxUint8 u, wxUint8 v)
|
|||
return c;
|
||||
//*/
|
||||
/*
|
||||
const wxUint32 c = y - 16;
|
||||
const wxUint32 d = u - 128;
|
||||
const wxUint32 e = v - 128;
|
||||
const uint32_t c = y - 16;
|
||||
const uint32_t d = u - 128;
|
||||
const uint32_t e = v - 128;
|
||||
|
||||
wxUint32 r = (298 * c + 409 * e + 128) & 0xf800;
|
||||
wxUint32 g = ((298 * c - 100 * d - 208 * e + 128) >> 5) & 0x7e0;
|
||||
wxUint32 b = ((298 * c + 516 * d + 128) >> 11) & 0x1f;
|
||||
uint32_t r = (298 * c + 409 * e + 128) & 0xf800;
|
||||
uint32_t g = ((298 * c - 100 * d - 208 * e + 128) >> 5) & 0x7e0;
|
||||
uint32_t b = ((298 * c + 516 * d + 128) >> 11) & 0x1f;
|
||||
|
||||
WORD texel = (WORD)(r | g | b);
|
||||
|
||||
|
@ -236,14 +236,14 @@ wxUint16 yuv_to_rgb565(wxUint8 y, wxUint8 u, wxUint8 v)
|
|||
// Size: 2, Format: 1
|
||||
//
|
||||
|
||||
wxUint32 Load16bYUV (wxUIntPtr dst, wxUIntPtr /*src*/, int /*wid_64*/, int /*height*/, int /*line*/, int /*real_width*/, int tile)
|
||||
uint32_t Load16bYUV (wxUIntPtr dst, wxUIntPtr /*src*/, int /*wid_64*/, int /*height*/, int /*line*/, int /*real_width*/, int tile)
|
||||
{
|
||||
wxUint32 * mb = (wxUint32*)(gfx.RDRAM+rdp.addr[rdp.tiles[tile].t_mem]); //pointer to the macro block
|
||||
uint32_t * mb = (uint32_t*)(gfx.RDRAM+rdp.addr[rdp.tiles[tile].t_mem]); //pointer to the macro block
|
||||
wxUint16 * tex = (wxUint16*)dst;
|
||||
wxUint16 i;
|
||||
for (i = 0; i < 128; i++)
|
||||
{
|
||||
wxUint32 t = mb[i]; //each wxUint32 contains 2 pixels
|
||||
uint32_t t = mb[i]; //each uint32_t contains 2 pixels
|
||||
wxUint8 y1 = (wxUint8)t&0xFF;
|
||||
wxUint8 v = (wxUint8)(t>>8)&0xFF;
|
||||
wxUint8 y0 = (wxUint8)(t>>16)&0xFF;
|
||||
|
|
|
@ -43,24 +43,24 @@
|
|||
// Load 32bit RGBA texture
|
||||
// Based on sources of angrylion's software plugin.
|
||||
//
|
||||
wxUint32 Load32bRGBA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
uint32_t Load32bRGBA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
{
|
||||
if (height < 1) height = 1;
|
||||
const wxUint16 *tmem16 = (wxUint16*)rdp.tmem;
|
||||
const wxUint32 tbase = (src - (wxUIntPtr)rdp.tmem) >> 1;
|
||||
const wxUint32 width = max(1, wid_64 << 1);
|
||||
const uint32_t tbase = (src - (wxUIntPtr)rdp.tmem) >> 1;
|
||||
const uint32_t width = max(1, wid_64 << 1);
|
||||
const int ext = real_width - width;
|
||||
line = width + (line>>2);
|
||||
wxUint32 s, t, c;
|
||||
wxUint32 * tex = (wxUint32*)dst;
|
||||
uint32_t s, t, c;
|
||||
uint32_t * tex = (uint32_t*)dst;
|
||||
wxUint16 rg, ba;
|
||||
for (t = 0; t < (wxUint32)height; t++)
|
||||
for (t = 0; t < (uint32_t)height; t++)
|
||||
{
|
||||
wxUint32 tline = tbase + line * t;
|
||||
wxUint32 xorval = (t & 1) ? 3 : 1;
|
||||
uint32_t tline = tbase + line * t;
|
||||
uint32_t xorval = (t & 1) ? 3 : 1;
|
||||
for (s = 0; s < width; s++)
|
||||
{
|
||||
wxUint32 taddr = ((tline + s) ^ xorval) & 0x3ff;
|
||||
uint32_t taddr = ((tline + s) ^ xorval) & 0x3ff;
|
||||
rg = tmem16[taddr];
|
||||
ba = tmem16[taddr|0x400];
|
||||
c = ((ba&0xFF)<<24) | (rg << 8) | (ba>>8);
|
||||
|
@ -69,15 +69,15 @@ wxUint32 Load32bRGBA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int
|
|||
tex += ext;
|
||||
}
|
||||
int id = tile - rdp.cur_tile;
|
||||
wxUint32 mod = (id == 0) ? cmb.mod_0 : cmb.mod_1;
|
||||
uint32_t mod = (id == 0) ? cmb.mod_0 : cmb.mod_1;
|
||||
if (mod || !voodoo.sup_32bit_tex)
|
||||
{
|
||||
//convert to ARGB_4444
|
||||
const wxUint32 tex_size = real_width * height;
|
||||
tex = (wxUint32 *)dst;
|
||||
const uint32_t tex_size = real_width * height;
|
||||
tex = (uint32_t *)dst;
|
||||
wxUint16 *tex16 = (wxUint16*)dst;
|
||||
wxUint16 a, r, g, b;
|
||||
for (wxUint32 i = 0; i < tex_size; i++) {
|
||||
for (uint32_t i = 0; i < tex_size; i++) {
|
||||
c = tex[i];
|
||||
a = (c >> 28) & 0xF;
|
||||
r = (c >> 20) & 0xF;
|
||||
|
@ -94,21 +94,21 @@ wxUint32 Load32bRGBA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int
|
|||
// LoadTile for 32bit RGBA texture
|
||||
// Based on sources of angrylion's software plugin.
|
||||
//
|
||||
void LoadTile32b (wxUint32 tile, wxUint32 ul_s, wxUint32 ul_t, wxUint32 width, wxUint32 height)
|
||||
void LoadTile32b (uint32_t tile, uint32_t ul_s, uint32_t ul_t, uint32_t width, uint32_t height)
|
||||
{
|
||||
const wxUint32 line = rdp.tiles[tile].line << 2;
|
||||
const wxUint32 tbase = rdp.tiles[tile].t_mem << 2;
|
||||
const wxUint32 addr = rdp.timg.addr >> 2;
|
||||
const wxUint32* src = (const wxUint32*)gfx.RDRAM;
|
||||
const uint32_t line = rdp.tiles[tile].line << 2;
|
||||
const uint32_t tbase = rdp.tiles[tile].t_mem << 2;
|
||||
const uint32_t addr = rdp.timg.addr >> 2;
|
||||
const uint32_t* src = (const uint32_t*)gfx.RDRAM;
|
||||
wxUint16 *tmem16 = (wxUint16*)rdp.tmem;
|
||||
wxUint32 c, ptr, tline, s, xorval;
|
||||
uint32_t c, ptr, tline, s, xorval;
|
||||
|
||||
for (wxUint32 j = 0; j < height; j++)
|
||||
for (uint32_t j = 0; j < height; j++)
|
||||
{
|
||||
tline = tbase + line * j;
|
||||
s = ((j + ul_t) * rdp.timg.width) + ul_s;
|
||||
xorval = (j & 1) ? 3 : 1;
|
||||
for (wxUint32 i = 0; i < width; i++)
|
||||
for (uint32_t i = 0; i < width; i++)
|
||||
{
|
||||
c = src[addr + s + i];
|
||||
ptr = ((tline + i) ^ xorval) & 0x3ff;
|
||||
|
@ -122,30 +122,30 @@ void LoadTile32b (wxUint32 tile, wxUint32 ul_s, wxUint32 ul_t, wxUint32 width, w
|
|||
// LoadBlock for 32bit RGBA texture
|
||||
// Based on sources of angrylion's software plugin.
|
||||
//
|
||||
void LoadBlock32b(wxUint32 tile, wxUint32 ul_s, wxUint32 ul_t, wxUint32 lr_s, wxUint32 dxt)
|
||||
void LoadBlock32b(uint32_t tile, uint32_t ul_s, uint32_t ul_t, uint32_t lr_s, uint32_t dxt)
|
||||
{
|
||||
const wxUint32 * src = (const wxUint32*)gfx.RDRAM;
|
||||
const wxUint32 tb = rdp.tiles[tile].t_mem << 2;
|
||||
const wxUint32 tiwindwords = rdp.timg.width;
|
||||
const wxUint32 slindwords = ul_s;
|
||||
const wxUint32 line = rdp.tiles[tile].line << 2;
|
||||
const uint32_t * src = (const uint32_t*)gfx.RDRAM;
|
||||
const uint32_t tb = rdp.tiles[tile].t_mem << 2;
|
||||
const uint32_t tiwindwords = rdp.timg.width;
|
||||
const uint32_t slindwords = ul_s;
|
||||
const uint32_t line = rdp.tiles[tile].line << 2;
|
||||
|
||||
wxUint16 *tmem16 = (wxUint16*)rdp.tmem;
|
||||
wxUint32 addr = rdp.timg.addr >> 2;
|
||||
wxUint32 width = (lr_s - ul_s + 1) << 2;
|
||||
uint32_t addr = rdp.timg.addr >> 2;
|
||||
uint32_t width = (lr_s - ul_s + 1) << 2;
|
||||
if (width & 7)
|
||||
width = (width & (~7)) + 8;
|
||||
|
||||
if (dxt != 0)
|
||||
{
|
||||
wxUint32 j= 0;
|
||||
wxUint32 t = 0;
|
||||
wxUint32 oldt = 0;
|
||||
wxUint32 ptr;
|
||||
uint32_t j= 0;
|
||||
uint32_t t = 0;
|
||||
uint32_t oldt = 0;
|
||||
uint32_t ptr;
|
||||
|
||||
addr += (ul_t * tiwindwords) + slindwords;
|
||||
wxUint32 c = 0;
|
||||
for (wxUint32 i = 0; i < width; i += 2)
|
||||
uint32_t c = 0;
|
||||
for (uint32_t i = 0; i < width; i += 2)
|
||||
{
|
||||
oldt = t;
|
||||
t = ((j >> 11) & 1) ? 3 : 1;
|
||||
|
@ -165,8 +165,8 @@ void LoadBlock32b(wxUint32 tile, wxUint32 ul_s, wxUint32 ul_t, wxUint32 lr_s, wx
|
|||
else
|
||||
{
|
||||
addr += (ul_t * tiwindwords) + slindwords;
|
||||
wxUint32 c, ptr;
|
||||
for (wxUint32 i = 0; i < width; i ++)
|
||||
uint32_t c, ptr;
|
||||
for (uint32_t i = 0; i < width; i ++)
|
||||
{
|
||||
ptr = ((tb + i) ^ 1) & 0x3ff;
|
||||
c = src[addr + i];
|
||||
|
|
|
@ -590,7 +590,7 @@ static inline void load4bI(uint8_t *src, uint8_t *dst, int wid_64, int height, i
|
|||
//****************************************************************
|
||||
// Size: 0, Format: 2
|
||||
|
||||
wxUint32 Load4bCI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
uint32_t Load4bCI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
{
|
||||
if (wid_64 < 1) wid_64 = 1;
|
||||
if (height < 1) height = 1;
|
||||
|
@ -622,7 +622,7 @@ wxUint32 Load4bCI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int lin
|
|||
//
|
||||
// ** BY GUGAMAN **
|
||||
|
||||
wxUint32 Load4bIA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
uint32_t Load4bIA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
{
|
||||
if (rdp.tlut_mode != 0)
|
||||
return Load4bCI (dst, src, wid_64, height, line, real_width, tile);
|
||||
|
@ -637,7 +637,7 @@ wxUint32 Load4bIA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int lin
|
|||
//****************************************************************
|
||||
// Size: 0, Format: 4
|
||||
|
||||
wxUint32 Load4bI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
uint32_t Load4bI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
{
|
||||
if (rdp.tlut_mode != 0)
|
||||
return Load4bCI (dst, src, wid_64, height, line, real_width, tile);
|
||||
|
@ -653,7 +653,7 @@ wxUint32 Load4bI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line
|
|||
//****************************************************************
|
||||
// Size: 0, Format: 0
|
||||
|
||||
wxUint32 Load4bSelect (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
uint32_t Load4bSelect (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
{
|
||||
if (rdp.tlut_mode == 0)
|
||||
return Load4bI (dst, src, wid_64, height, line, real_width, tile);
|
||||
|
|
|
@ -373,7 +373,7 @@ static inline void load8bI(uint8_t *src, uint8_t *dst, int wid_64, int height, i
|
|||
// Size: 1, Format: 2
|
||||
//
|
||||
|
||||
wxUint32 Load8bCI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int /*tile*/)
|
||||
uint32_t Load8bCI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int /*tile*/)
|
||||
{
|
||||
if (wid_64 < 1) wid_64 = 1;
|
||||
if (height < 1) height = 1;
|
||||
|
@ -401,7 +401,7 @@ wxUint32 Load8bCI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int lin
|
|||
// Size: 1, Format: 3
|
||||
//
|
||||
|
||||
wxUint32 Load8bIA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
uint32_t Load8bIA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
{
|
||||
if (rdp.tlut_mode != 0)
|
||||
return Load8bCI (dst, src, wid_64, height, line, real_width, tile);
|
||||
|
@ -417,7 +417,7 @@ wxUint32 Load8bIA (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int lin
|
|||
// Size: 1, Format: 4
|
||||
//
|
||||
|
||||
wxUint32 Load8bI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
uint32_t Load8bI (wxUIntPtr dst, wxUIntPtr src, int wid_64, int height, int line, int real_width, int tile)
|
||||
{
|
||||
if (rdp.tlut_mode != 0)
|
||||
return Load8bCI (dst, src, wid_64, height, line, real_width, tile);
|
||||
|
|
|
@ -37,11 +37,11 @@
|
|||
//
|
||||
//****************************************************************
|
||||
|
||||
static void mod_tex_inter_color_using_factor (wxUint16 *dst, int size, wxUint32 color, wxUint32 factor)
|
||||
static void mod_tex_inter_color_using_factor (wxUint16 *dst, int size, uint32_t color, uint32_t factor)
|
||||
{
|
||||
float percent = factor / 255.0f;
|
||||
float percent_i = 1 - percent;
|
||||
wxUint32 cr, cg, cb;
|
||||
uint32_t cr, cg, cb;
|
||||
wxUint16 col, a;
|
||||
wxUint8 r, g, b;
|
||||
|
||||
|
@ -60,9 +60,9 @@ static void mod_tex_inter_color_using_factor (wxUint16 *dst, int size, wxUint32
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_inter_col_using_col1 (wxUint16 *dst, int size, wxUint32 color0, wxUint32 color1)
|
||||
static void mod_tex_inter_col_using_col1 (wxUint16 *dst, int size, uint32_t color0, uint32_t color1)
|
||||
{
|
||||
wxUint32 cr, cg, cb;
|
||||
uint32_t cr, cg, cb;
|
||||
wxUint16 col, a;
|
||||
wxUint8 r, g, b;
|
||||
|
||||
|
@ -88,9 +88,9 @@ static void mod_tex_inter_col_using_col1 (wxUint16 *dst, int size, wxUint32 colo
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_full_color_sub_tex (wxUint16 *dst, int size, wxUint32 color)
|
||||
static void mod_full_color_sub_tex (wxUint16 *dst, int size, uint32_t color)
|
||||
{
|
||||
wxUint32 cr, cg, cb, ca;
|
||||
uint32_t cr, cg, cb, ca;
|
||||
wxUint16 col;
|
||||
wxUint8 a, r, g, b;
|
||||
|
||||
|
@ -110,9 +110,9 @@ static void mod_full_color_sub_tex (wxUint16 *dst, int size, wxUint32 color)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_col_inter_col1_using_tex (wxUint16 *dst, int size, wxUint32 color0, wxUint32 color1)
|
||||
static void mod_col_inter_col1_using_tex (wxUint16 *dst, int size, uint32_t color0, uint32_t color1)
|
||||
{
|
||||
wxUint32 cr0, cg0, cb0, cr1, cg1, cb1;
|
||||
uint32_t cr0, cg0, cb0, cr1, cg1, cb1;
|
||||
wxUint16 col;
|
||||
wxUint8 r, g, b;
|
||||
wxUint16 a;
|
||||
|
@ -139,9 +139,9 @@ static void mod_col_inter_col1_using_tex (wxUint16 *dst, int size, wxUint32 colo
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_col_inter_col1_using_texa (wxUint16 *dst, int size, wxUint32 color0, wxUint32 color1)
|
||||
static void mod_col_inter_col1_using_texa (wxUint16 *dst, int size, uint32_t color0, uint32_t color1)
|
||||
{
|
||||
wxUint32 cr0, cg0, cb0, cr1, cg1, cb1;
|
||||
uint32_t cr0, cg0, cb0, cr1, cg1, cb1;
|
||||
wxUint16 col;
|
||||
wxUint8 r, g, b;
|
||||
wxUint16 a;
|
||||
|
@ -167,9 +167,9 @@ static void mod_col_inter_col1_using_texa (wxUint16 *dst, int size, wxUint32 col
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_col_inter_col1_using_texa__mul_tex (wxUint16 *dst, int size, wxUint32 color0, wxUint32 color1)
|
||||
static void mod_col_inter_col1_using_texa__mul_tex (wxUint16 *dst, int size, uint32_t color0, uint32_t color1)
|
||||
{
|
||||
wxUint32 cr0, cg0, cb0, cr1, cg1, cb1;
|
||||
uint32_t cr0, cg0, cb0, cr1, cg1, cb1;
|
||||
wxUint16 col;
|
||||
wxUint8 r, g, b;
|
||||
wxUint16 a;
|
||||
|
@ -195,9 +195,9 @@ static void mod_col_inter_col1_using_texa__mul_tex (wxUint16 *dst, int size, wxU
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_col_inter_tex_using_tex (wxUint16 *dst, int size, wxUint32 color)
|
||||
static void mod_col_inter_tex_using_tex (wxUint16 *dst, int size, uint32_t color)
|
||||
{
|
||||
wxUint32 cr, cg, cb;
|
||||
uint32_t cr, cg, cb;
|
||||
wxUint16 col;
|
||||
wxUint8 r, g, b;
|
||||
wxUint16 a;
|
||||
|
@ -221,9 +221,9 @@ static void mod_col_inter_tex_using_tex (wxUint16 *dst, int size, wxUint32 color
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_col_inter_tex_using_texa (wxUint16 *dst, int size, wxUint32 color)
|
||||
static void mod_col_inter_tex_using_texa (wxUint16 *dst, int size, uint32_t color)
|
||||
{
|
||||
wxUint32 cr, cg, cb;
|
||||
uint32_t cr, cg, cb;
|
||||
wxUint16 col;
|
||||
wxUint8 r, g, b;
|
||||
wxUint16 a;
|
||||
|
@ -247,10 +247,10 @@ static void mod_col_inter_tex_using_texa (wxUint16 *dst, int size, wxUint32 colo
|
|||
}
|
||||
|
||||
static void mod_col2_inter__col_inter_col1_using_tex__using_texa (wxUint16 *dst, int size,
|
||||
wxUint32 color0, wxUint32 color1,
|
||||
wxUint32 color2)
|
||||
uint32_t color0, uint32_t color1,
|
||||
uint32_t color2)
|
||||
{
|
||||
wxUint32 cr0, cg0, cb0, cr1, cg1, cb1, cr2, cg2, cb2;
|
||||
uint32_t cr0, cg0, cb0, cr1, cg1, cb1, cr2, cg2, cb2;
|
||||
wxUint16 col;
|
||||
wxUint8 r, g, b;
|
||||
wxUint16 a;
|
||||
|
@ -281,7 +281,7 @@ static void mod_col2_inter__col_inter_col1_using_tex__using_texa (wxUint16 *dst,
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_scale_fac_add_fac (wxUint16 *dst, int size, wxUint32 factor)
|
||||
static void mod_tex_scale_fac_add_fac (wxUint16 *dst, int size, uint32_t factor)
|
||||
{
|
||||
float percent = factor / 255.0f;
|
||||
wxUint16 col;
|
||||
|
@ -296,10 +296,10 @@ static void mod_tex_scale_fac_add_fac (wxUint16 *dst, int size, wxUint32 factor)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_sub_col_mul_fac_add_tex (wxUint16 *dst, int size, wxUint32 color, wxUint32 factor)
|
||||
static void mod_tex_sub_col_mul_fac_add_tex (wxUint16 *dst, int size, uint32_t color, uint32_t factor)
|
||||
{
|
||||
float percent = factor / 255.0f;
|
||||
wxUint32 cr, cg, cb;
|
||||
uint32_t cr, cg, cb;
|
||||
wxUint16 col, a;
|
||||
float r, g, b;
|
||||
|
||||
|
@ -328,9 +328,9 @@ static void mod_tex_sub_col_mul_fac_add_tex (wxUint16 *dst, int size, wxUint32 c
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_scale_col_add_col (wxUint16 *dst, int size, wxUint32 color0, wxUint32 color1)
|
||||
static void mod_tex_scale_col_add_col (wxUint16 *dst, int size, uint32_t color0, uint32_t color1)
|
||||
{
|
||||
wxUint32 cr0, cg0, cb0, cr1, cg1, cb1;
|
||||
uint32_t cr0, cg0, cb0, cr1, cg1, cb1;
|
||||
wxUint16 col;
|
||||
wxUint8 r, g, b;
|
||||
wxUint16 a;
|
||||
|
@ -357,9 +357,9 @@ static void mod_tex_scale_col_add_col (wxUint16 *dst, int size, wxUint32 color0,
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_add_col (wxUint16 *dst, int size, wxUint32 color)
|
||||
static void mod_tex_add_col (wxUint16 *dst, int size, uint32_t color)
|
||||
{
|
||||
wxUint32 cr, cg, cb;
|
||||
uint32_t cr, cg, cb;
|
||||
wxUint16 col;
|
||||
wxUint8 a, r, g, b;
|
||||
|
||||
|
@ -379,9 +379,9 @@ static void mod_tex_add_col (wxUint16 *dst, int size, wxUint32 color)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_col_mul_texa_add_tex (wxUint16 *dst, int size, wxUint32 color)
|
||||
static void mod_col_mul_texa_add_tex (wxUint16 *dst, int size, uint32_t color)
|
||||
{
|
||||
wxUint32 cr, cg, cb;
|
||||
uint32_t cr, cg, cb;
|
||||
wxUint16 col;
|
||||
wxUint8 r, g, b;
|
||||
wxUint16 a;
|
||||
|
@ -403,7 +403,7 @@ static void mod_col_mul_texa_add_tex (wxUint16 *dst, int size, wxUint32 color)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_sub_col (wxUint16 *dst, int size, wxUint32 color)
|
||||
static void mod_tex_sub_col (wxUint16 *dst, int size, uint32_t color)
|
||||
{
|
||||
int cr, cg, cb;
|
||||
wxUint16 col;
|
||||
|
@ -424,10 +424,10 @@ static void mod_tex_sub_col (wxUint16 *dst, int size, wxUint32 color)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_sub_col_mul_fac (wxUint16 *dst, int size, wxUint32 color, wxUint32 factor)
|
||||
static void mod_tex_sub_col_mul_fac (wxUint16 *dst, int size, uint32_t color, uint32_t factor)
|
||||
{
|
||||
float percent = factor / 255.0f;
|
||||
wxUint32 cr, cg, cb;
|
||||
uint32_t cr, cg, cb;
|
||||
wxUint16 col, a;
|
||||
float r, g, b;
|
||||
|
||||
|
@ -456,9 +456,9 @@ static void mod_tex_sub_col_mul_fac (wxUint16 *dst, int size, wxUint32 color, wx
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_col_inter_tex_using_col1 (wxUint16 *dst, int size, wxUint32 color0, wxUint32 color1)
|
||||
static void mod_col_inter_tex_using_col1 (wxUint16 *dst, int size, uint32_t color0, uint32_t color1)
|
||||
{
|
||||
wxUint32 cr, cg, cb;
|
||||
uint32_t cr, cg, cb;
|
||||
wxUint16 col, a;
|
||||
wxUint8 r, g, b;
|
||||
|
||||
|
@ -484,7 +484,7 @@ static void mod_col_inter_tex_using_col1 (wxUint16 *dst, int size, wxUint32 colo
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_inter_noise_using_col (wxUint16 *dst, int size, wxUint32 color)
|
||||
static void mod_tex_inter_noise_using_col (wxUint16 *dst, int size, uint32_t color)
|
||||
{
|
||||
wxUint16 col, a;
|
||||
wxUint8 r, g, b, noise;
|
||||
|
@ -508,9 +508,9 @@ static void mod_tex_inter_noise_using_col (wxUint16 *dst, int size, wxUint32 col
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_inter_col_using_texa (wxUint16 *dst, int size, wxUint32 color)
|
||||
static void mod_tex_inter_col_using_texa (wxUint16 *dst, int size, uint32_t color)
|
||||
{
|
||||
wxUint32 cr, cg, cb;
|
||||
uint32_t cr, cg, cb;
|
||||
wxUint16 col;
|
||||
wxUint8 r, g, b;
|
||||
wxUint16 a;
|
||||
|
@ -533,7 +533,7 @@ static void mod_tex_inter_col_using_texa (wxUint16 *dst, int size, wxUint32 colo
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_mul_col (wxUint16 *dst, int size, wxUint32 color)
|
||||
static void mod_tex_mul_col (wxUint16 *dst, int size, uint32_t color)
|
||||
{
|
||||
float cr, cg, cb;
|
||||
wxUint16 col;
|
||||
|
@ -555,10 +555,10 @@ static void mod_tex_mul_col (wxUint16 *dst, int size, wxUint32 color)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_scale_fac_add_col (wxUint16 *dst, int size, wxUint32 color, wxUint32 factor)
|
||||
static void mod_tex_scale_fac_add_col (wxUint16 *dst, int size, uint32_t color, uint32_t factor)
|
||||
{
|
||||
float percent = factor / 255.0f;
|
||||
wxUint32 cr, cg, cb;
|
||||
uint32_t cr, cg, cb;
|
||||
wxUint16 col;
|
||||
float r, g, b;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
//
|
||||
//****************************************************************
|
||||
|
||||
static void mod_tex_inter_color_using_factor_CI (wxUint32 color, wxUint32 factor)
|
||||
static void mod_tex_inter_color_using_factor_CI (uint32_t color, uint32_t factor)
|
||||
{
|
||||
float percent = factor / 255.0f;
|
||||
float percent_i = 1 - percent;
|
||||
|
@ -66,7 +66,7 @@ static void mod_tex_inter_color_using_factor_CI (wxUint32 color, wxUint32 factor
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_inter_col_using_col1_CI (wxUint32 color0, wxUint32 color1)
|
||||
static void mod_tex_inter_col_using_col1_CI (uint32_t color0, uint32_t color1)
|
||||
{
|
||||
wxUint8 cr, cg, cb;
|
||||
wxUint16 col;
|
||||
|
@ -100,7 +100,7 @@ static void mod_tex_inter_col_using_col1_CI (wxUint32 color0, wxUint32 color1)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_full_color_sub_tex_CI (wxUint32 color)
|
||||
static void mod_full_color_sub_tex_CI (uint32_t color)
|
||||
{
|
||||
wxUint8 cr, cg, cb, ca;
|
||||
wxUint16 col;
|
||||
|
@ -129,9 +129,9 @@ static void mod_full_color_sub_tex_CI (wxUint32 color)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_col_inter_col1_using_tex_CI (wxUint32 color0, wxUint32 color1)
|
||||
static void mod_col_inter_col1_using_tex_CI (uint32_t color0, uint32_t color1)
|
||||
{
|
||||
wxUint32 cr0, cg0, cb0, cr1, cg1, cb1;
|
||||
uint32_t cr0, cg0, cb0, cr1, cg1, cb1;
|
||||
wxUint16 col;
|
||||
wxUint8 a, r, g, b;
|
||||
float percent_r, percent_g, percent_b;
|
||||
|
@ -162,7 +162,7 @@ static void mod_col_inter_col1_using_tex_CI (wxUint32 color0, wxUint32 color1)
|
|||
|
||||
|
||||
|
||||
static void mod_tex_sub_col_mul_fac_add_tex_CI (wxUint32 color, wxUint32 factor)
|
||||
static void mod_tex_sub_col_mul_fac_add_tex_CI (uint32_t color, uint32_t factor)
|
||||
{
|
||||
float percent = factor / 255.0f;
|
||||
wxUint8 cr, cg, cb, a;
|
||||
|
@ -196,7 +196,7 @@ static void mod_tex_sub_col_mul_fac_add_tex_CI (wxUint32 color, wxUint32 factor)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_scale_col_add_col_CI (wxUint32 color0, wxUint32 color1)
|
||||
static void mod_tex_scale_col_add_col_CI (uint32_t color0, uint32_t color1)
|
||||
{
|
||||
wxUint8 cr, cg, cb;
|
||||
wxUint16 col;
|
||||
|
@ -226,7 +226,7 @@ static void mod_tex_scale_col_add_col_CI (wxUint32 color0, wxUint32 color1)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_add_col_CI (wxUint32 color)
|
||||
static void mod_tex_add_col_CI (uint32_t color)
|
||||
{
|
||||
wxUint8 cr, cg, cb;
|
||||
wxUint16 col;
|
||||
|
@ -253,7 +253,7 @@ static void mod_tex_add_col_CI (wxUint32 color)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_sub_col_CI (wxUint32 color)
|
||||
static void mod_tex_sub_col_CI (uint32_t color)
|
||||
{
|
||||
wxUint8 cr, cg, cb;
|
||||
wxUint16 col;
|
||||
|
@ -280,7 +280,7 @@ static void mod_tex_sub_col_CI (wxUint32 color)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_sub_col_mul_fac_CI (wxUint32 color, wxUint32 factor)
|
||||
static void mod_tex_sub_col_mul_fac_CI (uint32_t color, uint32_t factor)
|
||||
{
|
||||
float percent = factor / 255.0f;
|
||||
wxUint8 cr, cg, cb;
|
||||
|
@ -316,7 +316,7 @@ static void mod_tex_sub_col_mul_fac_CI (wxUint32 color, wxUint32 factor)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_col_inter_tex_using_col1_CI (wxUint32 color0, wxUint32 color1)
|
||||
static void mod_col_inter_tex_using_col1_CI (uint32_t color0, uint32_t color1)
|
||||
{
|
||||
wxUint8 cr, cg, cb;
|
||||
wxUint16 col;
|
||||
|
@ -350,7 +350,7 @@ static void mod_col_inter_tex_using_col1_CI (wxUint32 color0, wxUint32 color1)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_inter_col_using_texa_CI (wxUint32 color)
|
||||
static void mod_tex_inter_col_using_texa_CI (uint32_t color)
|
||||
{
|
||||
wxUint8 a, r, g, b;
|
||||
|
||||
|
@ -367,7 +367,7 @@ static void mod_tex_inter_col_using_texa_CI (wxUint32 color)
|
|||
}
|
||||
}
|
||||
|
||||
static void mod_tex_mul_col_CI (wxUint32 color)
|
||||
static void mod_tex_mul_col_CI (uint32_t color)
|
||||
{
|
||||
wxUint8 a, r, g, b;
|
||||
wxUint16 col;
|
||||
|
@ -391,7 +391,7 @@ static void mod_tex_mul_col_CI (wxUint32 color)
|
|||
}
|
||||
}
|
||||
|
||||
static void ModifyPalette(wxUint32 mod, wxUint32 modcolor, wxUint32 modcolor1, wxUint32 modfactor)
|
||||
static void ModifyPalette(uint32_t mod, uint32_t modcolor, uint32_t modcolor1, uint32_t modfactor)
|
||||
{
|
||||
switch (mod)
|
||||
{
|
||||
|
|
|
@ -65,7 +65,7 @@ void util_init ()
|
|||
}
|
||||
}
|
||||
|
||||
static wxUint32 u_cull_mode = 0;
|
||||
static uint32_t u_cull_mode = 0;
|
||||
|
||||
//software backface culling. Gonetz
|
||||
// mega modifications by Dave2001
|
||||
|
@ -164,15 +164,15 @@ int cull_tri(VERTEX **v) // type changed to VERTEX** [Dave2001]
|
|||
void apply_shade_mods (VERTEX *v)
|
||||
{
|
||||
float col[4];
|
||||
wxUint32 mod;
|
||||
uint32_t mod;
|
||||
memcpy (col, rdp.col, 16);
|
||||
|
||||
if (rdp.cmb_flags)
|
||||
{
|
||||
if (v->shade_mod == 0)
|
||||
v->color_backup = *(wxUint32*)(&(v->b));
|
||||
v->color_backup = *(uint32_t*)(&(v->b));
|
||||
else
|
||||
*(wxUint32*)(&(v->b)) = v->color_backup;
|
||||
*(uint32_t*)(&(v->b)) = v->color_backup;
|
||||
mod = rdp.cmb_flags;
|
||||
if (mod & CMB_SET)
|
||||
{
|
||||
|
@ -1791,10 +1791,10 @@ void update_scissor ()
|
|||
rdp.update ^= UPDATE_SCISSOR;
|
||||
|
||||
// KILL the floating point error with 0.01f
|
||||
rdp.scissor.ul_x = (wxUint32)max(min((rdp.scissor_o.ul_x * rdp.scale_x + rdp.offset_x + 0.01f),settings.res_x),0);
|
||||
rdp.scissor.lr_x = (wxUint32)max(min((rdp.scissor_o.lr_x * rdp.scale_x + rdp.offset_x + 0.01f),settings.res_x),0);
|
||||
rdp.scissor.ul_y = (wxUint32)max(min((rdp.scissor_o.ul_y * rdp.scale_y + rdp.offset_y + 0.01f),settings.res_y),0);
|
||||
rdp.scissor.lr_y = (wxUint32)max(min((rdp.scissor_o.lr_y * rdp.scale_y + rdp.offset_y + 0.01f),settings.res_y),0);
|
||||
rdp.scissor.ul_x = (uint32_t)max(min((rdp.scissor_o.ul_x * rdp.scale_x + rdp.offset_x + 0.01f),settings.res_x),0);
|
||||
rdp.scissor.lr_x = (uint32_t)max(min((rdp.scissor_o.lr_x * rdp.scale_x + rdp.offset_x + 0.01f),settings.res_x),0);
|
||||
rdp.scissor.ul_y = (uint32_t)max(min((rdp.scissor_o.ul_y * rdp.scale_y + rdp.offset_y + 0.01f),settings.res_y),0);
|
||||
rdp.scissor.lr_y = (uint32_t)max(min((rdp.scissor_o.lr_y * rdp.scale_y + rdp.offset_y + 0.01f),settings.res_y),0);
|
||||
//grClipWindow specifies the hardware clipping window. Any pixels outside the clipping window are rejected.
|
||||
//Values are inclusive for minimum x and y values and exclusive for maximum x and y values.
|
||||
// grClipWindow (rdp.scissor.ul_x?rdp.scissor.ul_x+1:0, rdp.scissor.ul_y?rdp.scissor.ul_y+1:0, rdp.scissor.lr_x, rdp.scissor.lr_y);
|
||||
|
@ -2038,7 +2038,7 @@ void update ()
|
|||
if (rdp.update & UPDATE_CULL_MODE)
|
||||
{
|
||||
rdp.update ^= UPDATE_CULL_MODE;
|
||||
wxUint32 mode = (rdp.flags & CULLMASK) >> CULLSHIFT;
|
||||
uint32_t mode = (rdp.flags & CULLMASK) >> CULLSHIFT;
|
||||
FRDP (" |- cull_mode - mode: %s\n", str_cull[mode]);
|
||||
switch (mode)
|
||||
{
|
||||
|
@ -2116,13 +2116,13 @@ void update ()
|
|||
rdp.clip_max_x = min((rdp.view_trans[0] + scale_x + rdp.offset_x) * rdp.clip_ratio, settings.res_x);
|
||||
rdp.clip_max_y = min((rdp.view_trans[1] + scale_y + rdp.offset_y) * rdp.clip_ratio, settings.res_y);
|
||||
|
||||
FRDP (" |- viewport - (%d, %d, %d, %d)\n", (wxUint32)rdp.clip_min_x, (wxUint32)rdp.clip_min_y, (wxUint32)rdp.clip_max_x, (wxUint32)rdp.clip_max_y);
|
||||
FRDP (" |- viewport - (%d, %d, %d, %d)\n", (uint32_t)rdp.clip_min_x, (uint32_t)rdp.clip_min_y, (uint32_t)rdp.clip_max_x, (uint32_t)rdp.clip_max_y);
|
||||
if (!rdp.scissor_set)
|
||||
{
|
||||
rdp.scissor.ul_x = (wxUint32)rdp.clip_min_x;
|
||||
rdp.scissor.lr_x = (wxUint32)rdp.clip_max_x;
|
||||
rdp.scissor.ul_y = (wxUint32)rdp.clip_min_y;
|
||||
rdp.scissor.lr_y = (wxUint32)rdp.clip_max_y;
|
||||
rdp.scissor.ul_x = (uint32_t)rdp.clip_min_x;
|
||||
rdp.scissor.lr_x = (uint32_t)rdp.clip_max_x;
|
||||
rdp.scissor.ul_y = (uint32_t)rdp.clip_min_y;
|
||||
rdp.scissor.lr_y = (uint32_t)rdp.clip_max_y;
|
||||
grClipWindow (rdp.scissor.ul_x, rdp.scissor.ul_y, rdp.scissor.lr_x, rdp.scissor.lr_y);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ const char *CIStatus[] = { "ci_main", "ci_zimg", "ci_unknown", "ci_useless",
|
|||
|
||||
char out_buf[2048];
|
||||
|
||||
wxUint32 frame_count; // frame counter
|
||||
uint32_t frame_count; // frame counter
|
||||
|
||||
int ucode_error_report = TRUE;
|
||||
int wrong_tile = -1;
|
||||
|
@ -196,7 +196,7 @@ static void rsp_reserved3();
|
|||
static void ys_memrect();
|
||||
|
||||
wxUint8 microcode[4096];
|
||||
wxUint32 uc_crc;
|
||||
uint32_t uc_crc;
|
||||
void microcheck ();
|
||||
|
||||
// ** UCODE FUNCTIONS **
|
||||
|
@ -293,13 +293,13 @@ void rdp_reset ()
|
|||
|
||||
void microcheck ()
|
||||
{
|
||||
wxUint32 i;
|
||||
uint32_t i;
|
||||
uc_crc = 0;
|
||||
|
||||
// Check first 3k of ucode, because the last 1k sometimes contains trash
|
||||
for (i=0; i<3072>>2; i++)
|
||||
{
|
||||
uc_crc += ((wxUint32*)microcode)[i];
|
||||
uc_crc += ((uint32_t*)microcode)[i];
|
||||
}
|
||||
|
||||
FRDP_E ("crc: %08lx\n", uc_crc);
|
||||
|
@ -414,7 +414,7 @@ void drawNoFullscreenMessage()
|
|||
#endif
|
||||
}
|
||||
|
||||
static wxUint32 d_ul_x, d_ul_y, d_lr_x, d_lr_y;
|
||||
static uint32_t d_ul_x, d_ul_y, d_lr_x, d_lr_y;
|
||||
|
||||
static void DrawPartFrameBufferToScreen()
|
||||
{
|
||||
|
@ -434,9 +434,9 @@ static void DrawPartFrameBufferToScreen()
|
|||
|
||||
#define RGBA16TO32(color) \
|
||||
((color&1)?0xFF:0) | \
|
||||
((wxUint32)((float)((color&0xF800) >> 11) / 31.0f * 255.0f) << 24) | \
|
||||
((wxUint32)((float)((color&0x07C0) >> 6) / 31.0f * 255.0f) << 16) | \
|
||||
((wxUint32)((float)((color&0x003E) >> 1) / 31.0f * 255.0f) << 8)
|
||||
((uint32_t)((float)((color&0xF800) >> 11) / 31.0f * 255.0f) << 24) | \
|
||||
((uint32_t)((float)((color&0x07C0) >> 6) / 31.0f * 255.0f) << 16) | \
|
||||
((uint32_t)((float)((color&0x003E) >> 1) / 31.0f * 255.0f) << 8)
|
||||
|
||||
static void copyWhiteToRDRAM()
|
||||
{
|
||||
|
@ -444,11 +444,11 @@ static void copyWhiteToRDRAM()
|
|||
return;
|
||||
|
||||
wxUint16 *ptr_dst = (wxUint16*)(gfx.RDRAM + rdp.cimg);
|
||||
wxUint32 *ptr_dst32 = (wxUint32*)(gfx.RDRAM + rdp.cimg);
|
||||
uint32_t *ptr_dst32 = (uint32_t*)(gfx.RDRAM + rdp.cimg);
|
||||
|
||||
for(wxUint32 y = 0; y < rdp.ci_height; y++)
|
||||
for(uint32_t y = 0; y < rdp.ci_height; y++)
|
||||
{
|
||||
for(wxUint32 x = 0; x < rdp.ci_width; x++)
|
||||
for(uint32_t x = 0; x < rdp.ci_width; x++)
|
||||
{
|
||||
if(rdp.ci_size == 2)
|
||||
ptr_dst[(x + y * rdp.ci_width) ^ 1] = 0xFFFF;
|
||||
|
@ -467,8 +467,8 @@ static void CopyFrameBuffer (GrBuffer_t buffer = GR_BUFFER_BACKBUFFER)
|
|||
// don't bother to write the stuff in asm... the slow part is the read from video card,
|
||||
// not the copy.
|
||||
|
||||
wxUint32 width = rdp.ci_width;//*gfx.VI_WIDTH_REG;
|
||||
wxUint32 height;
|
||||
uint32_t width = rdp.ci_width;//*gfx.VI_WIDTH_REG;
|
||||
uint32_t height;
|
||||
if (fb_emulation_enabled && !(settings.hacks&hack_PPL))
|
||||
{
|
||||
int ind = (rdp.ci_count > 0)?rdp.ci_count-1:0;
|
||||
|
@ -486,20 +486,20 @@ static void CopyFrameBuffer (GrBuffer_t buffer = GR_BUFFER_BACKBUFFER)
|
|||
{
|
||||
wxUint16 * ptr_src = new wxUint16[width*height];
|
||||
if (grLfbReadRegion(buffer,
|
||||
(wxUint32)rdp.offset_x,
|
||||
(wxUint32)rdp.offset_y,//rdp.ci_upper_bound,
|
||||
(uint32_t)rdp.offset_x,
|
||||
(uint32_t)rdp.offset_y,//rdp.ci_upper_bound,
|
||||
width,
|
||||
height,
|
||||
width<<1,
|
||||
ptr_src))
|
||||
{
|
||||
wxUint16 *ptr_dst = (wxUint16*)(gfx.RDRAM+rdp.cimg);
|
||||
wxUint32 *ptr_dst32 = (wxUint32*)(gfx.RDRAM+rdp.cimg);
|
||||
uint32_t *ptr_dst32 = (uint32_t*)(gfx.RDRAM+rdp.cimg);
|
||||
wxUint16 c;
|
||||
|
||||
for (wxUint32 y=0; y<height; y++)
|
||||
for (uint32_t y=0; y<height; y++)
|
||||
{
|
||||
for (wxUint32 x=0; x<width; x++)
|
||||
for (uint32_t x=0; x<width; x++)
|
||||
{
|
||||
c = ptr_src[x + y * width];
|
||||
if (settings.frame_buffer&fb_read_alpha)
|
||||
|
@ -549,9 +549,9 @@ static void CopyFrameBuffer (GrBuffer_t buffer = GR_BUFFER_BACKBUFFER)
|
|||
{
|
||||
wxUint16 *ptr_src = (wxUint16*)info.lfbPtr;
|
||||
wxUint16 *ptr_dst = (wxUint16*)(gfx.RDRAM+rdp.cimg);
|
||||
wxUint32 *ptr_dst32 = (wxUint32*)(gfx.RDRAM+rdp.cimg);
|
||||
uint32_t *ptr_dst32 = (uint32_t*)(gfx.RDRAM+rdp.cimg);
|
||||
wxUint16 c;
|
||||
wxUint32 stride = info.strideInBytes>>1;
|
||||
uint32_t stride = info.strideInBytes>>1;
|
||||
|
||||
int read_alpha = settings.frame_buffer & fb_read_alpha;
|
||||
if ((settings.hacks&hack_PMario) && rdp.frame_buffers[rdp.ci_count-1].status != ci_aux)
|
||||
|
@ -631,15 +631,15 @@ input: none
|
|||
output: none
|
||||
*******************************************************************/
|
||||
void DetectFrameBufferUsage ();
|
||||
wxUint32 fbreads_front = 0;
|
||||
wxUint32 fbreads_back = 0;
|
||||
uint32_t fbreads_front = 0;
|
||||
uint32_t fbreads_back = 0;
|
||||
int cpu_fb_read_called = FALSE;
|
||||
int cpu_fb_write_called = FALSE;
|
||||
int cpu_fb_write = FALSE;
|
||||
int cpu_fb_ignore = FALSE;
|
||||
int CI_SET = TRUE;
|
||||
wxUint32 ucode5_texshiftaddr = 0;
|
||||
wxUint32 ucode5_texshiftcount = 0;
|
||||
uint32_t ucode5_texshiftaddr = 0;
|
||||
uint32_t ucode5_texshiftcount = 0;
|
||||
wxUint16 ucode5_texshift = 0;
|
||||
int depth_buffer_fog;
|
||||
|
||||
|
@ -684,7 +684,7 @@ EXPORT void CALL ProcessDList(void)
|
|||
if (settings.autodetect_ucode)
|
||||
{
|
||||
// Thanks to ZeZu for ucode autodetection!!!
|
||||
wxUint32 startUcode = *(wxUint32*)(gfx.DMEM+0xFD0);
|
||||
uint32_t startUcode = *(uint32_t*)(gfx.DMEM+0xFD0);
|
||||
memcpy (microcode, gfx.RDRAM+startUcode, 4096);
|
||||
microcheck ();
|
||||
}
|
||||
|
@ -693,7 +693,7 @@ EXPORT void CALL ProcessDList(void)
|
|||
}
|
||||
else if ( ((old_ucode == ucode_S2DEX) && (settings.ucode == ucode_F3DEX)) || settings.force_microcheck)
|
||||
{
|
||||
wxUint32 startUcode = *(wxUint32*)(gfx.DMEM+0xFD0);
|
||||
uint32_t startUcode = *(uint32_t*)(gfx.DMEM+0xFD0);
|
||||
memcpy (microcode, gfx.RDRAM+startUcode, 4096);
|
||||
microcheck ();
|
||||
}
|
||||
|
@ -736,7 +736,7 @@ EXPORT void CALL ProcessDList(void)
|
|||
|
||||
rdp.model_i = 0; // 0 matrices so far in stack
|
||||
//stack_size can be less then 32! Important for Silicon Vally. Thanks Orkin!
|
||||
rdp.model_stack_size = min(32, (*(wxUint32*)(gfx.DMEM+0x0FE4))>>6);
|
||||
rdp.model_stack_size = min(32, (*(uint32_t*)(gfx.DMEM+0x0FE4))>>6);
|
||||
if (rdp.model_stack_size == 0)
|
||||
rdp.model_stack_size = 32;
|
||||
rdp.Persp_en = TRUE;
|
||||
|
@ -773,8 +773,8 @@ EXPORT void CALL ProcessDList(void)
|
|||
//* End of set states *//
|
||||
|
||||
// Get the start of the display list and the length of it
|
||||
wxUint32 dlist_start = *(wxUint32*)(gfx.DMEM+0xFF0);
|
||||
wxUint32 dlist_length = *(wxUint32*)(gfx.DMEM+0xFF4);
|
||||
uint32_t dlist_start = *(uint32_t*)(gfx.DMEM+0xFF0);
|
||||
uint32_t dlist_length = *(uint32_t*)(gfx.DMEM+0xFF4);
|
||||
FRDP("--- NEW DLIST --- crc: %08lx, ucode: %d, fbuf: %08lx, fbuf_width: %d, dlist start: %08lx, dlist_length: %d, x_scale: %f, y_scale: %f\n", uc_crc, settings.ucode, *gfx.VI_ORIGIN_REG, *gfx.VI_WIDTH_REG, dlist_start, dlist_length, (*gfx.VI_X_SCALE_REG & 0xFFF)/1024.0f, (*gfx.VI_Y_SCALE_REG & 0xFFF)/1024.0f);
|
||||
FRDP_E("--- NEW DLIST --- crc: %08lx, ucode: %d, fbuf: %08lx\n", uc_crc, settings.ucode, *gfx.VI_ORIGIN_REG);
|
||||
|
||||
|
@ -796,7 +796,7 @@ EXPORT void CALL ProcessDList(void)
|
|||
rdp.pc[rdp.pc_i] = dlist_start;
|
||||
rdp.dl_count = -1;
|
||||
rdp.halt = 0;
|
||||
wxUint32 a;
|
||||
uint32_t a;
|
||||
|
||||
// catches exceptions so that it doesn't freeze
|
||||
#ifdef CATCH_EXCEPTIONS
|
||||
|
@ -815,8 +815,8 @@ EXPORT void CALL ProcessDList(void)
|
|||
a = rdp.pc[rdp.pc_i] & BMASK;
|
||||
|
||||
// Load the next command and its input
|
||||
rdp.cmd0 = ((wxUint32*)gfx.RDRAM)[a>>2]; // \ Current command, 64 bit
|
||||
rdp.cmd1 = ((wxUint32*)gfx.RDRAM)[(a>>2)+1]; // /
|
||||
rdp.cmd0 = ((uint32_t*)gfx.RDRAM)[a>>2]; // \ Current command, 64 bit
|
||||
rdp.cmd1 = ((uint32_t*)gfx.RDRAM)[(a>>2)+1]; // /
|
||||
// cmd2 and cmd3 are filled only when needed, by the function that needs them
|
||||
|
||||
// Output the address before the command
|
||||
|
@ -927,17 +927,17 @@ static void rdp_noop()
|
|||
|
||||
static void ys_memrect ()
|
||||
{
|
||||
wxUint32 tile = (wxUint16)((rdp.cmd1 & 0x07000000) >> 24);
|
||||
uint32_t tile = (wxUint16)((rdp.cmd1 & 0x07000000) >> 24);
|
||||
|
||||
wxUint32 lr_x = (wxUint16)((rdp.cmd0 & 0x00FFF000) >> 14);
|
||||
wxUint32 lr_y = (wxUint16)((rdp.cmd0 & 0x00000FFF) >> 2);
|
||||
wxUint32 ul_x = (wxUint16)((rdp.cmd1 & 0x00FFF000) >> 14);
|
||||
wxUint32 ul_y = (wxUint16)((rdp.cmd1 & 0x00000FFF) >> 2);
|
||||
uint32_t lr_x = (wxUint16)((rdp.cmd0 & 0x00FFF000) >> 14);
|
||||
uint32_t lr_y = (wxUint16)((rdp.cmd0 & 0x00000FFF) >> 2);
|
||||
uint32_t ul_x = (wxUint16)((rdp.cmd1 & 0x00FFF000) >> 14);
|
||||
uint32_t ul_y = (wxUint16)((rdp.cmd1 & 0x00000FFF) >> 2);
|
||||
|
||||
if (lr_y > rdp.scissor_o.lr_y)
|
||||
lr_y = rdp.scissor_o.lr_y;
|
||||
wxUint32 off_x = ((rdp.cmd2 & 0xFFFF0000) >> 16) >> 5;
|
||||
wxUint32 off_y = (rdp.cmd2 & 0x0000FFFF) >> 5;
|
||||
uint32_t off_x = ((rdp.cmd2 & 0xFFFF0000) >> 16) >> 5;
|
||||
uint32_t off_y = (rdp.cmd2 & 0x0000FFFF) >> 5;
|
||||
|
||||
FRDP ("memrect (%d, %d, %d, %d), ci_width: %d", ul_x, ul_y, lr_x, lr_y, rdp.ci_width);
|
||||
if (off_x > 0)
|
||||
|
@ -946,8 +946,8 @@ static void ys_memrect ()
|
|||
FRDP (" off_y: %d", off_y);
|
||||
LRDP("\n");
|
||||
|
||||
wxUint32 y, width = lr_x - ul_x;
|
||||
wxUint32 tex_width = rdp.tiles[tile].line << 3;
|
||||
uint32_t y, width = lr_x - ul_x;
|
||||
uint32_t tex_width = rdp.tiles[tile].line << 3;
|
||||
wxUint8 * texaddr = gfx.RDRAM + rdp.addr[rdp.tiles[tile].t_mem] + tex_width*off_y + off_x;
|
||||
wxUint8 * fbaddr = gfx.RDRAM + rdp.cimg + ul_x;
|
||||
|
||||
|
@ -1015,15 +1015,15 @@ static void rdp_texrect()
|
|||
{
|
||||
if (!rdp.LLE)
|
||||
{
|
||||
wxUint32 a = rdp.pc[rdp.pc_i];
|
||||
uint32_t a = rdp.pc[rdp.pc_i];
|
||||
wxUint8 cmdHalf1 = gfx.RDRAM[a+3];
|
||||
wxUint8 cmdHalf2 = gfx.RDRAM[a+11];
|
||||
a >>= 2;
|
||||
if ((cmdHalf1 == 0xE1 && cmdHalf2 == 0xF1) || (cmdHalf1 == 0xB4 && cmdHalf2 == 0xB3) || (cmdHalf1 == 0xB3 && cmdHalf2 == 0xB2))
|
||||
{
|
||||
//gSPTextureRectangle
|
||||
rdp.cmd2 = ((wxUint32*)gfx.RDRAM)[a+1];
|
||||
rdp.cmd3 = ((wxUint32*)gfx.RDRAM)[a+3];
|
||||
rdp.cmd2 = ((uint32_t*)gfx.RDRAM)[a+1];
|
||||
rdp.cmd3 = ((uint32_t*)gfx.RDRAM)[a+3];
|
||||
rdp.pc[rdp.pc_i] += 16;
|
||||
}
|
||||
else
|
||||
|
@ -1032,8 +1032,8 @@ static void rdp_texrect()
|
|||
if (settings.hacks&hack_ASB)
|
||||
rdp.cmd2 = 0;
|
||||
else
|
||||
rdp.cmd2 = ((wxUint32*)gfx.RDRAM)[a+0];
|
||||
rdp.cmd3 = ((wxUint32*)gfx.RDRAM)[a+1];
|
||||
rdp.cmd2 = ((uint32_t*)gfx.RDRAM)[a+0];
|
||||
rdp.cmd3 = ((uint32_t*)gfx.RDRAM)[a+1];
|
||||
rdp.pc[rdp.pc_i] += 8;
|
||||
}
|
||||
}
|
||||
|
@ -1183,11 +1183,11 @@ static void rdp_texrect()
|
|||
|
||||
int i;
|
||||
|
||||
wxUint32 tile = (wxUint16)((rdp.cmd1 & 0x07000000) >> 24);
|
||||
uint32_t tile = (wxUint16)((rdp.cmd1 & 0x07000000) >> 24);
|
||||
|
||||
rdp.texrecting = 1;
|
||||
|
||||
wxUint32 prev_tile = rdp.cur_tile;
|
||||
uint32_t prev_tile = rdp.cur_tile;
|
||||
rdp.cur_tile = tile;
|
||||
|
||||
const float Z = set_sprite_combine_mode ();
|
||||
|
@ -1590,10 +1590,10 @@ static void rdp_fullsync()
|
|||
|
||||
static void rdp_setkeygb()
|
||||
{
|
||||
wxUint32 sB = rdp.cmd1&0xFF;
|
||||
wxUint32 cB = (rdp.cmd1>>8)&0xFF;
|
||||
wxUint32 sG = (rdp.cmd1>>16)&0xFF;
|
||||
wxUint32 cG = (rdp.cmd1>>24)&0xFF;
|
||||
uint32_t sB = rdp.cmd1&0xFF;
|
||||
uint32_t cB = (rdp.cmd1>>8)&0xFF;
|
||||
uint32_t sG = (rdp.cmd1>>16)&0xFF;
|
||||
uint32_t cG = (rdp.cmd1>>24)&0xFF;
|
||||
rdp.SCALE = (rdp.SCALE&0xFF0000FF) | (sG<<16) | (sB<<8);
|
||||
rdp.CENTER = (rdp.CENTER&0xFF0000FF) | (cG<<16) | (cB<<8);
|
||||
FRDP("setkeygb. cG=%02lx, sG=%02lx, cB=%02lx, sB=%02lx\n", cG, sG, cB, sB);
|
||||
|
@ -1601,8 +1601,8 @@ static void rdp_setkeygb()
|
|||
|
||||
static void rdp_setkeyr()
|
||||
{
|
||||
wxUint32 sR = rdp.cmd1&0xFF;
|
||||
wxUint32 cR = (rdp.cmd1>>8)&0xFF;
|
||||
uint32_t sR = rdp.cmd1&0xFF;
|
||||
uint32_t cR = (rdp.cmd1>>8)&0xFF;
|
||||
rdp.SCALE = (rdp.SCALE&0x00FFFFFF) | (sR<<24);
|
||||
rdp.CENTER = (rdp.CENTER&0x00FFFFFF) | (cR<<24);
|
||||
FRDP("setkeyr. cR=%02lx, sR=%02lx\n", cR, sR);
|
||||
|
@ -1630,10 +1630,10 @@ static void rdp_setconvert()
|
|||
static void rdp_setscissor()
|
||||
{
|
||||
// clipper resolution is 320x240, scale based on computer resolution
|
||||
rdp.scissor_o.ul_x = /*min(*/(wxUint32)(((rdp.cmd0 & 0x00FFF000) >> 14))/*, 320)*/;
|
||||
rdp.scissor_o.ul_y = /*min(*/(wxUint32)(((rdp.cmd0 & 0x00000FFF) >> 2))/*, 240)*/;
|
||||
rdp.scissor_o.lr_x = /*min(*/(wxUint32)(((rdp.cmd1 & 0x00FFF000) >> 14))/*, 320)*/;
|
||||
rdp.scissor_o.lr_y = /*min(*/(wxUint32)(((rdp.cmd1 & 0x00000FFF) >> 2))/*, 240)*/;
|
||||
rdp.scissor_o.ul_x = /*min(*/(uint32_t)(((rdp.cmd0 & 0x00FFF000) >> 14))/*, 320)*/;
|
||||
rdp.scissor_o.ul_y = /*min(*/(uint32_t)(((rdp.cmd0 & 0x00000FFF) >> 2))/*, 240)*/;
|
||||
rdp.scissor_o.lr_x = /*min(*/(uint32_t)(((rdp.cmd1 & 0x00FFF000) >> 14))/*, 320)*/;
|
||||
rdp.scissor_o.lr_y = /*min(*/(uint32_t)(((rdp.cmd1 & 0x00000FFF) >> 2))/*, 240)*/;
|
||||
|
||||
rdp.ci_upper_bound = rdp.scissor_o.ul_y;
|
||||
rdp.ci_lower_bound = rdp.scissor_o.lr_y;
|
||||
|
@ -1665,13 +1665,13 @@ static void rdp_setprimdepth()
|
|||
static void rdp_setothermode()
|
||||
{
|
||||
#define F3DEX2_SETOTHERMODE(cmd,sft,len,data) { \
|
||||
rdp.cmd0 = (wxUint32)((cmd<<24) | ((32-(sft)-(len))<<8) | (((len)-1))); \
|
||||
rdp.cmd1 = (wxUint32)(data); \
|
||||
rdp.cmd0 = (uint32_t)((cmd<<24) | ((32-(sft)-(len))<<8) | (((len)-1))); \
|
||||
rdp.cmd1 = (uint32_t)(data); \
|
||||
gfx_instruction[settings.ucode][cmd] (); \
|
||||
}
|
||||
#define SETOTHERMODE(cmd,sft,len,data) { \
|
||||
rdp.cmd0 = (wxUint32)((cmd<<24) | ((sft)<<8) | (len)); \
|
||||
rdp.cmd1 = (wxUint32)data; \
|
||||
rdp.cmd0 = (uint32_t)((cmd<<24) | ((sft)<<8) | (len)); \
|
||||
rdp.cmd1 = (uint32_t)data; \
|
||||
gfx_instruction[settings.ucode][cmd] (); \
|
||||
}
|
||||
|
||||
|
@ -1691,7 +1691,7 @@ static void rdp_setothermode()
|
|||
}
|
||||
}
|
||||
|
||||
void load_palette (wxUint32 addr, wxUint16 start, wxUint16 count)
|
||||
void load_palette (uint32_t addr, wxUint16 start, wxUint16 count)
|
||||
{
|
||||
LRDP("Loading palette... ");
|
||||
wxUint16 *dpal = rdp.pal_8 + start;
|
||||
|
@ -1727,7 +1727,7 @@ void load_palette (wxUint32 addr, wxUint16 start, wxUint16 count)
|
|||
|
||||
static void rdp_loadtlut()
|
||||
{
|
||||
wxUint32 tile = (rdp.cmd1 >> 24) & 0x07;
|
||||
uint32_t tile = (rdp.cmd1 >> 24) & 0x07;
|
||||
wxUint16 start = rdp.tiles[tile].t_mem - 256; // starting location in the palettes
|
||||
// wxUint16 start = ((wxUint16)(rdp.cmd1 >> 2) & 0x3FF) + 1;
|
||||
wxUint16 count = ((wxUint16)(rdp.cmd1 >> 14) & 0x3FF) + 1; // number to copy
|
||||
|
@ -1767,7 +1767,7 @@ static void rdp_loadtlut()
|
|||
int tile_set = 0;
|
||||
static void rdp_settilesize()
|
||||
{
|
||||
wxUint32 tile = (rdp.cmd1 >> 24) & 0x07;
|
||||
uint32_t tile = (rdp.cmd1 >> 24) & 0x07;
|
||||
rdp.last_tile_size = tile;
|
||||
|
||||
rdp.tiles[tile].f_ul_s = (float)((rdp.cmd0 >> 12) & 0xFFF) / 4.0f;
|
||||
|
@ -1820,7 +1820,7 @@ static void rdp_settilesize()
|
|||
tile, ul_s, ul_t, lr_s, lr_t, rdp.tiles[tile].f_ul_s, rdp.tiles[tile].f_ul_t);
|
||||
}
|
||||
|
||||
void setTBufTex(wxUint16 t_mem, wxUint32 cnt)
|
||||
void setTBufTex(wxUint16 t_mem, uint32_t cnt)
|
||||
{
|
||||
FRDP("setTBufTex t_mem=%d, cnt=%d\n", t_mem, cnt);
|
||||
TBUFF_COLOR_IMAGE * pTbufTex = rdp.tbuff_tex;
|
||||
|
@ -1974,7 +1974,7 @@ end_dxt_test:
|
|||
}
|
||||
}
|
||||
|
||||
void LoadBlock32b(wxUint32 tile, wxUint32 ul_s, wxUint32 ul_t, wxUint32 lr_s, wxUint32 dxt);
|
||||
void LoadBlock32b(uint32_t tile, uint32_t ul_s, uint32_t ul_t, uint32_t lr_s, uint32_t dxt);
|
||||
static void rdp_loadblock()
|
||||
{
|
||||
if (rdp.skip_drawing)
|
||||
|
@ -1982,8 +1982,8 @@ static void rdp_loadblock()
|
|||
LRDP("loadblock skipped\n");
|
||||
return;
|
||||
}
|
||||
wxUint32 tile = (wxUint32)((rdp.cmd1 >> 24) & 0x07);
|
||||
wxUint32 dxt = (wxUint32)(rdp.cmd1 & 0x0FFF);
|
||||
uint32_t tile = (uint32_t)((rdp.cmd1 >> 24) & 0x07);
|
||||
uint32_t dxt = (uint32_t)(rdp.cmd1 & 0x0FFF);
|
||||
wxUint16 lr_s = (wxUint16)(rdp.cmd1 >> 14) & 0x3FF;
|
||||
if (ucode5_texshiftaddr)
|
||||
{
|
||||
|
@ -2001,13 +2001,13 @@ static void rdp_loadblock()
|
|||
rdp.addr[rdp.tiles[tile].t_mem] = rdp.timg.addr;
|
||||
|
||||
// ** DXT is used for swapping every other line
|
||||
/* double fdxt = (double)0x8000000F/(double)((wxUint32)(2047/(dxt-1))); // F for error
|
||||
wxUint32 _dxt = (wxUint32)fdxt;*/
|
||||
/* double fdxt = (double)0x8000000F/(double)((uint32_t)(2047/(dxt-1))); // F for error
|
||||
uint32_t _dxt = (uint32_t)fdxt;*/
|
||||
|
||||
// 0x00000800 -> 0x80000000 (so we can check the sign bit instead of the 11th bit)
|
||||
wxUint32 _dxt = dxt << 20;
|
||||
uint32_t _dxt = dxt << 20;
|
||||
|
||||
wxUint32 addr = segoffset(rdp.timg.addr) & BMASK;
|
||||
uint32_t addr = segoffset(rdp.timg.addr) & BMASK;
|
||||
|
||||
// lr_s specifies number of 64-bit words to copy
|
||||
// 10.2 format
|
||||
|
@ -2039,9 +2039,9 @@ static void rdp_loadblock()
|
|||
|
||||
//angrylion's advice to use ul_s in texture image offset and cnt calculations.
|
||||
//Helps to fix Vigilante 8 jpeg backgrounds and logos
|
||||
wxUint32 off = rdp.timg.addr + (ul_s << rdp.tiles[tile].size >> 1);
|
||||
uint32_t off = rdp.timg.addr + (ul_s << rdp.tiles[tile].size >> 1);
|
||||
unsigned char *dst = ((unsigned char *)rdp.tmem) + (rdp.tiles[tile].t_mem<<3);
|
||||
wxUint32 cnt = lr_s-ul_s+1;
|
||||
uint32_t cnt = lr_s-ul_s+1;
|
||||
if (rdp.tiles[tile].size == 3)
|
||||
cnt <<= 1;
|
||||
|
||||
|
@ -2198,7 +2198,7 @@ LABEL_20:
|
|||
while ( v12 );
|
||||
}
|
||||
|
||||
void LoadTile32b (wxUint32 tile, wxUint32 ul_s, wxUint32 ul_t, wxUint32 width, wxUint32 height);
|
||||
void LoadTile32b (uint32_t tile, uint32_t ul_s, uint32_t ul_t, uint32_t width, uint32_t height);
|
||||
static void rdp_loadtile()
|
||||
{
|
||||
if (rdp.skip_drawing)
|
||||
|
@ -2208,7 +2208,7 @@ static void rdp_loadtile()
|
|||
}
|
||||
rdp.timg.set_by = 1; // load tile
|
||||
|
||||
wxUint32 tile = (wxUint32)((rdp.cmd1 >> 24) & 0x07);
|
||||
uint32_t tile = (uint32_t)((rdp.cmd1 >> 24) & 0x07);
|
||||
|
||||
rdp.addr[rdp.tiles[tile].t_mem] = rdp.timg.addr;
|
||||
|
||||
|
@ -2247,8 +2247,8 @@ static void rdp_loadtile()
|
|||
rdp.tiles[0].lr_t = lr_t;
|
||||
}
|
||||
|
||||
wxUint32 height = lr_t - ul_t + 1; // get height
|
||||
wxUint32 width = lr_s - ul_s + 1;
|
||||
uint32_t height = lr_t - ul_t + 1; // get height
|
||||
uint32_t width = lr_s - ul_s + 1;
|
||||
|
||||
#ifdef TEXTURE_FILTER
|
||||
LOAD_TILE_INFO &info = rdp.load_info[rdp.tiles[tile].t_mem];
|
||||
|
@ -2267,7 +2267,7 @@ static void rdp_loadtile()
|
|||
#endif
|
||||
|
||||
int line_n = rdp.timg.width << rdp.tiles[tile].size >> 1;
|
||||
wxUint32 offs = ul_t * line_n;
|
||||
uint32_t offs = ul_t * line_n;
|
||||
offs += ul_s << rdp.tiles[tile].size >> 1;
|
||||
offs += rdp.timg.addr;
|
||||
if (offs >= BMASK)
|
||||
|
@ -2285,7 +2285,7 @@ static void rdp_loadtile()
|
|||
if (height == 0)
|
||||
return;
|
||||
|
||||
wxUint32 wid_64 = rdp.tiles[tile].line;
|
||||
uint32_t wid_64 = rdp.tiles[tile].line;
|
||||
unsigned char *dst = ((unsigned char *)rdp.tmem) + (rdp.tiles[tile].t_mem<<3);
|
||||
unsigned char *end = ((unsigned char *)rdp.tmem) + 4096 - (wid_64<<3);
|
||||
loadTile((uint32_t *)gfx.RDRAM, (uint32_t *)dst, wid_64, height, line_n, offs, (uint32_t *)end);
|
||||
|
@ -2303,7 +2303,7 @@ static void rdp_settile()
|
|||
|
||||
rdp.first = 0;
|
||||
|
||||
rdp.last_tile = (wxUint32)((rdp.cmd1 >> 24) & 0x07);
|
||||
rdp.last_tile = (uint32_t)((rdp.cmd1 >> 24) & 0x07);
|
||||
TILE *tile = &rdp.tiles[rdp.last_tile];
|
||||
|
||||
tile->format = (wxUint8)((rdp.cmd0 >> 21) & 0x07);
|
||||
|
@ -2360,10 +2360,10 @@ static void rdp_settile()
|
|||
|
||||
static void rdp_fillrect()
|
||||
{
|
||||
wxUint32 ul_x = ((rdp.cmd1 & 0x00FFF000) >> 14);
|
||||
wxUint32 ul_y = (rdp.cmd1 & 0x00000FFF) >> 2;
|
||||
wxUint32 lr_x = ((rdp.cmd0 & 0x00FFF000) >> 14) + 1;
|
||||
wxUint32 lr_y = ((rdp.cmd0 & 0x00000FFF) >> 2) + 1;
|
||||
uint32_t ul_x = ((rdp.cmd1 & 0x00FFF000) >> 14);
|
||||
uint32_t ul_y = (rdp.cmd1 & 0x00000FFF) >> 2;
|
||||
uint32_t lr_x = ((rdp.cmd0 & 0x00FFF000) >> 14) + 1;
|
||||
uint32_t lr_y = ((rdp.cmd0 & 0x00000FFF) >> 2) + 1;
|
||||
if ((ul_x > lr_x) || (ul_y > lr_y))
|
||||
{
|
||||
LRDP("Fillrect. Wrong coordinates. Skipped\n");
|
||||
|
@ -2390,14 +2390,14 @@ static void rdp_fillrect()
|
|||
lr_x = min(max(lr_x, rdp.scissor_o.ul_x), rdp.scissor_o.lr_x);
|
||||
ul_y = min(max(ul_y, rdp.scissor_o.ul_y), rdp.scissor_o.lr_y);
|
||||
lr_y = min(max(lr_y, rdp.scissor_o.ul_y), rdp.scissor_o.lr_y);
|
||||
wxUint32 zi_width_in_dwords = rdp.ci_width >> 1;
|
||||
uint32_t zi_width_in_dwords = rdp.ci_width >> 1;
|
||||
ul_x >>= 1;
|
||||
lr_x >>= 1;
|
||||
wxUint32 * dst = (wxUint32*)(gfx.RDRAM+rdp.cimg);
|
||||
uint32_t * dst = (uint32_t*)(gfx.RDRAM+rdp.cimg);
|
||||
dst += ul_y * zi_width_in_dwords;
|
||||
for (wxUint32 y = ul_y; y < lr_y; y++)
|
||||
for (uint32_t y = ul_y; y < lr_y; y++)
|
||||
{
|
||||
for (wxUint32 x = ul_x; x < lr_x; x++)
|
||||
for (uint32_t x = ul_x; x < lr_x; x++)
|
||||
{
|
||||
dst[x] = rdp.fill_color;
|
||||
}
|
||||
|
@ -2416,13 +2416,13 @@ static void rdp_fillrect()
|
|||
|
||||
if (rdp.cur_image && (rdp.cur_image->format != 0) && (rdp.cycle_mode == 3) && (rdp.cur_image->width == lr_x - ul_x) && (rdp.cur_image->height == lr_y - ul_y))
|
||||
{
|
||||
wxUint32 color = rdp.fill_color;
|
||||
uint32_t color = rdp.fill_color;
|
||||
if (rdp.ci_size < 3)
|
||||
{
|
||||
color = ((color&1)?0xFF:0) |
|
||||
((wxUint32)((float)((color&0xF800) >> 11) / 31.0f * 255.0f) << 24) |
|
||||
((wxUint32)((float)((color&0x07C0) >> 6) / 31.0f * 255.0f) << 16) |
|
||||
((wxUint32)((float)((color&0x003E) >> 1) / 31.0f * 255.0f) << 8);
|
||||
((uint32_t)((float)((color&0xF800) >> 11) / 31.0f * 255.0f) << 24) |
|
||||
((uint32_t)((float)((color&0x07C0) >> 6) / 31.0f * 255.0f) << 16) |
|
||||
((uint32_t)((float)((color&0x003E) >> 1) / 31.0f * 255.0f) << 8);
|
||||
}
|
||||
grDepthMask (FXFALSE);
|
||||
grBufferClear (color, 0, 0xFFFF);
|
||||
|
@ -2447,15 +2447,15 @@ static void rdp_fillrect()
|
|||
rdp.scissor.lr_y);
|
||||
|
||||
// KILL the floating point error with 0.01f
|
||||
wxInt32 s_ul_x = (wxUint32)min(max(ul_x * rdp.scale_x + rdp.offset_x + 0.01f, rdp.scissor.ul_x), rdp.scissor.lr_x);
|
||||
wxInt32 s_lr_x = (wxUint32)min(max(lr_x * rdp.scale_x + rdp.offset_x + 0.01f, rdp.scissor.ul_x), rdp.scissor.lr_x);
|
||||
wxInt32 s_ul_y = (wxUint32)min(max(ul_y * rdp.scale_y + rdp.offset_y + 0.01f, rdp.scissor.ul_y), rdp.scissor.lr_y);
|
||||
wxInt32 s_lr_y = (wxUint32)min(max(lr_y * rdp.scale_y + rdp.offset_y + 0.01f, rdp.scissor.ul_y), rdp.scissor.lr_y);
|
||||
wxInt32 s_ul_x = (uint32_t)min(max(ul_x * rdp.scale_x + rdp.offset_x + 0.01f, rdp.scissor.ul_x), rdp.scissor.lr_x);
|
||||
wxInt32 s_lr_x = (uint32_t)min(max(lr_x * rdp.scale_x + rdp.offset_x + 0.01f, rdp.scissor.ul_x), rdp.scissor.lr_x);
|
||||
wxInt32 s_ul_y = (uint32_t)min(max(ul_y * rdp.scale_y + rdp.offset_y + 0.01f, rdp.scissor.ul_y), rdp.scissor.lr_y);
|
||||
wxInt32 s_lr_y = (uint32_t)min(max(lr_y * rdp.scale_y + rdp.offset_y + 0.01f, rdp.scissor.ul_y), rdp.scissor.lr_y);
|
||||
|
||||
if (s_lr_x < 0) s_lr_x = 0;
|
||||
if (s_lr_y < 0) s_lr_y = 0;
|
||||
if ((wxUint32)s_ul_x > settings.res_x) s_ul_x = settings.res_x;
|
||||
if ((wxUint32)s_ul_y > settings.res_y) s_ul_y = settings.res_y;
|
||||
if ((uint32_t)s_ul_x > settings.res_x) s_ul_x = settings.res_x;
|
||||
if ((uint32_t)s_ul_y > settings.res_y) s_ul_y = settings.res_y;
|
||||
|
||||
FRDP (" - %d, %d, %d, %d\n", s_ul_x, s_ul_y, s_lr_x, s_lr_y);
|
||||
|
||||
|
@ -2474,7 +2474,7 @@ static void rdp_fillrect()
|
|||
|
||||
if (rdp.cycle_mode == 3)
|
||||
{
|
||||
wxUint32 color = rdp.fill_color;
|
||||
uint32_t color = rdp.fill_color;
|
||||
|
||||
if ((settings.hacks&hack_PMario) && rdp.ci_count > 0 && rdp.frame_buffers[rdp.ci_count-1].status == ci_aux)
|
||||
{
|
||||
|
@ -2485,9 +2485,9 @@ static void rdp_fillrect()
|
|||
else if (rdp.ci_size < 3)
|
||||
{
|
||||
color = ((color&1)?0xFF:0) |
|
||||
((wxUint32)((float)((color&0xF800) >> 11) / 31.0f * 255.0f) << 24) |
|
||||
((wxUint32)((float)((color&0x07C0) >> 6) / 31.0f * 255.0f) << 16) |
|
||||
((wxUint32)((float)((color&0x003E) >> 1) / 31.0f * 255.0f) << 8);
|
||||
((uint32_t)((float)((color&0xF800) >> 11) / 31.0f * 255.0f) << 24) |
|
||||
((uint32_t)((float)((color&0x07C0) >> 6) / 31.0f * 255.0f) << 16) |
|
||||
((uint32_t)((float)((color&0x003E) >> 1) / 31.0f * 255.0f) << 8);
|
||||
}
|
||||
|
||||
grConstantColorValue (color);
|
||||
|
@ -2519,8 +2519,8 @@ static void rdp_fillrect()
|
|||
}
|
||||
else
|
||||
{
|
||||
wxUint32 cmb_mode_c = (rdp.cycle1 << 16) | (rdp.cycle2 & 0xFFFF);
|
||||
wxUint32 cmb_mode_a = (rdp.cycle1 & 0x0FFF0000) | ((rdp.cycle2 >> 16) & 0x00000FFF);
|
||||
uint32_t cmb_mode_c = (rdp.cycle1 << 16) | (rdp.cycle2 & 0xFFFF);
|
||||
uint32_t cmb_mode_a = (rdp.cycle1 & 0x0FFF0000) | ((rdp.cycle2 >> 16) & 0x00000FFF);
|
||||
if (cmb_mode_c == 0x9fff9fff || cmb_mode_a == 0x09ff09ff) //shade
|
||||
{
|
||||
AllowShadeMods (v, 4);
|
||||
|
@ -2738,7 +2738,7 @@ static void RestoreScale()
|
|||
//*/
|
||||
}
|
||||
|
||||
static wxUint32 swapped_addr = 0;
|
||||
static uint32_t swapped_addr = 0;
|
||||
|
||||
static void rdp_setcolorimage()
|
||||
{
|
||||
|
@ -2985,8 +2985,8 @@ static void rdp_setcolorimage()
|
|||
}
|
||||
}
|
||||
grLfbWriteRegion(GR_BUFFER_BACKBUFFER,
|
||||
(wxUint32)rdp.offset_x,
|
||||
(wxUint32)rdp.offset_y,
|
||||
(uint32_t)rdp.offset_x,
|
||||
(uint32_t)rdp.offset_y,
|
||||
GR_LFB_SRC_FMT_555,
|
||||
width,
|
||||
height,
|
||||
|
@ -3048,7 +3048,7 @@ static void rdp_setcolorimage()
|
|||
// int zi_height = min((int)rdp.zi_width*3/4, (int)rdp.vi_height);
|
||||
// rdp.zi_words = rdp.zi_width * zi_height;
|
||||
}
|
||||
wxUint32 format = (rdp.cmd0 >> 21) & 0x7;
|
||||
uint32_t format = (rdp.cmd0 >> 21) & 0x7;
|
||||
rdp.ci_size = (rdp.cmd0 >> 19) & 0x3;
|
||||
rdp.ci_end = rdp.cimg + ((rdp.ci_width*rdp.ci_height)<<(rdp.ci_size-1));
|
||||
FRDP("setcolorimage - %08lx, width: %d, height: %d, format: %d, size: %d\n", rdp.cmd1, rdp.ci_width, rdp.ci_height, format, rdp.ci_size);
|
||||
|
@ -3222,10 +3222,10 @@ Emulator should not call this function again if other memory
|
|||
is read within the same 4KB range
|
||||
input: addr rdram address
|
||||
val val
|
||||
size 1 = wxUint8, 2 = wxUint16, 4 = wxUint32
|
||||
size 1 = wxUint8, 2 = wxUint16, 4 = uint32_t
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL FBRead(wxUint32 addr)
|
||||
EXPORT void CALL FBRead(uint32_t addr)
|
||||
{
|
||||
LOG ("FBRead ()\n");
|
||||
|
||||
|
@ -3238,7 +3238,7 @@ EXPORT void CALL FBRead(wxUint32 addr)
|
|||
return;
|
||||
}
|
||||
cpu_fb_read_called = TRUE;
|
||||
wxUint32 a = segoffset(addr);
|
||||
uint32_t a = segoffset(addr);
|
||||
FRDP("FBRead. addr: %08lx\n", a);
|
||||
if (!rdp.fb_drawn && (a >= rdp.cimg) && (a < rdp.ci_end))
|
||||
{
|
||||
|
@ -3254,13 +3254,13 @@ EXPORT void CALL FBRead(wxUint32 addr)
|
|||
fbreads_front++;
|
||||
//if (fbreads_front > 2)//&& (rdp.ci_width <= 320))
|
||||
{
|
||||
wxUint32 cimg = rdp.cimg;
|
||||
uint32_t cimg = rdp.cimg;
|
||||
rdp.cimg = rdp.maincimg[1].addr;
|
||||
if (fb_emulation_enabled)
|
||||
{
|
||||
rdp.ci_width = rdp.maincimg[1].width;
|
||||
rdp.ci_count = 0;
|
||||
wxUint32 h = rdp.frame_buffers[0].height;
|
||||
uint32_t h = rdp.frame_buffers[0].height;
|
||||
rdp.frame_buffers[0].height = rdp.maincimg[1].height;
|
||||
CopyFrameBuffer(GR_BUFFER_FRONTBUFFER);
|
||||
rdp.frame_buffers[0].height = h;
|
||||
|
@ -3284,9 +3284,9 @@ size = size of the plist, max = 1024
|
|||
output: none
|
||||
*******************************************************************/
|
||||
#ifdef RDP_LOGGING
|
||||
EXPORT void CALL FBWList(FrameBufferModifyEntry* /*plist*/, wxUint32 size)
|
||||
EXPORT void CALL FBWList(FrameBufferModifyEntry* /*plist*/, uint32_t size)
|
||||
#else
|
||||
EXPORT void CALL FBWList(FrameBufferModifyEntry* /*plist*/, wxUint32)
|
||||
EXPORT void CALL FBWList(FrameBufferModifyEntry* /*plist*/, uint32_t)
|
||||
#endif
|
||||
{
|
||||
LOG ("FBWList ()\n");
|
||||
|
@ -3302,10 +3302,10 @@ Purpose: This function is called to notify the dll that the
|
|||
frame buffer has been modified by CPU at the given address.
|
||||
input: addr rdram address
|
||||
val val
|
||||
size 1 = wxUint8, 2 = wxUint16, 4 = wxUint32
|
||||
size 1 = wxUint8, 2 = wxUint16, 4 = uint32_t
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL FBWrite(wxUint32 addr, wxUint32 /*size*/)
|
||||
EXPORT void CALL FBWrite(uint32_t addr, uint32_t /*size*/)
|
||||
{
|
||||
LOG ("FBWrite ()\n");
|
||||
if (cpu_fb_ignore)
|
||||
|
@ -3317,13 +3317,13 @@ EXPORT void CALL FBWrite(wxUint32 addr, wxUint32 /*size*/)
|
|||
return;
|
||||
}
|
||||
cpu_fb_write_called = TRUE;
|
||||
wxUint32 a = segoffset(addr);
|
||||
uint32_t a = segoffset(addr);
|
||||
FRDP("FBWrite. addr: %08lx\n", a);
|
||||
if (a < rdp.cimg || a > rdp.ci_end)
|
||||
return;
|
||||
cpu_fb_write = TRUE;
|
||||
wxUint32 shift_l = (a-rdp.cimg) >> 1;
|
||||
wxUint32 shift_r = shift_l+2;
|
||||
uint32_t shift_l = (a-rdp.cimg) >> 1;
|
||||
uint32_t shift_r = shift_l+2;
|
||||
|
||||
d_ul_x = min(d_ul_x, shift_l%rdp.ci_width);
|
||||
d_ul_y = min(d_ul_y, shift_l/rdp.ci_width);
|
||||
|
@ -3356,10 +3356,10 @@ Plugin can return up to 6 frame buffer info
|
|||
///*
|
||||
typedef struct
|
||||
{
|
||||
wxUint32 addr;
|
||||
wxUint32 size;
|
||||
wxUint32 width;
|
||||
wxUint32 height;
|
||||
uint32_t addr;
|
||||
uint32_t size;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
} FrameBufferInfo;
|
||||
EXPORT void CALL FBGetFrameBufferInfo(void *p)
|
||||
{
|
||||
|
@ -3411,14 +3411,14 @@ void DetectFrameBufferUsage ()
|
|||
{
|
||||
LRDP("DetectFrameBufferUsage\n");
|
||||
|
||||
wxUint32 dlist_start = *(wxUint32*)(gfx.DMEM+0xFF0);
|
||||
wxUint32 a;
|
||||
uint32_t dlist_start = *(uint32_t*)(gfx.DMEM+0xFF0);
|
||||
uint32_t a;
|
||||
|
||||
int tidal = FALSE;
|
||||
if ((settings.hacks&hack_PMario) && (rdp.copy_ci_index || rdp.frame_buffers[rdp.copy_ci_index].status == ci_copy_self))
|
||||
tidal = TRUE;
|
||||
wxUint32 ci = rdp.cimg, zi = rdp.zimg;
|
||||
wxUint32 ci_height = rdp.frame_buffers[(rdp.ci_count > 0)?rdp.ci_count-1:0].height;
|
||||
uint32_t ci = rdp.cimg, zi = rdp.zimg;
|
||||
uint32_t ci_height = rdp.frame_buffers[(rdp.ci_count > 0)?rdp.ci_count-1:0].height;
|
||||
rdp.main_ci = rdp.main_ci_end = rdp.main_ci_bg = rdp.ci_count = 0;
|
||||
rdp.main_ci_index = rdp.copy_ci_index = rdp.copy_zi_index = 0;
|
||||
rdp.zimg_end = 0;
|
||||
|
@ -3446,8 +3446,8 @@ void DetectFrameBufferUsage ()
|
|||
a = rdp.pc[rdp.pc_i] & BMASK;
|
||||
|
||||
// Load the next command and its input
|
||||
rdp.cmd0 = ((wxUint32*)gfx.RDRAM)[a>>2]; // \ Current command, 64 bit
|
||||
rdp.cmd1 = ((wxUint32*)gfx.RDRAM)[(a>>2)+1]; // /
|
||||
rdp.cmd0 = ((uint32_t*)gfx.RDRAM)[a>>2]; // \ Current command, 64 bit
|
||||
rdp.cmd1 = ((uint32_t*)gfx.RDRAM)[(a>>2)+1]; // /
|
||||
|
||||
// Output the address before the command
|
||||
|
||||
|
@ -3553,7 +3553,7 @@ void DetectFrameBufferUsage ()
|
|||
if (rdp.read_previous_ci && !previous_ci_was_read && (settings.swapmode != 2) && (settings.ucode != ucode_PerfectDark))
|
||||
{
|
||||
int ind = (rdp.ci_count > 0)?rdp.ci_count-1:0;
|
||||
wxUint32 height = rdp.frame_buffers[ind].height;
|
||||
uint32_t height = rdp.frame_buffers[ind].height;
|
||||
rdp.frame_buffers[ind].height = ci_height;
|
||||
CopyFrameBuffer();
|
||||
rdp.frame_buffers[ind].height = height;
|
||||
|
@ -3580,7 +3580,7 @@ void DetectFrameBufferUsage ()
|
|||
rdp.cimg = rdp.maincimg[0].addr;
|
||||
rdp.ci_width = rdp.maincimg[0].width;
|
||||
rdp.ci_count = 0;
|
||||
wxUint32 h = rdp.frame_buffers[0].height;
|
||||
uint32_t h = rdp.frame_buffers[0].height;
|
||||
rdp.frame_buffers[0].height = rdp.maincimg[0].height;
|
||||
CopyFrameBuffer();
|
||||
rdp.frame_buffers[0].height = h;
|
||||
|
@ -3625,12 +3625,12 @@ void DetectFrameBufferUsage ()
|
|||
* based on sources of ziggy's z64 *
|
||||
*******************************************/
|
||||
|
||||
static wxUint32 rdp_cmd_ptr = 0;
|
||||
static wxUint32 rdp_cmd_cur = 0;
|
||||
static wxUint32 rdp_cmd_data[0x1000];
|
||||
static uint32_t rdp_cmd_ptr = 0;
|
||||
static uint32_t rdp_cmd_cur = 0;
|
||||
static uint32_t rdp_cmd_data[0x1000];
|
||||
|
||||
void lle_triangle(wxUint32 w1, wxUint32 w2, int shade, int texture, int zbuffer,
|
||||
wxUint32 * rdp_cmd)
|
||||
void lle_triangle(uint32_t w1, uint32_t w2, int shade, int texture, int zbuffer,
|
||||
uint32_t * rdp_cmd)
|
||||
{
|
||||
rdp.cur_tile = (w1 >> 16) & 0x7;
|
||||
int j;
|
||||
|
@ -3643,11 +3643,11 @@ void lle_triangle(wxUint32 w1, wxUint32 w2, int shade, int texture, int zbuffer,
|
|||
wxInt32 yl, ym, yh;
|
||||
wxInt32 xl, xm, xh;
|
||||
wxInt32 dxldy, dxhdy, dxmdy;
|
||||
wxUint32 w3, w4, w5, w6, w7, w8;
|
||||
uint32_t w3, w4, w5, w6, w7, w8;
|
||||
|
||||
wxUint32 * shade_base = rdp_cmd + 8;
|
||||
wxUint32 * texture_base = rdp_cmd + 8;
|
||||
wxUint32 * zbuffer_base = rdp_cmd + 8;
|
||||
uint32_t * shade_base = rdp_cmd + 8;
|
||||
uint32_t * texture_base = rdp_cmd + 8;
|
||||
uint32_t * zbuffer_base = rdp_cmd + 8;
|
||||
|
||||
if (shade)
|
||||
{
|
||||
|
@ -3727,8 +3727,8 @@ void lle_triangle(wxUint32 w1, wxUint32 w2, int shade, int texture, int zbuffer,
|
|||
|
||||
#define XSCALE(x) (float(x)/(1<<18))
|
||||
#define YSCALE(y) (float(y)/(1<<2))
|
||||
#define ZSCALE(z) ((rdp.zsrc == 1)? float(rdp.prim_depth) : float(wxUint32(z))/0xffff0000)
|
||||
//#define WSCALE(w) (rdp.Persp_en? (float(wxUint32(w) + 0x10000)/0xffff0000) : 1.0f)
|
||||
#define ZSCALE(z) ((rdp.zsrc == 1)? float(rdp.prim_depth) : float(uint32_t(z))/0xffff0000)
|
||||
//#define WSCALE(w) (rdp.Persp_en? (float(uint32_t(w) + 0x10000)/0xffff0000) : 1.0f)
|
||||
//#define WSCALE(w) (rdp.Persp_en? 4294901760.0/(w + 65536) : 1.0f)
|
||||
#define WSCALE(w) (rdp.Persp_en? 65536.0f/float((w+ 0xffff)>>16) : 1.0f)
|
||||
#define CSCALE(c) (((c)>0x3ff0000? 0x3ff0000:((c)<0? 0 : (c)))>>18)
|
||||
|
@ -4081,7 +4081,7 @@ static rdp_instr rdp_command_table[64] =
|
|||
rdp_setcombine, rdp_settextureimage, rdp_setdepthimage, rdp_setcolorimage
|
||||
};
|
||||
|
||||
static const wxUint32 rdp_command_length[64] =
|
||||
static const uint32_t rdp_command_length[64] =
|
||||
{
|
||||
8, // 0x00, No Op
|
||||
8, // 0x01, ???
|
||||
|
@ -4149,15 +4149,15 @@ static const wxUint32 rdp_command_length[64] =
|
|||
8 // 0x3f, Set_Color_Image
|
||||
};
|
||||
|
||||
#define rdram ((wxUint32*)gfx.RDRAM)
|
||||
#define rsp_dmem ((wxUint32*)gfx.DMEM)
|
||||
#define rdram ((uint32_t*)gfx.RDRAM)
|
||||
#define rsp_dmem ((uint32_t*)gfx.DMEM)
|
||||
|
||||
#define dp_start (*(wxUint32*)gfx.DPC_START_REG)
|
||||
#define dp_end (*(wxUint32*)gfx.DPC_END_REG)
|
||||
#define dp_current (*(wxUint32*)gfx.DPC_CURRENT_REG)
|
||||
#define dp_status (*(wxUint32*)gfx.DPC_STATUS_REG)
|
||||
#define dp_start (*(uint32_t*)gfx.DPC_START_REG)
|
||||
#define dp_end (*(uint32_t*)gfx.DPC_END_REG)
|
||||
#define dp_current (*(uint32_t*)gfx.DPC_CURRENT_REG)
|
||||
#define dp_status (*(uint32_t*)gfx.DPC_STATUS_REG)
|
||||
|
||||
inline wxUint32 READ_RDP_DATA(wxUint32 address)
|
||||
inline uint32_t READ_RDP_DATA(uint32_t address)
|
||||
{
|
||||
if (dp_status & 0x1) // XBUS_DMEM_DMA enabled
|
||||
return rsp_dmem[(address & 0xfff)>>2];
|
||||
|
@ -4167,13 +4167,13 @@ inline wxUint32 READ_RDP_DATA(wxUint32 address)
|
|||
|
||||
static void rdphalf_1()
|
||||
{
|
||||
wxUint32 cmd = rdp.cmd1 >> 24;
|
||||
uint32_t cmd = rdp.cmd1 >> 24;
|
||||
if (cmd >= 0xc8 && cmd <=0xcf) //triangle command
|
||||
{
|
||||
LRDP("rdphalf_1 - lle triangle\n");
|
||||
rdp_cmd_ptr = 0;
|
||||
rdp_cmd_cur = 0;
|
||||
wxUint32 a;
|
||||
uint32_t a;
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -4195,8 +4195,8 @@ static void rdphalf_1()
|
|||
a = rdp.pc[rdp.pc_i] & BMASK;
|
||||
|
||||
// Load the next command and its input
|
||||
rdp.cmd0 = ((wxUint32*)gfx.RDRAM)[a>>2]; // \ Current command, 64 bit
|
||||
rdp.cmd1 = ((wxUint32*)gfx.RDRAM)[(a>>2)+1]; // /
|
||||
rdp.cmd0 = ((uint32_t*)gfx.RDRAM)[a>>2]; // \ Current command, 64 bit
|
||||
rdp.cmd1 = ((uint32_t*)gfx.RDRAM)[(a>>2)+1]; // /
|
||||
|
||||
// Go to the next instruction
|
||||
rdp.pc[rdp.pc_i] = (a+8) & BMASK;
|
||||
|
@ -4207,7 +4207,7 @@ static void rdphalf_1()
|
|||
rdp.cmd0 = rdp_cmd_data[rdp_cmd_cur+0];
|
||||
rdp.cmd1 = rdp_cmd_data[rdp_cmd_cur+1];
|
||||
/*
|
||||
wxUint32 cmd3 = ((wxUint32*)gfx.RDRAM)[(a>>2)+2];
|
||||
uint32_t cmd3 = ((uint32_t*)gfx.RDRAM)[(a>>2)+2];
|
||||
if ((cmd3>>24) == 0xb4)
|
||||
rglSingleTriangle = TRUE;
|
||||
else
|
||||
|
@ -4256,8 +4256,8 @@ void CALL ProcessRDPList(void)
|
|||
return;
|
||||
}
|
||||
|
||||
wxUint32 i;
|
||||
wxUint32 cmd, length, cmd_length;
|
||||
uint32_t i;
|
||||
uint32_t cmd, length, cmd_length;
|
||||
rdp_cmd_ptr = 0;
|
||||
rdp_cmd_cur = 0;
|
||||
|
||||
|
|
|
@ -46,10 +46,10 @@
|
|||
struct t3dGlobState {
|
||||
wxUint16 pad0;
|
||||
wxUint16 perspNorm;
|
||||
wxUint32 flag;
|
||||
wxUint32 othermode0;
|
||||
wxUint32 othermode1;
|
||||
wxUint32 segBases[16];
|
||||
uint32_t flag;
|
||||
uint32_t othermode0;
|
||||
uint32_t othermode1;
|
||||
uint32_t segBases[16];
|
||||
/* the viewport to use */
|
||||
short vsacle1;
|
||||
short vsacle0;
|
||||
|
@ -59,19 +59,19 @@ struct t3dGlobState {
|
|||
short vtrans0;
|
||||
short vtrans3;
|
||||
short vtrans2;
|
||||
wxUint32 rdpCmds;
|
||||
uint32_t rdpCmds;
|
||||
};
|
||||
|
||||
struct t3dState {
|
||||
wxUint32 renderState; /* render state */
|
||||
wxUint32 textureState; /* texture state */
|
||||
uint32_t renderState; /* render state */
|
||||
uint32_t textureState; /* texture state */
|
||||
wxUint8 flag;
|
||||
wxUint8 triCount; /* how many tris? */
|
||||
wxUint8 vtxV0; /* where to load verts? */
|
||||
wxUint8 vtxCount; /* how many verts? */
|
||||
wxUint32 rdpCmds; /* ptr (segment address) to RDP DL */
|
||||
wxUint32 othermode0;
|
||||
wxUint32 othermode1;
|
||||
uint32_t rdpCmds; /* ptr (segment address) to RDP DL */
|
||||
uint32_t othermode0;
|
||||
uint32_t othermode1;
|
||||
};
|
||||
|
||||
|
||||
|
@ -80,29 +80,29 @@ struct t3dTriN{
|
|||
};
|
||||
|
||||
|
||||
static void t3dProcessRDP(wxUint32 a)
|
||||
static void t3dProcessRDP(uint32_t a)
|
||||
{
|
||||
if (a)
|
||||
{
|
||||
rdp.LLE = 1;
|
||||
rdp.cmd0 = ((wxUint32*)gfx.RDRAM)[a++];
|
||||
rdp.cmd1 = ((wxUint32*)gfx.RDRAM)[a++];
|
||||
rdp.cmd0 = ((uint32_t*)gfx.RDRAM)[a++];
|
||||
rdp.cmd1 = ((uint32_t*)gfx.RDRAM)[a++];
|
||||
while (rdp.cmd0 + rdp.cmd1) {
|
||||
gfx_instruction[0][rdp.cmd0>>24] ();
|
||||
rdp.cmd0 = ((wxUint32*)gfx.RDRAM)[a++];
|
||||
rdp.cmd1 = ((wxUint32*)gfx.RDRAM)[a++];
|
||||
wxUint32 cmd = rdp.cmd0>>24;
|
||||
rdp.cmd0 = ((uint32_t*)gfx.RDRAM)[a++];
|
||||
rdp.cmd1 = ((uint32_t*)gfx.RDRAM)[a++];
|
||||
uint32_t cmd = rdp.cmd0>>24;
|
||||
if (cmd == 0xE4 || cmd == 0xE5)
|
||||
{
|
||||
rdp.cmd2 = ((wxUint32*)gfx.RDRAM)[a++];
|
||||
rdp.cmd3 = ((wxUint32*)gfx.RDRAM)[a++];
|
||||
rdp.cmd2 = ((uint32_t*)gfx.RDRAM)[a++];
|
||||
rdp.cmd3 = ((uint32_t*)gfx.RDRAM)[a++];
|
||||
}
|
||||
}
|
||||
rdp.LLE = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void t3dLoadGlobState(wxUint32 pgstate)
|
||||
static void t3dLoadGlobState(uint32_t pgstate)
|
||||
{
|
||||
t3dGlobState *gstate = (t3dGlobState*)&gfx.RDRAM[segoffset(pgstate)];
|
||||
FRDP ("Global state. pad0: %04lx, perspNorm: %04lx, flag: %08lx\n", gstate->pad0, gstate->perspNorm, gstate->flag);
|
||||
|
@ -135,7 +135,7 @@ static void t3dLoadGlobState(wxUint32 pgstate)
|
|||
t3dProcessRDP(segoffset(gstate->rdpCmds) >> 2);
|
||||
}
|
||||
|
||||
static void t3d_vertex(wxUint32 addr, wxUint32 v0, wxUint32 n)
|
||||
static void t3d_vertex(uint32_t addr, uint32_t v0, uint32_t n)
|
||||
{
|
||||
float x, y, z;
|
||||
|
||||
|
@ -143,7 +143,7 @@ static void t3d_vertex(wxUint32 addr, wxUint32 v0, wxUint32 n)
|
|||
rdp.vn = n; // Number of vertices to copy
|
||||
n <<= 4;
|
||||
|
||||
for (wxUint32 i=0; i < n; i+=16)
|
||||
for (uint32_t i=0; i < n; i+=16)
|
||||
{
|
||||
VERTEX *v = &rdp.vtx[v0 + (i>>4)];
|
||||
x = (float)((short*)gfx.RDRAM)[(((addr+i) >> 1) + 0)^1];
|
||||
|
@ -185,7 +185,7 @@ static void t3d_vertex(wxUint32 addr, wxUint32 v0, wxUint32 n)
|
|||
}
|
||||
}
|
||||
|
||||
static void t3dLoadObject(wxUint32 pstate, wxUint32 pvtx, wxUint32 ptri)
|
||||
static void t3dLoadObject(uint32_t pstate, uint32_t pvtx, uint32_t ptri)
|
||||
{
|
||||
LRDP("Loading Turbo3D object\n");
|
||||
t3dState *ostate = (t3dState*)&gfx.RDRAM[segoffset(pstate)];
|
||||
|
@ -210,7 +210,7 @@ static void t3dLoadObject(wxUint32 pstate, wxUint32 pvtx, wxUint32 ptri)
|
|||
|
||||
if (!(ostate->flag&1)) //load matrix
|
||||
{
|
||||
wxUint32 addr = segoffset(pstate+sizeof(t3dState)) & BMASK;
|
||||
uint32_t addr = segoffset(pstate+sizeof(t3dState)) & BMASK;
|
||||
load_matrix(rdp.combined, addr);
|
||||
#ifdef EXTREME_LOGGING
|
||||
FRDP ("{%f,%f,%f,%f}\n", rdp.combined[0][0], rdp.combined[0][1], rdp.combined[0][2], rdp.combined[0][3]);
|
||||
|
@ -230,7 +230,7 @@ static void t3dLoadObject(wxUint32 pstate, wxUint32 pvtx, wxUint32 ptri)
|
|||
if (ptri)
|
||||
{
|
||||
update ();
|
||||
wxUint32 a = segoffset(ptri);
|
||||
uint32_t a = segoffset(ptri);
|
||||
for (int t=0; t < ostate->triCount; t++)
|
||||
{
|
||||
t3dTriN * tri = (t3dTriN*)&gfx.RDRAM[a];
|
||||
|
@ -252,13 +252,13 @@ static void Turbo3D()
|
|||
{
|
||||
LRDP("Start Turbo3D microcode\n");
|
||||
settings.ucode = ucode_Fast3D;
|
||||
wxUint32 a = 0, pgstate = 0, pstate = 0, pvtx = 0, ptri = 0;
|
||||
uint32_t a = 0, pgstate = 0, pstate = 0, pvtx = 0, ptri = 0;
|
||||
do {
|
||||
a = rdp.pc[rdp.pc_i] & BMASK;
|
||||
pgstate = ((wxUint32*)gfx.RDRAM)[a>>2];
|
||||
pstate = ((wxUint32*)gfx.RDRAM)[(a>>2)+1];
|
||||
pvtx = ((wxUint32*)gfx.RDRAM)[(a>>2)+2];
|
||||
ptri = ((wxUint32*)gfx.RDRAM)[(a>>2)+3];
|
||||
pgstate = ((uint32_t*)gfx.RDRAM)[a>>2];
|
||||
pstate = ((uint32_t*)gfx.RDRAM)[(a>>2)+1];
|
||||
pvtx = ((uint32_t*)gfx.RDRAM)[(a>>2)+2];
|
||||
ptri = ((uint32_t*)gfx.RDRAM)[(a>>2)+3];
|
||||
FRDP("GlobalState: %08lx, Object: %08lx, Vertices: %08lx, Triangles: %08lx\n", pgstate, pstate, pvtx, ptri);
|
||||
if (!pstate)
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
|
||||
static void rsp_vertex(int v0, int n)
|
||||
{
|
||||
wxUint32 addr = segoffset(rdp.cmd1) & 0x00FFFFFF;
|
||||
uint32_t addr = segoffset(rdp.cmd1) & 0x00FFFFFF;
|
||||
int i;
|
||||
float x, y, z;
|
||||
|
||||
|
@ -73,7 +73,7 @@ static void rsp_vertex(int v0, int n)
|
|||
rdp.update ^= UPDATE_LIGHTS;
|
||||
|
||||
// Calculate light vectors
|
||||
for (wxUint32 l=0; l<rdp.num_lights; l++)
|
||||
for (uint32_t l=0; l<rdp.num_lights; l++)
|
||||
{
|
||||
InverseTransformVector(&rdp.light[l].dir_x, rdp.light_vector[l], rdp.model);
|
||||
NormalizeVector (rdp.light_vector[l]);
|
||||
|
@ -270,7 +270,7 @@ void projection_mul (float m[4][4])
|
|||
rdp.update |= UPDATE_MULT_MAT;
|
||||
}
|
||||
|
||||
void load_matrix (float m[4][4], wxUint32 addr)
|
||||
void load_matrix (float m[4][4], uint32_t addr)
|
||||
{
|
||||
FRDP ("matrix - addr: %08lx\n", addr);
|
||||
int x,y; // matrix index
|
||||
|
@ -294,7 +294,7 @@ static void uc0_matrix()
|
|||
LRDP("uc0:matrix ");
|
||||
|
||||
// Use segment offset to get the address
|
||||
wxUint32 addr = segoffset(rdp.cmd1) & 0x00FFFFFF;
|
||||
uint32_t addr = segoffset(rdp.cmd1) & 0x00FFFFFF;
|
||||
wxUint8 command = (wxUint8)((rdp.cmd0 >> 16) & 0xFF);
|
||||
|
||||
DECLAREALIGN16VAR(m[4][4]);
|
||||
|
@ -363,7 +363,7 @@ static void uc0_movemem()
|
|||
{
|
||||
LRDP("uc0:movemem ");
|
||||
|
||||
wxUint32 i,a;
|
||||
uint32_t i,a;
|
||||
|
||||
// Check the command
|
||||
switch ((rdp.cmd0 >> 16) & 0xFF)
|
||||
|
@ -462,7 +462,7 @@ static void uc0_movemem()
|
|||
// do not update the combined matrix!
|
||||
rdp.update &= ~UPDATE_MULT_MAT;
|
||||
|
||||
wxUint32 addr = segoffset(rdp.cmd1) & 0x00FFFFFF;
|
||||
uint32_t addr = segoffset(rdp.cmd1) & 0x00FFFFFF;
|
||||
load_matrix(rdp.combined, addr);
|
||||
|
||||
addr = rdp.pc[rdp.pc_i] & BMASK;
|
||||
|
@ -504,12 +504,12 @@ static void uc0_movemem()
|
|||
//
|
||||
static void uc0_displaylist()
|
||||
{
|
||||
wxUint32 addr = segoffset(rdp.cmd1) & 0x00FFFFFF;
|
||||
uint32_t addr = segoffset(rdp.cmd1) & 0x00FFFFFF;
|
||||
|
||||
// This fixes partially Gauntlet: Legends
|
||||
if (addr == rdp.pc[rdp.pc_i] - 8) { LRDP("display list not executed!\n"); return; }
|
||||
|
||||
wxUint32 push = (rdp.cmd0 >> 16) & 0xFF; // push the old location?
|
||||
uint32_t push = (rdp.cmd0 >> 16) & 0xFF; // push the old location?
|
||||
|
||||
FRDP("uc0:displaylist: %08lx, push:%s", addr, push?"no":"yes");
|
||||
FRDP(" (seg %d, offset %08lx)\n", (rdp.cmd1>>24)&0x0F, rdp.cmd1&0x00FFFFFF);
|
||||
|
@ -588,7 +588,7 @@ static void uc0_culldl()
|
|||
{
|
||||
wxUint8 vStart = (wxUint8)((rdp.cmd0 & 0x00FFFFFF) / 40) & 0xF;
|
||||
wxUint8 vEnd = (wxUint8)(rdp.cmd1 / 40) & 0x0F;
|
||||
wxUint32 cond = 0;
|
||||
uint32_t cond = 0;
|
||||
VERTEX *v;
|
||||
|
||||
FRDP("uc0:culldl start: %d, end: %d\n", vStart, vEnd);
|
||||
|
@ -621,7 +621,7 @@ static void uc0_popmatrix()
|
|||
{
|
||||
LRDP("uc0:popmatrix\n");
|
||||
|
||||
wxUint32 param = rdp.cmd1;
|
||||
uint32_t param = rdp.cmd1;
|
||||
|
||||
switch (param)
|
||||
{
|
||||
|
@ -640,7 +640,7 @@ static void uc0_popmatrix()
|
|||
|
||||
static void uc6_obj_sprite ();
|
||||
|
||||
static void uc0_modifyvtx(wxUint8 where, wxUint16 vtx, wxUint32 val)
|
||||
static void uc0_modifyvtx(wxUint8 where, wxUint16 vtx, uint32_t val)
|
||||
{
|
||||
VERTEX *v = &rdp.vtx[vtx];
|
||||
|
||||
|
@ -796,7 +796,7 @@ static void uc0_texture()
|
|||
int tile = (rdp.cmd0 >> 8) & 0x07;
|
||||
if (tile == 7 && (settings.hacks&hack_Supercross)) tile = 0; //fix for supercross 2000
|
||||
rdp.mipmap_level = (rdp.cmd0 >> 11) & 0x07;
|
||||
wxUint32 on = (rdp.cmd0 & 0xFF);
|
||||
uint32_t on = (rdp.cmd0 & 0xFF);
|
||||
rdp.cur_tile = tile;
|
||||
|
||||
if (on)
|
||||
|
@ -842,7 +842,7 @@ static void uc0_setothermode_h()
|
|||
len = rdp.cmd0 & 0xFF;
|
||||
}
|
||||
|
||||
wxUint32 mask = 0;
|
||||
uint32_t mask = 0;
|
||||
int i = len;
|
||||
for (; i; i--)
|
||||
mask = (mask << 1) | 1;
|
||||
|
@ -860,7 +860,7 @@ static void uc0_setothermode_h()
|
|||
|
||||
if (mask & 0x000000C0) // rgb dither mode
|
||||
{
|
||||
wxUint32 dither_mode = (rdp.othermode_h >> 6) & 0x3;
|
||||
uint32_t dither_mode = (rdp.othermode_h >> 6) & 0x3;
|
||||
FRDP ("rgb dither mode: %s\n", str_dither[dither_mode]);
|
||||
}
|
||||
|
||||
|
@ -897,7 +897,7 @@ static void uc0_setothermode_h()
|
|||
FRDP ("Persp_en: %d\n", rdp.Persp_en);
|
||||
}
|
||||
|
||||
wxUint32 unk = mask & 0x0FFC60F0F;
|
||||
uint32_t unk = mask & 0x0FFC60F0F;
|
||||
if (unk) // unknown portions, LARGE
|
||||
{
|
||||
FRDP ("UNKNOWN PORTIONS: shift: %d, len: %d, unknowns: %08lx\n", shift, len, unk);
|
||||
|
@ -921,7 +921,7 @@ static void uc0_setothermode_l()
|
|||
shift = (rdp.cmd0 >> 8) & 0xFF;
|
||||
}
|
||||
|
||||
wxUint32 mask = 0;
|
||||
uint32_t mask = 0;
|
||||
int i = len;
|
||||
for (; i; i--)
|
||||
mask = (mask << 1) | 1;
|
||||
|
@ -1044,8 +1044,8 @@ static void uc0_cleargeometrymode()
|
|||
|
||||
static void uc0_line3d()
|
||||
{
|
||||
wxUint32 v0 = ((rdp.cmd1 >> 16) & 0xff) / 10;
|
||||
wxUint32 v1 = ((rdp.cmd1 >> 8) & 0xff) / 10;
|
||||
uint32_t v0 = ((rdp.cmd1 >> 16) & 0xff) / 10;
|
||||
uint32_t v1 = ((rdp.cmd1 >> 8) & 0xff) / 10;
|
||||
wxUint16 width = (wxUint16)(rdp.cmd1 & 0xFF) + 3;
|
||||
|
||||
VERTEX *v[3] = {
|
||||
|
@ -1053,7 +1053,7 @@ static void uc0_line3d()
|
|||
&rdp.vtx[v0],
|
||||
&rdp.vtx[v0]
|
||||
};
|
||||
wxUint32 cull_mode = (rdp.flags & CULLMASK) >> CULLSHIFT;
|
||||
uint32_t cull_mode = (rdp.flags & CULLMASK) >> CULLSHIFT;
|
||||
rdp.flags |= CULLMASK;
|
||||
rdp.update |= UPDATE_CULL_MODE;
|
||||
rsp_tri1(v, width);
|
||||
|
|
|
@ -117,7 +117,7 @@ static void uc1_line3d()
|
|||
&rdp.vtx[(rdp.cmd1 >> 9) & 0x7F],
|
||||
&rdp.vtx[(rdp.cmd1 >> 9) & 0x7F]
|
||||
};
|
||||
wxUint32 cull_mode = (rdp.flags & CULLMASK) >> CULLSHIFT;
|
||||
uint32_t cull_mode = (rdp.flags & CULLMASK) >> CULLSHIFT;
|
||||
rdp.flags |= CULLMASK;
|
||||
rdp.update |= UPDATE_CULL_MODE;
|
||||
rsp_tri1(v, width);
|
||||
|
@ -142,7 +142,7 @@ static void uc1_line3d()
|
|||
}
|
||||
}
|
||||
|
||||
wxUint32 branch_dl = 0;
|
||||
uint32_t branch_dl = 0;
|
||||
|
||||
static void uc1_rdphalf_1()
|
||||
{
|
||||
|
@ -153,9 +153,9 @@ static void uc1_rdphalf_1()
|
|||
|
||||
static void uc1_branch_z()
|
||||
{
|
||||
wxUint32 addr = segoffset(branch_dl);
|
||||
uint32_t addr = segoffset(branch_dl);
|
||||
FRDP ("uc1:branch_less_z, addr: %08lx\n", addr);
|
||||
wxUint32 vtx = (rdp.cmd0 & 0xFFF) >> 1;
|
||||
uint32_t vtx = (rdp.cmd0 & 0xFFF) >> 1;
|
||||
if( fabs(rdp.vtx[vtx].z) <= (rdp.cmd1/*&0xFFFF*/) )
|
||||
{
|
||||
rdp.pc[rdp.pc_i] = addr;
|
||||
|
|
|
@ -41,7 +41,7 @@ static void calc_point_light (VERTEX *v, float * vpos)
|
|||
{
|
||||
float light_intensity = 0.0f;
|
||||
register float color[3] = {rdp.light[rdp.num_lights].r, rdp.light[rdp.num_lights].g, rdp.light[rdp.num_lights].b};
|
||||
for (wxUint32 l=0; l<rdp.num_lights; l++)
|
||||
for (uint32_t l=0; l<rdp.num_lights; l++)
|
||||
{
|
||||
if (rdp.light[l].nonblack)
|
||||
{
|
||||
|
@ -102,14 +102,14 @@ static void uc2_vertex ()
|
|||
rdp.update ^= UPDATE_LIGHTS;
|
||||
|
||||
// Calculate light vectors
|
||||
for (wxUint32 l=0; l<rdp.num_lights; l++)
|
||||
for (uint32_t l=0; l<rdp.num_lights; l++)
|
||||
{
|
||||
InverseTransformVector(&rdp.light[l].dir_x, rdp.light_vector[l], rdp.model);
|
||||
NormalizeVector (rdp.light_vector[l]);
|
||||
}
|
||||
}
|
||||
|
||||
wxUint32 addr = segoffset(rdp.cmd1);
|
||||
uint32_t addr = segoffset(rdp.cmd1);
|
||||
int v0, i, n;
|
||||
float x, y, z;
|
||||
|
||||
|
@ -125,7 +125,7 @@ static void uc2_vertex ()
|
|||
return;
|
||||
}
|
||||
|
||||
wxUint32 geom_mode = rdp.geom_mode;
|
||||
uint32_t geom_mode = rdp.geom_mode;
|
||||
if ((settings.hacks&hack_Fzero) && (rdp.geom_mode & 0x40000))
|
||||
{
|
||||
if (((short*)gfx.RDRAM)[(((addr) >> 1) + 4)^1] || ((short*)gfx.RDRAM)[(((addr) >> 1) + 5)^1])
|
||||
|
@ -230,7 +230,7 @@ static void uc2_culldl ()
|
|||
{
|
||||
wxUint16 vStart = (wxUint16)(rdp.cmd0 & 0xFFFF) >> 1;
|
||||
wxUint16 vEnd = (wxUint16)(rdp.cmd1 & 0xFFFF) >> 1;
|
||||
wxUint32 cond = 0;
|
||||
uint32_t cond = 0;
|
||||
FRDP ("uc2:culldl start: %d, end: %d\n", vStart, vEnd);
|
||||
|
||||
if (vEnd < vStart) return;
|
||||
|
@ -303,7 +303,7 @@ static void uc2_quad ()
|
|||
{
|
||||
if ((rdp.cmd0 & 0x00FFFFFF) == 0x2F)
|
||||
{
|
||||
wxUint32 command = rdp.cmd0>>24;
|
||||
uint32_t command = rdp.cmd0>>24;
|
||||
if (command == 0x6)
|
||||
{
|
||||
uc6_obj_ldtx_sprite ();
|
||||
|
@ -362,7 +362,7 @@ static void uc2_line3d ()
|
|||
&rdp.vtx[(rdp.cmd0 >> 9) & 0x7F]
|
||||
};
|
||||
wxUint16 width = (wxUint16)(rdp.cmd0 + 3)&0xFF;
|
||||
wxUint32 cull_mode = (rdp.flags & CULLMASK) >> CULLSHIFT;
|
||||
uint32_t cull_mode = (rdp.flags & CULLMASK) >> CULLSHIFT;
|
||||
rdp.flags |= CULLMASK;
|
||||
rdp.update |= UPDATE_CULL_MODE;
|
||||
rsp_tri1(v, width);
|
||||
|
@ -398,10 +398,10 @@ static void uc2_pop_matrix ()
|
|||
static void uc2_geom_mode ()
|
||||
{
|
||||
// Switch around some things
|
||||
wxUint32 clr_mode = (rdp.cmd0 & 0x00DFC9FF) |
|
||||
uint32_t clr_mode = (rdp.cmd0 & 0x00DFC9FF) |
|
||||
((rdp.cmd0 & 0x00000600) << 3) |
|
||||
((rdp.cmd0 & 0x00200000) >> 12) | 0xFF000000;
|
||||
wxUint32 set_mode = (rdp.cmd1 & 0xFFDFC9FF) |
|
||||
uint32_t set_mode = (rdp.cmd1 & 0xFFDFC9FF) |
|
||||
((rdp.cmd1 & 0x00000600) << 3) |
|
||||
((rdp.cmd1 & 0x00200000) >> 12);
|
||||
|
||||
|
@ -555,7 +555,7 @@ static void uc2_moveword ()
|
|||
{
|
||||
wxUint8 index = (wxUint8)((rdp.cmd0 >> 16) & 0xFF);
|
||||
wxUint16 offset = (wxUint16)(rdp.cmd0 & 0xFFFF);
|
||||
wxUint32 data = rdp.cmd1;
|
||||
uint32_t data = rdp.cmd1;
|
||||
|
||||
FRDP ("uc2:moveword ");
|
||||
|
||||
|
@ -670,7 +670,7 @@ static void uc6_obj_movemem ();
|
|||
static void uc2_movemem ()
|
||||
{
|
||||
int idx = rdp.cmd0 & 0xFF;
|
||||
wxUint32 addr = segoffset(rdp.cmd1);
|
||||
uint32_t addr = segoffset(rdp.cmd1);
|
||||
int ofs = (rdp.cmd0 >> 5) & 0x7F8;
|
||||
|
||||
FRDP ("uc2:movemem ofs:%d ", ofs);
|
||||
|
@ -684,7 +684,7 @@ static void uc2_movemem ()
|
|||
|
||||
case 8: // VIEWPORT
|
||||
{
|
||||
wxUint32 a = addr >> 1;
|
||||
uint32_t a = addr >> 1;
|
||||
short scale_x = ((short*)gfx.RDRAM)[(a+0)^1] >> 2;
|
||||
short scale_y = ((short*)gfx.RDRAM)[(a+1)^1] >> 2;
|
||||
short scale_z = ((short*)gfx.RDRAM)[(a+2)^1];
|
||||
|
@ -745,7 +745,7 @@ static void uc2_movemem ()
|
|||
rdp.light[n].dir_x = (float)(((char*)gfx.RDRAM)[(addr+8)^3]) / 127.0f;
|
||||
rdp.light[n].dir_y = (float)(((char*)gfx.RDRAM)[(addr+9)^3]) / 127.0f;
|
||||
rdp.light[n].dir_z = (float)(((char*)gfx.RDRAM)[(addr+10)^3]) / 127.0f;
|
||||
wxUint32 a = addr >> 1;
|
||||
uint32_t a = addr >> 1;
|
||||
rdp.light[n].x = (float)(((short*)gfx.RDRAM)[(a+4)^1]);
|
||||
rdp.light[n].y = (float)(((short*)gfx.RDRAM)[(a+5)^1]);
|
||||
rdp.light[n].z = (float)(((short*)gfx.RDRAM)[(a+6)^1]);
|
||||
|
@ -795,7 +795,7 @@ static void uc2_rdphalf_2 ()
|
|||
|
||||
static void uc2_dlist_cnt ()
|
||||
{
|
||||
wxUint32 addr = segoffset(rdp.cmd1) & BMASK;
|
||||
uint32_t addr = segoffset(rdp.cmd1) & BMASK;
|
||||
int count = rdp.cmd0 & 0x000000FF;
|
||||
FRDP ("dl_count - addr: %08lx, count: %d\n", addr, count);
|
||||
if (addr == 0)
|
||||
|
|
|
@ -40,8 +40,8 @@
|
|||
int cur_mtx = 0;
|
||||
int billboarding = 0;
|
||||
int vtx_last = 0;
|
||||
wxUint32 dma_offset_mtx = 0;
|
||||
wxUint32 dma_offset_vtx = 0;
|
||||
uint32_t dma_offset_mtx = 0;
|
||||
uint32_t dma_offset_vtx = 0;
|
||||
|
||||
static void uc5_dma_offsets ()
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ static void uc5_dma_offsets ()
|
|||
static void uc5_matrix ()
|
||||
{
|
||||
// Use segment offset to get the address
|
||||
wxUint32 addr = dma_offset_mtx + (segoffset(rdp.cmd1) & BMASK);
|
||||
uint32_t addr = dma_offset_mtx + (segoffset(rdp.cmd1) & BMASK);
|
||||
|
||||
wxUint8 n = (wxUint8)((rdp.cmd0 >> 16) & 0xF);
|
||||
wxUint8 multiply;
|
||||
|
@ -106,7 +106,7 @@ static void uc5_matrix ()
|
|||
|
||||
static void uc5_vertex ()
|
||||
{
|
||||
wxUint32 addr = dma_offset_vtx + (segoffset(rdp.cmd1) & BMASK);
|
||||
uint32_t addr = dma_offset_vtx + (segoffset(rdp.cmd1) & BMASK);
|
||||
|
||||
// | cccc cccc 1111 1??? 0000 0002 2222 2222 | cmd1 = address |
|
||||
// c = vtx command
|
||||
|
@ -199,7 +199,7 @@ static void uc5_tridma ()
|
|||
// 2 = method #2 of getting count
|
||||
// 0 = unused
|
||||
|
||||
wxUint32 addr = segoffset(rdp.cmd1) & BMASK;
|
||||
uint32_t addr = segoffset(rdp.cmd1) & BMASK;
|
||||
int num = (rdp.cmd0 & 0xFFF0) >> 4;
|
||||
//int num = ((rdp.cmd0 & 0x00F00000) >> 20) + 1; // same thing!
|
||||
FRDP("uc5:tridma #%d - addr: %08lx, count: %d\n", rdp.tri_n, addr, num);
|
||||
|
@ -264,7 +264,7 @@ static void uc5_tridma ()
|
|||
|
||||
static void uc5_dl_in_mem ()
|
||||
{
|
||||
wxUint32 addr = segoffset(rdp.cmd1) & BMASK;
|
||||
uint32_t addr = segoffset(rdp.cmd1) & BMASK;
|
||||
int count = (rdp.cmd0 & 0x00FF0000) >> 16;
|
||||
FRDP ("uc5:dl_in_mem - addr: %08lx, count: %d\n", addr, count);
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ typedef struct DRAWIMAGE_t {
|
|||
wxUint16 imageY;
|
||||
wxUint16 imageW;
|
||||
wxUint16 imageH;
|
||||
wxUint32 imagePtr;
|
||||
uint32_t imagePtr;
|
||||
wxUint8 imageFmt;
|
||||
wxUint8 imageSiz;
|
||||
wxUint16 imagePal;
|
||||
|
@ -451,7 +451,7 @@ void DrawImage (DRAWIMAGE & d)
|
|||
else if (d.scaleX == 1.0f && d.scaleY == 1.0f)
|
||||
grClipWindow (rdp.scissor.ul_x, rdp.scissor.ul_y, rdp.scissor.lr_x, rdp.scissor.lr_y);
|
||||
else
|
||||
grClipWindow (rdp.scissor.ul_x, rdp.scissor.ul_y, min(rdp.scissor.lr_x, (wxUint32)((d.frameX+d.imageW/d.scaleX+0.5f)*rdp.scale_x)), min(rdp.scissor.lr_y, (wxUint32)((d.frameY+d.imageH/d.scaleY+0.5f)*rdp.scale_y)));
|
||||
grClipWindow (rdp.scissor.ul_x, rdp.scissor.ul_y, min(rdp.scissor.lr_x, (uint32_t)((d.frameX+d.imageW/d.scaleX+0.5f)*rdp.scale_x)), min(rdp.scissor.lr_y, (uint32_t)((d.frameY+d.imageH/d.scaleY+0.5f)*rdp.scale_y)));
|
||||
rdp.update |= UPDATE_SCISSOR;
|
||||
}
|
||||
|
||||
|
@ -716,7 +716,7 @@ struct MAT2D {
|
|||
|
||||
static void uc6_read_background_data (DRAWIMAGE & d, bool bReadScale)
|
||||
{
|
||||
wxUint32 addr = segoffset(rdp.cmd1) >> 1;
|
||||
uint32_t addr = segoffset(rdp.cmd1) >> 1;
|
||||
|
||||
d.imageX = (((wxUint16 *)gfx.RDRAM)[(addr+0)^1] >> 5); // 0
|
||||
d.imageW = (((wxUint16 *)gfx.RDRAM)[(addr+1)^1] >> 2); // 1
|
||||
|
@ -728,7 +728,7 @@ static void uc6_read_background_data (DRAWIMAGE & d, bool bReadScale)
|
|||
d.frameY = ((short*)gfx.RDRAM)[(addr+6)^1] / 4.0f; // 6
|
||||
d.frameH = ((wxUint16 *)gfx.RDRAM)[(addr+7)^1] >> 2; // 7
|
||||
|
||||
d.imagePtr = segoffset(((wxUint32*)gfx.RDRAM)[(addr+8)>>1]); // 8,9
|
||||
d.imagePtr = segoffset(((uint32_t*)gfx.RDRAM)[(addr+8)>>1]); // 8,9
|
||||
d.imageFmt = ((wxUint8 *)gfx.RDRAM)[(((addr+11)<<1)+0)^3]; // 11
|
||||
d.imageSiz = ((wxUint8 *)gfx.RDRAM)[(((addr+11)<<1)+1)^3]; // |
|
||||
d.imagePal = ((wxUint16 *)gfx.RDRAM)[(addr+12)^1]; // 12
|
||||
|
@ -997,7 +997,7 @@ static void uc6_draw_polygons (VERTEX v[4])
|
|||
|
||||
static void uc6_read_object_data (DRAWOBJECT & d)
|
||||
{
|
||||
wxUint32 addr = segoffset(rdp.cmd1) >> 1;
|
||||
uint32_t addr = segoffset(rdp.cmd1) >> 1;
|
||||
|
||||
d.objX = ((short*)gfx.RDRAM)[(addr+0)^1] / 4.0f; // 0
|
||||
d.scaleW = ((wxUint16 *)gfx.RDRAM)[(addr+1)^1] / 1024.0f; // 1
|
||||
|
@ -1185,7 +1185,7 @@ static void uc6_obj_movemem ()
|
|||
LRDP("uc6:obj_movemem\n");
|
||||
|
||||
int index = rdp.cmd0 & 0xFFFF;
|
||||
wxUint32 addr = segoffset(rdp.cmd1) >> 1;
|
||||
uint32_t addr = segoffset(rdp.cmd1) >> 1;
|
||||
|
||||
if (index == 0) { // movemem matrix
|
||||
mat_2d.A = ((int*)gfx.RDRAM)[(addr+0)>>1] / 65536.0f;
|
||||
|
@ -1248,18 +1248,18 @@ static wxUint16 uc6_yuv_to_rgba(wxUint8 y, wxUint8 u, wxUint8 v)
|
|||
static void uc6_DrawYUVImageToFrameBuffer(wxUint16 ul_x, wxUint16 ul_y, wxUint16 lr_x, wxUint16 lr_y)
|
||||
{
|
||||
FRDP ("uc6:DrawYUVImageToFrameBuffer ul_x%d, ul_y%d, lr_x%d, lr_y%d\n", ul_x, ul_y, lr_x, lr_y);
|
||||
wxUint32 ci_width = rdp.ci_width;
|
||||
wxUint32 ci_height = rdp.ci_lower_bound;
|
||||
uint32_t ci_width = rdp.ci_width;
|
||||
uint32_t ci_height = rdp.ci_lower_bound;
|
||||
if (ul_x >= ci_width)
|
||||
return;
|
||||
if (ul_y >= ci_height)
|
||||
return;
|
||||
wxUint32 width = 16, height = 16;
|
||||
uint32_t width = 16, height = 16;
|
||||
if (lr_x > ci_width)
|
||||
width = ci_width - ul_x;
|
||||
if (lr_y > ci_height)
|
||||
height = ci_height - ul_y;
|
||||
wxUint32 * mb = (wxUint32*)(gfx.RDRAM+rdp.timg.addr); //pointer to the first macro block
|
||||
uint32_t * mb = (uint32_t*)(gfx.RDRAM+rdp.timg.addr); //pointer to the first macro block
|
||||
wxUint16 * dst = (wxUint16*)(gfx.RDRAM+rdp.cimg);
|
||||
dst += ul_x + ul_y * ci_width;
|
||||
//yuv macro block contains 16x16 texture. we need to put it in the proper place inside cimg
|
||||
|
@ -1267,7 +1267,7 @@ static void uc6_DrawYUVImageToFrameBuffer(wxUint16 ul_x, wxUint16 ul_y, wxUint16
|
|||
{
|
||||
for (wxUint16 w = 0; w < 16; w+=2)
|
||||
{
|
||||
wxUint32 t = *(mb++); //each wxUint32 contains 2 pixels
|
||||
uint32_t t = *(mb++); //each uint32_t contains 2 pixels
|
||||
if ((h < height) && (w < width)) //clipping. texture image may be larger than color image
|
||||
{
|
||||
wxUint8 y0 = (wxUint8)t&0xFF;
|
||||
|
@ -1359,11 +1359,11 @@ static void uc6_obj_loadtxtr ()
|
|||
rdp.s2dex_tex_loaded = TRUE;
|
||||
rdp.update |= UPDATE_TEXTURE;
|
||||
|
||||
wxUint32 addr = segoffset(rdp.cmd1) >> 1;
|
||||
wxUint32 type = ((wxUint32*)gfx.RDRAM)[(addr + 0) >> 1]; // 0, 1
|
||||
uint32_t addr = segoffset(rdp.cmd1) >> 1;
|
||||
uint32_t type = ((uint32_t*)gfx.RDRAM)[(addr + 0) >> 1]; // 0, 1
|
||||
|
||||
if (type == 0x00000030) { // TLUT
|
||||
wxUint32 image = segoffset(((wxUint32*)gfx.RDRAM)[(addr + 2) >> 1]); // 2, 3
|
||||
uint32_t image = segoffset(((uint32_t*)gfx.RDRAM)[(addr + 2) >> 1]); // 2, 3
|
||||
wxUint16 phead = ((wxUint16 *)gfx.RDRAM)[(addr + 4) ^ 1] - 256; // 4
|
||||
wxUint16 pnum = ((wxUint16 *)gfx.RDRAM)[(addr + 5) ^ 1] + 1; // 5
|
||||
|
||||
|
@ -1371,7 +1371,7 @@ static void uc6_obj_loadtxtr ()
|
|||
load_palette (image, phead, pnum);
|
||||
}
|
||||
else if (type == 0x00001033) { // TxtrBlock
|
||||
wxUint32 image = segoffset(((wxUint32*)gfx.RDRAM)[(addr + 2) >> 1]); // 2, 3
|
||||
uint32_t image = segoffset(((uint32_t*)gfx.RDRAM)[(addr + 2) >> 1]); // 2, 3
|
||||
wxUint16 tmem = ((wxUint16 *)gfx.RDRAM)[(addr + 4) ^ 1]; // 4
|
||||
wxUint16 tsize = ((wxUint16 *)gfx.RDRAM)[(addr + 5) ^ 1]; // 5
|
||||
wxUint16 tline = ((wxUint16 *)gfx.RDRAM)[(addr + 6) ^ 1]; // 6
|
||||
|
@ -1389,7 +1389,7 @@ static void uc6_obj_loadtxtr ()
|
|||
}
|
||||
else if (type == 0x00fc1034)
|
||||
{
|
||||
wxUint32 image = segoffset(((wxUint32*)gfx.RDRAM)[(addr + 2) >> 1]); // 2, 3
|
||||
uint32_t image = segoffset(((uint32_t*)gfx.RDRAM)[(addr + 2) >> 1]); // 2, 3
|
||||
wxUint16 tmem = ((wxUint16 *)gfx.RDRAM)[(addr + 4) ^ 1]; // 4
|
||||
wxUint16 twidth = ((wxUint16 *)gfx.RDRAM)[(addr + 5) ^ 1]; // 5
|
||||
wxUint16 theight = ((wxUint16 *)gfx.RDRAM)[(addr + 6) ^ 1]; // 6
|
||||
|
@ -1422,7 +1422,7 @@ static void uc6_obj_ldtx_sprite ()
|
|||
{
|
||||
LRDP("uc6:obj_ldtx_sprite\n");
|
||||
|
||||
wxUint32 addr = rdp.cmd1;
|
||||
uint32_t addr = rdp.cmd1;
|
||||
uc6_obj_loadtxtr ();
|
||||
rdp.cmd1 = addr + 24;
|
||||
uc6_obj_sprite ();
|
||||
|
@ -1432,7 +1432,7 @@ static void uc6_obj_ldtx_rect ()
|
|||
{
|
||||
LRDP("uc6:obj_ldtx_rect\n");
|
||||
|
||||
wxUint32 addr = rdp.cmd1;
|
||||
uint32_t addr = rdp.cmd1;
|
||||
uc6_obj_loadtxtr ();
|
||||
rdp.cmd1 = addr + 24;
|
||||
uc6_obj_rectangle ();
|
||||
|
@ -1442,7 +1442,7 @@ static void uc6_ldtx_rect_r ()
|
|||
{
|
||||
LRDP("uc6:ldtx_rect_r\n");
|
||||
|
||||
wxUint32 addr = rdp.cmd1;
|
||||
uint32_t addr = rdp.cmd1;
|
||||
uc6_obj_loadtxtr ();
|
||||
rdp.cmd1 = addr + 24;
|
||||
uc6_obj_rectangle_r ();
|
||||
|
@ -1454,8 +1454,8 @@ static void uc6_loaducode ()
|
|||
RDP_E ("uc6:load_ucode\n");
|
||||
|
||||
// copy the microcode data
|
||||
wxUint32 addr = segoffset(rdp.cmd1);
|
||||
wxUint32 size = (rdp.cmd0 & 0xFFFF) + 1;
|
||||
uint32_t addr = segoffset(rdp.cmd1);
|
||||
uint32_t size = (rdp.cmd0 & 0xFFFF) + 1;
|
||||
memcpy (microcode, gfx.RDRAM+addr, size);
|
||||
|
||||
microcheck ();
|
||||
|
@ -1463,16 +1463,16 @@ static void uc6_loaducode ()
|
|||
|
||||
void uc6_sprite2d ()
|
||||
{
|
||||
wxUint32 a = rdp.pc[rdp.pc_i] & BMASK;
|
||||
wxUint32 cmd0 = ((wxUint32*)gfx.RDRAM)[a>>2]; //check next command
|
||||
uint32_t a = rdp.pc[rdp.pc_i] & BMASK;
|
||||
uint32_t cmd0 = ((uint32_t*)gfx.RDRAM)[a>>2]; //check next command
|
||||
if ( (cmd0>>24) != 0xBE )
|
||||
return;
|
||||
|
||||
FRDP ("uc6:uc6_sprite2d #%d, #%d\n", rdp.tri_n, rdp.tri_n+1);
|
||||
wxUint32 addr = segoffset(rdp.cmd1) >> 1;
|
||||
uint32_t addr = segoffset(rdp.cmd1) >> 1;
|
||||
DRAWIMAGE d;
|
||||
|
||||
d.imagePtr = segoffset(((wxUint32*)gfx.RDRAM)[(addr+0)>>1]); // 0,1
|
||||
d.imagePtr = segoffset(((uint32_t*)gfx.RDRAM)[(addr+0)>>1]); // 0,1
|
||||
wxUint16 stride = (((wxUint16 *)gfx.RDRAM)[(addr+4)^1]); // 4
|
||||
d.imageW = (((wxUint16 *)gfx.RDRAM)[(addr+5)^1]); // 5
|
||||
d.imageH = (((wxUint16 *)gfx.RDRAM)[(addr+6)^1]); // 6
|
||||
|
@ -1481,7 +1481,7 @@ void uc6_sprite2d ()
|
|||
d.imagePal = 0;
|
||||
d.imageX = (((wxUint16 *)gfx.RDRAM)[(addr+8)^1]); // 8
|
||||
d.imageY = (((wxUint16 *)gfx.RDRAM)[(addr+9)^1]); // 9
|
||||
wxUint32 tlut = ((wxUint32*)gfx.RDRAM)[(addr + 2) >> 1]; // 2, 3
|
||||
uint32_t tlut = ((uint32_t*)gfx.RDRAM)[(addr + 2) >> 1]; // 2, 3
|
||||
//low-level implementation of sprite2d apparently calls setothermode command to set tlut mode
|
||||
//However, description of sprite2d microcode just says that
|
||||
//TlutPointer should be Null when CI images will not be used.
|
||||
|
@ -1504,12 +1504,12 @@ void uc6_sprite2d ()
|
|||
if (d.imageW == 0)
|
||||
return;// d.imageW = stride;
|
||||
|
||||
cmd0 = ((wxUint32*)gfx.RDRAM)[a>>2]; //check next command
|
||||
cmd0 = ((uint32_t*)gfx.RDRAM)[a>>2]; //check next command
|
||||
while (1)
|
||||
{
|
||||
if ( (cmd0>>24) == 0xBE )
|
||||
{
|
||||
wxUint32 cmd1 = ((wxUint32*)gfx.RDRAM)[(a>>2)+1];
|
||||
uint32_t cmd1 = ((uint32_t*)gfx.RDRAM)[(a>>2)+1];
|
||||
rdp.pc[rdp.pc_i] = (a+8) & BMASK;
|
||||
|
||||
d.scaleX = ((cmd1>>16)&0xFFFF)/1024.0f;
|
||||
|
@ -1523,11 +1523,11 @@ void uc6_sprite2d ()
|
|||
|
||||
a = rdp.pc[rdp.pc_i] & BMASK;
|
||||
rdp.pc[rdp.pc_i] = (a+8) & BMASK;
|
||||
cmd0 = ((wxUint32*)gfx.RDRAM)[a>>2]; //check next command
|
||||
cmd0 = ((uint32_t*)gfx.RDRAM)[a>>2]; //check next command
|
||||
}
|
||||
if ( (cmd0>>24) == 0xBD )
|
||||
{
|
||||
wxUint32 cmd1 = ((wxUint32*)gfx.RDRAM)[(a>>2)+1];
|
||||
uint32_t cmd1 = ((uint32_t*)gfx.RDRAM)[(a>>2)+1];
|
||||
|
||||
d.frameX = ((short)((cmd1>>16)&0xFFFF)) / 4.0f;
|
||||
d.frameY = ((short)(cmd1&0xFFFF)) / 4.0f;
|
||||
|
@ -1552,8 +1552,8 @@ void uc6_sprite2d ()
|
|||
return;
|
||||
}
|
||||
|
||||
const wxUint32 texsize = (d.imageW * d.imageH) << d.imageSiz >> 1;
|
||||
const wxUint32 maxTexSize = rdp.tlut_mode < 2 ? 4096 : 2048;
|
||||
const uint32_t texsize = (d.imageW * d.imageH) << d.imageSiz >> 1;
|
||||
const uint32_t maxTexSize = rdp.tlut_mode < 2 ? 4096 : 2048;
|
||||
|
||||
if (texsize > maxTexSize)
|
||||
{
|
||||
|
@ -1709,7 +1709,7 @@ void uc6_sprite2d ()
|
|||
|
||||
}
|
||||
a = rdp.pc[rdp.pc_i] & BMASK;
|
||||
cmd0 = ((wxUint32*)gfx.RDRAM)[a>>2]; //check next command
|
||||
cmd0 = ((uint32_t*)gfx.RDRAM)[a>>2]; //check next command
|
||||
if (( (cmd0>>24) == 0xBD ) || ( (cmd0>>24) == 0xBE ))
|
||||
rdp.pc[rdp.pc_i] = (a+8) & BMASK;
|
||||
else
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
// Bugs fixed with help from glN64 sources. Thanks, Orkin!
|
||||
//****************************************************************
|
||||
|
||||
wxUint32 pd_col_addr = 0;
|
||||
uint32_t pd_col_addr = 0;
|
||||
|
||||
static void uc7_colorbase ()
|
||||
{
|
||||
|
@ -79,15 +79,15 @@ static void uc7_vertex ()
|
|||
rdp.update ^= UPDATE_LIGHTS;
|
||||
|
||||
// Calculate light vectors
|
||||
for (wxUint32 l=0; l<rdp.num_lights; l++)
|
||||
for (uint32_t l=0; l<rdp.num_lights; l++)
|
||||
{
|
||||
InverseTransformVector(&rdp.light[l].dir_x, rdp.light_vector[l], rdp.model);
|
||||
NormalizeVector (rdp.light_vector[l]);
|
||||
}
|
||||
}
|
||||
|
||||
wxUint32 addr = segoffset(rdp.cmd1);
|
||||
wxUint32 v0, i, n;
|
||||
uint32_t addr = segoffset(rdp.cmd1);
|
||||
uint32_t v0, i, n;
|
||||
float x, y, z;
|
||||
|
||||
rdp.v0 = v0 = (rdp.cmd0 & 0x0F0000) >> 16;
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
//
|
||||
//****************************************************************
|
||||
|
||||
wxUint32 uc8_normale_addr = 0;
|
||||
uint32_t uc8_normale_addr = 0;
|
||||
float uc8_coord_mod[16];
|
||||
|
||||
static void uc8_vertex ()
|
||||
|
@ -52,7 +52,7 @@ static void uc8_vertex ()
|
|||
MulMatrices(rdp.model, rdp.proj, rdp.combined);
|
||||
}
|
||||
|
||||
wxUint32 addr = segoffset(rdp.cmd1);
|
||||
uint32_t addr = segoffset(rdp.cmd1);
|
||||
int v0, i, n;
|
||||
float x, y, z;
|
||||
|
||||
|
@ -74,7 +74,7 @@ static void uc8_vertex ()
|
|||
rdp.update ^= UPDATE_LIGHTS;
|
||||
|
||||
// Calculate light vectors
|
||||
for (wxUint32 l=0; l<rdp.num_lights; l++)
|
||||
for (uint32_t l=0; l<rdp.num_lights; l++)
|
||||
{
|
||||
InverseTransformVector(&rdp.light[l].dir_x, rdp.light_vector[l], rdp.model);
|
||||
NormalizeVector (rdp.light_vector[l]);
|
||||
|
@ -134,7 +134,7 @@ static void uc8_vertex ()
|
|||
|
||||
if ((rdp.geom_mode & 0x00020000))
|
||||
{
|
||||
wxUint32 shift = v0 << 1;
|
||||
uint32_t shift = v0 << 1;
|
||||
v->vec[0] = ((char*)gfx.RDRAM)[(uc8_normale_addr + (i>>3) + shift + 0)^3];
|
||||
v->vec[1] = ((char*)gfx.RDRAM)[(uc8_normale_addr + (i>>3) + shift + 1)^3];
|
||||
v->vec[2] = (char)(v->flags&0xff);
|
||||
|
@ -158,7 +158,7 @@ static void uc8_vertex ()
|
|||
float color[3] = {rdp.light[rdp.num_lights].r, rdp.light[rdp.num_lights].g, rdp.light[rdp.num_lights].b};
|
||||
FRDP("ambient light. r: %f, g: %f, b: %f\n", color[0], color[1], color[2]);
|
||||
float light_intensity = 0.0f;
|
||||
wxUint32 l;
|
||||
uint32_t l;
|
||||
if (rdp.geom_mode & 0x00400000)
|
||||
{
|
||||
NormalizeVector (v->vec);
|
||||
|
@ -237,7 +237,7 @@ static void uc8_moveword ()
|
|||
{
|
||||
wxUint8 index = (wxUint8)((rdp.cmd0 >> 16) & 0xFF);
|
||||
wxUint16 offset = (wxUint16)(rdp.cmd0 & 0xFFFF);
|
||||
wxUint32 data = rdp.cmd1;
|
||||
uint32_t data = rdp.cmd1;
|
||||
|
||||
FRDP ("uc8:moveword ");
|
||||
|
||||
|
@ -292,8 +292,8 @@ static void uc8_moveword ()
|
|||
FRDP ("coord mod:%d, %08lx\n", n, data);
|
||||
if (rdp.cmd0&8)
|
||||
return;
|
||||
wxUint32 idx = (rdp.cmd0>>1)&3;
|
||||
wxUint32 pos = rdp.cmd0&0x30;
|
||||
uint32_t idx = (rdp.cmd0>>1)&3;
|
||||
uint32_t pos = rdp.cmd0&0x30;
|
||||
if (pos == 0)
|
||||
{
|
||||
uc8_coord_mod[0+idx] = (short)(rdp.cmd1>>16);
|
||||
|
@ -334,7 +334,7 @@ static void uc8_moveword ()
|
|||
static void uc8_movemem ()
|
||||
{
|
||||
int idx = rdp.cmd0 & 0xFF;
|
||||
wxUint32 addr = segoffset(rdp.cmd1);
|
||||
uint32_t addr = segoffset(rdp.cmd1);
|
||||
int ofs = (rdp.cmd0 >> 5) & 0x3FFF;
|
||||
|
||||
FRDP ("uc8:movemem ofs:%d ", ofs);
|
||||
|
@ -343,7 +343,7 @@ static void uc8_movemem ()
|
|||
{
|
||||
case 8: // VIEWPORT
|
||||
{
|
||||
wxUint32 a = addr >> 1;
|
||||
uint32_t a = addr >> 1;
|
||||
short scale_x = ((short*)gfx.RDRAM)[(a+0)^1] >> 2;
|
||||
short scale_y = ((short*)gfx.RDRAM)[(a+1)^1] >> 2;
|
||||
short scale_z = ((short*)gfx.RDRAM)[(a+2)^1];
|
||||
|
@ -399,7 +399,7 @@ static void uc8_movemem ()
|
|||
rdp.light[n].dir_y = (float)(((char*)gfx.RDRAM)[(addr+9)^3]) / 127.0f;
|
||||
rdp.light[n].dir_z = (float)(((char*)gfx.RDRAM)[(addr+10)^3]) / 127.0f;
|
||||
// **
|
||||
wxUint32 a = addr >> 1;
|
||||
uint32_t a = addr >> 1;
|
||||
rdp.light[n].x = (float)(((short*)gfx.RDRAM)[(a+16)^1]);
|
||||
rdp.light[n].y = (float)(((short*)gfx.RDRAM)[(a+17)^1]);
|
||||
rdp.light[n].z = (float)(((short*)gfx.RDRAM)[(a+18)^1]);
|
||||
|
@ -435,7 +435,7 @@ static void uc8_movemem ()
|
|||
char y = ((char*)gfx.RDRAM)[uc8_normale_addr + ((i<<1) + 1)^3];
|
||||
FRDP("#%d x = %d, y = %d\n", i, x, y);
|
||||
}
|
||||
wxUint32 a = uc8_normale_addr >> 1;
|
||||
uint32_t a = uc8_normale_addr >> 1;
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
FRDP ("n[%d] = 0x%04lx \n", i, ((wxUint16*)gfx.RDRAM)[(a+i)^1]);
|
||||
|
|
|
@ -57,7 +57,7 @@ static int Calc_invw (int w) {
|
|||
int count, neg;
|
||||
union {
|
||||
wxInt32 W;
|
||||
wxUint32 UW;
|
||||
uint32_t UW;
|
||||
wxInt16 HW[2];
|
||||
wxUint16 UHW[2];
|
||||
} Result;
|
||||
|
@ -95,9 +95,9 @@ static int Calc_invw (int w) {
|
|||
return Result.W;
|
||||
}
|
||||
|
||||
static void uc9_draw_object (wxUint8 * addr, wxUint32 type)
|
||||
static void uc9_draw_object (wxUint8 * addr, uint32_t type)
|
||||
{
|
||||
wxUint32 textured, vnum, vsize;
|
||||
uint32_t textured, vnum, vsize;
|
||||
switch (type) {
|
||||
case 0: //null
|
||||
textured = vnum = vsize = 0;
|
||||
|
@ -128,7 +128,7 @@ static void uc9_draw_object (wxUint8 * addr, wxUint32 type)
|
|||
break;
|
||||
}
|
||||
VERTEX vtx[4];
|
||||
for (wxUint32 i = 0; i < vnum; i++)
|
||||
for (uint32_t i = 0; i < vnum; i++)
|
||||
{
|
||||
VERTEX &v = vtx[i];
|
||||
v.sx = zSortRdp.scale_x * ((short*)addr)[0^1];
|
||||
|
@ -181,15 +181,15 @@ static void uc9_draw_object (wxUint8 * addr, wxUint32 type)
|
|||
}
|
||||
}
|
||||
|
||||
static wxUint32 uc9_load_object (wxUint32 zHeader, wxUint32 * rdpcmds)
|
||||
static uint32_t uc9_load_object (uint32_t zHeader, uint32_t * rdpcmds)
|
||||
{
|
||||
wxUint32 type = zHeader & 7;
|
||||
uint32_t type = zHeader & 7;
|
||||
wxUint8 * addr = gfx.RDRAM + (zHeader&0xFFFFFFF8);
|
||||
switch (type) {
|
||||
case 1: //sh tri
|
||||
case 3: //sh quad
|
||||
{
|
||||
rdp.cmd1 = ((wxUint32*)addr)[1];
|
||||
rdp.cmd1 = ((uint32_t*)addr)[1];
|
||||
if (rdp.cmd1 != rdpcmds[0])
|
||||
{
|
||||
rdpcmds[0] = rdp.cmd1;
|
||||
|
@ -203,19 +203,19 @@ static wxUint32 uc9_load_object (wxUint32 zHeader, wxUint32 * rdpcmds)
|
|||
case 2: //tx tri
|
||||
case 4: //tx quad
|
||||
{
|
||||
rdp.cmd1 = ((wxUint32*)addr)[1];
|
||||
rdp.cmd1 = ((uint32_t*)addr)[1];
|
||||
if (rdp.cmd1 != rdpcmds[0])
|
||||
{
|
||||
rdpcmds[0] = rdp.cmd1;
|
||||
uc9_rpdcmd ();
|
||||
}
|
||||
rdp.cmd1 = ((wxUint32*)addr)[2];
|
||||
rdp.cmd1 = ((uint32_t*)addr)[2];
|
||||
if (rdp.cmd1 != rdpcmds[1])
|
||||
{
|
||||
uc9_rpdcmd ();
|
||||
rdpcmds[1] = rdp.cmd1;
|
||||
}
|
||||
rdp.cmd1 = ((wxUint32*)addr)[3];
|
||||
rdp.cmd1 = ((uint32_t*)addr)[3];
|
||||
if (rdp.cmd1 != rdpcmds[2])
|
||||
{
|
||||
uc9_rpdcmd ();
|
||||
|
@ -229,15 +229,15 @@ static wxUint32 uc9_load_object (wxUint32 zHeader, wxUint32 * rdpcmds)
|
|||
}
|
||||
break;
|
||||
}
|
||||
return segoffset(((wxUint32*)addr)[0]);
|
||||
return segoffset(((uint32_t*)addr)[0]);
|
||||
}
|
||||
|
||||
static void uc9_object ()
|
||||
{
|
||||
LRDP("uc9:object\n");
|
||||
wxUint32 rdpcmds[3] = {0, 0, 0};
|
||||
wxUint32 cmd1 = rdp.cmd1;
|
||||
wxUint32 zHeader = segoffset(rdp.cmd0);
|
||||
uint32_t rdpcmds[3] = {0, 0, 0};
|
||||
uint32_t cmd1 = rdp.cmd1;
|
||||
uint32_t zHeader = segoffset(rdp.cmd0);
|
||||
while (zHeader)
|
||||
zHeader = uc9_load_object(zHeader, rdpcmds);
|
||||
zHeader = segoffset(cmd1);
|
||||
|
@ -254,7 +254,7 @@ static void uc9_fmlight ()
|
|||
{
|
||||
int mid = rdp.cmd0&0xFF;
|
||||
rdp.num_lights = 1 + ((rdp.cmd1>>12)&0xFF);
|
||||
wxUint32 a = -1024 + (rdp.cmd1&0xFFF);
|
||||
uint32_t a = -1024 + (rdp.cmd1&0xFFF);
|
||||
FRDP ("uc9:fmlight matrix: %d, num: %d, dmem: %04lx\n", mid, rdp.num_lights, a);
|
||||
|
||||
M44 *m = NULL;
|
||||
|
@ -280,7 +280,7 @@ static void uc9_fmlight ()
|
|||
rdp.light[rdp.num_lights].a = 1.0f;
|
||||
FRDP ("ambient light: r: %.3f, g: %.3f, b: %.3f\n", rdp.light[rdp.num_lights].r, rdp.light[rdp.num_lights].g, rdp.light[rdp.num_lights].b);
|
||||
a += 8;
|
||||
wxUint32 i;
|
||||
uint32_t i;
|
||||
for (i = 0; i < rdp.num_lights; i++)
|
||||
{
|
||||
rdp.light[i].r = (float)(((wxUint8*)gfx.DMEM)[(a+0)^3]) / 255.0f;
|
||||
|
@ -320,16 +320,16 @@ static void uc9_fmlight ()
|
|||
|
||||
static void uc9_light ()
|
||||
{
|
||||
wxUint32 csrs = -1024 + ((rdp.cmd0>>12)&0xFFF);
|
||||
wxUint32 nsrs = -1024 + (rdp.cmd0&0xFFF);
|
||||
wxUint32 num = 1 + ((rdp.cmd1>>24)&0xFF);
|
||||
wxUint32 cdest = -1024 + ((rdp.cmd1>>12)&0xFFF);
|
||||
wxUint32 tdest = -1024 + (rdp.cmd1&0xFFF);
|
||||
uint32_t csrs = -1024 + ((rdp.cmd0>>12)&0xFFF);
|
||||
uint32_t nsrs = -1024 + (rdp.cmd0&0xFFF);
|
||||
uint32_t num = 1 + ((rdp.cmd1>>24)&0xFF);
|
||||
uint32_t cdest = -1024 + ((rdp.cmd1>>12)&0xFFF);
|
||||
uint32_t tdest = -1024 + (rdp.cmd1&0xFFF);
|
||||
int use_material = (csrs != 0x0ff0);
|
||||
tdest >>= 1;
|
||||
FRDP ("uc9:light n: %d, colsrs: %04lx, normales: %04lx, coldst: %04lx, texdst: %04lx\n", num, csrs, nsrs, cdest, tdest);
|
||||
VERTEX v;
|
||||
for (wxUint32 i = 0; i < num; i++)
|
||||
for (uint32_t i = 0; i < num; i++)
|
||||
{
|
||||
v.vec[0] = ((char*)gfx.DMEM)[(nsrs++)^3];
|
||||
v.vec[1] = ((char*)gfx.DMEM)[(nsrs++)^3];
|
||||
|
@ -341,9 +341,9 @@ static void uc9_light ()
|
|||
v.a = 0xFF;
|
||||
if (use_material)
|
||||
{
|
||||
v.r = (wxUint8)(((wxUint32)v.r * gfx.DMEM[(csrs++)^3])>>8);
|
||||
v.g = (wxUint8)(((wxUint32)v.g * gfx.DMEM[(csrs++)^3])>>8);
|
||||
v.b = (wxUint8)(((wxUint32)v.b * gfx.DMEM[(csrs++)^3])>>8);
|
||||
v.r = (wxUint8)(((uint32_t)v.r * gfx.DMEM[(csrs++)^3])>>8);
|
||||
v.g = (wxUint8)(((uint32_t)v.g * gfx.DMEM[(csrs++)^3])>>8);
|
||||
v.b = (wxUint8)(((uint32_t)v.b * gfx.DMEM[(csrs++)^3])>>8);
|
||||
v.a = gfx.DMEM[(csrs++)^3];
|
||||
}
|
||||
gfx.DMEM[(cdest++)^3] = v.r;
|
||||
|
@ -392,9 +392,9 @@ static void uc9_mtxcat ()
|
|||
LRDP("uc9:mtxcat ");
|
||||
M44 *s = NULL;
|
||||
M44 *t = NULL;
|
||||
wxUint32 S = rdp.cmd0&0xF;
|
||||
wxUint32 T = (rdp.cmd1>>16)&0xF;
|
||||
wxUint32 D = rdp.cmd1&0xF;
|
||||
uint32_t S = rdp.cmd0&0xF;
|
||||
uint32_t T = (rdp.cmd1>>16)&0xF;
|
||||
uint32_t D = rdp.cmd1&0xF;
|
||||
switch (S) {
|
||||
case 4:
|
||||
s = (M44*)rdp.model;
|
||||
|
@ -558,7 +558,7 @@ void uc9_movemem ()
|
|||
int len = (1 + ((rdp.cmd0>>15)&0x1ff))<<3;
|
||||
FRDP ("uc9:movemem ofs: %d, len: %d. ", ofs, len);
|
||||
int flag = rdp.cmd0 & 0x01;
|
||||
wxUint32 addr = segoffset(rdp.cmd1);
|
||||
uint32_t addr = segoffset(rdp.cmd1);
|
||||
switch (idx)
|
||||
{
|
||||
|
||||
|
@ -622,7 +622,7 @@ void uc9_movemem ()
|
|||
|
||||
case 12: // VIEWPORT
|
||||
{
|
||||
wxUint32 a = addr >> 1;
|
||||
uint32_t a = addr >> 1;
|
||||
short scale_x = ((short*)gfx.RDRAM)[(a+0)^1] >> 2;
|
||||
short scale_y = ((short*)gfx.RDRAM)[(a+1)^1] >> 2;
|
||||
short scale_z = ((short*)gfx.RDRAM)[(a+2)^1];
|
||||
|
|
|
@ -43,25 +43,25 @@
|
|||
|
||||
void uc9_rpdcmd ()
|
||||
{
|
||||
wxUint32 a = segoffset(rdp.cmd1) >> 2;
|
||||
uint32_t a = segoffset(rdp.cmd1) >> 2;
|
||||
FRDP ("uc9:rdpcmd addr: %08lx\n", a);
|
||||
if (a)
|
||||
{
|
||||
rdp.LLE = 1;
|
||||
wxUint32 cmd = 0;
|
||||
uint32_t cmd = 0;
|
||||
while(1)
|
||||
{
|
||||
rdp.cmd0 = ((wxUint32*)gfx.RDRAM)[a++];
|
||||
rdp.cmd0 = ((uint32_t*)gfx.RDRAM)[a++];
|
||||
cmd = rdp.cmd0>>24;
|
||||
if (cmd == 0xDF)
|
||||
break;
|
||||
rdp.cmd1 = ((wxUint32*)gfx.RDRAM)[a++];
|
||||
rdp.cmd1 = ((uint32_t*)gfx.RDRAM)[a++];
|
||||
if (cmd == 0xE4 || cmd == 0xE5)
|
||||
{
|
||||
a++;
|
||||
rdp.cmd2 = ((wxUint32*)gfx.RDRAM)[a++];
|
||||
rdp.cmd2 = ((uint32_t*)gfx.RDRAM)[a++];
|
||||
a++;
|
||||
rdp.cmd3 = ((wxUint32*)gfx.RDRAM)[a++];
|
||||
rdp.cmd3 = ((uint32_t*)gfx.RDRAM)[a++];
|
||||
}
|
||||
gfx_instruction[ucode_zSort][cmd] ();
|
||||
};
|
||||
|
|
|
@ -65,10 +65,10 @@ static void fb_bg_copy ()
|
|||
if ( (status == ci_copy) )
|
||||
return;
|
||||
|
||||
wxUint32 addr = segoffset(rdp.cmd1) >> 1;
|
||||
uint32_t addr = segoffset(rdp.cmd1) >> 1;
|
||||
wxUint8 imageFmt = ((wxUint8 *)gfx.RDRAM)[(((addr+11)<<1)+0)^3];
|
||||
wxUint8 imageSiz = ((wxUint8 *)gfx.RDRAM)[(((addr+11)<<1)+1)^3];
|
||||
wxUint32 imagePtr = segoffset(((wxUint32*)gfx.RDRAM)[(addr+8)>>1]);
|
||||
uint32_t imagePtr = segoffset(((uint32_t*)gfx.RDRAM)[(addr+8)>>1]);
|
||||
FRDP ("fb_bg_copy. fmt: %d, size: %d, imagePtr %08lx, main_ci: %08lx, cur_ci: %08lx \n", imageFmt, imageSiz, imagePtr, rdp.main_ci, rdp.frame_buffers[rdp.ci_count-1].addr);
|
||||
|
||||
if (status == ci_main)
|
||||
|
@ -112,13 +112,13 @@ static void fb_bg_copy ()
|
|||
|
||||
static void fb_setscissor()
|
||||
{
|
||||
rdp.scissor_o.lr_y = (wxUint32)(((rdp.cmd1 & 0x00000FFF) >> 2));
|
||||
rdp.scissor_o.lr_y = (uint32_t)(((rdp.cmd1 & 0x00000FFF) >> 2));
|
||||
if (rdp.ci_count)
|
||||
{
|
||||
rdp.scissor_o.ul_x = (wxUint32)(((rdp.cmd0 & 0x00FFF000) >> 14));
|
||||
rdp.scissor_o.lr_x = (wxUint32)(((rdp.cmd1 & 0x00FFF000) >> 14));
|
||||
rdp.scissor_o.ul_x = (uint32_t)(((rdp.cmd0 & 0x00FFF000) >> 14));
|
||||
rdp.scissor_o.lr_x = (uint32_t)(((rdp.cmd1 & 0x00FFF000) >> 14));
|
||||
COLOR_IMAGE & cur_fb = rdp.frame_buffers[rdp.ci_count-1];
|
||||
if (rdp.scissor_o.lr_x - rdp.scissor_o.ul_x > (wxUint32)(cur_fb.width >> 1))
|
||||
if (rdp.scissor_o.lr_x - rdp.scissor_o.ul_x > (uint32_t)(cur_fb.width >> 1))
|
||||
{
|
||||
if (cur_fb.height == 0 || (cur_fb.width >= rdp.scissor_o.lr_x-1 && cur_fb.width <= rdp.scissor_o.lr_x+1))
|
||||
cur_fb.height = rdp.scissor_o.lr_y;
|
||||
|
@ -131,7 +131,7 @@ static void fb_uc2_movemem()
|
|||
{
|
||||
if ((rdp.cmd0 & 0xFF) == 8)
|
||||
{
|
||||
wxUint32 a = segoffset(rdp.cmd1) >> 1;
|
||||
uint32_t a = segoffset(rdp.cmd1) >> 1;
|
||||
short scale_x = ((short*)gfx.RDRAM)[(a+0)^1] >> 2;
|
||||
short trans_x = ((short*)gfx.RDRAM)[(a+4)^1] >> 2;
|
||||
COLOR_IMAGE & cur_fb = rdp.frame_buffers[rdp.ci_count-1];
|
||||
|
@ -139,7 +139,7 @@ static void fb_uc2_movemem()
|
|||
{
|
||||
short scale_y = ((short*)gfx.RDRAM)[(a+1)^1] >> 2;
|
||||
short trans_y = ((short*)gfx.RDRAM)[(a+5)^1] >> 2;
|
||||
wxUint32 height = scale_y + trans_y;
|
||||
uint32_t height = scale_y + trans_y;
|
||||
if (height < rdp.scissor_o.lr_y)
|
||||
cur_fb.height = height;
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ static void fb_rect()
|
|||
int diff = abs((int)rdp.frame_buffers[rdp.ci_count-1].width - width);
|
||||
if (diff < 4)
|
||||
{
|
||||
wxUint32 lr_y = min(rdp.scissor_o.lr_y, (rdp.cmd0 & 0xFFF) >> 2);
|
||||
uint32_t lr_y = min(rdp.scissor_o.lr_y, (rdp.cmd0 & 0xFFF) >> 2);
|
||||
if (rdp.frame_buffers[rdp.ci_count-1].height < lr_y)
|
||||
{
|
||||
FRDP("fb_rect. ul_x: %d, lr_x: %d, fb_height: %d -> %d\n", ul_x, lr_x, rdp.frame_buffers[rdp.ci_count-1].height, lr_y);
|
||||
|
@ -181,7 +181,7 @@ static void fb_settextureimage()
|
|||
if (((rdp.cmd0 >> 19) & 0x03) >= 2) //check that texture is 16/32bit
|
||||
{
|
||||
int tex_format = ((rdp.cmd0 >> 21) & 0x07);
|
||||
wxUint32 addr = segoffset(rdp.cmd1);
|
||||
uint32_t addr = segoffset(rdp.cmd1);
|
||||
if ( tex_format == 0 )
|
||||
{
|
||||
FRDP ("fb_settextureimage. fmt: %d, size: %d, imagePtr %08lx, main_ci: %08lx, cur_ci: %08lx \n", ((rdp.cmd0 >> 21) & 0x07), ((rdp.cmd0 >> 19) & 0x03), addr, rdp.main_ci, rdp.frame_buffers[rdp.ci_count-1].addr);
|
||||
|
@ -419,7 +419,7 @@ static void fb_setcolorimage()
|
|||
{
|
||||
rdp.frame_buffers[rdp.ci_count-1].status = ci_useless;
|
||||
/*
|
||||
wxUint32 addr = rdp.frame_buffers[rdp.ci_count-1].addr;
|
||||
uint32_t addr = rdp.frame_buffers[rdp.ci_count-1].addr;
|
||||
for (int i = 0; i < rdp.ci_count - 1; i++)
|
||||
{
|
||||
if (rdp.frame_buffers[i].addr == addr)
|
||||
|
|
Loading…
Reference in New Issue