support system library box_lib.obj

git-svn-id: svn://kolibrios.org@1098 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2009-06-01 18:25:07 +00:00
parent 74eca8d29f
commit 955ef786b3
11 changed files with 1001 additions and 1144 deletions

View File

@ -1,217 +0,0 @@
;<EFBFBD>ä䥪⨢­®¥ ¯à®£à ¬¬¨à®¢ ­¨¥ ¢ KOLIBRI
;Ž¯â¨¬¨§¨à®¢ ­­ë© ª®¬¯®­¥­â CheckBox (ˆá室­ë© ¢ à¨ ­â ®â Maxxxx32)
;Ž¯â¨¬¨§¨à®¢ ­ ¢ë¢®¤ áâப¨ ­ ¤¯¨á¨ ¤«ï CheckBox'a + ⥯¥àì, ¯à¨ ¯à®¢¥àª¥ ­¥ ¯à®¨á室¨â ¯®¤áç¥â ª®«-¢  ᨬ¢®«®¢ ¢ áâப¥
;Ž¯â¨¬¨§ æ¨ï ª®¬ ­¤ - ®âª § «áï ®â á®åà ­¥­¨ï ॣ¨áâ஢ ¢ á⥪¥.
;17.07.2006 ¯à®¨§¢¥¤¥­  ®¯â¨¬¨§ æ¨ï, ¯à¨ ãáâ ­®¢ª¥ 祪 ¡®ªá  ¢ ¯®«®¦¥­¨¥ ¢ª«î祭® ¯®á«¥¤ãî騥 祪 ¡®ªáë ¢ â®â ¦¥ ¯à®¬¥¦ã⮪ ¢à¥¬¥­¨ ­¥ ¯à®¢¥àïîâáï
;<Lrz> - ’¥¯«®¢ €«¥ªá¥© www.test-kolibri.narod.ru
macro use_check_box
{
ch_text_margin=4 ;à ááâ®ï­¨¥ ®â ¯àאַ㣮«ì­¨ª  祪 ¡®ªá  ¤® ­ ¤¯¨á¨
ch_size=10 ;à §¬¥à ª¢ ¤à â  祪 ¡®ªá 
ch_left equ [edi] ;ª®®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® å
ch_top equ [edi+2] ;ª®®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® ã
ch_color equ [edi+4] ;梥⠢­ãâਠcheckbox
ch_border_color equ [edi+8] ;梥â à ¬ª¨ checkbox
ch_text_color equ [edi+12] ;梥â ⥪áâ 
ch_text_ptr equ [edi+16] ;㪠§ â¥«ì ­  ­ ç «® ⥪á⮢®© áâப¨
ch_text_length equ [edi+20] ;¤«¨­  ­ ¤¯¨á¨ (2^64 â ª®© ¤«¨­ë ¬®¦¥â ¡ëâì ⥪áâ)
ch_flags equ [edi+24] ;ä« £¨
check_box:
.draw:
pusha ;á®åà ­¨¬ ¢á¥ ॣ¨áâàë
mov eax,38 ;à¨á®¢ ­¨¥ «¨­¨¨
mov bx,ch_left ;¯®«®¦¥­¨¥ ¯® å
;mov cx,bx ;á®åà ­¨¬ ¢ ॣ¨áâॠcx §­ ç¥­¨¥ bx
push bx ;3 - ¬¨ªà®®¯¥à æ¨¨ ¨á¯®«ì§ãï á⥪ ¬®¦­® ¢ë¨£à âì ¢ à §¬¥à¥, ¨á¯®«ì§ãï ॣ¨áâàë - ¢ ᪮à®áâ¨
shl ebx,16 ;ᤢ¨­¥¬ ­  16 à §à冷¢ ¢ «¥¢® (㬭®¦¨¬ ­  65536)
pop bx ;2 - ¬¨ªà®®¯¥à æ¨¨ ­  ¤ ­­ë© ¬®¬¥­â áä®à¬¨à®¢ ­  [ª®®à¤¨­ â  ­ ç «  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ­ ç «  ¯® ®á¨ x]
;mov bx,cx ;¢®ááâ ­®¢¨¬ §­ ç¥­¨¥ bx
mov cx,ch_top ;§ £à㧨¬ ¢ cx §­ ç¥­¨¥ y
mov si,cx ;á®åà ­¨¬ §­ ç¥­¨¥ ॣ¨áâà  cx ¢ ॣ¨áâà 㪠§ â¥«ì si
;push cx
shl ecx,16 ; ᤢ¨­¥¬ ­  16 à §à冷¢ ¢ «¥¢® (㬭®¦¨¬ ­  65536) mov cx,si ;¢®ááâ ­®¢¨¬ §­ ç¥­¨¥ ॣ¨áâà  cx
mov cx,si ;¢®ááâ ­®¢¨¬ §­ ç¥­¨¥ ॣ¨áâà  cx
;pop cx ;[ª®®à¤¨­ â  ­ ç «  ¯® ®á¨ y]*65536 + [ª®®à¤¨­ â  ­ ç «  ¯® ®á¨ y]
;push cx
add cx,ch_size ;[ª®®à¤¨­ â  ­ ç «  ¯® ®á¨ y]*65536 + [ª®®à¤¨­ â  ª®­æ  ¯® ®á¨ y]
mov edx,ch_border_color ;–¢¥â «¨­¨¨
int 0x40 ;à¨á®¢ ­¨¥ ¢¥à⨪ «ì­®© «¥¢®© «¨­¨¨ ª¢ ¤à â  (¯àאַ㣮«ì­¨ª )
;
mov bp,bx ;á®åà ­¨¬ ॣ¨áâà bx ¢ ॣ¨áâॠ㪠§ â¥«ï ¡ §ë
;push bx ;¢â®«ª­ãâì ¢ bx [ª®®à¤¨­ â  ­ ç «  ¯® ®á¨ å]*65536 + [ª®®à¤¨­ â  ­ ç «  ¯® ®á¨ x]
add bx,ch_size ;[ª®®à¤¨­ â  ­ ç «  + ¤«¨­  áâ®à®­ë ¯® ®á¨ å]
ror ebx,16 ;[ª®®à¤¨­ â  ­ ç «  + ¤¨­  áâ®à®­ë ¯® ®á¨ å]*65536
add bx,ch_size ;[ª®®à¤¨­ â  ­ ç « +¤«¨­  áâ®à®­ë ¯® ®á¨ å]*65536 + [ª®®à¤¨­ â  ­ ç « +¤«¨­  áâ®à®­ë ¯® ®á¨ x]
int 0x40
mov bx,bp ;¢®ááâ ­®¢¨¬ §­ ç¥­¨¥ ॣ¨áâà  bx
;pop bx
mov cx,si ;á®åà ­¨¬ §­ ç¥­¨¥ ॣ¨áâà  cx ¢ ॣ¨áâà 㪠§ â¥«ì
;pop cx
int 0x40
add cx,ch_size ;¤®¡ ¢¨¬ à §¬¥à áâ®à®­ë
mov si,cx ;á®åà ­¨¬ §­ ç¥­¨¥ ॣ¨áâà  cx ¢ ॣ¨áâà 㪠§ â¥«ì si
;push cx
shl ecx,16
mov cx,si
;pop cx
int 0x40 ;­ à¨á®¢ «¨ ¯àאַ㣮«ì­¨ª
mov eax,13 ;§ ªà è¨¢ ¥¬ ¥£®. ”ã­ªæ¨ï 13 - ­ à¨á®¢ âì ¯®«®áã
mov bx,ch_left ;§ £à㧨âì ¢ bx, ¯®«®¦¥­¨¥ ¯® å
add bx,1 ;ᤢ¨­¥¬ ­  1 â.¥. ¯à¨¡ ¢¨¬ 1 ¨­ ç¥ § âà¥âáï à ¬ª 
shl ebx,16 ;ᤢ¨­¥¬ ­  16 à §à冷¢ ¢ «¥¢® (㬭®¦¨¬ ­  65536)
mov bx,ch_size ;¯à¨¡ ¢¨¬ ¤«¨­ã áâ®à®­ë ¯àאַ㣮«ì­¨ª 
sub bx,1 ;¢ëç⥬ 1 â.ª. ¨­ ç¥ § âà¥âáï à ¬ª 
mov bp,bx ; á®åà ­¨¬ ॣ¨áâà bx ¢ ॣ¨áâॠ㪠§ â¥«ï ¡ §ë
;push bx
mov cx,ch_top ;§ £à㧨¬ ª®®à¤¨­ âë ¯® y
add cx,1 ;ᤢ¨­¥¬ ­  1 â.¥. ¯à¨¡ ¢¨¬ 1 ¨­ ç¥ § âà¥âáï à ¬ª 
shl ecx,16 ;ᤢ¨­¥¬ ­  16 à §à冷¢ ¢ «¥¢® (㬭®¦¨¬ ­  65536)
mov cx,bp ;¢®ááâ ­®¢¨¬ §­ ç¥­¨¥ ॣ¨áâà  cx
;pop cx
mov edx,ch_color ;§ £à㧨¬ 梥⠯®«®áë
int 0x40 ;§ ªà á¨«¨
bt dword ch_flags,1 ;¤®áâ âì §­ ç¥­¨¥ ¡¨â  ¨§ ¯¥à¥¬¥­­®© ¨ ¯®¬¥áâ¨âì ¢ ä« £ CF
jnc @f ;¢ ¥á«¨ CF=1, â® ¢ë¯®«­¨¬ á«¥¤ãîéãî ¯à®æ¥¤ãàã ¨­ ç¥ ¯¥à¥©â¨ ­  ­¨¦­îî @@
call .draw_ch ;­ à¨á®¢ âì ¢ª«î祭­ë© 祪 ¡®ªá
@@:
;----------------------------
;à áç¥â ªã¤  ¡ã¤¥â ¯à®¨§¢¥¤¥­ ¢ë¢®¤ ⥪áâ 
;----------------------------
mov bx,ch_left ;§ £à㧨âì §­ ç¥­¨¥ å ¤«ï 祪 ¡®ªá 
add bx,(ch_size+ch_text_margin) ;¤®¡ ¢¨âì à §¬¥à áâ®à®­ë ¨ à ááâ®ï­¨¥ ­  ª®â®à®¬ ­ ç­¥âáï ¢ë¢®¤ ⥪áâ 
shl ebx,16 ;ᤢ¨­¥¬ ­  16 à §à冷¢ ¢ «¥¢® (㬭®¦¨¬ ­  65536)
mov bx,ch_top ;§ £à㧨¬ §­ ç¥­¨¥ ¯® y
add bx,(ch_size-9+2) ;¤®¡ ¢¨¬ §­ ç¥­¨¥ ¤«¨­ë áâ®à®­ë -9+2
mov ecx,ch_text_color ;§ £à㧨¬ 梥⠭ ¤¯¨á¨
mov edx,ch_text_ptr ;㪠¦¥¬  ¤à¥á ®â ªã¤  ­ã¦­® ¢ë¢®¤¨âì áâபã
mov esi,ch_text_length ;‡ £à㧨¬ ¤«¨­ã ­ ¤¯¨á¨ ¢ esi
xor eax,eax ;¢­¥á¥¬ ¢ eax §­ ç¥­¨¥ ¢ë¢®¤  ­ ¤¯¨á¨ ­  ª ­¢ã
add eax,4
int 0x40 ;‚뢮¤
popa ;¢®ááâ ­®¢¨âì §­ ç¥­¨ï ॣ¨áâ஢ ¨§ á⥪ 
ret ;¢ë©¤¥¬ ¨§ ¯à®æ¥¤ãàë
.clear_ch: ;®ç¨á⪠ 祪 ¡®ªá 
mov edx,ch_color ;梥⠢­ãâਠ祪 ¡®ªá 
jmp @f ;¡¥§ãá«®¢­ë© ¯à릮ª ­  ­¨¦­îî ¬¥âªã @@
.draw_ch: ;­ à¨á®¢ âì ¢ª«î祭­ë© 祪 ¡®ªá
mov edx,ch_border_color ;§ £à㧨âì 梥â
@@:
mov bx,ch_left ;§ £à㧨âì ª®®à¤¨­ âã ¯® å
add bx,(ch_size/3) ;¤®¡ ¢¨âì (áâ®à®­  ¯àאַ㣮«ì­¨ª /3)
shl ebx,16 ;ᤢ¨­¥¬ ­  16 à §à冷¢ ¢ «¥¢® (㬭®¦¨¬ ­  65536)
mov bx,(ch_size/2) ;§ £à㧨âì (áâ®à®­  ¯àאַ㣮«ì­¨ª /2)
mov bp,bx ;á®åà ­¨¬ ॣ¨áâà bx ¢ ॣ¨áâॠ㪠§ â¥«ï ¡ §ë
;push bx
mov cx,ch_top ;§ £à㧨âì ª®®à¤¨­ âã ¯® ã
add cx,(ch_size/3) ;¤®¡ ¢¨âì (áâ®à®­  ¯àאַ㣮«ì­¨ª /3)
shl ecx,16 ;ᤢ¨­¥¬ ­  16 à §à冷¢ ¢ «¥¢® (㬭®¦¨¬ ­  65536)
mov cx,bp ;§ £à㧨¬ §­ ç¥­¨ï ॣ¨áâà  ãª § â¥«ï ¡ §ë ¢ cx
;pop cx
mov eax,13 ;¢ eax - §­ ç¥­¨ï ä㭪樨 ¤«ï ¢ë¢®¤  ¯®«®áë â.¥. ¯® áã⨠¯àאַ㣮«ì­¨ª , ª®â®àë© ®â®¡à ¦ ¥â ¢ª«î祭­ë© ª®¬¯®­¥­â 祪 ¡®ªá
int 0x40 ;¢ë¢®¤
ret ;¢ë©â¨ ¨§ ¯à®æ¥¤ãàë
.mouse: ;®¡à ¡®âª  ¬ëè¨
pusha
mov eax,37 ;¡ã¤¥¬ çâ® â® ¤¥« âì ¥á«¨ ã ­ á çâ® - ­¨âì ­ ¦ â®
xor ebx,ebx ;®¡­ã«¨âì ॣ¨áâà ebx (¨§¬¥­ï¥â ä« £¨)
add ebx,2 ;¢­¥á⨠¢ ॣ¨áâà §­ ç¥­¨¥ 2
int 0x40 ;¯à®¢¥àª  ­¥ ­ ¦ « «¨ ¯®«ì§®¢ â¥«ì ª­®¯ªã ¬ë誨
test eax,eax ;¯à®¢¥àª  ¥á«¨ ã ­ á ¢ eax=0, â® ãáâ ­®¢¨¬ ä« £ ¨ ¢ë©¤¥¬
jnz @f ;¯¥à¥©â¨ ­  ­¨¦­îî ¬¥âªã @@
btr dword ch_flags,2 ;¨§¢«¥ç¥­¨¥ §­ ç¥­¨ï § ¤ ­­®£® ¡¨â  ¢ ä« £ cf ¨ ¨§¬¥­¥­¨¥ ¥£® §­ ç¥­¨ï ­  ­ã«¥¢®¥.
popa ;¥á«¨ ­¨ç¥£® ­¥ ¯à®¨§®è«®, â® ¢®ááâ ­®¢¨¬ §­ ç¥­¨ï ॣ¨áâ஢ ¨§ á⥪ 
ret ;¢ë室
@@:
bts dword ch_flags,2 ;¯à®¢¥àª  ä« £  â.¥. ¯¥à¥­®á ¢ cf §­ ç¥­¨¥ ¡¨â  ¨ ãáâ ­®¢ª  ¡¨â  ¢ á®áâ®ï­¨¥ ¢ª«î祭®
jc .mouse_end ;¥á«¨ CF=1 â® ¯¥à¥©â¨ ¢ ª®­¥æ â.¥. íâ® ¢ë室
mov esi,ch_text_length ;§ £à㧨âì ª®«-¢® ᨬ¢®«®¢ ¢ ⥪á⮢®© áâப¥
;“¬­®¦¥­¨¥ ­  6 <EFBFBD>ëáâ஥ 㬭®¦¥­¨¥ ¬®¦­® ¢®á¯®«ì§®¢ âìáï «î¡ë¬ ¬§ ¬¥â®¤®¢, ­® ­  áâ àëå <EFBFBD>à®æ¥áá®à å (386,486,P1)¡ëáâ॥ ¡ã¤¥â á ¨­áâàãªæ¨¥© Lea
;lea esi,[eax*2+eax]
;shl eax,1
imul esi,6 ; ¨«¨ ¬®¦­® ¨ â ª 㬭®¦¨âì ­  6
add esi,ch_text_margin ;¤®¡ ¢¨âì 3 - à ááâ®ï­¨¥ ®â 祪 ¡®ªá  ¤® ­ ¤¯¨á¨
mov eax,37 ;¯®«ã稬 ª®®à¤¨­ âë ¬ë誨
xor ebx,ebx ;®¡­ã«¨âì ॣ¨áâà
add ebx,1 ;¤®¡ ¢¨âì 1
int 0x40 ;¯®«ãç¨âì ª®®à¤¨­ âë ªãàá®à  ®â­®á¨â¥«ì­® ®ª­ 
mov bx,ch_top ;§ £à㧨âì ¢ bx §­ ç¥­¨¥ ª®®à¤¨­ âë ã
cmp ax,bx ;áà ¢­¨âì á á ª®®à¤¨­ â®© ªãàá®à 
jl .mouse_end ;SF <> OF ¥á«¨ ¬¥­ìè¥
add bx,ch_size ;¤®¡ ¢¨âì à §¬¥à
cmp ax,bx ;áà ¢­¨âì
jg .mouse_end ;ZF = 0 ¨ SF = OF ¥á«¨ ¡®«ìè¥
shr eax,16 ;à §¤¥«¨¬ ­  65536 ¨«¨ ¯à®á⮠ᤢ¨­¥¬ ¡¨âë ­  16 §­ ç¥­¨©
mov bx,ch_left ;¯à®¨§¢¥¤¥¬  ­ «®£¨ç­®¥ áà ¢­¥­¨¥
cmp ax,bx ;áà ¢­¨âì ॣ¨áâàë
jl .mouse_end ;¥á«¨ ¬¥­ìè¥
add bx,ch_size ;¤®¡ ¢¨âì ¤«¨­ã áâ®à®­ë ¯àאַ㣮«ì­¨ª 
add bx,si ;“ç¥áâì ¢ §­ ç¥­¨¨ ¯® å ¥é¥ ¨ ¤«¨­ã ­ ¤¯¨á¨ ª 祪¡®ªáã
cmp ax,bx ;áâà ¢­¨âì ॣ¨áâàë
jg .mouse_end ;¥á«¨ ¡®«ìè¥
bts dword ch_flags,1 ;¨§¢«¥ç¥­¨¥ §­ ç¥­¨ï § ¤ ­­®£® ¡¨â  ¢ ä« £ cf ¨ ¨§¬¥­¥­¨¥ ¥£® §­ ç¥­¨ï ­  1.
jc @f ;CF=1 â® ¯¥à¥©â¨ ­  ­¨¦­îî @@
call .draw_ch ;®â®¡à §¨âì ¢ª«î祭­ë© 祪 ¡®ªá
mov dword [esp+24],1 ;¤ «ì­¥©è ï ¯à®¢¥àª  祪 ¡®ªá®¢ ¡¥á¬ëá«¥­ , ¯® í⮬㠢 á⥪, £¤¥ à á¯®« £ ¥âáï ecx ¯®¬¥áâ¨â¬ 0
jmp .mouse_end ;¢ë©â¨
@@:
btr dword ch_flags,1 ;¨§¢«¥ç¥­¨¥ §­ ç¥­¨ï § ¤ ­­®£® ¡¨â  ¢ ä« £ cf ¨ ¨§¬¥­¥­¨¥ ¥£® §­ ç¥­¨ï ­  ­ã«¥¢®¥.
call .clear_ch ;¢ëª«îç¨âì 祪 ¡®ªá â.¥. ­  ¬¥á⥠§ ªà è¥­­®£® ¯àאַ㣮«ì­¨ª  ®â®¡à §¨âì 梥â ä®­ .
.mouse_end:
popa ;¢®ááâ ­®¢¨âì ॣ¨áâàë ¨§ á⥪ 
ret ;¢ë©â¨
}
struc check_box left,top,color,border_color,text_color,text,text_length,flags
{ ;áâàãªâãà  ¯ à ¬¥â஢ ¤«ï 祪 ¡®ªá 
.left: dw left ;+0 ;¯®«®¦¥­¨¥ ¯® å
.top: dw top ;+2 ;¯®«®¦¥­¨¥ ¯® ã
.color: dd color ;+4 ;梥⠢­ãâਠ祪 ¡®ªá 
.border_color: dd border_color ;+8 梥â à ¬ª¨
.text_color: dd text_color ;+12 梥â ⥪áâ  ­ ¤¯¨á¨
.text: dd text ;+16  ¤à¥á ¢ ª®¤¥ ¯à®£à ¬¬ë £¤¥ à á¯®«®¦¥­ ⥪áâà
.text_length: dd text_length ; +20 ¤«¨­  ⥪áâ 
.flags: dd flags+0 ;+24 ä« £¨
}
ch_struc_size=28 ;®¡é ï áâàãªâãà  28 ¡ ©â
macro draw_check_boxes start,end ;à¨á®¢ âì 祪 ¡®ªáë
{
mov edi,start ;“ª § â¥«ì ­  ­ ç «® ¤ ­­ëå 祪 ¡®ªá®¢ â.¥. ­  ­ ç «® ¤ ­­ëå ¯¥à¢®£® 祪¡®ªá 
mov ecx,((end-start)/ch_struc_size) ;Š®«¨ç¥á⢮ 祪 ¡®ªá®¢
@@:
call check_box.draw ;Žâ®¡à §¨âì 祪 ¡®ªá
add edi,ch_struc_size ;“ª § â¥«ì ­  ¯®á«¥¤ãî騥 祪 ¡®ªáë â.¥. +28
loop @b ;¯à룭ãâì ¥á«¨ ¢ ecx/cx §­ ç¥­¨¥ ­¥ 0 ­  ¢¥àå­îî @@
}
macro mouse_check_boxes start,end ;ãáâ ­®¢ª  祪 ¡®ªá®¢, ¢ § ¢¨á¨¬®á⨠®â ᮡëâ¨ï
{
mov edi,start ; “ª § â¥«ì ­  ­ ç «® ¤ ­­ëå 祪 ¡®ªá®¢ â.¥. ­  ­ ç «® ¤ ­­ëå ¯¥à¢®£® 祪¡®ªá 
mov ecx,((end-start)/ch_struc_size) ;Š®«¨ç¥á⢮ 祪 ¡®ªá®¢
@@:
call check_box.mouse ;¯à®¢¥àª  ¬ë誨 ¨ ®¡à ¡®âª  ᮡë⨩
add edi,ch_struc_size ;“ª § â¥«ì ­  ¯®á«¥¤ãî騥 祪 ¡®ªáë
loop @b ;¯à룭ãâì ¥á«¨ ¢ ecx/cx §­ ç¥­¨¥ ­¥ 0 ­  ¢¥àå­îî @@
}
macro check_boxes_set_sys_color start,end,color_table
{
mov edi,start
mov ecx,((end-start)/ch_struc_size)
mov esi,color_table
@@:
push dword [esi+32]
pop dword ch_text_color
push dword [esi+36]
pop dword ch_border_color
add edi,ch_struc_size
loop @b
}

View File

@ -1,41 +0,0 @@
macro file_sys struc_ptr
{
mov eax,58
mov ebx,struc_ptr
int 0x40
}
struc fs_struc function_number,block_number,size,data_ptr,mem_for_sys_ptr
{
.function_number: dd function_number+0 ;+0
.block_number: dd block_number+0 ;+4
.size: dd size+0 ;+8
.data_ptr: dd data_ptr+0 ;+12
.mem_for_sys_ptr: dd mem_for_sys_ptr+0 ;+16
}
fs_struc_size=20
fs_read_file=0
fs_rewrite_file=1
fs_delete_file=2
fs_write_to_file=3
fs_create_dir=4
fs_rename_file=5
fs_lba_read=9
fs_get_file_size=12
fs_get_file_atr=13
fs_get_file_date_time=14
fs_get_fs_info=15
fs_run_app=16
fse_successful=0
fse_not_def_base=1
fse_bad_fs=2
fse_bad_fs=3
fse_part_not_def=4
fse_file_not_found=5
fse_end_of_file=6
fse_bad_ptr=7
fse_disk_filled=8
fse_bad_fat_table=9
fse_acces_denied=10

View File

@ -2,19 +2,19 @@ macro use_label
{ {
draw_label: draw_label:
pusha pusha
xor esi,esi xor esi,esi
mov edx,[edi+8] mov edx,[edi+8]
.check_next: .check_next:
mov ah,[edx+esi] mov ah,[edx+esi]
inc esi inc esi
test ah,ah test ah,ah
jz @f jz @f
jmp .check_next jmp .check_next
@@: @@:
mov eax,4 mov eax,4
mov ebx,[edi] mov ebx,[edi]
mov ecx,[edi+4] mov ecx,[edi+4]
int 0x40 mcall
popa popa
ret ret
} }
@ -24,28 +24,28 @@ struc label left,top,color,text
.top: dw top ; +0 .top: dw top ; +0
.left: dw left ; +2 .left: dw left ; +2
.color: dd color; +4 .color: dd color; +4
.text: dd text ; +8 .text: dd text ; +8
} }
l_struc_size=12 l_struc_size=12
macro draw_labels start,end macro draw_labels start,end
{ {
mov edi,start mov edi,start
mov ecx,((end-start)/l_struc_size) mov ecx,((end-start)/l_struc_size)
@@: @@:
call draw_label call draw_label
add edi,l_struc_size add edi,l_struc_size
loop @r loop @r
} }
macro labels_set_sys_color start,end,color_table macro labels_set_sys_color start,end,color_table
{ {
mov edi,start mov edi,start
mov ecx,((end-start)/l_struc_size) mov ecx,((end-start)/l_struc_size)
mov esi,color_table mov esi,color_table
@@: @@:
push dword [esi+32] push dword [esi+32]
pop dword [edi+4] pop dword [edi+4]
add edi,l_struc_size add edi,l_struc_size
loop @r loop @r
} }

