forked from KolibriOS/kolibrios
SYNC WITH MAIN TRUNC: kernel-A updated to $1687
git-svn-id: svn://kolibrios.org@1689 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
fb9f6b3fef
commit
500832c01d
@ -22,6 +22,10 @@ iglobal
|
||||
szReservePortArea db 'ReservePortArea',0
|
||||
szBoot_Log db 'Boot_Log',0
|
||||
|
||||
szMutexInit db 'MutexInit',0
|
||||
szMutexLock db 'MutexLock',0
|
||||
szMutexUnlock db 'MutexUnlock',0
|
||||
|
||||
szPciApi db 'PciApi', 0
|
||||
szPciRead32 db 'PciRead32', 0
|
||||
szPciRead16 db 'PciRead16', 0
|
||||
@ -91,7 +95,11 @@ kernel_export:
|
||||
dd szReservePortArea , r_f_port_area
|
||||
dd szBoot_Log , boot_log
|
||||
|
||||
dd szPciApi , pci_api
|
||||
dd szMutexInit , mutex_init ;gcc fastcall
|
||||
dd szMutexLock , mutex_lock ;gcc fastcall
|
||||
dd szMutexUnlock , mutex_unlock ;gcc fastcall
|
||||
|
||||
dd szPciApi , pci_api_drv
|
||||
dd szPciRead32 , pci_read32
|
||||
dd szPciRead16 , pci_read16
|
||||
dd szPciRead8 , pci_read8
|
||||
|
@ -635,7 +635,8 @@ proc kernel_free stdcall, base:dword
|
||||
pop esi ebx
|
||||
ret
|
||||
.fail:
|
||||
and [heap_mutex], 0
|
||||
xor eax, eax
|
||||
mov [heap_mutex], eax
|
||||
pop esi ebx
|
||||
ret
|
||||
endp
|
||||
|
@ -1089,25 +1089,7 @@ sysfn_meminfo:
|
||||
.fail:
|
||||
or dword [esp+32], -1
|
||||
ret
|
||||
iglobal
|
||||
align 4
|
||||
f68call:
|
||||
dd f68.11 ; init_heap
|
||||
dd f68.12 ; user_alloc
|
||||
dd f68.13 ; user_free
|
||||
dd f68.14 ; get_event_ex
|
||||
dd f68.fail ;moved to f68.24
|
||||
dd f68.16 ; get_service
|
||||
dd f68.17 ; call_service
|
||||
dd f68.fail ;moved to f68.25
|
||||
dd f68.19 ; load_dll
|
||||
dd f68.20 ; user_realloc
|
||||
dd f68.21 ; load_driver
|
||||
dd f68.22 ; shmem_open
|
||||
dd f68.23 ; shmem_close
|
||||
dd f68.24
|
||||
dd f68.25
|
||||
endg
|
||||
|
||||
align 4
|
||||
f68:
|
||||
cmp ebx,4
|
||||
@ -1227,6 +1209,24 @@ f68:
|
||||
mov [esp+32], eax
|
||||
ret
|
||||
|
||||
align 4
|
||||
f68call:
|
||||
dd f68.11 ; init_heap
|
||||
dd f68.12 ; user_alloc
|
||||
dd f68.13 ; user_free
|
||||
dd f68.14 ; get_event_ex
|
||||
dd f68.fail ;moved to f68.24
|
||||
dd f68.16 ; get_service
|
||||
dd f68.17 ; call_service
|
||||
dd f68.fail ;moved to f68.25
|
||||
dd f68.19 ; load_dll
|
||||
dd f68.20 ; user_realloc
|
||||
dd f68.21 ; load_driver
|
||||
dd f68.22 ; shmem_open
|
||||
dd f68.23 ; shmem_close
|
||||
dd f68.24
|
||||
dd f68.25
|
||||
|
||||
align 4
|
||||
proc load_pe_driver stdcall, file:dword
|
||||
|
||||
|
@ -283,6 +283,12 @@ __exports:
|
||||
alloc_page, 'AllocPage', \ ; gcc ABI
|
||||
alloc_pages, 'AllocPages', \ ; stdcall
|
||||
commit_pages, 'CommitPages', \ ; eax, ebx, ecx
|
||||
\
|
||||
create_event, 'CreateEvent', \ ; ecx, esi
|
||||
raise_event, 'RaiseEvent', \ ; eax, ebx, edx, esi
|
||||
wait_event, 'WaitEvent', \ ; eax, ebx
|
||||
get_event_ex, 'GetEvent', \ ; edi
|
||||
\
|
||||
create_kernel_object, 'CreateObject', \
|
||||
create_ring_buffer, 'CreateRingBuffer', \ ; stdcall
|
||||
destroy_kernel_object, 'DestroyObject', \
|
||||
@ -300,7 +306,7 @@ __exports:
|
||||
\
|
||||
get_display, 'GetDisplay', \
|
||||
set_screen, 'SetScreen', \
|
||||
pci_api, 'PciApi', \
|
||||
pci_api_drv, 'PciApi', \
|
||||
pci_read8, 'PciRead8', \ ; stdcall
|
||||
pci_read16, 'PciRead16', \ ; stdcall
|
||||
pci_read32, 'PciRead32', \ ; stdcall
|
||||
@ -315,6 +321,7 @@ __exports:
|
||||
user_free, 'UserFree', \ ; stdcall
|
||||
unmap_pages, 'UnmapPages', \ ; eax, ecx
|
||||
sys_msg_board_str, 'SysMsgBoardStr', \
|
||||
get_timer_ticks, 'GetTimerTicks', \
|
||||
delay_hs, 'Delay', \ ; ebx
|
||||
set_mouse_data, 'SetMouseData'
|
||||
|
||||
|
@ -347,6 +347,7 @@ Returned value:
|
||||
* bit 0 (mask 1): window is maximized
|
||||
* bit 1 (mask 2): window is minimized to panel
|
||||
* bit 2 (mask 4): window is rolled up
|
||||
* +71 = +0x47: dword: event mask
|
||||
Remarks:
|
||||
* Slots are numbered starting from 1.
|
||||
* Returned value is not a total number of threads, because there
|
||||
@ -844,12 +845,12 @@ Returned value:
|
||||
* function does not return value
|
||||
Structure of the buffer:
|
||||
db a,b,c,d for version a.b.c.d
|
||||
db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
|
||||
db 0
|
||||
dd REV - kernel SVN revision number
|
||||
For Kolibri 0.7.1.0 kernel:
|
||||
db 0,7,0,0
|
||||
For Kolibri 0.7.7.0 kernel:
|
||||
db 0,7,7,0
|
||||
db 2
|
||||
dd 638
|
||||
dd 1657
|
||||
|
||||
======================================================================
|
||||
======= Function 18, subfunction 14 - wait for screen retrace. =======
|
||||
@ -1658,56 +1659,8 @@ Returned value:
|
||||
Remarks:
|
||||
* If the buffer is too small to hold all data, only first (edx-1)
|
||||
bytes are copied and than terminating 0 is inserted.
|
||||
|
||||
======================================================================
|
||||
=============== Function 32 - delete file from ramdisk. ==============
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 32 - function number
|
||||
* ebx = pointer to the filename
|
||||
Returned value:
|
||||
* eax = 0 - success; otherwise file system error code
|
||||
Remarks:
|
||||
* This function is obsolete; function 58 allows to fulfill
|
||||
the same operations with the extended possibilities.
|
||||
* The current implementation returns only values 0(success) and
|
||||
5(file not found).
|
||||
* The filename must be either in the format 8+3 characters
|
||||
(first 8 characters - name itself, last 3 - extension,
|
||||
the short names and extensions are supplemented with spaces),
|
||||
or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
|
||||
(name no more than 8 characters, dot, extension 3 characters
|
||||
supplemented if necessary by spaces).
|
||||
The filename must be written with capital letters. The terminating
|
||||
character with code 0 is not necessary (not ASCIIZ-string).
|
||||
* This function does not support folders on the ramdisk.
|
||||
|
||||
======================================================================
|
||||
================ Function 33 - write file to ramdisk. ================
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 33 - function number
|
||||
* ebx = pointer to the filename
|
||||
* ecx = pointer to data for writing
|
||||
* edx = number of bytes for writing
|
||||
* should be set esi=0
|
||||
Returned value:
|
||||
* eax = 0 - success, otherwise file system error code
|
||||
Remarks:
|
||||
* This function is obsolete; function 70 allows to fulfil
|
||||
the same operations with extended possibilities.
|
||||
* If esi contains non-zero value and selected file already exists,
|
||||
one more file with the same name will be created.
|
||||
* Otherwise file will be overwritten.
|
||||
* The filename must be either in the format 8+3 characters
|
||||
(first 8 characters - name itself, last 3 - extension,
|
||||
the short names and extensions are supplemented with spaces),
|
||||
or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
|
||||
(name no more than 8 characters, dot, extension 3 characters
|
||||
supplemented if necessary by spaces).
|
||||
The filename must be written with capital letters. The terminating
|
||||
character with code 0 is not necessary (not ASCIIZ-string).
|
||||
* This function does not support folders on the ramdisk.
|
||||
* By default, current folder for the thread is "/rd/1".
|
||||
* At process/thread creation the current folder will be inherited
|
||||
|
||||
======================================================================
|
||||
======= Function 35 - read the color of a pixel on the screen. =======
|
||||
@ -3421,7 +3374,6 @@ Remarks:
|
||||
======================================================================
|
||||
The input mode influences results of reading keys by function 2.
|
||||
When a program loads, ASCII input mode is set for it.
|
||||
If subfunction is not support then eax=-1.
|
||||
|
||||
-------------- Subfunction 1 - set keyboard input mode. --------------
|
||||
Parameters:
|
||||
@ -3773,6 +3725,58 @@ Remarks:
|
||||
* If ecx=0, the function frees memory block at edx and returns 0.
|
||||
* The contents of the block are unchanged up to the shorter of
|
||||
the new and old sizes.
|
||||
======================================================================
|
||||
======== Function 68, subfunction 22 - open named memory area. =======
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 68 - function number
|
||||
* ebx = 22 - subfunction number
|
||||
* ecx = area name. Maximum of 31 characters with terminating zero
|
||||
* edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
|
||||
* esi = flags for open and access:
|
||||
* SHM_OPEN = 0x00 - open existing memory area. If an area
|
||||
with such name does not exist, the function
|
||||
will return error code 5.
|
||||
* SHM_OPEN_ALWAYS = 0x04 - open existing or create new
|
||||
memory area.
|
||||
* SHM_CREATE = 0x08 - create new memory area. If an area
|
||||
with such name already exists, the function
|
||||
will return error code 10.
|
||||
* SHM_READ = 0x00 - only read access
|
||||
* SHM_WRITE = 0x01 - read and write access
|
||||
Returned value:
|
||||
* eax = pointer to memory area, 0 if error has occured
|
||||
* if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
|
||||
edx = 0 - success, otherwise - error code
|
||||
* if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
|
||||
edx = error code (if eax=0) or area size in bytes
|
||||
Error codes:
|
||||
* E_NOTFOUND = 5
|
||||
* E_ACCESS = 10
|
||||
* E_NOMEM = 30
|
||||
* E_PARAM = 33
|
||||
Remarks:
|
||||
* Before this call one must initialize process heap by call to
|
||||
subfunction 11.
|
||||
* If a new area is created, access flags set maximal rights
|
||||
for other processes. An attempt from other process to open
|
||||
with denied rights will fail with error code E_ACCESS.
|
||||
* The process which has created an area always has write access.
|
||||
|
||||
======================================================================
|
||||
======= Function 68, subfunction 23 - close named memory area. =======
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 68 - function number
|
||||
* ebx = 23 - subfunction number
|
||||
* ecx = area name. Maximum of 31 characters with terminating zero
|
||||
Returned value:
|
||||
* eax destroyed
|
||||
Remarks:
|
||||
* A memory area is physically freed (with deleting all data and
|
||||
freeing physical memory), when all threads which have opened
|
||||
this area will close it.
|
||||
* When thread is terminating, all opened by it areas are closed.
|
||||
|
||||
======================================================================
|
||||
====== Function 68, subfunction 24 - set new exceptions handler ======
|
||||
@ -3813,6 +3817,7 @@ Parameters:
|
||||
* edx = value of activity (0/1)
|
||||
Returned value:
|
||||
* eax = value of old activity for this signal (0/1)
|
||||
* eax = -1 - invalid signal number
|
||||
Remarks:
|
||||
* In current implementation, it is changed only exception mask for
|
||||
user exception handler, wich was previously set by subfunction 24.
|
||||
@ -4111,6 +4116,10 @@ Examples:
|
||||
* '/hd0/2/menuet/pics/tanzania.bmp',0
|
||||
* '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
|
||||
* '/sys/MySuperApp.ini',0
|
||||
Also function supports relative names. If the path begins not
|
||||
with '/', it is considered relative to a current folder. To get or
|
||||
set a current folder, use the function 30.
|
||||
|
||||
Available subfunctions:
|
||||
* subfunction 0 - read file
|
||||
* subfunction 1 - read folder
|
||||
|
@ -173,7 +173,6 @@ patch_AD:
|
||||
ret
|
||||
|
||||
|
||||
|
||||
align 16
|
||||
ac_unknown db 'unknown manufacturer',13,10,0
|
||||
ac_Realtek db 'Realtek Semiconductor',13,10,0
|
||||
@ -181,6 +180,9 @@ ac_Analog db 'Analog Devices',13,10,0
|
||||
ac_CMedia db 'C-Media Electronics',13,10,0
|
||||
ac_Cirrus db 'Cirrus Logic',13,10,0
|
||||
ac_Wolfson db 'Wolfson Microelectronics',13,10,0
|
||||
ac_VIA db 'VIA Technologies',13,10,0
|
||||
ac_SigmaTel db 'SigmaTel',13,10,0
|
||||
ac_eMicro db 'eMicro',13,10,0
|
||||
|
||||
chip_unknown db 'unknown codec id ', 0
|
||||
|
||||
@ -189,6 +191,9 @@ CHIP_REALTEK equ 0x414C4700
|
||||
CHIP_CMEDIA equ 0x434D4900
|
||||
CHIP_CIRRUS equ 0x43525900
|
||||
CHIP_WOLFSON equ 0x574D4C00
|
||||
CHIP_VIA equ 0x56494100
|
||||
CHIP_SIGMATEL equ 0x83847600
|
||||
CHIP_EMICRO equ 0x454D4300
|
||||
|
||||
align 16
|
||||
codecs dd CHIP_ANALOG, ac_Analog, chips_Analog
|
||||
@ -196,6 +201,9 @@ codecs dd CHIP_ANALOG, ac_Analog, chips_Analog
|
||||
dd CHIP_REALTEK,ac_Realtek, chips_Realtek
|
||||
dd CHIP_CIRRUS, ac_Cirrus, chips_Cirrus
|
||||
dd CHIP_WOLFSON,ac_Wolfson, chips_Wolfson
|
||||
dd CHIP_VIA, ac_VIA, chips_VIA
|
||||
dd CHIP_SIGMATEL, ac_SigmaTel, chips_SigmaTel
|
||||
dd CHIP_EMICRO, ac_eMicro, chips_eMicro
|
||||
dd 0
|
||||
|
||||
align 16
|
||||
@ -207,6 +215,8 @@ chips_Analog dd 0x03, chip_AD1819
|
||||
dd 0x62, chip_AD1887
|
||||
dd 0x63, chip_AD1886A
|
||||
dd 0x70, chip_AD1980
|
||||
dd 0x72, chip_AD1981A
|
||||
dd 0x74, chip_AD1981B
|
||||
dd 0x75, chip_AD1985
|
||||
dd 0xFF
|
||||
|
||||
@ -243,8 +253,17 @@ chips_Cirrus dd 0x00, chip_CS4297
|
||||
dd 0xFF
|
||||
|
||||
chips_Wolfson dd 0x00, chip_WM9700
|
||||
dd 0x03, chip_WM9703
|
||||
dd 0x04, chip_WM9704
|
||||
dd 0x03, chip_WM9703
|
||||
dd 0x04, chip_WM9704
|
||||
dd 0xFF
|
||||
|
||||
chips_VIA dd 0x61, chip_VIA1612A
|
||||
dd 0xFF
|
||||
|
||||
chips_SigmaTel dd 0x58, chip_STAC9758
|
||||
dd 0xFF
|
||||
|
||||
chips_eMicro dd 0x28, chip_EM28028
|
||||
dd 0xFF
|
||||
|
||||
align 16
|
||||
@ -258,6 +277,8 @@ chip_AD1886 db 'AD1886 ',0dh,0ah,00h
|
||||
chip_AD1886A db 'AD1886A',0dh,0ah,00h
|
||||
chip_AD1887 db 'AD1887 ',0dh,0ah,00h
|
||||
chip_AD1980 db 'AD1980 ',0dh,0ah,00h
|
||||
chip_AD1981A db 'AD1981A',0dh,0ah,00h
|
||||
chip_AD1981B db 'AD1981B',0dh,0ah,00h
|
||||
chip_AD1985 db 'AD1985 ',0dh,0ah,00h
|
||||
|
||||
;Realtek
|
||||
@ -290,6 +311,16 @@ chip_CS4291 db 'CS4291',13,10,0
|
||||
chip_CS4202 db 'CS4202',13,10,0
|
||||
|
||||
;Wolfson
|
||||
chip_WM9700 db 'WM9704',13,10,0
|
||||
chip_WM9703 db 'WM9703/9704',13,10,0
|
||||
chip_WM9704 db 'WM9704 (quad)',13,10,0
|
||||
chip_WM9700 db 'WM9704',13,10,0
|
||||
chip_WM9703 db 'WM9703/9704',13,10,0
|
||||
chip_WM9704 db 'WM9704 (quad)',13,10,0
|
||||
|
||||
;VIA
|
||||
chip_VIA1612A db 'VIA1612A',13,10,0
|
||||
|
||||
;SigmaTel
|
||||
chip_STAC9758 db 'STAC9758,59',13,10,0
|
||||
|
||||
;eMicro
|
||||
chip_EM28028 db 'EM28028',13,10,0
|
||||
|
||||
|
1166
kernel/branches/Kolibri-A/trunk/drivers/emu10k1x.asm
Normal file
1166
kernel/branches/Kolibri-A/trunk/drivers/emu10k1x.asm
Normal file
File diff suppressed because it is too large
Load Diff
@ -26,6 +26,10 @@ kernel_export \
|
||||
FpuRestore,\
|
||||
ReservePortArea,\
|
||||
Boot_Log,\
|
||||
\
|
||||
MutexInit,\
|
||||
MutexLock,\
|
||||
MutexUnlock,\
|
||||
\
|
||||
PciApi,\
|
||||
PciRead32,\
|
||||
|
@ -159,31 +159,44 @@ inp_size equ IOCTL.inp_size
|
||||
output equ IOCTL.output
|
||||
out_size equ IOCTL.out_size
|
||||
|
||||
|
||||
|
||||
align 4
|
||||
|
||||
srv_calls dd service_proc.srv_getversion ; 0
|
||||
dd service_proc.snd_create_buff ; 1
|
||||
dd service_proc.snd_destroy_buff ; 2
|
||||
dd service_proc.snd_setformat ; 3
|
||||
dd service_proc.snd_getformat ; 4
|
||||
dd service_proc.snd_reset ; 5
|
||||
dd service_proc.snd_setpos ; 6
|
||||
dd service_proc.snd_getpos ; 7
|
||||
dd service_proc.snd_setbuff ; 8
|
||||
dd service_proc.snd_out ; 9
|
||||
dd service_proc.snd_play ; 10
|
||||
dd service_proc.snd_stop ; 11
|
||||
dd service_proc.snd_setvolume ; 12
|
||||
dd service_proc.snd_getvolume ; 13
|
||||
dd service_proc.snd_setpan ; 14
|
||||
dd service_proc.snd_getpan ; 15
|
||||
dd service_proc.snd_getbuffsize ; 16
|
||||
dd service_proc.snd_getfreespace ; 17
|
||||
dd service_proc.snd_settimebase ; 18
|
||||
dd service_proc.snd_gettimestamp ; 19
|
||||
srv_calls_end:
|
||||
|
||||
proc service_proc stdcall, ioctl:dword
|
||||
|
||||
mov edi, [ioctl]
|
||||
mov eax, [edi+io_code]
|
||||
|
||||
cmp eax, SRV_GETVERSION
|
||||
jne @F
|
||||
mov eax, [edi+output]
|
||||
cmp [edi+out_size], 4
|
||||
jne .fail
|
||||
mov eax, [eax]
|
||||
mov [eax], dword API_VERSION
|
||||
xor eax, eax
|
||||
ret
|
||||
@@:
|
||||
cmp eax, (srv_calls_end-srv_calls)/4
|
||||
ja .fail
|
||||
|
||||
cmp eax, SND_CREATE_BUFF
|
||||
jne @F
|
||||
mov ebx, [edi+input]
|
||||
stdcall CreateBuffer,[ebx],[ebx+4]
|
||||
mov edi, [ioctl]
|
||||
mov ecx, [edi+output]
|
||||
mov ecx, [ecx]
|
||||
mov [ecx], ebx
|
||||
ret
|
||||
ja @F
|
||||
|
||||
jmp [srv_calls+eax*4]
|
||||
@@:
|
||||
mov ebx, [edi+input]
|
||||
mov edx, [ebx]
|
||||
@ -191,114 +204,132 @@ proc service_proc stdcall, ioctl:dword
|
||||
cmp [edx+STREAM.magic], 'WAVE'
|
||||
jne .fail
|
||||
|
||||
cmp [edx+STREAM.size], STREAM_SIZE
|
||||
cmp [edx+STREAM.size], STREAM.sizeof
|
||||
jne .fail
|
||||
|
||||
cmp eax, SND_DESTROY_BUFF
|
||||
jne @F
|
||||
mov eax, edx
|
||||
call DestroyBuffer ;edx= stream
|
||||
jmp [srv_calls+eax*4]
|
||||
.fail:
|
||||
mov eax, -1
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_SETFORMAT
|
||||
jne @F
|
||||
stdcall SetFormat,edx,[ebx+4]
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_GETFORMAT
|
||||
jne @F
|
||||
|
||||
align 4
|
||||
.srv_getversion:
|
||||
mov eax, [edi+output]
|
||||
cmp [edi+out_size], 4
|
||||
jne .fail
|
||||
mov eax, [eax]
|
||||
mov [eax], dword API_VERSION
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
align 4
|
||||
.snd_create_buff:
|
||||
mov ebx, [edi+input]
|
||||
stdcall CreateBuffer,[ebx],[ebx+4]
|
||||
mov edi, [ioctl]
|
||||
mov ecx, [edi+output]
|
||||
mov ecx, [ecx]
|
||||
mov [ecx], ebx
|
||||
ret
|
||||
|
||||
align 4
|
||||
.snd_destroy_buff:
|
||||
mov eax, edx
|
||||
call DestroyBuffer
|
||||
ret
|
||||
|
||||
align 4
|
||||
.snd_setformat:
|
||||
stdcall SetFormat, edx,[ebx+4]
|
||||
ret
|
||||
|
||||
align 4
|
||||
.snd_getformat:
|
||||
movzx eax, word [edx+STREAM.format]
|
||||
mov ecx, [edi+output]
|
||||
mov ecx, [ecx]
|
||||
mov [ecx], eax
|
||||
xor eax, eax
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_RESET
|
||||
jne @F
|
||||
|
||||
align 4
|
||||
.snd_reset:
|
||||
stdcall ResetBuffer,edx,[ebx+4]
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_SETPOS
|
||||
jne @F
|
||||
|
||||
align 4
|
||||
.snd_setpos:
|
||||
stdcall SetBufferPos,edx,[ebx+4]
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_GETPOS
|
||||
jne @F
|
||||
|
||||
align 4
|
||||
.snd_getpos:
|
||||
stdcall GetBufferPos, edx
|
||||
mov edi, [ioctl]
|
||||
mov ecx, [edi+output]
|
||||
mov ecx, [ecx]
|
||||
mov [ecx], ebx
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_SETBUFF
|
||||
jne @F
|
||||
|
||||
align 4
|
||||
.snd_setbuff:
|
||||
mov eax, [ebx+4]
|
||||
stdcall set_buffer, edx,eax,[ebx+8],[ebx+12]
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_SETVOLUME
|
||||
jne @F
|
||||
|
||||
align 4
|
||||
.snd_out:
|
||||
mov eax, [ebx+4]
|
||||
stdcall wave_out, edx,eax,[ebx+8]
|
||||
ret
|
||||
|
||||
align 4
|
||||
.snd_play:
|
||||
stdcall play_buffer, edx,[ebx+4]
|
||||
ret
|
||||
|
||||
align 4
|
||||
.snd_stop:
|
||||
stdcall stop_buffer, edx
|
||||
ret
|
||||
|
||||
align 4
|
||||
.snd_setvolume:
|
||||
stdcall SetBufferVol,edx,[ebx+4],[ebx+8]
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_GETVOLUME
|
||||
jne @F
|
||||
|
||||
align 4
|
||||
.snd_getvolume:
|
||||
mov eax, [edi+output]
|
||||
mov ecx, [eax]
|
||||
mov eax, [eax+4]
|
||||
stdcall GetBufferVol,edx,ecx,eax
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_SETPAN
|
||||
jne @F
|
||||
align 4
|
||||
.snd_setpan:
|
||||
stdcall SetBufferPan,edx,[ebx+4]
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_GETPAN
|
||||
jne @F
|
||||
|
||||
align 4
|
||||
.snd_getpan:
|
||||
mov eax, [edx+STREAM.pan]
|
||||
mov ebx, [edi+output]
|
||||
mov ebx, [ebx]
|
||||
mov [ebx], eax
|
||||
xor eax, eax
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_OUT
|
||||
jne @F
|
||||
|
||||
mov eax, [ebx+4]
|
||||
stdcall wave_out, edx,eax,[ebx+8]
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_PLAY
|
||||
jne @F
|
||||
|
||||
stdcall play_buffer, edx,[ebx+4]
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_STOP
|
||||
jne @F
|
||||
|
||||
stdcall stop_buffer, edx
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_GETBUFFSIZE
|
||||
jne @F
|
||||
align 4
|
||||
.snd_getbuffsize:
|
||||
mov eax, [edx+STREAM.in_size]
|
||||
mov ecx, [edi+output]
|
||||
mov ecx, [ecx]
|
||||
mov [ecx], eax
|
||||
xor eax, eax
|
||||
ret
|
||||
@@:
|
||||
cmp eax, SND_GETFREESPACE
|
||||
jne @F
|
||||
|
||||
align 4
|
||||
.snd_getfreespace:
|
||||
test [edx+STREAM.format], PCM_OUT
|
||||
jz .fail
|
||||
|
||||
@ -307,12 +338,38 @@ proc service_proc stdcall, ioctl:dword
|
||||
mov [ecx], ebx
|
||||
xor eax, eax
|
||||
ret
|
||||
@@:
|
||||
.fail:
|
||||
or eax, -1
|
||||
align 4
|
||||
.snd_settimebase:
|
||||
cmp [edi+inp_size], 8
|
||||
jne .fail
|
||||
|
||||
mov edi, [edi+input]
|
||||
mov eax, [edi]
|
||||
mov ebx, [edi+4]
|
||||
mov dword [edx+STREAM.time_base], eax
|
||||
mov dword [edx+STREAM.time_base+4], ebx
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
.snd_gettimestamp:
|
||||
cmp [edi+out_size], 8
|
||||
jne .fail
|
||||
|
||||
mov edi, [edi+output]
|
||||
|
||||
push 48
|
||||
emms
|
||||
fild qword [edx+STREAM.time_stamp]
|
||||
fidiv dword [esp]
|
||||
fadd qword [edx+STREAM.time_base]
|
||||
fstp qword [edi]
|
||||
add esp, 4
|
||||
|
||||
xor eax, eax
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
restore handle
|
||||
restore io_code
|
||||
restore input
|
||||
@ -352,7 +409,7 @@ proc CreateBuffer stdcall, format:dword, size:dword
|
||||
|
||||
call GetPid
|
||||
mov ebx, eax
|
||||
mov eax, STREAM_SIZE
|
||||
mov eax, STREAM.sizeof
|
||||
|
||||
call CreateObject
|
||||
test eax, eax
|
||||
@ -412,7 +469,6 @@ proc CreateBuffer stdcall, format:dword, size:dword
|
||||
mov [edi+STREAM.in_base], eax
|
||||
mov [edi+STREAM.in_size], ecx
|
||||
add eax, 128
|
||||
; sub ecx, 128
|
||||
mov [edi+STREAM.in_wp], eax
|
||||
mov [edi+STREAM.in_rp], eax
|
||||
mov [edi+STREAM.in_count], 0
|
||||
@ -443,13 +499,21 @@ proc CreateBuffer stdcall, format:dword, size:dword
|
||||
stdcall AllocKernelSpace, dword 128*1024
|
||||
|
||||
mov edi, [str]
|
||||
xor ebx, ebx
|
||||
|
||||
mov [edi+STREAM.out_base], eax
|
||||
mov [edi+STREAM.out_wp], eax
|
||||
mov [edi+STREAM.out_rp], eax
|
||||
mov [edi+STREAM.out_count], 0
|
||||
mov [edi+STREAM.out_count], ebx
|
||||
add eax, 64*1024
|
||||
mov [edi+STREAM.out_top], eax
|
||||
|
||||
mov dword [edi+STREAM.time_base], ebx
|
||||
mov dword [edi+STREAM.time_base+4], ebx
|
||||
|
||||
mov dword [edi+STREAM.time_stamp], ebx
|
||||
mov dword [edi+STREAM.time_stamp+4], ebx
|
||||
|
||||
stdcall AllocPages, dword 64/4
|
||||
mov edi, [str]
|
||||
mov ebx, [edi+STREAM.out_base]
|
||||
@ -488,7 +552,7 @@ proc CreateBuffer stdcall, format:dword, size:dword
|
||||
|
||||
mov [ebx+STREAM.magic], 'WAVE'
|
||||
mov [ebx+STREAM.destroy], DestroyBuffer.destroy
|
||||
mov [ebx+STREAM.size], STREAM_SIZE
|
||||
mov [ebx+STREAM.size], STREAM.sizeof
|
||||
mov [ebx+STREAM.flags], SND_STOP
|
||||
|
||||
pushf
|
||||
@ -1039,7 +1103,7 @@ do_mix_list:
|
||||
cmp [ebx+STREAM.magic], 'WAVE'
|
||||
jne .next
|
||||
|
||||
cmp [ebx+STREAM.size], STREAM_SIZE
|
||||
cmp [ebx+STREAM.size], STREAM.sizeof
|
||||
jne .next
|
||||
|
||||
cmp [ebx+STREAM.flags], SND_PLAY;
|
||||
@ -1108,7 +1172,7 @@ prepare_playlist:
|
||||
cmp [edi+STREAM.magic], 'WAVE'
|
||||
jne .next
|
||||
|
||||
cmp [edi+STREAM.size], STREAM_SIZE
|
||||
cmp [edi+STREAM.size], STREAM.sizeof
|
||||
jne .next
|
||||
|
||||
cmp [edi+STREAM.flags], SND_PLAY;
|
||||
|
@ -91,6 +91,8 @@ SND_SETPAN equ 14
|
||||
SND_GETPAN equ 15
|
||||
SND_GETBUFFSIZE equ 16
|
||||
SND_GETFREESPACE equ 17
|
||||
SND_SETTIMEBASE equ 18
|
||||
SND_GETTIMESTAMP equ 19
|
||||
|
||||
struc STREAM
|
||||
{
|
||||
@ -113,6 +115,22 @@ struc STREAM
|
||||
.out_count dd ?
|
||||
.out_top dd ? ;16*4
|
||||
|
||||
.in_base dd ?
|
||||
.in_size dd ?
|
||||
.in_wp dd ?
|
||||
.in_rp dd ?
|
||||
.in_count dd ?
|
||||
.in_free dd ?
|
||||
.in_top dd ?
|
||||
|
||||
align 8
|
||||
|
||||
.time_base dq ?
|
||||
.time_stamp dq ?
|
||||
|
||||
.notify_event dd ?
|
||||
.notify_id dd ?
|
||||
|
||||
.r_size dd ?
|
||||
.r_dt dd ?
|
||||
.r_silence dd ?
|
||||
@ -125,19 +143,9 @@ struc STREAM
|
||||
.l_amp_f dd ? ;float point left
|
||||
.r_amp_f dd ? ;float point right
|
||||
|
||||
.in_base dd ?
|
||||
.in_size dd ?
|
||||
.in_wp dd ?
|
||||
.in_rp dd ?
|
||||
.in_count dd ?
|
||||
.in_free dd ?
|
||||
.in_top dd ?
|
||||
|
||||
.notify_event dd ?
|
||||
.notify_id dd ?
|
||||
.sizeof:
|
||||
}
|
||||
|
||||
STREAM_SIZE equ 36*4
|
||||
FD_OFFSET equ 24
|
||||
|
||||
virtual at 0
|
||||
|
@ -87,7 +87,7 @@ end if
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc update_stream
|
||||
proc update_streams
|
||||
locals
|
||||
stream_index dd ?
|
||||
event rd 6
|
||||
@ -98,6 +98,9 @@ proc update_stream
|
||||
mov edx, [stream_index]
|
||||
mov esi, [play_list+edx*4]
|
||||
|
||||
add dword [esi+STREAM.time_stamp], 4096
|
||||
adc dword [esi+STREAM.time_stamp+4], 0
|
||||
|
||||
mov eax, [esi+STREAM.out_rp]
|
||||
cmp eax, [esi+STREAM.out_top]
|
||||
jb @f
|
||||
|
1281
kernel/branches/Kolibri-A/trunk/drivers/vt823(x).asm
Normal file
1281
kernel/branches/Kolibri-A/trunk/drivers/vt823(x).asm
Normal file
File diff suppressed because it is too large
Load Diff
@ -795,7 +795,7 @@ biosdisk_enum_root:
|
||||
xor eax, eax
|
||||
ret
|
||||
.big:
|
||||
push ecx
|
||||
push ecx edx
|
||||
push -'0'
|
||||
mov ecx, 10
|
||||
@@:
|
||||
@ -810,7 +810,7 @@ biosdisk_enum_root:
|
||||
add al, '0'
|
||||
stosb
|
||||
jnz @b
|
||||
pop ecx
|
||||
pop edx ecx
|
||||
pop eax
|
||||
inc eax
|
||||
ret
|
||||
|
@ -7,6 +7,13 @@
|
||||
|
||||
$Revision$
|
||||
|
||||
WINDOW_MOVE_AND_RESIZE_FLAGS = \
|
||||
mouse.WINDOW_RESIZE_N_FLAG + \
|
||||
mouse.WINDOW_RESIZE_W_FLAG + \
|
||||
mouse.WINDOW_RESIZE_S_FLAG + \
|
||||
mouse.WINDOW_RESIZE_E_FLAG + \
|
||||
mouse.WINDOW_MOVE_FLAG
|
||||
|
||||
uglobal
|
||||
align 4
|
||||
event_start dd ?
|
||||
@ -445,7 +452,7 @@ get_event_for_app: ;; used from f10,f11,f23
|
||||
xor eax,eax
|
||||
ret
|
||||
.IRQ:
|
||||
;TODO: ñäåëàòü òàê æå, êàê è äëÿ FlagAutoReset (BgrRedraw,Mouse,IPC,Stack,Debug)
|
||||
;TODO: same thing as done for FlagAutoReset (BgrRedraw,Mouse,IPC,Stack,Debug)
|
||||
mov edx,[irq_owner+eax*4-64] ; eax==16+irq
|
||||
cmp edx,[edi+TASKDATA.pid]
|
||||
jne .loop
|
||||
@ -460,8 +467,9 @@ get_event_for_app: ;; used from f10,f11,f23
|
||||
push eax
|
||||
; If the window is captured and moved by the user, then no mouse events!!!
|
||||
mov al, [mouse.active_sys_window.action]
|
||||
test al, mouse.WINDOW_MOVE_FLAG
|
||||
pop eax
|
||||
and al, WINDOW_MOVE_AND_RESIZE_FLAGS
|
||||
test al, al
|
||||
pop eax
|
||||
jnz .loop
|
||||
@@:
|
||||
btr [ebx+APPDATA.event_mask],eax
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -177,6 +177,7 @@ irq1:
|
||||
mov eax,VKEY_SCRLOCK
|
||||
jmp .no_key.xor
|
||||
@@:
|
||||
xor ebx, ebx
|
||||
test ch,ch
|
||||
js .writekey
|
||||
movzx eax,ch ; plain key
|
||||
@ -200,7 +201,6 @@ irq1:
|
||||
jz @f
|
||||
mov bl,[keymap_alt+eax]
|
||||
@@:
|
||||
mov bh, 0
|
||||
jmp .writekey
|
||||
.modifier:
|
||||
test ch, ch
|
||||
|
@ -553,6 +553,13 @@ v20ga32:
|
||||
mov al, 0x3F
|
||||
out 0xA1, al
|
||||
|
||||
; Enable interrupts in IDE controller
|
||||
mov al, 0
|
||||
mov dx, 0x3F6
|
||||
out dx, al
|
||||
mov dl, 0x76
|
||||
out dx, al
|
||||
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
include 'detect/disks.inc'
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
@ -2048,10 +2055,13 @@ sysfn_mouse_acceleration: ; 18.19 = set/get mouse features
|
||||
; cmp ecx,4 ; set mouse pointer position
|
||||
dec ecx
|
||||
jnz .set_mouse_button
|
||||
mov [MOUSE_Y],dx ;y
|
||||
ror edx,16
|
||||
mov [MOUSE_X],dx ;x
|
||||
cmp dx, word[Screen_Max_Y]
|
||||
ja .end
|
||||
|
||||
rol edx,16
|
||||
cmp dx, word[Screen_Max_X]
|
||||
ja .end
|
||||
mov [MOUSE_X], edx
|
||||
ret
|
||||
.set_mouse_button:
|
||||
; cmp ecx,5 ; set mouse button features
|
||||
@ -2124,15 +2134,11 @@ endg
|
||||
iglobal
|
||||
version_inf:
|
||||
db 0,7,7,0 ; version 0.7.7.0
|
||||
db UID_KOLIBRI
|
||||
db 0 ;reserved
|
||||
dd __REV__
|
||||
version_end:
|
||||
endg
|
||||
|
||||
UID_NONE=0
|
||||
UID_MENUETOS=1 ;official
|
||||
UID_KOLIBRI=2 ;russian
|
||||
|
||||
sys_cachetodiskette:
|
||||
cmp ebx, 1
|
||||
jne .no_floppy_a_save
|
||||
@ -2588,6 +2594,10 @@ sys_cpuusage:
|
||||
mov al, [ecx+window_data+WDATA.fl_wstate]
|
||||
stosb
|
||||
|
||||
; Event mask (+71)
|
||||
mov EAX, dword [ECX+CURRENT_TASK+TASKDATA.event_mask]
|
||||
stosd
|
||||
|
||||
pop esi
|
||||
pop edi
|
||||
|
||||
@ -2720,11 +2730,6 @@ sys_redrawstat:
|
||||
mov eax, [Screen_Max_Y]
|
||||
mov [edx + RECT.bottom], eax
|
||||
|
||||
mov edi, [TASK_BASE]
|
||||
or [edi - twdw + WDATA.fl_wdrawn], 1 ; no new position & buttons from app
|
||||
call sys_window_mouse
|
||||
ret
|
||||
|
||||
srl1:
|
||||
ret
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user