Merge pull request #3373 from janisozaur/platform

Prepare code compiling for x86-64 port.
This commit is contained in:
Ted John 2016-04-21 22:10:06 +01:00
commit 6173eda7bb
6 changed files with 30 additions and 10 deletions

View File

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

View File

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

View File

@ -141,7 +141,7 @@ static rct_widget window_editor_object_selection_widgets[] = {
{ WWT_FLATBTN, 1, 391, 504, 46, 159, 0xFFFFFFFF, STR_NONE },
{ WWT_DROPDOWN_BUTTON, 0, 470, 591, 23, 34, STR_INSTALL_NEW_TRACK_DESIGN, STR_INSTALL_NEW_TRACK_DESIGN_TIP },
{ WWT_DROPDOWN_BUTTON, 0, 350, 463, 23, 34, STR_OBJECT_FILTER, STR_OBJECT_FILTER_TIP },
{ WWT_TEXT_BOX, 1, 4, 214, 46, 57, (uint32)_filter_string, STR_NONE },
{ WWT_TEXT_BOX, 1, 4, 214, 46, 57, STR_NONE, STR_NONE },
{ WWT_DROPDOWN_BUTTON, 1, 218, 287, 46, 57, STR_OBJECT_SEARCH_CLEAR, STR_NONE },
{ WWT_IMGBTN, 1, 3, 287, 73, 76, 0xFFFFFFFF, STR_NONE },
{ WWT_TAB, 1, 3, 33, 47, 73, 0x2000144E, STR_OBJECT_FILTER_ALL_RIDES_TIP },
@ -398,6 +398,7 @@ void window_editor_object_selection_open()
WC_EDITOR_OBJECT_SELECTION,
WF_10 | WF_RESIZABLE
);
window_editor_object_selection_widgets[WIDX_FILTER_STRING_BUTTON].image = (uint32)_filter_string;
window->widgets = window_editor_object_selection_widgets;
window->enabled_widgets =

View File

