rem: MenuSounds = (SOUND)pMS->CurFrame; pMS->CurFrame = 0;
add: SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
context: PickPlanetSide (PMENU_STATE pMS){	BOOLEAN select, cancel;	select = CurrentMenuState.select;	cancel = CurrentMenuState.cancel;	if (GLOBAL (CurrentActivity) & CHECK_ABORT)	{		if (pMenuState->flash_task)		{			ConcludeTask(pMenuState->flash_task);			pMenuState->flash_task = 0;		}		goto ExitPlanetSide;	}	if (!pMS->Initialized)	{		pMS->InputFunc = PickPlanetSide;		SetMenuRepeatDelay (0, 0, 0, FALSE);		if (pMS->CurFrame == 0)		{			pMS->CurFrame = (FRAME)MenuSounds;			MenuSounds = 0;		}		if (!select)		{			RECT r;			pMS->Initialized = TRUE;			LockMutex (GraphicsLock);			SetContext (ScanContext);			pMenuState->flash_rect0.corner.x =					pSolarSysState->MenuState.first_item.x >> MAG_SHIFT;			pMenuState->flash_rect0.corner.y =					pSolarSysState->MenuState.first_item.y >> MAG_SHIFT;			GetContextClipRect (&r);			r.corner.x += pMenuState->flash_rect0.corner.x - (FLASH_WIDTH >> 1);			r.corner.y += pMenuState->flash_rect0.corner.y - (FLASH_HEIGHT >> 1);			r.extent.width = FLASH_WIDTH;			r.extent.height = FLASH_HEIGHT;			LoadDisplayPixmap (&r, pMenuState->flash_frame0);			SetFlashRect (NULL_PTR, (FRAME)0);			UnlockMutex (GraphicsLock);			InitLander (0);			pMenuState->flash_task = AssignTask (flash_planet_loc_func,					2048, "flash planet location");		}	}	else if (select || cancel)	{		STAMP s;		MenuSounds = (SOUND)pMS->CurFrame;		pMS->CurFrame = 0;		LockMutex (GraphicsLock);		DrawStatusMessage (NULL_PTR);		UnlockMutex (GraphicsLock);		FlushInput ();		if (pMenuState->flash_task)		{			ConcludeTask (pMenuState->flash_task);			pMenuState->flash_task = 0;		}		if (!select)			SetPlanetLoc (pSolarSysState->MenuState.first_item);		else		{			COUNT fuel_required;			extern void PlanetSide (PMENU_STATE pMS);			fuel_required = (COUNT)(					pSolarSysState->SysInfo.PlanetInfo.SurfaceGravity << 1					);			if (fuel_required > 3 * FUEL_TANK_SCALE)				fuel_required = 3 * FUEL_TANK_SCALE;			EraseCoarseScan ();			LockMutex (GraphicsLock);			DeltaSISGauges (0, -(SIZE)fuel_required, 0);			SetContext (ScanContext);			s.origin = pMenuState->flash_rect0.corner;			s.frame = SetAbsFrameIndex (misc_data, FLASH_INDEX);			DrawStamp (&s);			UnlockMutex (GraphicsLock);			PlanetSide (pMS);			if (GLOBAL (CurrentActivity) & CHECK_ABORT)				goto ExitPlanetSide;			if (GET_GAME_STATE (FOUND_PLUTO_SPATHI) == 1)			{				HSTARSHIP hStarShip;				extern ACTIVITY NextActivity;				extern void SaveFlagshipState (void);				if (pMenuState->flash_task)				{					ConcludeTask (pMenuState->flash_task);					pMenuState->flash_task = 0;				}				NextActivity |= CHECK_LOAD; /* fake a load game */				GLOBAL (CurrentActivity) |= START_ENCOUNTER;				battle_counter = 0;				PutGroupInfo (0L, (BYTE)~0);				ReinitQueue (&GLOBAL (npc_built_ship_q));				hStarShip = CloneShipFragment (SPATHI_SHIP,						&GLOBAL (npc_built_ship_q), 1);				if (hStarShip)				{					BYTE captains_name_index;					COUNT which_player;					STARSHIPPTR StarShipPtr;					StarShipPtr = LockStarShip (							&GLOBAL (npc_built_ship_q), hStarShip							);					which_player = StarShipPlayer (StarShipPtr);					captains_name_index = NAME_OFFSET + NUM_CAPTAINS_NAMES;					OwnStarShip (StarShipPtr, which_player, captains_name_index);					UnlockStarShip (							&GLOBAL (npc_built_ship_q), hStarShip							);				}				SaveFlagshipState ();				return (FALSE);			}			if (optWhichCoarseScan == OPT_PC)				PrintCoarseScanPC ();			else				PrintCoarseScan3DO ();		}		DrawMenuStateStrings (PM_MIN_SCAN, DISPATCH_SHUTTLE);		LockMutex (GraphicsLock);		SetFlashRect ((PRECT)~0L, (FRAME)0);		UnlockMutex (GraphicsLock);ExitPlanetSide:		if (pMS->CurFrame)		{			MenuSounds = (SOUND)pMS->CurFrame;			pMS->CurFrame = 0;		}		pMS->InputFunc = DoScan;		pMS->CurState = DISPATCH_SHUTTLE;		SetDefaultMenuRepeatDelay ();	}	else	{		SIZE dx = 0, dy = 0;		POINT new_pt;		new_pt = pSolarSysState->MenuState.first_item;		if (CurrentMenuState.left) dx = -1;		if (CurrentMenuState.right) dx = 1;		if (CurrentMenuState.up) dy = -1;		if (CurrentMenuState.down) dy = 1;		dx = dx << MAG_SHIFT;		if (dx)		{			new_pt.x += dx;			if (new_pt.x < 0)				new_pt.x += (MAP_WIDTH << MAG_SHIFT);			else if (new_pt.x >= (MAP_WIDTH << MAG_SHIFT))				new_pt.x -= (MAP_WIDTH << MAG_SHIFT);		}		dy = dy << MAG_SHIFT;		if (dy)		{			new_pt.y += dy;			if (new_pt.y < 0 || new_pt.y >= (MAP_HEIGHT << MAG_SHIFT))				new_pt.y = pSolarSysState->MenuState.first_item.y;		}		if (new_pt.x != pSolarSysState->MenuState.first_item.x				|| new_pt.y != pSolarSysState->MenuState.first_item.y)		{			DWORD TimeIn;			TimeIn = GetTimeCounter ();			SetPlanetLoc (new_pt);			SleepThreadUntil (TimeIn + ONE_SECOND / 40);		}	}	return (TRUE);}