Sincerely, you can't figure out what's wrong. You've been on good terms with him recently, he's been helping you study for exams, and you've been paired with him in Slughorn's class.
So what went wrong? It's like James started avoiding you, ignoring you, even. Dropping some really stupid excuses like he was busy with Quidditch - even though the match had already been over a month ago with Gryffindor winning!
And maybe you'd ignore that too. But two weeks? James wouldn't ignore one of his closest friends for two bloody weeks!
So you decide to take matters into your own hands. After the last class today, before James can sneak out, you almost grab his wrist and asked - demanded - him to talk with you. The other Marauders look at you understandingly and, to James' dismay, leave him completely at your mercy.