diff --git a/Ample.xcodeproj/project.pbxproj b/Ample.xcodeproj/project.pbxproj index 28d3b21..e4e14ae 100644 --- a/Ample.xcodeproj/project.pbxproj +++ b/Ample.xcodeproj/project.pbxproj @@ -78,6 +78,12 @@ B63C1BA6250192D800511A71 /* cecm.plist in Resources */ = {isa = PBXBuildFile; fileRef = B63C1B9C250192D800511A71 /* cecm.plist */; }; B63C1BA8250192E600511A71 /* zijini.plist in Resources */ = {isa = PBXBuildFile; fileRef = B63C1BA7250192E600511A71 /* zijini.plist */; }; B63C1BA9250192E600511A71 /* zijini.plist in Resources */ = {isa = PBXBuildFile; fileRef = B63C1BA7250192E600511A71 /* zijini.plist */; }; + B63C1F0B25B143C50016A611 /* CheatSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = B63C1F0925B143C50016A611 /* CheatSheet.xib */; }; + B63C1F0C25B143C50016A611 /* CheatSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = B63C1F0925B143C50016A611 /* CheatSheet.xib */; }; + B63C1F0F25B1447C0016A611 /* CheatSheetWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = B63C1F0E25B1447C0016A611 /* CheatSheetWindowController.m */; }; + B63C1F1025B1447C0016A611 /* CheatSheetWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = B63C1F0E25B1447C0016A611 /* CheatSheetWindowController.m */; }; + B63C1F1225B147E10016A611 /* CheatSheet.html in Resources */ = {isa = PBXBuildFile; fileRef = B63C1F1125B147E10016A611 /* CheatSheet.html */; }; + B63C1F1325B147E10016A611 /* CheatSheet.html in Resources */ = {isa = PBXBuildFile; fileRef = B63C1F1125B147E10016A611 /* CheatSheet.html */; }; B64979C224EF6703008ABD20 /* MediaViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B64979C124EF6703008ABD20 /* MediaViewController.m */; }; B64AF1EE250EC35B00A09B9B /* DiskImages.xib in Resources */ = {isa = PBXBuildFile; fileRef = B64AF1EC250EC35B00A09B9B /* DiskImages.xib */; }; B64AF1EF250EC35B00A09B9B /* DiskImages.xib in Resources */ = {isa = PBXBuildFile; fileRef = B64AF1EC250EC35B00A09B9B /* DiskImages.xib */; }; @@ -303,6 +309,10 @@ B63C1B9B250192D800511A71 /* cec2000.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = cec2000.plist; sourceTree = ""; }; B63C1B9C250192D800511A71 /* cecm.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = cecm.plist; sourceTree = ""; }; B63C1BA7250192E600511A71 /* zijini.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = zijini.plist; sourceTree = ""; }; + B63C1F0A25B143C50016A611 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/CheatSheet.xib; sourceTree = ""; }; + B63C1F0D25B1447C0016A611 /* CheatSheetWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CheatSheetWindowController.h; sourceTree = ""; }; + B63C1F0E25B1447C0016A611 /* CheatSheetWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CheatSheetWindowController.m; sourceTree = ""; }; + B63C1F1125B147E10016A611 /* CheatSheet.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = CheatSheet.html; sourceTree = ""; }; B64979C024EF6703008ABD20 /* MediaViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaViewController.h; sourceTree = ""; }; B64979C124EF6703008ABD20 /* MediaViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MediaViewController.m; sourceTree = ""; }; B64AF1ED250EC35B00A09B9B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/DiskImages.xib; sourceTree = ""; }; @@ -447,6 +457,7 @@ B61099FA24F5F370005CB652 /* uniap2en.plist */, B61099EE24F5F36E005CB652 /* uniap2pt.plist */, B6109A0224F5F371005CB652 /* uniap2ti.plist */, + B63C1F1125B147E10016A611 /* CheatSheet.html */, ); path = Resources; sourceTree = ""; @@ -552,6 +563,8 @@ B6004DEE24FB05D600D38596 /* LogWindowController.m */, B66236A724FD9A34006CABD7 /* PreferencesWindowController.h */, B66236A824FD9A34006CABD7 /* PreferencesWindowController.m */, + B63C1F0D25B1447C0016A611 /* CheatSheetWindowController.h */, + B63C1F0E25B1447C0016A611 /* CheatSheetWindowController.m */, ); name = "Window Controllers"; sourceTree = ""; @@ -569,6 +582,7 @@ B6D6DE3724FAC8B500661A5F /* Preferences.xib */, B61099E324F5F230005CB652 /* SlotView.xib */, B64AF1EC250EC35B00A09B9B /* DiskImages.xib */, + B63C1F0925B143C50016A611 /* CheatSheet.xib */, ); name = Nibs; sourceTree = ""; @@ -740,6 +754,7 @@ B6DDECCE2505A86E0093587A /* eject-16x16@3x.png in Resources */, B64AF1EE250EC35B00A09B9B /* DiskImages.xib in Resources */, B6109A3B24F5F377005CB652 /* apple2gsr1.plist in Resources */, + B63C1F1225B147E10016A611 /* CheatSheet.html in Resources */, B63C1B9625008A2700511A71 /* DownloadWindow.xib in Resources */, B6D6DE3B24FACF4F00661A5F /* Defaults.plist in Resources */, B6109A2224F5F377005CB652 /* models.plist in Resources */, @@ -759,6 +774,7 @@ B6D6DE3924FAC8B500661A5F /* Preferences.xib in Resources */, B6109A2924F5F377005CB652 /* apple2gs.plist in Resources */, B6109A1F24F5F377005CB652 /* apple2jp.plist in Resources */, + B63C1F0B25B143C50016A611 /* CheatSheet.xib in Resources */, B6109A3024F5F377005CB652 /* apple2.plist in Resources */, B6109A2D24F5F377005CB652 /* prav8m.plist in Resources */, ); @@ -787,6 +803,7 @@ B6E4B5C724FDE2670094A35C /* am100.plist in Resources */, B6E4B5C824FDE2670094A35C /* laser2c.plist in Resources */, B6DDECC125057A550093587A /* drag-handle-4x10.png in Resources */, + B63C1F0C25B143C50016A611 /* CheatSheet.xib in Resources */, B6E4B5C924FDE2670094A35C /* laser128.plist in Resources */, B6E4B5CA24FDE2670094A35C /* apple2ep.plist in Resources */, B6DDECCD2505A86E0093587A /* eject-16x16@2x.png in Resources */, @@ -831,6 +848,7 @@ B6E4B5EA24FDE2670094A35C /* apple3.plist in Resources */, B6E4B5EB24FDE2670094A35C /* apple2ee.plist in Resources */, B6E4B5EC24FDE2670094A35C /* dodo.plist in Resources */, + B63C1F1325B147E10016A611 /* CheatSheet.html in Resources */, B6E4B5ED24FDE2670094A35C /* Preferences.xib in Resources */, B6DDECD72505A86E0093587A /* eject-16x16.png in Resources */, B6E4B5EF24FDE2670094A35C /* apple2gs.plist in Resources */, @@ -869,6 +887,7 @@ B6BA258024E99BE9005FB8FF /* AppDelegate.m in Sources */, B6004DF024FB05D600D38596 /* LogWindowController.m in Sources */, B66236A924FD9A34006CABD7 /* PreferencesWindowController.m in Sources */, + B63C1F0F25B1447C0016A611 /* CheatSheetWindowController.m in Sources */, B64AF1F2250ECB2E00A09B9B /* DiskImagesWindowController.m in Sources */, B64AF1F6250ED5E400A09B9B /* TableCellView.m in Sources */, B63C1B9425008A2700511A71 /* DownloadWindowController.m in Sources */, @@ -883,6 +902,7 @@ B608E1802502FE0C00D53465 /* TransparentScroller.m in Sources */, B64AF1FB250EF6A500A09B9B /* Transformers.m in Sources */, B6E4B5B024FDE2670094A35C /* main.m in Sources */, + B63C1F1025B1447C0016A611 /* CheatSheetWindowController.m in Sources */, B63C1B8C24FF4BF700511A71 /* Ample.m in Sources */, B64AF1F3250ECB2E00A09B9B /* DiskImagesWindowController.m in Sources */, B6B9EA672506A5550080E70D /* EjectButton.m in Sources */, @@ -918,6 +938,14 @@ name = MediaView.xib; sourceTree = ""; }; + B63C1F0925B143C50016A611 /* CheatSheet.xib */ = { + isa = PBXVariantGroup; + children = ( + B63C1F0A25B143C50016A611 /* Base */, + ); + name = CheatSheet.xib; + sourceTree = ""; + }; B64AF1EC250EC35B00A09B9B /* DiskImages.xib */ = { isa = PBXVariantGroup; children = ( diff --git a/Ample/AppDelegate.m b/Ample/AppDelegate.m index a3dcb5a..22e791f 100644 --- a/Ample/AppDelegate.m +++ b/Ample/AppDelegate.m @@ -11,6 +11,7 @@ #import "PreferencesWindowController.h" #import "DownloadWindowController.h" #import "DiskImagesWindowController.h" +#import "CheatSheetWindowController.h" #import "Transformers.h" #import "LogWindowController.h" @@ -25,6 +26,7 @@ NSWindowController *_launcher; NSWindowController *_downloader; NSWindowController *_diskImages; + NSWindowController *_cheatSheet; } @@ -179,6 +181,14 @@ } [_diskImages showWindow: sender]; } + +- (IBAction)displayCheatSheet:(id)sender { + if (!_cheatSheet) { + _cheatSheet = [CheatSheetWindowController new]; + } + [_cheatSheet showWindow: sender]; +} + - (IBAction)displaySupportDirectory:(id)sender { NSURL *url = SupportDirectory(); NSWorkspace *ws = [NSWorkspace sharedWorkspace]; diff --git a/Ample/Base.lproj/CheatSheet.xib b/Ample/Base.lproj/CheatSheet.xib new file mode 100644 index 0000000..c480414 --- /dev/null +++ b/Ample/Base.lproj/CheatSheet.xib @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ample/Base.lproj/MainMenu.xib b/Ample/Base.lproj/MainMenu.xib index f312567..58d5e48 100644 --- a/Ample/Base.lproj/MainMenu.xib +++ b/Ample/Base.lproj/MainMenu.xib @@ -436,6 +436,12 @@ + + + + + + diff --git a/Ample/CheatSheetWindowController.h b/Ample/CheatSheetWindowController.h new file mode 100644 index 0000000..912b072 --- /dev/null +++ b/Ample/CheatSheetWindowController.h @@ -0,0 +1,17 @@ +// +// CheatSheetWindowController.h +// Ample +// +// Created by Kelvin Sherlock on 1/14/2021. +// Copyright © 2021 Kelvin Sherlock. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface CheatSheetWindowController : NSWindowController + +@end + +NS_ASSUME_NONNULL_END diff --git a/Ample/CheatSheetWindowController.m b/Ample/CheatSheetWindowController.m new file mode 100644 index 0000000..c1e417d --- /dev/null +++ b/Ample/CheatSheetWindowController.m @@ -0,0 +1,47 @@ +// +// CheatSheetWindowController.m +// Ample +// +// Created by Kelvin Sherlock on 1/14/2021. +// Copyright © 2021 Kelvin Sherlock. All rights reserved. +// + +#import "CheatSheetWindowController.h" + +#import + +@interface CheatSheetWindowController () +@property (weak) IBOutlet WKWebView *webView; + +@end + +@interface CheatSheetWindowController (NavigationDelegate) +@end + +@implementation CheatSheetWindowController + +-(NSString *)windowNibName { + return @"CheatSheet"; +} + +- (void)windowDidLoad { + [super windowDidLoad]; + + [_webView setHidden: YES]; + NSBundle *bundle = [NSBundle mainBundle]; + NSURL *url = [bundle URLForResource: @"CheatSheet" withExtension: @"html"]; + [[[_webView configuration] preferences] setValue: @YES forKey: @"developerExtrasEnabled"]; + [_webView loadFileURL: url allowingReadAccessToURL: url]; + +} + +-(void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { + // delay to prevent flash in dark mode. + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0/8 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [webView setHidden: NO]; + }); + +} + + +@end diff --git a/Ample/Resources/CheatSheet.html b/Ample/Resources/CheatSheet.html new file mode 100644 index 0000000..b657a52 --- /dev/null +++ b/Ample/Resources/CheatSheet.html @@ -0,0 +1,222 @@ + + + + + Keyboard Cheat Sheet + + + + +
+ MacBook: +
+

Full UI Mode

+ + + + + + + + + + + + + + + + + + + +
+ Delete + Fn+Delete + Toggle partial UI mode
Option+EnterToggle full screen mode
F12Reset Key
+ +

Partial UI Mode

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Delete + Fn+Delete + Toggle full UI mode
Option+EnterToggle full screen mode
TabConfig menu
EscQuit
PPause
~Debugger break (when active)
+ Page Down + Fn+Down Arrow + Fast forward (while pressed)
F3Soft reset
Shift+F3Hard reset
F5Toggle debugger
Shift+F5Toggle graphic filters
F7Load state
Shift+F7Save state
F10Toggle throttle
F11Show FPS
Shift+F11Show profiler
F12Save snapshot
Shift+F12Record MNG video
Control+Shift+F12Record AVI video
Option+Shift+F12Record rendered AVI video
+ +

Note

+
    +
  • F keys may require Fn key depending on keyboard and system settings.
  • +
  • Shift, Control, and Option assume left-key unless otherwise specified.
  • +
+ +