When two or more defendants are jointly charged with any public offense, whether felony or misdemeanor, they must be tried jointly, unless the court order separate trials. In ordering separate trials, the court in its discretion may order a separate trial as to one or more defendants, and a joint trial as to the others, or may order any number of the defendants to be tried at one trial, and any number of the others at different trials, or may order a separate trial for each defendant; provided, that where two or more persons can be jointly tried, the fact that separate accusatory pleadings were filed shall not prevent their joint trial.
Ca. Pen. Code § 1098