Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 122
Line 1... Line 1...
1
;******************************************************************************
1
;-----------------------------------------------------------------------------
2
; project name:      TINYPAD
2
; project name:      TINYPAD
3
; compiler:          flat assembler 1.60
3
; compiler:          flat assembler 1.64
4
; memory to compile: 2 Mbytes +
4
; memory to compile: 3.0/11.5 MBytes (without/with size optimizations)
5
; version:           3.78a
5
; version:           4.0
6
; last update:       13/05/2005
6
; last update:       2006-04-13 (Apr 13, 2006)
-
 
7
;-----------------------------------------------------------------------------
-
 
8
; originally by:     Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi
7
; maintained by:     Ivan Poddubny, Mike Semenyako (aka mike.dld)
9
; maintained by:     Ivan Poddubny           >> ivan-yar@bk.ru
8
; e-mail:            ivan-yar@bk.ru, mike.dld@tut.by
10
;                    Mike Semenyako          >> mike.dld@gmail.com
9
;******************************************************************************
11
;-----------------------------------------------------------------------------
-
 
12
; TODO:
-
 
13
;   optimize drawing (reduce flickering);
-
 
14
;   optimize memory usage (allocate only needed amount, not static 3 Mbytes);
-
 
15
;   add block selection ability, undo action;
-
 
16
;   working with multiple files (add tabs);
-
 
17
;   other bugfixes and speed/size optimizations
-
 
18
;
10
; HISTORY:
19
; HISTORY:
-
 
20
; 4.0.2 (mike.dld)
-
 
21
;   bug-fixes:
-
 
22
;     - program terminates if started with parameters (fine for DOCPAK)
-
 
23
; 4.0.1 (mike.dld)
-
 
24
;   bug-fixes:
-
 
25
;     - unable to run program after exiting from main menu (Alt+X)
-
 
26
;   new features:
-
 
27
;     - integration with DOCPAK
-
 
28
; 4.0 (mike.dld)
-
 
29
;   bug-fixes:
-
 
30
;     - main menu popups' "on show" was called only for first shown popup
11
; 3.79 (just some ideas for further releases)
31
;     - clear selection on left/right arrow keys
-
 
32
;   new features:
-
 
33
;     - "replace" dialog (w/o "skip", "replace all")
-
 
34
;     - line numbers display
-
 
35
;     - options (except "appearance" and "smart tabulation")
-
 
36
;     - options saving (colors, window position, "Options" popup triggers)
-
 
37
; 4.0 beta 2 (mike.dld)
-
 
38
;   bug-fixes:
-
 
39
;     - unable to start if /rd/1/example.asm is missing (from Halyavin)
-
 
40
;     - clicking on menu items draws main window in popup (from Rohan)
-
 
41
;     - passed parameters aren't taken into account (from Mario79)
-
 
42
;     - background isn't erased if text lines < screen lines after
12
;   optimize drawing (reduce flickering)
43
;       selection deletion (from Rohan)
-
 
44
; 4.0 beta 1 (mike.dld)
-
 
45
;   menu bar and popup menu;
13
;   optimize memory usage (allocate only needed amount, not static 3 Mbytes)
46
;     removed buttons from the top and input fields from the bottom since
-
 
47
;     now they're accesible through main/popup menu;
14
;   improve keyboard handling (use 66th function)
48
;   improved keyboard handling (using 66th function);
-
 
49
;     support for almost all FASMW keyboard shourtcuts;
15
;   introduce real selection capabilities (including block selection)
50
;   added text selection ability, standard selection operations
-
 
51
;     (copy,cut,paste);
-
 
52
;   new integrated dialogs (open, save, find)
16
;   and of course other small speed and size optimizations ;)
53
;   fix to collapse SPACEs into TABs only for *.asm and *.inc files
17
; 3.78a (mike.dld)
54
; 3.78a (mike.dld)
18
;   fixed termination while typing in x positions higher than (line_length+10)
55
;   fixed termination while typing in x positions higher than (line_length+10);
19
;   improved drawing on small heights
56
;   improved drawing on small heights
20
;     don't draw window while its height equals 0
57
;     don't draw window while its height = 0 (Kolibri "minimize" support)
21
; 3.78 (mike.dld)
58
; 3.78 (mike.dld)
22
;   now lines may be of ANY length;
59
;   now lines may be of ANY length;
23
;     optimized memory usage (less memory for internal file representation)
60
;     optimized memory usage (less memory for internal file representation)
24
;       after loading file, it's internal size equals to its real size
61
;       after loading file, it's internal size equals to its real size
25
;       plus 14 bytes for each line (4 bytes for line length
62
;       plus 14 bytes for each line (4 bytes for line length
26
;         and 10 spaced to the end - to reduce data relocations)
63
;         and 10 spaced to the end - to reduce data relocations count);
27
;     completely rewritten keyboard handling;
64
;     completely rewritten keyboard handling;
28
;     added horizontal scrollbar;
65
;     added horizontal scrollbar;
29
;   all line feed formats are supported: WIN(CRLF),*NIX(LF),MAC(CR);
66
;   all line feed formats are supported: WIN(CRLF),*NIX(LF),MAC(CR);
30
;   etc.
67
;   etc.
31
; 3.77 (mike.dld)
68
; 3.77 (mike.dld)
Line 41... Line 78...
41
;   changed TAB,ENTER,DELETE,BSPACE keys behaviour (rewritten from scratch);
78
;   changed TAB,ENTER,DELETE,BSPACE keys behaviour (rewritten from scratch);
42
;   vertical scrollbar;
79
;   vertical scrollbar;
43
;   extra window resizing capabilities (added a couple of constants);
80
;   extra window resizing capabilities (added a couple of constants);
44
;   completely new text cursor management & moving text cursor with mouse;
81
;   completely new text cursor management & moving text cursor with mouse;
45
;   improved search function, moving cursor to beginning of text found;
82
;   improved search function, moving cursor to beginning of text found;
46
;   adjustable max line width (change LINE_WIDTH & recompile) // (obsolete)
83
;   adjustable max line width (change LINE_WIDTH & recompile) // (obsolet)
47
; 3.75a
84
; 3.75a
48
;   fixed converting char to upper case in read_string
85
;   fixed converting char to upper case in read_string
49
; 3.75
86
; 3.75
50
;   rewrote save_file from scratch; bugfix in loadfile;
87
;   rewrote save_file from scratch; bugfix in loadfile;
51
; 3.74
88
; 3.74
Line 61... Line 98...
61
;   simple toolbar
98
;   simple toolbar
62
;   compile, run applications from TINYPAD, all fasm output is in debug board
99
;   compile, run applications from TINYPAD, all fasm output is in debug board
63
;   TAB button
100
;   TAB button
64
;   auto-indent
101
;   auto-indent
65
;   Ctrl+L - insert comment string
102
;   Ctrl+L - insert comment string
66
;******************************************************************************
103
;-----------------------------------------------------------------------------
67
; Memory 0x300000:
104
; Memory 0x300000:
68
;   stack            0x00eff0 -  áâíª
105
;   stack for popup  0x00dff0 -
69
;   stack for help   0x00fff0 -
106
;   stack for help   0x00eff0 -
70
;   load position    0x010000 +   ¤à¥á § £à㧪¨ ä ©« 
107
;   stack            0x00fff0 -
71
;   screen comp      0x078000 +  ᮤ¥à¦¨¬®¥ íªà ­  (obsolete)
108
;   load position    0x010000 +
72
;   edit area        0x080000 +  ¤®ªã¬¥­â
109
;   edit area        0x080000 +
73
;   copy/paste area  0x2f0000 +  ®¡« áâì ¤«ï ª®¯¨à®¢ ­¨ï/¢áâ ¢ª¨
110
;   copy/paste area  0x2f0000 +
74
;******************************************************************************
111
;-----------------------------------------------------------------------------
Line 75... Line -...
75
 
-
 
76
include 'lang.inc'
112
 
-
 
113
include 'macros.inc' ; useful stuff
77
include 'macros.inc' ; useful stuff
114
include 'tinypad.inc'
-
 
115
purge mov,add,sub            ;  SPEED
-
 
116
 
Line 78... Line 117...
78
purge mov	     ;  SPEED
117
header '01',1,@CODE,TINYPAD_END,AREA_ENDMEM,MAIN_STACK,@PARAMS,self_path
79
 
-
 
80
macro mov op1,op2 {
-
 
81
 if (op1 in __regs) & (op2 eq -1)
-
 
82
  or  op1,-1
-
 
83
 else
-
 
84
  mov op1,op2
-
 
Line -... Line 118...
-
 
118
 
-
 
119
;include 'debug.inc'
-
 
120
 
85
 end if
121
ASEPC     = '-'           ; separator character (char)
-
 
122
ATOPH     = POP_IHEIGHT+2 ; menu bar height (pixels)
-
 
123
;OLEFT    = 50+1          ; left offset (pixels)        !!! don't change !!!
-
 
124
SCRLW     = 16            ; scrollbar widht/height (pixels)
-
 
125
ATABW     = 8             ; tab width (chars)
-
 
126
LINEH     = 10            ; line height (pixels)
-
 
127
PATHL     = 255           ; maximum path length (chars) !!! don't change !!!
-
 
128
AMINS     = 8             ; minimal scroll thumb size (pixels)
-
 
129
 
-
 
130
STATH     = 14            ; status bar height
-
 
131
 
-
 
132
MEV_LDOWN = 1
-
 
133
MEV_LUP   = 2
Line 86... Line -...
86
}
-
 
87
 
134
MEV_RDOWN = 3
88
 header '01',1,@CODE,TINYPAD_END,0x300000,0xeff0,@PARAMS,0
135
MEV_RUP   = 4
89
 
-
 
90
ASEPC = '-'
-
 
91
RBTNW = rstr.size*6/3
-
 
92
LBTNW = lstr.size*6/2
-
 
93
ABTNH = 16
-
 
94
ATOPH = 24
-
 
-
 
136
MEV_MOVE  = 5
Line -... Line 137...
-
 
137
 
-
 
138
;-----------------------------------------------------------------------------
-
 
139
section @OPTIONS ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
 
140
;-----------------------------------------------------------------------------
-
 
141
 
-
 
142
label color_tbl dword
-
 
143
  RGB(  0,  0,  0) ; RGB(  0,  0,  0) ; RGB(  0,  0,  0) ; text
-
 
144
  RGB(  0,144,  0) ; RGB(  0,144,  0) ; RGB(  0,160,  0) ; numbers
-
 
145
  RGB(176,  0,  0) ; RGB(160,  0,  0) ; RGB(  0,128,255) ; strings
-
 
146
  RGB(128,128,128) ; RGB(144,144,144) ; RGB(160,160,160) ; comments
-
 
147
  RGB( 48, 48,240) ; RGB( 48, 48,240) ; RGB(255,  0,  0) ; symbols
-
 
148
  RGB(255,255,255) ; RGB(224,224,224) ; RGB(255,255,255) ; background
-
 
149
  RGB(255,255,255) ; RGB(255,255,255) ; RGB(255,255,255) ; selection text
-
 
150
  RGB( 10, 36,106) ; RGB(  0,  0,128) ; RGB(  0, 64,128) ; selection background
-
 
151
 
-
 
152
ins_mode db 1
95
OLEFT = 5+1
153
 
-
 
154
options  db OPTS_AUTOINDENT+OPTS_OPTIMSAVE+OPTS_SMARTTAB
-
 
155
 
Line 96... Line 156...
96
SCRLW = 16
156
mainwnd_pos:
97
ATABW = 8
157
  .x dd 100
98
PATHL = 260
158
  .y dd 75
Line 99... Line -...
99
 
-
 
100
AMINS = 8
159
  .w dd 6*80+6+SCRLW+5
Line 101... Line 160...
101
 
160
  .h dd 402
-
 
161
 
-
 
162
;-----------------------------------------------------------------------------
-
 
163
section @CODE ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
 
164
;-----------------------------------------------------------------------------
-
 
165
 
-
 
166
;       fninit
-
 
167
 
-
 
168
        cld
-
 
169
        mov     edi,@UDATA
-
 
170
        mov     ecx,@PARAMS-@UDATA
-
 
171
        mov     al,0
-
 
172
        rep     stosb
-
 
173
 
-
 
174
        mov     [left_ofs],40+1
-
 
175
        mov     [f_info+4],0
102
;-----------------------------------------------------------------------------
176
        mov     [f_info+12],AREA_TEMP
103
section @CODE ;///////////////////////////////////////////////////////////////
177
        mov     [f_info+16],AREA_EDIT-AREA_TEMP
104
;-----------------------------------------------------------------------------
178
 
105
 
179
;        mov     esi,s_example
106
;******************************************************************************
180
;        mov     edi,s_fname
-
 
181
;        mov     ecx,s_example.size
107
; INITIALIZING
182
;        mov     [s_fname.size],ecx
108
 
183
;        rep     movsb
109
	cld
184
        mov     esi,s_example
110
	mov	esi,s_example
185
        mov     edi,tb_opensave.text
111
	mov	edi,s_fname
186
        mov     ecx,s_example.size
-
 
187
        mov     [tb_opensave.length],cl
112
	mov	ecx,s_example.size
188
        rep     movsb
113
	mov	[s_fname.size],ecx
189
 
Line -... Line 190...
-
 
190
        mov     esi,s_still
-
 
191
        mov     edi,s_search
-
 
192
        mov     ecx,s_still.size
-
 
193
        mov     [s_search.size],ecx
-
 
194
        rep     movsb
-
 
195
 
-
 
196
        cmp     byte[@PARAMS],0
-
 
197
        jz      no_params
-
 
198
 
-
 
199
;// Willow's code to support DOCPAK [
-
 
200
 
-
 
201
        cmp     byte[@PARAMS],'*'
-
 
202
        jne     .noipc
-
 
203
; convert size from decimal representation to dword
-
 
204
        mov     esi, @PARAMS+1
-
 
205
        xor     edx, edx
-
 
206
        xor     eax, eax
-
 
207
@@:
-
 
208
        lodsb
-
 
209
        test    al, al
-
 
210
        jz      @f
-
 
211
        lea     edx, [edx*4+edx]
-
 
212
        lea     edx, [edx*2+eax]
-
 
213
        jmp     @b
-
 
214
@@:
-
 
215
        add     edx,20
-
 
216
        mcall   60,1,AREA_TEMP-16 ; 0x10000-16
-
 
217
        mov     dword[AREA_TEMP-16+4],8 ; [0x10000-16+4],8
-
 
218
        mcall   40,1000000b
-
 
219
        mcall   23,200
-
 
220
        cmp     eax,7
-
 
221
        jne     key.alt_x.close  ; ýòî íà mcall -1 ìåòêà
-
 
222
        mov     esi,AREA_TEMP-16 ; 0x10000-16
-
 
223
        mov     byte[esi],1
-
 
224
        mov     eax,[esi+12]
114
	rep	movsb
225
        inc     eax
115
	mov	esi,s_still
226
        call    load_file.file_found
116
	mov	edi,s_search
227
        jmp     @f
117
	mov	ecx,s_still.size
228
;       call    file_found  ; çàãðóçêà ôàéëà
118
	mov	[s_search.size],ecx
229
;       jmp     do_load_file.restorecursor ; îòîáðàæåíèå
119
	rep	movsb
230
  .noipc:
120
	cmp	byte[@PARAMS],0
231
 
121
	jz	no_params
232
;// Willow's code to support DOCPAK ]
122
 
233
 
-
 
234
    ; parameters are at @PARAMS
123
    ; parameters are at @PARAMS
235
        mov     esi,@PARAMS
124
	mov	esi,@PARAMS
236
        mov     edi,tb_opensave.text
Line 125... Line 237...
125
	mov	edi,s_fname
237
        mov     ecx,PATHL
-
 
238
        rep     movsb
-
 
239
        mov     edi,tb_opensave.text
-
 
240
        mov     ecx,PATHL
-
 
241
        xor     al,al
-
 
242
        repne   scasb
-
 
243
        jne     key.alt_x.close
-
 
244
        lea     eax,[edi-tb_opensave.text-1]
126
	mov	ecx,PATHL
245
        mov     [tb_opensave.length],al
127
	rep	movsb
-
 
Line 128... Line 246...
128
	mov	edi,s_fname
246
 
129
	mov	ecx,PATHL
247
  no_params:
130
	xor	al,al
248
        call    btn.load_file;do_load_file
131
	repne	scasb
249
        jnc     @f
Line 132... Line 250...
132
	sub	edi,s_fname+1
250
        call    new_file
133
	mov	[s_fname.size],edi
251
 
-
 
252
    @@:
-
 
253
        call    drawwindow
134
 
254
        mcall   66,1,1
135
  no_params:
255
        mcall   40,00100111b
136
	mcall	40,00100111b
256
 
137
	jmp	do_load_file
257
;-----------------------------------------------------------------------------
138
 
258
 
139
;******************************************************************************
259
still:
140
; MAIN LOOP
260
       call    writepos ; write current position & number of strings
141
still:
261
 
Line 142... Line -...
142
	call	writepos ; write current position & number of strings
-
 
143
 
-
 
144
  .skip_write:
262
  .skip_write:
145
	mcall	10;23,50; wait here until event
-
 
146
	dec	eax	; redraw ?
-
 
147
	jz	red
-
 
148
	dec	eax	; key ?
-
 
149
	jz	key
-
 
150
	dec	eax	; button ?
-
 
151
	jz	button
-
 
152
	sub	eax,3	; mouse ?
-
 
153
	jz	mouse
-
 
154
 
-
 
155
	;d
-
 
156
 
-
 
157
	jmp	still.skip_write
-
 
158
;******************************************************************************
-
 
159
 
-
 
160
  mouse:
-
 
161
	mcall	9,p_info,-1
-
 
162
	cmp	ax,[p_info.window_stack_position]
-
 
163
	jne	still
-
 
164
 
-
 
165
	mcall	37,2
-
 
166
	test	al,1
-
 
167
	jz	.capture_off
-
 
168
 
-
 
169
	mcall	37,1
-
 
170
	mov	ebx,eax
-
 
171
	and	ebx,0x0000FFFF
-
 
172
	shr	eax,16
-
 
173
 
-
 
174
	mov	ecx,[top_ofs]
-
 
175
	inc	ecx
-
 
176
	pushd	OLEFT ecx [p_info.x_size] ecx
-
 
177
	popd	[__rc+0xC] [__rc+0x8] [__rc+0x4] [__rc+0x0]
-
 
178
	sub	[__rc+0x8],SCRLW+5+3
-
 
179
	imul	ecx,[slines],10
-
 
180
	dec	ecx
-
 
181
	add	[__rc+0xC],ecx
-
 
182
	mov	ecx,__rc
-
 
183
	call	pt_in_rect
-
 
184
	jnc	.check_vscroll
-
 
185
	sub	eax,OLEFT
-
 
186
	sub	ebx,[__rc+0x4]
-
 
187
	push	eax
-
 
188
	mov	eax,ebx
-
 
189
	xor	edx,edx
-
 
190
	mov	ecx,10
-
 
191
	div	ecx
-
 
192
    @@: add	eax,[top_line]
-
 
193
	mov	ebx,eax
-
 
194
	pop	eax
-
 
195
	xor	edx,edx
-
 
196
	mov	ecx,6
-
 
197
	div	ecx
-
 
198
    @@: add	eax,[left_col]
-
 
199
 
-
 
200
	cmp	eax,[columns]
-
 
201
	jb	@f
-
 
202
	mov	eax,[columns]
-
 
203
    @@: cmp	ebx,[lines]
-
 
204
	jb	@f
-
 
205
	mov	ebx,[lines]
-
 
