Don't depend on DEV_BRANCH

Allows things to be compiled independently
This commit is contained in:
Jasmine Iwanek
2024-08-08 20:25:03 -04:00
parent 3cd59235c9
commit 892f066ffa
19 changed files with 163 additions and 163 deletions

View File

@@ -76,19 +76,19 @@ static const MIDI_OUT_DEVICE devices[] = {
{ &device_none },
#ifdef USE_FLUIDSYNTH
{ &fluidsynth_device },
#endif
#endif /* USE_FLUIDSYNTH */
#ifdef USE_MUNT
{ &mt32_old_device },
{ &mt32_new_device },
{ &cm32l_device },
{ &cm32ln_device },
#endif
#endif /*USE_MUNT */
#ifdef USE_RTMIDI
{ &rtmidi_output_device },
#endif
#if defined(DEV_BRANCH) && defined(USE_OPL4ML)
#endif /* USE_RTMIDI */
#ifdef USE_OPL4ML
{ &opl4_midi_device },
#endif
#endif /* USE_OPL4ML */
{ NULL }
// clang-format on
};
@@ -98,7 +98,7 @@ static const MIDI_IN_DEVICE midi_in_devices[] = {
{ &device_none },
#ifdef USE_RTMIDI
{ &rtmidi_input_device },
#endif
#endif /* USE_RTMIDI */
{ NULL }
// clang-format on
};

View File

@@ -16,9 +16,9 @@
#include <86box/pic.h>
#include <86box/sound.h>
#include <86box/timer.h>
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
# include <86box/snd_ad1848.h>
#endif
#endif /*USE_GUSMAX */
#include <86box/plat_fallthrough.h>
#include <86box/plat_unused.h>
@@ -144,11 +144,11 @@ typedef struct gus_t {
uint8_t usrr;
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
uint8_t max_ctrl;
ad1848_t ad1848;
#endif
#endif /*USE_GUSMAX */
} gus_t;
static int gus_gf1_irqs[8] = { -1, 2, 5, 3, 7, 11, 12, 15 };
@@ -256,9 +256,9 @@ writegus(uint16_t addr, uint8_t val, void *priv)
int d;
int old;
uint16_t port;
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
uint16_t csioport;
#endif
#endif /*USE_GUSMAX */
if ((addr == 0x388) || (addr == 0x389))
port = addr;
@@ -606,10 +606,10 @@ writegus(uint16_t addr, uint8_t val, void *priv)
gus->irq_midi = gus->irq;
} else
gus->irq_midi = gus_midi_irqs[(val >> 3) & 7];
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
if (gus->type == GUS_MAX)
ad1848_setirq(&gus->ad1848, gus->irq);
#endif
#endif /*USE_GUSMAX */
gus->sb_nmi = val & 0x80;
} else {
@@ -622,10 +622,10 @@ writegus(uint16_t addr, uint8_t val, void *priv)
gus->dma2 = gus->dma;
} else
gus->dma2 = gus_dmas[(val >> 3) & 7];
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
if (gus->type == GUS_MAX)
ad1848_setdma(&gus->ad1848, gus->dma2);
#endif
#endif /*USE_GUSMAX */
}
break;
case 1:
@@ -683,7 +683,7 @@ writegus(uint16_t addr, uint8_t val, void *priv)
break;
case 0x306:
case 0x706:
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
if (gus->type == GUS_MAX) {
if (gus->dma >= 4)
val |= 0x10;
@@ -703,7 +703,7 @@ writegus(uint16_t addr, uint8_t val, void *priv)
}
}
}
#endif
#endif /*USE_GUSMAX */
break;
default:
@@ -755,11 +755,11 @@ readgus(uint16_t addr, void *priv)
return val;
case 0x20F:
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
if (gus->type == GUS_MAX)
val = 0x02;
else
#endif
#endif /*USE_GUSMAX */
val = 0x00;
break;
@@ -878,11 +878,11 @@ readgus(uint16_t addr, void *priv)
break;
case 0x306:
case 0x706:
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
if (gus->type == GUS_MAX)
val = 0x0a; /* GUS MAX */
else
#endif
#endif /*USE_GUSMAX */
val = 0xff; /*Pre 3.7 - no mixer*/
break;
@@ -939,7 +939,7 @@ readgus(uint16_t addr, void *priv)
gus->ad_status &= ~0x01;
#ifdef OLD_NMI_BEHAVIOR
nmi = 0;
#endif
#endif /* OLD_NMI_BEHAVIOR */
fallthrough;
case 0x389:
val = gus->ad_data;
@@ -1182,24 +1182,24 @@ gus_get_buffer(int32_t *buffer, int len, void *priv)
{
gus_t *gus = (gus_t *) priv;
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
if ((gus->type == GUS_MAX) && (gus->max_ctrl))
ad1848_update(&gus->ad1848);
#endif
#endif /*USE_GUSMAX */
gus_update(gus);
for (int c = 0; c < len * 2; c++) {
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
if ((gus->type == GUS_MAX) && (gus->max_ctrl))
buffer[c] += (int32_t) (gus->ad1848.buffer[c] / 2);
#endif
#endif /*USE_GUSMAX */
buffer[c] += (int32_t) gus->buffer[c & 1][c >> 1];
}
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
if ((gus->type == GUS_MAX) && (gus->max_ctrl))
gus->ad1848.pos = 0;
#endif
#endif /*USE_GUSMAX */
gus->pos = 0;
}
@@ -1332,9 +1332,9 @@ gus_reset(void *priv)
gus->usrr = 0;
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
gus->max_ctrl = 0;
#endif
#endif /*USE_GUSMAX */
gus->irq_state = 0;
gus->midi_irq_state = 0;
@@ -1383,7 +1383,7 @@ gus_init(UNUSED(const device_t *info))
io_sethandler(0x0506 + gus->base, 0x0001, readgus, NULL, NULL, writegus, NULL, NULL, gus);
io_sethandler(0x0388, 0x0002, readgus, NULL, NULL, writegus, NULL, NULL, gus);
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
if (gus->type == GUS_MAX) {
ad1848_init(&gus->ad1848, AD1848_TYPE_CS4231);
ad1848_setirq(&gus->ad1848, 5);
@@ -1391,7 +1391,7 @@ gus_init(UNUSED(const device_t *info))
io_sethandler(0x10C + gus->base, 4,
ad1848_read, NULL, NULL, ad1848_write, NULL, NULL, &gus->ad1848);
}
#endif
#endif /*USE_GUSMAX */
timer_add(&gus->samp_timer, gus_poll_wave, gus, 1);
timer_add(&gus->timer_1, gus_poll_timer_1, gus, 1);
@@ -1424,10 +1424,10 @@ gus_speed_changed(void *priv)
else
gus->samp_latch = (uint64_t) (TIMER_USEC * (1000000.0 / gusfreqs[gus->voices - 14]));
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
if ((gus->type == GUS_MAX) && (gus->max_ctrl))
ad1848_speed_changed(&gus->ad1848);
#endif
#endif /*USE_GUSMAX */
}
static const device_config_t gus_config[] = {
@@ -1445,12 +1445,12 @@ static const device_config_t gus_config[] = {
.description = "Classic",
.value = GUS_CLASSIC
},
#if defined(DEV_BRANCH) && defined(USE_GUSMAX)
#ifdef USE_GUSMAX
{
.description = "MAX",
.value = GUS_MAX
},
#endif
#endif /*USE_GUSMAX */
{ NULL }
},
},