Implemented missing lswx and stswx instructions. Tested with Wii PES 2008 (PAL), which now works (OpenGL devs please take a look at this game).

Changed the scope of some variables introduced in my previous commit (r6132).

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6147 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
anusko 2010-08-29 17:53:55 +00:00
parent ad6ddfa18c
commit 3058a926cf
6 changed files with 60 additions and 22 deletions

View File

@ -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.

View File

@ -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()

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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;