Prev: A5EA Up: Map Next: A63A
A5F2: 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 A5F2 CP $20 Jump ahead to TestSpace_IndexByCode if this text byte is below 20.
A5F4 JR C,TestSpace_IndexByCode
A5F6 CP $60 Jump ahead to GetCommonWordAndProcess if it is at least 60.
A5F8 JP NC,GetCommonWordAndProcess
A5FB CP $40 Jump ahead to TestSpace_PrintSpace if it is below 40.
A5FD JR C,TestSpace_PrintSpace
A5FF AND %00011111 Take the letter count of this packed word from bits 0-4.
A601 INC A Set B to the length plus one, point HL at the byte after IX, and clear C.
A602 LD B,A
A603 PUSH IX
A605 POP HL
A606 INC HL
A607 LD C,$00
TestSpace_0 A609 CALL RotateAndExtractCharacterCode Call RotateAndExtractCharacterCode to rotate and extract character code, then call Print_Character to print character.
A60C CALL Print_Character
A60F DJNZ TestSpace_0 Count the next character of the message and repeat from TestSpace_0.
A611 PUSH HL Copy the pointer into the record, and go to MarkSuccessScript_MarkSuccess if the count in C is not zero.
A612 POP IX
A614 LD A,C
A615 AND A
A616 JR NZ,MarkSuccessScript_MarkSuccess
A618 DEC IX Step the pointer back one byte and go back to MarkSuccessScript_MarkSuccess.
A61A JR MarkSuccessScript_MarkSuccess
Call Print_Character to print this character.
TestSpace_PrintSpace A61C CALL Print_Character Print this character and go back to MarkSuccessScript_MarkSuccess for the next letter.
A61F 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 A621 PUSH DE Use the control character jump table at JumpTable_ControlCharacters.
A622 LD E,A
A623 LD D,$00
A625 LD HL,$A55D
A628 ADD HL,DE
A629 ADD HL,DE Move the pointer on by the length, step to the next character of the message and swap the two pointers.
A62A LD E,(HL)
A62B INC HL
A62C LD D,(HL)
A62D EX DE,HL
A62E POP DE
A62F CP $1D Jump back to DispatchTextControlHandler if the token is at least 1D.
A631 JR NC,DispatchTextControlHandler
A633 CALL DispatchTextControlHandler Go to MarkSuccessScript_MarkSuccess if the looked-up handler returns zero.
A636 JR Z,MarkSuccessScript_MarkSuccess
A638 JR MarkSuccessScript Carry on from MarkSuccessScript once the handler has returned.
Prev: A5EA Up: Map Next: A63A