#define FXGPREGBASE 0x100 /* FX general purpose registers base */
#define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */
+#define A_TANKMEMCTLREGBASE 0x100 /* Tank memory control registers base - only for Audigy */
+#define A_TANKMEMCTLREG_MASK 0x1f /* only 5 bits used - only for Audigy */
+
/* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is */
/* decompressed back to 20 bits on a read. There are a total of 160 locations, the last 32 */
/* locations are for external TRAM. */
struct list_head list; /* list link container */
unsigned int vcount;
unsigned int count; /* count of GPR (1..16) */
- unsigned char gpr[32]; /* GPR number(s) */
+ unsigned short gpr[32]; /* GPR number(s) */
unsigned int value[32];
unsigned int min; /* minimum range */
unsigned int max; /* maximum range */
typedef struct _snd_emu10k1_fx8010_irq {
struct _snd_emu10k1_fx8010_irq *next;
snd_fx8010_irq_handler_t *handler;
- unsigned char gpr_running;
+ unsigned short gpr_running;
void *private_data;
} snd_emu10k1_fx8010_irq_t;
unsigned int channels; /* 16-bit channels count */
unsigned int tram_start; /* initial ring buffer position in TRAM (in samples) */
unsigned int buffer_size; /* count of buffered samples */
- unsigned char gpr_size; /* GPR containing size of ring buffer in samples (host) */
- unsigned char gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
- unsigned char gpr_count; /* GPR containing count of samples between two interrupts (host) */
- unsigned char gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
- unsigned char gpr_trigger; /* GPR containing trigger (activate) information (host) */
- unsigned char gpr_running; /* GPR containing info if PCM is running (FX8010) */
+ unsigned short gpr_size; /* GPR containing size of ring buffer in samples (host) */
+ unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
+ unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */
+ unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
+ unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
+ unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
unsigned char etram[32]; /* external TRAM address & data */
snd_pcm_indirect_t pcm_rec;
unsigned int tram_pos;
#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
+#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
+#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
+#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
+#define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
+#define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
+#define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
+
#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f? */
#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x1f? */
#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f? */
#define A_C_00100000 0xd5
#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
#define A_GPR_COND 0xd7 /* CCR, condition register */
-/* 0xd8 = noise1 */
-/* 0xd9 = noise2 */
+#define A_GPR_NOISE0 0xd8 /* noise source */
+#define A_GPR_NOISE1 0xd9 /* noise source */
+#define A_GPR_IRQ 0xda /* IRQ register */
+#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
+#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
/* definitions for debug register */
#define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */
snd_ctl_elem_id_t id; /* full control ID definition */
unsigned int vcount; /* visible count */
unsigned int count; /* count of GPR (1..16) */
- unsigned char gpr[32]; /* GPR number(s) */
+ unsigned short gpr[32]; /* GPR number(s) */
unsigned int value[32]; /* initial values */
unsigned int min; /* minimum range */
unsigned int max; /* maximum range */
typedef struct {
char name[128];
- unsigned long gpr_valid[0x100/(sizeof(unsigned long)*8)]; /* bitmask of valid initializers */
- unsigned int gpr_map[0x100]; /* initializers */
+ DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
+ unsigned int gpr_map[0x200]; /* initializers */
unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
emu10k1_fx8010_control_gpr_t __user *gpr_add_controls; /* GPR controls to add/replace */
unsigned int gpr_list_control_total; /* total count of GPR controls */
emu10k1_fx8010_control_gpr_t __user *gpr_list_controls; /* listed GPR controls */
- unsigned long tram_valid[0xa0/(sizeof(unsigned long)*8)]; /* bitmask of valid initializers */
- unsigned int tram_data_map[0xa0]; /* data initializers */
- unsigned int tram_addr_map[0xa0]; /* map initializers */
+ DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
+ unsigned int tram_data_map[0x100]; /* data initializers */
+ unsigned int tram_addr_map[0x100]; /* map initializers */
- unsigned long code_valid[512/(sizeof(unsigned long)*8)]; /* bitmask of valid instructions */
- unsigned int code[512][2]; /* one instruction - 64 bits */
+ DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
+ unsigned int code[1024][2]; /* one instruction - 64 bits */
} emu10k1_fx8010_code_t;
typedef struct {
unsigned int channels; /* 16-bit channels count, zero = remove this substream */
unsigned int tram_start; /* ring buffer position in TRAM (in samples) */
unsigned int buffer_size; /* count of buffered samples */
- unsigned char gpr_size; /* GPR containing size of ringbuffer in samples (host) */
- unsigned char gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
- unsigned char gpr_count; /* GPR containing count of samples between two interrupts (host) */
- unsigned char gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
- unsigned char gpr_trigger; /* GPR containing trigger (activate) information (host) */
- unsigned char gpr_running; /* GPR containing info if PCM is running (FX8010) */
+ unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */
+ unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
+ unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */
+ unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
+ unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
+ unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
unsigned char pad; /* reserved */
unsigned char etram[32]; /* external TRAM address & data (one per channel) */
unsigned int res2; /* reserved */