diff --git a/data/Tupfile.lua b/data/Tupfile.lua index e33179d98..6bd2b7a3b 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -430,7 +430,7 @@ tup.append_table(img_files, { {"LOADDRV", VAR_PROGS .. "/system/loaddrv/loaddrv"}, {"MAGNIFY", VAR_PROGS .. "/system/magnify/magnify"}, {"MGB", VAR_PROGS .. "/testing/mgb/trunk/mgb"}, - {"MOUSEMUL", VAR_PROGS .. "/system/mousemul/trunk/mousemul"}, + {"MOUSEMUL", VAR_PROGS .. "/system/mousemul/mousemul"}, {"MADMOUSE", VAR_PROGS .. "/other/madmouse/madmouse"}, {"MYKEY", VAR_PROGS .. "/system/MyKey/trunk/MyKey"}, {"PCIDEV", VAR_PROGS .. "/testing/pcidev/trunk/PCIDEV"}, diff --git a/programs/build_all.bat b/programs/build_all.bat index 98f6890ef..6603dfef2 100644 --- a/programs/build_all.bat +++ b/programs/build_all.bat @@ -70,7 +70,7 @@ fasm system\kbd\trunk\kbd.ASM %BIN%\kbd fasm system\launcher\launcher.asm %BIN%\launcher fasm system\menu\menu.asm %BIN%\@menu fasm system\mgb\trunk\mgb.asm %BIN%\mgb -fasm system\mousemul\trunk\mousemul.asm %BIN%\mousemul +fasm system\mousemul\mousemul.asm %BIN%\mousemul fasm system\PANEL\trunk\@TASKBAR.ASM %BIN%\@TASKBAR fasm system\pcidev\trunk\pcidev.asm %BIN%\pcidev fasm system\RB\trunk\@RB.ASM %BIN%\@RB diff --git a/programs/system/mousemul/trunk/Tupfile.lua b/programs/system/mousemul/Tupfile.lua similarity index 79% rename from programs/system/mousemul/trunk/Tupfile.lua rename to programs/system/mousemul/Tupfile.lua index 04360af8e..163201e66 100644 --- a/programs/system/mousemul/trunk/Tupfile.lua +++ b/programs/system/mousemul/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/system/mousemul/trunk/build.bat b/programs/system/mousemul/build.bat similarity index 100% rename from programs/system/mousemul/trunk/build.bat rename to programs/system/mousemul/build.bat diff --git a/programs/system/mousemul/trunk/build.sh b/programs/system/mousemul/build.sh similarity index 100% rename from programs/system/mousemul/trunk/build.sh rename to programs/system/mousemul/build.sh diff --git a/programs/system/mousemul/trunk/makefile b/programs/system/mousemul/makefile similarity index 100% rename from programs/system/mousemul/trunk/makefile rename to programs/system/mousemul/makefile diff --git a/programs/system/mousemul/trunk/mousemul.asm b/programs/system/mousemul/mousemul.asm similarity index 94% rename from programs/system/mousemul/trunk/mousemul.asm rename to programs/system/mousemul/mousemul.asm index 5af3717dd..58e3b37ed 100644 --- a/programs/system/mousemul/trunk/mousemul.asm +++ b/programs/system/mousemul/mousemul.asm @@ -1,306 +1,312 @@ -; <--- description ---> -; compiler: FASM 1.67.23 -; name: Mouse Emulation For KolibriOS -;----------------------------------------------------------------------------- -; version: 1.2 -; last update: 01/06/2012 -; written by: Marat Zakiyanov aka Mario79, aka Mario -; changes: using new functions 66.6 and 66.7 -;----------------------------------------------------------------------------- -; version: 1.1 -; last update: 26/05/2012 -; written by: Lipatov Kirill aka Leency -; changes: shows notify with instructions, while opening program -;----------------------------------------------------------------------------- -; version: 1.0 -; last update: 04/09/2010 -; written by: Marat Zakiyanov aka Mario79, aka Mario -; changes: total optimization of code, -; different events for Up and Down of key Num 5 -; advansed acceleration mode -;----------------------------------------------------------------------------- -; version: 0.8 -; last update: 03/10/2007 -; written by: Zlobny_Gluk -; e-mail: umbrosia@land.ru -;----------------------------------------------------------------------------- -; <--- include all KolibriOS stuff ---> -include "lang.inc" -include '../../../macros.inc' - -; <--- start of KolibriOS application ---> -MEOS_APP_START - -; <--- start of code ---> -CODE -;----------------------------------------------------------------------------- -start: - mcall 70,notifyapp - -start1: - xor ebx,ebx - mcall 40 -@@: - mcall 23,10 - - mcall 66,3 - test eax,0x80 ;NumLock status - jz @r - - mov ebx,4 - call hotkeys_common - - mcall 40,10b -still: - mcall 10 - - cmp eax,2 ; if event == 2 - jne still -;----------------------------------------------------------------------------- -key: ; key event handler - call mouse_acceleration - - mcall 2 ; get key code - - push eax - mcall 66,3 - test eax,0x80 ;NumLock status - pop eax - jnz @f - mov ebx,5 - call hotkeys_common - jmp start1 -@@: - cmp al,2 - jne still - - xor edx,edx - - cmp ah,80 ; Down Num 2 - je keytwo - cmp ah,81 ; Down Num 3 - je keythree - cmp ah,75 ; Down Num 4 - je keyfour - cmp ah,77 ; Down Num 6 - je keysix - cmp ah,71 ; Down Num 7 - je keyseven - cmp ah,72 ; Down Num 8 - je keyeight - cmp ah,73 ; Down Num 9 - je keynine - cmp ah,76 ; Down Num 5 - je keyfive - cmp ah,204 ; Up Num 5 - je keyfive_1 - cmp ah,79 ; Down Num 1 - jne still -;----------------------------------------------------------------------------- -keyone: - call down -keyfour: - call left - jmp mouseread -;----------------------------------------------------------------------------- -keythree: - call right -keytwo: - call down - jmp mouseread -;----------------------------------------------------------------------------- -keyseven: - call left -keyeight: - call up - jmp mouseread -;----------------------------------------------------------------------------- -keynine: - call up -keysix: - call right - jmp mouseread -;----------------------------------------------------------------------------- -keyfive: - inc edx -keyfive_1: - mcall 18,19,5 - jmp still -;----------------------------------------------------------------------------- -left: - mov eax,esi - shl eax,16 - sub edx,eax - ret -;----------------------------------------------------------------------------- -right: - mov eax,esi - shl eax,16 - add edx,eax - ret -;----------------------------------------------------------------------------- -down: - add edx,esi - ret -;----------------------------------------------------------------------------- -up: - sub edx,esi - ret -;----------------------------------------------------------------------------- -mouseread: - xor ebx,ebx - mcall 37 - add edx,eax - -sravn: - xor ebx,ebx - xor edi,edi - -real: - mov ebx,edx - mov edi,ebx - shr ebx,16 ; get x1 -; shl edi,16 ; get y1 -; shr edi,16 - and edi,0xffff - -nullli: - add ebx,16 - cmp ebx,65535 - jg xmin - sub ebx,15 - - add edi,16 - cmp edi,65535 - jg ymin - sub edi,15 - -razr: - mcall 14 - - mov ecx,eax - shr eax,16 ; get x2 -; shl ecx,16 ; get y2 -; shr ecx,16 - and ecx,0xffff - -rightdownli: - cmp eax,ebx - jl xmax - cmp ecx,edi - jl ymax - -mousewrite: - mcall 18,19,4 - mcall 26,9 - mov [mouse_timer_ticks],eax - jmp still -;----------------------------------------------------------------------------- -mouse_acceleration: - xor esi,esi - inc esi - mcall 18,19,2 - mov ecx,eax - mcall 26,9 - sub eax,[mouse_timer_ticks] - cmp eax,ecx ; mouse_delay - ja @f - xor ecx,ecx - mcall 18,19 ; checkspeed - mov esi,eax - shl esi,2 -@@: - ret -;----------------------------------------------------------------------------- -xmax: - dec eax - dec ebx - dec edi - shl eax,16 - add edi,eax - mov edx,edi - jmp sravn -;----------------------------------------------------------------------------- -xmin: - mov edx,edi - jmp sravn -;----------------------------------------------------------------------------- -ymax: - dec ecx - dec ebx - - shl ebx,16 - mov edi,ebx - add edi,ecx - mov edx,edi - jmp sravn -;----------------------------------------------------------------------------- -ymin: - shl ebx,16 - mov edx,ebx - shr ebx,16 - jmp sravn -;----------------------------------------------------------------------------- -hotkeys_common: - xor ecx,ecx - xor edx,edx - mov cl,79 ; Down Num 1 - mcall 66 - - mov cl,80 ; Down Num 2 - mcall 66 - - mov cl,81 ; Down Num 3 - mcall 66 - - mov cl,75 ; Down Num 4 - mcall 66 - - mov cl,76 ; Down Num 5 - mcall 66 - - mov cl,204 ; Up Num 5 - mcall 66 - - mov cl,77 ; Down Num 6 - mcall 66 - - mov cl,71 ; Down Num 7 - mcall 66 - - mov cl,72 ; Down Num 8 - mcall 66 - - mov cl,73 ; Down Num 9 - mcall 66 -; disable/enable input, work only hotkeys (f.66.6,66.7) - add ebx,2 - mcall 66 - ret -;----------------------------------------------------------------------------- -; <--- initialised data ---> -DATA -;----------------------------------------------------------------------------- -; <--- uninitialised data ---> -UDATA -mouse_timer_ticks dd 0 -;----------------------------------------------------------------------------- -if lang eq ru_RU - ud_user_message db '"NumLock включает и выключает эмулятор мыши.\nУправление через Numpad." -I',0 -else if lang eq it_IT - ud_user_message db '"NumLock - on/off - usa Numpad per muovere il cursore." -I',0 -else - ud_user_message db '"NumLock - on/off mouse emul. Numpad - move cursor." -I',0 -end if - -notifyapp: - dd 7 - dd 0 - dd ud_user_message - dd 0 - dd 0 - db '@notify',0 -;----------------------------------------------------------------------------- -MEOS_APP_END -; <--- end of KolibriOS application ---> -; ZG +; SPDX-License-Identifier: NOASSERTION +; + +; Text encoded with Code Page 866 - Cyrillic + + +; <--- description ---> +; compiler: FASM 1.67.23 +; name: Mouse Emulation For KolibriOS +;----------------------------------------------------------------------------- +; version: 1.2 +; last update: 01/06/2012 +; written by: Marat Zakiyanov aka Mario79, aka Mario +; changes: using new functions 66.6 and 66.7 +;----------------------------------------------------------------------------- +; version: 1.1 +; last update: 26/05/2012 +; written by: Lipatov Kirill aka Leency +; changes: shows notify with instructions, while opening program +;----------------------------------------------------------------------------- +; version: 1.0 +; last update: 04/09/2010 +; written by: Marat Zakiyanov aka Mario79, aka Mario +; changes: total optimization of code, +; different events for Up and Down of key Num 5 +; advansed acceleration mode +;----------------------------------------------------------------------------- +; version: 0.8 +; last update: 03/10/2007 +; written by: Zlobny_Gluk +; e-mail: umbrosia@land.ru +;----------------------------------------------------------------------------- +; <--- include all KolibriOS stuff ---> +include "lang.inc" +include '../../macros.inc' + +; <--- start of KolibriOS application ---> +MEOS_APP_START + +; <--- start of code ---> +CODE +;----------------------------------------------------------------------------- +start: + mcall 70,notifyapp + +start1: + xor ebx,ebx + mcall 40 +@@: + mcall 23,10 + + mcall 66,3 + test eax,0x80 ;NumLock status + jz @r + + mov ebx,4 + call hotkeys_common + + mcall 40,10b +still: + mcall 10 + + cmp eax,2 ; if event == 2 + jne still +;----------------------------------------------------------------------------- +key: ; key event handler + call mouse_acceleration + + mcall 2 ; get key code + + push eax + mcall 66,3 + test eax,0x80 ;NumLock status + pop eax + jnz @f + mov ebx,5 + call hotkeys_common + jmp start1 +@@: + cmp al,2 + jne still + + xor edx,edx + + cmp ah,80 ; Down Num 2 + je keytwo + cmp ah,81 ; Down Num 3 + je keythree + cmp ah,75 ; Down Num 4 + je keyfour + cmp ah,77 ; Down Num 6 + je keysix + cmp ah,71 ; Down Num 7 + je keyseven + cmp ah,72 ; Down Num 8 + je keyeight + cmp ah,73 ; Down Num 9 + je keynine + cmp ah,76 ; Down Num 5 + je keyfive + cmp ah,204 ; Up Num 5 + je keyfive_1 + cmp ah,79 ; Down Num 1 + jne still +;----------------------------------------------------------------------------- +keyone: + call down +keyfour: + call left + jmp mouseread +;----------------------------------------------------------------------------- +keythree: + call right +keytwo: + call down + jmp mouseread +;----------------------------------------------------------------------------- +keyseven: + call left +keyeight: + call up + jmp mouseread +;----------------------------------------------------------------------------- +keynine: + call up +keysix: + call right + jmp mouseread +;----------------------------------------------------------------------------- +keyfive: + inc edx +keyfive_1: + mcall 18,19,5 + jmp still +;----------------------------------------------------------------------------- +left: + mov eax,esi + shl eax,16 + sub edx,eax + ret +;----------------------------------------------------------------------------- +right: + mov eax,esi + shl eax,16 + add edx,eax + ret +;----------------------------------------------------------------------------- +down: + add edx,esi + ret +;----------------------------------------------------------------------------- +up: + sub edx,esi + ret +;----------------------------------------------------------------------------- +mouseread: + xor ebx,ebx + mcall 37 + add edx,eax + +sravn: + xor ebx,ebx + xor edi,edi + +real: + mov ebx,edx + mov edi,ebx + shr ebx,16 ; get x1 +; shl edi,16 ; get y1 +; shr edi,16 + and edi,0xffff + +nullli: + add ebx,16 + cmp ebx,65535 + jg xmin + sub ebx,15 + + add edi,16 + cmp edi,65535 + jg ymin + sub edi,15 + +razr: + mcall 14 + + mov ecx,eax + shr eax,16 ; get x2 +; shl ecx,16 ; get y2 +; shr ecx,16 + and ecx,0xffff + +rightdownli: + cmp eax,ebx + jl xmax + cmp ecx,edi + jl ymax + +mousewrite: + mcall 18,19,4 + mcall 26,9 + mov [mouse_timer_ticks],eax + jmp still +;----------------------------------------------------------------------------- +mouse_acceleration: + xor esi,esi + inc esi + mcall 18,19,2 + mov ecx,eax + mcall 26,9 + sub eax,[mouse_timer_ticks] + cmp eax,ecx ; mouse_delay + ja @f + xor ecx,ecx + mcall 18,19 ; checkspeed + mov esi,eax + shl esi,2 +@@: + ret +;----------------------------------------------------------------------------- +xmax: + dec eax + dec ebx + dec edi + shl eax,16 + add edi,eax + mov edx,edi + jmp sravn +;----------------------------------------------------------------------------- +xmin: + mov edx,edi + jmp sravn +;----------------------------------------------------------------------------- +ymax: + dec ecx + dec ebx + + shl ebx,16 + mov edi,ebx + add edi,ecx + mov edx,edi + jmp sravn +;----------------------------------------------------------------------------- +ymin: + shl ebx,16 + mov edx,ebx + shr ebx,16 + jmp sravn +;----------------------------------------------------------------------------- +hotkeys_common: + xor ecx,ecx + xor edx,edx + mov cl,79 ; Down Num 1 + mcall 66 + + mov cl,80 ; Down Num 2 + mcall 66 + + mov cl,81 ; Down Num 3 + mcall 66 + + mov cl,75 ; Down Num 4 + mcall 66 + + mov cl,76 ; Down Num 5 + mcall 66 + + mov cl,204 ; Up Num 5 + mcall 66 + + mov cl,77 ; Down Num 6 + mcall 66 + + mov cl,71 ; Down Num 7 + mcall 66 + + mov cl,72 ; Down Num 8 + mcall 66 + + mov cl,73 ; Down Num 9 + mcall 66 +; disable/enable input, work only hotkeys (f.66.6,66.7) + add ebx,2 + mcall 66 + ret +;----------------------------------------------------------------------------- +; <--- initialised data ---> +DATA +;----------------------------------------------------------------------------- +; <--- uninitialised data ---> +UDATA +mouse_timer_ticks dd 0 +;----------------------------------------------------------------------------- +if lang eq ru_RU + ud_user_message db '"NumLock включает и выключает эмулятор мыши.\nУправление через Numpad." -I',0 +else if lang eq it_IT + ud_user_message db '"NumLock - on/off - usa Numpad per muovere il cursore." -I',0 +else + ud_user_message db '"NumLock - on/off mouse emul. Numpad - move cursor." -I',0 +end if + +notifyapp: + dd 7 + dd 0 + dd ud_user_message + dd 0 + dd 0 + db '@notify',0 +;----------------------------------------------------------------------------- +MEOS_APP_END +; <--- end of KolibriOS application ---> +; ZG