rem: SleepThreadUntil (TimeIn + BATTLE_FRAME_RATE);
add: SleepThreadUntil (TimeIn + (ONE_SECOND / BATTLE_FRAME_RATE));
context: int arilou_gate_task(void* data){	BYTE counter;	DWORD TimeIn;	Task task = (Task) data;	TimeIn = GetTimeCounter ();	counter = GET_GAME_STATE (ARILOU_SPACE_COUNTER);	while (!Task_ReadState (task, TASK_EXIT))	{		SetSemaphore (GLOBAL (GameClock.clock_sem));		if (GET_GAME_STATE (ARILOU_SPACE) == OPENING)		{			if (++counter == 10)				counter = 9;		}		else		{			if (counter-- == 0)				counter = 0;		}		SetSemaphore (GraphicsSem);		SET_GAME_STATE (ARILOU_SPACE_COUNTER, counter);		ClearSemaphore (GraphicsSem);		ClearSemaphore (GLOBAL (GameClock.clock_sem));		SleepThreadUntil (TimeIn + BATTLE_FRAME_RATE);		TimeIn = GetTimeCounter ();	}	FinishTask (task);	return(0);}