Prev: 51874 Up: Map Next: 51953
51922: Set Room Attributes
Used by the routine at InitialiseGame.
Goes through the data for all of the rooms, which is held from RoomData to ObjectTypes, and copies the second colour in the size and colours byte of each into the first so that both colours are the same.
Copy the second colour over the first.
SetRoomAttributes 51922 LD HL,25705 Point HL at RoomData.
51925 LD BC,29640 Point BC at ObjectTypes.
51928 INC HL Increment HL.
SetRoomAttributes_Next 51929 LD E,(HL) Fetch the length of the data.
51930 INC HL Increment HL.
51931 LD A,(HL) Fetch the size and colours.
51932 RRCA Rotate the second colour into bits 0-2.
51933 RRCA
51934 RRCA
51935 AND %00000111 Keep only bits 0-2.
51937 LD D,A Copy it to D.
51938 LD A,(HL) Fetch the size and colours.
51939 AND %11111000 Keep only bits 3-7.
51941 OR D Merge D.
51942 LD (HL),A Store the size and colours.
51943 LD D,0 Set D to 0.
51945 ADD HL,DE Add DE to HL.
51946 AND A Return if the end of the room data has been reached.
51947 SBC HL,BC
51949 RET NC
51950 ADD HL,BC Add BC to HL.
51951 JR SetRoomAttributes_Next Jump to SetRoomAttributes_Next.
Prev: 51874 Up: Map Next: 51953