mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-04 13:42:55 +01:00
Move registers struct to common.h
So that it can still be used in x64 builds
This commit is contained in:
@@ -647,59 +647,6 @@ static int RCT2_CALLPROC_EBPSAFE(int address)
|
||||
*/
|
||||
int RCT2_CALLFUNC_X(int address, int *_eax, int *_ebx, int *_ecx, int *_edx, int *_esi, int *_edi, int *_ebp);
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
typedef struct registers {
|
||||
union {
|
||||
int eax;
|
||||
short ax;
|
||||
struct {
|
||||
char al;
|
||||
char ah;
|
||||
};
|
||||
};
|
||||
union {
|
||||
int ebx;
|
||||
short bx;
|
||||
struct {
|
||||
char bl;
|
||||
char bh;
|
||||
};
|
||||
};
|
||||
union {
|
||||
int ecx;
|
||||
short cx;
|
||||
struct {
|
||||
char cl;
|
||||
char ch;
|
||||
};
|
||||
};
|
||||
union {
|
||||
int edx;
|
||||
short dx;
|
||||
struct {
|
||||
char dl;
|
||||
char dh;
|
||||
};
|
||||
};
|
||||
union {
|
||||
int esi;
|
||||
short si;
|
||||
};
|
||||
union {
|
||||
int edi;
|
||||
short di;
|
||||
};
|
||||
union {
|
||||
int ebp;
|
||||
short bp;
|
||||
};
|
||||
} registers;
|
||||
|
||||
assert_struct_size(registers, 7 * 4);
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
static int RCT2_CALLFUNC_Y(int address, registers *inOut)
|
||||
{
|
||||
return RCT2_CALLFUNC_X(address, &inOut->eax, &inOut->ebx, &inOut->ecx, &inOut->edx, &inOut->esi, &inOut->edi, &inOut->ebp);
|
||||
|
||||
53
src/common.h
53
src/common.h
@@ -89,4 +89,57 @@
|
||||
#define FASTCALL
|
||||
#endif // PLATFORM_X86
|
||||
|
||||
/**
|
||||
* x86 register structure, only used for easy interop to RCT2 code.
|
||||
*/
|
||||
#pragma pack(push, 1)
|
||||
typedef struct registers {
|
||||
union {
|
||||
int eax;
|
||||
short ax;
|
||||
struct {
|
||||
char al;
|
||||
char ah;
|
||||
};
|
||||
};
|
||||
union {
|
||||
int ebx;
|
||||
short bx;
|
||||
struct {
|
||||
char bl;
|
||||
char bh;
|
||||
};
|
||||
};
|
||||
union {
|
||||
int ecx;
|
||||
short cx;
|
||||
struct {
|
||||
char cl;
|
||||
char ch;
|
||||
};
|
||||
};
|
||||
union {
|
||||
int edx;
|
||||
short dx;
|
||||
struct {
|
||||
char dl;
|
||||
char dh;
|
||||
};
|
||||
};
|
||||
union {
|
||||
int esi;
|
||||
short si;
|
||||
};
|
||||
union {
|
||||
int edi;
|
||||
short di;
|
||||
};
|
||||
union {
|
||||
int ebp;
|
||||
short bp;
|
||||
};
|
||||
} registers;
|
||||
assert_struct_size(registers, 7 * 4);
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user