system/mousemul: Post-SVN clean up

- Move source code from `trunk` into program root directory.
- Update build files and ASM include paths.
- Note: Line endings standardised from `CRLF` > `LF`, so best to view diffs with whitespace changes hidden.
This commit is contained in:
2025-05-20 10:39:13 +01:00
committed by Andrew
parent 0dcffe1fe4
commit 18b0e1f6ff
7 changed files with 315 additions and 309 deletions

View File

@@ -430,7 +430,7 @@ tup.append_table(img_files, {
{"LOADDRV", VAR_PROGS .. "/system/loaddrv/loaddrv"}, {"LOADDRV", VAR_PROGS .. "/system/loaddrv/loaddrv"},
{"MAGNIFY", VAR_PROGS .. "/system/magnify/magnify"}, {"MAGNIFY", VAR_PROGS .. "/system/magnify/magnify"},
{"MGB", VAR_PROGS .. "/testing/mgb/trunk/mgb"}, {"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"}, {"MADMOUSE", VAR_PROGS .. "/other/madmouse/madmouse"},
{"MYKEY", VAR_PROGS .. "/system/MyKey/trunk/MyKey"}, {"MYKEY", VAR_PROGS .. "/system/MyKey/trunk/MyKey"},
{"PCIDEV", VAR_PROGS .. "/testing/pcidev/trunk/PCIDEV"}, {"PCIDEV", VAR_PROGS .. "/testing/pcidev/trunk/PCIDEV"},

View File

@@ -70,7 +70,7 @@ fasm system\kbd\trunk\kbd.ASM %BIN%\kbd
fasm system\launcher\launcher.asm %BIN%\launcher fasm system\launcher\launcher.asm %BIN%\launcher
fasm system\menu\menu.asm %BIN%\@menu fasm system\menu\menu.asm %BIN%\@menu
fasm system\mgb\trunk\mgb.asm %BIN%\mgb 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\PANEL\trunk\@TASKBAR.ASM %BIN%\@TASKBAR
fasm system\pcidev\trunk\pcidev.asm %BIN%\pcidev fasm system\pcidev\trunk\pcidev.asm %BIN%\pcidev
fasm system\RB\trunk\@RB.ASM %BIN%\@RB fasm system\RB\trunk\@RB.ASM %BIN%\@RB

View File

@@ -1,5 +1,5 @@
if tup.getconfig("NO_FASM") ~= "" then return end 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") tup.include(HELPERDIR .. "/use_fasm.lua")
add_include(tup.getvariantdir()) add_include(tup.getvariantdir())

View File

@@ -1,306 +1,312 @@
; <--- description ---> ; SPDX-License-Identifier: NOASSERTION
; compiler: FASM 1.67.23 ;
; name: Mouse Emulation For KolibriOS
;----------------------------------------------------------------------------- ; Text encoded with Code Page 866 - Cyrillic
; version: 1.2
; last update: 01/06/2012
; written by: Marat Zakiyanov aka Mario79, aka Mario ; <--- description --->
; changes: using new functions 66.6 and 66.7 ; compiler: FASM 1.67.23
;----------------------------------------------------------------------------- ; name: Mouse Emulation For KolibriOS
; version: 1.1 ;-----------------------------------------------------------------------------
; last update: 26/05/2012 ; version: 1.2
; written by: Lipatov Kirill aka Leency ; last update: 01/06/2012
; changes: shows notify with instructions, while opening program ; written by: Marat Zakiyanov aka Mario79, aka Mario
;----------------------------------------------------------------------------- ; changes: using new functions 66.6 and 66.7
; version: 1.0 ;-----------------------------------------------------------------------------
; last update: 04/09/2010 ; version: 1.1
; written by: Marat Zakiyanov aka Mario79, aka Mario ; last update: 26/05/2012
; changes: total optimization of code, ; written by: Lipatov Kirill aka Leency
; different events for Up and Down of key Num 5 ; changes: shows notify with instructions, while opening program
; advansed acceleration mode ;-----------------------------------------------------------------------------
;----------------------------------------------------------------------------- ; version: 1.0
; version: 0.8 ; last update: 04/09/2010
; last update: 03/10/2007 ; written by: Marat Zakiyanov aka Mario79, aka Mario
; written by: Zlobny_Gluk ; changes: total optimization of code,
; e-mail: umbrosia@land.ru ; different events for Up and Down of key Num 5
;----------------------------------------------------------------------------- ; advansed acceleration mode
; <--- include all KolibriOS stuff ---> ;-----------------------------------------------------------------------------
include "lang.inc" ; version: 0.8
include '../../../macros.inc' ; last update: 03/10/2007
; written by: Zlobny_Gluk
; <--- start of KolibriOS application ---> ; e-mail: umbrosia@land.ru
MEOS_APP_START ;-----------------------------------------------------------------------------
; <--- include all KolibriOS stuff --->
; <--- start of code ---> include "lang.inc"
CODE include '../../macros.inc'
;-----------------------------------------------------------------------------
start: ; <--- start of KolibriOS application --->
mcall 70,notifyapp MEOS_APP_START
start1: ; <--- start of code --->
xor ebx,ebx CODE
mcall 40 ;-----------------------------------------------------------------------------
@@: start:
mcall 23,10 mcall 70,notifyapp
mcall 66,3 start1:
test eax,0x80 ;NumLock status xor ebx,ebx
jz @r mcall 40
@@:
mov ebx,4 mcall 23,10
call hotkeys_common
mcall 66,3
mcall 40,10b test eax,0x80 ;NumLock status
still: jz @r
mcall 10
mov ebx,4
cmp eax,2 ; if event == 2 call hotkeys_common
jne still
;----------------------------------------------------------------------------- mcall 40,10b
key: ; key event handler still:
call mouse_acceleration mcall 10
mcall 2 ; get key code cmp eax,2 ; if event == 2
jne still
push eax ;-----------------------------------------------------------------------------
mcall 66,3 key: ; key event handler
test eax,0x80 ;NumLock status call mouse_acceleration
pop eax
jnz @f mcall 2 ; get key code
mov ebx,5
call hotkeys_common push eax
jmp start1 mcall 66,3
@@: test eax,0x80 ;NumLock status
cmp al,2 pop eax
jne still jnz @f
mov ebx,5
xor edx,edx call hotkeys_common
jmp start1
cmp ah,80 ; Down Num 2 @@:
je keytwo cmp al,2
cmp ah,81 ; Down Num 3 jne still
je keythree
cmp ah,75 ; Down Num 4 xor edx,edx
je keyfour
cmp ah,77 ; Down Num 6 cmp ah,80 ; Down Num 2
je keysix je keytwo
cmp ah,71 ; Down Num 7 cmp ah,81 ; Down Num 3
je keyseven je keythree
cmp ah,72 ; Down Num 8 cmp ah,75 ; Down Num 4
je keyeight je keyfour
cmp ah,73 ; Down Num 9 cmp ah,77 ; Down Num 6
je keynine je keysix
cmp ah,76 ; Down Num 5 cmp ah,71 ; Down Num 7
je keyfive je keyseven
cmp ah,204 ; Up Num 5 cmp ah,72 ; Down Num 8
je keyfive_1 je keyeight
cmp ah,79 ; Down Num 1 cmp ah,73 ; Down Num 9
jne still je keynine
;----------------------------------------------------------------------------- cmp ah,76 ; Down Num 5
keyone: je keyfive
call down cmp ah,204 ; Up Num 5
keyfour: je keyfive_1
call left cmp ah,79 ; Down Num 1
jmp mouseread jne still
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
keythree: keyone:
call right call down
keytwo: keyfour:
call down call left
jmp mouseread jmp mouseread
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
keyseven: keythree:
call left call right
keyeight: keytwo:
call up call down
jmp mouseread jmp mouseread
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
keynine: keyseven:
call up call left
keysix: keyeight:
call right call up
jmp mouseread jmp mouseread
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
keyfive: keynine:
inc edx call up
keyfive_1: keysix:
mcall 18,19,5 call right
jmp still jmp mouseread
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
left: keyfive:
mov eax,esi inc edx
shl eax,16 keyfive_1:
sub edx,eax mcall 18,19,5
ret jmp still
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
right: left:
mov eax,esi mov eax,esi
shl eax,16 shl eax,16
add edx,eax sub edx,eax
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
down: right:
add edx,esi mov eax,esi
ret shl eax,16
;----------------------------------------------------------------------------- add edx,eax
up: ret
sub edx,esi ;-----------------------------------------------------------------------------
ret down:
;----------------------------------------------------------------------------- add edx,esi
mouseread: ret
xor ebx,ebx ;-----------------------------------------------------------------------------
mcall 37 up:
add edx,eax sub edx,esi
ret
sravn: ;-----------------------------------------------------------------------------
xor ebx,ebx mouseread:
xor edi,edi xor ebx,ebx
mcall 37
real: add edx,eax
mov ebx,edx
mov edi,ebx sravn:
shr ebx,16 ; get x1 xor ebx,ebx
; shl edi,16 ; get y1 xor edi,edi
; shr edi,16
and edi,0xffff real:
mov ebx,edx
nullli: mov edi,ebx
add ebx,16 shr ebx,16 ; get x1
cmp ebx,65535 ; shl edi,16 ; get y1
jg xmin ; shr edi,16
sub ebx,15 and edi,0xffff
add edi,16 nullli:
cmp edi,65535 add ebx,16
jg ymin cmp ebx,65535
sub edi,15 jg xmin
sub ebx,15
razr:
mcall 14 add edi,16
cmp edi,65535
mov ecx,eax jg ymin
shr eax,16 ; get x2 sub edi,15
; shl ecx,16 ; get y2
; shr ecx,16 razr:
and ecx,0xffff mcall 14
rightdownli: mov ecx,eax
cmp eax,ebx shr eax,16 ; get x2
jl xmax ; shl ecx,16 ; get y2
cmp ecx,edi ; shr ecx,16
jl ymax and ecx,0xffff
mousewrite: rightdownli:
mcall 18,19,4 cmp eax,ebx
mcall 26,9 jl xmax
mov [mouse_timer_ticks],eax cmp ecx,edi
jmp still jl ymax
;-----------------------------------------------------------------------------
mouse_acceleration: mousewrite:
xor esi,esi mcall 18,19,4
inc esi mcall 26,9
mcall 18,19,2 mov [mouse_timer_ticks],eax
mov ecx,eax jmp still
mcall 26,9 ;-----------------------------------------------------------------------------
sub eax,[mouse_timer_ticks] mouse_acceleration:
cmp eax,ecx ; mouse_delay xor esi,esi
ja @f inc esi
xor ecx,ecx mcall 18,19,2
mcall 18,19 ; checkspeed mov ecx,eax
mov esi,eax mcall 26,9
shl esi,2 sub eax,[mouse_timer_ticks]
@@: cmp eax,ecx ; mouse_delay
ret ja @f
;----------------------------------------------------------------------------- xor ecx,ecx
xmax: mcall 18,19 ; checkspeed
dec eax mov esi,eax
dec ebx shl esi,2
dec edi @@:
shl eax,16 ret
add edi,eax ;-----------------------------------------------------------------------------
mov edx,edi xmax:
jmp sravn dec eax
;----------------------------------------------------------------------------- dec ebx
xmin: dec edi
mov edx,edi shl eax,16
jmp sravn add edi,eax
;----------------------------------------------------------------------------- mov edx,edi
ymax: jmp sravn
dec ecx ;-----------------------------------------------------------------------------
dec ebx xmin:
mov edx,edi
shl ebx,16 jmp sravn
mov edi,ebx ;-----------------------------------------------------------------------------
add edi,ecx ymax:
mov edx,edi dec ecx
jmp sravn dec ebx
;-----------------------------------------------------------------------------
ymin: shl ebx,16
shl ebx,16 mov edi,ebx
mov edx,ebx add edi,ecx
shr ebx,16 mov edx,edi
jmp sravn jmp sravn
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
hotkeys_common: ymin:
xor ecx,ecx shl ebx,16
xor edx,edx mov edx,ebx
mov cl,79 ; Down Num 1 shr ebx,16
mcall 66 jmp sravn
;-----------------------------------------------------------------------------
mov cl,80 ; Down Num 2 hotkeys_common:
mcall 66 xor ecx,ecx
xor edx,edx
mov cl,81 ; Down Num 3 mov cl,79 ; Down Num 1
mcall 66 mcall 66
mov cl,75 ; Down Num 4 mov cl,80 ; Down Num 2
mcall 66 mcall 66
mov cl,76 ; Down Num 5 mov cl,81 ; Down Num 3
mcall 66 mcall 66
mov cl,204 ; Up Num 5 mov cl,75 ; Down Num 4
mcall 66 mcall 66
mov cl,77 ; Down Num 6 mov cl,76 ; Down Num 5
mcall 66 mcall 66
mov cl,71 ; Down Num 7 mov cl,204 ; Up Num 5
mcall 66 mcall 66
mov cl,72 ; Down Num 8 mov cl,77 ; Down Num 6
mcall 66 mcall 66
mov cl,73 ; Down Num 9 mov cl,71 ; Down Num 7
mcall 66 mcall 66
; disable/enable input, work only hotkeys (f.66.6,66.7)
add ebx,2 mov cl,72 ; Down Num 8
mcall 66 mcall 66
ret
;----------------------------------------------------------------------------- mov cl,73 ; Down Num 9
; <--- initialised data ---> mcall 66
DATA ; disable/enable input, work only hotkeys (f.66.6,66.7)
;----------------------------------------------------------------------------- add ebx,2
; <--- uninitialised data ---> mcall 66
UDATA ret
mouse_timer_ticks dd 0 ;-----------------------------------------------------------------------------
;----------------------------------------------------------------------------- ; <--- initialised data --->
if lang eq ru_RU DATA
ud_user_message db '"NumLock ¢ª«î砥⠨ ¢ëª«îç ¥â í¬ã«ïâ®à ¬ëè¨.\n“¯à ¢«¥­¨¥ ç¥à¥§ Numpad." -I',0 ;-----------------------------------------------------------------------------
else if lang eq it_IT ; <--- uninitialised data --->
ud_user_message db '"NumLock - on/off - usa Numpad per muovere il cursore." -I',0 UDATA
else mouse_timer_ticks dd 0
ud_user_message db '"NumLock - on/off mouse emul. Numpad - move cursor." -I',0 ;-----------------------------------------------------------------------------
end if if lang eq ru_RU
ud_user_message db '"NumLock ¢ª«î砥⠨ ¢ëª«îç ¥â í¬ã«ïâ®à ¬ëè¨.\n“¯à ¢«¥­¨¥ ç¥à¥§ Numpad." -I',0
notifyapp: else if lang eq it_IT
dd 7 ud_user_message db '"NumLock - on/off - usa Numpad per muovere il cursore." -I',0
dd 0 else
dd ud_user_message ud_user_message db '"NumLock - on/off mouse emul. Numpad - move cursor." -I',0
dd 0 end if
dd 0
db '@notify',0 notifyapp:
;----------------------------------------------------------------------------- dd 7
MEOS_APP_END dd 0
; <--- end of KolibriOS application ---> dd ud_user_message
; ZG dd 0
dd 0
db '@notify',0
;-----------------------------------------------------------------------------
MEOS_APP_END
; <--- end of KolibriOS application --->
; ZG