Prev: D2F8 Up: Map Next: E1E5
E1A4: Draw Furniture Item
Input
HL Address of furniture string.
DE Position(Py, Px)
Output
FurnitureDraw E1A4 LD A,(HL) Get next byte in string.
E1A5 INC HL
E1A6 BIT 7,A Test for normal tile.
E1A8 JR Z,FurnitureDraw_4
E1AA CP $FF Test for END OF STRING value.
E1AC RET Z
E1AD CP $FE Test for code.
E1AF JR NZ,FurnitureDraw_0
E1B1 LD C,(HL) Get colour.
E1B2 INC HL
E1B3 JR FurnitureDraw
FurnitureDraw_0 E1B5 CP $FC Test for code.
E1B7 JR NZ,FurnitureDraw_1
E1B9 LD A,E Px += Sx
E1BA ADD A,(HL)
E1BB LD E,A
E1BC INC HL
E1BD LD A,D Py += Sy
E1BE ADD A,(HL)
E1BF LD D,A
E1C0 INC HL
E1C1 JR FurnitureDraw
FurnitureDraw_1 E1C3 CP $FB Test for code.
E1C5 JR NZ,FurnitureDraw_2
E1C7 LD A,(HL) Get next two bytes holding new tile start address.
E1C8 LD (TileStartPtr),A
E1CB INC HL
E1CC LD A,(HL)
E1CD LD ($C147),A
E1D0 INC HL
E1D1 JR FurnitureDraw
FurnitureDraw_2 E1D3 LD B,(HL) Get number of times to draw.
E1D4 INC HL
E1D5 LD A,(HL) Get tile(n) to draw.
E1D6 INC HL
FurnitureDraw_3 E1D7 CALL TileDraw Draw tile.
E1DA INC E Px++
E1DB DJNZ FurnitureDraw_3 Times 'B'
E1DD JR FurnitureDraw
FurnitureDraw_4 E1DF CALL TileDraw Draw tile
E1E2 INC E Px++
E1E3 JR FurnitureDraw
Prev: D2F8 Up: Map Next: E1E5