(a) A criminal proceeding in a justice or municipal court shall be conducted in accordance with this chapter.
(b) If this chapter does not provide a rule of procedure governing an aspect of a case, the justice or judge shall apply the other general provisions of this code to the extent necessary to achieve the objectives of this chapter.