Previous 15994 Revisions Next

r7967 Tuesday 4th May, 2010 at 21:06:31 UTC by Angelo Salese
[Super A'Can]: Allow C.U.G. to bypass an assert
[src/mame/machine]dc.c
[src/mess/drivers]supracan.c

src/mame/machine/dc.c
r7966r7967
15711571        dc_rtcregister[RTC1] = (dc_rtcregister[RTC1] + 1) & 0xFFFF;
15721572}
15731573
1574MACHINE_START( dc )
1574/* fill the RTC registers with the proper start-up values */
1575static void rtc_initial_setup(running_machine *machine)
15751576{
1577   static UINT32 current_time;
1578   static int year_count,cur_year,i;
1579   static const int month_to_day_conversion[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
1580   mame_system_time systime;
1581   mame_get_base_datetime(machine, &systime);
1582
1583   memset(dc_rtcregister, 0, sizeof(dc_rtcregister));
1584
1585   /* put the seconds */
1586   current_time = systime.local_time.second;
1587   /* put the minutes */
1588   current_time+= systime.local_time.minute*60;
1589   /* put the hours */
1590   current_time+= systime.local_time.hour*60*60;
1591   /* put the days (note -1) */
1592   current_time+= (systime.local_time.mday-1)*60*60*24;
1593   /* take the current year here for calculating leaps */
1594   cur_year = (systime.local_time.year);
1595
1596   /* take the months - despite popular beliefs, leap years aren't just evenly divisible by 4 */
1597   if(((((cur_year % 4) == 0) && ((cur_year % 100) != 0)) || ((cur_year % 400) == 0)) && systime.local_time.month > 2)
1598      current_time+= (month_to_day_conversion[systime.local_time.month]+1)*60*60*24;
1599   else
1600      current_time+= (month_to_day_conversion[systime.local_time.month])*60*60*24;
1601
1602   /* put the years */
1603   year_count = (cur_year-1949);
1604
1605   for(i=0;i<year_count-1;i++)
1606      current_time += (((((i+1950) % 4) == 0) && (((i+1950) % 100) != 0)) || (((i+1950) % 400) == 0)) ? 60*60*24*366 : 60*60*24*365;
1607
1608   dc_rtcregister[RTC2] = current_time & 0x0000ffff;
1609   dc_rtcregister[RTC1] = (current_time & 0xffff0000) >> 16;
1610
15761611   dc_rtc_timer = timer_alloc(machine, dc_rtc_increment, 0);
15771612}
15781613
1614MACHINE_START( dc )
1615{
1616   rtc_initial_setup(machine);
1617}
1618
15791619MACHINE_RESET( dc )
15801620{
15811621   /* halt the ARM7 */
r7966r7967
15831623
15841624   memset(dc_sysctrl_regs, 0, sizeof(dc_sysctrl_regs));
15851625   memset(maple_regs, 0, sizeof(maple_regs));
1586   memset(dc_rtcregister, 0, sizeof(dc_rtcregister));
15871626   memset(dc_coin_counts, 0, sizeof(dc_coin_counts));
15881627
15891628   timer_adjust_periodic(dc_rtc_timer, attotime_zero, 0, ATTOTIME_IN_SEC(1));
src/mess/drivers/supracan.c
r7966r7967
449449   if(state->video_flags & 8)
450450      draw_sprites(screen->machine,bitmap,cliprect);
451451
452   if(state->video_flags & 4)
453      draw_roz(screen->machine,bitmap,cliprect);
452//   if(state->video_flags & 4)
453//      draw_roz(screen->machine,bitmap,cliprect);
454454
455455   return 0;
456456}
r7966r7967
524524               }
525525            }
526526         }
527         else
527         else if(data != 0x0000) // fake DMA, used by C.U.G.
528528         {
529529            verboselog(space->machine, 0, "supracan_dma_w: Unknown DMA kickoff value of %04x (other regs %08x, %08x, %d)\n", data, acan_dma_regs->source[ch], acan_dma_regs->dest[ch], acan_dma_regs->count[ch] + 1);
530530            fatalerror("supracan_dma_w: Unknown DMA kickoff value of %04x (other regs %08x, %08x, %d)",data, acan_dma_regs->source[ch], acan_dma_regs->dest[ch], acan_dma_regs->count[ch] + 1);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team