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

Title screen jumps momentarily on reset

Title screen jumps momentarily on reset
by on (#39407)
When I reset the ROM in FCEU, the title screen jumps downward by several dozen scanlines* for about one or two frames.

Image

The image on the left shows how the title screen usually looks. The image on the right shows what happens for the first frame or so after resetting the ROM. Note that the metallic highlights (which are sprites) are not affected.

As a workaround, on reset I blank the screen by setting every palette entry to the background color, then wait for a few frames before switching to the real palette.

The workaround is effective, and it seems like many commercial NES games do the same thing; however, I was wondering if somebody could give a technical explanation of why the jump might be occurring. If there's a proper way to prevent it, that's what I'd prefer to do, since clearing the palette feels like a kludge.

* In case it helps, the image above shows a jump of exactly 57 scanlines.

by on (#39408)
It's probably because you're setting the scroll mid-frame. Try first displaying the screen by turning it on in the NMI/Vblank. That may solve your problem.

by on (#39409)
Actually, you are probably turning rendering on in the middle of a frame. I imagine that the lighter green is your color 0, so it's displayed at the top of the screen while rendering is still off. When you turn it on, then the PPU starts rendering from the point you defined as the top of your screen (but because rendering started in the middle of the frame it's in the middle of the frame instead of the top!).

What Celius suggested will probably fix it. Wait for VBlank before enabling rendering.

In fact this is the exact same problem we were started discussing here. I suggested a pretty clen fix at the end of this post.

by on (#39444)
Man... FCEU is so outdated. Why don't you try another emulator?

by on (#39447)
Fx3 wrote:
Man... FCEU is so outdated. Why don't you try another emulator?

Fair enough. What do you suggest?

by on (#39448)
From what I've worked on recently, it seems to me that Nestopia has been becoming the most accurate, but I have to always set it to Above Normal priority just to make it run well on my system :/ So, I usually use Nintendulator for most of my preliminary tests. I also use FCEUXD SP when I need to use a hex viewer while it runs. After I've got it how I want it to run on Nintendulator, I usually test against Nestopia after that, since I tire of setting the priority everytime I boot it up.

by on (#39449)
Fx3 wrote:
Man... FCEU is so outdated. Why don't you try another emulator?


I see no better emulator for debugging than FCEUXD. If Nestopia had good/any debugging features, I would definitely use it.

by on (#39451)
Celius wrote:
Fx3 wrote:
Man... FCEU is so outdated. Why don't you try another emulator?


I see no better emulator for debugging than FCEUXD. If Nestopia had good/any debugging features, I would definitely use it.


Correct. What's the point of debugging from something outdated and possibly inaccurate? ;)

by on (#39455)
Fx3 wrote:
Celius wrote:
Fx3 wrote:
Man... FCEU is so outdated. Why don't you try another emulator?


I see no better emulator for debugging than FCEUXD. If Nestopia had good/any debugging features, I would definitely use it.


Correct. What's the point of debugging from something outdated and possibly inaccurate? ;)


With all of the branches that it's had, you'd think someone would come along to try making one that improves the accuracy, while keeping all of the debugging features.

by on (#39457)
tokumaru wrote:
Actually, you are probably turning rendering on in the middle of a frame. I imagine that the lighter green is your color 0, so it's displayed at the top of the screen while rendering is still off. When you turn it on, then the PPU starts rendering from the point you defined as the top of your screen (but because rendering started in the middle of the frame it's in the middle of the frame instead of the top!).

What Celius suggested will probably fix it. Wait for VBlank before enabling rendering.

That was totally it. The problem is fixed now. Thanks!

by on (#39458)
Drag wrote:
With all of the branches that it's [FCEUXD] had, you'd think someone would come along to try making one that improves the accuracy, while keeping all of the debugging features.

Could be pasta, which many people don't like dealing with.

by on (#39460)
I'm glad it worked, SSD! I had that problem for a while too, but that fixed it.

Fx3 wrote:
Celius wrote:
Fx3 wrote:
Man... FCEU is so outdated. Why don't you try another emulator?


I see no better emulator for debugging than FCEUXD. If Nestopia had good/any debugging features, I would definitely use it.


Correct. What's the point of debugging from something outdated and possibly inaccurate? ;)


I see your point, but mostly for basic debugging is what I meant, not for really hardware specific things. Nintendulator would be the next best option to debug with, but it's ease of use doesn't compare to FCEUXD's. And if you're going to try debug with Nestopia, you might as well try and debug on an actual NES; it has about just as much debugging capabilities.

On a side note, I don't meant to sound like a dick when I say this, but you really don't have to use ";)" with every post. It starts to lose it's meaning after a while.

by on (#39466)
Nestopia would be my primary emulator if it didn't exhibit severe input lag in full-screen mode with Vsync enabled. It also seems to have a very obscure input bug that will sometimes cause a button to stick for several frames. IIRC, I found only one mention of it on the forums, and it was pretty much shrugged off... -_-

by on (#39486)
I never had performance issues with Nestopia in any of my PCs, and it is my emulator of choice for playing and testing. Vsync is a must for me and I've never had problems because of it.

For debugging, nothing beats FCEUXD. Nintendlator's debugger is very unfriendly, and those hardcoded levels of debugging are a pain... Why can't you pick the individual windows you need like in FCEUXD? So I usually end up using Nintendulator only for testing, because it's accuracy used to be legendary (but I don't even know if this is the case anymore, as Nestopia is getting pretty damn accurate too).

When developing, I always keep these 3 emulators open. I use Nestopia the most though, with every build of the game. I use the others occasionally, and to track down bugs.

by on (#39488)
Quote:
I never had performance issues with Nestopia in any of my PCs, and it is my emulator of choice for playing and testing. Vsync is a must for me and I've never had problems because of it.

Same here. Nestopia was slow on my PC 3 years ago before I switched, tough.

And like tokumary said I also use mostly Nestopia and also Virtua NES. Virtua NES isn't very accurate but it's damn fast and you can get a lot of features using only one keyboad key without having to deal with menus and all, that's why I love that emulator to debug things as quickly as possible.

by on (#39489)
Yeah, VirtuaNES is my emulator of choice if the there are people using the TV, and I can't use the NES. To me, it's by far the best emulator in terms of speed, and still keeping updated enough to be worth something. I've been using v.092 though, because my old retrousb controller wouldn't work with v.092, so I never bothered updating.

I don't know why Nestopia runs slow on my system, because it didn't use to. I have a 3200+ AMD processor and 512 of RAM, so I don't know what gives. I do know that the accuracy of the games has been surpassing Nintendulator though, as when I was developing Tic-Tac XO, I found a problem with the way I was doing delays back then. I was actually doing a very cruddy way, which I didn't know at the time, where I was constantly waiting for vblanks. Of course vblanks get missed, but the side effect is that even playing music in the NMI causes the tune to drag. This wouldn't happen in Nintendulator, and the only way I found this happening before testing on an NES was through testing in Nestopia.

More recently, my minigame compo entry !Clik! has a problem with saving a high score on reset, which apparently has something to do with the way I handled CHR-RAM. This only happened in Nestopia, but then was confirmed on the NES itself from two different people.

So, this is why I use Nestopia as my "test before hardware test emulator". It just seems to have surpassed Nintendulator in that respect, though I wish it wouldn't have, because Nintendulator runs so much better on my system.

I can't say I ever had any input lag on Nestopia though. It's just an issue of having to set priority on it, for me.