summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-04-09 01:13:51 -0400
committer AJR <ajrhacker@users.noreply.github.com>2018-04-09 01:13:51 -0400
commit67139e021ba20b9dde829096a02837b490468473 (patch)
tree0baf99cd3b1802e3c791b59c4aa94fc6a4a38d40
parent1f6c67fc851e73990ed6bf29057c691fb75a4401 (diff)
sindbadm: Acknowledge sound interrupt the 8255 Mode 2 way (nw)
-rw-r--r--src/mame/drivers/segag80r.cpp22
-rw-r--r--src/mame/includes/segag80r.h8
2 files changed, 14 insertions, 16 deletions
diff --git a/src/mame/drivers/segag80r.cpp b/src/mame/drivers/segag80r.cpp
index c6111903b3c..cf0a6de25ec 100644
--- a/src/mame/drivers/segag80r.cpp
+++ b/src/mame/drivers/segag80r.cpp
@@ -111,9 +111,6 @@
#include "machine/segag80.h"
#include "cpu/z80/z80.h"
-#include "sound/sn76496.h"
-#include "sound/samples.h"
-#include "machine/i8255.h"
#include "machine/segacrpt_device.h"
#include "speaker.h"
@@ -299,17 +296,21 @@ WRITE8_MEMBER(segag80r_state::coin_count_w)
*
*************************************/
-WRITE8_MEMBER(segag80r_state::sindbadm_soundport_w)
+READ8_MEMBER(segag80r_state::sindbadm_sound_data_r)
{
- m_soundlatch->write(space, 0, data);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
+ uint8_t result = m_ppi->pa_r();
+ if (!machine().side_effects_disabled())
+ {
+ m_ppi->pc6_w(0);
+ m_ppi->pc6_w(1);
+ }
+ return result;
}
-
WRITE8_MEMBER(segag80r_state::sindbadm_misc_w)
{
machine().bookkeeping().coin_counter_w(0, data & 0x02);
+ m_audiocpu->set_input_line(INPUT_LINE_NMI, BIT(data, 7) ? CLEAR_LINE : ASSERT_LINE);
// osd_printf_debug("Unknown = %02X\n", data);
}
@@ -400,7 +401,7 @@ void segag80r_state::sindbadm_sound_map(address_map &map)
map(0x8000, 0x87ff).mirror(0x1800).ram();
map(0xa000, 0xa003).mirror(0x1ffc).w(this, FUNC(segag80r_state::sindbadm_sn1_SN76496_w));
map(0xc000, 0xc003).mirror(0x1ffc).w(this, FUNC(segag80r_state::sindbadm_sn2_SN76496_w));
- map(0xe000, 0xe000).mirror(0x1fff).r(m_soundlatch, FUNC(generic_latch_8_device::read));
+ map(0xe000, 0xe000).mirror(0x1fff).r(this, FUNC(segag80r_state::sindbadm_sound_data_r));
}
@@ -956,7 +957,6 @@ MACHINE_CONFIG_START(segag80r_state::sindbadm)
MCFG_SEGACRPT_SET_DECRYPTED_TAG(":decrypted_opcodes")
MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(WRITE8(segag80r_state, sindbadm_soundport_w))
MCFG_I8255_IN_PORTB_CB(IOPORT("FC"))
MCFG_I8255_OUT_PORTC_CB(WRITE8(segag80r_state, sindbadm_misc_w))
@@ -971,8 +971,6 @@ MACHINE_CONFIG_START(segag80r_state::sindbadm)
MCFG_CPU_PROGRAM_MAP(sindbadm_sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(segag80r_state, irq0_line_hold, 4*60)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
-
/* sound hardware */
MCFG_SOUND_ADD("sn1", SN76496, SINDBADM_SOUND_CLOCK/2) /* matches PCB videos, correct? */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
diff --git a/src/mame/includes/segag80r.h b/src/mame/includes/segag80r.h
index 67b387257f5..d8d4349a7d5 100644
--- a/src/mame/includes/segag80r.h
+++ b/src/mame/includes/segag80r.h
@@ -14,7 +14,7 @@
#include "machine/segag80.h"
#include "sound/sn76496.h"
#include "audio/segasnd.h"
-#include "machine/gen_latch.h"
+#include "machine/i8255.h"
#include "screen.h"
@@ -43,7 +43,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
- m_soundlatch(*this, "soundlatch"),
+ m_ppi(*this, "ppi8255"),
m_decrypted_opcodes(*this, "decrypted_opcodes") { }
required_shared_ptr<uint8_t> m_mainram;
@@ -60,7 +60,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
- optional_device<generic_latch_8_device> m_soundlatch;
+ optional_device<i8255_device> m_ppi;
optional_shared_ptr<uint8_t> m_decrypted_opcodes;
std::vector<uint8_t> m_paletteram;
@@ -125,7 +125,7 @@ public:
DECLARE_READ8_MEMBER(n7751_command_r);
DECLARE_INPUT_CHANGED_MEMBER(service_switch);
DECLARE_WRITE8_MEMBER(usb_ram_w);
- DECLARE_WRITE8_MEMBER(sindbadm_soundport_w);
+ DECLARE_READ8_MEMBER(sindbadm_sound_data_r);
DECLARE_WRITE8_MEMBER(sindbadm_misc_w);
DECLARE_WRITE8_MEMBER(sindbadm_sn1_SN76496_w);
DECLARE_WRITE8_MEMBER(sindbadm_sn2_SN76496_w);