to quote OG:
"CPU cores *must* call standard_irq_callback() when taking an
interrupt.  No ifs, no buts,  Not only HOLD_LINE relies on it, but
more importantly run until interrupt relies on it."
This commit is contained in:
Michaël Banaan Ananas 2014-08-11 22:11:10 +00:00
parent b46be5aef6
commit c307d95ce0
8 changed files with 24 additions and 43 deletions

View File

@ -7,6 +7,7 @@ NMI:
m_cc |= CC_I | CC_F;
set_ea(VECTOR_NMI);
eat(1);
standard_irq_callback(INPUT_LINE_NMI);
goto INTERRUPT_VECTOR;
FIRQ:
@ -25,6 +26,7 @@ FIRQ:
m_cc |= CC_I | CC_F;
set_ea(VECTOR_FIRQ);
eat(1);
standard_irq_callback(M6809_FIRQ_LINE);
goto INTERRUPT_VECTOR;
IRQ:
@ -35,6 +37,7 @@ IRQ:
m_cc |= CC_I;
set_ea(VECTOR_IRQ);
eat(1);
standard_irq_callback(M6809_IRQ_LINE);
goto INTERRUPT_VECTOR;
INTERRUPT_VECTOR:
@ -447,6 +450,16 @@ CWAI:
set_ea(m_ea.w); // need to do this to set the addressing mode
m_cc |= CC_I | (m_ea.w != VECTOR_IRQ ? CC_F : 0);
// invoke standard interrupt callback for MAME core
switch (m_ea.w)
{
case VECTOR_NMI: standard_irq_callback(INPUT_LINE_NMI); break;
case VECTOR_FIRQ: standard_irq_callback(M6809_FIRQ_LINE); break;
case VECTOR_IRQ: standard_irq_callback(M6809_IRQ_LINE); break;
default: break;
}
goto INTERRUPT_VECTOR;
LEA_xy:

View File

@ -140,7 +140,7 @@ enum
HD6309_ZERO_WORD
};
#define HD6309_IRQ_LINE 0 /* IRQ line number */
#define HD6309_FIRQ_LINE 1 /* FIRQ line number */
#define HD6309_IRQ_LINE M6809_IRQ_LINE /* 0 - IRQ line number */
#define HD6309_FIRQ_LINE M6809_FIRQ_LINE /* 1 - FIRQ line number */
#endif // __HD6309_H__

View File

@ -1,6 +1,6 @@
MAIN:
// check interrupt lines
switch(check_pending_interrupt())
switch(get_pending_interrupt())
{
case VECTOR_NMI: goto NMI;
case VECTOR_FIRQ: goto FIRQ;

View File

@ -73,7 +73,7 @@ private:
void execute_one();
};
#define KONAMI_IRQ_LINE 0 /* IRQ line number */
#define KONAMI_FIRQ_LINE 1 /* FIRQ line number */
#define KONAMI_IRQ_LINE M6809_IRQ_LINE /* 0 - IRQ line number */
#define KONAMI_FIRQ_LINE M6809_FIRQ_LINE /* 1 - FIRQ line number */
#endif /* __KONAMI_CPU_H__ */

View File

@ -1,6 +1,6 @@
MAIN:
// check interrupt lines
switch(check_pending_interrupt())
switch(get_pending_interrupt())
{
case VECTOR_NMI: goto NMI;
case VECTOR_FIRQ: goto FIRQ;

View File

@ -238,7 +238,6 @@ protected:
bool is_register_addressing_mode();
bool is_ea_addressing_mode() { return m_addressing_mode == ADDRESSING_MODE_EA; }
UINT16 get_pending_interrupt();
UINT16 check_pending_interrupt();
void log_illegal();
private:

View File

@ -1,6 +1,6 @@
MAIN:
// check interrupt lines
switch(check_pending_interrupt())
switch(get_pending_interrupt())
{
case VECTOR_NMI: goto NMI;
case VECTOR_FIRQ: goto FIRQ;

View File

@ -302,43 +302,12 @@ inline bool m6809_base_device::is_register_addressing_mode()
inline UINT16 m6809_base_device::get_pending_interrupt()
{
UINT16 result;
if (m_nmi_asserted)
result = VECTOR_NMI;
return VECTOR_NMI;
else if (!(m_cc & CC_F) && m_firq_line)
result = VECTOR_FIRQ;
return VECTOR_FIRQ;
else if (!(m_cc & CC_I) && m_irq_line)
result = VECTOR_IRQ;
return VECTOR_IRQ;
else
result = 0;
return result;
}
//-------------------------------------------------
// check_pending_interrupt
//-------------------------------------------------
inline UINT16 m6809_base_device::check_pending_interrupt()
{
UINT16 result = get_pending_interrupt();
// check_pending_interrupt() will also invoke the IRQ
// callback for FIRQ and IRQ interrupts
//
// I'm not sure why this is necessary; neither the 6809, 6309
// nor (presumably) Konami had any interrupt acknowledge lines so
// it isn't clear what this is reflecting
switch(result)
{
case VECTOR_FIRQ:
standard_irq_callback(M6809_FIRQ_LINE);
break;
case VECTOR_IRQ:
standard_irq_callback(M6809_IRQ_LINE);
break;
}
return result;
return 0;
}