#ifndef __6581_H
#define __6581_H


#include "mytypes.h"



#define SID_NUM_MAX				3
#define SID_REGS				25

#define BV(n)					(1 << (n))

#define CHAN_DISABLED(f, n)		((f) & BV(n))
#define DISABLE_CHAN(f, n)		(f) |= BV(n)
#define ENABLE_CHAN(f, n)		(f) &= ~BV(n)
#define FILTER_DISABLED(f, n)	((f) & BV((n) + 10))
#define DISABLE_FILTER(f, n)	(f) |= BV((n) + 10)
#define ENABLE_FILTER(f, n)		(f) &= ~BV((n) + 10)



void sidConfigure(uword *_sidPorts, int _clockSpeed);

void sidReset(int);
void sidResume(int sidChipNum);
void sidSetDisChan(uword disChan);
void sidWriteData(int sidChipNum, uword reg, ubyte data);



#endif // __6581_H

