Subversion Repositories Kolibri OS

Rev

Rev 9568 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9568 Rev 9587
1
;--------------------------------------------------------------------
1
;--------------------------------------------------------------------
2
; v.016 30.07.2011
2
; v.016 30.07.2011
3
; Start with open file path
3
; Start with open file path
4
; Show working file path
4
; Show working file path
5
; Some optimization
5
; Some optimization
6
;
6
;
7
; Marat Zakiyanov aka Mario79, aka Mario
7
; Marat Zakiyanov aka Mario79, aka Mario
8
;--------------------------------------------------------------------
8
;--------------------------------------------------------------------
9
; v.015 08.03.2010
9
; v.015 08.03.2010
10
; Support for OpenDialog - Open and Save
10
; Support for OpenDialog - Open and Save
11
; Some optimization
11
; Some optimization
12
;
12
;
13
; Marat Zakiyanov aka Mario79, aka Mario
13
; Marat Zakiyanov aka Mario79, aka Mario
14
;--------------------------------------------------------------------
14
;--------------------------------------------------------------------
15
; v.014 05.02.2010
15
; v.014 05.02.2010
16
; 
16
; 
17
; PageUp, PageDown      - áâà ­¨æ  ¢¢¥àå/¢­¨§
17
; PageUp, PageDown      - áâà ­¨æ  ¢¢¥àå/¢­¨§
18
; Ctrl+UP, Ctrl+Down    - ¯à®ªàã⪠ áâà ­¨æë ­  áâப㠢¢¥àå/¢­¨§ ¡¥§ ᬥ饭¨ï ªãàá®à 
18
; Ctrl+UP, Ctrl+Down    - ¯à®ªàã⪠ áâà ­¨æë ­  áâப㠢¢¥àå/¢­¨§ ¡¥§ ᬥ饭¨ï ªãàá®à 
19
; Home,End              - ¢ ­ ç «®/ª®­¥æ áâப¨
19
; Home,End              - ¢ ­ ç «®/ª®­¥æ áâப¨
20
; Ctrl+Home, Ctrl+End   - ª ¯¥à¢®¬ã/¯®á«¥¤­¥¬ã ¡ ©âã ä ©« 
20
; Ctrl+Home, Ctrl+End   - ª ¯¥à¢®¬ã/¯®á«¥¤­¥¬ã ¡ ©âã ä ©« 
21
; Left, Right           - ªãàá®à ¢«¥¢®/¢¯à ¢®
21
; Left, Right           - ªãàá®à ¢«¥¢®/¢¯à ¢®
22
; Ctrl+O                - ®âªàëâì ä ©«
22
; Ctrl+O                - ®âªàëâì ä ©«
23
; Ctrl+S                - á®åà ­¨âì
23
; Ctrl+S                - á®åà ­¨âì
24
; Ctrl+F                - ¯®¨áª (+Tab ¤«ï OptionBox)
24
; Ctrl+F                - ¯®¨áª (+Tab ¤«ï OptionBox)
25
; Ctrl+G                - ¯¥à¥å®¤ ­  ᬥ饭¨¥ (+Tab ¤«ï OptionBox)
25
; Ctrl+G                - ¯¥à¥å®¤ ­  ᬥ饭¨¥ (+Tab ¤«ï OptionBox)
26
; Ctrl+B                - ¢ë¤¥«¨âì ¡«®ª
26
; Ctrl+B                - ¢ë¤¥«¨âì ¡«®ª
27
; ESC                   - á­ïâì ¢ë¤¥«¥­¨¥
27
; ESC                   - á­ïâì ¢ë¤¥«¥­¨¥
28
; Ctrl+C		- ª®¯¨à®¢ âì ¡«®ª
28
; Ctrl+C		- ª®¯¨à®¢ âì ¡«®ª
29
; Ctrl+V		- ¢áâ ¢¨âì ¢ ¢ë¤¥«¥­­ãî ®¡« áâì
29
; Ctrl+V		- ¢áâ ¢¨âì ¢ ¢ë¤¥«¥­­ãî ®¡« áâì
30
; Ctrl+X		- ¢ë१ âì ¢ë¤¥«¥­­ãî ®¡« áâì (¢ ¡ãä¥à)
30
; Ctrl+X		- ¢ë१ âì ¢ë¤¥«¥­­ãî ®¡« áâì (¢ ¡ãä¥à)
31
; n                     - ¨­¢¥àâ¨à®¢ âì ¡ ©â ¯®¤ ªãàá®à®¬
31
; n                     - ¨­¢¥àâ¨à®¢ âì ¡ ©â ¯®¤ ªãàá®à®¬
32
; Ins                   - ०¨¬ § ¬¥­ë/¢áâ ¢ª¨ (¯® 㬮«ç ­¨î)
32
; Ins                   - ०¨¬ § ¬¥­ë/¢áâ ¢ª¨ (¯® 㬮«ç ­¨î)
33
;   Del                 - ¢ ०¨¬¥ ¢áâ ¢ª¨ - 㤠«¨âì ¡ ©â ¯®¤ ªãàá®à®¬
33
;   Del                 - ¢ ०¨¬¥ ¢áâ ¢ª¨ - 㤠«¨âì ¡ ©â ¯®¤ ªãàá®à®¬
34
;   BackSpace           - ¢ ०¨¬¥ ¢áâ ¢ª¨ - 㤠«¨âì ¡ ©â ¯¥à¥¤ ªãàá®à®¬
34
;   BackSpace           - ¢ ०¨¬¥ ¢áâ ¢ª¨ - 㤠«¨âì ¡ ©â ¯¥à¥¤ ªãàá®à®¬
35
; ~                     - ᬥ­  ª®¤¨à®¢ª¨ (cp866,cp1251)
35
; ~                     - ᬥ­  ª®¤¨à®¢ª¨ (cp866,cp1251)
36
; Shift+~               - ᬥ­  ª®¤¨à®¢ª¨ (cp866 ¨«¨ cp1251,koi8-r)
36
; Shift+~               - ᬥ­  ª®¤¨à®¢ª¨ (cp866 ¨«¨ cp1251,koi8-r)
37
 
37
 
38
;  ¬ïâì ¯¥à¥à á¯à¥¤¥«ï¥âáï ­  㢥«¨ç¥­¨¥ i umen'shenie.
38
;  ¬ïâì ¯¥à¥à á¯à¥¤¥«ï¥âáï ­  㢥«¨ç¥­¨¥ i umen'shenie.
39
; ” ©« § £à㦠¥âáï 楫¨ª®¬.
39
; ” ©« § £à㦠¥âáï 楫¨ª®¬.
40
 
40
 
41
; Œ ªà®áë load_lib.mac ¨ ¡¨¡«¨®â¥ªã box_lib.obj ᮧ¤ «¨:
41
; Œ ªà®áë load_lib.mac ¨ ¡¨¡«¨®â¥ªã box_lib.obj ᮧ¤ «¨:
42
;  - Alexey Teplov / €«¥ªá¥© ’¥¯«®¢
42
;  - Alexey Teplov / €«¥ªá¥© ’¥¯«®¢
43
; Mario79, Mario - Marat Zakiyanov / Œ à â ‡ ª¨ï­®¢
43
; Mario79, Mario - Marat Zakiyanov / Œ à â ‡ ª¨ï­®¢
44
; Diamondz - Evgeny Grechnikov / …¢£¥­¨© ƒà¥ç­¨ª®¢ ¨ ¤à.
44
; Diamondz - Evgeny Grechnikov / …¢£¥­¨© ƒà¥ç­¨ª®¢ ¨ ¤à.
45
;
45
;
46
; staper@inbox.ru
46
; staper@inbox.ru
47
; babalbes@yandex.ru
47
; babalbes@yandex.ru
48
;--------------------------------------------------------------------
48
;--------------------------------------------------------------------
49
use32
49
use32
50
	org	0
50
	org	0
51
	db	'MENUET01'
51
	db	'MENUET01'
52
	dd	1
52
	dd	1
53
	dd	START	;program start
53
	dd	START	;program start
54
	dd	I_END	;program image	size
54
	dd	I_END	;program image	size
55
	dd	(D_END+0x600) and not 3	;required amount of memory
55
	dd	(D_END+0x600) and not 3	;required amount of memory
56
	dd	(D_END+0x600) and not 3	;stack
56
	dd	(D_END+0x600) and not 3	;stack
57
	dd	fname_buf
57
	dd	fname_buf
58
	dd	cur_dir_path
58
	dd	cur_dir_path
59
;--------------------------------------------------------------------
59
;--------------------------------------------------------------------
60
_title	equ 'HeEd 0.16', 0
60
_title	equ 'HeEd 0.16', 0
61
 
61
 
62
include	'lang.inc'
62
include	'lang.inc'
63
include '../../../KOSfuncs.inc'
63
include '../../../KOSfuncs.inc'
64
include '../../../config.inc'		;for nightbuild
64
include '../../../config.inc'		;for nightbuild
65
include '../../../macros.inc'
65
include '../../../macros.inc'
66
include	'../../libraries/box_lib/trunk/box_lib.mac'
66
include	'../../libraries/box_lib/trunk/box_lib.mac'
67
include	'../../../load_lib.mac'
67
include	'../../../load_lib.mac'
68
 
68
 
69
@use_library
69
@use_library
70
;--------------------------------------------------------------------
70
;--------------------------------------------------------------------
71
times	16	dd	0
71
times	16	dd	0
72
 
72
 
73
frgrd_color	equ	0xfefefe
73
frgrd_color	equ	0xfefefe
74
bkgrd_color	equ	0x000000
74
bkgrd_color	equ	0x000000
75
kursred_color	equ	0x0039ff
75
kursred_color	equ	0x0039ff
76
kurstxt_color	equ	0x708090
76
kurstxt_color	equ	0x708090
77
text_color	equ	0xaaaaaa
77
text_color	equ	0xaaaaaa
78
 
78
 
79
panel_clr1	equ	0xe9e9e2
79
panel_clr1	equ	0xe9e9e2
80
panel_clr2	equ	0x8b8b89
80
panel_clr2	equ	0x8b8b89
81
panel_clr3	equ	0x777777;eaeae3
81
panel_clr3	equ	0x777777;eaeae3
82
;--------------------------------------------------------------------
82
;--------------------------------------------------------------------
83
palitra:
83
palitra:
84
.1	dd	frgrd_color,bkgrd_color	;梥⠭¥¢ë¤¥«¥­­®£® ᨬ¢®« 
84
.1	dd	frgrd_color,bkgrd_color	;梥⠭¥¢ë¤¥«¥­­®£® ᨬ¢®« 
85
.2	dd	frgrd_color,text_color	;«¥¢ë©,¯à ¢ë© á⮫¡æë,ç áâì ­¨¦­¥© áâப¨
85
.2	dd	frgrd_color,text_color	;«¥¢ë©,¯à ¢ë© á⮫¡æë,ç áâì ­¨¦­¥© áâப¨
86
.3	dd	kursred_color,frgrd_color	;ªãàá®à 
86
.3	dd	kursred_color,frgrd_color	;ªãàá®à 
87
.4	dd	kurstxt_color,bkgrd_color	;ªãàá®à  ¢ ⥪á⮢®© ®¡« áâ¨
87
.4	dd	kurstxt_color,bkgrd_color	;ªãàá®à  ¢ ⥪á⮢®© ®¡« áâ¨
88
.5	dd	panel_clr1,not	text_color	;­¨¦­ïï ¯ ­¥«ì
88
.5	dd	panel_clr1,not	text_color	;­¨¦­ïï ¯ ­¥«ì
89
;--------------------------------------------------------------------
89
;--------------------------------------------------------------------
90
FIRST_HEX equ 0*65536+24
90
FIRST_HEX equ 0*65536+24
91
scroll_width_size equ 15
91
scroll_width_size equ 15
92
;--------------------------------------------------------------------
92
;--------------------------------------------------------------------
93
struct	f70
93
struct	f70
94
	Function	rd 1
94
	Function	rd 1
95
	Position	rd 1
95
	Position	rd 1
96
	Flags	rd 1
96
	Flags	rd 1
97
	Count	rd 1
97
	Count	rd 1
98
	Buffer	rd 1
98
	Buffer	rd 1
99
	rezerv	rb 1
99
	rezerv	rb 1
100
	FileName	rd 1
100
	FileName	rd 1
101
ends
101
ends
102
;--------------------------------------------------------------------
102
;--------------------------------------------------------------------
103
START:
103
START:
104
	mcall	SF_SYS_MISC,SSF_HEAP_INIT
104
	mcall	SF_SYS_MISC,SSF_HEAP_INIT
105
 
105
 
106
load_libraries l_libs_start,end_l_libs
106
load_libraries l_libs_start,end_l_libs
107
;--------------------------------------------------------------------
107
;--------------------------------------------------------------------
108
;OpenDialog	initialisation
108
;OpenDialog	initialisation
109
	push    dword OpenDialog_data
109
	push    dword OpenDialog_data
110
	call    [OpenDialog_Init]
110
	call    [OpenDialog_Init]
111
;--------------------------------------------------------------------	
111
;--------------------------------------------------------------------	
112
	mov	esi,fname_buf
112
	mov	esi,fname_buf
113
	cmp	[esi],byte 0
113
	cmp	[esi],byte 0
114
	je	.start_temp_file_name
114
	je	.start_temp_file_name
115
	
115
	
116
	cld
116
	cld
117
@@:
117
@@:
118
	lodsb
118
	lodsb
119
	test	al,al
119
	test	al,al
120
	jne	@b
120
	jne	@b
121
	
121
	
122
	std
122
	std
123
@@:
123
@@:
124
	lodsb
124
	lodsb
125
	cmp	al,'/'	
125
	cmp	al,'/'	
126
	jne	@b
126
	jne	@b
127
	add	esi,2
127
	add	esi,2
128
	jmp	.selected_start_file_name
128
	jmp	.selected_start_file_name
129
;--------------------------------------------------------------------	
129
;--------------------------------------------------------------------	
130
.start_temp_file_name:
130
.start_temp_file_name:
131
	mov	esi,start_temp_file_name
131
	mov	esi,start_temp_file_name
132
.selected_start_file_name:
132
.selected_start_file_name:
133
	mov	edi,filename_area
133
	mov	edi,filename_area
134
	xor	eax,eax
134
	xor	eax,eax
135
	cld
135
	cld
136
@@:
136
@@:
137
	lodsb
137
	lodsb
138
	stosb
138
	stosb
139
	test	eax,eax
139
	test	eax,eax
140
	jnz	@b
140
	jnz	@b
141
 
141
 
142
	mcall	SF_SET_EVENTS_MASK,0x27
142
	mcall	SF_SET_EVENTS_MASK,0x27
143
 
143
 
144
	mcall	SF_SYS_MISC,SSF_MEM_ALLOC,32*1024	;áâà ­¨ç­ë© ¡ãä¥à
144
	mcall	SF_SYS_MISC,SSF_MEM_ALLOC,32*1024	;áâà ­¨ç­ë© ¡ãä¥à
145
	mov	[screen_table],eax
145
	mov	[screen_table],eax
146
	mcall	SF_SYS_MISC,SSF_MEM_ALLOC,4*1024
146
	mcall	SF_SYS_MISC,SSF_MEM_ALLOC,4*1024
147
 
147
 
148
	mov	[file_buffer],eax
148
	mov	[file_buffer],eax
149
 
149
 
150
	mcall	SF_SYS_MISC,SSF_MEM_ALLOC,1024
150
	mcall	SF_SYS_MISC,SSF_MEM_ALLOC,1024
151
	mov	[copy_buf],eax
151
	mov	[copy_buf],eax
152
 
152
 
153
 
153
 
154
	;à §¬¥à	⥪ã饣® ¯ãâ¨
154
	;à §¬¥à	⥪ã饣® ¯ãâ¨
155
	mov	esi,cur_dir_path
155
	mov	esi,cur_dir_path
156
@@:
156
@@:
157
	cmp	byte [esi],0
157
	cmp	byte [esi],0
158
	je	@f
158
	je	@f
159
	inc	esi
159
	inc	esi
160
	jmp	@b
160
	jmp	@b
161
;-------------------------------------
161
;-------------------------------------
162
@@:
162
@@:
163
	sub	esi,cur_dir_path
163
	sub	esi,cur_dir_path
164
	mov	[edit1.pos],esi
164
	mov	[edit1.pos],esi
165
	mov	[edit1.size],esi
165
	mov	[edit1.size],esi
166
 
166
 
167
	;®¡é¥á¨á⥬­ë¥ ª« ¢¨è¨ ¤«ï Shift+ªãàá®àë
167
	;®¡é¥á¨á⥬­ë¥ ª« ¢¨è¨ ¤«ï Shift+ªãàá®àë
168
;	mcall	SF_KEYBOARD,SSF_SET_SYS_HOTKEY,75,1
168
;	mcall	SF_KEYBOARD,SSF_SET_SYS_HOTKEY,75,1
169
;	mcall	SF_KEYBOARD,,77
169
;	mcall	SF_KEYBOARD,,77
170
;	mcall	SF_KEYBOARD,,72
170
;	mcall	SF_KEYBOARD,,72
171
;	mcall	SF_KEYBOARD,,80
171
;	mcall	SF_KEYBOARD,,80
172
 
172
 
173
	call	ready_screen_buffer
173
	call	ready_screen_buffer
174
;	jmp	open_file
174
;	jmp	open_file
175
	mcall	SF_THREAD_INFO,procinfo,-1
175
	mcall	SF_THREAD_INFO,procinfo,-1
176
	mov	ecx,[ebx+30]	; PID
176
	mov	ecx,[ebx+30]	; PID
177
	mcall	SF_SYSTEM,SSF_GET_THREAD_SLOT
177
	mcall	SF_SYSTEM,SSF_GET_THREAD_SLOT
178
	mov	[active_process],eax	; WINDOW SLOT
178
	mov	[active_process],eax	; WINDOW SLOT
179
;--------------------------------------------------------------------
179
;--------------------------------------------------------------------
180
; open the file if program has a file path, when it was launched
180
; open the file if program has a file path, when it was launched
181
	cmp	[fname_buf],byte 0
181
	cmp	[fname_buf],byte 0
182
	jne	open_dialog.start
182
	jne	open_dialog.start
183
;--------------------------------------------------------------------
183
;--------------------------------------------------------------------
184
redraw_all:
184
redraw_all:
185
	call	control_minimal_window_size
185
	call	control_minimal_window_size
186
	call	draw_window_1
186
	call	draw_window_1
187
still:
187
still:
188
	mcall	SF_WAIT_EVENT
188
	mcall	SF_WAIT_EVENT
189
 
189
 
190
	cmp	eax,6
190
	cmp	eax,6
191
	je	mouse
191
	je	mouse
192
	dec	al
192
	dec	al
193
	jz	redraw_all
193
	jz	redraw_all
194
	dec	al
194
	dec	al
195
	jz	key
195
	jz	key
196
	dec	al
196
	dec	al
197
	jz	button
197
	jz	button
198
	jmp	still
198
	jmp	still
199
;---------------------------------------------------------------------
199
;---------------------------------------------------------------------
200
control_minimal_window_size:
200
control_minimal_window_size:
201
	pusha
201
	pusha
202
	mcall	SF_THREAD_INFO,procinfo,-1
202
	mcall	SF_THREAD_INFO,procinfo,-1
203
	mov	eax,[ebx+70]
203
	mov	eax,[ebx+70]
204
	test	eax,10b
204
	test	eax,10b
205
	jnz	.end
205
	jnz	.end
206
	test	eax,100b
206
	test	eax,100b
207
	jnz	.end
207
	jnz	.end
208
	test	eax,1b
208
	test	eax,1b
209
	jnz	.end
209
	jnz	.end
210
	mov	esi,-1
210
	mov	esi,-1
211
	mov	eax,procinfo
211
	mov	eax,procinfo
212
	mov	eax,[eax+46]
212
	mov	eax,[eax+46]
213
	cmp	eax,299
213
	cmp	eax,299
214
	jae	@f
214
	jae	@f
215
	mov	esi,299
215
	mov	esi,299
216
	mcall	SF_CHANGE_WINDOW,-1,ebx,ebx
216
	mcall	SF_CHANGE_WINDOW,-1,ebx,ebx
217
@@:
217
@@:
218
	mov	edx,-1
218
	mov	edx,-1
219
	mov	eax,procinfo
219
	mov	eax,procinfo
220
	mov	eax,[eax+42]
220
	mov	eax,[eax+42]
221
	cmp	eax,399
221
	cmp	eax,399
222
	jae	@f
222
	jae	@f
223
	mov	edx,399
223
	mov	edx,399
224
	mcall	SF_CHANGE_WINDOW,-1,ebx,,ebx
224
	mcall	SF_CHANGE_WINDOW,-1,ebx,,ebx
225
@@:
225
@@:
226
.end:
226
.end:
227
	popa
227
	popa
228
	ret
228
	ret
229
;---------------------------------------------------------------------
229
;---------------------------------------------------------------------
230
red:
230
red:
231
	call	ready_screen_buffer
231
	call	ready_screen_buffer
232
	call	main_area
232
	call	main_area
233
	jmp	still
233
	jmp	still
234
;---------------------------------------------------------------------
234
;---------------------------------------------------------------------
235
draw_window_1:
235
draw_window_1:
236
	call	start_draw
236
	call	start_draw
237
	call	draw_window
237
	call	draw_window
238
 
238
 
239
	mov     eax,[threath_buf+70]
239
	mov     eax,[threath_buf+70]
240
	test	eax,10b
240
	test	eax,10b
241
	jnz     .end
241
	jnz     .end
242
	test	eax,100b
242
	test	eax,100b
243
	jnz     .end
243
	jnz     .end
244
 
244
 
245
	call	show_file_size
245
	call	show_file_size
246
	call	show_codepage
246
	call	show_codepage
247
	call	show_insert
247
	call	show_insert
248
	call	ready_screen_buffer
248
	call	ready_screen_buffer
249
	call	main_area
249
	call	main_area
250
.end:
250
.end:
251
	ret
251
	ret
252
;---------------------------------------------------------------------
252
;---------------------------------------------------------------------
253
key:
253
key:
254
	mcall	SF_GET_KEY
254
	mcall	SF_GET_KEY
255
	dec	al
255
	dec	al
256
	jz	still
256
	jz	still
257
	dec	al
257
	dec	al
258
	jz	key.syst
258
	jz	key.syst
259
	cmp	ah,2
259
	cmp	ah,2
260
	je	Ctrl_B	;¢ë¤¥«¨âì ¡«®ª
260
	je	Ctrl_B	;¢ë¤¥«¨âì ¡«®ª
261
	cmp	ah,3
261
	cmp	ah,3
262
	je	Ctrl_C	;copy
262
	je	Ctrl_C	;copy
263
	cmp	ah,6
263
	cmp	ah,6
264
	je	Ctrl_F	;find
264
	je	Ctrl_F	;find
265
	cmp	ah,7
265
	cmp	ah,7
266
	je	Ctrl_G	;go to
266
	je	Ctrl_G	;go to
267
	cmp	ah,8
267
	cmp	ah,8
268
	je	BackSpace
268
	je	BackSpace
269
	cmp	ah,15
269
	cmp	ah,15
270
	je	open_dialog ;open_file ;Ctrl+O
270
	je	open_dialog ;open_file ;Ctrl+O
271
	cmp	ah,19
271
	cmp	ah,19
272
	je	open_dialog_save ;save_file ;Ctrl+S
272
	je	open_dialog_save ;save_file ;Ctrl+S
273
	cmp	ah,22
273
	cmp	ah,22
274
	je	Ctrl_V	;paste
274
	je	Ctrl_V	;paste
275
	cmp	ah,24
275
	cmp	ah,24
276
	je	Ctrl_X	;cut
276
	je	Ctrl_X	;cut
277
	cmp	ah,27
277
	cmp	ah,27
278
	je	ESC
278
	je	ESC
279
	cmp	ah,48
279
	cmp	ah,48
280
	jb	still
280
	jb	still
281
	cmp	ah,57
281
	cmp	ah,57
282
	jbe	input_from_keyboard	;0-9
282
	jbe	input_from_keyboard	;0-9
283
	cmp	ah,65
283
	cmp	ah,65
284
	jb	still
284
	jb	still
285
	cmp	ah,70
285
	cmp	ah,70
286
	jbe	input_from_keyboard	;A-F
286
	jbe	input_from_keyboard	;A-F
287
	cmp	ah,81
287
	cmp	ah,81
288
	jne	@f
288
	jne	@f
289
	call	Ctrl_DOWN
289
	call	Ctrl_DOWN
290
	jmp	red
290
	jmp	red
291
;--------------------------------------
291
;--------------------------------------
292
@@:
292
@@:
293
	cmp	ah,82
293
	cmp	ah,82
294
	jne	@f
294
	jne	@f
295
	call	Ctrl_UP
295
	call	Ctrl_UP
296
	jmp	red
296
	jmp	red
297
;--------------------------------------
297
;--------------------------------------
298
@@:
298
@@:
299
	cmp	ah,84
299
	cmp	ah,84
300
	jne	@f
300
	jne	@f
301
	call	Ctrl_HOME
301
	call	Ctrl_HOME
302
	jmp	red
302
	jmp	red
303
;--------------------------------------
303
;--------------------------------------
304
@@:
304
@@:
305
	cmp	ah,85
305
	cmp	ah,85
306
	je	Ctrl_END
306
	je	Ctrl_END
307
	cmp	ah,96
307
	cmp	ah,96
308
	je	change_codepage	;⨫줠, cp866 - cp1251
308
	je	change_codepage	;⨫줠, cp866 - cp1251
309
	cmp	ah,97
309
	cmp	ah,97
310
	jb	still
310
	jb	still
311
	cmp	ah,102
311
	cmp	ah,102
312
	jbe	input_from_keyboard ;a-f
312
	jbe	input_from_keyboard ;a-f
313
	cmp	ah,126
313
	cmp	ah,126
314
	jne	@f
314
	jne	@f
315
	xor	ah,ah
315
	xor	ah,ah
316
	jmp	change_codepage	;Shift+~, koi8-r
316
	jmp	change_codepage	;Shift+~, koi8-r
317
;--------------------------------------
317
;--------------------------------------
318
@@:
318
@@:
319
	cmp	ah,110
319
	cmp	ah,110
320
	je	invert_byte ;n
320
	je	invert_byte ;n
321
	cmp	ah,176
321
	cmp	ah,176
322
	jne	@f
322
	jne	@f
323
	call	LEFT
323
	call	LEFT
324
	jmp	red
324
	jmp	red
325
;--------------------------------------
325
;--------------------------------------
326
@@:
326
@@:
327
	cmp	ah,177
327
	cmp	ah,177
328
	jne	@f
328
	jne	@f
329
	call	DOWN
329
	call	DOWN
330
	jmp	red
330
	jmp	red
331
;--------------------------------------
331
;--------------------------------------
332
@@:
332
@@:
333
	cmp	ah,178
333
	cmp	ah,178
334
	je	UP
334
	je	UP
335
	cmp	ah,179
335
	cmp	ah,179
336
	je	RIGHT
336
	je	RIGHT
337
	cmp	ah,180
337
	cmp	ah,180
338
	jne	@f
338
	jne	@f
339
	call	HOME
339
	call	HOME
340
	jmp	red
340
	jmp	red
341
;--------------------------------------
341
;--------------------------------------
342
@@:
342
@@:
343
	cmp	ah,181
343
	cmp	ah,181
344
	je	END_
344
	je	END_
345
	cmp	ah,182
345
	cmp	ah,182
346
	je	DEL
346
	je	DEL
347
	cmp	ah,183
347
	cmp	ah,183
348
	je	PGDN
348
	je	PGDN
349
	cmp	ah,184
349
	cmp	ah,184
350
	je	PGUP
350
	je	PGUP
351
	cmp	ah,185
351
	cmp	ah,185
352
	je	Insert
352
	je	Insert
353
	jmp	still
353
	jmp	still
354
;--------------------------------------
354
;--------------------------------------
355
.syst:
355
.syst:
356
	cmp	ah,72
356
	cmp	ah,72
357
	cmp	ah,75
357
	cmp	ah,75
358
	cmp	ah,77
358
	cmp	ah,77
359
	cmp	ah,80
359
	cmp	ah,80
360
	jmp	still
360
	jmp	still
361
;--------------------------------------------------------------------
361
;--------------------------------------------------------------------
362
button:
362
button:
363
	mcall	SF_GET_BUTTON
363
	mcall	SF_GET_BUTTON
364
	dec	ah
364
	dec	ah
365
	jnz	still
365
	jnz	still
366
 
366
 
367
	jmp	close_prog
367
	jmp	close_prog
368
;--------------------------------------------------------------------
368
;--------------------------------------------------------------------
369
align	4
369
align	4
370
mouse:
370
mouse:
371
	mcall	SF_SYSTEM,SSF_GET_ACTIVE_WINDOW
371
	mcall	SF_SYSTEM,SSF_GET_ACTIVE_WINDOW
372
	cmp	[active_process],eax
372
	cmp	[active_process],eax
373
	jne	still
373
	jne	still
374
 
374
 
375
	mcall	SF_MOUSE_GET,SSF_SCROLL_DATA
375
	mcall	SF_MOUSE_GET,SSF_SCROLL_DATA
376
	test	eax,eax
376
	test	eax,eax
377
	jz	.menu_bar_1;.mouse
377
	jz	.menu_bar_1;.mouse
378
	bt	eax,15
378
	bt	eax,15
379
	jc	@f	;®¡à ¡®âª  ª®«ñᨪ  ¬ëè¨
379
	jc	@f	;®¡à ¡®âª  ª®«ñᨪ  ¬ëè¨
380
	mov	ecx,eax
380
	mov	ecx,eax
381
	shl	ecx,2
381
	shl	ecx,2
382
.1:
382
.1:
383
	call	Ctrl_DOWN
383
	call	Ctrl_DOWN
384
	loop	.1
384
	loop	.1
385
	jmp	red
385
	jmp	red
386
;--------------------------------------
386
;--------------------------------------
387
@@:
387
@@:
388
	xor	ecx,ecx
388
	xor	ecx,ecx
389
	sub	cx,ax
389
	sub	cx,ax
390
	shl	cx,2
390
	shl	cx,2
391
.2:
391
.2:
392
	call	Ctrl_UP
392
	call	Ctrl_UP
393
	loop	.2
393
	loop	.2
394
	jmp	red
394
	jmp	red
395
;--------------------------------------------------------------------
395
;--------------------------------------------------------------------
396
.menu_bar_1:
396
.menu_bar_1:
397
	call	.set_mouse_flag
397
	call	.set_mouse_flag
398
@@:
398
@@:
399
	push	dword menu_data_1	;mouse event for Menu 1
399
	push	dword menu_data_1	;mouse event for Menu 1
400
	call	[menu_bar_mouse]
400
	call	[menu_bar_mouse]
401
	cmp	[menu_data_1.click],dword 1
401
	cmp	[menu_data_1.click],dword 1
402
	jne	.menu_bar_2
402
	jne	.menu_bar_2
403
	cmp	[menu_data_1.cursor_out],dword 0
403
	cmp	[menu_data_1.cursor_out],dword 0
404
	jne	.analyse_out_menu_1
404
	jne	.analyse_out_menu_1
405
	jmp	.menu_bar_1
405
	jmp	.menu_bar_1
406
;--------------------------------------------------------------------
406
;--------------------------------------------------------------------
407
.menu_bar_2:
407
.menu_bar_2:
408
	push	dword menu_data_2
408
	push	dword menu_data_2
409
	call	[menu_bar_mouse]
409
	call	[menu_bar_mouse]
410
	cmp	[menu_data_2.click],dword 1
410
	cmp	[menu_data_2.click],dword 1
411
	jne	.menu_bar_3
411
	jne	.menu_bar_3
412
	cmp	[menu_data_2.cursor_out],dword 0
412
	cmp	[menu_data_2.cursor_out],dword 0
413
	jne	.analyse_out_menu_2
413
	jne	.analyse_out_menu_2
414
	jmp	.menu_bar_1
414
	jmp	.menu_bar_1
415
;--------------------------------------------------------------------
415
;--------------------------------------------------------------------
416
.menu_bar_3:
416
.menu_bar_3:
417
	push	dword menu_data_3
417
	push	dword menu_data_3