View File

@ -1,399 +0,0 @@
;--- ¤à㣨¥ ¬ ªà®áë ---
include '..\..\develop\examples\editbox\trunk\editbox.inc'
include 'txtbut.inc'
;include 'gp.inc'
include 'label.inc'
;include '..\..\develop\examples\checkbox\trunk\check.inc'
include 'check.inc'
include 'file_sys.inc'
include 'textwork.inc'
;include 'ini.inc'
__CPU_type equ p5
SYSENTER_VAR equ 0
macro movr reg,val
{
if val < 65536
push val
pop reg
else
mov reg,val
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls
local ..ret_point
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
if __CPU_type eq p5
int 0x40
else
if __CPU_type eq p6
push ebp
mov ebp, esp
push ..ret_point ; it may be 2 or 5 byte
sysenter
..ret_point:
pop edx
pop ecx
else
if __CPU_type eq k6
push ecx
syscall
pop ecx
else
display 'ERROR : unknown CPU type'
int 0x40
end if
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
;--- § £®«®¢®ª ---
macro meos_header par_buf,cur_dir_buf
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __app_start
dd __app_end
dd __app_end
dd __app_end
if <par_buf> eq <>
dd 0x0
else
dd par_buf
end if
if <cur_dir_buf> eq <>
dd 0x0
else
dd cur_dir_buf
end if
}
;--- ®¯à¥¤¥«¨âì â®çªã ¢å®¤  ---
macro app_start
{
__app_start:
}
;--- ®¯à¥¤¥«¨âì ª®­¥æ ¯à¨«®¦¥­¨ï ¨ à §¬¥à á⥪  ---
macro app_end stack_size
{
if <stack_size> eq <>
rb 1024
else
rb stack_size
end if
__app_end:
}
;--- § ¢¥àè¨âì ⥪ã騩 ¯®â®ª ---
macro app_close
{
xor eax,eax
dec eax
int 0x40
}
;--- ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª« ¢¨è¨ ---
macro get_key
{
;mov eax,2
push 2
pop eax
int 0x40
}
;--- ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨ ---
macro get_pressed_button
{
;mov eax,17
push 17
pop eax
int 0x40
}
;--- á®®¡é¨âì á¨á⥬¥ ® ­ ç «¥ ¯¥à¥à¨á®¢ª¨ ®ª­  ---
macro start_draw_window
{
;mov eax,12
push 12
pop eax
xor ebx,ebx
inc ebx
int 0x40
}
;--- á®®¡é¨âì á¨á⥬¥ ® § ¢¥à襭¨¨ ¯¥à¥à¨á®¢ª¨ ®ª­  ---
macro stop_draw_window
{
;mov eax,12
push 12
pop eax
;mov ebx,2
push 2
pop ebx
int 0x40
}
;--- ãáâ ­®¢¨âì ¬ áªã ®¦¨¤ ¥¬ëå ᮡë⨩ ---
macro set_events_mask mask
{
;mov eax,40
push 40
pop eax
;mov ebx,mask
push mask
pop ebx
int 0x40
}
;--- ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ¯à®æ¥áᥠ---
macro get_procinfo proc_inf_buf,slot_num
{
;mov eax,9
push 9
pop eax
;mov ebx,proc_inf_buf
push proc_inf_buf
pop ebx
if <slot_num> eq <>
xor ecx,ecx
dec ecx
else
;mov ecx,slot_num
push slot_num
pop ecx
end if
int 0x40
}
macro get_sys_colors col_buf
{
;mov eax,48
push 48
pop eax
;mov ebx,3
push 3
pop ebx
;mov ecx,col_buf
push col_buf
pop ecx
;mov edx,40
push 40
pop edx
int 0x40
}
macro get_grab_area
{
movr eax,48
movr ebx,7
int 0x40
}
macro get_skin_height
{
movr eax,48
movr ebx,4
int 0x40
}
macro min_window
{
movr eax,18
movr ebx,10
int 0x40
}
macro activ_window slot_n
{
movr eax,18
movr ebx,3
if <slot_n> eq <>
else
movr ecx,slot_n
end if
int 0x40
}
macro get_active_window
{
movr eax,18
movr ebx,7
int 0x40
}
macro delay time
{
movr eax,5
if <time> eq <>
else
movr ebx,time
end if
int 0x40
}
;--- ®¦¨¤ âì ᮡëâ¨ï ---
macro wait_event redraw,key,button,mouse,ipc,other
{
movr eax,10
int 0x40
dec ax
if <redraw> eq <>
else
jz redraw
end if
dec ax
if <key> eq <>
else
jz key
end if
dec ax
if <button> eq <>
else
jz button
end if
dec ax
dec ax
dec ax
if <mouse> eq <>
else
jz mouse
end if
if <ipc> eq <>
else
dec ax
jz ipc
end if
if <other> eq <>
jmp still
else
jmp other
end if
}
;--- ¯®«ãç¨âì à §¬¥àë íªà ­  ---
macro get_screen_size
{
movr eax,14
int 0x40
}
macro get_screen_prop struc_ptr
{
movr eax,61
push eax eax
xor ebx,ebx
inc ebx
int 0x40
mov [struc_ptr],eax
pop eax
inc ebx
int 0x40
mov [struc_ptr+4],ax
pop eax
inc ebx
int 0x40
mov [struc_ptr+6],eax
}
macro resize_mem mem_size
{
movr eax,64
xor ebx,ebx
inc ebx
if <mem_size> eq <>
else
movr ecx,mem_size
end if
int 0x40
}
evm_redraw equ 1
evm_key equ 10b
evm_button equ 100b
evm_mouse equ 100000b
evm_ipc equ 1000000b
struc procinfo
{
.takts_per_second: dd ?
.window_stack_pos: dw ?
.slot_number: dw ?
dw ?
.name: rb 11
.align: db ?
.addres: dd ?
.use_mem: dd ?
.pid: dd ?
.left: dd ?
.top: dd ?
.width: dd ?
.height: dd ?
.slot_state: dw ?
rb (1024-56)
}
struc sys_color_table
{
.frames: dd ? ;+0
.grab: dd ? ;+4
.grab_button: dd ? ;+8
.grab_button_text: dd ? ;+12
.grab_text: dd ? ;+16
.work: dd ? ;+20
.work_button: dd ?;+24
.work_button_text: dd ? ;+28
.work_text: dd ? ;+32
.work_graph: dd ? ;+36
}
struc screen_size
{
.height: dw ?
.width: dw ?
}
struc screen_prop
{
.height: dw ? ;+0
.width: dw ? ;+2
.bitspp: dw ? ;+4
.bytesps: dd ?;+6
}
struc ipc_buffer size
{
.block: dd ?
.in_use: dd ?
.messages: rb size
}
;--- æ¢¥â  ---
cl_white=0xffffff
cl_black=0x000000
;==============================================================================
;============== Š®­áâ ­âë =====================================================
;==============================================================================

View File

@ -1,3 +1,7 @@
<Lrz> - ¨á¯®«ì§ãîâáï ª®¬¯®­¥­âë ¨§ á¨á⥬­®© ¡¨¡«¨®â¥ª¨ box_lib.obj.
Ž£à®¬­ ï ¡« £®¤ à­®áâì Mario79, §  ᮢ¥âë, â¥áâ¨à®¢ ­¨¥ ¨ subrutine ¯® á¡à®áã ¨§®¡à ¦¥­¨ï ¢ ¡ãä¥à, ¤«ï ¤ «ì­¥©è¥£® á®åà ­¥­¨ï
­  HDD.
€¢â®à ¤®ªã¬¥­â  ¨ ¯à®£à ¬¬ë: …¢â¨å®¢ Œ ªá¨¬ (Maxxxx32) €¢â®à ¤®ªã¬¥­â  ¨ ¯à®£à ¬¬ë: …¢â¨å®¢ Œ ªá¨¬ (Maxxxx32)
<EFBFBD>« £®¤ à­®áâ¨: <EFBFBD>« £®¤ à­®áâ¨:
Œ à âã ‡ ª¨ï­®¢ã (Mario79) §  ¯®¬®éì, ᮢ¥âë, ªà¨â¨ªã; Œ à âã ‡ ª¨ï­®¢ã (Mario79) §  ¯®¬®éì, ᮢ¥âë, ªà¨â¨ªã;

View File

@ -1,208 +1,203 @@
save_file: save_file:
pusha pusha
bt dword [flags],0 bt dword [flags],0
jnc .not_shooted jnc .not_shooted
cmp byte [ed_buffer.1],0 cmp byte [ed_buffer.1],0
je .no_file_name je .no_file_name
mov edi,sign_n_input mov edi,sign_n_input
call zstr_to_int call zstr_to_int
mov [sign_n],al mov [sign_n],al
; £¥­¥à¨à㥬 ¨¬ï ä ©«  ; £¥­¥à¨à㥬 ¨¬ï ä ©« 
xor eax,eax xor eax,eax
mov ecx,1056 mov ecx,1056
mov edi,file_name mov edi,file_name
rep stosb ; § ¯®«­ï¥¬ ­ã«ï¬¨ rep stosb ; § ¯®«­ï¥¬ ­ã«ï¬¨
mov esi,ed_buffer.1 mov esi,ed_buffer.1
mov edi,file_name mov edi,file_name
.next: .next:
mov ah,[esi] mov ah,[esi]
test ah,ah test ah,ah
jz .str_end jz .str_end
cmp ah,'*' cmp ah,'*'
jne .no_insert_number jne .no_insert_number
jmp .insert_number jmp .insert_number
.no_insert_number: .no_insert_number:
mov [edi],ah mov [edi],ah
inc edi inc edi
inc esi inc esi
jmp .next jmp .next
.insert_number: .insert_number:
bt word [ch6.flags],1 bt word [ch6.flags],1
jnc @f jnc @f
mov eax,[cur_number] mov eax,[cur_number]
;mov ebx,4 ;mov ebx,4
movsx ebx,byte [sign_n] movsx ebx,byte [sign_n]
push ebx push ebx
call int_to_str call int_to_str
pop ebx pop ebx
add edi,ebx add edi,ebx
@@: @@:
inc esi inc esi
jmp .next jmp .next
.str_end: .str_end:
;;;;clean memory
mov ecx,dword [sf_buf.bmp_header]
mov ebx,13
mov eax,68
mcall
; ‚ëç¨á«ï¥¬, ᪮«ìª® ¡ ©â ­ã¦­® ¯à¨¡ ¢«ïâì ª ª ¦¤®© áâப¥, ; ‚ëç¨á«ï¥¬, ᪮«ìª® ¡ ©â ­ã¦­® ¯à¨¡ ¢«ïâì ª ª ¦¤®© áâப¥,
; ç⮡ë á«¥¤ãîé ï ¡ë«  ¢ëà ¢­¥­  ­  4 ¡ ©â . ; ç⮡ë á«¥¤ãîé ï ¡ë«  ¢ëà ¢­¥­  ­  4 ¡ ©â .
; <EFBFBD>¥§ã«ìâ â ¯®¬¥é ¥¬ ¢ edi. ; <EFBFBD>¥§ã«ìâ â ¯®¬¥é ¥¬ ¢ edi.
xor edx,edx
movzx eax,word [scr_buf.width] ; eax = è¨à¨­  ª à⨭ª¨ xor edx,edx
lea eax,[eax*3] ; eax = ¡ ©â ­  áâப㠪 à⨭ª¨ movzx eax,word [scr_buf.width] ; eax = è¨à¨­  ª à⨭ª¨
movr ebx,4 ; ebx = 4 lea eax,[eax*3] ; eax = ¡ ©â ­  áâப㠪 à⨭ª¨
mov edi,ebx ; edi = 4 mov ebx,4 ; ebx = 4
div ebx ; eax = ¡ ©â ­  áâப㠪 à⨭ª¨ div 4 edx = ¡ ©â... mod 4 mov edi,ebx ; edi = 4
sub edi,edx ; edi = ª®«¨ç¥á⢮ ¡ ©â div ebx ; eax = ¡ ©â ­  áâப㠪 à⨭ª¨ div 4 edx = ¡ ©â... mod 4
test edx,edx sub edi,edx ; edi = ª®«¨ç¥á⢮ ¡ ©â
jnz @f test edx,edx
xor edi,edi jnz @f
xor edi,edi
@@: @@:
; ¢ë¤¥«ï¥¬ ¯ ¬ïâì ; ¢ë¤¥«ï¥¬ ¯ ¬ïâì
mov ecx,[scr_buf.end_ptr] ; mov ecx,[scr_buf.end_ptr]
mov [sf_buf.bmp_header],ecx ; mov [sf_buf.bmp_header],ecx
add ecx,0x36
mov [sf_buf.bmp_area],ecx
movsx ebx,word [scr_buf.width]
movsx edx,word [scr_buf.height]
;imul ebx,edx
lea ebx,[ebx*3]
add ebx,edi
imul ebx,edx
add ecx,ebx
mov [sf_buf.end],ecx
add ecx,4096
xor ebx,ebx
inc ebx
movr eax,64
int 0x40
push edi ; add ecx,0x36
; § ¯®«­ï¥¬ áâàãªâãàã ¤«ï á®åà ­¥­¨ï ä ©«  ; mov [sf_buf.bmp_area],ecx
mov edi,fs_struc movsx ebx,word [scr_buf.width]
mov [edi],dword 2 movsx edx,word [scr_buf.height]
mov eax,[sf_buf.bmp_header] ;imul ebx,edx
mov ebx,[sf_buf.end] lea ebx,[ebx*3]
sub ebx,eax add ebx,edi
mov [edi+12],ebx imul ebx,edx
mov [edi+16],eax mov ecx,ebx
mov [edi+21],dword file_name
; § ¯®«­ï¥¬ § £®«®¢®ª bmp ; mov [sf_buf.end],ecx
mov edi,[sf_buf.bmp_header] add ecx,0x36
mov [edi],word 'BM' mov ebx,12
mov ebx,[sf_buf.end] mov eax,68
sub ebx,[sf_buf.bmp_area] mcall
mov [edi+34],ebx ; à §¬¥à ª à⨭ª¨
mov [edi+10],dword 0x36 ; à §¬¥à § £®«®¢ª 
add ebx,0x36
mov [edi+2],ebx ; à §¬¥à ä ©« 
mov [edi+14],dword 0x28
movzx eax,word [scr_buf.width]
mov [edi+18],eax ; £®à¨§®­â «ì­ë© à §¬¥à
movzx eax,word [scr_buf.height]
mov [edi+22],eax ; ¢¥à⨪«ì­ë© à §¬¥à
mov [edi+26],word 1
mov [edi+28],word 24
; ª®¯¨à㥬 ¨ ¯¥à¥¢®à ç¨¢ ¥¬ mov [sf_buf.bmp_header],eax
; mov esi,[scr_buf.ptr] add eax,0x36
; mov edi,[sf_buf.bmp_area] mov [sf_buf.bmp_area],eax
; mov edx,[sf_buf.end] add eax,ecx
; sub edx,edi sub eax,0x36
; movsx ecx,word [scr_buf.height] mov [sf_buf.end],eax
;.next_str:
;push ecx
;
; movsx ecx,word [scr_buf.width]
; lea ecx,[ecx*3]
; mov ebx,ecx
;.next_byte:
; mov ah,[esi+ebx]
; mov [edi+edx],ah
; dec ebx
; dec edx
; loop .next_byte
; movsx ecx,word [scr_buf.width]
; lea ecx,[ecx*3]
; add esi,ecx
;pop ecx
; loop .next_str
mov esi,[scr_buf.end_ptr] ; push edi
mov edi,[sf_buf.bmp_area] ; § ¯®«­ï¥¬ áâàãªâãàã ¤«ï á®åà ­¥­¨ï ä ©« 
movzx ecx,word [scr_buf.height] mov ebp,fs_struc
movzx ebx,word [scr_buf.width] mov [ebp],dword 2
lea ebx,[ebx*3]
add edi,ebx mov eax,[sf_buf.bmp_header]
mov ebx,[sf_buf.end]
sub ebx,eax
mov [ebp+12],ebx
mov [ebp+16],eax
mov [ebp+21],dword file_name
; § ¯®«­ï¥¬ § £®«®¢®ª bmp
mov ebp,[sf_buf.bmp_header]
mov [ebp],word 'BM'
mov ebx,[sf_buf.end]
sub ebx,[sf_buf.bmp_area]
mov [ebp+34],ebx ; à §¬¥à ª à⨭ª¨
mov [ebp+10],dword 0x36 ; à §¬¥à § £®«®¢ª 
add ebx,0x36
mov [ebp+2],ebx ; à §¬¥à ä ©« 
mov [ebp+14],dword 0x28
movzx eax,word [scr_buf.width]
mov [ebp+18],eax ; £®à¨§®­â «ì­ë© à §¬¥à
movzx eax,word [scr_buf.height]
mov [ebp+22],eax ; ¢¥à⨪«ì­ë© à §¬¥à
mov [ebp+26],word 1
mov [ebp+28],word 24
; á®å࠭塞
mov esi,[scr_buf.ptr]
mov edi,[sf_buf.end]
movzx edx,word [scr_buf.height]
movzx ebx,word [scr_buf.width]
lea ebx,[ebx*3]
test ebx,11b
jz @f
shr ebx,2
inc ebx
shl ebx,2
@@:
cld
align 4
.next_str: .next_str:
mov edx,ebx sub edi,ebx
.next_pixel: mov ecx,ebx
mov ah,[esi] shr ecx,2
mov [edi],ah rep movsd
dec esi sub edi,ebx
dec edi dec edx
dec edx jnz .next_str
jnz .next_pixel
lea edi,[2*ebx+edi]
add edi,[esp]
loop .next_str
pop edi draw_status saving
mov eax,70
mov ebx,fs_struc
mcall
; á®å࠭塞 test eax,eax
draw_status saving jne save_error
mov eax,70
mov ebx,fs_struc
int 0x40
test eax,eax inc dword [cur_number]
jne save_error call draw_number
inc dword [cur_number] draw_status saved_ok
call draw_number
draw_status saved_ok
popa popa
ret ret
.no_file_name: .no_file_name:
draw_status no_file_name draw_status no_file_name
popa popa
ret ret
.not_shooted: .not_shooted:
draw_status not_shooted draw_status not_shooted
popa popa
ret ret
save_error: save_error:
cmp al,5 cmp al,5
jne @f jne @f
mov [status.text],dword bad_file_name mov [status.text],dword bad_file_name
@@: @@:
cmp al,8 cmp al,8
jne @f jne @f
mov [status.text],dword disk_filled mov [status.text],dword disk_filled
@@: @@:
cmp al,9 cmp al,9
jne @f jne @f
mov [status.text],dword bad_fat_table mov [status.text],dword bad_fat_table
@@: @@:
cmp al,10 cmp al,10
jne @f jne @f
mov [status.text],dword ac_den mov [status.text],dword ac_den
@@: @@:
cmp al,11 cmp al,11
jne @f jne @f
mov [status.text],dword device_er mov [status.text],dword device_er
@@: @@:
call send_draw_status call send_draw_status
popa popa
ret ret

View File

