Post subject: Idea for a new tool: Lag detection?
Active player (325)
Joined: 2/23/2005
Posts: 786
Frame advance is useful and powerful, but it can be foiled by one thing: heavy lag. Not knowing what button presses will be ineffective can annoy just about anyone. So, how's this for an idea: A lag detector. It would work something like this: When lag detection is enabled, every time you hit the Frame Advance key, it would emulate the next frame, then compare the output images. If they are identical, it would display an indicator (maybe a little red box) which would tell you that maybe your next keypress will not have an effect. Obviously it would need to be configurable, to allow for games with different properties. For example, some games might require you to compare the 2nd and the 3rd frame from the current one you're on, or the 3rd and the 4th, depending on the input lag or whatever. I think this would be really useful.
Active player (278)
Joined: 5/29/2004
Posts: 5712
The nice thing about Mupen 64 is that you can't press a button on lag frames, because input is only accepted when the game "requests" it. It means you have to watch the frame counter carefully, though, to see when it goes up by more than 1 at a time.
put yourself in my rocketpack if that poochie is one outrageous dude
nesrocks
He/Him
Player (241)
Joined: 5/1/2004
Posts: 4096
Location: Rio, Brazil
If we could toggle it on/off then i think it's a really nice feature, but for the purpose of detecting ramdom frames of lag during a movie instead of the input issue. I just wonder how hard and cpu expensive it would be to compare 2 frames...
Active player (278)
Joined: 5/29/2004
Posts: 5712
Oh, but it's comparing output images? I'm not sure that's a great idea. Sometimes a game just looks static for a while.
put yourself in my rocketpack if that poochie is one outrageous dude
nesrocks
He/Him
Player (241)
Joined: 5/1/2004
Posts: 4096
Location: Rio, Brazil
Well but then the user would know it's not lag.
Active player (278)
Joined: 5/29/2004
Posts: 5712
I still think you could look deeper into the hardware to detect it...
put yourself in my rocketpack if that poochie is one outrageous dude
Player (36)
Joined: 9/11/2004
Posts: 2623
That would be highly nontrivial as every game handles lag in a different way.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Active player (325)
Joined: 2/23/2005
Posts: 786
I don't think comparing images would be too terribly bad. Small pictures, limited palette, and most of the time, it would only have to stop after the first pixel. And it would only be available when using frame advance, which would allow for that extra time.
Emulator Coder, Skilled player (1300)
Joined: 12/21/2004
Posts: 2687
At least a few NES games don't show the same image when they're lagging, since the sprites shake or something else happens during the lag. (For example, Snake Rattle n' Roll, Kabuki Quantum Fighter, and Double Dragon all seem to do this.) I'd think it would be more reliable and useful to detect the lag some other way (check if the input was used if that's possible, or use some other tell-tale sign of lag (probably something in the emulation timing) otherwise), and if there was lag and a certain user-configurable option is on, auto-frame advance past that frame and give the next frame the same input. EDIT: Of course, a little detector light or something could be made to go off instead, it that much was working. I don't know how much it would help just to know that the button you pressed didn't do anything though... if you know what the lag looks like you'd already know that but it doesn't really stop it from being annoying.
Joined: 10/3/2004
Posts: 138
It should be possible to programmatically detect lag, at least for some games. I know that, on the C64, lag is introduced when you are not using IRQs, but instead busywaiting until certain scanlines, and a piece of code overshoots one of those scanlines, then the game will busywait until that same scanline next frame. Perhaps something similar happens on the NES with regards to the sprite 0 hit and vblank.
Editor, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
In Rockman you know the game is lagging when PC == 0xD4B1. In Rockman 2, PC == 0xCFF7. In Megaman 2, PC == 0xCFFA. I don't know values for other games. I should point out that static screen is not a reliable way to detect lag in all games, even when it happens. When it lags, it's possible that the screen scrolls on 1st frame and the objects (enemies and items and such) scroll on the 2nd frame. Both frames contain (some) motion.