418
	call	[menu_bar_mouse]
418
	call	[menu_bar_mouse]
419
	cmp	[menu_data_3.click],dword 1
419
	cmp	[menu_data_3.click],dword 1
420
	jne	.scroll_bar
420
	jne	.scroll_bar
421
	cmp	[menu_data_3.cursor_out],dword 0
421
	cmp	[menu_data_3.cursor_out],dword 0
422
	jne	.analyse_out_menu_3
422
	jne	.analyse_out_menu_3
423
	jmp	.menu_bar_1
423
	jmp	.menu_bar_1
424
;--------------------------------------------------------------------
424
;--------------------------------------------------------------------
425
.set_mouse_flag:
425
.set_mouse_flag:
426
	xor	eax,eax
426
	xor	eax,eax
427
	inc	eax
427
	inc	eax
428
	mov	[menu_data_1.get_mouse_flag],eax
428
	mov	[menu_data_1.get_mouse_flag],eax
429
	mov	[menu_data_2.get_mouse_flag],eax
429
	mov	[menu_data_2.get_mouse_flag],eax
430
	mov	[menu_data_3.get_mouse_flag],eax
430
	mov	[menu_data_3.get_mouse_flag],eax
431
	ret
431
	ret
432
;--------------------------------------------------------------------
432
;--------------------------------------------------------------------
433
.analyse_out_menu_1:
433
.analyse_out_menu_1:
434
	cmp	[menu_data_1.cursor_out],dword 1
434
	cmp	[menu_data_1.cursor_out],dword 1
435
	je	open_dialog
435
	je	open_dialog
436
	cmp	[menu_data_1.cursor_out],dword 2
436
	cmp	[menu_data_1.cursor_out],dword 2
437
	je	open_dialog_save	;save_file
437
	je	open_dialog_save	;save_file
438
	cmp	[menu_data_1.cursor_out],dword 3
438
	cmp	[menu_data_1.cursor_out],dword 3
439
	je	close_prog
439
	je	close_prog
440
	jmp	still
440
	jmp	still
441
;--------------------------------------------------------------------
441
;--------------------------------------------------------------------
442
.analyse_out_menu_2:
442
.analyse_out_menu_2:
443
	cmp	[menu_data_2.cursor_out],dword 1
443
	cmp	[menu_data_2.cursor_out],dword 1
444
	jne	@f
444
	jne	@f
445
	add	[bytes_per_line],4
445
	add	[bytes_per_line],4
446
	jmp	redraw_all
446
	jmp	redraw_all
447
;--------------------------------------
447
;--------------------------------------
448
@@:
448
@@:
449
	cmp	[menu_data_2.cursor_out],dword 2
449
	cmp	[menu_data_2.cursor_out],dword 2
450
	jne	@f
450
	jne	@f
451
	add	[bytes_per_line],8
451
	add	[bytes_per_line],8
452
	jmp	redraw_all
452
	jmp	redraw_all
453
;--------------------------------------
453
;--------------------------------------
454
@@:
454
@@:
455
	cmp	[menu_data_2.cursor_out],dword 3
455
	cmp	[menu_data_2.cursor_out],dword 3
456
	jne	@f
456
	jne	@f
457
	cmp	[bytes_per_line],4
457
	cmp	[bytes_per_line],4
458
	je	still
458
	je	still
459
	sub	[bytes_per_line],4
459
	sub	[bytes_per_line],4
460
	jmp	redraw_all
460
	jmp	redraw_all
461
;--------------------------------------
461
;--------------------------------------
462
@@:
462
@@:
463
	cmp	[menu_data_2.cursor_out],dword 4
463
	cmp	[menu_data_2.cursor_out],dword 4
464
	jne	still
464
	jne	still
465
	cmp	[bytes_per_line],8
465
	cmp	[bytes_per_line],8
466
	jbe	still
466
	jbe	still
467
	sub	[bytes_per_line],8
467
	sub	[bytes_per_line],8
468
	jmp	redraw_all
468
	jmp	redraw_all
469
;--------------------------------------------------------------------
469
;--------------------------------------------------------------------
470
.analyse_out_menu_3:	;analyse result of Menu 2
470
.analyse_out_menu_3:	;analyse result of Menu 2
471
	cmp	[menu_data_3.cursor_out],dword 1
471
	cmp	[menu_data_3.cursor_out],dword 1
472
	jne	still
472
	jne	still
473
	call	create_help_window
473
	call	create_help_window
474
	jmp	still
474
	jmp	still
475
;--------------------------------------------------------------------
475
;--------------------------------------------------------------------
476
.scroll_bar:
476
.scroll_bar:
477
;	mcall	SF_MOUSE_GET,SSF_BUTTON
477
;	mcall	SF_MOUSE_GET,SSF_BUTTON
478
;	test	eax,eax
478
;	test	eax,eax
479
;	jnz	@f
479
;	jnz	@f
480
;	btr	[flags],5
480
;	btr	[flags],5
481
;	btr	[flags],7
481
;	btr	[flags],7
482
;	jmp	still
482
;	jmp	still
483
 
483
 
484
.mouse:
484
.mouse:
485
.vertical:
485
.vertical:
486
	mcall	SF_MOUSE_GET,SSF_BUTTON
486
	mcall	SF_MOUSE_GET,SSF_BUTTON
487
	test	eax,eax
487
	test	eax,eax
488
	jnz	@f
488
	jnz	@f
489
	btr	[flags],5
489
	btr	[flags],5
490
	btr	[flags],7
490
	btr	[flags],7
491
	jmp	still
491
	jmp	still
492
;--------------------------------------
492
;--------------------------------------
493
@@:
493
@@:
494
	bt	[flags],5
494
	bt	[flags],5
495
	jc	@f
495
	jc	@f
496
	bt	[flags],7
496
	bt	[flags],7
497
	jc	.horizontal_0
497
	jc	.horizontal_0
498
 
498
 
499
	mcall	SF_MOUSE_GET,SSF_WINDOW_POSITION
499
	mcall	SF_MOUSE_GET,SSF_WINDOW_POSITION
500
	shr	eax,16
500
	shr	eax,16
501
	cmp	ax,[scroll_bar_data_vertical.x_pos]
501
	cmp	ax,[scroll_bar_data_vertical.x_pos]
502
	jb	.horizontal
502
	jb	.horizontal
503
	sub	ax,[scroll_bar_data_vertical.x_pos]
503
	sub	ax,[scroll_bar_data_vertical.x_pos]
504
	cmp	ax,[scroll_bar_data_vertical.x_size]
504
	cmp	ax,[scroll_bar_data_vertical.x_size]
505
	jge	still
505
	jge	still
506
 
506
 
507
 
507
 
508
@@:
508
@@:
509
;	cmp	[scroll_bar_data_vertictal.delta2],0
509
;	cmp	[scroll_bar_data_vertictal.delta2],0
510
	;	jne	.horizontal
510
	;	jne	.horizontal
511
 
511
 
512
;	mov	eax,[scroll_bar_data_vertical.max_area]
512
;	mov	eax,[scroll_bar_data_vertical.max_area]
513
;	cmp	eax,[scroll_bar_data_vertical.cur_area]
513
;	cmp	eax,[scroll_bar_data_vertical.cur_area]
514
;	jbe	.horizontal
514
;	jbe	.horizontal
515
 
515
 
516
	;	mouse event for Vertical ScrollBar
516
	;	mouse event for Vertical ScrollBar
517
	mov	edi,[screen_table]
517
	mov	edi,[screen_table]
518
	mov	edi,[edi]
518
	mov	edi,[edi]
519
	cmp	edi,[file_size]
519
	cmp	edi,[file_size]
520
	jae	still
520
	jae	still
521
	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
521
	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
522
	call	[scrollbar_ver_mouse]
522
	call	[scrollbar_ver_mouse]
523
 
523
 
524
	xor	edx,edx
524
	xor	edx,edx
525
	mov	ebx,[scroll_bar_data_vertical.max_area]
525
	mov	ebx,[scroll_bar_data_vertical.max_area]
526
	sub	ebx,[scroll_bar_data_vertical.cur_area]
526
	sub	ebx,[scroll_bar_data_vertical.cur_area]
527
	mov	eax,[file_size]
527
	mov	eax,[file_size]
528
	mov	esi,[bytes_per_line]
528
	mov	esi,[bytes_per_line]
529
	mov	ecx,[scroll_bar_data_vertical.position]
529
	mov	ecx,[scroll_bar_data_vertical.position]
530
	div	esi
530
	div	esi
531
	xor	edx,edx
531
	xor	edx,edx
532
	mul	ecx
532
	mul	ecx
533
	div	ebx
533
	div	ebx
534
	mul	esi
534
	mul	esi
535
	cmp	eax,[file_size]
535
	cmp	eax,[file_size]
536
	jng	@f
536
	jng	@f
537
	sub	eax,esi;[bytes_per_line]
537
	sub	eax,esi;[bytes_per_line]
538
@@:
538
@@:
539
	mov	ecx,[cursor]
539
	mov	ecx,[cursor]
540
	inc	ecx
540
	inc	ecx
541
	shr	ecx,1
541
	shr	ecx,1
542
	add	ecx,eax
542
	add	ecx,eax
543
@@:
543
@@:
544
	cmp	ecx,[file_size]
544
	cmp	ecx,[file_size]
545
	jle	@f
545
	jle	@f
546
	sub	ecx,esi;[bytes_per_line]
546
	sub	ecx,esi;[bytes_per_line]
547
	sub	eax,esi;[bytes_per_line]
547
	sub	eax,esi;[bytes_per_line]
548
	jmp	@b
548
	jmp	@b
549
;--------------------------------------
549
;--------------------------------------
550
@@:
550
@@:
551
	mov	[begin_offset],eax
551
	mov	[begin_offset],eax
552
	bts	[flags],5
552
	bts	[flags],5
553
 
553
 
554
	mov	eax,scroll_bar_data_vertical.redraw
554
	mov	eax,scroll_bar_data_vertical.redraw
555
	xor	ebx,ebx
555
	xor	ebx,ebx
556
;	cmp	[eax],ebx
556
;	cmp	[eax],ebx
557
;	je	@f
557
;	je	@f
558
	mov	[eax],ebx
558
	mov	[eax],ebx
559
	jmp	red
559
	jmp	red
560
;--------------------------------------------------------------------
560
;--------------------------------------------------------------------
561
;@@:
561
;@@:
562
;	cmp	[scroll_bar_data_vertical.delta2],0
562
;	cmp	[scroll_bar_data_vertical.delta2],0
563
;	jne	still
563
;	jne	still
564
.horizontal:
564
.horizontal:
565
	mov	eax,[scroll_bar_data_horizontal.max_area]
565
	mov	eax,[scroll_bar_data_horizontal.max_area]
566
	cmp	eax,[scroll_bar_data_horizontal.cur_area]
566
	cmp	eax,[scroll_bar_data_horizontal.cur_area]
567
	jbe	.other
567
	jbe	.other
568
 
568
 
569
	mcall	SF_MOUSE_GET,SSF_WINDOW_POSITION
569
	mcall	SF_MOUSE_GET,SSF_WINDOW_POSITION
570
	cmp	ax,[scroll_bar_data_horizontal.y_pos]
570
	cmp	ax,[scroll_bar_data_horizontal.y_pos]
571
	jb	still
571
	jb	still
572
	sub	ax,[scroll_bar_data_horizontal.y_pos]
572
	sub	ax,[scroll_bar_data_horizontal.y_pos]
573
	cmp	ax,[scroll_bar_data_horizontal.y_size]
573
	cmp	ax,[scroll_bar_data_horizontal.y_size]
574
	jge	still
574
	jge	still
575
 
575
 
576
	; mouse event for Horizontal ScrollBar
576
	; mouse event for Horizontal ScrollBar
577
.horizontal_0:
577
.horizontal_0:
578
;	mcall	SF_MOUSE_GET,SSF_BUTTON
578
;	mcall	SF_MOUSE_GET,SSF_BUTTON
579
;	test	eax,eax
579
;	test	eax,eax
580
;	jnz	@f
580
;	jnz	@f
581
;	btr	[flags],5
581
;	btr	[flags],5
582
;	btr	[flags],7
582
;	btr	[flags],7
583
;	jmp	still
583
;	jmp	still
584
;@@:;	bt	[flags],7
584
;@@:;	bt	[flags],7
585
;	jc	@f
585
;	jc	@f
586
 
586
 
587
;	mcall	SF_MOUSE_GET,SSF_WINDOW_POSITION
587
;	mcall	SF_MOUSE_GET,SSF_WINDOW_POSITION
588
;	shr	eax,16
588
;	shr	eax,16
589
;	cmp	ax,[scroll_bar_data_vertical.x_pos]
589
;	cmp	ax,[scroll_bar_data_vertical.x_pos]
590
;	jb	.horizontal
590
;	jb	.horizontal
591
;	sub	ax,[scroll_bar_data_vertical.x_pos]
591
;	sub	ax,[scroll_bar_data_vertical.x_pos]
592
;	cmp	ax,[scroll_bar_data_vertical.x_size]
592
;	cmp	ax,[scroll_bar_data_vertical.x_size]
593
;	jge	still
593
;	jge	still
594
;@@:
594
;@@:
595
	; mouse event for Vertical ScrollBar
595
	; mouse event for Vertical ScrollBar
596
 
596
 
597
	mov	eax,[ready_screen_buffer.string_size]
597
	mov	eax,[ready_screen_buffer.string_size]
598
	shr	eax,1
598
	shr	eax,1
599
	cmp	eax,[len_str_scr]
599
	cmp	eax,[len_str_scr]
600
	jle	still
600
	jle	still
601
	push	dword scroll_bar_data_horizontal	;draw for Horizontal ScrollBar
601
	push	dword scroll_bar_data_horizontal	;draw for Horizontal ScrollBar
602
	call	[scrollbar_hor_mouse]
602
	call	[scrollbar_hor_mouse]
603
 
603
 
604
	xor	edx,edx
604
	xor	edx,edx
605
	mov	eax,[scroll_bar_data_horizontal.position]
605
	mov	eax,[scroll_bar_data_horizontal.position]
606
	mov	ebx,[ready_screen_buffer.string_size]
606
	mov	ebx,[ready_screen_buffer.string_size]
607
	shr	ebx,1
607
	shr	ebx,1
608
	mul	ebx
608
	mul	ebx
609
	mov	ebx,[scroll_bar_data_horizontal.max_area]
609
	mov	ebx,[scroll_bar_data_horizontal.max_area]
610
	sub	ebx,[scroll_bar_data_horizontal.cur_area]
610
	sub	ebx,[scroll_bar_data_horizontal.cur_area]
611
	div	ebx
611
	div	ebx
612
	mov	[beg_str_scr],eax
612
	mov	[beg_str_scr],eax
613
	add	eax,[len_str_scr]
613
	add	eax,[len_str_scr]
614
	mov	ebx,[ready_screen_buffer.string_size]
614
	mov	ebx,[ready_screen_buffer.string_size]
615
	shr	ebx,1
615
	shr	ebx,1
616
	cmp	eax,ebx
616
	cmp	eax,ebx
617
	jle	@f
617
	jle	@f
618
	mov	eax,[ready_screen_buffer.string_size]
618
	mov	eax,[ready_screen_buffer.string_size]
619
	shr	eax,1
619
	shr	eax,1
620
	sub	eax,[len_str_scr]
620
	sub	eax,[len_str_scr]
621
	mov	[beg_str_scr],eax
621
	mov	[beg_str_scr],eax
622
@@:
622
@@:
623
	mov	eax,scroll_bar_data_horizontal.redraw
623
	mov	eax,scroll_bar_data_horizontal.redraw
624
	xor	ebx,ebx
624
	xor	ebx,ebx
625
	cmp	[eax],ebx
625
	cmp	[eax],ebx
626
	je	.other
626
	je	.other
627
	mov	[eax],ebx
627
	mov	[eax],ebx
628
;	call	draw_window
628
;	call	draw_window
629
	call	main_area
629
	call	main_area
630
	bts	[flags],7
630
	bts	[flags],7
631
	jmp	still
631
	jmp	still
632
;--------------------------------------------------------------------
632
;--------------------------------------------------------------------
633
.other:
633
.other:
634
;	cmp	[scroll_bar_data_vertical.delta2],0
634
;	cmp	[scroll_bar_data_vertical.delta2],0
635
;	jne	still
635
;	jne	still
636
;	cmp	[scroll_bar_data_horizontal.delta2],0
636
;	cmp	[scroll_bar_data_horizontal.delta2],0
637
;	jne	still
637
;	jne	still
638
	jmp	still
638
	jmp	still
639
;--------------------------------------------------------------------
639
;--------------------------------------------------------------------
640
align	4
640
align	4
641
ready_screen_buffer:
641
ready_screen_buffer:
642
	mov	[.fl],0
642
	mov	[.fl],0
643
	mov	esi,[screen_table]
643
	mov	esi,[screen_table]
644
	add	esi,4
644
	add	esi,4
645
	mov	ecx,[number_strings]
645
	mov	ecx,[number_strings]
646
	mov	[.number_strings],cx
646
	mov	[.number_strings],cx
647
	push	[cursor]
647
	push	[cursor]
648
	pop	[.cursor]
648
	pop	[.cursor]
649
	push	[file_size]
649
	push	[file_size]
650
	pop	[.length_to_end]
650
	pop	[.length_to_end]
651
	mov	edi,[begin_offset]
651
	mov	edi,[begin_offset]
652
 
652
 
653
	mov	[.shblock_end],0
653
	mov	[.shblock_end],0
654
	mov	[.shblock_beg],0
654
	mov	[.shblock_beg],0
655
	bt	[flags],8
655
	bt	[flags],8
656
	jnc	@f
656
	jnc	@f
657
	mov	eax,[shblock_beg]
657
	mov	eax,[shblock_beg]
658
	add	eax,[file_buffer]
658
	add	eax,[file_buffer]
659
	mov	[.shblock_beg],eax
659
	mov	[.shblock_beg],eax
660
	mov	eax,[shblock_end]
660
	mov	eax,[shblock_end]
661
	add	eax,[file_buffer]
661
	add	eax,[file_buffer]
662
	mov	[.shblock_end],eax
662
	mov	[.shblock_end],eax
663
@@:
663
@@:
664
	mov	[.offset],edi
664
	mov	[.offset],edi
665
	sub	[.length_to_end],edi
665
	sub	[.length_to_end],edi
666
	jz	.pre_next_string
666
	jz	.pre_next_string
667
	add	edi,[file_buffer]
667
	add	edi,[file_buffer]
668
 
668
 
669
.next_string:
669
.next_string:
670
	mov	word [esi],0x2020
670
	mov	word [esi],0x2020
671
	add	esi,2
671
	add	esi,2
672
	mov	eax,0x20302030
672
	mov	eax,0x20302030
673
	mov	dword [esi],eax
673
	mov	dword [esi],eax
674
	mov	dword [esi+4],eax
674
	mov	dword [esi+4],eax
675
	mov	dword [esi+8],eax
675
	mov	dword [esi+8],eax
676
	mov	dword [esi+12],eax
676
	mov	dword [esi+12],eax
677
	push	edi
677
	push	edi
678
	mov	ecx,8
678
	mov	ecx,8
679
	mov	edi,[.offset]
679
	mov	edi,[.offset]
680
@@:
680
@@:
681
	mov	eax,edi
681
	mov	eax,edi
682
	and	eax,0xF
682
	and	eax,0xF
683
	cmp	al,10
683
	cmp	al,10
684
	sbb	al,69h
684
	sbb	al,69h
685
	das
685
	das
686
	mov	[esi+ecx*2-2],al
686
	mov	[esi+ecx*2-2],al
687
	shr	edi,4
687
	shr	edi,4
688
	loop	@b
688
	loop	@b
689
	mov	word [esi+16],0x203a	;¤¢®¥â®ç¨¥
689
	mov	word [esi+16],0x203a	;¤¢®¥â®ç¨¥
690
	mov	eax,[bytes_per_line]
690
	mov	eax,[bytes_per_line]
691
	add	[.offset],eax
691
	add	[.offset],eax
692
	mov	[.string_size],2+4*4+4+2
692
	mov	[.string_size],2+4*4+4+2
693
	add	esi,4*4+4+2
693
	add	esi,4*4+4+2
694
	pop	edi
694
	pop	edi
695
	mov	[.temp],edi
695
	mov	[.temp],edi
696
	push	[.cursor]
696
	push	[.cursor]
697
	pop	[.cursor_temp]
697
	pop	[.cursor_temp]
698
 
698
 
699
	;hex	§­ ç¥­¨ï
699
	;hex	§­ ç¥­¨ï
700
	mov	dword [esi-4],0x20202020
700
	mov	dword [esi-4],0x20202020
701
 
701
 
702
	mov	edx,[bytes_per_line]
702
	mov	edx,[bytes_per_line]
703
.next_group:
703
.next_group:
704
	mov	ecx,[group_bytes]
704
	mov	ecx,[group_bytes]
705
 
705
 
706
.next_byte:
706
.next_byte:
707
	mov	al,[edi]
707
	mov	al,[edi]
708
	ror	ax,4
708
	ror	ax,4
709
	cmp	al,10
709
	cmp	al,10
710
	sbb	al,69h
710
	sbb	al,69h
711
	das
711
	das
712
	mov	[esi],al
712
	mov	[esi],al
713
	mov	byte [esi+1],0x20
713
	mov	byte [esi+1],0x20
714
	cmp	edi,[.shblock_end]
714
	cmp	edi,[.shblock_end]
715
	ja	@f
715
	ja	@f
716
	cmp	edi,[.shblock_beg]
716
	cmp	edi,[.shblock_beg]
717
	jl	@f
717
	jl	@f
718
	mov	byte [esi+1],(0x20+3*4)
718
	mov	byte [esi+1],(0x20+3*4)
719
@@:
719
@@:
720
	dec	[.cursor]
720
	dec	[.cursor]
721
	jnz	@f
721
	jnz	@f
722
	mov	byte [esi+1],(0x20+2*4)
722
	mov	byte [esi+1],(0x20+2*4)
723
@@:
723
@@:
724
	shr	ax,16-4
724
	shr	ax,16-4
725
	cmp	al,10
725
	cmp	al,10
726
	sbb	al,69h
726
	sbb	al,69h
727
	das
727
	das
728
	mov	[esi+2],al
728
	mov	[esi+2],al
729
	mov	byte [esi+3],0x20
729
	mov	byte [esi+3],0x20
730
	cmp	edi,[.shblock_end]
730
	cmp	edi,[.shblock_end]
731
	ja	@f
731
	ja	@f
732
	cmp	edi,[.shblock_beg]
732
	cmp	edi,[.shblock_beg]
733
	jl	@f
733
	jl	@f
734
	mov	byte [esi+3],(0x20+3*4)
734
	mov	byte [esi+3],(0x20+3*4)
735
@@:
735
@@:
736
	dec	[.cursor]
736
	dec	[.cursor]
737
	jnz	@f
737
	jnz	@f
738
	mov	byte [esi+3],(0x20+2*4)
738
	mov	byte [esi+3],(0x20+2*4)
739
@@:
739
@@:
740
	mov	word [esi+4],0x2020
740
	mov	word [esi+4],0x2020
741
	add	[.string_size],6
741
	add	[.string_size],6
742
	add	esi,6
742
	add	esi,6
743
	inc	edi
743
	inc	edi
744
	dec	[.length_to_end]
744
	dec	[.length_to_end]
745
	jz	.to_null
745
	jz	.to_null
746
	dec	ecx
746
	dec	ecx
747
	jz	@f
747
	jz	@f
748
	dec	edx
748
	dec	edx
749
	jnz	.next_byte
749
	jnz	.next_byte
750
	jz	.ascii
750
	jz	.ascii
751
@@:
751
@@:
752
	mov	word [esi],0x2020
752
	mov	word [esi],0x2020
753
	add	esi,2
753
	add	esi,2
754
	add	[.string_size],2
754
	add	[.string_size],2
755
	dec	edx
755
	dec	edx
756
	jnz	.next_group;byte
756
	jnz	.next_group;byte
757
	sub	esi,2
757
	sub	esi,2
758
	sub	[.string_size],2
758
	sub	[.string_size],2
759
	jz	.ascii
759
	jz	.ascii
760
.ascii:
760
.ascii:
761
	push	edi
761
	push	edi
762
	mov	edi,[.temp]
762
	mov	edi,[.temp]
763
	mov	word [esi],0x2020
763
	mov	word [esi],0x2020
764
	mov	ebx,[.cursor_temp]
764
	mov	ebx,[.cursor_temp]
765
	add	esi,2
765
	add	esi,2
766
	add	[.string_size],2
766
	add	[.string_size],2
767
	mov	ecx,[bytes_per_line]
767
	mov	ecx,[bytes_per_line]
768
@@:
768
@@:
769
	mov	al,[edi]
769
	mov	al,[edi]
770
	mov	[esi],al
770
	mov	[esi],al
771
	mov	byte [esi+1],0x20
771
	mov	byte [esi+1],0x20
772
	dec	ebx
772
	dec	ebx
773
	jnz	.s1
773
	jnz	.s1
774
	mov	byte [esi+1],(0x20+3*4)
774
	mov	byte [esi+1],(0x20+3*4)
775
.s1:
775
.s1:
776
	dec	ebx
776
	dec	ebx
777
	jnz	.s2
777
	jnz	.s2
778
	mov	byte [esi+1],(0x20+3*4)
778
	mov	byte [esi+1],(0x20+3*4)
779
.s2:
779
.s2:
780
	inc	edi
780
	inc	edi
781
	add	esi,2
781
	add	esi,2
782
	add	[.string_size],2
782
	add	[.string_size],2
783
	loop	@b
783
	loop	@b
784
	pop	edi
784
	pop	edi
785
	mov	edx,[bytes_per_line]
785
	mov	edx,[bytes_per_line]
786
	dec	[.number_strings]
786
	dec	[.number_strings]
787
	jnz	.next_string
787
	jnz	.next_string
788
	ret
788
	ret
789
;---------------------------------------------------------------------
789
;---------------------------------------------------------------------
790
.fl	db 0
790
.fl	db 0
791
.fl_buf	dd 0
791
.fl_buf	dd 0
792
.to_null:
792
.to_null:
793
	dec	[.fl]
793
	dec	[.fl]
794
	mov	[.fl_buf],edi
794
	mov	[.fl_buf],edi
795
	jmp	.pre_next_byte0
795
	jmp	.pre_next_byte0
796
;--------------------------------------------------------------------
796
;--------------------------------------------------------------------
797
.pre_next_string:
797
.pre_next_string:
798
	mov	word [esi],0x2020
798
	mov	word [esi],0x2020
799
	add	esi,2
799
	add	esi,2
800
	mov	eax,0x20302030
800
	mov	eax,0x20302030
801
	mov	dword [esi],eax
801
	mov	dword [esi],eax
802
	mov	dword [esi+4],eax
802
	mov	dword [esi+4],eax
803
	mov	dword [esi+8],eax
803
	mov	dword [esi+8],eax
804
	mov	dword [esi+12],eax
804
	mov	dword [esi+12],eax
805
	mov	ecx,8
805
	mov	ecx,8
806
	mov	edi,[.offset]
806
	mov	edi,[.offset]
807
@@:
807
@@:
808
	mov	eax,edi
808
	mov	eax,edi
809
	and	eax,0xF
809
	and	eax,0xF
810
	cmp	al,10
810
	cmp	al,10
811
	sbb	al,69h
811
	sbb	al,69h
812
	das
812
	das
813
	mov	[esi+ecx*2-2],al
813
	mov	[esi+ecx*2-2],al
814
	shr	edi,4
814
	shr	edi,4
815
	loop	@b
815
	loop	@b
816
	mov	word [esi+16],0x203a	;¤¢®¥â®ç¨¥
816
	mov	word [esi+16],0x203a	;¤¢®¥â®ç¨¥
817
	mov	eax,[bytes_per_line]
817
	mov	eax,[bytes_per_line]
818
	add	[.offset],eax
818
	add	[.offset],eax
819
	mov	[.string_size],2+4*4+4+2
819
	mov	[.string_size],2+4*4+4+2
820
	add	esi,4*4+4+2
820
	add	esi,4*4+4+2
821
	push	[.cursor]
821
	push	[.cursor]
822
	pop	[.cursor_temp]
822
	pop	[.cursor_temp]
823
 
823
 
824
	;hex §­ ç¥­¨ï
824
	;hex §­ ç¥­¨ï
825
	mov	dword [esi-4],0x20202020
825
	mov	dword [esi-4],0x20202020
826
 
826
 
827
	mov	edx,[bytes_per_line]
827
	mov	edx,[bytes_per_line]
828
.pre_next_group:
828
.pre_next_group:
829
	mov	ecx,[group_bytes]
829
	mov	ecx,[group_bytes]
830
 
830
 
831
.pre_next_byte:
831
.pre_next_byte:
832
	mov	dword [esi],0x20202020
832
	mov	dword [esi],0x20202020
833
	dec	[.cursor]
833
	dec	[.cursor]
834
	jnz	@f
834
	jnz	@f
835
	mov	byte [esi+1],(0x20+2*4)
835
	mov	byte [esi+1],(0x20+2*4)
836
@@:
836
@@:
837
	dec	[.cursor]
837
	dec	[.cursor]
838
	jnz	@f
838
	jnz	@f
839
	mov	byte [esi+3],(0x20+2*4)
839
	mov	byte [esi+3],(0x20+2*4)
840
@@:
840
@@:
841
	mov	word [esi+4],0x2020
841
	mov	word [esi+4],0x2020
842
	add	[.string_size],6
842
	add	[.string_size],6
843
	add	esi,6
843
	add	esi,6
844
.pre_next_byte0:
844
.pre_next_byte0:
845
	dec	ecx
845
	dec	ecx
846
	jz	@f
846
	jz	@f
847
	dec	edx
847
	dec	edx
848
	jnz	.pre_next_byte
848
	jnz	.pre_next_byte
849
	jz	.pre_ascii
849
	jz	.pre_ascii
850
@@:
850
@@:
851
	mov	word [esi],0x2020
851
	mov	word [esi],0x2020
852
	add	esi,2
852
	add	esi,2
853
	add	[.string_size],2
853
	add	[.string_size],2
854
	dec	edx
854
	dec	edx
855
	jnz	.pre_next_group;byte
855
	jnz	.pre_next_group;byte
856
	sub	esi,2
856
	sub	esi,2
857
	sub	[.string_size],2
857
	sub	[.string_size],2
858
	jz	.pre_ascii
858
	jz	.pre_ascii
859
 
859
 
860
.pre_ascii:
860
.pre_ascii:
861
	mov	word [esi],0x2020
861
	mov	word [esi],0x2020
862
	add	esi,2
862
	add	esi,2
863
	add	[.string_size],2
863
	add	[.string_size],2
864
	mov	ecx,[bytes_per_line]
864
	mov	ecx,[bytes_per_line]
865
	cmp	[.fl],0	;¯à®¢¥àª  ä« £ 
865
	cmp	[.fl],0	;¯à®¢¥àª  ä« £ 
866
	jne	.last_ascii
866
	jne	.last_ascii
867
	mov	ebx,[.cursor_temp]
867
	mov	ebx,[.cursor_temp]
868
@@:
868
@@:
869
	mov	word [esi],0x2020
869
	mov	word [esi],0x2020
870
	dec	ebx
870
	dec	ebx
871
	jnz	.ps1
871
	jnz	.ps1
872
	mov	byte [esi+1],(0x20+3*4)
872
	mov	byte [esi+1],(0x20+3*4)
873
.ps1:
873
.ps1:
874
	dec	ebx
874
	dec	ebx
875
	jnz	.ps2
875
	jnz	.ps2
876
	mov	byte [esi+1],(0x20+3*4)
876
	mov	byte [esi+1],(0x20+3*4)
877
.ps2:
877
.ps2:
878
	add	esi,2
878
	add	esi,2
879
	add	[.string_size],2
879
	add	[.string_size],2
880
.1:
880
.1:
881
	loop	@b
881
	loop	@b
882
	mov	edx,[bytes_per_line]
882
	mov	edx,[bytes_per_line]
883
	dec	[.number_strings]
883
	dec	[.number_strings]
884
	jnz	.pre_next_string
884
	jnz	.pre_next_string
