Previous 15994 Revisions Next

r14671 Wednesday 29th February, 2012 at 13:26:07 UTC by Olivier Galibert
next: timer fix, add the softints [O. Galibert]
[src/mess/drivers]next.c
[src/mess/includes]next.h

src/mess/includes/next.h
r14670r14671
8888
8989   attotime timer_tbase;
9090   UINT16 timer_vbase;
91   UINT32 timer_data;
91   UINT32 timer_data, timer_next_data;
9292   UINT32 timer_ctrl;
9393   emu_timer *timer_tm;
9494
src/mess/drivers/next.c
r14670r14671
44
55    TODO:
66
7    - Find what the sleeping threads are waiting for
8
97    - Hook up the mouse (not before the system boots though, see the first problem)
108
119    - Find why the kernel doesn't manage to change the nvram at boot (readback error)
r14670r14671
150148   rtc->ce_w(BIT(scr2, 8));
151149   rtc->sdi_w(BIT(scr2, 10));
152150   rtc->sck_w(BIT(scr2, 9));
151   irq_set(0, scr2 & 0x01000000);
152   irq_set(1, scr2 & 0x02000000);
153153}
154154
155155READ32_MEMBER( next_state::scr1_r )
r14670r14671
660660void next_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
661661{
662662   irq_set(29, true);
663   if(timer_ctrl & 0x40000000) {
664      timer_data = 0xffff0000; // Old value instead?  Hard to know, since the kernel uses 0xffff
663   timer_data = timer_next_data;
664   if(timer_ctrl & 0x40000000)
665665      timer_start();
666   }
666   else
667      timer_ctrl &= 0x7fffffff;
667668}
668669
669670READ32_MEMBER( next_state::timer_data_r )
r14670r14671
675676
676677WRITE32_MEMBER( next_state::timer_data_w )
677678{
678   if(timer_ctrl & 0x80000000)
679      timer_update();
680   COMBINE_DATA(&timer_data);
681   timer_data &= 0xffff0000;
682   if(timer_ctrl & 0x80000000)
683      timer_start();
679   if(timer_ctrl & 0x80000000) {
680      COMBINE_DATA(&timer_next_data);
681      timer_next_data &= 0xffff0000;
682   } else {
683      COMBINE_DATA(&timer_data);
684      timer_data &= 0xffff0000;
685   }
684686}
685687
686688READ32_MEMBER( next_state::timer_ctrl_r )
r14670r14671
698700      if(oldact) {
699701         timer_update();
700702         irq_set(29, false);
701      } else
703      } else {
704         timer_next_data = timer_data;
702705         timer_start();
706      }
703707   }
704708}
705709
r14670r14671
831835   eventc_latch = 0;
832836   timer_vbase = 0;
833837   timer_data = 0;
838   timer_next_data = 0;
834839   timer_ctrl = 0;
835840   dma_drq_w(4, true); // soundout
836841}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team