6532riot.c: Made reg_r method debugger friendly. (nw)

This commit is contained in:
Wilbert Pol 2012-10-06 18:15:58 +00:00
parent dd3e7829b7
commit 0f67ea3758
2 changed files with 29 additions and 20 deletions

View File

@ -255,10 +255,10 @@ READ8_DEVICE_HANDLER( riot6532_r )
READ8_MEMBER( riot6532_device::read ) READ8_MEMBER( riot6532_device::read )
{ {
return reg_r(offset); return reg_r(offset, space.debugger_access());
} }
UINT8 riot6532_device::reg_r(UINT8 offset) UINT8 riot6532_device::reg_r(UINT8 offset, bool debugger_access)
{ {
UINT8 val = 0; UINT8 val = 0;
@ -267,9 +267,12 @@ UINT8 riot6532_device::reg_r(UINT8 offset)
{ {
val = m_irqstate; val = m_irqstate;
/* implicitly clears the PA7 flag */ if ( ! debugger_access )
m_irqstate &= ~PA7_FLAG; {
update_irqstate(); /* implicitly clears the PA7 flag */
m_irqstate &= ~PA7_FLAG;
update_irqstate();
}
} }
/* if A2 == 1 and A0 == 0, we are reading the timer */ /* if A2 == 1 and A0 == 0, we are reading the timer */
@ -277,22 +280,25 @@ UINT8 riot6532_device::reg_r(UINT8 offset)
{ {
val = get_timer(); val = get_timer();
/* A3 contains the timer IRQ enable */ if ( ! debugger_access )
if (offset & 8)
{ {
m_irqenable |= TIMER_FLAG; /* A3 contains the timer IRQ enable */
} if (offset & 8)
else {
{ m_irqenable |= TIMER_FLAG;
m_irqenable &= ~TIMER_FLAG; }
} else
{
m_irqenable &= ~TIMER_FLAG;
}
/* implicitly clears the timer flag */ /* implicitly clears the timer flag */
if (m_timerstate != TIMER_FINISHING || val != 0xff) if (m_timerstate != TIMER_FINISHING || val != 0xff)
{ {
m_irqstate &= ~TIMER_FLAG; m_irqstate &= ~TIMER_FLAG;
}
update_irqstate();
} }
update_irqstate();
} }
/* if A2 == 0 and A0 == anything, we are reading from ports */ /* if A2 == 0 and A0 == anything, we are reading from ports */
@ -318,7 +324,10 @@ UINT8 riot6532_device::reg_r(UINT8 offset)
/* changes to port A need to update the PA7 state */ /* changes to port A need to update the PA7 state */
if (port == &m_port[0]) if (port == &m_port[0])
{ {
update_pa7_state(); if ( ! debugger_access )
{
update_pa7_state();
}
} }
} }

View File

@ -53,7 +53,7 @@ public:
DECLARE_READ8_MEMBER( read ); DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write ); DECLARE_WRITE8_MEMBER( write );
UINT8 reg_r(UINT8 offset); UINT8 reg_r(UINT8 offset, bool debugger_access = false);
void reg_w(UINT8 offset, UINT8 data); void reg_w(UINT8 offset, UINT8 data);
void porta_in_set(UINT8 data, UINT8 mask); void porta_in_set(UINT8 data, UINT8 mask);