From 8d3f76a569932265d4d7e69355d4968a7b265d9f Mon Sep 17 00:00:00 2001 From: goldnchild <48141308+goldnchild@users.noreply.github.com> Date: Fri, 1 Jul 2022 09:03:47 -0700 Subject: [PATCH] nld_dm9314.cpp: add RS mode to netlist 9314 (#10016) --- src/lib/netlist/devices/nld_dm9314.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/netlist/devices/nld_dm9314.cpp b/src/lib/netlist/devices/nld_dm9314.cpp index edb789dda64..e8241af09de 100644 --- a/src/lib/netlist/devices/nld_dm9314.cpp +++ b/src/lib/netlist/devices/nld_dm9314.cpp @@ -64,7 +64,19 @@ namespace netlist::devices { if (m_SQ[i]()) { /* R-S Mode */ - // FIXME: R-S mode is not yet implemented! + // RS mode is just an "extension of regular D mode" + // The way RS mode works is that D and S bar go high (keeps old value) + // S bar going low sets output high + // D going low and S bar high sets output low + // S bar going low AND D going low sets output low (D takes precedence) + if (!m_EQ()) + { + if (!m_D[i]()) // if D low and SQ high we clear the bit + { + m_last_Q &= ~(1 << i); + m_Q[i].push((m_last_Q & (1<>i, delay); + } + } } else {