Routines |
Prev: 60591 | Up: Map | Next: 60690 |
First draw a yellow "GAME OVER":
|
|||||
Controller_GameOver | 60607 | LD C,54 | C=INK: YELLOW, PAPER: YELLOW . | ||
60609 | XOR A | Set *GameOver_X_Offset to 0. | |||
60610 | LD (60911),A | ||||
60613 | LD A,1 | Set *GameOver_Y_Offset to 1. | |||
60615 | LD (60912),A | ||||
60618 | CALL Draw_GameOver | Call Draw_GameOver. | |||
Then, a little offset to the first one, draw a cyan "GAME OVER".
|
|||||
60621 | LD C,109 | C=INK: CYAN, PAPER: CYAN (BRIGHT) . | |||
60623 | XOR A | Set *GameOver_Y_Offset to 0. | |||
60624 | LD (60912),A | ||||
60627 | CALL Draw_GameOver | Call Draw_GameOver. | |||
Now flash the "GAME OVER" cycling down and back up through the following colours:
|
|||||
60630 | LD B,10 | Set a counter in B of 10 to count the number of down/ up cycles here. | |||
GameOver_Flash_Loop | 60632 | LD A,1 | Set *GameOver_X_Offset to 1. | ||
60634 | LD (60911),A | ||||
60637 | PUSH BC | Stash the colour loop counter on the stack. | |||
First cycle down, starting at: INK:
WHITE,
PAPER:
WHITE
(BRIGHT)
(127).
|
|||||
60638 | LD C,127 | Set the starting colour value in C to INK: WHITE, PAPER: WHITE (BRIGHT) . | |||
CycleDown_Loop | 60640 | CALL Draw_GameOver | Call Draw_GameOver. | ||
60643 | LD A,C | Jump to CycleUp_Loop if the current colour is: INK: BLUE, PAPER: BLUE (BRIGHT) (73). | |||
60644 | CP 73 | ||||
60646 | JR Z,CycleUp_Loop | ||||
60648 | SUB 9 | Subtract 9 from the current colour value and store the result back in C. | |||
60650 | LD C,A | ||||
60651 | CALL GameOver_FlashOffset | Call GameOver_FlashOffset. | |||
60654 | JR CycleDown_Loop | Jump to CycleDown_Loop. | |||
Next cycle back up again; on first entry, starting at INK:
BLUE,
PAPER:
BLUE
(BRIGHT)
(73).
|
|||||
CycleUp_Loop | 60656 | LD A,C | Jump to GameOver_Cycle_Next if the current colour is: INK: YELLOW, PAPER: YELLOW (BRIGHT) (118). | ||
60657 | CP 118 | ||||
60659 | JR Z,GameOver_Cycle_Next | ||||
60661 | ADD A,9 | Add 9 to the current colour value and store the result back in C. | |||
60663 | LD C,A | ||||
60664 | CALL Draw_GameOver | Call Draw_GameOver. | |||
60667 | CALL GameOver_FlashOffset | Call GameOver_FlashOffset. | |||
60670 | JR CycleUp_Loop | Jump to CycleUp_Loop. | |||
Handle the flash loop.
|
|||||
GameOver_Cycle_Next | 60672 | POP BC | Restore the cycle counter from the stack. | ||
60673 | DJNZ GameOver_Flash_Loop | Decrease the cycle counter by one and loop back to GameOver_Flash_Loop until the cycle has repeated 10 times. | |||
60675 | LD B,2 | B=2. | |||
Controller_GameOver_0 | 60677 | PUSH BC | Stash BC on the stack. | ||
60678 | LD HL,60690 | HL=60690. | |||
60681 | LD B,40 | B=40. | |||
60683 | CALL 61290 | Call 61290. | |||
60686 | POP BC | Restore BC from the stack. | |||
60687 | DJNZ Controller_GameOver_0 | Decrease counter by one and loop back to Controller_GameOver_0 until counter is zero. | |||
60689 | RET | Return. |
Prev: 60591 | Up: Map | Next: 60690 |