mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-12-25 01:11:48 +01:00
NCCH: Changed decompression to load .code directly into memory rather than an intermediate buffer.
This commit is contained in:
parent
c144ed5058
commit
79a48082e2
@ -314,18 +314,12 @@ bool Load_NCCH(std::string& filename, std::string* error_string) {
|
|||||||
if (i == 0 && is_compressed) {
|
if (i == 0 && is_compressed) {
|
||||||
u32 decompressed_size = LZSS_GetDecompressedSize(buffer,
|
u32 decompressed_size = LZSS_GetDecompressedSize(buffer,
|
||||||
exefs_header.section[i].size);
|
exefs_header.section[i].size);
|
||||||
u8* decompressed_buffer = new u8[decompressed_size];
|
|
||||||
|
|
||||||
if (!LZSS_Decompress(buffer, exefs_header.section[i].size, decompressed_buffer,
|
if (!LZSS_Decompress(buffer, exefs_header.section[i].size,
|
||||||
|
Memory::GetPointer(exheader_header.codeset_info.text.address),
|
||||||
decompressed_size, error_string)) {
|
decompressed_size, error_string)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Load .code section into memory...
|
|
||||||
LoadBuffer(exheader_header.codeset_info.text.address, decompressed_buffer,
|
|
||||||
decompressed_size);
|
|
||||||
|
|
||||||
delete[] decompressed_buffer;
|
|
||||||
|
|
||||||
// Load uncompressed executable...
|
// Load uncompressed executable...
|
||||||
} else {
|
} else {
|
||||||
// Load .code section into memory...
|
// Load .code section into memory...
|
||||||
|
Loading…
Reference in New Issue
Block a user