XWA.Exe Patches

Need help editing the game? Check for help here!

Moderators: Darksaber, General_Trageton, Forceflow

Post Reply

XWA.Exe Patches

JeremyaFr
Lieutenant JG
XWAU Member
Posts: 624
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue Feb 10, 2015 9:36 pm

Here is a list of patches for XWINGALLIANCE.EXE that were dispersed throughout the forum.

DISCLAIMER
Never apply a patch if you are not sure of what it does.
It is recommended to make a backup of XWingAlliance.exe.

To make it easy to apply patches, I've create a GUI tool:
XwaExePatcher.png
XwaExePatcher.png (27.52 KiB) Viewed 3611 times
download link:
XwaExePatcher.zip

The patches are defined in an xml file "patcher.xml". The format of this file is defined in "patcher.xsd".

patcher.xsd:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="ArrayOfPatch">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" name="Patch">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" name="Item">
                <xs:complexType>
                  <xs:attribute name="Offset" type="xs:string" use="required" />
                  <xs:attribute name="From" type="xs:string" use="required" />
                  <xs:attribute name="To" type="xs:string" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="Name" type="xs:string" use="required" />
            <xs:attribute name="Description" type="xs:string" use="optional" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
patcher.xml:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfPatch>
  <Patch Name="[Recommended] triangling to infinity" Description="Fix the 'triangling to infinity' glitch.">
    <Item Offset="193C4A" From="750C" To="9090" />
    <Item Offset="193C53" From="02" To="08" />
  </Patch>
  <Patch Name="[Recommended] disable briefing wireframe overlay" Description="Disable the briefing wireframe overlay.">
    <Item Offset="07E09C" From="7D" To="EB"/>
    <Item Offset="07E12E" From="7D" To="EB"/>
    <Item Offset="07E1B9" From="47" To="90"/>
  </Patch>
  <Patch Name="remove joystick check" Description="Remove the joystick check.">
    <Item Offset="138CB4" From="754E" To="EB4E" />
  </Patch>
  <Patch Name="show framerate" Description="Show in-flight framerate">
    <Item Offset="05A3EA" From="85C07405" To="90909090" />
    <Item Offset="0F165A" From="85C07405" To="90909090" />
    <Item Offset="07978B" From="746F" To="EB6F" />
  </Patch>
  <Patch Name="show framerate, vertices, triangles" Description="Show in-flight framerate, SceneNumVerts, SceneNumTris, SceneNumTexChanges, SceneNumStateChanges">
    <Item Offset="05A3EA" From="85C07405" To="90909090" />
    <Item Offset="0F165A" From="85C07405" To="90909090" />
    <Item Offset="07978B" From="746F" To="EB36" />
  </Patch>
  <Patch Name="show framerate, video memory" Description="Show in-flight framerate, TexThrash, TotalTex">
    <Item Offset="05A3EA" From="85C07405" To="90909090" />
    <Item Offset="0F165A" From="85C07405" To="90909090" />
    <Item Offset="07978B" From="746F" To="EB0A" />
  </Patch>
  <Patch Name="crafts count per region" Description="Replace the craft count per region from 96 to 192.">
    <Item Offset="14C2E" From="60000000C1E305" To="C0000000C1E306"/>
  </Patch>
  <Patch Name ="backdrop scaling factor from 256.0f to 512.0f">
    <Item Offset="1A83AC" From="00008043" To="00000044"/>
  </Patch>
  <Patch Name ="backdrop scaling factor from 256.0f to 128.0f">
    <Item Offset="1A83AC" From="00008043" To="00000043"/>
  </Patch>
  <Patch Name ="backdrop scaling factor from 256.0f to 64.0f">
    <Item Offset="1A83AC" From="00008043" To="00008042"/>
  </Patch>
  <Patch Name ="backdrop scaling factor from 256.0f to 32.0f">
    <Item Offset="1A83AC" From="00008043" To="00000042"/>
  </Patch>
  <Patch Name="remove textures size limit" Description="Remove the 256x256 texture size limit.">
    <Item Offset="19564A" From="81790C000100007717" To="909090909090909090" />
    <Item Offset="1956C2" From="817A10000100007717" To="909090909090909090" />
  </Patch>
  <Patch Name="opt textures count limit from 200 to 1024">
    <Item Offset="0CC432" From="2003" To="0010" />
    <Item Offset="0CC43A" From="2803" To="0810" />
    <Item Offset="0CC445" From="2C03" To="0C10" />
    <Item Offset="0CC44C" From="2003" To="0010" />
    <Item Offset="0CC466" From="C800" To="0004" />
    <Item Offset="0CC497" From="3003" To="1010" />
    <Item Offset="0CC4C9" From="3003" To="1010" />
    <Item Offset="0CC4E6" From="3003" To="1010" />
    <Item Offset="0CC4EE" From="2003" To="0010" />
  </Patch>
  <Patch Name="[Fix] 32-bit bmp screenshot" Description="Fix misaligned flightscreen*.bmp screenshots.">
    <Item Offset="136CDA" From="740140" To="909090"/>
    <Item Offset="136D00" From="18" To="20"/>
    <Item Offset="136B2E" From="03" To="04"/>
    <Item Offset="136B35" From="0F8C50FFFFFFF6C3017445" To="9090909090909090909090"/>
    <Item Offset="136B56" From="6A0056E8C237FFFF0FBFC083C408" To="8B44245C3BD80F8C29FFFFFFEB21"/>
    <Item Offset="136C3B" From="03" To="04"/>
    <Item Offset="136C43" From="7C8CF6C3017447" To="90909090909090"/>
    <Item Offset="136C60" From="6A0056E8B836FFFF0FBFC083C408" To="8B44245C3BD80F8C65FFFFFFEB23"/>
  </Patch>
  <Patch Name="[Fix] disable a3d" Description="Disable the creation of an A3D device.">
    <Item Offset="1A7CA1" From="558BEC83EC20C745" To="B8FFFFFFFFC20C00"/>
  </Patch>
  <Patch Name="[Experimental] replace malloc with calloc">
    <Item Offset="19BCE0" From="A1B81E7B008B4C24045051E810000000" To="8B4C2404516A0190909090E8C0000000" />
  </Patch>
</ArrayOfPatch>
Last edited by JeremyaFr on Thu Feb 12, 2015 11:08 pm, edited 1 time in total.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 9201
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Tue Feb 10, 2015 11:32 pm

Thanks Jeremy :D

Just a couple of questions I understand all of them apart from the last two, I don't think you've published these offsets before

Replace malloc with calloc, what is it and what does it do?
Disable a3d = Disable the creation of a A3D device, but what exactly is an A3D device and what does it do?

Thanks
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Rasalas
Cadet 2nd Class
Posts: 50
Joined: Fri Jan 17, 2014 8:09 pm

Post by Rasalas » Wed Feb 11, 2015 12:26 am

Darksaber wrote:Disable a3d = Disable the creation of a A3D device, but what exactly is an A3D device and what does it do?
That's the Aureal 3D sound engine: http://en.wikipedia.org/wiki/A3D
Jeremy, does using this patch have any benefits compared to disabling A3D in XWA's sound menue?

JeremyaFr
Lieutenant JG
XWAU Member
Posts: 624
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Feb 11, 2015 12:37 am

Darksaber wrote:Disable a3d = Disable the creation of a A3D device, but what exactly is an A3D device and what does it do?
From Update202.rtf:
Aureal A3D Interactive(TM) sound support: Provides hardware accelerated 3d positional audio. To enable this support go to the sound options menu in the game, and select on for 3d sound enabled. If you have an Aureal supported sound card it will default to A3D support.

Improvements to Direct Sound 3D support: We have made adjustments to our sound system to create a more fulfilling experience for users with Direct Sound 3D supported soundcards.
On a system where an Aureal sound card was present and the a3d dlls are still installed, XWA may crash when 3D sound is enabled. Disabling the A3D device fix that crash.
Darksaber wrote:Replace malloc with calloc, what is it and what does it do?
malloc allocates memory without initializing it.
calloc allocates memory and fills it with 0.
I do not recommend to use this patch. I have made it for debugging purposes.

User avatar
Forceflow

Fleet Admiral (Administrator)
Posts: 5108
Joined: Wed Oct 20, 1999 11:01 pm
Contact:

Post by Forceflow » Wed Feb 11, 2015 4:39 pm

Great work!
Maybe you should add a 'Not recommended' to the settings you deem unsafe to use or have a 'recommended' setting for the patches.
Murphy was an optimist! I am a pessimist!
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project

JeremyaFr
Lieutenant JG
XWAU Member
Posts: 624
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Feb 12, 2015 11:06 pm

UPDATE:
I've added Recommended, Fix, Experimental tags to the patches.

User avatar
Trevor
Cadet 2nd Class
Posts: 76
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Fri Feb 13, 2015 5:28 pm

Hi Jeremya.

None of your stuff load in 98.
I wanted to try the hangar stuff but the patcher requires net4.

Ill try patching manually and then test the dlls

Edit:
Ok, its confirmed that none of these new features will work in 9x based systems.

Those of us using 9x to play this game are stuck with the official stuff except for the Opts and Texture stuff

The last version of MSVC that I know works in 9x is MSVCR90.dll (MSVC 2008)
It doesnt work in Vanilla 98 but with Kex it does.

trev

JeremyaFr
Lieutenant JG
XWAU Member
Posts: 624
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Mar 04, 2015 11:26 pm

Hello Trevor,
I have no plan to support systems older than Windows XP.

User avatar
Atx
Lieutenant Commander
Posts: 1213
Joined: Mon Feb 11, 2002 12:01 am

Post by Atx » Mon Apr 13, 2015 12:46 pm

As a former staunch supporter of win98 I agree its no longer worth supporting. Now if someone has Win98 still using it as a Dosbox (sheepishly looks away) then I advise you get KernelEx and all its numerous add ons.
Add ons are still being made for it by the community I believe.
http://kernelex.sourceforge.net/

Nice work on breaking the features ;)

JeremyFr - thanks for all your EXE insights and a huge thanks for all the neat tools. I know it's a lot of hard work (and a lot of your free time) but it is truly appreciated by the community here. :D
The Navbuoy is closed...long live the XWAU!!!

User avatar
DTM
Lieutenant
XWAU Member
Posts: 939
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Sat Apr 25, 2015 6:15 am

Great work as always!
What are the patches already included into the XWAU Craft Pack?

MTD industries
WIPs: XWA campaign based on Rebels TV Show

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 9201
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sat Apr 25, 2015 8:22 am

Using Disc and Gog versions
[Recommended] triangling to infinity
[Recommended] disable briefing wireframe overlay
crafts count per region
backdrop scaling factor from 256.0f to 128.0f
remove textures size limit
opt textures count limit from 200 to 1024
[Fix] 32-bit bmp screenshot
[Fix] disable a3d
To setup the dinput hook
To call the hook that selects the hangar type
To call the hook that selects the inside animation
To call the hook that selects the hangar model index
To call the hook that loads hangar opt
To remove the opt filter
To call the hook that sets the hangar camera
To call the hook that sets the hangar map
To call the hook that sets the family hangar map
To call the hook that remove D3DInfos count limit

If using Gog version (Only)
Removed
Force 800 mode
Fixed Z Clear
32 bit Mode
No CD Check

Reapplied
Correct No CD Check
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Bman
Ensign
Posts: 432
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sat Apr 14, 2018 10:47 pm

Hi Jeremy, just wanted to confirm... these general patches are Not already part of your recent runtime .dll files? My understanding is these offset patches are included in the installers and applied through XWAUCP or DSUCP packs, correct ?

JeremyaFr
Lieutenant JG
XWAU Member
Posts: 624
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Apr 15, 2018 11:56 am

Hi Bman,
These general patches are not part of the hook DLLs. They are included in the craft packs (see the above list except the hook patches).

JeremyaFr
Lieutenant JG
XWAU Member
Posts: 624
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Apr 15, 2018 12:22 pm

Hello,
I've added "disable gun turret random rotation" patch to XwaExePatcher.
It will disable the gun turret rotation when there is no targetted craft.
See viewtopic.php?p=153940#p153940

Bman
Ensign
Posts: 432
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sun Apr 15, 2018 5:24 pm

Awesome. I will test it in near future. Thank you!

EDIT: Hi Jeremy, I just noticed in the patcher.xml file for XWA.Exe patches, should we remove the following script lines ?

Code: Select all

  </Patch>
  <Patch Name="disable S-Foil model filter">
    <Item Offset="0FB86E" From="7419" To="EB19"/>
  </Patch>
Because this is already included in the hook_sfoils.dll file? I was wondering if it was redundant.

Post Reply