Skip to content

Commit

Permalink
Handle ` key in AZERTY as well as possible, fix name of NTSC VIC-20 v…
Browse files Browse the repository at this point in the history
…ariant.
  • Loading branch information
dillof committed Jun 28, 2020
1 parent 450c2f7 commit ec81ea0
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 44 deletions.
12 changes: 8 additions & 4 deletions C64.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -3131,6 +3132,7 @@
4B540E9A24A674E100F6925B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4B540EA324A6750B00F6925B /* vice_plus4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vice_plus4.c; sourceTree = "<group>"; };
4B540EA524A6757B00F6925B /* VicePlus4.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VicePlus4.swift; sourceTree = "<group>"; };
4B540EA924A7805F00F6925B /* GridView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GridView.swift; sourceTree = "<group>"; };
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 = "<group>"; };
4B680035249A023100A76E57 /* vice_vic20.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vice_vic20.c; sourceTree = "<group>"; };
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -8871,15 +8875,15 @@
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;
LD_RUNPATH_SEARCH_PATHS = (
"$(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 = "";
Expand All @@ -8897,15 +8901,15 @@
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;
LD_RUNPATH_SEARCH_PATHS = (
"$(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 = "";
Expand Down
31 changes: 2 additions & 29 deletions C64/Settings/ReleaseNotesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
1 change: 1 addition & 0 deletions C64/Vice/ViceThread.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ - (id)init {
if ((self = [super init]) == nil) {
return nil;
}
self.qualityOfService = NSQualityOfServiceUserInteractive;
return self;
}

Expand Down
50 changes: 50 additions & 0 deletions C64UIComponents/GridView.swift
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>

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() {

}
}
2 changes: 1 addition & 1 deletion Emulator/Computer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 6 additions & 7 deletions Emulator/KeyboardSymbols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)),

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions THANKS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Thanks to these people for suggestions, testing, and bug reports:

- Kye Lewis <[email protected]>
- Michael Berengue
13 changes: 11 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down

0 comments on commit ec81ea0

Please sign in to comment.