summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/mcs51/mcs51.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
committer Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
commit97b67170277437131adf6ed4d60139c172529e4f (patch)
tree7a5cbf608f191075f1612b1af15832c206a3fe2d /src/devices/cpu/mcs51/mcs51.cpp
parentb380514764cf857469bae61c11143a19f79a74c5 (diff)
(nw) Clean up the mess on master
This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
Diffstat (limited to 'src/devices/cpu/mcs51/mcs51.cpp')
-rw-r--r--src/devices/cpu/mcs51/mcs51.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/devices/cpu/mcs51/mcs51.cpp b/src/devices/cpu/mcs51/mcs51.cpp
index 60d39a25139..c307c19a611 100644
--- a/src/devices/cpu/mcs51/mcs51.cpp
+++ b/src/devices/cpu/mcs51/mcs51.cpp
@@ -874,6 +874,8 @@ uint8_t mcs51_cpu_device::bit_address_r(uint8_t offset)
int distance; /* distance between bit addressable words */
/* 1 for normal bits, 8 for sfr bit addresses */
+ m_last_bit = offset;
+
//User defined bit addresses 0x20-0x2f (values are 0x0-0x7f)
if (offset < 0x80) {
distance = 1;
@@ -1358,6 +1360,8 @@ void mcs51_cpu_device::execute_op(uint8_t op)
m_recalc_parity = 0;
}
+ m_last_op = op;
+
switch( op )
{
case 0x00: nop(op); break; //NOP
@@ -1777,6 +1781,10 @@ void mcs51_cpu_device::check_irqs()
return;
}
+ // Hack to work around polling latency issue with JB INT0/INT1
+ if (m_last_op == 0x20 && ((int_vec == V_IE0 && m_last_bit == 0xb2) || (int_vec == V_IE1 && m_last_bit == 0xb3)))
+ PC = PPC + 3;
+
//Save current pc to stack, set pc to new interrupt vector
push_pc();
PC = int_vec;
@@ -2126,6 +2134,8 @@ void mcs51_cpu_device::device_start()
save_item(NAME(m_ppc));
save_item(NAME(m_pc));
+ save_item(NAME(m_last_op));
+ save_item(NAME(m_last_bit));
save_item(NAME(m_rwm) );
save_item(NAME(m_cur_irq_prio) );
save_item(NAME(m_last_line_state) );
@@ -2213,6 +2223,8 @@ void mcs51_cpu_device::device_reset()
/* Flag as NO IRQ in Progress */
m_irq_active = 0;
m_cur_irq_prio = -1;
+ m_last_op = 0;
+ m_last_bit = 0;
/* these are all defined reset states */
PC = 0;