summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2017-04-20 23:02:58 -0400
committer arbee <rb6502@users.noreply.github.com>2017-04-20 23:02:58 -0400
commitbf6d752dc76181f16d00c9a021db6120f0c3d743 (patch)
treeb0b37a43a7177d0e19b139cb1caf1fc9f8339d46 /src/mame
parentd4569e3b994fc872dae002d7abbe0d2b1bd8890e (diff)
cleaner mac fix (nw)
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/machine/macadb.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/mame/machine/macadb.cpp b/src/mame/machine/macadb.cpp
index e661c29ed29..472adc97de2 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)
{
@@ -642,16 +642,13 @@ TIMER_CALLBACK_MEMBER(mac_state::mac_adb_tick)
m_via1->write_cb2((m_adb_send & 0x80)>>7);
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)
+ else
{
m_adb_command <<= 1;
}
-
- m_adb_extclock ^= 1;
+
+ // do one clock transition on CB1 to advance the VIA shifter
+ m_via1->write_cb1(m_adb_extclock ^ 1);
m_via1->write_cb1(m_adb_extclock);
m_adb_timer_ticks--;
@@ -662,7 +659,8 @@ TIMER_CALLBACK_MEMBER(mac_state::mac_adb_tick)
if ((m_adb_direction) && (ADB_IS_BITBANG_CLASS))
{
adb_talk();
- if((m_adb_last_talk == 2) && m_adb_datasize) {
+ if((m_adb_last_talk == 2) && m_adb_datasize)
+ {
m_adb_timer_ticks = 8;
m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
}
@@ -693,6 +691,8 @@ void mac_state::mac_adb_newaction(int state)
m_adb_direction = 1; // Mac is shifting us a command
m_adb_waiting_cmd = 1; // we're going to get a command
m_adb_irq_pending = 0;
+ m_adb_extclock = 1; // VIA output shifts on falling clock
+ m_via1->write_cb1(m_adb_extclock);
m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
break;
@@ -709,6 +709,9 @@ void mac_state::mac_adb_newaction(int state)
m_adb_send = m_adb_buffer[0];
m_adb_datasize--;
+ m_adb_extclock = 0; // VIA input shifts on rising clock
+ m_via1->write_cb1(m_adb_extclock);
+
// move down the rest of the buffer, if any
for (i = 0; i < m_adb_datasize; i++)
{
@@ -1122,6 +1125,8 @@ void mac_state::adb_vblank()
this->adb_talk();
m_adb_timer_ticks = 8;
+ m_adb_extclock = 0; // VIA input shifts on rising clock
+ m_via1->write_cb1(m_adb_extclock);
this->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
}
#if 0
@@ -1159,6 +1164,8 @@ void mac_state::adb_vblank()
this->adb_talk();
m_adb_timer_ticks = 8;
+ m_adb_extclock = 0; // VIA input shifts on rising clock
+ m_via1->write_cb1(m_adb_extclock);
this->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
}
#if 0