@ -1,29 +1,60 @@
; 01.06.09 - Š®¬¯®­¥­âë ¡¥àãâìáï ¨§ á¨á⥬­®© ¡¨¡«¨®â¥ª¨ <Lrz>
; €¢â®à ¯à®£à ¬¬ë …¢â¨å®¢ Œ ªá¨¬ (Maxxxx32) ; €¢â®à ¯à®£à ¬¬ë …¢â¨å®¢ Œ ªá¨¬ (Maxxxx32)
; 24.07.2008 <Lrz> ®¡­®¢«¥­ editbox ; 24.07.2008 <Lrz> ®¡­®¢«¥­ editbox
; 01.02.07 - ®¡­®¢«ñ­ editbox ; 01.02.07 - ®¡­®¢«ñ­ editbox
; 31.01.07 - ¢áñ ⥯¥àì à¨áã¥âáï ®â­®á¨â¥«ì­® ª«¨¥­â᪮© ®¡« á⨠; 31.01.07 - ¢áñ ⥯¥àì à¨áã¥âáï ®â­®á¨â¥«ì­® ª«¨¥­â᪮© ®¡« áâ¨
macro draw_status text_ptr
{
mov [status.text],dword text_ptr
call send_draw_status
}
title equ 'Screenshooter v 0.91' ; ‡ £®«®¢®ª ®ª­ 
include '../../develop/libraries/box_lib/trunk/load_lib.mac'
include '../../develop/libraries/box_lib/trunk/editbox_ex.mac'
;include '../../develop/examples/editbox/trunk/editbox.inc'
include '../../macros.inc'
include 'scrshoot.mac'
include 'txtbut.inc'
include 'label.inc'
include 'textwork.inc'
title equ 'Screenshooter v 0.9' ; ‡ £®«®¢®ª ®ª­  ;include 'macros.inc' ; ¢áâ ¢«ï¥¬ ¬ ªà®áë
include 'macros.inc' ; ¢áâ ¢«ï¥¬ ¬ ªà®áë ; meos_header cmdstr ; ¢áâ ¢«ï¥¬ § £®«®¢®ª ¯à®£à ¬¬ë
meos_header cmdstr ; ¢áâ ¢«ï¥¬ § £®«®¢®ª ¯à®£à ¬¬ë use32
org 0x0
db 'MENUET01'
dd 0x1
dd start
dd i_end
dd i_end
dd i_end
dd cmdstr
dd cur_dir_path
align 4
include 'scrwin.inc' ; ¢áâ ¢«ï¥¬ ª®¤ ®ª­  ¯à¤¯à®á¬®âà  include 'scrwin.inc' ; ¢áâ ¢«ï¥¬ ª®¤ ®ª­  ¯à¤¯à®á¬®âà 
include 'scrsavef.inc'; ¢áâ ¢«ï¥¬ ¯à®æ¥¤ãàã á®åà ­¥­¨ï ä ©«  include 'scrsavef.inc'; ¢áâ ¢«ï¥¬ ¯à®æ¥¤ãàã á®åà ­¥­¨ï ä ©« 
use_edit_box ; \
@use_library
use_txt_button ; | use_txt_button ; |
use_label ; |-- GUI ª®¬¯®­¥­âë ¨ ­¥ª®â®àë¥ ¯à®æ¥¤ãàë use_label ; |-- GUI ª®¬¯®­¥­âë ¨ ­¥ª®â®àë¥ ¯à®æ¥¤ãàë
use_check_box ; |
use_text_work ; / use_text_work ; /
include 'gp.inc' include 'gp.inc'
include 'srectwin.inc' include 'srectwin.inc'
include 'lang.inc' include 'lang.inc'
;--- ­ ç «® ¯à®£à ¬¬ë --- ;--- ­ ç «® ¯à®£à ¬¬ë ---
app_start align 4
start:
sys_load_library library_name, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i
;if return code =-1 then exit, else nornary work
; cmp eax,-1
inc eax
test eax,eax
jz close
;;;;;;;;;;;;;;;; init memory 68/11
mov eax,68
mov ebx,11
mcall
test eax,eax
jz close
;mov al,[gs:1280*4*1024] ;mov al,[gs:1280*4*1024]
; ãáâ ­ ¢«¨¢ ¥¬ ipc ¡ãää¥à ; ãáâ ­ ¢«¨¢ ¥¬ ipc ¡ãää¥à
push 60 push 60
@ -33,7 +64,7 @@ include 'lang.inc'
inc ebx inc ebx
mov ecx,app_ipc mov ecx,app_ipc
mov edx,32 mov edx,32
int 0x40 mcall
push 66 ; ãáâ ­ ¢«¨¢ ¥¬ £«®¡ «ì­ãî £®àïçãî ª« ¢¨èã push 66 ; ãáâ ­ ¢«¨¢ ¥¬ £«®¡ «ì­ãî £®àïçãî ª« ¢¨èã
pop eax pop eax
@ -41,7 +72,7 @@ include 'lang.inc'
mov ebx,4 mov ebx,4
mov cl,55 ; 55 - PrintScrn mov cl,55 ; 55 - PrintScrn
xor edx,edx xor edx,edx
int 0x40 mcall
mov ebx,app mov ebx,app
call get_slot_n call get_slot_n
@ -75,7 +106,19 @@ key:
call shoot call shoot
jmp still jmp still
@@: @@:
key_edit_boxes editboxes,editboxes_end ; key_edit_boxes editboxes,editboxes_end
push dword edit1
call [edit_box_key]
push dword edit2
call [edit_box_key]
push dword edit3
call [edit_box_key]
push dword edit4
call [edit_box_key]
jmp still jmp still
button: button:
get_pressed_button get_pressed_button
@ -87,8 +130,33 @@ mouse:
get_active_window get_active_window
cmp eax,[slot_n] cmp eax,[slot_n]
jne still jne still
mouse_check_boxes check_boxes,check_boxes_end ;----------------------------------
mouse_edit_boxes editboxes,editboxes_end push dword edit1
call [edit_box_mouse]
push dword edit2
call [edit_box_mouse]
push dword edit3
call [edit_box_mouse]
push dword edit4
call [edit_box_mouse]
;----------------------------------
push dword ch1
call [check_box_mouse]
push dword ch2
call [check_box_mouse]
push dword ch3
call [check_box_mouse]
push dword ch4
call [check_box_mouse]
push dword ch5
call [check_box_mouse]
push dword ch6
call [check_box_mouse]
push dword use_rect
call [check_box_mouse]
;-----------------------------------
; mouse_check_boxes check_boxes,check_boxes_end
; mouse_edit_boxes editboxes,editboxes_end
jmp still jmp still
ipc: ipc:
cmp word [app_ipc+8],2 cmp word [app_ipc+8],2
@ -103,7 +171,7 @@ ipc:
.clear_ipc: .clear_ipc:
cld cld
xor eax,eax xor eax,eax
movr ecx,32 mov ecx,32
mov edi,app_ipc mov edi,app_ipc
rep stosb rep stosb
jmp still jmp still
@ -113,10 +181,10 @@ p_close:
bt dword [flags],3 bt dword [flags],3
jnc @f jnc @f
movr eax,18 mov eax,18
mov ebx,eax mov ebx,eax
mov ecx,[set_rect_window_pid] mov ecx,[set_rect_window_pid]
int 0x40 mcall
@@: @@:
close: close:
@ -133,14 +201,14 @@ start_draw_window ;
mov ecx,100*65536+220 mov ecx,100*65536+220
add cx,ax add cx,ax
mov edx,[sc.work] mov edx,[sc.work]
add edx,0x34000000;0x33000000 or edx,0x34000000;0x33000000
xor esi,esi xor esi,esi
;xor edi,edi ;xor edi,edi
mov edi,grab_text mov edi,grab_text
xor eax,eax xor eax,eax
int 0x40 mcall
movr eax,47 ; ¢ë¢®¤¨¬ ç¨á«  ¢ ®ª­® mov eax,47 ; ¢ë¢®¤¨¬ ç¨á«  ¢ ®ª­®
mov bx,4 mov bx,4
shl ebx,16 shl ebx,16
movsx ecx,word [scr.width] ; è¨à¨­  íªà ­  movsx ecx,word [scr.width] ; è¨à¨­  íªà ­ 
@ -149,30 +217,58 @@ start_draw_window ;
mov dx,[label1.top] mov dx,[label1.top]
push dx push dx
mov esi,[sc.work_text] mov esi,[sc.work_text]
int 0x40 mcall
movsx ecx,word [scr.height] ; ¢ëá®â  íªà ­  movsx ecx,word [scr.height] ; ¢ëá®â  íªà ­ 
mov dx,[label2.top] mov dx,[label2.top]
int 0x40 mcall
mov bx,2 mov bx,2
shl ebx,16 shl ebx,16
movsx ecx,word [scr.bitspp] ; ¡¨â ­  ¯¨ªá¥«ì movsx ecx,word [scr.bitspp] ; ¡¨â ­  ¯¨ªá¥«ì
mov dx,240 mov dx,240
shl edx,16 shl edx,16
pop dx pop dx
int 0x40 mcall
mov bx,6 mov bx,6
shl ebx,16 shl ebx,16
mov ecx,[scr.bytesps] ; ¡ ©â ­  áâபã mov ecx,[scr.bytesps] ; ¡ ©â ­  áâபã
mov dx,[label2.top] mov dx,[label2.top]
int 0x40 mcall
call draw_number ; ¯à®à¨á®¢ë¢ ¥¬ ­®¬¥à á­¨¬ª  call draw_number ; ¯à®à¨á®¢ë¢ ¥¬ ­®¬¥à á­¨¬ª 
call dr_st call dr_st
draw_labels labels,labels_end ; ¬¥âª¨ draw_labels labels,labels_end ; ¬¥âª¨
draw_edit_boxes editboxes,editboxes_end ; edit_box ; draw_edit_boxes editboxes,editboxes_end ; edit_box
;------ show check editbox -----------
push dword edit1
call [edit_box_draw]
push dword edit2
call [edit_box_draw]
push dword edit3
call [edit_box_draw]
push dword edit4
call [edit_box_draw]
;------ end check all editbox -------
draw_txt_buttons buttons,buttons_end ; ª­®¯ª¨ draw_txt_buttons buttons,buttons_end ; ª­®¯ª¨
draw_check_boxes check_boxes,check_boxes_end ; ä« ¦ª¨ ; draw_check_boxes check_boxes,check_boxes_end ; ä« ¦ª¨
;------ check all checkbox ---------
push dword ch1
call [check_box_draw]
push dword ch2
call [check_box_draw]
push dword ch3
call [check_box_draw]
push dword ch4
call [check_box_draw]
push dword ch5
call [check_box_draw]
push dword ch6
call [check_box_draw]
push dword use_rect
call [check_box_draw]
;------ end check all checkbox ------
stop_draw_window ; ª®­¥æ ¯¥à¥à¨á®¢ª¨ stop_draw_window ; ª®­¥æ ¯¥à¥à¨á®¢ª¨
ret ret
@ -231,7 +327,12 @@ ret
;--- ¯®«ãç¨âì ¯ ¬ïâì ¤«ï á­¨¬ª  --- ;--- ¯®«ãç¨âì ¯ ¬ïâì ¤«ï á­¨¬ª  ---
get_mem_for_shoot: get_mem_for_shoot:
mov [scr_buf.ptr],dword __app_end ;clean memory
mov ecx,dword [scr_buf.ptr]
mov ebx,13
mov eax,68
mcall
bt dword [use_rect.flags],1 ; ä®âª âì ®¡« áâì íªà ­  bt dword [use_rect.flags],1 ; ä®âª âì ®¡« áâì íªà ­ 
jc .use_area jc .use_area
movzx ecx, word [scr.width] movzx ecx, word [scr.width]
@ -244,12 +345,13 @@ get_mem_for_shoot:
@@: @@:
imul ecx,ebx imul ecx,ebx
lea ecx,[ecx*3] lea ecx,[ecx*3]
add ecx,__app_end ; add ecx,i_end
mov ebx,12
mov eax,68
mcall
mov [scr_buf.ptr],eax
add eax,ecx
mov [scr_buf.end_ptr],ecx mov [scr_buf.end_ptr],ecx
xor ebx,ebx
inc ebx
mov eax,64
int 0x40
ret ret
;--- ᮤ âì ®ª­® ¯à®¥¤¯à®á¬®âà  --- ;--- ᮤ âì ®ª­® ¯à®¥¤¯à®á¬®âà  ---
@ -260,9 +362,9 @@ pusha
mov eax,51 mov eax,51
xor ebx,ebx xor ebx,ebx
inc ebx inc ebx
movr ecx,scr_window mov ecx,scr_window
mov edx,__app_end-1000 mov edx,i_end_tread-1000
int 0x40 mcall
@@: @@:
popa popa
ret ret
@ -280,14 +382,14 @@ draw_number:
mov edi,sign_n_input mov edi,sign_n_input
call zstr_to_int call zstr_to_int
mov [sign_n],al mov [sign_n],al
movr eax,13 mov eax,13
mov ebx,150*65536+96 mov ebx,150*65536+96
mov cx,[label9.top] mov cx,[label9.top]
shl ecx,16 shl ecx,16
mov cx,10 mov cx,10
mov edx,[sc.work] mov edx,[sc.work]
int 0x40 mcall
movr eax,47 mov eax,47
movsx bx,byte [sign_n] movsx bx,byte [sign_n]
shl ebx,16 shl ebx,16
mov ecx,[cur_number] mov ecx,[cur_number]
@ -295,20 +397,20 @@ draw_number:
shl edx,16 shl edx,16
mov dx,[label9.top] mov dx,[label9.top]
mov esi,[sc.work_text] mov esi,[sc.work_text]
int 0x40 mcall
ret ret
;--- ¯à®æ¥¤ãà , § ¯ã᪠îé ï ¯®â®ª  ¢â®áꥬª¨ --- ;--- ¯à®æ¥¤ãà , § ¯ã᪠îé ï ¯®â®ª  ¢â®áꥬª¨ ---
start_autoshoot: start_autoshoot:
bts dword [flags],1 bts dword [flags],1
jc @f jc @f
movr eax,51 mov eax,51
;mov ebx,1 ;mov ebx,1
xor ebx,ebx xor ebx,ebx
inc ebx inc ebx
mov ecx,autoshoot mov ecx,autoshoot
mov edx,__app_end-512 mov edx,i_end_tread-512
int 0x40 mcall
@@: @@:
ret ret
@ -324,29 +426,29 @@ autoshoot:
.next: .next:
bt dword [flags],1 bt dword [flags],1
jnc close jnc close
movr eax,60 mov eax,60
movr ebx,2 mov ebx,2
mov ecx,[app.pid] mov ecx,[app.pid]
mov edx,messages.draw_number mov edx,messages.draw_number
mov esi,2 mov esi,2
int 0x40 mcall
call shoot call shoot
jmp autoshoot.next jmp autoshoot.next
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ áâப¨ á®áâ®ï­¨ï --- ;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ áâப¨ á®áâ®ï­¨ï ---
; (¤®«¦­  ¢ë§ë¢ âìáï ¯®â®ª®¬ £« ¢­®£® ®ª­ ) ; (¤®«¦­  ¢ë§ë¢ âìáï ¯®â®ª®¬ £« ¢­®£® ®ª­ )
dr_st: dr_st:
movr eax,38 ; ®â१®ª mov eax,38 ; ®â१®ª
mov ebx,0*65536+310 mov ebx,0*65536+310
mov ecx,198*65536+198 mov ecx,198*65536+198
mov edx,[sc.work_graph] mov edx,[sc.work_graph]
int 0x40 mcall
movr eax,13 ; ¯®«®áª  mov eax,13 ; ¯®«®áª 
mov bx,310 mov bx,310
mov ecx,199*65536+15 mov ecx,199*65536+15
mov edx,[sc.work] mov edx,[sc.work]
int 0x40 mcall
mov edi,status mov edi,status
call draw_label call draw_label
@ -356,17 +458,17 @@ ret
; ¢å®¤ ebx - ¡ãää¥à 1024 ¡ ©â ; ¢å®¤ ebx - ¡ãää¥à 1024 ¡ ©â
; ¢ë室 ecx - ­®¬¥à á«®â  ; ¢ë室 ecx - ­®¬¥à á«®â 
get_slot_n: get_slot_n:
movr eax,9 mov eax,9
xor ecx,ecx xor ecx,ecx
dec ecx dec ecx
int 0x40 mcall
mov edx,[ebx+30] mov edx,[ebx+30]
xor ecx,ecx xor ecx,ecx
@@: @@:
movr eax,9 mov eax,9
inc ecx inc ecx
int 0x40 mcall
cmp [ebx+30],edx cmp [ebx+30],edx
je @f je @f
jmp @b jmp @b
@ -388,11 +490,11 @@ save_shoot:
bt dword [flags],1 bt dword [flags],1
jc .running jc .running
movr eax,51 mov eax,51
;mov ebx,1 ;mov ebx,1
xor ebx,ebx xor ebx,ebx
inc ebx inc ebx
int 0x40 mcall
.running: .running:
ret ret
@ -402,12 +504,12 @@ one_shoot_thread:
activ_window activ_window
bt dword [ch1.flags],1 ; ¬¨­¨¬¨§¨à®¢ âì ®ª­® ? bt dword [ch1.flags],1 ; ¬¨­¨¬¨§¨à®¢ âì ®ª­® ?
jnc @f jnc @f
movr eax,60 mov eax,60
movr ebx,2 mov ebx,2
mov ecx,[app.pid] mov ecx,[app.pid]
mov edx,messages.min_window mov edx,messages.min_window
mov esi,2 mov esi,2
int 0x40 mcall
@@: @@:
call shoot call shoot
btr dword [flags],2 btr dword [flags],2
@ -416,12 +518,12 @@ one_shoot_thread:
;--- ¯à®æ¥¤ãà , ®â¯à ¢«ïîé ï £« ¢­®¬ã ®ª­ã á®®¡é¥­¨¥ ® ¯¥à¥à¨á®¢ª¥ ;--- ¯à®æ¥¤ãà , ®â¯à ¢«ïîé ï £« ¢­®¬ã ®ª­ã á®®¡é¥­¨¥ ® ¯¥à¥à¨á®¢ª¥
; áâப¨ á®áâ®ï­¨ï --- ; áâப¨ á®áâ®ï­¨ï ---
send_draw_status: send_draw_status:
movr eax,60 mov eax,60
movr ebx,2 mov ebx,2
mov ecx,[app.pid] mov ecx,[app.pid]
mov edx,messages.draw_status mov edx,messages.draw_status
mov esi,2 mov esi,2
int 0x40 mcall
ret ret
;--- ¯®â®ª, á®åà ­ï ä ©« --- ;--- ¯®â®ª, á®åà ­ï ä ©« ---
@ -436,34 +538,34 @@ save_shoot_thread:
show_set_rect_window: show_set_rect_window:
bts dword [flags],3 bts dword [flags],3
jc @f jc @f
movr eax,51 mov eax,51
xor ebx,ebx xor ebx,ebx
inc ebx inc ebx
mov ecx,set_rect_window mov ecx,set_rect_window
mov edx,set_rect_window_esp mov edx,set_rect_window_esp
int 0x40 mcall
mov [set_rect_window_pid],eax mov [set_rect_window_pid],eax
ret ret
@@: @@:
movr eax,18 mov eax,18
mov ebx,eax mov ebx,eax
mov ecx,[set_rect_window_pid] mov ecx,[set_rect_window_pid]
int 0x40 mcall
btr dword [flags],3 btr dword [flags],3
ret ret
;--- ¯®«ã祭¨¥ ¨­ä®à¬ æ¨¨ ®¡  ªâ¨¢­®¬ ®ª­¥ --- ;--- ¯®«ã祭¨¥ ¨­ä®à¬ æ¨¨ ®¡  ªâ¨¢­®¬ ®ª­¥ ---
get_active_window_info: get_active_window_info:
movr eax,18 mov eax,18
movr ebx,7 mov ebx,7
int 0x40 mcall
mov ecx,eax mov ecx,eax
movr eax,9 mov eax,9
mov ebx,active_app mov ebx,active_app
int 0x40 mcall
ret ret
;==================================================================== ;====================================================================
@ -493,30 +595,30 @@ status label 5,201,0,no_shoot
labels_end: labels_end:
editboxes: editboxes:
edit1 edit_box 300,5,35,cl_white,0xaabbcc,0,0,0,1024,ed_buffer.1,ed_focus ; ¯ãâì ª ä ©«ã edit1 edit_box 300,5,35,cl_white,0xaabbcc,0,0,0,300,ed_buffer.1,ed_focus,10,10 ; ¯ãâì ª ä ©«ã
edit2 edit_box 35,75,134,cl_white,0xaabbcc,0,0,0,9,ed_buffer.2,ed_figure_only ; § ¤¥à¦ª  edit2 edit_box 35,75,134,cl_white,0xaabbcc,0,0,0,9,ed_buffer.2,ed_figure_only,3,3 ; § ¤¥à¦ª 
edit3 edit_box 35,165,164,cl_white,0xaabbcc,0,0,0,9,ed_buffer.3,ed_figure_only edit3 edit_box 35,165,164,cl_white,0xaabbcc,0,0,0,9,ed_buffer.3,ed_figure_only ;  ¢â®­ã¬¥à æ¨ï
edit4 edit_box 16,165,181,cl_white,0xaabbcc,0,0,0,1,sign_n_input,ed_figure_only,1 edit4 edit_box 16,165,181,cl_white,0xaabbcc,0,0,0,1,sign_n_input,ed_figure_only,1
editboxes_end: editboxes_end:
buttons: buttons:
but1 txt_button 150,5,15,65,2,0,0,but_text.1,one_shoot ; ᤥ« âì á­¨¬®ª but1 txt_button 150,5,15,65,2,0,0,but_text.1,one_shoot ; ᤥ« âì á­¨¬®ª
but2 txt_button 145,160,15,65,3,0,0,but_text.2,save_shoot ; á®åà ­¨âì á­¨¬®ª but2 txt_button 145,160,15,65,3,0,0,but_text.2,save_shoot ; á®åà ­¨âì á­¨¬®ª
but3 txt_button 140,115,12,120,4,0,0,but_text.3,show_scr_window ; ¯®ª § âì á­¨¬®ª but3 txt_button 140,115,12,120,4,0,0,but_text.3,show_scr_window ; ¯®ª § âì á­¨¬®ª
but4 txt_button 80,205,15,163,5,0,0,but_text.4,apply_number ; ¯à¨¬¥­¨âì ­®¬¥à but4 txt_button 80,205,15,163,5,0,0,but_text.4,apply_number ; ¯à¨¬¥­¨âì ­®¬¥à
but5 txt_button 150,5,15,85,6,0,0,but_text.5,start_autoshoot ; ­ ç âì  ¢â®áêñ¬ªã but5 txt_button 150,5,15,85,6,0,0,but_text.5,start_autoshoot ; ­ ç âì  ¢â®áêñ¬ªã
but6 txt_button 145,160,15,85,7,0,0,but_text.6,stop_autoshoot ; ®áâ ­®¢¨âì  ¢â®áêñ¬ªã but6 txt_button 145,160,15,85,7,0,0,but_text.6,stop_autoshoot ; ®áâ ­®¢¨âì  ¢â®áêñ¬ªã
but7 txt_button 40,205,10,150,8,0,0,but_text.7,show_set_rect_window ; § ¤ âì ®¡« áâì but7 txt_button 40,205,10,150,8,0,0,but_text.7,show_set_rect_window ; § ¤ âì ®¡« áâì
buttons_end: buttons_end:
check_boxes: check_boxes:
ch1 check_box 5,105,cl_white,0,0,ch_text.1,(ch_text.2-ch_text.1) ; ᢥà­ãâì ®ª­® ch1 check_box 5,105,5,11,cl_white,0,0,ch_text.1,(ch_text.2-ch_text.1),ch_flag_en ; ᢥà­ãâì ®ª­®
ch2 check_box 5,120,cl_white,0,0,ch_text.2,(ch_text.3-ch_text.2) ; § â¥¬ ᤥ« âì  ªâ¨¢­ë¬ ch2 check_box 5,120,5,11,cl_white,0,0,ch_text.2,(ch_text.3-ch_text.2),ch_flag_en ; § â¥¬ ᤥ« âì  ªâ¨¢­ë¬
ch3 check_box 145,105,cl_white,0,0,ch_text.3,(ch_text.4-ch_text.3) ; ¯®ª § âì á­¨¬®ª ch3 check_box 145,105,5,11,cl_white,0,0,ch_text.3,(ch_text.4-ch_text.3),ch_flag_en ; ¯®ª § âì á­¨¬®ª
ch4 check_box 5,135,cl_white,0,0,ch_text.4,(ch_text.5-ch_text.4) ; ch4 check_box 5,135,5,11,cl_white,0,0,ch_text.4,(ch_text.5-ch_text.4),ch_flag_en ; § ¤¥à¦ª 
ch5 check_box 5,150,cl_white,0,0,ch_text.5,(ch_text.6-ch_text.5) ch5 check_box 5,150,5,11,cl_white,0,0,ch_text.5,(ch_text.6-ch_text.5)
ch6 check_box 5,165,cl_white,0,0,ch_text.6,(ch_text.7-ch_text.6) ch6 check_box 5,165,5,11,cl_white,0,0,ch_text.6,(ch_text.7-ch_text.6),ch_flag_en
use_rect check_box 145,150,cl_white,0,0,ch_text.7,(ch_text.8-ch_text.7) ; ¨á¯. ®¡« áâì use_rect check_box 145,150,5,11,cl_white,0,0,ch_text.7,(ch_text.8-ch_text.7) ; ¨á¯. ®¡« áâì
;  ¢â®­ã¬¥à æ¨ï ;  ¢â®­ã¬¥à æ¨ï
check_boxes_end: check_boxes_end:
@ -610,7 +712,7 @@ disk_filled db 'Disk is full',0
bad_fat_table db 'FAT table destroyed',0 bad_fat_table db 'FAT table destroyed',0
ac_den db 'Access denied',0 ac_den db 'Access denied',0
device_er db 'Device error',0 device_er db 'Device error',0
not_shooted db 'Make photo !!!',0 not_shooted db 'Make a photo !!!',0
no_file_name db 'Enter file name !!!',0 no_file_name db 'Enter file name !!!',0
invalid_rect db 'Wrong area size',0 invalid_rect db 'Wrong area size',0
@ -620,11 +722,14 @@ sign_n_input:
db '2',0 db '2',0
app_ipc ipc_buffer 32 app_ipc ipc_buffer 32
align 4
mouse_flag: dd 0x0 mouse_flag: dd 0x0
structure_of_potock: structure_of_potock:
rb 100 rb 100
align 4
cur_number dd ? cur_number dd ?
sign_n db ? sign_n db ?
@ -656,6 +761,17 @@ sf_buf:
set_rect_window_pid dd ? set_rect_window_pid dd ?
set_rect_window_slot dd ? set_rect_window_slot dd ?
align 4
ed_buffer:
.1: db '/sys/*.bmp',0
rb 287
.2: db '100',0
rb 6
.3: rb 10
align 4
rect_input_buffer: rect_input_buffer:
.left rb 6 .left rb 6
.top rb 6 .top rb 6
@ -664,10 +780,7 @@ rect_input_buffer:
cmdstr rb 257 cmdstr rb 257
ed_buffer: align 4
.1: rb 1025
.2: rb 10
.3: rb 10
file_name: file_name:
rb 1058 rb 1058
@ -679,11 +792,17 @@ rect:
.height dw ? .height dw ?
.width dw ? .width dw ?
sc sys_color_table sc sys_color_table
app procinfo ; ¨­ä®à¬ æ¨ï ® £« ¢­®¬ ®ª­¥ app procinfo ; ¨­ä®à¬ æ¨ï ® £« ¢­®¬ ®ª­¥
active_app procinfo ; ¨­ä®à¬ æ¨ï ®¡  ªâ¨¢­®¬ ®ª­¥ active_app procinfo ; ¨­ä®à¬ æ¨ï ®¡  ªâ¨¢­®¬ ®ª­¥
set_rect_window_procinfo procinfo ; ¨­ä®à¬ æ¨ï ®¡ ®ª­¥ ®¡« á⨠set_rect_window_procinfo procinfo ; ¨­ä®à¬ æ¨ï ®¡ ®ª­¥ ®¡« áâ¨
shoot_esp rb 512 ; á⥪ ¯®â®ª  ä®âª ­ìï shoot_esp rb 512 ; á⥪ ¯®â®ª  ä®âª ­ìï
set_rect_window_esp rb 512 ; á⥪ ®ª­  ®¡« á⨠set_rect_window_esp rb 512 ; á⥪ ®ª­  ®¡« áâ¨
app_end ; ª®­¥æ ¯à®£à ¬¬ë ; app_end ; ª®­¥æ ¯à®£à ¬¬ë
align 4
cur_dir_path rb 4096
library_path rb 4096
i_end_tread:
rb 1024
align 4
i_end:

View File

@ -0,0 +1,312 @@
;In this file content a macros need for compilation the scrshoot
evm_redraw equ 1
evm_key equ 10b
evm_button equ 100b
evm_mouse equ 100000b
evm_ipc equ 1000000b
;--- ñîîáùèòü ñèñòåìå î íà÷àëå ïåðåðèñîâêè îêíà ---
macro draw_status text_ptr
{
mov [status.text],dword text_ptr
call send_draw_status
}
macro start_draw_window
{
;mov eax,12
push 12
pop eax
xor ebx,ebx
inc ebx
mcall
}
;--- ñîîáùèòü ñèñòåìå î çàâåðøåíèè ïåðåðèñîâêè îêíà ---
macro stop_draw_window
{
;mov eax,12
push 12
pop eax
;mov ebx,2
push 2
pop ebx
mcall
}
;--- óñòàíîâèòü ìàñêó îæèäàåìûõ ñîáûòèé ---
;--- îæèäàòü ñîáûòèÿ ---
macro wait_event redraw,key,button,mouse,ipc,other
{
mov eax,10
mcall
dec ax
if <redraw> eq <>
else
jz redraw
end if
dec ax
if <key> eq <>
else
jz key
end if
dec ax
if <button> eq <>
else
jz button
end if
dec ax
dec ax
dec ax
if <mouse> eq <>
else
jz mouse
end if
if <ipc> eq <>
else
dec ax
jz ipc
end if
if <other> eq <>
jmp still
else
jmp other
end if
}
;--- óñòàíîâèòü ìàñêó îæèäàåìûõ ñîáûòèé ---
macro set_events_mask mask
{
;mov eax,40
push 40
pop eax
;mov ebx,mask
push mask
pop ebx
mcall
}
macro check_boxes_set_sys_color start,end,color_table
{
ch_left equ [edi] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî õ
ch_top equ [edi+2] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî ó
ch_text_margin equ [edi+4] ;=4 ðàññòîÿíèå îò ïðÿìîóãîëüíèêà ÷åê áîêñà äî íàäïèñè
ch_size equ [edi+8] ;12 ðàçìåð êâàäðàòà ÷åê áîêñà
ch_color equ [edi+12] ;öâåò âíóòðè checkbox
ch_border_color equ [edi+16] ; or [edi+4] ;öâåò ðàìêè checkbox åå ìîæíî çàäàòü ñàìîñòîÿòåëüíî
ch_text_color equ [edi+20];[edi+4] ;öâåò òåêñòà
ch_text_ptr equ [edi+24] ;óêàçàòåëü íà íà÷àëî òåêñòîâîé ñòðîêè
ch_text_length equ [edi+28]
ch_flags equ [edi+32] ;ôëàãè
;ch_left equ [edi] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî õ
;ch_top equ [edi+2] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî ó
;ch_color equ [edi+4] ;öâåò âíóòðè checkbox
;ch_border_color equ [edi+8] ;öâåò ðàìêè checkbox
;ch_text_color equ [edi+12] ;öâåò òåêñòà
;ch_text_ptr equ [edi+16] ;óêàçàòåëü íà íà÷àëî òåêñòîâîé ñòðîêè
;ch_text_length equ [edi+20] ;äëèíà íàäïèñè (2^64 òàêîé äëèíû ìîæåò áûòü òåêñò)
;ch_flags equ [edi+24] ;ôëàãè
mov edi,start
mov ecx,((end-start)/ch_struc_size)
mov esi,color_table
@@:
push dword [esi+32]
pop dword ch_text_color
push dword [esi+36]
pop dword ch_border_color
add edi,ch_struc_size
loop @b
}
macro get_key
{
;mov eax,2
push 2
pop eax
mcall
}
macro edit_boxes_set_sys_color start,end,color_table
{
ed_focus_border_color equ [edi+20] ;öâåò ðàìêè êîìïîíåíòà
ed_blur_border_color equ [edi+24] ;öâåò íå àêòèâíîãî êîìïîíåíòà
mov edi,start
mov ecx,((end-start)/ed_struc_size)
mov esi,color_table
@@:
mov eax,[esi+36]
mov ebx,[esi+20]
mov dword ed_focus_border_color,eax
shr bh,1
shr bl,1
shr ah,1
shr al,1
add ah,bh
add al,bl
ror eax,16
ror ebx,16
shr bl,1
shr al,1
add al,bl
ror eax,16
mov dword ed_blur_border_color,eax
add edi,ed_struc_size
loop @b
}
;--- ïîëó÷èòü êîä íàæàòîé êíîïêè ---
macro get_pressed_button
{
;mov eax,17
push 17
pop eax
mcall
}
macro get_active_window
{
mov eax,18
mov ebx,7
mcall
}
;--- ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ¯à®æ¥áᥠ---
macro get_procinfo proc_inf_buf,slot_num
{
;mov eax,9
push 9
pop eax
;mov ebx,proc_inf_buf
push proc_inf_buf
pop ebx
if <slot_num> eq <>
xor ecx,ecx
dec ecx
else
;mov ecx,slot_num
push slot_num
pop ecx
end if
mcall
}
macro get_sys_colors col_buf
{
;mov eax,48
push 48
pop eax
;mov ebx,3
push 3
pop ebx
;mov ecx,col_buf
push col_buf
pop ecx
;mov edx,40
push 40
pop edx
mcall
}
macro get_screen_prop struc_ptr
{
mov eax,61
push eax eax
xor ebx,ebx
inc ebx
mcall
mov [struc_ptr],eax
pop eax
inc ebx
mcall
mov [struc_ptr+4],ax
pop eax
inc ebx
mcall
mov [struc_ptr+6],eax
}
macro min_window
{
mov eax,18
mov ebx,10
mcall
}
macro app_close
{
or eax,-1
mcall
}
macro get_skin_height
{
mov eax,48
mov ebx,4
mcall
}
macro delay time
{
mov eax,5
if <time> eq <>
else
mov ebx,time
end if
mcall
}
macro activ_window slot_n
{
mov eax,18
mov ebx,3
if <slot_n> eq <>
else
mov ecx,slot_n
end if
mcall
}
struc screen_prop
{
.height: dw ? ;+0
.width: dw ? ;+2
.bitspp: dw ? ;+4
.bytesps: dd ?;+6
}
struc sys_color_table
{
.frames: dd ? ;+0
.grab: dd ? ;+4
.grab_button: dd ? ;+8
.grab_button_text: dd ? ;+12
.grab_text: dd ? ;+16
.work: dd ? ;+20
.work_button: dd ?;+24
.work_button_text: dd ? ;+28
.work_text: dd ? ;+32
.work_graph: dd ? ;+36
}
struc procinfo
{
.takts_per_second: dd ?
.window_stack_pos: dw ?
.slot_number: dw ?
dw ?
.name: rb 11
.align: db ?
.addres: dd ?
.use_mem: dd ?
.pid: dd ?
.left: dd ?
.top: dd ?
.width: dd ?
.height: dd ?
.slot_state: dw ?
rb (1024-56)
}
struc ipc_buffer size
{
.block: dd ?
.in_use: dd ?
.messages: rb size
}
;--- æ¢¥â  ---
cl_white=0xffffff
cl_black=0x000000
ch_struc_size=36

