Post subject: Lagless FCEU
Joined: 3/1/2005
Posts: 46
After coming across an article about console overclocking, I started to think that it would be fairly easy to accomplish the same thing with an emulator. I loaded up the FCEU code and made a couple minor changes and it worked...sort of. Any semblance of lag was gone and games still play at the same speed. However, the sound was affected. The tempo remains the same, but the pitch is twice as high as before. I played around with some of the sound values, but didn't succeed at anything except slowing it down. I believe the key to finding the problem is that the emulator will crash if Sound Quality is set to anything but Low, but the reality is I have only a vague idea how it all works. I would greatly appreciate it if someone could help figure this out. I don't know if removing lag would fit with Bisqwit's vision for TASvideos, but it would certainly be cool for actual gameplay, and could be made an option fairly easily. For anyone looking to help, here's how I accomplished the overclock. 1. In x6502.h, double the values of NTSC_CPU and PAL_CPU. 2. In x6502.c, X6502_Run(), double the number of cycles specified in the ifelse statement just before the start of the main loop(cycles*=xx).
Post subject: Re: Lagless FCEU
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I have experimented with lag removal sometimes for the purpose of making the Rockman zipping GIF animations. Lag destroys them because the screen shakes, so I had to erase lag. Basically how I did it was: adding this line to ppu.c: static const unsigned EXTRA_CYCLES_SCANLINE = 900; // BISQWIT'S ADDITION And changing this line: X6502_Run((scanlines_per_frame-242)*(256+85)-12); to: X6502_Run((scanlines_per_frame-242)*(256+85+EXTRA_CYCLES_SCANLINE)-12); //-12); But no, an emulator changed in this manner is not eligible for Tasvideos submissions.
Post subject: Re: Lagless FCEU
Active player (411)
Joined: 3/16/2004
Posts: 2623
Location: America, Québec
The title should be "Lagless NES emulation in FCEU"
Bisqwit wrote:
But no, an emulator changed in this manner is not eligible for Tasvideos submissions.
You should put that in the rules because I've noticed many people that think that overclocked system emulation should be used. Also, Star Fox emulation is somewhat overclocked in the old Snes9x version used here and it has been accepted. :S
JXQ
Experienced player (761)
Joined: 5/6/2005
Posts: 3132
I think it would be neat to just play some of the lag-prone NES games without lag. (Blaster Master and Kirby's Adventure, for example)
<Swordless> Go hug a tree, you vegetarian (I bet you really are one)
ventuz
He/Him
Player (126)
Joined: 10/4/2004
Posts: 940
and Shatterhand?
Post subject: Re: Lagless FCEU
Banned User
Joined: 12/23/2004
Posts: 1850
Andy Olivera wrote:
However, the sound was affected. The tempo remains the same, but the pitch is twice as high as before.
From what I remember, sound output is directly related to CPU. That is, any change results in different sound frequencies. This is also seen on a real console. Good luck fixing it, unless you can find some way to force FCEU to use the old CPU speed to the original.
Perma-banned
Post subject: Re: Lagless FCEU
Joined: 3/1/2005
Posts: 46
Bisqwit wrote:
adding this line to ppu.c: <tt>static const unsigned EXTRA_CYCLES_SCANLINE = 900; // BISQWIT'S ADDITION</tt> And changing this line: <tt>X6502_Run((scanlines_per_frame-242)*(256+85)-12);</tt> to: <tt>X6502_Run((scanlines_per_frame-242)*(256+85+EXTRA_CYCLES_SCANLINE)-12); //-12);</tt>
I gave it a shot. It eliminated video lag, but introduced audio lag(since the cpu is still running at the same speed). I guess I'll have to do a bit more studying...