This commit is contained in:
Florin9doi 2026-03-10 22:50:34 +11:00 committed by GitHub
commit a5723959b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View file

@ -51,6 +51,7 @@ std::unordered_map<std::string, ppu_static_module*>& ppu_module_manager::get()
std::vector<std::string> g_ppu_function_names;
atomic_t<u32> liblv2_begin = 0, liblv2_end = 0;
atomic_t<bool> libusbd_active = false;
extern u32 ppu_generate_id(std::string_view name)
{
@ -1920,6 +1921,10 @@ shared_ptr<lv2_prx> ppu_load_prx(const ppu_prx_object& elf, bool virtual_load, c
liblv2_begin = prx->segs[0].addr;
liblv2_end = prx->segs[0].addr + prx->segs[0].size;
}
if (prx->path.ends_with("sys/external/libusbd.sprx"sv))
{
libusbd_active = true;
}
std::vector<u32> applied;
@ -2054,6 +2059,10 @@ void ppu_unload_prx(const lv2_prx& prx)
liblv2_begin = 0;
liblv2_end = 0;
}
if (prx.path.ends_with("sys/external/libusbd.sprx"sv))
{
libusbd_active = false;
}
// Format patch name
std::string hash = fmt::format("PRX-%s", fmt::base57(prx.sha1));

View file

@ -56,6 +56,8 @@ cfg_guncon3 g_cfg_guncon3;
cfg_topshotelite g_cfg_topshotelite;
cfg_topshotfearmaster g_cfg_topshotfearmaster;
extern atomic_t<bool> libusbd_active;
template <>
void fmt_class_string<libusb_transfer>::format(std::string& out, u64 arg)
{
@ -661,7 +663,7 @@ void usb_handler_thread::operator()()
u64 delay = 1'000;
// Process fake transfers
if (!fake_transfers.empty())
if (libusbd_active && !fake_transfers.empty())
{
std::lock_guard lock_tf(mutex_transfers);
u64 timestamp = get_system_time() - Emu.GetPauseTime();