Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Goober5000 on January 22, 2004, 07:27:40 pm
-
Well, after getting no response from Beowulf, I thought I'd ask the general SCP community.
Everybody who is getting the afterburner bug (the afterburner button not working in Windows 2000 or Windows XP) can you please download and try the following builds?
In chronological order:
3.2: http://fs2source.warpcore.org/releases/fs2_open-3.2.zip
3.3: http://fs2source.warpcore.org/exes/fs2_open3_3.exe
3.4: http://fs2source.warpcore.org/exes/fs2_open_3.4.zip
3.5: http://fs2source.warpcore.org/exes/fs2_open_3_5.exe
3.5.1: http://fs2source.warpcore.org/exes/fs2_open_3_5_1.exe
3.5.3: http://fs2source.warpcore.org/exes/fs2_open_3_5_3_unofficial.exe
3.5.5: http://fs2source.warpcore.org/exes/3.5.5.zip
Try each of the builds and report back which SCP version the bug is first seen on. Please also mention whether it appears in retail FS2.
-
Don't know if you saw it Goober but that problem may have been fixed
Originally posted by Gravaton
Heh seems the assembler wasn't as tough as I thought it would be, I seem to have found a possible fix for the issue. Here's the relevant chunk again (code/io/timer.cpp lines 292-308):
#if defined(_MSC_VER)
// Timing in milliseconds.
_asm mov edx, temp_large.HighPart
_asm mov eax, temp_large.LowPart
//_asm shld edx, eax, 16 ; Keep 32+11 bits
//_asm shl eax, 16
// edx:eax = number of 1.19Mhz pulses elapsed.
_asm mov ebx, Timer_freq
// Make sure we won't divide overflow. Make time wrap at about 9 hours
sub_again:
_asm sub edx, ebx ; subtract until negative...
_asm jns sub_again ; ...to prevent divide overflow...
_asm add edx, ebx ; ...then add in to get correct value.
_asm div ebx
//eax = milliseconds elapsed...
_asm mov tmp, eax
tmp is an int, and the problem SEEMS to be that, on my system, at the end of this block eax is equal to a number around 33,000,000. This, when moved into tmp (which is a regular int) gets taken to be a negative number of about -9,000,000. And at that point everyone gets all sad. The solution I've found is to turn tmp into an unsigned int (as there's no way any of the system timer functions would EVER be returning a value less then zero according to MSDN specs), and also turn the "now" variable (in code/ship/afterburner.cpp line ) for the afterburner into an unsigned int as well. This worked.
Then I realized that all that NEEDS to be changed is the "now" variable, as the timer function will return a signed int that can be converted to unsigned without losing any data. Tried it, tested it, it works.
So to sum it up, changing the declaration of now (code/ship/afterburner.cpp line 242) from "int" to "unsigned int" seems to fix this problem on my machine. The scope of this change SEEMS to be restricted to the problem area alone, but I'd once again like to reiterate that I'm not very familiar with the project overall and it's theoretically possible that this could break something or many things.
But just maybe I fixed it ;)
Dave
-
That's interesting. I'll need someone with Win2000 or WinXP to confirm it.
-
Just to confirm that I also have this problem (Win XP, Radeon 9800 Pro 1gig Ram ..la di da)
When pressing the afterburner it merely makes a engine shutdown sound and accelerates to normal top speed. I assume this is the problem. :)
Hope its been fixed for the next version, have tried both 3.5.5 and the build available on the "Latest" thread. Odd I didn't have this problem on Windows 2000.
Keep up the great work!
-
really? hell even i can fix that problem.
-
Originally posted by illum
Just to confirm that I also have this problem (Win XP, Radeon 9800 Pro 1gig Ram ..la di da)
When pressing the afterburner it merely makes a engine shutdown sound and accelerates to normal top speed. I assume this is the problem. :)
Hope its been fixed for the next version, have tried both 3.5.5 and the build available on the "Latest" thread. Odd I didn't have this problem on Windows 2000.
Keep up the great work!
Targetting illum. Target locked. Fire.
:welcome:
:D
-
I have this same problem. Wondering if a slightly altered build could be released to help fix this (because it's a relatively simple thing to fix I gather?).
I'd be willing to help test it :)
-
Assembler, yuk!
-
Originally posted by Lt.Cannonfodder
Targetting illum. Target locked. Fire.
Ack That'll teach me to break radio cover and stop lurking. :eek:
Yes if 3.6 isn't imminent or close, a fixed built would be most welcome. Thankyouverymuch. :)
-
Originally posted by Goober5000
Well, after getting no response from Beowulf, I thought I'd ask the general SCP community.
Everybody who is getting the afterburner bug (the afterburner button not working in Windows 2000 or Windows XP) can you please download and try the following builds?
In chronological order:
3.2: http://fs2source.warpcore.org/releases/fs2_open-3.2.zip
3.3: http://fs2source.warpcore.org/exes/fs2_open3_3.exe
3.4: http://fs2source.warpcore.org/exes/fs2_open_3.4.zip
3.5: http://fs2source.warpcore.org/exes/fs2_open_3_5.exe
3.5.1: http://fs2source.warpcore.org/exes/fs2_open_3_5_1.exe
3.5.3: http://fs2source.warpcore.org/exes/fs2_open_3_5_3_unofficial.exe
3.5.5: http://fs2source.warpcore.org/exes/3.5.5.zip
Try each of the builds and report back which SCP version the bug is first seen on. Please also mention whether it appears in retail FS2.
Hey man, sorry for my leave of absence. I've had more work than usual lately.
I've tried out those builds, sent you the info as a PM. Thanks.
~Beowulf
-
Hm. From what Beowulf said, none of those builds work... even 3.2. So it definitely sounds like an OS-specific thing. The signed/unsigned theory sounds good, but we'd have to see if it affects anything else.
-
well it is a one line potential fix. line 241, afterburner.cpp
-
if that's a local variable I don't see hoe it could break anything else
-
same thing happens to me (win XP pro with none of the patches applied)
and the AB didn't work in ANY of those builds at all, and even worse, seems to have stopped in the original exe despite a clean install. :shaking:
-
Did you remember to set compatability mode on the clean install? It's always been needed.
EDIT: That's actually not true now that I think about it. My afterburners have worked perfectly WITHOUT compatability mode since the Launcher or maybe even earlier. You are running from the Launcher, right?
-
tried both the original launcher and RT's one. neither one fixes it :(
and compatability set to win98 does nothing at all for the original exe, and last time i checked, crashes FS open before it even opens.