summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2017-03-05 18:06:18 +0100
committer Dirk Best <mail@dirk-best.de>2017-03-05 18:09:49 +0100
commit9763b2928a9a294a1bb2b4cb0af1e7626b64ef22 (patch)
tree3793351813963e237fa05642536ee0a09509e726
parent18d4f730cff8f3647af7ab6ef66f6a493d9d7ec4 (diff)
ay8910: Add a write handler for the case of bc1=a0 and bc2=a1
-rw-r--r--src/devices/sound/ay8910.cpp18
-rw-r--r--src/devices/sound/ay8910.h7
2 files changed, 23 insertions, 2 deletions
diff --git a/src/devices/sound/ay8910.cpp b/src/devices/sound/ay8910.cpp
index a3979b70bf6..4da686b0cb4 100644
--- a/src/devices/sound/ay8910.cpp
+++ b/src/devices/sound/ay8910.cpp
@@ -1119,6 +1119,24 @@ WRITE8_MEMBER( ay8910_device::data_w )
#endif
}
+WRITE8_MEMBER( ay8910_device::write )
+{
+ switch (offset & 3)
+ {
+ case 0: // latch address
+ address_w(space, 0, data);
+ break;
+ case 1: // inactive
+ break;
+ case 2: // write to psg
+ data_w(space, 0, data);
+ break;
+ case 3: // latch address
+ address_w(space, 0, data);
+ break;
+ }
+}
+
WRITE8_MEMBER( ay8910_device::reset_w )
{
ay8910_reset_ym();
diff --git a/src/devices/sound/ay8910.h b/src/devices/sound/ay8910.h
index a46bef62ffc..bc970338385 100644
--- a/src/devices/sound/ay8910.h
+++ b/src/devices/sound/ay8910.h
@@ -1,4 +1,4 @@
-// license:BSD-3-Clause
+ // license:BSD-3-Clause
// copyright-holders:Couriersud
#pragma once
@@ -126,6 +126,9 @@ public:
/* use this when BC1 == !A0; here, BC1=0 selects 'latch address' and BC1=1 selects 'data' */
DECLARE_WRITE8_MEMBER( address_data_w );
+ // bc1=a0, bc2=a1
+ virtual DECLARE_WRITE8_MEMBER(write);
+
void set_volume(int channel,int volume);
void ay_set_clock(int clock);
@@ -227,7 +230,7 @@ public:
/* AY8914 handlers needed due to different register map */
DECLARE_READ8_MEMBER( read );
- DECLARE_WRITE8_MEMBER( write );
+ virtual DECLARE_WRITE8_MEMBER( write ) override;
};
extern const device_type AY8914;