Prev: AAF4 Up: Map Next: AB54
AB30: Raise Rope
Used by the routine at Update_Rope.
Makes the rope shorter by two, which raises Sabreman. The length never gets below 20.
When the length falls to a multiple of 80 he is at the top of the room. The length is then made shorter by two more, the second byte of the world map entry of the room is cleared, Sabreman moves up to the room above and the room is drawn.
Input
A Controls
HL Length of the rope
IX Object record of Sabreman
Raise_Rope AB30 PUSH AF Keep the controls on the stack.
AB31 LD A,H Copy the high byte of the length to A.
AB32 AND A Jump to Raise_Rope_Shorten if the length is more than FF.
AB33 JR NZ,Raise_Rope_Shorten
AB35 LD A,L Copy the low byte of the length to A.
AB36 CP $20 Jump to Lower_Rope_Store_Length if the rope is already at its shortest (the length is less than 20).
AB38 JR C,Lower_Rope_Store_Length
Raise_Rope_Shorten AB3A DEC HL Make the length of the rope shorter by two.
AB3B DEC HL
AB3C LD A,L Copy the low byte of the length to A.
AB3D AND %01111110 Keep only bits 1 to 6.
AB3F JR NZ,Lower_Rope_Store_Length Jump to Lower_Rope_Store_Length if the rope has not reached the top of the room (the length is not a multiple of 80).
AB41 DEC HL Make the length shorter by two, to raise the rope into the room above.
AB42 DEC HL
AB43 LD ($AAA5),HL Store the new length of the rope.
AB46 CALL Find_World_Map_Address Find the address of the world map entry of the room.
AB49 INC HL Point at the second byte of the entry.
AB4A LD (HL),$00 Clear the second byte of the entry.
AB4C DEC (IX+$04) Move Sabreman up to the room above.
AB4F CALL Draw_Room Draw the new room.
AB52 POP AF Fetch the controls again from the stack.
AB53 RET Return.
Prev: AAF4 Up: Map Next: AB54