diff --git a/src/emucore/Cart3EPlus.cxx b/src/emucore/Cart3EPlus.cxx index 553388ae8..dd8a8d719 100644 --- a/src/emucore/Cart3EPlus.cxx +++ b/src/emucore/Cart3EPlus.cxx @@ -266,7 +266,7 @@ bool Cartridge3EPlus::patch(uInt16 address, uInt8 value) myBankChanged = true; uInt32 bankNumber = (address >> RAM_BANK_TO_POWER) & 7; // now 512 byte bank # (ie: 0-7) - Int16 whichBankIsThere = bankInUse[bankNumber]; // ROM or RAM bank reference + uInt16 whichBankIsThere = bankInUse[bankNumber]; // ROM or RAM bank reference if (whichBankIsThere == BANK_UNDEFINED) { diff --git a/src/macos/.gitignore b/src/macos/.gitignore new file mode 100644 index 000000000..a868e2622 --- /dev/null +++ b/src/macos/.gitignore @@ -0,0 +1 @@ +M6502.ins diff --git a/src/macos/AboutBox.h b/src/macos/AboutBox.h index 27eb9a666..e1df45d55 100644 --- a/src/macos/AboutBox.h +++ b/src/macos/AboutBox.h @@ -24,16 +24,6 @@ @author Mark Grebe */ @interface AboutBox : NSObject -{ - IBOutlet NSTextField *appNameField; - IBOutlet NSTextView *creditsField; - IBOutlet NSTextField *versionField; - NSTimer *scrollTimer; - CGFloat currentPosition; - CGFloat maxScrollHeight; - NSTimeInterval startTime; - BOOL restartAtTop; -} + (AboutBox *)sharedInstance; - (IBAction)showPanel:(id)sender; diff --git a/src/macos/AboutBox.m b/src/macos/AboutBox.m index cde2dbe67..b83154b2b 100644 --- a/src/macos/AboutBox.m +++ b/src/macos/AboutBox.m @@ -18,6 +18,16 @@ #import "AboutBox.h" @implementation AboutBox +{ + IBOutlet NSTextField *appNameField; + IBOutlet NSTextView *creditsField; + IBOutlet NSTextField *versionField; + NSTimer *scrollTimer; + CGFloat currentPosition; + CGFloat maxScrollHeight; + NSTimeInterval startTime; + BOOL restartAtTop; +} static AboutBox *sharedInstance = nil; diff --git a/src/macos/Preferences.h b/src/macos/Preferences.h index 304ab97f5..144bc0880 100644 --- a/src/macos/Preferences.h +++ b/src/macos/Preferences.h @@ -17,6 +17,10 @@ #import +void prefsSetString(const char* key, const char* value); +void prefsGetString(const char* key, char* value, int size); +void prefsSave(void); + /** Preferences class and support functions for the macOS SDL2 port of Stella. @@ -24,9 +28,6 @@ @author Mark Grebe */ @interface Preferences : NSObject -{ - NSUserDefaults *defaults; /* Defaults pointer */ -} + (Preferences *)sharedInstance; - (void)setString:(const char *)key : (const char *)value; diff --git a/src/macos/Preferences.m b/src/macos/Preferences.m index cd4ee494b..db911397a 100644 --- a/src/macos/Preferences.m +++ b/src/macos/Preferences.m @@ -35,6 +35,9 @@ void prefsSave(void) } @implementation Preferences +{ + NSUserDefaults *defaults; /* Defaults pointer */ +} static Preferences *sharedInstance = nil; diff --git a/src/macos/SDLMain.h b/src/macos/SDLMain.h index c55cb7cad..bbe4f5a0b 100644 --- a/src/macos/SDLMain.h +++ b/src/macos/SDLMain.h @@ -6,8 +6,7 @@ #import @interface SDLMain : NSObject -{ -} + + (SDLMain*) sharedInstance; @end diff --git a/src/macos/English.lproj/InfoPlist.strings b/src/macos/en.lproj/InfoPlist.strings similarity index 100% rename from src/macos/English.lproj/InfoPlist.strings rename to src/macos/en.lproj/InfoPlist.strings diff --git a/src/macos/stella.xcodeproj/project.pbxproj b/src/macos/stella.xcodeproj/project.pbxproj index cc014f273..6d07b68d0 100644 --- a/src/macos/stella.xcodeproj/project.pbxproj +++ b/src/macos/stella.xcodeproj/project.pbxproj @@ -915,7 +915,6 @@ 2DEFB40B09C3386F00754289 /* Cart.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Cart.icns; sourceTree = SOURCE_ROOT; }; 2DF971D70892CEA400F64D23 /* DebuggerSystem.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = DebuggerSystem.hxx; sourceTree = ""; }; 2DF971DF0892CEA400F64D23 /* Expression.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = Expression.hxx; sourceTree = ""; }; - 55FE2A3D1EE487CA00078ADE /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; B2F367C504C7ADC700A80002 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = SDLMain.nib; sourceTree = ""; }; CFE3F6071E84A9A200A8204E /* CartBUSWidget.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CartBUSWidget.cxx; sourceTree = ""; }; CFE3F6081E84A9A200A8204E /* CartBUSWidget.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CartBUSWidget.hxx; sourceTree = ""; }; @@ -1358,6 +1357,7 @@ E0306E0B1F93E916003DDD52 /* JitterEmulation.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JitterEmulation.hxx; sourceTree = ""; }; E034A5EC209FB25C00C89E9E /* EmulationTiming.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmulationTiming.cxx; sourceTree = ""; }; E034A5ED209FB25C00C89E9E /* EmulationTiming.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = EmulationTiming.hxx; sourceTree = ""; }; + E07C2326226393BD00B78631 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; E0893AF0211B9841008B170D /* HighPass.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HighPass.cxx; path = audio/HighPass.cxx; sourceTree = ""; }; E0893AF1211B9841008B170D /* HighPass.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = HighPass.hxx; path = audio/HighPass.hxx; sourceTree = ""; }; E09F4139201E901C004A3391 /* AudioQueue.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = AudioQueue.hxx; sourceTree = ""; }; @@ -2636,13 +2636,14 @@ }; buildConfigurationList = 2D91752109BA903B0026E9FF /* Build configuration list for PBXProject "stella" */; compatibilityVersion = "Xcode 10.0"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + de, + ja, + en, + fr, + Base, ); mainGroup = 29B97314FDCFA39411CA2CEA /* Stella */; projectDirPath = ""; @@ -3001,7 +3002,7 @@ 55FE2A3C1EE487CA00078ADE /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 55FE2A3D1EE487CA00078ADE /* English */, + E07C2326226393BD00B78631 /* en */, ); name = InfoPlist.strings; sourceTree = ""; @@ -3119,8 +3120,12 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "c++14"; + CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES; + CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_WARN_ATOMIC_IMPLICIT_SEQ_CST = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; @@ -3129,13 +3134,21 @@ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_FLOAT_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_INTERFACE_IVARS = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -3153,12 +3166,20 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_VERSION = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_PEDANTIC = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_PARAMETER = NO; GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_PATH = "@rpath"; @@ -3176,8 +3197,12 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "c++14"; + CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES; + CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_WARN_ATOMIC_IMPLICIT_SEQ_CST = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; @@ -3186,13 +3211,21 @@ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_FLOAT_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_INTERFACE_IVARS = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -3208,12 +3241,20 @@ GCC_OPTIMIZATION_LEVEL = 3; GCC_VERSION = ""; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_PEDANTIC = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_STRICT_SELECTOR_MATCH = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_PARAMETER = NO; GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_PATH = "@rpath";