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
|
@ -285,6 +285,39 @@ static void DynGen_IndirectDispatch( int mode, int bits, bool sign = false )
|
||||||
xJS( GetIndirectDispatcherPtr( mode, szidx, sign ) );
|
xJS( GetIndirectDispatcherPtr( mode, szidx, sign ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
// Generates the various instances of the indirect dispatchers
|
||||||
|
static void DynGen_IndirectTlbDispatcher( int mode, int bits, bool sign )
|
||||||
|
{
|
||||||
|
xMOVZX( eax, al );
|
||||||
|
xSUB( ecx, 0x80000000 );
|
||||||
|
xSUB( ecx, eax );
|
||||||
|
|
||||||
|
// jump to the indirect handler, which is a __fastcall C++ function.
|
||||||
|
// [ecx is address, edx is data]
|
||||||
|
xFastCall(ptr32[(eax*4) + vtlbdata.RWFT[bits][mode]], ecx, edx);
|
||||||
|
|
||||||
|
if (!mode)
|
||||||
|
{
|
||||||
|
if (bits == 0)
|
||||||
|
{
|
||||||
|
if (sign)
|
||||||
|
xMOVSX(eax, al);
|
||||||
|
else
|
||||||
|
xMOVZX(eax, al);
|
||||||
|
}
|
||||||
|
else if (bits == 1)
|
||||||
|
{
|
||||||
|
if (sign)
|
||||||
|
xMOVSX(eax, ax);
|
||||||
|
else
|
||||||
|
xMOVZX(eax, ax);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
xJMP( ebx );
|
||||||
|
}
|
||||||
|
|
||||||
// One-time initialization procedure. Multiple subsequent calls during the lifespan of the
|
// One-time initialization procedure. Multiple subsequent calls during the lifespan of the
|
||||||
// process will be ignored.
|
// process will be ignored.
|
||||||
//
|
//
|
||||||
|
@ -308,33 +341,7 @@ void vtlb_dynarec_init()
|
||||||
{
|
{
|
||||||
xSetPtr( GetIndirectDispatcherPtr( mode, bits, !!sign ) );
|
xSetPtr( GetIndirectDispatcherPtr( mode, bits, !!sign ) );
|
||||||
|
|
||||||
xMOVZX( eax, al );
|
DynGen_IndirectTlbDispatcher( mode, bits, sign );
|
||||||
xSUB( ecx, 0x80000000 );
|
|
||||||
xSUB( ecx, eax );
|
|
||||||
|
|
||||||
// jump to the indirect handler, which is a __fastcall C++ function.
|
|
||||||
// [ecx is address, edx is data]
|
|
||||||
xFastCall(ptr32[(eax*4) + vtlbdata.RWFT[bits][mode]], ecx, edx);
|
|
||||||
|
|
||||||
if (!mode)
|
|
||||||
{
|
|
||||||
if (bits == 0)
|
|
||||||
{
|
|
||||||
if (sign)
|
|
||||||
xMOVSX(eax, al);
|
|
||||||
else
|
|
||||||
xMOVZX(eax, al);
|
|
||||||
}
|
|
||||||
else if (bits == 1)
|
|
||||||
{
|
|
||||||
if (sign)
|
|
||||||
xMOVSX(eax, ax);
|
|
||||||
else
|
|
||||||
xMOVZX(eax, ax);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
xJMP( ebx );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue