(Glide64) Refactor common code as gsSP1Triangle