Subversion Repositories Kolibri OS

Rev

Rev 1017 | Rev 1431 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1017 Rev 1429
Line -... Line 1...
-
 
1
;************************************************************************
1
;constants
2
; v.015 08.03.2010
2
;for keys
3
; Support for OpenDialog - Open and Save
3
KEY_ESC      equ 27
4
; Some optimization
-
 
5
;************************************************************************
4
KEY_PGDN     equ 183
6
; v.014 05.02.2010
-
 
7
; 
5
KEY_PGUP     equ 184
8
; PageUp, PageDown      - áâà ­¨æ  ¢¢¥àå/¢­¨§
-
 
9
; Ctrl+UP, Ctrl+Down    - ¯à®ªàã⪠ áâà ­¨æë ­  áâப㠢¢¥àå/¢­¨§ ¡¥§ ᬥ饭¨ï ªãàá®à 
-
 
10
; Home,End              - ¢ ­ ç «®/ª®­¥æ áâப¨
-
 
11
; Ctrl+Home, Ctrl+End   - ª ¯¥à¢®¬ã/¯®á«¥¤­¥¬ã ¡ ©âã ä ©« 
6
KEY_LNDN     equ 177
12
; Left, Right           - ªãàá®à ¢«¥¢®/¢¯à ¢®
7
KEY_LNUP     equ 178
13
; Ctrl+O                - ®âªàëâì ä ©«
8
KEY_RIGHT    equ 179
14
; Ctrl+S                - á®åà ­¨âì
9
KEY_LEFT     equ 176
15
; Ctrl+F                - ¯®¨áª (+Tab ¤«ï OptionBox)
-
 
16
; Ctrl+G                - ¯¥à¥å®¤ ­  ᬥ饭¨¥ (+Tab ¤«ï OptionBox)
10
KEY_HOME     equ 180
17
; Ctrl+B                - ¢ë¤¥«¨âì ¡«®ª
11
KEY_END      equ 181
18
; ESC                   - á­ïâì ¢ë¤¥«¥­¨¥
12
KEY_HOMETOP  equ 251  ;Ctrl + '['
19
; Ctrl+C		- ª®¯¨à®¢ âì ¡«®ª
-
 
20
; Ctrl+V		- ¢áâ ¢¨âì ¢ ¢ë¤¥«¥­­ãî ®¡« áâì
-
 
21
; Ctrl+X		- ¢ë१ âì ¢ë¤¥«¥­­ãî ®¡« áâì (¢ ¡ãä¥à)
-
 
22
; n                     - ¨­¢¥àâ¨à®¢ âì ¡ ©â ¯®¤ ªãàá®à®¬
-
 
23
; Ins                   - ०¨¬ § ¬¥­ë/¢áâ ¢ª¨ (¯® 㬮«ç ­¨î)
-
 
24
;   Del                 - ¢ ०¨¬¥ ¢áâ ¢ª¨ - 㤠«¨âì ¡ ©â ¯®¤ ªãàá®à®¬
-
 
25
;   BackSpace           - ¢ ०¨¬¥ ¢áâ ¢ª¨ - 㤠«¨âì ¡ ©â ¯¥à¥¤ ªãàá®à®¬
-
 
26
; ~                     - ᬥ­  ª®¤¨à®¢ª¨ (cp866,cp1251)
-
 
27
; Shift+~               - ᬥ­  ª®¤¨à®¢ª¨ (cp866 ¨«¨ cp1251,koi8-r)
-
 
28
 
-
 
29
;  ¬ïâì ¯¥à¥à á¯à¥¤¥«ï¥âáï ­  㢥«¨ç¥­¨¥ i umen'shenie.
-
 
30
; ” ©« § £à㦠¥âáï 楫¨ª®¬.
-
 
31
 
-
 
32
; Œ ªà®áë load_lib.mac, editbox_ex ¨ ¡¨¡«¨®â¥ªã box_lib.obj ᮧ¤ «¨:
-
 
33
;  - Alexey Teplov / €«¥ªá¥© ’¥¯«®¢
-
 
34
; Mario79, Mario - Marat Zakiyanov / Œ à â ‡ ª¨ï­®¢
-
 
35
; Diamondz - Evgeny Grechnikov / …¢£¥­¨© ƒà¥ç­¨ª®¢ ¨ ¤à.
-
 
36
;
-
 
37
; staper@inbox.ru
13
KEY_ENDBOTTOM equ 253 ;Ctrl + ']'
38
; babalbes@yandex.ru
Line 14... Line 39...
14
 
39
 
15
 use32
40
use32
16
 org 0x0
41
	org	0x0
17
 db 'MENUET01'  ; 8 byte id
42
	db	'MENUET01'
18
 dd 0x01        ; header version
43
	dd	0x1
19
 dd START       ; start of code
44
	dd	START	;program start
-
 
45
	dd	I_END	;program image	size
20
 dd I_END       ; size of image
46
	dd	(D_END+0x600) and not 3	;required amount of memory
21
 dd 0x80000     ; memory for app
47
	dd	(D_END+0x600) and not 3	;stack
22
 dd 0x80000     ; esp
48
	dd	0x0	;buf_cmd_lin
Line 23... Line 49...
23
 dd 0x0 , 0x0   ; I_Param , I_Icon
49
	dd	cur_dir_path
24
 
-
 
Line -... Line 50...
-
 
50
 
-
 
51
_title	equ 'HeEd 0.15'
-
 
52
 
-
 
53
include	'lang.inc'
-
 
54
include '../../../macros.inc'
-
 
55
include	'../../libraries/box_lib/trunk/box_lib.mac'
-
 
56
include	'../../libraries/box_lib/load_lib.mac'
-
 
57
include	'../../libraries/box_lib/asm/trunk/opendial.mac'
-
 
58
 
-
 
59
@use_library
-
 
60
use_OpenDialog
-
 
61
 
-
 
62
times	16	dd	0
-
 
63
 
-
 
64
frgrd_color	equ	0xfefefe
-
 
65
bkgrd_color	equ	0x000000
-
 
66
kursred_color	equ	0x0039ff
-
 
67
kurstxt_color	equ	0x708090
-
 
68
text_color	equ	0xaaaaaa
-
 
69
 
-
 
70
panel_clr1	equ	0xe9e9e2
-
 
71
panel_clr2	equ	0x8b8b89
-
 
72
panel_clr3	equ	0x777777;eaeae3
-
 
73
 
-
 
74
 
-
 
75
palitra:
-
 
76
.1	dd	frgrd_color,bkgrd_color	;梥⠭¥¢ë¤¥«¥­­®£® ᨬ¢®« 
-
 
77
.2	dd	frgrd_color,text_color	;«¥¢ë©,¯à ¢ë© á⮫¡æë,ç áâì ­¨¦­¥© áâப¨
-
 
78
.3	dd	kursred_color,frgrd_color	;ªãàá®à 
-
 
79
.4	dd	kurstxt_color,bkgrd_color	;ªãàá®à  ¢ ⥪á⮢®© ®¡« áâ¨
-
 
80
.5	dd	panel_clr1,not	text_color	;­¨¦­ïï ¯ ­¥«ì
-
 
81
 
-
 
82
FIRST_HEX equ 0*65536+24
-
 
83
scroll_width_size equ 15
-
 
84
 
-
 
85
struct	f70
-
 
86
	func_n	rd 1
-
 
87
	param1	rd 1
-
 
88
	param2	rd 1
-
 
89
	param3	rd 1
-
 
90
	param4	rd 1
-
 
91
	rezerv	rb 1
-
 
92
	name	rd 1
-
 
93
ends
-
 
94
 
-
 
95
START:
-
 
96
	mcall	68,11
-
 
97
;OpenDialog	initialisation
-
 
98
init_OpenDialog	OpenDialog_data
-
 
99
 
-
 
100
	load_library	boxlib_name,cur_dir_path,buf_cmd_lin,system_path,\
-
 
101
	err_message_found_lib,head_f_l,myimport,err_message_import,head_f_i
-
 
102
 
-
 
103
	mcall	40,0x27
-
 
104
 
-
 
105
	mcall	68,12,32*1024	;áâà ­¨ç­ë© ¡ãä¥à
-
 
106
	mov	[screen_table],eax
-
 
107
	mcall	68,12,4*1024
-
 
108
;	mov	[blocks_table],eax
-
 
109
	mov	[file_buffer],eax
-
 
110
;	mov	esi,eax
-
 
111
;	mcall	68,12,4*1024
-
 
112
;	mov	[esi],eax
-
 
113
;	mov	[blocks_counter],1
-
 
114
 
-
 
115
;	mcall	68,12,1024	;Procinfo area for function 9 in MenuBar
-
 
116
;	mov	[menu_data_1.procinfo],eax
Line 25... Line -...
25
 include 'lang.inc'
-
 
Line -... Line 117...
-
 
117
;	mov	[menu_data_2.procinfo],eax
26
 include '..\..\..\macros.inc'
118
	mcall	68,12,1024
-
 
119
	mov	[copy_buf],eax
27
 
120
 
-
 
121
 
-
 
122
	;à §¬¥à	⥪ã饣® ¯ãâ¨
28
 
123
	mov	esi,cur_dir_path
-
 
124
@@:
-
 
125
	cmp	byte [esi],0
29
START: ; start of execution
126
	je	@f
30
 
127
	inc	esi
-
 
128
	jmp	@b
-
 
129
@@:
-
 
130
	sub	esi,cur_dir_path
-
 
131
	mov	[edit1.pos],esi
-
 
132
	mov	[edit1.size],esi
-
 
133
 
Line 31... Line 134...
31
  mov  eax,40
134
	;®¡é¥á¨á⥬­ë¥ ª« ¢¨è¨ ¤«ï Shift+ªãàá®àë
32
  mov  ebx,100111b ;event mouse
135
;	mcall	66,4,75,1
Line -... Line 136...
-
 
136
;	mcall	66,,77
-
 
137
;	mcall	66,,72
33
  mcall
138
;	mcall	66,,80
34
  mov  dword [process_info+42],540
-
 
35
  mov  dword [process_info+46],414
139
 
36
 
-
 
37
red:
-
 
38
  call draw_window
-
 
39
 
-
 
40
still:
-
 
41
  mov  eax,10  ; wait here for event
-
 
42
  mcall
-
 
43
  dec  al      ; redraw request ?
-
 
44
  je   red
-
 
45
  dec  al      ; key in buffer ?
-
 
46
  je   key
-
 
47
  dec  al      ; button in buffer ?
-
 
48
  je   button
-
 
49
               ; mouse event received
-
 
50
 mouse:
-
 
51
  mov  eax,37
-
 
Line 52... Line -...
52
  mov  ebx,2
-
 
53
  mcall
-
 
54
  or   eax,eax
140
	call	ready_screen_buffer
55
  jz   still
-
 
56
  cmp  [menu_opened],1
-
 
57
  jne  still
-
 
58
  mov  [menu_opened],0
-
 
59
 
141
;	jmp	open_file
60
 
-
 
61
 key:          ; key
-
 
62
  mov  eax,2
-
 
63
  mcall
-
 
64
; test al,al
-
 
65
; jnz  still
142
 
66
  cmp  ah,KEY_ESC
-
 
67
  jz   close
-
 
68
  mov  al,[o_s_flag]
-
 
69
  and  al,8  ;set bit 3?
-
 
70
  jz   edit_keys ;not - no output to filename area
-
 
71
  cmp  ah,8  ;BACKSPACE
-
 
72
  jnz  no_backspace
-
 
73
  dec  [name_l]
-
 
74
  cmp  [name_l],0
-
 
75
  mov  edx,filename
-
 
76
  je   A1
-
 
77
  jg   @f
-
 
78
  mov  [name_l],0
-
 
79
  jmp  A1
-
 
80
 @@:
-
 
81
  add  dl,[name_l]
143
redraw_all:
82
 A1:
-
 
83
  sub  [x_cursor],0x60000
-
 
84
  mov  [edx],byte 0
-
 
85
  cmp  [x_cursor],0xb0005
-
 
86
  jge  @f
-
 
87
  mov  [x_cursor],0xb0005
-
 
88
@@:
-
 
89
  call redraw_window
-
 
90
  jmp  still  ;END BACKSPACE
-
 
91
 
-
 
92
 no_backspace:
-
 
93
  cmp  ah,0x30 ;'0'
-
 
94
  jl   A2
-
 
95
  cmp  ah,0x39 ;'9'
-
 
96
  jle  bigsym
-
 
97
  cmp  ah,65 ;'A'
-
 
98
  jbe  bigsym
-
 
99
  cmp  ah,90 ;'Z'
-
 
100
  jle  bigsym
-
 
101
  cmp  ah,97 ;'a'
-
 
102
  jbe  smsym
-
 
103
  cmp  ah,122;'z'
-
 
104
  jle  smsym
144
	call	draw_window_1
105
  jmp  still
-
 
106
 A2:
-
 
107
  cmp  ah,46 ;'.'
-
 
108
  jz   bigsym
-
 
109
  cmp  ah,0x20
-
 
110
  jz   bigsym
-
 
111
  jmp  still
-
 
112
 smsym:
-
 
113
  sub  ah,32
-
 
114
 bigsym:
-
 
115
  cmp  [name_l],13 ;yes. filename length <13
-
 
116
  jl   @f
-
 
117
  sub  [o_s_flag],8 ;not - disable output to filename area
-
 
118
  mov  [x_cursor],0x680005; - set x-base & x-size
-
 
119
  jmp  _end_keys
-
 
120
 @@:
-
 
121
  mov  edx,filename  ;
-
 
122
  add  dl,[name_l]
-
 
123
  mov  [edx],ah
-
 
124
  inc  [name_l]
-
 
125
  add  [x_cursor],0x60000
-
 
126
 _end_keys:
-
 
127
  call redraw_window
-
 
128
  jmp  still
-
 
129
 edit_keys:
-
 
130
  cmp  ah,KEY_PGDN
-
 
131
  jnz  @f
-
 
132
  call PgDn
-
 
133
  jmp  still
-
 
134
 @@:
-
 
135
  cmp  ah,KEY_PGUP
-
 
136
  jnz  @f
-
 
137
  call PgUp
-
 
138
  jmp  still
-
 
139
 @@:
-
 
140
  cmp  ah,KEY_HOME ;Home
-
 
141
  jnz  @f
-
 
142
  call Home
-
 
143
  jmp  still
-
 
144
 @@:
-
 
145
  cmp  ah,KEY_END ;Home
-
 
146
  jnz  @f
-
 
147
  call _End
-
 
148
  jmp  still
-
 
149
 @@:
-
 
150
  cmp  ah,KEY_HOMETOP
-
 
151
  jnz  @f
-
 
152
  call CtrlHome
-
 
153
  jmp  still
145
still:
154
 @@:
-
 
155
  cmp  ah,KEY_ENDBOTTOM
-
 
156
  jnz  @f
-
 
157
  call CtrlEnd
-
 
158
  jmp  still
146
	mcall	10
159
 @@:
-
 
160
  cmp  ah,KEY_LNDN
147
 
161
  jnz  @f
-
 
162
  call LnDn
-
 
163
  jmp  still
-
 
164
 @@:
-
 
165
  cmp  ah,KEY_LNUP
148
	cmp	eax,6
166
  jnz  @f
-
 
167
  call LnUp
-
 
168
  jmp  still
-
 
169
 @@:
-
 
170
  cmp  ah,KEY_RIGHT ;Right
149
	je	mouse
171
  jnz  @f
-
 
172
  call Right
-
 
173
  jmp  still
-
 
174
 @@:
-
 
175
  cmp  ah,KEY_LEFT ;Left
-
 
176
  jnz  @f
-
 
177
  call Left
-
 
178
 @@:
-
 
179
  ;। ªâ¨à®¢ ­¨¥ áâப¨ ¢ hex-¯à¥¤áâ ¢«¥­¨¨
-
 
180
  mov  esi,[current]
-
 
181
  mov  bl,[posx]
-
 
182
  add  esi,0x10000 ;0x80000
-
 
183
  cmp  ah,0x30
-
 
184
  jl   still   ;ah<'0'
-
 
185
  cmp  ah,0x39
-
 
186
  jle  A23   ;ah='0'...'9' - ¯¥à¥¢®¤ ¨§ ᨬ¢®«®¢ ¢ hex
-
 
187
;¯à®¢¥àª  ­  ª®¤ë áâ àè¨å hex-æ¨äà
-
 
188
  cmp  ah,0x61 ;ah<'a'
-
 
189
  jl   A27   ;¬®¦¥â ¡ëâì ¢¢®¤ïâáï ¡®«ì訥 ¡ãª¢ë?
-
 
190
  cmp  ah,0x66 ;ah>'f'
-
 
191
  jg   still
-
 
192
  sub  ah,0x20 ;ª®­¢¥àâ¨à㥬 ¢ ¡®«ì訥 ¡ãª¢ë
-
 
193
  jmp  A24
-
 
194
 A27:
-
 
195
  cmp  ah,0x41
-
 
196
  jl   still   ;ah<'A'
-
 
197
  cmp  ah,0x46
-
 
198
  jg   still   ;ah>'F'
-
 
199
 A24:
-
 
200
  add  ah,9
-
 
201
 A23:
-
 
202
  mov  dl,[esi];®à¨£¨­ «ì­ë© ¡ ©â
-
 
203
  and  bl,1    ;¥á«¨ ­¥ç¥â - । ªâ¨àã¥âáï ¬« ¤è¨© ¯®«ã¡ ©â, ç¥â - áâ à訩
-
 
204
  jz   hi_half_byte
-
 
205
  ;¬« ¤è¨© ¯®«ã¡ ©â
-
 
206
  and  ah,0x0f ;®¡­ã«ï¥¬ áâ à訩 ¯®«ã¡ ©â ¢¢¥¤¥­­®© æ¨äàë
-
 
207
 ;¥á«¨ ah = 0x30...0x39, â® ¢á¥ ­®à¬ «ì­®
-
 
208
 ;¥á«¨ ah = 0x41...0x46, â® ­  ¬¥âª¥ €24 ¯®«ã稬
-
 
209
 ;ah = 0x4A...0x4F ¨ ⮦¥ ¢á¥ ­®à¬ «ì­®
-
 
210
  and  dl,0xf0 ;®¡­ã«ï¥¬ ¬« ¤è¨© ¯®«ã¡ ©â 㠮ਣ¨­ «ì­®£® ¡ ©â 
-
 
211
  jmp  patch_byte
-
 
212
 hi_half_byte:
-
 
213
  ;áâ à訩 ¯®«ã¡ ©â
-
 
214
  shl  ah,4    ;®¤­®¢à¥¬¥­­® ᤢ¨£ ¥¬ ­ã¦­®¥ §­ ç¥­¨¥ ¢ áâ à訩 ¯®«ã¡ ©â
-
 
215
 ;¨ ®¡­ã«ï¥¬ ¬« ¤è¨©
-
 
216
  and  dl,0x0f ;®¡­ã«ï¥¬ áâ à訩 ¯®«ã¡ ©â 㠮ਣ¨­ «ì­®£® ¡ ©â 
-
 
217
 patch_byte:
150
	dec	al
218
  or   ah,dl   ;®¡ê¥¤¨­ï¥¬ ¯®«ã¡ ©âë
-
 
219
  mov  [esi],ah;¯ â稬 ¢ ¯ ¬ïâ¨
-
 
220
  mov  ebx,0x20100
-
 
221
  movzx ecx,ah ;¤«ï ä㭪樨 ¢ë¢®¤  ç¨á« 
-
 
222
  ;⥯¥àì ­ ¤® à áç¨â âì ª®®à¤¨­ âë ¢ë¢®¤  ¤«ï ç¨á« 
-
 
223
  ;edx = x shl 16 + y
-
 
224
  mov  edx,[x_cursor]
-
 
225
  mov  edi,[y_cursor]
151
	jz	redraw_all
226
  and  edx,0xffff0000
152
	dec	al
Line -... Line 153...
-
 
153
	jz	key
-
 
154
	dec	al
-
 
155
	jz	button
-
 
156
	jmp	still
-
 
157
 
227
  shr  edi,0x10
158
red:	call	ready_screen_buffer
228
  xor  esi,esi
159
	call	main_area
-
 
160
	jmp	still
-
 
161
 
-
 
162
draw_window_1:
-
 
163
	call	start_draw
229
  or   edx,edi
164
	call	draw_window
-
 
165
	call	show_file_size
-
 
166
	call	show_codepage
-
 
167
	call	show_insert
-
 
168
	call	ready_screen_buffer
-
 
169
	call	main_area
-
 
170
	ret
-
 
171
 
-
 
172
key:
-
 
173
	mcall	2
-
 
174
	dec	al
-
 
175
	jz	still
-
 
176
	dec	al
-
 
177
	jz	key.syst
-
 
178
	cmp	ah,2
-
 
179
	je	Ctrl_B	;¢ë¤¥«¨âì ¡«®ª
230
  mov  eax,47
180
	cmp	ah,3
-
 
181
	je	Ctrl_C	;copy
-
 
182
	cmp	ah,6
-
 
183
	je	Ctrl_F	;find
-
 
184
	cmp	ah,7
-
 
185
	je	Ctrl_G	;go to
-
 
186
	cmp	ah,8
-
 
187
	je	BackSpace
-
 
188
	cmp	ah,15
-
 
189
	je	open_dialog	;open_file ;Ctrl+O
-
 
190
	cmp	ah,19
-
 
191
	je	save_file	;Ctrl+S
-
 
192
	cmp	ah,22
-
 
193
	je	Ctrl_V	;paste
-
 
194
	cmp	ah,24
-
 
195
	je	Ctrl_X	;cut
-
 
196
	cmp	ah,27
-
 
197
	je	ESC
231
  add  edx,8
198
	cmp	ah,48
232
  mcall
199
	jb	still
233
  call redraw_window
-
 
234
  jmp  still
200
	cmp	ah,57
235
 
201
	jbe	input_from_keyboard	;0-9
236
 button:   ; button
202
	cmp	ah,65
237
  mov  eax,17 ; get id
203
	jb	still
238
  mcall
-
 
239
  dec  ah  ;close programm button
204
	cmp	ah,70
240
  jne  @f
205
	jbe	input_from_keyboard	;A-F
241
 close:
206
	cmp	ah,81
242
  mov  eax,-1 ; close this program
207
	jne	@f
243
  mcall
208
	call	Ctrl_DOWN
244
 @@:
209
	jmp	red
245
  dec  ah
-
 
246
  jne  @f
210
@@:
247
  call redraw_window
211
	cmp	ah,82
-
 
212
	jne	@f
-
 
213
	call	Ctrl_UP
-
 
214
	jmp	red
-
 
215
@@:
-
 
216
	cmp	ah,84
-
 
217
	jne	@f
-
 
218
	call	Ctrl_HOME
248
  call menufile
219
	jmp	red
-
 
220
@@:
249
  jmp  still
221
	cmp	ah,85
250
 @@:
-
 
251
  dec  ah  ;menu 'coding' button
222
	je	Ctrl_END
252
  jne  @f
223
	cmp	ah,96
253
  call redraw_window
224
	je	change_codepage	;⨫줠, cp866 - cp1251
254
  call menucoding
