royal soverign and mars lost their foremasts , and on the other side , gravina , who made it into cadiz before the worst of the weather struck , was immediately ordered out again into the teeth of the gale , his ship , the prince of astoria was dismasted and limped back into port .