| |
Laxity
Registered: Aug 2005 Posts: 459 |
Detecting ctrl and shift pressed simultaniously
OK.. here goes.
I need to find out if it's possible to detect simultanious key presses of both Ctrl and shift (both left and or right). The code I've written for detecting this works nicely in Vice, but the question is if the key matrix of the real c64 hardware allows this?
Unfortunately my 64 is broken, so I'm unable to investigate this myself. |
|
... 24 posts hidden. Click here to view all posts.... |
| |
Zyron
Registered: Jan 2002 Posts: 2381 |
There's a Crest-demo that goes on automatically where you can hold the parts with Shift-Lock, don't remember which one right now. |
| |
iopop
Registered: Dec 2001 Posts: 317 |
Quote: There's a Crest-demo that goes on automatically where you can hold the parts with Shift-Lock, don't remember which one right now.
its Krestology 100% - as if you ever wanted to hold the parts in that one anyhow.. :) |
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
Krestology may be the demo - it has a big finger pressing it very early.
LAxity:Yes you can via the link I gave earlier. The biggest issue is if three keys in the grid that align so that you make 3 points of a square (using 8*8 grid) then a 4th key press is registered. Maybe with some clever coding you can eliminate the ghost press. From the link at Joe's site if you pressed 3, 5 and W then R would also be detected even if not pressed. |
| |
Style
Registered: Jun 2004 Posts: 498 |
Quote: There's a Crest-demo that goes on automatically where you can hold the parts with Shift-Lock, don't remember which one right now.
and not the corresponding shift key? |
| |
Laxity
Registered: Aug 2005 Posts: 459 |
Quote: Krestology may be the demo - it has a big finger pressing it very early.
LAxity:Yes you can via the link I gave earlier. The biggest issue is if three keys in the grid that align so that you make 3 points of a square (using 8*8 grid) then a 4th key press is registered. Maybe with some clever coding you can eliminate the ghost press. From the link at Joe's site if you pressed 3, 5 and W then R would also be detected even if not pressed.
Yes, I saw your link. I'm already detecting key presses using $dc00 and $dc01 and it works like a charm. No problem there... Multiple key presses and all is good. Was just wondering as I said a few times already :), if the physical hardware would allow for the combination of shift and control being pressed simulaniously, and apparently it does.. So there's much rejoycing ;) |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Quote: wow, you can detect the difference between shift and shift lock?
How? any details?
They should be equivalent!
From Markos article 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).)
|
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Indeed, you cannot detect any key combinations possible. Two keys pressed at the same time are possible, but at already three (i think) you get short circuits in the matrix for certain key combinations, and more short circuit-prone combinations with rising number of pressed keys to detect at the same time.
That is, keys may be left released in the checked combination but are still reported as being pressed (Giana Sisters cheat code, pressing ARMIN will skip a level - as intended by the author, but pressing ARMN will do that as well).
Or, different keys kan be pressed instead of some of the keys in the checked combination (Giana Sisters ARMIN again, but i forgot the extra key combination that works as well).
Oh and also Deus Ex Machina allows you to hold parts by pressing left shift or shift lock. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Also, if many keys are involved, some completely different key might replace several others. To stick at the Giana Sisters example:
ARMIN is the intended combination.
ARMN is an example that a key might not be needed to achieve the same port settings.
But:
AWXZ also works, or ARM together with one of the SHIFT-keys. |
| |
Style
Registered: Jun 2004 Posts: 498 |
Quote: From Markos article 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).)
Jesus Marko is a smart guy - I would have never thought to try that, altho the theory is very sound.
|
| |
TNT Account closed
Registered: Oct 2004 Posts: 189 |
Quote: Jesus Marko is a smart guy - I would have never thought to try that, altho the theory is very sound.
It was first done by ZYX-soft of Finnish Gold, they used it to select different musics inside one of their demos.
Edit: it's in D.Y.S.P.I.D.C.E. |
Previous - 1 | 2 | 3 | 4 - Next |