SID6581 The driver for the SID allows reading and writing bytes or sequences of bytes to/from the SID6581 installed on the PCI catweasel controller. If no SID is installed on the controller, the driver is not loaded and, therefore, cannot be opened. API: The name of the device is set to "\Device\SID6581_0", with higher number for the last digit, if more than one is installed. The user-mode name to be used with the CreateFile function is "\\.\SID6581_0". The file SID6581_usr.h defines the driver commands for C Programmers. It contains the defines for the IO control commands. To use: find/open the device by using the CreateFile function. Example: SIDhandle=CreateFile( "\\\\.\\SID6581_0", GENERIC_READ, FILE_SHARE_WRITE|FILE_SHARE_READ, 0L, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0L ); As with any file-handle, you may also specify to use overlapped IO. If it does not return INVALID_HANDLE_VALUE (windows define for 0xFFFFFFFF), you have a handle to the SID6581 driver. To send commands, use the DeviceIoControl function. See the MSDN documentation for details on CreateFile, DeviceIoControl, CloseHandle and overlapped IO. The DeviceIoControl requires a control code and input and output buffers. The control codes are defined in SID6581_usr.h. The header file also containes comments on the data to be placed in the buffers. The input and output referred to is passed in the buffers for the DeviceIoControl function. For simple Operation, you will only need the SID_SID_PEEK_POKE IO command. For example, to set the volume of the SID, this function might be used: int set_vol(unsigned char vol,HANDLE SIDhandle) { unsigned char buffer[2]; DWORD dummy; buffer[0]=24; //volume register on SID buffer[1]=vol&0x0FU; if(!DeviceIoControl(SIDhandle,SID_SID_PEEK_POKE,buffer,2,0L,0UL,&dummy,0L)) { //failed. driver error. return 0; } return 1; }