Subversion Repositories Kolibri OS

Rev

Rev 3130 | Rev 4601 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3130 Rev 3358
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;Basic macros for use editbox                             ;
2
;Basic macros for use editbox                             ;
3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4
 
4
 
5
 
5
 
6
macro use_editbox_draw
6
macro use_editbox_draw
7
{
7
{
8
edit_box:
8
edit_box:
9
.draw:
9
.draw:
10
        pushad
10
        pushad
11
;--- à¨á㥬 à ¬ªã ---
11
;--- à¨á㥬 à ¬ªã ---
12
        mov     edi,dword [esp+36]
12
        mov     edi,dword [esp+36]
13
        call    .draw_border            ; ”ã­ªæ¨ï áâ ¡¨«ì­ 
13
        call    .draw_border            ; ”ã­ªæ¨ï áâ ¡¨«ì­ 
14
.draw_bg_cursor_text:
14
.draw_bg_cursor_text:
15
;--- ¨§¬¥­ï¥¬ ᬥ饭¨¥, ¥á«¨ ­ ¤® ---
15
;--- ¨§¬¥­ï¥¬ ᬥ饭¨¥, ¥á«¨ ­ ¤® ---
16
        call    .check_offset           ;¢ëç¨á«¥­¨¥ ¯®§¨æ¨¨ ªãàá®à  áâ ¡¨«ì­ 
16
        call    .check_offset           ;¢ëç¨á«¥­¨¥ ¯®§¨æ¨¨ ªãàá®à  áâ ¡¨«ì­ 
17
;--- à¨á㥬 ¢­ãâ७­îî ®¡« áâì ---
17
;--- à¨á㥬 ¢­ãâ७­îî ®¡« áâì ---
18
        call    .draw_bg                ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª à ¡®ç¥© ®¡« áâ¨
18
        call    .draw_bg                ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª à ¡®ç¥© ®¡« áâ¨
19
;---- à¨á㥬 ¢ë¤¥«¥­¨¥, ¯® shift ¥á«¨ ¥áâì
19
;---- à¨á㥬 ¢ë¤¥«¥­¨¥, ¯® shift ¥á«¨ ¥áâì
20
        call    .draw_shift
20
        call    .draw_shift
21
.draw_cursor_text:
21
.draw_cursor_text:
22
;--- à¨á㥬 ªãàá®à ---
22
;--- à¨á㥬 ªãàá®à ---
23
        ;--- ¬®¦¥â ¥£® ­¥ ­ ¤® à¨á®¢ âì ----
23
        ;--- ¬®¦¥â ¥£® ­¥ ­ ¤® à¨á®¢ âì ----
24
        test    word ed_flags,ed_focus
24
        test    word ed_flags,ed_focus
25
        jz     	@f
25
        jz     	@f
26
        call    .draw_cursor
26
        call    .draw_cursor
27
@@:
27
@@:
28
        call    .draw_text
28
        call    .draw_text
29
;        ret
29
;        ret
30
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
30
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
31
;Ž¡é¨© ¢ë室 ¨§ editbox ¤«ï ¢á¥å ä㭪権 ¨ ¯®áâ ®¡à ¡®â稪®¢;;
31
;Ž¡é¨© ¢ë室 ¨§ editbox ¤«ï ¢á¥å ä㭪権 ¨ ¯®áâ ®¡à ¡®â稪®¢;;
32
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
32
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
33
.editbox_exit:
33
.editbox_exit:
34
        popad
34
        popad
35
        ret 4
35
        ret 4
36
}
36
}
37
 
37
 
38
 
38
 
39
macro use_editbox_key
39
macro use_editbox_key
40
{
40
{
41
;==========================================================
41
;==========================================================
42
;=== ®¡à ¡®âª  ª« ¢¨ âãàë =================================
42
;=== ®¡à ¡®âª  ª« ¢¨ âãàë =================================
43
;==========================================================
43
;==========================================================
44
edit_box_key:
44
edit_box_key:
45
pushad
45
pushad
46
        mov     edi,dword [esp+36]
46
        mov     edi,dword [esp+36]
47
        test    word ed_flags,ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
47
        test    word ed_flags,ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
48
        je      edit_box.editbox_exit
48
        je      edit_box.editbox_exit
49
        test    word ed_flags,ed_mouse_on
49
        test    word ed_flags,ed_mouse_on
50
        jne     edit_box.editbox_exit
50
        jne     edit_box.editbox_exit
-
 
51
 
-
 
52
;--------------------------------------
-
 
53
; this code for Win-keys, works with
-
 
54
; kernel SVN r.3356 or later
-
 
55
	push	eax
-
 
56
	push	ebx
-
 
57
	mcall	66,3
-
 
58
	test	ax,0x200	; LWin
-
 
59
	jnz	.win_key_pressed
-
 
60
	test	ax,0x400	; RWin
-
 
61
	jz	@f
-
 
62
.win_key_pressed:
-
 
63
	pop	ebx
-
 
64
	pop	eax
-
 
65
	jmp	edit_box.editbox_exit
-
 
66
@@:
-
 
67
	pop	ebx
-
 
68
	pop	eax
51
 
69
;--------------------------------------
52
;à®¢¥àª  ­ ¦ â shift ?
70
;à®¢¥àª  ­ ¦ â shift ?
53
        call    edit_box_key.check_shift
71
        call    edit_box_key.check_shift
54
;----------------------------------------------------------
72
;----------------------------------------------------------
55
;--- ¯à®¢¥à塞, çâ® ­ ¦ â® --------------------------------
73
;--- ¯à®¢¥à塞, çâ® ­ ¦ â® --------------------------------
56
;----------------------------------------------------------
74
;----------------------------------------------------------
57
        cmp     ah,8
75
        cmp     ah,8
58
        jz      edit_box_key.backspace
76
        jz      edit_box_key.backspace
59
        cmp     ah,0xb6
77
        cmp     ah,0xb6
60
        jz      edit_box_key.delete
78
        jz      edit_box_key.delete
61
        cmp     ah,176
79
        cmp     ah,176
62
        jz      edit_box_key.left
80
        jz      edit_box_key.left
63
        cmp     ah,179
81
        cmp     ah,179
64
        jz      edit_box_key.right
82
        jz      edit_box_key.right
65
        cmp     ah,180
83
        cmp     ah,180
66
        jz      edit_box_key.home
84
        jz      edit_box_key.home
67
        cmp     ah,181
85
        cmp     ah,181
68
        jz      edit_box_key.end
86
        jz      edit_box_key.end
69
        cmp     ah,185  ;insert
87
        cmp     ah,185  ;insert
70
        jz      edit_box_key.insert
88
        jz      edit_box_key.insert
71
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
89
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
72
;‡ £«ã誠 ­  ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢­¨§ â.¥. ¯à¨ ®¡­ à㦥­¨¨ íâ¨å ª®¤®¢ ¯à®¨á室¨â ¢ë室 ¨§ ®¡à ¡®â稪 
90
;‡ £«ã誠 ­  ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢­¨§ â.¥. ¯à¨ ®¡­ à㦥­¨¨ íâ¨å ª®¤®¢ ¯à®¨á室¨â ¢ë室 ¨§ ®¡à ¡®â稪 
73
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
91
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
74
use_key_no_process   up,down,esc,enter,tab,numl,capsl,scrolll
92
use_key_no_process   up,down,esc,enter,tab,numl,capsl,scrolll
75
;--- ­ ¦ â  ¤àã£ ï ª« ¢¨è  ---
93
;--- ­ ¦ â  ¤àã£ ï ª« ¢¨è  ---
76
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
94
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
77
;à®¢¥àª  ãáâ ­®¢«¥­ «¨ ä« £ ¯à¨ ª®â®à®¬ ­ã¦­® ¢ë¢®¤¨âì ⮫쪮 æ¨äàë ¢ ­ã¦­®¬ ¡®ªá¥, ¥á«¨ â ª®© ­¥®¡å®¤¨¬®á⨠­¥â, ­ã¦­® § ª®¬¥­â¨à®¢ âì ¬ ªà®á
95
;à®¢¥àª  ãáâ ­®¢«¥­ «¨ ä« £ ¯à¨ ª®â®à®¬ ­ã¦­® ¢ë¢®¤¨âì ⮫쪮 æ¨äàë ¢ ­ã¦­®¬ ¡®ªá¥, ¥á«¨ â ª®© ­¥®¡å®¤¨¬®á⨠­¥â, ­ã¦­® § ª®¬¥­â¨à®¢ âì ¬ ªà®á
78
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
96
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
79
use_key_figures_only
97
use_key_figures_only
80
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
98
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
81
;¯à®¢¥àª  ­  shift, ¡ë« «¨ ­ ¦ â
99
;¯à®¢¥àª  ­  shift, ¡ë« «¨ ­ ¦ â
82
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
100
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
83
are_key_shift_press
101
are_key_shift_press
84
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
102
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
85
; ¯à®¢¥à塞, ­ å®¤¨âáï «¨ ªãàá®à ¢ ª®­æ¥ + ¤ «ì­¥©è ï ®¡à ¡®âª 
103
; ¯à®¢¥à塞, ­ å®¤¨âáï «¨ ªãàá®à ¢ ª®­æ¥ + ¤ «ì­¥©è ï ®¡à ¡®âª 
86
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
104
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
87
are_key_cur_end
105
are_key_cur_end
88
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
106
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
89
;Ž¡à ¡®âª  ª« ¢¨è insert,delete.backspace,home,end,left,right
107
;Ž¡à ¡®âª  ª« ¢¨è insert,delete.backspace,home,end,left,right
90
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
108
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
91
use_work_key
109
use_work_key
92
}
110
}
93
 
111
 
94
macro use_editbox_mouse
112
macro use_editbox_mouse
95
{
113
{
96
;==========================================================
114
;==========================================================
97
;=== ®¡à ¡®âª  ¬ëè¨ =======================================
115
;=== ®¡à ¡®âª  ¬ëè¨ =======================================
98
;==========================================================
116
;==========================================================
99
;save for stdcall ebx,esi,edi,ebp
117
;save for stdcall ebx,esi,edi,ebp
100
edit_box_mouse:
118
edit_box_mouse:
101
pushad
119
pushad
102
        mov     edi,dword [esp+36]
120
        mov     edi,dword [esp+36]
103
;debug
121
;debug
104
;----------------------------------------------------------
122
;----------------------------------------------------------
105
;--- ¯®«ãç ¥¬ á®áâ®ï­¨¥ ª­®¯®ª ¬ëè¨ -----------------------
123
;--- ¯®«ãç ¥¬ á®áâ®ï­¨¥ ª­®¯®ª ¬ëè¨ -----------------------
106
;----------------------------------------------------------
124
;----------------------------------------------------------
107
        mcall   37,2
125
        mcall   37,2
108
;----------------------------------------------------------
126
;----------------------------------------------------------
109
;--- ¯à®¢¥à塞 á®áâ®ï­¨¥ ----------------------------------
127
;--- ¯à®¢¥à塞 á®áâ®ï­¨¥ ----------------------------------
110
;----------------------------------------------------------
128
;----------------------------------------------------------
111
        test    eax,1
129
        test    eax,1
112
        jnz     edit_box_mouse.mouse_left_button
130
        jnz     edit_box_mouse.mouse_left_button
113
        and     word ed_flags,ed_mouse_on_off
131
        and     word ed_flags,ed_mouse_on_off
114
	mov	ebx,dword ed_mouse_variable
132
	mov	ebx,dword ed_mouse_variable
115
	push	0
133
	push	0
116
	pop	dword [ebx]
134
	pop	dword [ebx]
117
;        mov     dword [ebx],ebx
135
;        mov     dword [ebx],ebx
118
        jmp     edit_box.editbox_exit
136
        jmp     edit_box.editbox_exit
119
.mouse_left_button:
137
.mouse_left_button:
120
;----------------------------------------------------------
138
;----------------------------------------------------------
121
;--- ¡«®ª¨à®¢ª  ®â 䮪ãá¨à®¢ª¨ ¢ ¤àã£¨å ¡®ªá å ¯à¨ ¯®¯ ¤ ­¨¨ ­  ­¨å ªãàá®à 
139
;--- ¡«®ª¨à®¢ª  ®â 䮪ãá¨à®¢ª¨ ¢ ¤àã£¨å ¡®ªá å ¯à¨ ¯®¯ ¤ ­¨¨ ­  ­¨å ªãàá®à 
122
;----------------------------------------------------------
140
;----------------------------------------------------------
123
        mov     eax,dword ed_mouse_variable
141
        mov     eax,dword ed_mouse_variable
124
	push	dword [eax]
142
	push	dword [eax]
125
	pop	eax
143
	pop	eax
126
        test    eax,eax
144
        test    eax,eax
127
        jz      @f
145
        jz      @f
128
        cmp     eax,edi
146
        cmp     eax,edi
129
        je      @f
147
        je      @f
130
        jmp     edit_box_mouse._blur
148
        jmp     edit_box_mouse._blur
131
;----------------------------------------------------------
149
;----------------------------------------------------------
132
;--- ¯®«ãç ¥¬ ª®®à¤¨­ âë ¬ëè¨ ®â­®á¨â¥«ì­® 0 â.¥ ¢á¥© ®¡« á⨠íªà ­ 
150
;--- ¯®«ãç ¥¬ ª®®à¤¨­ âë ¬ëè¨ ®â­®á¨â¥«ì­® 0 â.¥ ¢á¥© ®¡« á⨠íªà ­ 
133
;----------------------------------------------------------
151
;----------------------------------------------------------
134
@@:     mcall   37,1
152
@@:     mcall   37,1
135
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
153
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
136
;”ã­ªæ¨ï ®¡à ¡®âª¨  ¬ë誨 ¯®«ã祭¨¥ ª®®à¤¨­ â ¨ ¯à®¢¥àª  ¨å + ¢ë¤¥«¥­¨ï
154
;”ã­ªæ¨ï ®¡à ¡®âª¨  ¬ë誨 ¯®«ã祭¨¥ ª®®à¤¨­ â ¨ ¯à®¢¥àª  ¨å + ¢ë¤¥«¥­¨ï
137
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
155
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
138
use_work_mouse
156
use_work_mouse
139
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
157
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
140
;Ž¡é¨¥ ä㭪樨 ®¡à ¡®âª¨
158
;Ž¡é¨¥ ä㭪樨 ®¡à ¡®âª¨
141
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
159
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
142
use_general_func
160
use_general_func
143
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
161
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
144
;”㭪樨 ¤«ï à ¡®âë á key
162
;”㭪樨 ¤«ï à ¡®âë á key
145
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
163
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
146
use_key_func
164
use_key_func
147
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
165
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
148
;”㭪樨 ¤«ï à ¡®âë á mouse
166
;”㭪樨 ¤«ï à ¡®âë á mouse
149
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
167
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
150
use_mouse_func
168
use_mouse_func
151
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
169
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
152
;Bit mask from editbox
170
;Bit mask from editbox
153
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
171
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
154
}
172
}
155
 
173
 
156
 
174
 
157
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
175
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
158
;­¨¦¥ à á¯®«®¦¥­ë ä㭪樨 ª®â®à묨 ॠ«¨§ã¥âáï ¢¥áì  «£®à¨â¬
176
;­¨¦¥ à á¯®«®¦¥­ë ä㭪樨 ª®â®à묨 ॠ«¨§ã¥âáï ¢¥áì  «£®à¨â¬
159
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
177
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
160
;Œ ªà®á ¤«ï ¢ë¢®¤  ®á­®¢­ëå ä㭪権 ª®â®àë¥ ¨á¯®«ì§ãîâáï ¡®ªá®¬
178
;Œ ªà®á ¤«ï ¢ë¢®¤  ®á­®¢­ëå ä㭪権 ª®â®àë¥ ¨á¯®«ì§ãîâáï ¡®ªá®¬
161
macro use_general_func
179
macro use_general_func
162
{
180
{
163
;debug_func
181
;debug_func
164
;----------------------------------------------------------
182
;----------------------------------------------------------
165
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ¢ë¤¥«¥­­®© ç á⨠-----------------
183
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ¢ë¤¥«¥­­®© ç á⨠-----------------
166
;----------------------------------------------------------
184
;----------------------------------------------------------
167
edit_box.draw_shift:
185
edit_box.draw_shift:
168
        test    word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
186
        test    word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
169
        jz      @f
187
        jz      @f
170
        mov     ebp,shift_color
188
        mov     ebp,shift_color
171
        mov     ebx,dword       ed_shift_pos
189
        mov     ebx,dword       ed_shift_pos
172
        call    edit_box_key.sh_cl_
190
        call    edit_box_key.sh_cl_
173
@@:     ret
191
@@:     ret
174
;----------------------------------------------------------
192
;----------------------------------------------------------
175
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ⥪áâ  --------------------------
193
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ⥪áâ  --------------------------
176
;----------------------------------------------------------
194
;----------------------------------------------------------
177
edit_box.draw_text:
195
edit_box.draw_text:
178
;--- ¢ëç¨á«ï¥¬, ᪮«ìª® ¯®¬¥é ¥âáï ᨬ¢®«®¢ ---
196
;--- ¢ëç¨á«ï¥¬, ᪮«ìª® ¯®¬¥é ¥âáï ᨬ¢®«®¢ ---
179
;--- çâ®¡ë ¬ãá®à ­¥ à¨á®¢ âì ---
197
;--- çâ®¡ë ¬ãá®à ­¥ à¨á®¢ âì ---
180
        call    edit_box.get_n
198
        call    edit_box.get_n
181
        mov     esi,ed_size
199
        mov     esi,ed_size
182
        mov     ebx,ed_offset
200
        mov     ebx,ed_offset
183
        sub     esi,ebx
201
        sub     esi,ebx
184
        cmp     eax,esi
202
        cmp     eax,esi
185
        jae     @F
203
        jae     @F
186
        mov     esi,eax         ;çâ®¡ë ­¥ ¢ë室¨âì §  ¯à¥¤¥«ë íªà ­ 
204
        mov     esi,eax         ;çâ®¡ë ­¥ ¢ë室¨âì §  ¯à¥¤¥«ë íªà ­ 
187
;--- à¨á㥬 ⥪áâ ---
205
;--- à¨á㥬 ⥪áâ ---
188
@@:     mov     eax,4
206
@@:     mov     eax,4
189
        mov     ebx,ed_left
207
        mov     ebx,ed_left
190
        mov     edx,ed_offset
208
        mov     edx,ed_offset
191
        add     ebx,2
209
        add     ebx,2
192
        shl     ebx,16
210
        shl     ebx,16
193
        add     ebx,ed_top
211
        add     ebx,ed_top
194
        mov     ecx,ed_text_color
212
        mov     ecx,ed_text_color
195
        add     ebx,4
213
        add     ebx,4
196
        add     edx,ed_text
214
        add     edx,ed_text
197
		test    word ed_flags,ed_pass
215
		test    word ed_flags,ed_pass
198
		jz      @f
216
		jz      @f
199
		call    edit_box.draw_password
217
		call    edit_box.draw_password
200
		jmp     .end_f
218
		jmp     .end_f
201
@@:
219
@@:
202
        mcall
220
        mcall
203
.end_f:
221
.end_f:
204
ret
222
ret
205
 
223
 
206
txt_pass db '*',0
224
txt_pass db '*',0
207
 
225
 
208
proc edit_box.draw_password
226
proc edit_box.draw_password
209
locals
227
locals
210
	s_len dw ? ;¤«¨­  ¢ë¢®¤¨¬®£® ⥪áâ 
228
	s_len dw ? ;¤«¨­  ¢ë¢®¤¨¬®£® ⥪áâ 
211
endl
229
endl
212
	cmp esi,1
230
	cmp esi,1
213
	jl .end_f ;¥á«¨ áâப  ¯ãáâ ï
231
	jl .end_f ;¥á«¨ áâப  ¯ãáâ ï
214
	mov [s_len],si
232
	mov [s_len],si
215
	xor esi,esi
233
	xor esi,esi
216
	inc esi
234
	inc esi
217
	lea edx,[txt_pass]
235
	lea edx,[txt_pass]
218
@@:
236
@@:
219
	mcall
237
	mcall
220
	add ebx,6 shl 16 ;¤®¡ ¢«ï¥¬ áâ ­¤ àâ­ãî è¨à¨­ã ᨬ¢®« 
238
	add ebx,6 shl 16 ;¤®¡ ¢«ï¥¬ áâ ­¤ àâ­ãî è¨à¨­ã ᨬ¢®« 
221
	dec word[s_len]
239
	dec word[s_len]
222
	cmp word[s_len],0
240
	cmp word[s_len],0
223
	jg @b
241
	jg @b
224
.end_f:
242
.end_f:
225
ret
243
ret
226
endp
244
endp
227
;----------------------------------------------------------
245
;----------------------------------------------------------
228
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ä®­  ----------------------------
246
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ä®­  ----------------------------
229
;¢å®¤­ë¥ ¤ ­­ë¥
247
;¢å®¤­ë¥ ¤ ­­ë¥
230
;eax
248
;eax
231
;edx - color
249
;edx - color
232
;----------------------------------------------------------
250
;----------------------------------------------------------
233
 
251
 
234
edit_box.draw_bg:
252
edit_box.draw_bg:
235
        mov     ebx,ed_left
253
        mov     ebx,ed_left
236
        add     ebx,1
254
        add     ebx,1
237
        mov     edx,ed_color
255
        mov     edx,ed_color
238
        shl     ebx,16
256
        shl     ebx,16
239
        add     ebx,ed_width
257
        add     ebx,ed_width
240
        sub     ebx,1
258
        sub     ebx,1
241
;¢å®¤ ⮫쪮 梥â edx
259
;¢å®¤ ⮫쪮 梥â edx
242
edit_box.draw_bg_eax:
260
edit_box.draw_bg_eax:
243
        mov     ecx,ed_top
261
        mov     ecx,ed_top
244
        mov     eax,13
262
        mov     eax,13
245
        add     ecx,1
263
        add     ecx,1
246
        shl     ecx,16
264
        shl     ecx,16
247
        add     ecx,ed_height
265
        add     ecx,ed_height
248
        dec     ecx
266
        dec     ecx
249
        mcall
267
        mcall
250
ret
268
ret
251
;----------------------------------------------------------
269
;----------------------------------------------------------
252
;--- ¯à®æ¥¤ãà  ¯®«ã祭¨ï ª®«¨ç¥á⢠ ᨬ¢®«®¢ ¢ ⥪ã饩 è¨à¨­¥ ª®¬¯®­¥­â 
270
;--- ¯à®æ¥¤ãà  ¯®«ã祭¨ï ª®«¨ç¥á⢠ ᨬ¢®«®¢ ¢ ⥪ã饩 è¨à¨­¥ ª®¬¯®­¥­â 
253
;----------------------------------------------------------
271
;----------------------------------------------------------
254
edit_box.get_n:
272
edit_box.get_n:
255
        mov     eax,ed_width    ;¯®«ã祬 è¨à¨­ã ª®¬¯®­¥­â 
273
        mov     eax,ed_width    ;¯®«ã祬 è¨à¨­ã ª®¬¯®­¥­â 
256
        xor     edx,edx   ;१ã«ìâ â à á¯®« £ ¥âáï ¢ ¯ à¥ edx:eax ¢ eax - ®áâ â®ª
274
        xor     edx,edx   ;१ã«ìâ â à á¯®« £ ¥âáï ¢ ¯ à¥ edx:eax ¢ eax - ®áâ â®ª
257
        sub     eax,4           ;¢ëç⥬ 4
275
        sub     eax,4           ;¢ëç⥬ 4
258
        mov     ebx,6           ;§ £à㧨¬ ¤¥«¨â¥«ì
276
        mov     ebx,6           ;§ £à㧨¬ ¤¥«¨â¥«ì
259
        div     ebx             ;à §¤¥«¨¬ ­  6
277
        div     ebx             ;à §¤¥«¨¬ ­  6
260
ret
278
ret
261
;----------------------------------------------------------
279
;----------------------------------------------------------
262
;--- ¯à®æ¥¤ãà  à¨á®¢ ­¨ï ªãàá®à  --------------------------
280
;--- ¯à®æ¥¤ãà  à¨á®¢ ­¨ï ªãàá®à  --------------------------
263
;----------------------------------------------------------
281
;----------------------------------------------------------
264
;¢å®¤­ë¥ ebp- 梥â
282
;¢å®¤­ë¥ ebp- 梥â
265
edit_box.clear_cursor:
283
edit_box.clear_cursor:
266
        mov     edx,ebp
284
        mov     edx,ebp
267
        mov     ebx,cl_curs_x
285
        mov     ebx,cl_curs_x
268
        mov     ecx,cl_curs_y
286
        mov     ecx,cl_curs_y
269
        jmp     edit_box.draw_curs
287
        jmp     edit_box.draw_curs
270
edit_box.draw_cursor:
288
edit_box.draw_cursor:
271
        mov     edx,ed_text_color
289
        mov     edx,ed_text_color
272
        mov     ebx,ed_pos
290
        mov     ebx,ed_pos
273
        mov     ecx,ed_offset
291
        mov     ecx,ed_offset
274
        sub     ebx,ecx
292
        sub     ebx,ecx
275
 
293
 
276
        lea     ebx,[ebx*2+ebx]
294
        lea     ebx,[ebx*2+ebx]
277
        shl     ebx,1
295
        shl     ebx,1
278
        ;imul   ebx,6
296
        ;imul   ebx,6
279
        add     ebx,ed_left
297
        add     ebx,ed_left
280
        mov     ecx,ed_top
298
        mov     ecx,ed_top
281
        inc     ebx
299
        inc     ebx
282
        add     ecx,2
300
        add     ecx,2
283
        mov     ebp,ebx
301
        mov     ebp,ebx
284
        shl     ebx,16
302
        shl     ebx,16
285
        mov     bx,bp
303
        mov     bx,bp
286
        mov     ebp,ecx
304
        mov     ebp,ecx
287
 
305
 
288
        shl     ecx,16
306
        shl     ecx,16
289
        mov     cx,bp
307
        mov     cx,bp
290
        add     ecx,ed_height-4
308
        add     ecx,ed_height-4
291
 
309
 
292
        mov     cl_curs_x,ebx
310
        mov     cl_curs_x,ebx
293
        mov     cl_curs_y,ecx
311
        mov     cl_curs_y,ecx
294
edit_box.draw_curs:
312
edit_box.draw_curs:
295
        mcall   38
313
        mcall   38
296
ret
314
ret
297
;----------------------------------------------------------
315
;----------------------------------------------------------
298
;--- ¯à®æ¥¤ãà  à¨á®¢ ­¨ï à ¬ª¨ ----------------------------
316
;--- ¯à®æ¥¤ãà  à¨á®¢ ­¨ï à ¬ª¨ ----------------------------
299
;----------------------------------------------------------
317
;----------------------------------------------------------
300
edit_box.draw_border:
318
edit_box.draw_border:
301
;--- 梥â à ¬ª¨ ---
319
;--- 梥â à ¬ª¨ ---
302
        test    word ed_flags,ed_focus
320
        test    word ed_flags,ed_focus
303
        mov     edx,ed_focus_border_color
321
        mov     edx,ed_focus_border_color
304
        jne     @f
322
        jne     @f
305
        mov     edx,ed_blur_border_color
323
        mov     edx,ed_blur_border_color
306
@@:
324
@@:
307
;--- ᢥàåã ---
325
;--- ᢥàåã ---
308
        mov     eax,38
326
        mov     eax,38
309
        mov     ebx,ed_left
327
        mov     ebx,ed_left
310
        mov     ecx,ebx
328
        mov     ecx,ebx
311
        shl     ebx,16
329
        shl     ebx,16
312
        mov     bx,cx
330
        mov     bx,cx
313
        add     ebx,ed_width
331
        add     ebx,ed_width
314
        mov     ecx,ed_top
332
        mov     ecx,ed_top
315
        mov     esi,ecx
333
        mov     esi,ecx
316
        shl     ecx,16
334
        shl     ecx,16
317
        mov     cx,si
335
        mov     cx,si
318
        mcall
336
        mcall
319
;--- á­¨§ã ---
337
;--- á­¨§ã ---
320
        mov     esi,ecx
338
        mov     esi,ecx
321
        add     ecx,ed_height
339
        add     ecx,ed_height
322
        mov     ebp,ecx
340
        mov     ebp,ecx
323
        shl     ecx,16
341
        shl     ecx,16
324
        mov     cx,bp
342
        mov     cx,bp
325
        mcall
343
        mcall
326
;--- á«¥¢  ---
344
;--- á«¥¢  ---
327
        mov     cx,si
345
        mov     cx,si
328
        mov     ebp,ebx
346
        mov     ebp,ebx
329
        sub     ebx,ed_width
347
        sub     ebx,ed_width
330
        mcall
348
        mcall
331
;--- á¯à ¢  ---
349
;--- á¯à ¢  ---
332
        mov     ebx,ebp
350
        mov     ebx,ebp
333
        shl     ebx,16
351
        shl     ebx,16
334
        mov     bx,bp
352
        mov     bx,bp
335
        mcall
353
        mcall
336
ret
354
ret
337
;----------------------------------------------------------
355
;----------------------------------------------------------
338
;--- ¯à®¢¥àª , § è¥« «¨ ªãàá®à §  £à ­¨æë ¨, ¥á«¨ ­ ¤®, ---
356
;--- ¯à®¢¥àª , § è¥« «¨ ªãàá®à §  £à ­¨æë ¨, ¥á«¨ ­ ¤®, ---
339
;--- ¨§¬¥­ï¥¬ ᬥ饭¨¥ ------------------------------------
357
;--- ¨§¬¥­ï¥¬ ᬥ饭¨¥ ------------------------------------
340
;--- ¥á«¨ ᬥ饭¨¥ ¡ë«®, ãáâ ­®¢ª  ä« £  ed_offset_cl, ¨­ ç¥,
358
;--- ¥á«¨ ᬥ饭¨¥ ¡ë«®, ãáâ ­®¢ª  ä« £  ed_offset_cl, ¨­ ç¥,
341
; ¥á«¨ ­¨ç¥£® ­¥ ¨§¬¥­¨«®áì, â® ¢ëáâ ¢«¥­¨¥ ed_offset_fl
359
; ¥á«¨ ­¨ç¥£® ­¥ ¨§¬¥­¨«®áì, â® ¢ëáâ ¢«¥­¨¥ ed_offset_fl
342
; ¢ ®¡é¥© ¡¨â®¢®© ¬ âà¨æ¥ á®áâ®ï­¨ï ª®¬¯®­¥­â®¢ word ed_flags
360
; ¢ ®¡é¥© ¡¨â®¢®© ¬ âà¨æ¥ á®áâ®ï­¨ï ª®¬¯®­¥­â®¢ word ed_flags
343
;----------------------------------------------------------
361
;----------------------------------------------------------
344
edit_box.check_offset:
362
edit_box.check_offset:
345
pushad
363
pushad
346
        mov     ecx,ed_pos
364
        mov     ecx,ed_pos
347
        mov     ebx,ed_offset
365
        mov     ebx,ed_offset
348
        cmp     ebx,ecx
366
        cmp     ebx,ecx
349
        ja      edit_box.sub_8
367
        ja      edit_box.sub_8
350
 
368
 
351
        push    ebx
369
        push    ebx
352
        call    edit_box.get_n  ;¯®«ã稬 ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ã¬¥é îâáï ¢ è¨à¨­¥ ª®¬¯®­¥­â , ¢ ¯ à¥ ॣ¨áâ஢ edx:eax
370
        call    edit_box.get_n  ;¯®«ã稬 ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ã¬¥é îâáï ¢ è¨à¨­¥ ª®¬¯®­¥­â , ¢ ¯ à¥ ॣ¨áâ஢ edx:eax
353
        pop     ebx
371
        pop     ebx
354
        mov     edx,ebx
372
        mov     edx,ebx
355
        add     edx,eax         ;ed_offset+width editbox
373
        add     edx,eax         ;ed_offset+width editbox
356
        inc     edx             ;­¥®¡å®¤¨¬® ¤«ï ­®à¬ «ì­®£® ¯®«®¦¥­¨ï ªãàá®à  ¢ ªà ©­¥© «¥¢®© ¯®§¨æ¨¨
374
        inc     edx             ;­¥®¡å®¤¨¬® ¤«ï ­®à¬ «ì­®£® ¯®«®¦¥­¨ï ªãàá®à  ¢ ªà ©­¥© «¥¢®© ¯®§¨æ¨¨
357
        cmp     edx,ecx
375
        cmp     edx,ecx
358
        ja      @f
376
        ja      @f
359
 
377
 
360
        mov     edx,ed_size
378
        mov     edx,ed_size
361
        cmp     edx,ecx
379
        cmp     edx,ecx
362
        je      edit_box.add_end
380
        je      edit_box.add_end
363
 
381
 
364
        sub     edx,ecx
382
        sub     edx,ecx
365
        cmp     edx,8
383
        cmp     edx,8
366
        jbe     edit_box.add_8
384
        jbe     edit_box.add_8
367
        add     ebx,8
385
        add     ebx,8
368
        jmp     edit_box.chk_d
386
        jmp     edit_box.chk_d
369
 
387
 
370
edit_box.sub_8:
388
edit_box.sub_8:
371
	test    ecx,ecx
389
	test    ecx,ecx
372
        jz      edit_box.sub_min
390
        jz      edit_box.sub_min
373
        cmp     ebx,8
391
        cmp     ebx,8
374
        jbe     edit_box.sub_min
392
        jbe     edit_box.sub_min
375
        sub     ebx,8   ;ebx=ed_offset
393
        sub     ebx,8   ;ebx=ed_offset
376
        jmp     edit_box.chk_d
394
        jmp     edit_box.chk_d
377
edit_box.sub_min:
395
edit_box.sub_min:
378
        xor     ebx,ebx
396
        xor     ebx,ebx
379
        jmp     edit_box.chk_d
397
        jmp     edit_box.chk_d
380
 
398
 
381
edit_box.add_end:sub    edx,eax
399
edit_box.add_end:sub    edx,eax
382
        mov     ebx,edx
400
        mov     ebx,edx
383
        jmp     edit_box.chk_d
401
        jmp     edit_box.chk_d
384
edit_box.add_8: add     ebx,edx
402
edit_box.add_8: add     ebx,edx
385
edit_box.chk_d: mov     ed_offset,ebx
403
edit_box.chk_d: mov     ed_offset,ebx
386
        call    edit_box.draw_bg
404
        call    edit_box.draw_bg
387
        and     word ed_flags,ed_offset_cl
405
        and     word ed_flags,ed_offset_cl
388
edit_ex
406
edit_ex
389
@@:
407
@@:
390
        or      word ed_flags,ed_offset_fl
408
        or      word ed_flags,ed_offset_fl
391
 
409
 
392
edit_ex
410
edit_ex
393
 
411
 
394
align 4
412
align 4
395
proc edit_box_set_text, edit:dword, text:dword
413
proc edit_box_set_text, edit:dword, text:dword
396
pushad
414
pushad
397
	mov edi,dword[edit]
415
	mov edi,dword[edit]
398
	mov ecx,ed_max
416
	mov ecx,ed_max
399
	inc ecx ;ãç¨â뢠¥¬ ¡ã¤ã饥 ®¡à¥§ ­¨¥ áâப¨ ¤«ï ascii 0
417
	inc ecx ;ãç¨â뢠¥¬ ¡ã¤ã饥 ®¡à¥§ ­¨¥ áâப¨ ¤«ï ascii 0
400
	mov edi,dword[text]
418
	mov edi,dword[text]
401
	xor al,al
419
	xor al,al
402
	cld
420
	cld
403
	repne scasb ;¯®¨áª ¢ áâப¥ edi ᨬ¢®«  al
421
	repne scasb ;¯®¨áª ¢ áâப¥ edi ᨬ¢®«  al
404
	mov ecx,edi ;ecx = text + ¬¨­. §­ ç¥­¨¥ ¨§: 1) ed_max ¨«¨ 2) ¤«¨­ë áâப¨ text
