Data
| Prev: 9860 | Up: Map | Next: 994D |
9921: Plan script: you (actor 0) - read, parse and do the player's commands
|
The player is a character like any other, and this is its script. Each pass: D6BF reads a line from the keyboard with a time limit (D898; if the player types nothing for a few seconds the step fails and the player WAITs instead, so the game goes on), D715 turns the line ($5B00) into a list of words at $5B81 (D9C5), D769 checks for words left, D77E looks the next words up (AAB2) and splits off one sentence (9FF0 -> 9FF2), D7D9 checks that there is a sentence, D7FA parses it (B191) into a verb and objects and copies them into the plan registers (D826, D82C), and DO plan verb / plan dobj / plan iobj carries it out. When a step fails the script goes back a step or two, which is how a line with several commands is worked through one sentence per turn.
'TAKE LAMP. EXAMINE LAMP. INVENTORY' typed as one line is carried out one sentence a minute - the lamp is taken at 8:02, examined at 8:03 and the inventory listed at 8:04, with the clock printed between, before the next prompt.
Entry points: 9921 = you (actor 0).
Each sub-block is one instruction. Room and object numbers are as the game uses them (the reference pages list both).
In an instruction, 'plan dobj' and 'plan iobj' are not fixed objects: they mean the direct and indirect object currently held in the actor's plan registers (bytes +4 and +5 of its actor record), so the same step works on whatever the actor is dealing with - for the player, the objects of the command just typed. 'plan verb' is the verb register (+3), 'self' is the acting character, and '-' means none.
|
||||
| 9921 | DEFB $01,$22 | DO 34 LOOK | ||
| 9923 | DEFB $13,$BF,$D6,$48,$99 | RUN D6BF [fail 9948] | ||
| 9928 | DEFB $13,$15,$D7,$23,$99 | RUN D715 [fail 9923] | ||
| 992D | DEFB $13,$69,$D7,$23,$99 | RUN D769 [fail 9923] | ||
| 9932 | DEFB $13,$7E,$D7,$23,$99 | RUN D77E [fail 9923] | ||
| 9937 | DEFB $13,$D9,$D7,$2D,$99 | RUN D7D9 [fail 992D] | ||
| 993C | DEFB $13,$FA,$D7,$37,$99 | RUN D7FA [fail 9937] | ||
| 9941 | DEFB $02,$FA,$FD,$FC | DO plan verb: plan dobj, plan iobj | ||
| 9945 | DEFB $0E,$37,$99 | GOTO 9937 | ||
| 9948 | DEFB $01,$31 | DO 49 WAIT HERE | ||
| 994A | DEFB $0E,$23,$99 | GOTO 9923 | ||
| Prev: 9860 | Up: Map | Next: 994D |