Prev: 24966 Up: Map Next: 25245
24967: Describe Location
Used by the routines at GameLoop, ObeyCommand, OfferAnotherGame and RedrawLocation.
Prints where the player is, what is here, and which ways lead out. Bank 6 supplies the long text for rooms below 102, and it opens "welcome to Blizzard Pass by Alan Cox. This program is dedicated to Hawkwind. Any resemblance between the characters in the game and your mother in law is total coincidence". A dark room says so and lists nothing. The text is underlined before the cursor is put back for the prompt.
Remember the cursor, and choose a row. Pictures use row 13 so the text sits under the illustration.
DescribeLocation 24967 LD A,255 The description pauses at the bottom of the picture.
24969 LD (24966),A
24972 LD A,46 A full stop makes the first letter a capital.
24974 LD (23451),A
24977 LD HL,(23433) Stash the cursor on the stack.
24980 PUSH HL
24981 LD HL,(23431) Stash the print address on the stack.
24984 PUSH HL
Clear the text rows.
24985 CALL ClearLowerRows Call ClearLowerRows.
24988 LD A,(26326) Test whether pictures are on.
24991 OR A
24992 LD A,13 Pictures on use row 13.
24994 JR NZ,DescribeLocation_Row
24996 XOR A
Home the chosen row.
DescribeLocation_Row 24997 LD (23433),A Write it to *PrintRow.
25000 CALL HomeRow Call HomeRow.
25003 XOR A Write 0 to PrintColumn.
25004 LD (23434),A
25007 LD A,(23944) Jump to DescribeLocation_Text if *Darkness is zero.
25010 OR A
25011 JR Z,DescribeLocation_Text
Print "It is dark. You cannot see.".
25013 LD A,25 Print SystemMessage_19 using PrintSystemMessage.
25015 CALL PrintSystemMessage
Underline the description.
25018 JP DescribeLocation_Rule Jump to DescribeLocation_Rule.
Rooms under 102 with pictures switched off are read from bank 6. Every other room uses the tokenised text at TokenisedLocations.
DescribeLocation_Text 25021 LD HL,30158 The default text is the tokenised list at TokenisedLocations.
25024 LD A,(23943) Jump to DescribeLocation_Print if *CurrentRoom is at least 102.
25027 CP 102
25029 JR NC,DescribeLocation_Print
25031 LD A,(26326) Test whether pictures are on.
25034 OR A
25035 LD A,(23943) Fetch CurrentRoom.
25038 JR NZ,DescribeLocation_Print Jump to DescribeLocation_Print if pictures are on.
Page in the long descriptions.
DescribeLocation_Page 25040 PUSH AF Stash the room number on the stack.
25041 LD A,6 page RAM bank 6 in at 49152, keeping the 48K ROM.
25043 CALL PageBank
25046 LD HL,49152 Point HL at Picture_IcyThroneHall.
25049 POP AF Restore the room number from the stack.
Print this room's text.
DescribeLocation_Print 25050 LD (23439),A Write it to *MessageNumber.
25053 CALL PrintMessage Call PrintMessage.
25056 XOR A page RAM bank 0 in at 49152, keeping the 48K ROM.
25057 CALL PageBank
25060 XOR A Write 0 to SearchHit.
25061 LD (23418),A
25064 LD HL,24010 Point HL at ObjectLocations.
25067 LD B,A Start with a zero count.
List every object whose location byte is this room. The first one is introduced with a colon.
DescribeLocation_Objects 25068 LD A,(23943) Jump to DescribeLocation_Next if it is not *CurrentRoom.
25071 CP (HL)
25072 JR NZ,DescribeLocation_Next
25074 LD A,(23418) Jump to DescribeLocation_Seen if *SearchHit is set.
25077 OR A
25078 JR NZ,DescribeLocation_Seen
25080 LD A,B An index below 70 is named without the introduction.
25081 CP 70
25083 JR C,DescribeLocation_Name
Print ". You can see".
25085 XOR A Print SystemMessages using PrintSystemMessage.
25086 PUSH BC Call PrintSystemMessage.
25087 CALL PrintSystemMessage
25090 POP BC
25091 LD A,32 Print a space.
25093 CALL PlotCharacter
25096 LD A,58 Print a colon.
25098 CALL PlotCharacter
25101 LD A,45 Print a dash.
25103 CALL PlotCharacter
25106 LD A,32 Print a space.
25108 CALL PlotCharacter
An object was listed.
DescribeLocation_Seen 25111 LD A,1 Write 1 to *SearchHit.
25113 LD (23418),A
Print this object's name.
DescribeLocation_Name 25116 LD A,B Call PrintObjectName.
25117 CALL PrintObjectName
Step to the next object.
DescribeLocation_Next 25120 LD A,(23949) Jump to DescribeLocation_Exits if B equals *ObjectTotal.
25123 CP B
25124 JR Z,DescribeLocation_Exits
25126 INC B The next location byte belongs to the next object.
25127 INC HL
25128 JR DescribeLocation_Objects Jump to DescribeLocation_Objects.
After the objects, list the directions that leave this room.
DescribeLocation_Exits 25130 LD A,(23418) An empty list needs no tidy-up.
25133 OR A
25134 JR Z,DescribeLocation_Moves
25136 LD A,12 Two backspaces remove the comma after the last object.
25138 CALL PlotCharacter
25141 LD A,12
25143 CALL PlotCharacter
List the ways out.
DescribeLocation_Moves 25146 CALL FindExits Call FindExits.
25149 INC HL Advance to the first exit.
25150 BIT 7,(HL) Jump to DescribeLocation_Rule if bit 7 is set.
25152 JR NZ,DescribeLocation_Rule
Print ". You can go".
25154 LD A,13 Print SystemMessage_0D using PrintSystemMessage.
25156 CALL PrintSystemMessage
Print one direction.
DescribeLocation_Exit 25159 LD A,(HL) Bit 7 ends the list of directions.
25160 BIT 7,A
25162 JR NZ,DescribeLocation_Stop
25164 CALL PrintSystemMessage Call PrintSystemMessage.
25167 INC HL Advance to the next exit.
25168 INC HL
25169 JR DescribeLocation_Exit Jump to DescribeLocation_Exit.
Finish the exit list.
DescribeLocation_Stop 25171 LD A,12 Rub out the last comma.
25173 CALL PlotCharacter
25176 LD A,12
25178 CALL PlotCharacter
25181 LD A,46 Finish with a full stop.
25183 CALL PlotCharacter
Underline the description and restore the cursor the caller had saved.
DescribeLocation_Rule 25186 XOR A The description is finished, so scrolling may resume.
25187 LD (24966),A
25190 LD A,13 Start the rule on a new line.
25192 CALL PrintCharacter
25195 LD A,(26326) Test whether pictures are on.
25198 OR A
25199 LD A,(23433) Fetch PrintRow.
25202 JR NZ,DescribeLocation_Bottom Jump to DescribeLocation_Bottom if pictures are on.
25204 LD A,15 Pictures off force row 15.
25206 LD (23433),A
25209 XOR A Write 0 to PrintColumn.
25210 LD (23434),A
25213 CALL HomeRow Call HomeRow.
25216 LD A,15 Row 15, ready for the rule.
Draw the underline.
DescribeLocation_Bottom 25218 INC A The rule sits on the row under the text.
25219 LD (23447),A
25222 LD B,42 Forty-two underscores fill the row.
Print the rule.
DescribeLocation_Bar 25224 LD A,95 Print this underscore.
25226 CALL PlotCharacter
25229 DJNZ DescribeLocation_Bar Jump to DescribeLocation_Bar until the row is filled.
25231 LD A,13 Close the rule with ENTER.
25233 CALL PrintCharacter
25236 POP HL Restore the print address from the stack.
25237 LD (23431),HL
25240 POP HL Restore the cursor from the stack.
25241 LD (23433),HL
25244 RET Return.
Prev: 24966 Up: Map Next: 25245