mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-27 06:27:03 +02:00
[hle, core/loader] remove hbl.nsp specific workaround
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
46cfd9b6f3
commit
330eac9be6
9 changed files with 25 additions and 32 deletions
|
|
@ -1174,8 +1174,7 @@ KProcess::KProcess(KernelCore& kernel)
|
|||
|
||||
KProcess::~KProcess() = default;
|
||||
|
||||
Result KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std::size_t code_size,
|
||||
KProcessAddress aslr_space_start, size_t aslr_space_offset, bool is_hbl) {
|
||||
Result KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std::size_t code_size, KProcessAddress aslr_space_start, size_t aslr_space_offset) {
|
||||
// Create a resource limit for the process.
|
||||
const auto pool = static_cast<KMemoryManager::Pool>(metadata.GetPoolPartition());
|
||||
const auto physical_memory_size = m_kernel.MemoryManager().GetSize(pool);
|
||||
|
|
@ -1247,7 +1246,6 @@ Result KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std:
|
|||
aslr_space_start));
|
||||
|
||||
// Assign remaining properties.
|
||||
m_is_hbl = is_hbl;
|
||||
m_ideal_core_id = metadata.GetMainThreadCore();
|
||||
|
||||
// Set up emulation context.
|
||||
|
|
|
|||
|
|
@ -133,7 +133,6 @@ private:
|
|||
bool m_is_initialized : 1 = false;
|
||||
bool m_is_application : 1 = false;
|
||||
bool m_is_default_application_system_resource : 1 = false;
|
||||
bool m_is_hbl : 1 = false;
|
||||
bool m_is_suspended : 1 = false;
|
||||
bool m_is_immortal : 1 = false;
|
||||
bool m_is_handle_table_initialized : 1 = false;
|
||||
|
|
@ -277,10 +276,6 @@ public:
|
|||
return m_capabilities.CanForceDebug();
|
||||
}
|
||||
|
||||
bool IsHbl() const {
|
||||
return m_is_hbl;
|
||||
}
|
||||
|
||||
u32 GetAllocateOption() const {
|
||||
return m_page_table.GetAllocateOption();
|
||||
}
|
||||
|
|
@ -514,8 +509,7 @@ public:
|
|||
}
|
||||
|
||||
public:
|
||||
Result LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std::size_t code_size,
|
||||
KProcessAddress aslr_space_start, size_t aslr_space_offset, bool is_hbl);
|
||||
Result LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std::size_t code_size, KProcessAddress aslr_space_start, size_t aslr_space_offset);
|
||||
|
||||
void LoadModule(CodeSet code_set, KProcessAddress base_addr);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
|
@ -106,9 +109,7 @@ void Break(Core::System& system, BreakReason reason, u64 info1, u64 info2) {
|
|||
system.CurrentPhysicalCore().LogBacktrace();
|
||||
}
|
||||
|
||||
const bool is_hbl = GetCurrentProcess(system.Kernel()).IsHbl();
|
||||
const bool should_break = is_hbl || !notification_only;
|
||||
|
||||
const bool should_break = !notification_only;
|
||||
if (system.DebuggerEnabled() && should_break) {
|
||||
auto* thread = system.Kernel().GetCurrentEmuThread();
|
||||
system.GetDebugger().NotifyThreadStopped(thread);
|
||||
|
|
|
|||
|
|
@ -71,9 +71,10 @@ struct PatchCollection {
|
|||
std::array<s32, 13> module_patcher_indices{};
|
||||
};
|
||||
|
||||
AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys::VirtualFile file_,
|
||||
bool override_update_)
|
||||
: AppLoader(std::move(file_)), override_update(override_update_), is_hbl(false) {
|
||||
AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys::VirtualFile file_, bool override_update_)
|
||||
: AppLoader(std::move(file_))
|
||||
, override_update(override_update_)
|
||||
{
|
||||
const auto file_dir = file->GetContainingDirectory();
|
||||
|
||||
// Title ID
|
||||
|
|
@ -124,9 +125,11 @@ AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys
|
|||
}
|
||||
|
||||
AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(
|
||||
FileSys::VirtualDir directory, bool override_update_, bool is_hbl_)
|
||||
: AppLoader(directory->GetFile("main")), dir(std::move(directory)),
|
||||
override_update(override_update_), is_hbl(is_hbl_) {}
|
||||
FileSys::VirtualDir directory, bool override_update_)
|
||||
: AppLoader(directory->GetFile("main"))
|
||||
, dir(std::move(directory))
|
||||
, override_update(override_update_)
|
||||
{}
|
||||
|
||||
FileType AppLoader_DeconstructedRomDirectory::IdentifyType(const FileSys::VirtualFile& dir_file) {
|
||||
if (FileSys::IsDirectoryExeFS(dir_file->GetContainingDirectory())) {
|
||||
|
|
@ -232,7 +235,7 @@ AppLoader_DeconstructedRomDirectory::LoadResult AppLoader_DeconstructedRomDirect
|
|||
? ::Settings::values.rng_seed.GetValue() : Common::Random::Random64(0)) << 12) & 0xfff000;
|
||||
|
||||
// Setup the process code layout
|
||||
if (process.LoadFromMetadata(metadata, code_size, fastmem_base, aslr_offset, is_hbl).IsError()) {
|
||||
if (process.LoadFromMetadata(metadata, code_size, fastmem_base, aslr_offset).IsError()) {
|
||||
return {ResultStatus::ErrorUnableToParseKernelMetadata, {}};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
|
@ -22,13 +25,9 @@ namespace Loader {
|
|||
*/
|
||||
class AppLoader_DeconstructedRomDirectory final : public AppLoader {
|
||||
public:
|
||||
explicit AppLoader_DeconstructedRomDirectory(FileSys::VirtualFile main_file,
|
||||
bool override_update_ = false);
|
||||
|
||||
explicit AppLoader_DeconstructedRomDirectory(FileSys::VirtualFile main_file, bool override_update_ = false);
|
||||
// Overload to accept exefs directory. Must contain 'main' and 'main.npdm'
|
||||
explicit AppLoader_DeconstructedRomDirectory(FileSys::VirtualDir directory,
|
||||
bool override_update_ = false,
|
||||
bool is_hbl_ = false);
|
||||
explicit AppLoader_DeconstructedRomDirectory(FileSys::VirtualDir directory, bool override_update_ = false);
|
||||
|
||||
/**
|
||||
* Identifies whether or not the given file is a deconstructed ROM directory.
|
||||
|
|
@ -63,7 +62,6 @@ private:
|
|||
std::string name;
|
||||
u64 title_id{};
|
||||
bool override_update;
|
||||
bool is_hbl;
|
||||
|
||||
Modules modules;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ AppLoader::LoadResult AppLoader_KIP::Load(Kernel::KProcess& process,
|
|||
? ::Settings::values.rng_seed.GetValue() : Common::Random::Random64(0)) << 12) & 0xfff000;
|
||||
|
||||
// Setup the process code layout
|
||||
if (process.LoadFromMetadata(FileSys::ProgramMetadata::GetDefault(), codeset.memory.size(), 0, aslr_offset, false).IsError()) {
|
||||
if (process.LoadFromMetadata(FileSys::ProgramMetadata::GetDefault(), codeset.memory.size(), 0, aslr_offset).IsError()) {
|
||||
return {ResultStatus::ErrorNotInitialized, {}};
|
||||
}
|
||||
const VAddr base_address = GetInteger(process.GetEntryPoint());
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ static bool LoadNroImpl(Core::System& system, Kernel::KProcess& process,
|
|||
|
||||
// Setup the process code layout
|
||||
if (process
|
||||
.LoadFromMetadata(FileSys::ProgramMetadata::GetDefault(), image_size, fastmem_base, aslr_offset, false)
|
||||
.LoadFromMetadata(FileSys::ProgramMetadata::GetDefault(), image_size, fastmem_base, aslr_offset)
|
||||
.IsError()) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@ AppLoader_NSP::AppLoader_NSP(FileSys::VirtualFile file_,
|
|||
}
|
||||
|
||||
if (nsp->IsExtractedType()) {
|
||||
secondary_loader = std::make_unique<AppLoader_DeconstructedRomDirectory>(
|
||||
nsp->GetExeFS(), false, file->GetName() == "hbl.nsp");
|
||||
secondary_loader = std::make_unique<AppLoader_DeconstructedRomDirectory>(nsp->GetExeFS(), false);
|
||||
} else {
|
||||
const auto control_nca =
|
||||
nsp->GetNCA(nsp->GetProgramTitleID(), FileSys::ContentRecordType::Control);
|
||||
|
|
|
|||
|
|
@ -581,7 +581,7 @@ MainWindow::MainWindow(bool has_broken_vulkan)
|
|||
} else if (should_launch_hlaunch) {
|
||||
std::filesystem::path const sd_dir = Common::FS::GetEdenPathString(Common::FS::EdenPath::SDMCDir);
|
||||
auto const hbl_path = (sd_dir / "atmosphere" / "hbl.nsp").string();
|
||||
BootGame(QString::fromStdString(hbl_path), ApplicationAppletParameters());
|
||||
BootGame(QString::fromStdString(hbl_path), LibraryAppletParameters(0x010000000000100Dull, Service::AM::AppletId::QLaunch));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue