From 6fd10cdacb5cbe47a4fc339c20a733d4a9a384a1 Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Sat, 26 Nov 2016 20:57:57 +0900 Subject: initial --- libopna/s98gen.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 libopna/s98gen.h (limited to 'libopna/s98gen.h') diff --git a/libopna/s98gen.h b/libopna/s98gen.h new file mode 100644 index 0000000..8fa458d --- /dev/null +++ b/libopna/s98gen.h @@ -0,0 +1,34 @@ +#ifndef MYON_S98GEN_H_INCLUDED +#define MYON_S98GEN_H_INCLUDED + +#include +#include +#include +#include "opna.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct s98gen { + struct opna opna; + uint8_t *s98data; + size_t s98data_size; + size_t current_offset; + uint32_t opnaclock; + uint32_t samples_to_generate; + uint16_t samples_to_generate_frac; + uint32_t timer_numerator; + uint32_t timer_denominator; +}; + +// returns true if initialization succeeded +// returns false without touching *s98 when initialization failed (invalid data) +bool s98gen_init(struct s98gen *s98, void *s98data, size_t s98data_size); +bool s98gen_generate(struct s98gen *s98, int16_t *buf, size_t samples); + +#ifdef __cplusplus +} +#endif + +#endif // MYON_S98GEN_H_INCLUDED -- cgit v1.2.3