forked from KolibriOS/kolibrios
modify macros and optimization
git-svn-id: svn://kolibrios.org@483 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1,7 +1,632 @@
|
||||
;Œ ªà®á ¤«ï ¢ë¢®¤ ®á®¢ëå äãªæ¨© ª®â®àë¥ ¨á¯«ì§ãîâáï ¡®ªá®¬
|
||||
macro use_general_func
|
||||
{
|
||||
;debug_func
|
||||
;----------------------------------------------------------
|
||||
;--- ¯à®æ¥¤ãà ¯à®à¨á®¢ª¨ ¢ë¤¥«¥®© ç á⨠-----------------
|
||||
;----------------------------------------------------------
|
||||
.draw_shift:
|
||||
test word ed_flags,ed_shift_bac ;ãáâ ®¢ª ä« £ , ¢ë¤¥«¥®© ®¡« áâ¨
|
||||
jz @f
|
||||
mov ebp,shift_color
|
||||
mov ebx,dword ed_shift_pos
|
||||
call .sh_cl_
|
||||
@@: ret
|
||||
;----------------------------------------------------------
|
||||
;--- ¯à®æ¥¤ãà ¯à®à¨á®¢ª¨ ⥪áâ --------------------------
|
||||
;----------------------------------------------------------
|
||||
.draw_text:
|
||||
;--- ¢ëç¨á«ï¥¬, ᪮«ìª® ¯®¬¥é ¥âáï ᨬ¢®«®¢ ---
|
||||
;--- çâ®¡ë ¬ãá®à ¥ à¨á®¢ âì ---
|
||||
call .get_n
|
||||
mov esi,ed_size
|
||||
mov ebx,ed_offset
|
||||
sub esi,ebx
|
||||
cmp eax,esi
|
||||
jae @F
|
||||
mov esi,eax ;çâ®¡ë ¥ ¢ë室¨âì § ¯à¥¤¥«ë íªà
|
||||
;--- à¨á㥬 ⥪áâ ---
|
||||
@@: mov eax,4
|
||||
mov ebx,ed_left
|
||||
mov edx,ed_offset
|
||||
add ebx,2
|
||||
shl ebx,16
|
||||
mov bx,ed_top
|
||||
add ebx,4
|
||||
mov ecx,ed_text_color
|
||||
add edx,ed_text
|
||||
mcall
|
||||
ret
|
||||
;----------------------------------------------------------
|
||||
;--- ¯à®æ¥¤ãà ¯à®à¨á®¢ª¨ ä® ----------------------------
|
||||
;¢å®¤ë¥ ¤ ë¥
|
||||
;eax
|
||||
;edx - color
|
||||
;----------------------------------------------------------
|
||||
;¢å®¤ ⮫쪮 梥â edx
|
||||
.draw_bg:
|
||||
mov ebx,ed_left
|
||||
add ebx,1
|
||||
shl ebx,16
|
||||
mov bx,ed_width
|
||||
sub ebx,1
|
||||
mov edx,ed_color
|
||||
.draw_bg_eax:
|
||||
mov ecx,ed_top
|
||||
mov eax,13
|
||||
add ecx,1
|
||||
shl ecx,16
|
||||
mov cx,ed_height
|
||||
dec ecx
|
||||
mcall
|
||||
ret
|
||||
|
||||
;----------------------------------------------------------
|
||||
;--- ¯à®æ¥¤ãà ¯®«ãç¥¨ï ª®«¨ç¥á⢠ᨬ¢®«®¢ ¢ ⥪ã饩 é¨à¨¥ ª®¬¯®¥â
|
||||
;----------------------------------------------------------
|
||||
.get_n:
|
||||
mov eax,ed_width ;¯®«ã祬 è¨à¨ã ª®¬¯®¥â
|
||||
xor edx,edx ;१ã«ìâ â à ᯮ«®£ ¥âáï ¢ ¯ ॠedx:eax ¢ eax - ®áâ ⮪
|
||||
sub eax,4 ;¢ëç⨬ 4
|
||||
mov ebx,6 ;§ £à㧬¨ ¤¥«¨â¥«ì
|
||||
div ebx ;à §¬¤¥«¨¬ 6
|
||||
ret
|
||||
;----------------------------------------------------------
|
||||
;--- ¯à®æ¥¤ãà à¨á®¢ ¨ï ªãàá®à --------------------------
|
||||
;----------------------------------------------------------
|
||||
;¢å®¤ë¥ ebp- 梥â
|
||||
.clear_cursor:
|
||||
mov edx,ebp
|
||||
mov ebx,cl_curs_x
|
||||
mov ecx,cl_curs_y
|
||||
jmp .draw_curs
|
||||
.draw_cursor:
|
||||
mov edx,ed_text_color
|
||||
mov ebx,ed_pos
|
||||
mov ecx,ed_offset
|
||||
sub ebx,ecx
|
||||
|
||||
lea ebx,[ebx*2+ebx]
|
||||
shl ebx,1
|
||||
;imul ebx,6
|
||||
add bx,ed_left
|
||||
mov ecx,ed_top
|
||||
inc ebx
|
||||
add ecx,2
|
||||
mov ebp,ebx
|
||||
shl ebx,16
|
||||
mov bx,bp
|
||||
mov ebp,ecx
|
||||
|
||||
shl ecx,16
|
||||
mov cx,bp
|
||||
add cx,ed_height-4
|
||||
|
||||
mov cl_curs_x,ebx
|
||||
mov cl_curs_y,ecx
|
||||
.draw_curs:
|
||||
mcall 38
|
||||
ret
|
||||
;----------------------------------------------------------
|
||||
;--- ¯à®æ¥¤ãà à¨á®¢ ¨ï à ¬ª¨ ----------------------------
|
||||
;----------------------------------------------------------
|
||||
.draw_border:
|
||||
;--- 梥â à ¬ª¨ ---
|
||||
test word ed_flags,ed_focus
|
||||
mov edx,ed_focus_border_color
|
||||
jne @f
|
||||
mov edx,ed_blur_border_color
|
||||
@@:
|
||||
;--- ᢥàåã ---
|
||||
mov eax,38
|
||||
mov ebx,ed_left
|
||||
mov ecx,ebx
|
||||
shl ebx,16
|
||||
mov bx,cx
|
||||
add bx,ed_width
|
||||
mov ecx, ed_top
|
||||
mov esi,ecx
|
||||
shl ecx,16
|
||||
mov cx,si
|
||||
mcall
|
||||
;--- ᨧã ---
|
||||
mov esi,ecx
|
||||
add ecx,ed_height
|
||||
mov ebp,ecx
|
||||
shl ecx,16
|
||||
mov cx,bp
|
||||
mcall
|
||||
;--- á«¥¢ ---
|
||||
mov cx,si
|
||||
mov ebp,ebx
|
||||
sub bx,ed_width
|
||||
mcall
|
||||
;--- á¯à ¢ ---
|
||||
mov ebx,ebp
|
||||
shl ebx,16
|
||||
mov bx,bp
|
||||
mcall
|
||||
ret
|
||||
;----------------------------------------------------------
|
||||
;--- ¯à®¢¥àª , § 襫 «¨ ªãàá®à § £à ¨æë ¨, ¥á«¨ ¤®, ---
|
||||
;--- ¨§¬¥ï¥¬ ᬥ饨¥ ------------------------------------
|
||||
;--- ¥á«¨ ᬥ饨¥ ¡ë«® ãáâ ®¢ª ä« £ ed_offset_cl ¨ ç¥
|
||||
; ¥á«¨ ¨ç¥£® ¥ ¨§¬¥¨«®áì â® ¢ëáâ ¢«¥¨¥ ed_offset_fl
|
||||
; ¢ ®¡é¥© ¡¨â®¢®© ¬ àà¨æ¥ á®áâ®ï¨ï ª®¬¯®¥â®¢ word ed_flags
|
||||
;----------------------------------------------------------
|
||||
.check_offset:
|
||||
pusha
|
||||
mov ecx,ed_pos
|
||||
mov ebx,ed_offset
|
||||
cmp ebx,ecx
|
||||
ja .sub_8
|
||||
|
||||
push ebx
|
||||
call .get_n ;¯®«ã稬 ª®«-¢® ᨬ¢®«®¢ ¢ ¯ ॠॣ¨áâ஢ edx:eax
|
||||
pop ebx
|
||||
mov edx,ebx
|
||||
add edx,eax ;ed_offset+width editbox
|
||||
inc edx ;¥®¡å®¤¨¬® ¤«ï ®¬ «ì®£® ¯®«®¦¥¨ï ªãàá®à ¢ ªà ©¥© «¥¢®© ¯®§¨æ¨¨
|
||||
cmp edx,ecx
|
||||
ja @f
|
||||
|
||||
mov edx,ed_size
|
||||
cmp edx,ecx
|
||||
je .add_end
|
||||
|
||||
sub edx,ecx
|
||||
cmp edx,8
|
||||
jbe .add_8
|
||||
add ebx,8
|
||||
jmp .chk_d
|
||||
|
||||
.sub_8: cmp ecx,0
|
||||
je .sub_min
|
||||
cmp ebx,8
|
||||
jbe .sub_min
|
||||
sub ebx,8 ;ebx=ed_offset
|
||||
jmp .chk_d
|
||||
.sub_min:
|
||||
xor ebx,ebx
|
||||
jmp .chk_d
|
||||
|
||||
.add_end:sub edx,eax
|
||||
mov ebx,edx
|
||||
jmp .chk_d
|
||||
.add_8: add ebx,edx
|
||||
.chk_d: mov ed_offset,ebx
|
||||
call .draw_bg
|
||||
and word ed_flags,ed_offset_cl
|
||||
edit_ex
|
||||
@@:
|
||||
or word ed_flags,ed_offset_fl
|
||||
edit_ex
|
||||
}
|
||||
|
||||
macro use_key_func
|
||||
{
|
||||
;Ž¡à ¡®âª Shift ¤«ï áïâ¨ï ¢ë¤¥«¥¨ï ¥¨§¢¥á⮩ ®¡« áâ¨
|
||||
.shift: ;;;;;;;SHIFT
|
||||
test word ed_flags,ed_shift
|
||||
je .f_exit
|
||||
|
||||
@@: mov ebp,shift_color
|
||||
or word ed_flags,ed_shift_bac ;ãáâ ®¢ª ä« £ , ¢ë¤¥«¥®© ®¡« áâ¨
|
||||
mov ebx,dword ed_shift_pos
|
||||
call .sh_cl_
|
||||
jmp .draw_cursor_text
|
||||
;;;;;;;;;;;;;;;;;;;;;
|
||||
.f_exit:call .check_offset
|
||||
and word ed_flags,ed_shift_cl
|
||||
call .enable_null
|
||||
jmp .draw_cursor_text
|
||||
.sh_cl_:
|
||||
;;;;;;SHIFT end
|
||||
;®¡à ¡®âª ®ç¨á⪨, ¯à¨ «¥¢®¬ - ¯à ¢®¬ ¤¢¨¦¥¨¨ ¢ë¤¥«¥¨ï
|
||||
;¤«ï ®¡à ¡®âª¨ áïâ¨ï ¢ë¤¥«¥¨ï
|
||||
;¢å®¤ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
|
||||
mov eax,dword ed_pos
|
||||
cmp eax,ebx
|
||||
|
||||
jae .sh_n
|
||||
push eax ;¬¥ì襥 ¢ eax
|
||||
push ebx ;¡®«ì襥
|
||||
jmp .sh_n1
|
||||
;¥á«¨ ¨ ç¥
|
||||
.sh_n: push ebx
|
||||
push eax
|
||||
.sh_n1:
|
||||
call .check_offset
|
||||
call .get_n
|
||||
mov edx,eax ;size of ed_box
|
||||
mov ecx,ed_offset
|
||||
add eax,ecx ;eax = w_off= ed_offset+width
|
||||
mov edx,eax ;save
|
||||
pop ebx ;¡®«ì襥
|
||||
pop eax ;¬¥ì襥
|
||||
|
||||
cmp eax,ecx ;áà ¢¥¨¥ á ¬¥ì襣® á offset.
|
||||
jae .f_f ;¥á«¨ ¡®«ìè¥
|
||||
xor eax,eax
|
||||
cmp edx,ebx ;cà ¢¨¬ à §¬¥à w_off á ¡®«ì訬
|
||||
jb @f
|
||||
sub ebx,ecx
|
||||
jmp .nxt_f
|
||||
@@: mov ebx,edx
|
||||
sub ebx,ecx
|
||||
jmp .nxt_f
|
||||
.f_f:
|
||||
sub eax,ecx
|
||||
cmp edx,ebx ;cà ¢¨¬ à §¬¥à w_off á ¡®«ì訬
|
||||
jle @f
|
||||
sub ebx,ecx
|
||||
sub ebx,eax
|
||||
jmp .nxt_f
|
||||
@@:
|
||||
mov ebx,edx
|
||||
sub ebx,ecx
|
||||
sub ebx,eax
|
||||
.nxt_f:
|
||||
mov edx,ebx
|
||||
lea ebx,[eax*2+eax]
|
||||
shl ebx,1
|
||||
add ebx,ed_left
|
||||
inc ebx
|
||||
shl ebx,16
|
||||
lea ecx,[edx*2+edx]
|
||||
shl ecx,1
|
||||
mov bx,cx
|
||||
inc ebx
|
||||
mov edx,ebp;shift_color
|
||||
|
||||
call .draw_bg_eax
|
||||
@@: call .enable_null
|
||||
ret
|
||||
;;;;;;;;;;;;;;;;;;;;;
|
||||
;“áâ ®¢ª - áï⨥ ¢ë¤¥«¥¨ï ¢ ®¤¨ ᨬ¢®«
|
||||
;;;;;;;;;;;;;;;;;;;;;
|
||||
.drw_sim:
|
||||
mov eax,dword ed_pos
|
||||
call .draw_rectangle ; à¨á®¢ âì ¯àאַ㣮«ì¨ª á § ¤ ë¬ æ¢¥â®¬
|
||||
jmp @b
|
||||
;;;;;;;;;;;;;;;;;;;;;
|
||||
;”ãªæ¨ï ãáâ ®¢ª¨ ¢ë¤¥«¥¨ï ¯à¨ ¤¢¨¦¥¨ï ¢«¥¢® ¨ ¢¯à ¢® ¨ ¦ ⨨ shift
|
||||
;‹®£¨ª :
|
||||
;;;;;;;;;;
|
||||
.draw_wigwag:
|
||||
;äãªæ¨ï ãáâ ®¢ª¨ ¯¥à¥¬¥ëå
|
||||
mov ebp,shift_color
|
||||
call .clear_cursor
|
||||
|
||||
or word ed_flags,ed_shift_bac ;ãáâ ®¢ª ä« £ , ¢ë¤¥«¥®© ®¡« áâ¨
|
||||
mov ebp,shift_color
|
||||
mov eax,dword ed_pos
|
||||
test word ed_flags,ed_left_fl
|
||||
jz .low
|
||||
jmp @f
|
||||
;;;;;;;;;;
|
||||
;”ãªæ¨ï 㤠«¥¨ï ¢ë¤¥«¥¨ï ¯à¨ ¤¢¨¦¥¨ï ¢«¥¢® ¨ ¢¯à ¢® ¨ ¦ ⨨ shift
|
||||
;‹®£¨ª :
|
||||
;;;;;;;;;;
|
||||
.draw_wigwag_cl:
|
||||
;äãªæ¨ï ãáâ ®¢ª¨ ¯¥à¥¬¥ëå
|
||||
mov ebp,ed_color
|
||||
call .clear_cursor
|
||||
|
||||
mov ebp,ed_color
|
||||
mov eax,dword ed_pos
|
||||
test word ed_flags,ed_left_fl
|
||||
jz .low
|
||||
@@: call .draw_rectangle ; à¨á®¢ âì ¯àאַ㣮«ì¨ª § ªà 訢 ¥¬®© ®¡« áâ¨
|
||||
ret
|
||||
.low: dec eax
|
||||
jmp @b
|
||||
;¢å®¤®© ¯ à ¬¥âà ebx - ed_pos
|
||||
.sh_first_sh:
|
||||
test word ed_flags,ed_shift
|
||||
je @f
|
||||
mov dword ed_shift_pos_old,ebx
|
||||
test word ed_flags,ed_shift_on
|
||||
jne @f
|
||||
mov dword ed_shift_pos,ebx
|
||||
or word ed_flags,ed_shift_on
|
||||
@@: ret
|
||||
;Ž¡à ¡®âª ªà ©¨å ¯®«®¦¥¨© ¢ editbox ¯à¨ ¦ ⮬ shift
|
||||
;¯à®¨§¢®¤¨â áï⨥ ¢ë¤¥«¥¨¥, ¥á«¨ ¥â shift
|
||||
;¨ ç¥ ¢®®¡é¥ ¢ë室¨â
|
||||
.sh_st_of:
|
||||
test word ed_flags,ed_shift
|
||||
jne @f
|
||||
test word ed_flags,ed_shift_bac
|
||||
je @f
|
||||
mov ebp,ed_color
|
||||
mov ebx,dword ed_shift_pos
|
||||
call .sh_cl_ ;®ç¨á⪠¢ë¤¥«¥®£® äà £¬¥â
|
||||
and word ed_flags,ed_shift_cl ; ®ç¨á⪠®â ⮣® çâ® ã¡à «¨ ¢ë¤¥«¥¨¥
|
||||
jmp .draw_cursor_text
|
||||
@@:
|
||||
and word ed_flags,ed_shift_off
|
||||
edit_ex
|
||||
;¯à®¢¥àª á®áâ®ï¨ï shift ¡ë« «¨ ® ¦ â à ìè¥?
|
||||
.sh_enable:
|
||||
test word ed_flags,ed_shift
|
||||
jne .sh_ext_en ; à¨á®¢ âì § ªà è¥ë© ¯àאַ㣮«ì¨ª
|
||||
|
||||
test word ed_flags,ed_shift_bac
|
||||
je @f
|
||||
call .check_offset
|
||||
|
||||
mov ebp,ed_color
|
||||
mov ebx,dword ed_shift_pos
|
||||
call .sh_cl_ ;®ç¨á⪠¢ë¤¥«¥®£® äà £¬¥â
|
||||
call .draw_wigwag_cl
|
||||
and word ed_flags,ed_shift_cl ; 1¢ à ¥ 㦮
|
||||
ret
|
||||
|
||||
@@: mov ebp,ed_color
|
||||
call .clear_cursor
|
||||
call .check_offset
|
||||
ret
|
||||
.sh_ext_en:
|
||||
call .check_offset
|
||||
test word ed_flags,ed_offset_fl
|
||||
je @f
|
||||
;<3B>¨á®¢ ¨¥ § ªà è¥ëå ¯àאַ㣮«ì¨ª®¢ ¨ ®ç¨á⪠¨å
|
||||
mov eax,dword ed_shift_pos
|
||||
mov ebx,dword ed_pos
|
||||
mov ecx,dword ed_shift_pos_old
|
||||
;¯à®¢¥àª ¨ à¨á®¢ ¨¥ § ªà è¥ëå ®¡« á⥩
|
||||
cmp eax,ecx
|
||||
je .1_shem
|
||||
jb .smaller
|
||||
cmp ecx,ebx
|
||||
ja .1_shem
|
||||
call .draw_wigwag_cl ;clear
|
||||
jmp .sh_e_end
|
||||
.smaller:
|
||||
cmp ecx,ebx
|
||||
jb .1_shem
|
||||
call .draw_wigwag_cl ;clear
|
||||
jmp .sh_e_end
|
||||
;alike =
|
||||
.1_shem: call .draw_wigwag
|
||||
.sh_e_end: and word ed_flags,ed_shift_off
|
||||
ret
|
||||
@@: mov ebp,shift_color
|
||||
mov ebx,dword ed_shift_pos
|
||||
call .sh_cl_
|
||||
jmp .sh_e_end
|
||||
;äãªæ¨ï ¤«ï ®¡à ¡®âª¨ shift ¯à¨ ¦ ⨨ home and end
|
||||
.sh_home_end:
|
||||
mov ebp,ed_color
|
||||
call .clear_cursor
|
||||
test word ed_flags,ed_shift_bac
|
||||
je @f
|
||||
mov ebp,ed_color
|
||||
mov ebx,dword ed_shift_pos_old
|
||||
call .sh_cl_
|
||||
|
||||
@@: test word ed_flags,ed_shift
|
||||
je .sh_exit_ ;¢ë©â¨
|
||||
mov ebp,shift_color
|
||||
mov ebx,dword ed_shift_pos
|
||||
call .sh_cl_
|
||||
or word ed_flags,ed_shift_bac ;ãáâ ®¢ª ä« £ , ¢ë¤¥«¥®© ®¡« áâ¨
|
||||
jmp .sh_e_end
|
||||
.sh_exit_: call .check_offset
|
||||
ret
|
||||
;äãªæ¨ï ¢¥á¥¨ï 0 ¯® ¤à¥áã ed_size+1
|
||||
.enable_null:
|
||||
pusha
|
||||
mov eax,ed_size
|
||||
mov ebx,ed_text
|
||||
test eax,eax
|
||||
add eax,ebx
|
||||
jne @f
|
||||
inc eax
|
||||
@@: xor ebx,ebx
|
||||
mov [eax],bl
|
||||
edit_ex
|
||||
;- 㤠«¥¨¥ ᨬ¢®«
|
||||
;‚å®¤ë¥ ¤ ë¥ edx=ed_size;ecx=ed_pos
|
||||
.del_char:
|
||||
mov esi,ed_text
|
||||
test word ed_flags,ed_shift_on
|
||||
je @f
|
||||
mov eax,dword ed_shift_pos
|
||||
mov ebx,esi
|
||||
cmp eax,ecx
|
||||
jae .dh_n
|
||||
|
||||
mov ed_pos,eax ;çâ® ¡ë ¥ ¡ë«® ã¡¥£ ¨ï ªãàá®à
|
||||
mov ebp,ecx
|
||||
sub ebp,eax
|
||||
add ebx,eax ;eax ¬¥ìè¥
|
||||
sub edx,ecx
|
||||
add esi,ecx
|
||||
|
||||
mov dword ed_shift_pos,ebp
|
||||
jmp .del_ch_sh
|
||||
;¥á«¨ ¨ ç¥
|
||||
.dh_n:
|
||||
mov ebp,eax
|
||||
sub ebp,ecx
|
||||
add ebx,ecx
|
||||
sub edx,eax
|
||||
add esi,eax
|
||||
mov dword ed_shift_pos,ebp
|
||||
jmp .del_ch_sh
|
||||
|
||||
@@: add esi,ecx ;㪠§ ⥫ì + ᬥ饨¥ ª ॠ«ì®¬ã ¡ãää¥àã
|
||||
mov ebx,esi
|
||||
inc esi
|
||||
cld
|
||||
|
||||
sub edx,ecx
|
||||
.del_ch_sh:
|
||||
|
||||
push edi
|
||||
mov edi,ebx
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
dec edx
|
||||
jns @b
|
||||
|
||||
pop edi
|
||||
ret
|
||||
;¢ëç¨á«¨âì § ªà 訢 ¥¬ãî ®¡« áâì
|
||||
;ᮣ« 襨¥ ¢ ebp - ¯¥à¥¤ ¥âáï ed_size
|
||||
.clear_bg:
|
||||
call .get_n ;¯®«ãç¨âì à §¬¥à ¢ ᨬ¢®« å è¨à¨ë ª®¬¯®¥â
|
||||
push eax
|
||||
mov ebx,ed_offset
|
||||
add eax,ebx ;eax = w_off= ed_offset+width
|
||||
mov ebx,ebp ;ed_size
|
||||
|
||||
cmp eax,ebx
|
||||
jb @f
|
||||
mov eax,ed_pos
|
||||
sub ebx,eax
|
||||
mov ecx,ed_offset
|
||||
sub eax,ecx
|
||||
jmp .nxt
|
||||
@@: mov ebx,ed_pos
|
||||
push ebx
|
||||
sub eax,ebx
|
||||
mov ebx,eax ;It is don't optimal
|
||||
|
||||
pop eax ;ed_pos
|
||||
mov ecx,ed_offset
|
||||
sub eax,ecx
|
||||
.nxt:
|
||||
mov ebp,eax ;¯à®¢¥àª ¢ë室 § ªà 訢 ¥¬®© ®¡« á⨠§ ¯à¥¤¥«ë ¤«¨ë
|
||||
add ebp,ebx
|
||||
pop edx
|
||||
cmp ebp,edx
|
||||
je @f
|
||||
inc ebx
|
||||
|
||||
@@: mov edx,ebx
|
||||
lea ebx,[eax*2+eax]
|
||||
shl ebx,1
|
||||
add ebx,ed_left
|
||||
inc ebx
|
||||
shl ebx,16
|
||||
lea ecx,[edx*2+edx]
|
||||
shl ecx,1
|
||||
mov bx,cx
|
||||
mov edx,ed_color
|
||||
call .draw_bg_eax
|
||||
ret
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
;;; Ž¡à ¡®âª ¯à¨¬¨â¨¢®¢
|
||||
;;;;;;;;;;;;;;;;;;;;
|
||||
;<3B> à¨á®¢ âì ¯àאַ㣮«ì¨ª, 梥⠯¥à¥¤ ¥âáï ¢ ebp
|
||||
;¢å®¤ë¥ ¯ à ¬¥âàë:
|
||||
;eax=dword ed_pos
|
||||
;ebp=-梥â ed_color or shift_color
|
||||
.draw_rectangle:
|
||||
mov ecx,dword ed_offset
|
||||
sub eax,ecx
|
||||
lea ebx,[eax*2+eax]
|
||||
shl ebx,1
|
||||
inc ebx
|
||||
add ebx,ed_left
|
||||
shl ebx,16
|
||||
mov bx,6
|
||||
mov edx,ebp
|
||||
call .draw_bg_eax
|
||||
ret
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
;;<3B>஢¥àª ¦ â «¨ shift
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
.check_shift:
|
||||
pusha ;á®åà ¨¬ ¢á¥ ॣ¨áâàë
|
||||
mcall 66,3,1
|
||||
test al,0x03
|
||||
je @f
|
||||
or word ed_flags,ed_shift ;ãáâ ®¢¨¬ ä« £
|
||||
@@:edit_ex
|
||||
}
|
||||
;¬ ªà®á ª« ¢¨è ª®â®àë¥ ¯à®¨á室¨â ॠªæ¨ï
|
||||
macro use_key_process backspase,delete,left,right,home,end,insert
|
||||
{
|
||||
if backspase eq
|
||||
else
|
||||
cmp ah,8
|
||||
jz .backspace
|
||||
end if
|
||||
if delete eq
|
||||
else
|
||||
cmp ah,0xb6
|
||||
jz .delete
|
||||
end if
|
||||
if left eq
|
||||
else
|
||||
cmp ah,176
|
||||
jz .left
|
||||
end if
|
||||
if right eq
|
||||
else
|
||||
cmp ah,179
|
||||
jz .right
|
||||
end if
|
||||
if home eq
|
||||
else
|
||||
cmp ah,180
|
||||
jz .home
|
||||
end if
|
||||
if home eq
|
||||
else
|
||||
cmp ah,181
|
||||
jz .end
|
||||
end if
|
||||
if insert eq
|
||||
else
|
||||
cmp ah,185 ;insert
|
||||
jz .insert
|
||||
end if
|
||||
}
|
||||
macro use_key_no_process up,down,esc
|
||||
{
|
||||
if up eq
|
||||
else
|
||||
cmp ah,177
|
||||
jz .no_figure
|
||||
end if
|
||||
if down eq
|
||||
else
|
||||
cmp ah,178
|
||||
jz .no_figure
|
||||
end if
|
||||
if esc eq
|
||||
else
|
||||
cmp ah,27 ;ESC - ª« ¢¨è ))
|
||||
jz .no_figure
|
||||
end if
|
||||
}
|
||||
|
||||
macro use_key_figures_only
|
||||
{
|
||||
test word ed_flags,ed_figure_only ; ⮫쪮 æ¨äàë ?
|
||||
jz @f
|
||||
cmp ah,'0'
|
||||
jb .no_figure
|
||||
cmp ah,'9'
|
||||
ja .no_figure
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; Œ ªà®á ¢ë室
|
||||
macro edit_ex
|
||||
{
|
||||
popa
|
||||
popa
|
||||
ret
|
||||
}
|
||||
macro debug
|
||||
|
||||
Reference in New Issue
Block a user