summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/audio/bally.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/audio/bally.cpp')
-rw-r--r--src/mame/audio/bally.cpp80
1 files changed, 59 insertions, 21 deletions
diff --git a/src/mame/audio/bally.cpp b/src/mame/audio/bally.cpp
index 3b712c9b678..23506f47b53 100644
--- a/src/mame/audio/bally.cpp
+++ b/src/mame/audio/bally.cpp
@@ -89,7 +89,8 @@ DISCRETE_SOUND_END
//-------------------------------------------------
// sound_select - handle an external write to the board
//-------------------------------------------------
-WRITE8_MEMBER(bally_as2888_device::sound_select)
+
+void bally_as2888_device::sound_select(uint8_t data)
{
machine().scheduler().synchronize(timer_expired_delegate(FUNC(bally_as2888_device::sound_select_sync), this), data);
}
@@ -103,6 +104,7 @@ TIMER_CALLBACK_MEMBER(bally_as2888_device::sound_select_sync)
//-------------------------------------------------
// sound_int - handle an external sound interrupt to the board
//-------------------------------------------------
+
WRITE_LINE_MEMBER(bally_as2888_device::sound_int)
{
machine().scheduler().synchronize(timer_expired_delegate(FUNC(bally_as2888_device::sound_int_sync), this), state);
@@ -120,6 +122,7 @@ TIMER_CALLBACK_MEMBER(bally_as2888_device::sound_int_sync)
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
+
void bally_as2888_device::device_add_mconfig(machine_config &config)
{
DISCRETE(config, m_discrete, as2888_discrete);
@@ -132,6 +135,7 @@ void bally_as2888_device::device_add_mconfig(machine_config &config)
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
+
void bally_as2888_device::device_start()
{
save_item(NAME(m_sound_select));
@@ -172,6 +176,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(bally_as2888_device::timer_as2888)
//--------------------------------------------------------------------------
// IO ports
//--------------------------------------------------------------------------
+
static INPUT_PORTS_START(as3022)
PORT_START("SW1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Sound Test") PORT_CHANGED_MEMBER(DEVICE_SELF, bally_as3022_device, sw1, 0)
@@ -191,7 +196,8 @@ INPUT_CHANGED_MEMBER(bally_as3022_device::sw1)
//-------------------------------------------------
// sound_select - handle an external write to the board
//-------------------------------------------------
-WRITE8_MEMBER(bally_as3022_device::sound_select)
+
+void bally_as3022_device::sound_select(uint8_t data)
{
machine().scheduler().synchronize(timer_expired_delegate(FUNC(bally_as3022_device::sound_select_sync), this), data);
}
@@ -205,6 +211,7 @@ TIMER_CALLBACK_MEMBER(bally_as3022_device::sound_select_sync)
//-------------------------------------------------
// sound_int - handle an external sound interrupt to the board
//-------------------------------------------------
+
WRITE_LINE_MEMBER(bally_as3022_device::sound_int)
{
machine().scheduler().synchronize(timer_expired_delegate(FUNC(bally_as3022_device::sound_int_sync), this), state);
@@ -218,6 +225,7 @@ TIMER_CALLBACK_MEMBER(bally_as3022_device::sound_int_sync)
//-------------------------------------------------
// pia_irq_w - IRQ line state changes
//-------------------------------------------------
+
WRITE_LINE_MEMBER(bally_as3022_device::pia_irq_w)
{
int combined_state = m_pia->irq_a_state() | m_pia->irq_b_state();
@@ -227,6 +235,7 @@ WRITE_LINE_MEMBER(bally_as3022_device::pia_irq_w)
//-------------------------------------------------
// CPU map, from schematics
//-------------------------------------------------
+
void bally_as3022_device::as3022_map(address_map &map)
{
map.unmap_value_high();
@@ -239,6 +248,7 @@ void bally_as3022_device::as3022_map(address_map &map)
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
+
void bally_as3022_device::device_add_mconfig(machine_config &config)
{
M6808(config, m_cpu, DERIVED_CLOCK(1, 1));
@@ -268,6 +278,7 @@ void bally_as3022_device::device_add_mconfig(machine_config &config)
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
+
void bally_as3022_device::device_start()
{
// Set volumes to a sane default.
@@ -284,7 +295,8 @@ void bally_as3022_device::device_start()
//-------------------------------------------------
// pia_porta_r - PIA port A reads
//-------------------------------------------------
-READ8_MEMBER(bally_as3022_device::pia_porta_r)
+
+uint8_t bally_as3022_device::pia_porta_r()
{
if (m_bc1 && !m_bdir)
{
@@ -301,7 +313,8 @@ READ8_MEMBER(bally_as3022_device::pia_porta_r)
//-------------------------------------------------
// pia_porta_w - PIA port A writes
//-------------------------------------------------
-WRITE8_MEMBER(bally_as3022_device::pia_porta_w)
+
+void bally_as3022_device::pia_porta_w(uint8_t data)
{
if (m_bc1 && !m_bdir)
{
@@ -314,7 +327,8 @@ WRITE8_MEMBER(bally_as3022_device::pia_porta_w)
//-------------------------------------------------
// pia_portb_w - PIA port B writes
//-------------------------------------------------
-WRITE8_MEMBER(bally_as3022_device::pia_portb_w)
+
+void bally_as3022_device::pia_portb_w(uint8_t data)
{
m_bc1 = BIT(data, 0);
m_bdir = BIT(data, 1);
@@ -328,6 +342,7 @@ WRITE8_MEMBER(bally_as3022_device::pia_portb_w)
//-------------------------------------------------
// pia_cb2_w - PIA CB2 writes
//-------------------------------------------------
+
WRITE_LINE_MEMBER(bally_as3022_device::pia_cb2_w)
{
// This pin is hooked up to the amp, and disables sounds when hi
@@ -348,7 +363,8 @@ WRITE_LINE_MEMBER(bally_as3022_device::pia_cb2_w)
//-------------------------------------------------
// ay_io_r - AY8912 IO A reads (B is unconnected)
//-------------------------------------------------
-READ8_MEMBER(bally_as3022_device::ay_io_r)
+
+uint8_t bally_as3022_device::ay_io_r()
{
// The two high bits are unconnected, the others are inverted.
return ~m_sound_select & 0x3f;
@@ -374,6 +390,7 @@ void bally_as3022_device::update_ay_bus()
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
+
void bally_sounds_plus_device::device_add_mconfig(machine_config &config)
{
bally_as3022_device::device_add_mconfig(config);
@@ -393,6 +410,7 @@ void bally_sounds_plus_device::device_add_mconfig(machine_config &config)
//-------------------------------------------------
// CPU map, from schematics
//-------------------------------------------------
+
void bally_sounds_plus_device::sounds_plus_map(address_map &map)
{
map.unmap_value_high();
@@ -404,13 +422,14 @@ void bally_sounds_plus_device::sounds_plus_map(address_map &map)
//-------------------------------------------------
// pia_portb_w - PIA port B writes
//-------------------------------------------------
-WRITE8_MEMBER(bally_sounds_plus_device::vocalizer_pia_portb_w)
+
+void bally_sounds_plus_device::vocalizer_pia_portb_w(uint8_t data)
{
bool speech_clock = BIT(data, 6);
bool speech_data = BIT(data, 7);
m_mc3417->clock_w(speech_clock ? 1 : 0);
m_mc3417->digit_w(speech_data ? 1 : 0);
- pia_portb_w(space, offset, data);
+ pia_portb_w(data);
}
@@ -440,7 +459,8 @@ INPUT_CHANGED_MEMBER(bally_cheap_squeak_device::sw1)
//-------------------------------------------------
// sound_select - handle an external write to the board
//-------------------------------------------------
-WRITE8_MEMBER(bally_cheap_squeak_device::sound_select)
+
+void bally_cheap_squeak_device::sound_select(uint8_t data)
{
machine().scheduler().synchronize(timer_expired_delegate(FUNC(bally_cheap_squeak_device::sound_select_sync), this), data);
}
@@ -468,6 +488,7 @@ TIMER_CALLBACK_MEMBER(bally_cheap_squeak_device::sound_int_sync)
//-------------------------------------------------
// CPU map, from schematics
//-------------------------------------------------
+
void bally_cheap_squeak_device::cheap_squeak_map(address_map &map)
{
map.unmap_value_high();
@@ -479,6 +500,7 @@ void bally_cheap_squeak_device::cheap_squeak_map(address_map &map)
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
+
void bally_cheap_squeak_device::device_add_mconfig(machine_config &config)
{
M6803(config, m_cpu, DERIVED_CLOCK(1, 1));
@@ -496,6 +518,7 @@ void bally_cheap_squeak_device::device_add_mconfig(machine_config &config)
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
+
void bally_cheap_squeak_device::device_start()
{
m_sound_ack_w_handler.resolve();
@@ -506,7 +529,8 @@ void bally_cheap_squeak_device::device_start()
//-------------------------------------------------
// out_p1_cb - IO port 1 write
//-------------------------------------------------
-WRITE8_MEMBER(bally_cheap_squeak_device::out_p1_cb)
+
+void bally_cheap_squeak_device::out_p1_cb(uint8_t data)
{
m_dac->write(data);
}
@@ -514,16 +538,18 @@ WRITE8_MEMBER(bally_cheap_squeak_device::out_p1_cb)
//-------------------------------------------------
// in_p2_cb - IO port 2 read
//-------------------------------------------------
-READ8_MEMBER(bally_cheap_squeak_device::in_p2_cb)
+
+uint8_t bally_cheap_squeak_device::in_p2_cb()
{
- int sound_int_bit = m_sound_int ? 1 : 0;
- return 0x40 | (m_sound_select & 0x0f) << 1 | sound_int_bit;
+ int sound_int_bit = m_sound_int ? 1 : 0;
+ return 0x40 | (m_sound_select & 0x0f) << 1 | sound_int_bit;
}
//-------------------------------------------------
// out_p2_cb - IO port 2 write
//-------------------------------------------------
-WRITE8_MEMBER(bally_cheap_squeak_device::out_p2_cb)
+
+void bally_cheap_squeak_device::out_p2_cb(uint8_t data)
{
m_sound_ack = BIT(data, 0);
if (!m_sound_ack_w_handler.isnull())
@@ -567,7 +593,8 @@ INPUT_CHANGED_MEMBER(bally_squawk_n_talk_device::sw1)
//-------------------------------------------------
// sound_select - handle an external write to the board
//-------------------------------------------------
-WRITE8_MEMBER(bally_squawk_n_talk_device::sound_select)
+
+void bally_squawk_n_talk_device::sound_select(uint8_t data)
{
machine().scheduler().synchronize(timer_expired_delegate(FUNC(bally_squawk_n_talk_device::sound_select_sync), this), data);
}
@@ -580,6 +607,7 @@ TIMER_CALLBACK_MEMBER(bally_squawk_n_talk_device::sound_select_sync)
//-------------------------------------------------
// sound_int - handle an external sound interrupt to the board
//-------------------------------------------------
+
WRITE_LINE_MEMBER(bally_squawk_n_talk_device::sound_int)
{
machine().scheduler().synchronize(timer_expired_delegate(FUNC(bally_squawk_n_talk_device::sound_int_sync), this), state);
@@ -594,6 +622,7 @@ TIMER_CALLBACK_MEMBER(bally_squawk_n_talk_device::sound_int_sync)
//-------------------------------------------------
// CPU map, from schematics
//-------------------------------------------------
+
void bally_squawk_n_talk_device::squawk_n_talk_map(address_map &map)
{
map.unmap_value_high();
@@ -609,6 +638,7 @@ void bally_squawk_n_talk_device::squawk_n_talk_map(address_map &map)
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
+
void bally_squawk_n_talk_device::device_add_mconfig(machine_config &config)
{
M6802(config, m_cpu, DERIVED_CLOCK(1, 1)); // could also be jumpered to use a 6808
@@ -648,6 +678,7 @@ void bally_squawk_n_talk_device::device_add_mconfig(machine_config &config)
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
+
void bally_squawk_n_talk_device::device_start()
{
save_item(NAME(m_sound_select));
@@ -656,7 +687,8 @@ void bally_squawk_n_talk_device::device_start()
//-------------------------------------------------
// pia1_portb_w - PIA 1 port B write
//-------------------------------------------------
-WRITE8_MEMBER(bally_squawk_n_talk_device::pia1_portb_w)
+
+void bally_squawk_n_talk_device::pia1_portb_w(uint8_t data)
{
m_tms5200->rsq_w(BIT(data, 0));
m_tms5200->wsq_w(BIT(data, 1));
@@ -665,7 +697,8 @@ WRITE8_MEMBER(bally_squawk_n_talk_device::pia1_portb_w)
//-------------------------------------------------
// pia2_porta_r - PIA 2 port A reads
//-------------------------------------------------
-READ8_MEMBER(bally_squawk_n_talk_device::pia2_porta_r)
+
+uint8_t bally_squawk_n_talk_device::pia2_porta_r()
{
// 5 lines and they go through inverters
return ~m_sound_select & 0x1f;
@@ -674,6 +707,7 @@ READ8_MEMBER(bally_squawk_n_talk_device::pia2_porta_r)
//-------------------------------------------------
// pia2_ca2_w - PIA 2 CA2 writes
//-------------------------------------------------
+
WRITE_LINE_MEMBER(bally_squawk_n_talk_device::pia2_ca2_w)
{
machine().output().set_value("sound_led0", state);
@@ -729,7 +763,8 @@ void bally_squawk_n_talk_ay_device::device_start()
//-------------------------------------------------
// pia2_porta_r - PIA 2 port A reads
//-------------------------------------------------
-READ8_MEMBER(bally_squawk_n_talk_ay_device::pia2_porta_r)
+
+uint8_t bally_squawk_n_talk_ay_device::pia2_porta_r()
{
if (m_bc1 && !m_bdir)
{
@@ -743,7 +778,8 @@ READ8_MEMBER(bally_squawk_n_talk_ay_device::pia2_porta_r)
//-------------------------------------------------
// pia2_porta_w - PIA 2 port A writes
//-------------------------------------------------
-WRITE8_MEMBER(bally_squawk_n_talk_ay_device::pia2_porta_w)
+
+void bally_squawk_n_talk_ay_device::pia2_porta_w(uint8_t data)
{
if (m_bc1 && !m_bdir)
{
@@ -756,7 +792,8 @@ WRITE8_MEMBER(bally_squawk_n_talk_ay_device::pia2_porta_w)
//-------------------------------------------------
// pia2_portb_w - PIA 2 port B writes
//-------------------------------------------------
-WRITE8_MEMBER(bally_squawk_n_talk_ay_device::pia2_portb_w)
+
+void bally_squawk_n_talk_ay_device::pia2_portb_w(uint8_t data)
{
m_bc1 = BIT(data, 0);
m_bdir = BIT(data, 1);
@@ -790,7 +827,8 @@ WRITE_LINE_MEMBER(bally_squawk_n_talk_ay_device::pia2_cb2_w)
//-------------------------------------------------
// ay_io_r - AY8910 read
//-------------------------------------------------
-READ8_MEMBER(bally_squawk_n_talk_ay_device::ay_io_r)
+
+uint8_t bally_squawk_n_talk_ay_device::ay_io_r()
{
// 5 lines and they go through inverters
return ~m_sound_select & 0x1f;