summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2015-02-08 17:17:52 +0100
committer hap <happppp@users.noreply.github.com>2015-02-08 17:17:52 +0100
commit881345d294bd781aaa0c34e233f9ca8006f3d645 (patch)
tree9acee232203fab243a14ab1d9ce473cb2191dce4
parent713a4de6e80576ab7c5a7810cbdafa6489a11baa (diff)
added simple display output
-rw-r--r--src/mess/drivers/tmtennis.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/mess/drivers/tmtennis.c b/src/mess/drivers/tmtennis.c
index 76409aae71e..735d513e380 100644
--- a/src/mess/drivers/tmtennis.c
+++ b/src/mess/drivers/tmtennis.c
@@ -45,6 +45,9 @@ public:
DECLARE_WRITE8_MEMBER(plate_w);
DECLARE_WRITE8_MEMBER(grid_w);
+ UINT16 m_vfd_state[0x10];
+ void update_vfd();
+
virtual void machine_start();
};
@@ -52,6 +55,27 @@ public:
/***************************************************************************
+ Display
+
+***************************************************************************/
+
+void tmtennis_state::update_vfd()
+{
+ for (int i = 0; i < 12; i++)
+ if (m_grid & (1 << i) && m_vfd_state[i] != m_plate)
+ {
+ // on difference, send to output
+ for (int j = 0; j < 12; j++)
+ output_set_lamp_value(i*100 + j, m_plate >> j & 1);
+
+ m_vfd_state[i] = m_plate;
+ }
+}
+
+
+
+/***************************************************************************
+
I/O
***************************************************************************/
@@ -84,6 +108,8 @@ WRITE8_MEMBER(tmtennis_state::plate_w)
if (offset == NEC_UCOM4_PORTF) offset--;
int shift = (offset - NEC_UCOM4_PORTC) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
+
+ update_vfd();
}
WRITE8_MEMBER(tmtennis_state::grid_w)
@@ -91,6 +117,8 @@ WRITE8_MEMBER(tmtennis_state::grid_w)
// port G/H/I: vfd matrix grid
int shift = (offset - NEC_UCOM4_PORTG) * 4;
m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
+
+ update_vfd();
}
@@ -133,11 +161,13 @@ INPUT_PORTS_END
void tmtennis_state::machine_start()
{
// zerofill
+ memset(m_vfd_state, 0, sizeof(m_vfd_state));
m_input_mux = 0;
m_plate = 0;
m_grid = 0;
// register for savestates
+ save_item(NAME(m_vfd_state));
save_item(NAME(m_input_mux));
save_item(NAME(m_plate));
save_item(NAME(m_grid));