![]() |
Routines |
| Prev: 29395 | Up: Map | Next: 29503 |
|
Used by the routines at TurnReadAndTokeniseTheCommand, Response_ICannotDoThat, MessageOpenTheGateForAConjunction, Inglish_AskWhat, DisplayLocateHelpMessage, GameOver_Start, LoadBlock, SaveGame, VerifyBlock, Action_Look, Action_RefuseIfNotCarried, Action_Putdown, Action_AddTheObjectMass, Action_Pickup, Action_Direction, Action_CarryOnWithTheObject, Action_Follow, Action_TalkTo, Action_Shoot, YouAreDead, Action_Inventory, Action_Attack, Action_RollAgainstTen, Action_AddToThePlayersStrength, Action_Give, Action_Examine, Turn_RunTheHandlerIfPresent, YouSeeStart, YouSeePrint, Turn_ReportWhoIsCarryingAnObject, Turn_FinishTheSentence, Turn_GateTheMessage, TurnReportACharacter, Condition_WhereTheObjectIs, TurnDescribeWhatIsHere, Message_ListWithASeparator, TableListWhatIsHere, Message_ExitsForThisLocation, MessageListTheObjects, DisplayExits, Message_NameFromThisRecord, Response_YouSay, ActionTie, ActionUntie, ActionBurn, Action_RemoveTheRing, ActionGoblinCapture, EventContainersAndScripts, Event_TheBarrel, Event_TheDeepBog, Event_ARandomHalf, Event_DayDawnsOnTheTrolls, Event_LocationTwentyFive, Event_GiveTheLunch, Event_TheHoleVanishes, Event_AHoleAppears, Event_TheLakeOrTheRiver, Event_TheWebSmothersYou, Event_DropsFromAbove, Event_StungFromAbove and EventForestriver.
Prints a message. Bytes under 32 are control codes from the table at PrintTable. Dictionary tokens are expanded in line.
|
||||||||
|
Store A, DE and IX for later (see PrintMessage_TokenByNibble_Return).
|
||||||||
| PrintMessage | 29405 | LD (28893),DE | Store DE at PrintMessage_SavedDE. | |||||
| 29409 | LD (28896),IX | Store IX at PrintMessage_SavedIX. | ||||||
| 29413 | LD (28892),A | Save A for PrintMessage_TokenByNibble_Return. | ||||||
| 29416 | LD A,(46842) | If 46842 is not zero, jump to PrintMessage_Body | ||||||
| 29419 | AND A | |||||||
| 29420 | JR NZ,PrintMessage_Body | |||||||
| 29422 | LD (46843),A | Clear the message-suppressed flag, because this message is being printed. | ||||||
|
This entry point is used by the routine at Message_PrintAtASignedOffset.
|
||||||||
| PrintMessage_Body | 29425 | PUSH HL | Use the text pointer as the message pointer. | |||||
| 29426 | POP IX | |||||||
| PrintMessage_Loop | 29428 | LD A,(IX+0) | Fetch the next character of the text message. | |||||
| 29431 | BIT 7,A | Jump to PrintMessage_PlainText if bit 7 of the character is clear, so it is plain text rather than a dictionary token. | ||||||
| 29433 | JR Z,PrintMessage_PlainText | |||||||
| 29435 | AND 127 | Jump to PrintMessage_TokenByNibble if the high nibble of this token byte, with bit 7 clear, is 48. | ||||||
| 29437 | LD D,A | |||||||
| 29438 | LD E,(IX+1) | |||||||
| 29441 | INC IX | |||||||
| 29443 | AND 240 | |||||||
| 29445 | CP 48 | |||||||
| 29447 | JR Z,PrintMessage_TokenByNibble | |||||||
| 29449 | CP 32 | Jump to PrintMessage_TokenByNibble if the high nibble of this token byte is 32. | ||||||
| 29451 | JR Z,PrintMessage_TokenByNibble | |||||||
| 29453 | CP 96 | Jump to PrintMessage_TokenByNibble if the high nibble of this token byte is 96. | ||||||
| 29455 | JR Z,PrintMessage_TokenByNibble | |||||||
|
This entry point is used by the routine at GetCommonWord.
|
||||||||
| PrintMessage_Token | 29457 | CALL PrintToken | Call PrintToken to print a dictionary token. | |||||
| PrintMessage_StepToTheNextCharacter | 29460 | INC IX | Step to the next character of the message. | |||||
| 29462 | JR PrintMessage_Loop | Jump back to PrintMessage_Loop. | ||||||
| PrintMessage_PlainText | 29464 | CP 32 | If the character is less than 32 jump to PrintMessage_PrintTable. | |||||
| 29466 | JR C,PrintMessage_PrintTable | |||||||
| 29468 | CP 96 | Jump to GetCommonWord if the character is 96 or above, as that is a common word. | ||||||
| 29470 | JP NC,GetCommonWord | |||||||
| 29473 | CALL MessagePrintOneCharacter | Else, call MessagePrintOneCharacter. | ||||||
| 29476 | JR PrintMessage_StepToTheNextCharacter | Jump back to PrintMessage_StepToTheNextCharacter to move onto the next character. | ||||||
| PrintMessage_PrintTable | 29478 | PUSH DE | Save DE and keep A in E. | |||||
| 29479 | LD E,A | |||||||
| 29480 | LD D,0 | The control-code offset's high byte is zero. | ||||||
| 29482 | LD HL,29333 | Point HL at entry DE of PrintTable. | ||||||
| 29485 | ADD HL,DE | |||||||
| 29486 | ADD HL,DE | Add the control code again, so this selects the handler word in PrintTable. | ||||||
| 29487 | LD E,(HL) | Read the low byte of the handler. | ||||||
| 29488 | INC HL | Step to the high byte of the handler word. | ||||||
| 29489 | LD D,(HL) | Read the high byte of the handler. | ||||||
| 29490 | EX DE,HL | Point HL at the control-code handler. | ||||||
| 29491 | POP DE | Restore DE from the stack, and jump to PrintMessage_Indirect_Jump if the character is not below 20. | ||||||
| 29492 | CP 20 | |||||||
| 29494 | JR NC,PrintMessage_Indirect_Jump | |||||||
| 29496 | CALL PrintMessage_Indirect_Jump | Call PrintMessage_Indirect_Jump to run the control-code handler. | ||||||
| 29499 | JR Z,PrintMessage_StepToTheNextCharacter | Jump back to PrintMessage_StepToTheNextCharacter if the control-code handler returned zero. | ||||||
| 29501 | JR PrintMessage_Token | Jump back to PrintMessage_Token to print a dictionary token. | ||||||
|
View the equivalent code in;
|
||||||||
| Prev: 29395 | Up: Map | Next: 29503 |