Prev: 52009 Up: Map Next: 52102
52064: Build Figure Sprite List
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 21 and 22 are moved eight to the left.
Input
B The vertical offset for the sprite for the top part
C The vertical offset for the sprite for the middle part
D The number of the sprite for the middle part
E The number of the sprite for the lower part
A' The number of the sprite for the top part
HL The address of the sprite list to make
IX The address of the figure
Write the lower sprite.
BuildFigureSpriteList 52064 LD (HL),244 Set the horizontal offset of the lower sprite to 244 and move on.
52066 INC HL
52067 LD (HL),4 Set the vertical offset of the lower sprite to 4 and move on.
52069 INC HL
52070 LD (HL),E Set the number of the lower sprite, and move on.
52071 INC HL
Use a further left offset for types 21 and 22.
52072 LD A,(IX+0) Fetch the type.
52075 SUB 21 Subtract 21.
52077 CP 2 Compare it with 2.
52079 LD A,244 Use a horizontal offset of 244.
52081 JR NC,BuildFigureSpriteList_Middle Jump to BuildFigureSpriteList_Middle unless the type is 21 or 22.
52083 SUB 8 Move the offset eight to the left.
Write the middle sprite.
BuildFigureSpriteList_Middle 52085 LD (HL),A Set the horizontal offset of the middle sprite, and move on.
52086 INC HL
52087 LD (HL),C Set the vertical offset of the middle sprite, and move on.
52088 INC HL
52089 LD (HL),D Set the number of the middle sprite, and move on.
52090 INC HL
Write the top sprite and the terminator.
52091 LD (HL),244 Set the horizontal offset of the top sprite to 244 and move on.
52093 INC HL
52094 LD (HL),B Set the vertical offset of the top sprite, and move on.
52095 INC HL
52096 EX AF,AF' Set the number of the top sprite, and move on.
52097 LD (HL),A
52098 INC HL
52099 LD (HL),128 Set the terminator and return.
52101 RET
Prev: 52009 Up: Map Next: 52102