Conflict resolution.
This commit is contained in:
@@ -152,7 +152,7 @@ midi_out_device_has_config(int card)
|
||||
return devices[card].device->config ? 1 : 0;
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
midi_out_device_get_internal_name(int card)
|
||||
{
|
||||
return device_get_internal_name(devices[card].device);
|
||||
@@ -270,7 +270,7 @@ midi_in_device_has_config(int card)
|
||||
return midi_in_devices[card].device->config ? 1 : 0;
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
midi_in_device_get_internal_name(int card)
|
||||
{
|
||||
return device_get_internal_name(midi_in_devices[card].device);
|
||||
|
||||
@@ -888,9 +888,9 @@ adgold_filter_cd_audio(int channel, double *buffer, void *priv)
|
||||
}
|
||||
|
||||
static void
|
||||
adgold_input_msg(void *p, uint8_t *msg, uint32_t len)
|
||||
adgold_input_msg(void *priv, uint8_t *msg, uint32_t len)
|
||||
{
|
||||
adgold_t *adgold = (adgold_t *) p;
|
||||
adgold_t *adgold = (adgold_t *) priv;
|
||||
|
||||
if (adgold->sysex)
|
||||
return;
|
||||
@@ -908,9 +908,9 @@ adgold_input_msg(void *p, uint8_t *msg, uint32_t len)
|
||||
}
|
||||
|
||||
static int
|
||||
adgold_input_sysex(void *p, uint8_t *buffer, uint32_t len, int abort)
|
||||
adgold_input_sysex(void *priv, uint8_t *buffer, uint32_t len, int abort)
|
||||
{
|
||||
adgold_t *adgold = (adgold_t *) p;
|
||||
adgold_t *adgold = (adgold_t *) priv;
|
||||
|
||||
if (abort) {
|
||||
adgold->sysex = 0;
|
||||
@@ -930,7 +930,7 @@ adgold_input_sysex(void *p, uint8_t *buffer, uint32_t len, int abort)
|
||||
void *
|
||||
adgold_init(UNUSED(const device_t *info))
|
||||
{
|
||||
FILE *f;
|
||||
FILE *fp;
|
||||
int c;
|
||||
double out;
|
||||
adgold_t *adgold = malloc(sizeof(adgold_t));
|
||||
@@ -980,11 +980,11 @@ adgold_init(UNUSED(const device_t *info))
|
||||
adgold->adgold_eeprom[0x18] = 0x00; /* Surround */
|
||||
adgold->adgold_eeprom[0x19] = 0x00;
|
||||
|
||||
f = nvr_fopen("adgold.bin", "rb");
|
||||
if (f) {
|
||||
if (fread(adgold->adgold_eeprom, 1, 0x1a, f) != 0x1a)
|
||||
fp = nvr_fopen("adgold.bin", "rb");
|
||||
if (fp) {
|
||||
if (fread(adgold->adgold_eeprom, 1, 0x1a, fp) != 0x1a)
|
||||
fatal("adgold_init(): Error reading data\n");
|
||||
fclose(f);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
adgold->adgold_status = 0xf;
|
||||
|
||||
@@ -2054,18 +2054,18 @@ generate_es1371_filter(void)
|
||||
}
|
||||
|
||||
static void
|
||||
es1371_input_msg(void *p, uint8_t *msg, uint32_t len)
|
||||
es1371_input_msg(void *priv, uint8_t *msg, uint32_t len)
|
||||
{
|
||||
es1371_t *dev = (es1371_t *) p;
|
||||
es1371_t *dev = (es1371_t *) priv;
|
||||
|
||||
for (uint32_t i = 0; i < len; i++)
|
||||
es1371_write_fifo(dev, msg[i]);
|
||||
}
|
||||
|
||||
static int
|
||||
es1371_input_sysex(void *p, uint8_t *buffer, uint32_t len, int abort)
|
||||
es1371_input_sysex(void *priv, uint8_t *buffer, uint32_t len, int abort)
|
||||
{
|
||||
es1371_t *dev = (es1371_t *) p;
|
||||
es1371_t *dev = (es1371_t *) priv;
|
||||
uint32_t i = -1;
|
||||
|
||||
audiopci_log("Abort = %i\n", abort);
|
||||
|
||||
@@ -968,7 +968,7 @@ azt2316a_get_buffer(int32_t *buffer, int len, void *priv)
|
||||
static void *
|
||||
azt_init(const device_t *info)
|
||||
{
|
||||
FILE *f;
|
||||
FILE *fp;
|
||||
char *fn = NULL;
|
||||
int i;
|
||||
int loaded_from_eeprom = 0;
|
||||
@@ -986,20 +986,20 @@ azt_init(const device_t *info)
|
||||
}
|
||||
|
||||
/* config */
|
||||
f = nvr_fopen(fn, "rb");
|
||||
if (f) {
|
||||
fp = nvr_fopen(fn, "rb");
|
||||
if (fp) {
|
||||
uint8_t checksum = 0x7f;
|
||||
uint8_t saved_checksum;
|
||||
size_t res;
|
||||
|
||||
res = fread(read_eeprom, AZTECH_EEPROM_SIZE, 1, f);
|
||||
res = fread(read_eeprom, AZTECH_EEPROM_SIZE, 1, fp);
|
||||
for (i = 0; i < AZTECH_EEPROM_SIZE; i++)
|
||||
checksum += read_eeprom[i];
|
||||
|
||||
res = fread(&saved_checksum, sizeof(saved_checksum), 1, f);
|
||||
res = fread(&saved_checksum, sizeof(saved_checksum), 1, fp);
|
||||
(void) res;
|
||||
|
||||
fclose(f);
|
||||
fclose(fp);
|
||||
|
||||
if (checksum == saved_checksum)
|
||||
loaded_from_eeprom = 1;
|
||||
@@ -1273,7 +1273,7 @@ azt_close(void *priv)
|
||||
{
|
||||
azt2316a_t *azt2316a = (azt2316a_t *) priv;
|
||||
char *fn = NULL;
|
||||
FILE *f;
|
||||
FILE *fp;
|
||||
uint8_t checksum = 0x7f;
|
||||
|
||||
if (azt2316a->type == SB_SUBTYPE_CLONE_AZT1605_0X0C) {
|
||||
@@ -1283,18 +1283,18 @@ azt_close(void *priv)
|
||||
}
|
||||
|
||||
/* always save to eeprom (recover from bad values) */
|
||||
f = nvr_fopen(fn, "wb");
|
||||
if (f) {
|
||||
fp = nvr_fopen(fn, "wb");
|
||||
if (fp) {
|
||||
for (uint8_t i = 0; i < AZTECH_EEPROM_SIZE; i++)
|
||||
checksum += azt2316a->sb->dsp.azt_eeprom[i];
|
||||
fwrite(azt2316a->sb->dsp.azt_eeprom, AZTECH_EEPROM_SIZE, 1, f);
|
||||
fwrite(azt2316a->sb->dsp.azt_eeprom, AZTECH_EEPROM_SIZE, 1, fp);
|
||||
|
||||
// TODO: confirm any models saving mixer settings to EEPROM and implement reading back
|
||||
// TODO: should remember to save wss duplex setting if 86Box has voice recording implemented in the future? Also, default azt2316a->wss_config
|
||||
// TODO: azt2316a->cur_mode is not saved to EEPROM?
|
||||
fwrite(&checksum, sizeof(checksum), 1, f);
|
||||
fwrite(&checksum, sizeof(checksum), 1, fp);
|
||||
|
||||
fclose(f);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
sb_close(azt2316a->sb);
|
||||
|
||||
@@ -171,13 +171,13 @@ static void cs423x_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config
|
||||
static void
|
||||
cs423x_nvram(cs423x_t *dev, uint8_t save)
|
||||
{
|
||||
FILE *f = nvr_fopen(dev->nvr_path, save ? "wb" : "rb");
|
||||
if (f) {
|
||||
FILE *fp = nvr_fopen(dev->nvr_path, save ? "wb" : "rb");
|
||||
if (fp) {
|
||||
if (save)
|
||||
fwrite(dev->eeprom_data, sizeof(dev->eeprom_data), 1, f);
|
||||
fwrite(dev->eeprom_data, sizeof(dev->eeprom_data), 1, fp);
|
||||
else
|
||||
(void) !fread(dev->eeprom_data, sizeof(dev->eeprom_data), 1, f);
|
||||
fclose(f);
|
||||
(void) !fread(dev->eeprom_data, sizeof(dev->eeprom_data), 1, fp);
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2168,18 +2168,18 @@ void
|
||||
emu8k_init(emu8k_t *emu8k, uint16_t emu_addr, int onboard_ram)
|
||||
{
|
||||
uint32_t const BLOCK_SIZE_WORDS = 0x10000;
|
||||
FILE *f;
|
||||
FILE *fp;
|
||||
int c;
|
||||
double out;
|
||||
|
||||
f = rom_fopen("roms/sound/awe32.raw", "rb");
|
||||
if (!f)
|
||||
fp = rom_fopen("roms/sound/awe32.raw", "rb");
|
||||
if (!fp)
|
||||
fatal("AWE32.RAW not found\n");
|
||||
|
||||
emu8k->rom = malloc(1024 * 1024);
|
||||
if (fread(emu8k->rom, 1, 1048576, f) != 1048576)
|
||||
if (fread(emu8k->rom, 1, 1048576, fp) != 1048576)
|
||||
fatal("emu8k_init(): Error reading data\n");
|
||||
fclose(f);
|
||||
fclose(fp);
|
||||
/*AWE-DUMP creates ROM images offset by 2 bytes, so if we detect this
|
||||
then correct it*/
|
||||
if (emu8k->rom[3] == 0x314d && emu8k->rom[4] == 0x474d) {
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
#include <86box/pic.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/snd_ad1848.h>
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
# include <86box/snd_ad1848.h>
|
||||
#endif
|
||||
#include <86box/plat_fallthrough.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
@@ -104,9 +106,12 @@ typedef struct gus_t {
|
||||
pc_timer_t timer_1;
|
||||
pc_timer_t timer_2;
|
||||
|
||||
uint8_t type;
|
||||
|
||||
int irq;
|
||||
int dma;
|
||||
int irq_midi;
|
||||
int dma2;
|
||||
uint16_t base;
|
||||
int latch_enable;
|
||||
|
||||
@@ -139,9 +144,9 @@ typedef struct gus_t {
|
||||
|
||||
uint8_t usrr;
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
uint8_t max_ctrl;
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
ad1848_t ad1848;
|
||||
#endif
|
||||
} gus_t;
|
||||
@@ -211,16 +216,16 @@ gus_update_int_status(gus_t *gus)
|
||||
|
||||
if (gus->irq != -1) {
|
||||
if (intr_pending)
|
||||
picintlevel(1 << gus->irq, &gus->irq_state);
|
||||
picint(1 << gus->irq);
|
||||
else
|
||||
picintclevel(1 << gus->irq, &gus->irq_state);
|
||||
picintc(1 << gus->irq);
|
||||
}
|
||||
|
||||
if (gus->irq_midi != -1) {
|
||||
if ((gus->irq_midi != -1) && (gus->irq_midi != gus->irq)) {
|
||||
if (midi_intr_pending)
|
||||
picintlevel(1 << gus->irq_midi, &gus->midi_irq_state);
|
||||
picint(1 << gus->irq_midi);
|
||||
else
|
||||
picintclevel(1 << gus->irq_midi, &gus->midi_irq_state);
|
||||
picintc(1 << gus->irq_midi);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -589,14 +594,24 @@ writegus(uint16_t addr, uint8_t val, void *priv)
|
||||
} else
|
||||
gus->irq_midi = gus_midi_irqs[(val >> 3) & 7];
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
ad1848_setirq(&gus->ad1848, gus->irq);
|
||||
if (gus->type == GUS_MAX)
|
||||
ad1848_setirq(&gus->ad1848, gus->irq);
|
||||
#endif
|
||||
|
||||
gus->sb_nmi = val & 0x80;
|
||||
} else {
|
||||
gus->dma = gus_dmas[val & 7];
|
||||
|
||||
if (val & 0x40) {
|
||||
if (gus->dma == -1)
|
||||
gus->dma = gus->dma2 = gus_dmas[(val >> 3) & 7];
|
||||
else
|
||||
gus->dma2 = gus->dma;
|
||||
} else
|
||||
gus->dma2 = gus_dmas[(val >> 3) & 7];
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
ad1848_setdma(&gus->ad1848, gus->dma);
|
||||
if (gus->type == GUS_MAX)
|
||||
ad1848_setdma(&gus->ad1848, gus->dma2);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
@@ -655,20 +670,24 @@ writegus(uint16_t addr, uint8_t val, void *priv)
|
||||
break;
|
||||
case 0x306:
|
||||
case 0x706:
|
||||
if (gus->dma >= 4)
|
||||
val |= 0x30;
|
||||
gus->max_ctrl = (val >> 6) & 1;
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
if (val & 0x40) {
|
||||
if ((val & 0xF) != ((addr >> 4) & 0xF)) {
|
||||
csioport = 0x30c | ((addr >> 4) & 0xf);
|
||||
io_removehandler(csioport, 4,
|
||||
ad1848_read, NULL, NULL,
|
||||
ad1848_write, NULL, NULL, &gus->ad1848);
|
||||
csioport = 0x30c | ((val & 0xf) << 4);
|
||||
io_sethandler(csioport, 4,
|
||||
ad1848_read, NULL, NULL,
|
||||
ad1848_write, NULL, NULL, &gus->ad1848);
|
||||
if (gus->type == GUS_MAX) {
|
||||
if (gus->dma >= 4)
|
||||
val |= 0x10;
|
||||
if (gus->dma2 >= 4)
|
||||
val |= 0x20;
|
||||
gus->max_ctrl = (val >> 6) & 1;
|
||||
if (val & 0x40) {
|
||||
if ((val & 0xF) != ((addr >> 4) & 0xF)) {
|
||||
csioport = 0x30c | ((addr >> 4) & 0xf);
|
||||
io_removehandler(csioport, 4,
|
||||
ad1848_read, NULL, NULL,
|
||||
ad1848_write, NULL, NULL, &gus->ad1848);
|
||||
csioport = 0x30c | ((val & 0xf) << 4);
|
||||
io_sethandler(csioport, 4,
|
||||
ad1848_read, NULL, NULL,
|
||||
ad1848_write, NULL, NULL, &gus->ad1848);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -723,9 +742,11 @@ readgus(uint16_t addr, void *priv)
|
||||
return val;
|
||||
|
||||
case 0x20F:
|
||||
if (gus->max_ctrl)
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
if (gus->type == GUS_MAX)
|
||||
val = 0x02;
|
||||
else
|
||||
#endif
|
||||
val = 0x00;
|
||||
break;
|
||||
|
||||
@@ -844,9 +865,11 @@ readgus(uint16_t addr, void *priv)
|
||||
break;
|
||||
case 0x306:
|
||||
case 0x706:
|
||||
if (gus->max_ctrl)
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
if (gus->type == GUS_MAX)
|
||||
val = 0x0a; /* GUS MAX */
|
||||
else
|
||||
#endif
|
||||
val = 0xff; /*Pre 3.7 - no mixer*/
|
||||
break;
|
||||
|
||||
@@ -905,7 +928,7 @@ readgus(uint16_t addr, void *priv)
|
||||
#ifdef OLD_NMI_BEHAVIOR
|
||||
nmi = 0;
|
||||
#endif
|
||||
/*FALLTHROUGH*/
|
||||
fallthrough;
|
||||
case 0x389:
|
||||
val = gus->ad_data;
|
||||
break;
|
||||
@@ -1128,30 +1151,30 @@ gus_get_buffer(int32_t *buffer, int len, void *priv)
|
||||
gus_t *gus = (gus_t *) priv;
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
if (gus->max_ctrl)
|
||||
if ((gus->type == GUS_MAX) && (gus->max_ctrl))
|
||||
ad1848_update(&gus->ad1848);
|
||||
#endif
|
||||
gus_update(gus);
|
||||
|
||||
for (int c = 0; c < len * 2; c++) {
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
if (gus->max_ctrl)
|
||||
if ((gus->type == GUS_MAX) && (gus->max_ctrl))
|
||||
buffer[c] += (int32_t) (gus->ad1848.buffer[c] / 2);
|
||||
#endif
|
||||
buffer[c] += (int32_t) gus->buffer[c & 1][c >> 1];
|
||||
}
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
if (gus->max_ctrl)
|
||||
if ((gus->type == GUS_MAX) && (gus->max_ctrl))
|
||||
gus->ad1848.pos = 0;
|
||||
#endif
|
||||
gus->pos = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gus_input_msg(void *p, uint8_t *msg, uint32_t len)
|
||||
gus_input_msg(void *priv, uint8_t *msg, uint32_t len)
|
||||
{
|
||||
gus_t *gus = (gus_t *) p;
|
||||
gus_t *gus = (gus_t *) priv;
|
||||
|
||||
if (gus->sysex)
|
||||
return;
|
||||
@@ -1169,9 +1192,9 @@ gus_input_msg(void *p, uint8_t *msg, uint32_t len)
|
||||
}
|
||||
|
||||
static int
|
||||
gus_input_sysex(void *p, uint8_t *buffer, uint32_t len, int abort)
|
||||
gus_input_sysex(void *priv, uint8_t *buffer, uint32_t len, int abort)
|
||||
{
|
||||
gus_t *gus = (gus_t *) p;
|
||||
gus_t *gus = (gus_t *) priv;
|
||||
|
||||
if (abort) {
|
||||
gus->sysex = 0;
|
||||
@@ -1189,11 +1212,11 @@ gus_input_sysex(void *p, uint8_t *buffer, uint32_t len, int abort)
|
||||
}
|
||||
|
||||
static void
|
||||
gus_reset(void *p)
|
||||
gus_reset(void *priv)
|
||||
{
|
||||
gus_t *gus = (gus_t *) p;
|
||||
int c;
|
||||
double out = 1.0;
|
||||
gus_t *gus = (gus_t *) priv;
|
||||
int c;
|
||||
double out = 1.0;
|
||||
|
||||
if (gus == NULL)
|
||||
return;
|
||||
@@ -1277,7 +1300,9 @@ gus_reset(void *p)
|
||||
|
||||
gus->usrr = 0;
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
gus->max_ctrl = 0;
|
||||
#endif
|
||||
|
||||
gus->irq_state = 0;
|
||||
gus->midi_irq_state = 0;
|
||||
@@ -1317,6 +1342,8 @@ gus_init(UNUSED(const device_t *info))
|
||||
|
||||
gus->uart_out = 1;
|
||||
|
||||
gus->type = device_get_config_int("type");
|
||||
|
||||
gus->base = device_get_config_hex16("base");
|
||||
|
||||
io_sethandler(gus->base, 0x0010, readgus, NULL, NULL, writegus, NULL, NULL, gus);
|
||||
@@ -1325,11 +1352,13 @@ gus_init(UNUSED(const device_t *info))
|
||||
io_sethandler(0x0388, 0x0002, readgus, NULL, NULL, writegus, NULL, NULL, gus);
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
ad1848_init(&gus->ad1848, AD1848_TYPE_CS4231);
|
||||
ad1848_setirq(&gus->ad1848, 5);
|
||||
ad1848_setdma(&gus->ad1848, 3);
|
||||
io_sethandler(0x10C + gus->base, 4,
|
||||
ad1848_read, NULL, NULL, ad1848_write, NULL, NULL, &gus->ad1848);
|
||||
if (gus->type == GUS_MAX) {
|
||||
ad1848_init(&gus->ad1848, AD1848_TYPE_CS4231);
|
||||
ad1848_setirq(&gus->ad1848, 5);
|
||||
ad1848_setdma(&gus->ad1848, 3);
|
||||
io_sethandler(0x10C + gus->base, 4,
|
||||
ad1848_read, NULL, NULL, ad1848_write, NULL, NULL, &gus->ad1848);
|
||||
}
|
||||
#endif
|
||||
|
||||
timer_add(&gus->samp_timer, gus_poll_wave, gus, 1);
|
||||
@@ -1364,7 +1393,7 @@ gus_speed_changed(void *priv)
|
||||
gus->samp_latch = (uint64_t) (TIMER_USEC * (1000000.0 / gusfreqs[gus->voices - 14]));
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
|
||||
if (gus->max_ctrl)
|
||||
if ((gus->type == GUS_MAX) && (gus->max_ctrl))
|
||||
ad1848_speed_changed(&gus->ad1848);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -145,7 +145,9 @@ MPU401_RunClock(mpu_t *mpu)
|
||||
return;
|
||||
}
|
||||
timer_advance_u64(&mpu->mpu401_event_callback, (MPU401_TIMECONSTANT / mpu->clock.freq) * 1000 * TIMER_USEC);
|
||||
// mpu401_log("Next event after %" PRIu64 " us (time constant: %i)\n", (uint64_t) ((MPU401_TIMECONSTANT / mpu->clock.freq) * 1000 * TIMER_USEC), (int) MPU401_TIMECONSTANT);
|
||||
#if 0
|
||||
mpu401_log("Next event after %" PRIu64 " us (time constant: %i)\n", (uint64_t) ((MPU401_TIMECONSTANT / mpu->clock.freq) * 1000 * TIMER_USEC), (int) MPU401_TIMECONSTANT);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1410,9 +1412,9 @@ MPU401_NotesOff(mpu_t *mpu, int i)
|
||||
|
||||
/*Input handler for SysEx */
|
||||
int
|
||||
MPU401_InputSysex(void *p, uint8_t *buffer, uint32_t len, int abort)
|
||||
MPU401_InputSysex(void *priv, uint8_t *buffer, uint32_t len, int abort)
|
||||
{
|
||||
mpu_t *mpu = (mpu_t *) p;
|
||||
mpu_t *mpu = (mpu_t *) priv;
|
||||
int i;
|
||||
uint8_t val_ff = 0xff;
|
||||
|
||||
@@ -1465,9 +1467,9 @@ MPU401_InputSysex(void *p, uint8_t *buffer, uint32_t len, int abort)
|
||||
|
||||
/*Input handler for MIDI*/
|
||||
void
|
||||
MPU401_InputMsg(void *p, uint8_t *msg, uint32_t len)
|
||||
MPU401_InputMsg(void *priv, uint8_t *msg, uint32_t len)
|
||||
{
|
||||
mpu_t *mpu = (mpu_t *) p;
|
||||
mpu_t *mpu = (mpu_t *) priv;
|
||||
int i;
|
||||
int tick;
|
||||
static uint8_t old_msg = 0;
|
||||
|
||||
@@ -51,7 +51,7 @@ enum {
|
||||
|
||||
class YMFMChipBase {
|
||||
public:
|
||||
YMFMChipBase(uint32_t clock, fm_type type, UNUSED(uint32_t samplerate))
|
||||
YMFMChipBase(UNUSED(uint32_t clock), fm_type type, UNUSED(uint32_t samplerate))
|
||||
: m_buf_pos(0)
|
||||
, m_flags(0)
|
||||
, m_type(type)
|
||||
|
||||
@@ -2227,11 +2227,11 @@ sb_awe32_pnp_init(const device_t *info)
|
||||
|
||||
uint8_t *pnp_rom = NULL;
|
||||
if (pnp_rom_file) {
|
||||
FILE *f = rom_fopen(pnp_rom_file, "rb");
|
||||
if (f) {
|
||||
if (fread(sb->pnp_rom, 1, 512, f) == 512)
|
||||
FILE *fp = rom_fopen(pnp_rom_file, "rb");
|
||||
if (fp) {
|
||||
if (fread(sb->pnp_rom, 1, 512, fp) == 512)
|
||||
pnp_rom = sb->pnp_rom;
|
||||
fclose(f);
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -489,7 +489,7 @@ sb_exec_command(sb_dsp_t *dsp)
|
||||
case 0x17: /* 2-bit ADPCM output with reference */
|
||||
dsp->sbref = dsp->dma_readb(dsp->dma_priv);
|
||||
dsp->sbstep = 0;
|
||||
/* Fall through */
|
||||
fallthrough;
|
||||
case 0x16: /* 2-bit ADPCM output */
|
||||
sb_start_dma(dsp, 1, 0, ADPCM_2, dsp->sb_data[0] + (dsp->sb_data[1] << 8));
|
||||
dsp->sbdat2 = dsp->dma_readb(dsp->dma_priv);
|
||||
@@ -612,7 +612,7 @@ sb_exec_command(sb_dsp_t *dsp)
|
||||
case 0x77: /* 2.6-bit ADPCM output with reference */
|
||||
dsp->sbref = dsp->dma_readb(dsp->dma_priv);
|
||||
dsp->sbstep = 0;
|
||||
/* Fall through */
|
||||
fallthrough;
|
||||
case 0x76: /* 2.6-bit ADPCM output */
|
||||
sb_start_dma(dsp, 1, 0, ADPCM_26, dsp->sb_data[0] + (dsp->sb_data[1] << 8));
|
||||
dsp->sbdat2 = dsp->dma_readb(dsp->dma_priv);
|
||||
@@ -991,6 +991,9 @@ sb_write(uint16_t a, uint8_t v, void *priv)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1064,9 +1067,9 @@ sb_read(uint16_t a, void *priv)
|
||||
}
|
||||
|
||||
void
|
||||
sb_dsp_input_msg(void *p, uint8_t *msg, uint32_t len)
|
||||
sb_dsp_input_msg(void *priv, uint8_t *msg, uint32_t len)
|
||||
{
|
||||
sb_dsp_t *dsp = (sb_dsp_t *) p;
|
||||
sb_dsp_t *dsp = (sb_dsp_t *) priv;
|
||||
|
||||
sb_dsp_log("MIDI in sysex = %d, uart irq = %d, msg = %d\n", dsp->midi_in_sysex, dsp->uart_irq, len);
|
||||
|
||||
@@ -1089,9 +1092,9 @@ sb_dsp_input_msg(void *p, uint8_t *msg, uint32_t len)
|
||||
}
|
||||
|
||||
int
|
||||
sb_dsp_input_sysex(void *p, uint8_t *buffer, uint32_t len, int abort)
|
||||
sb_dsp_input_sysex(void *priv, uint8_t *buffer, uint32_t len, int abort)
|
||||
{
|
||||
sb_dsp_t *dsp = (sb_dsp_t *) p;
|
||||
sb_dsp_t *dsp = (sb_dsp_t *) priv;
|
||||
|
||||
if (!dsp->uart_irq && !dsp->midi_in_poll && (dsp->mpu != NULL))
|
||||
return MPU401_InputSysex(dsp->mpu, buffer, len, abort);
|
||||
|
||||
@@ -196,7 +196,7 @@ sound_card_has_config(int card)
|
||||
return device_has_config(sound_cards[card].device) ? 1 : 0;
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
sound_card_get_internal_name(int card)
|
||||
{
|
||||
return device_get_internal_name(sound_cards[card].device);
|
||||
|
||||
Reference in New Issue
Block a user