885
	ret
885
	ret
886
;---------------------------------------------------------------------
886
;---------------------------------------------------------------------
887
;ª®à४⭮ ®¡à ¡ â뢠¥¬ 䨭 «ì­ãî áâபã ä ©« , ¤«¨­  ª®â®à®© ¢ à¨ â¨¢­ 
887
;ª®à४⭮ ®¡à ¡ â뢠¥¬ 䨭 «ì­ãî áâபã ä ©« , ¤«¨­  ª®â®à®© ¢ à¨ â¨¢­ 
888
.last_ascii:
888
.last_ascii:
889
	mov	ebx,[.fl_buf]
889
	mov	ebx,[.fl_buf]
890
	sub	ebx,[.temp]
890
	sub	ebx,[.temp]
891
	sub	ecx,ebx
891
	sub	ecx,ebx
892
	mov	edi,[.temp]
892
	mov	edi,[.temp]
893
	mov	[.fl],0
893
	mov	[.fl],0
894
@@:
894
@@:
895
	mov	al,[edi]
895
	mov	al,[edi]
896
	mov	[esi],al
896
	mov	[esi],al
897
	mov	byte [esi+1],0x20
897
	mov	byte [esi+1],0x20
898
	dec	[.cursor_temp]
898
	dec	[.cursor_temp]
899
	jnz	.la1
899
	jnz	.la1
900
	mov	byte [esi+1],(0x20+3*4)
900
	mov	byte [esi+1],(0x20+3*4)
901
.la1:
901
.la1:
902
	dec	[.cursor_temp]
902
	dec	[.cursor_temp]
903
	jnz	.la2
903
	jnz	.la2
904
	mov	byte [esi+1],(0x20+3*4)
904
	mov	byte [esi+1],(0x20+3*4)
905
.la2:
905
.la2:
906
	inc	edi
906
	inc	edi
907
	add	esi,2
907
	add	esi,2
908
	add	[.string_size],2
908
	add	[.string_size],2
909
	dec	ebx
909
	dec	ebx
910
	jnz	@b
910
	jnz	@b
911
	inc	ecx
911
	inc	ecx
912
	jmp	.1
912
	jmp	.1
913
;--------------------------------------------------------------------
913
;--------------------------------------------------------------------
914
.string_size	dd 16
914
.string_size	dd 16
915
.number_strings	dw 0
915
.number_strings	dw 0
916
.length_to_end	dd 0
916
.length_to_end	dd 0
917
.temp		dd 0
917
.temp		dd 0
918
.offset		dd 0
918
.offset		dd 0
919
.cursor		dd 0
919
.cursor		dd 0
920
.cursor_temp	dd 0
920
.cursor_temp	dd 0
921
.shblock_beg	dd 0
921
.shblock_beg	dd 0
922
.shblock_end	dd 0
922
.shblock_end	dd 0
923
;--------------------------------------------------------------------
923
;--------------------------------------------------------------------
924
align	4
924
align	4
925
main_area:
925
main_area:
926
	mov	ecx,[number_strings]
926
	mov	ecx,[number_strings]
927
	mov	[.number_strings],cx
927
	mov	[.number_strings],cx
928
	push	[len_str_scr]
928
	push	[len_str_scr]
929
	pop	[.len_str_scr]
929
	pop	[.len_str_scr]
930
	mov	eax,[ready_screen_buffer.string_size]
930
	mov	eax,[ready_screen_buffer.string_size]
931
	shr	eax,1
931
	shr	eax,1
932
	mov	[.string_size],eax
932
	mov	[.string_size],eax
933
	mov	edi,[screen_table]
933
	mov	edi,[screen_table]
934
	mov	edi,[edi]
934
	mov	edi,[edi]
935
	cmp	[file_size],edi
935
	cmp	[file_size],edi
936
	jbe	.4
936
	jbe	.4
937
	xor	edx,edx	;¯®«§ã­®ª
937
	xor	edx,edx	;¯®«§ã­®ª
938
	mov	ebx,[scroll_bar_data_vertical.max_area]
938
	mov	ebx,[scroll_bar_data_vertical.max_area]
939
	sub	ebx,[scroll_bar_data_vertical.cur_area]
939
	sub	ebx,[scroll_bar_data_vertical.cur_area]
940
	mov	ecx,[file_size]
940
	mov	ecx,[file_size]
941
	mov	eax,[current_offset]
941
	mov	eax,[current_offset]
942
	test	eax,eax
942
	test	eax,eax
943
	jnz	.3
943
	jnz	.3
944
	inc	eax
944
	inc	eax
945
.3:
945
.3:
946
	mul	ebx
946
	mul	ebx
947
	test	ecx,ecx
947
	test	ecx,ecx
948
	jnz	.5
948
	jnz	.5
949
	inc	ecx
949
	inc	ecx
950
.5:
950
.5:
951
	div	ecx
951
	div	ecx
952
	mov	[scroll_bar_data_vertical.position],eax
952
	mov	[scroll_bar_data_vertical.position],eax
953
 
953
 
954
	mcall	SF_MOUSE_GET,SSF_BUTTON	;ª¯®¯ª 	¬ëè¨ ­ ¦ â  - ­¥â á¬ëá«  ¯¥à¥à¨á®¢ë¢ âì ScrollBar
954
	mcall	SF_MOUSE_GET,SSF_BUTTON	;ª¯®¯ª 	¬ëè¨ ­ ¦ â  - ­¥â á¬ëá«  ¯¥à¥à¨á®¢ë¢ âì ScrollBar
955
	test	eax,eax
955
	test	eax,eax
956
	jnz	.4
956
	jnz	.4
957
	push	dword scroll_bar_data_vertical
957
	push	dword scroll_bar_data_vertical
958
	call	[scrollbar_ver_mouse]
958
	call	[scrollbar_ver_mouse]
959
 
959
 
960
	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
960
	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
961
	call	[scrollbar_ver_draw]
961
	call	[scrollbar_ver_draw]
962
 
962
 
963
;	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
963
;	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
964
;	call	[scrollbar_ver_draw]
964
;	call	[scrollbar_ver_draw]
965
 
965
 
966
;	xor	eax,eax
966
;	xor	eax,eax
967
;	inc	eax
967
;	inc	eax
968
;	mov	[scroll_bar_data_vertical.all_redraw],eax
968
;	mov	[scroll_bar_data_vertical.all_redraw],eax
969
;	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
969
;	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
970
;	call	[scrollbar_ver_draw]
970
;	call	[scrollbar_ver_draw]
971
;	xor	eax,eax	;reset	all_redraw	flag
971
;	xor	eax,eax	;reset	all_redraw	flag
972
;	mov	[scroll_bar_data_vertical.all_redraw],eax
972
;	mov	[scroll_bar_data_vertical.all_redraw],eax
973
 
973
 
974
.4:
974
.4:
975
	mov	esi,0x000001	;梥⠨ ç¨á«® ¡¨â ­  ¯¨ªá¥«ì
975
	mov	esi,0x000001	;梥⠨ ç¨á«® ¡¨â ­  ¯¨ªá¥«ì
976
	mov	edx,FIRST_HEX	;ª®®à¤¨­ âë ¯¥à¢®£® hex
976
	mov	edx,FIRST_HEX	;ª®®à¤¨­ âë ¯¥à¢®£® hex
977
	call	show_current_offset
977
	call	show_current_offset
978
	mov	edi,[screen_table]
978
	mov	edi,[screen_table]
979
	add	edi,4
979
	add	edi,4
980
	mov	ecx,[beg_str_scr]
980
	mov	ecx,[beg_str_scr]
981
	sub	[.string_size],ecx
981
	sub	[.string_size],ecx
982
	shl	ecx,1
982
	shl	ecx,1
983
	add	edi,ecx
983
	add	edi,ecx
984
.out:
984
.out:
985
	push	edi
985
	push	edi
986
	movzx	ebx,byte [edi]
986
	movzx	ebx,byte [edi]
987
	cmp	bl,128	;¯à®¢¥àª  ­  ¯à¨­ ¤«¥¦­®áâì ᨬ¢®«  ª à áè¨à¥­­®© â ¡«¨æ¥
987
	cmp	bl,128	;¯à®¢¥àª  ­  ¯à¨­ ¤«¥¦­®áâì ᨬ¢®«  ª à áè¨à¥­­®© â ¡«¨æ¥
988
	jb	.7
988
	jb	.7
989
	add	ebx,[codepage_offset]
989
	add	ebx,[codepage_offset]
990
.7:
990
.7:
991
	movzx	edi,byte [edi+1]
991
	movzx	edi,byte [edi+1]
992
	lea	edi,[(edi*2-0x40)]
992
	lea	edi,[(edi*2-0x40)]
993
	add	edi,palitra
993
	add	edi,palitra
994
	shl	bx,4
994
	shl	bx,4
995
	add	ebx,font_buffer
995
	add	ebx,font_buffer
996
	mov	ecx,8*65536+16
996
	mov	ecx,8*65536+16
997
	mov	ebp,0
997
	mov	ebp,0
998
	mcall	SF_PUT_IMAGE_EXT
998
	mcall	SF_PUT_IMAGE_EXT
999
	pop	edi
999
	pop	edi
1000
 
1000
 
1001
	add	edi,2
1001
	add	edi,2
1002
	add	edx,8*65536
1002
	add	edx,8*65536
1003
 
1003
 
1004
	dec	[.len_str_scr]
1004
	dec	[.len_str_scr]
1005
	jz	.loop_str
1005
	jz	.loop_str
1006
	dec	[.string_size]
1006
	dec	[.string_size]
1007
	jz	.next_string
1007
	jz	.next_string
1008
 
1008
 
1009
	push	edi
1009
	push	edi
1010
	movzx	ebx,byte [edi]
1010
	movzx	ebx,byte [edi]
1011
	cmp	bl,128
1011
	cmp	bl,128
1012
	jb	.8
1012
	jb	.8
1013
	add	ebx,[codepage_offset]
1013
	add	ebx,[codepage_offset]
1014
.8:
1014
.8:
1015
	movzx	edi,byte [edi+1]
1015
	movzx	edi,byte [edi+1]
1016
	lea	edi,[(edi*2-0x40)]
1016
	lea	edi,[(edi*2-0x40)]
1017
	add	edi,palitra
1017
	add	edi,palitra
1018
	shl	bx,4
1018
	shl	bx,4
1019
	add	ebx,font_buffer
1019
	add	ebx,font_buffer
1020
	mcall
1020
	mcall
1021
	pop	edi
1021
	pop	edi
1022
 
1022
 
1023
	add	edi,2
1023
	add	edi,2
1024
	add	edx,8*65536
1024
	add	edx,8*65536
1025
 
1025
 
1026
	dec	[.len_str_scr]
1026
	dec	[.len_str_scr]
1027
	jz	.loop_str
1027
	jz	.loop_str
1028
	dec	[.string_size]
1028
	dec	[.string_size]
1029
	jnz	.out
1029
	jnz	.out
1030
	jz	.next_string	; WTF?
1030
	jz	.next_string	; WTF?
1031
;--------------------------------------------------------------------
1031
;--------------------------------------------------------------------
1032
.string_size	dd 0
1032
.string_size	dd 0
1033
.number_strings	dw 0
1033
.number_strings	dw 0
1034
.len_str_scr	dd 0
1034
.len_str_scr	dd 0
1035
;--------------------------------------------------------------------
1035
;--------------------------------------------------------------------
1036
@@:
1036
@@:
1037
	pushad
1037
	pushad
1038
	mov	ecx,edx
1038
	mov	ecx,edx
1039
	shl	ecx,16
1039
	shl	ecx,16
1040
	mov	ebx,edx
1040
	mov	ebx,edx
1041
	shr	ebx,16
1041
	shr	ebx,16
1042
	cmp	bx,[scroll_bar_data_vertical.x_pos]
1042
	cmp	bx,[scroll_bar_data_vertical.x_pos]
1043
	jge	.ls1
1043
	jge	.ls1
1044
	mov	ax,[scroll_bar_data_vertical.x_pos]
1044
	mov	ax,[scroll_bar_data_vertical.x_pos]
1045
	sub	ax,bx
1045
	sub	ax,bx
1046
	shl	ebx,16
1046
	shl	ebx,16
1047
	mov	bx,ax
1047
	mov	bx,ax
1048
	mov	cx,16
1048
	mov	cx,16
1049
	mcall	SF_DRAW_RECT,,,frgrd_color
1049
	mcall	SF_DRAW_RECT,,,frgrd_color
1050
.ls1:
1050
.ls1:
1051
	popad
1051
	popad
1052
	jmp	@f
1052
	jmp	@f
1053
;--------------------------------------------------------------------
1053
;--------------------------------------------------------------------
1054
.loop_str:
1054
.loop_str:
1055
	bt	[flags],6
1055
	bt	[flags],6
1056
	jc	@b
1056
	jc	@b
1057
@@:
1057
@@:
1058
	dec	[.string_size]
1058
	dec	[.string_size]
1059
	jz	.next_string
1059
	jz	.next_string
1060
	add	edi,2
1060
	add	edi,2
1061
	add	edx,8*65536
1061
	add	edx,8*65536
1062
	jmp	@b
1062
	jmp	@b
1063
;--------------------------------------
1063
;--------------------------------------
1064
@@:;®ç¨á⪠ ä®­®¢ë¬ 梥⮬ ­¥§ ªà è¥­­ëå ®¡« á⥩
1064
@@:;®ç¨á⪠ ä®­®¢ë¬ 梥⮬ ­¥§ ªà è¥­­ëå ®¡« á⥩
1065
	pushad
1065
	pushad
1066
	ror	edx,16
1066
	ror	edx,16
1067
	mov	dx,16
1067
	mov	dx,16
1068
	mov	ecx,edx
1068
	mov	ecx,edx
1069
	mov	edx,frgrd_color
1069
	mov	edx,frgrd_color
1070
	movzx	ebx,[scroll_bar_data_vertical.x_pos]
1070
	movzx	ebx,[scroll_bar_data_vertical.x_pos]
1071
	
1071
	
1072
	mov	ax,[scroll_bar_data_vertical.x_size]
1072
	mov	ax,[scroll_bar_data_vertical.x_size]
1073
	test	ax,ax
1073
	test	ax,ax
1074
	jnz	.no_inc_ebx
1074
	jnz	.no_inc_ebx
1075
	inc	ebx
1075
	inc	ebx
1076
.no_inc_ebx:
1076
.no_inc_ebx:
1077
	sub	ecx,2*65536
1077
	sub	ecx,2*65536
1078
	mov	cx,2
1078
	mov	cx,2
1079
	mcall	SF_DRAW_RECT
1079
	mcall	SF_DRAW_RECT
1080
	popad
1080
	popad
1081
 
1081
 
1082
	pushad
1082
	pushad
1083
	mov	ecx,edx
1083
	mov	ecx,edx
1084
	shl	ecx,16
1084
	shl	ecx,16
1085
	mov	ebx,edx
1085
	mov	ebx,edx
1086
	shr	ebx,16
1086
	shr	ebx,16
1087
	cmp	bx,[scroll_bar_data_vertical.x_pos]
1087
	cmp	bx,[scroll_bar_data_vertical.x_pos]
1088
	jge	.10
1088
	jge	.10
1089
	mov	ax,[scroll_bar_data_vertical.x_pos]
1089
	mov	ax,[scroll_bar_data_vertical.x_pos]
1090
	sub	ax,bx
1090
	sub	ax,bx
1091
	shl	ebx,16
1091
	shl	ebx,16
1092
	mov	bx,ax
1092
	mov	bx,ax
1093
	mov	cx,16
1093
	mov	cx,16
1094
	
1094
	
1095
	mov	ax,[scroll_bar_data_vertical.x_size]
1095
	mov	ax,[scroll_bar_data_vertical.x_size]
1096
	test	ax,ax
1096
	test	ax,ax
1097
	jnz	.no_inc_ebx_2
1097
	jnz	.no_inc_ebx_2
1098
	inc	ebx
1098
	inc	ebx
1099
.no_inc_ebx_2:
1099
.no_inc_ebx_2:
1100
	mcall	SF_DRAW_RECT,,,frgrd_color
1100
	mcall	SF_DRAW_RECT,,,frgrd_color
1101
.10:
1101
.10:
1102
	popad
1102
	popad
1103
	jmp	@f
1103
	jmp	@f
1104
;--------------------------------------------------------------------
1104
;--------------------------------------------------------------------
1105
.next_string:
1105
.next_string:
1106
	bt	[flags],6
1106
	bt	[flags],6
1107
	jc	@b
1107
	jc	@b
1108
@@:
1108
@@:
1109
	push	[len_str_scr]
1109
	push	[len_str_scr]
1110
	pop	[.len_str_scr]
1110
	pop	[.len_str_scr]
1111
	mov	eax,[ready_screen_buffer.string_size]
1111
	mov	eax,[ready_screen_buffer.string_size]
1112
	shr	eax,1
1112
	shr	eax,1
1113
	mov	[.string_size],eax	;ª®à४æ¨ï ᬥ饭¨ï ¢å®¤­ëå ¤ ­­ëå
1113
	mov	[.string_size],eax	;ª®à४æ¨ï ᬥ饭¨ï ¢å®¤­ëå ¤ ­­ëå
1114
	mov	ecx,[beg_str_scr]
1114
	mov	ecx,[beg_str_scr]
1115
	sub	[.string_size],ecx
1115
	sub	[.string_size],ecx
1116
	sub	eax,ecx
1116
	sub	eax,ecx
1117
	shl	ecx,1
1117
	shl	ecx,1
1118
	add	edi,ecx
1118
	add	edi,ecx
1119
 
1119
 
1120
	shl	eax,19
1120
	shl	eax,19
1121
	sub	edx,eax
1121
	sub	edx,eax
1122
	add	edx,18
1122
	add	edx,18
1123
	dec	[.number_strings]
1123
	dec	[.number_strings]
1124
	jnz	.out
1124
	jnz	.out
1125
	btr	[flags],6
1125
	btr	[flags],6
1126
	jmp	end_draw
1126
	jmp	end_draw
1127
;--------------------------------------------------------------------
1127
;--------------------------------------------------------------------
1128
align	4
1128
align	4
1129
show_current_offset:
1129
show_current_offset:
1130
	pushad
1130
	pushad
1131
	push	edx	;¢ë¢®¤ ⥪ã饣® ᬥ饭¨ï ¢ ä ©«¥
1131
	push	edx	;¢ë¢®¤ ⥪ã饣® ᬥ饭¨ï ¢ ä ©«¥
1132
	mov	edi,palitra.5
1132
	mov	edi,palitra.5
1133
	mov	eax,[begin_offset]
1133
	mov	eax,[begin_offset]
1134
	mov	ebx,[cursor]
1134
	mov	ebx,[cursor]
1135
	dec	ebx
1135
	dec	ebx
1136
	shr	bx,1
1136
	shr	bx,1
1137
	add	ebx,eax
1137
	add	ebx,eax
1138
	mov	[current_offset],ebx
1138
	mov	[current_offset],ebx
1139
	mov	edx,[low_area]
1139
	mov	edx,[low_area]
1140
	lea	eax,[8*8+8+8]
1140
	lea	eax,[8*8+8+8]
1141
	shl	eax,16
1141
	shl	eax,16
1142
	add	edx,eax
1142
	add	edx,eax
1143
	mov	ecx,8
1143
	mov	ecx,8
1144
	call	hex_output
1144
	call	hex_output
1145
	lea	eax,[8*8+14]
1145
	lea	eax,[8*8+14]
1146
	shl	eax,16
1146
	shl	eax,16
1147
	add	edx,eax
1147
	add	edx,eax
1148
	push	edx
1148
	push	edx
1149
	;¤¢®¨ç­®¥ §­ ç¥­¨¥ ¡ ©â 
1149
	;¤¢®¨ç­®¥ §­ ç¥­¨¥ ¡ ©â 
1150
	mov	edx,[file_buffer]
1150
	mov	edx,[file_buffer]
1151
	add	edx,ebx;[current_offset]
1151
	add	edx,ebx;[current_offset]
1152
	xor	eax,eax
1152
	xor	eax,eax
1153
	cmp	ebx,[file_size]
1153
	cmp	ebx,[file_size]
1154
	jae	@f
1154
	jae	@f
1155
	mov	al,[edx]
1155
	mov	al,[edx]
1156
@@:
1156
@@:
1157
	mov	bx,2
1157
	mov	bx,2
1158
	mov	ebp,8
1158
	mov	ebp,8
1159
	xor	ecx,ecx
1159
	xor	ecx,ecx
1160
	xor	edx,edx
1160
	xor	edx,edx
1161
@@:
1161
@@:
1162
	div	bx
1162
	div	bx
1163
	or	cl,dl
1163
	or	cl,dl
1164
	ror	ecx,4
1164
	ror	ecx,4
1165
	dec	ebp
1165
	dec	ebp
1166
	jnz	@b
1166
	jnz	@b
1167
	mov	ebx,ecx
1167
	mov	ebx,ecx
1168
	pop	edx
1168
	pop	edx
1169
	mov	ecx,8
1169
	mov	ecx,8
1170
	call	hex_output
1170
	call	hex_output
1171
 
1171
 
1172
	;¤¥áïâ¨ç­®¥
1172
	;¤¥áïâ¨ç­®¥
1173
	push	edx
1173
	push	edx
1174
	mov	edx,[file_buffer]
1174
	mov	edx,[file_buffer]
1175
	mov	ebx,[current_offset]
1175
	mov	ebx,[current_offset]
1176
	add	edx,ebx
1176
	add	edx,ebx
1177
	xor	eax,eax
1177
	xor	eax,eax
1178
	inc	ebx
1178
	inc	ebx
1179
	cmp	ebx,[file_size]	;0 ¥á«¨ §  £à ­¨æ¥© ä ©« 
1179
	cmp	ebx,[file_size]	;0 ¥á«¨ §  £à ­¨æ¥© ä ©« 
1180
	jb	@f
1180
	jb	@f
1181
	mov	edx,D_END
1181
	mov	edx,D_END
1182
@@:
1182
@@:
1183
	mov	al,[edx]
1183
	mov	al,[edx]
1184
	xor	ebx,ebx
1184
	xor	ebx,ebx
1185
;	mov	ebp,3
1185
;	mov	ebp,3
1186
	mov	cl,10
1186
	mov	cl,10
1187
@@:
1187
@@:
1188
	div	cl
1188
	div	cl
1189
	mov	bl,ah
1189
	mov	bl,ah
1190
	xor	ah,ah
1190
	xor	ah,ah
1191
	shl	ebx,8
1191
	shl	ebx,8
1192
	test	al,al
1192
	test	al,al
1193
;	dec	ebp
1193
;	dec	ebp
1194
	jnz	@b
1194
	jnz	@b
1195
	shr	ebx,8
1195
	shr	ebx,8
1196
	cmp	byte [edx],100
1196
	cmp	byte [edx],100
1197
	jb	.1
1197
	jb	.1
1198
	mov	ebp,3
1198
	mov	ebp,3
1199
	jmp	@f
1199
	jmp	@f
1200
;--------------------------------------
1200
;--------------------------------------
1201
.1:
1201
.1:
1202
	mov	ebp,1
1202
	mov	ebp,1
1203
	cmp	byte [edx],10
1203
	cmp	byte [edx],10
1204
	jb	@f
1204
	jb	@f
1205
	mov	ebp,2
1205
	mov	ebp,2
1206
@@:
1206
@@:
1207
	mov	al,bl
1207
	mov	al,bl
1208
	shr	ebx,8
1208
	shr	ebx,8
1209
	cmp	al,10
1209
	cmp	al,10
1210
	sbb	al,69h
1210
	sbb	al,69h
1211
	das
1211
	das
1212
	shl	eax,8
1212
	shl	eax,8
1213
;	test	bx,bx
1213
;	test	bx,bx
1214
	dec	ebp
1214
	dec	ebp
1215
	jnz	@b
1215
	jnz	@b
1216
 
1216
 
1217
	mov	ecx,8*65536+16
1217
	mov	ecx,8*65536+16
1218
	pop	edx
1218
	pop	edx
1219
	add	edx,(8*8+30)*65536;268*65536
1219
	add	edx,(8*8+30)*65536;268*65536
1220
	mov	edi,palitra.5
1220
	mov	edi,palitra.5
1221
	mov	ebp,0
1221
	mov	ebp,0
1222
	push	dword 3
1222
	push	dword 3
1223
@@:
1223
@@:
1224
	shr	eax,8
1224
	shr	eax,8
1225
	xor	ebx,ebx
1225
	xor	ebx,ebx
1226
	mov	bl,al
1226
	mov	bl,al
1227
	shl	ebx,4
1227
	shl	ebx,4
1228
	add	ebx,font_buffer
1228
	add	ebx,font_buffer
1229
	push	eax
1229
	push	eax
1230
	mcall	SF_PUT_IMAGE_EXT
1230
	mcall	SF_PUT_IMAGE_EXT
1231
	pop	eax
1231
	pop	eax
1232
	sub	edx,8*65536
1232
	sub	edx,8*65536
1233
	dec	dword [esp]
1233
	dec	dword [esp]
1234
	jnz	@b
1234
	jnz	@b
1235
	add	esp,4
1235
	add	esp,4
1236
;	mov	edx,[low_area]	;¢ë¢®¤ esp
1236
;	mov	edx,[low_area]	;¢ë¢®¤ esp
1237
;	add	edx,298*65536
1237
;	add	edx,298*65536
1238
;	mov	ebx,esp
1238
;	mov	ebx,esp
1239
;	mov	ecx,8
1239
;	mov	ecx,8
1240
;	call	hex_output
1240
;	call	hex_output
1241
	pop	edx
1241
	pop	edx
1242
	popad
1242
	popad
1243
	ret
1243
	ret
1244
;---------------------------------------------------------------------
1244
;---------------------------------------------------------------------
1245
align	4
1245
align	4
1246
hex_output:	;¢ë¢®¤ hex áâப¨ ¨§ 8 ᨬ¢®«®¢
1246
hex_output:	;¢ë¢®¤ hex áâப¨ ¨§ 8 ᨬ¢®«®¢
1247
	pushad
1247
	pushad
1248
	mov	edi,(hex8_string)	; ¤à¥á ¡ãä¥à 
1248
	mov	edi,(hex8_string)	; ¤à¥á ¡ãä¥à 
1249
	mov	dword [edi],0x30303030
1249
	mov	dword [edi],0x30303030
1250
	mov	dword [edi+4],0x30303030
1250
	mov	dword [edi+4],0x30303030
1251
	push	ecx
1251
	push	ecx
1252
.1:
1252
.1:
1253
	mov	eax,ebx
1253
	mov	eax,ebx
1254
	and	eax,0xF
1254
	and	eax,0xF
1255
	cmp	al,10
1255
	cmp	al,10
1256
	sbb	al,69h
1256
	sbb	al,69h
1257
	das
1257
	das
1258
	mov	[edi+ecx-1],al
1258
	mov	[edi+ecx-1],al
1259
	shr	ebx,4
1259
	shr	ebx,4
1260
	loop	.1
1260
	loop	.1
1261
	mov	ecx,8*65536+16
1261
	mov	ecx,8*65536+16
1262
.2:
1262
.2:
1263
	push	edi
1263
	push	edi
1264
	xor	ebx,ebx
1264
	xor	ebx,ebx
1265
	mov	al,[edi]
1265
	mov	al,[edi]
1266
	shl	eax,4
1266
	shl	eax,4
1267
	add	eax,font_buffer
1267
	add	eax,font_buffer
1268
	xchg	eax,ebx
1268
	xchg	eax,ebx
1269
	mov	edi,palitra.5
1269
	mov	edi,palitra.5
1270
	mov	ebp,0
1270
	mov	ebp,0
1271
	mcall	SF_PUT_IMAGE_EXT
1271
	mcall	SF_PUT_IMAGE_EXT
1272
	add	edx,8*65536
1272
	add	edx,8*65536
1273
	pop	edi
1273
	pop	edi
1274
	inc	edi
1274
	inc	edi
1275
	dec	dword [esp]
1275
	dec	dword [esp]
1276
	jnz	.2
1276
	jnz	.2
1277
	add	esp,4
1277
	add	esp,4
1278
	popad
1278
	popad
1279
	ret
1279
	ret
1280
;------------------------------------------------------
1280
;------------------------------------------------------
1281
align	4
1281
align	4
1282
input_from_keyboard:
1282
input_from_keyboard:
1283
	xor	al,al
1283
	xor	al,al
1284
	sub	ah,48
1284
	sub	ah,48
1285
	cmp	ah,9
1285
	cmp	ah,9
1286
	jle	.1
1286
	jle	.1
1287
	sub	ah,7
1287
	sub	ah,7
1288
	cmp	ah,15
1288
	cmp	ah,15
1289
	jle	.1
1289
	jle	.1
1290
	sub	ah,32
1290
	sub	ah,32
1291
.1:
1291
.1:
1292
	bt	[flags],1
1292
	bt	[flags],1
1293
	jnc	.2
1293
	jnc	.2
1294
	mov	ebx,[cursor]
1294
	mov	ebx,[cursor]
1295
	and	bl,1
1295
	and	bl,1
1296
	jz	.2
1296
	jz	.2
1297
	inc	[file_size]
1297
	inc	[file_size]
1298
	call	raspred_mem
1298
	call	raspred_mem
1299
	mov	edi,[current_offset]
1299
	mov	edi,[current_offset]
1300
	add	edi,[file_buffer]
1300
	add	edi,[file_buffer]
1301
	mov	esi,[file_buffer]
1301
	mov	esi,[file_buffer]
1302
	add	esi,[file_size]
1302
	add	esi,[file_size]
1303
	dec	esi
1303
	dec	esi
1304
@@:
1304
@@:
1305
	cmp	edi,esi
1305
	cmp	edi,esi
1306
	ja	@f
1306
	ja	@f
1307
	mov	bl,[esi]
1307
	mov	bl,[esi]
1308
	mov	[esi+1],bl
1308
	mov	[esi+1],bl
1309
	dec	esi
1309
	dec	esi
1310
	jmp	@b
1310
	jmp	@b
1311
;--------------------------------------
1311
;--------------------------------------
1312
@@:
1312
@@:
1313
	call	show_file_size
1313
	call	show_file_size
1314
	mov	ebx,[current_offset]
1314
	mov	ebx,[current_offset]
1315
	add	ebx,[file_buffer]
1315
	add	ebx,[file_buffer]
1316
	mov	byte [ebx],0
1316
	mov	byte [ebx],0
1317
.2:
1317
.2:
1318
	mov	ecx,[current_offset]
1318
	mov	ecx,[current_offset]
1319
	add	ecx,[file_buffer]
1319
	add	ecx,[file_buffer]
1320
	;á¬.	¯¥à¢ãî	¢¥àá¨î	heed.asm
1320
	;á¬.	¯¥à¢ãî	¢¥àá¨î	heed.asm
1321
	mov	dl,[ecx]	;®à¨£¨­ «ì­ë© ¡ ©â
1321
	mov	dl,[ecx]	;®à¨£¨­ «ì­ë© ¡ ©â
1322
	mov	ebx,[cursor]
1322
	mov	ebx,[cursor]
1323
	and	bl,1	;­¥ç¥â - । ªâ¨à㥬 áâ à訩 ¯®«ã¡ ©â
1323
	and	bl,1	;­¥ç¥â - । ªâ¨à㥬 áâ à訩 ¯®«ã¡ ©â
1324
	jnz	.hi_half_byte ;çñâ - áâ à訩
1324
	jnz	.hi_half_byte ;çñâ - áâ à訩
1325
	and	dl,0xf0	;®¡­ã«ï¥¬ ¬«. ¯-¡ ©â ®à¨£¨­ «ì­®£® ¡ ©â 
1325
	and	dl,0xf0	;®¡­ã«ï¥¬ ¬«. ¯-¡ ©â ®à¨£¨­ «ì­®£® ¡ ©â 
1326
	jmp	.patch_byte
1326
	jmp	.patch_byte
