Prev: D26E Up: Map Next: D2A2
D273: 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 D273 LD DE,($BBB6) Fetch ScreenXPosition into DE.
D277 LD HL,$00CF Return if it is further to the right than CF.
D27A AND A
D27B SBC HL,DE
D27D RET C
D27E LD HL,$0010 Return if it is not further to the right than 10.
D281 SBC HL,DE
D283 RET NC
Return if the tile is off the screen vertically.
D284 LD HL,($BBB8) Fetch ScreenYPosition.
D287 LD A,H Return if the high byte is not zero.
D288 AND A
D289 RET NZ
Fetch the tile and find its image.
D28A LD D,L Keep the low byte of the vertical position in D.
D28B LD A,C Fetch the swap flag.
D28C PUSH BC Stash the count of tiles on the stack.
D28D LD C,(IY+$00) Fetch the tile number into BC.
D290 LD B,$00
Combine the variant with the entry for the strip in the table at StripVariants.
D292 LD HL,$6542 Find the entry for the tile in StripVariants.
D295 ADD HL,BC
D296 XOR (HL) Combine it with the swap flag, to make the number of the image.
Find the address of the image.
D297 LD BC,$6FDC Point BC at StripGraphicTable.
D29A CALL GetTableEntry Call GetTableEntry.
Draw the image.
D29D CALL DrawStripGraphic Draw the graphic.
D2A0 POP BC Restore the count of tiles from the stack.
D2A1 RET Return.
View the equivalent code in;
Prev: D26E Up: Map Next: D2A2