-
 
255
  jmp  still
-
 
256
 @@:
-
 
257
  dec  ah  ;menu 'Help' button
-
 
258
  jne  @f
-
 
259
  call redraw_window
-
 
260
  call menuhelp
-
 
261
  jmp  still
-
 
262
 @@:
-
 
263
  ;now processed low_level menu buttons
-
 
264
  ;id m_open = 5
225
	cmp	ah,97
265
  ;id m_save = 6
226
	jb	still
266
  ;id m_exit = 7
227
	cmp	ah,102
267
  ;id m_win2dos 8
228
	jbe	input_from_keyboard ;a-f
268
  ;id m_win2koi 9
-
 
269
  ;id m_win2iso 10
-
 
270
  ;id m_dos2win 11
-
 
271
  ;id m_dos2koi 12
-
 
272
  ;id m_dos2iso 13
-
 
273
  ;id m_help 14
-
 
274
  ;id m_about 15
229
	cmp	ah,126
275
  dec  ah ;open?
-
 
276
  jne  @f
230
	jne	@f
277
  cmp  [o_s_flag],0  ;disable 'Open' if flag !=0
231
	xor	ah,ah
278
  jnz  no_open
232
	jmp	change_codepage	;Shift+~, koi8-r
279
;  call redraw_window
233
@@:
280
  mov  [color],0x0072b9fc
-
 
281
  call f2 ;set x_cursor & y_cursor for input filename
-
 
282
  mov  [o_s_flag],8   ;for output to filename area
-
 
283
 no_open:
-
 
284
  call redraw_window
-
 
285
  jmp  still
-
 
286
 @@:
234
	cmp	ah,110
287
  dec  ah ;save?
-
 
288
  jne  @f
-
 
289
  cmp  [o_s_flag],1  ;enable save if flag = 1
-
 
290
  jnz  no_save
-
 
291
  movzx ecx,[name_l] ;begin clear filename string
-
 
292
  mov  edi,filename
-
 
293
  xor  al,al
-
 
294
  jecxz no_clear
-
 
295
 clear:
235
	je	invert_byte ;n
296
  mov  [edi+ecx],al
236
	cmp	ah,176
-
 
237
	jne	@f
-
 
238
	call	LEFT
-
 
239
	jmp	red
-
 
240
@@:
297
  loop clear
241
	cmp	ah,177
298
  mov  [name_l],al ;set filename length = 0
242
	jne	@f
-
 
243
	call	DOWN
299
 no_clear:  ;ebd clear
244
	jmp	red
300
  call f2 ;set x_cursor & y_cursor for input filename
245
@@:
-
 
246
	cmp	ah,178
-
 
247
	je	UP
301
  mov  [o_s_flag],9 ;for output to filename area
248
	cmp	ah,179
302
 no_save:
249
	je	RIGHT
303
  call redraw_window
250
	cmp	ah,180
-
 
251
	jne	@f
304
  jmp  still
252
	call	HOME
-
 
253
	jmp	red
305
 @@:
254
@@:
-
 
255
	cmp	ah,181
-
 
256
	je	END_
-
 
257
	cmp	ah,182
-
 
258
	je	DEL
-
 
259
	cmp	ah,183
-
 
260
	je	PGDN
306
  dec  ah ;exit?
261
	cmp	ah,184
307
  jne  @f
262
	je	PGUP
-
 
263
	cmp	ah,185
-
 
264
	je	Insert
-
 
265
	jmp	still
-
 
266
.syst:
-
 
267
	cmp	ah,72
-
 
268
	cmp	ah,75
-
 
269
	cmp	ah,77
-
 
270
	cmp	ah,80
-
 
271
	jmp	still
-
 
272
 
-
 
273
button:
-
 
274
	mcall	17
-
 
275
	dec	ah
-
 
276
	jnz	still
-
 
277
	jmp	close_prog
-
 
278
 
-
 
279
align	4
-
 
280
mouse:
-
 
281
	mcall	37,7
-
 
282
	test	eax,eax
308
  jmp  close
283
	jz	.menu_bar_1;.mouse
-
 
284
	bt	eax,15
-
 
285
	jc	@f	;®¡à ¡®âª  ª®«ñᨪ  ¬ëè¨
-
 
286
	mov	ecx,eax
-
 
287
	shl	ecx,2
-
 
288
.1:
-
 
289
	call	Ctrl_DOWN
-
 
290
	loop	.1
-
 
291
	jmp	red
-
 
292
@@:
-
 
293
	xor	ecx,ecx
-
 
294
	sub	cx,ax
-
 
295
	shl	cx,2
-
 
296
.2:
-
 
297
	call	Ctrl_UP
-
 
298
	loop	.2
-
 
299
	jmp	red
309
 @@:
300
 
-
 
301
.menu_bar_1:
310
  dec  ah ;m_win2dos?
302
	call	.set_mouse_flag
-
 
303
@@:
-
 
304
	push	dword menu_data_1	;mouse event for Menu 1
-
 
305
	call	[menu_bar_mouse]
311
  jne  @f
306
	cmp	[menu_data_1.click],dword 1
-
 
307
	jne	.menu_bar_2
-
 
308
	cmp	[menu_data_1.cursor_out],dword 0
312
  push dword WIN_TABLE
309
	jne	.analyse_out_menu_1
-
 
310
	jmp	.menu_bar_1
-
 
311
.menu_bar_2:
-
 
312
	push	dword menu_data_2
-
 
313
	call	[menu_bar_mouse]
313
  push dword DOS_TABLE
314
	cmp	[menu_data_2.click],dword 1
-
 
315
	jne	.menu_bar_3
-
 
316
	cmp	[menu_data_2.cursor_out],dword 0
-
 
317
	jne	.analyse_out_menu_2
-
 
318
	jmp	.menu_bar_1
-
 
319
.menu_bar_3:
-
 
320
	push	dword menu_data_3
-
 
321
	call	[menu_bar_mouse]
-
 
322
	cmp	[menu_data_3.click],dword 1
-
 
323
	jne	.scroll_bar
-
 
324
	cmp	[menu_data_3.cursor_out],dword 0
-
 
325
	jne	.analyse_out_menu_3
-
 
326
	jmp	.menu_bar_1
314
  call coding
327
 
-
 
328
.set_mouse_flag:
-
 
329
	xor	eax,eax
-
 
330
	inc	eax
-
 
331
	mov	[menu_data_1.get_mouse_flag],eax
-
 
332
	mov	[menu_data_2.get_mouse_flag],eax
-
 
333
	mov	[menu_data_3.get_mouse_flag],eax
315
  call redraw_window
334
	ret
316
  jmp  still
335
 
317
 @@:
336
.analyse_out_menu_1:
-
 
337
	cmp	[menu_data_1.cursor_out],dword 1
318
  dec  ah ;m_win2koi?
338
	je	open_dialog
319
  jne  @f
-
 
320
  push WIN_TABLE
-
 
321
  push KOI_TABLE
-
 
322
  call coding
339
	cmp	[menu_data_1.cursor_out],dword 2
323
  call redraw_window
340
	je	open_dialog_save	;save_file
324
  jmp  still
341
	cmp	[menu_data_1.cursor_out],dword 3
325
 @@:
342
	je	close_prog
326
  dec  ah ;m_win2iso?
343
	jmp	still
327
  jne  @f
-
 
328
  push WIN_TABLE
-
 
329
  push ISO_TABLE
-
 
330
  call coding
344
 
331
  call redraw_window
345
.analyse_out_menu_2:
332
  jmp  still
346
	cmp	[menu_data_2.cursor_out],dword 1
333
 @@:
347
	jne	@f
334
  dec  ah ;m_dos2win?
348
	add	[bytes_per_line],4
335
  jne  @f
-
 
336
  push DOS_TABLE
349
	jmp	redraw_all
337
  push WIN_TABLE
350
@@:
338
  call coding
351
	cmp	[menu_data_2.cursor_out],dword 2
339
  call redraw_window
352
	jne	@f
340
  jmp  still
353
	add	[bytes_per_line],8
-
 
354
	jmp	redraw_all
-
 
355
@@:
341
 @@:
356
	cmp	[menu_data_2.cursor_out],dword 3
342
  dec  ah ;m_dos2koi?
357
	jne	@f
343
  jne  @f
358
	cmp	[bytes_per_line],4
344
  push DOS_TABLE
359
	je	still
-
 
360
	sub	[bytes_per_line],4
-
 
361
	jmp	redraw_all
-
 
362
@@:
345
  push KOI_TABLE
363
	cmp	[menu_data_2.cursor_out],dword 4
346
  call coding
364
	jne	still
347
  call redraw_window
365
	cmp	[bytes_per_line],8
348
  jmp  still
366
	jbe	still
-
 
367
	sub	[bytes_per_line],8
-
 
368
	jmp	redraw_all
349
 @@:
369
 
350
  dec  ah ;dos2iso?
370
.analyse_out_menu_3:	;analyse result of Menu 2
351
  jne  @f
371
	cmp	[menu_data_3.cursor_out],dword 1
352
  push DOS_TABLE
372
	jne	still
-
 
373
	call	create_help_window
-
 
374
	jmp	still
-
 
375
 
-
 
376
.scroll_bar:
-
 
377
;	mcall	37,2
353
  push ISO_TABLE
378
;	test	eax,eax
-
 
379
;	jnz	@f
354
  call coding
380
;	btr	[flags],5
355
  call redraw_window
381
;	btr	[flags],7
356
  jmp  still
382
;	jmp	still
357
 @@:
383
 
358
  dec  ah ;m_help?
384
.mouse:
359
  jne  @f
385
.vertical:
-
 
386
	mcall	37,2
360
  ;create new thread for output help info
387
	test	eax,eax
-
 
388
	jnz	@f
-
 
389
	btr	[flags],5
-
 
390
	btr	[flags],7
361
  ;parameter: address for entry_point thread
391
	jmp	still
362
  push help_thread
392
@@:
363
  call create_process
393
	bt	[flags],5
364
  call redraw_window
394
	jc	@f
365
  jmp  still
395
	bt	[flags],7
-
 
396
	jc	.horizontal_0
-
 
397
 
366
 @@:
398
	mcall	37,1
367
  dec  ah ;m_about?
-
 
368
  jne  @f
399
	shr	eax,16
369
  ;create new thread for output about info
400
	cmp	ax,[scroll_bar_data_vertical.start_x]
370
  ;parameter: address for entry_point thread
-
 
371
  push about_thread
401
	jb	.horizontal
372
  call create_process
402
	sub	ax,[scroll_bar_data_vertical.start_x]
373
  call redraw_window
403
	cmp	ax,[scroll_bar_data_vertical.size_x]
374
  jmp  still
-
 
375
 @@:
404
	jge	still
376
  ;button 'Go'
405
 
377
  and  [o_s_flag],1
406
 
378
  jnz  _savefile
407
@@:
379
  ;open file
408
;	cmp	[scroll_bar_data_vertictal.delta2],0
380
  mov  eax,6
409
	;	jne	.horizontal
381
  mov  ebx,filename
410
 
382
  xor  ecx,ecx
411
;	mov	eax,[scroll_bar_data_vertical.max_area]
383
  or   edx,-1
-
 
384
  mov  esi,0x10000
412
;	cmp	eax,[scroll_bar_data_vertical.cur_area]
385
  mcall
-
 
Line 386... Line 413...
386
  inc  [o_s_flag]
413
;	jbe	.horizontal
-
 
414
 
-
 
415
	;	mouse event for Vertical ScrollBar
387
  mov  [sizefile],eax
416
	mov	edi,[screen_table]
388
  jmp  end_Go
417
	mov	edi,[edi]
-
 
418
	cmp	edi,[file_size]
389
 _savefile:
419
	jae	still
390
  ;save file
420
	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
391
  mcall 70,writeinfo
421
	call	[scrollbar_ver_mouse]
392
 end_Go:
422
 
393
  call CtrlHome
423
	xor	edx,edx
394
  jmp  still
-
 
395
 
-
 
396
Right:
424
	mov	ebx,[scroll_bar_data_vertical.max_area]
397
  pushad
425
	sub	ebx,[scroll_bar_data_vertical.cur_area]
398
  mov  al,[posx]
426
	mov	eax,[file_size]
399
  inc  al
427
	mov	esi,[bytes_per_line]
400
  cmp  al,0x20
428
	mov	ecx,[scroll_bar_data_vertical.position]
401
  jl   @f
429
	div	esi
402
  mov  [posx],0
430
	xor	edx,edx
403
  mov  [x_cursor],0x680005
431
	mul	ecx
-
 
432
	div	ebx
404
  mov  [text_cursor],0x01200000
433
	mul	esi
-
 
434
	cmp	eax,[file_size]
405
  sub  [current],0xf ;because [current] add 0x10 in LnDn
435
	jng	@f
406
  call LnDn
436
	sub	eax,esi;[bytes_per_line]
407
  popad
437
@@:
408
  ret
438
	mov	ecx,[cursor]
409
 @@:
-
 
410
  mov  [posx],al
439
	inc	ecx
411
  and  al,1
-
 
412
  jnz  @f ;not increment [current]
440
	shr	ecx,1
413
  ;increment
-
 
414
  add  [x_cursor],0xa0000
-
 
Line -... Line 441...
-
 
441
	add	ecx,eax
-
 
442
@@:
-
 
443
	cmp	ecx,[file_size]
415
  sub  [text_cursor],0x40000
444
	jle	@f
-
 
445
	sub	ecx,esi;[bytes_per_line]
416
  inc  [current]
446
	sub	eax,esi;[bytes_per_line]
-
 
447
	jmp	@b
-
 
448
@@:
-
 
449
	mov	[begin_offset],eax
-
 
450
	bts	[flags],5
-
 
451
 
-
 
452
	mov	eax,scroll_bar_data_vertical.redraw
-
 
453
	xor	ebx,ebx
-
 
454
;	cmp	[eax],ebx
417
  jmp  end_r
455
;	je	@f
-
 
456
	mov	[eax],ebx
-
 
457
	jmp	red
-
 
458
;@@:
-
 
459
;	cmp	[scroll_bar_data_vertical.delta2],0
418
 @@:
460
;	jne	still
-
 
461
.horizontal:
-
 
462
	mov	eax,[scroll_bar_data_horizontal.max_area]
-
 
463
	cmp	eax,[scroll_bar_data_horizontal.cur_area]
-
 
464
	jbe	.other
-
 
465
 
419
  add  [x_cursor],0x60000
466
	mcall	37,1
-
 
467
	cmp	ax,[scroll_bar_data_horizontal.start_y]
420
  sub  [text_cursor],0x60000
468
	jb	still
-
 
469
	sub	ax,[scroll_bar_data_horizontal.start_y]
-
 
470
	cmp	ax,[scroll_bar_data_horizontal.size_y]
-
 
471
	jge	still
-
 
472
 
-
 
473
	; mouse event for Horizontal ScrollBar
-
 
474
.horizontal_0:
-
 
475
;	mcall	37,2
-
 
476
;	test	eax,eax
-
 
477
;	jnz	@f
-
 
478
;	btr	[flags],5
-
 
479
;	btr	[flags],7
-
 
480
;	jmp	still
421
 end_r:
481
;@@:;	bt	[flags],7
-
 
482
;	jc	@f
-
 
483
 
-
 
484
;	mcall	37,1
-
 
485
;	shr	eax,16
-
 
486
;	cmp	ax,[scroll_bar_data_vertical.start_x]
-
 
487
;	jb	.horizontal
-
 
488
;	sub	ax,[scroll_bar_data_vertical.start_x]
-
 
489
;	cmp	ax,[scroll_bar_data_vertical.size_x]
-
 
490
;	jge	still
-
 
491
;@@:
-
 
492
	; mouse event for Vertical ScrollBar
-
 
493
 
-
 
494
	mov	eax,[ready_screen_buffer.string_size]
-
 
495
	shr	eax,1
-
 
496
	cmp	eax,[len_str_scr]
-
 
497
	jle	still
422
  call redraw_window
498
	push	dword scroll_bar_data_horizontal	;draw for Horizontal ScrollBar
423
  popad
499
	call	[scrollbar_hor_mouse]
-
 
500
 
424
  ret
501
	xor	edx,edx
425
 
502
	mov	eax,[scroll_bar_data_horizontal.position]
426
Left:
503
	mov	ebx,[ready_screen_buffer.string_size]
-
 
504
	shr	ebx,1
-
 
505
	mul	ebx
-
 
506
	mov	ebx,[scroll_bar_data_horizontal.max_area]
-
 
507
	sub	ebx,[scroll_bar_data_horizontal.cur_area]
427
  pushad
508
	div	ebx
-
 
509
	mov	[beg_str_scr],eax
428
  mov  al,[posx]
510
	add	eax,[len_str_scr]
429
  dec  al
511
	mov	ebx,[ready_screen_buffer.string_size]
430
  jge  @f
512
	shr	ebx,1
431
  mov  [posx],0x1f
513
	cmp	eax,ebx
432
  mov  [x_cursor],0x015e0005
514
	jle	@f
-
 
515
	mov	eax,[ready_screen_buffer.string_size]
433
  mov  [text_cursor],0x00840000
516
	shr	eax,1
434
  add  [current],0x0f
517
	sub	eax,[len_str_scr]
435
  call LnUp
518
	mov	[beg_str_scr],eax
436
  popad
519
@@:
437
  ret
520
	mov	eax,scroll_bar_data_horizontal.redraw
438
 @@:
521
	xor	ebx,ebx
439
  mov  [posx],al
-
 
440
  and  al,1
-
 
441
  jnz @f ;decrement [current]
522
	cmp	[eax],ebx
442
  ;not decrement
-
 
443
  sub  [x_cursor],0x60000
523
	je	.other
444
  add  [text_cursor],0x60000
-
 
Line -... Line 524...
-
 
524
	mov	[eax],ebx
-
 
525
;	call	draw_window
-
 
526
	call	main_area
-
 
527
	bts	[flags],7
-
 
528
	jmp	still
-
 
529
.other:
-
 
530
;	cmp	[scroll_bar_data_vertical.delta2],0
445
  jmp  end_l
531
;	jne	still
-
 
532
;	cmp	[scroll_bar_data_horizontal.delta2],0
-
 
533
;	jne	still
-
 
534
	jmp	still
446
 @@:
535
 
447
  cmp  [current],0
536
 
448
  jle  end_l
537
 
-
 
538
;------------------------------------------------
449
  sub  [x_cursor],0xa0000
539
 
-
 
540
;------------------------------------------------
-
 
541
 
-
 
542
 
-
 
543
align	4
-
 
544
ready_screen_buffer:
-
 
545
	mov	[.fl],0
-
 
546
	mov	esi,[screen_table]
-
 
547
	add	esi,4
-
 
548
	mov	ecx,[number_strings]
-
 
549
	mov	[.number_strings],cx
-
 
550
	push	[cursor]
-
 
551
	pop	[.cursor]
-
 
552
	push	[file_size]
-
 
553
	pop	[.length_to_end]
-
 
554
	mov	edi,[begin_offset]
-
 
555
 
-
 
556
	mov	[.shblock_end],0
450
  add  [text_cursor],0x40000
557
	mov	[.shblock_beg],0
-
 
558
	bt	[flags],8
-
 
559
	jnc	@f
-
 
560
	mov	eax,[shblock_beg]
451
  dec  [current]
561
	add	eax,[file_buffer]
452
 end_l:
562
	mov	[.shblock_beg],eax
-
 
563
	mov	eax,[shblock_end]
453
  call redraw_window
564
	add	eax,[file_buffer]
-
 
565
	mov	[.shblock_end],eax
-
 
566
@@:
-
 
567
	mov	[.offset],edi
454
  popad
568
	sub	[.length_to_end],edi
455
  ret
569
	jz	.pre_next_string
-
 
570
	add	edi,[file_buffer]
456
 
571
 
457
LnDn:
572
.next_string:
-
 
573
	mov	word [esi],0x2020
-
 
574
	add	esi,2
-
 
575
	mov	eax,0x20302030
-
 
576
	mov	dword [esi],eax
-
 
577
	mov	dword [esi+4],eax
-
 
578
	mov	dword [esi+8],eax
-
 
579
	mov	dword [esi+12],eax
-
 
580
	push	edi
-
 
581
	mov	ecx,8
-
 
582
	mov	edi,[.offset]
-
 
583
@@:
-
 
584
	mov	eax,edi
-
 
585
	and	eax,0xF
458
  pushad
586
	cmp	al,10
-
 
587
	sbb	al,69h
-
 
588
	das
-
 
589
	mov	[esi+ecx*2-2],al
-
 
590
	shr	edi,4
-
 
591
	loop	@b
-
 
592
	mov	word [esi+16],0x203a	;¤¢®¥â®ç¨¥
-
 
593
	mov	eax,[bytes_per_line]
-
 
594
	add	[.offset],eax
-
 
595
	mov	[.string_size],2+4*4+4+2
-
 
596
	add	esi,4*4+4+2
-
 
597
	pop	edi
-
 
598
	mov	[.temp],edi
-
 
599
	push	[.cursor]
-
 
600
	pop	[.cursor_temp]
-
 
601
 
-
 
602
	;hex	§­ ç¥­¨ï
-
 
603
	mov	dword [esi-4],0x20202020
-
 
604
 
-
 
605
	mov	edx,[bytes_per_line]
-
 
606
.next_group:
-
 
607
	mov	ecx,[group_bytes]
-
 
608
 
-
 
609
.next_byte:
-
 
610
	mov	al,[edi]
-
 
611
	ror	ax,4
-
 
612
	cmp	al,10
-
 
613
	sbb	al,69h
-
 
614
	das
-
 
615
	mov	[esi],al
-
 
616
	mov	byte [esi+1],0x20
-
 
617
	cmp	edi,[.shblock_end]
-
 
618
	ja	@f
-
 
619
	cmp	edi,[.shblock_beg]
-
 
620
	jl	@f
-
 
621
	mov	byte [esi+1],(0x20+3*4)
-
 
622
@@:
-
 
623
	dec	[.cursor]
-
 
624
	jnz	@f
-
 
625
	mov	byte [esi+1],(0x20+2*4)
-
 
626
@@:
-
 
627
	shr	ax,16-4
-
 
628
	cmp	al,10
-
 
629
	sbb	al,69h
-
 
630
	das
-
 
631
	mov	[esi+2],al
-
 
632
	mov	byte [esi+3],0x20
-
 
633
	cmp	edi,[.shblock_end]
-
 
634
	ja	@f
-
 
635
	cmp	edi,[.shblock_beg]
-
 
636
	jl	@f
459
  add  [current],0x10
637
	mov	byte [esi+3],(0x20+3*4)
-
 
638
@@:
-
 
639
	dec	[.cursor]
-
 
640
	jnz	@f
-
 
641
	mov	byte [esi+3],(0x20+2*4)
-
 
642
@@:
-
 
643
	mov	word [esi+4],0x2020
-
 
644
	add	[.string_size],6
-
 
645
	add	esi,6
-
 
646
	inc	edi
-
 
647
	dec	[.length_to_end]
460
  movzx ecx,[lines]
648
	jz	.to_null
461
  cmp  cl,[posy]
649
	dec	ecx
-
 
