Prev: A5F1 Up: Map Next: A6C4
A606: Key press update
Used by the routine at _87c9.
Sets the action flags based on which keys are pressed.
Keys_UpdateAction A606 LD A,(Flag_Demo)
A609 AND A
A60A JP NZ,Keys_UpdateAction_9
A60D CALL Keyboard_GetState
A610 LD B,$00 Holds the bits represent which type of action is required.
A612 LD IX,KeyState_ShiftToV
A616 LD A,(IX+$01) Mask off keys A,D & G
A619 AND $15
A61B LD C,A
A61C LD A,(IX+$06) Mask off keys J & L
A61F AND $0A
A621 OR C OR into single result.
A622 XOR $1F Flip bits and see if anything was pressed.
A624 JR Z,Keys_UpdateAction_0
A626 SET 2,B If so, then set the bit for rotate clockwise.
Keys_UpdateAction_0 A628 LD A,(IX+$01) Check for keys S & F
A62B AND $0A
A62D LD C,A
A62E LD A,(IX+$06) Check for keys H, K & ENTER
A631 SET 0,A
A633 AND $15
A635 OR C
A636 XOR $1F Flip bits and see if anything was pressed.
A638 JR Z,Keys_UpdateAction_1
A63A SET 3,B If so, set the bit for rotate anti-clockwise.
Keys_UpdateAction_1 A63C LD A,(IX+$00) Check for keys Z & C
A63F AND $0A
A641 LD C,A
A642 LD A,(IX+$07) Check for keys B & M
A645 AND $14
A647 OR C
A648 XOR $1E Flip bits and see if anything was pressed.
A64A JR Z,Keys_UpdateAction_2
A64C SET 1,B If so, then set the bit for walk left.
Keys_UpdateAction_2 A64E LD A,(IX+$00) Check for keys X & V
A651 AND $14
A653 LD C,A
A654 LD A,(IX+$07) Check for keys N & Symbol Shift
A657 AND $0A
A659 OR C
A65A XOR $1E Flip bits and check if anything was pressed.
A65C JR Z,Keys_UpdateAction_3
A65E SET 0,B If so, then set bit for walking right.
Keys_UpdateAction_3 A660 LD A,(IX+$02) Check for keys W & R
A663 AND $0A
A665 LD C,A
A666 LD A,(IX+$05) Check for keys Y, I & P
A669 AND $15
A66B OR C
A66C XOR $1F Flip bits and see if anything was pressed.
A66E JR Z,Keys_UpdateAction_4
A670 SET 6,B If so, then set bit for drop.
Keys_UpdateAction_4 A672 LD A,(IX+$02) Check for keys Q, E & T
A675 AND $15
A677 LD C,A
A678 LD A,(IX+$05) Check for keys U & O
A67B AND $0A
A67D OR C
A67E XOR $1F Flip bits and see if anything was pressed.
A680 JR Z,Keys_UpdateAction_5
A682 SET 5,B If so, then set bit for pick up.
Keys_UpdateAction_5 A684 LD A,(IX+$03) Check for keys 1 to 5
A687 XOR (IX+$04) include keys 6 to 0
A68A AND $1E
A68C JR Z,Keys_UpdateAction_6
A68E SET 7,B Check bit for special / menu action.
Keys_UpdateAction_6 A690 LD A,(IX+$00)
A693 AND (IX+$07)
A696 AND (IX+$03)
A699 AND (IX+$04)
A69C AND $01
A69E JR NZ,Keys_UpdateAction_7
A6A0 SET 4,B
Keys_UpdateAction_7 A6A2 LD A,B
A6A3 LD (KeyState_Actions),A
A6A6 LD A,($BD1F)
A6A9 ADD A,B
A6AA LD ($BD1F),A
A6AD LD A,(IX+$06)
A6B0 AND $01
A6B2 XOR $01
A6B4 JR Z,Keys_UpdateAction_8
A6B6 LD A,$FF
Keys_UpdateAction_8 A6B8 LD ($BD2B),A
A6BB RET
Keys_UpdateAction_9 A6BC LD (KeyState_Actions),A
A6BF XOR A
A6C0 LD ($BD2B),A
A6C3 RET
Prev: A5F1 Up: Map Next: A6C4