(MESS) 64h156: Return of the weak bits. (nw)

This commit is contained in:
Curt Coder 2014-02-03 22:15:14 +00:00
parent fd643e41b2
commit 54797825ba
2 changed files with 19 additions and 1 deletions

View File

@ -87,7 +87,19 @@ inline void c64h156_device::receive_bit()
m_bit_sync = (m_edge.is_never() || m_edge >= next) ? 0 : 1;
if (m_bit_sync) {
m_zero_count = 0;
m_cycles_until_random_flux = (rand() % 31) + 289;
get_next_edge(when);
} else {
m_zero_count++;
}
if (m_zero_count >= m_cycles_until_random_flux) {
m_bit_sync = 1;
m_zero_count = 0;
m_cycles_until_random_flux = (rand() % 367) + 33;
}
}
@ -311,7 +323,9 @@ c64h156_device::c64h156_device(const machine_config &mconfig, const char *tag, d
m_u4a(0),
m_u4b(0),
m_ue3(0),
m_uc1b(0)
m_uc1b(0),
m_zero_count(0),
m_cycles_until_random_flux(0)
{
}
@ -357,6 +371,8 @@ void c64h156_device::device_start()
save_item(NAME(m_uc1b));
save_item(NAME(m_via_pa));
save_item(NAME(m_ud3));
save_item(NAME(m_zero_count));
save_item(NAME(m_cycles_until_random_flux));
}

View File

@ -177,6 +177,8 @@ private:
int m_u4b;
int m_ue3;
int m_uc1b;
int m_zero_count;
int m_cycles_until_random_flux;
// write logic
UINT8 m_via_pa;