Difference between revisions of "Hand Controller"

From Intellivision Wiki
Jump to: navigation, search
Line 3: Line 3:
 
In the image above, the hexadecimal numbers indicate which bits get set to zero when the user presses the corresponding input.  Reading the hand controller returns all 1's in the lower 8 bits when no key is pressed.  The numbers are shown in this form because many programs typically read the controller inputs and then invert the values, in order to quickly determine if any key is pressed.  Because of this inversion, most programs use values similar to the ones shown above to interpret the controller's input.
 
In the image above, the hexadecimal numbers indicate which bits get set to zero when the user presses the corresponding input.  Reading the hand controller returns all 1's in the lower 8 bits when no key is pressed.  The numbers are shown in this form because many programs typically read the controller inputs and then invert the values, in order to quickly determine if any key is pressed.  Because of this inversion, most programs use values similar to the ones shown above to interpret the controller's input.
  
For instance, the '1' key, when pressed, clears bits 0 and 7.  This gives the value $7E when reading the controller port.  Pressing more than one input causes all of the corresponding bits to clear.  For instance, pressing 1 and 9 together clears bits 0, 2, 5 and 7, giving $5A.
+
For instance, pressing the '1' key clears bits 0 and 7.  This gives the value $7E when reading the controller port. ($7E, when inverted, yields $81.) Pressing more than one input causes all of the corresponding bits to clear.  For instance, pressing 1 and 9 together clears bits 0, 2, 5 and 7, giving $5A.
  
 
Careful inspection shows that programs can easily decode single keypad presses from the 12-key keypad, or any combination of side-action buttons in combination with a disc input.  It is not possible to uniquely decode a keypad input combined with either a side-action button or disc input.
 
Careful inspection shows that programs can easily decode single keypad presses from the 12-key keypad, or any combination of side-action buttons in combination with a disc input.  It is not possible to uniquely decode a keypad input combined with either a side-action button or disc input.

Revision as of 23:35, 2 June 2005

Hand controller.png

In the image above, the hexadecimal numbers indicate which bits get set to zero when the user presses the corresponding input. Reading the hand controller returns all 1's in the lower 8 bits when no key is pressed. The numbers are shown in this form because many programs typically read the controller inputs and then invert the values, in order to quickly determine if any key is pressed. Because of this inversion, most programs use values similar to the ones shown above to interpret the controller's input.

For instance, pressing the '1' key clears bits 0 and 7. This gives the value $7E when reading the controller port. ($7E, when inverted, yields $81.) Pressing more than one input causes all of the corresponding bits to clear. For instance, pressing 1 and 9 together clears bits 0, 2, 5 and 7, giving $5A.

Careful inspection shows that programs can easily decode single keypad presses from the 12-key keypad, or any combination of side-action buttons in combination with a disc input. It is not possible to uniquely decode a keypad input combined with either a side-action button or disc input.