ay8910: Add a write handler for the case of bc1=a0 and bc2=a1

This commit is contained in:
Dirk Best 2017-03-05 18:06:18 +01:00
parent 18d4f730cf
commit 9763b2928a
2 changed files with 23 additions and 2 deletions

View File

@ -1119,6 +1119,24 @@ WRITE8_MEMBER( ay8910_device::data_w )
#endif #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 ) WRITE8_MEMBER( ay8910_device::reset_w )
{ {
ay8910_reset_ym(); ay8910_reset_ym();

View File

@ -1,4 +1,4 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:Couriersud // copyright-holders:Couriersud
#pragma once #pragma once
@ -126,6 +126,9 @@ public:
/* use this when BC1 == !A0; here, BC1=0 selects 'latch address' and BC1=1 selects 'data' */ /* use this when BC1 == !A0; here, BC1=0 selects 'latch address' and BC1=1 selects 'data' */
DECLARE_WRITE8_MEMBER( address_data_w ); DECLARE_WRITE8_MEMBER( address_data_w );
// bc1=a0, bc2=a1
virtual DECLARE_WRITE8_MEMBER(write);
void set_volume(int channel,int volume); void set_volume(int channel,int volume);
void ay_set_clock(int clock); void ay_set_clock(int clock);
@ -227,7 +230,7 @@ public:
/* AY8914 handlers needed due to different register map */ /* AY8914 handlers needed due to different register map */
DECLARE_READ8_MEMBER( read ); DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write ); virtual DECLARE_WRITE8_MEMBER( write ) override;
}; };
extern const device_type AY8914; extern const device_type AY8914;