![]() |
Routines |
| Prev: 50573 | Up: Map | Next: 50643 |
|
Works out which of the four directions the player is facing, from the mirror flag and the type of the legs.
|
||||||||||||||||||||||||||||||||
|
Combine the mirror flag with bit 2 of the type.
|
||||||||||||||||||||||||||||||||
| GetFacingDirection | 50621 | LD A,(IX+7) | Fetch the flags. | |||||||||||||||||||||||||||||
| 50624 | RRCA | Move bit 6, which mirrors the object, down to bit 3. | ||||||||||||||||||||||||||||||
| 50625 | RRCA | |||||||||||||||||||||||||||||||
| 50626 | RRCA | |||||||||||||||||||||||||||||||
| 50627 | AND %00001000 | Keep only that bit. | ||||||||||||||||||||||||||||||
| 50629 | XOR %00001000 | Flip it, to say that the object is not mirrored. | ||||||||||||||||||||||||||||||
|
Merge in bit 2 of the type and keep the direction.
|
||||||||||||||||||||||||||||||||
| 50631 | LD L,A | Stash the flag in L. | ||||||||||||||||||||||||||||||
| 50632 | LD A,(IX+0) | Fetch the type. | ||||||||||||||||||||||||||||||
| 50635 | AND %00000100 | Keep only bit 2 of the type. | ||||||||||||||||||||||||||||||
| 50637 | OR L | Combine it with the other bit. | ||||||||||||||||||||||||||||||
| 50638 | RRCA | Move the two bits down to bits 0 and 1. | ||||||||||||||||||||||||||||||
| 50639 | RRCA | |||||||||||||||||||||||||||||||
| 50640 | AND %00000011 | Keep only those two bits. | ||||||||||||||||||||||||||||||
| 50642 | RET | Return. | ||||||||||||||||||||||||||||||
|
View the equivalent code in;
|
||||||||||||||||||||||||||||||||
| Prev: 50573 | Up: Map | Next: 50643 |