Subversion Repositories Kolibri OS

Rev

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

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