zzogl-pg: Refactor a bunch of Mem.cpp stuff.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2762 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2010-03-23 12:21:46 +00:00
parent 6db10003de
commit 4cccb9e034
6 changed files with 468 additions and 1541 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="pcsx2_suite_2008 workspace">
<Project filename="pcsx2/Linux/pcsx2.cbp">
<Project filename="pcsx2/Linux/pcsx2.cbp" active="1">
<Depends filename="common/build/x86emitter/x86emitter.cbp" />
<Depends filename="common/build/Utilities/Utilities.cbp" />
<Depends filename="3rdparty/zlib/zlib.cbp" />
@ -30,6 +30,6 @@
<Project filename="plugins/zerospu2/Linux/ZeroSPU2.cbp">
<Depends filename="3rdparty/SoundTouch/SoundTouch.cbp" />
</Project>
<Project filename="plugins/zzogl-pg/opengl/Linux/zzogl-pg/zzogl-pg.cbp" active="1" />
<Project filename="plugins/zzogl-pg/opengl/Linux/zzogl-pg/zzogl-pg.cbp" />
</Workspace>
</CodeBlocks_workspace_file>

File diff suppressed because it is too large Load Diff

View File

@ -43,6 +43,40 @@ typedef u32 (*_readPixel_0)(const void* pmem, int x, int y, u32 bw);
typedef int (*_TransferHostLocal)(const void* pbyMem, u32 nQWordSize);
typedef void (*_TransferLocalHost)(void* pbyMem, u32 nQWordSize);
typedef void (__fastcall *_SwizzleBlock)(u8 *dst, u8 *src, int pitch, u32 WriteMask);
// Both of the following structs should probably be local class variables or in a namespace,
// but this works for the moment.
struct TransferData
{
u32 widthlimit;
u32 blockbits;
u32 blockwidth;
u32 blockheight;
u32 transfersize;
__forceinline TransferData(u32 limit, u32 bits, u32 width, u32 height, u32 size)
{
widthlimit = limit;
blockbits = bits;
blockwidth = width;
blockheight = height;
transfersize = size;
}
};
struct TransferFuncts
{
_writePixel_0 wp;
_getPixelAddress_0 gp;
_SwizzleBlock Swizzle, Swizzle_u;
__forceinline TransferFuncts(_writePixel_0 writePix, _getPixelAddress_0 readPix, _SwizzleBlock s, _SwizzleBlock su)
{
wp = writePix;
gp = readPix;
Swizzle = s;
Swizzle_u = su;
}
};
// rest not visible externally
struct BLOCK
{

View File

@ -24,7 +24,7 @@
// special swizzle macros - which I converted to functions.
static __forceinline void SwizzleBlock24(u8 *dst, u8 *src, int pitch, u32 WriteMask = 0xffffffff)
static __forceinline __fastcall void SwizzleBlock24(u8 *dst, u8 *src, int pitch, u32 WriteMask = 0xffffffff)
{
u8* pnewsrc = src;
u32* pblock = tempblock;
@ -52,7 +52,7 @@ static __forceinline void SwizzleBlock24(u8 *dst, u8 *src, int pitch, u32 WriteM
#define SwizzleBlock24u SwizzleBlock24
static __forceinline void SwizzleBlock8H(u8 *dst, u8 *src, int pitch, u32 WriteMask = 0xffffffff)
static __forceinline __fastcall void SwizzleBlock8H(u8 *dst, u8 *src, int pitch, u32 WriteMask = 0xffffffff)
{
u8* pnewsrc = src;
u32* pblock = tempblock;
@ -75,7 +75,7 @@ static __forceinline void SwizzleBlock8H(u8 *dst, u8 *src, int pitch, u32 WriteM
#define SwizzleBlock8Hu SwizzleBlock8H
static __forceinline void SwizzleBlock4HH(u8 *dst, u8 *src, int pitch, u32 WriteMask = 0xffffffff)
static __forceinline __fastcall void SwizzleBlock4HH(u8 *dst, u8 *src, int pitch, u32 WriteMask = 0xffffffff)
{
u8* pnewsrc = src;
u32* pblock = tempblock;
@ -97,7 +97,7 @@ static __forceinline void SwizzleBlock4HH(u8 *dst, u8 *src, int pitch, u32 Write
#define SwizzleBlock4HHu SwizzleBlock4HH
static __forceinline void SwizzleBlock4HL(u8 *dst, u8 *src, int pitch, u32 WriteMask = 0xffffffff)
static __forceinline __fastcall void SwizzleBlock4HL(u8 *dst, u8 *src, int pitch, u32 WriteMask = 0xffffffff)
{
u8* pnewsrc = src;
u32* pblock = tempblock;

View File

@ -67,7 +67,7 @@ void __fastcall SwizzleBlock24_c(u8* dst, u8* src, int srcpitch, u32 WriteMask)
}
}
void __fastcall SwizzleBlock16_c(u8* dst, u8* src, int srcpitch)
void __fastcall SwizzleBlock16_c(u8* dst, u8* src, int srcpitch, u32 WriteMask)
{
u32* d = &g_columnTable16[0][0];
@ -76,7 +76,7 @@ void __fastcall SwizzleBlock16_c(u8* dst, u8* src, int srcpitch)
((u16*)dst)[d[i]] = ((u16*)src)[i];
}
void __fastcall SwizzleBlock8_c(u8* dst, u8* src, int srcpitch)
void __fastcall SwizzleBlock8_c(u8* dst, u8* src, int srcpitch, u32 WriteMask)
{
u32* d = &g_columnTable8[0][0];
@ -85,7 +85,7 @@ void __fastcall SwizzleBlock8_c(u8* dst, u8* src, int srcpitch)
dst[d[i]] = src[i];
}
void __fastcall SwizzleBlock4_c(u8* dst, u8* src, int srcpitch)
void __fastcall SwizzleBlock4_c(u8* dst, u8* src, int srcpitch, u32 WriteMask)
{
u32* d = &g_columnTable4[0][0];

View File

@ -25,13 +25,13 @@
#include "GS.h"
extern "C" void __fastcall SwizzleBlock32_sse2(u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern "C" void __fastcall SwizzleBlock16_sse2(u8* dst, u8* src, int srcpitch);
extern "C" void __fastcall SwizzleBlock8_sse2(u8* dst, u8* src, int srcpitch);
extern "C" void __fastcall SwizzleBlock4_sse2(u8* dst, u8* src, int srcpitch);
extern "C" void __fastcall SwizzleBlock16_sse2(u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern "C" void __fastcall SwizzleBlock8_sse2(u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern "C" void __fastcall SwizzleBlock4_sse2(u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern "C" void __fastcall SwizzleBlock32u_sse2(u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern "C" void __fastcall SwizzleBlock16u_sse2(u8* dst, u8* src, int srcpitch);
extern "C" void __fastcall SwizzleBlock8u_sse2(u8* dst, u8* src, int srcpitch);
extern "C" void __fastcall SwizzleBlock4u_sse2(u8* dst, u8* src, int srcpitch);
extern "C" void __fastcall SwizzleBlock16u_sse2(u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern "C" void __fastcall SwizzleBlock8u_sse2(u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern "C" void __fastcall SwizzleBlock4u_sse2(u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
// frame swizzling
@ -60,9 +60,9 @@ extern "C" void __fastcall Frame16SwizzleBlock16A4_sse2(u16* dst, Vector_16F* sr
extern "C" void __fastcall Frame16SwizzleBlock16ZA4_sse2(u16* dst, Vector_16F* src, int srcpitch, u32 WriteMask);
extern void __fastcall SwizzleBlock32_c(u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern void __fastcall SwizzleBlock16_c(u8* dst, u8* src, int srcpitch);
extern void __fastcall SwizzleBlock8_c(u8* dst, u8* src, int srcpitch);
extern void __fastcall SwizzleBlock4_c(u8* dst, u8* src, int srcpitch);
extern void __fastcall SwizzleBlock16_c(u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern void __fastcall SwizzleBlock8_c(u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern void __fastcall SwizzleBlock4_c(u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
// no AA
extern void __fastcall FrameSwizzleBlock32_c(u32* dst, u32* src, int srcpitch, u32 WriteMask);
@ -92,9 +92,9 @@ extern void __fastcall Frame16SwizzleBlock16A4_c(u16* dst, Vector_16F* src, int
extern void __fastcall Frame16SwizzleBlock16ZA4_c(u16* dst, Vector_16F* src, int srcpitch, u32 WriteMask);
extern void __fastcall SwizzleColumn32_c(int y, u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern void __fastcall SwizzleColumn16_c(int y, u8* dst, u8* src, int srcpitch);
extern void __fastcall SwizzleColumn8_c(int y, u8* dst, u8* src, int srcpitch);
extern void __fastcall SwizzleColumn4_c(int y, u8* dst, u8* src, int srcpitch);
extern void __fastcall SwizzleColumn16_c(int y, u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern void __fastcall SwizzleColumn8_c(int y, u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern void __fastcall SwizzleColumn4_c(int y, u8* dst, u8* src, int srcpitch, u32 WriteMask = 0xffffffff);
extern "C" void __fastcall WriteCLUT_T16_I8_CSM1_sse2(u32* vm, u32* clut);
extern "C" void __fastcall WriteCLUT_T32_I8_CSM1_sse2(u32* vm, u32* clut);