Merge pull request #1561 from comex/10.9

Update OS X Requirement to 10.9 + fixes
This commit is contained in:
skidau 2014-11-26 12:31:28 +11:00
commit 69bd1562e2
13 changed files with 70 additions and 15 deletions

View File

@ -250,10 +250,10 @@ if(APPLE)
# This is inserted into the Info.plist as well. # This is inserted into the Info.plist as well.
# Note that the SDK determines the maximum version of which optional # Note that the SDK determines the maximum version of which optional
# features can be used, not the minimum required version to run. # features can be used, not the minimum required version to run.
set(OSX_MIN_VERSION "10.7") set(OSX_MIN_VERSION "10.9")
set(TARGET_FLAGS "${TARGET_FLAGS} -mmacosx-version-min=${OSX_MIN_VERSION}") set(TARGET_FLAGS "${TARGET_FLAGS} -mmacosx-version-min=${OSX_MIN_VERSION}")
set(SYSROOT_LEGACY_PATH "/Developer/SDKs/MacOSX10.7.sdk") set(SYSROOT_LEGACY_PATH "/Developer/SDKs/MacOSX10.9.sdk")
set(SYSROOT_PATH "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk") set(SYSROOT_PATH "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk")
if(EXISTS "${SYSROOT_PATH}/") if(EXISTS "${SYSROOT_PATH}/")
set(TARGET_SYSROOT ${SYSROOT_PATH}) set(TARGET_SYSROOT ${SYSROOT_PATH})
elseif(EXISTS "${SYSROOT_LEGACY_PATH}/") elseif(EXISTS "${SYSROOT_LEGACY_PATH}/")

View File

@ -11,7 +11,7 @@ Please read the [FAQ](https://dolphin-emu.org/docs/faq/) before using Dolphin.
## System Requirements ## System Requirements
* OS * OS
* Microsoft Windows (Vista or higher). * Microsoft Windows (Vista or higher).
* Linux or Apple Mac OS X (10.7 or higher). * Linux or Apple Mac OS X (10.9 or higher).
* Unix-like systems other than Linux might work but are not officially supported. * Unix-like systems other than Linux might work but are not officially supported.
* Processor * Processor
* A CPU with SSE2 support. * A CPU with SSE2 support.

View File

@ -32,22 +32,22 @@ bool CoreAudioSound::Start()
OSStatus err; OSStatus err;
AURenderCallbackStruct callback_struct; AURenderCallbackStruct callback_struct;
AudioStreamBasicDescription format; AudioStreamBasicDescription format;
ComponentDescription desc; AudioComponentDescription desc;
Component component; AudioComponent component;
desc.componentType = kAudioUnitType_Output; desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_DefaultOutput; desc.componentSubType = kAudioUnitSubType_DefaultOutput;
desc.componentFlags = 0; desc.componentFlags = 0;
desc.componentFlagsMask = 0; desc.componentFlagsMask = 0;
desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentManufacturer = kAudioUnitManufacturer_Apple;
component = FindNextComponent(nullptr, &desc); component = AudioComponentFindNext(nullptr, &desc);
if (component == nullptr) if (component == nullptr)
{ {
ERROR_LOG(AUDIO, "error finding audio component"); ERROR_LOG(AUDIO, "error finding audio component");
return false; return false;
} }
err = OpenAComponent(component, &audioUnit); err = AudioComponentInstanceNew(component, &audioUnit);
if (err != noErr) if (err != noErr)
{ {
ERROR_LOG(AUDIO, "error opening audio component"); ERROR_LOG(AUDIO, "error opening audio component");
@ -131,7 +131,7 @@ void CoreAudioSound::Stop()
if (err != noErr) if (err != noErr)
ERROR_LOG(AUDIO, "error uninitializing audiounit"); ERROR_LOG(AUDIO, "error uninitializing audiounit");
err = CloseComponent(audioUnit); err = AudioComponentInstanceDispose(audioUnit);
if (err != noErr) if (err != noErr)
ERROR_LOG(AUDIO, "error closing audio component"); ERROR_LOG(AUDIO, "error closing audio component");
} }

View File

@ -26,9 +26,18 @@
#include <AL/alext.h> #include <AL/alext.h>
#endif #endif
#ifdef __APPLE__
// Avoid conflict with objc.h (on Windows, ST uses the system BOOL type, so this doesn't work)
#define BOOL SoundTouch_BOOL
#endif
#include <soundtouch/SoundTouch.h> #include <soundtouch/SoundTouch.h>
#include <soundtouch/STTypes.h> #include <soundtouch/STTypes.h>
#ifdef __APPLE__
#undef BOOL
#endif
// 16 bit Stereo // 16 bit Stereo
#define SFX_MAX_SOURCE 1 #define SFX_MAX_SOURCE 1
#define OAL_MAX_BUFFERS 32 #define OAL_MAX_BUFFERS 32

View File

@ -64,4 +64,9 @@ int Wiimote::IOWrite(const u8* buf, size_t len)
return 0; return 0;
} }
void Wiimote::EnablePowerAssertionInternal()
{}
void Wiimote::DisablePowerAssertionInternal()
{}
}; };

View File

@ -255,4 +255,9 @@ int Wiimote::IOWrite(u8 const* buf, size_t len)
return write(int_sock, buf, (int)len); return write(int_sock, buf, (int)len);
} }
void Wiimote::EnablePowerAssertionInternal()
{}
void Wiimote::DisablePowerAssertionInternal()
{}
}; // WiimoteReal }; // WiimoteReal

View File

@ -783,6 +783,11 @@ int Wiimote::IOWrite(const u8* buf, size_t len)
return _IOWrite(dev_handle, hid_overlap_write, stack, buf, len, nullptr); return _IOWrite(dev_handle, hid_overlap_write, stack, buf, len, nullptr);
} }
void Wiimote::EnablePowerAssertionInternal()
{}
void Wiimote::DisablePowerAssertionInternal()
{}
// invokes callback for each found wiimote bluetooth device // invokes callback for each found wiimote bluetooth device
template <typename T> template <typename T>
void ProcessWiimotes(bool new_scan, T& callback) void ProcessWiimotes(bool new_scan, T& callback)

View File

@ -72,7 +72,6 @@
memcpy(wm->input, data, length); memcpy(wm->input, data, length);
wm->inputlen = length; wm->inputlen = length;
(void)UpdateSystemActivity(UsrActivity);
CFRunLoopStop(CFRunLoopGetCurrent()); CFRunLoopStop(CFRunLoopGetCurrent());
} }
@ -195,6 +194,7 @@ void Wiimote::InitInternal()
m_connected = false; m_connected = false;
m_wiimote_thread_run_loop = nullptr; m_wiimote_thread_run_loop = nullptr;
btd = nil; btd = nil;
m_pm_assertion = kIOPMNullAssertionID;
} }
void Wiimote::TeardownInternal() void Wiimote::TeardownInternal()
@ -328,4 +328,22 @@ int Wiimote::IOWrite(const unsigned char *buf, size_t len)
return 0; return 0;
} }
void Wiimote::EnablePowerAssertionInternal()
{
if (m_pm_assertion == kIOPMNullAssertionID)
{
if (IOReturn ret = IOPMAssertionCreateWithName(kIOPMAssertPreventUserIdleDisplaySleep, kIOPMAssertionLevelOn, CFSTR("Dolphin Wiimote activity"), &m_pm_assertion))
ERROR_LOG(WIIMOTE, "Could not create power management assertion: %08x", ret);
}
}
void Wiimote::DisablePowerAssertionInternal()
{
if (m_pm_assertion != kIOPMNullAssertionID)
{
if (IOReturn ret = IOPMAssertionRelease(m_pm_assertion))
ERROR_LOG(WIIMOTE, "Could not release power management assertion: %08x", ret);
}
}
} }

View File

@ -48,6 +48,7 @@ Wiimote::Wiimote()
Wiimote::~Wiimote() Wiimote::~Wiimote()
{ {
DisablePowerAssertionInternal();
StopThread(); StopThread();
ClearReadQueue(); ClearReadQueue();
m_write_reports.Clear(); m_write_reports.Clear();
@ -334,6 +335,7 @@ bool Wiimote::PrepareOnThread()
void Wiimote::EmuStart() void Wiimote::EmuStart()
{ {
DisableDataReporting(); DisableDataReporting();
EnablePowerAssertionInternal();
} }
void Wiimote::EmuStop() void Wiimote::EmuStop()
@ -343,6 +345,8 @@ void Wiimote::EmuStop()
DisableDataReporting(); DisableDataReporting();
NOTICE_LOG(WIIMOTE, "Stopping Wiimote data reporting."); NOTICE_LOG(WIIMOTE, "Stopping Wiimote data reporting.");
DisablePowerAssertionInternal();
} }
void Wiimote::EmuResume() void Wiimote::EmuResume()
@ -358,6 +362,8 @@ void Wiimote::EmuResume()
QueueReport(WM_REPORT_MODE, &rpt, sizeof(rpt)); QueueReport(WM_REPORT_MODE, &rpt, sizeof(rpt));
NOTICE_LOG(WIIMOTE, "Resuming Wiimote data reporting."); NOTICE_LOG(WIIMOTE, "Resuming Wiimote data reporting.");
EnablePowerAssertionInternal();
} }
void Wiimote::EmuPause() void Wiimote::EmuPause()
@ -371,6 +377,8 @@ void Wiimote::EmuPause()
QueueReport(WM_REPORT_MODE, &rpt, sizeof(rpt)); QueueReport(WM_REPORT_MODE, &rpt, sizeof(rpt));
NOTICE_LOG(WIIMOTE, "Pausing Wiimote data reporting."); NOTICE_LOG(WIIMOTE, "Pausing Wiimote data reporting.");
DisablePowerAssertionInternal();
} }
static unsigned int CalculateConnectedWiimotes() static unsigned int CalculateConnectedWiimotes()

View File

@ -47,6 +47,9 @@ public:
void EmuResume(); void EmuResume();
void EmuPause(); void EmuPause();
void EnablePowerAssertionInternal();
void DisablePowerAssertionInternal();
// connecting and disconnecting from physical devices // connecting and disconnecting from physical devices
// (using address inserted by FindWiimotes) // (using address inserted by FindWiimotes)
// these are called from the wiimote's thread. // these are called from the wiimote's thread.
@ -80,6 +83,7 @@ public:
int inputlen; int inputlen;
bool m_connected; bool m_connected;
CFRunLoopRef m_wiimote_thread_run_loop; CFRunLoopRef m_wiimote_thread_run_loop;
IOPMAssertionID m_pm_assertion;
#elif defined(__linux__) && HAVE_BLUEZ #elif defined(__linux__) && HAVE_BLUEZ
bdaddr_t bdaddr; // Bluetooth address bdaddr_t bdaddr; // Bluetooth address
int cmd_sock; // Command socket int cmd_sock; // Command socket

View File

@ -15,6 +15,7 @@
#define NS_ENUM_AVAILABLE(...) #define NS_ENUM_AVAILABLE(...)
// end hack // end hack
#import <IOBluetooth/IOBluetooth.h> #import <IOBluetooth/IOBluetooth.h>
#include <IOKit/pwr_mgt/IOPMLib.h>
#elif defined(__linux__) && HAVE_BLUEZ #elif defined(__linux__) && HAVE_BLUEZ
#include <bluetooth/bluetooth.h> #include <bluetooth/bluetooth.h>
#endif #endif

View File

@ -17,7 +17,7 @@
static bool IsOsSupported() static bool IsOsSupported()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
return QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7; return QSysInfo::MacintoshVersion >= QSysInfo::MV_10_9;
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
return (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based) >= QSysInfo::WV_VISTA; return (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based) >= QSysInfo::WV_VISTA;
#else #else
@ -28,7 +28,7 @@ static bool IsOsSupported()
static QString LowestSupportedOsVersion() static QString LowestSupportedOsVersion()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
return SL("Mac OS X 10.7"); return SL("Mac OS X 10.9");
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
return SL("Windows Vista SP2"); return SL("Windows Vista SP2");
#else #else

View File

@ -241,12 +241,12 @@ bool DolphinApp::OnInit()
#endif #endif
#ifdef __APPLE__ #ifdef __APPLE__
if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_7) if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_9)
{ {
PanicAlertT("Hi,\n\nDolphin requires Mac OS X 10.7 or greater.\n" PanicAlertT("Hi,\n\nDolphin requires Mac OS X 10.9 or greater.\n"
"Unfortunately you're running an old version of OS X.\n" "Unfortunately you're running an old version of OS X.\n"
"The last Dolphin version to support OS X 10.6 is Dolphin 3.5\n" "The last Dolphin version to support OS X 10.6 is Dolphin 3.5\n"
"Please upgrade to 10.7 or greater to use the newest Dolphin version.\n\n" "Please upgrade to 10.9 or greater to use the newest Dolphin version.\n\n"
"Sayonara!\n"); "Sayonara!\n");
return false; return false;
} }