| Routines

29977: Copy a graphic buffer to the screen

Used by the routines at 27406 (to print the Skool Daze logo and the score box), 30464 (to print a lines bubble), 31040 (to print the lesson box) and 63829 (to print a safe combination letter in a bubble).
Input
DE | Attribute file address
HL | Graphic buffer address
29977 | PUSH DE | Save the attribute file address
29978 | LD BC,8 | Copy the first row of attribute bytes from the graphic buffer to the screen
29981 | LDIR
29983 | LD C,24 | Copy the second row of attribute bytes from the graphic buffer to the screen
29985 | EX DE,HL
29986 | ADD HL,BC
29987 | EX DE,HL
29988 | LD C,8
29990 | LDIR
29992 | LD C,24 | Copy the third row of attribute bytes from the graphic buffer to the screen
29994 | EX DE,HL
29995 | ADD HL,BC
29996 | EX DE,HL
29997 | LD C,8
29999 | LDIR
The attribute bytes have been copied to the screen. Now for the graphic bytes. This entry point is used by the routine at 30156.
30001 | POP DE | Restore the attribute file address to DE
30002 | LD A,D | Set DE to the corresponding display file address
30003 | SUB 80
30005 | ADD A,A
30006 | ADD A,A
30007 | ADD A,A
30008 | LD D,A
30009 | LD C,3 | There are three rows of UDGs to copy to the screen
30011 | LD A,8 | There are 8 pixel lines per row of UDGs
30013 | PUSH BC | Save C (the row counter)
30014 | PUSH DE | Copy a row of 8 UDGs from the graphic buffer to the screen
30015 | LD C,8
30017 | LDIR
30019 | POP DE
30020 | INC D
30021 | DEC A
30022 | JR NZ,30014
30024 | LD A,E | Set DE to the display file address for the next row
30025 | ADD A,32
30027 | LD E,A
30028 | JR C,30034
30030 | LD A,D
30031 | SUB 8
30033 | LD D,A
30034 | POP BC | Restore the row counter to C
30035 | DEC C | Next row
30036 | JR NZ,30011 | Jump back until all three rows of UDGs have been copied
30038 | RET |