![]() |
Routines |
| Prev: CB29 | Up: Map | Next: CB86 |
|
Used by the routines at HandleOutlaw and HandleSheriff.
Makes a sprite list of three sprites one above the other, using the numbers from ChooseFigureSprites. Types 15 and 16 are moved eight to the left.
|
||||||||||||||||||||
|
Write the lower sprite.
|
||||||||||||||||||||
| BuildFigureSpriteList | CB60 | LD (HL),$F4 | Set the horizontal offset of the lower sprite to F4 and move on. | |||||||||||||||||
| CB62 | INC HL | |||||||||||||||||||
| CB63 | LD (HL),$04 | Set the vertical offset of the lower sprite to 04 and move on. | ||||||||||||||||||
| CB65 | INC HL | |||||||||||||||||||
| CB66 | LD (HL),E | Set the number of the lower sprite, and move on. | ||||||||||||||||||
| CB67 | INC HL | |||||||||||||||||||
|
Use a further left offset for types 15 and 16.
|
||||||||||||||||||||
| CB68 | LD A,(IX+$00) | Fetch the type. | ||||||||||||||||||
| CB6B | SUB $15 | Subtract 15. | ||||||||||||||||||
| CB6D | CP $02 | Compare it with 02. | ||||||||||||||||||
| CB6F | LD A,$F4 | Use a horizontal offset of F4. | ||||||||||||||||||
| CB71 | JR NC,BuildFigureSpriteList_Middle | Jump to BuildFigureSpriteList_Middle unless the type is 15 or 16. | ||||||||||||||||||
| CB73 | SUB $08 | Move the offset eight to the left. | ||||||||||||||||||
|
Write the middle sprite.
|
||||||||||||||||||||
| BuildFigureSpriteList_Middle | CB75 | LD (HL),A | Set the horizontal offset of the middle sprite, and move on. | |||||||||||||||||
| CB76 | INC HL | |||||||||||||||||||
| CB77 | LD (HL),C | Set the vertical offset of the middle sprite, and move on. | ||||||||||||||||||
| CB78 | INC HL | |||||||||||||||||||
| CB79 | LD (HL),D | Set the number of the middle sprite, and move on. | ||||||||||||||||||
| CB7A | INC HL | |||||||||||||||||||
|
Write the top sprite and the terminator.
|
||||||||||||||||||||
| CB7B | LD (HL),$F4 | Set the horizontal offset of the top sprite to F4 and move on. | ||||||||||||||||||
| CB7D | INC HL | |||||||||||||||||||
| CB7E | LD (HL),B | Set the vertical offset of the top sprite, and move on. | ||||||||||||||||||
| CB7F | INC HL | |||||||||||||||||||
| CB80 | EX AF,AF' | Set the number of the top sprite, and move on. | ||||||||||||||||||
| CB81 | LD (HL),A | |||||||||||||||||||
| CB82 | INC HL | |||||||||||||||||||
| CB83 | LD (HL),$80 | Set the terminator and return. | ||||||||||||||||||
| CB85 | RET | |||||||||||||||||||
| Prev: CB29 | Up: Map | Next: CB86 |