Rev 8107 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8108 | maxcodehac | 1 | ; writed by maxcodehack |
8107 | superturbo | 2 | ; adaptation of clayer for ktcc |
3 | format elf |
||
4 | use32 ; Tell compiler to use 32 bit instructions |
||
5 | ; ELF section |
||
6 | section '.text' executable |
||
7 | |||
8 | |||
9 | include '../../../../../proc32.inc' |
||
10 | include '../../../../../macros.inc' |
||
11 | purge section,mov,add,sub |
||
12 | |||
13 | include '../../../../../dll.inc' |
||
14 | |||
15 | |||
16 | public init_boxlib as 'kolibri_boxlib_init' |
||
17 | |||
18 | |||
19 | proc init_boxlib |
||
20 | local retval dd ? |
||
21 | mov [retval], eax |
||
22 | pusha |
||
23 | mcall 68, 11 |
||
24 | test eax, eax |
||
25 | jnz @f |
||
26 | mov [retval], -1 |
||
27 | jmp exit_init_boxlib |
||
28 | @@: |
||
29 | stdcall dll.Load, @IMPORT |
||
30 | test eax, eax |
||
31 | jz exit_init_boxlib |
||
32 | mov [retval], -1 |
||
33 | exit_init_boxlib: |
||
34 | popa |
||
35 | mov eax, [retval] |
||
36 | ret |
||
37 | endp |
||
38 | |||
39 | ;; Wrapper to handle edit_box_key function for editboxes. |
||
40 | ;; Call this baby from C (refer kolibri_editbox.h for details) |
||
41 | ;public editbox_key_thunk as '_editbox_key@4' ; renamed due to ambiguity |
||
42 | ;public press_key as '_press_key' |
||
43 | ;; replaced by siemargl as inline ASM in C wrapper |
||
44 | ;editbox_key_thunk: |
||
45 | ; mov [oldebp], ebp ;Save ebp because GCC is crazy for it otherwise. |
||
46 | ; pop ebp ;Save return address in ebp. Stack top is param now. |
||
47 | ; mov eax, dword [press_key] |
||
48 | ; call [edit_box_key] ; The pointer we passed should be on the stack already. |
||
49 | ; push ebp ;push the return address back to stack |
||
50 | ; mov ebp, [oldebp] |
||
51 | ; ret |
||
52 | ;oldebp dd ? |
||
53 | ;press_key dd ? |
||
54 | |||
55 | |||
56 | section '.data' writeable |
||
57 | @IMPORT: |
||
58 | library lib_boxlib, 'box_lib.obj' |
||
59 | |||
60 | import lib_boxlib, \ |
||
61 | edit_box_draw, 'edit_box' , \ |
||
62 | edit_box_key, 'edit_box_key' , \ |
||
63 | edit_box_mouse, 'edit_box_mouse', \ |
||
64 | edit_box_set_text, 'edit_box_set_text' , \ |
||
65 | init_checkbox2, 'init_checkbox2' , \ |
||
66 | check_box_draw2, 'check_box_draw2' , \ |
||
67 | check_box_mouse2, 'check_box_mouse2' , \ |
||
68 | option_box_draw, 'option_box_draw' , \ |
||
69 | option_box_mouse, 'option_box_mouse' , \ |
||
70 | scrollbar_v_draw, 'scrollbar_v_draw' , \ |
||
71 | scrollbar_v_mouse, 'scrollbar_v_mouse' , \ |
||
72 | scrollbar_h_draw, 'scrollbar_h_draw' , \ |
||
73 | scrollbar_h_mouse, 'scrollbar_h_mouse' , \ |
||
74 | dynamic_button_draw, 'dbutton_draw' , \ |
||
75 | dynamic_button_mouse, 'dbutton_mouse' , \ |
||
76 | menu_bar_draw, 'menu_bar_draw' , \ |
||
77 | menu_bar_mouse, 'menu_bar_mouse' , \ |
||
78 | menu_bar_activate, 'menu_bar_activate' , \ |
||
79 | fb_draw_panel, 'FileBrowser_draw' , \ |
||
80 | fb_mouse, 'FileBrowser_mouse' , \ |
||
81 | fb_key, 'FileBrowser_key' , \ |
||
82 | tl_data_init, 'tl_data_init' , \ |
||
83 | tl_data_clear, 'tl_data_clear' , \ |
||
84 | tl_info_clear, 'tl_info_clear' , \ |
||
85 | tl_key, 'tl_key' , \ |
||
86 | tl_mouse, 'tl_mouse' , \ |
||
87 | tl_draw, 'tl_draw' , \ |
||
88 | tl_info_undo, 'tl_info_undo' , \ |
||
89 | tl_info_redo, 'tl_info_redo' , \ |
||
90 | tl_node_add, 'tl_node_add' , \ |
||
91 | tl_node_set_data, 'tl_node_set_data' , \ |
||
92 | tl_node_get_data, 'tl_node_get_data' , \ |
||
93 | tl_node_delete, 'tl_node_delete' , \ |
||
94 | tl_cur_beg, 'tl_cur_beg' , \ |
||
95 | tl_cur_next, 'tl_cur_next' , \ |
||
96 | tl_cur_perv, 'tl_cur_perv' , \ |
||
97 | tl_node_close_open, 'tl_node_close_open' , \ |
||
98 | tl_node_lev_inc, 'tl_node_lev_inc' , \ |
||
99 | tl_node_lev_dec, 'tl_node_lev_dec' , \ |
||
100 | tl_node_move_up, 'tl_node_move_up' , \ |
||
101 | tl_node_move_down, 'tl_node_move_down' , \ |
||
102 | tl_node_poi_get_info, 'tl_node_poi_get_info' , \ |
||
103 | tl_node_poi_get_next_info, 'tl_node_poi_get_next_info' , \ |
||
104 | tl_node_poi_get_data, 'tl_node_poi_get_data' , \ |
||
105 | tl_save_mem, 'tl_save_mem' , \ |
||
106 | tl_load_mem, 'tl_load_mem' , \ |
||
107 | tl_get_mem_size, 'tl_get_mem_size' , \ |
||
108 | path_show_prepare, 'PathShow_prepare' , \ |
||
109 | path_show_draw, 'PathShow_draw' , \ |
||
110 | ted_but_sumb_upper, 'ted_but_sumb_upper' , \ |
||
111 | ted_but_sumb_lover, 'ted_but_sumb_lover' , \ |
||
112 | ted_but_convert_by_table, 'ted_but_convert_by_table' , \ |
||
113 | ted_can_save, 'ted_can_save' , \ |
||
114 | ted_clear, 'ted_clear' , \ |
||
115 | ted_delete, 'ted_delete' , \ |
||
116 | ted_draw, 'ted_draw' , \ |
||
117 | ted_init, 'ted_init' , \ |
||
118 | ted_init_scroll_bars, 'ted_init_scroll_bars' , \ |
||
119 | ted_init_syntax_file, 'ted_init_syntax_file' , \ |
||
120 | ted_is_select, 'ted_is_select' , \ |
||
121 | ted_key, 'ted_key' , \ |
||
122 | ted_mouse, 'ted_mouse' , \ |
||
123 | ted_open_file, 'ted_open_file' , \ |
||
124 | ted_save_file, 'ted_save_file' , \ |
||
125 | ted_text_add, 'ted_text_add' , \ |
||
126 | ted_but_select_word, 'ted_but_select_word' , \ |
||
127 | ted_but_cut, 'ted_but_cut' , \ |
||
128 | ted_but_copy, 'ted_but_copy' , \ |
||
129 | ted_but_paste, 'ted_but_paste' , \ |
||
130 | ted_but_undo, 'ted_but_undo' , \ |
||
131 | ted_but_redo, 'ted_but_redo' , \ |
||
132 | ted_but_reverse, 'ted_but_reverse' , \ |
||
133 | ted_but_find, 'ted_but_find' , \ |
||
134 | ted_but_replace, 'ted_but_replace' , \ |
||
135 | ted_text_colored, 'ted_text_colored' , \ |
||
136 | ted_go_to_position, 'ted_go_to_position' , \ |
||
137 | frame_draw, 'frame_draw' , \ |
||
138 | progressbar_draw,'progressbar_draw' , \ |
||
139 | progressbar_progress, 'progressbar_progress' |
||
140 | |||
141 | |||
142 | public edit_box_draw as 'edit_box_draw' |
||
143 | public edit_box_key as 'edit_box_key' |
||
144 | public edit_box_mouse as 'edit_box_mouse' |
||
145 | public edit_box_set_text as 'edit_box_set_text' |
||
146 | |||
147 | public check_box_draw2 as 'check_box_draw2' |
||
148 | public check_box_mouse2 as 'check_box_mouse2' |
||
149 | public init_checkbox2 as 'init_checkbox2' |
||
150 | |||
151 | public progressbar_draw as 'progressbar_draw' |
||
152 | public progressbar_progress as 'progressbar_progress' |
||
153 | |||
154 | public frame_draw as 'frame_draw' |
||
155 | |||
156 | public scrollbar_v_draw as 'scrollbar_v_draw' |
||
157 | public scrollbar_v_mouse as 'scrollbar_v_mouse' |
||
158 | public scrollbar_h_draw as 'scrollbar_h_draw' |
||
159 | public scrollbar_h_mouse as 'scrollbar_h_mouse' |
||
160 | |||
161 | public option_box_draw as 'option_box_draw' |
||
162 | public option_box_mouse as 'option_box_mouse' |
||
163 | |||
164 | public menu_bar_draw as 'menu_bar_draw' |
||
165 | public menu_bar_mouse as 'menu_bar_mouse' |
||
166 | public menu_bar_activate as 'menu_bar_activate' |
||
167 | |||
168 | public dynamic_button_draw as 'dynamic_button_draw' |
||
169 | public dynamic_button_mouse as 'dynamic_button_mouse' |
||
170 | |||
171 | public path_show_prepare as 'path_show_prepare' |
||
172 | public path_show_draw as 'path_show_draw' |
||
173 | |||
174 | public fb_draw_panel as 'filebrowse_draw' |
||
175 | public fb_mouse as 'filebrowse_mouse' |
||
176 | public fb_key as 'filebrowse_key' |
||
177 | |||
178 | public ted_but_sumb_upper as 'ted_but_sumb_upper' |
||
179 | public ted_but_sumb_lover as 'ted_but_sumb_lover' |
||
180 | public ted_but_convert_by_table as 'ted_but_convert_by_table' |
||
181 | public ted_can_save as 'ted_can_save' |
||
182 | public ted_clear as 'ted_clear' |
||
183 | public ted_delete as 'ted_delete' |
||
184 | public ted_draw as 'ted_draw' |
||
185 | public ted_init as 'ted_init' |
||
186 | public ted_init_scroll_bars as 'ted_init_scroll_bars' |
||
187 | public ted_init_syntax_file as 'ted_init_syntax_file' |
||
188 | public ted_is_select as 'ted_is_select' |
||
189 | public ted_key as 'ted_key_asm' |
||
190 | public ted_mouse as 'ted_mouse' |
||
191 | public ted_open_file as 'ted_open_file_asm' |
||
192 | public ted_save_file as 'ted_save_file_asm' |
||
193 | public ted_text_add as '_ted_text_add' |
||
194 | public ted_but_select_word as 'ted_but_select_word' |
||
195 | public ted_but_cut as 'ted_but_cut' |
||
196 | public ted_but_copy as 'ted_but_copy' |
||
197 | public ted_but_paste as 'ted_but_paste' |
||
198 | public ted_but_undo as 'ted_but_undo' |
||
199 | public ted_but_redo as 'ted_but_redo' |
||
200 | public ted_but_reverse as 'ted_but_reverse' |
||
201 | public ted_but_find as 'ted_but_find' |
||
202 | public ted_but_replace as 'ted_but_replace' |
||
203 | public ted_text_colored as 'ted_text_colored_asm' |
||
204 | public ted_go_to_position as 'ted_go_to_position' |
||
205 | |||
206 | public tl_data_init as 'tl_data_init' |
||
207 | public tl_data_clear as 'tl_data_clear' |
||
208 | public tl_info_clear as 'tl_info_clear' |
||
209 | public tl_key as 'tl_key_asm' |
||
210 | public tl_mouse as 'tl_mouse' |
||
211 | public tl_draw as 'tl_draw' |
||
212 | public tl_info_undo as 'tl_info_undo' |
||
213 | public tl_info_redo as 'tl_info_redo' |
||
214 | public tl_node_add as 'tl_node_add' |
||
215 | public tl_node_set_data as 'tl_node_set_data' |
||
216 | public tl_node_get_data as 'tl_node_get_data' |
||
217 | public tl_node_delete as 'tl_node_delete' |
||
218 | public tl_cur_beg as 'tl_cur_beg' |
||
219 | public tl_cur_next as 'tl_cur_next' |
||
220 | public tl_cur_perv as 'tl_cur_perv' |
||
221 | public tl_node_close_open as 'tl_node_close_open' |
||
222 | public tl_node_lev_inc as 'tl_node_lev_inc' |
||
223 | public tl_node_lev_dec as 'tl_node_lev_dec' |
||
224 | public tl_node_move_up as 'tl_node_move_up' |
||
225 | public tl_node_move_down as 'tl_node_move_down' |
||
226 | public tl_node_poi_get_info as 'tl_node_poi_get_info' |
||
227 | public tl_node_poi_get_next_info as 'tl_node_poi_get_next_info' |
||
228 | public tl_node_poi_get_data as 'tl_node_poi_get_data' |
||
229 | public tl_save_mem as 'tl_save_mem_asm' |
||
230 | public tl_load_mem as 'tl_load_mem_asm' |
||
231 | public tl_get_mem_size as 'tl_get_mem_size_asm' |