Prev: EAF9 Up: Map Next: EB39
EB18: Set Decoration Size
Copies the five bytes that describe the size of the obstacle that a decoration makes (see Check_Object_Contact) from the table at Decoration_Size_Table to the bytes 0A to 0E of its object record. The entry is chosen by the type of the decoration, which is 74 for the first entry.
Input
IX Object record of the decoration
Set_Decoration_Size EB18 LD A,(IX+$00) Fetch the type of the decoration.
EB1B SUB $74 Subtract 74 to make the number of the entry.
EB1D LD C,A Store the number in C.
EB1E SLA A Multiply the number by four.
EB20 SLA A
EB22 ADD A,C Add the number to make it five times the number.
EB23 LD E,A Store the offset of the entry in E.
EB24 LD D,$00 Clear the high byte of the offset.
EB26 LD HL,$EB7E Point HL at Decoration_Size_Table.
EB29 ADD HL,DE Make HL point at the entry.
EB2A EX DE,HL Swap, so that DE points at the entry.
EB2B PUSH IX Copy the address of the object record into HL.
EB2D POP HL
EB2E LD BC,$000A Set the offset of byte 0A in BC.
EB31 ADD HL,BC Make HL point at byte 0A of the object record.
EB32 EX DE,HL Swap, so that HL points at the entry and DE at the record.
EB33 LD BC,$0005 Set the number of bytes to copy to 05.
EB36 LDIR Copy the size to the object record.
EB38 RET Return.
Prev: EAF9 Up: Map Next: EB39