mirror of https://github.com/PCSX2/pcsx2.git
zzogl-pg: Work on GetRectMemAddress.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3639 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
e4eec943de
commit
699e623998
|
@ -42,6 +42,8 @@ using namespace std;
|
||||||
#include <X11/extensions/xf86vmode.h>
|
#include <X11/extensions/xf86vmode.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MEMORY_END 0x00400000
|
||||||
|
|
||||||
class GLWindow
|
class GLWindow
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -312,6 +314,24 @@ enum PSM_value
|
||||||
// 16, 16S, 16Z, 16SZ -- 2, PSMT8 and 8H - 3, PSMT4, 4HL, 4HH -- 4.
|
// 16, 16S, 16Z, 16SZ -- 2, PSMT8 and 8H - 3, PSMT4, 4HL, 4HH -- 4.
|
||||||
inline int PSMT_BITMODE(int psm) {return (psm & 0x7);}
|
inline int PSMT_BITMODE(int psm) {return (psm & 0x7);}
|
||||||
|
|
||||||
|
inline int PSMT_BITS_NUM(int psm)
|
||||||
|
{
|
||||||
|
switch (PSMT_BITMODE(psm))
|
||||||
|
{
|
||||||
|
case 4:
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
return 2;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// CLUT = Color look up table. Set proper color to table according CLUT table.
|
// CLUT = Color look up table. Set proper color to table according CLUT table.
|
||||||
// Used for PSMT8, PSMT8H, PSMT4, PSMT4HH, PSMT4HL textures
|
// Used for PSMT8, PSMT8H, PSMT4, PSMT4HH, PSMT4HL textures
|
||||||
inline bool PSMT_ISCLUT(int psm) { return (PSMT_BITMODE(psm) > 2);}
|
inline bool PSMT_ISCLUT(int psm) { return (PSMT_BITMODE(psm) > 2);}
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#include "zerogs.h"
|
#include "zerogs.h"
|
||||||
#include "targets.h"
|
#include "targets.h"
|
||||||
|
|
||||||
|
extern _getPixelAddress getPixelFun[64];
|
||||||
|
|
||||||
namespace ZeroGS
|
namespace ZeroGS
|
||||||
{
|
{
|
||||||
extern CRangeManager s_RangeMngr; // manages overwritten memory
|
extern CRangeManager s_RangeMngr; // manages overwritten memory
|
||||||
|
@ -38,57 +40,59 @@
|
||||||
void GetRectMemAddress(int& start, int& end, int psm, int x, int y, int w, int h, int bp, int bw)
|
void GetRectMemAddress(int& start, int& end, int psm, int x, int y, int w, int h, int bp, int bw)
|
||||||
{
|
{
|
||||||
FUNCLOG
|
FUNCLOG
|
||||||
|
u32 bits = 0;
|
||||||
|
|
||||||
if (m_Blocks[psm].bpp == 0)
|
if (m_Blocks[psm].bpp == 0)
|
||||||
{
|
{
|
||||||
ZZLog::Error_Log("ZeroGS: Bad psm 0x%x.", psm);
|
ZZLog::Error_Log("ZeroGS: Bad psm 0x%x.", psm);
|
||||||
start = 0;
|
start = 0;
|
||||||
end = 0x00400000;
|
end = MEMORY_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PSMT_ISZTEX(psm) || psm == PSMCT16S)
|
if (PSMT_ISZTEX(psm))
|
||||||
{
|
{
|
||||||
|
// Somehow, I doubt this code is right. I'll have to look into it. For the moment, I'm keeping it the
|
||||||
|
// way it was. --arcum42
|
||||||
|
|
||||||
const BLOCK& b = m_Blocks[psm];
|
const BLOCK& b = m_Blocks[psm];
|
||||||
|
|
||||||
bw = (bw + b.width - 1) / b.width;
|
bw = (bw + b.width - 1) / b.width;
|
||||||
start = bp * 256 + ((y / b.height) * bw + (x / b.width)) * 0x2000;
|
start = bp * 256 + ((y / b.height) * bw + (x / b.width)) * 0x2000;
|
||||||
end = bp * 256 + (((y + h - 1) / b.height) * bw + (x + w + b.width - 1) / b.width) * 0x2000;
|
end = bp * 256 + (((y + h - 1) / b.height) * bw + (x + w + b.width - 1) / b.width) * 0x2000;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// For some reason, we have to treat these as 32 bit.
|
||||||
|
if ((psm == PSMT8H) || (psm == PSMT4HL) || (psm == PSMT4HH))
|
||||||
|
{
|
||||||
|
bits = 4;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bits = PSMT_BITS_NUM(psm);
|
||||||
|
}
|
||||||
|
|
||||||
|
start = getPixelFun[psm](x, y, bp, bw);
|
||||||
|
end = getPixelFun[psm](x + w - 1, y + h - 1, bp, bw) + 1;
|
||||||
|
|
||||||
|
if (bits > 0)
|
||||||
|
{
|
||||||
|
start *= bits;
|
||||||
|
end *= bits;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// just take the addresses
|
// This is what it used to do, which doesn't seem right.
|
||||||
switch (psm)
|
// Keeping it for reference, in case removing it breaks anything.
|
||||||
{
|
|
||||||
case PSMCT32:
|
//int newx = ((x + w - 1 + 31) & ~31) - 1;
|
||||||
case PSMCT24:
|
//int newy = ((y + h - 1 + 15) & ~15) - 1;
|
||||||
case PSMT8H:
|
//start = getPixelAddress4(x, y, bp, bw) / 2;
|
||||||
case PSMT4HL:
|
//end = (getPixelAddress4(max(newx, x), max(newy, y), bp, bw) + 2) / 2;
|
||||||
case PSMT4HH:
|
|
||||||
start = 4 * getPixelAddress32(x, y, bp, bw);
|
start /= 2;
|
||||||
end = 4 * getPixelAddress32(x + w - 1, y + h - 1, bp, bw) + 4;
|
end /= 2;
|
||||||
break;
|
|
||||||
|
|
||||||
case PSMCT16:
|
|
||||||
start = 2 * getPixelAddress16(x, y, bp, bw);
|
|
||||||
end = 2 * getPixelAddress16(x + w - 1, y + h - 1, bp, bw) + 2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PSMT8:
|
|
||||||
start = getPixelAddress8(x, y, bp, bw);
|
|
||||||
end = getPixelAddress8(x + w - 1, y + h - 1, bp, bw) + 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PSMT4:
|
|
||||||
{
|
|
||||||
start = getPixelAddress4(x, y, bp, bw) / 2;
|
|
||||||
int newx = ((x + w - 1 + 31) & ~31) - 1;
|
|
||||||
int newy = ((y + h - 1 + 15) & ~15) - 1;
|
|
||||||
end = (getPixelAddress4(max(newx, x), max(newy, y), bp, bw) + 2) / 2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,6 +118,7 @@
|
||||||
|
|
||||||
assert(gs.imageEndX < 2048 && gs.imageEndY < 2048);
|
assert(gs.imageEndX < 2048 && gs.imageEndY < 2048);
|
||||||
|
|
||||||
|
// This needs to be looked in to, since psm should *not* be 63.
|
||||||
// hack! viewful joe
|
// hack! viewful joe
|
||||||
if (gs.dstbuf.psm == 63) gs.dstbuf.psm = 0;
|
if (gs.dstbuf.psm == 63) gs.dstbuf.psm = 0;
|
||||||
|
|
||||||
|
@ -121,11 +126,11 @@
|
||||||
|
|
||||||
GetRectMemAddress(start, end, gs.dstbuf.psm, gs.trxpos.dx, gs.trxpos.dy, gs.imageWnew, gs.imageHnew, gs.dstbuf.bp, gs.dstbuf.bw);
|
GetRectMemAddress(start, end, gs.dstbuf.psm, gs.trxpos.dx, gs.trxpos.dy, gs.imageWnew, gs.imageHnew, gs.dstbuf.bp, gs.dstbuf.bw);
|
||||||
|
|
||||||
if (end > 0x00400000)
|
if (end > MEMORY_END)
|
||||||
{
|
{
|
||||||
ZZLog::Warn_Log("Host local out of bounds!");
|
ZZLog::Warn_Log("Host local out of bounds!");
|
||||||
//gs.imageTransfer = -1;
|
//gs.imageTransfer = -1;
|
||||||
end = 0x00400000;
|
end = MEMORY_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
gs_imageEnd = end;
|
gs_imageEnd = end;
|
||||||
|
|
|
@ -302,6 +302,18 @@ _getPixelAddress_0 getPixelFun_0[64] =
|
||||||
NULL, NULL, getPixelAddress16SZ_0, NULL, NULL, NULL, NULL, NULL
|
NULL, NULL, getPixelAddress16SZ_0, NULL, NULL, NULL, NULL, NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_getPixelAddress getPixelFun[64] =
|
||||||
|
{
|
||||||
|
getPixelAddress32, getPixelAddress24, getPixelAddress16, NULL, NULL, NULL, NULL, NULL,
|
||||||
|
NULL, NULL, getPixelAddress16S, NULL, NULL, NULL, NULL, NULL,
|
||||||
|
NULL, NULL, NULL, getPixelAddress8, getPixelAddress4, NULL, NULL, NULL,
|
||||||
|
NULL, NULL, NULL, getPixelAddress8H, NULL, NULL, NULL, NULL,
|
||||||
|
NULL, NULL, NULL, NULL, getPixelAddress4HL, NULL, NULL, NULL,
|
||||||
|
NULL, NULL, NULL, NULL, getPixelAddress4HH, NULL, NULL, NULL,
|
||||||
|
getPixelAddress32Z, getPixelAddress24Z, getPixelAddress16Z, NULL, NULL, NULL, NULL, NULL,
|
||||||
|
NULL, NULL, getPixelAddress16SZ, NULL, NULL, NULL, NULL, NULL
|
||||||
|
};
|
||||||
|
|
||||||
_writePixel_0 writePixelFun_0[64] =
|
_writePixel_0 writePixelFun_0[64] =
|
||||||
{
|
{
|
||||||
writePixel32_0, writePixel24_0, writePixel16_0, NULL, NULL, NULL, NULL, NULL,
|
writePixel32_0, writePixel24_0, writePixel16_0, NULL, NULL, NULL, NULL, NULL,
|
||||||
|
|
|
@ -47,7 +47,7 @@ extern u32 s_uTex1Data[2][2], s_uClampData[2];
|
||||||
int ZeroGS::Save(s8* pbydata)
|
int ZeroGS::Save(s8* pbydata)
|
||||||
{
|
{
|
||||||
if (pbydata == NULL)
|
if (pbydata == NULL)
|
||||||
return 40 + 0x00400000 + sizeof(gs) + 2*VBSAVELIMIT + 2*sizeof(frameInfo) + 4 + 256*4;
|
return 40 + MEMORY_END + sizeof(gs) + 2*VBSAVELIMIT + 2*sizeof(frameInfo) + 4 + 256*4;
|
||||||
|
|
||||||
s_RTs.ResolveAll();
|
s_RTs.ResolveAll();
|
||||||
s_DepthRTs.ResolveAll();
|
s_DepthRTs.ResolveAll();
|
||||||
|
@ -64,8 +64,8 @@ int ZeroGS::Save(s8* pbydata)
|
||||||
|
|
||||||
pbydata += 4;
|
pbydata += 4;
|
||||||
|
|
||||||
memcpy(pbydata, g_pbyGSMemory, 0x00400000);
|
memcpy(pbydata, g_pbyGSMemory, MEMORY_END);
|
||||||
pbydata += 0x00400000;
|
pbydata += MEMORY_END;
|
||||||
|
|
||||||
memcpy(pbydata, g_pbyGSClut, 256*4);
|
memcpy(pbydata, g_pbyGSClut, 256*4);
|
||||||
pbydata += 256 * 4;
|
pbydata += 256 * 4;
|
||||||
|
@ -109,8 +109,8 @@ bool ZeroGS::Load(s8* pbydata)
|
||||||
savelimit = *(u32*)pbydata;
|
savelimit = *(u32*)pbydata;
|
||||||
pbydata += 4;
|
pbydata += 4;
|
||||||
|
|
||||||
memcpy(g_pbyGSMemory, pbydata, 0x00400000);
|
memcpy(g_pbyGSMemory, pbydata, MEMORY_END);
|
||||||
pbydata += 0x00400000;
|
pbydata += MEMORY_END;
|
||||||
|
|
||||||
memcpy(g_pbyGSClut, pbydata, 256*4);
|
memcpy(g_pbyGSClut, pbydata, 256*4);
|
||||||
pbydata += 256 * 4;
|
pbydata += 256 * 4;
|
||||||
|
|
|
@ -417,7 +417,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
{
|
{
|
||||||
case PSMCT32:
|
case PSMCT32:
|
||||||
addr = getPixelAddress32(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress32(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (addr * 4 < 0x00400000)
|
if (addr * 4 < MEMORY_END)
|
||||||
u = readPixel32(psrc, j, i, ptex->tbp0, ptex->tbw);
|
u = readPixel32(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||||
else
|
else
|
||||||
u = 0;
|
u = 0;
|
||||||
|
@ -425,7 +425,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
|
|
||||||
case PSMCT24:
|
case PSMCT24:
|
||||||
addr = getPixelAddress24(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress24(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (addr * 4 < 0x00400000)
|
if (addr * 4 < MEMORY_END)
|
||||||
u = readPixel24(psrc, j, i, ptex->tbp0, ptex->tbw);
|
u = readPixel24(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||||
else
|
else
|
||||||
u = 0;
|
u = 0;
|
||||||
|
@ -433,7 +433,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
|
|
||||||
case PSMCT16:
|
case PSMCT16:
|
||||||
addr = getPixelAddress16(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress16(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (addr * 2 < 0x00400000)
|
if (addr * 2 < MEMORY_END)
|
||||||
{
|
{
|
||||||
u = readPixel16(psrc, j, i, ptex->tbp0, ptex->tbw);
|
u = readPixel16(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||||
u = RGBA16to32(u);
|
u = RGBA16to32(u);
|
||||||
|
@ -446,7 +446,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
|
|
||||||
case PSMCT16S:
|
case PSMCT16S:
|
||||||
addr = getPixelAddress16(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress16(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (addr * 2 < 0x00400000)
|
if (addr * 2 < MEMORY_END)
|
||||||
{
|
{
|
||||||
u = readPixel16S(psrc, j, i, ptex->tbp0, ptex->tbw);
|
u = readPixel16S(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||||
u = RGBA16to32(u);
|
u = RGBA16to32(u);
|
||||||
|
@ -459,7 +459,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
|
|
||||||
case PSMT8:
|
case PSMT8:
|
||||||
addr = getPixelAddress8(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress8(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (addr < 0x00400000)
|
if (addr < MEMORY_END)
|
||||||
{
|
{
|
||||||
if (usevid)
|
if (usevid)
|
||||||
{
|
{
|
||||||
|
@ -481,7 +481,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
|
|
||||||
case PSMT4:
|
case PSMT4:
|
||||||
addr = getPixelAddress4(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress4(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (addr < 2*0x00400000)
|
if (addr < 2*MEMORY_END)
|
||||||
{
|
{
|
||||||
if (usevid)
|
if (usevid)
|
||||||
{
|
{
|
||||||
|
@ -504,7 +504,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
|
|
||||||
case PSMT8H:
|
case PSMT8H:
|
||||||
addr = getPixelAddress8H(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress8H(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (4*addr < 0x00400000)
|
if (4*addr < MEMORY_END)
|
||||||
{
|
{
|
||||||
if (usevid)
|
if (usevid)
|
||||||
{
|
{
|
||||||
|
@ -526,7 +526,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
|
|
||||||
case PSMT4HL:
|
case PSMT4HL:
|
||||||
addr = getPixelAddress4HL(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress4HL(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (4*addr < 0x00400000)
|
if (4*addr < MEMORY_END)
|
||||||
{
|
{
|
||||||
if (usevid)
|
if (usevid)
|
||||||
{
|
{
|
||||||
|
@ -548,7 +548,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
|
|
||||||
case PSMT4HH:
|
case PSMT4HH:
|
||||||
addr = getPixelAddress4HH(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress4HH(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (4*addr < 0x00400000)
|
if (4*addr < MEMORY_END)
|
||||||
{
|
{
|
||||||
if (usevid)
|
if (usevid)
|
||||||
{
|
{
|
||||||
|
@ -570,7 +570,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
|
|
||||||
case PSMT32Z:
|
case PSMT32Z:
|
||||||
addr = getPixelAddress32Z(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress32Z(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (4*addr < 0x00400000)
|
if (4*addr < MEMORY_END)
|
||||||
u = readPixel32Z(psrc, j, i, ptex->tbp0, ptex->tbw);
|
u = readPixel32Z(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||||
else
|
else
|
||||||
u = 0;
|
u = 0;
|
||||||
|
@ -578,7 +578,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
|
|
||||||
case PSMT24Z:
|
case PSMT24Z:
|
||||||
addr = getPixelAddress24Z(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress24Z(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (4*addr < 0x00400000)
|
if (4*addr < MEMORY_END)
|
||||||
u = readPixel24Z(psrc, j, i, ptex->tbp0, ptex->tbw);
|
u = readPixel24Z(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||||
else
|
else
|
||||||
u = 0;
|
u = 0;
|
||||||
|
@ -586,7 +586,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
|
|
||||||
case PSMT16Z:
|
case PSMT16Z:
|
||||||
addr = getPixelAddress16Z(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress16Z(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (2*addr < 0x00400000)
|
if (2*addr < MEMORY_END)
|
||||||
u = readPixel16Z(psrc, j, i, ptex->tbp0, ptex->tbw);
|
u = readPixel16Z(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||||
else
|
else
|
||||||
u = 0;
|
u = 0;
|
||||||
|
@ -594,7 +594,7 @@ ZeroGS::SaveTex(tex0Info* ptex, int usevid)
|
||||||
|
|
||||||
case PSMT16SZ:
|
case PSMT16SZ:
|
||||||
addr = getPixelAddress16SZ(j, i, ptex->tbp0, ptex->tbw);
|
addr = getPixelAddress16SZ(j, i, ptex->tbp0, ptex->tbw);
|
||||||
if (2*addr < 0x00400000)
|
if (2*addr < MEMORY_END)
|
||||||
u = readPixel16SZ(psrc, j, i, ptex->tbp0, ptex->tbw);
|
u = readPixel16SZ(psrc, j, i, ptex->tbp0, ptex->tbw);
|
||||||
else
|
else
|
||||||
u = 0;
|
u = 0;
|
||||||
|
|
|
@ -1979,7 +1979,7 @@ void MemoryTarget_GetMemAddress(int& start, int& end, const tex0Info& tex0)
|
||||||
int nbStart, nbEnd;
|
int nbStart, nbEnd;
|
||||||
GetRectMemAddress(nbStart, nbEnd, tex0.psm, 0, 0, tex0.tw, tex0.th, tex0.tbp0, tex0.tbw);
|
GetRectMemAddress(nbStart, nbEnd, tex0.psm, 0, 0, tex0.tw, tex0.th, tex0.tbp0, tex0.tbw);
|
||||||
assert(nbStart < nbEnd);
|
assert(nbStart < nbEnd);
|
||||||
nbEnd = min(nbEnd, 0x00400000);
|
nbEnd = min(nbEnd, MEMORY_END);
|
||||||
|
|
||||||
start = nbStart / (4 * GPU_TEXWIDTH);
|
start = nbStart / (4 * GPU_TEXWIDTH);
|
||||||
end = (nbEnd + GPU_TEXWIDTH * 4 - 1) / (4 * GPU_TEXWIDTH);
|
end = (nbEnd + GPU_TEXWIDTH * 4 - 1) / (4 * GPU_TEXWIDTH);
|
||||||
|
@ -2947,7 +2947,7 @@ void FlushTransferRanges(const tex0Info* ptex)
|
||||||
\
|
\
|
||||||
Tsrc* src = (Tsrc*)(psrc); \
|
Tsrc* src = (Tsrc*)(psrc); \
|
||||||
T* pPageOffset = (T*)g_pbyGSMemory + fbp*(256/sizeof(T)), *dst; \
|
T* pPageOffset = (T*)g_pbyGSMemory + fbp*(256/sizeof(T)), *dst; \
|
||||||
int maxfbh = (0x00400000-fbp*256) / (sizeof(T) * fbw); \
|
int maxfbh = (MEMORY_END-fbp*256) / (sizeof(T) * fbw); \
|
||||||
if( maxfbh > fbh ) maxfbh = fbh; \
|
if( maxfbh > fbh ) maxfbh = fbh; \
|
||||||
\
|
\
|
||||||
for(int i = 0; i < maxfbh; ++i) { \
|
for(int i = 0; i < maxfbh; ++i) { \
|
||||||
|
@ -3092,7 +3092,7 @@ void _Resolve(const void* psrc, int fbp, int fbw, int fbh, int psm, u32 fbm, boo
|
||||||
Tsrc* src = (Tsrc*)(psrc); \
|
Tsrc* src = (Tsrc*)(psrc); \
|
||||||
T* pPageOffset = (T*)g_pbyGSMemory + fbp*(256/sizeof(T)), *dst; \
|
T* pPageOffset = (T*)g_pbyGSMemory + fbp*(256/sizeof(T)), *dst; \
|
||||||
int srcpitch = Pitch(fbw) * blockheight/sizeof(Tsrc); \
|
int srcpitch = Pitch(fbw) * blockheight/sizeof(Tsrc); \
|
||||||
int maxfbh = (0x00400000-fbp*256) / (sizeof(T) * fbw); \
|
int maxfbh = (MEMORY_END-fbp*256) / (sizeof(T) * fbw); \
|
||||||
if( maxfbh > fbh ) maxfbh = fbh; \
|
if( maxfbh > fbh ) maxfbh = fbh; \
|
||||||
for(i = 0; i < (maxfbh&~(blockheight-1))*X; i += blockheight) { \
|
for(i = 0; i < (maxfbh&~(blockheight-1))*X; i += blockheight) { \
|
||||||
/*if( smask2 && (i&1) == smask1 ) continue; */ \
|
/*if( smask2 && (i&1) == smask1 ) continue; */ \
|
||||||
|
|
|
@ -166,7 +166,7 @@ class ZeroGSInit
|
||||||
public:
|
public:
|
||||||
ZeroGSInit()
|
ZeroGSInit()
|
||||||
{
|
{
|
||||||
const u32 mem_size = 0x00400000 + 0x10000; // leave some room for out of range accesses (saves on the checks)
|
const u32 mem_size = MEMORY_END + 0x10000; // leave some room for out of range accesses (saves on the checks)
|
||||||
// clear
|
// clear
|
||||||
g_pbyGSMemory = (u8*)_aligned_malloc(mem_size, 1024);
|
g_pbyGSMemory = (u8*)_aligned_malloc(mem_size, 1024);
|
||||||
memset(g_pbyGSMemory, 0, mem_size);
|
memset(g_pbyGSMemory, 0, mem_size);
|
||||||
|
|
Loading…
Reference in New Issue