This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

VBlank glitch - unwanted scrolling

VBlank glitch - unwanted scrolling
by on (#42196)
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

by on (#42198)
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.

by on (#42199)
It's a beautiful gray screen on FCEUX.

by on (#42201)
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!

by on (#42203)
Tempo = 1 is fast. Maybe something is overflowing.

by on (#42206)
Totally, but after all, no meotronome has less than 40 of tempo, so I'll limit to that.

Thanks!