Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 280 → Rev 281

/kernel/trunk/drivers/ati2d.asm
2,6 → 2,7
format MS COFF
 
include 'proc32.inc'
include 'imports.inc'
 
DEBUG equ 1
 
33,11 → 34,16
end virtual
 
struc CURSOR
{ .magic dd ?
.size dd ?
.pid dd ?
.base dd ?
.hot_x dd ?
{;common object header
.magic dd ? ;'CURS'
.destroy dd ? ;internal destructor
.fd dd ? ;next object in list
.bk dd ? ;prev object in list
.pid dd ? ;owner id
 
;cursor data
.base dd ? ;allocated memory
.hot_x dd ? ;hotspot coords
.hot_y dd ?
}
virtual at 0
44,7 → 50,7
CURSOR CURSOR
end virtual
 
CURSOR_SIZE equ 24
CURSOR_SIZE equ 32
 
R8500 equ 0x514C ;R200
R9000 equ 0x4966 ;RV250
155,18 → 161,6
public service_proc
public version
 
extrn SysMsgBoardStr
extrn PciApi
extrn PciRead32
extrn AllocKernelSpace
extrn MapPage
extrn RegService
extrn SetHwCursor
extrn HwCursorRestore
extrn HwCursorCreate
extrn LFBAddress
extrn LoadFile
 
CURSOR_IMAGE_OFFSET equ 0x00500000
 
DRV_ENTRY equ 1
192,18 → 186,12
test eax, eax
jz .fail
 
xor eax, eax
mov edi, cursors
mov ecx, CURSOR_SIZE*16
cld
rep stosd
 
not eax
or eax, -1
mov [cursor_map], eax
mov [cursor_map+4], eax
mov edx, cursor_map
mov [cursor_start], edx
add edx, 4
add edx, 8
mov [cursor_end], edx
 
stdcall RegService, sz_ati_srv, service_proc
457,16 → 445,41
popfd
ret
 
; param
; eax= pid
; ebx= src
; ecx= flags
 
align 4
proc ati_cursor stdcall, hcursor:dword, src:dword, flags:dword
ati_cursor:
.src equ esp
.flags equ esp+4
.hcursor equ esp+8
 
stdcall video_alloc
sub esp, 4 ;space for .hcursor
push ecx
push ebx
 
mov edi, [hcursor]
mov ebx, eax
mov eax, CURSOR_SIZE
call CreateObject
test eax, eax
jz .fail
 
mov [.hcursor],eax
 
xor ebx, ebx
mov [eax+CURSOR.magic], 'CURS'
mov [eax+CURSOR.destroy], destroy_cursor
mov [eax+CURSOR.hot_x], ebx
mov [eax+CURSOR.hot_y], ebx
 
call video_alloc
mov edi, [.hcursor]
mov [edi+CURSOR.base], eax
 
mov esi, [src]
mov ebx, [flags]
mov esi, [.src]
mov ebx, [.flags]
cmp bx, LOAD_INDIRECT
je .indirect
 
476,8 → 489,9
mov [edi+CURSOR.hot_y], edx
 
stdcall ati_init_cursor, eax, esi
mov eax, [hcursor]
mov eax, [.hcursor]
.fail:
add esp, 12
ret
.indirect:
shr ebx, 16
486,14 → 500,15
mov [edi+CURSOR.hot_x], ecx
mov [edi+CURSOR.hot_y], edx
 
xchg edi, eax
push edi
mov edi, eax
mov ebx, eax
mov ecx, 64*64
xor eax,eax
cld
rep stosd
mov edi, ebx
 
mov esi, [src]
pop edi
mov esi, [.src]
mov ebx, 32
cld
@@:
502,11 → 517,22
add edi, 128
dec ebx
jnz @B
mov eax, [hcursor]
mov eax, [.hcursor]
add esp, 12
ret
endp
 
align 4
destroy_cursor:
 
push eax
mov eax, [eax+CURSOR.base]
call video_free
pop eax
 
call DestroyObject
ret
 
align 4
proc ati_init_cursor stdcall, dst:dword, src:dword
locals
rBase dd ?
955,7 → 981,7
dd (R9800XT shl 16)+VID_ATI
dd 0 ;terminator
 
version dd 0x00010001
version dd 0x00020002
 
sz_ati_srv db 'HWCURSOR',0
 
970,7 → 996,6
 
pCursor db 4096 dup(?)
 
cursors rb CURSOR_SIZE*64
cursor_map rd 2
cursor_start rd 1
cursor_end rd 1
/kernel/trunk/drivers/infinity.asm
17,6 → 17,7
 
include 'proc32.inc'
include 'main.inc'
include 'imports.inc'
 
DEBUG equ 1
 
30,25 → 31,6
public service_proc
public version
 
extrn AttachIntHandler
extrn SysMsgBoardStr
extrn PciApi
extrn PciRead32
extrn PciRead8
extrn PciWrite8
extrn AllocKernelSpace
extrn MapPage
extrn RegService
extrn KernelAlloc
extrn KernelFree
extrn GetPgAddr
extrn GetCurrentTask
extrn GetService
extrn ServiceHandler
extrn FpuSave
extrn FpuRestore
extrn SendEvent
 
SND_CREATE_BUFF equ 2
SND_PLAY equ 3
SND_STOP equ 4
212,13 → 194,17
 
mov edi, [str]
mov [edi+STREAM.base], eax
mov [edi+STREAM.seg_0], eax
mov [edi+STREAM.curr_seg], eax
mov [edi+STREAM.notify_off1], eax
add eax, 0x8000
add eax, 0x7FFF
mov [edi+STREAM.lim_0], eax
inc eax
mov [edi+STREAM.seg_1], eax
mov [edi+STREAM.notify_off2], eax
add eax, 0x7FFF
mov [edi+STREAM.limit], eax
 
mov [edi+STREAM.lim_1], eax
inc eax
 
mov [edi+STREAM.work_buff], eax
266,7 → 252,6
 
mov eax, [str]
ret
 
.fail:
xor eax, eax
ret
367,7 → 352,7
mov [ebx+STREAM.work_write], eax
mov [ebx+STREAM.work_count], 0
 
mov eax, [ebx+STREAM.base]
mov eax, [ebx+STREAM.seg_0]
mov [ebx+STREAM.curr_seg], eax
 
mov esi, [ebx+STREAM.curr_seg]
520,6 → 505,7
ret
endp
 
if 0
align 4
proc check_stream
 
529,11 → 515,15
mov esi, [play_list+edx]
 
mov eax, [esi+STR.curr_seg]
cmp eax, [esi+STR.limit]
cmp eax, [esi+STR.lim_0]
jb .next
 
.m1:
mov eax,[esi+STR.base]
mov eax, [esi+STREAM.seg_0]
mov ecx, [esi+STREAM.lim_0]
xchg eax, [ebx+STREAM.seg_1]
xchg ecx, [ebx+STREAM.lim_1]
mov [esi+STREAM.seg_0], eax
mov [esi+STREAM.lim_0], ecx
mov [esi+STR.curr_seg], eax
.next:
add edx, 4
540,8 → 530,8
loop .l1
ret
endp
end if
 
 
align 4
proc prepare_playlist
 
733,7 → 723,7
mm_mask dq 0xFF00FF00FF00FF00
 
stream_map dd 0xFFFF ; 16
version dd 0x00010001
version dd 0x00020002
 
szInfinity db 'INFINITY',0
szSound db 'SOUND',0
/kernel/trunk/drivers/main.inc
98,8 → 98,13
.r_silence dd 0
 
.base dd 0
.limit dd 0
.seg_0 dd 0
.lim_0 dd 0
.seg_1 dd 0
.lim_1 dd 0
.curr_seg dd 0
.limit dd 0
 
.buff_size dd 0
.notify_off1 dd 0
.notify_off2 dd 0
107,7 → 112,7
.resample dd 0
}
 
