Rev 468 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 468 | Rev 483 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ; SEE YOU File FAQ.txt and HISTORY. Good Like! |
1 | ; SEE YOU File FAQ.txt and HISTORY. Good Like! |
2 | ;;;;;;;;;;;;;;;;;; |
2 | ;;;;;;;;;;;;;;;;;; |
3 | include 'editbox.mac' ;¬ ªà®á ª®â®àë© ¤®«¦¥ ®¡«¥£ç¨âì ¦¨§ì :) á¯¥æ¨ «ì® ¤«ï editbox |
3 | include 'editbox.mac' ;¬ ªà®á ª®â®àë© ¤®«¦¥ ®¡«¥£ç¨âì ¦¨§ì :) á¯¥æ¨ «ì® ¤«ï editbox |
4 | ;;;;;;;;;;;;;;;;;; |
4 | ;;;;;;;;;;;;;;;;;; |
5 | macro use_edit_box structure_of_potock,scr_h,scr_w |
5 | macro use_edit_box procinfo,scr_h,scr_w |
6 | { |
6 | { |
7 | edit_box: |
7 | edit_box: |
8 | ed_width equ [edi] ;è¨à¨ ª®¬¯®¥â |
8 | ed_width equ [edi] ;è¨à¨ ª®¬¯®¥â |
9 | ed_left equ [edi+4] ;¯®«®¦¥¨¥ ¯® ®á¨ å |
9 | ed_left equ [edi+4] ;¯®«®¦¥¨¥ ¯® ®á¨ å |
10 | ed_top equ [edi+8] ;¯®«®¦¥¨¥ ¯® ®á¨ ã |
10 | ed_top equ [edi+8] ;¯®«®¦¥¨¥ ¯® ®á¨ ã |
Line 44... | Line 44... | ||
44 | je @f |
44 | je @f |
45 | call .draw_cursor |
45 | call .draw_cursor |
46 | @@: |
46 | @@: |
47 | call .draw_text |
47 | call .draw_text |
48 | edit_ex |
48 | edit_ex |
49 | - | ||
50 | ;debug_func |
- | |
51 | ;---------------------------------------------------------- |
- | |
52 | ;--- ¯à®æ¥¤ãà ¯à®à¨á®¢ª¨ ¢ë¤¥«¥®© ç á⨠----------------- |
- | |
53 | ;---------------------------------------------------------- |
- | |
54 | .draw_shift: |
- | |
55 | test word ed_flags,ed_shift_bac ;ãáâ ®¢ª ä« £ , ¢ë¤¥«¥®© ®¡« á⨠|
- | |
56 | jz @f |
- | |
57 | mov ebp,shift_color |
- | |
58 | mov ebx,dword ed_shift_pos |
- | |
59 | call .sh_cl_ |
- | |
60 | @@: ret |
- | |
61 | ;---------------------------------------------------------- |
- | |
62 | ;--- ¯à®æ¥¤ãà ¯à®à¨á®¢ª¨ ⥪áâ -------------------------- |
- | |
63 | ;---------------------------------------------------------- |
- | |
64 | .draw_text: |
- | |
65 | ;--- ¢ëç¨á«ï¥¬, ᪮«ìª® ¯®¬¥é ¥âáï ᨬ¢®«®¢ --- |
- | |
66 | ;--- çâ®¡ë ¬ãá®à ¥ à¨á®¢ âì --- |
- | |
67 | call .get_n |
- | |
68 | mov esi,ed_size |
- | |
69 | mov ebx,ed_offset |
- | |
70 | sub esi,ebx |
- | |
71 | cmp eax,esi |
- | |
72 | jae @F |
- | |
73 | mov esi,eax ;çâ®¡ë ¥ ¢ë室¨âì § ¯à¥¤¥«ë íªà |
- | |
74 | ;--- à¨á㥬 ⥪áâ --- |
- | |
75 | @@: mov eax,4 |
- | |
76 | mov ebx,ed_left |
- | |
77 | mov edx,ed_offset |
- | |
78 | add ebx,2 |
- | |
79 | shl ebx,16 |
- | |
80 | mov bx,ed_top |
- | |
81 | add ebx,4 |
- | |
82 | mov ecx,ed_text_color |
- | |
83 | add edx,ed_text |
- | |
84 | int 0x40 |
- | |
85 | ret |
- | |
86 | ;---------------------------------------------------------- |
- | |
87 | ;--- ¯à®æ¥¤ãà ¯à®à¨á®¢ª¨ ä® ---------------------------- |
- | |
88 | ;¢å®¤ë¥ ¤ ë¥ |
- | |
89 | ;eax |
- | |
90 | ;edx - color |
- | |
91 | ;---------------------------------------------------------- |
- | |
92 | ;¢å®¤ ⮫쪮 梥â edx |
- | |
93 | .draw_bg: |
- | |
94 | mov ebx,ed_left |
- | |
95 | add ebx,1 |
- | |
96 | shl ebx,16 |
- | |
97 | mov bx,ed_width |
- | |
98 | sub ebx,1 |
- | |
99 | mov edx,ed_color |
- | |
100 | .draw_bg_eax: |
- | |
101 | mov ecx,ed_top |
- | |
102 | mov eax,13 |
- | |
103 | add ecx,1 |
- | |
104 | shl ecx,16 |
- | |
105 | mov cx,ed_height |
- | |
106 | dec ecx |
- | |
107 | int 0x40 |
- | |
108 | ret |
- | |
109 | - | ||
110 | ;---------------------------------------------------------- |
- | |
111 | ;--- ¯à®æ¥¤ãà ¯®«ãç¥¨ï ª®«¨ç¥á⢠ᨬ¢®«®¢ ¢ ⥪ã饩 é¨à¨¥ ª®¬¯®¥â -------------- |
- | |
112 | ;---------------------------------------------------------- |
- | |
113 | .get_n: |
- | |
114 | mov eax,ed_width ;¯®«ã祬 è¨à¨ã ª®¬¯®¥â |
- | |
115 | xor edx,edx ;१ã«ìâ â à ᯮ«®£ ¥âáï ¢ ¯ ॠedx:eax ¢ eax - ®áâ ⮪ |
- | |
116 | sub eax,4 ;¢ëç⨬ 4 |
- | |
117 | mov ebx,6 ;§ £à㧬¨ ¤¥«¨â¥«ì |
- | |
118 | div ebx ;à §¬¤¥«¨¬ 6 |
- | |
119 | ret |
- | |
120 | ;---------------------------------------------------------- |
- | |
121 | ;--- ¯à®æ¥¤ãà à¨á®¢ ¨ï ªãàá®à -------------------------- |
- | |
122 | ;---------------------------------------------------------- |
- | |
123 | ;¢å®¤ë¥ ebp- 梥â |
- | |
124 | .clear_cursor: |
- | |
125 | mov edx,ebp |
- | |
126 | mov ebx,cl_curs_x |
- | |
127 | mov ecx,cl_curs_y |
- | |
128 | jmp .draw_curs |
- | |
129 | .draw_cursor: |
- | |
130 | mov edx,ed_text_color |
- | |
131 | mov ebx,ed_pos |
- | |
132 | mov ecx,ed_offset |
- | |
133 | sub ebx,ecx |
- | |
134 | - | ||
135 | lea ebx,[ebx*2+ebx] |
- | |
136 | shl ebx,1 |
- | |
137 | ;imul ebx,6 |
- | |
138 | add bx,ed_left |
- | |
139 | mov ecx,ed_top |
- | |
140 | inc ebx |
- | |
141 | add ecx,2 |
- | |
142 | mov ebp,ebx |
- | |
143 | shl ebx,16 |
- | |
144 | mov bx,bp |
- | |
145 | mov ebp,ecx |
- | |
146 | - | ||
147 | shl ecx,16 |
- | |
148 | mov cx,bp |
- | |
149 | add cx,ed_height-4 |
- | |
150 | - | ||
151 | mov cl_curs_x,ebx |
- | |
152 | mov cl_curs_y,ecx |
- | |
153 | .draw_curs: |
- | |
154 | mov eax,38 |
- | |
155 | int 0x40 |
- | |
156 | ret |
- | |
157 | ;---------------------------------------------------------- |
- | |
158 | ;--- ¯à®æ¥¤ãà à¨á®¢ ¨ï à ¬ª¨ ---------------------------- |
- | |
159 | ;---------------------------------------------------------- |
- | |
160 | .draw_border: |
- | |
161 | ;--- 梥â à ¬ª¨ --- |
- | |
162 | test word ed_flags,ed_focus |
- | |
163 | mov edx,ed_focus_border_color |
- | |
164 | jne @f |
- | |
165 | mov edx,ed_blur_border_color |
- | |
166 | @@: |
- | |
167 | ;--- ᢥàåã --- |
- | |
168 | mov eax,38 |
- | |
169 | mov ebx,ed_left |
- | |
170 | mov ecx,ebx |
- | |
171 | shl ebx,16 |
- | |
172 | mov bx,cx |
- | |
173 | add bx,ed_width |
- | |
174 | mov ecx, ed_top |
- | |
175 | mov esi,ecx |
- | |
176 | shl ecx,16 |
- | |
177 | mov cx,si |
- | |
178 | int 0x40 |
- | |
179 | - | ||
180 | ;--- ᨧã --- |
- | |
181 | mov esi,ecx |
- | |
182 | add ecx,ed_height |
- | |
183 | mov ebp,ecx |
- | |
184 | shl ecx,16 |
- | |
185 | mov cx,bp |
- | |
186 | int 0x40 |
- | |
187 | - | ||
188 | ;--- á«¥¢ --- |
- | |
189 | mov cx,si |
- | |
190 | mov ebp,ebx |
- | |
191 | sub bx,ed_width |
- | |
192 | int 0x40 |
- | |
193 | - | ||
194 | ;--- á¯à ¢ --- |
- | |
195 | mov ebx,ebp |
- | |
196 | shl ebx,16 |
- | |
197 | mov bx,bp |
- | |
198 | int 0x40 |
- | |
199 | ret |
- | |
200 | ;---------------------------------------------------------- |
- | |
201 | ;--- ¯à®¢¥àª , § 襫 «¨ ªãàá®à § £à ¨æë ¨, ¥á«¨ ¤®, --- |
- | |
202 | ;--- ¨§¬¥ï¥¬ ᬥ饨¥ ------------------------------------ |
- | |
203 | ;--- eax = -1, ¥á«¨ ¥ ¨§¬¥¨«®áì ¨«¨ eax = 0, ¥á«¨ |
- | |
204 | ; ¨§¬¥¨«®áì |
- | |
205 | ;---------------------------------------------------------- |
- | |
206 | .check_offset: |
- | |
207 | pusha |
- | |
208 | mov ecx,ed_pos |
- | |
209 | mov ebx,ed_offset |
- | |
210 | cmp ebx,ecx |
- | |
211 | ja .sub_8 |
- | |
212 | - | ||
213 | push ebx |
- | |
214 | call .get_n ;¯®«ã稬 ª®«-¢® ᨬ¢®«®¢ ¢ ¯ ॠॣ¨áâ஢ edx:eax |
- | |
215 | pop ebx |
- | |
216 | mov edx,ebx |
- | |
217 | add edx,eax ;ed_offset+width editbox |
- | |
218 | inc edx ;¥®¡å®¤¨¬® ¤«ï ®¬ «ì®£® ¯®«®¦¥¨ï ªãàá®à ¢ ªà ©¥© «¥¢®© ¯®§¨æ¨¨ |
- | |
219 | cmp edx,ecx |
- | |
220 | ja @f |
- | |
221 | - | ||
222 | mov edx,ed_size |
- | |
223 | cmp edx,ecx |
- | |
224 | je .add_end |
- | |
225 | - | ||
226 | sub edx,ecx |
- | |
227 | cmp edx,8 |
- | |
228 | jbe .add_8 |
- | |
229 | add ebx,8 |
- | |
230 | jmp .chk_d |
- | |
231 | - | ||
232 | .sub_8: cmp ecx,0 |
- | |
233 | je .sub_min |
- | |
234 | cmp ebx,8 |
- | |
235 | jbe .sub_min |
- | |
236 | sub ebx,8 ;ebx=ed_offset |
- | |
237 | jmp .chk_d |
- | |
238 | .sub_min: |
- | |
239 | xor ebx,ebx |
- | |
240 | jmp .chk_d |
- | |
241 | - | ||
242 | .add_end:sub edx,eax |
- | |
243 | mov ebx,edx |
- | |
244 | jmp .chk_d |
- | |
245 | .add_8: add ebx,edx |
- | |
246 | .chk_d: mov ed_offset,ebx |
- | |
247 | call .draw_bg |
- | |
248 | and word ed_flags,ed_offset_cl |
- | |
249 | edit_ex |
- | |
250 | @@: |
- | |
251 | or word ed_flags,ed_offset_fl |
- | |
252 | edit_ex |
- | |
253 | ;========================================================== |
49 | ;========================================================== |
254 | ;=== ®¡à ¡®âª ª« ¢¨ âãàë ================================= |
50 | ;=== ®¡à ¡®âª ª« ¢¨ âãàë ================================= |
255 | ;========================================================== |
51 | ;========================================================== |
256 | .key: |
52 | .key: |
257 | pusha |
53 | pusha |
258 | test word ed_flags,ed_focus ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
54 | test word ed_flags,ed_focus ; ¥á«¨ ¥ ¢ 䮪ãá¥, ¢ë室¨¬ |
259 | je @b |
55 | je .no_figure |
260 | ;஢¥àª ¦ âë shift |
56 | ;஢¥àª ¦ â shift ? |
261 | call .check_shift |
57 | call .check_shift |
262 | ;---------------------------------------------------------- |
58 | ;---------------------------------------------------------- |
263 | ;--- ¯à®¢¥à塞, çâ® ¦ â® -------------------------------- |
59 | ;--- ¯à®¢¥à塞, çâ® ¦ â® -------------------------------- |
264 | ;---------------------------------------------------------- |
60 | ;---------------------------------------------------------- |
265 | cmp ah,8 |
- | |
266 | jz .backspace |
- | |
267 | cmp ah,0xb6 |
- | |
268 | jz .delete |
- | |
269 | cmp ah,176 |
- | |
270 | jz .left |
- | |
271 | cmp ah,179 |
- | |
272 | jz .right |
- | |
273 | cmp ah,180 |
- | |
274 | jz .home |
- | |
275 | cmp ah,181 |
- | |
276 | jz .end |
- | |
277 | cmp ah,185 ;insert |
61 | use_key_process backspase,delete,left,right,home,end,insert |
278 | jz .insert |
- | |
279 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
62 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
280 | ; £«ãèª ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢¨§ |
63 | ; £«ãèª ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢¨§ â.¥. ¯à¨ ®¡ à㦥¨¨ íâ¨å ª®¤®¢ ¯à®¨á室¨â ¢ë室 ¨§ ®¡à ¡®â稪 |
281 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
64 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
282 | cmp ah,177 |
- | |
283 | jz .no_figure |
- | |
284 | cmp ah,178 |
65 | use_key_no_process up,down,esc |
285 | jz .no_figure |
- | |
286 | cmp ah,27 ;ESC - ª« ¢¨è )) |
- | |
287 | jz .no_figure |
- | |
288 | ;--- ¦ â ¤àã£ ï ª« ¢¨è --- |
66 | ;--- ¦ â ¤àã£ ï ª« ¢¨è --- |
289 | test word ed_flags,ed_figure_only ; ⮫쪮 æ¨äàë ? |
- | |
290 | jz @f |
67 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
291 | cmp ah,'0' |
68 | ;஢¥àª ãáâ ®¢«¥ «¨ ä« £ ¯à¨ ª®â®à®¬ 㦮 ¢ë¢®¤¨âì ⮫쪮 æ¨äàë ¢ 㦮¬ ¡®ªá¥ ¥á«¨ â ª®©¥®¡å®¤¨¬®á⨠¥â 㦮 § ª®¬¥â¨à®¢ âì ¬ ªà®á |
292 | jb .no_figure |
69 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
293 | cmp ah,'9' |
70 | use_key_figures_only |
294 | ja .no_figure |
- | |
295 | ;¯à®¢¥àª shift |
71 | ;¯à®¢¥àª shift |
296 | @@: test word ed_flags,ed_shift_on |
72 | @@: test word ed_flags,ed_shift_on |
297 | je @f |
73 | je @f |
298 | ;å®¤ë¥ ¤ ë¥ edx=ed_size;ecx=ed_pos |
74 | ;å®¤ë¥ ¤ ë¥ edx=ed_size;ecx=ed_pos |
299 | push eax |
75 | push eax |
300 | mov edx,ed_size |
76 | mov edx,ed_size |
301 | mov ecx,ed_pos |
77 | mov ecx,ed_pos |
302 | pusha |
78 | pusha |
303 | ;clear |
79 | ;clear |
304 | mov ebp,edx ;ed_size |
80 | ; mov ebp,edx ;ed_size |
305 | call .clear_bg |
81 | ; call .clear_bg |
306 | mov ebp,ed_color |
82 | mov ebp,ed_color |
307 | mov ebx,dword ed_shift_pos |
83 | mov ebx,dword ed_shift_pos |
308 | call .sh_cl_ |
84 | call .sh_cl_ |
Line 309... | Line 85... | ||
309 | 85 | ||
Line 477... | Line 253... | ||
477 | call .sh_first_sh |
253 | call .sh_first_sh |
478 | mov eax,ed_size |
254 | mov eax,ed_size |
479 | mov ed_pos,eax |
255 | mov ed_pos,eax |
480 | call .sh_home_end |
256 | call .sh_home_end |
481 | jmp .draw_cursor_text |
257 | jmp .draw_cursor_text |
482 | ;¡à ¡®âª Shift ¤«ï áïâ¨ï ¢ë¤¥«¥¨ï ¥¨§¢¥á⮩ ®¡« á⨠|
- | |
483 | .shift: ;;;;;;;SHIFT |
- | |
484 | test word ed_flags,ed_shift |
- | |
485 | je .f_exit |
- | |
486 | - | ||
487 | @@: mov ebp,shift_color |
- | |
488 | or word ed_flags,ed_shift_bac ;ãáâ ®¢ª ä« £ , ¢ë¤¥«¥®© ®¡« á⨠|
- | |
489 | mov ebx,dword ed_shift_pos |
- | |
490 | call .sh_cl_ |
- | |
491 | jmp .draw_cursor_text |
- | |
492 | ;;;;;;;;;;;;;;;;;;;;; |
- | |
493 | .f_exit:call .check_offset |
- | |
494 | and word ed_flags,ed_shift_cl |
- | |
495 | call .enable_null |
- | |
496 | jmp .draw_cursor_text |
- | |
497 | .sh_cl_: |
- | |
498 | ;;;;;;SHIFT end |
- | |
499 | ;®¡à ¡®âª ®ç¨á⪨, ¯à¨ «¥¢®¬ - ¯à ¢®¬ ¤¢¨¦¥¨¨ ¢ë¤¥«¥¨ï |
- | |
500 | ;¤«ï ®¡à ¡®âª¨ áïâ¨ï ¢ë¤¥«¥¨ï |
- | |
501 | ;¢å®¤ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos |
- | |
502 | mov eax,dword ed_pos |
- | |
503 | cmp eax,ebx |
- | |
504 | - | ||
505 | jae .sh_n |
- | |
506 | push eax ;¬¥ì襥 ¢ eax |
- | |
507 | push ebx ;¡®«ì襥 |
- | |
508 | jmp .sh_n1 |
- | |
509 | ;¥á«¨ ¨ ç¥ |
- | |
510 | .sh_n: push ebx |
- | |
511 | push eax |
- | |
512 | .sh_n1: |
- | |
513 | call .check_offset |
- | |
514 | call .get_n |
- | |
515 | mov edx,eax ;size of ed_box |
- | |
516 | mov ecx,ed_offset |
- | |
517 | add eax,ecx ;eax = w_off= ed_offset+width |
- | |
518 | mov edx,eax ;save |
- | |
519 | pop ebx ;¡®«ì襥 |
- | |
520 | pop eax ;¬¥ì襥 |
- | |
521 | - | ||
522 | cmp eax,ecx ;áà ¢¥¨¥ á ¬¥ì襣® á offset. |
- | |
523 | jae .f_f ;¥á«¨ ¡®«ìè¥ |
- | |
524 | xor eax,eax |
- | |
525 | cmp edx,ebx ;cà ¢¨¬ à §¬¥à w_off á ¡®«ì訬 |
- | |
526 | jb @f |
- | |
527 | sub ebx,ecx |
- | |
528 | jmp .nxt_f |
- | |
529 | @@: mov ebx,edx |
- | |
530 | sub ebx,ecx |
- | |
531 | jmp .nxt_f |
- | |
532 | .f_f: |
- | |
533 | sub eax,ecx |
- | |
534 | cmp edx,ebx ;cà ¢¨¬ à §¬¥à w_off á ¡®«ì訬 |
- | |
535 | jle @f |
- | |
536 | sub ebx,ecx |
- | |
537 | sub ebx,eax |
- | |
538 | jmp .nxt_f |
- | |
539 | @@: |
- | |
540 | mov ebx,edx |
- | |
541 | sub ebx,ecx |
- | |
542 | sub ebx,eax |
- | |
543 | .nxt_f: |
- | |
544 | mov edx,ebx |
- | |
545 | lea ebx,[eax*2+eax] |
- | |
546 | shl ebx,1 |
- | |
547 | add ebx,ed_left |
- | |
548 | inc ebx |
- | |
549 | shl ebx,16 |
- | |
550 | lea ecx,[edx*2+edx] |
- | |
551 | shl ecx,1 |
- | |
552 | mov bx,cx |
- | |
553 | inc ebx |
- | |
554 | mov edx,ebp;shift_color |
- | |
555 | - | ||
556 | call .draw_bg_eax |
- | |
557 | @@: call .enable_null |
- | |
558 | ret |
- | |
559 | ;;;;;;;;;;;;;;;;;;;;; |
- | |
560 | ;áâ ®¢ª - áï⨥ ¢ë¤¥«¥¨ï ¢ ®¤¨ ᨬ¢®« |
- | |
561 | ;;;;;;;;;;;;;;;;;;;;; |
- | |
562 | .drw_sim: |
- | |
563 | mov eax,dword ed_pos |
- | |
564 | call .draw_rectangle ; à¨á®¢ âì ¯àאַ㣮«ì¨ª á § ¤ ë¬ æ¢¥â®¬ |
- | |
565 | jmp @b |
- | |
566 | ;;;;;;;;;;;;;;;;;;;;; |
- | |
567 | ;ãªæ¨ï ãáâ ®¢ª¨ ¢ë¤¥«¥¨ï ¯à¨ ¤¢¨¦¥¨ï ¢«¥¢® ¨ ¢¯à ¢® ¨ ¦ ⨨ shift |
- | |
568 | ;®£¨ª : |
- | |
569 | ;;;;;;;;;; |
- | |
570 | .draw_wigwag: |
- | |
571 | ;äãªæ¨ï ãáâ ®¢ª¨ ¯¥à¥¬¥ëå |
- | |
572 | mov ebp,shift_color |
- | |
573 | call .clear_cursor |
- | |
574 | - | ||
575 | or word ed_flags,ed_shift_bac ;ãáâ ®¢ª ä« £ , ¢ë¤¥«¥®© ®¡« á⨠|
- | |
576 | mov ebp,shift_color |
- | |
577 | mov eax,dword ed_pos |
- | |
578 | test word ed_flags,ed_left_fl |
- | |
579 | jz .low |
- | |
580 | jmp @f |
- | |
581 | ;;;;;;;;;; |
- | |
582 | ;ãªæ¨ï 㤠«¥¨ï ¢ë¤¥«¥¨ï ¯à¨ ¤¢¨¦¥¨ï ¢«¥¢® ¨ ¢¯à ¢® ¨ ¦ ⨨ shift |
- | |
583 | ;®£¨ª : |
- | |
584 | ;;;;;;;;;; |
- | |
585 | .draw_wigwag_cl: |
- | |
586 | ;äãªæ¨ï ãáâ ®¢ª¨ ¯¥à¥¬¥ëå |
- | |
587 | mov ebp,ed_color |
- | |
588 | call .clear_cursor |
- | |
589 | - | ||
590 | mov ebp,ed_color |
- | |
591 | mov eax,dword ed_pos |
- | |
592 | test word ed_flags,ed_left_fl |
- | |
593 | jz .low |
- | |
594 | @@: call .draw_rectangle ; à¨á®¢ âì ¯àאַ㣮«ì¨ª § ªà 訢 ¥¬®© ®¡« á⨠|
- | |
595 | ret |
- | |
596 | .low: dec eax |
- | |
597 | jmp @b |
- | |
598 | ;¢å®¤®© ¯ à ¬¥âà ebx - ed_pos |
- | |
599 | .sh_first_sh: |
- | |
600 | test word ed_flags,ed_shift |
- | |
601 | je @f |
- | |
602 | mov dword ed_shift_pos_old,ebx |
- | |
603 | test word ed_flags,ed_shift_on |
- | |
604 | jne @f |
- | |
605 | mov dword ed_shift_pos,ebx |
- | |
606 | or word ed_flags,ed_shift_on |
- | |
607 | @@: ret |
- | |
608 | ;¡à ¡®âª ªà ©¨å ¯®«®¦¥¨© ¢ editbox ¯à¨ ¦ ⮬ shift |
- | |
609 | ;¯à®¨§¢®¤¨â áï⨥ ¢ë¤¥«¥¨¥, ¥á«¨ ¥â shift |
- | |
610 | ;¨ ç¥ ¢®®¡é¥ ¢ë室¨â |
- | |
611 | .sh_st_of: |
- | |
612 | test word ed_flags,ed_shift |
- | |
613 | jne @f |
- | |
614 | test word ed_flags,ed_shift_bac |
- | |
615 | je @f |
- | |
616 | mov ebp,ed_color |
- | |
617 | mov ebx,dword ed_shift_pos |
- | |
618 | call .sh_cl_ ;®ç¨á⪠¢ë¤¥«¥®£® äà £¬¥â |
- | |
619 | and word ed_flags,ed_shift_cl ; ®ç¨á⪠®â ⮣® çâ® ã¡à «¨ ¢ë¤¥«¥¨¥ |
- | |
620 | jmp .draw_cursor_text |
- | |
621 | @@: |
- | |
622 | and word ed_flags,ed_shift_off |
- | |
623 | edit_ex |
- | |
624 | ;¯à®¢¥àª á®áâ®ï¨ï shift ¡ë« «¨ ® ¦ â à ìè¥? |
- | |
625 | .sh_enable: |
- | |
626 | test word ed_flags,ed_shift |
- | |
627 | jne .sh_ext_en ; à¨á®¢ âì § ªà è¥ë© ¯àאַ㣮«ì¨ª |
- | |
628 | - | ||
629 | test word ed_flags,ed_shift_bac |
- | |
630 | je @f |
- | |
631 | call .check_offset |
- | |
632 | - | ||
633 | mov ebp,ed_color |
- | |
634 | mov ebx,dword ed_shift_pos |
- | |
635 | call .sh_cl_ ;®ç¨á⪠¢ë¤¥«¥®£® äà £¬¥â |
- | |
636 | call .draw_wigwag_cl |
- | |
637 | and word ed_flags,ed_shift_cl ; 1¢ à ¥ 㦮 |
- | |
638 | ret |
- | |
639 | - | ||
640 | @@: mov ebp,ed_color |
- | |
641 | call .clear_cursor |
- | |
642 | call .check_offset |
- | |
643 | ret |
- | |
644 | .sh_ext_en: |
- | |
645 | call .check_offset |
- | |
646 | test word ed_flags,ed_offset_fl |
- | |
647 | je @f |
- | |
648 | ;¨á®¢ ¨¥ § ªà è¥ëå ¯àאַ㣮«ì¨ª®¢ ¨ ®ç¨á⪠¨å |
- | |
649 | mov eax,dword ed_shift_pos |
- | |
650 | mov ebx,dword ed_pos |
- | |
651 | mov ecx,dword ed_shift_pos_old |
- | |
652 | ;¯à®¢¥àª ¨ à¨á®¢ ¨¥ § ªà è¥ëå ®¡« á⥩ |
- | |
653 | cmp eax,ecx |
- | |
654 | je .1_shem |
- | |
655 | jb .smaller |
- | |
656 | cmp ecx,ebx |
- | |
657 | ja .1_shem |
- | |
658 | call .draw_wigwag_cl ;clear |
- | |
659 | jmp .sh_e_end |
- | |
660 | .smaller: |
- | |
661 | cmp ecx,ebx |
- | |
662 | jb .1_shem |
- | |
663 | call .draw_wigwag_cl ;clear |
- | |
664 | jmp .sh_e_end |
- | |
665 | ;alike = |
- | |
666 | .1_shem: call .draw_wigwag |
- | |
667 | .sh_e_end: and word ed_flags,ed_shift_off |
- | |
668 | ret |
- | |
669 | @@: mov ebp,shift_color |
- | |
670 | mov ebx,dword ed_shift_pos |
- | |
671 | call .sh_cl_ |
- | |
672 | jmp .sh_e_end |
- | |
673 | ;äãªæ¨ï ¤«ï ®¡à ¡®âª¨ shift ¯à¨ ¦ ⨨ home and end |
- | |
674 | .sh_home_end: |
- | |
675 | mov ebp,ed_color |
- | |
676 | call .clear_cursor |
- | |
677 | test word ed_flags,ed_shift_bac |
- | |
678 | je @f |
- | |
679 | mov ebp,ed_color |
- | |
680 | mov ebx,dword ed_shift_pos_old |
- | |
681 | call .sh_cl_ |
- | |
682 | - | ||
683 | @@: test word ed_flags,ed_shift |
- | |
684 | je .sh_exit_ ;¢ë©â¨ |
- | |
685 | mov ebp,shift_color |
- | |
686 | mov ebx,dword ed_shift_pos |
- | |
687 | call .sh_cl_ |
- | |
688 | or word ed_flags,ed_shift_bac ;ãáâ ®¢ª ä« £ , ¢ë¤¥«¥®© ®¡« á⨠|
- | |
689 | jmp .sh_e_end |
- | |
690 | .sh_exit_: call .check_offset |
- | |
691 | ret |
- | |
692 | ;äãªæ¨ï ¢¥á¥¨ï 0 ¯® ¤à¥áã ed_size+1 |
- | |
693 | .enable_null: |
- | |
694 | pusha |
- | |
695 | mov eax,ed_size |
- | |
696 | mov ebx,ed_text |
- | |
697 | test eax,eax |
- | |
698 | add eax,ebx |
- | |
699 | jne @f |
- | |
700 | inc eax |
- | |
701 | @@: xor ebx,ebx |
- | |
702 | mov [eax],bl |
- | |
703 | edit_ex |
- | |
704 | ;- 㤠«¥¨¥ ᨬ¢®« |
- | |
705 | ;å®¤ë¥ ¤ ë¥ edx=ed_size;ecx=ed_pos |
- | |
706 | .del_char: |
- | |
707 | mov esi,ed_text |
- | |
708 | test word ed_flags,ed_shift_on |
- | |
709 | je @f |
- | |
710 | mov eax,dword ed_shift_pos |
- | |
711 | mov ebx,esi |
- | |
712 | cmp eax,ecx |
- | |
713 | jae .dh_n |
- | |
714 | - | ||
715 | mov ed_pos,eax ;çâ® ¡ë ¥ ¡ë«® ã¡¥£ ¨ï ªãàá®à |
- | |
716 | mov ebp,ecx |
- | |
717 | sub ebp,eax |
- | |
718 | add ebx,eax ;eax ¬¥ìè¥ |
- | |
719 | sub edx,ecx |
- | |
720 | add esi,ecx |
- | |
721 | - | ||
722 | mov dword ed_shift_pos,ebp |
- | |
723 | jmp .del_ch_sh |
- | |
724 | ;¥á«¨ ¨ ç¥ |
- | |
725 | .dh_n: |
- | |
726 | mov ebp,eax |
- | |
727 | sub ebp,ecx |
- | |
728 | add ebx,ecx |
- | |
729 | sub edx,eax |
- | |
730 | add esi,eax |
- | |
731 | mov dword ed_shift_pos,ebp |
- | |
732 | jmp .del_ch_sh |
- | |
733 | - | ||
734 | @@: add esi,ecx ;㪠§ ⥫ì + ᬥ饨¥ ª ॠ«ì®¬ã ¡ãää¥àã |
- | |
735 | mov ebx,esi |
- | |
736 | inc esi |
- | |
737 | cld |
- | |
738 | - | ||
739 | sub edx,ecx |
- | |
740 | .del_ch_sh: |
- | |
741 | - | ||
742 | push edi |
- | |
743 | mov edi,ebx |
- | |
744 | @@: |
- | |
745 | lodsb |
- | |
746 | stosb |
- | |
747 | dec edx |
- | |
748 | jns @b |
- | |
749 | - | ||
750 | pop edi |
- | |
751 | ret |
- | |
752 | ;¢ëç¨á«¨âì § ªà 訢 ¥¬ãî ®¡« áâì |
- | |
753 | ;ᮣ« 襨¥ ¢ ebp - ¯¥à¥¤ ¥âáï ed_size |
- | |
754 | .clear_bg: |
- | |
755 | call .get_n ;¯®«ãç¨âì à §¬¥à ¢ ᨬ¢®« å è¨à¨ë ª®¬¯®¥â |
- | |
756 | push eax |
- | |
757 | mov ebx,ed_offset |
- | |
758 | add eax,ebx ;eax = w_off= ed_offset+width |
- | |
759 | mov ebx,ebp ;ed_size |
- | |
760 | - | ||
761 | cmp eax,ebx |
- | |
762 | jb @f |
- | |
763 | mov eax,ed_pos |
- | |
764 | sub ebx,eax |
- | |
765 | mov ecx,ed_offset |
- | |
766 | sub eax,ecx |
- | |
767 | jmp .nxt |
- | |
768 | @@: mov ebx,ed_pos |
- | |
769 | push ebx |
- | |
770 | sub eax,ebx |
- | |
771 | mov ebx,eax ;It is don't optimal |
- | |
772 | - | ||
773 | pop eax ;ed_pos |
- | |
774 | mov ecx,ed_offset |
- | |
775 | sub eax,ecx |
- | |
776 | .nxt: |
- | |
777 | mov ebp,eax ;¯à®¢¥àª ¢ë室 § ªà 訢 ¥¬®© ®¡« á⨠§ ¯à¥¤¥«ë ¤«¨ë |
- | |
778 | add ebp,ebx |
- | |
779 | pop edx |
- | |
780 | cmp ebp,edx |
- | |
781 | je @f |
- | |
782 | inc ebx |
- | |
783 | - | ||
784 | @@: mov edx,ebx |
- | |
785 | lea ebx,[eax*2+eax] |
- | |
786 | shl ebx,1 |
- | |
787 | add ebx,ed_left |
- | |
788 | inc ebx |
- | |
789 | shl ebx,16 |
- | |
790 | lea ecx,[edx*2+edx] |
- | |
791 | shl ecx,1 |
- | |
792 | mov bx,cx |
- | |
793 | mov edx,ed_color |
- | |
794 | call .draw_bg_eax |
- | |
795 | ret |
- | |
796 | ;;;;;;;;;;;;;;;;;;; |
- | |
797 | ;;; ¡à ¡®âª ¯à¨¬¨â¨¢®¢ |
- | |
798 | ;;;;;;;;;;;;;;;;;;;; |
- | |
799 | ; à¨á®¢ âì ¯àאַ㣮«ì¨ª, 梥⠯¥à¥¤ ¥âáï ¢ ebp |
- | |
800 | ;¢å®¤ë¥ ¯ à ¬¥âàë: |
- | |
801 | ;eax=dword ed_pos |
- | |
802 | ;ebp=-梥â ed_color or shift_color |
- | |
803 | .draw_rectangle: |
- | |
804 | mov ecx,dword ed_offset |
- | |
805 | sub eax,ecx |
- | |
806 | lea ebx,[eax*2+eax] |
- | |
807 | shl ebx,1 |
- | |
808 | inc ebx |
- | |
809 | add ebx,ed_left |
- | |
810 | shl ebx,16 |
- | |
811 | mov bx,6 |
- | |
812 | mov edx,ebp |
- | |
813 | call .draw_bg_eax |
- | |
814 | ret |
- | |
815 | ;;;;;;;;;;;;;;;;;; |
- | |
816 | ;;஢¥àª ¦ â «¨ shift |
- | |
817 | ;;;;;;;;;;;;;;;;;; |
- | |
818 | .check_shift: |
- | |
819 | pusha ;á®åà ¨¬ ¢á¥ ॣ¨áâàë |
- | |
820 | mcall 66,3,1 |
- | |
821 | test al,0x03 |
- | |
822 | je @f |
- | |
823 | or word ed_flags,ed_shift ;ãáâ ®¢¨¬ ä« £ |
- | |
824 | @@:edit_ex |
- | |
825 | ;========================================================== |
258 | ;========================================================== |
826 | ;=== ®¡à ¡®âª ¬ëè¨ ======================================= |
259 | ;=== ®¡à ¡®âª ¬ëè¨ ======================================= |
827 | ;========================================================== |
260 | ;========================================================== |
828 | .mouse: |
261 | .mouse: |
829 | pusha |
262 | pusha |
Line 856... | Line 289... | ||
856 | ;---------------------------------------------------------- |
289 | ;---------------------------------------------------------- |
857 | @@: mcall 37,0 |
290 | @@: mcall 37,0 |
858 | ;---------------------------------------------------------- |
291 | ;---------------------------------------------------------- |
859 | ;--- ¥ 㤥ন¢ ¥¬ «¨ ¬ë ª« ¢¨èã ¬ë誨, ¯¥à¥¬¥é ï ªãàá®à, ¢® ¢á¥ à §ë¥ áâ®à®ë? |
292 | ;--- ¥ 㤥ন¢ ¥¬ «¨ ¬ë ª« ¢¨èã ¬ë誨, ¯¥à¥¬¥é ï ªãàá®à, ¢® ¢á¥ à §ë¥ áâ®à®ë? |
860 | ;---------------------------------------------------------- |
293 | ;---------------------------------------------------------- |
861 | mov ecx,structure_of_potock |
294 | mov ecx,procinfo |
862 | test word ed_flags,ed_mouse_on |
295 | test word ed_flags,ed_mouse_on |
863 | jne .mouse_wigwag |
296 | jne .mouse_wigwag |
864 | ;---------------------------------------------------------- |
297 | ;---------------------------------------------------------- |
865 | ;--- ¯à®¢¥à塞, ¯®¯ ¤ ¥â «¨ ªãàá®à ¢ edit box ------------- |
298 | ;--- ¯à®¢¥à塞, ¯®¯ ¤ ¥â «¨ ªãàá®à ¢ edit box ------------- |
866 | ;---------------------------------------------------------- |
299 | ;---------------------------------------------------------- |
Line 895... | Line 328... | ||
895 | push eax |
328 | push eax |
896 | mov ebp,ed_color |
329 | mov ebp,ed_color |
897 | call .clear_cursor |
330 | call .clear_cursor |
898 | pop eax |
331 | pop eax |
899 | ._mvpos: |
332 | ._mvpos: |
900 | mov ecx,structure_of_potock |
333 | mov ecx,procinfo |
901 | mov ebx,dword [ecx+34] |
334 | mov ebx,dword [ecx+34] |
902 | xor edx,edx |
335 | xor edx,edx |
903 | sub eax,ed_left |
336 | sub eax,ed_left |
904 | sub eax,ebx |
337 | sub eax,ebx |
905 | if scr_w eq |
338 | if scr_w eq |
Line 959... | Line 392... | ||
959 | call .clear_cursor |
392 | call .clear_cursor |
960 | .drc: call .draw_border |
393 | .drc: call .draw_border |
961 | .mouse_ex: |
394 | .mouse_ex: |
Line 962... | Line 395... | ||
962 | 395 | ||
- | 396 | edit_ex |
|
- | 397 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
- | 398 | ;¡é¨¥ äãªæ¨¨ ®¡à ¡®âª¨ |
|
- | 399 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
- | 400 | use_general_func |
|
- | 401 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
- | 402 | ;ãªæ¨¨ ¤«ï à ¡®âë á key |
|
- | 403 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
963 | edit_ex |
404 | use_key_func |
964 | ;---------------------------------------------------------- |
405 | ;---------------------------------------------------------- |
965 | ;--- ¯à®æ¥¤ãà à §¬ë¢ ¨ï 䮪ãá -------------------------- |
406 | ;--- ¯à®æ¥¤ãà à §¬ë¢ ¨ï 䮪ãá -------------------------- |
966 | ;---------------------------------------------------------- |
407 | ;---------------------------------------------------------- |
967 | ;.blur: |
408 | ;.blur: |
Line 981... | Line 422... | ||
981 | shr eax,16 |
422 | shr eax,16 |
982 | or word ed_flags,ed_shift_bac+ed_shift_on+ed_shift |
423 | or word ed_flags,ed_shift_bac+ed_shift_on+ed_shift |
983 | ;;;;;;;;;;;;;;;;;; |
424 | ;;;;;;;;;;;;;;;;;; |
984 | ;;¯à®æ¥¤ãà ®¡à ¡®âª¨ ¯®«®¦¥¨ï ¢ë¤¥«¥®£® ⥪áâ , ª®£¤ ¯à®¨á室¨â ¢ë室 § ¯à¥¤¥«ë editbox |
425 | ;;¯à®æ¥¤ãà ®¡à ¡®âª¨ ¯®«®¦¥¨ï ¢ë¤¥«¥®£® ⥪áâ , ª®£¤ ¯à®¨á室¨â ¢ë室 § ¯à¥¤¥«ë editbox |
985 | ;;;;;;;;;;;;;;;;;; |
426 | ;;;;;;;;;;;;;;;;;; |
986 | mov ecx,structure_of_potock |
427 | mov ecx,procinfo |
987 | mov ebx,dword [ecx+34] |
428 | mov ebx,dword [ecx+34] |
988 | add ebx,ed_left |
429 | add ebx,ed_left |
989 | if scr_w eq |
430 | if scr_w eq |
990 | else |
431 | else |
991 | add ebx,scr_w |
432 | add ebx,scr_w |
Line 1093... | Line 534... | ||
1093 | ed_insert_cl= 1111111101111111b |
534 | ed_insert_cl= 1111111101111111b |
1094 | ed_mouse_on = 100000000b |
535 | ed_mouse_on = 100000000b |
1095 | ed_mous_adn_b= 100011000b |
536 | ed_mous_adn_b= 100011000b |
1096 | ed_mouse_on_off=1111111011111111b |
537 | ed_mouse_on_off=1111111011111111b |
1097 | ed_height=14 ; ¢ëá®â |
538 | ed_height=14 ; ¢ëá®â |
1098 | macro draw_edit_boxes start,_end,use_f9,structure_of_potock |
539 | macro draw_edit_boxes start,_end,use_f9,procinfo |
1099 | { |
540 | { |
1100 | if use_f9 eq |
541 | if use_f9 eq |
1101 | else |
542 | else |
1102 | mcall 9,structure_of_potock,-1 |
543 | mcall 9,procinfo,-1 |
1103 | end if |
544 | end if |
1104 | mov edi,start |
545 | mov edi,start |
1105 | mov ecx,((_end-start)/ed_struc_size) |
546 | mov ecx,((_end-start)/ed_struc_size) |
1106 | @@: |
547 | @@: |
1107 | call edit_box.draw |
548 | call edit_box.draw |
Line 1177... | Line 618... | ||
1177 | mov ed_blur_border_color,eax |
618 | mov ed_blur_border_color,eax |
1178 | add edi,ed_struc_size |
619 | add edi,ed_struc_size |
1179 | loop @b |
620 | loop @b |
1180 | } |
621 | } |
Line 1181... | Line 622... | ||
1181 | 622 | ||
1182 | macro draw_edit_box ed_ptr,use_f9,structure_of_potock |
623 | macro draw_edit_box ed_ptr,use_f9,procinfo |
1183 | { |
624 | { |
1184 | if use_f9 eq |
625 | if use_f9 eq |
1185 | else |
626 | else |
1186 | mcall 9,structure_of_potock,-1 |
627 | mcall 9,procinfo,-1 |
1187 | end if |
628 | end if |
1188 | mov edi,ed_ptr |
629 | mov edi,ed_ptr |
1189 | call edit_box.draw |
630 | call edit_box.draw |