USB: Stop sending USB replies after prx_unload
This commit is contained in:
@@ -51,6 +51,7 @@ std::unordered_map<std::string, ppu_static_module*>& ppu_module_manager::get()
|
|||||||
std::vector<std::string> g_ppu_function_names;
|
std::vector<std::string> g_ppu_function_names;
|
||||||
|
|
||||||
atomic_t<u32> liblv2_begin = 0, liblv2_end = 0;
|
atomic_t<u32> liblv2_begin = 0, liblv2_end = 0;
|
||||||
|
atomic_t<bool> libusbd_active = false;
|
||||||
|
|
||||||
extern u32 ppu_generate_id(std::string_view name)
|
extern u32 ppu_generate_id(std::string_view name)
|
||||||
{
|
{
|
||||||
@@ -1928,6 +1929,10 @@ shared_ptr<lv2_prx> ppu_load_prx(const ppu_prx_object& elf, bool virtual_load, c
|
|||||||
liblv2_begin = prx->segs[0].addr;
|
liblv2_begin = prx->segs[0].addr;
|
||||||
liblv2_end = prx->segs[0].addr + prx->segs[0].size;
|
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;
|
std::vector<u32> applied;
|
||||||
|
|
||||||
@@ -2062,6 +2067,10 @@ void ppu_unload_prx(const lv2_prx& prx)
|
|||||||
liblv2_begin = 0;
|
liblv2_begin = 0;
|
||||||
liblv2_end = 0;
|
liblv2_end = 0;
|
||||||
}
|
}
|
||||||
|
if (prx.path.ends_with("sys/external/libusbd.sprx"sv))
|
||||||
|
{
|
||||||
|
libusbd_active = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Format patch name
|
// Format patch name
|
||||||
std::string hash = fmt::format("PRX-%s", fmt::base57(prx.sha1));
|
std::string hash = fmt::format("PRX-%s", fmt::base57(prx.sha1));
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ cfg_guncon3 g_cfg_guncon3;
|
|||||||
cfg_topshotelite g_cfg_topshotelite;
|
cfg_topshotelite g_cfg_topshotelite;
|
||||||
cfg_topshotfearmaster g_cfg_topshotfearmaster;
|
cfg_topshotfearmaster g_cfg_topshotfearmaster;
|
||||||
|
|
||||||
|
extern atomic_t<bool> libusbd_active;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void fmt_class_string<libusb_transfer>::format(std::string& out, u64 arg)
|
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;
|
u64 delay = 1'000;
|
||||||
|
|
||||||
// Process fake transfers
|
// Process fake transfers
|
||||||
if (!fake_transfers.empty())
|
if (libusbd_active && !fake_transfers.empty())
|
||||||
{
|
{
|
||||||
std::lock_guard lock_tf(mutex_transfers);
|
std::lock_guard lock_tf(mutex_transfers);
|
||||||
u64 timestamp = get_system_time() - Emu.GetPauseTime();
|
u64 timestamp = get_system_time() - Emu.GetPauseTime();
|
||||||
|
|||||||
Reference in New Issue
Block a user