|  | Routines | 
| Prev: 24336 | Up: Map | Next: 24448 | 
| 
Takes the background reference from Background_Reference and executes the appropriate routine to copy the background data addresses to the buffer at Background_Data_Buffer.  Used by the routine at 37376. | |||||||||||
| 
Blanks the screen.
 | |||||||||||
| Change_Background | 24354 | LD HL,22528 | Writes 63 to all 768 locations of the attributes buffer. 
 | ||||||||
| 24357 | LD E,L | ||||||||||
| 24358 | LD D,H | ||||||||||
| 24359 | INC DE | ||||||||||
| 24360 | LD (HL),63 | ||||||||||
| 24362 | LD BC,767 | ||||||||||
| 24365 | LDIR | ||||||||||
| 24367 | LD HL,16384 | Writes 0 to all 6144 locations of the screen buffer. | |||||||||
| 24370 | LD E,L | ||||||||||
| 24371 | LD D,H | ||||||||||
| 24372 | INC DE | ||||||||||
| 24373 | LD BC,6143 | ||||||||||
| 24376 | LD (HL),0 | ||||||||||
| 24378 | LDIR | ||||||||||
| 
Fetch the background reference from Background_Reference and use it to calculate the address for the copy-to-buffer routine.
 | |||||||||||
| 24380 | LD HL,24320 | Loads A with the contents of Background_Reference. | |||||||||
| 24383 | LD A,(HL) | ||||||||||
| 24384 | DEC A | Decrease it by one, then double it. | |||||||||
| 24385 | ADD A,A | ||||||||||
| 24386 | LD C,A | Store it as the LSB of BC (MSB is 0). | |||||||||
| 24387 | LD B,0 | ||||||||||
| 24389 | LD (HL),B | Write 0 to Background_Reference. | |||||||||
| 24390 | LD HL,24330 | HL=The beginning of three address references for the copy routines which populate Background_Data_Buffer at $5F0A. | |||||||||
| 24393 | ADD HL,BC | Add BC to HL. | |||||||||
| 24394 | LD E,(HL) | DE=One of the three background address references; 
 | |||||||||
| 24395 | INC HL | ||||||||||
| 24396 | LD D,(HL) | ||||||||||
| 24397 | EX DE,HL | Swap the DE and HL registers. | |||||||||
| 24398 | CALL Indirect_Jump | Call Indirect_Jump. | |||||||||
| 24401 | RET | Return. | |||||||||
| 
Indirect jump to copy-to-buffer routine.
 | |||||||||||
| Indirect_Jump | 24402 | JP (HL) | Indirect jump to address held by HL. 
 | ||||||||
| 
Set up background 1.
 | |||||||||||
| 24403 | LD HL,24619 | Copies 18 bytes of data from Background_1_Addresses to Background_Data_Buffer. | |||||||||
| 24406 | LD DE,24336 | ||||||||||
| 24409 | LD BC,18 | ||||||||||
| 24412 | LDIR | ||||||||||
| 24414 | CALL Create_Background | Call Create_Background. | |||||||||
| 24417 | RET | Return. | |||||||||
| 
Set up background 2.
 | |||||||||||
| 24418 | LD HL,24637 | Copies 18 bytes of data from Background_2_Addresses to Background_Data_Buffer. | |||||||||
| 24421 | LD DE,24336 | ||||||||||
| 24424 | LD BC,18 | ||||||||||
| 24427 | LDIR | ||||||||||
| 24429 | CALL Create_Background | Call Create_Background. | |||||||||
| 24432 | RET | Return. | |||||||||
| 
Set up background 3.
 | |||||||||||
| 24433 | LD HL,24655 | Copies 18 bytes of data from Background_3_Addresses to Background_Data_Buffer. | |||||||||
| 24436 | LD DE,24336 | ||||||||||
| 24439 | LD BC,18 | ||||||||||
| 24442 | LDIR | ||||||||||
| 24444 | CALL Create_Background | Call Create_Background. | |||||||||
| 24447 | RET | Return. | |||||||||
| Prev: 24336 | Up: Map | Next: 24448 |