Prev: F4F4 Up: Map Next: F595
F52A: Look on for a thing that can be carried, and take it
The pick-up's search, from where FIND_OBSTACLE (or this, going round) left it. Each record whose box meets the search box is tested: it must be a thing that can be picked up (bit 5 of +12). A door ends the search (though no door has bit 5 set: a door's +12 is exactly 1). Then the weight: the thing's +16 less 16 (never below nought) is added to what he carries (CARRIED_WEIGHT, IY+$12), and if that comes to 8 or more it is TOO HEAVY (message 3) and nothing changes. So the load is at most 7; the heaviest things weigh 6.
Taking it: the place in use gets the record's address, the record is marked as carried (bit 5 of +16) and not in the air, and the object table says it is in no room ($FE, SET_THING_ROOM). The knight is redrawn stooping; then the thing's picture is wiped from the room, by redrawing its area (REDRAW_OBJECT) with THIS_RECORD pointing at it so that it is left out, and drawn in the panel's box for the place (SHOW_THING_IN_USE). Krumlinde names the part from the weight on RTN_Store_Carried_Weight.
The flags in IY+$11 are cleared: they say whether the lure and the thing of kind 11 lie in the room, and whichever still does sets its flag again on the next pass (CHE3D).
PICK_UP_LOOK_ON F52A CALL NEXT_OBSTACLE Look on from the last record met
This entry point is used by the routine at PICK_UP.
PICK_UP_LOOK_ON_0 F52D JR NC,KNIGHT_DONE Nothing more: the pick-up ends with a redraw
F52F BIT 5,(IX+OBJ_KIND) Not a thing that can be carried: look on
F533 JR Z,PICK_UP_LOOK_ON
F535 LD A,(IX+OBJ_KIND) A door: stop
F538 AND $0F
F53A CP $01
F53C JR Z,KNIGHT_DONE
F53E LD A,(IX+OBJ_WEIGHT) Its weight: +16 less 16, nought if below
F541 AND $1F
F543 SUB $10
F545 JR NC,PICK_UP_LOOK_ON_1
F547 XOR A
PICK_UP_LOOK_ON_1 F548 ADD A,(IY+CARRIED_WEIGHT-V) Added to his load, 8 or more is TOO HEAVY
F54B CP $08
F54D JR C,TAKE_THING
F54F LD (IY+MESSAGE-V),$03
F553 JR KNIGHT_DONE
TAKE_THING F555 LD (CARRIED_WEIGHT),A The author's WEI3. The new load
F558 PUSH IX The place in use holds the thing now
F55A POP DE
F55B LD H,$FF
F55D LD L,(IY+SELECTED-V)
F560 LD (HL),E
F561 INC HL
F562 LD (HL),D
F563 SET 5,(IX+OBJ_WEIGHT) Carried, and not in the air
F567 RES 7,(IX+OBJ_STATE)
F56B RES 1,(IY+THINGS_NOTED-V) The thing of kind 11 may not lie in the room any more
F56F LD C,$FE In no room
F571 CALL SET_THING_ROOM
F574 PUSH IX Redraw the knight, stooping
F576 CALL KNIGHT_DONE
F579 POP HL THIS_RECORD = IY+$78, meant as the thing's number among the records so that its own redraw leaves it out; but the knight's redraw has already used that byte for a sprite's width (3 when measured, the thing being 9), so a fixed record is left out instead
F57A LD A,(THIS_RECORD)
F57D PUSH AF
F57E LD A,(FOUND_RECORD)
F581 LD (THIS_RECORD),A
F584 PUSH HL Redraw where it was: without it
F585 CALL REDRAW_OBJECT
F588 POP HL Draw it in the panel's box
F589 CALL SHOW_THING_IN_USE
F58C POP AF THIS_RECORD back to the knight's
F58D LD (THIS_RECORD),A
F590 LD (IY+THINGS_NOTED-V),$00 Both room flags cleared (see above)
F594 RET The knight's pass is over
Prev: F4F4 Up: Map Next: F595