650
	jz	@f
-
 
651
	dec	edx
-
 
652
	jnz	.next_byte
462
  jl   @f ;when counter strings >= number strings in window
653
	jz	.ascii
463
  add  [y_cursor],0xa0000
654
@@:
464
  inc  [posy]
655
	mov	word [esi],0x2020
465
  call redraw_window
656
	add	esi,2
466
  popad
657
	add	[.string_size],2
-
 
658
	dec	edx
467
  ret
659
	jnz	.next_group;byte
-
 
660
	sub	esi,2
-
 
661
	sub	[.string_size],2
-
 
662
	jz	.ascii
-
 
663
.ascii:
-
 
664
	push	edi
-
 
665
	mov	edi,[.temp]
-
 
666
	mov	word [esi],0x2020
-
 
667
	mov	ebx,[.cursor_temp]
-
 
668
	add	esi,2
-
 
669
	add	[.string_size],2
-
 
670
	mov	ecx,[bytes_per_line]
-
 
671
@@:
-
 
672
	mov	al,[edi]
468
 @@:
673
	mov	[esi],al
-
 
674
	mov	byte [esi+1],0x20
469
  mov  eax,0x10
675
	dec	ebx
-
 
676
	jnz	.s1
-
 
677
	mov	byte [esi+1],(0x20+3*4)
-
 
678
.s1:
470
  xor  edx,edx
679
	dec	ebx
Line -... Line 680...
-
 
680
	jnz	.s2
-
 
681
	mov	byte [esi+1],(0x20+3*4)
-
 
682
.s2:
-
 
683
	inc	edi
-
 
684
	add	esi,2
-
 
685
	add	[.string_size],2
-
 
686
	loop	@b
-
 
687
	pop	edi
-
 
688
	mov	edx,[bytes_per_line]
-
 
689
	dec	[.number_strings]
-
 
690
	jnz	.next_string
-
 
691
	ret
-
 
692
 
-
 
693
.fl	db 0
-
 
694
.fl_buf	dd 0
-
 
695
.to_null:
-
 
696
	dec	[.fl]
471
  imul ecx
697
	mov	[.fl_buf],edi
-
 
698
	jmp	.pre_next_byte0
-
 
699
 
-
 
700
.pre_next_string:
-
 
701
	mov	word [esi],0x2020
-
 
702
	add	esi,2
-
 
703
	mov	eax,0x20302030
-
 
704
	mov	dword [esi],eax
472
  sub  eax,0x10
705
	mov	dword [esi+4],eax
-
 
706
	mov	dword [esi+8],eax
-
 
707
	mov	dword [esi+12],eax
473
  sub  [end_str],eax
708
	mov	ecx,8
-
 
709
	mov	edi,[.offset]
-
 
710
@@:
-
 
711
	mov	eax,edi
474
;  mov  eax,[sizefile]
712
	and	eax,0xF
-
 
713
	cmp	al,10
-
 
714
	sbb	al,69h
-
 
715
	das
-
 
716
	mov	[esi+ecx*2-2],al
-
 
717
	shr	edi,4
-
 
718
	loop	@b
-
 
719
	mov	word [esi+16],0x203a	;¤¢®¥â®ç¨¥
-
 
720
	mov	eax,[bytes_per_line]
-
 
721
	add	[.offset],eax
-
 
722
	mov	[.string_size],2+4*4+4+2
-
 
723
	add	esi,4*4+4+2
475
;  add  eax,0x80000
724
	push	[.cursor]
476
;  cmp  eax,[end_str]
725
	pop	[.cursor_temp]
477
;  jge  @f
726
 
478
;  mov  [end_str],eax
-
 
479
; @@:
-
 
480
  call draw_window
-
 
481
  popad
727
	;hex §­ ç¥­¨ï
482
  ret
-
 
483
 
728
	mov	dword [esi-4],0x20202020
484
LnUp:
729
 
485
  pushad
730
	mov	edx,[bytes_per_line]
-
 
731
.pre_next_group:
486
  sub  [current],0x10
732
	mov	ecx,[group_bytes]
487
  cmp  [current],0
733
 
488
  jge  @f
734
.pre_next_byte:
489
  mov  [current],0
735
	mov	dword [esi],0x20202020
490
 @@:
736
	dec	[.cursor]
491
  cmp  [posy],3
737
	jnz	@f
492
  jle @f ;when counter strings < number top string
738
	mov	byte [esi+1],(0x20+2*4)
493
  sub  [y_cursor],0xa0000
739
@@:
494
  dec  [posy]
-
 
495
  call redraw_window
740
	dec	[.cursor]
-
 
741
	jnz	@f
-
 
742
	mov	byte [esi+3],(0x20+2*4)
496
  popad
743
@@:
497
  ret
744
	mov	word [esi+4],0x2020
-
 
745
	add	[.string_size],6
498
 @@:
746
	add	esi,6
-
 
747
.pre_next_byte0:
-
 
748
	dec	ecx
Line 499... Line 749...
499
;  movzx ecx,[lines]
749
	jz	@f
-
 
750
	dec	edx
-
 
751
	jnz	.pre_next_byte
-
 
752
	jz	.pre_ascii
-
 
753
@@:
-
 
754
	mov	word [esi],0x2020
-
 
755
	add	esi,2
-
 
756
	add	[.string_size],2
-
 
757
	dec	edx
-
 
758
	jnz	.pre_next_group;byte
-
 
759
	sub	esi,2
-
 
760
	sub	[.string_size],2
-
 
761
	jz	.pre_ascii
-
 
762
 
-
 
763
.pre_ascii:
-
 
764
	mov	word [esi],0x2020
-
 
765
	add	esi,2
500
;  mov  eax,0x10
766
	add	[.string_size],2
-
 
767
	mov	ecx,[bytes_per_line]
-
 
768
	cmp	[.fl],0	;¯à®¢¥àª  ä« £ 
-
 
769
	jne	.last_ascii
501
;  xor  edx,edx
770
	mov	ebx,[.cursor_temp]
-
 
771
@@:
-
 
772
	mov	word [esi],0x2020
-
 
773
	dec	ebx
502
;  imul ecx
774
	jnz	.ps1
-
 
775
	mov	byte [esi+1],(0x20+3*4)
-
 
776
.ps1:
-
 
777
	dec	ebx
-
 
778
	jnz	.ps2
-
 
779
	mov	byte [esi+1],(0x20+3*4)
-
 
780
.ps2:
-
 
781
	add	esi,2
-
 
782
	add	[.string_size],2
-
 
783
.1:
-
 
784
	loop	@b
-
 
785
	mov	edx,[bytes_per_line]
-
 
786
	dec	[.number_strings]
-
 
787
	jnz	.pre_next_string
-
 
788
	ret
-
 
789
 
-
 
790
;ª®à४⭮ ®¡à ¡ â뢠¥¬ 䨭 «ì­ãî áâபã ä ©« , ¤«¨­  ª®â®à®© ¢ à¨ â¨¢­ 
-
 
791
.last_ascii:
-
 
792
	mov	ebx,[.fl_buf]
-
 
793
	sub	ebx,[.temp]
-
 
794
	sub	ecx,ebx
-
 
795
	mov	edi,[.temp]
-
 
796
	mov	[.fl],0
-
 
797
@@:
-
 
798
	mov	al,[edi]
-
 
799
	mov	[esi],al
-
 
800
	mov	byte [esi+1],0x20
-
 
801
	dec	[.cursor_temp]
Line -... Line 802...
-
 
802
	jnz	.la1
-
 
803
	mov	byte [esi+1],(0x20+3*4)
-
 
804
.la1:
-
 
805
	dec	[.cursor_temp]
-
 
806
	jnz	.la2
-
 
807
	mov	byte [esi+1],(0x20+3*4)
-
 
808
.la2:
-
 
809
	inc	edi
-
 
810
	add	esi,2
-
 
811
	add	[.string_size],2
-
 
812
	dec	ebx
-
 
813
	jnz	@b
503
;  add  eax,0x10
814
	inc	ecx
-
 
815
	jmp	.1
-
 
816
 
-
 
817
.string_size	dd 16
-
 
818
.number_strings	dw 0
-
 
819
.length_to_end	dd 0
-
 
820
.temp		dd 0
-
 
821
.offset		dd 0
-
 
822
.cursor		dd 0
-
 
823
.cursor_temp	dd 0
-
 
824
.shblock_beg	dd 0
-
 
825
.shblock_end	dd 0
-
 
826
 
-
 
827
 
-
 
828
align	4
-
 
829
main_area:
-
 
830
	mov	ecx,[number_strings]
-
 
831
	mov	[.number_strings],cx
-
 
832
	push	[len_str_scr]
-
 
833
	pop	[.len_str_scr]
-
 
834
	mov	eax,[ready_screen_buffer.string_size]
-
 
835
	shr	eax,1
-
 
836
	mov	[.string_size],eax
-
 
837
	mov	edi,[screen_table]
-
 
838
	mov	edi,[edi]
-
 
839
	cmp	[file_size],edi
-
 
840
	jbe	.4
-
 
841
	xor	edx,edx	;¯®«§ã­®ª
-
 
842
	mov	ebx,[scroll_bar_data_vertical.max_area]
-
 
843
	sub	ebx,[scroll_bar_data_vertical.cur_area]
-
 
844
	mov	ecx,[file_size]
-
 
845
	mov	eax,[current_offset]
-
 
846
	test	eax,eax
-
 
847
	jnz	.3
-
 
848
	inc	eax
-
 
849
.3:
-
 
850
	mul	ebx
-
 
851
	test	ecx,ecx
-
 
852
	jnz	.5
-
 
853
	inc	ecx
-
 
854
.5:
-
 
855
	div	ecx
-
 
856
	mov	[scroll_bar_data_vertical.position],eax
-
 
857
 
-
 
858
	mcall	37,2	;ª¯®¯ª 	¬ëè¨ ­ ¦ â  - ­¥â á¬ëá«  ¯¥à¥à¨á®¢ë¢ âì ScrollBar
-
 
859
	test	eax,eax
-
 
860
	jnz	.4
-
 
861
	push	dword scroll_bar_data_vertical
-
 
862
	call	[scrollbar_ver_mouse]
-
 
863
 
-
 
864
	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
-
 
865
	call	[scrollbar_ver_draw]
-
 
866
 
-
 
867
;	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
-
 
868
;	call	[scrollbar_ver_draw]
-
 
869
 
-
 
870
;	xor	eax,eax
-
 
871
;	inc	eax
-
 
872
;	mov	[scroll_bar_data_vertical.all_redraw],eax
-
 
873
;	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
504
  sub  [end_str],0x10
874
;	call	[scrollbar_ver_draw]
-
 
875
;	xor	eax,eax	;reset	all_redraw	flag
505
  cmp  [end_str],0x10000
876
;	mov	[scroll_bar_data_vertical.all_redraw],eax
-
 
877
 
506
  jge  @f
878
.4:
-
 
879
	mov	esi,0x000001	;梥⠨ ç¨á«® ¡¨â ­  ¯¨ªá¥«ì
507
  mov  [end_str],0x10000
880
	mov	edx,FIRST_HEX	;ª®®à¤¨­ âë ¯¥à¢®£® hex
-
 
881
	call	show_current_offset
-
 
882
	mov	edi,[screen_table]
-
 
883
	add	edi,4
-
 
884
	mov	ecx,[beg_str_scr]
-
 
885
	sub	[.string_size],ecx
508
 @@:
886
	shl	ecx,1
-
 
887
	add	edi,ecx
-
 
888
.out:
-
 
889
	push	edi
-
 
890
	movzx	ebx,byte [edi]
-
 
891
	cmp	bl,128	;¯à®¢¥àª  ­  ¯à¨­ ¤«¥¦­®áâì ᨬ¢®«  ª à áè¨à¥­­®© â ¡«¨æ¥
-
 
892
	jb	.7
-
 
893
	add	ebx,[codepage_offset]
509
  call redraw_window
894
.7:
510
  popad
895
	movzx	edi,byte [edi+1]
511
  ret
896
	lea	edi,[(edi*2-0x40)]
-
 
897
	add	edi,palitra
-
 
898
	shl	bx,4
512
 
899
	add	ebx,font_buffer
-
 
900
	mov	ecx,8*65536+16
-
 
901
	mov	ebp,0
-
 
902
	mcall	65
-
 
903
	pop	edi
-
 
904
 
-
 
905
	add	edi,2
513
CtrlEnd:
906
	add	edx,8*65536
-
 
907
 
-
 
908
	dec	[.len_str_scr]
-
 
909
	jz	.loop_str
514
  pushad
910
	dec	[.string_size]
-
 
911
	jz	.next_string
515
  popad
912
 
-
 
913
	push	edi
Line -... Line 914...
-
 
914
	movzx	ebx,byte [edi]
-
 
915
	cmp	bl,128
-
 
916
	jb	.8
-
 
917
	add	ebx,[codepage_offset]
-
 
918
.8:
-
 
919
	movzx	edi,byte [edi+1]
-
 
920
	lea	edi,[(edi*2-0x40)]
-
 
921
	add	edi,palitra
-
 
922
	shl	bx,4
-
 
923
	add	ebx,font_buffer
516
  ret
924
	mcall
517
 
925
	pop	edi
518
CtrlHome:
926
 
-
 
927
	add	edi,2
519
  pushad
928
	add	edx,8*65536
-
 
929
 
-
 
930
	dec	[.len_str_scr]
-
 
931
	jz	.loop_str
520
  mov  [x_cursor],0x00680005   ;ãáâ ­ ¢«¨¢ îâáï §­ ç¥­¨ï, ª ª ¯à¨ ®âªàë⨨
932
	dec	[.string_size]
521
  mov  [y_cursor],0x00280008
933
	jnz	.out
522
  mov  [text_cursor],0x01200000
934
	jz	.next_string
-
 
935
 
-
 
936
.string_size	dd 0
523
  mov  [posx],0
937
.number_strings	dw 0
-
 
938
.len_str_scr	dd 0
524
  mov  [posy],3
939
 
-
 
940
@@:
-
 
941
	pushad
-
 
942
	mov	ecx,edx
525
  call b_in_screen
943
	shl	ecx,16
-
 
944
	mov	ebx,edx
-
 
945
	shr	ebx,16
-
 
946
	cmp	bx,[scroll_bar_data_vertical.start_x]
-
 
947
	jge	.ls1
-
 
948
	mov	ax,[scroll_bar_data_vertical.start_x]
-
 
949
	sub	ax,bx
Line 526... Line -...
526
  mov  [end_str],0x10000
-
 
-
 
950
	shl	ebx,16
527
  mov  [current],0
951
	mov	bx,ax
528
  call redraw_window
-
 
-
 
952
	mov	cx,16
529
  popad
953
	mcall	13,,,frgrd_color
-
 
954
.ls1:
530
  ret
955
	popad
531
 
956
	jmp	@f
532
_End:
957
.loop_str:
-
 
958
	bt	[flags],6
533
  pushad
959
	jc	@b
534
  mov  [x_cursor],0x015e0005
960
@@:
535
  mov  [posx],0x1f
-
 
Line 536... Line -...
536
  mov  [text_cursor],0x00840000
-
 
537
  or   [current],0xf
961
	dec	[.string_size]
-
 
962
	jz	.next_string
-
 
963
	add	edi,2
-
 
964
	add	edx,8*65536
-
 
965
	jmp	@b
-
 
966
 
-
 
967
@@:;®ç¨á⪠ ä®­®¢ë¬ 梥⮬ ­¥§ ªà è¥­­ëå ®¡« á⥩
-
 
968
	pushad
-
 
969
	ror	edx,16
-
 
970
	mov	dx,16
-
 
971
	mov	ecx,edx
-
 
972
	mov	edx,frgrd_color
-
 
973
	movzx	ebx,[scroll_bar_data_vertical.start_x]
-
 
974
	sub	ecx,2*65536
-
 
975
	mov	cx,2
-
 
976
	mcall	13
-
 
977
	popad
-
 
978
 
-
 
979
	pushad
-
 
980
	mov	ecx,edx
-
 
981
	shl	ecx,16
-
 
982
	mov	ebx,edx
-
 
983
	shr	ebx,16
-
 
984
	cmp	bx,[scroll_bar_data_vertical.start_x]
-
 
985
	jge	.10
-
 
986
	mov	ax,[scroll_bar_data_vertical.start_x]
-
 
987
	sub	ax,bx
-
 
988
	shl	ebx,16
-
 
989
	mov	bx,ax
-
 
990
	mov	cx,16
-
 
991
	mcall	13,,,frgrd_color
-
 
992
.10:
-
 
993
	popad
-
 
994
	jmp	@f
-
 
995
.next_string:
-
 
996
	bt	[flags],6
-
 
997
	jc	@b
-
 
998
@@:
-
 
999
	push	[len_str_scr]
-
 
1000
	pop	[.len_str_scr]
-
 
1001
	mov	eax,[ready_screen_buffer.string_size]
-
 
1002
	shr	eax,1
-
 
1003
	mov	[.string_size],eax	;ª®à४æ¨ï ᬥ饭¨ï ¢å®¤­ëå ¤ ­­ëå
-
 
1004
	mov	ecx,[beg_str_scr]
-
 
1005
	sub	[.string_size],ecx
-
 
1006
	sub	eax,ecx
-
 
1007
	shl	ecx,1
-
 
1008
	add	edi,ecx
-
 
1009
 
-
 
1010
	shl	eax,19
-
 
1011
	sub	edx,eax
-
 
1012
	add	edx,18
-
 
1013
	dec	[.number_strings]
-
 
1014
	jnz	.out
-
 
1015
	btr	[flags],6
-
 
1016
	jmp	end_draw
-
 
1017
 
-
 
1018
 
-
 
1019
align	4
-
 
1020
show_current_offset:
-
 
1021
	pushad
-
 
1022
	push	edx	;¢ë¢®¤ ⥪ã饣® ᬥ饭¨ï ¢ ä ©«¥
-
 
1023
	mov	edi,palitra.5
-
 
1024
	mov	eax,[begin_offset]
-
 
1025
	mov	ebx,[cursor]
-
 
1026
	dec	ebx
-
 
1027
	shr	bx,1
-
 
1028
	add	ebx,eax
-
 
1029
	mov	[current_offset],ebx
-
 
1030
	mov	edx,[low_area]
-
 
1031
	lea	eax,[8*8+8+8]
-
 
1032
	shl	eax,16
538
  call b_in_screen
1033
	add	edx,eax
-
 
1034
	mov	ecx,8
-
 
1035
	call	hex_output
-
 
1036
	lea	eax,[8*8+14]
-
 
1037
	shl	eax,16
-
 
1038
	add	edx,eax
-
 
1039
	push	edx
539
  call redraw_window
1040
	;¤¢®¨ç­®¥ §­ ç¥­¨¥ ¡ ©â 
-
 
1041
	mov	edx,[file_buffer]
540
  popad
1042
	add	edx,ebx;[current_offset]
-
 
1043
	xor	eax,eax
-
 
1044
	cmp	ebx,[file_size]
-
 
1045
	jae	@f
541
  ret
1046
	mov	al,[edx]
-
 
1047
@@:
542
 
1048
	mov	bx,2
543
Home:
1049
	mov	ebp,8
-
 
1050
	xor	ecx,ecx
-
 
1051
	xor	edx,edx
-
 
1052
@@:
-
 
1053
	div	bx
-
 
1054
	or	cl,dl
-
 
1055
	ror	ecx,4
-
 
1056
	dec	ebp
-
 
1057
	jnz	@b
-
 
1058
	mov	ebx,ecx
-
 
1059
	pop	edx
-
 
1060
	mov	ecx,8
-
 
1061
	call	hex_output
-
 
1062
 
-
 
1063
	;¤¥áïâ¨ç­®¥
-
 
1064
	push	edx
-
 
1065
	mov	edx,[file_buffer]
-
 
1066
	mov	ebx,[current_offset]
-
 
1067
	add	edx,ebx
-
 
1068
	xor	eax,eax
-
 
1069
	inc	ebx
-
 
1070
	cmp	ebx,[file_size]	;0 ¥á«¨ §  £à ­¨æ¥© ä ©« 
-
 
1071
	jb	@f
-
 
1072
	mov	edx,D_END
-
 
1073
@@:
-
 
1074
	mov	al,[edx]
-
 
1075
	xor	ebx,ebx
-
 
1076
;	mov	ebp,3
-
 
1077
	mov	cl,10
-
 
1078
@@:
-
 
1079
	div	cl
-
 
1080
	mov	bl,ah
-
 
1081
	xor	ah,ah
-
 
1082
	shl	ebx,8
-
 
1083
	test	al,al
-
 
1084
;	dec	ebp
-
 
1085
	jnz	@b
-
 
1086
	shr	ebx,8
-
 
1087
	cmp	byte [edx],100
-
 
1088
	jb	.1
-
 
1089
	mov	ebp,3
-
 
1090
	jmp	@f
-
 
1091
.1:
-
 
1092
	mov	ebp,1
-
 
1093
	cmp	byte [edx],10
-
 
1094
	jb	@f
-
 
1095
	mov	ebp,2
-
 
1096
@@:
-
 
1097
	mov	al,bl
-
 
1098
	shr	ebx,8
-
 
1099
	cmp	al,10
-
 
1100
	sbb	al,69h
-
 
1101
	das
-
 
1102
	shl	eax,8
-
 
1103
;	test	bx,bx
-
 
1104
	dec	ebp
-
 
1105
	jnz	@b
-
 
1106
 
-
 
1107
	mov	ecx,8*65536+16
-
 
1108
	pop	edx
-
 
1109
	add	edx,(8*8+30)*65536;268*65536
-
 
1110
	mov	edi,palitra.5
-
 
1111
	mov	ebp,0
544
  pushad
1112
	push	dword 3
-
 
1113
@@:
545
  mov  [x_cursor],0x00680005 ;ãáâ ­ ¢«¨¢ îâáï §­ ç¥­¨ï ¤«ï ­ ç «  áâப¨
1114
	shr	eax,8
546
  mov  [posx],0
1115
	xor	ebx,ebx
Line -... Line 1116...
-
 
1116
	mov	bl,al
547
  mov  [text_cursor],0x01200000
1117
	shl	ebx,4
-
 
1118
	add	ebx,font_buffer
548
  and  [current],0xfffffff0
1119
	push	eax
-
 
1120
	mcall	65
-
 
1121
	pop	eax
-
 
1122
	sub	edx,8*65536
-
 
1123
	dec	dword [esp]
-
 
1124
	jnz	@b
549
  call b_in_screen
1125
	add	esp,4
550
  call redraw_window
1126
;	mov	edx,[low_area]	;¢ë¢®¤ esp
551
  popad
1127
;	add	edx,298*65536
552
  ret
1128
;	mov	ebx,esp
-
 
1129
;	mov	ecx,8
553
 
1130
;	call	hex_output
554
PgDn:
1131
	pop	edx
555
  pushad
1132
	popad
556
  xor  edx,edx
1133
	ret
557
  movzx ecx,[lines]
1134
 
-
 
1135
 
-
 
1136
align	4
-
 
1137
hex_output:	;¢ë¢®¤ hex áâப¨ ¨§ 8 ᨬ¢®«®¢
-
 
