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

WIP (PLEASE DON'T MERGE): 64-bit version #28

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

beholdnec
Copy link

Here is a work-in-progress branch to port 3D Movie Maker to 64-bit Windows!

This will not only bring 3D Movie Maker into the 64-bit future, but another perk is that rewriting the x86-specific parts of the code will make it easier to port 3DMM to other platforms.

Currently, the project builds and runs most of the menu. It crashes when you attempt to create or play a movie. "Internal error 103" messages may appear, but the program will continue.

Since the original code depends on 32-bit libraries, I tried to patch up the missing pieces:

  • New C versions of the Kauai decompression routines have been created, since the existing C versions of these functions were broken.
  • BRender has been cobbled together from foone's BRender-v1.1.2 repo, which dates to a few months after 3DMM's version of BRender.
  • A nonfunctional stub for the AudioMan library has been created.

@LowLevelMahn
Copy link

LowLevelMahn commented Jun 17, 2022

i think this pull request is too large - 143 files changes in whole - who should review that?
can you splitt this pull request in smaller and more logical seperated pull requests over time?

BRender has been cobbled together from foone's BRender-v1.1.2 repo, which >dates to a few months after 3DMM's version of BRender.

björk also "ported" the 1.1.2 Version, you join forces?

https://github.com/bjrkk/3DMM-BRender (builds with VS2022,clang and mingw gcc, 32 and 64bit)
https://github.com/bjrkk/brenSDL - with SDL backend
active on discord: https://discord.gg/s5vcHhm2

A nonfunctional stub for the AudioMan library has been created.

is this stub optional? can one switch between the 32bit libs and your stub?

# Local Tooling
add_compile_definitions(
  $<$<PLATFORM_ID:Windows>:WIN>
  $<$<PLATFORM_ID:Windows>:IN_80386> # <====
  $<$<CONFIG:Debug>:DEBUG>
)

the IN_80386 activates most of the x86 inline asm - 3DMM doesn't build even in 32bit full without that
wouldn't it be better to cleanup x86 build first and then port over to 64bit?

@mdtauk
Copy link

mdtauk commented Jun 17, 2022

Wouldn't BRender require updating to support 64bit, or is that covered in this PR? Maybe break it out into

  • BRender
  • Kauai
  • Core

@bruxisma
Copy link

I would like to add to the recommendation that this PR be split up. I'd also like to advocate that vendoring a BRender implementation is not really a solution here. It precludes the ability for us to easily track upstream BRender implementations, doesn't allow for things like FetchContent, and as others have said, the null stub for audioman also makes it difficult to switch between versions.

My recommendations for getting this PR into a final state to merge are

  1. Convert all tooling that generates x86 ASM to generate C or C++ code instead (PCs are fast enough now, it shouldn't be an issue)
  2. Convert all inline assembly to architecture portable C or C++
  3. Setup a FetchContent option to pull in an upstream project that we later decide on
  4. Get said upstream project working with amd64 architectures
  5. Port rest of code to be amd64 safe

Work regarding a 64-bit replacement/stub for AudioMan can be done separately and alongside all of this, I should note (though given bjrkk's work on getting the SDL renderer to work, I expect SDL audio will be used at some point)

@beholdnec beholdnec changed the title WIP: 64-bit version WIP (PLEASE DON'T MERGE): 64-bit version Jun 17, 2022
@beholdnec
Copy link
Author

Thanks for the feedback. This branch is a work in progress, please don't try to merge it yet. I'll look into splitting this work up.

@LowLevelMahn
Copy link

  1. Convert all tooling that generates x86 ASM to generate C or C++ code instead (PCs are fast enough now, it shouldn't be an issue)

Is there a real need for generating c/cpp code?, isnt that some sort of loop unrolling, thats also not needed anymore

@beholdnec
Copy link
Author

I fixed some loading issues. You can now enter the editor and place actors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants