rem: SetSemaphore (&GraphicsSem);
add: SetSemaphore (GraphicsSem);
context: DrawDescriptionString (PMENU_STATE pMS, COUNT which_string, SIZE state){	COUNT rel_index;	RECT r;	TEXT lf;	COLOR BackGround, ForeGround;	FONT Font;	static BOOLEAN DoNaming (INPUT_STATE InputState, PMENU_STATE pMS);	SetSemaphore (&GraphicsSem);	rel_index = (COUNT)(which_string - pMS->first_item.y);	{		r.corner.x = 2;		r.extent.width = SHIP_NAME_WIDTH;		r.extent.height = SHIP_NAME_HEIGHT;		SetContext (StatusContext);		if (pMS->delta_item == CHANGE_CAPTAIN_SETTING)		{			Font = TinyFont;			r.corner.y = 10;			++r.corner.x;			r.extent.width -= 2;			lf.baseline.x = r.corner.x + (r.extent.width >> 1) - 1;			BackGround = BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0x1F), 0x09);			ForeGround = BUILD_COLOR (MAKE_RGB15 (0xA, 0x1F, 0x1F), 0x0B);		}		else		{			Font = StarConFont;			r.corner.y = 20;			lf.baseline.x = r.corner.x + (r.extent.width >> 1);			BackGround = BUILD_COLOR (MAKE_RGB15 (0xF, 0x00, 0x00), 0x2D);			ForeGround = BUILD_COLOR (MAKE_RGB15 (0x1F, 0xA, 0x00), 0x7D);		}		lf.baseline.y = r.corner.y + r.extent.height - 1;		lf.align = ALIGN_CENTER;	}	SetContextFont (Font);	lf.pStr = ((GAME_DESC *)pMS->CurString)[rel_index];	lf.CharCount = (COUNT)~0;	if (state <= 0)	{		if (pMS->InputFunc == DoNaming)		{			if (pMS->delta_item == CHANGE_CAPTAIN_SETTING)				DrawCaptainsName ();			else			{				DrawFlagshipName (TRUE);				if (pMenuState && pMenuState->InputFunc == DoOutfit)					DrawFlagshipName (FALSE);			}		}		else		{			if (state == 0)			{				COLOR OldColor;				OldColor = SetContextForeGroundColor (BLACK_COLOR);				DrawFilledRectangle (&r);				SetContextForeGroundColor (OldColor);			}			DrawText (&lf);		}		SetFlashRect (&r, (FRAME)0);		SetFlashRect ((PRECT)~0L, (FRAME)0);	}	else	{		COUNT i;		RECT text_r;		BYTE char_deltas[MAX_DESC_CHARS];		PBYTE pchar_deltas;		TextRect (&lf, &text_r, char_deltas);		if ((text_r.extent.width + 2) >= r.extent.width)		{			ClearSemaphore (&GraphicsSem);			return (FALSE);		}		SetContextForeGroundColor (BackGround);		DrawFilledRectangle (&r);		pchar_deltas = char_deltas;		for (i = pMS->first_item.x; i > 0; --i)			text_r.corner.x += (SIZE)*pchar_deltas++;		if (SerialInput)		{			if ((COUNT)pMS->first_item.x < lf.CharCount) /* end of line */				--text_r.corner.x;			text_r.extent.width = 1;		}		else		{			if ((COUNT)pMS->first_item.x == lf.CharCount) /* end of line */				text_r.extent.width = 1;			else				text_r.extent.width = (SIZE)*pchar_deltas;		}		text_r.corner.y = r.corner.y;		text_r.extent.height = r.extent.height;		SetContextForeGroundColor (BLACK_COLOR);		DrawFilledRectangle (&text_r);		SetContextForeGroundColor (ForeGround);		DrawText (&lf);		SetFlashRect (&r, (FRAME)0);	}	ClearSemaphore (&GraphicsSem);	return (TRUE);}