diff --git a/C64.xcodeproj/project.pbxproj b/C64.xcodeproj/project.pbxproj index caa83791..681b3feb 100644 --- a/C64.xcodeproj/project.pbxproj +++ b/C64.xcodeproj/project.pbxproj @@ -51,6 +51,7 @@ 4B540EA624A6757B00F6925B /* VicePlus4.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B540EA524A6757B00F6925B /* VicePlus4.swift */; }; 4B540EA724A67C4900F6925B /* Emulator.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B68F8B12496407700A76E57 /* Emulator.framework */; }; 4B540EA824A67CE900F6925B /* VicePlus4.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B540E9724A674E100F6925B /* VicePlus4.framework */; }; + 4B540EAA24A7805F00F6925B /* GridView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B540EA924A7805F00F6925B /* GridView.swift */; }; 4B671FDE24A08ABB00E39F01 /* Keyboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1638C2224672A50056A275 /* Keyboard.swift */; }; 4B6800162499FDF700A76E57 /* libsounddrv.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B6800152499FDD500A76E57 /* libsounddrv.a */; }; 4B6800172499FE6800A76E57 /* lamelib.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B3FAA5321D7AD7400C272C4 /* lamelib.c */; }; @@ -3131,6 +3132,7 @@ 4B540E9A24A674E100F6925B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 4B540EA324A6750B00F6925B /* vice_plus4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vice_plus4.c; sourceTree = ""; }; 4B540EA524A6757B00F6925B /* VicePlus4.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VicePlus4.swift; sourceTree = ""; }; + 4B540EA924A7805F00F6925B /* GridView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GridView.swift; sourceTree = ""; }; 4B6800152499FDD500A76E57 /* libsounddrv.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libsounddrv.a; sourceTree = BUILT_PRODUCTS_DIR; }; 4B680033249A00A500A76E57 /* vice_c64.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vice_c64.c; sourceTree = ""; }; 4B680035249A023100A76E57 /* vice_vic20.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vice_vic20.c; sourceTree = ""; }; @@ -5899,6 +5901,7 @@ 4B0E62C422086FE700C3681A /* DriveTrackView.swift */, 4B7609F321F47B900058FBCD /* Info.plist */, 4B0E62C62208714700C3681A /* LedView.swift */, + 4B540EA924A7805F00F6925B /* GridView.swift */, 4B460E482274530500815E7F /* LightPenGestureRecognizer.swift */, 4B460E462274529200815E7F /* LightPenView.swift */, 4BD5B37B2221C425000C77B8 /* MachinePartView.swift */, @@ -8068,6 +8071,7 @@ 4B7609FD21F47BB90058FBCD /* DriveStatusView.swift in Sources */, 4B0E62C522086FE700C3681A /* DriveTrackView.swift in Sources */, 4BF57F012262543500909B2B /* PlaceholderView.swift in Sources */, + 4B540EAA24A7805F00F6925B /* GridView.swift in Sources */, 4B841CFF21F8CEDF009CAF4B /* MediaView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -8871,7 +8875,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = F27CVJNWXK; INFOPLIST_FILE = "$(SRCROOT)/C64/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 13.4; @@ -8879,7 +8883,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.4; + MARKETING_VERSION = 1.5; PRODUCT_BUNDLE_IDENTIFIER = at.spiderlab.c64; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -8897,7 +8901,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = F27CVJNWXK; INFOPLIST_FILE = "$(SRCROOT)/C64/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 13.4; @@ -8905,7 +8909,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.4; + MARKETING_VERSION = 1.5; PRODUCT_BUNDLE_IDENTIFIER = at.spiderlab.c64; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/C64/Settings/ReleaseNotesViewController.swift b/C64/Settings/ReleaseNotesViewController.swift index 9c0357c9..cd9ae3fa 100644 --- a/C64/Settings/ReleaseNotesViewController.swift +++ b/C64/Settings/ReleaseNotesViewController.swift @@ -33,35 +33,8 @@ class ReleaseNotesViewController: UIViewController { } var releases = [ - Release(name: "Release 1.4 Build 10", year: 2020, month: 6, day: 27, changes: [ - "Map <- to Escape in addition to `" - ]), - Release(name: "Release 1.4 Build 9", year: 2020, month: 6, day: 26, changes: [ - "Add more VIC-20 variants.", - "Fix VIC-1001 software keyboard." - ]), - Release(name: "Release 1.4 Build 8", year: 2020, month: 6, day: 26, changes: [ - "Add support for VIC-20 cartridge images.", - "Fix border show/hide animation on VIC-20." - ]), - Release(name: "Release 1.4 Build 7", year: 2020, month: 6, day: 24, changes: [ - "Add VIC-1001." - ]), - Release(name: "Release 1.4 Build 6", year: 2020, month: 6, day: 23, changes: [ - "Fix colors when restarting VIC-20." - ]), - Release(name: "Release 1.4 Build 5", year: 2020, month: 6, day: 23, changes: [ - "Add first party VIC-20 RAM expansions.", - "Use correct font for directory listing for VIC-20." - ]), - Release(name: "Release 1.4 Build 4", year: 2020, month: 6, day: 19, changes: [ - "Preliminary VIC-20 support (startup colors are wrong on subsequent runs)." - ]), - Release(name: "Release 1.4 Build 3", year: 2020, month: 6, day: 14, changes: [ - "Use right shift key to force shfit.", - "When forcing shift on/off, delay other key presses by one frame." - ]), - Release(name: "Relase 1.4 Build 2", year: 2020, month: 6, day: 11, changes: [ + Release(name: "Release 1.5", year: 2020, month: 6, day: 28, changes: [ + "Add Commodore VIC-20 emulation.", "Use new keyboard API to support long key presses." ]), Release(name: "Release 1.4", year: 2020, month: 4, day: 25, changes: [ diff --git a/C64/Vice/ViceThread.m b/C64/Vice/ViceThread.m index 03c27f5c..706419bd 100644 --- a/C64/Vice/ViceThread.m +++ b/C64/Vice/ViceThread.m @@ -45,6 +45,7 @@ - (id)init { if ((self = [super init]) == nil) { return nil; } + self.qualityOfService = NSQualityOfServiceUserInteractive; return self; } diff --git a/C64UIComponents/GridView.swift b/C64UIComponents/GridView.swift new file mode 100644 index 00000000..f5d09e2e --- /dev/null +++ b/C64UIComponents/GridView.swift @@ -0,0 +1,50 @@ +/* + GridView.swift -- arrange subviews in fixed grid + Copyright (C) 2020 Dieter Baron + + This file is part of C64, a Commodore 64 emulator for iOS, based on VICE. + The authors can be contacted at + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + */ + +import UIKit + +@IBDesignable class GridView: UIView { + private struct SubViewInfo { + var view: UIView + var position: CGRect + } + @IBInspectable var margin: CGFloat = 8 { didSet { updateLayout() } } + @IBInspectable var horizontalGap: CGFloat = 8 { didSet { updateLayout() } } + @IBInspectable var verticalGap: CGFloat = 8 { didSet { updateLayout() } } + @IBInspectable var cellWidth: CGFloat = 72 { didSet { updateLayout() } } + @IBInspectable var cellHeight: CGFloat = 72 { didSet { updateLayout() } } + + private var subviewInfos = [SubViewInfo]() + + func add(subview: UIView, at position: CGRect) { + + } + + func remove(subview: UIView) { + + } + + private func updateLayout() { + + } +} diff --git a/Emulator/Computer.swift b/Emulator/Computer.swift index 3911847a..ad3b405f 100644 --- a/Emulator/Computer.swift +++ b/Emulator/Computer.swift @@ -400,7 +400,7 @@ public struct Computer: MachinePart { Computer(identifier: "VIC-20 PET NTSC", name: "Commodore VIC-20 (PET Style Keyboard, NTSC)", fullName: "Commodore VIC-20", - variantName: "PET Style Keyboard, PAL", + variantName: "PET Style Keyboard, NTSC", iconName: "Commodore VIC-20", viceMachineModel: .vic20Ntsc, keyboardName: "PET Style Keyboard", diff --git a/Emulator/KeyboardSymbols.swift b/Emulator/KeyboardSymbols.swift index 3c4bc722..8cd2b050 100644 --- a/Emulator/KeyboardSymbols.swift +++ b/Emulator/KeyboardSymbols.swift @@ -43,17 +43,17 @@ public struct KeyboardSymbols { symbol = .char(char) modifierFlags = key.modifierFlags.subtracting([.shift, .alphaShift, .alternate]) } - else if key.charactersIgnoringModifiers.count == 1, let char = key.charactersIgnoringModifiers.first, char >= " " { + else if key.charactersIgnoringModifiers.count == 1, let char = key.charactersIgnoringModifiers.first, (char >= "a" && char <= "z") || char == "`" || char == "\"" { symbol = .char(char) modifierFlags = key.modifierFlags.subtracting([.shift, .alphaShift, .alternate]) - if char >= "a" && char <= "z" { - if key.modifierFlags.contains(.shift) || key.modifierFlags.contains(.alphaShift), let uppercaseChar = char.uppercased().first { + if char >= "a" && char <= "z" && (key.modifierFlags.contains(.shift) || key.modifierFlags.contains(.alphaShift)), let uppercaseChar = char.uppercased().first { symbol = .char(uppercaseChar) - } - } - else { } } + else if key.characters.count == 2, let char = key.characters.dropFirst().first, char >= " " { + symbol = .char(char) + modifierFlags = key.modifierFlags.subtracting([.shift, .alphaShift, .alternate]) + } else { symbol = .key(key.keyCode) modifierFlags = key.modifierFlags.subtracting(.alphaShift) @@ -219,7 +219,6 @@ public struct KeyboardSymbols { .Char("0"): KeySymbols(normal: .char("0"), shifted: .char("^")), .Char("+"): KeySymbols(normal: .char("+")), .Char("-"): KeySymbols(normal: .char("-")), - .Char("£"): KeySymbols(normal: .char("=")), .ClearHome: KeySymbols(both: .key(.keyboardHome)), .InsertDelete: KeySymbols(both: .key(.keyboardDeleteOrBackspace)), diff --git a/README.md b/README.md index 509372e3..ebd3d6fc 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,9 @@ ![Screenshot](screenshot.png) -C64 is an open source emulator for the 8 bit home computer [Commodore 64](https://en.wikipedia.org/wiki/Commodore_64). It is based on [Vice](http://vice-emu.sourceforge.net), which provices accurate emulation of many hardware variants and peripherals. +C64 is an open source emulator for the 8 bit home computers [Commodore 64](https://en.wikipedia.org/wiki/Commodore_64) and [Commodore VIC-20](https://en.wikipedia.org/wiki/Commodore_VIC-20). It is based on [Vice](http://vice-emu.sourceforge.net), which provices accurate emulation of many hardware variants and peripherals. + +It requires at least iPadOS 13.5. It aims to approximate the feeling of using actual hardware: - Rather than configuring abstract settings, you select hardware components. diff --git a/THANKS.md b/THANKS.md index 233c52d3..6ccb6aa1 100644 --- a/THANKS.md +++ b/THANKS.md @@ -1,3 +1,4 @@ Thanks to these people for suggestions, testing, and bug reports: - Kye Lewis +- Michael Berengue diff --git a/TODO.md b/TODO.md index 23403880..be6067cb 100644 --- a/TODO.md +++ b/TODO.md @@ -1,9 +1,19 @@ # TODO -## framework restructuring +## Support for Multiple Computers - move Audio.m, ringbuffer.c to Emulator - split machine specific ui callbacks into their own files +- render: More efficient partial updates (especially refresh only) +- fix ``' plus other key on AZERTY keyboards. +- rewrite machine configuration, embed in scroll view +- hierarchical configuration +- don't split meda in games by type, use single list + +## VIC-20 + +- Lightpen support +- VIC-1001 with jpkernal: keyboard strange in lower case mode ## other @@ -17,7 +27,6 @@ - documentation - disk select: sub views for game / tools (inbox?) - disk select: show currently selected (other drives too) -- rewrite machine configuration view as collection view - turn off disk drives (via status bar) - tape status view left border too wide (led view too wide?) - sharing of whole game