fix codec reset condition. DEV_GET_POS audio driver service.

git-svn-id: svn://kolibrios.org@4496 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Asper 2014-01-20 15:51:16 +00:00
parent a3fd0e561e
commit d403519d87

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -19,7 +19,7 @@ IRQ_REMAP equ 0
IRQ_LINE equ 0
;irq 0,1,2,8,12,13 недоступны
;irq 0,1,2,8,12,13 unavailable
; FEDCBA9876543210
VALID_IRQ equ 1100111011111000b
ATTCH_IRQ equ 0000111010100000b
@ -175,6 +175,7 @@ DEV_NOTIFY equ 5
DEV_SET_MASTERVOL equ 6
DEV_GET_MASTERVOL equ 7
DEV_GET_INFO equ 8
DEV_GET_POS equ 9
struc AC_CNTRL ;AC controller base class
{ .bus dd ?
@ -294,7 +295,7 @@ struc CODEC ;Audio Chip base class
.reg_vendor_id_2 dw ? ;0x7E
.reset dd ? ;virual
.reset dd ? ;virtual
.set_master_vol dd ?
}
@ -493,6 +494,20 @@ proc service_proc stdcall, ioctl:dword
mov ebx, [edi+output]
stdcall get_dev_info, ebx
ret
@@:
cmp eax, DEV_GET_POS
jne @F
push ebx edx
mov edx, VIADEV_PLAYBACK + VIA_REG_OFFSET_CURR_COUNT
call [ctrl.ctrl_read32]
and eax, 0x00FFFFFF
mov ebx, 4096
sub ebx, eax
shr ebx, 2
mov edx, [edi+output]
mov [edx], ebx
pop edx ebx
ret
@@:
.fail:
or eax, -1
@ -814,7 +829,7 @@ proc init_codec
pop eax
test eax, VIA_ACLINK_C00_READY
jz .ready
jnz .ready
call reset_codec
test eax, eax