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

@ -14,7 +14,7 @@ pusha
mov eax,4
mov ebx,[edi]
mov ecx,[edi+4]
int 0x40
mcall
popa
ret
}

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)
<EFBFBD>« £®¤ à­®áâ¨:
Œ à âã ‡ ª¨ï­®¢ã (Mario79) §  ¯®¬®éì, ᮢ¥âë, ªà¨â¨ªã;

View File

@ -45,13 +45,21 @@ pusha
jmp .next
.str_end:
;;;;clean memory
mov ecx,dword [sf_buf.bmp_header]
mov ebx,13
mov eax,68
mcall
; ‚ëç¨á«ï¥¬, ᪮«ìª® ¡ ©â ­ã¦­® ¯à¨¡ ¢«ïâì ª ª ¦¤®© áâப¥,
; ç⮡ë á«¥¤ãîé ï ¡ë«  ¢ëà ¢­¥­  ­  4 ¡ ©â .
; <EFBFBD>¥§ã«ìâ â ¯®¬¥é ¥¬ ¢ edi.
xor edx,edx
movzx eax,word [scr_buf.width] ; eax = è¨à¨­  ª à⨭ª¨
lea eax,[eax*3] ; eax = ¡ ©â ­  áâப㠪 à⨭ª¨
movr ebx,4 ; ebx = 4
mov ebx,4 ; ebx = 4
mov edi,ebx ; edi = 4
div ebx ; eax = ¡ ©â ­  áâப㠪 à⨭ª¨ div 4 edx = ¡ ©â... mod 4
sub edi,edx ; edi = ª®«¨ç¥á⢮ ¡ ©â
@ -61,102 +69,89 @@ pusha
@@:
; ¢ë¤¥«ï¥¬ ¯ ¬ïâì
mov ecx,[scr_buf.end_ptr]
mov [sf_buf.bmp_header],ecx
add ecx,0x36
mov [sf_buf.bmp_area],ecx
; mov ecx,[scr_buf.end_ptr]
; 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
mov ecx,ebx
push edi
; mov [sf_buf.end],ecx
add ecx,0x36
mov ebx,12
mov eax,68
mcall
mov [sf_buf.bmp_header],eax
add eax,0x36
mov [sf_buf.bmp_area],eax
add eax,ecx
sub eax,0x36
mov [sf_buf.end],eax
; push edi
; § ¯®«­ï¥¬ áâàãªâãàã ¤«ï á®åà ­¥­¨ï ä ©« 
mov edi,fs_struc
mov [edi],dword 2
mov ebp,fs_struc
mov [ebp],dword 2
mov eax,[sf_buf.bmp_header]
mov ebx,[sf_buf.end]
sub ebx,eax
mov [edi+12],ebx
mov [edi+16],eax
mov [edi+21],dword file_name
mov [ebp+12],ebx
mov [ebp+16],eax
mov [ebp+21],dword file_name
; § ¯®«­ï¥¬ § £®«®¢®ª bmp
mov edi,[sf_buf.bmp_header]
mov [edi],word 'BM'
mov ebp,[sf_buf.bmp_header]
mov [ebp],word 'BM'
mov ebx,[sf_buf.end]
sub ebx,[sf_buf.bmp_area]
mov [edi+34],ebx ; à §¬¥à ª à⨭ª¨
mov [edi+10],dword 0x36 ; à §¬¥à § £®«®¢ª 
mov [ebp+34],ebx ; à §¬¥à ª à⨭ª¨
mov [ebp+10],dword 0x36 ; à §¬¥à § £®«®¢ª 
add ebx,0x36
mov [edi+2],ebx ; à §¬¥à ä ©« 
mov [edi+14],dword 0x28
mov [ebp+2],ebx ; à §¬¥à ä ©« 
mov [ebp+14],dword 0x28
movzx eax,word [scr_buf.width]
mov [edi+18],eax ; £®à¨§®­â «ì­ë© à §¬¥à
mov [ebp+18],eax ; £®à¨§®­â «ì­ë© à §¬¥à
movzx eax,word [scr_buf.height]
mov [edi+22],eax ; ¢¥à⨪«ì­ë© à §¬¥à
mov [edi+26],word 1
mov [edi+28],word 24
; ª®¯¨à㥬 ¨ ¯¥à¥¢®à ç¨¢ ¥¬
; mov esi,[scr_buf.ptr]
; mov edi,[sf_buf.bmp_area]
; mov edx,[sf_buf.end]
; sub edx,edi
; movsx ecx,word [scr_buf.height]
;.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]
mov edi,[sf_buf.bmp_area]
movzx ecx,word [scr_buf.height]
movzx ebx,word [scr_buf.width]
lea ebx,[ebx*3]
add edi,ebx
.next_str:
mov edx,ebx
.next_pixel:
mov ah,[esi]
mov [edi],ah
dec esi
dec edi
dec edx
jnz .next_pixel
lea edi,[2*ebx+edi]
add edi,[esp]
loop .next_str
pop edi
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:
sub edi,ebx
mov ecx,ebx
shr ecx,2
rep movsd
sub edi,ebx
dec edx
jnz .next_str
draw_status saving
mov eax,70
mov ebx,fs_struc
int 0x40
mcall
test eax,eax
jne save_error

