![]() |
Routines |
| Prev: 6961 | Up: Map | Next: 6992 |
|
Used by the routine at Game_Initialise.
Displays a rainbow-like cycling colour border while waiting for the player to press "S" to unpause the game.
|
||||||||||||||||||||
| Pause_BorderEffect | 6966 | EI | Enable interrupts. | |||||||||||||||||
| 6967 | LD B,$14 | Pause for 14 frames to give the player a moment before the effect begins. | ||||||||||||||||||
| Pause_BorderEffect_ShortLoop | 6969 | HALT | ||||||||||||||||||
| 696A | DJNZ Pause_BorderEffect_ShortLoop | |||||||||||||||||||
| Pause_BorderEffect_ColourCycle | 696C | LD B,$0E | Set a frame counter in B of 0E frames. | |||||||||||||||||
| 696E | HALT | Halt operation (suspend CPU until the next interrupt). | ||||||||||||||||||
|
Derive a border colour (00-07) from the current frame loop counter.
|
||||||||||||||||||||
| Pause_BorderEffect_ColourLoop | 696F | LD A,B | Load A with bits 0-2 of the current frame counter value. This limits the value to be between 00-07 (i.e. the colour palette). | |||||||||||||||||
| 6970 | AND %00000111 | |||||||||||||||||||
| 6972 | PUSH BC | Stash the frame counter on the stack. | ||||||||||||||||||
| Pause_Border_PauseLoop_01 | 6973 | DJNZ Pause_Border_PauseLoop_01 | Decrease the frame counter by one and loop until the counter is zero. | |||||||||||||||||
| 6975 | POP BC | Restore the frame counter from the stack. | ||||||||||||||||||
| 6976 | PUSH BC | But keep a copy of it back on the stack. | ||||||||||||||||||
| 6977 | LD B,$00 | Set B to 00 which increases the size of the counter. | ||||||||||||||||||
| Pause_Border_PauseLoop_02 | 6979 | DJNZ Pause_Border_PauseLoop_02 | Decrease the frame counter by one and loop again until the counter is zero. | |||||||||||||||||
| 697B | POP BC | Restore the frame counter from the stack. | ||||||||||||||||||
| 697C | OUT ($FE),A | Set border to the colour held by A. | ||||||||||||||||||
| 697E | DJNZ Pause_BorderEffect_ColourLoop | Decrease counter by one and loop back to Pause_BorderEffect_ColourLoop until counter is zero. | ||||||||||||||||||
| 6980 | LD A,$FD | Read from the keyboard;
|
||||||||||||||||||
| 6982 | IN A,($FE) | |||||||||||||||||||
| 6984 | AND %00000010 | Keep only the bit which relates to the "S" key (bit 1). | ||||||||||||||||||
| 6986 | JR NZ,Pause_BorderEffect_ColourCycle | Jump back to Pause_BorderEffect_ColourCycle if the "S" key was not pressed. | ||||||||||||||||||
| 6988 | LD A,$FD | Read from the keyboard again;
|
||||||||||||||||||
| StartKey_Debounce | 698A | IN A,($FE) | ||||||||||||||||||
| 698C | AND %00000010 | Keep only the bit which relates to the "S" key (bit 1). | ||||||||||||||||||
| 698E | JR Z,StartKey_Debounce | Jump to StartKey_Debounce until the "S" key has been released. | ||||||||||||||||||
| 6990 | DI | Disable interrupts. | ||||||||||||||||||
| 6991 | RET | Return. | ||||||||||||||||||
| Prev: 6961 | Up: Map | Next: 6992 |