Subversion Repositories Kolibri OS

Rev

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

Rev 311 Rev 327
1
;-----------------------------------------------------------------------------
1
;-----------------------------------------------------------------------------
2
; project name:      TINYPAD
2
; project name:      TINYPAD
3
; compiler:          flat assembler 1.67.18
3
; compiler:          flat assembler 1.67.18
4
; memory to compile: 3.0/9.0 MBytes (without/with size optimizations)
4
; memory to compile: 3.0/9.0 MBytes (without/with size optimizations)
5
; version:           4.0.4
5
; version:           4.0.4
6
; last update:       2007-02-01 (Feb 01, 2007)
6
; last update:       2007-02-08 (Feb 08, 2007)
7
; minimal kernel:    revision #270 (svn://kolibrios.org/kernel)
7
; minimal kernel:    revision #270 (svn://kolibrios.org/kernel)
8
;-----------------------------------------------------------------------------
8
;-----------------------------------------------------------------------------
9
; originally by:     Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi
9
; originally by:     Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi
10
; maintained by:     Mike Semenyako          >> mike.dld@gmail.com
10
; maintained by:     Mike Semenyako          >> mike.dld@gmail.com
11
;                    Ivan Poddubny           >> ivan-yar@bk.ru
11
;                    Ivan Poddubny           >> ivan-yar@bk.ru
12
;-----------------------------------------------------------------------------
12
;-----------------------------------------------------------------------------
13
; TODO (4.1.0):
13
; TODO (4.1.0):
14
;   - optimize drawing (reduce flickering)
14
;   - optimize drawing (reduce flickering)
15
;   - add vertical selection, undo, goto position, overwrite mode
15
;   - add vertical selection, undo, goto position, overwrite mode
16
;   - improve window drawing with small dimensions
16
;   - improve window drawing with small dimensions
17
;   - save settings to ini file, not to executable
17
;   - save settings to ini file, not to executable
18
;   - add prompt to save file before closing/opening
18
;   - add prompt to save file before closing/opening
19
;   - other bug-fixes and speed/size optimizations
19
;   - other bug-fixes and speed/size optimizations
20
;
20
;
21
; HISTORY:
21
; HISTORY:
22
; 4.0.4 (mike.dld)
22
; 4.0.4 (mike.dld)
23
;   bug-fixes:
23
;   bug-fixes:
24
;     - statusbar contained hint after dialog operation cancelled
24
;     - statusbar contained hint after dialog operation cancelled
25
;     - small drawing fix for gutter and line saved/modified markers
25
;     - small drawing fix for gutter and line saved/modified markers
26
;       (incorrect calculations)
26
;       (incorrect calculations)
27
;     - incorrect lines marking on Ctrl+V
27
;     - incorrect lines marking on Ctrl+V
-
 
