本文整理汇总了C++中running_machine::current_datetime方法的典型用法代码示例。如果您正苦于以下问题:C++ running_machine::current_datetime方法的具体用法?C++ running_machine::current_datetime怎么用?C++ running_machine::current_datetime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类running_machine
的用法示例。
在下文中一共展示了running_machine::current_datetime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: europc_rtc_set_time
void europc_rtc_set_time(running_machine &machine)
{
system_time systime;
/* get the current date/time from the core */
machine.current_datetime(systime);
europc_rtc.data[0] = dec_2_bcd(systime.utc_time.second);
europc_rtc.data[1] = dec_2_bcd(systime.utc_time.minute);
europc_rtc.data[2] = dec_2_bcd(systime.utc_time.hour);
europc_rtc.data[3] = dec_2_bcd(systime.utc_time.mday);
europc_rtc.data[4] = dec_2_bcd(systime.utc_time.month + 1);
europc_rtc.data[5] = dec_2_bcd(systime.utc_time.year % 100);
}
示例2: srtc_update_time
static void srtc_update_time( running_machine &machine )
{
system_time curtime, *systime = &curtime;
machine.current_datetime(curtime);
rtc_state.ram[0] = systime->local_time.second % 10;
rtc_state.ram[1] = systime->local_time.second / 10;
rtc_state.ram[2] = systime->local_time.minute % 10;
rtc_state.ram[3] = systime->local_time.minute / 10;
rtc_state.ram[4] = systime->local_time.hour % 10;
rtc_state.ram[5] = systime->local_time.hour / 10;
rtc_state.ram[6] = systime->local_time.mday % 10;
rtc_state.ram[7] = systime->local_time.mday / 10;
rtc_state.ram[8] = systime->local_time.month;
rtc_state.ram[9] = (systime->local_time.year - 1000) % 10;
rtc_state.ram[10] = ((systime->local_time.year - 1000) / 10) % 10;
rtc_state.ram[11] = (systime->local_time.year - 1000) / 100;
rtc_state.ram[12] = systime->local_time.weekday % 7;
}