Horizontal stripes in "Super Mario Bros."

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

User avatar
DRW
Posts: 2195
Joined: Sat Sep 07, 2013 2:59 pm

Horizontal stripes in "Super Mario Bros."

Post by DRW »

Today, I noticed something with "Super Mario Bros.": When I played it, horizontal lines appeared on the screen sometimes.

Unfortunately, when I got my camera from the cellar, the issues didn't appear anymore, so I have to simulate it with an emulator screenshot.
If I remember correctly, it looked similar to this:
Image

Sometimes it appears in black, sometimes in white and here it appeared in green.

It's definitely not an interference from the video cable or from the TV itself since this only happens with SMB and no other game. But it doesn't happen whenever I have the cartridge in the console. Although I remember that the same thing happened two years ago as well, so it's not a new phenomenon.

My question is: Is this some software-related glitch that happens on all cartridges since it's part of the code? Or is it an issue that happens due to faulty or dirty contacts?
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
User avatar
rainwarrior
Posts: 8719
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Horizontal stripes in "Super Mario Bros."

Post by rainwarrior »

It's a bug in the game (or a bug in the hardware, depending on your point of view).

Thread discussing it: viewtopic.php?f=2&t=10104

Basically if you write to $2000 mid-screen there's a chance it'll mess up the scroll for that line. Super Mario Bros. tries to turn off the NMI flag to prevent re-entrant NMI (e.g. if there are too many creatures onscreen and there is slowdown) but when it's done and turns it back on, sometimes the timing conflicts perfectly with a rendering operation that causes this glitch.
User avatar
DRW
Posts: 2195
Joined: Sat Sep 07, 2013 2:59 pm

Re: Horizontal stripes in "Super Mario Bros."

Post by DRW »

Thanks. So, that means nothing is wrong with my cartridge and I don't have to buy a new one..
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
Pokun
Posts: 2520
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Horizontal stripes in "Super Mario Bros."

Post by Pokun »

This bug doesn't exist on PAL systems nor on VS System PPUs I heard. I had never seen it before I got my Famicom.
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Horizontal stripes in "Super Mario Bros."

Post by Sik »

rainwarrior wrote:It's a bug in the game (or a bug in the hardware, depending on your point of view).

Thread discussing it: viewtopic.php?f=2&t=10104

Basically if you write to $2000 mid-screen there's a chance it'll mess up the scroll for that line. Super Mario Bros. tries to turn off the NMI flag to prevent re-entrant NMI (e.g. if there are too many creatures onscreen and there is slowdown) but when it's done and turns it back on, sometimes the timing conflicts perfectly with a rendering operation that causes this glitch.
This was my first thought, except for the fact the glitch line is green. Unless it turns out DRW got confused and it was just the same color as the bricks, that is.
User avatar
mikejmoffitt
Posts: 1353
Joined: Sun May 27, 2012 8:43 pm

Re: Horizontal stripes in "Super Mario Bros."

Post by mikejmoffitt »

Sik wrote:
rainwarrior wrote:It's a bug in the game (or a bug in the hardware, depending on your point of view).

Thread discussing it: viewtopic.php?f=2&t=10104

Basically if you write to $2000 mid-screen there's a chance it'll mess up the scroll for that line. Super Mario Bros. tries to turn off the NMI flag to prevent re-entrant NMI (e.g. if there are too many creatures onscreen and there is slowdown) but when it's done and turns it back on, sometimes the timing conflicts perfectly with a rendering operation that causes this glitch.
This was my first thought, except for the fact the glitch line is green. Unless it turns out DRW got confused and it was just the same color as the bricks, that is.
It was probably at a different place, where there were pipes on-screen.
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Horizontal stripes in "Super Mario Bros."

Post by Sik »

Oh right, I forgot about the pipes =S (could have been the pipes that lead to the bonus stage)
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Re: Horizontal stripes in "Super Mario Bros."

Post by thefox »

Arkanoid seems to suffer from the same problem.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
User avatar
Memblers
Site Admin
Posts: 3995
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: Horizontal stripes in "Super Mario Bros."

Post by Memblers »

I remember seeing it happen in Zelda 2, in the side-scrolling areas.

Also, kevtris found a spot in Rygar where this glitch seems to be reproducible. I'm pretty sure it was this same glitch. It's in the second area, immediately after the sunset area. There's a tree with a door on the left branch, and a rope on the right. Climbing near the top of that rope caused it to happen. Just going by memory, hope I'm remembering right.
User avatar
kevtris
Posts: 504
Joined: Sat Oct 29, 2005 2:09 am
Location: Indianapolis
Contact:

Re: Horizontal stripes in "Super Mario Bros."

Post by kevtris »

Rygar also has this problem. I discovered it on the HDMI adapter work. If you go up the first rope you come to, go across 1 screen then down the 2nd rope and just hang on the rope, one of the scanlines of the tree trunk will wiggle occasionally. After seeing it there, I saw it easily on SMB and several other games, too.

At first I thought it was the adapter but turns out it is in the PPU. Also, the EXT pins will glitch sometimes when 2000 is written to also, which causes the pixels to "sparkle" because they seem to glitch a little bit (saw this on the logic analyzer).

I had to add a facility to control which PPU/CPU alignment is in use to kill the sparkling. Interestingly it does not stop the scanline wiggling though. The "Desparkle" setting is really a CPU/PPU alignment selector. It actively changes the alignment during operation by dropping PPU clock(s) occasionally to force one of the alignments.
/* this is a comment */
User avatar
Dwedit
Posts: 4833
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Horizontal stripes in "Super Mario Bros."

Post by Dwedit »

thefox wrote:Arkanoid seems to suffer from the same problem.
That game has horizontal mirroring and shouldn't have that problem at all.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Re: Horizontal stripes in "Super Mario Bros."

Post by thefox »

Dwedit wrote:
thefox wrote:Arkanoid seems to suffer from the same problem.
That game has horizontal mirroring and shouldn't have that problem at all.
Yeah that's why I was a little bit surprised to see it, but I wasn't sure whether I should trust the thread's assessment that the problem doesn't happen with horizontal mirroring.

You can draw your own conclusions from this Twitch stream capture: http://www.twitch.tv/themexicanrunner/v/8625249 (requires Flash). You can see the glitch at around 10:55 mark, then again at around 11:06 (these are not the only places, just what I could find quickly right now). Based on an emulator breakpoint the game typically writes to $2000 around scanlines 40-60 (depends on game load and can vary by more than that), which matches up with where the glitch shows up in the video.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
User avatar
tokumaru
Posts: 12385
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Horizontal stripes in "Super Mario Bros."

Post by tokumaru »

Dwedit wrote:That game has horizontal mirroring and shouldn't have that problem at all.
...and we're back to trying to figure this out! :lol:
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Re: Horizontal stripes in "Super Mario Bros."

Post by thefox »

Another one to the list of games where this happens: Rambo (vertical mirroring)
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
User avatar
|darc|
Posts: 2
Joined: Wed Mar 06, 2013 1:25 am

Re: Horizontal stripes in "Super Mario Bros."

Post by |darc| »

Has anyone tested different PPUs to see if perhaps this was fixed in a later revision? I recently restored and NESRGB-modded another NES, and I started noticing this a lot on that console while playing SMB1 yesterday. On my other NESRGB-modded NES, I never really noticed this. Maybe I just got lucky and that NES didn't boot in that CPU-PPU alignment much when I played SMB1.

EDIT: Well, I just tried the glitch test rom on both consoles, and I get the glitch on both. But still, I wonder if this happens on all PPU revisions.
Post Reply