Previous 15994 Revisions Next

r1637 Wednesday 30th January, 2008 at 00:56:04 UTC by Dirk Best
[APPLE2GS] Removed usage of cpu_getcurrentframe()
[src/mess/machine]apple2gs.c

src/mess/machine/apple2gs.c
r1636r1637
148148static INT8 apple2gs_mouse_dy;
149149static mess_image *apple2gs_cur_slot6_image;
150150static emu_timer *apple2gs_scanline_timer;
151static emu_timer *apple2gs_clock_timer;
152static emu_timer *apple2gs_qsecond_timer;
151153
152154
153155/* -----------------------------------------------------------------------
r1636r1637
346348}
347349
348350
351/* Clock interrupt */
352static TIMER_CALLBACK( apple2gs_clock_tick )
353{
354   if ((apple2gs_vgcint & 0x04) && !(apple2gs_vgcint & 0x40))
355   {
356      apple2gs_vgcint |= 0xc0;
357      apple2gs_add_irq(IRQ_VGC_SECOND);
358   }
359}
360
361
362/* Quarter-second interrupt */
363static TIMER_CALLBACK( apple2gs_qsecond_tick )
364{
365   if ((apple2gs_inten & 0x10) && !(apple2gs_intflag & 0x10))
366   {
367      apple2gs_intflag |= 0x10;
368      apple2gs_add_irq(IRQ_INTEN_QSECOND);
369   }
370}
371
372
349373/* -----------------------------------------------------------------------
350374 * ADB
351375 * ----------------------------------------------------------------------- */
r1636r1637
766790}
767791
768792
769
770793static TIMER_CALLBACK(apple2gs_scanline_tick)
771794{
772795   int scanline;
773   int current_frame;
774796
775797   // make sure we're in the 65816's context
776798   cpuintrf_push_context(0);
r1636r1637
793815      }
794816   }
795817
796   if (scanline == BORDER_TOP)
818   if (scanline == (192+BORDER_TOP))
797819   {
798      current_frame = cpu_getcurrentframe();
799
800      /* quarter second interrupt */
801      if ((apple2gs_inten & 0x10) && !(apple2gs_intflag & 0x10) && ((current_frame % 15) == 0))
802      {
803         apple2gs_intflag |= 0x10;
804         apple2gs_add_irq(IRQ_INTEN_QSECOND);
805      }
806
807      /* one second interrupt */
808      if ((apple2gs_vgcint & 0x04) && !(apple2gs_vgcint & 0x40) && ((current_frame % 60) == 0))
809      {
810         apple2gs_vgcint |= 0xc0;
811         apple2gs_add_irq(IRQ_VGC_SECOND);
812      }
813   }
814   else if (scanline == (192+BORDER_TOP))
815   {
816820      /* VBL interrupt */
817821      if ((apple2gs_inten & 0x08) && !(apple2gs_intflag & 0x08))
818822      {
r1636r1637
17181722
17191723MACHINE_RESET( apple2gs )
17201724{
1725   apple2gs_clock_timer = timer_alloc(apple2gs_clock_tick, NULL);
1726   timer_adjust(apple2gs_clock_timer, ATTOTIME_IN_SEC(1), 0, ATTOTIME_IN_SEC(1));
1727   
1728   apple2gs_qsecond_timer = timer_alloc(apple2gs_qsecond_tick, NULL);
1729   timer_adjust(apple2gs_qsecond_timer, ATTOTIME_IN_USEC(266700), 0, ATTOTIME_IN_USEC(266700));
1730   
17211731   apple2gs_scanline_timer = timer_alloc(apple2gs_scanline_tick, NULL);
17221732   timer_adjust(apple2gs_scanline_timer, attotime_never, 0, attotime_never);
17231733

Previous 15994 Revisions Next


© 1998-2018 The MESS Team