diff --git a/Emulator/Base/Aliases.h b/Emulator/Base/Aliases.h index 36abbc7ab..4f5f44f9d 100644 --- a/Emulator/Base/Aliases.h +++ b/Emulator/Base/Aliases.h @@ -41,13 +41,13 @@ typedef u32 Block; // // Converts a certain unit to master cycles -#define USEC(delay) (Cycle)((delay) * 28) -#define MSEC(delay) (Cycle)((delay) * 28000) -#define SEC(delay) (Cycle)((delay) * 28000000) +#define USEC(delay) (Cycle(delay) * 28) +#define MSEC(delay) (Cycle(delay) * 28000) +#define SEC(delay) (Cycle(delay) * 28000000) -#define CPU_CYCLES(cycles) ((Cycle)(cycles) << 2) -#define CIA_CYCLES(cycles) ((Cycle)(cycles) * 40) -#define DMA_CYCLES(cycles) ((Cycle)(cycles) << 3) +#define CPU_CYCLES(cycles) (Cycle(cycles) << 2) +#define CIA_CYCLES(cycles) (Cycle(cycles) * 40) +#define DMA_CYCLES(cycles) (Cycle(cycles) << 3) // Converts master cycles to a certain unit #define AS_USEC(delay) ((delay) / 28) diff --git a/GUI/Dialogs/Inspector/MemoryPanel.swift b/GUI/Dialogs/Inspector/MemoryPanel.swift index 16afc4106..bbfd91e25 100644 --- a/GUI/Dialogs/Inspector/MemoryPanel.swift +++ b/GUI/Dialogs/Inspector/MemoryPanel.swift @@ -46,7 +46,7 @@ extension Inspector { let ptr = mask.bindMemory(to: UInt32.self, capacity: cap) // Create image data - for bank in 0..<256 { + for bank in 0...255 { var color: NSColor var mirror = false @@ -85,12 +85,12 @@ extension Inspector { r = Int(ciBgColor.red * CGFloat(255 - y*c)) g = Int(ciBgColor.green * CGFloat(255 - y*c)) b = Int(ciBgColor.blue * CGFloat(255 - y*c)) - a = Int(ciBgColor.alpha) + a = Int(ciBgColor.alpha * CGFloat(255)) } else { r = Int(ciColor.red * CGFloat(255 - y*c)) g = Int(ciColor.green * CGFloat(255 - y*c)) b = Int(ciColor.blue * CGFloat(255 - y*c)) - a = Int(ciColor.alpha) + a = Int(ciColor.alpha * CGFloat(255)) } let abgr = UInt32(r | g << 8 | b << 16 | a << 24) ptr[y*width + dx] = abgr diff --git a/GUI/Metal/ImageToolbox.swift b/GUI/Metal/ImageToolbox.swift index 61a847fe6..f1e9885ef 100644 --- a/GUI/Metal/ImageToolbox.swift +++ b/GUI/Metal/ImageToolbox.swift @@ -200,7 +200,7 @@ public extension NSImage { static func make(data: UnsafeMutableRawPointer, rect: CGSize) -> NSImage? { guard let cgImage = CGImage.make(data: data, size: rect) else { - warn("Failed to create CGImage.") + warn("Failed to create CGImage") return nil } diff --git a/vAmiga.xcodeproj/project.pbxproj b/vAmiga.xcodeproj/project.pbxproj index d155d0963..81628eb56 100644 --- a/vAmiga.xcodeproj/project.pbxproj +++ b/vAmiga.xcodeproj/project.pbxproj @@ -2549,7 +2549,7 @@ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; @@ -2641,7 +2641,7 @@ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; @@ -2723,6 +2723,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_UNDEFINED_BEHAVIOR_SANITIZER_INTEGER = YES; CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES; CODE_SIGN_ENTITLEMENTS = Resources/vAmiga.entitlements; @@ -2767,6 +2768,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_UNDEFINED_BEHAVIOR_SANITIZER_INTEGER = YES; CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES; CODE_SIGN_ENTITLEMENTS = Resources/vAmiga.entitlements;