1) The function 18/19 - to get/set mouse features

2) The application SETUP is changed for operation from functions 18/19, also instead of functions 6 and 33 the function 70 is used. 

git-svn-id: svn://kolibrios.org@120 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2006-08-13 13:02:57 +00:00
parent df2e1aa3a9
commit 28e25be617
8 changed files with 598 additions and 380 deletions

File diff suppressed because it is too large Load Diff

View File

@ -925,6 +925,54 @@ Remarks:
* See also subfunction 2 - terminate * See also subfunction 2 - terminate
process/thread by given slot. process/thread by given slot.
======================================================================
====================== Function 18, subfunction 19 =====================
======================= Get/set mouse features. ======================
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 19 - subfunction number
* ecx = subsubfunction number
ecx = 0 - get mouse speed
Returned value:
* eax = current mouse speed
ecx = 1 - set mouse speed
edx = selected value of speed
Returned value:
* function does not return value
ecx = 2 - get mouse delay
Returned value:
* eax = current mouse delay
ecx = 3 - set mouse delay
edx = selected value of delay
Returned value:
* function does not return value
ecx = 4 - set mouse pointer position
edx = [coordinate on axis x]*65536 + [coordinate on axis y]
Returned value:
* function does not return value
Remarks:
* Recommended speed of the mouse (in subfunction 1) from 1 up to 9.
The installed value is not inspected by the code of a kernel, on this use
cautiously, at incorrect value the cursor can "freeze".
Speed of mouse can be regulated through the application SETUP.
* Recommended delay of the mouse (in subfunction 3) = 10. Lower value
is not handled COM by mice. At the very large values the movement of
the mouse on 1 pixel is impossible and the cursor will jump
on the value of the installed speed (subfunction 1).
The installed value is not inspected by the code of a kernel.
* In subfunction 4 the installed value is not inspected by
the code of a kernel. Before usage it is necessary to find out current
screen resolution and at installation of a position to watch,
that the value of a position should do not fall outside
the limits the screen.
====================================================================== ======================================================================
============ Function 19 - start application from ramdisk. =========== ============ Function 19 - start application from ramdisk. ===========
====================================================================== ======================================================================
@ -4372,3 +4420,4 @@ Application start functions can return also following errors:
* 30 = 0x1E = not enough memory * 30 = 0x1E = not enough memory
* 31 = 0x1F = file is not executable * 31 = 0x1F = file is not executable
* 32 = 0x20 = too many processes * 32 = 0x20 = too many processes

View File

@ -4,7 +4,7 @@ MouseByteNumber DB 0
FirstByte DB 0 FirstByte DB 0
SecondByte DB 0 SecondByte DB 0
ThirdByte DB 0 ThirdByte DB 0
timer_ticks_com dd 0
;*************************************** ;***************************************
;* ÍÎÂÛÉ ÎÁÐÀÁÎÒ×ÈÊ ÏÐÅÐÛÂÀÍÈß ÎÒ ÌÛØÈ * ;* ÍÎÂÛÉ ÎÁÐÀÁÎÒ×ÈÊ ÏÐÅÐÛÂÀÍÈß ÎÒ ÌÛØÈ *
;*************************************** ;***************************************
@ -68,7 +68,7 @@ check_mouse_data_com1:
shl AL,6 shl AL,6
or AL,[SecondByte] or AL,[SecondByte]
cbw cbw
shl ax,1 call mouse_acceleration_com1
add AX,[0xFB0A] ;[XCoordinate] add AX,[0xFB0A] ;[XCoordinate]
; Êóðñîð íå äîëæåí âûõîäèòü çà ëåâóþ èëè ; Êóðñîð íå äîëæåí âûõîäèòü çà ëåâóþ èëè
; ïðàâóþ ãðàíèöó ýêðàíà ; ïðàâóþ ãðàíèöó ýêðàíà
@ -90,7 +90,7 @@ check_mouse_data_com1:
shl AL,4 shl AL,4
or AL,[ThirdByte] or AL,[ThirdByte]
cbw cbw
shl ax,1 call mouse_acceleration_com1
add AX,[0xFB0C] ;[YCoordinate] add AX,[0xFB0C] ;[YCoordinate]
; Êóðñîð íå äîëæåí âûõîäèòü çà âåðõíþþ èëè ; Êóðñîð íå äîëæåí âûõîäèòü çà âåðõíþþ èëè
; íèæíþþ ãðàíèöó ýêðàíà ; íèæíþþ ãðàíèöó ýêðàíà
@ -106,6 +106,8 @@ check_mouse_data_com1:
xor AX,AX xor AX,AX
@@Y2: @@Y2:
mov [0xFB0C],AX ;[YCoordinate] mov [0xFB0C],AX ;[YCoordinate]
mov eax,[timer_ticks]
mov [timer_ticks_com],eax
jmp @@EndMouseInterrupt jmp @@EndMouseInterrupt
@@Error: @@Error:
@ -116,3 +118,13 @@ check_mouse_data_com1:
call ready_for_next_irq call ready_for_next_irq
ret ret
mouse_acceleration_com1:
push eax
mov eax,[timer_ticks]
sub eax,[timer_ticks_com]
cmp eax,[mouse_delay]
pop eax
ja @f
shl ax,1
@@:
ret

View File

@ -4,7 +4,7 @@ MouseByteNumber_1 DB 0
FirstByte_1 DB 0 FirstByte_1 DB 0
SecondByte_1 DB 0 SecondByte_1 DB 0
ThirdByte_1 DB 0 ThirdByte_1 DB 0
timer_ticks_com_1 dd 0
;*************************************** ;***************************************
;* ÍÎÂÛÉ ÎÁÐÀÁÎÒ×ÈÊ ÏÐÅÐÛÂÀÍÈß ÎÒ ÌÛØÈ * ;* ÍÎÂÛÉ ÎÁÐÀÁÎÒ×ÈÊ ÏÐÅÐÛÂÀÍÈß ÎÒ ÌÛØÈ *
;*************************************** ;***************************************
@ -68,7 +68,7 @@ check_mouse_data_com2:
shl AL,6 shl AL,6
or AL,[SecondByte_1] or AL,[SecondByte_1]
cbw cbw
shl ax,1 call mouse_acceleration_com2
add AX,[0xFB0A] ;[XCoordinate] add AX,[0xFB0A] ;[XCoordinate]
; Êóðñîð íå äîëæåí âûõîäèòü çà ëåâóþ èëè ; Êóðñîð íå äîëæåí âûõîäèòü çà ëåâóþ èëè
; ïðàâóþ ãðàíèöó ýêðàíà ; ïðàâóþ ãðàíèöó ýêðàíà
@ -90,7 +90,7 @@ check_mouse_data_com2:
shl AL,4 shl AL,4
or AL,[ThirdByte_1] or AL,[ThirdByte_1]
cbw cbw
shl ax,1 call mouse_acceleration_com2
add AX,[0xFB0C] ;[YCoordinate] add AX,[0xFB0C] ;[YCoordinate]
; Êóðñîð íå äîëæåí âûõîäèòü çà âåðõíþþ èëè ; Êóðñîð íå äîëæåí âûõîäèòü çà âåðõíþþ èëè
; íèæíþþ ãðàíèöó ýêðàíà ; íèæíþþ ãðàíèöó ýêðàíà
@ -106,6 +106,8 @@ check_mouse_data_com2:
xor AX,AX xor AX,AX
@@Y2_1: @@Y2_1:
mov [0xFB0C],AX ;[YCoordinate] mov [0xFB0C],AX ;[YCoordinate]
mov eax,[timer_ticks]
mov [timer_ticks_com_1],eax
jmp @@EndMouseInterrupt_1 jmp @@EndMouseInterrupt_1
@@Error_1: @@Error_1:
@ -116,3 +118,13 @@ check_mouse_data_com2:
call ready_for_next_irq call ready_for_next_irq
ret ret
mouse_acceleration_com2:
push eax
mov eax,[timer_ticks]
sub eax,[timer_ticks_com_1]
cmp eax,[mouse_delay]
pop eax
ja @f
shl ax,1
@@:
ret

View File

@ -4,6 +4,7 @@ MouseByteNumber_2 DB 0
FirstByte_2 DB 0 FirstByte_2 DB 0
SecondByte_2 DB 0 SecondByte_2 DB 0
ThirdByte_2 DB 0 ThirdByte_2 DB 0
timer_ticks_ps2 dd 0
;************************************** ;**************************************
;* ОБРАБОТЧИК ПРЕРЫВАНИЯ ОТ МЫШИ PS/2 * ;* ОБРАБОТЧИК ПРЕРЫВАНИЯ ОТ МЫШИ PS/2 *
@ -53,7 +54,7 @@ check_mouse_data_ps2:
; Занести в AL младший байт ; Занести в AL младший байт
@@M0: @@M0:
mov AL,[SecondByte_2] mov AL,[SecondByte_2]
shl ax,1 call mouse_acceleration_ps2
; Вычислить новое значение координаты ; Вычислить новое значение координаты
; курсора по X ; курсора по X
add AX,[0xFB0A] ;[XCoordinate] add AX,[0xFB0A] ;[XCoordinate]
@ -79,7 +80,7 @@ check_mouse_data_ps2:
; Занести в AL младший байт ; Занести в AL младший байт
@@M3: @@M3:
mov AL,[ThirdByte_2] mov AL,[ThirdByte_2]
shl ax,1 call mouse_acceleration_ps2
; Вычислить новое значение координаты курсора ; Вычислить новое значение координаты курсора
; по Y (Y-координата мыши PS/2 направлена ; по Y (Y-координата мыши PS/2 направлена
; противоположно экранной) ; противоположно экранной)
@ -98,6 +99,8 @@ check_mouse_data_ps2:
mov [0xFB0C],AX ;[YCoordinate] mov [0xFB0C],AX ;[YCoordinate]
; Показать курсор в новой позиции ; Показать курсор в новой позиции
mov eax,[timer_ticks]
mov [timer_ticks_ps2],eax
jmp @@EndMouseInterrupt_2 jmp @@EndMouseInterrupt_2
; Обнаружен сбой в порядке передачи информации от мыши ; Обнаружен сбой в порядке передачи информации от мыши
@ -108,6 +111,16 @@ check_mouse_data_ps2:
call ready_for_next_irq_1 call ready_for_next_irq_1
ret ret
mouse_acceleration_ps2:
push eax
mov eax,[timer_ticks]
sub eax,[timer_ticks_ps2]
cmp eax,[mouse_delay]
pop eax
ja @f
imul ax,[mouse_speed_factor]
@@:
ret
;*********************************************** ;***********************************************
;* ОЖИДАНИЕ ОЧИСТКИ ВХОДНОГО БУФЕРА I8042 * ;* ОЖИДАНИЕ ОЧИСТКИ ВХОДНОГО БУФЕРА I8042 *
;* При выходе из процедуры: * ;* При выходе из процедуры: *

View File

@ -16,6 +16,9 @@ uglobal
mousedata dd 0x0 mousedata dd 0x0
endg endg
mouse_delay dd 10
mouse_speed_factor dw 3
include 'm_ps2.inc' include 'm_ps2.inc'
include 'm_com1.inc' include 'm_com1.inc'
include 'm_com2.inc' include 'm_com2.inc'

View File

