bfm_sc4 - cleanup some tagmap use

(note, previous change to screenless refreshrate for the synths still causes issues here)
This commit is contained in:
David Haywood 2013-01-26 19:57:44 +00:00
parent 856bbddc83
commit d32d713e9e
2 changed files with 34 additions and 8 deletions

View File

@ -42,18 +42,18 @@
#include "sc4_dmd.lh"
UINT8 read_input_matrix(running_machine &machine, int row)
UINT8 sc4_state::read_input_matrix(running_machine &machine, int row)
{
static const char *const portnames[16] = { "IN-0", "IN-1", "IN-2", "IN-3", "IN-4", "IN-5", "IN-6", "IN-7", "IN-8", "IN-9", "IN-A", "IN-B" };
ioport_port* portnames[16] = { m_io1, m_io2, m_io3, m_io4, m_io5, m_io6, m_io7, m_io8, m_io9, m_io10, m_io11, m_io12 };
UINT8 value;
if (row<4)
{
value = (machine.root_device().ioport(portnames[row])->read_safe(0x00) & 0x1f) + ((machine.root_device().ioport(portnames[row+8])->read_safe(0x00) & 0x07) << 5);
value = ((portnames[row])->read_safe(0x00) & 0x1f) + (((portnames[row+8])->read_safe(0x00) & 0x07) << 5);
}
else
{
value = (machine.root_device().ioport(portnames[row])->read_safe(0x00) & 0x1f) + ((machine.root_device().ioport(portnames[row+4])->read_safe(0x00) & 0x18) << 2);
value = ((portnames[row])->read_safe(0x00) & 0x1f) + (((portnames[row+4])->read_safe(0x00) & 0x18) << 2);
}
return value;
@ -934,7 +934,7 @@ INPUT_PORTS_START( sc4_base )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
PORT_START("IN-a")
PORT_START("IN-A")
PORT_DIPNAME( 0x01, 0x00, "IN-a:0" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
@ -952,7 +952,7 @@ INPUT_PORTS_START( sc4_base )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
PORT_START("IN-b")
PORT_START("IN-B")
PORT_DIPNAME( 0x01, 0x00, "IN-b:0" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )

View File

@ -20,8 +20,19 @@ public:
m_ymz(*this, "ymz"),
m_maincpu(*this, "maincpu"),
m_vfd0(*this, "vfd0"),
m_nvram(*this, "nvram")
m_nvram(*this, "nvram"),
m_io1(*this, "IN-0"),
m_io2(*this, "IN-1"),
m_io3(*this, "IN-2"),
m_io4(*this, "IN-3"),
m_io5(*this, "IN-4"),
m_io6(*this, "IN-5"),
m_io7(*this, "IN-6"),
m_io8(*this, "IN-7"),
m_io9(*this, "IN-8"),
m_io10(*this, "IN-9"),
m_io11(*this, "IN-A"),
m_io12(*this, "IN-B")
{
m_chk41addr = -1;
m_dochk41 = false;
@ -59,6 +70,7 @@ public:
UINT16 m_mainram[0x10000/2];
UINT8 read_input_matrix(running_machine &machine, int row);
DECLARE_WRITE8_MEMBER(mux_output_w);
DECLARE_WRITE8_MEMBER(mux_output2_w);
@ -484,6 +496,20 @@ public:
DECLARE_MACHINE_START(sc4);
DECLARE_MACHINE_RESET(sc4);
protected:
required_ioport m_io1;
required_ioport m_io2;
required_ioport m_io3;
required_ioport m_io4;
required_ioport m_io5;
required_ioport m_io6;
required_ioport m_io7;
required_ioport m_io8;
required_ioport m_io9;
required_ioport m_io10;
required_ioport m_io11;
required_ioport m_io12;
};
class sc4_adder4_state : public sc4_state