Example #1
0
	static int GetUnixTimeout(struct timespec *outTime, timeout_t inMilliseconds)
	{
		int		error;

		error = GetUnixTime(outTime);
		if (error != 0)
			return error;

		CalcUnixTimeout(outTime, inMilliseconds);

		return 0;
	}
Example #2
0
void handle_init(AppContextRef ctx) {
	(void)ctx;
	PblTm currentTime;
	unsigned int unixTime;

	resource_init_current_app(&APP_RESOURCES);

	get_time(&currentTime);
	unixTime = GetUnixTime(&currentTime);
	SetRandomSeed(unixTime);

	InitializeExitConfirmationWindow();
	
	handle_minute_tick(ctx, NULL);

	ResetGame();
	ShowAdventureWindow();
}
Example #3
0
int InitializeBiosTime()
{
	uint sid = SysGetCurrentSpaceId();
	mapAddress = (size_t)SysAllocateMemory( sid, MB(1), 0, ALLOC_VIRTUAL );
	if( mapAddress==0 ){
		printf("[time]failed to allocate 1 mb memory.\n");
		return -ERR_NOMEM;
	}
	if( SysMapMemory( sid, mapAddress, MB(1), 0, 0, MAP_ADDRESS ) < 0 ){
		printf("[time]failed to map 1 mb memory.\n");
		return -ERR_NOMEM;
	}
	time_t unixTime = GetUnixTime();
	char timestr[100];
	strtime(&unixTime, timestr);
	printf("[time]System time: %s\n", timestr );
	return 0;
}