Subversion Repositories Kolibri OS

Rev

Rev 444 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 444 Rev 462
Line 9... Line 9...
9
 
9
 
10
 
10
 
Line -... Line 11...
-
 
11
include 'proc32.inc'
-
 
12
include 'imports.inc'
11
include 'proc32.inc'
13
 
Line 12... Line 14...
12
include 'imports.inc'
14
API_VERSION     equ 0x01000100
Line 13... Line 15...
13
 
15
 
Line 55... Line 57...
55
BIT28 EQU 0x10000000
57
BIT28 EQU 0x10000000
56
BIT29 EQU 0x20000000
58
BIT29 EQU 0x20000000
57
BIT30 EQU 0x40000000
59
BIT30 EQU 0x40000000
58
BIT31 EQU 0x80000000
60
BIT31 EQU 0x80000000
Line -... Line 61...
-
 
61
 
-
 
62
PCM_4 equ BIT20
-
 
63
PCM_6 equ BIT21
59
 
64
 
60
VID_INTEL        equ 0x8086
65
VID_INTEL        equ 0x8086
Line 61... Line 66...
61
VID_NVIDIA       equ 0x10DE
66
VID_NVIDIA       equ 0x10DE
62
 
67
 
Line 90... Line 95...
90
MC_IN_CR_REG     equ  0x2b  ; MIC in Control Register
95
MC_IN_CR_REG     equ  0x2b  ; MIC in Control Register
91
RR equ  BIT1  ; reset registers.  Nukes all regs
96
RR equ  BIT1  ; reset registers.  Nukes all regs
Line 92... Line 97...
92
 
97
 
93
CODEC_MASTER_VOL_REG		equ	0x02
98
CODEC_MASTER_VOL_REG         equ 0x02
94
CODEC_AUX_VOL			equ	0x04	;
99
CODEC_AUX_VOL                equ 0x04 ;
95
CODEC_PCM_OUT_REG		equ	18h	; PCM output volume
100
CODEC_PCM_OUT_REG            equ 0x18 ; PCM output volume
96
CODEC_EXT_AUDIO_REG		equ	28h	; extended audio
101
CODEC_EXT_AUDIO_REG          equ 0x28 ; extended audio
97
CODEC_EXT_AUDIO_CTRL_REG	equ	2ah	; extended audio control
102
CODEC_EXT_AUDIO_CTRL_REG     equ 0x2a ; extended audio control
98
CODEC_PCM_FRONT_DACRATE_REG	equ	2ch	; PCM out sample rate
103
CODEC_PCM_FRONT_DACRATE_REG  equ 0x2c ; PCM out sample rate
99
CODEC_PCM_SURND_DACRATE_REG	equ	2eh	; surround sound sample rate
104
CODEC_PCM_SURND_DACRATE_REG  equ 0x2e ; surround sound sample rate
Line 100... Line 105...
100
CODEC_PCM_LFE_DACRATE_REG	equ	30h	; LFE sample rate
105
CODEC_PCM_LFE_DACRATE_REG    equ 0x30 ; LFE sample rate
101
 
106
 
102
GLOB_CTRL        equ  0x2C ;   Global Control
107
GLOB_CTRL        equ  0x2C  ;   Global Control
Line 116... Line 121...
116
CTRL_CNT_GIE     equ  0x00000001  ;   GPI Interrupt Enable
121
CTRL_CNT_GIE     equ  0x00000001  ;   GPI Interrupt Enable
Line 117... Line 122...
117
 
122
 
118
CODEC_REG_POWERDOWN   equ 0x26
123
CODEC_REG_POWERDOWN   equ 0x26
Line -... Line 124...
-
 
124
CODEC_REG_ST          equ 0x26
119
CODEC_REG_ST          equ 0x26
125
 
120
 
126
SRV_GETVERSION        equ  0
121
DEV_PLAY              equ  1
127
DEV_PLAY              equ  1
122
DEV_STOP              equ  2
128
DEV_STOP              equ  2
123
DEV_CALLBACK          equ  3
129
DEV_CALLBACK          equ  3
Line 383... Line 389...
383
align 4
389
align 4
384
proc service_proc stdcall, ioctl:dword
390
proc service_proc stdcall, ioctl:dword
Line 385... Line 391...
385
 
391
 
386
           mov edi, [ioctl]
392
           mov edi, [ioctl]
-
 
393
           mov eax, [edi+io_code]
-
 
394
 
-
 
395
           cmp eax, SRV_GETVERSION
-
 
396
           jne @F
-
 
397
 
-
 
398
           mov eax, [edi+output]
-
 
399
           cmp [edi+out_size], 4
-
 
400
           jne .fail
-
 
401
 
-
 
402
           mov [eax], dword API_VERSION
-
 
403
           xor eax, eax
-
 
404
           ret
387
           mov eax, [edi+io_code]
405
@@:
388
           cmp eax, DEV_PLAY
406
           cmp eax, DEV_PLAY
389
           jne @F
407
           jne @F
390
     if DEBUG
408
     if DEBUG
391
           mov esi, msgPlay
409
           mov esi, msgPlay
Line 869... Line 887...
869
           jnz .wait
887
           jnz .wait
870
.err:
888
.err:
871
           xor eax, eax        ; timeout error
889
           xor eax, eax        ; timeout error
872
           ret
890
           ret
873
.ready:
891
.ready:
-
 
892
           mov eax, 2      ;force set 16-bit 2-channel PCM
-
 
893
           mov edx, GLOB_CTRL
-
 
894
           call [ctrl.ctrl_write32]
-
 
895
           mov eax, 5000   ; wait 5 ms
-
 
896
           call StallExec
-
 
897
 
874
           call detect_codec
898
           call detect_codec
Line 875... Line 899...
875
 
899
 
876
           xor eax, eax
900
           xor eax, eax
877
           inc eax
901
           inc eax
Line 1354... Line 1378...
1354
        dd (CTRL_CK8S    shl 16)+VID_NVIDIA,msg_CK8S,set_ICH
1378
        dd (CTRL_CK8S    shl 16)+VID_NVIDIA,msg_CK8S,set_ICH
1355
        dd (CTRL_MCP51   shl 16)+VID_NVIDIA,msg_MCP51,set_ICH
1379
        dd (CTRL_MCP51   shl 16)+VID_NVIDIA,msg_MCP51,set_ICH
Line 1356... Line 1380...
1356
 
1380
 
Line -... Line 1381...
-
 
1381
        dd 0    ;terminator
1357
        dd 0    ;terminator
1382
 
Line 1358... Line 1383...
1358
 
1383
 
1359
version      dd 0x00040004
1384
version      dd (5 shl 16) or (API_VERSION and 0xFFFF)
1360
 
1385
 
1361
msg_ICH      db 'Intel ICH',  13,10, 0
1386
msg_ICH      db 'Intel ICH',  13,10, 0