![]() |
Routines |
| Prev: 44340 | Up: Map | Next: 44460 |
|
Used by the routine at QueueProgram.
Clears an area of the screen that is four characters wide and thirty-two lines high, working upwards from the address that is given.
|
||||||||
| ClearIconArea | 44423 | PUSH BC | Save the registers. | |||||
| 44424 | PUSH DE | |||||||
| 44425 | PUSH HL | |||||||
| 44426 | LD C,32 | There are 32 lines to clear. | ||||||
| ClearIconArea_Line | 44428 | LD B,4 | There are four bytes in a line. | |||||
| 44430 | XOR A | Clear a byte... | ||||||
| ClearIconArea_Byte | 44431 | LD (HL),A | ...on the screen. | |||||
| 44432 | INC L | Move on to the next byte. | ||||||
| 44433 | DJNZ ClearIconArea_Byte | Loop back until the line has been cleared. | ||||||
| 44435 | DEC L | Go back to the start of the line. | ||||||
| 44436 | DEC L | |||||||
| 44437 | DEC L | |||||||
| 44438 | DEC L | |||||||
| 44439 | LD A,H | Fetch the high byte of the address... | ||||||
| 44440 | DEC H | ...and move up one line. | ||||||
| 44441 | AND 7 | Jump if that has not moved into the character above. | ||||||
| 44443 | JR NZ,ClearIconArea_Next | |||||||
| 44445 | LD A,H | Otherwise fetch the high byte again, as it has moved up a row of characters... | ||||||
| 44446 | ADD A,8 | ...add eight to it... | ||||||
| 44448 | LD H,A | ...and store it. | ||||||
| 44449 | LD A,L | Fetch the low byte... | ||||||
| 44450 | SUB 32 | ...take one row of characters off it... | ||||||
| 44452 | LD L,A | ...and store it. | ||||||
| ClearIconArea_Next | 44453 | DEC C | Loop back until all of the lines have been cleared. | |||||
| 44454 | JR NZ,ClearIconArea_Line | |||||||
| 44456 | POP HL | Restore the registers. | ||||||
| 44457 | POP DE | |||||||
| 44458 | POP BC | |||||||
| 44459 | RET | Return. | ||||||
| Prev: 44340 | Up: Map | Next: 44460 |