View File

@ -4,38 +4,39 @@
scr_window: scr_window:
.start: .start:
.red: .red:
call .draw_window call .draw_window
.still: .still:
wait_event .red,close wait_event .red,close
jmp .still jmp .still
.draw_window: .draw_window:
start_draw_window start_draw_window
xor eax,eax xor eax,eax
movsx ebx,word [scr.width] movsx ebx,word [scr.width]
movsx ecx,word [scr.height] movsx ecx,word [scr.height]
;xor edx,edx ;xor edx,edx
mov edx,0x01000000 mov edx,0x01000000
xor esi,esi xor esi,esi
xor edi,edi xor edi,edi
int 0x40 mcall
movr eax,7 mov eax,7
mov ebx,[scr_buf.ptr] mov ebx,dword [scr_buf.ptr]
mov ecx,[scr_buf.size] mov ecx,dword [scr_buf.size]
xor edx,edx xor edx,edx
int 0x40 mcall
movr eax,13 mov eax,13
mov ebx,19*65536+231 mov ebx,19*65536+231
mov ecx,19*65536+10 mov ecx,19*65536+10
mov edx,0x00FF00 mov edx,0x00FF00
int 0x40 mcall
mov edi,.label mov edi,.label
call draw_label call draw_label
stop_draw_window stop_draw_window
ret ret
.label label 20,20,0x80000000,$+4 .label label 20,20,0x80000000,$+4
db '<27>â® ¢ è á­¨¬®ª. ‚ë室 - «î¡ ï ª« ¢¨è .',0 db '<27>â® ¢ è á­¨¬®ª. ‚ë室 - «î¡ ï ª« ¢¨è .',0

View File