1138
	pushad
558
  mov  eax,0x10
1139
	mov	edi,(hex8_string)	; ¤à¥á ¡ãä¥à 
-
 
1140
	mov	dword [edi],0x30303030
559
  imul ecx
1141
	mov	dword [edi+4],0x30303030
560
  add  [current],eax
1142
	push	ecx
561
  add  [end_str],eax
1143
.1:
562
  call redraw_window
1144
	mov	eax,ebx
-
 
1145
	and	eax,0xF
563
  popad
1146
	cmp	al,10
564
  ret
1147
	sbb	al,69h
-
 
1148
	das
-
 
1149
	mov	[edi+ecx-1],al
565
 
1150
	shr	ebx,4
566
PgUp:
1151
	loop	.1
-
 
1152
	mov	ecx,8*65536+16
-
 
1153
.2:
-
 
1154
	push	edi
-
 
1155
	xor	ebx,ebx
-
 
1156
	mov	al,[edi]
-
 
1157
	shl	eax,4
-
 
1158
	add	eax,font_buffer
-
 
1159
	xchg	eax,ebx
-
 
1160
	mov	edi,palitra.5
-
 
1161
	mov	ebp,0
-
 
1162
	mcall	65
-
 
1163
	add	edx,8*65536
-
 
1164
	pop	edi
-
 
1165
	inc	edi
-
 
1166
	dec	dword [esp]
-
 
1167
	jnz	.2
-
 
1168
	add	esp,4
-
 
1169
	popad
-
 
1170
	ret
-
 
1171
;------------------------------------------------------
-
 
1172
align	4
-
 
1173
input_from_keyboard:
-
 
1174
	xor	al,al
-
 
1175
	sub	ah,48
-
 
1176
	cmp	ah,9
-
 
1177
	jle	.1
-
 
1178
	sub	ah,7
-
 
1179
	cmp	ah,15
-
 
1180
	jle	.1
-
 
1181
	sub	ah,32
-
 
1182
.1:
-
 
1183
	bt	[flags],1
-
 
1184
	jnc	.2
-
 
1185
	mov	ebx,[cursor]
-
 
1186
	and	bl,1
-
 
1187
	jz	.2
-
 
1188
	inc	[file_size]
-
 
1189
	call	raspred_mem
-
 
1190
	mov	edi,[current_offset]
-
 
1191
	add	edi,[file_buffer]
-
 
1192
	mov	esi,[file_buffer]
-
 
1193
	add	esi,[file_size]
-
 
1194
	dec	esi
-
 
1195
@@:
-
 
1196
	cmp	edi,esi
-
 
1197
	ja	@f
-
 
1198
	mov	bl,[esi]
-
 
1199
	mov	[esi+1],bl
-
 
1200
	dec	esi
-
 
1201
	jmp	@b
-
 
1202
@@:
-
 
1203
	call	show_file_size
-
 
1204
	mov	ebx,[current_offset]
Line 567... Line 1205...
567
  pushad
1205
	add	ebx,[file_buffer]
568
  xor  edx,edx
1206
	mov	byte [ebx],0
-
 
1207
.2:
569
  movzx ecx,[lines]
1208
	mov	ecx,[current_offset]
570
  mov  eax,0x10
1209
	add	ecx,[file_buffer]
571
  imul ecx
1210
	;á¬.	¯¥à¢ãî	¢¥àá¨î	heed.asm
572
  sub  [current],eax
1211
	mov	dl,[ecx]	;®à¨£¨­ «ì­ë© ¡ ©â
573
  cmp  [current],0
1212
	mov	ebx,[cursor]
574
  jge  @f
1213
	and	bl,1	;­¥ç¥â - । ªâ¨à㥬 áâ à訩 ¯®«ã¡ ©â
-
 
1214
	jnz	.hi_half_byte ;çñâ - áâ à訩
575
  mov  [current],0
1215
	and	dl,0xf0	;®¡­ã«ï¥¬ ¬«. ¯-¡ ©â ®à¨£¨­ «ì­®£® ¡ ©â 
-
 
1216
	jmp	.patch_byte
-
 
1217
.hi_half_byte:	;®¤­®¢à¥¬¥­­® ᤢ¨£ ¥¬ ­ã¦­®¥ §­ ç¥­¨¥ ¢ áâ ¯-â ¨ ®¡­ã«ï¥¬ ¬« ¤è¨©
-
 
1218
	shl	ax,4
-
 
1219
	and	dl,0x0f	;®¡­ã«ï¥¬ áâ à訩 ¯®«ã¡ ©â 㠮ਣ¨­ «ì­®£® ¡ ©â 
-
 
1220
.patch_byte:
576
 @@:
1221
	or	ah,dl
577
  sub  [end_str],eax
1222
	mov	[ecx],ah
-
 
1223
	jmp	RIGHT
578
  cmp  [end_str],0x10000
1224
 
579
  jge  @f
1225
raspred_mem:
580
;  call CtrlHome
1226
	pushad
581
  mov  [end_str],0x10000
1227
	xor	edx,edx
-
 
1228
	mov	ecx,4096
-
 
1229
	mov	eax,[file_size]
582
 @@:
1230
	inc	eax
583
  call redraw_window
1231
	div	ecx
-
 
1232
	cmp	eax,[prev_f_size_bl]
Line -... Line 1233...
-
 
1233
	ja	@f
-
 
1234
	je	.ret
-
 
1235
	cmp	[file_size],4096
-
 
1236
	jbe	.ret
-
 
1237
	mov	[prev_f_size_bl],eax
-
 
1238
	xor	edx,edx
-
 
1239
	mul	ecx
-
 
1240
	mov	ecx,eax
Line 584... Line 1241...
584
  popad
1241
	jmp	.1
585
  ret
1242
@@:
586
 
1243
	mov	[prev_f_size_bl],eax
587
b_in_screen:
1244
	xor	edx,edx
-
 
1245
	mul	ecx
588
  pushad
1246
	add	ecx,eax
589
  call get_process_info
1247
.1:
590
  mov  eax,[process_info+0x2e]
1248
	mcall	68,20,,[file_buffer]
591
  mov  ebx,0x0a
1249
.ret:
592
  sub  eax,0x3c
1250
	popad
593
  cmp  eax,0x10   ;now
1251
	ret
-
 
1252
;---------------------------------------
594
  jg   @f   ;now
1253
 
-
 
1254
align	4
-
 
1255
show_file_size:
595
  mov  [lines],0  ;now
1256
	mov	ebx,[file_size]
596
  jmp  C1   ;now
1257
	mov	edx,[low_area];
597
 @@:
1258
	mov	esi,1
-
 
1259
	mov	ecx,8
-
 
1260
	call	hex_output
-
 
1261
	ret
598
  xor  edx,edx
1262
 
599
  div  ebx
1263
 
600
  mov  [lines],al
1264
align	4
601
 C1:
1265
draw_window:
602
  popad
1266
	mcall	0,100*65536+653,100*65536+360,((0x73 shl 24) + frgrd_color),,title
603
  ret
-
 
604
 
1267
	mcall	9,threath_buf,-1
-
 
1268
	cmp	byte [threath_buf+70],3	;®ª­® á¢ñà­ãâ® ¢ § £®«®¢®ª?
-
 
1269
	jnae	@f
605
 
1270
.@d:
-
 
1271
	call	end_draw
-
 
1272
	add	esp,4
-
 
1273
	jmp	still
-
 
1274
@@:
-
 
1275
	cmp	dword [threath_buf+66],(24*4)	;¯à®¢¥àª  ¬¨­¨¬ «ì­®© ¢ëá®âë
606
 
1276
	jae	@f
607
output_screen:
-
 
-
 
1277
	mov	esi,dword [threath_buf+46]
608
  pushad
1278
	sub	esi,dword [threath_buf+66]
609
  movzx ecx,[lines]
1279
	add	esi,24*4
610
  jecxz no_out ;now
1280
	mcall	67,-1,-1,-1,
611
  cmp  [rflag],1
1281
	jmp	.@d
612
  jz   _redraw
1282
@@:
613
  mov  eax,[end_str]
-
 
614
  sub  eax,0x80001
1283
	cmp	dword [threath_buf+62],(26*6)	;¯à®¢¥àª  ¬¨­¨¬ «ì­®© è¨à¨­ë
615
  cmp  eax,[sizefile]
1284
	jae	@f
616
  jl   @f
1285
	mov	edx,dword [threath_buf+42]
617
 _redraw:
1286
	sub	edx,dword [threath_buf+62]
-
 
1287
	add	edx,26*6
618
  xor  edx,edx
1288
	mcall	67,-1,-1,,-1
619
  mov  eax,0x10
1289
	jmp	.@d
-
 
1290
@@:
620
  imul ecx
1291
	mov	eax,[file_size]
621
  sub  [end_str],eax
1292
	mov	ebx,[bytes_per_line]
622
  cmp  [end_str],0x10000
1293
	xor	edx,edx
623
  jge  A3
1294
	div	ebx
624
  mov  [end_str],0x10000
1295
	mov	[scroll_bar_data_vertical.size_x],0
-
 
1296
	cmp	eax,[number_strings]
-
 
1297
	jl	@f
625
 A3:
1298
	mov	[scroll_bar_data_vertical.size_x],scroll_width_size
-
 
1299
@@:
-
 
1300
	mov	eax,dword [threath_buf+62]	;è¨à¨­  ª«¨¥­â᪮© ®¡« áâ¨
Line -... Line 1301...
-
 
1301
	sub	ax,[scroll_bar_data_vertical.size_x]
Line -... Line 1302...
-
 
1302
	mov	[scroll_bar_data_vertical.start_x],ax
-
 
1303
	mov	eax,dword [threath_buf+66]	;¢ëá®â  ª«¨¥­â᪮© ®¡« áâ¨
-
 
1304
	sub	eax,24+24-11
-
 
1305
	mov	[scroll_bar_data_vertical.size_y],ax
-
 
1306
	mov	ebx,eax
-
 
1307
	push	eax
-
 
1308
	add	ebx,20
-
 
1309
	mov	[scroll_bar_data_vertical.max_area],ebx
-
 
1310
	mov	ebx,[scroll_bar_data_vertical.btn_high]
-
 
1311
	shl	ebx,1
-
 
1312
	add	ebx,20
-
 
1313
	mov	[scroll_bar_data_vertical.cur_area],ebx
-
 
1314
	pop	eax
-
 
1315
	sub	eax,3
-
 
1316
	mov	ebx,18
-
 
1317
	xor	edx,edx
-
 
1318
	div	bx
-
 
1319
	mov	[number_strings],eax	;ª®«-¢® hex áâப ¢ ®ª­¥
-
 
1320
	mov	ebx,[bytes_per_line]
-
 
1321
	mul	ebx
-
 
1322
	mov	edi,[screen_table]	;ª®«-¢® ¡ ©â®¢ ¤«ï ¢ë¢®¤ 
-
 
1323
	mov	dword [edi],eax
-
 
1324
 
-
 
1325
	push	eax
-
 
1326
 
-
 
1327
	mov	ebx,dword [threath_buf+62]
-
 
1328
	inc	ebx
-
 
1329
	mov	ecx,(FIRST_HEX-18)
-
 
1330
	ror	ecx,16
-
 
1331
	mov	cx,18
-
 
1332
	ror	ecx,16
-
 
1333
	mcall	13,,,frgrd_color	;¯®«®á  ᢥàåã
-
 
1334
 
-
 
1335
	mcall	,,18,panel_clr1	;¢¥àå­ïï ¯ ­¥«ì
-
 
1336
 
-
 
1337
	dec	ebx
-
 
1338
	mcall	38,,<18,18>,panel_clr2
-
 
1339
	mov	ecx,dword [threath_buf+66]
-
 
1340
	sub	cx,18
-
 
1341
	push	cx
-
 
1342
	shl	ecx,16
-
 
1343
	pop	cx
-
 
1344
	mcall	,,,panel_clr3	;­¨¦­ïï ¯ ­¥«ì
-
 
1345
	add	ecx,1*65536
-
 
1346
	mov	cx,18
-
 
1347
;	inc	ebx
-
 
1348
	mcall	13,,,panel_clr1
-
 
1349
 
-
 
1350
 
-
 
1351
	mov	eax,dword [threath_buf+62]
-
 
1352
	sub	eax,scroll_width_size
-
 
1353
	shr	eax,3	;div 8
-
 
1354
	mov	[len_str_scr],eax
-
 
1355
 
-
 
1356
 
-
 
1357
	mov	eax,[len_str_scr]
-
 
1358
	shl	eax,1
-
 
1359
	cmp	eax,[ready_screen_buffer.string_size]
Line -... Line 1360...
-
 
1360
	jae	@f
-
 
1361
 
-
 
1362
	mov	edi,[screen_table]
-
 
1363
	mov	eax,[bytes_per_line]
-
 
1364
	sub	dword [edi],eax
-
 
1365
	dec	[number_strings]
626
  mov  [rflag],0
1366
 
627
 @@:
1367
@@:
-
 
1368
	shr	ecx,16
628
  mov  eax,0x28
1369
	mov	edx,ecx
-
 
1370
	mov	ecx,(FIRST_HEX)
629
 @@:
1371
	shr	ecx,16
-
 
1372
	mov	eax,[number_strings]
-
 
1373
	lea	ebx,[eax*8];*18
-
 
1374
	lea	ebx,[ebx*2]
-
 
1375
	lea	eax,[eax*2]
-
 
1376
	add	eax,ebx
-
 
1377
	add	cx,ax
-
 
1378
	add	cx,21
-
 
1379
	sub	dx,cx
-
 
1380
	shl	ecx,16
-
 
1381
	add	cx,dx
-
 
1382
	sub	ecx,1*65536
630
  push ecx
1383
	movzx	ebx,	word [scroll_bar_data_vertical.start_x]
-
 
1384
	mcall	13,,,frgrd_color
-
 
1385
 
-
 
1386
	pop	eax
-
 
1387
 
-
 
1388
	cmp	eax,[file_size]
-
 
1389
	jge	@f
-
 
1390
;	push	dword scroll_bar_data_vertical
-
 
1391
;	call	[scrollbar_ver_mouse]
-
 
1392
	xor	eax,eax
-
 
1393
	inc	eax
631
  push eax
1394
	mov	[scroll_bar_data_vertical.all_redraw],eax
-
 
1395
	push	dword scroll_bar_data_vertical	;draw for Vertical ScrollBar
-
 
1396
	call	[scrollbar_ver_draw]
632
  call form_str
1397
	xor	eax,eax	;reset all_redraw flag
-
 
1398
	mov	[scroll_bar_data_vertical.all_redraw],eax
633
  mov  ebx,0x01880000
1399
@@:
-
 
1400
	push	dword menu_data_1	;draw for Menu 1
634
  add  ebx,eax
1401
	call	[menu_bar_draw]
635
  mov  ecx,0x00ffffff
1402
	push	dword menu_data_2	;draw for Menu 2
-
 
1403
	call	[menu_bar_draw]
-
 
1404
	push	dword menu_data_3	;draw for Menu 3
-
 
1405
	call	[menu_bar_draw]
-
 
1406
 
-
 
1407
;;;
636
  add  eax,10
1408
 
-
 
1409
	mov	eax,dword [threath_buf+66]
637
  mov  edx,[end_str]
1410
	add	eax,8*65536-15
-
 
1411
	mov	[low_area],eax
-
 
1412
 
-
 
1413
	mov	ebx,[beg_str_scr]
-
 
1414
	mov	[beg_str_scr],0
-
 
1415
	mov	eax,[len_str_scr]
-
 
1416
	shl	eax,1
-
 
1417
	cmp	eax,[ready_screen_buffer.string_size]
638
  push eax
1418
	jae	@f
639
  sub  edx,0x10
1419
 
640
  mov  esi,0x10
1420
	mov	[beg_str_scr],ebx
-
 
1421
	movzx	eax,word [threath_buf+66]
-
 
1422
	sub	eax,34
-
 
1423
	mov	[scroll_bar_data_horizontal.start_y],ax
-
 
1424
 
-
 
1425
;cur_area/(size_x-30)=len_str_scr/string_size
-
 
1426
 
-
 
1427
	mov	eax,dword [threath_buf+62]
-
 
1428
	sub	ax,[scroll_bar_data_vertical.size_x]
-
 
1429
	mov	[scroll_bar_data_horizontal.size_x],ax
-
 
1430
	sub	eax,[scroll_bar_data_horizontal.btn_high]
-
 
1431
	sub	eax,[scroll_bar_data_horizontal.btn_high]
-
 
1432
	mov	[scroll_bar_data_horizontal.max_area],eax
-
 
1433
	xor	edx,edx
641
  mov  eax,4
1434
	mov	ebx,[len_str_scr]
642
  mcall
-
 
643
  pop  eax
1435
	mul	ebx
644
  pop  ecx
1436
	mov	ebx,[ready_screen_buffer.string_size]
645
  loop @b
1437
	shr	ebx,1
646
 no_out:
1438
	div	ebx
647
  popad
-
 
648
  ret
1439
	mov	[scroll_bar_data_horizontal.cur_area],eax
649
 
1440
 
650
 
1441
	push	dword scroll_bar_data_horizontal	;draw for Horizontal ScrollBar
651
 
-
 
652
form_str:
-
 
653
  pushad
1442
	call	[scrollbar_hor_mouse]
654
  mov  ebp,[end_str]  ;¯®á«¥¤­¨© ¢ë¢¥¤¥­­ë© ¡ ©â
-
 
655
  xor  edi,edi ;áç¥â稪 ¡ ©â <= 16
1443
	xor	eax,eax
Line -... Line 1444...
-
 
1444
	inc	eax
-
 
1445
	mov	[scroll_bar_data_horizontal.all_redraw],eax
-
 
1446
	push	dword scroll_bar_data_horizontal	;draw for Vertical ScrollBar
-
 
1447
	call	[scrollbar_hor_draw]
Line -... Line 1448...
-
 
1448
	xor	eax,eax	;reset all_redraw flag
-
 
1449
	mov	[scroll_bar_data_horizontal.all_redraw],eax
-
 
1450
@@:
Line 656... Line 1451...
656
  ;¢ë¢¥á⨠ ¤à¥á
1451
	mov	eax,[low_area]
657
  mov  ecx,ebp
-
 
658
  mov  ebx,0x80100  ;8 æ¨äà, 16-à¨ç­ë¥, ç¨á«® ¢ ecx
-
 
659
  sub  ecx,0x10000  ;­®à¬ «¨§ æ¨ï  ¤à¥á 
-
 
660
  mov  edx,0x80000  ;­ ç «® ¯® •
-
 
661
  add  edx,[esp+0x24]  ;­ ç «® ¯® “
-
 
662
  mov  esi,0x00ffffff ;梥â
1452
	mov	edi,[screen_table]
-
 
1453
	mov	esi,[bytes_per_line]
663
  mov  eax,47 ;¢ë¢¥á⨠ç¨á«®
1454
	mov	ecx,esi
664
  mcall
1455
	shl	ecx,1
665
  add  edx,0x600000   ;0x40 - 8chars + 0x20 - space
1456
	mov	eax,[edi]
-
 
1457
	mov	ebx,[cursor]
-
 
1458
	inc	ebx
-
 
1459
	shr	ebx,1
-
 
1460
@@:
-
 
1461
	cmp	eax,ebx
-
 
1462
	jge	@f
-
 
1463
	add	[begin_offset],esi
-
 
1464
	sub	[cursor],ecx
666
  mov  ebx,0x20100    ;2 æ¨äàë, 16-à¨ç­ë¥, ç¨á«® ¢ ecx
1465
	sub	ebx,esi
667
 @@:
1466
	jmp	@b
668
  mov  ecx,[ebp+edi]   ;ç¨á«® ¢ ecx
1467
@@:
-
 
1468
	bts	[flags],6
669
  inc  edi
1469
	ret
-
 
1470
 
670
  and  ecx,0xff
1471
align	4
671
  cmp  edi,0x11
-
 
672
  jz   endstr
1472
start_draw:
673
  mcall
1473
	mcall	12,1
674
  add  edx,0x100000
-
 
675
  jmp  @b
1474
	ret
676
 endstr:
1475
 
677
  dec  edi
1476
end_draw:
678
  add  ebp,edi
1477
	mcall	12,2
679
  mov  [end_str],ebp
1478
	ret
680
  popad
1479
 
681
  ret  4
-
 
-
 
1480
close_prog:
682
 
1481
	mcall	-1
683
 
1482
;-------------------------------------------------------------------------------
684
 
1483
change_codepage:	;¬¥­ï¥¬ ¢â®àãî ¯®«®¢¨­ã â ¡«¨æë
685
draw_cursor:
1484
	test	ah,ah
686
  pushad
1485
	jnz	@f
687
  mov  ebx,[x_cursor]
1486
	btc	[flags],4
688
  mov  ecx,[esp+0x24]
1487
	jc	.1
689
  mov  edx,[color]
1488
	push	[codepage_offset]
-
 
1489
	pop	[codepage_offset_previous]
690
  mov  eax,13
1490
	mov	[codepage_offset],2*128
-
 
1491
	jmp	.end
691
  mcall
1492
.1:
692
  movzx edi,[o_s_flag]
1493
	push	[codepage_offset_previous]
693
  and  edi,8
1494
	pop	[codepage_offset]
694
  jnz  @f
1495
	jmp	.end
-
 
1496
@@:
695
  add  ebx,[text_cursor]
1497
	cmp	[codepage_offset],0
696
  mcall
1498
	jne	@f
697
 @@:
1499
	add	[codepage_offset],128
698
  popad
1500
	jmp	.end
699
  ret  4
1501
@@:
700
 
1502
	mov	[codepage_offset],0
701
f2:
1503
.end:
702
  mov  eax,[process_info+46]
1504
	call	show_codepage
703
  mov  [x_cursor],0xb0005
1505
	jmp	red
704
  sub  eax,0x11
1506
 
-
 
1507
show_codepage:
-
 
1508
	mov	ebp,6
-
 
1509
	mov	edx,dword [threath_buf+62]
705
;  mov  [text_cursor],-1
1510
	sub	edx,73
Line -... Line 1511...
-
 
1511
	shl	edx,16
706
  shl  eax,0x10
1512
	add	edx,[low_area]
707
 
1513
	mov	edi,string_cp866
-
 
1514
	cmp	[codepage_offset],0
-
 
1515
	je	@f
708
  mov  [y_filename_area],eax
1516
	add	edi,6
709
  ret
1517
	cmp	[codepage_offset],128
-
 
1518
	je	@f
710
 
1519
	add	edi,6
-
 
1520
@@:
-
 
1521
	mov	ecx,8*65536+16
-
 
1522
	mov	esi,1
711
menufile:
1523
	push	ebp
712
  mov  [menu_opened],1
1524
	mov	ebp,0
-
 
1525
@@:
-
 
1526
	xor	ebx,ebx
-
 
1527
	push	edi
-
 
1528
	mov	bl,[edi]
-
 
1529
	shl	bx,4
-
 
1530
	add	ebx,font_buffer
-
 
1531
	mov	edi,palitra.5
713
  mov  ebx,[xf_menu];x-base+x_size for hi-level menu button
