URL
https://opencores.org/ocsvn/psg16/psg16/trunk
Subversion Repositories psg16
[/] [psg16/] [trunk/] [software/] [code snippets/] [SetupAC97.asm] - Rev 2
Compare with Previous | Blame | View Log
AC97 EQU 0xFFFF_FFFF_FFDC_1000;--------------------------------------------------------------------------; Setup the AC97/LM4550 audio controller. Check keyboard for a CTRL-C; interrupt which may be necessary if the audio controller isn't; responding.;--------------------------------------------------------------------------;SetupAC97:subui sp,sp,#16sm [sp],r1/lrsac974:sc r0,AC97+0x26 ; trigger a read of register 26 (status reg)sac971: ; wait for status to register 0xF (all ready)call KeybdGetChar ; see if we needed to CTRL-Cbeqi r1,#CTRLC,sac973lc r1,AC97+0x68 ; wait for dirty bit to clearbne r1,r0,sac971lc r1,AC97+0x26 ; check status at reg h26, wait forandi r1,r1,#0x0F ; analogue to be readybnei r1,#0x0F,sac974sac973:sc r0,AC97+2 ; master volume, 0db attenuation, mute offsc r0,AC97+4 ; headphone volume, 0db attenuation, mute offsc r0,AC97+0x18 ; PCM gain (mixer) mute off, no attenuationsc r0,AC97+0x0A ; mute PC beepsetlo r1,#0x8000 ; bypass 3D soundsc r1,AC97+0x20sac972:call KeybdGetCharbeqi r1,#CTRLC,sac975lc r1,AC97+0x68 ; wait for dirty bits to clearbne r1,r0,sac972 ; wait a while for the settings to take effectsac975:lm [sp],r1/lraddui sp,sp,#16ret
