mirror of
https://github.com/holub/mame
synced 2025-10-08 09:30:17 +03:00
feversoc.cpp: Eliminate set_lamp_value and MCFG_CPU_VBLANK_INT (nw)
This commit is contained in:
parent
de007f3e5f
commit
001ec452c9
@ -87,6 +87,7 @@ public:
|
|||||||
m_nvram(*this, "nvram"),
|
m_nvram(*this, "nvram"),
|
||||||
m_spriteram(*this, "spriteram"),
|
m_spriteram(*this, "spriteram"),
|
||||||
m_in(*this, {"IN1", "IN0"}),
|
m_in(*this, {"IN1", "IN0"}),
|
||||||
|
m_lamps(*this, "lamp%u", 1U),
|
||||||
m_maincpu(*this, "maincpu"),
|
m_maincpu(*this, "maincpu"),
|
||||||
m_oki(*this, "oki"),
|
m_oki(*this, "oki"),
|
||||||
m_eeprom(*this, "eeprom"),
|
m_eeprom(*this, "eeprom"),
|
||||||
@ -95,18 +96,26 @@ public:
|
|||||||
m_gfxdecode(*this, "gfxdecode"),
|
m_gfxdecode(*this, "gfxdecode"),
|
||||||
m_palette(*this, "palette") { }
|
m_palette(*this, "palette") { }
|
||||||
|
|
||||||
|
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);
|
||||||
|
void feversoc_map(address_map &map);
|
||||||
|
uint32_t screen_update_feversoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||||
|
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_mainram1;
|
||||||
required_shared_ptr<uint32_t> m_mainram2;
|
required_shared_ptr<uint32_t> m_mainram2;
|
||||||
required_shared_ptr<uint32_t> m_nvram;
|
required_shared_ptr<uint32_t> m_nvram;
|
||||||
required_shared_ptr<uint32_t> m_spriteram;
|
required_shared_ptr<uint32_t> m_spriteram;
|
||||||
required_ioport_array<2> m_in;
|
required_ioport_array<2> m_in;
|
||||||
DECLARE_READ16_MEMBER(in_r);
|
output_finder<7> m_lamps;
|
||||||
DECLARE_WRITE16_MEMBER(output_w);
|
|
||||||
DECLARE_WRITE16_MEMBER(output2_w);
|
|
||||||
DECLARE_DRIVER_INIT(feversoc);
|
|
||||||
uint32_t screen_update_feversoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
|
||||||
INTERRUPT_GEN_MEMBER(feversoc_irq);
|
|
||||||
DECLARE_WRITE16_MEMBER(feversoc_irq_ack);
|
|
||||||
required_device<sh2_device> m_maincpu;
|
required_device<sh2_device> m_maincpu;
|
||||||
required_device<okim6295_device> m_oki;
|
required_device<okim6295_device> m_oki;
|
||||||
required_device<eeprom_serial_93cxx_device> m_eeprom;
|
required_device<eeprom_serial_93cxx_device> m_eeprom;
|
||||||
@ -114,8 +123,6 @@ public:
|
|||||||
required_device<ticket_dispenser_device> m_hopper;
|
required_device<ticket_dispenser_device> m_hopper;
|
||||||
required_device<gfxdecode_device> m_gfxdecode;
|
required_device<gfxdecode_device> m_gfxdecode;
|
||||||
required_device<palette_device> m_palette;
|
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 )
|
WRITE16_MEMBER( feversoc_state::output2_w )
|
||||||
{
|
{
|
||||||
machine().output().set_lamp_value(1, BIT(data, 0)); // LAMP1
|
for (int n = 0; n < 7; n++)
|
||||||
machine().output().set_lamp_value(2, BIT(data, 1)); // LAMP2
|
m_lamps[n] = BIT(data, n); // LAMP1-LAMP7
|
||||||
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
|
|
||||||
|
|
||||||
machine().bookkeeping().coin_counter_w(2, data & 0x2000); // key in
|
machine().bookkeeping().coin_counter_w(2, data & 0x2000); // key in
|
||||||
//data & 0x4000 key out
|
//data & 0x4000 key out
|
||||||
@ -266,9 +268,10 @@ static INPUT_PORTS_START( feversoc )
|
|||||||
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
|
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||||
INPUT_PORTS_END
|
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)
|
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);
|
m_maincpu->set_input_line(8, CLEAR_LINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void feversoc_state::machine_start()
|
||||||
|
{
|
||||||
|
m_lamps.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
MACHINE_CONFIG_START(feversoc_state::feversoc)
|
MACHINE_CONFIG_START(feversoc_state::feversoc)
|
||||||
|
|
||||||
/* basic machine hardware */
|
/* basic machine hardware */
|
||||||
MCFG_CPU_ADD("maincpu",SH2,MASTER_CLOCK)
|
MCFG_CPU_ADD("maincpu",SH2,MASTER_CLOCK)
|
||||||
MCFG_CPU_PROGRAM_MAP(feversoc_map)
|
MCFG_CPU_PROGRAM_MAP(feversoc_map)
|
||||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", feversoc_state, feversoc_irq)
|
|
||||||
|
|
||||||
/* video hardware */
|
/* video hardware */
|
||||||
MCFG_SCREEN_ADD("screen", RASTER)
|
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_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_UPDATE_DRIVER(feversoc_state, screen_update_feversoc)
|
||||||
MCFG_SCREEN_PALETTE("palette")
|
MCFG_SCREEN_PALETTE("palette")
|
||||||
|
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(feversoc_state, feversoc_irq))
|
||||||
|
|
||||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", feversoc)
|
MCFG_GFXDECODE_ADD("gfxdecode", "palette", feversoc)
|
||||||
MCFG_PALETTE_ADD("palette", 0x1000)
|
MCFG_PALETTE_ADD("palette", 0x1000)
|
||||||
|
Loading…
Reference in New Issue
Block a user