A few tweaks to more often called functions = general speedup :)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@874 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2009-03-31 15:06:27 +00:00
parent 13986ebabf
commit 149f84b00d
3 changed files with 21 additions and 18 deletions

View File

@ -25,15 +25,18 @@
u32 s_iLastCOP0Cycle = 0;
u32 s_iLastPERFCycle[2] = { 0, 0 };
void UpdateCP0Status() {
u32 value = cpuRegs.CP0.n.Status.val;
__releaseinline void UpdateCP0Status() {
//currently the 2 memory modes are not implemented. Given this function is called so much,
//it's commented out for now. Only the interrupt test is needed. (rama)
if (value & 0x06 ||
(value & 0x18) == 0) { // Kernel Mode (KSU = 0 | EXL = 1 | ERL = 1)*/
memSetKernelMode(); // Kernel memory always
} else { // User Mode
memSetUserMode();
}
//u32 value = cpuRegs.CP0.n.Status.val;
//if (value & 0x06 ||
// (value & 0x18) == 0) { // Kernel Mode (KSU = 0 | EXL = 1 | ERL = 1)*/
// memSetKernelMode(); // Kernel memory always
//} else { // User Mode
// memSetUserMode();
//}
cpuTestHwInts();
}

View File

@ -106,7 +106,7 @@ void cpuShutdown()
disR5900FreeSyms();
}
void cpuException(u32 code, u32 bd)
__releaseinline void __fastcall cpuException(u32 code, u32 bd)
{
cpuRegs.branch = 0; // Tells the interpreter that an exception occurred during a branch.
bool errLevel2, checkStatus;
@ -244,7 +244,7 @@ void cpuTestMissingHwInts() {
}
// sets a branch test to occur some time from an arbitrary starting point.
__forceinline int cpuSetNextBranch( u32 startCycle, s32 delta )
__forceinline int __fastcall cpuSetNextBranch( u32 startCycle, s32 delta )
{
// typecast the conditional to signed so that things don't blow up
// if startCycle is greater than our next branch cycle.
@ -258,14 +258,14 @@ __forceinline int cpuSetNextBranch( u32 startCycle, s32 delta )
}
// sets a branch to occur some time from the current cycle
__forceinline int cpuSetNextBranchDelta( s32 delta )
__forceinline int __fastcall cpuSetNextBranchDelta( s32 delta )
{
return cpuSetNextBranch( cpuRegs.cycle, delta );
}
// tests the cpu cycle agaisnt the given start and delta values.
// Returns true if the delta time has passed.
__forceinline int cpuTestCycle( u32 startCycle, s32 delta )
__forceinline int __fastcall cpuTestCycle( u32 startCycle, s32 delta )
{
// typecast the conditional to signed so that things don't explode
// if the startCycle is ahead of our current cpu cycle.
@ -504,7 +504,7 @@ __forceinline bool _cpuBranchTest_Shared()
return vsyncEvent;
}
void cpuTestINTCInts()
__releaseinline void cpuTestINTCInts()
{
if( cpuRegs.interrupt & (1 << 30) ) return;
//if( (cpuRegs.CP0.n.Status.val & 0x10407) != 0x10401 ) return;
@ -556,7 +556,7 @@ __forceinline void cpuTestTIMRInts() {
}
}
void cpuTestHwInts() {
__forceinline void cpuTestHwInts() {
cpuTestINTCInts();
cpuTestDMACInts();
cpuTestTIMRInts();

View File

@ -257,14 +257,14 @@ extern void cpuInit();
extern void cpuReset(); // can throw Exception::FileNotFound.
extern void cpuShutdown();
extern void cpuExecuteBios();
extern void cpuException(u32 code, u32 bd);
extern void __fastcall cpuException(u32 code, u32 bd);
extern void cpuTlbMissR(u32 addr, u32 bd);
extern void cpuTlbMissW(u32 addr, u32 bd);
extern void cpuTestHwInts();
extern int cpuSetNextBranch( u32 startCycle, s32 delta );
extern int cpuSetNextBranchDelta( s32 delta );
extern int cpuTestCycle( u32 startCycle, s32 delta );
extern int __fastcall cpuSetNextBranch( u32 startCycle, s32 delta );
extern int __fastcall cpuSetNextBranchDelta( s32 delta );
extern int __fastcall cpuTestCycle( u32 startCycle, s32 delta );
extern void cpuSetBranch();
extern bool _cpuBranchTest_Shared(); // for internal use by the Dynarecs and Ints inside R5900: