Skip to content

Commit

Permalink
set-up directories correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
aliaspider committed Mar 25, 2023
1 parent 11362aa commit 021e33f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
28 changes: 9 additions & 19 deletions libretro/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,15 @@ void cpu_thread_entry(VMBootParameters boot_params)

bool retro_load_game(const struct retro_game_info* game)
{
const char* system_base = nullptr;
environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &system_base);
std::string system = Path::Combine(system_base, "pcsx2");

EmuFolders::AppRoot = system;
EmuFolders::Resources = Path::Combine(EmuFolders::AppRoot, "resources");
EmuFolders::DataRoot = EmuFolders::AppRoot;
CommonHost::InitializeCriticalFolders();

Host::Internal::SetBaseSettingsLayer(&s_settings_interface);
CommonHost::SetDefaultSettings(s_settings_interface, true, true, true, true, true);
CommonHost::LoadStartupSettings();
Expand All @@ -580,18 +588,6 @@ bool retro_load_game(const struct retro_game_info* game)

VMManager::LoadSettings();

const char* system_base = nullptr;
environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &system_base);
std::string system = Path::Combine(system_base, "pcsx2");

EmuFolders::AppRoot = system;
EmuFolders::DataRoot = system;
EmuFolders::Bios = Path::Combine(system, "bios");
EmuFolders::Resources = Path::Combine(system, "resources");
EmuFolders::MemoryCards = Path::Combine(system, "memcards");
EmuFolders::GameSettings = Path::Combine(system, "gamesettings");


if (Options::bios.empty())
{
log_cb(RETRO_LOG_ERROR, "Could not find any valid PS2 Bios File in %s\n", EmuFolders::Bios.c_str());
Expand All @@ -601,13 +597,7 @@ bool retro_load_game(const struct retro_game_info* game)
s_settings_interface.SetBoolValue("EmuCore/GS", "FrameLimitEnable", false);
s_settings_interface.SetFloatValue("EmuCore/GS", "upscale_multiplier", Options::upscale_multiplier);
s_settings_interface.SetBoolValue("EmuCore", "EnableFastBoot", Options::fast_boot);

EmuConfig.BaseFilenames.Bios = Options::bios.Get();
EmuConfig.CurrentIRX = ""; // By default no IRX injection
// EmuConfig.UseBOOT2Injection = Options::fast_boot;
// EmuConfig.GS.FrameLimitEnable = false;
// EmuConfig.GS.UpscaleMultiplier = Options::upscale_multiplier;
// EmuConfig.GS.SynchronousMTGS = true;
s_settings_interface.SetStringValue("Filenames", "BIOS", Options::bios.Get().c_str());

write_pos = 0;

Expand Down
2 changes: 2 additions & 0 deletions pcsx2/Frontend/CommonHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ static bool s_discord_presence_active = false;

bool CommonHost::InitializeCriticalFolders()
{
#ifndef __LIBRETRO__
SetAppRoot();
SetResourcesDirectory();
SetDataDirectory();
#endif

// logging of directories in case something goes wrong super early
Console.WriteLn("AppRoot Directory: %s", EmuFolders::AppRoot.c_str());
Expand Down

0 comments on commit 021e33f

Please sign in to comment.