![]() |
Routines |
| Prev: 47941 | Up: Map | Next: 47996 |
|
Used by the routines at GameComplete, ShowAmulet, HandlerPoems, GameOver_1UP_Messaging, EnterRoomBelow, InitialiseGame, SwitchPlayer and HandlerGameMenu.
Clears the top third of the screen, but only from below the banner. The banner is left untouched.
|
||||||||
|
||||||||
| ClearPlayArea | 47964 | LD HL,16448 | HL=16448(screen buffer). | |||||
|
Here D contains the value to be written (0) and E holds the number of rows of pixels to act on (the full height of a character block).
|
||||||||
| 47967 | LD DE,8 | DE=0008. | ||||||
|
B holds the number of columns (i.e. 32 == full width of the screen), and C is a counter for how many rows to clear (i.e. the top third would usually be 8 rows, but the banner takes up two - hence this initialises to 6).
|
||||||||
| 47970 | LD BC,8198 | BC=8198. | ||||||
| ClearPlayArea_ClearLine | 47973 | PUSH BC | Stash BC and HL on the stack. | |||||
| 47974 | PUSH HL | |||||||
| ClearPlayArea_ClearLine_Start | 47975 | PUSH BC | Stash BC on the stack. | |||||
| ClearPlayArea_ClearLine_Loop | 47976 | LD (HL),D | Write 0 (D) to the screen (HL). | |||||
| 47977 | INC L | Move "right" onto the next column. | ||||||
| 47978 | DJNZ ClearPlayArea_ClearLine_Loop | Decrease the width counter by one and loop back to ClearPlayArea_ClearLine_Loop until counter is zero. | ||||||
|
Resets the width counter ready for the next loop.
|
||||||||
| 47980 | POP BC | Restore BC from the stack. | ||||||
| 47981 | DEC C | Decrease the number of rows counter by one. | ||||||
| 47982 | JR NZ,ClearPlayArea_ClearLine_Start | Jump back to ClearPlayArea_ClearLine_Start unless C is zero. | ||||||
|
Resets the screen buffer to where the clearing started for this loop, then moves down one character block.
|
||||||||
| 47984 | POP HL | Restore HL from the stack. | ||||||
| 47985 | INC H | Increments H by one. | ||||||
| 47986 | POP BC | Restore BC from the stack. | ||||||
| 47987 | DEC E | Decrease the pixel row counter by one. | ||||||
| 47988 | JR NZ,ClearPlayArea_ClearLine | Jump back to ClearPlayArea_ClearLine unless E is zero. | ||||||
|
Clears the other two thirds of the screen, so now the screen only contains the banner.
|
||||||||
| 47990 | LD HL,18432 | HL=18432(screen buffer). | ||||||
| 47993 | JP ResetScreen_FromAddress | Jump to ResetScreen_FromAddress. | ||||||
| Prev: 47941 | Up: Map | Next: 47996 |