Prev: BEBF Up: Map Next: BEFE
BEE4: Print Sprites
Used by the routines at DrawPanel and PrintBorder.
Prints the sprite of an object a number of times, moving the pixel position of the object by a step each time, so that it makes a row of sprites. BC, DE and HL are preserved while each sprite is printed.
Input
B Number of times
D Step along the y axis in pixels
E Step along the x axis in pixels
IX The address of the object
Print one sprite and step the position.
PrintSprites BEE4 PUSH BC Stash BC, DE and HL on the stack.
BEE5 PUSH DE
BEE6 PUSH HL
BEE7 CALL PrintSprite Call PrintSprite.
BEEA POP HL Restore HL, DE and BC from the stack.
BEEB POP DE
BEEC POP BC
BEED LD A,(IX+$1A) Fetch the pixel x position of the object.
BEF0 ADD A,E Add the step along the x axis.
BEF1 LD (IX+$1A),A Set the pixel x position of the object.
BEF4 LD A,(IX+$1B) Fetch the pixel y position of the object.
BEF7 ADD A,D Add the step along the y axis.
BEF8 LD (IX+$1B),A Set the pixel y position of the object.
BEFB DJNZ PrintSprites Jump to PrintSprites until all of the sprites have been printed.
BEFD RET Return.
View the equivalent code in;
Prev: BEBF Up: Map Next: BEFE