![]() |
Routines |
| Prev: 63088 | Up: Map | Next: 63192 |
|
Used by the routine at Main_Game_Loop.
Reads the active control input for the current control mode stored in *50431. Scales the mode index to a word offset, loads the handler address from the table at Control_Handler_Table, pushes Read_Control_Input_Return as the return address, and jumps to the handler. Each handler reads one or more hardware ports and returns the direction and fire bits in A. The common landing pad at Read_Control_Input_Return masks the result to five bits and stores it in B and C.
|
||||||||||||
| Read_Control_Input | 63171 | LD HL,63197 | Point to the handler table at Control_Handler_Table and zero D. | |||||||||
| 63174 | LD D,0 | |||||||||||
| 63176 | LD A,(50431) | Scale *50431 to a zero-based word table offset in E. | ||||||||||
| 63179 | DEC A | |||||||||||
| 63180 | ADD A,A | |||||||||||
| 63181 | LD E,A | |||||||||||
| 63182 | ADD HL,DE | Load the handler address from the table. | ||||||||||
| 63183 | LD E,(HL) | |||||||||||
| 63184 | INC HL | |||||||||||
| 63185 | LD D,(HL) | |||||||||||
| 63186 | EX DE,HL | |||||||||||
| 63187 | LD DE,63192 | Push the return address. | ||||||||||
| 63190 | PUSH DE | |||||||||||
| 63191 | JP (HL) | Dispatch to the control handler. | ||||||||||
| Prev: 63088 | Up: Map | Next: 63192 |