Rev 259 | Rev 280 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 259 | Rev 267 | ||
---|---|---|---|
Line 1... | Line 1... | ||
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-03 (Jan 3, 2007) |
6 | ; last update: 2007-01-07 (Jan 7, 2007) |
7 | ; minimal kernel: revision #138 (svn://kolibrios.org/kernel) |
7 | ; minimal kernel: revision #138 (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 |
Line 13... | Line 13... | ||
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 | ; |
19 | ; |
19 | ; TODO (FOR 4.0.4, PLANNED FOR 2007-01-21): |
20 | ; TODO (FOR 4.0.4, PLANNED FOR 2007-01-21): |
20 | ; - finish tabbed interface [critical] |
21 | ; - finish tabbed interface (some bug with tab switching) [critical] |
21 | ; - add memory reallocation to keys handler [critical] |
22 | ; - add memory reallocation to keys handler [critical] |
22 | ; - rework save_file (memory manager) [critical] |
23 | ; - rework save_file (memory manager) [critical] |
- | 24 | ; - fix scrollbars dragging coordinates calculation [critical] |
|
23 | ; - reduce flickering (changes checker) [average] |
25 | ; - fix parameters parsing (incl. DOCPAK) [average] |
24 | ; - incorrect saved/modified lines flags on copy/paste [normal] |
26 | ; - reduce flickering (introduce changes checker) [normal] |
25 | ; - case-insensitive file extensions comparison (.asm/.inc) [normal] |
27 | ; - fix incorrect saved/modified lines flags on copy/paste [normal] |
26 | ; - prompt to save file before closing/opening [low] |
28 | ; - add prompt to save file before closing/opening [low] |
27 | ; |
29 | ; |
28 | ; HISTORY: |
30 | ; HISTORY: |
29 | ; 4.0.4 pre (mike.dld) |
31 | ; 4.0.4 pre (mike.dld) |
30 | ; bug-fixes: |
32 | ; bug-fixes: |
31 | ; - statusbar contained hint after dialog operation cancelled |
33 | ; - statusbar contained hint after dialog operation cancelled |
32 | ; - small drawing fix for gutter and line saved/modified markers |
34 | ; - small drawing fix for gutter and line saved/modified markers |
33 | ; changes: |
35 | ; changes: |
- | 36 | ; - editor and other modifications to ease parts placement changing |
|
34 | ; - modified/saved colors now match those in MSVS |
37 | ; - modified/saved colors now match those in MSVS |
35 | ; - function 70 for *all* file operations (including diamond's fixes) |
38 | ; - function 70 for *all* file operations (including diamond's fixes) |
36 | ; - 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 |
|
- | 41 | ; non-latin chars in name (russian etc.) |
|
- | 42 | ; - overall code cleanup |
|
37 | ; new features: |
43 | ; new features: |
38 | ; - recode tables between CP866, CP1251 and KOI8-R (suggested by Victor) |
44 | ; - recode tables between CP866, CP1251 and KOI8-R (suggested by Victor) |
39 | ; - 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) |
|
40 | ; 4.0.3 (mike.dld) |
47 | ; 4.0.3 (mike.dld) |
41 | ; bug-fixes: |
48 | ; bug-fixes: |
42 | ; - 1-char selection if pressing |
49 | ; - 1-char selection if pressing |
43 | ; - fault in `writepos`, added call to function 9 |
50 | ; - fault in `writepos`, added call to function 9 |
44 | ; - main menu items weren't highlighted if popup opened and cursor |
51 | ; - main menu items weren't highlighted if popup opened and cursor |
45 | ; isn't in main menu item's area |
52 | ; isn't in main menu item's area |
46 | ; - statusbar and textboxes drawing fixes (wrong colors) |
53 | ; - statusbar and textboxes drawing fixes (wrong colors) |
47 | ; - perform no redraw while pressing Shift, Ctrl, Alt keys |
54 | ; - perform no redraw while pressing Shift, Ctrl, Alt keys |
48 | ; - data length from DOCPAK in string representation (fixed by diamond) |
55 | ; - data length from DOCPAK in string representation (fixed by diamond) |
- | 56 | ; - compare file extension case-insensitively (fixed by diamond) |
|
49 | ; changes: |
57 | ; changes: |
50 | ; - function 70 instead of 58 for files loading/saving |
58 | ; - function 70 instead of 58 for files loading/saving |
51 | ; - clientarea-relative drawing (less code) |
59 | ; - clientarea-relative drawing (less code) |
52 | ; - every line's dword is now splitted into 2 words; |
60 | ; - every line's dword is now splitted into 2 words; |
53 | ; low word - line block length, so max line length is 65535 now |
61 | ; low word - line block length, so max line length is 65535 now |
Line 166... | Line 174... | ||
166 | LCHGW = 3 ; changed/saved marker width |
174 | LCHGW = 3 ; changed/saved marker width |
Line 167... | Line 175... | ||
167 | 175 | ||
168 | STATH = 16 ; status bar height |
176 | STATH = 16 ; status bar height |
Line 169... | Line -... | ||
169 | TBARH = 18 ; tab bar height |
- | |
170 | - | ||
171 | MEV_LDOWN = 1 |
- | |
172 | MEV_LUP = 2 |
- | |
173 | MEV_RDOWN = 3 |
- | |
174 | MEV_RUP = 4 |
- | |
175 | MEV_MOVE = 5 |
177 | TBARH = 18 ; tab bar height |
176 | 178 | ||
177 | ;----------------------------------------------------------------------------- |
179 | ;----------------------------------------------------------------------------- |
Line 178... | Line 180... | ||
178 | section @OPTIONS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
180 | section @OPTIONS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
179 | ;----------------------------------------------------------------------------- |
181 | ;----------------------------------------------------------------------------- |
180 | 182 | ||
181 | label color_tbl dword |
183 | label color_tbl dword |
182 | RGB( 0, 0, 0) ; RGB( 0, 0, 0) ; RGB( 0, 0, 0) ; text |
184 | RGB( 0, 0, 0) ; RGB( 0, 0, 0) ; RGB( 0, 0, 0) ; text |
183 | RGB( 0,144, 0) ; RGB( 0,144, 0) ; RGB( 0,160, 0) ; numbers |
185 | RGB( 0,144, 0) ; RGB( 0,160, 0) ; RGB( 0,144, 0) ; numbers |
184 | RGB(176, 0, 0) ; RGB(160, 0, 0) ; RGB( 0,128,255) ; strings |
186 | RGB(176, 0, 0) ; RGB( 0,128,255) ; RGB(160, 0, 0) ; strings |
185 | RGB(128,128,128) ; RGB(144,144,144) ; RGB(160,160,160) ; comments |
187 | RGB(128,128,128) ; RGB(160,160,160) ; RGB(144,144,144) ; comments |
186 | RGB( 48, 48,240) ; RGB( 48, 48,240) ; RGB(255, 0, 0) ; symbols |
188 | RGB( 48, 48,240) ; RGB(255, 0, 0) ; RGB( 48, 48,240) ; symbols |
187 | RGB(255,255,255) ; RGB(224,224,224) ; RGB(255,255,255) ; background |
189 | RGB(255,255,255) ; RGB(255,255,255) ; RGB(224,224,224) ; background |
188 | RGB(255,255,255) ; RGB(255,255,255) ; RGB(255,255,255) ; selection text |
190 | RGB(255,255,255) ; RGB(255,255,255) ; RGB(255,255,255) ; selection text |
Line 189... | Line 191... | ||
189 | RGB( 10, 36,106) ; RGB( 0, 0,128) ; RGB( 0, 64,128) ; selection background |
191 | RGB( 10, 36,106) ; RGB( 0, 64,128) ; RGB( 0, 0,128) ; selection background |
Line 190... | Line 192... | ||
190 | RGB(255,238, 98) ; modified line marker |
192 | RGB(255,238, 98) ; modified line marker |
Line 191... | Line 193... | ||
191 | RGB(108,226,108) ; saved line marker |
193 | RGB(108,226,108) ; saved line marker |
192 | 194 | ||
193 | ins_mode db 1 |
195 | ins_mode db 1 |
194 | 196 | ||
195 | options db OPTS_AUTOINDENT+OPTS_OPTIMSAVE+OPTS_SMARTTAB |
197 | options db OPTS_AUTOINDENT+OPTS_OPTIMSAVE+OPTS_SMARTTAB |
Line 196... | Line 198... | ||
196 | 198 | ||
Line 233... | Line 235... | ||
233 | call mem.Alloc |
235 | call mem.Alloc |
234 | mov [temp_buf],eax |
236 | mov [temp_buf],eax |
Line 235... | Line 237... | ||
235 | 237 | ||
236 | mov eax,65536 |
238 | mov eax,65536 |
237 | call mem.Alloc |
239 | call mem.Alloc |
Line 238... | Line 240... | ||
238 | mov [cur_tab.Editor.Data],eax |
240 | mov [cur_editor.Lines],eax |
Line 239... | Line 241... | ||
239 | 241 | ||
240 | inc [do_not_draw] |
242 | inc [do_not_draw] |
Line 362... | Line 364... | ||
362 | ;----------------------------------------------------------------------------- |
364 | ;----------------------------------------------------------------------------- |
363 | func start_fasm ;///////////////////////////////////////////////////////////// |
365 | func start_fasm ;///////////////////////////////////////////////////////////// |
364 | ;----------------------------------------------------------------------------- |
366 | ;----------------------------------------------------------------------------- |
365 | ; BL = run after compile |
367 | ; BL = run after compile |
366 | ;----------------------------------------------------------------------------- |
368 | ;----------------------------------------------------------------------------- |
367 | cmp [cur_tab.Editor.AsmMode],0 ;! [asm_mode],0 |
369 | cmp [cur_editor.AsmMode],0 ;! [asm_mode],0 |
368 | jne @f |
370 | jne @f |
369 | ret |
371 | ret |
370 | @@: mov esi,f_info.path ; s_fname |
372 | @@: mov esi,f_info.path ; s_fname |
371 | mov edi,fasm_parameters |
373 | mov edi,fasm_parameters |
Line 558... | Line 560... | ||
558 | 0x28,0x29,0x00,0x2B,0x2C,0x2D,0x2E,0x2F,\ |
560 | 0x28,0x29,0x00,0x2B,0x2C,0x2D,0x2E,0x2F,\ |
559 | 0x30,0x31,0x32,0x33,0x34,0x35,0x00,0x00,\ |
561 | 0x30,0x31,0x32,0x33,0x34,0x35,0x00,0x00,\ |
560 | 0x00,0x39,0x00,0x00,0x00,0x00,0x00,0x00 |
562 | 0x00,0x39,0x00,0x00,0x00,0x00,0x00,0x00 |
561 | times 12*16 db 0x00 |
563 | times 12*16 db 0x00 |
Line 562... | Line 564... | ||
562 | 564 | ||
563 | accel_table dd \ |
565 | accel_table_main dd \ |
564 | 0x0000000E,key.bkspace ,\ ; BackSpace |
566 | 0x0000000E,key.bkspace ,\ ; BackSpace |
565 | 0x0000000F,key.tab ,\ ; Tab |
567 | 0x0000000F,key.tab ,\ ; Tab |
566 | 0x0000001C,key.return ,\ ; Return |
568 | 0x0000001C,key.return ,\ ; Return |
567 | 0x0000003D,key.f3 ,\ ; F3 |
569 | 0x0000003D,key.f3 ,\ ; F3 |
Line 597... | Line 599... | ||
597 | \;0x00020026,key.ctrl_l ,\ ; Ctrl+L |
599 | \;0x00020026,key.ctrl_l ,\ ; Ctrl+L |
598 | 0x0002002D,key.ctrl_x ,\ ; Ctrl+X |
600 | 0x0002002D,key.ctrl_x ,\ ; Ctrl+X |
599 | 0x0002002E,key.ctrl_c ,\ ; Ctrl+C |
601 | 0x0002002E,key.ctrl_c ,\ ; Ctrl+C |
600 | 0x0002002F,key.ctrl_v ,\ ; Ctrl+V |
602 | 0x0002002F,key.ctrl_v ,\ ; Ctrl+V |
601 | 0x00020031,key.ctrl_n ,\ ; Ctrl+N |
603 | 0x00020031,key.ctrl_n ,\ ; Ctrl+N |
- | 604 | 0x0002003E,key.ctrl_f4 ,\ ; Ctrl+F4 |
|
602 | 0x00020043,key.ctrl_f9 ,\ ; Ctrl+F9 |
605 | 0x00020043,key.ctrl_f9 ,\ ; Ctrl+F9 |
603 | 0x00020147,key.ctrl_home ,\ ; Ctrl+Home |
606 | 0x00020147,key.ctrl_home ,\ ; Ctrl+Home |
604 | \;0x00020148,key.ctrl_up ,\ ; Ctrl+Up |
607 | \;0x00020148,key.ctrl_up ,\ ; Ctrl+Up |
605 | 0x00020149,key.ctrl_pgup ,\ ; Ctrl+PageUp |
608 | 0x00020149,key.ctrl_pgup ,\ ; Ctrl+PageUp |
606 | 0x0002014B,key.ctrl_left ,\ ; Ctrl+Left |
609 | 0x0002014B,key.ctrl_left ,\ ; Ctrl+Left |
Line 639... | Line 642... | ||
639 | 0x00010153,key.tb.del ,\ ; Shift+Del |
642 | 0x00010153,key.tb.del ,\ ; Shift+Del |
640 | 0 |
643 | 0 |
Line 641... | Line 644... | ||
641 | 644 | ||
642 | accel_table2 dd \ |
645 | accel_table2 dd \ |
643 | 1,btn.close_main_window ,\ |
646 | 1,btn.close_main_window ,\ |
644 | 'UP',btn.scroll_up ,\ |
647 | 'VSL',btn.vscroll_up ,\ |
645 | 'DN',btn.scroll_down ,\ |
648 | 'VSG',btn.vscroll_down ,\ |
- | 649 | 'HSL',btn.hscroll_up ,\ |
|
646 | 'LT',btn.scroll_left ,\ |
650 | 'HSG',btn.hscroll_down ,\ |
- | 651 | 'TBL',btn.tabctl_right ,\ |
|
647 | 'RT',btn.scroll_right ,\ |
652 | 'TBG',btn.tabctl_left ,\ |
Line 648... | Line 653... | ||
648 | 0 |
653 | 0 |
649 | 654 | ||
650 | accel_table2_botdlg dd \ |
655 | accel_table2_botdlg dd \ |
Line 723... | Line 728... | ||
723 | file_info FILEINFO |
728 | file_info FILEINFO |
Line 724... | Line 729... | ||
724 | 729 | ||
725 | tab_bar TABCTL |
730 | tab_bar TABCTL |
726 | virtual at tab_bar.Current |
731 | virtual at tab_bar.Current |
- | 732 | cur_tab TABITEM |
|
- | 733 | end virtual |
|
727 | cur_tab TABITEM |
734 | virtual at tab_bar.Current.Editor |
728 | ;cur_tab_addr dd ? |
735 | cur_editor EDITOR |
Line 729... | Line 736... | ||
729 | end virtual |
736 | end virtual |
730 | 737 | ||
731 | lines.scr dd ? ; number of lines on the screen |
738 | lines.scr dd ? ; number of lines on the screen |