mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-09 12:31:40 +12:00
feat: 3dsx loading
romFS works too, pretty neat
This commit is contained in:
parent
a18ed8778f
commit
29352d223b
8 changed files with 469 additions and 39 deletions
|
@ -453,6 +453,8 @@ bool Emulator::loadROM(const std::filesystem::path& path) {
|
|||
success = loadNCSD(path, ROMType::NCSD);
|
||||
else if (extension == ".cxi" || extension == ".app")
|
||||
success = loadNCSD(path, ROMType::CXI);
|
||||
else if (extension == ".3dsx")
|
||||
success = load3DSX(path);
|
||||
else {
|
||||
printf("Unknown file type\n");
|
||||
success = false;
|
||||
|
@ -492,6 +494,19 @@ bool Emulator::loadNCSD(const std::filesystem::path& path, ROMType type) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Emulator::load3DSX(const std::filesystem::path& path) {
|
||||
std::optional<u32> entrypoint = memory.load3DSX(path);
|
||||
romType = ROMType::HB_3DSX;
|
||||
|
||||
if (!entrypoint.has_value()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
cpu.setReg(15, entrypoint.value()); // Set initial PC
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Emulator::loadELF(const std::filesystem::path& path) {
|
||||
loadedELF.open(path, std::ios_base::binary); // Open ROM in binary mode
|
||||
romType = ROMType::ELF;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue