VBlank glitch - unwanted scrolling

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
User avatar
Petruza
Posts: 311
Joined: Mon Dec 22, 2008 10:45 pm
Location: Argentina

VBlank glitch - unwanted scrolling

Post by Petruza »

Hi, I've made the first version of the metronome App with my NES library which is also under development.

The only modification to VRAM that I make after each VBlank is update one of three numbers, with a function that reads a 3 character string and outputs it to a Name table using an array that transforms ASCII codes into actual tile numbers.
I didn't think that would be so slow to make glitches!

What it happens is that when a number is printed, for like one frame the background scrolls so that the 0,0 of the first tile of the string being printed becomes the 0,0 of the screen, I can see this clearly with FCEXUD.

Can you tell me if this problem is that it just takes too long after Vblank or is it something else?
Is this unwanted scrolling a normal glitch when violating the VBlank period?
Thanks!

http://petruza.com.ar/rnes/NEStronome.nes
User avatar
Disch
Posts: 1848
Joined: Wed Nov 10, 2004 6:47 pm

Post by Disch »

Make sure you set the scroll (write to $2000 and twice to $2005) after you finish all your PPU drawing in VBlank. Remember that $2006 and $2007 mess with the scroll -- so you need to reset your scroll after you finish with those regs.
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

It's a beautiful gray screen on FCEUX.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
Petruza
Posts: 311
Joined: Mon Dec 22, 2008 10:45 pm
Location: Argentina

Post by Petruza »

Disch wrote:Make sure you set the scroll (write to $2000 and twice to $2005) after you finish all your PPU drawing in VBlank. Remember that $2006 and $2007 mess with the scroll -- so you need to reset your scroll after you finish with those regs.
Yayyyy! thanks! that was it.
Maybe my library is not so slow after all... :D
Dwedit wrote:It's a beautiful gray screen on FCEUX.
But How beautiful!! No, really, now that you told me, yes, you're right, but it works on FCEUxd and some other emus... :?

Problem solved!
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

Tempo = 1 is fast. Maybe something is overflowing.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
Petruza
Posts: 311
Joined: Mon Dec 22, 2008 10:45 pm
Location: Argentina

Post by Petruza »

Totally, but after all, no meotronome has less than 40 of tempo, so I'll limit to that.

Thanks!
Post Reply