Title screen jumps momentarily on reset

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
SecretServiceDude
Posts: 99
Joined: Wed Oct 22, 2008 3:49 pm
Location: Los Angeles, CA

Title screen jumps momentarily on reset

Post by SecretServiceDude »

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.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

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.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

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.
User avatar
Zepper
Formerly Fx3
Posts: 3264
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

Man... FCEU is so outdated. Why don't you try another emulator?
User avatar
SecretServiceDude
Posts: 99
Joined: Wed Oct 22, 2008 3:49 pm
Location: Los Angeles, CA

Post by SecretServiceDude »

Fx3 wrote:Man... FCEU is so outdated. Why don't you try another emulator?
Fair enough. What do you suggest?
Roth
Posts: 400
Joined: Wed Aug 03, 2005 3:15 pm
Contact:

Post by Roth »

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.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

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.
User avatar
Zepper
Formerly Fx3
Posts: 3264
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

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? ;)
Drag
Posts: 1350
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Post by Drag »

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.
User avatar
SecretServiceDude
Posts: 99
Joined: Wed Oct 22, 2008 3:49 pm
Location: Los Angeles, CA

Post by SecretServiceDude »

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!
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

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.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

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.
User avatar
BMF54123
Posts: 410
Joined: Mon Aug 28, 2006 2:52 am
Contact:

Post by BMF54123 »

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... -_-
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

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.
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Post by Bregalad »

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.
Useless, lumbering half-wits don't scare us.
Post Reply