![]() |
Routines |
| Prev: 50215 | Up: Map | Next: 50327 |
|
Used by the routines at DrawCell and DrawStripsLeftToRight.
Draws one tile of the edge of a cell of the town, if its position is inside the area where the town is drawn, which is from 17 to 207 horizontally and below 256 vertically. The tile number comes from the list at IY, and is changed to the number of an image by a table at TileImageNumbers and then by the swap flag.
|
||||||||||
|
Return if the tile is outside the play area horizontally.
|
||||||||||
| DrawStrip | 50280 | LD DE,(41550) | Fetch ScreenHorizontalPosition into DE. | |||||||
| 50284 | LD HL,207 | Return if it is further to the right than 207. | ||||||||
| 50287 | AND A | |||||||||
| 50288 | SBC HL,DE | |||||||||
| 50290 | RET C | |||||||||
| 50291 | LD HL,16 | Return if it is not further to the right than 16. | ||||||||
| 50294 | SBC HL,DE | |||||||||
| 50296 | RET NC | |||||||||
|
Return if the tile is off the screen vertically.
|
||||||||||
| 50297 | LD HL,(41552) | Fetch ScreenVerticalPosition. | ||||||||
| 50300 | LD A,H | Return if the high byte is not zero. | ||||||||
| 50301 | AND A | |||||||||
| 50302 | RET NZ | |||||||||
| 50303 | LD D,L | Keep the low byte of the vertical position in D. | ||||||||
|
Fetch the tile and find its image.
|
||||||||||
| 50304 | LD A,C | Fetch the swap flag. | ||||||||
| 50305 | PUSH BC | Stash the count of tiles on the stack. | ||||||||
| 50306 | LD C,(IY+0) | Fetch the tile number into BC. | ||||||||
| 50309 | LD B,0 | |||||||||
| 50311 | LD HL,24108 | Find the entry for the tile in TileImageNumbers. | ||||||||
| 50314 | ADD HL,BC | |||||||||
| 50315 | XOR (HL) | Combine it with the swap flag, to make the number of the image. | ||||||||
| 50316 | LD BC,35374 | Point BC at EdgeImagePointers. | ||||||||
|
Find the address of the image.
|
||||||||||
| 50319 | CALL GetTableEntry | Call GetTableEntry. | ||||||||
|
Draw the image.
|
||||||||||
| 50322 | CALL DrawStripGraphic | Call DrawStripGraphic. | ||||||||
| 50325 | POP BC | Restore the count of tiles from the stack. | ||||||||
| 50326 | RET | Return. | ||||||||
|
View the equivalent code in;
|
||||||||||
| Prev: 50215 | Up: Map | Next: 50327 |