overlays: do not open home menu in VSH

This commit is contained in:
Megamouse 2023-01-19 19:11:46 +01:00
parent 44771150b7
commit d3183708e8
7 changed files with 16 additions and 8 deletions

View file

@ -2043,7 +2043,7 @@ bool ppu_load_exec(const ppu_exec_object& elf, utils::serial* ar)
// Initialize memory stats (according to sdk version) // Initialize memory stats (according to sdk version)
u32 mem_size; u32 mem_size;
if (g_ps3_process_info.get_cellos_appname() == "vsh.self"sv) if (Emu.IsVsh())
{ {
// Because vsh.self comes before any generic application, more memory is available to it // Because vsh.self comes before any generic application, more memory is available to it
mem_size = 0xF000000; mem_size = 0xF000000;
@ -2096,7 +2096,7 @@ bool ppu_load_exec(const ppu_exec_object& elf, utils::serial* ar)
load_libs.emplace("libsysmodule.sprx"); load_libs.emplace("libsysmodule.sprx");
} }
if (ar || g_ps3_process_info.get_cellos_appname() == "vsh.self"sv) if (ar || Emu.IsVsh())
{ {
// Cannot be used with vsh.self or savestates (they self-manage itself) // Cannot be used with vsh.self or savestates (they self-manage itself)
load_libs.clear(); load_libs.clear();
@ -2271,7 +2271,7 @@ bool ppu_load_exec(const ppu_exec_object& elf, utils::serial* ar)
ppu->cmd_push({ppu_cmd::initialize, 0}); ppu->cmd_push({ppu_cmd::initialize, 0});
if (!entry && g_ps3_process_info.get_cellos_appname() != "vsh.self"sv) if (!entry && !Emu.IsVsh())
{ {
// Set TLS args, call sys_initialize_tls // Set TLS args, call sys_initialize_tls
ppu->cmd_list ppu->cmd_list

View file

@ -432,7 +432,7 @@ error_code sys_event_queue_receive(ppu_thread& ppu, u32 equeue_id, vm::ptr<sys_e
// "/dev_flash/vsh/module/msmw2.sprx" seems to rely on some cryptic shared memory behaviour that we don't emulate correctly // "/dev_flash/vsh/module/msmw2.sprx" seems to rely on some cryptic shared memory behaviour that we don't emulate correctly
// This is a hack to avoid waiting for 1m40s every time we boot vsh // This is a hack to avoid waiting for 1m40s every time we boot vsh
if (queue.key == 0x8005911000000012 && g_ps3_process_info.get_cellos_appname() == "vsh.self"sv) if (queue.key == 0x8005911000000012 && Emu.IsVsh())
{ {
sys_event.todo("sys_event_queue_receive(equeue_id=0x%x, *0x%x, timeout=0x%llx) Bypassing timeout for msmw2.sprx", equeue_id, dummy_event, timeout); sys_event.todo("sys_event_queue_receive(equeue_id=0x%x, *0x%x, timeout=0x%llx) Bypassing timeout for msmw2.sprx", equeue_id, dummy_event, timeout);
timeout = 1; timeout = 1;

View file

@ -3274,4 +3274,9 @@ utils::serial* Emulator::DeserialManager() const
return m_ar.get(); return m_ar.get();
} }
bool Emulator::IsVsh()
{
return g_ps3_process_info.get_cellos_appname() == "vsh.self"sv;
}
Emulator Emu; Emulator Emu;

View file

@ -340,6 +340,8 @@ public:
static game_boot_result GetElfPathFromDir(std::string& elf_path, const std::string& path); static game_boot_result GetElfPathFromDir(std::string& elf_path, const std::string& path);
static void GetBdvdDir(std::string& bdvd_dir, std::string& sfb_dir, std::string& game_dir, const std::string& elf_dir); static void GetBdvdDir(std::string& bdvd_dir, std::string& sfb_dir, std::string& game_dir, const std::string& elf_dir);
friend void init_fxo_for_exec(utils::serial*, bool); friend void init_fxo_for_exec(utils::serial*, bool);
static bool IsVsh();
}; };
extern Emulator Emu; extern Emulator Emu;

View file

@ -242,6 +242,8 @@ void pad_thread::operator()()
{ {
Init(); Init();
const bool is_vsh = Emu.IsVsh();
pad::g_reset = false; pad::g_reset = false;
pad::g_started = true; pad::g_started = true;
@ -401,7 +403,7 @@ void pad_thread::operator()()
} }
// Handle home menu if requested // Handle home menu if requested
if (!m_home_menu_open && Emu.IsRunning()) if (!is_vsh && !m_home_menu_open && Emu.IsRunning())
{ {
for (usz i = 0; i < m_pads.size(); i++) for (usz i = 0; i < m_pads.size(); i++)
{ {

View file

@ -21,7 +21,6 @@
#include "Emu/Io/Null/null_music_handler.h" #include "Emu/Io/Null/null_music_handler.h"
#include "Emu/Cell/Modules/cellAudio.h" #include "Emu/Cell/Modules/cellAudio.h"
#include "Emu/Cell/lv2/sys_rsxaudio.h" #include "Emu/Cell/lv2/sys_rsxaudio.h"
#include "Emu/Cell/lv2/sys_process.h"
#include "Emu/RSX/Overlays/overlay_perf_metrics.h" #include "Emu/RSX/Overlays/overlay_perf_metrics.h"
#include "Emu/system_utils.hpp" #include "Emu/system_utils.hpp"
#include "Emu/vfs_config.h" #include "Emu/vfs_config.h"
@ -660,7 +659,7 @@ void gui_application::OnEmuSettingsChange()
if (!Emu.IsStopped()) if (!Emu.IsStopped())
{ {
// Force audio provider // Force audio provider
if (g_ps3_process_info.get_cellos_appname() == "vsh.self"sv) if (Emu.IsVsh())
{ {
g_cfg.audio.provider.set(audio_provider::rsxaudio); g_cfg.audio.provider.set(audio_provider::rsxaudio);
} }