diff --git a/Source/Core/Common/Src/x64Emitter.cpp b/Source/Core/Common/Src/x64Emitter.cpp index dff1847e9c..3c8cecc346 100644 --- a/Source/Core/Common/Src/x64Emitter.cpp +++ b/Source/Core/Common/Src/x64Emitter.cpp @@ -1337,7 +1337,11 @@ void CallCdeclFunction3(void* fnptr, u32 arg0, u32 arg1, u32 arg2) PUSH(32, Imm32(arg1)); PUSH(32, Imm32(arg0)); CALL(fnptr); +#ifdef _WIN32 // don't inc stack +#else + ADD(32, R(ESP), Imm8(3 * 4)); +#endif #endif } @@ -1366,7 +1370,11 @@ void CallCdeclFunction4(void* fnptr, u32 arg0, u32 arg1, u32 arg2, u32 arg3) PUSH(32, Imm32(arg1)); PUSH(32, Imm32(arg0)); CALL(fnptr); +#ifdef _WIN32 // don't inc stack +#else + ADD(32, R(ESP), Imm8(4 * 4)); +#endif #endif } @@ -1398,7 +1406,11 @@ void CallCdeclFunction5(void* fnptr, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 PUSH(32, Imm32(arg1)); PUSH(32, Imm32(arg0)); CALL(fnptr); +#ifdef _WIN32 // don't inc stack +#else + ADD(32, R(ESP), Imm8(5 * 4)); +#endif #endif } @@ -1433,7 +1445,11 @@ void CallCdeclFunction6(void* fnptr, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 PUSH(32, Imm32(arg1)); PUSH(32, Imm32(arg0)); CALL(fnptr); +#ifdef _WIN32 // don't inc stack +#else + ADD(32, R(ESP), Imm8(6 * 4)); +#endif #endif }