Prev: D26E Up: Map Next: D2A2
D273: Draw the edge picture under one column of a building
Used by the routines at DRAW_OUTLINE and OUTLINE_NEAR_FACES.
The column's lower tile (the number at IY) picks its edge picture from TILE_EDGES -- 0 a whole line, 2 and 3 a stub at one end or the other of a tile with an archway -- and C, 1 for a face seen from behind, is XORed in to swap the stubs; EDGE_TABLE gives the picture, and PUT_EDGE ORs it into the buffer at DRAW_X and DRAW_Y, mirrored on a second face (DRAW_PASS). Only a column that starts inside the buffer's width (x from 17 to 207) and at a y from 0 to 255 is drawn.
Input
IY the column's pair of tiles in a building definition
C 0, or 1 to swap the stubs at an archway
DRAW_EDGE D273 LD DE,(DRAW_X) x from 17 to 207, or nothing
D277 LD HL,$00CF
D27A AND A
D27B SBC HL,DE
D27D RET C
D27E LD HL,$0010
D281 SBC HL,DE
D283 RET NC
D284 LD HL,(DRAW_Y) y from 0 to 255, or nothing; D = y, E = x
D287 LD A,H
D288 AND A
D289 RET NZ
D28A LD D,L
D28B LD A,C The tile's edge number, XOR C
D28C PUSH BC
D28D LD C,(IY+$00)
D290 LD B,$00
D292 LD HL,TILE_EDGES
D295 ADD HL,BC
D296 XOR (HL)
D297 LD BC,EDGE_TABLE HL = the picture (EDGE_TABLE)
D29A CALL TABLE_WORD
D29D CALL PUT_EDGE ORed into the buffer
D2A0 POP BC
D2A1 RET
Prev: D26E Up: Map Next: D2A2