12,10 → 12,8 |
include '../../../programs/dll.inc' |
|
public init_boxlib as '_kolibri_boxlib_init' |
public editbox_key_thunk as '_editbox_key@4' ; renamed due to ambiguity |
public press_key as '_press_key' |
|
;;; Returns 0 on success. -1 on failure. |
|
proc init_boxlib |
pusha |
mcall 68,11 |
26,18 → 24,22 |
|
;; Wrapper to handle edit_box_key function for editboxes. |
;; Call this baby from C (refer kolibri_editbox.h for details) |
editbox_key_thunk: |
mov [oldebp], ebp ;Save ebp because GCC is crazy for it otherwise. |
pop ebp ;Save return address in ebp. Stack top is param now. |
mov eax, dword [press_key] |
call [edit_box_key] ; The pointer we passed should be on the stack already. |
push ebp ;push the return address back to stack |
mov ebp, [oldebp] |
ret |
;public editbox_key_thunk as '_editbox_key@4' ; renamed due to ambiguity |
;public press_key as '_press_key' |
;; replaced by siemargl as inline ASM in C wrapper |
;editbox_key_thunk: |
; mov [oldebp], ebp ;Save ebp because GCC is crazy for it otherwise. |
; pop ebp ;Save return address in ebp. Stack top is param now. |
; mov eax, dword [press_key] |
; call [edit_box_key] ; The pointer we passed should be on the stack already. |
; push ebp ;push the return address back to stack |
; mov ebp, [oldebp] |
; ret |
;oldebp dd ? |
;press_key dd ? |
|
oldebp dd ? |
press_key dd ? |
|
|
@IMPORT: |
library lib_boxlib, 'box_lib.obj' |
|