summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-04-15 23:57:01 -0400
committer AJR <ajrhacker@users.noreply.github.com>2018-04-15 23:57:01 -0400
commit001ec452c96e50a2749bbedd706cfc411e157220 (patch)
tree90bfc64bf54bac1f6243bd4b132175c6f65b68f6
parentde007f3e5f775017e3b0aa04b6834783d99c09ad (diff)
feversoc.cpp: Eliminate set_lamp_value and MCFG_CPU_VBLANK_INT (nw)
-rw-r--r--src/mame/drivers/feversoc.cpp46
1 files changed, 27 insertions, 19 deletions
diff --git a/src/mame/drivers/feversoc.cpp b/src/mame/drivers/feversoc.cpp
index a5abe25d3df..7247c368367 100644
--- a/src/mame/drivers/feversoc.cpp
+++ b/src/mame/drivers/feversoc.cpp
@@ -87,6 +87,7 @@ public:
m_nvram(*this, "nvram"),
m_spriteram(*this, "spriteram"),
m_in(*this, {"IN1", "IN0"}),
+ m_lamps(*this, "lamp%u", 1U),
m_maincpu(*this, "maincpu"),
m_oki(*this, "oki"),
m_eeprom(*this, "eeprom"),
@@ -95,18 +96,26 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
- required_shared_ptr<uint32_t> m_mainram1;
- required_shared_ptr<uint32_t> m_mainram2;
- required_shared_ptr<uint32_t> m_nvram;
- required_shared_ptr<uint32_t> m_spriteram;
- required_ioport_array<2> m_in;
+ DECLARE_DRIVER_INIT(feversoc);
+ void feversoc(machine_config &config);
+
+private:
DECLARE_READ16_MEMBER(in_r);
DECLARE_WRITE16_MEMBER(output_w);
DECLARE_WRITE16_MEMBER(output2_w);
- DECLARE_DRIVER_INIT(feversoc);
+ void feversoc_map(address_map &map);
uint32_t screen_update_feversoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(feversoc_irq);
+ DECLARE_WRITE_LINE_MEMBER(feversoc_irq);
DECLARE_WRITE16_MEMBER(feversoc_irq_ack);
+ virtual void machine_start() override;
+
+ required_shared_ptr<uint32_t> m_mainram1;
+ required_shared_ptr<uint32_t> m_mainram2;
+ required_shared_ptr<uint32_t> m_nvram;
+ required_shared_ptr<uint32_t> m_spriteram;
+ required_ioport_array<2> m_in;
+ output_finder<7> m_lamps;
+
required_device<sh2_device> m_maincpu;
required_device<okim6295_device> m_oki;
required_device<eeprom_serial_93cxx_device> m_eeprom;
@@ -114,8 +123,6 @@ public:
required_device<ticket_dispenser_device> m_hopper;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- void feversoc(machine_config &config);
- void feversoc_map(address_map &map);
};
@@ -180,13 +187,8 @@ WRITE16_MEMBER( feversoc_state::output_w )
WRITE16_MEMBER( feversoc_state::output2_w )
{
- machine().output().set_lamp_value(1, BIT(data, 0)); // LAMP1
- machine().output().set_lamp_value(2, BIT(data, 1)); // LAMP2
- machine().output().set_lamp_value(3, BIT(data, 2)); // LAMP3
- machine().output().set_lamp_value(4, BIT(data, 3)); // LAMP4
- machine().output().set_lamp_value(5, BIT(data, 4)); // LAMP5
- machine().output().set_lamp_value(6, BIT(data, 5)); // LAMP6
- machine().output().set_lamp_value(7, BIT(data, 6)); // LAMP7
+ for (int n = 0; n < 7; n++)
+ m_lamps[n] = BIT(data, n); // LAMP1-LAMP7
machine().bookkeeping().coin_counter_w(2, data & 0x2000); // key in
//data & 0x4000 key out
@@ -266,9 +268,10 @@ static INPUT_PORTS_START( feversoc )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
-INTERRUPT_GEN_MEMBER(feversoc_state::feversoc_irq)
+WRITE_LINE_MEMBER(feversoc_state::feversoc_irq)
{
- m_maincpu->set_input_line(8, ASSERT_LINE);
+ if (state)
+ m_maincpu->set_input_line(8, ASSERT_LINE);
}
WRITE16_MEMBER(feversoc_state::feversoc_irq_ack)
@@ -276,12 +279,16 @@ WRITE16_MEMBER(feversoc_state::feversoc_irq_ack)
m_maincpu->set_input_line(8, CLEAR_LINE);
}
+void feversoc_state::machine_start()
+{
+ m_lamps.resolve();
+}
+
MACHINE_CONFIG_START(feversoc_state::feversoc)
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",SH2,MASTER_CLOCK)
MCFG_CPU_PROGRAM_MAP(feversoc_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", feversoc_state, feversoc_irq)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -291,6 +298,7 @@ MACHINE_CONFIG_START(feversoc_state::feversoc)
MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1) //dynamic resolution?
MCFG_SCREEN_UPDATE_DRIVER(feversoc_state, screen_update_feversoc)
MCFG_SCREEN_PALETTE("palette")
+ MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(feversoc_state, feversoc_irq))
MCFG_GFXDECODE_ADD("gfxdecode", "palette", feversoc)
MCFG_PALETTE_ADD("palette", 0x1000)