![]() |
Routines |
| Prev: 8F61 | Up: Map | Next: 8F90 |
|
Used by the routine at HandlerControls.
|
|||||||||||||||||||||
| ReadCursorJoystick | 8F6A | LD A,$EF | Read from the keyboard;
|
||||||||||||||||||
| 8F6C | OUT ($FD),A | ||||||||||||||||||||
| 8F6E | IN A,($FE) | ||||||||||||||||||||
| 8F70 | LD C,A | Store this value in C temporarily. | |||||||||||||||||||
|
Handle "up".
|
|||||||||||||||||||||
| 8F71 | AND %00001000 | Keep only bit 3 ("7"). | |||||||||||||||||||
| 8F73 | LD E,A | Store this value in E. | |||||||||||||||||||
| 8F74 | LD A,C | Retrieve C and rotate the bits right twice. | |||||||||||||||||||
| 8F75 | RRCA | ||||||||||||||||||||
| 8F76 | RRCA | ||||||||||||||||||||
|
Handle "down", "right" and "fire".
|
|||||||||||||||||||||
| 8F77 | AND %01000101 | Keep only bits 0 ("8"), 2 ("6") and 6 ("0"). | |||||||||||||||||||
| 8F79 | OR E | Set the bits from E. | |||||||||||||||||||
| 8F7A | LD E,A | Store this value back in E. | |||||||||||||||||||
|
Handle relocating the "fire" bit.
|
|||||||||||||||||||||
| 8F7B | RRCA | Rotate the bits right twice. | |||||||||||||||||||
| 8F7C | RRCA | ||||||||||||||||||||
| 8F7D | AND %00010000 | Keep only bit 4 ("0"). | |||||||||||||||||||
| 8F7F | OR E | Set the bits from E. | |||||||||||||||||||
|
Filter out the unused bits.
|
|||||||||||||||||||||
| 8F80 | AND %00011111 | Keep only bits 0-4. | |||||||||||||||||||
| 8F82 | LD E,A | Store this value back in E. | |||||||||||||||||||
|
Handle reading "left" from a different port.
|
|||||||||||||||||||||
| 8F83 | LD A,$F7 | Read from the keyboard;
|
|||||||||||||||||||
| 8F85 | OUT ($FD),A | ||||||||||||||||||||
| 8F87 | IN A,($FE) | ||||||||||||||||||||
|
Handle relocating the "left" bit.
|
|||||||||||||||||||||
| 8F89 | RRA | Rotate the bits right three times. | |||||||||||||||||||
| 8F8A | RRA | ||||||||||||||||||||
| 8F8B | RRA | ||||||||||||||||||||
| 8F8C | AND %00000010 | Keep only bit 1 ("5"). | |||||||||||||||||||
| 8F8E | OR E | Set the bits from E resulting in;
|
|||||||||||||||||||
| 8F8F | RET | Return. | |||||||||||||||||||
|
View the equivalent code in;
|
|||||||||||||||||||||
| Prev: 8F61 | Up: Map | Next: 8F90 |