![]() |
Routines |
| Prev: 8D16 | Up: Map | Next: 8D85 |
|
Used by the routines at HandlerMatchVerb and GameStart.
Run the scenic check, read a command and dispatch it.
|
||||
| GameLoop | 8D2A | CALL HandlerTurnBasedEvents | Call HandlerTurnBasedEvents to turn-based events. | |
| 8D2D | LD HL,$6224 | Check the scenic-event rooms. | ||
| 8D30 | LD BC,$0008 | There are eight scenic rooms to check. | ||
| GameLoop_Loop1 | 8D33 | LD A,($6223) | Fetch the current room. | |
| 8D36 | CPIR | See whether the player is standing in this scenic room. | ||
| 8D38 | JR NZ,GameLoop_Step1 | The player is not in this scenic room. | ||
| 8D3A | PUSH HL | Keep the scenic search while the warning is printed. | ||
| 8D3B | PUSH BC | |||
| 8D3C | LD HL,$7851 | Print An alien soldier has appeared. He fires a plasma gun at you.. | ||
| 8D3F | CALL PrintStringAndANewline | |||
| 8D42 | LD A,$14 | The plasma shell has one chance in 14 of hitting. | ||
| 8D44 | CALL GenerateRandomNumber | Call GenerateRandomNumber to generate random number. | ||
| 8D47 | JR Z,HandlerPlasmaShell | The shell hits when that draw comes up zero. | ||
| 8D49 | LD HL,$788F | Print But he missed.. | ||
| 8D4C | CALL PrintStringAndANewline | |||
| 8D4F | POP BC | Restore the scenic-room search. | ||
| 8D50 | POP HL | |||
| 8D51 | XOR A | See whether another scenic room is still to be checked. | ||
| 8D52 | OR C | |||
| 8D53 | JR NZ,GameLoop_Loop1 | Check the next scenic room. | ||
| GameLoop_Step1 | 8D55 | CALL Handler_UserInput | Call Handler_UserInput to read another command. | |
| 8D58 | LD A,($6291) | Fetch the first word of the command. | ||
| 8D5B | CP $59 | Jump to GameLoop_Step3 when Y (59) was not pressed. | ||
| 8D5D | JR NZ,GameLoop_Step3 | |||
| GameLoop_Step2 | 8D5F | LD HL,$997F | Continue at HandlerMatchVerb_Step2 to run Action: Type. | |
| 8D62 | JP HandlerMatchVerb_Step2 | |||
| GameLoop_Step3 | 8D65 | XOR A | Start the synonym scan with a clear result. | |
| 8D66 | LD HL,$6291 | Check the command's word tokens for a noun. | ||
| 8D69 | LD B,$0A | A command has at most 0A word tokens. | ||
| GameLoop_Loop2 | 8D6B | LD A,(HL) | Read the next word token. | |
| 8D6C | CP $FF | Jump to HandlerMatchVerb when the command has no more words (FF). | ||
| 8D6E | JR Z,HandlerMatchVerb | |||
| 8D70 | EXX | Look that token up in the noun list without losing the token pointer. | ||
| 8D71 | LD HL,$8868 | |||
| 8D74 | LD BC,($62C8) | |||
| 8D78 | CPIR | |||
| 8D7A | JR NZ,GameLoop_Step4 | This token is not a noun, so try the next word. | ||
| 8D7C | CALL Parser_ResolvePhrase | Call Parser_ResolvePhrase to resolve phrase. | ||
| 8D7F | JR C,GameLoop | Jump back to GameLoop when the carry flag is set. | ||
| GameLoop_Step4 | 8D81 | EXX | Bring the token pointer back. | |
| 8D82 | INC HL | Move on to the next word token. | ||
| 8D83 | DJNZ GameLoop_Loop2 | Repeat for the remaining words of the command. | ||
| Prev: 8D16 | Up: Map | Next: 8D85 |