STREAM_SIZE equ 23*4
STREAM_SIZE equ 27*4
 
virtual at 0
STREAM STREAM
/kernel/trunk/drivers/mixer.asm
106,7 → 106,6
ret
endp
 
 
align 4
proc update_stream
locals
141,7 → 140,6
inc [stream_index]
dec [play_count]
jnz .l1
 
ret
.copy:
mov ebx, esi
158,10 → 156,15
 
mov [ebx+STREAM.work_write], edi
 
cmp esi, [ebx+STREAM.limit]
cmp esi, [ebx+STREAM.lim_0]
jb @f
 
mov esi, [ebx+STREAM.base]
mov esi, [ebx+STREAM.seg_0]
mov eax, [ebx+STREAM.lim_0]
xchg esi, [ebx+STREAM.seg_1]
xchg eax, [ebx+STREAM.lim_1]
mov [ebx+STREAM.seg_0], esi
mov [ebx+STREAM.lim_0], eax
@@:
mov [ebx+STREAM.curr_seg], esi
 
176,7 → 179,6
inc [stream_index]
dec [play_count]
jnz .l1
 
ret
@@:
mov [ev_code], 0xFF000001
233,9 → 235,15
 
mov eax, [ebx+STREAM.curr_seg]
add eax, [ebx+STREAM.r_size]
cmp eax, [ebx+STREAM.limit]
cmp eax, [ebx+STREAM.lim_0]
jb @f
mov eax, [ebx+STREAM.base]
 
mov eax, [ebx+STREAM.seg_0]
mov ecx, [ebx+STREAM.lim_0]
xchg eax, [ebx+STREAM.seg_1]
xchg ecx, [ebx+STREAM.lim_1]
mov [ebx+STREAM.seg_0], eax
mov [ebx+STREAM.lim_0], ecx
@@:
mov [ebx+STREAM.curr_seg], eax
 
246,7 → 254,6
mov ecx,0x8000
cmp eax, [ebx+STREAM.notify_off1]
je @f
 
ret
@@:
mov [ev_code], 0xFF000001
603,7 → 610,6
proc s8_stereo stdcall, dest:dword,src:dword,r_buff:dword,\
r_dt:dword, r_size:dword,r_end:dword
 
 
mov esi, [src]
mov edi, [dest]
mov ecx, [r_size]
1016,31 → 1022,26
movq mm3, [eax+88]
paddsw mm3, [ecx+88]
; psraw mm3, 1
 
movq [edx+88], mm3
 
movq mm0, [eax+96]
paddsw mm0, [ecx+96]
; psraw mm0, 1
 
movq [edx+96], mm0
 
movq mm1, [eax+104]
paddsw mm1, [ecx+104]
; psraw mm1, 1
 
movq [edx+104], mm1
 
movq mm2, [eax+112]
paddsw mm2, [ecx+112]
; psraw mm2, 1
 
movq [edx+112], mm2
 
movq mm3, [eax+120]
paddsw mm3, [ecx+120]
; psraw mm3, 1
 
movq [edx+120], mm3
 
ret
/kernel/trunk/drivers/sceletone.asm
4,8 → 4,8
format MS COFF
 
include 'proc32.inc'
include 'imports.inc'
 
 
OS_BASE equ 0;
new_app_base equ 0x60400000
PROC_BASE equ OS_BASE+0x0080000
27,24 → 27,6
public service_proc
public version
 
extrn AttachIntHandler
extrn SysMsgBoardStr
extrn PciApi
extrn PciRead32
extrn PciRead8
extrn PciWrite8
extrn AllocKernelSpace
extrn KernelAlloc
extrn MapPage
extrn GetPgAddr
extrn RegService
extrn ServiceHandler
extrn SetHwCursor
extrn LFBAddress
extrn LoadFile
extrn FpuSave
extrn FpuRestore
 
DEBUG equ 1
 
DRV_ENTRY equ 1
161,7 → 143,7
devices dd (DEVICE_ID shl 16)+VENDOR_ID
dd 0 ;terminator
 
version dd 0x00010001
version dd 0x00020002
 
my_service db 'MY_SERVICE',0 ;max 16 chars include zero
 
/kernel/trunk/drivers/sis.asm
1,8 → 1,8
 
format MS COFF
 
 
include 'proc32.inc'
include 'imports.inc'
 
DEBUG equ 1
 
251,19 → 251,6
public service_proc
public version
 
extrn AttachIntHandler
extrn SysMsgBoardStr
extrn PciApi
extrn PciRead32
extrn PciRead8
extrn PciWrite8
extrn AllocKernelSpace
extrn MapPage
extrn RegService
extrn KernelAlloc
extrn GetPgAddr
extrn GetCurrentTask
 
section '.flat' code readable align 16
 
proc START stdcall, state:dword
1143,7 → 1130,7
devices dd (CTRL_SIS shl 16)+VID_SIS,msg_AC, set_SIS
dd 0
 
version dd 0x00010001
version dd 0x00020002
 
msg_AC db '7012 AC97 controller',13,10, 0
msg_SIS db 'Silicon Integrated Systems',13,10, 0
/kernel/trunk/drivers/unisound.asm
3,6 → 3,7
 
 
include 'proc32.inc'
include 'imports.inc'
 
DEBUG equ 1
 
277,19 → 278,6
public service_proc
public version
 
extrn AttachIntHandler
extrn SysMsgBoardStr
extrn PciApi
extrn PciRead32
extrn PciRead8
extrn PciWrite8
extrn AllocKernelSpace
extrn MapPage
extrn RegService
extrn KernelAlloc
extrn GetPgAddr
extrn GetCurrentTask
 
section '.flat' code readable align 16
 
proc START stdcall, state:dword
1363,7 → 1351,7
 
dd 0 ;terminator
 
version dd 0x00010001
version dd 0x00020002
 
msg_ICH db 'Intel ICH', 13,10, 0
msg_ICH0 db 'Intel ICH0', 13,10, 0