Prev: 46500 Up: Map Next: 46639
46518: Unlink The Next Display Record
Unlinks the next display record and clears the pointer left in the previous entry.
UnlinkNextDisplayRecord 46518 LD (40987),A Store it in the initialised flag and read the next display link.
46521 LD IX,(40946)
46525 LD (40944),IX Store that pointer in the first display link.
46529 LD L,(IX-2) Read the pointer saved ahead of this record.
46532 LD H,(IX-1)
46535 LD (40946),HL Store the pointer in the next display link.
46538 LD (IX-2),0 Clear the pointer in the previous display entry.
46542 LD (IX-1),0
46546 RET Return.
46547 LD A,(45422) Jump ahead to UnlinkNextDisplayRecord_ClearPointer if bit 0 of display flag (45422) is clear.
46550 BIT 0,A
46552 JR Z,UnlinkNextDisplayRecord_ClearPointer
46554 LD A,(45443) Jump ahead to UnlinkNextDisplayRecord_ReadNext to check flag and set display parameter.
46557 LD HL,45432
46560 JR UnlinkNextDisplayRecord_ReadNext
46562 LD A,(45421) Jump ahead to UnlinkNextDisplayRecord_CallsDisplayParameter if bit 0 of display flag at DisplayFlag is clear.
46565 BIT 0,A
46567 JR Z,UnlinkNextDisplayRecord_CallsDisplayParameter
46569 LD A,(45442) Read the byte at 45440+2 and take the display data pointer.
46572 LD HL,45426
UnlinkNextDisplayRecord_ReadNext 46575 CALL RestoreSavedCharacterRecord Call RestoreSavedCharacterRecord to restore the saved character record, then call UnlinkNextDisplayRecord to read the next display link.
46578 CALL UnlinkNextDisplayRecord
46581 LD HL,26760 Take the message, then call PrintTextAndHandleControlCharacters to print the message.
46584 CALL PrintTextAndHandleControlCharacters
46587 RET Return.
Calls the display-parameter check, using the pointer saved at ObjectTablePointer+8.
UnlinkNextDisplayRecord_CallsDisplayParameter 46588 CALL SelectJumpIfNotZero Call SelectJumpIfNotZero to plant the JR NZ opcode and test the character record.
46591 LD HL,(45446) Call UnlinkNextDisplayRecord to read the next character record.
46594 PUSH HL
46595 LD A,(45442)
46598 CALL UnlinkNextDisplayRecord
46601 LD HL,26752 Take the message, then call PrintTextAndHandleControlCharacters to print the message.
46604 CALL PrintTextAndHandleControlCharacters
46607 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 26748.
UnlinkNextDisplayRecord_ClearPointer 46608 CALL SelectJumpIfZero Call SelectJumpIfZero to plant the JR Z opcode.
46611 LD HL,0 Clear the pointer and take the display data pointer.
46614 PUSH HL
46615 LD HL,45426
46618 PUSH HL
46619 CALL SelectJumpIfNotZero Call SelectJumpIfNotZero to plant the JR NZ opcode and test the character record.
46622 LD HL,(45446) Call UnlinkNextDisplayRecord to read the next character record.
46625 PUSH HL
46626 LD A,(45443)
46629 CALL UnlinkNextDisplayRecord
46632 LD HL,26748 Take the message, then call PrintTextAndHandleControlCharacters to print the message.
46635 CALL PrintTextAndHandleControlCharacters
46638 RET Return.
Prev: 46500 Up: Map Next: 46639