Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1689 → Rev 1688

/kernel/branches/Kolibri-A/trunk/core/memory.inc
1089,8 → 1089,26
.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
jbe sys_sheduler
1210,24 → 1228,6
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
 
stdcall load_PE, [file]
/kernel/branches/Kolibri-A/trunk/core/heap.inc
635,8 → 635,7
pop esi ebx
ret
.fail:
xor eax, eax
mov [heap_mutex], eax
and [heap_mutex], 0
pop esi ebx
ret
endp
/kernel/branches/Kolibri-A/trunk/core/peload.inc
283,12 → 283,6
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', \
306,7 → 300,7
\
get_display, 'GetDisplay', \
set_screen, 'SetScreen', \
pci_api_drv, 'PciApi', \
pci_api, 'PciApi', \
pci_read8, 'PciRead8', \ ; stdcall
pci_read16, 'PciRead16', \ ; stdcall
pci_read32, 'PciRead32', \ ; stdcall
321,7 → 315,6
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'
 
/kernel/branches/Kolibri-A/trunk/core/exports.inc
22,10 → 22,6
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
95,11 → 91,7
dd szReservePortArea , r_f_port_area
dd szBoot_Log , boot_log
 
dd szMutexInit , mutex_init ;gcc fastcall
dd szMutexLock , mutex_lock ;gcc fastcall
dd szMutexUnlock , mutex_unlock ;gcc fastcall
 
dd szPciApi , pci_api_drv
dd szPciApi , pci_api
dd szPciRead32 , pci_read32
dd szPciRead16 , pci_read16
dd szPciRead8 , pci_read8
/kernel/branches/Kolibri-A/trunk/kernel.asm
553,13 → 553,6
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'
;!!!!!!!!!!!!!!!!!!!!!!!!!!
2055,13 → 2048,10
; cmp ecx,4 ; set mouse pointer position
dec ecx
jnz .set_mouse_button
cmp dx, word[Screen_Max_Y]
ja .end
 
mov [MOUSE_Y],dx ;y
ror edx,16
mov [MOUSE_X],dx ;x
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
2134,11 → 2124,15
iglobal
version_inf:
db 0,7,7,0 ; version 0.7.7.0
db 0 ;reserved
db UID_KOLIBRI
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
2594,10 → 2588,6
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
 
2730,6 → 2720,11
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
 
/kernel/branches/Kolibri-A/trunk/fs/fs_lfn.inc
795,7 → 795,7
xor eax, eax
ret
.big:
push ecx edx
push ecx
push -'0'
mov ecx, 10
@@:
810,7 → 810,7
add al, '0'
stosb
jnz @b
pop edx ecx
pop ecx
pop eax
inc eax
ret
/kernel/branches/Kolibri-A/trunk/docs/sysfuncs.txt
347,7 → 347,6
* 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
845,12 → 844,12
* function does not return value
Structure of the buffer:
db a,b,c,d for version a.b.c.d
db 0
db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
dd REV - kernel SVN revision number
For Kolibri 0.7.7.0 kernel:
db 0,7,7,0
For Kolibri 0.7.1.0 kernel:
db 0,7,0,0
db 2
dd 1657
dd 638
 
======================================================================
======= Function 18, subfunction 14 - wait for screen retrace. =======
1659,10 → 1658,58
Remarks:
* If the buffer is too small to hold all data, only first (edx-1)
bytes are copied and than terminating 0 is inserted.
* By default, current folder for the thread is "/rd/1".
* At process/thread creation the current folder will be inherited
 
======================================================================
=============== 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.
 
======================================================================
======= Function 35 - read the color of a pixel on the screen. =======
======================================================================
Parameters:
3374,6 → 3421,7
======================================================================
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:
3725,60 → 3773,8
* 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 ======
======================================================================
Parameters:
3817,7 → 3813,6
* 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.
4116,10 → 4111,6
* '/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
/kernel/branches/Kolibri-A/trunk/gui/window.inc
319,9 → 319,6
shl edi, 5
add edi, window_data
 
test [edi + WDATA.fl_wdrawn], 1
jz .exit
 
test [edi + WDATA.fl_wstate], WSTATE_MAXIMIZED
jnz .exit
 
395,7 → 392,6
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
mov byte [window_data + 0x20 + WDATA.cl_titlebar + 3], 1 ; desktop is not movable
push eax ecx
xor eax, eax
mov ecx, WIN_STACK
1040,10 → 1036,10
add edi, window_data
 
; can window change its height?
; only types 2 and 3 can be resized
mov dl, [edi + WDATA.fl_wstyle]
test dl, 2
jz .exit
and dl, 0x0f
cmp dl, 0x04
je .exit
 
; toggle normal/maximized window state
mov bl, [edi + WDATA.fl_wstate]
1226,33 → 1222,30
push eax ebx
 
; TODO: do we really need `draw_limits`?
; Yes, they are used by background drawing code.
mov ecx, [eax + BOX.left]
mov edx, [ebx + BOX.left]
cmp ecx, edx
jle @f
mov ecx, edx
xchg ecx, edx
@@: mov [draw_limits.left], ecx
mov ecx, [eax + BOX.left]
add ecx, [eax + BOX.width]
add edx, [ebx + BOX.width]
cmp ecx, edx
mov ecx, [eax + BOX.width]
cmp ecx, [ebx + BOX.width]
jae @f
mov ecx, edx
@@: mov [draw_limits.right], ecx
mov ecx, [ebx + BOX.width]
@@: add ecx, edx
mov [draw_limits.right], ecx
mov ecx, [eax + BOX.top]
mov edx, [ebx + BOX.top]
cmp ecx, edx
jle @f
mov ecx, edx
xchg ecx, edx
@@: mov [draw_limits.top], ecx
mov ecx, [eax + BOX.top]
add ecx, [eax + BOX.height]
add edx, [ebx + BOX.height]
cmp ecx, edx
mov ecx, [eax + BOX.height]
cmp ecx, [ebx + BOX.height]
jae @f
mov ecx, edx
@@: mov [draw_limits.bottom], ecx
mov ecx, [ebx + BOX.height]
@@: add ecx, edx
mov [draw_limits.bottom], ecx
 
; recalculate screen buffer at old position
push ebx
1440,7 → 1433,6
; was it already defined before?
test [edi + WDATA.fl_wdrawn], 1
jnz .set_client_box
or [edi + WDATA.fl_wdrawn], 1
 
; NOTE: commented out since doesn't provide necessary functionality
; anyway, to be reworked
/kernel/branches/Kolibri-A/trunk/gui/event.inc
7,13 → 7,6
 
$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 ?
452,7 → 445,7
xor eax,eax
ret
.IRQ:
;TODO: same thing as done for FlagAutoReset (BgrRedraw,Mouse,IPC,Stack,Debug)
;TODO: ñäåëàòü òàê æå, êàê è äëÿ FlagAutoReset (BgrRedraw,Mouse,IPC,Stack,Debug)
mov edx,[irq_owner+eax*4-64] ; eax==16+irq
cmp edx,[edi+TASKDATA.pid]
jne .loop
467,8 → 460,7
push eax
; If the window is captured and moved by the user, then no mouse events!!!
mov al, [mouse.active_sys_window.action]
and al, WINDOW_MOVE_AND_RESIZE_FLAGS
test al, al
test al, mouse.WINDOW_MOVE_FLAG
pop eax
jnz .loop
@@:
/kernel/branches/Kolibri-A/trunk/gui/mouse.inc
5,7 → 5,7
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
$Revision: 1532$
$Revision: -1 $
 
include 'mousepointer.inc'
 
/kernel/branches/Kolibri-A/trunk/drivers/vt823(x).asm
File deleted
\ No newline at end of file
/kernel/branches/Kolibri-A/trunk/drivers/emu10k1x.asm
File deleted
/kernel/branches/Kolibri-A/trunk/drivers/codec.inc
173,6 → 173,7
ret
 
 
 
align 16
ac_unknown db 'unknown manufacturer',13,10,0
ac_Realtek db 'Realtek Semiconductor',13,10,0
180,9 → 181,6
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
 
191,9 → 189,6
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
201,9 → 196,6
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
215,8 → 207,6
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
 
257,15 → 247,6
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
;Analog Devices
chip_AD1819 db 'AD1819 ',0dh,0ah,00h
277,8 → 258,6
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
314,13 → 293,3
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
 
/kernel/branches/Kolibri-A/trunk/drivers/infinity.asm
159,61 → 159,14
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_calls_end-srv_calls)/4
ja .fail
 
cmp eax, SND_CREATE_BUFF
ja @F
 
jmp [srv_calls+eax*4]
@@:
mov ebx, [edi+input]
mov edx, [ebx]
 
cmp [edx+STREAM.magic], 'WAVE'
jne .fail
 
cmp [edx+STREAM.size], STREAM.sizeof
jne .fail
 
jmp [srv_calls+eax*4]
.fail:
mov eax, -1
ret
 
align 4
.srv_getversion:
cmp eax, SRV_GETVERSION
jne @F
mov eax, [edi+output]
cmp [edi+out_size], 4
jne .fail
221,9 → 174,9
mov [eax], dword API_VERSION
xor eax, eax
ret
 
align 4
.snd_create_buff:
@@:
cmp eax, SND_CREATE_BUFF
jne @F
mov ebx, [edi+input]
stdcall CreateBuffer,[ebx],[ebx+4]
mov edi, [ioctl]
231,20 → 184,30
mov ecx, [ecx]
mov [ecx], ebx
ret
@@:
mov ebx, [edi+input]
mov edx, [ebx]
 
align 4
.snd_destroy_buff:
cmp [edx+STREAM.magic], 'WAVE'
jne .fail
 
cmp [edx+STREAM.size], STREAM_SIZE
jne .fail
 
cmp eax, SND_DESTROY_BUFF
jne @F
mov eax, edx
call DestroyBuffer
call DestroyBuffer ;edx= stream
ret
 
align 4
.snd_setformat:
@@:
cmp eax, SND_SETFORMAT
jne @F
stdcall SetFormat, edx,[ebx+4]
ret
@@:
cmp eax, SND_GETFORMAT
jne @F
 
align 4
.snd_getformat:
movzx eax, word [edx+STREAM.format]
mov ecx, [edi+output]
mov ecx, [ecx]
251,19 → 214,19
mov [ecx], eax
xor eax, eax
ret
 
align 4
.snd_reset:
@@:
cmp eax, SND_RESET
jne @F
stdcall ResetBuffer,edx,[ebx+4]
ret
 
align 4
.snd_setpos:
@@:
cmp eax, SND_SETPOS
jne @F
stdcall SetBufferPos,edx,[ebx+4]
ret
 
align 4
.snd_getpos:
@@:
cmp eax, SND_GETPOS
jne @F
stdcall GetBufferPos, edx
mov edi, [ioctl]
mov ecx, [edi+output]
270,48 → 233,34
mov ecx, [ecx]
mov [ecx], ebx
ret
 
align 4
.snd_setbuff:
@@:
cmp eax, SND_SETBUFF
jne @F
mov eax, [ebx+4]
stdcall set_buffer, edx,eax,[ebx+8],[ebx+12]
ret
 
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:
@@:
cmp eax, SND_SETVOLUME
jne @F
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
align 4
.snd_setpan:
@@:
cmp eax, SND_SETPAN
jne @F
stdcall SetBufferPan,edx,[ebx+4]
ret
 
align 4
.snd_getpan:
@@:
cmp eax, SND_GETPAN
jne @F
mov eax, [edx+STREAM.pan]
mov ebx, [edi+output]
mov ebx, [ebx]
318,9 → 267,28
mov [ebx], eax
xor eax, eax
ret
@@:
cmp eax, SND_OUT
jne @F
 
align 4
.snd_getbuffsize:
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
mov eax, [edx+STREAM.in_size]
mov ecx, [edi+output]
mov ecx, [ecx]
327,9 → 295,10
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
 
338,38 → 307,12
mov [ecx], ebx
xor eax, eax
ret
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
@@:
.fail:
or eax, -1
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
409,7 → 352,7
 
call GetPid
mov ebx, eax
mov eax, STREAM.sizeof
mov eax, STREAM_SIZE
 
call CreateObject
test eax, eax
469,6 → 412,7
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
499,21 → 443,13
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], ebx
mov [edi+STREAM.out_count], 0
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]
552,7 → 488,7
 
mov [ebx+STREAM.magic], 'WAVE'
mov [ebx+STREAM.destroy], DestroyBuffer.destroy
mov [ebx+STREAM.size], STREAM.sizeof
mov [ebx+STREAM.size], STREAM_SIZE
mov [ebx+STREAM.flags], SND_STOP
 
pushf
1103,7 → 1039,7
cmp [ebx+STREAM.magic], 'WAVE'
jne .next
 
cmp [ebx+STREAM.size], STREAM.sizeof
cmp [ebx+STREAM.size], STREAM_SIZE
jne .next
 
cmp [ebx+STREAM.flags], SND_PLAY;
1172,7 → 1108,7
cmp [edi+STREAM.magic], 'WAVE'
jne .next
 
cmp [edi+STREAM.size], STREAM.sizeof
cmp [edi+STREAM.size], STREAM_SIZE
jne .next
 
cmp [edi+STREAM.flags], SND_PLAY;
/kernel/branches/Kolibri-A/trunk/drivers/mixer.asm
87,7 → 87,7
endp
 
align 4
proc update_streams
proc update_stream
locals
stream_index dd ?
event rd 6
98,9 → 98,6
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
/kernel/branches/Kolibri-A/trunk/drivers/imports.inc
27,10 → 27,6
ReservePortArea,\
Boot_Log,\
\
MutexInit,\
MutexLock,\
MutexUnlock,\
\
PciApi,\
PciRead32,\
PciRead16,\
/kernel/branches/Kolibri-A/trunk/drivers/main.inc
91,8 → 91,6
SND_GETPAN equ 15
SND_GETBUFFSIZE equ 16
SND_GETFREESPACE equ 17
SND_SETTIMEBASE equ 18
SND_GETTIMESTAMP equ 19
 
struc STREAM
{
115,22 → 113,6
.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 ?
143,9 → 125,19
.l_amp_f dd ? ;float point left
.r_amp_f dd ? ;float point right
 
.sizeof:
.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 ?
}
 
STREAM_SIZE equ 36*4
FD_OFFSET equ 24
 
virtual at 0
/kernel/branches/Kolibri-A/trunk/hid/keyboard.inc
177,7 → 177,6
mov eax,VKEY_SCRLOCK
jmp .no_key.xor
@@:
xor ebx, ebx
test ch,ch
js .writekey
movzx eax,ch ; plain key
201,6 → 200,7
jz @f
mov bl,[keymap_alt+eax]
@@:
mov bh, 0
jmp .writekey
.modifier:
test ch, ch