In the medieval period the wall circuit was expanded. Via Vittorio Emanuele continued to be the main road east-west through the walled city. West gate was still Porta Nuova, the circuit continued to Corso Alberti, to Piazza Vittorio Emanuele Orlando where it turned east along Via Volturno to Piazza Verdi and along the line of Via Cavour. At this north-east corner there was a defence, Castello a Mare, to protect the port at La Cala. A huge chain was used to block La Cala with the other end at S Maria della Catena (St Mary of the Chain). The sea-side wall was along the western side of Foro Italico Umberto. The wall turns west along the northern side of Via Abramo Lincoln, continues along Corso Tukory. The wall turns north approximately on Via Benedetto, to Palazzo dei Normanni and back to Porta Nuova. Source: Palermo - City Guide by Adriana Chirco, 1998, Dario Flaccovio Editore.

What was the purpose of Castello a Mare?