206
	dec	ebx
-
 
207
    @@:
-
 
208
	cmp	[posx],eax
-
 
209
	jne	.change_cur_pos
-
 
210
	cmp	[posy],ebx
-
 
211
	je	still.skip_write
-
 
212
 
-
 
213
  .change_cur_pos:
-
 
214
	mov	[posx],eax
-
 
215
	mov	eax,[posy]
-
 
216
	pushd	ebx
-
 
217
	popd	[posy]
-
 
218
	cmp	eax,ebx
-
 
219
	je	@f
-
 
220
	push	ebx
-
 
221
	mov	ebx,eax
-
 
222
	call	drawfile.ex
-
 
223
	pop	eax
-
 
224
    @@: mov	ebx,eax
-
 
225
	call	drawfile.ex
-
 
226
	jmp	still
-
 
227
 
-
 
228
  .check_vscroll:
-
 
229
	mov	ecx,[p_info.x_size]
-
 
230
	sub	ecx,SCRLW+5-2
-
 
231
	pushd	ecx [top_ofs] ecx [bot_ofs]
-
 
232
	popd	[__rc+0xC] [__rc+0x8] [__rc+0x4] [__rc+0x0]
-
 
233
	add	[__rc+0x8],SCRLW-2
-
 
234
	add	[__rc+0x4],SCRLW+1
-
 
235
	sub	[__rc+0xC],SCRLW*2+3
-
 
236
	mov	ecx,__rc
-
 
237
	call	pt_in_rect
-
 
238
	jnc	.check_hscroll
-
 
239
 
-
 
240
	sub	ebx,[__rc+0x4]
-
 
241
	cmp	[vscrl_capt],0
-
 
242
	jge	.vcaptured
-
 
243
	mov	eax,[vscrl_top]
-
 
244
	cmp	ebx,eax
-
 
245
	jb	.center_vcapture
-
 
246
	add	eax,[vscrl_size]
-
 
247
	cmp	ebx,eax
-
 
248
	jae	.center_vcapture
-
 
249
	mov	eax,ebx
-
 
250
	sub	eax,[vscrl_top]
-
 
251
	dec	eax
-
 
252
	mov	[vscrl_capt],eax
-
 
253
	dec	ebx
-
 
254
	jmp	.vcaptured
-
 
255
  .center_vcapture:
-
 
256
	mov	eax,[vscrl_size]
-
 
257
	shr	eax,1
-
 
258
	mov	[vscrl_capt],eax
-
 
259
  .vcaptured:
-
 
260
	sub	ebx,[vscrl_capt]
-
 
261
	jns	@f
-
 
262
	xor	ebx,ebx
-
 
263
    @@:
-
 
264
	mov	[vscrl_top],ebx
-
 
265
	mov	eax,[lines]
-
 
266
	sub	eax,[slines]
-
 
267
	mul	ebx
-
 
268
	mov	ebx,[bot_ofs]
-
 
269
	sub	ebx,[top_ofs]
-
 
270
	sub	ebx,SCRLW*3+2+2 	;**
-
 
271
	sub	ebx,[vscrl_size]
-
 
272
	div	ebx
-
 
273
	cmp	eax,[top_line]
-
 
274
	je	still.skip_write
-
 
275
	mov	[top_line],eax
-
 
276
	call	check_bottom_right
-
 
277
	call	drawfile
-
 
278
	jmp	still.skip_write
-
 
279
 
-
 
280
  .check_hscroll:
-
 
281
	pushd	(OLEFT+SCRLW+1) [bot_ofs] [p_info.x_size] [bot_ofs]
-
 
282
	popd	[__rc+0xC] [__rc+0x8] [__rc+0x4] [__rc+0x0]
-
 
283
	add	[__rc+0x8],-SCRLW*2-10-1
-
 
284
	add	[__rc+0x4],-SCRLW
-
 
285
	add	[__rc+0xC],-2
-
 
286
	mov	ecx,__rc
-
 
287
	call	pt_in_rect
-
 
288
	jnc	.capture_off
-
 
289
 
-
 
290
	mov	ebx,eax
-
 
291
	sub	ebx,[__rc+0x0]
-
 
292
	cmp	[hscrl_capt],0
-
 
293
	jge	.hcaptured
-
 
294
	mov	eax,[hscrl_top]
-
 
295
	cmp	ebx,eax
-
 
296
	jb	.center_hcapture
-
 
297
	add	eax,[hscrl_size]
-
 
298
	cmp	ebx,eax
-
 
299
	jae	.center_hcapture
-
 
300
	mov	eax,ebx
-
 
301
	sub	eax,[hscrl_top]
-
 
302
	dec	eax
-
 
303
	mov	[hscrl_capt],eax
-
 
304
	dec	ebx
-
 
305
	jmp	.hcaptured
-
 
306
  .center_hcapture:
-
 
307
	mov	eax,[hscrl_size]
-
 
308
	shr	eax,1
-
 
309
	mov	[hscrl_capt],eax
-
 
310
  .hcaptured:
-
 
311
	sub	ebx,[hscrl_capt]
-
 
312
	jns	@f
-
 
313
	xor	ebx,ebx
-
 
314
    @@:
-
 
315
	mov	[hscrl_top],ebx
-
 
316
	mov	eax,[columns]
-
 
317
	sub	eax,[scolumns]
-
 
318
	mul	ebx
-
 
319
	mov	ebx,[p_info.x_size]
-
 
320
	sub	ebx,SCRLW*3+10+2	;**
-
 
321
	sub	ebx,[hscrl_size]
-
 
322
	div	ebx
-
 
323
	cmp	eax,[left_col]
-
 
324
	je	still.skip_write
-
 
325
	mov	[left_col],eax
-
 
326
	call	check_bottom_right
-
 
327
	call	drawfile
-
 
328
	jmp	still.skip_write
-
 
329
 
-
 
330
  .capture_off:
-
 
331
	or	[vscrl_capt],-1
-
 
332
	or	[hscrl_capt],-1
-
 
333
	jmp	still.skip_write
-
 
334
 
-
 
335
func pt_in_rect
-
 
336
	cmp	eax,[ecx+0x0]
-
 
337
	jl	@f
-
 
338
	cmp	ebx,[ecx+0x4]
-
 
339
	jl	@f
-
 
340
	cmp	eax,[ecx+0x8]
-
 
341
	jg	@f
-
 
342
	cmp	ebx,[ecx+0xC]
-
 
343
	jg	@f
-
 
344
	stc
-
 
345
	ret
-
 
346
    @@: clc
-
 
347
	ret
-
 
348
endf
-
 
349
 
-
 
350
func check_bottom_right
-
 
351
	push	eax
-
 
352
	mov	eax,[top_line]
-
 
353
	add	eax,[slines]
-
 
354
	cmp	eax,[lines]
-
 
355
	jbe	.lp1
-
 
356
	mov	eax,[lines]
-
 
357
	sub	eax,[slines]
-
 
358
	jns	@f
-
 
359
	xor	eax,eax
-
 
360
    @@: mov	[top_line],eax
-
 
361
  .lp1: mov	eax,[left_col]
-
 
362
	add	eax,[scolumns]
-
 
363
	cmp	eax,[columns]
-
 
364
	jbe	.exit
-
 
365
	mov	eax,[columns]
-
 
366
	sub	eax,[scolumns]
-
 
367
	jns	@f
-
 
368
	xor	eax,eax
-
 
369
    @@: mov	[left_col],eax
-
 
370
  .exit:
-
 
371
	pop	eax
-
 
372
	ret
-
 
373
endf
-
 
374
 
-
 
375
; *********************************
-
 
376
; *         BUTTON HANDLER        *
-
 
377
; *********************************
-
 
378
 
-
 
379
  button:
-
 
380
 
-
 
381
	mcall	17
-
 
382
	shr	eax,8
-
 
383
 
-
 
384
	cmp	eax,'UP'
-
 
385
	jne	not_up
-
 
386
	dec	[top_line]
-
 
387
	jns	check_inv_all.skip_check
-
 
388
	mov	[top_line],0
-
 
389
	jmp	still.skip_write
-
 
390
  not_up:
-
 
391
 
-
 
392
	cmp	eax,'DN'
-
 
393
	jne	not_down
-
 
394
	inc	[top_line]
-
 
395
	mov	eax,[lines]
-
 
396
	sub	eax,[slines]
-
 
397
	cmp	eax,[top_line]
-
 
398
	jae	check_inv_all.skip_check
-
 
399
	dec	eax
-
 
400
	mov	[top_line],eax
-
 
401
	jmp	still.skip_write
-
 
402
  not_down:
-
 
403
 
-
 
404
	cmp	eax,'LT'
-
 
405
	jne	not_left
-
 
406
	dec	[left_col]
-
 
407
	jns	check_inv_all.skip_check
-
 
408
	mov	[left_col],0
-
 
409
	jmp	still.skip_write
-
 
410
  not_left:
-
 
411
 
-
 
412
	cmp	eax,'RT'
-
 
413
	jne	not_right
-
 
414
	inc	[left_col]
-
 
415
	mov	eax,[columns]
-
 
416
	sub	eax,[scolumns]
-
 
417
	cmp	eax,[left_col]
-
 
418
	jae	check_inv_all.skip_check
-
 
419
	dec	eax
-
 
420
	mov	[left_col],eax
-
 
421
	jmp	still.skip_write
-
 
422
  not_right:
-
 
423
 
-
 
424
; SEARCH {
-
 
425
  search:
-
 
426
	cmp	al,50
-
 
427
	jne	no_search
-
 
428
 
-
 
429
  .skip_check:
-
 
430
 
-
 
431
	cld
-
 
432
	mov	ecx,[posy]
-
 
433
	mov	edx,ecx
-
 
434
	call	get_line_offset
-
 
435
	cmp	dword[esi],0
-
 
436
	je	still
-
 
437
	call	get_real_length
-
 
438
	add	esi,4
-
 
439
	or	eax,eax
-
 
440
	jz	.end_line.2
-
 
441
	mov	ecx,eax
-
 
442
	sub	ecx,[posx]
-
 
443
	push	esi
-
 
444
	add	esi,[posx]
-
 
445
	dec	ecx
-
 
446
	inc	esi
-
 
447
	jmp	@f
-
 
448
 
-
 
449
  .next_line:
-
 
450
	push	esi
-
 
451
    @@:
-
 
452
	sub	ecx,[s_search.size]
-
 
453
	inc	ecx
-
 
454
 
-
 
455
  .next_char:
-
 
456
	dec	ecx
-
 
457
	js	.end_line
-
 
458
	xor	edi,edi
-
 
459
 
-
 
460
  .next_ok:
-
 
461
	movzx	eax,byte[edi+esi]
-
 
462
	movzx	ebx,byte[edi+s_search]
-
 
463
 
-
 
464
	cmp	al,$61
-
 
465
	jb	@f
-
 
466
	add	al,[eax+add_table-$61]
-
 
467
    @@: cmp	bl,$61
-
 
468
	jb	@f
-
 
469
	add	bl,[ebx+add_table-$61]
-
 
470
    @@:
-
 
471
 
-
 
472
	cmp	al,bl
-
 
473
	je	@f
-
 
474
 
-
 
475
	inc	esi
-
 
476
	jmp	.next_char
-
 
477
    @@:
-
 
478
	inc	edi
-
 
479
	cmp	edi,[s_search.size]
-
 
480
	jne	.next_ok
-
 
481
 
-
 
482
  .found:
-
 
483
	add	esp,4
-
 
484
	mov	[posy],edx
-
 
485
	mov	ecx,edx
-
 
486
	lea	eax,[esi-4]
-
 
487
	call	get_line_offset
-
 
488
	sub	eax,esi
-
 
489
	mov	[posx],eax
-
 
490
	jmp	check_inv_all
-
 
491
 
-
 
492
  .end_line:
-
 
493
	pop	esi
-
 
494
  .end_line.2:
-
 
495
	add	esi,[esi-4]
-
 
496
	inc	edx
-
 
497
	call	get_real_length
-
 
498
	mov	ecx,eax
-
 
499
	lodsd
-
 
500
	or	eax,eax
-
 
501
	jnz	.next_line
-
 
502
	jmp	still
-
 
503
 
-
 
504
; SEARCH }
-
 
505
 
-
 
506
  no_search:
-
 
507
 
-
 
508
; TOOLBAR {
-
 
509
	cmp	eax,10000
-
 
510
	jb	no_toolbar
-
 
511
 
-
 
512
	add	eax,-10000
-
 
513
	jnz	@f
-
 
514
	mov	bl,0;[run_outfile],0
-
 
515
	call	start_fasm
-
 
516
	jmp	still
-
 
517
    @@: dec	eax
-
 
518
	jnz	@f
-
 
519
	mov	bl,1;[run_outfile],1
-
 
520
	call	start_fasm
-
 
521
	jmp	still
-
 
522
    @@: dec	eax
-
 
523
	jnz	@f
-
 
524
	call	open_debug_board
-
 
525
	jmp	still
-
 
526
    @@: dec	eax
-
 
527
	jnz	still
-
 
528
	call	open_sysfuncs_txt
-
 
529
	jmp	still
-
 
530
; TOOLBAR }
-
 
531
 
-
 
532
  no_toolbar:
-
 
533
 
-
 
534
	cmp	al,4
-
 
535
	jne	noid4
-
 
536
 
-
 
537
; LOAD_FILE {
-
 
538
  do_load_file:
-
 
539
	cmp	[s_fname],'/'
-
 
540
	jne	@f
-
 
541
	call	loadhdfile
-
 
542
	jmp	.restorecursor
-
 
543
    @@: call	loadfile
-
 
544
 
-
 
545
    .restorecursor:
-
 
546
	xor	eax,eax
-
 
547
	mov	[top_line],eax
-
 
548
	mov	[posx],eax
-
 
549
	mov	[posy],eax
-
 
550
 
-
 
551
; enable color syntax for ASM and INC files:
-
 
552
	mov	[asm_mode],al
-
 
553
 
-
 
554
	mov	eax,[s_fname.size]
-
 
555
	add	eax,s_fname
-
 
556
	mov	byte[eax],0
-
 
557
	cmp	dword[eax-3],'ASM'
-
 
558
	jne	@f
-
 
559
	inc	[asm_mode]
-
 
560
	jmp	.nocol
-
 
561
    @@: cmp	dword[eax-3],'INC'
-
 
562
	jne	.nocol
-
 
563
	inc	[asm_mode]
-
 
564
    .nocol:
-
 
565
 
-
 
566
; if the header is the same as previous,
-
 
567
; just redraw the text area
-
 
568
; else redraw the window
-
 
569
 
-
 
570
	mov	ecx, [s_fname.size]
-
 
571
	add	ecx, 10 	    ; strlen(" - TINYPAD");
-
 
572
	cmp	ecx, [s_title.size]
-
 
573
	jne	@f
-
 
574
	add	ecx, -10
-
 
575
	mov	esi, s_fname	   ; strcmp(s_fname,header);
-
 
576
	mov	edi, s_title
-
 
577
	rep	cmpsb
-
 
578
	jne	@f
-
 
579
	call	drawfile
-
 
580
	jmp	still
-
 
581
    @@:
-
 
582
 
-
 
583
; set window title:
-
 
584
	mov	esi,s_fname
-
 
585
	mov	edi,s_title
-
 
586
	mov	ecx,[s_fname.size]
-
 
587
	lea	eax,[ecx+10]
-
 
588
	mov	[s_title.size],eax
-
 
589
	cld
-
 
590
	rep	movsb
-
 
591
 
-
 
592
	mov	dword[edi],' - '
-
 
593
	add	edi,3
-
 
594
	mov	esi,htext
-
 
595
	mov	ecx,htext.size
-
 
596
	rep	movsb
-
 
597
 
-
 
598
	call	drawwindow
-
 
599
	jmp	still
-
 
600
; LOAD_FILE }
-
 
601
 
-
 
602
  noid4:
-
 
603
 
-
 
604
	cmp	al, 2
-
 
605
	jz	yessave
-
 
606
 
-
 
607
	dec	al	 ; close if butid == 1
-
 
608
	jnz	nosave
-
 
609
; EXIT:
-
 
610
	mov	[main_closed],1
-
 
611
	mcall	-1
-
 
612
 
-
 
613
; SAVE_FILE {
-
 
Line -... Line 263...
-
 
263
        mcall   10;23,50; wait here until event
614
  yessave:
264
        cmp     [main_closed],0
615
	call	save_file
265
        jne     key.alt_x
616
	jmp	still
266
        dec     eax     ; redraw ?
617
; SAVE_FILE }
-
 
618
 
-
 
619
  nosave:
-
 
620
	inc	al
-
 
621
	call	read_string
-
 
622
	jmp	still
-
 
623
 
-
 
624
;**********************************
-
 
625
;*         REDRAW HANDLER         *
-
 
626
;**********************************
-
 
627
 
-
 
628
func red
-
 
629
; ¯¥à¥à¨á®¢ª  ®ª­ 
-
 
630
	call	drawwindow
-
 
631
	jmp	check_inv_all.skip_check
-
 
632
endf
-
 
633
 
-
 
634
;**********************************
-
 
635
;*          KEY HANDLER           *
-
 
636
;**********************************
-
 
637
 
-
 
638
key:
-
 
639
	mcall	2		; GET KEY
-
 
640
	cmp	al,1
-
 
641
	je	still
-
 
642
 
-
 
643
	shr	eax,8
-
 
644
 
-
 
645
; HELP_WND {
-
 
646
	cmp	al,0xD2;210  ; Ctrl + F1
-
 
647
	jne	no_help_text
-
 
648
 
-
 
649
	mcall	51,1,help_thread_start,0xfff0
-
 
650
	jmp	still
-
 
651
; HELP_WND }
-
 
652
 
-
 
653
  no_help_text:
-
 
654
; LOAD_FILE {
-
 
655
	cmp	al,211	     ; Ctrl + F2
-
 
656
	je	do_load_file
-
 
657
; LOAD_FILE }
-
 
658
 
-
 
659
; SEARCH {
-
 
660
	cmp	al,212	     ; Ctrl + F3
-
 
661
	je	search.skip_check
-
 
662
; SEARCH }
-
 
663
 
-
 
664
; SAVE_FILE {
-
 
665
	cmp	al,213	     ; Ctrl + F4
-
 
666
	je	yessave
-
 
667
; SAVE_FILE }
-
 
668
 
-
 
669
; ENTER_FILENAME {
-
 
670
	cmp	al,214	     ; Ctrl + F5
-
 
671
	jne	@f
-
 
672
	mov	al,5
-
 
673
	call	read_string
-
 
674
	jmp	still
-
 
675
    @@:
-
 
676
; ENTER_FILENAME }
-
 
677
 
-
 
678
; ENTER_SEARCH {
-
 
679
	cmp	al,215	     ; Ctrl + F6
-
 
680
	jne	@f
-
 
681
	mov	al,51
-
 
682
	call	read_string
-
 
683
	jmp	still
-
 
684
    @@:
-
 
685
; ENTER_SEARCH }
-
 
686
 
-
 
687
; CHANGE_LANG_LAYOUT {
-
 
688
	cmp	al,217	     ; Ctrl + F8
-
 
689
	jne	@f
-
 
690
	call	layout
-
 
691
	jmp	still
-
 
692
    @@:
-
 
693
; CHANGE_LANG_LAYOUT }
-
 
694
 
-
 
695
; 3 times english -> àãá᪨©
-
 
696
; 2 times àãá᪨© -> english
-
 
697
 
-
 
