mirror of https://github.com/PCSX2/pcsx2.git
Cleaned up the dummy MTGS gif transfer function a bit, and let the F5-F7 keys to be passed in GSkeyEvent (allows me to remove windows specific keyboard handling from the gs).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1218 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
a974cff9bd
commit
3f9a45c8aa
15
pcsx2/GS.h
15
pcsx2/GS.h
|
@ -99,6 +99,21 @@ struct GIFPath
|
||||||
__forceinline void PrepRegs();
|
__forceinline void PrepRegs();
|
||||||
void SetTag(const void* mem);
|
void SetTag(const void* mem);
|
||||||
u32 GetReg();
|
u32 GetReg();
|
||||||
|
|
||||||
|
__forceinline bool StepReg()
|
||||||
|
{
|
||||||
|
if((++curreg & 0xf) == tag.nreg)
|
||||||
|
{
|
||||||
|
curreg = 0;
|
||||||
|
|
||||||
|
if(--tag.nloop == 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -280,8 +280,6 @@ __forceinline u32 mtgsThreadObject::_gifTransferDummy( GIF_PATH pathidx, const u
|
||||||
|
|
||||||
while(size > 0)
|
while(size > 0)
|
||||||
{
|
{
|
||||||
bool eop = false;
|
|
||||||
|
|
||||||
if(path.tag.nloop == 0)
|
if(path.tag.nloop == 0)
|
||||||
{
|
{
|
||||||
path.SetTag( pMem );
|
path.SetTag( pMem );
|
||||||
|
@ -290,7 +288,9 @@ __forceinline u32 mtgsThreadObject::_gifTransferDummy( GIF_PATH pathidx, const u
|
||||||
--size;
|
--size;
|
||||||
|
|
||||||
if(pathidx == 2 && path.tag.eop)
|
if(pathidx == 2 && path.tag.eop)
|
||||||
|
{
|
||||||
Path3transfer = FALSE;
|
Path3transfer = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if( pathidx == 0 )
|
if( pathidx == 0 )
|
||||||
{
|
{
|
||||||
|
@ -305,42 +305,16 @@ __forceinline u32 mtgsThreadObject::_gifTransferDummy( GIF_PATH pathidx, const u
|
||||||
return ++size;
|
return ++size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*f(path.tag.pre)
|
|
||||||
{
|
|
||||||
assert(path.tag.flg != GIF_FLG_IMAGE); // kingdom hearts, ffxii, tales of abyss
|
|
||||||
|
|
||||||
if((path.tag.flg & 2) == 0)
|
|
||||||
{
|
|
||||||
// Primitive handler... Nothing for the Dummy to do here.
|
|
||||||
|
|
||||||
//GIFReg r;
|
|
||||||
//r.i64 = path.tag.PRIM;
|
|
||||||
//(this->*m_fpGIFRegHandlers[GIF_A_D_REG_PRIM])(&r);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if(path.tag.eop)
|
|
||||||
{
|
|
||||||
eop = true;
|
|
||||||
}
|
|
||||||
else if(path.tag.nloop == 0)
|
|
||||||
{
|
|
||||||
if(pathidx == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
eop = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if(path.tag.nloop > 0)
|
|
||||||
{
|
{
|
||||||
|
// NOTE: size > 0 => do {} while(size > 0); should be faster than while(size > 0) {}
|
||||||
|
|
||||||
switch(path.tag.flg)
|
switch(path.tag.flg)
|
||||||
{
|
{
|
||||||
case GIF_FLG_PACKED:
|
case GIF_FLG_PACKED:
|
||||||
|
|
||||||
while(size > 0)
|
do
|
||||||
{
|
{
|
||||||
if( path.GetReg() == 0xe )
|
if( path.GetReg() == 0xe )
|
||||||
{
|
{
|
||||||
|
@ -348,25 +322,19 @@ __forceinline u32 mtgsThreadObject::_gifTransferDummy( GIF_PATH pathidx, const u
|
||||||
if(handler >= 0x60 && handler < 0x63)
|
if(handler >= 0x60 && handler < 0x63)
|
||||||
s_GSHandlers[handler&0x3]((const u32*)pMem);
|
s_GSHandlers[handler&0x3]((const u32*)pMem);
|
||||||
}
|
}
|
||||||
|
|
||||||
size--;
|
size--;
|
||||||
pMem += 16; // 128 bits! //sizeof(GIFPackedReg);
|
pMem += 16; // 128 bits! //sizeof(GIFPackedReg);
|
||||||
|
|
||||||
if((++path.curreg & 0xf) == path.tag.nreg)
|
|
||||||
{
|
|
||||||
path.curreg = 0;
|
|
||||||
path.tag.nloop--;
|
|
||||||
|
|
||||||
if(path.tag.nloop == 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
while(path.StepReg() && size > 0);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIF_FLG_REGLIST:
|
case GIF_FLG_REGLIST:
|
||||||
|
|
||||||
size *= 2;
|
size *= 2;
|
||||||
|
|
||||||
while(size > 0)
|
do
|
||||||
{
|
{
|
||||||
const int handler = path.GetReg();
|
const int handler = path.GetReg();
|
||||||
if(handler >= 0x60 && handler < 0x63)
|
if(handler >= 0x60 && handler < 0x63)
|
||||||
|
@ -374,20 +342,11 @@ __forceinline u32 mtgsThreadObject::_gifTransferDummy( GIF_PATH pathidx, const u
|
||||||
|
|
||||||
size--;
|
size--;
|
||||||
pMem += 8; //sizeof(GIFReg); -- 64 bits!
|
pMem += 8; //sizeof(GIFReg); -- 64 bits!
|
||||||
|
|
||||||
if((++path.curreg & 0xf) == path.tag.nreg)
|
|
||||||
{
|
|
||||||
path.curreg = 0;
|
|
||||||
path.tag.nloop--;
|
|
||||||
|
|
||||||
if(path.tag.nloop == 0)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
while(path.StepReg() && size > 0);
|
||||||
|
|
||||||
if(size & 1) pMem += 8; //sizeof(GIFReg);
|
if(size & 1) pMem += 8; //sizeof(GIFReg);
|
||||||
|
|
||||||
size /= 2;
|
size /= 2;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -413,15 +372,18 @@ __forceinline u32 mtgsThreadObject::_gifTransferDummy( GIF_PATH pathidx, const u
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(eop && ((int)size <= 0 || pathidx == 0))
|
if(pathidx == 0)
|
||||||
{
|
{
|
||||||
break;
|
if(path.tag.eop && path.tag.nloop == 0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pathidx == 0)
|
if(pathidx == 0)
|
||||||
{
|
{
|
||||||
if(!path.tag.eop && path.tag.nloop > 0)
|
if(size == 0 && path.tag.nloop > 0)
|
||||||
{
|
{
|
||||||
path.tag.nloop = 0;
|
path.tag.nloop = 0;
|
||||||
DevCon::Write( "path1 hack! " );
|
DevCon::Write( "path1 hack! " );
|
||||||
|
|
|
@ -413,7 +413,7 @@ namespace HostGui
|
||||||
case VK_CAPITAL: keymod->capslock = TRUE; break;
|
case VK_CAPITAL: keymod->capslock = TRUE; break;
|
||||||
|
|
||||||
case VK_F1: case VK_F2: case VK_F3: case VK_F4:
|
case VK_F1: case VK_F2: case VK_F3: case VK_F4:
|
||||||
case VK_F5: case VK_F6: case VK_F7: case VK_F8:
|
case VK_F8: // note: VK_F5-VK_F7 are reserved for GS
|
||||||
case VK_F9: case VK_F10: case VK_F11: case VK_F12:
|
case VK_F9: case VK_F10: case VK_F11: case VK_F12:
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue