More linux work. Getting a bit closer, but JIT does still not work.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@119 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
3d769df036
commit
53ee26711e
|
@ -1,11 +1,12 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
warnings = ' -Wall -Wwrite-strings -Wfloat-equal -Wshadow -Wpointer-arith -Wcast-qual -Wpacked'
|
warnings = ' -Wall -Wwrite-strings -Wfloat-equal -Wshadow -Wpointer-arith -Wcast-qual -Wpacked -Wno-conversion'
|
||||||
|
|
||||||
nonactive_warnings = '-Wunreachable-code'
|
nonactive_warnings = '-Wunreachable-code'
|
||||||
|
|
||||||
ccflags = '-g -O3 -fno-strict-aliasing -fPIC -msse2 -DLOGGING -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE' + warnings
|
ccflags = '-g -O3 -fno-strict-aliasing -fPIC -msse2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE' + warnings
|
||||||
|
#ccflags += ' -DLOGGING'
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
ccflags += ' -I/opt/local/include'
|
ccflags += ' -I/opt/local/include'
|
||||||
|
@ -47,7 +48,7 @@ else:
|
||||||
"Source/Core/VideoCommon/Src",
|
"Source/Core/VideoCommon/Src",
|
||||||
"Source/Plugins/Plugin_VideoOGL/Src",
|
"Source/Plugins/Plugin_VideoOGL/Src",
|
||||||
"Source/Plugins/Plugin_DSP_NULL/Src",
|
"Source/Plugins/Plugin_DSP_NULL/Src",
|
||||||
"Source/Plugins/Plugin_DSP_LLE/Src",
|
# "Source/Plugins/Plugin_DSP_LLE/Src",
|
||||||
"Source/Plugins/Plugin_PadSimple/Src",
|
"Source/Plugins/Plugin_PadSimple/Src",
|
||||||
"Source/Plugins/Plugin_nJoy_SDL/Src",
|
"Source/Plugins/Plugin_nJoy_SDL/Src",
|
||||||
"Source/Core/DolphinWX/src",
|
"Source/Core/DolphinWX/src",
|
||||||
|
|
|
@ -135,3 +135,4 @@ void ABI_PopAllCalleeSavedRegsAndAdjustStack() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,6 @@
|
||||||
|
|
||||||
// === 32-bit bog standard cdecl, shared between linux and windows ============================
|
// === 32-bit bog standard cdecl, shared between linux and windows ============================
|
||||||
// MacOSX 32-bit is same as System V with a few exceptions that we probably don't care much about.
|
// MacOSX 32-bit is same as System V with a few exceptions that we probably don't care much about.
|
||||||
|
|
||||||
#else
|
#else
|
||||||
// 64 bit calling convention
|
// 64 bit calling convention
|
||||||
|
|
||||||
|
@ -63,7 +62,6 @@
|
||||||
#define ABI_PARAM2 RDX
|
#define ABI_PARAM2 RDX
|
||||||
#define ABI_PARAM3 R8
|
#define ABI_PARAM3 R8
|
||||||
#define ABI_PARAM4 R9
|
#define ABI_PARAM4 R9
|
||||||
|
|
||||||
#else
|
#else
|
||||||
// === 64-bit Unix (hopefully MacOSX too) =====================================================
|
// === 64-bit Unix (hopefully MacOSX too) =====================================================
|
||||||
|
|
||||||
|
@ -92,3 +90,4 @@ void ABI_PushAllCalleeSavedRegsAndAdjustStack();
|
||||||
void ABI_PopAllCalleeSavedRegsAndAdjustStack();
|
void ABI_PopAllCalleeSavedRegsAndAdjustStack();
|
||||||
|
|
||||||
#endif // _JIT_ABI_H
|
#endif // _JIT_ABI_H
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ void PanicAlert(const char* format, ...)
|
||||||
//#error Do a messagebox!
|
//#error Do a messagebox!
|
||||||
vprintf(format, args);
|
vprintf(format, args);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
asm ("int $3") ;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ void MemArena::GrabLowMemSpace(size_t size)
|
||||||
ftruncate(fd, size);
|
ftruncate(fd, size);
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,11 @@ void* AllocateExecutableMemory(int size)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
void* retval = mmap(0, size, PROT_READ | PROT_WRITE | PROT_EXEC,
|
void* retval = mmap(0, size, PROT_READ | PROT_WRITE | PROT_EXEC,
|
||||||
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); // | MAP_FIXED
|
MAP_ANONYMOUS | MAP_PRIVATE
|
||||||
|
#ifdef __x86_64__
|
||||||
|
| MAP_32BIT
|
||||||
|
#endif
|
||||||
|
, -1, 0); // | MAP_FIXED
|
||||||
printf("mappah exe %p %i\n", retval, size);
|
printf("mappah exe %p %i\n", retval, size);
|
||||||
|
|
||||||
if (!retval)
|
if (!retval)
|
||||||
|
|
|
@ -43,8 +43,6 @@ public:
|
||||||
private:
|
private:
|
||||||
enum { BIOS_SIZE = 2*1024*1024 };
|
enum { BIOS_SIZE = 2*1024*1024 };
|
||||||
|
|
||||||
static char gameID[7];
|
|
||||||
|
|
||||||
static void RunFunction(u32 _iAddr, bool _bUseDebugger);
|
static void RunFunction(u32 _iAddr, bool _bUseDebugger);
|
||||||
|
|
||||||
static void UpdateDebugger_MapLoaded(const char* _gameID = NULL);
|
static void UpdateDebugger_MapLoaded(const char* _gameID = NULL);
|
||||||
|
|
|
@ -1050,9 +1050,10 @@ void SDRUpdated()
|
||||||
|
|
||||||
u32 CheckDTLB(u32 _Address, XCheckTLBFlag _Flag)
|
u32 CheckDTLB(u32 _Address, XCheckTLBFlag _Flag)
|
||||||
{
|
{
|
||||||
PanicAlert("TLB: Read from unknown memory (0x%08x)\n"
|
PanicAlert("TLB: %s unknown memory (0x%08x)\n"
|
||||||
"Several games uses the TLB to map memory. This\n"
|
"Several games uses the TLB to map memory. This\n"
|
||||||
"function is not support in dolphin. Cheers!", _Address);
|
"function is not support in dolphin. Cheers!",
|
||||||
|
_Flag == FLAG_WRITE ? "Write to" : "Read from", _Address);
|
||||||
|
|
||||||
u32 sr = PowerPC::ppcState.sr[EA_SR(_Address)];
|
u32 sr = PowerPC::ppcState.sr[EA_SR(_Address)];
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
// 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 <map>
|
||||||
#include "x64Emitter.h"
|
#include "x64Emitter.h"
|
||||||
#include "ABI.h"
|
#include "ABI.h"
|
||||||
#include "../../HLE/HLE.h"
|
#include "../../HLE/HLE.h"
|
||||||
|
@ -259,9 +260,13 @@ namespace Jit64
|
||||||
|
|
||||||
bool ImHereDebug = false;
|
bool ImHereDebug = false;
|
||||||
|
|
||||||
|
std::map<u32, bool> been_here;
|
||||||
void ImHere()
|
void ImHere()
|
||||||
{
|
{
|
||||||
|
if (been_here.find(PC) != been_here.end())
|
||||||
|
return;
|
||||||
LOG(DYNA_REC, "I'm here - PC = %08x , LR = %08x", PC, LR);
|
LOG(DYNA_REC, "I'm here - PC = %08x , LR = %08x", PC, LR);
|
||||||
|
been_here[PC] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlushRegCaches()
|
void FlushRegCaches()
|
||||||
|
|
|
@ -191,12 +191,13 @@ void Generate()
|
||||||
|
|
||||||
ABI_PushAllCalleeSavedRegsAndAdjustStack();
|
ABI_PushAllCalleeSavedRegsAndAdjustStack();
|
||||||
|
|
||||||
//INT3();
|
// INT3();
|
||||||
|
|
||||||
MOV(64, R(RBX), Imm64((u64)Memory::base));
|
MOV(64, R(RBX), Imm64((u64)Memory::base));
|
||||||
if ((u64)GetCodePointers() > 0x80000000ULL) {
|
// if ((u64)GetCodePointers() > 0x80000000ULL) {
|
||||||
PanicAlert("Code Pointers are above the limit!");
|
// PanicAlert("Code Pointers are above the limit! %p",
|
||||||
}
|
// GetCodePointers());
|
||||||
|
//}
|
||||||
MOV(64, R(R15), Imm64((u64)GetCodePointers())); //It's below 2GB so 32 bits are good enough
|
MOV(64, R(R15), Imm64((u64)GetCodePointers())); //It's below 2GB so 32 bits are good enough
|
||||||
const u8 *outerLoop = GetCodePtr();
|
const u8 *outerLoop = GetCodePtr();
|
||||||
|
|
||||||
|
|
|
@ -56,8 +56,8 @@ namespace Jit64
|
||||||
if (accessSize != 32)
|
if (accessSize != 32)
|
||||||
XOR(32, R(EAX), R(EAX));
|
XOR(32, R(EAX), R(EAX));
|
||||||
#ifdef _M_IX86
|
#ifdef _M_IX86
|
||||||
AND(32, R(ECX), Imm32(Memory::MEMVIEW32_MASK));
|
AND(32, R(reg), Imm32(Memory::MEMVIEW32_MASK));
|
||||||
MOV(accessSize, R(EAX), MDisp(ECX, (u32)Memory::base));
|
MOV(accessSize, R(EAX), MDisp(reg, (u32)Memory::base));
|
||||||
#else
|
#else
|
||||||
MOV(accessSize, R(EAX), MComplex(RBX, reg, SCALE_1, 0));
|
MOV(accessSize, R(EAX), MComplex(RBX, reg, SCALE_1, 0));
|
||||||
#endif
|
#endif
|
||||||
|
@ -72,9 +72,9 @@ namespace Jit64
|
||||||
SetJumpTarget(argh);
|
SetJumpTarget(argh);
|
||||||
switch (accessSize)
|
switch (accessSize)
|
||||||
{
|
{
|
||||||
case 32: ABI_CallFunctionR((void *)&Memory::Read_U32, ECX); break;
|
case 32: ABI_CallFunctionR((void *)&Memory::Read_U32, reg); break;
|
||||||
case 16: ABI_CallFunctionR((void *)&Memory::Read_U16, ECX); break;
|
case 16: ABI_CallFunctionR((void *)&Memory::Read_U16, reg); break;
|
||||||
case 8: ABI_CallFunctionR((void *)&Memory::Read_U8, ECX); break;
|
case 8: ABI_CallFunctionR((void *)&Memory::Read_U8, reg); break;
|
||||||
}
|
}
|
||||||
SetJumpTarget(arg2);
|
SetJumpTarget(arg2);
|
||||||
}
|
}
|
||||||
|
@ -135,10 +135,10 @@ namespace Jit64
|
||||||
}
|
}
|
||||||
|
|
||||||
//Still here? Do regular path.
|
//Still here? Do regular path.
|
||||||
#ifdef _M_IX86
|
#if defined(_M_X64) && defined(_WIN32)
|
||||||
if (true) {
|
|
||||||
#elif defined(_M_X64)
|
|
||||||
if (accessSize == 8 || accessSize == 16 || !jo.enableFastMem) {
|
if (accessSize == 8 || accessSize == 16 || !jo.enableFastMem) {
|
||||||
|
#else
|
||||||
|
if (true) {
|
||||||
#endif
|
#endif
|
||||||
// Safe and boring
|
// Safe and boring
|
||||||
gpr.Flush(FLUSH_VOLATILE);
|
gpr.Flush(FLUSH_VOLATILE);
|
||||||
|
@ -259,6 +259,8 @@ namespace Jit64
|
||||||
|
|
||||||
void stfs(UGeckoInstruction inst)
|
void stfs(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
|
Default(inst);
|
||||||
|
return; // LINUXTODO
|
||||||
BIT32OLD;
|
BIT32OLD;
|
||||||
OLD;
|
OLD;
|
||||||
bool update = inst.OPCD & 1;
|
bool update = inst.OPCD & 1;
|
||||||
|
@ -336,6 +338,8 @@ namespace Jit64
|
||||||
|
|
||||||
void stX(UGeckoInstruction inst)
|
void stX(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
|
Default(inst);
|
||||||
|
return;
|
||||||
int s = inst.RS;
|
int s = inst.RS;
|
||||||
int a = inst.RA;
|
int a = inst.RA;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue