Prev: E1AD Up: Map Next: E239
E200: Show this turn's play area, and clear the buffers for the next
Used by the routine at NEW_GAME.
Called at the end of every turn (NEW_GAME): copies the pixels and the attributes to the screen (COPY_BUFFER, COPY_ATTR_BUFFER), and goes on into CLEAR_BUFFER.
The entry point CLEAR_BUFFER, also used at a new game (NEW_GAME), by the menu (MENU) and at the end of a game (GAME_OVER), fills the attribute buffer with bright white ink on the paper colour in FLASH -- black but for the turn after a villain dies -- and the pixel buffer with zeros, both with PUSHes from the top down. The fill of the attributes starts just below ATTR_SPILL, so that byte is never written here.
FILL_BELOW_HL is the fill: B rows of 24 bytes, ending at HL, all DE.
Output
HL The lowest address filled (the buffer's start)
SHOW_PLAY_AREA E200 CALL COPY_BUFFER Copy the pixels and the attributes to the screen
E203 CALL COPY_ATTR_BUFFER
This entry point is used by the routines at NEW_GAME, MENU and GAME_OVER.
CLEAR_BUFFER E206 LD HL,ATTR_SPILL CLEAR_BUFFER: the attributes, 14 rows of 24 bytes below ATTR_SPILL, each FLASH's paper with bright white ink
E209 LD A,(FLASH)
E20C OR $47
E20E LD E,A
E20F LD D,A
E210 LD B,$0E
E212 CALL FILL_BELOW_HL
E215 LD HL,ATTR_BUFFER Then the pixels, 112 rows of 24 bytes below ATTR_BUFFER, all zeros
E218 LD DE,$0000
E21B LD B,$70
FILL_BELOW_HL E21D LD (SAVED_SP),SP FILL_BELOW_HL: keep SP and point it at the end of the area
E221 LD SP,HL
SHOW_PLAY_AREA_0 E222 PUSH DE Twelve pushes a row
E223 PUSH DE
E224 PUSH DE
E225 PUSH DE
E226 PUSH DE
E227 PUSH DE
E228 PUSH DE
E229 PUSH DE
E22A PUSH DE
E22B PUSH DE
E22C PUSH DE
E22D PUSH DE
E22E DJNZ SHOW_PLAY_AREA_0
E230 LD HL,$0000 HL = the lowest byte filled; restore SP
E233 ADD HL,SP
E234 LD SP,(SAVED_SP)
E238 RET
Prev: E1AD Up: Map Next: E239