Prev: BB55 Up: Map Next: BBB0
BB57: ZRDR_P
Print border around game area.
ZRDR_P BB57 PUSH BC Preserve registers.
BB58 PUSH DE
BB59 PUSH HL
BB5A PUSH AF
BB5B LD HL,(border_graphics_pointer) Load address of border graphics from border_graphics_pointer and store in CHARS.
BB5E LD ($5C36),HL
BB61 LD E,$14 Set E to 20 as loop counter and row coordinate.
vertical_border_loop BB63 LD A,$00 Print character $00 (left border) in column 0.
BB65 LD C,$00
BB67 LD B,E
BB68 PUSH DE
BB69 CALL print_8x8_graphic
BB6C LD C,$1F Print character $01 (right border) in column 31.
BB6E LD A,$01
BB70 CALL print_8x8_graphic
BB73 POP DE
BB74 DEC E Loop back to vertical_border_loop for 20 rows.
BB75 JR NZ,vertical_border_loop
BB77 LD E,$1E Set E to 30 as loop counter and column coordinate.
horizontal_border_loop BB79 LD A,$02 Print character $02 (top border) in row 0.
BB7B LD B,$00
BB7D LD C,E
BB7E PUSH DE
BB7F CALL print_8x8_graphic
BB82 LD B,$15 Print character $03 (bottom border) in row 21.
BB84 LD A,$03
BB86 CALL print_8x8_graphic
BB89 POP DE
BB8A DEC E Loop back to horizontal_border_loop for 30 columns.
BB8B JR NZ,horizontal_border_loop
BB8D LD A,$04 Print character $04 (top-left corner) at coordinate (0,0).
BB8F LD BC,$0000
BB92 CALL print_8x8_graphic
BB95 LD A,$05 Print character $05 (top-right corner) at coordinate (31,0).
BB97 LD C,$1F
BB99 CALL print_8x8_graphic
BB9C LD A,$06 Print character $06 (bottom-left corner) at coordinate (0,21).
BB9E LD BC,$1500
BBA1 CALL print_8x8_graphic
BBA4 LD C,$1F Print character $07 (bottom-right corner) at coordinate (31,21).
BBA6 LD A,$07
BBA8 CALL print_8x8_graphic
BBAB POP AF Restore registers and return.
BBAC POP HL
BBAD POP DE
BBAE POP BC
BBAF RET
Prev: BB55 Up: Map Next: BBB0