ISO: add some logging

This commit is contained in:
Megamouse 2026-01-10 08:20:55 +01:00
parent 4dc994833d
commit a8624682a7
2 changed files with 17 additions and 1 deletions

View file

@ -1174,6 +1174,8 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch,
launching_from_disc_archive = is_file_iso(disc_info);
sys_log.notice("Savestate: is iso archive = %d ('%s')", launching_from_disc_archive, disc_info);
if (!klic[0])
{
klic.clear();
@ -1299,6 +1301,8 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch,
if (launching_from_disc_archive)
{
sys_log.notice("Savestate: Loading iso archive");
load_iso(disc_info);
m_path = iso_device::virtual_device_name + "/" + argv[0];
@ -1441,6 +1445,8 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch,
const std::string resolved_path = GetCallbacks().resolve_path(m_path);
if (!launching_from_disc_archive && is_file_iso(m_path))
{
sys_log.notice("Loading iso archive '%s'", m_path);
load_iso(m_path);
launching_from_disc_archive = true;
@ -1457,6 +1463,8 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch,
m_path = path;
}
sys_log.notice("Load: is iso archive = %d (m_path='%s')", launching_from_disc_archive, m_path);
if (launching_from_disc_archive)
{
m_dir = "/dev_bdvd/PS3_GAME/";
@ -1855,6 +1863,8 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch,
{
if (is_file_iso(game_path))
{
sys_log.notice("Loading iso archive for patch ('%s')", game_path);
load_iso(game_path);
launching_from_disc_archive = true;
game_path = iso_device::virtual_device_name + "/PS3_GAME/./";
@ -2368,7 +2378,7 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch,
else if (!bdvd_dir.empty() && fs::is_dir(bdvd_dir))
{
// Disc games are on /dev_bdvd/
const std::string& disc_path = !launching_from_disc_archive ? resolved_path : m_path;
const std::string& disc_path = launching_from_disc_archive ? m_path : resolved_path;
const usz pos = disc_path.rfind(m_game_dir);
argv[0] = "/dev_bdvd/PS3_GAME/" + unescape(disc_path.substr(pos + m_game_dir.size() + 1));
m_dir = "/dev_bdvd/PS3_GAME/";

View file

@ -9,6 +9,8 @@
#include <filesystem>
#include <stack>
LOG_CHANNEL(sys_log, "SYS");
bool is_file_iso(const std::string& path)
{
if (path.empty()) return false;
@ -609,6 +611,8 @@ void iso_dir::rewind()
void load_iso(const std::string& path)
{
sys_log.notice("Loading iso '%s'", path);
fs::set_virtual_device("iso_overlay_fs_dev", stx::make_shared<iso_device>(path));
vfs::mount("/dev_bdvd/"sv, iso_device::virtual_device_name + "/");
@ -616,5 +620,7 @@ void load_iso(const std::string& path)
void unload_iso()
{
sys_log.notice("Unoading iso");
fs::set_virtual_device("iso_overlay_fs_dev", stx::shared_ptr<iso_device>());
}