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