summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2013-01-27 18:12:16 +0000
committer Curt Coder <curtcoder@mail.com>2013-01-27 18:12:16 +0000
commit53490a7c7a5882c96f5356ec8f0117ae4f795ec9 (patch)
treeaf871788c316938589eddc86bf851a7e71e75424 /src
parent3e20f59cce2aeea6bb2e5604c57c45a379db0017 (diff)
(MESS) Tagmap lookup cleanup. (nw)
Diffstat (limited to 'src')
-rw-r--r--src/mess/machine/s100_dj2db.c17
-rw-r--r--src/mess/machine/s100_dj2db.h7
-rw-r--r--src/mess/machine/wangpckb.c50
-rw-r--r--src/mess/machine/wangpckb.h16
4 files changed, 63 insertions, 27 deletions
diff --git a/src/mess/machine/s100_dj2db.c b/src/mess/machine/s100_dj2db.c
index 60ba4349574..7c6e7af03a5 100644
--- a/src/mess/machine/s100_dj2db.c
+++ b/src/mess/machine/s100_dj2db.c
@@ -266,8 +266,12 @@ s100_dj2db_device::s100_dj2db_device(const machine_config &mconfig, const char *
m_floppy2(*this, MB8866_TAG":2"),
m_floppy3(*this, MB8866_TAG":3"),
m_floppy(NULL),
- m_j1a(*this, "J1A"),
+ m_rom(*this, "dj2db"),
m_ram(*this, "ram"),
+ m_j1a(*this, "J1A"),
+ m_j3a(*this, "J3A"),
+ m_j4(*this, "J4"),
+ m_sw1(*this, "SW1"),
m_drive(0),
m_head(1),
m_int_enbl(0),
@@ -284,9 +288,6 @@ s100_dj2db_device::s100_dj2db_device(const machine_config &mconfig, const char *
void s100_dj2db_device::device_start()
{
- // find memory regions
- m_rom = memregion("dj2db")->base();
-
// allocate memory
m_ram.allocate(0x400);
@@ -310,7 +311,7 @@ void s100_dj2db_device::device_start()
void s100_dj2db_device::device_reset()
{
- m_board_enbl = ioport("J4")->read();
+ m_board_enbl = m_j4->read();
}
@@ -326,7 +327,7 @@ UINT8 s100_dj2db_device::s100_smemr_r(address_space &space, offs_t offset)
if ((offset >= 0xf800) && (offset < 0xfbf8))
{
- data = m_rom[offset & 0x3ff] ^ 0xff;
+ data = m_rom->base()[offset & 0x3ff] ^ 0xff;
}
else if (offset == 0xfbf8) // SERIAL IN
{
@@ -504,7 +505,7 @@ void s100_dj2db_device::s100_sout_w(address_space &space, offs_t offset, UINT8 d
{
if (offset == 0x41)
{
- m_board_enbl = (data & ioport("J3A")->read()) ? 1 : 0;
+ m_board_enbl = (data & m_j3a->read()) ? 1 : 0;
}
}
@@ -515,7 +516,7 @@ void s100_dj2db_device::s100_sout_w(address_space &space, offs_t offset, UINT8 d
void s100_dj2db_device::s100_phantom_w(int state)
{
- if (!BIT(ioport("SW1")->read(), 2))
+ if (!BIT(m_sw1->read(), 2))
{
m_phantom = state;
}
diff --git a/src/mess/machine/s100_dj2db.h b/src/mess/machine/s100_dj2db.h
index 19451fa3344..77981cf7e1f 100644
--- a/src/mess/machine/s100_dj2db.h
+++ b/src/mess/machine/s100_dj2db.h
@@ -66,8 +66,12 @@ private:
required_device<floppy_connector> m_floppy2;
required_device<floppy_connector> m_floppy3;
floppy_image_device *m_floppy;
- required_ioport m_j1a;
+ required_memory_region m_rom;
optional_shared_ptr<UINT8> m_ram;
+ required_ioport m_j1a;
+ required_ioport m_j3a;
+ required_ioport m_j4;
+ required_ioport m_sw1;
// floppy state
int m_drive; // selected drive
@@ -75,7 +79,6 @@ private:
int m_int_enbl; // interrupt enable
// S-100 bus state
- const UINT8 *m_rom;
int m_access_enbl; // access enable
int m_board_enbl; // board enable
int m_phantom; // phantom
diff --git a/src/mess/machine/wangpckb.c b/src/mess/machine/wangpckb.c
index 44144f4e8f5..f8edad67a79 100644
--- a/src/mess/machine/wangpckb.c
+++ b/src/mess/machine/wangpckb.c
@@ -385,7 +385,23 @@ ioport_constructor wangpc_keyboard_device::device_input_ports() const
wangpc_keyboard_device::wangpc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, WANGPC_KEYBOARD, "Wang PC Keyboard", tag, owner, clock),
device_serial_interface(mconfig, *this),
- m_maincpu(*this, I8051_TAG)
+ m_maincpu(*this, I8051_TAG),
+ m_y0(*this, "Y0"),
+ m_y1(*this, "Y1"),
+ m_y2(*this, "Y2"),
+ m_y3(*this, "Y3"),
+ m_y4(*this, "Y4"),
+ m_y5(*this, "Y5"),
+ m_y6(*this, "Y6"),
+ m_y7(*this, "Y7"),
+ m_y8(*this, "Y8"),
+ m_y9(*this, "Y9"),
+ m_ya(*this, "YA"),
+ m_yb(*this, "YB"),
+ m_yc(*this, "YC"),
+ m_yd(*this, "YD"),
+ m_ye(*this, "YE"),
+ m_yf(*this, "YF")
{
}
@@ -479,22 +495,22 @@ READ8_MEMBER( wangpc_keyboard_device::kb_p1_r )
switch (m_y & 0x0f)
{
- case 0: data &= ioport("Y0")->read(); break;
- case 1: data &= ioport("Y1")->read(); break;
- case 2: data &= ioport("Y2")->read(); break;
- case 3: data &= ioport("Y3")->read(); break;
- case 4: data &= ioport("Y4")->read(); break;
- case 5: data &= ioport("Y5")->read(); break;
- case 6: data &= ioport("Y6")->read(); break;
- case 7: data &= ioport("Y7")->read(); break;
- case 8: data &= ioport("Y8")->read(); break;
- case 9: data &= ioport("Y9")->read(); break;
- case 0xa: data &= ioport("YA")->read(); break;
- case 0xb: data &= ioport("YB")->read(); break;
- case 0xc: data &= ioport("YC")->read(); break;
- case 0xd: data &= ioport("YD")->read(); break;
- case 0xe: data &= ioport("YE")->read(); break;
- case 0xf: data &= ioport("YF")->read(); break;
+ case 0: data &= m_y0->read(); break;
+ case 1: data &= m_y1->read(); break;
+ case 2: data &= m_y2->read(); break;
+ case 3: data &= m_y3->read(); break;
+ case 4: data &= m_y4->read(); break;
+ case 5: data &= m_y5->read(); break;
+ case 6: data &= m_y6->read(); break;
+ case 7: data &= m_y7->read(); break;
+ case 8: data &= m_y8->read(); break;
+ case 9: data &= m_y9->read(); break;
+ case 0xa: data &= m_ya->read(); break;
+ case 0xb: data &= m_yb->read(); break;
+ case 0xc: data &= m_yc->read(); break;
+ case 0xd: data &= m_yd->read(); break;
+ case 0xe: data &= m_ye->read(); break;
+ case 0xf: data &= m_yf->read(); break;
}
return data;
diff --git a/src/mess/machine/wangpckb.h b/src/mess/machine/wangpckb.h
index ec7f291f4e8..a0441f41ab6 100644
--- a/src/mess/machine/wangpckb.h
+++ b/src/mess/machine/wangpckb.h
@@ -74,6 +74,22 @@ protected:
private:
required_device<cpu_device> m_maincpu;
+ required_ioport m_y0;
+ required_ioport m_y1;
+ required_ioport m_y2;
+ required_ioport m_y3;
+ required_ioport m_y4;
+ required_ioport m_y5;
+ required_ioport m_y6;
+ required_ioport m_y7;
+ required_ioport m_y8;
+ required_ioport m_y9;
+ required_ioport m_ya;
+ required_ioport m_yb;
+ required_ioport m_yc;
+ required_ioport m_yd;
+ required_ioport m_ye;
+ required_ioport m_yf;
UINT8 m_y;
};