28
;     - put filename of current tab into open/save dialog (noticed by Maxxxx32)
28
;   changes:
29
;   changes:
29
;     - editor and other modifications to ease parts placement changing,
30
;     - editor and other modifications to ease parts placement changing,
30
;       including changes in look
31
;       including changes in look
31
;     - modified/saved colors now match those in MSVS
32
;     - modified/saved colors now match those in MSVS
32
;     - function 70 for *all* file operations (including diamond's fixes)
33
;     - function 70 for *all* file operations (including diamond's fixes)
33
;     - use memory manager instead of statically allocated region
34
;     - use memory manager instead of statically allocated region
34
;     - case-insensitive filenames input, to be able to open/save files with
35
;     - case-insensitive filenames input, to be able to open/save files with
35
;       non-latin chars in name (russian etc.)
36
;       non-latin chars in name (russian etc.)
36
;     - reduced flickering (changes checker)
37
;     - reduced flickering (changes checker)
37
;     - overall code cleanup
38
;     - overall code cleanup
38
;   new features:
39
;   new features:
39
;     - recode tables between CP866, CP1251 and KOI8-R (suggested by Victor)
40
;     - recode tables between CP866, CP1251 and KOI8-R (suggested by Victor)
40
;     - tabbed interface, ability to open several files in one app instance
41
;     - tabbed interface, ability to open several files in one app instance
41
;       (thanks IRC guys for ideas and testing)
42
;       (thanks IRC guys for ideas and testing)
42
;     - make any tab default to compile it disregarding currently active tab
43
;     - make any tab default to compile it disregarding currently active tab
43
;     - configuration dialog (colors, tabs positioning)
44
;     - configuration dialog (colors, tabs positioning)
44
; 4.0.3 (mike.dld)
45
; 4.0.3 (mike.dld)
45
;   bug-fixes:
46
;   bug-fixes:
46
;     - 1-char selection if pressing  out of real line length
47
;     - 1-char selection if pressing  out of real line length
47
;     - fault in `writepos`, added call to function 9
48
;     - fault in `writepos`, added call to function 9
48
;     - main menu items weren't highlighted if popup opened and cursor
49
;     - main menu items weren't highlighted if popup opened and cursor
49
;       isn't in main menu item's area
50
;       isn't in main menu item's area
50
;     - statusbar and textboxes drawing fixes (wrong colors)
51
;     - statusbar and textboxes drawing fixes (wrong colors)
51
;     - perform no redraw while pressing Shift, Ctrl, Alt keys
52
;     - perform no redraw while pressing Shift, Ctrl, Alt keys
52
;     - data length from DOCPAK in string representation (fixed by diamond)
53
;     - data length from DOCPAK in string representation (fixed by diamond)
53
;     - compare file extension case-insensitively (fixed by diamond)
54
;     - compare file extension case-insensitively (fixed by diamond)
54
;   changes:
55
;   changes:
55
;     - function 70 instead of 58 for files loading/saving
56
;     - function 70 instead of 58 for files loading/saving
56
;     - clientarea-relative drawing (less code)
57
;     - clientarea-relative drawing (less code)
57
;     - every line's dword is now splitted into 2 words;
58
;     - every line's dword is now splitted into 2 words;
58
;       low word - line block length, so max line length is 65535 now
59
;       low word - line block length, so max line length is 65535 now
59
;       high word - various flags. for now, only 2 of 16 bits are used:
60
;       high word - various flags. for now, only 2 of 16 bits are used:
60
;         if bit #0 is set, line was modified since file open
61
;         if bit #0 is set, line was modified since file open
61
;         if bit #1 is set, line was saved after last modification
62
;         if bit #1 is set, line was saved after last modification
62
;       high word could also be further used for code collapsing and different
63
;       high word could also be further used for code collapsing and different
63
;         line marking features (breakpoints, errors, bookmarks, etc.)
64
;         line marking features (breakpoints, errors, bookmarks, etc.)
64
;   new features:
65
;   new features:
65
;     - line markers for modified and saved lines
66
;     - line markers for modified and saved lines
66
;     - status messages for various actions
67
;     - status messages for various actions
67
; 4.0.2 (mike.dld)
68
; 4.0.2 (mike.dld)
68
;   bug-fixes:
69
;   bug-fixes:
69
;     - program terminates if started with parameters (fine for DOCPAK)
70
;     - program terminates if started with parameters (fine for DOCPAK)
70
; 4.0.1 (mike.dld)
71
; 4.0.1 (mike.dld)
71
;   bug-fixes:
72
;   bug-fixes:
72
;     - unable to run program after exiting from main menu (Alt+X)
73
;     - unable to run program after exiting from main menu (Alt+X)
73
;   new features:
74
;   new features:
74
;     - integration with DOCPAK
75
;     - integration with DOCPAK
75
; 4.0 (mike.dld)
76
; 4.0 (mike.dld)
76
;   bug-fixes:
77
;   bug-fixes:
77
;     - main menu popups' "on show" was called only for first shown popup
78
;     - main menu popups' "on show" was called only for first shown popup
78
;     - clear selection on left/right arrow keys
79
;     - clear selection on left/right arrow keys
79
;   new features:
80
;   new features:
80
;     - "replace" dialog (w/o "skip", "replace all")
81
;     - "replace" dialog (w/o "skip", "replace all")
81
;     - line numbers display
82
;     - line numbers display
82
;     - options (except "appearance" and "smart tabulation")
83
;     - options (except "appearance" and "smart tabulation")
83
;     - options saving (colors, window position, "Options" popup triggers)
84
;     - options saving (colors, window position, "Options" popup triggers)
84
; 4.0 beta 2 (mike.dld)
85
; 4.0 beta 2 (mike.dld)
85
;   bug-fixes:
86
;   bug-fixes:
86
;     - unable to start if /rd/1/example.asm is missing (from Halyavin)
87
;     - unable to start if /rd/1/example.asm is missing (from Halyavin)
87
;     - clicking on menu items draws main window in popup (from Rohan)
88
;     - clicking on menu items draws main window in popup (from Rohan)
88
;     - passed parameters aren't taken into account (from Mario79)
89
;     - passed parameters aren't taken into account (from Mario79)
89
;     - background isn't erased if text lines < screen lines after
90
;     - background isn't erased if text lines < screen lines after
90
;       selection deletion (from Rohan)
91
;       selection deletion (from Rohan)
91
; 4.0 beta 1 (mike.dld)
92
; 4.0 beta 1 (mike.dld)
92
;   menu bar and popup menu;
93
;   menu bar and popup menu;
93
;     removed buttons from the top and input fields from the bottom since
94
;     removed buttons from the top and input fields from the bottom since
94
;     now they're accesible through main/popup menu;
95
;     now they're accesible through main/popup menu;
95
;   improved keyboard handling (using 66th function);
96
;   improved keyboard handling (using 66th function);
96
;     support for almost all FASMW keyboard shourtcuts;
97
;     support for almost all FASMW keyboard shourtcuts;
97
;   added text selection ability, standard selection operations
98
;   added text selection ability, standard selection operations
98
;     (copy,cut,paste);
99
;     (copy,cut,paste);
99
;   new integrated dialogs (open, save, find)
100
;   new integrated dialogs (open, save, find)
100
;   fix to collapse SPACEs into TABs only for *.asm and *.inc files
101
;   fix to collapse SPACEs into TABs only for *.asm and *.inc files
101
; 3.78a (mike.dld)
102
; 3.78a (mike.dld)
102
;   fixed termination while typing in x positions higher than (line_length+10);
103
;   fixed termination while typing in x positions higher than (line_length+10);
103
;   improved drawing on small heights
104
;   improved drawing on small heights
104
;     don't draw window while its height = 0 (Kolibri "minimize" support)
105
;     don't draw window while its height = 0 (Kolibri "minimize" support)
105
; 3.78 (mike.dld)
106
; 3.78 (mike.dld)
106
;   now lines may be of ANY length;
107
;   now lines may be of ANY length;
107
;     optimized memory usage (less memory for internal file representation)
108
;     optimized memory usage (less memory for internal file representation)
108
;       after loading file, it's internal size equals to its real size
109
;       after loading file, it's internal size equals to its real size
109
;       plus 14 bytes for each line (4 bytes for line length
110
;       plus 14 bytes for each line (4 bytes for line length
110
;         and 10 spaced to the end - to reduce data relocations count);
111
;         and 10 spaced to the end - to reduce data relocations count);
111
;     completely rewritten keyboard handling;
112
;     completely rewritten keyboard handling;
112
;     added horizontal scrollbar;
113
;     added horizontal scrollbar;
113
;   all line feed formats are supported: WIN(CRLF),*NIX(LF),MAC(CR);
114
;   all line feed formats are supported: WIN(CRLF),*NIX(LF),MAC(CR);
114
;   etc.
115
;   etc.
115
; 3.77 (mike.dld)
116
; 3.77 (mike.dld)
116
;   changed save_string to collapse SPACEs into TABs;
117
;   changed save_string to collapse SPACEs into TABs;
117
;   rewrote drawfile from scratch (speed++)
118
;   rewrote drawfile from scratch (speed++)
118
;     through some drawing improvements  needed
119
;     through some drawing improvements  needed
119
;     (some checkups to reduce flickering);
120
;     (some checkups to reduce flickering);
120
;   writepos (size--);
121
;   writepos (size--);
121
;   fixed drawing window while height < 100px, and for non-asm files;
122
;   fixed drawing window while height < 100px, and for non-asm files;
122
;   several small fixes; speed/size optimizations
123
;   several small fixes; speed/size optimizations
123
; 3.76 (mike.dld)
124
; 3.76 (mike.dld)
124
;   changed loadfile/loadhdfile to expand TABs into SPACEs;
125
;   changed loadfile/loadhdfile to expand TABs into SPACEs;
125
;   changed TAB,ENTER,DELETE,BSPACE keys behaviour (rewritten from scratch);
126
;   changed TAB,ENTER,DELETE,BSPACE keys behaviour (rewritten from scratch);
126
;   vertical scrollbar;
127
;   vertical scrollbar;
127
;   extra window resizing capabilities (added a couple of constants);
128
;   extra window resizing capabilities (added a couple of constants);
128
;   completely new text cursor management & moving text cursor with mouse;
129
;   completely new text cursor management & moving text cursor with mouse;
129
;   improved search function, moving cursor to beginning of text found;
130
;   improved search function, moving cursor to beginning of text found;
130
;   adjustable max line width (change LINE_WIDTH & recompile) // (obsolet)
131
;   adjustable max line width (change LINE_WIDTH & recompile) // (obsolet)
131
; 3.75a
132
; 3.75a
132
;   fixed converting char to upper case in read_string
133
;   fixed converting char to upper case in read_string
133
; 3.75
134
; 3.75
134
;   rewrote save_file from scratch; bugfix in loadfile;
135
;   rewrote save_file from scratch; bugfix in loadfile;
135
; 3.74
136
; 3.74
136
;   optimisation
137
;   optimisation
137
; 3.73
138
; 3.73
138
;   completly new load_file function
139
;   completly new load_file function
139
; 3.72
140
; 3.72
140
;   speed++
141
;   speed++
141
; 3.71
142
; 3.71
142
;   error beep
143
;   error beep
143
; 3.6,3.7:
144
; 3.6,3.7:
144
;   many bugs fixed
145
;   many bugs fixed
145
;   simple toolbar
146
;   simple toolbar
146
;   compile, run applications from TINYPAD, all fasm output is in debug board
147
;   compile, run applications from TINYPAD, all fasm output is in debug board
147
;   TAB button
148
;   TAB button
148
;   auto-indent
149
;   auto-indent
149
;   Ctrl+L - insert comment string
150
;   Ctrl+L - insert comment string
150
;-----------------------------------------------------------------------------
151
;-----------------------------------------------------------------------------
151
 
152
 
152
include 'lang.inc'
153
include 'lang.inc'
153
include 'macros.inc' ; useful stuff
154
include 'macros.inc' ; useful stuff
154
;include 'proc32.inc'
155
;include 'proc32.inc'
155
include 'tinypad.inc'
156
include 'tinypad.inc'
156
;purge mov,add,sub            ;  SPEED
157
;purge mov,add,sub            ;  SPEED
157
 
158
 
158
header '01',1,@CODE,TINYPAD_END,STATIC_MEM_END,MAIN_STACK,@PARAMS,self_path
159
header '01',1,@CODE,TINYPAD_END,STATIC_MEM_END,MAIN_STACK,@PARAMS,self_path
159
 
160
 
160
APP_VERSION equ '4.0.4'
161
APP_VERSION equ '4.0.4'
161
 
162
 
162
;include 'debug.inc'
163
;include 'debug.inc'
163
;define __DEBUG__ 1
164
;define __DEBUG__ 1
164
;define __DEBUG_LEVEL__ 1
165
;define __DEBUG_LEVEL__ 1
165
;include 'debug-fdo.inc'
166
;include 'debug-fdo.inc'
166
 
167
 
167
ASEPC = '-'  ; separator character (char)
168
ASEPC = '-'  ; separator character (char)
168
ATOPH = 19   ; menu bar height (pixels)
169
ATOPH = 19   ; menu bar height (pixels)
169
SCRLW = 16   ; scrollbar widht/height (pixels)
170
SCRLW = 16   ; scrollbar widht/height (pixels)
170
ATABW = 8    ; tab key indent width (chars)
171
ATABW = 8    ; tab key indent width (chars)
171
LINEH = 10   ; line height (pixels)
172
LINEH = 10   ; line height (pixels)
172
PATHL = 256  ; maximum path length (chars) !!! don't change !!!
173
PATHL = 256  ; maximum path length (chars) !!! don't change !!!
173
AMINS = 8    ; minimal scroll thumb size (pixels)
174
AMINS = 8    ; minimal scroll thumb size (pixels)
174
LCHGW = 3    ; changed/saved marker width (pixels)
175
LCHGW = 3    ; changed/saved marker width (pixels)
175
 
176
 
176
STATH = 16   ; status bar height (pixels)
177
STATH = 16   ; status bar height (pixels)
177
TBARH = 18   ; tab bar height (pixels)
178
TBARH = 18   ; tab bar height (pixels)
178
 
179
 
179
;-----------------------------------------------------------------------------
180
;-----------------------------------------------------------------------------
180
section @OPTIONS ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
181
section @OPTIONS ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
181
;-----------------------------------------------------------------------------
182
;-----------------------------------------------------------------------------
182
 
183
 
183
label color_tbl dword
184
label color_tbl dword
184
  .text:       RGB(  0,  0,  0)
185
  .text:       RGB(  0,  0,  0)
185
  .back:       RGB(255,255,255)
186
  .back:       RGB(255,255,255)
186
  .text.sel:   RGB(255,255,255)
187
  .text.sel:   RGB(255,255,255)
187
  .back.sel:   RGB( 10, 36,106)
188
  .back.sel:   RGB( 10, 36,106)
188
  .symbol:     RGB( 48, 48,240)
189
  .symbol:     RGB( 48, 48,240)
189
  .number:     RGB(  0,144,  0)
190
  .number:     RGB(  0,144,  0)
190
  .string:     RGB(176,  0,  0)
191
  .string:     RGB(176,  0,  0)
191
  .comment:    RGB(128,128,128)
192
  .comment:    RGB(128,128,128)
192
  .line.moded: RGB(255,238, 98)
193
  .line.moded: RGB(255,238, 98)
193
  .line.saved: RGB(108,226,108)
194
  .line.saved: RGB(108,226,108)
194
 
195
 
195
ins_mode db 1
196
ins_mode db 1
196
tab_pos  db 2
197
tab_pos  db 2
197
 
198
 
198
options  db OPTS_AUTOINDENT+OPTS_OPTIMSAVE+OPTS_SMARTTAB
199
options  db OPTS_AUTOINDENT+OPTS_OPTIMSAVE+OPTS_SMARTTAB
199
 
200
 
200
mainwnd_pos:
201
mainwnd_pos:
201
  .x dd 250
202
  .x dd 250
202
  .y dd 75
203
  .y dd 75
203
  .w dd 6*80+6+SCRLW+5	;- 220
204
  .w dd 6*80+6+SCRLW+5	;- 220
204
  .h dd 402		;- 220
205
  .h dd 402		;- 220
205
 
206
 
206
;-----------------------------------------------------------------------------
207
;-----------------------------------------------------------------------------
207
section @CODE ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
208
section @CODE ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
208
;-----------------------------------------------------------------------------
209
;-----------------------------------------------------------------------------
209
 
210
 
210
;       fninit
211
;       fninit
211
 
212
 
212
;       stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_left,50
213
;       stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_left,50
213
;       mov     [mainwnd_pos.x],eax
214
;       mov     [mainwnd_pos.x],eax
214
;       stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_top,50
215
;       stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_top,50
215
;       mov     [mainwnd_pos.y],eax
216
;       mov     [mainwnd_pos.y],eax
216
;       stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_right,350
217
;       stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_right,350
217
;       sub     eax,[mainwnd_pos.x]
218
;       sub     eax,[mainwnd_pos.x]
218
;       mov     [mainwnd_pos.w],eax
219
;       mov     [mainwnd_pos.w],eax
219
;       stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_bottom,450
220
;       stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_bottom,450
220
;       sub     eax,[mainwnd_pos.y]
221
;       sub     eax,[mainwnd_pos.y]
221
;       mov     [mainwnd_pos.h],eax
222
;       mov     [mainwnd_pos.h],eax
222
 
223
 
223
	cld
224
	cld
224
	mov	edi,@UDATA
225
	mov	edi,@UDATA
225
	mov	ecx,@PARAMS-@UDATA
226
	mov	ecx,@PARAMS-@UDATA
226
	mov	al,0
227
	mov	al,0
227
	rep	stosb
228
	rep	stosb
228
 
229
 
229
	mov	al,[tab_pos]
230
	mov	al,[tab_pos]
230
	mov	[tab_bar.Style],al
231
	mov	[tab_bar.Style],al
231
 
232
 
232
	mcall	68,11
233
	mcall	68,11
233
	or	eax,eax
234
	or	eax,eax
234
	jz	key.alt_x.close
235
	jz	key.alt_x.close
235
 
236
 
236
	mov	eax,65536
237
	mov	eax,65536
237
	call	mem.Alloc
238
	call	mem.Alloc
238
	mov	[temp_buf],eax
239
	mov	[temp_buf],eax
239
 
240
 
240
	inc	[do_not_draw]
241
	inc	[do_not_draw]
241
 
242
 
242
	mov	dword[app_start],7
243
	mov	dword[app_start],7
243
 
244
 
244
	mov	esi,s_example
245
	mov	esi,s_example
245
	mov	edi,tb_opensave.text
246
	mov	edi,tb_opensave.text
246
	mov	ecx,s_example.size
247
	mov	ecx,s_example.size
247
	mov	[tb_opensave.length],cl
248
	mov	[tb_opensave.length],cl
248
	rep	movsb
249
	rep	movsb
249
 
250
 
250
	mov	esi,s_still
251
	mov	esi,s_still
251
	mov	edi,s_search
252
	mov	edi,s_search
252
	mov	ecx,s_still.size
253
	mov	ecx,s_still.size
253
	mov	[s_search.size],ecx
254
	mov	[s_search.size],ecx
254
	rep	movsb
255
	rep	movsb
255
 
256
 
256
	cmp	byte[@PARAMS],0
257
	cmp	byte[@PARAMS],0
257
	jz	no_params
258
	jz	no_params
258
 
259
 
259
;// Willow's code to support DOCPAK [
260
;// Willow's code to support DOCPAK [
260
 
261
 
261
	cmp	byte[@PARAMS],'*'
262
	cmp	byte[@PARAMS],'*'
262
	jne	.noipc
263
	jne	.noipc
263
 
264
 
264
;// diamond [ (convert size from decimal representation to dword)
265
;// diamond [ (convert size from decimal representation to dword)
265
;--     mov     edx,dword[@PARAMS+1]
266
;--     mov     edx,dword[@PARAMS+1]
266
	mov	esi,@PARAMS+1
267
	mov	esi,@PARAMS+1
267
	xor	edx,edx
268
	xor	edx,edx
268
	xor	eax,eax
269
	xor	eax,eax
269
    @@: lodsb
270
    @@: lodsb
270
	test	al,al
271
	test	al,al
271
	jz	@f
272
	jz	@f
272
	lea	edx,[edx*4+edx]
273
	lea	edx,[edx*4+edx]
273
	lea	edx,[edx*2+eax-'0']
274
	lea	edx,[edx*2+eax-'0']
274
	jmp	@b
275
	jmp	@b
275
    @@:
276
    @@:
276
;// diamond ]
277
;// diamond ]
277
 
278
 
278
	add	edx,20
279
	add	edx,20
279
 
280
 
280
	mov	eax,edx
281
	mov	eax,edx
281
	call	mem.Alloc
282
	call	mem.Alloc
282
	mov	ebp,eax
283
	mov	ebp,eax
283
	push	eax
284
	push	eax
284
 
285
 
285
	mov	dword[ebp+0],0
286
	mov	dword[ebp+0],0
286
	mov	dword[ebp+4],8
287
	mov	dword[ebp+4],8
287
	mcall	60,1,ebp
288
	mcall	60,1,ebp
288
	mcall	40,1000000b
289
	mcall	40,1000000b
289
 
290
 
290
	mcall	23,200
291
	mcall	23,200
291
 
292
 
292
	cmp	eax,7
293
	cmp	eax,7
293
	jne	key.alt_x.close
294
	jne	key.alt_x.close
294
	mov	byte[ebp],1
295
	mov	byte[ebp],1
295
 
296
 
296
	mov	ecx,[ebp+12]
297
	mov	ecx,[ebp+12]
297
	lea	esi,[ebp+16]
298
	lea	esi,[ebp+16]
298
	call	create_tab
299
	call	create_tab
299
	call	load_from_memory
300
	call	load_from_memory
300
 
301
 
301
	pop	ebp
302
	pop	ebp
302
	mov	eax,ebp
303
	mov	eax,ebp
303
	call	mem.Free
304
	call	mem.Free
304
 
305
 
305
	jmp	@f
306
	jmp	@f
306
  .noipc:
307
  .noipc:
307
 
308
 
308
;// Willow's code to support DOCPAK ]
309
;// Willow's code to support DOCPAK ]
309
 
310
 
310
	mov	esi,@PARAMS
311
	mov	esi,@PARAMS
311
	mov	edi,tb_opensave.text
312
	mov	edi,tb_opensave.text
312
	mov	ecx,PATHL
313
	mov	ecx,PATHL
313
	rep	movsb
314
	rep	movsb
314
	mov	edi,tb_opensave.text
315
	mov	edi,tb_opensave.text
315
	mov	ecx,PATHL
316
	mov	ecx,PATHL
316
	xor	al,al
317
	xor	al,al
317
	repne	scasb
318
	repne	scasb
318
	jne	key.alt_x.close
319
	jne	key.alt_x.close
319
	lea	eax,[edi-tb_opensave.text-1]
320
	lea	eax,[edi-tb_opensave.text-1]
320
	mov	[tb_opensave.length],al
321
	mov	[tb_opensave.length],al
321
	call	load_file
322
	call	load_file
322
	jnc	@f
323
	jnc	@f
323
 
324
 
324
  no_params:
325
  no_params:
325
	call	create_tab
326
	call	create_tab
326
 
327
 
327
    @@:
328
    @@:
328
	mov	[s_status],0
329
	mov	[s_status],0
329
	dec	[do_not_draw]
330
	dec	[do_not_draw]
330
	mcall	66,1,1
331
	mcall	66,1,1
331
	mcall	40,00100111b
332
	mcall	40,00100111b
332
red:
333
red:
333
	call	drawwindow
334
	call	drawwindow
334
 
335
 
335
;-----------------------------------------------------------------------------
336
;-----------------------------------------------------------------------------
336
 
337
 
337
still:
338
still:
338
	call	draw_statusbar ; write current position & number of strings
339
	call	draw_statusbar ; write current position & number of strings
339
 
340
 
340
  .skip_write:
341
  .skip_write:
341
	mcall	10	; wait here until event
342
	mcall	10	; wait here until event
342
	cmp	[main_closed],0
343
	cmp	[main_closed],0
343
	jne	key.alt_x
344
	jne	key.alt_x
344
	dec	eax	; redraw ?
345
	dec	eax	; redraw ?
345
	jz	red
346
	jz	red
346
	dec	eax	; key ?
347
	dec	eax	; key ?
347
	jz	key
348
	jz	key
348
	dec	eax	; button ?
349
	dec	eax	; button ?
349
	jz	button
350
	jz	button
350
	sub	eax,3	; mouse ?
351
	sub	eax,3	; mouse ?
351
	jz	mouse
352
	jz	mouse
352
 
353
 
353
	jmp	still.skip_write
354
	jmp	still.skip_write
354
 
355
 
355
;-----------------------------------------------------------------------------
356
;-----------------------------------------------------------------------------
356
func start_fasm ;/////////////////////////////////////////////////////////////
357
func start_fasm ;/////////////////////////////////////////////////////////////
357
;-----------------------------------------------------------------------------
358
;-----------------------------------------------------------------------------
358
; BL = run after compile
359
; BL = run after compile
359
;-----------------------------------------------------------------------------
360
;-----------------------------------------------------------------------------
360
; FASM infile,outfile,/path/to/files[,run]
361
; FASM infile,outfile,/path/to/files[,run]
361
;-----------------------------------------------------------------------------
362
;-----------------------------------------------------------------------------
362
	cmp	[cur_editor.AsmMode],0
363
	cmp	[cur_editor.AsmMode],0
363
	jne	@f
364
	jne	@f
364
	ret
365
	ret
365
    @@:
366
    @@:
366
	mov	eax,[tab_bar.Default.Ptr]
367
	mov	eax,[tab_bar.Default.Ptr]
367
	or	eax,eax
368
	or	eax,eax
368
	jnz	@f
369
	jnz	@f
369
	mov	eax,[tab_bar.Current.Ptr]
370
	mov	eax,[tab_bar.Current.Ptr]
370
    @@: cmp	byte[eax+TABITEM.Editor.FilePath],'/'
371
    @@: cmp	byte[eax+TABITEM.Editor.FilePath],'/'
371
	je	@f
372
	je	@f
372
	ret
373
	ret
373
    @@:
374
    @@:
374
	mov	edi,fasm_parameters
375
	mov	edi,fasm_parameters
375
	push	eax
376
	push	eax
376
 
377
 
377
	cld
378
	cld
378
 
379
 
379
	lea	esi,[eax+TABITEM.Editor.FilePath]
380
	lea	esi,[eax+TABITEM.Editor.FilePath]
380
	add	esi,[eax+TABITEM.Editor.FileName]
381
	add	esi,[eax+TABITEM.Editor.FileName]
381
	push	esi esi
382
	push	esi esi
382
    @@: lodsb
383
    @@: lodsb
383
	cmp	al,0
384
	cmp	al,0
384
	je	@f
385
	je	@f
385
	stosb
386
	stosb
386
	cmp	al,'.'
387
	cmp	al,'.'
387
	jne	@b
388
	jne	@b
388
	mov	ecx,esi
389
	mov	ecx,esi
389
	jmp	@b
390
	jmp	@b
390
    @@:
391
    @@:
391
	mov	al,','
392
	mov	al,','
392
	stosb
393
	stosb
393
 
394
 
394
	pop	esi
395
	pop	esi
395
	sub	ecx,esi
396
	sub	ecx,esi
396
	dec	ecx
397
	dec	ecx
397
	jz	@f
398
	jz	@f
398
	rep	movsb
399
	rep	movsb
399
    @@:
400
    @@:
400
	mov	al,','
401
	mov	al,','
401
	stosb
402
	stosb
402
 
403
 
403
	pop	ecx esi
404
	pop	ecx esi
404
	add	esi,TABITEM.Editor.FilePath
405
	add	esi,TABITEM.Editor.FilePath
405
	sub	ecx,esi
406
	sub	ecx,esi
406
	rep	movsb
407
	rep	movsb
407
 
408
 
408
	cmp	bl,0 ; run outfile ?
409
	cmp	bl,0 ; run outfile ?
409
	je	@f
410
	je	@f
410
	mov	dword[edi],',run'
411
	mov	dword[edi],',run'
411
	add	edi,4
412
	add	edi,4
412
    @@:
413
    @@:
413
	mov	al,0
414
	mov	al,0
414
	stosb
415
	stosb
415
 
416
 
416
	mov	[app_start.filename],app_fasm
417
	mov	[app_start.filename],app_fasm
417
	mov	[app_start.params],fasm_parameters
418
	mov	[app_start.params],fasm_parameters
418
start_ret:
419
start_ret:
419
	mcall	70,app_start
420
	mcall	70,app_start
420
	ret
421
	ret
421
endf
422
endf
422
 
423
 
423
;-----------------------------------------------------------------------------
424
;-----------------------------------------------------------------------------
424
func open_debug_board ;///////////////////////////////////////////////////////
425
func open_debug_board ;///////////////////////////////////////////////////////
425
;-----------------------------------------------------------------------------
426
;-----------------------------------------------------------------------------
426
	mov	[app_start.filename],app_board
427
	mov	[app_start.filename],app_board
427
	mov	[app_start.params],0
428
	mov	[app_start.params],0
428
	jmp	start_ret
429
	jmp	start_ret
429
endf
430
endf
430
 
431
 
431
;-----------------------------------------------------------------------------
432
;-----------------------------------------------------------------------------
432
func open_sysfuncs_txt ;//////////////////////////////////////////////////////
433
func open_sysfuncs_txt ;//////////////////////////////////////////////////////
433
;-----------------------------------------------------------------------------
434
;-----------------------------------------------------------------------------
434
	mov	[app_start.filename],app_docpak
435
	mov	[app_start.filename],app_docpak
435
	mov	[app_start.params],sysfuncs_param
436
	mov	[app_start.params],sysfuncs_param
436
	call	start_ret
437
	call	start_ret
437
	cmp	eax,0xfffffff0
438
	cmp	eax,0xfffffff0
438
	jb	@f
439
	jb	@f
439
	mov	[app_start.filename],app_tinypad
440
	mov	[app_start.filename],app_tinypad
440
	mov	[app_start.params],sysfuncs_filename
441
	mov	[app_start.params],sysfuncs_filename
441
	call	start_ret
442
	call	start_ret
442
    @@: ret
443
    @@: ret
443
endf
444
endf
444
 
445
 
445
set_opt:
446
set_opt:
446
 
447
 
447
  .dialog:
448
  .dialog:
448
	mov	[bot_mode],1
449
	mov	[bot_mode],1
449
	mov	[bot_dlg_height],128
450
	mov	[bot_dlg_height],128
450
	mov	[bot_dlg_handler],optsdlg_handler
451
	mov	[bot_dlg_handler],optsdlg_handler
451
	mov	[focused_tb],tb_color
452
	mov	[focused_tb],tb_color
452
	mov	al,[tb_color.length]
453
	mov	al,[tb_color.length]
453
	mov	[tb_color.pos.x],al
454
	mov	[tb_color.pos.x],al
454
	mov	[tb_color.sel.x],0
455
	mov	[tb_color.sel.x],0
455
	mov	[tb_casesen],1
456
	mov	[tb_casesen],1
456
	mov	[cur_part],0
457
	mov	[cur_part],0
457
	m2m	[cur_color],dword[color_tbl.text]
458
	m2m	[cur_color],dword[color_tbl.text]
458
	mov	esi,color_tbl
459
	mov	esi,color_tbl
459
	mov	edi,cur_colors
460
	mov	edi,cur_colors
460
	mov	ecx,10
461
	mov	ecx,10
461
	cld
462
	cld
462
	rep	movsd
463
	rep	movsd
463
	call	drawwindow
464
	call	drawwindow
464
	ret
465
	ret
465
 
466
 
466
  .line_numbers:
467
  .line_numbers:
467
	mov	al,OPTS_LINENUMS
468
	mov	al,OPTS_LINENUMS
468
	jmp	.main
469
	jmp	.main
469
  .optimal_fill:
470
  .optimal_fill:
470
	mov	al,OPTS_OPTIMSAVE
471
	mov	al,OPTS_OPTIMSAVE
471
	jmp	.main
472
	jmp	.main
472
  .auto_indents:
473
  .auto_indents:
473
	mov	al,OPTS_AUTOINDENT
474
	mov	al,OPTS_AUTOINDENT
474
	jmp	.main
475
	jmp	.main
475
  .auto_braces:
476
  .auto_braces:
476
	mov	al,OPTS_AUTOBRACES
477
	mov	al,OPTS_AUTOBRACES
477
	jmp	.main
478
	jmp	.main
478
  .secure_sel:
479
  .secure_sel:
479
	mov	al,OPTS_SECURESEL
480
	mov	al,OPTS_SECURESEL
480
 
481
 
481
  .main:
482
  .main:
482
	xor	[options],al
483
	xor	[options],al
483
	ret
484
	ret
484
 
485
 
485
;-----------------------------------------------------------------------------
486
;-----------------------------------------------------------------------------
486
 
487
 
487
include 'tp-defines.inc'
488
include 'tp-defines.inc'
488
 
489
 
489
include 'tp-draw.asm'
490
include 'tp-draw.asm'
490
include 'tp-key.asm'
491
include 'tp-key.asm'
491
include 'tp-button.asm'
492
include 'tp-button.asm'
492
include 'tp-mouse.asm'
493
include 'tp-mouse.asm'
493
include 'tp-files.asm'
494
include 'tp-files.asm'
494
include 'tp-common.asm'
495
include 'tp-common.asm'
495
include 'tp-dialog.asm'
496
include 'tp-dialog.asm'
496
include 'tp-popup.asm'
497
include 'tp-popup.asm'
497
include 'tp-tbox.asm'
498
include 'tp-tbox.asm'
498
include 'tp-tabctl.asm'
499
include 'tp-tabctl.asm'
499
include 'tp-editor.asm'
500
include 'tp-editor.asm'
500
include 'tp-recode.asm'
501
include 'tp-recode.asm'
501
 
502
 
502
;include 'lib-ini.asm'
503
;include 'lib-ini.asm'
503
 
504
 
504
;-----------------------------------------------------------------------------
505
;-----------------------------------------------------------------------------
505
section @DATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
506
section @DATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
506
;-----------------------------------------------------------------------------
507
;-----------------------------------------------------------------------------
507
 
508
 
508
vscrl_capt dd -1
509
vscrl_capt dd -1
509
hscrl_capt dd -1
510
hscrl_capt dd -1
510
body_capt  dd -1
511
body_capt  dd -1
511
 
512
 
512
key0 db \
513
key0 db \
513
  0x00,0x00,0x02,0x03,0x04,0x05,0x06,0x07,\
514
  0x00,0x00,0x02,0x03,0x04,0x05,0x06,0x07,\
514
  0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x00,0x00,\
515
  0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x00,0x00,\
515
  0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,\
516
  0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,\
516
  0x18,0x19,0x1A,0x1B,0x00,0x00,0x1E,0x1F,\
517
  0x18,0x19,0x1A,0x1B,0x00,0x00,0x1E,0x1F,\
517
  0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,\
518
  0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,\
518
  0x28,0x29,0x00,0x2B,0x2C,0x2D,0x2E,0x2F,\
519
  0x28,0x29,0x00,0x2B,0x2C,0x2D,0x2E,0x2F,\
519
  0x30,0x31,0x32,0x33,0x34,0x35,0x00,0x00,\
520
  0x30,0x31,0x32,0x33,0x34,0x35,0x00,0x00,\
520
  0x00,0x39,0x00,0x00,0x00,0x00,0x00,0x00
521
  0x00,0x39,0x00,0x00,0x00,0x00,0x00,0x00
521
  times 12*16 db 0x00
522
  times 12*16 db 0x00
522
 
523
 
523
accel_table_main dd		    \
524
accel_table_main dd		    \
524
  0x0000000E,key.bkspace	   ,\ ; BackSpace
525
  0x0000000E,key.bkspace	   ,\ ; BackSpace
525
  0x0000000F,key.tab		   ,\ ; Tab
526
  0x0000000F,key.tab		   ,\ ; Tab
526
  0x0000001C,key.return 	   ,\ ; Return
527
  0x0000001C,key.return 	   ,\ ; Return
527
  0x0000003D,key.f3		   ,\ ; F3
528
  0x0000003D,key.f3		   ,\ ; F3
528
  0x00000043,key.f9		   ,\ ; F9
529
  0x00000043,key.f9		   ,\ ; F9
529
  0x00000147,key.home		   ,\ ; Home
530
  0x00000147,key.home		   ,\ ; Home
530
  0x00000148,key.up		   ,\ ; Up
531
  0x00000148,key.up		   ,\ ; Up
531
  0x00000149,key.pgup		   ,\ ; PageUp
532
  0x00000149,key.pgup		   ,\ ; PageUp
532
  0x0000014B,key.left		   ,\ ; Left
533
  0x0000014B,key.left		   ,\ ; Left
533
  0x0000014D,key.right		   ,\ ; Right
534
  0x0000014D,key.right		   ,\ ; Right
534
  0x0000014F,key.end		   ,\ ; End
535
  0x0000014F,key.end		   ,\ ; End
535
  0x00000150,key.down		   ,\ ; Down
536
  0x00000150,key.down		   ,\ ; Down
536
  0x00000151,key.pgdn		   ,\ ; PageDown
537
  0x00000151,key.pgdn		   ,\ ; PageDown
537
  0x00000152,key.ins		   ,\ ; Insert
538
  0x00000152,key.ins		   ,\ ; Insert
538
  0x00000153,key.del		   ,\ ; Delete
539
  0x00000153,key.del		   ,\ ; Delete
539
  0x00010043,key.shift_f9	   ,\ ; Shift+F9
540
  0x00010043,key.shift_f9	   ,\ ; Shift+F9
540
  0x00010147,key.shift_home	   ,\ ; Shift+Home
541
  0x00010147,key.shift_home	   ,\ ; Shift+Home
541
  0x00010148,key.shift_up	   ,\ ; Shift+Up
542
  0x00010148,key.shift_up	   ,\ ; Shift+Up
542
  0x00010149,key.shift_pgup	   ,\ ; Shift+PageUp
543
  0x00010149,key.shift_pgup	   ,\ ; Shift+PageUp
543
  0x0001014B,key.shift_left	   ,\ ; Shift+Left
544
  0x0001014B,key.shift_left	   ,\ ; Shift+Left
544
  0x0001014D,key.shift_right	   ,\ ; Shift+Right
545
  0x0001014D,key.shift_right	   ,\ ; Shift+Right
545
  0x0001014F,key.shift_end	   ,\ ; Shift+End
546
  0x0001014F,key.shift_end	   ,\ ; Shift+End
546
  0x00010150,key.shift_down	   ,\ ; Shift+Down
547
  0x00010150,key.shift_down	   ,\ ; Shift+Down
547
  0x00010151,key.shift_pgdn	   ,\ ; Shift+PageDown
548
  0x00010151,key.shift_pgdn	   ,\ ; Shift+PageDown
548
  0x00010153,key.del		   ,\ ; Shift+Delete
549
  0x00010153,key.del		   ,\ ; Shift+Delete
549
  0x0002000F,key.ctrl_tab	   ,\ ; Ctrl+Tab
550
  0x0002000F,key.ctrl_tab	   ,\ ; Ctrl+Tab
550
  0x00020015,key.ctrl_y 	   ,\ ; Ctrl+Y
551
  0x00020015,key.ctrl_y 	   ,\ ; Ctrl+Y
551
  0x00020018,key.ctrl_o 	   ,\ ; Ctrl+O
552
  0x00020018,key.ctrl_o 	   ,\ ; Ctrl+O
552
  0x0002001E,key.ctrl_a 	   ,\ ; Ctrl+A
553
  0x0002001E,key.ctrl_a 	   ,\ ; Ctrl+A
553
  0x0002001F,key.ctrl_s 	   ,\ ; Ctrl+S
554
  0x0002001F,key.ctrl_s 	   ,\ ; Ctrl+S
554
  0x00020020,key.ctrl_d 	   ,\ ; Ctrl+D
555
  0x00020020,key.ctrl_d 	   ,\ ; Ctrl+D
555
  0x00020021,key.ctrl_f 	   ,\ ; Ctrl+F
556
  0x00020021,key.ctrl_f 	   ,\ ; Ctrl+F
556
  0x00020022,key.ctrl_g 	   ,\ ; Ctrl+G
557
  0x00020022,key.ctrl_g 	   ,\ ; Ctrl+G
557
  0x00020023,key.ctrl_h 	   ,\ ; Ctrl+H
558
  0x00020023,key.ctrl_h 	   ,\ ; Ctrl+H
558
\;0x00020026,key.ctrl_l            ,\ ; Ctrl+L
559
\;0x00020026,key.ctrl_l            ,\ ; Ctrl+L
559
  0x0002002D,key.ctrl_x 	   ,\ ; Ctrl+X
560
  0x0002002D,key.ctrl_x 	   ,\ ; Ctrl+X
560
  0x0002002E,key.ctrl_c 	   ,\ ; Ctrl+C
561
  0x0002002E,key.ctrl_c 	   ,\ ; Ctrl+C
561
  0x0002002F,key.ctrl_v 	   ,\ ; Ctrl+V
562
  0x0002002F,key.ctrl_v 	   ,\ ; Ctrl+V
562
  0x00020031,key.ctrl_n 	   ,\ ; Ctrl+N
563
  0x00020031,key.ctrl_n 	   ,\ ; Ctrl+N
563
  0x0002003E,key.ctrl_f4	   ,\ ; Ctrl+F4
564
  0x0002003E,key.ctrl_f4	   ,\ ; Ctrl+F4
564
  0x00020043,key.ctrl_f9	   ,\ ; Ctrl+F9
565
  0x00020043,key.ctrl_f9	   ,\ ; Ctrl+F9
565
  0x00020147,key.ctrl_home	   ,\ ; Ctrl+Home
566
  0x00020147,key.ctrl_home	   ,\ ; Ctrl+Home
566
\;0x00020148,key.ctrl_up           ,\ ; Ctrl+Up
567
\;0x00020148,key.ctrl_up           ,\ ; Ctrl+Up
567
  0x00020149,key.ctrl_pgup	   ,\ ; Ctrl+PageUp
568
  0x00020149,key.ctrl_pgup	   ,\ ; Ctrl+PageUp
568
  0x0002014B,key.ctrl_left	   ,\ ; Ctrl+Left
569
  0x0002014B,key.ctrl_left	   ,\ ; Ctrl+Left
569
  0x0002014D,key.ctrl_right	   ,\ ; Ctrl+Right
570
  0x0002014D,key.ctrl_right	   ,\ ; Ctrl+Right
570
  0x0002014F,key.ctrl_end	   ,\ ; Ctrl+End
571
  0x0002014F,key.ctrl_end	   ,\ ; Ctrl+End
571
\;0x00020150,key.ctrl_down         ,\ ; Ctrl+Down
572
\;0x00020150,key.ctrl_down         ,\ ; Ctrl+Down
572
  0x00020151,key.ctrl_pgdn	   ,\ ; Ctrl+PageDown
573
  0x00020151,key.ctrl_pgdn	   ,\ ; Ctrl+PageDown
573
  0x00020153,key.del		   ,\ ; Ctrl+Del
574
  0x00020153,key.del		   ,\ ; Ctrl+Del
574
  0x0003000F,key.shift_ctrl_tab    ,\ ; Shift+Ctrl+Tab
575
  0x0003000F,key.shift_ctrl_tab    ,\ ; Shift+Ctrl+Tab
575
  0x0003001F,key.shift_ctrl_s	   ,\ ; Shift+Ctrl+S
576
  0x0003001F,key.shift_ctrl_s	   ,\ ; Shift+Ctrl+S
576
  0x00030147,key.shift_ctrl_home   ,\ ; Shift+Ctrl+Home
577
  0x00030147,key.shift_ctrl_home   ,\ ; Shift+Ctrl+Home
577
\;0x00030148,key.shift_ctrl_up     ,\ ; Shift+Ctrl+Up
578
\;0x00030148,key.shift_ctrl_up     ,\ ; Shift+Ctrl+Up
578
  0x00030149,key.shift_ctrl_pgup   ,\ ; Shift+Ctrl+PageUp
579
  0x00030149,key.shift_ctrl_pgup   ,\ ; Shift+Ctrl+PageUp
579
  0x0003014B,key.shift_ctrl_left   ,\ ; Shift+Ctrl+Left
580
  0x0003014B,key.shift_ctrl_left   ,\ ; Shift+Ctrl+Left
580
  0x0003014D,key.shift_ctrl_right  ,\ ; Shift+Ctrl+Right
581
  0x0003014D,key.shift_ctrl_right  ,\ ; Shift+Ctrl+Right
581
  0x0003014F,key.shift_ctrl_end    ,\ ; Shift+Ctrl+End
582
  0x0003014F,key.shift_ctrl_end    ,\ ; Shift+Ctrl+End
582
\;0x00030150,key.shift_ctrl_down   ,\ ; Shift+Ctrl+Down
583
\;0x00030150,key.shift_ctrl_down   ,\ ; Shift+Ctrl+Down
583
  0x00030151,key.shift_ctrl_pgdn   ,\ ; Shift+Ctrl+PageDown
584
  0x00030151,key.shift_ctrl_pgdn   ,\ ; Shift+Ctrl+PageDown
584
  0x0004002D,key.alt_x		   ,\ ; Alt+X
585
  0x0004002D,key.alt_x		   ,\ ; Alt+X
585
  0
586
  0
586
 
587
 
587
accel_table_textbox dd		    \
588
accel_table_textbox dd		    \
588
\;0x00000001,key.tb.escape         ,\ ; Escape
589
\;0x00000001,key.tb.escape         ,\ ; Escape
589
  0x0000000E,key.tb.bkspace	   ,\ ; BackSpace
590
  0x0000000E,key.tb.bkspace	   ,\ ; BackSpace
590
\;0x0000000F,key.tb.tab            ,\ ; Tab
591
\;0x0000000F,key.tb.tab            ,\ ; Tab
591
\;0x0000001C,key.tb.return         ,\ ; Return
592
\;0x0000001C,key.tb.return         ,\ ; Return
592
  0x00000147,key.tb.home	   ,\ ; Home
593
  0x00000147,key.tb.home	   ,\ ; Home
593
  0x0000014B,key.tb.left	   ,\ ; Left
594
  0x0000014B,key.tb.left	   ,\ ; Left
594
  0x0000014D,key.tb.right	   ,\ ; Right
595
  0x0000014D,key.tb.right	   ,\ ; Right
595
  0x0000014F,key.tb.end 	   ,\ ; End
596
  0x0000014F,key.tb.end 	   ,\ ; End
596
  0x00000153,key.tb.del 	   ,\ ; Delete
597
  0x00000153,key.tb.del 	   ,\ ; Delete
597
  0x00010147,key.tb.shift_home	   ,\ ; Shift+Home
598
  0x00010147,key.tb.shift_home	   ,\ ; Shift+Home
598
  0x0001014B,key.tb.shift_left	   ,\ ; Shift+Left
599
  0x0001014B,key.tb.shift_left	   ,\ ; Shift+Left
599
  0x0001014D,key.tb.shift_right    ,\ ; Shift+Right
600
  0x0001014D,key.tb.shift_right    ,\ ; Shift+Right
600
  0x0001014F,key.tb.shift_end	   ,\ ; Shift+End
601
  0x0001014F,key.tb.shift_end	   ,\ ; Shift+End
601
  0x00010153,key.tb.del 	   ,\ ; Shift+Del
602
  0x00010153,key.tb.del 	   ,\ ; Shift+Del
602
  0
603
  0
603
 
604
 
604
accel_table2 dd 	  \
605
accel_table2 dd 	  \
605
  1    ,key.alt_x	 ,\
606
  1    ,key.alt_x	 ,\
606
  'VSL',btn.vscroll_up	 ,\
607
  'VSL',btn.vscroll_up	 ,\
607
  'VSG',btn.vscroll_down ,\
608
  'VSG',btn.vscroll_down ,\
608
  'HSL',btn.hscroll_up	 ,\
609
  'HSL',btn.hscroll_up	 ,\
609
  'HSG',btn.hscroll_down ,\
610
  'HSG',btn.hscroll_down ,\
610
  'TBL',btn.tabctl_right ,\
611
  'TBL',btn.tabctl_right ,\
611
  'TBG',btn.tabctl_left  ,\
612
  'TBG',btn.tabctl_left  ,\
612
  0
613
  0
613
 
614
 
614
accel_table2_botdlg dd	   \
615
accel_table2_botdlg dd	   \
615
  1    ,key.alt_x	  ,\
616
  1    ,key.alt_x	  ,\
616
  20001,btn.bot.cancel	  ,\
617
  20001,btn.bot.cancel	  ,\
617
  20002,btn.bot.opensave  ,\
618
  20002,btn.bot.opensave  ,\
618
  20003,btn.bot.find	  ,\
619
  20003,btn.bot.find	  ,\
619
  20004,btn.bot.appearance,\
620
  20004,btn.bot.appearance,\
620
  21001,btn.bot.tabpos	  ,\
621
  21001,btn.bot.tabpos	  ,\
621
  0
622
  0
622
 
623
 
623
add_table:
624
add_table:
624
  times $1A db -$20
625
  times $1A db -$20
625
  times $25 db -$00
626
  times $25 db -$00
626
  times $10 db -$20
627
  times $10 db -$20
627
  times $30 db -$00
628
  times $30 db -$00
628
  times $10 db -$50
629
  times $10 db -$50
629
  times $04 db -$00,-$01
630
  times $04 db -$00,-$01
630
  times $08 db -$00
631
  times $08 db -$00
631
 
632
 
632
s_status dd 0
633
s_status dd 0
633
 
634
 
634
@^
635
@^
635
fasm_start:
636
fasm_start:
636
	dd	7
637
	dd	7
637
	dd	0
638
	dd	0
638
	dd	fasm_parameters
639
	dd	fasm_parameters
639
	dd	0
640
	dd	0
640
	dd	0
641
	dd	0
641
	db	'/RD/1/DEVELOP/FASM',0
642
	db	'/RD/1/DEVELOP/FASM',0
642
board_start:
643
board_start:
643
	dd	7
644
	dd	7
644
	dd	0
645
	dd	0
645
	dd	0
646
	dd	0
646
	dd	0
647
	dd	0
647
	dd	0
648
	dd	0
648
	db	'/RD/1/BOARD',0
649
	db	'/RD/1/BOARD',0
649
tinypad_start:
650
tinypad_start:
650
	dd	7
651
	dd	7
651
	dd	0
652
	dd	0
652
	dd	?
653
	dd	?
653
	dd	0
654
	dd	0
654
	dd	0
655
	dd	0
655
	db	'/RD/1/TINYPAD',0
656
	db	'/RD/1/TINYPAD',0
656
docpak_start:
657
docpak_start:
657
	dd	7
658
	dd	7
658
	dd	0
659
	dd	0
659
	dd	sysfuncs_param
660
	dd	sysfuncs_param
660
	dd	0
661
	dd	0
661
	dd	0
662
	dd	0
662
	db	'/RD/1/DOCPAK',0
663
	db	'/RD/1/DOCPAK',0
663
^@
664
^@
664
 
665
 
665
sz app_fasm    ,'/RD/1/DEVELOP/FASM',0
666
sz app_fasm    ,'/RD/1/DEVELOP/FASM',0
666
sz app_board   ,'/RD/1/BOARD',0
667
sz app_board   ,'/RD/1/BOARD',0
667
sz app_tinypad ,'/RD/1/TINYPAD',0
668
sz app_tinypad ,'/RD/1/TINYPAD',0
668
sz app_docpak  ,'/RD/1/DOCPAK',0
669
sz app_docpak  ,'/RD/1/DOCPAK',0
669
 
670
 
670
sz sysfuncs_param,'g',0
671
sz sysfuncs_param,'g',0
671
 
672
 
672
include 'tp-locale.inc'
673
include 'tp-locale.inc'
673
 
674
 
674
;// options dialog data [
675
;// options dialog data [
675
label optsdlg_editor at $-EDITOR.Bounds
676
label optsdlg_editor at $-EDITOR.Bounds
676
; rb PATHL     ; FilePath       db PATHL dup(?)
677
; rb PATHL     ; FilePath       db PATHL dup(?)
677
; dd 0         ; FileName       dd ?
678
; dd 0         ; FileName       dd ?
678
  dd ?,?,?,?   ; Bounds         RECT
679
  dd ?,?,?,?   ; Bounds         RECT
679
  dd @f        ; Lines          dd ?
680
  dd @f        ; Lines          dd ?
680
  dd ?	       ; Lines.Size     dd ?
681
  dd ?	       ; Lines.Size     dd ?
681
  dd 9	       ; Lines.Count    dd ?
682
  dd 9	       ; Lines.Count    dd ?
682
  dd 21        ; Columns.Count  dd ?
683
  dd 21        ; Columns.Count  dd ?
683
  dd 0,4       ; Caret          POINT
684
  dd 0,4       ; Caret          POINT
684
  dd 100,4     ; SelStart       POINT
685
  dd 100,4     ; SelStart       POINT
685
  dd 0,0       ; TopLeft        POINT
686
  dd 0,0       ; TopLeft        POINT
686
  dd 0,0       ; VScroll        SCROLLBAR
687
  dd 0,0       ; VScroll        SCROLLBAR
687
  dd 0,0       ; HScroll        SCROLLBAR
688
  dd 0,0       ; HScroll        SCROLLBAR
688
  dd 0	       ; Gutter.Width   dd ?
689
  dd 0	       ; Gutter.Width   dd ?
689
  db 0	       ; Gutter.Visible db ?
690
  db 0	       ; Gutter.Visible db ?
690
  db 1	       ; AsmMode        db ?
691
  db 1	       ; AsmMode        db ?
691
  db 0	       ; Modified       db ?
692
  db 0	       ; Modified       db ?
692
 
693
 
693
@@:
694
@@:
694
  dd 0x00000000+1
695
  dd 0x00000000+1
695
  db ' '
696
  db ' '
696
  dd 0x00010000+9
697
  dd 0x00010000+9
697
  db ' org 100h'
698
  db ' org 100h'
698
  dd 0x00000000+1
699
  dd 0x00000000+1
699
  db ' '
700
  db ' '
700
  dd 0x00000000+20
701
  dd 0x00000000+20
701
  db ' mov ah,09h  ; write'
702
  db ' mov ah,09h  ; write'
702
  dd 0x00000000+12
703
  dd 0x00000000+12
703
  db ' mov dx,text'
704
  db ' mov dx,text'
704
  dd 0x00000000+8
705
  dd 0x00000000+8
705
  db ' int 21h'
706
  db ' int 21h'
706
  dd 0x00030000+8
707
  dd 0x00030000+8
707
  db ' int 20h'
708
  db ' int 20h'
708
  dd 0x00000000+1
709
  dd 0x00000000+1
709
  db ' '
710
  db ' '
710
  dd 0x00000000+21
711
  dd 0x00000000+21
711
  db ' text db "Hello!",24h'
712
  db ' text db "Hello!",24h'
712
  dd 0
713
  dd 0
713
 
714
 
714
optsdlg_editor_parts:	; left,top,right,bottom,type
715
optsdlg_editor_parts:	; left,top,right,bottom,type
715
  db 0, 12, 13, 29, 22
716
  db 0, 12, 13, 29, 22
716
  db 0, 12, 33, 47, 42
717
  db 0, 12, 33, 47, 42
717
  db 0, 12, 53, 29, 72
718
  db 0, 12, 53, 29, 72
718
  db 0, 12, 83, 53, 92
719
  db 0, 12, 83, 53, 92
719
  db 2, 12, 43, 77, 52
720
  db 2, 12, 43, 77, 52
720
  db 3,  4, 43,148, 52
721
  db 3,  4, 43,148, 52
721
  db 4, 48, 33, 53, 42
722
  db 4, 48, 33, 53, 42
722
  db 4,108, 83,113, 92
723
  db 4,108, 83,113, 92
723
  db 5, 36, 13, 59, 22
724
  db 5, 36, 13, 59, 22
724
  db 5, 54, 33, 71, 42
725
  db 5, 54, 33, 71, 42
725
  db 5, 36, 53, 53, 72
726
  db 5, 36, 53, 53, 72
726
  db 5,114, 83,131, 92
727
  db 5,114, 83,131, 92
727
  db 6, 60, 83,107, 92
728
  db 6, 60, 83,107, 92
728
  db 7, 84, 33,125, 42
729
  db 7, 84, 33,125, 42
729
  db 8,  1, 13,  5, 22
730
  db 8,  1, 13,  5, 22
730
  db 9,  1, 63,  5, 72
731
  db 9,  1, 63,  5, 72
731
  db 1,  1,  1,148,105
732
  db 1,  1,  1,148,105
732
  db -1
733
  db -1
733
;// ]
734
;// ]
734
 
735
 
735
sz symbols_ex,';?.%"',"'"
736
sz symbols_ex,';?.%"',"'"
736
sz symbols   ,'#&*\:/<>|{}()[]=+-, '
737
sz symbols   ,'#&*\:/<>|{}()[]=+-, '
737
 
738
 
738
sz ini_sec_window   ,'Window',0
739
sz ini_sec_window   ,'Window',0
739
sz ini_window_top   ,'Top',0
740
sz ini_window_top   ,'Top',0
740
sz ini_window_left  ,'Left',0
741
sz ini_window_left  ,'Left',0
741
sz ini_window_right ,'Right',0
742
sz ini_window_right ,'Right',0
742
sz ini_window_bottom,'Bottom',0
743
sz ini_window_bottom,'Bottom',0
743
 
744
 
744
TINYPAD_END:	 ; end of file
745
TINYPAD_END:	 ; end of file
745
 
746
 
746
self_path rb PATHL
747
self_path rb PATHL
747
 
748
 
748
;-----------------------------------------------------------------------------
749
;-----------------------------------------------------------------------------
749
section @UDATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
750
section @UDATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
750
;-----------------------------------------------------------------------------
751
;-----------------------------------------------------------------------------
751
 
752
 
752
app_start:
753
app_start:
753
	   dd ?,?
754
	   dd ?,?
754
 .params   dd ?
755
 .params   dd ?
755
	   dd ?,?
756
	   dd ?,?
756
	   db ?
757
	   db ?
757
 .filename dd ?
758
 .filename dd ?
758
 
759
 
759
f_info.length dd ?
760
f_info.length dd ?
760
f_info.path:
761
f_info.path:
761
    times PATHL+1 db ?
762
    times PATHL+1 db ?
762
f_info70 rd 7
763
f_info70 rd 7
763
 
764
 
764
file_info FILEINFO
765
file_info FILEINFO
765
 
766
 
766
checker_ed    EDITOR
767
checker_ed    EDITOR
767
checker_ed_ll dd ?
768
checker_ed_ll dd ?
768
 
769
 
769
tab_bar      TABCTL
770
tab_bar      TABCTL
770
virtual at tab_bar.Current
771
virtual at tab_bar.Current
771
  cur_tab      TABITEM
772
  cur_tab      TABITEM
772
end virtual
773
end virtual
773
virtual at tab_bar.Current.Editor
774
virtual at tab_bar.Current.Editor
774
  cur_editor   EDITOR
775
  cur_editor   EDITOR
775
end virtual
776
end virtual
776
 
777
 
777
lines.scr     dd ?    ; number of lines on the screen
778
lines.scr     dd ?    ; number of lines on the screen
778
columns.scr   dd ?    ; number of columns on the screen
779
columns.scr   dd ?    ; number of columns on the screen
779
top_ofs       dd ?    ; height occupied by top buttons
780
top_ofs       dd ?    ; height occupied by top buttons
780
bot_ofs       dd ?    ; height occupied by bottom buttons
781
bot_ofs       dd ?    ; height occupied by bottom buttons
781
	      dw ?
782
	      dw ?
782
left_ofs      dd ?    ;
783
left_ofs      dd ?    ;
783
__rc	      dd ?,?,?,?
784
__rc	      dd ?,?,?,?
784
copy_count    dd ?    ; number of lines for copying (Ctrl+E)
785
copy_count    dd ?    ; number of lines for copying (Ctrl+E)
785
copy_size     dd ?    ; size of data to copy
786
copy_size     dd ?    ; size of data to copy
786
s_title.size  dd ?    ; caption length
787
s_title.size  dd ?    ; caption length
787
 
788
 
788
cur_line_len  dd ?
789
cur_line_len  dd ?
789
h_popup       dd ?
790
h_popup       dd ?
790
bot_dlg_handler dd ?
791
bot_dlg_handler dd ?
791
 
792
 
792
sel.begin.x   dd ?
793
sel.begin.x   dd ?
793
sel.begin.y   dd ?
794
sel.begin.y   dd ?
794
sel.end.x     dd ?
795
sel.end.x     dd ?
795
sel.end.y     dd ?
796
sel.end.y     dd ?
796
sel.selected  db ?
797
sel.selected  db ?
797
 
798
 
798
in_sel	      db ?
799
in_sel	      db ?
799
 
800
 
800
do_not_draw   db ?    ; draw top and bottom buttons?
801
do_not_draw   db ?    ; draw top and bottom buttons?
801
main_closed   db ?    ; main window closed?
802
main_closed   db ?    ; main window closed?
802
tb_casesen    db ?    ; focused textbox is case-sensitive?
803
tb_casesen    db ?    ; focused textbox is case-sensitive?
803
 
804
 
804
draw_blines   db ?
805
draw_blines   db ?
805
 
806
 
806
align 4
807
align 4
807
s_fname.size  dd ?
808
s_fname.size  dd ?
808
s_fname       rb PATHL+1
809
s_fname       rb PATHL+1
809
align 4
810
align 4
810
s_search.size dd ?
811
s_search.size dd ?
811
s_search      rb PATHL+1
812
s_search      rb PATHL+1
812
 
813
 
813
s_title       rb PATHL+11  ; window caption
814
s_title       rb PATHL+11  ; window caption
814
 
815
 
815
chr db ?
816
chr db ?
816
ext db ?
817
ext db ?
817
shi dd ?
818
shi dd ?
818
 
819
 
819
align 4
820
align 4
820
cl_3d_normal dd ?
821
cl_3d_normal dd ?
821
cl_3d_pushed dd ?
822
cl_3d_pushed dd ?
822
cl_3d_outset dd ?
823
cl_3d_outset dd ?
823
cl_3d_inset  dd ?
824
cl_3d_inset  dd ?
824
cl_3d_grayed dd ?
825
cl_3d_grayed dd ?
825
 
826
 
826
tb_color     TBOX
827
tb_color     TBOX
827
tb_opensave  TBOX
828
tb_opensave  TBOX
828
tb_find      TBOX
829
tb_find      TBOX
829
tb_replace   TBOX
830
tb_replace   TBOX
830
tb_gotorow   TBOX
831
tb_gotorow   TBOX
831
tb_gotocol   TBOX
832
tb_gotocol   TBOX
832
 
833
 
833
focused_tb   dd ?
834
focused_tb   dd ?
834
 
835
 
835
key1 rb 256
836
key1 rb 256
836
 
837
 
837
mst  db ?
838
mst  db ?
838
mst2 db ?
839
mst2 db ?
839
mev  db ?
840
mev  db ?
840
mouse_captured	db ?
841
mouse_captured	db ?
841
just_from_popup db ?
842
just_from_popup db ?
842
 
843
 
843
bot_mode db ?
844
bot_mode db ?
844
 
845
 
845
align 4
846
align 4
846
 
847
 
847
bot_dlg_height dd ?
848
bot_dlg_height dd ?
848
bot_dlg_mode2  db ?
849
bot_dlg_mode2  db ?
849
 
850
 
850
temp_buf dd ?
851
temp_buf dd ?
851
copy_buf dd ?
852
copy_buf dd ?
852
 
853
 
853
;-----------------------------------------------------------------------------
854
;-----------------------------------------------------------------------------
854
section @PARAMS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
855
section @PARAMS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
855
;-----------------------------------------------------------------------------
856
;-----------------------------------------------------------------------------
856
 
857
 
857
fasm_parameters:
858
fasm_parameters:
858
 
859
 
859
p_info	process_information
860
p_info	process_information
860
p_info2 process_information
861
p_info2 process_information
861
sc	system_colors
862
sc	system_colors
862
 
863
 
863
rb 1024*4
864
rb 1024*4
864
MAIN_STACK:
865
MAIN_STACK:
865
rb 1024*4
866
rb 1024*4
866
POPUP_STACK:
867
POPUP_STACK:
867
 
868
 
868
STATIC_MEM_END:
869
STATIC_MEM_END:
869
 
870
 
870
diff10 'Main memory size',0,$
871
diff10 'Main memory size',0,$