Prev: 39552 Up: Map Next: 39717
39587: Read The Room Display Parameter
Used by the routine at ActionPrintOpeningText.
Accepts the picture when the character attribute is 103 and the room display parameter is 50 or when the character attribute is 50 and the room display parameter is 103 or 18.
ReadRoomDisplayParameter 39587 LD A,(40970) Jump ahead to ReadRoomDisplayParameter_TestRoomByte if the current character attribute is not 103.
39590 CP 103
39592 JR NZ,ReadRoomDisplayParameter_TestRoomByte
39594 LD A,(41012) Jump to ReadRoomDisplayParameter_TestActionSucceeded if the room display parameter is 50.
39597 CP 50
39599 LD L,112
39601 JR Z,ReadRoomDisplayParameter_TestActionSucceeded
ReadRoomDisplayParameter_Loop 39603 XOR A Clear A.
39604 RET Return.
The character attribute is 50. Accept the picture when the room display parameter is 103 or 18.
ReadRoomDisplayParameter_TestRoomByte 39605 CP 50 Jump to ReadRoomDisplayParameter_Loop if the character attribute is not 50.
39607 JR NZ,ReadRoomDisplayParameter_Loop
39609 LD A,(41012) Jump to ReadRoomDisplayParameter_TestActionSucceeded if the room display parameter is 103.
39612 CP 103
39614 LD L,114
39616 JR Z,ReadRoomDisplayParameter_TestActionSucceeded
39618 CP 18 Jump back to ReadRoomDisplayParameter_Loop while the room display parameter is not 18.
39620 JR NZ,ReadRoomDisplayParameter_Loop
39622 LD L,94 The token is 94.
ReadRoomDisplayParameter_TestActionSucceeded 39624 OR %00000001 Reset the zero flag.
39626 RET Return.
Script action: adjust attribute match.
39627 DEFB 4,0 Display record read by ProcessDisplayRecord: flags 4 value 0.
Run by 51812 after the display record at 39627.
ReadRoomDisplayParameter_AdjustMatch 39629 CALL ReadRoomDisplayParameter Return zero through ParseInputNumber_ReturnZero if ReadRoomDisplayParameter finds no display parameter.
39632 JP Z,ParseInputNumber_ReturnZero
39635 LD A,L Take the low byte of the pointer, drop 20 from the attribute pair result and store that in the low byte.
39636 SUB 20
39638 LD L,A
This entry point is used by the routine at ActionPrintOpeningText.
Leave 109 as the result, then record the result in the character just matched, then leave 105 as the result.
ReadRoomDisplayParameter_0 39639 LD A,109 Police Cab.
39641 LD (58054),A Store it in the character just matched.
39644 LD A,105 Jump ahead to ReadRoomDisplayParameter_1 to walk and place character.
39646 JP ReadRoomDisplayParameter_1
Walks a character by six or two places and stores the result.
39649 DEFB 4,0 Display record read by ProcessDisplayRecord: flags 4 value 0.
Place character beside match.
Run by 51812 after the display record at 39649.
ReadRoomDisplayParameter_PlaceCharacter 39651 CALL PlaceCharacterBesideMatch Call PlaceCharacterBesideMatch to place the character beside the match.
39654 LD DE,6 Call MeasureCharacterDistance to measure character distance.
39657 CALL MeasureCharacterDistance
39660 LD A,(IX+2) Subtract 2 from the location and jump to ReadRoomDisplayParameter_Next to store the script cycle.
39663 SUB 2
39665 LD L,A
39666 JR ReadRoomDisplayParameter_Next
39668 DEFB 4,0 Display record read by ProcessDisplayRecord: flags 4 value 0.
Place character beside match.
Run by 51812 after the display record at 39668.
39670 CALL PlaceCharacterBesideMatch Call PlaceCharacterBesideMatch to place the character beside the match.
39673 LD DE,2 Call MeasureCharacterDistance to measure character distance.
39676 CALL MeasureCharacterDistance
39679 LD L,(IX+2) Read the location.
ReadRoomDisplayParameter_Next 39682 LD A,1 Take 1.
Clear the high byte of the pointer, then record the pointer in the script cycle counter, then read the character just matched.
ReadRoomDisplayParameter_1 39684 PUSH AF Save 1 and store the location in the script cycle counter.
39685 LD H,0
39687 LD (40991),HL
39690 LD A,(58054) Read the character just matched and call ClearObjectHeldMark to clear object attribute bit 7.
39693 CALL ClearObjectHeldMark
39696 POP BC
39697 PUSH BC Read the character just matched and call StoreMatchedCharacterRoom to compare current character.
39698 LD A,(58054)
39701 CALL StoreMatchedCharacterRoom
39704 POP AF
Fetch location data pointer.
39705 CALL FetchLocationDataPointer Call FetchLocationDataPointer to look this room up.
39708 RES 6,(IX+0) Clear bit 6 of the room, point HL at the command at 62381 and set the carry.
39712 LD HL,62381
39715 SCF
39716 RET Return.
Prev: 39552 Up: Map Next: 39717