diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 706a6ecaf..7c389c368 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -215,11 +215,9 @@ endif() if(WIN32 OR (APPLE AND CMAKE_MACOSX_BUNDLE)) # Copy the binary to the root of the install prefix on Windows and macOS install(TARGETS 86Box DESTINATION ".") - install(DIRECTORY ${CMAKE_SOURCE_DIR}/assets DESTINATION ".") else() # On Linux we want to copy the binary to the `bin` folder. install(TARGETS 86Box) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/assets) endif() @@ -290,10 +288,3 @@ endif() if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") add_custom_command(TARGET 86Box POST_BUILD COMMAND paxctl ARGS +m $ COMMENT "Disable PaX MPROTECT") endif() - -add_custom_command(TARGET 86Box POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMAKE_SOURCE_DIR}/assets - $/assets - COMMENT "Copying assets directory to build output" -) diff --git a/src/floppy/fdd_audio.c b/src/floppy/fdd_audio.c index 19a44309a..b2c77e42a 100644 --- a/src/floppy/fdd_audio.c +++ b/src/floppy/fdd_audio.c @@ -26,6 +26,7 @@ #include <86box/fdd_audio.h> #include <86box/fdc.h> #include <86box/mem.h> +#include <86box/rom.h> #include <86box/sound.h> #include <86box/plat.h> #include <86box/path.h> @@ -668,7 +669,7 @@ load_wav(const char *filename, int *sample_count) if (strstr(filename, "..") != NULL) return NULL; - FILE *f = plat_fopen(filename, "rb"); + FILE *f = asset_fopen(filename, "rb"); if (f == NULL) { fdd_log("FDD Audio: Failed to open WAV file: %s\n", filename); return NULL; diff --git a/src/mem/rom.c b/src/mem/rom.c index 6943b53d3..5798b4252 100644 --- a/src/mem/rom.c +++ b/src/mem/rom.c @@ -166,10 +166,10 @@ asset_get_full_path(char *dest, const char *fn) dest[0] = 0x00; - if (!strncmp(fn, "assets/", 5)) { + if (!strncmp(fn, "assets/", 7)) { /* Relative path */ for (rom_path_t *asset_path = &asset_paths; asset_path != NULL; asset_path = asset_path->next) { - path_append_filename(temp, asset_path->path, fn + 5); + path_append_filename(temp, asset_path->path, fn + 7); if (rom_check(temp)) { strcpy(dest, temp); @@ -218,10 +218,10 @@ asset_fopen(const char *fn, char *mode) if ((fn == NULL) || (mode == NULL)) return NULL; - if (!strncmp(fn, "assets/", 5)) { + if (!strncmp(fn, "assets/", 7)) { /* Relative path */ for (rom_path_t *asset_path = &asset_paths; asset_path != NULL; asset_path = asset_path->next) { - path_append_filename(temp, asset_path->path, fn + 5); + path_append_filename(temp, asset_path->path, fn + 7); if ((fp = plat_fopen(temp, mode)) != NULL) return fp; @@ -267,10 +267,10 @@ asset_getfile(const char *fn, char *s, int size) { char temp[1024]; - if (!strncmp(fn, "assets/", 5)) { + if (!strncmp(fn, "assets/", 7)) { /* Relative path */ for (rom_path_t *asset_path = &asset_paths; asset_path != NULL; asset_path = asset_path->next) { - path_append_filename(temp, asset_path->path, fn + 5); + path_append_filename(temp, asset_path->path, fn + 7); if (plat_file_check(temp)) { strncpy(s, temp, size); @@ -322,10 +322,10 @@ asset_present(const char *fn) if (fn == NULL) return 0; - if (!strncmp(fn, "assets/", 5)) { + if (!strncmp(fn, "assets/", 7)) { /* Relative path */ for (rom_path_t *asset_path = &asset_paths; asset_path != NULL; asset_path = asset_path->next) { - path_append_filename(temp, asset_path->path, fn + 5); + path_append_filename(temp, asset_path->path, fn + 7); if (plat_file_check(temp)) return 1;