New fixes fizzled out, back to the uglier set. (nw)

This commit is contained in:
arbee 2017-04-22 23:28:47 -04:00
parent dac6dc4f62
commit 13473bbd4c
2 changed files with 28 additions and 23 deletions

View File

@ -1238,10 +1238,17 @@ WRITE_LINE_MEMBER(mac_state::mac_adb_via_out_cb2)
} }
else else
{ {
if (state) if (m_adb_timer_ticks > 1)
m_adb_command |= 1; {
else if (state)
m_adb_command &= ~1; {
m_adb_command |= 1;
}
else
{
m_adb_command &= ~1;
}
}
} }
} }

View File

@ -637,18 +637,26 @@ TIMER_CALLBACK_MEMBER(mac_state::mac_adb_tick)
} }
else else
{ {
// for input to Mac, the VIA reads on the *other* clock edge, so update this here
if (!m_adb_direction) if (!m_adb_direction)
{ {
m_via1->write_cb2((m_adb_send & 0x80)>>7); m_via1->write_cb2((m_adb_send & 0x80)>>7);
m_adb_send <<= 1; if (m_adb_timer_ticks != 9)
{
m_adb_send <<= 1;
}
} }
else
// 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) && (m_adb_timer_ticks > 1))
{ {
m_adb_command <<= 1; m_adb_command <<= 1;
} }
// do one clock transition on CB1 to advance the VIA shifter m_adb_extclock ^= 1;
m_via1->write_cb1(m_adb_extclock ^ 1);
m_via1->write_cb1(m_adb_extclock); m_via1->write_cb1(m_adb_extclock);
m_adb_timer_ticks--; m_adb_timer_ticks--;
@ -659,9 +667,8 @@ TIMER_CALLBACK_MEMBER(mac_state::mac_adb_tick)
if ((m_adb_direction) && (ADB_IS_BITBANG_CLASS)) if ((m_adb_direction) && (ADB_IS_BITBANG_CLASS))
{ {
adb_talk(); adb_talk();
if((m_adb_last_talk == 2) && m_adb_datasize) if((m_adb_last_talk == 2) && m_adb_datasize) {
{ m_adb_timer_ticks = 9;
m_adb_timer_ticks = 8;
m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100))); m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
} }
} }
@ -682,7 +689,7 @@ void mac_state::mac_adb_newaction(int state)
#endif #endif
m_adb_state = state; m_adb_state = state;
m_adb_timer_ticks = 8; m_adb_timer_ticks = 9;
switch (state) switch (state)
{ {
@ -691,8 +698,6 @@ void mac_state::mac_adb_newaction(int state)
m_adb_direction = 1; // Mac is shifting us a command m_adb_direction = 1; // Mac is shifting us a command
m_adb_waiting_cmd = 1; // we're going to get a command m_adb_waiting_cmd = 1; // we're going to get a command
m_adb_irq_pending = 0; 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))); m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
break; break;
@ -709,9 +714,6 @@ void mac_state::mac_adb_newaction(int state)
m_adb_send = m_adb_buffer[0]; m_adb_send = m_adb_buffer[0];
m_adb_datasize--; 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 // move down the rest of the buffer, if any
for (i = 0; i < m_adb_datasize; i++) for (i = 0; i < m_adb_datasize; i++)
{ {
@ -1124,9 +1126,7 @@ void mac_state::adb_vblank()
m_adb_waiting_cmd = 1; m_adb_waiting_cmd = 1;
this->adb_talk(); this->adb_talk();
m_adb_timer_ticks = 8; m_adb_timer_ticks = 9;
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))); this->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
} }
#if 0 #if 0
@ -1163,9 +1163,7 @@ void mac_state::adb_vblank()
m_adb_waiting_cmd = 1; m_adb_waiting_cmd = 1;
this->adb_talk(); this->adb_talk();
m_adb_timer_ticks = 8; m_adb_timer_ticks = 9;
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))); this->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
} }
#if 0 #if 0