c-layer many fixes

git-svn-id: svn://kolibrios.org@6612 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
siemargl
2016-10-20 17:13:23 +00:00
parent 7a0442863e
commit 12a29e00e5
17 changed files with 220 additions and 115 deletions

View File

@@ -12,10 +12,8 @@ include '../../../programs/system/run/trunk/txtbut.inc'
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.
;;; Returns 0 on success. -1 on failure.
proc init_boxlib
pusha
mcall 68,11
@@ -26,17 +24,21 @@ endp
;; 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'