fixes #564 - ebp not restored on mouse down event call

This commit is contained in:
IntelOrca 2014-11-12 22:59:25 +00:00
parent e9c3e8f1c1
commit 2be36b1621
1 changed files with 16 additions and 12 deletions

View File

@ -1602,6 +1602,7 @@ void window_event_mouse_down_call(rct_window *w, int widgetIndex)
#ifdef _MSC_VER #ifdef _MSC_VER
__asm { __asm {
push ebp
push address push address
push widget push widget
push w push w
@ -1611,21 +1612,24 @@ void window_event_mouse_down_call(rct_window *w, int widgetIndex)
mov esi, w mov esi, w
call[esp + 12] call[esp + 12]
add esp, 16 add esp, 16
pop ebp
} }
#else #else
__asm__("\ __asm__("\
push %[address]\n\ push ebp \n\
mov edi, %[widget] \n\ push %[address]\n\
mov eax, %[w] \n\ mov edi, %[widget] \n\
mov edx, %[widgetIndex] \n\ mov eax, %[w] \n\
push edi \n\ mov edx, %[widgetIndex] \n\
push eax \n\ push edi \n\
push edx \n\ push eax \n\
mov esi, %[w] \n\ push edx \n\
call [esp+12] \n\ mov esi, %[w] \n\
add esp, 16 \n\ call [esp+12] \n\
" :[address] "+m" (address), [w] "+m" (w), [widget] "+m" (widget), [widgetIndex] "+m" (widgetIndex): : "eax", "esi", "edx", "edi" add esp, 16 \n\
); pop ebp \n\
" :[address] "+m" (address), [w] "+m" (w), [widget] "+m" (widget), [widgetIndex] "+m" (widgetIndex): : "eax", "esi", "edx", "edi"
);
#endif #endif
} }