Prev: 34567 Up: Map Next: 34697
34627: Draw objects in Magic Knight's inventory if he is carrying the Mirror
Used by the routine at 27703.
34627 LD A,35 If Magic Knight is not carrying the Mirror (35)...
34629 CALL 33645 ...
34632 RET NZ ...then return
34633 LD HL,25164 Point HL at start of Magic Knight's current inventory (carrying)
34636 LD B,5 Load B with 5 (five inventory slots)
34638 LD DE,784 Load DE with x- and y-coordinates respectively to start drawing object graphics (D, or x = 3, E, or y = 16)
34641 PUSH BC Store BC (B = remaining number of inventory slots to process)
34642 PUSH HL Store HL (pointer to current position in Magic Knight's current inventory)
34643 PUSH DE Store DE (coordinates in characters to draw object)
34644 LD A,(HL) Load index of object in current slot in Magic Knight's inventory into A
34645 OR A If this is zero...
34646 JR Z,34693 ...then restore registers and return
34648 LD E,6 Load 6 (index of objects' attribute property) into E
34650 CALL 33525 Point HL at the attribute property of the object in the current inventory slot
34653 LD A,(HL) Store attribute at 23695...
34654 LD (23695),A ...
34657 INC HL Advance HL to point to graphic index property...
34658 LD A,(HL) ...and load into A
34659 POP BC Restore BC (coordinates in characters to draw object, was in DE)
34660 PUSH BC Store BC (coordinates in characters to draw object)
34661 PUSH BC Store BC (coordinates in characters to draw object)
34662 CALL 54406 Draw an object with lookup index A at character coordinates (C, B)
34665 POP BC Restore BC (coordinates in characters to draw object)
34666 CALL 54148 Load HL with attribute file address for coordinates (C, B)
34669 LD A,(23695) Load A with attribute stored at 23695...
34672 LD (HL),A ...and apply this attribute to attribute file at coordinates (C, B)...
34673 INC HL ...
34674 LD (HL),A ...(C + 1, B)...
34675 LD BC,31 ...
34678 ADD HL,BC ...
34679 LD (HL),A ...(C, B + 1)...
34680 INC HL ...
34681 LD (HL),A ...and (C + 1, B + 1)
34682 POP DE Restore DE (coordinates in characters to draw object)
34683 LD A,E Advance right by three characters (i.e. add three to x-coordinate in E)...
34684 ADD A,3 ...
34686 LD E,A ...
34687 POP HL Restore HL (pointer to current position in Magic Knight's current inventory)
34688 INC HL Advance HL to next inventory slot
34689 POP BC Restore BC (B = remaining number of inventory slots to process)
34690 DJNZ 34641 Decrease B, and loop back to 34641 if not zero
34692 RET Return
34693 POP DE Restore DE (coordinates in characters to draw object)
34694 POP HL Restore HL (pointer to current position in Magic Knight's current inventory)
34695 POP BC Restore BC (B = remaining number of inventory slots to process)
34696 RET Return
Prev: 34567 Up: Map Next: 34697