Redesign dusk.dsk into a dual-archive DSK2 format
Splits the asset archive into a compressed (DEFLATE) zip and an uncompressed (STORED) zip back to back behind a small header, instead of one plain zip. DEFLATE-compressed zip entries aren't reliably seekable in libzip, which caused locale string lookups (repeated rewind/reopen of the same entry) to silently skip content on Dolphin specifically. Uncompressed entries don't have that problem, so locale files now go in the stored archive without needing to buffer the whole thing in memory. Adds tools/asset/pack as the new packer (replacing the plain `tar --format=zip`), a shared assetdsk.h/.c opener used by all platforms, and a second ASSET.zipStored handle with fallback lookup in assetfile.c. Confirmed working: Linux, PSP (PPSSPP), and Dolphin-FAT (Wii DOL under -a LLE) - the original Dolphin locale lookup failure no longer reproduces.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "asset/asset.h"
|
||||
#include "asset/assetdsk.h"
|
||||
#include "engine/engine.h"
|
||||
#include "util/string.h"
|
||||
#include "assert/assert.h"
|
||||
@@ -45,10 +46,10 @@ errorret_t assetInitLinux(void) {
|
||||
stringCopy(ASSET.platform.systemPath, ".", ASSET_SYSTEM_PATH_MAX);
|
||||
}
|
||||
|
||||
// Open zip file
|
||||
// Open dusk.dsk
|
||||
char_t searchPath[ASSET_SYSTEM_PATH_MAX];
|
||||
const char_t **path = ASSET_LINUX_SEARCH_PATHS;
|
||||
int32_t error;
|
||||
bool_t opened = false;
|
||||
do {
|
||||
char_t temp[ASSET_SYSTEM_PATH_MAX];
|
||||
snprintf(
|
||||
@@ -75,17 +76,18 @@ errorret_t assetInitLinux(void) {
|
||||
printf("Try open asset file: %s\n", searchPath);
|
||||
|
||||
// Try open
|
||||
error = 0;
|
||||
ASSET.zip = zip_open(searchPath, ZIP_RDONLY, &error);
|
||||
if(ASSET.zip == NULL) {
|
||||
printf("Opened asset file with non-zero error code: %d\n", error);
|
||||
if(errorIsNotOk(
|
||||
assetDskOpenFromPath(searchPath, &ASSET.zip, &ASSET.zipStored)
|
||||
)) {
|
||||
printf("Failed to open asset file: %s\n", searchPath);
|
||||
continue;
|
||||
}
|
||||
opened = true;
|
||||
break;// Found!
|
||||
} while(*(++path) != NULL);
|
||||
|
||||
// Did we open the asset?
|
||||
if(ASSET.zip == NULL) {
|
||||
if(!opened) {
|
||||
errorThrow("Failed to open asset file.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user