mirror of https://github.com/PCSX2/pcsx2.git
(minor optimization) Let's not even use the GS plugin's Path1 or Path3 parsers anymore. All GIFtags can be sent safely through the GS's hack-free Path2 instead.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3310 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
e8f5468491
commit
04e89783cd
|
@ -195,7 +195,7 @@ void __fastcall WriteFIFO_page_6(u32 mem, const mem128_t *value)
|
||||||
nloop0_packet[2] = psHu32(GIF_FIFO + 8);
|
nloop0_packet[2] = psHu32(GIF_FIFO + 8);
|
||||||
nloop0_packet[3] = psHu32(GIF_FIFO + 12);
|
nloop0_packet[3] = psHu32(GIF_FIFO + 12);
|
||||||
Registers::Freeze();
|
Registers::Freeze();
|
||||||
GetMTGS().PrepDataPacket(GIF_PATH_3, nloop0_packet, 1);
|
GetMTGS().PrepDataPacket(GIF_PATH_3, (u8*)nloop0_packet, 1);
|
||||||
u64* data = (u64*)GetMTGS().GetDataPacketPtr();
|
u64* data = (u64*)GetMTGS().GetDataPacketPtr();
|
||||||
data[0] = value[0];
|
data[0] = value[0];
|
||||||
data[1] = value[1];
|
data[1] = value[1];
|
||||||
|
|
|
@ -245,9 +245,7 @@ extern GS_RegionMode gsRegionMode;
|
||||||
|
|
||||||
enum MTGS_RingCommand
|
enum MTGS_RingCommand
|
||||||
{
|
{
|
||||||
GS_RINGTYPE_P1
|
GS_RINGTYPE_PATH // GIFpaths 1, 2, and 3
|
||||||
, GS_RINGTYPE_P2
|
|
||||||
, GS_RINGTYPE_P3
|
|
||||||
, GS_RINGTYPE_RESTART
|
, GS_RINGTYPE_RESTART
|
||||||
, GS_RINGTYPE_VSYNC
|
, GS_RINGTYPE_VSYNC
|
||||||
, GS_RINGTYPE_FRAMESKIP
|
, GS_RINGTYPE_FRAMESKIP
|
||||||
|
@ -319,7 +317,6 @@ public:
|
||||||
|
|
||||||
int PrepDataPacket( MTGS_RingCommand cmd, u32 size );
|
int PrepDataPacket( MTGS_RingCommand cmd, u32 size );
|
||||||
int PrepDataPacket( GIF_PATH pathidx, const u8* srcdata, u32 size );
|
int PrepDataPacket( GIF_PATH pathidx, const u8* srcdata, u32 size );
|
||||||
int PrepDataPacket( GIF_PATH pathidx, const u32* srcdata, u32 size );
|
|
||||||
void SendDataPacket();
|
void SendDataPacket();
|
||||||
void SendGameCRC( u32 crc );
|
void SendGameCRC( u32 crc );
|
||||||
void WaitForOpen();
|
void WaitForOpen();
|
||||||
|
|
|
@ -143,7 +143,7 @@ __forceinline void gsInterrupt()
|
||||||
|
|
||||||
static u32 WRITERING_DMA(u32 *pMem, u32 qwc)
|
static u32 WRITERING_DMA(u32 *pMem, u32 qwc)
|
||||||
{
|
{
|
||||||
int size = GetMTGS().PrepDataPacket(GIF_PATH_3, pMem, qwc);
|
int size = GetMTGS().PrepDataPacket(GIF_PATH_3, (u8*)pMem, qwc);
|
||||||
u8* pgsmem = GetMTGS().GetDataPacketPtr();
|
u8* pgsmem = GetMTGS().GetDataPacketPtr();
|
||||||
|
|
||||||
memcpy_aligned(pgsmem, pMem, size<<4);
|
memcpy_aligned(pgsmem, pMem, size<<4);
|
||||||
|
|
|
@ -326,48 +326,24 @@ void SysMtgsThread::ExecuteTaskInThread()
|
||||||
|
|
||||||
switch( tag.command )
|
switch( tag.command )
|
||||||
{
|
{
|
||||||
case GS_RINGTYPE_P1:
|
case GS_RINGTYPE_PATH:
|
||||||
{
|
|
||||||
const int qsize = tag.data[0];
|
|
||||||
const u128* data = &RingBuffer[m_RingPos+1];
|
|
||||||
|
|
||||||
MTGS_LOG( "(MTGS Packet Read) ringtype=P1, qwc=%u", qsize );
|
|
||||||
|
|
||||||
// make sure that tag>>16 is the MAX size readable
|
|
||||||
GSgifTransfer1((u32*)(data - 0x400 + qsize), 0x4000-qsize*16);
|
|
||||||
//GSgifTransfer1((u32*)data, qsize);
|
|
||||||
ringposinc += qsize;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GS_RINGTYPE_P2:
|
|
||||||
{
|
{
|
||||||
const int qsize = tag.data[0];
|
const int qsize = tag.data[0];
|
||||||
const u128* data = &RingBuffer[m_RingPos+1];
|
const u128* data = &RingBuffer[m_RingPos+1];
|
||||||
|
|
||||||
MTGS_LOG( "(MTGS Packet Read) ringtype=P2, qwc=%u", qsize );
|
MTGS_LOG( "(MTGS Packet Read) ringtype=P2, qwc=%u", qsize );
|
||||||
|
|
||||||
|
// All GIFpath data is sent through Path2, which is the hack-free giftag
|
||||||
|
// parser on the GS plugin side of the world. PCSX2 now handles *all* the
|
||||||
|
// hacks, wrap-arounds, and (soon!) partial transfers during its own internal
|
||||||
|
// GIFtag parse, so the hack-free path on the GS is the preferred one for
|
||||||
|
// all packets. -air
|
||||||
|
|
||||||
GSgifTransfer2((u32*)data, qsize);
|
GSgifTransfer2((u32*)data, qsize);
|
||||||
ringposinc += qsize;
|
ringposinc += qsize;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GS_RINGTYPE_P3:
|
|
||||||
{
|
|
||||||
const int qsize = tag.data[0];
|
|
||||||
const u128* data = &RingBuffer[m_RingPos+1];
|
|
||||||
|
|
||||||
MTGS_LOG( "(MTGS Packet Read) ringtype=P3, qwc=%u", qsize );
|
|
||||||
|
|
||||||
GSgifTransfer3((u32*)data, qsize);
|
|
||||||
ringposinc += qsize;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
switch( tag.command )
|
|
||||||
{
|
|
||||||
case GS_RINGTYPE_RESTART:
|
case GS_RINGTYPE_RESTART:
|
||||||
//MTGS_LOG( "(MTGS Packet Read) ringtype=Restart" );
|
//MTGS_LOG( "(MTGS Packet Read) ringtype=Restart" );
|
||||||
m_RingPos = 0;
|
m_RingPos = 0;
|
||||||
|
@ -445,8 +421,6 @@ void SysMtgsThread::ExecuteTaskInThread()
|
||||||
jNO_DEFAULT;
|
jNO_DEFAULT;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint newringpos = m_RingPos + ringposinc;
|
uint newringpos = m_RingPos + ringposinc;
|
||||||
pxAssert( newringpos <= RingBufferSize );
|
pxAssert( newringpos <= RingBufferSize );
|
||||||
|
@ -594,11 +568,6 @@ void SysMtgsThread::SendDataPacket()
|
||||||
//m_PacketLocker.Release();
|
//m_PacketLocker.Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
int SysMtgsThread::PrepDataPacket( GIF_PATH pathidx, const u32* srcdata, u32 size )
|
|
||||||
{
|
|
||||||
return PrepDataPacket( pathidx, (u8*)srcdata, size );
|
|
||||||
}
|
|
||||||
|
|
||||||
int SysMtgsThread::PrepDataPacket( MTGS_RingCommand cmd, u32 size )
|
int SysMtgsThread::PrepDataPacket( MTGS_RingCommand cmd, u32 size )
|
||||||
{
|
{
|
||||||
// Note on volatiles: m_WritePos is not modified by the GS thread, so there's no need
|
// Note on volatiles: m_WritePos is not modified by the GS thread, so there's no need
|
||||||
|
@ -756,7 +725,7 @@ int SysMtgsThread::PrepDataPacket( GIF_PATH pathidx, const u8* srcdata, u32 size
|
||||||
{
|
{
|
||||||
//m_PacketLocker.Acquire();
|
//m_PacketLocker.Acquire();
|
||||||
|
|
||||||
return PrepDataPacket( (MTGS_RingCommand)pathidx, GIFPath_ParseTag(pathidx, srcdata, size) );
|
return PrepDataPacket( GS_RINGTYPE_PATH, GIFPath_ParseTag(pathidx, srcdata, size) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void SysMtgsThread::RestartRingbuffer( uint packsize )
|
void SysMtgsThread::RestartRingbuffer( uint packsize )
|
||||||
|
|
Loading…
Reference in New Issue