Prev: C427 Up: Map Next: C497
C468: Draw Strip
Used by the routines at DrawCell and DrawStripsLeftToRight.
Draws one tile of the edge of a cell of the town, if its position is inside the area where the town is drawn, which is from 11 to CF horizontally and below 0100 vertically. The tile number comes from the list at IY, and is changed to the number of an image by a table at TileImageNumbers and then by the swap flag.
Input
IY The address of the tile in its list
C One to swap the image for the other of its pair
Return if the tile is outside the play area horizontally.
DrawStrip C468 LD DE,($A24E) Fetch ScreenHorizontalPosition into DE.
C46C LD HL,$00CF Return if it is further to the right than CF.
C46F AND A
C470 SBC HL,DE
C472 RET C
C473 LD HL,$0010 Return if it is not further to the right than 10.
C476 SBC HL,DE
C478 RET NC
Return if the tile is off the screen vertically.
C479 LD HL,($A250) Fetch ScreenVerticalPosition.
C47C LD A,H Return if the high byte is not zero.
C47D AND A
C47E RET NZ
C47F LD D,L Keep the low byte of the vertical position in D.
Fetch the tile and find its image.
C480 LD A,C Fetch the swap flag.
C481 PUSH BC Stash the count of tiles on the stack.
C482 LD C,(IY+$00) Fetch the tile number into BC.
C485 LD B,$00
C487 LD HL,$5E2C Find the entry for the tile in TileImageNumbers.
C48A ADD HL,BC
C48B XOR (HL) Combine it with the swap flag, to make the number of the image.
C48C LD BC,$8A2E Point BC at EdgeImagePointers.
Find the address of the image.
C48F CALL GetTableEntry Call GetTableEntry.
Draw the image.
C492 CALL DrawStripGraphic Call DrawStripGraphic.
C495 POP BC Restore the count of tiles from the stack.
C496 RET Return.
View the equivalent code in;
Prev: C427 Up: Map Next: C497