mirror of
https://github.com/holub/mame
synced 2025-04-24 09:20:02 +03:00
(MESS) vc4000.c: Reduce tagmap lookups (nw)
This commit is contained in:
parent
0ed1842cdf
commit
35e3b93a06
@ -114,25 +114,25 @@ READ8_MEMBER( vc4000_state::vc4000_key_r )
|
||||
switch(offset & 0x0f)
|
||||
{
|
||||
case 0x08:
|
||||
data = ioport("KEYPAD1_1")->read();
|
||||
data = m_keypad1_1->read();
|
||||
break;
|
||||
case 0x09:
|
||||
data = ioport("KEYPAD1_2")->read();
|
||||
data = m_keypad1_2->read();
|
||||
break;
|
||||
case 0x0a:
|
||||
data = ioport("KEYPAD1_3")->read();
|
||||
data = m_keypad1_3->read();
|
||||
break;
|
||||
case 0x0b:
|
||||
data = ioport("PANEL")->read();
|
||||
data = m_panel->read();
|
||||
break;
|
||||
case 0x0c:
|
||||
data = ioport("KEYPAD2_1")->read();
|
||||
data = m_keypad2_1->read();
|
||||
break;
|
||||
case 0x0d:
|
||||
data = ioport("KEYPAD2_2")->read();
|
||||
data = m_keypad2_2->read();
|
||||
break;
|
||||
case 0x0e:
|
||||
data = ioport("KEYPAD2_3")->read();
|
||||
data = m_keypad2_3->read();
|
||||
break;
|
||||
}
|
||||
return data;
|
||||
|
@ -72,8 +72,25 @@ class vc4000_state : public driver_device
|
||||
{
|
||||
public:
|
||||
vc4000_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_cass(*this, CASSETTE_TAG)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_cass(*this, CASSETTE_TAG)
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_keypad1_1(*this, "KEYPAD1_1")
|
||||
, m_keypad1_2(*this, "KEYPAD1_2")
|
||||
, m_keypad1_3(*this, "KEYPAD1_3")
|
||||
, m_panel(*this, "PANEL")
|
||||
, m_keypad2_1(*this, "KEYPAD2_1")
|
||||
, m_keypad2_2(*this, "KEYPAD2_2")
|
||||
, m_keypad2_3(*this, "KEYPAD2_3")
|
||||
#ifndef ANALOG_HACK
|
||||
, m_io_joy1_x(*this, "JOY1_X")
|
||||
, m_io_joy1_y(*this, "JOY1_Y")
|
||||
, m_io_joy2_x(*this, "JOY2_X")
|
||||
, m_io_joy2_y(*this, "JOY2_Y")
|
||||
#else
|
||||
, m_joys(*this, "JOYS")
|
||||
, m_config(*this, "CONFIG")
|
||||
#endif
|
||||
{ }
|
||||
|
||||
DECLARE_WRITE8_MEMBER(vc4000_sound_ctl);
|
||||
@ -98,6 +115,25 @@ public:
|
||||
virtual void palette_init();
|
||||
UINT32 screen_update_vc4000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(vc4000_video_line);
|
||||
|
||||
protected:
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_ioport m_keypad1_1;
|
||||
required_ioport m_keypad1_2;
|
||||
required_ioport m_keypad1_3;
|
||||
required_ioport m_panel;
|
||||
required_ioport m_keypad2_1;
|
||||
required_ioport m_keypad2_2;
|
||||
required_ioport m_keypad2_3;
|
||||
#ifndef ANALOG_HACK
|
||||
required_ioport m_io_joy1_x;
|
||||
required_ioport m_io_joy1_y;
|
||||
required_ioport m_io_joy2_x;
|
||||
required_ioport m_io_joy2_y;
|
||||
#else
|
||||
required_ioport m_joys;
|
||||
required_ioport m_config;
|
||||
#endif
|
||||
};
|
||||
|
||||
/*----------- defined in audio/vc4000.c -----------*/
|
||||
|
@ -115,21 +115,21 @@ READ8_MEMBER( vc4000_state::vc4000_video_r )
|
||||
|
||||
#ifndef ANALOG_HACK
|
||||
case 0xcc:
|
||||
if (!activeS2650_FO)) data=ioport("JOY1_X")->read();
|
||||
else data=ioport("JOY1_Y")->read();
|
||||
if (!activeS2650_FO)) data = m_io_joy1_x->read();
|
||||
else data = m_io_joy1_y->read();
|
||||
break;
|
||||
case 0xcd:
|
||||
if (!activecpu_get_reg(S2650_FO)) data=ioport("JOY2_X")->read();
|
||||
else data=ioport("JOY2_Y")->read();
|
||||
if (!activecpu_get_reg(S2650_FO)) data = m_io_joy2_x->read();
|
||||
else data = m_io_joy2_y->read();
|
||||
break;
|
||||
#else
|
||||
|
||||
case 0xcc: /* left joystick */
|
||||
if (ioport("CONFIG")->read()&1)
|
||||
if (m_config->read()&1)
|
||||
{ /* paddle */
|
||||
if (!machine().device("maincpu")->state().state_int(S2650_FO))
|
||||
if (!m_maincpu->state_int(S2650_FO))
|
||||
{
|
||||
data = ioport("JOYS")->read() & 0x03;
|
||||
data = m_joys->read() & 0x03;
|
||||
switch (data)
|
||||
{
|
||||
case 0x01:
|
||||
@ -147,7 +147,7 @@ READ8_MEMBER( vc4000_state::vc4000_video_r )
|
||||
}
|
||||
else
|
||||
{
|
||||
data = ioport("JOYS")->read() & 0x0c;
|
||||
data = m_joys->read() & 0x0c;
|
||||
switch (data)
|
||||
{
|
||||
case 0x08:
|
||||
@ -166,9 +166,9 @@ READ8_MEMBER( vc4000_state::vc4000_video_r )
|
||||
}
|
||||
else
|
||||
{ /* buttons */
|
||||
if (!machine().device("maincpu")->state().state_int(S2650_FO))
|
||||
if (!m_maincpu->state_int(S2650_FO))
|
||||
{
|
||||
data = ioport("JOYS")->read() & 0x03;
|
||||
data = m_joys->read() & 0x03;
|
||||
switch (data)
|
||||
{
|
||||
case 0x01:
|
||||
@ -184,7 +184,7 @@ READ8_MEMBER( vc4000_state::vc4000_video_r )
|
||||
}
|
||||
else
|
||||
{
|
||||
data = ioport("JOYS")->read() & 0x0c;
|
||||
data = m_joys->read() & 0x0c;
|
||||
switch (data)
|
||||
{
|
||||
case 0x08:
|
||||
@ -202,11 +202,11 @@ READ8_MEMBER( vc4000_state::vc4000_video_r )
|
||||
break;
|
||||
|
||||
case 0xcd: /* right joystick */
|
||||
if (ioport("CONFIG")->read()&1)
|
||||
if (m_config->read()&1)
|
||||
{
|
||||
if (!machine().device("maincpu")->state().state_int(S2650_FO))
|
||||
if (!m_maincpu->state_int(S2650_FO))
|
||||
{
|
||||
data = ioport("JOYS")->read() & 0x30;
|
||||
data = m_joys->read() & 0x30;
|
||||
switch (data)
|
||||
{
|
||||
case 0x10:
|
||||
@ -224,7 +224,7 @@ READ8_MEMBER( vc4000_state::vc4000_video_r )
|
||||
}
|
||||
else
|
||||
{
|
||||
data = ioport("JOYS")->read() & 0xc0;
|
||||
data = m_joys->read() & 0xc0;
|
||||
switch (data)
|
||||
{
|
||||
case 0x80:
|
||||
@ -243,9 +243,9 @@ READ8_MEMBER( vc4000_state::vc4000_video_r )
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!machine().device("maincpu")->state().state_int(S2650_FO))
|
||||
if (!m_maincpu->state_int(S2650_FO))
|
||||
{
|
||||
data = ioport("JOYS")->read() & 0x30;
|
||||
data = m_joys->read() & 0x30;
|
||||
switch (data)
|
||||
{
|
||||
case 0x10:
|
||||
@ -261,7 +261,7 @@ READ8_MEMBER( vc4000_state::vc4000_video_r )
|
||||
}
|
||||
else
|
||||
{
|
||||
data = ioport("JOYS")->read() & 0xc0;
|
||||
data = m_joys->read() & 0xc0;
|
||||
switch (data)
|
||||
{
|
||||
case 0x80:
|
||||
@ -593,7 +593,7 @@ INTERRUPT_GEN_MEMBER(vc4000_state::vc4000_video_line)
|
||||
|
||||
if (m_irq_pause>10)
|
||||
{
|
||||
machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
|
||||
m_maincpu->set_input_line(0, CLEAR_LINE);
|
||||
m_irq_pause = 0;
|
||||
}
|
||||
|
||||
@ -639,7 +639,7 @@ INTERRUPT_GEN_MEMBER(vc4000_state::vc4000_video_line)
|
||||
(m_video.sprites[1].finished_now) |
|
||||
(m_video.sprites[0].finished_now)) && (!m_irq_pause))
|
||||
{
|
||||
machine().device("maincpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, 3);
|
||||
m_maincpu->set_input_line_and_vector(0, ASSERT_LINE, 3);
|
||||
m_irq_pause=1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user