1327
;--------------------------------------
1327
;--------------------------------------
1328
.hi_half_byte:	;®¤­®¢à¥¬¥­­® ᤢ¨£ ¥¬ ­ã¦­®¥ §­ ç¥­¨¥ ¢ áâ ¯-â ¨ ®¡­ã«ï¥¬ ¬« ¤è¨©
1328
.hi_half_byte:	;®¤­®¢à¥¬¥­­® ᤢ¨£ ¥¬ ­ã¦­®¥ §­ ç¥­¨¥ ¢ áâ ¯-â ¨ ®¡­ã«ï¥¬ ¬« ¤è¨©
1329
	shl	ax,4
1329
	shl	ax,4
1330
	and	dl,0x0f	;®¡­ã«ï¥¬ áâ à訩 ¯®«ã¡ ©â 㠮ਣ¨­ «ì­®£® ¡ ©â 
1330
	and	dl,0x0f	;®¡­ã«ï¥¬ áâ à訩 ¯®«ã¡ ©â 㠮ਣ¨­ «ì­®£® ¡ ©â 
1331
.patch_byte:
1331
.patch_byte:
1332
	or	ah,dl
1332
	or	ah,dl
1333
	mov	[ecx],ah
1333
	mov	[ecx],ah
1334
	jmp	RIGHT
1334
	jmp	RIGHT
1335
;--------------------------------------------------------------------
1335
;--------------------------------------------------------------------
1336
raspred_mem:
1336
raspred_mem:
1337
	pushad
1337
	pushad
1338
	xor	edx,edx
1338
	xor	edx,edx
1339
	mov	ecx,4096
1339
	mov	ecx,4096
1340
	mov	eax,[file_size]
1340
	mov	eax,[file_size]
1341
	inc	eax
1341
	inc	eax
1342
	div	ecx
1342
	div	ecx
1343
	cmp	eax,[prev_f_size_bl]
1343
	cmp	eax,[prev_f_size_bl]
1344
	ja	@f
1344
	ja	@f
1345
	je	.ret
1345
	je	.ret
1346
	cmp	[file_size],4096
1346
	cmp	[file_size],4096
1347
	jbe	.ret
1347
	jbe	.ret
1348
	mov	[prev_f_size_bl],eax
1348
	mov	[prev_f_size_bl],eax
1349
	xor	edx,edx
1349
	xor	edx,edx
1350
	mul	ecx
1350
	mul	ecx
1351
	mov	ecx,eax
1351
	mov	ecx,eax
1352
	jmp	.1
1352
	jmp	.1
1353
;--------------------------------------
1353
;--------------------------------------
1354
@@:
1354
@@:
1355
	mov	[prev_f_size_bl],eax
1355
	mov	[prev_f_size_bl],eax
1356
	xor	edx,edx
1356
	xor	edx,edx
1357
	mul	ecx
1357
	mul	ecx
1358
	add	ecx,eax
1358
	add	ecx,eax
1359
.1:
1359
.1:
1360
	mcall	SF_SYS_MISC,SSF_MEM_REALLOC,,[file_buffer]
1360
	mcall	SF_SYS_MISC,SSF_MEM_REALLOC,,[file_buffer]
1361
.ret:
1361
.ret:
1362
	popad
1362
	popad
1363
	ret
1363
	ret
1364
;--------------------------------------------------------------------
1364
;--------------------------------------------------------------------
1365
align	4
1365
align	4
1366
show_file_size:
1366
show_file_size:
1367
	mov	ebx,[file_size]
1367
	mov	ebx,[file_size]
1368
	mov	edx,[low_area];
1368
	mov	edx,[low_area];
1369
	mov	esi,1
1369
	mov	esi,1
1370
	mov	ecx,8
1370
	mov	ecx,8
1371
	call	hex_output
1371
	call	hex_output
1372
	ret
1372
	ret
1373
;---------------------------------------------------------------------
1373
;---------------------------------------------------------------------
1374
align	4
1374
align	4
1375
create_title:
1375
create_title:
1376
	mov	edi,title_buf
1376
	mov	edi,title_buf
1377
	mov	esi,title
1377
	mov	esi,title
1378
	cld
1378
	cld
1379
@@:
1379
@@:
1380
	lodsb
1380
	lodsb
1381
	stosb
1381
	stosb
1382
	test	al,al
1382
	test	al,al
1383
	jne	@b
1383
	jne	@b
1384
	mov	[edi-1],byte ' '
1384
	mov	[edi-1],byte ' '
1385
	mov	esi,fname_buf
1385
	mov	esi,fname_buf
1386
@@:
1386
@@:
1387
	lodsb
1387
	lodsb
1388
	stosb
1388
	stosb
1389
	test	al,al
1389
	test	al,al
1390
	jne	@b
1390
	jne	@b
1391
	ret
1391
	ret
1392
;---------------------------------------------------------------------
1392
;---------------------------------------------------------------------
1393
align	4
1393
align	4
1394
draw_window:
1394
draw_window:
1395
	call	create_title
1395
	call	create_title
1396
	xor	esi,esi
1396
	xor	esi,esi
1397
	mcall	SF_CREATE_WINDOW,100*65536+653,100*65536+360,((0x73 shl 24) + frgrd_color),,title_buf	;title
1397
	mcall	SF_CREATE_WINDOW,100*65536+653,100*65536+360,((0x73 shl 24) + frgrd_color),,title_buf	;title
1398
	mcall	SF_THREAD_INFO,threath_buf,-1
1398
	mcall	SF_THREAD_INFO,threath_buf,-1
1399
;	cmp	byte [threath_buf+70],3	;®ª­® á¢ñà­ãâ® ¢ § £®«®¢®ª?
1399
;	cmp	byte [threath_buf+70],3	;®ª­® á¢ñà­ãâ® ¢ § £®«®¢®ª?
1400
;	jnae	@f
1400
;	jnae	@f
1401
	mov	eax,[threath_buf+70]
1401
	mov	eax,[threath_buf+70]
1402
	test	eax,10b
1402
	test	eax,10b
1403
	jnz	.@d
1403
	jnz	.@d
1404
	test	eax,100b
1404
	test	eax,100b
1405
	jz	@f
1405
	jz	@f
1406
.@d:
1406
.@d:
1407
	call	end_draw
1407
	call	end_draw
1408
	ret
1408
	ret
1409
;--------------------------------------
1409
;--------------------------------------
1410
@@:
1410
@@:
1411
	cmp	dword [threath_buf+66],(24*4)	;¯à®¢¥àª  ¬¨­¨¬ «ì­®© ¢ëá®âë
1411
	cmp	dword [threath_buf+66],(24*4)	;¯à®¢¥àª  ¬¨­¨¬ «ì­®© ¢ëá®âë
1412
	jae	@f
1412
	jae	@f
1413
	mov	esi,dword [threath_buf+46]
1413
	mov	esi,dword [threath_buf+46]
1414
	sub	esi,dword [threath_buf+66]
1414
	sub	esi,dword [threath_buf+66]
1415
	add	esi,24*4
1415
	add	esi,24*4
1416
	mcall	SF_CHANGE_WINDOW,-1,-1,-1,
1416
	mcall	SF_CHANGE_WINDOW,-1,-1,-1,
1417
	jmp	.@d
1417
	jmp	.@d
1418
;--------------------------------------
1418
;--------------------------------------
1419
@@:
1419
@@:
1420
	cmp	dword [threath_buf+62],(26*6)	;¯à®¢¥àª  ¬¨­¨¬ «ì­®© è¨à¨­ë
1420
	cmp	dword [threath_buf+62],(26*6)	;¯à®¢¥àª  ¬¨­¨¬ «ì­®© è¨à¨­ë
1421
	jae	@f
1421
	jae	@f
1422
	mov	edx,dword [threath_buf+42]
1422
	mov	edx,dword [threath_buf+42]
1423
	sub	edx,dword [threath_buf+62]
1423
	sub	edx,dword [threath_buf+62]
1424
	add	edx,26*6
1424
	add	edx,26*6
1425
	mcall	SF_CHANGE_WINDOW,-1,-1,,-1
1425
	mcall	SF_CHANGE_WINDOW,-1,-1,,-1
1426
	jmp	.@d
1426
	jmp	.@d
1427
;--------------------------------------
1427
;--------------------------------------
1428
@@:
1428
@@:
1429
	mov	eax,[file_size]
1429
	mov	eax,[file_size]
1430
	mov	ebx,[bytes_per_line]
1430
	mov	ebx,[bytes_per_line]
1431
	xor	edx,edx
1431
	xor	edx,edx
1432
	div	ebx
1432
	div	ebx
1433
	mov	[scroll_bar_data_vertical.x_size],0
1433
	mov	[scroll_bar_data_vertical.x_size],0
1434
	cmp	eax,[number_strings]
1434
	cmp	eax,[number_strings]
1435
	jl	@f
1435
	jl	@f
1436
	mov	[scroll_bar_data_vertical.x_size],scroll_width_size
1436
	mov	[scroll_bar_data_vertical.x_size],scroll_width_size
1437
@@:
1437
@@:
1438
	mov	eax,dword [threath_buf+62]	;è¨à¨­  ª«¨¥­â᪮© ®¡« áâ¨
1438
	mov	eax,dword [threath_buf+62]	;è¨à¨­  ª«¨¥­â᪮© ®¡« áâ¨
1439
	sub	ax,[scroll_bar_data_vertical.x_size]
1439
	sub	ax,[scroll_bar_data_vertical.x_size]
1440
	mov	[scroll_bar_data_vertical.x_pos],ax
1440
	mov	[scroll_bar_data_vertical.x_pos],ax
1441
	mov	eax,dword [threath_buf+66]	;¢ëá®â  ª«¨¥­â᪮© ®¡« áâ¨
1441
	mov	eax,dword [threath_buf+66]	;¢ëá®â  ª«¨¥­â᪮© ®¡« áâ¨
1442
	sub	eax,24+24-11
1442
	sub	eax,24+24-11
1443
	mov	[scroll_bar_data_vertical.y_size],ax
1443
	mov	[scroll_bar_data_vertical.y_size],ax
1444
	mov	ebx,eax
1444
	mov	ebx,eax
1445
	push	eax
1445
	push	eax
1446
	add	ebx,20
1446
	add	ebx,20
1447
	mov	[scroll_bar_data_vertical.max_area],ebx
1447
	mov	[scroll_bar_data_vertical.max_area],ebx
1448
	mov	ebx,[scroll_bar_data_vertical.btn_height]
1448
	mov	ebx,[scroll_bar_data_vertical.btn_height]
1449
	shl	ebx,1
1449
	shl	ebx,1
1450
	add	ebx,20
1450
	add	ebx,20
1451
	mov	[scroll_bar_data_vertical.cur_area],ebx
1451
	mov	[scroll_bar_data_vertical.cur_area],ebx
1452
	pop	eax
1452
	pop	eax
1453
	sub	eax,3
1453
	sub	eax,3
1454
	mov	ebx,18
1454
	mov	ebx,18
1455
	xor	edx,edx
1455
	xor	edx,edx
1456
	div	bx
1456
	div	bx
1457
	mov	[number_strings],eax	;ª®«-¢® hex áâப ¢ ®ª­¥
1457
	mov	[number_strings],eax	;ª®«-¢® hex áâப ¢ ®ª­¥
1458
	mov	ebx,[bytes_per_line]
1458
	mov	ebx,[bytes_per_line]
1459
	mul	ebx
1459
	mul	ebx
1460
	mov	edi,[screen_table]	;ª®«-¢® ¡ ©â®¢ ¤«ï ¢ë¢®¤ 
1460
	mov	edi,[screen_table]	;ª®«-¢® ¡ ©â®¢ ¤«ï ¢ë¢®¤ 
1461
	mov	dword [edi],eax
1461
	mov	dword [edi],eax
1462
 
1462
 
1463
	push	eax
1463
	push	eax
1464
 
1464
 
1465
	mov	ebx,dword [threath_buf+62]
1465
	mov	ebx,dword [threath_buf+62]
1466
	inc	ebx
1466
	inc	ebx
1467
	mov	ecx,(FIRST_HEX-18)
1467
	mov	ecx,(FIRST_HEX-18)
1468
	ror	ecx,16
1468
	ror	ecx,16
1469
	mov	cx,18
1469
	mov	cx,18
1470
	ror	ecx,16
1470
	ror	ecx,16
1471
	mcall	SF_DRAW_RECT,,,frgrd_color	;¯®«®á  ᢥàåã
1471
	mcall	SF_DRAW_RECT,,,frgrd_color	;¯®«®á  ᢥàåã
1472
 
1472
 
1473
	mcall	,,18,panel_clr1	;¢¥àå­ïï ¯ ­¥«ì
1473
	mcall	,,18,panel_clr1	;¢¥àå­ïï ¯ ­¥«ì
1474
 
1474
 
1475
	dec	ebx
1475
	dec	ebx
1476
	mcall	SF_DRAW_LINE,,<18,18>,panel_clr2
1476
	mcall	SF_DRAW_LINE,,<18,18>,panel_clr2
1477
	mov	ecx,dword [threath_buf+66]
1477
	mov	ecx,dword [threath_buf+66]
1478
	sub	cx,18
1478
	sub	cx,18
1479
	push	cx
1479
	push	cx
1480
	shl	ecx,16
1480
	shl	ecx,16
1481
	pop	cx
1481
	pop	cx
1482
	mcall	,,,panel_clr3	;­¨¦­ïï ¯ ­¥«ì
1482
	mcall	,,,panel_clr3	;­¨¦­ïï ¯ ­¥«ì
1483
	inc	ebx
1483
	inc	ebx
1484
	add	ecx,1*65536
1484
	add	ecx,1*65536
1485
	mov	cx,18
1485
	mov	cx,18
1486
	mcall	SF_DRAW_RECT,,,panel_clr1
1486
	mcall	SF_DRAW_RECT,,,panel_clr1
1487
 
1487
 
1488
 
1488
 
1489
	mov	eax,dword [threath_buf+62]
1489
	mov	eax,dword [threath_buf+62]
1490
	sub	eax,scroll_width_size
1490
	sub	eax,scroll_width_size
1491
	shr	eax,3	;div 8
1491
	shr	eax,3	;div 8
1492
	mov	[len_str_scr],eax
1492
	mov	[len_str_scr],eax
1493
 
1493
 
1494
 
1494
 
1495
	mov	eax,[len_str_scr]
1495
	mov	eax,[len_str_scr]
1496
	shl	eax,1
1496
	shl	eax,1
1497
	cmp	eax,[ready_screen_buffer.string_size]
1497
	cmp	eax,[ready_screen_buffer.string_size]
1498
	jae	@f
1498
	jae	@f
1499
 
1499
 
1500
	mov	edi,[screen_table]
1500
	mov	edi,[screen_table]
1501
	mov	eax,[bytes_per_line]
1501
	mov	eax,[bytes_per_line]
1502
	sub	dword [edi],eax
1502
	sub	dword [edi],eax
1503
	dec	[number_strings]
1503
	dec	[number_strings]
1504
 
1504
 
1505
@@:
1505
@@:
1506
	shr	ecx,16
1506
	shr	ecx,16
1507
	mov	edx,ecx
1507
	mov	edx,ecx
1508
	mov	ecx,(FIRST_HEX)
1508
	mov	ecx,(FIRST_HEX)
1509
	shr	ecx,16
1509
	shr	ecx,16
1510
	mov	eax,[number_strings]
1510
	mov	eax,[number_strings]
1511
	lea	ebx,[eax*8];*18
1511
	lea	ebx,[eax*8];*18
1512
	lea	ebx,[ebx*2]
1512
	lea	ebx,[ebx*2]
1513
	lea	eax,[eax*2]
1513
	lea	eax,[eax*2]
1514
	add	eax,ebx
1514
	add	eax,ebx
1515
	add	cx,ax
1515
	add	cx,ax
1516
	add	cx,21
1516
	add	cx,21
1517
	sub	dx,cx
1517
	sub	dx,cx
1518
	shl	ecx,16
1518
	shl	ecx,16
1519
	add	cx,dx
1519
	add	cx,dx
1520
	sub	ecx,1*65536
1520
	sub	ecx,1*65536
1521
	movzx	ebx,	word [scroll_bar_data_vertical.x_pos]
1521
	movzx	ebx,	word [scroll_bar_data_vertical.x_pos]
1522
	inc	ebx
1522
	inc	ebx
1523
	mcall	SF_DRAW_RECT,,,frgrd_color
1523
	mcall	SF_DRAW_RECT,,,frgrd_color
1524
 
1524
 
1525
	pop	eax
1525
	pop	eax
1526
 
1526
 
1527
	cmp	eax,[file_size]
1527
	cmp	eax,[file_size]
1528
	jge	@f
1528
	jge	@f
1529
;	push	dword scroll_bar_data_vertical
1529
;	push	dword scroll_bar_data_vertical
1530
;	call	[scrollbar_ver_mouse]
1530
;	call	[scrollbar_ver_mouse]
1531
	xor	eax,eax
1531
	xor	eax,eax
1532
	inc	eax
1532
	inc	eax
1533
	mov	[scroll_bar_data_vertical.all_redraw],eax
1533
	mov	[scroll_bar_data_vertical.all_redraw],eax
1534
	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
1534
	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
1535
	call	[scrollbar_ver_draw]
1535
	call	[scrollbar_ver_draw]
1536
	xor	eax,eax	;reset all_redraw flag
1536
	xor	eax,eax	;reset all_redraw flag
1537
	mov	[scroll_bar_data_vertical.all_redraw],eax
1537
	mov	[scroll_bar_data_vertical.all_redraw],eax
1538
@@:
1538
@@:
1539
	push	dword menu_data_1	;draw for Menu 1
1539
	push	dword menu_data_1	;draw for Menu 1
1540
	call	[menu_bar_draw]
1540
	call	[menu_bar_draw]
1541
	push	dword menu_data_2	;draw for Menu 2
1541
	push	dword menu_data_2	;draw for Menu 2
1542
	call	[menu_bar_draw]
1542
	call	[menu_bar_draw]
1543
	push	dword menu_data_3	;draw for Menu 3
1543
	push	dword menu_data_3	;draw for Menu 3
1544
	call	[menu_bar_draw]
1544
	call	[menu_bar_draw]
1545
 
1545
 
1546
;;;
1546
;;;
1547
 
1547
 
1548
	mov	eax,dword [threath_buf+66]
1548
	mov	eax,dword [threath_buf+66]
1549
	add	eax,8*65536-15
1549
	add	eax,8*65536-15
1550
	mov	[low_area],eax
1550
	mov	[low_area],eax
1551
 
1551
 
1552
	mov	ebx,[beg_str_scr]
1552
	mov	ebx,[beg_str_scr]
1553
	mov	[beg_str_scr],0
1553
	mov	[beg_str_scr],0
1554
	mov	eax,[len_str_scr]
1554
	mov	eax,[len_str_scr]
1555
	shl	eax,1
1555
	shl	eax,1
1556
	cmp	eax,[ready_screen_buffer.string_size]
1556
	cmp	eax,[ready_screen_buffer.string_size]
1557
	jae	@f
1557
	jae	@f
1558
 
1558
 
1559
	mov	[beg_str_scr],ebx
1559
	mov	[beg_str_scr],ebx
1560
	movzx	eax,word [threath_buf+66]
1560
	movzx	eax,word [threath_buf+66]
1561
	sub	eax,34
1561
	sub	eax,34
1562
	mov	[scroll_bar_data_horizontal.y_pos],ax
1562
	mov	[scroll_bar_data_horizontal.y_pos],ax
1563
 
1563
 
1564
;cur_area/(x_size-30)=len_str_scr/string_size
1564
;cur_area/(x_size-30)=len_str_scr/string_size
1565
 
1565
 
1566
	mov	eax,dword [threath_buf+62]
1566
	mov	eax,dword [threath_buf+62]
1567
	sub	ax,[scroll_bar_data_vertical.x_size]
1567
	sub	ax,[scroll_bar_data_vertical.x_size]
1568
	mov	[scroll_bar_data_horizontal.x_size],ax
1568
	mov	[scroll_bar_data_horizontal.x_size],ax
1569
	sub	eax,[scroll_bar_data_horizontal.btn_height]
1569
	sub	eax,[scroll_bar_data_horizontal.btn_height]
1570
	sub	eax,[scroll_bar_data_horizontal.btn_height]
1570
	sub	eax,[scroll_bar_data_horizontal.btn_height]
1571
	mov	[scroll_bar_data_horizontal.max_area],eax
1571
	mov	[scroll_bar_data_horizontal.max_area],eax
1572
	xor	edx,edx
1572
	xor	edx,edx
1573
	mov	ebx,[len_str_scr]
1573
	mov	ebx,[len_str_scr]
1574
	mul	ebx
1574
	mul	ebx
1575
	mov	ebx,[ready_screen_buffer.string_size]
1575
	mov	ebx,[ready_screen_buffer.string_size]
1576
	shr	ebx,1
1576
	shr	ebx,1
1577
	div	ebx
1577
	div	ebx
1578
	mov	[scroll_bar_data_horizontal.cur_area],eax
1578
	mov	[scroll_bar_data_horizontal.cur_area],eax
1579
 
1579
 
1580
	push	dword scroll_bar_data_horizontal	;draw for Horizontal ScrollBar
1580
	push	dword scroll_bar_data_horizontal	;draw for Horizontal ScrollBar
1581
	call	[scrollbar_hor_mouse]
1581
	call	[scrollbar_hor_mouse]
1582
	xor	eax,eax
1582
	xor	eax,eax
1583
	inc	eax
1583
	inc	eax
1584
	mov	[scroll_bar_data_horizontal.all_redraw],eax
1584
	mov	[scroll_bar_data_horizontal.all_redraw],eax
1585
	push	dword scroll_bar_data_horizontal	;draw for Vertical ScrollBar
1585
	push	dword scroll_bar_data_horizontal	;draw for Vertical ScrollBar
1586
	call	[scrollbar_hor_draw]
1586
	call	[scrollbar_hor_draw]
1587
	xor	eax,eax	;reset all_redraw flag
1587
	xor	eax,eax	;reset all_redraw flag
1588
	mov	[scroll_bar_data_horizontal.all_redraw],eax
1588
	mov	[scroll_bar_data_horizontal.all_redraw],eax
1589
@@:
1589
@@:
1590
	mov	eax,[low_area]
1590
	mov	eax,[low_area]
1591
	mov	edi,[screen_table]
1591
	mov	edi,[screen_table]
1592
	mov	esi,[bytes_per_line]
1592
	mov	esi,[bytes_per_line]
1593
	mov	ecx,esi
1593
	mov	ecx,esi
1594
	shl	ecx,1
1594
	shl	ecx,1
1595
	mov	eax,[edi]
1595
	mov	eax,[edi]
1596
	mov	ebx,[cursor]
1596
	mov	ebx,[cursor]
1597
	inc	ebx
1597
	inc	ebx
1598
	shr	ebx,1
1598
	shr	ebx,1
1599
@@:
1599
@@:
1600
	cmp	eax,ebx
1600
	cmp	eax,ebx
1601
	jge	@f
1601
	jge	@f
1602
	add	[begin_offset],esi
1602
	add	[begin_offset],esi
1603
	sub	[cursor],ecx
1603
	sub	[cursor],ecx
1604
	sub	ebx,esi
1604
	sub	ebx,esi
1605
	jmp	@b
1605
	jmp	@b
1606
;--------------------------------------
1606
;--------------------------------------
1607
@@:
1607
@@:
1608
	bts	[flags],6
1608
	bts	[flags],6
1609
	ret
1609
	ret
1610
;--------------------------------------------------------------------
1610
;--------------------------------------------------------------------
1611
align	4
1611
align	4
1612
start_draw:
1612
start_draw:
1613
	mcall	SF_REDRAW,SSF_BEGIN_DRAW
1613
	mcall	SF_REDRAW,SSF_BEGIN_DRAW
1614
	ret
1614
	ret
1615
;--------------------------------------------------------------------
1615
;--------------------------------------------------------------------
1616
end_draw:
1616
end_draw:
1617
	mcall	SF_REDRAW,SSF_END_DRAW
1617
	mcall	SF_REDRAW,SSF_END_DRAW
1618
	ret
1618
	ret
1619
;--------------------------------------------------------------------
1619
;--------------------------------------------------------------------
1620
close_prog:
1620
close_prog:
1621
	mcall	SF_TERMINATE_PROCESS
1621
	mcall	SF_TERMINATE_PROCESS
1622
;--------------------------------------------------------------------
1622
;--------------------------------------------------------------------
1623
change_codepage:	;¬¥­ï¥¬ ¢â®àãî ¯®«®¢¨­ã â ¡«¨æë
1623
change_codepage:	;¬¥­ï¥¬ ¢â®àãî ¯®«®¢¨­ã â ¡«¨æë
1624
	test	ah,ah
1624
	test	ah,ah
1625
	jnz	@f
1625
	jnz	@f
1626
	btc	[flags],4
1626
	btc	[flags],4
1627
	jc	.1
1627
	jc	.1
1628
	push	[codepage_offset]
1628
	push	[codepage_offset]
1629
	pop	[codepage_offset_previous]
1629
	pop	[codepage_offset_previous]
1630
	mov	[codepage_offset],2*128
1630
	mov	[codepage_offset],2*128
1631
	jmp	.end
1631
	jmp	.end
1632
;--------------------------------------
1632
;--------------------------------------
1633
.1:
1633
.1:
1634
	push	[codepage_offset_previous]
1634
	push	[codepage_offset_previous]
1635
	pop	[codepage_offset]
1635
	pop	[codepage_offset]
1636
	jmp	.end
1636
	jmp	.end
1637
;--------------------------------------
1637
;--------------------------------------
1638
@@:
1638
@@:
1639
	cmp	[codepage_offset],0
1639
	cmp	[codepage_offset],0
1640
	jne	@f
1640
	jne	@f
1641
	add	[codepage_offset],128
1641
	add	[codepage_offset],128
1642
	jmp	.end
1642
	jmp	.end
1643
;--------------------------------------
1643
;--------------------------------------
1644
@@:
1644
@@:
1645
	mov	[codepage_offset],0
1645
	mov	[codepage_offset],0
1646
.end:
1646
.end:
1647
	call	show_codepage
1647
	call	show_codepage
1648
	jmp	red
1648
	jmp	red
1649
;--------------------------------------------------------------------
1649
;--------------------------------------------------------------------
1650
show_codepage:
1650
show_codepage:
1651
	mov	ebp,6
1651
	mov	ebp,6
1652
	mov	edx,dword [threath_buf+62]
1652
	mov	edx,dword [threath_buf+62]
1653
	sub	edx,73
1653
	sub	edx,73
1654
	shl	edx,16
1654
	shl	edx,16
1655
	add	edx,[low_area]
1655
	add	edx,[low_area]
1656
	mov	edi,string_cp866
1656
	mov	edi,string_cp866
1657
	cmp	[codepage_offset],0
1657
	cmp	[codepage_offset],0
1658
	je	@f
1658
	je	@f
1659
	add	edi,6
1659
	add	edi,6
1660
	cmp	[codepage_offset],128
1660
	cmp	[codepage_offset],128
1661
	je	@f
1661
	je	@f
1662
	add	edi,6
1662
	add	edi,6
1663
@@:
1663
@@:
1664
	mov	ecx,8*65536+16
1664
	mov	ecx,8*65536+16
1665
	mov	esi,1
1665
	mov	esi,1
1666
	push	ebp
1666
	push	ebp
1667
	mov	ebp,0
1667
	mov	ebp,0
1668
@@:
1668
@@:
1669
	xor	ebx,ebx
1669
	xor	ebx,ebx
1670
	push	edi
1670
	push	edi
1671
	mov	bl,[edi]
1671
	mov	bl,[edi]
1672
	shl	bx,4
1672
	shl	bx,4
1673
	add	ebx,font_buffer
1673
	add	ebx,font_buffer
1674
	mov	edi,palitra.5
1674
	mov	edi,palitra.5
1675
	mcall	SF_PUT_IMAGE_EXT
1675
	mcall	SF_PUT_IMAGE_EXT
1676
	add	edx,8*65536
1676
	add	edx,8*65536
1677
	pop	edi
1677
	pop	edi
1678
	inc	edi
1678
	inc	edi
1679
	dec	dword [esp]
1679
	dec	dword [esp]
1680
	jnz	@b
1680
	jnz	@b
1681
	add	esp,4
1681
	add	esp,4
1682
	ret
1682
	ret
1683
;--------------------------------------------------------------------
1683
;--------------------------------------------------------------------
1684
show_insert:	;®â®¡à ¦¥­¨¥ ०¨¬  ¢áâ ¢ª¨/§ ¬¥­ë
1684
show_insert:	;®â®¡à ¦¥­¨¥ ०¨¬  ¢áâ ¢ª¨/§ ¬¥­ë
1685
	mov	ebp,3
1685
	mov	ebp,3
1686
	mov	edx,dword [threath_buf+62]
1686
	mov	edx,dword [threath_buf+62]
1687
	sub	edx,120
1687
	sub	edx,120
1688
	shl	edx,16	; mov edx,428*65536+335
1688
	shl	edx,16	; mov edx,428*65536+335
1689
	add	edx,[low_area]
1689
	add	edx,[low_area]
1690
	mov	edi,string_ins
1690
	mov	edi,string_ins
1691
	push	ebp
1691
	push	ebp
1692
	mov	ecx,8*65536+16
1692
	mov	ecx,8*65536+16
1693
	mov	esi,1
1693
	mov	esi,1
1694
	mov	ebp,0
1694
	mov	ebp,0
1695
.1:
1695
.1:
1696
	xor	ebx,ebx
1696
	xor	ebx,ebx
1697
	push	edi
1697
	push	edi
1698
	bt	[flags],1
1698
	bt	[flags],1
1699
	jnc	.2
1699
	jnc	.2
1700
	mov	bl,[edi]
1700
	mov	bl,[edi]
1701
	shl	bx,4
1701
	shl	bx,4
1702
.2:
1702
.2:
1703
	add	ebx,font_buffer
1703
	add	ebx,font_buffer
1704
	mov	edi,palitra.5
1704
	mov	edi,palitra.5
1705
	mcall	SF_PUT_IMAGE_EXT
1705
	mcall	SF_PUT_IMAGE_EXT
1706
	add	edx,8*65536
1706
	add	edx,8*65536
1707
	pop	edi
1707
	pop	edi
1708
	inc	edi
1708
	inc	edi
1709
	dec	dword [esp]
1709
	dec	dword [esp]
1710
	jnz	.1
1710
	jnz	.1
1711
	add	esp,4
1711
	add	esp,4
1712
	ret
1712
	ret
1713
;-------------------------------------------------------------------------------
1713
;-------------------------------------------------------------------------------
1714
	;help window
1714
	;help window
1715
create_help_window:
1715
create_help_window:
1716
	pushad
1716
	pushad
1717
        cmp	[help_is_open_already], 1
1717
        cmp	[help_is_open_already], 1
1718
        jne	@f
1718
        jne	@f
1719
  	mov     ecx, [help_window_pid]
1719
  	mov     ecx, [help_window_pid]
1720
        mcall   SF_SYSTEM, SSF_GET_THREAD_SLOT
1720
        mcall   SF_SYSTEM, SSF_GET_THREAD_SLOT
1721
        xchg    eax, ecx
1721
        xchg    eax, ecx
1722
        mcall   SF_SYSTEM, SSF_FOCUS_WINDOW
1722
        mcall   SF_SYSTEM, SSF_FOCUS_WINDOW
1723
	popad
1723
	popad
1724
        ret
1724
        ret
1725
;---------------------------------------------------------------------
1725
;---------------------------------------------------------------------
1726
@@:
1726
@@:
1727
	mcall	SF_CREATE_THREAD,1,.thread,(.threat_stack+16*4)
1727
	mcall	SF_CREATE_THREAD,1,.thread,(.threat_stack+16*4)
1728
        mov     [help_is_open_already], 1
1728
        mov     [help_is_open_already], 1
1729
        mov     [help_window_pid], eax
1729
        mov     [help_window_pid], eax
1730
	popad
1730
	popad
1731
	ret
1731
	ret
1732
;--------------------------------------------------------------------
1732
;--------------------------------------------------------------------
1733
.thread:
1733
.thread:
1734
	call	.window
1734
	call	.window
1735
;--------------------------------------------------------------------
1735
;--------------------------------------------------------------------
1736
.still:
1736
.still:
1737
	mcall	SF_WAIT_EVENT
1737
	mcall	SF_WAIT_EVENT
1738
	dec	al
1738
	dec	al
