aboutsummaryrefslogtreecommitdiff
path: root/libopna/opnaadpcm.h
diff options
context:
space:
mode:
Diffstat (limited to 'libopna/opnaadpcm.h')
-rw-r--r--libopna/opnaadpcm.h43
1 files changed, 43 insertions, 0 deletions
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 <stdint.h>
+#include <stdbool.h>
+
+#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