ABI fix for Linux x64. ABI_CallFunctionCC16 was not calculating the jump distance on far calls.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6600 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau 2010-12-17 05:16:51 +00:00
parent 2a54c445a0
commit 77a36cf9cb
1 changed files with 9 additions and 1 deletions

View File

@ -242,7 +242,15 @@ void XEmitter::ABI_CallFunctionC16(void *func, u16 param1) {
void XEmitter::ABI_CallFunctionCC16(void *func, u32 param1, u16 param2) {
MOV(32, R(ABI_PARAM1), Imm32(param1));
MOV(32, R(ABI_PARAM2), Imm32((u32)param2));
CALL(func);
u64 distance = u64(func) - (u64(code) + 5);
if (distance >= 0x0000000080000000ULL
&& distance < 0xFFFFFFFF80000000ULL) {
// Far call
MOV(64, R(RAX), Imm64((u64)func));
CALLptr(R(RAX));
} else {
CALL(func);
}
}
void XEmitter::ABI_CallFunctionC(void *func, u32 param1) {