From 8820a60e019e809411e999c7d6b36e07e970a112 Mon Sep 17 00:00:00 2001 From: dob205 Date: Fri, 19 Nov 2021 13:40:35 +0100 Subject: [PATCH 1/4] 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); } From 469a9d0b7a5a9ad4f5140761868b5867a5dc6df6 Mon Sep 17 00:00:00 2001 From: dob205 Date: Fri, 19 Nov 2021 13:44:53 +0100 Subject: [PATCH 2/4] Adds the macOSXglue.m into the compilation process Enables to get the macOSXglue up and running while compiling 86Box on macOS, also executes some functions related to macOS now not on Windows and Linux anymore --- src/CMakeLists.txt | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fde99e3f0..1acfa8260 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,24 +16,33 @@ # # Prepare the macOS app bundle icon depending on the release channel -if(RELEASE_BUILD) - set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/release/86Box.icns) -elseif(BETA_BUILD) - set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/beta/86Box.icns) -elseif(ALPHA_BUILD) - set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/dev/86Box.icns) -else() - set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/branch/86Box.icns) -endif() +set(APP_ICON_MACOSX) +if (APPLE) + if(RELEASE_BUILD) + set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/release/86Box.icns) + elseif(BETA_BUILD) + set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/beta/86Box.icns) + elseif(ALPHA_BUILD) + set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/dev/86Box.icns) + else() + set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/branch/86Box.icns) + endif() set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES 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 # 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 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) add_compile_definitions(USE_NEW_DYNAREC) @@ -184,7 +193,6 @@ endif() if(APPLE) set(APPS ${CMAKE_CURRENT_BINARY_DIR}/86Box.app) install(CODE " - include(InstallRequiredSystemLibraries) include(BundleUtilities) fixup_bundle(\"${APPS}\" \"\" \"\")" COMPONENT Runtime) From d5086701c28d12115418b9e946cbf2db66cfafa2 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 19 Nov 2021 15:08:22 +0100 Subject: [PATCH 3/4] Moved the call to win_load_icon_set(), should fix the bug of no icon in the Settings dialog in the Settings-only mode, closes #1844. --- src/win/win_ui.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win/win_ui.c b/src/win/win_ui.c index e5ab4958c..60d63b99e 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -1270,6 +1270,9 @@ ui_init(int nCmdShow) tdconfig.pButtons = tdbuttons; tdconfig.pfCallback = TaskDialogProcedure; + /* Load the desired iconset */ + win_load_icon_set(); + /* Start settings-only mode if requested. */ if (settings_only) { if (! pc_init_modules()) { @@ -1404,9 +1407,6 @@ ui_init(int nCmdShow) ResetAllMenus(); media_menu_init(); - /* Load the desired iconset */ - win_load_icon_set(); - /* Make the window visible on the screen. */ ShowWindow(hwnd, nCmdShow); From 3cdcf010f2adcfa212ee9260a3ab4f37723dc470 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 19 Nov 2021 15:26:32 +0100 Subject: [PATCH 4/4] Fixed the Commodore 386X-25 on-board CL-GD 5402 ROM path. --- src/video/vid_cl54xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index 3055de90a..6cc24affa 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -42,7 +42,7 @@ #define BIOS_GD5401_PATH "roms/video/cirruslogic/avga1.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_GD5422_PATH "roms/video/cirruslogic/cl5422.bin" #define BIOS_GD5426_DIAMOND_A1_ISA_PATH "roms/video/cirruslogic/diamond5426.bin"