Prev: 24607 Up: Map Next: 24695
24622: Draw Play Area
Used by the routine at LevelNew.
Draws the brick walls, the cubby hole shelves either side of the play area and the floor using the UDGs at UDG_Brick.
Before After
play-area-before play-area-after
floor-strip
DrawPlayArea 24622 LD HL,(23606) Stash CHARS on the stack.
24625 PUSH HL
24626 LD HL,30422 Write UDG_Brick to CHARS.
24629 LD (23606),HL
Create the left-hand wall.
24632 LD DE,24711 DE=Message_Bricks_LR.
24635 LD HL,6144 HL=6144 (screen position).
24638 LD B,20 Set the brick counter to 20 (the wall is 20 bricks high).
24640 CALL PrintString_Wrapper Print the wall using PrintString_Wrapper.
Create the right-hand wall.
24643 LD HL,6392 HL=6392 (screen position).
24646 LD B,20 Set the brick counter to 20 (the wall is 20 bricks high).
24648 CALL PrintString_Wrapper Print the wall using PrintString_Wrapper.
Create the left-hand cubby hole shelves.
24651 LD DE,24713 DE=Message_Bricks_Cubby.
24654 LD HL,6144 HL=6144 (screen position).
24657 CALL DrawCubbyHoleShelves Draw the shelves using DrawCubbyHoleShelves.
Create the right-hand cubby hole shelves.
24660 LD HL,6376 HL=6376 (screen position).
24663 CALL DrawCubbyHoleShelves Draw the shelves using DrawCubbyHoleShelves.
Create the floor, which is 16 tiles wide.
24666 LD HL,47104 HL=47104 (screen position).
24669 LD DE,24717 DE=Message_Floor.
24672 LD C,16 Set the tile counter in C to 16.
DrawPlayArea_FloorLoop 24674 LD B,1 Set the row counter in B to 1 (the tile is one row high).
24676 CALL PrintString_Wrapper Print the tile using PrintString_Wrapper.
24679 LD A,L Move the screen position 16 pixels to the right and back up 8 pixels to the row it was printed on.
24680 ADD A,16
24682 LD L,A
24683 LD A,H
24684 SUB 8
24686 LD H,A
24687 DEC C Decrease the tile counter by one and loop back to DrawPlayArea_FloorLoop until the whole floor has been drawn.
24688 JR NZ,DrawPlayArea_FloorLoop
24690 POP HL Restore CHARS from the stack, and write it back to 23606.
24691 LD (23606),HL
24694 RET Return.
Prev: 24607 Up: Map Next: 24695