clang-format in src/sound/

This commit is contained in:
Jasmine Iwanek
2022-09-18 17:16:40 -04:00
parent 740d7af8d6
commit 645732b7bf
27 changed files with 521 additions and 521 deletions

View File

@@ -72,17 +72,17 @@ typedef struct
} MIDI_OUT_DEVICE, MIDI_IN_DEVICE;
static const device_t midi_out_none_device = {
.name = "None",
.name = "None",
.internal_name = "none",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
static const MIDI_OUT_DEVICE devices[] = {
@@ -105,17 +105,17 @@ static const MIDI_OUT_DEVICE devices[] = {
};
static const device_t midi_in_none_device = {
.name = "None",
.name = "None",
.internal_name = "none",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
static const MIDI_IN_DEVICE midi_in_devices[] = {

View File

@@ -550,17 +550,17 @@ static const device_config_t fluidsynth_config[] = {
};
const device_t fluidsynth_device = {
.name = "FluidSynth",
.name = "FluidSynth",
.internal_name = "fluidsynth",
.flags = 0,
.local = 0,
.init = fluidsynth_init,
.close = fluidsynth_close,
.reset = NULL,
.flags = 0,
.local = 0,
.init = fluidsynth_init,
.close = fluidsynth_close,
.reset = NULL,
{ .available = fluidsynth_available },
.speed_changed = NULL,
.force_redraw = NULL,
.config = fluidsynth_config
.force_redraw = NULL,
.config = fluidsynth_config
};
#endif /*USE_FLUIDSYNTH*/
#endif/*USE_FLUIDSYNTH*/

View File

@@ -15,21 +15,20 @@
#include <86box/ui.h>
#include <mt32emu/c_interface/c_interface.h>
#define MT32_OLD_CTRL_ROM "roms/sound/mt32/MT32_CONTROL.ROM"
#define MT32_OLD_PCM_ROM "roms/sound/mt32/MT32_PCM.ROM"
#define MT32_NEW_CTRL_ROM "roms/sound/mt32_new/MT32_CONTROL.ROM"
#define MT32_NEW_PCM_ROM "roms/sound/mt32_new/MT32_PCM.ROM"
#define CM32L_CTRL_ROM "roms/sound/cm32l/CM32L_CONTROL.ROM"
#define CM32L_PCM_ROM "roms/sound/cm32l/CM32L_PCM.ROM"
#define CM32LN_CTRL_ROM "roms/sound/cm32ln/CM32LN_CONTROL.ROM"
#define CM32LN_PCM_ROM "roms/sound/cm32ln/CM32LN_PCM.ROM"
#define MT32_OLD_CTRL_ROM "roms/sound/mt32/MT32_CONTROL.ROM"
#define MT32_OLD_PCM_ROM "roms/sound/mt32/MT32_PCM.ROM"
#define MT32_NEW_CTRL_ROM "roms/sound/mt32_new/MT32_CONTROL.ROM"
#define MT32_NEW_PCM_ROM "roms/sound/mt32_new/MT32_PCM.ROM"
#define CM32L_CTRL_ROM "roms/sound/cm32l/CM32L_CONTROL.ROM"
#define CM32L_PCM_ROM "roms/sound/cm32l/CM32L_PCM.ROM"
#define CM32LN_CTRL_ROM "roms/sound/cm32ln/CM32LN_CONTROL.ROM"
#define CM32LN_PCM_ROM "roms/sound/cm32ln/CM32LN_PCM.ROM"
extern void givealbuffer_midi(void *buf, uint32_t size);
extern void al_set_midi(int freq, int buf_size);
static mt32emu_report_handler_version get_mt32_report_handler_version(mt32emu_report_handler_i i);
static void display_mt32_message(void *instance_data, const char *message);
static void display_mt32_message(void *instance_data, const char *message);
static const mt32emu_report_handler_i_v0 handler_mt32_v0 = {
/** Returns the actual interface version ID */
@@ -377,7 +376,7 @@ mt32_close(void *p)
}
static const device_config_t mt32_config[] = {
// clang-format off
// clang-format off
{
.name = "output_gain",
.description = "Output Gain",
@@ -421,57 +420,57 @@ static const device_config_t mt32_config[] = {
};
const device_t mt32_old_device = {
.name = "Roland MT-32 Emulation",
.name = "Roland MT-32 Emulation",
.internal_name = "mt32",
.flags = 0,
.local = 0,
.init = mt32_old_init,
.close = mt32_close,
.reset = NULL,
.flags = 0,
.local = 0,
.init = mt32_old_init,
.close = mt32_close,
.reset = NULL,
{ .available = mt32_old_available },
.speed_changed = NULL,
.force_redraw = NULL,
.config = mt32_config
.force_redraw = NULL,
.config = mt32_config
};
const device_t mt32_new_device = {
.name = "Roland MT-32 (New) Emulation",
.name = "Roland MT-32 (New) Emulation",
.internal_name = "mt32",
.flags = 0,
.local = 0,
.init = mt32_new_init,
.close = mt32_close,
.reset = NULL,
.flags = 0,
.local = 0,
.init = mt32_new_init,
.close = mt32_close,
.reset = NULL,
{ .available = mt32_new_available },
.speed_changed = NULL,
.force_redraw = NULL,
.config = mt32_config
.force_redraw = NULL,
.config = mt32_config
};
const device_t cm32l_device = {
.name = "Roland CM-32L Emulation",
.name = "Roland CM-32L Emulation",
.internal_name = "cm32l",
.flags = 0,
.local = 0,
.init = cm32l_init,
.close = mt32_close,
.reset = NULL,
.flags = 0,
.local = 0,
.init = cm32l_init,
.close = mt32_close,
.reset = NULL,
{ .available = cm32l_available },
.speed_changed = NULL,
.force_redraw = NULL,
.config = mt32_config
.force_redraw = NULL,
.config = mt32_config
};
const device_t cm32ln_device = {
.name = "Roland CM-32LN Emulation",
.name = "Roland CM-32LN Emulation",
.internal_name = "cm32ln",
.flags = 0,
.local = 0,
.init = cm32ln_init,
.close = mt32_close,
.reset = NULL,
.flags = 0,
.local = 0,
.init = cm32ln_init,
.close = mt32_close,
.reset = NULL,
{ .available = cm32ln_available },
.speed_changed = NULL,
.force_redraw = NULL,
.config = mt32_config
.force_redraw = NULL,
.config = mt32_config
};

View File

@@ -28,8 +28,7 @@
#include <cstdlib>
#include <cstring>
extern "C"
{
extern "C" {
#include <86box/86box.h>
#include <86box/device.h>
#include <86box/midi.h>
@@ -69,7 +68,7 @@ rtmidi_play_sysex(uint8_t *sysex, unsigned int len)
midiout->sendMessage(sysex, len);
}
void*
void *
rtmidi_output_init(const device_t *info)
{
midi_device_t *dev = (midi_device_t *) malloc(sizeof(midi_device_t));
@@ -152,7 +151,7 @@ rtmidi_input_callback(double timeStamp, std::vector<unsigned char> *message, voi
midi_in_msg(message->data(), message->size());
}
void*
void *
rtmidi_input_init(const device_t *info)
{
midi_device_t *dev = (midi_device_t *) malloc(sizeof(midi_device_t));
@@ -273,34 +272,34 @@ static const device_config_t midi_input_config[] = {
.default_int = 1
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
// clang-format on
};
const device_t rtmidi_output_device = {
.name = SYSTEM_MIDI_NAME,
.name = SYSTEM_MIDI_NAME,
.internal_name = SYSTEM_MIDI_INTERNAL_NAME,
.flags = 0,
.local = 0,
.init = rtmidi_output_init,
.close = rtmidi_output_close,
.reset = NULL,
.flags = 0,
.local = 0,
.init = rtmidi_output_init,
.close = rtmidi_output_close,
.reset = NULL,
{ .available = rtmidi_out_get_num_devs },
.speed_changed = NULL,
.force_redraw = NULL,
.config = system_midi_config
.force_redraw = NULL,
.config = system_midi_config
};
const device_t rtmidi_input_device = {
.name = MIDI_INPUT_NAME,
.name = MIDI_INPUT_NAME,
.internal_name = MIDI_INPUT_INTERNAL_NAME,
.flags = 0,
.local = 0,
.init = rtmidi_input_init,
.close = rtmidi_input_close,
.reset = NULL,
.flags = 0,
.local = 0,
.init = rtmidi_input_init,
.close = rtmidi_input_close,
.reset = NULL,
{ .available = rtmidi_in_get_num_devs },
.speed_changed = NULL,
.force_redraw = NULL,
.config = midi_input_config
.force_redraw = NULL,
.config = midi_input_config
};
}

View File

@@ -637,117 +637,117 @@ ac97_codec_get(int model)
if ((model >= 0) && (model < (sizeof(ac97_codecs) / sizeof(ac97_codecs[0]))))
return ac97_codecs[model].device;
else
return &cs4297a_device; /* fallback */
return &cs4297a_device;/* fallback */
}
const device_t ad1881_device = {
.name = "Analog Devices AD1881",
.name = "Analog Devices AD1881",
.internal_name = "ad1881",
.flags = DEVICE_AC97,
.local = AC97_CODEC_AD1881,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
.flags = DEVICE_AC97,
.local = AC97_CODEC_AD1881,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t ak4540_device = {
.name = "Asahi Kasei AK4540",
.name = "Asahi Kasei AK4540",
.internal_name = "ak4540",
.flags = DEVICE_AC97,
.local = AC97_CODEC_AK4540,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
.flags = DEVICE_AC97,
.local = AC97_CODEC_AK4540,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t alc100_device = {
.name = "Avance Logic ALC100",
.name = "Avance Logic ALC100",
.internal_name = "alc100",
.flags = DEVICE_AC97,
.local = AC97_CODEC_ALC100,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
.flags = DEVICE_AC97,
.local = AC97_CODEC_ALC100,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t cs4297_device = {
.name = "Crystal CS4297",
.name = "Crystal CS4297",
.internal_name = "cs4297",
.flags = DEVICE_AC97,
.local = AC97_CODEC_CS4297,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
.flags = DEVICE_AC97,
.local = AC97_CODEC_CS4297,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t cs4297a_device = {
.name = "Crystal CS4297A",
.name = "Crystal CS4297A",
.internal_name = "cs4297a",
.flags = DEVICE_AC97,
.local = AC97_CODEC_CS4297A,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
.flags = DEVICE_AC97,
.local = AC97_CODEC_CS4297A,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t stac9708_device = {
.name = "SigmaTel STAC9708",
.name = "SigmaTel STAC9708",
.internal_name = "stac9708",
.flags = DEVICE_AC97,
.local = AC97_CODEC_STAC9708,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
.flags = DEVICE_AC97,
.local = AC97_CODEC_STAC9708,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t stac9721_device = {
.name = "SigmaTel STAC9721",
.name = "SigmaTel STAC9721",
.internal_name = "stac9721",
.flags = DEVICE_AC97,
.local = AC97_CODEC_STAC9721,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
.flags = DEVICE_AC97,
.local = AC97_CODEC_STAC9721,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t wm9701a_device = {
.name = "Wolfson WM9701A",
.name = "Wolfson WM9701A",
.internal_name = "wm9701a",
.flags = DEVICE_AC97,
.local = AC97_CODEC_WM9701A,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
.flags = DEVICE_AC97,
.local = AC97_CODEC_WM9701A,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};

View File

@@ -804,15 +804,15 @@ ac97_via_close(void *priv)
}
const device_t ac97_via_device = {
.name = "VIA VT82C686 Integrated AC97 Controller",
.name = "VIA VT82C686 Integrated AC97 Controller",
.internal_name = "ac97_via",
.flags = DEVICE_PCI,
.local = 0,
.init = ac97_via_init,
.close = ac97_via_close,
.reset = NULL,
.flags = DEVICE_PCI,
.local = 0,
.init = ac97_via_init,
.close = ac97_via_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = ac97_via_speed_changed,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};

View File

@@ -141,29 +141,29 @@ adlib_close(void *p)
}
const device_t adlib_device = {
.name = "AdLib",
.name = "AdLib",
.internal_name = "adlib",
.flags = DEVICE_ISA,
.local = 0,
.init = adlib_init,
.close = adlib_close,
.reset = NULL,
.flags = DEVICE_ISA,
.local = 0,
.init = adlib_init,
.close = adlib_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t adlib_mca_device = {
.name = "AdLib (MCA)",
.name = "AdLib (MCA)",
.internal_name = "adlib_mca",
.flags = DEVICE_MCA,
.local = 0,
.init = adlib_init,
.close = adlib_close,
.reset = NULL,
.flags = DEVICE_MCA,
.local = 0,
.init = adlib_init,
.close = adlib_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};

View File

@@ -55,7 +55,7 @@ typedef struct adgold_t {
int voice_count[2], voice_latch[2];
} adgold_mma;
fm_drv_t opl;
fm_drv_t opl;
ym7128_t ym7128;
int fm_vol_l, fm_vol_r;
@@ -178,11 +178,11 @@ adgold_getsamp_dma(adgold_t *adgold, int channel)
return;
}
adgold->adgold_mma_fifo[channel][adgold->adgold_mma_fifo_end[channel]] = temp;
adgold->adgold_mma_fifo_end[channel] = (adgold->adgold_mma_fifo_end[channel] + 1) & 255;
adgold->adgold_mma_fifo_end[channel] = (adgold->adgold_mma_fifo_end[channel] + 1) & 255;
if (adgold->adgold_mma_regs[channel][0xc] & 0x60) {
temp = dma_channel_read(adgold->dma);
temp = dma_channel_read(adgold->dma);
adgold->adgold_mma_fifo[channel][adgold->adgold_mma_fifo_end[channel]] = temp;
adgold->adgold_mma_fifo_end[channel] = (adgold->adgold_mma_fifo_end[channel] + 1) & 255;
adgold->adgold_mma_fifo_end[channel] = (adgold->adgold_mma_fifo_end[channel] + 1) & 255;
}
if (((adgold->adgold_mma_fifo_end[channel] - adgold->adgold_mma_fifo_start[channel]) & 255) >= adgold->adgold_mma_intpos[channel]) {
adgold->adgold_mma_status &= ~(0x01 << channel);
@@ -339,7 +339,7 @@ adgold_write(uint16_t addr, uint8_t val, void *p)
break; /* 7350 Hz*/
}
if (val & 0x80) {
adgold->adgold_mma_enable[0] = 0;
adgold->adgold_mma_enable[0] = 0;
adgold->adgold_mma_fifo_end[0] = adgold->adgold_mma_fifo_start[0] = 0;
adgold->adgold_mma_status &= ~0x01;
adgold_update_irq_status(adgold);
@@ -352,7 +352,7 @@ adgold_write(uint16_t addr, uint8_t val, void *p)
if (adgold->adgold_mma_regs[0][0xc] & 1) {
if (adgold->adgold_mma_regs[0][0xc] & 0x80) {
adgold->adgold_mma_enable[1] = 1;
adgold->adgold_mma_enable[1] = 1;
adgold->adgold_mma.voice_count[1] = adgold->adgold_mma.voice_latch[1];
while (((adgold->adgold_mma_fifo_end[0] - adgold->adgold_mma_fifo_start[0]) & 255) < 128) {
@@ -387,7 +387,7 @@ adgold_write(uint16_t addr, uint8_t val, void *p)
case 0xb:
if (((adgold->adgold_mma_fifo_end[0] - adgold->adgold_mma_fifo_start[0]) & 255) < 128) {
adgold->adgold_mma_fifo[0][adgold->adgold_mma_fifo_end[0]] = val;
adgold->adgold_mma_fifo_end[0] = (adgold->adgold_mma_fifo_end[0] + 1) & 255;
adgold->adgold_mma_fifo_end[0] = (adgold->adgold_mma_fifo_end[0] + 1) & 255;
if (((adgold->adgold_mma_fifo_end[0] - adgold->adgold_mma_fifo_start[0]) & 255) >= adgold->adgold_mma_intpos[0]) {
adgold->adgold_mma_status &= ~0x01;
adgold_update_irq_status(adgold);
@@ -821,7 +821,7 @@ adgold_get_buffer(int32_t *buffer, int len, void *p)
}
adgold->opl.reset_buffer(adgold->opl.priv);
adgold->pos = 0;
adgold->pos = 0;
free(adgold_buffer);
}
@@ -889,8 +889,8 @@ adgold_init(const device_t *info)
adgold_t *adgold = malloc(sizeof(adgold_t));
memset(adgold, 0, sizeof(adgold_t));
adgold->dma = device_get_config_int("dma");
adgold->irq = device_get_config_int("irq");
adgold->dma = device_get_config_int("dma");
adgold->irq = device_get_config_int("irq");
adgold->surround_enabled = device_get_config_int("surround");
adgold->gameport_enabled = device_get_config_int("gameport");
@@ -940,7 +940,7 @@ adgold_init(const device_t *info)
fclose(f);
}
adgold->adgold_status = 0xf;
adgold->adgold_status = 0xf;
adgold->adgold_38x_addr = 0;
switch (adgold->irq) {
case 3:
@@ -958,18 +958,18 @@ adgold_init(const device_t *info)
}
adgold->adgold_eeprom[0x13] |= (adgold->dma << 3);
memcpy(adgold->adgold_38x_regs, adgold->adgold_eeprom, 0x19);
adgold->vol_l = attenuation[adgold->adgold_eeprom[0x04] & 0x3f];
adgold->vol_r = attenuation[adgold->adgold_eeprom[0x05] & 0x3f];
adgold->bass = adgold->adgold_eeprom[0x06] & 0xf;
adgold->treble = adgold->adgold_eeprom[0x07] & 0xf;
adgold->fm_vol_l = (int) (int8_t) (adgold->adgold_eeprom[0x09] - 128);
adgold->fm_vol_r = (int) (int8_t) (adgold->adgold_eeprom[0x0a] - 128);
adgold->vol_l = attenuation[adgold->adgold_eeprom[0x04] & 0x3f];
adgold->vol_r = attenuation[adgold->adgold_eeprom[0x05] & 0x3f];
adgold->bass = adgold->adgold_eeprom[0x06] & 0xf;
adgold->treble = adgold->adgold_eeprom[0x07] & 0xf;
adgold->fm_vol_l = (int) (int8_t) (adgold->adgold_eeprom[0x09] - 128);
adgold->fm_vol_r = (int) (int8_t) (adgold->adgold_eeprom[0x0a] - 128);
adgold->samp_vol_l = (int) (int8_t) (adgold->adgold_eeprom[0x0b] - 128);
adgold->samp_vol_r = (int) (int8_t) (adgold->adgold_eeprom[0x0c] - 128);
adgold->aux_vol_l = (int) (int8_t) (adgold->adgold_eeprom[0x0d] - 128);
adgold->aux_vol_r = (int) (int8_t) (adgold->adgold_eeprom[0x0e] - 128);
adgold->adgold_mma_enable[0] = 0;
adgold->adgold_mma_enable[0] = 0;
adgold->adgold_mma_fifo_start[0] = adgold->adgold_mma_fifo_end[0] = 0;
/*388/389 are handled by adlib_init*/
@@ -1005,7 +1005,7 @@ adgold_close(void *p)
}
static const device_config_t adgold_config[] = {
// clang-format off
// clang-format off
{
.name = "irq",
.description = "IRQ",
@@ -1080,15 +1080,15 @@ static const device_config_t adgold_config[] = {
};
const device_t adgold_device = {
.name = "AdLib Gold",
.name = "AdLib Gold",
.internal_name = "adlibgold",
.flags = DEVICE_ISA,
.local = 0,
.init = adgold_init,
.close = adgold_close,
.reset = NULL,
.flags = DEVICE_ISA,
.local = 0,
.init = adgold_init,
.close = adgold_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = adgold_config
.force_redraw = NULL,
.config = adgold_config
};

View File

@@ -2053,7 +2053,7 @@ es1371_speed_changed(void *p)
}
static const device_config_t es1371_config[] = {
// clang-format off
// clang-format off
{
.name = "codec",
.description = "CODEC",
@@ -2090,11 +2090,11 @@ static const device_config_t es1371_config[] = {
.default_int = 1
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
// clang-format on
};
static const device_config_t es1371_onboard_config[] = {
// clang-format off
// clang-format off
{
.name = "receive_input",
.description = "Receive input (MIDI)",
@@ -2107,29 +2107,29 @@ static const device_config_t es1371_onboard_config[] = {
};
const device_t es1371_device = {
.name = "Ensoniq AudioPCI (ES1371)",
.name = "Ensoniq AudioPCI (ES1371)",
.internal_name = "es1371",
.flags = DEVICE_PCI,
.local = 0,
.init = es1371_init,
.close = es1371_close,
.reset = es1371_reset,
.flags = DEVICE_PCI,
.local = 0,
.init = es1371_init,
.close = es1371_close,
.reset = es1371_reset,
{ .available = NULL },
.speed_changed = es1371_speed_changed,
.force_redraw = NULL,
.config = es1371_config
.force_redraw = NULL,
.config = es1371_config
};
const device_t es1371_onboard_device = {
.name = "Ensoniq AudioPCI (ES1371) (On-Board)",
.name = "Ensoniq AudioPCI (ES1371) (On-Board)",
.internal_name = "es1371_onboard",
.flags = DEVICE_PCI,
.local = 1,
.init = es1371_init,
.close = es1371_close,
.reset = es1371_reset,
.flags = DEVICE_PCI,
.local = 1,
.init = es1371_init,
.close = es1371_close,
.reset = es1371_reset,
{ .available = NULL },
.speed_changed = es1371_speed_changed,
.force_redraw = NULL,
.config = es1371_onboard_config
.force_redraw = NULL,
.config = es1371_onboard_config
};

View File

@@ -1227,7 +1227,7 @@ azt_speed_changed(void *p)
}
static const device_config_t azt1605_config[] = {
// clang-format off
// clang-format off
{
.name = "codec",
.description = "CODEC",
@@ -1367,7 +1367,7 @@ static const device_config_t azt1605_config[] = {
.default_int = 0
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
// clang-format on
};
static const device_config_t azt2316a_config[] = {
@@ -1488,33 +1488,33 @@ static const device_config_t azt2316a_config[] = {
.default_int = 0
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
// clang-format on
};
const device_t azt2316a_device = {
.name = "Aztech Sound Galaxy Pro 16 AB (Washington)",
.name = "Aztech Sound Galaxy Pro 16 AB (Washington)",
.internal_name = "azt2316a",
.flags = DEVICE_ISA | DEVICE_AT,
.local = SB_SUBTYPE_CLONE_AZT2316A_0X11,
.init = azt_init,
.close = azt_close,
.reset = NULL,
.flags = DEVICE_ISA | DEVICE_AT,
.local = SB_SUBTYPE_CLONE_AZT2316A_0X11,
.init = azt_init,
.close = azt_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = azt_speed_changed,
.force_redraw = NULL,
.config = azt2316a_config
.force_redraw = NULL,
.config = azt2316a_config
};
const device_t azt1605_device = {
.name = "Aztech Sound Galaxy Nova 16 Extra (Clinton)",
.name = "Aztech Sound Galaxy Nova 16 Extra (Clinton)",
.internal_name = "azt1605",
.flags = DEVICE_ISA | DEVICE_AT,
.local = SB_SUBTYPE_CLONE_AZT1605_0X0C,
.init = azt_init,
.close = azt_close,
.reset = NULL,
.flags = DEVICE_ISA | DEVICE_AT,
.local = SB_SUBTYPE_CLONE_AZT1605_0X0C,
.init = azt_init,
.close = azt_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = azt_speed_changed,
.force_redraw = NULL,
.config = azt1605_config
.force_redraw = NULL,
.config = azt1605_config
};

View File

@@ -1474,7 +1474,7 @@ static const device_config_t cmi8738_config[] = {
.default_int = 1
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
// clang-format on
};
const device_t cmi8338_device = {

View File

@@ -227,19 +227,19 @@ static const device_config_t cms_config[] = {
}
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
// clang-format on
};
const device_t cms_device = {
.name = "Creative Music System / Game Blaster",
.name = "Creative Music System / Game Blaster",
.internal_name = "cms",
.flags = DEVICE_ISA,
.local = 0,
.init = cms_init,
.close = cms_close,
.reset = NULL,
.flags = DEVICE_ISA,
.local = 0,
.init = cms_init,
.close = cms_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = cms_config
.force_redraw = NULL,
.config = cms_config
};

View File

@@ -57,7 +57,7 @@ static const uint8_t slam_init_key[32] = { 0x96, 0x35, 0x9A, 0xCD, 0xE6, 0xF3, 0
0xF1, 0xF8, 0x7C, 0x3E, 0x9F, 0x4F, 0x27, 0x13,
0x09, 0x84, 0x42, 0xA1, 0xD0, 0x68, 0x34, 0x1A };
static const uint8_t cs4236b_eeprom[] = {
// clang-format off
// clang-format off
/* Chip configuration */
0x55, 0xbb, /* magic */
0x00, 0x00, /* length */
@@ -505,7 +505,7 @@ cs423x_get_buffer(int32_t *buffer, int len, void *priv)
{
cs423x_t *dev = (cs423x_t *) priv;
int c, opl_wss = dev->opl_wss;
int32_t *opl_buf = NULL;
int32_t *opl_buf = NULL;
/* Output audio from the WSS codec, and also the OPL if we're in charge of it. */
ad1848_update(&dev->ad1848);

View File

@@ -109,25 +109,25 @@ dac_close(void *p)
}
const lpt_device_t lpt_dac_device = {
.name = "LPT DAC / Covox Speech Thing",
.name = "LPT DAC / Covox Speech Thing",
.internal_name = "lpt_dac",
.init = dac_init,
.close = dac_close,
.write_data = dac_write_data,
.write_ctrl = dac_write_ctrl,
.read_data = NULL,
.read_status = dac_read_status,
.read_ctrl = NULL
.init = dac_init,
.close = dac_close,
.write_data = dac_write_data,
.write_ctrl = dac_write_ctrl,
.read_data = NULL,
.read_status = dac_read_status,
.read_ctrl = NULL
};
const lpt_device_t lpt_dac_stereo_device = {
.name = "Stereo LPT DAC",
.name = "Stereo LPT DAC",
.internal_name = "lpt_dac_stereo",
.init = dac_stereo_init,
.close = dac_close,
.write_data = dac_write_data,
.write_ctrl = dac_write_ctrl,
.read_data = NULL,
.read_status = dac_read_status,
.read_ctrl = NULL
.init = dac_stereo_init,
.close = dac_close,
.write_data = dac_write_data,
.write_ctrl = dac_write_ctrl,
.read_data = NULL,
.read_status = dac_read_status,
.read_ctrl = NULL
};

View File

@@ -132,13 +132,13 @@ dss_close(void *p)
}
const lpt_device_t dss_device = {
.name = "Disney Sound Source",
.name = "Disney Sound Source",
.internal_name = "dss",
.init = dss_init,
.close = dss_close,
.write_data = dss_write_data,
.write_ctrl = dss_write_ctrl,
.read_data = NULL,
.read_status = dss_read_status,
.read_ctrl = NULL
.init = dss_init,
.close = dss_close,
.write_data = dss_write_data,
.write_ctrl = dss_write_ctrl,
.read_data = NULL,
.read_status = dss_read_status,
.read_ctrl = NULL
};

View File

@@ -1786,7 +1786,7 @@ mpu401_standalone_init(const device_t *info)
base = 0; /* Tell mpu401_init() that this is the MCA variant. */
/* According to @6c0f.adf, the IRQ is supposed to be fixed to 2.
This is only true for earlier models. Later ones have selectable IRQ. */
irq = device_get_config_int("irq");
irq = device_get_config_int("irq");
} else {
base = device_get_config_hex16("base");
irq = device_get_config_int("irq");
@@ -1806,7 +1806,7 @@ mpu401_standalone_close(void *priv)
}
static const device_config_t mpu401_standalone_config[] = {
// clang-format off
// clang-format off
{
.name = "base",
.description = "MPU-401 Address",
@@ -1910,11 +1910,11 @@ static const device_config_t mpu401_standalone_config[] = {
.default_int = 1
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
// clang-format on
};
static const device_config_t mpu401_standalone_mca_config[] = {
// clang-format off
// clang-format off
{
.name = "irq",
.description = "MPU-401 IRQ",
@@ -1958,33 +1958,33 @@ static const device_config_t mpu401_standalone_mca_config[] = {
.default_int = 1
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
// clang-format on
};
const device_t mpu401_device = {
.name = "Roland MPU-IPC-T",
.name = "Roland MPU-IPC-T",
.internal_name = "mpu401",
.flags = DEVICE_ISA,
.local = 0,
.init = mpu401_standalone_init,
.close = mpu401_standalone_close,
.reset = NULL,
.flags = DEVICE_ISA,
.local = 0,
.init = mpu401_standalone_init,
.close = mpu401_standalone_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = mpu401_standalone_config
.force_redraw = NULL,
.config = mpu401_standalone_config
};
const device_t mpu401_mca_device = {
.name = "Roland MPU-IMC",
.name = "Roland MPU-IMC",
.internal_name = "mpu401_mca",
.flags = DEVICE_MCA,
.local = 0,
.init = mpu401_standalone_init,
.close = mpu401_standalone_close,
.reset = NULL,
.flags = DEVICE_MCA,
.local = 0,
.init = mpu401_standalone_init,
.close = mpu401_standalone_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = mpu401_standalone_mca_config
.force_redraw = NULL,
.config = mpu401_standalone_mca_config
};

View File

@@ -36,30 +36,31 @@
static uint32_t fm_dev_inst[FM_DRV_MAX][FM_MAX];
uint8_t
fm_driver_get(int chip_id, fm_drv_t *drv) {
fm_driver_get(int chip_id, fm_drv_t *drv)
{
switch (chip_id) {
case FM_YM3812:
if (fm_driver == FM_DRV_NUKED) {
*drv = nuked_opl_drv;
*drv = nuked_opl_drv;
drv->priv = device_add_inst(&ym3812_nuked_device, fm_dev_inst[fm_driver][chip_id]++);
} else {
*drv = ymfm_drv;
*drv = ymfm_drv;
drv->priv = device_add_inst(&ym3812_ymfm_device, fm_dev_inst[fm_driver][chip_id]++);
}
break;
case FM_YMF262:
if (fm_driver == FM_DRV_NUKED) {
*drv = nuked_opl_drv;
*drv = nuked_opl_drv;
drv->priv = device_add_inst(&ymf262_nuked_device, fm_dev_inst[fm_driver][chip_id]++);
} else {
*drv = ymfm_drv;
*drv = ymfm_drv;
drv->priv = device_add_inst(&ymf262_ymfm_device, fm_dev_inst[fm_driver][chip_id]++);
}
break;
case FM_YMF289B:
*drv = ymfm_drv;
*drv = ymfm_drv;
drv->priv = device_add_inst(&ymf289b_ymfm_device, fm_dev_inst[fm_driver][chip_id]++);
break;

View File

@@ -173,7 +173,7 @@ typedef struct chip {
typedef struct {
nuked_t opl;
int8_t flags, pad;
int8_t flags, pad;
uint16_t port;
uint8_t status, timer_ctrl;
@@ -1355,7 +1355,7 @@ nuked_generate_stream(nuked_t *dev, int32_t *sndptr, uint32_t num)
void
nuked_init(nuked_t *dev, uint32_t samplerate)
{
uint8_t i;
uint8_t i;
memset(dev, 0x00, sizeof(nuked_t));
@@ -1456,7 +1456,7 @@ nuked_timer_2(void *priv)
static void
nuked_drv_set_do_cycles(void *priv, int8_t do_cycles)
{
nuked_drv_t *dev = (nuked_drv_t *)priv;
nuked_drv_t *dev = (nuked_drv_t *) priv;
if (do_cycles)
dev->flags |= FLAG_CYCLES;
@@ -1468,7 +1468,7 @@ static void *
nuked_drv_init(const device_t *info)
{
nuked_drv_t *dev = (nuked_drv_t *) calloc(1, sizeof(nuked_drv_t));
dev->flags = FLAG_CYCLES;
dev->flags = FLAG_CYCLES;
if (info->local == FM_YMF262)
dev->flags |= FLAG_OPL3;
else
@@ -1486,14 +1486,14 @@ nuked_drv_init(const device_t *info)
static void
nuked_drv_close(void *priv)
{
nuked_drv_t *dev = (nuked_drv_t *)priv;
nuked_drv_t *dev = (nuked_drv_t *) priv;
free(dev);
}
static int32_t *
nuked_drv_update(void *priv)
{
nuked_drv_t *dev = (nuked_drv_t *)priv;
nuked_drv_t *dev = (nuked_drv_t *) priv;
if (dev->pos >= sound_pos_global)
return dev->buffer;
@@ -1536,7 +1536,7 @@ nuked_drv_read(uint16_t port, void *priv)
static void
nuked_drv_write(uint16_t port, uint8_t val, void *priv)
{
nuked_drv_t *dev = (nuked_drv_t *)priv;
nuked_drv_t *dev = (nuked_drv_t *) priv;
nuked_drv_update(dev);
if ((port & 0x0001) == 0x0001) {
@@ -1574,38 +1574,39 @@ nuked_drv_write(uint16_t port, uint8_t val, void *priv)
}
static void
nuked_drv_reset_buffer(void *priv) {
nuked_drv_t *dev = (nuked_drv_t *)priv;
nuked_drv_reset_buffer(void *priv)
{
nuked_drv_t *dev = (nuked_drv_t *) priv;
dev->pos = 0;
}
const device_t ym3812_nuked_device = {
.name = "Yamaha YM3812 OPL2 (NUKED)",
.name = "Yamaha YM3812 OPL2 (NUKED)",
.internal_name = "ym3812_nuked",
.flags = 0,
.local = FM_YM3812,
.init = nuked_drv_init,
.close = nuked_drv_close,
.reset = NULL,
.flags = 0,
.local = FM_YM3812,
.init = nuked_drv_init,
.close = nuked_drv_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t ymf262_nuked_device = {
.name = "Yamaha YMF262 OPL3 (NUKED)",
.name = "Yamaha YMF262 OPL3 (NUKED)",
.internal_name = "ymf262_nuked",
.flags = 0,
.local = FM_YMF262,
.init = nuked_drv_init,
.close = nuked_drv_close,
.reset = NULL,
.flags = 0,
.local = FM_YMF262,
.init = nuked_drv_init,
.close = nuked_drv_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const fm_drv_t nuked_opl_drv = {

View File

@@ -28,17 +28,18 @@ extern "C" {
#include <86box/snd_opl.h>
}
#define RSM_FRAC 10
#define RSM_FRAC 10
enum {
FLAG_CYCLES = (1 << 0)
};
class YMFMChipBase
{
class YMFMChipBase {
public:
YMFMChipBase(uint32_t clock, fm_type type, uint32_t samplerate)
: m_buf_pos(0), m_flags(0), m_type(type)
: m_buf_pos(0)
, m_flags(0)
, m_type(type)
{
memset(m_buffer, 0, sizeof(m_buffer));
}
@@ -47,30 +48,29 @@ public:
{
}
fm_type type() const { return m_type; }
int8_t flags() const { return m_flags; }
void set_do_cycles(int8_t do_cycles) { do_cycles ? m_flags |= FLAG_CYCLES : m_flags &= ~FLAG_CYCLES; }
int32_t *buffer() const { return (int32_t *)m_buffer; }
void reset_buffer() { m_buf_pos = 0; }
fm_type type() const { return m_type; }
int8_t flags() const { return m_flags; }
void set_do_cycles(int8_t do_cycles) { do_cycles ? m_flags |= FLAG_CYCLES : m_flags &= ~FLAG_CYCLES; }
int32_t *buffer() const { return (int32_t *) m_buffer; }
void reset_buffer() { m_buf_pos = 0; }
virtual uint32_t sample_rate() const = 0;
virtual void write(uint16_t addr, uint8_t data) = 0;
virtual void generate(int32_t *data, uint32_t num_samples) = 0;
virtual void generate_resampled(int32_t *data, uint32_t num_samples) = 0;
virtual int32_t * update() = 0;
virtual uint8_t read(uint16_t addr) = 0;
virtual void write(uint16_t addr, uint8_t data) = 0;
virtual void generate(int32_t *data, uint32_t num_samples) = 0;
virtual void generate_resampled(int32_t *data, uint32_t num_samples) = 0;
virtual int32_t *update() = 0;
virtual uint8_t read(uint16_t addr) = 0;
protected:
int32_t m_buffer[SOUNDBUFLEN * 2];
int m_buf_pos;
int8_t m_flags;
int m_buf_pos;
int8_t m_flags;
fm_type m_type;
};
template <typename ChipType>
class YMFMChip : public YMFMChipBase, public ymfm::ymfm_interface
{
class YMFMChip : public YMFMChipBase, public ymfm::ymfm_interface {
public:
YMFMChip(uint32_t clock, fm_type type, uint32_t samplerate)
: YMFMChipBase(clock, type, samplerate)
@@ -80,11 +80,11 @@ public:
{
memset(m_samples, 0, sizeof(m_samples));
memset(m_oldsamples, 0, sizeof(m_oldsamples));
m_rateratio = (samplerate << RSM_FRAC) / m_chip.sample_rate(m_clock);
m_clock_us = 1000000 / (double) m_clock;
m_rateratio = (samplerate << RSM_FRAC) / m_chip.sample_rate(m_clock);
m_clock_us = 1000000 / (double) m_clock;
m_subtract[0] = 80.0;
m_subtract[1] = 320.0;
m_type = type;
m_type = type;
timer_add(&m_timers[0], YMFMChip::timer1, this, 0);
timer_add(&m_timers[1], YMFMChip::timer2, this, 0);
@@ -126,7 +126,7 @@ public:
}
}
virtual void generate_resampled(int32_t *data, uint32_t num_samples) override
virtual void generate_resampled(int32_t *data, uint32_t num_samples) override
{
for (uint32_t i = 0; i < num_samples; i++) {
while (m_samplecnt >= m_rateratio) {
@@ -144,11 +144,11 @@ virtual void generate_resampled(int32_t *data, uint32_t num_samples) override
}
*data++ = ((int32_t) ((m_oldsamples[0] * (m_rateratio - m_samplecnt)
+ m_samples[0] * m_samplecnt)
/ m_rateratio));
+ m_samples[0] * m_samplecnt)
/ m_rateratio));
*data++ = ((int32_t) ((m_oldsamples[1] * (m_rateratio - m_samplecnt)
+ m_samples[1] * m_samplecnt)
/ m_rateratio));
+ m_samples[1] * m_samplecnt)
/ m_rateratio));
m_samplecnt += 1 << RSM_FRAC;
}
@@ -197,21 +197,20 @@ virtual void generate_resampled(int32_t *data, uint32_t num_samples) override
}
private:
ChipType m_chip;
uint32_t m_clock;
double m_clock_us, m_subtract[2];
ChipType m_chip;
uint32_t m_clock;
double m_clock_us, m_subtract[2];
typename ChipType::output_data m_output;
pc_timer_t m_timers[2];
pc_timer_t m_timers[2];
// Resampling
int32_t m_rateratio;
int32_t m_samplecnt;
int32_t m_oldsamples[2];
int32_t m_samples[2];
int32_t m_rateratio;
int32_t m_samplecnt;
int32_t m_oldsamples[2];
int32_t m_samples[2];
};
extern "C"
{
extern "C" {
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
@@ -271,7 +270,7 @@ ymfm_drv_close(void *priv)
YMFMChipBase *drv = (YMFMChipBase *) priv;
if (drv != NULL)
delete(drv);
delete (drv);
}
static uint8_t
@@ -300,14 +299,16 @@ ymfm_drv_write(uint16_t port, uint8_t val, void *priv)
}
static int32_t *
ymfm_drv_update(void *priv) {
ymfm_drv_update(void *priv)
{
YMFMChipBase *drv = (YMFMChipBase *) priv;
return drv->update();
}
static void
ymfm_drv_reset_buffer(void *priv) {
ymfm_drv_reset_buffer(void *priv)
{
YMFMChipBase *drv = (YMFMChipBase *) priv;
drv->reset_buffer();
@@ -321,45 +322,45 @@ ymfm_drv_set_do_cycles(void *priv, int8_t do_cycles)
}
const device_t ym3812_ymfm_device = {
.name = "Yamaha YM3812 OPL2 (YMFM)",
.name = "Yamaha YM3812 OPL2 (YMFM)",
.internal_name = "ym3812_ymfm",
.flags = 0,
.local = FM_YM3812,
.init = ymfm_drv_init,
.close = ymfm_drv_close,
.reset = NULL,
.flags = 0,
.local = FM_YM3812,
.init = ymfm_drv_init,
.close = ymfm_drv_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t ymf262_ymfm_device = {
.name = "Yamaha YMF262 OPL3 (YMFM)",
.name = "Yamaha YMF262 OPL3 (YMFM)",
.internal_name = "ymf262_ymfm",
.flags = 0,
.local = FM_YMF262,
.init = ymfm_drv_init,
.close = ymfm_drv_close,
.reset = NULL,
.flags = 0,
.local = FM_YMF262,
.init = ymfm_drv_init,
.close = ymfm_drv_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t ymf289b_ymfm_device = {
.name = "Yamaha YMF289B OPL3-L (YMFM)",
.name = "Yamaha YMF289B OPL3-L (YMFM)",
.internal_name = "ymf289b_ymfm",
.flags = 0,
.local = FM_YMF289B,
.init = ymfm_drv_init,
.close = ymfm_drv_close,
.reset = NULL,
.flags = 0,
.local = FM_YMF289B,
.init = ymfm_drv_init,
.close = ymfm_drv_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const fm_drv_t ymfm_drv {
@@ -370,5 +371,4 @@ const fm_drv_t ymfm_drv {
&ymfm_drv_set_do_cycles,
NULL,
};
}

View File

@@ -711,7 +711,7 @@ pas16_get_buffer(int32_t *buffer, int len, void *p)
buffer[c] += (pas16->pcm_buffer[c & 1][c >> 1] / 2);
}
pas16->pos = 0;
pas16->pos = 0;
pas16->opl.reset_buffer(pas16->opl.priv);
pas16->dsp.pos = 0;
}
@@ -743,15 +743,15 @@ pas16_close(void *p)
}
const device_t pas16_device = {
.name = "Pro Audio Spectrum 16",
.name = "Pro Audio Spectrum 16",
.internal_name = "pas16",
.flags = DEVICE_ISA,
.local = 0,
.init = pas16_init,
.close = pas16_close,
.reset = NULL,
.flags = DEVICE_ISA,
.local = 0,
.init = pas16_init,
.close = pas16_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};

View File

@@ -187,15 +187,15 @@ ps1snd_close(void *priv)
}
const device_t ps1snd_device = {
.name = "IBM PS/1 Audio Card",
.name = "IBM PS/1 Audio Card",
.internal_name = "ps1snd",
.flags = 0,
.local = 0,
.init = ps1snd_init,
.close = ps1snd_close,
.reset = NULL,
.flags = 0,
.local = 0,
.init = ps1snd_init,
.close = ps1snd_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};

View File

@@ -237,7 +237,7 @@ pssj_close(void *p)
#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA)
static const device_config_t pssj_isa_config[] = {
// clang-format off
// clang-format off
{
.name = "base",
.description = "Address",
@@ -268,45 +268,45 @@ static const device_config_t pssj_isa_config[] = {
#endif
const device_t pssj_device = {
.name = "Tandy PSSJ",
.name = "Tandy PSSJ",
.internal_name = "pssj",
.flags = 0,
.local = 0,
.init = pssj_init,
.close = pssj_close,
.reset = NULL,
.flags = 0,
.local = 0,
.init = pssj_init,
.close = pssj_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t pssj_1e0_device = {
.name = "Tandy PSSJ (port 1e0h)",
.name = "Tandy PSSJ (port 1e0h)",
.internal_name = "pssj_1e0",
.flags = 0,
.local = 0,
.init = pssj_1e0_init,
.close = pssj_close,
.reset = NULL,
.flags = 0,
.local = 0,
.init = pssj_1e0_init,
.close = pssj_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA)
const device_t pssj_isa_device = {
.name = "Tandy PSSJ Clone",
.name = "Tandy PSSJ Clone",
.internal_name = "pssj_isa",
.flags = DEVICE_ISA,
.local = 0,
.init = pssj_isa_init,
.close = pssj_close,
.reset = NULL,
.flags = DEVICE_ISA,
.local = 0,
.init = pssj_isa_init,
.close = pssj_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = pssj_isa_config
.force_redraw = NULL,
.config = pssj_isa_config
};
#endif

View File

@@ -183,7 +183,7 @@ sb_get_buffer_sb2(int32_t *buffer, int len, void *p)
sb_ct1335_mixer_t *mixer = &sb->mixer_sb2;
int c;
double out_mono = 0.0, out_l = 0.0, out_r = 0.0;
int32_t *opl_buf = NULL;
int32_t *opl_buf = NULL;
if (sb->opl_enabled)
opl_buf = sb->opl.update(sb->opl.priv);
@@ -266,11 +266,11 @@ sb_get_buffer_sbpro(int32_t *buffer, int len, void *p)
sb_ct1345_mixer_t *mixer = &sb->mixer_sbpro;
int c;
double out_l = 0.0, out_r = 0.0;
int32_t *opl_buf = NULL, *opl2_buf = NULL;
int32_t *opl_buf = NULL, *opl2_buf = NULL;
if (sb->opl_enabled) {
if (sb->dsp.sb_type == SBPRO) {
opl_buf = sb->opl.update(sb->opl.priv);
opl_buf = sb->opl.update(sb->opl.priv);
opl2_buf = sb->opl2.update(sb->opl2.priv);
} else
opl_buf = sb->opl.update(sb->opl.priv);
@@ -347,7 +347,7 @@ sb_get_buffer_sb16_awe32(int32_t *buffer, int len, void *p)
int32_t in_l, in_r;
double out_l = 0.0, out_r = 0.0;
double bass_treble;
int32_t *opl_buf = NULL;
int32_t *opl_buf = NULL;
if (sb->opl_enabled)
opl_buf = sb->opl.update(sb->opl.priv);
@@ -1216,8 +1216,8 @@ static void
sb_16_reply_mca_write(int port, uint8_t val, void *p)
{
uint16_t addr, mpu401_addr;
int low_dma, high_dma;
sb_t *sb = (sb_t *) p;
int low_dma, high_dma;
sb_t *sb = (sb_t *) p;
if (port < 0x102)
return;
@@ -1245,21 +1245,21 @@ sb_16_reply_mca_write(int port, uint8_t val, void *p)
if (addr) {
io_removehandler(addr, 0x0004,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
io_removehandler(addr + 8, 0x0002,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
io_removehandler(0x0388, 0x0004,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
io_removehandler(addr + 4, 0x0002,
sb_ct1745_mixer_read, NULL, NULL,
sb_ct1745_mixer_write, NULL, NULL,
sb);
sb_ct1745_mixer_read, NULL, NULL,
sb_ct1745_mixer_write, NULL, NULL,
sb);
}
/* DSP I/O handler is activated in sb_dsp_setaddr */
@@ -1337,7 +1337,7 @@ sb_16_reply_mca_write(int port, uint8_t val, void *p)
break;
}
low_dma = sb->pos_regs[3] & 3;
low_dma = sb->pos_regs[3] & 3;
high_dma = (sb->pos_regs[3] >> 4) & 7;
if (!high_dma)
high_dma = low_dma;
@@ -1945,7 +1945,7 @@ sb_16_reply_mca_init(const device_t *info)
sb_dsp_init(&sb->dsp, SB16, SB_SUBTYPE_DEFAULT, sb);
sb_ct1745_mixer_reset(sb);
sb->mixer_enabled = 1;
sb->mixer_enabled = 1;
sb->mixer_sb16.output_filter = 1;
sound_add_handler(sb_get_buffer_sb16_awe32, sb);
sound_set_cd_audio_filter(sb16_awe32_filter_cd_audio, sb);

View File

@@ -349,11 +349,11 @@ sb_start_dma(sb_dsp_t *dsp, int dma8, int autoinit, uint8_t format, int len)
dsp->sb_pausetime = -1;
if (dma8) {
dsp->sb_8_length = dsp->sb_8_origlength = len;
dsp->sb_8_format = format;
dsp->sb_8_autoinit = autoinit;
dsp->sb_8_pause = 0;
dsp->sb_8_enable = 1;
dsp->sb_8_length = dsp->sb_8_origlength = len;
dsp->sb_8_format = format;
dsp->sb_8_autoinit = autoinit;
dsp->sb_8_pause = 0;
dsp->sb_8_enable = 1;
if (dsp->sb_16_enable && dsp->sb_16_output)
dsp->sb_16_enable = 0;
@@ -363,11 +363,11 @@ sb_start_dma(sb_dsp_t *dsp, int dma8, int autoinit, uint8_t format, int len)
dsp->sbleftright = dsp->sbleftright_default;
dsp->sbdacpos = 0;
} else {
dsp->sb_16_length = dsp->sb_16_origlength = len;
dsp->sb_16_format = format;
dsp->sb_16_autoinit = autoinit;
dsp->sb_16_pause = 0;
dsp->sb_16_enable = 1;
dsp->sb_16_length = dsp->sb_16_origlength = len;
dsp->sb_16_format = format;
dsp->sb_16_autoinit = autoinit;
dsp->sb_16_pause = 0;
dsp->sb_16_enable = 1;
if (dsp->sb_8_enable && dsp->sb_8_output)
dsp->sb_8_enable = 0;
dsp->sb_16_output = 1;
@@ -380,22 +380,22 @@ void
sb_start_dma_i(sb_dsp_t *dsp, int dma8, int autoinit, uint8_t format, int len)
{
if (dma8) {
dsp->sb_8_length = dsp->sb_8_origlength = len;
dsp->sb_8_format = format;
dsp->sb_8_autoinit = autoinit;
dsp->sb_8_pause = 0;
dsp->sb_8_enable = 1;
dsp->sb_8_length = dsp->sb_8_origlength = len;
dsp->sb_8_format = format;
dsp->sb_8_autoinit = autoinit;
dsp->sb_8_pause = 0;
dsp->sb_8_enable = 1;
if (dsp->sb_16_enable && !dsp->sb_16_output)
dsp->sb_16_enable = 0;
dsp->sb_8_output = 0;
if (!timer_is_enabled(&dsp->input_timer))
timer_set_delay_u64(&dsp->input_timer, dsp->sblatchi);
} else {
dsp->sb_16_length = dsp->sb_16_origlength = len;
dsp->sb_16_format = format;
dsp->sb_16_autoinit = autoinit;
dsp->sb_16_pause = 0;
dsp->sb_16_enable = 1;
dsp->sb_16_length = dsp->sb_16_origlength = len;
dsp->sb_16_format = format;
dsp->sb_16_autoinit = autoinit;
dsp->sb_16_pause = 0;
dsp->sb_16_enable = 1;
if (dsp->sb_8_enable && !dsp->sb_8_output)
dsp->sb_8_enable = 0;
dsp->sb_16_output = 0;

View File

@@ -245,7 +245,7 @@ sn76489_device_close(void *p)
#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA)
static const device_config_t tndy_config[] = {
// clang-format off
// clang-format off
{
.name = "base",
.description = "Address",
@@ -276,45 +276,45 @@ static const device_config_t tndy_config[] = {
#endif
const device_t sn76489_device = {
.name = "TI SN74689 PSG",
.name = "TI SN74689 PSG",
.internal_name = "sn76489",
.flags = 0,
.local = 0,
.init = sn76489_device_init,
.close = sn76489_device_close,
.reset = NULL,
.flags = 0,
.local = 0,
.init = sn76489_device_init,
.close = sn76489_device_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
const device_t ncr8496_device = {
.name = "NCR8496 PSG",
.name = "NCR8496 PSG",
.internal_name = "ncr8496",
.flags = 0,
.local = 0,
.init = ncr8496_device_init,
.close = sn76489_device_close,
.reset = NULL,
.flags = 0,
.local = 0,
.init = ncr8496_device_init,
.close = sn76489_device_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};
#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA)
const device_t tndy_device = {
.name = "TNDY",
.name = "TNDY",
.internal_name = "tndy",
.flags = DEVICE_ISA,
.local = 0,
.init = tndy_device_init,
.close = sn76489_device_close,
.reset = NULL,
.flags = DEVICE_ISA,
.local = 0,
.init = tndy_device_init,
.close = sn76489_device_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = tndy_config
.force_redraw = NULL,
.config = tndy_config
};
#endif

View File

@@ -91,7 +91,7 @@ ssi2001_close(void *p)
}
static const device_config_t ssi2001_config[] = {
// clang-format off
// clang-format off
{
.name = "base",
.description = "Address",

View File

@@ -52,7 +52,7 @@ typedef struct wss_t {
uint8_t config;
ad1848_t ad1848;
fm_drv_t opl;
fm_drv_t opl;
int opl_enabled;
uint8_t pos_regs[8];
@@ -227,7 +227,7 @@ wss_speed_changed(void *priv)
}
static const device_config_t wss_config[] = {
// clang-format off
// clang-format off
{
.name = "base",
.description = "Address",
@@ -268,29 +268,29 @@ static const device_config_t wss_config[] = {
};
const device_t wss_device = {
.name = "Windows Sound System",
.name = "Windows Sound System",
.internal_name = "wss",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = wss_init,
.close = wss_close,
.reset = NULL,
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = wss_init,
.close = wss_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = wss_speed_changed,
.force_redraw = NULL,
.config = wss_config
.force_redraw = NULL,
.config = wss_config
};
const device_t ncr_business_audio_device = {
.name = "NCR Business Audio",
.name = "NCR Business Audio",
.internal_name = "ncraudio",
.flags = DEVICE_MCA,
.local = 0,
.init = ncr_audio_init,
.close = wss_close,
.reset = NULL,
.flags = DEVICE_MCA,
.local = 0,
.init = ncr_audio_init,
.close = wss_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = wss_speed_changed,
.force_redraw = NULL,
.config = NULL
.force_redraw = NULL,
.config = NULL
};