Prev: AC94 Up: Map Next: ACCC
ACA6: Copy Display Data To Display Buffer
Used by the routine at CopyDisplayIfNeeded.
Copies display data from the character data structure to the display buffer at AAA8. If bit 6 of E is set, copies from offset 04; if bit 7 of E is set, copies from offset 0E. Always sets bit 0 of the return value.
Input
E Flags (bits 6 and 7 indicate which display data set to copy)
Output
A Bit 0 is set if data was copied
CopyDisplayDataToDisplayBuffer ACA6 BIT 6,E Jump ahead to CopyDisplayDataToDisplayBuffer_Next if bit 6 is clear.
ACA8 JR Z,CopyDisplayDataToDisplayBuffer_Next
ACAA RES 6,E Clear the marker.
ACAC PUSH DE Keep DE, take offset 04 and join the copy at CopyDisplayDataToDisplayBuffer_AddOffset.
ACAD LD DE,$0004
ACB0 JR CopyDisplayDataToDisplayBuffer_AddOffset
Bit 7 selects the second display block.
CopyDisplayDataToDisplayBuffer_Next ACB2 BIT 7,E See whether bit 7 of the low byte of the source is set.
ACB4 RET Z Return if that marker is clear.
ACB5 RES 7,E Clear bit 7 and take offset 000E, keeping DE.
ACB7 PUSH DE
ACB8 LD DE,$000E
CopyDisplayDataToDisplayBuffer_AddOffset ACBB PUSH IY Use the buffer: co-ordinate header (AAA8).
ACBD POP HL
ACBE ADD HL,DE
ACBF LD DE,$AAA8
ACC2 EX DE,HL
ACC3 LD BC,$000A Take a length of 0A entries and copy these bytes across.
ACC6 LDIR
ACC8 POP DE
ACC9 OR %00000001 Reset the zero flag.
ACCB RET Return.
View the equivalent code in;
Prev: AC94 Up: Map Next: ACCC