From 1fd9e57af253c9f04dd63cd584460d48c23f4810 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Tue, 10 Jan 2017 23:08:26 +0200 Subject: [PATCH] newbrain: Decoded VFD bitstream, and added simultaneous video and VFD display. [Curt Coder] --- src/mame/drivers/newbrain.cpp | 18 +++++++++------ src/mame/layout/newbrain.lay | 41 ++++++++++++++++------------------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/mame/drivers/newbrain.cpp b/src/mame/drivers/newbrain.cpp index 48a5be36ac9..584cbaec106 100644 --- a/src/mame/drivers/newbrain.cpp +++ b/src/mame/drivers/newbrain.cpp @@ -31,7 +31,7 @@ TODO: - - VFD + - VFD does not receive data from main CPU - bitmapped video - accurate video timing - cassette @@ -492,9 +492,15 @@ WRITE8_MEMBER( newbrain_state::cop_d_w ) m_403_q = m_403_d; } else { m_403_q = 0xf; - output().set_digit_value(m_405_q & 0x0f, m_402_q); - + if (LOG_COP) logerror("%s %s keydata disabled\n", machine().time().as_string(), machine().describe_context()); + + // COP to VFD serial format, bits 15..0 + // A B J I x H G2 C x F G1 E K L M D + uint16_t value = BITSWAP16(m_402_q, 11, 7, 1, 13, 10, 3, 2, 12, 9, 5, 6, 4, 0, 8, 14, 15) & 0x3fff; + output().set_digit_value(m_405_q & 0x0f, value); + + if (LOG_VFD) logerror("%s %s vfd segment %u 402.Q %04x data %04x\n", machine().time().as_string(), machine().describe_context(), m_405_q & 0x0f, m_402_q, value); } m_cop_k6 = k6; @@ -524,10 +530,8 @@ WRITE_LINE_MEMBER( newbrain_state::k2_w ) if (state) { - m_402_q >>= 1; - m_402_q = (m_cop_so << 15) | (m_402_q & 0x7fff); - - if (LOG_VFD) logerror("%s %s SEGMENT %04x\n", machine().time().as_string(), machine().describe_context(), m_402_q); + m_402_q <<= 1; + m_402_q = (m_402_q & 0xfffe) | m_cop_so; } } diff --git a/src/mame/layout/newbrain.lay b/src/mame/layout/newbrain.lay index 9fb6f688033..a5d8213b70e 100644 --- a/src/mame/layout/newbrain.lay +++ b/src/mame/layout/newbrain.lay @@ -1,65 +1,62 @@ - + - + - + - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +