mirror of
https://github.com/holub/mame
synced 2025-05-28 16:43:04 +03:00
Revert most of previous fix, instead change VIA6522 to work better. (nw)
This commit is contained in:
parent
0ffeb44f0f
commit
99d385880c
@ -39,8 +39,8 @@
|
||||
#define LOG_READ (1U << 3)
|
||||
#define LOG_INT (1U << 4)
|
||||
|
||||
//#define VERBOSE (LOG_SHIFT|LOG_SETUP|LOG_READ)
|
||||
//#define LOG_OUTPUT_FUNC printf
|
||||
#define VERBOSE (LOG_SHIFT)
|
||||
#define LOG_OUTPUT_FUNC printf
|
||||
|
||||
#include "logmacro.h"
|
||||
|
||||
@ -675,7 +675,7 @@ READ8_MEMBER( via6522_device::read )
|
||||
val = m_sr;
|
||||
m_out_cb1 = 1;
|
||||
m_cb1_handler(m_out_cb1);
|
||||
m_shift_counter = 8;
|
||||
m_shift_counter = 7;
|
||||
clear_int(INT_SR);
|
||||
LOGSHIFT("ACR: %02x ", m_acr);
|
||||
if (SI_O2_CONTROL(m_acr))
|
||||
@ -861,7 +861,7 @@ WRITE8_MEMBER( via6522_device::write )
|
||||
m_cb1_handler(m_out_cb1);
|
||||
}
|
||||
|
||||
m_shift_counter = 8;
|
||||
m_shift_counter = 7;
|
||||
clear_int(INT_SR);
|
||||
LOGSHIFT(" - ACR is: %02x ", m_acr);
|
||||
if (SO_O2_CONTROL(m_acr))
|
||||
|
@ -1238,17 +1238,10 @@ WRITE_LINE_MEMBER(mac_state::mac_adb_via_out_cb2)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_adb_timer_ticks > 1)
|
||||
{
|
||||
if (state)
|
||||
{
|
||||
m_adb_command |= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_adb_command &= ~1;
|
||||
}
|
||||
}
|
||||
if (state)
|
||||
m_adb_command |= 1;
|
||||
else
|
||||
m_adb_command &= ~1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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", m_adb_command, (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", mac->m_adb_command, (mac->m_adb_command>>2)&3, addr, reg, m_adb_mouseaddr, m_adb_keybaddr);
|
||||
|
||||
if (m_adb_waiting_cmd)
|
||||
{
|
||||
@ -637,21 +637,16 @@ 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;
|
||||
}
|
||||
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) && (m_adb_timer_ticks > 1))
|
||||
if (m_adb_direction)
|
||||
{
|
||||
m_adb_command <<= 1;
|
||||
}
|
||||
@ -668,7 +663,7 @@ TIMER_CALLBACK_MEMBER(mac_state::mac_adb_tick)
|
||||
{
|
||||
adb_talk();
|
||||
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)));
|
||||
}
|
||||
}
|
||||
@ -689,7 +684,7 @@ void mac_state::mac_adb_newaction(int state)
|
||||
#endif
|
||||
|
||||
m_adb_state = state;
|
||||
m_adb_timer_ticks = 9;
|
||||
m_adb_timer_ticks = 8;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
@ -1126,7 +1121,7 @@ void mac_state::adb_vblank()
|
||||
m_adb_waiting_cmd = 1;
|
||||
this->adb_talk();
|
||||
|
||||
m_adb_timer_ticks = 9;
|
||||
m_adb_timer_ticks = 8;
|
||||
this->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
|
||||
}
|
||||
#if 0
|
||||
@ -1163,7 +1158,7 @@ void mac_state::adb_vblank()
|
||||
m_adb_waiting_cmd = 1;
|
||||
this->adb_talk();
|
||||
|
||||
m_adb_timer_ticks = 9;
|
||||
m_adb_timer_ticks = 8;
|
||||
this->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
|
||||
}
|
||||
#if 0
|
||||
|
Loading…
Reference in New Issue
Block a user