Prev: E148 Up: Map Next: E200
E1AD: Copy Attributes To Screen
Used by the routine at CopyBuffersToScreen.
Copies the attributes of the attribute buffer onto the screen, in the same way as CopyPixelsToScreen. The buffer holds 14 rows of 24 bytes, and the top row of the buffer is the bottom row of the playing area.
Point the stack at the last row of attributes.
CopyAttributesToScreen E1AD LD ($BBAE),SP Save the stack pointer, point it at the end of the last row of attributes of the playing area, count 14 rows, and point HL at the end of the first row of the buffer.
E1B1 LD SP,$59FD
E1B4 LD B,$0E
E1B6 LD HL,$F05B
Copy a row and step up the screen.
CopyAttributesToScreen_Row E1B9 LD D,(HL) Copy the last twenty bytes of the row from the buffer onto the screen, two at a time.
E1BA DEC HL
E1BB LD E,(HL)
E1BC DEC HL
E1BD PUSH DE
E1BE LD D,(HL)
E1BF DEC HL
E1C0 LD E,(HL)
E1C1 DEC HL
E1C2 PUSH DE
E1C3 LD D,(HL)
E1C4 DEC HL
E1C5 LD E,(HL)
E1C6 DEC HL
E1C7 PUSH DE
E1C8 LD D,(HL)
E1C9 DEC HL
E1CA LD E,(HL)
E1CB DEC HL
E1CC PUSH DE
E1CD LD D,(HL)
E1CE DEC HL
E1CF LD E,(HL)
E1D0 DEC HL
E1D1 PUSH DE
E1D2 LD D,(HL)
E1D3 DEC HL
E1D4 LD E,(HL)
E1D5 DEC HL
E1D6 PUSH DE
E1D7 LD D,(HL)
E1D8 DEC HL
E1D9 LD E,(HL)
E1DA DEC HL
E1DB PUSH DE
E1DC LD D,(HL)
E1DD DEC HL
E1DE LD E,(HL)
E1DF DEC HL
E1E0 PUSH DE
E1E1 LD D,(HL)
E1E2 DEC HL
E1E3 LD E,(HL)
E1E4 DEC HL
E1E5 PUSH DE
E1E6 LD D,(HL)
E1E7 DEC HL
E1E8 LD E,(HL)
E1E9 DEC HL
E1EA PUSH DE
E1EB LD D,(HL) Copy the first two bytes of the row onto the screen.
E1EC DEC HL
E1ED LD E,(HL)
E1EE PUSH DE
E1EF EX DE,HL Keep the buffer address in DE.
E1F0 LD HL,$FFF6 Move up one row of attributes on the screen.
E1F3 ADD HL,SP
E1F4 LD SP,HL
E1F5 LD HL,$002D Move on to the end of the next row of the buffer.
E1F8 ADD HL,DE
E1F9 DJNZ CopyAttributesToScreen_Row Loop back until all of the rows have been copied.
E1FB LD SP,($BBAE) Get the stack pointer back and return.
E1FF RET
Prev: E148 Up: Map Next: E200