This has been left out in the current SMW version.
When you hit a goal tape, and spawn a starman (which never happens), this is set to #$01. Now each time you switch an area in a level, this gets multiplied by 2. When this reaches #$80 (changed area seven times), you will start the area with the star power. The instruction which sets this address to #$01 is located at $00:FB5C.