mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-01 04:03:00 +01:00
Add platform define for x86
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
|
||||
int DISABLE_OPT RCT2_CALLPROC_X(int address, int _eax, int _ebx, int _ecx, int _edx, int _esi, int _edi, int _ebp)
|
||||
{
|
||||
int result;
|
||||
int result = 0;
|
||||
#ifdef PLATFORM_X86
|
||||
#ifdef _MSC_VER
|
||||
__asm {
|
||||
push ebp
|
||||
@@ -56,13 +57,15 @@ int DISABLE_OPT RCT2_CALLPROC_X(int address, int _eax, int _ebx, int _ecx, int _
|
||||
: "eax","ecx","edx","esi","edi","memory"
|
||||
);
|
||||
#endif
|
||||
#endif // PLATFORM_X86
|
||||
// lahf only modifies ah, zero out the rest
|
||||
return result & 0xFF00;
|
||||
}
|
||||
|
||||
int DISABLE_OPT RCT2_CALLFUNC_X(int address, int *_eax, int *_ebx, int *_ecx, int *_edx, int *_esi, int *_edi, int *_ebp)
|
||||
{
|
||||
int result;
|
||||
int result = 0;
|
||||
#ifdef PLATFORM_X86
|
||||
#ifdef _MSC_VER
|
||||
__asm {
|
||||
// Store C's base pointer
|
||||
@@ -207,6 +210,7 @@ int DISABLE_OPT RCT2_CALLFUNC_X(int address, int *_eax, int *_ebx, int *_ecx, in
|
||||
: "eax","ecx","edx","esi","edi","memory"
|
||||
);
|
||||
#endif
|
||||
#endif // PLATFORM_X86
|
||||
// lahf only modifies ah, zero out the rest
|
||||
return result & 0xFF00;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
#endif
|
||||
#define abstract = 0
|
||||
|
||||
#if defined(__i386__) || defined(_M_I86)
|
||||
#define PLATFORM_X86
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_X86
|
||||
#ifdef __GNUC__
|
||||
#define FASTCALL __attribute__((fastcall))
|
||||
#elif _MSC_VER
|
||||
@@ -42,5 +47,8 @@
|
||||
#pragma message "Not using fastcall calling convention, please check your compiler support"
|
||||
#define FASTCALL
|
||||
#endif
|
||||
#else // PLATFORM_X86
|
||||
#define FASTCALL
|
||||
#endif // PLATFORM_X86
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user