The proceedings shall be given preference and be determined promptly. A defendant in custody may be present in court in the court's discretion and shall be entitled to be present when oral testimony is adduced on a material issue of fact within the defendant's personal knowledge.