Prev: ABF9 Up: Map Next: ACFC
AC6F: Zoombox: draw border
This draws the zoombox border.
Used by the routine at zoombox.
zoombox_draw_border AC6F LD A,($AB68) Fetch zoombox_y
AC72 DEC A Subtract one so that we draw around the zoombox fill area
AC73 ADD A,A Multiply it by 16 producing an offset into the game_window_start_addresses array
AC74 ADD A,A
AC75 ADD A,A
AC76 ADD A,A
AC77 LD HL,$EDD3 Point HL at the game_window_start_addresses array
AC7A ADD A,L Combine it with the offset
AC7B LD L,A
AC7C JR NC,zoombox_draw_border_0
AC7E INC H
zoombox_draw_border_0 AC7F LD A,(HL) Fetch the game window start address
AC80 INC HL
AC81 LD H,(HL)
AC82 LD L,A
Top left corner tile.
AC83 LD A,($AB66) Fetch zoombox_x
AC86 DEC A Subtract one so that we draw around the zoombox fill area
AC87 ADD A,L Combine with game window start address
AC88 LD L,A
AC89 LD A,$00 Draw a top-left zoombox border tile
AC8B CALL zoombox_draw_tile
AC8E INC L Move the destination pointer forward
Top horizontal run, moving right.
AC8F LD A,($AB67) Fetch zoombox_width
AC92 LD B,A Set iterations
Start loop
zoombox_draw_border_1 AC93 LD A,$01 Draw a horizontal zoombox border tile
AC95 CALL zoombox_draw_tile
AC98 INC L Move the destination pointer forward
AC99 DJNZ zoombox_draw_border_1 ...loop
Top right corner tile.
AC9B LD A,$02 Draw a top-right zoombox border tile
AC9D CALL zoombox_draw_tile
ACA0 LD DE,$0020 See similar code at AC5F onwards
ACA3 LD A,L
ACA4 CP $E0
ACA6 JR C,zoombox_draw_border_2
ACA8 LD D,$07
zoombox_draw_border_2 ACAA ADD HL,DE
Right hand vertical run, moving down.
ACAB LD A,($AB69) Fetch zoombox_height
ACAE LD B,A Set iterations
Start loop
zoombox_draw_border_3 ACAF LD A,$03 Draw a vertical zoombox border tile
ACB1 CALL zoombox_draw_tile
ACB4 LD DE,$0020 See similar code at AC5F onwards
ACB7 LD A,L
ACB8 CP $E0
ACBA JR C,zoombox_draw_border_4
ACBC LD D,$07
zoombox_draw_border_4 ACBE ADD HL,DE
ACBF DJNZ zoombox_draw_border_3 ...loop
Bottom right corner tile.
ACC1 LD A,$04 Draw a bottom-right zoombox border tile
ACC3 CALL zoombox_draw_tile
ACC6 DEC L Move the destination pointer backwards
Bottom horizontal run, moving left.
ACC7 LD A,($AB67) Fetch zoombox_width
ACCA LD B,A Set iterations
Start loop
zoombox_draw_border_5 ACCB LD A,$01 Draw a horizontal zoombox border tile
ACCD CALL zoombox_draw_tile
ACD0 DEC L Move the destination pointer backwards
ACD1 DJNZ zoombox_draw_border_5 ...loop
Bottom left corner tile.
ACD3 LD A,$05 Draw a bottom-left zoombox border tile
ACD5 CALL zoombox_draw_tile
ACD8 LD DE,$FFE0 Inversion of similar code at AC5F onwards
ACDB LD A,L
ACDC CP $20
ACDE JR NC,zoombox_draw_border_6
ACE0 LD DE,$F8E0
zoombox_draw_border_6 ACE3 ADD HL,DE
Left hand vertical run, moving up.
ACE4 LD A,($AB69) Fetch zoombox_height
ACE7 LD B,A Set iterations
Start loop
zoombox_draw_border_7 ACE8 LD A,$03 Draw a vertical zoombox border tile
ACEA CALL zoombox_draw_tile
ACED LD DE,$FFE0 Inversion of similar code at AC5F onwards
ACF0 LD A,L
ACF1 CP $20
ACF3 JR NC,zoombox_draw_border_8
ACF5 LD DE,$F8E0
zoombox_draw_border_8 ACF8 ADD HL,DE
ACF9 DJNZ zoombox_draw_border_7 ...loop
ACFB RET Return
Prev: ABF9 Up: Map Next: ACFC