MacOsX Compilation
This commit is contained in:
17
src/86box.c
17
src/86box.c
@@ -394,6 +394,7 @@ pc_init(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
char path[2048], path2[2048];
|
char path[2048], path2[2048];
|
||||||
char *cfg = NULL, *p;
|
char *cfg = NULL, *p;
|
||||||
|
char mac_rom_path[2048];
|
||||||
char temp[128];
|
char temp[128];
|
||||||
struct tm *info;
|
struct tm *info;
|
||||||
time_t now;
|
time_t now;
|
||||||
@@ -589,23 +590,15 @@ 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
|
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
getDefaultROMPath(mac_rom_path);
|
||||||
|
strcpy(path2, mac_rom_path);
|
||||||
|
#endif
|
||||||
if (vmrp && (path2[0] == '\0')) {
|
if (vmrp && (path2[0] == '\0')) {
|
||||||
#ifdef __APPLE__
|
|
||||||
//NO COMMAND LINE ARG for MacOsX when aunched from Finder, so this will never run??
|
|
||||||
getDefaultROMPath(path2);
|
|
||||||
// This will return an absolut path to ~/Library/Application Support/bundleidentifierk/roms
|
|
||||||
#else
|
|
||||||
strcpy(path2, usr_path);
|
strcpy(path2, usr_path);
|
||||||
plat_path_slash(path2);
|
plat_path_slash(path2);
|
||||||
strcat(path2, "roms");
|
strcat(path2, "roms");
|
||||||
#endif
|
|
||||||
plat_path_slash(path2);
|
plat_path_slash(path2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,24 +16,33 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Prepare the macOS app bundle icon depending on the release channel
|
# Prepare the macOS app bundle icon depending on the release channel
|
||||||
if(RELEASE_BUILD)
|
set(APP_ICON_MACOSX)
|
||||||
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/release/86Box.icns)
|
if (APPLE)
|
||||||
elseif(BETA_BUILD)
|
if(RELEASE_BUILD)
|
||||||
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/beta/86Box.icns)
|
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/release/86Box.icns)
|
||||||
elseif(ALPHA_BUILD)
|
elseif(BETA_BUILD)
|
||||||
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/dev/86Box.icns)
|
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/beta/86Box.icns)
|
||||||
else()
|
elseif(ALPHA_BUILD)
|
||||||
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/branch/86Box.icns)
|
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/dev/86Box.icns)
|
||||||
endif()
|
else()
|
||||||
|
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/branch/86Box.icns)
|
||||||
|
endif()
|
||||||
|
|
||||||
set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES
|
set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES
|
||||||
MACOSX_PACKAGE_LOCATION "Resources")
|
MACOSX_PACKAGE_LOCATION "Resources")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#Adding the macOS glue for ROM paths
|
||||||
|
set(MAC_GLUE)
|
||||||
|
if (APPLE)
|
||||||
|
set(MAC_GLUE ${CMAKE_CURRENT_SOURCE_DIR}/mac/macOSXGlue.m)
|
||||||
|
endif()
|
||||||
|
|
||||||
# WIN32 marks us as a GUI app on Windows
|
# WIN32 marks us as a GUI app on Windows
|
||||||
# MACOSX_BUNDLE prepares a macOS application bundle including with the app icon
|
# MACOSX_BUNDLE prepares a macOS application bundle including with the app icon
|
||||||
add_executable(86Box WIN32 MACOSX_BUNDLE 86box.c config.c log.c random.c timer.c io.c acpi.c apm.c
|
add_executable(86Box WIN32 MACOSX_BUNDLE 86box.c config.c log.c random.c timer.c io.c acpi.c apm.c
|
||||||
dma.c ddma.c nmi.c pic.c pit.c port_6x.c port_92.c ppi.c pci.c mca.c usb.c
|
dma.c ddma.c nmi.c pic.c pit.c port_6x.c port_92.c ppi.c pci.c mca.c usb.c
|
||||||
device.c nvr.c nvr_at.c nvr_ps2.c ${APP_ICON_MACOSX})
|
device.c nvr.c nvr_at.c nvr_ps2.c ${APP_ICON_MACOSX} ${MAC_GLUE})
|
||||||
|
|
||||||
if(NEW_DYNAREC)
|
if(NEW_DYNAREC)
|
||||||
add_compile_definitions(USE_NEW_DYNAREC)
|
add_compile_definitions(USE_NEW_DYNAREC)
|
||||||
@@ -187,7 +196,6 @@ endif()
|
|||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(APPS ${CMAKE_CURRENT_BINARY_DIR}/86Box.app)
|
set(APPS ${CMAKE_CURRENT_BINARY_DIR}/86Box.app)
|
||||||
install(CODE "
|
install(CODE "
|
||||||
include(InstallRequiredSystemLibraries)
|
|
||||||
include(BundleUtilities)
|
include(BundleUtilities)
|
||||||
fixup_bundle(\"${APPS}\" \"\" \"\")"
|
fixup_bundle(\"${APPS}\" \"\" \"\")"
|
||||||
COMPONENT Runtime)
|
COMPONENT Runtime)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#define BIOS_GD5401_PATH "roms/video/cirruslogic/avga1.rom"
|
#define BIOS_GD5401_PATH "roms/video/cirruslogic/avga1.rom"
|
||||||
#define BIOS_GD5402_PATH "roms/video/cirruslogic/avga2.rom"
|
#define BIOS_GD5402_PATH "roms/video/cirruslogic/avga2.rom"
|
||||||
#define BIOS_GD5402_ONBOARD_PATH "roms/machines/cbm_sl386sx25/c000.rom"
|
#define BIOS_GD5402_ONBOARD_PATH "roms/machines/cmdsl386sx25/c000.rom"
|
||||||
#define BIOS_GD5420_PATH "roms/video/cirruslogic/5420.vbi"
|
#define BIOS_GD5420_PATH "roms/video/cirruslogic/5420.vbi"
|
||||||
#define BIOS_GD5422_PATH "roms/video/cirruslogic/cl5422.bin"
|
#define BIOS_GD5422_PATH "roms/video/cirruslogic/cl5422.bin"
|
||||||
#define BIOS_GD5426_DIAMOND_A1_ISA_PATH "roms/video/cirruslogic/diamond5426.bin"
|
#define BIOS_GD5426_DIAMOND_A1_ISA_PATH "roms/video/cirruslogic/diamond5426.bin"
|
||||||
|
|||||||
@@ -1270,6 +1270,9 @@ ui_init(int nCmdShow)
|
|||||||
tdconfig.pButtons = tdbuttons;
|
tdconfig.pButtons = tdbuttons;
|
||||||
tdconfig.pfCallback = TaskDialogProcedure;
|
tdconfig.pfCallback = TaskDialogProcedure;
|
||||||
|
|
||||||
|
/* Load the desired iconset */
|
||||||
|
win_load_icon_set();
|
||||||
|
|
||||||
/* Start settings-only mode if requested. */
|
/* Start settings-only mode if requested. */
|
||||||
if (settings_only) {
|
if (settings_only) {
|
||||||
if (! pc_init_modules()) {
|
if (! pc_init_modules()) {
|
||||||
@@ -1404,9 +1407,6 @@ ui_init(int nCmdShow)
|
|||||||
ResetAllMenus();
|
ResetAllMenus();
|
||||||
media_menu_init();
|
media_menu_init();
|
||||||
|
|
||||||
/* Load the desired iconset */
|
|
||||||
win_load_icon_set();
|
|
||||||
|
|
||||||
/* Make the window visible on the screen. */
|
/* Make the window visible on the screen. */
|
||||||
ShowWindow(hwnd, nCmdShow);
|
ShowWindow(hwnd, nCmdShow);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user