1532
	mcall	65
-
 
1533
	add	edx,8*65536
714
  mov  edx,5;first id button for this group
1534
	pop	edi
-
 
1535
	inc	edi
-
 
1536
	dec	dword [esp]
-
 
1537
	jnz	@b
-
 
1538
	add	esp,4
-
 
1539
	ret
-
 
1540
 
-
 
1541
show_insert:	;®â®¡à ¦¥­¨¥ ०¨¬  ¢áâ ¢ª¨/§ ¬¥­ë
-
 
1542
	mov	ebp,3
-
 
1543
	mov	edx,dword [threath_buf+62]
-
 
1544
	sub	edx,120
-
 
1545
	shl	edx,16	; mov edx,428*65536+335
-
 
1546
	add	edx,[low_area]
-
 
1547
	mov	edi,string_ins
-
 
1548
	push	ebp
-
 
1549
	mov	ecx,8*65536+16
-
 
1550
	mov	esi,1
-
 
1551
	mov	ebp,0
-
 
1552
.1:
-
 
1553
	xor	ebx,ebx
-
 
1554
	push	edi
-
 
1555
	bt	[flags],1
-
 
1556
	jnc	.2
-
 
1557
	mov	bl,[edi]
-
 
1558
	shl	bx,4
-
 
1559
.2:
-
 
1560
	add	ebx,font_buffer
-
 
1561
	mov	edi,palitra.5
-
 
1562
	mcall	65
-
 
1563
	add	edx,8*65536
-
 
1564
	pop	edi
-
 
1565
	inc	edi
-
 
1566
	dec	dword [esp]
-
 
1567
	jnz	.1
-
 
1568
	add	esp,4
715
  mov  edi,3;counter buttons
1569
	ret
-
 
1570
;-------------------------------------------------------------------------------
-
 
1571
	;help window
-
 
1572
create_help_window:
-
 
1573
	pushad
-
 
1574
	mcall	51,1,.thread,(.threat_stack+16*4)
-
 
1575
	popad
-
 
1576
	ret
-
 
1577
.thread:
-
 
1578
	call	.window
-
 
1579
.still:
-
 
1580
	mcall	10
-
 
1581
	dec	al
-
 
1582
	jz	.red
-
 
1583
	dec	al
-
 
1584
	jz	.key
-
 
1585
	dec	al
-
 
1586
	jz	.button
-
 
1587
	jmp	.still
-
 
1588
	mcall	-1
-
 
1589
.button:
-
 
1590
	mcall	17,1
-
 
1591
	cmp	ah,1
-
 
1592
	jne	@f
-
 
1593
	mcall	-1
-
 
1594
@@:
-
 
1595
	cmp	ah,2
716
  call f1
1596
	jne	@f
717
  ;output text for menu
1597
	mov	edi,(help_end-help_text)/51
-
 
1598
	movzx	eax,[cur_help_string]
-
 
1599
	sub	edi,13
718
  shr  ecx,0x10  ;y-base button
1600
	sub	edi,eax
719
  and  ebx,0xffff0000
1601
	jz	.still
720
  add  ecx,0x6000f ;for y-base text
1602
	inc	[cur_help_string]
-
 
1603
	jmp	.red
721
  mov  esi,4 ;length text
1604
@@:
722
  add  ebx,ecx ;full base text
1605
	cmp	ah,3
723
  mov  edx,m_open
1606
	jne	.still
724
  mov  ecx,[sc.work_button_text]
1607
	cmp	[cur_help_string],0
-
 
1608
	je	.still
725
  or   ecx,0x10000000
1609
	dec	[cur_help_string]
726
  sub  eax,4
1610
	jmp	.red
727
  mcall
-
 
728
  add  ebx,0x0c ;next full base text
1611
 
729
  add  edx,4 ;next string
1612
.key:
-
 
1613
	mcall	2
-
 
1614
	jmp	.still
730
  mcall
1615
 
Line 731... Line -...
731
  add  ebx,0x0c
-
 
732
  add  edx,4
-
 
733
  mcall
-
 
734
  ret
1616
.red:
735
 
-
 
736
menucoding:
-
 
737
  mov  [menu_opened],1
-
 
738
  mov  ebx,[xe_menu]
-
 
739
  mov  edx,8 ;first id
-
 
740
  mov  edi,6 ;counter
-
 
741
  add  ebx,0x10 ;add width buttons
-
 
742
  push edi
-
 
743
  call f1
-
 
744
  pop  edi
-
 
745
  shr  ecx,0x10
-
 
746
  and  ebx,0xffff0000
-
 
747
  add  ecx,0x8000f
-
 
748
  mov  esi,8 ;length text
-
 
749
  add  ebx,ecx
1617
	call	.window
750
  mov  edx,m_win2dos
-
 
751
  mov  ecx,[sc.work_button_text]
-
 
752
  or   ecx,0x10000000
-
 
Line -... Line 1618...
-
 
1618
	jmp	.still
753
  sub  eax,4
1619
 
754
 @@:
1620
.window:
755
  mcall
1621
	pushad
-
 
1622
	mcall	12,1
-
 
1623
	mcall	0,50*65536+320,0x70*65536+240,0x13000000,,help_but_text
-
 
1624
	mcall	8,<130,20>,<6,12>,2,0xaaaaaa
-
 
1625
	mcall	,<150,20>,,3,
-
 
1626
	mov	ebx,8*65536+15
-
 
1627
	mov	ecx,0x00DDDDDD
756
  add  ebx,0x0c
1628
	xor	edx,edx
-
 
1629
	movzx	eax,byte [cur_help_string]
757
  add  edx,8 ;next string
1630
	mov	edi,(help_end-help_text)/51
758
  dec  edi
1631
	sub	edi,eax
-
 
1632
	mov	esi,51
-
 
1633
	mul	si
-
 
1634
	mov	edx,help_text
759
  jnz  @b
1635
	add	edx,eax
-
 
1636
	mov	eax,4
760
  ret
1637
@@:
-
 
1638
	add	ebx,0x10
-
 
1639
	mcall
-
 
1640
	add	edx,51
-
 
1641
	dec	edi
761
 
1642
	jnz	@b
-
 
1643
	mcall	12,2
-
 
1644
	popad
-
 
1645
	ret
-
 
1646
 
-
 
1647
.threat_stack:	times	16	dd	0
-
 
1648
;-------------------------------------------------
-
 
1649
 
-
 
1650
open_file:
-
 
1651
	mov	dword [ed_box_data],1
-
 
1652
	mov	dword [ed_box_data+4],edit1
-
 
1653
	call	draw_ed_box	;à¨á㥬 editbox
-
 
1654
	;à §¬¥à ä ©« ?
762
menuhelp:
1655
.0:
-
 
1656
	mov	[func_70.func_n],5
-
 
1657
	mov	[func_70.param1],0
-
 
1658
	mov	[func_70.param2],0
763
  mov  [menu_opened],1
1659
	mov	[func_70.param3],0
-
 
1660
	mov	[func_70.param4],bufferfinfo
-
 
1661
	mov	[func_70.rezerv],0
-
 
1662
	mov	[func_70.name],file_name
-
 
1663
	mcall	70,func_70
-
 
1664
 
-
 
1665
	test	al,al	;ä ©« ­ ©¤¥­?
-
 
1666
	jz	@f
-
 
1667
	mcall	4,400*65536+31,0x80CC0000,error_open_file_string
764
  mov  ebx,[xh_menu]
1668
	jmp	open_file
-
 
1669
@@:
-
 
1670
;	mov	edx,[blocks_counter]
-
 
1671
;	mov	edi,[blocks_table]
-
 
1672
;	@@:	mov	ecx,[edi]	;¢ë᢮¡®¦¤ ¥¬:
-
 
1673
;	mcall	68,13	;¡«®ª¨ ä ©« 
-
 
1674
;	add	edi,8
-
 
1675
;	dec	edx
-
 
1676
;	jnz	@b
-
 
1677
;	mcall	68,13,[blocks_table]	;â ¡«¨æã
-
 
1678
 
-
 
1679
	mov	eax,	dword [bufferfinfo+32]	;ª®¯¨à㥬 à §¬¥à ä ©« 
-
 
1680
	mov	[file_size],eax
-
 
1681
 
765
  mov  edx,14 ;first id
1682
;	mov	ebx,65536	;64Š ¡«®ª
-
 
1683
;	xor	edx,edx
766
  add  ebx,6 ;add width buttons
1684
;	div	ebx
-
 
1685
;	push	dx	;¤«¨­  ¯®á«¥¤­¥£® ¡«®ª 
-
 
1686
;	test	dx,dx
-
 
1687
;	jz	@f
767
  mov  edi,2 ;counter
1688
;	inc	eax
-
 
1689
;	@@:	test	eax,eax
-
 
1690
;	jnz	@f
-
 
1691
;	inc	eax
-
 
1692
;	@@:	mov	[blocks_counter],eax
Line -... Line 1693...
-
 
1693
;	sal	eax,3;*8	;à §¬¥à â ¡«¨æë á ¨­¤¥ªá ¬¨ ¡«®ª®¢
-
 
1694
;;	add	eax,32	;à¥è ¥¬	¯à®¡«¥¬ã á 32Œ ä ©« ¬¨
-
 
1695
 
-
 
1696
;	mov	ecx,eax	;¢ë¤¥«ï¥¬ ¯ ¬ïâì:
-
 
1697
;	mcall	68,12	;¯®¤ â ¡«¨æã
-
 
1698
;	mov	[blocks_table],eax
-
 
1699
;	mov	edi,eax
-
 
1700
;	mov	ecx,[blocks_counter]
-
 
1701
;	@@:	mov	dword [edi+4],65536
-
 
1702
;	add	edi,8
-
 
1703
;	loop	@b
-
 
1704
;	xor	edx,edx
-
 
1705
;	pop	dx	;¤«¨­  ¯®á«¥¤­¥£® ¡«®ª 
-
 
1706
;	mov	dword [edi-4],edx
-
 
1707
 
-
 
1708
;	mov	edx,[blocks_counter]
-
 
1709
;	mov	edi,[blocks_table]
-
 
1710
;@@:	mcall	68,12,[edi+4]	;¯®¤ ¡«®ª
-
 
1711
;	mov	[edi],eax
-
 
1712
;	add	edi,8
-
 
1713
;	dec	edx
-
 
1714
;	jnz	@b
-
 
1715
 
768
  call f1
1716
	mcall	68,13,[file_buffer]
-
 
1717
	test	eax,eax
-
 
1718
	jnz	@f
769
  shr  ecx,0x10
1719
	;§¤¥áì ®è¨¡ª  ­  ­¥ ®á¢®¡®¦¤¥­¨¥ ¡«®ª 
-
 
1720
@@:
-
 
1721
	mcall	68,12,[file_size]
-
 
1722
	mov	[file_buffer],eax
-
 
1723
 
-
 
1724
;;¨¬¥¥¬ â ¡«¨æã: [ DWORD 㪠§ â¥«ì ­  ¯¥à¢ë© í«¥¬¥­â ¡«®ª  : DWORD ¤«¨­  ¡«®ª  ]
-
 
1725
 
-
 
1726
;	mov	ecx,[blocks_counter]	;®âªà뢠¥¬ ä ©«
-
 
1727
;	mov	edi,[blocks_table]
-
 
1728
	mov	[func_70.func_n],0
-
 
1729
	mov	[func_70.param1],0
-
 
1730
	mov	[func_70.param2],0
-
 
1731
	mov	[func_70.rezerv],0
-
 
1732
	mov	[func_70.name],file_name
-
 
1733
;@@:
-
 
1734
	push	dword [file_size];dword [edi+4]
-
 
1735
	pop	dword [func_70.param3]
-
 
1736
	push	dword [file_buffer];dword [edi]
-
 
1737
	pop	dword [func_70.param4]
-
 
1738
	mcall	70,func_70
-
 
1739
;	add	edi,8
-
 
1740
;	add	dword [func_70.param1],65536
-
 
1741
;	loop	@b
-
 
1742
 
-
 
1743
	test	eax,eax
-
 
1744
	jz	@f
-
 
1745
	;®è¨¡ª  ç⥭¨ï
-
 
1746
@@:
-
 
1747
	call	Ctrl_HOME
-
 
1748
 
-
 
1749
	jmp	redraw_all
-
 
1750
;-------------------------------------------------------------------------------
-
 
1751
open_dialog_save:
-
 
1752
	call	get_filter_data
-
 
1753
	mov	[OpenDialog_data.type],1	; Save
-
 
1754
	start_OpenDialog	OpenDialog_data
-
 
1755
	cmp	[OpenDialog_data.status],2	; OpenDialog does not start
-
 
1756
;	je	.sysxtree	; some kind of alternative, instead OpenDialog
-
 
1757
	je	save_file
-
 
1758
	cmp	[OpenDialog_data.status],1
-
 
1759
	jne	still
-
 
1760
	mov	esi,fname_buf
-
 
1761
	mov	edi,file_name
-
 
1762
	cld
-
 
1763
@@:
-
 
1764
	cmp	byte [esi],0
-
 
1765
	je	@f
-
 
1766
	movsb
-
 
1767
	jmp	@b
-
 
1768
@@:
-
 
1769
	mov	byte [edi],0
-
 
1770
	sub	esi,path
-
 
1771
	mov	[edit1.size],esi
-
 
1772
	mov	[edit1.pos],esi
-
 
1773
	jmp	save_file.1
-
 
1774
;-------------------------------------------------------------------------------
770
  and  ebx,0xffff0000
1775
save_file:	;á®å࠭塞 ä ©«
-
 
1776
	mov	dword [ed_box_data],1
-
 
1777
	mov	dword [ed_box_data+4],edit1
-
 
1778
	call	draw_ed_box
-
 
1779
.1:
-
 
1780
	mov	[func_70.func_n],2
-
 
1781
	mov	[func_70.param1],0
-
 
1782
	mov	[func_70.param2],0
-
 
1783
	push	[file_size]
-
 
1784
	pop	[func_70.param3]
-
 
1785
	push	[file_buffer]
-
 
1786
	pop	[func_70.param4]
-
 
1787
	mov	[func_70.rezerv],0
-
 
1788
	mov	[func_70.name],file_name
-
 
1789
	mcall	70,func_70
-
 
1790
	cmp	al,0	;á®åà ­ñ­ 㤠筮?
-
 
1791
	je	redraw_all
-
 
1792
	mcall	4,400*65536+31,0x80CC0000,error_save_file_string
-
 
1793
	jmp	save_file
-
 
1794
;-------------------------------------------------------------------------------
-
 
1795
draw_ed_box:	;à¨á®¢ ­¨¥ edit box' 
-
 
1796
.1:
-
 
1797
	push	eax	ebx	ecx	edx
771
  add  ecx,0x8000f
1798
	mcall	13,180*65536+220,25*65536+70,0xaaaaaa
-
 
1799
	bt	[flags],9
-
 
1800
	jnc	@f
-
 
1801
	mcall	4,246*65536+35,0x80ffffff,sel_text
-
 
1802
@@:
-
 
1803
	bt	[flags],2
-
 
1804
	jnc	@f
-
 
1805
	push	dword Option_boxs
-
 
1806
	call	[option_box_draw]
-
 
1807
@@:
-
 
1808
	bt	[flags],3
-
 
1809
	jnc	@f
-
 
1810
	push	dword Option_boxs2
-
 
1811
	call	[option_box_draw]
-
 
1812
@@:
-
 
1813
	mov	eax,ed_box_data
-
 
1814
	mov	ecx,[eax]
-
 
1815
@@:
-
 
1816
	add	eax,4
-
 
1817
	push	dword [eax]
-
 
1818
	call	[edit_box_draw]
-
 
1819
	loop	@b
-
 
1820
	pop	edx	ecx	ebx	eax
-
 
1821
.2:
-
 
1822
	mcall	10
-
 
1823
	cmp	al,6
-
 
1824
	je	.mouse
-
 
1825
	cmp	al,3
-
 
1826
	je	.button
-
 
1827
	cmp	al,2
-
 
1828
	je	.keys
-
 
1829
	cmp	al,1
-
 
1830
	jne	.2
-
 
1831
	call	draw_window
-
 
1832
	call	main_area
-
 
1833
	bt	[flags],2
-
 
1834
	jnc	@f
-
 
1835
	push	dword Option_boxs
-
 
1836
	call	[option_box_draw]
-
 
1837
@@:
-
 
1838
	bt	[flags],3
-
 
1839
	jnc	@f
-
 
1840
	push	dword Option_boxs2
-
 
1841
	call	[option_box_draw]
-
 
1842
@@:
-
 
1843
	jmp	.1
-
 
1844
 
-
 
1845
.mouse:
-
 
1846
	bt	[flags],2
-
 
1847
	jnc	@f
-
 
1848
	push	dword Option_boxs
-
 
1849
	call	[option_box_mouse]
-
 
1850
@@:
-
 
1851
	bt	[flags],3
-
 
1852
	jnc	@f
-
 
1853
	push	dword Option_boxs2
-
 
1854
	call	[option_box_mouse]
-
 
1855
@@:
-
 
1856
	jmp	.2
-
 
1857
 
-
 
1858
.keys:
-
 
1859
	mcall	2
-
 
1860
	cmp	ah,13
-
 
1861
	je	.4
-
 
1862
	cmp	ah,27
-
 
1863
	je	.3
-
 
1864
 
-
 
1865
	bt	[flags],2	;¯à®¢¥àª  ­  ¯à¨¬¥­¨¬®áâì ᨬ¢®«®¢ 0-9,a-b
-
 
1866
	jnc	.eb2
-
 
1867
.eb1:
-
 
1868
	cmp	ah,9
-
 
1869
	jne	.eb1_1
-
 
1870
	push	edx
-
 
1871
	mov	edx,[option_group1]
-
 
1872
	cmp	edx,op1
-
 
1873
	jne	@f
-
 
1874
	mov	edx,op2
-
 
1875
	jmp	.eb1_2
-
 
1876
@@:
-
 
1877
	cmp	edx,op2
-
 
1878
	jne	@f
-
 
1879
	mov	edx,op3
-
 
1880
	jmp	.eb1_2
-
 
1881
@@:
-
 
1882
	mov	edx,op1
-
 
1883
.eb1_2:
-
 
1884
	mov	[option_group1],edx
-
 
1885
	pop	edx
-
 
1886
	jmp	.1
-
 
1887
.eb1_1:
-
 
1888
	cmp	ah,48
-
 
1889
	jb	.eb1_3
-
 
1890
	cmp	ah,57
-
 
1891
	jbe	.eb
-
 
1892
	cmp	ah,102
-
 
1893
	jg	.eb1_3
-
 
1894
	cmp	ah,97
-
 
1895
	jge	.eb
-
 
1896
.eb1_3:
-
 
1897
	cmp	ah,182
-
 
1898
	je	.eb
-
 
1899
	cmp	ah,8
-
 
1900
	je	.eb
-
 
1901
	cmp	ah,176
-
 
1902
	je	.eb
-
 
1903
	cmp	ah,179
-
 
1904
	je	.eb
-
 
1905
	dec	[edit2.shift]
-
 
1906
	dec	[edit2.shift+4]
-
 
1907
 
-
 
1908
	push	dword [ed_box_data+4];	[esp]
-
 
1909
	call	[edit_box_draw]
-
 
1910
	jmp	.2
-
 
1911
 
-
 
1912
.eb2:
-
 
1913
	bt	[flags],3
-
 
1914
	jnc	.eb3
-
 
1915
	cmp	ah,9
-
 
1916
	jne	.eb2_2
-
 
1917
	push	edx
-
 
1918
	mov	edx,[option_group2]
-
 
1919
	cmp	edx,op11
-
 
1920
	jne	@f
-
 
1921
	mov	edx,op12
-
 
1922
	jmp	.eb2_1
-
 
1923
@@:
-
 
1924
	mov	edx,op11
-
 
1925
.eb2_1:
-
 
1926
	mov	[option_group2],edx
-
 
1927
	pop	edx
-
 
1928
	jmp	.1
-
 
1929
.eb2_2:
-
 
1930
	cmp	ah,182
-
 
1931
	je	.eb
-
 
1932
	cmp	ah,8
-
 
1933
	je	.eb
-
 
1934
	cmp	ah,176
-
 
1935
	je	.eb
-
 
1936
	cmp	ah,179
-
 
1937
	je	.eb
-
 
1938
	mov	edx,[option_group2]
-
 
1939
	cmp	edx,op11
-
 
1940
	jne	.eb
-
 
1941
	cmp	ah,48
-
 
1942
	jb	.eb2_3
-
 
1943
	cmp	ah,57
-
 
1944
	jbe	.eb
-
 
1945
	cmp	ah,102
-
 
1946
	jg	.eb2_3
-
 
1947
	cmp	ah,97
-
 
1948
	jge	.eb
-
 
1949
.eb2_3:
-
 
1950
	dec	[edit3.shift]
-
 
1951
	dec	[edit3.shift+4]
-
 
1952
	push	dword [ed_box_data+4];[esp]
-
 
1953
	call	[edit_box_draw]
-
 
1954
	jmp	.2
-
 
1955
.eb3:
-
 
1956
	bt	[flags],9
-
 
1957
	jnc	.eb
-
 
1958
	cmp	ah,9
-
 
1959
	je	.eb3_1
-
 
1960
	cmp	ah,182
-
 
1961
	je	.eb3_2
-
 
1962
	cmp	ah,8
-
 
1963
	je	.eb3_2
-
 
1964
	cmp	ah,176
-
 
1965
	je	.eb3_2
-
 
1966
	cmp	ah,179
-
 
1967
	je	.eb3_2
-
 
1968
	cmp	ah,48
-
 
1969
	jb	.eb3_3
-
 
1970
	cmp	ah,57
-
 
1971
	jbe	.eb3_2
-
 
1972
	cmp	ah,102
-
 
1973
	jg	.eb3_3
-
 
1974
	cmp	ah,97
-
 
1975
	jge	.eb3_2
-
 
1976
.eb3_3:
-
 
1977
	push	edx
-
 
1978
	mov	edx,[edit4.flags]
-
 
1979
	and	edx,2
-
 
1980
	jz	@f
-
 
1981
	pop	edx
-
 
1982
	dec	[edit4.shift]
-
 
1983
	dec	[edit4.shift+4]
-
 
1984
	jmp	.2
-
 
1985
@@:
-
 
1986
	pop	edx
-
 
1987
	dec	[edit5.shift]
-
 
1988
	dec	[edit5.shift+4]
-
 
1989
	jmp	.2
-
 
1990
.eb3_1:
-
 
1991
	push	edx
-
 
1992
	mov	edx,[edit4.flags]
-
 
1993
	and	edx,2
772
  mov  esi,4 ;length text
1994
	jz	@f
Line 773... Line -...
773
  add  ebx,ecx
-
 
774
  mov  edx,m_help
-
 
775
  mov  ecx,[sc.work_button_text]
-
 
776
  or   ecx,0x10000000
-
 
777
  sub  eax,4
-
 
778
  mcall
-
 
779
  add  ebx,0x0c
-
 
780
  inc  esi ;add lebgth output text
-
 
781
  add  edx,4
-
 
782
  mcall
-
 
783
  ret
-
 
Line 784... Line 1995...
784
 
1995
	pop	edx
785
f1:;uses for drawing low-level menu buttons
1996
	mov	[edit5.flags],2
786
  ;counter buttons get into
1997
	mov	[edit4.flags],0
-
 
1998
	jmp	.eb3_2
-
 
1999
@@:
-
 
2000
	pop	edx
-
 
2001
	mov	[edit4.flags],2
-
 
2002
	mov	[edit5.flags],0
-
 
2003
.eb3_2:
-
 
2004
	push	dword [ed_box_data+4]
-
 
2005
	call	[edit_box_key]
-
 
2006
	push	dword [ed_box_data+8]
-
 
2007
	call	[edit_box_key]
-
 
2008
	jmp	.1
-
 
2009
 
-
 
2010
.eb:
-
 
2011
	push	dword [ed_box_data+4];[esp]
-
 
2012
	call	[edit_box_key]
-
 
2013
	jmp	.2
-
 
2014
 
-
 
2015
.button:
-
 
2016
	mcall	17
-
 
2017
	cmp	ah,1
-
 
2018
	jne	.2
-
 
2019
	jmp	close_prog
-
 
2020
.3:
-
 
2021
	btr	[flags],2
-
 
2022
	btr	[flags],3
-
 
2023
	add	esp,4
Line -... Line 2024...
-
 
2024
	jmp	redraw_all
-
 
2025
.4:
-
 
2026
	mcall	13,180*65536+220,25*65536+70,frgrd_color
-
 
2027
	ret
787
  ;menufile,menucoding,menuhelp funcs.
2028
 
-
 
2029
 
-
 
2030
;-------------------------------------------------
-
 
2031
;-------------------------------------------------
788
  mov  ecx,[y_menu]         ;y-base+y_size for hi-level menu button
2032
;-------------------------------------------------
789
  mov  esi,[sc.work_button] ;color buttons
2033
 
-
 
2034
strtohex:
-
 
2035
;enter: edi - pointer to string,ebx - pointer to size of string; exit: eax in hex
-
 
2036
	mov	esi,hex8_string
-
 
2037
@@:
-
 
2038
	mov	ah,[edi+ecx-1]	;®¡à ¡®âª  ¢¢¥¤ñ­­ëå ᨬ¢®«®¢
-
 
2039
	sub	ah,48
-
 
2040
	cmp	ah,9
-
 
2041
	jbe	.1
-
 
2042
	sub	ah,7
-
 
2043
	cmp	ah,15
-
 
2044
	jbe	.1
-
 
2045
	sub	ah,32
-
 
2046
.1:
-
 
2047
	mov	[esi+ecx-1],ah
-
 
2048
	dec	ecx
-
 
2049
	jnz	@b
-
 
2050
	mov	ecx,[ebx]
-
 
2051
	xor	eax,eax
790
  mov  eax,8
2052
.2:
-
 
2053
	shl	eax,4
-
 
2054
	or	al,[esi]
791
  push ecx                  ;for output text
2055
	inc	esi
-
 
2056
	dec	ecx
-
 
2057
	jnz	.2
792
 @@:
2058
	ret
-
 
2059
 
-
 
2060
Ctrl_G:
793
  add  ecx,0xc0000
2061
	bts	[flags],2
-
 
2062
	mov	dword [ed_box_data],1
-
 
2063
	mov	dword [ed_box_data+4],edit2
Line 794... Line -...
794
  mcall
-
 
795
  inc  edx ;id
-
 
796
  dec  edi ;counter
2064
	call	draw_ed_box
797
  jnz  @b
-
 
798
  pop  ecx ;for output text
-
 
799
  ret
-
 
800
 
-
 
801
redraw_window:
-
 
802
  call get_process_info
2065
	btr	[flags],2
803
  mov  [rflag],1
-
 
804
  call draw_window
2066
	mov	ecx,[edit2.size]
805
  ret
2067
	test	ecx,ecx
806
 
-
 
807
;this is debug func
-
 
808
debug:
2068
	jz	.end
809
  pushad
-
 
810
  mov  ecx,[esp+0x24]
-
 
811
  mov  ebx,0x80100
2069
	cmp	ecx,8
812
  mov  edx,0x10000a0
2070
	jg	Ctrl_G
813
  mov  eax,47
-
 
814
  mov  esi,0x00ffffff
-
 
815
  mcall
2071
 
816
  popad
2072
	mov	edi,go_to_string
817
  ret  4
2073
	mov	ebx,edit2.size
818
 
-
 
819
;   *********************************************
-
 
820
;   *******  WINDOW DEFINITIONS AND DRAW ********
-
 
821
;   *********************************************
2074
	call	strtohex
822
 
2075
 
823
draw_window:
2076
	cmp	eax,[file_size]	;¢ë¡®à check_box' 
824
  pushad
-
 
825
  mov  eax,48
-
 
826
  mov  ebx,3
-
 
827
  mov  ecx,sc
-
 
828
  mov  edx,sizeof.system_colors
2077
	jg	Ctrl_G
829
  mcall
2078
	mov	edx,[option_group1]
830
 
2079
	cmp	edx,op1	;abs
831
  mov  eax,12                 ; function 12:tell os about windowdraw
2080
	je	.abs
832
  mov  ebx,1                  ; 1, start of draw
2081
	cmp	edx,op2
833
  mcall
2082
	jne	.back
834
     ; DRAW WINDOW
-
 
835
  mov  eax,0                  ; function 0 : define and draw window
2083
	add	eax,[current_offset]	;forward
836
                              ; [x start] *65536 + [x size]
2084
	cmp	eax,[file_size]
837
  mov  ebx,[process_info+42]
2085
	jg	Ctrl_G
838
                              ; [y start] *65536 + [y size]
-
 
839
  mov  ecx,[process_info+46]
-
 
840
  mov  edx,0x03000000         ; color of work area RRGGBB,8->color gl
2086
	mov	edi,[screen_table]
841
  mcall
-
 
842
     ; WINDOW LABEL
-
 
843
  mov  eax,4                  ; function 4 : write text to window
-
 
844
  mov  ebx,8*65536+8          ; [x start] *65536 + [y start]
-
 
845
  mov  ecx,[sc.grab_text]
2087
	mov	edi,[edi]
846
  or   ecx,0x10000000         ; font 1 & color ( 0xF0RRGGBB )
-
 
847
  mov  edx,labelt             ; pointer to text beginning
2088
	xor	edx,edx
848
  mov  esi,labellen-labelt    ; text length
-
 
849
  mcall
2089
@@:
850
    ;check for only header window output
2090
	add	edx,edi
851
  cmp  dword [process_info+46],25
-
 
852
  jle  minimaze_view
-
 
853
 
2091
	cmp	eax,edx
854
     ;MENU AREA
2092
	jg	@b
855
  mov  eax,[process_info+42] ;x-size window
-
 
856
  mov  ecx,[process_info+46] ;y-size window
2093
	sub	edx,edi
857
  push ecx ;for using done
-
 
858
  mov  ebx,0x40000
2094
	mov	[begin_offset],edx
859
  sub  eax,8
2095
	sub	eax,edx
860
  mov  edi,ecx
-
 
861
  add  ebx,eax ;x-base + x-size
2096
	shl	eax,1
862
  sub  edi,22 ;temporary value for menu area
2097
	inc	eax
863
  push ebx ;for drawing buttons area
-
 
864
  sub  ecx,edi ;y-base menu area
2098
	mov	[cursor],eax
865
  mov  edx,[sc.work_graph]
-
 
866
  shl  ecx,0x10
2099
	jmp	.end
867
  mov  eax,13
2100
 
868
  add  ecx,0x10
-
 
869
  mcall
2101
.back:
870
     ;MENU BUTTONS
-
 
871
  ;now in hi-half ecx register begin Y-coord. menu area
-
 
872
  ;in hi-half ebx begin X-coord.
-
 
-
 
2102
	cmp	eax,[current_offset]	;back
873
  ;menu 'File'
2103
	jg	Ctrl_G
874
  mov  esi,edx ;color
2104
	mov	edi,[screen_table]
875
  and  ecx,0xffff0000
2105
	mov	edi,[edi]
876
  and  ebx,0xffff0000
2106
	mov	ebx,[current_offset]
877
  add  ecx,0x1000c
2107
	sub	ebx,eax
878
  add  ebx,0x20028   ;40x12
2108
	xor	edx,edx
879
  mov  edx,2 ;menu 'File' id = 2
-
 
880
  mov  [y_menu],ecx ;for low-level menus func.
2109
@@:
881
  mov  [xf_menu],ebx;for low-level menus func.
2110
	add	edx,edi
882
  mov  eax,8
-
 
883
  push ebx ;for output buttons texts
2111
	cmp	edx,ebx
884
  mcall
2112
	jb	@b
885
  ;registers is't change
2113
	sub	edx,edi
886
  ;menu 'Coding'
2114
	mov	[begin_offset],edx
887
  add  ebx,0x290018 ;80x12
2115
	sub	ebx,edx
888
  inc  edx ;menu 'coding' id = 3
2116
	mov	edx,ebx
889
  mov  [xe_menu],ebx;for low-level menus func.
2117
	shl	edx,1
890
  mcall
-
 
891
  ;menu 'Help'
-
 
892
  add  ebx,0x40ffe8 ;+0x280000 - 0x28, 40x12
-
 
893
  inc  edx ;menu 'Help' id = 4
-
 
894
  mov  [xh_menu],ebx;for low-level menus func.
-
 
895
  mcall
2118
	inc	edx
896
     ;MENU BUTTONS TEXTS
2119
	mov	[cursor],edx
897
  ;'File'
-
 
898
  pop  ebx
-
 
899
  shr  ecx,0x10
2120
	jmp	.end
900
  and  ebx,0xffff0000
2121
.abs:
-
 
2122
	mov	esi,[screen_table]
901
  add  ecx,3
2123
	mov	esi,[esi]
902
  mov  eax,4                     ; function 4 : write text to window
2124
	xor	ebx,ebx
903
  add  ebx,0x80000
2125
.3:
904
  mov  edx,f_menu
2126
	add	ebx,esi
905
  add  ebx,ecx                   ; [x start] *65536 + [y start]
2127
	cmp	eax,ebx
906
  mov  esi,4
2128
	jg	.3
-
 
2129
	sub	ebx,esi
907
  mov  ecx,[sc.work_button_text]
2130
	cmp	ebx,[file_size]
908
  or   ecx,0x10000000            ; font 1 & color ( 0xF0RRGGBB )
2131
	jg	Ctrl_G
909
  push esi                       ;for 'Help' menu text
2132
	mov	[begin_offset],ebx
910
  mcall
-
 
Line 911... Line 2133...
911
  ;'coding'
2133
	sub	eax,ebx
-
 
2134
	shl	eax,1
-
 
2135
	inc	eax
-
 
2136
	mov	[cursor],eax
-
 
2137
.end:
-
 
2138
	jmp	red
-
 
2139
 
-
 
2140
Ctrl_B:
-
 
2141
	bts	[flags],9
-
 
2142
	mov	dword [ed_box_data],2
-
 
2143
	mov	dword [ed_box_data+4],edit4
-
 
2144
	mov	dword [ed_box_data+8],edit5
-
 
2145
	call	draw_ed_box
-
 
2146
	btr	[flags],9
-
 
2147
 
-
 
2148
	mov	ecx,[edit4.size]
-
 
2149
	test	ecx,ecx
-
 
2150
	jz	.end
-
 
2151
	cmp	ecx,8
-
 
2152
	jg	Ctrl_B
-
 
2153
 
912
  ;registers is't change
2154
	mov	edi,sel1_string
-
 
2155
	mov	ebx,edit4.size
-
 
2156
	call	strtohex
913
  add  ebx,0x2d0000
2157
 
-
 
2158
	cmp	eax,[file_size]
-
 
2159
	jge	Ctrl_B
-
 
2160
	push	eax	;from
-
 
2161
	mov	ecx,[edit5.size]
-
 
2162
	test	ecx,ecx
914
  ;mov  esi,6
2163
	jz	.end
-
 
2164
	cmp	ecx,8
-
 
2165
	jg	Ctrl_B
-
 
2166
 
915
  add  esi,2
2167
	mov	edi,sel2_string
-
 
2168
	mov	ebx,edit5.size
-
 
2169
	call	strtohex
-
 
2170
 
-
 
2171
	cmp	eax,[file_size]
-
 
2172
	jb	@f
-
 
2173
	pop	eax
-
 
2174
	jmp	Ctrl_B
-
 
2175
@@:
-
 
2176
	pop	[shblock_beg]
-
 
2177
	cmp	eax,[shblock_beg]
-
 
2178
	jae	@f
-
 
2179
	xchg	eax,[shblock_beg]
-
 
2180
@@:
-
 
2181
	mov	[shblock_end],eax
-
 
2182
	bts	[flags],8
-
 
2183
.end:
-
 
2184
	jmp	red
-
 
2185
 
-
 
2186
Ctrl_F:
-
 
2187
	bts	[flags],3
-
 
2188
	mov	dword [ed_box_data],1
-
 
2189
	mov	dword [ed_box_data+4],edit3
-
 
2190
	call	draw_ed_box
-
 
2191
	btr	[flags],3
-
 
2192
	mov	ecx,[edit3.size]
-
 
2193
	test	ecx,ecx
-
 
2194
	jz	.end
-
 
2195
	cmp	ecx,8
-
 
2196
	jg	Ctrl_F
-
 
2197
	mov	edi,find_string
-
 
2198
	mov	edx,[option_group2]
-
 
2199
	cmp	edx,op11
-
 
2200
	jne	.find
-
 
2201
	mov	eax,find_string
-
 
2202
	push	dword [eax]
-
 
2203
	push	dword [eax+4]
-
 
2204
	bts	[flags],0
-
 
2205
	mov	ebx,edit3.size
-
 
2206
	call	strtohex
-
 
2207
	mov	ecx,[edit3.size]
-
 
2208
	bt	cx,0
-
 
2209
	jnc	.3
-
 
2210
	inc	ecx
-
 
2211
	shl	eax,4
-
 
2212
.3:
-
 
2213
	shr	ecx,1
916
;  mov  edx,e_menu
2214
.4:
-
 
2215
	mov	[edi+ecx-1],al
-
 
2216
	shr	eax,8
917
  add  edx,4
2217
	loop	.4
-
 
2218
.find:
-
 
2219
	mov	esi,[current_offset]
-
 
2220
	mov	ebx,[file_size]
-
 
2221
	mov	eax,ebx
-
 
2222
	add	eax,[file_buffer]
-
 
2223
	add	esi,[file_buffer]
-
 
2224
.5:
-
 
2225
	mov	ecx,[edit3.size]
-
 
2226
	cmp	edx,op11
918
  mcall
2227
	jne	.7
-
 
2228
	bt	cx,0
-
 
2229
	jnc	.6
-
 
2230
	inc	ecx
-
 
2231
.6:
-
 
2232
	shr	ecx,1
-
 
2233
.7:
-
 
2234
	cld
-
 
2235
@@:
-
 
2236
	cmp	esi,eax
-
 
2237
	jg	.end
-
 
2238
	cmpsb
-
 
2239
	je	.8
-
 
2240
	mov	edi,find_string
-
 
2241
	jmp	.5
-
 
2242
.8:
-
 
2243
	loop	@b
-
 
2244
	sub	esi,[file_buffer]
-
 
2245
	mov	ecx,[edit3.size]
-
 
2246
	cmp	edx,op11
-
 
2247
	jne	.10
-
 
2248
	bt	cx,0
-
 
2249
	jnc	.9
-
 
2250
	inc	ecx
-
 
2251
.9:
-
 
2252
	shr	ecx,1
-
 
2253
.10:
-
 
2254
	sub	esi,ecx
-
 
2255
	xor	edx,edx
-
 
2256
	mov	edi,[screen_table]
-
 
2257
	mov	edi,[edi]
-
 
2258
@@:
919
  ;'Help'
2259
	add	edx,edi
-
 
2260
	cmp	edx,esi
-
 
2261
	jb	@b
-
 
2262
	sub	edx,edi
920
  add  ebx,0x3b0000
2263
	mov	[begin_offset],edx
-
 
2264
	sub	esi,edx
-
 
2265
	shl	esi,1
-
 
2266
	inc	esi
-
 
2267
	mov	[cursor],esi
-
 
2268
.end:
-
 
2269
	bt	[flags],0
-
 
2270
	jnc	@f
-
 
2271
	mov	eax,find_string
-
 
2272
	pop	dword [eax+4]
-
 
2273
	pop	dword [eax]
-
 
2274
	btr	[flags],0
-
 
2275
@@:
-
 
2276
	jmp	red
-
 
2277
 
-
 
2278
invert_byte:
-
 
2279
	mov	ebx,[current_offset]
-
 
2280
	cmp	ebx,[file_size]
-
 
2281
	jae	still
-
 
2282
	add	ebx,[file_buffer]
-
 
2283
	not	byte [ebx]
-
 
2284
	jmp	red
-
 
2285
 
-
 
2286
 
-
 
2287
Insert:	;¯¥à¥ª«î祭¨¥	०¨¬ 	¢áâ ¢ª¨/§ ¬¥­ë
-
 
2288
	btc	[flags],1	;not [insert_mod]
-
 
2289
	call	show_insert
-
 
2290
	jmp	red
-
 
2291
 
921
;   mov  esi,4
2292
 
-
 
2293
DEL:
-
 
2294
	bt	[flags],1
-
 
2295
	jnc	still
-
 
2296
	mov	edi,[current_offset]
-
 
2297
	mov	esi,[file_buffer]
-
 
2298
	mov	edx,[file_size]
-
 
2299
	test	edx,edx
922
  pop  esi
2300
	jz	still
-
 
2301
	dec	edx
-
 
2302
	cmp	edi,edx
-
 
2303
	jbe	@f
-
 
2304
	call	LEFT
-
 
2305
	call	LEFT
-
 
2306
	jmp	red
923
;  mov  edx,h_menu
2307
@@:
-
 
2308
	jb	@f
924
  add  edx,6
2309
	call	LEFT
-
 
2310
	call	LEFT
-
 
2311
@@:
-
 
2312
	cmp	edi,edx
-
 
2313
	je	@f
Line 925... Line -...
925
  mcall
-
 
926
 ;LOW_LEVEL MENU
-
 
927
  ;for every hi-level menu exists one procedure
-
 
928
  ;in begin programm they are not calls,
-
 
929
  ;but when user click on one item hi-level menu
-
 
930
  ;or press hot keys, call one func. and after
-
 
931
  ;end work this func. she is redraw window -
-
 
932
  ;low-level menu is hide. Functions:
-
 
933
  ;menufile,menucoding,menuhelp.
-
 
934
  ;Thay uses global virables, top-left corner every
-
 
935
  ;hi-level menu buttons: [xf_menu],[xe_menu],[xh_menu],[y_menu]
-
 
936
 
-
 
937
     ;DRAW BUTTONS AREA
-
 
938
  pop  ebx ;for push ebx into processed menu area: x-bzse + x-size
-
 
939
;  mov  ecx,[process_info+46]
-
 
940
  pop  ecx
-
 
941
  push ecx
-
 
942
  sub  ecx,24
-
 
943
  mov  edx,[sc.work_graph]
-
 
Line 944... Line 2314...
944
  shl  ecx,16              ;y start
2314
	mov	al,[edi+esi+1]
945
  mov  eax,13
2315
	mov	[edi+esi],al
946
  add  ecx,20
-
 
947
  mcall
2316
	inc	edi
948
 
2317
	jmp	@b
949
;filename input area
-
 
950
;  mov  ecx,[process_info+46]
-
 
951
  pop  ecx
-
 
952
  push ecx ;for info strings
2318
@@:
953
  mov  ebx,0x0008005a
2319
	dec	[file_size]
954
  sub  ecx,21
2320
	call	show_file_size
955
  xor  edx,edx
-
 
Line 956... Line -...
956
  shl  ecx,16
-
 
957
  mov  [y_filename_area],ecx
-
 
958
  dec  edx
-
 
959
  add  ecx,16
-
 
960
  mov  eax,13
-
 
961
  push ecx ;for button 'Go'
-
 
962
  mcall
-
 
963
 
-
 
964
;button 'Go', press in case open/save if filename input complete
-
 
965
  ;button size = 24x16
-
 
966
  mov  eax,8
-
 
Line 967... Line 2321...
967
  pop  ecx ;y-base+y-size
2321
	jmp	red
968
  mov  ebx,0x00680018;x-base+x-size
-
 
969
  dec  ecx
2322
 
970
  mov  edx,0xff ;id
2323
 
971
  mov  esi,[sc.work_button]
-
 
972
  mcall
2324
BackSpace:
973
  shr  ecx,0x10
-
 
974
  and  ebx,0xffff0000
-
 
975
  add  ecx,0x50004
-
 
976
  mov  edx,b_go
-
 
977
  add  ebx,ecx
-
 
978
  mov  esi,2
-
 
979
  mov  ecx,[sc.work_button_text]
-
 
980
  or   ecx,0x10000000
-
 
981
  sub  eax,4
2325
	bt	[flags],1	;cmp [insert_mod],0
982
  mcall
-
 
983
 
-
 
984
;where output cursor?
-
 
985
  mov  al,[o_s_flag]
-
 
986
  and  al,8
2326
	jnc	still	;je still
987
  je   @f
2327
	mov	edi,[current_offset]
988
  mov  ecx,[y_filename_area]
2328
	mov	esi,[file_buffer]
989
  add  ecx,0x40008
-
 
990
  jmp  cursor
2329
	mov	edx,[file_size]
991
 @@:  ;o_s_flag<0 - not output cursor into filename area
2330
	test	edx,edx
992
  mov  ecx,[y_cursor]
2331
	jz	still
993
 cursor:
-
 
994
  push ecx
-
 
995
  call draw_cursor
2332
	test	edi,edi
Line -... Line 2333...
-
 
2333
	jz	still
-
 
2334
	call	LEFT
996
 
2335
	call	LEFT
-
 
2336
	cmp	[cursor],2
-
 
2337
	jne	@f
997
  mov  eax,[y_filename_area]
2338
	cmp	edx,1
-
 
2339
	jne	@f
-
 
2340
	dec	[cursor]
-
 
2341
@@:
-
 
2342
	cmp	edi,edx
998
  mov  ebx,0xa0000
2343
	jge	@f
-
 
2344
	mov	al,[edi+esi]
-
 
2345
	mov	[edi+esi-1],al
-
 
2346
	inc	edi
999
  mov  edx,filename
2347
	jmp	@b
-
 
2348
@@:
1000
  shr  eax,0x10
2349
	dec	[file_size]
-
 
2350
	call	show_file_size
-
 
2351
	jmp	red
1001
  and  ebx,0xffff0000
2352
 
-
 
2353
 
-
 
2354
Ctrl_UP:
-
 
2355
	cmp	[begin_offset],0
-
 
2356
	je	@f
-
 
2357
	mov	eax,[bytes_per_line]
-
 
2358
	sub	[begin_offset],eax
-
 
2359
@@:
1002
  add  eax,4
2360
	ret
-
 
2361
 
1003
  xor  ecx,ecx
2362
 
-
 
2363
Ctrl_DOWN:
1004
  add  ebx,eax
2364
	mov	eax,[cursor]
1005
  movzx esi,[name_l]
2365
	dec	eax
-
 
2366
	shr	eax,1
-
 
2367
	add	eax,[begin_offset]
-
 
2368
	mov	ebx,[bytes_per_line]
1006
  mov  eax,4
2369
	add	eax,ebx
-
 
2370
	cmp	eax,[file_size]
-
 
2371
	jge	@f
-
 
2372
	add	[begin_offset],ebx
-
 
2373
@@:
-
 
2374
	ret
-
 
2375
 
-
 
2376
 
1007
  mcall
2377
UP:
Line -... Line 2378...
-
 
2378
	mov	eax,[current_offset]
-
 
2379
	cmp	eax,[bytes_per_line]
-
 
2380
	jb	still
-
 
2381
	mov	eax,[cursor]
-
 
2382
	dec	ax
-
 
2383
	shr	ax,1
-
 
2384
	cmp	eax,[bytes_per_line]
-
 
2385
	jge	@f
-
 
2386
	mov	eax,[bytes_per_line]
-
 
2387
	sub	[begin_offset],eax
-
 
2388
	jmp	red
-
 
2389
@@:
-
 
2390
	mov	eax,[bytes_per_line]
-
 
2391
	shl	ax,1
-
 
2392
	sub	[cursor],eax
-
 
2393
	jmp	red
-
 
2394
 
-
 
2395
 
Line -... Line 2396...
-
 
2396
DOWN:	;­ 	áâபã	¢­¨§
-
 
2397
	mov	eax,[current_offset]
-
 
2398
	add	eax,[bytes_per_line]
-
 
2399
	bt	[flags],1
-
 
2400
	jnc	@f
-
 
2401
	dec	eax
-
 
2402
@@:
-
 
2403
	cmp	eax,[file_size]
-
 
2404
	jge	still	;¥á«¨ ¬ë ­  ¯®á«¥¤­¥© áâப¥ ä ©« , â® á⮯
-
 
2405
	mov	eax,[screen_table]
-
 
2406
	mov	eax,[eax]
-
 
2407
	mov	edx,[cursor]
-
 
2408
	dec	dx
-
 
2409
	shr	dx,1
-
 
2410
	add	edx,[bytes_per_line]
-
 
2411
	cmp	eax,edx	;­  ¯®á«¥¤­¥© áâப¥?
-
 
2412
	jbe	@f
-
 
2413
	mov	eax,[bytes_per_line]
-
 
2414
	shl	ax,1
-
 
2415
	add	[cursor],eax
-
 
2416
	ret
-
 
2417
@@:
-
 
2418
	mov	eax,[bytes_per_line]
-
 
2419
	add	[begin_offset],eax
-
 
2420
	ret
-
 
2421
 
-
 
2422
 
-
 
2423
LEFT:
-
 
2424
	cmp	[cursor],1
-
 
2425
	jbe	@f
-
 
2426
	dec	[cursor]
-
 
2427
	jmp	.end
-
 
2428
@@:
-
 
2429
	cmp	[begin_offset],0	;ªãàá®à	­  ¯¥à¢®© áâப¥ ᮠᬥ饭¨¥¬ 0?
-
 
2430
	jne	@f	;¨­ ç¥ ᬥ頥¬ á ¯à®ªàã⪮© ¢¢¥àå ¢¢¥àå ¨ ¢ ª®­¥æ áâப¨
-
 
2431
;	inc	[cursor]
-
 
2432
	jmp	.end;still	;⮣¤  á⮯
-
 
2433
@@:
-
 
2434
	mov	eax,[bytes_per_line]
-
 
2435
	sub	[begin_offset],eax
-
 
2436
	shl	ax,1
-
 
2437
	dec	eax
-
 
2438
	add	[cursor],eax
-
 
2439
.end:
-
 
2440
	ret
-
 
2441
 
-
 
2442
 
-
 
2443
RIGHT:
-
 
2444
	mov	ecx,[begin_offset]	;¢ëç¨á«ï¥¬ ᬥ饭¨¥ ªãàá®à 
-
 
2445
	mov	edx,[cursor]	;¤«ï ¯à®¢¥àª¨ áãé¥á⢮¢ ­¨ï
-
 
2446
	shr	edx,1	;á«¥¤ãî饣® ᨬ¢®« 
-
 
2447
	add	ecx,edx
-
 
2448
	bt	[flags],1
-
 
2449
	jnc	@f
-
 
2450
	dec	ecx	;áà ¢­¨¢ ¥¬ á à §¬¥à®¬ ä ©« 
-
 
2451
@@:
-
 
2452
	cmp	ecx,[file_size]	;¯®«®¦¥­¨¥¬ ªãàá®à  - ­¥ ¤ «¥¥ 1 ¡ ©â  ®â ª®­æ  ä ©« 
-
 
2453
	jge	red
-
 
2454
	cmp	[file_size],0
-
 
2455
	je	still
-
 
2456
	mov	eax,[screen_table]
-
 
2457
	mov	eax,[eax]
-
 
2458
	mov	ecx,[begin_offset]
-
 
2459
	cmp	eax,edx	;áà ¢­¥­¨¥ ­  ­¨¦­îî áâபã
-
 
2460
	jbe	@f
-
 
2461
	inc	[cursor]	;ªãàá®à ¢¯à ¢®
-
 
2462
	jmp	red
-
 
2463
@@:
-
 
2464
	mov	ecx,[bytes_per_line]	;ᬥ頥¬áï ­  áâà®çªã ¢­¨§
-
 
2465
	add	[begin_offset],ecx	;á ¯à®ªàã⪮©
-
 
2466
	shl	cx,1
-
 
2467
	dec	cx
-
 
2468
	sub	[cursor],ecx
-
 
2469
	jmp	red
-
 
2470
 
-
 
2471
 
-
 
2472
PGDN:
-
 
2473
	mov	edi,[screen_table]
-
 
2474
	mov	eax,[edi]
-
 
2475
	shl	eax,1
-
 
2476
	add	eax,[begin_offset]
-
 
2477
	cmp	eax,[file_size]	;¥áâì «¨ ¢®§¬®¦­®áâì ᬥáâ¨âìáï ­  áâà ­¨æã?
-
 
2478
	jg	Ctrl_END
-
 
2479
	mov	eax,[edi]
-
 
2480
	add	[begin_offset],eax
Line -... Line 2481...
-
 
2481
;	mov	ebx,[cursor]
-
 
2482
;	dec	ebx
1008
 
2483
;	xor	ecx,ecx
1009
;info strings
2484
;	bt	ebx,0
1010
     ; sizefile text
2485
;	jnc	@f
1011
;    mov  eax,[process_info+46]
2486
;	inc	ecx
1012
  pop  eax
2487
;	@@:	shr	ebx,1
1013
  mov  ebx,0x00840000
2488
;	add	ebx,eax
-
 
2489
;	@@:	cmp	ebx,[file_size]
-
 
2490
;	jbe	@f
-
 
2491
;	sub	ebx,[bytes_per_line]
-
 
2492
;	jmp	@b
-
 
2493
;	@@:	sub	ebx,eax
-
 
2494
;	shl	ebx,1
-
 
2495
;	inc	ebx
-
 
2496
;	add	ebx,ecx
-
 
2497
;	mov	[cursor],ebx
-
 
2498
	jmp	red
-
 
2499
 
-
 
2500
 
-
 
2501
PGUP:
1014
  sub  eax,18
2502
	mov	eax,[screen_table]
-
 
2503
	mov	eax,[eax]
1015
  xor  ecx,ecx
2504
	mov	edx,[begin_offset]
-
 
2505
	cmp	eax,edx
-
 
2506
	jbe	@f
-
 
2507
	call	Ctrl_HOME
-
 
2508
	jmp	red
-
 
2509
@@:
1016
  add  ebx,eax
2510
	sub	[begin_offset],eax
Line 1017... Line 2511...
1017
  mov  edx,sizestr   ; pointer to text beginning
2511
	jmp	red
1018
  mov  eax,4
2512
 
1019
  mov  esi,5
2513
 
1020
  mcall
2514
HOME:
1021
  add  ebx,0x00530000
2515
	mov	eax,[cursor]
1022
  inc  esi
2516
	dec	ax
1023
;    mov  edx,offst
2517
	shr	ax,1
1024
  add  edx,5
2518
	mov	ecx,[bytes_per_line]
1025
  inc  esi
2519
	xor	edx,edx
1026
  mcall
-
 
1027
    ;sizefile
2520
	div	ecx
1028
  mov  ecx,[sizefile]
2521
	shl	dx,1
1029
  mov  edx,ebx
-
 
1030
  xor  esi,esi
2522
	sub	[cursor],edx
1031
  sub  edx,0x00350000
2523
	bt	[cursor],0
1032
  mov  eax,47
-
 
1033
  mov  ebx,0x80100
2524
	jc	@f
1034
  mcall
2525
	dec	[cursor]
1035
  mov  ecx,[current]
2526
@@:
1036
  add  edx,0x005f0000
2527
	ret
1037
  mcall
2528
 
1038
 
2529
 
1039
  push [text_cursor] ;íâ® ¯®§¨æ¨ï ªãàá®à  ¢ ⥪á⮢®© áâப¥
2530
END_:
-
 
2531
	mov	eax,[cursor]
1040
  call draw_cursor
2532
	dec	ax
-
 
2533
	shr	ax,1
1041
  mov  ecx,[sizefile]
2534
	mov	ecx,[bytes_per_line]
-
 
2535
	xor	edx,edx
-
 
2536
	div	ecx
1042
  jecxz minimaze_view
2537
	mov	eax,[current_offset]
Line 1043... Line -...
1043
  call output_screen
-
 
1044
 
-
 
1045
 minimaze_view:
-
 
1046
  mov  eax,12  ; function 12:tell os about windowdraw
-
 
1047
  mov  ebx,2 ; 2, end of draw
-
 
1048
  mcall
-
 
1049
  popad
-
 
1050
  ret
-
 
1051
 
-
 
1052
 
-
 
Line -... Line 2538...
-
 
2538
	sub	eax,edx
-
 
2539
	add	eax,[bytes_per_line]
-
 
2540
	mov	edx,[file_size]
-
 
2541
	cmp	eax,edx
1053
 
2542
	jbe	@f
-
 
2543
	sub	edx,eax
-
 
2544
	add	eax,edx
-
 
2545
@@:
-
 
2546
	sub	eax,[begin_offset]
-
 
2547
	shl	eax,1
-
 
2548
	test	eax,eax
-
 
2549
	jz	red
-
 
2550
	dec	eax
-
 
2551
	mov	[cursor],eax
-
 
2552
	jmp	red
-
 
2553
 
-
 
2554
 
-
 
2555
Ctrl_HOME:
-
 
2556
	mov	[begin_offset],0
-
 
2557
	mov	[cursor],1
-
 
2558
	ret
-
 
2559
 
-
 
2560
 
-
 
2561
Ctrl_END:
-
 
2562
	mov	eax,[file_size]
-
 
2563
	mov	ecx,[screen_table]
-
 
2564
	mov	ecx,[ecx]
-
 
2565
	xor	edx,edx
-
 
2566
	div	ecx
1054
 
2567
	test	dx,dx
1055
 
2568
	jnz	@f
-
 
2569
	test	eax,eax
-
 
2570
	jz	@f
-
 
2571
	mov	edx,ecx
-
 
2572
	dec	eax
1056
get_process_info:
2573
@@:
-
 
2574
	push	dx
-
 
2575
	xor	dx,dx
-
 
2576
	mul	ecx
-
 
2577
	pop	dx
-
 
2578
	shl	edx,1
-
 
2579
	cmp	edx,1
-
 
2580
	jg	@f
-
 
2581
	mov	edx,2
-
 
2582
@@:
-
 
2583
	dec	edx
-
 
2584
	mov	[begin_offset],eax
-
 
2585
	mov	[cursor],edx
-
 
2586
	jmp	red
1057
  pushad
2587
 
-
 
2588
 
-
 
2589
ESC:
1058
  mov  eax,9
2590
	btr	[flags],8
-
 
2591
	jmp	red
-
 
2592
 
-
 
2593
copy_to_buf:
-
 
2594
	bt	[flags],8
-
 
2595
	jnc	.1
1059
  mov  ebx,process_info
2596
	mov	eax,[shblock_end]
-
 
2597
	sub	eax,[shblock_beg]
-
 
2598
	inc	eax
-
 
2599
	mov	ecx,eax
-
 
2600
	mov	[copy_len],eax
-
 
2601
	mcall	68,20,,[copy_buf]
-
 
2602
	mov	esi,[shblock_beg]
-
 
2603
	mov	edi,[copy_buf]
-
 
2604
	add	esi,[file_buffer]
-
 
2605
	mov	ecx,[copy_len]
-
 
2606
	cld
-
 
2607
@@:
-
 
2608
	movsb
-
 
2609
	loop	@b
-
 
2610
	bts	[flags],10
-
 
2611
	xor	eax,eax
-
 
2612
	ret
-
 
2613
.1:
-
 
2614
	or	eax,-1
-
 
2615
	ret
1060
  xor  ecx,ecx
2616
 
-
 
2617
Ctrl_C:
-
 
2618
	call	copy_to_buf
1061
  dec  ecx
2619
	jmp	still
1062
  mcall
2620
 
1063
  popad
2621
shblock_sz	dd	0
1064
  ret
2622
 
-
 
2623
Ctrl_V:
-
 
2624
	bt	[flags],10
1065
 
2625
	jnc	still
1066
coding:
2626
	bt	[flags],8
1067
  pushad
2627
	jnc	.past_kurs
1068
  mov  ebp,0x10000 ;0x80000
2628
;¢áâ ¢«ï¥¬ ¡«®ª ¢ ¢ë¤¥«¥­­ãî ®¡« áâì
1069
  mov  edi,[esp+0x28] ;source table
2629
	mov	ebx,[shblock_end]
1070
  mov  esi,[esp+0x24] ;destination table
2630
	sub	ebx,[shblock_beg]
1071
  xor  ecx,ecx ;index in file
2631
	inc	ebx
1072
 new_char:
2632
	mov	[shblock_sz],ebx
1073
  xor  ebx,ebx ;index in tables
2633
	mov	esi,[copy_buf]
1074
 not_c:
2634
	mov	edi,[file_buffer]
1075
  mov  ah,[ebp+ecx] ;load char
-
 
1076
  cmp  ah,[edi+ebx] ;
2635
	add	edi,[shblock_beg]
1077
  jz   @f
2636
	mov	eax,[copy_len]
1078
  inc  ebx
2637
.1:
1079
  cmp  ebx,0x40
2638
	cld
-
 
2639
@@:
1080
  jge  end_table
2640
	movsb
Line -... Line 2641...
-
 
2641
	dec	eax
1081
  jmp  not_c
2642
	jz	.del
-
 
2643
	dec	ebx
1082
 @@:
2644
	jnz	@b
1083
  mov  al,[esi+ebx]
2645
.add:
1084
  inc  ebx
2646
	push	esi	edi	eax
-
 
2647
	push	[file_size]
-
 
2648
	add	[file_size],eax
-
 
2649
	call	raspred_mem
-
 
2650
	pop	ecx
-
 
2651
	mov	edi,[esp+4]
1085
  mov  [ebp+ecx],al
2652
	add	ecx,[file_buffer]
1086
 end_table:
2653
	sub	ecx,edi
-
 
2654
	inc	ecx
-
 
2655
	mov	edi,[file_size]
-
 
2656
	add	edi,[file_buffer]
1087
  inc  ecx
2657
	mov	esi,edi
-
 
2658
	sub	esi,eax
-
 
2659
	std
-
 
2660
@@:
1088
  cmp  ecx,[sizefile]
2661
	movsb
1089
  jle  new_char
2662
	loop	@b
1090
  popad
2663
	pop	eax edi esi
-
 
2664
	cld
-
 
2665
@@:
-
 
2666
	movsb
-
 
2667
	dec	eax
1091
  ret  8
2668
	jnz	@b
-
 
2669
	mov	eax,[shblock_beg]
-
 
2670
	add	eax,[copy_len]
-
 
2671
	dec	eax
-
 
2672
	mov	[shblock_end],eax
-
 
2673
	jmp	red
-
 
2674
.del:
-
 
2675
	dec	ebx
1092
 
2676
	jz	red
1093
create_process:
2677
	mov	ecx,[file_size]
-
 
2678
	add	ecx,[file_buffer]
-
 
2679
	sub	ecx,edi
1094
  pushad
2680
	mov	esi,edi
1095
  mov  eax,51
2681
	add	esi,ebx
-
 
2682
	cld
-
 
2683
@@:	movsb
-
 
2684
	loop	@b
-
 
2685
	sub	[file_size],ebx
-
 
2686
	call	raspred_mem
-
 
2687
	mov	eax,[shblock_beg]
-
 
2688
	add	eax,[copy_len]
1096
  xor  ebx,ebx
2689
	dec	eax
-
 
2690
	mov	[shblock_end],eax
1097
  mov  ecx,[esp+0x24]
2691
	jmp	red
-
 
2692
 
-
 
2693
;¥á«¨ ¡«®ª ­¥ ¢ë¤¥«¥­, â® ¢áâ ¢«ï¥¬ ¡«®ª ¯¥à¥¤ ªãàá®à®¬ 
1098
  inc  ebx
2694
.past_kurs:
1099
  mov  edx,0x7E000 ;0x1000
2695
;	bt	[flags],1
-
 
2696
;	jnc	still
-
 
2697
;	mov	esi,[file_buffer]
-
 
2698
;	add	esi,[current_offset]
-
 
2699
;	jmp	red
1100
  mcall
2700
	jmp	still
1101
  popad
2701
 
-
 
2702
Ctrl_X:
-
 
2703
	bt	[flags],1
-
 
2704
	jnc	still
-
 
2705
	call	copy_to_buf
-
 
2706
	test	eax,eax
1102
  ret  4
2707
	jnz	still
-
 
2708
 
-
 
2709
	mov	ecx,[file_size]
-
 
2710
	sub	ecx,[copy_len]
-
 
2711
	sub	ecx,[shblock_beg]
-
 
2712
	inc	ecx
-
 
2713
	mov	ebx,[file_size]
1103
 
2714
	mov	edi,[shblock_beg]
-
 
2715
	mov	esi,[shblock_end]
1104
help_thread:
2716
	inc	esi
-
 
2717
	add	esi,[file_buffer]
-
 
2718
	add	edi,[file_buffer]
-
 
2719
	add	ebx,[file_buffer]
-
 
2720
	cld
-
 
2721
@@:
-
 
2722
	cmp	esi,ebx
-
 
2723
	je	.1
-
 
2724
	movsb
-
 
2725
	loop	@b
-
 
2726
.1:
-
 
2727
	mov	eax,[file_size]
-
 
2728
	sub	eax,[copy_len]
-
 
2729
	mov	[file_size],eax
-
 
2730
	btr	[flags],8
-
 
2731
 
-
 
2732
	mov	eax,[shblock_beg]
-
 
2733
	mov	esi,[screen_table]
-
 
2734
	mov	esi,[esi]
1105
  call help_window
2735
	xor	ebx,ebx
-
 
2736
.3:
-
 
2737
	add	ebx,esi
-
 
2738
	cmp	eax,ebx
-
 
2739
	jg	.3
-
 
2740
	sub	ebx,esi
-
 
2741
;	cmp	ebx,[file_size]
-
 
2742
;	jg	Ctrl_G
-
 
2743
	mov	[begin_offset],ebx
-
 
2744
	sub	eax,ebx
-
 
2745
	shl	eax,1
-
 
2746
	inc	eax
-
 
2747
	mov	[cursor],eax
-
 
2748
	jmp	red
-
 
2749
 
-
 
2750
;---------------------------------------------------------------------
-
 
2751
open_dialog:
-
 
2752
	call	get_filter_data
-
 
2753
	mov	[OpenDialog_data.type],0	; Open
-
 
2754
	start_OpenDialog	OpenDialog_data
-
 
2755
	cmp	[OpenDialog_data.status],2	; OpenDialog does not start
-
 
2756
	je	.sysxtree	; some kind of alternative, instead OpenDialog
-
 
2757
	cmp	[OpenDialog_data.status],1
-
 
2758
	jne	still
-
 
2759
	mov	esi,fname_buf
-
 
2760
	jmp	.load
-
 
2761
.sysxtree:
1106
 help_still:
2762
	call	opendialog
-
 
2763
	jc	still
-
 
2764
	mov	esi,path
-
 
2765
.load:
-
 
2766
	mov	edi,file_name
-
 
2767
	cld
-
 
2768
@@:
-
 
2769
	cmp	byte [esi],0
-
 
2770
	je	@f
-
 
2771
	movsb
1107
  mov  eax,10
2772
	jmp	@b
-
 
2773
@@:
1108
  mcall
2774
	mov	byte [edi],0
1109
  dec  eax
2775
	sub	esi,path
-
 
2776
	mov	[edit1.size],esi
-
 
2777
	mov	[edit1.pos],esi
-
 
2778
	jmp	open_file.0
-
 
2779
;---------------------------------------------------------------------
-
 
2780
get_filter_data:
Line -... Line 2781...
-
 
2781
	mov	edi,[OpenDialog_data.com_area]
-
 
2782
	test	edi,edi
-
 
2783
	jnz	@f
Line -... Line 2784...
-
 
2784
	add	esp,4
-
 
2785
	jmp	still
-
 
2786
@@:
-
 
2787
	add	edi,4096+4
-
 
2788
	mov	esi,Filter
-
 
2789
	mov	ecx,[esi]
1110
  jz   help_red
2790
	inc	ecx
1111
  dec  eax
2791
	cld
-
 
2792
	rep	movsb
1112
  jz   help_key
2793
	mov	edi,[OpenDialog_data.com_area]
1113
  dec  eax
-
 
1114
  jz   help_button
-
 
Line -... Line 2794...
-
 
2794
	mov	[edi+4096],dword 1
-
 
2795
	ret
-
 
2796
;---------------------------------------------------------------------
-
 
2797
;##################################
-
 
2798
opendialog:
-
 
2799
;
-
 
2800
; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec,
-
 
2801
; 1 byte space, 1 byte type of dialog (O - Open ,S - Save)
-
 
2802
;
-
 
2803
	mov	edi,path
-
 
2804
	xor	eax,eax
-
 
2805
	mov	ecx,(1024+16)/4
-
 
2806
	rep	stosd
-
 
2807
 
-
 
2808
	mov	[dlg_pid_get],0
1115
  jmp  help_still
2809
 
-
 
2810
; Get my PID in dec format 4 bytes
1116
 help_red:
2811
	mov	eax,9
-
 
2812
	mov	ebx,procinfo
-
 
2813
	or	ecx,-1
-
 
2814
	mcall
-
 
2815
 
1117
  call help_window
2816
; convert eax bin to param dec
1118
  jmp  help_still
2817
	mov	eax,dword [procinfo+30]	;offset of myPID
-
 
2818
	mov	edi,param+4-1	;offset to 4 bytes
1119
 help_key:
2819
	mov	ecx,4
