summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2017-04-19 22:43:05 -0400
committer arbee <rb6502@users.noreply.github.com>2017-04-19 22:43:05 -0400
commit055ba7142687aea835019bf05032fa999dfd435a (patch)
tree2779987444e7e9391f3a1f8c22882bb2d4dff210 /src/mame
parent61eba47cfbc63882ad15465908e664c39ea72647 (diff)
mac: fix major 0.183 regression in Mac II series [R. Belmont]
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/machine/mac.cpp15
-rw-r--r--src/mame/machine/macadb.cpp27
2 files changed, 27 insertions, 15 deletions
diff --git a/src/mame/machine/mac.cpp b/src/mame/machine/mac.cpp
index 43cac6789cf..8e3bc092fa3 100644
--- a/src/mame/machine/mac.cpp
+++ b/src/mame/machine/mac.cpp
@@ -1238,10 +1238,17 @@ WRITE_LINE_MEMBER(mac_state::mac_adb_via_out_cb2)
}
else
{
- if (state)
- m_adb_command |= 1;
- else
- m_adb_command &= ~1;
+ if (m_adb_timer_ticks > 1)
+ {
+ if (state)
+ {
+ m_adb_command |= 1;
+ }
+ else
+ {
+ m_adb_command &= ~1;
+ }
+ }
}
}
diff --git a/src/mame/machine/macadb.cpp b/src/mame/machine/macadb.cpp
index a3f81e3a6b4..49bc23b8762 100644
--- a/src/mame/machine/macadb.cpp
+++ b/src/mame/machine/macadb.cpp
@@ -283,7 +283,7 @@ void mac_state::adb_talk()
addr = (m_adb_command>>4);
reg = (m_adb_command & 3);
-// printf("Mac sent %x (cmd %d addr %d reg %d mr %d kr %d)\n", mac->m_adb_command, (mac->m_adb_command>>2)&3, addr, reg, m_adb_mouseaddr, m_adb_keybaddr);
+ //printf("Mac sent %x (cmd %d addr %d reg %d mr %d kr %d)\n", m_adb_command, (m_adb_command>>2)&3, addr, reg, m_adb_mouseaddr, m_adb_keybaddr);
if (m_adb_waiting_cmd)
{
@@ -637,19 +637,24 @@ TIMER_CALLBACK_MEMBER(mac_state::mac_adb_tick)
}
else
{
+ // for input to Mac, the VIA reads on the *other* clock edge, so update this here
+ if (!m_adb_direction)
+ {
+ m_via1->write_cb2((m_adb_send & 0x80)>>7);
+ if (m_adb_timer_ticks != 9)
+ {
+ m_adb_send <<= 1;
+ }
+ }
+
// do one clock transition on CB1 to advance the VIA shifter
m_adb_extclock ^= 1;
m_via1->write_cb1(m_adb_extclock);
- if (m_adb_direction)
+ if ((m_adb_direction) && (m_adb_timer_ticks > 1))
{
m_adb_command <<= 1;
}
- else
- {
- m_via1->write_cb2((m_adb_send & 0x80)>>7);
- m_adb_send <<= 1;
- }
m_adb_extclock ^= 1;
m_via1->write_cb1(m_adb_extclock);
@@ -663,7 +668,7 @@ TIMER_CALLBACK_MEMBER(mac_state::mac_adb_tick)
{
adb_talk();
if((m_adb_last_talk == 2) && m_adb_datasize) {
- m_adb_timer_ticks = 8;
+ m_adb_timer_ticks = 9;
m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
}
}
@@ -684,7 +689,7 @@ void mac_state::mac_adb_newaction(int state)
#endif
m_adb_state = state;
- m_adb_timer_ticks = 8;
+ m_adb_timer_ticks = 9;
switch (state)
{
@@ -1121,7 +1126,7 @@ void mac_state::adb_vblank()
m_adb_waiting_cmd = 1;
this->adb_talk();
- m_adb_timer_ticks = 8;
+ m_adb_timer_ticks = 9;
this->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
}
#if 0
@@ -1158,7 +1163,7 @@ void mac_state::adb_vblank()
m_adb_waiting_cmd = 1;
this->adb_talk();
- m_adb_timer_ticks = 8;
+ m_adb_timer_ticks = 9;
this->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
}
#if 0