At the Stage Select screen press C-Up, C-Right, C-Down, C-Left, R, L, Z, C-Up, C-Right, C-Down, C-Left to unlock all stages. A scream will confirm that you've entered the code correctly and the level select has been enabled. Use the analog stick to select stages and worlds at this screen. You can enter both this code and the Unlock Weapons code before any level.
Unlock All Weapons
At the Stage Select screen, press C-Left, C-Down, C-Right, C-Up, Z, L, R, C-Left, C-Down, C-Right, C-Up to unlock all the weapons in the game. A weapons noise will confirm that you've entered the code correctly and received all the weapons.