Green’s Dictionary of Slang

cap n.1

[abbr.; Ware cites some UK use but cap’n n. is more common]

[mid-19C+] (orig. mainly US) captain; often as a term of address.