mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-09 01:29:23 +00:00
Merge branch 'master' into master
This commit is contained in:
commit
486b5c2abb
3 changed files with 54 additions and 31 deletions
|
@ -321,13 +321,28 @@ public:
|
||||||
|
|
||||||
void update_connections()
|
void update_connections()
|
||||||
{
|
{
|
||||||
|
connected_controllers = 0;
|
||||||
|
|
||||||
|
const auto update_connection = [this](u32 i, bool connected)
|
||||||
|
{
|
||||||
|
if (connected)
|
||||||
|
{
|
||||||
|
connected_controllers++;
|
||||||
|
controllers[i].status = CELL_GEM_STATUS_READY;
|
||||||
|
controllers[i].port = port_num(i);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
controllers[i].status = CELL_GEM_STATUS_DISCONNECTED;
|
||||||
|
controllers[i].port = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
switch (g_cfg.io.move)
|
switch (g_cfg.io.move)
|
||||||
{
|
{
|
||||||
case move_handler::real:
|
case move_handler::real:
|
||||||
case move_handler::fake:
|
case move_handler::fake:
|
||||||
{
|
{
|
||||||
connected_controllers = 0;
|
|
||||||
|
|
||||||
std::lock_guard lock(pad::g_pad_mutex);
|
std::lock_guard lock(pad::g_pad_mutex);
|
||||||
const auto handler = pad::get_pad_thread(true);
|
const auto handler = pad::get_pad_thread(true);
|
||||||
if (!handler) break;
|
if (!handler) break;
|
||||||
|
@ -335,51 +350,41 @@ public:
|
||||||
for (u32 i = 0; i < CELL_GEM_MAX_NUM; i++)
|
for (u32 i = 0; i < CELL_GEM_MAX_NUM; i++)
|
||||||
{
|
{
|
||||||
const auto& pad = ::at32(handler->GetPads(), pad_num(i));
|
const auto& pad = ::at32(handler->GetPads(), pad_num(i));
|
||||||
const bool connected = (pad && (pad->m_port_status & CELL_PAD_STATUS_CONNECTED) && i < attribute.max_connect);
|
const bool connected = pad && (pad->m_port_status & CELL_PAD_STATUS_CONNECTED) && i < attribute.max_connect;
|
||||||
const bool is_real_move = g_cfg.io.move != move_handler::real || pad->m_pad_handler == pad_handler::move;
|
const bool is_real_move = g_cfg.io.move != move_handler::real || pad->m_pad_handler == pad_handler::move;
|
||||||
|
|
||||||
if (connected && is_real_move)
|
update_connection(i, connected && is_real_move);
|
||||||
{
|
|
||||||
connected_controllers++;
|
|
||||||
controllers[i].status = CELL_GEM_STATUS_READY;
|
|
||||||
controllers[i].port = port_num(i);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
controllers[i].status = CELL_GEM_STATUS_DISCONNECTED;
|
|
||||||
controllers[i].port = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case move_handler::mouse:
|
||||||
case move_handler::raw_mouse:
|
case move_handler::raw_mouse:
|
||||||
{
|
{
|
||||||
connected_controllers = 0;
|
|
||||||
|
|
||||||
auto& handler = g_fxo->get<MouseHandlerBase>();
|
auto& handler = g_fxo->get<MouseHandlerBase>();
|
||||||
std::lock_guard mouse_lock(handler.mutex);
|
std::lock_guard mouse_lock(handler.mutex);
|
||||||
|
|
||||||
const MouseInfo& info = handler.GetInfo();
|
const MouseInfo& info = handler.GetInfo();
|
||||||
|
|
||||||
for (u32 i = 0; i < CELL_GEM_MAX_NUM; i++)
|
for (u32 i = 0; i < CELL_GEM_MAX_NUM; i++)
|
||||||
{
|
{
|
||||||
const bool connected = i < attribute.max_connect && info.status[i] == CELL_MOUSE_STATUS_CONNECTED;
|
update_connection(i, i < attribute.max_connect && info.status[i] == CELL_MOUSE_STATUS_CONNECTED);
|
||||||
|
|
||||||
if (connected)
|
|
||||||
{
|
|
||||||
connected_controllers++;
|
|
||||||
controllers[i].status = CELL_GEM_STATUS_READY;
|
|
||||||
controllers[i].port = port_num(i);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
controllers[i].status = CELL_GEM_STATUS_DISCONNECTED;
|
|
||||||
controllers[i].port = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
#ifdef HAVE_LIBEVDEV
|
||||||
|
case move_handler::gun:
|
||||||
|
{
|
||||||
|
gun_thread& gun = g_fxo->get<gun_thread>();
|
||||||
|
std::scoped_lock lock(gun.handler.mutex);
|
||||||
|
gun.num_devices = gun.handler.init() ? gun.handler.get_num_guns() : 0;
|
||||||
|
|
||||||
|
for (u32 i = 0; i < CELL_GEM_MAX_NUM; i++)
|
||||||
|
{
|
||||||
|
update_connection(i, i < attribute.max_connect && i < gun.num_devices);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
case move_handler::null:
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,10 @@
|
||||||
|
|
||||||
#include "Emu/RSX/GSRender.h"
|
#include "Emu/RSX/GSRender.h"
|
||||||
|
|
||||||
|
#ifdef LLVM_AVAILABLE
|
||||||
|
#include "llvm/Config/llvm-config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
LOG_CHANNEL(sys_log, "SYS");
|
LOG_CHANNEL(sys_log, "SYS");
|
||||||
|
|
||||||
// Preallocate 32 MiB
|
// Preallocate 32 MiB
|
||||||
|
@ -345,6 +349,19 @@ extern void dump_executable(std::span<const u8> data, const ppu_module<lv2_obj>*
|
||||||
|
|
||||||
void Emulator::Init()
|
void Emulator::Init()
|
||||||
{
|
{
|
||||||
|
// Log LLVM version
|
||||||
|
if (static bool logged_llvm = false; !logged_llvm)
|
||||||
|
{
|
||||||
|
#ifndef LLVM_AVAILABLE
|
||||||
|
sys_log.always()("LLVM version: Compiled without LLVM");
|
||||||
|
#elif defined (LLVM_VERSION_STRING)
|
||||||
|
sys_log.always()("LLVM version: %s", LLVM_VERSION_STRING);
|
||||||
|
#else
|
||||||
|
sys_log.always()("LLVM version: Unknown");
|
||||||
|
#endif
|
||||||
|
logged_llvm = true;
|
||||||
|
}
|
||||||
|
|
||||||
jit_runtime::initialize();
|
jit_runtime::initialize();
|
||||||
|
|
||||||
const std::string emu_dir = rpcs3::utils::get_emu_dir();
|
const std::string emu_dir = rpcs3::utils::get_emu_dir();
|
||||||
|
|
|
@ -665,6 +665,7 @@ int main(int argc, char** argv)
|
||||||
logs::stored_message qt{(strcmp(QT_VERSION_STR, qVersion()) != 0) ? sys_log.error : sys_log.notice};
|
logs::stored_message qt{(strcmp(QT_VERSION_STR, qVersion()) != 0) ? sys_log.error : sys_log.notice};
|
||||||
qt.text = fmt::format("Qt version: Compiled against Qt %s | Run-time uses Qt %s", QT_VERSION_STR, qVersion());
|
qt.text = fmt::format("Qt version: Compiled against Qt %s | Run-time uses Qt %s", QT_VERSION_STR, qVersion());
|
||||||
|
|
||||||
|
// Write current time
|
||||||
logs::stored_message time{sys_log.always()};
|
logs::stored_message time{sys_log.always()};
|
||||||
time.text = fmt::format("Current Time: %s", std::chrono::system_clock::now());
|
time.text = fmt::format("Current Time: %s", std::chrono::system_clock::now());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue