Prev: 42474 Up: Map Next: 42554
42482: Test For A Space
Used by the routine at ProcessTextCommand.
Sorts a text byte into a blank, a vocabulary code, or a packed letter.
TestSpace 42482 CP 32 Jump ahead to TestSpace_IndexByCode if this text byte is below 32.
42484 JR C,TestSpace_IndexByCode
42486 CP 96 Jump ahead to GetCommonWordAndProcess if it is at least 96.
42488 JP NC,GetCommonWordAndProcess
42491 CP 64 Jump ahead to TestSpace_PrintSpace if it is below 64.
42493 JR C,TestSpace_PrintSpace
42495 AND %00011111 Take the letter count of this packed word from bits 0-4.
42497 INC A Set B to the length plus one, point HL at the byte after IX, and clear C.
42498 LD B,A
42499 PUSH IX
42501 POP HL
42502 INC HL
42503 LD C,0
TestSpace_0 42505 CALL RotateAndExtractCharacterCode Call RotateAndExtractCharacterCode to rotate and extract character code, then call Print_Character to print character.
42508 CALL Print_Character
42511 DJNZ TestSpace_0 Count the next character of the message and repeat from TestSpace_0.
42513 PUSH HL Copy the pointer into the record, and go to MarkSuccessScript_MarkSuccess if the count in C is not zero.
42514 POP IX
42516 LD A,C
42517 AND A
42518 JR NZ,MarkSuccessScript_MarkSuccess
42520 DEC IX Step the pointer back one byte and go back to MarkSuccessScript_MarkSuccess.
42522 JR MarkSuccessScript_MarkSuccess
Call Print_Character to print this character.
TestSpace_PrintSpace 42524 CALL Print_Character Print this character and go back to MarkSuccessScript_MarkSuccess for the next letter.
42527 JR MarkSuccessScript_MarkSuccess
Store the result in the low byte of the source, then clear the high byte of the source, then use the control character jump table at JumpTable_ControlCharacters as the pointer.
TestSpace_IndexByCode 42529 PUSH DE Use the control character jump table at JumpTable_ControlCharacters.
42530 LD E,A
42531 LD D,0
42533 LD HL,42333
42536 ADD HL,DE
42537 ADD HL,DE Move the pointer on by the length, step to the next character of the message and swap the two pointers.
42538 LD E,(HL)
42539 INC HL
42540 LD D,(HL)
42541 EX DE,HL
42542 POP DE
42543 CP 29 Jump back to DispatchTextControlHandler if the token is at least 29.
42545 JR NC,DispatchTextControlHandler
42547 CALL DispatchTextControlHandler Go to MarkSuccessScript_MarkSuccess if the looked-up handler returns zero.
42550 JR Z,MarkSuccessScript_MarkSuccess
42552 JR MarkSuccessScript Carry on from MarkSuccessScript once the handler has returned.
Prev: 42474 Up: Map Next: 42554