Merge pull request #266 from cxd4/what_if_I_told_you_CR_plus_LF_equals_mind_blown

used Visual Studio 2008 to fix remaining files with mixes of CR, LF and CRLF
This commit is contained in:
zilmar 2015-03-12 08:40:36 +11:00
commit fb4b31064d
9 changed files with 1383 additions and 1383 deletions

View File

@ -42,18 +42,18 @@ segment .text
extern "C" void __declspec(naked) DetectSIMD(int func, int * iedx, int * iecx) extern "C" void __declspec(naked) DetectSIMD(int func, int * iedx, int * iecx)
{ {
_asm { _asm {
push ebp push ebp
mov ebp,esp mov ebp,esp
mov eax,[func] mov eax,[func]
cpuid cpuid
mov eax,[iedx] mov eax,[iedx]
mov [eax],edx mov [eax],edx
mov eax,[iecx] mov eax,[iecx]
mov [eax],ecx mov [eax],ecx
leave leave
ret ret
} }
} }
/**************************************************************** /****************************************************************
; ;
@ -65,8 +65,8 @@ extern "C" void __declspec(naked) TransformVectorSSE(float *src, float *dst, flo
{ {
__asm __asm
{ {
push ebp push ebp
mov ebp,esp mov ebp,esp
mov ecx,[src] mov ecx,[src]
mov eax,[dst] mov eax,[dst]
@ -91,17 +91,17 @@ extern "C" void __declspec(naked) TransformVectorSSE(float *src, float *dst, flo
addps xmm0,xmm2 ; mat[0][2]*src[0]+mat[1][2]*src[1]+mat[2][2]*src[2] mat[0][1]*src[0]+mat[1][1]*src[1]+mat[2][1]*src[2] 0 mat[0][0]*src[0]+mat[1][0]*src[1]+mat[2][0]*src[2] addps xmm0,xmm2 ; mat[0][2]*src[0]+mat[1][2]*src[1]+mat[2][2]*src[2] mat[0][1]*src[0]+mat[1][1]*src[1]+mat[2][1]*src[2] 0 mat[0][0]*src[0]+mat[1][0]*src[1]+mat[2][0]*src[2]
movss [eax],xmm0 ; mat[0][0]*src[0]+mat[1][0]*src[1]+mat[2][0]*src[2] movss [eax],xmm0 ; mat[0][0]*src[0]+mat[1][0]*src[1]+mat[2][0]*src[2]
movhps [eax+4],xmm0 ; mat[0][2]*src[0]+mat[1][2]*src[1]+mat[2][2]*src[2] mat[0][1]*src[0]+mat[1][1]*src[1]+mat[2][1]*src[2] movhps [eax+4],xmm0 ; mat[0][2]*src[0]+mat[1][2]*src[1]+mat[2][2]*src[2] mat[0][1]*src[0]+mat[1][1]*src[1]+mat[2][1]*src[2]
leave leave
ret ret
} }
} }
extern "C" void __declspec(naked) MulMatricesSSE(float m1[4][4],float m2[4][4],float r[4][4]) extern "C" void __declspec(naked) MulMatricesSSE(float m1[4][4],float m2[4][4],float r[4][4])
{ {
__asm __asm
{ {
push ebp push ebp
mov ebp,esp mov ebp,esp
mov eax,[r] mov eax,[r]
mov ecx,[m1] mov ecx,[m1]
@ -204,17 +204,17 @@ extern "C" void __declspec(naked) MulMatricesSSE(float m1[4][4],float m2[4][4],f
addps xmm4,xmm7 addps xmm4,xmm7
movaps [eax+48],xmm4 movaps [eax+48],xmm4
leave leave
ret ret
} }
} }
extern "C" void __declspec(naked) NormalizeVectorSSE (float *v) extern "C" void __declspec(naked) NormalizeVectorSSE (float *v)
{ {
_asm _asm
{ {
push ebp push ebp
mov ebp,esp mov ebp,esp
mov edx, [v] mov edx, [v]
movaps xmm0, [edx] ; x y z 0 movaps xmm0, [edx] ; x y z 0
@ -229,10 +229,10 @@ extern "C" void __declspec(naked) NormalizeVectorSSE (float *v)
rsqrtps xmm0, xmm0 ; 1.0/sqrt(x*x+z*z+y*y) rsqrtps xmm0, xmm0 ; 1.0/sqrt(x*x+z*z+y*y)
mulps xmm2, xmm0 ; x/sqrt(x*x+z*z+y*y) y/sqrt(x*x+z*z+y*y) z/sqrt(x*x+z*z+y*y) 0 mulps xmm2, xmm0 ; x/sqrt(x*x+z*z+y*y) y/sqrt(x*x+z*z+y*y) z/sqrt(x*x+z*z+y*y) 0
movaps [edx], xmm2 movaps [edx], xmm2
leave leave
ret ret
} }
} }
/***************************************************************** /*****************************************************************
; ;
@ -243,8 +243,8 @@ extern "C" void __declspec(naked) NormalizeVectorSSE (float *v)
float __declspec(naked) DotProductSSE3(register float *v1, register float *v2) float __declspec(naked) DotProductSSE3(register float *v1, register float *v2)
{ {
_asm { _asm {
push ebp push ebp
mov ebp,esp mov ebp,esp
mov eax,[v1] mov eax,[v1]
mov edx,[v2] mov edx,[v2]
@ -253,10 +253,10 @@ float __declspec(naked) DotProductSSE3(register float *v1, register float *v2)
haddps xmm0, xmm0 haddps xmm0, xmm0
haddps xmm0, xmm0 haddps xmm0, xmm0
; movss eax, xmm0 ; movss eax, xmm0
leave leave
ret ret
} }
} }
/**************************************************************** /****************************************************************
; ;
@ -267,8 +267,8 @@ float __declspec(naked) DotProductSSE3(register float *v1, register float *v2)
extern "C" void __declspec(naked) TransformVector3DNOW(float *src, float *dst, float mat[4][4]) extern "C" void __declspec(naked) TransformVector3DNOW(float *src, float *dst, float mat[4][4])
{ {
_asm { _asm {
push ebp push ebp
mov ebp,esp mov ebp,esp
femms femms
mov ecx,[src] mov ecx,[src]
@ -296,16 +296,16 @@ extern "C" void __declspec(naked) TransformVector3DNOW(float *src, float *dst, f
movq [eax],mm0 ; mat[0][1]*src[0]+mat[1][1]*src[1]+mat[2][1]*src[2] mat[0][0]*src[0]+mat[1][0]*src[1]+mat[2][0]*src[2] movq [eax],mm0 ; mat[0][1]*src[0]+mat[1][1]*src[1]+mat[2][1]*src[2] mat[0][0]*src[0]+mat[1][0]*src[1]+mat[2][0]*src[2]
movd [eax+8],mm3 ; mat[0][2]*src[0]+mat[1][2]*src[1]+mat[2][2]*src[2] movd [eax+8],mm3 ; mat[0][2]*src[0]+mat[1][2]*src[1]+mat[2][2]*src[2]
femms femms
leave leave
ret ret
} }
} }
extern "C" void __declspec(naked) InverseTransformVector3DNOW(float *src, float *dst, float mat[4][4]) extern "C" void __declspec(naked) InverseTransformVector3DNOW(float *src, float *dst, float mat[4][4])
{ {
_asm { _asm {
push ebp push ebp
mov ebp,esp mov ebp,esp
femms femms
mov ecx,[src] mov ecx,[src]
@ -333,16 +333,16 @@ extern "C" void __declspec(naked) InverseTransformVector3DNOW(float *src, float
movq [eax],mm0 ; mat[1][0]*src[0]+mat[1][1]*src[1]+mat[1][2]*src[2] mat[0][0]*src[0]+mat[0][1]*src[1]+mat[0][2]*src[2] movq [eax],mm0 ; mat[1][0]*src[0]+mat[1][1]*src[1]+mat[1][2]*src[2] mat[0][0]*src[0]+mat[0][1]*src[1]+mat[0][2]*src[2]
movd [eax+8],mm2 ; mat[2][0]*src[0]+mat[2][1]*src[1]+mat[2][2]*src[2] movd [eax+8],mm2 ; mat[2][0]*src[0]+mat[2][1]*src[1]+mat[2][2]*src[2]
femms femms
leave leave
ret ret
} }
} }
extern "C" void __declspec(naked) MulMatrices3DNOW(float m1[4][4],float m2[4][4],float r[4][4]) extern "C" void __declspec(naked) MulMatrices3DNOW(float m1[4][4],float m2[4][4],float r[4][4])
{ {
_asm { _asm {
push ebp push ebp
mov ebp,esp mov ebp,esp
femms femms
mov ecx,[m1] mov ecx,[m1]
@ -465,16 +465,16 @@ extern "C" void __declspec(naked) MulMatrices3DNOW(float m1[4][4],float m2[4][4
movq [eax+48],mm7 movq [eax+48],mm7
movq [eax+56],mm3 movq [eax+56],mm3
femms femms
leave leave
ret ret
} }
} }
extern "C" float __declspec(naked) DotProduct3DNOW(register float *v1, register float *v2) extern "C" float __declspec(naked) DotProduct3DNOW(register float *v1, register float *v2)
{ {
_asm { _asm {
push ebp push ebp
mov ebp,esp mov ebp,esp
femms femms
mov edx,[v1] mov edx,[v1]
@ -489,15 +489,15 @@ extern "C" float __declspec(naked) DotProduct3DNOW(register float *v1, register
pfadd mm0,mm1 pfadd mm0,mm1
movd eax,mm0 movd eax,mm0
femms femms
leave leave
ret ret
} }
} }
extern "C" void __declspec(naked) NormalizeVector3DNOW(float *v) extern "C" void __declspec(naked) NormalizeVector3DNOW(float *v)
{ {
_asm { _asm {
push ebp push ebp
mov ebp,esp mov ebp,esp
femms femms
mov edx,[v] mov edx,[v]
@ -521,7 +521,7 @@ extern "C" void __declspec(naked) NormalizeVector3DNOW(float *v)
movq [edx],mm1 movq [edx],mm1
movq [edx+8],mm2 movq [edx+8],mm2
femms femms
leave leave
ret ret
} }
} }

View File

@ -67,7 +67,7 @@ GLIDE64_DEBUGGER _debugger;
#define COL_GRID 0xFFFFFF80 #define COL_GRID 0xFFFFFF80
int grid = 0; int grid = 0;
static const char *tri_type[4] = { "TRIANGLE", "TEXRECT", "FILLRECT", "BACKGROUND" }; static const char *tri_type[4] = { "TRIANGLE", "TEXRECT", "FILLRECT", "BACKGROUND" };
//Platform-specific stuff //Platform-specific stuff
#ifndef __WINDOWS__ #ifndef __WINDOWS__
@ -212,7 +212,7 @@ void debug_cacheviewer ()
{ SX(x*64.0f), SY(512+64.0f*i), 1, 1, 0, 0, 0, 0, {0, 0, 0, 0} }, { SX(x*64.0f), SY(512+64.0f*i), 1, 1, 0, 0, 0, 0, {0, 0, 0, 0} },
{ SX(x*64.0f+64.0f*cache[x+y*16].scale_x), SY(512+64.0f*i), 1, 1, 255*cache[x+y*16].scale_x, 0, 0, 0, {0, 0, 0, 0} }, { SX(x*64.0f+64.0f*cache[x+y*16].scale_x), SY(512+64.0f*i), 1, 1, 255*cache[x+y*16].scale_x, 0, 0, 0, {0, 0, 0, 0} },
{ SX(x*64.0f), SY(512+64.0f*i+64.0f*cache[x+y*16].scale_y), 1, 1, 0, 255*cache[x+y*16].scale_y, 0, 0, {0, 0, 0, 0} }, { SX(x*64.0f), SY(512+64.0f*i+64.0f*cache[x+y*16].scale_y), 1, 1, 0, 255*cache[x+y*16].scale_y, 0, 0, {0, 0, 0, 0} },
{ SX(x*64.0f+64.0f*cache[x+y*16].scale_x), SY(512+64.0f*i+64.0f*cache[x+y*16].scale_y), 1, 1, 255*cache[x+y*16].scale_x, 255*cache[x+y*16].scale_y, 0, 0, {0, 0, 0, 0} } { SX(x*64.0f+64.0f*cache[x+y*16].scale_x), SY(512+64.0f*i+64.0f*cache[x+y*16].scale_y), 1, 1, 255*cache[x+y*16].scale_x, 255*cache[x+y*16].scale_y, 0, 0, {0, 0, 0, 0} }
}; };
for for
(int i=0; i<4; i++) (int i=0; i<4; i++)
@ -364,7 +364,7 @@ void debug_capture ()
{ SX(704.0f), SY(221.0f), 1, 1, 0, 0, 0, 0, {0, 0, 0, 0} }, { SX(704.0f), SY(221.0f), 1, 1, 0, 0, 0, 0, {0, 0, 0, 0} },
{ SX(704.0f+256.0f*scx), SY(221.0f), 1, 1, 255*scx, 0, 255*scx, 0, {0, 0, 0, 0} }, { SX(704.0f+256.0f*scx), SY(221.0f), 1, 1, 255*scx, 0, 255*scx, 0, {0, 0, 0, 0} },
{ SX(704.0f), SY(221.0f+256.0f*scy), 1, 1, 0, 255*scy, 0, 255*scy, {0, 0, 0, 0} }, { SX(704.0f), SY(221.0f+256.0f*scy), 1, 1, 0, 255*scy, 0, 255*scy, {0, 0, 0, 0} },
{ SX(704.0f+256.0f*scx), SY(221.0f+256.0f*scy), 1, 1, 255*scx, 255*scy, 255*scx, 255*scy, {0, 0, 0, 0} } { SX(704.0f+256.0f*scx), SY(221.0f+256.0f*scy), 1, 1, 255*scx, 255*scy, 255*scx, 255*scy, {0, 0, 0, 0} }
}; };
ConvertCoordsConvert (v, 4); ConvertCoordsConvert (v, 4);
VERTEX *varr[4] = { &v[0], &v[1], &v[2], &v[3] }; VERTEX *varr[4] = { &v[0], &v[1], &v[2], &v[3] };
@ -851,7 +851,7 @@ void debug_mouse ()
{ cx, cy, 1, 1, 0, 0, 0, 0, {0, 0, 0, 0} }, { cx, cy, 1, 1, 0, 0, 0, 0, {0, 0, 0, 0} },
{ cx+32, cy, 1, 1, 255, 0, 0, 0, {0, 0, 0, 0} }, { cx+32, cy, 1, 1, 255, 0, 0, 0, {0, 0, 0, 0} },
{ cx, cy+32, 1, 1, 0, 255, 0, 0, {0, 0, 0, 0} }, { cx, cy+32, 1, 1, 0, 255, 0, 0, {0, 0, 0, 0} },
{ cx+32, cy+32, 1, 1, 255, 255, 0, 0, {0, 0, 0, 0} } { cx+32, cy+32, 1, 1, 255, 255, 0, 0, {0, 0, 0, 0} }
}; };
ConvertCoordsKeep (v, 4); ConvertCoordsKeep (v, 4);
@ -996,7 +996,7 @@ void output (float x, float y, int scale, const char *fmt, ...)
VERTEX v[4] = { { SX(x), SY(768-y), 1, 1, (float)c, r+16.0f, 0, 0, {0, 0, 0, 0} }, VERTEX v[4] = { { SX(x), SY(768-y), 1, 1, (float)c, r+16.0f, 0, 0, {0, 0, 0, 0} },
{ SX(x+8), SY(768-y), 1, 1, c+8.0f, r+16.0f, 0, 0, {0, 0, 0, 0} }, { SX(x+8), SY(768-y), 1, 1, c+8.0f, r+16.0f, 0, 0, {0, 0, 0, 0} },
{ SX(x), SY(768-y-16), 1, 1, (float)c, (float)r, 0, 0, {0, 0, 0, 0} }, { SX(x), SY(768-y-16), 1, 1, (float)c, (float)r, 0, 0, {0, 0, 0, 0} },
{ SX(x+8), SY(768-y-16), 1, 1, c+8.0f, (float)r, 0, 0, {0, 0, 0, 0} } { SX(x+8), SY(768-y-16), 1, 1, c+8.0f, (float)r, 0, 0, {0, 0, 0, 0} }
}; };
if (!scale) if (!scale)
{ {

View File

@ -39,45 +39,45 @@
extern "C" int __declspec(naked) imul16(int x, int y) extern "C" int __declspec(naked) imul16(int x, int y)
{ {
_asm { _asm {
push ebp push ebp
mov ebp,esp mov ebp,esp
mov eax, [x] mov eax, [x]
mov edx, [y] mov edx, [y]
imul edx imul edx
shrd eax,edx,16 shrd eax,edx,16
leave leave
ret ret
} }
} }
//(x * y) >> 14 //(x * y) >> 14
extern "C" int __declspec(naked) imul14(int x, int y) extern "C" int __declspec(naked) imul14(int x, int y)
{ {
_asm { _asm {
push ebp push ebp
mov ebp,esp mov ebp,esp
mov eax, [x] mov eax, [x]
mov edx, [y] mov edx, [y]
imul edx imul edx
shrd eax,edx,14 shrd eax,edx,14
leave leave
ret ret
} }
} }
//(x << 16) / y //(x << 16) / y
extern "C" int __declspec(naked) idiv16(int x, int y) extern "C" int __declspec(naked) idiv16(int x, int y)
{ {
_asm { _asm {
push ebp push ebp
mov ebp,esp mov ebp,esp
mov eax, [x] mov eax, [x]
mov ebx, [y] mov ebx, [y]
mov edx,eax mov edx,eax
sar edx,16 sar edx,16
shl eax,16 shl eax,16
idiv ebx idiv ebx
leave leave
ret ret
} }
} }

View File

@ -909,7 +909,7 @@ __inline double interp3p(float a, float b, float c, double r1, double r2)
{ {
return (a)+(((b)+((c)-(b))*(r2))-(a))*(r1); return (a)+(((b)+((c)-(b))*(r2))-(a))*(r1);
} }
/* /*
#define interp3p(a, b, c, r1, r2) \ #define interp3p(a, b, c, r1, r2) \
(a+(((b)+((c)-(b))*(r2))-(a))*(r1)) (a+(((b)+((c)-(b))*(r2))-(a))*(r1))
*/ */
@ -1925,32 +1925,32 @@ void update ()
if (((rdp.flags & ZBUF_ENABLED) || rdp.zsrc == 1) && rdp.cycle_mode < 2) if (((rdp.flags & ZBUF_ENABLED) || rdp.zsrc == 1) && rdp.cycle_mode < 2)
{ {
if (rdp.flags & ZBUF_COMPARE) if (rdp.flags & ZBUF_COMPARE)
{ {
switch ((rdp.rm & 0xC00)>>10) { switch ((rdp.rm & 0xC00)>>10) {
case 0: case 0:
grDepthBiasLevel(0); grDepthBiasLevel(0);
grDepthBufferFunction (settings.zmode_compare_less ? GR_CMP_LESS : GR_CMP_LEQUAL); grDepthBufferFunction (settings.zmode_compare_less ? GR_CMP_LESS : GR_CMP_LEQUAL);
break; break;
case 1: case 1:
grDepthBiasLevel(-4); grDepthBiasLevel(-4);
grDepthBufferFunction (settings.zmode_compare_less ? GR_CMP_LESS : GR_CMP_LEQUAL); grDepthBufferFunction (settings.zmode_compare_less ? GR_CMP_LESS : GR_CMP_LEQUAL);
break; break;
case 2: case 2:
grDepthBiasLevel(settings.ucode == 7 ? -4 : 0); grDepthBiasLevel(settings.ucode == 7 ? -4 : 0);
grDepthBufferFunction (GR_CMP_LESS); grDepthBufferFunction (GR_CMP_LESS);
break; break;
case 3: case 3:
// will be set dynamically per polygon // will be set dynamically per polygon
//grDepthBiasLevel(-deltaZ); //grDepthBiasLevel(-deltaZ);
grDepthBufferFunction (GR_CMP_LEQUAL); grDepthBufferFunction (GR_CMP_LEQUAL);
break; break;
} }
} }
else else
{ {
grDepthBiasLevel(0); grDepthBiasLevel(0);
grDepthBufferFunction (GR_CMP_ALWAYS); grDepthBufferFunction (GR_CMP_ALWAYS);
} }
if (rdp.flags & ZBUF_UPDATE) if (rdp.flags & ZBUF_UPDATE)
@ -1960,7 +1960,7 @@ void update ()
} }
else else
{ {
grDepthBiasLevel(0); grDepthBiasLevel(0);
grDepthBufferFunction (GR_CMP_ALWAYS); grDepthBufferFunction (GR_CMP_ALWAYS);
grDepthMask (FXFALSE); grDepthMask (FXFALSE);
} }

