I'm actually planning on going in depth on this topic sometime. When Link makes the deal to get Majora's Mask for the Happy Mask Salesman a timeloop begins. Even if Link let's the moon collide into Termina without playing the Song of Time, time automatically resets with Link in the Clock Tower...