Rev 3539 | Rev 5363 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3539 | Rev 5077 | ||
---|---|---|---|
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
7 | 7 | ||
- | 8 | format PE DLL native 0.05 |
|
8 | format MS COFF |
9 | entry START |
9 | 10 | ||
10 | DEBUG equ 1 |
11 | DEBUG equ 1 |
11 | DEBUG_IRQ equ 0 |
12 | DEBUG_IRQ equ 0 |
12 | - | ||
13 | include 'proc32.inc' |
- | |
14 | include 'imports.inc' |
- | |
15 | 13 | ||
16 | API_VERSION equ 0x01000100 |
14 | API_VERSION equ 0x01000100 |
17 | 15 | ||
18 | USE_COM_IRQ equ 0 ;make irq 3 and irq 4 available for PCI devices |
16 | USE_COM_IRQ equ 0 ;make irq 3 and irq 4 available for PCI devices |
19 | 17 | ||
20 | ;irq 0,1,2,8,12,13 недоступны |
18 | ;irq 0,1,2,8,12,13 недоступны |
21 | ; FEDCBA9876543210 |
19 | ; FEDCBA9876543210 |
22 | VALID_IRQ equ 1100111011111000b |
20 | VALID_IRQ equ 1100111011111000b |
23 | ATTCH_IRQ equ 0000111010100000b |
21 | ATTCH_IRQ equ 0000111010100000b |
24 | 22 | ||
25 | if USE_COM_IRQ |
23 | if USE_COM_IRQ |
26 | ATTCH_IRQ equ 0000111010111000b |
24 | ATTCH_IRQ equ 0000111010111000b |
27 | end if |
25 | end if |
28 | 26 | ||
29 | CPU_FREQ equ 2000d |
27 | CPU_FREQ equ 2000d |
30 | 28 | ||
31 | BIT0 EQU 0x00000001 |
29 | BIT0 EQU 0x00000001 |
32 | BIT1 EQU 0x00000002 |
30 | BIT1 EQU 0x00000002 |
33 | BIT2 EQU 0x00000004 |
31 | BIT2 EQU 0x00000004 |
34 | BIT3 EQU 0x00000008 |
32 | BIT3 EQU 0x00000008 |
35 | BIT4 EQU 0x00000010 |
33 | BIT4 EQU 0x00000010 |
36 | BIT5 EQU 0x00000020 |
34 | BIT5 EQU 0x00000020 |
37 | BIT6 EQU 0x00000040 |
35 | BIT6 EQU 0x00000040 |
38 | BIT7 EQU 0x00000080 |
36 | BIT7 EQU 0x00000080 |
39 | BIT8 EQU 0x00000100 |
37 | BIT8 EQU 0x00000100 |
40 | BIT9 EQU 0x00000200 |
38 | BIT9 EQU 0x00000200 |
41 | BIT10 EQU 0x00000400 |
39 | BIT10 EQU 0x00000400 |
42 | BIT11 EQU 0x00000800 |
40 | BIT11 EQU 0x00000800 |
43 | BIT12 EQU 0x00001000 |
41 | BIT12 EQU 0x00001000 |
44 | BIT13 EQU 0x00002000 |
42 | BIT13 EQU 0x00002000 |
45 | BIT14 EQU 0x00004000 |
43 | BIT14 EQU 0x00004000 |
46 | BIT15 EQU 0x00008000 |
44 | BIT15 EQU 0x00008000 |
47 | BIT16 EQU 0x00010000 |
45 | BIT16 EQU 0x00010000 |
48 | BIT17 EQU 0x00020000 |
46 | BIT17 EQU 0x00020000 |
49 | BIT18 EQU 0x00040000 |
47 | BIT18 EQU 0x00040000 |
50 | BIT19 EQU 0x00080000 |
48 | BIT19 EQU 0x00080000 |
51 | BIT20 EQU 0x00100000 |
49 | BIT20 EQU 0x00100000 |
52 | BIT21 EQU 0x00200000 |
50 | BIT21 EQU 0x00200000 |
53 | BIT22 EQU 0x00400000 |
51 | BIT22 EQU 0x00400000 |
54 | BIT23 EQU 0x00800000 |
52 | BIT23 EQU 0x00800000 |
55 | BIT24 EQU 0x00100000 |
53 | BIT24 EQU 0x00100000 |
56 | BIT25 EQU 0x02000000 |
54 | BIT25 EQU 0x02000000 |
57 | BIT26 EQU 0x04000000 |
55 | BIT26 EQU 0x04000000 |
58 | BIT27 EQU 0x08000000 |
56 | BIT27 EQU 0x08000000 |
59 | BIT28 EQU 0x10000000 |
57 | BIT28 EQU 0x10000000 |
60 | BIT29 EQU 0x20000000 |
58 | BIT29 EQU 0x20000000 |
61 | BIT30 EQU 0x40000000 |
59 | BIT30 EQU 0x40000000 |
62 | BIT31 EQU 0x80000000 |
60 | BIT31 EQU 0x80000000 |
63 | 61 | ||
64 | VID_FM801 equ 0x1319 |
62 | VID_FM801 equ 0x1319 |
65 | CTRL_FM801 equ 0x0801 |
63 | CTRL_FM801 equ 0x0801 |
66 | 64 | ||
67 | FM_PCM_VOLUME equ 0x00 |
65 | FM_PCM_VOLUME equ 0x00 |
68 | FM_FM_VOLUME equ 0x02 |
66 | FM_FM_VOLUME equ 0x02 |
69 | FM_I2S_VOLUME equ 0x04 |
67 | FM_I2S_VOLUME equ 0x04 |
70 | FM_RECORD_SOURCE equ 0x06 |
68 | FM_RECORD_SOURCE equ 0x06 |
71 | 69 | ||
72 | FM_PLAY_CTL equ 0x08 |
70 | FM_PLAY_CTL equ 0x08 |
73 | FM_PLAY_RATE_MASK equ 0x0f00 |
71 | FM_PLAY_RATE_MASK equ 0x0f00 |
74 | FM_PLAY_BUF1_LAST equ 0x0001 |
72 | FM_PLAY_BUF1_LAST equ 0x0001 |
75 | FM_PLAY_BUF2_LAST equ 0x0002 |
73 | FM_PLAY_BUF2_LAST equ 0x0002 |
76 | FM_PLAY_START equ 0x0020 |
74 | FM_PLAY_START equ 0x0020 |
77 | FM_PLAY_PAUSE equ 0x0040 |
75 | FM_PLAY_PAUSE equ 0x0040 |
78 | FM_PLAY_STOPNOW equ 0x0080 |
76 | FM_PLAY_STOPNOW equ 0x0080 |
79 | FM_PLAY_16BIT equ 0x4000 |
77 | FM_PLAY_16BIT equ 0x4000 |
80 | FM_PLAY_STEREO equ 0x8000 |
78 | FM_PLAY_STEREO equ 0x8000 |
81 | 79 | ||
82 | FM_PLAY_DMALEN equ 0x0a |
80 | FM_PLAY_DMALEN equ 0x0a |
83 | FM_PLAY_DMABUF1 equ 0x0c |
81 | FM_PLAY_DMABUF1 equ 0x0c |
84 | FM_PLAY_DMABUF2 equ 0x10 |
82 | FM_PLAY_DMABUF2 equ 0x10 |
85 | 83 | ||
86 | FM_REC_CTL equ 0x14 |
84 | FM_REC_CTL equ 0x14 |
87 | FM_REC_RATE_MASK equ 0x0f00 |
85 | FM_REC_RATE_MASK equ 0x0f00 |
88 | FM_REC_BUF1_LAST equ 0x0001 |
86 | FM_REC_BUF1_LAST equ 0x0001 |
89 | FM_REC_BUF2_LAST equ 0x0002 |
87 | FM_REC_BUF2_LAST equ 0x0002 |
90 | FM_REC_START equ 0x0020 |
88 | FM_REC_START equ 0x0020 |
91 | FM_REC_PAUSE equ 0x0040 |
89 | FM_REC_PAUSE equ 0x0040 |
92 | FM_REC_STOPNOW equ 0x0080 |
90 | FM_REC_STOPNOW equ 0x0080 |
93 | FM_REC_16BIT equ 0x4000 |
91 | FM_REC_16BIT equ 0x4000 |
94 | FM_REC_STEREO equ 0x8000 |
92 | FM_REC_STEREO equ 0x8000 |
95 | 93 | ||
96 | FM_REC_DMALEN equ 0x16 |
94 | FM_REC_DMALEN equ 0x16 |
97 | FM_REC_DMABUF1 equ 0x18 |
95 | FM_REC_DMABUF1 equ 0x18 |
98 | FM_REC_DMABUF2 equ 0x1c |
96 | FM_REC_DMABUF2 equ 0x1c |
99 | 97 | ||
100 | FM_CODEC_CTL equ 0x22 |
98 | FM_CODEC_CTL equ 0x22 |
101 | FM_VOLUME equ 0x26 |
99 | FM_VOLUME equ 0x26 |
102 | FM_VOLUME_MUTE equ 0x8000 |
100 | FM_VOLUME_MUTE equ 0x8000 |
103 | 101 | ||
104 | FM_CODEC_CMD equ 0x2a |
102 | FM_CODEC_CMD equ 0x2a |
105 | FM_CODEC_CMD_READ equ 0x0080 |
103 | FM_CODEC_CMD_READ equ 0x0080 |
106 | FM_CODEC_CMD_VALID equ 0x0100 |
104 | FM_CODEC_CMD_VALID equ 0x0100 |
107 | FM_CODEC_CMD_BUSY equ 0x0200 |
105 | FM_CODEC_CMD_BUSY equ 0x0200 |
108 | 106 | ||
109 | FM_CODEC_DATA equ 0x2c |
107 | FM_CODEC_DATA equ 0x2c |
110 | 108 | ||
111 | FM_IO_CTL equ 0x52 |
109 | FM_IO_CTL equ 0x52 |
112 | FM_CARD_CTL equ 0x54 |
110 | FM_CARD_CTL equ 0x54 |
113 | 111 | ||
114 | FM_INTMASK equ 0x56 |
112 | FM_INTMASK equ 0x56 |
115 | FM_INTMASK_PLAY equ 0x0001 |
113 | FM_INTMASK_PLAY equ 0x0001 |
116 | FM_INTMASK_REC equ 0x0002 |
114 | FM_INTMASK_REC equ 0x0002 |
117 | FM_INTMASK_VOL equ 0x0040 |
115 | FM_INTMASK_VOL equ 0x0040 |
118 | FM_INTMASK_MPU equ 0x0080 |
116 | FM_INTMASK_MPU equ 0x0080 |
119 | 117 | ||
120 | FM_INTSTATUS equ 0x5a |
118 | FM_INTSTATUS equ 0x5a |
121 | FM_INTSTATUS_PLAY equ 0x0100 |
119 | FM_INTSTATUS_PLAY equ 0x0100 |
122 | FM_INTSTATUS_REC equ 0x0200 |
120 | FM_INTSTATUS_REC equ 0x0200 |
123 | FM_INTSTATUS_VOL equ 0x4000 |
121 | FM_INTSTATUS_VOL equ 0x4000 |
124 | FM_INTSTATUS_MPU equ 0x8000 |
122 | FM_INTSTATUS_MPU equ 0x8000 |
125 | 123 | ||
126 | CODEC_MASTER_VOL_REG equ 0x02 ; |
124 | CODEC_MASTER_VOL_REG equ 0x02 ; |
127 | CODEC_AUX_VOL equ 0x04 ; |
125 | CODEC_AUX_VOL equ 0x04 ; |
128 | CODEC_PCM_OUT_REG equ 0x18 ; PCM output volume |
126 | CODEC_PCM_OUT_REG equ 0x18 ; PCM output volume |
129 | CODEC_EXT_AUDIO_REG equ 0x28 ; extended audio |
127 | CODEC_EXT_AUDIO_REG equ 0x28 ; extended audio |
130 | CODEC_EXT_AUDIO_CTRL_REG equ 0x2a ; extended audio control |
128 | CODEC_EXT_AUDIO_CTRL_REG equ 0x2a ; extended audio control |
131 | CODEC_PCM_FRONT_DACRATE_REG equ 0x2c ; PCM out sample rate |
129 | CODEC_PCM_FRONT_DACRATE_REG equ 0x2c ; PCM out sample rate |
132 | CODEC_PCM_SURND_DACRATE_REG equ 0x2e ; surround sound sample rate |
130 | CODEC_PCM_SURND_DACRATE_REG equ 0x2e ; surround sound sample rate |
133 | CODEC_PCM_LFE_DACRATE_REG equ 0x30 ; LFE sample rate |
131 | CODEC_PCM_LFE_DACRATE_REG equ 0x30 ; LFE sample rate |
134 | 132 | ||
135 | SRV_GETVERSION equ 0 |
133 | SRV_GETVERSION equ 0 |
136 | DEV_PLAY equ 1 |
134 | DEV_PLAY equ 1 |
137 | DEV_STOP equ 2 |
135 | DEV_STOP equ 2 |
138 | DEV_CALLBACK equ 3 |
136 | DEV_CALLBACK equ 3 |
139 | DEV_SET_BUFF equ 4 |
137 | DEV_SET_BUFF equ 4 |
140 | DEV_NOTIFY equ 5 |
138 | DEV_NOTIFY equ 5 |
141 | DEV_SET_MASTERVOL equ 6 |
139 | DEV_SET_MASTERVOL equ 6 |
142 | DEV_GET_MASTERVOL equ 7 |
140 | DEV_GET_MASTERVOL equ 7 |
143 | DEV_GET_INFO equ 8 |
141 | DEV_GET_INFO equ 8 |
144 | 142 | ||
145 | struc AC_CNTRL ;AC controller base class |
143 | struc AC_CNTRL ;AC controller base class |
146 | { .bus dd ? |
144 | { .bus dd ? |
147 | .devfn dd ? |
145 | .devfn dd ? |
148 | 146 | ||
149 | .vendor dd ? |
147 | .vendor dd ? |
150 | .dev_id dd ? |
148 | .dev_id dd ? |
151 | .pci_cmd dd ? |
149 | .pci_cmd dd ? |
152 | .pci_stat dd ? |
150 | .pci_stat dd ? |
153 | 151 | ||
154 | .codec_io_base dd ? |
152 | .codec_io_base dd ? |
155 | .codec_mem_base dd ? |
153 | .codec_mem_base dd ? |
156 | 154 | ||
157 | .ctrl_io_base dd ? |
155 | .ctrl_io_base dd ? |
158 | .ctrl_mem_base dd ? |
156 | .ctrl_mem_base dd ? |
159 | .cfg_reg dd ? |
157 | .cfg_reg dd ? |
160 | .int_line dd ? |
158 | .int_line dd ? |
161 | 159 | ||
162 | .vendor_ids dd ? ;vendor id string |
160 | .vendor_ids dd ? ;vendor id string |
163 | .ctrl_ids dd ? ;hub id string |
161 | .ctrl_ids dd ? ;hub id string |
164 | 162 | ||
165 | .buffer dd ? |
163 | .buffer dd ? |
166 | 164 | ||
167 | .notify_pos dd ? |
165 | .notify_pos dd ? |
168 | .notify_task dd ? |
166 | .notify_task dd ? |
169 | 167 | ||
170 | .lvi_reg dd ? |
168 | .lvi_reg dd ? |
171 | .ctrl_setup dd ? |
169 | .ctrl_setup dd ? |
172 | .user_callback dd ? |
170 | .user_callback dd ? |
173 | .codec_read16 dd ? |
171 | .codec_read16 dd ? |
174 | .codec_write16 dd ? |
172 | .codec_write16 dd ? |
175 | 173 | ||
176 | .ctrl_read8 dd ? |
174 | .ctrl_read8 dd ? |
177 | .ctrl_read16 dd ? |
175 | .ctrl_read16 dd ? |
178 | .ctrl_read32 dd ? |
176 | .ctrl_read32 dd ? |
179 | 177 | ||
180 | .ctrl_write8 dd ? |
178 | .ctrl_write8 dd ? |
181 | .ctrl_write16 dd ? |
179 | .ctrl_write16 dd ? |
182 | .ctrl_write32 dd ? |
180 | .ctrl_write32 dd ? |
183 | } |
181 | } |
184 | 182 | ||
185 | struc CODEC ;Audio Chip base class |
183 | struc CODEC ;Audio Chip base class |
186 | { |
184 | { |
187 | .chip_id dd ? |
185 | .chip_id dd ? |
188 | .flags dd ? |
186 | .flags dd ? |
189 | .status dd ? |
187 | .status dd ? |
190 | 188 | ||
191 | .ac_vendor_ids dd ? ;ac vendor id string |
189 | .ac_vendor_ids dd ? ;ac vendor id string |
192 | .chip_ids dd ? ;chip model string |
190 | .chip_ids dd ? ;chip model string |
193 | 191 | ||
194 | .shadow_flag dd ? |
192 | .shadow_flag dd ? |
195 | dd ? |
193 | dd ? |
196 | 194 | ||
197 | .regs dw ? ; codec registers |
195 | .regs dw ? ; codec registers |
198 | .reg_master_vol dw ? ;0x02 |
196 | .reg_master_vol dw ? ;0x02 |
199 | .reg_aux_out_vol dw ? ;0x04 |
197 | .reg_aux_out_vol dw ? ;0x04 |
200 | .reg_mone_vol dw ? ;0x06 |
198 | .reg_mone_vol dw ? ;0x06 |
201 | .reg_master_tone dw ? ;0x08 |
199 | .reg_master_tone dw ? ;0x08 |
202 | .reg_beep_vol dw ? ;0x0A |
200 | .reg_beep_vol dw ? ;0x0A |
203 | .reg_phone_vol dw ? ;0x0C |
201 | .reg_phone_vol dw ? ;0x0C |
204 | .reg_mic_vol dw ? ;0x0E |
202 | .reg_mic_vol dw ? ;0x0E |
205 | .reg_line_in_vol dw ? ;0x10 |
203 | .reg_line_in_vol dw ? ;0x10 |
206 | .reg_cd_vol dw ? ;0x12 |
204 | .reg_cd_vol dw ? ;0x12 |
207 | .reg_video_vol dw ? ;0x14 |
205 | .reg_video_vol dw ? ;0x14 |
208 | .reg_aux_in_vol dw ? ;0x16 |
206 | .reg_aux_in_vol dw ? ;0x16 |
209 | .reg_pcm_out_vol dw ? ;0x18 |
207 | .reg_pcm_out_vol dw ? ;0x18 |
210 | .reg_rec_select dw ? ;0x1A |
208 | .reg_rec_select dw ? ;0x1A |
211 | .reg_rec_gain dw ? ;0x1C |
209 | .reg_rec_gain dw ? ;0x1C |
212 | .reg_rec_gain_mic dw ? ;0x1E |
210 | .reg_rec_gain_mic dw ? ;0x1E |
213 | .reg_gen dw ? ;0x20 |
211 | .reg_gen dw ? ;0x20 |
214 | .reg_3d_ctrl dw ? ;0X22 |
212 | .reg_3d_ctrl dw ? ;0X22 |
215 | .reg_page dw ? ;0X24 |
213 | .reg_page dw ? ;0X24 |
216 | .reg_powerdown dw ? ;0x26 |
214 | .reg_powerdown dw ? ;0x26 |
217 | .reg_ext_audio dw ? ;0x28 |
215 | .reg_ext_audio dw ? ;0x28 |
218 | .reg_ext_st dw ? ;0x2a |
216 | .reg_ext_st dw ? ;0x2a |
219 | .reg_pcm_front_rate dw ? ;0x2c |
217 | .reg_pcm_front_rate dw ? ;0x2c |
220 | .reg_pcm_surr_rate dw ? ;0x2e |
218 | .reg_pcm_surr_rate dw ? ;0x2e |
221 | .reg_lfe_rate dw ? ;0x30 |
219 | .reg_lfe_rate dw ? ;0x30 |
222 | .reg_pcm_in_rate dw ? ;0x32 |
220 | .reg_pcm_in_rate dw ? ;0x32 |
223 | dw ? ;0x34 |
221 | dw ? ;0x34 |
224 | .reg_cent_lfe_vol dw ? ;0x36 |
222 | .reg_cent_lfe_vol dw ? ;0x36 |
225 | .reg_surr_vol dw ? ;0x38 |
223 | .reg_surr_vol dw ? ;0x38 |
226 | .reg_spdif_ctrl dw ? ;0x3A |
224 | .reg_spdif_ctrl dw ? ;0x3A |
227 | dw ? ;0x3C |
225 | dw ? ;0x3C |
228 | dw ? ;0x3E |
226 | dw ? ;0x3E |
229 | dw ? ;0x40 |
227 | dw ? ;0x40 |
230 | dw ? ;0x42 |
228 | dw ? ;0x42 |
231 | dw ? ;0x44 |
229 | dw ? ;0x44 |
232 | dw ? ;0x46 |
230 | dw ? ;0x46 |
233 | dw ? ;0x48 |
231 | dw ? ;0x48 |
234 | dw ? ;0x4A |
232 | dw ? ;0x4A |
235 | dw ? ;0x4C |
233 | dw ? ;0x4C |
236 | dw ? ;0x4E |
234 | dw ? ;0x4E |
237 | dw ? ;0x50 |
235 | dw ? ;0x50 |
238 | dw ? ;0x52 |
236 | dw ? ;0x52 |
239 | dw ? ;0x54 |
237 | dw ? ;0x54 |
240 | dw ? ;0x56 |
238 | dw ? ;0x56 |
241 | dw ? ;0x58 |
239 | dw ? ;0x58 |
242 | dw ? ;0x5A |
240 | dw ? ;0x5A |
243 | dw ? ;0x5C |
241 | dw ? ;0x5C |
244 | dw ? ;0x5E |
242 | dw ? ;0x5E |
245 | .reg_page_0 dw ? ;0x60 |
243 | .reg_page_0 dw ? ;0x60 |
246 | .reg_page_1 dw ? ;0x62 |
244 | .reg_page_1 dw ? ;0x62 |
247 | .reg_page_2 dw ? ;0x64 |
245 | .reg_page_2 dw ? ;0x64 |
248 | .reg_page_3 dw ? ;0x66 |
246 | .reg_page_3 dw ? ;0x66 |
249 | .reg_page_4 dw ? ;0x68 |
247 | .reg_page_4 dw ? ;0x68 |
250 | .reg_page_5 dw ? ;0x6A |
248 | .reg_page_5 dw ? ;0x6A |
251 | .reg_page_6 dw ? ;0x6C |
249 | .reg_page_6 dw ? ;0x6C |
252 | .reg_page_7 dw ? ;0x6E |
250 | .reg_page_7 dw ? ;0x6E |
253 | dw ? ;0x70 |
251 | dw ? ;0x70 |
254 | dw ? ;0x72 |
252 | dw ? ;0x72 |
255 | dw ? ;0x74 |
253 | dw ? ;0x74 |
256 | dw ? ;0x76 |
254 | dw ? ;0x76 |
257 | dw ? ;0x78 |
255 | dw ? ;0x78 |
258 | dw ? ;0x7A |
256 | dw ? ;0x7A |
259 | .reg_vendor_id_1 dw ? ;0x7C |
257 | .reg_vendor_id_1 dw ? ;0x7C |
260 | .reg_vendor_id_2 dw ? ;0x7E |
258 | .reg_vendor_id_2 dw ? ;0x7E |
261 | 259 | ||
262 | 260 | ||
263 | .reset dd ? ;virual |
261 | .reset dd ? ;virual |
264 | .set_master_vol dd ? |
262 | .set_master_vol dd ? |
265 | } |
263 | } |
266 | 264 | ||
267 | struc CTRL_INFO |
265 | struc CTRL_INFO |
268 | { .pci_cmd dd ? |
266 | { .pci_cmd dd ? |
269 | .irq dd ? |
267 | .irq dd ? |
270 | .glob_cntrl dd ? |
268 | .glob_cntrl dd ? |
271 | .glob_sta dd ? |
269 | .glob_sta dd ? |
272 | .codec_io_base dd ? |
270 | .codec_io_base dd ? |
273 | .ctrl_io_base dd ? |
271 | .ctrl_io_base dd ? |
274 | .codec_mem_base dd ? |
272 | .codec_mem_base dd ? |
275 | .ctrl_mem_base dd ? |
273 | .ctrl_mem_base dd ? |
276 | .codec_id dd ? |
274 | .codec_id dd ? |
277 | } |
275 | } |
278 | - | ||
279 | struc IOCTL |
- | |
280 | { .handle dd ? |
- | |
281 | .io_code dd ? |
- | |
282 | .input dd ? |
- | |
283 | .inp_size dd ? |
- | |
284 | .output dd ? |
- | |
285 | .out_size dd ? |
- | |
286 | } |
- | |
287 | - | ||
288 | virtual at 0 |
- | |
289 | IOCTL IOCTL |
- | |
290 | end virtual |
- | |
291 | 276 | ||
- | 277 | EVENT_NOTIFY equ 0x00000200 |
|
292 | EVENT_NOTIFY equ 0x00000200 |
278 | |
293 | 279 | section '.flat' code readable writable executable |
|
294 | public START |
280 | include '../struct.inc' |
295 | public service_proc |
- | |
296 | public version |
281 | include '../macros.inc' |
297 | 282 | include '../proc32.inc' |
|
298 | section '.flat' code readable align 16 |
283 | include '../peimport.inc' |
299 | 284 | ||
300 | proc START stdcall, state:dword |
285 | proc START c uses ebx esi edi, state:dword, cmdline:dword |
301 | 286 | ||
302 | cmp [state], 1 |
287 | cmp [state], 1 |
303 | jne .stop |
288 | jne .stop |
304 | 289 | ||
305 | if DEBUG |
290 | if DEBUG |
306 | mov eax, START |
291 | mov eax, START |
307 | call dword2str |
292 | call dword2str |
308 | call SysMsgBoardStr |
293 | invoke SysMsgBoardStr |
309 | mov esi, msgInit |
294 | mov esi, msgInit |
310 | call SysMsgBoardStr |
295 | invoke SysMsgBoardStr |
311 | end if |
296 | end if |
312 | 297 | ||
313 | call detect_controller |
298 | call detect_controller |
314 | test eax, eax |
299 | test eax, eax |
315 | jz .fail |
300 | jz .fail |
316 | 301 | ||
317 | if DEBUG |
302 | if DEBUG |
318 | mov esi, [ctrl.vendor_ids] |
303 | mov esi, [ctrl.vendor_ids] |
319 | call SysMsgBoardStr |
304 | invoke SysMsgBoardStr |
320 | mov esi, [ctrl.ctrl_ids] |
305 | mov esi, [ctrl.ctrl_ids] |
321 | call SysMsgBoardStr |
306 | invoke SysMsgBoardStr |
322 | 307 | ||
323 | end if |
308 | end if |
324 | 309 | ||
325 | call init_controller |
310 | call init_controller |
326 | test eax, eax |
311 | test eax, eax |
327 | jz .fail |
312 | jz .fail |
328 | 313 | ||
329 | call init_codec |
314 | call init_codec |
330 | test eax, eax |
315 | test eax, eax |
331 | jz .fail |
316 | jz .fail |
332 | 317 | ||
333 | call reset_controller |
318 | call reset_controller |
334 | call setup_codec |
319 | call setup_codec |
335 | 320 | ||
336 | mov esi, msgPrimBuff |
321 | mov esi, msgPrimBuff |
337 | call SysMsgBoardStr |
322 | invoke SysMsgBoardStr |
338 | call create_primary_buff |
323 | call create_primary_buff |
339 | 324 | ||
340 | mov esi, msgDone |
325 | mov esi, msgDone |
341 | call SysMsgBoardStr |
326 | invoke SysMsgBoardStr |
342 | 327 | ||
343 | mov eax, VALID_IRQ |
328 | mov eax, VALID_IRQ |
344 | mov ebx, [ctrl.int_line] |
329 | mov ebx, [ctrl.int_line] |
345 | mov esi, msgInvIRQ |
330 | mov esi, msgInvIRQ |
346 | bt eax, ebx |
331 | bt eax, ebx |
347 | jnc .fail_msg |
332 | jnc .fail_msg |
348 | mov eax, ATTCH_IRQ |
333 | mov eax, ATTCH_IRQ |
349 | mov esi, msgAttchIRQ |
334 | mov esi, msgAttchIRQ |
350 | bt eax, ebx |
335 | bt eax, ebx |
351 | jnc .fail_msg |
336 | jnc .fail_msg |
352 | 337 | ||
353 | stdcall AttachIntHandler, ebx, ac97_irq, dword 0 |
338 | invoke AttachIntHandler, ebx, ac97_irq, dword 0 |
354 | .reg: |
339 | .reg: |
355 | 340 | ||
356 | stdcall RegService, sz_sound_srv, service_proc |
341 | invoke RegService, sz_sound_srv, service_proc |
357 | ret |
342 | ret |
358 | .fail: |
343 | .fail: |
359 | if DEBUG |
344 | if DEBUG |
360 | mov esi, msgFail |
345 | mov esi, msgFail |
361 | call SysMsgBoardStr |
346 | invoke SysMsgBoardStr |
362 | end if |
347 | end if |
363 | xor eax, eax |
348 | xor eax, eax |
364 | ret |
349 | ret |
365 | .fail_msg: |
350 | .fail_msg: |
366 | call SysMsgBoardStr |
351 | invoke SysMsgBoardStr |
367 | xor eax, eax |
352 | xor eax, eax |
368 | ret |
353 | ret |
369 | .stop: |
354 | .stop: |
370 | call stop |
355 | call stop |
371 | xor eax, eax |
356 | xor eax, eax |
372 | ret |
357 | ret |
373 | endp |
358 | endp |
374 | 359 | ||
375 | handle equ IOCTL.handle |
360 | handle equ IOCTL.handle |
376 | io_code equ IOCTL.io_code |
361 | io_code equ IOCTL.io_code |
377 | input equ IOCTL.input |
362 | input equ IOCTL.input |
378 | inp_size equ IOCTL.inp_size |
363 | inp_size equ IOCTL.inp_size |
379 | output equ IOCTL.output |
364 | output equ IOCTL.output |
380 | out_size equ IOCTL.out_size |
365 | out_size equ IOCTL.out_size |
381 | 366 | ||
382 | align 4 |
367 | align 4 |
383 | proc service_proc stdcall, ioctl:dword |
368 | proc service_proc stdcall, ioctl:dword |
384 | 369 | ||
385 | mov edi, [ioctl] |
370 | mov edi, [ioctl] |
386 | mov eax, [edi+io_code] |
371 | mov eax, [edi+io_code] |
387 | 372 | ||
388 | cmp eax, SRV_GETVERSION |
373 | cmp eax, SRV_GETVERSION |
389 | jne @F |
374 | jne @F |
390 | 375 | ||
391 | mov eax, [edi+output] |
376 | mov eax, [edi+output] |
392 | cmp [edi+out_size], 4 |
377 | cmp [edi+out_size], 4 |
393 | jne .fail |
378 | jne .fail |
394 | 379 | ||
395 | mov [eax], dword API_VERSION |
380 | mov [eax], dword API_VERSION |
396 | xor eax, eax |
381 | xor eax, eax |
397 | ret |
382 | ret |
398 | @@: |
383 | @@: |
399 | cmp eax, DEV_PLAY |
384 | cmp eax, DEV_PLAY |
400 | jne @F |
385 | jne @F |
401 | if DEBUG |
386 | if DEBUG |
402 | mov esi, msgPlay |
387 | mov esi, msgPlay |
403 | call SysMsgBoardStr |
388 | invoke SysMsgBoardStr |
404 | end if |
389 | end if |
405 | call play |
390 | call play |
406 | ret |
391 | ret |
407 | @@: |
392 | @@: |
408 | cmp eax, DEV_STOP |
393 | cmp eax, DEV_STOP |
409 | jne @F |
394 | jne @F |
410 | if DEBUG |
395 | if DEBUG |
411 | mov esi, msgStop |
396 | mov esi, msgStop |
412 | call SysMsgBoardStr |
397 | invoke SysMsgBoardStr |
413 | end if |
398 | end if |
414 | call stop |
399 | call stop |
415 | ret |
400 | ret |
416 | @@: |
401 | @@: |
417 | cmp eax, DEV_CALLBACK |
402 | cmp eax, DEV_CALLBACK |
418 | jne @F |
403 | jne @F |
419 | mov ebx, [edi+input] |
404 | mov ebx, [edi+input] |
420 | stdcall set_callback, [ebx] |
405 | stdcall set_callback, [ebx] |
421 | ret |
406 | ret |
422 | @@: |
407 | @@: |
423 | cmp eax, DEV_SET_MASTERVOL |
408 | cmp eax, DEV_SET_MASTERVOL |
424 | jne @F |
409 | jne @F |
425 | mov eax, [edi+input] |
410 | mov eax, [edi+input] |
426 | mov eax, [eax] |
411 | mov eax, [eax] |
427 | call set_master_vol ;eax= vol |
412 | call set_master_vol ;eax= vol |
428 | ret |
413 | ret |
429 | @@: |
414 | @@: |
430 | cmp eax, DEV_GET_MASTERVOL |
415 | cmp eax, DEV_GET_MASTERVOL |
431 | jne @F |
416 | jne @F |
432 | mov ebx, [edi+output] |
417 | mov ebx, [edi+output] |
433 | stdcall get_master_vol, ebx |
418 | stdcall get_master_vol, ebx |
434 | ret |
419 | ret |
435 | ;@@: |
420 | ;@@: |
436 | ; cmp eax, DEV_GET_INFO |
421 | ; cmp eax, DEV_GET_INFO |
437 | ; jne @F |
422 | ; jne @F |
438 | ; mov ebx, [edi+output] |
423 | ; mov ebx, [edi+output] |
439 | ; stdcall get_dev_info, ebx |
424 | ; stdcall get_dev_info, ebx |
440 | ; ret |
425 | ; ret |
441 | @@: |
426 | @@: |
442 | .fail: |
427 | .fail: |
443 | or eax, -1 |
428 | or eax, -1 |
444 | ret |
429 | ret |
445 | endp |
430 | endp |
446 | 431 | ||
447 | restore handle |
432 | restore handle |
448 | restore io_code |
433 | restore io_code |
449 | restore input |
434 | restore input |
450 | restore inp_size |
435 | restore inp_size |
451 | restore output |
436 | restore output |
452 | restore out_size |
437 | restore out_size |
453 | 438 | ||
454 | align 4 |
439 | align 4 |
455 | proc fill_buffer |
440 | proc fill_buffer |
456 | 441 | ||
457 | cmp [ctrl.user_callback], 0 |
442 | cmp [ctrl.user_callback], 0 |
458 | je .exit |
443 | je .exit |
459 | 444 | ||
460 | mov esi, [ctrl.buffer] |
445 | mov esi, [ctrl.buffer] |
461 | mov eax, int_flip_flop |
446 | mov eax, int_flip_flop |
462 | inc dword [eax] |
447 | inc dword [eax] |
463 | test dword [eax], 1 |
448 | test dword [eax], 1 |
464 | je @f |
449 | je @f |
465 | add esi, 0x4000 |
450 | add esi, 0x4000 |
466 | @@: |
451 | @@: |
467 | stdcall [ctrl.user_callback], esi |
452 | stdcall [ctrl.user_callback], esi |
468 | 453 | ||
469 | mov edx, FM_PLAY_DMABUF1 |
454 | mov edx, FM_PLAY_DMABUF1 |
470 | mov eax, [buffer_pgaddr] |
455 | mov eax, [buffer_pgaddr] |
471 | mov esi, int_flip_flop |
456 | mov esi, int_flip_flop |
472 | test dword [esi], 1 |
457 | test dword [esi], 1 |
473 | je @f |
458 | je @f |
474 | mov edx, FM_PLAY_DMABUF2 |
459 | mov edx, FM_PLAY_DMABUF2 |
475 | add eax, 0x4000 |
460 | add eax, 0x4000 |
476 | @@: |
461 | @@: |
477 | call [ctrl.ctrl_write32] |
462 | call [ctrl.ctrl_write32] |
478 | 463 | ||
479 | .exit: |
464 | .exit: |
480 | ret |
465 | ret |
481 | endp |
466 | endp |
482 | 467 | ||
483 | align 4 |
468 | align 4 |
484 | proc ac97_irq |
469 | proc ac97_irq |
485 | 470 | ||
486 | if DEBUG_IRQ |
471 | if DEBUG_IRQ |
487 | mov esi, msgIRQ |
472 | mov esi, msgIRQ |
488 | call SysMsgBoardStr |
473 | invoke SysMsgBoardStr |
489 | end if |
474 | end if |
490 | 475 | ||
491 | mov edx, FM_INTSTATUS |
476 | mov edx, FM_INTSTATUS |
492 | call [ctrl.ctrl_read16] |
477 | call [ctrl.ctrl_read16] |
493 | 478 | ||
494 | test eax, FM_INTSTATUS_PLAY |
479 | test eax, FM_INTSTATUS_PLAY |
495 | je .exit |
480 | je .exit |
496 | 481 | ||
497 | push eax |
482 | push eax |
498 | call fill_buffer |
483 | call fill_buffer |
499 | pop eax |
484 | pop eax |
500 | 485 | ||
501 | .exit: |
486 | .exit: |
502 | mov edx, FM_INTSTATUS |
487 | mov edx, FM_INTSTATUS |
503 | call [ctrl.ctrl_write16] |
488 | call [ctrl.ctrl_write16] |
504 | 489 | ||
505 | ret |
490 | ret |
506 | endp |
491 | endp |
507 | 492 | ||
508 | align 4 |
493 | align 4 |
509 | proc create_primary_buff |
494 | proc create_primary_buff |
510 | 495 | ||
511 | stdcall KernelAlloc, 0x10000 |
496 | invoke KernelAlloc, 0x10000 |
512 | mov [ctrl.buffer], eax |
497 | mov [ctrl.buffer], eax |
513 | 498 | ||
514 | mov edi, eax |
499 | mov edi, eax |
515 | mov ecx, 0x10000/4 |
500 | mov ecx, 0x10000/4 |
516 | xor eax, eax |
501 | xor eax, eax |
517 | cld |
502 | cld |
518 | rep stosd |
503 | rep stosd |
519 | 504 | ||
520 | mov eax, [ctrl.buffer] |
505 | mov eax, [ctrl.buffer] |
521 | call GetPgAddr |
506 | invoke GetPgAddr |
522 | mov [buffer_pgaddr], eax |
507 | mov [buffer_pgaddr], eax |
523 | 508 | ||
524 | ret |
509 | ret |
525 | endp |
510 | endp |
526 | 511 | ||
527 | align 4 |
512 | align 4 |
528 | proc detect_controller |
513 | proc detect_controller |
529 | locals |
514 | locals |
530 | last_bus dd ? |
515 | last_bus dd ? |
531 | bus dd ? |
516 | bus dd ? |
532 | devfn dd ? |
517 | devfn dd ? |
533 | endl |
518 | endl |
534 | 519 | ||
535 | xor eax, eax |
520 | xor eax, eax |
536 | mov [bus], eax |
521 | mov [bus], eax |
537 | inc eax |
522 | inc eax |
538 | call PciApi |
523 | invoke PciApi |
539 | cmp eax, -1 |
524 | cmp eax, -1 |
540 | je .err |
525 | je .err |
541 | 526 | ||
542 | mov [last_bus], eax |
527 | mov [last_bus], eax |
543 | 528 | ||
544 | .next_bus: |
529 | .next_bus: |
545 | and [devfn], 0 |
530 | and [devfn], 0 |
546 | .next_dev: |
531 | .next_dev: |
547 | stdcall PciRead32, [bus], [devfn], dword 0 |
532 | invoke PciRead32, [bus], [devfn], dword 0 |
548 | test eax, eax |
533 | test eax, eax |
549 | jz .next |
534 | jz .next |
550 | cmp eax, -1 |
535 | cmp eax, -1 |
551 | je .next |
536 | je .next |
552 | 537 | ||
553 | push eax |
538 | push eax |
554 | stdcall PciRead32, [bus], [devfn], dword 0x09 |
539 | invoke PciRead32, [bus], [devfn], dword 0x09 |
555 | and eax, 0xffffff |
540 | and eax, 0xffffff |
556 | cmp eax, 0x060100 ;pci-isa |
541 | cmp eax, 0x060100 ;pci-isa |
557 | jne .no_bridge |
542 | jne .no_bridge |
558 | 543 | ||
559 | mov eax, [bus] |
544 | mov eax, [bus] |
560 | mov [brg_bus], eax |
545 | mov [brg_bus], eax |
561 | mov eax, [devfn] |
546 | mov eax, [devfn] |
562 | mov [brg_devfn], eax |
547 | mov [brg_devfn], eax |
563 | .no_bridge: |
548 | .no_bridge: |
564 | pop eax |
549 | pop eax |
565 | 550 | ||
566 | mov edi, devices |
551 | mov edi, devices |
567 | @@: |
552 | @@: |
568 | mov ebx, [edi] |
553 | mov ebx, [edi] |
569 | test ebx, ebx |
554 | test ebx, ebx |
570 | jz .next |
555 | jz .next |
571 | 556 | ||
572 | cmp eax, ebx |
557 | cmp eax, ebx |
573 | je .found |
558 | je .found |
574 | add edi, 12 |
559 | add edi, 12 |
575 | jmp @B |
560 | jmp @B |
576 | .next: |
561 | .next: |
577 | inc [devfn] |
562 | inc [devfn] |
578 | cmp [devfn], 256 |
563 | cmp [devfn], 256 |
579 | jb .next_dev |
564 | jb .next_dev |
580 | mov eax, [bus] |
565 | mov eax, [bus] |
581 | inc eax |
566 | inc eax |
582 | mov [bus], eax |
567 | mov [bus], eax |
583 | cmp eax, [last_bus] |
568 | cmp eax, [last_bus] |
584 | jna .next_bus |
569 | jna .next_bus |
585 | xor eax, eax |
570 | xor eax, eax |
586 | ret |
571 | ret |
587 | .found: |
572 | .found: |
588 | mov ebx, [bus] |
573 | mov ebx, [bus] |
589 | mov [ctrl.bus], ebx |
574 | mov [ctrl.bus], ebx |
590 | 575 | ||
591 | mov ecx, [devfn] |
576 | mov ecx, [devfn] |
592 | mov [ctrl.devfn], ecx |
577 | mov [ctrl.devfn], ecx |
593 | 578 | ||
594 | mov edx, eax |
579 | mov edx, eax |
595 | and edx, 0xFFFF |
580 | and edx, 0xFFFF |
596 | mov [ctrl.vendor], edx |
581 | mov [ctrl.vendor], edx |
597 | shr eax, 16 |
582 | shr eax, 16 |
598 | mov [ctrl.dev_id], eax |
583 | mov [ctrl.dev_id], eax |
599 | 584 | ||
600 | mov ebx, [edi+4] |
585 | mov ebx, [edi+4] |
601 | mov [ctrl.ctrl_ids], ebx |
586 | mov [ctrl.ctrl_ids], ebx |
602 | mov [ctrl.vendor_ids], msg_FM |
587 | mov [ctrl.vendor_ids], msg_FM |
603 | 588 | ||
604 | mov esi, [edi+8] |
589 | mov esi, [edi+8] |
605 | mov [ctrl.ctrl_setup], esi |
590 | mov [ctrl.ctrl_setup], esi |
606 | ret |
591 | ret |
607 | .err: |
592 | .err: |
608 | xor eax, eax |
593 | xor eax, eax |
609 | ret |
594 | ret |
610 | endp |
595 | endp |
611 | 596 | ||
612 | align 4 |
597 | align 4 |
613 | proc init_controller |
598 | proc init_controller |
614 | 599 | ||
615 | stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 4 |
600 | invoke PciRead32, [ctrl.bus], [ctrl.devfn], 4 |
616 | mov ebx, eax |
601 | mov ebx, eax |
617 | and eax, 0xFFFF |
602 | and eax, 0xFFFF |
618 | mov [ctrl.pci_cmd], eax |
603 | mov [ctrl.pci_cmd], eax |
619 | shr ebx, 16 |
604 | shr ebx, 16 |
620 | mov [ctrl.pci_stat], ebx |
605 | mov [ctrl.pci_stat], ebx |
621 | 606 | ||
622 | mov esi, msgPciCmd |
607 | mov esi, msgPciCmd |
623 | call SysMsgBoardStr |
608 | invoke SysMsgBoardStr |
624 | call dword2str |
609 | call dword2str |
625 | call SysMsgBoardStr |
610 | invoke SysMsgBoardStr |
626 | 611 | ||
627 | mov esi, msgPciStat |
612 | mov esi, msgPciStat |
628 | call SysMsgBoardStr |
613 | invoke SysMsgBoardStr |
629 | mov eax, [ctrl.pci_stat] |
614 | mov eax, [ctrl.pci_stat] |
630 | call dword2str |
615 | call dword2str |
631 | call SysMsgBoardStr |
616 | invoke SysMsgBoardStr |
632 | 617 | ||
633 | mov esi, msgCtrlIsaIo |
618 | mov esi, msgCtrlIsaIo |
634 | call SysMsgBoardStr |
619 | invoke SysMsgBoardStr |
635 | 620 | ||
636 | stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 0x10 |
621 | invoke PciRead32, [ctrl.bus], [ctrl.devfn], 0x10 |
637 | 622 | ||
638 | call dword2str |
623 | call dword2str |
639 | call SysMsgBoardStr |
624 | invoke SysMsgBoardStr |
640 | 625 | ||
641 | and eax, 0xFFFE |
626 | and eax, 0xFFFE |
642 | mov [ctrl.ctrl_io_base], eax |
627 | mov [ctrl.ctrl_io_base], eax |
643 | 628 | ||
644 | mov esi, msgIrqNum |
629 | mov esi, msgIrqNum |
645 | call SysMsgBoardStr |
630 | invoke SysMsgBoardStr |
646 | 631 | ||
647 | stdcall PciRead32, [ctrl.bus], [ctrl.devfn], dword 0x3C |
632 | invoke PciRead32, [ctrl.bus], [ctrl.devfn], 0x3C |
648 | and eax, 0xFF |
633 | and eax, 0xFF |
649 | mov [ctrl.int_line], eax |
634 | mov [ctrl.int_line], eax |
650 | 635 | ||
651 | call dword2str |
636 | call dword2str |
652 | call SysMsgBoardStr |
637 | invoke SysMsgBoardStr |
653 | 638 | ||
654 | call [ctrl.ctrl_setup] |
639 | call [ctrl.ctrl_setup] |
655 | xor eax, eax |
640 | xor eax, eax |
656 | inc eax |
641 | inc eax |
657 | ret |
642 | ret |
658 | endp |
643 | endp |
659 | 644 | ||
660 | align 4 |
645 | align 4 |
661 | proc set_FM |
646 | proc set_FM |
662 | mov [ctrl.codec_read16], codec_io_r16 ;virtual |
647 | mov [ctrl.codec_read16], codec_io_r16 ;virtual |
663 | mov [ctrl.codec_write16], codec_io_w16 ;virtual |
648 | mov [ctrl.codec_write16], codec_io_w16 ;virtual |
664 | 649 | ||
665 | mov [ctrl.ctrl_read8 ], ctrl_io_r8 ;virtual |
650 | mov [ctrl.ctrl_read8 ], ctrl_io_r8 ;virtual |
666 | mov [ctrl.ctrl_read16], ctrl_io_r16 ;virtual |
651 | mov [ctrl.ctrl_read16], ctrl_io_r16 ;virtual |
667 | mov [ctrl.ctrl_read32], ctrl_io_r32 ;virtual |
652 | mov [ctrl.ctrl_read32], ctrl_io_r32 ;virtual |
668 | 653 | ||
669 | mov [ctrl.ctrl_write8 ], ctrl_io_w8 ;virtual |
654 | mov [ctrl.ctrl_write8 ], ctrl_io_w8 ;virtual |
670 | mov [ctrl.ctrl_write16], ctrl_io_w16 ;virtual |
655 | mov [ctrl.ctrl_write16], ctrl_io_w16 ;virtual |
671 | mov [ctrl.ctrl_write32], ctrl_io_w32 ;virtual |
656 | mov [ctrl.ctrl_write32], ctrl_io_w32 ;virtual |
672 | ret |
657 | ret |
673 | endp |
658 | endp |
674 | 659 | ||
675 | align 4 |
660 | align 4 |
676 | proc reset_controller |
661 | proc reset_controller |
677 | 662 | ||
678 | mov esi, msgInitCtrl |
663 | mov esi, msgInitCtrl |
679 | call SysMsgBoardStr |
664 | invoke SysMsgBoardStr |
680 | 665 | ||
681 | mov edx, FM_CARD_CTL |
666 | mov edx, FM_CARD_CTL |
682 | call [ctrl.ctrl_read8] |
667 | call [ctrl.ctrl_read8] |
683 | push eax |
668 | push eax |
684 | or al, 1 |
669 | or al, 1 |
685 | mov edx, FM_CARD_CTL |
670 | mov edx, FM_CARD_CTL |
686 | call [ctrl.ctrl_write8] |
671 | call [ctrl.ctrl_write8] |
687 | mov eax, 10 |
672 | mov eax, 10 |
688 | call StallExec |
673 | call StallExec |
689 | pop eax |
674 | pop eax |
690 | and al, 0xFE |
675 | and al, 0xFE |
691 | mov edx, FM_CARD_CTL |
676 | mov edx, FM_CARD_CTL |
692 | call [ctrl.ctrl_write8] |
677 | call [ctrl.ctrl_write8] |
693 | mov eax, 10 |
678 | mov eax, 10 |
694 | call StallExec |
679 | call StallExec |
695 | 680 | ||
696 | mov eax, 0x0404 |
681 | mov eax, 0x0404 |
697 | mov edx, FM_PCM_VOLUME |
682 | mov edx, FM_PCM_VOLUME |
698 | call [ctrl.ctrl_write16] |
683 | call [ctrl.ctrl_write16] |
699 | mov edx, FM_FM_VOLUME |
684 | mov edx, FM_FM_VOLUME |
700 | call [ctrl.ctrl_write16] |
685 | call [ctrl.ctrl_write16] |
701 | mov edx, FM_I2S_VOLUME |
686 | mov edx, FM_I2S_VOLUME |
702 | call [ctrl.ctrl_write16] |
687 | call [ctrl.ctrl_write16] |
703 | 688 | ||
704 | mov edx, FM_INTMASK |
689 | mov edx, FM_INTMASK |
705 | call [ctrl.ctrl_read16] |
690 | call [ctrl.ctrl_read16] |
706 | and eax, not FM_INTMASK_PLAY |
691 | and eax, not FM_INTMASK_PLAY |
707 | or eax, FM_INTMASK_REC or FM_INTMASK_MPU or FM_INTMASK_VOL |
692 | or eax, FM_INTMASK_REC or FM_INTMASK_MPU or FM_INTMASK_VOL |
708 | mov edx, FM_INTMASK |
693 | mov edx, FM_INTMASK |
709 | call [ctrl.ctrl_write16] |
694 | call [ctrl.ctrl_write16] |
710 | 695 | ||
711 | mov eax, FM_INTMASK_PLAY or FM_INTMASK_REC or FM_INTMASK_MPU or FM_INTMASK_VOL |
696 | mov eax, FM_INTMASK_PLAY or FM_INTMASK_REC or FM_INTMASK_MPU or FM_INTMASK_VOL |
712 | mov edx, FM_INTSTATUS |
697 | mov edx, FM_INTSTATUS |
713 | call [ctrl.ctrl_write16] |
698 | call [ctrl.ctrl_write16] |
714 | 699 | ||
715 | ret |
700 | ret |
716 | endp |
701 | endp |
717 | 702 | ||
718 | align 4 |
703 | align 4 |
719 | proc init_codec |
704 | proc init_codec |
720 | 705 | ||
721 | mov esi, msgInitCodec |
706 | mov esi, msgInitCodec |
722 | call SysMsgBoardStr |
707 | invoke SysMsgBoardStr |
723 | 708 | ||
724 | mov al, FM_CODEC_CMD_READ |
709 | mov al, FM_CODEC_CMD_READ |
725 | mov edx, FM_CODEC_CMD |
710 | mov edx, FM_CODEC_CMD |
726 | call [ctrl.ctrl_write8] |
711 | call [ctrl.ctrl_write8] |
727 | 712 | ||
728 | call reset_codec |
713 | call reset_codec |
729 | 714 | ||
730 | call detect_codec |
715 | call detect_codec |
731 | 716 | ||
732 | xor eax, eax |
717 | xor eax, eax |
733 | inc eax |
718 | inc eax |
734 | ret |
719 | ret |
735 | endp |
720 | endp |
736 | 721 | ||
737 | align 4 |
722 | align 4 |
738 | proc reset_codec |
723 | proc reset_codec |
739 | 724 | ||
740 | mov ecx, 255 |
725 | mov ecx, 255 |
741 | .L1: |
726 | .L1: |
742 | mov edx, FM_CODEC_CMD |
727 | mov edx, FM_CODEC_CMD |
743 | call [ctrl.ctrl_read16] |
728 | call [ctrl.ctrl_read16] |
744 | test ah, FM_CODEC_CMD_VALID shr 8 |
729 | test ah, FM_CODEC_CMD_VALID shr 8 |
745 | jne .L2 |
730 | jne .L2 |
746 | loop .L1 |
731 | loop .L1 |
747 | .L2: |
732 | .L2: |
748 | mov edx, FM_CODEC_CTL |
733 | mov edx, FM_CODEC_CTL |
749 | call [ctrl.ctrl_read8] |
734 | call [ctrl.ctrl_read8] |
750 | push eax |
735 | push eax |
751 | or al, 0x20 |
736 | or al, 0x20 |
752 | mov edx, FM_CODEC_CTL |
737 | mov edx, FM_CODEC_CTL |
753 | call [ctrl.ctrl_write8] |
738 | call [ctrl.ctrl_write8] |
754 | pop eax |
739 | pop eax |
755 | and al, 0xDF |
740 | and al, 0xDF |
756 | mov edx, FM_CODEC_CTL |
741 | mov edx, FM_CODEC_CTL |
757 | call [ctrl.ctrl_write8] |
742 | call [ctrl.ctrl_write8] |
758 | 743 | ||
759 | xor eax, eax |
744 | xor eax, eax |
760 | inc eax |
745 | inc eax |
761 | ret |
746 | ret |
762 | endp |
747 | endp |
763 | 748 | ||
764 | align 4 |
749 | align 4 |
765 | play: |
750 | play: |
766 | mov eax, 0x4000-1 |
751 | mov eax, 0x4000-1 |
767 | mov edx, FM_PLAY_DMALEN |
752 | mov edx, FM_PLAY_DMALEN |
768 | call [ctrl.ctrl_write16] |
753 | call [ctrl.ctrl_write16] |
769 | 754 | ||
770 | call fill_buffer |
755 | call fill_buffer |
771 | 756 | ||
772 | mov eax, FM_PLAY_START or FM_PLAY_STOPNOW or FM_PLAY_STEREO or FM_PLAY_16BIT or 0xA00 |
757 | mov eax, FM_PLAY_START or FM_PLAY_STOPNOW or FM_PLAY_STEREO or FM_PLAY_16BIT or 0xA00 |
773 | mov edx, FM_PLAY_CTL |
758 | mov edx, FM_PLAY_CTL |
774 | call [ctrl.ctrl_write16] |
759 | call [ctrl.ctrl_write16] |
775 | 760 | ||
776 | xor eax, eax |
761 | xor eax, eax |
777 | ret |
762 | ret |
778 | 763 | ||
779 | align 4 |
764 | align 4 |
780 | stop: |
765 | stop: |
781 | mov edx, FM_PLAY_CTL |
766 | mov edx, FM_PLAY_CTL |
782 | call [ctrl.ctrl_read16] |
767 | call [ctrl.ctrl_read16] |
783 | and eax, not (FM_PLAY_START or FM_PLAY_STOPNOW) |
768 | and eax, not (FM_PLAY_START or FM_PLAY_STOPNOW) |
784 | or eax, FM_PLAY_BUF1_LAST or FM_PLAY_BUF2_LAST |
769 | or eax, FM_PLAY_BUF1_LAST or FM_PLAY_BUF2_LAST |
785 | mov edx, FM_PLAY_CTL |
770 | mov edx, FM_PLAY_CTL |
786 | call [ctrl.ctrl_write16] |
771 | call [ctrl.ctrl_write16] |
787 | 772 | ||
788 | xor eax, eax |
773 | xor eax, eax |
789 | ret |
774 | ret |
790 | 775 | ||
791 | align 4 |
776 | align 4 |
792 | proc get_dev_info stdcall, p_info:dword |
777 | proc get_dev_info stdcall, p_info:dword |
793 | virtual at esi |
778 | virtual at esi |
794 | CTRL_INFO CTRL_INFO |
779 | CTRL_INFO CTRL_INFO |
795 | end virtual |
780 | end virtual |
796 | 781 | ||
797 | mov esi, [p_info] |
782 | mov esi, [p_info] |
798 | mov eax, [ctrl.int_line] |
783 | mov eax, [ctrl.int_line] |
799 | mov ebx, [ctrl.codec_io_base] |
784 | mov ebx, [ctrl.codec_io_base] |
800 | mov ecx, [ctrl.ctrl_io_base] |
785 | mov ecx, [ctrl.ctrl_io_base] |
801 | mov edx, [ctrl.codec_mem_base] |
786 | mov edx, [ctrl.codec_mem_base] |
802 | mov edi, [ctrl.ctrl_mem_base] |
787 | mov edi, [ctrl.ctrl_mem_base] |
803 | 788 | ||
804 | mov [CTRL_INFO.irq], eax |
789 | mov [CTRL_INFO.irq], eax |
805 | mov [CTRL_INFO.codec_io_base], ebx |
790 | mov [CTRL_INFO.codec_io_base], ebx |
806 | mov [CTRL_INFO.ctrl_io_base], ecx |
791 | mov [CTRL_INFO.ctrl_io_base], ecx |
807 | mov [CTRL_INFO.codec_mem_base], edx |
792 | mov [CTRL_INFO.codec_mem_base], edx |
808 | mov [CTRL_INFO.ctrl_mem_base], edi |
793 | mov [CTRL_INFO.ctrl_mem_base], edi |
809 | 794 | ||
810 | mov eax, [codec.chip_id] |
795 | mov eax, [codec.chip_id] |
811 | mov [CTRL_INFO.codec_id], eax |
796 | mov [CTRL_INFO.codec_id], eax |
812 | 797 | ||
813 | mov ebx, [ctrl.pci_cmd] |
798 | mov ebx, [ctrl.pci_cmd] |
814 | mov [CTRL_INFO.pci_cmd], ebx |
799 | mov [CTRL_INFO.pci_cmd], ebx |
815 | ret |
800 | ret |
816 | endp |
801 | endp |
817 | 802 | ||
818 | align 4 |
803 | align 4 |
819 | proc set_callback stdcall, handler:dword |
804 | proc set_callback stdcall, handler:dword |
820 | mov eax, [handler] |
805 | mov eax, [handler] |
821 | mov [ctrl.user_callback], eax |
806 | mov [ctrl.user_callback], eax |
822 | ret |
807 | ret |
823 | endp |
808 | endp |
824 | 809 | ||
825 | align 4 |
810 | align 4 |
826 | proc codec_read stdcall, ac_reg:dword ; reg = edx, reval = eax |
811 | proc codec_read stdcall, ac_reg:dword ; reg = edx, reval = eax |
827 | 812 | ||
828 | mov edx, [ac_reg] |
813 | mov edx, [ac_reg] |
829 | 814 | ||
830 | mov ebx, edx |
815 | mov ebx, edx |
831 | shr ebx, 1 |
816 | shr ebx, 1 |
832 | bt [codec.shadow_flag], ebx |
817 | bt [codec.shadow_flag], ebx |
833 | jc .use_shadow |
818 | jc .use_shadow |
834 | 819 | ||
835 | call [ctrl.codec_read16] ;change edx !!! |
820 | call [ctrl.codec_read16] ;change edx !!! |
836 | mov ecx, eax |
821 | mov ecx, eax |
837 | 822 | ||
838 | .read_ok: |
823 | .read_ok: |
839 | mov edx, [ac_reg] |
824 | mov edx, [ac_reg] |
840 | mov [codec.regs+edx], cx |
825 | mov [codec.regs+edx], cx |
841 | bts [codec.shadow_flag], ebx |
826 | bts [codec.shadow_flag], ebx |
842 | mov eax, ecx |
827 | mov eax, ecx |
843 | ret |
828 | ret |
844 | .use_shadow: |
829 | .use_shadow: |
845 | movzx eax, word [codec.regs+edx] |
830 | movzx eax, word [codec.regs+edx] |
846 | ret |
831 | ret |
847 | 832 | ||
848 | endp |
833 | endp |
849 | 834 | ||
850 | align 4 |
835 | align 4 |
851 | proc codec_write stdcall, ac_reg:dword |
836 | proc codec_write stdcall, ac_reg:dword |
852 | 837 | ||
853 | mov esi, [ac_reg] |
838 | mov esi, [ac_reg] |
854 | 839 | ||
855 | mov edx, esi |
840 | mov edx, esi |
856 | 841 | ||
857 | call [ctrl.codec_write16] |
842 | call [ctrl.codec_write16] |
858 | 843 | ||
859 | mov [codec.regs+esi], ax |
844 | mov [codec.regs+esi], ax |
860 | shr esi, 1 |
845 | shr esi, 1 |
861 | bts [codec.shadow_flag], esi |
846 | bts [codec.shadow_flag], esi |
862 | 847 | ||
863 | ret |
848 | ret |
864 | endp |
849 | endp |
865 | 850 | ||
866 | align 4 |
851 | align 4 |
867 | proc check_semafore |
852 | proc check_semafore |
868 | align 4 |
853 | align 4 |
869 | .ok: |
854 | .ok: |
870 | xor eax, eax |
855 | xor eax, eax |
871 | inc eax |
856 | inc eax |
872 | ret |
857 | ret |
873 | endp |
858 | endp |
874 | 859 | ||
875 | align 4 |
860 | align 4 |
876 | proc StallExec |
861 | proc StallExec |
877 | push ecx |
862 | push ecx |
878 | push edx |
863 | push edx |
879 | push ebx |
864 | push ebx |
880 | push eax |
865 | push eax |
881 | 866 | ||
882 | mov ecx, CPU_FREQ |
867 | mov ecx, CPU_FREQ |
883 | mul ecx |
868 | mul ecx |
884 | mov ebx, eax ;low |
869 | mov ebx, eax ;low |
885 | mov ecx, edx ;high |
870 | mov ecx, edx ;high |
886 | rdtsc |
871 | rdtsc |
887 | add ebx, eax |
872 | add ebx, eax |
888 | adc ecx, edx |
873 | adc ecx, edx |
889 | @@: |
874 | @@: |
890 | rdtsc |
875 | rdtsc |
891 | sub eax, ebx |
876 | sub eax, ebx |
892 | sbb edx, ecx |
877 | sbb edx, ecx |
893 | js @B |
878 | js @B |
894 | 879 | ||
895 | pop eax |
880 | pop eax |
896 | pop ebx |
881 | pop ebx |
897 | pop edx |
882 | pop edx |
898 | pop ecx |
883 | pop ecx |
899 | ret |
884 | ret |
900 | endp |
885 | endp |
901 | 886 | ||
902 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
887 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
903 | ; CONTROLLER IO functions |
888 | ; CONTROLLER IO functions |
904 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
889 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
905 | 890 | ||
906 | align 4 |
891 | align 4 |
907 | proc codec_io_r16 |
892 | proc codec_io_r16 |
908 | 893 | ||
909 | push edx |
894 | push edx |
910 | mov ecx, 255 |
895 | mov ecx, 255 |
911 | .L1: |
896 | .L1: |
912 | mov edx, FM_CODEC_CMD |
897 | mov edx, FM_CODEC_CMD |
913 | call [ctrl.ctrl_read16] |
898 | call [ctrl.ctrl_read16] |
914 | test ah, FM_CODEC_CMD_BUSY shr 8 |
899 | test ah, FM_CODEC_CMD_BUSY shr 8 |
915 | je .L2 |
900 | je .L2 |
916 | loop .L1 |
901 | loop .L1 |
917 | .L2: |
902 | .L2: |
918 | pop eax |
903 | pop eax |
919 | or al, FM_CODEC_CMD_READ |
904 | or al, FM_CODEC_CMD_READ |
920 | mov edx, FM_CODEC_CMD |
905 | mov edx, FM_CODEC_CMD |
921 | call [ctrl.ctrl_write8] |
906 | call [ctrl.ctrl_write8] |
922 | 907 | ||
923 | mov ecx, 255 |
908 | mov ecx, 255 |
924 | .L3: |
909 | .L3: |
925 | mov edx, FM_CODEC_CMD |
910 | mov edx, FM_CODEC_CMD |
926 | call [ctrl.ctrl_read16] |
911 | call [ctrl.ctrl_read16] |
927 | test ah, FM_CODEC_CMD_VALID shr 8 |
912 | test ah, FM_CODEC_CMD_VALID shr 8 |
928 | jne .L4 |
913 | jne .L4 |
929 | loop .L3 |
914 | loop .L3 |
930 | .L4: |
915 | .L4: |
931 | mov edx, FM_CODEC_DATA |
916 | mov edx, FM_CODEC_DATA |
932 | call [ctrl.ctrl_read16] |
917 | call [ctrl.ctrl_read16] |
933 | 918 | ||
934 | ret |
919 | ret |
935 | endp |
920 | endp |
936 | 921 | ||
937 | align 4 |
922 | align 4 |
938 | proc codec_io_w16 |
923 | proc codec_io_w16 |
939 | 924 | ||
940 | push edx |
925 | push edx |
941 | push eax |
926 | push eax |
942 | mov ecx, 255 |
927 | mov ecx, 255 |
943 | .L1: |
928 | .L1: |
944 | mov edx, FM_CODEC_CMD |
929 | mov edx, FM_CODEC_CMD |
945 | call [ctrl.ctrl_read16] |
930 | call [ctrl.ctrl_read16] |
946 | test ah, FM_CODEC_CMD_BUSY shr 8 |
931 | test ah, FM_CODEC_CMD_BUSY shr 8 |
947 | je .L2 |
932 | je .L2 |
948 | loop .L1 |
933 | loop .L1 |
949 | .L2: |
934 | .L2: |
950 | pop eax |
935 | pop eax |
951 | mov edx, FM_CODEC_DATA |
936 | mov edx, FM_CODEC_DATA |
952 | call [ctrl.ctrl_write16] |
937 | call [ctrl.ctrl_write16] |
953 | 938 | ||
954 | pop eax |
939 | pop eax |
955 | mov edx, FM_CODEC_CMD |
940 | mov edx, FM_CODEC_CMD |
956 | call [ctrl.ctrl_write16] |
941 | call [ctrl.ctrl_write16] |
957 | 942 | ||
958 | ret |
943 | ret |
959 | endp |
944 | endp |
960 | 945 | ||
961 | align 4 |
946 | align 4 |
962 | proc ctrl_io_r8 |
947 | proc ctrl_io_r8 |
963 | add edx, [ctrl.ctrl_io_base] |
948 | add edx, [ctrl.ctrl_io_base] |
964 | in al, dx |
949 | in al, dx |
965 | ret |
950 | ret |
966 | endp |
951 | endp |
967 | 952 | ||
968 | align 4 |
953 | align 4 |
969 | proc ctrl_io_r16 |
954 | proc ctrl_io_r16 |
970 | add edx, [ctrl.ctrl_io_base] |
955 | add edx, [ctrl.ctrl_io_base] |
971 | in ax, dx |
956 | in ax, dx |
972 | ret |
957 | ret |
973 | endp |
958 | endp |
974 | 959 | ||
975 | align 4 |
960 | align 4 |
976 | proc ctrl_io_r32 |
961 | proc ctrl_io_r32 |
977 | add edx, [ctrl.ctrl_io_base] |
962 | add edx, [ctrl.ctrl_io_base] |
978 | in eax, dx |
963 | in eax, dx |
979 | ret |
964 | ret |
980 | endp |
965 | endp |
981 | 966 | ||
982 | align 4 |
967 | align 4 |
983 | proc ctrl_io_w8 |
968 | proc ctrl_io_w8 |
984 | add edx, [ctrl.ctrl_io_base] |
969 | add edx, [ctrl.ctrl_io_base] |
985 | out dx, al |
970 | out dx, al |
986 | ret |
971 | ret |
987 | endp |
972 | endp |
988 | 973 | ||
989 | align 4 |
974 | align 4 |
990 | proc ctrl_io_w16 |
975 | proc ctrl_io_w16 |
991 | add edx, [ctrl.ctrl_io_base] |
976 | add edx, [ctrl.ctrl_io_base] |
992 | out dx, ax |
977 | out dx, ax |
993 | ret |
978 | ret |
994 | endp |
979 | endp |
995 | 980 | ||
996 | align 4 |
981 | align 4 |
997 | proc ctrl_io_w32 |
982 | proc ctrl_io_w32 |
998 | add edx, [ctrl.ctrl_io_base] |
983 | add edx, [ctrl.ctrl_io_base] |
999 | out dx, eax |
984 | out dx, eax |
1000 | ret |
985 | ret |
1001 | endp |
986 | endp |
1002 | 987 | ||
1003 | align 4 |
988 | align 4 |
1004 | dword2str: |
989 | dword2str: |
1005 | mov esi, hex_buff |
990 | mov esi, hex_buff |
1006 | mov ecx, -8 |
991 | mov ecx, -8 |
1007 | @@: |
992 | @@: |
1008 | rol eax, 4 |
993 | rol eax, 4 |
1009 | mov ebx, eax |
994 | mov ebx, eax |
1010 | and ebx, 0x0F |
995 | and ebx, 0x0F |
1011 | mov bl, [ebx+hexletters] |
996 | mov bl, [ebx+hexletters] |
1012 | mov [8+esi+ecx], bl |
997 | mov [8+esi+ecx], bl |
1013 | inc ecx |
998 | inc ecx |
1014 | jnz @B |
999 | jnz @B |
1015 | ret |
1000 | ret |
1016 | 1001 | ||
1017 | hexletters db '0123456789ABCDEF' |
1002 | hexletters db '0123456789ABCDEF' |
1018 | hex_buff db 8 dup(0),13,10,0 |
1003 | hex_buff db 8 dup(0),13,10,0 |
1019 | brg_bus dd ? |
1004 | brg_bus dd ? |
1020 | brg_devfn dd ? |
1005 | brg_devfn dd ? |
1021 | include "codec.inc" |
1006 | include "codec.inc" |
1022 | 1007 | ||
1023 | align 4 |
1008 | align 4 |
1024 | devices dd (CTRL_FM801 shl 16)+VID_FM801, msg_FM801, set_FM |
1009 | devices dd (CTRL_FM801 shl 16)+VID_FM801, msg_FM801, set_FM |
1025 | dd 0 |
1010 | dd 0 |
1026 | - | ||
1027 | version dd (5 shl 16) or (API_VERSION and 0xFFFF) |
- | |
1028 | 1011 | ||
1029 | msg_FM801 db 'FM801 AC97 controller',13,10, 0 |
1012 | msg_FM801 db 'FM801 AC97 controller',13,10, 0 |
1030 | msg_FM db 'Forte Media',13,10, 0 |
1013 | msg_FM db 'Forte Media',13,10, 0 |
1031 | 1014 | ||
1032 | sz_sound_srv db 'SOUND',0 |
1015 | sz_sound_srv db 'SOUND',0 |
1033 | 1016 | ||
1034 | msgInit db 'detect hardware...',13,10,0 |
1017 | msgInit db 'detect hardware...',13,10,0 |
1035 | msgFail db 'device not found',13,10,0 |
1018 | msgFail db 'device not found',13,10,0 |
1036 | msgAttchIRQ db 'IRQ line not supported', 13,10, 0 |
1019 | msgAttchIRQ db 'IRQ line not supported', 13,10, 0 |
1037 | msgInvIRQ db 'IRQ line not assigned or invalid', 13,10, 0 |
1020 | msgInvIRQ db 'IRQ line not assigned or invalid', 13,10, 0 |
1038 | msgPlay db 'start play', 13,10,0 |
1021 | msgPlay db 'start play', 13,10,0 |
1039 | msgStop db 'stop play', 13,10,0 |
1022 | msgStop db 'stop play', 13,10,0 |
1040 | ;msgNotify db 'call notify',13,10,0 |
1023 | ;msgNotify db 'call notify',13,10,0 |
1041 | msgIRQ db 'AC97 IRQ', 13,10,0 |
1024 | msgIRQ db 'AC97 IRQ', 13,10,0 |
1042 | msgInitCtrl db 'init controller',13,10,0 |
1025 | msgInitCtrl db 'init controller',13,10,0 |
1043 | msgInitCodec db 'init codec',13,10,0 |
1026 | msgInitCodec db 'init codec',13,10,0 |
1044 | msgPrimBuff db 'create primary buffer ...',0 |
1027 | msgPrimBuff db 'create primary buffer ...',0 |
1045 | msgDone db 'done',13,10,0 |
1028 | msgDone db 'done',13,10,0 |
1046 | ;msgReg db 'set service handler',13,10,0 |
1029 | ;msgReg db 'set service handler',13,10,0 |
1047 | ;msgOk db 'service installed',13,10,0 |
1030 | ;msgOk db 'service installed',13,10,0 |
1048 | ;msgStatus db 'global status ',0 |
1031 | ;msgStatus db 'global status ',0 |
1049 | ;msgControl db 'global control ',0 |
1032 | ;msgControl db 'global control ',0 |
1050 | msgPciCmd db 'PCI command ',0 |
1033 | msgPciCmd db 'PCI command ',0 |
1051 | msgPciStat db 'PCI status ',0 |
1034 | msgPciStat db 'PCI status ',0 |
1052 | msgCtrlIsaIo db 'controller io base ',0 |
1035 | msgCtrlIsaIo db 'controller io base ',0 |
1053 | msgIrqNum db 'IRQ default ',0 |
1036 | msgIrqNum db 'IRQ default ',0 |
1054 | ;msgIrqMap db 'AC97 irq map as ',0 |
1037 | ;msgIrqMap db 'AC97 irq map as ',0 |
- | 1038 | ||
- | 1039 | align 4 |
|
1055 | 1040 | data fixups |
|
1056 | section '.data' data readable writable align 16 |
1041 | end data |
1057 | 1042 | ||
1058 | codec CODEC |
1043 | codec CODEC |
1059 | ctrl AC_CNTRL |
1044 | ctrl AC_CNTRL |
1060 | 1045 | ||
1061 | int_flip_flop rd 1 |
1046 | int_flip_flop rd 1 |
1062 | buffer_pgaddr rd 1 |
1047 | buffer_pgaddr rd 1 |