A machine comprising a swing mechanism and a hydraulic control system, the hydraulic control system comprising: a closed-loop hydraulic circuit including a hydraulic motor and at least one variable displacement pump configured to supply the at least one hydraulic motor with pressurized hydraulic fluid; at least one actuator configured to adjust the displacement of the at least one variable displacement pump; a control unit configured to: receive a first input indicative of a desired displacement of the at least one variable displacement pump; receive a second input indicative of an actual displacement of the at least one variable displacement pump; and control the at least one actuator to adjust the displacement of the at least one variable displacement pump in a first control mode when the actual displacement does not match the desired displacement, and in a second control mode when the actual displacement matches the desired displacement; and an input device configured to receive an operator input corresponding to a desired speed and direction of rotation of a swing mechanism of the machine, wherein the control unit is operatively coupled to the input device and configured to determine the desired displacement of the at least one variable displacement pump based at least in part on the desired speed and direction of rotation, and characterised in that the first control mode is a pressure control mode in which the control unit controls the at least one actuator such that a system pressure in the closed-loop hydraulic circuit does not exceed a maximum desired system pressure set at least in part on the basis of the absolute value of the desired speed of the swing mechanism. a closed-loop hydraulic circuit including a hydraulic motor and at least one variable displacement pump configured to supply the at least one hydraulic motor with pressurized hydraulic fluid; at least one actuator configured to adjust the displacement of the at least one variable displacement pump; a control unit configured to: receive a first input indicative of a desired displacement of the at least one variable displacement pump; receive a second input indicative of an actual displacement of the at least one variable displacement pump; and control the at least one actuator to adjust the displacement of the at least one variable displacement pump in a first control mode when the actual displacement does not match the desired displacement, and in a second control mode when the actual displacement matches the desired displacement; and receive a first input indicative of a desired displacement of the at least one variable displacement pump; receive a second input indicative of an actual displacement of the at least one variable displacement pump; and control the at least one actuator to adjust the displacement of the at least one variable displacement pump in a first control mode when the actual displacement does not match the desired displacement, and in a second control mode when the actual displacement matches the desired displacement; and an input device configured to receive an operator input corresponding to a desired speed and direction of rotation of a swing mechanism of the machine, wherein the control unit is operatively coupled to the input device and configured to determine the desired displacement of the at least one variable displacement pump based at least in part on the desired speed and direction of rotation, and characterised in that the first control mode is a pressure control mode in which the control unit controls the at least one actuator such that a system pressure in the closed-loop hydraulic circuit does not exceed a maximum desired system pressure set at least in part on the basis of the absolute value of the desired speed of the swing mechanism.