Previous 199869 Revisions Next

r18898 Wednesday 7th November, 2012 at 21:09:10 UTC by O. Galibert
n2a03: Put a second irq line logically-ored with the normal one [O. Galibert]
[src/emu/cpu/m6502]m6502.c m6502.h n2a03.h
[src/emu/sound]nes_apu.c

trunk/src/emu/sound/nes_apu.c
r18897r18898
371371               if (chan->regs[0] & 0x80) /* IRQ Generator */
372372               {
373373                  chan->irq_occurred = TRUE;
374                  downcast<n2a03_device &>(info->APU.dpcm.memory->device()).set_input_line(N2A03_IRQ_LINE, ASSERT_LINE);
374                  downcast<n2a03_device &>(info->APU.dpcm.memory->device()).set_input_line(N2A03_APU_IRQ_LINE, ASSERT_LINE);
375375               }
376376               break;
377377            }
r18897r18898
521521   case APU_WRE0:
522522      info->APU.dpcm.regs[0] = value;
523523      if (0 == (value & 0x80)) {
524         downcast<n2a03_device &>(info->APU.dpcm.memory->device()).set_input_line(N2A03_IRQ_LINE, CLEAR_LINE);
524         downcast<n2a03_device &>(info->APU.dpcm.memory->device()).set_input_line(N2A03_APU_IRQ_LINE, CLEAR_LINE);
525525         info->APU.dpcm.irq_occurred = FALSE;
526526      }
527527      break;
trunk/src/emu/cpu/m6502/m6502.c
r18897r18898
9696   save_item(NAME(IR));
9797   save_item(NAME(nmi_state));
9898   save_item(NAME(irq_state));
99   save_item(NAME(apu_irq_state));
99100   save_item(NAME(v_state));
100101   save_item(NAME(inst_state));
101102   save_item(NAME(inst_substate));
r18897r18898
116117   IR = 0x00;
117118   nmi_state = false;
118119   irq_state = false;
120   apu_irq_state = false;
119121   irq_taken = false;
120122   v_state = false;
121123   inst_state = STATE_RESET;
r18897r18898
131133   inst_substate = 0;
132134   nmi_state = false;
133135   irq_state = false;
136   apu_irq_state = false;
134137   irq_taken = false;
135138   v_state = false;
136139   end_cycles = 0;
r18897r18898
416419{
417420   switch(inputnum) {
418421   case IRQ_LINE: irq_state = state == ASSERT_LINE; break;
422   case APU_IRQ_LINE: apu_irq_state = state == ASSERT_LINE; break;
419423   case NMI_LINE: nmi_state = nmi_state || (state == ASSERT_LINE); break;
420424   case V_LINE:
421425      if(!v_state && state == ASSERT_LINE)
r18897r18898
612616   IR = mintf->read_decrypted(PC);
613617   sync = false;
614618
615   if((nmi_state || (irq_state && !(P & F_I))) && !inhibit_interrupts) {
619   if((nmi_state || ((irq_state || apu_irq_state) && !(P & F_I))) && !inhibit_interrupts) {
616620      irq_taken = true;
617621      IR = 0x00;
618622   } else
trunk/src/emu/cpu/m6502/m6502.h
r18897r18898
4747public:
4848   enum {
4949      IRQ_LINE = INPUT_LINE_IRQ0,
50      APU_IRQ_LINE = INPUT_LINE_IRQ1,
5051      NMI_LINE = INPUT_LINE_NMI,
5152      V_LINE   = 10
5253   };
r18897r18898
176177   memory_interface *mintf;
177178   int inst_state, inst_substate;
178179   int icount;
179   bool nmi_state, irq_state, v_state;
180   bool nmi_state, irq_state, apu_irq_state, v_state;
180181   bool irq_taken, sync, direct_disabled, inhibit_interrupts;
181182   UINT64 end_cycles;
182183
trunk/src/emu/cpu/m6502/n2a03.h
r18897r18898
8787
8888enum {
8989   N2A03_IRQ_LINE = m6502_device::IRQ_LINE,
90   N2A03_APU_IRQ_LINE = m6502_device::APU_IRQ_LINE,
9091   N2A03_NMI_LINE = m6502_device::NMI_LINE,
9192   N2A03_SET_OVERFLOW = m6502_device::V_LINE,
9293};

Previous 199869 Revisions Next


© 1997-2024 The MAME Team