diff --git a/src/hll/ACXLoader.c b/src/hll/ACXLoader.c index 80426f6..42776e5 100644 --- a/src/hll/ACXLoader.c +++ b/src/hll/ACXLoader.c @@ -16,11 +16,13 @@ #include #include +#include #include #include "system4.h" #include "system4/string.h" #include "system4/acx.h" +#include "system4/file.h" #include "hll.h" #include "little_endian.h" @@ -31,8 +33,26 @@ struct acx *acx = NULL; static bool ACXLoader_Load(struct string *filename) { + int error = ACX_SUCCESS; char *path = gamedir_path(filename->text); - acx = acx_load(path); + acx = acx_load(path, &error); + + // XXX: Fix for games (e.g. Tsuma Shibori) that shipped with incorrectly + // cased file names + if (error == ACX_ERROR_FILE) { + char *ipath = path_get_icase(path); + if (ipath) { + free(path); + path = ipath; + acx = acx_load(path, &error); + } + } + + if (error == ACX_ERROR_FILE) { + WARNING("acx_load(\"%s\"): %s", path, strerror(errno)); + } else if (error == ACX_ERROR_INVALID) { + WARNING("acx_load(\"%s\"): invalid .acx file"); + } free(path); return !!acx; } diff --git a/subprojects/libsys4 b/subprojects/libsys4 index 2e8b581..7b08a56 160000 --- a/subprojects/libsys4 +++ b/subprojects/libsys4 @@ -1 +1 @@ -Subproject commit 2e8b581636a1004298b4f2c6aeea61b3c8b0d099 +Subproject commit 7b08a56babe700fdcc07cc3bdbd0132a55733a84