Since you're the founder with the focus on the tech aspect (basically you should be the CTO) what was the reason for hiring the CTO in the first place? A CTO that's obviously not a better software developer than you. Hard facts, but maybe it was your partner who planned this since the very beginning.
After you've talked to your lawyer you could possibly strike a deal with the CTO / CEO and go become an employee if you are interested in just keeping on coding for the company. Maybe getting a bonus that if you decide to leave or still be on the companies payroll provided that the company reach a certain revenue / value etc.