mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-08-22 10:18:48 +00:00
Add OpenArchive and NCCH read file errors
[OpenArchive] Only throw an error if the shared extdata ID is 0xE0000000
This commit is contained in:
parent
9935b68f00
commit
74a9c08975
3 changed files with 18 additions and 2 deletions
|
@ -92,8 +92,10 @@ std::optional<u32> NCCHArchive::readFile(FileSession* file, u64 offset, u32 size
|
|||
} else if (highProgramID == systemDataArchive && lowProgramID == badWordList) {
|
||||
fileData = std::vector<u8>(std::begin(BAD_WORD_LIST_DATA), std::end(BAD_WORD_LIST_DATA));
|
||||
} else {
|
||||
Helpers::panic("[NCCH archive] Read from unimplemented NCCH archive file. High program ID: %08X, low ID: %08X",
|
||||
Helpers::warn("[NCCH archive] Read from unimplemented NCCH archive file. High program ID: %08X, low ID: %08X",
|
||||
highProgramID, lowProgramID);
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (offset >= fileData.size()) {
|
||||
|
|
|
@ -111,7 +111,8 @@ void Kernel::readFile(u32 messagePointer, Handle fileHandle) {
|
|||
auto archive = file->archive;
|
||||
std::optional<u32> bytesRead = archive->readFile(file, offset, size, dataPointer);
|
||||
if (!bytesRead.has_value()) {
|
||||
Helpers::panic("Kernel::ReadFile failed");
|
||||
Helpers::warn("Kernel::ReadFile failed");
|
||||
mem.write32(messagePointer + 4, 0xC8804478);
|
||||
} else {
|
||||
mem.write32(messagePointer + 4, Result::Success);
|
||||
mem.write32(messagePointer + 8, bytesRead.value());
|
||||
|
|
|
@ -236,6 +236,19 @@ void FSService::openArchive(u32 messagePointer) {
|
|||
auto archivePath = readPath(archivePathType, archivePathPointer, archivePathSize);
|
||||
log("FS::OpenArchive(archive ID = %d, archive path type = %d)\n", archiveID, archivePathType);
|
||||
|
||||
// Needed for HOME Menu
|
||||
if ((archiveID == 7) && (archivePathType == 2)) {
|
||||
const u32 id = *(u32*)&archivePath.binary[4];
|
||||
|
||||
if (id == 0xE0000000) {
|
||||
log("FS::OpenArchive: Failed to open archive\n");
|
||||
mem.write32(messagePointer + 4, 0xC8804478);
|
||||
mem.write64(messagePointer + 8, 0);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Rust::Result<Handle, Result::HorizonResult> res = openArchiveHandle(archiveID, archivePath);
|
||||
mem.write32(messagePointer, IPC::responseHeader(0x80C, 3, 0));
|
||||
if (res.isOk()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue