Fast sprite rendering routine that supports horizontal and vertical flipping