1
0
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:
Ted John
2016-09-17 23:12:25 +01:00
parent 2d5de506f4
commit d786e57914
2 changed files with 53 additions and 53 deletions

View File

@@ -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);

View File

@@ -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