698
; COPY START {
-
 
699
	cmp	al,19
-
 
700
	jne	no_copy_start
-
 
701
	push	[posy]
-
 
702
	pop	[copy_start]
-
 
703
	jmp	still
-
 
704
; COPY START }
-
 
705
 
-
 
706
  no_copy_start:
-
 
707
 
-
 
708
; COPY END {
-
 
709
	cmp	al,5
-
 
710
	jne	no_copy_end
-
 
711
	mov	eax,[posy]
-
 
712
	cmp	eax,[copy_start]
-
 
713
	jae	@f
-
 
714
	xchg	eax,[copy_start]
-
 
715
    @@: sub	eax,[copy_start]
-
 
716
	inc	eax
-
 
717
	mov	[copy_count],eax
-
 
718
 
-
 
719
	mov	ecx,[copy_start]
-
 
720
	call	get_line_offset
-
 
721
	push	esi
-
 
722
	mov	ecx,eax
-
 
723
    @@: lodsd
-
 
724
	add	esi,eax
-
 
725
	loop	@b
-
 
726
	mov	ecx,esi
-
 
727
	pop	esi
-
 
728
	sub	ecx,esi
-
 
729
	mov	[copy_size],ecx
-
 
730
 
-
 
731
	mov	edi,0x2f0000
-
 
732
	cld
-
 
733
	rep	movsb
-
 
734
	jmp	still
-
 
735
; COPY END }
-
 
736
 
-
 
737
  no_copy_end:
-
 
738
 
-
 
739
; PASTE {
-
 
740
	cmp	al,16
-
 
741
	jne	no_copy_paste
-
 
742
	mov	ebx,[copy_count]
-
 
743
	or	ebx,ebx
-
 
744
	jz	still
-
 
745
	add	[lines],ebx
-
 
746
 
-
 
747
	mov	ecx,[posy]
-
 
748
	call	get_line_offset
-
 
749
	mov	ebx,esi
-
 
750
	mov	edi,0x2E0000
-
 
751
	mov	esi,edi
-
 
752
	mov	ecx,[copy_size]
-
 
753
	sub	esi,ecx
-
 
754
	lea	ecx,[esi+4]
-
 
755
	sub	ecx,ebx
-
 
756
	std
-
 
757
	rep	movsb
-
 
758
	mov	edi,ebx
-
 
759
	mov	esi,0x2F0000
-
 
760
	mov	ecx,[copy_size]
-
 
761
	cld
-
 
762
	rep	movsb
-
 
763
 
-
 
764
	jmp	check_inv_all
-
 
765
; PASTE }
-
 
766
 
-
 
767
  no_copy_paste:
-
 
768
 
-
 
769
; INSERT_SEPARATOR {
-
 
770
	cmp	al,0x0C       ; Ctrl+L
-
 
771
	jne	no_insert_separator
-
 
772
 
-
 
773
	mov	ecx,[posy]
-
 
774
	call	get_line_offset
-
 
775
	mov	ebx,esi
-
 
776
 
-
 
777
	mov	ecx,[lines]
-
 
778
	call	get_line_offset
-
 
779
	lea	edi,[esi+90+4]
-
 
780
	lea	ecx,[esi+4]
-
 
781
	sub	ecx,ebx
-
 
782
	std
-
 
783
	rep	movsb
-
 
784
 
-
 
785
	lea	edi,[ebx+5]
-
 
786
	mov	dword[ebx],90
-
 
787
	mov	al,ASEPC
-
 
788
	mov	ecx,79
-
 
789
	cld
-
 
790
	rep	stosb
-
 
791
	mov	al,' '
-
 
792
	mov	ecx,10
-
 
793
	rep	stosb
-
 
794
	mov	byte[ebx+4],';'
-
 
795
 
-
 
796
	inc	[lines]
-
 
797
	inc	[posy]
-
 
798
 
-
 
799
	jmp	check_inv_all
-
 
800
; INSERT_SEPARATOR }
-
 
801
 
-
 
802
  no_insert_separator:
-
 
803
 
-
 
804
; DEL_LINE {
-
 
805
	cmp	al,4
-
 
806
	jne	no_delete_line
-
 
807
 
-
 
808
	mov	eax,[posy]
-
 
809
	inc	eax
-
 
810
	cmp	eax,[lines]
-
 
811
	jge	still
-
 
812
 
-
 
813
	mov	ecx,[posy]
-
 
814
	call	get_line_offset
-
 
815
	mov	edi,esi
-
 
816
	lodsd
-
 
817
	add	esi,eax
-
 
818
 
-
 
819
	dec	[lines]
-
 
820
	mov	ecx,0x2e0000
-
 
821
	sub	ecx,esi
-
 
822
	shr	ecx,2		       ;// fixed (was 4)
-
 
823
	cld
-
 
824
	rep	movsd
-
 
825
	jmp	check_inv_all
-
 
826
; DEL_LINE }
-
 
827
 
-
 
828
  no_delete_line:
-
 
829
 
-
 
830
; ENTER {
-
 
831
	cmp	al,13
-
 
832
	jnz	noenter
-
 
833
 
-
 
834
	mov	ecx,[posy]
-
 
835
	call	get_line_offset
-
 
836
 
-
 
837
	mov	ebx,[posx]
-
 
838
	cmp	ebx,[esi]
-
 
839
	jb	@f
-
 
840
	mov	ebx,[esi]
-
 
841
	dec	ebx
-
 
842
	jns	@f
-
 
843
	xor	ebx,ebx
-
 
844
    @@:
-
 
845
 
-
 
846
	cld
-
 
847
 
-
 
848
	mov	edi,0x10000
-
 
849
	mov	ebp,esi
-
 
850
	mov	ecx,ebx
-
 
851
	inc	ecx
-
 
852
    @@: dec	ecx
-
 
853
	jz	@f
-
 
854
	cmp	byte[esi+ecx+4-1],' '
-
 
855
	je	@b
-
 
856
    @@: lea	eax,[ecx+10]
-
 
857
	stosd
-
 
858
	jecxz	@f
-
 
859
	push	esi
-
 
860
	add	esi,4
-
 
861
	rep	movsb
-
 
862
	pop	esi
-
 
863
    @@: mov	al,' '
-
 
864
	mov	ecx,10
-
 
865
	rep	stosb
-
 
866
 
-
 
867
	mov	ecx,[esi]
-
 
868
	sub	ecx,ebx;[posx]
-
 
869
	add	esi,ebx;[posx]
-
 
870
	add	esi,4
-
 
871
	inc	ecx
-
 
872
    @@: dec	ecx
-
 
873
	jz	@f
-
 
874
	cmp	byte[esi+ecx-1],' '
-
 
875
	je	@b
-
 
876
    @@: jz	.lp1
-
 
877
    @@: cmp	byte[esi],' '
-
 
878
	jne	.lp1
-
 
879
	inc	esi
-
 
880
	loop	@b
-
 
881
  .lp1: push	edi ecx
-
 
882
	mov	ecx,[ebp]
-
 
883
	lea	edi,[ebp+4]
-
 
884
	mov	al,' '
-
 
885
	repe	scasb
-
 
886
	mov	eax,ecx
-
 
887
	pop	ecx edi
-
 
888
	je	.lp2
-
 
889
	neg	eax
-
 
890
	add	eax,[ebp]
-
 
891
	dec	eax
-
 
892
	jmp	@f
-
 
893
  .lp2: xor	eax,eax
-
 
894
    @@: mov	edx,edi
-
 
895
	add	edi,4
-
 
896
	mov	[posx],eax
-
 
897
	jecxz	@f
-
 
898
	push	ecx
-
 
899
	mov	ecx,eax
-
 
900
	mov	al,' '
-
 
901
	rep	stosb
-
 
902
	pop	ecx
-
 
903
    @@: jecxz	@f
-
 
904
	rep	movsb
-
 
905
    @@: mov	ecx,10
-
 
906
	mov	al,' '
-
 
907
	rep	stosb
-
 
908
 
-
 
909
	lea	eax,[edi-4]
-
 
910
	sub	eax,edx
-
 
911
	mov	[edx],eax
-
 
912
 
-
 
913
	lea	ecx,[edi-0x10000]
-
 
914
 
-
 
915
	push	ecx
-
 
916
	mov	edi,0x2E0000
-
 
917
	lea	esi,[edi+4]
-
 
918
	sub	esi,ecx
-
 
919
	add	esi,[ebp]
-
 
920
	lea	ecx,[esi-4]
-
 
921
	sub	ecx,ebp
-
 
922
	std
-
 
923
	cmp	esi,edi
-
 
924
	jb	@f
-
 
925
	je	.lp3
-
 
926
	lea	esi,[ebp+4]
-
 
927
	mov	eax,[esp]
-
 
928
	lea	edi,[esi+eax-4]
-
 
929
	add	esi,[ebp]
-
 
930
	mov	ecx,0x2E0000
-
 
931
	sub	ecx,esi
-
 
932
	cld
-
 
933
    @@: rep	movsb
-
 
934
  .lp3: pop	ecx
-
 
935
	mov	esi,0x10000
-
 
936
	mov	edi,ebp
-
 
937
	cld
-
 
938
	rep	movsb
-
 
939
 
-
 
940
	inc	[posy]
-
 
941
	inc	[lines]
-
 
942
 
-
 
943
	jmp	check_inv_all
-
 
944
; ENTER }
-
 
945
 
-
 
946
  noenter:
-
 
947
 
-
 
948
; UP {
-
 
949
	cmp	al,130+48
-
 
950
	jnz	noup
-
 
951
 
-
 
952
	mov	eax,[posy]
-
 
953
	dec	eax
-
 
954
	jns	@f
-
 
955
	xor	eax,eax
-
 
956
    @@: mov	ecx,[top_line]
-
 
957
	cmp	eax,ecx
-
 
958
	jae	@f
-
 
959
	dec	ecx
-
 
960
	jns	@f
-
 
961
	xor	ecx,ecx
-
 
962
    @@: jmp	check_inv_all.skip_init
-
 
963
; UP }
-
 
964
 
-
 
965
  noup:
-
 
966
 
-
 
967
; DOWN {
-
 
968
	cmp	al,129+48
-
 
969
	jnz	nodown
-
 
970
 
-
 
971
	mov	eax,[posy]
-
 
972
	inc	eax
-
 
973
	cmp	eax,[lines]
-
 
974
	jb	@f
-
 
975
	dec	eax
-
 
976
    @@: mov	ecx,[top_line]
-
 
977
	mov	edx,eax
-
 
978
	sub	edx,ecx
-
 
979
	cmp	edx,[slines]
-
 
980
	jb	@f
-
 
981
	inc	ecx
-
 
982
    @@: jmp	check_inv_all.skip_init
-
 
983
; DOWN }
-
 
984
 
-
 
985
  nodown:
-
 
986
 
-
 
987
; LEFT {
-
 
988
	cmp	al,128+48
-
 
989
	jnz	noleft
-
 
990
	mov	eax,[posx]
-
 
991
	dec	eax
-
 
992
	jns	@f
-
 
993
	inc	eax
-
 
994
    @@: mov	[posx],eax
-
 
995
	jmp	check_inv_all
-
 
996
; LEFT }
-
 
997
 
-
 
998
  noleft:
-
 
999
 
-
 
1000
; RIGHT {
-
 
1001
	cmp	al,131+48
-
 
1002
	jnz	noright
-
 
1003
	mov	eax,[posx]
-
 
1004
	inc	eax
-
 
1005
	cmp	eax,[columns]
-
 
1006
	jbe	@f
-
 
1007
	dec	eax
-
 
1008
    @@: mov	[posx],eax
-
 
1009
	jmp	check_inv_all
-
 
1010
; RIGHT }
-
 
1011
 
-
 
1012
  noright:
-
 
1013
 
-
 
1014
; PAGE_UP {
-
 
1015
  page_up:
-
 
1016
	cmp	al,136+48
-
 
1017
	jnz	nopu
-
 
1018
	mov	edx,[slines]
-
 
1019
	dec	edx
-
 
1020
	mov	eax,[posy]
-
 
1021
	mov	ecx,[top_line]
-
 
1022
	sub	eax,edx
-
 
1023
	jns	@f
-
 
1024
	xor	eax,eax
-
 
1025
    @@: sub	ecx,edx
-
 
1026
	jns	@f
-
 
1027
	xor	ecx,ecx
-
 
1028
    @@: jmp	check_inv_all.skip_init
-
 
1029
; PAGE_UP }
-
 
1030
 
-
 
1031
  nopu:
-
 
1032
 
-
 
1033
; PAGE_DOWN {
267
        jz      red
1034
  page_down:
-
 
1035
	cmp	al,135+48
-
 
1036
	jnz	nopd
-
 
1037
	mov	edx,[slines]
-
 
1038
	dec	edx
-
 
1039
	mov	eax,[posy]
-
 
1040
	mov	ecx,[top_line]
-
 
1041
	add	eax,edx
-
 
1042
	add	ecx,edx
-
 
1043
	cmp	eax,[lines]
-
 
1044
	jb	@f
-
 
1045
	mov	eax,[lines]
-
 
1046
	dec	eax
-
 
1047
    @@: jmp  check_inv_all.skip_init
-
 
1048
; PAGE_DOWN }
-
 
1049
 
-
 
1050
  nopd:
-
 
1051
 
-
 
1052
; HOME {
-
 
1053
	cmp	al,132+48
-
 
1054
	jnz	nohome
-
 
1055
	mov	[posx],0
-
 
1056
	jmp	check_inv_all
-
 
1057
; HOME }
-
 
1058
 
-
 
1059
  nohome:
-
 
1060
 
-
 
1061
; END {
-
 
1062
  end_key:
-
 
1063
	cmp	al,133+48
-
 
1064
	jnz	noend
-
 
1065
 
-
 
1066
	mov	ecx,[posy]
-
 
1067
	call	get_line_offset
-
 
1068
	call	get_real_length
-
 
1069
	mov	[posx],eax
-
 
1070
	jmp	check_inv_all
-
 
1071
; END }
-
 
1072
 
-
 
1073
  noend:
-
 
1074
 
-
 
1075
; GO_START {
-
 
1076
	cmp	al,251	       ; Ctrl + [
-
 
1077
	jnz	no_go_to_start
-
 
1078
	xor	eax,eax
-
 
1079
	mov	[top_line],eax
-
 
1080
	mov	[posy],eax
-
 
1081
	jmp	check_inv_all.skip_check
-
 
1082
; GO_START }
-
 
1083
 
-
 
1084
  no_go_to_start:
-
 
1085
 
-
 
1086
; GO_END {
-
 
1087
	cmp	al,253	       ; Ctrl + ]
-
 
1088
	jnz	no_go_to_end
-
 
1089
	mov	eax,[lines]    ; eax = lines in the file
-
 
1090
	mov	[posy],eax
-
 
1091
	sub	eax,[slines]   ; eax -= lines on the screen
-
 
1092
	jns	@f
-
 
1093
	xor	eax,eax
-
 
1094
    @@: mov	[top_line],eax
-
 
1095
	dec	[posy]
-
 
1096
	jmp	check_inv_all.skip_check
-
 
1097
; GO_END }
-
 
1098
 
-
 
1099
  no_go_to_end:
-
 
1100
 
-
 
1101
; DELETE {
-
 
1102
  __key_delete:
-
 
1103
	cmp	al,134+48
-
 
1104
	jne	nodel
-
 
1105
 
-
 
1106
	mov	ecx,[posy]
-
 
1107
	call	get_line_offset
-
 
1108
	lea	ebx,[esi+4]
-
 
1109
	mov	ebp,esi
-
 
1110
 
-
 
1111
	call	get_real_length
-
 
1112
	or	eax,eax
-
 
1113
	je	.line_up
-
 
1114
 
-
 
1115
	mov	ecx,[posx]
-
 
1116
	cmp	ecx,eax
-
 
1117
	jae	.line_up
-
 
1118
	lea	edi,[ebx+ecx]
-
 
1119
	neg	ecx
-
 
1120
	add	ecx,[ebp]
-
 
1121
	repe	scasb
-
 
1122
	je	.line_up
-
 
1123
 
-
 
1124
	mov	edi,ebx
-
 
1125
	mov	ecx,[posx]
-
 
1126
	add	edi,ecx
-
 
1127
	lea	esi,[edi+1]
-
 
1128
	neg	ecx
-
 
1129
	add	ecx,[ebp]
-
 
1130
	dec	ecx
-
 
1131
	rep	movsb
-
 
1132
	mov	byte[edi],' '
-
 
1133
 
-
 
1134
	jmp	check_inv_all
-
 
1135
 
-
 
1136
  .line_up:
-
 
1137
	mov	eax,[lines]
-
 
1138
	dec	eax
-
 
1139
	cmp	eax,[posy]
-
 
1140
	je	still;.ok
-
 
1141
	mov	edi,0x10004
-
 
1142
	mov	esi,ebx
-
 
1143
	mov	ecx,[posx]
-
 
1144
	rep	movsb
-
 
1145
	mov	ecx,[posx]
-
 
1146
	mov	[0x10000],ecx
-
 
1147
	cmp	ecx,[ebp]
-
 
1148
	jbe	@f
-
 
1149
	sub	ecx,[ebp]
-
 
1150
	sub	edi,ecx
-
 
1151
	mov	al,' '
-
 
1152
	rep	stosb
-
 
1153
    @@: lea	esi,[ebx+4]
-
 
1154
	add	esi,[ebp]
-
 
1155
	mov	ecx,[esi-4]
-
 
1156
	add	[0x10000],ecx
-
 
1157
	rep	movsb
-
 
1158
 
-
 
1159
	lea	ecx,[edi-0x10000]
-
 
1160
 
-
 
1161
	mov	esi,0x10000
-
 
1162
	call	get_real_length
-
 
1163
	cmp	eax,[columns]
-
 
1164
	jbe	@f
-
 
1165
	mov	[columns],eax
-
 
1166
    @@:
-
 
1167
 
-
 
1168
	push	ecx
-
 
1169
	mov	edi,0x2E0000
-
 
1170
	lea	esi,[edi+8]
-
 
1171
	sub	esi,ecx
-
 
1172
	add	esi,[ebp]
-
 
1173
	lea	eax,[ebp+4]
-
 
1174
	add	eax,[ebp]
-
 
1175
	add	esi,[eax]
-
 
1176
	lea	ecx,[esi-4]
-
 
1177
	sub	ecx,ebp
-
 
1178
	std
-
 
1179
	cmp	esi,edi
-
 
1180
	jb	@f
-
 
1181
	jz	.lp1
-
 
1182
	mov	edi,ebp
-
 
1183
	add	edi,[esp]
-
 
1184
	lea	esi,[ebp+8]
-
 
1185
	add	esi,[esi-8]
-
 
1186
	add	esi,[esi-4]
-
 
1187
	mov	ecx,0x2E0000
-
 
1188
	sub	ecx,esi
-
 
1189
	cld
-
 
1190
    @@: rep	movsb
-
 
1191
  .lp1: pop	ecx
-
 
1192
	mov	esi,0x10000
-
 
1193
	mov	edi,ebp
-
 
1194
	cld
-
 
1195
	rep	movsb
-
 
1196
 
-
 
1197
  .ok.dec.lines:
-
 
1198
	dec	[lines]
-
 
1199
	mov	eax,[lines]
-
 
1200
	cmp	[posy],eax
-
 
1201
	jb	check_inv_all
-
 
1202
	dec	eax
-
 
1203
	mov	[posy],eax
-
 
1204
	jmp	check_inv_all
-
 
1205
; DELETE }
-
 
1206
 
-
 
1207
  nodel:
-
 
1208
 
-
 
