You know that little coin at the scoreboard which represents all the coins you collected?
I tried messing around with it, but sometimes the bottom pixels got all messed up and sometimes mario doesn't appear on screen, making the game unplayable.
Whats up with that coin?
That coin is part background, part sprite. The sprite is also sprite 0, the overlap of which with the background is what is used to time the scrolling split at the bottom of the status bar.
So... be careful when messing around with it. You'll need to account for both the background portion, and the sprite portion, and you need to make sure some of the sprite still overlaps the background to make sure the scrolling split takes place.
SMB1 uses the sprite 0 hit flag (a flag that gets set when a non-transparent pixel in sprite 0 overlaps - or underlaps, depending on the sprite's drawing priority - a non-transparent background pixel) to detect when the status bar is about to finish rendering, so it can change the scroll for the gameplay area of the screen. If you mess up the alignment between the sprite and the background, the hit will not happen and the program won't be able to properly prepare for the gameplay portion of the screen.