Tinypad 4.0.4 in progress

git-svn-id: svn://kolibrios.org@258 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Mihail Semenyako (mike.dld) 2006-12-30 17:44:05 +00:00
parent acc759e3d8
commit 82ef5da45f
9 changed files with 481 additions and 401 deletions

View File

@ -1,5 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix en >lang.inc @echo lang fix en >lang.inc
@fasm tinypad.asm tinypad @fasm tinypad.asm tinypad.bin
@erase lang.inc @erase lang.inc
@pause @pause

View File

@ -1,5 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix ru >lang.inc @echo lang fix ru >lang.inc
@fasm tinypad.asm tinypad @fasm tinypad.asm tinypad.bin
@erase lang.inc @erase lang.inc
@pause @pause

View File

@ -1,57 +0,0 @@
help_thread_start:
call draw_help_wnd
still_hw:
cmp [main_closed],1
je exit_hw
mcall 10
cmp eax,1
je help_thread_start
cmp eax,2
je key_hw
cmp eax,3
je button_hw
jmp still_hw
key_hw:
mcall ;2
cmp ah, 27
jne still_hw
button_hw:
mcall 17
exit_hw:
mcall -1
func draw_help_wnd
mcall 12,1
mcall 48,3,sc,sizeof.system_colors
mov ecx,[skinh]
add ecx,200*65536+(5+10*2+16*10)
mov edx,[sc.work]
or edx,0x03000000
mcall 0,<200,10+10*2+help_text.maxl*6>
mov ebx,[skinh]
shr ebx,1
adc ebx,1+0x000A0000-4
mcall 4,,[sc.grab_text],help_title,help_title.size
mov eax,4
mov ebx,[skinh]
add ebx,0x000F000A
xor ecx,ecx
mov edx,help_text
@@: inc edx
movzx esi,byte[edx-1]
mcall
add ebx,10
add edx,esi
cmp byte[edx],0
jne @b
mcall 12,2
ret
endf

View File

