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:
hrydgard 2008-08-01 08:37:19 +00:00
parent 3d769df036
commit 53ee26711e
11 changed files with 41 additions and 27 deletions

View File

@ -1,11 +1,12 @@
import os
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'
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':
ccflags += ' -I/opt/local/include'
@ -47,7 +48,7 @@ else:
"Source/Core/VideoCommon/Src",
"Source/Plugins/Plugin_VideoOGL/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_nJoy_SDL/Src",
"Source/Core/DolphinWX/src",

View File

@ -134,4 +134,5 @@ void ABI_PopAllCalleeSavedRegsAndAdjustStack() {
#endif
#endif
#endif

View File

@ -52,7 +52,6 @@
// === 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.
#else
// 64 bit calling convention
@ -63,7 +62,6 @@
#define ABI_PARAM2 RDX
#define ABI_PARAM3 R8
#define ABI_PARAM4 R9
#else
// === 64-bit Unix (hopefully MacOSX too) =====================================================
@ -91,4 +89,5 @@ void ABI_CallFunctionR(void *func, Gen::X64Reg reg1);
void ABI_PushAllCalleeSavedRegsAndAdjustStack();
void ABI_PopAllCalleeSavedRegsAndAdjustStack();
#endif // _JIT_ABI_H
#endif // _JIT_ABI_H

View File

@ -52,6 +52,7 @@ void PanicAlert(const char* format, ...)
//#error Do a messagebox!
vprintf(format, args);
printf("\n");
asm ("int $3") ;
#endif
}

View File

@ -40,7 +40,6 @@ void MemArena::GrabLowMemSpace(size_t size)
ftruncate(fd, size);
return;
#endif
}

View File

@ -53,7 +53,11 @@ void* AllocateExecutableMemory(int size)
#else
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);
if (!retval)

View File

@ -43,8 +43,6 @@ public:
private:
enum { BIOS_SIZE = 2*1024*1024 };
static char gameID[7];
static void RunFunction(u32 _iAddr, bool _bUseDebugger);
static void UpdateDebugger_MapLoaded(const char* _gameID = NULL);

View File

@ -1050,9 +1050,10 @@ void SDRUpdated()
u32 CheckDTLB(u32 _Address, XCheckTLBFlag _Flag)
{
PanicAlert("TLB: Read from unknown memory (0x%08x)\n"
"Several games uses the TLB to map memory. This\n"
"function is not support in dolphin. Cheers!", _Address);
PanicAlert("TLB: %s unknown memory (0x%08x)\n"
"Several games uses the TLB to map memory. This\n"
"function is not support in dolphin. Cheers!",
_Flag == FLAG_WRITE ? "Write to" : "Read from", _Address);
u32 sr = PowerPC::ppcState.sr[EA_SR(_Address)];
@ -1144,4 +1145,4 @@ u32 CheckDTLB(u32 _Address, XCheckTLBFlag _Flag)
}
} // namespace
} // namespace

View File

@ -15,6 +15,7 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include <map>
#include "x64Emitter.h"
#include "ABI.h"
#include "../../HLE/HLE.h"
@ -259,9 +260,13 @@ namespace Jit64
bool ImHereDebug = false;
std::map<u32, bool> been_here;
void ImHere()
{
if (been_here.find(PC) != been_here.end())
return;
LOG(DYNA_REC, "I'm here - PC = %08x , LR = %08x", PC, LR);
been_here[PC] = true;
}
void FlushRegCaches()

View File

@ -191,12 +191,13 @@ void Generate()
ABI_PushAllCalleeSavedRegsAndAdjustStack();
//INT3();
// INT3();
MOV(64, R(RBX), Imm64((u64)Memory::base));
if ((u64)GetCodePointers() > 0x80000000ULL) {
PanicAlert("Code Pointers are above the limit!");
}
// if ((u64)GetCodePointers() > 0x80000000ULL) {
// 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
const u8 *outerLoop = GetCodePtr();

View File

@ -56,8 +56,8 @@ namespace Jit64
if (accessSize != 32)
XOR(32, R(EAX), R(EAX));
#ifdef _M_IX86
AND(32, R(ECX), Imm32(Memory::MEMVIEW32_MASK));
MOV(accessSize, R(EAX), MDisp(ECX, (u32)Memory::base));
AND(32, R(reg), Imm32(Memory::MEMVIEW32_MASK));
MOV(accessSize, R(EAX), MDisp(reg, (u32)Memory::base));
#else
MOV(accessSize, R(EAX), MComplex(RBX, reg, SCALE_1, 0));
#endif
@ -72,9 +72,9 @@ namespace Jit64
SetJumpTarget(argh);
switch (accessSize)
{
case 32: ABI_CallFunctionR((void *)&Memory::Read_U32, ECX); break;
case 16: ABI_CallFunctionR((void *)&Memory::Read_U16, ECX); break;
case 8: ABI_CallFunctionR((void *)&Memory::Read_U8, ECX); break;
case 32: ABI_CallFunctionR((void *)&Memory::Read_U32, reg); break;
case 16: ABI_CallFunctionR((void *)&Memory::Read_U16, reg); break;
case 8: ABI_CallFunctionR((void *)&Memory::Read_U8, reg); break;
}
SetJumpTarget(arg2);
}
@ -135,10 +135,10 @@ namespace Jit64
}
//Still here? Do regular path.
#ifdef _M_IX86
if (true) {
#elif defined(_M_X64)
#if defined(_M_X64) && defined(_WIN32)
if (accessSize == 8 || accessSize == 16 || !jo.enableFastMem) {
#else
if (true) {
#endif
// Safe and boring
gpr.Flush(FLUSH_VOLATILE);
@ -259,6 +259,8 @@ namespace Jit64
void stfs(UGeckoInstruction inst)
{
Default(inst);
return; // LINUXTODO
BIT32OLD;
OLD;
bool update = inst.OPCD & 1;
@ -336,6 +338,8 @@ namespace Jit64
void stX(UGeckoInstruction inst)
{
Default(inst);
return;
int s = inst.RS;
int a = inst.RA;