summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-09-05 01:02:20 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-09-05 01:02:20 -0400
commitaec5b89e7743415d4ba03cb2d9b21719eb563198 (patch)
tree274b829c0c9b66123eb0a89f00173d1fd33e43e0
parent2a893c9418e01a5d9c4e4b577d53461123439188 (diff)
pitnrun: Add 74LS259 latches (nw)
-rw-r--r--src/mame/drivers/pitnrun.cpp38
-rw-r--r--src/mame/includes/pitnrun.h10
-rw-r--r--src/mame/video/pitnrun.cpp13
3 files changed, 34 insertions, 27 deletions
diff --git a/src/mame/drivers/pitnrun.cpp b/src/mame/drivers/pitnrun.cpp
index 0aa23b0d953..a50a41acebd 100644
--- a/src/mame/drivers/pitnrun.cpp
+++ b/src/mame/drivers/pitnrun.cpp
@@ -72,6 +72,7 @@ K1000233A
#include "cpu/m6805/m68705.h"
#include "cpu/z80/z80.h"
+#include "machine/74259.h"
#include "machine/gen_latch.h"
#include "machine/watchdog.h"
@@ -83,22 +84,25 @@ K1000233A
INTERRUPT_GEN_MEMBER(pitnrun_state::nmi_source)
{
- if (m_nmi) device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (m_nmi)
+ device.execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
}
-WRITE8_MEMBER(pitnrun_state::nmi_enable_w)
+WRITE_LINE_MEMBER(pitnrun_state::nmi_enable_w)
{
- m_nmi = data & 1;
+ m_nmi = state;
+ if (!m_nmi)
+ m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
}
-WRITE8_MEMBER(pitnrun_state::hflip_w)
+WRITE_LINE_MEMBER(pitnrun_state::hflip_w)
{
- flip_screen_x_set(data);
+ flip_screen_x_set(state);
}
-WRITE8_MEMBER(pitnrun_state::vflip_w)
+WRITE_LINE_MEMBER(pitnrun_state::vflip_w)
{
- flip_screen_y_set(data);
+ flip_screen_y_set(state);
}
static ADDRESS_MAP_START( pitnrun_map, AS_PROGRAM, 8, pitnrun_state )
@@ -108,13 +112,9 @@ static ADDRESS_MAP_START( pitnrun_map, AS_PROGRAM, 8, pitnrun_state )
AM_RANGE(0x9000, 0x9fff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
AM_RANGE(0xa000, 0xa0ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xa800, 0xa800) AM_READ_PORT("SYSTEM")
- AM_RANGE(0xa800, 0xa807) AM_WRITENOP /* Analog Sound */
- AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW") AM_WRITE(nmi_enable_w)
- AM_RANGE(0xb001, 0xb001) AM_WRITE(color_select_w)
- AM_RANGE(0xb004, 0xb004) AM_WRITENOP/* COLOR SEL 2 - not used ?*/
- AM_RANGE(0xb005, 0xb005) AM_WRITE(char_bank_select)
- AM_RANGE(0xb006, 0xb006) AM_WRITE(hflip_w)
- AM_RANGE(0xb007, 0xb007) AM_WRITE(vflip_w)
+ AM_RANGE(0xa800, 0xa807) AM_DEVWRITE("noiselatch", ls259_device, write_d0) /* Analog Sound */
+ AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW")
+ AM_RANGE(0xb000, 0xb007) AM_DEVWRITE("mainlatch", ls259_device, write_d0)
AM_RANGE(0xb800, 0xb800) AM_READ_PORT("INPUTS") AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xc800, 0xc801) AM_WRITE(scroll_w)
AM_RANGE(0xc802, 0xc802) AM_WRITE(scroll_y_w)
@@ -279,6 +279,14 @@ static MACHINE_CONFIG_START( pitnrun )
MCFG_CPU_PROGRAM_MAP(pitnrun_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", pitnrun_state, nmi_source)
+ MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 7B (mislabeled LS156 on schematic)
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(pitnrun_state, nmi_enable_w)) // NMION
+ MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(pitnrun_state, color_select_w))
+ MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // COLOR SEL 2 - not used ?
+ MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(pitnrun_state, char_bank_select_w))
+ MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(pitnrun_state, hflip_w)) // HFLIP
+ MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(pitnrun_state, vflip_w)) // VFLIP
+
MCFG_CPU_ADD("audiocpu", Z80, XTAL_5MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(pitnrun_sound_map)
MCFG_CPU_IO_MAP(pitnrun_sound_io_map)
@@ -315,6 +323,8 @@ static MACHINE_CONFIG_START( pitnrun )
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_AY8910_PORT_B_READ_CB(DEVREAD8("soundlatch", generic_latch_8_device, read))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+
+ MCFG_DEVICE_ADD("noiselatch", LS259, 0) // 1J
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( pitnrun_mcu, pitnrun )
diff --git a/src/mame/includes/pitnrun.h b/src/mame/includes/pitnrun.h
index 3eec602aaa5..d0de3a6e7d3 100644
--- a/src/mame/includes/pitnrun.h
+++ b/src/mame/includes/pitnrun.h
@@ -40,9 +40,9 @@ public:
tilemap_t *m_bg;
tilemap_t *m_fg;
- DECLARE_WRITE8_MEMBER(nmi_enable_w);
- DECLARE_WRITE8_MEMBER(hflip_w);
- DECLARE_WRITE8_MEMBER(vflip_w);
+ DECLARE_WRITE_LINE_MEMBER(nmi_enable_w);
+ DECLARE_WRITE_LINE_MEMBER(hflip_w);
+ DECLARE_WRITE_LINE_MEMBER(vflip_w);
DECLARE_READ8_MEMBER(mcu_data_r);
DECLARE_WRITE8_MEMBER(mcu_data_w);
DECLARE_READ8_MEMBER(mcu_status_r);
@@ -53,13 +53,13 @@ public:
DECLARE_READ8_MEMBER(m68705_portC_r);
DECLARE_WRITE8_MEMBER(videoram_w);
DECLARE_WRITE8_MEMBER(videoram2_w);
- DECLARE_WRITE8_MEMBER(char_bank_select);
+ DECLARE_WRITE_LINE_MEMBER(char_bank_select_w);
DECLARE_WRITE8_MEMBER(scroll_w);
DECLARE_WRITE8_MEMBER(scroll_y_w);
DECLARE_WRITE8_MEMBER(ha_w);
DECLARE_WRITE8_MEMBER(h_heed_w);
DECLARE_WRITE8_MEMBER(v_heed_w);
- DECLARE_WRITE8_MEMBER(color_select_w);
+ DECLARE_WRITE_LINE_MEMBER(color_select_w);
TILE_GET_INFO_MEMBER(get_tile_info1);
TILE_GET_INFO_MEMBER(get_tile_info2);
diff --git a/src/mame/video/pitnrun.cpp b/src/mame/video/pitnrun.cpp
index b95363f0654..65893c0128c 100644
--- a/src/mame/video/pitnrun.cpp
+++ b/src/mame/video/pitnrun.cpp
@@ -53,13 +53,10 @@ WRITE8_MEMBER(pitnrun_state::videoram2_w)
m_bg ->mark_all_dirty();
}
-WRITE8_MEMBER(pitnrun_state::char_bank_select)
+WRITE_LINE_MEMBER(pitnrun_state::char_bank_select_w)
{
- if(m_char_bank!=data)
- {
- m_bg ->mark_all_dirty();
- m_char_bank=data;
- }
+ m_char_bank = state;
+ m_bg->mark_all_dirty();
}
@@ -89,9 +86,9 @@ WRITE8_MEMBER(pitnrun_state::v_heed_w)
m_v_heed=data;
}
-WRITE8_MEMBER(pitnrun_state::color_select_w)
+WRITE_LINE_MEMBER(pitnrun_state::color_select_w)
{
- m_color_select=data;
+ m_color_select = state;
machine().tilemap().mark_all_dirty();
}