Dude, I know exactly where you're coming from. I fell for one my straight friends when I started film school. I fell for him hard. And it did eat me up inside. We joked around just like you and your friend do. It took me a while to get to the point where I said look, he's never going to feel the same for me. Just move on.
But of course it's never that easy. My feelings for him just got stronger. Basically wanting something I couldn't have made me want him more. At this time I was still in the closet. It reached the point where I would go home angry at no one and nothing in particular. Just outright frustrated and the only thing that would calm me down was listening to bands like Disturbed or Korn or Slipknot.
It reached a point where I had to fess up for my own mental well-being. So, I gathered my wits and told him that I'm bi. I didn't tell him I had a crush on him in words exactly, but he said he had a feeling that I did, he just didn't know how to approach the topic.
From there, not a whole lot changed. Our joking around changed for a short period of time while he was still getting used to the idea of having a bi friend. But now we joke around just like before. Telling him did help me get over him. Now I'd be lying if I told you that I don't find him attractive, cuz I still do, but I no longer feel the need to become more with him. Telling him brought as closer as friends, and now I consider him one of my closest. And I know he thinks the same of me.
I know he and I will never be boyfriends. I know I'll never have him physically. And you know what? I actually don't care anymore. I'm perfectly happy the way things are between us now.
I knew you didn't ask for it exactly, but that's my story. Take what you will from it. As much as the situation can suck, it's at least not hopeless.