Prev: 37644 Up: Map Next: 37718
37694: Test Space Key
Return non-zero only on the call when SPACE (or SHIFT) goes down. SpaceKeyLatch latches the key as held until it is released.
Output
A Zero unless SPACE has just been pressed
Return non-zero when SPACE is first pressed.
TestSpaceKey 37694 LD A,126 Read from the keyboard;
Port Number Bit
0 1 2 3 4
126 SPACE FULL-STOP M N B
Shift Z X C V
37696 OUT (253),A
37698 IN A,(254)
Test SPACE and clear the latch if it is up.
37700 CPL Flip the bits.
37701 AND %00000001 Keep only bit 0.
37703 JR Z,TestSpaceKey_StoreLatch If the result is zero jump to TestSpaceKey_StoreLatch.
Report a new press only if the latch was not already set.
37705 LD A,(24157) A=*SpaceKeyLatch.
37708 AND A If A is not zero then jump to TestSpaceKey_Clear.
37709 JR NZ,TestSpaceKey_Clear
37711 INC A Increment A by one.
TestSpaceKey_StoreLatch 37712 LD (24157),A Write A to SpaceKeyLatch.
37715 RET Return.
TestSpaceKey_Clear 37716 XOR A A=0.
37717 RET Return.
Prev: 37644 Up: Map Next: 37718