• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
1 2 3 4 5 ... 114 Next »

[Unofficial] Dolphin built for an older version of macOS / OS X (10.9 Mavericks)
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
[Unofficial] Dolphin built for an older version of macOS / OS X (10.9 Mavericks)
05-03-2021, 12:51 PM (This post was last modified: 05-04-2021, 05:08 AM by wowfunhappy.)
#1
wowfunhappy Offline
Junior Member
**
Posts: 49
Threads: 6
Joined: Jan 2016
Brick 
[Image: screen-shot-2021-05-03-at-12-52-45-am-png.1768954]
Hello! Over the past year-and-a-half or so, I've become a little obsessed with a specific version of Apple's Mac operating system, known as "Mavericks". It's the last version before Apple made everything flat, and it's both super stable and very hackable!

Official builds of Dolphin do not work on Mavericks, and have not for many years; even the old 5.0 stable release crashes on launch. However, after futzing around way too much with Dolphin and QT over the weekend, I was able to compile a fully up-to-date build that works! I just finished this an hour ago and haven't had the chance to dig into any games, but Mario Galaxy, Sin & Punishment, and Kirby's Air Ride all seemed to load up without issue.

Build instructions (including code modifications) are below, and you can find my patched copy of qt-base 5.9 here. To the at-least-one other person in the universe who finds this useful: you are very, very welcome!

Known Issues/Limitations
• No Vulkan/MoltenVK support
• No built-in updater
• I may have added back some race conditions in Dolphin's configuration and Analytics code, due to Mavericks's lack of shared_mutex.
• Probably other things. Please don't report bugs to the Dolphin developers. You can report them to me in this thread, if you'd like.

https://jonathanalland.com/downloads/dolphin-for-mavericks.dmg

Build Instructions: (Show Spoiler)
1. sudo port install clang-11 hidapi legacy-support



2. Build and install qt5.9 using my modified version of qt-base: https://github.com/Wowfunhappy/qt5.9-base-mavericks



3. Change the relevant part of CMakeLists.txt to:

Code:
# MacOS prior to 10.12 did not fully support C++17, which is used to
# handle configuration options
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9.5" CACHE STRING "")
include_directories(/opt/local/include/LegacySupport)

set(CMAKE_USER_MAKE_RULES_OVERRIDE "CMake/FlagsOverride.cmake")

project(dolphin-emu)

# Name of the Dolphin distributor. If you redistribute Dolphin builds (forks,
# unofficial builds) please consider identifying your distribution with a
# unique name here.
set(DISTRIBUTOR "Wowfunhappy" CACHE STRING "Name of the distributor.")



4. Run the below to remove shared_mutex from Analytics.h

Code:
git revert 5e3472eba926703f5ee3e8c671e70ff5a4f0b0cf



5. Replace Externals/fmt with an updated copy from the libfmt's master branch. I used commit 38127d9ec03c64cf3ebd2df64f02ff3e7b9e89be, the latest as of this writing.



6. Comment out the following lines in dolphin/Source/Core/DolphinQt/CMakeLists.txt:

Code:
get_target_property(qtmacstyle_location Qt5::QMacStylePlugin LOCATION)
target_sources(dolphin-emu PRIVATE "${qtmacstyle_location}")
set_source_files_properties("${qtmacstyle_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/styles)



7. Add to top of dolphin/Source/Core/MacUpdater/CMakeLists.txt:

Code:
#Doesn't work on 10.9
return()



8. Comment out the following line in dolphin/Source/Core/Common/Config/ConfigInfo.h:

Code:
#include <shared_mutex>



9. Replace the relevant part at the bottom of dolphin/Source/Core/Common/Config/ConfigInfo.h:

Code:
CachedValue<T> GetCachedValue() const
 {
   std::lock_guard lock(m_cached_value_mutex);
   return m_cached_value;
 }

 template <typename U>
 CachedValue<U> GetCachedValueCasted() const
 {
   std::lock_guard lock(m_cached_value_mutex);
   return CachedValue<U>{static_cast<U>(m_cached_value.value), m_cached_value.config_version};
 }

 void SetCachedValue(const CachedValue<T>& cached_value) const
 {
   std::unique_lock lock(m_cached_value_mutex);
   if (m_cached_value.config_version < cached_value.config_version)
     m_cached_value = cached_value;
 }

private:
 Location m_location;
 T m_default_value;

 mutable CachedValue<T> m_cached_value;
 mutable std::mutex m_cached_value_mutex;
};
}  // namespace Config



10. Replace the entire contents of Source/Core/Common/Config/Config.cpp with the following:

Code:
// Copyright 2016 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#include <algorithm>
#include <atomic>
#include <list>
#include <map>
#include <mutex>
#include <shared_mutex>

#include "Common/Config/Config.h"

namespace Config
{
static Layers s_layers;
static std::list<ConfigChangedCallback> s_callbacks;
static u32 s_callback_guards = 0;
static std::atomic<u64> s_config_version = 0;

Layers* GetLayers()
{
 return &s_layers;
}

void AddLayer(std::unique_ptr<Layer> layer)
{
 s_layers[layer->GetLayer()] = std::move(layer);
 OnConfigChanged();
}

void AddLayer(std::unique_ptr<ConfigLayerLoader> loader)
{
 AddLayer(std::make_unique<Layer>(std::move(loader)));
}

Layer* GetLayer(LayerType layer)
{
 if (!LayerExists(layer))
   return nullptr;
 return s_layers[layer].get();
}

void RemoveLayer(LayerType layer)
{
 s_layers.erase(layer);
 OnConfigChanged();
}
bool LayerExists(LayerType layer)
{
 return s_layers.find(layer) != s_layers.end();
}

void AddConfigChangedCallback(ConfigChangedCallback func)
{
 s_callbacks.emplace_back(func);
}
   
void OnConfigChanged()
{
 s_config_version.fetch_add(1, std::memory_order_relaxed);
 if (s_callback_guards)
   return;

 for (const auto& callback : s_callbacks)
   callback();
}
   
u64 GetConfigVersion()
{
   return s_config_version.load(std::memory_order_relaxed);
}

// Explicit load and save of layers
void Load()
{
 for (auto& layer : s_layers)
   layer.second->Load();
 OnConfigChanged();
}

void Save()
{
 for (auto& layer : s_layers)
   layer.second->Save();
 OnConfigChanged();
}

void Init()
{
 // These layers contain temporary values
 ClearCurrentRunLayer();
}

void Shutdown()
{
 s_layers.clear();
 s_callbacks.clear();
}

void ClearCurrentRunLayer()
{
 s_layers[LayerType::CurrentRun] = std::make_unique<Layer>(LayerType::CurrentRun);
}

static const std::map<System, std::string> system_to_name = {
   {System::Main, "Dolphin"},          {System::GCPad, "GCPad"},    {System::WiiPad, "Wiimote"},
   {System::GCKeyboard, "GCKeyboard"}, {System::GFX, "Graphics"},   {System::Logger, "Logger"},
   {System::Debugger, "Debugger"},     {System::SYSCONF, "SYSCONF"}};

const std::string& GetSystemName(System system)
{
 return system_to_name.at(system);
}

std::optional<System> GetSystemFromName(const std::string& name)
{
 const auto system = std::find_if(system_to_name.begin(), system_to_name.end(),
                                  [&name](const auto& entry) { return entry.second == name; });
 if (system != system_to_name.end())
   return system->first;

 return {};
}

const std::string& GetLayerName(LayerType layer)
{
 static const std::map<LayerType, std::string> layer_to_name = {
     {LayerType::Base, "Base"},
     {LayerType::GlobalGame, "Global GameINI"},
     {LayerType::LocalGame, "Local GameINI"},
     {LayerType::Netplay, "Netplay"},
     {LayerType::Movie, "Movie"},
     {LayerType::CommandLine, "Command Line"},
     {LayerType::CurrentRun, "Current Run"},
 };
 return layer_to_name.at(layer);
}

LayerType GetActiveLayerForConfig(const Location& config)
{
 for (auto layer : SEARCH_ORDER)
 {
     const auto it = s_layers.find(layer);
     if (it != s_layers.end())
     {
         if (it->second->Exists(config))
             return layer;
     }
 }

 // If config is not present in any layer, base layer is considered active.
 return LayerType::Base;
}

std::optional<std::string> GetAsString(const Location& config)
{
   std::optional<std::string> result;
   //ReadLock lock(s_layers_rw_lock);
   
   for (auto layer : SEARCH_ORDER)
   {
       const auto it = s_layers.find(layer);
       if (it != s_layers.end())
       {
           result = it->second->Get<std::string>(config);
           if (result.has_value())
               break;
       }
   }
   
   return result;
}
   
ConfigChangeCallbackGuard::ConfigChangeCallbackGuard()
{
 ++s_callback_guards;
}

ConfigChangeCallbackGuard::~ConfigChangeCallbackGuard()
{
 if (--s_callback_guards)
   return;

 OnConfigChanged();
}

}  // namespace Config



11. Run cmake, specifying the path to MacPorts's modern clang compiler.

Code:
cmake -DCMAKE_C_COMPILER=/opt/local/bin/clang-mp-11 -DCMAKE_CXX_COMPILER=/opt/local/bin/clang++-mp-11 -DENABLE_VULKAN=OFF -DCMAKE_PREFIX_PATH=/usr/local/Qt-5.9.9/ ../dolphin/
Find
Reply
05-10-2021, 03:43 PM
#2
wowfunhappy Offline
Junior Member
**
Posts: 49
Threads: 6
Joined: Jan 2016
I've been using this quite heavily over the past week, it really does work! I'm through the first half of NSMBWii and the first world of Super Mario Galaxy 2. All on my favorite eight year old OS... I'm very pleased! Big Grin

Some notes:

1. You should go into Settings → Interface and uncheck "Confirm on Stop". Otherwise, Dolphin will sometimes crash when exiting a game from fullscreen mode.

2. Attempting to map buttons on certain controllers causes Dolphin to freeze for a few minutes. To work around this, right click the buttons to use the advanced "Configure Input" dialog. If you hold down the button on your controller as this dialog opens, it'll be easy to tell which one to select.
Find
Reply
05-31-2021, 06:13 AM
#3
wowfunhappy Offline
Junior Member
**
Posts: 49
Threads: 6
Joined: Jan 2016
I have set this up properly on Github now, and I plan to post future releases there. Hoping to stay in sync with master, at least until support for QT 5.9 is dropped.

https://github.com/Wowfunhappy/dolphin/releases/

(Sorry for the triple bump, my post count is too low to edit posts >24 hours old.)
Find
Reply
08-31-2021, 06:57 AM
#4
WaxXxy Offline
Junior Member
**
Posts: 1
Threads: 0
Joined: Aug 2021
Hello fellow OS Mavericks user appreciate the work you are doing for the platform, I have a slightly off topic question for you, do you know of a way to convert .rvz files to .iso on Mac OS 10.9.5? it seems as though the version of dolphin (5.0-5971) I'm running can't recognize .rvz, much thanks in advance!!
Find
Reply
02-13-2022, 10:43 AM (This post was last modified: 02-13-2022, 10:44 AM by wowfunhappy.)
#5
wowfunhappy Offline
Junior Member
**
Posts: 49
Threads: 6
Joined: Jan 2016
(08-31-2021, 06:57 AM)WaxXxy Wrote: Hello fellow OS Mavericks user appreciate the work you are doing for the platform, I have a slightly off topic question for you, do you know of a way to convert .rvz files to .iso on Mac OS 10.9.5? it seems as though the version of dolphin (5.0-5971) I'm running can't recognize .rvz, much thanks in advance!!

Yes... use my Dolphin builds! (Which can now be downloaded from https://jonathanalland.com/old-osx-projects.html)
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode