summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/ymf271.h
diff options
context:
space:
mode:
author cam900 <dbtlrchl@naver.com>2018-02-22 22:10:11 +0900
committer Vas Crabb <cuavas@users.noreply.github.com>2018-02-23 00:10:11 +1100
commit4457a26752fd95f79f27d8475a51033cd1a43822 (patch)
treea955e809275c90241c815c0c96c7ace73f37b2fc /src/devices/sound/ymf271.h
parent638f84f3db917f08a7e105f5d53e4b587b30efd8 (diff)
Allow YMF271 4 Channel Output, Move Imperfect_sound tags into ymf271.h (#3229)
* ymf271 : Allow 4 channel output, Add notes, Convert external memory handler to address space, Add notes, Move global imperfect_sound tags to device imperfect_features ms32, bnstars, seibuspi : Minor bankswitching cleanup, Add notes ms32 : Real mobo can output stereo sound (ex: http: //www.nicovideo.jp/watch/sm23743949) And mobo has a second stereo sound connector, Accurate this seibuspi : Single PCBs only output mono sound(sxx2e PCB : unverified), Accurate this * seibuspi : Fix unneeded * seibuspi.h : REAL remove unneeded * seibuspi.cpp : Remove duplicates * seibuspi.h : Minor cleanup
Diffstat (limited to 'src/devices/sound/ymf271.h')
-rw-r--r--src/devices/sound/ymf271.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/devices/sound/ymf271.h b/src/devices/sound/ymf271.h
index a93df6fcdcb..f49b08cec2d 100644
--- a/src/devices/sound/ymf271.h
+++ b/src/devices/sound/ymf271.h
@@ -9,21 +9,15 @@
#define MCFG_YMF271_IRQ_HANDLER(_devcb) \
devcb = &ymf271_device::set_irq_handler(*device, DEVCB_##_devcb);
-#define MCFG_YMF271_EXT_READ_HANDLER(_devcb) \
- devcb = &ymf271_device::set_ext_read_handler(*device, DEVCB_##_devcb);
-
-#define MCFG_YMF271_EXT_WRITE_HANDLER(_devcb) \
- devcb = &ymf271_device::set_ext_write_handler(*device, DEVCB_##_devcb);
-
-class ymf271_device : public device_t, public device_sound_interface
+class ymf271_device : public device_t, public device_sound_interface, public device_rom_interface
{
public:
+ static constexpr feature_type imperfect_features() { return feature::SOUND; }
+
ymf271_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// static configuration helpers
template <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb) { return downcast<ymf271_device &>(device).m_irq_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ext_read_handler(device_t &device, Object &&cb) { return downcast<ymf271_device &>(device).m_ext_read_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_ext_write_handler(device_t &device, Object &&cb) { return downcast<ymf271_device &>(device).m_ext_write_handler.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -38,6 +32,9 @@ protected:
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
+ // device_rom_interface overrides
+ virtual void rom_bank_updated() override;
+
private:
struct YMF271Slot
{
@@ -113,7 +110,6 @@ private:
void ymf271_write_fm(int bank, uint8_t address, uint8_t data);
void ymf271_write_pcm(uint8_t address, uint8_t data);
void ymf271_write_timer(uint8_t address, uint8_t data);
- uint8_t ymf271_read_memory(uint32_t offset);
inline int get_keyscaled_rate(int rate, int keycode, int keyscale);
inline int get_internal_keycode(int block, int fns);
@@ -149,17 +145,14 @@ private:
uint8_t m_ext_rw;
uint8_t m_ext_readlatch;
- optional_region_ptr<uint8_t> m_mem_base;
- uint32_t m_mem_size;
+ uint32_t m_master_clock;
emu_timer *m_timA;
emu_timer *m_timB;
sound_stream *m_stream;
- std::unique_ptr<int32_t[]> m_mix_buffer;
+ std::vector<int32_t> m_mix_buffer;
devcb_write_line m_irq_handler;
- devcb_read8 m_ext_read_handler;
- devcb_write8 m_ext_write_handler;
};
DECLARE_DEVICE_TYPE(YMF271, ymf271_device)