Prev: 43486 Up: Map Next: 43636
43494: Process command to read an object
Used by the routine at 64623.
43494 LD IX,24848 Point IX at Magic Knight's current inventory (carrying)
43498 LD B,5 Load B with 5 (five inventory slots)
43500 LD HL,51920 Point HL at "[Current Command] WHICH OBJECT ?" text
43503 LD DE,51928 Point DE at "[Current Command] THE " text
43506 CALL 45809 Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with selected item index
43509 LD HL,24848 Point IX at Magic Knight's current inventory (carrying)
43512 CALL 45766 Print name of object in inventory slot A of inventory data at HL in command summary window
43515 CALL 64207 Display execute / reject command window and return here if execute chosen, else exit to main game loop
43518 LD A,(41779) Load A with index of Current Object...
43521 CALL 45685 ...and if this is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for fire to be pressed
43524 CP 24 If Current Object is the Instruction Book (24)...
43526 JP Z,43624 ...then skip ahead to 43624
43529 CP 21 If Current Object is the Gadget X (21)...
43531 JP Z,43630 ...then skip ahead to 43630
43534 LD A,2 If Magic Knight is not carrying the Crystal Ball (2)...
43536 CALL 45510 ...
43539 JR NZ,43592 ...then skip ahead to 43592
43541 LD A,(41779) Load A with index of Current Object...
43544 LD B,21 Load B with 21 (index of read-text for Wand of Command with Crystal Ball)
43546 CP 3 If Current Object is the Wand of Command (3)...
43548 JR Z,43617 ...then skip ahead to 43617 (display text with index B)
43550 LD B,23 Load B with 23 (index of read-text for Magic Talisman with Crystal Ball)
43552 CP 6 If Current Object is the Magic Talisman (6)...
43554 JR Z,43617 ...then skip ahead to 43617 (display text with index B)
43556 LD B,24 Load B with 24 (index of read-text for Glow Shield with Crystal Ball)
43558 CP 12 If Current Object is the Glow Shield (12)...
43560 JR Z,43617 ...then skip ahead to 43617 (display text with index B)
43562 LD B,25 Load B with 25 (index of read-text for Boomerang with Crystal Ball)
43564 CP 14 If Current Object is the Boomerang (14)...
43566 JR Z,43617 ...then skip ahead to 43617 (display text with index B)
43568 LD B,3 Load B with 3 (index of read-text for unreadable magic language) (see trivia)
43570 CP 15 If Current Object is the Sword (15)...
43572 JR Z,43617 ...then skip ahead to 43617 (display text with index B)
43574 LD B,27 Load B with 27 (index of read-text for Brass Ankh with Crystal Ball)
43576 CP 16 If Current Object is the Brass Ankh (16)...
43578 JR Z,43617 ...then skip ahead to 43617 (display text with index B)
43580 LD B,28 Load B with 28 (index of read-text for Elf-Horn with Crystal Ball)
43582 CP 22 If Current Object is the Elf-Horn (22)...
43584 JR Z,43617 ...then skip ahead to 43617 (display text with index B)
43586 LD B,29 Load B with 29 (index of read-text for Silver Arrow with Crystal Ball)
43588 CP 23 If Current Object is the Silver Arrow (23)...
43590 JR Z,43617 ...then skip ahead to 43617 (display text with index B)
43592 LD A,(41779) Load A with index of Current Object...
43595 LD E,0 Point HL at start of record for object with index A in object properties table...
43597 CALL 45390 ...
43600 BIT 5,(HL) If can-be-read flag is set...
43602 JR NZ,43610 ...then skip ahead to 43610
43604 LD HL,52859 Point HL at "THERE IS NO WRITING FOR ME TO [Current Command]" text
43607 JP 64297 Display "THERE IS NO WRITING FOR ME TO [Current Command]" window (12) and return to game
43610 INC HL Advance HL to read-text index for object...
43611 INC HL ...
43612 INC HL ...
43613 LD A,(HL) ...and load into A
43614 AND 31 Clear bits 5, 6 and 7...
43616 LD B,A ...and load index into B
At this point, B holds the index of the read-text to print
43617 CALL 63322 Point HL at start of B-th entry in list of read-texts of readable objects
43620 CALL 64317 Display window 2 with object's read-text and return to game...
43623 DEFB 2 ...
43624 CALL 37951 Display instructions windows
43627 JP 41742 Set Magic Knight's available action flags and jump to start of main game loop
43630 CALL 37764 Display and handle Gadget X menu
43633 JP 41742 Set Magic Knight's available action flags and jump to start of main game loop
Prev: 43486 Up: Map Next: 43636