Prev: B5A4 Up: Map Next: B62F
B5B6: Unlink The Next Display Record
Unlinks the next display record and clears the pointer left in the previous entry.
UnlinkNextDisplayRecord B5B6 LD ($A01B),A Store it in the initialised flag and read the next display link.
B5B9 LD IX,($9FF2)
B5BD LD ($9FF0),IX Store that pointer in the first display link.
B5C1 LD L,(IX-$02) Read the pointer saved ahead of this record.
B5C4 LD H,(IX-$01)
B5C7 LD ($9FF2),HL Store the pointer in the next display link.
B5CA LD (IX-$02),$00 Clear the pointer in the previous display entry.
B5CE LD (IX-$01),$00
B5D2 RET Return.
B5D3 LD A,($B16E) Jump ahead to UnlinkNextDisplayRecord_ClearPointer if bit 0 of display flag (B16E) is clear.
B5D6 BIT 0,A
B5D8 JR Z,UnlinkNextDisplayRecord_ClearPointer
B5DA LD A,($B183) Jump ahead to UnlinkNextDisplayRecord_ReadNext to check flag and set display parameter.
B5DD LD HL,$B178
B5E0 JR UnlinkNextDisplayRecord_ReadNext
B5E2 LD A,($B16D) Jump ahead to UnlinkNextDisplayRecord_CallsDisplayParameter if bit 0 of display flag at DisplayFlag is clear.
B5E5 BIT 0,A
B5E7 JR Z,UnlinkNextDisplayRecord_CallsDisplayParameter
B5E9 LD A,($B182) Read the byte at B180+02 and take the display data pointer.
B5EC LD HL,$B172
UnlinkNextDisplayRecord_ReadNext B5EF CALL RestoreSavedCharacterRecord Call RestoreSavedCharacterRecord to restore the saved character record, then call UnlinkNextDisplayRecord to read the next display link.
B5F2 CALL UnlinkNextDisplayRecord
B5F5 LD HL,$6888 Take the message, then call PrintTextAndHandleControlCharacters to print the message.
B5F8 CALL PrintTextAndHandleControlCharacters
B5FB RET Return.
Calls the display-parameter check, using the pointer saved at ObjectTablePointer+08.
UnlinkNextDisplayRecord_CallsDisplayParameter B5FC CALL SelectJumpIfNotZero Call SelectJumpIfNotZero to plant the JR NZ opcode and test the character record.
B5FF LD HL,($B186) Call UnlinkNextDisplayRecord to read the next character record.
B602 PUSH HL
B603 LD A,($B182)
B606 CALL UnlinkNextDisplayRecord
B609 LD HL,$6880 Take the message, then call PrintTextAndHandleControlCharacters to print the message.
B60C CALL PrintTextAndHandleControlCharacters
B60F RET Return.
Plant the JR Z test, push a zero pointer and DisplayDataPointer, test the character record through SelectJumpIfNotZero, read the next record through UnlinkNextDisplayRecord and print the message at 687C.
UnlinkNextDisplayRecord_ClearPointer B610 CALL SelectJumpIfZero Call SelectJumpIfZero to plant the JR Z opcode.
B613 LD HL,$0000 Clear the pointer and take the display data pointer.
B616 PUSH HL
B617 LD HL,$B172
B61A PUSH HL
B61B CALL SelectJumpIfNotZero Call SelectJumpIfNotZero to plant the JR NZ opcode and test the character record.
B61E LD HL,($B186) Call UnlinkNextDisplayRecord to read the next character record.
B621 PUSH HL
B622 LD A,($B183)
B625 CALL UnlinkNextDisplayRecord
B628 LD HL,$687C Take the message, then call PrintTextAndHandleControlCharacters to print the message.
B62B CALL PrintTextAndHandleControlCharacters
B62E RET Return.
Prev: B5A4 Up: Map Next: B62F