1120
  inc  eax
2820
	mov	ebx,10
1121
  inc  eax
2821
.new_d:
1122
  mcall
-
 
1123
  jmp  help_still
-
 
1124
 help_button:
2822
	xor	edx,edx
1125
  mov  eax,17
-
 
1126
  mcall
-
 
1127
  dec  ah
-
 
1128
  jne  help_still
-
 
1129
  shr  eax,8
-
 
1130
  dec  eax
2823
	div	ebx
1131
  mcall
-
 
1132
 
-
 
1133
help_window:
-
 
1134
  pushad
-
 
1135
  mov  eax,12  ; function 12:tell os about windowdraw
-
 
1136
  mov  ebx,1 ; 1, start of draw
-
 
1137
  mcall
-
 
1138
     ; DRAW WINDOW
-
 
1139
  mov  eax,0 ; function 0 : define and draw window
-
 
1140
  mov  ebx,0x500140 ; [x start] *65536 + [x size]
-
 
1141
  mov  ecx,0x700110 ; [y start] *65536 + [y size]
2824
	add	dl,'0'
-
 
2825
	mov	[edi],dl
-
 
2826
	dec	edi
-
 
2827
	loop	.new_d
-
 
2828
 
-
 
2829
; wirite 1 byte space to param
-
 
2830
	mov	[param+4],byte 32	;Space for next parametr
-
 
2831
; and 1 byte type of dialog to param
1142
  mov  edx,0x03000000 ; color of work area RRGGBB,8->color gl
2832
	mov	[param+5],byte 'O'	;Get Open dialog (Use 'S' for Save dialog)
-
 
2833
 
Line 1143... Line 2834...
1143
  mcall
2834
;
1144
     ; WINDOW LABEL
2835
; STEP2 prepare IPC area for get messages
1145
  mov  eax,4 ; function 4 : write text to window
-
 
1146
  mov  ebx,8*65536+8 ; [x start] *65536 + [y start]
2836
;
1147
  mov  ecx,0x10ffffff ; font 1 & color ( 0xF0RRGGBB )
2837
 
1148
  mov  edx,help_label ; pointer to text beginning
-
 
1149
  mov  esi,14 ; text length
-
 
1150
  mcall
-
 
1151
     ; HELP TEXT
-
 
1152
  add  edx,14 ;help_text addr.
-
 
1153
  add  esi,37 ; = 51 - length 1 line
2838
; prepare IPC area
1154
  mov  ecx,0x00ffffff
2839
	mov	[path],dword 0
1155
  mov  edi,(help_end-help_text)/51
2840
	mov	[path+4],dword 8
-
 
2841
 
-
 
2842
; define IPC memory
-
 
2843
	mov	eax,60
-
 
2844
	mov	ebx,1		; define IPC
-
 
2845
	mov	ecx,path	; offset of area
-
 
2846
	mov	edx,1024+16	; size
-
 
2847
	mcall
1156
 @@:
2848
 
1157
  add  ebx,0x10
2849
; change wanted events list 7-bit IPC event
-
 
2850
	mov	eax,40
-
 
2851
	mov	ebx,01000111b
-
 
2852
;	cmp	[image],0
-
 
2853
;	jnz	@f
1158
  mcall
2854
;	mov	bl,01000110b
-
 
2855
;@@:
-
 
2856
	mcall
-
 
2857
 
-
 
2858
;
-
 
2859
; STEP 3 run SYSTEM XTREE with parameters
-
 
2860
;
-
 
2861
	mov	eax,70
-
 
2862
	mov	ebx,run_fileinfo
-
 
2863
	mcall
-
 
2864
	bt	eax,31
-
 
2865
	jnc	@f
1159
  add  edx,51
2866
	mcall	40,0x27
-
 
2867
	add	esp,4
-
 
2868
	jmp	open_file
1160
  dec  edi
2869
@@:
1161
  jnz  @b
2870
	mov	[get_loops],0
1162
 
-
 
1163
 
2871
.getmesloop:
1164
  mov  eax,12  ; function 12:tell os about windowdraw
-
 
1165
  mov  ebx,2 ; 2, end of draw
-
 
1166
  mcall
2872
	mov	eax,23
1167
  popad
-
 
1168
  ret
2873
	mov	ebx,50	;0.5 sec
1169
 
2874
	mcall
1170
about_thread:
-
 
1171
  call about_window
2875
	dec	eax
1172
 about_still:
-
 
Line -... Line 2876...
-
 
2876
	jz	.mred
-
 
2877
	dec	eax
-
 
2878
	jz	.mkey
-
 
2879
	dec	eax
1173
  mov  eax,10
2880
	jz	.mbutton
-
 
2881
	cmp	al,	7-3
-
 
2882
	jz	.mgetmes
-
 
2883
; Get number of procces
-
 
2884
	mov	ebx,procinfo
-
 
2885
	mov	ecx,-1
-
 
2886
	mov	eax,9
-
 
2887
	mcall
-
 
2888
	mov	ebp,eax
-
 
2889
 
1174
  mcall
2890
.loox:
-
 
2891
	mov	eax,9
-
 
2892
	mov	ebx,procinfo
-
 
2893
	mov	ecx,ebp
-
 
2894
	mcall
-
 
2895
	mov	eax,[DLGPID]
-
 
2896
	cmp	[procinfo+30],eax	;IF Dialog find
-
 
2897
	je	.dlg_is_work	;jmp to dlg_is_work
-
 
2898
	dec	ebp
-
 
2899
	jnz	.loox
-
 
2900
 
-
 
2901
	jmp	.erroff
-
 
2902
 
-
 
2903
.dlg_is_work:
-
 
2904
	cmp	[procinfo+50],word 9	;If slot state 9 - dialog is terminated
-
 
2905
	je	.erroff	;TESTODP2 terminated too
-
 
2906
 
-
 
2907
	cmp	[dlg_pid_get],dword 1
-
 
2908
	je	.getmesloop
-
 
2909
	inc	[get_loops]
-
 
2910
	cmp	[get_loops],4	;2 sec if DLG_PID not get TESTOP2 terminated
-
 
2911
	jae	.erroff
-
 
2912
	jmp	.getmesloop
-
 
2913
 
-
 
2914
.mred:
-
 
2915
;	cmp	[image],	0
-
 
2916
;	jz	.getmesloop
-
 
2917
;	call	redraw_all
-
 
2918
	call	draw_window_1
-
 
2919
	jmp	.getmesloop
-
 
2920
.mkey:
-
 
2921
	mov	eax,2
-
 
2922
	mcall	;	read (eax=2)
-
 
2923
	jmp	.getmesloop
-
 
2924
.mbutton:
-
 
2925
	mov	eax,17	; get id
-
 
2926
	mcall
-
 
2927
	cmp	ah,1	; button id=1 ?
1175
  dec  eax
2928
	jne	.getmesloop
-
 
2929
	mov	eax,-1	; close this program
-
 
2930
	mcall
1176
  jz   about_red
2931
.mgetmes:
-
 
2932
 
-
 
2933
; If dlg_pid_get then second message get jmp to still
1177
  dec  eax
2934
	cmp	[dlg_pid_get],dword 1
-
 
2935
	je	.ready
Line 1178... Line 2936...
1178
  jz   about_key
2936
 
-
 
2937
; First message is number of PID SYSXTREE dialog
-
 
2938
 
-
 
2939
; convert PID dec to PID bin
-
 
2940
	movzx	eax,byte [path+16]
-
 
2941
	sub	eax,48
1179
  dec  eax
2942
	imul	eax,10
1180
  jz   about_button
2943
	movzx	ebx,byte [path+16+1]
-
 
2944
	add	eax,ebx
-
 
2945
	sub	eax,48
-
 
2946
	imul	eax,10
-
 
2947
	movzx	ebx,byte [path+16+2]
-
 
2948
	add	eax,ebx
-
 
2949
	sub	eax,48
-
 
2950
	imul	eax,10
-
 
2951
	movzx	ebx,byte [path+16+3]
-
 
2952
	add	eax,ebx
-
 
2953
	sub	eax,48
-
 
2954
	mov	[DLGPID],eax
-
 
2955
 
-
 
2956
; Claear and prepare IPC area for next message
-
 
2957
	mov	[path],dword 0
-
 
2958
	mov	[path+4],dword 8
-
 
2959
	mov	[path+8],dword 0
-
 
2960
	mov	[path+12],dword 0
-
 
2961
	mov	[path+16],dword 0
-
 
2962
 
1181
  jmp  about_still
2963
; Set dlg_pid_get for get next message
1182
 about_red:
2964
	mov	[dlg_pid_get],dword 1
1183
  call about_window
-
 
1184
  jmp  about_still
-
 
1185
 about_key:
-
 
1186
  inc  eax
-
 
Line 1270... Line -...
1270
sizestr: db 'SIZE:'
-
 
1271
 
-
 
1272
offst: db 'OFFSET:'
3277
op_text:	; ‘®¯à®¢®¦¤ î騩 ⥪áâ ¤«ï 祪 ¡®ªá®¢
1273
 
3278
.1	db 'Absolutely'
1274
labelt: db   'HeEd'
3279
.e1:
1275
labellen:
3280
.2	db 'Forward'
-
 
3281
.e2:
1276
 
3282
.3	db 'Back'
1277
;text for hi-level menu buttons
3283
.e3:
1278
f_menu: db 'File'
3284
 
-
 
3285
op_text2:
1279
e_menu: db 'Coding'
3286
.11	db 'Hex'
1280
h_menu: db 'Help'
3287
.e11:
-
 
3288
.21	db 'ASCII'
1281
;text for low-level menu buttons
3289
.e21:
1282
;menu File
3290
 
1283
m_open: db 'Open'
3291
 
-
 
3292
system_path	db '/sys/lib/'
-
 
3293
boxlib_name	db 'box_lib.obj',0
1284
m_save: db 'Save'
3294
 
1285
m_exit: db 'Exit'
3295
head_f_i:
1286
;menu coding
3296
head_f_l	db 'error',0
1287
m_win2dos: db 'Win->Dos'
3297
err_message_found_lib	db 'box_lib.obj was not found',0
-
 
3298
err_message_import	db 'box_lib.obj was not imported',0
1288
m_win2koi: db 'Win->Koi'
3299
 
1289
m_win2iso: db 'Win->Iso'
3300
sel_text	db "From to",0
1290
m_dos2win: db 'Dos->Win'
3301
 
1291
m_dos2koi: db 'Dos->Koi'
3302
help_but_text	= menu_text_area_3 ;db	'Help',0
1292
m_dos2iso: db 'Dos->Iso'
3303
error_open_file_string	db "Isn't found!",0
1293
;menu Help
3304
error_save_file_string	db "Isn't saved!",0
-
 
3305
string_cp866	db ' cp866'
1294
m_help: db 'Help'
3306
string_cp1251	db 'cp1251'
-
 
3307
string_koi8r	db 'koi8-r'
-
 
3308
string_ins	db 'Ins'
1295
m_about: db 'About'
3309
 
1296
;tables for coding
3310
 
-
 
3311
align	4
-
 
3312
number_strings	dd 16	;ª®«¨ç¥á⢮ áâப ­  «¨áâ¥
-
 
3313
;bytes_per_line	dd 16	;ª®«-¢® á⮫¡æ®¢
-
 
3314
 
1297
WIN_TABLE:
3315
group_bytes	dd 8
1298
db 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9
3316
bytes_per_line	dd 16
1299
db 0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3
3317
 
1300
db 0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD
3318
 
1301
db 0xDE,0xDF,0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7
3319
 
-
 
3320
;blocks_counter	dd 1
-
 
3321
;blocks_table	dd 0
1302
db 0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1
3322
cursor	dd 1
1303
db 0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB
3323
 
1304
db 0xFC,0xFD,0xFE,0xFF
-
 
1305
DOS_TABLE:
-
 
1306
db 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89
-
 
1307
db 0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93
-
 
1308
db 0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D
-
 
1309
db 0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7
-
 
1310
db 0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xE0,0xE1
-
 
1311
db 0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB
-
 
1312
db 0xEC,0xED,0xEE,0xEF
-
 
1313
KOI_TABLE:
-
 
1314
db 0xE1,0xE2,0xF7,0xE7,0xE4,0xE5,0xF6,0xFA,0xE9,0xEA
-
 
1315
db 0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF2,0xF3,0xF4,0xF5
-
 
1316
db 0xE6,0xE8,0xE3,0xFE,0xFB,0xFD,0xFF,0xF9,0xF8,0xFC
-
 
1317
db 0xE0,0xF1,0xC1,0xC2,0xD7,0xC7,0xC4,0xC5,0xD6,0xDA
-
 
1318
db 0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD2,0xD3
-
 
1319
db 0xD4,0xD5,0xC6,0xC8,0xC3,0xDE,0xDB,0xDD,0xDF,0xD9
-
 
1320
db 0xD8,0xDC,0xC0,0xD1
-
 
1321
ISO_TABLE:
-
 
1322
db 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9
-
 
1323
db 0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,0xC0,0xC1,0xC2,0xC3
-
 
1324
db 0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD
-
 
1325
db 0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7
-
 
1326
db 0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,0xE0,0xE1
-
 
1327
db 0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB
-
 
1328
db 0xEC,0xED,0xEE,0xEF
-
 
1329
 
-
 
1330
;text for help_window
-
 
1331
help_label: db 'Help for HeEd.'
-
 
1332
help_text:
-
 
1333
if lang eq ru
-
 
1334
 db '1.HeEd ¢ á®áâ®ï­¨¨ ®âªàëâì ä ©« ⮫쪮 ®¤¨­ à § ¨  '
-
 
1335
 db '  ­ã¦­®¥ ç¨á«® à § á®åà ­¨âì ¥£®.                  '
-
 
1336
 db '2.à¨ ®âªàë⨨ ä ©«  ¡¥§ à áè¨à¥­¨ï ­ ¤® íâ® à áè¨-'
-
 
1337
 db '  è¨à¥­¨¥ ¢á¥ à ¢­® 㪠§ë¢ âì ª ª âਠ¯à®¡¥«  ¯®á«¥'
-
 
1338
 db '  â®çª¨.                                           '
-
 
1339
 db '3.‘ ¬® ®âªàë⨥ ä ©«  ¯à®¨á室¨â ¯à¨ ­ ¦ â¨¨ ª­®¯ª¨'
-
 
1340
 db '  "Go".                                            '
-
 
Line 1341... Line -...
1341
 db '4.‘®§¤ ­¨¥ ­®¢ëå ä ©«®¢ ¢ ¬¥­î ­¥ ¯à¥¤ãᬮâ७®, ­®'
-
 
Line 1342... Line -...
1342
 db '  ¬®¦­® ¦¥ । ªâ¨à®¢ âì...                        '
-
 
Line -... Line 3324...
-
 
3324
flags	dw 001000010b
-
 
3325
;¡¨â	0: ¢ edit_box - ¢®á¯à¨ï⨥/(­¥)	¢á¥å ¢¢®¤¨¬ëå ᨬ¢®«®¢
-
 
3326
;1:	0/1 - ०¨¬ § ¬¥­ë/¢áâ ¢ª¨
-
 
3327
;2:	¢ edit_box - ®¡à ¡®âª  Ctrl_G
-
 
3328
;3:	¢ edit_box - ®¡à ¡®âª  Ctrl_F
-
 
3329
;4:	¢ change_codepage - ¥á«¨ ¯®¤­ïâ, â® ¢®ááâ ­®¢¨âì ¯à¥¤ë¤ãéãî ª®¤¨à®¢ªã
-
 
3330
;5:	vertical_scroll_bar move
-
 
3331
;6:	¯®«­ ï	¯¥à¥à¨á®¢ª  ®ª­ 
-
 
3332
;7:	horizontal_scroll_bar move
-
 
3333
;8:	1 - ¢ë¤¥«¥­ ¡«®ª
-
 
3334
;9:	¢ edit_box - ®¡à ¡®âª  Ctrl_B
-
 
3335
;10:	¢ ¯ ¬ï⨠"¢¨á¨â" ᪮¯¨à®¢ ­­ë© ¡«®ª
-
 
3336
 
-
 
3337
help_text:
1343
 db '5.‚ ä ©« § ¯¨á뢠¥âáï ⮫쪮 ª®«¨ç¥á⢮ ¡ ©â, ª®â®-'
3338
if lang eq ru
-
 
3339
 db 'Ctrl+O              - ®âªàëâì ä ©«                 '
-
 
3340
 db 'Ctrl+S              - á®åà ­¨âì                    '
-
 
3341
 db 'PageUp, PageDown    - áâà ­¨æ  ¢¢¥àå/¢­¨§          '
-
 
3342
 db 'Ctrl+UP, Ctrl+Down  - ¯à®ªàã⪠ áâà ­¨æë ­  áâà®-  '
-
 
3343
 db '                 ªã ¢¢¥àå/¢­¨§ ¡¥§ ᬥ饭¨ï ªãàá®à '
-
 
3344
 db 'Home,End            - ¢ ­ ç «®/ª®­¥æ áâப¨        '
-
 
3345
 db 'Ctrl+Home, Ctrl+End - ¢ ­ ç «®/ª®­¥æ ä ©«          '
-
 
3346
 db 'Left, Right, UP, DN - ªãàá®à ¢«¥¢®/¢¯à ¢®/¢ëè¥/­¨¦¥'
-
 
3347
 db 'n                   - ¨­¢¥àâ¨à®¢ âì ¡ ©â           '
-
 
3348
 db 'Ins                 - ०¨¬ § ¬¥­ë/¢áâ ¢ª¨         '
-
 
3349
 db '  Del               - 㤠«¨âì ¡ ©â ¯®¤ ªãàá®à®¬    '
-
 
3350
 db '  BackSpace         - 㤠«¨âì ¡ ©â ¯¥à¥¤ ªãàá®à®¬  '
-
 
3351
 db '~                   - ᬥ­  ª®¤¨à®¢®ª cp866,cp1251 '
-
 
3352
 db 'Shift+~             - cp866/cp1251,koi8r           '
-
 
3353
 db 'Ctrl+F              - ¯®¨áª                        '
-
 
3354
 db 'Ctrl+G              - ¯¥à¥å®¤ ­  ᬥ饭¨¥          '
-
 
3355
 db 'Ctrl+B              - ¢ë¤¥«¨âì ¡«®ª                '
-
 
3356
 db 'ESC                 - á­ïâì ¢ë¤¥«¥­¨¥              '
-
 
3357
 db 'Ctrl+C              - ª®¯¨à®¢ âì ¡«®ª              '
-
 
3358
 db 'Ctrl+V              - ¢áâ ¢¨âì ¢ ¢ë¤¥«¥­­ãî ®¡« áâì'
-
 
3359
 db 'Ctrl+X              - ¢ë१ âì ¢ ¡ãä¥à             '
-
 
3360
else
-
 
3361
 db 'Ctrl+O              - open file                    '
-
 
3362
 db 'Ctrl+S              - save file                    '
-
 
3363
 db 'PageUp, PageDown    - page up/down                 '
-
 
3364
 db 'Ctrl+UP, Ctrl+Down  - scroll page by one string    '
-
 
3365
 db '                    up/down without cursor movement'
-
 
3366
 db 'Home,End            - at the start/end of string   '
-
 
3367
 db 'Ctrl+Home, Ctrl+End - at the start/end of file     '
-
 
3368
 db 'Left, Right, Up, Dn - move cursor to the lft/rght..'
-
 
3369
 db 'n                   - invert byte                  '
-
 
3370
 db 'Ins                 - replace/past mode            '
-
 
3371
 db '  Del               - delete byte under cursor     '
-
 
3372
 db '  BackSpace         - delete byte before cursor    '
-
 
3373
 db '~                   - change codepages cp866,cp1251'
-
 
3374
 db 'Shift+~             - cp866/cp1251,koi8r           '
-
 
3375
 db 'Ctrl+F              - find                         '
-
 
3376
 db 'Ctrl+G              - go to offset                 '
-
 
3377
 db 'Ctrl+B              - select area                  '
-
 
3378
 db 'ESC                 - deselect area                '
-
 
3379
 db 'Ctrl+C              - copy area                    '
-
 
3380
 db 'Ctrl+V              - past into area from buf      '
-
 
3381
 db 'Ctrl+X              - cut area into buffer         '
-
 
3382
end if
-
 
3383
help_end:
-
 
3384
 
-
 
3385
 
-
 
3386
 
-
 
3387
 
-
 
3388
;align	4096
-
 
3389
font_buffer	file 'cp866-8x16'	;ASCII+cp866	(+ð,ñ)
-
 
3390
cp1251		file 'cp1251-8x16'
-
 
3391
koi8_r		file 'koi8-r-8x16'
-
 
3392
 
-
 
3393
 
-
 
3394
;##########################	open_dial
-
 
3395
get_loops	dd 0
-
 
3396
dlg_pid_get	dd 0
-
 
3397
DLGPID	dd 0
-
 
3398
param:
-
 
3399
	dd 0	; My dec PID
-
 
3400
	dd 0,0	; Type of dialog
-
 
3401
run_fileinfo:
-
 
3402
	dd 7
-
 
3403
	dd 0
-
 
3404
	dd param
-
 
3405
	dd 0
-
 
3406
	dd 0
-
 
3407
;run_filepath
-
 
3408
	db '/sys/SYSXTREE',0
-
 
3409
readdir_fileinfo:
-
 
3410
	dd 1
-
 
3411
	dd 0
-
 
3412
	dd 0
-
 
3413
readblocks	dd	0
-
 
3414
directory_ptr	dd	0
-
 
3415
 
-
 
3416
;##########################	
-
 
3417
 
-
 
3418
 
-
 
3419
title	db	_title
-
 
3420
;---------------------------------------------------------------------
-
 
3421
OpenDialog_data:
-
 
3422
.type			dd 0
-
 
3423
.procinfo		dd procinfo	;+4
-
 
3424
.com_area_name		dd communication_area_name	;+8
-
 
3425
.com_area		dd 0	;+12
-
 
3426
.opendir_pach		dd temp_dir_pach	;+16
-
 
3427
.dir_default_pach	dd communication_area_default_pach	;+20
-
 
3428
.start_path		dd open_dialog_path	;+24
-
 
3429
.draw_window		dd draw_window_1	;+28
-
 
3430
.status			dd 0	;+32
-
 
3431
.openfile_pach 		dd fname_buf	;+36
-
 
3432
 
1344
 db '  ஥ ¡ë«® à §¬¥à®¬ ä ©«  ¤® ®âªàëâ¨ï.             '
3433
communication_area_name:
1345
 db '6.à¨ ­ ¦ â¨¨ "Go" á ¯ãáâë¬ ¯®«¥¬ ¨¬¥­¨ ä ©«  ¢ë¢®-'
3434
	db 'FFFFFFFF_open_dialog',0
-
 
3435
open_dialog_path:
-
 
3436
	db '/sys/File Managers/opendial',0
1346
 db '  ¤¨âáï ¯ ¬ïâì á  ¤à¥á  0å80000, ­® à §¬¥à ä ©«    '
3437
communication_area_default_pach:
1347
 db '  à ¢¥­ 0xFFFFFFFF.                                '
3438
	db '/rd/1',0