1739
	jz	.red
1739
	jz	.red
1740
	dec	al
1740
	dec	al
1741
	jz	.key
1741
	jz	.key
1742
	dec	al
1742
	dec	al
1743
	jz	.button
1743
	jz	.button
1744
	jmp	.still
1744
	jmp	.still
1745
;--------------------------------------------------------------------
1745
;--------------------------------------------------------------------
1746
        and	[help_is_open_already], 0
1746
        and	[help_is_open_already], 0
1747
	mcall	SF_TERMINATE_PROCESS
1747
	mcall	SF_TERMINATE_PROCESS
1748
.button:
1748
.button:
1749
	mcall	SF_GET_BUTTON
1749
	mcall	SF_GET_BUTTON
1750
	cmp	ah,1
1750
	cmp	ah,1
1751
	jne	@f
1751
	jne	@f
1752
        and	[help_is_open_already], 0
1752
        and	[help_is_open_already], 0
1753
	mcall	SF_TERMINATE_PROCESS
1753
	mcall	SF_TERMINATE_PROCESS
1754
@@:
1754
@@:
1755
	cmp	ah,2
1755
	cmp	ah,2
1756
	jne	@f
1756
	jne	@f
1757
	mov	edi,(help_end-help_text)/51
1757
	mov	edi,(help_end-help_text)/51
1758
	movzx	eax,[cur_help_string]
1758
	movzx	eax,[cur_help_string]
1759
	sub	edi,13
1759
	sub	edi,13
1760
	sub	edi,eax
1760
	sub	edi,eax
1761
	jz	.still
1761
	jz	.still
1762
	inc	[cur_help_string]
1762
	inc	[cur_help_string]
1763
	jmp	.red
1763
	jmp	.red
1764
;--------------------------------------
1764
;--------------------------------------
1765
@@:
1765
@@:
1766
	cmp	ah,3
1766
	cmp	ah,3
1767
	jne	.still
1767
	jne	.still
1768
	cmp	[cur_help_string],0
1768
	cmp	[cur_help_string],0
1769
	je	.still
1769
	je	.still
1770
	dec	[cur_help_string]
1770
	dec	[cur_help_string]
1771
	jmp	.red
1771
	jmp	.red
1772
;--------------------------------------------------------------------
1772
;--------------------------------------------------------------------
1773
.key:
1773
.key:
1774
	mcall	SF_GET_KEY
1774
	mcall	SF_GET_KEY
1775
	jmp	.still
1775
	jmp	.still
1776
;--------------------------------------------------------------------
1776
;--------------------------------------------------------------------
1777
.red:
1777
.red:
1778
	call	.window
1778
	call	.window
1779
	jmp	.still
1779
	jmp	.still
1780
;--------------------------------------------------------------------
1780
;--------------------------------------------------------------------
1781
.window:
1781
.window:
1782
	pushad
1782
	pushad
1783
	mcall	SF_REDRAW,SSF_BEGIN_DRAW
1783
	mcall	SF_REDRAW,SSF_BEGIN_DRAW
1784
	mcall	SF_CREATE_WINDOW,50*65536+320,0x70*65536+240,0x13000000,,help_but_text
1784
	mcall	SF_CREATE_WINDOW,50*65536+320,0x70*65536+240,0x13000000,,help_but_text
1785
	mcall	SF_DEFINE_BUTTON,<130,20>,<6,12>,2,0xaaaaaa
1785
	mcall	SF_DEFINE_BUTTON,<130,20>,<6,12>,2,0xaaaaaa
1786
	mcall	,<150,20>,,3,
1786
	mcall	,<150,20>,,3,
1787
	mov	ebx,8*65536+15
1787
	mov	ebx,8*65536+15
1788
	mov	ecx,0x00DDDDDD
1788
	mov	ecx,0x00DDDDDD
1789
	xor	edx,edx
1789
	xor	edx,edx
1790
	movzx	eax,byte [cur_help_string]
1790
	movzx	eax,byte [cur_help_string]
1791
	mov	edi,(help_end-help_text)/51
1791
	mov	edi,(help_end-help_text)/51
1792
	sub	edi,eax
1792
	sub	edi,eax
1793
	mov	esi,51
1793
	mov	esi,51
1794
	mul	si
1794
	mul	si
1795
	mov	edx,help_text
1795
	mov	edx,help_text
1796
	add	edx,eax
1796
	add	edx,eax
1797
	mov	eax,SF_DRAW_TEXT
1797
	mov	eax,SF_DRAW_TEXT
1798
@@:
1798
@@:
1799
	add	ebx,0x10
1799
	add	ebx,0x10
1800
	mcall
1800
	mcall
1801
	add	edx,51
1801
	add	edx,51
1802
	dec	edi
1802
	dec	edi
1803
	jnz	@b
1803
	jnz	@b
1804
	mcall	SF_REDRAW,SSF_END_DRAW
1804
	mcall	SF_REDRAW,SSF_END_DRAW
1805
	popad
1805
	popad
1806
	ret
1806
	ret
1807
;--------------------------------------------------------------------
1807
;--------------------------------------------------------------------
1808
.threat_stack:	times	16	dd	0
1808
.threat_stack:	times	16	dd	0
1809
;--------------------------------------------------------------------
1809
;--------------------------------------------------------------------
1810
open_file:
1810
open_file:
1811
	mov	[func_70.Function],SSF_GET_INFO
1811
	mov	[func_70.Function],SSF_GET_INFO
1812
	mov	[func_70.Position],0
1812
	mov	[func_70.Position],0
1813
	mov	[func_70.Flags],0
1813
	mov	[func_70.Flags],0
1814
	mov	[func_70.Count],0
1814
	mov	[func_70.Count],0
1815
	mov	[func_70.Buffer],bufferfinfo
1815
	mov	[func_70.Buffer],bufferfinfo
1816
	mov	[func_70.rezerv],0
1816
	mov	[func_70.rezerv],0
1817
	mov	[func_70.FileName],file_name
1817
	mov	[func_70.FileName],file_name
1818
	mcall	SF_FILE,func_70
1818
	mcall	SF_FILE,func_70
1819
 
1819
 
1820
	test	al,al	;ä ©« ­ ©¤¥­?
1820
	test	al,al	;ä ©« ­ ©¤¥­?
1821
	jz	@f
1821
	jz	@f
1822
	mcall	SF_DRAW_TEXT,400*65536+31,0x80CC0000,error_open_file_string
1822
	mcall	SF_DRAW_TEXT,400*65536+31,0x80CC0000,error_open_file_string
1823
	jmp	open_file
1823
	jmp	open_file
1824
;--------------------------------------------------------------------
1824
;--------------------------------------------------------------------
1825
@@:
1825
@@:
1826
	mov	eax,	dword [bufferfinfo+32]	;ª®¯¨à㥬 à §¬¥à ä ©« 
1826
	mov	eax,	dword [bufferfinfo+32]	;ª®¯¨à㥬 à §¬¥à ä ©« 
1827
	mov	[file_size],eax
1827
	mov	[file_size],eax
1828
 
1828
 
1829
	mcall	SF_SYS_MISC,SSF_MEM_FREE,[file_buffer]
1829
	mcall	SF_SYS_MISC,SSF_MEM_FREE,[file_buffer]
1830
	test	eax,eax
1830
	test	eax,eax
1831
	jnz	@f
1831
	jnz	@f
1832
	;§¤¥áì ®è¨¡ª  ­  ­¥ ®á¢®¡®¦¤¥­¨¥ ¡«®ª 
1832
	;§¤¥áì ®è¨¡ª  ­  ­¥ ®á¢®¡®¦¤¥­¨¥ ¡«®ª 
1833
@@:
1833
@@:
1834
	mov ecx,[file_size]
1834
	mov ecx,[file_size]
1835
	or ecx,ecx
1835
	or ecx,ecx
1836
	jnz @f
1836
	jnz @f
1837
	inc ecx ;¥á«¨ à §¬¥à ä ©«  0 ¡ ©â
1837
	inc ecx ;¥á«¨ à §¬¥à ä ©«  0 ¡ ©â
1838
@@:
1838
@@:
1839
	mcall	SF_SYS_MISC,SSF_MEM_ALLOC
1839
	mcall	SF_SYS_MISC,SSF_MEM_ALLOC
1840
	mov	[file_buffer],eax
1840
	mov	[file_buffer],eax
1841
 
1841
 
1842
;;¨¬¥¥¬ â ¡«¨æã: [ DWORD 㪠§ â¥«ì ­  ¯¥à¢ë© í«¥¬¥­â ¡«®ª  : DWORD ¤«¨­  ¡«®ª  ]
1842
;;¨¬¥¥¬ â ¡«¨æã: [ DWORD 㪠§ â¥«ì ­  ¯¥à¢ë© í«¥¬¥­â ¡«®ª  : DWORD ¤«¨­  ¡«®ª  ]
1843
 
1843
 
1844
	mov	[func_70.Function],SSF_READ_FILE
1844
	mov	[func_70.Function],SSF_READ_FILE
1845
	mov	[func_70.Position],0
1845
	mov	[func_70.Position],0
1846
	mov	[func_70.Flags],0
1846
	mov	[func_70.Flags],0
1847
	mov	[func_70.rezerv],0
1847
	mov	[func_70.rezerv],0
1848
	mov	[func_70.FileName],file_name
1848
	mov	[func_70.FileName],file_name
1849
	push	dword [file_size];dword [edi+4]
1849
	push	dword [file_size];dword [edi+4]
1850
	pop	dword [func_70.Count]
1850
	pop	dword [func_70.Count]
1851
	push	dword [file_buffer];dword [edi]
1851
	push	dword [file_buffer];dword [edi]
1852
	pop	dword [func_70.Buffer]
1852
	pop	dword [func_70.Buffer]
1853
	mcall	SF_FILE,func_70
1853
	mcall	SF_FILE,func_70
1854
 
1854
 
1855
	test	eax,eax
1855
	test	eax,eax
1856
	jz	@f
1856
	jz	@f
1857
	;®è¨¡ª  ç⥭¨ï
1857
	;®è¨¡ª  ç⥭¨ï
1858
@@:
1858
@@:
1859
	call	Ctrl_HOME
1859
	call	Ctrl_HOME
1860
 
1860
 
1861
	jmp	redraw_all
1861
	jmp	redraw_all
1862
;-------------------------------------------------------------------------------
1862
;-------------------------------------------------------------------------------
1863
open_dialog_save:
1863
open_dialog_save:
1864
	mov	[OpenDialog_data.type],1	; Save
1864
	mov	[OpenDialog_data.type],1	; Save
1865
 
1865
 
1866
	push    dword OpenDialog_data
1866
	push    dword OpenDialog_data
1867
	call    [OpenDialog_Start]
1867
	call    [OpenDialog_Start]
1868
 
1868
 
1869
;	cmp	[OpenDialog_data.status],2	; OpenDialog does not start
1869
;	cmp	[OpenDialog_data.status],2	; OpenDialog does not start
1870
	cmp	[OpenDialog_data.status],1
1870
	cmp	[OpenDialog_data.status],1
1871
	jne	still
1871
	jne	still
1872
	mov	esi,fname_buf
1872
	mov	esi,fname_buf
1873
	mov	edi,file_name
1873
	mov	edi,file_name
1874
	cld
1874
	cld
1875
@@:
1875
@@:
1876
	cmp	byte [esi],0
1876
	cmp	byte [esi],0
1877
	je	@f
1877
	je	@f
1878
	movsb
1878
	movsb
1879
	jmp	@b
1879
	jmp	@b
1880
;--------------------------------------
1880
;--------------------------------------
1881
@@:
1881
@@:
1882
	mov	byte [edi],0
1882
	mov	byte [edi],0
1883
	sub	esi,path
1883
	sub	esi,path
1884
	mov	[edit1.size],esi
1884
	mov	[edit1.size],esi
1885
	mov	[edit1.pos],esi
1885
	mov	[edit1.pos],esi
1886
;	jmp	save_file
1886
;	jmp	save_file
1887
;-------------------------------------------------------------------------------
1887
;-------------------------------------------------------------------------------
1888
save_file:	;á®å࠭塞 ä ©«
1888
save_file:	;á®å࠭塞 ä ©«
1889
	mov	[func_70.Function],SSF_CREATE_FILE
1889
	mov	[func_70.Function],SSF_CREATE_FILE
1890
	mov	[func_70.Position],0
1890
	mov	[func_70.Position],0
1891
	mov	[func_70.Flags],0
1891
	mov	[func_70.Flags],0
1892
	push	[file_size]
1892
	push	[file_size]
1893
	pop	[func_70.Count]
1893
	pop	[func_70.Count]
1894
	push	[file_buffer]
1894
	push	[file_buffer]
1895
	pop	[func_70.Buffer]
1895
	pop	[func_70.Buffer]
1896
	mov	[func_70.rezerv],0
1896
	mov	[func_70.rezerv],0
1897
	mov	[func_70.FileName],file_name
1897
	mov	[func_70.FileName],file_name
1898
	mcall	SF_FILE,func_70
1898
	mcall	SF_FILE,func_70
1899
	cmp	al,0	;á®åà ­ñ­ 㤠筮?
1899
	cmp	al,0	;á®åà ­ñ­ 㤠筮?
1900
	je	redraw_all
1900
	je	redraw_all
1901
	mcall	SF_DRAW_TEXT,400*65536+31,0x80CC0000,error_save_file_string
1901
	mcall	SF_DRAW_TEXT,400*65536+31,0x80CC0000,error_save_file_string
1902
	jmp	save_file
1902
	jmp	save_file
1903
;-------------------------------------------------------------------------------
1903
;-------------------------------------------------------------------------------
1904
draw_ed_box:	;à¨á®¢ ­¨¥ edit box' 
1904
draw_ed_box:	;à¨á®¢ ­¨¥ edit box' 
1905
.1:
1905
.1:
1906
	push	eax	ebx	ecx	edx
1906
	push	eax	ebx	ecx	edx
1907
	mcall	SF_DRAW_RECT,180*65536+220,25*65536+70,0xaaaaaa
1907
	mcall	SF_DRAW_RECT,180*65536+220,25*65536+70,0xaaaaaa
1908
	bt	[flags],9
1908
	bt	[flags],9
1909
	jnc	@f
1909
	jnc	@f
1910
	mcall	SF_DRAW_TEXT,246*65536+35,0x80ffffff,sel_text
1910
	mcall	SF_DRAW_TEXT,246*65536+35,0x80ffffff,sel_text
1911
@@:
1911
@@:
1912
	bt	[flags],2
1912
	bt	[flags],2
1913
	jnc	@f
1913
	jnc	@f
1914
	push	dword Option_boxs
1914
	push	dword Option_boxs
1915
	call	[option_box_draw]
1915
	call	[option_box_draw]
1916
@@:
1916
@@:
1917
	bt	[flags],3
1917
	bt	[flags],3
1918
	jnc	@f
1918
	jnc	@f
1919
	push	dword Option_boxs2
1919
	push	dword Option_boxs2
1920
	call	[option_box_draw]
1920
	call	[option_box_draw]
1921
@@:
1921
@@:
1922
	mov	eax,ed_box_data
1922
	mov	eax,ed_box_data
1923
	mov	ecx,[eax]
1923
	mov	ecx,[eax]
1924
@@:
1924
@@:
1925
	add	eax,4
1925
	add	eax,4
1926
	push	dword [eax]
1926
	push	dword [eax]
1927
	call	[edit_box_draw]
1927
	call	[edit_box_draw]
1928
	loop	@b
1928
	loop	@b
1929
	pop	edx	ecx	ebx	eax
1929
	pop	edx	ecx	ebx	eax
1930
.2:
1930
.2:
1931
	mcall	SF_WAIT_EVENT
1931
	mcall	SF_WAIT_EVENT
1932
	cmp	al,6
1932
	cmp	al,6
1933
	je	.mouse
1933
	je	.mouse
1934
	cmp	al,3
1934
	cmp	al,3
1935
	je	.button
1935
	je	.button
1936
	cmp	al,2
1936
	cmp	al,2
1937
	je	.keys
1937
	je	.keys
1938
	cmp	al,1
1938
	cmp	al,1
1939
	jne	.2
1939
	jne	.2
1940
	call	draw_window
1940
	call	draw_window
1941
	
1941
	
1942
	mov     eax,[threath_buf+70]
1942
	mov     eax,[threath_buf+70]
1943
	test    eax,10b
1943
	test    eax,10b
1944
	jnz     .2
1944
	jnz     .2
1945
	test    eax,100b
1945
	test    eax,100b
1946
	jnz     .2
1946
	jnz     .2
1947
	
1947
	
1948
	call	main_area
1948
	call	main_area
1949
	bt	[flags],2
1949
	bt	[flags],2
1950
	jnc	@f
1950
	jnc	@f
1951
	push	dword Option_boxs
1951
	push	dword Option_boxs
1952
	call	[option_box_draw]
1952
	call	[option_box_draw]
1953
@@:
1953
@@:
1954
	bt	[flags],3
1954
	bt	[flags],3
1955
	jnc	@f
1955
	jnc	@f
1956
	push	dword Option_boxs2
1956
	push	dword Option_boxs2
1957
	call	[option_box_draw]
1957
	call	[option_box_draw]
1958
@@:
1958
@@:
1959
	jmp	.1
1959
	jmp	.1
1960
;--------------------------------------------------------------------
1960
;--------------------------------------------------------------------
1961
.mouse:
1961
.mouse:
1962
	bt	[flags],2
1962
	bt	[flags],2
1963
	jnc	@f
1963
	jnc	@f
1964
	push	dword Option_boxs
1964
	push	dword Option_boxs
1965
	call	[option_box_mouse]
1965
	call	[option_box_mouse]
1966
@@:
1966
@@:
1967
	bt	[flags],3
1967
	bt	[flags],3
1968
	jnc	@f
1968
	jnc	@f
1969
	push	dword Option_boxs2
1969
	push	dword Option_boxs2
1970
	call	[option_box_mouse]
1970
	call	[option_box_mouse]
1971
@@:
1971
@@:
1972
	jmp	.2
1972
	jmp	.2
1973
;--------------------------------------------------------------------
1973
;--------------------------------------------------------------------
1974
.keys:
1974
.keys:
1975
	mcall	SF_GET_KEY
1975
	mcall	SF_GET_KEY
1976
	cmp	ah,13
1976
	cmp	ah,13
1977
	je	.4
1977
	je	.4
1978
	cmp	ah,27
1978
	cmp	ah,27
1979
	je	.3
1979
	je	.3
1980
 
1980
 
1981
	bt	[flags],2	;¯à®¢¥àª  ­  ¯à¨¬¥­¨¬®áâì ᨬ¢®«®¢ 0-9,a-b
1981
	bt	[flags],2	;¯à®¢¥àª  ­  ¯à¨¬¥­¨¬®áâì ᨬ¢®«®¢ 0-9,a-b
1982
	jnc	.eb2
1982
	jnc	.eb2
1983
.eb1:
1983
.eb1:
1984
	cmp	ah,9
1984
	cmp	ah,9
1985
	jne	.eb1_1
1985
	jne	.eb1_1
1986
	push	edx
1986
	push	edx
1987
	mov	edx,[option_group1]
1987
	mov	edx,[option_group1]
1988
	cmp	edx,op1
1988
	cmp	edx,op1
1989
	jne	@f
1989
	jne	@f
1990
	mov	edx,op2
1990
	mov	edx,op2
1991
	jmp	.eb1_2
1991
	jmp	.eb1_2
1992
;--------------------------------------
1992
;--------------------------------------
1993
@@:
1993
@@:
1994
	cmp	edx,op2
1994
	cmp	edx,op2
1995
	jne	@f
1995
	jne	@f
1996
	mov	edx,op3
1996
	mov	edx,op3
1997
	jmp	.eb1_2
1997
	jmp	.eb1_2
1998
;--------------------------------------
1998
;--------------------------------------
1999
@@:
1999
@@:
2000
	mov	edx,op1
2000
	mov	edx,op1
2001
.eb1_2:
2001
.eb1_2:
2002
	mov	[option_group1],edx
2002
	mov	[option_group1],edx
2003
	pop	edx
2003
	pop	edx
2004
	jmp	.1
2004
	jmp	.1
2005
;--------------------------------------
2005
;--------------------------------------
2006
.eb1_1:
2006
.eb1_1:
2007
	cmp	ah,48
2007
	cmp	ah,48
2008
	jb	.eb1_3
2008
	jb	.eb1_3
2009
	cmp	ah,57
2009
	cmp	ah,57
2010
	jbe	.eb
2010
	jbe	.eb
2011
	cmp	ah,102
2011
	cmp	ah,102
2012
	jg	.eb1_3
2012
	jg	.eb1_3
2013
	cmp	ah,97
2013
	cmp	ah,97
2014
	jge	.eb
2014
	jge	.eb
2015
.eb1_3:
2015
.eb1_3:
2016
	cmp	ah,182
2016
	cmp	ah,182
2017
	je	.eb
2017
	je	.eb
2018
	cmp	ah,8
2018
	cmp	ah,8
2019
	je	.eb
2019
	je	.eb
2020
	cmp	ah,176
2020
	cmp	ah,176
2021
	je	.eb
2021
	je	.eb
2022
	cmp	ah,179
2022
	cmp	ah,179
2023
	je	.eb
2023
	je	.eb
2024
	dec	[edit2.shift]
2024
	dec	[edit2.shift]
2025
	dec	[edit2.shift+4]
2025
	dec	[edit2.shift+4]
2026
 
2026
 
2027
	push	dword [ed_box_data+4];	[esp]
2027
	push	dword [ed_box_data+4];	[esp]
2028
	call	[edit_box_draw]
2028
	call	[edit_box_draw]
2029
	jmp	.2
2029
	jmp	.2
2030
;--------------------------------------
2030
;--------------------------------------
2031
.eb2:
2031
.eb2:
2032
	bt	[flags],3
2032
	bt	[flags],3
2033
	jnc	.eb3
2033
	jnc	.eb3
2034
	cmp	ah,9
2034
	cmp	ah,9
2035
	jne	.eb2_2
2035
	jne	.eb2_2
2036
	push	edx
2036
	push	edx
2037
	mov	edx,[option_group2]
2037
	mov	edx,[option_group2]
2038
	cmp	edx,op11
2038
	cmp	edx,op11
2039
	jne	@f
2039
	jne	@f
2040
	mov	edx,op12
2040
	mov	edx,op12
2041
	jmp	.eb2_1
2041
	jmp	.eb2_1
2042
;--------------------------------------
2042
;--------------------------------------
2043
@@:
2043
@@:
2044
	mov	edx,op11
2044
	mov	edx,op11
2045
.eb2_1:
2045
.eb2_1:
2046
	mov	[option_group2],edx
2046
	mov	[option_group2],edx
2047
	pop	edx
2047
	pop	edx
2048
	jmp	.1
2048
	jmp	.1
2049
;--------------------------------------
2049
;--------------------------------------
2050
.eb2_2:
2050
.eb2_2:
2051
	cmp	ah,182
2051
	cmp	ah,182
2052
	je	.eb
2052
	je	.eb
2053
	cmp	ah,8
2053
	cmp	ah,8
2054
	je	.eb
2054
	je	.eb
2055
	cmp	ah,176
2055
	cmp	ah,176
2056
	je	.eb
2056
	je	.eb
2057
	cmp	ah,179
2057
	cmp	ah,179
2058
	je	.eb
2058
	je	.eb
2059
	mov	edx,[option_group2]
2059
	mov	edx,[option_group2]
2060
	cmp	edx,op11
2060
	cmp	edx,op11
2061
	jne	.eb
2061
	jne	.eb
2062
	cmp	ah,48
2062
	cmp	ah,48
2063
	jb	.eb2_3
2063
	jb	.eb2_3
2064
	cmp	ah,57
2064
	cmp	ah,57
2065
	jbe	.eb
2065
	jbe	.eb
2066
	cmp	ah,102
2066
	cmp	ah,102
2067
	jg	.eb2_3
2067
	jg	.eb2_3
2068
	cmp	ah,97
2068
	cmp	ah,97
2069
	jge	.eb
2069
	jge	.eb
2070
.eb2_3:
2070
.eb2_3:
2071
	dec	[edit3.shift]
2071
	dec	[edit3.shift]
2072
	dec	[edit3.shift+4]
2072
	dec	[edit3.shift+4]
2073
	push	dword [ed_box_data+4];[esp]
2073
	push	dword [ed_box_data+4];[esp]
2074
	call	[edit_box_draw]
2074
	call	[edit_box_draw]
2075
	jmp	.2
2075
	jmp	.2
2076
;--------------------------------------
2076
;--------------------------------------
2077
.eb3:
2077
.eb3:
2078
	bt	[flags],9
2078
	bt	[flags],9
2079
	jnc	.eb
2079
	jnc	.eb
2080
	cmp	ah,9
2080
	cmp	ah,9
2081
	je	.eb3_1
2081
	je	.eb3_1
2082
	cmp	ah,182
2082
	cmp	ah,182
2083
	je	.eb3_2
2083
	je	.eb3_2
2084
	cmp	ah,8
2084
	cmp	ah,8
2085
	je	.eb3_2
2085
	je	.eb3_2
2086
	cmp	ah,176
2086
	cmp	ah,176
2087
	je	.eb3_2
2087
	je	.eb3_2
2088
	cmp	ah,179
2088
	cmp	ah,179
2089
	je	.eb3_2
2089
	je	.eb3_2
2090
	cmp	ah,48
2090
	cmp	ah,48
2091
	jb	.eb3_3
2091
	jb	.eb3_3
2092
	cmp	ah,57
2092
	cmp	ah,57
2093
	jbe	.eb3_2
2093
	jbe	.eb3_2
2094
	cmp	ah,102
2094
	cmp	ah,102
2095
	jg	.eb3_3
2095
	jg	.eb3_3
2096
	cmp	ah,97
2096
	cmp	ah,97
2097
	jge	.eb3_2
2097
	jge	.eb3_2
2098
.eb3_3:
2098
.eb3_3:
2099
	push	edx
2099
	push	edx
2100
	mov	edx,[edit4.flags]
2100
	mov	edx,[edit4.flags]
2101
	and	edx,2
2101
	and	edx,2
2102
	jz	@f
2102
	jz	@f
2103
	pop	edx
2103
	pop	edx
2104
	dec	[edit4.shift]
2104
	dec	[edit4.shift]
2105
	dec	[edit4.shift+4]
2105
	dec	[edit4.shift+4]
2106
	jmp	.2
2106
	jmp	.2
2107
;--------------------------------------
2107
;--------------------------------------
2108
@@:
2108
@@:
2109
	pop	edx
2109
	pop	edx
2110
	dec	[edit5.shift]
2110
	dec	[edit5.shift]
2111
	dec	[edit5.shift+4]
2111
	dec	[edit5.shift+4]
2112
	jmp	.2
2112
	jmp	.2
2113
;--------------------------------------
2113
;--------------------------------------
2114
.eb3_1:
2114
.eb3_1:
2115
	push	edx
2115
	push	edx
2116
	mov	edx,[edit4.flags]
2116
	mov	edx,[edit4.flags]
2117
	and	edx,2
2117
	and	edx,2
2118
	jz	@f
2118
	jz	@f
2119
	pop	edx
2119
	pop	edx
2120
	mov	[edit5.flags],2
2120
	mov	[edit5.flags],2
2121
	mov	[edit4.flags],0
2121
	mov	[edit4.flags],0
2122
	jmp	.eb3_2
2122
	jmp	.eb3_2
2123
;--------------------------------------
2123
;--------------------------------------
2124
@@:
2124
@@:
2125
	pop	edx
2125
	pop	edx
2126
	mov	[edit4.flags],2
2126
	mov	[edit4.flags],2
2127
	mov	[edit5.flags],0
2127
	mov	[edit5.flags],0
2128
.eb3_2:
2128
.eb3_2:
2129
	push	dword [ed_box_data+4]
2129
	push	dword [ed_box_data+4]
2130
	call	[edit_box_key]
2130
	call	[edit_box_key]
2131
	push	dword [ed_box_data+8]
2131
	push	dword [ed_box_data+8]
2132
	call	[edit_box_key]
2132
	call	[edit_box_key]
2133
	jmp	.1
2133
	jmp	.1
2134
;--------------------------------------
2134
;--------------------------------------
2135
.eb:
2135
.eb:
2136
	push	dword [ed_box_data+4];[esp]
2136
	push	dword [ed_box_data+4];[esp]
2137
	call	[edit_box_key]
2137
	call	[edit_box_key]
2138
	jmp	.2
2138
	jmp	.2
2139
;--------------------------------------------------------------------
2139
;--------------------------------------------------------------------
2140
.button:
2140
.button:
2141
	mcall	SF_GET_BUTTON
2141
	mcall	SF_GET_BUTTON
2142
	cmp	ah,1
2142
	cmp	ah,1
2143
	jne	.2
2143
	jne	.2
2144
	jmp	close_prog
2144
	jmp	close_prog
2145
.3:
2145
.3:
2146
	btr	[flags],2
2146
	btr	[flags],2
2147
	btr	[flags],3
2147
	btr	[flags],3
2148
	add	esp,4
2148
	add	esp,4
2149
	jmp	redraw_all
2149
	jmp	redraw_all
2150
.4:
2150
.4:
2151
	mcall	SF_DRAW_RECT,180*65536+220,25*65536+70,frgrd_color
2151
	mcall	SF_DRAW_RECT,180*65536+220,25*65536+70,frgrd_color
2152
	ret
2152
	ret
2153
;--------------------------------------------------------------------
2153
;--------------------------------------------------------------------
2154
strtohex:
2154
strtohex:
2155
;enter: edi - pointer to string,ebx - pointer to size of string; exit: eax in hex
2155
;enter: edi - pointer to string,ebx - pointer to size of string; exit: eax in hex
2156
	mov	esi,hex8_string
2156
	mov	esi,hex8_string
2157
@@:
2157
@@:
2158
	mov	ah,[edi+ecx-1]	;®¡à ¡®âª  ¢¢¥¤ñ­­ëå ᨬ¢®«®¢
2158
	mov	ah,[edi+ecx-1]	;®¡à ¡®âª  ¢¢¥¤ñ­­ëå ᨬ¢®«®¢
2159
	sub	ah,48
2159
	sub	ah,48
2160
	cmp	ah,9
2160
	cmp	ah,9
2161
	jbe	.1
2161
	jbe	.1
2162
	sub	ah,7
2162
	sub	ah,7
2163
	cmp	ah,15
2163
	cmp	ah,15
2164
	jbe	.1
2164
	jbe	.1
2165
	sub	ah,32
2165
	sub	ah,32
2166
.1:
2166
.1:
2167
	mov	[esi+ecx-1],ah
2167
	mov	[esi+ecx-1],ah
2168
	dec	ecx
2168
	dec	ecx
2169
	jnz	@b
2169
	jnz	@b
2170
	mov	ecx,[ebx]
2170
	mov	ecx,[ebx]
2171
	xor	eax,eax
2171
	xor	eax,eax
2172
.2:
2172
.2:
2173
	shl	eax,4
2173
	shl	eax,4
2174
	or	al,[esi]
2174
	or	al,[esi]
2175
	inc	esi
2175
	inc	esi
2176
	dec	ecx
2176
	dec	ecx
2177
	jnz	.2
2177
	jnz	.2
2178
	ret
2178
	ret
2179
 
2179
 
2180
Ctrl_G:
2180
Ctrl_G:
2181
	bts	[flags],2
2181
	bts	[flags],2
2182
	mov	dword [ed_box_data],1
2182
	mov	dword [ed_box_data],1
2183
	mov	dword [ed_box_data+4],edit2
2183
	mov	dword [ed_box_data+4],edit2
2184
	call	draw_ed_box
2184
	call	draw_ed_box
2185
	btr	[flags],2
2185
	btr	[flags],2
2186
	mov	ecx,[edit2.size]
2186
	mov	ecx,[edit2.size]
2187
	test	ecx,ecx
2187
	test	ecx,ecx
2188
	jz	.end
2188
	jz	.end
2189
	cmp	ecx,8
2189
	cmp	ecx,8
2190
	jg	Ctrl_G
2190
	jg	Ctrl_G
2191
 
2191
 
2192
	mov	edi,go_to_string
2192
	mov	edi,go_to_string
