I saw this movie on a VHS in the early 1990s. It was most likely an English language movie, in color. I vaguely remember it was a western when one or more of the characters at some point were about to be hanged, but someone shot down the ropes when they were about to go down and they escaped. I definitely remember the last scene though: it was a harbor with some sail ship present but then a black steam ship appeared and a fight took place aboard it. On of the characters placed a cannon shell in the way of a rotating gun turret and it got blown up after triggering the shell.