From f774afc5387887f4ce8067502412f5f64899632f Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Thu, 23 Nov 2017 13:51:14 +0900 Subject: libopna: make levelmeter and oscillo conditional --- libopna/opnaadpcm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libopna/opnaadpcm.c') diff --git a/libopna/opnaadpcm.c b/libopna/opnaadpcm.c index 7825c40..4001dc1 100644 --- a/libopna/opnaadpcm.c +++ b/libopna/opnaadpcm.c @@ -35,7 +35,9 @@ void opna_adpcm_reset(struct opna_adpcm *adpcm) { adpcm->prev_acc = 0; adpcm->adpcmd = 127; adpcm->out = 0; +#ifdef LIBOPNA_ENABLE_LEVELDATA leveldata_init(&adpcm->leveldata); +#endif } static uint32_t addr_conv(const struct opna_adpcm *adpcm, uint16_t a) { @@ -184,7 +186,9 @@ void opna_adpcm_writereg(struct opna_adpcm *adpcm, unsigned reg, unsigned val) { void opna_adpcm_mix(struct opna_adpcm *adpcm, int16_t *buf, unsigned samples) { unsigned level = 0; if (!adpcm->ram || !(adpcm->control1 & C1_START)) { +#ifdef LIBOPNA_ENABLE_LEVELDATA leveldata_update(&adpcm->leveldata, level); +#endif return; } for (unsigned i = 0; i < samples; i++) { @@ -208,7 +212,9 @@ void opna_adpcm_mix(struct opna_adpcm *adpcm, int16_t *buf, unsigned samples) { } if (!(adpcm->control1 & C1_START)) return; } +#ifdef LIBOPNA_ENABLE_LEVELDATA leveldata_update(&adpcm->leveldata, level); +#endif } void opna_adpcm_set_ram_256k(struct opna_adpcm *adpcm, void *ram) { -- cgit v1.2.3