summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Wilbert Pol <wilbertpol@users.noreply.github.com>2015-08-11 13:23:50 +0200
committer Wilbert Pol <wilbertpol@users.noreply.github.com>2015-08-11 22:52:44 +0200
commit16500a8e22038cd636717bc8b984e031caedb5a2 (patch)
tree3a188705f158205549a7db8c0eb555ec2bf9dbaa /src
parent4d60a89a60e8de11e9b828a14edfcaf8c1de1b2a (diff)
vector06.c: reduce tagmap lookups (nw)
Diffstat (limited to 'src')
-rw-r--r--src/mess/drivers/vector06.c18
-rw-r--r--src/mess/includes/vector06.h70
-rw-r--r--src/mess/machine/vector06.c40
3 files changed, 73 insertions, 55 deletions
diff --git a/src/mess/drivers/vector06.c b/src/mess/drivers/vector06.c
index 02cf3423bfc..8546573f221 100644
--- a/src/mess/drivers/vector06.c
+++ b/src/mess/drivers/vector06.c
@@ -33,7 +33,7 @@ ADDRESS_MAP_END
/* Input ports */
static INPUT_PORTS_START( vector06 )
- PORT_START("LINE0")
+ PORT_START("LINE.0")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Del") PORT_CODE(KEYCODE_DEL)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER)
@@ -42,7 +42,7 @@ static INPUT_PORTS_START( vector06 )
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Up") PORT_CODE(KEYCODE_UP)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN)
- PORT_START("LINE1")
+ PORT_START("LINE.1")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Home") PORT_CODE(KEYCODE_HOME)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PgUp") PORT_CODE(KEYCODE_PGUP)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC)
@@ -51,7 +51,7 @@ static INPUT_PORTS_START( vector06 )
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5)
- PORT_START("LINE2")
+ PORT_START("LINE.2")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2)
@@ -60,7 +60,7 @@ static INPUT_PORTS_START( vector06 )
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7)
- PORT_START("LINE3")
+ PORT_START("LINE.3")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("'") PORT_CODE(KEYCODE_INSERT)
@@ -69,7 +69,7 @@ static INPUT_PORTS_START( vector06 )
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("=") PORT_CODE(KEYCODE_EQUALS)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH)
- PORT_START("LINE4")
+ PORT_START("LINE.4")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("@") PORT_CODE(KEYCODE_QUOTE)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B)
@@ -78,7 +78,7 @@ static INPUT_PORTS_START( vector06 )
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G)
- PORT_START("LINE5")
+ PORT_START("LINE.5")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J)
@@ -87,7 +87,7 @@ static INPUT_PORTS_START( vector06 )
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O)
- PORT_START("LINE6")
+ PORT_START("LINE.6")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R)
@@ -96,7 +96,7 @@ static INPUT_PORTS_START( vector06 )
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W)
- PORT_START("LINE7")
+ PORT_START("LINE.7")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z)
@@ -105,7 +105,7 @@ static INPUT_PORTS_START( vector06 )
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("]") PORT_CODE(KEYCODE_CLOSEBRACE)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("~") PORT_CODE(KEYCODE_TILDE)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE)
- PORT_START("LINE8")
+ PORT_START("LINE.8")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
diff --git a/src/mess/includes/vector06.h b/src/mess/includes/vector06.h
index 970965465ef..959842aa3b6 100644
--- a/src/mess/includes/vector06.h
+++ b/src/mess/includes/vector06.h
@@ -27,30 +27,27 @@ class vector06_state : public driver_device
public:
vector06_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_cassette(*this, "cassette"),
- m_cart(*this, "cartslot"),
- m_fdc(*this, "wd1793"),
- m_floppy0(*this, "wd1793:0"),
- m_floppy1(*this, "wd1793:1"),
- m_ppi(*this, "ppi8255"),
- m_ppi2(*this, "ppi8255_2"),
- m_ram(*this, RAM_TAG),
- m_palette(*this, "palette")
+ m_maincpu(*this, "maincpu"),
+ m_cassette(*this, "cassette"),
+ m_cart(*this, "cartslot"),
+ m_fdc(*this, "wd1793"),
+ m_floppy0(*this, "wd1793:0"),
+ m_floppy1(*this, "wd1793:1"),
+ m_ppi(*this, "ppi8255"),
+ m_ppi2(*this, "ppi8255_2"),
+ m_ram(*this, RAM_TAG),
+ m_palette(*this, "palette"),
+ m_bank1(*this, "bank1"),
+ m_bank2(*this, "bank2"),
+ m_bank3(*this, "bank3"),
+ m_bank4(*this, "bank4"),
+ m_region_maincpu(*this, "maincpu"),
+ m_line(*this, "LINE"),
+ m_reset(*this, "RESET")
{ }
DECLARE_FLOPPY_FORMATS(floppy_formats);
- required_device<cpu_device> m_maincpu;
- required_device<cassette_image_device> m_cassette;
- required_device<generic_slot_device> m_cart;
- required_device<fd1793_t> m_fdc;
- required_device<floppy_connector> m_floppy0;
- required_device<floppy_connector> m_floppy1;
- required_device<i8255_device> m_ppi;
- required_device<i8255_device> m_ppi2;
- required_device<ram_device> m_ram;
- required_device<palette_device> m_palette;
DECLARE_READ8_MEMBER(vector06_8255_portb_r);
DECLARE_READ8_MEMBER(vector06_8255_portc_r);
DECLARE_WRITE8_MEMBER(vector06_8255_porta_w);
@@ -64,12 +61,6 @@ public:
DECLARE_READ8_MEMBER(vector06_8255_2_r);
DECLARE_WRITE8_MEMBER(vector06_8255_2_w);
DECLARE_WRITE8_MEMBER(vector06_disc_w);
- UINT8 m_keyboard_mask;
- UINT8 m_color_index;
- UINT8 m_video_mode;
- UINT8 m_romdisk_msb;
- UINT8 m_romdisk_lsb;
- UINT8 m_vblank_state;
void vector06_set_video_mode(int width);
virtual void machine_start();
virtual void machine_reset();
@@ -79,6 +70,33 @@ public:
INTERRUPT_GEN_MEMBER(vector06_interrupt);
TIMER_CALLBACK_MEMBER(reset_check_callback);
IRQ_CALLBACK_MEMBER(vector06_irq_callback);
+
+private:
+ required_device<cpu_device> m_maincpu;
+ required_device<cassette_image_device> m_cassette;
+ required_device<generic_slot_device> m_cart;
+ required_device<fd1793_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<i8255_device> m_ppi;
+ required_device<i8255_device> m_ppi2;
+ required_device<ram_device> m_ram;
+ required_device<palette_device> m_palette;
+ required_memory_bank m_bank1;
+ required_memory_bank m_bank2;
+ required_memory_bank m_bank3;
+ required_memory_bank m_bank4;
+ required_memory_region m_region_maincpu;
+ required_ioport_array<9> m_line;
+ required_ioport m_reset;
+
+ UINT8 m_keyboard_mask;
+ UINT8 m_color_index;
+ UINT8 m_video_mode;
+ UINT8 m_romdisk_msb;
+ UINT8 m_romdisk_lsb;
+ UINT8 m_vblank_state;
+
};
#endif /* VECTOR06_H_ */
diff --git a/src/mess/machine/vector06.c b/src/mess/machine/vector06.c
index b6f4e353fed..a2d7d770db4 100644
--- a/src/mess/machine/vector06.c
+++ b/src/mess/machine/vector06.c
@@ -15,20 +15,20 @@
READ8_MEMBER( vector06_state::vector06_8255_portb_r )
{
UINT8 key = 0xff;
- if (BIT(m_keyboard_mask, 0)) key &= ioport("LINE0")->read();
- if (BIT(m_keyboard_mask, 1)) key &= ioport("LINE1")->read();
- if (BIT(m_keyboard_mask, 2)) key &= ioport("LINE2")->read();
- if (BIT(m_keyboard_mask, 3)) key &= ioport("LINE3")->read();
- if (BIT(m_keyboard_mask, 4)) key &= ioport("LINE4")->read();
- if (BIT(m_keyboard_mask, 5)) key &= ioport("LINE5")->read();
- if (BIT(m_keyboard_mask, 6)) key &= ioport("LINE6")->read();
- if (BIT(m_keyboard_mask, 7)) key &= ioport("LINE7")->read();
+ if (BIT(m_keyboard_mask, 0)) key &= m_line[0]->read();
+ if (BIT(m_keyboard_mask, 1)) key &= m_line[1]->read();
+ if (BIT(m_keyboard_mask, 2)) key &= m_line[2]->read();
+ if (BIT(m_keyboard_mask, 3)) key &= m_line[3]->read();
+ if (BIT(m_keyboard_mask, 4)) key &= m_line[4]->read();
+ if (BIT(m_keyboard_mask, 5)) key &= m_line[5]->read();
+ if (BIT(m_keyboard_mask, 6)) key &= m_line[6]->read();
+ if (BIT(m_keyboard_mask, 7)) key &= m_line[7]->read();
return key;
}
READ8_MEMBER( vector06_state::vector06_8255_portc_r )
{
- UINT8 ret = ioport("LINE8")->read();
+ UINT8 ret = m_line[8]->read();
if (m_cassette->input() > 0)
ret |= 0x10;
@@ -121,17 +121,17 @@ IRQ_CALLBACK_MEMBER(vector06_state::vector06_irq_callback)
TIMER_CALLBACK_MEMBER(vector06_state::reset_check_callback)
{
- UINT8 val = ioport("RESET")->read();
+ UINT8 val = m_reset->read();
if (BIT(val, 0))
{
- membank("bank1")->set_base(memregion("maincpu")->base() + 0x10000);
+ m_bank1->set_base(m_region_maincpu->base() + 0x10000);
m_maincpu->reset();
}
if (BIT(val, 1))
{
- membank("bank1")->set_base(m_ram->pointer() + 0x0000);
+ m_bank1->set_base(m_ram->pointer() + 0x0000);
m_maincpu->reset();
}
}
@@ -165,15 +165,15 @@ void vector06_state::machine_reset()
{
address_space &space = m_maincpu->space(AS_PROGRAM);
- space.install_read_bank (0x0000, 0x7fff, "bank1");
- space.install_write_bank(0x0000, 0x7fff, "bank2");
- space.install_read_bank (0x8000, 0xffff, "bank3");
- space.install_write_bank(0x8000, 0xffff, "bank4");
+ space.install_read_bank (0x0000, 0x7fff, m_bank1);
+ space.install_write_bank(0x0000, 0x7fff, m_bank2);
+ space.install_read_bank (0x8000, 0xffff, m_bank3);
+ space.install_write_bank(0x8000, 0xffff, m_bank4);
- membank("bank1")->set_base(memregion("maincpu")->base() + 0x10000);
- membank("bank2")->set_base(m_ram->pointer() + 0x0000);
- membank("bank3")->set_base(m_ram->pointer() + 0x8000);
- membank("bank4")->set_base(m_ram->pointer() + 0x8000);
+ m_bank1->set_base(m_region_maincpu->base() + 0x10000);
+ m_bank2->set_base(m_ram->pointer() + 0x0000);
+ m_bank3->set_base(m_ram->pointer() + 0x8000);
+ m_bank4->set_base(m_ram->pointer() + 0x8000);
m_keyboard_mask = 0;
m_color_index = 0;