rem: NewTime = TaskSwitch ();
add: TaskSwitch (); NewTime = GetTimeCounter ();
context: DoInput (PVOID pInputState){	DWORD NewTime;	INPUT_STATE InputState;	NewTime = GetTimeCounter ();	((PINPUT_STATE_DESC)pInputState)->MenuRepeatDelay = MENU_REPEAT_DELAY;	do	{		NewTime = TaskSwitch ();		InputState = GetInputState (NormalInput);#if DEMO_MODE || CREATE_JOURNAL		if (ArrowInput != DemoInput)#endif		{			static DWORD OldTime;				int test1,test2;				test1=NewTime - OldTime;				test2=(DWORD)((PINPUT_STATE_DESC)pInputState)->MenuRepeatDelay;			if (InputState == OldInputState					&& NewTime - OldTime <					(DWORD)((PINPUT_STATE_DESC)pInputState)->MenuRepeatDelay)				InputState = 0;			else			{#define ACCELERATION_INCREMENT 10				if (InputState != OldInputState)					((PINPUT_STATE_DESC)pInputState)->MenuRepeatDelay =							MENU_REPEAT_DELAY;				else if (((PINPUT_STATE_DESC)pInputState)->MenuRepeatDelay						<= ACCELERATION_INCREMENT)					((PINPUT_STATE_DESC)pInputState)->MenuRepeatDelay =							ACCELERATION_INCREMENT;				else					((PINPUT_STATE_DESC)pInputState)->MenuRepeatDelay -=							ACCELERATION_INCREMENT;				if (OldInputState != (INPUT_STATE)~0L)					OldInputState = InputState;				else				{					OldInputState = InputState;					InputState = 0;				}				OldTime = NewTime;			}#if CREATE_JOURNAL			JournalInput (InputState);#endif /* CREATE_JOURNAL */		}		if (InputState & DEVICE_EXIT)			InputState = ConfirmExit ();					if (MenuSounds				&& (pSolarSysState == 0						/* see if in menu */				|| pSolarSysState->MenuState.CurState				|| pSolarSysState->MenuState.Initialized > 2)				&& ((InputState & DEVICE_BUTTON1)				|| GetInputXComponent (InputState)				|| GetInputYComponent (InputState))#ifdef NEVER				&& !PLRPlaying ((MUSIC_REF)~0)#endif /* NEVER */				)		{			SOUND S;			S = MenuSounds;			if (InputState & DEVICE_BUTTON1)				S = SetAbsSoundIndex (S, 1);			PlaySoundEffect (S, 0, 0);		}	} while ((*((PINPUT_STATE_DESC)pInputState)->InputFunc)			(InputState, pInputState));	OldInputState = (INPUT_STATE)~0L;}