Rev 242 | Rev 259 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
122 | diamond | 1 | ;----------------------------------------------------------------------------- |
31 | halyavin | 2 | ; project name: TINYPAD |
178 | heavyiron | 3 | ; compiler: flat assembler 1.67.1 |
4 | ; memory to compile: 2.0/7.0 MBytes (without/with size optimizations) |
||
258 | mikedld | 5 | ; version: 4.0.4 pre |
6 | ; last update: 2006-12-30 (Dec 30, 2006) |
||
178 | heavyiron | 7 | ; minimal kernel: revision #138 (svn://kolibrios.org/kernel) |
122 | diamond | 8 | ;----------------------------------------------------------------------------- |
9 | ; originally by: Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi |
||
258 | mikedld | 10 | ; maintained by: Mike Semenyako >> mike.dld@gmail.com |
11 | ; Ivan Poddubny >> ivan-yar@bk.ru |
||
122 | diamond | 12 | ;----------------------------------------------------------------------------- |
13 | ; TODO: |
||
178 | heavyiron | 14 | ; - optimize drawing (reduce flickering) |
15 | ; - optimize memory usage (allocate only needed amount, not static 3 Mbytes) |
||
16 | ; - add block selection ability, undo action, goto position |
||
17 | ; - working with multiple files (add tabs) |
||
18 | ; - improve window drawing with small dimensions |
||
19 | ; - other bugfixes and speed/size optimizations |
||
122 | diamond | 20 | ; |
31 | halyavin | 21 | ; HISTORY: |
258 | mikedld | 22 | ; 4.0.4 pre (mike.dld) |
23 | ; bug-fixes: |
||
24 | ; - clear statusbar text if dialog operation cancelled |
||
25 | ; changes: |
||
26 | ; - modified/saved colors now match those in MSVS |
||
27 | ; new features: |
||
28 | ; - recode tables between CP866, CP1251 and KOI8-R (suggested by Victor) |
||
178 | heavyiron | 29 | ; 4.0.3 (mike.dld) |
30 | ; bug-fixes: |
||
31 | ; - 1-char selection if pressing |
||
32 | ; - fault in `writepos`, added call to function 9 |
||
33 | ; - main menu items weren't highlighted if popup opened and cursor |
||
258 | mikedld | 34 | ; isn't in main menu item's area |
178 | heavyiron | 35 | ; - statusbar and textboxes drawing fixes (wrong colors) |
36 | ; - perform no redraw while pressing Shift, Ctrl, Alt keys |
||
258 | mikedld | 37 | ; - data length from DOCPAK in string representation (fixed by diamond) |
178 | heavyiron | 38 | ; changes: |
39 | ; - function 70 instead of 58 for files loading/saving |
||
40 | ; - clientarea-relative drawing (less code) |
||
41 | ; - every line's dword is now splitted into 2 words; |
||
42 | ; low word - line block length, so max line length is 65535 now |
||
43 | ; high word - various flags. for now, only 2 of 16 bits are used: |
||
44 | ; if bit #0 is set, line was modified since file open |
||
45 | ; if bit #1 is set, line was saved after last modification |
||
46 | ; high word could also be further used for code collapsing and different |
||
47 | ; line marking features (breakpoints, errors, bookmarks, etc.) |
||
48 | ; new features: |
||
49 | ; - line markers for modified and saved lines |
||
50 | ; - status messages for various actions |
||
122 | diamond | 51 | ; 4.0.2 (mike.dld) |
52 | ; bug-fixes: |
||
53 | ; - program terminates if started with parameters (fine for DOCPAK) |
||
54 | ; 4.0.1 (mike.dld) |
||
55 | ; bug-fixes: |
||
56 | ; - unable to run program after exiting from main menu (Alt+X) |
||
57 | ; new features: |
||
58 | ; - integration with DOCPAK |
||
59 | ; 4.0 (mike.dld) |
||
60 | ; bug-fixes: |
||
61 | ; - main menu popups' "on show" was called only for first shown popup |
||
62 | ; - clear selection on left/right arrow keys |
||
63 | ; new features: |
||
64 | ; - "replace" dialog (w/o "skip", "replace all") |
||
65 | ; - line numbers display |
||
66 | ; - options (except "appearance" and "smart tabulation") |
||
67 | ; - options saving (colors, window position, "Options" popup triggers) |
||
68 | ; 4.0 beta 2 (mike.dld) |
||
69 | ; bug-fixes: |
||
70 | ; - unable to start if /rd/1/example.asm is missing (from Halyavin) |
||
71 | ; - clicking on menu items draws main window in popup (from Rohan) |
||
72 | ; - passed parameters aren't taken into account (from Mario79) |
||
73 | ; - background isn't erased if text lines < screen lines after |
||
74 | ; selection deletion (from Rohan) |
||
75 | ; 4.0 beta 1 (mike.dld) |
||
76 | ; menu bar and popup menu; |
||
77 | ; removed buttons from the top and input fields from the bottom since |
||
78 | ; now they're accesible through main/popup menu; |
||
79 | ; improved keyboard handling (using 66th function); |
||
80 | ; support for almost all FASMW keyboard shourtcuts; |
||
81 | ; added text selection ability, standard selection operations |
||
82 | ; (copy,cut,paste); |
||
83 | ; new integrated dialogs (open, save, find) |
||
84 | ; fix to collapse SPACEs into TABs only for *.asm and *.inc files |
||
31 | halyavin | 85 | ; 3.78a (mike.dld) |
122 | diamond | 86 | ; fixed termination while typing in x positions higher than (line_length+10); |
31 | halyavin | 87 | ; improved drawing on small heights |
122 | diamond | 88 | ; don't draw window while its height = 0 (Kolibri "minimize" support) |
31 | halyavin | 89 | ; 3.78 (mike.dld) |
90 | ; now lines may be of ANY length; |
||
91 | ; optimized memory usage (less memory for internal file representation) |
||
92 | ; after loading file, it's internal size equals to its real size |
||
93 | ; plus 14 bytes for each line (4 bytes for line length |
||
122 | diamond | 94 | ; and 10 spaced to the end - to reduce data relocations count); |
31 | halyavin | 95 | ; completely rewritten keyboard handling; |
96 | ; added horizontal scrollbar; |
||
97 | ; all line feed formats are supported: WIN(CRLF),*NIX(LF),MAC(CR); |
||
98 | ; etc. |
||
99 | ; 3.77 (mike.dld) |
||
100 | ; changed save_string to collapse SPACEs into TABs; |
||
101 | ; rewrote drawfile from scratch (speed++) |
||
178 | heavyiron | 102 | ; through some drawing improvements needed |
31 | halyavin | 103 | ; (some checkups to reduce flickering); |
104 | ; writepos (size--); |
||
105 | ; fixed drawing window while height < 100px, and for non-asm files; |
||
106 | ; several small fixes; speed/size optimizations |
||
107 | ; 3.76 (mike.dld) |
||
108 | ; changed loadfile/loadhdfile to expand TABs into SPACEs; |
||
109 | ; changed TAB,ENTER,DELETE,BSPACE keys behaviour (rewritten from scratch); |
||
110 | ; vertical scrollbar; |
||
111 | ; extra window resizing capabilities (added a couple of constants); |
||
112 | ; completely new text cursor management & moving text cursor with mouse; |
||
113 | ; improved search function, moving cursor to beginning of text found; |
||
122 | diamond | 114 | ; adjustable max line width (change LINE_WIDTH & recompile) // (obsolet) |
31 | halyavin | 115 | ; 3.75a |
116 | ; fixed converting char to upper case in read_string |
||
117 | ; 3.75 |
||
118 | ; rewrote save_file from scratch; bugfix in loadfile; |
||
119 | ; 3.74 |
||
120 | ; optimisation |
||
121 | ; 3.73 |
||
122 | ; completly new load_file function |
||
123 | ; 3.72 |
||
124 | ; speed++ |
||
125 | ; 3.71 |
||
126 | ; error beep |
||
127 | ; 3.6,3.7: |
||
128 | ; many bugs fixed |
||
129 | ; simple toolbar |
||
130 | ; compile, run applications from TINYPAD, all fasm output is in debug board |
||
131 | ; TAB button |
||
132 | ; auto-indent |
||
133 | ; Ctrl+L - insert comment string |
||
122 | diamond | 134 | ;----------------------------------------------------------------------------- |
31 | halyavin | 135 | ; Memory 0x300000: |
122 | diamond | 136 | ; stack for popup 0x00dff0 - |
137 | ; stack for help 0x00eff0 - |
||
138 | ; stack 0x00fff0 - |
||
139 | ; load position 0x010000 + |
||
140 | ; edit area 0x080000 + |
||
141 | ; copy/paste area 0x2f0000 + |
||
142 | ;----------------------------------------------------------------------------- |
||
31 | halyavin | 143 | |
178 | heavyiron | 144 | include 'lang.inc' |
31 | halyavin | 145 | include 'macros.inc' ; useful stuff |
178 | heavyiron | 146 | ;include 'proc32.inc' |
122 | diamond | 147 | include 'tinypad.inc' |
178 | heavyiron | 148 | ;purge mov,add,sub ; SPEED |
31 | halyavin | 149 | |
122 | diamond | 150 | header '01',1,@CODE,TINYPAD_END,AREA_ENDMEM,MAIN_STACK,@PARAMS,self_path |
31 | halyavin | 151 | |
258 | mikedld | 152 | APP_VERSION equ '4.0.4 pre' |
153 | |||
122 | diamond | 154 | ;include 'debug.inc' |
31 | halyavin | 155 | |
258 | mikedld | 156 | ASEPC = '-' ; separator character (char) |
157 | ATOPH = POP_IHEIGHT+2 ; menu bar height (pixels) |
||
122 | diamond | 158 | ;OLEFT = 50+1 ; left offset (pixels) !!! don't change !!! |
258 | mikedld | 159 | SCRLW = 16 ; scrollbar widht/height (pixels) |
160 | ATABW = 8 ; tab width (chars) |
||
161 | LINEH = 10 ; line height (pixels) |
||
162 | PATHL = 255 ; maximum path length (chars) !!! don't change !!! |
||
163 | AMINS = 8 ; minimal scroll thumb size (pixels) |
||
164 | LCHGW = 2 ; changed/saved marker width |
||
31 | halyavin | 165 | |
258 | mikedld | 166 | STATH = 14 ; status bar height |
31 | halyavin | 167 | |
122 | diamond | 168 | MEV_LDOWN = 1 |
169 | MEV_LUP = 2 |
||
170 | MEV_RDOWN = 3 |
||
171 | MEV_RUP = 4 |
||
172 | MEV_MOVE = 5 |
||
173 | |||
31 | halyavin | 174 | ;----------------------------------------------------------------------------- |
122 | diamond | 175 | section @OPTIONS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
31 | halyavin | 176 | ;----------------------------------------------------------------------------- |
177 | |||
122 | diamond | 178 | label color_tbl dword |
258 | mikedld | 179 | RGB( 0, 0, 0) ; RGB( 0, 0, 0) ; RGB( 0, 0, 0) ; text |
180 | RGB( 0,144, 0) ; RGB( 0,144, 0) ; RGB( 0,160, 0) ; numbers |
||
181 | RGB(176, 0, 0) ; RGB(160, 0, 0) ; RGB( 0,128,255) ; strings |
||
122 | diamond | 182 | RGB(128,128,128) ; RGB(144,144,144) ; RGB(160,160,160) ; comments |
183 | RGB( 48, 48,240) ; RGB( 48, 48,240) ; RGB(255, 0, 0) ; symbols |
||
184 | RGB(255,255,255) ; RGB(224,224,224) ; RGB(255,255,255) ; background |
||
185 | RGB(255,255,255) ; RGB(255,255,255) ; RGB(255,255,255) ; selection text |
||
186 | RGB( 10, 36,106) ; RGB( 0, 0,128) ; RGB( 0, 64,128) ; selection background |
||
258 | mikedld | 187 | RGB(255,255, 0) ; modified line marker |
188 | RGB( 0,255, 0) ; saved line marker |
||
31 | halyavin | 189 | |
122 | diamond | 190 | ins_mode db 1 |
31 | halyavin | 191 | |
122 | diamond | 192 | options db OPTS_AUTOINDENT+OPTS_OPTIMSAVE+OPTS_SMARTTAB |
31 | halyavin | 193 | |
122 | diamond | 194 | mainwnd_pos: |
195 | .x dd 100 |
||
196 | .y dd 75 |
||
197 | .w dd 6*80+6+SCRLW+5 |
||
198 | .h dd 402 |
||
31 | halyavin | 199 | |
122 | diamond | 200 | ;----------------------------------------------------------------------------- |
201 | section @CODE ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
||
202 | ;----------------------------------------------------------------------------- |
||
31 | halyavin | 203 | |
122 | diamond | 204 | ; fninit |
31 | halyavin | 205 | |
178 | heavyiron | 206 | ; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_left,50 |
207 | ; mov [mainwnd_pos.x],eax |
||
208 | ; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_top,50 |
||
209 | ; mov [mainwnd_pos.y],eax |
||
210 | ; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_right,350 |
||
211 | ; sub eax,[mainwnd_pos.x] |
||
212 | ; mov [mainwnd_pos.w],eax |
||
213 | ; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_bottom,450 |
||
214 | ; sub eax,[mainwnd_pos.y] |
||
215 | ; mov [mainwnd_pos.h],eax |
||
216 | |||
258 | mikedld | 217 | cld |
218 | mov edi,@UDATA |
||
219 | mov ecx,@PARAMS-@UDATA |
||
220 | mov al,0 |
||
221 | rep stosb |
||
31 | halyavin | 222 | |
178 | heavyiron | 223 | inc [do_not_draw] |
224 | |||
258 | mikedld | 225 | mov [left_ofs],40+1 |
226 | mov [f_info+4],0 |
||
227 | mov [f_info+12],AREA_TEMP |
||
228 | mov [f_info+16],AREA_EDIT-AREA_TEMP |
||
31 | halyavin | 229 | |
258 | mikedld | 230 | mov esi,s_example |
231 | mov edi,tb_opensave.text |
||
232 | mov ecx,s_example.size |
||
233 | mov [tb_opensave.length],cl |
||
234 | rep movsb |
||
31 | halyavin | 235 | |
258 | mikedld | 236 | mov esi,s_still |
237 | mov edi,s_search |
||
238 | mov ecx,s_still.size |
||
239 | mov [s_search.size],ecx |
||
240 | rep movsb |
||
31 | halyavin | 241 | |
258 | mikedld | 242 | cmp byte[@PARAMS],0 |
243 | jz no_params |
||
31 | halyavin | 244 | |
122 | diamond | 245 | ;// Willow's code to support DOCPAK [ |
31 | halyavin | 246 | |
258 | mikedld | 247 | cmp byte[@PARAMS],'*' |
248 | jne .noipc |
||
178 | heavyiron | 249 | |
250 | ;// diamond [ (convert size from decimal representation to dword) |
||
251 | ;-- mov edx,dword[@PARAMS+1] |
||
258 | mikedld | 252 | mov esi,@PARAMS+1 |
253 | xor edx,edx |
||
254 | xor eax,eax |
||
178 | heavyiron | 255 | @@: lodsb |
258 | mikedld | 256 | test al,al |
257 | jz @f |
||
258 | lea edx,[edx*4+edx] |
||
259 | lea edx,[edx*2+eax-'0'] |
||
260 | jmp @b |
||
178 | heavyiron | 261 | @@: |
262 | ;// diamond ] |
||
263 | |||
258 | mikedld | 264 | add edx,20 |
265 | mcall 60,1,AREA_TEMP-16 ; 0x10000-16 |
||
266 | mov dword[AREA_TEMP-16+4],8 ; [0x10000-16+4],8 |
||
267 | mcall 40,1000000b |
||
268 | mcall 23,200 |
||
269 | cmp eax,7 |
||
270 | jne key.alt_x.close ; ¤Єю эр mcall -1 ьхЄър |
||
271 | mov esi,AREA_TEMP-16 ; 0x10000-16 |
||
272 | mov byte[esi],1 |
||
273 | mov eax,[esi+12] |
||
274 | inc eax |
||
275 | call load_file.file_found |
||
276 | jmp @f |
||
122 | diamond | 277 | .noipc: |
31 | halyavin | 278 | |
122 | diamond | 279 | ;// Willow's code to support DOCPAK ] |
31 | halyavin | 280 | |
122 | diamond | 281 | ; parameters are at @PARAMS |
258 | mikedld | 282 | mov esi,@PARAMS |
283 | mov edi,tb_opensave.text |
||
284 | mov ecx,PATHL |
||
285 | rep movsb |
||
286 | mov edi,tb_opensave.text |
||
287 | mov ecx,PATHL |
||
288 | xor al,al |
||
289 | repne scasb |
||
290 | jne key.alt_x.close |
||
291 | lea eax,[edi-tb_opensave.text-1] |
||
292 | mov [tb_opensave.length],al |
||
31 | halyavin | 293 | |
122 | diamond | 294 | no_params: |
258 | mikedld | 295 | call btn.load_file;do_load_file |
296 | jnc @f |
||
297 | call new_file |
||
31 | halyavin | 298 | |
299 | @@: |
||
178 | heavyiron | 300 | dec [do_not_draw] |
258 | mikedld | 301 | mcall 66,1,1 |
302 | mcall 40,00100111b |
||
178 | heavyiron | 303 | red: |
258 | mikedld | 304 | call drawwindow |
178 | heavyiron | 305 | call check_inv_all.skip_check |
31 | halyavin | 306 | |
122 | diamond | 307 | ;----------------------------------------------------------------------------- |
31 | halyavin | 308 | |
122 | diamond | 309 | still: |
310 | call writepos ; write current position & number of strings |
||
31 | halyavin | 311 | |
122 | diamond | 312 | .skip_write: |
258 | mikedld | 313 | mcall 10;23,50; wait here until event |
314 | cmp [main_closed],0 |
||
315 | jne key.alt_x |
||
316 | dec eax ; redraw ? |
||
317 | jz red |
||
318 | dec eax ; key ? |
||
319 | jz key |
||
320 | dec eax ; button ? |
||
321 | jz button |
||
322 | sub eax,3 ; mouse ? |
||
323 | jz mouse |
||
31 | halyavin | 324 | |
258 | mikedld | 325 | jmp still.skip_write |
31 | halyavin | 326 | |
122 | diamond | 327 | ;----------------------------------------------------------------------------- |
328 | func start_fasm ;///////////////////////////////////////////////////////////// |
||
329 | ;----------------------------------------------------------------------------- |
||
31 | halyavin | 330 | ; BL = run after compile |
122 | diamond | 331 | ;----------------------------------------------------------------------------- |
258 | mikedld | 332 | cmp [asm_mode],0 |
333 | jne @f |
||
334 | ret |
||
335 | @@: mov esi,f_info.path ; s_fname |
||
336 | mov edi,fasm_parameters |
||
31 | halyavin | 337 | |
258 | mikedld | 338 | cmp byte[esi],'/' |
339 | je .yes_systree |
||
31 | halyavin | 340 | |
258 | mikedld | 341 | mov ecx,[f_info.length] ; [s_fname.size] |
342 | rep movsb |
||
31 | halyavin | 343 | |
258 | mikedld | 344 | mov al,',' |
345 | stosb |
||
31 | halyavin | 346 | |
258 | mikedld | 347 | mov ecx,[f_info.length] ; [s_fname.size] |
348 | add ecx,-4 |
||
349 | mov esi,f_info.path ; s_fname |
||
350 | rep movsb |
||
31 | halyavin | 351 | |
258 | mikedld | 352 | mov al,',' |
353 | stosb |
||
31 | halyavin | 354 | |
258 | mikedld | 355 | mov dword[edi],'/RD/' |
356 | mov word[edi+4],'1/' |
||
357 | add edi,6 |
||
31 | halyavin | 358 | |
258 | mikedld | 359 | mov al,0 |
360 | stosb |
||
31 | halyavin | 361 | |
258 | mikedld | 362 | jmp .run |
31 | halyavin | 363 | |
364 | .yes_systree: |
||
258 | mikedld | 365 | mov eax,[f_info.length] |
366 | add esi,eax ; [s_fname.size] |
||
367 | dec esi |
||
31 | halyavin | 368 | |
258 | mikedld | 369 | xor ecx,ecx |
370 | mov al,'/' |
||
371 | @@: cmp [esi],al |
||
372 | je @f |
||
373 | dec esi |
||
374 | inc ecx |
||
375 | jmp @b |
||
376 | @@: inc esi |
||
31 | halyavin | 377 | |
258 | mikedld | 378 | push esi esi ecx |
31 | halyavin | 379 | |
258 | mikedld | 380 | rep movsb |
31 | halyavin | 381 | |
258 | mikedld | 382 | mov al,',' |
383 | stosb |
||
31 | halyavin | 384 | |
258 | mikedld | 385 | pop ecx esi |
31 | halyavin | 386 | |
258 | mikedld | 387 | add ecx,-4 |
388 | rep movsb |
||
31 | halyavin | 389 | |
258 | mikedld | 390 | mov al,',' |
391 | stosb |
||
31 | halyavin | 392 | |
258 | mikedld | 393 | pop ecx |
394 | sub ecx,f_info.path ; s_fname |
||
395 | mov esi,f_info.path ; s_fname |
||
31 | halyavin | 396 | |
258 | mikedld | 397 | rep movsb |
31 | halyavin | 398 | |
258 | mikedld | 399 | mov al,0 |
400 | stosb |
||
31 | halyavin | 401 | |
402 | .run: |
||
258 | mikedld | 403 | cmp bl,0 ; run outfile ? |
404 | je @f |
||
405 | mov dword[edi-1],',run' |
||
406 | mov byte[edi+3],0 |
||
178 | heavyiron | 407 | @@: |
258 | mikedld | 408 | mov ebx, fasm_start |
178 | heavyiron | 409 | start_ret: |
258 | mikedld | 410 | mov eax, 70 |
411 | int 0x40 |
||
412 | ret |
||
31 | halyavin | 413 | endf |
414 | |||
122 | diamond | 415 | ;----------------------------------------------------------------------------- |
416 | func open_debug_board ;/////////////////////////////////////////////////////// |
||
417 | ;----------------------------------------------------------------------------- |
||
258 | mikedld | 418 | mov ebx, board_start |
419 | jmp start_ret |
||
31 | halyavin | 420 | endf |
421 | |||
122 | diamond | 422 | ;----------------------------------------------------------------------------- |
423 | func open_sysfuncs_txt ;////////////////////////////////////////////////////// |
||
424 | ;----------------------------------------------------------------------------- |
||
258 | mikedld | 425 | mov ebx, docpak_start |
426 | call start_ret |
||
427 | cmp eax,0xfffffff0 |
||
428 | jb @f |
||
429 | mov ebx, tinypad_start |
||
430 | mov dword [ebx+8], sysfuncs_filename |
||
431 | call start_ret |
||
122 | diamond | 432 | @@: ret |
31 | halyavin | 433 | endf |
434 | |||
122 | diamond | 435 | ;----------------------------------------------------------------------------- |
178 | heavyiron | 436 | ;func layout ;///// change keyboard layout /////////////////////////////////// |
122 | diamond | 437 | ;----------------------------------------------------------------------------- |
178 | heavyiron | 438 | ; mcall 19,setup,param_setup |
439 | ; mcall 5,eax |
||
440 | ;; call activate_me |
||
441 | ;; ret |
||
442 | ;;endf |
||
443 | |||
444 | ;;func activate_me |
||
445 | ; mcall 9,p_info,-1 |
||
446 | ; inc eax |
||
447 | ; inc eax |
||
448 | ; mov ecx,eax |
||
449 | ; mov edi,[p_info.PID] |
||
450 | ; mov ebx,p_info |
||
451 | ; @@: dec ecx |
||
452 | ; jz @f ; counter=0 => not found? => return |
||
453 | ; mcall 9 |
||
454 | ; cmp edi,[p_info.PID] |
||
455 | ; jne @b |
||
456 | ; mcall 18,3 |
||
457 | ; mcall 5,eax |
||
458 | ; @@: ret |
||
31 | halyavin | 459 | ;endf |
460 | |||
122 | diamond | 461 | func set_opt |
258 | mikedld | 462 | test [options],al |
463 | je @f |
||
464 | not al |
||
465 | and [options],al |
||
466 | ret |
||
467 | @@: or [options],al |
||
468 | ret |
||
31 | halyavin | 469 | endf |
470 | |||
122 | diamond | 471 | func set_line_numbers |
258 | mikedld | 472 | mov al,OPTS_LINENUMS |
473 | call set_opt |
||
474 | ret |
||
31 | halyavin | 475 | endf |
476 | |||
122 | diamond | 477 | func set_optimal_fill |
258 | mikedld | 478 | mov al,OPTS_OPTIMSAVE |
479 | call set_opt |
||
480 | ret |
||
31 | halyavin | 481 | endf |
482 | |||
122 | diamond | 483 | func set_auto_indents |
258 | mikedld | 484 | mov al,OPTS_AUTOINDENT |
485 | call set_opt |
||
486 | ret |
||
31 | halyavin | 487 | endf |
488 | |||
122 | diamond | 489 | func set_auto_braces |
258 | mikedld | 490 | mov al,OPTS_AUTOBRACES |
491 | call set_opt |
||
492 | ret |
||
31 | halyavin | 493 | endf |
494 | |||
122 | diamond | 495 | func set_secure_sel |
258 | mikedld | 496 | mov al,OPTS_SECURESEL |
497 | call set_opt |
||
498 | ret |
||
31 | halyavin | 499 | endf |
500 | |||
122 | diamond | 501 | ;----------------------------------------------------------------------------- |
31 | halyavin | 502 | |
122 | diamond | 503 | include 'tp-draw.asm' |
504 | include 'tp-key.asm' |
||
258 | mikedld | 505 | include 'tp-button.asm' |
122 | diamond | 506 | include 'tp-mouse.asm' |
507 | include 'tp-files.asm' |
||
258 | mikedld | 508 | include 'tp-common.asm' |
509 | include 'tp-dialog.asm' |
||
122 | diamond | 510 | include 'tp-popup.asm' |
511 | include 'tp-tbox.asm' |
||
258 | mikedld | 512 | include 'tp-recode.asm' |
31 | halyavin | 513 | |
178 | heavyiron | 514 | ;include 'lib-ini.asm' |
515 | |||
31 | halyavin | 516 | ;----------------------------------------------------------------------------- |
122 | diamond | 517 | section @DATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
31 | halyavin | 518 | ;----------------------------------------------------------------------------- |
519 | |||
122 | diamond | 520 | ;addr dd s_fname ; address of input string |
521 | ;temp dd 0xABCD ; used in read_string |
||
522 | vscrl_capt dd -1 |
||
523 | hscrl_capt dd -1 |
||
524 | body_capt dd -1 |
||
31 | halyavin | 525 | |
122 | diamond | 526 | key0 db \ |
527 | 0x00,0x00,0x02,0x03,0x04,0x05,0x06,0x07,\ |
||
528 | 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x00,0x00,\ |
||
529 | 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,\ |
||
530 | 0x18,0x19,0x1A,0x1B,0x00,0x00,0x1E,0x1F,\ |
||
531 | 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,\ |
||
532 | 0x28,0x29,0x00,0x2B,0x2C,0x2D,0x2E,0x2F,\ |
||
533 | 0x30,0x31,0x32,0x33,0x34,0x35,0x00,0x00,\ |
||
534 | 0x00,0x39,0x00,0x00,0x00,0x00,0x00,0x00 |
||
535 | times 12*16 db 0x00 |
||
31 | halyavin | 536 | |
258 | mikedld | 537 | accel_table dd \ |
538 | 0x0000000E,key.bkspace ,\ ; BackSpace |
||
539 | 0x0000000F,key.tab ,\ ; Tab |
||
540 | 0x0000001C,key.return ,\ ; Return |
||
541 | 0x0000003D,key.f3 ,\ ; F3 |
||
542 | 0x00000043,key.f9 ,\ ; F9 |
||
543 | 0x00000147,key.home ,\ ; Home |
||
544 | 0x00000148,key.up ,\ ; Up |
||
545 | 0x00000149,key.pgup ,\ ; PageUp |
||
546 | 0x0000014B,key.left ,\ ; Left |
||
547 | 0x0000014D,key.right ,\ ; Right |
||
548 | 0x0000014F,key.end ,\ ; End |
||
549 | 0x00000150,key.down ,\ ; Down |
||
550 | 0x00000151,key.pgdn ,\ ; PageDown |
||
551 | 0x00000152,key.ins ,\ ; Insert |
||
552 | 0x00000153,key.del ,\ ; Delete |
||
553 | 0x00010147,key.shift_home ,\ ; Shift+Home |
||
554 | 0x00010148,key.shift_up ,\ ; Shift+Up |
||
555 | 0x00010149,key.shift_pgup ,\ ; Shift+PageUp |
||
556 | 0x0001014B,key.shift_left ,\ ; Shift+Left |
||
557 | 0x0001014D,key.shift_right ,\ ; Shift+Right |
||
558 | 0x0001014F,key.shift_end ,\ ; Shift+End |
||
559 | 0x00010150,key.shift_down ,\ ; Shift+Down |
||
560 | 0x00010151,key.shift_pgdn ,\ ; Shift+PageDown |
||
561 | 0x00010153,key.del ,\ ; Shift+Delete |
||
562 | 0x00020015,key.ctrl_y ,\ ; Ctrl+Y |
||
563 | 0x00020018,key.ctrl_o ,\ ; Ctrl+O |
||
564 | 0x0002001E,key.ctrl_a ,\ ; Ctrl+A |
||
565 | 0x0002001F,key.ctrl_s ,\ ; Ctrl+S |
||
566 | 0x00020020,key.ctrl_d ,\ ; Ctrl+D |
||
567 | 0x00020021,key.ctrl_f ,\ ; Ctrl+F |
||
568 | 0x00020022,key.ctrl_g ,\ ; Ctrl+G |
||
569 | 0x00020023,key.ctrl_h ,\ ; Ctrl+H |
||
122 | diamond | 570 | \;0x00020026,key.ctrl_l ,\ ; Ctrl+L |
258 | mikedld | 571 | 0x0002002D,key.ctrl_x ,\ ; Ctrl+X |
572 | 0x0002002E,key.ctrl_c ,\ ; Ctrl+C |
||
573 | 0x0002002F,key.ctrl_v ,\ ; Ctrl+V |
||
574 | 0x00020031,key.ctrl_n ,\ ; Ctrl+N |
||
575 | 0x00020043,key.ctrl_f9 ,\ ; Ctrl+F9 |
||
576 | 0x00020147,key.ctrl_home ,\ ; Ctrl+Home |
||
122 | diamond | 577 | \;0x00020148,key.ctrl_up ,\ ; Ctrl+Up |
258 | mikedld | 578 | 0x00020149,key.ctrl_pgup ,\ ; Ctrl+PageUp |
579 | 0x0002014B,key.ctrl_left ,\ ; Ctrl+Left |
||
580 | 0x0002014D,key.ctrl_right ,\ ; Ctrl+Right |
||
581 | 0x0002014F,key.ctrl_end ,\ ; Ctrl+End |
||
122 | diamond | 582 | \;0x00020150,key.ctrl_down ,\ ; Ctrl+Down |
258 | mikedld | 583 | 0x00020151,key.ctrl_pgdn ,\ ; Ctrl+PageDown |
584 | 0x00020153,key.del ,\ ; Ctrl+Del |
||
585 | 0x0003001F,key.shift_ctrl_s ,\ ; Shift+Ctrl+S |
||
122 | diamond | 586 | 0x00030147,key.shift_ctrl_home ,\ ; Shift+Ctrl+Home |
587 | \;0x00030148,key.shift_ctrl_up ,\ ; Shift+Ctrl+Up |
||
588 | 0x00030149,key.shift_ctrl_pgup ,\ ; Shift+Ctrl+PageUp |
||
589 | 0x0003014B,key.shift_ctrl_left ,\ ; Shift+Ctrl+Left |
||
590 | 0x0003014D,key.shift_ctrl_right ,\ ; Shift+Ctrl+Right |
||
591 | 0x0003014F,key.shift_ctrl_end ,\ ; Shift+Ctrl+End |
||
592 | \;0x00030150,key.shift_ctrl_down ,\ ; Shift+Ctrl+Down |
||
593 | 0x00030151,key.shift_ctrl_pgdn ,\ ; Shift+Ctrl+PageDown |
||
258 | mikedld | 594 | 0x0004002D,key.alt_x ,\ ; Alt+X |
122 | diamond | 595 | |
31 | halyavin | 596 | |
258 | mikedld | 597 | accel_table_textbox dd \ |
122 | diamond | 598 | \;0x00000001,key.tb.escape ,\ ; Escape |
258 | mikedld | 599 | 0x0000000E,key.tb.bkspace ,\ ; BackSpace |
122 | diamond | 600 | \;0x0000000F,key.tb.tab ,\ ; Tab |
601 | \;0x0000001C,key.tb.return ,\ ; Return |
||
258 | mikedld | 602 | 0x00000147,key.tb.home ,\ ; Home |
603 | 0x0000014B,key.tb.left ,\ ; Left |
||
604 | 0x0000014D,key.tb.right ,\ ; Right |
||
605 | 0x0000014F,key.tb.end ,\ ; End |
||
606 | 0x00000153,key.tb.del ,\ ; Delete |
||
607 | 0x00010147,key.tb.shift_home ,\ ; Shift+Home |
||
608 | 0x0001014B,key.tb.shift_left ,\ ; Shift+Left |
||
122 | diamond | 609 | 0x0001014D,key.tb.shift_right ,\ ; Shift+Right |
258 | mikedld | 610 | 0x0001014F,key.tb.shift_end ,\ ; Shift+End |
611 | 0x00010153,key.tb.del ,\ ; Shift+Del |
||
122 | diamond | 612 | |
31 | halyavin | 613 | |
258 | mikedld | 614 | accel_table2 dd \ |
122 | diamond | 615 | 1,btn.close_main_window ,\ |
616 | \;10000,btn.compile ,\ |
||
617 | \;10001,btn.compile_run ,\ |
||
618 | \;10002,btn.debug_board ,\ |
||
619 | \;10003,btn.sysfuncs_txt ,\ |
||
258 | mikedld | 620 | 'UP',btn.scroll_up ,\ |
621 | 'DN',btn.scroll_down ,\ |
||
622 | 'LT',btn.scroll_left ,\ |
||
122 | diamond | 623 | 'RT',btn.scroll_right ,\ |
624 | \;5,key.ctrl_o ,\ |
||
625 | |||
31 | halyavin | 626 | |
258 | mikedld | 627 | accel_table2_botdlg dd \ |
122 | diamond | 628 | 1,btn.close_main_window ,\ |
258 | mikedld | 629 | 20001,btn.bot.cancel ,\ |
122 | diamond | 630 | 20002,btn.bot.opensave ,\ |
258 | mikedld | 631 | 20003,btn.bot.find ,\ |
122 | diamond | 632 | |
31 | halyavin | 633 | |
634 | add_table: |
||
635 | ; times $61 db -$00 |
||
636 | times $1A db -$20 |
||
637 | times $25 db -$00 |
||
638 | times $10 db -$20 |
||
639 | times $30 db -$00 |
||
640 | times $10 db -$50 |
||
641 | times $04 db -$00,-$01 |
||
642 | times $08 db -$00 |
||
643 | |||
122 | diamond | 644 | ;error_beep db 0xA0,0x30,0 |
31 | halyavin | 645 | |
178 | heavyiron | 646 | s_status dd 0 |
647 | |||
122 | diamond | 648 | sz s_example,'EXAMPLE.ASM' |
31 | halyavin | 649 | sz s_still ,'still' |
650 | |||
122 | diamond | 651 | ;sz param_setup,'LANG',0 ; parameter for SETUP |
31 | halyavin | 652 | |
178 | heavyiron | 653 | fasm_start: |
258 | mikedld | 654 | dd 7 |
655 | dd 0 |
||
656 | dd fasm_parameters |
||
657 | dd 0 |
||
658 | dd 0 |
||
659 | db '/RD/1/DEVELOP/FASM',0 |
||
178 | heavyiron | 660 | board_start: |
258 | mikedld | 661 | dd 7 |
662 | dd 0 |
||
663 | dd 0 |
||
664 | dd 0 |
||
665 | dd 0 |
||
666 | db '/RD/1/BOARD',0 |
||
178 | heavyiron | 667 | tinypad_start: |
258 | mikedld | 668 | dd 7 |
669 | dd 0 |
||
670 | dd ? |
||
671 | dd 0 |
||
672 | dd 0 |
||
673 | db '/RD/1/TINYPAD',0 |
||
178 | heavyiron | 674 | docpak_start: |
258 | mikedld | 675 | dd 7 |
676 | dd 0 |
||
677 | dd sysfuncs_param |
||
678 | dd 0 |
||
679 | dd 0 |
||
680 | db '/RD/1/DOCPAK',0 |
||
178 | heavyiron | 681 | |
122 | diamond | 682 | ;sz setup ,'SETUP ' ; to change keyboard layout |
31 | halyavin | 683 | |
122 | diamond | 684 | sz sysfuncs_param,'g',0 |
685 | |||
31 | halyavin | 686 | lsz sysfuncs_filename,\ |
687 | ru,<'SYSFUNCR.TXT',0>,\ |
||
688 | en,<'SYSFUNCS.TXT',0> |
||
689 | |||
258 | mikedld | 690 | sz htext,'TINYPAD ',APP_VERSION |
31 | halyavin | 691 | |
692 | lszc help_text,b,\ |
||
693 | ru,'КОМАНДЫ:',\ |
||
694 | ru,' ',\ |
||
695 | ru,' CTRL+F1 : Это окно',\ |
||
696 | ru,' CTRL+S : Первая строка для копирования',\ |
||
697 | ru,' CTRL+E : Последняя строка для копирования',\ |
||
698 | ru,' CTRL+P : Вставить выбранное на текущую позицию',\ |
||
699 | ru,' CTRL+D : Удалить строку',\ |
||
700 | ru,' CTRL+L : Вставить строку-разделитель',\ |
||
701 | ru,' CTRL+[ : Перейти в начало файла',\ |
||
702 | ru,' CTRL+] : Перейти в конец файла',\ |
||
703 | ru,' CTRL+F2 : Загрузить файл',\ |
||
704 | ru,' CTRL+F3 : Поиск',\ |
||
705 | ru,' CTRL+F4 : Сохранить файл',\ |
||
706 | ru,' CTRL+F5 : Ввести имя файла',\ |
||
707 | ru,' CTRL+F6 : Ввести строку для поиска',\ |
||
708 | ru,' CTRL+F8 : Сменить раскладку клавиатуры',\ |
||
122 | diamond | 709 | \ |
31 | halyavin | 710 | en,'COMMANDS:',\ |
711 | en,' ',\ |
||
712 | en,' CTRL+F1 : SHOW THIS WINDOW',\ |
||
713 | en,' CTRL+S : SELECT FIRST STRING TO COPY',\ |
||
714 | en,' CTRL+E : SELECT LAST STRING TO COPY',\ |
||
715 | en,' CTRL+P : PASTE SELECTED TO CURRENT POSITION',\ |
||
716 | en,' CTRL+D : DELETE CURRENT LINE',\ |
||
717 | en,' CTRL+L : INSERT SEPARATOR LINE',\ |
||
718 | en,' CTRL+[ : GO TO THE BEGINNING OF FILE',\ |
||
719 | en,' CTRL+] : GO TO THE END OF FILE',\ |
||
720 | en,' CTRL+F2 : LOAD FILE',\ |
||
721 | en,' CTRL+F3 : SEARCH',\ |
||
722 | en,' CTRL+F4 : SAVE FILE',\ |
||
723 | en,' CTRL+F5 : ENTER FILENAME',\ |
||
724 | en,' CTRL+F6 : ENTER SEARCH STRING',\ |
||
122 | diamond | 725 | en,' CTRL+F8 : CHANGE KEYBOARD LAYOUT' |
726 | db 0 |
||
31 | halyavin | 727 | |
122 | diamond | 728 | menubar_res main_menu,\ |
258 | mikedld | 729 | ru,'Файл' ,popup_file ,onshow.file ,\ |
730 | ru,'Правка' ,popup_edit ,onshow.edit ,\ |
||
731 | ru,'Поиск' ,popup_search ,onshow.search ,\ |
||
732 | ru,'Запуск' ,popup_run ,onshow.run ,\ |
||
733 | ru,'Кодировка',popup_recode ,onshow.recode ,\ |
||
734 | ru,'Опции' ,popup_options,onshow.options,\ |
||
122 | diamond | 735 | \ |
258 | mikedld | 736 | en,'File' ,popup_file ,onshow.file ,\ |
737 | en,'Edit' ,popup_edit ,onshow.edit ,\ |
||
738 | en,'Search' ,popup_search ,onshow.search ,\ |
||
739 | en,'Run' ,popup_run ,onshow.run ,\ |
||
740 | en,'Encoding',popup_recode ,onshow.recode ,\ |
||
741 | en,'Options' ,popup_options,onshow.options |
||
31 | halyavin | 742 | |
122 | diamond | 743 | popup_res popup_file,\ |
258 | mikedld | 744 | ru,'Новый' ,'Ctrl+N' ,key.ctrl_n ,\ |
178 | heavyiron | 745 | ru,'Открыть...' ,'Ctrl+O' ,key.ctrl_o ,\ |
746 | ru,'Сохранить' ,'Ctrl+S' ,key.ctrl_s ,\ |
||
747 | ru,'Сохранить как...','Ctrl+Shift+S',key.shift_ctrl_s,\ |
||
258 | mikedld | 748 | ru,'-' ,'' ,0 ,\ |
749 | ru,'Выход' ,'Alt+X' ,key.alt_x ,\ |
||
122 | diamond | 750 | \ |
258 | mikedld | 751 | en,'New' ,'Ctrl+N' ,key.ctrl_n ,\ |
752 | en,'Open...' ,'Ctrl+O' ,key.ctrl_o ,\ |
||
753 | en,'Save' ,'Ctrl+S' ,key.ctrl_s ,\ |
||
178 | heavyiron | 754 | en,'Save as...','Ctrl+Shift+S',key.shift_ctrl_s,\ |
258 | mikedld | 755 | en,'-' ,'' ,0 ,\ |
756 | en,'Exit' ,'Alt+X' ,key.alt_x |
||
31 | halyavin | 757 | |
122 | diamond | 758 | popup_res popup_edit,\ |
759 | ru,'Вырезать' ,'Ctrl+X',key.ctrl_x,\ |
||
760 | ru,'Копировать' ,'Ctrl+C',key.ctrl_c,\ |
||
761 | ru,'Вставить' ,'Ctrl+V',key.ctrl_v,\ |
||
258 | mikedld | 762 | ru,'Удалить' ,'' ,key.del ,\ |
763 | ru,'-' ,'' ,0 ,\ |
||
122 | diamond | 764 | ru,'Выделить всё','Ctrl+A',key.ctrl_a,\ |
178 | heavyiron | 765 | \; ru,'-' ,'' ,0 ,\ |
766 | \; ru,'Вертикальное выделение','Alt+Ins',0 ,\ |
||
122 | diamond | 767 | \ |
258 | mikedld | 768 | en,'Cut' ,'Ctrl+X',key.ctrl_x,\ |
769 | en,'Copy' ,'Ctrl+C',key.ctrl_c,\ |
||
770 | en,'Paste' ,'Ctrl+V',key.ctrl_v,\ |
||
771 | en,'Delete' ,'' ,key.del ,\ |
||
772 | en,'-' ,'' ,0 ,\ |
||
178 | heavyiron | 773 | en,'Select all','Ctrl+A',key.ctrl_a;,\ |
774 | ; en,'-' ,'' ,0 ,\ |
||
775 | ; en,'Vertical selection','Alt+Ins',0 |
||
31 | halyavin | 776 | |
122 | diamond | 777 | popup_res popup_search,\ |
778 | ru,'Перейти...' ,'Ctrl+G',key.ctrl_g,\ |
||
258 | mikedld | 779 | ru,'-' ,'' ,0 ,\ |
122 | diamond | 780 | ru,'Найти...' ,'Ctrl+F',key.ctrl_f,\ |
781 | ru,'Найти далее','F3' ,key.f3 ,\ |
||
782 | ru,'Заменить...','Ctrl+H',key.ctrl_h,\ |
||
783 | \ |
||
784 | en,'Position...','Ctrl+G',key.ctrl_g,\ |
||
258 | mikedld | 785 | en,'-' ,'' ,0 ,\ |
786 | en,'Find...' ,'Ctrl+F',key.ctrl_f,\ |
||
122 | diamond | 787 | en,'Find next' ,'F3' ,key.f3 ,\ |
788 | en,'Replace...' ,'Ctrl+H',key.ctrl_h |
||
31 | halyavin | 789 | |
122 | diamond | 790 | popup_res popup_run,\ |
258 | mikedld | 791 | ru,'Запустить' ,'F9' ,key.f9 ,\ |
792 | ru,'Компилировать' ,'Ctrl+F9',key.ctrl_f9 ,\ |
||
793 | ru,'-' ,'' ,0 ,\ |
||
794 | ru,'Доска отладки' ,'' ,open_debug_board ,\ |
||
795 | ru,'Системные функции','' ,open_sysfuncs_txt,\ |
||
122 | diamond | 796 | \ |
258 | mikedld | 797 | en,'Run' ,'F9' ,key.f9 ,\ |
798 | en,'Compile' ,'Ctrl+F9',key.ctrl_f9 ,\ |
||
799 | en,'-' ,'' ,0 ,\ |
||
800 | en,'Debug board' ,'' ,open_debug_board ,\ |
||
801 | en,'System functions' ,'' ,open_sysfuncs_txt |
||
122 | diamond | 802 | |
258 | mikedld | 803 | popup_res popup_recode,\ |
804 | ru,'CP866 -> CP1251' ,'',recode.866.1251,\ |
||
805 | ru,'CP1251 -> CP866' ,'',recode.1251.866,\ |
||
806 | ru,'-' ,'',0,\ |
||
807 | ru,'CP866 -> KOI8-R' ,'',recode.866.koi,\ |
||
808 | ru,'KOI8-R -> CP866' ,'',recode.koi.866,\ |
||
809 | ru,'-' ,'',0,\ |
||
810 | ru,'CP1251 -> KOI8-R' ,'',recode.1251.koi,\ |
||
811 | ru,'KOI8-R -> CP1251' ,'',recode.koi.1251,\ |
||
812 | \ |
||
813 | en,'CP866 -> CP1251' ,'',recode.866.1251,\ |
||
814 | en,'CP1251 -> CP866' ,'',recode.1251.866,\ |
||
815 | en,'-' ,'',0,\ |
||
816 | en,'CP866 -> KOI8-R' ,'',recode.866.koi,\ |
||
817 | en,'KOI8-R -> CP866' ,'',recode.koi.866,\ |
||
818 | en,'-' ,'',0,\ |
||
819 | en,'CP1251 -> KOI8-R' ,'',recode.1251.koi,\ |
||
820 | en,'KOI8-R -> CP1251' ,'',recode.koi.1251 |
||
821 | |||
122 | diamond | 822 | popup_res popup_options,\ |
258 | mikedld | 823 | ru,'Внешний вид...' ,'',0,\ |
824 | ru,'-' ,'',0,\ |
||
122 | diamond | 825 | ru,'Безопасное выделение' ,'',set_secure_sel,\ |
826 | ru,'Автоматические скобки' ,'',set_auto_braces,\ |
||
827 | ru,'Автоматический отступ' ,'',set_auto_indents,\ |
||
258 | mikedld | 828 | ru,'Умная табуляция' ,'',0,\ |
122 | diamond | 829 | ru,'Оптимальное сохранение','',set_optimal_fill,\ |
258 | mikedld | 830 | ru,'-' ,'',0,\ |
831 | ru,'Номера строк' ,'',set_line_numbers,\ |
||
122 | diamond | 832 | \ |
258 | mikedld | 833 | en,'Appearance...' ,'',0,\ |
834 | en,'-' ,'',0,\ |
||
122 | diamond | 835 | en,'Secure selection' ,'',set_secure_sel,\ |
836 | en,'Automatic brackets' ,'',set_auto_braces,\ |
||
837 | en,'Automatic indents' ,'',set_auto_indents,\ |
||
838 | en,'Smart tabulation' ,'',0,\ |
||
839 | en,'Optimal fill on saving','',set_optimal_fill,\ |
||
258 | mikedld | 840 | en,'-' ,'',0,\ |
841 | en,'Line numbers' ,'',set_line_numbers |
||
122 | diamond | 842 | |
843 | lsz s_modified,\ |
||
844 | ru,'Изменено',\ |
||
845 | en,'Modified' |
||
846 | |||
847 | lsz s_2filename,\ |
||
848 | ru,'Имя файла:',\ |
||
849 | en,'Filename:' |
||
850 | lsz s_2open,\ |
||
851 | ru,'Открыть',\ |
||
852 | en,'Open' |
||
853 | lsz s_2save,\ |
||
854 | ru,'Сохранить',\ |
||
855 | en,'Save' |
||
856 | lsz s_2find,\ |
||
857 | ru,'Найти',\ |
||
858 | en,'Find' |
||
859 | db ':' |
||
860 | lsz s_2replace,\ |
||
861 | ru,'Заменить',\ |
||
862 | en,'Replace' |
||
863 | db ':' |
||
864 | lsz s_2cancel,\ |
||
865 | ru,'Отмена',\ |
||
866 | en,'Cancel' |
||
867 | |||
178 | heavyiron | 868 | lsz s_enter_filename,\ |
869 | ru,<'Введите имя файла',0>,\ |
||
870 | en,<'Enter filename',0> |
||
871 | |||
872 | lsz s_enter_text_to_find,\ |
||
873 | ru,<'Введите текст для поиска',0>,\ |
||
874 | en,<'Enter text to find',0> |
||
875 | |||
876 | lsz s_enter_text_to_replace,\ |
||
877 | ru,<'Введите текст для замены',0>,\ |
||
878 | en,<'Enter text to replace',0> |
||
879 | |||
880 | lsz s_text_not_found,\ |
||
881 | ru,<'Достигнут конец файла, текст не найден',0>,\ |
||
882 | en,<'Reached end of file, text not found',0> |
||
883 | |||
884 | lszc s_fs_error,b,\ |
||
885 | ru,<'Операция завершена успешно (0)',0>,\ |
||
886 | ru,<'',0>,\ |
||
887 | ru,<'Функция не поддерживается для данной файловой системы (2)',0>,\ |
||
888 | ru,<'Неизвестная файловая система (3)',0>,\ |
||
889 | ru,<'',0>,\ |
||
890 | ru,<'Невозможно открыть файл (5)',0>,\ |
||
891 | ru,<'Операция завершена успешно (6)',0>,\ |
||
892 | ru,<'Адрес находится за границами памяти программы (7)',0>,\ |
||
893 | ru,<'На диске нет свободного места (8)',0>,\ |
||
894 | ru,<'Таблица FAT уничтожена (9)',0>,\ |
||
895 | ru,<'Доступ запрещён (10)',0>,\ |
||
896 | ru,<'Ошибка устройства (11)',0>,\ |
||
897 | \ |
||
898 | en,<'Operation executed successfully (0)',0>,\ |
||
899 | en,<'',0>,\ |
||
900 | en,<'Function is not supported for the given filesystem (2)',0>,\ |
||
901 | en,<'Unknown filesystem (3)',0>,\ |
||
902 | en,<'',0>,\ |
||
903 | en,<'Unable to open file (5)',0>,\ |
||
904 | en,<'Operation executed successfully (6)',0>,\ |
||
905 | en,<'Pointer lies outside of application memory (7)',0>,\ |
||
906 | en,<'Disk is full (8)',0>,\ |
||
907 | en,<'FAT table is destroyed (9)',0>,\ |
||
908 | en,<'Access denied (10)',0>,\ |
||
909 | en,<'Device error (11)',0> |
||
910 | |||
122 | diamond | 911 | sz symbols_ex,';?.%"',"'" |
912 | sz symbols ,'#&*\:/<>|{}()[]=+-, ' |
||
913 | |||
258 | mikedld | 914 | ini_sec_window db 'Window',0 |
915 | ini_window_top db 'Top',0 |
||
178 | heavyiron | 916 | ini_window_left db 'Left',0 |
917 | ini_window_right db 'Right',0 |
||
918 | ini_window_bottom db 'Bottom',0 |
||
919 | |||
920 | finfo_ini dd ?,?,?,AREA_TEMP,AREA_EDIT-AREA_TEMP |
||
258 | mikedld | 921 | db '/rd/1/tinypad.ini',0 |
178 | heavyiron | 922 | |
258 | mikedld | 923 | TINYPAD_END: ; end of file |
122 | diamond | 924 | |
925 | self_path rb PATHL |
||
926 | |||
31 | halyavin | 927 | ;----------------------------------------------------------------------------- |
122 | diamond | 928 | section @UDATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
31 | halyavin | 929 | ;----------------------------------------------------------------------------- |
930 | |||
178 | heavyiron | 931 | f_info70 rd 7 |
932 | |||
122 | diamond | 933 | f_info.length dd ? |
934 | f_info dd ?,?,?,?,?;?,0,?,AREA_TEMP,AREA_EDIT-AREA_TEMP |
||
935 | |||
936 | f_info.path: |
||
937 | times PATHL+1 db ? |
||
938 | |||
258 | mikedld | 939 | pos.x dd ? ; global X position (cursor) |
940 | pos.y dd ? ; global Y position (cursor) |
||
941 | sel.x dd ? ; global X position (selection start) |
||
942 | sel.y dd ? ; global Y position (selection start) |
||
943 | lines dd ? ; number of lines in file |
||
122 | diamond | 944 | lines.scr dd ? ; number of lines on the screen |
31 | halyavin | 945 | columns dd ? ; number of columns in file |
122 | diamond | 946 | columns.scr dd ? ; number of columns on the screen |
31 | halyavin | 947 | top_ofs dd ? ; height occupied by top buttons |
948 | bot_ofs dd ? ; height occupied by bottom buttons |
||
258 | mikedld | 949 | dw ? |
122 | diamond | 950 | left_ofs dd ? ; |
31 | halyavin | 951 | top_line dd ? ; topmost visible line on screen |
952 | left_col dd ? ; leftmost visible char on line |
||
953 | vscrl_top dd ? |
||
954 | vscrl_size dd ? |
||
955 | hscrl_top dd ? |
||
956 | hscrl_size dd ? |
||
178 | heavyiron | 957 | ;skinh dd ? ; skin height |
258 | mikedld | 958 | __rc dd ?,?,?,? |
31 | halyavin | 959 | ;filelen dd ? ; file size (on save) ??? |
960 | filesize dd ? ; file size (on load) ??? |
||
258 | mikedld | 961 | ya dd ? ; for read_string |
122 | diamond | 962 | ;copy_start dd ? ; first line for copying (Ctrl+S) |
31 | halyavin | 963 | copy_count dd ? ; number of lines for copying (Ctrl+E) |
964 | copy_size dd ? ; size of data to copy |
||
965 | s_title.size dd ? ; caption length |
||
966 | |||
122 | diamond | 967 | draw_blines dd ? ; last line to draw |
968 | |||
31 | halyavin | 969 | cur_line_len dd ? |
122 | diamond | 970 | h_popup dd ? |
971 | bot_dlg_handler dd ? |
||
31 | halyavin | 972 | |
122 | diamond | 973 | sel.begin.x dd ? |
974 | sel.begin.y dd ? |
||
975 | sel.end.x dd ? |
||
976 | sel.end.y dd ? |
||
977 | sel.selected db ? |
||
978 | |||
258 | mikedld | 979 | in_sel db ? |
122 | diamond | 980 | |
31 | halyavin | 981 | asm_mode db ? ; ASM highlight? |
982 | do_not_draw db ? ; draw top and bottom buttons? |
||
122 | diamond | 983 | main_closed db ? ; main window closed? |
984 | tb_casesen db ? ; focused textbox is case-sensitive? |
||
31 | halyavin | 985 | |
986 | align 4 |
||
987 | s_fname.size dd ? |
||
988 | s_fname rb PATHL+1 |
||
989 | align 4 |
||
990 | s_search.size dd ? |
||
991 | s_search rb PATHL+1 |
||
992 | |||
122 | diamond | 993 | s_title rb PATHL+11 ; window caption |
31 | halyavin | 994 | |
122 | diamond | 995 | chr db ? |
996 | ext db ? |
||
997 | shi dd ? |
||
998 | |||
999 | align 4 |
||
1000 | cl_3d_normal dd ? |
||
1001 | cl_3d_pushed dd ? |
||
1002 | cl_3d_outset dd ? |
||
1003 | cl_3d_inset dd ? |
||
1004 | cl_3d_grayed dd ? |
||
1005 | |||
1006 | tb_opensave TBOX |
||
1007 | tb_find TBOX |
||
1008 | tb_replace TBOX |
||
1009 | tb_gotorow TBOX |
||
1010 | tb_gotocol TBOX |
||
1011 | |||
1012 | focused_tb dd ? |
||
1013 | |||
1014 | key1 rb 256 |
||
1015 | |||
1016 | mst db ? |
||
1017 | mst2 db ? |
||
1018 | mev db ? |
||
258 | mikedld | 1019 | mouse_captured db ? |
122 | diamond | 1020 | just_from_popup db ? |
1021 | |||
1022 | bot_mode db ? |
||
1023 | |||
1024 | modified db ? |
||
1025 | |||
1026 | align 4 |
||
1027 | |||
1028 | bot_dlg_height dd ? |
||
1029 | bot_dlg_mode2 db ? |
||
1030 | |||
31 | halyavin | 1031 | ;----------------------------------------------------------------------------- |
122 | diamond | 1032 | section @PARAMS ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
31 | halyavin | 1033 | ;----------------------------------------------------------------------------- |
1034 | |||
1035 | fasm_parameters: |
||
1036 | |||
258 | mikedld | 1037 | p_info process_information |
122 | diamond | 1038 | p_info2 process_information |
258 | mikedld | 1039 | sc system_colors |
122 | diamond | 1040 | |
1041 | diff16 'Main memory size',0,$ |
||
1042 | |||
1043 | MAIN_STACK = 0x0000FFF0 |
||
1044 | POPUP_STACK = 0x0000EFF0 |
||
1045 | |||
1046 | AREA_TEMP = 0x00010000 ; 0x00010000 |
||
1047 | AREA_EDIT = 0x000C0000 ; 0x00080000 |
||
1048 | AREA_TEMP2 = 0x00190000 ; 0x002E0000 |
||
1049 | AREA_CBUF = 0x001A0000 ; 0x002F0000 |
||
1050 | AREA_ENDMEM = 0x001B0000 ; 0x00300000 |
||
1051 | |||
1052 | diff10 'Header+options size',0,@CODE |
||
1053 | diff10 'Load area size',AREA_TEMP,AREA_EDIT |
||
1054 | diff10 'Edit area size',AREA_EDIT,AREA_TEMP2 |
||
1055 | diff10 'Total memory usage',0,AREA_ENDMEM |
||
1056 | |||
1057 | ;store dword '/hd/' at tb_opensave.text+4*0 |
||
1058 | ;store dword '1/tp' at tb_opensave.text+4*1 |
||
1059 | ;store dword 'ad4/' at tb_opensave.text+4*2 |
||
1060 | ;store dword 'tiny' at tb_opensave.text+4*3 |
||
1061 | ;store dword 'pad.' at tb_opensave.text+4*4 |
||
1062 | ;store dword 'asm' at tb_opensave.text+4*5 |
||
1063 | ;store byte 23 at tb_opensave.length>'Device>'Access>'FAT>'Disk>'Pointer>'Operation>'Unable>'',0>'Unknown>'Function>'',0>'Operation>'Ошибка>'Доступ>'Таблица>'На>'Адрес>'Операция>'Невозможно>'',0>'Неизвестная>'Функция>'',0>'Операция>'Reached>'Достигнут>'Enter>'Введите>'Enter>'Введите>'Enter>'Введите>'SYSFUNCS.TXT',0>'SYSFUNCR.TXT',0>>> |