1,9 → 1,10 |
;----------------------------------------------------------------------------- |
; project name: TINYPAD |
; compiler: flat assembler 1.64 |
; memory to compile: 3.0/11.5 MBytes (without/with size optimizations) |
; version: 4.0 |
; last update: 2006-04-13 (Apr 13, 2006) |
; compiler: flat assembler 1.67.1 |
; memory to compile: 2.0/7.0 MBytes (without/with size optimizations) |
; version: 4.0.3 |
; last update: 2006-08-28 (Aug 28, 2006) |
; minimal kernel: revision #138 (svn://kolibrios.org/kernel) |
;----------------------------------------------------------------------------- |
; originally by: Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi |
; maintained by: Ivan Poddubny >> ivan-yar@bk.ru |
10,13 → 11,36 |
; Mike Semenyako >> mike.dld@gmail.com |
;----------------------------------------------------------------------------- |
; TODO: |
; optimize drawing (reduce flickering); |
; optimize memory usage (allocate only needed amount, not static 3 Mbytes); |
; add block selection ability, undo action; |
; working with multiple files (add tabs); |
; other bugfixes and speed/size optimizations |
; - optimize drawing (reduce flickering) |
; - optimize memory usage (allocate only needed amount, not static 3 Mbytes) |
; - add block selection ability, undo action, goto position |
; - working with multiple files (add tabs) |
; - improve window drawing with small dimensions |
; - other bugfixes and speed/size optimizations |
; |
; HISTORY: |
; 4.0.3 (mike.dld) |
; bug-fixes: |
; - 1-char selection if pressing <BS> out of real line length |
; - fault in `writepos`, added call to function 9 |
; - main menu items weren't highlighted if popup opened and cursor |
; isn't in menu item's area |
; - statusbar and textboxes drawing fixes (wrong colors) |
; - perform no redraw while pressing Shift, Ctrl, Alt keys |
; - data length from DOCPAK in string representation (fix by diamond) |
; changes: |
; - function 70 instead of 58 for files loading/saving |
; - clientarea-relative drawing (less code) |
; - every line's dword is now splitted into 2 words; |
; low word - line block length, so max line length is 65535 now |
; high word - various flags. for now, only 2 of 16 bits are used: |
; if bit #0 is set, line was modified since file open |
; if bit #1 is set, line was saved after last modification |
; high word could also be further used for code collapsing and different |
; line marking features (breakpoints, errors, bookmarks, etc.) |
; new features: |
; - line markers for modified and saved lines |
; - status messages for various actions |
; 4.0.2 (mike.dld) |
; bug-fixes: |
; - program terminates if started with parameters (fine for DOCPAK) |
68,7 → 92,7 |
; 3.77 (mike.dld) |
; changed save_string to collapse SPACEs into TABs; |
; rewrote drawfile from scratch (speed++) |
; through some drawing improvements still needed |
; through some drawing improvements needed |
; (some checkups to reduce flickering); |
; writepos (size--); |
; fixed drawing window while height < 100px, and for non-asm files; |
110,9 → 134,11 |
; copy/paste area 0x2f0000 + |
;----------------------------------------------------------------------------- |
|
include 'lang.inc' |
include 'macros.inc' ; useful stuff |
;include 'proc32.inc' |
include 'tinypad.inc' |
purge mov,add,sub ; SPEED |
;purge mov,add,sub ; SPEED |
|
header '01',1,@CODE,TINYPAD_END,AREA_ENDMEM,MAIN_STACK,@PARAMS,self_path |
|
126,6 → 152,7 |
LINEH = 10 ; line height (pixels) |
PATHL = 255 ; maximum path length (chars) !!! don't change !!! |
AMINS = 8 ; minimal scroll thumb size (pixels) |
LCHGW = 2 ; changed/saved marker width |
|
STATH = 14 ; status bar height |
|
148,6 → 175,8 |
RGB(255,255,255) ; RGB(224,224,224) ; RGB(255,255,255) ; background |
RGB(255,255,255) ; RGB(255,255,255) ; RGB(255,255,255) ; selection text |
RGB( 10, 36,106) ; RGB( 0, 0,128) ; RGB( 0, 64,128) ; selection background |
RGB( 0,255, 0) ; modified line marker |
RGB(255,255, 0) ; saved line marker |
|
ins_mode db 1 |
|
165,6 → 194,17 |
|
; fninit |
|
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_left,50 |
; mov [mainwnd_pos.x],eax |
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_top,50 |
; mov [mainwnd_pos.y],eax |
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_right,350 |
; sub eax,[mainwnd_pos.x] |
; mov [mainwnd_pos.w],eax |
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_bottom,450 |
; sub eax,[mainwnd_pos.y] |
; mov [mainwnd_pos.h],eax |
|
cld |
mov edi,@UDATA |
mov ecx,@PARAMS-@UDATA |
171,16 → 211,13 |
mov al,0 |
rep stosb |
|
inc [do_not_draw] |
|
mov [left_ofs],40+1 |
mov [f_info+4],0 |
mov [f_info+12],AREA_TEMP |
mov [f_info+16],AREA_EDIT-AREA_TEMP |
|
; mov esi,s_example |
; mov edi,s_fname |
; mov ecx,s_example.size |
; mov [s_fname.size],ecx |
; rep movsb |
mov esi,s_example |
mov edi,tb_opensave.text |
mov ecx,s_example.size |
200,18 → 237,21 |
|
cmp byte[@PARAMS],'*' |
jne .noipc |
; convert size from decimal representation to dword |
|
;// diamond [ (convert size from decimal representation to dword) |
;-- mov edx,dword[@PARAMS+1] |
mov esi, @PARAMS+1 |
xor edx, edx |
xor eax, eax |
@@: |
lodsb |
@@: lodsb |
test al, al |
jz @f |
lea edx, [edx*4+edx] |
lea edx, [edx*2+eax] |
lea edx,[edx*2+eax-'0'] |
jmp @b |
@@: |
;// diamond ] |
|
add edx,20 |
mcall 60,1,AREA_TEMP-16 ; 0x10000-16 |
mov dword[AREA_TEMP-16+4],8 ; [0x10000-16+4],8 |
225,8 → 265,6 |
inc eax |
call load_file.file_found |
jmp @f |
; call file_found ; çàãðóçêà ôàéëà |
; jmp do_load_file.restorecursor ; îòîáðàæåíèå |
.noipc: |
|
;// Willow's code to support DOCPAK ] |
250,9 → 288,12 |
call new_file |
|
@@: |
call drawwindow |
dec [do_not_draw] |
mcall 66,1,1 |
mcall 40,00100111b |
red: |
call drawwindow |
call check_inv_all.skip_check |
|
;----------------------------------------------------------------------------- |
|
275,14 → 316,6 |
jmp still.skip_write |
|
;----------------------------------------------------------------------------- |
func red ;///// window redraw //////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
call drawwindow |
call check_inv_all.skip_check |
jmp still |
endf |
|
;----------------------------------------------------------------------------- |
func start_fasm ;///////////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
; BL = run after compile |
362,7 → 395,11 |
je @f |
mov dword[edi-1],',run' |
mov byte[edi+3],0 |
@@: mcall 19,fasm_filename,fasm_parameters |
@@: |
mov ebx, fasm_start |
start_ret: |
mov eax, 70 |
int 0x40 |
ret |
endf |
|
369,46 → 406,49 |
;----------------------------------------------------------------------------- |
func open_debug_board ;/////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
mcall 19,debug_filename,0 |
ret |
mov ebx, board_start |
jmp start_ret |
endf |
|
;----------------------------------------------------------------------------- |
func open_sysfuncs_txt ;////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
mcall 19,docpak_filename,sysfuncs_param |
mov ebx, docpak_start |
call start_ret |
cmp eax,0xfffffff0 |
jb @f |
mcall 19,tinypad_filename,sysfuncs_filename |
mov ebx, tinypad_start |
mov dword [ebx+8], sysfuncs_filename |
call start_ret |
@@: ret |
endf |
|
;----------------------------------------------------------------------------- |
func layout ;///// change keyboard layout /////////////////////////////////// |
;func layout ;///// change keyboard layout /////////////////////////////////// |
;----------------------------------------------------------------------------- |
mcall 19,setup,param_setup |
mcall 5,eax |
; call activate_me |
; ret |
; mcall 19,setup,param_setup |
; mcall 5,eax |
;; call activate_me |
;; ret |
;;endf |
|
;;func activate_me |
; mcall 9,p_info,-1 |
; inc eax |
; inc eax |
; mov ecx,eax |
; mov edi,[p_info.PID] |
; mov ebx,p_info |
; @@: dec ecx |
; jz @f ; counter=0 => not found? => return |
; mcall 9 |
; cmp edi,[p_info.PID] |
; jne @b |
; mcall 18,3 |
; mcall 5,eax |
; @@: ret |
;endf |
|
;func activate_me |
mcall 9,p_info,-1 |
inc eax |
inc eax |
mov ecx,eax |
mov edi,[p_info.PID] |
mov ebx,p_info |
@@: dec ecx |
jz @f ; counter=0 => not found? => return |
mcall 9 |
cmp edi,[p_info.PID] |
jne @b |
mcall 18,3 |
mcall 5,eax |
@@: ret |
endf |
|
func set_opt |
test [options],al |
je @f |
453,16 → 493,16 |
|
include 'tp-draw.asm' |
include 'tp-key.asm' |
;include 'tp-key2.asm' |
include 'tp-butto.asm' |
include 'tp-mouse.asm' |
include 'tp-files.asm' |
include 'tp-commo.asm' |
include 'tp-dialo.asm' |
;include 'tp-find.asm' |
include 'tp-popup.asm' |
include 'tp-tbox.asm' |
|
;include 'lib-ini.asm' |
|
;----------------------------------------------------------------------------- |
section @DATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
;----------------------------------------------------------------------------- |
593,15 → 633,42 |
|
;error_beep db 0xA0,0x30,0 |
|
s_status dd 0 |
|
sz s_example,'EXAMPLE.ASM' |
sz s_still ,'still' |
|
;sz param_setup,'LANG',0 ; parameter for SETUP |
|
sz fasm_filename ,'FASM ' |
sz debug_filename ,'BOARD ' |
sz tinypad_filename,'TINYPAD ' |
sz docpak_filename ,'DOCPAK ' |
fasm_start: |
dd 7 |
dd 0 |
dd fasm_parameters |
dd 0 |
dd 0 |
db '/RD/1/FASM',0 |
board_start: |
dd 7 |
dd 0 |
dd 0 |
dd 0 |
dd 0 |
db '/RD/1/BOARD',0 |
tinypad_start: |
dd 7 |
dd 0 |
dd ? |
dd 0 |
dd 0 |
db '/RD/1/TINYPAD',0 |
docpak_start: |
dd 7 |
dd 0 |
dd sysfuncs_param |
dd 0 |
dd 0 |
db '/RD/1/DOCPAK',0 |
|
;sz setup ,'SETUP ' ; to change keyboard layout |
|
sz sysfuncs_param,'g',0 |
610,7 → 677,7 |
ru,<'SYSFUNCR.TXT',0>,\ |
en,<'SYSFUNCS.TXT',0> |
|
sz htext,'TINYPAD' |
sz htext,'TINYPAD 4.0.3' |
|
lszc help_text,b,\ |
ru,':',\ |
665,7 → 732,7 |
ru,'®¢ë©' ,'Ctrl+N',key.ctrl_n ,\ |
ru,'âªàëâì...' ,'Ctrl+O',key.ctrl_o ,\ |
ru,'®åà ¨âì' ,'Ctrl+S',key.ctrl_s ,\ |
ru,'®åà ¨âì ª ª...','' ,key.shift_ctrl_s,\ |
ru,'®åà ¨âì ª ª...','Ctrl+Shift+S',key.shift_ctrl_s,\ |
ru,'-' ,'' ,0 ,\ |
ru,'ë室' ,'Alt+X' ,key.alt_x ,\ |
\ |
672,7 → 739,7 |
en,'New' ,'Ctrl+N',key.ctrl_n ,\ |
en,'Open...' ,'Ctrl+O',key.ctrl_o ,\ |
en,'Save' ,'Ctrl+S',key.ctrl_s ,\ |
en,'Save as...','' ,key.shift_ctrl_s,\ |
en,'Save as...','Ctrl+Shift+S',key.shift_ctrl_s,\ |
en,'-' ,'' ,0 ,\ |
en,'Exit' ,'Alt+X' ,key.alt_x |
|
683,6 → 750,8 |
ru,'¤ «¨âì' ,'' ,key.del ,\ |
ru,'-' ,'' ,0 ,\ |
ru,'뤥«¨âì ¢áñ','Ctrl+A',key.ctrl_a,\ |
\; ru,'-' ,'' ,0 ,\ |
\; ru,'¥à⨪ «ì®¥ ¢ë¤¥«¥¨¥','Alt+Ins',0 ,\ |
\ |
en,'Cut' ,'Ctrl+X',key.ctrl_x,\ |
en,'Copy' ,'Ctrl+C',key.ctrl_c,\ |
689,7 → 758,9 |
en,'Paste' ,'Ctrl+V',key.ctrl_v,\ |
en,'Delete' ,'' ,key.del ,\ |
en,'-' ,'' ,0 ,\ |
en,'Select all','Ctrl+A',key.ctrl_a |
en,'Select all','Ctrl+A',key.ctrl_a;,\ |
; en,'-' ,'' ,0 ,\ |
; en,'Vertical selection','Alt+Ins',0 |
|
popup_res popup_search,\ |
ru,'¥à¥©â¨...' ,'Ctrl+G',key.ctrl_g,\ |
763,9 → 834,61 |
ru,'⬥ ',\ |
en,'Cancel' |
|
lsz s_enter_filename,\ |
ru,<'¢¥¤¨â¥ ¨¬ï ä ©« ',0>,\ |
en,<'Enter filename',0> |
|
lsz s_enter_text_to_find,\ |
ru,<'¢¥¤¨â¥ ⥪áâ ¤«ï ¯®¨áª ',0>,\ |
en,<'Enter text to find',0> |
|
lsz s_enter_text_to_replace,\ |
ru,<'¢¥¤¨â¥ ⥪áâ ¤«ï § ¬¥ë',0>,\ |
en,<'Enter text to replace',0> |
|
lsz s_text_not_found,\ |
ru,<'®á⨣ãâ ª®¥æ ä ©« , ⥪áâ ¥ ©¤¥',0>,\ |
en,<'Reached end of file, text not found',0> |
|
lszc s_fs_error,b,\ |
ru,<'¯¥à æ¨ï § ¢¥àè¥ ãá¯¥è® (0)',0>,\ |
ru,<'',0>,\ |
ru,<'ãªæ¨ï ¥ ¯®¤¤¥à¦¨¢ ¥âáï ¤«ï ¤ ®© ä ©«®¢®© á¨á⥬ë (2)',0>,\ |
ru,<'¥¨§¢¥áâ ï ä ©«®¢ ï á¨á⥬ (3)',0>,\ |
ru,<'',0>,\ |
ru,<'¥¢®§¬®¦® ®âªàëâì ä ©« (5)',0>,\ |
ru,<'¯¥à æ¨ï § ¢¥àè¥ ãá¯¥è® (6)',0>,\ |
ru,<'¤à¥á 室¨âáï § £à ¨æ ¬¨ ¯ ¬ï⨠¯à®£à ¬¬ë (7)',0>,\ |
ru,<' ¤¨áª¥ ¥â ᢮¡®¤®£® ¬¥áâ (8)',0>,\ |
ru,<' ¡«¨æ FAT ã¨ç⮦¥ (9)',0>,\ |
ru,<'®áâ㯠§ ¯à¥éñ (10)',0>,\ |
ru,<'訡ª ãáâனá⢠(11)',0>,\ |
\ |
en,<'Operation executed successfully (0)',0>,\ |
en,<'',0>,\ |
en,<'Function is not supported for the given filesystem (2)',0>,\ |
en,<'Unknown filesystem (3)',0>,\ |
en,<'',0>,\ |
en,<'Unable to open file (5)',0>,\ |
en,<'Operation executed successfully (6)',0>,\ |
en,<'Pointer lies outside of application memory (7)',0>,\ |
en,<'Disk is full (8)',0>,\ |
en,<'FAT table is destroyed (9)',0>,\ |
en,<'Access denied (10)',0>,\ |
en,<'Device error (11)',0> |
|
sz symbols_ex,';?.%"',"'" |
sz symbols ,'#&*\:/<>|{}()[]=+-, ' |
|
ini_sec_window db 'Window',0 |
ini_window_top db 'Top',0 |
ini_window_left db 'Left',0 |
ini_window_right db 'Right',0 |
ini_window_bottom db 'Bottom',0 |
|
finfo_ini dd ?,?,?,AREA_TEMP,AREA_EDIT-AREA_TEMP |
db '/rd/1/tinypad.ini',0 |
|
TINYPAD_END: ; end of file |
|
self_path rb PATHL |
774,6 → 897,8 |
section @UDATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
;----------------------------------------------------------------------------- |
|
f_info70 rd 7 |
|
f_info.length dd ? |
f_info dd ?,?,?,?,?;?,0,?,AREA_TEMP,AREA_EDIT-AREA_TEMP |
|
798,7 → 923,7 |
vscrl_size dd ? |
hscrl_top dd ? |
hscrl_size dd ? |
skinh dd ? ; skin height |
;skinh dd ? ; skin height |
__rc dd ?,?,?,? |
;filelen dd ? ; file size (on save) ??? |
filesize dd ? ; file size (on load) ??? |