![]() |
Routines |
| Prev: D6C9 | Up: Map | Next: D704 |
|
Used by the routines at CalculateSpriteSize and PrintSprite.
Finds the sprite for the graphic number of an object. The data of the sprite is flipped, in place, if it is not the same way round as the flags of the object say. If there is no sprite for the graphic number, this returns to the routine that called the routine that called it.
|
||||||||||||
|
Find the address of the sprite.
|
||||||||||||
| GetSpriteAddress | D6EF | LD L,(IX+$00) | Fetch the sprite number. | |||||||||
| D6F2 | LD H,$00 | Set H to 00. | ||||||||||
| D6F4 | ADD HL,HL | Double HL. | ||||||||||
| D6F5 | LD BC,$7112 | Point BC at SpriteTable. | ||||||||||
| D6F8 | ADD HL,BC | Add BC to HL. | ||||||||||
| D6F9 | LD E,(HL) | Fetch the address of the sprite. | ||||||||||
| D6FA | INC HL | |||||||||||
| D6FB | LD D,(HL) | |||||||||||
|
Flip it if there is a sprite.
|
||||||||||||
| D6FC | LD A,(DE) | Fetch the width of the sprite and test it. | ||||||||||
| D6FD | AND A | |||||||||||
| D6FE | JP NZ,FlipSprite | Jump to FlipSprite if there is a sprite, to flip it if needed. | ||||||||||
| D701 | INC SP | Drop the return address. | ||||||||||
| D702 | INC SP | |||||||||||
| D703 | RET | Return. | ||||||||||
| Prev: D6C9 | Up: Map | Next: D704 |