Fix sign extension bug from hardware reads. Mainly seems to affect homebrew apps.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@193 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
e4792fafaf
commit
96ca347bdc
|
@ -33,7 +33,7 @@ CDolLoader::CDolLoader(const char* _szFilename) : m_bInit(false)
|
||||||
p[i] = Common::swap32(p[i]);
|
p[i] = Common::swap32(p[i]);
|
||||||
|
|
||||||
// load all text (code) sections
|
// load all text (code) sections
|
||||||
for(int i=0; i<DOL_NUM_TEXT; i++)
|
for(int i = 0; i < DOL_NUM_TEXT; i++)
|
||||||
{
|
{
|
||||||
if(m_dolheader.textOffset[i] != 0)
|
if(m_dolheader.textOffset[i] != 0)
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ CDolLoader::CDolLoader(const char* _szFilename) : m_bInit(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// load all data sections
|
// load all data sections
|
||||||
for(int i=0; i<DOL_NUM_DATA; i++)
|
for(int i = 0; i < DOL_NUM_DATA; i++)
|
||||||
{
|
{
|
||||||
if(m_dolheader.dataOffset[i] != 0)
|
if(m_dolheader.dataOffset[i] != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,8 +15,10 @@
|
||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
#include "Thunk.h"
|
||||||
|
|
||||||
#include "../PowerPC.h"
|
#include "../PowerPC.h"
|
||||||
|
#include "../../CoreTiming.h"
|
||||||
#include "../PPCTables.h"
|
#include "../PPCTables.h"
|
||||||
#include "x64Emitter.h"
|
#include "x64Emitter.h"
|
||||||
|
|
||||||
|
@ -85,7 +87,12 @@ namespace Jit64
|
||||||
if (inst.LK)
|
if (inst.LK)
|
||||||
AND(32, M(&CR), Imm32(~(0xFF000000)));
|
AND(32, M(&CR), Imm32(~(0xFF000000)));
|
||||||
#endif
|
#endif
|
||||||
|
//if (destination == js.compilerPC)
|
||||||
|
//{
|
||||||
|
//PanicAlert("Idle loop detected at %08x", destination);
|
||||||
|
// CALL(ProtectFunction(&CoreTiming::Idle, 0));
|
||||||
|
// JMP(Asm::testExceptions, true);
|
||||||
|
//}
|
||||||
WriteExit(destination, 0);
|
WriteExit(destination, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -106,10 +113,10 @@ namespace Jit64
|
||||||
|
|
||||||
CCFlags branch;
|
CCFlags branch;
|
||||||
|
|
||||||
const bool only_counter_check = ((inst.BO >> 4) & 1);
|
const bool only_counter_check = (inst.BO & 16) ? true : false;
|
||||||
const bool only_condition_check = ((inst.BO >> 2) & 1);
|
const bool only_condition_check = (inst.BO & 4) ? true : false;
|
||||||
if (only_condition_check && only_counter_check)
|
//if (only_condition_check && only_counter_check)
|
||||||
PanicAlert("Bizarre bcx encountered. Likely bad or corrupt code.");
|
// PanicAlert("Bizarre bcx encountered. Likely bad or corrupt code.");
|
||||||
bool doFullTest = (inst.BO & 16) == 0 && (inst.BO & 4) == 0;
|
bool doFullTest = (inst.BO & 16) == 0 && (inst.BO & 4) == 0;
|
||||||
bool ctrDecremented = false;
|
bool ctrDecremented = false;
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,9 @@ void SafeLoadRegToEAX(X64Reg reg, int accessSize, s32 offset, bool signExtend)
|
||||||
case 16: ABI_CallFunctionR(ProtectFunction((void *)&Memory::Read_U16, 1), reg); break;
|
case 16: ABI_CallFunctionR(ProtectFunction((void *)&Memory::Read_U16, 1), reg); break;
|
||||||
case 8: ABI_CallFunctionR(ProtectFunction((void *)&Memory::Read_U8, 1), reg); break;
|
case 8: ABI_CallFunctionR(ProtectFunction((void *)&Memory::Read_U8, 1), reg); break;
|
||||||
}
|
}
|
||||||
|
if (signExtend && accessSize < 32) {
|
||||||
|
MOVSX(32, accessSize, EAX, R(EAX));
|
||||||
|
}
|
||||||
SetJumpTarget(arg2);
|
SetJumpTarget(arg2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue