![]() |
Routines |
| Prev: 63678 | Up: Map | Next: 63766 |
|
Used by the routine at GameEntryPoint.
|
||||||||||||||||||||
|
In-game Holding down "SHIFT" and pressing 1, 2 or 3 has the following effect:
|
||||||||||||||||||||
| Controls_PauseQuit | 63695 | LD A,254 |
|
|||||||||||||||||
| 63697 | CALL ReadKeyboard | Call ReadKeyboard. | ||||||||||||||||||
| 63700 | CP 1 | Return if "SHIFT" is not being pressed. | ||||||||||||||||||
| 63702 | RET NZ | |||||||||||||||||||
|
"SHIFT" is being held down here. Test for the number keys.
|
||||||||||||||||||||
| 63703 | CALL ReadKeyboard_1234 | Call ReadKeyboard_1234. | ||||||||||||||||||
| 63706 | CP 4 | Jump to QuitGame if "3" is being pressed. | ||||||||||||||||||
| 63708 | JR Z,QuitGame | |||||||||||||||||||
| 63710 | CP 1 | Return if "1" is not being pressed. | ||||||||||||||||||
| 63712 | RET NZ | |||||||||||||||||||
|
If "1" is being pressed - this is where the "in-game pause" loop begins.
|
||||||||||||||||||||
| PauseGame_Loop | 63713 | LD A,254 |
|
|||||||||||||||||
| 63715 | CALL ReadKeyboard | Call ReadKeyboard. | ||||||||||||||||||
| 63718 | CP 1 | Test for "SHIFT"... | ||||||||||||||||||
| 63720 | LD B,6 | B=6. | ||||||||||||||||||
| 63722 | JR NZ,GamePaused | Jump to GamePaused if "SHIFT" is not being pressed. | ||||||||||||||||||
| 63724 | CALL ReadKeyboard_1234 | Call ReadKeyboard_1234. | ||||||||||||||||||
| 63727 | CP 4 | Jump to TestFor_ResumeGame if "3" (quit) is not being pressed. | ||||||||||||||||||
| 63729 | JR NZ,TestFor_ResumeGame | |||||||||||||||||||
|
Action quitting the game.
|
||||||||||||||||||||
| QuitGame | 63731 | LD A,1 | Write 1 to *Game_State. | |||||||||||||||||
| 63733 | LD (54269),A | |||||||||||||||||||
|
To resume the game we just reset the border colour and RETurn from the pause loop.
|
||||||||||||||||||||
| ResumeGame | 63736 | XOR A | Set the border to BLACK. | |||||||||||||||||
| 63737 | OUT (254),A | |||||||||||||||||||
| 63739 | RET | Return. | ||||||||||||||||||
|
The game is in the pause loop so test if we want to resume.
|
||||||||||||||||||||
| TestFor_ResumeGame | 63740 | CP 2 | Jump to ResumeGame if "2" is being pressed. | |||||||||||||||||
| 63742 | JR Z,ResumeGame | |||||||||||||||||||
| 63744 | LD B,6 | B=6. | ||||||||||||||||||
|
Creates a nice border pattern.
|
||||||||||||||||||||
| GamePaused | 63746 | LD A,B | A=B. | |||||||||||||||||
| 63747 | OUT (254),A | Change border very quickly to create a rainbow effect. | ||||||||||||||||||
| 63749 | OUT (254),A | |||||||||||||||||||
| 63751 | DJNZ GamePaused | Decrease counter by one and loop back to GamePaused until counter is zero. | ||||||||||||||||||
| 63753 | CALL ReadKeyboard_1234 | Call ReadKeyboard_1234. | ||||||||||||||||||
| 63756 | JR PauseGame_Loop | Loop back to PauseGame_Loop. | ||||||||||||||||||
|
Testing for the number keys.
|
||||||||||||||||||||
| ReadKeyboard_1234 | 63758 | LD A,247 |
|
|||||||||||||||||
| ReadKeyboard | 63760 | IN A,(254) | Read from the keyboard. | |||||||||||||||||
| 63762 | CPL | Invert the bits in A. | ||||||||||||||||||
| 63763 | AND %00001111 | Keep only bits 0-3. | ||||||||||||||||||
| 63765 | RET | Return. | ||||||||||||||||||
| Prev: 63678 | Up: Map | Next: 63766 |