I won't attempt to "re-invent the wheel", so here goes:
St. Augustine, "Treatise on Baptism"
"When we speak of within and without in relation to the Church, it is the position of the heart that we must consider, not that of the body."
St. Bernard, "De Baptismo"
"What is clearer than that the will is taken for the act, when the act is excluded by necessity?"
St. Thomas Aquinas "Summa Theologica"
"...a man receives the effect of Baptism by the power of the Holy Ghost, not only without Baptism of Water, but also without Baptism of Blood: forasmuch as his heart is moved by the Holy Ghost to believe in and love God and to repent of his sins: wherefore this is also called Baptism of Repentance."
St. Thomas Aquinas "Summa Theologica"
"So also before Baptism Cornelius and others like him receive grace and virtues through their faith in Christ and their desire for Baptism, implicit or explicit"
St. Thomas Aquinas "Summa Theologica"
"man receives the forgiveness of sins before Baptism in so far as he has Baptism of desire, explicitly or implicitly"
"Catechism of the Council of Trent":
"....should any unforeseen accident deprive adults of baptism, their intention of receiving it, and their repentance for past sins, will avail them to grace and righteousness." [section on baptism]
"...such is the efficacy of true contrition...that through it we obtain from God the immediate pardon of our sins." [section on penance]