diff options
author | MetalliC <0vetal0@gmail.com> | 2020-08-14 22:18:36 +0300 |
---|---|---|
committer | MetalliC <0vetal0@gmail.com> | 2020-08-14 22:18:36 +0300 |
commit | 8cba504bb7e4c027fcdb4a26904471121e2adfc4 (patch) | |
tree | 7f22397ae58a7ae4b1b9b329e04263b1ef6e752c /src/mame/machine | |
parent | a7f7fb9e6a7763320210e9938cd5867b894c6926 (diff) |
midvunit.cpp: crusnwld uses newer type PIC
midwayic.cpp: remove few unneeded HLE hacks, add debugger access guards
Diffstat (limited to 'src/mame/machine')
-rw-r--r-- | src/mame/machine/midwayic.cpp | 46 | ||||
-rw-r--r-- | src/mame/machine/midwayic.h | 1 |
2 files changed, 23 insertions, 24 deletions
diff --git a/src/mame/machine/midwayic.cpp b/src/mame/machine/midwayic.cpp index fbc3383a01e..8045c6cb69c 100644 --- a/src/mame/machine/midwayic.cpp +++ b/src/mame/machine/midwayic.cpp @@ -107,11 +107,6 @@ void midway_serial_pic_device::generate_serial_data(int upper) m_data[0] = temp & 0xff; m_data[1] = (temp >> 8) & 0xff; m_data[2] = (temp >> 16) & 0xff; - - /* special hack for RevX */ - m_ormask = 0x80; - if (upper == 419) - m_ormask = 0x00; } @@ -130,7 +125,6 @@ void midway_serial_pic_device::serial_register_state() save_item(NAME(m_idx)); save_item(NAME(m_status)); save_item(NAME(m_bits)); - save_item(NAME(m_ormask)); } DEFINE_DEVICE_TYPE(MIDWAY_SERIAL_PIC, midway_serial_pic_device, "midway_serial_pic_sim", "Midway Serial PIC Simulation") @@ -152,8 +146,7 @@ midway_serial_pic_device::midway_serial_pic_device(const machine_config &mconfig m_buff(0), m_idx(0), m_status(0), - m_bits(0), - m_ormask(0) + m_bits(0) { memset(m_data,0,sizeof(m_data)); } @@ -191,8 +184,11 @@ u8 midway_serial_pic_device::status_r() u8 midway_serial_pic_device::read() { - logerror("%s:security R = %04X\n", machine().describe_context(), m_buff); - m_status = 1; + if (!machine().side_effects_disabled()) + { + logerror("%s:security R = %04X\n", machine().describe_context(), m_buff); + m_status = 1; + } return m_buff; } @@ -208,9 +204,8 @@ void midway_serial_pic_device::write(u8 data) if (!m_status) { /* the self-test writes 1F, 0F, and expects to read an F in the low 4 bits */ - /* Cruis'n World expects the high bit to be set as well */ if (data & 0x0f) - m_buff = m_ormask | data; + m_buff = data & 0xf; else m_buff = m_data[m_idx++ % sizeof(m_data)]; } @@ -409,17 +404,20 @@ u8 midway_serial_pic2_device::status_r() { uint8_t result = 0; - /* if we're still holding the data ready bit high, do it */ - if (m_latch & 0xf00) + if (!machine().side_effects_disabled()) { - if (machine().time() > m_latch_expire_time) - m_latch &= 0xff; - else - m_latch -= 0x100; - result = 1; - } + /* if we're still holding the data ready bit high, do it */ + if (m_latch & 0xf00) + { + if (machine().time() > m_latch_expire_time) + m_latch &= 0xff; + else + m_latch -= 0x100; + result = 1; + } - logerror("%s:PIC status %d\n", machine().describe_context(), result); + logerror("%s:PIC status %d\n", machine().describe_context(), result); + } return result; } @@ -429,7 +427,8 @@ u8 midway_serial_pic2_device::read() uint8_t result = 0; /* PIC data register */ - logerror("%s:PIC data read (index=%d total=%d latch=%03X) =", machine().describe_context(), m_index, m_total, m_latch); + if (!machine().side_effects_disabled()) + logerror("%s:PIC data read (index=%d total=%d latch=%03X) =", machine().describe_context(), m_index, m_total, m_latch); /* return the current result */ if (m_latch & 0xf00) @@ -439,7 +438,8 @@ u8 midway_serial_pic2_device::read() else if (m_index < m_total) result = 0xff; - logerror("%02X\n", result); + if (!machine().side_effects_disabled()) + logerror("%02X\n", result); return result; } diff --git a/src/mame/machine/midwayic.h b/src/mame/machine/midwayic.h index e231bdd5674..a10988714b0 100644 --- a/src/mame/machine/midwayic.h +++ b/src/mame/machine/midwayic.h @@ -51,7 +51,6 @@ private: uint8_t m_idx; uint8_t m_status; uint8_t m_bits; - uint8_t m_ormask; }; |