mirror of https://github.com/PCSX2/pcsx2.git
Fixed VUSkip a bit - it is no longer unstable and should also give better/more consistent skipping then before.
MTGS mode fix: Retooled the MTGS's GIFtag handler so that it's based on Gsdx's GIFtag handler (may fix MTGS problems in DigitalDevilSaga). Updated VM build to give an error when trying to load VTLB states. Various tweaks and code cleanups. git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@467 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
parent
1876fbc49c
commit
7e5b1c504b
|
@ -37,6 +37,13 @@ Counter counters[6];
|
|||
u32 nextsCounter; // records the cpuRegs.cycle value of the last call to rcntUpdate()
|
||||
s32 nextCounter; // delta from nextsCounter, in cycles, until the next rcntUpdate()
|
||||
|
||||
// VUSkip Locals and Globals
|
||||
|
||||
u32 g_vu1SkipCount; // number of frames to disable/skip VU1
|
||||
static void (*s_prevExecuteVU1Block)() = NULL; // old VU1 block (either Int or Rec)
|
||||
|
||||
extern void DummyExecuteVU1Block(void);
|
||||
|
||||
void rcntReset(int index) {
|
||||
counters[index].count = 0;
|
||||
counters[index].sCycleT = cpuRegs.cycle;
|
||||
|
@ -237,6 +244,11 @@ u32 UpdateVSyncRate()
|
|||
m_iStart = GetCPUTicks();
|
||||
cpuRcntSet();
|
||||
|
||||
// Initialize VU Skip Stuff...
|
||||
assert(Cpu != NULL && Cpu->ExecuteVU1Block != NULL );
|
||||
s_prevExecuteVU1Block = Cpu->ExecuteVU1Block;
|
||||
g_vu1SkipCount = 0;
|
||||
|
||||
return (u32)m_iTicks;
|
||||
}
|
||||
|
||||
|
@ -393,18 +405,26 @@ static __forceinline void VSyncStart(u32 sCycle) // VSync Start
|
|||
if (Config.Patch) applypatch(1); // Apply patches (ToDo: clean up patch code)
|
||||
}
|
||||
|
||||
extern void gsPostVsyncEnd();
|
||||
|
||||
static __forceinline void VSyncEnd(u32 sCycle) // VSync End
|
||||
{
|
||||
iFrame++;
|
||||
|
||||
gsPostVsyncEnd();
|
||||
if( g_vu1SkipCount > 0 )
|
||||
{
|
||||
gsPostVsyncEnd( false );
|
||||
AtomicDecrement( g_vu1SkipCount );
|
||||
Cpu->ExecuteVU1Block = DummyExecuteVU1Block;
|
||||
}
|
||||
else
|
||||
{
|
||||
gsPostVsyncEnd( true );
|
||||
Cpu->ExecuteVU1Block = s_prevExecuteVU1Block;
|
||||
}
|
||||
|
||||
hwIntcIrq(3); // HW Irq
|
||||
psxVBlankEnd(); // psxCounters vBlank End
|
||||
if (gates) rcntEndGate(0x8, sCycle); // Counters End Gate Code
|
||||
frameLimit(); // limit FPS (also handles frameskip and VUskip)
|
||||
frameLimit(); // limit FPS
|
||||
}
|
||||
|
||||
//#define VSYNC_DEBUG // Uncomment this to enable some vSync Timer debugging features.
|
||||
|
|
|
@ -131,7 +131,7 @@ void WriteFIFO(u32 mem, const u64 *value) {
|
|||
|
||||
data[0] = value[0];
|
||||
data[1] = value[1];
|
||||
GSgifTransferDummy(2, (u32*)data, 1);
|
||||
GSgifTransferDummy(2, (u8*)data, 1);
|
||||
GSRINGBUF_DONECOPY((u8*)data, 16);
|
||||
}
|
||||
else {
|
||||
|
|
495
pcsx2/GS.cpp
495
pcsx2/GS.cpp
|
@ -213,7 +213,7 @@ static mutex_t gsRingRestartLock = {0};
|
|||
static volatile bool gsHasToExit = false;
|
||||
static volatile int g_GsExitCode = 0;
|
||||
|
||||
static int m_mtgsCopyCommandTally = 0;
|
||||
static int mtgs_CopyCommandTally = 0;
|
||||
|
||||
int g_FFXHack=0;
|
||||
|
||||
|
@ -315,11 +315,57 @@ struct GIFTAG
|
|||
u32 flg : 2;
|
||||
u32 nreg : 4;
|
||||
u32 regs[2];
|
||||
u32 curreg;
|
||||
};
|
||||
|
||||
static GIFTAG g_path[3];
|
||||
static PCSX2_ALIGNED16(u8 s_byRegs[3][16]);
|
||||
struct GIFPath
|
||||
{
|
||||
GIFTAG tag;
|
||||
UINT32 nreg;
|
||||
UINT32 _pad[3];
|
||||
u8 regs[16];
|
||||
|
||||
// unpack the registers
|
||||
// registers are stored as a sequence of 4 bit values in the
|
||||
// upper 64 bits of the GIFTAG. That sucks for us, so we unpack
|
||||
// them into an 8 bit array.
|
||||
__forceinline void PrepRegs()
|
||||
{
|
||||
if( tag.nreg == 0 )
|
||||
{
|
||||
u32 tempreg = tag.regs[0];
|
||||
for(u32 i=0; i<16; ++i, tempreg >>= 4)
|
||||
{
|
||||
if( i == 8 ) tempreg = tag.regs[1];
|
||||
assert( (tempreg&0xf) < 0x64 );
|
||||
regs[i] = tempreg & 0xf;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
u32 tempreg = tag.regs[0];
|
||||
for(u32 i=0; i<tag.nreg; ++i, tempreg >>= 4)
|
||||
{
|
||||
assert( (tempreg&0xf) < 0x64 );
|
||||
regs[i] = tempreg & 0xf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetTag(const void* mem)
|
||||
{
|
||||
tag = *((GIFTAG*)mem);
|
||||
nreg = 0;
|
||||
|
||||
PrepRegs();
|
||||
}
|
||||
|
||||
DWORD GetReg()
|
||||
{
|
||||
return regs[nreg]; // (DWORD)GET_GIF_REG(tag, nreg);
|
||||
}
|
||||
};
|
||||
|
||||
static PCSX2_ALIGNED16(GIFPath g_path[3]);
|
||||
|
||||
// g_pGSRingPos == g_pGSWritePos => fifo is empty
|
||||
static u8* g_pGSRingPos = NULL; // cur pos ring is at
|
||||
|
@ -350,10 +396,6 @@ static u64 m_iSlowStart=0;
|
|||
static bool m_justSkipped = false;
|
||||
static bool m_StrictSkipping = false;
|
||||
|
||||
static void (*s_prevExecuteVU1Block)() = NULL;
|
||||
|
||||
void DummyExecuteVU1Block(void);
|
||||
|
||||
static void OnModeChanged( u32 framerate, u32 iTicks )
|
||||
{
|
||||
m_iSlowStart = GetCPUTicks();
|
||||
|
@ -421,9 +463,6 @@ void gsInit()
|
|||
if( GSsetBaseMem != NULL )
|
||||
GSsetBaseMem(g_MTGSMem);
|
||||
}
|
||||
|
||||
assert(Cpu != NULL && Cpu->ExecuteVU1Block != NULL );
|
||||
s_prevExecuteVU1Block = Cpu->ExecuteVU1Block;
|
||||
}
|
||||
|
||||
// Opens the gsRingbuffer thread.
|
||||
|
@ -439,8 +478,6 @@ s32 gsOpen()
|
|||
|
||||
// MultiGS Procedure From Here Out...
|
||||
|
||||
SysPrintf("gsInit [Multithreaded GS]\n");
|
||||
|
||||
gsHasToExit = false;
|
||||
event_init( g_hGsEvent );
|
||||
event_init( g_hGSDone );
|
||||
|
@ -452,7 +489,7 @@ s32 gsOpen()
|
|||
|
||||
if( !thread_create( g_hVuGsThread ) )
|
||||
{
|
||||
SysPrintf(" > MTGS Thread creation failure!\n");
|
||||
SysPrintf("MTGS > Thread creation failure!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -475,7 +512,7 @@ void GS_SETEVENT()
|
|||
assert( !g_EEFreezeRegs || (g_globalXMMSaved > 0) );
|
||||
|
||||
event_set(g_hGsEvent);
|
||||
m_mtgsCopyCommandTally = 0;
|
||||
mtgs_CopyCommandTally = 0;
|
||||
}
|
||||
|
||||
void gsWaitGS()
|
||||
|
@ -504,7 +541,7 @@ static void gsSetEventWait()
|
|||
FreezeXMMRegs(0);
|
||||
FreezeMMXRegs(0);
|
||||
|
||||
m_mtgsCopyCommandTally = 0;
|
||||
mtgs_CopyCommandTally = 0;
|
||||
}
|
||||
|
||||
// mem and size are the ones returned from GSRingBufCopy
|
||||
|
@ -553,13 +590,14 @@ void GSRINGBUF_DONECOPY(const u8* mem, u32 size)
|
|||
// 24 - very slow on HT machines (+5% drop in fps)
|
||||
// 8 - roughly 2% slower on HT machines.
|
||||
|
||||
FreezeXMMRegs(1);
|
||||
FreezeMMXRegs(1);
|
||||
if( ++m_mtgsCopyCommandTally > 16 )
|
||||
if( ++mtgs_CopyCommandTally > 16 )
|
||||
{
|
||||
FreezeXMMRegs(1);
|
||||
FreezeMMXRegs(1);
|
||||
GS_SETEVENT();
|
||||
FreezeXMMRegs(0);
|
||||
FreezeMMXRegs(0);
|
||||
|
||||
FreezeXMMRegs(0);
|
||||
FreezeMMXRegs(0);
|
||||
}
|
||||
}
|
||||
|
||||
void gsShutdown()
|
||||
|
@ -571,7 +609,7 @@ void gsShutdown()
|
|||
// (they might be 1 byte under some compilers).
|
||||
gsHasToExit = true;
|
||||
|
||||
SysPrintf("Closing gs thread\n");
|
||||
SysPrintf("MTGS > Closing GS thread...\n");
|
||||
GS_SETEVENT();
|
||||
|
||||
if (g_hVuGsThread != NULL) thread_close( g_hVuGsThread );
|
||||
|
@ -582,13 +620,6 @@ void gsShutdown()
|
|||
mutex_destroy( stackLock );
|
||||
#endif
|
||||
gsHasToExit = false;
|
||||
|
||||
#ifdef _WIN32
|
||||
VirtualFree(GS_RINGBUFFERBASE, GS_RINGBUFFERSIZE, MEM_DECOMMIT|MEM_RELEASE);
|
||||
#else
|
||||
SysMunmap((uptr)GS_RINGBUFFERBASE, GS_RINGBUFFERSIZE);
|
||||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
GSclose();
|
||||
|
@ -803,6 +834,33 @@ void GSRingBufSimplePacket(int type, int data0, int data1, int data2)
|
|||
AtomicExchangePointer( g_pGSWritePos, future_writepos );
|
||||
}
|
||||
|
||||
void GSRingBufSimplePacket64(int type, u32 data0, u64 data1 )
|
||||
{
|
||||
u8* writepos = g_pGSWritePos;
|
||||
const u8* future_writepos = writepos+16;
|
||||
|
||||
assert( future_writepos <= GS_RINGBUFFEREND );
|
||||
|
||||
if( future_writepos == GS_RINGBUFFEREND )
|
||||
future_writepos = GS_RINGBUFFERBASE;
|
||||
|
||||
while( future_writepos == *(volatile PU8*)&g_pGSRingPos )
|
||||
gsSetEventWait();
|
||||
|
||||
#ifdef RINGBUF_DEBUG_STACK
|
||||
mutex_lock( stackLock );
|
||||
ringposStack.push_front( (long)writepos );
|
||||
mutex_unlock( stackLock );
|
||||
#endif
|
||||
|
||||
*(u32*)writepos = type;
|
||||
*(u32*)(writepos+4) = data0;
|
||||
*(u64*)(writepos+8) = data1;
|
||||
|
||||
assert( future_writepos != *(volatile PU8*)&g_pGSRingPos );
|
||||
AtomicExchangePointer( g_pGSWritePos, future_writepos );
|
||||
}
|
||||
|
||||
void gsReset()
|
||||
{
|
||||
if( CHECK_MULTIGS )
|
||||
|
@ -818,16 +876,21 @@ void gsReset()
|
|||
#endif
|
||||
MTGS_LOG( "MTGS > Sending Reset...\n" );
|
||||
GSRingBufSimplePacket( GS_RINGTYPE_RESET, 0, 0, 0 );
|
||||
GSRingBufSimplePacket( GS_RINGTYPE_FRAMESKIP, 0, 0, 0 );
|
||||
|
||||
#ifdef _DEBUG
|
||||
g_mtgsCopyLock = 0;
|
||||
#endif
|
||||
// I think this would be a good idea (air)
|
||||
//Path3transfer = 0;
|
||||
memset(g_path, 0, sizeof(g_path));
|
||||
memset(s_byRegs, 0, sizeof(s_byRegs));
|
||||
//memset(s_byRegs, 0, sizeof(s_byRegs));
|
||||
}
|
||||
else
|
||||
{
|
||||
SysPrintf("GIF reset\n");
|
||||
GSreset();
|
||||
GSsetFrameSkip(0);
|
||||
}
|
||||
|
||||
OnModeChanged(
|
||||
|
@ -850,9 +913,9 @@ static bool _gsGIFSoftReset( int mask )
|
|||
{
|
||||
if( CHECK_MULTIGS )
|
||||
{
|
||||
if(mask & 1) memset(&g_path[0], 0, sizeof(GIFTAG));
|
||||
if(mask & 2) memset(&g_path[1], 0, sizeof(GIFTAG));
|
||||
if(mask & 4) memset(&g_path[2], 0, sizeof(GIFTAG));
|
||||
if(mask & 1) memset(&g_path[0], 0, sizeof(g_path[0]));
|
||||
if(mask & 2) memset(&g_path[1], 0, sizeof(g_path[1]));
|
||||
if(mask & 4) memset(&g_path[2], 0, sizeof(g_path[2]));
|
||||
}
|
||||
|
||||
if( GSgifSoftReset == NULL )
|
||||
|
@ -1074,7 +1137,7 @@ void gsIrq() {
|
|||
hwIntcIrq(0);
|
||||
}
|
||||
|
||||
static void GSRegHandlerSIGNAL(u32* data)
|
||||
static void GSRegHandlerSIGNAL(const u32* data)
|
||||
{
|
||||
MTGS_LOG("MTGS SIGNAL data %x_%x CSRw %x\n",data[0], data[1], CSRw);
|
||||
|
||||
|
@ -1090,7 +1153,7 @@ static void GSRegHandlerSIGNAL(u32* data)
|
|||
|
||||
}
|
||||
|
||||
static void GSRegHandlerFINISH(u32* data)
|
||||
static void GSRegHandlerFINISH(const u32* data)
|
||||
{
|
||||
MTGS_LOG("MTGS FINISH data %x_%x CSRw %x\n",data[0], data[1], CSRw);
|
||||
|
||||
|
@ -1102,188 +1165,196 @@ static void GSRegHandlerFINISH(u32* data)
|
|||
|
||||
}
|
||||
|
||||
static void GSRegHandlerLABEL(u32* data)
|
||||
static void GSRegHandlerLABEL(const u32* data)
|
||||
{
|
||||
GSSIGLBLID->LBLID = (GSSIGLBLID->LBLID&~data[1])|(data[0]&data[1]);
|
||||
}
|
||||
|
||||
typedef void (*GIFRegHandler)(u32* data);
|
||||
typedef void (*GIFRegHandler)(const u32* data);
|
||||
static GIFRegHandler s_GSHandlers[3] = { GSRegHandlerSIGNAL, GSRegHandlerFINISH, GSRegHandlerLABEL };
|
||||
|
||||
/*midnight madness cares because the tag is 5 dwords*/ \
|
||||
static __forceinline void TagPathTransfer( const GIFTAG* ptag, GIFTAG *path )
|
||||
enum GIF_FLG
|
||||
{
|
||||
const u64* psrc = (const u64*)ptag;
|
||||
u64* pdst = (u64*)path;
|
||||
pdst[0] = psrc[0];
|
||||
pdst[1] = psrc[1];
|
||||
//pdst[2] = psrc[2];
|
||||
//pdst[3] = psrc[3];
|
||||
}
|
||||
GIF_FLG_PACKED = 0,
|
||||
GIF_FLG_REGLIST = 1,
|
||||
GIF_FLG_IMAGE = 2,
|
||||
GIF_FLG_IMAGE2 = 3
|
||||
};
|
||||
|
||||
enum GIF_REG
|
||||
{
|
||||
GIF_REG_PRIM = 0x00,
|
||||
GIF_REG_RGBA = 0x01,
|
||||
GIF_REG_STQ = 0x02,
|
||||
GIF_REG_UV = 0x03,
|
||||
GIF_REG_XYZF2 = 0x04,
|
||||
GIF_REG_XYZ2 = 0x05,
|
||||
GIF_REG_TEX0_1 = 0x06,
|
||||
GIF_REG_TEX0_2 = 0x07,
|
||||
GIF_REG_CLAMP_1 = 0x08,
|
||||
GIF_REG_CLAMP_2 = 0x09,
|
||||
GIF_REG_FOG = 0x0a,
|
||||
GIF_REG_XYZF3 = 0x0c,
|
||||
GIF_REG_XYZ3 = 0x0d,
|
||||
GIF_REG_A_D = 0x0e,
|
||||
GIF_REG_NOP = 0x0f,
|
||||
};
|
||||
|
||||
// simulates a GIF tag
|
||||
u32 GSgifTransferDummy(int path, u32 *pMem, u32 size)
|
||||
u32 GSgifTransferDummy(int pathidx, const u8 *pMem, u32 size)
|
||||
{
|
||||
int nreg = 0, i, nloop;
|
||||
u32 curreg = 0;
|
||||
u32 tempreg;
|
||||
GIFTAG* ptag = &g_path[path];
|
||||
|
||||
if( path == 0 ) {
|
||||
nloop = 0;
|
||||
}
|
||||
else {
|
||||
nloop = ptag->nloop;
|
||||
curreg = ptag->curreg;
|
||||
nreg = ptag->nreg == 0 ? 16 : ptag->nreg;
|
||||
}
|
||||
GIFPath& path = g_path[pathidx];
|
||||
|
||||
while(size > 0)
|
||||
{
|
||||
if(nloop == 0)
|
||||
{
|
||||
ptag = (GIFTAG*)pMem;
|
||||
nreg = ptag->nreg == 0 ? 16 : ptag->nreg;
|
||||
bool eop = false;
|
||||
|
||||
pMem+= 4;
|
||||
if(path.tag.nloop == 0)
|
||||
{
|
||||
path.SetTag( pMem );
|
||||
|
||||
pMem += sizeof(GIFTAG);
|
||||
size--;
|
||||
|
||||
if( path == 2 && ptag->eop) Path3transfer = 0; //fixes SRS and others
|
||||
if(pathidx == 2 && path.tag.eop)
|
||||
Path3transfer = 0;
|
||||
|
||||
if( path == 0 )
|
||||
{
|
||||
// if too much data for VU1, just ignore
|
||||
if((ptag->nloop * nreg) > (size * (ptag->flg == 1 ? 2 : 1))) {
|
||||
g_path[path].nloop = 0;
|
||||
return ++size; // have to increment or else the GS plugin will process this packet
|
||||
if(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 (ptag->nloop == 0 ) {
|
||||
if (path == 0 ) {
|
||||
if ((!ptag->eop) && (g_FFXHack))
|
||||
continue;
|
||||
else
|
||||
return size;
|
||||
}
|
||||
|
||||
g_path[path].nloop = 0;
|
||||
|
||||
// motogp graphics show
|
||||
if (!ptag->eop )
|
||||
if(path.tag.eop)
|
||||
{
|
||||
eop = true;
|
||||
}
|
||||
else if(path.tag.nloop == 0)
|
||||
{
|
||||
if(pathidx == 0 && g_FFXHack)
|
||||
{
|
||||
continue;
|
||||
else
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
tempreg = ptag->regs[0];
|
||||
for(i = 0; i < nreg; ++i, tempreg >>= 4) {
|
||||
if( i == 8 ) tempreg = ptag->regs[1];
|
||||
s_byRegs[path][i] = tempreg&0xf;
|
||||
eop = true;
|
||||
}
|
||||
|
||||
nloop = ptag->nloop;
|
||||
curreg = 0;
|
||||
}
|
||||
|
||||
switch(ptag->flg)
|
||||
if(path.tag.nloop > 0)
|
||||
{
|
||||
case 0: // PACKED
|
||||
switch(path.tag.flg)
|
||||
{
|
||||
for(; size > 0; size--, pMem += 4)
|
||||
case GIF_FLG_PACKED:
|
||||
|
||||
while(size > 0)
|
||||
{
|
||||
if( s_byRegs[path][curreg] == 0xe && (pMem[2]&0xff) >= 0x60 ) {
|
||||
if( (pMem[2]&0xff) < 0x63 )
|
||||
s_GSHandlers[pMem[2]&0x3](pMem);
|
||||
if( path.GetReg() == 0xe )
|
||||
{
|
||||
const int handler = pMem[8];
|
||||
if(handler >= 0x60 && handler < 0x63)
|
||||
s_GSHandlers[handler&0x3]((const u32*)pMem);
|
||||
}
|
||||
size--;
|
||||
pMem += 16; // 128 bits! //sizeof(GIFPackedReg);
|
||||
|
||||
curreg++;
|
||||
if (nreg == curreg) {
|
||||
curreg = 0;
|
||||
if( nloop-- <= 1 ) {
|
||||
size--;
|
||||
pMem += 4;
|
||||
if((++path.nreg & 0xf) == path.tag.nreg)
|
||||
{
|
||||
path.nreg = 0;
|
||||
path.tag.nloop--;
|
||||
|
||||
if(path.tag.nloop == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( nloop > 0 ) {
|
||||
assert(size == 0);
|
||||
TagPathTransfer( ptag, &g_path[path] );
|
||||
g_path[path].nloop = nloop;
|
||||
g_path[path].curreg = curreg;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: // REGLIST
|
||||
{
|
||||
|
||||
case GIF_FLG_REGLIST:
|
||||
|
||||
size *= 2;
|
||||
|
||||
tempreg = ptag->regs[0];
|
||||
for(i = 0; i < nreg; ++i, tempreg >>= 4) {
|
||||
if( i == 8 ) tempreg = ptag->regs[1];
|
||||
assert( (tempreg&0xf) < 0x64 );
|
||||
s_byRegs[path][i] = tempreg&0xf;
|
||||
}
|
||||
|
||||
for(; size > 0; pMem+= 2, size--) {
|
||||
if( s_byRegs[path][curreg] >= 0x60 && s_byRegs[path][curreg] < 0x63 )
|
||||
s_GSHandlers[s_byRegs[path][curreg]&3](pMem);
|
||||
while(size > 0)
|
||||
{
|
||||
const int handler = path.GetReg();
|
||||
if(handler >= 0x60 && handler < 0x63)
|
||||
s_GSHandlers[handler&0x3]((const u32*)pMem);
|
||||
|
||||
curreg++;
|
||||
if (nreg == curreg) {
|
||||
curreg = 0;
|
||||
if( nloop-- <= 1 ) {
|
||||
size--;
|
||||
pMem += 2;
|
||||
size--;
|
||||
pMem += 8; //sizeof(GIFReg); -- 64 bits!
|
||||
|
||||
if((++path.nreg & 0xf) == path.tag.nreg)
|
||||
{
|
||||
path.nreg = 0;
|
||||
path.tag.nloop--;
|
||||
|
||||
if(path.tag.nloop == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(size & 1) pMem += 8; //sizeof(GIFReg);
|
||||
|
||||
if( size & 1 ) pMem += 2;
|
||||
size /= 2;
|
||||
|
||||
if( nloop > 0 ) {
|
||||
assert(size == 0);
|
||||
TagPathTransfer( ptag, &g_path[path] );
|
||||
g_path[path].nloop = nloop;
|
||||
g_path[path].curreg = curreg;
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case GIF_FLG_IMAGE2: // hmmm
|
||||
|
||||
assert(0);
|
||||
|
||||
path.tag.nloop = 0;
|
||||
|
||||
break;
|
||||
|
||||
case GIF_FLG_IMAGE:
|
||||
{
|
||||
int len = (int)min(size, path.tag.nloop);
|
||||
|
||||
//ASSERT(!(len&3));
|
||||
|
||||
pMem += len * 16;
|
||||
path.tag.nloop -= len;
|
||||
size -= len;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 2: // GIF_IMAGE (FROM_VFRAM)
|
||||
case 3:
|
||||
{
|
||||
// simulate
|
||||
if( (int)size < nloop ) {
|
||||
TagPathTransfer( ptag, &g_path[path] );
|
||||
g_path[path].nloop = nloop-size;
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
pMem += nloop*4;
|
||||
size -= nloop;
|
||||
nloop = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
jNO_DEFAULT;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if( path == 0 && ptag->eop ) {
|
||||
g_path[0].nloop = 0;
|
||||
return size;
|
||||
|
||||
if(eop && ((int)size <= 0 || pathidx == 0))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_path[path] = *ptag;
|
||||
g_path[path].curreg = curreg;
|
||||
g_path[path].nloop = nloop;
|
||||
|
||||
// FIXME: dq8, pcsx2 error probably
|
||||
|
||||
if(pathidx == 0)
|
||||
{
|
||||
if(!path.tag.eop && path.tag.nloop > 0)
|
||||
{
|
||||
path.tag.nloop = 0;
|
||||
|
||||
SysPrintf( "path1 hack!" );
|
||||
}
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
static int gspath3done=0;
|
||||
|
@ -1329,8 +1400,11 @@ static u64 s_gstag=0; // used for querying the last tag
|
|||
static void WRITERING_DMA(u32 *pMem, u32 qwc)
|
||||
{
|
||||
psHu32(GIF_STAT) |= 0xE00;
|
||||
Path3transfer = 1;
|
||||
if( CHECK_MULTIGS)
|
||||
|
||||
// Path3 transfer will be set to zero by the GIFhandler.
|
||||
Path3transfer = 1;
|
||||
|
||||
if( CHECK_MULTIGS )
|
||||
{
|
||||
int sizetoread = (qwc)<<4;
|
||||
u8* pgsmem = GSRingBufCopy(sizetoread, GS_RINGTYPE_P3);
|
||||
|
@ -1348,7 +1422,7 @@ static void WRITERING_DMA(u32 *pMem, u32 qwc)
|
|||
}
|
||||
else memcpy_raz_(pgsmem, pMem, sizetoread);
|
||||
|
||||
GSgifTransferDummy(2, pMem, qwc);
|
||||
GSgifTransferDummy(2, (u8*)pMem, qwc);
|
||||
GSRINGBUF_DONECOPY(pgsmem, sizetoread);
|
||||
}
|
||||
else
|
||||
|
@ -1357,10 +1431,8 @@ static void WRITERING_DMA(u32 *pMem, u32 qwc)
|
|||
if( GSgetLastTag != NULL )
|
||||
{
|
||||
GSgetLastTag(&s_gstag);
|
||||
if( (s_gstag) == 1 )
|
||||
{
|
||||
if( s_gstag == 1 )
|
||||
Path3transfer = 0; /* fixes SRS and others */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1476,7 +1548,7 @@ void GIFdma()
|
|||
// I'm not really sure that is intentional. --arcum42
|
||||
FreezeXMMRegs(1);
|
||||
FreezeMMXRegs(1);
|
||||
GIFchain();
|
||||
GIFchain();
|
||||
FreezeXMMRegs(0); // Theres a comment below that says not to unfreeze the xmm regs, so not sure about this.
|
||||
FreezeMMXRegs(0);
|
||||
|
||||
|
@ -1825,7 +1897,7 @@ void gsSyncLimiterLostTime( s32 deltaTime )
|
|||
// and would also mean that aforementioned menus would still be laggy by whatever
|
||||
// frame count threshold. This method is more responsive.
|
||||
|
||||
static __forceinline void frameSkip()
|
||||
static __forceinline void frameSkip( bool forceskip )
|
||||
{
|
||||
static u8 FramesToRender = 0;
|
||||
static u8 FramesToSkip = 0;
|
||||
|
@ -1847,6 +1919,30 @@ static __forceinline void frameSkip()
|
|||
|
||||
m_iSlowStart = uSlowExpectedEnd;
|
||||
|
||||
if( forceskip )
|
||||
{
|
||||
if( !FramesToSkip )
|
||||
{
|
||||
SysPrintf( "- Skipping some VUs!\n" );
|
||||
|
||||
GSsetFrameSkip( 1 );
|
||||
FramesToRender = noSkipFrames;
|
||||
FramesToSkip = 1; // just set to 1
|
||||
|
||||
// We're already skipping, so FramesToSkip==1 will just restore the gsFrameSkip
|
||||
// setting and reset our delta times as needed.
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// if we've already given the EE a skipcount assignment then don't do anything more.
|
||||
// Otherwise we could start compounding the issue and skips would be too long.
|
||||
if( g_vu1SkipCount > 0 )
|
||||
{
|
||||
SysPrintf("- Already Assigned a Skipcount.. %d\n", g_vu1SkipCount );
|
||||
return;
|
||||
}
|
||||
|
||||
if( FramesToRender == 0 )
|
||||
{
|
||||
// -- Standard operation section --
|
||||
|
@ -1865,17 +1961,22 @@ static __forceinline void frameSkip()
|
|||
// We also check for that here.
|
||||
|
||||
if( (m_justSkipped && (sSlowDeltaTime > m_iSlowTicks)) ||
|
||||
sSlowDeltaTime > m_iSlowTicks*2 )
|
||||
(sSlowDeltaTime > m_iSlowTicks*2) )
|
||||
{
|
||||
//SysPrintf( "Frameskip Initiated! Lateness: %d\n", (int)( (sSlowDeltaTime*100) / m_iSlowTicks ) );
|
||||
SysPrintf( "Frameskip Initiated! Lateness: %d\n", (int)( (sSlowDeltaTime*100) / m_iSlowTicks ) );
|
||||
|
||||
GSsetFrameSkip(1);
|
||||
|
||||
if( CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_VUSKIP )
|
||||
AtomicExchangePointer( Cpu->ExecuteVU1Block, DummyExecuteVU1Block );
|
||||
|
||||
FramesToRender = noSkipFrames+1;
|
||||
FramesToSkip = yesSkipFrames;
|
||||
{
|
||||
// For best results we have to wait for the EE to
|
||||
// tell us when to skip, so that VU skips are synched with GS skips.
|
||||
AtomicExchangeAdd( g_vu1SkipCount, yesSkipFrames+1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
GSsetFrameSkip(1);
|
||||
FramesToRender = noSkipFrames+1;
|
||||
FramesToSkip = yesSkipFrames;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1914,8 +2015,6 @@ static __forceinline void frameSkip()
|
|||
}
|
||||
|
||||
m_justSkipped = true;
|
||||
if( CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_VUSKIP )
|
||||
AtomicExchangePointer( Cpu->ExecuteVU1Block, s_prevExecuteVU1Block );
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
@ -1934,7 +2033,8 @@ static __forceinline void frameSkip()
|
|||
}
|
||||
}
|
||||
|
||||
void gsPostVsyncEnd()
|
||||
// updategs - if FALSE the gs will skip the frame.
|
||||
void gsPostVsyncEnd( bool updategs )
|
||||
{
|
||||
*(u32*)(PS2MEM_GS+0x1000) ^= 0x2000; // swap the vsync field
|
||||
|
||||
|
@ -1944,7 +2044,7 @@ void gsPostVsyncEnd()
|
|||
AtomicIncrement( g_pGSvSyncCount );
|
||||
//SysPrintf( " Sending VSync : %d \n", g_pGSvSyncCount );
|
||||
#endif
|
||||
GSRingBufSimplePacket(GS_RINGTYPE_VSYNC, (*(u32*)(PS2MEM_GS+0x1000)&0x2000), 0, 0);
|
||||
GSRingBufSimplePacket(GS_RINGTYPE_VSYNC, (*(u32*)(PS2MEM_GS+0x1000)&0x2000), updategs, 0);
|
||||
|
||||
// No need to freeze MMX/XMM registers here since this
|
||||
// code is always called from the context of a BranchTest.
|
||||
|
@ -1958,13 +2058,13 @@ void gsPostVsyncEnd()
|
|||
if( PAD1update != NULL ) PAD1update(0);
|
||||
if( PAD2update != NULL ) PAD2update(1);
|
||||
|
||||
frameSkip();
|
||||
frameSkip( !updategs );
|
||||
}
|
||||
}
|
||||
|
||||
static void _resetFrameskip()
|
||||
{
|
||||
AtomicExchangePointer( Cpu->ExecuteVU1Block, s_prevExecuteVU1Block );
|
||||
g_vu1SkipCount = 0; // set to 0 so that EE will re-enable the VU at the next vblank.
|
||||
GSsetFrameSkip( 0 );
|
||||
}
|
||||
|
||||
|
@ -2058,7 +2158,7 @@ GS_THREADPROC
|
|||
{
|
||||
GSvsync(*(u32*)(g_pGSRingPos+4));
|
||||
|
||||
frameSkip();
|
||||
frameSkip( !( *(u32*)(g_pGSRingPos+8) ) );
|
||||
|
||||
if( PAD1update != NULL ) PAD1update(0);
|
||||
if( PAD2update != NULL ) PAD2update(1);
|
||||
|
@ -2199,12 +2299,25 @@ GS_THREADPROC
|
|||
return 0;
|
||||
}
|
||||
|
||||
int gsFreeze(gzFile f, int Mode) {
|
||||
|
||||
int gsFreeze(gzFile f, int Mode)
|
||||
{
|
||||
gzfreeze(PS2MEM_GS, 0x2000);
|
||||
gzfreeze(&CSRw, sizeof(CSRw));
|
||||
gzfreeze(g_path, sizeof(g_path));
|
||||
gzfreeze(s_byRegs, sizeof(s_byRegs));
|
||||
|
||||
for(int i=0; i<3; i++ )
|
||||
{
|
||||
gzfreeze( &g_path[i].tag, sizeof( g_path[i].tag ) );
|
||||
|
||||
// Earlier versions had an extra u32 in the tag struct:
|
||||
|
||||
//if( Mode == 0 && g_SaveVersion <= 0x7a300010 )
|
||||
{
|
||||
u32 dummy; gzread( f, &dummy, sizeof( dummy ) );
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=0; i<3; i++ )
|
||||
gzfreeze( &g_path[i].regs, sizeof( g_path[i].regs ) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
30
pcsx2/GS.h
30
pcsx2/GS.h
|
@ -76,8 +76,9 @@ enum GS_RINGTYPE
|
|||
// if returns NULL, don't copy (memory is preserved)
|
||||
u8* GSRingBufCopy(u32 size, u32 type);
|
||||
void GSRingBufSimplePacket(int type, int data0, int data1, int data2);
|
||||
void GSRingBufSimplePacket64(int type, u32 data0, u64 data1 );
|
||||
|
||||
u32 GSgifTransferDummy(int path, u32 *pMem, u32 size);
|
||||
u32 GSgifTransferDummy(int path, const u8 *pMem, u32 size);
|
||||
|
||||
void gsInit();
|
||||
s32 gsOpen();
|
||||
|
@ -87,6 +88,7 @@ void gsSetVideoRegionType( u32 isPal );
|
|||
void gsResetFrameSkip();
|
||||
void gsSyncLimiterLostTime( s32 deltaTime );
|
||||
void gsDynamicSkipEnable();
|
||||
void gsPostVsyncEnd( bool updategs );
|
||||
|
||||
// mem and size are the ones from GSRingBufCopy
|
||||
extern void GSRINGBUF_DONECOPY(const u8 *mem, u32 size);
|
||||
|
@ -97,31 +99,25 @@ void gsGIFReset();
|
|||
void gsCSRwrite(u32 value);
|
||||
|
||||
void gsWrite8(u32 mem, u8 value);
|
||||
void gsConstWrite8(u32 mem, int mmreg);
|
||||
|
||||
void gsWrite16(u32 mem, u16 value);
|
||||
void gsConstWrite16(u32 mem, int mmreg);
|
||||
|
||||
void gsWrite32(u32 mem, u32 value);
|
||||
void gsConstWrite32(u32 mem, int mmreg);
|
||||
|
||||
void gsWrite64(u32 mem, u64 value);
|
||||
void gsConstWrite64(u32 mem, int mmreg);
|
||||
|
||||
void gsConstWrite128(u32 mem, int mmreg);
|
||||
void gsConstWrite8(u32 mem, int mmreg);
|
||||
void gsConstWrite16(u32 mem, int mmreg);
|
||||
void gsConstWrite32(u32 mem, int mmreg);
|
||||
void gsConstWrite64(u32 mem, int mmreg);
|
||||
void gsConstWrite128(u32 mem, int mmreg);
|
||||
|
||||
u8 gsRead8(u32 mem);
|
||||
int gsConstRead8(u32 x86reg, u32 mem, u32 sign);
|
||||
|
||||
u16 gsRead16(u32 mem);
|
||||
int gsConstRead16(u32 x86reg, u32 mem, u32 sign);
|
||||
|
||||
u32 gsRead32(u32 mem);
|
||||
int gsConstRead32(u32 x86reg, u32 mem);
|
||||
|
||||
u64 gsRead64(u32 mem);
|
||||
void gsConstRead64(u32 mem, int mmreg);
|
||||
|
||||
int gsConstRead8(u32 x86reg, u32 mem, u32 sign);
|
||||
int gsConstRead16(u32 x86reg, u32 mem, u32 sign);
|
||||
int gsConstRead32(u32 x86reg, u32 mem);
|
||||
void gsConstRead64(u32 mem, int mmreg);
|
||||
void gsConstRead128(u32 mem, int xmmreg);
|
||||
|
||||
void gsIrq();
|
||||
|
@ -133,6 +129,8 @@ int gsFreeze(gzFile f, int Mode);
|
|||
int _GIFchain();
|
||||
void gifMFIFOInterrupt();
|
||||
|
||||
extern u32 g_vu1SkipCount;
|
||||
|
||||
// GS Playback
|
||||
#define GSRUN_TRANS1 1
|
||||
#define GSRUN_TRANS2 2
|
||||
|
|
|
@ -1739,7 +1739,7 @@ int recMemConstWrite128(u32 mem, int mmreg)
|
|||
}
|
||||
}
|
||||
|
||||
int memRead8 (u32 mem, u8 *out) {
|
||||
int __fastcall memRead8 (u32 mem, u8 *out) {
|
||||
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -1765,7 +1765,7 @@ int memRead8 (u32 mem, u8 *out) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
int memRead8RS (u32 mem, u64 *out)
|
||||
int __fastcall memRead8RS (u32 mem, u64 *out)
|
||||
{
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -1788,7 +1788,7 @@ int memRead8RS (u32 mem, u64 *out)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int memRead8RU (u32 mem, u64 *out)
|
||||
int __fastcall memRead8RU (u32 mem, u64 *out)
|
||||
{
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -1811,7 +1811,7 @@ int memRead8RU (u32 mem, u64 *out)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int memRead16(u32 mem, u16 *out) {
|
||||
int __fastcall memRead16(u32 mem, u16 *out) {
|
||||
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -1838,7 +1838,7 @@ int memRead16(u32 mem, u16 *out) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
int memRead16RS(u32 mem, u64 *out) {
|
||||
int __fastcall memRead16RS(u32 mem, u64 *out) {
|
||||
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -1865,7 +1865,7 @@ int memRead16RS(u32 mem, u64 *out) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
int memRead16RU(u32 mem, u64 *out) {
|
||||
int __fastcall memRead16RU(u32 mem, u64 *out) {
|
||||
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -1892,7 +1892,7 @@ int memRead16RU(u32 mem, u64 *out) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
int memRead32(u32 mem, u32 *out) {
|
||||
int __fastcall memRead32(u32 mem, u32 *out) {
|
||||
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -1915,7 +1915,7 @@ int memRead32(u32 mem, u32 *out) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
int memRead32RS(u32 mem, u64 *out)
|
||||
int __fastcall memRead32RS(u32 mem, u64 *out)
|
||||
{
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -1938,7 +1938,7 @@ int memRead32RS(u32 mem, u64 *out)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int memRead32RU(u32 mem, u64 *out)
|
||||
int __fastcall memRead32RU(u32 mem, u64 *out)
|
||||
{
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -1961,7 +1961,7 @@ int memRead32RU(u32 mem, u64 *out)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int memRead64(u32 mem, u64 *out) {
|
||||
int __fastcall memRead64(u32 mem, u64 *out) {
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
case 0x10000000: *out = hwRead64(mem); return 0;
|
||||
|
@ -1978,7 +1978,7 @@ int memRead64(u32 mem, u64 *out) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
int memRead128(u32 mem, u64 *out) {
|
||||
int __fastcall memRead128(u32 mem, u64 *out) {
|
||||
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -2002,7 +2002,7 @@ int memRead128(u32 mem, u64 *out) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
void memWrite8 (u32 mem, u8 value) {
|
||||
void __fastcall memWrite8 (u32 mem, u8 value) {
|
||||
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -2027,7 +2027,7 @@ void memWrite8 (u32 mem, u8 value) {
|
|||
cpuTlbMissW(mem, cpuRegs.branch);
|
||||
}
|
||||
|
||||
void memWrite16(u32 mem, u16 value) {
|
||||
void __fastcall memWrite16(u32 mem, u16 value) {
|
||||
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -2052,7 +2052,7 @@ void memWrite16(u32 mem, u16 value) {
|
|||
cpuTlbMissW(mem, cpuRegs.branch);
|
||||
}
|
||||
|
||||
void memWrite32(u32 mem, u32 value)
|
||||
void __fastcall memWrite32(u32 mem, u32 value)
|
||||
{
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -2078,7 +2078,7 @@ void memWrite32(u32 mem, u32 value)
|
|||
cpuTlbMissW(mem, cpuRegs.branch);
|
||||
}
|
||||
|
||||
void memWrite64(u32 mem, const u64* value) {
|
||||
void __fastcall memWrite64(u32 mem, const u64* value) {
|
||||
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -2098,7 +2098,7 @@ void memWrite64(u32 mem, const u64* value) {
|
|||
cpuTlbMissW(mem, cpuRegs.branch);
|
||||
}
|
||||
|
||||
void memWrite128(u32 mem, const u64 *value) {
|
||||
void __fastcall memWrite128(u32 mem, const u64 *value) {
|
||||
|
||||
mem = TRANSFORM_ADDR(mem);
|
||||
switch( (mem&~0xffff) ) {
|
||||
|
@ -2436,8 +2436,8 @@ void __fastcall _ext_memWrite128(u32 mem, const u64 *value)
|
|||
template<int vunum>
|
||||
int __fastcall vuMicroRead8(u32 addr,mem8_t* data)
|
||||
{
|
||||
addr&=vunum==0?0xfff:0x3fff;
|
||||
VURegs* vu=vunum==0?&VU0:&VU1;
|
||||
addr&=(vunum==0)?0xfff:0x3fff;
|
||||
VURegs* vu=(vunum==0)?&VU0:&VU1;
|
||||
|
||||
*data=vu->Micro[addr];
|
||||
return 0;
|
||||
|
@ -2445,8 +2445,8 @@ int __fastcall vuMicroRead8(u32 addr,mem8_t* data)
|
|||
template<int vunum>
|
||||
int __fastcall vuMicroRead16(u32 addr,mem16_t* data)
|
||||
{
|
||||
addr&=vunum==0?0xfff:0x3fff;
|
||||
VURegs* vu=vunum==0?&VU0:&VU1;
|
||||
addr&=(vunum==0)?0xfff:0x3fff;
|
||||
VURegs* vu=(vunum==0)?&VU0:&VU1;
|
||||
|
||||
*data=*(u16*)&vu->Micro[addr];
|
||||
return 0;
|
||||
|
@ -2454,8 +2454,8 @@ int __fastcall vuMicroRead16(u32 addr,mem16_t* data)
|
|||
template<int vunum>
|
||||
int __fastcall vuMicroRead32(u32 addr,mem32_t* data)
|
||||
{
|
||||
addr&=vunum==0?0xfff:0x3fff;
|
||||
VURegs* vu=vunum==0?&VU0:&VU1;
|
||||
addr&=(vunum==0)?0xfff:0x3fff;
|
||||
VURegs* vu=(vunum==0)?&VU0:&VU1;
|
||||
|
||||
*data=*(u32*)&vu->Micro[addr];
|
||||
return 0;
|
||||
|
@ -2463,8 +2463,8 @@ int __fastcall vuMicroRead32(u32 addr,mem32_t* data)
|
|||
template<int vunum>
|
||||
int __fastcall vuMicroRead64(u32 addr,mem64_t* data)
|
||||
{
|
||||
addr&=vunum==0?0xfff:0x3fff;
|
||||
VURegs* vu=vunum==0?&VU0:&VU1;
|
||||
addr&=(vunum==0)?0xfff:0x3fff;
|
||||
VURegs* vu=(vunum==0)?&VU0:&VU1;
|
||||
|
||||
*data=*(u64*)&vu->Micro[addr];
|
||||
return 0;
|
||||
|
@ -2472,8 +2472,8 @@ int __fastcall vuMicroRead64(u32 addr,mem64_t* data)
|
|||
template<int vunum>
|
||||
int __fastcall vuMicroRead128(u32 addr,mem128_t* data)
|
||||
{
|
||||
addr&=vunum==0?0xfff:0x3fff;
|
||||
VURegs* vu=vunum==0?&VU0:&VU1;
|
||||
addr&=(vunum==0)?0xfff:0x3fff;
|
||||
VURegs* vu=(vunum==0)?&VU0:&VU1;
|
||||
|
||||
data[0]=*(u64*)&vu->Micro[addr];
|
||||
data[1]=*(u64*)&vu->Micro[addr+8];
|
||||
|
@ -2482,8 +2482,8 @@ int __fastcall vuMicroRead128(u32 addr,mem128_t* data)
|
|||
template<int vunum>
|
||||
void __fastcall vuMicroWrite8(u32 addr,mem8_t data)
|
||||
{
|
||||
addr&=vunum==0?0xfff:0x3fff;
|
||||
VURegs* vu=vunum==0?&VU0:&VU1;
|
||||
addr&=(vunum==0)?0xfff:0x3fff;
|
||||
VURegs* vu=(vunum==0)?&VU0:&VU1;
|
||||
|
||||
if (vu->Micro[addr]!=data)
|
||||
{
|
||||
|
@ -2498,8 +2498,8 @@ void __fastcall vuMicroWrite8(u32 addr,mem8_t data)
|
|||
template<int vunum>
|
||||
void __fastcall vuMicroWrite16(u32 addr,mem16_t data)
|
||||
{
|
||||
addr&=vunum==0?0xfff:0x3fff;
|
||||
VURegs* vu=vunum==0?&VU0:&VU1;
|
||||
addr&=(vunum==0)?0xfff:0x3fff;
|
||||
VURegs* vu=(vunum==0)?&VU0:&VU1;
|
||||
|
||||
if (*(u16*)&vu->Micro[addr]!=data)
|
||||
{
|
||||
|
@ -2514,8 +2514,8 @@ void __fastcall vuMicroWrite16(u32 addr,mem16_t data)
|
|||
template<int vunum>
|
||||
void __fastcall vuMicroWrite32(u32 addr,mem32_t data)
|
||||
{
|
||||
addr&=vunum==0?0xfff:0x3fff;
|
||||
VURegs* vu=vunum==0?&VU0:&VU1;
|
||||
addr&=(vunum==0)?0xfff:0x3fff;
|
||||
VURegs* vu=(vunum==0)?&VU0:&VU1;
|
||||
|
||||
if (*(u32*)&vu->Micro[addr]!=data)
|
||||
{
|
||||
|
@ -2530,8 +2530,8 @@ void __fastcall vuMicroWrite32(u32 addr,mem32_t data)
|
|||
template<int vunum>
|
||||
void __fastcall vuMicroWrite64(u32 addr,const mem64_t* data)
|
||||
{
|
||||
addr&=vunum==0?0xfff:0x3fff;
|
||||
VURegs* vu=vunum==0?&VU0:&VU1;;
|
||||
addr&=(vunum==0)?0xfff:0x3fff;
|
||||
VURegs* vu=(vunum==0)?&VU0:&VU1;;
|
||||
|
||||
if (*(u64*)&vu->Micro[addr]!=data[0])
|
||||
{
|
||||
|
@ -2546,8 +2546,8 @@ void __fastcall vuMicroWrite64(u32 addr,const mem64_t* data)
|
|||
template<int vunum>
|
||||
void __fastcall vuMicroWrite128(u32 addr,const mem128_t* data)
|
||||
{
|
||||
addr&=vunum==0?0xfff:0x3fff;
|
||||
VURegs* vu=vunum==0?&VU0:&VU1;
|
||||
addr&=(vunum==0)?0xfff:0x3fff;
|
||||
VURegs* vu=(vunum==0)?&VU0:&VU1;
|
||||
|
||||
if (*(u64*)&vu->Micro[addr]!=data[0] || *(u64*)&vu->Micro[addr+8]!=data[1])
|
||||
{
|
||||
|
|
119
pcsx2/Memory.h
119
pcsx2/Memory.h
|
@ -66,22 +66,62 @@ struct PSMEMORYMAP
|
|||
|
||||
#define PSM(mem) (PS2MEM_BASE + TRANSFORM_ADDR(mem))
|
||||
|
||||
int memRead8(u32 mem, u8 *out);
|
||||
int memRead8RS(u32 mem, u64 *out);
|
||||
int memRead8RU(u32 mem, u64 *out);
|
||||
int memRead16(u32 mem, u16 *out);
|
||||
int memRead16RS(u32 mem, u64 *out);
|
||||
int memRead16RU(u32 mem, u64 *out);
|
||||
int memRead32(u32 mem, u32 *out);
|
||||
int memRead32RS(u32 mem, u64 *out);
|
||||
int memRead32RU(u32 mem, u64 *out);
|
||||
int memRead64(u32 mem, u64 *out);
|
||||
int memRead128(u32 mem, u64 *out);
|
||||
void memWrite8 (u32 mem, u8 value);
|
||||
void memWrite16(u32 mem, u16 value);
|
||||
void memWrite32(u32 mem, u32 value);
|
||||
void memWrite64(u32 mem, const u64 *value);
|
||||
void memWrite128(u32 mem, const u64 *value);
|
||||
int __fastcall memRead8(u32 mem, u8 *out);
|
||||
int __fastcall memRead8RS(u32 mem, u64 *out);
|
||||
int __fastcall memRead8RU(u32 mem, u64 *out);
|
||||
int __fastcall memRead16(u32 mem, u16 *out);
|
||||
int __fastcall memRead16RS(u32 mem, u64 *out);
|
||||
int __fastcall memRead16RU(u32 mem, u64 *out);
|
||||
int __fastcall memRead32(u32 mem, u32 *out);
|
||||
int __fastcall memRead32RS(u32 mem, u64 *out);
|
||||
int __fastcall memRead32RU(u32 mem, u64 *out);
|
||||
int __fastcall memRead64(u32 mem, u64 *out);
|
||||
int __fastcall memRead128(u32 mem, u64 *out);
|
||||
void __fastcall memWrite8 (u32 mem, u8 value);
|
||||
void __fastcall memWrite16(u32 mem, u16 value);
|
||||
void __fastcall memWrite32(u32 mem, u32 value);
|
||||
void __fastcall memWrite64(u32 mem, const u64 *value);
|
||||
void __fastcall memWrite128(u32 mem, const u64 *value);
|
||||
|
||||
// recMemConstRead8, recMemConstRead16, recMemConstRead32 return 1 if a call was made, 0 otherwise
|
||||
u8 recMemRead8();
|
||||
u16 recMemRead16();
|
||||
u32 recMemRead32();
|
||||
void recMemRead64(u64 *out);
|
||||
void recMemRead128(u64 *out);
|
||||
|
||||
void recMemWrite8();
|
||||
void recMemWrite16();
|
||||
void recMemWrite32();
|
||||
void recMemWrite64();
|
||||
void recMemWrite128();
|
||||
|
||||
void _eeReadConstMem8(int mmreg, u32 mem, int sign);
|
||||
void _eeReadConstMem16(int mmreg, u32 mem, int sign);
|
||||
void _eeReadConstMem32(int mmreg, u32 mem);
|
||||
void _eeReadConstMem128(int mmreg, u32 mem);
|
||||
void _eeWriteConstMem8(u32 mem, int mmreg);
|
||||
void _eeWriteConstMem16(u32 mem, int mmreg);
|
||||
void _eeWriteConstMem32(u32 mem, int mmreg);
|
||||
void _eeWriteConstMem64(u32 mem, int mmreg);
|
||||
void _eeWriteConstMem128(u32 mem, int mmreg);
|
||||
void _eeMoveMMREGtoR(int to, int mmreg);
|
||||
|
||||
// extra ops
|
||||
void _eeWriteConstMem16OP(u32 mem, int mmreg, int op);
|
||||
void _eeWriteConstMem32OP(u32 mem, int mmreg, int op);
|
||||
|
||||
int recMemConstRead8(u32 x86reg, u32 mem, u32 sign);
|
||||
int recMemConstRead16(u32 x86reg, u32 mem, u32 sign);
|
||||
int recMemConstRead32(u32 x86reg, u32 mem);
|
||||
void recMemConstRead64(u32 mem, int mmreg);
|
||||
void recMemConstRead128(u32 mem, int xmmreg);
|
||||
|
||||
int recMemConstWrite8(u32 mem, int mmreg);
|
||||
int recMemConstWrite16(u32 mem, int mmreg);
|
||||
int recMemConstWrite32(u32 mem, int mmreg);
|
||||
int recMemConstWrite64(u32 mem, int mmreg);
|
||||
int recMemConstWrite128(u32 mem, int xmmreg);
|
||||
|
||||
#else
|
||||
|
||||
|
@ -181,20 +221,6 @@ void memSetPageAddr(u32 vaddr, u32 paddr);
|
|||
void memClearPageAddr(u32 vaddr);
|
||||
void memShutdown();
|
||||
|
||||
// recMemConstRead8, recMemConstRead16, recMemConstRead32 return 1 if a call was made, 0 otherwise
|
||||
u8 recMemRead8();
|
||||
u16 recMemRead16();
|
||||
u32 recMemRead32();
|
||||
void recMemRead64(u64 *out);
|
||||
void recMemRead128(u64 *out);
|
||||
|
||||
// returns 1 if mem should be cleared
|
||||
void recMemWrite8();
|
||||
void recMemWrite16();
|
||||
void recMemWrite32();
|
||||
void recMemWrite64();
|
||||
void recMemWrite128();
|
||||
|
||||
#ifdef _WIN32
|
||||
int SysPageFaultExceptionFilter(EXCEPTION_POINTERS* eps);
|
||||
#endif
|
||||
|
@ -255,39 +281,6 @@ void __fastcall _memWrite128(u32 mem, u64 *value);
|
|||
#define recMemConstWrite32 0&&
|
||||
#define recMemConstWrite64 0&&
|
||||
#define recMemConstWrite128 0&&
|
||||
|
||||
#else // PCSX2_VIRTUAL_MEM
|
||||
|
||||
// VM only functions
|
||||
|
||||
void _eeReadConstMem8(int mmreg, u32 mem, int sign);
|
||||
void _eeReadConstMem16(int mmreg, u32 mem, int sign);
|
||||
void _eeReadConstMem32(int mmreg, u32 mem);
|
||||
void _eeReadConstMem128(int mmreg, u32 mem);
|
||||
void _eeWriteConstMem8(u32 mem, int mmreg);
|
||||
void _eeWriteConstMem16(u32 mem, int mmreg);
|
||||
void _eeWriteConstMem32(u32 mem, int mmreg);
|
||||
void _eeWriteConstMem64(u32 mem, int mmreg);
|
||||
void _eeWriteConstMem128(u32 mem, int mmreg);
|
||||
void _eeMoveMMREGtoR(int to, int mmreg);
|
||||
|
||||
// extra ops
|
||||
void _eeWriteConstMem16OP(u32 mem, int mmreg, int op);
|
||||
void _eeWriteConstMem32OP(u32 mem, int mmreg, int op);
|
||||
|
||||
int recMemConstRead8(u32 x86reg, u32 mem, u32 sign);
|
||||
int recMemConstRead16(u32 x86reg, u32 mem, u32 sign);
|
||||
int recMemConstRead32(u32 x86reg, u32 mem);
|
||||
void recMemConstRead64(u32 mem, int mmreg);
|
||||
void recMemConstRead128(u32 mem, int xmmreg);
|
||||
|
||||
int recMemConstWrite8(u32 mem, int mmreg);
|
||||
int recMemConstWrite16(u32 mem, int mmreg);
|
||||
int recMemConstWrite32(u32 mem, int mmreg);
|
||||
int recMemConstWrite64(u32 mem, int mmreg);
|
||||
int recMemConstWrite128(u32 mem, int xmmreg);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
12
pcsx2/Misc.c
12
pcsx2/Misc.c
|
@ -571,8 +571,16 @@ int LoadState(const char *file) {
|
|||
if( dwCurSaveStateVer != g_SaveVersion ) {
|
||||
|
||||
#ifdef PCSX2_VIRTUAL_MEM
|
||||
if( dwCurSaveStateVer >= 0x8b400000 )
|
||||
{
|
||||
gzclose(f);
|
||||
SysPrintf(
|
||||
"Savestate load aborted:\n"
|
||||
" VM edition cannot safely load savestates created by the VTLB edition.\n" );
|
||||
return 0;
|
||||
}
|
||||
// pcsx2 vm supports opening these formats
|
||||
if( dwCurSaveStateVer != 0x7a30000d && dwCurSaveStateVer != 0x7a30000e && dwCurSaveStateVer != 0x7a30000f) {
|
||||
if( dwCurSaveStateVer < 0x7a30000d) {
|
||||
gzclose(f);
|
||||
SysPrintf("Unsupported savestate version: %x.\n", dwCurSaveStateVer );
|
||||
return 0;
|
||||
|
@ -581,7 +589,7 @@ int LoadState(const char *file) {
|
|||
gzclose(f);
|
||||
SysPrintf(
|
||||
"Savestate load aborted:\n"
|
||||
" vTlb edition cannot safely load savestates created by the VM edition.\n" );
|
||||
" VTLB edition cannot safely load savestates created by the VM edition.\n" );
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -68,37 +68,6 @@
|
|||
#define COMMONdefs
|
||||
#endif
|
||||
|
||||
// jASSUME - give hints to the optimizer
|
||||
// This is primarily useful for the default case switch optimizer, which enables VC to
|
||||
// generate more compact switches.
|
||||
|
||||
#ifdef NDEBUG
|
||||
# define jBREAKPOINT() ((void) 0)
|
||||
# ifdef _MSC_VER
|
||||
# define jASSUME(exp) (__assume(exp))
|
||||
# else
|
||||
# define jASSUME(exp) ((void) sizeof(exp))
|
||||
# endif
|
||||
#else
|
||||
# if defined(_MSC_VER)
|
||||
# define jBREAKPOINT() do { __asm int 3 } while(0)
|
||||
# else
|
||||
# define jBREAKPOINT() ((void) *(volatile char *) 0)
|
||||
# endif
|
||||
# define jASSUME(exp) if(exp) ; else jBREAKPOINT()
|
||||
#endif
|
||||
|
||||
// disable the default case in a switch
|
||||
#define jNO_DEFAULT \
|
||||
{ \
|
||||
break; \
|
||||
\
|
||||
default: \
|
||||
jASSUME(0); \
|
||||
break; \
|
||||
}
|
||||
|
||||
|
||||
// PS2EgetLibType returns (may be OR'd)
|
||||
#define PS2E_LT_GS 0x01
|
||||
#define PS2E_LT_PAD 0x02 // -=[ OBSOLETE ]=-
|
||||
|
|
|
@ -30,6 +30,36 @@
|
|||
#define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0]))
|
||||
#endif
|
||||
|
||||
// jASSUME - give hints to the optimizer
|
||||
// This is primarily useful for the default case switch optimizer, which enables VC to
|
||||
// generate more compact switches.
|
||||
|
||||
#ifdef NDEBUG
|
||||
# define jBREAKPOINT() ((void) 0)
|
||||
# ifdef _MSC_VER
|
||||
# define jASSUME(exp) (__assume(exp))
|
||||
# else
|
||||
# define jASSUME(exp) ((void) sizeof(exp))
|
||||
# endif
|
||||
#else
|
||||
# if defined(_MSC_VER)
|
||||
# define jBREAKPOINT() do { __asm int 3 } while(0)
|
||||
# else
|
||||
# define jBREAKPOINT() ((void) *(volatile char *) 0)
|
||||
# endif
|
||||
# define jASSUME(exp) if(exp) ; else jBREAKPOINT()
|
||||
#endif
|
||||
|
||||
// disable the default case in a switch
|
||||
#define jNO_DEFAULT \
|
||||
{ \
|
||||
break; \
|
||||
\
|
||||
default: \
|
||||
jASSUME(0); \
|
||||
break; \
|
||||
}
|
||||
|
||||
|
||||
// Basic types
|
||||
#if defined(_MSC_VER)
|
||||
|
@ -44,6 +74,8 @@ typedef unsigned __int16 u16;
|
|||
typedef unsigned __int32 u32;
|
||||
typedef unsigned __int64 u64;
|
||||
|
||||
typedef unsigned int uint;
|
||||
|
||||
#define PCSX2_ALIGNED(alig,x) __declspec(align(alig)) x
|
||||
#define PCSX2_ALIGNED16(x) __declspec(align(16)) x
|
||||
#define PCSX2_ALIGNED16_DECL(x) __declspec(align(16)) x
|
||||
|
@ -79,8 +111,11 @@ typedef unsigned char u8;
|
|||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned long long u64;
|
||||
|
||||
#endif
|
||||
|
||||
typedef unsigned int uint;
|
||||
|
||||
#define LONG long
|
||||
typedef union _LARGE_INTEGER
|
||||
{
|
||||
|
|
|
@ -1631,7 +1631,7 @@ static int Vif1TransDirectHL(u32 *data){
|
|||
dst[1] = src[1];
|
||||
|
||||
GSRINGBUF_DONECOPY(gsmem, 16);
|
||||
GSgifTransferDummy(1, (u32*)splittransfer[0], 1);
|
||||
GSgifTransferDummy(1, (u8*)splittransfer[0], 1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1675,7 +1675,7 @@ static int Vif1TransDirectHL(u32 *data){
|
|||
//unaligned copy.VIF handling is -very- messy, so i'l use this code til i fix it :)
|
||||
memcpy_raz_u(gsmem,data,ret<<2);
|
||||
GSRINGBUF_DONECOPY(gsmem, ret<<2);
|
||||
GSgifTransferDummy(1, data, ret>>2);
|
||||
GSgifTransferDummy(1, (u8*)data, ret>>2);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -26,15 +26,15 @@
|
|||
|
||||
#define verify(x) {if (!(x)) { (*(u8*)0)=3; }}
|
||||
|
||||
const u32 VTLB_PAGE_BITS =12;
|
||||
const u32 VTLB_PAGE_MASK=(4095);
|
||||
const u32 VTLB_PAGE_SIZE=(4096);
|
||||
static const uint VTLB_PAGE_BITS =12;
|
||||
static const uint VTLB_PAGE_MASK=(4095);
|
||||
static const uint VTLB_PAGE_SIZE=(4096);
|
||||
|
||||
const u32 VTLB_PMAP_ITEMS=(0x20000000/VTLB_PAGE_SIZE);
|
||||
const u32 VTLB_PMAP_SZ=0x20000000;
|
||||
const u32 VTLB_VMAP_ITEMS=(0x100000000ULL/VTLB_PAGE_SIZE);
|
||||
s32 pmap[VTLB_PMAP_ITEMS]; //512KB
|
||||
s32 vmap[VTLB_VMAP_ITEMS]; //4MB
|
||||
static const uint VTLB_PMAP_ITEMS=(0x20000000/VTLB_PAGE_SIZE);
|
||||
static const uint VTLB_PMAP_SZ=0x20000000;
|
||||
static const uint VTLB_VMAP_ITEMS=(0x100000000ULL/VTLB_PAGE_SIZE);
|
||||
static s32 pmap[VTLB_PMAP_ITEMS]; //512KB
|
||||
static s32 vmap[VTLB_VMAP_ITEMS]; //4MB
|
||||
|
||||
//5 -> one for each size
|
||||
//2 -> read/write
|
||||
|
@ -204,7 +204,7 @@ void __fastcall vtlb_memWrite128(u32 mem, const u64 *value)
|
|||
MemOp_w1<128,u64>(mem,value);
|
||||
}
|
||||
|
||||
int vtlb_Miss(u32 addr,u32 mode)
|
||||
static __forceinline int vtlb_Miss(u32 addr,u32 mode)
|
||||
{
|
||||
SysPrintf("vtlb miss : addr 0x%X, mode %d\n",addr,mode);
|
||||
verify(false);
|
||||
|
@ -215,7 +215,7 @@ int vtlb_Miss(u32 addr,u32 mode)
|
|||
|
||||
return -1;
|
||||
}
|
||||
int vtlb_BusError(u32 addr,u32 mode)
|
||||
static __forceinline int vtlb_BusError(u32 addr,u32 mode)
|
||||
{
|
||||
SysPrintf("vtlb bus error : addr 0x%X, mode %d\n",addr,mode);
|
||||
verify(false);
|
||||
|
@ -303,7 +303,7 @@ void vtlb_MapHandler(vtlbHandler handler,u32 start,u32 size)
|
|||
verify(0==(size&VTLB_PAGE_MASK) && size>0);
|
||||
s32 value=handler|0x80000000;
|
||||
|
||||
while(size)
|
||||
while(size>0)
|
||||
{
|
||||
pmap[start>>VTLB_PAGE_BITS]=value;
|
||||
|
||||
|
@ -322,7 +322,7 @@ void vtlb_MapBlock(void* base,u32 start,u32 size,u32 blocksize)
|
|||
verify(0==(blocksize&VTLB_PAGE_MASK) && blocksize>0);
|
||||
verify(0==(size%blocksize));
|
||||
|
||||
while(size)
|
||||
while(size>0)
|
||||
{
|
||||
u32 blocksz=blocksize;
|
||||
s32 ptr=baseint;
|
||||
|
@ -344,7 +344,7 @@ void vtlb_Mirror(u32 new_region,u32 start,u32 size)
|
|||
verify(0==(start&VTLB_PAGE_MASK));
|
||||
verify(0==(size&VTLB_PAGE_MASK) && size>0);
|
||||
|
||||
while(size)
|
||||
while(size>0)
|
||||
{
|
||||
pmap[start>>VTLB_PAGE_BITS]=pmap[new_region>>VTLB_PAGE_BITS];
|
||||
|
||||
|
@ -354,7 +354,7 @@ void vtlb_Mirror(u32 new_region,u32 start,u32 size)
|
|||
}
|
||||
}
|
||||
|
||||
void* vtlb_GetPhyPtr(u32 paddr)
|
||||
__forceinline void* vtlb_GetPhyPtr(u32 paddr)
|
||||
{
|
||||
if (paddr>=VTLB_PMAP_SZ || pmap[paddr>>VTLB_PAGE_BITS]<0)
|
||||
return 0;
|
||||
|
@ -372,7 +372,6 @@ void vtlb_VMap(u32 vaddr,u32 paddr,u32 sz)
|
|||
|
||||
while(sz>0)
|
||||
{
|
||||
|
||||
s32 pme;
|
||||
if (paddr>=VTLB_PMAP_SZ)
|
||||
{
|
||||
|
|
|
@ -37,7 +37,7 @@ vtlbHandler vtlb_RegisterHandler( vltbMemR8FP* r8,vltbMemR16FP* r16,vltbMemR32FP
|
|||
|
||||
void vtlb_MapHandler(vtlbHandler handler,u32 start,u32 size);
|
||||
void vtlb_MapBlock(void* base,u32 start,u32 size,u32 blocksize=0);
|
||||
void* vtlb_GetPhyPtr(u32 paddr);
|
||||
extern void* vtlb_GetPhyPtr(u32 paddr);
|
||||
//void vtlb_Mirror(u32 new_region,u32 start,u32 size); // -> not working yet :(
|
||||
|
||||
//virtual mappings
|
||||
|
|
|
@ -2393,7 +2393,7 @@ void VU1XGKICK_MTGSTransfer(u32 *pMem, u32 addr)
|
|||
static int scount = 0;
|
||||
++scount;
|
||||
|
||||
size = GSgifTransferDummy(0, data, (0x4000-(addr&0x3fff))>>4);
|
||||
size = GSgifTransferDummy(0, (u8*)data, (0x4000-(addr&0x3fff))>>4);
|
||||
|
||||
size = 0x4000-(size<<4)-(addr&0x3fff);
|
||||
assert( size >= 0 );
|
||||
|
|
|
@ -3798,7 +3798,7 @@ void SetFastMemory(int bSetFast)
|
|||
// nothing
|
||||
}
|
||||
|
||||
void vtlb_DynGenOp(bool Read,u32 sz)
|
||||
static __forceinline void vtlb_DynGenOp(bool Read,u32 sz)
|
||||
{
|
||||
int reg=-1;
|
||||
|
||||
|
|
Loading…
Reference in New Issue