Skip to content

Commit

Permalink
z8: A little more optional logging for IRQs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrhacker committed Feb 20, 2024
1 parent 3c038a5 commit c91b375
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/devices/cpu/z8/z8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#define LOG_TIMER (1U << 1)
#define LOG_RECEIVE (1U << 2)
#define LOG_TRANSMIT (1U << 3)
#define LOG_IRQ (1U << 4)

#define VERBOSE 0
#include "logmacro.h"
Expand Down Expand Up @@ -1331,7 +1332,10 @@ void z8_device::request_interrupt(int irq)
assert(irq >= 0 && irq < 6);

if (m_irq_initialized)
{
m_irq |= 1 << irq;
LOGMASKED(LOG_IRQ, "%s: IRQ%d requested\n", machine().time().to_string(), irq);
}
}

void z8_device::take_interrupt(int irq)
Expand Down
2 changes: 1 addition & 1 deletion src/devices/cpu/z8/z8ops.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ INSTRUCTION( swap_IR1 ) { mode_IR1(swap) }

INSTRUCTION( ccf ) { m_flags ^= Z8_FLAGS_C; }
INSTRUCTION( di ) { m_imr &= ~Z8_IMR_ENABLE; }
INSTRUCTION( ei ) { m_imr |= Z8_IMR_ENABLE; m_irq_initialized = true; }
INSTRUCTION( ei ) { m_imr |= Z8_IMR_ENABLE; if (!m_irq_initialized) LOGMASKED(LOG_IRQ, "(%04X): IRQs first enabled\n", m_ppc); m_irq_initialized = true; }
INSTRUCTION( nop ) { /* no operation */ }
INSTRUCTION( rcf ) { set_flag_c(0); }
INSTRUCTION( scf ) { set_flag_c(1); }
Expand Down

0 comments on commit c91b375

Please sign in to comment.