diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index bb7245489e..3dba513079 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -630,13 +630,7 @@ void VideoThrottle() u32 Speed = VPS * 100 / VideoInterface::TargetRefreshRate; // Settings are shown the same for both extended and summary info - std::string SSettings = StringFromFormat("%s %s", - #ifdef _M_IX86 - _CoreParameter.iCPUCore ? jit->GetName() : "Int32", - #else - _CoreParameter.iCPUCore ? jit->GetName() : "Int64", - #endif - _CoreParameter.bCPUThread ? "DC" : "SC"); + std::string SSettings = StringFromFormat("%s %s", cpu_core_base->GetName(), _CoreParameter.bCPUThread ? "DC" : "SC"); // Use extended or summary information. The summary information does not print the ticks data, // that's more of a debugging interest, it can always be optional of course if someone is interested. diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp index 12103fc701..a2f05a4b82 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp @@ -261,7 +261,11 @@ void Interpreter::ClearCache() const char *Interpreter::GetName() { - return "Interpreter"; +#ifdef _M_X64 + return "Interpreter64"; +#else + return "Interpreter32"; +#endif } Interpreter *Interpreter::getInstance() diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp index eb0d012b2f..9e1346a8ad 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp @@ -521,12 +521,40 @@ void Interpreter::lhzx(UGeckoInstruction _inst) } } +// TODO: is this right? +// FIXME: Should rollback if a DSI occurs void Interpreter::lswx(UGeckoInstruction _inst) { - static bool bFirst = true; - if (bFirst) - PanicAlert("lswx - Instruction unimplemented"); - bFirst = false; + u32 EA = Helper_Get_EA_X(_inst); + u32 n = rSPR(SPR_XER) & 0x7F; + int r = _inst.RD; + int i = 0; + + if (n > 0) + { + m_GPR[r] = 0; + do + { + u32 TempValue = Memory::Read_U8(EA) << (24 - i); + if (PowerPC::ppcState.Exceptions & EXCEPTION_DSI) + { + PanicAlert("DSI exception in lswx."); + NOTICE_LOG(POWERPC, "DSI exception in lswx"); + return; + } + m_GPR[r] |= TempValue; + + EA++; + n--; + i += 8; + if (i == 32) + { + i = 0; + r = (r + 1) & 31; + m_GPR[r] = 0; + } + } while (n > 0); + } } void Interpreter::lwbrx(UGeckoInstruction _inst) @@ -722,12 +750,27 @@ void Interpreter::stswi(UGeckoInstruction _inst) } } +// TODO: is this right? is it DSI interruptible? void Interpreter::stswx(UGeckoInstruction _inst) { - static bool bFirst = true; - if (bFirst) - PanicAlert("stswx - Instruction unimplemented"); - bFirst = false; + u32 EA = Helper_Get_EA_X(_inst); + u32 n = rSPR(SPR_XER) & 0x7F; + int r = _inst.RS; + int i = 0; + + while (n > 0) + { + Memory::Write_U8((m_GPR[r] >> (24 - i)) & 0xFF, EA); + + EA++; + n--; + i += 8; + if (i == 32) + { + i = 0; + r++; + } + } } void Interpreter::stwbrx(UGeckoInstruction _inst) diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Tables.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Tables.cpp index 9ea755cdef..498ac69af8 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Tables.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Tables.cpp @@ -362,11 +362,10 @@ static GekkoOPTemplate table63_2[] = namespace InterpreterTables { -bool initialized = false; - void InitTables() { // once initialized, tables are read-only + static bool initialized = false; if (initialized) return; diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit64_Tables.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit64_Tables.cpp index cebff3a80b..f3bf4c8648 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit64_Tables.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit64_Tables.cpp @@ -392,11 +392,10 @@ void CompileInstruction(PPCAnalyst::CodeOp & op) } } -bool initialized = false; - void InitTables() { // once initialized, tables are read-only + static bool initialized = false; if (initialized) return; diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_Tables.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_Tables.cpp index 29e7573296..7272cc265a 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_Tables.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL_Tables.cpp @@ -395,11 +395,10 @@ void CompileInstruction(PPCAnalyst::CodeOp & op) } } -bool initialized = false; - void InitTables() { // once initialized, tables are read-only + static bool initialized = false; if (initialized) return;