Prev: C115 Up: Map Next: C1A0
C157: Routine at C157
Input
A Tile Index
C Attribute colour value.
DE Position (Y, X)
Output
Tile_DrawFlip C157 PUSH AF
C158 PUSH HL
C159 PUSH BC
C15A PUSH DE
C15B PUSH AF
C15C LD A,$1C Invert Y position.
C15E SUB D
C15F LD D,A
C160 POP AF
C161 EX DE,HL
C162 PUSH HL
C163 LD D,$58 Convert position into Attibute address.
C165 LD E,L
C166 LD L,H
C167 LD H,$00
C169 ADD HL,HL
C16A ADD HL,HL
C16B ADD HL,HL
C16C ADD HL,HL
C16D ADD HL,HL
C16E ADD HL,DE
C16F LD (HL),C Set colour for tile.
C170 POP HL Calculate screen adress. Gets address of bottom scan of character square.
C171 LD L,H
C172 LD D,$00
C174 LD H,D
C175 PUSH DE
C176 ADD HL,HL
C177 ADD HL,HL
C178 ADD HL,HL
C179 ADD HL,HL
C17A LD DE,$9079
C17D ADD HL,DE
C17E LD E,(HL)
C17F INC HL
C180 LD D,(HL)
C181 EX DE,HL
C182 DEC HL
C183 DEC HL
C184 POP DE
C185 ADD HL,DE
C186 PUSH HL
C187 LD L,A Calculate tile address from index.
C188 LD H,$00
C18A ADD HL,HL
C18B ADD HL,HL
C18C ADD HL,HL
C18D LD DE,(TileStartPtr)
C191 ADD HL,DE
C192 POP DE
C193 LD B,$08 Height of tile.
Tile_DrawFlip_0 C195 LD A,(HL) Draw tile by blitting top of bitmap to bottom of character square in reverse order.
C196 LD (DE),A
C197 INC HL
C198 DEC D
C199 DJNZ Tile_DrawFlip_0
C19B POP DE
C19C POP BC
C19D POP HL
C19E POP AF
C19F RET
Prev: C115 Up: Map Next: C1A0