@ -1972,7 +1972,9 @@ sys_system_table:
dd sysfn_centermouse ; 15 = center mouse cursor dd sysfn_centermouse ; 15 = center mouse cursor
dd sysfn_getfreemem ; 16 = get free memory size dd sysfn_getfreemem ; 16 = get free memory size
dd sysfn_getallmem ; 17 = get total memory size dd sysfn_getallmem ; 17 = get total memory size
dd sysfn_terminate2 ; 18 = terminate thread using PID instead of slot dd sysfn_terminate2 ; 18 = terminate thread using PID
; instead of slot
dd sysfn_mouse_acceleration; 19 = set/get mouse acceleration
sysfn_num = ($ - sys_system_table)/4 sysfn_num = ($ - sys_system_table)/4
endg endg
@ -2170,6 +2172,39 @@ sysfn_centermouse: ; 18.15 = mouse centered
mov [esp+36],dword 0 mov [esp+36],dword 0
ret ret
sysfn_mouse_acceleration: ; 18.19 = set/get mouse features
cmp ebx,0 ; get mouse speed factor
jnz .set_mouse_acceleration
xor eax,eax
mov ax,[mouse_speed_factor]
mov [esp+36],eax
ret
.set_mouse_acceleration:
cmp ebx,1 ; set mouse speed factor
jnz .get_mouse_delay
mov [mouse_speed_factor],cx
ret
.get_mouse_delay:
cmp ebx,2 ; get mouse delay
jnz .set_mouse_delay
mov eax,[mouse_delay]
mov [esp+36],eax
ret
.set_mouse_delay:
cmp ebx,3 ; set mouse delay
jnz .set_pointer_position
mov [mouse_delay],ecx
ret
.set_pointer_position:
cmp ebx,4 ; set mouse pointer position
jnz .end
mov [0xFB0C],cx ;y
ror ecx,16
mov [0xFB0A],cx ;x
rol ecx,16
.end:
ret
sysfn_getfreemem: sysfn_getfreemem:
mov eax,[MEM_FreeSpace] mov eax,[MEM_FreeSpace]
shl eax,2 shl eax,2

View File

