Exemplo n.º 1
0
static FILE *log_open(uint32_t handle) {
	char tmp[128];
	FILE *f;
	sprintf(tmp, "%u.log", handle);
	f = fopen(tmp, "ab");
	if (f) {
		uint32_t starttime = timer_starttime();
		uint32_t curtime = timer_now();
		time_t ti = starttime + curtime/100;
		service_log(handle, "open log file %s\n", tmp);
		fprintf(f, "open time:%u %s", curtime, ctime(&ti));
		fflush(f);
	} else {
		service_log(handle, "open log file %s failed\n", tmp);
	}
	return f;
}
Exemplo n.º 2
0
double cpu_getscanlinetime(int scanline)
{
	double scantime = timer_starttime(refresh_timer) + (double)scanline * scanline_period;
	double abstime = timer_get_time();
	double result;

	/* if we're already past the computed time, count it for the next frame */
	if (abstime >= scantime)
		scantime += TIME_IN_HZ(Machine->drv->frames_per_second);

	/* compute how long from now until that time */
	result = scantime - abstime;

	/* if it's small, just count a whole frame */
	if (result < TIME_IN_NSEC(1))
		result += TIME_IN_HZ(Machine->drv->frames_per_second);
	return result;
}
Exemplo n.º 3
0
attotime timer_device_starttime(const device_config *timer)
{
	timer_state *state = get_safe_token(timer);
	return timer_starttime(state->timer);
}
Exemplo n.º 4
0
attotime timer_device_starttime(running_device *timer)
{
	timer_state *state = get_safe_token(timer);
	return timer_starttime(state->timer);
}