mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-27 05:17:10 -06:00
Merge branch 'main' into audio3
This commit is contained in:
commit
44df27bf70
5
.gitmodules
vendored
5
.gitmodules
vendored
@ -125,7 +125,10 @@
|
||||
[submodule "externals/sdl3"]
|
||||
path = externals/sdl3
|
||||
url = https://github.com/shadexternals/sdl3.git
|
||||
|
||||
branch = main
|
||||
[submodule "externals/cpp-httplib"]
|
||||
path = externals/cpp-httplib
|
||||
url = https://github.com/shadexternals/cpp-httplib.git
|
||||
[submodule "externals/openal-soft"]
|
||||
path = externals/openal-soft
|
||||
url = https://github.com/shadexternals/openal-soft.git
|
||||
|
||||
@ -1120,7 +1120,7 @@ create_target_directory_groups(shadps4)
|
||||
|
||||
target_link_libraries(shadps4 PRIVATE magic_enum::magic_enum fmt::fmt toml11::toml11 tsl::robin_map xbyak::xbyak Tracy::TracyClient RenderDoc::API FFmpeg::ffmpeg Dear_ImGui gcn half::half ZLIB::ZLIB PNG::PNG)
|
||||
target_link_libraries(shadps4 PRIVATE Boost::headers GPUOpen::VulkanMemoryAllocator LibAtrac9 sirit Vulkan::Headers xxHash::xxhash Zydis::Zydis glslang::glslang SDL3::SDL3 SDL3_mixer::SDL3_mixer pugixml::pugixml)
|
||||
target_link_libraries(shadps4 PRIVATE stb::headers libusb::usb lfreist-hwinfo::hwinfo nlohmann_json::nlohmann_json miniz fdk-aac CLI11::CLI11 OpenAL::OpenAL)
|
||||
target_link_libraries(shadps4 PRIVATE stb::headers libusb::usb lfreist-hwinfo::hwinfo nlohmann_json::nlohmann_json miniz fdk-aac CLI11::CLI11 OpenAL::OpenAL Cpp_Httplib)
|
||||
|
||||
target_compile_definitions(shadps4 PRIVATE IMGUI_USER_CONFIG="imgui/imgui_config.h")
|
||||
target_compile_definitions(Dear_ImGui PRIVATE IMGUI_USER_CONFIG="${PROJECT_SOURCE_DIR}/src/imgui/imgui_config.h")
|
||||
|
||||
2
externals/CLI11
vendored
2
externals/CLI11
vendored
@ -1 +1 @@
|
||||
Subproject commit bf5a16a26a34a9a7ad75f4a7705585e44675fef0
|
||||
Subproject commit 617af272277f8c5aefdc20894b0ebef1cd6b0104
|
||||
5
externals/CMakeLists.txt
vendored
5
externals/CMakeLists.txt
vendored
@ -308,3 +308,8 @@ set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
||||
|
||||
add_subdirectory(openal-soft EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# cpp-httplib
|
||||
add_library(Cpp_Httplib INTERFACE)
|
||||
target_include_directories(Cpp_Httplib INTERFACE cpp-httplib/)
|
||||
|
||||
|
||||
1
externals/cpp-httplib
vendored
Submodule
1
externals/cpp-httplib
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit f80864ca031932351abef49b74097c67f14719c6
|
||||
2
externals/sdl3
vendored
2
externals/sdl3
vendored
@ -1 +1 @@
|
||||
Subproject commit bdb72bb3f051de32c91f5deb439a50bfd51499dc
|
||||
Subproject commit 4e2fd57e77fb4a28c0eeef0670fc4121cc2cf1f9
|
||||
@ -65,7 +65,7 @@ s32 createLibraryContext(s32 libHttpCtxId, u64 poolSize, const char* name, s32 t
|
||||
|
||||
OrbisNpWebApiContext* findAndValidateContext(s32 libCtxId, s32 flag) {
|
||||
std::scoped_lock lk{g_global_mutex};
|
||||
if (libCtxId < 1 || libCtxId >= 0x8000) {
|
||||
if (libCtxId < 1 || libCtxId >= 0x8000 || !g_contexts.contains(libCtxId)) {
|
||||
return nullptr;
|
||||
}
|
||||
auto& context = g_contexts[libCtxId];
|
||||
|
||||
@ -269,9 +269,14 @@ namespace Frontend {
|
||||
|
||||
using namespace Libraries::Pad;
|
||||
|
||||
static Uint32 SDLCALL PollController(void* userdata, SDL_TimerID timer_id, Uint32 interval) {
|
||||
std::mutex motion_control_mutex;
|
||||
float gyro_buf[3] = {0.0f, 0.0f, 0.0f}, accel_buf[3] = {0.0f, -9.81f, 0.0f};
|
||||
static Uint32 SDLCALL PollGyroAndAccel(void* userdata, SDL_TimerID timer_id, Uint32 interval) {
|
||||
auto* controller = reinterpret_cast<Input::GameController*>(userdata);
|
||||
return controller->Poll();
|
||||
std::scoped_lock l{motion_control_mutex};
|
||||
controller->Gyro(0, gyro_buf);
|
||||
controller->Acceleration(0, accel_buf);
|
||||
return 4;
|
||||
}
|
||||
|
||||
WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_,
|
||||
@ -407,12 +412,16 @@ void WindowSDL::WaitEvent() {
|
||||
// AND IT DOESN'T EVEN USE PROPER ENUMS
|
||||
case SDL_EVENT_GAMEPAD_SENSOR_UPDATE:
|
||||
switch ((SDL_SensorType)event.gsensor.sensor) {
|
||||
case SDL_SENSOR_GYRO:
|
||||
controller->Gyro(0, event.gsensor.data);
|
||||
case SDL_SENSOR_GYRO: {
|
||||
std::scoped_lock l{motion_control_mutex};
|
||||
memcpy(gyro_buf, event.gsensor.data, sizeof(gyro_buf));
|
||||
break;
|
||||
case SDL_SENSOR_ACCEL:
|
||||
controller->Acceleration(0, event.gsensor.data);
|
||||
}
|
||||
case SDL_SENSOR_ACCEL: {
|
||||
std::scoped_lock l{motion_control_mutex};
|
||||
memcpy(accel_buf, event.gsensor.data, sizeof(accel_buf));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -471,7 +480,7 @@ void WindowSDL::WaitEvent() {
|
||||
}
|
||||
|
||||
void WindowSDL::InitTimers() {
|
||||
SDL_AddTimer(33, &PollController, controller);
|
||||
SDL_AddTimer(4, &PollGyroAndAccel, controller);
|
||||
SDL_AddTimer(33, Input::MousePolling, (void*)controller);
|
||||
}
|
||||
|
||||
|
||||
@ -583,6 +583,14 @@ void Translator::S_MULK_I32(const GcnInst& inst) {
|
||||
// SOP1
|
||||
|
||||
void Translator::S_MOV(const GcnInst& inst) {
|
||||
if (inst.dst[0].field == OperandField::ScalarGPR) {
|
||||
if (inst.src[0].field == OperandField::ExecLo) {
|
||||
ir.SetThreadBitScalarReg(IR::ScalarReg(inst.dst[0].code), ir.GetExec());
|
||||
return;
|
||||
} else if (inst.src[0].field == OperandField::ExecHi) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
SetDst(inst.dst[0], GetSrc(inst.src[0]));
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user