@ -1,190 +1,273 @@
set_rect_window: set_rect_window:
mov ebx,set_rect_window_procinfo mov ebx,set_rect_window_procinfo
call get_slot_n call get_slot_n
mov [set_rect_window_slot],ecx mov [set_rect_window_slot],ecx
set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse) set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse)
.red: .red:
edit_boxes_set_sys_color rect_input,rect_input_end,sc edit_boxes_set_sys_color rect_input,rect_input_end,sc
labels_set_sys_color rect_input_labels,rect_input_labels_end,sc labels_set_sys_color rect_input_labels,rect_input_labels_end,sc
check_boxes_set_sys_color riw_check_boxes,riw_check_boxes_end,sc check_boxes_set_sys_color riw_check_boxes,riw_check_boxes_end,sc
call .draw_window call .draw_window
.still: .still:
wait_event .red,.key,.button,.mouse wait_event .red,.key,.button,.mouse
.key: .key:
get_key get_key
key_edit_boxes rect_input,rect_input_end push dword rect_input.left
call [edit_box_key]
call read_rect push dword rect_input.top
call draw_rect_on_screen call [edit_box_key]
jmp .still push dword rect_input.width
call [edit_box_key]
push dword rect_input.height
call [edit_box_key]
; key_edit_boxes rect_input,rect_input_end
call read_rect
call draw_rect_on_screen
jmp .still
.button: .button:
get_pressed_button get_pressed_button
cmp ah,1 cmp ah,1
jne @f jne @f
btr dword [flags],3 btr dword [flags],3
jmp close jmp close
@@: @@:
jmp .still jmp .still
.mouse: .mouse:
get_active_window get_active_window
cmp eax,[set_rect_window_slot] cmp eax,[set_rect_window_slot]
jne .still jne .still
mouse_edit_boxes rect_input,rect_input_end push dword rect_input.left
mouse_check_boxes riw_check_boxes,riw_check_boxes_end call [edit_box_mouse]
jmp .still push dword rect_input.top
call [edit_box_mouse]
push dword rect_input.width
call [edit_box_mouse]
push dword rect_input.height
call [edit_box_mouse]
;;;;;;;;;;;;;;;;;;;;;;
push dword use_rect_active_window
call [check_box_mouse]
; mouse_edit_boxes rect_input,rect_input_end
; mouse_check_boxes riw_check_boxes,riw_check_boxes_end
jmp .still
.draw_window: .draw_window:
start_draw_window start_draw_window
xor eax,eax xor eax,eax
mov ebx,100*65536+250 mov ebx,100*65536+250
mov ecx,100*65536+130 mov ecx,100*65536+130
mov edx,[sc.work] mov edx,[sc.work]
add edx,0x33000000 add edx,0x33000000
mov edi,riw_grab_text mov edi,riw_grab_text
xor esi,esi xor esi,esi
int 0x40 mcall
draw_labels rect_input_labels,rect_input_labels_end draw_labels rect_input_labels,rect_input_labels_end
draw_edit_boxes rect_input,rect_input_end push dword rect_input.left
call [edit_box_draw]
draw_check_boxes riw_check_boxes,riw_check_boxes_end push dword rect_input.top
call [edit_box_draw]
call read_rect push dword rect_input.width
call draw_rect_on_screen call [edit_box_draw]
stop_draw_window push dword rect_input.height
call [edit_box_draw]
;;;;;;;;;;;;;;;;;;;;;;
push dword use_rect_active_window
call [check_box_draw]
; draw_edit_boxes rect_input,rect_input_end
; draw_check_boxes riw_check_boxes,riw_check_boxes_end
call read_rect
call draw_rect_on_screen
stop_draw_window
ret ret
;-------------------------------------------------------------------- ;--------------------------------------------------------------------
;--- <EFBFBD>腮硅<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> ---------------------------------------------- ;--- <EFBFBD>腮硅<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> ----------------------------------------------
;-------------------------------------------------------------------- ;--------------------------------------------------------------------
read_rect: read_rect:
bt dword [use_rect_active_window.flags],1 bt dword [use_rect_active_window.flags],1
jc read_rect_from_active_window jc read_rect_from_active_window
mov edi,rect_input_buffer.left mov edi,rect_input_buffer.left
call zstr_to_int call zstr_to_int
cmp ax,[scr.width] cmp ax,[scr.width]
jb @f jb @f
mov ax,[scr.width] mov ax,[scr.width]
@@: @@:
mov [rect.left],ax mov [rect.left],ax
mov edi,rect_input_buffer.top mov edi,rect_input_buffer.top
call zstr_to_int call zstr_to_int
cmp ax,[scr.height] cmp ax,[scr.height]
jb @f jb @f
mov ax,[scr.height] mov ax,[scr.height]
@@: @@:
mov [rect.top],ax mov [rect.top],ax
mov edi,rect_input_buffer.width mov edi,rect_input_buffer.width
call zstr_to_int call zstr_to_int
mov bx,[scr.width] mov bx,[scr.width]
sub bx,[rect.left] sub bx,[rect.left]
cmp ax,bx cmp ax,bx
jb @f jb @f
mov ax,bx mov ax,bx
@@: @@:
mov [rect.width],ax mov [rect.width],ax
mov edi,rect_input_buffer.height mov edi,rect_input_buffer.height
call zstr_to_int call zstr_to_int
mov bx,[scr.height] mov bx,[scr.height]
sub bx,[rect.top] sub bx,[rect.top]
cmp ax,bx cmp ax,bx
jb @f jb @f
mov ax,bx mov ax,bx
@@: @@:
mov [rect.height],ax mov [rect.height],ax
ret ret
read_rect_from_active_window: read_rect_from_active_window:
call get_active_window_info call get_active_window_info
mov eax,[active_app.left] mov eax,[active_app.left]
mov [rect.left],ax mov [rect.left],ax
mov eax,[active_app.top] mov eax,[active_app.top]
mov [rect.top],ax mov [rect.top],ax
mov eax,[active_app.width] mov eax,[active_app.width]
inc eax inc eax
mov [rect.width],ax mov [rect.width],ax
mov eax,[active_app.height] mov eax,[active_app.height]
inc eax inc eax
mov [rect.height],ax mov [rect.height],ax
ret ret
draw_rect_on_screen: draw_rect_on_screen:
mov eax,13 mov eax,13
mov ebx,150*65536+80 mov ebx,150*65536+80
mov ecx,5*65536+60 mov ecx,5*65536+60
xor edx,edx xor edx,edx
int 0x40 mcall
;movzx eax,word [rect.left] ;movzx eax,word [rect.left]
;mul word [scr.width] ;mul word [scr.width]
xor edx,edx xor edx,edx
movzx eax,word [scr.width] movzx eax,word [scr.width]
mov ebx,80 mov ebx,80
div ebx div ebx
mov ebx,eax mov ebx,eax
xor edx,edx xor edx,edx
movzx eax,word [rect.height] movzx eax,word [rect.height]
div ebx div ebx
push ax push ax
xor edx,edx xor edx,edx
movzx eax,word [rect.width] movzx eax,word [rect.width]
div ebx div ebx
push ax push ax
xor edx,edx xor edx,edx
movzx eax,word [rect.top] movzx eax,word [rect.top]
div ebx div ebx
push ax push ax
xor edx,edx xor edx,edx
movzx eax,word [rect.left] movzx eax,word [rect.left]
div ebx div ebx
push ax push ax
pop bx pop bx
add bx,150 add bx,150
shl ebx,16 shl ebx,16
pop cx pop cx
add cx,5 add cx,5
shl ecx,16 shl ecx,16
pop bx pop bx
pop cx pop cx
mov edx,0xffffff mov edx,0xffffff
mov eax,13 mov eax,13
int 0x40 mcall
ret ret
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;DATA ¤ ­­ë¥
;‚ᥣ¤  ᮡ«î¤ âì ¯®á«¥¤®¢ â¥«ì­®áâì ¢ ¨¬¥­¨.
system_path db '/sys/lib/'
library_name db 'box_lib.obj',0
err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0
head_f_i:
head_f_l db 'System error',0
err_message_import db 'Error on load import library box_lib.obj',0
myimport:
edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key
edit_box_mouse dd aEdit_box_mouse
version_ed dd aVersion_ed
check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse
version_ch dd aVersion_ch
option_box_draw dd aOption_box_draw
option_box_mouse dd aOption_box_mouse
version_op dd aVersion_op
dd 0
dd 0
aEdit_box_draw db 'edit_box',0
aEdit_box_key db 'edit_box_key',0
aEdit_box_mouse db 'edit_box_mouse',0
aVersion_ed db 'version_ed',0
aCheck_box_draw db 'check_box_draw',0
aCheck_box_mouse db 'check_box_mouse',0
aVersion_ch db 'version_ch',0
aOption_box_draw db 'option_box_draw',0
aOption_box_mouse db 'option_box_mouse',0
aVersion_op db 'version_op',0
rect_input: rect_input:
.left edit_box 35,95,5,cl_white,0,0,0,5,rect_input_buffer.left,\ .left edit_box 35,95,5,cl_white,0,0,0,5,rect_input_buffer.left,\
ed_figure_only+ed_focus ed_figure_only+ed_focus
.top edit_box 35,95,25,cl_white,0,0,0,5,rect_input_buffer.top,\ .top edit_box 35,95,25,cl_white,0,0,0,5,rect_input_buffer.top,\
ed_figure_only ed_figure_only
.width edit_box 35,95,45,cl_white,0,0,0,5,rect_input_buffer.width,\ .width edit_box 35,95,45,cl_white,0,0,0,5,rect_input_buffer.width,\
ed_figure_only ed_figure_only
.height edit_box 35,95,65,cl_white,0,0,0,5,rect_input_buffer.height,\ .height edit_box 35,95,65,cl_white,0,0,0,5,rect_input_buffer.height,\
ed_figure_only ed_figure_only
@ -200,11 +283,11 @@ rect_input_labels_end:
rect_input_labels_text: rect_input_labels_text:
.left db '<27>痰祚 甄ア<E79484>:',0 .left db '<27>痰祚 甄ア<E79484>:',0
.top db '<27>痰祚 瓣ム繝:',0 .top db '<27>痰祚 瓣ム繝:',0
.width db '˜¨à¨­ :',0 .width db '˜¨à¨­ :',0
.height db '<27><EFBFBD><E8ABB1>:',0 .height db '<27><EFBFBD><E8ABB1>:',0
riw_check_boxes: riw_check_boxes:
use_rect_active_window check_box 10,85,cl_white,0,0,\ use_rect_active_window check_box 10,85,5,11,cl_white,0,0,\
riw_check_boxes_text.1,\ riw_check_boxes_text.1,\
riw_check_boxes_text.2-riw_check_boxes_text.1 riw_check_boxes_text.2-riw_check_boxes_text.1
riw_check_boxes_end: riw_check_boxes_end:

View File

@ -7,45 +7,45 @@ txt_button:
.draw: .draw:
pusha pusha
;--- ¯à®à¨á®¢ª  á ¬®© ª­®¯ª¨ --- ;--- ¯à®à¨á®¢ª  á ¬®© ª­®¯ª¨ ---
mov eax,8 mov eax,8
mov ebx,[edi] ; [but.width] mov ebx,[edi] ; [but.width]
mov ecx,[edi+4] ;[but.height] mov ecx,[edi+4] ;[but.height]
mov edx,[edi+8];[but.id] mov edx,[edi+8];[but.id]
mov esi,[edi+12];[but.color] mov esi,[edi+12];[but.color]
int 0x40 mcall
;--- ⥪áâ ­  ­¥© --- ;--- ⥪áâ ­  ­¥© ---
; áç¨â ¥¬ ª®«¨ç¥á⢮ ᨬ¢®«®¢ ; áç¨â ¥¬ ª®«¨ç¥á⢮ ᨬ¢®«®¢
mov edx,[edi+20] mov edx,[edi+20]
xor esi,esi xor esi,esi
.check_next_symbol: .check_next_symbol:
cmp [edx+esi],byte 0 cmp [edx+esi],byte 0
je .str_end je .str_end
inc esi ; ¢ esi ¤«¨­  áâப¨ ¢ ᨬ¢®« å inc esi ; ¢ esi ¤«¨­  áâப¨ ¢ ᨬ¢®« å
jmp .check_next_symbol jmp .check_next_symbol
.str_end: .str_end:
; ¢ëç¨á«ï¥¬ ª®®à¤¨­ âë ; ¢ëç¨á«ï¥¬ ª®®à¤¨­ âë
lea ebx,[esi*2+esi] lea ebx,[esi*2+esi]
lea ebx,[ebx*2] ; ¢ ebx ¤«¨­  áâப¨ ¢ ¯¨ªá¥«ïå lea ebx,[ebx*2] ; ¢ ebx ¤«¨­  áâப¨ ¢ ¯¨ªá¥«ïå
;not ebx ;not ebx
neg ebx neg ebx
add bx,[edi] ; [but.width] add bx,[edi] ; [but.width]
sar bx,1 sar bx,1
inc bx inc bx
add bx,[edi+2];[but.left] ; ¢ bx ¯®§¨æ¨ï á«¥¢  add bx,[edi+2];[but.left] ; ¢ bx ¯®§¨æ¨ï á«¥¢ 
shl ebx,16 shl ebx,16
mov bx,[edi+4];[but.height] mov bx,[edi+4];[but.height]
sub bx,8 sub bx,8
sar bx,1 sar bx,1
add bx,[edi+6];[but.top] ; ¢ bx ¯®§¨æ¨ï ᢥàåã add bx,[edi+6];[but.top] ; ¢ bx ¯®§¨æ¨ï ᢥàåã
; à¨á㥬 áâபã ⥪áâ  ; à¨á㥬 áâபã ⥪áâ 
mov ecx,[edi+16] ;[but.text_color] mov ecx,[edi+16] ;[but.text_color]
shr eax,1 shr eax,1
int 0x40 mcall
popa popa
ret ret
} }
@ -54,53 +54,53 @@ struc txt_button width,left,height,top,id,color,text_color,text_ptr,\
proc_addres proc_addres
{ {
.width dw width ;+0 .width dw width ;+0
.left dw left ;+2 .left dw left ;+2
.height dw height ;+4 .height dw height ;+4
.top dw top ;+6 .top dw top ;+6
.id dd id ;+8 .id dd id ;+8
.color dd color ;+12 .color dd color ;+12
.text_color dd text_color ;+16 .text_color dd text_color ;+16
.text_ptr dd text_ptr ;+20 .text_ptr dd text_ptr ;+20
.proc_addres dd proc_addres+0 ;+24 .proc_addres dd proc_addres+0 ;+24
} }
but_struc_size=24+4 but_struc_size=24+4
macro draw_txt_buttons start,end macro draw_txt_buttons start,end
{ {
mov edi,start mov edi,start
mov ecx,((end-start)/but_struc_size) mov ecx,((end-start)/but_struc_size)
@@: @@:
call txt_button.draw call txt_button.draw
add edi,but_struc_size add edi,but_struc_size
loop @b loop @b
} }
macro txt_but_set_sys_color start,end,color_table macro txt_but_set_sys_color start,end,color_table
{ {
mov edi,start mov edi,start
mov esi,color_table mov esi,color_table
mov ecx,((end-start)/but_struc_size) mov ecx,((end-start)/but_struc_size)
@@: @@:
push dword [esi+24] push dword [esi+24]
pop dword [edi+12] pop dword [edi+12]
push dword [esi+28] push dword [esi+28]
pop dword [edi+16] pop dword [edi+16]
add edi,but_struc_size add edi,but_struc_size
loop @b loop @b
} }
macro txt_but_ev start,end macro txt_but_ev start,end
{ {
mov edi,start mov edi,start
mov ecx,((end-start)/but_struc_size) mov ecx,((end-start)/but_struc_size)
.txt_but_next: .txt_but_next:
cmp ah,[edi+8] cmp ah,[edi+8]
jne @f jne @f
cmp dword [edi+24],0 cmp dword [edi+24],0
je @f je @f
pusha pusha
call dword [edi+24] call dword [edi+24]
popa popa
@@: @@:
add edi,but_struc_size add edi,but_struc_size
loop .txt_but_next loop .txt_but_next
} }