Prev: 733A Up: Map Next: 7374
733E: Input: Left/ Right
Used by the routines at JetmanThrust and JetmanWalk.
Check if this should be read from the Kempston joystick instead?
ReadInputLR 733E LD A,($5CF3) If GameOptions indicates the control method is via the Kempston joystick then jump to ReadKempstonJoystick.
7341 BIT 1,A
7343 JR NZ,ReadKempstonJoystick
Check for "Left" and "Right" button inputs for port FE.
7345 LD A,$FE Read from the keyboard;
Port Number Bit
0 1 2 3 4
FE SHIFT Z X C V
7347 OUT ($FD),A
7349 IN A,($FE)
734B AND %00011110 Strip out the SHIFT key.
734D CP $1E If none of these keys have been pressed, jump to ReadInputLR_7F.
734F JR Z,ReadInputLR_7F
7351 AND %00010100 Keep only bits 2 ("X") and 4 ("V").
7353 CP $14 If neither key is pressed jump to Input_Left.
7355 JR Z,Input_Left
7357 JR Input_Right Jump to Input_Right.
Check for "Left" and "Right" button input for port 7F.
ReadInputLR_7F 7359 LD A,$7F Read from the keyboard;
Port Number Bit
0 1 2 3 4
7F SPACE FULL-STOP M N B
735B OUT ($FD),A
735D IN A,($FE)
735F AND %00011110 Strip out the SPACE key.
7361 CP $1E If none of these keys have been pressed, jump to Input_None.
7363 JR Z,Input_None
7365 AND %00010100 Keep only bits 2 ("M") and 4 ("B").
7367 CP $14 If neither key is pressed jump to Input_Right.
7369 JR Z,Input_Right
Return "Left" button pressed.
Input_Left 736B LD A,$FD A=11111101.
736D RET Return.
Return "Right" button pressed.
Input_Right 736E LD A,$FE A=11111110.
7370 RET Return.
Return "no input".
Input_None 7371 LD A,$FF A=11111111.
7373 RET Return.
View the equivalent code in;
Prev: 733A Up: Map Next: 7374