Subversion Repositories Kolibri OS

Rev

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

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