diff rf5c164.h @ 2082:485834c0fea7

Forgot to add PCM source files
author Michael Pavone <pavone@retrodev.com>
date Thu, 03 Feb 2022 23:41:40 -0800
parents
children 62a53c052d9b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rf5c164.h	Thu Feb 03 23:41:40 2022 -0800
@@ -0,0 +1,36 @@
+#ifndef RF5C164_H_
+#define RF5C164_H_
+#include <stdint.h>
+#include "render_audio.h"
+
+typedef struct {
+	uint32_t cur_ptr;
+	uint8_t  regs[7];
+	uint8_t  sample;
+	uint8_t  state;
+} rf5c164_channel;
+
+typedef struct {
+	audio_source    *audio;
+	uint32_t        cycle;
+	uint32_t        clock_step;
+	uint16_t        ram[64*1024];
+	uint16_t        ram_bank;
+	uint16_t        pending_address;
+	int16_t         left;
+	int16_t         right;
+	rf5c164_channel channels[8];
+	uint8_t         pending_byte;
+	uint8_t         channel_enable;
+	uint8_t         selected_channel;
+	uint8_t         cur_channel;
+	uint8_t         step;
+	uint8_t         flags;
+} rf5c164;
+
+void rf5c164_init(rf5c164* pcm, uint32_t mclks, uint32_t divider);
+void rf5c164_run(rf5c164* pcm, uint32_t cycle);
+void rf5c164_write(rf5c164* pcm, uint16_t address, uint8_t value);
+uint8_t rf5c164_read(rf5c164* pcm, uint16_t address);
+
+#endif //RF5C164_H_