![]() |
Routines |
| Prev: 42136 | Up: Map | Next: 42204 |
|
Used by the routine at MoveProgramPacket.
Finds a direction for a program packet to go in, which is the one that it is heading in if that is possible, and otherwise the one to the side, the opposite one, and the other side.
|
||||||||||||||||||||
| ChooseDirection | 42179 | CALL TestCellInDirection | Try the direction that the packet is heading in, and return if it can go there. | |||||||||||||||||
| 42182 | RET Z | |||||||||||||||||||
| 42183 | LD A,C | Try the direction before it... | ||||||||||||||||||
| 42184 | DEC A | |||||||||||||||||||
| 42185 | AND 3 | |||||||||||||||||||
| 42187 | CALL TestCellInDirection | ...and return if the packet can go there. | ||||||||||||||||||
| 42190 | RET Z | |||||||||||||||||||
| 42191 | LD A,C | Try the opposite direction... | ||||||||||||||||||
| 42192 | XOR 2 | |||||||||||||||||||
| 42194 | CALL TestCellInDirection | ...and return if the packet can go there. | ||||||||||||||||||
| 42197 | RET Z | |||||||||||||||||||
| 42198 | LD A,C | Try the direction after the original one... | ||||||||||||||||||
| 42199 | INC A | |||||||||||||||||||
| 42200 | AND 3 | |||||||||||||||||||
| 42202 | JR TestCellInDirection | Jump to TestCellInDirection. | ||||||||||||||||||
| Prev: 42136 | Up: Map | Next: 42204 |