VIC-20 and key repeat function ??

Modding and Technical Issues

Moderator: Moderators

Post Reply
repetto74
Vic 20 Amateur
Posts: 41
Joined: Tue Aug 23, 2016 10:05 am

VIC-20 and key repeat function ??

Post by repetto74 »

Hi guys,

A fairly simple question. I cannot recall if the VIC-20 will repeat the key pressed if I keep my finger on it :?: My VIC20 does not do that and wondering if this is normal.
If not then what could be the problem? All keys are working perfectly when pressing them.
Thanks
Rick
User avatar
R'zo
Vic 20 Nerd
Posts: 514
Joined: Fri Jan 16, 2015 11:48 pm

Re: VIC-20 and key repeat function ??

Post by R'zo »

repetto74 wrote:Hi guys,

A fairly simple question. I cannot recall if the VIC-20 will repeat the key pressed if I keep my finger on it :?: My VIC20 does not do that and wondering if this is normal.
If not then what could be the problem? All keys are working perfectly when pressing them.
Thanks
Rick
There's a simple poke that turns key repeat on and off. I don't have time at the moment but I'll try to look it up later tonight.
R'zo
I do not believe in obsolete...
repetto74
Vic 20 Amateur
Posts: 41
Joined: Tue Aug 23, 2016 10:05 am

Re: VIC-20 and key repeat function ??

Post by repetto74 »

Ok so by default this was not set up on a VIC-20? I do recall of course this working on a C64 but had a doubt for the VIC20 :-)

EDIT : I found! Actually the keystroke repeat works for the spacebar only for both C64 and VIC :-). My memory is failing :mrgreen:
User avatar
Stormcrow
Vic 20 Enthusiast
Posts: 177
Joined: Mon Dec 24, 2012 9:46 pm
Website: http://trimboli.name
Location: Ronkonkoma, NY

Re: VIC-20 and key repeat function ??

Post by Stormcrow »

Address 650 (decimal) is "Key repeat (128 = repeat all keys)."
Address 651 is "Repeat speed counter."
Address 652 is "Repeat delay counter."

Poke 128 into address 650 to enable repeating keys. It seems any value from 0 to 127 disables key repeats and any value from 128 to 255 enables them. I'm not sure if there's anything else that happens with values other than 0 and 128. The values in 651 and 652 seem to change on their own, though I have managed to temporarily increase the delay before the repeating starts by changing address 651 (it changes back though after one repeat).

My copy of Vice seems to like to start with repeating keys disabled. I seem to remember the keys on my real VIC (not hooked up, alas) repeating by default, but I'm not completely sure.
User avatar
Stormcrow
Vic 20 Enthusiast
Posts: 177
Joined: Mon Dec 24, 2012 9:46 pm
Website: http://trimboli.name
Location: Ronkonkoma, NY

Re: VIC-20 and key repeat function ??

Post by Stormcrow »

repetto74 wrote:Actually the keystroke repeat works for the spacebar only for both C64 and VIC :-).
The cursor keys probably repeat by default as well.
repetto74
Vic 20 Amateur
Posts: 41
Joined: Tue Aug 23, 2016 10:05 am

Re: VIC-20 and key repeat function ??

Post by repetto74 »

Hi Stormcrow,

Many thanks for this little tutorial on how to enable repeated keystrokes for all keys! I will for sure test it :D
And yes of course the cursor keys have also the repeat function enabled. My memory is failing again and again :mrgreen:
Thanks!
Rick
User avatar
Mike
Herr VC
Posts: 4843
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: VIC-20 and key repeat function ??

Post by Mike »

For address 650, only the top two bits are relevant (the keyboard decode routine checks the address with a BIT instruction and uses BMI and BVS to branch upon bits 6 and 7). If bit 7 (value 128) is set, all keys repeat, this also takes precedence over bit 6. If bit 6 is set (but not bit 7), no keys repeat. If both bits are 0, the CRSR keys, DELete (and INSerT) and the Space bar repeat; this is the default.

The check is located in the KERNAL at address $EB86.
Stormcrow wrote:The values in 651 and 652 seem to change on their own, [...]
These two addresses keep the running values of the delay (~1/4 second) and repeat (every 1/15 second) timers, and their init values are hardcoded in the keyboard decode routine (as immediate operands of the two instructions at addresses $EB7D and $EBB0, respectively). Thankfully enough, this routine is vectored over $028F, and it is possible to replace the routine with an own version, and define other init values.
Post Reply