From 4e5e3377f1cfead70e31170a644f1158fe7d35ce Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Tue, 12 Sep 2017 18:35:24 -0400 Subject: [PATCH] Perf: re-enable VOSF on Xcode-made, OSX-host builds --- .../src/MacOSX/BasiliskII.xcodeproj/project.pbxproj | 2 ++ BasiliskII/src/MacOSX/config.h | 1 + BasiliskII/src/SDL/video_sdl2.cpp | 12 ++---------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/BasiliskII/src/MacOSX/BasiliskII.xcodeproj/project.pbxproj b/BasiliskII/src/MacOSX/BasiliskII.xcodeproj/project.pbxproj index 916f1ad8..8ff0df48 100644 --- a/BasiliskII/src/MacOSX/BasiliskII.xcodeproj/project.pbxproj +++ b/BasiliskII/src/MacOSX/BasiliskII.xcodeproj/project.pbxproj @@ -1316,6 +1316,7 @@ "$(inherited)", "$(LOCAL_LIBRARY_DIR)/Frameworks", ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.basiliskii.BasiliskII; @@ -1332,6 +1333,7 @@ "$(inherited)", "$(LOCAL_LIBRARY_DIR)/Frameworks", ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.basiliskii.BasiliskII; diff --git a/BasiliskII/src/MacOSX/config.h b/BasiliskII/src/MacOSX/config.h index 76393d47..5dbc78ab 100644 --- a/BasiliskII/src/MacOSX/config.h +++ b/BasiliskII/src/MacOSX/config.h @@ -43,6 +43,7 @@ /* Define if using video enabled on SEGV signals. */ /* #undef ENABLE_VOSF */ +#define ENABLE_VOSF 1 /* Define if using XFree86 DGA extension. */ /* #undef ENABLE_XF86_DGA */ diff --git a/BasiliskII/src/SDL/video_sdl2.cpp b/BasiliskII/src/SDL/video_sdl2.cpp index 5c7d5cf8..43b6263e 100644 --- a/BasiliskII/src/SDL/video_sdl2.cpp +++ b/BasiliskII/src/SDL/video_sdl2.cpp @@ -210,9 +210,6 @@ extern void SysMountFirstFloppy(void); static void *vm_acquire_framebuffer(uint32 size) { -#if __MACOSX__ - return calloc(1, size); -#else // always try to reallocate framebuffer at the same address static void *fb = VM_MAP_FAILED; if (fb != VM_MAP_FAILED) { @@ -226,16 +223,11 @@ static void *vm_acquire_framebuffer(uint32 size) if (fb == VM_MAP_FAILED) fb = vm_acquire(size, VM_MAP_DEFAULT | VM_MAP_32BIT); return fb; -#endif } static inline void vm_release_framebuffer(void *fb, uint32 size) { -#if __MACOSX__ - free(fb); -#else vm_release(fb, size); -#endif } static inline int get_customized_color_depth(int default_depth) @@ -696,7 +688,7 @@ static SDL_Surface * init_sdl_video(int width, int height, int bpp, Uint32 flags if (guest_surface) { delete_sdl_video_surfaces(); } - + int window_width = width; int window_height = height; Uint32 window_flags = 0; @@ -961,7 +953,7 @@ void driver_base::init() printf("VOSF acceleration is not profitable on this platform, disabling it\n"); use_vosf = false; } - if (!use_vosf) { + if (!use_vosf) { free(the_buffer_copy); vm_release(the_buffer, the_buffer_size); the_host_buffer = NULL;