summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ti99/internal/datamux.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/ti99/internal/datamux.cpp')
-rw-r--r--src/devices/bus/ti99/internal/datamux.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/devices/bus/ti99/internal/datamux.cpp b/src/devices/bus/ti99/internal/datamux.cpp
index d56d8573822..d87b2df75e6 100644
--- a/src/devices/bus/ti99/internal/datamux.cpp
+++ b/src/devices/bus/ti99/internal/datamux.cpp
@@ -72,13 +72,13 @@
#include "datamux.h"
#include "cpu/tms9900/tms99com.h"
-#define LOG_WARN (1U<<1) // Warnings
-#define LOG_READY (1U<<2) // READY line
-#define LOG_ACCESS (1U<<3) // Access to this GROM
-#define LOG_ADDRESS (1U<<4) // Address register
-#define LOG_WAITCOUNT (1U<<5) // Wait state counter
+#define LOG_WARN (1U << 1) // Warnings
+#define LOG_READY (1U << 2) // READY line
+#define LOG_ACCESS (1U << 3) // Access to this GROM
+#define LOG_ADDRESS (1U << 4) // Address register
+#define LOG_WAITCOUNT (1U << 5) // Wait state counter
-#define VERBOSE ( LOG_GENERAL | LOG_WARN )
+#define VERBOSE (LOG_GENERAL | LOG_WARN)
#include "logmacro.h"
@@ -101,6 +101,7 @@ datamux_device::datamux_device(const machine_config &mconfig, const char *tag, d
m_grom0(*owner, TI99_GROM0_TAG),
m_grom1(*owner, TI99_GROM1_TAG),
m_grom2(*owner, TI99_GROM2_TAG),
+ m_tms9901(*owner, TI99_TMS9901_TAG),
m_ready(*this),
m_addr_buf(0),
m_dbin(CLEAR_LINE),
@@ -436,6 +437,10 @@ void datamux_device::setaddress(offs_t offset, uint16_t busctrl)
LOGMASKED(LOG_ADDRESS, "Set address %04x\n", m_addr_buf);
+ // Trigger the TMS9901 clock when A10 is 1
+ if ((m_addr_buf & 0x0020) != 0)
+ m_tms9901->update_clock();
+
if ((m_addr_buf & 0xe000) == 0x0000)
{
return; // console ROM
@@ -476,7 +481,7 @@ void datamux_device::setaddress(offs_t offset, uint16_t busctrl)
The datamux is connected to the clock line in order to operate
the wait state counter and to read/write the bytes.
*/
-WRITE_LINE_MEMBER( datamux_device::clock_in )
+void datamux_device::clock_in(int state)
{
// return immediately if the datamux is currently inactive
if (m_waitcount>0)
@@ -543,7 +548,7 @@ void datamux_device::ready_join()
m_ready((m_sysready==CLEAR_LINE || m_muxready==CLEAR_LINE)? CLEAR_LINE : ASSERT_LINE);
}
-WRITE_LINE_MEMBER( datamux_device::ready_line )
+void datamux_device::ready_line(int state)
{
if (state != m_sysready) LOGMASKED(LOG_READY, "READY line from PBox = %d\n", state);
m_sysready = (line_state)state;
@@ -552,7 +557,7 @@ WRITE_LINE_MEMBER( datamux_device::ready_line )
}
/* Called from VDP via console. */
-WRITE_LINE_MEMBER( datamux_device::gromclk_in )
+void datamux_device::gromclk_in(int state)
{
// Don't propagate the clock in idle phase
if (m_grom_idle) return;
@@ -576,10 +581,9 @@ WRITE_LINE_MEMBER( datamux_device::gromclk_in )
DEVICE LIFECYCLE FUNCTIONS
***************************************************************************/
-void datamux_device::device_start(void)
+void datamux_device::device_start()
{
m_muxready = ASSERT_LINE;
- m_ready.resolve();
// Register persistable state variables
save_item(NAME(m_addr_buf));
@@ -594,11 +598,11 @@ void datamux_device::device_start(void)
save_item(NAME(m_grom_idle));
}
-void datamux_device::device_stop(void)
+void datamux_device::device_stop()
{
}
-void datamux_device::device_reset(void)
+void datamux_device::device_reset()
{
m_consolerom = (uint16_t*)owner()->memregion(TI99_CONSOLEROM)->base();
m_use32k = (ioport("RAM")->read()==1);