137 lines
5.3 KiB
NASM
137 lines
5.3 KiB
NASM
|
;------------------------------------------------------------------------------
|
|||
|
; Mad Mouse
|
|||
|
;---------------------------------------------------------------------
|
|||
|
; version: 0.2
|
|||
|
; last update: 03/06/2012
|
|||
|
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
|||
|
; changes: Some optimizations.
|
|||
|
;---------------------------------------------------------------------
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD> <20>⮣<EFBFBD> 㦠᭮ <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>: Sourcerer, 23.04.2010
|
|||
|
; popovpa (29.05.2012)
|
|||
|
; 1. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>.
|
|||
|
; 2. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<22><><EFBFBD><EFBFBD>᪠<EFBFBD><E1AAA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" ᢥ<><E1A2A5><EFBFBD> <20> <20><><EFBFBD><EFBFBD> :)
|
|||
|
; 3. <20><>⨬<EFBFBD><E2A8AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
use32 ; <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD>騩 32-<2D> ࠧ<>來<EFBFBD><EFA4AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
org 0x0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20>ᥣ<EFBFBD><E1A5A3> 0x0
|
|||
|
|
|||
|
db 'MENUET01' ; 1. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> (8 <20><><EFBFBD><EFBFBD>)
|
|||
|
dd 0x01 ; 2. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD><E0ACA0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9>
|
|||
|
dd START ; 3. <20><><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD> <20><>।<EFBFBD><E0A5A4><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; <20><> <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
dd IM_END ; 4. ࠧ<><E0A0A7><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
dd I_END ; 5. <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 0x0
|
|||
|
; <20><> <20><><EFBFBD>祭<EFBFBD><E7A5AD>, <20><>।<EFBFBD><E0A5A4><EFBFBD><F1ADADAE> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
dd stack_area ; 6. <20><><EFBFBD>設<EFBFBD> <20>⥪<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 㪠<><E3AAA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
dd 0x0 ; 7. 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><>ப<EFBFBD> <20> <20><>ࠬ<EFBFBD><E0A0AC>ࠬ<EFBFBD>.
|
|||
|
; <20> <20><> <20><><EFBFBD><EFBFBD>᪠ <20><>ࠢ<EFBFBD><E0A0A2> <20><><EFBFBD><EFBFBD>, <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뫮
|
|||
|
; <20><><EFBFBD><EFBFBD>饭<EFBFBD> <20> <20><>ࠬ<EFBFBD><E0A0AC>ࠬ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|||
|
dd 0x0 ; 8. 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><>ப<EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ᠭ <20><><EFBFBD><EFBFBD>,
|
|||
|
; <20><><EFBFBD>㤠 <20><><EFBFBD><EFBFBD>饭<EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
include '../../macros.inc'
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------------
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
START: ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><>砫<EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
|||
|
mov eax,40 ;<3B><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<>⨩.
|
|||
|
mov ebx,100000b ;<3B>㦭<EFBFBD> ⮫쪮 ᮡ<>⨥ <20><><EFBFBD><EFBFBD>
|
|||
|
int 0x40
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
;--- <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
align 4
|
|||
|
still:
|
|||
|
mov eax,10 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<>⨩
|
|||
|
int 0x40
|
|||
|
|
|||
|
mov eax,14 ;<3B>㭪<EFBFBD><E3ADAA><EFBFBD> 14 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD> <20><>࠭<EFBFBD>
|
|||
|
int 0x40 ;<3B>맮<EFBFBD> <20>.14 <20> 横<><E6A8AA> <20><>⮬<EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7>襭<EFBFBD><E8A5AD> <20><>࠭<EFBFBD>
|
|||
|
mov ebx,eax
|
|||
|
shl ebx,16
|
|||
|
shr ebx,16
|
|||
|
mov edi,ebx ;<3B><><EFBFBD>࠭<EFBFBD><E0A0AD> <20>
|
|||
|
shr eax,16 ;ᤢ<><E1A4A2><EFBFBD><EFBFBD><EFBFBD> eax <20><>ࠢ<EFBFBD> <20><> 16 - <20><><EFBFBD><EFBFBD>砥<EFBFBD> x
|
|||
|
mov esi,eax ;<3B><><EFBFBD>࠭<EFBFBD><E0A0AD> x
|
|||
|
;<3B><><EFBFBD><EFBFBD>砥<EFBFBD> <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov eax,37 ;<3B>㭪<EFBFBD><E3ADAA><EFBFBD> 37 - ࠡ<><E0A0A1><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
xor ebx,ebx ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 - <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
;<3B>⭮<EFBFBD><E2ADAE>⥫쭮 <20><>࠭<EFBFBD>
|
|||
|
int 0x40
|
|||
|
|
|||
|
mov ebx,eax ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD>
|
|||
|
shr eax,16 ;⥯<><E2A5AF><EFBFBD> <20> <20><><EFBFBD> ⮫쪮 x. <20>㦥<EFBFBD> <20> y
|
|||
|
mov ecx,eax ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> x
|
|||
|
shl ebx,16 ;ᤢ<><E1A4A2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> 16
|
|||
|
shr ebx,16 ;ᤢ<><E1A4A2><EFBFBD><EFBFBD><EFBFBD> <20>ࠢ<EFBFBD> <20><> 16, <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20>
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
;<3B> esi <20> edi <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><>࠭<EFBFBD> X <20> Y ᮮ⢥<E1AEAE>ᢥ<EFBFBD><E1A2A5><EFBFBD>
|
|||
|
;<3B> ecx <20> ebx <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> X <20> Y ᮮ⢥⢥<E2A2A5><E2A2A5><EFBFBD>
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
;<3B>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD> x
|
|||
|
test ecx,ecx ;ࠢ<><E0A0A2> 0?
|
|||
|
jz left_border ;<3B><><EFBFBD><EFBFBD>室 <20> <20><>ࠡ<EFBFBD>⪥ <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
cmp ecx,esi ;ࠢ<><E0A0A2> <20><>ਭ<EFBFBD> <20><>࠭<EFBFBD>?
|
|||
|
jz right_border ;<3B><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4> <20> <20><>ࠡ<EFBFBD>⪥ <20> <20>ࠢ<EFBFBD><E0A0A2><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
;<3B>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD> y
|
|||
|
test ebx,ebx ;ࠢ<><E0A0A2> 0?
|
|||
|
jz top_border ;<3B> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
cmp ebx,edi ;ࠢ<><E0A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>࠭<EFBFBD>?
|
|||
|
jz bottom_border ;<3B><><EFBFBD><EFBFBD>室 <20> <20><>ࠡ<EFBFBD>⪥ <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
jmp still ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><>祣<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>㦭<EFBFBD>
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
align 4
|
|||
|
left_border:
|
|||
|
mov edx,esi ;<3B> edx <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ਭ<EFBFBD> <20><>࠭<EFBFBD>
|
|||
|
dec edx ;㬥<><E3ACA5>訬 <20><> 1
|
|||
|
shl edx,16 ;⥯<><E2A5AF><EFBFBD> edx=(x-1)*65536
|
|||
|
add edx,ebx ;<3B> ⥯<><E2A5AF><EFBFBD> edx=(x-1)*65536+y
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
align 4
|
|||
|
set_mouse_position:
|
|||
|
mov eax,18 ;<3B>㭪<EFBFBD><E3ADAA><EFBFBD> 18: <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ன<EFBFBD><E0AEA9> <20><><EFBFBD><EFBFBD>
|
|||
|
mov ebx,19 ;<3B><><EFBFBD><EFBFBD>㭪<EFBFBD><E3ADAA><EFBFBD> 19
|
|||
|
mov ecx,4 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㭪<EFBFBD><E3ADAA><EFBFBD> 4: <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
int 0x40
|
|||
|
jmp still ;<3B><><EFBFBD><EFBFBD>堥<EFBFBD>
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
align 4
|
|||
|
right_border: ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>ࠢ<EFBFBD><E0A0A2><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
xor edx,edx
|
|||
|
inc edx ;edx=1
|
|||
|
shl edx,16 ;edx = 1*65536
|
|||
|
add edx,ebx ;edx=1*65536+y
|
|||
|
jmp set_mouse_position
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
align 4
|
|||
|
top_border: ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>孥<EFBFBD><E5ADA5> <20><><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
mov edx,ecx ;<3B> <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
shl edx,16 ;⥯<><E2A5AF><EFBFBD> edx=(x)*65536
|
|||
|
add edx,edi ;<3B> ⥯<><E2A5AF><EFBFBD> edx=(x)*65536+y
|
|||
|
dec edx ;<3B> ⥯<><E2A5AF><EFBFBD> edx=(x)*65536+(<28>-1)
|
|||
|
jmp set_mouse_position
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
align 4
|
|||
|
bottom_border: ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
mov edx,ecx ;edx=ecx x <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
shl edx,16 ;edx = <20>*65536
|
|||
|
;<3B> <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> ࠢ<><E0A0A2> 0
|
|||
|
jmp set_mouse_position
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
IM_END: ; <20><>⪠ <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
align 4
|
|||
|
rb 1024
|
|||
|
stack_area:
|
|||
|
;------------------------------------------------------------------------------
|
|||
|
I_END: ; <20><>⪠ <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
|||
|
;------------------------------------------------------------------------------
|