Prev: 57292 Up: Map Next: 57579
57402: Place Character
Moves the character to the room the action names.
PlaceCharacter 57402 LD C,A Call FindCharacter to find character.
57403 LD A,(41014)
57406 CALL FindCharacter
Store that byte in this character's id, then read the schedule entry from the current character's record, then read the low byte of the count.
57409 LD (IY+0),C Store the character id and read the current character record.
57412 LD IY,(40983)
57416 LD A,C Call FetchObjectDataPointer to look up that object.
57417 CALL FetchObjectDataPointer
57420 LD (40983),IX Remember this object record and read the marker at IY+1.
57424 LD A,(IY+1)
57427 LD (IX+1),A Store the moved marker.
57430 LD (IY+1),255 Write 255 at IY+1 and read the location at IY+15.
57434 LD A,(IY+15)
57437 LD (IX+15),A Store the character attribute.
57440 LD (IY+15),0 Clear the character attribute.
57444 LD B,0
PlaceCharacter_Loop 57446 INC B Go to PlaceCharacter_WritesValueEach if the object count has reached 110.
57447 LD A,B
57448 CP 110
57450 JR Z,PlaceCharacter_WritesValueEach
57452 CALL FetchObjectDataPointer Call FetchObjectDataPointer to look that object up.
57455 LD A,(41014) Jump back to PlaceCharacter_Loop while the current character does not match the moved marker.
57458 CP (IX+1)
57461 JR NZ,PlaceCharacter_Loop
57463 LD (IX+1),C Store the room in the character's destination and go back to place them.
57466 JR PlaceCharacter_Loop
Writes this value into each matching script entry, then makes it the character being processed.
PlaceCharacter_WritesValueEach 57468 CALL FindCharacterScriptEntry Go to PlaceCharacter_Next if FindCharacterScriptEntry found no script entry for this character.
57471 JR Z,PlaceCharacter_Next
57473 LD (IX+0),C Store the room in the character's location and go back to place them.
57476 JR PlaceCharacter_WritesValueEach
Read the low byte of the count, then record the result in the character being processed, then return non-zero.
PlaceCharacter_Next 57478 LD A,C Record the current character.
57479 LD (41014),A
57482 OR %00000001 Reset the zero flag.
57484 RET Return.
57485 DEFB 141,4 Display record read by ProcessDisplayRecord: flags 141 value 4.
57487 DEFB 135,253,229,253,255,155,224 Refresh the room from the text at 58877, using the low byte of the location, 255 and otherwise continue at 57499.
57494 DEFB 5,253,158,107 Describe the low byte of the location with the text at 27550.
57498 DEFB 11 Run the nested character script.
57499 DEFB 2,29,252,255 Copy room parameters Hidden Door, the high byte of the location, 255 into the display.
57503 DEFB 11 Run the nested character script.
57504 DEFB 136,0 Display record read by ProcessDisplayRecord: flags 136 value 0.
57506 DEFB 7,173,224,2,93 Refresh the room from the text at 57517, using Inspector Lestrade, Large Rock.
57511 DEFB 7,53,225,253,255 Refresh the room from the text at 57653, using the low byte of the location, 255.
57516 DEFB 11 Run the nested character script.
57517 DEFB 77,7,28,224 Display record read by ProcessDisplayRecord: flags 77 value 7 handler 57372.
Run by 51812 after the display record at 57517.
57521 LD A,(40970) Jump ahead to PlaceCharacter_0 if the current character attribute is not 88.
57524 CP 88
57526 JR NZ,PlaceCharacter_0
57528 LD A,(40929) Jump to PlaceCharacter_0 if the day of the week is not 1.
57531 CP 1
57533 JR NZ,PlaceCharacter_0
57535 LD IX,(40981) Read the secondary pointer and set bit 7 of its byte at offset 6.
57539 SET 7,(IX+6)
57543 SET 7,(IX+5) Mark the object-attribute flag and read the character attribute.
57547 LD A,(40970)
57550 LD (IX+15),A Store the character attribute.
57553 LD A,(41012) Store the moved marker.
57556 LD (IX+1),A
57559 LD HL,31578 Point HL at the message at 30237+1341.
57562 CALL PrintTextAndHandleControlCharacters Call PrintTextAndHandleControlCharacters to print the message.
PlaceCharacter_0 57565 OR %00000001 Reset the zero flag.
57567 RET Return.
57568 DEFB 136,0 Display record read by ProcessDisplayRecord: flags 136 value 0.
57570 DEFB 7,53,225,253,255 Refresh the room from the text at 57653, using the low byte of the location, 255.
57575 DEFB 3,235,224 Show the message at 57579.
57578 DEFB 11 Run the nested character script.
Prev: 57292 Up: Map Next: 57579