Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternate key(s) to toggle max speed #678

Closed
Michaelangel007 opened this issue Aug 23, 2019 · 22 comments

Comments

@Michaelangel007
Copy link
Contributor

commented Aug 23, 2019

Currently a user can use ScrollLock to toggle full speed after they enable it in Options > Input > [x] Scroll Lock acts as toggle for full-speed CPU.

= Problems =

There are a few issues with this:

  • ScrollLock isn't convenient to press (being on the far right of the keyboard)
  • Macs don't have a dedicated ScrollLock key. :-/ (You might be able to use Fn+Shift+F12 and/or F14 but people seem to report various issues of that working / not working. Excel users on a MBP are SOL IIRC.)
  • It is in the process of being phased out. My Logitech Illuminated Keyboard requires FN + Pause/Break to send this ⤓ key.
  • Virtual ][ uses Command-3 for full speed. (MacOSX Command == Windows Ctrl.) (See http://www.virtualii.com/)

= Solution =

I propose using these Ctrl-# keys:

  • Ctrl-0 Speed fastest
  • Ctrl-1 Speed 100%
  • Ctrl-3 Toggle speed fastest / 100%

Taking a quick look at "Ye olde" Beagle Bros Peeks and Pokes scancodes chart ...

.... I see we can take advantage of ASCII's crappy design with its omission of no scancodes for Ctrl-0 .. Ctrl-9.

i.e. The Apple 2 can't detect Ctrl-0. We don't have to worry about passing these keys into the virtual machine.

CALL-151
300:AD 00 C0 10 FB 8D 00 04 8D 10 C0 60
FC58G N 300G

I hacked in ~20 lines of code and added this feature this morning.

Pull Request coming up next.

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

@Michaelangel007:

I propose using these Ctrl-# keys: (Ctrl-0,1,3)

What about Ctrl-2? Why did you skip this?

@6502-workshop

This comment has been minimized.

Copy link

commented Aug 23, 2019

Thanks @Michaelangel007! This feature would definitely be a boost to my productivity. My primary workstation is a Mac and I RDP into a Windows machine when I need windows specific apps, thus I don't have a scroll lock key available.

@Michaelangel007

This comment has been minimized.

Copy link
Contributor Author

commented Aug 23, 2019

Hey Tom

Two reasons (pardon the pun):

  • By putting a 1 key "spacer" between Ctrl-1 and Ctrl-3 it makes it harder for a user to accidentally press the wrong key
  • Ctrl-3 was chosen so that Virtual ][ users don't have anything to learn. Since we didn't have any users we didn't have to worry about backwards compatibility.

If we want to be more consistent we could make use of Ctrl-2. What speed should it do?

  • 50% (mnemonic 1/2)
  • 200%
@Michaelangel007

This comment has been minimized.

Copy link
Contributor Author

commented Aug 23, 2019

OK, I fired up Virtual ][ so I could see what options are available. The menu Machine has these options:

  • Command-1 Regular Speed
  • Command-2 High Speed
  • Command-3 Maximum Speed

Looks like we could assign Ctrl-2 to be (SPEED_NORMAL + SPEED_MAX)/2 ?

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

By putting a 1 key "spacer" between Ctrl-1 and Ctrl-3 it makes it harder for a user to accidentally press the wrong key

Ah, I see. Perhaps best to just not map anything to Ctrl-2 (so as you currently have it).

To match Virtual ][, wouldn't Ctrl-3 = Full Speed? So...

  • Ctrl-1 = 1 MHz
  • Ctrl-2 (nothing)
  • Ctrl-3 = Full Speed
  • Ctrl-0 = toggle 1 MHz / Full Speed
@Michaelangel007

This comment has been minimized.

Copy link
Contributor Author

commented Aug 23, 2019

Yes, Technically Ctrl-3 "should" always set the speed to just flat out if we want to match Virtual ][. I made it a toggle for convenience.

@6502-workshop Mark what do you prefer?

  • Ctrl-2 Always set speed to Full? or
  • Ctrl-2 Toggle speed between Full and 100%?

I'm fine with either one and it is trivial to change it.

@6502-workshop

This comment has been minimized.

Copy link

commented Aug 23, 2019

@Michaelangel007

This comment has been minimized.

Copy link
Contributor Author

commented Aug 24, 2019

@6502-workshop Thanks Mark!

Fixed with commit 5e9b8fe.

@tomcw Can you review & test PR #679 ? (I gave it a quick go and everything seems OK.) Thanks.

@sicklittlemonkey

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2019

@Michaelangel007

This comment has been minimized.

Copy link
Contributor Author

commented Aug 24, 2019

Great points Nick! Love the # for similar MHz!

i.e.

  • Ctrl-1 -> 1 MHz
  • Ctrl-2 -> 2.8 MHz -- what
  • Ctrl-3 -> 3 MHz (or fastest)
  • Ctrl-4 -> 4 MHz

The original feature request came from Mark who is using Virtual ][. I wanted to make it as easy as possible for him to switch between Virtual ][ (Mac) and AppleWin (Windows). Thus the reason for the Virtual ][ "compatibility". (Something the GIMP guys are fucking clueless about.)

Ideally at some point down the road we'll have a dialog where you can customize the hotkeys -- which would solve the problem for everyone. =P

Currently Ctrl-0 just does a dumb toggle between 1 MHz and Fastest. The idea of toggling between the last speed and max is a good idea -- but I wanted to keep it simple.

@6502-workshop Mark how do you feel about Ctrl-2 and Ctrl-4 being added? 2.8 MHz and 4 Mhz respectively.

@tomcw Do you happen to know what "units" the SPEED_* macros in Common.h correspond to? Are these in MHz??

#define  SPEED_MIN         0
#define  SPEED_NORMAL      10
#define  SPEED_MAX         40
@6502-workshop

This comment has been minimized.

Copy link

commented Aug 24, 2019

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2019

@tomcw Do you happen to know what "units" the SPEED_* macros in Common.h correspond to? Are these in MHz??

Yes, it's 0.1 MHz (so SPEED_NORMAL = 10 = 1.0 Mhz).

@Michaelangel007 - also see my comments in the PR #679.
Like Nick, I'm saying that the toggle should toggle between the current custom speed (as set by the Config's slider control) and Full-Speed.

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Aug 25, 2019

Here's what I think we should have:

  • Ctrl-1: Set speed=1MHz and set custom speed=1MHz and save to Registry
  • Ctrl-3: Set speed=Full Speed
  • Ctrl-0: Toggle speed between custom speed and Full Speed

Where "Custom speed" is the speed set via the Configuration UI's "Custom Speed" slider.

NB. I don't care about Ctrl-2/4 and setting speed to 2MHz or 4MHz. But if implemented, then it should follow Ctrl-1's behaviour, ie. set custom speed & save to Registry.

My concern is if I've set Config's custom speed slide to eg. 3 MHz (btw. which also gets persisted to the Registry), then Ctrl-0 (speed toggle) will set to Full-Speed, then to 1 MHz.

I would expect that Ctrl-0 would toggle between Full-Speed and (the prev custom speed) 3 MHz.

@6502-workshop

This comment has been minimized.

Copy link

commented Aug 25, 2019

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Aug 26, 2019

@Michaelangel007 - I've update the branch's code to reflect my "spec" above.

@Michaelangel007

This comment has been minimized.

Copy link
Contributor Author

commented Aug 27, 2019

Great feedback everyone!

@tomcw Thanks for the review. Design and code looks good! 👍 /Oblg. Ship it!

@Michaelangel007

This comment has been minimized.

Copy link
Contributor Author

commented Aug 27, 2019

Merged PR.

Only thing left to do is to update bin/History.txt.

1.29.?.? - ?? ??? 2019
----------------------
. [Feature #678] Hotkeys to change emulation speed
    - Ctrl-0 Toggles between custom speed and max speed
    - Ctrl-1 Sets 1 MHz
    - Ctrl-3 Sets max speed

@tomcw It doesn't feel right checking this in -- yet. Where should it live until we push out the next release?

@tomcw tomcw added this to the 1.29.2 milestone Aug 27, 2019
@tomcw

This comment has been minimized.

Copy link
Contributor

commented Aug 27, 2019

It's fine to update History.txt now.
Also need to update the Help doc.

Since I've just added this to milestone 1.29.2, then this ensures that it won't be missed.

@6502-workshop

This comment has been minimized.

Copy link

commented Aug 27, 2019

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2019

Closing, as outstanding work completed.

@tomcw tomcw closed this Aug 29, 2019
@tomcw

This comment has been minimized.

Copy link
Contributor

commented Sep 6, 2019

FYI, new AppleWin build 1.29.2 here.

@6502-workshop

This comment has been minimized.

Copy link

commented Sep 7, 2019

Thanks Tom, works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.