Several seconds after starting my game, there's a single frame where the music seems to pop/skip. I've run the game on Nestopia, Nintendulator and FCEU, but the anomaly only crops up on Nestopia.
According to the wiki, reading PPUSTATUS at the exact start of NMI can cause the program to lose frames, but AFAIK I'm not doing that.
...Or am I?
Sorry I don't have more detailed info than that. Any ideas?
My game's music skips a frame in Nestopia
Moderator: Moderators
- SecretServiceDude
- Posts: 99
- Joined: Wed Oct 22, 2008 3:49 pm
- Location: Los Angeles, CA
Well, usually you don't read $2002 in the main programm except when waiting for sprite zero hits, and when you do that you know a VBlank isn't going to be triggered. So I guess you aren't, but I can't guarantee that....Or am I?
Are you sure your emulator runs at full speed ? This may simply be due to lag if your computer isn't powerfull enough, altough it's not likely that it will happen at a predictable time.
You also should make sure you (or the music engine you use) don't assume any values in RAM. Usually you'd want to clear $000-$7ff with zeroes manually. Nestopia is one of the only emulators to fill the RAM with garbage instead of full clean $00s.
Useless, lumbering half-wits don't scare us.
- SecretServiceDude
- Posts: 99
- Joined: Wed Oct 22, 2008 3:49 pm
- Location: Los Angeles, CA
At first I thought it might be lag, but the skip always occurs at the same time on my computer, regardless of whether or not other programs are running in the background.Bregalad wrote:Are you sure your emulator runs at full speed ? This may simply be due to lag if your computer isn't powerfull enough, altough it's not likely that it will happen at a predictable time.
I clear out $000-$7ff with zeroes in the reset handler, except for sprite OAM, which I fill with $fe.Bregalad wrote:You also should make sure you (or the music engine you use) don't assume any values in RAM. Usually you'd want to clear $000-$7ff with zeroes manually. Nestopia is one of the only emulators to fill the RAM with garbage instead of full clean $00s.
I get occasional single-frame lags in Nestopia all the time, in every game, probably as a result of it running slightly slower than my screen's refresh rate. The easiest way to see if it's emulator-related (if your computer's fast enough) is to turn on the NTSC filter, disable field merging, enable Vsync, and make sure you're running a 60Hz video mode. If the NTSC flickering "hiccups" at the same time your sound lags, then it's an emulator issue.
Another thing you could do is put a sprite somewhere onscreen that alternates between black and white each frame. That would be easier to catch than an NTSC hiccup.
Another thing you could do is put a sprite somewhere onscreen that alternates between black and white each frame. That would be easier to catch than an NTSC hiccup.
- BMF
RuSteD LOgIc
RuSteD LOgIc