Mentally ill.
Used other than figuratively or idiomatically: see chemically, imbalanced.
Not quite right mentally: perverted, stupid, or mentally ill.