mirror of https://github.com/PCSX2/pcsx2.git
zzogl-pg: remove an unneccessary structure.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3524 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
b5f1ef528a
commit
30a911f9f8
|
@ -92,7 +92,7 @@ static __forceinline const T* AlignOnBlockBoundry(TransferData data, TransferFun
|
|||
transwidth = data.widthlimit;
|
||||
}
|
||||
|
||||
pbuf = TransmitHostLocalY<T>(data, fun.wp, transwidth, endY, pbuf);
|
||||
pbuf = TransmitHostLocalY<T>(data.psm, fun.wp, transwidth, endY, pbuf);
|
||||
|
||||
if (pbuf == NULL) return NULL;
|
||||
|
||||
|
@ -134,7 +134,7 @@ static __forceinline const T* TransferAligningToBlocks(TransferData data, Transf
|
|||
/* transfer the rest */
|
||||
if (alignedPt.x < gs.imageEndX)
|
||||
{
|
||||
pbuf = TransmitHostLocalX<T>(data, fun.wp, data.widthlimit, data.blockheight, alignedPt.x, pbuf);
|
||||
pbuf = TransmitHostLocalX<T>(data.psm, fun.wp, data.widthlimit, data.blockheight, alignedPt.x, pbuf);
|
||||
|
||||
if (pbuf == NULL) return NULL;
|
||||
|
||||
|
@ -201,7 +201,7 @@ static __forceinline int RealTransfer(TransferData data, TransferFuncts fun, con
|
|||
|
||||
if (TransPitch(nSize, data.transfersize) / 4 > 0)
|
||||
{
|
||||
pbuf = TransmitHostLocalY<T>(data, fun.wp, data.widthlimit, gs.imageEndY, pbuf);
|
||||
pbuf = TransmitHostLocalY<T>(data.psm, fun.wp, data.widthlimit, gs.imageEndY, pbuf);
|
||||
|
||||
if (pbuf == NULL) return FinishTransfer(data, nLeftOver);
|
||||
|
||||
|
@ -215,7 +215,7 @@ static __forceinline int RealTransfer(TransferData data, TransferFuncts fun, con
|
|||
//DEFINE_TRANSFERLOCAL(32, u32, 2, 32, 8, 8, _, SwizzleBlock32);
|
||||
int TransferHostLocal32(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(2, 32, 8, 8, 32, PSM_);
|
||||
TransferData data(2, 32, 8, 8, 32, PSMCT32);
|
||||
TransferFuncts fun(writePixel32_0, getPixelAddress32_0, SwizzleBlock32, SwizzleBlock32u);
|
||||
|
||||
return RealTransfer<u32>(data, fun, pbyMem, nQWordSize);
|
||||
|
@ -224,7 +224,7 @@ int TransferHostLocal32(const void* pbyMem, u32 nQWordSize)
|
|||
//DEFINE_TRANSFERLOCAL(32Z, u32, 2, 32, 8, 8, _, SwizzleBlock32);
|
||||
int TransferHostLocal32Z(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(2, 32, 8, 8, 32, PSM_);
|
||||
TransferData data(2, 32, 8, 8, 32, PSMT32Z);
|
||||
TransferFuncts fun(writePixel32Z_0, getPixelAddress32Z_0, SwizzleBlock32, SwizzleBlock32u);
|
||||
|
||||
return RealTransfer<u32>(data, fun, pbyMem, nQWordSize);
|
||||
|
@ -233,7 +233,7 @@ int TransferHostLocal32Z(const void* pbyMem, u32 nQWordSize)
|
|||
//DEFINE_TRANSFERLOCAL(24, u8, 8, 32, 8, 8, _24, SwizzleBlock24);
|
||||
int TransferHostLocal24(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(8, 32, 8, 8, 24, PSM_24_);
|
||||
TransferData data(8, 32, 8, 8, 24, PSMCT24);
|
||||
TransferFuncts fun(writePixel24_0, getPixelAddress24_0, SwizzleBlock24, SwizzleBlock24u);
|
||||
|
||||
return RealTransfer<u8>(data, fun, pbyMem, nQWordSize);
|
||||
|
@ -242,7 +242,7 @@ int TransferHostLocal24(const void* pbyMem, u32 nQWordSize)
|
|||
//DEFINE_TRANSFERLOCAL(24Z, u8, 8, 32, 8, 8, _24, SwizzleBlock24);
|
||||
int TransferHostLocal24Z(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(8, 32, 8, 8, 24, PSM_24_);
|
||||
TransferData data(8, 32, 8, 8, 24, PSMT24Z);
|
||||
TransferFuncts fun(writePixel24Z_0, getPixelAddress24Z_0, SwizzleBlock24, SwizzleBlock24u);
|
||||
|
||||
return RealTransfer<u8>(data, fun, pbyMem, nQWordSize);
|
||||
|
@ -251,7 +251,7 @@ int TransferHostLocal24Z(const void* pbyMem, u32 nQWordSize)
|
|||
//DEFINE_TRANSFERLOCAL(16, u16, 4, 16, 16, 8, _, SwizzleBlock16);
|
||||
int TransferHostLocal16(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(4, 16, 16, 8, 16, PSM_);
|
||||
TransferData data(4, 16, 16, 8, 16, PSMCT16);
|
||||
TransferFuncts fun(writePixel16_0, getPixelAddress16_0, SwizzleBlock16, SwizzleBlock16u);
|
||||
|
||||
return RealTransfer<u16>(data, fun, pbyMem, nQWordSize);
|
||||
|
@ -260,7 +260,7 @@ int TransferHostLocal16(const void* pbyMem, u32 nQWordSize)
|
|||
//DEFINE_TRANSFERLOCAL(16S, u16, 4, 16, 16, 8, _, SwizzleBlock16);
|
||||
int TransferHostLocal16S(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(4, 16, 16, 8, 16, PSM_);
|
||||
TransferData data(4, 16, 16, 8, 16, PSMCT16S);
|
||||
TransferFuncts fun(writePixel16S_0, getPixelAddress16S_0, SwizzleBlock16, SwizzleBlock16u);
|
||||
|
||||
return RealTransfer<u16>(data, fun, pbyMem, nQWordSize);
|
||||
|
@ -269,7 +269,7 @@ int TransferHostLocal16S(const void* pbyMem, u32 nQWordSize)
|
|||
//DEFINE_TRANSFERLOCAL(16Z, u16, 4, 16, 16, 8, _, SwizzleBlock16);
|
||||
int TransferHostLocal16Z(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(4, 16, 16, 8, 16, PSM_);
|
||||
TransferData data(4, 16, 16, 8, 16, PSMT16Z);
|
||||
TransferFuncts fun(writePixel16Z_0, getPixelAddress16Z_0, SwizzleBlock16, SwizzleBlock16u);
|
||||
|
||||
return RealTransfer<u16>(data, fun, pbyMem, nQWordSize);
|
||||
|
@ -278,7 +278,7 @@ int TransferHostLocal16Z(const void* pbyMem, u32 nQWordSize)
|
|||
//DEFINE_TRANSFERLOCAL(16SZ, u16, 4, 16, 16, 8, _, SwizzleBlock16);
|
||||
int TransferHostLocal16SZ(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(4, 16, 16, 8, 16, PSM_);
|
||||
TransferData data(4, 16, 16, 8, 16, PSMT16SZ);
|
||||
TransferFuncts fun(writePixel16SZ_0, getPixelAddress16SZ_0, SwizzleBlock16, SwizzleBlock16u);
|
||||
|
||||
return RealTransfer<u16>(data, fun, pbyMem, nQWordSize);
|
||||
|
@ -287,7 +287,7 @@ int TransferHostLocal16SZ(const void* pbyMem, u32 nQWordSize)
|
|||
//DEFINE_TRANSFERLOCAL(8, u8, 4, 8, 16, 16, _, SwizzleBlock8);
|
||||
int TransferHostLocal8(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(4, 8, 16, 16, 8, PSM_);
|
||||
TransferData data(4, 8, 16, 16, 8, PSMT8);
|
||||
TransferFuncts fun(writePixel8_0, getPixelAddress8_0, SwizzleBlock8, SwizzleBlock8u);
|
||||
|
||||
return RealTransfer<u8>(data, fun, pbyMem, nQWordSize);
|
||||
|
@ -296,7 +296,7 @@ int TransferHostLocal8(const void* pbyMem, u32 nQWordSize)
|
|||
//DEFINE_TRANSFERLOCAL(4, u8, 8, 4, 32, 16, _4, SwizzleBlock4);
|
||||
int TransferHostLocal4(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(8, 4, 32, 16, 4, PSM_4_);
|
||||
TransferData data(8, 4, 32, 16, 4, PSMT4);
|
||||
TransferFuncts fun(writePixel4_0, getPixelAddress4_0, SwizzleBlock4, SwizzleBlock4u);
|
||||
|
||||
return RealTransfer<u8>(data, fun, pbyMem, nQWordSize);
|
||||
|
@ -305,7 +305,7 @@ int TransferHostLocal4(const void* pbyMem, u32 nQWordSize)
|
|||
//DEFINE_TRANSFERLOCAL(8H, u8, 4, 32, 8, 8, _, SwizzleBlock8H);
|
||||
int TransferHostLocal8H(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(4, 32, 8, 8, 8, PSM_);
|
||||
TransferData data(4, 32, 8, 8, 8, PSMT8H);
|
||||
TransferFuncts fun(writePixel8H_0, getPixelAddress8H_0, SwizzleBlock8H, SwizzleBlock8Hu);
|
||||
|
||||
return RealTransfer<u8>(data, fun, pbyMem, nQWordSize);
|
||||
|
@ -314,7 +314,7 @@ int TransferHostLocal8H(const void* pbyMem, u32 nQWordSize)
|
|||
//DEFINE_TRANSFERLOCAL(4HL, u8, 8, 32, 8, 8, _4, SwizzleBlock4HL);
|
||||
int TransferHostLocal4HL(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(8, 32, 8, 8, 4, PSM_4_);
|
||||
TransferData data(8, 32, 8, 8, 4, PSMT4HL);
|
||||
TransferFuncts fun(writePixel4HL_0, getPixelAddress4HL_0, SwizzleBlock4HL, SwizzleBlock4HLu);
|
||||
|
||||
return RealTransfer<u8>(data, fun, pbyMem, nQWordSize);
|
||||
|
@ -323,7 +323,7 @@ int TransferHostLocal4HL(const void* pbyMem, u32 nQWordSize)
|
|||
//DEFINE_TRANSFERLOCAL(4HH, u8, 8, 32, 8, 8, _4, SwizzleBlock4HH);
|
||||
int TransferHostLocal4HH(const void* pbyMem, u32 nQWordSize)
|
||||
{
|
||||
TransferData data(8, 32, 8, 8, 4, PSM_4_);
|
||||
TransferData data(8, 32, 8, 8, 4, PSMT4HH);
|
||||
TransferFuncts fun(writePixel4HH_0, getPixelAddress4HH_0, SwizzleBlock4HH, SwizzleBlock4HHu);
|
||||
|
||||
return RealTransfer<u8>(data, fun, pbyMem, nQWordSize);
|
||||
|
|
|
@ -48,13 +48,6 @@ extern _getPixelAddress_0 getPixelFun_0[64];
|
|||
extern _writePixel_0 writePixelFun_0[64];
|
||||
extern _readPixel_0 readPixelFun_0[64];
|
||||
|
||||
enum Psm_Size
|
||||
{
|
||||
PSM_ = 0,
|
||||
PSM_4_,
|
||||
PSM_24_
|
||||
};
|
||||
|
||||
// Both of the following structs should probably be local class variables or in a namespace,
|
||||
// but this works for the moment.
|
||||
|
||||
|
@ -66,8 +59,8 @@ struct TransferData
|
|||
u32 blockwidth;
|
||||
u32 blockheight;
|
||||
u32 transfersize;
|
||||
Psm_Size psm;
|
||||
__forceinline TransferData(u32 limit, u32 bits, u32 width, u32 height, u32 size, Psm_Size ps)
|
||||
u32 psm;
|
||||
__forceinline TransferData(u32 limit, u32 bits, u32 width, u32 height, u32 size, u32 ps)
|
||||
{
|
||||
widthlimit = limit;
|
||||
blockbits = bits;
|
||||
|
|
|
@ -259,6 +259,15 @@ u32 g_pageTable4[128][128];
|
|||
32Z, 24Z, 16Z, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, 16SZ, NULL, NULL, NULL, NULL, NULL };
|
||||
*/
|
||||
char* psm_name[64] =
|
||||
{ "PSMCT32", "PSMCT24", "PSMCT16", NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, "PSMCT16S", NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, "PSMT8", "PSMT4", NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, "PSMT8H", NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, "PSMT4HL", NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, "PSMT4HH", NULL, NULL, NULL,
|
||||
"PSMT32Z", "PSMT24Z", "PSMT16Z", NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, "PSMT16SZ", NULL, NULL, NULL, NULL, NULL };
|
||||
|
||||
_getPixelAddress_0 getPixelFun_0[64] =
|
||||
{
|
||||
|
|
|
@ -29,6 +29,8 @@ extern int pitch, area, fracX;
|
|||
extern int nSize;
|
||||
extern u8* pstart;
|
||||
|
||||
extern char* psm_name[64];
|
||||
|
||||
// transfers whole rows
|
||||
template <class T>
|
||||
static __forceinline const T *TransmitHostLocalY_(_writePixel_0 wp, s32 widthlimit, int endY, const T *buf)
|
||||
|
@ -213,18 +215,17 @@ static __forceinline const T *TransmitHostLocalY_4(_writePixel_0 wp, s32 widthli
|
|||
}
|
||||
|
||||
template <class T>
|
||||
static __forceinline const T *TransmitHostLocalY(TransferData data, _writePixel_0 wp, s32 widthlimit, int endY, const T *buf)
|
||||
static __forceinline const T *TransmitHostLocalY(u32 psm, _writePixel_0 wp, s32 widthlimit, int endY, const T *buf)
|
||||
{
|
||||
switch (data.psm)
|
||||
//ZZLog::WriteLn("TransmitHostLocalY: psm == %s, bimode == 0x%x", psm_name[psm], PSMT_BITMODE(psm));
|
||||
switch (PSMT_BITMODE(psm))
|
||||
{
|
||||
case PSM_:
|
||||
return TransmitHostLocalY_<T>(wp, widthlimit, endY, buf);
|
||||
|
||||
case PSM_4_:
|
||||
return TransmitHostLocalY_4<T>(wp, widthlimit, endY, buf);
|
||||
|
||||
case PSM_24_:
|
||||
case 1:
|
||||
return TransmitHostLocalY_24<T>(wp, widthlimit, endY, buf);
|
||||
case 4:
|
||||
return TransmitHostLocalY_4<T>(wp, widthlimit, endY, buf);
|
||||
default:
|
||||
return TransmitHostLocalY_<T>(wp, widthlimit, endY, buf);
|
||||
}
|
||||
|
||||
assert(0);
|
||||
|
@ -284,18 +285,17 @@ static __forceinline const T *TransmitHostLocalX_4(_writePixel_0 wp, u32 widthli
|
|||
}
|
||||
|
||||
template <class T>
|
||||
static __forceinline const T *TransmitHostLocalX(TransferData data, _writePixel_0 wp, u32 widthlimit, u32 blockheight, u32 startX, const T *buf)
|
||||
static __forceinline const T *TransmitHostLocalX(u32 psm, _writePixel_0 wp, u32 widthlimit, u32 blockheight, u32 startX, const T *buf)
|
||||
{
|
||||
switch (data.psm)
|
||||
//ZZLog::WriteLn("TransmitHostLocalX: psm == %s, bimode == 0x%x", psm_name[psm], PSMT_BITMODE(psm));
|
||||
switch (PSMT_BITMODE(psm))
|
||||
{
|
||||
case PSM_:
|
||||
return TransmitHostLocalX_<T>(wp, widthlimit, blockheight, startX, buf);
|
||||
|
||||
case PSM_4_:
|
||||
return TransmitHostLocalX_4<T>(wp, widthlimit, blockheight, startX, buf);
|
||||
|
||||
case PSM_24_:
|
||||
case 1:
|
||||
return TransmitHostLocalX_24<T>(wp, widthlimit, blockheight, startX, buf);
|
||||
case 4:
|
||||
return TransmitHostLocalX_4<T>(wp, widthlimit, blockheight, startX, buf);
|
||||
default:
|
||||
return TransmitHostLocalX_<T>(wp, widthlimit, blockheight, startX, buf);
|
||||
}
|
||||
|
||||
assert(0);
|
||||
|
|
Loading…
Reference in New Issue