![]() |
Routines |
| Prev: 39071 | Up: Map | Next: 39116 |
|
Works out the address in the World_Map world map of the entry for the room that the object at IX is in. The address is 28672 plus 32 times the room y plus twice the room x.
The multiplication of the room y by 32 is done as a multiplication of the low three bits of the room y by 32 plus 256 times the rest of the room y.
|
||||||||||||
| Find_World_Map_Address | 39090 | PUSH BC | Stash BC on the stack. | |||||||||
| 39091 | LD H,(IX+4) | Fetch the room y of the object into H. | ||||||||||
| 39094 | XOR A | Start the offset at zero. | ||||||||||
| 39095 | SRL H | Move bit 0 of the room y into A. | ||||||||||
| 39097 | RRA | |||||||||||
| 39098 | SRL H | Move bit 1 of the room y into A. | ||||||||||
| 39100 | RRA | |||||||||||
| 39101 | SRL H | Move bit 2 of the room y into A. (A is now 32 times the low three bits.) | ||||||||||
| 39103 | RRA | |||||||||||
| 39104 | LD L,(IX+2) | Fetch the room x of the object into L. | ||||||||||
| 39107 | ADD A,L | Add the room x to A. | ||||||||||
| 39108 | ADD A,L | Add the room x to A again, to make twice the room x. | ||||||||||
| 39109 | LD L,A | Store the low byte of the offset in L. | ||||||||||
| 39110 | LD BC,28672 | Point at the world map (World_Map). | ||||||||||
| 39113 | ADD HL,BC | Add the address of the world map to the offset. | ||||||||||
| 39114 | POP BC | Restore BC from the stack. | ||||||||||
| 39115 | RET | Return. | ||||||||||
| Prev: 39071 | Up: Map | Next: 39116 |