Page 1 of 1

Possible Vblank issue?

Posted: Wed Sep 29, 2010 9:54 pm
by Pennywise
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.

Posted: Thu Sep 30, 2010 2:58 am
by koitsu
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. :-)

Posted: Thu Sep 30, 2010 7:52 am
by Dwedit
This happens whenever you turn the screen back on during rendering time. Wait until the next vblank before you turn the screen back on.

Posted: Thu Sep 30, 2010 12:04 pm
by tokumaru
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.

Posted: Thu Sep 30, 2010 12:48 pm
by tepples
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.

Posted: Sun Oct 03, 2010 2:49 pm
by Pennywise
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.

Posted: Sun Oct 03, 2010 3:12 pm
by Dwedit
"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?

Posted: Sun Oct 03, 2010 8:16 pm
by Hamtaro126
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!