diff --git a/Source/Core/Core/Src/Boot/ElfReader.cpp b/Source/Core/Core/Src/Boot/ElfReader.cpp index 7ac5634380..1fa0fc8d19 100644 --- a/Source/Core/Core/Src/Boot/ElfReader.cpp +++ b/Source/Core/Core/Src/Boot/ElfReader.cpp @@ -131,7 +131,7 @@ bool ElfReader::LoadInto(u32 vaddr) u32 segmentVAddr[32]; u32 baseAddress = bRelocate?vaddr:0; - for (int i=0; ie_phnum; i++) + for (int i = 0; i < header->e_phnum; i++) { Elf32_Phdr *p = segments + i; @@ -146,22 +146,16 @@ bool ElfReader::LoadInto(u32 vaddr) u8 *dst = Memory::GetPointer(writeAddr); u32 srcSize = p->p_filesz; u32 dstSize = p->p_memsz; - //PSPHLE::userMemory.AllocAt(writeAddr, dstSize); - //memcpy(dst, src, srcSize); u32 *s = (u32*)src; u32 *d = (u32*)dst; - - //TODO : remove byteswapping - for (int i=0; i<(int)srcSize/4+1; i++) + for (int j = 0; j < (int)(srcSize + 3) / 4; j++) { *d++ = /*_byteswap_ulong*/(*s++); } - if (srcSize < dstSize) { //memset(dst + srcSize, 0, dstSize-srcSize); //zero out bss } - LOG(MASTER_LOG,"Loadable Segment Copied to %08x, size %08x", writeAddr, p->p_memsz); } } diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index ac23b98ca8..fbb9b20550 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -337,7 +337,6 @@ namespace Jit64 JMP(Asm::testExceptions, true); } - const u8* DoJit(u32 emaddress, JitBlock &b) { _assert_msg_(DYNA_REC, emaddress != 0, "ERROR - Trying to compile at 0. LR=%08x",LR); @@ -391,13 +390,7 @@ namespace Jit64 js.op = &ops[i]; js.instructionNumber = i; if (i == (int)size - 1) js.isLastInstruction = true; - //PPCTables::CompileInstruction(ops[i].inst); -#ifndef _WIN32 - if (!js.isLastInstruction) - Default(ops[i].inst); - else -#endif - PPCTables::CompileInstruction(ops[i].inst); + PPCTables::CompileInstruction(ops[i].inst); gpr.SanityCheck(); fpr.SanityCheck(); } diff --git a/Source/Core/Core/Src/PowerPC/Jit64/JitRegCache.cpp b/Source/Core/Core/Src/PowerPC/Jit64/JitRegCache.cpp index ce7f59db70..15618ff82e 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/JitRegCache.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/JitRegCache.cpp @@ -382,7 +382,7 @@ namespace Jit64 _assert_msg_(DYNA_REC, xr >= 0 && xr < NUMXREGS, "WTF - store - invalid reg"); xregs[xr].free = true; xregs[xr].dirty = false; - xregs[xr].ppcReg=-1; + xregs[xr].ppcReg = -1; OpArg newLoc = GetDefaultLocation(i); MOVAPD(newLoc, xr); regs[i].location = newLoc; diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp index 44939cd9c8..d1dcba61c2 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp @@ -335,6 +335,10 @@ namespace Jit64 MOVAPS(MComplex(EBX, EAX, SCALE_1, 16), XMM0); } +#ifndef _WIN32 +#define INSTRUCTION_START Default(inst); return; +#endif + void stX(UGeckoInstruction inst) { INSTRUCTION_START; diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp index 514bc3ed39..31644355aa 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp @@ -35,8 +35,11 @@ #include "JitAsm.h" #include "JitRegCache.h" -// #define INSTRUCTION_START Default(inst); return; +#ifdef _WIN32 #define INSTRUCTION_START +#else +#define INSTRUCTION_START Default(inst); return; +#endif #ifdef _M_IX86 #define DISABLE_32BIT Default(inst); return; @@ -48,8 +51,6 @@ namespace Jit64 { static double GC_ALIGNED16(psTemp[2]) = {1.0, 1.0}; static u64 GC_ALIGNED16(temp64); -static u32 GC_ALIGNED16(temp32); -static u32 temp; // TODO(ector): Improve 64-bit version void WriteDual32(u64 value, u32 address) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp index 1a76157fd0..0c9136e6ea 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp @@ -32,7 +32,7 @@ u32 s_nTargetWidth = 0, s_nTargetHeight = 0; u32 g_AAx = 0, g_AAy = 0; #ifndef _WIN32 -static GLWindow GLWin; +GLWindow GLWin; #endif #ifdef _WIN32