Subversion Repositories Kolibri OS

Rev

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

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