summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2019-06-16 19:15:22 +0200
committer hap <happppp@users.noreply.github.com>2019-06-16 19:15:35 +0200
commitb0b946d37fc24194cdec87f0e8ab1ea13694f7bc (patch)
treedee381a64749416d980e6eae65c1afde61272ba9
parent927944810e8459fe6aaa6ce742a4e4ea7c62d11d (diff)
hmcs40: remove port enum (nw)
-rw-r--r--src/devices/cpu/hmcs40/hmcs40.h12
-rw-r--r--src/mame/drivers/hh_hmcs40.cpp30
-rw-r--r--src/mame/machine/alpha8201.cpp2
3 files changed, 16 insertions, 28 deletions
diff --git a/src/devices/cpu/hmcs40/hmcs40.h b/src/devices/cpu/hmcs40/hmcs40.h
index 4da14642ed9..a19161f5dcf 100644
--- a/src/devices/cpu/hmcs40/hmcs40.h
+++ b/src/devices/cpu/hmcs40/hmcs40.h
@@ -81,18 +81,6 @@ enum
class hmcs40_cpu_device : public cpu_device
{
public:
- enum
- {
- PORT_R0X = 0,
- PORT_R1X,
- PORT_R2X,
- PORT_R3X,
- PORT_R4X,
- PORT_R5X,
- PORT_R6X,
- PORT_R7X
- };
-
// max 8 4-bit R ports
template <std::size_t Bit> auto read_r() { return m_read_r[Bit].bind(); }
template <std::size_t Bit> auto write_r() { return m_write_r[Bit].bind(); }
diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp
index 2a1d36b3c20..73069a313b6 100644
--- a/src/mame/drivers/hh_hmcs40.cpp
+++ b/src/mame/drivers/hh_hmcs40.cpp
@@ -258,7 +258,7 @@ public:
WRITE8_MEMBER(bambball_state::plate_w)
{
// R1x-R3x(,D0-D3): vfd plate
- int shift = (offset - hmcs40_cpu_device::PORT_R1X) * 4;
+ int shift = (offset - 1) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
@@ -278,7 +278,7 @@ WRITE16_MEMBER(bambball_state::grid_w)
m_grid = data >> 7 & 0x1ff;
// D0-D3: more plates (update display there)
- plate_w(space, 3 + hmcs40_cpu_device::PORT_R1X, data & 0xf);
+ plate_w(space, 3 + 1, data & 0xf);
}
READ8_MEMBER(bambball_state::input_r)
@@ -390,7 +390,7 @@ void bmboxing_state::prepare_display()
WRITE8_MEMBER(bmboxing_state::plate_w)
{
// R1x-R3x: vfd plate
- int shift = (offset - hmcs40_cpu_device::PORT_R1X) * 4;
+ int shift = (offset - 1) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
prepare_display();
}
@@ -1508,7 +1508,7 @@ void machiman_state::prepare_display()
WRITE8_MEMBER(machiman_state::plate_w)
{
// R0x-R3x,R6012: vfd plate
- int shift = (offset == hmcs40_cpu_device::PORT_R6X) ? 16 : offset * 4;
+ int shift = (offset == 6) ? 16 : offset * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
prepare_display();
}
@@ -1616,7 +1616,7 @@ public:
WRITE8_MEMBER(pairmtch_state::plate_w)
{
// R2x,R3x,R6x: vfd plate
- int shift = (offset == hmcs40_cpu_device::PORT_R6X) ? 8 : (offset-2) * 4;
+ int shift = (offset == 6) ? 8 : (offset-2) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
m_display->matrix(m_grid, m_plate);
}
@@ -2071,11 +2071,11 @@ INPUT_CHANGED_MEMBER(cgalaxn_state::player_switch)
WRITE8_MEMBER(cgalaxn_state::grid_w)
{
// R10,R11: input mux
- if (offset == hmcs40_cpu_device::PORT_R1X)
+ if (offset == 1)
m_inp_mux = data & 3;
// R1x-R3x: vfd grid
- int shift = (offset - hmcs40_cpu_device::PORT_R1X) * 4;
+ int shift = (offset - 1) * 4;
m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
prepare_display();
}
@@ -2197,7 +2197,7 @@ public:
WRITE8_MEMBER(cpacman_state::plate_w)
{
// R1x-R6x(,D1,D2): vfd plate
- int shift = (offset - hmcs40_cpu_device::PORT_R1X) * 4;
+ int shift = (offset - 1) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
@@ -2218,7 +2218,7 @@ WRITE16_MEMBER(cpacman_state::grid_w)
m_grid = data >> 5 & 0x7ff;
// D1,D2: plate 8,14 (update display there)
- plate_w(space, 6 + hmcs40_cpu_device::PORT_R1X, data >> 1 & 3);
+ plate_w(space, 6 + 1, data >> 1 & 3);
}
READ8_MEMBER(cpacman_state::input_r)
@@ -2333,7 +2333,7 @@ public:
WRITE8_MEMBER(cmspacmn_state::plate_w)
{
// R1x-R6x(,D0,D1): vfd plate
- int shift = (offset - hmcs40_cpu_device::PORT_R1X) * 4;
+ int shift = (offset - 1) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
@@ -2354,7 +2354,7 @@ WRITE16_MEMBER(cmspacmn_state::grid_w)
m_grid = data >> 5 & 0x7ff;
// D0,D1: more plates (update display there)
- plate_w(space, 6 + hmcs40_cpu_device::PORT_R1X, data & 3);
+ plate_w(space, 6 + 1, data & 3);
}
READ8_MEMBER(cmspacmn_state::input_r)
@@ -2629,7 +2629,7 @@ WRITE16_MEMBER(egalaxn2_state::grid_w)
WRITE8_MEMBER(egalaxn2_state::plate_w)
{
// R1x-R6x: vfd plate
- int shift = (offset - hmcs40_cpu_device::PORT_R1X) * 4;
+ int shift = (offset - 1) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
prepare_display();
}
@@ -3551,7 +3551,7 @@ void mwcbaseb_state::prepare_display()
WRITE8_MEMBER(mwcbaseb_state::plate_w)
{
// R1x-R3x,R6x: vfd plate
- int shift = (offset == hmcs40_cpu_device::PORT_R6X) ? 12 : (offset - hmcs40_cpu_device::PORT_R1X) * 4;
+ int shift = (offset == 6) ? 12 : (offset - 1) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
prepare_display();
}
@@ -4205,7 +4205,7 @@ public:
WRITE8_MEMBER(vinvader_state::plate_w)
{
// R1x-R3x(,D4-D6): vfd plate
- int shift = (offset - hmcs40_cpu_device::PORT_R1X) * 4;
+ int shift = (offset - 1) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
@@ -4222,7 +4222,7 @@ WRITE16_MEMBER(vinvader_state::grid_w)
m_grid = data >> 7 & 0x1ff;
// D4-D6: more plates (update display there)
- plate_w(space, 3 + hmcs40_cpu_device::PORT_R1X, data >> 4 & 7);
+ plate_w(space, 3 + 1, data >> 4 & 7);
}
// config
diff --git a/src/mame/machine/alpha8201.cpp b/src/mame/machine/alpha8201.cpp
index 5e517ed4596..9fab19b218b 100644
--- a/src/mame/machine/alpha8201.cpp
+++ b/src/mame/machine/alpha8201.cpp
@@ -368,7 +368,7 @@ READ8_MEMBER(alpha_8201_device::mcu_data_r)
else
logerror("%s: MCU side invalid read\n", tag());
- if (offset == hmcs40_cpu_device::PORT_R0X)
+ if (offset == 0)
ret >>= 4;
return ret & 0xf;
}