1209
; INSERT {
-
 
1210
	cmp	al,137+48
-
 
1211
	jnz	noins
-
 
1212
	;// ... toggle insert/overwrite mode here ...
-
 
1213
	jmp	still;check_inv_str
-
 
1214
; INSERT }
-
 
1215
 
-
 
1216
  noins:
-
 
1217
 
-
 
1218
; BACKSPACE {
-
 
1219
	cmp	al,8
-
 
1220
	jnz	nobs
-
 
1221
 
-
 
1222
	mov	eax,[posx]
-
 
1223
	dec	eax
-
 
1224
	js	.line_up
-
 
1225
 
-
 
1226
	dec	[posx]
-
 
1227
	mov	ecx,[posy]
-
 
1228
	call	get_line_offset
-
 
1229
 
-
 
1230
	mov	ebx,eax
-
 
1231
	call	get_real_length
-
 
1232
	cmp	eax,[posx]
-
 
1233
	jb	check_inv_all
-
 
1234
 
-
 
1235
	lea	edi,[esi+4+ebx]
-
 
1236
	mov	ecx,ebx
-
 
1237
	neg	ecx
-
 
1238
	add	ecx,[esi]
-
 
1239
	dec	ecx
-
 
1240
	lea	esi,[edi+1]
-
 
1241
	cld
-
 
1242
	rep	movsb
-
 
1243
	mov	byte[edi],' '
-
 
1244
 
-
 
1245
	jmp	check_inv_str
-
 
1246
 
-
 
1247
  .line_up:
-
 
1248
	cmp	[posy],0
-
 
1249
	je	still
-
 
1250
	mov	ecx,[posy]
-
 
1251
	dec	ecx
-
 
1252
	call	get_line_offset
-
 
1253
	mov	ebp,esi
-
 
1254
	lea	ebx,[esi+4]
-
 
1255
	mov	ecx,[ebp]
-
 
1256
    @@: cmp	byte[ebx+ecx-1],' '
-
 
1257
	jne	@f
-
 
1258
	dec	ecx
-
 
1259
	jg	@b
-
 
1260
    @@: mov	[posx],ecx
-
 
1261
	dec	[posy]
-
 
1262
	cld
-
 
1263
	jmp	__key_delete.line_up
-
 
1264
; BACKSPACE }
-
 
1265
 
-
 
1266
  nobs:
-
 
1267
 
-
 
1268
; TAB {
-
 
1269
  __key_tab:
-
 
1270
	cmp	eax,9  ; Tab
-
 
1271
	jne	notab
-
 
1272
 
-
 
1273
	mov	eax,[posx]
-
 
1274
 
-
 
1275
	mov	ecx,eax
-
 
1276
	add	eax,ATABW
-
 
1277
	and	eax,not(ATABW-1)
-
 
1278
	push	eax ' '
-
 
1279
	sub	eax,ecx
-
 
1280
  .direct:
-
 
1281
	mov	ecx,[posy]
-
 
1282
	call	get_line_offset
-
 
1283
 
-
 
1284
	xchg	eax,ecx
-
 
1285
 
-
 
1286
	call	get_real_length
-
 
1287
	cmp	eax,[posx]
-
 
1288
	jae	@f
-
 
1289
	mov	eax,[posx]
-
 
1290
    @@: mov	edx,[esi]
-
 
1291
	sub	edx,eax
-
 
1292
	cmp	ecx,edx
-
 
1293
	jl	@f
-
 
1294
	pushad; esi ecx eax
-
 
1295
	mov	ecx,0x2E0000-10+1
-
 
1296
	lea	eax,[esi+4]
-
 
1297
	add	eax,[esi]
-
 
1298
	sub	ecx,eax
-
 
1299
	mov	edi,0x2E0000
-
 
1300
	mov	esi,0x2E0000-10
-
 
1301
	std
-
 
1302
	rep	movsb
-
 
1303
	mov	ecx,10
-
 
1304
	mov	al,' '
-
 
1305
	rep	stosb
-
 
1306
	popad;  eax ecx esi
-
 
1307
	add	dword[esi],10
-
 
1308
	jmp	@b
-
 
1309
    @@: lea	ebx,[esi+4]
-
 
1310
	push	ecx
-
 
1311
	lea	edi,[ebx-1]
-
 
1312
	add	edi,[esi]
-
 
1313
	mov	esi,edi
-
 
1314
	sub	esi,ecx
-
 
1315
	lea	ecx,[esi+1]
-
 
1316
	sub	ecx,ebx
-
 
1317
	sub	ecx,[posx]
-
 
1318
	std
-
 
1319
	rep	movsb
-
 
1320
  .ok:	pop	ecx
-
 
1321
	pop	eax
-
 
1322
	rep	stosb
-
 
1323
 
-
 
1324
	cld
-
 
1325
 
-
 
1326
	pop	[posx]
-
 
1327
 
-
 
1328
	lea	esi,[ebx-4]
-
 
1329
	call	get_real_length
-
 
1330
	cmp	eax,[posx]
-
 
1331
	jae	@f
-
 
1332
	mov	eax,[posx]
-
 
1333
    @@: cmp	eax,[columns]
-
 
1334
	jbe	@f
-
 
1335
	mov	[columns],eax
-
 
1336
    @@:
-
 
1337
	jmp	check_inv_all
-
 
1338
; TAB }
-
 
1339
 
-
 
1340
  notab:
-
 
1341
 
-
 
1342
; ADD_KEY {
-
 
1343
	push	[posx] eax
-
 
1344
	inc	dword[esp+4]
-
 
1345
	mov	eax,1
-
 
1346
	jmp	__key_tab.direct
-
 
1347
; ADD_KEY }
-
 
1348
 
-
 
1349
check_inv_str = check_inv_all
-
 
1350
@^
-
 
1351
func check_inv_str
-
 
1352
	mov	eax,[posy]
-
 
1353
	mov	ecx,[top_line]
-
 
1354
  .skip_init:
-
 
1355
	call	check_cur_vis
-
 
1356
	mov	[posy],eax
-
 
1357
	mov	[top_line],ecx
-
 
1358
  .skip_check:
-
 
1359
;       call    invalidate_string
-
 
1360
	call	drawfile
268
        dec     eax     ; key ?
1361
	jmp	still
269
        jz      key
Line 1362... Line -...
1362
endf
-
 
1363
^@
-
 
1364
func check_inv_all
-
 
1365
	mov	eax,[posy]
-
 
1366
	mov	ecx,[top_line]
-
 
1367
  .skip_init:
-
 
1368
	call	check_cur_vis
-
 
1369
	mov	[posy],eax
-
 
1370
	mov	[top_line],ecx
-
 
1371
  .skip_check:
-
 
1372
;       call    clear_screen
-
 
1373
	call	drawfile
-
 
1374
	jmp	still
-
 
1375
endf
-
 
1376
 
-
 
1377
func check_cur_vis
-
 
1378
	cmp	eax,ecx
-
 
1379
	jb	.low
-
 
1380
	mov	edx,ecx
-
 
1381
	add	edx,[slines]
-
 
1382
	cmp	edx,[lines]
-
 
1383
	jbe	@f
-
 
1384
	mov	edx,[lines]
-
 
1385
    @@: cmp	eax,edx
-
 
1386
	jb	@f
-
 
1387
	lea	ecx,[eax+1]
-
 
1388
	sub	ecx,[slines]
-
 
1389
	jns	@f
-
 
1390
	xor	ecx,ecx
-
 
1391
	jmp	@f
-
 
1392
  .low: mov	ecx,eax
-
 
1393
    @@:
-
 
1394
	mov	edx,ecx
-
 
1395
	add	edx,[slines]
-
 
1396
	cmp	edx,[lines]
-
 
1397
	jbe	@f
-
 
1398
	mov	ecx,[lines]
-
 
1399
	sub	ecx,[slines]
-
 
1400
	jns	@f
-
 
1401
	xor	ecx,ecx
-
 
1402
    @@:;mov     [top_line],eax
-
 
1403
 
-
 
1404
	pushad
-
 
1405
	mov	eax,[posx]
-
 
1406
	mov	ebx,[left_col]
-
 
1407
	mov	ecx,ebx
-
 
1408
	add	ecx,[scolumns]
-
 
1409
	cmp	eax,ebx
-
 
1410
	jb	.lp1
-
 
1411
	cmp	eax,ecx
-
 
1412
	jb	.exit.2
-
 
1413
	lea	ebx,[eax]
-
 
1414
	sub	ebx,[scolumns]
-
 
1415
	jmp	@f
-
 
1416
  .lp1: mov	ebx,eax
-
 
1417
    @@: mov	[left_col],ebx
-
 
1418
  .exit.2:
-
 
1419
	mov	[posx],eax
-
 
1420
	popad
-
 
1421
 
270
        dec     eax     ; button ?
1422
	ret
271
        jz      button
1423
endf
272
        sub     eax,3   ; mouse ?
1424
 
273
        jz      mouse
1425
func get_real_length
274
 
1426
	mov	eax,[esi]
275
        jmp     still.skip_write
1427
    @@: cmp	byte[esi+eax+4-1],' '
276
 
1428
	jne	@f
277
;-----------------------------------------------------------------------------
1429
	dec	eax
278
func red ;///// window redraw ////////////////////////////////////////////////
1430
	jnz	@b
279
;-----------------------------------------------------------------------------
Line 1431... Line 280...
1431
    @@: ret
280
        call    drawwindow
1432
endf
281
        call    check_inv_all.skip_check
Line 1433... Line 282...
1433
 
282
        jmp     still
1434
;******************************************************************************
283
endf
Line 1435... Line 284...
1435
 
284
 
1436
;----------------------------------------------------------------------------
285
;-----------------------------------------------------------------------------
Line 1437... Line 286...
1437
func start_fasm ;////////////////////////////////////////////////////////////
286
func start_fasm ;/////////////////////////////////////////////////////////////
1438
;----------------------------------------------------------------------------
287
;-----------------------------------------------------------------------------
1439
; BL = run after compile
288
; BL = run after compile
1440
;----------------------------------------------------------------------------
289
;-----------------------------------------------------------------------------
Line 1441... Line 290...
1441
	cmp	[asm_mode],0
290
        cmp     [asm_mode],0
1442
	jne	@f
291
        jne     @f
Line 1469... Line 318...
1469
	stosb
318
        stosb
Line 1470... Line 319...
1470
 
319
 
Line 1471... Line 320...
1471
	jmp	.run
320
        jmp     .run
-
 
321
 
1472
 
322
 .yes_systree:
1473
 .yes_systree:
323
        mov     eax,[f_info.length]
Line 1474... Line 324...
1474
	add	esi,[s_fname.size]
324
        add     esi,eax ; [s_fname.size]
1475
	dec	esi
325
        dec     esi
1476
 
326
 
Line 1497... Line 347...
1497
 
347
 
1498
	mov	al,','
348
        mov     al,','
Line 1499... Line 349...
1499
	stosb
349
        stosb
1500
 
350
 
1501
	pop	ecx
351
        pop     ecx
Line 1502... Line 352...
1502
	sub	ecx,s_fname
352
        sub     ecx,f_info.path ; s_fname
Line 1503... Line 353...
1503
	mov	esi,s_fname
353
        mov     esi,f_info.path ; s_fname
1504
 
354
 
Line 1514... Line 364...
1514
	mov	byte[edi+3],0
364
        mov     byte[edi+3],0
1515
    @@: mcall	19,fasm_filename,fasm_parameters
365
    @@: mcall   19,fasm_filename,fasm_parameters
1516
	ret
366
        ret
1517
endf
367
endf
Line -... Line 368...
-
 
368
 
1518
 
369
;-----------------------------------------------------------------------------
-
 
370
func open_debug_board ;///////////////////////////////////////////////////////
1519
func open_debug_board
371
;-----------------------------------------------------------------------------
1520
	mcall	19,debug_filename,0
372
        mcall   19,debug_filename,0
1521
	ret
373
        ret
Line -... Line 374...
-
 
374
endf
-
 
375
 
-
 
376
;-----------------------------------------------------------------------------
1522
endf
377
func open_sysfuncs_txt ;//////////////////////////////////////////////////////
-
 
378
;-----------------------------------------------------------------------------
-
 
379
        mcall   19,docpak_filename,sysfuncs_param
1523
 
380
        cmp     eax,0xfffffff0
1524
func open_sysfuncs_txt
381
        jb      @f
1525
	mcall	19,tinypad_filename,sysfuncs_filename
382
        mcall   19,tinypad_filename,sysfuncs_filename
Line -... Line 383...
-
 
383
    @@: ret
1526
	ret
384
endf
1527
endf
385
 
1528
 
386
;-----------------------------------------------------------------------------
1529
func layout
387
func layout  ;///// change keyboard layout ///////////////////////////////////
1530
; ᬥ­¨âì à áª« ¤ªã ª« ¢¨ âãàë
388
;-----------------------------------------------------------------------------
1531
	mcall	19,setup,param_setup
389
        mcall   19,setup,param_setup
1532
	mcall	5,eax
390
        mcall   5,eax
Line 1549... Line 407...
1549
	mcall	18,3
407
        mcall   18,3
1550
	mcall	5,eax
408
        mcall   5,eax
1551
    @@: ret
409
    @@: ret
1552
endf
410
endf
Line 1553... Line -...
1553
 
-
 
1554
; *******************************************************************
-
 
1555
; **************************  DRAW WINDOW  **************************
-
 
1556
; *******************************************************************
-
 
1557
 
411
 
1558
func drawwindow
-
 
1559
 
-
 
1560
	mcall	48,3,sc,sizeof.system_colors
-
 
1561
 
-
 
1562
	mcall	12,1
-
 
1563
 
-
 
1564
	push	[color_tbl+4*5]
-
 
1565
	pop	[sc.work]
-
 
1566
 
-
 
1567
	mov	edx,[sc.work]
-
 
1568
	add	edx,0x03000000
-
 
1569
	mov	esi,[sc.grab]
-
 
1570
	or	esi,0x80000000
-
 
1571
	mcall	0,<100,6*80+6+OLEFT+SCRLW>,<75,402>,,,[sc.frame]
-
 
1572
 
-
 
1573
	mcall	48,4
-
 
1574
	mov	[skinh],eax
-
 
1575
	push	eax
-
 
1576
 
-
 
1577
	mcall	9,p_info,-1
-
 
1578
	pop	eax
-
 
1579
	cmp	[p_info.y_size],0
-
 
1580
	je	.exit.2
-
 
1581
 
412
func set_opt
1582
	mov	[top_ofs],eax
-
 
1583
	dec	[top_ofs]
-
 
1584
	cmp	[asm_mode],0
413
        test    [options],al
1585
	je	@f
-
 
1586
	add	[top_ofs],ATOPH+1
-
 
1587
    @@:
-
 
1588
; header string
-
 
1589
	mov	ebx,eax
-
 
1590
	shr	ebx,1
-
 
1591
	adc	ebx,1+0x000A0000-4
-
 
1592
	mcall	4,,[sc.grab_text],s_title,[s_title.size]
-
 
1593
 
-
 
1594
	mov	eax,[p_info.x_size]
-
 
1595
	sub	eax,5*2+SCRLW+2
-
 
1596
	cdq
-
 
1597
	mov	ebx,6
-
 
1598
	div	ebx
-
 
1599
	mov	[scolumns],eax
-
 
1600
 
-
 
1601
	mov	eax,[p_info.y_size] ; calculate buttons position
-
 
1602
	add	eax,-5-ABTNH*3-2-2
-
 
1603
	mov	[bot_ofs],eax
-
 
1604
 
-
 
1605
;       mov     eax,[procinfo.y_size]
-
 
1606
	mov	[do_not_draw],1 ; do_not_draw = true
-
 
1607
 
-
 
1608
	mov	ebx,eax
-
 
1609
	sub	ebx,[skinh]
-
 
1610
	sub	ebx,ATOPH+SCRLW*3+AMINS+5
-
 
1611
	js	.no_draw
-
 
1612
 
414
        je      @f
1613
;        cmp     eax,100
-
 
1614
;        jb      .no_draw        ; do not draw text & buttons if height < 100
-
 
1615
 
-
 
1616
	mov	[do_not_draw],0 ; do_not_draw = false
-
 
1617
	sub	eax,SCRLW+2+2
-
 
1618
	sub	eax,[top_ofs]
-
 
1619
	cdq
-
 
1620
	mov	ebx,10
-
 
1621
	div	ebx
-
 
1622
	mov	[slines],eax
-
 
1623
 
-
 
1624
	mov	ebx,[p_info.x_size]
-
 
1625
	add	ebx,5*65536-5
-
 
1626
	mov	ecx,[top_ofs-2]
-
 
1627
	mov	cx,word[top_ofs]
-
 
1628
	mcall	38,,,[sc.work_text]
-
 
1629
	mov	ecx,[bot_ofs-2]
415
        not     al
1630
	mov	cx,word[bot_ofs]
-
 
1631
	sub	ecx,0x00010001
-
 
1632
	push	ecx
-
 
1633
	mcall
-
 
1634
	add	ecx,(ABTNH+2)*65536+ABTNH+2
-
 
1635
	mcall
-
 
1636
	add	ecx,(ABTNH+2)*65536+ABTNH+2
-
 
1637
	mcall
-
 
1638
	pop	ecx
-
 
1639
	add	cx,(ABTNH+2)*3
-
 
1640
	mov	ebx,[p_info.x_size]
-
 
1641
	sub	ebx,RBTNW+5+1
-
 
1642
	push	bx
-
 
1643
	shl	ebx,16
-
 
1644
	pop	bx
-
 
1645
	mcall
-
 
1646
	mov	ebx,(5+LBTNW+1)*65536+(5+LBTNW+1)
-
 
1647
	add	ecx,(ABTNH+2)*65536
-
 
1648
	mcall
-
 
1649
 
-
 
1650
	inc	[top_ofs]
-
 
1651
 
-
 
1652
	mov	ebx,5*65536
-
 
1653
	mov	bx,word[p_info.x_size]
-
 
1654
	sub	bx,9
-
 
1655
	push	bx
-
 
1656
	sub	bx,RBTNW+2
-
 
1657
	mov	ecx,[bot_ofs-2]
-
 
1658
	mov	cx,ABTNH+1
-
 
1659
	mcall	13,,,[sc.work_graph]		; BAR STRIPE
-
 
1660
 
-
 
1661
	pop	bx
-
 
1662
	cmp	[asm_mode],0
-
 
1663
	je	.skip_top_btns
-
 
1664
	mov	ecx,[skinh-2]
-
 
1665
	mov	cx,ATOPH
-
 
1666
	mcall					; UPPER BAR
-
 
1667
 
-
 
1668
	mov	eax,8
-
 
1669
	mov	ebx,6*65536+52
-
 
1670
	mov	ecx,[skinh]
-
 
1671
	inc	ecx
-
 
1672
	shl	ecx,16
-
 
1673
	add	ecx,ATOPH-3
-
 
1674
	mov	edx,10000
-
 
1675
	mov	esi,[sc.work_button]
-
 
1676
    @@:
-
 
1677
	mcall					; TOOLBAR BUTTONS
-
 
1678
	add	ebx,54*65536
-
 
1679
	inc	edx
-
 
1680
	cmp	edx,10004
-
 
1681
	jb	@b
-
 
1682
 
-
 
1683
  .skip_top_btns:
-
 
1684
	mov	ebx,5*65536+LBTNW
-
 
1685
	mov	ecx,[bot_ofs]
-
 
1686
	shl	ecx,16
-
 
1687
	add	ecx,(ABTNH+2)*65536+ABTNH
-
 
1688
	mcall	8,,,5,[sc.work_button]		; FILE BUTTON
-
 
1689
 
-
 
1690
	add	ecx,(ABTNH+2)*65536
-
 
1691
	mcall	,,,51				; STRING BUTTON
-
 
1692
 
-
 
1693
	push	ebx ecx
-
 
1694
 
-
 
1695
	mov	ebx,[p_info.x_size]
-
 
1696
	shl	ebx,16
-
 
1697
	add	ebx,(-5-RBTNW)*65536+RBTNW
-
 
1698
	mov	ecx,[bot_ofs]
-
 
1699
	shl	ecx,16
-
 
1700
	add	ecx,ABTNH
-
 
1701
	mov	edx,2
-
 
1702
	mcall	,,,2				; SAVE BUTTON
-
 
1703
 
-
 
1704
	add	ecx,(ABTNH+2)*65536
-
 
1705
	mcall	,,,4				; FILE BUTTON
-
 
1706
 
-
 
1707
	add	ecx,(ABTNH+2)*65536
-
 
1708
	mcall	,,,50				; SEARCH BUTTON
-
 
1709
 
-
 
1710
	shr	ecx,16
-
 
1711
	mov	bx,cx
-
 
1712
	add	ebx,-ABTNH-2-ABTNH/2-2-3
-
 
1713
	mcall	4,,[sc.work_button_text],rstr,rstr.size/3
-
 
1714
	add	ebx,ABTNH+2
-
 
1715
	add	edx,rstr.size/3
-
 
1716
	mcall
-
 
1717
	add	ebx,ABTNH+2
-
 
1718
	add	edx,rstr.size/3
-
 
1719
	mcall
-
 
1720
 
-
 
1721
	pop	edi ebx
-
 
1722
	shr	edi,16
-
 
1723
	mov	bx,di
-
 
1724
	add	ebx,-1-ABTNH/2-2-2
-
 
1725
	mcall	,,,lstr,lstr.size/2
-
 
1726
	add	ebx,ABTNH+2
-
 
1727
	add	edx,lstr.size/2
-
 
1728
	mcall
-
 
1729
 
-
 
1730
	cmp	[asm_mode],0
-
 
1731
	je	@f
-
 
1732
	mov	ebx,[skinh]
-
 
1733
	add	ebx,0x000C0000+ATOPH/2-4
-
 
1734
	mcall	,,,toolbar_btn_text,toolbar_btn_text.size
-
 
1735
    @@:
-
 
1736
	mov	eax,[bot_ofs]
-
 
1737
	add	eax,ABTNH+2
-
 
1738
	mov	[ya],eax
-
 
1739
	mov	[addr],s_fname
-
 
1740
	call	print_text
-
 
1741
 
-
 
1742
	add	eax,ABTNH+2
-
 
1743
	mov	[ya],eax
-
 
1744
	mov	[addr],s_search
-
 
1745
	call	print_text
-
 
1746
	jmp	.exit
-
 
1747
 
-
 
1748
  .no_draw:
-
 
1749
	mov	ebx,[skinh]
-
 
1750
	mov	[top_ofs],ebx
-
 
1751
	mov	eax,[p_info.y_size]
-
 
1752
	add	eax,-3
-
 
1753
	mov	[bot_ofs],eax
-
 
1754
	sub	eax,ebx
-
 
1755
	push	eax
-
 
1756
	add	eax,-2-SCRLW
-
 
1757
	cdq
-
 
1758
	mov	ebx,10
-
 
1759
	idiv	ebx
-
 
1760
	mov	[slines],eax
-
 
1761
	pop	eax
-
 
1762
 
-
 
1763
	mov	ebx,[p_info.y_size]
-
 
1764
	sub	ebx,[skinh]
-
 
1765
	sub	ebx,SCRLW*3++AMINS+7
-
 
1766
	jns	@f
-
 
1767
 
-
 
1768
	inc	[do_not_draw]
-
 
1769
 
-
 
1770
	add	eax,-2
-
 
1771
	cdq
-
 
1772
	mov	ebx,10
-
 
1773
	idiv	ebx
-
 
1774
	mov	[slines],eax
-
 
1775
 
-
 
1776
	mov	eax,[p_info.x_size]
-
 
1777
	sub	eax,5*2
-
 
1778
	cdq
-
 
1779
	mov	ebx,6
-
 
1780
	idiv	ebx
-
 
1781
	mov	[scolumns],eax
-
 
1782
    @@:
-
 
1783
 
-
 
1784
  .exit:
-
 
1785
	call	drawfile
-
 
1786
  .exit.2:
-
 
1787
	mcall	12,2
416
        and     [options],al
1788
	ret
-
 
1789
endf
-
 
1790
 
-
 
1791
;--------------------------------------------
-
 
1792
func get_line_offset
-
 
1793
;--------------------------------------------
-
 
1794
; Input:
-
 
1795
;  ECX = line number
-
 
1796
; Output:
417
        ret
1797
;  ESI = line data offset
-
 
1798
;--------------------------------------------
-
 
1799
	push	eax
-
 
1800
	mov	esi,0x80000
-
 
1801
	jecxz	.exit
-
 
1802
    @@: lodsd
-
 
1803
	add	esi,eax
-
 
1804
	loop	@b
-
 
1805
  .exit:
-
 
1806
	pop	eax
418
    @@: or      [options],al
1807
	ret
419
        ret
Line 1808... Line -...
1808
endf
-
 
1809
 
-
 
1810
; **********************************
-
 
1811
; ***********  DRAWFILE  ***********
-
 
1812
; **********************************
-
 
1813
 
420
endf
1814
;---------------------------------------------------
-
 
1815
func drawfile.ex
-
 
1816
;---------------------------------------------------
421
 
1817
; Input:
422
func set_line_numbers
1818
;  EAX = start line
-
 
1819
;  EBX = end line
-
 
1820
;---------------------------------------------------
-
 
1821
	cmp	[p_info.y_size],0
423
        mov     al,OPTS_LINENUMS
1822
	jne	@f
-
 
1823
	ret
-
 
1824
    @@:
-
 
1825
	call	check_bottom_right
-
 
1826
 
-
 
1827
	pushad
-
 
1828
 
-
 
1829
	cmp	[slines],0
-
 
1830
	jle	drawfile.exit
-
 
1831
 
-
 
1832
	cmp	eax,ebx
-
 
1833
	jae	@f
-
 
1834
	xchg	eax,ebx
-
 
1835
    @@: cmp	eax,[top_line]
-
 
1836
	jae	@f
-
 
1837
	mov	eax,[top_line]
-
 
1838
    @@: mov	ecx,[top_line]
-
 
1839
	add	ecx,[slines]
-
 
1840
	cmp	ebx,ecx
-
 
1841
	jb	@f
-
 
1842
	dec	ecx
-
 
1843
	mov	ebx,ecx
-
 
1844
    @@: cmp	eax,ebx
-
 
1845
	ja	drawfile.exit
-
 
1846
 
-
 
1847
	mov	ecx,eax
-
 
1848
	call	get_line_offset
-
 
1849
 
-
 
1850
  .start:
-
 
1851
	mov	ecx,ebx
-
 
1852
	sub	ecx,eax
-
 
1853
 
-
 
1854
	mov	ebx,[top_ofs]
-
 
1855
	add	ebx,OLEFT*65536+1
-
 
1856
	sub	eax,[top_line]
-
 
1857
	imul	eax,10
-
 
1858
	add	ebx,eax
-
 
1859
 
-
 
1860
	imul	ebp,[left_col],6*65536
-
 
1861
 
424
        call    set_opt
Line 1862... Line 425...
1862
	jmp	drawfile.next_line
425
        ret
1863
endf
-
 
1864
 
-
 
1865
func drawfile
-
 
1866
	cmp	[p_info.y_size],0
-
 
1867
	jne	@f
-
 
1868
	ret
-
 
1869
    @@:
-
 
1870
	call	check_bottom_right
-
 
1871
 
-
 
1872
	pushad
-
 
1873
 
-
 
1874
	mov	ebx,[top_ofs]
-
 
1875
	add	ebx,OLEFT*65536+1
-
 
1876
 
-
 
1877
	mov	ecx,[top_line]
-
 
1878
	call	get_line_offset
-
 
1879
 
-
 
1880
  .start:
-
 
1881
	mov	ecx,[slines]
-
 
1882
	or	ecx,ecx
-
 
1883
	jle	.exit
-
 
1884
 
-
 
1885
	imul	ebp,[left_col],6*65536
-
 
1886
 
-
 
1887
  .next_line:
-
 
1888
 
-
 
1889
	push	ecx ebx
-
 
1890
 
-
 
1891
	mov	ecx,ebx
-
 
1892
	shl	ecx,16
-
 
1893
	mov	cl,10
-
 
1894
	mov	ebx,[p_info.x_size]
-
 
1895
	add	ebx,(OLEFT-1)*65536-10-SCRLW ; 
-
 
1896
	mcall	13,,,[color_tbl+4*5]
-
 
1897
 
426
endf
1898
	xor	ecx,ecx
-
 
1899
	lodsd
-
 
1900
	mov	[cur_line_len],eax
-
 
1901
 
-
 
1902
	or	eax,eax
-
 
1903
	ja	.next_block
-
 
1904
	add	esp,4*2
-
 
1905
	jmp	.draw_cursor
-
 
1906
 
-
 
1907
  .next_block:
-
 
1908
 
427
 
1909
	push	esi
-
 
1910
	push	ecx
-
 
1911
	call	get_next_part
-
 
1912
	pop	ebx
-
 
1913
	push	ecx
-
 
1914
	mov	ecx,eax
-
 
1915
 
-
 
1916
	push	esi ebx
-
 
1917
	mov	eax,ebx
-
 
1918
	sub	ebx,[left_col]
-
 
1919
	cmp	ebx,[scolumns]
-
 
1920
	jge	@f
-
 
1921
	add	ebx,esi
-
 
1922
	jle	@f
-
 
1923
	mov	ebx,[esp+8+4*2] ;// 4*2=esi+ebx
-
 
1924
	sub	eax,[left_col]
-
 
1925
	jge	.qqq
-
 
1926
	sub	edx,eax
-
 
1927
	add	esi,eax
-
 
1928
	mov	eax,OLEFT*65536
-
 
1929
	jmp	.qqq2
-
 
1930
  .qqq:
-
 
1931
	inc	eax
-
 
1932
	imul	eax,6*65536
-
 
1933
  .qqq2:
-
 
1934
	and	ebx,0x0000FFFF
-
 
1935
	add	ebx,eax
-
 
1936
 
-
 
1937
	mov	eax,[esp]
-
 
1938
	add	eax,[esp+4];esi
-
 
1939
	sub	eax,[left_col]
-
 
1940
	sub	eax,[scolumns]
-
 
1941
	jle	.qweqwe
-
 
1942
	sub	esi,eax
-
 
1943
  .qweqwe:
-
 
1944
 
-
 
1945
	mcall	4;[esp+8]
-
 
1946
    @@:
-
 
1947
	pop	eax eax ; ebx esi
-
 
1948
	imul	eax,6
-
 
1949
	add	[esp+10],ax
-
 
1950
	pop	ecx esi
-
 
1951
	cmp	ecx,[cur_line_len];LINE_WIDTH
-
 
1952
	jl	.next_block
-
 
1953
 
-
 
1954
	pop	ebx ecx
-
 
1955
	and	ebx,0x0000FFFF
-
 
1956
	add	ebx,OLEFT*65536+10
-
 
1957
	add	esi,[cur_line_len];LINE_WIDTH
-
 
1958
	dec	ecx
-
 
1959
	jg	.next_line
-
 
1960
 
-
 
1961
;--------------------------------------------------------------------------
-
 
1962
  .draw_cursor:
-
 
1963
	mov	eax,[posy]
-
 
1964
	sub	eax,[top_line]
-
 
1965
	js	@f
-
 
1966
	mov	ecx,[slines]
-
 
1967
	sub	ecx,eax
-
 
1968
	jle	@f
-
 
1969
	imul	eax,10
-
 
1970
	add	eax,[top_ofs]
-
 
1971
	inc	eax
-
 
1972
	shl	eax,16
-
 
1973
	add	eax,10-1
-
 
1974
	mov	ecx,eax
-
 
1975
	mov	ebx,[posx]
-
 
1976
	sub	ebx,[left_col]
-
 
1977
	js	@f
-
 
1978
	cmp	ebx,[scolumns]
-
 
1979
	ja	@f
-
 
1980
	imul	ebx,6
-
 
1981
	add	ebx,OLEFT-1
-
 
1982
	shl	ebx,16
-
 
1983
	inc	ebx
-
 
1984
	inc	ebx
-
 
1985
	mov	edx,[color_tbl+4*5]
-
 
1986
	not	edx
-
 
1987
	and	edx,0x00FFFFFF
-
 
1988
	mcall	13
-
 
1989
    @@:
-
 
1990
;--------------------------------------------------------------------------
-
 
1991
	cmp	[do_not_draw],2
-
 
1992
	je	.exit
-
 
1993
 
-
 
1994
	mov	ebx,[p_info.x_size]
-
 
1995
	shl	ebx,16
-
 
1996
	add	ebx,(-SCRLW-5+2)*65536+SCRLW-2
-
 
1997
	mov	ecx,[top_ofs-2]
-
 
1998
	mov	cx,SCRLW-1
-
 
1999
	mcall	8,,,'UP',[sc.work_button]
-
 
2000
	pushad
-
 
2001
	push	0x18
-
 
2002
	shr	ecx,16
-
 
2003
	mov	bx,cx
-
 
2004
	add	ebx,(SCRLW/2-3)*65536+SCRLW/2-4
-
 
2005
	mcall	4,,[sc.work_button_text],esp,1
-
 
2006
	add	esp,4
-
 
2007
	popad
-
 
2008
	mov	ecx,[bot_ofs]
-
 
2009
	shl	ecx,16
-
 
2010
	add	ecx,(-SCRLW*2-1)*65536+SCRLW-1
-
 
2011
	mcall	,,,'DN'
-
 
2012
	pushad
-
 
2013
	push	0x19
-
 
2014
	shr	ecx,16
-
 
2015
	mov	bx,cx
-
 
2016
	add	ebx,(SCRLW/2-3)*65536+SCRLW/2-4
-
 
2017
	mcall	4,,[sc.work_button_text],esp,1
-
 
2018
	add	esp,4
-
 
2019
	popad
-
 
2020
	sub	ebx,1*65536-2
-
 
2021
 
-
 
2022
	push	ebx
-
 
2023
	mov	eax,[lines]
-
 
2024
	mov	ebx,[slines]
-
 
2025
	mov	ecx,[top_line]
-
 
2026
	mov	edx,[bot_ofs]
-
 
2027
	sub	edx,[top_ofs]
-
 
2028
	add	edx,-(SCRLW*3+2)
-
 
2029
	call	get_scroll_vars
-
 
2030
	mov	[vscrl_top],eax
-
 
2031
	mov	[vscrl_size],ebx
-
 
2032
	pop	ebx
-
 
2033
 
-
 
2034
	mov	ecx,eax
-
 
2035
	add	ecx,[top_ofs]
-
 
2036
	shl	ecx,16
-
 
2037
	mov	cx,word[vscrl_size]
-
 
2038
	add	ecx,(SCRLW+1)*65536
-
 
2039
	mcall	13,,,[sc.work_button]
-
 
2040
	mov	ecx,[top_ofs-2]
-
 
2041
	mov	cx,word[vscrl_top]
-
 
2042
	add	ecx,(SCRLW+1)*65536
-
 
2043
	mov	edx,[color_tbl+4*5]
-
 
2044
	or	cx,cx
-
 
2045
	jle	@f
-
 
2046
	mcall
-
 
2047
    @@:
-
 
2048
	mov	ecx,[top_ofs]
-
 
2049
	add	ecx,[vscrl_top]
-
 
2050
	add	ecx,[vscrl_size]
-
 
2051
	add	ecx,SCRLW+1
-
 
2052
	mov	di,cx
-
 
2053
	shl	ecx,16
-
 
2054
	mov	cx,word[bot_ofs]
-
 
2055
	sub	cx,di
-
 
2056
	sub	cx,(SCRLW+1)*2
-
 
2057
	jle	@f
-
 
2058
	mcall
-
 
2059
    @@:
-
 
2060
;-------------------------------
-
 
2061
@^
-
 
2062
	pushad
-
 
2063
	mov	eax,ebx
-
 
2064
	shr	eax,16
-
 
2065
	mov	bx,ax
-
 
2066
	add	ebx,0x00010001
-
 
2067
	mov	ecx,[top_ofs]
-
 
2068
	add	ecx,[vscrl_top]
-
 
2069
	add	ecx,SCRLW+1
-
 
2070
	mov	eax,ecx
-
 
2071
	shl	ecx,16
-
 
2072
	add	eax,[vscrl_size]
-
 
2073
	dec	eax
-
 
2074
	add	ecx,eax
-
 
2075
	mov	edx,[sc.work_button]
-
 
2076
	add	edx,0x00202020
-
 
2077
	mcall	38
-
 
2078
	add	ebx,(SCRLW-2)*65536+(SCRLW-2)
-
 
2079
	mov	edx,[sc.work_button]
-
 
2080
	sub	edx,0x00202020
-
 
2081
	mcall	38
-
 
2082
	sub	ebx,(SCRLW-2)*65536
-
 
2083
	mov	ax,cx
-
 
2084
	shl	ecx,16
-
 
2085
	mov	cx,ax
-
 
2086
	mcall	38
-
 
2087
	mov	eax,[vscrl_size-2]
-
 
2088
	mov	ax,word[vscrl_size]
-
 
2089
	sub	eax,0x00010001
-
 
2090
	sub	ecx,eax
-
 
2091
	mov	edx,[sc.work_button]
-
 
2092
	add	edx,0x00202020
-
 
2093
	mcall	38
-
 
2094
	popad
-
 
2095
^@
-
 
2096
;-------------------------------
-
 
2097
	mov	eax,ebx
-
 
2098
	shr	eax,16
-
 
2099
	add	bx,ax
-
 
2100
	mov	ecx,[top_ofs-2]
-
 
2101
	mov	cx,word[top_ofs]
-
 
2102
	add	ecx,SCRLW*65536+SCRLW
-
 
2103
	mcall	38,,,[sc.work_text]
-
 
2104
	mov	ecx,[bot_ofs-2]
-
 
2105
	mov	cx,word[bot_ofs]
-
 
2106
	sub	ecx,(SCRLW*2+2)*65536+(SCRLW*2+2)
-
 
2107
	mcall
-
 
2108
	rol	ebx,16
-
 
2109
	push	bx
-
 
2110
	rol	ebx,16
-
 
2111
	pop	bx
-
 
2112
	mov	ecx,[top_ofs-2]
-
 
2113
	mov	cx,word[bot_ofs]
-
 
2114
	add	ecx,-2
-
 
2115
	mcall
-
 
2116
;--------------------------------------------------------------------------
-
 
2117
	mov	ebx,5*65536+SCRLW-1
-
 
2118
	mov	ecx,[bot_ofs]
-
 
2119
	shl	ecx,16
-
 
2120
	add	ecx,(-SCRLW)*65536+SCRLW-2
-
 
2121
	mcall	8,,,'LT',[sc.work_button]
-
 
2122
	pushad
-
 
2123
	push	0x1B
-
 
2124
	shr	ecx,16
-
 
2125
	mov	bx,cx
-
 
2126
	add	ebx,(SCRLW/2-3)*65536+SCRLW/2-4
-
 
2127
	mcall	4,,[sc.work_button_text],esp,1
-
 
2128
	add	esp,4
-
 
2129
	popad
-
 
2130
	mov	ebx,[p_info.x_size]
-
 