@ -19,7 +19,7 @@
dd 0x4000 ; reguired amount of memory dd 0x4000 ; reguired amount of memory
dd 0x4000 ; stack pointer (esp) dd 0x4000 ; stack pointer (esp)
dd I_PARAM,0 ; parameters, reserved dd I_PARAM,0 ; parameters, reserved
include 'lang.inc' ; include 'lang.inc'
include 'macros.inc' include 'macros.inc'
;****************************************************************************** ;******************************************************************************
@ -29,13 +29,6 @@ BBB equ 25
;****************************************************************************** ;******************************************************************************
apply_all: apply_all:
mov eax,6 ; load saved settings from SETUP.DAT
mov ebx,filename
xor ecx,ecx
or edx,-1
mov esi,keyboard
int 0x40
call _midibase ;1 call _midibase ;1
call _sound_dma ;10 call _sound_dma ;10
call _pci_acc ;12 call _pci_acc ;12
@ -43,7 +36,7 @@ apply_all:
call _wssp ;6 call _wssp ;6
call _syslang ;5 call _syslang ;5
call _keyboard ;2 call _keyboard ;2
call _mouse
call get_disk_info call get_disk_info
cmp [cd],0 cmp [cd],0
jne no_cd jne no_cd
@ -171,6 +164,7 @@ hd db 0
cd db 0 cd db 0
;****************************************************************************** ;******************************************************************************
apply_all_and_exit: apply_all_and_exit:
mcall 70,read_fileinfo
call apply_all call apply_all
jmp close jmp close
@ -250,6 +244,8 @@ get_other:
mov [lba_read],eax mov [lba_read],eax
mcall 26,12 mcall 26,12
mov [pci_acc],eax mov [pci_acc],eax
mcall 18,19,0
mov [mouse_speed],eax
ret ret
;****************************************************************************** ;******************************************************************************
@ -261,18 +257,11 @@ START:
cmp [I_PARAM], 'LANG' cmp [I_PARAM], 'LANG'
je set_language_and_exit je set_language_and_exit
; mov eax,6 ; load saved settings from SETUP.DAT
; mov ebx,filename
; xor ecx,ecx
; or edx,-1
; mov esi,keyboard
; int 0x40
cmp [I_PARAM], 'BOOT' cmp [I_PARAM], 'BOOT'
je apply_all_and_exit je apply_all_and_exit
call loadtxt
call get_setup_values call get_setup_values
call loadtxt
red: red:
call draw_window call draw_window
@ -441,12 +430,7 @@ noseltime:
noseldate: noseldate:
cmp ah,99 cmp ah,99
jne nosaveall jne nosaveall
mov eax,33 mcall 70,save_fileinfo
mov ebx,filename
mov ecx,keyboard
mov edx,48
xor esi,esi
int 0x40
call settime call settime
mov dword [blinkpar],0 mov dword [blinkpar],0
call drawtime call drawtime
@ -704,7 +688,33 @@ close:
call draw_window call draw_window
call drawtime call drawtime
nosyss: nosyss:
cmp ah,132 ; SET MOUSE SPEED
jnz .nominus
mov eax,[mouse_speed]
sub eax,2
cmp eax,9
jb @f
mov eax,8
@@:
inc eax
mov [mouse_speed],eax
call draw_infotext
.nominus:
cmp ah,133
jnz .noplus
mov eax,[mouse_speed]
cmp eax,9
jb @f
mov eax,0
@@:
inc eax
mov [mouse_speed],eax
call draw_infotext
.noplus:
cmp ah,131
jnz .noapply
call _mouse
.noapply:
cmp ah,3 ; SET KEYMAP cmp ah,3 ; SET KEYMAP
jne still jne still
call _keyboard call _keyboard
@ -849,10 +859,10 @@ draw_window:
xor eax,eax ; DRAW WINDOW xor eax,eax ; DRAW WINDOW
mov ebx,40*65536+355+BBB mov ebx,40*65536+355+BBB
mov ecx,40*65536+300 mov ecx,40*65536+310
mov edx,0x82111199 mov edx,0x83111199
mov esi,0x805588dd ; mov esi,0x805588dd
mov edi,0x005588dd ; mov edi,0x005588dd
int 0x40 int 0x40
mov eax,4 mov eax,4
@ -863,19 +873,21 @@ draw_window:
je ruslabel je ruslabel
add edx,20 add edx,20
ruslabel: ruslabel:
mov esi,26 mov esi,19 ;26
int 0x40 int 0x40
mov eax,8 ; CLOSE BUTTON ; mov eax,8 ; CLOSE BUTTON
mov ebx,(355+BBB-19)*65536+12 ; mov ebx,(355+BBB-19)*65536+12
mov ecx,5*65536+12 ; mov ecx,5*65536+12
mov edx,1 ; mov edx,1
mov esi,0x005588dd ; mov esi,0x005588dd
int 0x40 ; int 0x40
; APPLY ALL
mov eax,8 ; APPLY ALL
mov ebx,(350-79)*65536+100 mov ebx,(350-79)*65536+100
mov ecx,251*65536+12 mov ecx,266*65536+12
mov edx,100 mov edx,100
mov esi,0x005588dd
int 0x40 int 0x40
add ecx,16*65536 ; SAVE ALL add ecx,16*65536 ; SAVE ALL
dec edx dec edx
@ -935,6 +947,10 @@ draw_window:
mov ecx,43+24*8 ; 24 mov ecx,43+24*8 ; 24
call draw_buttons call draw_buttons
mov edx,131
mov ecx,43+26*8 ; 26
call draw_buttons
call draw_infotext call draw_infotext
mov eax,12 mov eax,12
@ -1109,9 +1125,13 @@ draw_infotext:
call onoff ; PCI ACCESS call onoff ; PCI ACCESS
mov [text00+LLL*20+28],ebx mov [text00+LLL*20+28],ebx
mov eax,[mouse_speed] ; MOUSE ACSELERATION
add al,48
mov [text00+LLL*26+28],al
mov eax,13 mov eax,13
mov ebx,175*65536+85 mov ebx,175*65536+85
mov ecx,40*65536+205 mov ecx,40*65536+225
mov edx,0x80111199-19 mov edx,0x80111199-19
int 0x40 int 0x40
@ -1155,7 +1175,7 @@ draw_infotext:
mov eax,13 mov eax,13
mov ebx,175*65536+85 mov ebx,175*65536+85
mov ecx,40*65536+205 mov ecx,40*65536+225
mov edx,0x80111199-19 mov edx,0x80111199-19
int 0x40 int 0x40
@ -1303,10 +1323,18 @@ _syslang:
int 0x40 int 0x40
ret ret
_mouse:
mov eax,18
mov ebx,19
mov ecx,1
mov edx,[mouse_speed]
int 0x40
ret
loadtxt: loadtxt:
cld cld
mov edi,text00 mov edi,text00
mov ecx,428 mov ecx,458 ;28
cmp [syslang],4 cmp [syslang],4
jne norus jne norus
mov esi,textrus mov esi,textrus
@ -1378,8 +1406,6 @@ blinkpar: dd 0x0
time: dw 0x0 time: dw 0x0
date: dd 0x0 date: dd 0x0
filename: db 'SETUP DAT',0
textrus: textrus:
db '<27> §  MIDI ROLAND MPU-401 : 0x320 - + <20>ਬ¥­¨âì' db '<27> §  MIDI ROLAND MPU-401 : 0x320 - + <20>ਬ¥­¨âì'
@ -1408,8 +1434,10 @@ textrus:
db ' ' db ' '
db '‘¨á⥬­ ï ¤ â  (¬,¤,£) : 00/00/00 - + ‚ë¡®à ' db '‘¨á⥬­ ï ¤ â  (¬,¤,£) : 00/00/00 - + ‚ë¡®à '
db ' ' db ' '
db '‘ª®à®áâì ªãàá®à  ¬ëè¨ : 1 - + <20>ਬ¥­¨âì'
db ' '
db '<>ˆŒ€<C592>ˆ…: <20>ਬ¥­¨âì ¢á¥ ' db '<>ˆŒ€<C592>ˆ…: <20>ਬ¥­¨âì ¢á¥ '
db 'ˆ<CB86>Žœ‡“‰… „Ž<E28099> Š FAT-32 ŽŽ<E28099>Ž†<C5BD>Ž! ' db 'ˆ<CB86>Žœ‡“‰… „Ž<E28099> Š FAT ŽŽ<E28099>Ž†<C5BD>Žœž! '
db '<27>… ‡€<E280A1>“„œŽ•<C5BD><EFBFBD>ˆœ <20><E28098>Ž‰Šˆ ‘®åà ­¨âì ¢á¥ ' db '<27>… ‡€<E280A1>“„œŽ•<C5BD><EFBFBD>ˆœ <20><E28098>Ž‰Šˆ ‘®åà ­¨âì ¢á¥ '
db 'x' db 'x'
@ -1441,13 +1469,15 @@ texteng:
db ' ' db ' '
db 'SYSTEM DATE (M,D,Y) : 00/00/00 - + SELECT ' db 'SYSTEM DATE (M,D,Y) : 00/00/00 - + SELECT '
db ' ' db ' '
db 'Mouse pointer speed : 1 - + APPLY '
db ' '
db 'NOTE: APPLY ALL ' db 'NOTE: APPLY ALL '
db 'TEST FAT32 FUNCTIONS WITH EXTREME CARE ' db 'TEST FAT FUNCTIONS WITH EXTREME CARE '
db 'SAVE YOUR SETTINGS BEFORE QUIT MENUET SAVE ALL ' db 'SAVE YOUR SETTINGS BEFORE QUIT MENUET SAVE ALL '
db 'x' db 'x'
labelt: labelt:
db '<27><E28098>Ž‰Š€ “<E28098>Ž‰ MENUET DEVICE SETUP ' db '<27><E28098>Ž‰Š€ “<E28098>Ž‰ DEVICE SETUP '
hex db '0123456789ABCDEF' hex db '0123456789ABCDEF'
@ -1628,6 +1658,23 @@ ru_keymap_shift:
db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
read_fileinfo:
dd 0
dd 0
dd 0
dd 52
dd keyboard
db 0
dd file_name
save_fileinfo:
dd 2
dd 0
dd 0
dd 52
dd keyboard
file_name: db '/rd/1/setup.dat',0
I_PARAM dd 0 I_PARAM dd 0
keyboard dd 0x0 keyboard dd 0x0
@ -1642,7 +1689,7 @@ f32p dd 0x1
sound_dma dd 0x1 sound_dma dd 0x1
lba_read dd 0x1 lba_read dd 0x1
pci_acc dd 0x1 pci_acc dd 0x1
mouse_speed dd 0x3
text00: text00:
I_END: I_END: