Prev: C1DB Up: Map Next: C28A
C1FD: Draw the four villains on the panel
Used by the routines at NEW_GAME and OBJECT_FLIGHT.
At a new game and whenever a villain is destroyed (OBJECT_FLIGHT). Each is drawn from the sprite of its first standing graphic -- 108, 104, 100 and 96 for records 0 to 3 -- upwards from the bottom of the screen, three columns apart from column 15. A villain still about is drawn as the first byte of each of its sprite's pairs less the second, which comes out as its outline, in the panel's white; a destroyed one as the second bytes, its picture, coloured from THING_COLOURS -- the colour of the object that kills it. A sprite stored mirrored is turned back first (MIRROR_SPRITE).
Measured: after a game starts, the four outlines in bright white; with record 0 emptied and this called again, that villain's picture, in bright cyan, three columns wide and six rows high.
DRAW_VILLAINS C1FD LD IY,VILLAINS IY = the first villain; DE = the bottom line of the screen, column 15
C201 LD DE,$57EF
C204 LD B,$04
DRAW_VILLAINS_0 C206 PUSH BC HL = the sprite for graphic 108, 104, 100 or 96, the first record first
C207 PUSH DE
C208 LD A,B
C209 ADD A,A
C20A ADD A,A
C20B ADD A,$5C
C20D LD BC,GRAPHICS
C210 CALL TABLE_WORD
C213 EX DE,HL stored mirrored? turn it back
C214 LD A,(DE)
C215 AND $40
C217 PUSH BC
C218 PUSH HL
C219 CALL NZ,MIRROR_SPRITE
C21C POP HL
C21D POP BC
C21E EX DE,HL
C21F LD A,(HL) B = its width in bytes, C its height in lines; HL its rows
C220 INC HL
C221 AND $3F
C223 LD B,A
C224 LD C,(HL)
C225 INC HL
C226 LD A,(IY+$00) destroyed (not graphics 96-111)?
C229 SUB $60
C22B CP $10
C22D JR NC,DRAW_VILLAINS_4
DRAW_VILLAINS_1 C22F PUSH BC still about: the first byte of each pair less the second, line by line upwards
C230 PUSH DE
DRAW_VILLAINS_2 C231 LD A,(HL)
C232 INC HL
C233 CPL
C234 OR (HL)
C235 INC HL
C236 CPL
C237 LD (DE),A
C238 INC E
C239 DJNZ DRAW_VILLAINS_2
C23B POP DE
C23C POP BC
C23D CALL SCREEN_LINE_UP
C240 DEC C
C241 JR NZ,DRAW_VILLAINS_1
DRAW_VILLAINS_3 C243 POP DE three columns on, and the next villain
C244 POP BC
C245 INC E
C246 INC E
C247 INC E
C248 PUSH DE
C249 LD DE,$0010
C24C ADD IY,DE
C24E POP DE
C24F DJNZ DRAW_VILLAINS_0
C251 RET
DRAW_VILLAINS_4 C252 PUSH BC destroyed: the second bytes, its picture
C253 PUSH DE
DRAW_VILLAINS_5 C254 INC HL
C255 LD A,(HL)
C256 INC HL
C257 LD (DE),A
C258 INC E
C259 DJNZ DRAW_VILLAINS_5
C25B POP DE
C25C POP BC
C25D CALL SCREEN_LINE_UP
C260 DEC C
C261 JR NZ,DRAW_VILLAINS_4
C263 POP DE C = its colour (THING_COLOURS), by B
C264 POP BC
C265 PUSH BC
C266 PUSH DE
C267 LD A,B
C268 LD HL,THING_COLOURS
C26B CALL ADD_HL_A
C26E LD C,(HL)
C26F EX DE,HL HL = the attribute of the cell at the bottom
C270 LD A,H
C271 RRCA
C272 RRCA
C273 RRCA
C274 AND $03
C276 LD H,A
C277 LD DE,$5800
C27A ADD HL,DE
C27B LD DE,$FFDE three wide and six high, upwards
C27E LD B,$06
DRAW_VILLAINS_6 C280 LD (HL),C
C281 INC L
C282 LD (HL),C
C283 INC L
C284 LD (HL),C
C285 ADD HL,DE
C286 DJNZ DRAW_VILLAINS_6
C288 JR DRAW_VILLAINS_3
Prev: C1DB Up: Map Next: C28A