git-svn-id: svn://kolibrios.org@6331 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pathoswithin 2016-03-13 04:04:08 +00:00
parent b141c63200
commit ff6211368f

View File

@ -2,9 +2,9 @@
; Mad Mouse
;---------------------------------------------------------------------
; version: 0.2
; last update: 03/06/2012
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Some optimizations.
; last update: 03/06/2012
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Some optimizations.
;---------------------------------------------------------------------
; €¢â®à í⮣® 㦠᭮ áâ६­®£® ª®¤ : Sourcerer, 23.04.2010
; popovpa (29.05.2012)
@ -13,10 +13,10 @@
; 3. Ž¯â¨¬¨§ æ¨ï ª®¤ .
;------------------------------------------------------------------------------
use32 ; âà ­á«ïâ®à, ¨á¯®«ì§ãî騩 32-å à §àï¤­ë¥ ª®¬ ­¤ë
org 0x0 ; ¡ §®¢ë©  ¤à¥á ª®¤ , ¢á¥£¤  0x0
org 0x0 ; ¡ §®¢ë©  ¤à¥á ª®¤ , ¢á¥£¤  0x0
db 'MENUET01' ; 1. ¨¤¥­â¨ä¨ª â®à ¨á¯®«­ï¥¬®£® ä ©«  (8 ¡ ©â)
dd 0x01 ; 2. ¢¥àá¨ï ä®à¬ â  § £®«®¢ª  ¨á¯®«­ï¥¬®£® ä ©« 
db 'MENUET01' ; 1. ¨¤¥­â¨ä¨ª â®à ¨á¯®«­ï¥¬®£® ä ©«  (8 ¡ ©â)
dd 0x01 ; 2. ¢¥àá¨ï ä®à¬ â  § £®«®¢ª  ¨á¯®«­ï¥¬®£® ä ©« 
dd START ; 3.  ¤à¥á, ­  ª®â®àë© á¨á⥬  ¯¥à¥¤ ñâ ã¯à ¢«¥­¨¥
; ¯®á«¥ § £à㧪¨ ¯à¨«®¦¥­¨ï ¢ ¯ ¬ïâì
dd IM_END ; 4. à §¬¥à ¯à¨«®¦¥­¨ï
@ -30,10 +30,7 @@
dd 0x0 ; 8. 㪠§ â¥«ì ­  áâபã, ¢ ª®â®àãî § ¯¨á ­ ¯ãâì,
; ®âªã¤  § ¯ã饭® ¯à¨«®¦¥­¨¥
;------------------------------------------------------------------------------
; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§­ì ¯à®£à ¬¬¨áâ 
include '../../macros.inc'
;------------------------------------------------------------------------------
;--- <20>€—€Ž <20><>Žƒ<C5BD>€ŒŒ ----------------------------------------------
;--- <20>€—€Ž <20><>Žƒ<C5BD>€ŒŒ ----------------------------------------------
;------------------------------------------------------------------------------
START: ; ¤à¥á ­ ç «  ¯à®£à ¬¬ë
mov eax,40 ;ãáâ ­®¢¨âì ¬ áªã ¤«ï ®¦¨¤ ¥¬ëå ᮡë⨩.
@ -42,7 +39,7 @@ START: ;
;------------------------------------------------------------------------------
;--- –ˆŠ‹ Ž<><C5BD><EFBFBD>ŽŠˆ Ž<E28098>ˆ‰ ----------------------------------------
;------------------------------------------------------------------------------
align 4
align 4
still:
mov eax,10 ;®¦¨¤ âì ᮡë⨩
int 0x40
@ -53,18 +50,18 @@ still:
mov ebx,eax
shl ebx,16
shr ebx,16
mov edi,ebx ;á®åà ­¨¬ ã
mov edi,ebx ;á®åà ­¨¬ ã
shr eax,16 ;ᤢ¨£ ¥¬ eax ¢¯à ¢® ­  16 - ¯®«ãç ¥¬ x
mov esi,eax ;á®åà ­¨¬ x
mov esi,eax ;á®åà ­¨¬ x
;¯®«ãç ¥¬ ª®®à¤¨­ âë ªãàá®à 
mov eax,37 ;äã­ªæ¨ï 37 - à ¡®â  á ¬ëèìî
xor ebx,ebx ;¯®¤äãªæ¨ï 0 - ª®®à¤¨­ âë ¬ëè¨
xor ebx,ebx ;¯®¤äãªæ¨ï 0 - ª®®à¤¨­ âë ¬ëè¨
;®â­®á¨â¥«ì­® íªà ­ 
int 0x40
mov ebx,eax ;§ ¯®¬¨­ ¥¬ ª®®à¤¨­ âë
mov ebx,eax ;§ ¯®¬¨­ ¥¬ ª®®à¤¨­ âë
shr eax,16 ;⥯¥àì ã ­ á ⮫쪮 x. ­ã¦¥­ ¨ y
mov ecx,eax ;§ ¯®¬¨­ ¥¬ x
mov ecx,eax ;§ ¯®¬¨­ ¥¬ x
shl ebx,16 ;ᤢ¨­¥¬ ¢«¥® ­  16
shr ebx,16 ;ᤢ¨­¥¬¢ ¯à ¢® ­  16, ã ­ á ¥áâì ã
;------------------------------------------------------------------------------
@ -72,28 +69,28 @@ still:
;¢ ecx ¨ ebx ª®®à¤¨­ âë ªãàá®à  X ¨ Y ᮮ⢥⢥­­®
;------------------------------------------------------------------------------
;áà ¢­¥­¨¥ ª®®à¤¨­ â x
test ecx,ecx ;à ¢­  0?
test ecx,ecx ;à ¢­  0?
jz left_border ;¯¥à¥å®¤ ª ®¡à ¡®âª¥ ã «¥¢®£® ªà ï
cmp ecx,esi ;à ¢­  è¨à¨­¥ íªà ­ ?
jz right_border ;¯¥à¥å®¤¨¬ ª ®¡à ¡®âª¥ 㠯ࠢ®£® ªà ï
cmp ecx,esi ;à ¢­  è¨à¨­¥ íªà ­ ?
jz right_border ;¯¥à¥å®¤¨¬ ª ®¡à ¡®âª¥ 㠯ࠢ®£® ªà ï
;áà ¢­¥­¨¥ ª®®à¤¨­ â y
test ebx,ebx ;à ¢­  0?
test ebx,ebx ;à ¢­  0?
jz top_border ;¥á«¨ ¤  §­ ç¨â ªãàá®à ¢¢¥àåã
cmp ebx,edi ;à ¢­  ¢ëá®â¥ íªà ­ ?
cmp ebx,edi ;à ¢­  ¢ëá®â¥ íªà ­ ?
jz bottom_border ;¯¥à¥å®¤ ª ®¡à ¡®âª¥ ã ­¨¦­¥£® ªà ï
jmp still ;¨­ ç¥ ­¨ç¥£® ¤¥« âì ­¥ ­ã¦­®
;------------------------------------------------------------------------------
align 4
align 4
left_border:
mov edx,esi ;¢ edx ¨¬¥¥¬ è¨à¨­ã íªà ­ 
mov edx,esi ;¢ edx ¨¬¥¥¬ è¨à¨­ã íªà ­ 
dec edx ;㬥­ì訬 ­  1
shl edx,16 ;⥯¥àì edx=(x-1)*65536
add edx,ebx ;  ⥯¥àì edx=(x-1)*65536+y
add edx,ebx ;  ⥯¥àì edx=(x-1)*65536+y
;------------------------------------------------------------------------------
align 4
align 4
set_mouse_position:
mov eax,18 ;äã­ªæ¨ï 18: ãáâ ­®¢¨âì ­ áâனª¨ ¬ëè¨
mov ebx,19 ;¯®¤äã­ªæ¨ï 19
@ -102,32 +99,32 @@ set_mouse_position:
int 0x40
jmp still ;®â¤ëå ¥¬
;------------------------------------------------------------------------------
align 4
align 4
right_border: ;ªãàá®à 㠯ࠢ®£® ªà ï
xor edx,edx
inc edx ;edx=1
shl edx,16 ;edx = 1*65536
add edx,ebx ;edx=1*65536+y
add edx,ebx ;edx=1*65536+y
jmp set_mouse_position
;------------------------------------------------------------------------------
align 4
align 4
top_border: ;ªãàá®à ã ¢¥àå­¥£® ªà ï
mov edx,ecx ;• ª®®à¤¨­ â  ªãàá®à 
mov edx,ecx ;• ª®®à¤¨­ â  ªãàá®à 
shl edx,16 ;⥯¥àì edx=(x)*65536
add edx,edi ;  ⥯¥àì edx=(x)*65536+y
add edx,edi ;  ⥯¥àì edx=(x)*65536+y
dec edx ;  ⥯¥àì edx=(x)*65536+(ã-1)
jmp set_mouse_position
;------------------------------------------------------------------------------
align 4
align 4
bottom_border: ;ªãàá®à ã ­¨¦­¥£® ªà ï
mov edx,ecx ;edx=ecx x ª®®à¤¨­ â  ªãàá®à 
mov edx,ecx ;edx=ecx x ª®®à¤¨­ â  ªãàá®à 
shl edx,16 ;edx = å*65536
;ã ª®®à¤¨­ â  à ¢­  0
inc edx ;ã ª®®à¤¨­ â  à ¢­  1
jmp set_mouse_position
;------------------------------------------------------------------------------
IM_END: ; ¬¥âª  ª®­æ  ª®¤ 
IM_END: ; ¬¥âª  ª®­æ  ª®¤ 
;------------------------------------------------------------------------------
align 4
rb 1024