summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatarGravatar smf- <smf-@users.noreply.github.com>2014-01-10 23:24:45 +0000
committerGravatarGravatar smf- <smf-@users.noreply.github.com>2014-01-10 23:24:45 +0000
commit8dc57a3427791c9e6d76f2020a6c4af8c94568f0 (patch)
tree8527ffce968d2a4d1aca30aca16a08ff2d218906 /src
parentf9047310cc79ced2583621ac271aedc7f991cd40 (diff)
Added write_sense to S2650 CPU and use it for pipbug serial port, Hunchback (Galaxian Hardware) and replace calls to set_input_line(1 in lazercmd.c & meadows.c [smf]
Diffstat (limited to 'src')
-rw-r--r--src/emu/cpu/s2650/s2650.c19
-rw-r--r--src/emu/cpu/s2650/s2650.h4
-rw-r--r--src/mame/drivers/galaxold.c8
-rw-r--r--src/mame/drivers/lazercmd.c4
-rw-r--r--src/mame/drivers/meadows.c8
-rw-r--r--src/mame/includes/galaxold.h1
-rw-r--r--src/mame/includes/lazercmd.h3
-rw-r--r--src/mame/includes/meadows.h10
-rw-r--r--src/mess/drivers/pipbug.c12
9 files changed, 34 insertions, 35 deletions
diff --git a/src/emu/cpu/s2650/s2650.c b/src/emu/cpu/s2650/s2650.c
index ecc1a6a0437..0d3325c8be2 100644
--- a/src/emu/cpu/s2650/s2650.c
+++ b/src/emu/cpu/s2650/s2650.c
@@ -17,6 +17,8 @@
#include "s2650.h"
#include "s2650cpu.h"
+#define S2650_SENSE_LINE INPUT_LINE_IRQ1
+
/* define this to have some interrupt information logged */
#define VERBOSE 0
@@ -913,16 +915,19 @@ void s2650_device::device_reset()
void s2650_device::execute_set_input(int irqline, int state)
{
- if (irqline == 1)
+ switch (irqline)
{
+ case INPUT_LINE_IRQ0:
+ m_irq_state = state;
+ break;
+
+ case S2650_SENSE_LINE:
if (state == CLEAR_LINE)
s2650_set_sense(0);
else
s2650_set_sense(1);
- return;
+ break;
}
-
- m_irq_state = state;
}
void s2650_device::s2650_set_flag(int state)
@@ -946,11 +951,9 @@ void s2650_device::s2650_set_sense(int state)
set_psu(m_psu & ~SI);
}
-int s2650_device::s2650_get_sense()
+WRITE_LINE_MEMBER(s2650_device::write_sense)
{
- /* OR'd with Input to allow for external connections */
-
- return (((m_psu & SI) ? 1 : 0) | ((m_io->read_byte(S2650_SENSE_PORT) & SI) ? 1 : 0));
+ set_input_line(S2650_SENSE_LINE, state);
}
void s2650_device::execute_run()
diff --git a/src/emu/cpu/s2650/s2650.h b/src/emu/cpu/s2650/s2650.h
index c9da52f3cc5..1ba21d8fcc5 100644
--- a/src/emu/cpu/s2650/s2650.h
+++ b/src/emu/cpu/s2650/s2650.h
@@ -31,6 +31,8 @@ public:
// construction/destruction
s2650_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ DECLARE_WRITE_LINE_MEMBER(write_sense);
+
protected:
// device-level overrides
virtual void device_start();
@@ -94,8 +96,6 @@ private:
void s2650_set_flag(int state);
int s2650_get_flag();
void s2650_set_sense(int state);
- int s2650_get_sense();
-
};
diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c
index 9e8d38728c0..917123bf138 100644
--- a/src/mame/drivers/galaxold.c
+++ b/src/mame/drivers/galaxold.c
@@ -873,12 +873,8 @@ static ADDRESS_MAP_START( hunchbkg, AS_PROGRAM, 8, galaxold_state )
AM_RANGE(0x6000, 0x6fff) AM_ROM
ADDRESS_MAP_END
-/* the nmi line seems to be inverted on the cpu plugin board */
-READ8_MEMBER(galaxold_state::ttl7474_trampoline){ device_t *device = machine().device("7474_9m_1"); return downcast<ttl7474_device *>(device)->output_comp_r(); }
-
static ADDRESS_MAP_START( hunchbkg_io, AS_IO, 8, galaxold_state )
AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READNOP // not used
- AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(ttl7474_trampoline)
ADDRESS_MAP_END
@@ -2597,6 +2593,10 @@ static MACHINE_CONFIG_DERIVED( hunchbkg, galaxold_base )
MCFG_CPU_PROGRAM_MAP(hunchbkg)
MCFG_CPU_IO_MAP(hunchbkg_io)
+ MCFG_DEVICE_MODIFY("7474_9m_1")
+ /* the nmi line seems to be inverted on the cpu plugin board */
+ MCFG_7474_COMP_OUTPUT_CB(DEVWRITELINE("maincpu", s2650_device, write_sense))
+
MCFG_MACHINE_RESET_OVERRIDE(galaxold_state,hunchbkg)
MCFG_FRAGMENT_ADD(galaxian_audio)
diff --git a/src/mame/drivers/lazercmd.c b/src/mame/drivers/lazercmd.c
index d0c001f1a63..1ab27a879cc 100644
--- a/src/mame/drivers/lazercmd.c
+++ b/src/mame/drivers/lazercmd.c
@@ -232,8 +232,6 @@
***************************************************************************/
#include "emu.h"
-#include "cpu/s2650/s2650.h"
-#include "sound/dac.h"
#include "includes/lazercmd.h"
// color overlays, bbonk does not have an overlay
@@ -259,7 +257,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(lazercmd_state::lazercmd_timer)
{
m_timer_count = 0;
m_sense_state ^= 1;
- m_maincpu->set_input_line(1, (m_sense_state) ? ASSERT_LINE : CLEAR_LINE);
+ m_maincpu->write_sense(m_sense_state ? ASSERT_LINE : CLEAR_LINE);
}
}
diff --git a/src/mame/drivers/meadows.c b/src/mame/drivers/meadows.c
index 9f894a043ad..6d29ebd6c83 100644
--- a/src/mame/drivers/meadows.c
+++ b/src/mame/drivers/meadows.c
@@ -116,11 +116,7 @@
***************************************************************************/
-#include "emu.h"
-#include "cpu/s2650/s2650.h"
#include "includes/meadows.h"
-#include "sound/dac.h"
-#include "sound/samples.h"
#include "deadeye.lh"
#include "gypsyjug.lh"
@@ -214,7 +210,7 @@ INTERRUPT_GEN_MEMBER(meadows_state::meadows_interrupt)
{
/* fake something toggling the sense input line of the S2650 */
m_main_sense_state ^= 1;
- device.execute().set_input_line(1, m_main_sense_state ? ASSERT_LINE : CLEAR_LINE);
+ m_maincpu->write_sense(m_main_sense_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -310,7 +306,7 @@ INTERRUPT_GEN_MEMBER(meadows_state::audio_interrupt)
{
/* fake something toggling the sense input line of the S2650 */
m_audio_sense_state ^= 1;
- device.execute().set_input_line(1, m_audio_sense_state ? ASSERT_LINE : CLEAR_LINE);
+ m_audiocpu->write_sense(m_audio_sense_state ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/mame/includes/galaxold.h b/src/mame/includes/galaxold.h
index 7143a3f12a8..28464999d3e 100644
--- a/src/mame/includes/galaxold.h
+++ b/src/mame/includes/galaxold.h
@@ -139,7 +139,6 @@ public:
DECLARE_CUSTOM_INPUT_MEMBER(vpool_lives_r);
DECLARE_CUSTOM_INPUT_MEMBER(ckongg_coinage_r);
DECLARE_CUSTOM_INPUT_MEMBER(dkongjrm_coinage_r);
- DECLARE_READ8_MEMBER(ttl7474_trampoline);
DECLARE_DRIVER_INIT(bullsdrtg);
DECLARE_DRIVER_INIT(ladybugg);
DECLARE_DRIVER_INIT(4in1);
diff --git a/src/mame/includes/lazercmd.h b/src/mame/includes/lazercmd.h
index 36224a8f96f..d64efbf0e56 100644
--- a/src/mame/includes/lazercmd.h
+++ b/src/mame/includes/lazercmd.h
@@ -1,3 +1,4 @@
+#include "cpu/s2650/s2650.h"
#include "sound/dac.h"
#define HORZ_RES 32
@@ -30,7 +31,7 @@ public:
{ }
/* device */
- required_device<cpu_device> m_maincpu;
+ required_device<s2650_device> m_maincpu;
required_device<dac_device> m_dac;
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
diff --git a/src/mame/includes/meadows.h b/src/mame/includes/meadows.h
index 1979193b452..9f05f203b76 100644
--- a/src/mame/includes/meadows.h
+++ b/src/mame/includes/meadows.h
@@ -3,6 +3,8 @@
Meadows S2650 hardware
*************************************************************************/
+#include "emu.h"
+#include "cpu/s2650/s2650.h"
#include "sound/dac.h"
#include "sound/samples.h"
@@ -14,8 +16,11 @@ public:
m_spriteram(*this, "spriteram"),
m_videoram(*this, "videoram"),
m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
m_dac(*this, "dac"),
- m_samples(*this, "samples") { }
+ m_samples(*this, "samples")
+ {
+ }
optional_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_videoram;
@@ -53,7 +58,8 @@ public:
INTERRUPT_GEN_MEMBER(minferno_interrupt);
INTERRUPT_GEN_MEMBER(audio_interrupt);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip);
- required_device<cpu_device> m_maincpu;
+ required_device<s2650_device> m_maincpu;
+ optional_device<s2650_device> m_audiocpu;
optional_device<dac_device> m_dac;
optional_device<samples_device> m_samples;
};
diff --git a/src/mess/drivers/pipbug.c b/src/mess/drivers/pipbug.c
index 98bce1ec45a..caa166d798f 100644
--- a/src/mess/drivers/pipbug.c
+++ b/src/mess/drivers/pipbug.c
@@ -54,7 +54,6 @@ public:
}
DECLARE_WRITE8_MEMBER(pipbug_ctrl_w);
- DECLARE_READ8_MEMBER(pipbug_serial_r);
DECLARE_WRITE8_MEMBER(pipbug_serial_w);
required_device<rs232_port_device> m_rs232;
required_device<cpu_device> m_maincpu;
@@ -66,11 +65,6 @@ WRITE8_MEMBER( pipbug_state::pipbug_ctrl_w )
// 0x80 is written here - not connected in the baby 2650
}
-READ8_MEMBER( pipbug_state::pipbug_serial_r )
-{
- return m_rs232->rx();
-}
-
WRITE8_MEMBER( pipbug_state::pipbug_serial_w )
{
m_rs232->tx(data);
@@ -83,9 +77,10 @@ static ADDRESS_MAP_START(pipbug_mem, AS_PROGRAM, 8, pipbug_state)
ADDRESS_MAP_END
static ADDRESS_MAP_START(pipbug_io, AS_IO, 8, pipbug_state)
- ADDRESS_MAP_UNMAP_HIGH
+// ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(S2650_CTRL_PORT, S2650_CTRL_PORT) AM_WRITE(pipbug_ctrl_w)
- AM_RANGE(S2650_SENSE_PORT, S2650_FO_PORT) AM_READWRITE(pipbug_serial_r,pipbug_serial_w)
+ AM_RANGE(S2650_FO_PORT, S2650_FO_PORT) AM_WRITE(pipbug_serial_w)
+ AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READNOP // this has to return zero or the parameter to write_sense is ignored
ADDRESS_MAP_END
/* Input ports */
@@ -181,6 +176,7 @@ static MACHINE_CONFIG_START( pipbug, pipbug_state )
/* video hardware */
MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal")
+ MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE("maincpu", s2650_device, write_sense))
MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal)
/* quickload */