if i manually convert the elf to dol outside of dolphin, then add some code to run apploader, it at least works:
diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp
index 0ad7f6ec12..cd27d8ff33 100644
--- a/Source/Core/Core/Boot/Boot.cpp
+++ b/Source/Core/Core/Boot/Boot.cpp
@@ -466,11 +466,12 @@ bool CBoot::Load_BS2(const std::string& boot_rom_filename)
return true;
}
-static void SetDefaultDisc()
+static std::optional<const DiscIO::VolumeDisc*> SetDefaultDisc()
{
const std::string default_iso = Config::Get(Config::MAIN_DEFAULT_ISO);
if (!default_iso.empty())
- SetDisc(DiscIO::CreateDisc(default_iso));
+ return SetDisc(DiscIO::CreateDisc(default_iso));
+ return {};
}
static void CopyDefaultExceptionHandlers()
@@ -529,14 +530,16 @@ bool CBoot::BootUp(std::unique_ptr<BootParameters> boot)
if (!executable.reader->IsValid())
return false;
- if (!executable.reader->LoadIntoMemory())
+ auto default_disc = SetDefaultDisc();
+ if (!default_disc)
{
- PanicAlertFmtT("Failed to load the executable to memory.");
- return false;
+ if (!executable.reader->LoadIntoMemory())
+ {
+ PanicAlertFmtT("Failed to load the executable to memory.");
+ return false;
+ }
}
- SetDefaultDisc();
-
SetupMSR();
SetupBAT(config.bWii);
CopyDefaultExceptionHandlers();
@@ -560,6 +563,11 @@ bool CBoot::BootUp(std::unique_ptr<BootParameters> boot)
SetupGCMemory();
}
+ if (default_disc)
+ {
+ RunApploader(config.bWii, **default_disc, {});
+ }
+
SConfig::OnNewTitleLoad();
PC = executable.reader->GetEntryPoint();
diff --git a/Source/Core/Core/Boot/Boot_BS2Emu.cpp b/Source/Core/Core/Boot/Boot_BS2Emu.cpp
index 1265317a90..feec60b4cd 100644
--- a/Source/Core/Core/Boot/Boot_BS2Emu.cpp
+++ b/Source/Core/Core/Boot/Boot_BS2Emu.cpp
@@ -372,7 +372,7 @@ bool CBoot::SetupWiiMemory(IOS::HLE::IOSC::ConsoleType console_type)
values in this region will also be placed here by the game as it boots.
They are:
0x80000038 Start of FST
- 0x8000003c Size of FST Size
+ 0x8000003c Size of FST
0x80000060 Copyright code
*/
diff --git a/Source/Core/DiscIO/DirectoryBlob.cpp b/Source/Core/DiscIO/DirectoryBlob.cpp
index 86de55595a..30005759b5 100644
--- a/Source/Core/DiscIO/DirectoryBlob.cpp
+++ b/Source/Core/DiscIO/DirectoryBlob.cpp
@@ -1087,7 +1087,7 @@ void DirectoryBlobPartition::BuildFST(std::vector<FSTBuilderNode> root_nodes, u6
// overflow check, compare the aligned name offset with the aligned name table size
ASSERT(Common::AlignUp(name_offset, 1ull << m_address_shift) == name_table_size);
- // write FST size and location
+ // write FST location, size and max size
Write32((u32)(fst_address >> m_address_shift), 0x0424, &m_disc_header);
Write32((u32)(m_fst_data.size() >> m_address_shift), 0x0428, &m_disc_header);
Write32((u32)(m_fst_data.size() >> m_address_shift), 0x042c, &m_disc_header);
is that an OK change? it would be nicer if the DirectoryBlob's main.dol gets overridden with whatever executable you've launched but...at least it works.