add: TFB_ReleaseColorMap();
context: SellMinerals (RESPONSE_REF R){	COUNT i, total;	BOOLEAN Sleepy;	RESPONSE_REF pStr1, pStr2;	total = 0;	Sleepy = TRUE;	for (i = 0; i < NUM_ELEMENT_CATEGORIES; ++i)	{		COUNT amount;		DWORD TimeIn;		if (i == 0)		{			DrawCargoStrings ((BYTE)~0, (BYTE)~0);			SleepThread (ONE_SECOND / 2);			TimeIn = GetTimeCounter ();			DrawCargoStrings ((BYTE)0, (BYTE)0);		}		else if (Sleepy)		{			DrawCargoStrings ((BYTE)(i - 1), (BYTE)i);			TimeIn = GetTimeCounter ();		}		if (amount = GLOBAL_SIS (ElementAmounts[i]))		{			total += amount * GLOBAL (ElementWorth[i]);			do			{				if (!Sleepy || AnyButtonPress (TRUE))				{					Sleepy = FALSE;					GLOBAL_SIS (ElementAmounts[i]) = 0;					GLOBAL_SIS (TotalElementMass) -= amount;					SetSemaphore (GraphicsSem);					DeltaSISGauges (0, 0, amount * GLOBAL (ElementWorth[i]));					ClearSemaphore (GraphicsSem);					break;				}								--GLOBAL_SIS (ElementAmounts[i]);				--GLOBAL_SIS (TotalElementMass);				TaskSwitch ();				TimeIn = GetTimeCounter ();				DrawCargoStrings ((BYTE)i, (BYTE)i);				SetSemaphore (GraphicsSem);				ShowRemainingCapacity ();				DeltaSISGauges (0, 0, GLOBAL (ElementWorth[i]));				ClearSemaphore (GraphicsSem);			} while (--amount);		}		if (Sleepy) {			SleepThreadUntil (TimeIn + (ONE_SECOND / 4));			TimeIn = GetTimeCounter ();		}	}	SleepThread (ONE_SECOND / 2);	SetSemaphore (GraphicsSem);	ClearSISRect (DRAW_SIS_DISPLAY);	ClearSemaphore (GraphicsSem);// DrawStorageBays (FALSE);	if (total < 1000)	{		total = GET_GAME_STATE (LIGHT_MINERAL_LOAD);		switch (total++)		{			case 0:				pStr1 = LIGHT_LOAD_A0;				pStr2 = LIGHT_LOAD_A1;				break;			case 1:				pStr1 = LIGHT_LOAD_B0;				pStr2 = LIGHT_LOAD_B1;				break;			case 2:				pStr1 = LIGHT_LOAD_C0;				pStr2 = LIGHT_LOAD_C1;				break;			case 3:				pStr1 = LIGHT_LOAD_D0;				pStr2 = LIGHT_LOAD_D1;				break;			case 4:				pStr1 = LIGHT_LOAD_E0;				pStr2 = LIGHT_LOAD_E1;				break;			case 5:				pStr1 = LIGHT_LOAD_F0;				pStr2 = LIGHT_LOAD_F1;				break;			case 6:				--total;				pStr1 = LIGHT_LOAD_G0;				pStr2 = LIGHT_LOAD_G1;				break;		}		SET_GAME_STATE (LIGHT_MINERAL_LOAD, total);	}	else if (total < 2500)	{		total = GET_GAME_STATE (MEDIUM_MINERAL_LOAD);		switch (total++)		{			case 0:				pStr1 = MEDIUM_LOAD_A0;				pStr2 = MEDIUM_LOAD_A1;				break;			case 1:				pStr1 = MEDIUM_LOAD_B0;				pStr2 = MEDIUM_LOAD_B1;				break;			case 2:				pStr1 = MEDIUM_LOAD_C0;				pStr2 = MEDIUM_LOAD_C1;				break;			case 3:				pStr1 = MEDIUM_LOAD_D0;				pStr2 = MEDIUM_LOAD_D1;				break;			case 4:				pStr1 = MEDIUM_LOAD_E0;				pStr2 = MEDIUM_LOAD_E1;				break;			case 5:				pStr1 = MEDIUM_LOAD_F0;				pStr2 = MEDIUM_LOAD_F1;				break;			case 6:				--total;				pStr1 = MEDIUM_LOAD_G0;				pStr2 = MEDIUM_LOAD_G1;				break;		}		SET_GAME_STATE (MEDIUM_MINERAL_LOAD, total);	}	else	{		total = GET_GAME_STATE (HEAVY_MINERAL_LOAD);		switch (total++)		{			case 0:				pStr1 = HEAVY_LOAD_A0;				pStr2 = HEAVY_LOAD_A1;				break;			case 1:				pStr1 = HEAVY_LOAD_B0;				pStr2 = HEAVY_LOAD_B1;				break;			case 2:				pStr1 = HEAVY_LOAD_C0;				pStr2 = HEAVY_LOAD_C1;				break;			case 3:				pStr1 = HEAVY_LOAD_D0;				pStr2 = HEAVY_LOAD_D1;				break;			case 4:				pStr1 = HEAVY_LOAD_E0;				pStr2 = HEAVY_LOAD_E1;				break;			case 5:				pStr1 = HEAVY_LOAD_F0;				pStr2 = HEAVY_LOAD_F1;				break;			case 6:				--total;				pStr1 = HEAVY_LOAD_G0;				pStr2 = HEAVY_LOAD_G1;				break;		}		SET_GAME_STATE (HEAVY_MINERAL_LOAD, total);	}	NPCPhrase (pStr1);	NPCPhrase (GLOBAL_PLAYER_NAME);	NPCPhrase (pStr2);	NormalStarbase (R);}