Re: [stella] SWCHA and Stella

Subject: Re: [stella] SWCHA and Stella
From: Tennessee Carmel-Veilleux <veilleux@xxxxxxxxx>
Date: Wed, 01 Jul 1998 09:14:10 -0400

Ruffin Bailey wrote:

> Well, there's been so terribly much traffic on the list lately I thought
> I'd post my "latest findings".
>
> I wrote a quick bit o' code to see if SWCHA was working the way it should
> on my Mac's RAsm/MacStella setup, and found something interesting.  It
> occurred to me earlier on that you could move the emulated joysticks in
> ways you could never more a real one (eg, right and left at the same
> time), so when my swcha test worked, I started playing around.
>
> Turns out that you can get three directions out of each joystick at any
> one time with Stella, but only if you press the keys on the keyboard in
> the right order.  With the "player one joystick", if you move up-down (in
> any order) first, you can then add left but right will not register.  Or
> you can move right-left first (again both at the same time, whichever
> first) and then add down.  You cannot add up before or after down while
> holding down left & right.
>
> I won't bore you with the player two joystick, but a different pattern
> emerged.
>
> Any reason it does this and is there any truth to this pattern with a
> real 2600?
>

This is a computer programmer question, and it seems that with what you're
telling us that you are wondering about the keyboard. When Stella (as well as
any port, like Macstella) reads the keys, it reads them using the keyboard
SCANCODES, which are not characters, but rather the "index" of the keys on the
keyboard. If you have a 101 key keyboard, your keyboard can generate 101
scancodes plus the shift flags, etc. When stella reads the key, in it's
internal it does:

switch(n) {
                   case KEY_A:
                       .....
                   case KEY_LEFT:
                       .....
};

and depending on the order the keys are read, it might happen that left or
right are not read on after the other, or vice-versa, so the keys REALLY are
read, but the couteract each other BEFORE you can see the effect, but the UP
and DOWN do not cancel each other because of the order they're read in,
because scancodes are indexed in order and if I remember well, the arrow keys
are numbered one after the other.

---------------------
Happy Canada day everyone !!!! ||*|| :)

--
Tennessee Carmel-Veilleux (Coordonator of Digital Meltdown)
veilleux@xxxxxxxxx (www.ameth.org/~veilleux)
ICQ ID : 8604827
||*|| This message was written in Canada / Ce message a été écrit au Canada



--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/stella.html

Current Thread