OpenCores
URL https://opencores.org/ocsvn/psg16/psg16/trunk

Subversion Repositories psg16

[/] [psg16/] [trunk/] [software/] [code snippets/] [SetupAC97.asm] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 robfinch
AC97            EQU             0xFFFF_FFFF_FFDC_1000
2
;--------------------------------------------------------------------------
3
; Setup the AC97/LM4550 audio controller. Check keyboard for a CTRL-C
4
; interrupt which may be necessary if the audio controller isn't
5
; responding.
6
;--------------------------------------------------------------------------
7
;
8
SetupAC97:
9
        subui   sp,sp,#16
10
        sm              [sp],r1/lr
11
sac974:
12
        sc              r0,AC97+0x26    ; trigger a read of register 26 (status reg)
13
sac971:                                         ; wait for status to register 0xF (all ready)
14
        call    KeybdGetChar    ; see if we needed to CTRL-C
15
        beqi    r1,#CTRLC,sac973
16
        lc              r1,AC97+0x68    ; wait for dirty bit to clear
17
        bne             r1,r0,sac971
18
        lc              r1,AC97+0x26    ; check status at reg h26, wait for
19
        andi    r1,r1,#0x0F             ; analogue to be ready
20
        bnei    r1,#0x0F,sac974
21
sac973:
22
        sc              r0,AC97+2               ; master volume, 0db attenuation, mute off
23
        sc              r0,AC97+4               ; headphone volume, 0db attenuation, mute off
24
        sc              r0,AC97+0x18    ; PCM gain (mixer) mute off, no attenuation
25
        sc              r0,AC97+0x0A    ; mute PC beep
26
        setlo   r1,#0x8000              ; bypass 3D sound
27
        sc              r1,AC97+0x20
28
sac972:
29
        call    KeybdGetChar
30
        beqi    r1,#CTRLC,sac975
31
        lc              r1,AC97+0x68    ; wait for dirty bits to clear
32
        bne             r1,r0,sac972    ; wait a while for the settings to take effect
33
sac975:
34
        lm              [sp],r1/lr
35
        addui   sp,sp,#16
36
        ret

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.