diff options
Diffstat (limited to 'src/mame/machine/macadb.cpp')
-rw-r--r-- | src/mame/machine/macadb.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mame/machine/macadb.cpp b/src/mame/machine/macadb.cpp index 0d61c247bda..f2d7fe357a9 100644 --- a/src/mame/machine/macadb.cpp +++ b/src/mame/machine/macadb.cpp @@ -26,12 +26,12 @@ static constexpr int32_t ADB_STATE_NOTINIT = 4; static constexpr int ADB_CMD_RESET = 0; static constexpr int ADB_CMD_FLUSH = 1; -// use 1 MHz base to get microseconds -static constexpr int adb_timebase = 1000000; +// use 1 MHz base to get microseconds (hack: *2 to get old wrong HC05 numbers to all realign to reality) +static constexpr int adb_timebase = 2000000; static constexpr int adb_short = 85; static constexpr int adb_long = 157; -static constexpr int adb_srq = ((85+157)*3); +static constexpr int adb_srq = ((85+157)*4); // ADB line states enum @@ -229,6 +229,7 @@ void macadb_device::device_start() m_adb_listenreg = 0; m_adb_listenaddr = 0; m_adb_stream_ptr = 0; + m_adb_linein = 0; std::fill(std::begin(m_adb_keybuf), std::end(m_adb_keybuf), 0); std::fill(std::begin(m_adb_pram), std::end(m_adb_pram), 0); @@ -262,6 +263,7 @@ void macadb_device::device_start() save_item(NAME(m_adb_currentkeys)); save_item(NAME(m_adb_modifiers)); save_item(NAME(m_adb_pram)); + save_item(NAME(m_adb_linein)); } WRITE_LINE_MEMBER(macadb_device::adb_data_w) @@ -1024,7 +1026,7 @@ void macadb_device::device_reset() WRITE_LINE_MEMBER(macadb_device::adb_linechange_w) { - /* static char const *const states[] = +/* static char const *const states[] = { "idle", "attention", @@ -1042,10 +1044,16 @@ WRITE_LINE_MEMBER(macadb_device::adb_linechange_w) "srqnodata" };*/ + if (state == m_adb_linein) + { + return; + } + m_adb_linein = state; + int dtime = (int)(machine().time().as_ticks(adb_timebase) - m_last_adb_time); m_last_adb_time = machine().time().as_ticks(adb_timebase); - /*if (m_adb_linestate <= 12) +/* if (m_adb_linestate <= 12) { printf("linechange: %d -> %d, time %d (state %d = %s)\n", state^1, state, dtime, m_adb_linestate, states[m_adb_linestate]); } @@ -1076,11 +1084,11 @@ WRITE_LINE_MEMBER(macadb_device::adb_linechange_w) case LST_IDLE: if ((state) && (dtime >= 4500)) // reset { - LOGMASKED(LOG_LINESTATE, "ADB RESET\n"); + //printf("ADB RESET\n"); } else if ((state) && (dtime >= 1200)) // attention { - LOGMASKED(LOG_LINESTATE, "ADB ATTENTION\n"); + //printf("ADB ATTENTION\n"); m_adb_waiting_cmd = 1; m_adb_direction = 0; m_adb_linestate++; @@ -1090,7 +1098,7 @@ WRITE_LINE_MEMBER(macadb_device::adb_linechange_w) case LST_ATTENTION: if ((!state) && (dtime >= 90)) // Tsync { - LOGMASKED(LOG_LINESTATE, "ADB Tsync\n"); + //printf("ADB Tsync\n"); m_adb_command = 0; m_adb_linestate++; } |