From 76b797058956a7348485836deccaece88d7199bc Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Thu, 26 Dec 2019 21:41:44 +0100 Subject: [PATCH] osx: xcode 11 / swift 5 --- core/linux/posix_vmem.cpp | 5 +- .../AppIcon.appiconset/Contents.json | 40 ++++++++ .../emulator-osx/emulator-osx/EmuGLView.swift | 12 +-- .../reicast-osx.xcodeproj/project.pbxproj | 33 +++++-- .../xcschemes/reicast-osx-naomi.xcscheme | 93 ------------------- 5 files changed, 75 insertions(+), 108 deletions(-) delete mode 100644 shell/apple/emulator-osx/reicast-osx.xcodeproj/xcshareddata/xcschemes/reicast-osx-naomi.xcscheme diff --git a/core/linux/posix_vmem.cpp b/core/linux/posix_vmem.cpp index e5f842b2c..445c8c4d9 100644 --- a/core/linux/posix_vmem.cpp +++ b/core/linux/posix_vmem.cpp @@ -64,7 +64,10 @@ bool mem_region_set_exec(void *start, size_t len) { size_t inpage = (uintptr_t)start & PAGE_MASK; if (mprotect((u8*)start - inpage, len + inpage, PROT_READ | PROT_WRITE | PROT_EXEC)) - die("mprotect failed..."); + { + WARN_LOG(VMEM, "mem_region_set_exec: mprotect failed. errno %d", errno); + return false; + } return true; } diff --git a/shell/apple/emulator-ios/reicast-ios/Images.xcassets/AppIcon.appiconset/Contents.json b/shell/apple/emulator-ios/reicast-ios/Images.xcassets/AppIcon.appiconset/Contents.json index 4f2fbe899..186cfc53d 100644 --- a/shell/apple/emulator-ios/reicast-ios/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/shell/apple/emulator-ios/reicast-ios/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,15 +1,35 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, { "size" : "60x60", "idiom" : "iphone", @@ -21,6 +41,16 @@ "size" : "60x60", "scale" : "3x" }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "idiom" : "ipad", "size" : "29x29", @@ -51,6 +81,16 @@ "idiom" : "ipad", "filename" : "Icon-76@2x.png", "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/shell/apple/emulator-osx/emulator-osx/EmuGLView.swift b/shell/apple/emulator-osx/emulator-osx/EmuGLView.swift index 7efa0e40c..0489dd019 100644 --- a/shell/apple/emulator-osx/emulator-osx/EmuGLView.swift +++ b/shell/apple/emulator-osx/emulator-osx/EmuGLView.swift @@ -31,8 +31,8 @@ class EmuGLView: NSOpenGLView, NSWindowDelegate { override func awakeFromNib() { let renderTimer = Timer.scheduledTimer(timeInterval: 0.001, target: self, selector: #selector(EmuGLView.timerTick), userInfo: nil, repeats: true) - RunLoop.current.add(renderTimer, forMode: RunLoopMode.defaultRunLoopMode) - RunLoop.current.add(renderTimer, forMode: RunLoopMode.eventTrackingRunLoopMode) + RunLoop.current.add(renderTimer, forMode: .default) + RunLoop.current.add(renderTimer, forMode: .eventTracking) let attrs:[NSOpenGLPixelFormatAttribute] = [ @@ -42,7 +42,7 @@ class EmuGLView: NSOpenGLView, NSWindowDelegate { // Must specify the 3.2 Core Profile to use OpenGL 3.2 UInt32(NSOpenGLPFAOpenGLProfile), UInt32(NSOpenGLProfileVersion3_2Core), - UInt32(NSOpenGLPFABackingStore), UInt32(true), + UInt32(NSOpenGLPFABackingStore), UInt32(truncating: true), UInt32(0) ] @@ -65,7 +65,7 @@ class EmuGLView: NSOpenGLView, NSWindowDelegate { } - func timerTick() { + @objc func timerTick() { if (emu_frame_pending()) { self.needsDisplay = true @@ -75,13 +75,13 @@ class EmuGLView: NSOpenGLView, NSWindowDelegate { override func keyDown(with e: NSEvent) { if (!e.isARepeat) { - emu_key_input(e.keyCode, true, UInt32(e.modifierFlags.rawValue & NSDeviceIndependentModifierFlagsMask.rawValue)) + emu_key_input(e.keyCode, true, UInt32(e.modifierFlags.rawValue & NSEvent.ModifierFlags.deviceIndependentFlagsMask.rawValue)) } emu_character_input(e.characters) } override func keyUp(with e: NSEvent) { - emu_key_input(e.keyCode, false, UInt32(e.modifierFlags.rawValue & NSDeviceIndependentModifierFlagsMask.rawValue)) + emu_key_input(e.keyCode, false, UInt32(e.modifierFlags.rawValue & NSEvent.ModifierFlags.deviceIndependentFlagsMask.rawValue)) } private func setMousePos(_ event: NSEvent) diff --git a/shell/apple/emulator-osx/reicast-osx.xcodeproj/project.pbxproj b/shell/apple/emulator-osx/reicast-osx.xcodeproj/project.pbxproj index 8eeb155e6..40a4c0d5f 100644 --- a/shell/apple/emulator-osx/reicast-osx.xcodeproj/project.pbxproj +++ b/shell/apple/emulator-osx/reicast-osx.xcodeproj/project.pbxproj @@ -2583,6 +2583,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -3056,6 +3057,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -3108,6 +3110,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.9; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -3117,6 +3120,8 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; + ENABLE_HARDENED_RUNTIME = NO; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -3154,7 +3159,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.flyinghead.Flycast; PRODUCT_NAME = "$(REI_APP_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "emulator-osx/emulator-osx-Bridging-Header.h"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -3164,6 +3169,8 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; + ENABLE_HARDENED_RUNTIME = NO; GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; "GCC_PREPROCESSOR_DEFINITIONS[arch=i386]" = ( TARGET_OSX, @@ -3196,8 +3203,9 @@ ); OTHER_LIBTOOLFLAGS = ""; PRODUCT_NAME = "$(REI_APP_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "emulator-osx/emulator-osx-Bridging-Header.h"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -3207,6 +3215,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", @@ -3218,7 +3227,7 @@ INFOPLIST_FILE = "emulator-osxTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "reicast-osxTests"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/reicast-osx.app/Contents/MacOS/reicast-osx"; }; name = Debug; @@ -3229,6 +3238,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", @@ -3236,7 +3246,7 @@ INFOPLIST_FILE = "emulator-osxTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "reicast-osxTests"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/reicast-osx.app/Contents/MacOS/reicast-osx"; }; name = Release; @@ -3291,6 +3301,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; }; name = DebugNaomi; }; @@ -3300,6 +3311,8 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; + ENABLE_HARDENED_RUNTIME = NO; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -3337,7 +3350,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.flyinghead.Flycast; PRODUCT_NAME = "$(REI_APP_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "emulator-osx/emulator-osx-Bridging-Header.h"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = DebugNaomi; }; @@ -3347,6 +3360,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", @@ -3358,7 +3372,7 @@ INFOPLIST_FILE = "emulator-osxTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "reicast-osxTests"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/reicast-osx.app/Contents/MacOS/reicast-osx"; }; name = DebugNaomi; @@ -3411,6 +3425,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.9; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; + SWIFT_VERSION = 5.0; }; name = ReleaseNaomi; }; @@ -3420,6 +3435,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; + ENABLE_HARDENED_RUNTIME = NO; GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; "GCC_PREPROCESSOR_DEFINITIONS[arch=i386]" = ( TARGET_OSX, @@ -3453,7 +3469,7 @@ OTHER_LIBTOOLFLAGS = ""; PRODUCT_NAME = "$(REI_APP_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "emulator-osx/emulator-osx-Bridging-Header.h"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = ReleaseNaomi; }; @@ -3463,6 +3479,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", @@ -3470,7 +3487,7 @@ INFOPLIST_FILE = "emulator-osxTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "reicast-osxTests"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/reicast-osx.app/Contents/MacOS/reicast-osx"; }; name = ReleaseNaomi; diff --git a/shell/apple/emulator-osx/reicast-osx.xcodeproj/xcshareddata/xcschemes/reicast-osx-naomi.xcscheme b/shell/apple/emulator-osx/reicast-osx.xcodeproj/xcshareddata/xcschemes/reicast-osx-naomi.xcscheme deleted file mode 100644 index 4b1af4cc1..000000000 --- a/shell/apple/emulator-osx/reicast-osx.xcodeproj/xcshareddata/xcschemes/reicast-osx-naomi.xcscheme +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -