Skip to content

Commit

Permalink
IOP HLE: Rename update host root functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Dnawrkshp authored and stenzek committed Nov 14, 2023
1 parent b5f8ef0 commit 4af8957
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
13 changes: 3 additions & 10 deletions pcsx2/IopBios.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,13 @@ typedef struct

static std::string hostRoot;

void Hle_SetElfPath(const char* elfFileName)
void Hle_SetHostRoot(const char* bootFilename)
{
DevCon.WriteLn("HLE Host: Will load ELF: %s\n", elfFileName);
hostRoot = Path::ToNativePath(Path::GetDirectory(elfFileName));
hostRoot = Path::ToNativePath(Path::GetDirectory(bootFilename));
Console.WriteLn("HLE Host: Set 'host:' root path to: %s\n", hostRoot.c_str());
}

void Hle_SetIsoPath(const char* isoFilename)
{
hostRoot = Path::ToNativePath(Path::GetDirectory(isoFilename));
Console.WriteLn("HLE Host: Set 'host:' root path to: %s\n", hostRoot.c_str());
}

void Hle_ClearElfPath()
void Hle_ClearHostRoot()
{
hostRoot = {};
}
Expand Down
5 changes: 2 additions & 3 deletions pcsx2/IopBios.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ namespace R3000A
}
} // namespace R3000A

extern void Hle_SetElfPath(const char* elfFileName);
extern void Hle_SetIsoPath(const char* isoFilename);
extern void Hle_ClearElfPath();
extern void Hle_SetHostRoot(const char* bootFilename);
extern void Hle_ClearHostRoot();

10 changes: 5 additions & 5 deletions pcsx2/VMManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1188,15 +1188,15 @@ bool VMManager::Initialize(VMBootParameters boot_params)
return false;
}

Hle_SetElfPath(s_elf_override.c_str());
Hle_SetHostRoot(s_elf_override.c_str());
}
else if (CDVDsys_GetSourceType() == CDVD_SourceType::Iso)
{
Hle_SetIsoPath(CDVDsys_GetFile(CDVDsys_GetSourceType()).c_str());
Hle_SetHostRoot(CDVDsys_GetFile(CDVDsys_GetSourceType()).c_str());
}
else
{
Hle_ClearElfPath();
Hle_ClearHostRoot();
}

// Check for resuming with hardcore mode.
Expand Down Expand Up @@ -1984,9 +1984,9 @@ bool VMManager::SetELFOverride(std::string path)

s_fast_boot_requested = !s_elf_override.empty() || EmuConfig.EnableFastBoot;
if (s_elf_override.empty())
Hle_ClearElfPath();
Hle_ClearHostRoot();
else
Hle_SetElfPath(s_elf_override.c_str());
Hle_SetHostRoot(s_elf_override.c_str());

Reset();
return true;
Expand Down

0 comments on commit 4af8957

Please sign in to comment.