summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/huc6230.h
diff options
context:
space:
mode:
author cam900 <dbtlrchl@naver.com>2018-08-24 10:47:41 +0900
committer R. Belmont <rb6502@users.noreply.github.com>2018-08-23 21:47:41 -0400
commit3204234f8d7edce4a3373be3895d6852f3480ff8 (patch)
tree53d7e681f530a10a906cec33a68d48fffa11ebbe /src/devices/sound/huc6230.h
parenta6e60706169401c038eb97e5bac54665f29335d9 (diff)
Add huc6230 Emulation (#3829)
* Add huc6230 Emulation huc6272.cpp : Add ADPCM transfer, Add save states PC-FXGA for PC-9801 C Bus is released in December 1995 in Japan, Correct metadata * huc6272.cpp : Fix ADPCM address * huc6230.cpp : Simpler interpolate * huc6230.cpp : Fix clamp huc6272.cpp : Fix ADPCM nibble * huc6272.cpp : Fix data type * Revert pcfxga year; PC-FXGA for PC9801 C-bus is not dumped?
Diffstat (limited to 'src/devices/sound/huc6230.h')
-rw-r--r--src/devices/sound/huc6230.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/devices/sound/huc6230.h b/src/devices/sound/huc6230.h
new file mode 100644
index 00000000000..632dbee80de
--- /dev/null
+++ b/src/devices/sound/huc6230.h
@@ -0,0 +1,56 @@
+// license:BSD-3-Clause
+// copyright-holders:cam900
+#ifndef MAME_SOUND_HUC6230_H
+#define MAME_SOUND_HUC6230_H
+
+#pragma once
+
+#include "sound/okiadpcm.h"
+#include "sound/c6280.h"
+
+class huc6230_device : public device_t, public device_sound_interface
+{
+public:
+ huc6230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ template <unsigned N> auto adpcm_update_cb() { return m_adpcm_update_cb[N].bind(); }
+
+ // write only
+ DECLARE_WRITE8_MEMBER( write );
+
+protected:
+ // device-level overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual void device_start() override;
+ virtual void device_clock_changed() override;
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
+
+private:
+ struct adpcm_channel {
+ oki_adpcm_state m_adpcm;
+ uint8_t m_lvol;
+ uint8_t m_rvol;
+ uint8_t m_interpolate;
+ uint8_t m_playing;
+ int32_t m_prev_sample;
+ int32_t m_curr_sample;
+ uint32_t m_pos;
+ uint8_t m_input;
+ };
+
+ // internal state
+ sound_stream *m_stream;
+ required_device<c6280_device> m_psg;
+ adpcm_channel m_adpcm_channel[2];
+ uint32_t m_adpcm_freq;
+ uint32_t m_cdda_lvol;
+ uint32_t m_cdda_rvol;
+
+ devcb_read8 m_adpcm_update_cb[2];
+};
+
+DECLARE_DEVICE_TYPE(HuC6230, huc6230_device)
+
+#endif // MAME_SOUND_HUC6230_H