View File

@ -598,9 +598,9 @@ struct RDP_Base{
wxUint32 fill_color; wxUint32 fill_color;
wxUint32 prim_color; wxUint32 prim_color;
wxUint32 blend_color; wxUint32 blend_color;
wxUint32 env_color; wxUint32 env_color;
wxUint32 SCALE; wxUint32 SCALE;
wxUint32 CENTER; wxUint32 CENTER;
wxUint32 prim_lodmin, prim_lodfrac; wxUint32 prim_lodmin, prim_lodfrac;
wxUint16 prim_depth; wxUint16 prim_depth;
wxUint16 prim_dz; wxUint16 prim_dz;

View File

@ -879,7 +879,7 @@ static void uc0_setothermode_h()
if (mask & 0x00300000) // cycle type if (mask & 0x00300000) // cycle type
{ {
rdp.cycle_mode = (wxUint8)((rdp.othermode_h & 0x00300000) >> 20); rdp.cycle_mode = (wxUint8)((rdp.othermode_h & 0x00300000) >> 20);
rdp.update |= UPDATE_ZBUF_ENABLED; rdp.update |= UPDATE_ZBUF_ENABLED;
FRDP ("cycletype: %d\n", rdp.cycle_mode); FRDP ("cycletype: %d\n", rdp.cycle_mode);
} }
@ -942,7 +942,7 @@ static void uc0_setothermode_l()
{ {
rdp.zsrc = (rdp.othermode_l & 0x00000004) >> 2; rdp.zsrc = (rdp.othermode_l & 0x00000004) >> 2;
FRDP ("z-src sel: %s\n", str_zs[rdp.zsrc]); FRDP ("z-src sel: %s\n", str_zs[rdp.zsrc]);
FRDP ("z-src sel: %08lx\n", rdp.zsrc); FRDP ("z-src sel: %08lx\n", rdp.zsrc);
rdp.update |= UPDATE_ZBUF_ENABLED; rdp.update |= UPDATE_ZBUF_ENABLED;
} }

View File

@ -39,82 +39,82 @@
// STANDARD DRAWIMAGE - draws a 2d image based on the following structure // STANDARD DRAWIMAGE - draws a 2d image based on the following structure
static float set_sprite_combine_mode () static float set_sprite_combine_mode ()
{ {
if (rdp.cycle_mode == 2) if (rdp.cycle_mode == 2)
{ {
rdp.tex = 1; rdp.tex = 1;
rdp.allow_combine = 0; rdp.allow_combine = 0;
// Now actually combine ! // Now actually combine !
GrCombineFunction_t color_source = GR_COMBINE_FUNCTION_LOCAL; GrCombineFunction_t color_source = GR_COMBINE_FUNCTION_LOCAL;
if (rdp.tbuff_tex && rdp.tbuff_tex->info.format == GR_TEXFMT_ALPHA_INTENSITY_88) if (rdp.tbuff_tex && rdp.tbuff_tex->info.format == GR_TEXFMT_ALPHA_INTENSITY_88)
color_source = GR_COMBINE_FUNCTION_LOCAL_ALPHA; color_source = GR_COMBINE_FUNCTION_LOCAL_ALPHA;
cmb.tmu1_func = cmb.tmu0_func = color_source; cmb.tmu1_func = cmb.tmu0_func = color_source;
cmb.tmu1_fac = cmb.tmu0_fac = GR_COMBINE_FACTOR_NONE; cmb.tmu1_fac = cmb.tmu0_fac = GR_COMBINE_FACTOR_NONE;
cmb.tmu1_a_func = cmb.tmu0_a_func = GR_COMBINE_FUNCTION_LOCAL; cmb.tmu1_a_func = cmb.tmu0_a_func = GR_COMBINE_FUNCTION_LOCAL;
cmb.tmu1_a_fac = cmb.tmu0_a_fac = GR_COMBINE_FACTOR_NONE; cmb.tmu1_a_fac = cmb.tmu0_a_fac = GR_COMBINE_FACTOR_NONE;
cmb.tmu1_invert = cmb.tmu0_invert = FXFALSE; cmb.tmu1_invert = cmb.tmu0_invert = FXFALSE;
cmb.tmu1_a_invert = cmb.tmu0_a_invert = FXFALSE; cmb.tmu1_a_invert = cmb.tmu0_a_invert = FXFALSE;
} }
rdp.update |= UPDATE_COMBINE; rdp.update |= UPDATE_COMBINE;
update (); update ();
rdp.allow_combine = 1; rdp.allow_combine = 1;
// set z buffer mode // set z buffer mode
float Z = 0.0f; float Z = 0.0f;
if ((rdp.othermode_l & 0x00000030) && rdp.cycle_mode < 2) if ((rdp.othermode_l & 0x00000030) && rdp.cycle_mode < 2)
{ {
wxUint16 prim_dz = 0; wxUint16 prim_dz = 0;
if (rdp.zsrc == 1) if (rdp.zsrc == 1)
{ {
Z = rdp.prim_depth; Z = rdp.prim_depth;
prim_dz = rdp.prim_dz; prim_dz = rdp.prim_dz;
} }
FRDP ("prim_depth = %d, prim_dz = %d\n", rdp.prim_depth, rdp.prim_dz); FRDP ("prim_depth = %d, prim_dz = %d\n", rdp.prim_depth, rdp.prim_dz);
Z = ScaleZ(Z); Z = ScaleZ(Z);
if (rdp.othermode_l & 0x00000400) if (rdp.othermode_l & 0x00000400)
grDepthBiasLevel(rdp.prim_dz); grDepthBiasLevel(rdp.prim_dz);
} }
else else
{ {
LRDP("z compare not used, using 0\n"); LRDP("z compare not used, using 0\n");
} }
grCullMode (GR_CULL_DISABLE); grCullMode (GR_CULL_DISABLE);
grFogMode (GR_FOG_DISABLE); grFogMode (GR_FOG_DISABLE);
rdp.update |= UPDATE_CULL_MODE | UPDATE_FOG_ENABLED; rdp.update |= UPDATE_CULL_MODE | UPDATE_FOG_ENABLED;
if (rdp.cycle_mode == 2) if (rdp.cycle_mode == 2)
{ {
grColorCombine (GR_COMBINE_FUNCTION_SCALE_OTHER, grColorCombine (GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE, GR_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE, GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE, GR_COMBINE_OTHER_TEXTURE,
FXFALSE); FXFALSE);
grAlphaCombine (GR_COMBINE_FUNCTION_SCALE_OTHER, grAlphaCombine (GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE, GR_COMBINE_FACTOR_ONE,
GR_COMBINE_LOCAL_NONE, GR_COMBINE_LOCAL_NONE,
GR_COMBINE_OTHER_TEXTURE, GR_COMBINE_OTHER_TEXTURE,
FXFALSE); FXFALSE);
grAlphaBlendFunction (GR_BLEND_ONE, grAlphaBlendFunction (GR_BLEND_ONE,
GR_BLEND_ZERO, GR_BLEND_ZERO,
GR_BLEND_ZERO, GR_BLEND_ZERO,
GR_BLEND_ZERO); GR_BLEND_ZERO);
if (rdp.othermode_l & 1) if (rdp.othermode_l & 1)
{ {
grAlphaTestFunction (GR_CMP_GEQUAL); grAlphaTestFunction (GR_CMP_GEQUAL);
grAlphaTestReferenceValue (0x80); grAlphaTestReferenceValue (0x80);
} }
else else
grAlphaTestFunction (GR_CMP_ALWAYS); grAlphaTestFunction (GR_CMP_ALWAYS);
rdp.update |= UPDATE_ALPHA_COMPARE | UPDATE_COMBINE; rdp.update |= UPDATE_ALPHA_COMPARE | UPDATE_COMBINE;
} }
return Z; return Z;
} }
void uc6_sprite2d (); void uc6_sprite2d ();
typedef struct DRAWIMAGE_t { typedef struct DRAWIMAGE_t {
@ -135,23 +135,23 @@ typedef struct DRAWIMAGE_t {
float scaleX; float scaleX;
float scaleY; float scaleY;
} DRAWIMAGE; } DRAWIMAGE;
typedef struct DRAWOBJECT_t { typedef struct DRAWOBJECT_t {
float objX; float objX;
float objY; float objY;
float scaleW; float scaleW;
float scaleH; float scaleH;
short imageW; short imageW;
short imageH; short imageH;
wxUint16 imageStride; wxUint16 imageStride;
wxUint16 imageAdrs; wxUint16 imageAdrs;
wxUint8 imageFmt; wxUint8 imageFmt;
wxUint8 imageSiz; wxUint8 imageSiz;
wxUint8 imagePal; wxUint8 imagePal;
wxUint8 imageFlags; wxUint8 imageFlags;
} DRAWOBJECT; } DRAWOBJECT;
void DrawHiresDepthImage (const DRAWIMAGE & d) void DrawHiresDepthImage (const DRAWIMAGE & d)
{ {
wxUint16 * src = (wxUint16*)(gfx.RDRAM+d.imagePtr); wxUint16 * src = (wxUint16*)(gfx.RDRAM+d.imagePtr);
@ -293,56 +293,56 @@ void DrawImage (DRAWIMAGE & d)
if (d.imageW == 0 || d.imageH == 0 || d.frameH == 0) return; if (d.imageW == 0 || d.imageH == 0 || d.frameH == 0) return;
int x_size, y_size, x_shift, y_shift, line; int x_size, y_size, x_shift, y_shift, line;
// choose optimum size for the format/size // choose optimum size for the format/size
switch (d.imageSiz) switch (d.imageSiz)
{ {
case 0: case 0:
if (rdp.tlut_mode < 2) if (rdp.tlut_mode < 2)
{ {
y_size = 64; y_size = 64;
y_shift = 6; y_shift = 6;
} }
else else
{ {
y_size = 32; y_size = 32;
y_shift = 5; y_shift = 5;
} }
x_size = 128; x_size = 128;
x_shift = 7; x_shift = 7;
line = 8; line = 8;
break; break;
case 1: case 1:
if (rdp.tlut_mode < 2) if (rdp.tlut_mode < 2)
{ {
y_size = 64; y_size = 64;
y_shift = 6; y_shift = 6;
} }
else else
{ {
y_size = 32; y_size = 32;
y_shift = 5; y_shift = 5;
} }
x_size = 64; x_size = 64;
x_shift = 6; x_shift = 6;
line = 8; line = 8;
break; break;
case 2: case 2:
x_size = 64; x_size = 64;
y_size = 32; y_size = 32;
x_shift = 6; x_shift = 6;
y_shift = 5; y_shift = 5;
line = 16; line = 16;
break; break;
case 3: case 3:
x_size = 32; x_size = 32;
y_size = 16; y_size = 16;
x_shift = 4; x_shift = 4;
y_shift = 3; y_shift = 3;
line = 16; line = 16;
break; break;
default: default:
FRDP("DrawImage. unknown image size: %d\n", d.imageSiz); FRDP("DrawImage. unknown image size: %d\n", d.imageSiz);
return; return;
} }
if (rdp.ci_width == 512 && !no_dlist) //RE2 if (rdp.ci_width == 512 && !no_dlist) //RE2
@ -443,8 +443,8 @@ void DrawImage (DRAWIMAGE & d)
rdp.tiles[0].lr_t = y_size-1; rdp.tiles[0].lr_t = y_size-1;
const float Z = set_sprite_combine_mode (); const float Z = set_sprite_combine_mode ();
if (rdp.cycle_mode == 2) if (rdp.cycle_mode == 2)
rdp.allow_combine = 0; rdp.allow_combine = 0;
if (fullscreen) if (fullscreen)
{ {
@ -453,7 +453,7 @@ void DrawImage (DRAWIMAGE & d)
else if (d.scaleX == 1.0f && d.scaleY == 1.0f) 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); grClipWindow (rdp.scissor.ul_x, rdp.scissor.ul_y, rdp.scissor.lr_x, rdp.scissor.lr_y);
else 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, (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)));
rdp.update |= UPDATE_SCISSOR; rdp.update |= UPDATE_SCISSOR;
} }
@ -715,89 +715,89 @@ struct MAT2D {
float BaseScaleX; float BaseScaleX;
float BaseScaleY; float BaseScaleY;
} mat_2d = {1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f}; } mat_2d = {1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f};
static void uc6_read_background_data (DRAWIMAGE & d, bool bReadScale) static void uc6_read_background_data (DRAWIMAGE & d, bool bReadScale)
{ {
wxUint32 addr = segoffset(rdp.cmd1) >> 1; wxUint32 addr = segoffset(rdp.cmd1) >> 1;
d.imageX = (((wxUint16 *)gfx.RDRAM)[(addr+0)^1] >> 5); // 0 d.imageX = (((wxUint16 *)gfx.RDRAM)[(addr+0)^1] >> 5); // 0
d.imageW = (((wxUint16 *)gfx.RDRAM)[(addr+1)^1] >> 2); // 1 d.imageW = (((wxUint16 *)gfx.RDRAM)[(addr+1)^1] >> 2); // 1
d.frameX = ((short*)gfx.RDRAM)[(addr+2)^1] / 4.0f; // 2 d.frameX = ((short*)gfx.RDRAM)[(addr+2)^1] / 4.0f; // 2
d.frameW = ((wxUint16 *)gfx.RDRAM)[(addr+3)^1] >> 2; // 3 d.frameW = ((wxUint16 *)gfx.RDRAM)[(addr+3)^1] >> 2; // 3
d.imageY = (((wxUint16 *)gfx.RDRAM)[(addr+4)^1] >> 5); // 4 d.imageY = (((wxUint16 *)gfx.RDRAM)[(addr+4)^1] >> 5); // 4
d.imageH = (((wxUint16 *)gfx.RDRAM)[(addr+5)^1] >> 2); // 5 d.imageH = (((wxUint16 *)gfx.RDRAM)[(addr+5)^1] >> 2); // 5
d.frameY = ((short*)gfx.RDRAM)[(addr+6)^1] / 4.0f; // 6 d.frameY = ((short*)gfx.RDRAM)[(addr+6)^1] / 4.0f; // 6
d.frameH = ((wxUint16 *)gfx.RDRAM)[(addr+7)^1] >> 2; // 7 d.frameH = ((wxUint16 *)gfx.RDRAM)[(addr+7)^1] >> 2; // 7
d.imagePtr = segoffset(((wxUint32*)gfx.RDRAM)[(addr+8)>>1]); // 8,9 d.imagePtr = segoffset(((wxUint32*)gfx.RDRAM)[(addr+8)>>1]); // 8,9
d.imageFmt = ((wxUint8 *)gfx.RDRAM)[(((addr+11)<<1)+0)^3]; // 11 d.imageFmt = ((wxUint8 *)gfx.RDRAM)[(((addr+11)<<1)+0)^3]; // 11
d.imageSiz = ((wxUint8 *)gfx.RDRAM)[(((addr+11)<<1)+1)^3]; // | d.imageSiz = ((wxUint8 *)gfx.RDRAM)[(((addr+11)<<1)+1)^3]; // |
d.imagePal = ((wxUint16 *)gfx.RDRAM)[(addr+12)^1]; // 12 d.imagePal = ((wxUint16 *)gfx.RDRAM)[(addr+12)^1]; // 12
wxUint16 imageFlip = ((wxUint16 *)gfx.RDRAM)[(addr+13)^1]; // 13; wxUint16 imageFlip = ((wxUint16 *)gfx.RDRAM)[(addr+13)^1]; // 13;
d.flipX = (wxUint8)imageFlip&0x01; d.flipX = (wxUint8)imageFlip&0x01;
if (bReadScale) if (bReadScale)
{ {
d.scaleX = ((short *)gfx.RDRAM)[(addr+14)^1] / 1024.0f; // 14 d.scaleX = ((short *)gfx.RDRAM)[(addr+14)^1] / 1024.0f; // 14
d.scaleY = ((short *)gfx.RDRAM)[(addr+15)^1] / 1024.0f; // 15 d.scaleY = ((short *)gfx.RDRAM)[(addr+15)^1] / 1024.0f; // 15
} }
else else
d.scaleX = d.scaleY = 1.0f; d.scaleX = d.scaleY = 1.0f;
d.flipY = 0; d.flipY = 0;
int imageYorig= ((int *)gfx.RDRAM)[(addr+16)>>1] >> 5; int imageYorig= ((int *)gfx.RDRAM)[(addr+16)>>1] >> 5;
rdp.last_bg = d.imagePtr; rdp.last_bg = d.imagePtr;
FRDP ("imagePtr: %08lx\n", d.imagePtr); FRDP ("imagePtr: %08lx\n", d.imagePtr);
FRDP ("frameX: %f, frameW: %d, frameY: %f, frameH: %d\n", d.frameX, d.frameW, d.frameY, d.frameH); FRDP ("frameX: %f, frameW: %d, frameY: %f, frameH: %d\n", d.frameX, d.frameW, d.frameY, d.frameH);
FRDP ("imageX: %d, imageW: %d, imageY: %d, imageH: %d\n", d.imageX, d.imageW, d.imageY, d.imageH); FRDP ("imageX: %d, imageW: %d, imageY: %d, imageH: %d\n", d.imageX, d.imageW, d.imageY, d.imageH);
FRDP ("imageYorig: %d, scaleX: %f, scaleY: %f\n", imageYorig, d.scaleX, d.scaleY); FRDP ("imageYorig: %d, scaleX: %f, scaleY: %f\n", imageYorig, d.scaleX, d.scaleY);
FRDP ("imageFmt: %d, imageSiz: %d, imagePal: %d, imageFlip: %d\n", d.imageFmt, d.imageSiz, d.imagePal, d.flipX); FRDP ("imageFmt: %d, imageSiz: %d, imagePal: %d, imageFlip: %d\n", d.imageFmt, d.imageSiz, d.imagePal, d.flipX);
} }
static void uc6_bg (bool bg_1cyc) static void uc6_bg (bool bg_1cyc)
{ {
static const char *strFuncNames[] = {"uc6:bg_1cyc", "uc6:bg_copy"}; static const char *strFuncNames[] = {"uc6:bg_1cyc", "uc6:bg_copy"};
const char *strFuncName = bg_1cyc ? strFuncNames[0] : strFuncNames[1]; const char *strFuncName = bg_1cyc ? strFuncNames[0] : strFuncNames[1];
if (rdp.skip_drawing) if (rdp.skip_drawing)
{ {
FRDP("%s skipped\n", strFuncName); FRDP("%s skipped\n", strFuncName);
return; return;
} }
FRDP ("%s #%d, #%d\n", strFuncName, rdp.tri_n, rdp.tri_n+1); FRDP ("%s #%d, #%d\n", strFuncName, rdp.tri_n, rdp.tri_n+1);
DRAWIMAGE d; DRAWIMAGE d;
uc6_read_background_data(d, bg_1cyc); uc6_read_background_data(d, bg_1cyc);
if (fb_hwfbe_enabled && FindTextureBuffer(d.imagePtr, d.imageW)) if (fb_hwfbe_enabled && FindTextureBuffer(d.imagePtr, d.imageW))
{ {
DrawHiresImage(d); DrawHiresImage(d);
return; return;
} }
if (settings.ucode == ucode_F3DEX2 || (settings.hacks&hack_PPL)) if (settings.ucode == ucode_F3DEX2 || (settings.hacks&hack_PPL))
{ {
if ( (d.imagePtr != rdp.cimg) && (d.imagePtr != rdp.ocimg) && d.imagePtr) //can't draw from framebuffer if ( (d.imagePtr != rdp.cimg) && (d.imagePtr != rdp.ocimg) && d.imagePtr) //can't draw from framebuffer
DrawImage (d); DrawImage (d);
else else
{ {
FRDP("%s skipped\n", strFuncName); FRDP("%s skipped\n", strFuncName);
} }
} }
else else
{ {
DrawImage (d); DrawImage (d);
} }
} }
static void uc6_bg_1cyc () static void uc6_bg_1cyc ()
{ {
uc6_bg(true); uc6_bg(true);
} }
static void uc6_bg_copy () static void uc6_bg_copy ()
{ {
uc6_bg(false); uc6_bg(false);
} }
@ -997,67 +997,67 @@ static void uc6_draw_polygons (VERTEX v[4])
} }
} }
static void uc6_read_object_data (DRAWOBJECT & d) static void uc6_read_object_data (DRAWOBJECT & d)
{ {
wxUint32 addr = segoffset(rdp.cmd1) >> 1; wxUint32 addr = segoffset(rdp.cmd1) >> 1;
d.objX = ((short*)gfx.RDRAM)[(addr+0)^1] / 4.0f; // 0 d.objX = ((short*)gfx.RDRAM)[(addr+0)^1] / 4.0f; // 0
d.scaleW = ((wxUint16 *)gfx.RDRAM)[(addr+1)^1] / 1024.0f; // 1 d.scaleW = ((wxUint16 *)gfx.RDRAM)[(addr+1)^1] / 1024.0f; // 1
d.imageW = ((short*)gfx.RDRAM)[(addr+2)^1] >> 5; // 2, 3 is padding d.imageW = ((short*)gfx.RDRAM)[(addr+2)^1] >> 5; // 2, 3 is padding
d.objY = ((short*)gfx.RDRAM)[(addr+4)^1] / 4.0f; // 4 d.objY = ((short*)gfx.RDRAM)[(addr+4)^1] / 4.0f; // 4
d.scaleH = ((wxUint16 *)gfx.RDRAM)[(addr+5)^1] / 1024.0f; // 5 d.scaleH = ((wxUint16 *)gfx.RDRAM)[(addr+5)^1] / 1024.0f; // 5
d.imageH = ((short*)gfx.RDRAM)[(addr+6)^1] >> 5; // 6, 7 is padding d.imageH = ((short*)gfx.RDRAM)[(addr+6)^1] >> 5; // 6, 7 is padding
d.imageStride = ((wxUint16 *)gfx.RDRAM)[(addr+8)^1]; // 8 d.imageStride = ((wxUint16 *)gfx.RDRAM)[(addr+8)^1]; // 8
d.imageAdrs = ((wxUint16 *)gfx.RDRAM)[(addr+9)^1]; // 9 d.imageAdrs = ((wxUint16 *)gfx.RDRAM)[(addr+9)^1]; // 9
d.imageFmt = ((wxUint8 *)gfx.RDRAM)[(((addr+10)<<1)+0)^3]; // 10 d.imageFmt = ((wxUint8 *)gfx.RDRAM)[(((addr+10)<<1)+0)^3]; // 10
d.imageSiz = ((wxUint8 *)gfx.RDRAM)[(((addr+10)<<1)+1)^3]; // | d.imageSiz = ((wxUint8 *)gfx.RDRAM)[(((addr+10)<<1)+1)^3]; // |
d.imagePal = ((wxUint8 *)gfx.RDRAM)[(((addr+10)<<1)+2)^3]; // 11 d.imagePal = ((wxUint8 *)gfx.RDRAM)[(((addr+10)<<1)+2)^3]; // 11
d.imageFlags = ((wxUint8 *)gfx.RDRAM)[(((addr+10)<<1)+3)^3]; // | d.imageFlags = ((wxUint8 *)gfx.RDRAM)[(((addr+10)<<1)+3)^3]; // |
if (d.imageW < 0) if (d.imageW < 0)
d.imageW = (short)rdp.scissor_o.lr_x - (short)d.objX - d.imageW; d.imageW = (short)rdp.scissor_o.lr_x - (short)d.objX - d.imageW;
if (d.imageH < 0) if (d.imageH < 0)
d.imageH = (short)rdp.scissor_o.lr_y - (short)d.objY - d.imageH; d.imageH = (short)rdp.scissor_o.lr_y - (short)d.objY - d.imageH;
FRDP ("#%d, #%d\n" FRDP ("#%d, #%d\n"
"objX: %f, scaleW: %f, imageW: %d\n" "objX: %f, scaleW: %f, imageW: %d\n"
"objY: %f, scaleH: %f, imageH: %d\n" "objY: %f, scaleH: %f, imageH: %d\n"
"size: %d, format: %d\n", rdp.tri_n, rdp.tri_n+1, "size: %d, format: %d\n", rdp.tri_n, rdp.tri_n+1,
d.objX, d.scaleW, d.imageW, d.objY, d.scaleH, d.imageH, d.imageSiz, d.imageFmt); d.objX, d.scaleW, d.imageW, d.objY, d.scaleH, d.imageH, d.imageSiz, d.imageFmt);
} }
static void uc6_init_tile(const DRAWOBJECT & d) static void uc6_init_tile(const DRAWOBJECT & d)
{ {
// SetTile () // SetTile ()
TILE *tile = &rdp.tiles[0]; TILE *tile = &rdp.tiles[0];
tile->format = d.imageFmt; // RGBA tile->format = d.imageFmt; // RGBA
tile->size = d.imageSiz; // 16-bit tile->size = d.imageSiz; // 16-bit
tile->line = d.imageStride; tile->line = d.imageStride;
tile->t_mem = d.imageAdrs; tile->t_mem = d.imageAdrs;
tile->palette = d.imagePal; tile->palette = d.imagePal;
tile->clamp_t = 1; tile->clamp_t = 1;
tile->mirror_t = 0; tile->mirror_t = 0;
tile->mask_t = 0; tile->mask_t = 0;
tile->shift_t = 0; tile->shift_t = 0;
tile->clamp_s = 1; tile->clamp_s = 1;
tile->mirror_s = 0; tile->mirror_s = 0;
tile->mask_s = 0; tile->mask_s = 0;
tile->shift_s = 0; tile->shift_s = 0;
// SetTileSize () // SetTileSize ()
rdp.tiles[0].ul_s = 0; rdp.tiles[0].ul_s = 0;
rdp.tiles[0].ul_t = 0; rdp.tiles[0].ul_t = 0;
rdp.tiles[0].lr_s = (d.imageW>0)?d.imageW-1:0; rdp.tiles[0].lr_s = (d.imageW>0)?d.imageW-1:0;
rdp.tiles[0].lr_t = (d.imageH>0)?d.imageH-1:0; rdp.tiles[0].lr_t = (d.imageH>0)?d.imageH-1:0;
} }
static void uc6_obj_rectangle () static void uc6_obj_rectangle ()
{ {
LRDP ("uc6:obj_rectangle "); LRDP ("uc6:obj_rectangle ");
DRAWOBJECT d; DRAWOBJECT d;
uc6_read_object_data(d); uc6_read_object_data(d);
if (d.imageAdrs > 4096) if (d.imageAdrs > 4096)
{ {
FRDP("tmem: %08lx is out of bounds! return\n", d.imageAdrs); FRDP("tmem: %08lx is out of bounds! return\n", d.imageAdrs);
@ -1068,8 +1068,8 @@ static void uc6_obj_rectangle ()
LRDP("Texture was not loaded! return\n"); LRDP("Texture was not loaded! return\n");
return; return;
} }
uc6_init_tile(d); uc6_init_tile(d);
float Z = set_sprite_combine_mode (); float Z = set_sprite_combine_mode ();
@ -1123,10 +1123,10 @@ static void uc6_obj_rectangle ()
static void uc6_obj_sprite () static void uc6_obj_sprite ()
{ {
LRDP ("uc6:obj_sprite "); LRDP ("uc6:obj_sprite ");
DRAWOBJECT d; DRAWOBJECT d;
uc6_read_object_data(d); uc6_read_object_data(d);
uc6_init_tile(d); uc6_init_tile(d);
float Z = set_sprite_combine_mode (); float Z = set_sprite_combine_mode ();
@ -1286,9 +1286,9 @@ static void uc6_DrawYUVImageToFrameBuffer(wxUint16 ul_x, wxUint16 ul_y, wxUint16
static void uc6_obj_rectangle_r () static void uc6_obj_rectangle_r ()
{ {
LRDP ("uc6:obj_rectangle_r "); LRDP ("uc6:obj_rectangle_r ");
DRAWOBJECT d; DRAWOBJECT d;
uc6_read_object_data(d); uc6_read_object_data(d);
if (d.imageFmt == 1 && (settings.hacks&hack_Ogre64)) //Ogre Battle needs to copy YUV texture to frame buffer if (d.imageFmt == 1 && (settings.hacks&hack_Ogre64)) //Ogre Battle needs to copy YUV texture to frame buffer
{ {
@ -1300,8 +1300,8 @@ static void uc6_obj_rectangle_r ()
rdp.tri_n += 2; rdp.tri_n += 2;
return; return;
} }
uc6_init_tile(d); uc6_init_tile(d);
float Z = set_sprite_combine_mode (); float Z = set_sprite_combine_mode ();
@ -1554,9 +1554,9 @@ void uc6_sprite2d ()
return; return;
} }
const wxUint32 texsize = (d.imageW * d.imageH) << d.imageSiz >> 1; const wxUint32 texsize = (d.imageW * d.imageH) << d.imageSiz >> 1;
const wxUint32 maxTexSize = rdp.tlut_mode < 2 ? 4096 : 2048; const wxUint32 maxTexSize = rdp.tlut_mode < 2 ? 4096 : 2048;
if (texsize > maxTexSize) if (texsize > maxTexSize)
{ {
if (d.scaleX != 1) if (d.scaleX != 1)

File diff suppressed because it is too large Load Diff

View File

@ -9,13 +9,13 @@
* * * *
****************************************************************************/ ****************************************************************************/
#pragma once #pragma once
class Mempak class Mempak
{ {
public: public:
static void Close ( void ); static void Close ( void );
static BYTE CalculateCrc ( BYTE * DataToCrc ); static BYTE CalculateCrc ( BYTE * DataToCrc );
static void ReadFrom ( int Control, int Address, BYTE * Buffer ); static void ReadFrom ( int Control, int Address, BYTE * Buffer );
static void WriteTo ( int Control, int Address, BYTE * Buffer ); static void WriteTo ( int Control, int Address, BYTE * Buffer );
}; };