예제 #1
0
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
0
파일: snesrtc.c 프로젝트: coinhelper/jsmess
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;
}