![]()  | 
Routines | 
| Prev: 24968 | Up: Map | Next: 25026 | 
| 
 
Used by the routine at 28210.
 
 | 
||||||||||||||||||||
| 
 
Check if this should be read from the Kempston joystick instead?
 
 | 
||||||||||||||||||||
| ReadInputLR | 24972 | LD A,(24126) | If GameOptions indicates the control method is via the Kempston joystick then jump to ReadKempstonJoystick. | |||||||||||||||||
| 24975 | BIT 1,A | |||||||||||||||||||
| 24977 | JR NZ,ReadKempstonJoystick | |||||||||||||||||||
| 
 
Check for "Left" and "Right" button inputs for port 254.
 
 | 
||||||||||||||||||||
| 24979 | LD A,254 | Read from the keyboard; 
  | 
||||||||||||||||||
| 24981 | OUT (253),A | |||||||||||||||||||
| 24983 | IN A,(254) | |||||||||||||||||||
| 24985 | AND %00011110 | Strip out the SHIFT key. | ||||||||||||||||||
| 24987 | CP 30 | If none of these keys have been pressed, jump to ReadInputLR_7F. | ||||||||||||||||||
| 24989 | JR Z,ReadInputLR_7F | |||||||||||||||||||
| 24991 | AND %00010100 | Keep only bits 2 ("X") and 4 ("V"). | ||||||||||||||||||
| 24993 | CP 20 | If neither key is pressed jump to Input_Left. | ||||||||||||||||||
| 24995 | JR Z,Input_Left | |||||||||||||||||||
| 24997 | JR Input_Right | Jump to Input_Right. | ||||||||||||||||||
| 
 
Check for "Left" and "Right" button input for port 127.
 
 | 
||||||||||||||||||||
| ReadInputLR_7F | 24999 | LD A,127 | Read from the keyboard; 
  | 
|||||||||||||||||
| 25001 | OUT (253),A | |||||||||||||||||||
| 25003 | IN A,(254) | |||||||||||||||||||
| 25005 | AND %00011110 | Strip out the SPACE key. | ||||||||||||||||||
| 25007 | CP 30 | If none of these keys have been pressed, jump to Input_None. | ||||||||||||||||||
| 25009 | JR Z,Input_None | |||||||||||||||||||
| 25011 | AND %00010100 | Keep only bits 2 ("M") and 4 ("B"). | ||||||||||||||||||
| 25013 | CP 20 | If neither key is pressed jump to Input_Right. | ||||||||||||||||||
| 25015 | JR Z,Input_Right | |||||||||||||||||||
| 
 
Return "Left" button pressed.
 
 | 
||||||||||||||||||||
| Input_Left | 25017 | LD A,253 | A=11111101. | |||||||||||||||||
| 25019 | RET | Return. | ||||||||||||||||||
| 
 
Return "Right" button pressed.
 
 | 
||||||||||||||||||||
| Input_Right | 25020 | LD A,254 | A=11111110. | |||||||||||||||||
| 25022 | RET | Return. | ||||||||||||||||||
| 
 
Return "no input".
 
 | 
||||||||||||||||||||
| Input_None | 25023 | LD A,255 | A=11111111. | |||||||||||||||||
| 25025 | RET | Return. | ||||||||||||||||||
| 
 
View the equivalent code in; 
 
 | 
||||||||||||||||||||
| Prev: 24968 | Up: Map | Next: 25026 |