422
	mov ecx,edi ;ecx = text + ¬¨­. §­ ç¥­¨¥ ¨§: 1) ed_max ¨«¨ 2) ¤«¨­ë áâப¨ text
405
 
423
 
406
	mov edi,dword[edit]
424
	mov edi,dword[edit]
407
	mov esi,dword[text]
425
	mov esi,dword[text]
408
	sub ecx,esi ;ecx = ¤«¨­  áâப¨ text (­® ­¥ ¡®«ìè¥ ç¥¬ ed_max)
426
	sub ecx,esi ;ecx = ¤«¨­  áâப¨ text (­® ­¥ ¡®«ìè¥ ç¥¬ ed_max)
409
	dec ecx
427
	dec ecx
410
	mov ed_size,ecx ;áâ ¢¨¬ ­®¢ë© à §¬¥à áâப¨
428
	mov ed_size,ecx ;áâ ¢¨¬ ­®¢ë© à §¬¥à áâப¨
411
	mov ed_pos,ecx ;áâ ¢¨¬ ªãàá®à ¢ ª®­¥æ ­®¢®© áâப¨
429
	mov ed_pos,ecx ;áâ ¢¨¬ ªãàá®à ¢ ª®­¥æ ­®¢®© áâப¨
412
	and word ed_flags,ed_shift_cl ;á­¨¬ ¥¬ ¢ë¤¥«¥­¨¥ ¥á«¨ ®­® ¡ë«®
430
	and word ed_flags,ed_shift_cl ;á­¨¬ ¥¬ ¢ë¤¥«¥­¨¥ ¥á«¨ ®­® ¡ë«®
413
	mov edi,ed_text
431
	mov edi,ed_text
414
	repne movsb ;ª®¯¨à®¢ ­¨¥ ⥪á⮢®© áâப¨ text ¢ edit_box
432
	repne movsb ;ª®¯¨à®¢ ­¨¥ ⥪á⮢®© áâப¨ text ¢ edit_box
415
	mov byte[edi],0 ;áâ ¢¨¬ ascii 0 ¢ ª®­æ¥ áâப¨
433
	mov byte[edi],0 ;áâ ¢¨¬ ascii 0 ¢ ª®­æ¥ áâப¨
416
popad
434
popad
417
ret
435
ret
418
endp
436
endp
419
}
437
}
420
 
438
 
