src/mame/machine/dc.c
| r7966 | r7967 | |
| 1571 | 1571 | dc_rtcregister[RTC1] = (dc_rtcregister[RTC1] + 1) & 0xFFFF; |
| 1572 | 1572 | } |
| 1573 | 1573 | |
| 1574 | | MACHINE_START( dc ) |
| 1574 | /* fill the RTC registers with the proper start-up values */ |
| 1575 | static void rtc_initial_setup(running_machine *machine) |
| 1575 | 1576 | { |
| 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 | |
| 1576 | 1611 | dc_rtc_timer = timer_alloc(machine, dc_rtc_increment, 0); |
| 1577 | 1612 | } |
| 1578 | 1613 | |
| 1614 | MACHINE_START( dc ) |
| 1615 | { |
| 1616 | rtc_initial_setup(machine); |
| 1617 | } |
| 1618 | |
| 1579 | 1619 | MACHINE_RESET( dc ) |
| 1580 | 1620 | { |
| 1581 | 1621 | /* halt the ARM7 */ |
| r7966 | r7967 | |
| 1583 | 1623 | |
| 1584 | 1624 | memset(dc_sysctrl_regs, 0, sizeof(dc_sysctrl_regs)); |
| 1585 | 1625 | memset(maple_regs, 0, sizeof(maple_regs)); |
| 1586 | | memset(dc_rtcregister, 0, sizeof(dc_rtcregister)); |
| 1587 | 1626 | memset(dc_coin_counts, 0, sizeof(dc_coin_counts)); |
| 1588 | 1627 | |
| 1589 | 1628 | timer_adjust_periodic(dc_rtc_timer, attotime_zero, 0, ATTOTIME_IN_SEC(1)); |
src/mess/drivers/supracan.c
| r7966 | r7967 | |
| 449 | 449 | if(state->video_flags & 8) |
| 450 | 450 | draw_sprites(screen->machine,bitmap,cliprect); |
| 451 | 451 | |
| 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); |
| 454 | 454 | |
| 455 | 455 | return 0; |
| 456 | 456 | } |
| r7966 | r7967 | |
| 524 | 524 | } |
| 525 | 525 | } |
| 526 | 526 | } |
| 527 | | else |
| 527 | else if(data != 0x0000) // fake DMA, used by C.U.G. |
| 528 | 528 | { |
| 529 | 529 | 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); |
| 530 | 530 | 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); |