Merge branch 'master' of https://github.com/laciba96/86Box
This commit is contained in:
@@ -9,15 +9,32 @@
|
|||||||
# CMake build script.
|
# CMake build script.
|
||||||
#
|
#
|
||||||
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
|
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
|
||||||
|
# dob205
|
||||||
#
|
#
|
||||||
# Copyright 2020,2021 David Hrdlička.
|
# Copyright 2020,2021 David Hrdlička.
|
||||||
|
# Copyright 2021 dob205.
|
||||||
#
|
#
|
||||||
|
|
||||||
# WIN32 marks us as a GUI app on Windows
|
# Prepare the macOS app bundle icon depending on the release channel
|
||||||
add_executable(86Box WIN32 86box.c config.c random.c timer.c io.c acpi.c apm.c
|
if(RELEASE_BUILD)
|
||||||
dma.c ddma.c nmi.c pic.c pit.c port_92.c ppi.c pci.c mca.c usb.c
|
set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/release/86Box.icns)
|
||||||
device.c nvr.c nvr_at.c nvr_ps2.c)
|
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")
|
||||||
|
|
||||||
|
# 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 random.c timer.c io.c acpi.c apm.c
|
||||||
|
dma.c ddma.c nmi.c pic.c pit.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})
|
||||||
|
|
||||||
if(NEW_DYNAREC)
|
if(NEW_DYNAREC)
|
||||||
add_compile_definitions(USE_NEW_DYNAREC)
|
add_compile_definitions(USE_NEW_DYNAREC)
|
||||||
endif()
|
endif()
|
||||||
@@ -63,13 +80,41 @@ if(MINGW)
|
|||||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".dll.a")
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".dll.a")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
#some macOS specific configuration steps
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
# Force using the newest library if it's installed by homebrew
|
# 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
|
||||||
|
set(CMAKE_MACOSX_BUNDLE 1)
|
||||||
|
|
||||||
|
# setting our compilation target to macOS Mojave (macOS version 10.14), can be eventually changed to macOS 10.13 High Sierra
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
|
||||||
|
|
||||||
|
# set the Info.plist properly
|
||||||
|
set_target_properties(86Box PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/Info.plist.in)
|
||||||
|
set(MACOSX_BUNDLE_GUI_IDENTIFIER net.86Box.86Box)
|
||||||
|
set(MACOSX_BUNDLE_BUNDLE_NAME 86Box)
|
||||||
|
set(MACOSX_BUNDLE_BUNDLE_VERSION 3.0)
|
||||||
|
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "3.0")
|
||||||
|
set(MACOSX_BUNDLE_LONG_VERSION_STRING "3.0.0")
|
||||||
|
set(MACOSX_BUNDLE_ICON_FILE 86Box.icns)
|
||||||
|
set(MACOSX_BUNDLE_INFO_STRING "A emulator of old computers")
|
||||||
|
set(MACOSX_BUNDLE_COPYRIGHT "© 2007-2021 Sarah Walker, Miran Grča, Fred N. van Kempen (waltje), SA1988, MoochMcGee, reenigne, leilei, JohnElliott, greatpsycho, and others")
|
||||||
|
|
||||||
|
|
||||||
|
# preparing the code signing for easier distribution, Apple dev certificate needed at one point
|
||||||
|
#set(XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES")
|
||||||
|
#set(XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-")
|
||||||
|
#set(XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${CMAKE_CURRENT_SOURCE_DIR}/mac/codesign/dev/app.entitlements)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Freetype REQUIRED)
|
find_package(Freetype REQUIRED)
|
||||||
include_directories(${FREETYPE_INCLUDE_DIRS})
|
include_directories(${FREETYPE_INCLUDE_DIRS})
|
||||||
|
if(APPLE)
|
||||||
|
target_link_libraries(86Box Freetype::Freetype) # bundles freetype for the macOS app bundle
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(OpenAL REQUIRED)
|
find_package(OpenAL REQUIRED)
|
||||||
include_directories(${OPENAL_INCLUDE_DIR})
|
include_directories(${OPENAL_INCLUDE_DIR})
|
||||||
@@ -119,7 +164,23 @@ if(MINITRACE)
|
|||||||
target_link_libraries(86Box minitrace)
|
target_link_libraries(86Box minitrace)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS 86Box)
|
if(APPLE)
|
||||||
|
install(TARGETS 86Box DESTINATION "bin")
|
||||||
|
else()
|
||||||
|
install(TARGETS 86Box)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# adjustments for macOS app bundles
|
||||||
|
if(APPLE)
|
||||||
|
set(APPS ${CMAKE_CURRENT_BINARY_DIR}/86Box.app)
|
||||||
|
install(CODE "
|
||||||
|
include(InstallRequiredSystemLibraries)
|
||||||
|
include(BundleUtilities)
|
||||||
|
fixup_bundle(\"${APPS}\" \"\" \"\")"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(VCPKG_TOOLCHAIN)
|
if(VCPKG_TOOLCHAIN)
|
||||||
x_vcpkg_install_local_dependencies(TARGETS 86Box DESTINATION "bin")
|
x_vcpkg_install_local_dependencies(TARGETS 86Box DESTINATION "bin")
|
||||||
endif()
|
endif()
|
||||||
|
@@ -497,7 +497,7 @@ fdd_load(int drive, char *fn)
|
|||||||
while (loaders[c].ext) {
|
while (loaders[c].ext) {
|
||||||
if (!strcasecmp(p, (char *) loaders[c].ext) && (size == loaders[c].size || loaders[c].size == -1)) {
|
if (!strcasecmp(p, (char *) loaders[c].ext) && (size == loaders[c].size || loaders[c].size == -1)) {
|
||||||
driveloaders[drive] = c;
|
driveloaders[drive] = c;
|
||||||
strcpy(floppyfns[drive], fn);
|
if (floppyfns[drive] != fn) strcpy(floppyfns[drive], fn);
|
||||||
d86f_setup(drive);
|
d86f_setup(drive);
|
||||||
loaders[c].load(drive, floppyfns[drive]);
|
loaders[c].load(drive, floppyfns[drive]);
|
||||||
drive_empty[drive] = 0;
|
drive_empty[drive] = 0;
|
||||||
|
@@ -129,6 +129,7 @@ extern void do_start(void);
|
|||||||
extern void do_stop(void);
|
extern void do_stop(void);
|
||||||
|
|
||||||
/* Internal platform support functions. */
|
/* Internal platform support functions. */
|
||||||
|
extern int has_language_changed(int id);
|
||||||
extern void set_language(int id);
|
extern void set_language(int id);
|
||||||
extern int get_vidpause(void);
|
extern int get_vidpause(void);
|
||||||
extern void show_cursor(int);
|
extern void show_cursor(int);
|
||||||
|
38
src/mac/Info.plist.in
Normal file
38
src/mac/Info.plist.in
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>English</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||||
|
<key>CFBundleGetInfoString</key>
|
||||||
|
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleLongVersionString</key>
|
||||||
|
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||||
|
<key>CSResourcesFileMapped</key>
|
||||||
|
<true/>
|
||||||
|
<key>NSHumanReadableCopyright</key>
|
||||||
|
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||||
|
<key>NSPrincipalClass</key>
|
||||||
|
<string>NSApplication</string>
|
||||||
|
<key>NSHighResolutionCapable</key>
|
||||||
|
<string>True</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
BIN
src/mac/icons/beta/86Box.icns
Normal file
BIN
src/mac/icons/beta/86Box.icns
Normal file
Binary file not shown.
BIN
src/mac/icons/branch/86Box.icns
Normal file
BIN
src/mac/icons/branch/86Box.icns
Normal file
Binary file not shown.
BIN
src/mac/icons/dev/86Box.icns
Normal file
BIN
src/mac/icons/dev/86Box.icns
Normal file
Binary file not shown.
BIN
src/mac/icons/release/86Box.icns
Normal file
BIN
src/mac/icons/release/86Box.icns
Normal file
Binary file not shown.
@@ -74,16 +74,16 @@ volatile int cpu_thread_run = 1;
|
|||||||
|
|
||||||
/* Local data. */
|
/* Local data. */
|
||||||
static HANDLE thMain;
|
static HANDLE thMain;
|
||||||
static rc_str_t *lpRCstr2048,
|
static rc_str_t *lpRCstr2048 = NULL,
|
||||||
*lpRCstr4096,
|
*lpRCstr4096 = NULL,
|
||||||
*lpRCstr4352,
|
*lpRCstr4352 = NULL,
|
||||||
*lpRCstr4608,
|
*lpRCstr4608 = NULL,
|
||||||
*lpRCstr5120,
|
*lpRCstr5120 = NULL,
|
||||||
*lpRCstr5376,
|
*lpRCstr5376 = NULL,
|
||||||
*lpRCstr5632,
|
*lpRCstr5632 = NULL,
|
||||||
*lpRCstr5888,
|
*lpRCstr5888 = NULL,
|
||||||
*lpRCstr6144,
|
*lpRCstr6144 = NULL,
|
||||||
*lpRCstr7168;
|
*lpRCstr7168 = NULL;
|
||||||
static int vid_api_inited = 0;
|
static int vid_api_inited = 0;
|
||||||
static char *argbuf;
|
static char *argbuf;
|
||||||
static int first_use = 1;
|
static int first_use = 1;
|
||||||
@@ -139,11 +139,31 @@ win_log(const char *fmt, ...)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
free_string(rc_str_t **str)
|
||||||
|
{
|
||||||
|
if (*str != NULL) {
|
||||||
|
free(*str);
|
||||||
|
*str = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
LoadCommonStrings(void)
|
LoadCommonStrings(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
free_string(&lpRCstr7168);
|
||||||
|
free_string(&lpRCstr6144);
|
||||||
|
free_string(&lpRCstr5888);
|
||||||
|
free_string(&lpRCstr5632);
|
||||||
|
free_string(&lpRCstr5376);
|
||||||
|
free_string(&lpRCstr5120);
|
||||||
|
free_string(&lpRCstr4608);
|
||||||
|
free_string(&lpRCstr4352);
|
||||||
|
free_string(&lpRCstr4096);
|
||||||
|
free_string(&lpRCstr2048);
|
||||||
|
|
||||||
lpRCstr2048 = (rc_str_t *)malloc(STR_NUM_2048*sizeof(rc_str_t));
|
lpRCstr2048 = (rc_str_t *)malloc(STR_NUM_2048*sizeof(rc_str_t));
|
||||||
lpRCstr4096 = (rc_str_t *)malloc(STR_NUM_4096*sizeof(rc_str_t));
|
lpRCstr4096 = (rc_str_t *)malloc(STR_NUM_4096*sizeof(rc_str_t));
|
||||||
lpRCstr4352 = (rc_str_t *)malloc(STR_NUM_4352*sizeof(rc_str_t));
|
lpRCstr4352 = (rc_str_t *)malloc(STR_NUM_4352*sizeof(rc_str_t));
|
||||||
@@ -221,6 +241,15 @@ size_t c16stombs(char dst[], const uint16_t src[], int len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
has_language_changed(int id)
|
||||||
|
{
|
||||||
|
LCID lcidNew = MAKELCID(id, dwSubLangID);
|
||||||
|
|
||||||
|
return (lang_id != lcidNew);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Set (or re-set) the language for the application. */
|
/* Set (or re-set) the language for the application. */
|
||||||
void
|
void
|
||||||
set_language(int id)
|
set_language(int id)
|
||||||
|
@@ -77,6 +77,9 @@
|
|||||||
static int first_cat = 0;
|
static int first_cat = 0;
|
||||||
static int dpi = 96;
|
static int dpi = 96;
|
||||||
|
|
||||||
|
/* Language */
|
||||||
|
static int temp_language;
|
||||||
|
|
||||||
/* Machine category */
|
/* Machine category */
|
||||||
static int temp_machine_type, temp_machine, temp_cpu, temp_wait_states, temp_fpu, temp_sync;
|
static int temp_machine_type, temp_machine, temp_cpu, temp_wait_states, temp_fpu, temp_sync;
|
||||||
static cpu_family_t *temp_cpu_f;
|
static cpu_family_t *temp_cpu_f;
|
||||||
@@ -322,6 +325,9 @@ win_settings_init(void)
|
|||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
/* Language */
|
||||||
|
// TODO: Set temp_language here.
|
||||||
|
|
||||||
/* Machine category */
|
/* Machine category */
|
||||||
temp_machine_type = machines[machine].type;
|
temp_machine_type = machines[machine].type;
|
||||||
temp_machine = machine;
|
temp_machine = machine;
|
||||||
@@ -447,6 +453,9 @@ win_settings_changed(void)
|
|||||||
{
|
{
|
||||||
int i = 0, j = 0;
|
int i = 0, j = 0;
|
||||||
|
|
||||||
|
/* Language */
|
||||||
|
// i = i || has_language_changed(temp_language);
|
||||||
|
|
||||||
/* Machine category */
|
/* Machine category */
|
||||||
i = i || (machine != temp_machine);
|
i = i || (machine != temp_machine);
|
||||||
i = i || (cpu_f != temp_cpu_f);
|
i = i || (cpu_f != temp_cpu_f);
|
||||||
@@ -537,6 +546,9 @@ win_settings_save(void)
|
|||||||
|
|
||||||
pc_reset_hard_close();
|
pc_reset_hard_close();
|
||||||
|
|
||||||
|
/* Language */
|
||||||
|
// set_language(temp_language);
|
||||||
|
|
||||||
/* Machine category */
|
/* Machine category */
|
||||||
machine = temp_machine;
|
machine = temp_machine;
|
||||||
cpu_f = temp_cpu_f;
|
cpu_f = temp_cpu_f;
|
||||||
|
Reference in New Issue
Block a user