![]() |
Routines |
| Prev: 26361 | Up: Map | Next: 26413 |
|
Fills the edge column which has been newly placed on the screen.
|
||||
| FillNewAttributeColumn | 26368 | LD DE,30722 | DE=30722. | |
| 26371 | LD B,16 | Set a counter in B to process 16 rows. | ||
| FillNewAttributeColumn_Loop | 26373 | LD A,(DE) | Read the terrain data into A. | |
| 26374 | INC E | Move to the next column of terrain data. | ||
| 26375 | LD C,4 | Set the default colour in C to GREEN. | ||
| 26377 | CP 15 | Jump to SetNewAttributeColumn_Colour if the terrain byte is lower than 15 or higher than 144. | ||
| 26379 | JR C,SetNewAttributeColumn_Colour | |||
| 26381 | CP 144 | |||
| 26383 | JR NC,SetNewAttributeColumn_Colour | |||
| 26385 | INC C | Increment the colour byte in C by one (to CYAN). | ||
| 26386 | CP 61 | Jump to SetNewAttributeColumn_Colour if the terrain byte is lower than 61. | ||
| 26388 | JR C,SetNewAttributeColumn_Colour | |||
| 26390 | INC C | Increment the colour byte in C by one (to YELLOW). | ||
| 26391 | CP 81 | Jump to SetNewAttributeColumn_Colour if #the terrain byte is lower than 81. | ||
| 26393 | JR C,SetNewAttributeColumn_Colour | |||
| 26395 | LD C,2 | Set the colour in C to RED. | ||
| 26397 | CP 111 | Jump to SetNewAttributeColumn_Colour if the terrain byte is lower than 111. | ||
| 26399 | JR C,SetNewAttributeColumn_Colour | |||
| 26401 | INC C | Increment the colour byte in C by one (to MAGENTA). | ||
| SetNewAttributeColumn_Colour | 26402 | LD (HL),C | Write the attribute byte in C to the attribute buffer pointer. | |
| 26403 | LD A,32 | L+=32 to move down one position. | ||
| 26405 | ADD A,L | |||
| 26406 | LD L,A | |||
| 26407 | ADC A,H | Add the carry to H. | ||
| 26408 | SUB L | |||
| 26409 | LD H,A | |||
| 26410 | DJNZ FillNewAttributeColumn_Loop | Decrease the row counter by one and loop back to FillNewAttributeColumn_Loop until all the rows have been processed. | ||
| 26412 | RET | Return. | ||
| Prev: 26361 | Up: Map | Next: 26413 |
SUB Linstruction then removes the low byte from the high byte calculation, leaving just the original high byte + the carry flag.