diff options
Diffstat (limited to 'src/devices/machine/tms1024.cpp')
-rw-r--r-- | src/devices/machine/tms1024.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/devices/machine/tms1024.cpp b/src/devices/machine/tms1024.cpp index 7c509b03c3d..b283c20893c 100644 --- a/src/devices/machine/tms1024.cpp +++ b/src/devices/machine/tms1024.cpp @@ -8,14 +8,13 @@ is available for pin-compatible Mitsubishi M50780SP/M50781SP. Other than more port pins, TMS1025 is assumed to be same as TMS1024. - TODO: - - x - */ #include "emu.h" #include "machine/tms1024.h" +#define VERBOSE 0 +#include "logmacro.h" DEFINE_DEVICE_TYPE(TMS1024, tms1024_device, "tms1024", "TMS1024 I/O Expander") DEFINE_DEVICE_TYPE(TMS1025, tms1025_device, "tms1025", "TMS1025 I/O Expander") @@ -27,7 +26,7 @@ DEFINE_DEVICE_TYPE(TMS1025, tms1025_device, "tms1025", "TMS1025 I/O Expander") tms1024_device::tms1024_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, type, tag, owner, clock) , m_h(0), m_s(0), m_std(0), m_ms(0) - , m_read_port(*this) + , m_read_port(*this, 0) , m_write_port(*this) { } @@ -50,10 +49,6 @@ tms1025_device::tms1025_device(const machine_config &mconfig, const char *tag, d void tms1024_device::device_start() { - // resolve callbacks (there is no port 0) - m_read_port.resolve_all_safe(0); - m_write_port.resolve_all_safe(); - // register for savestates save_item(NAME(m_h)); save_item(NAME(m_s)); @@ -79,7 +74,10 @@ u8 tms1024_device::read_h() { // read selected port data if (m_s != 0) + { m_h = (m_read_port[m_s-1])((offs_t)(m_s-1)) & 0xf; + LOG("%s: Read %d%d%d%d from P%d\n", machine().describe_context(), BIT(m_h, 3), BIT(m_h, 2), BIT(m_h, 1), BIT(m_h, 0), m_s); + } // high-impedance otherwise } @@ -101,11 +99,15 @@ void tms1024_device::write_std(int state) if (m_ms && !state && m_std) { if (m_s != 0) + { + LOG("%s: Write %d%d%d%d to P%d\n", machine().describe_context(), BIT(m_h, 3), BIT(m_h, 2), BIT(m_h, 1), BIT(m_h, 0), m_s); (m_write_port[m_s-1])((offs_t)(m_s-1), m_h); + } else { // reset all ports + LOG("%s: Reset all ports\n", machine().describe_context()); for (int i = PORT1; i <= PORT7; i++) (m_write_port[i])(offs_t(i), 0); } |