* handles correctly failures during setup
* style fixes * fixed warnings git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33279 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -88,7 +88,8 @@ emuxki_settings current_settings = {
|
|||||||
2 // buffer count
|
2 // buffer count
|
||||||
};
|
};
|
||||||
|
|
||||||
status_t emuxki_init(emuxki_dev * card);
|
status_t emuxki_init(emuxki_dev *card);
|
||||||
|
void emuxki_shutdown(emuxki_dev *card);
|
||||||
|
|
||||||
extern device_hooks multi_hooks;
|
extern device_hooks multi_hooks;
|
||||||
extern device_hooks midi_hooks;
|
extern device_hooks midi_hooks;
|
||||||
@@ -135,13 +136,14 @@ dump_hardware_regs(device_config *config)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
|
/*static void
|
||||||
trace_hardware_regs(device_config *config)
|
trace_hardware_regs(device_config *config)
|
||||||
{
|
{
|
||||||
TRACE(("EMU_IPR = %#08x\n",emuxki_reg_read_32(config, EMU_IPR)));
|
TRACE(("EMU_IPR = %#08x\n",emuxki_reg_read_32(config, EMU_IPR)));
|
||||||
TRACE(("EMU_INTE = %#08x\n",emuxki_reg_read_32(config, EMU_INTE)));
|
TRACE(("EMU_INTE = %#08x\n",emuxki_reg_read_32(config, EMU_INTE)));
|
||||||
TRACE(("EMU_HCFG = %#08x\n",emuxki_reg_read_32(config, EMU_HCFG)));
|
TRACE(("EMU_HCFG = %#08x\n",emuxki_reg_read_32(config, EMU_HCFG)));
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/* Misc stuff relative to Emuxki */
|
/* Misc stuff relative to Emuxki */
|
||||||
|
|
||||||
@@ -151,6 +153,7 @@ int emu10k1_recbuf_sizes[] = {
|
|||||||
14366, 16384, 20480, 24576, 28672, 32768, 40960, 49152, 57344, 65536
|
14366, 16384, 20480, 24576, 28672, 32768, 40960, 49152, 57344, 65536
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static uint32
|
static uint32
|
||||||
emuxki_rate_to_pitch(uint32 rate)
|
emuxki_rate_to_pitch(uint32 rate)
|
||||||
{
|
{
|
||||||
@@ -230,6 +233,7 @@ emuxki_mem_new(emuxki_dev *card, int ptbidx, size_t size)
|
|||||||
return mem;
|
return mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emuxki_mem_delete(emuxki_mem *mem)
|
emuxki_mem_delete(emuxki_mem *mem)
|
||||||
{
|
{
|
||||||
@@ -238,6 +242,7 @@ emuxki_mem_delete(emuxki_mem *mem)
|
|||||||
free(mem);
|
free(mem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *
|
void *
|
||||||
emuxki_pmem_alloc(emuxki_dev *card, size_t size)
|
emuxki_pmem_alloc(emuxki_dev *card, size_t size)
|
||||||
{
|
{
|
||||||
@@ -290,6 +295,7 @@ emuxki_pmem_alloc(emuxki_dev *card, size_t size)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *
|
void *
|
||||||
emuxki_rmem_alloc(emuxki_dev *card, size_t size)
|
emuxki_rmem_alloc(emuxki_dev *card, size_t size)
|
||||||
{
|
{
|
||||||
@@ -307,6 +313,7 @@ emuxki_rmem_alloc(emuxki_dev *card, size_t size)
|
|||||||
return mem->log_base;
|
return mem->log_base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
emuxki_mem_free(emuxki_dev *card, void *ptr)
|
emuxki_mem_free(emuxki_dev *card, void *ptr)
|
||||||
{
|
{
|
||||||
@@ -404,6 +411,7 @@ emuxki_chanparms_set_defaults(emuxki_channel *chan)
|
|||||||
chan->tremolo_depth = 0x00;
|
chan->tremolo_depth = 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static emuxki_channel *
|
static emuxki_channel *
|
||||||
emuxki_channel_new(emuxki_voice *voice, uint8 num)
|
emuxki_channel_new(emuxki_voice *voice, uint8 num)
|
||||||
{
|
{
|
||||||
@@ -419,6 +427,7 @@ emuxki_channel_new(emuxki_voice *voice, uint8 num)
|
|||||||
return chan;
|
return chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emuxki_channel_delete(emuxki_channel *chan)
|
emuxki_channel_delete(emuxki_channel *chan)
|
||||||
{
|
{
|
||||||
@@ -426,6 +435,7 @@ emuxki_channel_delete(emuxki_channel *chan)
|
|||||||
free(chan);
|
free(chan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emuxki_channel_set_fxsend(emuxki_channel *chan,
|
emuxki_channel_set_fxsend(emuxki_channel *chan,
|
||||||
emuxki_chanparms_fxsend *fxsend)
|
emuxki_chanparms_fxsend *fxsend)
|
||||||
@@ -451,6 +461,7 @@ emuxki_channel_set_fxsend(emuxki_channel *chan,
|
|||||||
chan->fxsend.h.dest = fxsend->h.dest;
|
chan->fxsend.h.dest = fxsend->h.dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emuxki_channel_set_srate(emuxki_channel *chan, uint32 srate)
|
emuxki_channel_set_srate(emuxki_channel *chan, uint32 srate)
|
||||||
{
|
{
|
||||||
@@ -463,6 +474,7 @@ emuxki_channel_set_srate(emuxki_channel *chan, uint32 srate)
|
|||||||
(emuxki_rate_to_pitch(srate) >> 8) & EMU_CHAN_IP_MASK;
|
(emuxki_rate_to_pitch(srate) >> 8) & EMU_CHAN_IP_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* voice params must be set before calling this */
|
/* voice params must be set before calling this */
|
||||||
static void
|
static void
|
||||||
emuxki_channel_set_bufparms(emuxki_channel *chan,
|
emuxki_channel_set_bufparms(emuxki_channel *chan,
|
||||||
@@ -472,6 +484,7 @@ emuxki_channel_set_bufparms(emuxki_channel *chan,
|
|||||||
chan->loop.end = end & EMU_CHAN_DSL_LOOPENDADDR_MASK;
|
chan->loop.end = end & EMU_CHAN_DSL_LOOPENDADDR_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emuxki_channel_commit_fx(emuxki_channel *chan)
|
emuxki_channel_commit_fx(emuxki_channel *chan)
|
||||||
{
|
{
|
||||||
@@ -515,6 +528,7 @@ emuxki_channel_commit_fx(emuxki_channel *chan)
|
|||||||
(chan->fxsend.c.level << 24) | chan->loop.start);
|
(chan->fxsend.c.level << 24) | chan->loop.start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emuxki_channel_commit_parms(emuxki_channel *chan)
|
emuxki_channel_commit_parms(emuxki_channel *chan)
|
||||||
{
|
{
|
||||||
@@ -576,6 +590,7 @@ emuxki_channel_commit_parms(emuxki_channel *chan)
|
|||||||
//splx(s);
|
//splx(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emuxki_channel_start(emuxki_channel *chan)
|
emuxki_channel_start(emuxki_channel *chan)
|
||||||
{
|
{
|
||||||
@@ -622,6 +637,7 @@ emuxki_channel_start(emuxki_channel *chan)
|
|||||||
//splx(s);
|
//splx(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emuxki_channel_stop(emuxki_channel *chan)
|
emuxki_channel_stop(emuxki_channel *chan)
|
||||||
{
|
{
|
||||||
@@ -641,8 +657,9 @@ emuxki_channel_stop(emuxki_channel *chan)
|
|||||||
//splx(s);
|
//splx(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Emuxki voice functions */
|
/* Emuxki voice functions */
|
||||||
static void
|
/*static void
|
||||||
emuxki_dump_voice(emuxki_voice *voice)
|
emuxki_dump_voice(emuxki_voice *voice)
|
||||||
{
|
{
|
||||||
LOG(("voice->use = %#u\n", voice->use));
|
LOG(("voice->use = %#u\n", voice->use));
|
||||||
@@ -662,7 +679,8 @@ emuxki_dump_voice(emuxki_voice *voice)
|
|||||||
LOG(("voice->trigblk = %#u\n", voice->trigblk));
|
LOG(("voice->trigblk = %#u\n", voice->trigblk));
|
||||||
LOG(("voice->blkmod = %#u\n", voice->blkmod));
|
LOG(("voice->blkmod = %#u\n", voice->blkmod));
|
||||||
LOG(("voice->timerate = %#u\n", voice->timerate));
|
LOG(("voice->timerate = %#u\n", voice->timerate));
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
/* Allocate channels for voice in case of play voice */
|
/* Allocate channels for voice in case of play voice */
|
||||||
static status_t
|
static status_t
|
||||||
@@ -700,6 +718,7 @@ emuxki_voice_channel_create(emuxki_voice *voice)
|
|||||||
return EAGAIN;
|
return EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* When calling this function we assume no one can access the voice */
|
/* When calling this function we assume no one can access the voice */
|
||||||
static void
|
static void
|
||||||
emuxki_voice_channel_destroy(emuxki_voice *voice)
|
emuxki_voice_channel_destroy(emuxki_voice *voice)
|
||||||
@@ -711,6 +730,7 @@ emuxki_voice_channel_destroy(emuxki_voice *voice)
|
|||||||
voice->dataloc.chan[1] = NULL;
|
voice->dataloc.chan[1] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
emuxki_voice_dataloc_create(emuxki_voice *voice)
|
emuxki_voice_dataloc_create(emuxki_voice *voice)
|
||||||
{
|
{
|
||||||
@@ -725,6 +745,7 @@ emuxki_voice_dataloc_create(emuxki_voice *voice)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emuxki_voice_dataloc_destroy(emuxki_voice *voice)
|
emuxki_voice_dataloc_destroy(emuxki_voice *voice)
|
||||||
{
|
{
|
||||||
@@ -750,10 +771,12 @@ emuxki_voice_dataloc_destroy(emuxki_voice *voice)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
emuxki_chan_write(&voice->stream->card->config, 0, buffaddr_reg, 0);
|
emuxki_chan_write(&voice->stream->card->config, 0, buffaddr_reg, 0);
|
||||||
emuxki_chan_write(&voice->stream->card->config, 0, buffsize_reg, EMU_RECBS_BUFSIZE_NONE);
|
emuxki_chan_write(&voice->stream->card->config, 0, buffsize_reg,
|
||||||
|
EMU_RECBS_BUFSIZE_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emuxki_voice_fxupdate(emuxki_voice *voice)
|
emuxki_voice_fxupdate(emuxki_voice *voice)
|
||||||
{
|
{
|
||||||
@@ -1017,6 +1040,7 @@ emuxki_voice_fxupdate(emuxki_voice *voice)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
emuxki_voice_set_stereo(emuxki_voice *voice, uint8 stereo)
|
emuxki_voice_set_stereo(emuxki_voice *voice, uint8 stereo)
|
||||||
{
|
{
|
||||||
@@ -1030,6 +1054,7 @@ emuxki_voice_set_stereo(emuxki_voice *voice, uint8 stereo)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
emuxki_voice_set_srate(emuxki_voice *voice, uint32 srate)
|
emuxki_voice_set_srate(emuxki_voice *voice, uint32 srate)
|
||||||
{
|
{
|
||||||
@@ -1045,6 +1070,7 @@ emuxki_voice_set_srate(emuxki_voice *voice, uint32 srate)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
emuxki_voice_set_audioparms(emuxki_voice *voice, uint8 stereo,
|
emuxki_voice_set_audioparms(emuxki_voice *voice, uint8 stereo,
|
||||||
uint8 b16, uint32 srate)
|
uint8 b16, uint32 srate)
|
||||||
@@ -1065,6 +1091,7 @@ emuxki_voice_set_audioparms(emuxki_voice *voice, uint8 stereo,
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
emuxki_voice_set_recparms(emuxki_voice *voice, emuxki_recsrc_t recsrc,
|
emuxki_voice_set_recparms(emuxki_voice *voice, emuxki_recsrc_t recsrc,
|
||||||
emuxki_recparams *recparams)
|
emuxki_recparams *recparams)
|
||||||
@@ -1090,6 +1117,7 @@ emuxki_voice_set_recparms(emuxki_voice *voice, emuxki_recsrc_t recsrc,
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* voice audio parms (see just before) must be set prior to this */
|
/* voice audio parms (see just before) must be set prior to this */
|
||||||
status_t
|
status_t
|
||||||
emuxki_voice_set_bufparms(emuxki_voice *voice, void *ptr,
|
emuxki_voice_set_bufparms(emuxki_voice *voice, void *ptr,
|
||||||
@@ -1137,6 +1165,7 @@ emuxki_voice_set_bufparms(emuxki_voice *voice, void *ptr,
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
emuxki_voice_commit_parms(emuxki_voice *voice)
|
emuxki_voice_commit_parms(emuxki_voice *voice)
|
||||||
{
|
{
|
||||||
@@ -1178,6 +1207,7 @@ emuxki_voice_commit_parms(emuxki_voice *voice)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static uint32
|
static uint32
|
||||||
emuxki_voice_curaddr(emuxki_voice *voice)
|
emuxki_voice_curaddr(emuxki_voice *voice)
|
||||||
{
|
{
|
||||||
@@ -1209,6 +1239,7 @@ emuxki_voice_curaddr(emuxki_voice *voice)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emuxki_resched_timer(emuxki_dev *card)
|
emuxki_resched_timer(emuxki_dev *card)
|
||||||
{
|
{
|
||||||
@@ -1252,6 +1283,7 @@ emuxki_resched_timer(emuxki_dev *card)
|
|||||||
//splx(s);
|
//splx(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static uint32
|
static uint32
|
||||||
emuxki_voice_adc_rate(emuxki_voice *voice)
|
emuxki_voice_adc_rate(emuxki_voice *voice)
|
||||||
{
|
{
|
||||||
@@ -1298,6 +1330,7 @@ emuxki_voice_adc_rate(emuxki_voice *voice)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
emuxki_voice_start(emuxki_voice *voice)
|
emuxki_voice_start(emuxki_voice *voice)
|
||||||
{
|
{
|
||||||
@@ -1352,6 +1385,7 @@ emuxki_voice_start(emuxki_voice *voice)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
emuxki_voice_halt(emuxki_voice *voice)
|
emuxki_voice_halt(emuxki_voice *voice)
|
||||||
{
|
{
|
||||||
@@ -1389,6 +1423,7 @@ emuxki_voice_halt(emuxki_voice *voice)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
emuxki_voice *
|
emuxki_voice *
|
||||||
emuxki_voice_new(emuxki_stream *stream, uint8 use, uint8 voicenum)
|
emuxki_voice_new(emuxki_stream *stream, uint8 use, uint8 voicenum)
|
||||||
{
|
{
|
||||||
@@ -1419,6 +1454,7 @@ emuxki_voice_new(emuxki_stream *stream, uint8 use, uint8 voicenum)
|
|||||||
return voice;
|
return voice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
emuxki_voice_delete(emuxki_voice *voice)
|
emuxki_voice_delete(emuxki_voice *voice)
|
||||||
{
|
{
|
||||||
@@ -1479,13 +1515,16 @@ emuxki_stream_set_audioparms(emuxki_stream *stream, bool stereo, uint8 channels,
|
|||||||
if (!stream->first_voice)
|
if (!stream->first_voice)
|
||||||
stream->first_voice = voice;
|
stream->first_voice = voice;
|
||||||
LIST_INSERT_HEAD((&stream->voices), voice, next);
|
LIST_INSERT_HEAD((&stream->voices), voice, next);
|
||||||
if ((error = emuxki_voice_set_audioparms(voice, stream->stereo, stream->b16, stream->sample_rate)))
|
if ((error = emuxki_voice_set_audioparms(voice, stream->stereo,
|
||||||
|
stream->b16, stream->sample_rate)))
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if (stream->use & EMU_USE_PLAY)
|
if (stream->use & EMU_USE_PLAY)
|
||||||
buffer = emuxki_pmem_alloc(stream->card, stream->bufframes * frame_size * stream->bufcount);
|
buffer = emuxki_pmem_alloc(stream->card, stream->bufframes
|
||||||
|
* frame_size * stream->bufcount);
|
||||||
else
|
else
|
||||||
buffer = emuxki_rmem_alloc(stream->card, stream->bufframes * frame_size * stream->bufcount);
|
buffer = emuxki_rmem_alloc(stream->card, stream->bufframes
|
||||||
|
* frame_size * stream->bufcount);
|
||||||
|
|
||||||
emuxki_voice_set_bufparms(voice, buffer,
|
emuxki_voice_set_bufparms(voice, buffer,
|
||||||
stream->bufframes * frame_size * stream->bufcount,
|
stream->bufframes * frame_size * stream->bufcount,
|
||||||
@@ -1496,6 +1535,7 @@ emuxki_stream_set_audioparms(emuxki_stream *stream, bool stereo, uint8 channels,
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
emuxki_stream_set_recparms(emuxki_stream *stream, emuxki_recsrc_t recsrc,
|
emuxki_stream_set_recparms(emuxki_stream *stream, emuxki_recsrc_t recsrc,
|
||||||
emuxki_recparams *recparams)
|
emuxki_recparams *recparams)
|
||||||
@@ -1527,6 +1567,7 @@ emuxki_stream_set_recparms(emuxki_stream *stream, emuxki_recsrc_t recsrc,
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
emuxki_stream_commit_parms(emuxki_stream *stream)
|
emuxki_stream_commit_parms(emuxki_stream *stream)
|
||||||
{
|
{
|
||||||
@@ -1541,6 +1582,7 @@ emuxki_stream_commit_parms(emuxki_stream *stream)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
emuxki_stream_get_nth_buffer(emuxki_stream *stream, uint8 chan, uint8 buf,
|
emuxki_stream_get_nth_buffer(emuxki_stream *stream, uint8 chan, uint8 buf,
|
||||||
char** buffer, size_t *stride)
|
char** buffer, size_t *stride)
|
||||||
@@ -1563,7 +1605,8 @@ emuxki_stream_get_nth_buffer(emuxki_stream *stream, uint8 chan, uint8 buf,
|
|||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
if (voice) {
|
if (voice) {
|
||||||
*buffer = (char*)voice->buffer->log_base + (buf * stream->bufframes * sample_size * 2);
|
*buffer = (char*)voice->buffer->log_base
|
||||||
|
+ (buf * stream->bufframes * sample_size * 2);
|
||||||
if (chan % 2 == 1)
|
if (chan % 2 == 1)
|
||||||
*buffer += sample_size;
|
*buffer += sample_size;
|
||||||
*stride = sample_size * 2;
|
*stride = sample_size * 2;
|
||||||
@@ -1579,7 +1622,8 @@ emuxki_stream_get_nth_buffer(emuxki_stream *stream, uint8 chan, uint8 buf,
|
|||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
if (voice) {
|
if (voice) {
|
||||||
*buffer = (char*)voice->buffer->log_base + (buf * stream->bufframes * sample_size);
|
*buffer = (char*)voice->buffer->log_base
|
||||||
|
+ (buf * stream->bufframes * sample_size);
|
||||||
*stride = sample_size;
|
*stride = sample_size;
|
||||||
} else
|
} else
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
@@ -1588,6 +1632,7 @@ emuxki_stream_get_nth_buffer(emuxki_stream *stream, uint8 chan, uint8 buf,
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
emuxki_stream_start(emuxki_stream *stream, void (*inth) (void *), void *inthparam)
|
emuxki_stream_start(emuxki_stream *stream, void (*inth) (void *), void *inthparam)
|
||||||
{
|
{
|
||||||
@@ -1603,6 +1648,7 @@ emuxki_stream_start(emuxki_stream *stream, void (*inth) (void *), void *inthpara
|
|||||||
stream->state |= EMU_STATE_STARTED;
|
stream->state |= EMU_STATE_STARTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
emuxki_stream_halt(emuxki_stream *stream)
|
emuxki_stream_halt(emuxki_stream *stream)
|
||||||
{
|
{
|
||||||
@@ -1615,6 +1661,7 @@ emuxki_stream_halt(emuxki_stream *stream)
|
|||||||
stream->state &= ~EMU_STATE_STARTED;
|
stream->state &= ~EMU_STATE_STARTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
emuxki_stream *
|
emuxki_stream *
|
||||||
emuxki_stream_new(emuxki_dev *card, uint8 use, uint32 bufframes, uint8 bufcount)
|
emuxki_stream_new(emuxki_dev *card, uint8 use, uint32 bufframes, uint8 bufcount)
|
||||||
{
|
{
|
||||||
@@ -1654,6 +1701,7 @@ emuxki_stream_new(emuxki_dev *card, uint8 use, uint32 bufframes, uint8 bufcount)
|
|||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
emuxki_stream_delete(emuxki_stream *stream)
|
emuxki_stream_delete(emuxki_stream *stream)
|
||||||
{
|
{
|
||||||
@@ -1678,6 +1726,7 @@ emuxki_stream_delete(emuxki_stream *stream)
|
|||||||
free(stream);
|
free(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Emuxki gprs */
|
/* Emuxki gprs */
|
||||||
// 87 values from 0.0dB to -xdB (-0.75dB each)
|
// 87 values from 0.0dB to -xdB (-0.75dB each)
|
||||||
static uint32 db_table[] = {
|
static uint32 db_table[] = {
|
||||||
@@ -1696,6 +1745,7 @@ static uint32 db_table[] = {
|
|||||||
1520301, 1394536, 1279174
|
1520301, 1394536, 1279174
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
emuxki_gpr_set(emuxki_dev *card, emuxki_gpr *gpr, int32 type, float *values)
|
emuxki_gpr_set(emuxki_dev *card, emuxki_gpr *gpr, int32 type, float *values)
|
||||||
{
|
{
|
||||||
@@ -1736,6 +1786,7 @@ emuxki_gpr_set(emuxki_dev *card, emuxki_gpr *gpr, int32 type, float *values)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
emuxki_gpr_get(emuxki_dev *card, emuxki_gpr *gpr, int32 type, float *values)
|
emuxki_gpr_get(emuxki_dev *card, emuxki_gpr *gpr, int32 type, float *values)
|
||||||
{
|
{
|
||||||
@@ -1756,6 +1807,7 @@ emuxki_gpr_get(emuxki_dev *card, emuxki_gpr *gpr, int32 type, float *values)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
emuxki_gpr_dump(emuxki_dev * card, uint16 count)
|
emuxki_gpr_dump(emuxki_dev * card, uint16 count)
|
||||||
{
|
{
|
||||||
@@ -1770,6 +1822,7 @@ emuxki_gpr_dump(emuxki_dev * card, uint16 count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static emuxki_gpr *
|
static emuxki_gpr *
|
||||||
emuxki_gpr_new(emuxki_dev *card, const char *name, emuxki_gpr_type type, uint16 *gpr_num,
|
emuxki_gpr_new(emuxki_dev *card, const char *name, emuxki_gpr_type type, uint16 *gpr_num,
|
||||||
float default_value, float default_mute, float min_gain, float max_gain, float granularity)
|
float default_value, float default_mute, float min_gain, float max_gain, float granularity)
|
||||||
@@ -1861,6 +1914,7 @@ emuxki_parameter_set(emuxki_dev *card, const void* cookie, int32 type, int32 *va
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
emuxki_parameter_get(emuxki_dev *card, const void* cookie, int32 type, int32 *value)
|
emuxki_parameter_get(emuxki_dev *card, const void* cookie, int32 type, int32 *value)
|
||||||
{
|
{
|
||||||
@@ -1876,6 +1930,7 @@ emuxki_parameter_get(emuxki_dev *card, const void* cookie, int32 type, int32 *va
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Emuxki interrupt */
|
/* Emuxki interrupt */
|
||||||
static int32
|
static int32
|
||||||
emuxki_int(void *arg)
|
emuxki_int(void *arg)
|
||||||
@@ -2052,6 +2107,7 @@ init_hardware(void)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
make_device_names(
|
make_device_names(
|
||||||
emuxki_dev * card)
|
emuxki_dev * card)
|
||||||
@@ -2076,7 +2132,7 @@ emuxki_setup(emuxki_dev * card)
|
|||||||
{
|
{
|
||||||
status_t err = B_OK;
|
status_t err = B_OK;
|
||||||
unsigned char cmd;
|
unsigned char cmd;
|
||||||
int32 base;
|
//int32 base;
|
||||||
|
|
||||||
PRINT(("setup_emuxki(%p)\n", card));
|
PRINT(("setup_emuxki(%p)\n", card));
|
||||||
|
|
||||||
@@ -2217,7 +2273,12 @@ emuxki_setup(emuxki_dev * card)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRINT(("installing interrupt : %lx\n", card->config.irq));
|
PRINT(("installing interrupt : %lx\n", card->config.irq));
|
||||||
install_io_interrupt_handler(card->config.irq, emuxki_int, card, 0);
|
err = install_io_interrupt_handler(card->config.irq, emuxki_int, card, 0);
|
||||||
|
if (err != B_OK) {
|
||||||
|
PRINT(("failed to install interrupt\n"));
|
||||||
|
emuxki_shutdown(card);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
emuxki_inte_enable(&card->config, EMU_INTE_VOLINCRENABLE | EMU_INTE_VOLDECRENABLE
|
emuxki_inte_enable(&card->config, EMU_INTE_VOLINCRENABLE | EMU_INTE_VOLDECRENABLE
|
||||||
| EMU_INTE_MUTEENABLE | EMU_INTE_FXDSPENABLE);
|
| EMU_INTE_MUTEENABLE | EMU_INTE_FXDSPENABLE);
|
||||||
@@ -2238,6 +2299,7 @@ emuxki_setup(emuxki_dev * card)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
emuxki_dump_fx(emuxki_dev * card)
|
emuxki_dump_fx(emuxki_dev * card)
|
||||||
{
|
{
|
||||||
@@ -2258,6 +2320,7 @@ emuxki_dump_fx(emuxki_dev * card)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
emuxki_initfx(emuxki_dev * card)
|
emuxki_initfx(emuxki_dev * card)
|
||||||
{
|
{
|
||||||
@@ -2644,6 +2707,7 @@ emuxki_initfx(emuxki_dev * card)
|
|||||||
emuxki_dump_fx(card);
|
emuxki_dump_fx(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
emuxki_init(emuxki_dev * card)
|
emuxki_init(emuxki_dev * card)
|
||||||
{
|
{
|
||||||
@@ -2792,7 +2856,6 @@ emuxki_init(emuxki_dev * card)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
init_driver(void)
|
init_driver(void)
|
||||||
{
|
{
|
||||||
@@ -2873,8 +2936,7 @@ init_driver(void)
|
|||||||
cards[num_cards].info = info;
|
cards[num_cards].info = info;
|
||||||
if (emuxki_setup(&cards[num_cards])) {
|
if (emuxki_setup(&cards[num_cards])) {
|
||||||
PRINT(("Setup of emuxki %ld failed\n", num_cards+1));
|
PRINT(("Setup of emuxki %ld failed\n", num_cards+1));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
num_cards++;
|
num_cards++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2892,7 +2954,7 @@ init_driver(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
void
|
||||||
emuxki_shutdown(emuxki_dev *card)
|
emuxki_shutdown(emuxki_dev *card)
|
||||||
{
|
{
|
||||||
uint32 i;
|
uint32 i;
|
||||||
@@ -3018,6 +3080,3 @@ find_device(const char * name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32 api_version = B_CUR_DRIVER_API_VERSION;
|
int32 api_version = B_CUR_DRIVER_API_VERSION;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user