Prev: 38381 Up: Map Next: 38579
38443: "You see ..." Routines
Used by the routine at Action_Dir.
YouSeeEntry 38443 LD HL,45056 HL="You see[0x16]".
38446 JR YouSeeWrapper Jump to YouSeeWrapper.
This entry point is used by the routines at Action_Look, Action_Dir and ActionClimbOut.
YouSeePreposition 38448 PUSH AF Stash AF on the stack.
38449 CALL LocateLocation Call LocateLocation.
38452 LD A,(IX+0) Fetch the location attribute, keep only bits 1-3 which signify the location preposition ("IN", "ON", "AT", etc).
38455 AND %00001110
38457 LD E,A Create an offset for the preposition word look-up.
38458 LD D,0
38460 LD HL,47744 Add the offset to 47744.
38463 ADD HL,DE
38464 LD E,(HL) Fetch the referenced text bytes which display the preposition word.
38465 INC HL
38466 LD D,(HL)
38467 LD HL,45053 Write the text tokens to $AFFD which updates the copy for "You are XXXX[0x16]".
38470 LD (HL),D
38471 INC HL
38472 LD (HL),E
38473 POP AF Restore AF from the stack.
38474 LD HL,45052 HL="You are in[0x16]".
This entry point is used by the routine at ActionCapture.
YouSeeWrapper 38477 PUSH IX Stash IX, IY and BC on the stack.
38479 PUSH IY
38481 PUSH BC
38482 CALL YouSeeStart Call YouSeeStart.
38485 POP BC Restore BC, IY and IX from the stack.
38486 POP IY
38488 POP IX
38490 RET Return.
From here starts the "intro" to a location;
  • Print the "You see[0x16]" text
  • Handle printing the location data message for this location (if one exists)
  • Handles initiating the location graphics/ drawing (if it exists)
  • Handles waiting for a keypress (if something was drawn)
  • Prints available exits
YouSeeStart 38491 LD B,A Store A in B temporarily.
38492 CALL LocateLocation Call LocateLocation to set IX to point to the appropriate location data for the current location.
38495 CALL PrintMsg Call PrintMsg.
38498 LD L,(IX+8) Load the location data offset for the current location description.
38501 LD H,(IX+9)
38504 LD A,H Check that there is a value for the description, set zero flag if not.
38505 OR L
38506 CALL YouSeePrint Call YouSeePrint.
38509 LD A,B Restore the previous value of A (the location ID).
38510 CALL Drawing Call Drawing.
38513 LD A,(32631) Test if LocationID contains $FF, call WaitForKey2 if it does not (i.e. wait for a keypress only if something has been drawn).
38516 INC A
38517 CALL NZ,WaitForKey2
38520 CALL 34179 Call 34179.
38523 LD A,B Restore the previous value of A (the location ID).
38524 CALL 41160 Call 41160.
YouSeeExits 38527 LD A,B Restore the previous value of A (the location ID).
38528 CALL DisplayExits Call DisplayExits.
38531 JP 40852 Jump to 40852.
YouSeePrint 38534 JP NZ,PrintMsg Print the location description if one is present.
YouSeeNext 38537 LD DE,2 DE=$0002.
38540 PUSH IY Stash IY on the stack.
38542 PUSH IX IY=IX.
38544 POP IY
38546 ADD IY,DE IY=IY + $0002 (from DE).
38548 CALL 40662 Call 40662.
38551 POP IY Restore IY from the stack.
38553 RET Return.
This is almost a carbon copy of WaitForKey only differing in that it ends with a return.
WaitForKey2 38554 XOR A Read from the keyboard port.
38555 IN A,(254)
38557 AND %00011111 A pressed key from any line will set its respective bit; bit 0 (outer key) to bit 4 (inner key). Hence keep only bits 0-4 for the check.
38559 CP 31 Loop back to WaitForKey2 until any key has been pressed.
38561 JR Z,WaitForKey2
38563 LD A,7 Set the border to white.
38565 OUT (254),A
38567 RET Return.
This entry point is used by the routine at Action_Dir.
YouSeeController 38568 CALL LocateLocation Call LocateLocation.
38571 CALL YouSeeNext Call YouSeeNext.
38574 CALL 34179 Call 34179.
38577 JR YouSeeExits Jump to YouSeeExits.
Prev: 38381 Up: Map Next: 38579