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

Possible Vblank issue?

Possible Vblank issue?
by on (#67969)
Image

So there are two pieces of text that are loaded separately with the question first and then the answers second. But with the second part the screen gets pushed down like so for a split second. I'm not sure I really understand what's causing it, but I've stepped through the code in a debugger to isolate the problem. The only thing I've come up with is that the problem happens when the scanline says Idle and then I think when Vblank occurs, it returns to normal. Anyway the problem doesn't happen for every question and in fact I can get it to go away by shortening that text by one character.

To give a little background info this is a translation hack for a mapper 1 game.

Thanks for any help.

by on (#67973)
The answer is 2.

Regarding the "screen getting pushed down" -- probably something messing with $2005, or it could be that the VRAM write routine (for tile/text placement) is taking too long and VBlank fires in the middle.

You're going to need a romhacker who's familiar with assembly to solve the problem. :-)

by on (#67974)
This happens whenever you turn the screen back on during rendering time. Wait until the next vblank before you turn the screen back on.

by on (#67984)
Dwedit wrote:
This happens whenever you turn the screen back on during rendering time.

I thought this was the problem, but then he said that even one character makes a difference... The time of writing a single character is not enough to push the screen down by that much.

Then again, I can't think of anything else, so Dwedit's suggestion of waiting for VBlank before turning rendering back on should be the first thing to try.

by on (#67987)
tokumaru wrote:
The time of writing a single character is not enough to push the screen down by that much.

Unless the single character is enough to push it past the time when T is copied to V, which IIRC is dot 304 of the pre-render line. If T isn't prepared by then (two writes to $2005), the wrong value gets copied to V.

by on (#68079)
I'm afraid I'm a bit lost, but what exactly is T and V? I do consider myself pretty good with NES ASM, but I've only learned what I needed to get by. Naturally, this is new to me.

by on (#68080)
"T" and "V" are nicknames for the latches that drive scrolling.

VRAM address and Scrolling are the same thing on the NES. The NES moves the VRAM address V around while it draws the screen so it knows where to fetch the tiles from. At the end of a scanline, it snaps the address back to the left, assigning the X bits from T to V. At the beginning of the frame, it copies all of the X and Y bits from T to V.
Re: Possible Vblank issue?
by on (#68086)
Pennywise wrote:
Image

To give a little background info this is a translation hack for a mapper 1 game.

Thanks for any help.


Is this for the Unused Quiz Option for Bayou Billy/Mad City (Konami)?
(According to the imagename, I am correct!)

If so, This is good progress of recovery

I looked at that in BMF's Cutting Room Floor Wiki, Some wierd Easter Egg!