Previous 15994 Revisions Next

r12191 Monday 11th July, 2011 at 02:54:23 UTC by R. Belmont
mac: made RBV/V8 VIA2 interrupt handling a bit more like a real VIA. Fixes audio on IIci.
[src/mess/drivers]mac.c
[src/mess/machine]mac.c

src/mess/machine/mac.c
r12190r12191
340340   {
341341      if (state)
342342      {
343         mac->m_rbv_regs[3] |= 0x90;   // any VIA 2 interrupt | sound interrupt
343         mac->m_rbv_regs[3] |= 0x10;   // any VIA 2 interrupt | sound interrupt
344344
345345         if (mac->m_rbv_ier & 0x10)   // ASC on RBV is CB1, bit 4 of IER/IFR
346346         {
r12190r12191
350350      }
351351      else
352352      {
353         mac->m_rbv_regs[3] &= ~0x90;
353         mac->m_rbv_regs[3] &= ~0x10;
354354         mac->m_rbv_ifr &= ~0x10;
355355      }
356356
src/mess/drivers/mac.c
r12190r12191
217217      switch (offset)
218218      {
219219         case 13:   // IFR
220//              printf("Read IER = %02x (PC=%x)\n", m_rbv_ier, cpu_get_pc(space.cpu));
220//            printf("Read IER = %02x (PC=%x)\n", m_rbv_ier, cpu_get_pc(m_maincpu));
221221            return m_rbv_ifr;
222222            break;
223223
224224         case 14:   // IER
225//              printf("Read IFR = %02x (PC=%x)\n", m_rbv_ifr, cpu_get_pc(space.cpu));
225//            printf("Read IFR = %02x (PC=%x)\n", m_rbv_ifr, cpu_get_pc(m_maincpu));
226226            return m_rbv_ier;
227227            break;
228228
r12190r12191
292292            else         // 1 bits write 0s
293293            {
294294               m_rbv_regs[offset] &= ~(data & 0x7f);
295
296               if (data & 0x78)
297               {
298                  m_rbv_ifr &= ~0x2;
299               }
295300            }
296301            break;
297302
r12190r12191
321326      switch (offset)
322327      {
323328         case 13:   // IFR
324//              printf("rbv_w: %02x to IFR\n", data);
325            m_rbv_ifr = data;
326            this->set_via2_interrupt(0);
329            if (data & 0x80)
330            {
331               data = 0x7f;
332            }
333            m_rbv_ifr = (m_rbv_ifr & ~data) & 0x7f;
334
335            if (m_rbv_ifr & m_rbv_ier & 0x7f)
336            {
337               this->set_via2_interrupt(1);
338            }
339            else
340            {
341               this->set_via2_interrupt(0);
342            }
327343            break;
328344
329345         case 14:   // IER
r12190r12191
336352               m_rbv_ier &= ~(data & 0x7f);
337353            }
338354
339//              printf("rbv_w: %02x to IER => %02x\n", data, m_rbv_ier);
355//                printf("rbv_w: %02x to IER => %02x\n", data, m_rbv_ier);
340356            break;
341357
342358         default:

Previous 15994 Revisions Next


© 1998-2018 The MESS Team