@ -75,7 +75,7 @@ static rct_widget window_server_list_widgets[] = {
{ WWT_FRAME, 0, 0, 340, 0, 90, 0xFFFFFFFF, STR_NONE }, // panel / background
{ WWT_CAPTION, 0, 1, 338, 1, 14, STR_SERVER_LIST, STR_WINDOW_TITLE_TIP }, // title bar
{ WWT_CLOSEBOX, 0, 327, 337, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP }, // close x button
{ WWT_TEXT_BOX, 1, 100, 344, 20, 31, (uint32)_playerName, STR_NONE }, // player name text box
{ WWT_TEXT_BOX, 1, 100, 344, 20, 31, STR_NONE, STR_NONE }, // player name text box
{ WWT_SCROLL, 1, 6, 337, 37, 50, STR_NONE, STR_NONE }, // server list
{ WWT_DROPDOWN_BUTTON, 1, 6, 106, 53, 64, STR_FETCH_SERVERS, STR_NONE }, // fetch servers button
{ WWT_DROPDOWN_BUTTON, 1, 112, 212, 53, 64, STR_ADD_SERVER, STR_NONE }, // add server button
@ -162,6 +162,7 @@ void window_server_list_open()
window = window_create_centred(WWIDTH_MIN, WHEIGHT_MIN, &window_server_list_events, WC_SERVER_LIST, WF_10 | WF_RESIZABLE);
window_server_list_widgets[WIDX_PLAYER_NAME_INPUT].image = (uint32)_playerName;
window->widgets = window_server_list_widgets;
window->enabled_widgets = (
(1 << WIDX_CLOSE) |

View File

@ -55,9 +55,9 @@ static rct_widget window_server_start_widgets[] = {
{ WWT_FRAME, 0, 0, WW-1, 0, WH-1, 0xFFFFFFFF, STR_NONE }, // panel / background
{ WWT_CAPTION, 0, 1, WW-2, 1, 14, STR_START_SERVER, STR_WINDOW_TITLE_TIP }, // title bar
{ WWT_CLOSEBOX, 0, WW-13, WW-3, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP }, // close x button
{ WWT_TEXT_BOX, 1, 120, WW-8, 20, 32, (uint32)_port, STR_NONE }, // port text box
{ WWT_TEXT_BOX, 1, 120, WW-8, 36, 48, (uint32)_name, STR_NONE }, // name text box
{ WWT_TEXT_BOX, 1, 120, WW-8, 52, 64, (uint32)_password, STR_NONE }, // password text box
{ WWT_TEXT_BOX, 1, 120, WW-8, 20, 32, STR_NONE, STR_NONE }, // port text box
{ WWT_TEXT_BOX, 1, 120, WW-8, 36, 48, STR_NONE, STR_NONE }, // name text box
{ WWT_TEXT_BOX, 1, 120, WW-8, 52, 64, STR_NONE, STR_NONE }, // password text box
{ WWT_SPINNER, 1, 120, WW-8, 68, 77, 1871, STR_NONE }, // max players
{ WWT_DROPDOWN_BUTTON, 1, WW-18, WW-8, 68, 72, STR_NUMERIC_UP, STR_NONE },
{ WWT_DROPDOWN_BUTTON, 1, WW-18, WW-8, 72, 76, STR_NUMERIC_DOWN, STR_NONE },
@ -116,6 +116,9 @@ void window_server_start_open()
window = window_create_centred(WW, WH, &window_server_start_events, WC_SERVER_START, WF_10);
window_server_start_widgets[WIDX_PORT_INPUT].image = (uint32)_port;
window_server_start_widgets[WIDX_NAME_INPUT].image = (uint32)_name;
window_server_start_widgets[WIDX_PASSWORD_INPUT].image = (uint32)_password;
window->widgets = window_server_start_widgets;
window->enabled_widgets = (
(1 << WIDX_CLOSE) |

View File

@ -87,10 +87,10 @@ static rct_widget window_title_command_editor_widgets[] = {
{ WWT_CLOSEBOX, 1, WW-13, WW-3, 2, 13, 824, STR_CLOSE_WINDOW_TIP }, // close x button
{ WWT_DROPDOWN, 1, WS, WW-WS-1, BY, BY+11, STR_NONE, STR_NONE }, // Command dropdown
{ WWT_DROPDOWN_BUTTON, 1, WW-WS-12, WW-WS-2, BY+1, BY+10, 876, STR_NONE },
{ WWT_TEXT_BOX, 1, WS, WW-WS-1, BY2, BY2+11, (uint32)textbox1Buffer, STR_NONE }, // full textbox
{ WWT_TEXT_BOX, 1, WS, WW-WS-1, BY2, BY2+11, STR_NONE, STR_NONE }, // full textbox
{ WWT_TEXT_BOX, 1, WS, WS+WHA-4, BY2, BY2+11, (uint32)textbox1Buffer, STR_NONE }, // x textbox
{ WWT_TEXT_BOX, 1, WS+WHA+3, WW-WS-1, BY2, BY2+11, (uint32)textbox2Buffer, STR_NONE }, // y textbox
{ WWT_TEXT_BOX, 1, WS, WS+WHA-4, BY2, BY2+11, STR_NONE, STR_NONE }, // x textbox
{ WWT_TEXT_BOX, 1, WS+WHA+3, WW-WS-1, BY2, BY2+11, STR_NONE, STR_NONE }, // y textbox
{ WWT_DROPDOWN, 1, 16, WW-17, BY2, BY2+11, STR_NONE, STR_NONE }, // Save dropdown
{ WWT_DROPDOWN_BUTTON, 1, WW-28, WW-18, BY2+1, BY2+10, 876, STR_NONE },
@ -209,6 +209,9 @@ void window_title_command_editor_open(int index, bool insert)
WC_TITLE_COMMAND_EDITOR,
WF_STICK_TO_FRONT
);
window_title_command_editor_widgets[WIDX_TEXTBOX_FULL].image = (uint32)textbox1Buffer;
window_title_command_editor_widgets[WIDX_TEXTBOX_X].image = (uint32)textbox1Buffer;
window_title_command_editor_widgets[WIDX_TEXTBOX_Y].image = (uint32)textbox2Buffer;
window->widgets = window_title_command_editor_widgets;
window->enabled_widgets =
(1 << WIDX_CLOSE) |