Prev: B86A Up: Map Next: B90E
B8AA: Read The Pointer At The First Display
Used by the routine at FollowLinkPointer.
Reads the word at B868 and stores it in the word at ActiveTextPointer.
ReadPointerFirstDisplay B8AA LD HL,($B868) Read the word at B868, store it in the word at ActiveTextPointer and clear A.
B8AD LD ($A02B),HL
B8B0 XOR A
B8B1 LD ($A024),A Clear the command mode at A024.
B8B4 LD HL,($9FF0) Read the first display link and clear the pointer.
B8B7 PUSH HL
B8B8 LD HL,$0000
B8BB LD ($9FF0),HL Store the pointer in the first display link.
ReadPointerFirstDisplay_PrepareCharacterDisplay B8BE CALL PrepareCharacterForDisplay Go to ReadPointerFirstDisplay_ObjectProcessingSource if PrepareCharacterForDisplay returns zero.
B8C1 JR Z,ReadPointerFirstDisplay_ObjectProcessingSource
B8C3 CP $02 Jump ahead to ReadPointerFirstDisplay_ReadsFirstDisplay if it is not 02.
B8C5 JR NZ,ReadPointerFirstDisplay_ReadsFirstDisplay
ReadPointerFirstDisplay_ObjectProcessingSource B8C7 LD HL,($A02B) Read the word at ActiveTextPointer.
B8CA LD A,(HL) Jump back to ReadPointerFirstDisplay_PrepareCharacterDisplay while the high nibble is not C0.
B8CB AND $F0
B8CD CP $C0
B8CF JR NZ,ReadPointerFirstDisplay_PrepareCharacterDisplay
B8D1 LD (HL),$90 Use 08 for the character code, then call AllocateMemory to allocate memory.
B8D3 LD A,$08
B8D5 CALL AllocateMemory
B8D8 LD HL,($9FEE) Read the list head and make this record the new head.
B8DB LD ($9FEE),IX
B8DF LD (IX-$02),L Store the low byte of the old list head in the link word ahead of this record.
B8E2 LD (IX-$01),H Store the high byte of the old list head in the link word ahead of this record, and read the word at 9FEE+02.
B8E5 LD HL,($9FF0)
B8E8 LD (IX+$05),L Store the low byte of the first display link at offset 05.
B8EB LD (IX+$06),H Store the high byte of that link at offset 06 and keep the stacked pointer as the first display link.
B8EE POP HL
B8EF LD ($9FF0),HL
B8F2 XOR A Clear the moved marker and read the room display parameter.
B8F3 LD (IX+$01),A
B8F6 LD A,($A034)
B8F9 LD (IX+$00),A Store the record's flag byte.
B8FC LD A,($A024) Copy A024 to offset 7.
B8FF LD (IX+$07),A
B902 XOR A
B903 RET Return.
Reads the first display link, then stores the saved pointer back into that link.
ReadPointerFirstDisplay_ReadsFirstDisplay B904 PUSH AF Call ReadFirstDisplayLink to read the first display link.
B905 CALL ReadFirstDisplayLink
B908 POP AF
B909 POP HL
B90A LD ($9FF0),HL Store the pointer in the first display link.
B90D RET Return.
Prev: B86A Up: Map Next: B90E