kolibrios-fun/programs/develop/libraries/box_lib/trunk/optionbox.mac

186 lines
6.2 KiB
Plaintext
Raw Normal View History

;䠩<><><E1AEA7><EFBFBD> 13.02.2009 <Lrz> <20><> <20><><EFBFBD> <20><EFBFBD><E0A8AC><EFBFBD><EFBFBD><EFBFBD> GPL2 <20><><EFBFBD><E6A5AD><EFBFBD>
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> box_lib.obj
;Optionbox
macro use_optionbox_driver ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E0A0A2><EFBFBD><EFBFBD><><20><><EFBFBD><EFBFBD><EFBFBD> )
{
option_box_draw:
pusha
mov eax,dword [esp+36]
@@: mov edi,dword [eax]
test edi,edi
je option_check
call option_box_draw_box
add eax,4
jmp @b
option_check:
mov eax,dword [esp+36]
@@: mov edi,dword [eax]
test edi,edi
je @f
mov ebx,dword [edi]
mov ebx,dword [ebx]
cmp edi,ebx
jne .clear_op
pusha
call option_box_draw_op
popa
add eax,4
jmp @b
.clear_op:
pusha
call option_box_clear_op
popa
add eax,4
jmp @b
@@: popa
ret 4
; exit <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :)
option_box_mouse:
pusha
mcall 37,2
test eax,eax
jnz @f
popa
ret 4
@@:
mov eax,dword [esp+36]
@@: mov edi,dword [eax]
test edi,edi
je option_check
call option_box_mouse_op
add eax,4
jmp @b
}
macro use_optionbox_draw
{
option_box_draw_box:
pusha ;<3B><><EFBFBD><EFBFBD><E0A0AD> <20><><EFBFBD><><E0A5A3><EFBFBD><EFBFBD><EFBFBD>
movzx ebx,word op_left
shl ebx,16
add ebx,dword op_size
movzx ecx,word op_top
shl ecx,16
add ecx,dword op_size
mov edx,dword op_border_color
mov eax,13
mcall ;<3B><><EFBFBD>㥬 ࠬ<><E0A0AC>
mov edx,dword op_color
add ebx,1 shl 16 - 2
add ecx,1 shl 16 - 2
mcall ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A5AD><EFBFBD><EFBFBD><EFBFBD><><E7A5AA><EFBFBD><EFBFBD><EFBFBD>
; mov eax,dword option_group
; mov dword eax,[eax]
; cmp eax,edi
; jne @f
; call option_box_draw_op ;<3B><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD><EFBFBD><20><><EFBFBD><EFBFBD>
;----------------------------
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><20><EFBFBD> <20><EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><><E2A5AA><EFBFBD>
;----------------------------
@@: movzx ebx,word op_left ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3A7A8> <20><><EFBFBD><EFBFBD><E7A5AD> <20> <20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD>
add ebx,dword op_size
add ebx,dword op_text_margin;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><20><><EFBFBD><E7ADA5><EFBFBD> <20><EFBFBD><><E2A5AA><EFBFBD>
shl ebx,16 ;ᤢ<><E1A4A2><EFBFBD><EFBFBD> <20><> 16 ࠧ<><EFBFBD> <20> <20><><EFBFBD><EFBFBD> (㬭<><E3ACAD><EFBFBD><EFBFBD> <20><> 65536)
mov bx,word op_top ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD> <20><> y
add ebx,op_size
mov ecx,dword op_text_color ;<3B><><EFBFBD><EFBFBD><EFBFBD><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> + flags
sub ebx,7 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> -9+2
mov edx,dword op_text_ptr ;㪠<><E3AAA0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><20><EFBFBD> <20><EFBFBD><EBA2AE><EFBFBD><EFBFBD> <20><><EFBFBD>
mov esi,dword op_text_length
;<3B><><EFBFBD><20> eax <20><><EFBFBD><EFBFBD><E7A5AD> <20><EFBFBD><EBA2AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
mov eax,4
mcall ;<3B><EFBFBD>
popa ;<3B><><EFBFBD><EFBFBD><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD><><E0A5A3><EFBFBD><20><> <20><EFBFBD>
ret ;<3B><EFBFBD><EBA9A4> <20><> <20><><EFBFBD><EFBFBD><E6A5A4><EFBFBD>
option_box_clear_op: ;<3B><><EFBFBD><EFBFBD>⪠ 祪 <20><><EFBFBD><EFBFBD><EFBFBD>
mov edx,dword op_color ;梥<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD>
jmp @f ;<3B><><EFBFBD><EFBFBD><EFBFBD><E1ABAE><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> @@
option_box_draw_op: ;<3B><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD><EFBFBD><20><><EFBFBD><EFBFBD>
mov edx,dword op_border_color ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3A7A8><>
@@:
movzx ebx,word op_left ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3A7A8> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20>
mov eax,dword op_size
mov bp,ax
shr eax,2
push ax
push ax
add ebx,eax
shl ebx,16 ;ᤢ<><E1A4A2><EFBFBD><EFBFBD> <20><> 16 ࠧ<><EFBFBD> <20> <20><><EFBFBD><EFBFBD> (㬭<><E3ACAD><EFBFBD><EFBFBD> <20><> 65536)
pop ax
lea eax,[eax*2]
sub bp,ax ;<3B><><EFBFBD><EFBFBD><E0A0AD><><E0A5A3><EFBFBD><EFBFBD> bx <20><><E0A5A3><EFBFBD><EFBFBD><EFBFBD><><E3AAA0><EFBFBD> <20><><EFBFBD><EFBFBD>
mov bx,bp
movzx ecx,word op_top ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3A7A8> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20>
pop ax
add cx,ax
shl ecx,16 ;ᤢ<><E1A4A2><EFBFBD><EFBFBD> <20><> 16 ࠧ<><EFBFBD> <20> <20><><EFBFBD><EFBFBD> (㬭<><E3ACAD><EFBFBD><EFBFBD> <20><> 65536)
mov cx,bp ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD><><E0A5A3><EFBFBD><EFBFBD><EFBFBD><><E3AAA0><EFBFBD> <20><><EFBFBD><EFBFBD> <20> cx
mov eax,13 ;<3B> eax - <20><><EFBFBD><EFBFBD><E7A5AD> <20>㭪樨 <20><><EFBFBD> <20><EFBFBD><EBA2AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.<2E>. <20><> <20><><EFBFBD><EFBFBD> <20><>אַ㣮<EFACAE><EFBFBD><ECADA8>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD>
mcall ;<3B><EFBFBD>
ret ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><E6A5A4><EFBFBD>
}
macro use_optionbox_mouse
{
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<3B><><EFBFBD><E0A0A1>稪 mouse
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
option_box_mouse_op: ;<3B><><EFBFBD><20><><EFBFBD><EFBFBD>
pusha
mov esi,dword op_text_length ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3A7A8> <20><><EFBFBD>-<2D><><><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E2AEA2> <20><><EFBFBD>
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 6 <20><><EFBFBD><EFBFBD>஥ 㬭<><E3ACAD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><ECA7AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><E2AEA4>, <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (386,486,P1)<29><><EFBFBD><EFBFBD><20><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Lea
; lea esi,[eax*2+eax]
; shl eax,1
imul esi,6 ; <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> ⠪ 㬭<><E3ACAD><EFBFBD><EFBFBD><EFBFBD> <20><> 6
xor ebx,ebx
add esi,dword op_text_margin ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov eax,37 ;<3B><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><>
inc ebx ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1
mcall ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E2ADAE>⥫쭮 <20><><EFBFBD><EFBFBD>
movzx ebx,word op_top ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3A7A8> <20> bx <20><><EFBFBD><EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20>
cmp ax,bx ;<3B><EFBFBD><E0A0A2><EFBFBD><EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><E0A4A8><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
jl option_box_mouse_end ;SF <> OF <20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
add ebx,dword op_size ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E0A0A7><EFBFBD>
cmp ax,bx ;<3B><EFBFBD><E0A0A2><EFBFBD><EFBFBD>
jg option_box_mouse_end ;ZF = 0 <20> SF = OF <20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
shr eax,16 ;ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD> <20><> 65536 <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E1A4A2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> 16 <20><><EFBFBD><EFBFBD><E7A5AD>
movzx ebx,word op_left ;<3B><EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD>
cmp ax,bx ;<3B><EFBFBD><E0A0A2><EFBFBD><EFBFBD><><E0A5A3><EFBFBD><EFBFBD><EFBFBD>
jl option_box_mouse_end ;<3B><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
add ebx,dword op_size ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>אַ㣮<EFACAE><EFBFBD><ECADA8>
add ebx,esi ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><E7A5AD> <20><> <20> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><E7A5AA><EFBFBD><EFBFBD><EFBFBD>
cmp ax,bx ;<3B><><EFBFBD><E0A0A2><EFBFBD><EFBFBD><><E0A5A3><EFBFBD><EFBFBD><EFBFBD>
jg option_box_mouse_end ;<3B><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov eax,dword option_group
mov [eax],edi
option_box_mouse_end:
popa ;<3B><><EFBFBD><EFBFBD><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><><E0A5A3><EFBFBD><EFBFBD><EFBFBD> <20><> <20><EFBFBD>
ret ;<3B><><EFBFBD><EFBFBD><EFBFBD>
}