Tweaks; timebase supports TBU.

This commit is contained in:
Ben Vanik 2015-01-06 00:13:27 -08:00
parent 672ecdf252
commit 3658e710d2
3 changed files with 17 additions and 3 deletions

View File

@ -555,7 +555,14 @@ XEEMITTER(mfspr, 0x7C0002A6, XFX)(PPCHIRBuilder& f, InstrData& i) {
// CTR
v = f.LoadCTR();
break;
// 268 + 269 = TB + TBU
case 268:
// TB
v = f.LoadClock();
break;
case 269:
// TBU
v = f.Shr(f.LoadClock(), 32);
break;
default:
XEINSTRNOTIMPLEMENTED();
return 1;
@ -566,8 +573,14 @@ XEEMITTER(mfspr, 0x7C0002A6, XFX)(PPCHIRBuilder& f, InstrData& i) {
XEEMITTER(mftb, 0x7C0002E6, XFX)(PPCHIRBuilder& f, InstrData& i) {
Value* time = f.LoadClock();
const uint32_t n = ((i.XFX.spr & 0x1F) << 5) | ((i.XFX.spr >> 5) & 0x1F);
if (n == 268) {
// TB - full bits.
} else {
// TBU - upper bits only.
time = f.Shr(time, 32);
}
f.StoreGPR(i.XFX.RT, time);
return 0;
}

View File

@ -30,7 +30,7 @@ X_RESULT XXMPApp::XMPGetStatusEx(uint32_t unk, uint32_t unk_ptr,
uint32_t disabled_ptr) {
// Some stupid games will hammer this on a thread - induce a delay
// here to keep from starving real threads.
Sleep(1);
Sleep(10);
XELOGD("XMPGetStatusEx(%.8X, %.8X, %.8X)", unk, unk_ptr, disabled_ptr);

View File

@ -246,6 +246,7 @@ SHIM_CALL XexGetProcedureAddress_shim(PPCContext* ppc_state,
out_function_ptr);
X_STATUS result = X_STATUS_INVALID_HANDLE;
SHIM_SET_MEM_32(out_function_ptr, 0xDEADF00D);
XModule* module = NULL;