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 )
{
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;
@ -267,16 +267,21 @@ UINT8 riot6532_device::reg_r(UINT8 offset)
{
val = m_irqstate;
if ( ! debugger_access )
{
/* implicitly clears the PA7 flag */
m_irqstate &= ~PA7_FLAG;
update_irqstate();
}
}
/* if A2 == 1 and A0 == 0, we are reading the timer */
else if ((offset & 0x05) == 0x04)
{
val = get_timer();
if ( ! debugger_access )
{
/* A3 contains the timer IRQ enable */
if (offset & 8)
{
@ -294,6 +299,7 @@ UINT8 riot6532_device::reg_r(UINT8 offset)
}
update_irqstate();
}
}
/* if A2 == 0 and A0 == anything, we are reading from ports */
else
@ -317,10 +323,13 @@ UINT8 riot6532_device::reg_r(UINT8 offset)
/* changes to port A need to update the PA7 state */
if (port == &m_port[0])
{
if ( ! debugger_access )
{
update_pa7_state();
}
}
}
/* apply the DDR to the result */
val = apply_ddr(port);

View File

@ -53,7 +53,7 @@ public:
DECLARE_READ8_MEMBER( read );
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 porta_in_set(UINT8 data, UINT8 mask);