Skip to content

Commit

Permalink
This is VirtualC64 4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed Jun 27, 2023
1 parent 843e9f7 commit 754a093
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 31 deletions.
2 changes: 2 additions & 0 deletions Emulator/Base/MsgQueueTypes.h
Expand Up @@ -96,6 +96,7 @@ enum_long(MSG_TYPE)
MSG_CART_SWITCH,

// Peripherals (Keyboard)
MSG_KB_AUTO_PRESS,
MSG_KB_AUTO_RELEASE,

// Peripherals (Mouse)
Expand Down Expand Up @@ -197,6 +198,7 @@ struct MsgTypeEnum : util::Reflection<MsgType, MsgType> {
case MSG_CRT_ATTACHED: return "CRT_ATTACHED";
case MSG_CART_SWITCH: return "CART_SWITCH";

case MSG_KB_AUTO_PRESS: return "KB_AUTO_PRESS";
case MSG_KB_AUTO_RELEASE: return "KB_AUTO_RELEASE";

case MSG_SHAKING: return "SHAKING";
Expand Down
6 changes: 3 additions & 3 deletions Emulator/Base/Thread.h
Expand Up @@ -212,11 +212,11 @@ class Thread : public CoreComponent, util::Wakeable {

// Returns the number of frames to compute (provided by the subclass)
virtual isize missingFrames(util::Time base) const = 0;

// Returns true if this functions is called from within the emulator thread
bool isEmulatorThread() { return std::this_thread::get_id() == thread.get_id(); }

public:

// Returns true if this functions is called from within the emulator thread
bool isEmulatorThread() { return std::this_thread::get_id() == thread.get_id(); }

// Performs a state change
void switchState(ExecutionState newState);
Expand Down
11 changes: 7 additions & 4 deletions Emulator/Peripherals/Keyboard/Keyboard.cpp
Expand Up @@ -264,7 +264,7 @@ Keyboard::releaseAll()
{
SYNCHRONIZED

debug(KBD_DEBUG, "_releaseAll()\n");
debug(KBD_DEBUG, "releaseAll()\n");

for (isize i = 0; i < 8; i++) {

Expand Down Expand Up @@ -360,23 +360,26 @@ Keyboard::processKeyEvent(EventID id)

debug(KBD_DEBUG, "Pressing %ld\n", key.nr);
press(key);
msgQueue.put(MSG_KB_AUTO_PRESS, key.nr);
}
break;
continue;

case KeyAction::Action::release:

for (auto &key: keys) {

debug(KBD_DEBUG, "Releasing %ld\n", key.nr);
msgQueue.put(MSG_KB_AUTO_RELEASE, key.nr);
release(key);
}
break;
continue;

case KeyAction::Action::releaseAll:

debug(KBD_DEBUG, "Releasing all\n");
releaseAll();
break;
msgQueue.put(MSG_KB_AUTO_RELEASE, -1);
continue;
}
}

Expand Down
9 changes: 2 additions & 7 deletions Emulator/config.h
Expand Up @@ -17,13 +17,13 @@
#define VER_MAJOR 4
#define VER_MINOR 6
#define VER_SUBMINOR 0
#define VER_BETA 2
#define VER_BETA 0

// Snapshot version number
#define SNP_MAJOR 4
#define SNP_MINOR 6
#define SNP_SUBMINOR 0
#define SNP_BETA 2
#define SNP_BETA 0

// Uncomment these settings in a release build
#define RELEASEBUILD
Expand Down Expand Up @@ -150,8 +150,3 @@ static const bool betaRelease = 1;
#endif

#include <assert.h>


// IDEAS:
// Update IEC bus inside CIA and VIA. Use delay flags if neccessary.
// Call CA1 action in VIA class only if the pin value really has changed.
2 changes: 1 addition & 1 deletion GUI/MyController.swift
Expand Up @@ -455,7 +455,7 @@ extension MyController {
case .CART_SWITCH:
break

case .KB_AUTO_RELEASE:
case .KB_AUTO_RELEASE, .KB_AUTO_PRESS:
if virtualKeyboard?.window?.isVisible == true {
virtualKeyboard!.refresh()
}
Expand Down
11 changes: 0 additions & 11 deletions GUI/Panels/Preferences/KeyboardPrefs.swift
Expand Up @@ -7,17 +7,6 @@
// See https://www.gnu.org for license information
// -----------------------------------------------------------------------------

/*
class KeyViewItem: NSCollectionViewItem {
override func viewDidLoad() {
super.viewDidLoad()
view.wantsLayer = true
}
}
*/

extension PreferencesController {

func refreshKeyboardTab() {
Expand Down
2 changes: 1 addition & 1 deletion GUI/Peripherals/VirtualKeyboardController.swift
Expand Up @@ -120,7 +120,7 @@ class VirtualKeyboardController: DialogController {
c64.keyboard.scheduleKeyReleaseAll(2)
cancelAction(self)
} else {
c64.keyboard.scheduleKeyRelease(nr, delay: 2)
c64.keyboard.scheduleKeyRelease(nr, delay: 0.25)
}
}

Expand Down
8 changes: 4 additions & 4 deletions VirtualC64.xcodeproj/project.pbxproj
Expand Up @@ -2422,7 +2422,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 230511;
CURRENT_PROJECT_VERSION = 230627;
DEAD_CODE_STRIPPING = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3NG65ZLYW7;
Expand All @@ -2443,7 +2443,7 @@
LIBRARY_SEARCH_PATHS = "$(inherited)";
LLVM_LTO = NO;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.6b2;
MARKETING_VERSION = 4.6;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 c++20";
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
Expand All @@ -2466,7 +2466,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 230511;
CURRENT_PROJECT_VERSION = 230627;
DEAD_CODE_STRIPPING = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3NG65ZLYW7;
Expand All @@ -2488,7 +2488,7 @@
LIBRARY_SEARCH_PATHS = "$(inherited)";
LLVM_LTO = YES_THIN;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.6b2;
MARKETING_VERSION = 4.6;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 c++20";
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
Expand Down

0 comments on commit 754a093

Please sign in to comment.