When a motion is based on facts not appearing of record the court may hear the matter on affidavits presented by the respective parties, but the court may direct that the matter be heard wholly or partly on oral testimony or depositions.
Upon motion of any party for a hearing pursuant to § 21-1-4.1, the court shall consider and decide the matter prior to trial.
SDCL 15-6-43(e)