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.
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. :-)
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.
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.
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.
"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.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!