Prev: 6C46 Up: Map Next: 6C95
6C68: Copy maze background tiles into a guard's buffer
Used by the routines at 655B and 66A4.
Input
HL Guard's new location
6C68 PUSH BC Save BC.
6C69 PUSH DE Save DE.
6C6A PUSH HL Save the guard's location.
6C6B LD BC,$4000 Convert the guard's location into a display file address.
6C6E ADD HL,BC
6C6F CALL $6C0F Set HL' to the corresponding attribute file address.
6C72 LD DE,$6DBF Point DE at the first of the maze background tiles in the temporary guard buffer.
6C75 CALL $6C95 Copy the top-left maze background tile into the temporary guard buffer.
6C78 CALL $6C95 Copy the top-right maze background tile into the temporary guard buffer.
6C7B EXX Exchange registers.
6C7C LD BC,$001E Point HL' at the bottom-left tile's attribute byte.
6C7F ADD HL,BC
6C80 EXX Exchange registers.
6C81 LD A,L Point HL at the bottom-left tile in the display file.
6C82 ADD A,$1E
6C84 LD L,A
6C85 JR NC,$6C8B
6C87 LD A,H
6C88 ADD A,$08
6C8A LD H,A
6C8B CALL $6C95 Copy the bottom-left maze background tile into the temporary guard buffer.
6C8E CALL $6C95 Copy the bottom-right maze background tile into the temporary guard buffer.
6C91 POP DE Restore the guard's location to DE.
6C92 POP HL Restore the value in DE on entry to HL.
6C93 POP BC Restore BC.
6C94 RET
Prev: 6C46 Up: Map Next: 6C95