View File

@ -1,29 +1,60 @@
; 01.06.09 - Š®¬¯®­¥­âë ¡¥àãâìáï ¨§ á¨á⥬­®© ¡¨¡«¨®â¥ª¨ <Lrz>
; €¢â®à ¯à®£à ¬¬ë …¢â¨å®¢ Œ ªá¨¬ (Maxxxx32)
; 24.07.2008 <Lrz> ®¡­®¢«¥­ editbox
; 01.02.07 - ®¡­®¢«ñ­ editbox
; 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' ; ¢áâ ¢«ï¥¬ ¬ ªà®áë
meos_header cmdstr ; ¢áâ ¢«ï¥¬ § £®«®¢®ª ¯à®£à ¬¬ë
;include 'macros.inc' ; ¢áâ ¢«ï¥¬ ¬ ªà®áë
; 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 'scrsavef.inc'; ¢áâ ¢«ï¥¬ ¯à®æ¥¤ãàã á®åà ­¥­¨ï ä ©« 
use_edit_box ; \
@use_library
use_txt_button ; |
use_label ; |-- GUI ª®¬¯®­¥­âë ¨ ­¥ª®â®àë¥ ¯à®æ¥¤ãàë
use_check_box ; |
use_text_work ; /
include 'gp.inc'
include 'srectwin.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]
; ãáâ ­ ¢«¨¢ ¥¬ ipc ¡ãää¥à
push 60
@ -33,7 +64,7 @@ include 'lang.inc'
inc ebx
mov ecx,app_ipc
mov edx,32
int 0x40
mcall
push 66 ; ãáâ ­ ¢«¨¢ ¥¬ £«®¡ «ì­ãî £®àïçãî ª« ¢¨èã
pop eax
@ -41,7 +72,7 @@ include 'lang.inc'
mov ebx,4
mov cl,55 ; 55 - PrintScrn
xor edx,edx
int 0x40
mcall
mov ebx,app
call get_slot_n
@ -75,7 +106,19 @@ key:
call shoot
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
button:
get_pressed_button
@ -87,8 +130,33 @@ mouse:
get_active_window
cmp eax,[slot_n]
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
ipc:
cmp word [app_ipc+8],2
@ -103,7 +171,7 @@ ipc:
.clear_ipc:
cld
xor eax,eax
movr ecx,32
mov ecx,32
mov edi,app_ipc
rep stosb
jmp still
@ -113,10 +181,10 @@ p_close:
bt dword [flags],3
jnc @f
movr eax,18
mov eax,18
mov ebx,eax
mov ecx,[set_rect_window_pid]
int 0x40
mcall
@@:
close:
@ -133,14 +201,14 @@ start_draw_window ;
mov ecx,100*65536+220
add cx,ax
mov edx,[sc.work]
add edx,0x34000000;0x33000000
or edx,0x34000000;0x33000000
xor esi,esi
;xor edi,edi
mov edi,grab_text
xor eax,eax
int 0x40
mcall
movr eax,47 ; ¢ë¢®¤¨¬ ç¨á«  ¢ ®ª­®
mov eax,47 ; ¢ë¢®¤¨¬ ç¨á«  ¢ ®ª­®
mov bx,4
shl ebx,16
movsx ecx,word [scr.width] ; è¨à¨­  íªà ­ 
@ -149,30 +217,58 @@ start_draw_window ;
mov dx,[label1.top]
push dx
mov esi,[sc.work_text]
int 0x40
mcall
movsx ecx,word [scr.height] ; ¢ëá®â  íªà ­ 
mov dx,[label2.top]
int 0x40
mcall
mov bx,2
shl ebx,16
movsx ecx,word [scr.bitspp] ; ¡¨â ­  ¯¨ªá¥«ì
mov dx,240
shl edx,16
pop dx
int 0x40
mcall
mov bx,6
shl ebx,16
mov ecx,[scr.bytesps] ; ¡ ©â ­  áâபã
mov dx,[label2.top]
int 0x40
mcall
call draw_number ; ¯à®à¨á®¢ë¢ ¥¬ ­®¬¥à á­¨¬ª 
call dr_st
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_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 ; ª®­¥æ ¯¥à¥à¨á®¢ª¨
ret
@ -231,7 +327,12 @@ ret
;--- ¯®«ãç¨âì ¯ ¬ïâì ¤«ï á­¨¬ª  ---
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 ; ä®âª âì ®¡« áâì íªà ­ 
jc .use_area
movzx ecx, word [scr.width]
@ -244,12 +345,13 @@ get_mem_for_shoot:
@@:
imul ecx,ebx
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
xor ebx,ebx
inc ebx
mov eax,64
int 0x40
ret
;--- ᮤ âì ®ª­® ¯à®¥¤¯à®á¬®âà  ---
@ -260,9 +362,9 @@ pusha
mov eax,51
xor ebx,ebx
inc ebx
movr ecx,scr_window
mov edx,__app_end-1000
int 0x40
mov ecx,scr_window
mov edx,i_end_tread-1000
mcall
@@:
popa
ret
@ -280,14 +382,14 @@ draw_number:
mov edi,sign_n_input
call zstr_to_int
mov [sign_n],al
movr eax,13
mov eax,13
mov ebx,150*65536+96
mov cx,[label9.top]
shl ecx,16
mov cx,10
mov edx,[sc.work]
int 0x40
movr eax,47
mcall
mov eax,47
movsx bx,byte [sign_n]
shl ebx,16
mov ecx,[cur_number]
@ -295,20 +397,20 @@ draw_number:
shl edx,16
mov dx,[label9.top]
mov esi,[sc.work_text]
int 0x40
mcall
ret
;--- ¯à®æ¥¤ãà , § ¯ã᪠îé ï ¯®â®ª  ¢â®áꥬª¨ ---
start_autoshoot:
bts dword [flags],1
jc @f
movr eax,51
mov eax,51
;mov ebx,1
xor ebx,ebx
inc ebx
mov ecx,autoshoot
mov edx,__app_end-512
int 0x40
mov edx,i_end_tread-512
mcall
@@:
ret
@ -324,29 +426,29 @@ autoshoot:
.next:
bt dword [flags],1
jnc close
movr eax,60
movr ebx,2
mov eax,60
mov ebx,2
mov ecx,[app.pid]
mov edx,messages.draw_number
mov esi,2
int 0x40
mcall
call shoot
jmp autoshoot.next
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ áâப¨ á®áâ®ï­¨ï ---
; (¤®«¦­  ¢ë§ë¢ âìáï ¯®â®ª®¬ £« ¢­®£® ®ª­ )
dr_st:
movr eax,38 ; ®â१®ª
mov eax,38 ; ®â१®ª
mov ebx,0*65536+310
mov ecx,198*65536+198
mov edx,[sc.work_graph]
int 0x40
mcall
movr eax,13 ; ¯®«®áª 
mov eax,13 ; ¯®«®áª 
mov bx,310
mov ecx,199*65536+15
mov edx,[sc.work]
int 0x40
mcall
mov edi,status
call draw_label
@ -356,17 +458,17 @@ ret
; ¢å®¤ ebx - ¡ãää¥à 1024 ¡ ©â
; ¢ë室 ecx - ­®¬¥à á«®â 
get_slot_n:
movr eax,9
mov eax,9
xor ecx,ecx
dec ecx
int 0x40
mcall
mov edx,[ebx+30]
xor ecx,ecx
@@:
movr eax,9
mov eax,9
inc ecx
int 0x40
mcall
cmp [ebx+30],edx
je @f
jmp @b
@ -388,11 +490,11 @@ save_shoot:
bt dword [flags],1
jc .running
movr eax,51
mov eax,51
;mov ebx,1
xor ebx,ebx
inc ebx
int 0x40
mcall
.running:
ret
@ -402,12 +504,12 @@ one_shoot_thread:
activ_window
bt dword [ch1.flags],1 ; ¬¨­¨¬¨§¨à®¢ âì ®ª­® ?
jnc @f
movr eax,60
movr ebx,2
mov eax,60
mov ebx,2
mov ecx,[app.pid]
mov edx,messages.min_window
mov esi,2
int 0x40
mcall
@@:
call shoot
btr dword [flags],2
@ -416,12 +518,12 @@ one_shoot_thread:
;--- ¯à®æ¥¤ãà , ®â¯à ¢«ïîé ï £« ¢­®¬ã ®ª­ã á®®¡é¥­¨¥ ® ¯¥à¥à¨á®¢ª¥
; áâப¨ á®áâ®ï­¨ï ---
send_draw_status:
movr eax,60
movr ebx,2
mov eax,60
mov ebx,2
mov ecx,[app.pid]
mov edx,messages.draw_status
mov esi,2
int 0x40
mcall
ret
;--- ¯®â®ª, á®åà ­ï ä ©« ---
@ -436,34 +538,34 @@ save_shoot_thread:
show_set_rect_window:
bts dword [flags],3
jc @f
movr eax,51
mov eax,51
xor ebx,ebx
inc ebx
mov ecx,set_rect_window
mov edx,set_rect_window_esp
int 0x40
mcall
mov [set_rect_window_pid],eax
ret
@@:
movr eax,18
mov eax,18
mov ebx,eax
mov ecx,[set_rect_window_pid]
int 0x40
mcall
btr dword [flags],3
ret
;--- ¯®«ã祭¨¥ ¨­ä®à¬ æ¨¨ ®¡  ªâ¨¢­®¬ ®ª­¥ ---
get_active_window_info:
movr eax,18
movr ebx,7
int 0x40
mov eax,18
mov ebx,7
mcall
mov ecx,eax
movr eax,9
mov eax,9
mov ebx,active_app
int 0x40
mcall
ret
;====================================================================
@ -493,9 +595,9 @@ status label 5,201,0,no_shoot
labels_end:
editboxes:
edit1 edit_box 300,5,35,cl_white,0xaabbcc,0,0,0,1024,ed_buffer.1,ed_focus ; ¯ãâì ª ä ©«ã
edit2 edit_box 35,75,134,cl_white,0xaabbcc,0,0,0,9,ed_buffer.2,ed_figure_only ; § ¤¥à¦ª 
edit3 edit_box 35,165,164,cl_white,0xaabbcc,0,0,0,9,ed_buffer.3,ed_figure_only
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,3,3 ; § ¤¥à¦ª 
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
editboxes_end:
@ -510,13 +612,13 @@ but7 txt_button 40,205,10,150,8,0,0,but_text.7,show_set_rect_window ;
buttons_end:
check_boxes:
ch1 check_box 5,105,cl_white,0,0,ch_text.1,(ch_text.2-ch_text.1) ; ᢥà­ãâì ®ª­®
ch2 check_box 5,120,cl_white,0,0,ch_text.2,(ch_text.3-ch_text.2) ; § â¥¬ ᤥ« âì  ªâ¨¢­ë¬
ch3 check_box 145,105,cl_white,0,0,ch_text.3,(ch_text.4-ch_text.3) ; ¯®ª § âì á­¨¬®ª
ch4 check_box 5,135,cl_white,0,0,ch_text.4,(ch_text.5-ch_text.4) ;
ch5 check_box 5,150,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)
use_rect check_box 145,150,cl_white,0,0,ch_text.7,(ch_text.8-ch_text.7) ; ¨á¯. ®¡« áâì
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,5,11,cl_white,0,0,ch_text.2,(ch_text.3-ch_text.2),ch_flag_en ; § â¥¬ ᤥ« âì  ªâ¨¢­ë¬
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,5,11,cl_white,0,0,ch_text.4,(ch_text.5-ch_text.4),ch_flag_en ; § ¤¥à¦ª 
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,5,11,cl_white,0,0,ch_text.6,(ch_text.7-ch_text.6),ch_flag_en
use_rect check_box 145,150,5,11,cl_white,0,0,ch_text.7,(ch_text.8-ch_text.7) ; ¨á¯. ®¡« áâì
;  ¢â®­ã¬¥à æ¨ï
check_boxes_end:
@ -610,7 +712,7 @@ disk_filled db 'Disk is full',0
bad_fat_table db 'FAT table destroyed',0
ac_den db 'Access denied',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
invalid_rect db 'Wrong area size',0
@ -620,11 +722,14 @@ sign_n_input:
db '2',0
app_ipc ipc_buffer 32
align 4
mouse_flag: dd 0x0
structure_of_potock:
rb 100
align 4
cur_number dd ?
sign_n db ?
@ -656,6 +761,17 @@ sf_buf:
set_rect_window_pid 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:
.left rb 6
.top rb 6
@ -664,10 +780,7 @@ rect_input_buffer:
cmdstr rb 257
ed_buffer:
.1: rb 1025
.2: rb 10
.3: rb 10
align 4
file_name:
rb 1058
@ -679,11 +792,17 @@ rect:
.height dw ?
.width dw ?
sc sys_color_table
app procinfo ; ¨­ä®à¬ æ¨ï ® £« ¢­®¬ ®ª­¥
active_app procinfo ; ¨­ä®à¬ æ¨ï ®¡  ªâ¨¢­®¬ ®ª­¥
set_rect_window_procinfo procinfo ; ¨­ä®à¬ æ¨ï ®¡ ®ª­¥ ®¡« áâ¨
shoot_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

