VICE key-rollover inconsistencies

You need an actual VIC.

Moderator: Moderators

Post Reply
User avatar
Wilson
Vic 20 Enthusiast
Posts: 190
Joined: Mon Sep 28, 2009 7:19 am
Location: Brooklyn, NY

VICE key-rollover inconsistencies

Post by Wilson »

Hey all,
I haven't dug too deep into this, but has anyone encountered any quirks with the the handling of key-rollover in the Vic-20 emulation in VICE? The C64 keyboard emulation seems to handle these cases.

For context, I was adapting the routine described here although, from some further testing, it appears there are easier ways to reproduce presumably related issues.

To reproduce:
type 'A', 'S', 'L' without releasing any key.

And the results I came up with:
- xvic: this seems to register as just 'A' and 'S' (no 3rd key at all is apparently read)
- x64sc: the KERNAL's routine buffers this as 'A', 'S', ':'.
- real Vic-20: I also get 'A', 'S', and ':' when using the KERNAL's routine.

The same is true with the 'ASD' 3-key combination. On x64sc (and on a real VIc-20) the KERNAL reads this as 'ASF'. On xvic, it seems to only read as 'AS'.

I just installed the latest binary release of VICE for testing this.
If I activate the status bar, the key presses look like they're all registered correctly. I noticed that the status bar has been updated to display 3 keys since version 3.5, so maybe there was some work on this front recently?


Moving on: this is less of a big deal (but maybe more bizarre and likely totally unrelated). When using a custom keyboard scanning routine (again, an adaptation of the one above), the up-arrow key no longer behaves the same as [SHIFT] + [CRSR DWN], which seems...very odd. The literal SHIFT+DOWN key combination does work as expected (both in VICE and on real hardware).

Anyway, that is all! Just wondering if this is known or if there's something I'm doing wrong.
groepaz
Vic 20 Scientist
Posts: 1187
Joined: Wed Aug 25, 2010 5:30 pm

Re: VICE key-rollover inconsistencies

Post by groepaz »

I have implemented (partial) emulation of the Keyboard matrix quirks some years ago - indeed only for C64 (and C128 i believe). Even for those, it doesn't really work right in all cases (but good enough for 3 keys i think). It's quite a surprisingly complex problem unfortunately :)

So no, you are not doing anything wrong - it's not implemented in xvic.

That said - i wouldnt trust *any* emulation for this kind of stuff, as there is not only the emulator, but also the PC keyboard and PC OS imposing some limitations on keyboard input.
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
Wilson
Vic 20 Enthusiast
Posts: 190
Joined: Mon Sep 28, 2009 7:19 am
Location: Brooklyn, NY

Re: VICE key-rollover inconsistencies

Post by Wilson »

Ah, very good. Thanks for the validation!
Yeah, my immediate thought was that the OS and/or input device were to blame, but the VICE status bar gave me some assurance that every relevant key event was reaching the emulator correctly in at least these simple test cases.
I definitely believe it's a complex problem. :) I suppose it would require at least some level of circuit emulation to do "correctly".
groepaz
Vic 20 Scientist
Posts: 1187
Joined: Wed Aug 25, 2010 5:30 pm

Re: VICE key-rollover inconsistencies

Post by groepaz »

It's basically a matrix of 8x8 resistors, 8 current sources, 8 current sinks (and all of them programmable as either source or sink) - not trivial at all :)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
Post Reply