mirror of https://github.com/PCSX2/pcsx2.git
recVtlb: separate dispatcher generation into a dedicated function
This commit is contained in:
parent
8a9a56707c
commit
d78f887d1c
pcsx2/x86/ix86-32
|
@ -285,29 +285,10 @@ static void DynGen_IndirectDispatch( int mode, int bits, bool sign = false )
|
|||
xJS( GetIndirectDispatcherPtr( mode, szidx, sign ) );
|
||||
}
|
||||
|
||||
// One-time initialization procedure. Multiple subsequent calls during the lifespan of the
|
||||
// process will be ignored.
|
||||
//
|
||||
void vtlb_dynarec_init()
|
||||
// ------------------------------------------------------------------------
|
||||
// Generates the various instances of the indirect dispatchers
|
||||
static void DynGen_IndirectTlbDispatcher( int mode, int bits, bool sign )
|
||||
{
|
||||
static bool hasBeenCalled = false;
|
||||
if (hasBeenCalled) return;
|
||||
hasBeenCalled = true;
|
||||
|
||||
// In case init gets called multiple times:
|
||||
HostSys::MemProtectStatic( m_IndirectDispatchers, PageAccess_ReadWrite() );
|
||||
|
||||
// clear the buffer to 0xcc (easier debugging).
|
||||
memset_8<0xcc,0x1000>( m_IndirectDispatchers );
|
||||
|
||||
for( int mode=0; mode<2; ++mode )
|
||||
{
|
||||
for( int bits=0; bits<5; ++bits )
|
||||
{
|
||||
for (int sign = 0; sign < (!mode && bits < 2 ? 2 : 1); sign++)
|
||||
{
|
||||
xSetPtr( GetIndirectDispatcherPtr( mode, bits, !!sign ) );
|
||||
|
||||
xMOVZX( eax, al );
|
||||
xSUB( ecx, 0x80000000 );
|
||||
xSUB( ecx, eax );
|
||||
|
@ -335,6 +316,32 @@ void vtlb_dynarec_init()
|
|||
}
|
||||
|
||||
xJMP( ebx );
|
||||
}
|
||||
|
||||
// One-time initialization procedure. Multiple subsequent calls during the lifespan of the
|
||||
// process will be ignored.
|
||||
//
|
||||
void vtlb_dynarec_init()
|
||||
{
|
||||
static bool hasBeenCalled = false;
|
||||
if (hasBeenCalled) return;
|
||||
hasBeenCalled = true;
|
||||
|
||||
// In case init gets called multiple times:
|
||||
HostSys::MemProtectStatic( m_IndirectDispatchers, PageAccess_ReadWrite() );
|
||||
|
||||
// clear the buffer to 0xcc (easier debugging).
|
||||
memset_8<0xcc,0x1000>( m_IndirectDispatchers );
|
||||
|
||||
for( int mode=0; mode<2; ++mode )
|
||||
{
|
||||
for( int bits=0; bits<5; ++bits )
|
||||
{
|
||||
for (int sign = 0; sign < (!mode && bits < 2 ? 2 : 1); sign++)
|
||||
{
|
||||
xSetPtr( GetIndirectDispatcherPtr( mode, bits, !!sign ) );
|
||||
|
||||
DynGen_IndirectTlbDispatcher( mode, bits, sign );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue