mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-11-01 03:50:37 +00:00
[core] Speed up NCZBLOCK reads and skip double AES for pre-decrypted NCZ (#4582)
- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- - Use a 32-slot direct-mapped block cache and reuse one ZSTD_DCtx per BlockReader instead of re-creating it per block. - Find the covering section with std::lower_bound instead of a linear scan (helps BKTR updates with thousands of sections). - Mark BlockNczFile as HasDecryptedSections() and drop its CTR pass; NCZ body is stored decrypted, so NcaFileSystemDriver now skips its AES layers for these files (no double decryption). - Recognize .xcz as XCZ in AppLoader_XCI::IdentifyType. thanks Reikatari Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4582 Reviewed-by: Maufeat <sahyno1996@gmail.com>
This commit is contained in:
@@ -54,7 +54,8 @@ FileType AppLoader_XCI::IdentifyType(const FileSys::VirtualFile& xci_file) {
|
||||
// Identify XCI as a valid container even when it does not include a bootable Program NCA.
|
||||
// Bootability is handled by AppLoader_XCI::Load().
|
||||
if (xci.GetSecurePartitionNSP() != nullptr) {
|
||||
return FileType::XCI;
|
||||
return xci_file->GetName().ends_with(".xcz") ? FileType::XCZ
|
||||
: FileType::XCI;
|
||||
}
|
||||
|
||||
return FileType::Error;
|
||||
|
||||
Reference in New Issue
Block a user