2131
	shl	ebx,16
-
 
2132
	add	ebx,(-SCRLW*2-5)*65536+SCRLW
-
 
2133
	mcall	,,,'RT'
-
 
2134
	pushad
-
 
2135
	push	0x1A
-
 
2136
	shr	ecx,16
-
 
2137
	mov	bx,cx
-
 
2138
	add	ebx,(SCRLW/2-2)*65536+SCRLW/2-4
-
 
2139
	mcall	4,,[sc.work_button_text],esp,1
-
 
2140
	add	esp,4
-
 
2141
	popad
-
 
2142
	inc	ecx
-
 
2143
 
-
 
2144
	push	ecx
-
 
2145
	mov	eax,[columns]
-
 
2146
	mov	ebx,[scolumns]
-
 
2147
	mov	ecx,[left_col]
-
 
2148
	mov	edx,[p_info.x_size]
-
 
2149
	add	edx,-(SCRLW*3+10)
-
 
2150
	call	get_scroll_vars
-
 
2151
	mov	[hscrl_top],eax
-
 
2152
	mov	[hscrl_size],ebx
-
 
2153
	pop	ecx
-
 
2154
 
-
 
2155
	mov	ebx,eax
-
 
2156
	add	ebx,OLEFT+SCRLW
-
 
2157
	shl	ebx,16
-
 
2158
	mov	bx,word[hscrl_size]
-
 
2159
	mcall	13,,,[sc.work_button]
-
 
2160
	mov	ebx,(OLEFT+SCRLW)*65536
-
 
2161
	mov	bx,word[hscrl_top]
-
 
2162
	mcall	,,,[color_tbl+4*5]
-
 
2163
	mov	ebx,OLEFT+SCRLW-1
-
 
2164
	add	ebx,[hscrl_top]
-
 
2165
	add	ebx,[hscrl_size]
-
 
2166
	mov	di,bx
-
 
2167
	shl	ebx,16
-
 
2168
	mov	bx,word[p_info.x_size]
-
 
2169
	sub	bx,di
-
 
2170
	sub	bx,SCRLW*2+6
-
 
2171
	jle	@f
-
 
2172
	mcall
-
 
2173
    @@:
-
 
2174
	mov	eax,ebx
-
 
2175
	shr	eax,16
-
 
2176
	add	bx,ax
-
 
2177
	mov	ecx,[bot_ofs-2]
-
 
2178
	mov	cx,word[bot_ofs]
-
 
2179
	sub	ecx,SCRLW*65536+2
-
 
2180
	mcall	38,,,[sc.work_text]
-
 
2181
	mov	ebx,[p_info.x_size-2]
-
 
2182
	mov	bx,word[p_info.x_size]
-
 
2183
	sub	ebx,(SCRLW*2+6)*65536+(SCRLW*2+6)
-
 
2184
	mcall
-
 
2185
	mov	ebx,[p_info.x_size]
-
 
2186
	add	ebx,5*65536-5
-
 
2187
	mov	ecx,[bot_ofs-2]
-
 
2188
	mov	cx,word[bot_ofs]
-
 
2189
	sub	ecx,(SCRLW+1)*65536+(SCRLW+1)
-
 
2190
	mcall
-
 
2191
;--------------------------------------------------------------------------
-
 
2192
 
428
func set_optimal_fill
2193
.exit:
429
        mov     al,OPTS_OPTIMSAVE
Line 2194... Line -...
2194
	popad
-
 
2195
	ret
430
        call    set_opt
2196
endf
-
 
2197
 
-
 
2198
;--------------------------------------------
431
        ret
2199
func get_scroll_vars
-
 
2200
;--------------------------------------------
-
 
2201
; Input:
-
 
2202
;  EAX = maximum data size      (units)
-
 
2203
;  EBX = visible data size      (units)
-
 
2204
;  ECX = current data position  (units)
-
 
2205
;  EDX = scrolling area size    (pixels)
-
 
2206
; Output:
-
 
2207
;  EAX = srcoller offset        (pixels)
432
endf
2208
;  EBX = scroller size          (pixels)
-
 
2209
;--------------------------------------------
-
 
2210
	push	eax ebx ecx edx
-
 
2211
;       sub     eax,ebx
-
 
2212
	mov	esi,eax
-
 
2213
	mov	eax,edx
-
 
2214
	mul	ebx
-
 
2215
	idiv	esi
-
 
2216
	cmp	eax,[esp]
-
 
2217
	jae	.null
-
 
2218
	cmp	eax,AMINS
-
 
2219
	jae	@f
-
 
2220
	neg	eax
-
 
2221
	add	eax,AMINS
-
 
2222
	sub	[esp],eax
-
 
2223
	mov	eax,AMINS
-
 
2224
    @@: mov	[esp+8],eax	; scroller size
-
 
2225
	mov	eax,[esp]
-
 
2226
	mul	ecx
-
 
2227
	idiv	esi
-
 
2228
	mov	[esp+12],eax	; scroller offset
-
 
2229
	add	eax,[esp+8]
-
 
2230
	cmp	eax,[esp]
-
 
2231
	jbe	@f
433
 
2232
	dec	dword[esp+12]
-
 
2233
    @@:
-
 
2234
	pop	edx ecx ebx eax
-
 
2235
	ret
-
 
2236
  .null:
434
func set_auto_indents
Line 2237... Line -...
2237
	mov	dword[esp+8],0
-
 
2238
	mov	dword[esp+12],0
435
        mov     al,OPTS_AUTOINDENT
2239
	jmp	@b
-
 
2240
endf
-
 
2241
 
-
 
2242
;--------------------------------------------
-
 
2243
func get_next_part
-
 
2244
;--------------------------------------------
-
 
2245
; Input:
-
 
2246
;  ECX = current letter
-
 
2247
;  ESI = string
-
 
2248
; Output:
-
 
2249
;  ECX = color
-
 
2250
;  EDX = string
-
 
2251
;  ESI = length
-
 
2252
;--------------------------------------------
-
 
2253
	cmp	[asm_mode],0
-
 
2254
	je	.plain.text
-
 
2255
	xor	ebx,ebx
-
 
2256
	mov	edx,ecx
-
 
2257
	add	esi,ecx
-
 
2258
	mov	edi,symbols
-
 
2259
	mov	al,[esi]
-
 
2260
	cmp	al,';'
-
 
2261
	je	.comment
-
 
2262
	mov	ecx,symbols.size
-
 
2263
	repne	scasb
-
 
2264
	je	.symbol
-
 
2265
	cmp	al,'$'
-
 
2266
	jne	@f
-
 
2267
	mov	edi,symbols
-
 
2268
	mov	al,[esi+1]
-
 
2269
	mov	ecx,symbols.size
-
 
2270
	repne	scasb
-
 
2271
	je	.not_symbol
-
 
2272
	jmp	.number
-
 
2273
    @@: cmp	al,'0'
-
 
2274
	jb	@f
-
 
2275
	cmp	al,'9'
-
 
2276
	jbe	.number
-
 
2277
    @@: cmp	al,"'"
-
 
2278
	je	.string
-
 
2279
	cmp	al,'"'
-
 
2280
	je	.string
-
 
2281
  .not_symbol:
-
 
2282
	inc	ebx
-
 
2283
	inc	edx
-
 
2284
	cmp	edx,[cur_line_len];LINE_WIDTH
-
 
2285
	jge	@f
-
 
2286
	mov	edi,symbols
-
 
2287
	mov	al,[esi+ebx]
-
 
2288
	cmp	al,';'
-
 
2289
	je	@f
-
 
2290
	mov	ecx,symbols.size
-
 
2291
	repne	scasb
-
 
2292
	jne	.not_symbol
-
 
2293
    @@: mov	ecx,edx
-
 
2294
	mov	edx,esi
-
 
2295
	mov	esi,ebx
-
 
2296
	mov	eax,[color_tbl+4*0]
-
 
2297
	ret
-
 
2298
  .symbol:
-
 
2299
	inc	ebx
-
 
2300
	inc	edx
-
 
2301
	cmp	edx,[cur_line_len];LINE_WIDTH
-
 
2302
	jge	@f
-
 
2303
	mov	edi,symbols
-
 
2304
	mov	al,[esi+ebx]
-
 
2305
	mov	ecx,symbols.size
-
 
2306
	repne	scasb
-
 
2307
	je	.symbol
-
 
2308
    @@: mov	ecx,edx
-
 
2309
	mov	edx,esi
-
 
2310
	mov	esi,ebx
-
 
2311
	mov	eax,[color_tbl+4*4]
-
 
2312
	ret
-
 
2313
  .comment:
-
 
2314
	neg	edx
-
 
2315
	add	edx,[cur_line_len];LINE_WIDTH
-
 
2316
	xchg	edx,esi
-
 
2317
	mov	ecx,[cur_line_len];LINE_WIDTH
-
 
2318
	mov	eax,[color_tbl+4*3]
-
 
2319
	ret
-
 
2320
  .number:
-
 
2321
	inc	ebx
-
 
2322
	inc	edx
-
 
2323
	cmp	edx,[cur_line_len];LINE_WIDTH
-
 
2324
	jge	@f
-
 
2325
	mov	edi,symbols
-
 
2326
	mov	al,[esi+ebx]
-
 
2327
	cmp	al,';'
-
 
2328
	je	@f
-
 
2329
	mov	ecx,symbols.size
-
 
2330
	repne	scasb
-
 
2331
	jne	.number
-
 
2332
    @@: mov	ecx,edx
-
 
2333
	mov	edx,esi
-
 
2334
	mov	esi,ebx
-
 
2335
	mov	eax,[color_tbl+4*1]
-
 
2336
	ret
-
 
2337
  .string:
-
 
2338
	inc	ebx
-
 
2339
	inc	edx
-
 
2340
	cmp	edx,[cur_line_len];LINE_WIDTH
-
 
2341
	jge	@f
-
 
2342
	cmp	[esi+ebx],al
-
 
2343
	jne	.string
-
 
2344
	inc	ebx
-
 
2345
	inc	edx
-
 
2346
    @@:
-
 
2347
	mov	ecx,edx
-
 
2348
	mov	edx,esi
-
 
2349
	mov	esi,ebx
-
 
2350
	mov	eax,[color_tbl+4*2]
-
 
2351
	ret
-
 
2352
  .plain.text:
-
 
2353
	mov	edx,[cur_line_len];LINE_WIDTH
-
 
2354
	xchg	edx,esi
-
 
2355
	mov	ecx,[cur_line_len];LINE_WIDTH
-
 
2356
	mov	eax,[color_tbl+4*0]
-
 
2357
	ret
-
 
2358
endf
-
 
2359
 
-
 
2360
; ********************************************
-
 
2361
; ****************  SAVEFILE  ****************
-
 
2362
; ********************************************
-
 
2363
func save_file
-
 
2364
	mov	esi,0x80000	; 0x70000 = 448 Kbytes (maximum)
-
 
2365
	mov	edi,0x10000
-
 
2366
 
-
 
2367
  .new_string:
-
 
2368
	call	save_string
-
 
2369
	cmp	dword[esi],0
-
 
2370
	jne	.new_string
-
 
2371
	sub	edi,0x10000+2	; minus last CRLF
-
 
2372
;!      mov     [filelen],edi
-
 
2373
	cmp	byte[s_fname],'/'
-
 
2374
	je	.systree_save
-
 
2375
	mcall	33,s_fname,0x10000,edi,0;[filelen],0
-
 
2376
	test	eax,eax
-
 
2377
	je	.exit
436
        call    set_opt
2378
	call	file_not_found
-
 
2379
	jmp	.exit
-
 
2380
 
-
 
2381
  .systree_save:
-
 
2382
;!      mov     eax,[filelen]
-
 
2383
	mov	[f_info+8],edi ;! eax
-
 
2384
	mov	[f_info+0],1
-
 
2385
	mov	esi,s_fname
-
 
2386
	mov	edi,f_info.path
-
 
2387
	mov	ecx,PATHL
-
 
2388
	cld
-
 
2389
	rep	movsb
-
 
2390
	mcall	58,f_info
-
 
2391
 
-
 
2392
  .exit:
-
 
2393
	ret
-
 
2394
endf
-
 
2395
 
-
 
2396
func save_string
-
 
2397
	lodsd
-
 
2398
	mov	ecx,eax
-
 
2399
 
-
 
2400
    @@: cmp	byte[esi+ecx-1],' '
-
 
2401
	jne	@f
-
 
2402
	loop	@b
-
 
2403
    @@: jecxz	.endcopy
-
 
2404
	xor	edx,edx
-
 
2405
	mov	ebx,edx
-
 
2406
	mov	ah,dl
-
 
2407
 
-
 
2408
  .next_char:
-
 
2409
	mov	al,[esi+ebx]
-
 
2410
	inc	ebx
-
 
2411
	test	ah,00000001b
-
 
2412
	jnz	.char
-
 
2413
	cmp	al,'"'
-
 
2414
	jne	@f
-
 
2415
	xor	ah,00000100b
-
 
2416
	jmp	.char
-
 
2417
    @@: cmp	al,"'"
-
 
2418
	jne	@f
-
 
2419
	xor	ah,00000010b
-
 
2420
	jmp	.char
-
 
2421
    @@: test	ah,00000110b
-
 
2422
	jnz	.char
-
 
2423
	cmp	al,';'
-
 
2424
	jne	@f
-
 
2425
	test	ah,00000001b
-
 
2426
	jnz	.char
-
 
2427
	xor	ah,00000001b
-
 
2428
	jmp	.char
-
 
2429
    @@: cmp	al,' '
-
 
2430
	jne	.char
-
 
2431
	inc	edx
-
 
2432
	test	ebx,ATABW-1
-
 
2433
	jnz	@f
-
 
2434
	dec	edx
-
 
2435
	jle	.put
-
 
2436
	mov	al,9
-
 
2437
	xor	edx,edx
-
 
2438
	jmp	.put
-
 
2439
  .char:
-
 
2440
	or	edx,edx
-
 
2441
	jz	.put
-
 
2442
	push	ecx eax
-
 
2443
	mov	ecx,edx
-
 
2444
	mov	al,' '
-
 
2445
	rep	stosb
437
        ret
2446
	pop	eax ecx
-
 
2447
	xor	edx,edx
-
 
2448
  .put:
-
 
2449
	stosb
-
 
2450
    @@: loop	.next_char
-
 
2451
 
-
 
2452
  .endcopy:
-
 
2453
	mov	eax,0x0A0D
-
 
2454
	stosw
-
 
2455
	add	esi,[esi-4]
-
 
2456
	ret
-
 
2457
endf
-
 
2458
 
-
 
2459
; ********************************************
-
 
2460
; ****************  LOADFILE  ****************
-
 
2461
; ********************************************
-
 
2462
 
-
 
2463
func loadhdfile
-
 
2464
	mov	[f_info+0],0
-
 
2465
	mov	[f_info+8],300000/512
-
 
2466
	mov	esi,s_fname
-
 
2467
	mov	edi,f_info.path;pathfile_read
-
 
2468
	mov	ecx,PATHL
-
 
2469
	cld
-
 
2470
	rep	movsb
-
 
2471
	mcall	58,f_info ; fileinfo_read
-
 
2472
	xchg	eax,ebx
-
 
2473
	inc	eax
-
 
2474
	test	ebx,ebx
-
 
2475
	je	file_found
-
 
2476
	cmp	ebx,6		 ;// ATV driver fix (6 instead of 5)
-
 
2477
	je	file_found
-
 
2478
	call	file_not_found
-
 
2479
	ret
-
 
2480
endf
-
 
2481
 
-
 
2482
func loadfile
-
 
2483
	mcall	6,s_fname,0,16800,0x10000 ; 6 = open file
-
 
2484
	inc	eax	     ; eax = -1 -> file not found
-
 
2485
	jnz	file_found
-
 
2486
	call	file_not_found
-
 
2487
	ret
-
 
2488
 
-
 
2489
  file_found:
-
 
2490
	dec	eax
-
 
2491
	mov	[filesize],eax
-
 
2492
	mov	[lines],1
-
 
2493
	mov	[columns],0
-
 
2494
	mov	esi,0x10000
-
 
2495
	mov	edi,0x80000
-
 
2496
	mov	edx,eax
-
 
2497
 
-
 
2498
  .next_line:
-
 
2499
	mov	ebx,edi
-
 
2500
	add	edi,4
-
 
2501
  .next_char:
-
 
2502
	or	edx,edx
-
 
2503
	jle	.exit
-
 
2504
	lodsb
-
 
2505
	dec	edx
-
 
2506
	cmp	al,13
-
 
2507
	je	.CR
-
 
2508
	cmp	al,10
-
 
2509
	je	.LF
-
 
2510
	cmp	al,9
-
 
2511
	je	.TB
-
 
2512
	cmp	al,0
-
 
2513
	je	.exit
-
 
2514
	stosb
-
 
2515
	jmp	.next_char
-
 
2516
 
-
 
2517
  .exit:
-
 
2518
	mov	ecx,10
-
 
2519
	mov	al,' '
-
 
2520
	rep	stosb
-
 
2521
	lea	eax,[edi-4]
-
 
2522
	sub	eax,ebx
-
 
2523
	mov	[ebx],eax
-
 
2524
	mov	dword[ebx+eax+4],0
-
 
2525
	sub	eax,10
-
 
2526
	jnz	@f
-
 
2527
	inc	eax
-
 
2528
    @@: cmp	eax,[columns]
-
 
2529
	jbe	@f
-
 
2530
	mov	[columns],eax
-
 
2531
    @@: ret
-
 
2532
 
-
 
2533
  .CR:	cmp	byte[esi],10
-
 
2534
	jne	.LF
-
 
2535
	lodsb
-
 
2536
	dec	edx
-
 
2537
  .LF:	mov	ecx,10
-
 
2538
	mov	al,' '
-
 
2539
	rep	stosb
-
 
2540
	lea	eax,[edi-4]
-
 
2541
	sub	eax,ebx
-
 
2542
	mov	[ebx],eax
-
 
2543
	inc	[lines]
-
 
2544
	add	eax,-10
-
 
2545
	cmp	eax,[columns]
-
 
2546
	jbe	.next_line
-
 
2547
	mov	[columns],eax
-
 
2548
	jmp	.next_line
-
 
2549
 
-
 
2550
  .TB:	lea	eax,[edi-4]
-
 
2551
	sub	eax,ebx
-
 
2552
	mov	ecx,eax
-
 
2553
	add	ecx,ATABW
-
 
2554
	and	ecx,not(ATABW-1)
-
 
2555
	sub	ecx,eax
-
 
2556
	mov	al,' '
-
 
2557
	rep	stosb
-
 
2558
	jmp	.next_char
-
 
2559
 
-
 
2560
  file_not_found:
-
 
2561
	mcall	55,eax,error_beep   ; beep
-
 
2562
	mov	[lines],1	    ; open empty document
-
 
2563
	mov	[columns],1
-
 
2564
	xor	eax,eax
-
 
2565
	mov	[top_line],eax
-
 
2566
	mov	[posx],eax
-
 
2567
	mov	[posy],eax
-
 
2568
	mov	edi,0x80000+4
-
 
2569
	mov	ecx,10
-
 
2570
	mov	[edi-4],ecx
438
endf
2571
	mov	[edi+10],eax
439
 
Line 2572... Line -...
2572
	mov	al,' '
-
 
2573
	cld
-
 
2574
	rep	stosb
-
 
2575
	ret
-
 
2576
endf
440
func set_auto_braces
2577
 
-
 
2578
; *****************************
-
 
2579
; ******  WRITE POSITION ******
-
 
2580
; *****************************
-
 
2581
 
-
 
2582
func writepos
-
 
2583
	cmp	[do_not_draw],1  ; return if drawing is not permitted
-
 
2584
	jae	.exit
-
 
2585
	pusha
-
 
2586
	mov	eax,[posx]
-
 
2587
	inc	eax
-
 
2588
	mov	ebx,5
-
 
2589
	mov	ecx,10
-
 
2590
	mov	edi,htext2.pos1
-
 
2591
	cld
-
 
2592
	call	uint2strz
441
        mov     al,OPTS_AUTOBRACES
2593
	mov	eax,[posy]
-
 
2594
	inc	eax
-
 
2595
	mov	ebx,5
-
 
2596
	mov	edi,htext2.pos2
-
 
2597
	call	uint2strz
-
 
2598
	mov	eax,[lines]	; number of lines
-
 
2599
	mov	ebx,5
-
 
2600
	mov	edi,htext2.pos3
-
 
2601
	call	uint2strz
-
 
2602
	mov	ebx,5*65536+htext2.size*6
442
        call    set_opt
2603
	mov	ecx,[bot_ofs]
-
 
2604
	shl	ecx,16
-
 
2605
	add	ecx,ABTNH
-
 
2606
	mcall	13,,,[sc.work_graph] ; draw bar
-
 
2607
	mov	ebx,12*65536
-
 
2608
	mov	bx,word[bot_ofs]
443
        ret
2609
	add	ebx,(ABTNH+2)/2-4
444
endf
Line 2610... Line 445...
2610
	mcall	4,,[sc.work_button_text],htext2,htext2.size ; write position
445
 
2611
	popa
-
 
2612
 
-
 
2613
  .exit:
-
 
2614
	ret
-
 
2615
endf
-
 
2616
 
-
 
2617
;-----------------------------------------------------------------------------
-
 
2618
func uint2strz ;//////////////////////////////////////////////////////////////
-
 
2619
;-----------------------------------------------------------------------------
-
 
2620
	dec	ebx
-
 
2621
	jz	@f
-
 
2622
	xor	edx,edx
-
 
2623
	div	ecx
-
 
2624
	push	edx
-
 
2625
	call	uint2strz
-
 
2626
	pop	eax
-
 
2627
    @@: cmp	al,10
-
 
2628
	sbb	al,$69
-
 
2629
	das
-
 
2630
	stosb
-
 
2631
	ret
-
 
2632
endf
-
 
2633
 
-
 
2634
; ****************************
-
 
2635
; ******* READ STRING ********
-
 
2636
; ****************************
-
 
2637
 
-
 
2638
func read_string
-
 
2639
	cmp	al,5
-
 
2640
	jz	.f1
-
 
2641
	cmp	al,51
-
 
2642
	jz	.f2
-
 
2643
	ret
-
 
2644
 
-
 
2645
  .f1:	mov	[addr],s_fname
-
 
2646
	mov	eax,[bot_ofs]
-
 
2647
	add	eax,ABTNH+2
-
 
2648
	mov	[ya],eax
-
 
2649
	push	0		; case insensitive
-
 
2650
	jmp	.rk
-
 
2651
  .f2:	mov	[addr],s_search
-
 
2652
	mov	eax,[bot_ofs]
-
 
2653
	add	eax,(ABTNH+2)*2
-
 
2654
	mov	[ya],eax
-
 
2655
	push	1		; case sensitive
-
 
2656
  .rk:
-
 
Line 2657... Line -...
2657
	mov	edi,[addr]
-
 
2658
	mov	ecx,PATHL
-
 
2659
	sub	ecx,[edi-4]
-
 
2660
	add	edi,[edi-4]
-
 
2661
	mov	al,$1C
-
 
2662
	cld
-
 
2663
	rep	stosb
-
 
2664
 
-
 
2665
	mov	edi,[addr]
-
 
2666
	mov	eax,[edi-4]
-
 
2667
	mov	[temp],eax
-
 
2668
	add	edi,eax
-
 
2669
	call	print_text
-
 
2670
	mcall	40,00000111b
-
 
2671
 
-
 
2672
  .waitev:
-
 
2673
 
-
 
2674
	mcall	10
-
 
2675
	cmp	eax,2
-
 
2676
	jne	.read_done
-
 
2677
	mcall	;2
-
 
2678
	shr	eax,8
-
 
2679
	cmp	al,13
446
func set_secure_sel
2680
	je	.read_done
-
 
2681
	cmp	al,8
-
 
2682
	jne	.nobs
-
 
2683
	cmp	edi,[addr]
-
 
2684
	je	.waitev
-
 
2685
	dec	[temp]
-
 
2686
	mov	eax,[addr]
-
 
2687
	dec	dword[eax-4]
-
 
2688
	sub	edi,1
447
        mov     al,OPTS_SECURESEL
2689
	mov	byte[edi],$1C
-
 
2690
	call	print_text
-
 
2691
	jmp	.waitev
-
 
2692
  .nobs:
-
 
2693
	movzx	ebx,al
-
 
2694
	sub	ebx,$20
-
 
2695
	jle	.waitev
-
 
2696
	cmp	byte[esp],0
-
 
2697
	jne	.keyok
-
 
2698
	sub	ebx,$40
-
 
2699
	jl	.keyok
-
 
2700
	add	al,[ebx+add_table]
-
 
2701
  .keyok:
448
        call    set_opt
2702
	mov	ecx,[addr]
-
 
2703
	add	ecx,PATHL
-
 
2704
	cmp	edi,ecx
-
 
2705
	jae	.waitev
-
 
2706
	mov	[edi],al
-
 
2707
	inc	[temp]
-
 
2708
	mov	eax,[addr]
-
 
2709
	inc	dword[eax-4]
-
 
2710
 
-
 
2711
	call	print_text
-
 
2712
	inc	edi
-
 
2713
	jmp	.waitev
-
 
2714
 
-
 
2715
  .read_done:
-
 
2716
	add	esp,4
-
 
2717
	mov	ecx,PATHL
-
 
2718
	sub	ecx,[temp]
-
 
2719
	mov	edi,[addr]
-
 
2720
	add	edi,[temp]
-
 
2721
	mov	al,' '
-
 
2722
	cld
449
        ret
2723
	rep	stosb
-
 
2724
	mov	[temp],987
-
 
2725
	call	print_text
-
 
2726
	mcall	40,00100111b
-
 
2727
	ret
-
 
2728
endf
-
 
2729
 
450
endf
2730
func print_text
-
 
2731
	pusha
-
 
2732
	mov	ebx,(LBTNW+5+2)*65536
451
 
2733
	mov	bx,word[p_info.x_size]
-
 
2734
	sub	bx,LBTNW+RBTNW+10+3
-
 
2735
	mov	ecx,[ya-2]
-
 
2736
	mov	cx,ABTNH+1
-
 
2737
	mcall	13,,,[sc.work]
-
 
2738
	mov	ebx,(LBTNW+5+2+4)*65536+ABTNH/2-3
-
 
2739
	add	ebx,[ya]
-
 
2740
	mov	eax,[p_info.x_size]
-
 
2741
	sub	eax,LBTNW+RBTNW+10+8
452
;-----------------------------------------------------------------------------
2742
	push	eax
-
 
2743
	cdq
-
 
2744
	mov	ecx,6
-
 
2745
	div	ecx
-
 
2746
	cmp	eax,PATHL
-
 
2747
	jbe	@f
-
 
2748
	mov	eax,PATHL
-
 
2749
    @@: mov	esi,eax
453
 
2750
	mcall	4,,[color_tbl+0],[addr]
-
 
2751
 
454
include 'tp-draw.asm'
2752
	mov	eax,[ya]
-
 
2753
	mov	ebx,eax
-
 
2754
	add	eax,ABTNH/2-6
-
 
2755
	shl	eax,16
-
 
2756
	add	eax,ebx
-
 
2757
	add	eax,ABTNH/2-6+11
-
 
2758
	mov	ecx,eax
-
 
2759
	imul	eax,[temp],6
455
include 'tp-key.asm'
2760
	pop	ebx
-
 
2761
	cmp	eax,ebx
-
 
2762
	jae	@f
-
 
2763
	add	eax,LBTNW+5+2+4
-
 
2764
	mov	ebx,eax
-
 
2765
	shl	eax,16
456
;include 'tp-key2.asm'
Line 2766... Line 457...
2766
	add	ebx,eax
457
include 'tp-butto.asm'
2767
	mcall	38,,,[color_tbl+0]
458
include 'tp-mouse.asm'
2768
 
459
include 'tp-files.asm'
Line 2769... Line 460...
2769
    @@: popa
460
include 'tp-commo.asm'
2770
	ret
461
include 'tp-dialo.asm'
2771
endf
462
;include 'tp-find.asm'
2772
 
463
include 'tp-popup.asm'
-
 
464
include 'tp-tbox.asm'
Line 2773... Line 465...
2773
include 'helpwnd.asm'
465
 
2774
 
466
;-----------------------------------------------------------------------------
2775
;-----------------------------------------------------------------------------
467
section @DATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
 
468
;-----------------------------------------------------------------------------
2776
section @DATA ;///////////////////////////////////////////////////////////////
469
 
-
 
470
;addr       dd s_fname  ; address of input string
2777
;-----------------------------------------------------------------------------
471
;temp       dd 0xABCD   ; used in read_string
2778
 
472
vscrl_capt dd -1
2779
addr	   dd s_fname  ; address of input string
473
hscrl_capt dd -1
-
 
474
body_capt  dd -1
-
 
475
 
-
 
476
key0 db \
-
 
477
  0x00,0x00,0x02,0x03,0x04,0x05,0x06,0x07,\
-
 
478
  0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x00,0x00,\
-
 
479
  0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,\
-
 
480
  0x18,0x19,0x1A,0x1B,0x00,0x00,0x1E,0x1F,\
-
 
481
  0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,\
-
 
482
  0x28,0x29,0x00,0x2B,0x2C,0x2D,0x2E,0x2F,\
-
 
483
  0x30,0x31,0x32,0x33,0x34,0x35,0x00,0x00,\
-
 
484
  0x00,0x39,0x00,0x00,0x00,0x00,0x00,0x00
-
 
485
  times 12*16 db 0x00
-
 
486
 
-
 
487
accel_table dd                      \
-
 
488
  0x0000000E,key.bkspace           ,\ ; BackSpace
-
 
489
  0x0000000F,key.tab               ,\ ; Tab
-
 
490
  0x0000001C,key.return            ,\ ; Return
-
 
491
  0x0000003D,key.f3                ,\ ; F3
-
 
492
  0x00000043,key.f9                ,\ ; F9
-
 
493
  0x00000147,key.home              ,\ ; Home
-
 
494
  0x00000148,key.up                ,\ ; Up
-
 
495
  0x00000149,key.pgup              ,\ ; PageUp
-
 
496
  0x0000014B,key.left              ,\ ; Left
-
 
497
  0x0000014D,key.right             ,\ ; Right
-
 
498
  0x0000014F,key.end               ,\ ; End
-
 
499
  0x00000150,key.down              ,\ ; Down
-
 
500
  0x00000151,key.pgdn              ,\ ; PageDown
-
 
501
  0x00000152,key.ins               ,\ ; Insert
-
 
502
  0x00000153,key.del               ,\ ; Delete
-
 
503
  0x00010147,key.shift_home        ,\ ; Shift+Home
-
 
504
  0x00010148,key.shift_up          ,\ ; Shift+Up
-
 
505
  0x00010149,key.shift_pgup        ,\ ; Shift+PageUp
-
 
506
  0x0001014B,key.shift_left        ,\ ; Shift+Left
-
 
507
  0x0001014D,key.shift_right       ,\ ; Shift+Right
-
 
508
  0x0001014F,key.shift_end         ,\ ; Shift+End
-
 
509
  0x00010150,key.shift_down        ,\ ; Shift+Down
-
 
510
  0x00010151,key.shift_pgdn        ,\ ; Shift+PageDown
-
 
511
  0x00010153,key.del               ,\ ; Shift+Delete
-
 
512
  0x00020015,key.ctrl_y            ,\ ; Ctrl+Y
-
 
513
  0x00020018,key.ctrl_o            ,\ ; Ctrl+O
-
 
514
  0x0002001E,key.ctrl_a            ,\ ; Ctrl+A
-
 
515
  0x0002001F,key.ctrl_s            ,\ ; Ctrl+S
-
 
516
  0x00020020,key.ctrl_d            ,\ ; Ctrl+D
-
 
517
  0x00020021,key.ctrl_f            ,\ ; Ctrl+F
-
 
518
  0x00020022,key.ctrl_g            ,\ ; Ctrl+G
-
 
519
  0x00020023,key.ctrl_h            ,\ ; Ctrl+H
-
 
520
\;0x00020026,key.ctrl_l            ,\ ; Ctrl+L
-
 
521
  0x0002002D,key.ctrl_x            ,\ ; Ctrl+X
-
 
522
  0x0002002E,key.ctrl_c            ,\ ; Ctrl+C
-
 
523
  0x0002002F,key.ctrl_v            ,\ ; Ctrl+V
-
 
524
  0x00020031,key.ctrl_n            ,\ ; Ctrl+N
-
 
525
  0x00020043,key.ctrl_f9           ,\ ; Ctrl+F9
-
 
526
  0x00020147,key.ctrl_home         ,\ ; Ctrl+Home
-
 
527
\;0x00020148,key.ctrl_up           ,\ ; Ctrl+Up
-
 
528
  0x00020149,key.ctrl_pgup         ,\ ; Ctrl+PageUp
-
 
529
  0x0002014B,key.ctrl_left         ,\ ; Ctrl+Left
-
 
530
  0x0002014D,key.ctrl_right        ,\ ; Ctrl+Right
-
 
531
  0x0002014F,key.ctrl_end          ,\ ; Ctrl+End
-
 
532
\;0x00020150,key.ctrl_down         ,\ ; Ctrl+Down
-
 
533
  0x00020151,key.ctrl_pgdn         ,\ ; Ctrl+PageDown
-
 
534
  0x00020153,key.del               ,\ ; Ctrl+Del
-
 
535
  0x0003001F,key.shift_ctrl_s      ,\ ; Shift+Ctrl+S
-
 
536
  0x00030147,key.shift_ctrl_home   ,\ ; Shift+Ctrl+Home
-
 
537
\;0x00030148,key.shift_ctrl_up     ,\ ; Shift+Ctrl+Up
-
 
538
  0x00030149,key.shift_ctrl_pgup   ,\ ; Shift+Ctrl+PageUp
-
 
539
  0x0003014B,key.shift_ctrl_left   ,\ ; Shift+Ctrl+Left
-
 
540
  0x0003014D,key.shift_ctrl_right  ,\ ; Shift+Ctrl+Right
-
 
541
  0x0003014F,key.shift_ctrl_end    ,\ ; Shift+Ctrl+End
-
 
542
\;0x00030150,key.shift_ctrl_down   ,\ ; Shift+Ctrl+Down
-
 
543
  0x00030151,key.shift_ctrl_pgdn   ,\ ; Shift+Ctrl+PageDown
-
 
544
  0x0004002D,key.alt_x             ,\ ; Alt+X
-
 
545
  0
-
 
546
 
-
 
547
accel_table_textbox dd              \
-
 
548
\;0x00000001,key.tb.escape         ,\ ; Escape
-
 
549
  0x0000000E,key.tb.bkspace        ,\ ; BackSpace
-
 
550
\;0x0000000F,key.tb.tab            ,\ ; Tab
-
 
551
\;0x0000001C,key.tb.return         ,\ ; Return
-
 
552
  0x00000147,key.tb.home           ,\ ; Home
-
 
553
  0x0000014B,key.tb.left           ,\ ; Left
-
 
554
  0x0000014D,key.tb.right          ,\ ; Right
-
 
555
  0x0000014F,key.tb.end            ,\ ; End
-
 
556
  0x00000153,key.tb.del            ,\ ; Delete
-
 
557
  0x00010147,key.tb.shift_home     ,\ ; Shift+Home
-
 
558
  0x0001014B,key.tb.shift_left     ,\ ; Shift+Left
-
 
559
  0x0001014D,key.tb.shift_right    ,\ ; Shift+Right
-
 
560
  0x0001014F,key.tb.shift_end      ,\ ; Shift+End
-
 
561
  0x00010153,key.tb.del            ,\ ; Shift+Del
-
 
562
  0
-
 
563
 
-
 
564
accel_table2 dd            \
-
 
565
  1,btn.close_main_window ,\
-
 
566
\;10000,btn.compile       ,\
-
 
567
\;10001,btn.compile_run   ,\
-
 
568
\;10002,btn.debug_board   ,\
-
 
569
\;10003,btn.sysfuncs_txt  ,\
-
 
570
  'UP',btn.scroll_up      ,\
-
 
571
  'DN',btn.scroll_down    ,\
Line 2780... Line 572...
2780
temp	   dd 0xabc	; used in read_string
572
  'LT',btn.scroll_left    ,\
2781
vscrl_capt dd -1
573
  'RT',btn.scroll_right   ,\
2782
hscrl_capt dd -1
574
\;5,key.ctrl_o            ,\
2783
 
575
  0
Line 2797... Line 589...
2797
  times $30 db -$00
589
  times $30 db -$00
2798
  times $10 db -$50
590
  times $10 db -$50
2799
  times $04 db -$00,-$01
591
  times $04 db -$00,-$01
2800
  times $08 db -$00
592
  times $08 db -$00
Line 2801... Line 593...
2801
 
593
 
Line 2802... Line 594...
2802
error_beep	db 0xA0,0x30,0
594
;error_beep      db 0xA0,0x30,0
2803
 
595
 
Line 2804... Line 596...
2804
sz s_example,'README.TXT'
596
sz s_example,'EXAMPLE.ASM'
2805
sz s_still  ,'still'
-
 
Line 2806... Line 597...
2806
 
597
sz s_still  ,'still'
2807
;sz param_setup,<'LANG',0> ; parameter for SETUP
598
 
2808
param_setup db 'LANG',0
599
;sz param_setup,'LANG',0 ; parameter for SETUP
-
 
600
 
2809
 
601
sz fasm_filename   ,'FASM       '
-
 
602
sz debug_filename  ,'BOARD      '
-
 
603
sz tinypad_filename,'TINYPAD    '
Line 2810... Line 604...
2810
sz fasm_filename   ,'FASM       '
604
sz docpak_filename ,'DOCPAK     '
2811
sz debug_filename  ,'BOARD      '
605
;sz setup           ,'SETUP      ' ; to change keyboard layout
2812
sz tinypad_filename,'TINYPAD    '
606
 
Line 2813... Line 607...
2813
sz setup	   ,'SETUP      ' ; to change keyboard layout
607
sz sysfuncs_param,'g',0
2814
 
-
 
2815
lsz sysfuncs_filename,\
-
 
2816
  ru,<'SYSFUNCR.TXT',0>,\
-
 
2817
  en,<'SYSFUNCS.TXT',0>
-
 
2818
 
-
 
2819
sz htext,'TINYPAD'
-
 
2820
sz toolbar_btn_text,'COMPILE    RUN     BOARD   SYSFUNC'
-
 
2821
 
-
 
2822
lsz lstr,\
-
 
2823
  ru,<'   ”€‰‹ > ',' ‘’ŽŠ€ > '>,\
-
 
2824
  en,<'   FILE > ',' STRING > '>
-
 
2825
lsz rstr,\
-
 
2826
  ru,<' ‘Ž•€ˆ’œ ',' ‡€ƒ“‡ˆ’œ ',' Žˆ‘Š     '>,\
-
 
2827
  en,<' SAVE   '   ,' LOAD   '	 ,' SEARCH '   >
