Previous 199869 Revisions Next

r31619 Monday 11th August, 2014 at 22:11:10 UTC by hap
fix http://mametesters.org/view.php?id=5350

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."
[src/emu/cpu/m6809]base6x09.ops hd6309.h hd6309.ops konami.h konami.ops m6809.h m6809.ops m6809inl.h

trunk/src/emu/cpu/m6809/m6809inl.h
r31618r31619
302302
303303inline UINT16 m6809_base_device::get_pending_interrupt()
304304{
305   UINT16 result;
306305   if (m_nmi_asserted)
307      result = VECTOR_NMI;
306      return VECTOR_NMI;
308307   else if (!(m_cc & CC_F) && m_firq_line)
309      result = VECTOR_FIRQ;
308      return VECTOR_FIRQ;
310309   else if (!(m_cc & CC_I) && m_irq_line)
311      result = VECTOR_IRQ;
310      return VECTOR_IRQ;
312311   else
313      result = 0;
314   return result;
312      return 0;
315313}
316
317
318
319//-------------------------------------------------
320//  check_pending_interrupt
321//-------------------------------------------------
322
323inline UINT16 m6809_base_device::check_pending_interrupt()
324{
325   UINT16 result = get_pending_interrupt();
326
327   // check_pending_interrupt() will also invoke the IRQ
328   // callback for FIRQ and IRQ interrupts
329   //
330   // I'm not sure why this is necessary; neither the 6809, 6309
331   // nor (presumably) Konami had any interrupt acknowledge lines so
332   // it isn't clear what this is reflecting
333   switch(result)
334   {
335      case VECTOR_FIRQ:
336         standard_irq_callback(M6809_FIRQ_LINE);
337         break;
338      case VECTOR_IRQ:
339         standard_irq_callback(M6809_IRQ_LINE);
340         break;
341   }
342
343   return result;
344}
trunk/src/emu/cpu/m6809/hd6309.ops
r31618r31619
11MAIN:
22   // check interrupt lines
3   switch(check_pending_interrupt())
3   switch(get_pending_interrupt())
44   {
55      case VECTOR_NMI:   goto NMI;
66      case VECTOR_FIRQ:   goto FIRQ;
trunk/src/emu/cpu/m6809/konami.ops
r31618r31619
11MAIN:
22   // check interrupt lines
3   switch(check_pending_interrupt())
3   switch(get_pending_interrupt())
44   {
55      case VECTOR_NMI:   goto NMI;
66      case VECTOR_FIRQ:   goto FIRQ;
trunk/src/emu/cpu/m6809/base6x09.ops
r31618r31619
77   m_cc |= CC_I | CC_F;
88   set_ea(VECTOR_NMI);
99   eat(1);
10   standard_irq_callback(INPUT_LINE_NMI);
1011   goto INTERRUPT_VECTOR;
1112
1213FIRQ:
r31618r31619
2526   m_cc |= CC_I | CC_F;
2627   set_ea(VECTOR_FIRQ);
2728   eat(1);
29   standard_irq_callback(M6809_FIRQ_LINE);
2830   goto INTERRUPT_VECTOR;
2931
3032IRQ:
r31618r31619
3537   m_cc |= CC_I;
3638   set_ea(VECTOR_IRQ);
3739   eat(1);
40   standard_irq_callback(M6809_IRQ_LINE);
3841   goto INTERRUPT_VECTOR;
3942
4043INTERRUPT_VECTOR:
r31618r31619
447450
448451   set_ea(m_ea.w);   // need to do this to set the addressing mode
449452   m_cc |= CC_I | (m_ea.w != VECTOR_IRQ ? CC_F : 0);
453
454   // invoke standard interrupt callback for MAME core
455   switch (m_ea.w)
456   {
457      case VECTOR_NMI:   standard_irq_callback(INPUT_LINE_NMI); break;
458      case VECTOR_FIRQ:   standard_irq_callback(M6809_FIRQ_LINE); break;
459      case VECTOR_IRQ:   standard_irq_callback(M6809_IRQ_LINE); break;
460      default:         break;
461   }
462
450463   goto INTERRUPT_VECTOR;
451464
452465LEA_xy:
trunk/src/emu/cpu/m6809/hd6309.h
r31618r31619
140140   HD6309_ZERO_WORD
141141};
142142
143#define HD6309_IRQ_LINE  0   /* IRQ line number */
144#define HD6309_FIRQ_LINE 1   /* FIRQ line number */
143#define HD6309_IRQ_LINE  M6809_IRQ_LINE   /* 0 - IRQ line number */
144#define HD6309_FIRQ_LINE M6809_FIRQ_LINE  /* 1 - FIRQ line number */
145145
146146#endif // __HD6309_H__
trunk/src/emu/cpu/m6809/m6809.ops
r31618r31619
11MAIN:
22   // check interrupt lines
3   switch(check_pending_interrupt())
3   switch(get_pending_interrupt())
44   {
55      case VECTOR_NMI:   goto NMI;
66      case VECTOR_FIRQ:   goto FIRQ;
trunk/src/emu/cpu/m6809/konami.h
r31618r31619
7373   void execute_one();
7474};
7575
76#define KONAMI_IRQ_LINE 0   /* IRQ line number */
77#define KONAMI_FIRQ_LINE 1   /* FIRQ line number */
76#define KONAMI_IRQ_LINE  M6809_IRQ_LINE   /* 0 - IRQ line number */
77#define KONAMI_FIRQ_LINE M6809_FIRQ_LINE  /* 1 - FIRQ line number */
7878
7979#endif /* __KONAMI_CPU_H__ */
trunk/src/emu/cpu/m6809/m6809.h
r31618r31619
238238   bool is_register_addressing_mode();
239239   bool is_ea_addressing_mode() { return m_addressing_mode == ADDRESSING_MODE_EA; }
240240   UINT16 get_pending_interrupt();
241   UINT16 check_pending_interrupt();
242241   void log_illegal();
243242
244243private:

Previous 199869 Revisions Next


© 1997-2024 The MAME Team