Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > SHIFT keys and SHIFT LOCK
2013-06-28 01:57
TWW

Registered: Jul 2009
Posts: 545
SHIFT keys and SHIFT LOCK

Hiho

I've read thourgh some old posts and instead of reviving them I figgured a new post was in order.

First off, the shift-keys el'weirdo bahaviour

Replicate as follows:

Start VICE
Shift to lower case characters (C= + SHIFT)
press "a" three times
press and hold left SHIFT
press "A" three times
press and hold right SHIFT
Release left SHIFT
Release Right SHIFT
press "a" three times

as you can see the last 3 "a"'s are still upper case and if you scan $dc00/$dc01 you will find that the shift status bi is still set in the keyboard matrix.

Is this a bug or will a real machine work the same way?

The second issue is the SHIFT LOCK detection trick outlined by Marco M. in C= Hacking #7:

Quote:

The difference between an input and an output is that an output uses more current to drive the signal to the desired level. An input and an output outputting logical '1' are equivalent for any other inputting chip. But if a chip is trying to drive a signal to ground level, it needs more current to sink an output than an input. You can even use outputs as inputs, i.e. read them in your program.

You can use this feature to distinquish between the left shift and the shift lock keys, although they are connected to same hardware lines. The shift lock key has smaller resistance than the left shift. If you make both CIA 1 ports to outputs (write $FF to $DC03 and $DC01) prior reading the left shift key, only shift lock can change the values you read from CIA 1 port B ($DC01).)


If this is the case, the following code snippet should be able to detect a SHIFT LOCK:

again:
    lda #$ff
    sta $dc03
    sta $dc01
    lda #%11111101
    sta $dc00
    lda $dc01
    asl
    ldx #$00
    bcs !no+
        ldx #$ff
!no:
    stx $0500
    jmp again


I can't get this to work in VICE so again, the same question really; Is it a un-supported feature?

EDIT: Actually I get the ecact same keyboard scan matrix readout when I press RUN-STOP (ESC) and SHIF LOCK (CAPS LOCK)...
 
... 10 posts hidden. Click here to view all posts....
 
2013-07-03 21:38
TWW

Registered: Jul 2009
Posts: 545
Okay then!

Done. Let me know if you need the test code if your can't replicate the issue.
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Bob/Censor Design
deetsay
CopAss/Leader
Acidchild/Padua
Jazzcat/Onslaught
macx
Ben Breton/Absence o..
ΛΛdZ
Guests online: 107
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.7)
4 Acidchild  (9.7)
5 Cash  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.039 sec.