2193
	mov	ebx,edit2.size
2193
	mov	ebx,edit2.size
2194
	call	strtohex
2194
	call	strtohex
2195
 
2195
 
2196
	cmp	eax,[file_size]	;¢ë¡®à check_box' 
2196
	cmp	eax,[file_size]	;¢ë¡®à check_box' 
2197
	jg	Ctrl_G
2197
	jg	Ctrl_G
2198
	mov	edx,[option_group1]
2198
	mov	edx,[option_group1]
2199
	cmp	edx,op1	;abs
2199
	cmp	edx,op1	;abs
2200
	je	.abs
2200
	je	.abs
2201
	cmp	edx,op2
2201
	cmp	edx,op2
2202
	jne	.back
2202
	jne	.back
2203
	add	eax,[current_offset]	;forward
2203
	add	eax,[current_offset]	;forward
2204
	cmp	eax,[file_size]
2204
	cmp	eax,[file_size]
2205
	jg	Ctrl_G
2205
	jg	Ctrl_G
2206
	mov	edi,[screen_table]
2206
	mov	edi,[screen_table]
2207
	mov	edi,[edi]
2207
	mov	edi,[edi]
2208
	xor	edx,edx
2208
	xor	edx,edx
2209
@@:
2209
@@:
2210
	add	edx,edi
2210
	add	edx,edi
2211
	cmp	eax,edx
2211
	cmp	eax,edx
2212
	jg	@b
2212
	jg	@b
2213
	sub	edx,edi
2213
	sub	edx,edi
2214
	mov	[begin_offset],edx
2214
	mov	[begin_offset],edx
2215
	sub	eax,edx
2215
	sub	eax,edx
2216
	shl	eax,1
2216
	shl	eax,1
2217
	inc	eax
2217
	inc	eax
2218
	mov	[cursor],eax
2218
	mov	[cursor],eax
2219
	jmp	.end
2219
	jmp	.end
2220
;--------------------------------------------------------------------
2220
;--------------------------------------------------------------------
2221
.back:
2221
.back:
2222
	cmp	eax,[current_offset]	;back
2222
	cmp	eax,[current_offset]	;back
2223
	jg	Ctrl_G
2223
	jg	Ctrl_G
2224
	mov	edi,[screen_table]
2224
	mov	edi,[screen_table]
2225
	mov	edi,[edi]
2225
	mov	edi,[edi]
2226
	mov	ebx,[current_offset]
2226
	mov	ebx,[current_offset]
2227
	sub	ebx,eax
2227
	sub	ebx,eax
2228
	xor	edx,edx
2228
	xor	edx,edx
2229
@@:
2229
@@:
2230
	add	edx,edi
2230
	add	edx,edi
2231
	cmp	edx,ebx
2231
	cmp	edx,ebx
2232
	jb	@b
2232
	jb	@b
2233
	sub	edx,edi
2233
	sub	edx,edi
2234
	mov	[begin_offset],edx
2234
	mov	[begin_offset],edx
2235
	sub	ebx,edx
2235
	sub	ebx,edx
2236
	mov	edx,ebx
2236
	mov	edx,ebx
2237
	shl	edx,1
2237
	shl	edx,1
2238
	inc	edx
2238
	inc	edx
2239
	mov	[cursor],edx
2239
	mov	[cursor],edx
2240
	jmp	.end
2240
	jmp	.end
2241
;--------------------------------------------------------------------
2241
;--------------------------------------------------------------------
2242
.abs:
2242
.abs:
2243
	mov	esi,[screen_table]
2243
	mov	esi,[screen_table]
2244
	mov	esi,[esi]
2244
	mov	esi,[esi]
2245
	xor	ebx,ebx
2245
	xor	ebx,ebx
2246
.3:
2246
.3:
2247
	add	ebx,esi
2247
	add	ebx,esi
2248
	cmp	eax,ebx
2248
	cmp	eax,ebx
2249
	jg	.3
2249
	jg	.3
2250
	sub	ebx,esi
2250
	sub	ebx,esi
2251
	cmp	ebx,[file_size]
2251
	cmp	ebx,[file_size]
2252
	jg	Ctrl_G
2252
	jg	Ctrl_G
2253
	mov	[begin_offset],ebx
2253
	mov	[begin_offset],ebx
2254
	sub	eax,ebx
2254
	sub	eax,ebx
2255
	shl	eax,1
2255
	shl	eax,1
2256
	inc	eax
2256
	inc	eax
2257
	mov	[cursor],eax
2257
	mov	[cursor],eax
2258
.end:
2258
.end:
2259
	jmp	red
2259
	jmp	red
2260
;--------------------------------------------------------------------
2260
;--------------------------------------------------------------------
2261
Ctrl_B:
2261
Ctrl_B:
2262
	bts	[flags],9
2262
	bts	[flags],9
2263
	mov	dword [ed_box_data],2
2263
	mov	dword [ed_box_data],2
2264
	mov	dword [ed_box_data+4],edit4
2264
	mov	dword [ed_box_data+4],edit4
2265
	mov	dword [ed_box_data+8],edit5
2265
	mov	dword [ed_box_data+8],edit5
2266
	call	draw_ed_box
2266
	call	draw_ed_box
2267
	btr	[flags],9
2267
	btr	[flags],9
2268
 
2268
 
2269
	mov	ecx,[edit4.size]
2269
	mov	ecx,[edit4.size]
2270
	test	ecx,ecx
2270
	test	ecx,ecx
2271
	jz	.end
2271
	jz	.end
2272
	cmp	ecx,8
2272
	cmp	ecx,8
2273
	jg	Ctrl_B
2273
	jg	Ctrl_B
2274
 
2274
 
2275
	mov	edi,sel1_string
2275
	mov	edi,sel1_string
2276
	mov	ebx,edit4.size
2276
	mov	ebx,edit4.size
2277
	call	strtohex
2277
	call	strtohex
2278
 
2278
 
2279
	cmp	eax,[file_size]
2279
	cmp	eax,[file_size]
2280
	jge	Ctrl_B
2280
	jge	Ctrl_B
2281
	push	eax	;from
2281
	push	eax	;from
2282
	mov	ecx,[edit5.size]
2282
	mov	ecx,[edit5.size]
2283
	test	ecx,ecx
2283
	test	ecx,ecx
2284
	jz	.end
2284
	jz	.end
2285
	cmp	ecx,8
2285
	cmp	ecx,8
2286
	jg	Ctrl_B
2286
	jg	Ctrl_B
2287
 
2287
 
2288
	mov	edi,sel2_string
2288
	mov	edi,sel2_string
2289
	mov	ebx,edit5.size
2289
	mov	ebx,edit5.size
2290
	call	strtohex
2290
	call	strtohex
2291
 
2291
 
2292
	cmp	eax,[file_size]
2292
	cmp	eax,[file_size]
2293
	jb	@f
2293
	jb	@f
2294
	pop	eax
2294
	pop	eax
2295
	jmp	Ctrl_B
2295
	jmp	Ctrl_B
2296
 
2296
 
2297
@@:
2297
@@:
2298
	pop	[shblock_beg]
2298
	pop	[shblock_beg]
2299
	cmp	eax,[shblock_beg]
2299
	cmp	eax,[shblock_beg]
2300
	jae	@f
2300
	jae	@f
2301
	xchg	eax,[shblock_beg]
2301
	xchg	eax,[shblock_beg]
2302
@@:
2302
@@:
2303
	mov	[shblock_end],eax
2303
	mov	[shblock_end],eax
2304
	bts	[flags],8
2304
	bts	[flags],8
2305
.end:
2305
.end:
2306
	jmp	red
2306
	jmp	red
2307
;--------------------------------------------------------------------
2307
;--------------------------------------------------------------------
2308
Ctrl_F:
2308
Ctrl_F:
2309
	bts	[flags],3
2309
	bts	[flags],3
2310
	mov	dword [ed_box_data],1
2310
	mov	dword [ed_box_data],1
2311
	mov	dword [ed_box_data+4],edit3
2311
	mov	dword [ed_box_data+4],edit3
2312
	call	draw_ed_box
2312
	call	draw_ed_box
2313
	btr	[flags],3
2313
	btr	[flags],3
2314
	mov	ecx,[edit3.size]
2314
	mov	ecx,[edit3.size]
2315
	test	ecx,ecx
2315
	test	ecx,ecx
2316
	jz	.end
2316
	jz	.end
2317
	cmp	ecx,8
2317
	cmp	ecx,8
2318
	jg	Ctrl_F
2318
	jg	Ctrl_F
2319
	mov	edi,find_string
2319
	mov	edi,find_string
2320
	mov	edx,[option_group2]
2320
	mov	edx,[option_group2]
2321
	cmp	edx,op11
2321
	cmp	edx,op11
2322
	jne	.find
2322
	jne	.find
2323
	mov	eax,find_string
2323
	mov	eax,find_string
2324
	push	dword [eax]
2324
	push	dword [eax]
2325
	push	dword [eax+4]
2325
	push	dword [eax+4]
2326
	bts	[flags],0
2326
	bts	[flags],0
2327
	mov	ebx,edit3.size
2327
	mov	ebx,edit3.size
2328
	call	strtohex
2328
	call	strtohex
2329
	mov	ecx,[edit3.size]
2329
	mov	ecx,[edit3.size]
2330
	bt	cx,0
2330
	bt	cx,0
2331
	jnc	.3
2331
	jnc	.3
2332
	inc	ecx
2332
	inc	ecx
2333
	shl	eax,4
2333
	shl	eax,4
2334
.3:
2334
.3:
2335
	shr	ecx,1
2335
	shr	ecx,1
2336
.4:
2336
.4:
2337
	mov	[edi+ecx-1],al
2337
	mov	[edi+ecx-1],al
2338
	shr	eax,8
2338
	shr	eax,8
2339
	loop	.4
2339
	loop	.4
2340
.find:
2340
.find:
2341
	mov	esi,[current_offset]
2341
	mov	esi,[current_offset]
2342
	mov	ebx,[file_size]
2342
	mov	ebx,[file_size]
2343
	mov	eax,ebx
2343
	mov	eax,ebx
2344
	add	eax,[file_buffer]
2344
	add	eax,[file_buffer]
2345
	add	esi,[file_buffer]
2345
	add	esi,[file_buffer]
2346
.5:
2346
.5:
2347
	mov	ecx,[edit3.size]
2347
	mov	ecx,[edit3.size]
2348
	cmp	edx,op11
2348
	cmp	edx,op11
2349
	jne	.7
2349
	jne	.7
2350
	bt	cx,0
2350
	bt	cx,0
2351
	jnc	.6
2351
	jnc	.6
2352
	inc	ecx
2352
	inc	ecx
2353
.6:
2353
.6:
2354
	shr	ecx,1
2354
	shr	ecx,1
2355
.7:
2355
.7:
2356
	cld
2356
	cld
2357
@@:
2357
@@:
2358
	cmp	esi,eax
2358
	cmp	esi,eax
2359
	jg	.end
2359
	jg	.end
2360
	cmpsb
2360
	cmpsb
2361
	je	.8
2361
	je	.8
2362
	mov	edi,find_string
2362
	mov	edi,find_string
2363
	jmp	.5
2363
	jmp	.5
2364
;--------------------------------------
2364
;--------------------------------------
2365
.8:
2365
.8:
2366
	loop	@b
2366
	loop	@b
2367
	sub	esi,[file_buffer]
2367
	sub	esi,[file_buffer]
2368
	mov	ecx,[edit3.size]
2368
	mov	ecx,[edit3.size]
2369
	cmp	edx,op11
2369
	cmp	edx,op11
2370
	jne	.10
2370
	jne	.10
2371
	bt	cx,0
2371
	bt	cx,0
2372
	jnc	.9
2372
	jnc	.9
2373
	inc	ecx
2373
	inc	ecx
2374
.9:
2374
.9:
2375
	shr	ecx,1
2375
	shr	ecx,1
2376
.10:
2376
.10:
2377
	sub	esi,ecx
2377
	sub	esi,ecx
2378
	xor	edx,edx
2378
	xor	edx,edx
2379
	mov	edi,[screen_table]
2379
	mov	edi,[screen_table]
2380
	mov	edi,[edi]
2380
	mov	edi,[edi]
2381
@@:
2381
@@:
2382
	add	edx,edi
2382
	add	edx,edi
2383
	cmp	edx,esi
2383
	cmp	edx,esi
2384
	jb	@b
2384
	jb	@b
2385
	sub	edx,edi
2385
	sub	edx,edi
2386
	mov	[begin_offset],edx
2386
	mov	[begin_offset],edx
2387
	sub	esi,edx
2387
	sub	esi,edx
2388
	shl	esi,1
2388
	shl	esi,1
2389
	inc	esi
2389
	inc	esi
2390
	mov	[cursor],esi
2390
	mov	[cursor],esi
2391
.end:
2391
.end:
2392
	bt	[flags],0
2392
	bt	[flags],0
2393
	jnc	@f
2393
	jnc	@f
2394
	mov	eax,find_string
2394
	mov	eax,find_string
2395
	pop	dword [eax+4]
2395
	pop	dword [eax+4]
2396
	pop	dword [eax]
2396
	pop	dword [eax]
2397
	btr	[flags],0
2397
	btr	[flags],0
2398
@@:
2398
@@:
2399
	jmp	red
2399
	jmp	red
2400
;--------------------------------------------------------------------
2400
;--------------------------------------------------------------------
2401
invert_byte:
2401
invert_byte:
2402
	mov	ebx,[current_offset]
2402
	mov	ebx,[current_offset]
2403
	cmp	ebx,[file_size]
2403
	cmp	ebx,[file_size]
2404
	jae	still
2404
	jae	still
2405
	add	ebx,[file_buffer]
2405
	add	ebx,[file_buffer]
2406
	not	byte [ebx]
2406
	not	byte [ebx]
2407
	jmp	red
2407
	jmp	red
2408
;--------------------------------------------------------------------
2408
;--------------------------------------------------------------------
2409
Insert:	;¯¥à¥ª«î祭¨¥	०¨¬ 	¢áâ ¢ª¨/§ ¬¥­ë
2409
Insert:	;¯¥à¥ª«î祭¨¥	०¨¬ 	¢áâ ¢ª¨/§ ¬¥­ë
2410
	btc	[flags],1	;not [insert_mod]
2410
	btc	[flags],1	;not [insert_mod]
2411
	call	show_insert
2411
	call	show_insert
2412
	jmp	red
2412
	jmp	red
2413
;--------------------------------------------------------------------
2413
;--------------------------------------------------------------------
2414
DEL:
2414
DEL:
2415
	bt	[flags],1
2415
	bt	[flags],1
2416
	jnc	still
2416
	jnc	still
2417
	mov	edi,[current_offset]
2417
	mov	edi,[current_offset]
2418
	mov	esi,[file_buffer]
2418
	mov	esi,[file_buffer]
2419
	mov	edx,[file_size]
2419
	mov	edx,[file_size]
2420
	test	edx,edx
2420
	test	edx,edx
2421
	jz	still
2421
	jz	still
2422
	dec	edx
2422
	dec	edx
2423
	cmp	edi,edx
2423
	cmp	edi,edx
2424
	jbe	@f
2424
	jbe	@f
2425
	call	LEFT
2425
	call	LEFT
2426
	call	LEFT
2426
	call	LEFT
2427
	jmp	red
2427
	jmp	red
2428
@@:
2428
@@:
2429
	jb	@f
2429
	jb	@f
2430
	call	LEFT
2430
	call	LEFT
2431
	call	LEFT
2431
	call	LEFT
2432
@@:
2432
@@:
2433
	cmp	edi,edx
2433
	cmp	edi,edx
2434
	je	@f
2434
	je	@f
2435
	mov	al,[edi+esi+1]
2435
	mov	al,[edi+esi+1]
2436
	mov	[edi+esi],al
2436
	mov	[edi+esi],al
2437
	inc	edi
2437
	inc	edi
2438
	jmp	@b
2438
	jmp	@b
2439
@@:
2439
@@:
2440
	dec	[file_size]
2440
	dec	[file_size]
2441
	call	show_file_size
2441
	call	show_file_size
2442
	jmp	red
2442
	jmp	red
2443
;--------------------------------------------------------------------
2443
;--------------------------------------------------------------------
2444
BackSpace:
2444
BackSpace:
2445
	bt	[flags],1	;cmp [insert_mod],0
2445
	bt	[flags],1	;cmp [insert_mod],0
2446
	jnc	still	;je still
2446
	jnc	still	;je still
2447
	mov	edi,[current_offset]
2447
	mov	edi,[current_offset]
2448
	mov	esi,[file_buffer]
2448
	mov	esi,[file_buffer]
2449
	mov	edx,[file_size]
2449
	mov	edx,[file_size]
2450
	test	edx,edx
2450
	test	edx,edx
2451
	jz	still
2451
	jz	still
2452
	test	edi,edi
2452
	test	edi,edi
2453
	jz	still
2453
	jz	still
2454
	call	LEFT
2454
	call	LEFT
2455
	call	LEFT
2455
	call	LEFT
2456
	cmp	[cursor],2
2456
	cmp	[cursor],2
2457
	jne	@f
2457
	jne	@f
2458
	cmp	edx,1
2458
	cmp	edx,1
2459
	jne	@f
2459
	jne	@f
2460
	dec	[cursor]
2460
	dec	[cursor]
2461
@@:
2461
@@:
2462
	cmp	edi,edx
2462
	cmp	edi,edx
2463
	jge	@f
2463
	jge	@f
2464
	mov	al,[edi+esi]
2464
	mov	al,[edi+esi]
2465
	mov	[edi+esi-1],al
2465
	mov	[edi+esi-1],al
2466
	inc	edi
2466
	inc	edi
2467
	jmp	@b
2467
	jmp	@b
2468
;--------------------------------------
2468
;--------------------------------------
2469
@@:
2469
@@:
2470
	dec	[file_size]
2470
	dec	[file_size]
2471
	call	show_file_size
2471
	call	show_file_size
2472
	jmp	red
2472
	jmp	red
2473
;--------------------------------------------------------------------
2473
;--------------------------------------------------------------------
2474
Ctrl_UP:
2474
Ctrl_UP:
2475
	cmp	[begin_offset],0
2475
	cmp	[begin_offset],0
2476
	je	@f
2476
	je	@f
2477
	mov	eax,[bytes_per_line]
2477
	mov	eax,[bytes_per_line]
2478
	sub	[begin_offset],eax
2478
	sub	[begin_offset],eax
2479
@@:
2479
@@:
2480
	ret
2480
	ret
2481
;--------------------------------------------------------------------
2481
;--------------------------------------------------------------------
2482
Ctrl_DOWN:
2482
Ctrl_DOWN:
2483
	mov	eax,[cursor]
2483
	mov	eax,[cursor]
2484
	dec	eax
2484
	dec	eax
2485
	shr	eax,1
2485
	shr	eax,1
2486
	add	eax,[begin_offset]
2486
	add	eax,[begin_offset]
2487
	mov	ebx,[bytes_per_line]
2487
	mov	ebx,[bytes_per_line]
2488
	add	eax,ebx
2488
	add	eax,ebx
2489
	cmp	eax,[file_size]
2489
	cmp	eax,[file_size]
2490
	jge	@f
2490
	jge	@f
2491
	add	[begin_offset],ebx
2491
	add	[begin_offset],ebx
2492
@@:
2492
@@:
2493
	ret
2493
	ret
2494
;--------------------------------------------------------------------
2494
;--------------------------------------------------------------------
2495
UP:
2495
UP:
2496
	mov	eax,[current_offset]
2496
	mov	eax,[current_offset]
2497
	cmp	eax,[bytes_per_line]
2497
	cmp	eax,[bytes_per_line]
2498
	jb	still
2498
	jb	still
2499
	mov	eax,[cursor]
2499
	mov	eax,[cursor]
2500
	dec	ax
2500
	dec	ax
2501
	shr	ax,1
2501
	shr	ax,1
2502
	cmp	eax,[bytes_per_line]
2502
	cmp	eax,[bytes_per_line]
2503
	jge	@f
2503
	jge	@f
2504
	mov	eax,[bytes_per_line]
2504
	mov	eax,[bytes_per_line]
2505
	sub	[begin_offset],eax
2505
	sub	[begin_offset],eax
2506
	jmp	red
2506
	jmp	red
2507
@@:
2507
@@:
2508
	mov	eax,[bytes_per_line]
2508
	mov	eax,[bytes_per_line]
2509
	shl	ax,1
2509
	shl	ax,1
2510
	sub	[cursor],eax
2510
	sub	[cursor],eax
2511
	jmp	red
2511
	jmp	red
2512
;--------------------------------------------------------------------
2512
;--------------------------------------------------------------------
2513
DOWN:	;­ 	áâபã	¢­¨§
2513
DOWN:	;­ 	áâபã	¢­¨§
2514
	mov	eax,[current_offset]
2514
	mov	eax,[current_offset]
2515
	add	eax,[bytes_per_line]
2515
	add	eax,[bytes_per_line]
2516
	bt	[flags],1
2516
	bt	[flags],1
2517
	jnc	@f
2517
	jnc	@f
2518
	dec	eax
2518
	dec	eax
2519
@@:
2519
@@:
2520
	cmp	eax,[file_size]
2520
	cmp	eax,[file_size]
2521
	jge	still	;¥á«¨ ¬ë ­  ¯®á«¥¤­¥© áâப¥ ä ©« , â® á⮯
2521
	jge	still	;¥á«¨ ¬ë ­  ¯®á«¥¤­¥© áâப¥ ä ©« , â® á⮯
2522
	mov	eax,[screen_table]
2522
	mov	eax,[screen_table]
2523
	mov	eax,[eax]
2523
	mov	eax,[eax]
2524
	mov	edx,[cursor]
2524
	mov	edx,[cursor]
2525
	dec	dx
2525
	dec	dx
2526
	shr	dx,1
2526
	shr	dx,1
2527
	add	edx,[bytes_per_line]
2527
	add	edx,[bytes_per_line]
2528
	cmp	eax,edx	;­  ¯®á«¥¤­¥© áâப¥?
2528
	cmp	eax,edx	;­  ¯®á«¥¤­¥© áâப¥?
2529
	jbe	@f
2529
	jbe	@f
2530
	mov	eax,[bytes_per_line]
2530
	mov	eax,[bytes_per_line]
2531
	shl	ax,1
2531
	shl	ax,1
2532
	add	[cursor],eax
2532
	add	[cursor],eax
2533
	ret
2533
	ret
2534
@@:
2534
@@:
2535
	mov	eax,[bytes_per_line]
2535
	mov	eax,[bytes_per_line]
2536
	add	[begin_offset],eax
2536
	add	[begin_offset],eax
2537
	ret
2537
	ret
2538
;--------------------------------------------------------------------
2538
;--------------------------------------------------------------------
2539
LEFT:
2539
LEFT:
2540
	cmp	[cursor],1
2540
	cmp	[cursor],1
2541
	jbe	@f
2541
	jbe	@f
2542
	dec	[cursor]
2542
	dec	[cursor]
2543
	jmp	.end
2543
	jmp	.end
2544
;--------------------------------------
2544
;--------------------------------------
2545
@@:
2545
@@:
2546
	cmp	[begin_offset],0	;ªãàá®à	­  ¯¥à¢®© áâப¥ ᮠᬥ饭¨¥¬ 0?
2546
	cmp	[begin_offset],0	;ªãàá®à	­  ¯¥à¢®© áâப¥ ᮠᬥ饭¨¥¬ 0?
2547
	jne	@f	;¨­ ç¥ ᬥ頥¬ á ¯à®ªàã⪮© ¢¢¥àå ¢¢¥àå ¨ ¢ ª®­¥æ áâப¨
2547
	jne	@f	;¨­ ç¥ ᬥ頥¬ á ¯à®ªàã⪮© ¢¢¥àå ¢¢¥àå ¨ ¢ ª®­¥æ áâப¨
2548
;	inc	[cursor]
2548
;	inc	[cursor]
2549
	jmp	.end;still	;⮣¤  á⮯
2549
	jmp	.end;still	;⮣¤  á⮯
2550
;--------------------------------------
2550
;--------------------------------------
2551
@@:
2551
@@:
2552
	mov	eax,[bytes_per_line]
2552
	mov	eax,[bytes_per_line]
2553
	sub	[begin_offset],eax
2553
	sub	[begin_offset],eax
2554
	shl	ax,1
2554
	shl	ax,1
2555
	dec	eax
2555
	dec	eax
2556
	add	[cursor],eax
2556
	add	[cursor],eax
2557
.end:
2557
.end:
2558
	ret
2558
	ret
2559
;--------------------------------------------------------------------
2559
;--------------------------------------------------------------------
2560
RIGHT:
2560
RIGHT:
2561
	mov	ecx,[begin_offset]	;¢ëç¨á«ï¥¬ ᬥ饭¨¥ ªãàá®à 
2561
	mov	ecx,[begin_offset]	;¢ëç¨á«ï¥¬ ᬥ饭¨¥ ªãàá®à 
2562
	mov	edx,[cursor]	;¤«ï ¯à®¢¥àª¨ áãé¥á⢮¢ ­¨ï
2562
	mov	edx,[cursor]	;¤«ï ¯à®¢¥àª¨ áãé¥á⢮¢ ­¨ï
2563
	shr	edx,1	;á«¥¤ãî饣® ᨬ¢®« 
2563
	shr	edx,1	;á«¥¤ãî饣® ᨬ¢®« 
2564
	add	ecx,edx
2564
	add	ecx,edx
2565
	bt	[flags],1
2565
	bt	[flags],1
2566
	jnc	@f
2566
	jnc	@f
2567
	dec	ecx	;áà ¢­¨¢ ¥¬ á à §¬¥à®¬ ä ©« 
2567
	dec	ecx	;áà ¢­¨¢ ¥¬ á à §¬¥à®¬ ä ©« 
2568
@@:
2568
@@:
2569
	cmp	ecx,[file_size]	;¯®«®¦¥­¨¥¬ ªãàá®à  - ­¥ ¤ «¥¥ 1 ¡ ©â  ®â ª®­æ  ä ©« 
2569
	cmp	ecx,[file_size]	;¯®«®¦¥­¨¥¬ ªãàá®à  - ­¥ ¤ «¥¥ 1 ¡ ©â  ®â ª®­æ  ä ©« 
2570
	jge	red
2570
	jge	red
2571
	cmp	[file_size],0
2571
	cmp	[file_size],0
2572
	je	still
2572
	je	still
2573
	mov	eax,[screen_table]
2573
	mov	eax,[screen_table]
2574
	mov	eax,[eax]
2574
	mov	eax,[eax]
2575
	mov	ecx,[begin_offset]
2575
	mov	ecx,[begin_offset]
2576
	cmp	eax,edx	;áà ¢­¥­¨¥ ­  ­¨¦­îî áâபã
2576
	cmp	eax,edx	;áà ¢­¥­¨¥ ­  ­¨¦­îî áâபã
2577
	jbe	@f
2577
	jbe	@f
2578
	inc	[cursor]	;ªãàá®à ¢¯à ¢®
2578
	inc	[cursor]	;ªãàá®à ¢¯à ¢®
2579
	jmp	red
2579
	jmp	red
2580
;--------------------------------------
2580
;--------------------------------------
2581
@@:
2581
@@:
2582
	mov	ecx,[bytes_per_line]	;ᬥ頥¬áï ­  áâà®çªã ¢­¨§
2582
	mov	ecx,[bytes_per_line]	;ᬥ頥¬áï ­  áâà®çªã ¢­¨§
2583
	add	[begin_offset],ecx	;á ¯à®ªàã⪮©
2583
	add	[begin_offset],ecx	;á ¯à®ªàã⪮©
2584
	shl	cx,1
2584
	shl	cx,1
2585
	dec	cx
2585
	dec	cx
2586
	sub	[cursor],ecx
2586
	sub	[cursor],ecx
2587
	jmp	red
2587
	jmp	red
2588
;--------------------------------------------------------------------
2588
;--------------------------------------------------------------------
2589
PGDN:
2589
PGDN:
2590
	mov	edi,[screen_table]
2590
	mov	edi,[screen_table]
2591
	mov	eax,[edi]
2591
	mov	eax,[edi]
2592
	shl	eax,1
2592
	shl	eax,1
2593
	add	eax,[begin_offset]
2593
	add	eax,[begin_offset]
2594
	cmp	eax,[file_size]	;¥áâì «¨ ¢®§¬®¦­®áâì ᬥáâ¨âìáï ­  áâà ­¨æã?
2594
	cmp	eax,[file_size]	;¥áâì «¨ ¢®§¬®¦­®áâì ᬥáâ¨âìáï ­  áâà ­¨æã?
2595
	jg	Ctrl_END
2595
	jg	Ctrl_END
2596
	mov	eax,[edi]
2596
	mov	eax,[edi]
2597
	add	[begin_offset],eax
2597
	add	[begin_offset],eax
2598
;	mov	ebx,[cursor]
2598
;	mov	ebx,[cursor]
2599
;	dec	ebx
2599
;	dec	ebx
2600
;	xor	ecx,ecx
2600
;	xor	ecx,ecx
2601
;	bt	ebx,0
2601
;	bt	ebx,0
2602
;	jnc	@f
2602
;	jnc	@f
2603
;	inc	ecx
2603
;	inc	ecx
2604
;	@@:	shr	ebx,1
2604
;	@@:	shr	ebx,1
2605
;	add	ebx,eax
2605
;	add	ebx,eax
2606
;	@@:	cmp	ebx,[file_size]
2606
;	@@:	cmp	ebx,[file_size]
2607
;	jbe	@f
2607
;	jbe	@f
2608
;	sub	ebx,[bytes_per_line]
2608
;	sub	ebx,[bytes_per_line]
2609
;	jmp	@b
2609
;	jmp	@b
2610
;	@@:	sub	ebx,eax
2610
;	@@:	sub	ebx,eax
2611
;	shl	ebx,1
2611
;	shl	ebx,1
2612
;	inc	ebx
2612
;	inc	ebx
2613
;	add	ebx,ecx
2613
;	add	ebx,ecx
2614
;	mov	[cursor],ebx
2614
;	mov	[cursor],ebx
2615
	jmp	red
2615
	jmp	red
2616
;--------------------------------------------------------------------
2616
;--------------------------------------------------------------------
2617
PGUP:
2617
PGUP:
2618
	mov	eax,[screen_table]
2618
	mov	eax,[screen_table]
2619
	mov	eax,[eax]
2619
	mov	eax,[eax]
2620
	mov	edx,[begin_offset]
2620
	mov	edx,[begin_offset]
2621
	cmp	eax,edx
2621
	cmp	eax,edx
2622
	jbe	@f
2622
	jbe	@f
2623
	call	Ctrl_HOME
2623
	call	Ctrl_HOME
2624
	jmp	red
2624
	jmp	red
2625
;--------------------------------------
2625
;--------------------------------------
2626
@@:
2626
@@:
2627
	sub	[begin_offset],eax
2627
	sub	[begin_offset],eax
2628
	jmp	red
2628
	jmp	red
2629
;--------------------------------------------------------------------
2629
;--------------------------------------------------------------------
2630
HOME:
2630
HOME:
2631
	mov	eax,[cursor]
2631
	mov	eax,[cursor]
2632
	dec	ax
2632
	dec	ax
2633
	shr	ax,1
2633
	shr	ax,1
2634
	mov	ecx,[bytes_per_line]
2634
	mov	ecx,[bytes_per_line]
2635
	xor	edx,edx
2635
	xor	edx,edx
2636
	div	ecx
2636
	div	ecx
2637
	shl	dx,1
2637
	shl	dx,1
2638
	sub	[cursor],edx
2638
	sub	[cursor],edx
2639
	bt	[cursor],0
2639
	bt	[cursor],0
2640
	jc	@f
2640
	jc	@f
2641
	dec	[cursor]
2641
	dec	[cursor]
2642
@@:
2642
@@:
2643
	ret
2643
	ret
2644
;--------------------------------------------------------------------
2644
;--------------------------------------------------------------------
2645
END_:
2645
END_:
2646
	mov	eax,[cursor]
2646
	mov	eax,[cursor]
2647
	dec	ax
2647
	dec	ax
2648
	shr	ax,1
2648
	shr	ax,1
2649
	mov	ecx,[bytes_per_line]
2649
	mov	ecx,[bytes_per_line]
2650
	xor	edx,edx
2650
	xor	edx,edx
2651
	div	ecx
2651
	div	ecx
2652
	mov	eax,[current_offset]
2652
	mov	eax,[current_offset]
2653
	sub	eax,edx
2653
	sub	eax,edx
2654
	add	eax,[bytes_per_line]
2654
	add	eax,[bytes_per_line]
2655
	mov	edx,[file_size]
2655
	mov	edx,[file_size]
2656
	cmp	eax,edx
2656
	cmp	eax,edx
2657
	jbe	@f
2657
	jbe	@f
2658
	sub	edx,eax
2658
	sub	edx,eax
2659
	add	eax,edx
2659
	add	eax,edx
2660
@@:
2660
@@:
2661
	sub	eax,[begin_offset]
2661
	sub	eax,[begin_offset]
2662
	shl	eax,1
2662
	shl	eax,1
2663
	test	eax,eax
2663
	test	eax,eax
2664
	jz	red
2664
	jz	red
2665
	dec	eax
2665
	dec	eax
2666
	mov	[cursor],eax
2666
	mov	[cursor],eax
2667
	jmp	red
2667
	jmp	red
2668
;--------------------------------------------------------------------
2668
;--------------------------------------------------------------------
2669
Ctrl_HOME:
2669
Ctrl_HOME:
2670
	mov	[begin_offset],0
2670
	mov	[begin_offset],0
2671
	mov	[cursor],1
2671
	mov	[cursor],1
2672
	ret
2672
	ret
2673
;--------------------------------------------------------------------
2673
;--------------------------------------------------------------------
2674
Ctrl_END:
2674
Ctrl_END:
2675
	mov	eax,[file_size]
2675
	mov	eax,[file_size]
2676
	mov	ecx,[screen_table]
2676
	mov	ecx,[screen_table]
2677
	mov	ecx,[ecx]
2677
	mov	ecx,[ecx]
2678
	xor	edx,edx
2678
	xor	edx,edx
2679
	div	ecx
2679
	div	ecx
2680
	test	dx,dx
2680
	test	dx,dx
2681
	jnz	@f
2681
	jnz	@f
2682
	test	eax,eax
2682
	test	eax,eax
2683
	jz	@f
2683
	jz	@f
2684
	mov	edx,ecx
2684
	mov	edx,ecx
2685
	dec	eax
2685
	dec	eax
2686
@@:
2686
@@:
2687
	push	dx
2687
	push	dx
2688
	xor	dx,dx
2688
	xor	dx,dx
2689
	mul	ecx
2689
	mul	ecx
2690
	pop	dx
2690
	pop	dx
2691
	shl	edx,1
2691
	shl	edx,1
2692
	cmp	edx,1
2692
	cmp	edx,1
2693
	jg	@f
2693
	jg	@f
2694
	mov	edx,2
2694
	mov	edx,2
2695
@@:
2695
@@:
2696
	dec	edx
2696
	dec	edx
2697
	mov	[begin_offset],eax
2697
	mov	[begin_offset],eax
2698
	mov	[cursor],edx
2698
	mov	[cursor],edx
2699
	jmp	red
2699
	jmp	red
2700
;--------------------------------------------------------------------
2700
;--------------------------------------------------------------------
2701
ESC:
2701
ESC:
2702
	btr	[flags],8
2702
	btr	[flags],8
2703
	jmp	red
2703
	jmp	red
2704
;--------------------------------------------------------------------
2704
;--------------------------------------------------------------------
2705
copy_to_buf:
2705
copy_to_buf:
2706
	bt	[flags],8
2706
	bt	[flags],8
2707
	jnc	.1
2707
	jnc	.1
2708
	mov	eax,[shblock_end]
2708
	mov	eax,[shblock_end]
2709
	sub	eax,[shblock_beg]
2709
	sub	eax,[shblock_beg]
2710
	inc	eax
2710
	inc	eax
2711
	mov	ecx,eax
2711
	mov	ecx,eax
2712
	mov	[copy_len],eax
2712
	mov	[copy_len],eax
2713
	mcall	SF_SYS_MISC,SSF_MEM_REALLOC,,[copy_buf]
2713
	mcall	SF_SYS_MISC,SSF_MEM_REALLOC,,[copy_buf]
2714
	mov	esi,[shblock_beg]
2714
	mov	esi,[shblock_beg]
2715
	mov	edi,[copy_buf]
2715
	mov	edi,[copy_buf]
2716
	add	esi,[file_buffer]
2716
	add	esi,[file_buffer]
2717
	mov	ecx,[copy_len]
2717
	mov	ecx,[copy_len]
2718
	cld
2718
	cld
2719
@@:
2719
@@:
2720
	movsb
2720
	movsb
2721
	loop	@b
2721
	loop	@b
2722
	bts	[flags],10
2722
	bts	[flags],10
2723
	xor	eax,eax
2723
	xor	eax,eax
2724
	ret
2724
	ret
2725
;---------------------------------------------------------------------
2725
;---------------------------------------------------------------------
2726
.1:
2726
.1:
2727
	or	eax,-1
2727
	or	eax,-1
2728
	ret
2728
	ret
2729
;--------------------------------------------------------------------
2729
;--------------------------------------------------------------------
2730
Ctrl_C:
2730
Ctrl_C:
2731
	call	copy_to_buf
2731
	call	copy_to_buf
2732
	jmp	still
2732
	jmp	still
2733
;--------------------------------------------------------------------
2733
;--------------------------------------------------------------------
2734
shblock_sz	dd	0
2734
shblock_sz	dd	0
2735
;--------------------------------------------------------------------
2735
;--------------------------------------------------------------------
2736
Ctrl_V:
2736
Ctrl_V:
2737
	bt	[flags],10
2737
	bt	[flags],10
2738
	jnc	still
2738
	jnc	still
2739
	bt	[flags],8
2739
	bt	[flags],8
2740
	jnc	.past_kurs
2740
	jnc	.past_kurs
2741
;¢áâ ¢«ï¥¬ ¡«®ª ¢ ¢ë¤¥«¥­­ãî ®¡« áâì
2741
;¢áâ ¢«ï¥¬ ¡«®ª ¢ ¢ë¤¥«¥­­ãî ®¡« áâì
2742
	mov	ebx,[shblock_end]
2742
	mov	ebx,[shblock_end]
2743
	sub	ebx,[shblock_beg]
2743
	sub	ebx,[shblock_beg]
2744
	inc	ebx
2744
	inc	ebx
2745
	mov	[shblock_sz],ebx
2745
	mov	[shblock_sz],ebx
2746
	mov	esi,[copy_buf]
2746
	mov	esi,[copy_buf]
2747
	mov	edi,[file_buffer]
2747
	mov	edi,[file_buffer]
2748
	add	edi,[shblock_beg]
2748
	add	edi,[shblock_beg]
2749
	mov	eax,[copy_len]
2749
	mov	eax,[copy_len]
2750
.1:
2750
.1:
2751
	cld
2751
	cld
2752
@@:
2752
@@:
2753
	movsb
2753
	movsb
2754
	dec	eax
2754
	dec	eax
2755
	jz	.del
2755
	jz	.del
2756
	dec	ebx
2756
	dec	ebx
2757
	jnz	@b
2757
	jnz	@b
2758
.add:
2758
.add:
2759
	push	esi	edi	eax
2759
	push	esi	edi	eax
2760
	push	[file_size]
2760
	push	[file_size]
2761
	add	[file_size],eax
2761
	add	[file_size],eax
2762
	call	raspred_mem
2762
	call	raspred_mem
2763
	pop	ecx
2763
	pop	ecx
2764
	mov	edi,[esp+4]
2764
	mov	edi,[esp+4]
2765
	add	ecx,[file_buffer]
2765
	add	ecx,[file_buffer]
2766
	sub	ecx,edi
2766
	sub	ecx,edi
2767
	inc	ecx
2767
	inc	ecx
2768
	mov	edi,[file_size]
2768
	mov	edi,[file_size]
2769
	add	edi,[file_buffer]
2769
	add	edi,[file_buffer]
2770
	mov	esi,edi
2770
	mov	esi,edi
2771
	sub	esi,eax
2771
	sub	esi,eax
2772
	std
2772
	std
2773
@@:
2773
@@:
2774
	movsb
2774
	movsb
2775
	loop	@b
2775
	loop	@b
2776
	pop	eax edi esi
2776
	pop	eax edi esi
2777
	cld
2777
	cld
2778
@@:
2778
@@:
2779
	movsb
2779
	movsb
2780
	dec	eax
2780
	dec	eax
2781
	jnz	@b
2781
	jnz	@b
2782
	mov	eax,[shblock_beg]
2782
	mov	eax,[shblock_beg]
2783
	add	eax,[copy_len]
2783
	add	eax,[copy_len]
2784
	dec	eax
2784
	dec	eax
2785
	mov	[shblock_end],eax
2785
	mov	[shblock_end],eax
2786
	jmp	red
2786
	jmp	red
2787
;--------------------------------------
2787
;--------------------------------------
2788
.del:
2788
.del:
2789
	dec	ebx
2789
	dec	ebx
2790
	jz	red
2790
	jz	red
2791
	mov	ecx,[file_size]
2791
	mov	ecx,[file_size]
2792
	add	ecx,[file_buffer]
2792
	add	ecx,[file_buffer]
2793
	sub	ecx,edi
2793
	sub	ecx,edi
2794
	mov	esi,edi
2794
	mov	esi,edi
2795
	add	esi,ebx
2795
	add	esi,ebx
2796
	cld
2796
	cld
2797
@@:
2797
@@:
2798
	movsb
2798
	movsb
2799
	loop	@b
2799
	loop	@b
2800
	sub	[file_size],ebx
2800
	sub	[file_size],ebx
2801
	call	raspred_mem
2801
	call	raspred_mem
2802
	mov	eax,[shblock_beg]
2802
	mov	eax,[shblock_beg]
2803
	add	eax,[copy_len]
2803
	add	eax,[copy_len]
2804
	dec	eax
2804
	dec	eax
2805
	mov	[shblock_end],eax
2805
	mov	[shblock_end],eax
2806
	jmp	red
2806
	jmp	red
2807
;--------------------------------------------------------------------
2807
;--------------------------------------------------------------------
2808
;¥á«¨ ¡«®ª ­¥ ¢ë¤¥«¥­, â® ¢áâ ¢«ï¥¬ ¡«®ª ¯¥à¥¤ ªãàá®à®¬ 
2808
;¥á«¨ ¡«®ª ­¥ ¢ë¤¥«¥­, â® ¢áâ ¢«ï¥¬ ¡«®ª ¯¥à¥¤ ªãàá®à®¬ 
2809
.past_kurs:
2809
.past_kurs:
2810
;	bt	[flags],1
2810
;	bt	[flags],1
2811
;	jnc	still
2811
;	jnc	still
2812
;	mov	esi,[file_buffer]
2812
;	mov	esi,[file_buffer]
2813
;	add	esi,[current_offset]
2813
;	add	esi,[current_offset]
2814
;	jmp	red
2814
;	jmp	red
2815
	jmp	still
2815
	jmp	still
2816
;--------------------------------------------------------------------
2816
;--------------------------------------------------------------------
2817
Ctrl_X:
2817
Ctrl_X:
2818
	bt	[flags],1
2818
	bt	[flags],1
2819
	jnc	still
2819
	jnc	still
2820
	call	copy_to_buf
2820
	call	copy_to_buf
2821
	test	eax,eax
2821
	test	eax,eax
2822
	jnz	still
2822
	jnz	still
2823
 
2823
 
2824
	mov	ecx,[file_size]
2824
	mov	ecx,[file_size]
2825
	sub	ecx,[copy_len]
2825
	sub	ecx,[copy_len]
2826
	sub	ecx,[shblock_beg]
2826
	sub	ecx,[shblock_beg]
2827
	inc	ecx
2827
	inc	ecx
2828
	mov	ebx,[file_size]
2828
	mov	ebx,[file_size]
2829
	mov	edi,[shblock_beg]
2829
	mov	edi,[shblock_beg]
2830
	mov	esi,[shblock_end]
2830
	mov	esi,[shblock_end]
2831
	inc	esi
2831
	inc	esi
2832
	add	esi,[file_buffer]
2832
	add	esi,[file_buffer]
2833
	add	edi,[file_buffer]
2833
	add	edi,[file_buffer]
2834
	add	ebx,[file_buffer]
2834
	add	ebx,[file_buffer]
2835
	cld
2835
	cld
2836
@@:
2836
@@:
2837
	cmp	esi,ebx
2837
	cmp	esi,ebx
2838
	je	.1
2838
	je	.1
2839
	movsb
2839
	movsb
2840
	loop	@b
2840
	loop	@b
2841
.1:
2841
.1:
2842
	mov	eax,[file_size]
2842
	mov	eax,[file_size]
2843
	sub	eax,[copy_len]
2843
	sub	eax,[copy_len]
2844
	mov	[file_size],eax
2844
	mov	[file_size],eax
2845
	btr	[flags],8
2845
	btr	[flags],8
2846
 
2846
 
2847
	mov	eax,[shblock_beg]
2847
	mov	eax,[shblock_beg]
2848
	mov	esi,[screen_table]
2848
	mov	esi,[screen_table]
2849
	mov	esi,[esi]
2849
	mov	esi,[esi]
2850
	xor	ebx,ebx
2850
	xor	ebx,ebx
2851
.3:
2851
.3:
2852
	add	ebx,esi
2852
	add	ebx,esi
2853
	cmp	eax,ebx
2853
	cmp	eax,ebx
2854
	jg	.3
2854
	jg	.3
2855
	sub	ebx,esi
2855
	sub	ebx,esi
2856
;	cmp	ebx,[file_size]
2856
;	cmp	ebx,[file_size]
2857
;	jg	Ctrl_G
2857
;	jg	Ctrl_G
2858
	mov	[begin_offset],ebx
2858
	mov	[begin_offset],ebx
2859
	sub	eax,ebx
2859
	sub	eax,ebx
2860
	shl	eax,1
2860
	shl	eax,1
2861
	inc	eax
2861
	inc	eax
2862
	mov	[cursor],eax
2862
	mov	[cursor],eax
2863
	jmp	red
2863
	jmp	red
2864
;---------------------------------------------------------------------
2864
;---------------------------------------------------------------------
2865
open_dialog:
2865
open_dialog:
2866
	mov	[OpenDialog_data.type],0	; Open
2866
	mov	[OpenDialog_data.type],0	; Open
2867
 
2867
 
2868
	push    dword OpenDialog_data
2868
	push    dword OpenDialog_data
2869
	call    [OpenDialog_Start]
2869
	call    [OpenDialog_Start]
2870
 
2870
 
2871
;	cmp	[OpenDialog_data.status],2	; OpenDialog does not start
2871
;	cmp	[OpenDialog_data.status],2	; OpenDialog does not start
2872
	cmp	[OpenDialog_data.status],1
2872
	cmp	[OpenDialog_data.status],1
2873
	jne	still
2873
	jne	still
2874
.start:
2874
.start:
2875
	mov	esi,fname_buf
2875
	mov	esi,fname_buf
2876
.load:
2876
.load:
2877
	mov	edi,file_name
2877
	mov	edi,file_name
2878
	cld
2878
	cld
2879
@@:
2879
@@:
2880
	cmp	byte [esi],0
2880
	cmp	byte [esi],0
2881
	je	@f
2881
	je	@f
2882
	movsb
2882
	movsb
2883
	jmp	@b
2883
	jmp	@b
2884
@@:
2884
@@:
2885
	mov	byte [edi],0
2885
	mov	byte [edi],0
2886
	sub	esi,path
2886
	sub	esi,path
2887
	mov	[edit1.size],esi
2887
	mov	[edit1.size],esi
2888
	mov	[edit1.pos],esi
2888
	mov	[edit1.pos],esi
2889
	jmp	open_file
2889
	jmp	open_file
2890
;---------------------------------------------------------------------
2890
;---------------------------------------------------------------------
2891
;----------------------- DATA AREA------------------------
2891
;----------------------- DATA AREA------------------------
2892
;--------------------------------------------------------------------
2892
;--------------------------------------------------------------------
2893
align 4
2893
align 4
2894
ProcLib_import:
2894
ProcLib_import:
2895
OpenDialog_Init		dd aOpenDialog_Init
2895
OpenDialog_Init		dd aOpenDialog_Init
2896
OpenDialog_Start	dd aOpenDialog_Start
2896
OpenDialog_Start	dd aOpenDialog_Start
2897
;OpenDialog__Version	dd aOpenDialog_Version
2897
;OpenDialog__Version	dd aOpenDialog_Version
2898
        dd      0,0
2898
        dd      0,0
2899
aOpenDialog_Init	db 'OpenDialog_init',0
2899
aOpenDialog_Init	db 'OpenDialog_init',0
2900
aOpenDialog_Start	db 'OpenDialog_start',0
2900
aOpenDialog_Start	db 'OpenDialog_start',0
2901
;aOpenDialog_Version	db 'Version_OpenDialog',0
2901
;aOpenDialog_Version	db 'Version_OpenDialog',0
2902
;---------------------------------------------------------------------
2902
;---------------------------------------------------------------------
2903
align	4
2903
align	4
2904
Box_lib_import:
2904
Box_lib_import:
2905
edit_box_draw		dd aEdit_box_draw
2905
edit_box_draw		dd aEdit_box_draw
2906
edit_box_key		dd aEdit_box_key
2906
edit_box_key		dd aEdit_box_key
2907
edit_box_mouse		dd aEdit_box_mouse
2907
edit_box_mouse		dd aEdit_box_mouse
2908
version_ed		dd aVersion_ed
2908
version_ed		dd aVersion_ed
2909
 
2909
 
2910
option_box_draw		dd aOption_box_draw
2910
option_box_draw		dd aOption_box_draw
2911
option_box_mouse	dd aOption_box_mouse
2911
option_box_mouse	dd aOption_box_mouse
2912
version_op		dd aVersion_op
2912
version_op		dd aVersion_op
2913
 
2913
 
2914
scrollbar_ver_draw	dd aScrollbar_ver_draw
2914
scrollbar_ver_draw	dd aScrollbar_ver_draw
2915
scrollbar_ver_mouse	dd aScrollbar_ver_mouse
2915
scrollbar_ver_mouse	dd aScrollbar_ver_mouse
2916
scrollbar_hor_draw	dd aScrollbar_hor_draw
2916
scrollbar_hor_draw	dd aScrollbar_hor_draw
2917
scrollbar_hor_mouse	dd aScrollbar_hor_mouse
2917
scrollbar_hor_mouse	dd aScrollbar_hor_mouse
2918
version_scrollbar	dd aVersion_scrollbar
2918
version_scrollbar	dd aVersion_scrollbar
2919
 
2919
 
2920
menu_bar_draw		dd aMenu_bar_draw
2920
menu_bar_draw		dd aMenu_bar_draw
2921
menu_bar_mouse		dd aMenu_bar_mouse
2921
menu_bar_mouse		dd aMenu_bar_mouse
2922
version_menu_bar	dd aVersion_menu_bar
2922
version_menu_bar	dd aVersion_menu_bar
2923
 
2923
 
2924
	dd 0,0
2924
	dd 0,0
2925
 
2925
 
2926
aEdit_box_draw		db 'edit_box_draw',0
2926
aEdit_box_draw		db 'edit_box_draw',0
2927
aEdit_box_key		db 'edit_box_key',0
2927
aEdit_box_key		db 'edit_box_key',0
2928
aEdit_box_mouse		db 'edit_box_mouse',0
2928
aEdit_box_mouse		db 'edit_box_mouse',0
2929
aVersion_ed		db 'version_ed',0
2929
aVersion_ed		db 'version_ed',0
2930
 
2930
 
2931
aOption_box_draw	db 'option_box_draw',0
2931
aOption_box_draw	db 'option_box_draw',0
2932
aOption_box_mouse	db 'option_box_mouse',0
2932
aOption_box_mouse	db 'option_box_mouse',0
2933
aVersion_op		db 'version_op',0
2933
aVersion_op		db 'version_op',0
2934
 
2934
 
2935
aScrollbar_ver_draw	db 'scrollbar_v_draw',0
2935
aScrollbar_ver_draw	db 'scrollbar_v_draw',0
2936
aScrollbar_ver_mouse	db 'scrollbar_v_mouse',0
2936
aScrollbar_ver_mouse	db 'scrollbar_v_mouse',0
2937
aScrollbar_hor_draw	db 'scrollbar_h_draw',0
2937
aScrollbar_hor_draw	db 'scrollbar_h_draw',0
2938
aScrollbar_hor_mouse	db 'scrollbar_h_mouse',0
2938
aScrollbar_hor_mouse	db 'scrollbar_h_mouse',0
2939
aVersion_scrollbar	db 'version_scrollbar',0
2939
aVersion_scrollbar	db 'version_scrollbar',0
2940
 
2940
 
2941
aMenu_bar_draw		db 'menu_bar_draw',0
2941
aMenu_bar_draw		db 'menu_bar_draw',0
2942
aMenu_bar_mouse		db 'menu_bar_mouse',0
2942
aMenu_bar_mouse		db 'menu_bar_mouse',0
2943
aVersion_menu_bar	db 'version_menu_bar',0
2943
aVersion_menu_bar	db 'version_menu_bar',0
2944
;---------------------------------------------------------------------
2944
;---------------------------------------------------------------------
2945
align	4
2945
align	4
2946
scroll_bar_data_vertical scrollbar scroll_width_size, 565, 284, 19, scroll_width_size, 300+20, 50, 0, 0xAAAAAA, 0xCCCCCC, 0, 10
2946
scroll_bar_data_vertical scrollbar scroll_width_size, 565, 284, 19, scroll_width_size, 300+20, 50, 0, 0xAAAAAA, 0xCCCCCC, 0, 10
2947
;---------------------------------------------------------------------
2947
;---------------------------------------------------------------------
2948
align	4
2948
align	4
2949
scroll_bar_data_horizontal scrollbar 300, 0, scroll_width_size, 300, scroll_width_size, 300, 30, 1, 0xAAAAAA, 0xCCCCCC, 0, 10
2949
scroll_bar_data_horizontal scrollbar 300, 0, scroll_width_size, 300, scroll_width_size, 300, 30, 1, 0xAAAAAA, 0xCCCCCC, 0, 10
2950
;---------------------------------------------------------------------
2950
;---------------------------------------------------------------------
2951
align	4
2951
align	4
2952
menu_data_1:
2952
menu_data_1:
2953
.type:		dd 0	;+0
2953
.type:		dd 0	;+0
2954
.x:
2954
.x:
2955
.size_x	dw 40	;+4
2955
.size_x	dw 40	;+4
2956
.start_x	dw 2	;+6
2956
.start_x	dw 2	;+6
2957
.y:
2957
.y:
2958
.size_y		dw 15	;+8
2958
.size_y		dw 15	;+8
2959
.start_y	dw 2	;+10
2959
.start_y	dw 2	;+10
2960
.text_pointer:	dd menu_text_area	;0	;+12
2960
.text_pointer:	dd menu_text_area	;0	;+12
2961
.pos_pointer:	dd menu_text_area.1	;0	;+16
2961
.pos_pointer:	dd menu_text_area.1	;0	;+16
2962
.text_end	dd menu_text_area.end	;0	;+20
2962
.text_end	dd menu_text_area.end	;0	;+20
2963
.mouse_pos	dd 0	;+24
2963
.mouse_pos	dd 0	;+24
2964
.mouse_keys	dd 0	;+28
2964
.mouse_keys	dd 0	;+28
2965
.x1:
2965
.x1:
2966
if lang eq ru
2966
if lang eq ru
2967
 .size_x1	dw 4*2+9*6	;+32
2967
 .size_x1	dw 4*2+9*6	;+32
2968
else
2968
else
2969
 .size_x1	dw 40	;+32
2969
 .size_x1	dw 40	;+32
2970
end if
2970
end if
2971
.start_x1	dw 2	;+34
2971
.start_x1	dw 2	;+34
2972
.y1:
2972
.y1:
2973
.size_y1	dw 100	;+36
2973
.size_y1	dw 100	;+36
2974
.start_y1	dw 18	;+38
2974
.start_y1	dw 18	;+38
2975
.bckg_col	dd 0xeeeeee	;+40
2975
.bckg_col	dd 0xeeeeee	;+40
2976
.frnt_col	dd 0xff	;+44
2976
.frnt_col	dd 0xff	;+44
2977
.menu_col	dd 0xffffff	;+48
2977
.menu_col	dd 0xffffff	;+48
2978
.select		dd 0	;+52
2978
.select		dd 0	;+52
2979
.out_select	dd 0	;+56
2979
.out_select	dd 0	;+56
2980
.buf_adress	dd 0	;+60
2980
.buf_adress	dd 0	;+60
2981
.procinfo	dd 0	;+64
2981
.procinfo	dd 0	;+64
2982
.click		dd 0	;+68
2982
.click		dd 0	;+68
2983
.cursor		dd 0	;+72
2983
.cursor		dd 0	;+72
2984
.cursor_old	dd 0	;+76
2984
.cursor_old	dd 0	;+76
2985
.interval	dd 16	;+80
2985
.interval	dd 16	;+80
2986
.cursor_max	dd 0	;+84
2986
.cursor_max	dd 0	;+84
2987
.extended_key	dd 0	;+88
2987
.extended_key	dd 0	;+88
2988
.menu_sel_col	dd 0x00cc00	;+92
2988
.menu_sel_col	dd 0x00cc00	;+92
2989
.bckg_text_col	dd 0	;+96
2989
.bckg_text_col	dd 0	;+96
2990
.frnt_text_col	dd 0xffffff	;+100
2990
.frnt_text_col	dd 0xffffff	;+100
2991
.mouse_keys_old	dd 0	;+104
2991
.mouse_keys_old	dd 0	;+104
2992
.font_height	dd 8	;+108
2992
.font_height	dd 8	;+108
2993
.cursor_out	dd 0	;+112
2993
.cursor_out	dd 0	;+112
2994
.get_mouse_flag	dd 0	;+116
2994
.get_mouse_flag	dd 0	;+116
2995
 
2995
 
2996
menu_text_area:
2996
menu_text_area:
2997
if lang eq ru
2997
if lang eq ru
2998
  	 db '” ©«',0
2998
  	 db '” ©«',0
2999
 .1:
2999
 .1:
3000
	 db 'Žâªàëâì',0
3000
	 db 'Žâªàëâì',0
3001
	 db '‘®åà ­¨âì',0
3001
	 db '‘®åà ­¨âì',0
3002
	 db '‚ë室',0
3002
	 db '‚ë室',0
3003
else
3003
else
3004
  	 db 'File',0
3004
  	 db 'File',0
3005
 .1:
3005
 .1:
3006
	 db 'Open',0
3006
	 db 'Open',0
3007
	 db 'Save',0
3007
	 db 'Save',0
3008
	 db 'Exit',0
3008
	 db 'Exit',0
3009
end if
3009
end if
3010
.end:
3010
.end:
3011
	 db 0
3011
	 db 0
3012
 
3012
 
3013
;---------------------------------------------------------------------
3013
;---------------------------------------------------------------------
3014
align	4
3014
align	4
3015
menu_data_2:
3015
menu_data_2:
3016
.type:		dd 0	;+0
3016
.type:		dd 0	;+0
3017
.x:
3017
.x:
3018
.size_x	dw 40	;+4
3018
.size_x	dw 40	;+4
3019
.start_x	dw 43	;+6
3019
.start_x	dw 43	;+6
3020
.y:
3020
.y:
3021
.size_y		dw 15	;+8
3021
.size_y		dw 15	;+8
3022
.start_y	dw 2	;+10
3022
.start_y	dw 2	;+10
3023
.text_pointer:	dd menu_text_area_2	;0	;+12
3023
.text_pointer:	dd menu_text_area_2	;0	;+12
3024
.pos_pointer:	dd menu_text_area_2.1	;0	;+16
3024
.pos_pointer:	dd menu_text_area_2.1	;0	;+16
3025
.text_end	dd menu_text_area_2.end	;0	;+20
3025
.text_end	dd menu_text_area_2.end	;0	;+20
3026
.mouse_pos	dd 0	;+24
3026
.mouse_pos	dd 0	;+24
3027
.mouse_keys	dd 0	;+28
3027
.mouse_keys	dd 0	;+28
3028
.x1:
3028
.x1:
3029
.size_x1	dw 4*2+5*6	;+32
3029
.size_x1	dw 4*2+5*6	;+32
3030
.start_x1	dw 43	;+34
3030
.start_x1	dw 43	;+34
3031
.y1:
3031
.y1:
3032
.size_y1	dw 100	;+36
3032
.size_y1	dw 100	;+36
3033
.start_y1	dw 18	;+38
3033
.start_y1	dw 18	;+38
3034
.bckg_col	dd 0xeeeeee	;+40
3034
.bckg_col	dd 0xeeeeee	;+40
3035
.frnt_col	dd 0xff	;+44
3035
.frnt_col	dd 0xff	;+44
3036
.menu_col	dd 0xffffff	;+48
3036
.menu_col	dd 0xffffff	;+48
3037
.select		dd 0	;+52
3037
.select		dd 0	;+52
3038
.out_select	dd 0	;+56
3038
.out_select	dd 0	;+56
3039
.buf_adress	dd 0	;+60
3039
.buf_adress	dd 0	;+60
3040
.procinfo	dd 0	;+64
3040
.procinfo	dd 0	;+64
3041
.click		dd 0	;+68
3041
.click		dd 0	;+68
3042
.cursor		dd 0	;+72
3042
.cursor		dd 0	;+72
3043
.cursor_old	dd 0	;+76
3043
.cursor_old	dd 0	;+76
3044
.interval	dd 16	;+80
3044
.interval	dd 16	;+80
3045
.cursor_max	dd 0	;+84
3045
.cursor_max	dd 0	;+84
3046
.extended_key	dd 0	;+88
3046
.extended_key	dd 0	;+88
3047
.menu_sel_col	dd 0x00cc00	;+92
3047
.menu_sel_col	dd 0x00cc00	;+92
3048
.bckg_text_col	dd 0	;	+96
3048
.bckg_text_col	dd 0	;	+96
3049
.frnt_text_col	dd 0xffffff	;+100
3049
.frnt_text_col	dd 0xffffff	;+100
3050
.mouse_keys_old	dd 0	;+104
3050
.mouse_keys_old	dd 0	;+104
3051
.font_height	dd 8	;+108
3051
.font_height	dd 8	;+108
3052
.cursor_out	dd 0	;+112
3052
.cursor_out	dd 0	;+112
3053
.get_mouse_flag	dd 0	;+116
3053
.get_mouse_flag	dd 0	;+116
3054
 
3054
 
3055
menu_text_area_2:
3055
menu_text_area_2:
3056
if lang eq ru
3056
if lang eq ru
3057
	 db '‚¨¤',0
3057
	 db '‚¨¤',0
3058
 .1:
3058
 .1:
3059
else
3059
else
3060
	 db 'View',0
3060
	 db 'View',0
3061
 .1:
3061
 .1:
3062
end if
3062
end if
3063
	 db 'Add 4',0
3063
	 db 'Add 4',0
3064
	 db 'Add 8',0
3064
	 db 'Add 8',0
3065
	 db 'Sub 4',0
3065
	 db 'Sub 4',0
3066
	 db 'Sub 8',0
3066
	 db 'Sub 8',0
3067
.end:
3067
.end:
3068
	 db 0
3068
	 db 0
3069
 
3069
 
3070
;---------------------------------------------------------------------
3070
;---------------------------------------------------------------------
3071
align	4
3071
align	4
3072
menu_data_3:
3072
menu_data_3:
3073
.type:		dd 0	;+0
3073
.type:		dd 0	;+0
3074
.x:
3074
.x:
3075
if lang eq ru
3075
if lang eq ru
3076
 .size_x	dw 4*2+7*6	;+32
3076
 .size_x	dw 4*2+7*6	;+32
3077
else
3077
else
3078
 .size_x	dw 40	;+4
3078
 .size_x	dw 40	;+4
3079
end if
3079
end if
3080
.start_x	dw 84	;+6
3080
.start_x	dw 84	;+6
3081
.y:
3081
.y:
3082
.size_y		dw 15	;+8
3082
.size_y		dw 15	;+8
3083
.start_y	dw 2	;+10
3083
.start_y	dw 2	;+10
3084
.text_pointer:	dd menu_text_area_3	;0	;+12
3084
.text_pointer:	dd menu_text_area_3	;0	;+12
3085
.pos_pointer:	dd menu_text_area_3.1	;0	;+16
3085
.pos_pointer:	dd menu_text_area_3.1	;0	;+16
3086
.text_end	dd menu_text_area_3.end	;0	;+20
3086
.text_end	dd menu_text_area_3.end	;0	;+20
3087
.mouse_pos	dd 0	;+24
3087
.mouse_pos	dd 0	;+24
3088
.mouse_keys	dd 0	;+28
3088
.mouse_keys	dd 0	;+28
3089
.x1:
3089
.x1:
3090
if lang eq ru
3090
if lang eq ru
3091
 .size_x1	dw 4*2+7*6	;+32
3091
 .size_x1	dw 4*2+7*6	;+32
3092
else
3092
else
3093
 .size_x1	dw 40	;+32
3093
 .size_x1	dw 40	;+32
3094
end if
3094
end if
3095
.start_x1	dw 84	;+34
3095
.start_x1	dw 84	;+34
3096
.y1:
3096
.y1:
3097
.size_y1	dw 100	;+36
3097
.size_y1	dw 100	;+36
3098
.start_y1	dw 18	;+38
3098
.start_y1	dw 18	;+38
3099
.bckg_col	dd 0xeeeeee	;+40
3099
.bckg_col	dd 0xeeeeee	;+40
3100
.frnt_col	dd 0xff	;+44
3100
.frnt_col	dd 0xff	;+44
3101
.menu_col	dd 0xffffff	;+48
3101
.menu_col	dd 0xffffff	;+48
3102
.select		dd 0	;+52
3102
.select		dd 0	;+52
3103
.out_select	dd 0	;+56
3103
.out_select	dd 0	;+56
3104
.buf_adress	dd 0	;+60
3104
.buf_adress	dd 0	;+60
3105
.procinfo	dd 0	;+64
3105
.procinfo	dd 0	;+64
3106
.click		dd 0	;+68
3106
.click		dd 0	;+68
3107
.cursor		dd 0	;+72
3107
.cursor		dd 0	;+72
3108
.cursor_old	dd 0	;+76
3108
.cursor_old	dd 0	;+76
3109
.interval	dd 16	;+80
3109
.interval	dd 16	;+80
3110
.cursor_max	dd 0	;+84
3110
.cursor_max	dd 0	;+84
3111
.extended_key	dd 0	;+88
3111
.extended_key	dd 0	;+88
3112
.menu_sel_col	dd 0x00cc00	;+92
3112
.menu_sel_col	dd 0x00cc00	;+92
3113
.bckg_text_col	dd 0	;	+96
3113
.bckg_text_col	dd 0	;	+96
3114
.frnt_text_col	dd 0xffffff	;+100
3114
.frnt_text_col	dd 0xffffff	;+100
3115
.mouse_keys_old	dd 0	;+104
3115
.mouse_keys_old	dd 0	;+104
3116
.font_height	dd 8	;+108
3116
.font_height	dd 8	;+108
3117
.cursor_out	dd 0	;+112
3117
.cursor_out	dd 0	;+112
3118
.get_mouse_flag	dd 0	;+116
3118
.get_mouse_flag	dd 0	;+116
3119
 
3119
 
3120
menu_text_area_3:
3120
menu_text_area_3:
3121
if lang eq ru
3121
if lang eq ru
3122
	db '‘¯à ¢ª ',0
3122
	db '‘¯à ¢ª ',0
3123
 .1:
3123
 .1:
3124
	db '‘¯à ¢ª ',0
3124
	db '‘¯à ¢ª ',0
3125
else
3125
else
3126
	db 'Help',0
3126
	db 'Help',0
3127
 .1:
3127
 .1:
3128
	db 'Help',0
3128
	db 'Help',0
3129
end if
3129
end if
3130
.end:
3130
.end:
3131
	db 0
3131
	db 0
3132
;---------------------------------------------------------------------
3132
;---------------------------------------------------------------------
3133
edit1	edit_box 200,190,27,0xffffff,0x6a9480,0,0xAABBCC,0,134,cur_dir_path,ed_focus,ed_focus,6,6	;ä ©«	®âªàëâì\á®åà ­¨âì
3133
edit1	edit_box 200,190,27,0xffffff,0x6a9480,0,0xAABBCC,0,134,cur_dir_path,ed_focus,ed_focus,6,6	;ä ©«	®âªàëâì\á®åà ­¨âì
3134
edit2	edit_box 55,270,29,0xeeeeee,0x6a9480,0,0xAABBCC,4,8,go_to_string,ed_focus,ed_focus,0,0	;¯¥à¥å®¦¤	­ 	ᬥ饭¨¥
3134
edit2	edit_box 55,270,29,0xeeeeee,0x6a9480,0,0xAABBCC,4,8,go_to_string,ed_focus,ed_focus,0,0	;¯¥à¥å®¦¤	­ 	ᬥ饭¨¥
3135
edit3	edit_box 55,270,29,0xeeeeee,0x6a9480,0,0xAABBCC,4,8,find_string,ed_focus,ed_focus,0,0	;¯®¨áª
3135
edit3	edit_box 55,270,29,0xeeeeee,0x6a9480,0,0xAABBCC,4,8,find_string,ed_focus,ed_focus,0,0	;¯®¨áª
3136
edit4	edit_box 55,220,49,0xeeeeee,0x6a9480,0,0xAABBCC,4,8,sel1_string,ed_focus,ed_focus,0,0	;¢ë¤¥«¨âì	¡«®ª	­ ç.ᬥé.
3136
edit4	edit_box 55,220,49,0xeeeeee,0x6a9480,0,0xAABBCC,4,8,sel1_string,ed_focus,ed_focus,0,0	;¢ë¤¥«¨âì	¡«®ª	­ ç.ᬥé.
3137
edit5	edit_box 55,300,49,0xeeeeee,0x6a9480,0,0xAABBCC,4,8,sel2_string,ed_focus,0,0,0	;¢ë¤¥«¨âì	¡«®ª	ª®­.ᬥé.
3137
edit5	edit_box 55,300,49,0xeeeeee,0x6a9480,0,0xAABBCC,4,8,sel2_string,ed_focus,0,0,0	;¢ë¤¥«¨âì	¡«®ª	ª®­.ᬥé.
3138
 
3138
 
3139
op1	option_box option_group1,210,50,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1,1
3139
op1	option_box option_group1,210,50,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1,1
3140
op2	option_box option_group1,310,50,6,12,0xFFFFFF,0,0,op_text.2,op_text.e2-op_text.2
3140
op2	option_box option_group1,310,50,6,12,0xFFFFFF,0,0,op_text.2,op_text.e2-op_text.2
3141
op3	option_box option_group1,310,65,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
3141
op3	option_box option_group1,310,65,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
3142
op11	option_box option_group2,210,50,6,12,0xffffff,0,0,op_text2.11,op_text2.e11-op_text2.11
3142
op11	option_box option_group2,210,50,6,12,0xffffff,0,0,op_text2.11,op_text2.e11-op_text2.11
3143
op12	option_box option_group2,310,50,6,12,0xffffff,0,0,op_text2.21,op_text2.e21-op_text2.21
3143
op12	option_box option_group2,310,50,6,12,0xffffff,0,0,op_text2.21,op_text2.e21-op_text2.21
3144
 
3144
 
3145
option_group1	dd op1	;㪠§ â¥«¨, ®­¨ ®â®¡à ¦ îâáï ¯® 㬮«ç ­¨î, ª®£¤  ¢ë¢®¤¨âáï
3145
option_group1	dd op1	;㪠§ â¥«¨, ®­¨ ®â®¡à ¦ îâáï ¯® 㬮«ç ­¨î, ª®£¤  ¢ë¢®¤¨âáï
3146
option_group2	dd op11	;¯à¨«®¦¥­¨¥
3146
option_group2	dd op11	;¯à¨«®¦¥­¨¥
3147
Option_boxs	dd op1,op2,op3,0
3147
Option_boxs	dd op1,op2,op3,0
3148
Option_boxs2	dd op11,op12,0
3148
Option_boxs2	dd op11,op12,0
3149
 
3149
 
3150
op_text:	; ‘®¯à®¢®¦¤ î騩 ⥪áâ ¤«ï 祪 ¡®ªá®¢
3150
op_text:	; ‘®¯à®¢®¦¤ î騩 ⥪áâ ¤«ï 祪 ¡®ªá®¢
3151
if lang eq ru
3151
if lang eq ru
3152
 .1	db '€¡á®«îâ­®¥'
3152
 .1	db '€¡á®«îâ­®¥'
3153
 .e1:
3153
 .e1:
3154
 .2	db '‚¯¥à¥¤'
3154
 .2	db '‚¯¥à¥¤'
3155
 .e2:
3155
 .e2:
3156
 .3	db ' § ¤'
3156
 .3	db ' § ¤'
3157
 .e3:
3157
 .e3:
3158
else
3158
else
3159
 .1	db 'Absolutely'
3159
 .1	db 'Absolutely'
3160
 .e1:
3160
 .e1:
3161
 .2	db 'Forward'
3161
 .2	db 'Forward'
3162
 .e2:
3162
 .e2:
3163
 .3	db 'Back'
3163
 .3	db 'Back'
3164
 .e3:
3164
 .e3:
3165
end if
3165
end if
3166
 
3166
 
3167
op_text2:
3167
op_text2:
3168
.11	db 'Hex'
3168
.11	db 'Hex'
3169
.e11:
3169
.e11:
3170
.21	db 'ASCII'
3170
.21	db 'ASCII'
3171
.e21:
3171
.e21:
3172
;--------------------------------------------------------------------
3172
;--------------------------------------------------------------------
3173
system_dir_Boxlib			db '/sys/lib/box_lib.obj',0
3173
system_dir_Boxlib			db '/sys/lib/box_lib.obj',0
3174
system_dir_ProcLib			db '/sys/lib/proc_lib.obj',0
3174
system_dir_ProcLib			db '/sys/lib/proc_lib.obj',0
3175
 
3175
 
3176
sel_text	db "From to",0
3176
sel_text	db "From to",0
3177
 
3177
 
3178
help_but_text	= menu_text_area_3 ;db	'Help',0
3178
help_but_text	= menu_text_area_3 ;db	'Help',0
3179
 
3179
 
3180
head_f_i:
3180
head_f_i:
3181
if lang eq ru
3181
if lang eq ru
3182
 error_open_file_string	db "” ©« ­¥ ­ ©¤¥­!",0
3182
 error_open_file_string	db "” ©« ­¥ ­ ©¤¥­!",0
3183
 error_save_file_string	db "” ©« ­¥ á®åà ­¥­!",0
3183
 error_save_file_string	db "” ©« ­¥ á®åà ­¥­!",0
3184
else
3184
else
3185
 error_open_file_string	db "Isn't found!",0
3185
 error_open_file_string	db "Isn't found!",0
3186
 error_save_file_string	db "Isn't saved!",0
3186
 error_save_file_string	db "Isn't saved!",0
3187
end if
3187
end if
3188
string_cp866	db ' cp866'
3188
string_cp866	db ' cp866'
3189
string_cp1251	db 'cp1251'
3189
string_cp1251	db 'cp1251'
3190
string_koi8r	db 'koi8-r'
3190
string_koi8r	db 'koi8-r'
3191
string_ins	db 'Ins'
3191
string_ins	db 'Ins'
3192
 
3192
 
3193
 
3193
 
3194
align	4
3194
align	4
3195
number_strings	dd 16	;ª®«¨ç¥á⢮ áâப ­  «¨áâ¥
3195
number_strings	dd 16	;ª®«¨ç¥á⢮ áâப ­  «¨áâ¥
3196
;bytes_per_line	dd 16	;ª®«-¢® á⮫¡æ®¢
3196
;bytes_per_line	dd 16	;ª®«-¢® á⮫¡æ®¢
3197
 
3197
 
3198
group_bytes	dd 8
3198
group_bytes	dd 8
3199
bytes_per_line	dd 16
3199
bytes_per_line	dd 16
3200
 
3200
 
3201
 
3201
 
3202
 
3202
 
3203
;blocks_counter	dd 1
3203
;blocks_counter	dd 1
3204
;blocks_table	dd 0
3204
;blocks_table	dd 0
3205
cursor	dd 1
3205
cursor	dd 1
3206
 
3206
 
3207
flags	dw 001000010b
3207
flags	dw 001000010b
3208
;¡¨â	0: ¢ edit_box - ¢®á¯à¨ï⨥/(­¥)	¢á¥å ¢¢®¤¨¬ëå ᨬ¢®«®¢
3208
;¡¨â	0: ¢ edit_box - ¢®á¯à¨ï⨥/(­¥)	¢á¥å ¢¢®¤¨¬ëå ᨬ¢®«®¢
3209
;1:	0/1 - ०¨¬ § ¬¥­ë/¢áâ ¢ª¨
3209
;1:	0/1 - ०¨¬ § ¬¥­ë/¢áâ ¢ª¨
3210
;2:	¢ edit_box - ®¡à ¡®âª  Ctrl_G
3210
;2:	¢ edit_box - ®¡à ¡®âª  Ctrl_G
3211
;3:	¢ edit_box - ®¡à ¡®âª  Ctrl_F
3211
;3:	¢ edit_box - ®¡à ¡®âª  Ctrl_F
3212
;4:	¢ change_codepage - ¥á«¨ ¯®¤­ïâ, â® ¢®ááâ ­®¢¨âì ¯à¥¤ë¤ãéãî ª®¤¨à®¢ªã
3212
;4:	¢ change_codepage - ¥á«¨ ¯®¤­ïâ, â® ¢®ááâ ­®¢¨âì ¯à¥¤ë¤ãéãî ª®¤¨à®¢ªã
3213
;5:	vertical_scroll_bar move
3213
;5:	vertical_scroll_bar move
3214
;6:	¯®«­ ï	¯¥à¥à¨á®¢ª  ®ª­ 
3214
;6:	¯®«­ ï	¯¥à¥à¨á®¢ª  ®ª­ 
3215
;7:	horizontal_scroll_bar move
3215
;7:	horizontal_scroll_bar move
3216
;8:	1 - ¢ë¤¥«¥­ ¡«®ª
3216
;8:	1 - ¢ë¤¥«¥­ ¡«®ª
3217
;9:	¢ edit_box - ®¡à ¡®âª  Ctrl_B
3217
;9:	¢ edit_box - ®¡à ¡®âª  Ctrl_B
3218
;10:	¢ ¯ ¬ï⨠"¢¨á¨â" ᪮¯¨à®¢ ­­ë© ¡«®ª
3218
;10:	¢ ¯ ¬ï⨠"¢¨á¨â" ᪮¯¨à®¢ ­­ë© ¡«®ª
3219
;--------------------------------------------------------------------
3219
;--------------------------------------------------------------------
3220
help_text:
3220
help_text:
3221
if lang eq ru
3221
if lang eq ru
3222
 db 'Ctrl+O              - ®âªàëâì ä ©«                 '
3222
 db 'Ctrl+O              - ®âªàëâì ä ©«                 '
3223
 db 'Ctrl+S              - á®åà ­¨âì                    '
3223
 db 'Ctrl+S              - á®åà ­¨âì                    '
3224
 db 'PageUp, PageDown    - áâà ­¨æ  ¢¢¥àå/¢­¨§          '
3224
 db 'PageUp, PageDown    - áâà ­¨æ  ¢¢¥àå/¢­¨§          '
3225
 db 'Ctrl+UP, Ctrl+Down  - ¯à®ªàã⪠ áâà ­¨æë ­  áâà®-  '
3225
 db 'Ctrl+UP, Ctrl+Down  - ¯à®ªàã⪠ áâà ­¨æë ­  áâà®-  '
3226
 db '                 ªã ¢¢¥àå/¢­¨§ ¡¥§ ᬥ饭¨ï ªãàá®à '
3226
 db '                 ªã ¢¢¥àå/¢­¨§ ¡¥§ ᬥ饭¨ï ªãàá®à '
3227
 db 'Home,End            - ¢ ­ ç «®/ª®­¥æ áâப¨        '
3227
 db 'Home,End            - ¢ ­ ç «®/ª®­¥æ áâப¨        '
3228
 db 'Ctrl+Home, Ctrl+End - ¢ ­ ç «®/ª®­¥æ ä ©«          '
3228
 db 'Ctrl+Home, Ctrl+End - ¢ ­ ç «®/ª®­¥æ ä ©«          '
3229
 db 'Left, Right, UP, DN - ªãàá®à ¢«¥¢®/¢¯à ¢®/¢ëè¥/­¨¦¥'
3229
 db 'Left, Right, UP, DN - ªãàá®à ¢«¥¢®/¢¯à ¢®/¢ëè¥/­¨¦¥'
3230
 db 'n                   - ¨­¢¥àâ¨à®¢ âì ¡ ©â           '
3230
 db 'n                   - ¨­¢¥àâ¨à®¢ âì ¡ ©â           '
3231
 db 'Ins                 - ०¨¬ § ¬¥­ë/¢áâ ¢ª¨         '
3231
 db 'Ins                 - ०¨¬ § ¬¥­ë/¢áâ ¢ª¨         '
3232
 db '  Del               - 㤠«¨âì ¡ ©â ¯®¤ ªãàá®à®¬    '
3232
 db '  Del               - 㤠«¨âì ¡ ©â ¯®¤ ªãàá®à®¬    '
3233
 db '  BackSpace         - 㤠«¨âì ¡ ©â ¯¥à¥¤ ªãàá®à®¬  '
3233
 db '  BackSpace         - 㤠«¨âì ¡ ©â ¯¥à¥¤ ªãàá®à®¬  '
3234
 db '~                   - ᬥ­  ª®¤¨à®¢®ª cp866,cp1251 '
3234
 db '~                   - ᬥ­  ª®¤¨à®¢®ª cp866,cp1251 '
3235
 db 'Shift+~             - cp866/cp1251,koi8r           '
3235
 db 'Shift+~             - cp866/cp1251,koi8r           '
3236
 db 'Ctrl+F              - ¯®¨áª                        '
3236
 db 'Ctrl+F              - ¯®¨áª                        '
3237
 db 'Ctrl+G              - ¯¥à¥å®¤ ­  ᬥ饭¨¥          '
3237
 db 'Ctrl+G              - ¯¥à¥å®¤ ­  ᬥ饭¨¥          '
3238
 db 'Ctrl+B              - ¢ë¤¥«¨âì ¡«®ª                '
3238
 db 'Ctrl+B              - ¢ë¤¥«¨âì ¡«®ª                '
3239
 db 'ESC                 - á­ïâì ¢ë¤¥«¥­¨¥              '
3239
 db 'ESC                 - á­ïâì ¢ë¤¥«¥­¨¥              '
3240
 db 'Ctrl+C              - ª®¯¨à®¢ âì ¡«®ª              '
3240
 db 'Ctrl+C              - ª®¯¨à®¢ âì ¡«®ª              '
3241
 db 'Ctrl+V              - ¢áâ ¢¨âì ¢ ¢ë¤¥«¥­­ãî ®¡« áâì'
3241
 db 'Ctrl+V              - ¢áâ ¢¨âì ¢ ¢ë¤¥«¥­­ãî ®¡« áâì'
3242
 db 'Ctrl+X              - ¢ë१ âì ¢ ¡ãä¥à             '
3242
 db 'Ctrl+X              - ¢ë१ âì ¢ ¡ãä¥à             '
3243
else
3243
else
3244
 db 'Ctrl+O              - open file                    '
3244
 db 'Ctrl+O              - open file                    '
3245
 db 'Ctrl+S              - save file                    '
3245
 db 'Ctrl+S              - save file                    '
3246
 db 'PageUp, PageDown    - page up/down                 '
3246
 db 'PageUp, PageDown    - page up/down                 '
3247
 db 'Ctrl+UP, Ctrl+Down  - scroll page by one string    '
3247
 db 'Ctrl+UP, Ctrl+Down  - scroll page by one string    '
3248
 db '                    up/down without cursor movement'
3248
 db '                    up/down without cursor movement'
3249
 db 'Home,End            - at the start/end of string   '
3249
 db 'Home,End            - at the start/end of string   '
3250
 db 'Ctrl+Home, Ctrl+End - at the start/end of file     '
3250
 db 'Ctrl+Home, Ctrl+End - at the start/end of file     '
3251
 db 'Left, Right, Up, Dn - move cursor to the lft/rght..'
3251
 db 'Left, Right, Up, Dn - move cursor to the lft/rght..'
3252
 db 'n                   - invert byte                  '
3252
 db 'n                   - invert byte                  '
3253
 db 'Ins                 - replace/past mode            '
3253
 db 'Ins                 - replace/past mode            '
3254
 db '  Del               - delete byte under cursor     '
3254
 db '  Del               - delete byte under cursor     '
3255
 db '  BackSpace         - delete byte before cursor    '
3255
 db '  BackSpace         - delete byte before cursor    '
3256
 db '~                   - change codepages cp866,cp1251'
3256
 db '~                   - change codepages cp866,cp1251'
3257
 db 'Shift+~             - cp866/cp1251,koi8r           '
3257
 db 'Shift+~             - cp866/cp1251,koi8r           '
3258
 db 'Ctrl+F              - find                         '
3258
 db 'Ctrl+F              - find                         '
3259
 db 'Ctrl+G              - go to offset                 '
3259
 db 'Ctrl+G              - go to offset                 '
3260
 db 'Ctrl+B              - select area                  '
3260
 db 'Ctrl+B              - select area                  '
3261
 db 'ESC                 - deselect area                '
3261
 db 'ESC                 - deselect area                '
3262
 db 'Ctrl+C              - copy area                    '
3262
 db 'Ctrl+C              - copy area                    '
3263
 db 'Ctrl+V              - past into area from buf      '
3263
 db 'Ctrl+V              - past into area from buf      '
3264
 db 'Ctrl+X              - cut area into buffer         '
3264
 db 'Ctrl+X              - cut area into buffer         '
3265
end if
3265
end if
3266
help_end:
3266
help_end:
3267
;--------------------------------------------------------------------
3267
;--------------------------------------------------------------------
3268
;align	4096
3268
;align	4096
3269
font_buffer	file 'cp866-8x16'	;ASCII+cp866	(+ð,ñ)
3269
font_buffer	file 'cp866-8x16'	;ASCII+cp866	(+ð,ñ)
3270
cp1251		file 'cp1251-8x16'
3270
cp1251		file 'cp1251-8x16'
3271
koi8_r		file 'koi8-r-8x16'	
3271
koi8_r		file 'koi8-r-8x16'	
3272
 
3272
 
3273
title	db	_title
3273
title	db	_title
3274
;---------------------------------------------------------------------
3274
;---------------------------------------------------------------------
3275
l_libs_start:
3275
l_libs_start:
3276
 
3276
 
3277
library01  l_libs system_dir_Boxlib+9, buf_cmd_lin, system_dir_Boxlib, Box_lib_import
3277
library01  l_libs system_dir_Boxlib+9, buf_cmd_lin, system_dir_Boxlib, Box_lib_import
3278
 
3278
 
3279
library02  l_libs system_dir_ProcLib+9, buf_cmd_lin, system_dir_ProcLib, ProcLib_import
3279
library02  l_libs system_dir_ProcLib+9, buf_cmd_lin, system_dir_ProcLib, ProcLib_import
3280
 
3280
 
3281
end_l_libs:
3281
end_l_libs:
3282
;---------------------------------------------------------------------
3282
;---------------------------------------------------------------------
3283
OpenDialog_data:
3283
OpenDialog_data:
3284
.type			dd 0
3284
.type			dd 0
3285
.procinfo		dd procinfo	;+4
3285
.procinfo		dd procinfo	;+4
3286
.com_area_name		dd communication_area_name	;+8
3286
.com_area_name		dd communication_area_name	;+8
3287
.com_area		dd 0	;+12
3287
.com_area		dd 0	;+12
3288
.opendir_pach		dd temp_dir_pach	;+16
3288
.opendir_pach		dd temp_dir_pach	;+16
3289
.dir_default_pach	dd communication_area_default_pach	;+20
3289
.dir_default_pach	dd communication_area_default_pach	;+20
3290
.start_path		dd open_dialog_path	;+24
3290
.start_path		dd open_dialog_path	;+24
3291
.draw_window		dd draw_window_1	;+28
3291
.draw_window		dd draw_window_1	;+28
3292
.status			dd 0	;+32
3292
.status			dd 0	;+32
3293
.openfile_pach 		dd fname_buf	;+36
3293
.openfile_pach 		dd fname_buf	;+36
3294
.filename_area		dd filename_area	;+40
3294
.filename_area		dd filename_area	;+40
3295
.filter_area		dd Filter
3295
.filter_area		dd Filter
3296
.x:
3296
.x:
3297
.x_size			dw 420 ;+48 ; Window X size
3297
.x_size			dw 420 ;+48 ; Window X size
3298
.x_start		dw 10 ;+50 ; Window X position
3298
.x_start		dw 10 ;+50 ; Window X position
3299
.y:
3299
.y:
3300
.y_size			dw 320 ;+52 ; Window y size
3300
.y_size			dw 320 ;+52 ; Window y size
3301
.y_start		dw 10 ;+54 ; Window Y position
3301
.y_start		dw 10 ;+54 ; Window Y position
3302
 
3302
 
3303
communication_area_name:
3303
communication_area_name:
3304
	db 'FFFFFFFF_open_dialog',0
3304
	db 'FFFFFFFF_open_dialog',0
3305
open_dialog_path:
3305
open_dialog_path:
3306
if __nightbuild eq yes
3306
if __nightbuild eq yes
3307
	db '/sys/MANAGERS/opendial',0
3307
	db '/sys/MANAGERS/opendial',0
3308
else
3308
else
3309
	db '/sys/File Managers/opendial',0
3309
	db '/sys/File Managers/opendial',0
3310
end if
3310
end if
3311
communication_area_default_pach:
3311
communication_area_default_pach:
3312
	db '/rd/1',0
3312
	db '/sys',0
3313
 
3313
 
3314
Filter:
3314
Filter:
3315
dd	Filter.end - Filter.1
3315
dd	Filter.end - Filter.1
3316
.1:
3316
.1:
3317
;db	'BIN',0
3317
;db	'BIN',0
3318
;db	'DAT',0
3318
;db	'DAT',0
3319
.end:
3319
.end:
3320
db	0
3320
db	0
3321
 
3321
 
3322
start_temp_file_name:	db 'temp.bin',0
3322
start_temp_file_name:	db 'temp.bin',0
3323
 
3323
 
3324
;---------------------------------------------------------------------
3324
;---------------------------------------------------------------------
3325
I_END:
3325
I_END:
3326
;--------------------------------------------------------------------
3326
;--------------------------------------------------------------------
3327
file_name:
3327
file_name:
3328
cur_dir_path	rb 4096
3328
cur_dir_path	rb 4096
3329
buf_cmd_lin	rb 0
3329
buf_cmd_lin	rb 0
3330
procinfo:	;opendialog
3330
procinfo:	;opendialog
3331
threath_buf:
3331
threath_buf:
3332
	rb 0x400
3332
	rb 0x400
3333
path:
3333
path:
3334
		rb 1024+16	;opendialog
3334
		rb 1024+16	;opendialog
3335
 
3335
 
3336
screen_table	rd 1
3336
screen_table	rd 1
3337
begin_offset	rd 1
3337
begin_offset	rd 1
3338
file_buffer	rd 1
3338
file_buffer	rd 1
3339
 
3339
 
3340
copy_buf	rd 1
3340
copy_buf	rd 1
3341
copy_len	rd 1
3341
copy_len	rd 1
3342
 
3342
 
3343
current_offset	rd 1
3343
current_offset	rd 1
3344
;	rd	1 ;¯®¤ áâ à訩 dword
3344
;	rd	1 ;¯®¤ áâ à訩 dword
3345
codepage_offset	rd 1
3345
codepage_offset	rd 1
3346
codepage_offset_previous	rd 1
3346
codepage_offset_previous	rd 1
3347
low_area	rd 1	;ª®®à¤¨­ âë ­¨¦­¥© áâப¨
3347
low_area	rd 1	;ª®®à¤¨­ âë ­¨¦­¥© áâப¨
3348
right_table_xy	rd 1
3348
right_table_xy	rd 1
3349
 
3349
 
3350
prev_f_size_bl	rd 1
3350
prev_f_size_bl	rd 1
3351
 
3351
 
3352
len_str_scr	rd 1
3352
len_str_scr	rd 1
3353
beg_str_scr	rd 1
3353
beg_str_scr	rd 1
3354
 
3354
 
3355
shblock_beg	rd 1	;ᬥ饭¨¥ ­ ç «  ¡«®ª 
3355
shblock_beg	rd 1	;ᬥ饭¨¥ ­ ç «  ¡«®ª 
3356
shblock_end	rd 1	;ᬥ饭¨¥ ª®­æ  ¡«®ª 
3356
shblock_end	rd 1	;ᬥ饭¨¥ ª®­æ  ¡«®ª 
3357
 
3357
 
3358
;mouse_flag	rd 1
3358
;mouse_flag	rd 1
3359
file_size	rd 1
3359
file_size	rd 1
3360
;	rd	1 ;¯®¤ áâ à訩 dword
3360
;	rd	1 ;¯®¤ áâ à訩 dword
3361
 
3361
 
3362
active_process	rd 1
3362
active_process	rd 1
3363
 
3363
 
3364
ed_box_data:	rd 8	;¯¥à¢ë© dword -ª®«-¢® í«¥¬¥­â®¢ ¤«ï ®¡à ¡®âª¨, ¤ «¥¥ 㪠§ â¥«¨ ­  editX;
3364
ed_box_data:	rd 8	;¯¥à¢ë© dword -ª®«-¢® í«¥¬¥­â®¢ ¤«ï ®¡à ¡®âª¨, ¤ «¥¥ 㪠§ â¥«¨ ­  editX;
3365
 
3365
 
3366
bufferfinfo	rb 40
3366
bufferfinfo	rb 40
3367
hex8_string	rb 9	;¡ãä¥à ¤«ï hex_output
3367
hex8_string	rb 9	;¡ãä¥à ¤«ï hex_output
3368
go_to_string	rb 9
3368
go_to_string	rb 9
3369
find_string	rb 17
3369
find_string	rb 17
3370
sel1_string	rb 9
3370
sel1_string	rb 9
3371
sel2_string	rb 9
3371
sel2_string	rb 9
3372
cur_help_string	rb 1	;­®¬¥à áâப¨, á ª®â®à®© ¢ë¢®¤¨âáï ⥪áâ ¢ help - ®ª­¥
3372
cur_help_string	rb 1	;­®¬¥à áâப¨, á ª®â®à®© ¢ë¢®¤¨âáï ⥪áâ ¢ help - ®ª­¥
3373
 
3373
 
3374
help_is_open_already	rb 1  ;¥á«¨ ®ª­® á¯à ¢ª¨ ®âªàëâ®, â® §¤¥áì 1
3374
help_is_open_already	rb 1  ;¥á«¨ ®ª­® á¯à ¢ª¨ ®âªàëâ®, â® §¤¥áì 1
3375
help_window_pid 	rd 1
3375
help_window_pid 	rd 1
3376
 
3376
 
3377
func_70	f70
3377
func_70	f70
3378
;---------------------------------------------------------------------
3378
;---------------------------------------------------------------------
3379
title_buf:
3379
title_buf:
3380
	rb 4096
3380
	rb 4096
3381
;---------------------------------------------------------------------
3381
;---------------------------------------------------------------------
3382
fname_buf:
3382
fname_buf:
3383
	rb 4096
3383
	rb 4096
3384
;---------------------------------------------------------------------
3384
;---------------------------------------------------------------------
3385
temp_dir_pach:
3385
temp_dir_pach:
3386
	rb 4096
3386
	rb 4096
3387
;---------------------------------------------------------------------
3387
;---------------------------------------------------------------------
3388
filename_area:
3388
filename_area:
3389
	rb 256
3389
	rb 256
3390
;---------------------------------------------------------------------
3390
;---------------------------------------------------------------------
3391
D_END:
3391
D_END: