18 Pa.C.S.A. §315.  Insanity.

(a)  General rule.–The mental soundness of an actor engaged in conduct charged to constitute an offense shall only be a defense to the charged offense when the actor proves by a preponderance of evidence that the actor was legally insane at the time of the commission of the offense.

(b)  Definition.–For purposes of this section, the phrase “legally insane” means that, at the time of the commission of the offense, the actor was laboring under such a defect of reason, from disease of the mind, as not to know the nature and quality of the act he was doing or, if the actor did know the quality of the act, that he did not know that what he was doing was wrong.