MacOSX Default ROM PATH
This commit is contained in:
20
src/86box.c
20
src/86box.c
@@ -33,7 +33,7 @@
|
|||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <dispatch/dispatch.h>
|
#include <dispatch/dispatch.h>
|
||||||
#include <mac/macOSXGlue.h>
|
#include "mac/macOSXGlue.h"
|
||||||
#ifdef __aarch64__
|
#ifdef __aarch64__
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -418,6 +418,9 @@ pc_init(int argc, char *argv[])
|
|||||||
plat_getcwd(usr_path, sizeof(usr_path) - 1);
|
plat_getcwd(usr_path, sizeof(usr_path) - 1);
|
||||||
plat_getcwd(rom_path, sizeof(rom_path) - 1);
|
plat_getcwd(rom_path, sizeof(rom_path) - 1);
|
||||||
|
|
||||||
|
printf("JV:usr_path %s\n",usr_path);
|
||||||
|
printf("JV:rom_path %s\n",usr_path);
|
||||||
|
|
||||||
memset(path, 0x00, sizeof(path));
|
memset(path, 0x00, sizeof(path));
|
||||||
memset(path2, 0x00, sizeof(path));
|
memset(path2, 0x00, sizeof(path));
|
||||||
|
|
||||||
@@ -586,20 +589,23 @@ usage:
|
|||||||
plat_dir_create(usr_path);
|
plat_dir_create(usr_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Path detection should be rewrite. Write function per OS rather than how it's done now
|
||||||
|
#ifdef __APPLE__
|
||||||
|
//Get and create default rom path for MacOsX
|
||||||
|
getDefaultROMPath(path2);
|
||||||
|
// This will return an absolut path to ~/Library/Application Support/bundleidentifierk/roms
|
||||||
|
#endif
|
||||||
|
|
||||||
if (vmrp && (path2[0] == '\0')) {
|
if (vmrp && (path2[0] == '\0')) {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
//NO COMMAND LINE ARG for MacOsX when aunched from Finder, so this will never run??
|
||||||
getDefaultROMPath(path2);
|
getDefaultROMPath(path2);
|
||||||
// This will return an absolut path to ~/Library/Application Support/bundleidentifier
|
// This will return an absolut path to ~/Library/Application Support/bundleidentifierk/roms
|
||||||
#else
|
#else
|
||||||
strcpy(path2, usr_path);
|
strcpy(path2, usr_path);
|
||||||
plat_path_slash(path2);
|
plat_path_slash(path2);
|
||||||
strcat(path2, "roms");
|
strcat(path2, "roms");
|
||||||
#endif
|
#endif
|
||||||
/// <summary>
|
|
||||||
/// TODO: Add Plateform specific getDefaultROMPath to hide the awkfull code below
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path2></param>
|
|
||||||
/// <returns>Correct Path of Default roms folder</returns>
|
|
||||||
plat_path_slash(path2);
|
plat_path_slash(path2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,9 +82,12 @@ endif()
|
|||||||
|
|
||||||
#some macOS specific configuration steps
|
#some macOS specific configuration steps
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
# Force using the newest library if it's installed by homebrew
|
find_library(COCOA_LIBRARY Cocoa)
|
||||||
|
target_link_libraries (86Box ${COCOA_LIBRARY} )
|
||||||
|
# Force using the newest library if it's installed by homebrew
|
||||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||||
|
|
||||||
|
|
||||||
# prepare stuff for macOS app bundles
|
# prepare stuff for macOS app bundles
|
||||||
set(CMAKE_MACOSX_BUNDLE 1)
|
set(CMAKE_MACOSX_BUNDLE 1)
|
||||||
|
|
||||||
@@ -214,8 +217,8 @@ add_subdirectory(sound)
|
|||||||
add_subdirectory(video)
|
add_subdirectory(video)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
add_subdirectory(mac)
|
add_subdirectory(mac)
|
||||||
else()
|
add_subdirectory(unix)
|
||||||
if (WIN32)
|
elseif(WIN32)
|
||||||
add_subdirectory(win)
|
add_subdirectory(win)
|
||||||
else()
|
else()
|
||||||
add_subdirectory(unix)
|
add_subdirectory(unix)
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
include_directories("./mac")
|
include_directories("./mac")
|
||||||
target_sources(86Box PUBLIC "./mac/MacOSCGlue.m")
|
target_sources(86Box PUBLIC "./macOSXGlue.m")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user