2 #include <resources/isapnp.h>
4 #include <proto/exec.h>
5 #include <proto/isapnp.h>
10 struct Library
* ISAPNPBase
;
19 struct ISAPNP_Device
* dev
[2];
21 UWORD ioregs
[ 3 ] = { 0, 0, 0 };
22 struct ISAPNP_IOResource
* r
;
25 ISAPNPBase
= OpenResource( ISAPNPNAME
);
27 if( ISAPNPBase
== NULL
)
29 printf( "No " ISAPNPNAME
".\n" );
33 dev
[ 0 ] = ISAPNP_FindDevice( NULL
,
34 ISAPNP_MAKE_ID( 'C', 'T', 'L' ),
37 if( dev
[ 0 ] == NULL
)
39 printf( "SB AWE Wavetable device found.\n" );
45 lock
= ISAPNP_LockDevicesA( ISAPNP_LOCKF_NONE
, dev
);
49 printf( "Unable to lock device?\n" );
54 for( r
= (struct ISAPNP_IOResource
*) dev
[ 0 ]->isapnpd_Resources
.mlh_Head
, o
= 0;
55 r
->isapnpior_MinNode
.mln_Succ
!= NULL
;
56 r
= (struct ISAPNP_IOResource
*) r
->isapnpior_MinNode
.mln_Succ
, ++o
)
60 printf( "Unexpected number of io registers!\n" );
64 ioregs
[ o
] = r
->isapnpior_MinBase
;
67 if( ioregs
[ 2 ] != 0 )
69 play( ioregs
[ 0 ], ioregs
[ 1 ], ioregs
[ 2 ] );
72 ISAPNP_UnlockDevices( lock
);
82 printf( "1: %04lx; 2: %04lx; 3: %04lx\n", r1
, r2
, r3
);