421
macro use_key_func
439
macro use_key_func
422
{
440
{
423
;Ž¡à ¡®âª  Shift ¤«ï á­ïâ¨ï ¢ë¤¥«¥­¨ï ­¥¨§¢¥áâ­®© ®¡« áâ¨
441
;Ž¡à ¡®âª  Shift ¤«ï á­ïâ¨ï ¢ë¤¥«¥­¨ï ­¥¨§¢¥áâ­®© ®¡« áâ¨
424
edit_box_key.shift: ;;;;;;;SHIFT
442
edit_box_key.shift: ;;;;;;;SHIFT
425
        test    word ed_flags,ed_shift
443
        test    word ed_flags,ed_shift
426
        je      edit_box_key.f_exit
444
        je      edit_box_key.f_exit
427
 
445
 
428
@@:     mov     ebp,shift_color
446
@@:     mov     ebp,shift_color
429
        or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
447
        or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
430
        mov     ebx,dword       ed_shift_pos
448
        mov     ebx,dword       ed_shift_pos
431
        call    edit_box_key.sh_cl_
449
        call    edit_box_key.sh_cl_
432
        jmp     edit_box.draw_cursor_text
450
        jmp     edit_box.draw_cursor_text
433
;;;;;;;;;;;;;;;;;;;;;
451
;;;;;;;;;;;;;;;;;;;;;
434
edit_box_key.f_exit:
452
edit_box_key.f_exit:
435
	call	edit_box.check_offset
453
	call	edit_box.check_offset
436
        and     word ed_flags,ed_shift_cl
454
        and     word ed_flags,ed_shift_cl
437
        call    edit_box_key.enable_null
455
        call    edit_box_key.enable_null
438
        jmp     edit_box.draw_cursor_text
456
        jmp     edit_box.draw_cursor_text
439
edit_box_key.sh_cl_:
457
edit_box_key.sh_cl_:
440
;;;;;;SHIFT end
458
;;;;;;SHIFT end
441
;®¡à ¡®âª  ®ç¨á⪨, ¯à¨ «¥¢®¬ - ¯à ¢®¬ ¤¢¨¦¥­¨¨ ¢ë¤¥«¥­¨ï
459
;®¡à ¡®âª  ®ç¨á⪨, ¯à¨ «¥¢®¬ - ¯à ¢®¬ ¤¢¨¦¥­¨¨ ¢ë¤¥«¥­¨ï
442
;¤«ï ®¡à ¡®âª¨ á­ïâ¨ï ¢ë¤¥«¥­¨ï
460
;¤«ï ®¡à ¡®âª¨ á­ïâ¨ï ¢ë¤¥«¥­¨ï
443
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
461
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
444
        mov     eax,dword       ed_pos
462
        mov     eax,dword       ed_pos
445
        cmp     eax,ebx
463
        cmp     eax,ebx
446
 
464
 
447
        jae     edit_box_key.sh_n
465
        jae     edit_box_key.sh_n
448
        push    eax  ;¬¥­ì襥 ¢ eax
466
        push    eax  ;¬¥­ì襥 ¢ eax
449
        push    ebx  ;¡®«ì襥
467
        push    ebx  ;¡®«ì襥
450
        jmp     edit_box_key.sh_n1
468
        jmp     edit_box_key.sh_n1
451
                     ;¥á«¨ ¨­ ç¥
469
                     ;¥á«¨ ¨­ ç¥
452
edit_box_key.sh_n:
470
edit_box_key.sh_n:
453
	push    ebx
471
	push    ebx
454
        push    eax
472
        push    eax
455
edit_box_key.sh_n1:
473
edit_box_key.sh_n1:
456
        call    edit_box.check_offset
474
        call    edit_box.check_offset
457
        call    edit_box.get_n
475
        call    edit_box.get_n
458
        mov     edx,eax ;size of ed_box
476
        mov     edx,eax ;size of ed_box
459
        mov     ecx,ed_offset
477
        mov     ecx,ed_offset
460
        add     eax,ecx ;eax = w_off= ed_offset+width
478
        add     eax,ecx ;eax = w_off= ed_offset+width
461
        mov     edx,eax ;save
479
        mov     edx,eax ;save
462
        pop     ebx     ;¡®«ì襥
480
        pop     ebx     ;¡®«ì襥
463
        pop     eax     ;¬¥­ì襥
481
        pop     eax     ;¬¥­ì襥
464
 
482
 
465
        cmp     eax,ecx         ;áà ¢­¥­¨¥ ¬¥­ì襣® á offset.
483
        cmp     eax,ecx         ;áà ¢­¥­¨¥ ¬¥­ì襣® á offset.
466
        jae     edit_box_key.f_f            ;¥á«¨ ¡®«ìè¥
484
        jae     edit_box_key.f_f            ;¥á«¨ ¡®«ìè¥
467
        xor     eax,eax
485
        xor     eax,eax
468
        cmp     edx,ebx         ;cà ¢­¨¬ à §¬¥à w_off á ¡®«ì訬
486
        cmp     edx,ebx         ;cà ¢­¨¬ à §¬¥à w_off á ¡®«ì訬
469
        jb      @f
487
        jb      @f
470
        sub     ebx,ecx
488
        sub     ebx,ecx
471
        jmp     edit_box_key.nxt_f
489
        jmp     edit_box_key.nxt_f
472
@@:     mov     ebx,edx
490
@@:     mov     ebx,edx
473
        sub     ebx,ecx
491
        sub     ebx,ecx
474
        jmp     edit_box_key.nxt_f
492
        jmp     edit_box_key.nxt_f
475
edit_box_key.f_f:
493
edit_box_key.f_f:
476
        sub     eax,ecx
494
        sub     eax,ecx
477
        cmp     edx,ebx         ;cà ¢­¨¬ à §¬¥à w_off á ¡®«ì訬
495
        cmp     edx,ebx         ;cà ¢­¨¬ à §¬¥à w_off á ¡®«ì訬
478
        jle     @f
496
        jle     @f
479
        sub     ebx,ecx
497
        sub     ebx,ecx
480
        sub     ebx,eax
498
        sub     ebx,eax
481
        jmp     edit_box_key.nxt_f
499
        jmp     edit_box_key.nxt_f
482
@@:
500
@@:
483
        mov     ebx,edx
501
        mov     ebx,edx
484
        sub     ebx,ecx
502
        sub     ebx,ecx
485
        sub     ebx,eax
503
        sub     ebx,eax
486
edit_box_key.nxt_f:
504
edit_box_key.nxt_f:
487
        mov     edx,ebx
505
        mov     edx,ebx
488
        lea     ebx,[eax*2+eax]
506
        lea     ebx,[eax*2+eax]
489
        shl     ebx,1
507
        shl     ebx,1
490
        add     ebx,ed_left
508
        add     ebx,ed_left
491
        inc     ebx
509
        inc     ebx
492
        shl     ebx,16
510
        shl     ebx,16
493
        lea     ecx,[edx*2+edx]
511
        lea     ecx,[edx*2+edx]
494
        shl     ecx,1
512
        shl     ecx,1
495
        mov     bx,cx
513
        mov     bx,cx
496
        inc     ebx
514
        inc     ebx
497
        mov     edx,ebp;shift_color
515
        mov     edx,ebp;shift_color
498
 
516
 
499
        call    edit_box.draw_bg_eax
517
        call    edit_box.draw_bg_eax
500
@@:     call    edit_box_key.enable_null
518
@@:     call    edit_box_key.enable_null
501
        ret
519
        ret
502
;;;;;;;;;;;;;;;;;;;;;
520
;;;;;;;;;;;;;;;;;;;;;
503
;“áâ ­®¢ª - á­ï⨥ ¢ë¤¥«¥­¨ï ¢ ®¤¨­ ᨬ¢®«
521
;“áâ ­®¢ª - á­ï⨥ ¢ë¤¥«¥­¨ï ¢ ®¤¨­ ᨬ¢®«
504
;;;;;;;;;;;;;;;;;;;;;
522
;;;;;;;;;;;;;;;;;;;;;
505
edit_box_key.drw_sim:
523
edit_box_key.drw_sim:
506
        mov     eax,dword       ed_pos
524
        mov     eax,dword       ed_pos
507
        call    edit_box_key.draw_rectangle   ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª á § ¤ ­­ë¬ 梥⮬
525
        call    edit_box_key.draw_rectangle   ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª á § ¤ ­­ë¬ 梥⮬
508
        jmp     @b
526
        jmp     @b
509
;;;;;;;;;;;;;;;;;;;;;
527
;;;;;;;;;;;;;;;;;;;;;
510
;”ã­ªæ¨ï ãáâ ­®¢ª¨ ¢ë¤¥«¥­¨ï ¯à¨ ¤¢¨¦¥­¨¨ ¢«¥¢® ¨ ¢¯à ¢® ¨ ­ ¦ â¨¨ shift
528
;”ã­ªæ¨ï ãáâ ­®¢ª¨ ¢ë¤¥«¥­¨ï ¯à¨ ¤¢¨¦¥­¨¨ ¢«¥¢® ¨ ¢¯à ¢® ¨ ­ ¦ â¨¨ shift
511
;‹®£¨ª :
529
;‹®£¨ª :
512
;;;;;;;;;;
530
;;;;;;;;;;
513
edit_box_key.draw_wigwag:
531
edit_box_key.draw_wigwag:
514
;äã­ªæ¨ï ãáâ ­®¢ª¨ ¯¥à¥¬¥­­ëå
532
;äã­ªæ¨ï ãáâ ­®¢ª¨ ¯¥à¥¬¥­­ëå
515
        mov     ebp,shift_color
533
        mov     ebp,shift_color
516
        call    edit_box.clear_cursor
534
        call    edit_box.clear_cursor
517
 
535
 
518
        or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £  ¢ë¤¥«¥­­®© ®¡« áâ¨
536
        or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £  ¢ë¤¥«¥­­®© ®¡« áâ¨
519
        mov     ebp,shift_color
537
        mov     ebp,shift_color
520
        mov     eax,dword       ed_pos
538
        mov     eax,dword       ed_pos
521
        test    word ed_flags,ed_left_fl
539
        test    word ed_flags,ed_left_fl
522
        jz      edit_box_key.low
540
        jz      edit_box_key.low
523
        jmp     @f
541
        jmp     @f
524
;;;;;;;;;;
542
;;;;;;;;;;
525
;”ã­ªæ¨ï 㤠«¥­¨ï ¢ë¤¥«¥­¨ï ¯à¨ ¤¢¨¦¥­¨¨ ¢«¥¢® ¨ ¢¯à ¢® ¨ ­ ¦ â¨¨ shift
543
;”ã­ªæ¨ï 㤠«¥­¨ï ¢ë¤¥«¥­¨ï ¯à¨ ¤¢¨¦¥­¨¨ ¢«¥¢® ¨ ¢¯à ¢® ¨ ­ ¦ â¨¨ shift
526
;‹®£¨ª :
544
;‹®£¨ª :
527
;;;;;;;;;;
545
;;;;;;;;;;
528
edit_box_key.draw_wigwag_cl:
546
edit_box_key.draw_wigwag_cl:
529
;äã­ªæ¨ï ãáâ ­®¢ª¨ ¯¥à¥¬¥­­ëå
547
;äã­ªæ¨ï ãáâ ­®¢ª¨ ¯¥à¥¬¥­­ëå
530
        mov     ebp,ed_color
548
        mov     ebp,ed_color
531
        call    edit_box.clear_cursor
549
        call    edit_box.clear_cursor
532
 
550
 
533
        mov     ebp,ed_color
551
        mov     ebp,ed_color
534
        mov     eax,dword       ed_pos
552
        mov     eax,dword       ed_pos
535
        test    word ed_flags,ed_left_fl
553
        test    word ed_flags,ed_left_fl
536
        jz      edit_box_key.low
554
        jz      edit_box_key.low
537
@@:     call    edit_box_key.draw_rectangle  ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª § ªà è¨¢ ¥¬®© ®¡« áâ¨
555
@@:     call    edit_box_key.draw_rectangle  ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª § ªà è¨¢ ¥¬®© ®¡« áâ¨
538
        ret
556
        ret
539
edit_box_key.low:   dec     eax
557
edit_box_key.low:   dec     eax
540
        jmp     @b
558
        jmp     @b
541
;¢å®¤­®© ¯ à ¬¥âà ebx - ed_pos
559
;¢å®¤­®© ¯ à ¬¥âà ebx - ed_pos
542
edit_box_key.sh_first_sh:
560
edit_box_key.sh_first_sh:
543
        test    word ed_flags,ed_shift
561
        test    word ed_flags,ed_shift
544
        je      @f
562
        je      @f
545
        mov     dword ed_shift_pos_old,ebx
563
        mov     dword ed_shift_pos_old,ebx
546
        test    word ed_flags,ed_shift_on
564
        test    word ed_flags,ed_shift_on
547
        jne     @f
565
        jne     @f
548
        mov     dword ed_shift_pos,ebx
566
        mov     dword ed_shift_pos,ebx
549
        or      word ed_flags,ed_shift_on
567
        or      word ed_flags,ed_shift_on
550
@@:     ret
568
@@:     ret
551
;Ž¡à ¡®âª  ªà ©­¨å ¯®«®¦¥­¨© ¢ editbox ¯à¨ ­ ¦ â®¬ shift
569
;Ž¡à ¡®âª  ªà ©­¨å ¯®«®¦¥­¨© ¢ editbox ¯à¨ ­ ¦ â®¬ shift
552
;¯à®¨§¢®¤¨â á­ï⨥ ¢ë¤¥«¥­¨ï, ¥á«¨ ­¥â shift
570
;¯à®¨§¢®¤¨â á­ï⨥ ¢ë¤¥«¥­¨ï, ¥á«¨ ­¥â shift
553
;¨­ ç¥ ¢®®¡é¥ ¢ë室¨â
571
;¨­ ç¥ ¢®®¡é¥ ¢ë室¨â
554
edit_box_key.sh_st_of:
572
edit_box_key.sh_st_of:
555
        test    word ed_flags,ed_shift
573
        test    word ed_flags,ed_shift
556
        jne     @f
574
        jne     @f
557
        test    word ed_flags,ed_shift_bac
575
        test    word ed_flags,ed_shift_bac
558
        je      @f
576
        je      @f
559
        mov     ebp,ed_color
577
        mov     ebp,ed_color
560
        mov     ebx,dword       ed_shift_pos
578
        mov     ebx,dword       ed_shift_pos
561
        call    edit_box_key.sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
579
        call    edit_box_key.sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
562
        and     word ed_flags,ed_shift_cl ; ®ç¨á⪠ ®â ⮣®, çâ® ã¡à «¨ ¢ë¤¥«¥­¨¥
580
        and     word ed_flags,ed_shift_cl ; ®ç¨á⪠ ®â ⮣®, çâ® ã¡à «¨ ¢ë¤¥«¥­¨¥
563
        jmp     edit_box.draw_cursor_text
581
        jmp     edit_box.draw_cursor_text
564
@@:
582
@@:
565
        and     word ed_flags,ed_shift_off
583
        and     word ed_flags,ed_shift_off
566
        popad
584
        popad
567
        ret     4
585
        ret     4
568
;¯à®¢¥àª  á®áâ®ï­¨ï shift, ¡ë« «¨ ®­ ­ ¦ â à ­ìè¥?
586
;¯à®¢¥àª  á®áâ®ï­¨ï shift, ¡ë« «¨ ®­ ­ ¦ â à ­ìè¥?
569
edit_box_key.sh_enable:
587
edit_box_key.sh_enable:
570
        test    word ed_flags,ed_shift
588
        test    word ed_flags,ed_shift
571
        jne     edit_box_key.sh_ext_en ;­ à¨á®¢ âì § ªà è¥­­ë© ¯àאַ㣮«ì­¨ª
589
        jne     edit_box_key.sh_ext_en ;­ à¨á®¢ âì § ªà è¥­­ë© ¯àאַ㣮«ì­¨ª
572
 
590
 
573
        test    word ed_flags,ed_shift_bac
591
        test    word ed_flags,ed_shift_bac
574
        je      @f
592
        je      @f
575
        call    edit_box.check_offset
593
        call    edit_box.check_offset
576
 
594
 
577
        mov     ebp,ed_color
595
        mov     ebp,ed_color
578
        mov     ebx,dword       ed_shift_pos
596
        mov     ebx,dword       ed_shift_pos
579
        call    edit_box_key.sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­­®£® äà £¬¥­â 
597
        call    edit_box_key.sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­­®£® äà £¬¥­â 
580
        call    edit_box_key.draw_wigwag_cl
598
        call    edit_box_key.draw_wigwag_cl
581
        and     word ed_flags,ed_shift_cl ; 1¢ à ­¥ ­ã¦­®
599
        and     word ed_flags,ed_shift_cl ; 1¢ à ­¥ ­ã¦­®
582
        ret
600
        ret
583
 
601
 
584
@@:     mov     ebp,ed_color
602
@@:     mov     ebp,ed_color
585
        call    edit_box.clear_cursor
603
        call    edit_box.clear_cursor
586
        call    edit_box.check_offset
604
        call    edit_box.check_offset
587
        ret
605
        ret
588
edit_box_key.sh_ext_en:
606
edit_box_key.sh_ext_en:
589
        call    edit_box.check_offset
607
        call    edit_box.check_offset
590
        test    word ed_flags,ed_offset_fl
608
        test    word ed_flags,ed_offset_fl
591
        je      @f
609
        je      @f
592
;¨á®¢ ­¨¥ § ªà è¥­­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ¨å ®ç¨á⪠
610
;¨á®¢ ­¨¥ § ªà è¥­­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ¨å ®ç¨á⪠
593
        mov     eax,dword       ed_shift_pos
611
        mov     eax,dword       ed_shift_pos
594
        mov     ebx,dword       ed_pos
612
        mov     ebx,dword       ed_pos
595
        mov     ecx,dword       ed_shift_pos_old
613
        mov     ecx,dword       ed_shift_pos_old
596
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­­ëå ®¡« á⥩
614
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­­ëå ®¡« á⥩
597
        cmp     eax,ecx
615
        cmp     eax,ecx
598
        je      edit_box_key.1_shem
616
        je      edit_box_key.1_shem
599
        jb      edit_box_key.smaller
617
        jb      edit_box_key.smaller
600
        cmp     ecx,ebx
618
        cmp     ecx,ebx
601
        ja      edit_box_key.1_shem
619
        ja      edit_box_key.1_shem
602
        call    edit_box_key.draw_wigwag_cl ;clear
620
        call    edit_box_key.draw_wigwag_cl ;clear
603
        jmp     edit_box_key.sh_e_end
621
        jmp     edit_box_key.sh_e_end
604
edit_box_key.smaller:
622
edit_box_key.smaller:
605
        cmp     ecx,ebx
623
        cmp     ecx,ebx
606
        jb      edit_box_key.1_shem
624
        jb      edit_box_key.1_shem
607
        call    edit_box_key.draw_wigwag_cl ;clear
625
        call    edit_box_key.draw_wigwag_cl ;clear
608
        jmp     edit_box_key.sh_e_end
626
        jmp     edit_box_key.sh_e_end
609
;alike  =
627
;alike  =
610
edit_box_key.1_shem:        call   edit_box_key.draw_wigwag
628
edit_box_key.1_shem:        call   edit_box_key.draw_wigwag
611
edit_box_key.sh_e_end:      and     word ed_flags,ed_shift_off
629
edit_box_key.sh_e_end:      and     word ed_flags,ed_shift_off
612
        ret
630
        ret
613
@@:     mov     ebp,shift_color
631
@@:     mov     ebp,shift_color
614
        mov     ebx,dword       ed_shift_pos
632
        mov     ebx,dword       ed_shift_pos
615
        call    edit_box_key.sh_cl_
633
        call    edit_box_key.sh_cl_
616
        jmp     edit_box_key.sh_e_end
634
        jmp     edit_box_key.sh_e_end
617
;äã­ªæ¨ï ¤«ï ®¡à ¡®âª¨ shift ¯à¨ ­ ¦ â¨¨ home and end
635
;äã­ªæ¨ï ¤«ï ®¡à ¡®âª¨ shift ¯à¨ ­ ¦ â¨¨ home and end
618
edit_box_key.sh_home_end:
636
edit_box_key.sh_home_end:
619
        mov     ebp,ed_color
637
        mov     ebp,ed_color
620
        call    edit_box.clear_cursor
638
        call    edit_box.clear_cursor
621
        test    word ed_flags,ed_shift_bac
639
        test    word ed_flags,ed_shift_bac
622
        je      @f
640
        je      @f
623
        mov     ebp,ed_color
641
        mov     ebp,ed_color
624
        mov     ebx,dword       ed_shift_pos_old
642
        mov     ebx,dword       ed_shift_pos_old
625
        call    edit_box_key.sh_cl_
643
        call    edit_box_key.sh_cl_
626
 
644
 
627
@@:     test    word ed_flags,ed_shift
645
@@:     test    word ed_flags,ed_shift
628
        je      edit_box_key.sh_exit_ ;¢ë©â¨
646
        je      edit_box_key.sh_exit_ ;¢ë©â¨
629
        mov     ebp,shift_color
647
        mov     ebp,shift_color
630
        mov     ebx,dword       ed_shift_pos
648
        mov     ebx,dword       ed_shift_pos
631
        call    edit_box_key.sh_cl_
649
        call    edit_box_key.sh_cl_
632
        or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
650
        or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
633
        jmp     edit_box_key.sh_e_end
651
        jmp     edit_box_key.sh_e_end
634
edit_box_key.sh_exit_:
652
edit_box_key.sh_exit_:
635
        call    edit_box.draw_bg
653
        call    edit_box.draw_bg
636
	call    edit_box.check_offset
654
	call    edit_box.check_offset
637
        ret
655
        ret
638
;äã­ªæ¨ï ¢­¥á¥­¨ï 0 ¯®  ¤à¥áã ed_size+1
656
;äã­ªæ¨ï ¢­¥á¥­¨ï 0 ¯®  ¤à¥áã ed_size+1
639
edit_box_key.enable_null:
657
edit_box_key.enable_null:
640
        pusha
658
        pusha
641
        mov     eax,ed_size
659
        mov     eax,ed_size
642
        mov     ebx,ed_text
660
        mov     ebx,ed_text
643
        test    eax,eax
661
        test    eax,eax
644
        add     eax,ebx
662
        add     eax,ebx
645
        jne     @f
663
        jne     @f
646
        inc     eax
664
        inc     eax
647
@@:     xor     ebx,ebx
665
@@:     xor     ebx,ebx
648
        mov     [eax],bl
666
        mov     [eax],bl
649
edit_ex
667
edit_ex
650
;- 㤠«¥­¨¥ ᨬ¢®« 
668
;- 㤠«¥­¨¥ ᨬ¢®« 
651
;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
669
;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
652
edit_box_key.del_char:
670
edit_box_key.del_char:
653
        mov     esi,ed_text
671
        mov     esi,ed_text
654
        test    word ed_flags,ed_shift_on
672
        test    word ed_flags,ed_shift_on
655
        je      @f
673
        je      @f
656
        mov     eax,dword ed_shift_pos
674
        mov     eax,dword ed_shift_pos
657
        mov     ebx,esi
675
        mov     ebx,esi
658
        cmp     eax,ecx
676
        cmp     eax,ecx
659
        jae     edit_box_key.dh_n
677
        jae     edit_box_key.dh_n
660
 
678
 
661
        mov     ed_pos,eax      ;çâ®¡ë ­¥ ¡ë«® ã¡¥£ ­¨ï ªãàá®à 
679
        mov     ed_pos,eax      ;çâ®¡ë ­¥ ¡ë«® ã¡¥£ ­¨ï ªãàá®à 
662
        mov     ebp,ecx
680
        mov     ebp,ecx
663
        sub     ebp,eax
681
        sub     ebp,eax
664
        add     ebx,eax  ;eax ¬¥­ìè¥
682
        add     ebx,eax  ;eax ¬¥­ìè¥
665
        sub     edx,ecx
683
        sub     edx,ecx
666
        add     esi,ecx
684
        add     esi,ecx
667
 
685
 
668
        mov     dword ed_shift_pos,ebp
686
        mov     dword ed_shift_pos,ebp
669
        jmp     edit_box_key.del_ch_sh
687
        jmp     edit_box_key.del_ch_sh
670
                     ;¥á«¨ ¨­ ç¥
688
                     ;¥á«¨ ¨­ ç¥
671
edit_box_key.dh_n:
689
edit_box_key.dh_n:
672
        mov     ebp,eax
690
        mov     ebp,eax
673
        sub     ebp,ecx
691
        sub     ebp,ecx
674
        add     ebx,ecx
692
        add     ebx,ecx
675
        sub     edx,eax
693
        sub     edx,eax
676
        add     esi,eax
694
        add     esi,eax
677
        mov     dword ed_shift_pos,ebp
695
        mov     dword ed_shift_pos,ebp
678
        jmp     edit_box_key.del_ch_sh
696
        jmp     edit_box_key.del_ch_sh
679
 
697
 
680
@@:     add     esi,ecx ;㪠§ â¥«ì + ᬥ饭¨¥ ª ॠ«ì­®¬ã ¡ãä¥àã
698
@@:     add     esi,ecx ;㪠§ â¥«ì + ᬥ饭¨¥ ª ॠ«ì­®¬ã ¡ãä¥àã
681
        mov     ebx,esi
699
        mov     ebx,esi
682
        inc     esi
700
        inc     esi
683
        cld
701
        cld
684
 
702
 
685
        sub     edx,ecx
703
        sub     edx,ecx
686
edit_box_key.del_ch_sh:
704
edit_box_key.del_ch_sh:
687
 
705
 
688
        push    edi
706
        push    edi
689
        mov     edi,ebx
707
        mov     edi,ebx
690
@@:
708
@@:
691
        lodsb
709
        lodsb
692
        stosb
710
        stosb
693
        dec edx
711
        dec edx
694
        jns @b
712
        jns @b
695
 
713
 
696
        pop edi
714
        pop edi
697
        ret
715
        ret
698
;¢ëç¨á«¨âì § ªà è¨¢ ¥¬ãî ®¡« áâì
716
;¢ëç¨á«¨âì § ªà è¨¢ ¥¬ãî ®¡« áâì
699
;ᮣ« è¥­¨¥ ¢ ebp - ¯¥à¥¤ ¥âáï ed_size
717
;ᮣ« è¥­¨¥ ¢ ebp - ¯¥à¥¤ ¥âáï ed_size
700
edit_box_key.clear_bg:
718
edit_box_key.clear_bg:
701
        call    edit_box.get_n  ;¯®«ãç¨âì à §¬¥à ¢ ᨬ¢®« å è¨à¨­ë ª®¬¯®­¥­â 
719
        call    edit_box.get_n  ;¯®«ãç¨âì à §¬¥à ¢ ᨬ¢®« å è¨à¨­ë ª®¬¯®­¥­â 
702
        push    eax
720
        push    eax
703
        mov     ebx,ed_offset
721
        mov     ebx,ed_offset
704
        add     eax,ebx ;eax = w_off= ed_offset+width
722
        add     eax,ebx ;eax = w_off= ed_offset+width
705
        mov     ebx,ebp ;ed_size
723
        mov     ebx,ebp ;ed_size
706
 
724
 
707
        cmp     eax,ebx
725
        cmp     eax,ebx
708
        jb      @f
726
        jb      @f
709
        mov     eax,ed_pos
727
        mov     eax,ed_pos
710
        sub     ebx,eax
728
        sub     ebx,eax
711
        mov     ecx,ed_offset
729
        mov     ecx,ed_offset
712
        sub     eax,ecx
730
        sub     eax,ecx
713
        jmp     edit_box_key.nxt
731
        jmp     edit_box_key.nxt
714
@@:     mov     ebx,ed_pos
732
@@:     mov     ebx,ed_pos
715
        push    ebx
733
        push    ebx
716
        sub     eax,ebx
734
        sub     eax,ebx
717
        mov     ebx,eax ;It is not optimal
735
        mov     ebx,eax ;It is not optimal
718
 
736
 
719
        pop     eax     ;ed_pos
737
        pop     eax     ;ed_pos
720
        mov     ecx,ed_offset
738
        mov     ecx,ed_offset
721
        sub     eax,ecx
739
        sub     eax,ecx
722
edit_box_key.nxt:
740
edit_box_key.nxt:
723
        mov     ebp,eax  ;¯à®¢¥àª  ­  ¢ë室 § ªà è¨¢ ¥¬®© ®¡« á⨠§  ¯à¥¤¥«ë ¤«¨­ë
741
        mov     ebp,eax  ;¯à®¢¥àª  ­  ¢ë室 § ªà è¨¢ ¥¬®© ®¡« á⨠§  ¯à¥¤¥«ë ¤«¨­ë
724
        add     ebp,ebx
742
        add     ebp,ebx
725
        pop     edx
743
        pop     edx
726
        cmp     ebp,edx
744
        cmp     ebp,edx
727
        je      @f
745
        je      @f
728
        inc     ebx
746
        inc     ebx
729
 
747
 
730
@@:     mov     edx,ebx
748
@@:     mov     edx,ebx
731
        lea     ebx,[eax*2+eax]
749
        lea     ebx,[eax*2+eax]
732
        shl     ebx,1
750
        shl     ebx,1
733
        add     ebx,ed_left
751
        add     ebx,ed_left
734
        inc     ebx
752
        inc     ebx
735
        shl     ebx,16
753
        shl     ebx,16
736
        lea     ecx,[edx*2+edx]
754
        lea     ecx,[edx*2+edx]
737
        shl     ecx,1
755
        shl     ecx,1
738
        mov     bx,cx
756
        mov     bx,cx
739
        mov     edx,ed_color
757
        mov     edx,ed_color
740
        call    edit_box.draw_bg_eax
758
        call    edit_box.draw_bg_eax
741
        ret
759
        ret
742
;;;;;;;;;;;;;;;;;;;
760
;;;;;;;;;;;;;;;;;;;
743
;;; Ž¡à ¡®âª  ¯à¨¬¨â¨¢®¢
761
;;; Ž¡à ¡®âª  ¯à¨¬¨â¨¢®¢
744
;;;;;;;;;;;;;;;;;;;;
762
;;;;;;;;;;;;;;;;;;;;
745
; à¨á®¢ âì ¯àאַ㣮«ì­¨ª, 梥⠯¥à¥¤ ¥âáï ¢ ebp
763
; à¨á®¢ âì ¯àאַ㣮«ì­¨ª, 梥⠯¥à¥¤ ¥âáï ¢ ebp
746
;¢å®¤­ë¥ ¯ à ¬¥âàë:
764
;¢å®¤­ë¥ ¯ à ¬¥âàë:
747
;eax=dword ed_pos
765
;eax=dword ed_pos
748
;ebp=-梥â ed_color or shift_color
766
;ebp=-梥â ed_color or shift_color
749
edit_box_key.draw_rectangle:
767
edit_box_key.draw_rectangle:
750
        mov     ecx,dword ed_offset
768
        mov     ecx,dword ed_offset
751
        sub     eax,ecx
769
        sub     eax,ecx
752
        lea     ebx,[eax*2+eax]
770
        lea     ebx,[eax*2+eax]
753
        shl     ebx,1
771
        shl     ebx,1
754
        inc     ebx
772
        inc     ebx
755
        add     ebx,ed_left
773
        add     ebx,ed_left
756
        shl     ebx,16
774
        shl     ebx,16
757
        add     ebx,6
775
        add     ebx,6
758
        mov     edx,ebp
776
        mov     edx,ebp
759
        call    edit_box.draw_bg_eax
777
        call    edit_box.draw_bg_eax
760
        ret
778
        ret
761
;;;;;;;;;;;;;;;;;;
779
;;;;;;;;;;;;;;;;;;
762
;;à®¢¥àª  ­ ¦ â «¨ shift
780
;;à®¢¥àª  ­ ¦ â «¨ shift
763
;;;;;;;;;;;;;;;;;;
781
;;;;;;;;;;;;;;;;;;
764
edit_box_key.check_shift:
782
edit_box_key.check_shift:
765
pusha   ;á®åà ­¨¬ ¢á¥ ॣ¨áâàë
783
pusha   ;á®åà ­¨¬ ¢á¥ ॣ¨áâàë
766
        mcall   66,3
784
        mcall   66,3
767
        test    al,0x03
785
        test    al,0x03
768
        je      @f
786
        je      @f
769
        or      word ed_flags,ed_shift   ;ãáâ ­®¢¨¬ ä« £
787
        or      word ed_flags,ed_shift   ;ãáâ ­®¢¨¬ ä« £
770
@@:edit_ex
788
@@:edit_ex
771
}
789
}
772
 
