From my travel guide I get the information that this castle was founded by the Knights of St. John of Jerusalem, who were based on Rhodos but liked the opportunity of having a stronghold in Bodrum when that was captured in 1402. It’s called the Castle of St. Peter and houses the excellent (that’s me writing) Museum of Underwater Archeology.
This is a view from one wall, some harbour in the background.