shiiion / dolphin

Dolphin fork intended to give Metroid Prime Trilogy mouselook controls
Other
466 stars 43 forks source link

project doesn't build on macos #100

Closed nsklaus closed 2 years ago

nsklaus commented 2 years ago

i have a macbookpro M1 from 2020, macos version is "monterey 12.3.1 (21E258)". i tried the two types of build, both failed. here's what i got:

build type 1 (single binary)

mkdir build
cd build
cmake ..
make

results in:
[ build ]                                                                             ⍉
> pwd
/Users/klaus/Sources/dolphin/build

[ build ]
> make
[  0%] Built target cpp-optparse
[  1%] Built target imgui
[  4%] Built target glslang
[  4%] Performing update step for 'MoltenVK'
[  4%] Performing patch step for 'MoltenVK'
HEAD is now at b3ef160c Merge pull request #1470 from billhollings/sdk-1.2.198
[  4%] Performing configure step for 'MoltenVK'
CMake Error at /Users/klaus/Sources/dolphin/build/Externals/MoltenVK/MoltenVK-prefix/src/MoltenVK-stamp/MoltenVK-configure-Release.cmake:37 (message):
  Command failed: 127

   '/Users/klaus/Sources/dolphin/Externals/MoltenVK/configure.sh' '/Users/klaus/Sources/dolphin/build/Externals/MoltenVK/MoltenVK-prefix/src/MoltenVK-stamp' '/Users/klaus/Sources/dolphin/build/Externals/MoltenVK/MoltenVK-prefix/src/MoltenVK' 'v1.1.6'

  See also

    /Users/klaus/Sources/dolphin/build/Externals/MoltenVK/MoltenVK-prefix/src/MoltenVK-stamp/MoltenVK-configure-*.log

-- stdout output is:

========== Retrieving MoltenVK dependencies into External ==========

========== Cereal ==========

cereal repo: https://github.com/USCiLab/cereal.git
cereal revision: 51cbda5f30e56c801c07fe3d3aba5d7fb9e6cca4
Fetching origin

========== Vulkan-Headers ==========

Vulkan-Headers repo: https://github.com/KhronosGroup/Vulkan-Headers.git
Vulkan-Headers revision: 8c1c27d5a9b9de8a17f500053bd08c7ca6bba19c
Fetching origin

========== SPIRV-Cross ==========

SPIRV-Cross repo: https://github.com/KhronosGroup/SPIRV-Cross.git
SPIRV-Cross revision: 7c3cb0b12c9965497b08403c82ac1b82846fa7be
Fetching origin

========== glslang and SPIRV-Tools ==========

glslang repo: https://github.com/KhronosGroup/glslang.git
glslang revision: c9706bdda0ac22b9856f1aa8261e5b9e15cd20c5
Fetching origin

-- stderr output is:
cat: /Users/klaus/Sources/dolphin/build/Externals/MoltenVK/MoltenVK-prefix/src/MoltenVK-stamp/MoltenVK-last-version.txt: No such file or directory
HEAD is now at 51cbda5f Merge branch 'develop' for release 1.2.2
HEAD is now at 8c1c27d Update for Vulkan-Docs 1.2.198
HEAD is now at 7c3cb0b1 Merge pull request #1810 from billhollings/early-frag-tests-depth-out
HEAD is now at c9706bdd Merge pull request #2817 from greg-lunarg/sdk0
env: python: No such file or directory

CMake Error at /Users/klaus/Sources/dolphin/build/Externals/MoltenVK/MoltenVK-prefix/src/MoltenVK-stamp/MoltenVK-configure-Release.cmake:47 (message):
  Stopping after outputting logs.

make[2]: *** [Externals/MoltenVK/MoltenVK-prefix/src/MoltenVK-stamp/MoltenVK-configure] Error 1
make[1]: *** [Externals/MoltenVK/CMakeFiles/MoltenVK.dir/all] Error 2
make: *** [all] Error 2

[ build ]                                                                             ⍉
>

build type 2 (universal)

[ 61%] Building CXX object Source/Core/Core/CMakeFiles/core.dir/PowerPC/Jit64/Jit_Branch.cpp.o
[ 61%] Building CXX object Source/Core/Core/CMakeFiles/core.dir/PowerPC/Jit64/Jit_LoadStorePaired.cpp.o
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:124:11: warning: 10 enumeration values not handled in switch: 'INVALID_GAME', 'MENU', 'MENU_PRIME_1'... [-Wswitch]
  switch (game) {
          ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:124:11: note: add missing switch cases
  switch (game) {
          ^
[ 61%] Building CXX object Source/Core/Core/CMakeFiles/core.dir/PowerPC/Jit64/Jit_Paired.cpp.o
[ 62%] Building CXX object Source/Core/Core/CMakeFiles/core.dir/PowerPC/Jit64/Jit_SystemRegisters.cpp.o
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:380:20: error: 'path' is unavailable: introduced in macOS 10.15
  std::filesystem::path search_name(str);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:909:24: note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
                       ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:380:25: error: 'path' is unavailable: introduced in macOS 10.15
  std::filesystem::path search_name(str);
                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:948:3: note: 'path' has been explicitly marked unavailable here
  path(const _Source& __src, format = format::auto_format) {
  ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:380:25: error: '~path' is unavailable: introduced in macOS 10.15
  std::filesystem::path search_name(str);
                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:968:3: note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:382:19: error: 'is_absolute' is unavailable: introduced in macOS 10.15
  if (search_name.is_absolute() && std::filesystem::exists(str)) {
                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:1406:34: note: 'is_absolute' has been explicitly marked unavailable here
  _LIBCPP_INLINE_VISIBILITY bool is_absolute() const {
                                 ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:382:53: error: 'exists' is unavailable: introduced in macOS 10.15
  if (search_name.is_absolute() && std::filesystem::exists(str)) {
                                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:1986:39: note: 'exists' has been explicitly marked unavailable here
inline _LIBCPP_INLINE_VISIBILITY bool exists(const path& __p) {
                                      ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:382:60: error: 'path' is unavailable: introduced in macOS 10.15
  if (search_name.is_absolute() && std::filesystem::exists(str)) {
                                                           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:948:3: note: 'path' has been explicitly marked unavailable here
  path(const _Source& __src, format = format::auto_format) {
  ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:382:60: error: '~path' is unavailable: introduced in macOS 10.15
  if (search_name.is_absolute() && std::filesystem::exists(str)) {
                                                           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:968:3: note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:385:35: error: 'absolute' is unavailable: introduced in macOS 10.15
  search_name = (std::filesystem::absolute(rel_file).parent_path()) / str;
                                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:1846:39: note: 'absolute' has been explicitly marked unavailable here
inline _LIBCPP_INLINE_VISIBILITY path absolute(const path& __p) {
                                      ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:385:44: error: 'path' is unavailable: introduced in macOS 10.15
  search_name = (std::filesystem::absolute(rel_file).parent_path()) / str;
                                           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:948:3: note: 'path' has been explicitly marked unavailable here
  path(const _Source& __src, format = format::auto_format) {
  ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:385:44: error: '~path' is unavailable: introduced in macOS 10.15
  search_name = (std::filesystem::absolute(rel_file).parent_path()) / str;
                                           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:968:3: note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:385:18: error: '~path' is unavailable: introduced in macOS 10.15
  search_name = (std::filesystem::absolute(rel_file).parent_path()) / str;
                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:968:3: note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:385:54: error: 'parent_path' is unavailable: introduced in macOS 10.15
  search_name = (std::filesystem::absolute(rel_file).parent_path()) / str;
                                                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:1366:34: note: 'parent_path' has been explicitly marked unavailable here
  _LIBCPP_INLINE_VISIBILITY path parent_path() const {
                                 ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:385:54: error: '~path' is unavailable: introduced in macOS 10.15
  search_name = (std::filesystem::absolute(rel_file).parent_path()) / str;
                                                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:968:3: note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:385:71: error: 'path' is unavailable: introduced in macOS 10.15
  search_name = (std::filesystem::absolute(rel_file).parent_path()) / str;
                                                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:948:3: note: 'path' has been explicitly marked unavailable here
  path(const _Source& __src, format = format::auto_format) {
  ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:385:71: error: '~path' is unavailable: introduced in macOS 10.15
  search_name = (std::filesystem::absolute(rel_file).parent_path()) / str;
                                                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:968:3: note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:385:69: error: 'operator/' is unavailable: introduced in macOS 10.15
  search_name = (std::filesystem::absolute(rel_file).parent_path()) / str;
                                                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:1500:41: note: 'operator/' has been explicitly marked unavailable here
  friend _LIBCPP_INLINE_VISIBILITY path operator/(const path& __lhs,
                                        ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:385:69: error: '~path' is unavailable: introduced in macOS 10.15
  search_name = (std::filesystem::absolute(rel_file).parent_path()) / str;
                                                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:968:3: note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:385:15: error: 'operator=' is unavailable: introduced in macOS 10.15
  search_name = (std::filesystem::absolute(rel_file).parent_path()) / str;
              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:978:9: note: 'operator=' has been explicitly marked unavailable here
  path& operator=(path&& __p) noexcept {
        ^
/Users/klaus/Sources/dolphin/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:387:24: error: 'exists' is unavailable: introduced in macOS 10.15
  if (std::filesystem::exists(search_name)) {
                       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/filesystem:1986:39: note: 'exists' has been explicitly marked unavailable here
inline _LIBCPP_INLINE_VISIBILITY bool exists(const path& __p) {
                                      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make[2]: *** [Source/Core/Core/CMakeFiles/core.dir/PrimeHack/Mods/ElfModLoader.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Source/Core/Core/CMakeFiles/core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
-- MoltenVK build command succeeded.  See also /Users/klaus/Sources/dolphin/build/x86_64/Externals/MoltenVK/MoltenVK-prefix/src/MoltenVK-stamp/MoltenVK-build-*.log
[ 62%] No install step for 'MoltenVK'
[ 62%] Completed 'MoltenVK'
[ 62%] Built target MoltenVK
make: *** [all] Error 2
Traceback (most recent call last):
  File "/Users/klaus/Sources/dolphin/build/../BuildMacOSUniversalBinary.py", line 367, in <module>
    build(conf)
  File "/Users/klaus/Sources/dolphin/build/../BuildMacOSUniversalBinary.py", line 298, in build
    subprocess.check_call(["cmake", "--build", ".",
  File "/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--parallel', '8']' returned non-zero exit status 2.

[ build ]                                                                             ⍉
>

i've installed qt5 from brew (brew install qt@5) i do not have python2, and available python3 seems to match with ../BuildMacOSUniversalBinary.py which have header:

!/usr/bin/env python3

both build seems to fail at moltenvk build step.

SirMangler commented 2 years ago

https://github.com/shiiion/dolphin/wiki/Frequently-Asked-Questions#what-platforms-is-primehack-on

To reiterate, neither me or shio can develop on MacOS. Even if you were to fix these errors, you would not have mouse support as there doesn't exist any mouse implementation for MacOS. We have absolutely no way of maintaining Mac support. Therefore, you are entirely on your own if you wish to pursue this.

The 2nd log tells you your problem, x is unavailable: introduced in macOS 10.15 which suggests your buildtools (or OS) is too old of a version. Try updating them and using the latest C++ standard if possible.

If you discover any problem and fix it, we're open to pull requests, but that's the most we can offer. If you want to discuss this further, I recommend joining our Discord.

shiiion commented 2 years ago

I’ll leave this opened but marked as a wontfix.

nsklaus commented 2 years ago

since it has been reopened i would like to add, i was able to pass that moltenvk error, and also those error: 'path' is unavailable: introduced in macOS 10.15. i added this to the cmakelist.txt file:

# set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14.0" CACHE STRING "")

  set (CMAKE_OSX_DEPLOYMENT_TARGET "12.0" CACHE STRING "Minimum OS X deployment version" FORCE)
  set (CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Architectures" FORCE)
  set (CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET[arch=x86_64] "12.0" CACHE STRING "arm 64 minimum deployment target" FORCE)

i also tried to change from x86_64 with arm64. result is always the same. it compile up to 100% then fails on final step:

[100%] Linking CXX executable ../../../Binaries/Dolphin.app/Contents/MacOS/Dolphin
Undefined symbols for architecture x86_64:
  "_win_w", referenced from:
      RenderWidget::event(QEvent*) in RenderWidget.cpp.o
  "_win_h", referenced from:
      RenderWidget::event(QEvent*) in RenderWidget.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Source/Core/DolphinQt/CMakeFiles/dolphin-emu.dir/build.make:11186: Binaries/Dolphin.app/Contents/MacOS/Dolphin] Error 1
make[1]: *** [CMakeFiles/Makefile2:2546: Source/Core/DolphinQt/CMakeFiles/dolphin-emu.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

i tried full stack x86_84 (using rosetta2 for the terminal, then x86_64 homebrew install, and qt5.12.12 from official site). i also tried full stack arm64 (arm64 homebrew for llvm, python, cmale, make ..) in both cases i end up there with those:Undefined symbols for architecture x86_64 / amr64: "_win_w", "_win_h" maybe i should try with qt6 now.

SirMangler commented 2 years ago

This is due to the fact win_w and win_h are defined within a mouse class. DInputMouseAbsolute on Windows. XInput2Mouse on Linux. I'm honestly surprised it seems to have made it so far without errors.

This should resolve that error. https://github.com/shiiion/dolphin/commit/f82de185aa2365eb34b6567e67d37e3ae40f0fb4

nsklaus commented 2 years ago

@SirMangler thank you for your message, that's nice because i wasn't able to build qt6 from sources (not enough memory error, process took 44gb and macos refused to continue) so i was out of options and ideas. i modified Source/Core/DolphinQt/RenderWidget.cpp as you told, i also did make clean and rm -fr ./* in build directory, and i ran again cmake .. then make -j5 but unfortunately the end result was the same.

[100%] Linking CXX executable ../../../Binaries/Dolphin.app/Contents/MacOS/Dolphin
Undefined symbols for architecture x86_64:
  "_win_w", referenced from:
      RenderWidget::event(QEvent*) in RenderWidget.cpp.o
  "_win_h", referenced from:
      RenderWidget::event(QEvent*) in RenderWidget.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Binaries/Dolphin.app/Contents/MacOS/Dolphin] Error 1
make[1]: *** [Source/Core/DolphinQt/CMakeFiles/dolphin-emu.dir/all] Error 2
make: *** [all] Error 2

[ build ]                                                                     ⍉
> 

here's my RenderWidget.cpp: (from line 454 to 471)

  case QEvent::Resize:
  {
    #if defined(CIFACE_USE_WIN32) || defined(CIFACE_USE_XLIB) 
    const QResizeEvent* se = static_cast<QResizeEvent*>(event);
    QSize new_size = se->size();

    QScreen* screen = window()->windowHandle()->screen();

    const auto dpr = screen->devicePixelRatio();

    // Window Centre for PrimeHack mouselock.
    win_w = (new_size.width() * dpr) / 2;
    win_h = (new_size.height() * dpr) / 2;

    emit SizeChanged(new_size.width() * dpr, new_size.height() * dpr);
    #endif
    break;
  }

but unfortunately this wasn't enough. however, i noticed two lines above (451-452): https://github.com/shiiion/dolphin/blob/f82de185aa2365eb34b6567e67d37e3ae40f0fb4/Source/Core/DolphinQt/RenderWidget.cpp#L451-L452

so possibly there's still more references to correct for this problem.

nsklaus commented 2 years ago

i applied same treatement for those two lines above (451-452) and now i was able to finish compiling primehack.

Consolidate compiler generated dependencies of target dolphin-emu
[ 85%] Building CXX object Source/Core/DolphinQt/CMakeFiles/dolphin-emu.dir/RenderWidget.cpp.o
Copying OS X content Binaries/Dolphin.app/Contents/Frameworks/libMoltenVK.dylib
[ 85%] Linking CXX executable ../../../Binaries/Dolphin.app/Contents/MacOS/Dolphin
-- Fixing up application bundle: /Users/klaus/Sources/dolphin/build/Binaries/Dolphin.app
/Dolphin.app: No such file or directory
/Dolphin.app: No such file or directory
[100%] Built target dolphin-emu

[ build ]                                                                      
> 

i can run it, application starts. i see the modifications this project brought (in settings, i see primehack specific panels) i'm also greeted by a popup saying this is inital run and i'm highly recommended to choose default settings for controller and so on. so that part is good. however, when i try to start any game it immediately crash and quit. to note, normal dolphin runs fine on the same hardware/system/environment. i'm also able to build normal dolphin from sources and it runs fine, even when using my own builds i can play games. i'm playing resident evil 0, 1 and 2 through normal dolphin. i wanted to play metroid prime too but gamecube controls for this game is not enjoyable. i wanted to have controller both stick to work in the usual fashion for FPS. (one stick to lookaround and the other stick for movement). also to note, all the games i currently have are gamecube ones. so to recap: app compiles and runs, but immediately crash upon starting a game.

i don't know if it will be of any help, but i have a crashlog: Dolphin-2022-04-20-121406.log

nsklaus commented 2 years ago

hold on, i just tried to build a normal dolphin from sources, and i see the same problem. i bet it's a moltenvk issue. something must have changed on their side. i will investigate. but since this project and normal doplhin now are on par, i think it's fine to consider that with the minors changes needed as seen in this issue, it's enough to get primehack to compile fine on mac too.

nsklaus commented 2 years ago

using this patch here: https://github.com/KhronosGroup/MoltenVK/issues/573#issuecomment-483427224 i'm able to compile the normal dolphin from source and have it run games. i tried to replicate that with primehack, but i fail at it so far. result is like before: app start, UI is usable, but everything crashes if i try to launch a game.

SirMangler commented 2 years ago

i modified Source/Core/DolphinQt/RenderWidget.cpp as you told

I wasn't telling you to do anything, I only sent the commit link to show you there's a new commit, you can simply update your repository with git pull assuming you used cloned the repository. If you didn't use git, you can redownload the latest source code.

but unfortunately this wasn't enough. however, i noticed two lines above (451-452):

https://github.com/shiiion/dolphin/blob/f82de185aa2365eb34b6567e67d37e3ae40f0fb4/Source/Core/DolphinQt/RenderWidget.cpp#L451-L452

so possibly there's still more references to correct for this problem.

Whoops, great job on me for missing that part. I pushed an update to cover that one too.

but everything crashes if i try to launch a game.

Sometimes on Windows, going between two dolphin versions can corrupt the video cache in strange ways causing crashes. You could try isolating or clearing your settings.

nsklaus commented 2 years ago

i deleted settings directory, on macos it's on ~/Library/Application Support/Dolphin/ apparently. when i started primehack after that, i once again was greeted with the first run popup. but result was the same. i also tried to use the libmoltenvk.dylib created by the compilation of normal dolphin, that works well and i copied it over in primehack's app bundle in: ~/Sources/dolphin/build/Binaries/Dolphin.app/Contents/Frameworks/libMoltenVK.dylib but that didn't help either.

here's the crashlog if it's of any help. meanwhile i'll continue investigating but i'm kind of running out of ideas.. Dolphin-2022-04-21-120418.log

vyuuui commented 2 years ago
Thread 18 Crashed:: Emuthread - Starting
0   Dolphin                                0x1050c4145 SerialInterface::UpdateDevices() + 373
1   Dolphin                                0x1050c7c5a VideoInterface::Update(unsigned long long) + 506 

As is stated in the crash log, the thread that crashed was last running UpdateDevices, where we update our own mouse input device. This is not implemented for MacOS, and needs to be if it is to work on that platform.

nsklaus commented 2 years ago

@vyuuui i see.. thanks for telling. i'm out of luck for the time being then. at least now i know.

SirMangler commented 2 years ago

@vyuuui i see.. thanks for telling. i'm out of luck for the time being then. at least now i know.

Try compiling the newest changes.

https://github.com/shiiion/dolphin/commit/b414e7b3072cc684117c6b4b046f93ea497e0003

brandonsorensen commented 2 years ago

Following the discussion in this thread, I was able to build PrimeHack on a base M1 device and launch an Echoes GameCube ROM with no crash. Naturally, the mouse input doesn't work.

I would be interested in trying to implement an input API class for macOS. My expertise skews more toward data science, so I am not used to working this close to the metal and may need some pointers. But given the limited scope, I'd love to take a stab at it.

I am curious whether we could leverage XQuartz such that we could just re-use the existing XInput2Mouse implementation. That's the direction I'll be trying first.

vyuuui commented 2 years ago

While I personally discourage the requirement of third party software being installed to be able to use this, if it allows you to quickly push out something that can be tested then go ahead. If possible, it should work with the native quartz API, which has been implemented here.

brandonsorensen commented 2 years ago

I created a mostly functional build by more or less recycling the code in that file. There's still a few hiccups I'm working to iron out, but as a proof of concept it's basically ready to go. I'll create a PR when I have time over the next few days.

vyuuui commented 2 years ago

@nsklaus ToT should have this dealt with, give it a try.