mirror of https://github.com/PCSX2/pcsx2.git
GSdx: Add support for the new hack-free GSgifTransfer callback, which will supercede the various hacky GSgifTransfer1/2/3 callbacks in use now. This version of GSdx will be *REQUIRED* by PCSX2 soon.
DevNote for zzOgl coders: Implementation of this callback can just double up on m_path[0]. I used a separate instance at m_path[3] mostly because it was easier than trying to fight around the existing PATH1 nloop hack, which is still needed for backward compat with existing and earlier versions of PCSX2. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3454 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
b0ec1394d1
commit
e85da0dfe1
|
@ -319,6 +319,11 @@ EXPORT_C GSreadFIFO2(uint8* mem, uint32 size)
|
||||||
s_gs->ReadFIFO(mem, size);
|
s_gs->ReadFIFO(mem, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXPORT_C GSgifTransfer(uint8* mem, uint32 size)
|
||||||
|
{
|
||||||
|
s_gs->Transfer<3>(mem , size);
|
||||||
|
}
|
||||||
|
|
||||||
EXPORT_C GSgifTransfer1(uint8* mem, uint32 addr)
|
EXPORT_C GSgifTransfer1(uint8* mem, uint32 addr)
|
||||||
{
|
{
|
||||||
s_gs->Transfer<0>(mem + addr, (0x4000 - addr) / 16);
|
s_gs->Transfer<0>(mem + addr, (0x4000 - addr) / 16);
|
||||||
|
|
|
@ -35,7 +35,7 @@ GSState::GSState()
|
||||||
, m_path3hack(0)
|
, m_path3hack(0)
|
||||||
, m_q(1.0f)
|
, m_q(1.0f)
|
||||||
, m_vprim(1)
|
, m_vprim(1)
|
||||||
, m_version(5)
|
, m_version(6)
|
||||||
, m_frameskip(0)
|
, m_frameskip(0)
|
||||||
, m_vkf(NULL)
|
, m_vkf(NULL)
|
||||||
{
|
{
|
||||||
|
@ -85,7 +85,7 @@ GSState::GSState()
|
||||||
m_sssize += sizeof(m_tr.x);
|
m_sssize += sizeof(m_tr.x);
|
||||||
m_sssize += sizeof(m_tr.y);
|
m_sssize += sizeof(m_tr.y);
|
||||||
m_sssize += m_mem.m_vmsize;
|
m_sssize += m_mem.m_vmsize;
|
||||||
m_sssize += (sizeof(m_path[0].tag) + sizeof(m_path[0].reg)) * 3;
|
m_sssize += (sizeof(m_path[0].tag) + sizeof(m_path[0].reg)) * ArraySize(m_path);
|
||||||
m_sssize += sizeof(m_q);
|
m_sssize += sizeof(m_q);
|
||||||
|
|
||||||
PRIM = &m_env.PRIM;
|
PRIM = &m_env.PRIM;
|
||||||
|
@ -136,7 +136,7 @@ void GSState::SetMultithreaded( bool isMT )
|
||||||
|
|
||||||
void GSState::Reset()
|
void GSState::Reset()
|
||||||
{
|
{
|
||||||
memset(&m_path[0], 0, sizeof(m_path[0]) * 3);
|
memset(&m_path[0], 0, sizeof(m_path[0]) * ArraySize(m_path));
|
||||||
memset(&m_v, 0, sizeof(m_v));
|
memset(&m_v, 0, sizeof(m_v));
|
||||||
|
|
||||||
// PRIM = &m_env.PRIM;
|
// PRIM = &m_env.PRIM;
|
||||||
|
@ -1375,7 +1375,12 @@ void GSState::Move()
|
||||||
#endif
|
#endif
|
||||||
void GSState::SoftReset(uint32 mask)
|
void GSState::SoftReset(uint32 mask)
|
||||||
{
|
{
|
||||||
if(mask & 1) memset(&m_path[0], 0, sizeof(GIFPath));
|
if(mask & 1)
|
||||||
|
{
|
||||||
|
memset(&m_path[0], 0, sizeof(GIFPath));
|
||||||
|
memset(&m_path[3], 0, sizeof(GIFPath));
|
||||||
|
}
|
||||||
|
|
||||||
if(mask & 2) memset(&m_path[1], 0, sizeof(GIFPath));
|
if(mask & 2) memset(&m_path[1], 0, sizeof(GIFPath));
|
||||||
if(mask & 4) memset(&m_path[2], 0, sizeof(GIFPath));
|
if(mask & 4) memset(&m_path[2], 0, sizeof(GIFPath));
|
||||||
|
|
||||||
|
@ -1403,6 +1408,7 @@ void GSState::ReadFIFO(uint8* mem, int size)
|
||||||
template void GSState::Transfer<0>(uint8* mem, uint32 size);
|
template void GSState::Transfer<0>(uint8* mem, uint32 size);
|
||||||
template void GSState::Transfer<1>(uint8* mem, uint32 size);
|
template void GSState::Transfer<1>(uint8* mem, uint32 size);
|
||||||
template void GSState::Transfer<2>(uint8* mem, uint32 size);
|
template void GSState::Transfer<2>(uint8* mem, uint32 size);
|
||||||
|
template void GSState::Transfer<3>(uint8* mem, uint32 size);
|
||||||
|
|
||||||
template<int index> void GSState::Transfer(uint8* mem, uint32 size)
|
template<int index> void GSState::Transfer(uint8* mem, uint32 size)
|
||||||
{
|
{
|
||||||
|
@ -1658,7 +1664,7 @@ int GSState::Freeze(GSFreezeData* fd, bool sizeonly)
|
||||||
WriteState(data, &m_tr.y);
|
WriteState(data, &m_tr.y);
|
||||||
WriteState(data, m_mem.m_vm8, m_mem.m_vmsize);
|
WriteState(data, m_mem.m_vm8, m_mem.m_vmsize);
|
||||||
|
|
||||||
for(int i = 0; i < 3; i++)
|
for(int i = 0; i < ArraySize(m_path); i++)
|
||||||
{
|
{
|
||||||
m_path[i].tag.NREG = m_path[i].nreg;
|
m_path[i].tag.NREG = m_path[i].nreg;
|
||||||
m_path[i].tag.NLOOP = m_path[i].nloop;
|
m_path[i].tag.NLOOP = m_path[i].nloop;
|
||||||
|
@ -1753,7 +1759,7 @@ int GSState::Defrost(const GSFreezeData* fd)
|
||||||
|
|
||||||
m_tr.total = 0; // TODO: restore transfer state
|
m_tr.total = 0; // TODO: restore transfer state
|
||||||
|
|
||||||
for(int i = 0; i < 3; i++)
|
for(int i = 0; i < ArraySize(m_path); i++)
|
||||||
{
|
{
|
||||||
ReadState(&m_path[i].tag, data);
|
ReadState(&m_path[i].tag, data);
|
||||||
ReadState(&m_path[i].reg, data);
|
ReadState(&m_path[i].reg, data);
|
||||||
|
|
|
@ -196,7 +196,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GIFPath m_path[3];
|
GIFPath m_path[4];
|
||||||
GIFRegPRIM* PRIM;
|
GIFRegPRIM* PRIM;
|
||||||
GSPrivRegSet* m_regs;
|
GSPrivRegSet* m_regs;
|
||||||
GSLocalMemory m_mem;
|
GSLocalMemory m_mem;
|
||||||
|
|
|
@ -18,6 +18,7 @@ EXPORTS
|
||||||
GSreset
|
GSreset
|
||||||
GSwriteCSR
|
GSwriteCSR
|
||||||
GSgifSoftReset
|
GSgifSoftReset
|
||||||
|
GSgifTransfer
|
||||||
GSgifTransfer1
|
GSgifTransfer1
|
||||||
GSgifTransfer2
|
GSgifTransfer2
|
||||||
GSgifTransfer3
|
GSgifTransfer3
|
||||||
|
|
Loading…
Reference in New Issue