From 8820a60e019e809411e999c7d6b36e07e970a112 Mon Sep 17 00:00:00 2001 From: dob205 Date: Fri, 19 Nov 2021 13:40:35 +0100 Subject: [PATCH] Loading macOSXglue.m and macOSXglue.h Enables to store the ROMs in "Application Support" on macOS, can be extended later into storage of global configuration files --- src/86box.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/86box.c b/src/86box.c index 908bef06f..89ff01e25 100644 --- a/src/86box.c +++ b/src/86box.c @@ -33,6 +33,7 @@ #ifdef __APPLE__ #include #include +#include "mac/macOSXGlue.h" #ifdef __aarch64__ #include #endif @@ -393,6 +394,7 @@ pc_init(int argc, char *argv[]) { char path[2048], path2[2048]; char *cfg = NULL, *p; + char mac_rom_path[2048]; char temp[128]; struct tm *info; time_t now; @@ -585,14 +587,14 @@ usage: plat_dir_create(usr_path); } + #ifdef __APPLE__ + getDefaultROMPath(mac_rom_path); + strcpy(path2, mac_rom_path); + #endif if (vmrp && (path2[0] == '\0')) { -#ifdef __APPLE__ - sprintf("%s/Library/Application Support/86Box/roms", getenv("HOME") ? getenv("HOME") : getpwuid(getuid())->pw_dir); -#else strcpy(path2, usr_path); plat_path_slash(path2); strcat(path2, "roms"); -#endif plat_path_slash(path2); }