790
 
773
macro use_key_no_process  up,down,esc,enter,tab,numl,capsl,scrolll
791
macro use_key_no_process  up,down,esc,enter,tab,numl,capsl,scrolll
774
{
792
{
775
if up eq
793
if up eq
776
else
794
else
777
        cmp     ah,177
795
        cmp     ah,177
778
        jz      edit_box.editbox_exit
796
        jz      edit_box.editbox_exit
779
end if
797
end if
780
if down eq
798
if down eq
781
else
799
else
782
        cmp     ah,178
800
        cmp     ah,178
783
        jz      edit_box.editbox_exit
801
        jz      edit_box.editbox_exit
784
end if
802
end if
785
if esc eq
803
if esc eq
786
else
804
else
787
        cmp     ah,27   ;ESC - ª« ¢¨è  ))
805
        cmp     ah,27   ;ESC - ª« ¢¨è  ))
788
        jz      edit_box.editbox_exit
806
        jz      edit_box.editbox_exit
789
end if
807
end if
790
if enter eq
808
if enter eq
791
else
809
else
792
        cmp     ah,13   ;ENTER - ª« ¢¨è  ))
810
        cmp     ah,13   ;ENTER - ª« ¢¨è  ))
793
        jz      edit_box.editbox_exit
811
        jz      edit_box.editbox_exit
794
end if
812
end if
795
if tab eq
813
if tab eq
796
else
814
else
797
        cmp     ah,9   ;TAB - ª« ¢¨è  ))
815
        cmp     ah,9   ;TAB - ª« ¢¨è  ))
798
        jz      edit_box.editbox_exit
816
        jz      edit_box.editbox_exit
799
end if
817
end if
800
 
818
 
801
if numl eq
819
if numl eq
802
else
820
else
803
        cmp     ah,4   ;Num Lock - ª« ¢¨è  ))
821
        cmp     ah,4   ;Num Lock - ª« ¢¨è  ))
804
        jz      edit_box.editbox_exit
822
        jz      edit_box.editbox_exit
805
end if
823
end if
806
 
824
 
807
if capsl eq
825
if capsl eq
808
else
826
else
809
        cmp     ah,2   ;Caps Lock - ª« ¢¨è  ))
827
        cmp     ah,2   ;Caps Lock - ª« ¢¨è  ))
810
        jz      edit_box.editbox_exit
828
        jz      edit_box.editbox_exit
811
end if
829
end if
812
 
830
 
813
if scrolll eq
831
if scrolll eq
814
else
832
else
815
        cmp     ah,1   ;Scroll Lock - ª« ¢¨è  ))
833
        cmp     ah,1   ;Scroll Lock - ª« ¢¨è  ))
816
        jz      edit_box.editbox_exit
834
        jz      edit_box.editbox_exit
817
end if
835
end if
818
 
836
 
819
}
837
}
820
 
838
 
821
macro use_key_figures_only
839
macro use_key_figures_only
822
{
840
{
823
        test    word ed_flags,ed_figure_only  ; ⮫쪮 æ¨äàë?
841
        test    word ed_flags,ed_figure_only  ; ⮫쪮 æ¨äàë?
824
        jz      @f
842
        jz      @f
825
        cmp     ah,'0'
843
        cmp     ah,'0'
826
        jb      edit_box.editbox_exit
844
        jb      edit_box.editbox_exit
827
        cmp     ah,'9'
845
        cmp     ah,'9'
828
        ja      edit_box.editbox_exit
846
        ja      edit_box.editbox_exit
829
@@:
847
@@:
830
}
848
}
831
macro are_key_shift_press
849
macro are_key_shift_press
832
{
850
{
833
        test    word ed_flags,ed_shift_on
851
        test    word ed_flags,ed_shift_on
834
        je      @f
852
        je      @f
835
        ;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
853
        ;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
836
        push    eax
854
        push    eax
837
        mov     edx,ed_size
855
        mov     edx,ed_size
838
        mov     ecx, ed_pos
856
        mov     ecx, ed_pos
839
        pusha
857
        pusha
840
;;;;;;;;;;;;;;;;;;;;;
858
;;;;;;;;;;;;;;;;;;;;;
841
;clear input arrea
859
;clear input arrea
842
        mov     ebp,ed_color
860
        mov     ebp,ed_color
843
        mov     ebx,dword       ed_shift_pos
861
        mov     ebx,dword       ed_shift_pos
844
        call    edit_box_key.sh_cl_
862
        call    edit_box_key.sh_cl_
845
        mov     ebp,ed_size
863
        mov     ebp,ed_size
846
        call    edit_box_key.clear_bg
864
        call    edit_box_key.clear_bg
847
;;;;;;;;;;;;;;;;;;;;;
865
;;;;;;;;;;;;;;;;;;;;;
848
        popa
866
        popa
849
        call    edit_box_key.del_char
867
        call    edit_box_key.del_char
850
;;;;
868
;;;;
851
        mov     ebx,ed_size
869
        mov     ebx,ed_size
852
        sub     ebx,dword ed_shift_pos
870
        sub     ebx,dword ed_shift_pos
853
        mov     ed_size,ebx
871
        mov     ed_size,ebx
854
        pop     eax
872
        pop     eax
855
@@:
873
@@:
856
}
874
}
857
macro are_key_cur_end
875
macro are_key_cur_end
858
{
876
{
859
        mov     ecx,ed_size
877
        mov     ecx,ed_size
860
        mov     edx, ed_max
878
        mov     edx, ed_max
861
        test    word ed_flags,ed_insert
879
        test    word ed_flags,ed_insert
862
        jne     @f
880
        jne     @f
863
        cmp     ecx,edx
881
        cmp     ecx,edx
864
        jae     edit_box.editbox_exit
882
        jae     edit_box.editbox_exit
865
@@:     mov     ebx, ed_pos
883
@@:     mov     ebx, ed_pos
866
        cmp     ebx,edx
884
        cmp     ebx,edx
867
        jl      @f ; ¥á«¨ ¬¥­ìè¥ ¨«¨ à ¢­®
885
        jl      @f ; ¥á«¨ ¬¥­ìè¥ ¨«¨ à ¢­®
868
        jmp     edit_box.editbox_exit
886
        jmp     edit_box.editbox_exit
869
 
887
 
870
@@:     ; ᤢ¨£ ¥¬ ᨬ¢®«ë ¯®á«¥ ªãàá®à  ¢¯à ¢®
888
@@:     ; ᤢ¨£ ¥¬ ᨬ¢®«ë ¯®á«¥ ªãàá®à  ¢¯à ¢®
871
        mov     ecx,ed_size
889
        mov     ecx,ed_size
872
        push    edi eax
890
        push    edi eax
873
        mov     ebp,edi
891
        mov     ebp,edi
874
        mov     esi,ed_text     ; “ª § â¥«ì ­  ¡ãä¥à
892
        mov     esi,ed_text     ; “ª § â¥«ì ­  ¡ãä¥à
875
                                ;ã¤¥¬ à ¡®â âì á® áâப®©
893
                                ;ã¤¥¬ à ¡®â âì á® áâப®©
876
        add     esi,ecx         ;add ed_size ¤®¡ ¢¨¬ max size
894
        add     esi,ecx         ;add ed_size ¤®¡ ¢¨¬ max size
877
        mov     edi,esi
895
        mov     edi,esi
878
 
896
 
879
        cmp     ecx,ebx         ;…᫨ ã ­ á ¯®§¨æ¨ï ªãàá®à  = ⥪ã饬ã à §¬¥àã ­ ¯¥ç â ­­ëå ᨬ¢®«®¢ â.¥. ªãàá®à á⮨⠢ ª®­æ¥
897
        cmp     ecx,ebx         ;…᫨ ã ­ á ¯®§¨æ¨ï ªãàá®à  = ⥪ã饬ã à §¬¥àã ­ ¯¥ç â ­­ëå ᨬ¢®«®¢ â.¥. ªãàá®à á⮨⠢ ª®­æ¥
880
        je      edit_box_key.In_k
898
        je      edit_box_key.In_k
881
 
899
 
882
        test    dword bp_flags,ed_insert ;IF insert is enabled  â.ª. edi ¨§¬¥­¥­,  ¤à¥á㥬 ç¥à¥§ ebp
900
        test    dword bp_flags,ed_insert ;IF insert is enabled  â.ª. edi ¨§¬¥­¥­,  ¤à¥á㥬 ç¥à¥§ ebp
883
        jne     edit_box_key.ins_v
901
        jne     edit_box_key.ins_v
884
;clear
902
;clear
885
pusha
903
pusha
886
        mov     edi,ebp
904
        mov     edi,ebp
887
        mov     ebp,ed_size
905
        mov     ebp,ed_size
888
        call    edit_box_key.clear_bg
906
        call    edit_box_key.clear_bg
889
popa
907
popa
890
        sub     ecx,ebx         ; ©¤¥¬ ª®«-¢® ᨬ¢®«®¢ ¤«ï ¯¥à¥¤¢¨¦¥­¨ï.
908
        sub     ecx,ebx         ; ©¤¥¬ ª®«-¢® ᨬ¢®«®¢ ¤«ï ¯¥à¥¤¢¨¦¥­¨ï.
891
        inc     edi             ;‘¬¥á⨬ ­ è¨ ᨬ¢®«ë ¢¯à ¢®
909
        inc     edi             ;‘¬¥á⨬ ­ è¨ ᨬ¢®«ë ¢¯à ¢®
892
        std
910
        std
893
        inc     ecx
911
        inc     ecx
894
   @@:
912
   @@:
895
        ;--------
913
        ;--------
896
        lodsb
914
        lodsb
897
        stosb
915
        stosb
898
        ;--------
916
        ;--------
899
        loop    @b
917
        loop    @b
900
edit_box_key.In_k:
918
edit_box_key.In_k:
901
	cld
919
	cld
902
        pop eax
920
        pop eax
903
        mov al,ah
921
        mov al,ah
904
        stosb
922
        stosb
905
        pop edi
923
        pop edi
906
; ¢áâ ¢«ï¥¬ ª®¤ ª« ¢¨è¨ â㤠, £¤¥ ªãàá®à
924
; ¢áâ ¢«ï¥¬ ª®¤ ª« ¢¨è¨ â㤠, £¤¥ ªãàá®à
907
        ; 㢥«¨ç¨¢ ¥¬ §­ ç¥­¨¥ à §¬¥à  ¨ ¯®§¨æ¨¨
925
        ; 㢥«¨ç¨¢ ¥¬ §­ ç¥­¨¥ à §¬¥à  ¨ ¯®§¨æ¨¨
908
        inc      dword ed_size
926
        inc      dword ed_size
909
        inc      dword ed_pos
927
        inc      dword ed_pos
910
        call    edit_box_key.draw_all2
928
        call    edit_box_key.draw_all2
911
        jmp     edit_box_key.shift
929
        jmp     edit_box_key.shift
912
}
930
}
913
macro use_work_key
931
macro use_work_key
914
{
932
{
915
edit_box_key.insert: test   word ed_flags,ed_insert ;not    word ed_insert
933
edit_box_key.insert: test   word ed_flags,ed_insert ;not    word ed_insert
916
         je     @f
934
         je     @f
917
         and    word ed_flags,ed_insert_cl
935
         and    word ed_flags,ed_insert_cl
918
 
936
 
919
        jmp     edit_box.editbox_exit
937
        jmp     edit_box.editbox_exit
920
@@:
938
@@:
921
        or      word ed_flags,ed_insert
939
        or      word ed_flags,ed_insert
922
        jmp     edit_box.editbox_exit
940
        jmp     edit_box.editbox_exit
923
edit_box_key.ins_v:
941
edit_box_key.ins_v:
924
;        dec     dword [ebp+48];ed_size    ;processing is insert
942
;        dec     dword [ebp+48];ed_size    ;processing is insert
925
	dec	dword bp_size
943
	dec	dword bp_size
926
        sub     esi,ecx
944
        sub     esi,ecx
927
        add     esi,ebx
945
        add     esi,ebx
928
        mov     edi,esi
946
        mov     edi,esi
929
;clear
947
;clear
930
pusha
948
pusha
931
        mov     edi,ebp
949
        mov     edi,ebp
932
        mov     ebp,ed_pos
950
        mov     ebp,ed_pos
933
        call    edit_box_key.clear_bg
951
        call    edit_box_key.clear_bg
934
popa
952
popa
935
        jmp     edit_box_key.In_k
953
        jmp     edit_box_key.In_k
936
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
954
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
937
edit_box_key.delete:
955
edit_box_key.delete:
938
        mov     edx,ed_size
956
        mov     edx,ed_size
939
        mov     ecx,ed_pos
957
        mov     ecx,ed_pos
940
        cmp     edx,ecx
958
        cmp     edx,ecx
941
        jg      edit_box_key.bac_del
959
        jg      edit_box_key.bac_del
942
        test    word ed_flags,ed_shift_on
960
        test    word ed_flags,ed_shift_on
943
        jne     edit_box_key.del_bac
961
        jne     edit_box_key.del_bac
944
        popad
962
        popad
945
        ret     4
963
        ret     4
946
edit_box_key.bac_del:
964
edit_box_key.bac_del:
947
        call    edit_box_key.del_char
965
        call    edit_box_key.del_char
948
        jmp     edit_box_key.draw_all
966
        jmp     edit_box_key.draw_all
949
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
967
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
950
;--- ­ ¦ â  ª« ¢¨è  backspace ---
968
;--- ­ ¦ â  ª« ¢¨è  backspace ---
951
edit_box_key.backspace:
969
edit_box_key.backspace:
952
        test    word ed_flags,ed_shift_on
970
        test    word ed_flags,ed_shift_on
953
        jne     edit_box_key.delete
971
        jne     edit_box_key.delete
954
        ; ¯à®¢¥à塞, ªãàá®à ã «¥¢®£® ªà ï?
972
        ; ¯à®¢¥à塞, ªãàá®à ã «¥¢®£® ªà ï?
955
        mov     ecx,ed_pos
973
        mov     ecx,ed_pos
956
        test    ecx,ecx
974
        test    ecx,ecx
957
        jnz     edit_box_key.del_bac
975
        jnz     edit_box_key.del_bac
958
        popad
976
        popad
959
        ret     4
977
        ret     4
960
 
978
 
961
edit_box_key.del_bac:
979
edit_box_key.del_bac:
962
        mov     edx,ed_size
980
        mov     edx,ed_size
963
        cmp     edx,ecx ;if ed_pos=ed_size
981
        cmp     edx,ecx ;if ed_pos=ed_size
964
        je      @f
982
        je      @f
965
        dec     ecx
983
        dec     ecx
966
        call    edit_box_key.del_char
984
        call    edit_box_key.del_char
967
@@:     test    word ed_flags,ed_shift_on
985
@@:     test    word ed_flags,ed_shift_on
968
        jne     edit_box_key.bac_del
986
        jne     edit_box_key.bac_del
969
        dec      dword ed_pos
987
        dec      dword ed_pos
970
edit_box_key.draw_all:
988
edit_box_key.draw_all:
971
        push    edit_box_key.shift;.draw_cursor_text;eax
989
        push    edit_box_key.shift;.draw_cursor_text;eax
972
 
990
 
973
        test    word ed_flags,ed_shift_on
991
        test    word ed_flags,ed_shift_on
974
        je      @f
992
        je      @f
975
        mov     eax,dword ed_shift_pos
993
        mov     eax,dword ed_shift_pos
976
        mov     ebx,ed_size
994
        mov     ebx,ed_size
977
        sub     ebx,eax
995
        sub     ebx,eax
978
        mov     ed_size,ebx
996
        mov     ed_size,ebx
979
 
997
 
980
        mov     ebp,ed_color
998
        mov     ebp,ed_color
981
        call    edit_box.clear_cursor
999
        call    edit_box.clear_cursor
982
        call    edit_box.check_offset
1000
        call    edit_box.check_offset
983
        call    edit_box.draw_bg
1001
        call    edit_box.draw_bg
984
        ret
1002
        ret
985
@@:     dec      dword ed_size
1003
@@:     dec      dword ed_size
986
 
1004
 
987
edit_box_key.draw_all2:
1005
edit_box_key.draw_all2:
988
        and    word ed_flags,ed_shift_cl
1006
        and    word ed_flags,ed_shift_cl
989
        mov     ebp,ed_color
1007
        mov     ebp,ed_color
990
        call    edit_box.clear_cursor
1008
        call    edit_box.clear_cursor
991
        call    edit_box.check_offset
1009
        call    edit_box.check_offset
992
        mov     ebp,ed_size
1010
        mov     ebp,ed_size
993
        call    edit_box_key.clear_bg
1011
        call    edit_box_key.clear_bg
994
        ret
1012
        ret
995
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1013
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
996
;--- ­ ¦ â  ª« ¢¨è  left ---
1014
;--- ­ ¦ â  ª« ¢¨è  left ---
997
edit_box_key.left:
1015
edit_box_key.left:
998
	mov     ebx,ed_pos
1016
	mov     ebx,ed_pos
999
        test    ebx,ebx
1017
        test    ebx,ebx
1000
        jz      edit_box_key.sh_st_of
1018
        jz      edit_box_key.sh_st_of
1001
        or      word ed_flags,ed_left_fl
1019
        or      word ed_flags,ed_left_fl
1002
        call    edit_box_key.sh_first_sh
1020
        call    edit_box_key.sh_first_sh
1003
        dec      dword ed_pos
1021
        dec      dword ed_pos
1004
        call    edit_box_key.sh_enable
1022
        call    edit_box_key.sh_enable
1005
        jmp     edit_box.draw_cursor_text
1023
        jmp     edit_box.draw_cursor_text
1006
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1024
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1007
;--- ­ ¦ â  ª« ¢¨è  right ---
1025
;--- ­ ¦ â  ª« ¢¨è  right ---
1008
edit_box_key.right:
1026
edit_box_key.right:
1009
	mov     ebx,ed_pos
1027
	mov     ebx,ed_pos
1010
        cmp     ebx,ed_size
1028
        cmp     ebx,ed_size
1011
        je      edit_box_key.sh_st_of
1029
        je      edit_box_key.sh_st_of
1012
        and     word ed_flags,ed_right_fl
1030
        and     word ed_flags,ed_right_fl
1013
        call    edit_box_key.sh_first_sh
1031
        call    edit_box_key.sh_first_sh
1014
        inc     dword  ed_pos
1032
        inc     dword  ed_pos
1015
        call    edit_box_key.sh_enable
1033
        call    edit_box_key.sh_enable
1016
        jmp     edit_box.draw_cursor_text
1034
        jmp     edit_box.draw_cursor_text
1017
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1035
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1018
edit_box_key.home:
1036
edit_box_key.home:
1019
        mov     ebx,ed_pos
1037
        mov     ebx,ed_pos
1020
        test    ebx,ebx
1038
        test    ebx,ebx
1021
        jz      edit_box_key.sh_st_of
1039
        jz      edit_box_key.sh_st_of
1022
        call    edit_box_key.sh_first_sh
1040
        call    edit_box_key.sh_first_sh
1023
        xor     eax,eax
1041
        xor     eax,eax
1024
        mov     ed_pos,eax
1042
        mov     ed_pos,eax
1025
        call    edit_box_key.sh_home_end
1043
        call    edit_box_key.sh_home_end
1026
        jmp     edit_box.draw_cursor_text
1044
        jmp     edit_box.draw_cursor_text
1027
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1045
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1028
edit_box_key.end:
1046
edit_box_key.end:
1029
        mov     ebx,ed_pos
1047
        mov     ebx,ed_pos
1030
        cmp     ebx,dword ed_size
1048
        cmp     ebx,dword ed_size
1031
        je      edit_box_key.sh_st_of
1049
        je      edit_box_key.sh_st_of
1032
        call    edit_box_key.sh_first_sh
1050
        call    edit_box_key.sh_first_sh
1033
        mov     eax,ed_size
1051
        mov     eax,ed_size
1034
        mov     ed_pos,eax
1052
        mov     ed_pos,eax
1035
        call    edit_box_key.sh_home_end
1053
        call    edit_box_key.sh_home_end
1036
        jmp     edit_box.draw_cursor_text
1054
        jmp     edit_box.draw_cursor_text
1037
}
1055
}
1038
 
1056
 
1039
macro use_mouse_func
1057
macro use_mouse_func
1040
{
1058
{
1041
;----------------------------------------------------------
1059
;----------------------------------------------------------
1042
;--- Ž¡à ¡®âª  .mouse_wigwag
1060
;--- Ž¡à ¡®âª  .mouse_wigwag
1043
;----------------------------------------------------------
1061
;----------------------------------------------------------
1044
edit_box_mouse.mouse_wigwag:
1062
edit_box_mouse.mouse_wigwag:
1045
        shr     eax,16
1063
        shr     eax,16
1046
        or      word ed_flags,ed_shift_bac+ed_shift_on+ed_shift
1064
        or      word ed_flags,ed_shift_bac+ed_shift_on+ed_shift
1047
;;;;;;;;;;;;;;;;;;
1065
;;;;;;;;;;;;;;;;;;
1048
;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ª®£¤  ¯à®¨á室¨â ¢ë室 §  ¯à¥¤¥«ë editbox
1066
;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ª®£¤  ¯à®¨á室¨â ¢ë室 §  ¯à¥¤¥«ë editbox
1049
;;;;;;;;;;;;;;;;;;
1067
;;;;;;;;;;;;;;;;;;
1050
        test    ax,0x8000
1068
        test    ax,0x8000
1051
        jnz     edit_box_mouse.mleft
1069
        jnz     edit_box_mouse.mleft
1052
 
1070
 
1053
        mov     ebx,ed_left
1071
        mov     ebx,ed_left
1054
        cmp     eax,ebx
1072
        cmp     eax,ebx
1055
        jb      edit_box_mouse.mleft
1073
        jb      edit_box_mouse.mleft
1056
 
1074
 
1057
        add     ebx,ed_width
1075
        add     ebx,ed_width
1058
        cmp     eax,ebx
1076
        cmp     eax,ebx
1059
        ja      edit_box_mouse.mright
1077
        ja      edit_box_mouse.mright
1060
 
1078
 
1061
        sub     ebx,ed_width
1079
        sub     ebx,ed_width
1062
 
1080
 
1063
        xor     edx,edx
1081
        xor     edx,edx
1064
        sub     eax,ebx ; ¢ëç⥬ ¨§ ª®®à¤¨­ â ¬ë誨 ¯® ®á¨ å ª®®à¤¨­ âë ¤® editbox ¯® ®á¨ å
1082
        sub     eax,ebx ; ¢ëç⥬ ¨§ ª®®à¤¨­ â ¬ë誨 ¯® ®á¨ å ª®®à¤¨­ âë ¤® editbox ¯® ®á¨ å
1065
        mov     ebx,6
1083
        mov     ebx,6
1066
        div     ebx
1084
        div     ebx
1067
;;;;;;;;;;;;;;;;;;
1085
;;;;;;;;;;;;;;;;;;
1068
;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ¢ ¯à¥¤¥« å ®¡« á⨠editbox
1086
;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ¢ ¯à¥¤¥« å ®¡« á⨠editbox
1069
;;;;;;;;;;;;;;;;;;
1087
;;;;;;;;;;;;;;;;;;
1070
;®«ã稫¨ ª®®à¤¨­ âë ¢ eax ¬ë誨, â.¥. ªã¤  ®­  ¯¥à¥¬¥á⨫ áì
1088
;®«ã稫¨ ª®®à¤¨­ âë ¢ eax ¬ë誨, â.¥. ªã¤  ®­  ¯¥à¥¬¥á⨫ áì
1071
;¨á®¢ ­¨¥ § ªà è¥­­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ¨å ®ç¨á⪠
1089
;¨á®¢ ­¨¥ § ªà è¥­­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ¨å ®ç¨á⪠
1072
        add     eax,ed_offset   ;¤®¡ ¢¨¬ ᬥ饭¨¥
1090
        add     eax,ed_offset   ;¤®¡ ¢¨¬ ᬥ饭¨¥
1073
        cmp     eax,dword ed_size       ;¥á«¨ ¢ë諨 §  ¯à¥¤¥«ë, â® ­¨ç¥£® ­¥ ¤¥« âì
1091
        cmp     eax,dword ed_size       ;¥á«¨ ¢ë諨 §  ¯à¥¤¥«ë, â® ­¨ç¥£® ­¥ ¤¥« âì
1074
        ja      edit_box_mouse.mwigvag
1092
        ja      edit_box_mouse.mwigvag
1075
edit_box_mouse.mdraw:
1093
edit_box_mouse.mdraw:
1076
        mov     dword   ed_pos,eax ;á®åà ­¨¬ ­®¢®¥ §­ ç¥­¨¥
1094
        mov     dword   ed_pos,eax ;á®åà ­¨¬ ­®¢®¥ §­ ç¥­¨¥
1077
;¨á®¢ ­¨¥ § ªà è¥­­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ¨å ®ç¨á⪠
1095
;¨á®¢ ­¨¥ § ªà è¥­­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ¨å ®ç¨á⪠
1078
        mov     ecx,dword       ed_shift_pos
1096
        mov     ecx,dword       ed_shift_pos
1079
        mov     ebx,dword       ed_shift_pos_old
1097
        mov     ebx,dword       ed_shift_pos_old
1080
        mov     dword   ed_shift_pos_old,eax    ;¢­¥á¥¬ ­®¢®¥ §­ ç¥­¨¥ áâ à®© ¯®§¨æ¨¨ ªãàá®à 
1098
        mov     dword   ed_shift_pos_old,eax    ;¢­¥á¥¬ ­®¢®¥ §­ ç¥­¨¥ áâ à®© ¯®§¨æ¨¨ ªãàá®à 
1081
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­­ëå ®¡« á⥩
1099
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­­ëå ®¡« á⥩
1082
        cmp     ecx,ebx         ;¢ëïá­ï¥¬ ªã¤  ¡ë«® ¤¢¨¦¥­¨¥ ­  ®¤¨­ è £ ­ § ¤
1100
        cmp     ecx,ebx         ;¢ëïá­ï¥¬ ªã¤  ¡ë«® ¤¢¨¦¥­¨¥ ­  ®¤¨­ è £ ­ § ¤
1083
        je      edit_box_mouse.m1_shem        ;¤¢¨¦¥­¨ï ­¥ ¡ë«® à ­¥¥
1101
        je      edit_box_mouse.m1_shem        ;¤¢¨¦¥­¨ï ­¥ ¡ë«® à ­¥¥
1084
        jb      edit_box_mouse.msmaller       ;¤¢¨¦¥­¨¥ ¡ë«® ->
1102
        jb      edit_box_mouse.msmaller       ;¤¢¨¦¥­¨¥ ¡ë«® ->
1085
        cmp     ebx,eax         ;¤¢¨¦¥­¨¥ ¡ë«® ¤® í⮣® <- ¨ âãâ ¬ë ¯à®¢¥à塞 ᥩç á ªã¤  ¤¢¨¦¥­¨¥ ¯à®¨á室¨â
1103
        cmp     ebx,eax         ;¤¢¨¦¥­¨¥ ¡ë«® ¤® í⮣® <- ¨ âãâ ¬ë ¯à®¢¥à塞 ᥩç á ªã¤  ¤¢¨¦¥­¨¥ ¯à®¨á室¨â
1086
        ja      edit_box_mouse.m1_shem        ;¥á«¨ ¡ë«® ¤¢¨¦¥­¨¥ <- â® ­ã¦­® § ªà á¨âì ®¡« áâì
1104
        ja      edit_box_mouse.m1_shem        ;¥á«¨ ¡ë«® ¤¢¨¦¥­¨¥ <- â® ­ã¦­® § ªà á¨âì ®¡« áâì
1087
        je      edit_box_mouse.mwigvag        ;¥á«¨ ¨§¬¥­¥­¨ï ­¥ ¡ë«®, â® ­¨ç¥£® ­¥ ¤¥« âì
1105
        je      edit_box_mouse.mwigvag        ;¥á«¨ ¨§¬¥­¥­¨ï ­¥ ¡ë«®, â® ­¨ç¥£® ­¥ ¤¥« âì
1088
        mov     ebp,ed_color    ;âã⠭㦭® ®ç¨áâ¨âì ®¡« áâì c ed_pos ed_shift_pos_old
1106
        mov     ebp,ed_color    ;âã⠭㦭® ®ç¨áâ¨âì ®¡« áâì c ed_pos ed_shift_pos_old
1089
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
1107
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
1090
        call    edit_box_key.sh_cl_
1108
        call    edit_box_key.sh_cl_
1091
        jmp     edit_box_mouse.mwigvag
1109
        jmp     edit_box_mouse.mwigvag
1092
edit_box_mouse.msmaller:
1110
edit_box_mouse.msmaller:
1093
        cmp     ebx,eax
1111
        cmp     ebx,eax
1094
        jb      edit_box_mouse.m1_shem
1112
        jb      edit_box_mouse.m1_shem
1095
        mov     ebp,ed_color
1113
        mov     ebp,ed_color
1096
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
1114
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
1097
        call    edit_box_key.sh_cl_
1115
        call    edit_box_key.sh_cl_
1098
        jmp     edit_box_mouse.mwigvag
1116
        jmp     edit_box_mouse.mwigvag
1099
;alike  =
1117
;alike  =
1100
edit_box_mouse.m1_shem:
1118
edit_box_mouse.m1_shem:
1101
        mov     ebp,shift_color
1119
        mov     ebp,shift_color
1102
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
1120
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
1103
        mov     ebx,ecx
1121
        mov     ebx,ecx
1104
        call    edit_box_key.sh_cl_
1122
        call    edit_box_key.sh_cl_
1105
        jmp     edit_box_mouse.mwigvag
1123
        jmp     edit_box_mouse.mwigvag
1106
edit_box_mouse.mwigvag:
1124
edit_box_mouse.mwigvag:
1107
        and     word ed_flags,ed_shift_mcl
1125
        and     word ed_flags,ed_shift_mcl
1108
        jmp     edit_box.draw_cursor_text
1126
        jmp     edit_box.draw_cursor_text
1109
;       popa
1127
;       popa
1110
;       ret
1128
;       ret
1111
edit_box_mouse.mleft:
1129
edit_box_mouse.mleft:
1112
        mov     eax,ed_pos
1130
        mov     eax,ed_pos
1113
        cmp     eax,0
1131
        cmp     eax,0
1114
        jbe      edit_box_mouse.mwigvag
1132
        jbe      edit_box_mouse.mwigvag
1115
        dec     eax
1133
        dec     eax
1116
        call    edit_box.check_offset
1134
        call    edit_box.check_offset
1117
        push    eax
1135
        push    eax
1118
        mov     ebx,ed_shift_pos
1136
        mov     ebx,ed_shift_pos
1119
        mov     ebp,shift_color
1137
        mov     ebp,shift_color
1120
        call    edit_box_key.sh_cl_
1138
        call    edit_box_key.sh_cl_
1121
        pop     eax
1139
        pop     eax
1122
        jmp     edit_box_mouse.mdraw
1140
        jmp     edit_box_mouse.mdraw
1123
edit_box_mouse.mright:
1141
edit_box_mouse.mright:
1124
        mov     eax,ed_pos
1142
        mov     eax,ed_pos
1125
        mov     ebx,ed_size
1143
        mov     ebx,ed_size
1126
        cmp     eax,ebx
1144
        cmp     eax,ebx
1127
        jae     edit_box_mouse.mwigvag
1145
        jae     edit_box_mouse.mwigvag
1128
        inc     eax
1146
        inc     eax
1129
        call    edit_box.check_offset
1147
        call    edit_box.check_offset
1130
        mov     ebx,ed_shift_pos
1148
        mov     ebx,ed_shift_pos
1131
        mov     ebp,shift_color
1149
        mov     ebp,shift_color
1132
        push    eax
1150
        push    eax
1133
        call    edit_box_key.sh_cl_
1151
        call    edit_box_key.sh_cl_
1134
        pop     eax
1152
        pop     eax
1135
        jmp     edit_box_mouse.mdraw
1153
        jmp     edit_box_mouse.mdraw
1136
}
1154
}
1137
 
1155
 
1138
macro use_work_mouse
1156
macro use_work_mouse
1139
;----------------------------------------------------------
1157
;----------------------------------------------------------
1140
;--- € ­¥ 㤥ন¢ ¥¬ «¨ ¬ë ª« ¢¨èã ¬ë誨, ¯¥à¥¬¥é ï ªãàá®à, ¢® ¢á¥ à §­ë¥ áâ®à®­ë?
1158
;--- € ­¥ 㤥ন¢ ¥¬ «¨ ¬ë ª« ¢¨èã ¬ë誨, ¯¥à¥¬¥é ï ªãàá®à, ¢® ¢á¥ à §­ë¥ áâ®à®­ë?
1141
;----------------------------------------------------------
1159
;----------------------------------------------------------
1142
{
1160
{
1143
        test    word ed_flags,ed_mouse_on
1161
        test    word ed_flags,ed_mouse_on
1144
        jne     edit_box_mouse.mouse_wigwag
1162
        jne     edit_box_mouse.mouse_wigwag
1145
;----------------------------------------------------------
1163
;----------------------------------------------------------
1146
;--- ¯à®¢¥à塞, ¯®¯ ¤ ¥â «¨ ªãàá®à ¢ edit box -------------
1164
;--- ¯à®¢¥à塞, ¯®¯ ¤ ¥â «¨ ªãàá®à ¢ edit box -------------
1147
;----------------------------------------------------------
1165
;----------------------------------------------------------
1148
        mov     ebx,ed_top
1166
        mov     ebx,ed_top
1149
        cmp     ax,bx
1167
        cmp     ax,bx
1150
        jl      edit_box_mouse._blur;.mouse_end_no_focus
1168
        jl      edit_box_mouse._blur;.mouse_end_no_focus
1151
 
1169
 
1152
        add     ebx,ed_height
1170
        add     ebx,ed_height
1153
        cmp     ax,bx
1171
        cmp     ax,bx
1154
        jg      edit_box_mouse._blur;.mouse_end_no_focus
1172
        jg      edit_box_mouse._blur;.mouse_end_no_focus
1155
 
1173
 
1156
        shr     eax,16
1174
        shr     eax,16
1157
 
1175
 
1158
        mov     ebx,ed_left
1176
        mov     ebx,ed_left
1159
        cmp     ax,bx
1177
        cmp     ax,bx
1160
        jl      edit_box_mouse._blur;.mouse_end_no_focus
1178
        jl      edit_box_mouse._blur;.mouse_end_no_focus
1161
 
1179
 
1162
        add     ebx,ed_width
1180
        add     ebx,ed_width
1163
 
1181
 
1164
        cmp     ax,bx
1182
        cmp     ax,bx
1165
        jg      edit_box_mouse._blur;.mouse_end_no_focus
1183
        jg      edit_box_mouse._blur;.mouse_end_no_focus
1166
 
1184
 
1167
;--- ¨§¬¥­ï¥¬ ¯®§¨æ¨î ªãàá®à  ---
1185
;--- ¨§¬¥­ï¥¬ ¯®§¨æ¨î ªãàá®à  ---
1168
        push    eax
1186
        push    eax
1169
        mov     ebp,ed_color
1187
        mov     ebp,ed_color
1170
        call    edit_box.clear_cursor
1188
        call    edit_box.clear_cursor
1171
        pop     eax
1189
        pop     eax
1172
edit_box_mouse._mvpos:
1190
edit_box_mouse._mvpos:
1173
        xor     edx,edx
1191
        xor     edx,edx
1174
        sub     eax,ed_left
1192
        sub     eax,ed_left
1175
 
1193
 
1176
        mov     ebx,6
1194
        mov     ebx,6
1177
        div     bx
1195
        div     bx
1178
        add     eax,ed_offset
1196
        add     eax,ed_offset
1179
        cmp     eax,ed_size
1197
        cmp     eax,ed_size
1180
        jna     edit_box_mouse._mshift
1198
        jna     edit_box_mouse._mshift
1181
        mov     eax,ed_size
1199
        mov     eax,ed_size
1182
 
1200
 
1183
edit_box_mouse._mshift:
1201
edit_box_mouse._mshift:
1184
;;;;;;;
1202
;;;;;;;
1185
;;‘¥ªæ¨ï ®¡à ¡®âª¨ shift ¨ ¢ë¤¥«¥­¨ï ¯® shift
1203
;;‘¥ªæ¨ï ®¡à ¡®âª¨ shift ¨ ¢ë¤¥«¥­¨ï ¯® shift
1186
;;;;;;;
1204
;;;;;;;
1187
        test    word ed_flags,ed_shift_bac
1205
        test    word ed_flags,ed_shift_bac
1188
        je      @f
1206
        je      @f
1189
        mov     ebp,dword       ed_color
1207
        mov     ebp,dword       ed_color
1190
        mov     ebx,dword ed_shift_pos
1208
        mov     ebx,dword ed_shift_pos
1191
        push    eax
1209
        push    eax
1192
        call    edit_box_key.sh_cl_
1210
        call    edit_box_key.sh_cl_
1193
        and     word ed_flags,ed_shift_bac_cl
1211
        and     word ed_flags,ed_shift_bac_cl
1194
        pop     eax
1212
        pop     eax
1195
@@:
1213
@@:
1196
        test    word ed_flags,ed_mouse_on
1214
        test    word ed_flags,ed_mouse_on
1197
        jne     @f
1215
        jne     @f
1198
 
1216
 
1199
        mov     dword ed_shift_pos,eax
1217
        mov     dword ed_shift_pos,eax
1200
        or      word  ed_flags,ed_mouse_on
1218
        or      word  ed_flags,ed_mouse_on
1201
        mov     dword ed_pos,eax
1219
        mov     dword ed_pos,eax
1202
 
1220
 
1203
;        mov     dword [mouse_flag],edi          ;ãáâ ­®¢¨¬ ¨¤¥­â¨ä¨ª â®à
1221
;        mov     dword [mouse_flag],edi          ;ãáâ ­®¢¨¬ ¨¤¥­â¨ä¨ª â®à
1204
 
1222
 
1205
       	mov	ebx,dword ed_mouse_variable
1223
       	mov	ebx,dword ed_mouse_variable
1206
	push	edi
1224
	push	edi
1207
	pop	dword [ebx]
1225
	pop	dword [ebx]
1208
 
1226
 
1209
 
1227
 
1210
 
1228
 
1211
 
1229
 
1212
        bts     word ed_flags,1                 ;ãáâ ­®¢ª  䮪ãá 
1230
        bts     word ed_flags,1                 ;ãáâ ­®¢ª  䮪ãá 
1213
        jmp     edit_box_mouse.m_sh
1231
        jmp     edit_box_mouse.m_sh
1214
@@:
1232
@@:
1215
        cmp     eax,dword ed_shift_pos  ;¥á«¨ ¯®§¨æ¨¨ ­¥ ¨§¬¥­¨«¨áì
1233
        cmp     eax,dword ed_shift_pos  ;¥á«¨ ¯®§¨æ¨¨ ­¥ ¨§¬¥­¨«¨áì
1216
        je      edit_box.editbox_exit
1234
        je      edit_box.editbox_exit
1217
        mov     ed_pos,eax
1235
        mov     ed_pos,eax
1218
        mov     ebp,dword shift_color
1236
        mov     ebp,dword shift_color
1219
        mov     ebx,dword ed_shift_pos
1237
        mov     ebx,dword ed_shift_pos
1220
        call    edit_box_key.sh_cl_
1238
        call    edit_box_key.sh_cl_
1221
        or      word ed_flags,ed_mous_adn_b     ;ãáâ ­®¢¨¬ ¡¨â, çâ® ¬ë ¢ë¤¥«¨«¨ +shift_on +
1239
        or      word ed_flags,ed_mous_adn_b     ;ãáâ ­®¢¨¬ ¡¨â, çâ® ¬ë ¢ë¤¥«¨«¨ +shift_on +
1222
edit_box_mouse.m_sh:
1240
edit_box_mouse.m_sh:
1223
	call    edit_box.draw_text
1241
	call    edit_box.draw_text
1224
        call    edit_box.draw_cursor
1242
        call    edit_box.draw_cursor
1225
;----------------------------------------------------------
1243
;----------------------------------------------------------
1226
;--- ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá  ---------------------------
1244
;--- ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá  ---------------------------
1227
;----------------------------------------------------------
1245
;----------------------------------------------------------
1228
        jmp     edit_box_mouse.drc
1246
        jmp     edit_box_mouse.drc
1229
edit_box_mouse._blur:
1247
edit_box_mouse._blur:
1230
        test    word ed_flags,ed_always_focus
1248
        test    word ed_flags,ed_always_focus
1231
        jne     edit_box.editbox_exit
1249
        jne     edit_box.editbox_exit
1232
        btr     word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
1250
        btr     word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
1233
        jnc     edit_box.editbox_exit
1251
        jnc     edit_box.editbox_exit
1234
 
1252
 
1235
        mov     ebp,ed_color
1253
        mov     ebp,ed_color
1236
        call    edit_box.clear_cursor
1254
        call    edit_box.clear_cursor
1237
edit_box_mouse.drc:   call    edit_box.draw_border
1255
edit_box_mouse.drc:   call    edit_box.draw_border
1238
        jmp     edit_box.editbox_exit
1256
        jmp     edit_box.editbox_exit
1239
}
1257
}
1240
 
1258
 
1241
 
1259
 
1242
; Œ ªà®á ¢ë室 
1260
; Œ ªà®á ¢ë室 
1243
macro edit_ex
1261
macro edit_ex
1244
{
1262
{
1245
popad
1263
popad
1246
ret
1264
ret
1247
}
1265
}
1248
macro debug
1266
macro debug
1249
{
1267
{
1250
        ;-----------  ®â« ¤ª 
1268
        ;-----------  ®â« ¤ª 
1251
        pushad
1269
        pushad
1252
;        mov     dword [ed_buffer.2],0
1270
;        mov     dword [ed_buffer.2],0
1253
;        mov     eax,edi
1271
;        mov     eax,edi
1254
        mov eax,dword [ed_buffer.2]
1272
        mov eax,dword [ed_buffer.2]
1255
        mov edi,ed_buffer.3
1273
        mov edi,ed_buffer.3
1256
        call .str
1274
        call .str
1257
        ;à¨á®¢ ­¨¥ ä®­ 
1275
        ;à¨á®¢ ­¨¥ ä®­ 
1258
        mov eax,13
1276
        mov eax,13
1259
        mov ebx,178*65536+70
1277
        mov ebx,178*65536+70
1260
        mov ecx,28*65536+10
1278
        mov ecx,28*65536+10
1261
        xor edx,edx
1279
        xor edx,edx
1262
        int 0x40
1280
        int 0x40
1263
        ;¢ë¢®¤ §­ ç¥­¨ï ­  íªà ­
1281
        ;¢ë¢®¤ §­ ç¥­¨ï ­  íªà ­
1264
        mov eax,4
1282
        mov eax,4
1265
        mov ebx,180*65536+30
1283
        mov ebx,180*65536+30
1266
        mov ecx,0x10DDBBCC
1284
        mov ecx,0x10DDBBCC
1267
        mov edx,ed_buffer.3
1285
        mov edx,ed_buffer.3
1268
        mov esi,8
1286
        mov esi,8
1269
        int 0x40
1287
        int 0x40
1270
        popad
1288
        popad
1271
        ;----------- ®â« ¤ª 
1289
        ;----------- ®â« ¤ª 
1272
}
1290
}
1273
macro   debug_func
1291
macro   debug_func
1274
{
1292
{
1275
.str:
1293
.str:
1276
        mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï, ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx, ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
1294
        mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï, ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx, ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
1277
         ;¯¥à¥¢®¤ ç¨á«  ¢ ASCII áâபã, ¢å®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­¨ï, edi  ¤à¥á ªã¤  ¡ã¤¥¬ § ¯¨á뢠âì áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®©
1295
         ;¯¥à¥¢®¤ ç¨á«  ¢ ASCII áâபã, ¢å®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­¨ï, edi  ¤à¥á ªã¤  ¡ã¤¥¬ § ¯¨á뢠âì áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®©
1278
        cmp eax,ecx  ;áà ¢­¨âì, ¥á«¨ ¢ eax ¬¥­ìè¥, 祬 ¢ ecx, â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
1296
        cmp eax,ecx  ;áà ¢­¨âì, ¥á«¨ ¢ eax ¬¥­ìè¥, 祬 ¢ ecx, â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
1279
        jb @f
1297
        jb @f
1280
        xor edx,edx  ;®ç¨áâ¨âì edx
1298
        xor edx,edx  ;®ç¨áâ¨âì edx
1281
        div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
1299
        div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
1282
        push edx     ;¯®«®¦¨âì ¢ á⥪
1300
        push edx     ;¯®«®¦¨âì ¢ á⥪
1283
        ;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
1301
        ;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
1284
        call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â , ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
1302
        call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â , ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
1285
        pop eax
1303
        pop eax
1286
        @@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al, 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­¨ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
1304
        @@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al, 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­¨ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
1287
        ;sbb al,$69  ;- ç¥áâ­®, ¤ ­­ ï ¨­áâàãªæ¨ï ¬¥­ï § áâ ¢«ï¥â § ¤ã¬ âìáï â.¥. ï ­¥ §­ î ª ª íâ® à ¡®â ¥â
1305
        ;sbb al,$69  ;- ç¥áâ­®, ¤ ­­ ï ¨­áâàãªæ¨ï ¬¥­ï § áâ ¢«ï¥â § ¤ã¬ âìáï â.¥. ï ­¥ §­ î ª ª íâ® à ¡®â ¥â
1288
        ;das        ;¯®á«¥ ¤ ­­®© ª®¬ ­¤ë ª ª ¡ë ¯à®¨á室¨â 㬥­ì襭¨¥ al ­  66h  (¢ ª­¨£¥ ­ ¯¨á ­® ¤à㣮¥)
1306
        ;das        ;¯®á«¥ ¤ ­­®© ª®¬ ­¤ë ª ª ¡ë ¯à®¨á室¨â 㬥­ì襭¨¥ al ­  66h  (¢ ª­¨£¥ ­ ¯¨á ­® ¤à㣮¥)
1289
        or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥, 祬 ¤¢¥ ¢ëè¥
1307
        or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥, 祬 ¤¢¥ ¢ëè¥
1290
        stosb       ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祩ªã ¯ ¬ï⨠es:edi
1308
        stosb       ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祩ªã ¯ ¬ï⨠es:edi
1291
 
1309
 
1292
        ret         ;¢¥à­ãâìáï ®ç¥­ì ¨­â¥à¥á­ë© 室, â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âáï ª®«-¢® ¢ë§®¢®¢, â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
1310
        ret         ;¢¥à­ãâìáï ®ç¥­ì ¨­â¥à¥á­ë© 室, â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âáï ª®«-¢® ¢ë§®¢®¢, â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
1293
}
1311
}
1294
 
1312
 
1295
ed_struc_size=76
1313
ed_struc_size=76