Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows x64 build #354

Merged
merged 16 commits into from
May 22, 2024
Merged

Windows x64 build #354

merged 16 commits into from
May 22, 2024

Conversation

pzychotic
Copy link
Contributor

@pzychotic pzychotic commented May 15, 2024

Pull Request Type

  • GitHub Workflow changes
  • Documentation or Wiki changes
  • Build and Dependency changes
  • Runtime changes
    • Render changes
    • Audio changes
    • Input changes
    • Network changes
    • Other changes

Description

Getting this out as a starting point for a possible Windows x64 build.

So far my local tests in Singleplayer work fine. I haven't tried any Multiplayer.

Quick summary:

  • DirectX SDK updated with x64 support
  • Prevent 32bit truncations of WinApi types
  • Compilation of scripts and netgames projects

Cut corners:

  • Disabled callstack and exception info logging: pzychotic@caf1981
    • Maybe this can be replaced with writing a MiniDump file nowadays?
  • Disabled some code for 'mono' debugger: pzychotic@bac882c
    • Do we even still need this?

Open questions:

  • I had to load the new d3-win.hog last so the x64 DLLs from it will be found before the x86 DLLs from the original game data: pzychotic@435b1f4
    • Shouldn't this also be done for Linux/Mac?
  • Array access with negative index in dsound3d.cpp only crashes in x64: pzychotic@11af2e7
    • This problem is already present in x86 builds, but doesn't crash...

Known Issue:

Checklist

  • I have tested my changes locally and verified that they work as intended.
  • I have documented any new or modified functionality.
  • I have reviewed the changes to ensure they do not introduce any unnecessary complexity or duplicate code.
  • I understand that by submitting this pull request, I am agreeing to license my contributions under the project's license.

This is one of the last versions still containing DirectDraw + DirectSound and also has x64 support.
Lots of these truncated 64bit pointer or handle types to 32bit.
… from the original game.

The last library opened with cf_OpenLibrary() will be the first to be searched for DLLs. This way we make sure to load our x64 DLLs before the x86 versions from the original game data.
No idea why this doesn't crash in current builds, maybe just corrupts some memory if we get into if-statement?!
@Lgt2x
Copy link
Collaborator

Lgt2x commented May 15, 2024

Hey, that looks promising! Just so you know, we will be working on replacing DirectX with SDL2 on Windows just like Linux and MacOS do, so don't spend too much effort on the DirectX code

@Lgt2x Lgt2x mentioned this pull request May 15, 2024
13 tasks
@pzychotic
Copy link
Contributor Author

Hey, that looks promising! Just so you know, we will be working on replacing DirectX with SDL2 on Windows just like Linux and MacOS do, so don't spend too much effort on the DirectX code

Thanks for the heads-up on DirectX stuff. I wasn't planning spending time on it, just replaced the SDK for the x64 support to get the current stuff to compile and run.

@JeodC JeodC added the build Modification to the build system label May 15, 2024
@MaddTheSane
Copy link
Contributor

  • I had to load the new d3-win.hog last so the x64 DLLs from it will be found before the x86 DLLs from the original game data:pzychotic@435b1f4

    • Shouldn't this also be done for Linux/Mac?

Maybe for Linux, but macOS can have multiple architectures in one binary.

# Conflicts:
#	lib/win/win32app.h
#	win32/winapp.cpp
@GravisZro GravisZro mentioned this pull request May 19, 2024
12 tasks
@pzychotic pzychotic marked this pull request as ready for review May 19, 2024 17:49
CMakeLists.txt Show resolved Hide resolved
@JeodC JeodC requested a review from winterheart May 20, 2024 23:20
@JeodC JeodC requested a review from Lgt2x May 20, 2024 23:20
@JeodC
Copy link
Collaborator

JeodC commented May 21, 2024

I can't review further, other than verifying it works in windows, but I'd like to note that as pzychotic nicely explained, this pull will resolve the outstanding multiplayer issues.

Copy link
Collaborator

@winterheart winterheart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need additionally mention somewhere that we use static DirectX libraries (and here issue about licensing them with GPLv3 code).

CMakeLists.txt Outdated Show resolved Hide resolved
Descent3/init.cpp Outdated Show resolved Hide resolved
@pzychotic
Copy link
Contributor Author

We need additionally mention somewhere that we use static DirectX libraries (and here issue about licensing them with GPLv3 code).

These are not static libraries, these are just the link libs needed by the linker to resolve the symbols to the DLLs.

Copy link
Collaborator

@winterheart winterheart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK from me. Good work!

@winterheart winterheart added this to the 1.5 Stable milestone May 22, 2024
@winterheart winterheart merged commit 764b84d into DescentDevelopers:main May 22, 2024
10 checks passed
@JeodC JeodC mentioned this pull request May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Modification to the build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Runtime Issue]: Newly built dmfc.dll and gamemodes crash Ping and Network Loss Meter not working
5 participants