Author Topic: Fixing the Afterburner Bug  (Read 3516 times)

0 Members and 1 Guest are viewing this topic.

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Fixing the Afterburner Bug
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.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Fixing the Afterburner Bug
Don't know if you saw it Goober but that problem may have been fixed

Quote
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
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Fixing the Afterburner Bug
That's interesting.  I'll need someone with Win2000 or WinXP to confirm it.

 

Offline illum

  • 21
Fixing the Afterburner Bug
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!

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
Fixing the Afterburner Bug
really?  hell even i can fix that problem.
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline Lt.Cannonfodder

  • 210
  • Digitalous Grunteous
Fixing the Afterburner Bug
Quote
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

  
Fixing the Afterburner Bug
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 :)

 

Offline RandomTiger

  • Senior Member
  • 211
Fixing the Afterburner Bug
Assembler, yuk!

 

Offline illum

  • 21
Fixing the Afterburner Bug
Quote
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. :)

 

Offline Beowulf

  • 27
Re: Fixing the Afterburner Bug
Quote
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
Never Forget

"It is always better to avenge dear ones than to induldge in mourning. For every one of us, living in this world means waiting for our end. Let whoever can win glory before death. When a warrior is gone, that will be his best and only bulwark."
                               --Beowulf


"... and no, real life sex is not just a myth. You just need to come out of your house once every while..." ~Tiara

YeeeeHoooooh! is the mood of the day. :p

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Fixing the Afterburner Bug
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.

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
Fixing the Afterburner Bug
well it is a one line potential fix.  line 241, afterburner.cpp
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Fixing the Afterburner Bug
if that's a local variable I don't see hoe it could break anything else
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Vasudan Admiral

  • Member
  • 211
    • Twisted Infinities
Fixing the Afterburner Bug
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:
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
Fixing the Afterburner Bug
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?
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM

 

Offline Vasudan Admiral

  • Member
  • 211
    • Twisted Infinities
Fixing the Afterburner Bug
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.
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities