rem: ClearSemaphore (GraphicsSem);
context: PauseGame (void){	RECT r;	STAMP s;	CONTEXT OldContext;	FRAME F;	HOT_SPOT OldHot;	if (ActivityFrame == 0			|| (GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_PAUSE))			|| (LastActivity & (CHECK_LOAD | CHECK_RESTART)))		return (FALSE);			GLOBAL (CurrentActivity) |= CHECK_PAUSE;	if (LOBYTE (GLOBAL (CurrentActivity)) != SUPER_MELEE)		SuspendGameClock ();	if (CommData.ConversationPhrases && PlayingTrack ())		PauseTrack ();	SetSemaphore (GraphicsSem);	OldContext = SetContext (ScreenContext);	OldHot = SetFrameHot (Screen, MAKE_HOT_SPOT (0, 0));	GetFrameRect (ActivityFrame, &r);	r.corner.x = (SCREEN_WIDTH - r.extent.width) >> 1;	r.corner.y = (SCREEN_HEIGHT - r.extent.height) >> 1;	s.origin = r.corner;	s.frame = ActivityFrame;	F = CaptureDrawable (LoadDisplayPixmap (&r, (FRAME)0));	DrawStamp (&s);	// Releasing the Semaphore lets the rotate_planet_task	// draw a frame.  PauseRotate can still allow one more frame	// to be drawn, so it is safer to just not release the Semaphore	//ClearSemaphore (GraphicsSem);	FlushGraphics ();	//SetSemaphore (GraphicsSem);	while (KeyDown (PauseKey))		TaskSwitch ();	FlushInput ();	// Wait for the pause key to be pressed again	while (!KeyDown (PauseKey))		TaskSwitch ();	s.frame = F;	DrawStamp (&s);	DestroyDrawable (ReleaseDrawable (s.frame));	SetFrameHot (Screen, OldHot);	SetContext (OldContext);	WaitForNoInput (ONE_SECOND / 4);	FlushInput ();	ClearSemaphore (GraphicsSem);	if (LOBYTE (GLOBAL (CurrentActivity)) != SUPER_MELEE)		ResumeGameClock ();	if (CommData.ConversationPhrases && PlayingTrack ())		ResumeTrack ();	TaskSwitch ();	GLOBAL (CurrentActivity) &= ~CHECK_PAUSE;	return (TRUE);}