Difference between revisions of "83Plus:BCALLs:4018"

From WikiTI
Jump to: navigation, search
m (Moved from utility to input)
(Diagonal arrow key presses!)
Line 8: Line 8:
  
 
=== Inputs ===
 
=== Inputs ===
* none
+
* Set 0, (iy + 2Ch) to receive diagonal arrow key presses (but see comments)
  
 
=== Outputs ===
 
=== Outputs ===
 
* A=([[83Plus:RAM:843F|kbdScanCode]])
 
* A=([[83Plus:RAM:843F|kbdScanCode]])
 +
** down + left: 252
 +
** down + right: 250
 +
** up + left: 245
 +
** up + right: 243
 
* ([[83Plus:RAM:843F|kbdScanCode]])=0
 
* ([[83Plus:RAM:843F|kbdScanCode]])=0
 
* kbdSCR,(iy+kbdFlags) reset
 
* kbdSCR,(iy+kbdFlags) reset
 +
  
 
=== Registers Destroyed ===
 
=== Registers Destroyed ===
Line 20: Line 25:
 
== Comments ==
 
== Comments ==
 
This routine expects that either interrupts are enabled or KbdScan was called manually.  Either of these routines will check the keyboard and load the appropriate scan code into the memory location kbdScanCode and set the flag kbdSCR,(iy+kbdFlags).
 
This routine expects that either interrupts are enabled or KbdScan was called manually.  Either of these routines will check the keyboard and load the appropriate scan code into the memory location kbdScanCode and set the flag kbdSCR,(iy+kbdFlags).
 +
 +
If you set 0, (iy + 2Ch) GetKey will return garbage values for diagonal arrow key presses. In particular, two of the combinations share the same value. So that flag obviously isn't meant for use with GetKey. You should not return to the OS with it set for that reason.

Revision as of 04:25, 10 May 2014

Synopsis

Official Name: GetCSC

BCALL Address: 4018

This routine loads the most recent scan code into register A.

Inputs

  • Set 0, (iy + 2Ch) to receive diagonal arrow key presses (but see comments)

Outputs

  • A=(kbdScanCode)
    • down + left: 252
    • down + right: 250
    • up + left: 245
    • up + right: 243
  • (kbdScanCode)=0
  • kbdSCR,(iy+kbdFlags) reset


Registers Destroyed

Comments

This routine expects that either interrupts are enabled or KbdScan was called manually. Either of these routines will check the keyboard and load the appropriate scan code into the memory location kbdScanCode and set the flag kbdSCR,(iy+kbdFlags).

If you set 0, (iy + 2Ch) GetKey will return garbage values for diagonal arrow key presses. In particular, two of the combinations share the same value. So that flag obviously isn't meant for use with GetKey. You should not return to the OS with it set for that reason.