@ -18,19 +18,19 @@ scr_window:
mov edx,0x01000000
xor esi,esi
xor edi,edi
int 0x40
mcall
movr eax,7
mov ebx,[scr_buf.ptr]
mov ecx,[scr_buf.size]
mov eax,7
mov ebx,dword [scr_buf.ptr]
mov ecx,dword [scr_buf.size]
xor edx,edx
int 0x40
mcall
movr eax,13
mov eax,13
mov ebx,19*65536+231
mov ecx,19*65536+10
mov edx,0x00FF00
int 0x40
mcall
mov edi,.label
call draw_label
@ -39,3 +39,4 @@ scr_window:
ret
.label label 20,20,0x80000000,$+4
db '<27>â® ¢ è á­¨¬®ª. ‚ë室 - «î¡ ï ª« ¢¨è .',0

View File

@ -16,7 +16,18 @@ set_rect_window:
.key:
get_key
key_edit_boxes rect_input,rect_input_end
push dword rect_input.left
call [edit_box_key]
push dword rect_input.top
call [edit_box_key]
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
@ -39,8 +50,24 @@ set_rect_window:
cmp eax,[set_rect_window_slot]
jne .still
mouse_edit_boxes rect_input,rect_input_end
mouse_check_boxes riw_check_boxes,riw_check_boxes_end
push dword rect_input.left
call [edit_box_mouse]
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
@ -54,13 +81,26 @@ set_rect_window:
add edx,0x33000000
mov edi,riw_grab_text
xor esi,esi
int 0x40
mcall
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]
push dword rect_input.width
call [edit_box_draw]
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
@ -133,7 +173,7 @@ draw_rect_on_screen:
mov ebx,150*65536+80
mov ecx,5*65536+60
xor edx,edx
int 0x40
mcall
;movzx eax,word [rect.left]
;mul word [scr.width]
@ -176,9 +216,52 @@ draw_rect_on_screen:
mov edx,0xffffff
mov eax,13
int 0x40
mcall
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:
.left edit_box 35,95,5,cl_white,0,0,0,5,rect_input_buffer.left,\
ed_figure_only+ed_focus
@ -204,7 +287,7 @@ rect_input_labels_text:
.height db '‚ëá®â :',0
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.2-riw_check_boxes_text.1
riw_check_boxes_end:

View File

@ -12,7 +12,7 @@ pusha
mov ecx,[edi+4] ;[but.height]
mov edx,[edi+8];[but.id]
mov esi,[edi+12];[but.color]
int 0x40
mcall
;--- ⥪áâ ­  ­¥© ---
; áç¨â ¥¬ ª®«¨ç¥á⢮ ᨬ¢®«®¢
mov edx,[edi+20]
@ -45,7 +45,7 @@ pusha
; à¨á㥬 áâபã ⥪áâ 
mov ecx,[edi+16] ;[but.text_color]
shr eax,1
int 0x40
mcall
popa
ret
}