@ -2,13 +2,13 @@
; project name: TINYPAD ; project name: TINYPAD
; compiler: flat assembler 1.67.1 ; compiler: flat assembler 1.67.1
; memory to compile: 2.0/7.0 MBytes (without/with size optimizations) ; memory to compile: 2.0/7.0 MBytes (without/with size optimizations)
; version: 4.0.3 ; version: 4.0.4 pre
; last update: 2006-08-28 (Aug 28, 2006) ; last update: 2006-12-30 (Dec 30, 2006)
; minimal kernel: revision #138 (svn://kolibrios.org/kernel) ; minimal kernel: revision #138 (svn://kolibrios.org/kernel)
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; originally by: Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi ; originally by: Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi
; maintained by: Ivan Poddubny >> ivan-yar@bk.ru ; maintained by: Mike Semenyako >> mike.dld@gmail.com
; Mike Semenyako >> mike.dld@gmail.com ; Ivan Poddubny >> ivan-yar@bk.ru
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; TODO: ; TODO:
; - optimize drawing (reduce flickering) ; - optimize drawing (reduce flickering)
@ -19,15 +19,22 @@
; - other bugfixes and speed/size optimizations ; - other bugfixes and speed/size optimizations
; ;
; HISTORY: ; HISTORY:
; 4.0.4 pre (mike.dld)
; bug-fixes:
; - clear statusbar text if dialog operation cancelled
; changes:
; - modified/saved colors now match those in MSVS
; new features:
; - recode tables between CP866, CP1251 and KOI8-R (suggested by Victor)
; 4.0.3 (mike.dld) ; 4.0.3 (mike.dld)
; bug-fixes: ; bug-fixes:
; - 1-char selection if pressing <BS> out of real line length ; - 1-char selection if pressing <BS> out of real line length
; - fault in `writepos`, added call to function 9 ; - fault in `writepos`, added call to function 9
; - main menu items weren't highlighted if popup opened and cursor ; - main menu items weren't highlighted if popup opened and cursor
; isn't in menu item's area ; isn't in main menu item's area
; - statusbar and textboxes drawing fixes (wrong colors) ; - statusbar and textboxes drawing fixes (wrong colors)
; - perform no redraw while pressing Shift, Ctrl, Alt keys ; - perform no redraw while pressing Shift, Ctrl, Alt keys
; - data length from DOCPAK in string representation (fix by diamond) ; - data length from DOCPAK in string representation (fixed by diamond)
; changes: ; changes:
; - function 70 instead of 58 for files loading/saving ; - function 70 instead of 58 for files loading/saving
; - clientarea-relative drawing (less code) ; - clientarea-relative drawing (less code)
@ -142,6 +149,8 @@ include 'tinypad.inc'
header '01',1,@CODE,TINYPAD_END,AREA_ENDMEM,MAIN_STACK,@PARAMS,self_path header '01',1,@CODE,TINYPAD_END,AREA_ENDMEM,MAIN_STACK,@PARAMS,self_path
APP_VERSION equ '4.0.4 pre'
;include 'debug.inc' ;include 'debug.inc'
ASEPC = '-' ; separator character (char) ASEPC = '-' ; separator character (char)
@ -175,8 +184,8 @@ label color_tbl dword
RGB(255,255,255) ; RGB(224,224,224) ; RGB(255,255,255) ; background 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(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( 10, 36,106) ; RGB( 0, 0,128) ; RGB( 0, 64,128) ; selection background
RGB( 0,255, 0) ; modified line marker RGB(255,255, 0) ; modified line marker
RGB(255,255, 0) ; saved line marker RGB( 0,255, 0) ; saved line marker
ins_mode db 1 ins_mode db 1
@ -493,13 +502,14 @@ endf
include 'tp-draw.asm' include 'tp-draw.asm'
include 'tp-key.asm' include 'tp-key.asm'
include 'tp-butto.asm' include 'tp-button.asm'
include 'tp-mouse.asm' include 'tp-mouse.asm'
include 'tp-files.asm' include 'tp-files.asm'
include 'tp-commo.asm' include 'tp-common.asm'
include 'tp-dialo.asm' include 'tp-dialog.asm'
include 'tp-popup.asm' include 'tp-popup.asm'
include 'tp-tbox.asm' include 'tp-tbox.asm'
include 'tp-recode.asm'
;include 'lib-ini.asm' ;include 'lib-ini.asm'
@ -677,7 +687,7 @@ lsz sysfuncs_filename,\
ru,<'SYSFUNCR.TXT',0>,\ ru,<'SYSFUNCR.TXT',0>,\
en,<'SYSFUNCS.TXT',0> en,<'SYSFUNCS.TXT',0>
sz htext,'TINYPAD 4.0.3' sz htext,'TINYPAD ',APP_VERSION
lszc help_text,b,\ lszc help_text,b,\
ru,'ŠŽŒ€<C592>:',\ ru,'ŠŽŒ€<C592>:',\
@ -720,12 +730,14 @@ menubar_res main_menu,\
ru,'<27>à ¢ª ' ,popup_edit ,onshow.edit ,\ ru,'<27>à ¢ª ' ,popup_edit ,onshow.edit ,\
ru,'<27>®¨áª' ,popup_search ,onshow.search ,\ ru,'<27>®¨áª' ,popup_search ,onshow.search ,\
ru,'‡ ¯ãáª' ,popup_run ,onshow.run ,\ ru,'‡ ¯ãáª' ,popup_run ,onshow.run ,\
ru,'Š®¤¨à®¢ª ',popup_recode ,onshow.recode ,\
ru,'Ž¯æ¨¨' ,popup_options,onshow.options,\ ru,'Ž¯æ¨¨' ,popup_options,onshow.options,\
\ \
en,'File' ,popup_file ,onshow.file ,\ en,'File' ,popup_file ,onshow.file ,\
en,'Edit' ,popup_edit ,onshow.edit ,\ en,'Edit' ,popup_edit ,onshow.edit ,\
en,'Search' ,popup_search ,onshow.search ,\ en,'Search' ,popup_search ,onshow.search ,\
en,'Run' ,popup_run ,onshow.run ,\ en,'Run' ,popup_run ,onshow.run ,\
en,'Encoding',popup_recode ,onshow.recode ,\
en,'Options' ,popup_options,onshow.options en,'Options' ,popup_options,onshow.options
popup_res popup_file,\ popup_res popup_file,\
@ -788,6 +800,25 @@ popup_res popup_run,\
en,'Debug board' ,'' ,open_debug_board ,\ en,'Debug board' ,'' ,open_debug_board ,\
en,'System functions' ,'' ,open_sysfuncs_txt en,'System functions' ,'' ,open_sysfuncs_txt
popup_res popup_recode,\
ru,'CP866 -> CP1251' ,'',recode.866.1251,\
ru,'CP1251 -> CP866' ,'',recode.1251.866,\
ru,'-' ,'',0,\
ru,'CP866 -> KOI8-R' ,'',recode.866.koi,\
ru,'KOI8-R -> CP866' ,'',recode.koi.866,\
ru,'-' ,'',0,\
ru,'CP1251 -> KOI8-R' ,'',recode.1251.koi,\
ru,'KOI8-R -> CP1251' ,'',recode.koi.1251,\
\
en,'CP866 -> CP1251' ,'',recode.866.1251,\
en,'CP1251 -> CP866' ,'',recode.1251.866,\
en,'-' ,'',0,\
en,'CP866 -> KOI8-R' ,'',recode.866.koi,\
en,'KOI8-R -> CP866' ,'',recode.koi.866,\
en,'-' ,'',0,\
en,'CP1251 -> KOI8-R' ,'',recode.1251.koi,\
en,'KOI8-R -> CP1251' ,'',recode.koi.1251
popup_res popup_options,\ popup_res popup_options,\
ru,'‚­¥è­¨© ¢¨¤...' ,'',0,\ ru,'‚­¥è­¨© ¢¨¤...' ,'',0,\
ru,'-' ,'',0,\ ru,'-' ,'',0,\

View File

@ -310,11 +310,20 @@ macro unused {
stosb stosb
or al,al or al,al
jnz @b jnz @b
mov ebx,f_info ; mov ebx,f_info
mov dword[ebx+0],1 ; mov dword[ebx+0],1
mov dword[ebx+8],self_path ; mov dword[ebx+8],self_path
mov dword[ebx+12],0 ; mov dword[ebx+12],0
mcall 58 ; mcall 58
mov [f_info70+0],2
mov [f_info70+4],0
mov [f_info70+8],0
mov [f_info70+12],TINYPAD_END
mov [f_info70+16],0
mov byte[f_info70+20],0
mov [f_info70+21],f_info.path
mcall 70,f_info70
; test eax,eax ; test eax,eax
; je .close ; je .close

View File

@ -252,6 +252,7 @@ botdlg.button:
xor eax,eax xor eax,eax
mov [bot_mode],al mov [bot_mode],al
mov [bot_dlg_height],eax mov [bot_dlg_height],eax
mov [s_status],eax
call drawwindow call drawwindow
ret ret

View File

@ -396,6 +396,8 @@ onshow:
ret ret
.run: .run:
ret ret
.recode:
ret
.options: .options:
mov word[popup_options+0],0 mov word[popup_options+0],0
mov byte[popup_options+5],0 mov byte[popup_options+5],0

View File

@ -0,0 +1,94 @@
recode:
.866.1251:
mov edi,table.866.1251
jmp .main
.1251.866:
mov edi,table.1251.866
jmp .main
.866.koi:
mov edi,table.866.koi
jmp .main
.koi.866:
mov edi,table.koi.866
jmp .main
.1251.koi:
mov edi,table.1251.koi
jmp .main
.koi.1251:
mov edi,table.koi.1251
.main:
mov ecx,[lines]
mov esi,AREA_EDIT
jecxz .exit
xor eax,eax
.lp0: dec ecx
js .exit
movzx edx,word[esi]
add esi,4
@@: dec edx
js .lp0
lodsb
add al,-$80
js @b
mov al,[edi+eax]
mov [esi-1],al
jmp @b
.exit:
ret
table.866.1251 db \
$C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7 , $C8,$C9,$CA,$CB,$CC,$CD,$CE,$CF,\
$D0,$D1,$D2,$D3,$D4,$D5,$D6,$D7 , $D8,$D9,$DA,$DB,$DC,$DD,$DE,$DF,\
$E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7 , $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF,\
$00,$00,$00,$00,$00,$00,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$00,$00,$00,$00,$00,$00,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$00,$00,$00,$00,$00,$00,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$F0,$F1,$F2,$F3,$F4,$F5,$F6,$F7 , $F8,$F9,$FA,$FB,$FC,$FD,$FE,$FF,\
$A8,$B8,$AA,$BA,$AF,$BF,$A1,$A2 , $B0,$95,$B7,$00,$B9,$A4,$00,$00
table.1251.866 db \
$00,$00,$00,$00,$00,$00,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$00,$00,$00,$00,$00,$F9,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$00,$F6,$F7,$00,$FD,$00,$00,$00 , $F0,$00,$F2,$00,$00,$00,$00,$F4,\
$F8,$00,$00,$00,$00,$00,$00,$FA , $F1,$FC,$F3,$00,$00,$00,$00,$F5,\
$80,$81,$82,$83,$84,$85,$86,$87 , $88,$89,$8A,$8B,$8C,$8D,$8E,$8F,\
$90,$91,$92,$93,$94,$95,$96,$97 , $98,$99,$9A,$9B,$9C,$9D,$9E,$9F,\
$A0,$A1,$A2,$A3,$A4,$A5,$A6,$A7 , $A8,$A9,$AA,$AB,$AC,$AD,$AE,$AF,\
$E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7 , $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF
table.866.koi db \
$E1,$E2,$F7,$E7,$E4,$E5,$F6,$FA , $E9,$EA,$EB,$EC,$ED,$EE,$EF,$F0,\
$F2,$F3,$F4,$F5,$E6,$E8,$E3,$FE , $FB,$FD,$FF,$F9,$F8,$FC,$E0,$F1,\
$C1,$C2,$D7,$C7,$C4,$C5,$D6,$DA , $C9,$CA,$CB,$CC,$CD,$CE,$CF,$D0,\
$90,$00,$00,$81,$87,$00,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$83,\
$84,$89,$88,$86,$80,$8A,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$00,$00,$00,$00,$00,$00,$00,$00 , $00,$85,$82,$8D,$8C,$8E,$8F,$8B,\
$D2,$D3,$D4,$D5,$C6,$C8,$C3,$DE , $DB,$DD,$DF,$D9,$D8,$DC,$C0,$D1,\
$B3,$A3,$B4,$A4,$B7,$A7,$BE,$AE , $00,$95,$9E,$00,$B0,$9F,$00,$A0
table.koi.866 db \
$C4,$B3,$DA,$BF,$C0,$D9,$C3,$B4 , $C2,$C1,$C5,$DF,$DC,$DB,$DD,$DE,\
$B0,$00,$00,$00,$00,$F9,$00,$00 , $00,$00,$00,$00,$00,$00,$FA,$FD,\
$FF,$00,$00,$F1,$F3,$00,$00,$F5 , $00,$00,$00,$00,$00,$00,$F7,$00,\
$FC,$00,$00,$F0,$F2,$00,$00,$F4 , $00,$00,$00,$00,$00,$00,$F6,$00,\
$EE,$A0,$A1,$E6,$A4,$A5,$E4,$A3 , $E5,$A8,$A9,$AA,$AB,$AC,$AD,$AE,\
$AF,$EF,$E0,$E1,$E2,$E3,$A6,$A2 , $EC,$EB,$A7,$E8,$ED,$E9,$E7,$EA,\
$9E,$80,$81,$96,$84,$85,$94,$83 , $95,$88,$89,$8A,$8B,$8C,$8D,$8E,\
$8F,$9F,$90,$91,$92,$93,$86,$82 , $9C,$9B,$87,$98,$9D,$99,$97,$9A
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