macOS: Fix things broken by plugin merges

This commit is contained in:
TellowKrinkle 2020-11-16 01:09:17 -06:00 committed by tellowkrinkle
parent 16750c19ce
commit 790e0a8327
13 changed files with 73 additions and 25 deletions

View File

@ -4,9 +4,9 @@
## Use cmake package to find module
if (Linux)
find_package(ALSA)
find_package(PCAP)
find_package(LibXml2)
endif()
find_package(PCAP)
find_package(LibXml2)
find_package(Freetype) # GSdx OSD
find_package(Gettext) # translation tool
if(EXISTS ${PROJECT_SOURCE_DIR}/.git)

View File

@ -330,6 +330,10 @@ set(pcsx2DEV9Headers
${pcsx2DEV9UIHeaders}
)
# USBNull
set(pcsx2USBNullSources USB/USBNull.cpp)
set(pcsx2USBNullHeaders USB/USB.h)
# USB sources
set(pcsx2USBSources
USB/USB.cpp
@ -378,7 +382,7 @@ set(pcsx2USBSources
USB/usb-eyetoy/api_init_linux.cpp
USB/usb-hid/api_init_linux.cpp
USB/usb-mic/api_init_linux.cpp
)
)
# USB headers
set(pcsx2USBHeaders
@ -876,8 +880,6 @@ set(Common
${pcsx2SPU2Headers}
${pcsx2DEV9Sources}
${pcsx2DEV9Headers}
${pcsx2USBSources}
${pcsx2USBHeaders}
${pcsx2DebugToolsSources}
${pcsx2GuiSources}
${pcsx2GuiResources}
@ -904,6 +906,8 @@ if(Linux)
set(Platform
${pcsx2LinuxSources}
${pcsx2LinuxHeaders}
${pcsx2USBSources}
${pcsx2USBHeaders}
)
set(Platform_Libs
@ -922,7 +926,9 @@ endif()
if(APPLE)
set(Platform
${pcsx2OSXSources}
${pcsx2LinuxHeaders})
${pcsx2LinuxHeaders}
${pcsx2USBNullSources}
${pcsx2USBNullHeaders})
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")

View File

@ -21,7 +21,7 @@
//#include <winsock2.h>
#include <Winioctl.h>
#include <windows.h>
#elif defined(__linux__)
#elif defined(__linux__) || defined(__APPLE__)
#include <sys/types.h>
#include <sys/mman.h>
#include <err.h>

View File

@ -58,16 +58,13 @@ void InitNet(NetAdapter* ad)
#ifdef _WIN32
SetThreadPriority(rx_thread.native_handle(), THREAD_PRIORITY_HIGHEST);
#elif defined(__POSIX__)
pthread_attr_t thAttr;
int policy = 0;
int max_prio_for_policy = 0;
sched_param param;
pthread_attr_init(&thAttr);
pthread_attr_getschedpolicy(&thAttr, &policy);
max_prio_for_policy = sched_get_priority_max(policy);
pthread_getschedparam(rx_thread.native_handle(), &policy, &param);
param.sched_priority = sched_get_priority_max(policy);
pthread_setschedprio(rx_thread.native_handle(), max_prio_for_policy);
pthread_attr_destroy(&thAttr);
pthread_setschedparam(rx_thread.native_handle(), policy, &param);
#endif
}

View File

@ -62,10 +62,7 @@ static __forceinline T GetClamped(T src, T min, T max)
return std::min(std::max(src, min), max);
}
#ifdef __WXMAC__
#else
extern void SysMessage(const char* fmt, ...);
#endif
extern void SysMessage(const wchar_t* fmt, ...);
//////////////////////////////////////////////////////////////

View File

@ -19,7 +19,7 @@
#include "Dialogs.h"
#include <cstring>
#if defined(__unix__)
#if defined(__unix__) || defined(__APPLE__)
#include <wx/wx.h>
void SysMessage(const char* fmt, ...)

View File

@ -89,8 +89,10 @@ SndOutModule* mods[] =
#if defined(SPU2X_PORTAUDIO)
PortaudioOut,
#endif
#if defined(__linux__) /* && defined(__ALSA__)*/
#if defined(__linux__) || defined(__APPLE__)
SDLOut,
#endif
#if defined(__linux__) /* && defined(__ALSA__)*/
AlsaOut,
#endif
nullptr // signals the end of our list

View File

@ -22,7 +22,7 @@
#ifdef _WIN32
#include <portaudio/include/portaudio.h>
#include "Windows/Dialogs.h"
#elif defined __linux
#elif defined(__linux__) || defined(__APPLE__)
#include "portaudio.h"
#include "Linux/Dialogs.h"
#endif

View File

@ -19,7 +19,7 @@
#include "Global.h"
#include "SndOut.h"
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include "Linux/Dialogs.h"
#elif defined(_WIN32)
#include "Windows/Dialogs.h"

View File

@ -17,7 +17,7 @@
#include "Global.h"
#include "spu2.h"
#include "Dma.h"
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include "Linux/Dialogs.h"
#include "Linux/Config.h"
#elif defined(_WIN32)

View File

@ -15,7 +15,7 @@
#include "PrecompiledHeader.h"
#include "../Config.h"
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include "../Linux/Config.h"
#endif
#include "../Global.h"

View File

@ -69,7 +69,7 @@ s64 remaining = 0;
#if _WIN32
HWND gsWnd = nullptr;
#else
#elif defined(__linux__)
#include "gtk.h"
#include <gdk/gdkx.h>
#include <X11/X.h>
@ -253,7 +253,7 @@ s32 USBopen(void* pDsp)
}
gsWnd = hWnd;
pDsp = gsWnd;
#else
#elif defined(__linux__)
g_GSdsp = (Display*)((uptr*)pDsp)[0];
g_GSwin = (Window)((uptr*)pDsp)[1];

46
pcsx2/USB/USBNull.cpp Normal file
View File

@ -0,0 +1,46 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2020 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "USB.h"
u8* ram = nullptr;
void USBconfigure() {}
void DestroyDevices() {}
void CreateDevices() {}
s32 USBinit() { return 0; }
void USBasync(u32 cycles) {}
void USBshutdown() {}
void USBclose() {}
s32 USBopen(void* pDsp) { return 0; }
s32 USBfreeze(int mode, freezeData* data) { return 0; }
u8 USBread8(u32 addr) { return 0; }
u16 USBread16(u32 addr) { return 0; }
u32 USBread32(u32 addr) { return 0; }
void USBwrite8(u32 addr, u8 value) {}
void USBwrite16(u32 addr, u16 value) {}
void USBwrite32(u32 addr, u32 value) {}
void USBDoFreezeOut(void* dest) {}
void USBDoFreezeIn(pxInputStream& infp) {}
void USBsetRAM(void* mem) { ram = static_cast<u8*>(mem); }
FILE* usbLog = nullptr;
s64 get_clock() { return 0; };