Prev: 54626 Up: Map Next: 54705
54640: Draw Playfield Border
Used by the routines at Apply_Wave_Border_Colour and RenderHUD.
Draws the rectangular border surrounding the play area. If the units digit of *WaveNumber is 9 the routine returns without drawing. Otherwise it draws full-width horizontal strips at rows 14 and 15 (top edge) via DrawPlayfieldBorderRow, then for each row from 16 to 183 it OR-blits columns 6 7 248 and 249 (left and right edges), and finally draws full-width strips at rows 184 and 185 (bottom edge) via DrawPlayfieldBorderRow. Called from Erase_Narrow_Entity_Sprite and RenderHUD.
playfield-border
DrawPlayfieldBorder 54640 LD A,(50184) A=*WaveNumber (BCD wave number).
54643 AND %00001111 Keep the low decimal digit (AND 15).
54645 CP 9 Return if the units digit is 9 (no border drawn).
54647 RET Z
54648 LD L,14 Call DrawPlayfieldBorderRow to draw the top-edge strip at row 14.
54650 CALL DrawPlayfieldBorderRow
54653 LD L,15 Call DrawPlayfieldBorderRow to draw the top-edge strip at row 15.
54655 CALL DrawPlayfieldBorderRow
54658 LD L,16 L=16 (top row of the framed block).
Left and right edges: for each row 16 to 183 OR-blit columns 6 7 248 and 249 via PlotCharacterCell_Draw.
DrawPlayfieldBorder_SideColumns 54660 LD H,6 H=6 (left inner column).
54662 PUSH HL Stash HL on the stack.
54663 CALL PlotCharacterCell_Draw Call PlotCharacterCell_Draw.
54666 POP HL Restore HL from the stack.
54667 LD H,7 H=7 (left inner column + 1).
54669 PUSH HL Stash HL on the stack.
54670 CALL PlotCharacterCell_Draw Call PlotCharacterCell_Draw.
54673 POP HL Restore HL from the stack.
54674 LD H,248 H=248 (right inner column).
54676 PUSH HL Stash HL on the stack.
54677 CALL PlotCharacterCell_Draw Call PlotCharacterCell_Draw.
54680 POP HL Restore HL from the stack.
54681 LD H,249 H=249 (right inner column + 1).
54683 PUSH HL Stash HL on the stack.
54684 CALL PlotCharacterCell_Draw Call PlotCharacterCell_Draw.
54687 POP HL Restore HL from the stack.
54688 INC L Increment L (next row).
54689 LD A,L Loop back to DrawPlayfieldBorder_SideColumns until all rows are drawn.
54690 CP 184
54692 JR NZ,DrawPlayfieldBorder_SideColumns
54694 LD L,184 Call DrawPlayfieldBorderRow to draw the bottom-edge strip at row 184.
54696 CALL DrawPlayfieldBorderRow
54699 LD L,185 Call DrawPlayfieldBorderRow to draw the bottom-edge strip at row 185.
54701 CALL DrawPlayfieldBorderRow
54704 RET Return.
Prev: 54626 Up: Map Next: 54705