From 6fd10cdacb5cbe47a4fc339c20a733d4a9a384a1 Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Sat, 26 Nov 2016 20:57:57 +0900 Subject: initial --- libopna/opnaadpcm.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 libopna/opnaadpcm.h (limited to 'libopna/opnaadpcm.h') diff --git a/libopna/opnaadpcm.h b/libopna/opnaadpcm.h new file mode 100644 index 0000000..27a1349 --- /dev/null +++ b/libopna/opnaadpcm.h @@ -0,0 +1,43 @@ +#ifndef LIBOPNA_OPNAADPCM_H_INCLUDED +#define LIBOPNA_OPNAADPCM_H_INCLUDED + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct opna_adpcm { + uint8_t control1; + uint8_t control2; + uint8_t vol; + uint16_t delta; + uint16_t start; + uint16_t end; + uint16_t limit; + uint32_t ramptr; + uint16_t step; + uint8_t *ram; + int16_t acc; + int16_t prev_acc; + uint16_t adpcmd; + int16_t out; +}; + +void opna_adpcm_reset(struct opna_adpcm *adpcm); +void opna_adpcm_mix(struct opna_adpcm *adpcm, int16_t *buf, unsigned samples); +void opna_adpcm_writereg(struct opna_adpcm *adpcm, unsigned reg, unsigned val); + +enum { + OPNA_ADPCM_RAM_SIZE = (1<<18) +}; + +void opna_adpcm_set_ram_256k(struct opna_adpcm *adpcm, void *ram); +void *opna_adpcm_get_ram(struct opna_adpcm *adpcm); + +#ifdef __cplusplus +} +#endif + +#endif // LIBOPNA_OPNAADPCM_H_INCLUDED -- cgit v1.2.3