mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00:00
android stuff
This commit is contained in:
parent
11e214f332
commit
a7f102610b
11 changed files with 304 additions and 236 deletions
108
3rdparty/CMakeLists.txt
vendored
108
3rdparty/CMakeLists.txt
vendored
|
@ -84,8 +84,12 @@ endif()
|
|||
|
||||
|
||||
# hidapi
|
||||
add_subdirectory(hidapi)
|
||||
|
||||
if (NOT ANDROID)
|
||||
add_subdirectory(hidapi)
|
||||
else()
|
||||
add_library(3rdparty_hidapi INTERFACE)
|
||||
target_compile_definitions(3rdparty_hidapi INTERFACE WITHOUT_HIDAPI=1)
|
||||
endif()
|
||||
|
||||
# glslang
|
||||
add_subdirectory(glslang EXCLUDE_FROM_ALL)
|
||||
|
@ -99,24 +103,28 @@ add_subdirectory(yaml-cpp)
|
|||
|
||||
# OpenGL
|
||||
|
||||
find_package(OpenGL REQUIRED OPTIONAL_COMPONENTS EGL)
|
||||
if (NOT ANDROID)
|
||||
find_package(OpenGL REQUIRED OPTIONAL_COMPONENTS EGL)
|
||||
|
||||
add_library(3rdparty_opengl INTERFACE)
|
||||
target_include_directories(3rdparty_opengl INTERFACE GL)
|
||||
add_library(3rdparty_opengl INTERFACE)
|
||||
target_include_directories(3rdparty_opengl INTERFACE GL)
|
||||
|
||||
if (WIN32)
|
||||
if(NOT MSVC)
|
||||
if (WIN32)
|
||||
if(NOT MSVC)
|
||||
target_link_libraries(3rdparty_opengl INTERFACE OpenGL::GL OpenGL::GLU)
|
||||
else()
|
||||
target_link_libraries(3rdparty_opengl INTERFACE dxgi.lib d2d1.lib dwrite.lib)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
target_link_libraries(3rdparty_opengl INTERFACE OpenGL::GL OpenGL::GLU)
|
||||
else()
|
||||
target_link_libraries(3rdparty_opengl INTERFACE dxgi.lib d2d1.lib dwrite.lib)
|
||||
target_link_libraries(3rdparty_opengl INTERFACE OpenGL::GL OpenGL::GLU OpenGL::GLX)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
target_link_libraries(3rdparty_opengl INTERFACE OpenGL::GL OpenGL::GLU)
|
||||
else()
|
||||
target_link_libraries(3rdparty_opengl INTERFACE OpenGL::GL OpenGL::GLU OpenGL::GLX)
|
||||
add_library(3rdparty_opengl INTERFACE)
|
||||
target_compile_definitions(3rdparty_opengl INTERFACE WITHOUT_OPENGL=1)
|
||||
endif()
|
||||
|
||||
|
||||
# stblib
|
||||
add_subdirectory(stblib)
|
||||
|
||||
|
@ -181,7 +189,7 @@ if(USE_VULKAN)
|
|||
target_compile_definitions(3rdparty_vulkan INTERFACE -DHAVE_VULKAN)
|
||||
target_link_libraries(3rdparty_vulkan INTERFACE Vulkan::Vulkan)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
if(UNIX AND NOT APPLE AND NOT ANDROID)
|
||||
find_package(Wayland)
|
||||
if (WAYLAND_FOUND)
|
||||
target_include_directories(3rdparty_vulkan
|
||||
|
@ -205,7 +213,12 @@ endif()
|
|||
add_subdirectory(asmjit EXCLUDE_FROM_ALL)
|
||||
|
||||
# OpenAL
|
||||
add_subdirectory(OpenAL EXCLUDE_FROM_ALL)
|
||||
if (NOT ANDROID)
|
||||
add_subdirectory(OpenAL EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
add_library(3rdparty_openal INTERFACE)
|
||||
target_compile_definitions(3rdparty_openal INTERFACE WITHOUT_OPENAL=1)
|
||||
endif()
|
||||
|
||||
# FAudio
|
||||
set(FAUDIO_TARGET 3rdparty_dummy_lib)
|
||||
|
@ -246,47 +259,48 @@ set_property(TARGET ${FAUDIO_TARGET} PROPERTY FOLDER "3rdparty/")
|
|||
|
||||
|
||||
# FFMPEG
|
||||
add_library(3rdparty_ffmpeg INTERFACE)
|
||||
if(NOT ANDROID)
|
||||
add_library(3rdparty_ffmpeg INTERFACE)
|
||||
|
||||
# Select the version of ffmpeg to use, default is builtin
|
||||
if(USE_SYSTEM_FFMPEG)
|
||||
message(STATUS "RPCS3: using shared ffmpeg")
|
||||
find_package(FFMPEG REQUIRED)
|
||||
# Select the version of ffmpeg to use, default is builtin
|
||||
if(USE_SYSTEM_FFMPEG)
|
||||
message(STATUS "RPCS3: using shared ffmpeg")
|
||||
find_package(FFMPEG REQUIRED)
|
||||
|
||||
target_include_directories(3rdparty_ffmpeg INTERFACE ${FFMPEG_INCLUDE_DIR})
|
||||
target_link_libraries(3rdparty_ffmpeg INTERFACE ${FFMPEG_LIBRARIES})
|
||||
else()
|
||||
message(STATUS "RPCS3: using builtin ffmpeg")
|
||||
add_subdirectory(ffmpeg EXCLUDE_FROM_ALL)
|
||||
# ffmpeg-core libraries are extracted to CMAKE_BINARY_DIR
|
||||
set(FFMPEG_LIB_DIR "${CMAKE_BINARY_DIR}/3rdparty/ffmpeg/lib")
|
||||
target_include_directories(3rdparty_ffmpeg INTERFACE ${FFMPEG_INCLUDE_DIR})
|
||||
target_link_libraries(3rdparty_ffmpeg INTERFACE ${FFMPEG_LIBRARIES})
|
||||
else()
|
||||
message(STATUS "RPCS3: using builtin ffmpeg")
|
||||
add_subdirectory(ffmpeg EXCLUDE_FROM_ALL)
|
||||
# ffmpeg-core libraries are extracted to CMAKE_BINARY_DIR
|
||||
set(FFMPEG_LIB_DIR "${CMAKE_BINARY_DIR}/3rdparty/ffmpeg/lib")
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(3rdparty_ffmpeg INTERFACE "Bcrypt.lib")
|
||||
if (WIN32)
|
||||
target_link_libraries(3rdparty_ffmpeg INTERFACE "Bcrypt.lib")
|
||||
endif()
|
||||
else()
|
||||
find_library(FFMPEG_LIB_AVFORMAT avformat PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
find_library(FFMPEG_LIB_AVCODEC avcodec PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
find_library(FFMPEG_LIB_AVUTIL avutil PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
find_library(FFMPEG_LIB_SWSCALE swscale PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
find_library(FFMPEG_LIB_SWRESAMPLE swresample PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
|
||||
target_link_libraries(3rdparty_ffmpeg
|
||||
INTERFACE
|
||||
${FFMPEG_LIB_AVFORMAT}
|
||||
${FFMPEG_LIB_AVCODEC}
|
||||
${FFMPEG_LIB_AVUTIL}
|
||||
${FFMPEG_LIB_SWSCALE}
|
||||
${FFMPEG_LIB_SWRESAMPLE}
|
||||
)
|
||||
endif()
|
||||
target_include_directories(3rdparty_ffmpeg INTERFACE "ffmpeg/include")
|
||||
endif()
|
||||
|
||||
find_library(FFMPEG_LIB_AVFORMAT avformat PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
find_library(FFMPEG_LIB_AVCODEC avcodec PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
find_library(FFMPEG_LIB_AVUTIL avutil PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
find_library(FFMPEG_LIB_SWSCALE swscale PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
find_library(FFMPEG_LIB_SWRESAMPLE swresample PATHS ${FFMPEG_LIB_DIR} NO_DEFAULT_PATH)
|
||||
|
||||
target_link_libraries(3rdparty_ffmpeg
|
||||
INTERFACE
|
||||
${FFMPEG_LIB_AVFORMAT}
|
||||
${FFMPEG_LIB_AVCODEC}
|
||||
${FFMPEG_LIB_AVUTIL}
|
||||
${FFMPEG_LIB_SWSCALE}
|
||||
${FFMPEG_LIB_SWRESAMPLE}
|
||||
)
|
||||
|
||||
target_include_directories(3rdparty_ffmpeg INTERFACE "ffmpeg/include")
|
||||
endif()
|
||||
|
||||
|
||||
# GLEW
|
||||
add_library(3rdparty_glew INTERFACE)
|
||||
if(NOT MSVC)
|
||||
if(NOT MSVC AND NOT ANDROID)
|
||||
find_package(GLEW REQUIRED)
|
||||
target_link_libraries(3rdparty_glew INTERFACE GLEW::GLEW)
|
||||
endif()
|
||||
|
|
6
3rdparty/libusb/os.cmake
vendored
6
3rdparty/libusb/os.cmake
vendored
|
@ -77,7 +77,7 @@ int main()
|
|||
elseif (UNIX)
|
||||
# Unix is for all *NIX systems including OSX
|
||||
add_compile_definitions(PLATFORM_POSIX=1 HAVE_CLOCK_GETTIME)
|
||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR ANDROID)
|
||||
set(OS_LINUX 1)
|
||||
|
||||
set(PLATFORM_SRC
|
||||
|
@ -87,7 +87,9 @@ elseif (UNIX)
|
|||
events_posix.c
|
||||
)
|
||||
|
||||
list(APPEND LIBUSB_LIBRARIES rt)
|
||||
if(NOT ANDROID)
|
||||
list(APPEND LIBUSB_LIBRARIES rt)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -1997,7 +1997,7 @@ static void signal_handler(int /*sig*/, siginfo_t* info, void* uct) noexcept
|
|||
|
||||
#else
|
||||
const u32 insn = is_executing ? 0 : *reinterpret_cast<u32*>(RIP(context));
|
||||
const bool is_writing =
|
||||
const bool is_writing =
|
||||
(insn & 0xbfff0000) == 0x0c000000 || // STR <Wt>, [<Xn>, #<imm>] (store word with immediate offset)
|
||||
(insn & 0xbfe00000) == 0x0c800000 || // STP <Wt1>, <Wt2>, [<Xn>, #<imm>] (store pair of registers with immediate offset)
|
||||
(insn & 0xbfdf0000) == 0x0d000000 || // STR <Wt>, [<Xn>, <Xm>] (store word with register offset)
|
||||
|
@ -2172,7 +2172,11 @@ void thread_base::start()
|
|||
void thread_base::initialize(void (*error_cb)())
|
||||
{
|
||||
#ifndef _WIN32
|
||||
#ifdef ANDROID
|
||||
m_thread.release(pthread_self());
|
||||
#else
|
||||
m_thread.release(reinterpret_cast<u64>(pthread_self()));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Initialize TLS variables
|
||||
|
@ -2617,6 +2621,8 @@ thread_base::~thread_base() noexcept
|
|||
const HANDLE handle0 = reinterpret_cast<HANDLE>(m_thread.load());
|
||||
WaitForSingleObject(handle0, INFINITE);
|
||||
CloseHandle(handle0);
|
||||
#elif defined(ANDROID)
|
||||
pthread_join(m_thread.load(), nullptr);
|
||||
#else
|
||||
pthread_join(reinterpret_cast<pthread_t>(m_thread.load()), nullptr);
|
||||
#endif
|
||||
|
@ -2691,7 +2697,13 @@ u64 thread_base::get_cycles()
|
|||
#else
|
||||
clockid_t _clock;
|
||||
struct timespec thread_time;
|
||||
if (!pthread_getcpuclockid(reinterpret_cast<pthread_t>(handle), &_clock) && !clock_gettime(_clock, &thread_time))
|
||||
pthread_t thread_id;
|
||||
#ifdef ANDROID
|
||||
thread_id = handle;
|
||||
#else
|
||||
thread_id = reinterpret_cast<pthread_t>(handle);
|
||||
#endif
|
||||
if (!pthread_getcpuclockid(thread_id, &_clock) && !clock_gettime(_clock, &thread_time))
|
||||
{
|
||||
cycles = static_cast<u64>(thread_time.tv_sec) * 1'000'000'000 + thread_time.tv_nsec;
|
||||
#endif
|
||||
|
@ -3194,7 +3206,7 @@ void thread_ctrl::set_thread_affinity_mask(u64 mask)
|
|||
thread_affinity_policy_data_t policy = { static_cast<integer_t>(std::countr_zero(mask)) };
|
||||
thread_port_t mach_thread = pthread_mach_thread_np(pthread_self());
|
||||
thread_policy_set(mach_thread, THREAD_AFFINITY_POLICY, reinterpret_cast<thread_policy_t>(&policy), !mask ? 0 : 1);
|
||||
#elif defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__)
|
||||
#elif !defined(ANDROID) && (defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__))
|
||||
if (!mask)
|
||||
{
|
||||
// Reset affinity mask
|
||||
|
@ -3246,7 +3258,7 @@ u64 thread_ctrl::get_thread_affinity_mask()
|
|||
|
||||
sig_log.error("Failed to get thread affinity mask.");
|
||||
return 0;
|
||||
#elif defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__)
|
||||
#elif !defined(ANDROID) && (defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__))
|
||||
cpu_set_t cs;
|
||||
CPU_ZERO(&cs);
|
||||
|
||||
|
@ -3313,6 +3325,8 @@ u64 thread_ctrl::get_tid()
|
|||
{
|
||||
#ifdef _WIN32
|
||||
return GetCurrentThreadId();
|
||||
#elif defined(ANDROID)
|
||||
return static_cast<u64>(pthread_self());
|
||||
#elif defined(__linux__)
|
||||
return syscall(SYS_gettid);
|
||||
#else
|
||||
|
|
|
@ -126,15 +126,17 @@ namespace utils
|
|||
std::vector<void*> get_backtrace(int max_depth)
|
||||
{
|
||||
std::vector<void*> result(max_depth);
|
||||
#ifndef ANDROID
|
||||
int depth = backtrace(result.data(), max_depth);
|
||||
|
||||
result.resize(depth);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<std::string> get_backtrace_symbols(const std::vector<void*>& stack)
|
||||
{
|
||||
std::vector<std::string> result;
|
||||
#ifndef ANDROID
|
||||
result.reserve(stack.size());
|
||||
|
||||
const auto symbols = backtrace_symbols(stack.data(), static_cast<int>(stack.size()));
|
||||
|
@ -144,6 +146,7 @@ namespace utils
|
|||
}
|
||||
|
||||
free(symbols);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -20,7 +20,7 @@ elseif(NOT WIN32 AND NOT CMAKE_CXX_FLAGS MATCHES "LIBICONV_PLUG")
|
|||
set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "iconv")
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
if(UNIX AND NOT APPLE AND NOT ANDROID)
|
||||
add_definitions(-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}/rpcs3")
|
||||
# Optionally enable X11 for window management
|
||||
find_package(X11)
|
||||
|
@ -33,162 +33,171 @@ if(UNIX AND NOT APPLE)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
# Qt
|
||||
# finds Qt libraries and setups custom commands for MOC and UIC
|
||||
# Must be done here because generated MOC and UIC targets cant
|
||||
# be found otherwise
|
||||
include(${CMAKE_SOURCE_DIR}/3rdparty/qt6.cmake)
|
||||
if (NOT ANDROID)
|
||||
# Qt
|
||||
# finds Qt libraries and setups custom commands for MOC and UIC
|
||||
# Must be done here because generated MOC and UIC targets cant
|
||||
# be found otherwise
|
||||
include(${CMAKE_SOURCE_DIR}/3rdparty/qt6.cmake)
|
||||
endif()
|
||||
|
||||
# subdirectories
|
||||
add_subdirectory(Emu)
|
||||
add_subdirectory(rpcs3qt)
|
||||
|
||||
if(WIN32)
|
||||
add_executable(rpcs3 WIN32)
|
||||
target_sources(rpcs3 PRIVATE rpcs3.rc)
|
||||
target_compile_definitions(rpcs3 PRIVATE UNICODE _UNICODE)
|
||||
elseif(APPLE)
|
||||
add_executable(rpcs3 MACOSX_BUNDLE)
|
||||
target_sources(rpcs3 PRIVATE rpcs3.icns update_helper.sh)
|
||||
set_source_files_properties(update_helper.sh PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||
set_target_properties(rpcs3
|
||||
PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/rpcs3.plist.in")
|
||||
else()
|
||||
add_executable(rpcs3)
|
||||
if (NOT ANDROID)
|
||||
add_subdirectory(rpcs3qt)
|
||||
endif()
|
||||
|
||||
target_sources(rpcs3
|
||||
PRIVATE
|
||||
display_sleep_control.cpp
|
||||
headless_application.cpp
|
||||
main.cpp
|
||||
main_application.cpp
|
||||
module_verifier.cpp
|
||||
rpcs3_version.cpp
|
||||
stb_image.cpp
|
||||
stdafx.cpp
|
||||
|
||||
Input/basic_keyboard_handler.cpp
|
||||
Input/basic_mouse_handler.cpp
|
||||
Input/ds3_pad_handler.cpp
|
||||
Input/ds4_pad_handler.cpp
|
||||
Input/dualsense_pad_handler.cpp
|
||||
Input/evdev_joystick_handler.cpp
|
||||
Input/evdev_gun_handler.cpp
|
||||
Input/gui_pad_thread.cpp
|
||||
Input/hid_pad_handler.cpp
|
||||
Input/keyboard_pad_handler.cpp
|
||||
Input/mm_joystick_handler.cpp
|
||||
Input/pad_thread.cpp
|
||||
Input/product_info.cpp
|
||||
Input/ps_move_calibration.cpp
|
||||
Input/ps_move_config.cpp
|
||||
Input/ps_move_handler.cpp
|
||||
Input/ps_move_tracker.cpp
|
||||
Input/raw_mouse_config.cpp
|
||||
Input/raw_mouse_handler.cpp
|
||||
Input/sdl_pad_handler.cpp
|
||||
Input/skateboard_pad_handler.cpp
|
||||
Input/xinput_pad_handler.cpp
|
||||
)
|
||||
|
||||
gen_git_version(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set_target_properties(rpcs3
|
||||
PROPERTIES
|
||||
AUTOMOC ON
|
||||
AUTOUIC ON)
|
||||
|
||||
target_link_libraries(rpcs3
|
||||
PRIVATE
|
||||
rpcs3_emu
|
||||
rpcs3_ui
|
||||
3rdparty::discordRPC
|
||||
3rdparty::qt6
|
||||
3rdparty::hidapi
|
||||
3rdparty::libusb
|
||||
3rdparty::wolfssl
|
||||
3rdparty::libcurl
|
||||
3rdparty::zlib
|
||||
3rdparty::opencv
|
||||
3rdparty::fusion
|
||||
${ADDITIONAL_LIBS})
|
||||
|
||||
# Unix display manager
|
||||
if(X11_FOUND)
|
||||
target_link_libraries(rpcs3 PRIVATE X11::X11)
|
||||
elseif(USE_VULKAN AND UNIX AND NOT WAYLAND_FOUND AND NOT APPLE)
|
||||
# Wayland has been checked in 3rdparty/CMakeLists.txt already.
|
||||
message(FATAL_ERROR "RPCS3 requires either X11 or Wayland (or both) for Vulkan.")
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(rpcs3 PRIVATE Threads::Threads)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(rpcs3 PRIVATE bcrypt ws2_32 Iphlpapi Winmm Psapi gdi32 setupapi pdh)
|
||||
else()
|
||||
target_link_libraries(rpcs3 PRIVATE ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
if(USE_PRECOMPILED_HEADERS)
|
||||
target_precompile_headers(rpcs3 PRIVATE stdafx.h)
|
||||
endif()
|
||||
|
||||
# Copy icons to executable directory
|
||||
if(APPLE)
|
||||
if (CMAKE_BUILD_TYPE MATCHES "Debug" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
|
||||
set(QT_DEPLOY_FLAGS "-no-strip")
|
||||
if (NOT ANDROID)
|
||||
if(WIN32)
|
||||
add_executable(rpcs3 WIN32)
|
||||
target_sources(rpcs3 PRIVATE rpcs3.rc)
|
||||
target_compile_definitions(rpcs3 PRIVATE UNICODE _UNICODE)
|
||||
elseif(APPLE)
|
||||
add_executable(rpcs3 MACOSX_BUNDLE)
|
||||
target_sources(rpcs3 PRIVATE rpcs3.icns update_helper.sh)
|
||||
set_source_files_properties(update_helper.sh PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||
set_target_properties(rpcs3
|
||||
PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/rpcs3.plist.in")
|
||||
else()
|
||||
set(QT_DEPLOY_FLAGS "")
|
||||
add_executable(rpcs3)
|
||||
endif()
|
||||
qt_finalize_target(rpcs3)
|
||||
add_custom_command(TARGET rpcs3 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/rpcs3.icns $<TARGET_FILE_DIR:rpcs3>/../Resources/rpcs3.icns
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/../Resources/Icons
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/../Resources/GuiConfigs
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/git $<TARGET_FILE_DIR:rpcs3>/../Resources/git
|
||||
COMMAND "${MACDEPLOYQT_EXECUTABLE}" "${PROJECT_BINARY_DIR}/bin/rpcs3.app" "${QT_DEPLOY_FLAGS}")
|
||||
elseif(UNIX)
|
||||
add_custom_command(TARGET rpcs3 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/Icons
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/GuiConfigs
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/git $<TARGET_FILE_DIR:rpcs3>/git)
|
||||
elseif(WIN32)
|
||||
add_custom_command(TARGET rpcs3 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:OpenAL::OpenAL> $<TARGET_FILE_DIR:rpcs3>
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/Icons
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/GuiConfigs
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/git $<TARGET_FILE_DIR:rpcs3>/git
|
||||
COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-compiler-runtime --no-opengl-sw --no-patchqt
|
||||
--no-translations --no-system-d3d-compiler --no-quick-import
|
||||
--plugindir "$<IF:$<CXX_COMPILER_ID:MSVC>,$<TARGET_FILE_DIR:rpcs3>/plugins,$<TARGET_FILE_DIR:rpcs3>/share/qt6/plugins>"
|
||||
--verbose 0 "$<TARGET_FILE:rpcs3>")
|
||||
endif()
|
||||
|
||||
# Unix installation
|
||||
if(UNIX AND NOT APPLE)
|
||||
# Install the binary
|
||||
install(TARGETS rpcs3 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
# Install the application icon and menu item
|
||||
install(FILES rpcs3.svg
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps)
|
||||
install(FILES rpcs3.png
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps)
|
||||
install(FILES rpcs3.desktop
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
||||
install(FILES rpcs3.metainfo.xml
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
|
||||
# Install other files
|
||||
install(DIRECTORY ../bin/Icons
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
|
||||
install(DIRECTORY ../bin/GuiConfigs
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
|
||||
install(DIRECTORY ../bin/git
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
|
||||
install(DIRECTORY ../bin/test
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
|
||||
target_sources(rpcs3
|
||||
PRIVATE
|
||||
display_sleep_control.cpp
|
||||
headless_application.cpp
|
||||
main.cpp
|
||||
main_application.cpp
|
||||
module_verifier.cpp
|
||||
rpcs3_version.cpp
|
||||
stb_image.cpp
|
||||
stdafx.cpp
|
||||
|
||||
Input/basic_keyboard_handler.cpp
|
||||
Input/basic_mouse_handler.cpp
|
||||
Input/ds3_pad_handler.cpp
|
||||
Input/ds4_pad_handler.cpp
|
||||
Input/dualsense_pad_handler.cpp
|
||||
Input/evdev_joystick_handler.cpp
|
||||
Input/evdev_gun_handler.cpp
|
||||
Input/gui_pad_thread.cpp
|
||||
Input/hid_pad_handler.cpp
|
||||
Input/keyboard_pad_handler.cpp
|
||||
Input/mm_joystick_handler.cpp
|
||||
Input/pad_thread.cpp
|
||||
Input/product_info.cpp
|
||||
Input/ps_move_calibration.cpp
|
||||
Input/ps_move_config.cpp
|
||||
Input/ps_move_handler.cpp
|
||||
Input/ps_move_tracker.cpp
|
||||
Input/raw_mouse_config.cpp
|
||||
Input/raw_mouse_handler.cpp
|
||||
Input/sdl_pad_handler.cpp
|
||||
Input/skateboard_pad_handler.cpp
|
||||
Input/xinput_pad_handler.cpp
|
||||
)
|
||||
|
||||
set_target_properties(rpcs3
|
||||
PROPERTIES
|
||||
AUTOMOC ON
|
||||
AUTOUIC ON)
|
||||
|
||||
target_link_libraries(rpcs3
|
||||
PRIVATE
|
||||
rpcs3_emu
|
||||
rpcs3_ui
|
||||
3rdparty::discordRPC
|
||||
3rdparty::qt6
|
||||
3rdparty::hidapi
|
||||
3rdparty::libusb
|
||||
3rdparty::wolfssl
|
||||
3rdparty::libcurl
|
||||
3rdparty::zlib
|
||||
3rdparty::opencv
|
||||
3rdparty::fusion
|
||||
${ADDITIONAL_LIBS})
|
||||
|
||||
# Unix display manager
|
||||
if(X11_FOUND)
|
||||
target_link_libraries(rpcs3 PRIVATE X11::X11)
|
||||
elseif(USE_VULKAN AND UNIX AND NOT WAYLAND_FOUND AND NOT APPLE AND NOT ANDROID)
|
||||
# Wayland has been checked in 3rdparty/CMakeLists.txt already.
|
||||
message(FATAL_ERROR "RPCS3 requires either X11 or Wayland (or both) for Vulkan.")
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(rpcs3 PRIVATE Threads::Threads)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(rpcs3 PRIVATE bcrypt ws2_32 Iphlpapi Winmm Psapi gdi32 setupapi pdh)
|
||||
else()
|
||||
target_link_libraries(rpcs3 PRIVATE ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
if(USE_PRECOMPILED_HEADERS)
|
||||
target_precompile_headers(rpcs3 PRIVATE stdafx.h)
|
||||
endif()
|
||||
|
||||
|
||||
# Copy icons to executable directory
|
||||
if(APPLE)
|
||||
if (CMAKE_BUILD_TYPE MATCHES "Debug" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
|
||||
set(QT_DEPLOY_FLAGS "-no-strip")
|
||||
else()
|
||||
set(QT_DEPLOY_FLAGS "")
|
||||
endif()
|
||||
qt_finalize_target(rpcs3)
|
||||
add_custom_command(TARGET rpcs3 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/rpcs3.icns $<TARGET_FILE_DIR:rpcs3>/../Resources/rpcs3.icns
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/../Resources/Icons
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/../Resources/GuiConfigs
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/git $<TARGET_FILE_DIR:rpcs3>/../Resources/git
|
||||
COMMAND "${MACDEPLOYQT_EXECUTABLE}" "${PROJECT_BINARY_DIR}/bin/rpcs3.app" "${QT_DEPLOY_FLAGS}")
|
||||
elseif(UNIX)
|
||||
add_custom_command(TARGET rpcs3 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/Icons
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/GuiConfigs
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/git $<TARGET_FILE_DIR:rpcs3>/git)
|
||||
elseif(WIN32)
|
||||
add_custom_command(TARGET rpcs3 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:OpenAL::OpenAL> $<TARGET_FILE_DIR:rpcs3>
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/Icons
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/GuiConfigs
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/git $<TARGET_FILE_DIR:rpcs3>/git
|
||||
COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-compiler-runtime --no-opengl-sw --no-patchqt
|
||||
--no-translations --no-system-d3d-compiler --no-quick-import
|
||||
--plugindir "$<IF:$<CXX_COMPILER_ID:MSVC>,$<TARGET_FILE_DIR:rpcs3>/plugins,$<TARGET_FILE_DIR:rpcs3>/share/qt6/plugins>"
|
||||
--verbose 0 "$<TARGET_FILE:rpcs3>")
|
||||
endif()
|
||||
|
||||
# Unix installation
|
||||
if(UNIX AND NOT APPLE)
|
||||
# Install the binary
|
||||
install(TARGETS rpcs3 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
# Install the application icon and menu item
|
||||
install(FILES rpcs3.svg
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps)
|
||||
install(FILES rpcs3.png
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps)
|
||||
install(FILES rpcs3.desktop
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
||||
install(FILES rpcs3.metainfo.xml
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
|
||||
# Install other files
|
||||
install(DIRECTORY ../bin/Icons
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
|
||||
install(DIRECTORY ../bin/GuiConfigs
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
|
||||
install(DIRECTORY ../bin/git
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
|
||||
install(DIRECTORY ../bin/test
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -46,7 +46,14 @@ target_link_libraries(rpcs3_emu
|
|||
# For stdafx.h
|
||||
target_include_directories(rpcs3_emu
|
||||
PUBLIC
|
||||
${PROJECT_SOURCE_DIR}/rpcs3)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
)
|
||||
|
||||
target_include_directories(rpcs3_emu
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty
|
||||
)
|
||||
|
||||
# Utilities
|
||||
target_sources(rpcs3_emu PRIVATE
|
||||
|
@ -494,34 +501,6 @@ target_sources(rpcs3_emu PRIVATE
|
|||
RSX/Core/RSXDrawCommands.cpp
|
||||
RSX/gcm_enums.cpp
|
||||
RSX/gcm_printing.cpp
|
||||
RSX/GL/GLCommonDecompiler.cpp
|
||||
RSX/GL/GLCompute.cpp
|
||||
RSX/GL/GLDMA.cpp
|
||||
RSX/GL/GLDraw.cpp
|
||||
RSX/GL/GLFragmentProgram.cpp
|
||||
RSX/GL/GLGSRender.cpp
|
||||
RSX/GL/GLHelpers.cpp
|
||||
RSX/GL/GLOverlays.cpp
|
||||
RSX/GL/GLPipelineCompiler.cpp
|
||||
RSX/GL/GLPresent.cpp
|
||||
RSX/GL/GLRenderTargets.cpp
|
||||
RSX/GL/GLResolveHelper.cpp
|
||||
RSX/GL/GLShaderInterpreter.cpp
|
||||
RSX/GL/GLTexture.cpp
|
||||
RSX/GL/GLTextureCache.cpp
|
||||
RSX/GL/glutils/blitter.cpp
|
||||
RSX/GL/glutils/buffer_object.cpp
|
||||
RSX/GL/glutils/capabilities.cpp
|
||||
RSX/GL/glutils/common.cpp
|
||||
RSX/GL/glutils/fbo.cpp
|
||||
RSX/GL/glutils/image.cpp
|
||||
RSX/GL/glutils/program.cpp
|
||||
RSX/GL/glutils/ring_buffer.cpp
|
||||
RSX/GL/glutils/sampler.cpp
|
||||
RSX/GL/GLVertexBuffers.cpp
|
||||
RSX/GL/GLVertexProgram.cpp
|
||||
RSX/GL/OpenGL.cpp
|
||||
RSX/GL/upscalers/fsr1/fsr_pass.cpp
|
||||
RSX/GSRender.cpp
|
||||
RSX/Host/MM.cpp
|
||||
RSX/Host/RSXDMAWriter.cpp
|
||||
|
@ -590,6 +569,39 @@ target_sources(rpcs3_emu PRIVATE
|
|||
RSX/rsx_vertex_data.cpp
|
||||
)
|
||||
|
||||
if(NOT ANDROID)
|
||||
target_sources(rpcs3_emu PRIVATE
|
||||
RSX/GL/GLCommonDecompiler.cpp
|
||||
RSX/GL/GLCompute.cpp
|
||||
RSX/GL/GLDMA.cpp
|
||||
RSX/GL/GLDraw.cpp
|
||||
RSX/GL/GLFragmentProgram.cpp
|
||||
RSX/GL/GLGSRender.cpp
|
||||
RSX/GL/GLHelpers.cpp
|
||||
RSX/GL/GLOverlays.cpp
|
||||
RSX/GL/GLPipelineCompiler.cpp
|
||||
RSX/GL/GLPresent.cpp
|
||||
RSX/GL/GLRenderTargets.cpp
|
||||
RSX/GL/GLResolveHelper.cpp
|
||||
RSX/GL/GLShaderInterpreter.cpp
|
||||
RSX/GL/GLTexture.cpp
|
||||
RSX/GL/GLTextureCache.cpp
|
||||
RSX/GL/glutils/blitter.cpp
|
||||
RSX/GL/glutils/buffer_object.cpp
|
||||
RSX/GL/glutils/capabilities.cpp
|
||||
RSX/GL/glutils/common.cpp
|
||||
RSX/GL/glutils/fbo.cpp
|
||||
RSX/GL/glutils/image.cpp
|
||||
RSX/GL/glutils/program.cpp
|
||||
RSX/GL/glutils/ring_buffer.cpp
|
||||
RSX/GL/glutils/sampler.cpp
|
||||
RSX/GL/GLVertexBuffers.cpp
|
||||
RSX/GL/GLVertexProgram.cpp
|
||||
RSX/GL/OpenGL.cpp
|
||||
RSX/GL/upscalers/fsr1/fsr_pass.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(TARGET 3rdparty_vulkan)
|
||||
target_sources(rpcs3_emu PRIVATE
|
||||
RSX/VK/upscalers/fsr1/fsr_pass.cpp
|
||||
|
@ -658,7 +670,7 @@ endif()
|
|||
|
||||
|
||||
if(USE_PRECOMPILED_HEADERS)
|
||||
target_precompile_headers(rpcs3_emu PRIVATE "${PROJECT_SOURCE_DIR}/rpcs3/stdafx.h")
|
||||
target_precompile_headers(rpcs3_emu PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../stdafx.h")
|
||||
endif()
|
||||
|
||||
if(WAYLAND_FOUND)
|
||||
|
|
|
@ -133,12 +133,12 @@ sys_net_sockaddr native_addr_to_sys_net_addr(const ::sockaddr_storage& native_ad
|
|||
sys_net_sockaddr sn_addr;
|
||||
|
||||
sys_net_sockaddr_in* paddr = reinterpret_cast<sys_net_sockaddr_in*>(&sn_addr);
|
||||
*paddr = {};
|
||||
|
||||
paddr->sin_len = sizeof(sys_net_sockaddr_in);
|
||||
paddr->sin_family = SYS_NET_AF_INET;
|
||||
paddr->sin_port = std::bit_cast<be_t<u16>, u16>(reinterpret_cast<const sockaddr_in*>(&native_addr)->sin_port);
|
||||
paddr->sin_addr = std::bit_cast<be_t<u32>, u32>(reinterpret_cast<const sockaddr_in*>(&native_addr)->sin_addr.s_addr);
|
||||
paddr->sin_zero = 0;
|
||||
|
||||
return sn_addr;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "Utilities/Thread.h"
|
||||
#include "util/logs.hpp"
|
||||
#include "Emu/Memory/vm.h"
|
||||
#include "../pine/pine_server.h"
|
||||
#include "pine/pine_server.h"
|
||||
|
||||
LOG_CHANNEL(IPC);
|
||||
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
#pragma once
|
||||
|
||||
#include "util/endian.hpp"
|
||||
#include "Emu/RSX/GL/GLVertexProgram.h"
|
||||
#include "Emu/RSX/GL/GLFragmentProgram.h"
|
||||
#include "Emu/RSX/Program/RSXVertexProgram.h"
|
||||
#include "Emu/RSX/Program/RSXFragmentProgram.h"
|
||||
#include "Emu/RSX/Program/ProgramStateCache.h"
|
||||
#include "Emu/RSX/Program/ShaderParam.h"
|
||||
#include "Utilities/File.h"
|
||||
|
||||
#ifndef WITHOUT_OPENGL
|
||||
#include "Emu/RSX/GL/GLVertexProgram.h"
|
||||
#include "Emu/RSX/GL/GLFragmentProgram.h"
|
||||
#endif
|
||||
|
||||
using CGprofile = u32;
|
||||
using CGbool = s32;
|
||||
using CGresource = u32;
|
||||
|
@ -368,7 +374,9 @@ public:
|
|||
prog.total_length = metadata.program_ucode_length + metadata.program_start_offset;
|
||||
prog.data = reinterpret_cast<u8*>(be_data.data()) + metadata.program_start_offset;
|
||||
for (u32 i = 0; i < 16; ++i) prog.texture_state.set_dimension(rsx::texture_dimension_extended::texture_dimension_2d, i);
|
||||
#ifndef WITHOUT_OPENGL
|
||||
GLFragmentDecompilerThread(m_glsl_shader, param_array, prog, unused).Task();
|
||||
#endif
|
||||
}
|
||||
|
||||
else
|
||||
|
@ -411,7 +419,9 @@ public:
|
|||
RSXVertexProgram prog;
|
||||
program_hash_util::vertex_program_utils::analyse_vertex_program(vdata, 0, prog);
|
||||
for (u32 i = 0; i < 4; ++i) prog.texture_state.set_dimension(rsx::texture_dimension_extended::texture_dimension_2d, i);
|
||||
#ifndef WITHOUT_OPENGL
|
||||
GLVertexDecompilerThread(prog, m_glsl_shader, param_array).Task();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ using display_handle_t = std::variant<
|
|||
std::pair<Display*, Window>
|
||||
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
|
||||
std::pair<wl_display*, wl_surface*>
|
||||
#elif defined(ANDROID)
|
||||
void *
|
||||
#endif
|
||||
>;
|
||||
#endif
|
||||
|
|
|
@ -170,6 +170,8 @@ namespace
|
|||
{
|
||||
#ifdef _WIN32
|
||||
tid = GetCurrentThreadId();
|
||||
#elif defined(ANDROID)
|
||||
tid = pthread_self();
|
||||
#else
|
||||
tid = reinterpret_cast<u64>(pthread_self());
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue