rem: SetSemaphore (&GraphicsSem);
add: SetSemaphore (GraphicsSem);
context: HailAlien (void){	MEM_HANDLE hOldIndex;	ENCOUNTER_STATE ES;	FONT PlayerFont, OldFont;	pCurInputState = &ES;	memset (pCurInputState, 0, sizeof (*pCurInputState));	ES.InputFunc = DoCommunication;	hOldIndex = SetResourceIndex (hResIndex);	PlayerFont = CaptureFont (LoadGraphic (PLAYER_FONT));	SetResourceIndex (hOldIndex);	CommData.AlienFrame = CaptureDrawable (			LoadGraphicInstance ((RESOURCE)CommData.AlienFrame)			);	CommData.AlienFont = CaptureFont (			LoadGraphic ((RESOURCE)CommData.AlienFont)			);	CommData.AlienColorMap = CaptureColorMap (			LoadColorMapInstance ((RESOURCE)CommData.AlienColorMap)			);	CommData.AlienSong = LoadMusicInstance ((RESOURCE)CommData.AlienSong);	CommData.ConversationPhrases = CaptureStringTable (			LoadStringTableInstance ((RESOURCE)CommData.ConversationPhrases)			);	ES.phrase_buf_index = 1;	ES.phrase_buf[0] = '\0';	SetContext (SpaceContext);	SetContextDrawState (DEST_PIXMAP | DRAW_REPLACE);	OldFont = SetContextFont (PlayerFont);	{		RECT r;		TaskContext = CaptureContext (CreateContext ());		SetContext (TaskContext);		SetContextFGFrame (Screen);		GetFrameRect (CommData.AlienFrame, &r);		r.corner.y = SIS_ORG_Y;		r.extent.width = SIS_SCREEN_WIDTH;BatchGraphics ();		if (LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)		{			r.corner.x = (SCREEN_WIDTH - SIS_SCREEN_WIDTH) >> 1;			SetContextClipRect (&r);		}		else		{			r.corner.x = SIS_ORG_X;			SetContextClipRect (&r);			if (pMenuState == 0)			{				RepairSISBorder ();				ClearSemaphore (&GraphicsSem);				DrawMenuStateStrings ((BYTE)~0, (BYTE)~0);				SetSemaphore (&GraphicsSem);			}			else /* in starbase */			{				ClearSemaphore (&GraphicsSem);				DrawSISFrame ();				SetSemaphore (&GraphicsSem);				if (GET_GAME_STATE (STARBASE_AVAILABLE))				{					DrawSISMessage (GAME_STRING (STARBASE_STRING_BASE + 1));					DrawSISTitle (GAME_STRING (STARBASE_STRING_BASE + 0));				}				else				{					DrawSISMessage (NULL_PTR);					DrawSISTitle (GLOBAL_SIS (PlanetName));				}			}		}		DrawSISComWindow ();	}	ClearSemaphore (&GraphicsSem);	LastActivity |= CHECK_LOAD; /* prevent spurious input */	(*CommData.init_encounter_func) ();	DoInput ((PVOID)&ES);	if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))		(*CommData.uninit_encounter_func) ();	SetSemaphore (&GraphicsSem);	DestroyStringTable (ReleaseStringTable (CommData.ConversationPhrases));	DestroyMusic ((MUSIC_REF)CommData.AlienSong);	TFB_ReleaseColorMap ();	DestroyColorMap (ReleaseColorMap (CommData.AlienColorMap));	DestroyFont (ReleaseFont (CommData.AlienFont));	DestroyDrawable (ReleaseDrawable (CommData.AlienFrame));	SetContext (SpaceContext);	SetContextFont (OldFont);	DestroyFont (ReleaseFont (PlayerFont));	CommData.ConversationPhrases = 0;	pCurInputState = 0;}