5 #include <proto/exec.h>
7 #include "emu10kx-ac97.h"
8 #include "linuxsupport.h"
15 struct Library
* EMU10kxBase
;
16 struct EMU10kxAC97
* EMU10kxAC97
;
19 EMU10kxBase
= OpenLibrary( "DEVS:AHI/emu10kx.audio", VERSION
);
21 if( EMU10kxBase
== NULL
)
23 Printf( "Unable to open DEVS:AHI/emu10kx.audio version %ld.\n", VERSION
);
28 EMU10kxAC97
= (struct EMU10kxAC97
*) FindSemaphore( EMU10KX_AC97_SEMAPHORE
);
29 if( EMU10kxAC97
!= NULL
)
31 ObtainSemaphore( &EMU10kxAC97
->Semaphore
);
35 if( EMU10kxAC97
== NULL
)
37 CloseLibrary( EMU10kxBase
);
38 Printf( "Unable to find semaphore '%s'.\n", (ULONG
) EMU10KX_AC97_SEMAPHORE
);
42 Printf( "%ld EMU10kx cards found.\n", EMU10kxAC97
->Cards
);
44 value
= CallHook( &EMU10kxAC97
->GetFunc
, (Object
*) EMU10kxBase
,
47 Printf( "CD volume on card 0 is 0x%04lx\n", value
);
49 Printf( "Setting it to 0x0000.\n" );
50 CallHook( &EMU10kxAC97
->SetFunc
, (Object
*) EMU10kxBase
, 0, AC97_CD_VOL
, 0 );
54 Printf( "Restoring it.\n" );
55 CallHook( &EMU10kxAC97
->SetFunc
, (Object
*) EMU10kxBase
, 0, AC97_CD_VOL
, value
);
57 Printf( "Exiting.\n" );
59 if( EMU10kxAC97
!= NULL
)
61 ReleaseSemaphore( &EMU10kxAC97
->Semaphore
);
64 CloseLibrary( EMU10kxBase
);