Can still get hard with masterbating, but no sex drive or random hardness

Hi. My first post on mojo. 46, lived half healthy, half partier lifestyle. Diabetic now. Up until 41 or so, had great sex drive/life. After my mother dying and a very bad (but oversexual) relationship, I just lost my sex drive or ability to get hard enough for sex. I no longer get random boners, but I can masterbate (porn, pics) and it gets hard and I can ejaculate. My last PCP said that he believes it’s all psychological. I haven’t lead the cleanest life and was a drinker and drug user (weekend warrior). My diabetes is controlled and these days I am strong, but my penis just doesn’t seem the same. Thanks in advance for any insight.