Prev: 53870 Up: Map Next: 53922
53875: Draw Strip
Used by the routines at DrawCell and DrawStripsLeftToRight.
Draws one strip of a cell, which is a graphic that is sixteen pixels wide. A strip is not drawn if its position is outside the view.
Input
C Variant of the strip (0 or 1)
IY Entry in the list of strips
Return if the tile is outside the play area horizontally.
DrawStrip 53875 LD DE,(48054) Fetch ScreenXPosition into DE.
53879 LD HL,207 Return if it is further to the right than 207.
53882 AND A
53883 SBC HL,DE
53885 RET C
53886 LD HL,16 Return if it is not further to the right than 16.
53889 SBC HL,DE
53891 RET NC
Return if the tile is off the screen vertically.
53892 LD HL,(48056) Fetch ScreenYPosition.
53895 LD A,H Return if the high byte is not zero.
53896 AND A
53897 RET NZ
Fetch the tile and find its image.
53898 LD D,L Keep the low byte of the vertical position in D.
53899 LD A,C Fetch the swap flag.
53900 PUSH BC Stash the count of tiles on the stack.
53901 LD C,(IY+0) Fetch the tile number into BC.
53904 LD B,0
Combine the variant with the entry for the strip in the table at StripVariants.
53906 LD HL,25922 Find the entry for the tile in StripVariants.
53909 ADD HL,BC
53910 XOR (HL) Combine it with the swap flag, to make the number of the image.
Find the address of the image.
53911 LD BC,28636 Point BC at StripGraphicTable.
53914 CALL GetTableEntry Call GetTableEntry.
Draw the image.
53917 CALL DrawStripGraphic Draw the graphic.
53920 POP BC Restore the count of tiles from the stack.
53921 RET Return.
View the equivalent code in;
Prev: 53870 Up: Map Next: 53922