![]() |
Routines |
| Prev: DC14 | Up: Map | Next: DC60 |
|
Used by the routine at ChooseDirection.
Swaps the controls for left and right, and up and down, which turns the controls around when the view is rotated. The control for fire is not changed.
|
||||||||||||
|
Swap left with right.
|
||||||||||||
| SwapControls | DC43 | LD A,E | Keep the control for fire. | |||||||||
| DC44 | AND $08 | |||||||||||
| DC46 | BIT 0,E | Make the control for right the control for left. | ||||||||||
| DC48 | JR Z,SwapControls_Left | |||||||||||
| DC4A | SET 1,A | Set the control for left. | ||||||||||
| SwapControls_Left | DC4C | BIT 1,E | Make the control for left the control for right. | |||||||||
| DC4E | JR Z,SwapControls_Down | |||||||||||
| DC50 | SET 0,A | Set the control for right. | ||||||||||
|
Swap up with down.
|
||||||||||||
| SwapControls_Down | DC52 | BIT 2,E | Make the control for down the control for up. | |||||||||
| DC54 | JR Z,SwapControls_Up | |||||||||||
| DC56 | SET 4,A | Set the control for up. | ||||||||||
| SwapControls_Up | DC58 | BIT 4,E | Make the control for up the control for down. | |||||||||
| DC5A | JR Z,SwapControls_Return | |||||||||||
| DC5C | SET 2,A | Set the control for down. | ||||||||||
| SwapControls_Return | DC5E | LD E,A | Keep the controls and return. | |||||||||
| DC5F | RET | |||||||||||
|
View the equivalent code in;
|
||||||||||||
| Prev: DC14 | Up: Map | Next: DC60 |