/programs/develop/tinypad/trunk/tp-butto.asm |
---|
File deleted |
\ No newline at end of file |
/programs/develop/tinypad/trunk/helpwnd.asm |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/develop/tinypad/trunk/tp-dialo.asm |
---|
File deleted |
/programs/develop/tinypad/trunk/tp-commo.asm |
---|
File deleted |
/programs/develop/tinypad/trunk/build_en.bat |
---|
1,5 → 1,5 |
@erase lang.inc |
@echo lang fix en >lang.inc |
@fasm tinypad.asm tinypad |
@fasm tinypad.asm tinypad.bin |
@erase lang.inc |
@pause |
/programs/develop/tinypad/trunk/build_ru.bat |
---|
1,5 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm tinypad.asm tinypad |
@fasm tinypad.asm tinypad.bin |
@erase lang.inc |
@pause |
/programs/develop/tinypad/trunk/tinypad.asm |
---|
2,13 → 2,13 |
; project name: TINYPAD |
; 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) |
; version: 4.0.4 pre |
; last update: 2006-12-30 (Dec 30, 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 |
; Mike Semenyako >> mike.dld@gmail.com |
; maintained by: Mike Semenyako >> mike.dld@gmail.com |
; Ivan Poddubny >> ivan-yar@bk.ru |
;----------------------------------------------------------------------------- |
; TODO: |
; - optimize drawing (reduce flickering) |
19,15 → 19,22 |
; - other bugfixes and speed/size optimizations |
; |
; 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) |
; 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 |
; isn't in main 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) |
; - data length from DOCPAK in string representation (fixed by diamond) |
; changes: |
; - function 70 instead of 58 for files loading/saving |
; - clientarea-relative drawing (less code) |
142,19 → 149,21 |
header '01',1,@CODE,TINYPAD_END,AREA_ENDMEM,MAIN_STACK,@PARAMS,self_path |
APP_VERSION equ '4.0.4 pre' |
;include 'debug.inc' |
ASEPC = '-' ; separator character (char) |
ATOPH = POP_IHEIGHT+2 ; menu bar height (pixels) |
ASEPC = '-' ; separator character (char) |
ATOPH = POP_IHEIGHT+2 ; menu bar height (pixels) |
;OLEFT = 50+1 ; left offset (pixels) !!! don't change !!! |
SCRLW = 16 ; scrollbar widht/height (pixels) |
ATABW = 8 ; tab width (chars) |
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 |
SCRLW = 16 ; scrollbar widht/height (pixels) |
ATABW = 8 ; tab width (chars) |
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 |
STATH = 14 ; status bar height |
MEV_LDOWN = 1 |
MEV_LUP = 2 |
167,16 → 176,16 |
;----------------------------------------------------------------------------- |
label color_tbl dword |
RGB( 0, 0, 0) ; RGB( 0, 0, 0) ; RGB( 0, 0, 0) ; text |
RGB( 0,144, 0) ; RGB( 0,144, 0) ; RGB( 0,160, 0) ; numbers |
RGB(176, 0, 0) ; RGB(160, 0, 0) ; RGB( 0,128,255) ; strings |
RGB( 0, 0, 0) ; RGB( 0, 0, 0) ; RGB( 0, 0, 0) ; text |
RGB( 0,144, 0) ; RGB( 0,144, 0) ; RGB( 0,160, 0) ; numbers |
RGB(176, 0, 0) ; RGB(160, 0, 0) ; RGB( 0,128,255) ; strings |
RGB(128,128,128) ; RGB(144,144,144) ; RGB(160,160,160) ; comments |
RGB( 48, 48,240) ; RGB( 48, 48,240) ; RGB(255, 0, 0) ; symbols |
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 |
RGB(255,255, 0) ; modified line marker |
RGB( 0,255, 0) ; saved line marker |
ins_mode db 1 |
205,94 → 214,94 |
; sub eax,[mainwnd_pos.y] |
; mov [mainwnd_pos.h],eax |
cld |
mov edi,@UDATA |
mov ecx,@PARAMS-@UDATA |
mov al,0 |
rep stosb |
cld |
mov edi,@UDATA |
mov ecx,@PARAMS-@UDATA |
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 [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,tb_opensave.text |
mov ecx,s_example.size |
mov [tb_opensave.length],cl |
rep movsb |
mov esi,s_example |
mov edi,tb_opensave.text |
mov ecx,s_example.size |
mov [tb_opensave.length],cl |
rep movsb |
mov esi,s_still |
mov edi,s_search |
mov ecx,s_still.size |
mov [s_search.size],ecx |
rep movsb |
mov esi,s_still |
mov edi,s_search |
mov ecx,s_still.size |
mov [s_search.size],ecx |
rep movsb |
cmp byte[@PARAMS],0 |
jz no_params |
cmp byte[@PARAMS],0 |
jz no_params |
;// Willow's code to support DOCPAK [ |
cmp byte[@PARAMS],'*' |
jne .noipc |
cmp byte[@PARAMS],'*' |
jne .noipc |
;// diamond [ (convert size from decimal representation to dword) |
;-- mov edx,dword[@PARAMS+1] |
mov esi,@PARAMS+1 |
xor edx,edx |
xor eax,eax |
mov esi,@PARAMS+1 |
xor edx,edx |
xor eax,eax |
@@: lodsb |
test al,al |
jz @f |
lea edx,[edx*4+edx] |
lea edx,[edx*2+eax-'0'] |
jmp @b |
test al,al |
jz @f |
lea edx,[edx*4+edx] |
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 |
mcall 40,1000000b |
mcall 23,200 |
cmp eax,7 |
jne key.alt_x.close ; ýòî íà mcall -1 ìåòêà |
mov esi,AREA_TEMP-16 ; 0x10000-16 |
mov byte[esi],1 |
mov eax,[esi+12] |
inc eax |
call load_file.file_found |
jmp @f |
add edx,20 |
mcall 60,1,AREA_TEMP-16 ; 0x10000-16 |
mov dword[AREA_TEMP-16+4],8 ; [0x10000-16+4],8 |
mcall 40,1000000b |
mcall 23,200 |
cmp eax,7 |
jne key.alt_x.close ; ýòî íà mcall -1 ìåòêà |
mov esi,AREA_TEMP-16 ; 0x10000-16 |
mov byte[esi],1 |
mov eax,[esi+12] |
inc eax |
call load_file.file_found |
jmp @f |
.noipc: |
;// Willow's code to support DOCPAK ] |
; parameters are at @PARAMS |
mov esi,@PARAMS |
mov edi,tb_opensave.text |
mov ecx,PATHL |
rep movsb |
mov edi,tb_opensave.text |
mov ecx,PATHL |
xor al,al |
repne scasb |
jne key.alt_x.close |
lea eax,[edi-tb_opensave.text-1] |
mov [tb_opensave.length],al |
mov esi,@PARAMS |
mov edi,tb_opensave.text |
mov ecx,PATHL |
rep movsb |
mov edi,tb_opensave.text |
mov ecx,PATHL |
xor al,al |
repne scasb |
jne key.alt_x.close |
lea eax,[edi-tb_opensave.text-1] |
mov [tb_opensave.length],al |
no_params: |
call btn.load_file;do_load_file |
jnc @f |
call new_file |
call btn.load_file;do_load_file |
jnc @f |
call new_file |
@@: |
dec [do_not_draw] |
mcall 66,1,1 |
mcall 40,00100111b |
mcall 66,1,1 |
mcall 40,00100111b |
red: |
call drawwindow |
call drawwindow |
call check_inv_all.skip_check |
;----------------------------------------------------------------------------- |
301,19 → 310,19 |
call writepos ; write current position & number of strings |
.skip_write: |
mcall 10;23,50; wait here until event |
cmp [main_closed],0 |
jne key.alt_x |
dec eax ; redraw ? |
jz red |
dec eax ; key ? |
jz key |
dec eax ; button ? |
jz button |
sub eax,3 ; mouse ? |
jz mouse |
mcall 10;23,50; wait here until event |
cmp [main_closed],0 |
jne key.alt_x |
dec eax ; redraw ? |
jz red |
dec eax ; key ? |
jz key |
dec eax ; button ? |
jz button |
sub eax,3 ; mouse ? |
jz mouse |
jmp still.skip_write |
jmp still.skip_write |
;----------------------------------------------------------------------------- |
func start_fasm ;///////////////////////////////////////////////////////////// |
320,106 → 329,106 |
;----------------------------------------------------------------------------- |
; BL = run after compile |
;----------------------------------------------------------------------------- |
cmp [asm_mode],0 |
jne @f |
ret |
@@: mov esi,f_info.path ; s_fname |
mov edi,fasm_parameters |
cmp [asm_mode],0 |
jne @f |
ret |
@@: mov esi,f_info.path ; s_fname |
mov edi,fasm_parameters |
cmp byte[esi],'/' |
je .yes_systree |
cmp byte[esi],'/' |
je .yes_systree |
mov ecx,[f_info.length] ; [s_fname.size] |
rep movsb |
mov ecx,[f_info.length] ; [s_fname.size] |
rep movsb |
mov al,',' |
stosb |
mov al,',' |
stosb |
mov ecx,[f_info.length] ; [s_fname.size] |
add ecx,-4 |
mov esi,f_info.path ; s_fname |
rep movsb |
mov ecx,[f_info.length] ; [s_fname.size] |
add ecx,-4 |
mov esi,f_info.path ; s_fname |
rep movsb |
mov al,',' |
stosb |
mov al,',' |
stosb |
mov dword[edi],'/RD/' |
mov word[edi+4],'1/' |
add edi,6 |
mov dword[edi],'/RD/' |
mov word[edi+4],'1/' |
add edi,6 |
mov al,0 |
stosb |
mov al,0 |
stosb |
jmp .run |
jmp .run |
.yes_systree: |
mov eax,[f_info.length] |
add esi,eax ; [s_fname.size] |
dec esi |
mov eax,[f_info.length] |
add esi,eax ; [s_fname.size] |
dec esi |
xor ecx,ecx |
mov al,'/' |
@@: cmp [esi],al |
je @f |
dec esi |
inc ecx |
jmp @b |
@@: inc esi |
xor ecx,ecx |
mov al,'/' |
@@: cmp [esi],al |
je @f |
dec esi |
inc ecx |
jmp @b |
@@: inc esi |
push esi esi ecx |
push esi esi ecx |
rep movsb |
rep movsb |
mov al,',' |
stosb |
mov al,',' |
stosb |
pop ecx esi |
pop ecx esi |
add ecx,-4 |
rep movsb |
add ecx,-4 |
rep movsb |
mov al,',' |
stosb |
mov al,',' |
stosb |
pop ecx |
sub ecx,f_info.path ; s_fname |
mov esi,f_info.path ; s_fname |
pop ecx |
sub ecx,f_info.path ; s_fname |
mov esi,f_info.path ; s_fname |
rep movsb |
rep movsb |
mov al,0 |
stosb |
mov al,0 |
stosb |
.run: |
cmp bl,0 ; run outfile ? |
je @f |
mov dword[edi-1],',run' |
mov byte[edi+3],0 |
cmp bl,0 ; run outfile ? |
je @f |
mov dword[edi-1],',run' |
mov byte[edi+3],0 |
@@: |
mov ebx, fasm_start |
mov ebx, fasm_start |
start_ret: |
mov eax, 70 |
int 0x40 |
ret |
mov eax, 70 |
int 0x40 |
ret |
endf |
;----------------------------------------------------------------------------- |
func open_debug_board ;/////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
mov ebx, board_start |
jmp start_ret |
mov ebx, board_start |
jmp start_ret |
endf |
;----------------------------------------------------------------------------- |
func open_sysfuncs_txt ;////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
mov ebx, docpak_start |
call start_ret |
cmp eax,0xfffffff0 |
jb @f |
mov ebx, tinypad_start |
mov dword [ebx+8], sysfuncs_filename |
call start_ret |
mov ebx, docpak_start |
call start_ret |
cmp eax,0xfffffff0 |
jb @f |
mov ebx, tinypad_start |
mov dword [ebx+8], sysfuncs_filename |
call start_ret |
@@: ret |
endf |
450,43 → 459,43 |
;endf |
func set_opt |
test [options],al |
je @f |
not al |
and [options],al |
ret |
@@: or [options],al |
ret |
test [options],al |
je @f |
not al |
and [options],al |
ret |
@@: or [options],al |
ret |
endf |
func set_line_numbers |
mov al,OPTS_LINENUMS |
call set_opt |
ret |
mov al,OPTS_LINENUMS |
call set_opt |
ret |
endf |
func set_optimal_fill |
mov al,OPTS_OPTIMSAVE |
call set_opt |
ret |
mov al,OPTS_OPTIMSAVE |
call set_opt |
ret |
endf |
func set_auto_indents |
mov al,OPTS_AUTOINDENT |
call set_opt |
ret |
mov al,OPTS_AUTOINDENT |
call set_opt |
ret |
endf |
func set_auto_braces |
mov al,OPTS_AUTOBRACES |
call set_opt |
ret |
mov al,OPTS_AUTOBRACES |
call set_opt |
ret |
endf |
func set_secure_sel |
mov al,OPTS_SECURESEL |
call set_opt |
ret |
mov al,OPTS_SECURESEL |
call set_opt |
ret |
endf |
;----------------------------------------------------------------------------- |
493,13 → 502,14 |
include 'tp-draw.asm' |
include 'tp-key.asm' |
include 'tp-butto.asm' |
include 'tp-button.asm' |
include 'tp-mouse.asm' |
include 'tp-files.asm' |
include 'tp-commo.asm' |
include 'tp-dialo.asm' |
include 'tp-common.asm' |
include 'tp-dialog.asm' |
include 'tp-popup.asm' |
include 'tp-tbox.asm' |
include 'tp-recode.asm' |
;include 'lib-ini.asm' |
524,55 → 534,55 |
0x00,0x39,0x00,0x00,0x00,0x00,0x00,0x00 |
times 12*16 db 0x00 |
accel_table dd \ |
0x0000000E,key.bkspace ,\ ; BackSpace |
0x0000000F,key.tab ,\ ; Tab |
0x0000001C,key.return ,\ ; Return |
0x0000003D,key.f3 ,\ ; F3 |
0x00000043,key.f9 ,\ ; F9 |
0x00000147,key.home ,\ ; Home |
0x00000148,key.up ,\ ; Up |
0x00000149,key.pgup ,\ ; PageUp |
0x0000014B,key.left ,\ ; Left |
0x0000014D,key.right ,\ ; Right |
0x0000014F,key.end ,\ ; End |
0x00000150,key.down ,\ ; Down |
0x00000151,key.pgdn ,\ ; PageDown |
0x00000152,key.ins ,\ ; Insert |
0x00000153,key.del ,\ ; Delete |
0x00010147,key.shift_home ,\ ; Shift+Home |
0x00010148,key.shift_up ,\ ; Shift+Up |
0x00010149,key.shift_pgup ,\ ; Shift+PageUp |
0x0001014B,key.shift_left ,\ ; Shift+Left |
0x0001014D,key.shift_right ,\ ; Shift+Right |
0x0001014F,key.shift_end ,\ ; Shift+End |
0x00010150,key.shift_down ,\ ; Shift+Down |
0x00010151,key.shift_pgdn ,\ ; Shift+PageDown |
0x00010153,key.del ,\ ; Shift+Delete |
0x00020015,key.ctrl_y ,\ ; Ctrl+Y |
0x00020018,key.ctrl_o ,\ ; Ctrl+O |
0x0002001E,key.ctrl_a ,\ ; Ctrl+A |
0x0002001F,key.ctrl_s ,\ ; Ctrl+S |
0x00020020,key.ctrl_d ,\ ; Ctrl+D |
0x00020021,key.ctrl_f ,\ ; Ctrl+F |
0x00020022,key.ctrl_g ,\ ; Ctrl+G |
0x00020023,key.ctrl_h ,\ ; Ctrl+H |
accel_table dd \ |
0x0000000E,key.bkspace ,\ ; BackSpace |
0x0000000F,key.tab ,\ ; Tab |
0x0000001C,key.return ,\ ; Return |
0x0000003D,key.f3 ,\ ; F3 |
0x00000043,key.f9 ,\ ; F9 |
0x00000147,key.home ,\ ; Home |
0x00000148,key.up ,\ ; Up |
0x00000149,key.pgup ,\ ; PageUp |
0x0000014B,key.left ,\ ; Left |
0x0000014D,key.right ,\ ; Right |
0x0000014F,key.end ,\ ; End |
0x00000150,key.down ,\ ; Down |
0x00000151,key.pgdn ,\ ; PageDown |
0x00000152,key.ins ,\ ; Insert |
0x00000153,key.del ,\ ; Delete |
0x00010147,key.shift_home ,\ ; Shift+Home |
0x00010148,key.shift_up ,\ ; Shift+Up |
0x00010149,key.shift_pgup ,\ ; Shift+PageUp |
0x0001014B,key.shift_left ,\ ; Shift+Left |
0x0001014D,key.shift_right ,\ ; Shift+Right |
0x0001014F,key.shift_end ,\ ; Shift+End |
0x00010150,key.shift_down ,\ ; Shift+Down |
0x00010151,key.shift_pgdn ,\ ; Shift+PageDown |
0x00010153,key.del ,\ ; Shift+Delete |
0x00020015,key.ctrl_y ,\ ; Ctrl+Y |
0x00020018,key.ctrl_o ,\ ; Ctrl+O |
0x0002001E,key.ctrl_a ,\ ; Ctrl+A |
0x0002001F,key.ctrl_s ,\ ; Ctrl+S |
0x00020020,key.ctrl_d ,\ ; Ctrl+D |
0x00020021,key.ctrl_f ,\ ; Ctrl+F |
0x00020022,key.ctrl_g ,\ ; Ctrl+G |
0x00020023,key.ctrl_h ,\ ; Ctrl+H |
\;0x00020026,key.ctrl_l ,\ ; Ctrl+L |
0x0002002D,key.ctrl_x ,\ ; Ctrl+X |
0x0002002E,key.ctrl_c ,\ ; Ctrl+C |
0x0002002F,key.ctrl_v ,\ ; Ctrl+V |
0x00020031,key.ctrl_n ,\ ; Ctrl+N |
0x00020043,key.ctrl_f9 ,\ ; Ctrl+F9 |
0x00020147,key.ctrl_home ,\ ; Ctrl+Home |
0x0002002D,key.ctrl_x ,\ ; Ctrl+X |
0x0002002E,key.ctrl_c ,\ ; Ctrl+C |
0x0002002F,key.ctrl_v ,\ ; Ctrl+V |
0x00020031,key.ctrl_n ,\ ; Ctrl+N |
0x00020043,key.ctrl_f9 ,\ ; Ctrl+F9 |
0x00020147,key.ctrl_home ,\ ; Ctrl+Home |
\;0x00020148,key.ctrl_up ,\ ; Ctrl+Up |
0x00020149,key.ctrl_pgup ,\ ; Ctrl+PageUp |
0x0002014B,key.ctrl_left ,\ ; Ctrl+Left |
0x0002014D,key.ctrl_right ,\ ; Ctrl+Right |
0x0002014F,key.ctrl_end ,\ ; Ctrl+End |
0x00020149,key.ctrl_pgup ,\ ; Ctrl+PageUp |
0x0002014B,key.ctrl_left ,\ ; Ctrl+Left |
0x0002014D,key.ctrl_right ,\ ; Ctrl+Right |
0x0002014F,key.ctrl_end ,\ ; Ctrl+End |
\;0x00020150,key.ctrl_down ,\ ; Ctrl+Down |
0x00020151,key.ctrl_pgdn ,\ ; Ctrl+PageDown |
0x00020153,key.del ,\ ; Ctrl+Del |
0x0003001F,key.shift_ctrl_s ,\ ; Shift+Ctrl+S |
0x00020151,key.ctrl_pgdn ,\ ; Ctrl+PageDown |
0x00020153,key.del ,\ ; Ctrl+Del |
0x0003001F,key.shift_ctrl_s ,\ ; Shift+Ctrl+S |
0x00030147,key.shift_ctrl_home ,\ ; Shift+Ctrl+Home |
\;0x00030148,key.shift_ctrl_up ,\ ; Shift+Ctrl+Up |
0x00030149,key.shift_ctrl_pgup ,\ ; Shift+Ctrl+PageUp |
581,44 → 591,44 |
0x0003014F,key.shift_ctrl_end ,\ ; Shift+Ctrl+End |
\;0x00030150,key.shift_ctrl_down ,\ ; Shift+Ctrl+Down |
0x00030151,key.shift_ctrl_pgdn ,\ ; Shift+Ctrl+PageDown |
0x0004002D,key.alt_x ,\ ; Alt+X |
0x0004002D,key.alt_x ,\ ; Alt+X |
0 |
accel_table_textbox dd \ |
accel_table_textbox dd \ |
\;0x00000001,key.tb.escape ,\ ; Escape |
0x0000000E,key.tb.bkspace ,\ ; BackSpace |
0x0000000E,key.tb.bkspace ,\ ; BackSpace |
\;0x0000000F,key.tb.tab ,\ ; Tab |
\;0x0000001C,key.tb.return ,\ ; Return |
0x00000147,key.tb.home ,\ ; Home |
0x0000014B,key.tb.left ,\ ; Left |
0x0000014D,key.tb.right ,\ ; Right |
0x0000014F,key.tb.end ,\ ; End |
0x00000153,key.tb.del ,\ ; Delete |
0x00010147,key.tb.shift_home ,\ ; Shift+Home |
0x0001014B,key.tb.shift_left ,\ ; Shift+Left |
0x00000147,key.tb.home ,\ ; Home |
0x0000014B,key.tb.left ,\ ; Left |
0x0000014D,key.tb.right ,\ ; Right |
0x0000014F,key.tb.end ,\ ; End |
0x00000153,key.tb.del ,\ ; Delete |
0x00010147,key.tb.shift_home ,\ ; Shift+Home |
0x0001014B,key.tb.shift_left ,\ ; Shift+Left |
0x0001014D,key.tb.shift_right ,\ ; Shift+Right |
0x0001014F,key.tb.shift_end ,\ ; Shift+End |
0x00010153,key.tb.del ,\ ; Shift+Del |
0x0001014F,key.tb.shift_end ,\ ; Shift+End |
0x00010153,key.tb.del ,\ ; Shift+Del |
0 |
accel_table2 dd \ |
accel_table2 dd \ |
1,btn.close_main_window ,\ |
\;10000,btn.compile ,\ |
\;10001,btn.compile_run ,\ |
\;10002,btn.debug_board ,\ |
\;10003,btn.sysfuncs_txt ,\ |
'UP',btn.scroll_up ,\ |
'DN',btn.scroll_down ,\ |
'LT',btn.scroll_left ,\ |
'UP',btn.scroll_up ,\ |
'DN',btn.scroll_down ,\ |
'LT',btn.scroll_left ,\ |
'RT',btn.scroll_right ,\ |
\;5,key.ctrl_o ,\ |
0 |
accel_table2_botdlg dd \ |
accel_table2_botdlg dd \ |
1,btn.close_main_window ,\ |
20001,btn.bot.cancel ,\ |
20001,btn.bot.cancel ,\ |
20002,btn.bot.opensave ,\ |
20003,btn.bot.find ,\ |
20003,btn.bot.find ,\ |
0 |
add_table: |
641,33 → 651,33 |
;sz param_setup,'LANG',0 ; parameter for SETUP |
fasm_start: |
dd 7 |
dd 0 |
dd fasm_parameters |
dd 0 |
dd 0 |
db '/RD/1/DEVELOP/FASM',0 |
dd 7 |
dd 0 |
dd fasm_parameters |
dd 0 |
dd 0 |
db '/RD/1/DEVELOP/FASM',0 |
board_start: |
dd 7 |
dd 0 |
dd 0 |
dd 0 |
dd 0 |
db '/RD/1/BOARD',0 |
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 |
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 |
dd 7 |
dd 0 |
dd sysfuncs_param |
dd 0 |
dd 0 |
db '/RD/1/DOCPAK',0 |
;sz setup ,'SETUP ' ; to change keyboard layout |
677,7 → 687,7 |
ru,<'SYSFUNCR.TXT',0>,\ |
en,<'SYSFUNCS.TXT',0> |
sz htext,'TINYPAD 4.0.3' |
sz htext,'TINYPAD ',APP_VERSION |
lszc help_text,b,\ |
ru,':',\ |
716,48 → 726,50 |
db 0 |
menubar_res main_menu,\ |
ru,' ©«' ,popup_file ,onshow.file ,\ |
ru,'à ¢ª ',popup_edit ,onshow.edit ,\ |
ru,'®¨áª' ,popup_search ,onshow.search ,\ |
ru,' ¯ãáª',popup_run ,onshow.run ,\ |
ru,'¯æ¨¨' ,popup_options,onshow.options,\ |
ru,' ©«' ,popup_file ,onshow.file ,\ |
ru,'à ¢ª ' ,popup_edit ,onshow.edit ,\ |
ru,'®¨áª' ,popup_search ,onshow.search ,\ |
ru,' ¯ãáª' ,popup_run ,onshow.run ,\ |
ru,'®¤¨à®¢ª ',popup_recode ,onshow.recode ,\ |
ru,'¯æ¨¨' ,popup_options,onshow.options,\ |
\ |
en,'File' ,popup_file ,onshow.file ,\ |
en,'Edit' ,popup_edit ,onshow.edit ,\ |
en,'Search' ,popup_search ,onshow.search,\ |
en,'Run' ,popup_run ,onshow.run ,\ |
en,'Options',popup_options,onshow.options |
en,'File' ,popup_file ,onshow.file ,\ |
en,'Edit' ,popup_edit ,onshow.edit ,\ |
en,'Search' ,popup_search ,onshow.search ,\ |
en,'Run' ,popup_run ,onshow.run ,\ |
en,'Encoding',popup_recode ,onshow.recode ,\ |
en,'Options' ,popup_options,onshow.options |
popup_res popup_file,\ |
ru,'®¢ë©' ,'Ctrl+N' ,key.ctrl_n ,\ |
ru,'®¢ë©' ,'Ctrl+N' ,key.ctrl_n ,\ |
ru,'âªàëâì...' ,'Ctrl+O' ,key.ctrl_o ,\ |
ru,'®åà ¨âì' ,'Ctrl+S' ,key.ctrl_s ,\ |
ru,'®åà ¨âì ª ª...','Ctrl+Shift+S',key.shift_ctrl_s,\ |
ru,'-' ,'' ,0 ,\ |
ru,'ë室' ,'Alt+X' ,key.alt_x ,\ |
ru,'-' ,'' ,0 ,\ |
ru,'ë室' ,'Alt+X' ,key.alt_x ,\ |
\ |
en,'New' ,'Ctrl+N' ,key.ctrl_n ,\ |
en,'Open...' ,'Ctrl+O' ,key.ctrl_o ,\ |
en,'Save' ,'Ctrl+S' ,key.ctrl_s ,\ |
en,'New' ,'Ctrl+N' ,key.ctrl_n ,\ |
en,'Open...' ,'Ctrl+O' ,key.ctrl_o ,\ |
en,'Save' ,'Ctrl+S' ,key.ctrl_s ,\ |
en,'Save as...','Ctrl+Shift+S',key.shift_ctrl_s,\ |
en,'-' ,'' ,0 ,\ |
en,'Exit' ,'Alt+X' ,key.alt_x |
en,'-' ,'' ,0 ,\ |
en,'Exit' ,'Alt+X' ,key.alt_x |
popup_res popup_edit,\ |
ru,'ë१ âì' ,'Ctrl+X',key.ctrl_x,\ |
ru,'®¯¨à®¢ âì' ,'Ctrl+C',key.ctrl_c,\ |
ru,'áâ ¢¨âì' ,'Ctrl+V',key.ctrl_v,\ |
ru,'¤ «¨âì' ,'' ,key.del ,\ |
ru,'-' ,'' ,0 ,\ |
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,\ |
en,'Paste' ,'Ctrl+V',key.ctrl_v,\ |
en,'Delete' ,'' ,key.del ,\ |
en,'-' ,'' ,0 ,\ |
en,'Cut' ,'Ctrl+X',key.ctrl_x,\ |
en,'Copy' ,'Ctrl+C',key.ctrl_c,\ |
en,'Paste' ,'Ctrl+V',key.ctrl_v,\ |
en,'Delete' ,'' ,key.del ,\ |
en,'-' ,'' ,0 ,\ |
en,'Select all','Ctrl+A',key.ctrl_a;,\ |
; en,'-' ,'' ,0 ,\ |
; en,'Vertical selection','Alt+Ins',0 |
764,50 → 776,69 |
popup_res popup_search,\ |
ru,'¥à¥©â¨...' ,'Ctrl+G',key.ctrl_g,\ |
ru,'-' ,'' ,0 ,\ |
ru,'-' ,'' ,0 ,\ |
ru,' ©â¨...' ,'Ctrl+F',key.ctrl_f,\ |
ru,' ©â¨ ¤ «¥¥','F3' ,key.f3 ,\ |
ru,' ¬¥¨âì...','Ctrl+H',key.ctrl_h,\ |
\ |
en,'Position...','Ctrl+G',key.ctrl_g,\ |
en,'-' ,'' ,0 ,\ |
en,'Find...' ,'Ctrl+F',key.ctrl_f,\ |
en,'-' ,'' ,0 ,\ |
en,'Find...' ,'Ctrl+F',key.ctrl_f,\ |
en,'Find next' ,'F3' ,key.f3 ,\ |
en,'Replace...' ,'Ctrl+H',key.ctrl_h |
popup_res popup_run,\ |
ru,' ¯ãáâ¨âì' ,'F9' ,key.f9 ,\ |
ru,'®¬¯¨«¨à®¢ âì' ,'Ctrl+F9',key.ctrl_f9 ,\ |
ru,'-' ,'' ,0 ,\ |
ru,'®áª ®â« ¤ª¨' ,'' ,open_debug_board ,\ |
ru,'¨áâ¥¬ë¥ äãªæ¨¨','' ,open_sysfuncs_txt,\ |
ru,' ¯ãáâ¨âì' ,'F9' ,key.f9 ,\ |
ru,'®¬¯¨«¨à®¢ âì' ,'Ctrl+F9',key.ctrl_f9 ,\ |
ru,'-' ,'' ,0 ,\ |
ru,'®áª ®â« ¤ª¨' ,'' ,open_debug_board ,\ |
ru,'¨áâ¥¬ë¥ äãªæ¨¨','' ,open_sysfuncs_txt,\ |
\ |
en,'Run' ,'F9' ,key.f9 ,\ |
en,'Compile' ,'Ctrl+F9',key.ctrl_f9 ,\ |
en,'-' ,'' ,0 ,\ |
en,'Debug board' ,'' ,open_debug_board ,\ |
en,'System functions' ,'' ,open_sysfuncs_txt |
en,'Run' ,'F9' ,key.f9 ,\ |
en,'Compile' ,'Ctrl+F9',key.ctrl_f9 ,\ |
en,'-' ,'' ,0 ,\ |
en,'Debug board' ,'' ,open_debug_board ,\ |
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,\ |
ru,'¥è¨© ¢¨¤...' ,'',0,\ |
ru,'-' ,'',0,\ |
ru,'¥è¨© ¢¨¤...' ,'',0,\ |
ru,'-' ,'',0,\ |
ru,'¥§®¯ ᮥ ¢ë¤¥«¥¨¥' ,'',set_secure_sel,\ |
ru,'¢â®¬ â¨ç¥áª¨¥ ᪮¡ª¨' ,'',set_auto_braces,\ |
ru,'¢â®¬ â¨ç¥áª¨© ®âáâã¯' ,'',set_auto_indents,\ |
ru,'¬ ï â ¡ã«ïæ¨ï' ,'',0,\ |
ru,'¬ ï â ¡ã«ïæ¨ï' ,'',0,\ |
ru,'¯â¨¬ «ì®¥ á®åà ¥¨¥','',set_optimal_fill,\ |
ru,'-' ,'',0,\ |
ru,'®¬¥à áâப' ,'',set_line_numbers,\ |
ru,'-' ,'',0,\ |
ru,'®¬¥à áâப' ,'',set_line_numbers,\ |
\ |
en,'Appearance...' ,'',0,\ |
en,'-' ,'',0,\ |
en,'Appearance...' ,'',0,\ |
en,'-' ,'',0,\ |
en,'Secure selection' ,'',set_secure_sel,\ |
en,'Automatic brackets' ,'',set_auto_braces,\ |
en,'Automatic indents' ,'',set_auto_indents,\ |
en,'Smart tabulation' ,'',0,\ |
en,'Optimal fill on saving','',set_optimal_fill,\ |
en,'-' ,'',0,\ |
en,'Line numbers' ,'',set_line_numbers |
en,'-' ,'',0,\ |
en,'Line numbers' ,'',set_line_numbers |
lsz s_modified,\ |
ru,'§¬¥¥®',\ |
880,16 → 911,16 |
sz symbols_ex,';?.%"',"'" |
sz symbols ,'#&*\:/<>|{}()[]=+-, ' |
ini_sec_window db 'Window',0 |
ini_window_top db 'Top',0 |
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 |
db '/rd/1/tinypad.ini',0 |
TINYPAD_END: ; end of file |
TINYPAD_END: ; end of file |
self_path rb PATHL |
905,17 → 936,17 |
f_info.path: |
times PATHL+1 db ? |
pos.x dd ? ; global X position (cursor) |
pos.y dd ? ; global Y position (cursor) |
sel.x dd ? ; global X position (selection start) |
sel.y dd ? ; global Y position (selection start) |
lines dd ? ; number of lines in file |
pos.x dd ? ; global X position (cursor) |
pos.y dd ? ; global Y position (cursor) |
sel.x dd ? ; global X position (selection start) |
sel.y dd ? ; global Y position (selection start) |
lines dd ? ; number of lines in file |
lines.scr dd ? ; number of lines on the screen |
columns dd ? ; number of columns in file |
columns.scr dd ? ; number of columns on the screen |
top_ofs dd ? ; height occupied by top buttons |
bot_ofs dd ? ; height occupied by bottom buttons |
dw ? |
dw ? |
left_ofs dd ? ; |
top_line dd ? ; topmost visible line on screen |
left_col dd ? ; leftmost visible char on line |
924,10 → 955,10 |
hscrl_top dd ? |
hscrl_size dd ? |
;skinh dd ? ; skin height |
__rc dd ?,?,?,? |
__rc dd ?,?,?,? |
;filelen dd ? ; file size (on save) ??? |
filesize dd ? ; file size (on load) ??? |
ya dd ? ; for read_string |
ya dd ? ; for read_string |
;copy_start dd ? ; first line for copying (Ctrl+S) |
copy_count dd ? ; number of lines for copying (Ctrl+E) |
copy_size dd ? ; size of data to copy |
945,7 → 976,7 |
sel.end.y dd ? |
sel.selected db ? |
in_sel db ? |
in_sel db ? |
asm_mode db ? ; ASM highlight? |
do_not_draw db ? ; draw top and bottom buttons? |
985,7 → 1016,7 |
mst db ? |
mst2 db ? |
mev db ? |
mouse_captured db ? |
mouse_captured db ? |
just_from_popup db ? |
bot_mode db ? |
1003,9 → 1034,9 |
fasm_parameters: |
p_info process_information |
p_info process_information |
p_info2 process_information |
sc system_colors |
sc system_colors |
diff16 'Main memory size',0,$ |
/programs/develop/tinypad/trunk/tp-button.asm |
---|
0,0 → 1,355 |
button: |
mcall 17 |
cmp al,0 |
jne still |
shr eax,8 |
cmp [bot_mode],0 |
je @f |
mov ebx,eax |
mov al,3 |
call [bot_dlg_handler] |
jmp still |
@@: mov esi,accel_table2 |
.acc: cmp eax,[esi] |
jne @f |
call dword[esi+4] |
jmp still.skip_write |
@@: add esi,8 |
cmp byte[esi],0 |
jne .acc |
jmp still.skip_write |
; cmp eax,BUTTON_SCRLUP |
; jne not_up |
btn.scroll_up: |
dec [top_line] |
jns @f |
inc [top_line] |
ret;jmp still.skip_write |
@@: call check_inv_all.skip_check |
ret |
; not_up: |
; cmp eax,BUTTON_SCRLDN |
; jne not_down |
btn.scroll_down: |
inc [top_line] |
mov eax,[lines] |
sub eax,[lines.scr] |
cmp eax,[top_line] |
jge @f |
dec [top_line] |
;dec eax |
;mov [top_line],eax |
ret;jmp still.skip_write |
@@: call check_inv_all.skip_check |
ret |
; not_down: |
; cmp eax,BUTTON_SCRLLT |
; jne not_left |
btn.scroll_left: |
dec [left_col] |
jns @f |
inc [left_col] |
ret;jmp still.skip_write |
@@: call check_inv_all.skip_check |
ret |
; not_left: |
; cmp eax,BUTTON_SCRLRT |
; jne not_right |
btn.scroll_right: |
inc [left_col] |
mov eax,[columns] |
sub eax,[columns.scr] |
cmp eax,[left_col] |
jge @f |
dec [left_col] |
;dec eax |
;mov [left_col],eax |
ret;jmp still.skip_write |
@@: call check_inv_all.skip_check |
ret |
; not_right: |
; SEARCH { |
; search: |
; cmp al,BUTTON_SEARCH |
; jne no_search |
btn.search: |
key.f3: |
call search |
jc @f |
call check_inv_all |
@@: ret |
func search |
cld |
mov ecx,[pos.y] |
mov edx,ecx |
call get_line_offset |
cmp word[esi],0 |
je .exit |
call get_real_length |
add esi,4 |
or eax,eax |
jz .end_line.2 |
mov ecx,eax |
sub ecx,[pos.x] |
push esi |
add esi,[pos.x] |
;dec ecx |
;inc esi |
jmp @f |
.next_line: |
push esi |
@@: sub ecx,[s_search.size] |
inc ecx |
.next_char: |
dec ecx |
js .end_line |
xor edi,edi |
.next_ok: |
movzx eax,byte[edi+esi] |
movzx ebx,byte[edi+s_search] |
cmp al,$61 |
jb @f |
add al,[eax+add_table-$61] |
@@: cmp bl,$61 |
jb @f |
add bl,[ebx+add_table-$61] |
@@: |
cmp al,bl |
je @f |
inc esi |
jmp .next_char |
@@: |
inc edi |
cmp edi,[s_search.size] |
jne .next_ok |
.found: |
add esp,4 |
mov [pos.y],edx |
mov [sel.y],edx |
mov ecx,edx |
lea eax,[esi-4] |
call get_line_offset |
sub eax,esi |
mov [sel.x],eax |
add eax,[s_search.size] |
mov [pos.x],eax |
mov [s_status],0 |
clc |
ret |
.end_line: |
pop esi |
.end_line.2: |
movzx eax,word[esi-4] |
add esi,eax;[esi-4] |
inc edx |
call get_real_length |
mov ecx,eax |
lodsd |
or eax,eax |
jnz .next_line |
.exit: |
mov [s_status],s_text_not_found |
stc |
ret |
endf |
; SEARCH } |
; no_search: |
; TOOLBAR { |
; cmp eax,10000 |
; jb no_toolbar |
; add eax,-10000 |
; jnz @f |
btn.compile: |
key.ctrl_f9: |
mov bl,0;[run_outfile],0 |
call start_fasm |
ret;jmp still |
; @@: dec eax |
; jnz @f |
btn.compile_run: |
key.f9: |
mov bl,1;[run_outfile],1 |
call start_fasm |
ret;jmp still |
; @@: dec eax |
; jnz @f |
btn.debug_board: |
call open_debug_board |
ret;jmp still |
; @@: dec eax |
; jnz still |
btn.sysfuncs_txt: |
call open_sysfuncs_txt |
ret;jmp still |
; TOOLBAR } |
; no_toolbar: |
; cmp al,4 |
; jne noid4 |
; LOAD_FILE { |
; do_load_file: |
btn.load_file: |
key.ctrl_l: |
; cmp [s_fname],'/' |
; jne @f |
; call load_hd_file |
; jmp .restorecursor |
; @@: call load_file |
call load_file |
jnc @f |
ret |
; .restorecursor: |
@@: |
xor eax,eax |
mov [top_line],eax |
mov [left_col],eax |
mov [pos.x],eax |
mov [pos.y],eax |
mov [sel.x],eax |
mov [sel.y],eax |
mov [modified],al |
; enable color syntax for ASM and INC files: |
mov [asm_mode],al |
mov eax,[f_info.length] ; [s_fname.size] |
add eax,f_info.path ; s_fname |
mov byte[eax],0 |
mov ecx, dword [eax-3] |
or ecx, 0x202020 |
cmp ecx, 'asm' |
jne @f |
inc [asm_mode] |
jmp .nocol |
@@: cmp ecx, 'inc' |
jne .nocol |
inc [asm_mode] |
.nocol: |
update_caption: |
macro unused { |
movzx ecx,[f_info.length] ; [s_fname.size] |
add ecx,10 ; strlen(" - TINYPAD"); |
cmp ecx,[s_title.size] |
jne @f |
add ecx,-10 |
mov esi,f_info.path ; s_fname ; strcmp(s_fname,header); |
mov edi,s_title |
repe cmpsb |
jne @f |
; call draw_file |
clc |
ret;jmp still |
@@: |
} |
; set window title: |
mov esi,f_info.path ; s_fname |
mov edi,s_title |
cld |
mov ecx,[f_info.length] ; [s_fname.size] |
jecxz @f |
;lea eax,[ecx+10] |
;mov [s_title.size],eax |
;cld |
rep movsb |
mov dword[edi],' - ' |
add edi,3 |
@@: mov esi,htext |
mov ecx,htext.size |
rep movsb |
mov al,0 |
stosb |
; call drawwindow |
clc |
ret;jmp still |
; LOAD_FILE } |
; noid4: |
; cmp al, 2 |
; jz yessave |
; dec al ; close if butid == 1 |
; jnz nosave |
; EXIT: |
btn.close_main_window: |
key.alt_x: |
mov esi,self_path |
mov byte[esi+PATHL-1],0 |
mov edi,f_info.path |
cld |
@@: lodsb |
stosb |
or al,al |
jnz @b |
; mov ebx,f_info |
; mov dword[ebx+0],1 |
; mov dword[ebx+8],self_path |
; mov dword[ebx+12],0 |
; 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 |
; je .close |
; cmp eax,6 |
; je .close |
; ret |
.close: |
mov [main_closed],1 |
mcall -1 |
; SAVE_FILE { |
; yessave: |
; btn.save_file: |
; key.ctrl_s: |
; mov [bot_mode],1 |
; mov [bot_save_mode],1 |
; mov [bot_dlg_height],16*2+4*2-1 |
; mov [bot_dlg_handler],osdlg_handler |
; call drawwindow |
; call save_file |
; ret;jmp still |
; SAVE_FILE } |
; nosave: |
; btn.save_enter_name: |
; inc al |
; call read_string |
; ret;jmp still |
/programs/develop/tinypad/trunk/tp-common.asm |
---|
0,0 → 1,590 |
;----------------------------------------------------------------------------- |
func check_cur_vis_inv ;////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
push eax ebx |
xor bl,bl |
.chk_y: |
mov eax,[pos.y] |
or eax,eax |
jge @f |
mov [pos.y],0 |
jmp .chk_dy |
@@: cmp eax,[lines] |
jl .chk_dy |
mov eax,[lines] |
dec eax |
mov [pos.y],eax |
.chk_dy: |
mov eax,[top_line] |
cmp eax,[pos.y] |
jle @f |
push [pos.y] |
pop [top_line] |
inc bl |
@@: add eax,[lines.scr] |
cmp eax,[pos.y] |
jg .chk_x |
mov eax,[pos.y] |
sub eax,[lines.scr] |
inc eax |
mov [top_line],eax |
inc bl |
.chk_x: |
mov eax,[pos.x] |
or eax,eax |
jge @f |
mov [pos.x],0 |
jmp .chk_dx |
@@: cmp eax,[columns] |
jl .chk_dx |
mov eax,[columns] |
mov [pos.x],eax |
.chk_dx: |
mov eax,[left_col] |
cmp eax,[pos.x] |
jle @f |
push [pos.x] |
pop [left_col] |
inc bl |
@@: add eax,[columns.scr] |
cmp eax,[pos.x] |
jg @f |
mov eax,[pos.x] |
sub eax,[columns.scr] |
inc eax |
mov [left_col],eax |
inc bl |
@@: cmp [mev],MEV_LDOWN |
jne .exit |
push [pos.x] [pos.y] |
pop [sel.y] [sel.x] |
.exit: |
or bl,bl |
clc |
jz @f |
call draw_file |
stc |
@@: pop ebx eax |
ret |
endf |
;----------------------------------------------------------------------------- |
func clear_selection ;//////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
push eax ebx |
mov eax,[sel.y] |
mov ebx,[pos.y] |
cmp eax,ebx |
jle @f |
xchg eax,ebx |
@@: push [pos.x] [pos.y] |
pop [sel.y] [sel.x] |
call draw_file.ex |
pop ebx eax |
ret |
endf |
;----------------------------------------------------------------------------- |
func pt_in_rect ;///////////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
cmp eax,[ecx+0x0] |
jl @f |
cmp ebx,[ecx+0x4] |
jl @f |
cmp eax,[ecx+0x8] |
jg @f |
cmp ebx,[ecx+0xC] |
jg @f |
stc |
ret |
@@: clc |
ret |
endf |
;----------------------------------------------------------------------------- |
func check_bottom_right ;///////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
push eax |
mov eax,[top_line] |
add eax,[lines.scr] |
cmp eax,[lines] |
jbe .lp1 |
mov eax,[lines] |
sub eax,[lines.scr] |
jns @f |
xor eax,eax |
@@: mov [top_line],eax |
.lp1: mov eax,[left_col] |
add eax,[columns.scr] |
cmp eax,[columns] |
jbe .exit |
mov eax,[columns] |
sub eax,[columns.scr] |
jns @f |
xor eax,eax |
@@: mov [left_col],eax |
.exit: |
pop eax |
ret |
endf |
;----------------------------------------------------------------------------- |
func check_inv_str ;////////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
@^ |
mov eax,[pos.y] |
mov ecx,[top_line] |
.skip_init: |
call check_cur_vis |
mov [pos.y],eax |
mov [top_line],ecx |
.skip_check: |
; call invalidate_string |
call drawfile |
ret |
^@ |
endf |
;----------------------------------------------------------------------------- |
func check_inv_all ;////////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
mov eax,[pos.y] |
mov ecx,[top_line] |
.skip_init: |
call check_cur_vis |
mov [pos.y],eax |
mov [top_line],ecx |
.skip_check: |
; call clear_screen |
call draw_file |
ret |
endf |
;----------------------------------------------------------------------------- |
func check_cur_vis ;////////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
cmp eax,ecx |
jb .low |
mov edx,ecx |
add edx,[lines.scr] |
cmp edx,[lines] |
jbe @f |
mov edx,[lines] |
@@: cmp eax,edx |
jb @f |
lea ecx,[eax+1] |
sub ecx,[lines.scr] |
jns @f |
xor ecx,ecx |
jmp @f |
.low: mov ecx,eax |
@@: mov edx,ecx |
add edx,[lines.scr] |
cmp edx,[lines] |
jbe @f |
mov ecx,[lines] |
sub ecx,[lines.scr] |
jns @f |
xor ecx,ecx |
@@:;mov [top_line],ecx |
pushad |
mov eax,[pos.x] |
mov ebx,[left_col] |
mov ecx,ebx |
add ecx,[columns.scr] |
cmp eax,ebx |
jb .lp1 |
cmp eax,ecx |
jb .exit |
lea ebx,[eax] |
sub ebx,[columns.scr] |
jmp @f |
.lp1: mov ebx,eax |
@@: mov [left_col],ebx |
.exit: |
mov [pos.x],eax |
popad |
ret |
endf |
;----------------------------------------------------------------------------- |
func get_real_length ;//////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
movzx eax,word[esi] |
@@: cmp byte[esi+eax+4-1],' ' |
jne @f |
dec eax |
jnz @b |
@@: ret |
endf |
;----------------------------------------------------------------------------- |
func get_line_offset ;//////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
; Input: |
; ECX = line number |
; Output: |
; ESI = line data offset |
;----------------------------------------------------------------------------- |
push eax ecx |
mov esi,AREA_EDIT |
jecxz .exit |
@@: movzx eax,word[esi] |
dec ecx |
lea esi,[esi+eax+4] |
jnz @b |
.exit: |
pop ecx eax |
ret |
endf |
;----------------------------------------------------------------------------- |
func init_sel_vars ;////////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
pushad |
mov [sel.selected],1 |
mov eax,[sel.x] |
mov ebx,[sel.y] |
mov ecx,[pos.x] |
mov edx,[pos.y] |
cmp ebx,edx |
jl .lp2 |
jne @f |
cmp eax,ecx |
jl .lp2 |
jne .lp1 |
dec [sel.selected] |
jmp .lp2 |
@@: xchg ebx,edx |
.lp1: xchg eax,ecx |
.lp2: mov [sel.begin.x],eax |
mov [sel.begin.y],ebx |
mov [sel.end.x],ecx |
mov [sel.end.y],edx |
popad |
ret |
endf |
;----------------------------------------------------------------------------- |
func get_scroll_vars ;//////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
; Input: |
; EAX = maximum data size (units) |
; EBX = visible data size (units) |
; ECX = current data position (units) |
; EDX = scrolling area size (pixels) |
; Output: |
; EAX = srcoller offset (pixels) |
; EBX = scroller size (pixels) |
;----------------------------------------------------------------------------- |
push eax ebx edx |
; sub eax,ebx |
mov esi,eax |
mov eax,edx |
imul ebx |
idiv esi |
cmp eax,[esp] |
jge .null |
cmp eax,AMINS |
jge @f |
neg eax |
add eax,AMINS |
sub [esp],eax |
mov eax,AMINS |
@@: mov [esp+4],eax ; scroller size |
mov eax,[esp] |
imul ecx |
idiv esi |
or eax,eax |
jns @f |
xor eax,eax |
@@: mov [esp+8],eax ; scroller offset |
add eax,[esp+4] |
cmp eax,[esp] |
jle @f |
; mov eax,[esp] |
; sub eax,[esp+4] |
; js @f |
; mov [esp+8],eax |
@@: |
pop edx ebx eax |
ret |
.null: |
mov dword[esp+4],0 |
mov dword[esp+8],0 |
jmp @b |
endf |
;----------------------------------------------------------------------------- |
func uint2strz ;////////////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
dec ebx |
jz @f |
xor edx,edx |
div ecx |
push edx |
call uint2strz |
pop eax |
@@: cmp al,10 |
sbb al,$69 |
das |
stosb |
ret |
endf |
;----------------------------------------------------------------------------- |
func uint2str ;/////////////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
cmp eax,ecx |
jb @f |
xor edx,edx |
div ecx |
push edx |
call uint2str |
pop eax |
@@: cmp al,10 |
sbb al,$69 |
das |
stosb |
ret |
endf |
;----------------------------------------------------------------------------- |
func rgb_to_gray ;//////////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
push 0 eax |
and dword[esp],0x000000FF |
fild dword[esp] |
fmul [float_gray_b] |
shr eax,8 |
mov [esp],eax |
and dword[esp],0x000000FF |
fild dword[esp] |
fmul [float_gray_g] |
faddp |
shr eax,8 |
and eax,0x000000FF |
mov [esp],eax |
fild dword[esp] |
fmul [float_gray_r] |
faddp |
frndint |
fist dword[esp] |
fist dword[esp+1] |
fistp dword[esp+2] |
pop eax |
add esp,4 |
ret |
endf |
;float_gray_r dd 0.30f |
;float_gray_g dd 0.59f |
;float_gray_b dd 0.11f |
;----------------------------------------------------------------------------- |
func get_active_menu_item ;/////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
pushad |
mov [mi_cur],0 |
mcall 37,1 |
movsx ebx,ax |
sar eax,16 |
mov ecx,__rc |
pushd 2 0 (main_menu.width+7) (ATOPH-2) |
popd [__rc+0xC] [__rc+0x8] [__rc+0x4] [__rc+0x0] |
; add [__rc+0xC],ATOPH-2 |
call pt_in_rect |
jnc .outside_menu |
m2m dword[ecx+0x8],dword[ecx+0x0] |
mov edx,main_menu |
@@: inc [mi_cur] |
movzx esi,word[edx+0] |
add [ecx+0x8],esi |
call pt_in_rect |
jc .exit |
m2m dword[ecx+0x0],dword[ecx+0x8] |
add edx,8+1 |
movzx esi,byte[edx-1] |
add edx,esi |
cmp byte[edx+8],0 |
jne @b |
mov [mi_cur],0 |
.exit: |
popad |
ret |
.outside_menu: |
or [mi_cur],-1 |
@@: popad |
ret |
endf |
;----------------------------------------------------------------------------- |
func get_active_popup_item ;////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
pushad |
mov [pi_cur],0 |
mcall 37,1 |
movsx ebx,ax |
sar eax,16 |
mov ecx,__rc |
mov dword[ecx+0x0],0 |
mov dword[ecx+0x4],0 |
movzx edx,[ebp+POPUP.width] |
mov dword[ecx+0x8],edx;POP_WIDTH |
movzx edx,[ebp+POPUP.height] |
mov dword[ecx+0xC],edx;POP_HEIGHT |
call pt_in_rect |
jnc .outside_window |
inc dword[ecx+0x0] |
mov dword[ecx+0x4],3 |
dec dword[ecx+0x8] |
mov dword[ecx+0xC],3+POP_IHEIGHT-1 |
mov edx,[ebp+POPUP.data];popup_text.data |
@@: inc [pi_cur] |
inc edx |
movzx esi,byte[edx-1] |
cmp byte[edx],'-' |
jne .lp1 |
pushd [ecx+0xC] |
sub dword[ecx+0xC],POP_IHEIGHT-4 |
call pt_in_rect |
popd [ecx+0xC] |
jc .separator |
add dword[ecx+0x4],4 |
add dword[ecx+0xC],4 |
jmp .lp3 |
.lp1: call pt_in_rect |
jnc .lp2 |
mov eax,[pi_cur] |
test byte[ebp+eax-1],1;byte[popup_text+eax-1],1 |
jnz .exit |
jmp .separator |
.lp2: add dword[ecx+0x4],POP_IHEIGHT |
add dword[ecx+0xC],POP_IHEIGHT |
add edx,esi |
inc edx |
movzx esi,byte[edx-1] |
.lp3: add edx,esi |
cmp byte[edx],0 |
jne @b |
.separator: |
mov [pi_cur],0 |
.exit: |
popad |
ret |
.outside_window: |
or [pi_cur],-1 |
jmp .exit |
endf |
;----------------------------------------------------------------------------- |
func line_add_spaces ;//////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
; esi = line offset |
; ecx = needed line length |
;----------------------------------------------------------------------------- |
pushad |
movzx edx,word[esi] |
cmp ecx,edx |
jbe .exit |
sub ecx,edx |
push ecx |
mov edi,AREA_TEMP2 |
mov eax,esi |
mov esi,edi |
sub esi,ecx |
lea ecx,[eax+4] |
add ecx,edx;[eax] |
push ecx |
neg ecx |
lea ecx,[esi+ecx+1] |
std |
rep movsb |
pop edi ecx |
add [eax],cx |
mov al,' ' |
cld |
rep stosb |
.exit: |
popad |
ret |
endf |
;----------------------------------------------------------------------------- |
func delete_selection ;/////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
cmp [sel.selected],0 |
je .exit.2 |
pushad |
mov ecx,[sel.begin.y] |
cmp ecx,[sel.end.y] |
je .single_line |
call get_line_offset |
and dword[esi],not 0x00020000 |
or dword[esi],0x00010000 |
mov ecx,[sel.begin.x] |
call line_add_spaces |
lea edi,[esi+4] |
mov ecx,[sel.end.y] |
call get_line_offset |
call get_real_length |
cmp eax,[sel.end.x] |
jbe @f |
mov eax,[sel.end.x] |
@@: movzx ecx,word[esi] |
sub ecx,eax |
mov ebx,[sel.begin.x] |
add ebx,ecx |
mov [edi-4],bx |
add edi,[sel.begin.x] |
lea esi,[esi+eax+4] |
mov ecx,AREA_TEMP2 |
sub ecx,esi |
cld |
rep movsb |
mov eax,[sel.end.y] |
sub eax,[sel.begin.y] |
sub [lines],eax |
jmp .exit |
.single_line: |
call get_line_offset |
and dword[esi],not 0x00020000 |
or dword[esi],0x00010000 |
call get_real_length |
cmp eax,[sel.begin.x] |
jbe .exit |
mov ecx,[sel.end.x] |
cmp ecx,eax |
jbe @f |
mov ecx,eax |
@@: sub ecx,[sel.begin.x] |
sub [esi],cx |
lea edi,[esi+4] |
add edi,[sel.begin.x] |
lea esi,[edi+ecx] |
mov ecx,AREA_TEMP2 |
sub ecx,esi |
cld |
rep movsb |
.exit: |
mov eax,[sel.begin.x] |
mov [pos.x],eax |
mov [sel.x],eax |
mov eax,[sel.begin.y] |
mov [pos.y],eax |
mov [sel.y],eax |
popad |
mov [modified],1 |
clc |
ret |
.exit.2: |
stc |
ret |
endf |
/programs/develop/tinypad/trunk/tp-dialog.asm |
---|
0,0 → 1,331 |
;----------------------------------------------------------------------------- |
func define_3d_button ;/////////////////////////////////////////////////////// |
;----------------------------------------------------------------------------- |
; ebx = <x,width> |
; ecx = <y,height> |
; esp+4*3 = id |
; esp+4*2 = text |
; esp+4*1 = text length |
;----------------------------------------------------------------------------- |
pushad |
mov edx,[esp+4*8+4+4*2] |
or edx,0x40000000 |
mcall 8 |
mov eax,[esp+4*8+4*1] |
add eax,2 |
imul eax,6 |
pushad |
shr ebx,16 |
shr ecx,16 |
push ebx ecx eax 15 |
call draw_3d_panel |
popad |
shr ecx,16 |
mov bx,cx |
add ebx,7*65536+4 |
mcall 4,,[sc.work_text],[esp+4*8+4*2],[esp+4*8+4*1] |
popad |
ret 4*3 |
endf |
finddlg_handler: |
cmp al,1 |
je .draw |
cmp al,2 |
je .key |
cmp al,3 |
je botdlg.button |
ret |
.draw: |
mov ebx,[bot_ofs] |
add ebx,(1+3)*65536+6 |
mcall 4,,[sc.work_text],s_2find,s_2find.size+1 |
mov ecx,[bot_ofs] |
shl ecx,16 |
add ecx,(3+17)*65536+15 |
push ecx |
cmp [bot_dlg_mode2],0 |
je @f |
add ebx,18 |
mcall 4,,[sc.work_text],s_2replace,s_2replace.size+1 |
mov ecx,[esp] |
add ecx,18*65536 |
@@: |
mov ebx,[p_info.client_box.width] |
shl ebx,16 |
push 20003 |
cmp [bot_dlg_mode2],0 |
jne .draw.lp1 |
add ebx,-(2+6*(s_2find.size+2))*65536+6*(s_2find.size+2) |
push s_2find s_2find.size |
jmp @f |
.draw.lp1: |
add ebx,-(2+6*(s_2replace.size+2))*65536+6*(s_2replace.size+2) |
push s_2replace s_2replace.size |
@@: call define_3d_button |
sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
mov bx,6*(s_2cancel.size+2) |
push 20001 s_2cancel s_2cancel.size |
call define_3d_button |
mov ecx,[esp] |
mov ebp,tb_find |
mov eax,[p_info.client_box.width] |
sub eax,6*(s_2find.size+2)+1 |
add eax,6*(s_2find.size+2)*65536 |
mov dword[tbox.x],eax |
add ecx,-18*65536+1 |
mov dword[tbox.y],ecx |
call textbox.draw |
pop ecx |
cmp [bot_dlg_mode2],0 |
je @f |
mov ebp,tb_replace |
mov eax,[p_info.client_box.width] |
sub eax,6*(s_2replace.size+2)+1 |
add eax,6*(s_2replace.size+2)*65536 |
mov dword[tbox.x],eax |
inc ecx |
mov dword[tbox.y],ecx |
call textbox.draw |
@@: |
ret |
.key: |
cmp ebx,KEY_ESCAPE |
je btn.bot.cancel |
cmp ebx,KEY_RETURN |
je btn.bot.find |
cmp ebx,KEY_NUMRETURN |
je btn.bot.find |
cmp ebx,KEY_TAB |
je ..tab |
call textbox.key |
ret |
..tab: |
cmp [bot_dlg_mode2],0 |
je @f |
mov eax,tb_replace |
cmp eax,[focused_tb] |
jne .key.lp1 |
mov eax,tb_find |
.key.lp1: |
mov [focused_tb],eax |
call .draw |
@@: ret |
osdlg_handler: |
cmp al,1 |
je .draw |
cmp al,2 |
je .key |
cmp al,3 |
je botdlg.button |
ret |
.draw: |
mov ebx,[bot_ofs] |
add ebx,(1+3)*65536+6 |
mcall 4,,[sc.work_text],s_2filename,s_2filename.size |
mov ebx,[p_info.client_box.width] |
shl ebx,16 |
mov ecx,[bot_ofs] |
shl ecx,16 |
add ecx,(2+18)*65536+15 |
push 20002 |
cmp [bot_dlg_mode2],0 |
jne .draw.lp1 |
add ebx,-(2+6*(s_2open.size+2))*65536+6*(s_2open.size+2) |
push s_2open s_2open.size |
jmp @f |
.draw.lp1: |
add ebx,-(2+6*(s_2save.size+2))*65536+6*(s_2save.size+2) |
push s_2save s_2save.size |
@@: call define_3d_button |
sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
mov bx,6*(s_2cancel.size+2) |
push 20001 s_2cancel s_2cancel.size |
call define_3d_button |
mov ebp,tb_opensave |
mov eax,[p_info.client_box.width] |
sub eax,6*(s_2filename.size+1)+1 |
add eax,6*(s_2filename.size+1)*65536 |
mov dword[tbox.x],eax |
add ecx,-18*65536+1 |
mov dword[tbox.y],ecx |
call textbox.draw |
ret |
.key: |
cmp ebx,KEY_ESCAPE |
je btn.bot.cancel |
cmp ebx,KEY_RETURN |
je btn.bot.opensave |
cmp ebx,KEY_NUMRETURN |
je btn.bot.opensave |
call textbox.key |
ret |
gotodlg_handler: |
cmp al,1 |
je .draw |
cmp al,2 |
je .key |
cmp al,3 |
je botdlg.button |
ret |
.draw: |
mov ebx,[bot_ofs] |
add ebx,(1+3)*65536+6 |
mcall 4,,[sc.work_text],s_2filename,s_2filename.size |
mov ebx,[p_info.box.width] |
shl ebx,16 |
mov ecx,[bot_ofs] |
shl ecx,16 |
add ecx,(2+18)*65536+15 |
push 20002 |
cmp [bot_dlg_mode2],0 |
jne .draw.lp1 |
add ebx,-(2+6*(s_2open.size+2))*65536+6*(s_2open.size+2) |
push s_2open s_2open.size |
jmp @f |
.draw.lp1: |
add ebx,-(2+6*(s_2save.size+2))*65536+6*(s_2save.size+2) |
push s_2save s_2save.size |
@@: call define_3d_button |
sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
mov bx,6*(s_2cancel.size+2) |
push 20001 s_2cancel s_2cancel.size |
call define_3d_button |
mov ebp,tb_opensave |
mov eax,[p_info.box.width] |
sub eax,6*(s_2filename.size+3) |
add eax,6*(s_2filename.size+2)*65536 |
mov dword[tbox.x],eax |
add ecx,-18*65536+1 |
mov dword[tbox.y],ecx |
call textbox.draw |
ret |
.key: |
cmp ebx,KEY_ESCAPE |
je btn.bot.cancel |
cmp ebx,KEY_RETURN |
je btn.bot.opensave |
cmp ebx,KEY_NUMRETURN |
je btn.bot.opensave |
call textbox.key |
ret |
botdlg.button: |
mov esi,accel_table2_botdlg |
.acc: cmp ebx,[esi] |
jne @f |
call dword[esi+4] |
ret |
@@: add esi,8 |
cmp byte[esi],0 |
jne .acc |
ret |
btn.bot.cancel: |
xor eax,eax |
mov [bot_mode],al |
mov [bot_dlg_height],eax |
mov [s_status],eax |
call drawwindow |
ret |
btn.bot.opensave: |
cmp [bot_dlg_mode2],0 |
je .lp1 |
call save_file |
jnc @f |
jmp .lp2 |
.lp1: call btn.load_file |
jnc @f |
.lp2: |
ret |
@@: call update_caption |
xor eax,eax |
mov [bot_mode],al |
mov [bot_dlg_height],eax |
call drawwindow |
ret |
btn.bot.find: |
movzx ecx,[tb_find.length] |
mov [s_search.size],ecx |
mov esi,tb_find.text |
mov edi,s_search |
cld |
rep movsb |
cmp [bot_dlg_mode2],0 |
je @f |
call search |
jnc .found |
call check_inv_all |
ret |
.found: |
;--------------------------------------- |
push [copy_size] [copy_count] |
mov esi,AREA_CBUF |
mov edi,AREA_CBUF-304 |
mov ecx,300/4 |
rep movsd |
movzx eax,[tb_replace.length] |
mov esi,tb_replace.text |
mov edi,AREA_CBUF |
stosd |
mov ecx,eax |
jecxz .lp1 |
rep movsb |
.lp1: add eax,4 |
mov [copy_size],eax |
mov [copy_count],1 |
push [sel.x] |
call init_sel_vars |
call key.ctrl_v |
pop [sel.x] |
mov esi,AREA_CBUF-304 |
mov edi,AREA_CBUF |
mov ecx,300/4 |
rep movsd |
pop [copy_count] [copy_size] |
;--------------------------------------- |
call check_inv_all |
ret |
@@: xor eax,eax |
mov [bot_mode],al |
mov [bot_dlg_height],eax |
call btn.search |
call drawwindow |
ret |
/programs/develop/tinypad/trunk/tp-mouse.asm |
---|
396,6 → 396,8 |
ret |
.run: |
ret |
.recode: |
ret |
.options: |
mov word[popup_options+0],0 |
mov byte[popup_options+5],0 |
/programs/develop/tinypad/trunk/tp-recode.asm |
---|
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 |
table.1251.koi db \ |
$B1,$B2,$00,$A2,$00,$00,$00,$00 , $00,$00,$B9,$00,$BA,$BC,$BB,$BF,\ |
$A1,$91,$92,$93,$94,$95,$96,$97 , $00,$99,$A9,$00,$AA,$AC,$AB,$AF,\ |
$A0,$BE,$AE,$B8,$9F,$BD,$00,$00 , $B3,$98,$B4,$9D,$00,$00,$9C,$B7,\ |
$00,$00,$B6,$A6,$AD,$00,$00,$9E , $A3,$B0,$A4,$9B,$A8,$B5,$A5,$A7,\ |
$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,\ |
$D2,$D3,$D4,$D5,$C6,$C8,$C3,$DE , $DB,$DD,$DF,$D9,$D8,$DC,$C0,$D1 |
table.koi.1251 db \ |
$00,$00,$00,$00,$00,$00,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\ |
$00,$91,$92,$93,$94,$95,$96,$97 , $00,$99,$00,$BB,$AE,$AB,$B7,$A4,\ |
$A0,$90,$83,$B8,$BA,$BE,$B3,$BF , $BC,$9A,$9C,$9E,$9D,$B4,$A2,$9F,\ |
$B9,$80,$81,$A8,$AA,$BD,$B2,$AF , $A3,$8A,$8C,$8E,$8D,$A5,$A1,$8F,\ |
$FE,$E0,$E1,$F6,$E4,$E5,$F4,$E3 , $F5,$E8,$E9,$EA,$EB,$EC,$ED,$EE,\ |
$EF,$FF,$F0,$F1,$F2,$F3,$E6,$E2 , $FC,$FB,$E7,$F8,$FD,$F9,$F7,$FA,\ |
$DE,$C0,$C1,$D6,$C4,$C5,$D4,$C3 , $D5,$C8,$C9,$CA,$CB,$CC,$CD,$CE,\ |
$CF,$DF,$D0,$D1,$D2,$D3,$C6,$C2 , $DC,$DB,$C7,$D8,$DD,$D9,$D7,$DA |