To unlock all levels, select two player mode, then enter "hg?" as your initials. Return to the main menu and start a single-player game. At the world selection screen, hold L + R and press Select to unlock all levels. To lock all levels, hold L + R and press Select again.