-
 
2828
 
-
 
2829
lsz htext2,\
-
 
2830
  ru,'Ž‡ˆ–ˆŸ 00000:00000   „‹ˆ€ 00000 ‘’ŽŠ',\
-
 
2831
  en,'POSITION 00000:00000   LENGTH 00000 LINES'
-
 
2832
if lang eq ru
-
 
2833
 htext2.pos1 = htext2+8
-
 
2834
 htext2.pos2 = htext2+14
-
 
Line 2835... Line 608...
2835
 htext2.pos3 = htext2+28
608
 
2836
else
609
lsz sysfuncs_filename,\
2837
 htext2.pos1 = htext2+9
610
  ru,<'SYSFUNCR.TXT',0>,\
2838
 htext2.pos2 = htext2+15
611
  en,<'SYSFUNCS.TXT',0>
Line 2854... Line 627...
2854
  ru,'  CTRL+F3 : ®¨áª',\
627
  ru,'  CTRL+F3 : ®¨áª',\
2855
  ru,'  CTRL+F4 : ‘®åà ­¨âì ä ©«',\
628
  ru,'  CTRL+F4 : ‘®åà ­¨âì ä ©«',\
2856
  ru,'  CTRL+F5 : ‚¢¥á⨠¨¬ï ä ©« ',\
629
  ru,'  CTRL+F5 : ‚¢¥á⨠¨¬ï ä ©« ',\
2857
  ru,'  CTRL+F6 : ‚¢¥á⨠áâப㠤«ï ¯®¨áª ',\
630
  ru,'  CTRL+F6 : ‚¢¥á⨠áâப㠤«ï ¯®¨áª ',\
2858
  ru,'  CTRL+F8 : ‘¬¥­¨âì à áª« ¤ªã ª« ¢¨ âãàë',\
631
  ru,'  CTRL+F8 : ‘¬¥­¨âì à áª« ¤ªã ª« ¢¨ âãàë',\
2859
  ru,'',\
632
\
2860
  en,'COMMANDS:',\
633
  en,'COMMANDS:',\
2861
  en,' ',\
634
  en,' ',\
2862
  en,'  CTRL+F1 : SHOW THIS WINDOW',\
635
  en,'  CTRL+F1 : SHOW THIS WINDOW',\
2863
  en,'  CTRL+S  : SELECT FIRST STRING TO COPY',\
636
  en,'  CTRL+S  : SELECT FIRST STRING TO COPY',\
2864
  en,'  CTRL+E  : SELECT LAST STRING TO COPY',\
637
  en,'  CTRL+E  : SELECT LAST STRING TO COPY',\
Line 2870... Line 643...
2870
  en,'  CTRL+F2 : LOAD FILE',\
643
  en,'  CTRL+F2 : LOAD FILE',\
2871
  en,'  CTRL+F3 : SEARCH',\
644
  en,'  CTRL+F3 : SEARCH',\
2872
  en,'  CTRL+F4 : SAVE FILE',\
645
  en,'  CTRL+F4 : SAVE FILE',\
2873
  en,'  CTRL+F5 : ENTER FILENAME',\
646
  en,'  CTRL+F5 : ENTER FILENAME',\
2874
  en,'  CTRL+F6 : ENTER SEARCH STRING',\
647
  en,'  CTRL+F6 : ENTER SEARCH STRING',\
2875
  en,'  CTRL+F8 : CHANGE KEYBOARD LAYOUT',\
648
  en,'  CTRL+F8 : CHANGE KEYBOARD LAYOUT'
2876
  en,''
649
db 0
2877
 
-
 
2878
lsz help_title,\
-
 
2879
  ru,'ŽŒŽ™œ',\
-
 
2880
  en,'TINYPAD HELP'
-
 
Line -... Line 650...
-
 
650
 
-
 
651
menubar_res main_menu,\
-
 
652
  ru,'” ©«'  ,popup_file   ,onshow.file   ,\
-
 
653
  ru,'à ¢ª ',popup_edit   ,onshow.edit   ,\
-
 
654
  ru,'®¨áª' ,popup_search ,onshow.search ,\
-
 
655
  ru,'‡ ¯ãáª',popup_run    ,onshow.run    ,\
-
 
656
  ru,'Ž¯æ¨¨' ,popup_options,onshow.options,\
-
 
657
\
-
 
658
  en,'File'   ,popup_file   ,onshow.file  ,\
-
 
659
  en,'Edit'   ,popup_edit   ,onshow.edit  ,\
-
 
660
  en,'Search' ,popup_search ,onshow.search,\
-
 
661
  en,'Run'    ,popup_run    ,onshow.run   ,\
-
 
662
  en,'Options',popup_options,onshow.options
-
 
663
 
-
 
664
popup_res popup_file,\
-
 
665
  ru,'®¢ë©'           ,'Ctrl+N',key.ctrl_n      ,\
-
 
666
  ru,'Žâªàëâì...'      ,'Ctrl+O',key.ctrl_o      ,\
-
 
667
  ru,'‘®åà ­¨âì'       ,'Ctrl+S',key.ctrl_s      ,\
-
 
668
  ru,'‘®åà ­¨âì ª ª...',''      ,key.shift_ctrl_s,\
-
 
669
  ru,'-'               ,''      ,0               ,\
-
 
670
  ru,'‚ë室'           ,'Alt+X' ,key.alt_x       ,\
-
 
671
\
-
 
672
  en,'New'       ,'Ctrl+N',key.ctrl_n      ,\
-
 
673
  en,'Open...'   ,'Ctrl+O',key.ctrl_o      ,\
-
 
674
  en,'Save'      ,'Ctrl+S',key.ctrl_s      ,\
-
 
675
  en,'Save as...',''      ,key.shift_ctrl_s,\
-
 
676
  en,'-'         ,''      ,0               ,\
-
 
677
  en,'Exit'      ,'Alt+X' ,key.alt_x
-
 
678
 
-
 
679
popup_res popup_edit,\
-
 
680
  ru,'‚ë१ âì'    ,'Ctrl+X',key.ctrl_x,\
-
 
681
  ru,'Š®¯¨à®¢ âì'  ,'Ctrl+C',key.ctrl_c,\
-
 
682
  ru,'‚áâ ¢¨âì'    ,'Ctrl+V',key.ctrl_v,\
-
 
683
  ru,'“¤ «¨âì'     ,''      ,key.del   ,\
-
 
684
  ru,'-'           ,''      ,0         ,\
-
 
685
  ru,'‚뤥«¨âì ¢áñ','Ctrl+A',key.ctrl_a,\
-
 
686
\
-
 
687
  en,'Cut'       ,'Ctrl+X',key.ctrl_x,\
-
 
688
  en,'Copy'      ,'Ctrl+C',key.ctrl_c,\
2881
 
689
  en,'Paste'     ,'Ctrl+V',key.ctrl_v,\
-
 
690
  en,'Delete'    ,''      ,key.del   ,\
-
 
691
  en,'-'         ,''      ,0         ,\
-
 
692
  en,'Select all','Ctrl+A',key.ctrl_a
-
 
693
 
-
 
694
popup_res popup_search,\
-
 
695
  ru,'¥à¥©â¨...' ,'Ctrl+G',key.ctrl_g,\
-
 
696
  ru,'-'          ,''      ,0         ,\
-
 
697
  ru,' ©â¨...'   ,'Ctrl+F',key.ctrl_f,\
-
 
698
  ru,' ©â¨ ¤ «¥¥','F3'    ,key.f3    ,\
-
 
699
  ru,'‡ ¬¥­¨âì...','Ctrl+H',key.ctrl_h,\
-
 
700
\
-
 
701
  en,'Position...','Ctrl+G',key.ctrl_g,\
-
 
702
  en,'-'          ,''      ,0         ,\
-
 
703
  en,'Find...'    ,'Ctrl+F',key.ctrl_f,\
-
 
704
  en,'Find next'  ,'F3'    ,key.f3    ,\
-
 
705
  en,'Replace...' ,'Ctrl+H',key.ctrl_h
-
 
706
 
-
 
707
popup_res popup_run,\
-
 
708
  ru,'‡ ¯ãáâ¨âì'        ,'F9'     ,key.f9           ,\
-
 
709
  ru,'Š®¬¯¨«¨à®¢ âì'    ,'Ctrl+F9',key.ctrl_f9      ,\
-
 
710
  ru,'-'                ,''       ,0                ,\
-
 
711
  ru,'„®áª  ®â« ¤ª¨'    ,''       ,open_debug_board ,\
-
 
712
  ru,'‘¨á⥬­ë¥ ä㭪樨',''       ,open_sysfuncs_txt,\
-
 
713
\
-
 
714
  en,'Run'              ,'F9'     ,key.f9           ,\
-
 
715
  en,'Compile'          ,'Ctrl+F9',key.ctrl_f9      ,\
-
 
716
  en,'-'                ,''       ,0                ,\
-
 
717
  en,'Debug board'      ,''       ,open_debug_board ,\
-
 
718
  en,'System functions' ,''       ,open_sysfuncs_txt
-
 
719
 
-
 
720
popup_res popup_options,\
-
 
721
  ru,'‚­¥è­¨© ¢¨¤...'        ,'',0,\
-
 
722
  ru,'-'                     ,'',0,\
-
 
723
  ru,'¥§®¯ á­®¥ ¢ë¤¥«¥­¨¥'  ,'',set_secure_sel,\
-
 
724
  ru,'€¢â®¬ â¨ç¥áª¨¥ ᪮¡ª¨' ,'',set_auto_braces,\
-
 
725
  ru,'€¢â®¬ â¨ç¥áª¨© ®âáâã¯' ,'',set_auto_indents,\
-
 
726
  ru,'“¬­ ï â ¡ã«ïæ¨ï'       ,'',0,\
-
 
727
  ru,'Ž¯â¨¬ «ì­®¥ á®åà ­¥­¨¥','',set_optimal_fill,\
-
 
728
  ru,'-'                     ,'',0,\
-
 
729
  ru,'®¬¥à  áâப'          ,'',set_line_numbers,\
-
 
730
\
-
 
731
  en,'Appearance...'         ,'',0,\
-
 
732
  en,'-'                     ,'',0,\
-
 
733
  en,'Secure selection'      ,'',set_secure_sel,\
-
 
734
  en,'Automatic brackets'    ,'',set_auto_braces,\
-
 
735
  en,'Automatic indents'     ,'',set_auto_indents,\
-
 
736
  en,'Smart tabulation'      ,'',0,\
-
 
737
  en,'Optimal fill on saving','',set_optimal_fill,\
-
 
738
  en,'-'                     ,'',0,\
-
 
739
  en,'Line numbers'          ,'',set_line_numbers
-
 
740
 
-
 
741
lsz s_modified,\
-
 
742
  ru,'ˆ§¬¥­¥­®',\
-
 
743
  en,'Modified'
-
 
744
 
-
 
745
lsz s_2filename,\
-
 
746
  ru,'ˆ¬ï ä ©« :',\
-
 
747
  en,'Filename:'
-
 
748
lsz s_2open,\
-
 
749
  ru,'Žâªàëâì',\
-
 
750
  en,'Open'
-
 
751
lsz s_2save,\
-
 
752
  ru,'‘®åà ­¨âì',\
-
 
753
  en,'Save'
-
 
754
lsz s_2find,\
-
 
755
  ru,' ©â¨',\
-
 
756
  en,'Find'
-
 
757
db ':'
-
 
758
lsz s_2replace,\
-
 
759
  ru,'‡ ¬¥­¨âì',\
-
 
760
  en,'Replace'
-
 
761
db ':'
-
 
762
lsz s_2cancel,\
-
 
763
  ru,'Žâ¬¥­ ',\
Line 2882... Line -...
2882
sz symbols,'#&*\:/<>|{}()[]=+-, '; %.'
-
 
2883
 
764
  en,'Cancel'
2884
align 4
-
 
2885
label f_info dword
-
 
2886
    dd	?
-
 
2887
    dd	0
-
 
2888
    dd	?
-
 
2889
    dd	0x10000
-
 
2890
    dd	0x70000
765
 
Line 2891... Line 766...
2891
.path:
766
sz symbols_ex,';?.%"',"'"
Line -... Line 767...
-
 
767
sz symbols   ,'#&*\:/<>|{}()[]=+-, '
-
 
768
 
2892
    times PATHL+1 db ?
769
TINYPAD_END:     ; end of file
2893
 
770
 
2894
TINYPAD_END:	 ; end of file
771
self_path rb PATHL
Line -... Line 772...
-
 
772
 
-
 
773
;-----------------------------------------------------------------------------
-
 
774
section @UDATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
 
775
;-----------------------------------------------------------------------------
-
 
776
 
-
 
777
f_info.length dd ?
2895
 
778
f_info dd ?,?,?,?,?;?,0,?,AREA_TEMP,AREA_EDIT-AREA_TEMP
2896
;-----------------------------------------------------------------------------
779
 
-
 
780
f_info.path:
-
 
781
    times PATHL+1 db ?
2897
section @UDATA ;//////////////////////////////////////////////////////////////
782
 
2898
;-----------------------------------------------------------------------------
783
pos.x         dd ?    ; global X position (cursor)
2899
 
784
pos.y         dd ?    ; global Y position (cursor)
2900
posx	      dd ?    ; global X position (text cursor)
785
sel.x         dd ?    ; global X position (selection start)
2901
posy	      dd ?    ; global Y position (text cursor)
786
sel.y         dd ?    ; global Y position (selection start)
2902
lines	      dd ?    ; number of lines in file
787
lines         dd ?    ; number of lines in file
-
 
788
lines.scr     dd ?    ; number of lines on the screen
-
 
789
columns       dd ?    ; number of columns in file
2903
slines	      dd ?    ; number of lines on the screen
790
columns.scr   dd ?    ; number of columns on the screen
2904
columns       dd ?    ; number of columns in file
791
top_ofs       dd ?    ; height occupied by top buttons
2905
scolumns      dd ?    ; number of columns on the screen
792
bot_ofs       dd ?    ; height occupied by bottom buttons
2906
top_ofs       dd ?    ; height occupied by top buttons
793
              dw ?
2907
bot_ofs       dd ?    ; height occupied by bottom buttons
794
left_ofs      dd ?    ;
Line 2914... Line 801...
2914
skinh	      dd ?    ; skin height
801
skinh         dd ?    ; skin height
2915
__rc	      dd ?,?,?,?
802
__rc          dd ?,?,?,?
2916
;filelen       dd ?    ; file size (on save) ???
803
;filelen       dd ?    ; file size (on save) ???
2917
filesize      dd ?    ; file size (on load) ???
804
filesize      dd ?    ; file size (on load) ???
2918
ya	      dd ?    ; for read_string
805
ya            dd ?    ; for read_string
2919
copy_start    dd ?    ; first line for copying (Ctrl+S)
806
;copy_start    dd ?    ; first line for copying (Ctrl+S)
2920
copy_count    dd ?    ; number of lines for copying (Ctrl+E)
807
copy_count    dd ?    ; number of lines for copying (Ctrl+E)
2921
copy_size     dd ?    ; size of data to copy
808
copy_size     dd ?    ; size of data to copy
2922
s_title.size  dd ?    ; caption length
809
s_title.size  dd ?    ; caption length
Line -... Line 810...
-
 
810
 
-
 
811
draw_blines   dd ?    ; last line to draw
2923
 
812
 
-
 
813
cur_line_len  dd ?
-
 
814
h_popup       dd ?
-
 
815
bot_dlg_handler dd ?
-
 
816
 
-
 
817
sel.begin.x   dd ?
-
 
818
sel.begin.y   dd ?
-
 
819
sel.end.x     dd ?
-
 
820
sel.end.y     dd ?
-
 
821
sel.selected  db ?
-
 
822
 
Line 2924... Line 823...
2924
cur_line_len  dd ?
823
in_sel        db ?
2925
 
824
 
2926
asm_mode      db ?    ; ASM highlight?
825
asm_mode      db ?    ; ASM highlight?
-
 
826
do_not_draw   db ?    ; draw top and bottom buttons?
Line 2927... Line 827...
2927
do_not_draw   db ?    ; draw top and bottom buttons?
827
main_closed   db ?    ; main window closed?
2928
main_closed   db ?    ; main window closed? (to close help window)
828
tb_casesen    db ?    ; focused textbox is case-sensitive?
2929
 
829
 
2930
align 4
830
align 4
2931
s_fname.size  dd ?
831
s_fname.size  dd ?
2932
s_fname       rb PATHL+1
832
s_fname       rb PATHL+1
Line 2933... Line 833...
2933
align 4
833
align 4
-
 
834
s_search.size dd ?
-
 
835
s_search      rb PATHL+1
-
 
836
 
-
 
837
s_title       rb PATHL+11  ; window caption
-
 
838
 
-
 
839
chr db ?
-
 
840
ext db ?
-
 
841
shi dd ?
-
 
842
 
-
 
843
align 4
-
 
844
cl_3d_normal dd ?
-
 
845
cl_3d_pushed dd ?
-
 
846
cl_3d_outset dd ?
-
 
847
cl_3d_inset  dd ?
-
 
848
cl_3d_grayed dd ?
-
 
849
 
-
 
850
tb_opensave  TBOX
-
 
851
tb_find      TBOX
-
 
852
tb_replace   TBOX
-
 
853
tb_gotorow   TBOX
-
 
854
tb_gotocol   TBOX
-
 
855
 
-
 
856
focused_tb   dd ?
-
 
857
 
-
 
858
key1 rb 256
-
 
859
 
-
 
860
mst  db ?
-
 
861
mst2 db ?
-
 
862
mev  db ?
-
 
863
mouse_captured  db ?
-
 
864
just_from_popup db ?
-
 
865
 
-
 
866
bot_mode db ?
-
 
867
 
-
 
868
modified db ?
-
 
869
 
Line 2934... Line 870...
2934
s_search.size dd ?
870
align 4
2935
s_search      rb PATHL+1
871
 
2936
 
872
bot_dlg_height dd ?
Line 2937... Line 873...
2937
s_title       rb 256  ; window caption
873
bot_dlg_mode2  db ?
Line 2938... Line 874...
2938
 
874
 
-
 
875
;-----------------------------------------------------------------------------
2939
;-----------------------------------------------------------------------------
876
section @PARAMS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2940
section @PARAMS ;/////////////////////////////////////////////////////////////
877
;-----------------------------------------------------------------------------
-
 
878
 
-
 
879
fasm_parameters:
-
 
880
 
-
 
881
p_info  process_information
-
 
882
p_info2 process_information
-
 
883
sc      system_colors
-
 
884
 
-
 
885
diff16 'Main memory size',0,$
-
 
886
 
-
 
887
MAIN_STACK  = 0x0000FFF0
-
 
888
POPUP_STACK = 0x0000EFF0
-
 
889
 
-
 
890
AREA_TEMP   = 0x00010000 ; 0x00010000
-
 
891
AREA_EDIT   = 0x000C0000 ; 0x00080000
-
 
892
AREA_TEMP2  = 0x00190000 ; 0x002E0000
-
 
893
AREA_CBUF   = 0x001A0000 ; 0x002F0000
-
 
894
AREA_ENDMEM = 0x001B0000 ; 0x00300000
-
 
895
 
-
 
896
diff10 'Header+options size',0,@CODE
-
 
897
diff10 'Load area size',AREA_TEMP,AREA_EDIT
-
 
898
diff10 'Edit area size',AREA_EDIT,AREA_TEMP2
-
 
899
diff10 'Total memory usage',0,AREA_ENDMEM
-
 
900
 
-
 
901
;store dword '/hd/' at tb_opensave.text+4*0