Twin Kingdom Valley disassembly =============================== Twin Kingdom Valley was written by Trevor Hall and Pete Skinner, and was published by Bug-Byte for the BBC Micro in 1983. It is a graphical text adventure in which the player must collect treasure. It is notable for its graphics and non-player characters. The following disassembly was created by reverse engineering binary images, without access to any source code. It is nevertheless reasonably complete, allowing the technical approaches used to be understood. The author of this disassembly imposes no additional copyright restrictions beyond those already present on the game itself. It is provided for educational purposes only, and it is hoped that the original authors will accept it in the good faith it was intended - as a tribute to their skills. Technical notes =============== The filename of the main binary has an embedded delete character. Source code for constructing and saving this and the other files is included at &5800. The game has 176 rooms and 98 pictures. Text is compressed using two dictionaries containing 255 and 125 words respectively. The parser understands 47 verbs. Interesting pokes ================= &1c4b = &c7 player survives death Loader disassembly ================== ; LVAL ; 00007A00 00007A00 0100 ; entry_point &7a00 a9 e5 LDA #&e5 ; &7ae5 = filename &7a02 8d d3 7a STA &7ad3 ; file_block + 0 (filename low) &7a05 a9 7a LDA #&7a &7a07 8d d4 7a STA &7ad4 ; file_block + 1 (filename high) &7a0a ad 2d 7a LDA &7a2d ; load_address_high &7a0d 8d d6 7a STA &7ad6 ; file_block + 3 (load address high) &7a10 a9 00 LDA #&00 &7a12 8d d5 7a STA &7ad5 ; file_block + 2 (load address low) &7a15 8d d9 7a STA &7ad9 ; file_block + 6 (execution address low) &7a18 a2 d3 LDX #&d3 ; &7ad3 = file_block &7a1a a0 7a LDY #&7a &7a1c a9 ff LDA #&ff ; load file &7a1e 20 dd ff JSR &ffdd ; OSFILE &7a21 20 9a 7a JSR &7a9a ; instructions_screen &7a24 a9 00 LDA #&00 &7a26 85 70 STA &70 ; source_address_low &7a28 85 72 STA &72 ; target_address_low &7a2a 85 74 STA &74 ; end_address_low &7a2c a9 10 LDA #&10 ; &1000 # actually LDA load_address_high &7a2e 85 71 STA &71 ; source_address_high &7a30 a9 04 LDA #&04 ; &0400 &7a32 85 73 STA &73 ; target_address_high &7a34 a9 14 LDA #&14 ; &1400 &7a36 85 75 STA &75 ; end_address_high &7a38 a9 d2 LDA #&d2 ; &7ad2 = null_function &7a3a 85 76 STA &76 ; call_address_low &7a3c a9 7a LDA #&7a &7a3e 85 77 STA &77 ; call_address_high &7a40 20 76 7a JSR &7a76 ; move_memory # Move &1000 - &13ff to &0400 - &07ff, call &7ad2 &7a43 a9 00 LDA #&00 &7a45 85 70 STA &70 ; source_address_low &7a47 85 72 STA &72 ; target_address_low &7a49 85 74 STA &74 &7a4b a9 70 LDA #&70 ; &7000 &7a4d 85 71 STA &71 ; source_address_high &7a4f a9 0c LDA #&0c ; &0c00 &7a51 85 73 STA &73 ; target_address_high &7a53 a9 78 LDA #&78 ; &7800 &7a55 85 75 STA &75 ; end_address_high &7a57 20 76 7a JSR &7a76 ; move_memory # Move &7000 - &77ff to &0c00 - &13ff, call &7ad2 &7a5a a9 00 LDA #&00 &7a5c 85 70 STA &70 ; source_address_low &7a5e 85 72 STA &72 ; target_address_low &7a60 85 74 STA &74 &7a62 a9 5e LDA #&5e ; &5e00 &7a64 85 71 STA &71 ; source_address_high &7a66 a9 0b LDA #&0b ; &0b00 &7a68 85 73 STA &73 ; target_address_high &7a6a a9 5f LDA #&5f ; &5f00 &7a6c 85 75 STA &75 ; end_address_high &7a6e a9 00 LDA #&00 ; &1400 = entry_point &7a70 85 76 STA &76 ; call_address_low &7a72 a9 14 LDA #&14 &7a74 85 77 STA &77 ; call_address_high ; move_memory # Move &5e00 - &5eff to &0b00 - &0bff, call &1400 &7a76 a0 00 LDY #&00 ; move_memory_loop &7a78 a5 70 LDA &70 ; source_address_low &7a7a c5 74 CMP &74 ; end_address_low &7a7c d0 09 BNE &7a87 ; not_at_end &7a7e a5 71 LDA &71 ; source_address_high &7a80 c5 75 CMP &75 ; end_address_high &7a82 d0 03 BNE &7a87 ; not_at_end &7a84 6c 76 00 JMP (&0076) ; call_address ; not_at_end &7a87 b1 70 LDA (&70),Y ; source_address &7a89 91 72 STA (&72),Y ; target_address &7a8b e6 70 INC &70 ; source_address_low &7a8d d0 02 BNE &7a91 ; skip_page &7a8f e6 71 INC &71 ; source_address_high ; skip_page &7a91 e6 72 INC &72 ; target_address_low &7a93 d0 e3 BNE &7a78 ; move_memory_loop &7a95 e6 73 INC &73 ; target_address_high &7a97 4c 78 7a JMP &7a78 ; move_memory_loop ; instructions_screen &7a9a a9 16 LDA #&16 # Change to MODE 7 &7a9c 20 ee ff JSR &ffee ; OSWRCH &7a9f a9 07 LDA #&07 &7aa1 20 ee ff JSR &ffee ; OSWRCH &7aa4 a9 60 LDA #&60 ; &6000 = instructions_text &7aa6 85 71 STA &71 ; text_address_high &7aa8 a9 00 LDA #&00 &7aaa 85 70 STA &70 ; text_address_low &7aac a9 05 LDA #&05 &7aae 85 72 STA &72 ; screens_remaining &7ab0 a0 00 LDY #&00 ; instructions_screen_screen_loop &7ab2 a2 19 LDX #&19 ; instructions_screen_line_loop &7ab4 20 e7 ff JSR &ffe7 ; OSNEWL ; instructions_screen_byte_loop &7ab7 b1 70 LDA (&70),Y ; text_address &7ab9 c8 INY &7aba d0 02 BNE &7abe ; skip_page &7abc e6 71 INC &71 ; text_address_high ; skip_page &7abe c9 0d CMP #&0d ; CR &7ac0 f0 06 BEQ &7ac8 ; is_end_of_line &7ac2 20 ee ff JSR &ffee ; OSWRCH &7ac5 4c b7 7a JMP &7ab7 ; instructions_screen_byte_loop ; is_end_of_line &7ac8 ca DEX &7ac9 d0 e9 BNE &7ab4 ; instructions_screen_line_loop &7acb 20 e0 ff JSR &ffe0 ; OSRDCH &7ace c6 72 DEC &72 ; screens_remaining &7ad0 d0 e0 BNE &7ab2 ; instructions_screen_screen_loop ; null_function &7ad2 60 RTS ; file_block &7ad3 d2 a5 ; filename &7ad5 5a a5 5a a5 ; load address &7ad9 5a a5 5a a5 ; execution address &7add 5a a5 5a a5 ; start address &7ae1 5a a5 5a a5 ; end address ; filename # Filename contains embedded delete character &7ae5 22 56 41 4c 4c 45 59 20 7f 22 0d ; ""VALLEY ." ; unused &7af0 a5 5a a5 5a a5 5a a5 5a a5 5a a5 5a a5 5a a5 5a Game disassembly ================ ; VALLEY ? # Filename contains embedded delete character ; 00000000 00000000 6800 # &1000 - &13ff is moved to &0400 - &07ff at &7a40 ; dictionary_two_words_addresses_low_table &0400 00 04 05 08 0c 0f 14 18 1b 22 25 29 2f 31 3b 44 &0410 4b 50 57 5c 60 66 68 71 7c 82 89 91 98 9c a0 a9 &0420 b0 b7 c0 c7 cc d3 dc e1 e7 ed f1 f8 05 08 0a 0f &0430 10 15 19 1d 21 26 2c 32 35 38 3f 46 4b 53 56 5e &0440 62 68 6d 72 77 7d 85 89 91 97 9c a2 a8 ae b7 bb &0450 c3 ca d1 d9 df ea f0 f8 ff 03 0a 11 19 1f 26 2b &0460 33 38 3b 45 49 4c 52 56 5c 66 6d 75 7d 87 90 97 &0470 9c a4 aa ad b4 b6 ba bf c2 c6 cb d3 d9 e1 e4 ; unused &047f 61 ; dictionary_two_words_addresses_high_table &0480 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 &0490 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 &04a0 05 05 05 05 05 05 05 05 05 05 05 05 06 06 06 06 &04b0 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 &04c0 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 &04d0 06 06 06 06 06 06 06 06 06 07 07 07 07 07 07 07 &04e0 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 &04f0 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 ; unused &04ff ec ; dictionary_two &0500 57 48 41 d4 ; word &80 : "WHAT" &0504 c9 ; word &81 : "I" &0505 41 4e d9 ; word &82 : "ANY" &0508 48 41 56 c5 ; word &83 : "HAVE" &050c 4e 4f d7 ; word &84 : "NOW" &050f 43 41 52 52 d9 ; word &85 : "CARRY" &0514 4d 4f 52 c5 ; word &86 : "MORE" &0518 59 4f d5 ; word &87 : "YOU" &051b 48 41 56 45 4e 27 d4 ; word &88 : "HAVEN'T" &0522 47 4f d4 ; word &89 : "GOT" &0525 54 48 41 d4 ; word &8a : "THAT" &0529 48 41 53 4e 27 d4 ; word &8b : "HASN'T" &052f 4f cb ; word &8c : "OK" &0531 43 4f 4e 54 41 49 4e 49 4e c7 ; word &8d : "CONTAINING" &053b 46 4f 4c 4c 4f 57 49 4e c7 ; word &8e : "FOLLOWING" &0544 4e 4f 54 48 49 4e c7 ; word &8f : "NOTHING" &054b 44 4f 4e 27 d4 ; word &90 : "DON'T" &0550 41 4c 52 45 41 44 d9 ; word &91 : "ALREADY" &0557 4c 4f 43 4b d3 ; word &92 : "LOCKS" &055c 49 54 27 d3 ; word &93 : "IT'S" &0560 41 4c 57 41 59 d3 ; word &94 : "ALWAYS" &0566 49 c6 ; word &95 : "IF" &0568 55 4e 56 49 53 49 54 45 c4 ; word &96 : "UNVISITED" &0571 44 45 53 43 52 49 50 54 49 4f ce ; word &97 : "DESCRIPTION" &057c 53 45 4c 45 43 d4 ; word &98 : "SELECT" &0582 4d 41 47 49 43 41 cc ; word &99 : "MAGICAL" &0589 44 41 52 4b 4e 45 53 d3 ; word &9a : "DARKNESS" &0591 4c 49 4e 47 45 52 d3 ; word &9b : "LINGERS" &0598 43 4f 4f cc ; word &9c : "COOL" &059c 46 45 45 cc ; word &9d : "FEEL" &05a0 53 54 52 41 4e 47 45 4c d9 ; word &9e : "STRANGELY" &05a9 48 45 41 4c 54 48 d9 ; word &9f : "HEALTHY" &05b0 53 48 41 4c 4c 4f d7 ; word &a0 : "SHALLOW" &05b7 52 45 46 52 45 53 48 45 d3 ; word &a1 : "REFRESHES" &05c0 53 54 52 41 4e 47 c5 ; word &a2 : "STRANGE" &05c7 4d 41 47 49 c3 ; word &a3 : "MAGIC" &05cc 52 45 56 45 41 4c d3 ; word &a4 : "REVEALS" &05d3 43 4f 4e 43 45 41 4c 45 c4 ; word &a5 : "CONCEALED" &05dc 44 4f 4f 52 d3 ; word &a6 : "DOORS" &05e1 4c 49 51 55 49 c4 ; word &a7 : "LIQUID" &05e7 44 52 41 49 4e d3 ; word &a8 : "DRAINS" &05ed 41 57 41 d9 ; word &a9 : "AWAY" &05f1 42 79 65 5f 42 79 e5 ; word &aa : "Bye_Bye" &05f8 20 28 59 65 73 20 2f 20 4e 6f 29 20 bf ; word &ab : " (Yes / No) ?" &0605 50 55 d4 ; word &ac : "PUT" &0608 42 c5 ; word &ad : "BE" &060a 53 49 4c 4c d9 ; word &ae : "SILLY" &060f a1 ; word &af : "!" &0610 44 59 49 4e c7 ; word &b0 : "DYING" &0615 57 45 41 cb ; word &b1 : "WEAK" &0619 44 45 41 c4 ; word &b2 : "DEAD" &061d 57 49 54 c8 ; word &b3 : "WITH" &0621 44 52 4f 50 d3 ; word &b4 : "DROPS" &0626 54 48 52 4f 57 ce ; word &b5 : "THROWN" &062c 42 52 45 41 4b d3 ; word &b6 : "BREAKS" &0632 57 48 cf ; word &b7 : "WHO" &0635 46 4f d2 ; word &b8 : "FOR" &0638 52 45 51 55 45 53 d4 ; word &b9 : "REQUEST" &063f 52 45 46 55 53 45 c4 ; word &ba : "REFUSED" &0646 54 41 4b 45 d3 ; word &bb : "TAKES" &064b 53 43 52 41 4d 42 4c c5 ; word &bc : "SCRAMBLE" &0653 4f 55 d4 ; word &bd : "OUT" &0656 46 4c 49 43 4b 45 52 d3 ; word &be : "FLICKERS" &065e 44 49 45 d3 ; word &bf : "DIES" &0662 54 48 49 52 53 d4 ; word &c0 : "THIRST" &0668 43 41 53 54 d3 ; word &c1 : "CASTS" &066d 53 50 45 4c cc ; word &c2 : "SPELL" &0672 53 57 49 4d d3 ; word &c3 : "SWIMS" &0677 46 4c 41 4d 45 d3 ; word &c4 : "FLAMES" &067d 47 45 4e 45 52 4f 55 d3 ; word &c5 : "GENEROUS" &0685 47 49 46 d4 ; word &c6 : "GIFT" &0689 41 43 43 45 50 54 45 c4 ; word &c7 : "ACCEPTED" &0691 52 45 54 55 52 ce ; word &c8 : "RETURN" &0697 47 49 56 45 ce ; word &c9 : "GIVEN" &069c 41 4d 55 4c 45 d4 ; word &ca : "AMULET" &06a2 4b 49 4e 47 27 d3 ; word &cb : "KING'S" &06a8 50 45 4f 50 4c c5 ; word &cc : "PEOPLE" &06ae 52 45 43 4f 47 4e 49 53 c5 ; word &cd : "RECOGNISE" &06b7 54 4f 4c c4 ; word &ce : "TOLD" &06bb 56 41 47 41 42 4f 4e c4 ; word &cf : "VAGABOND" &06c3 57 49 54 48 4f 55 d4 ; word &d0 : "WITHOUT" &06ca 52 45 53 50 45 43 d4 ; word &d1 : "RESPECT" &06d1 50 45 52 53 4f 4e 41 cc ; word &d2 : "PERSONAL" &06d9 41 52 52 45 53 d4 ; word &d3 : "ARREST" &06df 54 52 45 53 50 41 53 53 49 4e c7 ; word &d4 : "TRESPASSING" &06ea 44 45 4d 41 4e c4 ; word &d5 : "DEMAND" &06f0 53 55 49 54 41 42 4c c5 ; word &d6 : "SUITABLE" &06f8 50 41 59 4d 45 4e d4 ; word &d7 : "PAYMENT" &06ff 53 48 4f d7 ; word &d8 : "SHOW" &0703 46 52 45 45 44 4f cd ; word &d9 : "FREEDOM" &070a 57 45 4c 43 4f 4d c5 ; word &da : "WELCOME" &0711 48 4f 4e 4f 55 52 45 c4 ; word &db : "HONOURED" &0719 49 4e 44 45 45 c4 ; word &dc : "INDEED" &071f 42 45 43 41 55 53 c5 ; word &dd : "BECAUSE" &0726 48 41 4e 44 d3 ; word &de : "HANDS" &072b 50 52 49 4e 43 45 53 d3 ; word &df : "PRINCESS" &0733 46 4c 45 45 d3 ; word &e0 : "FLEES" &0738 53 48 c5 ; word &e1 : "SHE" &073b 52 45 43 4f 47 4e 49 53 45 d3 ; word &e2 : "RECOGNISES" &0745 53 41 59 d3 ; word &e3 : "SAYS" &0749 48 45 d2 ; word &e4 : "HER" &074c 46 41 54 48 45 d2 ; word &e5 : "FATHER" &0752 57 49 4c cc ; word &e6 : "WILL" &0756 52 45 57 41 52 c4 ; word &e7 : "REWARD" &075c 48 41 4e 44 53 4f 4d 45 4c d9 ; word &e8 : "HANDSOMELY" &0766 44 4f 45 53 4e 27 d4 ; word &e9 : "DOESN'T" &076d 45 4e 47 55 4c 46 45 c4 ; word &ea : "ENGULFED" &0775 53 54 52 45 4e 47 54 c8 ; word &eb : "STRENGTH" &077d 55 4e 44 45 52 53 54 41 4e c4 ; word &ec : "UNDERSTAND" &0787 44 49 52 45 43 54 49 4f ce ; word &ed : "DIRECTION" &0790 48 41 50 50 45 4e d3 ; word &ee : "HAPPENS" &0797 53 45 45 4d d3 ; word &ef : "SEEMS" &079c 4f 52 44 49 4e 41 52 d9 ; word &f0 : "ORDINARY" &07a4 53 49 4d 50 4c c5 ; word &f1 : "SIMPLE" &07aa 59 45 d4 ; word &f2 : "YET" &07ad 43 4f 4d 50 4c 45 d8 ; word &f3 : "COMPLEX" &07b4 41 d3 ; word &f4 : "AS" &07b6 53 54 41 d9 ; word &f5 : "STAY" &07ba 56 4f 49 43 c5 ; word &f6 : "VOICE" &07bf 4d 41 d9 ; word &f7 : "MAY" &07c2 50 41 53 d3 ; word &f8 : "PASS" &07c6 50 52 4f 56 c5 ; word &f9 : "PROVE" &07cb 59 4f 55 52 53 45 4c c6 ; word &fa : "YOURSELF" &07d3 57 4f 52 54 48 d9 ; word &fb : "WORTHY" &07d9 42 52 49 4e 47 49 4e c7 ; word &fc : "BRINGING" &07e1 21 21 a1 ; word &fd : "!!!" ; unused &07e4 0d &07e5 52 53 54 41 4e c4 ; "RSTAND" &07eb 0d 0d &07ed 31 ; "1" &07ee 0d ; unused # Source code fragment &07ef 04 10 11 2e 53 48 55 54 20 4c 44 58 50 ; 1040 .SHUT LDXP ... ; unused &07fc fc 13 00 00 ; entry_point &1400 20 9c 14 JSR &149c ; start_new_line &1403 a9 aa LDA #&aa &1405 85 1d STA &1d ; rnd_state &1407 a9 80 LDA #&80 &1409 8d fb 27 STA &27fb ; lamp_life &140c 85 03 STA &03 ; crystal_bridge_state # Set to non-zero to indicate bridge absent &140e 85 02 STA &02 ; player_hydration &1410 85 26 STA &26 ; uppercase # Set top bit to use uppercase &1412 a9 02 LDA #&02 &1414 85 27 STA &27 ; wooden_staff_drop_cooldown # Don't drop wooden staff until third chance failed &1416 20 c0 1f JSR &1fc0 ; initialise_mode_7_screen &1419 a9 01 LDA #&01 &141b 85 89 STA &89 ; player_room &141d 8d b4 29 STA &29b4 ; characters_location + 0 (CHARACTER_PLAYER) &1420 a9 00 LDA #&00 &1422 85 2a STA &2a ; text_delay &1424 20 0d 18 JSR &180d ; handle_option &1427 a9 00 LDA #&00 &1429 85 20 STA &20 ; amulet_state # Set to zero to indicate amulet not received &142b 85 21 STA &21 ; princess_state # Set to zero to indicate princess has not fled &142d 85 24 STA &24 ; room_29_or_4d_visited # Set to zero to indicate neither room visited &142f 85 25 STA &25 ; last_character_written # Set to zero to indicate nothing written &1431 8d fa 27 STA &27fa ; holdall_weight &1434 85 00 STA &00 ; concealed_doors_state # Set to zero to indicate doors not revealed &1436 85 14 STA &14 ; player_room_at_start_of_turn &1438 85 1c STA &1c ; player_previous_room &143a a2 25 LDX #&25 ; initialise_character_flags_loop &143c 9d d0 2a STA &2ad0,X ; characters_flags &143f ca DEX &1440 10 fa BPL &143c ; initialise_character_flags_loop &1442 a5 01 LDA &01 ; display_options &1444 29 a0 AND #&a0 ; OPTION_ALWAYS | OPTION_UNVISITED # &80 set if draw picture always, &20 if unvisited &1446 f0 06 BEQ &144e ; skip_drawing_picture &1448 20 17 25 JSR &2517 ; draw_room_picture &144b 4c 51 14 JMP &1451 ; main_game_loop ; skip_drawing_picture &144e 20 ea 20 JSR &20ea ; write_room_description ; new_turn &1451 a9 00 LDA #&00 # Positive to start turn &1453 20 00 0c JSR &0c00 ; update_turn &1456 a5 83 LDA &83 ; input_verb &1458 c9 0e CMP #&0e ; "swest" + 1 &145a b0 23 BCS &147f ; not_direction ; is_direction &145c 2c d0 2a BIT &2ad0 ; characters_flags + 0 (CHARACTER_PLAYER) # Negative if CHARACTER_FLAG_WAS_ATTACKED set &145f 10 13 BPL &1474 ; not_attacked ; was_attacked &1461 20 d4 24 JSR &24d4 ; handle_direction_and_end_sentence &1464 a9 40 LDA #&40 ; CHARACTER_FLAG_MOVED_AND_WAS_ATTACKED &1466 8d d0 2a STA &2ad0 ; characters_flags + 0 (CHARACTER_PLAYER) # Set &40 to stop further attacks &1469 0a ASL A # Negative to end turn &146a 20 00 0c JSR &0c00 ; update_turn ; clear_player_character_flags &146d a9 00 LDA #&00 &146f 8d d0 2a STA &2ad0 ; characters_flags + 0 (CHARACTER_PLAYER) # Clear CHARACTER_FLAG_MOVED_AND_WAS_ATTACKED &1472 f0 dd BEQ &1451 ; new_turn # Always branches ; not_attacked &1474 a9 80 LDA #&80 # Negative to end turn &1476 20 00 0c JSR &0c00 ; update_turn &1479 20 d4 24 JSR &24d4 ; handle_direction_and_end_sentence &147c 4c 6d 14 JMP &146d ; clear_player_character_flags ; not_direction &147f c9 11 CMP #&11 ; "drop" &1481 b0 0e BCS &1491 ; is_verb_with_handler ; is_hit_cut_or_throw &1483 20 da 1d JSR &1dda ; handle_hit_cut_or_throw &1486 20 9c 14 JSR &149c ; start_new_line &1489 a9 80 LDA #&80 # Negative to end turn &148b 20 00 0c JSR &0c00 ; update_turn &148e 4c 51 14 JMP &1451 ; new_turn ; is_verb_with_handler &1491 20 a7 14 JSR &14a7 ; call_verb_handler &1494 a9 80 LDA #&80 # Negative to end turn &1496 20 00 0c JSR &0c00 ; update_turn &1499 4c 6d 14 JMP &146d ; clear_player_character_flags ; start_new_line &149c a9 00 LDA #&00 &149e 85 6f STA &6f ; next_line_screen_x &14a0 85 82 STA &82 ; screen_x &14a2 a9 0d LDA #&0d ; CR &14a4 4c ee ff JMP &ffee ; OSWRCH ; call_verb_handler &14a7 ba TSX &14a8 86 69 STX &69 ; stack_pointer_before_verb_handler &14aa aa TAX &14ab bd b1 1e LDA &1eb1,X ; verb_handler_addresses_low_table - &11 &14ae 85 60 STA &60 ; handler_address_low &14b0 bd cf 1e LDA &1ecf,X ; verb_handler_addresses_high_table - &11 &14b3 85 61 STA &61 ; handler_address_high &14b5 6c 60 00 JMP (&0060) ; handler_address ; write_word_from_dictionary_two &14b8 30 03 BMI &14bd ; use_dictionary_two &14ba 4c d9 1f JMP &1fd9 ; write_word_from_dictionary_one ; use_dictionary_two &14bd a8 TAY &14be b9 80 03 LDA &0380,Y ; dictionary_two_words_addresses_low_table - &80 &14c1 85 70 STA &70 ; word_address_low &14c3 b9 00 04 LDA &0400,Y ; dictionary_two_words_addresses_high_table - &80 &14c6 85 71 STA &71 ; word_address_high &14c8 b9 81 03 LDA &0381,Y ; dictionary_two_words_addresses_low_table - &80 + 1 &14cb 4c ea 1f JMP &1fea ; write_word_from_dictionary_two_from_address ; write_string_using_dictionary_two &14ce 68 PLA # Packed string follows call &14cf 85 60 STA &60 ; packed_string_address_low &14d1 68 PLA &14d2 85 61 STA &61 ; packed_string_address_high ; write_string_using_dictionary_two_loop &14d4 e6 60 INC &60 ; packed_string_address_low &14d6 d0 02 BNE &14da ; skip_page &14d8 e6 61 INC &61 ; packed_string_address_high ; skip_page &14da a0 00 LDY #&00 &14dc b1 60 LDA (&60),Y ; packed_string_address &14de f0 06 BEQ &14e6 ; return_after_call &14e0 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &14e3 4c d4 14 JMP &14d4 ; write_string_using_dictionary_two_loop ; return_after_call &14e6 e6 60 INC &60 ; packed_string_address_low &14e8 d0 02 BNE &14ec ; skip_page &14ea e6 61 INC &61 ; packed_string_address_high ; skip_page &14ec 6c 60 00 JMP (&0060) ; packed_string_address ; determine_input_object # Called with A = location to consider objects in &14ef 85 61 STA &61 ; location &14f1 a9 00 LDA #&00 &14f3 85 60 STA &60 ; best_matches &14f5 ae fc 27 LDX &27fc ; number_of_objects ; determine_input_object_loop &14f8 bd bf 25 LDA &25bf,X ; objects_location - 1 &14fb c5 61 CMP &61 ; location &14fd d0 2c BNE &152b ; consider_next_object &14ff a9 00 LDA #&00 &1501 85 62 STA &62 ; words_matched &1503 bd 7f 25 LDA &257f,X ; objects_description - 1 &1506 a8 TAY &1507 b9 50 27 LDA &2750,Y ; object_descriptions_first_word &150a 20 2f 15 JSR &152f ; check_for_word_in_input &150d b9 7a 27 LDA &277a,Y ; object_descriptions_second_word &1510 20 2f 15 JSR &152f ; check_for_word_in_input &1513 b9 a4 27 LDA &27a4,Y ; object_descriptions_third_word &1516 20 2f 15 JSR &152f ; check_for_word_in_input &1519 b9 ce 27 LDA &27ce,Y ; object_descriptions_fourth_word &151c 20 2f 15 JSR &152f ; check_for_word_in_input &151f a5 60 LDA &60 ; best_matches &1521 c5 62 CMP &62 ; words_matched &1523 b0 06 BCS &152b ; consider_next_object &1525 a5 62 LDA &62 ; words_matched &1527 85 60 STA &60 ; best_matches &1529 86 63 STX &63 ; input_object ; consider_next_object &152b ca DEX &152c d0 ca BNE &14f8 ; determine_input_object_loop &152e 60 RTS ; check_for_word_in_input &152f f0 16 BEQ &1547 ; leave &1531 85 64 STA &64 ; word_to_look_for &1533 8a TXA &1534 48 PHA ; tmp_x &1535 a6 84 LDX &84 ; number_of_words_in_input &1537 f0 0c BEQ &1545 ; leave_after_restoring_x ; check_for_word_in_input_loop &1539 bd 7f 0a LDA &0a7f,X ; tokenised_input - 1 &153c c5 64 CMP &64 ; word_to_look_for &153e d0 02 BNE &1542 ; consider_next_word_of_input &1540 e6 62 INC &62 ; words_matched ; consider_next_word_of_input &1542 ca DEX &1543 d0 f4 BNE &1539 ; check_for_word_in_input_loop ; leave_after_restoring_x &1545 68 PLA ; tmp_x &1546 aa TAX ; leave &1547 60 RTS ; handle_take &1548 a5 89 LDA &89 ; player_room &154a 20 ef 14 JSR &14ef ; determine_input_object &154d a5 60 LDA &60 ; best_matches &154f d0 1e BNE &156f ; handle_take_object ; handle_take_not_object &1551 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1554 12 80 00 ; "Take what" &1557 20 9f 22 JSR &229f ; prompt_for_input &155a a5 89 LDA &89 ; player_room &155c 20 ef 14 JSR &14ef ; determine_input_object &155f a5 60 LDA &60 ; best_matches &1561 d0 0c BNE &156f ; handle_take_object ; write_i_cant_see_any_here &1563 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1566 81 36 34 82 37 00 ; "I can't see any here" &156c 4c 6a 1e JMP &1e6a ; leave_verb_handler ; handle_take_object &156f a6 63 LDX &63 ; input_object &1571 ca DEX &1572 a0 c8 LDY #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &1574 98 TYA # Set to negative to set object location &1575 20 6c 1b JSR &1b6c ; set_object_location # Returns carry clear if not too heavy &1578 90 03 BCC &157d ; write_i_have_it_now &157a 4c 97 15 JMP &1597 ; write_character_name_cant_carry_any_more ; write_i_have_it_now &157d 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1580 81 83 38 84 00 ; "I have it now" &1585 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; add_to_player_load &1588 18 CLC &1589 6d da 29 ADC &29da ; characters_load + 0 (CHARACTER_PLAYER) &158c b0 09 BCS &1597 ; write_you_cant_carry_any_more &158e cd e0 28 CMP &28e0 ; character_descriptions_maximum_load + 0 (CHARACTER_DESCRIPTION_YOU) &1591 b0 04 BCS &1597 ; write_you_cant_carry_any_more &1593 8d da 29 STA &29da ; characters_load + 0 (CHARACTER_PLAYER) &1596 60 RTS ; write_you_cant_carry_any_more &1597 a2 c8 LDX #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) ; write_character_name_cant_carry_any_more &1599 20 ea 1b JSR &1bea ; write_character_name &159c 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &159f 36 85 82 86 00 ; "Can't carry any more" &15a4 4c 6a 1e JMP &1e6a ; leave_verb_handler ; check_for_object_in_room &15a7 a5 6e LDA &6e ; room_to_consider &15a9 20 ef 14 JSR &14ef ; determine_input_object # Find best matching object in room &15ac a5 60 LDA &60 ; best_matches &15ae 85 6c STA &6c ; previous_best_matches &15b0 a5 63 LDA &63 ; input_object &15b2 85 6d STA &6d ; previous_input_object &15b4 ad c0 25 LDA &25c0 ; objects_location + 0 (OBJECT_HOLDALL) &15b7 c5 6e CMP &6e ; room_to_consider # Is the holdall in the room? &15b9 d0 0e BNE &15c9 ; use_object_in_room &15bb a9 ff LDA #&ff ; ROOM_IN_HOLDALL &15bd 20 ef 14 JSR &14ef ; determine_input_object # If so, find best matching object in holdall &15c0 a5 6c LDA &6c ; previous_best_matches &15c2 c5 60 CMP &60 ; best_matches &15c4 b0 03 BCS &15c9 ; use_object_in_room # Is it a better match than any object in the room? ; use_object_in_holdall &15c6 a5 60 LDA &60 ; best_matches # If so, use object in holdall ; leave &15c8 60 RTS # Leave with non-zero if object, zero if no object ; use_object_in_room &15c9 a5 6d LDA &6d ; previous_input_object # If not, use object in room &15cb 85 63 STA &63 ; input_object &15cd a5 6c LDA &6c ; previous_best_matches &15cf 85 60 STA &60 ; best_matches &15d1 60 RTS # Leave with non-zero if object, zero if no object ; check_for_object_carried_by_player &15d2 a9 01 LDA #&01 ; CHARACTER_PLAYER + 1 ; check_for_object_carried_by_character &15d4 18 CLC &15d5 69 c7 ADC #&c7 ; ROOM_CARRYING - 1 &15d7 85 6e STA &6e ; room_to_consider &15d9 20 a7 15 JSR &15a7 ; check_for_object_in_room # Returns non-zero if object found &15dc d0 ea BNE &15c8 ; leave &15de a5 83 LDA &83 ; input_verb # Otherwise, prompt player to specify object &15e0 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &15e3 a9 80 LDA #&80 ; "what" &15e5 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &15e8 20 9f 22 JSR &229f ; prompt_for_input &15eb 20 a7 15 JSR &15a7 ; check_for_object_in_room # Returns non-zero if object found &15ee d0 d8 BNE &15c8 ; leave &15f0 a5 6e LDA &6e ; room_to_consider &15f2 c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &15f4 d0 0b BNE &1601 ; is_npc ; write_you_havent_got_that &15f6 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &15f9 87 88 89 8a 00 ; "You haven't got that" &15fe 4c 6a 1e JMP &1e6a ; leave_verb_handler ; write_character_hasnt_got_that &1601 aa TAX &1602 20 ea 1b JSR &1bea ; write_character_name &1605 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1608 8b 89 8a 00 ; "hasn't got that" &160c 4c 6a 1e JMP &1e6a ; leave_verb_handler ; handle_drop &160f 20 d2 15 JSR &15d2 ; check_for_object_carried_by_player # Doesn't return if object not carried &1612 a6 63 LDX &63 ; input_object &1614 ca DEX &1615 a4 89 LDY &89 ; player_room &1617 a9 ff LDA #&ff # Set to negative to set object location &1619 20 6c 1b JSR &1b6c ; set_object_location ; write_ok &161c a9 8c LDA #&8c ; "Ok" ; write_word_from_dictionary_two_and_end_sentence &161e 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &1621 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; list_objects_carried &1624 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1627 87 83 00 ; "You have" &162a a9 c8 LDA #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &162c 4c 4c 16 JMP &164c ; list_objects_in_room_A ; handle_inventory &162f 20 24 16 JSR &1624 ; list_objects_carried &1632 ad c0 25 LDA &25c0 ; objects_location + 0 (OBJECT_HOLDALL) &1635 c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &1637 d0 03 BNE &163c ; skip_holdall &1639 20 3f 16 JSR &163f ; list_objects_in_holdall ; skip_holdall &163c 4c 51 3b JMP &3b51 ; write_newline ; list_objects_in_holdall &163f a9 02 LDA #&02 &1641 85 6f STA &6f ; next_line_screen_x # Indent holdall line &1643 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1646 3a 76 8d 00 ; "a holdall containing" &164a a9 ff LDA #&ff ; ROOM_IN_HOLDALL ; list_objects_in_room_A &164c 85 64 STA &64 ; room_to_list &164e a9 00 LDA #&00 &1650 85 62 STA &62 ; list_state # Set to zero to indicate first object &1652 ae fc 27 LDX &27fc ; number_of_objects &1655 ca DEX &1656 86 63 STX &63 ; object_to_consider ; list_objects_loop &1658 bd c0 25 LDA &25c0,X ; objects_location &165b c5 64 CMP &64 ; room_to_list &165d d0 22 BNE &1681 ; consider_next_object &165f 24 62 BIT &62 ; list_state # Negative if not first object &1661 30 16 BMI &1679 ; not_first_object ; is_first_object &1663 c6 62 DEC &62 ; list_state # Set to negative to indicate no longer first object &1665 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1668 5d 8e 00 ; "the following" &166b a9 80 LDA #&80 &166d 85 26 STA &26 ; uppercase # Set top bit to use uppercase &166f a5 6f LDA &6f ; next_line_screen_x &1671 18 CLC &1672 69 02 ADC #&02 # Indent list items &1674 85 6f STA &6f ; next_line_screen_x &1676 20 51 3b JSR &3b51 ; write_newline ; not_first_object &1679 a6 63 LDX &63 ; object_to_consider &167b 20 dd 24 JSR &24dd ; write_object_name &167e 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; consider_next_object &1681 c6 63 DEC &63 ; object_to_consider &1683 a6 63 LDX &63 ; object_to_consider &1685 d0 d1 BNE &1658 ; list_objects_loop &1687 24 62 BIT &62 ; list_state # Negative if any object listed &1689 30 0c BMI &1697 ; not_nothing &168b ad c0 25 LDA &25c0 ; objects_location + 0 (OBJECT_HOLDALL) &168e c5 64 CMP &64 ; room_to_list &1690 f0 05 BEQ &1697 ; not_nothing ; write_nothing &1692 a9 8f LDA #&8f ; "nothing" &1694 20 1e 16 JSR &161e ; write_word_from_dictionary_two_and_end_sentence ; not_nothing &1697 a9 00 LDA #&00 &1699 85 6f STA &6f ; next_line_screen_x &169b 60 RTS ; write_your_lamp_is_empty &169c 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &169f 3d 5a 3e 1f 00 ; "Your lamp is empty" &16a4 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; handle_on &16a7 a2 01 LDX #&01 ; OBJECT_LAMP &16a9 20 8d 3b JSR &3b8d ; check_if_object_is_carried_or_in_holdall # Returns zero if object carried &16ac d0 26 BNE &16d4 ; write_you_dont_have_a_lamp &16ae ad 81 25 LDA &2581 ; objects_description + 1 (OBJECT_LAMP) &16b1 f0 36 BEQ &16e9 ; write_your_lamp_is_already_on &16b3 a2 0a LDX #&0a ; OBJECT_FLINT &16b5 20 8d 3b JSR &3b8d ; check_if_object_is_carried_or_in_holdall # Returns zero if object carried &16b8 d0 2b BNE &16e5 ; write_you_dont_have_a_flint &16ba ad fb 27 LDA &27fb ; lamp_life &16bd f0 dd BEQ &169c ; write_your_lamp_is_empty &16bf a9 00 LDA #&00 ; "a lit lamp" &16c1 8d 81 25 STA &2581 ; objects_description + 1 (OBJECT_LAMP) &16c4 a9 1a LDA #&1a ; "on" ; write_the_lamp_is_now &16c6 8d d0 16 STA &16d0 ; the_lamp_is_now_on_string + 4 &16c9 20 ce 14 JSR &14ce ; write_string_using_dictionary_two ; the_lamp_is_now_on_string &16cc 5d 5a 3e 84 1a 00 ; "The lamp is now on" &16d2 d0 0e BNE &16e2 ; to_end_sentence_and_write_newline # Always branches ; write_you_dont_have_a_lamp &16d4 a9 5a LDA #&5a ; "lamp" ; write_you_dont_have_a &16d6 8d e0 16 STA &16e0 ; you_dont_have_a_string + 4 &16d9 20 ce 14 JSR &14ce ; write_string_using_dictionary_two ; you_dont_have_a_string &16dc 87 90 83 3a 5a 00 ; "You don't have a lamp" # Last word is modified ; to_end_sentence_and_write_newline &16e2 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; write_you_dont_have_a_flint &16e5 a9 33 LDA #&33 ; "flint" &16e7 d0 ed BNE &16d6 ; ; write_you_dont_have_a # Always branches ; write_your_lamp_is_already_on &16e9 a9 1a LDA #&1a ; "on" ; write_your_lamp_is_already &16eb 8d f5 16 STA &16f5 ; your_lamp_is_already_string + 4 &16ee 20 ce 14 JSR &14ce ; write_string_using_dictionary_two ; your_lamp_is_already_string &16f1 3d 5a 3e 91 1a 00 ; "Your lamp is already on" &16f7 d0 e9 BNE &16e2 ; to_end_sentence_and_write_newline # Always branches ; handle_off &16f9 a2 01 LDX #&01 ; OBJECT_LAMP &16fb 20 8d 3b JSR &3b8d ; check_if_object_is_carried_or_in_holdall # Returns zero if object carried &16fe d0 d4 BNE &16d4 ; write_you_dont_have_a_lamp &1700 ad 81 25 LDA &2581 ; objects_description + 1 (OBJECT_LAMP) &1703 d0 09 BNE &170e ; write_your_lamp_is_already_off &1705 a9 01 LDA #&01 ; "an unlit oil lamp" &1707 8d 81 25 STA &2581 ; objects_description + 1 (OBJECT_LAMP) &170a a9 1b LDA #&1b ; "off" &170c d0 b8 BNE &16c6 ; write_the_lamp_is_now # Always branches ; write_your_lamp_is_already_off &170e a9 1b LDA #&1b ; "off" &1710 d0 d9 BNE &16eb ; write_your_lamp_is_already # Always branches ; find_lockable_exit &1712 20 fb 24 JSR &24fb ; get_room_exit_count_and_data_offset &1715 a6 7a LDX &7a ; room_exit_count &1717 f0 1a BEQ &1733 ; skip_checking_exits &1719 a4 7b LDY &7b ; room_data_offset ; find_lockable_exit_loop &171b b1 77 LDA (&77),Y ; room_data_address # First byte of exit data is direction &171d 85 62 STA &62 ; exit_direction &171f 10 0d BPL &172e ; is_regular_exit # Top bit set if extended exit &1721 c8 INY &1722 c8 INY &1723 b1 77 LDA (&77),Y ; room_data_address # Third byte of extended exit data is state &1725 85 63 STA &63 ; exit_state &1727 10 06 BPL &172f ; consider_next_exit # Top bit set if lockable &1729 a5 62 LDA &62 ; exit_direction &172b 29 40 AND #&40 ; EXIT_DIRECTION_LOCKED # Leave with non-zero if exit is open, zero if locked &172d 60 RTS ; is_regular_exit &172e c8 INY ; consider_next_exit &172f c8 INY # Move to next exit &1730 ca DEX &1731 d0 e8 BNE &171b ; find_lockable_exit_loop ; skip_checking_exits &1733 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1736 8f 37 92 00 ; "Nothing here locks" &173a 4c 6a 1e JMP &1e6a ; leave_verb_handler ; locks_bitmap_table ; 65432 &173d 01 ; 0 : .......1 OBJECT_MASTER_KEY # (none) &173e 11 ; 1 : ...1...1 OBJECT_MASTER_KEY, OBJECT_BRASS_KEY # brass &173f 09 ; 2 : ....8..1 OBJECT_MASTER_KEY, OBJECT_BRONZE_KEY # bronze &1740 19 ; 3 : ...18..1 OBJECT_MASTER_KEY, OBJECT_BRONZE_KEY, OBJECT_BRASS_KEY # metal &1741 05 ; 4 : .....4.1 OBJECT_MASTER_KEY, OBJECT_SILVER_KEY # silver &1742 03 ; 5 : ......21 OBJECT_MASTER_KEY, OBJECT_GOLD_KEY # gold &1743 01 ; 6 : .......1 OBJECT_MASTER_KEY # wooden &1744 01 ; 7 : .......1 OBJECT_MASTER_KEY # stone ; consider_opening_or_locking_exit # Called with A = word &1745 85 64 STA &64 ; open_or_locked &1747 a5 63 LDA &63 ; exit_state &1749 29 07 AND #&07 # .....421 type of lock &174b aa TAX &174c bd 3d 17 LDA &173d,X ; locks_bitmap_table &174f 85 65 STA &65 ; lock_bitmap &1751 a9 01 LDA #&01 &1753 85 60 STA &60 ; ; key_bit &1755 a2 02 LDX #&02 ; OBJECT_MASTER_KEY # For each key, ; consider_opening_or_locking_exit_key_loop &1757 20 8d 3b JSR &3b8d ; check_if_object_is_carried_or_in_holdall # Returns zero if object carried &175a d0 34 BNE &1790 ; consider_next_key # Is the player carrying the key? &175c a5 60 LDA &60 ; key_bit &175e 25 65 AND &65 ; lock_bitmap &1760 f0 2e BEQ &1790 ; consider_next_key # If so, does the key work on this lock? &1762 88 DEY # Move back to first byte of exit data &1763 88 DEY &1764 a5 62 LDA &62 ; exit_direction &1766 49 40 EOR #&40 ; EXIT_DIRECTION_LOCKED # Toggle state of lock in this room &1768 91 77 STA (&77),Y ; room_data_address &176a c8 INY # Move to second byte of exit data &176b a5 89 LDA &89 ; player_room &176d 48 PHA ; player_room &176e b1 77 LDA (&77),Y ; room_data_address # Consider destination room &1770 85 89 STA &89 ; player_room &1772 20 12 17 JSR &1712 ; find_lockable_exit # Doesn't return if no lockable exit &1775 88 DEY # Move back to first byte of exit data &1776 88 DEY &1777 a5 62 LDA &62 ; exit_direction &1779 49 40 EOR #&40 ; EXIT_DIRECTION_LOCKED # Toggle state of lock in destination room &177b 91 77 STA (&77),Y ; room_data_address &177d 68 PLA ; player_room &177e 85 89 STA &89 ; player_room &1780 a5 64 LDA &64 ; open_or_locked &1782 8d 8b 17 STA &178b ; it_is_now_open_string + 3 &1785 20 ce 14 JSR &14ce ; write_string_using_dictionary_two ; it_is_now_open_string &1788 38 3e 84 17 00 ; "It is now open" # Last word is modified &178d 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; consider_next_key &1790 06 60 ASL &60 ; key_bit &1792 e8 INX # Move to next key &1793 e0 07 CPX #&07 ; OBJECT_BRASS_KEY + 1 &1795 90 c0 BCC &1757 ; consider_opening_or_locking_exit_key_loop ; write_you_dont_have_the_key # If none of the keys carried work on this lock, &1797 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &179a 87 90 83 5d 32 00 ; "You don't have the key" &17a0 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; handle_open &17a3 20 12 17 JSR &1712 ; find_lockable_exit # Doesn't return if no lockable exit &17a6 d0 05 BNE &17ad ; is_open # Returns non-zero if exit is open ; is_locked &17a8 a9 17 LDA #&17 ; "open" &17aa 4c 45 17 JMP &1745 ; consider_opening_or_locking_exit ; is_open &17ad a9 17 LDA #&17 ; "open" ; write_its_already &17af 8d b7 17 STA &17b7 ; its_already_open_string + 2 &17b2 20 ce 14 JSR &14ce ; write_string_using_dictionary_two ; its_already_open_string &17b5 93 91 17 00 ; "It's already open" # Last word is modified &17b9 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; handle_lock &17bc 20 12 17 JSR &1712 ; find_lockable_exit # Doesn't return if no lockable exit &17bf f0 05 BEQ &17c6 ; is_locked # Returns non-zero if exit is open ; is_open &17c1 a9 3f LDA #&3f ; "locked" &17c3 4c 45 17 JMP &1745 ; consider_opening_or_locking_exit ; is_locked &17c6 a9 3f LDA #&3f ; "locked" &17c8 d0 e5 BNE &17af ; write_its_already # Always branches ; display_options_table &17ca 60 ; "1" : OPTION_UNVISITED | OPTION_LONG &17cb 20 ; "2" : OPTION_UNVISITED &17cc c0 ; "3" : OPTION_ALWAYS | OPTION_LONG &17cd 80 ; "4" : OPTION_ALWAYS &17ce 40 ; "5" : OPTION_LONG &17cf 00 ; "6" : 0 ; write_draw_picture_always &17d0 20 69 18 JSR &1869 ; write_digit_and_space &17d3 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &17d6 2a 29 94 00 ; "Draw picture always" ; # Bug: missing RTS, falls through ; check_if_character_room_is_player_room &17da a5 1a LDA &1a ; character_room &17dc c5 89 CMP &89 ; player_room &17de 60 RTS ; write_draw_picture_if_room_unvisited &17df 20 69 18 JSR &1869 ; write_digit_and_space &17e2 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &17e5 2a 29 95 40 96 00 ; "Draw picture if room unvisited" &17eb 60 RTS ; write_dont_draw_picture &17ec 20 69 18 JSR &1869 ; write_digit_and_space &17ef 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &17f2 90 2a 29 00 ; "Don't draw picture" &17f6 60 RTS ; write_give_long_description &17f7 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &17fa 39 1c 77 97 00 ; ", give long description" &17ff 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; write_give_short_description &1802 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1805 39 1c 63 97 00 ; ", give short description" &180a 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; handle_option &180d 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1810 98 2d 00 ; "Select option" &1813 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &1816 a9 01 LDA #&01 &1818 20 df 17 JSR &17df ; write_draw_picture_if_room_unvisited &181b 20 f7 17 JSR &17f7 ; write_give_long_description &181e a9 02 LDA #&02 &1820 20 df 17 JSR &17df ; write_draw_picture_if_room_unvisited &1823 20 02 18 JSR &1802 ; write_give_short_description &1826 a9 03 LDA #&03 &1828 20 d0 17 JSR &17d0 ; write_draw_picture_always &182b 20 f7 17 JSR &17f7 ; write_give_long_description &182e a9 04 LDA #&04 &1830 20 d0 17 JSR &17d0 ; write_draw_picture_always &1833 20 02 18 JSR &1802 ; write_give_short_description &1836 a9 05 LDA #&05 &1838 20 ec 17 JSR &17ec ; write_dont_draw_picture &183b 20 f7 17 JSR &17f7 ; write_give_long_description &183e a9 06 LDA #&06 &1840 20 ec 17 JSR &17ec ; write_dont_draw_picture &1843 20 02 18 JSR &1802 ; write_give_short_description ; get_option &1846 20 5a 18 JSR &185a ; get_character_from_keyboard &1849 c9 31 CMP #&31 ; "1" &184b 90 f9 BCC &1846 ; get_option &184d c9 37 CMP #&37 ; "7" &184f b0 f5 BCS &1846 ; get_option &1851 aa TAX &1852 bd 99 17 LDA &1799,X ; display_options_table - &31 ("1") &1855 85 01 STA &01 ; display_options &1857 4c 51 3b JMP &3b51 ; write_newline ; get_character_from_keyboard &185a a9 80 LDA #&80 ; get_character_from_keyboard &185c 85 26 STA &26 ; uppercase # Set top bit to use uppercase &185e a9 7e LDA #&7e ; Acknowledge ESCAPE condition &1860 20 f4 ff JSR &fff4 ; OSBYTE &1863 20 e0 ff JSR &ffe0 ; OSRDCH &1866 4c ee ff JMP &ffee ; OSWRCH ; write_digit_and_space &1869 09 30 ORA #&30 ; "0" &186b 20 ee ff JSR &ffee ; OSWRCH ; write_space &186e a9 20 LDA #&20 ; " " &1870 4c ee ff JMP &ffee ; OSWRCH ; handle_picture &1873 20 fb 24 JSR &24fb ; get_room_exit_count_and_data_offset # Get room flags &1876 24 79 BIT &79 ; room_flags # .4...... set if room is magically dark &1878 50 0c BVC &1886 ; not_magically_dark # i.e. has no picture ; is_magically_dark &187a 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &187d 3a 99 9a 9b 37 00 ; "A magical darkness lingers here" &1883 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; not_magically_dark &1886 10 1b BPL &18a3 ; is_lit # 8....... set if room is dark ; is_dark &1888 ad 81 25 LDA &2581 ; objects_description + 1 (OBJECT_LAMP) &188b d0 19 BNE &18a6 ; is_too_dark &188d ad c1 25 LDA &25c1 ; objects_location + 1 (OBJECT_LAMP) &1890 c5 89 CMP &89 ; player_room # Is the lamp in the room? &1892 f0 0f BEQ &18a3 ; is_lit &1894 c9 c8 CMP #&c8 ; ROOM_CARRYING &1896 90 0e BCC &18a6 ; is_too_dark &1898 a8 TAY &1899 c8 INY &189a f0 0a BEQ &18a6 ; is_too_dark # Branch if lamp is in holdall &189c b9 eb 28 LDA &28eb,Y ; characters_location - &c8 (ROOM_CARRYING) - 1 &189f c5 89 CMP &89 ; player_room # Is the lamp carried by a character in the room? &18a1 d0 03 BNE &18a6 ; is_too_dark ; is_lit &18a3 4c 17 25 JMP &2517 ; draw_room_picture ; is_too_dark &18a6 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &18a9 93 41 42 00 ; "It's too dark" &18ad 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; handle_swim &18b0 20 16 1a JSR &1a16 ; check_if_room_has_water # Returns zero if room has water &18b3 d0 31 BNE &18e6 ; write_there_is_no_water_here &18b5 20 08 1a JSR &1a08 ; check_if_room_has_deep_water # Returns zero if room has deep water &18b8 d0 20 BNE &18da ; write_the_water_is_too_shallow &18ba a5 89 LDA &89 ; player_room &18bc c9 89 CMP #&89 ; ROOM_89 ("at Watersmeet") &18be f0 0b BEQ &18cb ; is_at_watersmeet ; not_at_watersmeet &18c0 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &18c3 5d 6c 3e 9c 00 ; "The water is cool" ; to_end_sentence_and_write_newline &18c8 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; is_at_watersmeet &18cb 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &18ce 87 9d 9e 9f 00 ; "You feel strangely healthy" &18d3 a9 be LDA #&be &18d5 8d 8e 29 STA &298e ; characters_strength + 0 (CHARACTER_PLAYER) &18d8 d0 ee BNE &18c8 ; to_end_sentence_and_write_newline # Always branches ; write_the_water_is_too_shallow &18da 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &18dd 5d 6c 3e 41 a0 00 ; "The water is too shallow" &18e3 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; write_there_is_no_water_here &18e6 a9 6c LDA #&6c ; "water" &18e8 4c 02 1b JMP &1b02 ; write_there_is_no_here ; handle_drink_in_room_without_water &18eb a5 89 LDA &89 ; player_room &18ed 85 1a STA &1a ; character_room &18ef c9 3f CMP #&3f ; ROOM_3f ("in the cellar") &18f1 f0 04 BEQ &18f7 ; handle_drink_beer &18f3 c9 9d CMP #&9d ; ROOM_9d ("in The Sword Inn") &18f5 d0 1a BNE &1911 ; handle_drink_in_room_without_water_or_beer ; handle_drink_beer &18f7 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &18fa 5d 4c 7e a1 87 00 ; "The strong beer refreshes you" &1900 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &1903 a0 32 LDY #&32 ; ceiling # Do 19 - 50 damage for drinking beer &1905 a9 1f LDA #&1f ; random &1907 a2 c8 LDX #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &1909 20 9e 1c JSR &1c9e ; damage_character_randomly ; reset_player_hydration &190c a9 ff LDA #&ff &190e 85 02 STA &02 ; player_hydration &1910 60 RTS ; handle_drink_in_room_without_water_or_beer &1911 a2 09 LDX #&09 ; OBJECT_JUG &1913 20 8d 3b JSR &3b8d ; check_if_object_is_carried_or_in_holdall # Returns zero if object carried &1916 d0 ce BNE &18e6 ; write_there_is_no_water_here # Is the player carrying the jug? &1918 ad 89 25 LDA &2589 ; objects_description + 9 (OBJECT_JUG) &191b c9 1c CMP #&1c ; "a jug of beer" &191d d0 05 BNE &1924 ; not_a_jug_of_beer &191f 20 f7 18 JSR &18f7 ; handle_drink_beer # Returns non-zero &1922 d0 0a BNE &192e ; lighten_and_empty_jug # Always branches ; not_a_jug_of_beer &1924 c9 0b CMP #&0b ; "a jug of water" &1926 d0 be BNE &18e6 ; write_there_is_no_water_here &1928 20 97 19 JSR &1997 ; write_the_cool_water_refreshes_you &192b 20 0c 19 JSR &190c ; reset_player_hydration ; lighten_and_empty_jug &192e ad c9 25 LDA &25c9 ; objects_location + 9 (OBJECT_JUG) &1931 c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &1933 d0 0f BNE &1944 ; lighten_holdall ; lighten_player &1935 ad da 29 LDA &29da ; characters_load + 0 (CHARACTER_PLAYER) &1938 38 SEC &1939 e9 0f SBC #&0f ; 15 # Jug contents weight 15 &193b 8d da 29 STA &29da ; characters_load + 0 (CHARACTER_PLAYER) ; empty_jug &193e a9 0a LDA #&0a ; "an empty stone jug" &1940 8d 89 25 STA &2589 ; objects_description + 9 (OBJECT_JUG) &1943 60 RTS ; lighten_holdall &1944 ad fa 27 LDA &27fa ; holdall_weight &1947 38 SEC &1948 e9 0f SBC #&0f &194a 8d fa 27 STA &27fa ; holdall_weight &194d 4c 3e 19 JMP &193e ; empty_jug ; handle_drink &1950 20 16 1a JSR &1a16 ; check_if_room_has_water # Returns zero if room has water &1953 d0 96 BNE &18eb ; handle_drink_in_room_without_water ; handle_drink_in_room_with_water &1955 20 0c 19 JSR &190c ; reset_player_hydration &1958 a5 89 LDA &89 ; player_room &195a c9 89 CMP #&89 ; ROOM_89 ("at Watersmeet") &195c d0 39 BNE &1997 ; write_the_cool_water_refreshes_you &195e 24 00 BIT &00 ; concealed_doors_state # Negative if concealed doors already revealed &1960 30 35 BMI &1997 ; write_the_cool_water_refreshes_you ; reveal_concealed_doors &1962 c6 00 DEC &00 ; concealed_doors_state # Set to negative to indicate concealed doors revealed &1964 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1967 3a a2 a3 a4 43 87 5d 4d 6b a5 a6 00 ; "A strange magic reveals to you the secret of concealed doors" &1973 a2 06 LDX #&06 &1975 86 60 STX &60 ; count &1977 a5 89 LDA &89 ; player_room &1979 48 PHA ; player_room ; reveal_concealed_doors_loop &197a bd 33 1a LDA &1a33,X ; rooms_with_concealed_doors_table &197d 85 89 STA &89 ; player_room &197f 20 fb 24 JSR &24fb ; get_room_exit_count_and_data_offset &1982 a5 87 LDA &87 ; room_description_length_and_exit_count &1984 18 CLC &1985 69 20 ADC #&20 # Add extra exit to room &1987 a0 01 LDY #&01 &1989 91 77 STA (&77),Y ; room_data_address # Second byte of room data is description length and exit count &198b c6 60 DEC &60 ; count &198d a6 60 LDX &60 ; count &198f 10 e9 BPL &197a ; reveal_concealed_doors_loop &1991 68 PLA ; player_room &1992 85 89 STA &89 ; player_room ; to_end_sentence_and_write_newline &1994 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; write_the_cool_water_refreshes_you &1997 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &199a 5d 9c 6c a1 87 00 ; "The cool water refreshes you" &19a0 d0 f2 BNE &1994 ; to_end_sentence_and_write_newline # Always branches ; handle_empty &19a2 20 d2 15 JSR &15d2 ; check_for_object_carried_by_player # Doesn't return if object not carried &19a5 a6 63 LDX &63 ; input_object &19a7 ca DEX &19a8 f0 2a BEQ &19d4 ; handle_empty_holdall &19aa e0 01 CPX #&01 ; OBJECT_LAMP &19ac f0 23 BEQ &19d1 ; handle_empty_lamp &19ae e0 09 CPX #&09 ; OBJECT_JUG &19b0 f0 05 BEQ &19b7 ; handle_empty_jug &19b2 a5 83 LDA &83 ; input_verb &19b4 4c be 1a JMP &1abe ; write_you_cant ; handle_empty_jug &19b7 ad 89 25 LDA &2589 ; objects_description + 9 (OBJECT_JUG) &19ba c9 0a CMP #&0a ; "an empty stone jug" &19bc d0 05 BNE &19c3 ; handle_empty_full_jug ; handle_empty_empty_jug &19be a9 1f LDA #&1f ; "empty" &19c0 4c af 17 JMP &17af ; write_its_already ; handle_empty_full_jug &19c3 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &19c6 5d a7 a8 a9 00 ; "The liquid drains away" &19cb 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &19ce 4c 2e 19 JMP &192e ; lighten_and_empty_jug ; handle_empty_lamp &19d1 4c f5 1a JMP &1af5 ; write_dont_be_silly ; handle_empty_holdall &19d4 20 1c 16 JSR &161c ; write_ok ; empty_holdall &19d7 ae fc 27 LDX &27fc ; number_of_objects ; empty_holdall_loop &19da bd bf 25 LDA &25bf,X ; objects_location - 1 &19dd c9 ff CMP #&ff ; ROOM_IN_HOLDALL &19df d0 05 BNE &19e6 ; consider_next_object &19e1 a5 89 LDA &89 ; player_room &19e3 9d bf 25 STA &25bf,X ; objects_location - 1 ; consider_next_object &19e6 ca DEX &19e7 d0 f1 BNE &19da ; empty_holdall_loop &19e9 8e fa 27 STX &27fa ; holdall_weight &19ec 60 RTS ; handle_quit &19ed 20 ee 12 JSR &12ee ; handle_score &19f0 a5 83 LDA &83 ; input_verb &19f2 20 d9 1f JSR &1fd9 ; write_word_from_dictionary_one &19f5 20 3a 1a JSR &1a3a ; get_yes_or_no # Returns carry set if yes, carry clear if no &19f8 90 0b BCC &1a05 ; to_write_newline ; end_of_game &19fa a9 aa LDA #&aa ; "Bye_Bye" &19fc 20 1e 16 JSR &161e ; write_word_from_dictionary_two_and_end_sentence ; quit_prompt_loop &19ff 20 9f 22 JSR &229f ; prompt_for_input &1a02 4c ff 19 JMP &19ff ; quit_prompt_loop ; to_write_newline &1a05 4c 51 3b JMP &3b51 ; write_newline ; check_if_room_has_deep_water &1a08 a2 03 LDX #&03 ; check_if_room_has_deep_water_loop &1a0a bd 2f 1a LDA &1a2f,X ; rooms_with_deep_water_table &1a0d c5 89 CMP &89 ; player_room &1a0f d0 01 BNE &1a12 ; consider_next_room &1a11 60 RTS # Leave with zero if room has deep water ; consider_next_room &1a12 ca DEX &1a13 10 f5 BPL &1a0a ; check_if_room_has_deep_water_loop &1a15 60 RTS # Leave with non-zero if room doesn't have deep water ; check_if_room_has_water &1a16 a2 0e LDX #&0e ; check_if_room_has_water_loop &1a18 bd 24 1a LDA &1a24,X ; rooms_with_water_table &1a1b c5 89 CMP &89 ; player_room &1a1d d0 01 BNE &1a20 ; consider_next_room &1a1f 60 RTS # Leave with zero if room has water ; consider_next_room &1a20 ca DEX &1a21 10 f5 BPL &1a18 ; check_if_room_has_water_loop &1a23 60 RTS # Leave with non-zero if room doesn't have water ; rooms_with_water_table &1a24 03 ; ROOM_03 ("by a spring") &1a25 04 ; ROOM_04 ("by a babbling brook") &1a26 08 ; ROOM_08 ("by a small stream") &1a27 09 ; ROOM_09 ("by a stream") &1a28 1b ; ROOM_1b ("close by a large rock, sitting on the canyon floor") &1a29 1c ; ROOM_1c ("in a deep canyon, to the east is a grand view of a waterfall") &1a2a 1d ; ROOM_1d ("on the canyon floor") &1a2b 1e ; ROOM_1e ("at the west end of the canyon") &1a2c 1f ; ROOM_1f ("in a very narrow fissure") &1a2d 87 ; ROOM_87 ("in a narrow fissure") &1a2e 88 ; ROOM_88 ("in a narrow fissure") ; rooms_with_deep_water_table &1a2f 0d ; ROOM_0d ("by a narrow river") &1a30 13 ; ROOM_13 ("by a deep river") &1a31 15 ; ROOM_15 ("at the top of a waterfall") &1a32 89 ; ROOM_89 ("at Watersmeet") ; rooms_with_concealed_doors_table &1a33 8b ; ROOM_8b ("in a cave") &1a34 5e ; ROOM_5e ("in a small bedroom") &1a35 5b ; ROOM_5b ("in the royal bedroom") &1a36 61 ; ROOM_61 ("in a long dry passage") &1a37 5f ; ROOM_5f ("in a small sitting room") &1a38 6f ; ROOM_6f ("in a room full of bones") &1a39 b0 ; ROOM_b0 ("in the strong room") ; get_yes_or_no &1a3a a9 ab LDA #&ab ; " (Yes / No) ?" &1a3c 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two ; get_yes_or_no_loop &1a3f 20 5a 18 JSR &185a ; get_character_from_keyboard &1a42 29 df AND #&df &1a44 c9 59 CMP #&59 ; "Y" &1a46 f0 05 BEQ &1a4d ; leave # Leave with carry set to indicate yes &1a48 c9 4e CMP #&4e ; "N" &1a4a d0 f3 BNE &1a3f ; get_yes_or_no_loop &1a4c 18 CLC # Leave with carry clear to indicate no ; leave &1a4d 60 RTS ; handle_fill_holdall &1a4e 20 24 16 JSR &1624 ; list_objects_carried &1a51 20 51 3b JSR &3b51 ; write_newline &1a54 24 62 BIT &62 ; list_state # Negative if any objects carried &1a56 30 03 BMI &1a5b ; is_carrying_something &1a58 4c 92 16 JMP &1692 ; write_nothing ; is_carrying_something &1a5b ae fc 27 LDX &27fc ; number_of_objects &1a5e ca DEX &1a5f 86 63 STX &63 ; object_to_consider ; handle_fill_holdall_loop &1a61 bd c0 25 LDA &25c0,X ; objects_location &1a64 c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &1a66 d0 19 BNE &1a81 ; consider_next_object &1a68 85 26 STA &26 ; uppercase &1a6a a9 ac LDA #&ac ; "Put" &1a6c 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &1a6f a6 63 LDX &63 ; input_object &1a71 20 dd 24 JSR &24dd ; write_object_name &1a74 a9 44 LDA #&44 ; "in" &1a76 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &1a79 20 3a 1a JSR &1a3a ; get_yes_or_no # Returns carry set if yes, carry clear if no &1a7c b0 0a BCS &1a88 ; handle_fill_holdall_with_object ; write_newline_and_consider_next_object &1a7e 20 51 3b JSR &3b51 ; write_newline ; consider_next_object &1a81 c6 63 DEC &63 ; object_to_consider &1a83 a6 63 LDX &63 ; object_to_consider &1a85 d0 da BNE &1a61 ; handle_fill_holdall_loop &1a87 60 RTS ; handle_fill_holdall_with_object &1a88 a6 63 LDX &63 ; object_to_consider &1a8a a0 ff LDY #&ff ; ROOM_IN_HOLDALL &1a8c 98 TYA # Set to negative to set object location &1a8d 20 6c 1b JSR &1b6c ; set_object_location # Returns carry clear if not too heavy &1a90 90 ec BCC &1a7e ; write_newline_and_consider_next_object &1a92 20 51 3b JSR &3b51 ; write_newline &1a95 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1a98 87 36 13 00 ; "You can't get" &1a9c a6 63 LDX &63 ; object_to_consider &1a9e 20 dd 24 JSR &24dd ; write_object_name &1aa1 a9 44 LDA #&44 ; "in" &1aa3 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &1aa6 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &1aa9 4c 7e 1a JMP &1a7e ; write_newline_and_consider_next_object ; handle_fill &1aac 20 d2 15 JSR &15d2 ; check_for_object_carried_by_player # Doesn't return if object not carried &1aaf a6 63 LDX &63 ; input_object &1ab1 ca DEX &1ab2 f0 9a BEQ &1a4e ; handle_fill_holdall &1ab4 e0 01 CPX #&01 ; OBJECT_LAMP &1ab6 f0 19 BEQ &1ad1 ; handle_fill_lamp &1ab8 e0 09 CPX #&09 ; OBJECT_JUG &1aba f0 5e BEQ &1b1a ; handle_fill_jug &1abc a9 1d LDA #&1d ; "fill" ; write_you_cant &1abe 8d c6 1a STA &1ac6 ; you_cant_fill_string + 2 &1ac1 20 ce 14 JSR &14ce ; write_string_using_dictionary_two ; you_cant_string &1ac4 87 36 1d 00 ; "You can't fill" # Last word is modified &1ac8 a6 63 LDX &63 ; input_object &1aca ca DEX &1acb 20 dd 24 JSR &24dd ; write_object_name &1ace 4c 51 3b JMP &3b51 ; write_newline ; handle_fill_lamp &1ad1 20 16 1a JSR &1a16 ; check_if_room_has_water # Returns zero if room has water &1ad4 f0 1f BEQ &1af5 ; write_dont_be_silly &1ad6 a5 89 LDA &89 ; player_room &1ad8 c9 3c CMP #&3c ; ROOM_3c ("in a workshop") &1ada f0 11 BEQ &1aed ; fill_lamp_with_oil &1adc a2 09 LDX #&09 ; OBJECT_JUG &1ade 20 8d 3b JSR &3b8d ; check_if_object_is_carried_or_in_holdall # Returns zero if object carried &1ae1 d0 1d BNE &1b00 ; write_there_is_no_oil_here &1ae3 ad 89 25 LDA &2589 ; objects_description + 9 (OBJECT_JUG) &1ae6 c9 0c CMP #&0c ; "a jug of oil" &1ae8 d0 16 BNE &1b00 ; write_there_is_no_oil_here &1aea 20 2e 19 JSR &192e ; lighten_and_empty_jug ; fill_lamp_with_oil &1aed a9 ff LDA #&ff &1aef 8d fb 27 STA &27fb ; lamp_life &1af2 4c 1c 16 JMP &161c ; write_ok ; write_dont_be_silly &1af5 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1af8 90 ad ae af 00 ; "Don't be silly !" &1afd 4c 51 3b JMP &3b51 ; write_newline ; write_there_is_no_oil_here &1b00 a9 5c LDA #&5c ; "oil" ; write_there_is_no_here &1b02 8d 0b 1b STA &1b0b ; there_is_no_here_string + 3 &1b05 20 ce 14 JSR &14ce ; write_string_using_dictionary_two ; there_is_no_here_string &1b08 45 3e 46 5c 37 00 ; "There is no oil here" # Fourth word is modified &1b0e 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; write_its_already_full &1b11 a9 47 LDA #&47 ; "full" &1b13 4c af 17 JMP &17af ; write_its_already ; fill_jug_with_water &1b16 a9 0b LDA #&0b ; "a jug of water" &1b18 d0 20 BNE &1b3a ; set_jug_description_if_not_too_heavy ; handle_fill_jug &1b1a ad 89 25 LDA &2589 ; objects_description + 9 (OBJECT_JUG) &1b1d c9 0a CMP #&0a ; "an empty stone jug" &1b1f d0 f0 BNE &1b11 ; write_its_already_full &1b21 20 16 1a JSR &1a16 ; check_if_room_has_water # Returns zero if room has water &1b24 f0 f0 BEQ &1b16 ; fill_jug_with_water &1b26 a5 89 LDA &89 ; player_room &1b28 c9 ae CMP #&ae ; ROOM_ae ("in a large hollow chamber, a river of gold flows through the chamber to the north") &1b2a f0 34 BEQ &1b60 ; fill_jug_with_gold &1b2c c9 3f CMP #&3f ; ROOM_3f ("in the cellar") &1b2e f0 34 BEQ &1b64 ; fill_jug_with_beer &1b30 c9 9d CMP #&9d ; ROOM_9d ("in The Sword Inn") &1b32 f0 30 BEQ &1b64 ; fill_jug_with_beer &1b34 c9 3c CMP #&3c ; ROOM_3c ("in a workshop") &1b36 d0 30 BNE &1b68 ; write_there_is_no_liquid_here ; fill_jug_with_oil &1b38 a9 0c LDA #&0c ; "a jug of oil" ; set_jug_description_if_not_too_heavy &1b3a 48 PHA ; jug description &1b3b ad c9 25 LDA &25c9 ; objects_location + 9 (OBJECT_JUG) &1b3e c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &1b40 d0 0c BNE &1b4e ; is_in_holdall ; is_carried &1b42 a9 0f LDA #&0f ; 15 # Jug contents weight 15 &1b44 20 88 15 JSR &1588 ; add_to_player_load # Doesn't return if object too heavy ; set_jug_description &1b47 68 PLA ; jug description &1b48 8d 89 25 STA &2589 ; objects_description + 9 (OBJECT_JUG) &1b4b 4c 1c 16 JMP &161c ; write_ok ; is_in_holdall &1b4e a9 0f LDA #&0f ; 15 # Jug contents weight 15 &1b50 18 CLC &1b51 6d fa 27 ADC &27fa ; holdall_weight &1b54 c9 64 CMP #&64 ; 100 # Holdall can hold 99 weight in total &1b56 90 03 BCC &1b5b ; set_holdall_weight &1b58 4c 97 15 JMP &1597 ; write_character_name_cant_carry_any_more ; set_holdall_weight &1b5b 8d fa 27 STA &27fa ; holdall_weight &1b5e d0 e7 BNE &1b47 ; set_jug_description # Always branches ; fill_jug_with_gold &1b60 a9 1b LDA #&1b ; "a jug of gold" &1b62 d0 d6 BNE &1b3a ; set_jug_description_if_not_too_heavy # Always branches ; fill_jug_with_beer &1b64 a9 1c LDA #&1c ; "a jug of beer" &1b66 d0 d2 BNE &1b3a ; set_jug_description_if_not_too_heavy # Always branches ; write_there_is_no_liquid_here &1b68 a9 a7 LDA #&a7 ; "liquid" &1b6a d0 96 BNE &1b02 ; write_there_is_no_here # Always branches ; set_object_location # Called with X = object, Y = location &1b6c 86 70 STX &70 ; object # A = negative to set, positive to check &1b6e 85 73 STA &73 ; set_or_check &1b70 bd c0 25 LDA &25c0,X ; objects_location &1b73 85 71 STA &71 ; object_location &1b75 bd 80 25 LDA &2580,X ; objects_description &1b78 aa TAX &1b79 bd 00 26 LDA &2600,X ; object_descriptions_weight &1b7c 85 72 STA &72 ; object_weight &1b7e c0 c8 CPY #&c8 ; ROOM_CARRYING &1b80 b0 06 BCS &1b88 ; consider_if_too_heavy &1b82 24 73 BIT &73 ; set_or_check # Negative if setting, positive if only checking &1b84 30 3e BMI &1bc4 ; set_object_location &1b86 18 CLC # Leave with carry clear to indicate not too heavy &1b87 60 RTS ; consider_if_too_heavy &1b88 c0 ff CPY #&ff ; ROOM_IN_HOLDALL &1b8a d0 13 BNE &1b9f ; consider_if_too_heavy_for_character ; consider_if_too_heavy_for_holdall &1b8c a5 72 LDA &72 ; object_weight &1b8e 18 CLC &1b8f 6d fa 27 ADC &27fa ; holdall_weight &1b92 90 01 BCC &1b95 ; skip_overflow &1b94 60 RTS ; skip_overflow &1b95 c9 64 CMP #&64 ; 100 # Holdall can hold 99 weight in total &1b97 90 01 BCC &1b9a ; not_too_heavy_for_holdall &1b99 60 RTS # Leave with carry set to indicate too heavy ; not_too_heavy_for_holdall &1b9a 8d fa 27 STA &27fa ; holdall_weight &1b9d 90 25 BCC &1bc4 ; set_object_location ; consider_if_too_heavy_for_character &1b9f b9 12 29 LDA &2912,Y ; characters_load - &c8 (ROOM_CARRYING) &1ba2 18 CLC &1ba3 65 72 ADC &72 ; object_weight &1ba5 90 01 BCC &1ba8 ; skip_overflow &1ba7 60 RTS ; skip_oerflow &1ba8 85 22 STA &22 ; new_weight &1baa b9 a0 28 LDA &28a0,Y ; characters_description - &c8 (ROOM_CARRYING) &1bad 29 1f AND #&1f # ...18421 character description &1baf 84 23 STY &23 ; new_location &1bb1 a8 TAY &1bb2 a5 22 LDA &22 ; new_weight &1bb4 d9 e0 28 CMP &28e0,Y ; character_descriptions_maximum_load &1bb7 90 01 BCC &1bba ; not_too_heavy_for_character &1bb9 60 RTS # Leave with carry set to indicate too heavy ; not_too_heavy_for_character &1bba a4 23 LDY &23 ; new_location &1bbc 24 73 BIT &73 ; set_or_check # Negative if setting, positive if only checking &1bbe 30 01 BMI &1bc1 ; set_character_load_and_object_location &1bc0 60 RTS ; set_character_load_and_object_location &1bc1 99 12 29 STA &2912,Y ; characters_load - &c8 (ROOM_CARRYING) ; set_object_location &1bc4 98 TYA &1bc5 a6 70 LDX &70 ; object &1bc7 9d c0 25 STA &25c0,X ; objects_location &1bca a4 71 LDY &71 ; object_location &1bcc c0 c8 CPY #&c8 ; ROOM_CARRYING &1bce 90 18 BCC &1be8 ; leave_with_carry_clear &1bd0 c0 ff CPY #&ff &1bd2 f0 0b BEQ &1bdf ; was_in_holdall ; was_carried_by_character &1bd4 b9 12 29 LDA &2912,Y ; characters_load - &c8 (ROOM_CARRYING) &1bd7 38 SEC &1bd8 e5 72 SBC &72 ; object_weight &1bda 99 12 29 STA &2912,Y ; characters_load - &c8 (ROOM_CARRYING) &1bdd 18 CLC # Leave with carry clear to indicate not too heavy &1bde 60 RTS ; was_in_holdall &1bdf ad fa 27 LDA &27fa ; holdall_weight &1be2 38 SEC &1be3 e5 72 SBC &72 ; object_weight &1be5 8d fa 27 STA &27fa ; holdall_weight ; leave_with_carry_clear &1be8 18 CLC # Leave with carry clear to indicate not too heavy ; leave &1be9 60 RTS ; write_character_name &1bea bd a0 28 LDA &28a0,X ; characters_description - &c8 (ROOM_CARRYING) &1bed 29 1f AND #&1f # ...18421 character description &1bef aa TAX &1bf0 bd 20 28 LDA &2820,X ; character_descriptions_first_word &1bf3 20 f6 24 JSR &24f6 ; write_object_name_word &1bf6 bd 40 28 LDA &2840,X ; character_descriptions_second_word &1bf9 20 f6 24 JSR &24f6 ; write_object_name_word &1bfc bd 60 28 LDA &2860,X ; character_descriptions_third_word &1bff 4c f6 24 JMP &24f6 ; write_object_name_word ; damage_character # Called with A = damage, X = character &1c02 85 62 STA &62 ; damage &1c04 86 63 STX &63 ; character &1c06 dd c6 28 CMP &28c6,X ; characters_strength - &c8 (ROOM_CARRYING) &1c09 b0 26 BCS &1c31 ; is_dead &1c0b bd c6 28 LDA &28c6,X ; characters_strength - &c8 (ROOM_CARRYING) &1c0e 38 SEC &1c0f e5 62 SBC &62 ; damage &1c11 9d c6 28 STA &28c6,X ; characters_strength - &c8 (ROOM_CARRYING) &1c14 c9 50 CMP #&50 ; 80 &1c16 b0 d1 BCS &1be9 ; leave &1c18 85 62 STA &62 ; strength &1c1a 20 da 17 JSR &17da ; check_if_character_room_is_player_room &1c1d d0 ca BNE &1be9 ; leave ; is_in_player_room &1c1f 20 74 1c JSR &1c74 ; write_character_name_is &1c22 a5 62 LDA &62 ; strength &1c24 c9 28 CMP #&28 ; 40 &1c26 b0 05 BCS &1c2d ; is_weak &1c28 a9 b0 LDA #&b0 ; "dying" ; to_write_word_from_dictionary_two_and_end_sentence &1c2a 4c 1e 16 JMP &161e ; write_word_from_dictionary_two_and_end_sentence ; is_weak &1c2d a9 b1 LDA #&b1 ; "weak" &1c2f d0 f9 BNE &1c2a ; to_write_word_from_dictionary_two_and_end_sentence # Always branches ; is_dead &1c31 8a TXA &1c32 48 PHA ; character &1c33 20 da 17 JSR &17da ; check_if_character_room_is_player_room &1c36 d0 0b BNE &1c43 ; skip_writing_character_name_is_dead &1c38 20 74 1c JSR &1c74 ; write_character_name_is &1c3b a9 b2 LDA #&b2 ; "dead" &1c3d 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &1c40 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; skip_writing_character_name_is_dead &1c43 68 PLA ; character &1c44 aa TAX &1c45 a9 00 LDA #&00 &1c47 9d c6 28 STA &28c6,X ; characters_strength - &c8 (ROOM_CARRYING) # Set to zero to indicate character is dead &1c4a e0 c8 CPX #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &1c4c d0 06 BNE &1c54 ; not_player ; is_player &1c4e 20 ee 12 JSR &12ee ; handle_score &1c51 4c fa 19 JMP &19fa ; end_of_game ; not_player &1c54 a9 c7 LDA #&c7 ; ROOM_DESTROYED &1c56 9d ec 28 STA &28ec,X ; characters_location - &c8 (ROOM_CARRYING) &1c59 86 62 STX &62 ; room_carried_by_character &1c5b ae fc 27 LDX &27fc ; number_of_objects &1c5e ca DEX &1c5f 86 63 STX &63 ; object_to_consider ; drop_objects_carried_by_dead_character_loop &1c61 bd c0 25 LDA &25c0,X ; objects_location # Negative if carried, so set location &1c64 c5 62 CMP &62 ; room_carried_by_character &1c66 d0 05 BNE &1c6d ; consider_next_object &1c68 a4 1a LDY &1a ; character_room &1c6a 20 6c 1b JSR &1b6c ; set_object_location ; consider_next_object &1c6d c6 63 DEC &63 ; object_to_consider &1c6f a6 63 LDX &63 ; object_to_consider &1c71 10 ee BPL &1c61 ; drop_objects_carried_by_dead_character_loop &1c73 60 RTS ; write_character_name_is &1c74 86 63 STX &63 ; character &1c76 20 ea 1b JSR &1bea ; write_character_name &1c79 a6 63 LDX &63 ; character &1c7b e0 c8 CPX #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &1c7d d0 04 BNE &1c83 ; not_player ; is_player &1c7f a9 48 LDA #&48 ; "are" &1c81 d0 02 BNE &1c85 ; to_write_word_from_dictionary_two ; not_player &1c83 a9 3e LDA #&3e ; "is" ; to_write_word_from_dictionary_two &1c85 4c b8 14 JMP &14b8 ; write_word_from_dictionary_two ; rnd &1c88 a2 08 LDX #&08 ; shuffle_rnd_state_loop &1c8a a5 1d LDA &1d ; rnd_state &1c8c 29 48 AND #&48 &1c8e 69 38 ADC #&38 &1c90 0a ASL A &1c91 0a ASL A &1c92 26 1f ROL &1f ; rnd_state + 2 &1c94 26 1e ROL &1e ; rnd_state + 1 &1c96 26 1d ROL &1d ; rnd_state &1c98 ca DEX &1c99 d0 ef BNE &1c8a ; shuffle_rnd_state_loop &1c9b a5 1d LDA &1d ; rnd_state &1c9d 60 RTS ; damage_character_randomly # Called with X = character, A = random, Y = ceiling &1c9e 86 61 STX &61 ; character &1ca0 85 60 STA &60 ; mask &1ca2 20 88 1c JSR &1c88 ; rnd &1ca5 25 60 AND &60 ; mask &1ca7 85 60 STA &60 ; value &1ca9 38 SEC &1caa 98 TYA &1cab e5 60 SBC &60 ; value &1cad a6 61 LDX &61 ; character &1caf 4c 02 1c JMP &1c02 ; damage_character ; end_sentence_and_start_new_line_indented &1cb2 a9 2f LDA #&2f ; "." &1cb4 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &1cb7 a9 02 LDA #&02 &1cb9 85 6f STA &6f ; next_line_screen_x &1cbb 4c 51 3b JMP &3b51 ; write_newline ; flag_character_attacked &1cbe a6 67 LDX &67 ; weapon_description &1cc0 a4 6a LDY &6a ; weapon_target &1cc2 a9 80 LDA #&80 ; CHARACTER_FLAG_WAS_ATTACKED &1cc4 99 08 2a STA &2a08,Y ; characters_flags - &c8 (ROOM_CARRYING) # Set &80 to indicate character was attacked &1cc7 60 RTS ; leave_with_carry_clear &1cc8 18 CLC &1cc9 60 RTS ; hit_weapon_after_strength_check # Called with A = allow_actions, Y = enemy &1cca 20 20 1d JSR &1d20 ; check_if_character_can_wield_object # Returns carry set if too weak &1ccd b0 70 BCS &1d3f ; leave ; hit_weapon &1ccf 24 64 BIT &64 ; allow_attacks # Negative if allowed &1cd1 10 6c BPL &1d3f ; leave &1cd3 20 da 17 JSR &17da ; check_if_character_room_is_player_room &1cd6 d0 13 BNE &1ceb ; skip_writing_character_hit_with_weapon ; write_character_hit_with_weapon &1cd8 a6 66 LDX &66 ; target_character &1cda 20 74 1c JSR &1c74 ; write_character_name_is &1cdd 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1ce0 0e b3 00 ; "hit with" &1ce3 a6 65 LDX &65 ; weapon_object &1ce5 20 dd 24 JSR &24dd ; write_object_name &1ce8 20 b2 1c JSR &1cb2 ; end_sentence_and_start_new_line_indented ; skip_writing_character_hit_with_weapon &1ceb 20 be 1c JSR &1cbe ; flag_character_attacked # Returns X = weapon_description, Y = weapon_target &1cee bd fc 26 LDA &26fc,X ; object_descriptions_hit_damage_ceiling &1cf1 a8 TAY &1cf2 bd 26 27 LDA &2726,X ; object_descriptions_hit_damage_random &1cf5 a6 66 LDX &66 ; target_character &1cf7 20 9e 1c JSR &1c9e ; damage_character_randomly &1cfa 20 88 1c JSR &1c88 ; rnd &1cfd c9 d2 CMP #&d2 ; 210 # 46 in 256 chance of dropping weapon &1cff b0 0a BCS &1d0b ; drop_weapon &1d01 a5 67 LDA &67 ; weapon_description &1d03 c9 16 CMP #&16 ; "a long wooden staff" &1d05 d0 c1 BNE &1cc8 ; leave_with_carry_clear &1d07 c6 27 DEC &27 ; wooden_staff_drop_cooldown # Don't drop long wooden staff first two times &1d09 10 bd BPL &1cc8 ; leave_with_carry_clear ; drop_weapon &1d0b 20 da 17 JSR &17da ; check_if_character_room_is_player_room &1d0e d0 61 BNE &1d71 ; consider_breaking_weapon &1d10 a6 65 LDX &65 ; weapon_object &1d12 20 dd 24 JSR &24dd ; write_object_name &1d15 a9 b4 LDA #&b4 ; "drops" &1d17 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &1d1a 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &1d1d 4c 71 1d JMP &1d71 ; consider_breaking_weapon ; check_if_character_can_wield_object # Called with X = object, Y = enemy &1d20 85 64 STA &64 ; allow_attacks # A = allow_actions &1d22 bd c0 25 LDA &25c0,X ; objects_location &1d25 84 66 STY &66 ; target_character &1d27 c9 ff CMP #&ff ; ROOM_IN_HOLDALL &1d29 d0 03 BNE &1d2e ; not_in_holdall &1d2b ad c0 25 LDA &25c0 ; objects_location + 0 (OBJECT_HOLDALL) ; not_in_holdall &1d2e a8 TAY ; character # Character wielding object &1d2f bd 80 25 LDA &2580,X ; objects_description &1d32 86 65 STX &65 ; weapon_object &1d34 aa TAX &1d35 86 67 STX &67 ; weapon_description &1d37 bd 2a 26 LDA &262a,X ; object_descriptions_strength_required &1d3a d9 c6 28 CMP &28c6,Y ; characters_strength - &c8 (ROOM_CARRYING) # Leave with carry set if too weak &1d3d 84 6a STY &6a ; weapon_target ; leave &1d3f 60 RTS ; throw_weapon_after_strength_check # Called with A = allow_actions, Y = enemy &1d40 20 20 1d JSR &1d20 ; check_if_character_can_wield_object # Returns carry set if too weak &1d43 b0 fa BCS &1d3f ; leave # Leave with carry set to indicate not thrown ; throw_weapon &1d45 24 64 BIT &64 ; allow_attacks # Negative if allowed &1d47 10 f6 BPL &1d3f ; leave &1d49 20 da 17 JSR &17da ; check_if_character_room_is_player_room &1d4c d0 14 BNE &1d62 ; skip_writing_weapon_is_thrown_at_character ; write_weapon_is_thrown_at_character &1d4e a6 65 LDX &65 ; weapon_object &1d50 20 dd 24 JSR &24dd ; write_object_name &1d53 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1d56 3e b5 49 00 ; "is thrown at" &1d5a a6 66 LDX &66 ; target_character &1d5c 20 ea 1b JSR &1bea ; write_character_name &1d5f 20 b2 1c JSR &1cb2 ; end_sentence_and_start_new_line_indented ; skip_writing_weapon_is_thrown_at_character &1d62 20 be 1c JSR &1cbe ; flag_character_attacked # Returns X = weapon_description, Y = weapon_target &1d65 bd a8 26 LDA &26a8,X ; object_descriptions_throw_damage_ceiling &1d68 a8 TAY &1d69 bd d2 26 LDA &26d2,X ; object_descriptions_throw_damage_random &1d6c a6 66 LDX &66 ; target_character &1d6e 20 9e 1c JSR &1c9e ; damage_character_randomly ; consider_breaking_weapon &1d71 20 88 1c JSR &1c88 ; rnd &1d74 a6 67 LDX &67 ; weapon_description &1d76 3d 7e 26 AND &267e,X ; object_descriptions_breakage_probability &1d79 a4 1a LDY &1a ; character_room &1d7b dd 7e 26 CMP &267e,X ; object_descriptions_breakage_probability &1d7e f0 07 BEQ &1d87 ; break_weapon ; set_weapon_location &1d80 a5 64 LDA &64 ; allow_attacks # Always negative; negative to set object location &1d82 a6 65 LDX &65 ; weapon_object &1d84 4c 6c 1b JMP &1b6c ; set_object_location ; break_weapon &1d87 c4 89 CPY &89 ; player_room &1d89 d0 0d BNE &1d98 ; skip_writing_weapon_breaks &1d8b a6 65 LDX &65 ; weapon_object &1d8d 20 dd 24 JSR &24dd ; write_object_name &1d90 a9 b6 LDA #&b6 ; "breaks" &1d92 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &1d95 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; skip_writing_weapon_breaks &1d98 a0 c7 LDY #&c7 ; ROOM_DESTROYED &1d9a d0 e4 BNE &1d80 ; set_weapon_location # Always branches ; determine_input_character &1d9c 85 61 STA &61 ; location &1d9e a9 00 LDA #&00 &1da0 85 60 STA &60 ; best_matches &1da2 ae fe 27 LDX &27fe ; number_of_characters ; determine_input_character_loop &1da5 bd b3 29 LDA &29b3,X ; characters_location - 1 &1da8 c5 61 CMP &61 ; location &1daa d0 28 BNE &1dd4 ; consider_next_character &1dac a9 00 LDA #&00 &1dae 85 62 STA &62 ; words_matched &1db0 bd 67 29 LDA &2967,X ; characters_description - 1 &1db3 29 7f AND #&7f &1db5 a8 TAY &1db6 b9 20 28 LDA &2820,Y ; character_descriptions_first_word &1db9 20 2f 15 JSR &152f ; check_for_word_in_input &1dbc b9 40 28 LDA &2840,Y ; character_descriptions_second_word &1dbf 20 2f 15 JSR &152f ; check_for_word_in_input &1dc2 b9 60 28 LDA &2860,Y ; character_descriptions_third_word &1dc5 20 2f 15 JSR &152f ; check_for_word_in_input &1dc8 a5 60 LDA &60 ; best_matches &1dca c5 62 CMP &62 ; words_matched &1dcc b0 06 BCS &1dd4 ; consider_next_character &1dce a5 62 LDA &62 ; words_matched &1dd0 85 60 STA &60 ; best_matches &1dd2 86 63 STX &63 ; input_character ; consider_next_character &1dd4 ca DEX &1dd5 d0 ce BNE &1da5 ; determine_input_character_loop &1dd7 a5 60 LDA &60 ; best_matches # Leave with A = number of words matched &1dd9 60 RTS ; handle_hit_cut_or_throw &1dda ba TSX &1ddb 86 69 STX &69 ; stack_pointer_before_verb_handler &1ddd c9 10 CMP #&10 ; "throw" &1ddf f0 11 BEQ &1df2 ; handle_throw ; handle_hit_or_cut &1de1 a5 83 LDA &83 ; input_verb &1de3 48 PHA ; input_verb &1de4 a9 b3 LDA #&b3 ; "with" &1de6 85 83 STA &83 ; input_verb &1de8 68 PLA ; input_verb &1de9 20 fd 1d JSR &1dfd ; check_for_object_and_character &1dec 20 57 1e JSR &1e57 ; check_if_too_weak # Doesn't return if player too weak to use object &1def 4c cf 1c JMP &1ccf ; hit_weapon ; handle_throw &1df2 a9 49 LDA #&49 ; "at" &1df4 20 fd 1d JSR &1dfd ; check_for_object_and_character &1df7 20 57 1e JSR &1e57 ; check_if_too_weak # Doesn't return if player too weak to use object &1dfa 4c 45 1d JMP &1d45 ; throw_weapon ; check_for_object_and_character &1dfd 85 68 STA &68 ; preposition &1dff a5 89 LDA &89 ; player_room &1e01 20 9c 1d JSR &1d9c ; determine_input_character # Returns A = number of words matched &1e04 85 65 STA &65 ; character_words_matched &1e06 a5 63 LDA &63 ; input_character &1e08 85 66 STA &66 ; target_character &1e0a 20 d2 15 JSR &15d2 ; check_for_object_carried_by_player # Doesn't return if object not carried &1e0d a5 63 LDA &63 ; input_object &1e0f 85 67 STA &67 ; hit_cut_or_throw_object &1e11 a5 65 LDA &65 ; character_words_matched &1e13 d0 48 BNE &1e5d ; use_target_character_as_character &1e15 a5 89 LDA &89 ; player_room &1e17 20 9c 1d JSR &1d9c ; determine_input_character # Returns A = number of words matched &1e1a d0 17 BNE &1e33 ; use_input_character_as_character &1e1c a5 68 LDA &68 ; preposition &1e1e 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &1e21 a9 b7 LDA #&b7 ; "who" &1e23 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &1e26 20 9f 22 JSR &229f ; prompt_for_input &1e29 a5 89 LDA &89 ; player_room &1e2b 20 9c 1d JSR &1d9c ; determine_input_character # Returns A = number of words matched &1e2e d0 03 BNE &1e33 ; use_input_character_as_character &1e30 4c 63 15 JMP &1563 ; write_i_cant_see_any_here ; use_input_object_as_character &1e33 a5 63 LDA &63 ; input_character ; use_character &1e35 18 CLC &1e36 69 c7 ADC #&c7 ; ROOM_CARRYING - 1 &1e38 a8 TAY &1e39 a6 67 LDX &67 ; hit_cut_or_throw_object &1e3b ca DEX &1e3c a5 89 LDA &89 ; player_room &1e3e 85 1a STA &1a ; character_room &1e40 a9 ff LDA #&ff # Set to negative to set object location &1e42 60 RTS # Leave with X = object, Y = character ; handle_give &1e43 a9 43 LDA #&43 ; "to" &1e45 20 fd 1d JSR &1dfd ; check_for_object_and_character # Returns X = object, Y = character, A negative &1e48 84 63 STY &63 ; input_character &1e4a 20 6c 1b JSR &1b6c ; set_object_location # Returns carry clear if not too heavy &1e4d 90 05 BCC &1e54 ; to_write_ok &1e4f a6 63 LDX &63 ; input_character &1e51 4c 99 15 JMP &1599 ; write_character_name_cant_carry_any_more ; to_write_ok &1e54 4c 1c 16 JMP &161c ; write_ok ; check_if_too_weak &1e57 20 20 1d JSR &1d20 ; check_if_character_can_wield_object # Returns carry set if too weak &1e5a b0 06 BCS &1e62 ; write_you_are_too_weak &1e5c 60 RTS ; use_target_character_as_character &1e5d a5 66 LDA &66 ; target_character &1e5f 4c 35 1e JMP &1e35 ; use_character ; write_you_are_too_weak &1e62 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1e65 87 48 41 b1 00 ; "You are too weak" ; leave_verb_handler &1e6a 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &1e6d a6 69 LDX &69 ; stack_pointer_before_verb_handler &1e6f 9a TXS &1e70 60 RTS ; to_write_character_name_cant_carry_any_more &1e71 4c 97 15 JMP &1597 ; write_character_name_cant_carry_any_more ; handle_ask &1e74 a5 89 LDA &89 ; player_room &1e76 20 9c 1d JSR &1d9c ; determine_input_character # Returns A = number of words matched &1e79 d0 13 BNE &1e8e ; handle_ask_character &1e7b 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1e7e 20 b7 00 ; "Ask who" &1e81 20 9f 22 JSR &229f ; prompt_for_input &1e84 a5 89 LDA &89 ; player_room &1e86 20 9c 1d JSR &1d9c ; determine_input_character # Returns A = number of words matched &1e89 d0 03 BNE &1e8e ; handle_ask_character &1e8b 4c 63 15 JMP &1563 ; write_i_cant_see_any_here ; handle_ask_character &1e8e a9 b8 LDA #&b8 ; "for" &1e90 85 83 STA &83 ; input_verb &1e92 a5 63 LDA &63 ; input_character # Character + 1 &1e94 85 66 STA &66 ; target_character &1e96 20 d4 15 JSR &15d4 ; check_for_object_carried_by_character # Doesn't return if object not carried by character &1e99 a6 66 LDX &66 ; target_character &1e9b e0 11 CPX #&11 ; CHARACTER_WITCH_TWO + 1 &1e9d f0 0e BEQ &1ead ; write_your_request_is_refused &1e9f bd 67 29 LDA &2967,X ; characters_description - 1 # Top bit set if enemy faction, clear if player faction &1ea2 30 09 BMI &1ead ; write_your_request_is_refused &1ea4 a6 63 LDX &63 ; input_character &1ea6 ca DEX &1ea7 20 3d 13 JSR &133d ; give_player_object &1eaa b0 c5 BCS &1e71 ; to_write_character_name_cant_carry_any_more &1eac 60 RTS ; write_your_request_is_refused &1ead 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1eb0 3d b9 3e ba 00 ; "Your request is refused" &1eb5 4c 6a 1e JMP &1e6a ; leave_verb_handler ; handle_wait &1eb8 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1ebb 87 21 37 00 ; "You wait here" &1ebf 4c fa 20 JMP &20fa ; end_sentence_and_write_newline # Verbs # ===== # verb &11 ("DROP") : &160f ; handle_drop # verb &12 ("TAKE") : &1548 ; handle_take # verb &13 ("GET") : &1548 ; handle_take # verb &14 ("LOCK") : &17bc ; handle_lock # verb &15 ("SHUT") : &17bc ; handle_lock # verb &16 ("CLOSE") : &17bc ; handle_lock # verb &17 ("OPEN") : &17a3 ; handle_open # verb &18 ("UNLOCK") : &17a3 ; handle_open # verb &19 ("LIGHT") : &16a7 ; handle_on # verb &1a ("ON") : &16a7 ; handle_on # verb &1b ("OFF") : &16f9 ; handle_off # verb &1c ("GIVE") : &1e43 ; handle_give # verb &1d ("FILL") : &1aac ; handle_fill # verb &1e ("POUR") : &19a2 ; handle_empty # verb &1f ("EMPTY") : &19a2 ; handle_empty # verb &20 ("ASK") : &1e74 ; handle_ask # verb &21 ("WAIT") : &1eb8 ; handle_wait # verb &22 ("WAVE") : &1391 ; handle_wave # verb &23 ("SWIM") : &18b0 ; handle_swim # verb &24 ("DRINK") : &1950 ; handle_drink # verb &25 ("END") : &19ed ; handle_quit # verb &26 ("QUIT") : &19ed ; handle_quit # verb &27 ("LOOK") : &4200 ; handle_look # verb &28 ("VIEW") : &4200 ; handle_look # verb &29 ("PICTURE") : &1873 ; handle_picture # verb &2a ("DRAW") : &1873 ; handle_picture # verb &2b ("SCORE") : &12ee ; handle_score # verb &2c ("INVENTORY") : &162f ; handle_inventory # verb &2d ("OPTION") : &180d ; handle_option # verb &2e ("HELP") : &1356 ; handle_help ; verb_handler_addresses_low_table ; 1 2 3 4 5 6 7 8 9 a b c d e f 0 &1ec2 0f 48 48 bc bc bc a3 a3 a7 a7 f9 43 ac a2 a2 74 ; &10 &1ed2 b8 91 b0 50 ed ed 00 00 73 73 ee 2f 0d 56 ; &20 ; verb_handler_addresses_high_table ; 1 2 3 4 5 6 7 8 9 a b c d e f 0 &1ee0 16 15 15 17 17 17 17 17 16 16 16 1e 1a 19 19 1e ; &10 &1ef0 1e 13 18 19 19 19 42 42 18 18 12 16 18 13 ; &20 ; unused &1efe 25 29 ; "%)" ; room_pictures_table &1f00 2f ; ROOM_00 : PICTURE_2f &1f01 2e ; ROOM_01 : PICTURE_2e &1f02 5c ; ROOM_02 : PICTURE_5c &1f03 27 ; ROOM_03 : PICTURE_27 &1f04 57 ; ROOM_04 : PICTURE_57 &1f05 21 ; ROOM_05 : PICTURE_21 &1f06 5d ; ROOM_06 : PICTURE_5d &1f07 62 ; ROOM_07 : PICTURE_62 &1f08 57 ; ROOM_08 : PICTURE_57 &1f09 57 ; ROOM_09 : PICTURE_57 &1f0a 29 ; ROOM_0a : PICTURE_29 &1f0b 5d ; ROOM_0b : PICTURE_5d &1f0c 29 ; ROOM_0c : PICTURE_29 &1f0d a4 ; ROOM_0d : PICTURE_a4 &1f0e 29 ; ROOM_0e : PICTURE_29 &1f0f 28 ; ROOM_0f : PICTURE_28 &1f10 28 ; ROOM_10 : PICTURE_28 &1f11 58 ; ROOM_11 : PICTURE_58 &1f12 29 ; ROOM_12 : PICTURE_29 &1f13 a4 ; ROOM_13 : PICTURE_a4 &1f14 c0 ; ROOM_14 : PICTURE_c0 &1f15 93 ; ROOM_15 : PICTURE_93 &1f16 92 ; ROOM_16 : PICTURE_92 &1f17 29 ; ROOM_17 : PICTURE_29 &1f18 63 ; ROOM_18 : PICTURE_63 &1f19 3e ; ROOM_19 : PICTURE_3e ; unused &1f1a 4f ; "O" &1f1b 34 ; ROOM_1b : PICTURE_34 &1f1c 33 ; ROOM_1c : PICTURE_33 &1f1d 31 ; ROOM_1d : PICTURE_31 &1f1e 32 ; ROOM_1e : PICTURE_32 &1f1f 4f ; ROOM_1f : PICTURE_4f &1f20 92 ; ROOM_20 : PICTURE_92 &1f21 92 ; ROOM_21 : PICTURE_92 &1f22 92 ; ROOM_22 : PICTURE_92 &1f23 5a ; ROOM_23 : PICTURE_5a &1f24 15 ; ROOM_24 : PICTURE_15 &1f25 16 ; ROOM_25 : PICTURE_16 &1f26 17 ; ROOM_26 : PICTURE_17 &1f27 18 ; ROOM_27 : PICTURE_18 &1f28 0b ; ROOM_28 : PICTURE_0b &1f29 0e ; ROOM_29 : PICTURE_0e &1f2a 0d ; ROOM_2a : PICTURE_0d &1f2b 0d ; ROOM_2b : PICTURE_0d &1f2c 19 ; ROOM_2c : PICTURE_19 &1f2d 59 ; ROOM_2d : PICTURE_59 &1f2e 0d ; ROOM_2e : PICTURE_0d &1f2f 1a ; ROOM_2f : PICTURE_1a &1f30 c1 ; ROOM_30 : PICTURE_c1 &1f31 58 ; ROOM_31 : PICTURE_58 ; unused &1f32 35 35 ; "55" &1f34 7d ; ROOM_34 : PICTURE_7d &1f35 8a ; ROOM_35 : PICTURE_8a &1f36 86 ; ROOM_36 : PICTURE_86 ; unused &1f37 41 ; "A" &1f38 72 ; ROOM_38 : PICTURE_72 &1f39 71 ; ROOM_39 : PICTURE_71 &1f3a 7c ; ROOM_3a : PICTURE_7c &1f3b 70 ; ROOM_3b : PICTURE_70 &1f3c 74 ; ROOM_3c : PICTURE_74 &1f3d 83 ; ROOM_3d : PICTURE_83 &1f3e 80 ; ROOM_3e : PICTURE_80 &1f3f 82 ; ROOM_3f : PICTURE_82 &1f40 80 ; ROOM_40 : PICTURE_80 &1f41 80 ; ROOM_41 : PICTURE_80 &1f42 80 ; ROOM_42 : PICTURE_80 &1f43 80 ; ROOM_43 : PICTURE_80 &1f44 84 ; ROOM_44 : PICTURE_84 &1f45 a9 ; ROOM_45 : PICTURE_a9 &1f46 9e ; ROOM_46 : PICTURE_9e &1f47 a8 ; ROOM_47 : PICTURE_a8 &1f48 90 ; ROOM_48 : PICTURE_90 &1f49 9f ; ROOM_49 : PICTURE_9f &1f4a a3 ; ROOM_4a : PICTURE_a3 &1f4b a0 ; ROOM_4b : PICTURE_a0 &1f4c 89 ; ROOM_4c : PICTURE_89 &1f4d 9d ; ROOM_4d : PICTURE_9d &1f4e 65 ; ROOM_4e : PICTURE_65 &1f4f 65 ; ROOM_4f : PICTURE_65 &1f50 65 ; ROOM_50 : PICTURE_65 &1f51 65 ; ROOM_51 : PICTURE_65 &1f52 67 ; ROOM_52 : PICTURE_67 &1f53 67 ; ROOM_53 : PICTURE_67 &1f54 67 ; ROOM_54 : PICTURE_67 &1f55 67 ; ROOM_55 : PICTURE_67 &1f56 6e ; ROOM_56 : PICTURE_6e &1f57 6d ; ROOM_57 : PICTURE_6d &1f58 7e ; ROOM_58 : PICTURE_7e &1f59 4c ; ROOM_59 : PICTURE_4c &1f5a 49 ; ROOM_5a : PICTURE_49 &1f5b 7a ; ROOM_5b : PICTURE_7a &1f5c 7b ; ROOM_5c : PICTURE_7b &1f5d 4c ; ROOM_5d : PICTURE_4c &1f5e a5 ; ROOM_5e : PICTURE_a5 &1f5f a6 ; ROOM_5f : PICTURE_a6 &1f60 a7 ; ROOM_60 : PICTURE_a7 &1f61 a8 ; ROOM_61 : PICTURE_a8 &1f62 86 ; ROOM_62 : PICTURE_86 &1f63 86 ; ROOM_63 : PICTURE_86 &1f64 9c ; ROOM_64 : PICTURE_9c &1f65 89 ; ROOM_65 : PICTURE_89 &1f66 86 ; ROOM_66 : PICTURE_86 &1f67 a8 ; ROOM_67 : PICTURE_a8 &1f68 8a ; ROOM_68 : PICTURE_8a &1f69 45 ; ROOM_69 : PICTURE_45 &1f6a 67 ; ROOM_6a : PICTURE_67 &1f6b 88 ; ROOM_6b : PICTURE_88 &1f6c 89 ; ROOM_6c : PICTURE_89 &1f6d 97 ; ROOM_6d : PICTURE_97 &1f6e 86 ; ROOM_6e : PICTURE_86 &1f6f be ; ROOM_6f : PICTURE_be ; unused # Source code fragment &1f70 3a 5b 3a 4c 44 41 20 57 54 41 42 4c 45 25 2c 59 ; ... :[:LDA WTABLE%,Y ... &1f80 59 ; ROOM_80 : PICTURE_59 &1f81 59 ; ROOM_81 : PICTURE_59 &1f82 59 ; ROOM_82 : PICTURE_59 &1f83 94 ; ROOM_83 : PICTURE_94 &1f84 94 ; ROOM_84 : PICTURE_94 &1f85 94 ; ROOM_85 : PICTURE_94 &1f86 94 ; ROOM_86 : PICTURE_94 &1f87 32 ; ROOM_87 : PICTURE_32 &1f88 96 ; ROOM_88 : PICTURE_96 &1f89 95 ; ROOM_89 : PICTURE_95 &1f8a c0 ; ROOM_8a : PICTURE_c0 &1f8b 89 ; ROOM_8b : PICTURE_89 ; unused # Source code fragment &1f8c 41 57 ; ... AW ... &1f8e 89 ; ROOM_8e : PICTURE_89 ; unused # Source code fragment &1f8f 41 42 4c 45 25 2b 57 44 ; ... ABLE%+WD ... &1f97 59 ; ROOM_97 : PICTURE_59 &1f98 b0 ; ROOM_98 : PICTURE_b0 &1f99 ad ; ROOM_99 : PICTURE_ad &1f9a 29 ; ROOM_9a : PICTURE_29 &1f9b ae ; ROOM_9b : PICTURE_ae &1f9c b1 ; ROOM_9c : PICTURE_b1 &1f9d 53 ; ROOM_9d : PICTURE_53 &1f9e b1 ; ROOM_9e : PICTURE_b1 &1f9f b1 ; ROOM_9f : PICTURE_b1 &1fa0 c1 ; ROOM_a0 : PICTURE_c1 &1fa1 58 ; ROOM_a1 : PICTURE_58 &1fa2 c0 ; ROOM_a2 : PICTURE_c0 &1fa3 c1 ; ROOM_a3 : PICTURE_c1 &1fa4 29 ; ROOM_a4 : PICTURE_29 &1fa5 58 ; ROOM_a5 : PICTURE_58 &1fa6 c0 ; ROOM_a6 : PICTURE_c0 &1fa7 c1 ; ROOM_a7 : PICTURE_c1 &1fa8 9f ; ROOM_a8 : PICTURE_9f ; unused &1fa9 8b &1faa a8 ; ROOM_aa : PICTURE_a8 &1fab 58 ; ROOM_ab : PICTURE_58 &1fac c0 ; ROOM_ac : PICTURE_c0 &1fad c1 ; ROOM_ad : PICTURE_c1 &1fae ba ; ROOM_ae : PICTURE_ba ; unused &1faf 41 ; ... A .... &1fb0 8c ; ROOM_b0 : PICTURE_8c ; unused # Source code fragment &1fb1 30 3a 53 54 41 57 41 44 52 25 2b 31 3a 54 59 ; ... 0:STAWADR%+1:TY ... ; initialise_mode_7_screen &1fc0 a0 d6 LDY #&d6 ; write_press_tab_key_to_see_a_picture_loop &1fc2 b9 76 24 LDA &2476,Y ; press_tab_key_to_see_a_picture_string - &d6 &1fc5 20 ee ff JSR &ffee ; OSWRCH &1fc8 c8 INY &1fc9 d0 f7 BNE &1fc2 ; write_press_tab_key_to_see_a_picture_loop &1fcb a9 98 LDA #&98 ; TELETEXT_CONCEAL &1fcd 8d 01 7c STA &7c01 ; screen_memory + 1 &1fd0 60 RTS ; write_material_name &1fd1 29 07 AND #&07 &1fd3 aa TAX &1fd4 f0 fa BEQ &1fd0 ; leave &1fd6 bd 5f 29 LDA &295f,X ; material_names_table - 1 ; write_word_from_dictionary_one &1fd9 c9 ff CMP #&ff # Word &ff sets uppercase for next character &1fdb f0 58 BEQ &2035 ; set_uppercase &1fdd a8 TAY &1fde c8 INY &1fdf 20 c4 3b JSR &3bc4 ; calculate_dictionary_one_word_address # Get address of next word &1fe2 a5 70 LDA &70 ; word_address_low &1fe4 48 PHA ; next_word_address_low &1fe5 88 DEY &1fe6 20 c4 3b JSR &3bc4 ; calculate_dictionary_one_word_address # Get address of this word &1fe9 68 PLA ; next_word_address_low ; write_word_from_dictionary_two_from_address &1fea 38 SEC &1feb e5 70 SBC &70 ; word_address_low # Calculate length of this word &1fed 18 CLC &1fee 65 82 ADC &82 ; screen_x &1ff0 c9 27 CMP #&27 &1ff2 90 03 BCC &1ff7 ; not_new_line # Will the word fit on the current line? &1ff4 20 51 3b JSR &3b51 ; write_newline # If not, start new line ; not_new_line &1ff7 a0 00 LDY #&00 &1ff9 a5 82 LDA &82 ; screen_x &1ffb f0 10 BEQ &200d ; skip_space # If not start of line, &1ffd b1 70 LDA (&70),Y ; word_address &1fff 29 7f AND #&7f &2001 20 8d 23 JSR &238d ; check_if_letter # Returns carry set if character is letter &2004 90 07 BCC &200d ; skip_space # and word starts with a letter, &2006 e6 82 INC &82 ; screen_x &2008 a9 20 LDA #&20 ; " " &200a 20 a1 3b JSR &3ba1 ; write_character_of_output # write space before word ; skip_space ; write_word_from_dictionary_loop &200d b1 70 LDA (&70),Y ; word_address &200f c8 INY &2010 e6 82 INC &82 ; screen_x &2012 09 00 ORA #&00 # Test top bit of character &2014 30 05 BMI &201b ; is_end_of_word # Top bit set if last character in word &2016 20 23 20 JSR &2023 ; write_character_from_dictionary # Returns A = last_character_written &2019 10 f2 BPL &200d ; write_word_from_dictionary_loop # Always branches ; is_end_of_word &201b c9 ae CMP #&ae ; "." | &80 &201d d0 02 BNE &2021 ; not_end_of_sentence &201f 85 26 STA &26 ; uppercase # Set top bit to use uppercase for next letter ; not_end_of_sentence &2021 29 7f AND #&7f ; write_character_from_dictionary &2023 20 8d 23 JSR &238d ; check_if_letter # Returns carry set if character is letter &2026 90 0a BCC &2032 ; not_letter &2028 09 20 ORA #&20 # Convert to lowercase &202a 24 26 BIT &26 ; uppercase # Top bit set to use uppercase &202c 10 04 BPL &2032 ; not_uppercase &202e 29 5f AND #&5f # Convert to uppercase &2030 85 26 STA &26 ; uppercase # Clear top bit to use lowercase for next letter ; not_uppercase ; not_letter &2032 4c a1 3b JMP &3ba1 ; write_character_of_output ; set_uppercase &2035 85 26 STA &26 ; uppercase &2037 60 RTS ; write_exit_room_description # Called with A = room &2038 48 PHA ; room &2039 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &203c 84 9e 34 00 ; "You can see" &2040 68 PLA ; room &2041 aa TAX &2042 bd 00 2a LDA &2a00,X ; room_data_addresses_low_table &2045 85 74 STA &74 ; exit_room_data_address_low &2047 bd 00 2b LDA &2b00,X ; room_data_addresses_table_high &204a 85 75 STA &75 ; exit_room_data_address_high &204c a0 00 LDY #&00 &204e b1 74 LDA (&74),Y ; exit_room_data # First byte of room data is flags &2050 29 07 AND #&07 ; ROOM_FLAG_TYPE_MASK # .....421 description type &2052 f0 39 BEQ &208d ; is_regular_room &2054 c9 01 CMP #&01 &2056 d0 08 BNE &2060 ; not_type_one ; is_type_one &2058 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &205b 3a 9f a0 00 ; "a disused quarry" &205f 60 RTS ; not_type_one &2060 c9 03 CMP #&03 &2062 b0 08 BCS &206c ; not_type_two ; is_type_two &2064 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &2067 5d a1 56 00 ; "the canyon floor" &206b 60 RTS ; not_type_two &206c d0 08 BNE &2076 ; not_type_three ; is_type_three &206e 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &2071 3a 91 a2 00 ; "a mountain range" &2075 60 RTS ; not_type_three &2076 c9 06 CMP #&06 &2078 b0 05 BCS &207f ; not_type_four_or_five ; is_type_four_or_five &207a a9 4e LDA #&4e ; "forest" &207c 4c d9 1f JMP &1fd9 ; write_word_from_dictionary_one ; not_type_four_or_five &207f d0 07 BNE &2088 ; is_type_seven ; is_type_six &2081 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &2084 3a a3 00 ; "a passage" &2087 60 RTS ; is_type_seven &2088 a9 52 LDA #&52 ; "desert" &208a 4c d9 1f JMP &1fd9 ; write_word_from_dictionary_one ; is_regular_room &208d c8 INY ; 1 &208e b1 74 LDA (&74),Y ; exit_room_data # Second byte of room data is description length and exit count &2090 29 1f AND #&1f # ...18421 description length &2092 85 76 STA &76 ; words_to_write &2094 c6 76 DEC &76 ; words_to_write &2096 a0 03 LDY #&03 # Skip room data bytes and leading preposition ; write_exit_room_description_loop &2098 98 TYA &2099 48 PHA ; offset &209a b1 74 LDA (&74),Y ; exit_room_data &209c 20 d9 1f JSR &1fd9 ; write_word_from_dictionary_one &209f 68 PLA ; offset &20a0 a8 TAY &20a1 c8 INY &20a2 c6 76 DEC &76 ; words_to_write &20a4 d0 f2 BNE &2098 ; write_exit_room_description_loop &20a6 60 RTS ; get_room_data_address_and_bytes &20a7 b9 00 2a LDA &2a00,Y ; room_data_addresses_low_table &20aa 85 77 STA &77 ; room_data_address_low &20ac b9 00 2b LDA &2b00,Y ; room_data_addresses_table_high &20af 85 78 STA &78 ; room_data_address_high &20b1 a0 01 LDY #&01 &20b3 b1 77 LDA (&77),Y ; room_data # Second byte of room data is description length and exit count &20b5 85 7a STA &7a ; room_description_length_and_exit_count &20b7 88 DEY ; 0 &20b8 b1 77 LDA (&77),Y ; room_data # First byte of room data is flags &20ba 85 79 STA &79 ; room_flags # Leave with A = room flags &20bc 60 RTS ; check_if_room_is_lit &20bd a4 89 LDY &89 ; player_room &20bf 20 a7 20 JSR &20a7 ; get_room_data_address_and_bytes # Returns A = room flags &20c2 85 8a STA &8a ; room_picture_availability # &80 set if dark, &40 set if magically dark (no picture) &20c4 09 10 ORA #&10 ; ROOM_FLAG_VISITED # Set &10 to indicate room has been visited &20c6 91 77 STA (&77),Y ; room_data_address &20c8 10 1f BPL &20e9 ; leave # Leave with negative to indicate room is lit &20ca ad 81 25 LDA &2581 ; objects_description + 1 (OBJECT_LAMP) # &01 if "an unlit oil lamp", &00 if "a lit lamp" &20cd d0 16 BNE &20e5 ; suppress_picture # Room is not lit if lamp is unlit &20cf ad c1 25 LDA &25c1 ; objects_location + 1 (OBJECT_LAMP) &20d2 c5 89 CMP &89 ; player_room &20d4 f0 13 BEQ &20e9 ; leave # Room is lit if lamp is in room &20d6 c9 c8 CMP #&c8 ; ROOM_CARRYING &20d8 90 0b BCC &20e5 ; suppress_picture &20da a8 TAY &20db c8 INY # &ff (ROOM_IN_HOLDALL) -> &00 &20dc f0 07 BEQ &20e5 ; suppress_picture # Room is unlit if lit lamp is in holdall (but see &11ef) &20de b9 eb 28 LDA &28eb,Y ; characters_location - &c8 (ROOM_CARRYING) - 1 &20e1 c5 89 CMP &89 ; player_room &20e3 f0 04 BEQ &20e9 ; leave # Room is lit if lamp carried by character in room ; suppress_picture &20e5 a9 ff LDA #&ff &20e7 85 8a STA &8a ; room_picture_availability # Set &80 and &40 to indicate picture not available ; leave &20e9 60 RTS # Leave with positive if room lit, negative if dark ; write_room_description &20ea 20 51 3b JSR &3b51 ; write_newline &20ed 20 bd 20 JSR &20bd ; check_if_room_is_lit # Returns positive if room is lit &20f0 10 10 BPL &2102 ; is_lit ; not_lit &20f2 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &20f5 38 3e 42 37 00 ; "It is dark here" ; end_sentence_and_write_newline &20fa a9 2f LDA #&2f ; "." &20fc 20 d9 1f JSR &1fd9 ; write_word_from_dictionary_one &20ff 4c 51 3b JMP &3b51 ; write_newline ; is_lit &2102 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &2105 84 48 00 ; "You are" &2108 a5 7a LDA &7a ; room_description_length_and_exit_count &210a 29 1f AND #&1f # ...18421 description length &210c f0 14 BEQ &2122 ; is_special_room # Zero if special room description ; is_regular_room &210e 85 76 STA &76 ; words_to_write &2110 a0 02 LDY #&02 ; write_room_description_loop &2112 98 TYA &2113 48 PHA ; offset &2114 b1 77 LDA (&77),Y ; room_data_address &2116 20 d9 1f JSR &1fd9 ; write_word_from_dictionary_one # Write regular room description &2119 68 PLA ; offset &211a a8 TAY &211b c8 INY &211c c6 76 DEC &76 ; words_to_write &211e d0 f2 BNE &2112 ; write_room_description_loop &2120 f0 10 BEQ &2132 ; to_write_room_exits ; is_special_room &2122 a5 79 LDA &79 ; room_flags # .....421 description type &2124 29 07 AND #&07 ; ROOM_FLAG_TYPE_MASK &2126 c9 06 CMP #&06 &2128 d0 0b BNE &2135 ; not_type_six ; is_type_six &212a 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &212d 44 3a a4 a5 00 ; "in a sloping maze" ; to_write_room_exits &2132 4c dc 21 JMP &21dc ; write_room_exits ; not_type_six &2135 c9 02 CMP #&02 &2137 d0 0a BNE &2143 ; not_type_two ; is_type_two &2139 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &213c 1a 5d a1 56 00 ; "on the canyon floor" &2141 d0 ef BNE &2132 ; to_write_room_exits # Always branches ; not_type_two &2143 c9 07 CMP #&07 &2145 d0 0a BNE &2151 ; not_type_seven ; is_type_seven &2147 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &214a 44 3b a6 52 00 ; "in an arid desert" &214f d0 e1 BNE &2132 ; to_write_room_exits # Always branches ; not_type_seven &2151 c9 03 CMP #&03 &2153 d0 3e BNE &2193 ; not_type_three ; is_type_three &2155 a2 a7 LDX #&a7 ; "high" &2157 a0 54 LDY #&54 ; "mountains" ; write_wandering_through &2159 8e 64 21 STX &2164 ; wandering_through_string + 2 &215c 8c 65 21 STY &2165 ; wandering_through_string + 3 &215f 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one ; wandering_through_string &2162 a8 a9 3a 3a 39 aa ab 00 ; "wandering through a a, paths lead" # Third and fourth words are modified &216a a9 02 LDA #&02 &216c 85 7b STA &7b ; room_data_offset &216e a5 7a LDA &7a ; room_description_length_and_exit_count # 842..... exit count &2170 4a LSR A # 84218421 -> .8421842 &2171 4a LSR A # -> ..842184 &2172 4a LSR A # -> ...84218 &2173 4a LSR A # -> ....8421 &2174 4a LSR A # -> .....842 &2175 85 7a STA &7a ; room_exit_count &2177 f0 2a BEQ &21a3 ; write_room_objects # Zero if room has no exits ; write_abridged_exits_loop &2179 a4 7b LDY &7b ; room_data_offset &217b b1 77 LDA (&77),Y ; room_data_address # Top bit set if extended exit &217d 10 01 BPL &2180 ; not_extended_exit &217f c8 INY ; not_extended_exit &2180 c8 INY # Move to next exit &2181 c8 INY &2182 84 7b STY &7b ; room_data_offset &2184 20 2d 24 JSR &242d ; write_direction # Write exit direction &2187 c6 7a DEC &7a ; room_description_length_and_exit_count &2189 f0 18 BEQ &21a3 ; write_room_objects &218b a9 39 LDA #&39 ; "." &218d 20 d9 1f JSR &1fd9 ; write_word_from_dictionary_one &2190 4c 79 21 JMP &2179 ; write_abridged_exits_loop ; not_type_three &2193 c9 04 CMP #&04 &2195 d0 06 BNE &219d ; is_type_five ; is_type_four &2197 a2 5d LDX #&5d ; "the" &2199 a0 ac LDY #&ac ; "woods" &219b d0 bc BNE &2159 ; write_wandering_through # Always branches ; is_type_five # Also type one, but not used &219d a2 ad LDX #&ad ; "dense" &219f a0 4e LDY #&4e ; "forest" &21a1 d0 b6 BNE &2159 ; write_wandering_through # Always branches ; write_room_objects &21a3 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; write_room_objects_without_newline &21a6 ae fc 27 LDX &27fc ; number_of_objects &21a9 ca DEX &21aa 86 7c STX &7c ; object_to_consider ; write_room_objects_loop &21ac bd c0 25 LDA &25c0,X ; objects_location &21af c5 89 CMP &89 ; player_room &21b1 d0 11 BNE &21c4 ; consider_next_object &21b3 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &21b6 45 3e 00 ; "There is " &21b9 20 dd 24 JSR &24dd ; write_object_name &21bc a9 37 LDA #&37 ; "here" &21be 20 d9 1f JSR &1fd9 ; write_word_from_dictionary_one &21c1 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; consider_next_object &21c4 c6 7c DEC &7c ; object_to_consider &21c6 a6 7c LDX &7c ; object_to_consider &21c8 10 e2 BPL &21ac ; write_room_objects_loop &21ca 4c 51 3b JMP &3b51 ; write_newline ; get_exit_data &21cd a4 7b LDY &7b ; room_data_offset &21cf b1 77 LDA (&77),Y ; room_data_address # First byte of exit data specifies direction &21d1 c8 INY &21d2 85 7c STA &7c ; exit_direction &21d4 b1 77 LDA (&77),Y ; room_data_address # Second byte of exit data specifies destination &21d6 c8 INY &21d7 85 7d STA &7d ; exit_room &21d9 84 7b STY &7b ; room_data_offset &21db 60 RTS ; write_room_exits &21dc 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &21df a5 79 LDA &79 ; room_flags # ..2..... if set, suppress writing room exits &21e1 29 20 AND #&20 ; ROOM_FLAG_SUPPRESS_EXITS &21e3 d0 c1 BNE &21a6 ; write_room_objects_without_newline &21e5 24 01 BIT &01 ; display_options # &40 (OPTION_LONG) set to give long description &21e7 50 bd BVC &21a6 ; write_room_objects_without_newline &21e9 20 04 25 JSR &2504 ; get_room_exit_count # Returns A = room exit count &21ec f0 b8 BEQ &21a6 ; write_room_objects_without_newline ; write_room_exits_loop &21ee 20 cd 21 JSR &21cd ; get_exit_data &21f1 a5 7c LDA &7c ; exit_direction &21f3 20 2d 24 JSR &242d ; write_direction # ..218421 direction &21f6 a5 7c LDA &7c ; exit_direction # 8....... set if exit has extended description &21f8 10 53 BPL &224d ; is_regular_exit ; is_extended_exit &21fa a9 3e LDA #&3e ; "is" &21fc 20 d9 1f JSR &1fd9 ; write_word_from_dictionary_one &21ff a9 00 LDA #&00 &2201 85 7e STA &7e ; unused # Unused variable &2203 a4 7b LDY &7b ; room_data_offset &2205 e6 7b INC &7b ; room_data_offset &2207 b1 77 LDA (&77),Y ; room_data_address # Get third byte of exit data &2209 85 7f STA &7f ; exit_state_or_material # 8....... set if exit is lockable &220b 10 48 BPL &2255 ; not_lockable_exit ; is_lockable_exit &220d 24 7c BIT &7c ; exit_direction # .4...... set if exit is open, unset if locked &220f 70 09 BVS &221a ; is_open ; is_locked &2211 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &2214 3a 3f 00 ; "a locked" &2217 4c 20 22 JMP &2220 ; write_lockable_exit_description ; is_open &221a 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &221d 3b 17 00 ; "an open" ; write_lockable_exit_description &2220 a5 7f LDA &7f ; exit_state_or_material &2222 20 d1 1f JSR &1fd1 ; write_material_name &2225 a5 7f LDA &7f ; exit_state_or_material # .4218... exit type &2227 4a LSR A # 84218421 -> .8421842 &2228 4a LSR A # -> ..842184 &2229 4a LSR A # -> ...84218 &222a 29 0f AND #&0f # -> ....4218 &222c 09 10 ORA #&10 &222e 20 75 22 JSR &2275 ; write_extended_exit_description # Returns X = exit description &2231 e0 18 CPX #&18 # Branch if door or secret door &2233 b0 0e BCS &2243 ; consider_writing_through_which_and_exit_room_description &2235 e0 14 CPX #&14 # Branch if grate &2237 b0 0e BCS &2247 ; write_through_which_and_exit_room_description # Always branches ; consider_next_exit &2239 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &223c c6 7a DEC &7a ; room_description_length_and_exit_count &223e d0 ae BNE &21ee ; write_room_exits_loop &2240 4c a6 21 JMP &21a6 ; write_room_objects_without_newline ; consider_writing_through_which_and_exit_room_description &2243 24 7c BIT &7c ; exit_direction # .4...... set if exit is open, unset if locked &2245 50 f2 BVC &2239 ; consider_next_exit ; write_through_which_and_exit_room_description &2247 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &224a a9 ae 00 ; "through which" ; is_regular_exit &224d a5 7d LDA &7d ; exit_room &224f 20 38 20 JSR &2038 ; write_exit_room_description # Write "you can see" and exit room description &2252 4c 39 22 JMP &2239 ; consider_next_exit ; not_lockable_exit &2255 a9 3a LDA #&3a ; "a" &2257 20 d9 1f JSR &1fd9 ; write_word_from_dictionary_one &225a a5 7f LDA &7f ; exit_state_or_material &225c 20 d1 1f JSR &1fd1 ; write_material_name &225f a5 7f LDA &7f ; exit_state_or_material # .4218... exit type &2261 4a LSR A # 84218421 -> .8421842 &2262 4a LSR A # -> ..842184 &2263 4a LSR A # -> ...84218 &2264 29 0f AND #&0f # -> ....4218 &2266 24 7c BIT &7c ; exit_direction # .4...... set if exit is open, unset if closed &2268 50 02 BVC &226c ; not_open # Branch if rock fall, fence or narrow crack &226a 09 20 ORA #&20 ; not_open &226c 20 75 22 JSR &2275 ; write_extended_exit_description &226f 24 7f BIT &7f ; exit_state_or_material # .4...... set to write exit room description &2271 70 d4 BVS &2247 ; write_through_which_and_exit_room_description &2273 50 c4 BVC &2239 ; consider_next_exit # Always branches ; write_extended_exit_description # Called with A = exit description &2275 aa TAX ; exit description &2276 bd 00 29 LDA &2900,X ; exit_descriptions_first_word &2279 20 f6 24 JSR &24f6 ; write_object_name_word &227c bd 30 29 LDA &2930,X ; exit_descriptions_second_word &227f 4c f6 24 JMP &24f6 ; write_object_name_word # Leave with X = exit description ; wait_for_character_or_timeout &2282 20 c0 2a JSR &2ac0 ; read_clock # Returns A = least significant byte of clock &2285 85 8b STA &8b ; next_clock &2287 c6 8b DEC &8b ; next_clock ; wait_for_character_or_timeout_loop &2289 20 c0 2a JSR &2ac0 ; read_clock # Returns A = least significant byte of clock &228c c5 8b CMP &8b ; next_clock &228e f0 0d BEQ &229d ; leave_with_negative &2290 a9 80 LDA #&80 ; Read buffer status &2292 a0 ff LDY #&ff &2294 a2 ff LDX #&ff ; Keyboard buffer &2296 20 f4 ff JSR &fff4 ; OSBYTE # Returns X = number of characters in buffer &2299 ca DEX &229a 30 ed BMI &2289 ; wait_for_character_or_timeout_loop &229c 60 RTS # Leave with positive if character in buffer ; leave_with_negative &229d ba TSX # Leave with negative if timed out &229e 60 RTS ; prompt_for_input &229f a9 00 LDA #&00 &22a1 85 25 STA &25 ; last_character_written # Set to zero to indicate nothing written &22a3 85 28 STA &28 ; score_high &22a5 85 82 STA &82 ; screen_x &22a7 a9 7e LDA #&7e ; Acknowledge ESCAPE condition &22a9 20 f4 ff JSR &fff4 ; OSBYTE &22ac a9 7c LDA #&7c ; Clear ESCAPE condition &22ae 20 f4 ff JSR &fff4 ; OSBYTE &22b1 a9 83 LDA #&83 ; TELETEXT_YELLOW &22b3 20 ee ff JSR &ffee ; OSWRCH &22b6 a9 3f LDA #&3f ; "?" &22b8 20 ee ff JSR &ffee ; OSWRCH &22bb 24 8a BIT &8a ; room_picture_availability # &40 set if room has no picture or already drawn &22bd 70 22 BVS &22e1 ; skip_checking_for_tab &22bf a9 00 LDA #&00 &22c1 8d 01 7c STA &7c01 ; screen_memory + 1 # Display "Press "TAB" key to see a picture" ; wait_for_character &22c4 20 82 22 JSR &2282 ; wait_for_character_or_timeout # Returns negative if timed out &22c7 30 fb BMI &22c4 ; wait_for_character &22c9 a0 ff LDY #&ff &22cb a2 9f LDX #&9f ; TAB &22cd a9 81 LDA #&81 ; Scan for a particular key &22cf 20 f4 ff JSR &fff4 ; OSBYTE &22d2 c8 INY &22d3 d0 0c BNE &22e1 ; skip_checking_for_tab &22d5 88 DEY ; &ff &22d6 84 8a STY &8a ; room_picture_availability # Set &80 and &40 to indicate picture now drawn &22d8 20 e0 ff JSR &ffe0 ; OSRDCH &22db 20 17 25 JSR &2517 ; draw_room_picture &22de 4c 9f 22 JMP &229f ; prompt_for_input ; skip_checking_for_tab &22e1 a9 98 LDA #&98 ; TELETEXT_CONCEAL &22e3 8d 01 7c STA &7c01 ; screen_memory + 1 # Hide "Press "TAB" key to see a picture" &22e6 a9 0a LDA #&0a ; &0ac0 = input_block &22e8 a8 TAY &22e9 8d c1 0a STA &0ac1 ; input_block + 1 (buffer address high) # Use &0a00 for input_buffer &22ec a9 80 LDA #&80 &22ee 85 26 STA &26 ; uppercase &22f0 8d c2 0a STA &0ac2 ; input_block + 2 (maximum line length) &22f3 8d c4 0a STA &0ac4 ; input_block + 4 (maximum ASCII value) &22f6 85 83 STA &83 ; input_verb # Set to negative to indicate no verb &22f8 a9 00 LDA #&00 ; Input line &22fa 85 88 STA &88 ; end_of_input # Set to positive to indicate not end of input &22fc 85 84 STA &84 ; number_of_words_in_input &22fe 8d c3 0a STA &0ac3 ; input_block + 3 (minimum ASCII value) &2301 8d c0 0a STA &0ac0 ; input_block + 0 (buffer address low) &2304 a2 c0 LDX #&c0 &2306 20 f1 ff JSR &fff1 ; OSWORD # Returns carry set if ESCAPE pressed &2309 b0 94 BCS &229f ; prompt_for_input &230b a2 00 LDX #&00 ; split_input_into_words_loop &230d 20 a0 23 JSR &23a0 ; get_byte_of_input # Doesn't return if end of input &2310 c9 2a CMP #&2a ; "*" &2312 d0 03 BNE &2317 ; not_star_command &2314 4c ca 0b JMP &0bca ; handle_star_command ; not_star_command &2317 20 8d 23 JSR &238d ; check_if_letter # Returns carry set if character is letter &231a 90 f1 BCC &230d ; split_input_into_words_loop &231c a0 00 LDY #&00 ; convert_input_word_to_uppercase_loop &231e 29 df AND #&df # Convert to uppercase &2320 99 c0 0a STA &0ac0,Y ; input_word &2323 c0 3e CPY #&3e &2325 f0 01 BEQ &2328 ; skip_adding_character &2327 c8 INY ; skip_adding_character &2328 20 a0 23 JSR &23a0 ; get_byte_of_input &232b 20 8d 23 JSR &238d ; check_if_letter # Returns carry set if character is letter &232e b0 ee BCS &231e ; convert_input_word_to_uppercase_loop &2330 98 TYA &2331 48 PHA ; input offset &2332 a9 0d LDA #&0d ; CR &2334 99 c0 0a STA &0ac0,Y ; input_word &2337 a9 ff LDA #&ff &2339 85 85 STA &85 ; dictionary_word_number ; look_for_matches_in_dictionary_word_loop &233b e6 85 INC &85 ; dictionary_word_number &233d a4 85 LDY &85 ; dictionary_word_number &233f 20 c4 3b JSR &3bc4 ; calculate_dictionary_one_word_address &2342 a0 00 LDY #&00 ; look_for_matches_in_dictionary_byte_loop &2344 b1 70 LDA (&70),Y ; word_address # Top bit set if last character of word in dictionary &2346 30 0c BMI &2354 ; is_end_of_word_in_dictionary &2348 c9 2a CMP #&2a ; "*" &234a f0 3c BEQ &2388 ; consider_next_word_of_input # Branch if end of dictionary reached without match &234c d9 c0 0a CMP &0ac0,Y ; input_word &234f d0 14 BNE &2365 ; check_for_end_of_input_word &2351 c8 INY &2352 d0 f0 BNE &2344 ; look_for_matches_in_dictionary_byte_loop # Always branches ; is_end_of_word_in_dictionary &2354 29 7f AND #&7f &2356 d9 c0 0a CMP &0ac0,Y ; input_word &2359 d0 0a BNE &2365 ; check_for_end_of_input_word &235b c8 INY &235c b9 c0 0a LDA &0ac0,Y ; input_word &235f c9 0d CMP #&0d ; CR &2361 d0 d8 BNE &233b ; look_for_matches_in_dictionary_word_loop &2363 f0 07 BEQ &236c ; found_match_in_dictionary # Always branches ; check_for_end_of_input_word &2365 b9 c0 0a LDA &0ac0,Y ; input_word &2368 c9 0d CMP #&0d ; CR &236a d0 cf BNE &233b ; look_for_matches_in_dictionary_word_loop ; found_match_in_dictionary &236c a4 84 LDY &84 ; number_of_words_in_input &236e a5 85 LDA &85 ; dictionary_word_number &2370 99 80 0a STA &0a80,Y ; tokenised_input &2373 e6 84 INC &84 ; number_of_words_in_input &2375 c9 2f CMP #&2f &2377 b0 0f BCS &2388 ; consider_next_word_of_input &2379 24 83 BIT &83 ; input_verb &237b 10 0b BPL &2388 ; consider_next_word_of_input &237d 85 83 STA &83 ; input_verb &237f c9 0e CMP #&0e ; "swest" + 1 &2381 90 05 BCC &2388 ; consider_next_word_of_input &2383 a9 ff LDA #&ff &2385 99 80 0a STA &0a80,Y ; tokenised_input ; consider_next_word_of_input &2388 68 PLA ; input offset &2389 a8 TAY &238a 4c 0d 23 JMP &230d ; split_input_into_words_loop ; check_if_letter &238d c9 41 CMP #&41 ; "A" &238f b0 01 BCS &2392 ; is_not_less_than_41 &2391 60 RTS ; is_not_less_than_41 &2392 c9 7b CMP #&7b ; "z" + 1 &2394 90 01 BCC &2397 ; is_less_than_7b &2396 60 RTS ; is_less_than_7b &2397 c9 5b CMP #&5b ; "Z" + 1 &2399 b0 02 BCS &239d ; is_not_less_than_5b &239b 38 SEC &239c 60 RTS ; is_not_less_than_5b &239d c9 61 CMP #&61 ; "a" &239f 60 RTS # Leave with carry set if character is letter ; get_byte_of_input &23a0 24 88 BIT &88 ; end_of_input # Positive if not end of input &23a2 10 06 BPL &23aa ; not_end_of_input ; is_end_of_input &23a4 68 PLA # Leave prompt_for_input on next return &23a5 68 PLA &23a6 a9 ff LDA #&ff &23a8 85 8a STA &8a ; room_picture_availability # Set &80 and &40 to suppress drawing picture ; not_end_of_input &23aa bd 00 0a LDA &0a00,X ; input_buffer &23ad e8 INX &23ae c9 0d CMP #&0d ; CR &23b0 d0 02 BNE &23b4 ; leave &23b2 c6 88 DEC &88 ; end_of_input # Set to negative to indicate end of input ; leave &23b4 60 RTS ; verb_to_direction_bitmap_table ; 0 1 2 3 4 5 6 7 8 9 a b c d ; N S E W U D NE NW NE NW SE SW SE SW &23b5 20 10 08 04 02 01 28 24 28 24 18 14 18 14 ; handle_direction &23c3 a5 8c LDA &8c ; description_based_direction # Non-zero if direction set from description &23c5 85 86 STA &86 ; input_direction &23c7 d0 15 BNE &23de ; skip_finding_direction_from_input ; find_direction_from_input &23c9 a8 TAY ; find_direction_from_input_loop &23ca b9 80 0a LDA &0a80,Y ; tokenised_input &23cd c9 0e CMP #&0e ; "swest" + 1 &23cf b0 08 BCS &23d9 ; consider_next_word &23d1 aa TAX &23d2 bd b5 23 LDA &23b5,X ; verb_to_direction_bitmap_table &23d5 05 86 ORA &86 ; input_direction &23d7 85 86 STA &86 ; input_direction ; consider_next_word &23d9 c8 INY &23da c4 84 CPY &84 ; number_of_words_in_input &23dc d0 ec BNE &23ca ; find_direction_from_input_loop ; skip_finding_direction_from_input &23de 20 fb 24 JSR &24fb ; get_room_exit_count_and_data_offset # Returns A = exit count &23e1 f0 35 BEQ &2418 ; skip_exits ; find_exit_identical_to_direction_loop &23e3 20 cd 21 JSR &21cd ; get_exit_data &23e6 a5 7c LDA &7c ; exit_direction # ..218421 direction &23e8 29 3f AND #&3f &23ea c5 86 CMP &86 ; input_direction &23ec f0 64 BEQ &2452 ; found_exit &23ee 24 7c BIT &7c ; exit_direction # 8....... set if exit has extended description &23f0 10 02 BPL &23f4 ; not_extended_exit &23f2 e6 7b INC &7b ; room_data_offset ; not_extended_exit &23f4 c6 7a DEC &7a ; room_exit_count &23f6 d0 eb BNE &23e3 ; find_exit_identical_to_direction_loop &23f8 a5 87 LDA &87 ; room_description_length_and_exit_count &23fa 85 7a STA &7a ; room_description_length_and_exit_count &23fc 20 04 25 JSR &2504 ; get_room_exit_count # Returns A = room exit count ; find_exit_including_direction_loop &23ff 20 cd 21 JSR &21cd ; get_exit_data &2402 a5 7c LDA &7c ; exit_direction &2404 29 3f AND #&3f &2406 85 7f STA &7f ; direction &2408 05 86 ORA &86 ; input_direction &240a c5 7f CMP &7f ; direction &240c f0 44 BEQ &2452 ; found_exit &240e 24 7c BIT &7c ; exit_direction # 8....... set if exit has extended description &2410 10 02 BPL &2414 ; not_extended_exit &2412 e6 7b INC &7b ; room_data_offset ; not_extended_exit &2414 c6 7a DEC &7a ; room_exit_count &2416 d0 e7 BNE &23ff ; find_exit_including_direction_loop ; skip_exits &2418 a5 86 LDA &86 ; input_direction &241a 29 01 AND #&01 &241c d0 06 BNE &2424 ; write_you_cant_go_direction # Branch if direction includes down &241e a5 79 LDA &79 ; room_flags # .....421 description type &2420 29 07 AND #&07 &2422 d0 56 BNE &247a ; handle_direction_in_special_room ; write_you_cant_go_direction &2424 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &2427 84 36 af 00 ; "You can't go" ; write_input_direction &242b a5 86 LDA &86 ; input_direction ; write_direction # Called with A = direction &242d 0a ASL A # 84218421 -> 8 4218421. &242e 0a ASL A # -> 4 218421.. &242f 85 80 STA &80 ; direction_bitmap &2431 a2 00 LDX #&00 ; "north" &2433 86 81 STX &81 ; count ; write_direction_loop &2435 26 80 ROL &80 ; direction_bitmap # Bit set if direction present: &2437 90 13 BCC &244c ; consider_next_direction # &20 north &10 south &08 east &04 west &02 up &01 down &2439 e0 04 CPX #&04 &243b 90 09 BCC &2446 ; skip_and # Don't add "and" if joining two cardinal directions &243d a5 81 LDA &81 ; count &243f f0 05 BEQ &2446 ; skip_and &2441 a9 3c LDA #&3c ; "and" &2443 20 d9 1f JSR &1fd9 ; write_word_from_dictionary_one ; skip_and &2446 8a TXA &2447 20 d9 1f JSR &1fd9 ; write_word_from_dictionary_one &244a e6 81 INC &81 ; count ; consider_next_direction &244c e8 INX &244d e0 06 CPX #&06 &244f 90 e4 BCC &2435 ; write_direction_loop &2451 60 RTS ; found_exit &2452 24 7c BIT &7c ; exit_direction # .4...... set if exit is open, unset if locked &2454 50 ce BVC &2424 ; write_you_cant_go_direction &2456 68 PLA # Leave handle_direction_and_end_sentence on next return &2457 68 PLA &2458 a5 7d LDA &7d ; exit_room ; set_player_room &245a 85 89 STA &89 ; player_room &245c 8d b4 29 STA &29b4 ; characters_location + 0 (CHARACTER_PLAYER) &245f 20 bd 20 JSR &20bd ; check_if_room_is_lit # Returns positive if room is lit &2462 24 8a BIT &8a ; room_picture_availability # &40 set if room has no picture &2464 70 11 BVS &2477 ; to_write_room_description &2466 a5 01 LDA &01 ; display_options # &80 (OPTION_ALWAYS) set to draw picture always &2468 30 0a BMI &2474 ; to_draw_room_picture &246a 29 20 AND #&20 ; OPTION_UNVISITED # &20 set to draw picture if room unvisited &246c f0 09 BEQ &2477 ; to_write_room_description &246e a5 8a LDA &8a ; room_picture_availability # &10 set if room visited &2470 29 10 AND #&10 ; ROOM_FLAG_VISITED &2472 d0 03 BNE &2477 ; to_write_room_description ; to_draw_room_picture &2474 4c 17 25 JMP &2517 ; draw_room_picture ; to_write_room_description &2477 4c ea 20 JMP &20ea ; write_room_description ; handle_direction_in_special_room &247a c9 02 CMP #&02 &247c b0 0b BCS &2489 ; not_type_one ; is_type_one &247e 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &2481 b0 b1 b2 b3 3d 98 00 ; "Steep slag heaps block your way" &2488 60 RTS ; not_type_one &2489 d0 0a BNE &2495 ; not_type_two ; is_type_two &248b 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &248e 5d b4 3e 41 b0 00 ; "The cliff is too steep" &2494 60 RTS ; not_type_two &2495 c9 04 CMP #&04 &2497 b0 0a BCS &24a3 ; not_type_three ; is_type_three &2499 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &249c 5d 54 48 41 b0 00 ; "The mountains are too steep" &24a2 60 RTS ; not_type_three &24a3 d0 0b BNE &24b0 ; not_type_four ; is_type_four &24a5 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &24a8 45 48 b5 44 3d 98 00 ; "There are bushes in your way" &24af 60 RTS ; not_type_four &24b0 c9 06 CMP #&06 &24b2 b0 0a BCS &24be ; not_type_five ; is_type_five &24b4 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &24b7 ad b6 b7 3d 98 00 ; "Dense undergrowth blocks your way" &24bd 60 RTS ; not_type_five &24be d0 0a BNE &24ca ; is_type_seven ; is_type_six &24c0 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &24c3 46 a3 b8 00 ; "No passage leads" &24c7 4c 2b 24 JMP &242b ; write_input_direction ; is_type_seven &24ca 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &24cd 5d b9 48 41 b0 00 ; "The dunes are too steep" ; leave &24d3 60 RTS ; handle_direction_and_end_sentence &24d4 20 c3 23 JSR &23c3 ; handle_direction &24d7 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &24da 4c 51 3b JMP &3b51 ; write_newline ; write_object_name # Called with X = object &24dd bd 80 25 LDA &2580,X ; objects_description &24e0 aa TAX &24e1 bd 50 27 LDA &2750,X ; object_descriptions_first_word &24e4 20 f6 24 JSR &24f6 ; write_object_name_word &24e7 bd 7a 27 LDA &277a,X ; object_descriptions_second_word &24ea 20 f6 24 JSR &24f6 ; write_object_name_word &24ed bd a4 27 LDA &27a4,X ; object_descriptions_third_word &24f0 20 f6 24 JSR &24f6 ; write_object_name_word &24f3 bd ce 27 LDA &27ce,X ; object_descriptions_fourth_word ; write_object_name_word &24f6 f0 db BEQ &24d3 ; leave &24f8 4c d9 1f JMP &1fd9 ; write_word_from_dictionary_one ; get_room_exit_count_and_data_offset &24fb a4 89 LDY &89 ; player_room &24fd 20 a7 20 JSR &20a7 ; get_room_data_address_and_bytes &2500 a5 7a LDA &7a ; room_description_length_and_exit_count &2502 85 87 STA &87 ; room_description_length_and_exit_count ; get_room_exit_count &2504 a5 7a LDA &7a ; room_description_length_and_exit_count # ...18421 number of words in room description &2506 29 1f AND #&1f &2508 18 CLC &2509 69 02 ADC #&02 &250b 85 7b STA &7b ; room_data_offset &250d a5 7a LDA &7a ; room_description_length_and_exit_count # 842..... number of exits in room &250f 4a LSR A # 84218421 -> .8421842 &2510 4a LSR A # -> ..842184 &2511 4a LSR A # -> ...84218 &2512 4a LSR A # -> ....8421 &2513 4a LSR A # -> .....842 &2514 85 7a STA &7a ; room_exit_count &2516 60 RTS ; draw_room_picture &2517 a5 25 LDA &25 ; last_character_written # Zero if nothing written &2519 f0 03 BEQ &251e ; skip_delay &251b 20 20 3b JSR &3b20 ; delay_before_picture ; skip_delay &251e a6 89 LDX &89 ; player_room &2520 bd 00 1f LDA &1f00,X ; room_pictures_table &2523 aa TAX &2524 20 12 0b JSR &0b12 ; draw_picture &2527 20 32 3b JSR &3b32 ; delay_four &252a 20 c0 1f JSR &1fc0 ; initialise_mode_7_screen &252d 20 fb 24 JSR &24fb ; get_room_exit_count_and_data_offset &2530 a5 79 LDA &79 ; room_flags # ....8... set if room has no direction for picture &2532 29 08 AND #&08 ; ROOM_FLAG_NO_PICTURE_DIRECTION &2534 d0 13 BNE &2549 ; skip_picture_direction &2536 20 6c 3b JSR &3b6c ; write_string_using_dictionary_one &2539 5d 29 3e 3d 28 00 ; "The picture is your view" &253f a4 7b LDY &7b ; room_data_offset &2541 b1 77 LDA (&77),Y ; room_data_address # Use first byte of exit data as picture direction &2543 20 2d 24 JSR &242d ; write_direction &2546 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; skip_picture_direction &2549 4c ea 20 JMP &20ea ; write_room_description ; press_tab_key_to_see_a_picture_string &254c 16 07 ; change to MODE 7 &254e 82 ; TELETEXT_GREEN &254f 20 50 72 65 73 73 20 22 54 41 42 22 20 6b 65 79 ; " Press "TAB" key to see a picture" &255f 20 74 6f 20 73 65 65 20 61 20 70 69 63 74 75 72 &256f 65 0d &2571 1c 00 18 27 01 ; define text winow x:(&00, &27), y:(&01, &18) ; unused # Source code fragment &2576 0d &2577 02 d0 19 2e 41 4e 33 20 4c ; 720.AN3 L ... # Objects # ======= # description location # &00 : &2580 &14 : a small holdall &25c0 &8d ROOM_8d ("in a sloping maze") # &01 : &2581 &01 : an unlit oil lamp &25c1 &00 ROOM_00 ("inside a wooden cabin") # &02 : &2582 &02 : the master key &25c2 &d1 ROOM_CARRYING + &09 (a dragon) # &03 : &2583 &03 : a gold key &25c3 &60 ROOM_60 ("in a small kitchen") # &04 : &2584 &04 : a silver key &25c4 &c7 ROOM_DESTROYED (see &116d) # &05 : &2585 &05 : a bronze key &25c5 &d8 ROOM_CARRYING + &10 (a witch) # &06 : &2586 &06 : a brass key &25c6 &00 ROOM_00 ("inside a wooden cabin") # &07 : &2587 &07 : a short wooden rod &25c7 &67 ROOM_67 ("in a passage") # &08 : &2588 &08 : a crystal ball &25c8 &6c ROOM_6c ("in a room") # &09 : &2589 &0a : an empty stone jug &25c9 &00 ROOM_00 ("inside a wooden cabin") # &0a : &258a &15 : a small flint stone &25ca &07 ROOM_07 ("in a disused flint quarry, large blocks of stone dwarf the twisty road") # &0b : &258b &16 : a long wooden staff &25cb &4f ROOM_4f ("in the west turret") # &0c : &258c &0e : a short dagger &25cc &68 ROOM_68 ("in a room") # &0d : &258d &0e : a short dagger &25cd &64 ROOM_64 ("in a damp hollow chamber") # &0e : &258e &0f : a broad sword &25ce &5b ROOM_5b ("in the royal bedroom") # &0f : &258f &0f : a broad sword &25cf &46 ROOM_46 ("in the armoury") # &10 : &2590 &10 : a knife &25d0 &46 ROOM_46 ("in the armoury") # &11 : &2591 &10 : a knife &25d1 &46 ROOM_46 ("in the armoury") # &12 : &2592 &11 : an axe &25d2 &46 ROOM_46 ("in the armoury") # &13 : &2593 &11 : an axe &25d3 &0e ROOM_0e ("wandering through the woods") # &14 : &2594 &12 : a hammer &25d4 &3c ROOM_3c ("in a workshop") # &15 : &2595 &12 : a hammer &25d5 &46 ROOM_46 ("in the armoury") # &16 : &2596 &10 : a knife &25d6 &c9 ROOM_CARRYING + &01 (a castle guard) # &17 : &2597 &10 : a knife &25d7 &d0 ROOM_CARRYING + &08 (a large guard) # &18 : &2598 &10 : a knife &25d8 &d4 ROOM_CARRYING + &0c (a castle guard) # &19 : &2599 &18 : a mace &25d9 &cd ROOM_CARRYING + &05 (a castle guard) # &1a : &259a &11 : an axe &25da &e0 ROOM_CARRYING + &18 (an elf) # &1b : &259b &18 : a mace &25db &dd ROOM_CARRYING + &15 (a sand lurker) # &1c : &259c &19 : a wooden club &25dc &db ROOM_CARRYING + &13 (a gorilla) # &1d : &259d &19 : a wooden club &25dd &e3 ROOM_CARRYING + &1b (a gorilla) # &1e : &259e &19 : a wooden club &25de &e5 ROOM_CARRYING + &1d (a gorilla) # &1f : &259f &10 : a knife &25df &e8 ROOM_CARRYING + &20 (a castle guard) # &20 : &25a0 &10 : a knife &25e0 &d7 ROOM_CARRYING + &0f (a witch) # &21 : &25a1 &18 : a mace &25e1 &e9 ROOM_CARRYING + &21 (a castle guard) # &22 : &25a2 &0f : a broad sword &25e2 &ea ROOM_CARRYING + &22 (a troll) # &23 : &25a3 &1d : some beer &25e3 &3f ROOM_3f ("in the cellar") # &24 : &25a4 &1d : some beer &25e4 &9d ROOM_9d ("in The Sword Inn") # &25 : &25a5 &1e : a bag of silver &25e5 &d6 ROOM_CARRYING + &0e (a castle guard) # &26 : &25a6 &1f : a diamond ring &25e6 &d9 ROOM_CARRYING + &11 (a dwarf) # &27 : &25a7 &1e : a bag of silver &25e7 &df ROOM_CARRYING + &17 (a sand lurker) # &28 : &25a8 &20 : a metal amulet &25e8 &c7 ROOM_DESTROYED (see &10e5) # &29 : &25a9 &21 : a uniform &25e9 &45 ROOM_45 ("in the guard room") # &2a : &25aa &13 : a large cut diamond &25ea &8b ROOM_8b ("in a cave") # &2b : &25ab &09 : a wooden treasure chest &25eb &50 ROOM_50 ("in the south turret") # &2c : &25ac &17 : a cauldron of oil &25ec &3c ROOM_3c ("in a workshop") # &2d : &25ad &0d : a bag of gold &25ed &6b ROOM_6b ("in a small chamber") # &2e : &25ae &1e : a bag of silver &25ee &e8 ROOM_CARRYING + &20 (a castle guard) # &2f : &25af &22 : a staff of gold &25ef &d7 ROOM_CARRYING + &0f (a witch) # &30 : &25b0 &23 : a ball of gold &25f0 &57 ROOM_57 ("in the throne room") # &31 : &25b1 &24 : the secret of life &25f1 &ae ROOM_ae ("in a large hollow chamber, a river of gold flows through the chamber to the north") # &32 : &25b2 &0d : a bag of gold &25f2 &31 ROOM_31 ("wandering through high mountains") # &33 : &25b3 &1a : a jewelled gold crown &25f3 &cf ROOM_CARRYING + &07 (the desert king) ; objects_description &2580 14 01 02 03 04 05 06 07 08 0a 15 16 0e 0e 0f 0f &2590 10 10 11 11 12 12 10 10 10 18 11 18 19 19 19 10 &25a0 10 18 0f 1d 1d 1e 1f 1e 20 21 13 09 17 0d 1e 22 &25b0 23 24 0d 1a ; unused # Source code fragment &25b4 52 54 48 49 32 0d ; ... RTHI2 &25ba 02 e4 24 2e 41 33 ; 740 .A3 ... ; objects_location &25c0 8d 00 d1 60 c7 d8 00 67 6c 00 07 4f 68 64 5b 46 &25d0 46 46 46 0e 3c 46 c9 d0 d4 cd e0 dd db e3 e5 e8 &25e0 d7 e9 ea 3f 9d d6 d9 df c7 45 8b 50 3c 6b e8 d7 &25f0 57 ae 31 cf ; unused # Source code fragment &25f4 42 45 51 41 33 43 3a 4c 44 41 26 32 ; ... BEQA3C:LDA&2 ... # Object description properties # ============================= # weight strength req. score breakage probability # &00 : a lit lamp &2600 &13 19, &262a &2d 45, &2654 &00 0, &267e &0f ; 1 in 16 # &01 : an unlit oil lamp &2601 &13 19, &262b &2d 45, &2655 &00 0, &267f &0f ; 1 in 16 # &02 : the master key &2602 &05 5, &262c &12 18, &2656 &00 0, &2680 &3f ; 1 in 64 # &03 : a gold key &2603 &08 8, &262d &12 18, &2657 &0f 15, &2681 &3f ; 1 in 64 # &04 : a silver key &2604 &07 7, &262e &12 18, &2658 &0c 12, &2682 &3f ; 1 in 64 # &05 : a bronze key &2605 &05 5, &262f &12 18, &2659 &00 0, &2683 &3f ; 1 in 64 # &06 : a brass key &2606 &05 5, &2630 &12 18, &265a &00 0, &2684 &3f ; 1 in 64 # &07 : a short wooden rod &2607 &03 3, &2631 &0d 13, &265b &00 0, &2685 &03 ; 1 in 4 # &08 : a crystal ball &2608 &19 25, &2632 &36 54, &265c &00 0, &2686 &01 ; 1 in 2 # &09 : a wooden treasure chest &2609 &6d 109, &2633 &87 135, &265d &af 175, &2687 &07 ; 1 in 8 # &0a : an empty stone jug &260a &05 5, &2634 &2d 45, &265e &00 0, &2688 &01 ; 1 in 2 # &0b : a jug of water &260b &14 20, &2635 &3f 63, &265f &00 0, &2689 &01 ; 1 in 2 # &0c : a jug of oil &260c &14 20, &2636 &3f 63, &2660 &00 0, &268a &01 ; 1 in 2 # &0d : a bag of gold &260d &1e 30, &2637 &3f 63, &2661 &32 50, &268b &3f ; 1 in 64 # &0e : a short dagger &260e &05 5, &2638 &36 54, &2662 &00 0, &268c &1f ; 1 in 32 # &0f : a broad sword &260f &28 40, &2639 &6c 108, &2663 &00 0, &268d &1f ; 1 in 32 # &10 : a knife &2610 &05 5, &263a &36 54, &2664 &00 0, &268e &1f ; 1 in 32 # &11 : an axe &2611 &14 20, &263b &5a 90, &2665 &00 0, &268f &1f ; 1 in 32 # &12 : a hammer &2612 &19 25, &263c &6c 108, &2666 &00 0, &2690 &0f ; 1 in 16 # &13 : a large cut diamond &2613 &32 50, &263d &36 54, &2667 &50 80, &2691 &07 ; 1 in 8 # &14 : a small holdall &2614 &02 2, &263e &1b 27, &2668 &00 0, &2692 &ff ; 1 in 256 # &15 : a small flint stone &2615 &03 3, &263f &36 54, &2669 &00 0, &2693 &07 ; 1 in 8 # &16 : a long wooden staff &2616 &0f 15, &2640 &0a 10, &266a &00 0, &2694 &01 ; 1 in 2 # &17 : a cauldron of oil &2617 &ff 255, &2641 &00 0, &266b &00 0, &2695 &00 ; always # &18 : a mace &2618 &1e 30, &2642 &75 117, &266c &00 0, &2696 &0f ; 1 in 16 # &19 : a wooden club &2619 &14 20, &2643 &5a 90, &266d &00 0, &2697 &07 ; 1 in 8 # &1a : a jewelled gold crown &261a &1e 30, &2644 &5a 90, &266e &5a 90, &2698 &03 ; 1 in 4 # &1b : a jug of gold &261b &14 20, &2645 &3f 63, &266f &64 100, &2699 &01 ; 1 in 2 # &1c : a jug of beer &261c &14 20, &2646 &3f 63, &2670 &00 0, &269a &01 ; 1 in 2 # &1d : some beer &261d &ff 255, &2647 &00 0, &2671 &00 0, &269b &00 ; always # &1e : a bag of silver &261e &19 25, &2648 &24 36, &2672 &19 25, &269c &3f ; 1 in 64 # &1f : a diamond ring &261f &05 5, &2649 &08 8, &2673 &0c 12, &269d &1f ; 1 in 32 # &20 : a metal amulet &2620 &00 0, &264a &05 5, &2674 &00 0, &269e &ff ; 1 in 256 # &21 : a uniform &2621 &0a 10, &264b &19 25, &2675 &00 0, &269f &ff ; 1 in 256 # &22 : a staff of gold &2622 &28 40, &264c &64 100, &2676 &64 100, &26a0 &ff ; 1 in 256 # &23 : a ball of gold &2623 &19 25, &264d &46 70, &2677 &41 65, &26a1 &ff ; 1 in 256 # &24 : the secret of life &2624 &64 100, &264e &96 150, &2678 &c8 200, &26a2 &00 ; always ; object_descriptions_weight &2600 13 13 05 08 07 05 05 03 19 6d 05 14 14 1e 05 28 &2610 05 14 19 32 02 03 0f ff 1e 14 1e 14 14 ff 19 05 &2620 00 0a 28 19 64 ; unused # Source code fragment &2625 4f 4d 2c 58 0d ; ... OM,X ; object_descriptions_strength_required &262a 2d 2d 12 12 12 12 12 0d 36 87 2d 3f 3f 3f 36 6c &263a 36 5a 6c 36 1b 36 0a 00 75 5a 5a 3f 3f 00 24 08 &264a 05 19 64 46 96 ; unused # Source code fragment &264f 41 44 30 2c 58 ; ... AD0,X ... ; object_descriptions_score &2654 00 00 00 0f 0c 00 00 00 00 af 00 00 00 32 00 00 &2664 00 00 00 50 00 00 00 00 00 00 5a 64 00 00 19 0c &2674 00 00 64 41 c8 ; unused # Source code fragment &2679 31 3a 53 54 58 ; ... 1:STX ... ; object_descriptions_breakage_probability &267e 0f 0f 3f 3f 3f 3f 3f 03 01 07 01 01 01 3f 1f 1f &268e 1f 1f 0f 07 ff 07 01 00 0f 07 03 01 01 00 3f 1f &269e ff ff ff ff 00 ; unused # Source code fragment &26a3 52 54 53 0d ; ... RTS &26a7 03 ; ... # Object description weapon properties # ==================================== # throw ceiling, throw random hit ceiling, hit random # &00 : a lit lamp &26a8 &14 20, &26d2 &0f 15, &26fc &19 25, &2726 &07 7 # &01 : an unlit oil lamp &26a9 &08 8, &26d3 &03 3, &26fd &0c 12, &2727 &07 7 # &02 : the master key &26aa &0c 12, &26d4 &07 7, &26fe &0c 12, &2728 &05 5 # &03 : a gold key &26ab &0c 12, &26d5 &07 7, &26ff &0c 12, &2729 &07 7 # &04 : a silver key &26ac &0c 12, &26d6 &07 7, &2700 &0c 12, &272a &07 7 # &05 : a bronze key &26ad &0c 12, &26d7 &07 7, &2701 &0c 12, &272b &07 7 # &06 : a brass key &26ae &0c 12, &26d8 &07 7, &2702 &0c 12, &272c &07 7 # &07 : a short wooden rod &26af &06 6, &26d9 &03 3, &2703 &03 3, &272d &03 3 # &08 : a crystal ball &26b0 &0a 10, &26da &07 7, &2704 &07 7, &272e &07 7 # &09 : a wooden treasure chest &26b1 &0c 12, &26db &07 7, &2705 &0a 10, &272f &07 7 # &0a : an empty stone jug &26b2 &07 7, &26dc &03 3, &2706 &07 7, &2730 &07 7 # &0b : a jug of water &26b3 &0c 12, &26dd &07 7, &2707 &18 24, &2731 &0f 15 # &0c : a jug of oil &26b4 &0c 12, &26de &07 7, &2708 &16 22, &2732 &0f 15 # &0d : a bag of gold &26b5 &0e 14, &26df &07 7, &2709 &24 36, &2733 &0f 15 # &0e : a short dagger &26b6 &1e 30, &26e0 &0f 15, &270a &28 40, &2734 &1f 31 # &0f : a broad sword &26b7 &1f 31, &26e1 &1f 31, &270b &82 130, &2735 &7f 127 # &10 : a knife &26b8 &50 80, &26e2 &1f 31, &270c &0f 15, &2736 &03 3 # &11 : an axe &26b9 &78 120, &26e3 &3f 63, &270d &50 80, &2737 &1f 31 # &12 : a hammer &26ba &37 55, &26e4 &1f 31, &270e &23 35, &2738 &0f 15 # &13 : a large cut diamond &26bb &0f 15, &26e5 &0f 15, &270f &07 7, &2739 &03 3 # &14 : a small holdall &26bc &0a 10, &26e6 &05 5, &2710 &16 22, &273a &0f 15 # &15 : a small flint stone &26bd &14 20, &26e7 &0f 15, &2711 &07 7, &273b &03 3 # &16 : a long wooden staff &26be &ff 255, &26e8 &00 0, &2712 &ff 255, &273c &00 0 # &17 : a cauldron of oil &26bf &00 0, &26e9 &00 0, &2713 &00 0, &273d &00 0 # &18 : a mace &26c0 &32 50, &26ea &0f 15, &2714 &64 100, &273e &3f 63 # &19 : a wooden club &26c1 &1e 30, &26eb &0f 15, &2715 &32 50, &273f &1f 31 # &1a : a jewelled gold crown &26c2 &14 20, &26ec &07 7, &2716 &23 35, &2740 &07 7 # &1b : a jug of gold &26c3 &0c 12, &26ed &03 3, &2717 &1e 30, &2741 &0f 15 # &1c : a jug of beer &26c4 &0c 12, &26ee &07 7, &2718 &19 25, &2742 &0f 15 # &1d : some beer &26c5 &00 0, &26ef &00 0, &2719 &00 0, &2743 &00 0 # &1e : a bag of silver &26c6 &0f 15, &26f0 &07 7, &271a &22 34, &2744 &0f 15 # &1f : a diamond ring &26c7 &05 5, &26f1 &03 3, &271b &16 22, &2745 &0f 15 # &20 : a metal amulet &26c8 &0a 10, &26f2 &03 3, &271c &01 1, &2746 &01 1 # &21 : a uniform &26c9 &06 6, &26f3 &00 0, &271d &07 7, &2747 &07 7 # &22 : a staff of gold &26ca &1e 30, &26f4 &0f 15, &271e &2d 45, &2748 &1f 31 # &23 : a ball of gold &26cb &14 20, &26f5 &0f 15, &271f &28 40, &2749 &1f 31 # &24 : the secret of life &26cc &ff 255, &26f6 &00 0, &2720 &00 0, &274a &00 0 ; object_descriptions_throw_damage_ceiling &26a8 14 08 0c 0c 0c 0c 0c 06 0a 0c 07 0c 0c 0e 1e 1f &26b8 50 78 37 0f 0a 14 ff 00 32 1e 14 0c 0c 00 0f 05 &26c8 0a 06 1e 14 ff ; unused # Source code fragment &26cd 2c 58 3a 53 54 ; ... ,X:ST ... ; object_descriptions_throw_damage_random &26d2 0f 03 07 07 07 07 07 03 07 07 03 07 07 07 0f 1f &26e2 1f 3f 1f 0f 05 0f 00 00 0f 0f 07 03 07 00 07 03 &26f2 03 00 0f 0f 00 ; unused # Source code fragment &26f7 2e 54 48 31 20 ; ... .TH1 ... ; object_descriptions_hit_damage_ceiling &26fc 19 0c 0c 0c 0c 0c 0c 03 07 0a 07 18 16 24 28 82 &270c 0f 50 23 07 16 07 ff 00 64 32 23 1e 19 00 22 16 &271c 01 07 2d 28 00 ; unused # Source code fragment &2721 30 2c 59 3a 53 ; ... 0,Y:S ... ; object_descriptions_hit_damage_random &2726 07 07 05 07 07 07 07 03 07 07 07 0f 0f 0f 1f 7f &2736 03 1f 0f 03 0f 03 00 00 3f 1f 07 0f 0f 00 0f 0f &2746 01 07 1f 1f 00 ; unused # Source code fragment &274b 4f 56 45 3a 4a ; ... OVE:J ... # Object descriptions # =================== # &00 : &2750 &3a, &277a &59, &27a4 &5a, &27ce &00 : "a lit lamp" # &01 : &2751 &3b, &277b &5b, &27a5 &5c, &27cf &5a : "an unlit oil lamp" # &02 : &2752 &5d, &277c &5e, &27a6 &32, &27d0 &00 : "the master key" # &03 : &2753 &3a, &277d &5f, &27a7 &32, &27d1 &00 : "a gold key" # &04 : &2754 &3a, &277e &60, &27a8 &32, &27d2 &00 : "a silver key" # &05 : &2755 &3a, &277f &61, &27a9 &32, &27d3 &00 : "a bronze key" # &06 : &2756 &3a, &2780 &62, &27aa &32, &27d4 &00 : "a brass key" # &07 : &2757 &3a, &2781 &63, &27ab &64, &27d5 &31 : "a short wooden rod" # &08 : &2758 &3a, &2782 &65, &27ac &66, &27d6 &00 : "a crystal ball" # &09 : &2759 &3a, &2783 &64, &27ad &67, &27d7 &68 : "a wooden treasure chest" # &0a : &275a &3b, &2784 &1f, &27ae &69, &27d8 &6a : "an empty stone jug" # &0b : &275b &3a, &2785 &6a, &27af &6b, &27d9 &6c : "a jug of water" # &0c : &275c &3a, &2786 &6a, &27b0 &6b, &27da &5c : "a jug of oil" # &0d : &275d &3a, &2787 &6d, &27b1 &6b, &27db &5f : "a bag of gold" # &0e : &275e &3a, &2788 &63, &27b2 &30, &27dc &00 : "a short dagger" # &0f : &275f &3a, &2789 &6e, &27b3 &6f, &27dd &00 : "a broad sword" # &10 : &2760 &3a, &278a &70, &27b4 &00, &27de &00 : "a knife" # &11 : &2761 &3b, &278b &71, &27b5 &00, &27df &00 : "an axe" # &12 : &2762 &3a, &278c &72, &27b6 &00, &27e0 &00 : "a hammer" # &13 : &2763 &3a, &278d &73, &27b7 &0f, &27e1 &74 : "a large cut diamond" # &14 : &2764 &3a, &278e &75, &27b8 &76, &27e2 &00 : "a small holdall" # &15 : &2765 &3a, &278f &75, &27b9 &33, &27e3 &69 : "a small flint stone" # &16 : &2766 &3a, &2790 &77, &27ba &64, &27e4 &78 : "a long wooden staff" # &17 : &2767 &3a, &2791 &79, &27bb &6b, &27e5 &5c : "a cauldron of oil" # &18 : &2768 &3a, &2792 &7a, &27bc &00, &27e6 &00 : "a mace" # &19 : &2769 &3a, &2793 &64, &27bd &7b, &27e7 &00 : "a wooden club" # &1a : &276a &3a, &2794 &7c, &27be &5f, &27e8 &7d : "a jewelled gold crown" # &1b : &276b &3a, &2795 &6a, &27bf &6b, &27e9 &5f : "a jug of gold" # &1c : &276c &3a, &2796 &6a, &27c0 &6b, &27ea &7e : "a jug of beer" # &1d : &276d &7f, &2797 &7e, &27c1 &00, &27eb &00 : "some beer" # &1e : &276e &3a, &2798 &6d, &27c2 &6b, &27ec &60 : "a bag of silver" # &1f : &276f &3a, &2799 &74, &27c3 &80, &27ed &00 : "a diamond ring" # &20 : &2770 &3a, &279a &81, &27c4 &82, &27ee &00 : "a metal amulet" # &21 : &2771 &3a, &279b &83, &27c5 &00, &27ef &00 : "a uniform" # &22 : &2772 &3a, &279c &78, &27c6 &6b, &27f0 &5f : "a staff of gold" # &23 : &2773 &3a, &279d &66, &27c7 &6b, &27f1 &5f : "a ball of gold" # &24 : &2774 &5d, &279e &4d, &27c8 &6b, &27f2 &58 : "the secret of life" ; object_descriptions_first_word ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &2750 3a 3b 5d 3a 3a 3a 3a 3a 3a 3a 3b 3a 3a 3a 3a 3a ; &00 &2760 3a 3b 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 7f 3a 3a ; &10 &2770 3a 3a 3a 3a 5d ; &20 ; unused # Source code fragment &2775 14 2e 54 48 32 ; ... .TH2 ... ; object_descriptions_second_word ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &277a 59 5b 5e 5f 60 61 62 63 65 64 1f 6a 6a 6d 63 6e ; &00 &278a 70 71 72 73 75 75 77 79 7a 64 7c 6a 6a 7e 6d 74 ; &10 &279a 81 83 78 66 4d ; &20 ; unused # Source code fragment &279f 4e 4f 4e 45 5f ; ... NONE_ ... ; object_descriptions_third_word ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &27a4 5a 5c 32 32 32 32 32 64 66 67 69 6b 6b 6b 30 6f ; &00 &27b4 00 00 00 0f 76 33 64 6b 00 7b 5f 6b 6b 00 6b 80 ; &10 &27c4 82 00 6b 6b 6b ; &20 ; unused # Source code fragment &27c9 53 52 46 4f 4c ; ... SRFOL ... ; object_descriptions_fourth_word ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &27ce 00 5a 00 00 00 00 00 31 00 68 6a 6c 5c 5f 00 00 ; &00 &27de 00 00 00 74 00 69 78 5c 00 00 7d 5f 7e 00 60 00 ; &10 &27ee 00 00 5f 5f 58 ; &20 ; unused # Source code fragment (&27f3 - &27fb) &27f3 50 54 5f 46 49 47 48 ; ... PT_FIGHT: ... ; holdall_weight &27fa 54 ; lamp_life &27fb 3a ; number_of_objects &27fc 34 ; unused &27fd 25 ; "%" ; number_of_characters &27fe 24 ; unused &27ff 0f # Character description properties # ================================ # max strength regain max load # &00 : you &2800 &be 190, &28c0 &03 3, &28e0 &6e 110 # &01 : the giant &2801 &f0 240, &28c1 &05 5, &28e1 &c8 200 # &02 : a dwarf &2802 &64 100, &28c2 &02 2, &28e2 &50 80 # &03 : a large guard &2803 &c8 200, &28c3 &03 3, &28e3 &aa 170 # &04 : a castle guard &2804 &8c 140, &28c4 &02 2, &28e4 &5a 90 # &05 : an elf &2805 &78 120, &28c5 &03 3, &28e5 &46 70 # &06 : the desert king &2806 &64 100, &28c6 &02 2, &28e6 &50 80 # &07 : a troll &2807 &dc 220, &28c7 &04 4, &28e7 &b4 180 # &08 : a witch &2808 &f5 245, &28c8 &06 6, &28e8 &f0 240 # &09 : a dragon &2809 &f5 245, &28c9 &0a 10, &28e9 &f0 240 # &0a : the inn keeper &280a &c8 200, &28ca &03 3, &28ea &aa 170 # &0b : a gorilla &280b &c8 200, &28cb &04 4, &28eb &64 100 # &0c : a sand lurker &280c &c8 200, &28cc &04 4, &28ec &b4 180 # &0d : an ill giant &280d &3c 60, &28cd &02 2, &28ed &41 65 # &0e : a strong elf &280e &96 150, &28ce &04 4, &28ee &78 120 ; character_descriptions_maximum_strength ; 0 1 2 3 4 5 6 7 8 9 a b c d e &2800 be f0 64 c8 8c 78 64 dc f5 f5 c8 c8 c8 3c 96 ; unused # Source code fragment &280f 70 57 2e 46 4f 4c 4c 4f 57 49 4e 47 20 4c 44 41 ; ... pW.FOLLOWING LDA# ... &281f 23 # Character descriptions # ====================== # &00 : &2820 &84, &2840 &00, &2860 &00 : "you" # &01 : &2821 &5d, &2841 &85, &2861 &00 : "the giant" # &02 : &2822 &3a, &2842 &86, &2862 &00 : "a dwarf" # &03 : &2823 &3a, &2843 &73, &2863 &55 : "a large guard" # &04 : &2824 &3a, &2844 &87, &2864 &55 : "a castle guard" # &05 : &2825 &3b, &2845 &88, &2865 &00 : "an elf" # &06 : &2826 &5d, &2846 &52, &2866 &4f : "the desert king" # &07 : &2827 &3a, &2847 &89, &2867 &00 : "a troll" # &08 : &2828 &3a, &2848 &8a, &2868 &00 : "a witch" # &09 : &2829 &3a, &2849 &8b, &2869 &00 : "a dragon" # &0a : &282a &5d, &284a &8c, &286a &53 : "the inn keeper" # &0b : &282b &3a, &284b &8d, &286b &00 : "a gorilla" # &0c : &282c &3a, &284c &8e, &286c &8f : "a sand lurker" # &0d : &282d &3b, &284d &35, &286d &85 : "an ill giant" # &0e : &282e &3a, &284e &4c, &286e &88 : "a strong elf" ; character_descriptions_first_word ; 0 1 2 3 4 5 6 7 8 9 a b c d e &2820 84 5d 3a 3a 3a 3b 5d 3a 3a 3a 5d 3a 3a 3b 3a ; unused # Source code fragment &282f 30 3a 43 4d 50 49 31 32 3a 42 45 51 46 4f 4c 34 ; ... 0:CMPI12:BEQFOL4: ... &283f 3a ; character_descriptions_second_word ; 0 1 2 3 4 5 6 7 8 9 a b c d e &2840 00 85 86 73 87 88 52 89 8a 8b 8c 8d 8e 35 4c ; unused # Source code fragment &284f 4e 47 3a 4c 44 41 72 6f 6f 6d 25 3a 4a 4d 50 46 ; ... NG:LDAroom%:JMPFO ... &285f 4f ; character_descriptions_third_word ; 0 1 2 3 4 5 6 7 8 9 a b c d e &2860 00 00 00 55 55 00 4f 00 00 00 53 00 8f 85 88 ; unused # Source code fragment &286f 20 4c 44 41 23 30 3a 53 54 41 49 30 0d ; ... LDA#0:STAI0 &287c 03 84 0c 2e ; 900. # Character descriptions movement properties # ========================================== # probability regions follows player # &00 : you &2880 &f0 16 in 16, 1 2 3 4 &28a0 &00 no # &01 : the giant &2881 &f3 13 in 16, 1 2 3 4 &28a1 &ff yes # &02 : a dwarf &2882 &57 9 in 16, 2 4 &28a2 &00 no # &03 : a large guard &2883 &00 16 in 16, &28a3 &00 no # &04 : a castle guard &2884 &13 13 in 16, 4 &28a4 &00 no # &05 : an elf &2885 &94 12 in 16, 1 4 &28a5 &00 no # &06 : the desert king &2886 &12 14 in 16, 4 &28a6 &ff yes # &07 : a troll &2887 &f9 7 in 16, 1 2 3 4 &28a7 &ff yes # &08 : a witch &2888 &00 16 in 16, &28a8 &00 no # &09 : a dragon &2889 &00 16 in 16, &28a9 &00 no # &0a : the inn keeper &288a &00 16 in 16, &28aa &00 no # &0b : a gorilla &288b &c1 15 in 16, 1 2 &28ab &00 no # &0c : a sand lurker &288c &2d 3 in 16, 3 &28ac &00 no # &0d : an ill giant &288d &f1 15 in 16, 1 2 3 4 &28ad &ff yes # &0e : a strong elf &288e &e1 15 in 16, 1 2 3 &28ae &ff yes ; character_descriptions_permitted_regions_and_movement_probability ; 0 1 2 3 4 5 6 7 8 9 a b c d e # 8421.... permitted regions &2880 f0 f3 57 00 13 94 12 f9 00 00 00 c1 2d f1 e1 # ....8421 movement probability ; unused # Source code fragment &288f 31 20 4a 53 52 41 54 54 45 4d 50 54 5f 46 49 47 ; ... 1 JSRATTEMPT_FIGH ... &289f 48 ; character_descriptions_follows_player # Non-zero if character follows player ; 0 1 2 3 4 5 6 7 8 9 a b c d e &28a0 00 ff 00 00 00 00 ff ff 00 00 00 00 00 ff ff ; unused # Source code fragment &28af 4a 53 52 46 4f 4c 4c 4f 57 49 4e 47 3a 4c 44 41 ; ... JSRFOLLOWING:LDAI ... &28bf 49 ; character_descriptions_strength_regain ; 0 1 2 3 4 5 6 7 8 9 a b c d e &28c0 03 05 02 03 02 03 02 04 06 0a 03 04 04 02 04 ; unused # Source code fragment &28cf 5f 41 57 41 59 0d ; ... _AWAY &... 03 98 35 2e 46 4f 4c 34 20 4c 44 ; 920.FOL4 LD ... ; character_descriptions_maximum_load ; 0 1 2 3 4 5 6 7 8 9 a b c d e &28e0 6e c8 50 aa 5a 46 50 b4 f0 f0 aa 64 b4 41 78 ; unused # Source code fragment &28ef 49 31 30 3a 42 45 51 4e 4f 5f 46 4f 4c 3a 4a 4d ; ... I10:BEQNO_FOL:JMP ... &28ff 50 # Exit descriptions # ================= # &00 : &2900 &9c, &2930 &9d : "rock fall" # &08 : &2908 &99, &2938 &00 : "fence" # &09 : &2909 &9a, &2939 &9b : "narrow crack" # &14 : &2914 &94, &2944 &00 : "grate" # &18 : &2918 &95, &2948 &00 : "door" # &19 : &2919 &4d, &2949 &95 : "secret door" # &20 : &2920 &4e, &2950 &90 : "forest path" # &21 : &2921 &91, &2951 &90 : "mountain path" # &22 : &2922 &92, &2952 &93 : "spiral staircase" # &23 : &2923 &96, &2953 &95 : "trap door" # &24 : &2924 &4d, &2954 &95 : "secret door" # &28 : &2928 &97, &2958 &00 : "archway" # &29 : &2929 &95, &2959 &98 : "door way" ; exit_descriptions_first_word &2900 9c ; &00 : "rock" ; unused # Source code fragment &2901 41 52 4b 5f 4d 4f 56 ; ... ARK_MOV ... &2908 99 ; &08 : "fence" &2909 9a ; &09 : "narrow" ; unused # Source code fragment &290a 03 a2 3a 2e 4e 4f 4e 45 5f 48 ; 930.NONE_H ... &2914 94 ; &14 : "grate" ; unused # Source code fragment &2915 52 45 20 ; ... RE ... &2918 95 ; &18 : "door" &2919 4d ; &19 ; "secret" ; unused # Source code fragment &291a 52 54 52 59 5f 54 ; ... RTRY_T ... &2920 4e ; &20 : "forest" &2921 91 ; &21 : "mountain" &2922 92 ; &22 : "spiral" &2923 96 ; &23 : "trap" &2924 4d ; &24 ; "secret" ; unused # Source code fragment &2925 44 41 49 ; ... DAI ... &2928 97 ; &28 : "archway" &2929 95 ; &29 : "door" ; unused # Source code fragment &292a 42 4e 45 54 48 35 ; ... BNETH5 ... ; exit_descriptions_second_word &2930 9d ; &00 : "fall" ; unused # Source code fragment &2931 4c 44 41 49 39 3a 42 ; ... LDAI9:B ... &2938 00 ; &08 : "" &2939 9b ; &09 : "crack" ; unused # Source code fragment &293a 46 4f 4c 4c 4f 57 49 4e 47 0d ; ... FOLLOWING &2944 00 ; &14 : "" ; unused # Source code fragment &2945 ac 38 2e ; 940. ... &2948 00 ; &18 : "" &2949 95 ; &19 ; "door" ; unused # Source code fragment &294a 49 46 54 49 4e 47 ; ... IFTING ... &2950 90 ; &20 : "path" &2951 90 ; &21 : "path" &2952 93 ; &22 : "staircase" &2953 95 ; &23 : "door" &2954 95 ; &24 ; "door" ; unused # Source code fragment &2955 41 4e 44 ; ... AND ... &2958 00 ; &28 : "" &2959 98 ; &29 : "way" ; unused # Source code fragment &295a 23 31 35 3a 53 54 ; ... #15:ST ... ; material_names_table &2960 62 ; 1 : "brass" &2961 61 ; 2 : "bronze" &2962 81 ; 3 : "metal" &2963 60 ; 4 : "silver" &2964 5f ; 5 : "gold" &2965 64 ; 6 : "wooden" &2966 69 ; 7 : "stone" ; unused &2967 49 ; "I" # Characters # ========== # faction strength load # &00 : &2968 &00 : you friendly &298e &be 190, &29da &00 0, # &01 : &2969 &84 : a castle guard enemy &298f &8c 140, &29db &05 5, # &02 : &296a &0d : an ill giant friendly &2990 &3c 60, &29dc &00 0, # &03 : &296b &05 : an elf friendly &2991 &5a 90, &29dd &00 0, # &04 : &296c &05 : an elf friendly &2992 &5a 90, &29de &00 0, # &05 : &296d &84 : a castle guard enemy &2993 &8c 140, &29df &1e 30, # &06 : &296e &05 : an elf friendly &2994 &5a 90, &29e0 &00 0, # &07 : &296f &86 : the desert king enemy &2995 &64 100, &29e1 &1e 30, # &08 : &2970 &83 : a large guard enemy &2996 &c8 200, &29e2 &05 5, # &09 : &2971 &89 : a dragon enemy &2997 &f5 245, &29e3 &05 5, # &0a : &2972 &05 : an elf friendly &2998 &5a 90, &29e4 &00 0, # &0b : &2973 &87 : a troll enemy &2999 &dc 220, &29e5 &00 0, # &0c : &2974 &84 : a castle guard enemy &299a &8c 140, &29e6 &05 5, # &0d : &2975 &05 : an elf friendly &299b &5a 90, &29e7 &00 0, # &0e : &2976 &84 : a castle guard enemy &299c &8c 140, &29e8 &19 25, # &0f : &2977 &88 : a witch enemy &299d &f5 245, &29e9 &2d 45, # &10 : &2978 &88 : a witch enemy &299e &f5 245, &29ea &05 5, # &11 : &2979 &82 : a dwarf enemy &299f &64 100, &29eb &05 5, # &12 : &297a &0a : the inn keeper friendly &29a0 &c8 200, &29ec &00 0, # &13 : &297b &8b : a gorilla enemy &29a1 &c8 200, &29ed &14 20, # &14 : &297c &05 : an elf friendly &29a2 &5a 90, &29ee &00 0, # &15 : &297d &8c : a sand lurker enemy &29a3 &c8 200, &29ef &1e 30, # &16 : &297e &05 : an elf friendly &29a4 &5a 90, &29f0 &00 0, # &17 : &297f &8c : a sand lurker enemy &29a5 &c8 200, &29f1 &19 25, # &18 : &2980 &05 : an elf friendly &29a6 &5a 90, &29f2 &14 20, # &19 : &2981 &8c : a sand lurker enemy &29a7 &c8 200, &29f3 &00 0, # &1a : &2982 &83 : a large guard enemy &29a8 &c8 200, &29f4 &00 0, # &1b : &2983 &8b : a gorilla enemy &29a9 &c8 200, &29f5 &14 20, # &1c : &2984 &8b : a gorilla enemy &29aa &c8 200, &29f6 &00 0, # &1d : &2985 &8b : a gorilla enemy &29ab &c8 200, &29f7 &14 20, # &1e : &2986 &0e : a strong elf friendly &29ac &96 150, &29f8 &00 0, # &1f : &2987 &8b : a gorilla enemy &29ad &c8 200, &29f9 &00 0, # &20 : &2988 &84 : a castle guard enemy &29ae &8c 140, &29fa &1e 30, # &21 : &2989 &84 : a castle guard enemy &29af &8c 140, &29fb &1e 30, # &22 : &298a &87 : a troll enemy &29b0 &c8 200, &29fc &28 40, # &23 : &298b &84 : a castle guard enemy &29b1 &8c 140, &29fd &00 0, ; characters_description # 8....... faction, set if enemy ; 0 1 2 3 4 5 6 7 8 9 a b c d e f # ...18421 description &2968 00 84 0d 05 05 84 05 86 83 89 05 87 84 05 84 88 ; &00 &2978 88 82 0a 8b 05 8c 05 8c 05 8c 83 8b 8b 8b 0e 8b ; &10 &2988 84 84 87 84 ; &20 ; unused &298c 12 2e ; characters_strength ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &298e be 8c 3c 5a 5a 8c 5a 64 c8 f5 5a dc 8c 5a 8c f5 ; &00 &299e f5 64 c8 c8 5a c8 5a c8 5a c8 c8 c8 c8 c8 96 c8 ; &10 &29ae 8c 8c c8 8c ; &20 ; unused &29b2 4c 44 ; "LD" # Character locations # =================== # &00 : you &29b4 &01 ROOM_01 ("on a road") # &01 : a castle guard &29b5 &45 ROOM_45 ("in the guard room") # &02 : an ill giant &29b6 &4b ROOM_4b ("in a dungeon") # &03 : an elf &29b7 &49 ROOM_49 ("in a musty dungeon") # &04 : an elf &29b8 &49 ROOM_49 ("in a musty dungeon") # &05 : a castle guard &29b9 &45 ROOM_45 ("in the guard room") # &06 : an elf &29ba &49 ROOM_49 ("in a musty dungeon") # &07 : the desert king &29bb &57 ROOM_57 ("in the throne room") # &08 : a large guard &29bc &47 ROOM_47 ("in a passage") # &09 : a dragon &29bd &4e ROOM_4e ("in the north turret") # &0a : an elf &29be &49 ROOM_49 ("in a musty dungeon") # &0b : a troll &29bf &49 ROOM_49 ("in a musty dungeon") # &0c : a castle guard &29c0 &3f ROOM_3f ("in the cellar") # &0d : an elf &29c1 &49 ROOM_49 ("in a musty dungeon") # &0e : a castle guard &29c2 &3f ROOM_3f ("in the cellar") # &0f : a witch &29c3 &51 ROOM_51 ("in the east turret") # &10 : a witch &29c4 &78 ROOM_78 ("in a twisty little passage in a maze") # &11 : a dwarf &29c5 &6b ROOM_6b ("in a small chamber") # &12 : the inn keeper &29c6 &9d ROOM_9d ("in The Sword Inn") # &13 : a gorilla &29c7 &15 ROOM_15 ("at the top of a waterfall") # &14 : an elf &29c8 &1e ROOM_1e ("at the west end of the canyon") # &15 : a sand lurker &29c9 &83 ROOM_83 ("on a cliff top") # &16 : an elf &29ca &1e ROOM_1e ("at the west end of the canyon") # &17 : a sand lurker &29cb &83 ROOM_83 ("on a cliff top") # &18 : an elf &29cc &1e ROOM_1e ("at the west end of the canyon") # &19 : a sand lurker &29cd &83 ROOM_83 ("on a cliff top") # &1a : a large guard &29ce &a9 ROOM_a9 ("locked up in a dungeon") # &1b : a gorilla &29cf &15 ROOM_15 ("at the top of a waterfall") # &1c : a gorilla &29d0 &15 ROOM_15 ("at the top of a waterfall") # &1d : a gorilla &29d1 &15 ROOM_15 ("at the top of a waterfall") # &1e : a strong elf &29d2 &9d ROOM_9d ("in The Sword Inn") # &1f : a gorilla &29d3 &15 ROOM_15 ("at the top of a waterfall") # &20 : a castle guard &29d4 &58 ROOM_58 ("on the landing") # &21 : a castle guard &29d5 &55 ROOM_55 ("in the east tower") # &22 : a troll &29d6 &85 ROOM_85 ("on a cliff top") # &23 : a castle guard &29d7 &55 ROOM_55 ("in the east tower") ; characters_location ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &29b4 01 45 4b 49 49 45 49 57 47 4e 49 49 3f 49 3f 51 ; &00 &29c4 78 6b 9d 15 1e 83 1e 83 1e 83 a9 15 15 15 9d 15 ; &10 &29d4 58 55 85 55 ; &20 ; unused &29d8 2c 58 ; ",X" ; characters_load ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &29da 00 05 00 00 00 1e 00 1e 05 05 00 00 05 00 19 2d ; &00 &29ea 05 05 00 14 00 1e 00 19 14 00 00 14 00 14 00 00 ; &10 &29fa 1e 1e 28 00 ; &20 ; unused &29fe 50 4c ; "PL" ; room_data_addresses_low_table ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &2a00 00 08 19 28 37 47 57 94 68 78 87 91 a3 ab b8 c2 ; &00 &2a10 ca d0 d6 e4 f4 fa 0b 1e 34 41 56 5e 6f 84 8c 99 ; &10 &2a20 a4 b0 c1 cf e0 e8 f2 fc 08 1b 25 32 3e 48 52 65 ; &20 &2a30 70 78 80 85 a6 b9 c7 8c d2 dd e9 f5 00 0b 13 1e ; &30 &2a40 25 2e 39 43 4e 59 62 6d 77 8c 95 a0 a8 b6 c2 cb ; &40 &2a50 d4 dd e6 f2 fd 09 14 1b 24 31 40 51 5d 64 71 88 ; &50 &2a60 7e 96 a5 af ba c5 cf d9 e5 f1 fb 05 0d 16 29 33 ; &60 &2a70 42 50 5e 6c 7a 86 94 a2 b0 c0 ce dc ea f6 04 12 ; &70 &2a80 20 2a 32 3a 44 4e 58 64 6e 7a 81 8e 9c a2 a8 b3 ; &80 &2a90 b9 bf c3 c9 da e0 e6 ee fb 09 31 16 3b 26 48 53 ; &90 &2aa0 5e 66 6e 74 7c 88 92 98 a0 a8 af ba c4 cc d4 ec ; &a0 &2ab0 f5 ; &b0 ; unused # Source code fragment &2ab1 52 32 25 3a 42 43 53 4d 41 32 3a 54 41 58 3a ; ... R2%:BCSMA2:TAX: ... ; read_clock &2ac0 a2 c0 LDX #&c0 ; &2bc0 = clock_block &2ac2 a0 2b LDY #&2b &2ac4 a9 01 LDA #&01 ; Read system clock &2ac6 20 f1 ff JSR &fff1 ; OSWORD &2ac9 ad c0 2b LDA &2bc0 ; clock_block &2acc 60 RTS # Leave with A = least significant byte of clock ; unused # Source code fragment &2acd 49 54 3a ; ... IT: ... ; characters_flags # Uses &2ad0 - &2af3. Source code fragment &2ad0 42 43 53 53 48 55 54 0d ; ... BCSSHUT &2ad8 04 06 17 2e 4f 50 45 20 4c 44 41 23 32 35 35 3a ; 1030.OPE LDA#255:BNEMA1 &2ae8 42 4e 45 4d 41 31 0d &2aef 04 10 11 2e 53 48 55 54 20 4c 44 58 50 52 32 25 ; 1040.SHUT LDXPR2% &2aff 0d ; room_data_addresses_table_high ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &2b00 2c 2c 2c 2c 2c 2c 2c 2e 2c 2c 2c 2c 2c 2c 2c 2c ; &00 &2b10 2c 2c 2c 2c 2c 2c 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ; &10 &2b20 2d 2d 2d 2d 2d 2d 2d 2d 2e 2e 2e 2e 2e 2e 2e 2e ; &20 &2b30 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2f 2f 2f 2f ; &30 &2b40 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f 2f ; &40 &2b50 2f 2f 2f 2f 2f 30 30 30 30 30 30 30 30 30 30 30 ; &50 &2b60 30 30 30 30 30 30 30 30 30 30 30 31 31 31 31 31 ; &60 &2b70 31 31 31 31 31 31 31 31 31 31 31 31 31 31 32 32 ; &70 &2b80 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 ; &80 &2b90 32 32 32 32 32 32 32 32 32 33 33 33 33 33 33 33 ; &90 &2ba0 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 ; &a0 &2bb0 33 ; &b0 ; unused # Source code fragment &2bb1 58 31 32 20 53 45 43 0d ; ... X12 SEC &2bb9 04 4c 13 2e 54 45 58 36 20 4c 44 58 49 30 3a 52 ; 1100.TEX6 LDXI0:RTS &2bc9 54 53 0d &2bcc 04 56 3b 2e ; 1100. ... ; characters_new_location # Uses &2bd0 - &2bf3. Source code fragment &2bd0 54 45 58 34 20 49 4e 59 3a 4c 44 41 28 50 52 25 ; ... TEX4 INY:LDA(PR%),Y:.MARK_MOVE TAX:LDAI8:PHA:TXA ... &2be0 29 2c 59 3a 2e 4d 41 52 4b 5f 4d 4f 56 45 20 54 &2bf0 41 58 3a 4c 44 41 49 38 3a 50 48 41 3a 54 58 41 # Room data # ========= # For each room, two bytes of data: # # 8....... ........ if set, room is dark # .4...... ........ if set, room is magically dark (has no picture) # ..2..... ........ if set, suppress writing room exits # ...1.... ........ set when room has been visited # ....8... ........ if set, room picture has no direction # .....421 ........ room type: non-zero if room has special description # # ........ 842..... number of exits # ........ ...18421 number of words in room description # # followed by packed room description, followed by exit data. # # For each exit, two or three bytes of data: # # 8....... ........ if set, exit is extended, i.e. has a third byte of data # .4...... ........ if set, exit is open, i.e. can be used # ..218421 ........ exit direction # # ........ 84218421 exit room # # ........ ........ 8....... if set, exit can be opened or locked by player # ........ ........ .4...... if set, exit can be seen through # ........ ........ ..218... exit type # ........ ........ .....421 exit material ; room_data ; room_00_data &2c00 08 ; regular room, no picture direction &2c01 24 ; description has 4 words, room has 1 exit &2c02 ba 3a 64 bb ; "inside a wooden cabin" &2c06 50 01 ; room &01 to south ; room_01_data &2c08 00 ; regular room &2c09 a3 ; description has 3 words, room has 5 exits &2c0a 1a 3a bc ; "on a road" &2c0d 60 00 ; room &00 to north &2c0f e8 04 00 ; room &04 via forest path to northeast &2c12 48 98 ; room &98 to east &2c14 44 02 ; room &02 to west &2c16 90 0a 46 ; room &0a visible through wooden fence to south ; room_02_data &2c19 00 ; regular room &2c1a 83 ; description has 3 words, room has 4 exits &2c1b 1a 3a bc ; "on a road" &2c1e 48 01 ; room &01 to east &2c20 e0 05 00 ; room &05 via forest path to north &2c23 44 07 ; room &07 to west &2c25 90 0a 46 ; room &0a visible through wooden fence to south ; room_03_data &2c28 00 ; regular room &2c29 83 ; description has 3 words, room has 4 exits &2c2a 50 3a bd ; "by a spring" &2c2d 44 04 ; room &04 to west &2c2f e0 11 08 ; room &11 via mountain path to north &2c32 e4 08 00 ; room &08 via forest path to northwest &2c35 50 98 ; room &98 to south ; room_04_data &2c37 00 ; regular room &2c38 84 ; description has 4 words, room has 4 exits &2c39 50 3a be bf ; "by a babbling brook" &2c3d 60 08 ; room &08 to north &2c3f d0 01 00 ; room &01 via forest path to south &2c42 48 03 ; room &03 to east &2c44 c4 05 00 ; room &05 via forest path to west ; room_05_data &2c47 00 ; regular room &2c48 83 ; description has 3 words, room has 4 exits &2c49 44 3a c0 ; "in a clearing" &2c4c e0 09 00 ; room &09 via forest path to north &2c4f c8 04 00 ; room &04 via forest path to east &2c52 50 02 ; room &02 to south &2c54 81 36 a1 ; room &36 visible through locked brass grate to down ; room_06_data &2c57 00 ; regular room &2c58 68 ; description has 8 words, room has 3 exits &2c59 49 5d c1 6b 3a b0 c2 c3 ; "at the top of a steep scree slope" &2c61 44 07 ; room &07 to west &2c63 60 0b ; room &0b to north &2c65 e8 0a 00 ; room &0a via forest path to northeast ; room_08_data &2c68 00 ; regular room &2c69 84 ; description has 4 words, room has 4 exits &2c6a 50 3a 75 c4 ; "by a small stream" &2c6e 44 09 ; room &09 to west &2c70 50 04 ; room &04 to south &2c72 d8 03 00 ; room &03 via forest path to southeast &2c75 e0 0c 00 ; room &0c via forest path to north ; room_09_data &2c78 00 ; regular room &2c79 83 ; description has 3 words, room has 4 exits &2c7a 50 3a c4 ; "by a stream" &2c7d 60 0d ; room &0d to north &2c7f 48 08 ; room &08 to east &2c81 d0 05 00 ; room &05 via forest path to south &2c84 c4 0a 00 ; room &0a via forest path to west ; room_0a_data &2c87 04 ; special room type 4 ("forest") &2c88 80 ; special description ("wandering through the woods"), room has 4 exits &2c89 60 17 ; room &17 to north &2c8b 54 06 ; room &06 to southwest &2c8d 48 09 ; room &09 to east &2c8f 68 16 ; room &16 to northeast ; room_0b_data &2c91 00 ; regular room &2c92 86 ; description has 6 words, room has 4 exits &2c93 1a 3a c5 6b c6 c7 ; "on a pile of jagged rocks" &2c99 50 07 ; room &07 to south &2c9b 48 06 ; room &06 to east &2c9d e0 0e 00 ; room &0e via forest path to north &2ca0 c4 0f 00 ; room &0f via forest path to west ; room_0c_data &2ca3 04 ; special room type 4 ("forest") &2ca4 60 ; special description ("wandering through the woods"), room has 3 exits &2ca5 50 08 ; room &08 to south &2ca7 44 0d ; room &0d to west &2ca9 60 12 ; room &12 to north ; room_0d_data &2cab 00 ; regular room &2cac 64 ; description has 4 words, room has 3 exits &2cad 50 3a 9a c8 ; "by a narrow river" &2cb1 60 13 ; room &13 to north &2cb3 50 09 ; room &09 to south &2cb5 c8 0c 00 ; room &0c via forest path to east ; room_0e_data &2cb8 04 ; special room type 4 ("forest") &2cb9 80 ; special description ("wandering through the woods"), room has 4 exits &2cba 54 0f ; room &0f to southwest &2cbc 50 0b ; room &0b to south &2cbe 68 17 ; room &17 to northeast &2cc0 60 19 ; room &19 to north ; room_0f_data &2cc2 05 ; special room type 5 ("forest") &2cc3 60 ; special description ("wandering through dense forest"), room has 3 exits &2cc4 44 86 ; room &86 to west &2cc6 48 0b ; room &0b to east &2cc8 68 0e ; room &0e to northeast ; room_10_data &2cca 05 ; special room type 5 ("forest") &2ccb 40 ; special description ("wandering through dense forest"), room has 2 exits &2ccc 48 19 ; room &19 to east &2cce 44 85 ; room &85 to west ; room_11_data &2cd0 03 ; special room type 3 ("a mountain range") &2cd1 40 ; special description ("wandering through high mountains"), room has 2 exits &2cd2 48 a0 ; room &a0 to east &2cd4 50 03 ; room &03 to south ; room_12_data &2cd6 00 ; regular room &2cd7 64 ; description has 4 words, room has 3 exits &2cd8 44 3a c9 ca ; "in a pleasant wood" &2cdc c4 13 00 ; room &13 via forest path to west &2cdf 48 11 ; room &11 to east &2ce1 d0 0c 00 ; room &0c via forest path to south ; room_13_data &2ce4 00 ; regular room &2ce5 84 ; description has 4 words, room has 4 exits &2ce6 50 3a 51 c8 ; "by a deep river" &2cea 60 15 ; room &15 to north &2cec e4 16 00 ; room &16 via forest path to northwest &2cef 50 0d ; room &0d to south &2cf1 c8 12 00 ; room &12 via forest path to east ; room_14_data &2cf4 03 ; special room type 3 ("a mountain range") &2cf5 40 ; special description ("wandering through high mountains"), room has 2 exits &2cf6 58 11 ; room &11 to southeast &2cf8 60 ab ; room &ab to north ; room_15_data &2cfa 00 ; regular room &2cfb 86 ; description has 6 words, room has 4 exits &2cfc 49 5d c1 6b 3a cb ; "at the top of a waterfall" &2d02 60 37 ; room &37 to north &2d04 44 16 ; room &16 to west &2d06 50 13 ; room &13 to south &2d08 c8 14 08 ; room &14 via mountain path to east ; room_16_data &2d0b 00 ; regular room &2d0c a4 ; description has 4 words, room has 5 exits &2d0d 50 3a b4 c1 ; "by a cliff top" &2d11 60 33 ; room &33 to north &2d13 c4 17 00 ; room &17 via forest path to west &2d16 d4 0a 00 ; room &0a via forest path to southwest &2d19 d8 13 00 ; room &13 via forest path to southeast &2d1c 48 15 ; room &15 to east ; room_17_data &2d1e 00 ; regular room &2d1f a7 ; description has 7 words, room has 5 exits &2d20 49 5d 25 6b 3a cc cd ; "at the end of a winding trail" &2d27 d0 0a 00 ; room &0a via forest path to south &2d2a 61 18 ; room &18 to north and down &2d2c e4 19 00 ; room &19 via forest path to northwest &2d2f d4 0e 00 ; room &0e via forest path to southwest &2d32 48 16 ; room &16 to east ; room_18_data &2d34 00 ; regular room &2d35 65 ; description has 5 words, room has 3 exits &2d36 1a 3a ce a4 cd ; "on a steeply sloping trail" &2d3b 50 35 ; room &35 to south &2d3d 4a 17 ; room &17 to east and up &2d3f 61 1d ; room &1d to north and down ; room_19_data &2d41 00 ; regular room &2d42 88 ; description has 8 words, room has 4 exits &2d43 1a 5d 01 cf 6b 3a 51 d0 ; "on the south edge of a deep fissure" &2d4b 60 33 ; room &33 to north &2d4d c4 10 00 ; room &10 via forest path to west &2d50 d0 0e 00 ; room &0e via forest path to south &2d53 d8 17 00 ; room &17 via forest path to southeast ; room_1a_data &2d56 40 ; regular room, magically dark &2d57 06 ; description has 6 words, room has 0 exits &2d58 44 3a 51 d1 d2 d3 ; "in a deep crocodile infested pool" ; room_1b_data &2d5e 02 ; special room type 2 ("the canyon floor") &2d5f 4b ; description has 11 words, room has 2 exits &2d60 16 50 3a 73 9c 39 d4 1a 5d a1 56 ; "close by a large rock, sitting on the canyon floor" &2d6b 48 1a ; room &1a to east &2d6d 44 1c ; room &1c to west ; room_1c_data &2d6f 02 ; special room type 2 ("the canyon floor") &2d70 4f ; description has 15 words, room has 2 exits &2d71 44 3a 51 a1 39 43 5d 02 3e 3a d5 28 6b 3a cb ; "in a deep canyon, to the east is a grand view of a waterfall" &2d80 48 1b ; room &1b to east &2d82 44 1d ; room &1d to west ; room_1d_data &2d84 02 ; special room type 2 ("the canyon floor") &2d85 60 ; special description ("on the canyon floor"), room has 3 exits &2d86 44 1e ; room &1e to west &2d88 48 1c ; room &1c to east &2d8a 52 18 ; room &18 to south and up ; room_1e_data &2d8c 02 ; special room type 2 ("the canyon floor") &2d8d 47 ; description has 7 words, room has 2 exits &2d8e 49 5d 03 25 6b 5d a1 ; "at the west end of the canyon" &2d95 44 1f ; room &1f to west &2d97 48 1d ; room &1d to east ; room_1f_data &2d99 00 ; regular room &2d9a 45 ; description has 5 words, room has 2 exits &2d9b 44 3a 4a 9a d0 ; "in a very narrow fissure" &2da0 48 1e ; room &1e to east &2da2 44 87 ; room &87 to west ; room_20_data &2da4 00 ; regular room &2da5 64 ; description has 4 words, room has 3 exits &2da6 50 3a b4 c1 ; "by a cliff top" &2daa 50 33 ; room &33 to south &2dac 64 24 ; room &24 to northwest &2dae 44 21 ; room &21 to west ; room_21_data &2db0 00 ; regular room &2db1 87 ; description has 7 words, room has 4 exits &2db2 43 5d 00 6b 3a 51 a1 ; "to the north of a deep canyon" &2db9 50 33 ; room &33 to south &2dbb 48 20 ; room &20 to east &2dbd 44 22 ; room &22 to west &2dbf 60 25 ; room &25 to north ; room_22_data &2dc1 00 ; regular room &2dc2 84 ; description has 4 words, room has 4 exits &2dc3 50 3a b4 c1 ; "by a cliff top" &2dc7 50 33 ; room &33 to south &2dc9 48 21 ; room &21 to east &2dcb 44 23 ; room &23 to west &2dcd 60 26 ; room &26 to north ; room_23_data &2dcf 00 ; regular room &2dd0 87 ; description has 7 words, room has 4 exits &2dd1 1a 5d cf 6b 3a 51 d0 ; "on the edge of a deep fissure" &2dd8 50 33 ; room &33 to south &2dda 48 22 ; room &22 to east &2ddc 68 27 ; room &27 to northeast &2dde 64 2d ; room &2d to northwest ; room_24_data &2de0 07 ; special room type 7 ("desert") &2de1 60 ; special description ("in an arid desert"), room has 3 exits &2de2 60 2a ; room &2a to north &2de4 44 25 ; room &25 to west &2de6 58 20 ; room &20 to southeast ; room_25_data &2de8 07 ; special room type 7 ("desert") &2de9 80 ; special description ("in an arid desert"), room has 4 exits &2dea 60 28 ; room &28 to north &2dec 44 26 ; room &26 to west &2dee 48 24 ; room &24 to east &2df0 50 21 ; room &21 to south ; room_26_data &2df2 07 ; special room type 7 ("desert") &2df3 80 ; special description ("in an arid desert"), room has 4 exits &2df4 68 28 ; room &28 to northeast &2df6 64 27 ; room &27 to northwest &2df8 54 22 ; room &22 to southwest &2dfa 48 25 ; room &25 to east ; room_27_data &2dfc 07 ; special room type 7 ("desert") &2dfd a0 ; special description ("in an arid desert"), room has 5 exits &2dfe 68 2b ; room &2b to northeast &2e00 60 2c ; room &2c to north &2e02 44 2d ; room &2d to west &2e04 54 23 ; room &23 to southwest &2e06 58 26 ; room &26 to southeast ; room_28_data &2e08 00 ; regular room &2e09 a7 ; description has 7 words, room has 5 exits &2e0a 44 5d 52 ae d6 5d 87 ; "in the desert which surrounds the castle" &2e11 60 29 ; room &29 to north &2e13 64 2b ; room &2b to northwest &2e15 54 26 ; room &26 to southwest &2e17 50 25 ; room &25 to south &2e19 68 2a ; room &2a to northeast ; room_29_data &2e1b 00 ; regular room &2e1c 44 ; description has 4 words, room has 2 exits &2e1d 1a 5d 2a 57 ; "on the draw bridge" &2e21 60 34 ; room &34 to north &2e23 50 28 ; room &28 to south ; room_2a_data &2e25 07 ; special room type 7 ("desert") &2e26 a0 ; special description ("in an arid desert"), room has 5 exits &2e27 44 32 ; room &32 to west &2e29 54 28 ; room &28 to southwest &2e2b 50 24 ; room &24 to south &2e2d c8 30 08 ; room &30 via mountain path to east &2e30 64 2e ; room &2e to northwest ; room_2b_data &2e32 07 ; special room type 7 ("desert") &2e33 a0 ; special description ("in an arid desert"), room has 5 exits &2e34 48 32 ; room &32 to east &2e36 68 2e ; room &2e to northeast &2e38 58 28 ; room &28 to southeast &2e3a 44 2c ; room &2c to west &2e3c 54 27 ; room &27 to southwest ; room_2c_data &2e3e 07 ; special room type 7 ("desert") &2e3f 80 ; special description ("in an arid desert"), room has 4 exits &2e40 48 2b ; room &2b to east &2e42 60 2f ; room &2f to north &2e44 44 80 ; room &80 to west &2e46 50 27 ; room &27 to south ; room_2d_data &2e48 07 ; special room type 7 ("desert") &2e49 80 ; special description ("in an arid desert"), room has 4 exits &2e4a 60 80 ; room &80 to north &2e4c 44 81 ; room &81 to west &2e4e 50 23 ; room &23 to south &2e50 48 27 ; room &27 to east ; room_2e_data &2e52 00 ; regular room &2e53 a6 ; description has 6 words, room has 5 exits &2e54 49 5d d7 6b 5d 87 ; "at the back of the castle" &2e5a 50 32 ; room &32 to south &2e5c 44 2f ; room &2f to west &2e5e 54 2b ; room &2b to southwest &2e60 58 2a ; room &2a to southeast &2e62 e0 30 08 ; room &30 via mountain path to north ; room_2f_data &2e65 07 ; special room type 7 ("desert") &2e66 80 ; special description ("in an arid desert"), room has 4 exits &2e67 48 2e ; room &2e to east &2e69 44 80 ; room &80 to west &2e6b 50 2c ; room &2c to south &2e6d e0 30 08 ; room &30 via mountain path to north ; room_30_data &2e70 03 ; special room type 3 ("a mountain range") &2e71 60 ; special description ("wandering through high mountains"), room has 3 exits &2e72 60 30 ; room &30 to north &2e74 51 2e ; room &2e to south and down &2e76 44 8a ; room &8a to west ; room_31_data &2e78 03 ; special room type 3 ("a mountain range") &2e79 60 ; special description ("wandering through high mountains"), room has 3 exits &2e7a 48 11 ; room &11 to east &2e7c 60 31 ; room &31 to north &2e7e 54 30 ; room &30 to southwest ; room_32_data &2e80 60 ; regular room, magically dark, suppress exits &2e81 03 ; description has 3 words, room has 0 exits &2e82 44 5d d8 ; "in the moat" ; room_33_data &2e85 60 ; regular room, magically dark, suppress exits &2e86 05 ; description has 5 words, room has 0 exits &2e87 d9 05 3a da 9d ; "diving down a dangerous fall" ; room_37_data &2e8c 60 ; regular room, magically dark, suppress exits &2e8d 06 ; description has 6 words, room has 0 exits &2e8e d9 05 3a 73 6c 9d ; "diving down a large water fall" ; room_07_data &2e94 09 ; special room type 1 ("a disused quarry"), no picture direction &2e95 2e ; description has 14 words, room has 1 exit &2e96 44 3a 9f 33 a0 39 73 b7 6b 69 86 5d db bc ; "in a disused flint quarry, large blocks of stone dwarf the twisty road" &2ea4 58 02 ; room &02 to southeast ; room_34_data &2ea6 00 ; regular room &2ea7 a5 ; description has 5 words, room has 5 exits &2ea8 44 5d 87 dc dd ; "in the castle entrance hall" &2ead 62 3a ; room &3a to north and up &2eaf c8 39 47 ; room &39 visible through stone archway to east &2eb2 41 41 ; room &41 to down &2eb4 c4 38 47 ; room &38 visible through stone archway to west &2eb7 50 29 ; room &29 to south ; room_35_data &2eb9 80 ; regular room, dark &2eba 83 ; description has 3 words, room has 4 exits &2ebb 44 3a de ; "in a cave" &2ebe 88 67 c3 ; room &67 via locked metal door to east &2ec1 60 18 ; room &18 to north &2ec3 41 66 ; room &66 to down &2ec5 44 6d ; room &6d to west ; room_36_data &2ec7 80 ; regular room, dark &2ec8 44 ; description has 4 words, room has 2 exits &2ec9 44 3a 9a a3 ; "in a narrow passage" &2ecd 61 6c ; room &6c to north and down &2ecf 92 05 a1 ; room &05 visible through locked brass grate to south and up ; room_38_data &2ed2 08 ; regular room, no picture direction &2ed3 43 ; description has 3 words, room has 2 exits &2ed4 44 5d df ; "in the study" &2ed7 e0 3c 4e ; room &3c visible through wooden door way to north &2eda c8 34 47 ; room &34 visible through stone archway to east ; room_39_data &2edd 08 ; regular room, no picture direction &2ede 44 ; description has 4 words, room has 2 exits &2edf 44 5d e0 dd ; "in the dining hall" &2ee3 c4 34 47 ; room &34 visible through stone archway to west &2ee6 e4 3b 4e ; room &3b visible through wooden door way to northwest ; room_3a_data &2ee9 00 ; regular room &2eea 46 ; description has 6 words, room has 2 exits &2eeb 1a 5d ff d5 ff 93 ; "on the Grand Staircase" &2ef1 42 58 ; room &58 to up &2ef3 41 34 ; room &34 to down ; room_3b_data &2ef5 08 ; regular room, no picture direction &2ef6 43 ; description has 3 words, room has 2 exits &2ef7 44 3a e1 ; "in a kitchen" &2efa d8 39 4e ; room &39 visible through wooden door way to southeast &2efd c4 3c 4e ; room &3c visible through wooden door way to west ; room_3c_data &2f00 08 ; regular room, no picture direction &2f01 43 ; description has 3 words, room has 2 exits &2f02 44 3a e2 ; "in a workshop" &2f05 c8 3b 4e ; room &3b visible through wooden door way to east &2f08 d0 38 4e ; room &38 visible through wooden door way to south ; room_3d_data &2f0b 80 ; regular room, dark &2f0c 24 ; description has 4 words, room has 1 exit &2f0d 44 5d e3 40 ; "in the store room" &2f11 48 3e ; room &3e to east ; room_3e_data &2f13 80 ; regular room, dark &2f14 63 ; description has 3 words, room has 3 exits &2f15 44 3a a3 ; "in a passage" &2f18 48 3f ; room &3f to east &2f1a 44 3d ; room &3d to west &2f1c 50 40 ; room &40 to south ; room_3f_data &2f1e 80 ; regular room, dark &2f1f 23 ; description has 3 words, room has 1 exit &2f20 44 5d e4 ; "in the cellar" &2f23 44 3e ; room &3e to west ; room_40_data &2f25 80 ; regular room, dark &2f26 43 ; description has 3 words, room has 2 exits &2f27 44 3a a3 ; "in a passage" &2f2a 60 3e ; room &3e to north &2f2c 44 41 ; room &41 to west ; room_41_data &2f2e 80 ; regular room, dark &2f2f 63 ; description has 3 words, room has 3 exits &2f30 44 3a a3 ; "in a passage" &2f33 48 42 ; room &42 to east &2f35 60 40 ; room &40 to north &2f37 42 34 ; room &34 to up ; room_42_data &2f39 80 ; regular room, dark &2f3a 44 ; description has 4 words, room has 2 exits &2f3b 44 3a 9a a3 ; "in a narrow passage" &2f3f 48 43 ; room &43 to east &2f41 44 41 ; room &41 to west ; room_43_data &2f43 80 ; regular room, dark &2f44 45 ; description has 5 words, room has 2 exits &2f45 44 3a 4a 9a a3 ; "in a very narrow passage" &2f4a 44 42 ; room &42 to west &2f4c 48 44 ; room &44 to east ; room_44_data &2f4e 80 ; regular room, dark &2f4f 44 ; description has 4 words, room has 2 exits &2f50 44 3a 75 40 ; "in a small room" &2f54 44 43 ; room &43 to west &2f56 c1 48 10 ; room &48 via spiral staircase to down ; room_45_data &2f59 88 ; regular room, dark, no picture direction &2f5a 24 ; description has 4 words, room has 1 exit &2f5b 44 5d 55 40 ; "in the guard room" &2f5f d0 48 4e ; room &48 visible through wooden door way to south ; room_46_data &2f62 80 ; regular room, dark &2f63 43 ; description has 3 words, room has 2 exits &2f64 44 5d e5 ; "in the armoury" &2f67 88 47 c4 ; room &47 via locked silver door to east &2f6a 98 65 48 ; room &65 visible through narrow crack to southeast ; room_47_data &2f6d 80 ; regular room, dark &2f6e 43 ; description has 3 words, room has 2 exits &2f6f 44 3a a3 ; "in a passage" &2f72 84 46 c4 ; room &46 via locked silver door to west &2f75 48 48 ; room &48 to east ; room_48_data &2f77 88 ; regular room, dark, no picture direction &2f78 c4 ; description has 4 words, room has 6 exits &2f79 44 3a 73 dd ; "in a large hall" &2f7d 44 47 ; room &47 to west &2f7f e0 45 4e ; room &45 visible through wooden door way to north &2f82 90 49 c1 ; room &49 via locked brass door to south &2f85 c2 44 10 ; room &44 via spiral staircase to up &2f88 58 4a ; room &4a to southeast &2f8a 54 65 ; room &65 to southwest ; room_49_data &2f8c 80 ; regular room, dark &2f8d 24 ; description has 4 words, room has 1 exit &2f8e 44 3a e6 e7 ; "in a musty dungeon" &2f92 a0 48 c1 ; room &48 via locked brass door to north ; room_4a_data &2f95 88 ; regular room, dark, no picture direction &2f96 44 ; description has 4 words, room has 2 exits &2f97 44 3a e8 e9 ; "in a pokey anteroom" &2f9b 64 48 ; room &48 to northwest &2f9d c1 4c 1e ; room &4c via wooden trap door to down ; room_4b_data &2fa0 80 ; regular room, dark &2fa1 23 ; description has 3 words, room has 1 exit &2fa2 44 3a e7 ; "in a dungeon" &2fa5 90 4c c2 ; room &4c via locked bronze door to south ; room_4c_data &2fa8 88 ; regular room, dark, no picture direction &2fa9 64 ; description has 4 words, room has 3 exits &2faa 44 3a ea dd ; "in a damp hall" &2fae a0 4b c2 ; room &4b via locked bronze door to north &2fb1 44 4d ; room &4d to west &2fb3 c2 4a 1e ; room &4a via wooden trap door to up ; room_4d_data &2fb6 80 ; regular room, dark &2fb7 63 ; description has 3 words, room has 3 exits &2fb8 44 3a 40 ; "in a room" &2fbb 90 61 c5 ; room &61 via locked gold door to south &2fbe 48 aa ; room &aa to east &2fc0 60 4c ; room &4c to north ; room_4e_data &2fc2 00 ; regular room &2fc3 24 ; description has 4 words, room has 1 exit &2fc4 44 5d 00 eb ; "in the north turret" &2fc8 c1 53 10 ; room &53 via spiral staircase to down ; room_4f_data &2fcb 00 ; regular room &2fcc 24 ; description has 4 words, room has 1 exit &2fcd 44 5d 03 eb ; "in the west turret" &2fd1 c1 52 10 ; room &52 via spiral staircase to down ; room_50_data &2fd4 00 ; regular room &2fd5 24 ; description has 4 words, room has 1 exit &2fd6 44 5d 01 eb ; "in the south turret" &2fda c1 54 10 ; room &54 via spiral staircase to down ; room_51_data &2fdd 00 ; regular room &2fde 24 ; description has 4 words, room has 1 exit &2fdf 44 5d 02 eb ; "in the east turret" &2fe3 c1 55 10 ; room &55 via spiral staircase to down ; room_52_data &2fe6 00 ; regular room &2fe7 44 ; description has 4 words, room has 2 exits &2fe8 44 5d 03 ec ; "in the west tower" &2fec c2 4f 10 ; room &4f via spiral staircase to up &2fef 88 59 c4 ; room &59 via locked silver door to east ; room_53_data &2ff2 00 ; regular room &2ff3 44 ; description has 4 words, room has 2 exits &2ff4 44 5d 00 ec ; "in the north tower" &2ff8 c2 4e 10 ; room &4e via spiral staircase to up &2ffb 50 58 ; room &58 to south ; room_54_data &2ffd 00 ; regular room &2ffe 44 ; description has 4 words, room has 2 exits &2fff 44 5d 01 ec ; "in the south tower" &3003 c2 50 10 ; room &50 via spiral staircase to up &3006 a0 5d c0 ; room &5d via locked door to north ; room_55_data &3009 00 ; regular room &300a 44 ; description has 4 words, room has 2 exits &300b 44 5d 02 ec ; "in the east tower" &300f c2 51 10 ; room &51 via spiral staircase to up &3012 44 5a ; room &5a to west ; room_56_data &3014 08 ; regular room, no picture direction &3015 23 ; description has 3 words, room has 1 exit &3016 44 3a 40 ; "in a room" &3019 50 59 ; room &59 to south ; room_57_data &301b 08 ; regular room, no picture direction &301c 24 ; description has 4 words, room has 1 exit &301d 44 5d ed 40 ; "in the throne room" &3021 d0 5a 48 ; room &5a visible through door way to south ; room_58_data &3024 00 ; regular room &3025 83 ; description has 3 words, room has 4 exits &3026 1a 5d ee ; "on the landing" &3029 60 53 ; room &53 to north &302b 58 5a ; room &5a to southeast &302d 54 59 ; room &59 to southwest &302f 41 3a ; room &3a to down ; room_59_data &3031 00 ; regular room &3032 83 ; description has 3 words, room has 4 exits &3033 44 3a ef ; "in a corridor" &3036 84 52 c4 ; room &52 via locked silver door to west &3039 e0 56 4e ; room &56 visible through wooden door way to north &303c 68 58 ; room &58 to northeast &303e 58 5d ; room &5d to southeast ; room_5a_data &3040 00 ; regular room &3041 a3 ; description has 3 words, room has 5 exits &3042 44 3a ef ; "in a corridor" &3045 48 55 ; room &55 to east &3047 e0 57 48 ; room &57 visible through door way to north &304a d0 5c 4e ; room &5c visible through wooden door way to south &304d 64 58 ; room &58 to northwest &304f 54 5d ; room &5d to southwest ; room_5b_data &3051 08 ; regular room, no picture direction &3052 24 ; description has 4 words, room has 1 exit &3053 44 5d f0 f1 ; "in the royal bedroom" &3057 c8 5d 4e ; room &5d visible through wooden door way to east &305a e0 59 27 ; room &59 via stone secret door to north ; room_5c_data &305d 08 ; regular room, no picture direction &305e 23 ; description has 3 words, room has 1 exit &305f 44 3a f1 ; "in a bedroom" &3062 60 5a ; room &5a to north ; room_5d_data &3064 00 ; regular room &3065 63 ; description has 3 words, room has 3 exits &3066 44 3a ef ; "in a corridor" &3069 90 54 c0 ; room &54 via locked door to south &306c c4 5b 4e ; room &5b visible through wooden door way to west &306f 68 5a ; room &5a to northeast ; room_5e_data &3071 88 ; regular room, dark, no picture direction &3072 44 ; description has 4 words, room has 2 exits &3073 44 3a 75 f1 ; "in a small bedroom" &3077 68 5f ; room &5f to northeast &3079 58 60 ; room &60 to southeast &307b c4 8b 20 ; room &8b via secret door to west ; room_60_data &307e 88 ; regular room, dark, no picture direction &307f 44 ; description has 4 words, room has 2 exits &3080 44 3a 75 e1 ; "in a small kitchen" &3084 60 5f ; room &5f to north &3086 54 5e ; room &5e to southwest ; room_5f_data &3088 88 ; regular room, dark, no picture direction &3089 45 ; description has 5 words, room has 2 exits &308a 44 3a 75 d4 40 ; "in a small sitting room" &308f 44 5e ; room &5e to west &3091 50 60 ; room &60 to south &3093 c8 61 20 ; room &61 via secret door to east ; room_61_data &3096 80 ; regular room, dark &3097 45 ; description has 5 words, room has 2 exits &3098 44 3a 77 4b a3 ; "in a long dry passage" &309d a0 4d c5 ; room &4d via locked gold door to north &30a0 50 62 ; room &62 to south &30a2 c4 5f 20 ; room &5f via secret door to west ; room_62_data &30a5 80 ; regular room, dark &30a6 44 ; description has 4 words, room has 2 exits &30a7 44 3a f2 a3 ; "in a wet passage" &30ab 60 61 ; room &61 to north &30ad 50 63 ; room &63 to south ; room_63_data &30af 80 ; regular room, dark &30b0 45 ; description has 5 words, room has 2 exits &30b1 44 3a f3 e6 a3 ; "in a dank musty passage" &30b6 50 64 ; room &64 to south &30b8 60 62 ; room &62 to north ; room_64_data &30ba 80 ; regular room, dark &30bb 45 ; description has 5 words, room has 2 exits &30bc 44 3a ea f4 f5 ; "in a damp hollow chamber" &30c1 60 63 ; room &63 to north &30c3 42 66 ; room &66 to up ; room_65_data &30c5 80 ; regular room, dark &30c6 43 ; description has 3 words, room has 2 exits &30c7 44 3a e7 ; "in a dungeon" &30ca 68 48 ; room &48 to northeast &30cc 84 46 48 ; room &46 visible through narrow crack to west ; room_66_data &30cf 80 ; regular room, dark &30d0 44 ; description has 4 words, room has 2 exits &30d1 44 3a 9a f6 ; "in a narrow shaft" &30d5 42 35 ; room &35 to up &30d7 41 64 ; room &64 to down ; room_67_data &30d9 80 ; regular room, dark &30da 63 ; description has 3 words, room has 3 exits &30db 44 3a a3 ; "in a passage" &30de 84 35 c3 ; room &35 via locked metal door to west &30e1 51 71 ; room &71 to south and down &30e3 48 68 ; room &68 to east ; room_68_data &30e5 80 ; regular room, dark &30e6 63 ; description has 3 words, room has 3 exits &30e7 44 3a 40 ; "in a room" &30ea 88 69 c2 ; room &69 via locked bronze door to east &30ed 44 67 ; room &67 to west &30ef 50 6c ; room &6c to south ; room_69_data &30f1 88 ; regular room, dark, no picture direction &30f2 43 ; description has 3 words, room has 2 exits &30f3 1a 3a ee ; "on a landing" &30f6 41 6a ; room &6a to down &30f8 84 68 c2 ; room &68 via locked bronze door to west ; room_6a_data &30fb 80 ; regular room, dark &30fc 44 ; description has 4 words, room has 2 exits &30fd 1a 3a 92 93 ; "on a spiral staircase" &3101 42 69 ; room &69 to up &3103 41 6b ; room &6b to down ; room_6b_data &3105 80 ; regular room, dark &3106 24 ; description has 4 words, room has 1 exit &3107 44 3a 75 f5 ; "in a small chamber" &310b 42 6a ; room &6a to up ; room_6c_data &310d 80 ; regular room, dark &310e 43 ; description has 3 words, room has 2 exits &310f 44 3a 40 ; "in a room" &3112 52 36 ; room &36 to south and up &3114 60 68 ; room &68 to north ; room_6d_data &3116 88 ; regular room, dark, no picture direction &3117 4d ; description has 13 words, room has 2 exits &3118 44 ff 5d ff dd ff 6b ff 5d ff 4e ff 4f ; "in The Hall Of The Forest King" &3125 51 6e ; room &6e to south and down &3127 48 35 ; room &35 to east ; room_6e_data &3129 80 ; regular room, dark &312a 44 ; description has 4 words, room has 2 exits &312b 44 3a 9a f6 ; "in a narrow shaft" &312f 62 6d ; room &6d to north and up &3131 41 6f ; room &6f to down ; room_6f_data &3133 88 ; regular room, dark, no picture direction &3134 46 ; description has 6 words, room has 2 exits &3135 44 3a 40 47 6b f7 ; "in a room full of bones" &313b 42 6e ; room &6e to up &313d 50 70 ; room &70 to south &313f 84 b0 cc ; room &b0 via locked silver secret door to west ; room_70_data &3142 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &3143 48 ; description has 8 words, room has 2 exits &3144 44 3a db f8 f9 a5 6b fa ; "in a twisty turny little maze of passages" &314c 50 73 ; room &73 to south &314e 44 72 ; room &72 to west ; room_71_data &3150 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &3151 48 ; description has 8 words, room has 2 exits &3152 44 3a f8 db f9 a5 6b fa ; "in a turny twisty little maze of passages" &315a 60 74 ; room &74 to north &315c 50 70 ; room &70 to south ; room_72_data &315e e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &315f 48 ; description has 8 words, room has 2 exits &3160 44 3a f9 f8 db a5 6b fa ; "in a little turny twisty maze of passages" &3168 50 75 ; room &75 to south &316a 48 70 ; room &70 to east ; room_73_data &316c e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &316d 48 ; description has 8 words, room has 2 exits &316e 44 3a f9 db f8 a5 6b fa ; "in a little twisty turny maze of passages" &3176 50 74 ; room &74 to south &3178 60 71 ; room &71 to north ; room_74_data &317a e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &317b 28 ; description has 8 words, room has 1 exit &317c 44 3a a5 6b db f8 f9 fa ; "in a maze of twisty turny little passages" &3184 48 77 ; room &77 to east ; room_75_data &3186 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &3187 48 ; description has 8 words, room has 2 exits &3188 44 3a a5 6b f8 db f9 fa ; "in a maze of turny twisty little passages" &3190 60 76 ; room &76 to north &3192 48 78 ; room &78 to east ; room_76_data &3194 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &3195 48 ; description has 8 words, room has 2 exits &3196 44 3a a5 6b f9 db f8 fa ; "in a maze of little twisty turny passages" &319e 60 77 ; room &77 to north &31a0 50 78 ; room &78 to south ; room_77_data &31a2 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &31a3 48 ; description has 8 words, room has 2 exits &31a4 44 3a a5 6b f9 f8 db fa ; "in a maze of little turny twisty passages" &31ac 50 76 ; room &76 to south &31ae 44 78 ; room &78 to west ; room_78_data &31b0 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &31b1 68 ; description has 8 words, room has 3 exits &31b2 44 3a db f9 a3 44 3a a5 ; "in a twisty little passage in a maze" &31ba 50 7a ; room &7a to south &31bc 44 79 ; room &79 to west &31be 48 7b ; room &7b to east ; room_79_data &31c0 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &31c1 48 ; description has 8 words, room has 2 exits &31c2 44 3a db f8 a3 44 3a a5 ; "in a twisty turny passage in a maze" &31ca 60 78 ; room &78 to north &31cc 44 7c ; room &7c to west ; room_7a_data &31ce e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &31cf 48 ; description has 8 words, room has 2 exits &31d0 44 3a f9 db a3 44 3a a5 ; "in a little twisty passage in a maze" &31d8 50 79 ; room &79 to south &31da 48 78 ; room &78 to east ; room_7b_data &31dc e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &31dd 48 ; description has 8 words, room has 2 exits &31de 44 3a f9 f8 a3 44 3a a5 ; "in a little turny passage in a maze" &31e6 50 7a ; room &7a to south &31e8 48 7d ; room &7d to east ; room_7c_data &31ea e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &31eb 28 ; description has 8 words, room has 1 exit &31ec 44 3a f8 db a3 44 3a a5 ; "in a turny twisty passage in a maze" &31f4 44 7e ; room &7e to west ; room_7d_data &31f6 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &31f7 48 ; description has 8 words, room has 2 exits &31f8 44 3a f8 f9 a3 44 3a a5 ; "in a turny little passage in a maze" &3200 44 7e ; room &7e to west &3202 50 7f ; room &7f to south ; room_7e_data &3204 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &3205 48 ; description has 8 words, room has 2 exits &3206 44 3a a3 44 3a db f8 a5 ; "in a passage in a twisty turny maze" &320e 60 7a ; room &7a to north &3210 50 6f ; room &6f to south ; room_7f_data &3212 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &3213 48 ; description has 8 words, room has 2 exits &3214 44 3a a3 44 3a f8 db a5 ; "in a passage in a turny twisty maze" &321c 50 7e ; room &7e to south &321e 60 67 ; room &67 to north ; room_80_data &3220 07 ; special room type 7 ("desert") &3221 80 ; special description ("in an arid desert"), room has 4 exits &3222 62 8a ; room &8a to north and up &3224 44 82 ; room &82 to west &3226 50 2d ; room &2d to south &3228 48 2c ; room &2c to east ; room_81_data &322a 07 ; special room type 7 ("desert") &322b 60 ; special description ("in an arid desert"), room has 3 exits &322c 60 82 ; room &82 to north &322e 44 84 ; room &84 to west &3230 48 2d ; room &2d to east ; room_82_data &3232 0f ; special room type 7 ("desert"), no picture direction &3233 60 ; special description ("in an arid desert"), room has 3 exits &3234 44 83 ; room &83 to west &3236 50 81 ; room &81 to south &3238 48 80 ; room &80 to east ; room_83_data &323a 08 ; regular room, no picture direction &323b 44 ; description has 4 words, room has 2 exits &323c 1a 3a b4 c1 ; "on a cliff top" &3240 50 84 ; room &84 to south &3242 48 82 ; room &82 to east ; room_84_data &3244 08 ; regular room, no picture direction &3245 44 ; description has 4 words, room has 2 exits &3246 1a 3a b4 c1 ; "on a cliff top" &324a 48 81 ; room &81 to east &324c 60 83 ; room &83 to north ; room_85_data &324e 08 ; regular room, no picture direction &324f 44 ; description has 4 words, room has 2 exits &3250 1a 3a b4 c1 ; "on a cliff top" &3254 50 86 ; room &86 to south &3256 48 10 ; room &10 to east ; room_86_data &3258 08 ; regular room, no picture direction &3259 64 ; description has 4 words, room has 3 exits &325a 1a 3a b4 c1 ; "on a cliff top" &325e 48 0f ; room &0f to east &3260 60 85 ; room &85 to north &3262 50 a6 ; room &a6 to south ; room_87_data &3264 00 ; regular room &3265 44 ; description has 4 words, room has 2 exits &3266 44 3a 9a d0 ; "in a narrow fissure" &326a 48 1f ; room &1f to east &326c 44 88 ; room &88 to west ; room_88_data &326e 00 ; regular room &326f 64 ; description has 4 words, room has 3 exits &3270 44 3a 9a d0 ; "in a narrow fissure" &3274 44 89 ; room &89 to west &3276 48 87 ; room &87 to east &3278 61 8b ; room &8b to north and down ; room_89_data &327a 08 ; regular room, no picture direction &327b 23 ; description has 3 words, room has 1 exit &327c 49 ff fb ; "at Watersmeet" &327f 48 88 ; room &88 to east ; room_8a_data &3281 03 ; special room type 3 ("a mountain range") &3282 65 ; description has 5 words, room has 3 exits &3283 a8 04 5d 03 54 ; "wandering up the west mountains" &3288 48 30 ; room &30 to east &328a 50 80 ; room &80 to south &328c 51 8e ; room &8e to south and down ; room_8b_data &328e 80 ; regular room, dark &328f 63 ; description has 3 words, room has 3 exits &3290 44 3a de ; "in a cave" &3293 44 8c ; room &8c to west &3295 60 8d ; room &8d to north &3297 52 88 ; room &88 to south and up &3299 c8 5e 20 ; room &5e via secret door to east ; room_8c_data &329c e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &329d 40 ; special description ("in a sloping maze"), room has 2 exits &329e 59 8d ; room &8d to southeast and down &32a0 66 94 ; room &94 to northwest and up ; room_8d_data &32a2 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &32a3 40 ; special description ("in a sloping maze"), room has 2 exits &32a4 66 94 ; room &94 to northwest and up &32a6 58 96 ; room &96 to southeast ; room_8e_data &32a8 80 ; regular room, dark &32a9 63 ; description has 3 words, room has 3 exits &32aa 44 3a de ; "in a cave" &32ad 48 8f ; room &8f to east &32af 62 8a ; room &8a to north and up &32b1 54 90 ; room &90 to southwest ; room_8f_data &32b3 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &32b4 40 ; special description ("in a sloping maze"), room has 2 exits &32b5 54 92 ; room &92 to southwest &32b7 48 95 ; room &95 to east ; room_90_data &32b9 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &32ba 40 ; special description ("in a sloping maze"), room has 2 exits &32bb 65 91 ; room &91 to northwest and down &32bd 48 8f ; room &8f to east ; room_91_data &32bf e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &32c0 20 ; special description ("in a sloping maze"), room has 1 exit &32c1 59 93 ; room &93 to southeast and down ; room_92_data &32c3 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &32c4 40 ; special description ("in a sloping maze"), room has 2 exits &32c5 52 8f ; room &8f to south and up &32c7 60 8e ; room &8e to north ; room_93_data &32c9 c0 ; regular room, dark, magically dark &32ca 68 ; description has 8 words, room has 3 exits &32cb 44 3a 75 de 44 5d 03 54 ; "in a small cave in the west mountains" &32d3 88 ae 00 ; room &ae via rock fall to east &32d6 4a 92 ; room &92 to east and up &32d8 55 8d ; room &8d to southwest and down ; room_94_data &32da e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &32db 40 ; special description ("in a sloping maze"), room has 2 exits &32dc 49 93 ; room &93 to east and down &32de 46 91 ; room &91 to west and up ; room_95_data &32e0 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &32e1 40 ; special description ("in a sloping maze"), room has 2 exits &32e2 44 8d ; room &8d to west &32e4 52 96 ; room &96 to south and up ; room_96_data &32e6 e6 ; special room type 6 ("a passage"), dark, magically dark, suppress exits &32e7 60 ; special description ("in a sloping maze"), room has 3 exits &32e8 54 8b ; room &8b to southwest &32ea 61 95 ; room &95 to north and down &32ec 48 8d ; room &8d to east ; room_97_data &32ee 00 ; regular room &32ef 47 ; description has 7 words, room has 2 exits &32f0 1a ff 5d ff 65 ff 57 ; "on The Crystal Bridge" &32f7 60 23 ; room &23 to north &32f9 50 19 ; room &19 to south ; room_98_data &32fb 00 ; regular room &32fc 83 ; description has 3 words, room has 4 exits &32fd 1a 3a bc ; "on a road" &3300 48 99 ; room &99 to east &3302 50 9a ; room &9a to south &3304 44 01 ; room &01 to west &3306 e0 03 00 ; room &03 via forest path to north ; room_99_data &3309 00 ; regular room &330a 83 ; description has 3 words, room has 4 exits &330b 1a 3a bc ; "on a road" &330e 48 9b ; room &9b to east &3310 50 9c ; room &9c to south &3312 44 98 ; room &98 to west &3314 60 11 ; room &11 to north ; room_9b_data &3316 00 ; regular room &3317 86 ; description has 6 words, room has 4 exits &3318 49 5d 25 6b 5d bc ; "at the end of the road" &331e 48 9d ; room &9d to east &3320 50 9e ; room &9e to south &3322 44 99 ; room &99 to west &3324 60 9f ; room &9f to north ; room_9d_data &3326 08 ; regular room, no picture direction &3327 27 ; description has 7 words, room has 1 exit &3328 44 ff 5d ff 6f ff 8c ; "in The Sword Inn" &332f 44 9b ; room &9b to west ; room_9a_data &3331 04 ; special room type 4 ("forest") &3332 80 ; special description ("wandering through the woods"), room has 4 exits &3333 60 98 ; room &98 to north &3335 48 9c ; room &9c to east &3337 50 a5 ; room &a5 to south &3339 44 a4 ; room &a4 to west ; room_9c_data &333b 00 ; regular room &333c 83 ; description has 3 words, room has 4 exits &333d 1a 3a fc ; "on a moor" &3340 48 9e ; room &9e to east &3342 50 a5 ; room &a5 to south &3344 44 9a ; room &9a to west &3346 60 99 ; room &99 to north ; room_9e_data &3348 00 ; regular room &3349 63 ; description has 3 words, room has 3 exits &334a 1a 3a fc ; "on a moor" &334d 44 9c ; room &9c to west &334f 60 9b ; room &9b to north &3351 50 a3 ; room &a3 to south ; room_9f_data &3353 08 ; regular room, no picture direction &3354 63 ; description has 3 words, room has 3 exits &3355 1a 3a fc ; "on a moor" &3358 60 a0 ; room &a0 to north &335a 48 a1 ; room &a1 to east &335c 50 9b ; room &9b to south ; room_a0_data &335e 03 ; special room type 3 ("a mountain range") &335f 60 ; special description ("wandering through high mountains"), room has 3 exits &3360 44 11 ; room &11 to west &3362 58 a1 ; room &a1 to southeast &3364 50 9f ; room &9f to south ; room_a1_data &3366 03 ; special room type 3 ("a mountain range") &3367 60 ; special description ("wandering through high mountains"), room has 3 exits &3368 44 9f ; room &9f to west &336a 64 a0 ; room &a0 to northwest &336c 50 a2 ; room &a2 to south ; room_a2_data &336e 03 ; special room type 3 ("a mountain range") &336f 40 ; special description ("wandering through high mountains"), room has 2 exits &3370 44 a3 ; room &a3 to west &3372 60 a1 ; room &a1 to north ; room_a3_data &3374 03 ; special room type 3 ("a mountain range") &3375 60 ; special description ("wandering through high mountains"), room has 3 exits &3376 48 a2 ; room &a2 to east &3378 60 9e ; room &9e to north &337a 44 a5 ; room &a5 to west ; room_a4_data &337c 04 ; special room type 4 ("forest") &337d 63 ; description has 3 words, room has 3 exits &337e 44 5d ac ; "in the woods" &3381 48 9a ; room &9a to east &3383 50 a7 ; room &a7 to south &3385 a0 01 46 ; room &01 visible through wooden fence to north ; room_a5_data &3388 03 ; special room type 3 ("a mountain range") &3389 80 ; special description ("wandering through high mountains"), room has 4 exits &338a 48 a3 ; room &a3 to east &338c 60 9c ; room &9c to north &338e 64 9a ; room &9a to northwest &3390 44 a7 ; room &a7 to west ; room_a6_data &3392 03 ; special room type 3 ("a mountain range") &3393 40 ; special description ("wandering through high mountains"), room has 2 exits &3394 60 86 ; room &86 to north &3396 48 a7 ; room &a7 to east ; room_a7_data &3398 03 ; special room type 3 ("a mountain range") &3399 60 ; special description ("wandering through high mountains"), room has 3 exits &339a 44 a6 ; room &a6 to west &339c 60 a4 ; room &a4 to north &339e 48 a5 ; room &a5 to east ; room_a8_data &33a0 80 ; regular room, dark &33a1 23 ; description has 3 words, room has 1 exit &33a2 44 3a e7 ; "in a dungeon" &33a5 84 aa c2 ; room &aa via locked bronze door to west ; room_a9_data &33a8 68 ; regular room, magically dark, suppress exits, no picture direction &33a9 05 ; description has 5 words, room has 0 exits &33aa 3f 04 44 3a e7 ; "locked up in a dungeon" ; room_aa_data &33af 80 ; regular room, dark &33b0 44 ; description has 4 words, room has 2 exits &33b1 44 3a 63 a3 ; "in a short passage" &33b5 88 a8 c2 ; room &a8 via locked bronze door to east &33b8 44 4d ; room &4d to west ; room_ab_data &33ba 03 ; special room type 3 ("a mountain range") &33bb 80 ; special description ("wandering through high mountains"), room has 4 exits &33bc 68 ad ; room &ad to northeast &33be 60 ac ; room &ac to north &33c0 50 14 ; room &14 to south &33c2 58 11 ; room &11 to southeast ; room_ac_data &33c4 03 ; special room type 3 ("a mountain range") &33c5 60 ; special description ("wandering through high mountains"), room has 3 exits &33c6 60 31 ; room &31 to north &33c8 58 ad ; room &ad to southeast &33ca 50 ab ; room &ab to south ; room_ad_data &33cc 03 ; special room type 3 ("a mountain range") &33cd 60 ; special description ("wandering through high mountains"), room has 3 exits &33ce 58 11 ; room &11 to southeast &33d0 54 ab ; room &ab to southwest &33d2 64 ac ; room &ac to northwest ; room_ae_data &33d4 08 ; regular room, no picture direction &33d5 51 ; description has 17 words, room has 2 exits &33d6 44 3a 73 f4 f5 39 3a c8 6b 5f fd a9 5d f5 43 5d ; "in a large hollow chamber, a river of gold flows through the chamber to the north" &33e6 00 &33e7 94 89 48 ; room &89 visible through narrow crack to southwest &33ea 44 93 ; room &93 to west ; room_af_data &33ec 60 ; regular room, magically dark, suppress exits &33ed 07 ; description has 7 words, room has 0 exits &33ee 49 5d 25 6b 3d 58 37 ; "at the end of your life here" ; room_b0_data &33f5 88 ; regular room, dark, no picture direction &33f6 04 ; description has 4 words, room has 0 exits &33f7 44 5d 4c 40 ; "in the strong room" &33fb 88 6f cc ; room &6f via locked silver secret door to east ; unused &33fe 00 00 ; dictionary_one_words_offset_table ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &3400 80 80 80 7f 7e 7b 7a 7e 82 82 82 86 8a 8a 8a 88 ; &00 &3410 86 86 85 84 82 81 80 80 7f 80 80 7d 7b 7a 79 78 ; &10 &3420 78 76 75 74 73 73 71 70 6f 6e 70 6f 6f 73 74 73 ; &20 &3430 6f 70 6e 6c 6c 6a 68 68 67 64 60 5c 59 57 56 53 ; &30 &3440 54 53 51 50 4d 4a 4a 47 46 44 41 40 3e 3f 40 41 ; &40 &3450 40 3d 3c 3d 3e 42 42 42 43 42 40 3f 3f 3d 3b 3c ; &50 &3460 3b 3c 3d 3d 3d 3e 40 3f 42 42 42 40 3d 3d 3b 3b ; &60 &3470 3b 3b 39 3a 3a 3c 3c 3e 3d 3d 40 3f 3e 41 41 40 ; &70 &3480 3f 3e 3e 3f 41 3f 3f 3f 40 3e 3e 3e 3f 3d 3f 3e ; &80 &3490 3f 3e 41 42 46 46 45 44 46 44 44 45 45 44 43 41 ; &90 &34a0 43 44 45 45 47 49 48 47 46 4a 4c 4c 4b 4b 4b 4b ; &a0 &34b0 48 48 47 47 47 47 48 4e 4f 4f 4f 50 50 4f 50 53 ; &b0 &34c0 53 56 54 54 54 55 54 55 55 55 58 57 5b 5d 5d 5f ; &c0 &34d0 5e 60 64 67 66 68 68 6c 6b 6a 6b 6f 70 73 72 71 ; &d0 &34e0 71 72 74 77 77 78 7a 7a 7c 7c 7f 7e 7f 7f 80 82 ; &e0 &34f0 85 85 87 85 84 85 87 87 87 87 88 8b 90 8f 8f 8d ; &f0 ; check_for_description_based_direction &3500 a9 00 LDA #&00 &3502 85 8d STA &8d ; count &3504 20 fb 24 JSR &24fb ; get_room_exit_count_and_data_offset &3507 a5 7b LDA &7b ; room_data_offset &3509 85 8e STA &8e ; room_data_offset ; check_for_description_based_direction_loop &350b 20 fb 24 JSR &24fb ; get_room_exit_count_and_data_offset # Get exit count for this room &350e a5 8d LDA &8d ; count &3510 c5 7a CMP &7a ; room_exit_count &3512 f0 3d BEQ &3551 ; i_dont_understand &3514 e6 8d INC &8d ; count &3516 a4 8e LDY &8e ; room_data_offset &3518 b1 77 LDA (&77),Y ; room_data_address # First byte of exit data is direction &351a 85 8f STA &8f ; exit_direction &351c c8 INY &351d b1 77 LDA (&77),Y ; room_data_address # Second byte of exit data is destination &351f 84 8e STY &8e ; room_data_offset &3521 a8 TAY &3522 20 4e 12 JSR &124e ; get_room_exit_count_and_data_offset_for_room_Y &3525 a9 00 LDA #&00 &3527 85 62 STA &62 ; words_matched &3529 a5 87 LDA &87 ; room_description_length_and_exit_count &352b 29 1f AND #&1f # ...18421 description length &352d f0 16 BEQ &3545 ; consider_next_exit # Branch if destination room has special description &352f a8 TAY &3530 c8 INY &3531 b1 77 LDA (&77),Y ; room_data_address # Consider last byte of destination room description &3533 20 2f 15 JSR &152f ; check_for_word_in_input &3536 a5 62 LDA &62 ; words_matched &3538 f0 0b BEQ &3545 ; consider_next_exit # Was that word in the input? ; use_description_based_direction &353a a5 8f LDA &8f ; exit_direction &353c 29 3f AND #&3f # ..218421 direction &353e 85 8c STA &8c ; description_based_direction # Set to non-zero to specify direction from description &3540 a9 00 LDA #&00 &3542 85 83 STA &83 ; input_verb # Set to zero to indicate direction found &3544 60 RTS ; consider_next_exit &3545 a4 8e LDY &8e ; room_data_offset &3547 24 8f BIT &8f ; exit_direction &3549 10 01 BPL &354c ; not_extended_exit &354b c8 INY ; not_extended_exit &354c c8 INY # Move to next exit &354d 84 8e STY &8e ; room_data_offset &354f d0 ba BNE &350b ; check_for_description_based_direction_loop ; i_dont_understand &3551 a9 83 LDA #&83 ; TELETEXT_YELLOW &3553 20 ee ff JSR &ffee ; OSWRCH &3556 a9 9d LDA #&9d ; TELETEXT_NEW_BACKGROUND &3558 20 ee ff JSR &ffee ; OSWRCH &355b a9 84 LDA #&84 ; TELETEXT_BLUE &355d 20 ee ff JSR &ffee ; OSWRCH &3560 20 eb 3b JSR &3beb ; write_nine_spaces &3563 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &3566 81 90 ec 00 ; "I don't understand" &356a 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; handle_text &356d a2 00 LDX #&00 ; write_choose_text_delay_loop &356f bd 8d 35 LDA &358d,X ; choose_text_delay_string &3572 20 ee ff JSR &ffee ; OSWRCH &3575 e8 INX &3576 e0 1b CPX #&1b &3578 d0 f5 BNE &356f ; write_choose_text_delay_loop ; get_delay &357a 20 5a 18 JSR &185a ; get_character_from_keyboard &357d c9 30 CMP #&30 ; "0" &357f 90 f9 BCC &357a ; get_delay &3581 c9 3a CMP #&3a ; "9" + 1 &3583 b0 f5 BCS &357a ; get_delay &3585 38 SEC &3586 e9 30 SBC #&30 ; "0" &3588 85 2a STA &2a ; text_delay &358a 4c 51 3b JMP &3b51 ; write_newline ; choose_text_delay_string &358d 43 68 6f 6f 73 65 20 74 65 78 74 20 64 65 6c 61 ; "Choose text delay, 0 to 9 ?" &359d 79 2c 20 30 20 74 6f 20 39 20 3f ; unused &35a8 0d ; unused # &35a9 - &35ff is a copy of &15a9 - &15ff &35a9 20 ef 14 JSR &14ef ; determine_input_object &35ac a5 60 LDA &60 ; best_matches &35ae 85 6c STA &6c ; previous_best_matches &35b0 a5 63 LDA &63 ; input_object &35b2 85 6d STA &6d ; previous_input_object &35b4 ad c0 25 LDA &25c0 ; objects_location + 0 (OBJECT_HOLDALL) &35b7 c5 6e CMP &6e ; room_to_consider &35b9 d0 0e BNE &35c9 &35bb a9 ff LDA #&ff ; ROOM_IN_HOLDALL &35bd 20 ef 14 JSR &14ef ; determine_input_object &35c0 a5 6c LDA &6c ; previous_best_matches &35c2 c5 60 CMP &60 ; best_matches &35c4 b0 03 BCS &35c9 &35c6 a5 60 LDA &60 ; best_matches &35c8 60 RTS &35c9 a5 6d LDA &6d ; previous_input_object &35cb 85 63 STA &63 ; input_object &35cd a5 6c LDA &6c ; previous_best_matches &35cf 85 60 STA &60 ; best_matches &35d1 60 RTS &35d2 a9 01 LDA #&01 ; CHARACTER_PLAYER + 1 &35d4 18 CLC &35d5 69 c7 ADC #&c7 ; ROOM_CARRYING - 1 &35d7 85 6e STA &6e ; room_to_consider &35d9 20 a7 15 JSR &15a7 ; check_for_object_in_room &35dc d0 ea BNE &35c8 &35de a5 83 LDA &83 ; input_verb &35e0 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &35e3 a9 80 LDA #&80 ; "what" &35e5 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &35e8 20 9f 22 JSR &229f ; prompt_for_input &35eb 20 a7 15 JSR &15a7 ; check_for_object_in_room &35ee d0 d8 BNE &35c8 &35f0 a5 6e LDA &6e ; room_to_consider &35f2 c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &35f4 d0 0b BNE &3601 &35f6 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &35f9 87 88 89 8a 00 ; "You haven't got that" &35fe 4c 6a JMP &..6a ; dictionary_one &3600 4e 4f 52 54 c8 ; word &00 : "NORTH" &3605 53 4f 55 54 c8 ; word &01 : "SOUTH" &360a 45 41 53 d4 ; word &02 : "EAST" &360e 57 45 53 d4 ; word &03 : "WEST" &3612 55 d0 ; word &04 : "UP" &3614 44 4f 57 ce ; word &05 : "DOWN" &3618 4e 4f 52 54 48 45 41 53 d4 ; word &06 : "NORTHEAST" &3621 4e 4f 52 54 48 57 45 53 d4 ; word &07 : "NORTHWEST" &362a 4e 45 41 53 d4 ; word &08 : "NEAST" &362f 4e 57 45 53 d4 ; word &09 : "NWEST" &3634 53 4f 55 54 48 45 41 53 d4 ; word &0a : "SOUTHEAST" &363d 53 4f 55 54 48 57 45 53 d4 ; word &0b : "SOUTHWEST" &3646 53 45 41 53 d4 ; word &0c : "SEAST" &364b 53 57 45 53 d4 ; word &0d : "SWEST" &3650 48 49 d4 ; word &0e : "HIT" &3653 43 55 d4 ; word &0f : "CUT" &3656 54 48 52 4f d7 ; word &10 : "THROW" &365b 44 52 4f d0 ; word &11 : "DROP" &365f 54 41 4b c5 ; word &12 : "TAKE" &3663 47 45 d4 ; word &13 : "GET" &3666 4c 4f 43 cb ; word &14 : "LOCK" &366a 53 48 55 d4 ; word &15 : "SHUT" &366e 43 4c 4f 53 c5 ; word &16 : "CLOSE" &3673 4f 50 45 ce ; word &17 : "OPEN" &3677 55 4e 4c 4f 43 cb ; word &18 : "UNLOCK" &367d 4c 49 47 48 d4 ; word &19 : "LIGHT" &3682 4f ce ; word &1a : "ON" &3684 4f 46 c6 ; word &1b : "OFF" &3687 47 49 56 c5 ; word &1c : "GIVE" &368b 46 49 4c cc ; word &1d : "FILL" &368f 50 4f 55 d2 ; word &1e : "POUR" &3693 45 4d 50 54 d9 ; word &1f : "EMPTY" &3698 41 53 cb ; word &20 : "ASK" &369b 57 41 49 d4 ; word &21 : "WAIT" &369f 57 41 56 c5 ; word &22 : "WAVE" &36a3 53 57 49 cd ; word &23 : "SWIM" &36a7 44 52 49 4e cb ; word &24 : "DRINK" &36ac 45 4e c4 ; word &25 : "END" &36af 51 55 49 d4 ; word &26 : "QUIT" &36b3 4c 4f 4f cb ; word &27 : "LOOK" &36b7 56 49 45 d7 ; word &28 : "VIEW" &36bb 50 49 43 54 55 52 c5 ; word &29 : "PICTURE" &36c2 44 52 41 d7 ; word &2a : "DRAW" &36c6 53 43 4f 52 c5 ; word &2b : "SCORE" &36cb 49 4e 56 45 4e 54 4f 52 d9 ; word &2c : "INVENTORY" &36d4 4f 50 54 49 4f ce ; word &2d : "OPTION" &36da 48 45 4c d0 ; word &2e : "HELP" &36de ae ; word &2f : "." &36df 44 41 47 47 45 d2 ; word &30 : "DAGGER" &36e5 52 4f c4 ; word &31 : "ROD" &36e8 4b 45 d9 ; word &32 : "KEY" &36eb 46 4c 49 4e d4 ; word &33 : "FLINT" &36f0 53 45 c5 ; word &34 : "SEE" &36f3 49 4c cc ; word &35 : "ILL" &36f6 43 41 4e 27 d4 ; word &36 : "CAN'T" &36fb 48 45 52 c5 ; word &37 : "HERE" &36ff 49 d4 ; word &38 : "IT" &3701 ac ; word &39 : "," &3702 c1 ; word &3a : "A" &3703 41 ce ; word &3b : "AN" &3705 41 4e c4 ; word &3c : "AND" &3708 59 4f 55 d2 ; word &3d : "YOUR" &370c 49 d3 ; word &3e : "IS" &370e 4c 4f 43 4b 45 c4 ; word &3f : "LOCKED" &3714 52 4f 4f cd ; word &40 : "ROOM" &3718 54 4f cf ; word &41 : "TOO" &371b 44 41 52 cb ; word &42 : "DARK" &371f 54 cf ; word &43 : "TO" &3721 49 ce ; word &44 : "IN" &3723 54 48 45 52 c5 ; word &45 : "THERE" &3728 4e cf ; word &46 : "NO" &372a 46 55 4c cc ; word &47 : "FULL" &372e 41 52 c5 ; word &48 : "ARE" &3731 41 d4 ; word &49 : "AT" &3733 56 45 52 d9 ; word &4a : "VERY" &3737 44 52 d9 ; word &4b : "DRY" &373a 53 54 52 4f 4e c7 ; word &4c : "STRONG" &3740 53 45 43 52 45 d4 ; word &4d : "SECRET" &3746 46 4f 52 45 53 d4 ; word &4e : "FOREST" &374c 4b 49 4e c7 ; word &4f : "KING" &3750 42 d9 ; word &50 : "BY" &3752 44 45 45 d0 ; word &51 : "DEEP" &3756 44 45 53 45 52 d4 ; word &52 : "DESERT" &375c 4b 45 45 50 45 d2 ; word &53 : "KEEPER" &3762 4d 4f 55 4e 54 41 49 4e d3 ; word &54 : "MOUNTAINS" &376b 47 55 41 52 c4 ; word &55 : "GUARD" &3770 46 4c 4f 4f d2 ; word &56 : "FLOOR" &3775 42 52 49 44 47 c5 ; word &57 : "BRIDGE" &377b 4c 49 46 c5 ; word &58 : "LIFE" &377f 4c 49 d4 ; word &59 : "LIT" &3782 4c 41 4d d0 ; word &5a : "LAMP" &3786 55 4e 4c 49 d4 ; word &5b : "UNLIT" &378b 4f 49 cc ; word &5c : "OIL" &378e 54 48 c5 ; word &5d : "THE" &3791 4d 41 53 54 45 d2 ; word &5e : "MASTER" &3797 47 4f 4c c4 ; word &5f : "GOLD" &379b 53 49 4c 56 45 d2 ; word &60 : "SILVER" &37a1 42 52 4f 4e 5a c5 ; word &61 : "BRONZE" &37a7 42 52 41 53 d3 ; word &62 : "BRASS" &37ac 53 48 4f 52 d4 ; word &63 : "SHORT" &37b1 57 4f 4f 44 45 ce ; word &64 : "WOODEN" &37b7 43 52 59 53 54 41 cc ; word &65 : "CRYSTAL" &37be 42 41 4c cc ; word &66 : "BALL" &37c2 54 52 45 41 53 55 52 c5 ; word &67 : "TREASURE" &37ca 43 48 45 53 d4 ; word &68 : "CHEST" &37cf 53 54 4f 4e c5 ; word &69 : "STONE" &37d4 4a 55 c7 ; word &6a : "JUG" &37d7 4f c6 ; word &6b : "OF" &37d9 57 41 54 45 d2 ; word &6c : "WATER" &37de 42 41 c7 ; word &6d : "BAG" &37e1 42 52 4f 41 c4 ; word &6e : "BROAD" &37e6 53 57 4f 52 c4 ; word &6f : "SWORD" &37eb 4b 4e 49 46 c5 ; word &70 : "KNIFE" &37f0 41 58 c5 ; word &71 : "AXE" &37f3 48 41 4d 4d 45 d2 ; word &72 : "HAMMER" &37f9 4c 41 52 47 c5 ; word &73 : "LARGE" &37fe 44 49 41 4d 4f 4e c4 ; word &74 : "DIAMOND" &3805 53 4d 41 4c cc ; word &75 : "SMALL" &380a 48 4f 4c 44 41 4c cc ; word &76 : "HOLDALL" &3811 4c 4f 4e c7 ; word &77 : "LONG" &3815 53 54 41 46 c6 ; word &78 : "STAFF" &381a 43 41 55 4c 44 52 4f ce ; word &79 : "CAULDRON" &3822 4d 41 43 c5 ; word &7a : "MACE" &3826 43 4c 55 c2 ; word &7b : "CLUB" &382a 4a 45 57 45 4c 4c 45 c4 ; word &7c : "JEWELLED" &3832 43 52 4f 57 ce ; word &7d : "CROWN" &3837 42 45 45 d2 ; word &7e : "BEER" &383b 53 4f 4d c5 ; word &7f : "SOME" &383f 52 49 4e c7 ; word &80 : "RING" &3843 4d 45 54 41 cc ; word &81 : "METAL" &3848 41 4d 55 4c 45 d4 ; word &82 : "AMULET" &384e 55 4e 49 46 4f 52 cd ; word &83 : "UNIFORM" &3855 59 4f d5 ; word &84 : "YOU" &3858 47 49 41 4e d4 ; word &85 : "GIANT" &385d 44 57 41 52 c6 ; word &86 : "DWARF" &3862 43 41 53 54 4c c5 ; word &87 : "CASTLE" &3868 45 4c c6 ; word &88 : "ELF" &386b 54 52 4f 4c cc ; word &89 : "TROLL" &3870 57 49 54 43 c8 ; word &8a : "WITCH" &3875 44 52 41 47 4f ce ; word &8b : "DRAGON" &387b 49 4e ce ; word &8c : "INN" &387e 47 4f 52 49 4c 4c c1 ; word &8d : "GORILLA" &3885 53 41 4e c4 ; word &8e : "SAND" &3889 4c 55 52 4b 45 d2 ; word &8f : "LURKER" &388f 50 41 54 c8 ; word &90 : "PATH" &3893 4d 4f 55 4e 54 41 49 ce ; word &91 : "MOUNTAIN" &389b 53 50 49 52 41 cc ; word &92 : "SPIRAL" &38a1 53 54 41 49 52 43 41 53 c5 ; word &93 : "STAIRCASE" &38aa 47 52 41 54 c5 ; word &94 : "GRATE" &38af 44 4f 4f d2 ; word &95 : "DOOR" &38b3 54 52 41 d0 ; word &96 : "TRAP" &38b7 41 52 43 48 57 41 d9 ; word &97 : "ARCHWAY" &38be 57 41 d9 ; word &98 : "WAY" &38c1 46 45 4e 43 c5 ; word &99 : "FENCE" &38c6 4e 41 52 52 4f d7 ; word &9a : "NARROW" &38cc 43 52 41 43 cb ; word &9b : "CRACK" &38d1 52 4f 43 cb ; word &9c : "ROCK" &38d5 46 41 4c cc ; word &9d : "FALL" &38d9 43 41 ce ; word &9e : "CAN" &38dc 44 49 53 55 53 45 c4 ; word &9f : "DISUSED" &38e3 51 55 41 52 52 d9 ; word &a0 : "QUARRY" &38e9 43 41 4e 59 4f ce ; word &a1 : "CANYON" &38ef 52 41 4e 47 c5 ; word &a2 : "RANGE" &38f4 50 41 53 53 41 47 c5 ; word &a3 : "PASSAGE" &38fb 53 4c 4f 50 49 4e c7 ; word &a4 : "SLOPING" &3902 4d 41 5a c5 ; word &a5 : "MAZE" &3906 41 52 49 c4 ; word &a6 : "ARID" &390a 48 49 47 c8 ; word &a7 : "HIGH" &390e 57 41 4e 44 45 52 49 4e c7 ; word &a8 : "WANDERING" &3917 54 48 52 4f 55 47 c8 ; word &a9 : "THROUGH" &391e 50 41 54 48 d3 ; word &aa : "PATHS" &3923 4c 45 41 c4 ; word &ab : "LEAD" &3927 57 4f 4f 44 d3 ; word &ac : "WOODS" &392c 44 45 4e 53 c5 ; word &ad : "DENSE" &3931 57 48 49 43 c8 ; word &ae : "WHICH" &3936 47 cf ; word &af : "GO" &3938 53 54 45 45 d0 ; word &b0 : "STEEP" &393d 53 4c 41 c7 ; word &b1 : "SLAG" &3941 48 45 41 50 d3 ; word &b2 : "HEAPS" &3946 42 4c 4f 43 cb ; word &b3 : "BLOCK" &394b 43 4c 49 46 c6 ; word &b4 : "CLIFF" &3950 42 55 53 48 45 d3 ; word &b5 : "BUSHES" &3956 55 4e 44 45 52 47 52 4f 57 54 c8 ; word &b6 : "UNDERGROWTH" &3961 42 4c 4f 43 4b d3 ; word &b7 : "BLOCKS" &3967 4c 45 41 44 d3 ; word &b8 : "LEADS" &396c 44 55 4e 45 d3 ; word &b9 : "DUNES" &3971 49 4e 53 49 44 c5 ; word &ba : "INSIDE" &3977 43 41 42 49 ce ; word &bb : "CABIN" &397c 52 4f 41 c4 ; word &bc : "ROAD" &3980 53 50 52 49 4e c7 ; word &bd : "SPRING" &3986 42 41 42 42 4c 49 4e c7 ; word &be : "BABBLING" &398e 42 52 4f 4f cb ; word &bf : "BROOK" &3993 43 4c 45 41 52 49 4e c7 ; word &c0 : "CLEARING" &399b 54 4f d0 ; word &c1 : "TOP" &399e 53 43 52 45 c5 ; word &c2 : "SCREE" &39a3 53 4c 4f 50 c5 ; word &c3 : "SLOPE" &39a8 53 54 52 45 41 cd ; word &c4 : "STREAM" &39ae 50 49 4c c5 ; word &c5 : "PILE" &39b2 4a 41 47 47 45 c4 ; word &c6 : "JAGGED" &39b8 52 4f 43 4b d3 ; word &c7 : "ROCKS" &39bd 52 49 56 45 d2 ; word &c8 : "RIVER" &39c2 50 4c 45 41 53 41 4e d4 ; word &c9 : "PLEASANT" &39ca 57 4f 4f c4 ; word &ca : "WOOD" &39ce 57 41 54 45 52 46 41 4c cc ; word &cb : "WATERFALL" &39d7 57 49 4e 44 49 4e c7 ; word &cc : "WINDING" &39de 54 52 41 49 cc ; word &cd : "TRAIL" &39e3 53 54 45 45 50 4c d9 ; word &ce : "STEEPLY" &39ea 45 44 47 c5 ; word &cf : "EDGE" &39ee 46 49 53 53 55 52 c5 ; word &d0 : "FISSURE" &39f5 43 52 4f 43 4f 44 49 4c c5 ; word &d1 : "CROCODILE" &39fe 49 4e 46 45 53 54 45 c4 ; word &d2 : "INFESTED" &3a06 50 4f 4f cc ; word &d3 : "POOL" &3a0a 53 49 54 54 49 4e c7 ; word &d4 : "SITTING" &3a11 47 52 41 4e c4 ; word &d5 : "GRAND" &3a16 53 55 52 52 4f 55 4e 44 d3 ; word &d6 : "SURROUNDS" &3a1f 42 41 43 cb ; word &d7 : "BACK" &3a23 4d 4f 41 d4 ; word &d8 : "MOAT" &3a27 44 49 56 49 4e c7 ; word &d9 : "DIVING" &3a2d 44 41 4e 47 45 52 4f 55 d3 ; word &da : "DANGEROUS" &3a36 54 57 49 53 54 d9 ; word &db : "TWISTY" &3a3c 45 4e 54 52 41 4e 43 c5 ; word &dc : "ENTRANCE" &3a44 48 41 4c cc ; word &dd : "HALL" &3a48 43 41 56 c5 ; word &de : "CAVE" &3a4c 53 54 55 44 d9 ; word &df : "STUDY" &3a51 44 49 4e 49 4e c7 ; word &e0 : "DINING" &3a57 4b 49 54 43 48 45 ce ; word &e1 : "KITCHEN" &3a5e 57 4f 52 4b 53 48 4f d0 ; word &e2 : "WORKSHOP" &3a66 53 54 4f 52 c5 ; word &e3 : "STORE" &3a6b 43 45 4c 4c 41 d2 ; word &e4 : "CELLAR" &3a71 41 52 4d 4f 55 52 d9 ; word &e5 : "ARMOURY" &3a78 4d 55 53 54 d9 ; word &e6 : "MUSTY" &3a7d 44 55 4e 47 45 4f ce ; word &e7 : "DUNGEON" &3a84 50 4f 4b 45 d9 ; word &e8 : "POKEY" &3a89 41 4e 54 45 52 4f 4f cd ; word &e9 : "ANTEROOM" &3a91 44 41 4d d0 ; word &ea : "DAMP" &3a95 54 55 52 52 45 d4 ; word &eb : "TURRET" &3a9b 54 4f 57 45 d2 ; word &ec : "TOWER" &3aa0 54 48 52 4f 4e c5 ; word &ed : "THRONE" &3aa6 4c 41 4e 44 49 4e c7 ; word &ee : "LANDING" &3aad 43 4f 52 52 49 44 4f d2 ; word &ef : "CORRIDOR" &3ab5 52 4f 59 41 cc ; word &f0 : "ROYAL" &3aba 42 45 44 52 4f 4f cd ; word &f1 : "BEDROOM" &3ac1 57 45 d4 ; word &f2 : "WET" &3ac4 44 41 4e cb ; word &f3 : "DANK" &3ac8 48 4f 4c 4c 4f d7 ; word &f4 : "HOLLOW" &3ace 43 48 41 4d 42 45 d2 ; word &f5 : "CHAMBER" &3ad5 53 48 41 46 d4 ; word &f6 : "SHAFT" &3ada 42 4f 4e 45 d3 ; word &f7 : "BONES" &3adf 54 55 52 4e d9 ; word &f8 : "TURNY" &3ae4 4c 49 54 54 4c c5 ; word &f9 : "LITTLE" &3aea 50 41 53 53 41 47 45 d3 ; word &fa : "PASSAGES" &3af2 57 41 54 45 52 53 4d 45 45 d4 ; word &fb : "WATERSMEET" &3afc 4d 4f 4f d2 ; word &fc : "MOOR" &3b00 46 4c 4f 57 d3 ; word &fd : "FLOWS" &3b05 2a 2a aa ; word &fe : "***" # ; word &ff : use uppercase for next character ; unused &3b08 0d 0d c7 0d 0d ; unused # Source code fragment &3b0d 22 41 43 43 45 50 54 45 44 22 29 3a 50 25 3f 35 ; ... "ACCEPTED"):P%?5=FNW ... &3b1d 3d a4 57 ; delay_before_picture &3b20 20 23 3b JSR &3b23 ; wait_for_clock ; wait_for_clock &3b23 20 c0 2a JSR &2ac0 ; read_clock # Returns A = least significant byte of clock &3b26 85 8b STA &8b ; previous_clock &3b28 c6 8b DEC &8b ; previous_clock ; wait_for_clock_loop &3b2a 20 c0 2a JSR &2ac0 ; read_clock # Returns A = least significant byte of clock &3b2d c5 8b CMP &8b ; previous_clock &3b2f d0 f9 BNE &3b2a ; wait_for_clock_loop &3b31 60 RTS ; delay_four &3b32 20 82 22 JSR &2282 ; wait_for_character_or_timeout ; delay_three &3b35 20 82 22 JSR &2282 ; wait_for_character_or_timeout &3b38 20 82 22 JSR &2282 ; wait_for_character_or_timeout &3b3b 24 ff BIT &ff ; os_flags # Negative if escape condition &3b3d 30 03 BMI &3b42 ; wait_for_character &3b3f 4c 82 22 JMP &2282 ; wait_for_character_or_timeout ; wait_for_character &3b42 20 82 22 JSR &2282 ; wait_for_character_or_timeout # Returns negative if timed out &3b45 30 fb BMI &3b42 ; wait_for_character &3b47 a9 7c LDA #&7c ; Clear ESCAPE condition &3b49 20 f4 ff JSR &fff4 ; OSBYTE &3b4c a9 7e LDA #&7e ; Acknowledge ESCAPE condition &3b4e 4c f4 ff JMP &fff4 ; OSBYTE ; write_newline &3b51 8a TXA &3b52 48 PHA ; tmp_x &3b53 20 e7 ff JSR &ffe7 ; OSNEWL &3b56 a6 6f LDX &6f ; next_line_screen_x &3b58 86 82 STX &82 ; screen_x &3b5a f0 0d BEQ &3b69 ; skip_writing_indent ; is_indented &3b5c 8a TXA &3b5d ca DEX &3b5e 09 02 ORA #&02 &3b60 18 CLC &3b61 69 80 ADC #&80 # Use teletext colour depending on indentation ; write_indent_loop &3b63 20 ee ff JSR &ffee ; OSWRCH &3b66 ca DEX &3b67 d0 fa BNE &3b63 ; write_indent_loop ; skip_writing_indent &3b69 68 PLA ; tmp_x &3b6a aa TAX &3b6b 60 RTS ; write_string_using_dictionary_one &3b6c 68 PLA # String follows call &3b6d 85 72 STA &72 ; packed_string_address_low &3b6f 68 PLA &3b70 85 73 STA &73 ; packed_string_address_high &3b72 e6 72 INC &72 ; packed_string_address_low ; write_string_using_dictionary_one_loop &3b74 d0 02 BNE &3b78 ; skip_page &3b76 e6 73 INC &73 ; packed_string_address_high ; skip_page &3b78 a0 00 LDY #&00 &3b7a b1 72 LDA (&72),Y ; packed_string_address &3b7c f0 06 BEQ &3b84 ; return_after_call &3b7e 20 d9 1f JSR &1fd9 ; write_word_from_dictionary_one &3b81 4c 72 3b JMP &3b72 ; write_string_using_dictionary_one_loop ; return_after_call &3b84 e6 72 INC &72 ; packed_string_address_low &3b86 d0 02 BNE &3b8a ; skip_page &3b88 e6 73 INC &73 ; packed_string_address_high ; skip_page &3b8a 6c 72 00 JMP (&0072) ; packed_string_address ; check_if_object_is_carried_or_in_holdall # Called with X = object to check &3b8d bd c0 25 LDA &25c0,X ; objects_location &3b90 c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &3b92 f0 0c BEQ &3ba0 ; leave # Leave with zero if object carried &3b94 ad c0 25 LDA &25c0 ; objects_location + 0 (OBJECT_HOLDALL) &3b97 c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &3b99 d0 05 BNE &3ba0 ; leave # Leave with non-zero if holdall not carried &3b9b bd c0 25 LDA &25c0,X ; objects_location &3b9e c9 ff CMP #&ff # Leave with zero if object in holdall ; leave &3ba0 60 RTS ; write_character_of_output &3ba1 20 ee ff JSR &ffee ; OSWRCH &3ba4 85 25 STA &25 ; last_character_written &3ba6 48 PHA ; tmp_a &3ba7 98 TYA &3ba8 48 PHA ; tmp_y &3ba9 8a TXA &3baa 48 PHA ; tmp_x &3bab a5 2a LDA &2a ; text_delay &3bad f0 0f BEQ &3bbe ; skip_delay_after_character &3baf 20 c0 2a JSR &2ac0 ; read_clock # Returns A = least significant byte of clock &3bb2 85 8b STA &8b ; previous_clock ; delay_after_character_loop &3bb4 20 c0 2a JSR &2ac0 ; read_clock # Returns A = least significant byte of clock &3bb7 38 SEC &3bb8 e5 8b SBC &8b ; previous_clock &3bba c5 2a CMP &2a ; text_delay &3bbc 90 f6 BCC &3bb4 ; delay_after_character_loop ; skip_delay_after_character &3bbe 68 PLA ; tmp_x &3bbf aa TAX &3bc0 68 PLA ; tmp_y &3bc1 a8 TAY &3bc2 68 PLA ; tmp_a &3bc3 60 RTS ; calculate_dictionary_one_word_address &3bc4 a9 00 LDA #&00 &3bc6 85 71 STA &71 ; word_address_high &3bc8 98 TYA &3bc9 85 70 STA &70 ; word_address_low &3bcb 0a ASL A &3bcc 26 71 ROL &71 ; word_address_high &3bce 0a ASL A &3bcf 26 71 ROL &71 ; word_address_high &3bd1 65 70 ADC &70 ; word_address_low &3bd3 90 02 BCC &3bd7 ; skip_page_one &3bd5 e6 71 INC &71 ; word_address_high ; skip_page_one &3bd7 18 CLC &3bd8 79 00 34 ADC &3400,Y ; dictionary_one_words_offset_table &3bdb 90 02 BCC &3bdf ; skip_page_two &3bdd e6 71 INC &71 ; word_address_high ; skip_page_two &3bdf 18 CLC &3be0 69 80 ADC #&80 ; &3580 = dictionary_one - &80 &3be2 85 70 STA &70 ; word_address_low &3be4 a5 71 LDA &71 ; word_address_high &3be6 69 35 ADC #&35 &3be8 85 71 STA &71 ; word_address_high &3bea 60 RTS ; write_nine_spaces &3beb a9 20 LDA #&20 ; " " &3bed a2 09 LDX #&09 ; write_X_copies_of_character_A ; write_X_copies_of_character_A_loop &3bef 20 ee ff JSR &ffee ; OSWRCH &3bf2 ca DEX &3bf3 d0 fa BNE &3bef ; write_X_copies_of_character_A_loop &3bf5 60 RTS ; unused # Source code fragment &3bf6 44 28 22 54 48 45 22 29 3a 50 ; ... D("THE"):P ... ; initialise_mode_5_screen &3c00 a0 19 LDY #&19 ; write_initialise_mode_5_loop &3c02 b9 d6 41 LDA &41d6,Y ; initialise_mode_5_string &3c05 20 ee ff JSR &ffee ; OSWRCH &3c06 88 DEY &3c09 10 f7 BPL &3c02 ; write_initialise_mode_5_loop &3c0b 4c bb 3c JMP &3cbb ; start_drawing_picture ; draw_line &3c0e a9 12 LDA #&12 # GCOL 0,colour &3c10 20 ee ff JSR &ffee ; OSWRCH &3c13 a9 00 LDA #&00 &3c15 20 ee ff JSR &ffee ; OSWRCH &3c18 a5 31 LDA &31 ; colour &3c1a 20 ee ff JSR &ffee ; OSWRCH &3c1d a9 19 LDA #&19 # DRAW &3c1f 20 ee ff JSR &ffee ; OSWRCH &3c22 a9 05 LDA #&05 &3c24 20 ee ff JSR &ffee ; OSWRCH &3c27 4c 16 3e JMP &3e16 ; write_coordinates ; scale_number # Called with A = number to scale &3c2a 86 30 STX &30 ; tmp_x &3c2c a6 33 LDX &33 ; scaling &3c2e 30 14 BMI &3c44 ; scale_up_number_loop &3c30 f0 0f BEQ &3c41 ; leave_after_restoring_x &3c32 29 ff AND #&ff # Set negative if negative &3c34 30 06 BMI &3c3c ; scale_down_negative_number_loop # Branch if number to be scaled is negative ; scale_down_positive_number_loop &3c36 4a LSR A &3c37 ca DEX &3c38 d0 fc BNE &3c36 ; shift_right_loop &3c3a f0 05 BEQ &3c41 ; leave_after_restoring_x # Always branches ; scale_down_negative_number_loop &3c3c 38 SEC &3c3d 6a ROR A &3c3e ca DEX &3c3f d0 fb BNE &3c3c ; rotate_right_loop ; leave_after_restoring_x &3c41 a6 30 LDX &30 ; tmp_x &3c43 60 RTS # Leave with A = scaled number ; scale_up_number_loop &3c44 0a ASL A &3c45 e8 INX &3c46 d0 fc BNE &3c44 ; shift_left_loop &3c48 f0 f7 BEQ &3c41 ; leave_after_restoring_x # Always branches ; set_colour # Called with A = byte of picture data &3c4a 8a TXA ; picture data byte # .421.... colour &3c4b 4a LSR A # 84218421 -> .8421842 &3c4c 4a LSR A # -> ..842184 &3c4d 4a LSR A # -> ...84218 &3c4e 4a LSR A # -> ....8421 &3c4f 29 07 AND #&07 # -> .....421 &3c51 86 30 STX &30 ; tmp_x &3c53 85 31 STA &31 ; colour &3c55 aa TAX &3c56 bd ce 41 LDA &41ce,X ; fill_colours_table &3c59 85 32 STA &32 ; fill_colours &3c5b a6 30 LDX &30 ; tmp_x &3c5d 60 RTS ; draw_subpicture # 1...0000 draw subpicture &3c5e 29 70 AND #&70 # .421.... subpicture scaling &3c60 4a LSR A &3c61 4a LSR A &3c62 4a LSR A &3c63 4a LSR A &3c64 65 33 ADC &33 ; scaling &3c66 85 30 STA &30 ; subpicture_scaling &3c68 18 CLC &3c69 69 03 ADC #&03 &3c6b c5 3c CMP &3c ; scaling_limit &3c6d b0 48 BCS &3cb7 ; to_draw_picture_loop # Don't draw subpicture if too small &3c6f b1 34 LDA (&34),Y ; picture_data_address # Get second byte for subpicture number &3c71 aa TAX ; subpicture &3c72 98 TYA ; picture data offset &3c73 48 PHA ; picture data offset &3c74 a5 34 LDA &34 ; picture_data_address_low &3c76 48 PHA ; picture_data_address_low &3c77 a5 35 LDA &35 ; picture_data_address_high &3c79 48 PHA ; picture_data_address_high &3c7a a5 33 LDA &33 ; scaling &3c7c 48 PHA ; scaling &3c7d a5 30 LDA &30 ; subpicture_scaling &3c7f 85 33 STA &33 ; scaling &3c81 a5 36 LDA &36 ; origin_x &3c83 48 PHA ; origin_x &3c84 a5 37 LDA &37 ; origin_y &3c86 48 PHA ; origin_y &3c87 a5 38 LDA &38 ; x &3c89 85 36 STA &36 ; origin_x &3c8b a5 39 LDA &39 ; y &3c8d 85 37 STA &37 ; origin_y &3c8f a5 3d LDA &3d ; absolute_x &3c91 48 PHA ; absolute_x &3c92 a5 3e LDA &3e ; absolute_y &3c94 48 PHA ; absolute_y &3c95 20 e5 3c JSR &3ce5 ; start_drawing_subpicture &3c98 a5 36 LDA &36 ; origin_x &3c9a 85 38 STA &38 ; x &3c9c a5 37 LDA &37 ; origin_y &3c9e 85 39 STA &39 ; y &3ca0 68 PLA ; absolute_y &3ca1 85 3e STA &3e ; absolute_y &3ca3 68 PLA ; absolute_x &3ca4 85 3d STA &3d ; absolute_x &3ca6 68 PLA ; origin_y &3ca7 85 37 STA &37 ; origin_y &3ca9 68 PLA ; origin_x &3caa 85 36 STA &36 ; origin_x &3cac 68 PLA ; scaling &3cad 85 33 STA &33 ; scaling &3caf 68 PLA ; picture_data_address_high &3cb0 85 35 STA &35 ; picture_data_address_high &3cb2 68 PLA ; picture_data_address_low &3cb3 85 34 STA &34 ; picture_data_address_low &3cb5 68 PLA ; picture data offset &3cb6 a8 TAY ; picture data offset ; to_draw_picture_loop &3cb7 c8 INY &3cb8 4c f5 3c JMP &3cf5 ; draw_picture_loop ; start_drawing_picture &3cbb a9 08 LDA #&08 &3cbd 85 3c STA &3c ; scaling_limit &3cbf a9 fd LDA #&fd ; -3 &3cc1 85 33 STA &33 ; scaling &3cc3 a9 00 LDA #&00 &3cc5 85 38 STA &38 ; x &3cc7 a9 ff LDA #&ff &3cc9 85 39 STA &39 ; y &3ccb 20 16 3e JSR &3e16 ; write_coordinates # MOVE to coordinates &3cce a9 03 LDA #&03 &3cd0 85 31 STA &31 ; colour &3cd2 a9 9f LDA #&9f &3cd4 85 38 STA &38 ; x &3cd6 20 0e 3c JSR &3c0e ; draw_line # Draw blue line at top of screen &3cd9 a9 50 LDA #&50 &3cdb 85 36 STA &36 ; origin_x &3cdd 85 38 STA &38 ; x &3cdf a9 80 LDA #&80 &3ce1 85 37 STA &37 ; origin_y &3ce3 85 39 STA &39 ; y ; start_drawing_subpicture &3ce5 bd 00 43 LDA &4300,X ; picture_data_addresses_low_table &3ce8 85 34 STA &34 ; picture_data_address_low &3cea bd c8 43 LDA &43c8,X ; picture_data_addresses_high_table &3ced 85 35 STA &35 ; picture_data_address_high &3cef a0 00 LDY #&00 &3cf1 84 3d STY &3d ; absolute_x &3cf3 84 3e STY &3e ; absolute_y ; draw_picture_loop &3cf5 b1 34 LDA (&34),Y ; picture_data_address # 00000000 indicates end of picture data &3cf7 d0 01 BNE &3cfa ; not_end_of_picture_data &3cf9 60 RTS ; not_end_of_picture_data &3cfa aa TAX ; picture data byte &3cfb c8 INY &3cfc 29 03 AND #&03 # ......01 move, ......10 draw line, .....11 fill &3cfe d0 7a BNE &3d7a ; move_draw_line_or_fill ; not_move_draw_line_or_fill &3d00 8a TXA ; picture data byte &3d01 29 04 AND #&04 &3d03 f0 1a BEQ &3d1f ; not_end_of_repeat ; consider_repeat # .....100 end repeat &3d05 8a TXA ; picture data byte &3d06 e6 3a INC &3a ; repeat_count &3d08 29 f8 AND #&f8 # 84218... number of repeats &3d0a 4a LSR A # 84218... -> .84218.. &3d0b 4a LSR A # .84218.. -> ..84218. &3d0c 4a LSR A # ..84218. -> ...84218 &3d0d c5 3a CMP &3a ; repeat_count &3d0f 90 05 BCC &3d16 ; repeat_again ; end_of_repeat &3d11 a4 3b LDY &3b ; repeat_picture_data_offset &3d13 4c f5 3c JMP &3cf5 ; draw_picture_loop ; repeat_again &3d16 68 PLA ; repeat_picture_data_offset &3d17 85 3b STA &3b ; repeat_picture_data_offset &3d19 68 PLA ; repeat_count &3d1a 85 3a STA &3a ; repeat_count &3d1c 4c f5 3c JMP &3cf5 ; draw_picture_loop ; not_end_of_repeat &3d1f 8a TXA ; picture data byte &3d20 29 08 AND #&08 &3d22 d0 24 BNE &3d48 ; draw_circle # ....1000 draw circle ; not_draw_circle &3d24 8a TXA ; picture data byte &3d25 10 03 BPL &3d2a ; not_draw_subpicture &3d27 4c 5e 3c JMP &3c5e ; draw_subpicture # 1...0000 draw subpicture ; not_draw_subpicture &3d2a c9 10 CMP #&10 &3d2c d0 0f BNE &3d3d ; set_scaling_limit ; start_repeat # 00010000 start repeat &3d2e a5 3a LDA &3a ; repeat_count &3d30 48 PHA ; repeat_count &3d31 a5 3b LDA &3b ; repeat_picture_data_offset &3d33 48 PHA ; repeat_picture_data_offset &3d34 84 3b STY &3b ; repeat_picture_data_offset &3d36 a9 00 LDA #&00 &3d38 85 3a STA &3a ; repeat_count &3d3a 4c f5 3c JMP &3cf5 ; draw_picture_loop ; set_scaling_limit # 0...0000 set scaling limit &3d3d 4a LSR A # .421.... scaling limit &3d3e 4a LSR A &3d3f 4a LSR A &3d40 4a LSR A &3d41 69 01 ADC #&01 &3d43 85 3c STA &3c ; scaling_limit &3d45 4c f5 3c JMP &3cf5 ; draw_picture_loop ; draw_circle # ....1000 draw circle &3d48 20 4a 3c JSR &3c4a ; set_colour # .421.... colour &3d4b 86 4e STX &4e ; circle_aspect # 8....... if set, ellipse, if clear, circle &3d4d b1 34 LDA (&34),Y ; picture_data_address # Get second byte for circle size and quarters &3d4f aa TAX ; second picture data byte &3d50 c8 INY &3d51 29 f0 AND #&f0 # 8421.... circle size &3d53 4a LSR A &3d54 4a LSR A &3d55 4a LSR A &3d56 4a LSR A &3d57 20 2a 3c JSR &3c2a ; scale_number &3d5a 85 54 STA &54 ; circle_size &3d5c 8a TXA ; second picture data byte &3d5d 29 03 AND #&03 # ......21 number of quarters to plot &3d5f 85 4b STA &4b ; circle_quarters_to_plot &3d61 e6 4b INC &4b ; circle_quarters_to_plot &3d63 8a TXA ; second picture data byte &3d64 4a LSR A &3d65 4a LSR A &3d66 29 03 AND #&03 # ....84.. starting quarter &3d68 85 4a STA &4a ; circle_quarter &3d6a 84 30 STY &30 ; tmp_y &3d6c a6 38 LDX &38 ; x &3d6e a4 39 LDY &39 ; y &3d70 a5 32 LDA &32 ; fill_colours &3d72 20 90 3e JSR &3e90 ; plot_circle &3d75 a4 30 LDY &30 ; tmp_y &3d77 4c f5 3c JMP &3cf5 ; draw_picture_loop ; move_draw_line_or_fill # ......01 move, ......10 draw line, .....11 fill &3d7a 20 4a 3c JSR &3c4a ; set_colour # .421.... colour &3d7d 8a TXA ; picture data byte &3d7e 29 03 AND #&03 &3d80 c9 02 CMP #&02 # If drawing line, &3d82 d0 0d BNE &3d91 ; skip_move &3d84 a9 19 LDA #&19 # MOVE &3d86 20 ee ff JSR &ffee ; OSWRCH &3d89 a9 04 LDA #&04 &3d8b 20 ee ff JSR &ffee ; OSWRCH &3d8e 20 16 3e JSR &3e16 ; write_coordinates # move to previous coordinates ; skip_move &3d91 8a TXA ; picture data byte &3d92 29 08 AND #&08 # ....8... if set, use negative y coordinate &3d94 f0 04 BEQ &3d9a ; is_positive_y ; is_negative_y &3d96 a9 f0 LDA #&f0 &3d98 d0 02 BNE &3d9c ; set_y_sign # Always branches ; is_positive_y &3d9a a9 00 LDA #&00 ; set_y_sign &3d9c 85 30 STA &30 ; y_sign &3d9e b1 34 LDA (&34),Y ; picture_data_address # Get second byte for coordinates &3da0 29 0f AND #&0f # ....8421 y coordinate &3da2 05 30 ORA &30 ; y_sign &3da4 85 39 STA &39 ; y &3da6 8a TXA ; picture data byte &3da7 29 80 AND #&80 # 8....... if set, use negative x coordinate &3da9 85 30 STA &30 ; x_sign &3dab b1 34 LDA (&34),Y ; picture_data_address # Second byte of picture data &3dad 29 f0 AND #&f0 # 8421.... x coordinate &3daf c8 INY &3db0 4a LSR A # 8421.... -> .8421... &3db1 05 30 ORA &30 ; x_sign &3db3 30 05 BMI &3dba ; is_positive_x ; is_positive_x &3db5 4a LSR A # .8421... -> ..8421.. &3db6 4a LSR A # -> ...8421. &3db7 4a LSR A # -> ....8421 &3db8 10 06 BPL &3dc0 ; set_x # Always branches ; is_negative_x &3dba 38 SEC &3dbb 6a ROR A # .8421... -> ..8421.. &3dbc 38 SEC &3dbd 6a ROR A # -> ...8421. &3dbe 38 SEC &3dbf 6a ROR A # -> ....8421 ; set_x &3dc0 85 38 STA &38 ; x &3dc2 8a TXA ; picture data byte &3dc3 29 04 AND #&04 # .....4.. if set, relative coordinates &3dc5 d0 0b BNE &3dd2 ; is_relative ; is_absolute &3dc7 a5 38 LDA &38 ; x &3dc9 85 3d STA &3d ; absolute_x &3dcb a5 39 LDA &39 ; y &3dcd 85 3e STA &3e ; absolute_y &3dcf 4c e0 3d JMP &3de0 ; scale_and_apply_origin ; is_relative &3dd2 a5 3d LDA &3d ; absolute_x &3dd4 18 CLC &3dd5 65 38 ADC &38 ; x &3dd7 85 3d STA &3d ; absolute_x &3dd9 a5 3e LDA &3e ; absolute_y &3ddb 18 CLC &3ddc 65 39 ADC &39 ; y &3dde 85 3e STA &3e ; absolute_y ; scale_and_apply_origin &3de0 a5 3d LDA &3d ; absolute_x &3de2 20 2a 3c JSR &3c2a ; scale_number &3de5 18 CLC &3de6 65 36 ADC &36 ; origin_x &3de8 85 38 STA &38 ; x &3dea a5 3e LDA &3e ; absolute_y &3dec 20 2a 3c JSR &3c2a ; scale_number &3def 18 CLC &3df0 65 37 ADC &37 ; origin_y &3df2 85 39 STA &39 ; y &3df4 8a TXA ; picture data byte &3df5 29 03 AND #&03 &3df7 c9 02 CMP #&02 &3df9 f0 05 BEQ &3e00 ; is_line &3dfb b0 09 BCS &3e06 ; is_fill ; is_move # ......01 move &3dfd 4c f5 3c JMP &3cf5 ; draw_picture_loop ; is_draw_line # ......10 draw line &3e00 20 0e 3c JSR &3c0e ; draw_line &3e03 4c f5 3c JMP &3cf5 ; draw_picture_loop ; is_fill # ......11 fill &3e06 a6 38 LDX &38 ; x &3e08 84 30 STY &30 ; tmp_y &3e0a a4 39 LDY &39 ; y &3e0c a5 32 LDA &32 ; fill_colours &3e0e 20 19 40 JSR &4019 ; fill_region &3e11 a4 30 LDY &30 ; tmp_y &3e13 4c f5 3c JMP &3cf5 ; draw_picture_loop ; write_coordinates &3e16 a5 38 LDA &38 ; x &3e18 c9 d0 CMP #&d0 &3e1a 90 04 BCC &3e20 ; is_positive ; is_negative &3e1c a9 ff LDA #&ff &3e1e d0 02 BNE &3e22 ; set_x_high # Always branches ; is_positive &3e20 a9 00 LDA #&00 ; set_x_high &3e22 85 30 STA &30 ; x_high &3e24 a5 38 LDA &38 ; x &3e26 0a ASL A &3e27 26 30 ROL &30 ; x_high &3e29 0a ASL A &3e2a 26 30 ROL &30 ; x_high &3e2c 0a ASL A &3e2d 26 30 ROL &30 ; x_high &3e2f 20 ee ff JSR &ffee ; OSWRCH &3e32 a5 30 LDA &30 ; x_high &3e34 20 ee ff JSR &ffee ; OSWRCH &3e37 a9 00 LDA #&00 &3e39 85 30 STA &30 ; y_high &3e3b a5 39 LDA &39 ; y &3e3d 0a ASL A &3e3e 26 30 ROL &30 ; y_high &3e40 0a ASL A &3e41 26 30 ROL &30 ; y_high &3e43 20 ee ff JSR &ffee ; OSWRCH &3e46 a5 30 LDA &30 ; y_high &3e48 4c ee ff JMP &ffee ; OSWRCH ; fill_pixel &3e4b a5 5a LDA &5a ; pixel_x &3e4d c9 a0 CMP #&a0 &3e4f b0 33 BCS &3e84 ; leave # Leave if offscreen &3e51 29 fc AND #&fc &3e53 0a ASL A &3e54 08 PHP ; carry &3e55 18 CLC &3e56 a4 52 LDY &52 ; pixel_y &3e58 79 00 09 ADC &0900,Y ; row_addresses_low_table &3e5b 85 58 STA &58 ; pixel_screen_address_low &3e5d 8a TXA &3e5e 79 00 0a ADC &0a00,Y ; row_addresses_high_table &3e61 28 PLP ; carry &3e62 69 00 ADC #&00 &3e64 85 59 STA &59 ; pixel_screen_address_high &3e66 a5 5a LDA &5a ; pixel_x &3e68 29 03 AND #&03 &3e6a a8 TAY ; pixel in byte &3e6b a1 58 LDA (&58,X) ; pixel_screen_address &3e6d 39 c6 41 AND &41c6,Y ; colour_3_pixel_table &3e70 f0 01 BEQ &3e73 ; is_black &3e72 60 RTS # Don't plot if pixel not black ; is_black &3e73 98 TYA ; pixel in byte &3e74 45 52 EOR &52 ; pixel_y &3e76 29 01 AND #&01 &3e78 d0 0b BNE &3e85 ; is_odd ; is_even &3e7a a1 58 LDA (&58,X) ; pixel_screen_address &3e7c 39 c2 41 AND &41c2,Y ; fill_mask_table &3e7f 19 ba 41 ORA &41ba,Y ; fill_even_table &3e82 81 58 STA (&58,X) ; pixel_screen_address ; leave &3e84 60 RTS ; is_odd &3e85 a1 58 LDA (&58,X) ; pixel_screen_address &3e87 39 c2 41 AND &41c2,Y ; fill_mask_table &3e8a 19 be 41 ORA &41be,Y ; fill_odd_table &3e8d 81 58 STA (&58,X) ; pixel_screen_address &3e8f 60 RTS ; plot_circle # Called with X = x, Y = y, A = colour &3e90 86 5a STX &5a ; pixel_x &3e92 84 52 STY &52 ; pixel_y &3e94 a2 01 LDX #&01 # Populate fill_even_table &3e96 48 PHA ; fill_colour &3e97 20 4e 40 JSR &404e ; populate_fill_table &3e9a 68 PLA ; fill_colour &3e9b 4a LSR A &3e9c 4a LSR A &3e9d a2 05 LDX #&05 # Populate fill_odd_table &3e9f 20 4e 40 JSR &404e ; populate_fill_table &3ea2 a2 00 LDX #&00 &3ea4 f0 0d BEQ &3eb3 ; plot_circle_quarter # Always branches ; leave &3ea6 60 RTS ; consider_next_quarter &3ea7 e6 4a INC &4a ; circle_quarter &3ea9 a5 4a LDA &4a ; circle_quarter &3eab 29 03 AND #&03 &3ead 85 4a STA &4a ; circle_quarter &3eaf c6 4b DEC &4b ; circle_quarters_to_plot &3eb1 f0 f3 BEQ &3ea6 ; leave ; plot_circle_quarter &3eb3 a5 5a LDA &5a ; pixel_x &3eb5 85 50 STA &50 ; circle_origin_x # Not centre of circle &3eb7 a5 52 LDA &52 ; pixel_y &3eb9 85 51 STA &51 ; circle_origin_y &3ebb 20 4b 3e JSR &3e4b ; fill_pixel # Plot starting pixel &3ebe a9 00 LDA #&00 &3ec0 85 55 STA &55 ; delta_low &3ec2 85 56 STA &56 ; delta_high &3ec4 85 4d STA &4d ; circle_sin &3ec6 38 SEC &3ec7 e5 54 SBC &54 ; circle_size &3ec9 85 4c STA &4c ; circle_minus_cos ; plot_circle_loop &3ecb a5 4c LDA &4c ; circle_minus_cos &3ecd f0 d8 BEQ &3ea7 ; consider_next_quarter &3ecf 0a ASL A &3ed0 85 44 STA &44 ; circle_twice_minus_cos_low &3ed2 a9 ff LDA #&ff &3ed4 2a ROL A &3ed5 85 45 STA &45 ; circle_twice_minus_cos_high &3ed7 18 CLC &3ed8 a5 44 LDA &44 ; circle_twice_minus_cos_low &3eda 65 55 ADC &55 ; delta_low &3edc 85 44 STA &44 ; circle_twice_minus_cos_low &3ede a5 45 LDA &45 ; circle_twice_minus_cos_high &3ee0 65 56 ADC &56 ; delta_high &3ee2 85 45 STA &45 ; circle_twice_minus_cos_high &3ee4 e6 44 INC &44 ; circle_twice_minus_cos_low &3ee6 d0 02 BNE &3eea ; skip_overflow_cos &3ee8 e6 45 INC &45 ; circle_twice_minus_cos_high ; skip_overflow_cos &3eea a5 4d LDA &4d ; circle_sin &3eec 0a ASL A &3eed 85 46 STA &46 ; circle_twice_sin_low &3eef a9 00 LDA #&00 &3ef1 69 00 ADC #&00 &3ef3 85 47 STA &47 ; circle_twice_sin_high &3ef5 a5 46 LDA &46 ; circle_twice_sin_low &3ef7 65 55 ADC &55 ; delta_low &3ef9 85 46 STA &46 ; circle_twice_sin_low &3efb a5 47 LDA &47 ; circle_twice_sin_high &3efd 65 56 ADC &56 ; delta_high &3eff 85 47 STA &47 ; circle_twice_sin_high &3f01 e6 46 INC &46 ; circle_twice_sin_low &3f03 d0 02 BNE &3f07 ; skip_overflow_sin &3f05 e6 47 INC &47 ; circle_twice_sin_high ; skip_overflow_sin &3f07 a5 44 LDA &44 ; circle_twice_minus_cos_low &3f09 65 46 ADC &46 ; circle_twice_sin_low &3f0b 85 48 STA &48 ; circle_twice_sin_minus_cos_low &3f0d a5 45 LDA &45 ; circle_twice_minus_cos_high &3f0f 65 47 ADC &47 ; circle_twice_sin_high &3f11 85 49 STA &49 ; circle_twice_sin_minus_cos_high &3f13 a5 48 LDA &48 ; circle_twice_sin_minus_cos_low &3f15 38 SEC &3f16 e5 55 SBC &55 ; delta_low &3f18 85 48 STA &48 ; circle_twice_sin_minus_cos_low &3f1a a5 49 LDA &49 ; circle_twice_sin_minus_cos_high &3f1c e5 56 SBC &56 ; delta_high &3f1e 85 49 STA &49 ; circle_twice_sin_minus_cos_high ; calculate_absolute_cos &3f20 a5 45 LDA &45 ; circle_twice_minus_cos_high &3f22 30 09 BMI &3f2d ; is_negative_minus_cos ; is_positive_minus_cos &3f24 85 41 STA &41 ; circle_absolute_twice_cos_high &3f26 a5 44 LDA &44 ; circle_twice_minus_cos_low &3f28 85 40 STA &40 ; circle_absolute_twice_cos_low &3f2a 4c 3a 3f JMP &3f3a ; calculate_absolute_sin ; is_negative_minus_cos &3f2d a9 00 LDA #&00 &3f2f 38 SEC &3f30 e5 44 SBC &44 ; circle_twice_minus_cos_low &3f32 85 40 STA &40 ; circle_absolute_twice_cos_low &3f34 a9 00 LDA #&00 &3f36 e5 45 SBC &45 ; circle_twice_minus_cos_high &3f38 85 41 STA &41 ; circle_absolute_twice_cos_high ; calculate_absolute_sin &3f3a a5 47 LDA &47 ; circle_twice_sin_high &3f3c 30 09 BMI &3f47 ; is_negative_sin ; is_positive_sin &3f3e 85 43 STA &43 ; circle_absolute_twice_sin_high &3f40 a5 46 LDA &46 ; circle_twice_sin_low &3f42 85 42 STA &42 ; circle_absolute_twice_sin_low &3f44 4c 54 3f JMP &3f54 ; calculate_absolute_sin_minus_cos ; is_negative_sin &3f47 a9 00 LDA #&00 &3f49 38 SEC &3f4a e5 46 SBC &46 ; circle_twice_sin_low &3f4c 85 42 STA &42 ; circle_absolute_twice_sin_low &3f4e a9 00 LDA #&00 &3f50 e5 47 SBC &47 ; circle_twice_sin_high &3f52 85 43 STA &43 ; circle_absolute_twice_sin_high ; calculate_absolute_sin_minus_cos &3f54 a5 49 LDA &49 ; circle_twice_sin_minus_cos_high &3f56 30 09 BMI &3f61 ; is_negative_sin_minus_cos ; is_positive_sin_minus_cos &3f58 85 5d STA &5d ; circle_absolute_twice_sin_minus_cos_high &3f5a a5 48 LDA &48 ; circle_twice_sin_minus_cos_low &3f5c 85 5c STA &5c ; circle_absolute_twice_sin_minus_cos_low &3f5e 4c 6e 3f JMP &3f6e ; compare_absolute_sin_and_absolute_cos ; is_negative_sin_minus_cos &3f61 a9 00 LDA #&00 &3f63 38 SEC &3f64 e5 48 SBC &48 ; circle_twice_sin_minus_cos_low &3f66 85 5c STA &5c ; circle_absolute_twice_sin_minus_cos_low &3f68 a9 00 LDA #&00 &3f6a e5 49 SBC &49 ; circle_twice_sin_minus_cos_high &3f6c 85 5d STA &5d ; circle_absolute_twice_sin_minus_cos_high ; compare_absolute_sin_and_absolute_cos &3f6e a5 41 LDA &41 ; circle_absolute_twice_cos_high &3f70 c5 43 CMP &43 ; circle_absolute_twice_sin_high &3f72 90 25 BCC &3f99 ; is_absolute_sin_greater_than_absolute_cos &3f74 d0 06 BNE &3f7c ; is_absolute_cos_greater_than_absolute_sin &3f76 a5 40 LDA &40 ; circle_absolute_twice_cos_low &3f78 c5 42 CMP &42 ; circle_absolute_twice_sin_low &3f7a 90 1d BCC &3f99 ; is_absolute_sin_greater_than_absolute_cos ; is_absolute_cos_greater_than_absolute_sin &3f7c a5 43 LDA &43 ; circle_absolute_twice_sin_high &3f7e c5 5d CMP &5d ; circle_absolute_twice_sin_minus_cos_high &3f80 90 32 BCC &3fb4 ; add_to_cos &3f82 d0 06 BNE &3f8a ; add_to_sin_and_cos &3f84 a5 42 LDA &42 ; circle_absolute_twice_sin_low &3f86 c5 5c CMP &5c ; circle_absolute_twice_sin_minus_cos_low &3f88 90 2a BCC &3fb4 ; add_to_cos ; add_to_sin_and_cos &3f8a e6 4c INC &4c ; circle_minus_cos &3f8c e6 4d INC &4d ; circle_sin &3f8e a5 48 LDA &48 ; circle_twice_sin_minus_cos_low &3f90 85 55 STA &55 ; delta_low &3f92 a5 49 LDA &49 ; circle_twice_sin_minus_cos_high &3f94 85 56 STA &56 ; delta_high &3f96 4c be 3f JMP &3fbe ; consider_quarter ; is_absolute_sin_greater_than_absolute_cos &3f99 a5 41 LDA &41 ; circle_absolute_twice_cos_high &3f9b c5 5d CMP &5d ; circle_absolute_twice_sin_minus_cos_high &3f9d 90 08 BCC &3fa7 ; add_to_sin &3f9f d0 e9 BNE &3f8a ; add_to_sin_and_cos &3fa1 a5 40 LDA &40 ; circle_absolute_twice_cos_low &3fa3 c5 5c CMP &5c ; circle_absolute_twice_sin_minus_cos_low &3fa5 b0 e3 BCS &3f8a ; add_to_sin_and_cos ; add_to_sin &3fa7 e6 4c INC &4c ; circle_minus_cos &3fa9 a5 44 LDA &44 ; circle_twice_minus_cos_low &3fab 85 55 STA &55 ; delta_low &3fad a5 45 LDA &45 ; circle_twice_minus_cos_high &3faf 85 56 STA &56 ; delta_high &3fb1 4c be 3f JMP &3fbe ; consider_quarter ; add_to_cos &3fb4 e6 4d INC &4d ; circle_sin &3fb6 a5 46 LDA &46 ; circle_twice_sin_low &3fb8 85 55 STA &55 ; delta_low &3fba a5 47 LDA &47 ; circle_twice_sin_high &3fbc 85 56 STA &56 ; delta_high ; consider_quarter &3fbe a5 54 LDA &54 ; circle_size &3fc0 18 CLC &3fc1 65 4c ADC &4c ; circle_minus_cos &3fc3 85 5e STA &5e ; circle_size_minus_cos &3fc5 a5 4a LDA &4a ; circle_quarter &3fc7 f0 1f BEQ &3fe8 ; is_quarter_0 &3fc9 c9 02 CMP #&02 &3fcb 90 27 BCC &3ff4 ; is_quarter_1 &3fcd f0 3b BEQ &400a ; is_quarter_2 ; is_quarter_3 &3fcf a5 51 LDA &51 ; circle_origin_y &3fd1 18 CLC &3fd2 65 4d ADC &4d ; circle_sin &3fd4 85 52 STA &52 ; pixel_y &3fd6 a5 5e LDA &5e ; circle_size_minus_cos ; consider_scaling_positive_x &3fd8 24 4e BIT &4e ; circle_aspect # Top bit set to plot ellipse, clear to plot circle &3fda 30 01 BMI &3fdd ; is_ellipse ; is_circle &3fdc 4a LSR A ; is_ellipse ; plot_circle_pixel &3fdd 18 CLC &3fde 65 50 ADC &50 ; circle_origin_x &3fe0 85 5a STA &5a ; pixel_x &3fe2 20 4b 3e JSR &3e4b ; fill_pixel &3fe5 4c cb 3e JMP &3ecb ; plot_circle_loop ; is_quarter_0 &3fe8 a5 51 LDA &51 ; circle_origin_y &3fea 38 SEC &3feb e5 5e SBC &5e ; circle_size_minus_cos &3fed 85 52 STA &52 ; pixel_y &3fef a5 4d LDA &4d ; circle_sin &3ff1 4c d8 3f JMP &3fd8 ; consider_scaling_positive_x ; is_quarter_1 &3ff4 a5 51 LDA &51 ; circle_origin_y &3ff6 38 SEC &3ff7 e5 4d SBC &4d ; circle_sin &3ff9 85 52 STA &52 ; pixel_y &3ffb a9 00 LDA #&00 &3ffd 38 SEC &3ffe e5 5e SBC &5e ; circle_size_minus_cos ; consider_scaling_negative_x &4000 f0 db BEQ &3fdd ; plot_circle_pixel &4002 24 4e BIT &4e ; circle_aspect # Top bit set to plot ellipse, clear to plot circle &4004 30 d7 BMI &3fdd ; plot_circle_pixel &4006 38 SEC &4007 6a ROR A &4008 30 d3 BMI &3fdd ; plot_circle_pixel # Always branches ; is_quarter_2 &400a a5 51 LDA &51 ; circle_origin_y &400c 18 CLC &400d 65 5e ADC &5e ; circle_size_minus_cos &400f 85 52 STA &52 ; pixel_y &4011 a9 00 LDA #&00 &4013 38 SEC &4014 e5 4d SBC &4d ; circle_sin &4016 4c 00 40 JMP &4000 ; consider_scaling_negative_x ; fill_region # Called with X = x, Y = y, A = fill_colour &4019 84 52 STY &52 ; pixel_y &401b 86 53 STX &53 ; fill_left_x &401d 86 54 STX &54 ; fill_right_x &401f 86 5a STX &5a ; pixel_x &4021 ba TSX &4022 86 44 STX &44 ; stack_pointer_before_fill_region &4024 a2 01 LDX #&01 # Populate fill_even_table &4026 86 55 STX &55 ; fill_y_delta &4028 48 PHA ; fill_colour &4029 20 4e 40 JSR &404e ; populate_fill_table &402c 68 PLA ; fill_colour &402d a2 05 LDX #&05 # Populate fill_odd_table &402f 4a LSR A &4030 4a LSR A &4031 20 4e 40 JSR &404e ; populate_fill_table &4034 a2 00 LDX #&00 &4036 20 94 41 JSR &4194 ; get_pixel &4039 d0 12 BNE &404d ; leave &403b 20 7c 41 JSR &417c ; push_fill_state_to_stack # Doesn't return if close to stack overflow &403e 20 64 40 JSR &4064 ; fill_row # Fill downwards &4041 a9 ff LDA #&ff &4043 85 55 STA &55 ; fill_y_delta &4045 c6 52 DEC &52 ; pixel_y &4047 20 7c 41 JSR &417c ; push_fill_state_to_stack # Doesn't return if close to stack overflow &404a 20 64 40 JSR &4064 ; fill_row # Fill upwards ; leave &404d 60 RTS ; populate_fill_table # Called with A = fill_colour &404e 29 03 AND #&03 # X = 1 to populate fill_even_table &4050 a8 TAY # X = 5 to populate fill_odd_table &4051 b9 ca 41 LDA &41ca,Y ; right_pixel_colour_table &4054 9d bc 41 STA &41bc,X ; fill_even_table + 2 # Or fill_odd_table if X = 5 &4057 0a ASL A &4058 9d bb 41 STA &41bb,X ; fill_even_table + 1 &405b 0a ASL A &405c 9d ba 41 STA &41ba,X ; fill_even_table &405f 0a ASL A &4060 9d b9 41 STA &41b9,X ; fill_even_table - 1 &4063 60 RTS ; fill_row &4064 a2 00 LDX #&00 &4066 86 5b STX &5b ; something_to_fill # Set to positive to indicate nothing to fill &4068 a5 53 LDA &53 ; fill_left_x &406a 18 CLC &406b 65 54 ADC &54 ; fill_right_x &406d 6a ROR A &406e 85 5a STA &5a ; pixel_x # Start at (left_x + right_x) / 2 &4070 20 94 41 JSR &4194 ; get_pixel &4073 d0 1d BNE &4092 ; fill_row_to_right # If starting pixel is not empty, nothing to fill &4075 a5 31 LDA &31 ; colour &4077 f0 04 BEQ &407d ; find_left_of_row_with_two_pixels # Branch if KR &4079 c9 07 CMP #&07 &407b d0 07 BNE &4084 ; find_left_of_row # Branch if not KG ; find_left_of_row_with_two_pixels # If filling with a dither that includes black, &407d a1 58 LDA (&58,X) ; pixel_screen_address &407f 39 f0 41 AND &41f0,Y ; colour_3_pixel_pairs_table # check for two empty pixels &4082 d0 0e BNE &4092 ; fill_row_to_right # If pair of starting pixels not empty, nothing to fill ; find_left_of_row &4084 c6 5a DEC &5a ; pixel_x &4086 c6 5b DEC &5b ; something_to_fill # Set to negative to indicate something to fill ; find_left_of_row_loop &4088 20 94 41 JSR &4194 ; get_pixel &408b d0 05 BNE &4092 ; fill_row_to_right # Move left until non-empty pixel found &408d c6 5a DEC &5a ; pixel_x &408f 4c 88 40 JMP &4088 ; find_left_of_row_loop ; fill_row_to_right &4092 a4 5a LDY &5a ; pixel_x &4094 c8 INY # Move right to first empty pixel &4095 84 56 STY &56 ; fill_first_x # Leftmost pixel that was filled in this row &4097 84 5a STY &5a ; pixel_x &4099 24 5b BIT &5b ; something_to_fill # Negative if something to fill &409b 10 24 BPL &40c1 ; nothing_to_fill ; fill_row_to_right_loop &409d 20 94 41 JSR &4194 ; get_pixel &40a0 d0 5b BNE &40fd ; end_of_fill &40a2 98 TYA &40a3 45 52 EOR &52 ; pixel_y &40a5 29 01 AND #&01 &40a7 d0 0c BNE &40b5 ; is_odd ; is_even &40a9 a1 58 LDA (&58,X) ; pixel_screen_address &40ab 19 ba 41 ORA &41ba,Y ; fill_even_table &40ae 81 58 STA (&58,X) ; pixel_screen_address &40b0 e6 5a INC &5a ; pixel_x &40b2 4c 9d 40 JMP &409d ; fill_row_to_right_loop ; is_odd &40b5 a1 58 LDA (&58,X) ; pixel_screen_address &40b7 19 be 41 ORA &41be,Y ; fill_odd_table &40ba 81 58 STA (&58,X) ; pixel_screen_address &40bc e6 5a INC &5a ; pixel_x &40be 4c 9d 40 JMP &409d ; fill_row_to_right_loop ; nothing_to_fill &40c1 a5 54 LDA &54 ; fill_right_x &40c3 c5 53 CMP &53 ; fill_left_x &40c5 f0 1b BEQ &40e2 ; leave_after_restoring_previous_fill_state &40c7 20 7c 41 JSR &417c ; push_fill_state_to_stack # Doesn't return if close to stack overflow &40ca a5 53 LDA &53 ; fill_left_x &40cc 18 CLC &40cd 65 54 ADC &54 ; fill_right_x &40cf 6a ROR A &40d0 85 54 STA &54 ; fill_right_x # right_x = (left_x + right_x) / 2 &40d2 20 64 40 JSR &4064 ; fill_row # Try filling this row from left to halfway &40d5 a5 53 LDA &53 ; fill_left_x &40d7 18 CLC &40d8 65 54 ADC &54 ; fill_right_x &40da 6a ROR A &40db 85 53 STA &53 ; fill_left_x &40dd e6 53 INC &53 ; fill_left_x # left_x = ((right_x + left_x) / 2) + 1 &40df 4c 64 40 JMP &4064 ; fill_row # Try filling this row from halfway to right ; leave_after_restoring_previous_fill_state &40e2 68 PLA ; return address low &40e3 aa TAX ; return address low &40e4 68 PLA ; return address high &40e5 a8 TAY ; return address high &40e6 68 PLA ; pixel_y &40e7 85 52 STA &52 ; pixel_y &40e9 68 PLA ; fill_left_x &40ea 85 53 STA &53 ; fill_left_x &40ec 68 PLA ; fill_right_x &40ed 85 54 STA &54 ; fill_right_x &40ef 68 PLA ; fill_y_delta &40f0 85 55 STA &55 ; fill_y_delta &40f2 68 PLA ; fill_first_x &40f3 85 56 STA &56 ; fill_first_x &40f5 68 PLA ; fill_last_x &40f6 85 57 STA &57 ; fill_last_x &40f8 98 TYA ; return address high &40f9 48 PHA ; return address high &40fa 8a TXA ; return address low &40fb 48 PHA ; return address low &40fc 60 RTS # Leave to return address ; end_of_fill &40fd a6 5a LDX &5a ; pixel_x &40ff ca DEX &4100 86 57 STX &57 ; fill_last_x # Rightmost pixel that was filled in this row &4102 a6 54 LDX &54 ; fill_right_x &4104 e8 INX &4105 e4 57 CPX &57 ; fill_last_x &4107 b0 1a BCS &4123 ; skip_filling_previous_row_further_right # If fill extended right beyond previous row, ; fill_previous_row_further_right &4109 20 7c 41 JSR &417c ; push_fill_state_to_stack # Doesn't return if close to stack overflow &410c 38 SEC &410d a9 00 LDA #&00 &410f e5 55 SBC &55 ; fill_y_delta # Invert direction &4111 85 55 STA &55 ; fill_y_delta &4113 18 CLC &4114 65 52 ADC &52 ; pixel_y # Return to previous row &4116 85 52 STA &52 ; pixel_y &4118 a5 54 LDA &54 ; fill_right_x &411a 85 53 STA &53 ; fill_left_x &411c a5 57 LDA &57 ; fill_last_x &411e 85 54 STA &54 ; fill_right_x &4120 20 64 40 JSR &4064 ; fill_row # Try filling further right in previous row ; skip_filling_previous_row_further_right &4123 a6 57 LDX &57 ; fill_last_x &4125 e8 INX &4126 e4 54 CPX &54 ; fill_right_x &4128 b0 0a BCS &4134 ; skip_filling_this_row_further_right # If fill didn't extend right beyond previous row, ; fill_this_row_further_right &412a 20 7c 41 JSR &417c ; push_fill_state_to_stack # Doesn't return if close to stack overflow &412d a5 57 LDA &57 ; fill_last_x &412f 85 53 STA &53 ; fill_left_x &4131 20 64 40 JSR &4064 ; fill_row # Try filling this row further right ; skip_filling_this_row_further_right &4134 a6 56 LDX &56 ; fill_first_x &4136 e8 INX &4137 e4 53 CPX &53 ; fill_left_x &4139 b0 1a BCS &4155 ; skip_filling_previous_row_further_left # If fill extended left beyond previous row, ; fill_previous_row_further_left &413b 20 7c 41 JSR &417c ; push_fill_state_to_stack # Doesn't return if close to stack overflow &413e a9 00 LDA #&00 &4140 38 SEC &4141 e5 55 SBC &55 ; fill_y_delta # Invert direction &4143 85 55 STA &55 ; fill_y_delta &4145 18 CLC &4146 65 52 ADC &52 ; pixel_y # Return to previous row &4148 85 52 STA &52 ; pixel_y &414a a5 53 LDA &53 ; fill_left_x &414c 85 54 STA &54 ; fill_right_x &414e a5 56 LDA &56 ; fill_first_x &4150 85 53 STA &53 ; fill_left_x &4152 20 64 40 JSR &4064 ; fill_row # Try filling further left in previous row ; skip_filling_previous_row_further_left &4155 a6 53 LDX &53 ; fill_left_x &4157 e8 INX &4158 e4 56 CPX &56 ; fill_first_x &415a b0 0a BCS &4166 ; skip_filling_this_row_further_right # If fill didn't extend left beyond previous row, ; fill_this_row_further_left &415c 20 7c 41 JSR &417c ; push_fill_state_to_stack # Doesn't return if close to stack overflow &415f a5 56 LDA &56 ; fill_first_x &4161 85 54 STA &54 ; fill_right_x &4163 20 64 40 JSR &4064 ; fill_row # Try filling this row further left ; skip_filling_this_row_further_left &4166 a5 52 LDA &52 ; pixel_y &4168 18 CLC &4169 65 55 ADC &55 ; fill_y_delta # Move to next row &416b 85 52 STA &52 ; pixel_y &416d a5 56 LDA &56 ; fill_first_x &416f 85 53 STA &53 ; fill_left_x # Leftmost extent of previous fill &4171 a5 57 LDA &57 ; fill_last_x &4173 85 54 STA &54 ; fill_right_x # Rightmost extent of previous fill &4175 4c 64 40 JMP &4064 ; fill_row # Try filling next row ; leave_fill_region &4178 a6 44 LDX &44 ; stack_pointer_before_fill_region &417a 9a TXS &417b 60 RTS ; push_fill_state_to_stack &417c ba TSX &417d e0 0a CPX #&0a &417f 90 f7 BCC &4178 ; leave_fill_region &4181 68 PLA ; return address low ? &4182 85 50 STA &50 ; return_address_low &4184 68 PLA ; return address high &4185 85 51 STA &51 ; return_address_high &4187 a0 08 LDY #&08 ; push_fill_state_to_stack_loop # Push &57 fill_last_x, &56 fill_first_x &4189 b9 4f 00 LDA &004f,Y # &54 fill_y_delta, &54 fill_right_x &418c 48 PHA # &53 fill_left_x, &52 pixel_y &418d 88 DEY # &51 return_address_high, &50 return_address_low &418e d0 f9 BNE &4189 ; push_fill_state_to_stack_loop &4190 60 RTS # Leave to return_address ; leave_with_negative &4191 a9 ff LDA #&ff &4193 60 RTS ; get_pixel # Called with X = 0 &4194 a5 5a LDA &5a ; pixel_x &4196 c9 a0 CMP #&a0 &4198 b0 f7 BCS &4191 ; leave_with_negative &419a 29 fc AND #&fc &419c 0a ASL A &419d 08 PHP ; carry &419e 18 CLC &419f a4 52 LDY &52 ; pixel_y &41a1 79 00 09 ADC &0900,Y ; row_addresses_low_table &41a4 85 58 STA &58 ; pixel_screen_address_low &41a6 8a TXA ; 0 &41a7 79 00 0a ADC &0a00,Y ; row_addresses_high_table &41aa 28 PLP ; carry &41ab 69 00 ADC #&00 &41ad 85 59 STA &59 ; pixel_screen_address_high &41af a5 5a LDA &5a ; pixel_x &41b1 29 03 AND #&03 &41b3 a8 TAY &41b4 b9 c6 41 LDA &41c6,Y ; colour_3_pixel_table &41b7 21 58 AND (&58,X) ; pixel_screen_address &41b9 60 RTS ; fill_even_table # Values are overwritten. Source code fragment (&41ba - &41c1) &41ba 0d 0a 78 28 ; 2680LDAP ... ; fill_odd_table # Values are overwritten &41be 4c 44 41 50 ; fill_mask_table &41c2 77 bb dd ee ; colour_3_pixel_table &41c6 88 44 22 11 ; right_pixel_colour_table &41ca 00 01 10 11 ; fill_colours_table ; 0 1 2 3 4 5 6 7 ; KR RR GG BB RG RB GB KG &41ce 04 05 0a 0f 09 0d 0e 08 ; initialise_mode_5_string &41d6 04 19 ; MOVE &41d8 00 00 00 04 03 13 ; set colour 3 to blue &41de 00 00 00 02 02 13 ; set colour 2 to green &41e4 00 00 00 00 00 00 20 0a 00 17 ; disable cursor &41ee 05 16 ; change to MODE 5 ; colour_3_pixel_pairs_table &41f0 88 cc 66 33 ; 3000 3300 0330 0033 ; unused # Source code fragment &41f4 3a 4c 44 41 28 50 52 25 29 2c 59 3a ; ... :LDA(PR%),Y: ... ; handle_look &4200 20 bd 20 JSR &20bd ; check_if_room_is_lit # Returns positive if room is lit &4203 30 21 BMI &4226 ; to_write_room_description &4205 20 df 12 JSR &12df ; check_for_object_carried_by_player &4208 d0 41 BNE &424b ; handle_look_carried_object &420a a9 00 LDA #&00 &420c 85 62 STA &62 ; words_matched &420e a9 29 LDA #&29 ; "picture" &4210 20 2f 15 JSR &152f ; check_for_word_in_input &4213 a5 62 LDA &62 ; words_matched &4215 f0 0f BEQ &4226 ; to_write_room_description ; handle_look_picture &4217 a5 89 LDA &89 ; player_room &4219 d0 0e BNE &4229 ; not_in_wooden_cabin # Branch if not ROOM_00 ("inside a wooden cabin") ; draw_picture_55_and_return_to_mode_7 &421b a2 55 LDX #&55 ; PICTURE_55 # Draw picture of bridge ; draw_picture_X_and_return_to_mode_7 &421d 20 12 0b JSR &0b12 ; draw_picture &4220 20 35 3b JSR &3b35 ; delay_three &4223 20 c0 1f JSR &1fc0 ; initialise_mode_7_screen ; to_write_room_description &4226 4c ea 20 JMP &20ea ; write_room_description ; not_in_wooden_cabin &4229 c9 57 CMP #&57 ; ROOM_57 ("in the throne room") &422b d0 0c BNE &4239 ; not_in_throne_room &422d 20 1b 42 JSR &421b ; draw_picture_55_and_return_to_mode_7 &4230 a2 4e LDX #&4e ; PICTURE_4e # Draw picture of cabin &4232 20 1d 42 JSR &421d ; draw_picture_X_and_return_to_mode_7 ; draw_picture_51_and_return_to_mode_7 &4235 a2 51 LDX #&51 ; PICTURE_51 # Draw picture of waterfall &4237 d0 e4 BNE &421d ; draw_picture_X_and_return_to_mode_7 ; not_in_throne_room &4239 c9 56 CMP #&56 ; ROOM_56 ("in a room") &423b d0 04 BNE &4241 ; not_in_a_room ; draw_picture_54_and_return_to_mode_7 &423d a2 54 LDX #&54 ; PICTURE_54 # Draw picture of stream &423f d0 dc BNE &421d ; draw_picture_X_and_return_to_mode_7 ; not_in_a_room &4241 c9 38 CMP #&38 ; ROOM_38 ("in the study") &4243 f0 f0 BEQ &4235 ; draw_picture_51_and_return_to_mode_7 &4245 c9 5b CMP #&5b ; ROOM_5b ("in the royal bedroom") &4247 f0 f4 BEQ &423d ; draw_picture_54_and_return_to_mode_7 &4249 d0 db BNE &4226 ; to_write_room_description # Always branches ; handle_look_carried_object &424b a6 63 LDX &63 ; input_object &424d bd 7f 25 LDA &257f,X ; objects_description - 1 &4250 a2 06 LDX #&06 ; check_if_object_with_picture_loop &4252 dd f2 42 CMP &42f2,X ; objects_with_pictures_table &4255 f0 0c BEQ &4263 ; is_object_with_picture &4257 ca DEX &4258 10 f8 BPL &4252 ; check_if_object_with_picture_loop &425a 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &425d ef f0 00 ; "Seems ordinary" &4260 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; is_object_with_picture &4263 bd f9 42 LDA &42f9,X ; objects_with_pictures_picture_table &4266 aa TAX &4267 e0 c3 CPX #&c3 ; PICTURE_c3 &4269 d0 b2 BNE &421d ; draw_picture_X_and_return_to_mode_7 ; is_secret_of_life &426b 20 03 13 JSR &1303 ; write_score &426e a5 28 LDA &28 ; score_high &4270 c9 04 CMP #&04 &4272 d0 2b BNE &429f ; leave ; completion_screen &4274 a9 af LDA #&af ; ROOM_af ("at the end of your life here") &4276 20 5a 24 JSR &245a ; set_player_room &4279 a2 c3 LDX #&c3 ; PICTURE_c3 &427b 20 1d 42 JSR &421d ; draw_picture_X_and_return_to_mode_7 &427e 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &4281 5d 4d 6b 58 3e f1 f2 f3 39 f4 3e 5d 29 6b 38 00 ; "The secret of life is simple yet complex, as is the picture of it" &4291 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &4294 20 eb 3b JSR &3beb ; write_nine_spaces &4297 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &429a f5 9c 00 ; "Stay cool" ; infinite_loop &429d d0 fe BNE &429d ; infinite_loop ; leave &429f 60 RTS ; update_world &42a0 a5 89 LDA &89 ; player_room &42a2 c9 93 CMP #&93 ; ROOM_93 ("in a small cave in the west mountains") &42a4 d0 16 BNE &42bc ; to_update_world_part_two &42a6 a2 2b LDX #&2b ; OBJECT_TREASURE_CHEST &42a8 20 8d 3b JSR &3b8d ; check_if_object_is_carried_or_in_holdall # Returns zero if object carried &42ab d0 12 BNE &42bf ; not_carrying_treasure_chest ; is_carrying_treasure_chest &42ad 20 fb 24 JSR &24fb ; get_room_exit_count_and_data_offset &42b0 a4 7b LDY &7b ; room_data_offset &42b2 a9 c8 LDA #&c8 # Was &88 (extended, east); set &40 to open exit &42b4 91 77 STA (&77),Y ; room_data_address # Set first byte of exit data &42b6 c8 INY &42b7 c8 INY &42b8 a9 47 LDA #&47 # Was &00 (rockfall); set to &47 (stone archway) &42ba 91 77 STA (&77),Y ; room_data_address # Set third byte of exit data ; to_update_world_part_two &42bc 4c 03 0f JMP &0f03 ; update_world_part_two ; not_carrying_treasure_chest &42bf 20 fb 24 JSR &24fb ; get_room_exit_count_and_data_offset &42c2 a4 7b LDY &7b ; room_data_offset &42c4 b1 77 LDA (&77),Y ; room_data_address &42c6 c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &42c8 f0 f2 BEQ &42bc ; to_update_world_part_two &42ca 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &42cd 5d 51 99 f6 6b 5d 53 6b 5d 54 e3 39 87 f7 f8 02 95 87 f9 fa fb 50 fc 5d 67 68 6b 5d 52 4f 00 ; "The deep magical voice of the keeper of the mountains says, you may pass east if you prove yourself worthy by bringing the treasure chest of the desert king" &42ec 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &42ef 4c 03 0f JMP &0f03 ; update_world_part_two ; objects_with_pictures_table &42f2 16 ; "a long wooden staff" &42f3 0e ; "a short dagger" &42f4 08 ; "a crystal ball" &42f5 0f ; "a broad sword" &42f6 07 ; "a short wooden rod" &42f7 13 ; "a large cut diamond" &42f8 24 ; "the secret of life" ; objects_with_pictures_picture_table &42f9 b9 ; PICTURE_b9 &42fa bb ; PICTURE_bb &42fb c2 ; PICTURE_c2 &42fc 99 ; PICTURE_99 &42fd bd ; PICTURE_bd &42fe bf ; PICTURE_bf &42ff c3 ; PICTURE_c3 ; picture_data_addresses_low_table ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &4300 90 92 9b be b0 c5 e4 f1 fa 4c 0f 5d 64 6f 78 80 ; &00 &4310 a1 d6 01 31 4c 55 60 6f 7a 85 94 9f a9 ec 07 1c ; &10 &4320 3a 3d 58 72 94 d1 ba 31 3a 51 63 ec ef f2 f5 fd ; &20 &4330 1c 83 88 01 0b 66 6d ae bd c8 d5 e8 05 16 cf 97 ; &30 &4340 b8 c3 6b d6 e7 f0 a2 fb 96 d1 90 93 1e 6f 86 06 ; &40 &4350 25 8b 3b 5a 90 95 fd 24 9a c1 c8 8c cf eb 40 c4 ; &50 &4360 d7 f6 fd 66 f3 f6 11 3c 45 9c bb f2 45 8a 66 7b ; &60 &4370 d2 e3 f4 0d 24 39 4d 94 9c a4 b1 be c7 18 43 8c ; &70 &4380 b7 de d6 15 2a 33 5d b3 0e 15 5d 8e 26 33 85 9c ; &80 &4390 48 85 ce d7 3e e0 09 77 64 a7 bc b7 4d 52 57 cf ; &90 &43a0 d8 73 dd ec 1e 12 2b 3e 53 60 56 66 89 a2 ac 99 ; &a0 &43b0 a7 e1 e5 30 ec a6 c7 15 38 4f f9 12 6b 94 1c 6a ; &b0 &43c0 bf dd b5 fb ; &c0 ; unused &43c4 81 31 2c 36 ; picture_data_addresses_high_table ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &43c8 44 44 44 44 44 44 44 44 44 45 45 45 45 45 45 45 ; &00 &43d8 45 45 46 46 46 46 46 46 46 46 46 46 46 46 47 47 ; &10 &43e8 47 47 47 47 47 47 47 48 48 48 48 48 48 48 48 55 ; &20 &43f8 49 49 49 4a 4a 4a 4a 4a 4a 4a 4a 4a 4b 4b 4b 4b ; &30 &4408 4b 4b 4b 4b 4b 4b 46 4b 4c 4c 4c 4c 4d 4d 4d 4a ; &40 &4418 4d 4d 4d 4d 4d 4d 47 48 4d 4d 4d 4b 4d 4d 4e 4e ; &50 &4428 4e 4e 4e 4f 4f 4f 50 50 50 50 50 50 51 50 51 51 ; &60 &4438 51 51 51 52 52 52 52 52 52 52 52 52 52 53 53 53 ; &70 &4448 53 53 53 54 54 54 54 54 55 55 55 55 55 55 54 54 ; &80 &4458 55 4e 54 54 4e 54 55 55 55 55 55 54 55 55 55 55 ; &90 &4468 55 50 55 55 48 56 56 56 56 56 54 54 56 56 56 56 ; &a0 &4478 56 56 4b 46 56 45 45 57 57 57 56 57 57 57 55 57 ; &b0 &4488 57 57 57 57 ; &c0 ; unused &448c 2d 1e 04 83 # Picture data # ============ # One or two bytes per action: # # X...YR01 xxxxyyyy move to (x, y), relative if R set, negative x if X set, negative y if Y set # XcccYR10 xxxxyyyy draw to (x, y), relative if R set, negative x if X set, negative y if Y set, colour c # XcccYR11 xxxxyyyy fill at (x, y), relative if R set, negative x if X set, negative y if Y set, colour c # # ccccc100 end repeat after c copies # # Eccc1000 ssssffqq draw circle (ellipse if E set), size s, q quarters starting from quarter f, colour c # # 1sss0000 pppppppp draw subpicture p, scale s # # 00010000 start repeat # # 00000000 end of picture data # # 0sss0000 set scaling limit to s + 1 ; picture_data ; picture_00_data # PICTURE_02 &4490 01 10 ; move (1, 0) ; picture_01_data # PICTURE_02, PICTURE_05, PICTURE_05 &4492 05 10 ; move +(1, 0) &4494 10 ; start repeat &4495 26 04 ; draw +(0, 4), green &4497 0d 2c ; move +(2, -4) &4499 1c ; end repeat after 4 copies &449a 00 ; end of picture ; picture_02_data # PICTURE_03, PICTURE_03, PICTURE_05, PICTURE_05 &449b 01 40 ; move (4, 0) &449d 10 ; start repeat &449e 85 c2 ; move +(-4, 2) &44a0 26 40 ; draw +(4, 0), green &44a2 1c ; end repeat after 4 copies &44a3 01 00 ; move (0, 0) &44a5 10 ; start repeat &44a6 90 01 ; subpicture &01, scale 0 &44a8 05 02 ; move +(0, 2) &44aa 90 00 ; subpicture &00, scale 0 &44ac 05 02 ; move +(0, 2) &44ae 0c ; end repeat after 2 copies &44af 00 ; end of picture ; picture_04_data # PICTURE_0a, PICTURE_0a, PICTURE_0a, PICTURE_0d &44b0 22 0a ; draw (0, 10), green &44b2 26 06 ; draw +(0, 6), green &44b4 26 40 ; draw +(4, 0), green &44b6 22 40 ; draw (4, 0), green &44b8 22 00 ; draw (0, 0), green &44ba 13 28 ; fill (2, 8), red &44bc 01 00 ; move (0, 0) ; picture_03_data # PICTURE_08 &44be 80 02 ; subpicture &02, scale 0 &44c0 01 08 ; move (0, 8) &44c2 80 02 ; subpicture &02, scale 0 &44c4 00 ; end of picture ; picture_05_data # PICTURE_0a, PICTURE_0a, PICTURE_0a, PICTURE_0a, PICTURE_0a &44c5 22 05 ; draw (0, 5), green &44c7 a0 06 ; subpicture &06, scale 0 &44c9 01 45 ; move (4, 5) &44cb 22 40 ; draw (4, 0), green &44cd 22 00 ; draw (0, 0), green &44cf 01 24 ; move (2, 4) &44d1 a0 01 ; subpicture &01, scale 0 &44d3 01 04 ; move (0, 4) &44d5 a0 01 ; subpicture &01, scale 0 &44d7 a0 07 ; subpicture &07, scale 0 &44d9 13 22 ; fill (2, 2), red &44db 01 00 ; move (0, 0) &44dd 90 02 ; subpicture &02, scale 0 &44df 01 20 ; move (2, 0) &44e1 90 02 ; subpicture &02, scale 0 &44e3 00 ; end of picture ; picture_06_data # PICTURE_05, PICTURE_05 &44e4 22 80 ; draw (8, 0), green &44e6 26 80 ; draw +(8, 0), green &44e8 01 10 ; move (1, 0) &44ea 10 ; start repeat &44eb 06 20 ; draw +(2, 0), black &44ed 05 20 ; move +(2, 0) &44ef 1c ; end repeat after 4 copies &44f0 00 ; end of picture ; picture_07_data # PICTURE_05, PICTURE_05 &44f1 01 10 ; move (1, 0) &44f3 10 ; start repeat &44f4 26 20 ; draw +(2, 0), green &44f6 05 20 ; move +(2, 0) &44f8 1c ; end repeat after 4 copies &44f9 00 ; end of picture ; picture_08_data # PICTURE_0a, PICTURE_0a, PICTURE_0e, PICTURE_0e, PICTURE_ae &44fa 22 08 ; draw (0, 8), green &44fc 26 08 ; draw +(0, 8), green &44fe 26 c0 ; draw +(12, 0), green &4500 22 c0 ; draw (12, 0), green &4502 22 00 ; draw (0, 0), green &4504 13 68 ; fill (6, 8), red &4506 01 00 ; move (0, 0) &4508 10 ; start repeat &4509 80 03 ; subpicture &03, scale 0 &450b 05 40 ; move +(4, 0) &450d 14 ; end repeat after 3 copies &450e 00 ; end of picture ; picture_0a_data # PICTURE_0b, PICTURE_0c, PICTURE_0d &450f 89 96 ; move (-7, -10) &4511 90 08 ; subpicture &08, scale 0 &4513 09 16 ; move (1, -10) &4515 90 08 ; subpicture &08, scale 0 &4517 81 86 ; move (-8, 6) &4519 80 05 ; subpicture &05, scale 0 &451b 89 be ; move (-5, -2) &451d 80 05 ; subpicture &05, scale 0 &451f 81 e6 ; move (-2, 6) &4521 80 05 ; subpicture &05, scale 0 &4523 09 1e ; move (1, -2) &4525 80 05 ; subpicture &05, scale 0 &4527 01 46 ; move (4, 6) &4529 80 05 ; subpicture &05, scale 0 &452b 89 9e ; move (-7, -2) &452d 90 04 ; subpicture &04, scale 0 &452f 89 fe ; move (-1, -2) &4531 90 04 ; subpicture &04, scale 0 &4533 09 5e ; move (5, -2) &4535 90 04 ; subpicture &04, scale 0 &4537 81 60 ; move (-10, 0) &4539 b2 82 ; draw (-8, 2), blue &453b b2 90 ; draw (-7, 0), blue &453d 01 70 ; move (7, 0) &453f 32 82 ; draw (8, 2), blue &4541 32 a0 ; draw (10, 0), blue &4543 53 0f ; fill (0, 15), red/blue &4545 01 03 ; move (0, 3) &4547 b8 93 ; ellipse size 9, 4 quarters from 0, blue &4549 c3 70 ; fill (-9, 0), red/green &454b 00 ; end of picture ; picture_09_data # PICTURE_0f &454c 01 10 ; move (1, 0) &454e 10 ; start repeat &454f 2e 08 ; draw +(0, -8), green &4551 05 38 ; move +(3, 8) &4553 14 ; end repeat after 3 copies &4554 09 0e ; move (0, -2) &4556 2a 8e ; draw (8, -2), green &4558 09 0b ; move (0, -5) &455a 2a 8b ; draw (8, -5), green &455c 00 ; end of picture ; picture_0b_data # ROOM_28 when drawbridge lowered, PICTURE_15, PICTURE_16, PICTURE_17, PICTURE_26 &455d 80 0a ; subpicture &0a, scale 0 &455f 09 09 ; move (0, -7) &4561 90 0f ; subpicture &0f, scale 0 &4563 00 ; end of picture ; picture_0c_data # ROOM_28 when drawbridge raised &4564 80 0a ; subpicture &0a, scale 0 &4566 89 f6 ; move (-1, -10) &4568 2a 16 ; draw (1, -10), green &456a 5b 0b ; fill (0, -5), red/blue &456c 3b 04 ; fill (0, -12), blue &456e 00 ; end of picture ; picture_0d_data # ROOM_2a, ROOM_2b, ROOM_2e, PICTURE_18, PICTURE_19, PICTURE_1a &456f 80 0a ; subpicture &0a, scale 0 &4571 89 f6 ; move (-1, -10) &4573 90 04 ; subpicture &04, scale 0 &4575 3b 04 ; fill (0, -12), blue &4577 00 ; end of picture ; picture_0e_data # ROOM_29 &4578 89 2a ; move (-14, -6) &457a 80 08 ; subpicture &08, scale 0 &457c 09 2a ; move (2, -6) &457e 80 08 ; subpicture &08, scale 0 ; picture_0f_data # PICTURE_0b, PICTURE_0b &4580 09 2a ; move (2, -6) &4582 aa ea ; draw (-2, -6), green &4584 ba c0 ; draw (-4, -16), blue &4586 3a 40 ; draw (4, -16), blue &4588 3a 2a ; draw (2, -6), blue &458a 5b 06 ; fill (0, -10), red/blue &458c 81 e6 ; move (-2, 6) &458e 90 09 ; subpicture &09, scale 0 &4590 22 26 ; draw (2, 6), green &4592 13 08 ; fill (0, 8), red &4594 a2 e6 ; draw (-2, 6), green &4596 22 0a ; draw (0, 10), green &4598 22 26 ; draw (2, 6), green &459a 22 08 ; draw (0, 8), green &459c bb b6 ; fill (-5, -10), blue &459e 3b 56 ; fill (5, -10), blue &45a0 00 ; end of picture ; picture_10_data # PICTURE_15, PICTURE_16, PICTURE_16, PICTURE_17, PICTURE_18, PICTURE_19, PICTURE_19, PICTURE_1a, PICTURE_26 &45a1 80 b5 ; subpicture &b5, scale 3 &45a3 80 b6 ; subpicture &b6, scale 3 &45a5 00 ; end of picture ; picture_b5_data # PICTURE_10, PICTURE_41, PICTURE_41, PICTURE_10 &45a6 32 33 ; draw (3, 3), blue &45a8 32 40 ; draw (4, 0), blue &45aa 32 65 ; draw (6, 5), blue &45ac 32 a0 ; draw (10, 0), blue &45ae 01 40 ; move (4, 0) &45b0 2a 3e ; draw (3, -2), green &45b2 81 60 ; move (-10, 0) &45b4 b2 a4 ; draw (-6, 4), blue &45b6 b2 c0 ; draw (-4, 0), blue &45b8 aa de ; draw (-3, -2), green &45ba 81 c0 ; move (-4, 0) &45bc b2 e2 ; draw (-2, 2), blue &45be 32 00 ; draw (0, 0), blue &45c0 aa ff ; draw (-1, -1), green &45c2 89 ac ; move (-6, -4) &45c4 a0 12 ; subpicture &12, scale 1 &45c6 00 ; end of picture ; picture_b6_data # PICTURE_10, PICTURE_42, PICTURE_42, PICTURE_10 &45c7 89 6b ; move (-10, -5) &45c9 aa 98 ; draw (-7, -8), green &45cb 89 a6 ; move (-6, -10) &45cd aa fa ; draw (-1, -6), green &45cf 2a 48 ; draw (4, -8), green &45d1 09 79 ; move (7, -7) &45d3 2a ab ; draw (10, -5), green &45d5 00 ; end of picture ; picture_11_data # PICTURE_11, PICTURE_11, PICTURE_14, PICTURE_14, PICTURE_21, PICTURE_24, PICTURE_c0 &45d6 81 60 ; move (-10, 0) &45d8 b2 68 ; draw (-10, 8), blue &45da ba 8c ; draw (-8, -4), blue &45dc ba c4 ; draw (-4, -12), blue &45de 89 a8 ; move (-6, -8) &45e0 ba cc ; draw (-4, -4), blue &45e2 32 0c ; draw (0, 12), blue &45e4 32 20 ; draw (2, 0), blue &45e6 3a 4c ; draw (4, -4), blue &45e8 09 08 ; move (0, -8) &45ea 32 80 ; draw (8, 0), blue &45ec 32 a8 ; draw (10, 8), blue &45ee 32 a0 ; draw (10, 0), blue &45f0 81 b8 ; move (-5, 8) &45f2 90 11 ; subpicture &11, scale 1 &45f4 89 bc ; move (-5, -4) &45f6 90 1b ; subpicture &1b, scale 1 &45f8 01 58 ; move (5, 8) &45fa 90 11 ; subpicture &11, scale 1 &45fc 01 50 ; move (5, 0) &45fe 90 1b ; subpicture &1b, scale 1 &4600 00 ; end of picture ; picture_12_data # PICTURE_b5, PICTURE_13, PICTURE_b5 &4601 09 08 ; move (0, -8) &4603 28 44 ; circle size 4, 1 quarters from 1, green &4605 22 00 ; draw (0, 0), green &4607 28 88 ; circle size 8, 1 quarters from 2, green &4609 81 c8 ; move (-4, 8) &460b 28 2d ; circle size 2, 2 quarters from 3, green &460d 01 04 ; move (0, 4) &460f 28 48 ; circle size 4, 1 quarters from 2, green &4611 22 0a ; draw (0, 10), green &4613 28 2d ; circle size 2, 2 quarters from 3, green &4615 01 2a ; move (2, 10) &4617 22 28 ; draw (2, 8), green &4619 01 4c ; move (4, 12) &461b 28 44 ; circle size 4, 1 quarters from 1, green &461d 28 2d ; circle size 2, 2 quarters from 3, green &461f 01 6c ; move (6, 12) &4621 28 84 ; circle size 8, 1 quarters from 1, green &4623 01 24 ; move (2, 4) &4625 2a 28 ; draw (2, -8), green &4627 09 44 ; move (4, -12) &4629 28 48 ; circle size 4, 1 quarters from 2, green &462b a8 35 ; ellipse size 3, 2 quarters from 1, green &462d 63 10 ; fill (1, 0), green/blue &462f 00 ; end of picture ; picture_b3_data # PICTURE_15, PICTURE_16, PICTURE_17, PICTURE_18, PICTURE_19, PICTURE_1a, PICTURE_41 &4630 40 ; set scaling limit to 5 ; picture_13_data # PICTURE_26 &4631 89 85 ; move (-8, -11) &4633 aa b8 ; draw (-5, -8), green &4635 2a 03 ; draw (0, -13), green &4637 09 47 ; move (4, -9) &4639 2a 65 ; draw (6, -11), green &463b 2a 96 ; draw (9, -10), green &463d 09 24 ; move (2, -12) &463f a0 12 ; subpicture &12, scale 1 &4641 81 b6 ; move (-5, 6) &4643 90 14 ; subpicture &14, scale 1 &4645 01 56 ; move (5, 6) &4647 90 14 ; subpicture &14, scale 1 &4649 63 0e ; fill (0, 14), green/blue &464b 00 ; end of picture ; picture_14_data # PICTURE_13, PICTURE_13, PICTURE_58, PICTURE_c0, PICTURE_c1, PICTURE_13, PICTURE_13 &464c 81 b8 ; move (-5, 8) &464e 90 11 ; subpicture &11, scale 1 &4650 01 58 ; move (5, 8) &4652 90 11 ; subpicture &11, scale 1 &4654 00 ; end of picture ; picture_15_data # ROOM_24 &4655 80 b3 ; subpicture &b3, scale 3 &4657 01 50 ; move (5, 0) &4659 90 10 ; subpicture &10, scale 1 &465b 81 b0 ; move (-5, 0) &465d 90 0b ; subpicture &0b, scale 0 &465f 00 ; end of picture ; picture_16_data # ROOM_25 &4660 80 b3 ; subpicture &b3, scale 3 &4662 81 60 ; move (-10, 0) &4664 90 10 ; subpicture &10, scale 1 &4666 01 a0 ; move (10, 0) &4668 90 10 ; subpicture &10, scale 1 &466a 01 00 ; move (0, 0) &466c 90 0b ; subpicture &0b, scale 0 &466e 00 ; end of picture ; picture_17_data # ROOM_26, PICTURE_42 &466f 80 b3 ; subpicture &b3, scale 3 &4671 81 b0 ; move (-5, 0) &4673 90 10 ; subpicture &10, scale 1 &4675 01 50 ; move (5, 0) &4677 90 0b ; subpicture &0b, scale 0 &4679 00 ; end of picture ; picture_18_data # ROOM_27 &467a 80 b3 ; subpicture &b3, scale 3 &467c 01 50 ; move (5, 0) &467e 90 10 ; subpicture &10, scale 1 &4680 81 b0 ; move (-5, 0) &4682 90 0d ; subpicture &0d, scale 0 &4684 00 ; end of picture ; picture_19_data # ROOM_2c &4685 80 b3 ; subpicture &b3, scale 3 &4687 81 60 ; move (-10, 0) &4689 90 10 ; subpicture &10, scale 1 &468b 01 a0 ; move (10, 0) &468d 90 10 ; subpicture &10, scale 1 &468f 01 00 ; move (0, 0) &4691 90 0d ; subpicture &0d, scale 0 &4693 00 ; end of picture ; picture_1a_data # ROOM_2f &4694 80 b3 ; subpicture &b3, scale 3 &4696 81 b0 ; move (-5, 0) &4698 90 10 ; subpicture &10, scale 1 &469a 01 50 ; move (5, 0) &469c 90 0d ; subpicture &0d, scale 0 &469e 00 ; end of picture ; picture_1b_data # PICTURE_11, PICTURE_11, PICTURE_11, PICTURE_11 &469f 53 00 ; fill (0, 0), red/blue &46a1 00 ; end of picture ; picture_46_data # PICTURE_1e, PICTURE_1e, PICTURE_2e, PICTURE_2e, PICTURE_44, PICTURE_ac, PICTURE_ac &46a2 80 1d ; subpicture &1d, scale 1 &46a4 01 0e ; move (0, 14) &46a6 80 1c ; subpicture &1c, scale 1 &46a8 00 ; end of picture ; picture_1c_data # PICTURE_46, PICTURE_1f, PICTURE_1f, PICTURE_1f, PICTURE_21, PICTURE_23, PICTURE_23, PICTURE_23, PICTURE_24, PICTURE_2e, PICTURE_46 &46a9 05 08 ; move +(0, 8) &46ab 38 4a ; circle size 4, 3 quarters from 2, blue &46ad 81 de ; move (-3, 14) &46af 38 2d ; circle size 2, 2 quarters from 3, blue &46b1 81 ab ; move (-6, 11) &46b3 b8 4c ; ellipse size 4, 1 quarters from 3, blue &46b5 81 a9 ; move (-6, 9) &46b7 38 3a ; circle size 3, 3 quarters from 2, blue &46b9 81 94 ; move (-7, 4) &46bb 38 49 ; circle size 4, 2 quarters from 2, blue &46bd 81 81 ; move (-8, 1) &46bf 38 29 ; circle size 2, 2 quarters from 2, blue &46c1 81 a0 ; move (-6, 0) &46c3 b8 26 ; ellipse size 2, 3 quarters from 1, blue &46c5 89 ef ; move (-2, -1) &46c7 38 65 ; circle size 6, 2 quarters from 1, blue &46c9 09 3b ; move (3, -5) &46cb b8 45 ; ellipse size 4, 2 quarters from 1, blue &46cd 09 5a ; move (5, -6) &46cf 38 45 ; circle size 4, 2 quarters from 1, blue &46d1 01 80 ; move (8, 0) &46d3 38 84 ; circle size 8, 1 quarters from 1, blue &46d5 01 64 ; move (6, 4) &46d7 b8 31 ; ellipse size 3, 2 quarters from 0, blue &46d9 01 68 ; move (6, 8) &46db 38 31 ; circle size 3, 2 quarters from 0, blue &46dd 01 6a ; move (6, 10) &46df 38 21 ; circle size 2, 2 quarters from 0, blue &46e1 01 3c ; move (3, 12) &46e3 38 4e ; circle size 4, 3 quarters from 3, blue &46e5 01 0c ; move (0, 12) &46e7 b8 2d ; ellipse size 2, 2 quarters from 3, blue &46e9 23 02 ; fill (0, 2), green &46eb 00 ; end of picture ; picture_1d_data # PICTURE_46, PICTURE_28, PICTURE_28, PICTURE_46 &46ec 09 22 ; move (2, -14) &46ee 98 25 ; ellipse size 2, 2 quarters from 1, red &46f0 1a 1b ; draw (1, -5), red &46f2 12 14 ; draw (1, 4), red &46f4 12 4c ; draw (4, 12), red &46f6 12 16 ; draw (1, 6), red &46f8 12 0f ; draw (0, 15), red &46fa 12 06 ; draw (0, 6), red &46fc 92 ca ; draw (-4, 10), red &46fe 92 f5 ; draw (-1, 5), red &4700 9a fc ; draw (-1, -4), red &4702 9a e2 ; draw (-2, -14), red &4704 13 00 ; fill (0, 0), red &4706 00 ; end of picture ; picture_1e_data # PICTURE_1e, PICTURE_1e, PICTURE_1e, PICTURE_22, PICTURE_22, PICTURE_23, PICTURE_28, PICTURE_29, PICTURE_3f, PICTURE_3f, PICTURE_3f, PICTURE_3f, PICTURE_5c &4707 81 c0 ; move (-4, 0) &4709 90 46 ; subpicture &46, scale 4 &470b 01 50 ; move (5, 0) &470d 90 46 ; subpicture &46, scale 4 &470f 81 91 ; move (-7, 1) &4711 a0 1e ; subpicture &1e, scale 1 &4713 09 0f ; move (0, -1) &4715 90 1e ; subpicture &1e, scale 1 &4717 01 70 ; move (7, 0) &4719 a0 1e ; subpicture &1e, scale 1 &471b 00 ; end of picture ; picture_1f_data # PICTURE_1f, PICTURE_1f, PICTURE_23, PICTURE_23, PICTURE_24, PICTURE_24, PICTURE_24 &471c 40 ; set scaling limit to 5 &471d 89 a8 ; move (-6, -8) &471f 90 1c ; subpicture &1c, scale 1 &4721 09 68 ; move (6, -8) &4723 90 1c ; subpicture &1c, scale 1 &4725 09 0e ; move (0, -2) &4727 a0 1c ; subpicture &1c, scale 1 &4729 81 b8 ; move (-5, 8) &472b 90 1f ; subpicture &1f, scale 1 &472d 01 58 ; move (5, 8) &472f 90 1f ; subpicture &1f, scale 1 &4731 81 b2 ; move (-5, 2) &4733 b0 20 ; subpicture &20, scale 2 &4735 01 52 ; move (5, 2) &4737 b0 20 ; subpicture &20, scale 2 &4739 00 ; end of picture ; picture_20_data # PICTURE_1f, PICTURE_1f, PICTURE_1f, PICTURE_1f &473a 23 00 ; fill (0, 0), green &473c 00 ; end of picture ; picture_21_data # ROOM_05 &473d 89 b8 ; move (-5, -8) &473f 90 22 ; subpicture &22, scale 2 &4741 01 50 ; move (5, 0) &4743 90 23 ; subpicture &23, scale 2 &4745 01 57 ; move (5, 7) &4747 40 ; set scaling limit to 5 &4748 90 11 ; subpicture &11, scale 1 &474a 09 72 ; move (7, -14) &474c a0 1c ; subpicture &1c, scale 1 &474e 53 57 ; fill (5, 7), red/blue &4750 81 b7 ; move (-5, 7) &4752 70 ; set scaling limit to 8 &4753 90 24 ; subpicture &24, scale 2 &4755 2b 04 ; fill (0, -12), green &4757 00 ; end of picture ; picture_22_data # PICTURE_21, PICTURE_21 &4758 81 b3 ; move (-5, 3) &475a 50 ; set scaling limit to 6 &475b 90 1e ; subpicture &1e, scale 1 &475d 01 55 ; move (5, 5) &475f 90 1e ; subpicture &1e, scale 1 &4761 89 87 ; move (-8, -9) &4763 10 ; start repeat &4764 16 55 ; draw +(5, 5), red &4766 8d ca ; move +(-4, -6) &4768 1c ; end repeat after 4 copies &4769 89 89 ; move (-8, -7) &476b 10 ; start repeat &476c 1e 5b ; draw +(5, -5), red &476e 85 c6 ; move +(-4, 6) &4770 1c ; end repeat after 4 copies &4771 00 ; end of picture ; picture_23_data # PICTURE_21, PICTURE_21 &4772 89 8f ; move (-8, -1) &4774 a0 1c ; subpicture &1c, scale 1 &4776 81 84 ; move (-8, 4) &4778 b0 1c ; subpicture &1c, scale 1 &477a 89 ce ; move (-4, -2) &477c b0 1c ; subpicture &1c, scale 1 &477e 89 b2 ; move (-5, -14) &4780 50 ; set scaling limit to 6 &4781 90 1e ; subpicture &1e, scale 1 &4783 90 25 ; subpicture &25, scale 2 &4785 ab b1 ; fill (-5, -15), green &4787 81 b2 ; move (-5, 2) &4789 22 a0 ; draw (10, 0), green &478b 09 43 ; move (4, -13) &478d 90 1f ; subpicture &1f, scale 1 &478f 09 3f ; move (3, -1) &4791 a0 1f ; subpicture &1f, scale 1 &4793 00 ; end of picture ; picture_24_data # PICTURE_21, PICTURE_21 &4794 01 58 ; move (5, 8) &4796 40 ; set scaling limit to 5 &4797 90 11 ; subpicture &11, scale 1 &4799 89 a5 ; move (-6, -11) &479b 90 1f ; subpicture &1f, scale 1 &479d 09 46 ; move (4, -10) &479f 90 1f ; subpicture &1f, scale 1 &47a1 09 2e ; move (2, -2) &47a3 a0 1f ; subpicture &1f, scale 1 &47a5 89 6a ; move (-10, -6) &47a7 aa ea ; draw (-2, -6), green &47a9 2a 0e ; draw (0, -2), green &47ab 22 32 ; draw (3, 2), green &47ad 2a cc ; draw (12, -4), green &47af 09 6f ; move (6, -1) &47b1 b0 1c ; subpicture &1c, scale 1 &47b3 53 58 ; fill (5, 8), red/blue &47b5 81 b8 ; move (-5, 8) &47b7 90 26 ; subpicture &26, scale 2 &47b9 00 ; end of picture ; picture_26_data # PICTURE_24, PICTURE_24 &47ba 80 13 ; subpicture &13, scale 1 &47bc 81 b0 ; move (-5, 0) &47be 90 10 ; subpicture &10, scale 1 &47c0 01 16 ; move (1, 6) &47c2 10 ; start repeat &47c3 26 20 ; draw +(2, 0), green &47c5 05 10 ; move +(1, 0) &47c7 14 ; end repeat after 3 copies &47c8 01 21 ; move (2, 1) &47ca 22 81 ; draw (8, 1), green &47cc 01 50 ; move (5, 0) &47ce 90 0b ; subpicture &0b, scale 0 &47d0 00 ; end of picture ; picture_25_data # PICTURE_23, PICTURE_27, PICTURE_23 &47d1 89 b6 ; move (-5, -10) &47d3 b8 39 ; ellipse size 3, 2 quarters from 2, blue &47d5 b8 40 ; ellipse size 4, 1 quarters from 0, blue &47d7 89 b8 ; move (-5, -8) &47d9 c8 29 ; ellipse size 2, 2 quarters from 2, black &47db aa e7 ; draw (-2, -9), green &47dd 09 09 ; move (0, -7) &47df c8 24 ; ellipse size 2, 1 quarters from 1, black &47e1 c8 1c ; ellipse size 1, 1 quarters from 3, black &47e3 09 1a ; move (1, -6) &47e5 c8 40 ; ellipse size 4, 1 quarters from 0, black &47e7 09 56 ; move (5, -10) &47e9 d8 31 ; ellipse size 3, 2 quarters from 0, red &47eb 89 f2 ; move (-1, -14) &47ed 3a 52 ; draw (5, -14), blue &47ef 09 24 ; move (2, -12) &47f1 90 3a ; subpicture &3a, scale 3 &47f3 09 56 ; move (5, -10) &47f5 a0 37 ; subpicture &37, scale 3 &47f7 5b 73 ; fill (7, -13), red/blue &47f9 cb b7 ; fill (-5, -9), red/green &47fb 4b 46 ; fill (4, -10), red/green ; picture_56_data # PICTURE_57 &47fd 89 b6 ; move (-5, -10) &47ff b8 39 ; ellipse size 3, 2 quarters from 2, blue &4801 b8 40 ; ellipse size 4, 1 quarters from 0, blue &4803 89 b4 ; move (-5, -12) &4805 b8 49 ; ellipse size 4, 2 quarters from 2, blue &4807 89 f0 ; move (-1, -16) &4809 b8 48 ; ellipse size 4, 1 quarters from 2, blue &480b 3a 60 ; draw (6, -16), blue &480d 89 f2 ; move (-1, -14) &480f 3a 52 ; draw (5, -14), blue &4811 38 20 ; circle size 2, 1 quarters from 0, blue &4813 89 b5 ; move (-5, -11) &4815 b8 20 ; ellipse size 2, 1 quarters from 0, blue &4817 89 f1 ; move (-1, -15) &4819 b8 38 ; ellipse size 3, 1 quarters from 2, blue &481b 6b 21 ; fill (2, -15), green/blue &481d 00 ; end of picture ; picture_a4_data # ROOM_0d, ROOM_13 &481e 89 b0 ; move (-5, -16) &4820 b8 69 ; ellipse size 6, 2 quarters from 2, blue &4822 01 00 ; move (0, 0) ; picture_57_data # ROOM_04, ROOM_08, ROOM_09 &4824 80 56 ; subpicture &56, scale 5 &4826 80 29 ; subpicture &29, scale 2 &4828 ab d8 ; fill (-3, -8), green &482a 63 0f ; fill (0, 15), green/blue &482c ab 71 ; fill (-9, -15), green &482e eb 84 ; fill (-8, -12), green/blue &4830 00 ; end of picture ; picture_27_data # ROOM_03, PICTURE_54 &4831 80 25 ; subpicture &25, scale 2 &4833 80 29 ; subpicture &29, scale 2 &4835 2b 08 ; fill (0, -8), green &4837 63 0f ; fill (0, 15), green/blue &4839 00 ; end of picture ; picture_28_data # ROOM_0f, ROOM_10 &483a 81 f0 ; move (-1, 0) &483c 80 1d ; subpicture &1d, scale 1 &483e 89 7f ; move (-9, -1) &4840 80 1d ; subpicture &1d, scale 1 &4842 01 00 ; move (0, 0) &4844 80 1e ; subpicture &1e, scale 1 &4846 01 84 ; move (8, 4) &4848 98 4d ; ellipse size 4, 2 quarters from 3, red &484a 73 0f ; fill (0, 15), black/green &484c 8b ac ; fill (-6, -4), black/red &484e 0b 84 ; fill (8, -12), black/red &4850 00 ; end of picture ; picture_29_data # ROOM_0a, ROOM_0c, ROOM_0e, ROOM_12, ROOM_17, ROOM_9a, ROOM_a4, PICTURE_57, PICTURE_27, PICTURE_5c, PICTURE_57, PICTURE_27 &4851 40 ; set scaling limit to 5 &4852 80 1e ; subpicture &1e, scale 1 &4854 81 60 ; move (-10, 0) &4856 a8 2d ; ellipse size 2, 2 quarters from 3, green &4858 01 80 ; move (8, 0) &485a a8 2d ; ellipse size 2, 2 quarters from 3, green &485c 63 0f ; fill (0, 15), green/blue &485e 2b 6b ; fill (6, -5), green &4860 ab ae ; fill (-6, -2), green &4862 00 ; end of picture ; picture_2a_data # PICTURE_2e, PICTURE_4e &4863 09 98 ; move (9, -8) &4865 1a 32 ; draw (3, -14), red &4867 9a 78 ; draw (-9, -8), red &4869 01 97 ; move (9, 7) &486b 12 31 ; draw (3, 1), red &486d 92 77 ; draw (-9, 7), red &486f 81 76 ; move (-9, 6) &4871 10 ; start repeat &4872 90 2b ; subpicture &2b, scale 2 &4874 0d 0f ; move +(0, -1) &4876 74 ; end repeat after 15 copies &4877 81 94 ; move (-7, 4) &4879 92 b3 ; draw (-5, 3), red &487b 81 b2 ; move (-5, 2) &487d 10 ; start repeat &487e 90 2b ; subpicture &2b, scale 2 &4880 0d 0f ; move +(0, -1) &4882 24 ; end repeat after 5 copies &4883 89 be ; move (-5, -2) &4885 9a 9f ; draw (-7, -1), red &4887 81 f1 ; move (-1, 1) &4889 12 10 ; draw (1, 0), red &488b 09 1f ; move (1, -1) &488d 10 ; start repeat &488e 90 2b ; subpicture &2b, scale 2 &4890 0d 0f ; move +(0, -1) &4892 64 ; end repeat after 13 copies &4893 81 94 ; move (-7, 4) &4895 10 ; start repeat &4896 90 2c ; subpicture &2c, scale 2 &4898 0d 0f ; move +(0, -1) &489a 24 ; end repeat after 5 copies &489b 81 f1 ; move (-1, 1) &489d 10 ; start repeat &489e 90 2c ; subpicture &2c, scale 2 &48a0 0d 0f ; move +(0, -1) &48a2 64 ; end repeat after 13 copies &48a3 01 31 ; move (3, 1) &48a5 10 ; start repeat &48a6 90 2c ; subpicture &2c, scale 2 &48a8 0d 0f ; move +(0, -1) &48aa 74 ; end repeat after 15 copies &48ab 01 97 ; move (9, 7) &48ad 10 ; start repeat &48ae 90 2d ; subpicture &2d, scale 2 &48b0 0d 0f ; move +(0, -1) &48b2 74 ; end repeat after 15 copies &48b3 a3 d0 ; fill (-3, 0), green &48b5 23 60 ; fill (6, 0), green &48b7 89 79 ; move (-9, -7) &48b9 10 ; start repeat &48ba 1e 8c ; draw +(8, -4), red &48bc 0d 2f ; move +(2, -1) &48be 1e 2f ; draw +(2, -1), red &48c0 16 66 ; draw +(6, 6), red &48c2 85 70 ; move +(-9, 0) &48c4 85 71 ; move +(-9, 1) &48c6 34 ; end repeat after 7 copies &48c7 10 ; start repeat &48c8 1e 2f ; draw +(2, -1), red &48ca 0d 2f ; move +(2, -1) &48cc 1e 4e ; draw +(4, -2), red &48ce 0d 2f ; move +(2, -1) &48d0 1e 2f ; draw +(2, -1), red &48d2 16 66 ; draw +(6, 6), red &48d4 85 70 ; move +(-9, 0) &48d6 85 71 ; move +(-9, 1) &48d8 2c ; end repeat after 6 copies &48d9 12 30 ; draw (3, 0), red &48db 12 96 ; draw (9, 6), red &48dd 81 77 ; move (-9, 7) &48df 92 be ; draw (-5, 14), red &48e1 12 3b ; draw (3, 11), red &48e3 12 97 ; draw (9, 7), red &48e5 73 08 ; fill (0, 8), black/green &48e7 01 3b ; move (3, 11) &48e9 12 31 ; draw (3, 1), red &48eb 00 ; end of picture ; picture_2b_data # PICTURE_2a, PICTURE_2a, PICTURE_2a, PICTURE_2a, PICTURE_2a, PICTURE_2a &48ec 18 19 ; circle size 1, 2 quarters from 2, red &48ee 00 ; end of picture ; picture_2c_data # PICTURE_2a, PICTURE_2a, PICTURE_2a, PICTURE_2a, PICTURE_2a, PICTURE_2a &48ef 18 13 ; circle size 1, 4 quarters from 0, red &48f1 00 ; end of picture ; picture_2d_data # PICTURE_2a, PICTURE_2a &48f2 18 11 ; circle size 1, 2 quarters from 0, red &48f4 00 ; end of picture ; picture_2e_data # ROOM_01 &48f5 81 f0 ; move (-1, 0) &48f7 90 2a ; subpicture &2a, scale 2 &48f9 09 58 ; move (5, -8) &48fb 90 3a ; subpicture &3a, scale 3 &48fd 01 60 ; move (6, 0) &48ff 90 46 ; subpicture &46, scale 4 &4901 81 85 ; move (-8, 5) &4903 a0 46 ; subpicture &46, scale 4 &4905 81 da ; move (-3, 10) &4907 a0 1c ; subpicture &1c, scale 1 &4909 01 28 ; move (2, 8) &490b 89 9e ; move (-7, -2) &490d a0 3a ; subpicture &3a, scale 3 &490f 09 a0 ; move (10, -16) &4911 9a 6e ; draw (-10, -2), red &4913 43 50 ; fill (5, 0), red/green &4915 89 f0 ; move (-1, -16) &4917 9a 67 ; draw (-10, -9), red &4919 cb 72 ; fill (-9, -14), red/green &491b 00 ; end of picture ; picture_30_data # PICTURE_31, PICTURE_33, PICTURE_4f, PICTURE_35, PICTURE_96 &491c 01 57 ; move (5, 7) &491e 22 69 ; draw (6, 9), green &4920 22 79 ; draw (7, 9), green &4922 22 8d ; draw (8, 13), green &4924 22 9d ; draw (9, 13), green &4926 26 11 ; draw +(1, 1), green &4928 81 b7 ; move (-5, 7) &492a a2 b9 ; draw (-5, 9), green &492c a2 99 ; draw (-7, 9), green &492e a2 8a ; draw (-8, 10), green &4930 a2 7a ; draw (-9, 10), green &4932 a6 f4 ; draw +(-1, 4), green &4934 89 83 ; move (-8, -13) &4936 aa 88 ; draw (-8, -8), green &4938 aa 7a ; draw (-9, -6), green &493a a2 7a ; draw (-9, 10), green &493c a2 88 ; draw (-8, 8), green &493e a2 92 ; draw (-7, 2), green &4940 aa af ; draw (-6, -1), green &4942 aa 97 ; draw (-7, -9), green &4944 89 d4 ; move (-3, -12) &4946 90 3a ; subpicture &3a, scale 3 &4948 09 56 ; move (5, -10) &494a a0 3a ; subpicture &3a, scale 3 &494c 81 97 ; move (-7, 7) &494e a2 b4 ; draw (-5, 4), green &4950 aa be ; draw (-5, -2), green &4952 09 08 ; move (0, -8) &4954 38 24 ; circle size 2, 1 quarters from 1, blue &4956 89 f4 ; move (-1, -12) &4958 b8 19 ; ellipse size 1, 2 quarters from 2, blue &495a 3a 14 ; draw (1, -12), blue &495c b8 11 ; ellipse size 1, 2 quarters from 0, blue &495e 09 00 ; move (0, -16) &4960 38 2c ; circle size 2, 1 quarters from 3, blue &4962 09 17 ; move (1, -9) &4964 b8 1c ; ellipse size 1, 1 quarters from 3, blue &4966 09 35 ; move (3, -11) &4968 b8 28 ; ellipse size 2, 1 quarters from 2, blue &496a b8 20 ; ellipse size 2, 1 quarters from 0, blue &496c 09 53 ; move (5, -13) &496e 3a 52 ; draw (5, -14), blue &4970 38 24 ; circle size 2, 1 quarters from 1, blue &4972 09 26 ; move (2, -10) &4974 2a 5b ; draw (5, -5), green &4976 2a 73 ; draw (7, -13), green &4978 22 84 ; draw (8, 4), green &497a 22 98 ; draw (9, 8), green &497c 22 9a ; draw (9, 10), green &497e 22 75 ; draw (7, 5), green &4980 2a 6e ; draw (6, -2), green &4982 00 ; end of picture ; picture_31_data # ROOM_1d when crystal bridge absent &4983 80 30 ; subpicture &30, scale 3 &4985 90 32 ; subpicture &32, scale 3 &4987 00 ; end of picture ; picture_32_data # ROOM_1e when crystal bridge absent, ROOM_87 when crystal bridge absent, PICTURE_31, PICTURE_38, PICTURE_31 &4988 81 6e ; move (-10, 14) &498a a2 7d ; draw (-9, 13), green &498c a2 9c ; draw (-7, 12), green &498e a2 aa ; draw (-6, 10), green &4990 a2 ca ; draw (-4, 10), green &4992 a2 e9 ; draw (-2, 9), green &4994 22 23 ; draw (2, 3), green &4996 2a 0d ; draw (0, -3), green &4998 2a 08 ; draw (0, -8), green &499a 01 06 ; move (0, 6) &499c 22 18 ; draw (1, 8), green &499e 22 39 ; draw (3, 9), green &49a0 22 4a ; draw (4, 10), green &49a2 22 6a ; draw (6, 10), green &49a4 22 8c ; draw (8, 12), green &49a6 22 9c ; draw (9, 12), green &49a8 22 ae ; draw (10, 14), green &49aa 01 10 ; move (1, 0) &49ac 2a 2c ; draw (2, -4), green &49ae 2a 19 ; draw (1, -7), green &49b0 2a 3a ; draw (3, -6), green &49b2 22 40 ; draw (4, 0), green &49b4 22 46 ; draw (4, 6), green &49b6 22 58 ; draw (5, 8), green &49b8 22 89 ; draw (8, 9), green &49ba 2a 7f ; draw (7, -1), green &49bc 2a 8d ; draw (8, -3), green &49be 2a 8b ; draw (8, -5), green &49c0 2a 69 ; draw (6, -7), green &49c2 81 e1 ; move (-2, 1) &49c4 a2 d5 ; draw (-3, 5), green &49c6 a2 e7 ; draw (-2, 7), green &49c8 a2 98 ; draw (-7, 8), green &49ca a2 a6 ; draw (-6, 6), green &49cc a2 a2 ; draw (-6, 2), green &49ce aa 86 ; draw (-8, -10), green &49d0 aa 96 ; draw (-7, -10), green &49d2 aa a8 ; draw (-6, -8), green &49d4 aa b7 ; draw (-5, -9), green &49d6 aa bd ; draw (-5, -3), green &49d8 2a 04 ; draw (0, -12), green &49da 89 b4 ; move (-5, -12) &49dc a0 3a ; subpicture &3a, scale 3 &49de 63 7e ; fill (7, 14), green/blue &49e0 09 17 ; move (1, -9) &49e2 38 20 ; circle size 2, 1 quarters from 0, blue &49e4 b8 19 ; ellipse size 1, 2 quarters from 2, blue &49e6 b8 40 ; ellipse size 4, 1 quarters from 0, blue &49e8 09 25 ; move (2, -11) &49ea 3a 24 ; draw (2, -12), blue &49ec b8 24 ; ellipse size 2, 1 quarters from 1, blue &49ee 09 00 ; move (0, -16) &49f0 38 2c ; circle size 2, 1 quarters from 3, blue &49f2 09 52 ; move (5, -14) &49f4 38 24 ; circle size 2, 1 quarters from 1, blue &49f6 3a 53 ; draw (5, -13), blue &49f8 93 70 ; fill (-9, 0), red &49fa 1b 9f ; fill (9, -1), red &49fc 0b 1c ; fill (1, -4), black/red &49fe 3b 23 ; fill (2, -13), blue &4a00 00 ; end of picture ; picture_33_data # ROOM_1c, PICTURE_4f &4a01 80 30 ; subpicture &30, scale 3 &4a03 90 34 ; subpicture &34, scale 3 &4a05 00 ; end of picture ; picture_4f_data # ROOM_1f &4a06 80 30 ; subpicture &30, scale 3 &4a08 90 33 ; subpicture &33, scale 3 &4a0a 00 ; end of picture ; picture_34_data # ROOM_1b, PICTURE_33, PICTURE_51, PICTURE_33 &4a0b 81 6e ; move (-10, 14) &4a0d a2 7c ; draw (-9, 12), green &4a0f a2 8c ; draw (-8, 12), green &4a11 a2 a9 ; draw (-6, 9), green &4a13 a2 d8 ; draw (-3, 8), green &4a15 22 09 ; draw (0, 9), green &4a17 22 28 ; draw (2, 8), green &4a19 90 37 ; subpicture &37, scale 3 &4a1b 01 58 ; move (5, 8) &4a1d 22 6a ; draw (6, 10), green &4a1f 22 8b ; draw (8, 11), green &4a21 22 ae ; draw (10, 14), green &4a23 22 9c ; draw (9, 12), green &4a25 22 92 ; draw (9, 2), green &4a27 22 80 ; draw (8, 0), green &4a29 2a 83 ; draw (8, -13), green &4a2b 2a 5e ; draw (5, -2), green &4a2d 22 74 ; draw (7, 4), green &4a2f 81 8a ; move (-8, 10) &4a31 a2 83 ; draw (-8, 3), green &4a33 aa ad ; draw (-6, -3), green &4a35 a2 c0 ; draw (-4, 0), green &4a37 a2 d7 ; draw (-3, 7), green &4a39 22 05 ; draw (0, 5), green &4a3b 2a 0f ; draw (0, -1), green &4a3d 89 82 ; move (-8, -14) &4a3f a0 3a ; subpicture &3a, scale 3 &4a41 89 ef ; move (-2, -1) &4a43 b0 3a ; subpicture &3a, scale 3 &4a45 89 f2 ; move (-1, -14) &4a47 38 20 ; circle size 2, 1 quarters from 0, blue &4a49 b8 6a ; ellipse size 6, 3 quarters from 2, blue &4a4b 09 40 ; move (4, -16) &4a4d 38 1c ; circle size 1, 1 quarters from 3, blue &4a4f 09 52 ; move (5, -14) &4a51 38 14 ; circle size 1, 1 quarters from 1, blue &4a53 3a 58 ; draw (5, -8), blue &4a55 09 37 ; move (3, -9) &4a57 a8 38 ; ellipse size 3, 1 quarters from 2, green &4a59 09 26 ; move (2, -10) &4a5b a8 58 ; ellipse size 5, 1 quarters from 2, green &4a5d 9b 84 ; fill (-8, -12), red &4a5f 1b 9f ; fill (9, -1), red &4a61 3b 04 ; fill (0, -12), blue &4a63 63 0f ; fill (0, 15), green/blue &4a65 00 ; end of picture ; picture_35_data # ROOM_1d when crystal bridge present &4a66 80 30 ; subpicture &30, scale 3 &4a68 01 01 ; move (0, 1) &4a6a 90 38 ; subpicture &38, scale 3 &4a6c 00 ; end of picture ; picture_36_data # PICTURE_38 &4a6d 81 40 ; move (-12, 0) &4a6f d8 cd ; ellipse size 12, 2 quarters from 3, red &4a71 a2 80 ; draw (-8, 0), green &4a73 d8 8d ; ellipse size 8, 2 quarters from 3, red &4a75 01 80 ; move (8, 0) &4a77 22 c0 ; draw (12, 0), green &4a79 12 af ; draw (10, 15), red &4a7b 12 7e ; draw (7, 14), red &4a7d 12 4d ; draw (4, 13), red &4a7f 12 0c ; draw (0, 12), red &4a81 92 cd ; draw (-4, 13), red &4a83 92 9e ; draw (-7, 14), red &4a85 92 6f ; draw (-10, 15), red &4a87 92 40 ; draw (-12, 0), red &4a89 e3 6c ; fill (-10, 12), green/blue &4a8b 63 ac ; fill (10, 12), green/blue &4a8d 43 0a ; fill (0, 10), red/green &4a8f 81 6f ; move (-10, 15) &4a91 a2 60 ; draw (-10, 0), green &4a93 a2 96 ; draw (-7, 6), green &4a95 a2 9e ; draw (-7, 14), green &4a97 81 cd ; move (-4, 13) &4a99 a2 c9 ; draw (-4, 9), green &4a9b 22 0a ; draw (0, 10), green &4a9d 22 0c ; draw (0, 12), green &4a9f 01 0a ; move (0, 10) &4aa1 22 49 ; draw (4, 9), green &4aa3 22 4d ; draw (4, 13), green &4aa5 01 7e ; move (7, 14) &4aa7 22 76 ; draw (7, 6), green &4aa9 22 a0 ; draw (10, 0), green &4aab 22 af ; draw (10, 15), green &4aad 00 ; end of picture ; picture_37_data # PICTURE_25, PICTURE_34, PICTURE_25, PICTURE_34 &4aae 10 ; start repeat &4aaf 10 ; start repeat &4ab0 a8 1d ; ellipse size 1, 2 quarters from 3, green &4ab2 3e 08 ; draw +(0, -8), blue &4ab4 85 f0 ; move +(-1, 0) &4ab6 14 ; end repeat after 3 copies &4ab7 05 4c ; move +(4, 12) &4ab9 05 0c ; move +(0, 12) &4abb 2c ; end repeat after 6 copies &4abc 00 ; end of picture ; picture_38_data # ROOM_1e when crystal bridge present, ROOM_23 when crystal bridge present, PICTURE_35, PICTURE_55, PICTURE_35 &4abd 01 08 ; move (0, 8) &4abf 90 36 ; subpicture &36, scale 3 &4ac1 09 0e ; move (0, -2) &4ac3 80 32 ; subpicture &32, scale 3 &4ac5 63 0a ; fill (0, 10), green/blue &4ac7 00 ; end of picture ; picture_39_data # PICTURE_3a, PICTURE_3a, PICTURE_3a, PICTURE_3a, PICTURE_3a &4ac8 a2 e4 ; draw (-2, 4), green &4aca 22 09 ; draw (0, 9), green &4acc 22 24 ; draw (2, 4), green &4ace 22 00 ; draw (0, 0), green &4ad0 2a 0a ; draw (0, -6), green &4ad2 53 04 ; fill (0, 4), red/blue &4ad4 00 ; end of picture ; picture_3a_data # PICTURE_25, PICTURE_2e, PICTURE_2e, PICTURE_30, PICTURE_30, PICTURE_32, PICTURE_34, PICTURE_34, PICTURE_25, PICTURE_2e, PICTURE_2e, PICTURE_30, PICTURE_30, PICTURE_32, PICTURE_34, PICTURE_34 &4ad5 90 39 ; subpicture &39, scale 3 &4ad7 01 23 ; move (2, 3) &4ad9 90 39 ; subpicture &39, scale 3 &4adb 81 d2 ; move (-3, 2) &4add 90 39 ; subpicture &39, scale 3 &4adf 81 e5 ; move (-2, 5) &4ae1 90 39 ; subpicture &39, scale 3 &4ae3 09 4c ; move (4, -4) &4ae5 90 39 ; subpicture &39, scale 3 &4ae7 00 ; end of picture ; picture_3b_data # PICTURE_42, PICTURE_3f &4ae8 89 68 ; move (-10, -8) &4aea 9a 89 ; draw (-8, -7), red &4aec 9a a8 ; draw (-6, -8), red &4aee 9a b8 ; draw (-5, -8), red &4af0 89 6c ; move (-10, -4) &4af2 9a 8d ; draw (-8, -3), red &4af4 9a ab ; draw (-6, -5), red &4af6 9a bb ; draw (-5, -5), red &4af8 09 58 ; move (5, -8) &4afa 1a 79 ; draw (7, -7), red &4afc 1a a8 ; draw (10, -8), red &4afe 09 5b ; move (5, -5) &4b00 1a 7c ; draw (7, -4), red &4b02 1a ab ; draw (10, -5), red &4b04 00 ; end of picture ; picture_3c_data # PICTURE_3e, PICTURE_5a &4b05 89 66 ; move (-10, -10) &4b07 10 ; start repeat &4b08 1e 6e ; draw +(6, -2), red &4b0a 16 41 ; draw +(4, 1), red &4b0c 1e 6f ; draw +(6, -1), red &4b0e 16 42 ; draw +(4, 2), red &4b10 8d 6d ; move +(-10, -3) &4b12 8d 6d ; move +(-10, -3) &4b14 0c ; end repeat after 2 copies &4b15 00 ; end of picture ; picture_3d_data # PICTURE_5b, PICTURE_40, PICTURE_bd &4b16 89 72 ; move (-9, -14) &4b18 58 ec ; circle size 14, 1 quarters from 3, red &4b1a da 60 ; draw (-10, -16), red &4b1c 1a a0 ; draw (10, -16), red &4b1e 81 e0 ; move (-2, 0) &4b20 12 20 ; draw (2, 0), red &4b22 58 e0 ; circle size 14, 1 quarters from 0, red &4b24 12 26 ; draw (2, 6), red &4b26 12 31 ; draw (3, 1), red &4b28 1a 4f ; draw (4, -1), red &4b2a 12 60 ; draw (6, 0), red &4b2c 12 84 ; draw (8, 4), red &4b2e 12 ac ; draw (10, 12), red &4b30 1a a0 ; draw (10, -16), red &4b32 5a 92 ; draw (9, -14), red &4b34 81 e0 ; move (-2, 0) &4b36 92 e6 ; draw (-2, 6), red &4b38 92 d1 ; draw (-3, 1), red &4b3a 9a cf ; draw (-4, -1), red &4b3c 92 a0 ; draw (-6, 0), red &4b3e 92 84 ; draw (-8, 4), red &4b40 92 6c ; draw (-10, 12), red &4b42 9a 60 ; draw (-10, -16), red &4b44 5b 08 ; fill (0, -8), red/blue &4b46 89 cf ; move (-4, -1) &4b48 9a ce ; draw (-4, -2), red &4b4a 1a 4e ; draw (4, -2), red &4b4c 1a 4f ; draw (4, -1), red &4b4e 81 a0 ; move (-6, 0) &4b50 9a ac ; draw (-6, -4), red &4b52 1a 6c ; draw (6, -4), red &4b54 12 60 ; draw (6, 0), red &4b56 81 84 ; move (-8, 4) &4b58 9a 89 ; draw (-8, -7), red &4b5a 1a 89 ; draw (8, -7), red &4b5c 12 84 ; draw (8, 4), red &4b5e 09 92 ; move (9, -14) &4b60 9a 72 ; draw (-9, -14), red &4b62 81 d1 ; move (-3, 1) &4b64 9a df ; draw (-3, -1), red &4b66 1a 3f ; draw (3, -1), red &4b68 12 31 ; draw (3, 1), red &4b6a 00 ; end of picture ; picture_42_data # PICTURE_40, PICTURE_3e &4b6b 80 3b ; subpicture &3b, scale 3 &4b6d 81 6f ; move (-10, 15) &4b6f 32 5f ; draw (5, 15), blue &4b71 81 b8 ; move (-5, 8) &4b73 90 41 ; subpicture &41, scale 4 &4b75 05 20 ; move +(2, 0) &4b77 48 b4 ; circle size 11, 1 quarters from 1, black &4b79 81 6f ; move (-10, 15) &4b7b 02 5f ; draw (5, 15), black &4b7d 01 58 ; move (5, 8) &4b7f 40 ; set scaling limit to 5 &4b80 90 17 ; subpicture &17, scale 1 &4b82 81 98 ; move (-7, 8) &4b84 a0 b6 ; subpicture &b6, scale 3 &4b86 81 d8 ; move (-3, 8) &4b88 a0 b6 ; subpicture &b6, scale 3 &4b8a 70 ; set scaling limit to 8 &4b8b 00 ; end of picture ; picture_5b_data # ROOM_23 when crystal bridge present &4b8c 80 b4 ; subpicture &b4, scale 3 &4b8e 80 3f ; subpicture &3f, scale 3 &4b90 09 0c ; move (0, -4) &4b92 90 3d ; subpicture &3d, scale 3 &4b94 4b 01 ; fill (0, -15), red/green &4b96 00 ; end of picture ; picture_3f_data # PICTURE_5b, PICTURE_5a, PICTURE_5b &4b97 80 3b ; subpicture &3b, scale 3 &4b99 50 ; set scaling limit to 6 &4b9a 81 83 ; move (-8, 3) &4b9c a0 1e ; subpicture &1e, scale 1 &4b9e 81 d4 ; move (-3, 4) &4ba0 a0 1e ; subpicture &1e, scale 1 &4ba2 01 24 ; move (2, 4) &4ba4 a0 1e ; subpicture &1e, scale 1 &4ba6 01 75 ; move (7, 5) &4ba8 a0 1e ; subpicture &1e, scale 1 &4baa 70 ; set scaling limit to 8 &4bab 81 6e ; move (-10, 14) &4bad a2 ba ; draw (-5, 10), green &4baf 22 4b ; draw (4, 11), green &4bb1 22 a9 ; draw (10, 9), green &4bb3 23 02 ; fill (0, 2), green &4bb5 63 0f ; fill (0, 15), green/blue &4bb7 00 ; end of picture ; picture_40_data # ROOM_19 when crystal bridge present &4bb8 80 b4 ; subpicture &b4, scale 3 &4bba 80 42 ; subpicture &42, scale 4 &4bbc 09 0c ; move (0, -4) &4bbe 90 3d ; subpicture &3d, scale 3 &4bc0 2b 01 ; fill (0, -15), green &4bc2 00 ; end of picture ; picture_41_data # PICTURE_42, PICTURE_59, PICTURE_42 &4bc3 80 b3 ; subpicture &b3, scale 3 &4bc5 70 ; set scaling limit to 8 &4bc6 81 b0 ; move (-5, 0) &4bc8 90 b5 ; subpicture &b5, scale 3 &4bca 01 50 ; move (5, 0) &4bcc 90 b5 ; subpicture &b5, scale 3 &4bce 00 ; end of picture ; picture_3e_data # ROOM_19 when crystal bridge absent &4bcf 90 3c ; subpicture &3c, scale 3 &4bd1 80 42 ; subpicture &42, scale 4 &4bd3 2b 01 ; fill (0, -15), green &4bd5 00 ; end of picture ; picture_43_data # PICTURE_44 &4bd6 01 40 ; move (4, 0) &4bd8 98 47 ; ellipse size 4, 4 quarters from 1, red &4bda 1a 34 ; draw (3, -12), red &4bdc 98 35 ; ellipse size 3, 2 quarters from 1, red &4bde 89 d4 ; move (-3, -12) &4be0 92 c0 ; draw (-4, 0), red &4be2 0b 08 ; fill (0, -8), black/red &4be4 00 ; end of picture ; picture_b2_data # PICTURE_ae &4be5 81 1d ; move (-15, 13) ; picture_44_data # PICTURE_72 &4be7 0d 0e ; move +(0, -2) &4be9 a0 46 ; subpicture &46, scale 4 &4beb 0d 0c ; move +(0, -4) &4bed 90 43 ; subpicture &43, scale 4 &4bef 00 ; end of picture ; picture_45_data # ROOM_69 &4bf0 80 87 ; subpicture &87, scale 0 &4bf2 81 a0 ; move (-6, 0) &4bf4 90 a2 ; subpicture &a2, scale 2 &4bf6 53 00 ; fill (0, 0), red/blue &4bf8 4b 02 ; fill (0, -14), red/green &4bfa 00 ; end of picture ; picture_47_data # PICTURE_49, PICTURE_4c &4bfb 89 80 ; move (-8, -16) &4bfd ea da ; draw (-3, -6), green &4bff 6a 3a ; draw (3, -6), green &4c01 6a 80 ; draw (8, -16), green &4c03 7b 08 ; fill (0, -8), black/green &4c05 81 9f ; move (-7, 15) &4c07 b0 4b ; subpicture &4b, scale 4 &4c09 b2 d6 ; draw (-3, 6), blue &4c0b 32 36 ; draw (3, 6), blue &4c0d 32 7f ; draw (7, 15), blue &4c0f b0 4a ; subpicture &4a, scale 4 &4c11 33 08 ; fill (0, 8), blue &4c13 89 ea ; move (-2, -6) &4c15 92 e2 ; draw (-2, 2), red &4c17 12 04 ; draw (0, 4), red &4c19 12 22 ; draw (2, 2), red &4c1b 1a 2a ; draw (2, -6), red &4c1d 09 1a ; move (1, -6) &4c1f 12 12 ; draw (1, 2), red &4c21 92 f2 ; draw (-1, 2), red &4c23 9a fa ; draw (-1, -6), red &4c25 13 03 ; fill (0, 3), red &4c27 09 56 ; move (5, -10) &4c29 12 53 ; draw (5, 3), red &4c2b 12 79 ; draw (7, 9), red &4c2d 12 a7 ; draw (10, 7), red &4c2f 09 64 ; move (6, -12) &4c31 12 64 ; draw (6, 4), red &4c33 12 96 ; draw (9, 6), red &4c35 1a 90 ; draw (9, -16), red &4c37 13 76 ; fill (7, 6), red &4c39 01 95 ; move (9, 5) &4c3b 12 74 ; draw (7, 4), red &4c3d 12 64 ; draw (6, 4), red &4c3f 01 74 ; move (7, 4) &4c41 1a 74 ; draw (7, -12), red &4c43 1a 64 ; draw (6, -12), red &4c45 53 05 ; fill (0, 5), red/blue &4c47 89 da ; move (-3, -6) &4c49 a2 d6 ; draw (-3, 6), green &4c4b 09 3a ; move (3, -6) &4c4d 22 36 ; draw (3, 6), green &4c4f 89 ea ; move (-2, -6) &4c51 10 ; start repeat &4c52 26 12 ; draw +(1, 2), green &4c54 a6 f0 ; draw +(-1, 0), green &4c56 1c ; end repeat after 4 copies &4c57 81 f3 ; move (-1, 3) &4c59 22 02 ; draw (0, 2), green &4c5b 22 13 ; draw (1, 3), green &4c5d 09 2a ; move (2, -6) &4c5f 10 ; start repeat &4c60 a6 f2 ; draw +(-1, 2), green &4c62 26 10 ; draw +(1, 0), green &4c64 1c ; end repeat after 4 copies &4c65 09 56 ; move (5, -10) &4c67 2a 68 ; draw (6, -8), green &4c69 2a 59 ; draw (5, -7), green &4c6b 2a 6c ; draw (6, -4), green &4c6d 2a 5d ; draw (5, -3), green &4c6f 22 60 ; draw (6, 0), green &4c71 22 50 ; draw (5, 0), green &4c73 22 64 ; draw (6, 4), green &4c75 22 53 ; draw (5, 3), green &4c77 01 66 ; move (6, 6) &4c79 22 75 ; draw (7, 5), green &4c7b 22 88 ; draw (8, 8), green &4c7d 09 a0 ; move (10, -16) &4c7f 2a 94 ; draw (9, -12), green &4c81 2a a2 ; draw (10, -14), green &4c83 2a 9a ; draw (9, -6), green &4c85 2a aa ; draw (10, -6), green &4c87 22 90 ; draw (9, 0), green &4c89 22 a0 ; draw (10, 0), green &4c8b 22 96 ; draw (9, 6), green &4c8d 22 a7 ; draw (10, 7), green &4c8f 00 ; end of picture ; picture_4a_data # PICTURE_47, PICTURE_47 &4c90 32 47 ; draw (4, 7), blue &4c92 00 ; end of picture ; picture_4b_data # PICTURE_47, PICTURE_47 &4c93 b2 c7 ; draw (-4, 7), blue &4c95 00 ; end of picture ; picture_48_data # PICTURE_4c, PICTURE_61, PICTURE_98 &4c96 81 c4 ; move (-4, 4) &4c98 92 d6 ; draw (-3, 6), red &4c9a 12 18 ; draw (1, 8), red &4c9c 92 da ; draw (-3, 10), red &4c9e 92 cc ; draw (-4, 12), red &4ca0 89 cc ; move (-4, -4) &4ca2 9a da ; draw (-3, -6), red &4ca4 1a 18 ; draw (1, -8), red &4ca6 9a d6 ; draw (-3, -10), red &4ca8 9a c4 ; draw (-4, -12), red &4caa 23 00 ; fill (0, 0), green &4cac 81 da ; move (-3, 10) &4cae 16 06 ; draw +(0, 6), red &4cb0 81 d6 ; move (-3, 6) &4cb2 9a da ; draw (-3, -6), red &4cb4 89 d6 ; move (-3, -10) &4cb6 9a d0 ; draw (-3, -16), red &4cb8 81 f9 ; move (-1, 9) &4cba 16 07 ; draw +(0, 7), red &4cbc 81 f7 ; move (-1, 7) &4cbe 9a f9 ; draw (-1, -7), red &4cc0 89 f7 ; move (-1, -9) &4cc2 9a f0 ; draw (-1, -16), red &4cc4 09 10 ; move (1, -16) &4cc6 12 1f ; draw (1, 15), red &4cc8 16 01 ; draw +(0, 1), red &4cca 09 30 ; move (3, -16) &4ccc 12 3f ; draw (3, 15), red &4cce 16 01 ; draw +(0, 1), red &4cd0 00 ; end of picture ; picture_49_data # ROOM_5a, PICTURE_61 &4cd1 89 a4 ; move (-6, -12) &4cd3 9a b6 ; draw (-5, -10), red &4cd5 92 b3 ; draw (-5, 3), red &4cd7 92 99 ; draw (-7, 9), red &4cd9 92 67 ; draw (-10, 7), red &4cdb 89 70 ; move (-9, -16) &4cdd 92 76 ; draw (-9, 6), red &4cdf 92 a4 ; draw (-6, 4), red &4ce1 9a a4 ; draw (-6, -12), red &4ce3 9a 94 ; draw (-7, -12), red &4ce5 92 94 ; draw (-7, 4), red &4ce7 92 75 ; draw (-9, 5), red &4ce9 93 96 ; fill (-7, 6), red &4ceb 81 a4 ; move (-6, 4) &4ced 92 94 ; draw (-7, 4), red &4cef 89 b6 ; move (-5, -10) &4cf1 aa a8 ; draw (-6, -8), green &4cf3 aa b9 ; draw (-5, -7), green &4cf5 aa ac ; draw (-6, -4), green &4cf7 aa bd ; draw (-5, -3), green &4cf9 a2 a0 ; draw (-6, 0), green &4cfb a2 b0 ; draw (-5, 0), green &4cfd a2 a4 ; draw (-6, 4), green &4cff a2 b3 ; draw (-5, 3), green &4d01 81 a6 ; move (-6, 6) &4d03 a2 95 ; draw (-7, 5), green &4d05 a2 88 ; draw (-8, 8), green &4d07 89 60 ; move (-10, -16) &4d09 aa 74 ; draw (-9, -12), green &4d0b aa 62 ; draw (-10, -14), green &4d0d aa 7a ; draw (-9, -6), green &4d0f aa 69 ; draw (-10, -7), green &4d11 a2 70 ; draw (-9, 0), green &4d13 a2 60 ; draw (-10, 0), green &4d15 a2 76 ; draw (-9, 6), green &4d17 a2 67 ; draw (-10, 7), green &4d19 01 00 ; move (0, 0) &4d1b 80 47 ; subpicture &47, scale 4 &4d1d 00 ; end of picture ; picture_4c_data # ROOM_59, ROOM_5d &4d1e 80 47 ; subpicture &47, scale 4 &4d20 09 0e ; move (0, -2) &4d22 a0 48 ; subpicture &48, scale 4 &4d24 00 ; end of picture ; picture_50_data # PICTURE_50, PICTURE_53, PICTURE_75, PICTURE_75, PICTURE_a3 &4d25 40 ; set scaling limit to 5 &4d26 90 50 ; subpicture &50, scale 5 &4d28 81 c8 ; move (-4, 8) &4d2a 18 41 ; circle size 4, 2 quarters from 0, red &4d2c 22 48 ; draw (4, 8), green &4d2e 18 45 ; circle size 4, 2 quarters from 1, red &4d30 2a 48 ; draw (4, -8), green &4d32 18 49 ; circle size 4, 2 quarters from 2, red &4d34 aa c8 ; draw (-4, -8), green &4d36 18 4d ; circle size 4, 2 quarters from 3, red &4d38 a2 c8 ; draw (-4, 8), green &4d3a 00 ; end of picture ; picture_52_data # PICTURE_53, PICTURE_53 &4d3b 09 00 ; move (0, -16) &4d3d 38 fb ; circle size 15, 4 quarters from 2, blue &4d3f 09 04 ; move (0, -12) &4d41 48 4b ; circle size 4, 4 quarters from 2, black &4d43 09 08 ; move (0, -8) &4d45 38 13 ; circle size 1, 4 quarters from 0, blue &4d47 b8 1b ; ellipse size 1, 4 quarters from 2, blue &4d49 3b 09 ; fill (0, -7), blue &4d4b 4b 05 ; fill (0, -11), red/green &4d4d 83 c1 ; fill (-4, 1), black/red &4d4f 10 ; start repeat &4d50 26 24 ; draw +(2, 4), green &4d52 85 e0 ; move +(-2, 0) &4d54 2e 2c ; draw +(2, -4), green &4d56 05 10 ; move +(1, 0) &4d58 14 ; end repeat after 3 copies &4d59 00 ; end of picture ; picture_53_data # ROOM_9d, PICTURE_82 &4d5a 81 b0 ; move (-5, 0) &4d5c 90 52 ; subpicture &52, scale 5 &4d5e 01 50 ; move (5, 0) &4d60 90 52 ; subpicture &52, scale 5 &4d62 81 6b ; move (-10, 11) &4d64 10 ; start repeat &4d65 10 ; start repeat &4d66 90 50 ; subpicture &50, scale 5 &4d68 05 40 ; move +(4, 0) &4d6a 2c ; end repeat after 6 copies &4d6b 89 64 ; move (-10, -12) &4d6d 0c ; end repeat after 2 copies &4d6e 00 ; end of picture ; picture_4d_data # PICTURE_4e, PICTURE_51, PICTURE_54, PICTURE_55 &4d6f 81 b8 ; move (-5, 8) &4d71 22 58 ; draw (5, 8), green &4d73 2a 58 ; draw (5, -8), green &4d75 aa b8 ; draw (-5, -8), green &4d77 a2 b8 ; draw (-5, 8), green &4d79 81 aa ; move (-6, 10) &4d7b 22 6a ; draw (6, 10), green &4d7d 2a 66 ; draw (6, -10), green &4d7f aa a6 ; draw (-6, -10), green &4d81 a2 aa ; draw (-6, 10), green &4d83 13 59 ; fill (5, 9), red &4d85 00 ; end of picture ; picture_4e_data # PICTURE_6d, picture of cabin &4d86 80 4d ; subpicture &4d, scale 4 &4d88 90 2a ; subpicture &2a, scale 2 &4d8a 00 ; end of picture ; picture_51_data # PICTURE_6d, PICTURE_72, picture of waterfall &4d8b 80 4d ; subpicture &4d, scale 4 &4d8d 90 34 ; subpicture &34, scale 3 &4d8f 00 ; end of picture ; picture_54_data # PICTURE_6e, PICTURE_7a, picture of stream &4d90 80 4d ; subpicture &4d, scale 4 &4d92 90 27 ; subpicture &27, scale 2 &4d94 00 ; end of picture ; picture_55_data # PICTURE_6d, PICTURE_2f, picture of bridge &4d95 80 4d ; subpicture &4d, scale 4 &4d97 90 38 ; subpicture &38, scale 3 &4d99 00 ; end of picture ; picture_58_data # ROOM_11, ROOM_31, ROOM_a1, ROOM_a5, ROOM_ab, PICTURE_c0 &4d9a 40 ; set scaling limit to 5 &4d9b 09 0c ; move (0, -4) &4d9d 80 14 ; subpicture &14, scale 1 &4d9f 70 ; set scaling limit to 8 &4da0 63 0f ; fill (0, 15), green/blue &4da2 89 6e ; move (-10, -2) &4da4 c8 e0 ; ellipse size 14, 1 quarters from 0, black &4da6 89 6c ; move (-10, -4) &4da8 48 c0 ; circle size 12, 1 quarters from 0, black &4daa cb b8 ; fill (-5, -8), red/green &4dac db 7f ; fill (-9, -1), red/blue &4dae 5b 46 ; fill (4, -10), red/blue &4db0 3a 7d ; draw (7, -3), blue &4db2 3a ab ; draw (10, -5), blue &4db4 9b 71 ; fill (-9, -15), red &4db6 aa 89 ; draw (-8, -7), green &4db8 aa 97 ; draw (-7, -9), green &4dba 89 90 ; move (-7, -16) &4dbc aa a6 ; draw (-6, -10), green &4dbe aa b4 ; draw (-5, -12), green &4dc0 00 ; end of picture ; picture_59_data # ROOM_2d, ROOM_80, ROOM_81, ROOM_82, ROOM_97 &4dc1 80 41 ; subpicture &41, scale 4 &4dc3 4b 02 ; fill (0, -14), red/green &4dc5 53 04 ; fill (0, 4), red/blue &4dc7 00 ; end of picture ; picture_5a_data # ROOM_23 when crystal bridge absent &4dc8 90 3c ; subpicture &3c, scale 3 &4dca 80 3f ; subpicture &3f, scale 3 &4dcc 4b 01 ; fill (0, -15), red/green &4dce 00 ; end of picture ; picture_5c_data # ROOM_02 &4dcf 89 60 ; move (-10, -16) &4dd1 1a a9 ; draw (10, -7), red &4dd3 09 20 ; move (2, -16) &4dd5 1a a6 ; draw (10, -10), red &4dd7 2b 81 ; fill (8, -15), green &4dd9 40 ; set scaling limit to 5 &4dda 81 b0 ; move (-5, 0) &4ddc 90 1e ; subpicture &1e, scale 1 &4dde 81 60 ; move (-10, 0) &4de0 a8 2d ; ellipse size 2, 2 quarters from 3, green &4de2 01 02 ; move (0, 2) &4de4 a8 24 ; ellipse size 2, 1 quarters from 1, green &4de6 01 52 ; move (5, 2) &4de8 90 29 ; subpicture &29, scale 2 &4dea 00 ; end of picture ; picture_5d_data # ROOM_06, ROOM_0b &4deb 89 17 ; move (-15, -9) &4ded a8 fd ; ellipse size 15, 2 quarters from 3, green &4def 01 f5 ; move (15, 5) &4df1 a8 f5 ; ellipse size 15, 2 quarters from 1, green &4df3 2b 01 ; fill (0, -15), green &4df5 81 68 ; move (-10, 8) &4df7 a2 aa ; draw (-6, 10), green &4df9 a2 c8 ; draw (-4, 8), green &4dfb a2 ec ; draw (-2, 12), green &4dfd 22 1d ; draw (1, 13), green &4dff 22 5b ; draw (5, 11), green &4e01 22 8c ; draw (8, 12), green &4e03 22 a9 ; draw (10, 9), green &4e05 63 0f ; fill (0, 15), green/blue &4e07 a3 b8 ; fill (-5, 8), green &4e09 cb 7c ; fill (-9, -4), red/green &4e0b 92 71 ; draw (-9, 1), red &4e0d 92 83 ; draw (-8, 3), red &4e0f 9a 9b ; draw (-7, -5), red &4e11 9a bc ; draw (-5, -4), red &4e13 92 a3 ; draw (-6, 3), red &4e15 92 d4 ; draw (-3, 4), red &4e17 9a cd ; draw (-4, -3), red &4e19 92 f1 ; draw (-1, 1), red &4e1b 12 05 ; draw (0, 5), red &4e1d 12 24 ; draw (2, 4), red &4e1f 12 20 ; draw (2, 0), red &4e21 1a 5e ; draw (5, -2), red &4e23 12 82 ; draw (8, 2), red &4e25 1a 9c ; draw (9, -4), red &4e27 12 a1 ; draw (10, 1), red &4e29 89 c9 ; move (-4, -7) &4e2b 9a ec ; draw (-2, -4), red &4e2d 9a fa ; draw (-1, -6), red &4e2f 89 e7 ; move (-2, -9) &4e31 1a 1b ; draw (1, -5), red &4e33 1a 2d ; draw (2, -3), red &4e35 1a 3b ; draw (3, -5), red &4e37 09 37 ; move (3, -9) &4e39 1a 5a ; draw (5, -6), red &4e3b 1a 68 ; draw (6, -8), red &4e3d 00 ; end of picture ; picture_94_data # ROOM_83, ROOM_84, ROOM_85, ROOM_86 &4e3e 80 5f ; subpicture &5f, scale 5 ; picture_5e_data # PICTURE_92, PICTURE_93 &4e40 89 6b ; move (-10, -5) &4e42 10 ; start repeat &4e43 36 20 ; draw +(2, 0), blue &4e45 36 21 ; draw +(2, 1), blue &4e47 3e 2e ; draw +(2, -2), blue &4e49 36 20 ; draw +(2, 0), blue &4e4b 36 42 ; draw +(4, 2), blue &4e4d 89 6a ; move (-10, -6) &4e4f 0c ; end repeat after 2 copies &4e50 bb 9b ; fill (-7, -5), blue &4e52 89 c8 ; move (-4, -8) &4e54 aa 63 ; draw (-10, -13), green &4e56 9a 95 ; draw (-7, -11), red &4e58 9a d2 ; draw (-3, -14), red &4e5a 1a 14 ; draw (1, -12), red &4e5c 1a 63 ; draw (6, -13), red &4e5e 2a 38 ; draw (3, -8), green &4e60 2a 39 ; draw (3, -7), green &4e62 33 08 ; fill (0, 8), blue &4e64 1b 2a ; fill (2, -6), red &4e66 2a 27 ; draw (2, -9), green &4e68 2a 14 ; draw (1, -12), green &4e6a 89 d2 ; move (-3, -14) &4e6c 2a 06 ; draw (0, -10), green &4e6e 2a 19 ; draw (1, -7), green &4e70 89 f9 ; move (-1, -7) &4e72 aa e7 ; draw (-2, -9), green &4e74 aa 95 ; draw (-7, -11), green &4e76 89 66 ; move (-10, -10) &4e78 aa 89 ; draw (-8, -7), green &4e7a 09 a8 ; move (10, -8) &4e7c 2a 99 ; draw (9, -7), green &4e7e 09 a5 ; move (10, -11) &4e80 2a 69 ; draw (6, -7), green &4e82 2b 01 ; fill (0, -15), green &4e84 00 ; end of picture ; picture_91_data # PICTURE_92, PICTURE_93 &4e85 81 64 ; move (-10, 4) &4e87 aa 8c ; draw (-8, -4), green &4e89 81 6d ; move (-10, 13) &4e8b aa af ; draw (-6, -1), green &4e8d aa cb ; draw (-4, -5), green &4e8f 81 af ; move (-6, 15) &4e91 a2 d0 ; draw (-3, 0), green &4e93 aa fb ; draw (-1, -5), green &4e95 81 cf ; move (-4, 15) &4e97 a2 e5 ; draw (-2, 5), green &4e99 81 ef ; move (-2, 15) &4e9b 22 00 ; draw (0, 0), green &4e9d 2a 1c ; draw (1, -4), green &4e9f 01 0f ; move (0, 15) &4ea1 22 07 ; draw (0, 7), green &4ea3 2a 2d ; draw (2, -3), green &4ea5 01 3f ; move (3, 15) &4ea7 22 3a ; draw (3, 10), green &4ea9 01 5f ; move (5, 15) &4eab 22 32 ; draw (3, 2), green &4ead 2a 3d ; draw (3, -3), green &4eaf 01 8f ; move (8, 15) &4eb1 22 62 ; draw (6, 2), green &4eb3 2a 4d ; draw (4, -3), green &4eb5 01 af ; move (10, 15) &4eb7 22 70 ; draw (7, 0), green &4eb9 2a 5d ; draw (5, -3), green &4ebb 01 a2 ; move (10, 2) &4ebd 2a 7c ; draw (7, -4), green &4ebf 09 ad ; move (10, -3) &4ec1 2a 9b ; draw (9, -5), green &4ec3 00 ; end of picture ; picture_5f_data # PICTURE_94, PICTURE_92, PICTURE_94 &4ec4 09 63 ; move (6, -13) &4ec6 1a a5 ; draw (10, -11), red &4ec8 09 2c ; move (2, -4) &4eca 10 ; start repeat &4ecb 3e 3e ; draw +(3, -2), blue &4ecd 36 11 ; draw +(1, 1), blue &4ecf 36 10 ; draw +(1, 0), blue &4ed1 3e 3f ; draw +(3, -1), blue &4ed3 09 2b ; move (2, -5) &4ed5 0c ; end repeat after 2 copies &4ed6 00 ; end of picture ; picture_60_data # PICTURE_93 &4ed7 09 70 ; move (7, -16) &4ed9 3a 63 ; draw (6, -13), blue &4edb 3a 47 ; draw (4, -9), blue &4edd 3a 4b ; draw (4, -5), blue &4edf 3a 57 ; draw (5, -9), blue &4ee1 3a a5 ; draw (10, -11), blue &4ee3 3a 63 ; draw (6, -13), blue &4ee5 3b 91 ; fill (9, -15), blue &4ee7 6b 65 ; fill (6, -11), green/blue &4ee9 09 2c ; move (2, -4) &4eeb 3a 4d ; draw (4, -3), blue &4eed b8 22 ; ellipse size 2, 3 quarters from 0, blue &4eef 09 63 ; move (6, -13) &4ef1 3a 56 ; draw (5, -10), blue &4ef3 3a a5 ; draw (10, -11), blue &4ef5 00 ; end of picture ; picture_61_data # Unused; corridor with closed door at end &4ef6 80 49 ; subpicture &49, scale 4 &4ef8 09 0e ; move (0, -2) &4efa a0 48 ; subpicture &48, scale 4 &4efc 00 ; end of picture ; picture_62_data # ROOM_07 &4efd 81 6e ; move (-10, 14) &4eff b2 9d ; draw (-7, 13), blue &4f01 b2 db ; draw (-3, 11), blue &4f03 b2 da ; draw (-3, 10), blue &4f05 01 09 ; move (0, 9) &4f07 32 39 ; draw (3, 9), blue &4f09 32 6a ; draw (6, 10), blue &4f0b 32 ae ; draw (10, 14), blue &4f0d 89 63 ; move (-10, -13) &4f0f ba 80 ; draw (-8, -16), blue &4f11 cb 71 ; fill (-9, -15), red/green &4f13 89 db ; move (-3, -5) &4f15 3a 06 ; draw (0, -10), blue &4f17 3a a2 ; draw (10, -14), blue &4f19 81 82 ; move (-8, 2) &4f1b b2 84 ; draw (-8, 4), blue &4f1d 81 b7 ; move (-5, 7) &4f1f b2 b9 ; draw (-5, 9), blue &4f21 81 b2 ; move (-5, 2) &4f23 b2 b3 ; draw (-5, 3), blue &4f25 90 63 ; subpicture &63, scale 6 &4f27 82 b2 ; draw (-5, 2), black &4f29 c3 73 ; fill (-9, 3), red/green &4f2b c3 b5 ; fill (-5, 5), red/green &4f2d 43 08 ; fill (0, 8), red/green &4f2f 32 15 ; draw (1, 5), blue &4f31 3a 1e ; draw (1, -2), blue &4f33 01 20 ; move (2, 0) &4f35 32 26 ; draw (2, 6), blue &4f37 32 38 ; draw (3, 8), blue &4f39 01 41 ; move (4, 1) &4f3b 32 45 ; draw (4, 5), blue &4f3d 32 59 ; draw (5, 9), blue &4f3f 09 7e ; move (7, -2) &4f41 32 60 ; draw (6, 0), blue &4f43 32 66 ; draw (6, 6), blue &4f45 32 8b ; draw (8, 11), blue &4f47 09 8d ; move (8, -3) &4f49 32 84 ; draw (8, 4), blue &4f4b 32 ab ; draw (10, 11), blue &4f4d 89 ea ; move (-2, -6) &4f4f 3a 08 ; draw (0, -8), blue &4f51 3a 2b ; draw (2, -5), blue &4f53 3a 37 ; draw (3, -9), blue &4f55 09 38 ; move (3, -8) &4f57 3a 4c ; draw (4, -4), blue &4f59 3a 5b ; draw (5, -5), blue &4f5b 3a 7d ; draw (7, -3), blue &4f5d 3a 8a ; draw (8, -6), blue &4f5f 09 55 ; move (5, -11) &4f61 3a 68 ; draw (6, -8), blue &4f63 3a 95 ; draw (9, -11), blue &4f65 00 ; end of picture ; picture_63_data # ROOM_18, PICTURE_62, PICTURE_62 &4f66 89 64 ; move (-10, -12) &4f68 ba a9 ; draw (-6, -7), blue &4f6a ba df ; draw (-3, -1), blue &4f6c b2 e0 ; draw (-2, 0), blue &4f6e b2 f2 ; draw (-1, 2), blue &4f70 b2 f4 ; draw (-1, 4), blue &4f72 b2 d5 ; draw (-3, 5), blue &4f74 b2 b7 ; draw (-5, 7), blue &4f76 b2 a7 ; draw (-6, 7), blue &4f78 b2 9a ; draw (-7, 10), blue &4f7a b2 6d ; draw (-10, 13), blue &4f7c 01 22 ; move (2, 2) &4f7e 32 26 ; draw (2, 6), blue &4f80 32 19 ; draw (1, 9), blue &4f82 32 07 ; draw (0, 7), blue &4f84 b2 f3 ; draw (-1, 3), blue &4f86 32 22 ; draw (2, 2), blue &4f88 32 31 ; draw (3, 1), blue &4f8a 3a 2f ; draw (2, -1), blue &4f8c 3a 48 ; draw (4, -8), blue &4f8e 3a 40 ; draw (4, -16), blue &4f90 43 00 ; fill (0, 0), red/green &4f92 93 a0 ; fill (-6, 0), red &4f94 01 ac ; move (10, 12) &4f96 32 9d ; draw (9, 13), blue &4f98 32 8d ; draw (8, 13), blue &4f9a 32 4f ; draw (4, 15), blue &4f9c b0 64 ; subpicture &64, scale 6 &4f9e 63 9f ; fill (9, 15), green/blue &4fa0 13 09 ; fill (0, 9), red &4fa2 89 88 ; move (-8, -8) &4fa4 ba 7b ; draw (-9, -5), blue &4fa6 b2 75 ; draw (-9, 5), blue &4fa8 b2 6b ; draw (-10, 11), blue &4faa b2 98 ; draw (-7, 8), blue &4fac ba 9c ; draw (-7, -4), blue &4fae ba ab ; draw (-6, -5), blue &4fb0 81 b5 ; move (-5, 5) &4fb2 b2 c3 ; draw (-4, 3), blue &4fb4 ba cf ; draw (-4, -1), blue &4fb6 b2 e2 ; draw (-2, 2), blue &4fb8 b2 e3 ; draw (-2, 3), blue &4fba 81 8e ; move (-8, 14) &4fbc b2 8c ; draw (-8, 12), blue &4fbe 81 ae ; move (-6, 14) &4fc0 b2 ac ; draw (-6, 12), blue &4fc2 b2 b9 ; draw (-5, 9), blue &4fc4 81 df ; move (-3, 15) &4fc6 b2 eb ; draw (-2, 11), blue &4fc8 b2 e7 ; draw (-2, 7), blue &4fca b2 f5 ; draw (-1, 5), blue &4fcc 81 ff ; move (-1, 15) &4fce 32 0d ; draw (0, 13), blue &4fd0 32 08 ; draw (0, 8), blue &4fd2 01 2e ; move (2, 14) &4fd4 32 29 ; draw (2, 9), blue &4fd6 32 31 ; draw (3, 1), blue &4fd8 3a 4e ; draw (4, -2), blue &4fda 3a 4a ; draw (4, -6), blue &4fdc 3a 68 ; draw (6, -8), blue &4fde 3a 70 ; draw (7, -16), blue &4fe0 01 4e ; move (4, 14) &4fe2 32 47 ; draw (4, 7), blue &4fe4 32 60 ; draw (6, 0), blue &4fe6 3a 6c ; draw (6, -4), blue &4fe8 3a 80 ; draw (8, -16), blue &4fea 01 7c ; move (7, 12) &4fec 32 8a ; draw (8, 10), blue &4fee 32 84 ; draw (8, 4), blue &4ff0 32 92 ; draw (9, 2), blue &4ff2 00 ; end of picture ; picture_64_data # PICTURE_63, PICTURE_63 &4ff3 32 07 ; draw (0, 7), blue &4ff5 00 ; end of picture ; picture_65_data # ROOM_4e, ROOM_4f, ROOM_50, ROOM_51 &4ff6 90 a2 ; subpicture &a2, scale 2 &4ff8 81 80 ; move (-8, 0) &4ffa a0 66 ; subpicture &66, scale 6 &4ffc 01 80 ; move (8, 0) &4ffe a0 66 ; subpicture &66, scale 6 &5000 81 19 ; move (-15, 9) &5002 98 fd ; ellipse size 15, 2 quarters from 3, red &5004 09 f7 ; move (15, -9) &5006 98 f5 ; ellipse size 15, 2 quarters from 1, red &5008 d3 c0 ; fill (-4, 0), red/blue &500a 53 40 ; fill (4, 0), red/blue &500c 43 0c ; fill (0, 12), red/green &500e 6b 04 ; fill (0, -12), green/blue &5010 00 ; end of picture ; picture_66_data # PICTURE_65, PICTURE_65, PICTURE_65, PICTURE_65 &5011 81 e0 ; move (-2, 0) &5013 38 47 ; circle size 4, 4 quarters from 1, blue &5015 b3 c0 ; fill (-4, 0), blue &5017 01 60 ; move (6, 0) &5019 38 47 ; circle size 4, 4 quarters from 1, blue &501b 33 40 ; fill (4, 0), blue &501d 01 08 ; move (0, 8) &501f 38 4b ; circle size 4, 4 quarters from 2, blue &5021 33 0c ; fill (0, 12), blue &5023 09 00 ; move (0, -16) &5025 38 4b ; circle size 4, 4 quarters from 2, blue &5027 3b 02 ; fill (0, -14), blue &5029 ba fe ; draw (-1, -2), blue &502b b2 b0 ; draw (-5, 0), blue &502d b2 f2 ; draw (-1, 2), blue &502f 32 0e ; draw (0, 14), blue &5031 32 12 ; draw (1, 2), blue &5033 32 50 ; draw (5, 0), blue &5035 3a 1e ; draw (1, -2), blue &5037 3a 02 ; draw (0, -14), blue &5039 33 00 ; fill (0, 0), blue &503b 00 ; end of picture ; picture_67_data # ROOM_52, ROOM_53, ROOM_54, ROOM_55, ROOM_6a, PICTURE_88 &503c 80 68 ; subpicture &68, scale 6 &503e d3 a0 ; fill (-6, 0), red/blue &5040 5b 6c ; fill (6, -4), red/blue &5042 4f 00 ; fill +(0, -16), red/green &5044 00 ; end of picture ; picture_68_data # PICTURE_67, PICTURE_67 &5045 89 cd ; move (-4, -3) &5047 9a dd ; draw (-3, -3), red &5049 9a db ; draw (-3, -5), red &504b 9a fb ; draw (-1, -5), red &504d 9a f9 ; draw (-1, -7), red &504f 1a 18 ; draw (1, -8), red &5051 1a 16 ; draw (1, -10), red &5053 1a 35 ; draw (3, -11), red &5055 1a 33 ; draw (3, -13), red &5057 1a 42 ; draw (4, -14), red &5059 9a c2 ; draw (-4, -14), red &505b 1a 33 ; draw (3, -13), red &505d 09 35 ; move (3, -11) &505f 9a c4 ; draw (-4, -12), red &5061 1a 16 ; draw (1, -10), red &5063 09 18 ; move (1, -8) &5065 9a c6 ; draw (-4, -10), red &5067 9a f9 ; draw (-1, -7), red &5069 89 fb ; move (-1, -5) &506b 9a c8 ; draw (-4, -8), red &506d 9a db ; draw (-3, -5), red &506f 89 dd ; move (-3, -3) &5071 9a ca ; draw (-4, -6), red ; picture_a1_data # PICTURE_a2 &5073 01 4c ; move (4, 12) &5075 1a 40 ; draw (4, -16), red &5077 9a c0 ; draw (-4, -16), red &5079 92 cc ; draw (-4, 12), red &507b 98 4d ; ellipse size 4, 2 quarters from 3, red &507d 81 c4 ; move (-4, 4) &507f b8 80 ; ellipse size 8, 1 quarters from 0, blue &5081 81 c5 ; move (-4, 5) &5083 b8 80 ; ellipse size 8, 1 quarters from 0, blue &5085 73 08 ; fill (0, 8), black/green &5087 7b 0d ; fill (0, -3), black/green &5089 00 ; end of picture ; picture_6d_data # ROOM_57 &508a 09 0a ; move (0, -6) &508c 90 6c ; subpicture &6c, scale 6 &508e 81 c1 ; move (-4, 1) &5090 b0 4e ; subpicture &4e, scale 4 &5092 01 04 ; move (0, 4) &5094 a0 51 ; subpicture &51, scale 5 &5096 01 41 ; move (4, 1) &5098 b0 55 ; subpicture &55, scale 5 &509a 01 00 ; move (0, 0) ; picture_69_data # PICTURE_6e, PICTURE_70, PICTURE_71, PICTURE_72, PICTURE_74, PICTURE_7a, PICTURE_7b, PICTURE_2f, PICTURE_a5, PICTURE_a6, PICTURE_a7 &509c 89 62 ; move (-10, -14) &509e aa 97 ; draw (-7, -9), green &50a0 a2 99 ; draw (-7, 9), green &50a2 a2 6e ; draw (-10, 14), green &50a4 81 99 ; move (-7, 9) &50a6 22 79 ; draw (7, 9), green &50a8 01 ae ; move (10, 14) &50aa 22 79 ; draw (7, 9), green &50ac 2a 77 ; draw (7, -9), green &50ae 2a a2 ; draw (10, -14), green &50b0 33 0e ; fill (0, 14), blue &50b2 d3 70 ; fill (-9, 0), red/blue &50b4 53 90 ; fill (9, 0), red/blue &50b6 d3 a8 ; fill (-6, 8), red/blue &50b8 eb 71 ; fill (-9, -15), green/blue &50ba 00 ; end of picture ; picture_6a_data # PICTURE_70, PICTURE_71, PICTURE_72, PICTURE_72, PICTURE_74, PICTURE_83, PICTURE_83, PICTURE_a7 &50bb 89 fc ; move (-1, -4) &50bd 9a fb ; draw (-1, -5), red &50bf 9a 9b ; draw (-7, -5), red &50c1 9a 9c ; draw (-7, -4), red &50c3 12 14 ; draw (1, 4), red &50c5 12 74 ; draw (7, 4), red &50c7 12 73 ; draw (7, 3), red &50c9 9a fb ; draw (-1, -5), red &50cb 9a f4 ; draw (-1, -12), red &50cd 9a e3 ; draw (-2, -13), red &50cf 9a eb ; draw (-2, -5), red &50d1 23 00 ; fill (0, 0), green &50d3 89 9c ; move (-7, -4) &50d5 9a fc ; draw (-1, -4), red &50d7 12 74 ; draw (7, 4), red &50d9 89 ab ; move (-6, -5) &50db 9a a3 ; draw (-6, -13), red &50dd 9a b4 ; draw (-5, -12), red &50df 9a bb ; draw (-5, -5), red &50e1 01 51 ; move (5, 1) &50e3 1a 5a ; draw (5, -6), red &50e5 1a 6b ; draw (6, -5), red &50e7 12 62 ; draw (6, 2), red &50e9 01 60 ; move (6, 0) &50eb 12 80 ; draw (8, 0), red &50ed 81 80 ; move (-8, 0) &50ef 92 d0 ; draw (-3, 0), red &50f1 00 ; end of picture ; picture_6b_data # PICTURE_6c, PICTURE_6e, PICTURE_a5, PICTURE_a6 &50f2 89 db ; move (-3, -5) &50f4 92 d8 ; draw (-3, 8), red &50f6 92 c8 ; draw (-4, 8), red &50f8 92 c0 ; draw (-4, 0), red &50fa 9a 9c ; draw (-7, -4), red &50fc 9a 91 ; draw (-7, -15), red &50fe 9a a1 ; draw (-6, -15), red &5100 9a a6 ; draw (-6, -10), red &5102 1a 66 ; draw (6, -10), red &5104 1a 61 ; draw (6, -15), red &5106 1a 71 ; draw (7, -15), red &5108 1a 7c ; draw (7, -4), red &510a 12 40 ; draw (4, 0), red &510c 12 48 ; draw (4, 8), red &510e 12 38 ; draw (3, 8), red &5110 1a 3b ; draw (3, -5), red &5112 9a db ; draw (-3, -5), red &5114 9a a7 ; draw (-6, -9), red &5116 1a 67 ; draw (6, -9), red &5118 1a 3b ; draw (3, -5), red &511a 5b 09 ; fill (0, -7), red/blue &511c ab ac ; fill (-6, -4), green &511e 9a 9c ; draw (-7, -4), red &5120 81 c0 ; move (-4, 0) &5122 92 d0 ; draw (-3, 0), red &5124 9a ac ; draw (-6, -4), red &5126 9a a1 ; draw (-6, -15), red &5128 9a b3 ; draw (-5, -13), red &512a 9a b6 ; draw (-5, -10), red &512c 09 6c ; move (6, -4) &512e 1a 7c ; draw (7, -4), red &5130 01 40 ; move (4, 0) &5132 12 30 ; draw (3, 0), red &5134 1a 6c ; draw (6, -4), red &5136 1a 61 ; draw (6, -15), red &5138 1a 53 ; draw (5, -13), red &513a 1a 56 ; draw (5, -10), red &513c 81 d7 ; move (-3, 7) &513e 12 0b ; draw (0, 11), red &5140 12 37 ; draw (3, 7), red &5142 63 00 ; fill (0, 0), green/blue &5144 00 ; end of picture ; picture_6c_data # PICTURE_6d, PICTURE_97, PICTURE_6d &5145 90 6b ; subpicture &6b, scale 6 &5147 89 de ; move (-3, -2) &5149 aa ae ; draw (-6, -2), green &514b aa 86 ; draw (-8, -10), green &514d aa 84 ; draw (-8, -12), green &514f 2a 84 ; draw (8, -12), green &5151 2a 86 ; draw (8, -10), green &5153 2a 6e ; draw (6, -2), green &5155 2a 3e ; draw (3, -2), green &5157 4b 06 ; fill (0, -10), red/green &5159 89 86 ; move (-8, -10) &515b 3a 86 ; draw (8, -10), blue &515d 89 2a ; move (-14, -6) &515f 9a 9a ; draw (-7, -6), red &5161 09 7a ; move (7, -6) &5163 1a ea ; draw (14, -6), red &5165 00 ; end of picture ; picture_6e_data # ROOM_56 &5166 09 36 ; move (3, -10) &5168 a0 6b ; subpicture &6b, scale 6 &516a 81 c2 ; move (-4, 2) &516c a0 54 ; subpicture &54, scale 5 &516e 89 97 ; move (-7, -9) &5170 1a 27 ; draw (2, -9), red &5172 09 47 ; move (4, -9) &5174 1a 77 ; draw (7, -9), red &5176 01 00 ; move (0, 0) &5178 80 69 ; subpicture &69, scale 6 &517a 00 ; end of picture ; picture_6f_data # PICTURE_70, PICTURE_2f, PICTURE_a7 &517b 89 a4 ; move (-6, -12) &517d ba 80 ; draw (-8, -16), blue &517f 9a 60 ; draw (-10, -16), red &5181 92 65 ; draw (-10, 5), red &5183 92 9a ; draw (-7, 10), red &5185 12 7a ; draw (7, 10), red &5187 12 a5 ; draw (10, 5), red &5189 1a a0 ; draw (10, -16), red &518b 1a 80 ; draw (8, -16), red &518d 3a 64 ; draw (6, -12), blue &518f c8 65 ; ellipse size 6, 2 quarters from 1, black &5191 1a 4a ; draw (4, -6), red &5193 10 ; start repeat &5194 9e ed ; draw +(-2, -3), red &5196 96 e3 ; draw +(-2, 3), red &5198 9e fe ; draw +(-1, -2), red &519a 96 e1 ; draw +(-2, 1), red &519c 9e fd ; draw +(-1, -3), red &519e 0d 7f ; move +(7, -1) &51a0 0c ; end repeat after 2 copies &51a1 89 c6 ; move (-4, -10) &51a3 9a b8 ; draw (-5, -8), red &51a5 9a a4 ; draw (-6, -12), red &51a7 4b 02 ; fill (0, -14), red/green &51a9 89 92 ; move (-7, -14) &51ab b2 91 ; draw (-7, 1), blue &51ad 09 72 ; move (7, -14) &51af 32 71 ; draw (7, 1), blue &51b1 81 80 ; move (-8, 0) &51b3 b2 c0 ; draw (-4, 0), blue &51b5 81 b0 ; move (-5, 0) &51b7 a8 2d ; ellipse size 2, 2 quarters from 3, green &51b9 81 d0 ; move (-3, 0) &51bb a8 4d ; ellipse size 4, 2 quarters from 3, green &51bd 01 30 ; move (3, 0) &51bf a8 45 ; ellipse size 4, 2 quarters from 1, green &51c1 01 40 ; move (4, 0) &51c3 32 80 ; draw (8, 0), blue &51c5 01 50 ; move (5, 0) &51c7 a8 25 ; ellipse size 2, 2 quarters from 1, green &51c9 89 44 ; move (-12, -12) &51cb 9a 64 ; draw (-10, -12), red &51cd 09 a4 ; move (10, -12) &51cf 1a c4 ; draw (12, -12), red &51d1 00 ; end of picture ; picture_70_data # ROOM_3b &51d2 09 4a ; move (4, -6) &51d4 a0 6f ; subpicture &6f, scale 6 &51d6 89 b7 ; move (-5, -9) &51d8 a0 6a ; subpicture &6a, scale 6 &51da 89 d7 ; move (-3, -9) &51dc 1a 17 ; draw (1, -9), red &51de 01 00 ; move (0, 0) &51e0 80 69 ; subpicture &69, scale 6 &51e2 00 ; end of picture ; picture_71_data # ROOM_39 &51e3 89 b7 ; move (-5, -9) &51e5 10 ; start repeat &51e6 a0 6a ; subpicture &6a, scale 6 &51e8 05 30 ; move +(3, 0) &51ea 14 ; end repeat after 3 copies &51eb 09 37 ; move (3, -9) &51ed 1a 77 ; draw (7, -9), red &51ef 01 00 ; move (0, 0) &51f1 80 69 ; subpicture &69, scale 6 &51f3 00 ; end of picture ; picture_72_data # ROOM_38 &51f4 89 b7 ; move (-5, -9) &51f6 a0 6a ; subpicture &6a, scale 6 &51f8 09 4a ; move (4, -6) &51fa a0 44 ; subpicture &44, scale 4 &51fc 09 37 ; move (3, -9) &51fe 90 6a ; subpicture &6a, scale 6 &5200 81 c0 ; move (-4, 0) &5202 b0 51 ; subpicture &51, scale 5 &5204 89 d7 ; move (-3, -9) &5206 9a f7 ; draw (-1, -9), red &5208 01 00 ; move (0, 0) &520a 80 69 ; subpicture &69, scale 6 &520c 00 ; end of picture ; picture_73_data # PICTURE_74, PICTURE_83, PICTURE_83 &520d 81 c0 ; move (-4, 0) &520f 98 4f ; ellipse size 4, 4 quarters from 3, red &5211 9a dc ; draw (-3, -4), red &5213 09 3c ; move (3, -4) &5215 98 35 ; ellipse size 3, 2 quarters from 1, red &5217 12 40 ; draw (4, 0), red &5219 2b 0b ; fill (0, -5), green &521b 09 00 ; move (0, -16) &521d 18 8b ; circle size 8, 4 quarters from 2, red &521f 23 02 ; fill (0, 2), green &5221 3b 08 ; fill (0, -8), blue &5223 00 ; end of picture ; picture_74_data # ROOM_3c &5224 09 4b ; move (4, -5) &5226 90 73 ; subpicture &73, scale 7 &5228 89 d7 ; move (-3, -9) &522a 90 6a ; subpicture &6a, scale 6 &522c 09 17 ; move (1, -9) &522e 1a 27 ; draw (2, -9), red &5230 09 67 ; move (6, -9) &5232 1a 77 ; draw (7, -9), red &5234 01 00 ; move (0, 0) &5236 80 69 ; subpicture &69, scale 6 &5238 00 ; end of picture ; picture_75_data # PICTURE_7a &5239 89 a5 ; move (-6, -11) &523b 10 ; start repeat &523c b0 50 ; subpicture &50, scale 5 &523e 05 10 ; move +(1, 0) &5240 1c ; end repeat after 4 copies &5241 01 16 ; move (1, 6) &5243 10 ; start repeat &5244 10 ; start repeat &5245 b0 50 ; subpicture &50, scale 5 &5247 05 10 ; move +(1, 0) &5249 0c ; end repeat after 2 copies &524a 8d ee ; move +(-2, -2) &524c 0c ; end repeat after 2 copies ; picture_76_data # PICTURE_7b, PICTURE_2f, PICTURE_a5 &524d 89 90 ; move (-7, -16) &524f 80 78 ; subpicture &78, scale 7 &5251 9a a2 ; draw (-6, -14), red &5253 9a a4 ; draw (-6, -12), red &5255 89 f0 ; move (-1, -16) &5257 80 77 ; subpicture &77, scale 7 &5259 89 e4 ; move (-2, -12) &525b 9a 94 ; draw (-7, -12), red &525d 09 4a ; move (4, -6) &525f 80 77 ; subpicture &77, scale 7 &5261 81 f3 ; move (-1, 3) &5263 92 f7 ; draw (-1, 7), red &5265 12 19 ; draw (1, 9), red &5267 12 29 ; draw (2, 9), red &5269 12 47 ; draw (4, 7), red &526b 12 43 ; draw (4, 3), red &526d 92 f3 ; draw (-1, 3), red &526f 9a 97 ; draw (-7, -9), red &5271 9a e7 ; draw (-2, -9), red &5273 12 43 ; draw (4, 3), red &5275 09 08 ; move (0, -8) &5277 1a 3e ; draw (3, -2), red &5279 89 ea ; move (-2, -6) &527b 80 79 ; subpicture &79, scale 7 &527d 81 e2 ; move (-2, 2) &527f 92 e1 ; draw (-2, 1), red &5281 73 00 ; fill (0, 0), black/green &5283 63 06 ; fill (0, 6), green/blue &5285 89 df ; move (-3, -1) &5287 92 d2 ; draw (-3, 2), red &5289 09 5c ; move (5, -4) &528b 1a ec ; draw (14, -4), red &528d 89 2c ; move (-14, -4) &528f 9a bc ; draw (-5, -4), red &5291 9a cd ; draw (-4, -3), red &5293 00 ; end of picture ; picture_77_data # PICTURE_76, PICTURE_76, PICTURE_76, PICTURE_76 &5294 12 08 ; draw (0, 8), red &5296 12 1a ; draw (1, 10), red &5298 12 12 ; draw (1, 2), red &529a 12 00 ; draw (0, 0), red ; picture_78_data # PICTURE_76, PICTURE_76 &529c 92 f0 ; draw (-1, 0), red &529e 92 f8 ; draw (-1, 8), red &52a0 12 08 ; draw (0, 8), red &52a2 12 00 ; draw (0, 0), red ; picture_79_data # PICTURE_76, PICTURE_76 &52a4 01 08 ; move (0, 8) &52a6 92 f8 ; draw (-1, 8), red &52a8 12 0a ; draw (0, 10), red &52aa 12 1a ; draw (1, 10), red &52ac 12 08 ; draw (0, 8), red &52ae 13 09 ; fill (0, 9), red &52b0 00 ; end of picture ; picture_7a_data # ROOM_5b &52b1 09 09 ; move (0, -7) &52b3 90 75 ; subpicture &75, scale 7 &52b5 81 e1 ; move (-2, 1) &52b7 a0 54 ; subpicture &54, scale 5 &52b9 01 00 ; move (0, 0) &52bb 80 69 ; subpicture &69, scale 6 &52bd 00 ; end of picture ; picture_7b_data # ROOM_5c &52be 09 09 ; move (0, -7) &52c0 90 76 ; subpicture &76, scale 7 &52c2 01 00 ; move (0, 0) &52c4 80 69 ; subpicture &69, scale 6 &52c6 00 ; end of picture ; picture_7c_data # ROOM_3a, PICTURE_7d &52c7 09 00 ; move (0, -16) &52c9 10 ; start repeat &52ca 96 60 ; draw +(-10, 0), red &52cc 16 03 ; draw +(0, 3), red &52ce 16 a0 ; draw +(10, 0), red &52d0 85 60 ; move +(-10, 0) &52d2 16 11 ; draw +(1, 1), red &52d4 16 a0 ; draw +(10, 0), red &52d6 24 ; end repeat after 5 copies &52d7 09 00 ; move (0, -16) &52d9 10 ; start repeat &52da 16 a0 ; draw +(10, 0), red &52dc 16 03 ; draw +(0, 3), red &52de 96 60 ; draw +(-10, 0), red &52e0 3f 0f ; fill +(0, -1), blue &52e2 05 a1 ; move +(10, 1) &52e4 96 f1 ; draw +(-1, 1), red &52e6 96 60 ; draw +(-10, 0), red &52e8 24 ; end repeat after 5 copies &52e9 01 04 ; move (0, 4) &52eb 10 ; start repeat &52ec 96 b0 ; draw +(-5, 0), red &52ee 16 03 ; draw +(0, 3), red &52f0 16 60 ; draw +(6, 0), red &52f2 14 ; end repeat after 3 copies &52f3 01 04 ; move (0, 4) &52f5 10 ; start repeat &52f6 16 50 ; draw +(5, 0), red &52f8 16 03 ; draw +(0, 3), red &52fa 96 a0 ; draw +(-6, 0), red &52fc 3f 4f ; fill +(4, -1), blue &52fe 85 c1 ; move +(-4, 1) &5300 14 ; end repeat after 3 copies &5301 89 60 ; move (-10, -16) &5303 92 6f ; draw (-10, 15), red &5305 12 af ; draw (10, 15), red &5307 1a a0 ; draw (10, -16), red &5309 01 2d ; move (2, 13) &530b 12 2f ; draw (2, 15), red &530d 81 ed ; move (-2, 13) &530f 92 ef ; draw (-2, 15), red &5311 33 0e ; fill (0, 14), blue &5313 d3 80 ; fill (-8, 0), red/blue &5315 53 80 ; fill (8, 0), red/blue &5317 00 ; end of picture ; picture_7d_data # ROOM_34 &5318 90 7c ; subpicture &7c, scale 7 &531a 89 8a ; move (-8, -6) &531c 90 8e ; subpicture &8e, scale 0 &531e 09 8b ; move (8, -5) &5320 90 8f ; subpicture &8f, scale 0 &5322 89 63 ; move (-10, -13) &5324 9a b8 ; draw (-5, -8), red &5326 92 b8 ; draw (-5, 8), red &5328 92 6d ; draw (-10, 13), red &532a 01 ad ; move (10, 13) &532c 12 58 ; draw (5, 8), red &532e 1a 58 ; draw (5, -8), red &5330 1a a3 ; draw (10, -13), red &5332 81 b8 ; move (-5, 8) &5334 92 ab ; draw (-6, 11), red &5336 12 6b ; draw (6, 11), red &5338 12 58 ; draw (5, 8), red &533a 6b 04 ; fill (0, -12), green/blue &533c d3 84 ; fill (-8, 4), red/blue &533e 53 84 ; fill (8, 4), red/blue &5340 33 0d ; fill (0, 13), blue &5342 00 ; end of picture ; picture_7e_data # ROOM_58 &5343 89 63 ; move (-10, -13) &5345 aa a7 ; draw (-6, -9), green &5347 aa c7 ; draw (-4, -9), green &5349 aa eb ; draw (-2, -5), green &534b 2a 2b ; draw (2, -5), green &534d 2a 47 ; draw (4, -9), green &534f 2a 67 ; draw (6, -9), green &5351 2a a3 ; draw (10, -13), green &5353 7b 04 ; fill (0, -12), black/green &5355 81 6d ; move (-10, 13) &5357 a2 a9 ; draw (-6, 9), green &5359 a2 c9 ; draw (-4, 9), green &535b a2 e5 ; draw (-2, 5), green &535d 22 25 ; draw (2, 5), green &535f 22 49 ; draw (4, 9), green &5361 22 69 ; draw (6, 9), green &5363 22 ad ; draw (10, 13), green &5365 33 0c ; fill (0, 12), blue &5367 89 fb ; move (-1, -5) &5369 a2 f0 ; draw (-1, 0), green &536b 22 02 ; draw (0, 2), green &536d 22 10 ; draw (1, 0), green &536f 2a 1b ; draw (1, -5), green &5371 d3 70 ; fill (-9, 0), red/blue &5373 89 a7 ; move (-6, -9) &5375 a2 a9 ; draw (-6, 9), green &5377 89 c7 ; move (-4, -9) &5379 a2 c9 ; draw (-4, 9), green &537b 89 eb ; move (-2, -5) &537d a2 e5 ; draw (-2, 5), green &537f 09 2b ; move (2, -5) &5381 22 25 ; draw (2, 5), green &5383 09 47 ; move (4, -9) &5385 22 49 ; draw (4, 9), green &5387 09 67 ; move (6, -9) &5389 22 69 ; draw (6, 9), green &538b 00 ; end of picture ; picture_7f_data # PICTURE_7f, PICTURE_80, PICTURE_81 &538c 89 ec ; move (-2, -4) &538e 9a c8 ; draw (-4, -8), red &5390 a2 c4 ; draw (-4, 4), green &5392 a2 e8 ; draw (-2, 8), green &5394 22 28 ; draw (2, 8), green &5396 22 44 ; draw (4, 4), green &5398 2a 48 ; draw (4, -8), green &539a 1a 2c ; draw (2, -4), red &539c 9a ec ; draw (-2, -4), red &539e 01 00 ; move (0, 0) &53a0 90 7f ; subpicture &7f, scale 7 &53a2 81 c4 ; move (-4, 4) &53a4 a2 e2 ; draw (-2, 2), green &53a6 81 e8 ; move (-2, 8) &53a8 a2 f4 ; draw (-1, 4), green &53aa 01 28 ; move (2, 8) &53ac 22 14 ; draw (1, 4), green &53ae 01 44 ; move (4, 4) &53b0 22 22 ; draw (2, 2), green &53b2 1b 0a ; fill (0, -6), red &53b4 53 0c ; fill (0, 12), red/blue &53b6 00 ; end of picture ; picture_80_data # ROOM_3e, ROOM_40, ROOM_41, ROOM_42, ROOM_43 &53b7 89 80 ; move (-8, -16) &53b9 9a c8 ; draw (-4, -8), red &53bb 09 80 ; move (8, -16) &53bd 1a 48 ; draw (4, -8), red &53bf 81 7a ; move (-9, 10) &53c1 a2 c4 ; draw (-4, 4), green &53c3 81 e8 ; move (-2, 8) &53c5 a2 cf ; draw (-4, 15), green &53c7 01 28 ; move (2, 8) &53c9 22 4f ; draw (4, 15), green &53cb 01 44 ; move (4, 4) &53cd 22 9a ; draw (9, 10), green &53cf 01 00 ; move (0, 0) &53d1 30 ; set scaling limit to 4 &53d2 80 7f ; subpicture &7f, scale 7 &53d4 70 ; set scaling limit to 8 &53d5 00 ; end of picture ; picture_82_data # ROOM_3f &53d6 09 3d ; move (3, -3) &53d8 a0 53 ; subpicture &53, scale 5 &53da 5b 3d ; fill (3, -3), red/blue &53dc 01 00 ; move (0, 0) ; picture_81_data # PICTURE_83, PICTURE_84 &53de 89 65 ; move (-10, -11) &53e0 ba 98 ; draw (-7, -8), blue &53e2 ba a8 ; draw (-6, -8), blue &53e4 89 98 ; move (-7, -8) &53e6 b2 94 ; draw (-7, 4), blue &53e8 b2 67 ; draw (-10, 7), blue &53ea 81 6d ; move (-10, 13) &53ec b2 a7 ; draw (-6, 7), blue &53ee 32 67 ; draw (6, 7), blue &53f0 32 ad ; draw (10, 13), blue &53f2 01 a7 ; move (10, 7) &53f4 32 74 ; draw (7, 4), blue &53f6 b2 94 ; draw (-7, 4), blue &53f8 33 05 ; fill (0, 5), blue &53fa 81 94 ; move (-7, 4) &53fc a2 a7 ; draw (-6, 7), green &53fe 01 67 ; move (6, 7) &5400 22 74 ; draw (7, 4), green &5402 3a 78 ; draw (7, -8), blue &5404 3a a5 ; draw (10, -11), blue &5406 89 e8 ; move (-2, -8) &5408 3a 78 ; draw (7, -8), blue &540a 89 cc ; move (-4, -4) &540c 30 ; set scaling limit to 4 &540d 90 7f ; subpicture &7f, scale 7 &540f 70 ; set scaling limit to 8 &5410 d3 70 ; fill (-9, 0), red/blue &5412 53 90 ; fill (9, 0), red/blue &5414 00 ; end of picture ; picture_83_data # ROOM_3d &5415 89 94 ; move (-7, -12) &5417 a0 6a ; subpicture &6a, scale 6 &5419 89 d4 ; move (-3, -12) &541b a0 6a ; subpicture &6a, scale 6 &541d 09 0a ; move (0, -6) &541f a0 73 ; subpicture &73, scale 7 &5421 09 4a ; move (4, -6) &5423 a0 73 ; subpicture &73, scale 7 &5425 01 00 ; move (0, 0) &5427 80 81 ; subpicture &81, scale 0 &5429 00 ; end of picture ; picture_84_data # ROOM_44 &542a 09 3c ; move (3, -4) &542c a0 a2 ; subpicture &a2, scale 2 &542e 01 00 ; move (0, 0) &5430 80 81 ; subpicture &81, scale 0 &5432 00 ; end of picture ; picture_85_data # PICTURE_aa, PICTURE_a8, PICTURE_a8, PICTURE_b9 &5433 89 c7 ; move (-4, -9) &5435 a8 28 ; ellipse size 2, 1 quarters from 2, green &5437 89 a9 ; move (-6, -7) &5439 a2 90 ; draw (-7, 0), green &543b 28 ec ; circle size 14, 1 quarters from 3, green &543d 01 0e ; move (0, 14) &543f 28 c0 ; circle size 12, 1 quarters from 0, green &5441 01 62 ; move (6, 2) &5443 2a 5b ; draw (5, -5), green &5445 28 44 ; circle size 4, 1 quarters from 1, green &5447 89 c9 ; move (-4, -7) &5449 a2 a0 ; draw (-6, 0), green &544b a2 ca ; draw (-4, 10), green &544d a2 ec ; draw (-2, 12), green &544f 28 c0 ; circle size 12, 1 quarters from 0, green &5451 01 40 ; move (4, 0) &5453 28 44 ; circle size 4, 1 quarters from 1, green &5455 00 ; end of picture ; picture_aa_data # PICTURE_aa, PICTURE_86 &5456 80 85 ; subpicture &85, scale 0 &5458 01 01 ; move (0, 1) &545a 90 aa ; subpicture &aa, scale 2 &545c 00 ; end of picture ; picture_86_data # ROOM_36, ROOM_62, ROOM_63, ROOM_66, ROOM_6e, PICTURE_89 &545d 30 ; set scaling limit to 4 &545e 80 aa ; subpicture &aa, scale 2 &5460 70 ; set scaling limit to 8 &5461 80 ab ; subpicture &ab, scale 2 &5463 53 80 ; fill (8, 0), red/blue &5465 00 ; end of picture ; picture_ab_data # PICTURE_86, PICTURE_a8, PICTURE_86 &5466 89 66 ; move (-10, -10) &5468 aa 81 ; draw (-8, -15), green &546a 81 63 ; move (-10, 3) &546c a2 8d ; draw (-8, 13), green &546e a2 cf ; draw (-4, 15), green &5470 01 5f ; move (5, 15) &5472 28 80 ; circle size 8, 1 quarters from 0, green &5474 01 97 ; move (9, 7) &5476 2a ac ; draw (10, -4), green &5478 28 a4 ; circle size 10, 1 quarters from 1, green &547a 89 c0 ; move (-4, -16) &547c a2 f0 ; draw (-1, 0), green &547e 22 10 ; draw (1, 0), green &5480 2a 40 ; draw (4, -16), green &5482 4b 04 ; fill (0, -12), red/green &5484 00 ; end of picture ; picture_8e_data # PICTURE_7d, PICTURE_7d &5485 89 d3 ; move (-3, -13) &5487 a2 d6 ; draw (-3, 6), green &5489 22 0e ; draw (0, 14), green &548b 22 38 ; draw (3, 8), green &548d 2a 39 ; draw (3, -7), green &548f 2a 28 ; draw (2, -8), green &5491 22 28 ; draw (2, 8), green &5493 a2 e6 ; draw (-2, 6), green &5495 aa e4 ; draw (-2, -12), green &5497 aa d3 ; draw (-3, -13), green &5499 13 09 ; fill (0, 9), red &549b 00 ; end of picture ; picture_8f_data # PICTURE_7d, PICTURE_7d &549c 89 e6 ; move (-2, -10) &549e a2 e6 ; draw (-2, 6), green &54a0 22 1c ; draw (1, 12), green &54a2 22 44 ; draw (4, 4), green &54a4 2a 40 ; draw (4, -16), green &54a6 2a 31 ; draw (3, -15), green &54a8 22 34 ; draw (3, 4), green &54aa a2 f6 ; draw (-1, 6), green &54ac aa f5 ; draw (-1, -11), green &54ae aa e6 ; draw (-2, -10), green &54b0 13 17 ; fill (1, 7), red &54b2 00 ; end of picture ; picture_87_data # PICTURE_45, PICTURE_88, PICTURE_89, PICTURE_8c, PICTURE_8a, PICTURE_45 &54b3 89 c8 ; move (-4, -8) &54b5 2a 48 ; draw (4, -8), green ; picture_9b_data # PICTURE_a9 &54b7 09 48 ; move (4, -8) &54b9 a8 60 ; ellipse size 6, 1 quarters from 0, green &54bb 89 60 ; move (-10, -16) &54bd aa 88 ; draw (-8, -8), green &54bf 81 6d ; move (-10, 13) &54c1 a2 af ; draw (-6, 15), green &54c3 28 f0 ; circle size 15, 1 quarters from 0, green &54c5 01 26 ; move (2, 6) &54c7 a8 ac ; ellipse size 10, 1 quarters from 3, green &54c9 01 36 ; move (3, 6) &54cb 28 c0 ; circle size 12, 1 quarters from 0, green &54cd 00 ; end of picture ; picture_92_data # ROOM_16, ROOM_20, ROOM_21, ROOM_22 &54ce 80 91 ; subpicture &91, scale 1 &54d0 80 5f ; subpicture &5f, scale 5 &54d2 80 5e ; subpicture &5e, scale 5 &54d4 13 42 ; fill (4, 2), red &54d6 00 ; end of picture ; picture_93_data # ROOM_15 &54d7 80 60 ; subpicture &60, scale 6 &54d9 80 91 ; subpicture &91, scale 1 &54db 80 5e ; subpicture &5e, scale 5 &54dd 13 42 ; fill (4, 2), red &54df 00 ; end of picture ; picture_95_data # ROOM_89, PICTURE_96 &54e0 81 6e ; move (-10, 14) &54e2 a2 72 ; draw (-9, 2), green &54e4 32 92 ; draw (9, 2), blue &54e6 22 ae ; draw (10, 14), green &54e8 63 08 ; fill (0, 8), green/blue &54ea 81 72 ; move (-9, 2) &54ec aa 94 ; draw (-7, -12), green &54ee 2a 00 ; draw (0, -16), green &54f0 01 92 ; move (9, 2) &54f2 2a 40 ; draw (4, -16), green &54f4 3a 45 ; draw (4, -11), blue &54f6 1b 92 ; fill (9, -14), red &54f8 9b 72 ; fill (-9, -14), red &54fa 09 45 ; move (4, -11) &54fc 38 8c ; circle size 8, 1 quarters from 3, blue &54fe 89 2e ; move (-14, -2) &5500 b8 e0 ; ellipse size 14, 1 quarters from 0, blue &5502 cb b8 ; fill (-5, -8), red/green &5504 4b 57 ; fill (5, -9), red/green &5506 33 00 ; fill (0, 0), blue &5508 00 ; end of picture ; picture_96_data # ROOM_88 &5509 80 30 ; subpicture &30, scale 3 &550b 90 95 ; subpicture &95, scale 1 &550d 00 ; end of picture ; picture_88_data # ROOM_6b, PICTURE_90 &550e 80 87 ; subpicture &87, scale 0 &5510 81 a0 ; move (-6, 0) &5512 90 67 ; subpicture &67, scale 6 &5514 00 ; end of picture ; picture_89_data # ROOM_4c, ROOM_65, ROOM_6c, ROOM_8b, ROOM_8e, PICTURE_9c &5515 80 87 ; subpicture &87, scale 0 &5517 81 a0 ; move (-6, 0) &5519 90 86 ; subpicture &86, scale 0 &551b 00 ; end of picture ; picture_be_data # ROOM_6f &551c 09 44 ; move (4, -12) &551e b0 b7 ; subpicture &b7, scale 3 &5520 89 e3 ; move (-2, -13) &5522 b0 b7 ; subpicture &b7, scale 3 &5524 01 00 ; move (0, 0) ; picture_8c_data # ROOM_b0, PICTURE_a3 &5526 80 87 ; subpicture &87, scale 0 &5528 89 c8 ; move (-4, -8) &552a aa 88 ; draw (-8, -8), green &552c 28 cc ; circle size 12, 1 quarters from 3, green &552e 53 00 ; fill (0, 0), red/blue &5530 4b 02 ; fill (0, -14), red/green &5532 00 ; end of picture ; picture_8d_data # PICTURE_90, PICTURE_9c, PICTURE_9d, PICTURE_97, PICTURE_b9 &5533 89 60 ; move (-10, -16) &5535 aa b8 ; draw (-5, -8), green &5537 89 78 ; move (-9, -8) &5539 a2 ab ; draw (-6, 11), green &553b 22 09 ; draw (0, 9), green &553d 01 1b ; move (1, 11) &553f 22 7f ; draw (7, 15), green &5541 2a 99 ; draw (9, -7), green &5543 09 59 ; move (5, -7) &5545 2a a0 ; draw (10, -16), green &5547 00 ; end of picture ; picture_90_data # ROOM_48 &5548 80 8d ; subpicture &8d, scale 0 &554a 90 88 ; subpicture &88, scale 0 &554c 00 ; end of picture ; picture_9c_data # ROOM_64, PICTURE_ba &554d 80 8d ; subpicture &8d, scale 0 &554f 90 89 ; subpicture &89, scale 0 &5551 00 ; end of picture ; picture_9d_data # ROOM_4d &5552 80 8d ; subpicture &8d, scale 0 &5554 90 8a ; subpicture &8a, scale 0 &5556 00 ; end of picture ; picture_9e_data # ROOM_46 &5557 09 5f ; move (5, -1) &5559 90 9a ; subpicture &9a, scale 1 &555b 01 00 ; move (0, 0) ; picture_8a_data # ROOM_35, ROOM_68, PICTURE_9d, PICTURE_9f, PICTURE_a0, PICTURE_9d &555d 80 87 ; subpicture &87, scale 0 &555f 81 a0 ; move (-6, 0) &5561 80 98 ; subpicture &98, scale 1 &5563 00 ; end of picture ; picture_98_data # PICTURE_8a, PICTURE_a8, PICTURE_8a &5564 8d e8 ; move +(-2, -8) &5566 92 e8 ; draw (-2, 8), red &5568 12 28 ; draw (2, 8), red &556a 1a 28 ; draw (2, -8), red &556c 9a e8 ; draw (-2, -8), red &556e 23 00 ; fill (0, 0), green &5570 90 48 ; subpicture &48, scale 4 &5572 53 50 ; fill (5, 0), red/blue &5574 4b 06 ; fill (0, -10), red/green &5576 00 ; end of picture ; picture_97_data # ROOM_6d &5577 80 8d ; subpicture &8d, scale 0 &5579 09 0e ; move (0, -2) &557b a0 6c ; subpicture &6c, scale 6 &557d 89 b8 ; move (-5, -8) &557f aa cc ; draw (-4, -4), green &5581 aa dd ; draw (-3, -3), green &5583 09 3d ; move (3, -3) &5585 2a 4c ; draw (4, -4), green &5587 2a 59 ; draw (5, -7), green &5589 53 06 ; fill (0, 6), red/blue &558b 7b 02 ; fill (0, -14), black/green &558d 00 ; end of picture ; picture_8b_data # PICTURE_9f, PICTURE_a0 &558e 81 c0 ; move (-4, 0) &5590 10 ; start repeat &5591 05 0e ; move +(0, 14) &5593 10 ; start repeat &5594 28 2f ; circle size 2, 4 quarters from 3, green &5596 0d 0d ; move +(0, -3) &5598 2c ; end repeat after 6 copies &5599 05 01 ; move +(0, 1) &559b 26 20 ; draw +(2, 0), green &559d 28 41 ; circle size 4, 2 quarters from 0, green &559f 8d e8 ; move +(-2, -8) &55a1 28 49 ; circle size 4, 2 quarters from 2, green &55a3 05 8b ; move +(8, 11) &55a5 0c ; end repeat after 2 copies &55a6 00 ; end of picture ; picture_99_data # a broad sword, PICTURE_9a, PICTURE_ae, PICTURE_bb &55a7 01 17 ; move (1, 7) &55a9 32 38 ; draw (3, 8), blue &55ab 32 19 ; draw (1, 9), blue &55ad 32 0f ; draw (0, 15), blue &55af b2 f9 ; draw (-1, 9), blue &55b1 b2 d8 ; draw (-3, 8), blue &55b3 b2 f7 ; draw (-1, 7), blue &55b5 3a 00 ; draw (0, -16), blue &55b7 32 17 ; draw (1, 7), blue &55b9 63 08 ; fill (0, 8), green/blue &55bb 00 ; end of picture ; picture_9a_data # PICTURE_9e, PICTURE_9e &55bc 89 ae ; move (-6, -2) &55be 10 ; start repeat &55bf a0 99 ; subpicture &99, scale 1 &55c1 05 20 ; move +(2, 0) &55c3 2c ; end repeat after 6 copies &55c4 9a 8e ; draw (-8, -2), red &55c6 92 83 ; draw (-8, 3), red &55c8 12 63 ; draw (6, 3), red &55ca 1a 6e ; draw (6, -2), red &55cc 13 02 ; fill (0, 2), red &55ce 00 ; end of picture ; picture_9f_data # ROOM_49, ROOM_a8 &55cf 09 5e ; move (5, -2) &55d1 a0 8b ; subpicture &8b, scale 0 &55d3 01 00 ; move (0, 0) &55d5 80 8a ; subpicture &8a, scale 0 &55d7 00 ; end of picture ; picture_a0_data # ROOM_4b &55d8 90 8b ; subpicture &8b, scale 0 &55da 80 8a ; subpicture &8a, scale 0 &55dc 00 ; end of picture ; picture_a2_data # PICTURE_45, PICTURE_65, PICTURE_84, PICTURE_45, PICTURE_65, PICTURE_84 &55dd 89 c0 ; move (-4, -16) &55df 9a e2 ; draw (-2, -14), red &55e1 1a 40 ; draw (4, -16), red &55e3 1a 31 ; draw (3, -15), red &55e5 1a 11 ; draw (1, -15), red &55e7 01 00 ; move (0, 0) &55e9 80 a1 ; subpicture &a1, scale 2 &55eb 00 ; end of picture ; picture_a3_data # ROOM_4a &55ec 09 0a ; move (0, -6) &55ee a0 50 ; subpicture &50, scale 5 &55f0 89 f8 ; move (-1, -8) &55f2 aa e5 ; draw (-2, -11), green &55f4 2a 25 ; draw (2, -11), green &55f6 2a 18 ; draw (1, -8), green &55f8 01 00 ; move (0, 0) &55fa 80 8c ; subpicture &8c, scale 0 &55fc 00 ; end of picture ; picture_2f_data # ROOM_00 &55fd 01 04 ; move (0, 4) &55ff 90 55 ; subpicture &55, scale 5 &5601 89 ca ; move (-4, -6) &5603 a0 6f ; subpicture &6f, scale 6 &5605 09 28 ; move (2, -8) &5607 a0 76 ; subpicture &76, scale 7 &5609 09 77 ; move (7, -9) &560b 1a 57 ; draw (5, -9), red &560d 01 00 ; move (0, 0) &560f 80 69 ; subpicture &69, scale 6 &5611 00 ; end of picture ; picture_a5_data # ROOM_5e &5612 89 97 ; move (-7, -9) &5614 9a a7 ; draw (-6, -9), red &5616 89 d8 ; move (-3, -8) &5618 a0 76 ; subpicture &76, scale 7 &561a 09 07 ; move (0, -9) &561c 1a 37 ; draw (3, -9), red &561e 09 57 ; move (5, -9) &5620 1a 77 ; draw (7, -9), red &5622 09 47 ; move (4, -9) &5624 a0 6b ; subpicture &6b, scale 6 &5626 01 00 ; move (0, 0) &5628 80 69 ; subpicture &69, scale 6 &562a 00 ; end of picture ; picture_a6_data # ROOM_5f &562b 89 97 ; move (-7, -9) &562d 10 ; start repeat &562e 16 20 ; draw +(2, 0), red &5630 05 10 ; move +(1, 0) &5632 a0 6b ; subpicture &6b, scale 6 &5634 05 10 ; move +(1, 0) &5636 16 30 ; draw +(3, 0), red &5638 0c ; end repeat after 2 copies &5639 01 00 ; move (0, 0) &563b 80 69 ; subpicture &69, scale 6 &563d 00 ; end of picture ; picture_a7_data # ROOM_60 &563e 89 ca ; move (-4, -6) &5640 a0 6f ; subpicture &6f, scale 6 &5642 09 07 ; move (0, -9) &5644 10 ; start repeat &5645 b0 6a ; subpicture &6a, scale 6 &5647 05 20 ; move +(2, 0) &5649 0c ; end repeat after 2 copies &564a 09 37 ; move (3, -9) &564c 1a 77 ; draw (7, -9), red &564e 01 00 ; move (0, 0) &5650 80 69 ; subpicture &69, scale 6 &5652 00 ; end of picture ; picture_a8_data # ROOM_47, ROOM_61, ROOM_67, ROOM_aa &5653 80 85 ; subpicture &85, scale 0 &5655 80 ab ; subpicture &ab, scale 2 &5657 01 03 ; move (0, 3) &5659 90 85 ; subpicture &85, scale 0 &565b 01 04 ; move (0, 4) &565d 90 98 ; subpicture &98, scale 1 &565f 00 ; end of picture ; picture_a9_data # ROOM_45 &5660 09 48 ; move (4, -8) &5662 b8 45 ; ellipse size 4, 2 quarters from 1, blue &5664 2a 49 ; draw (4, -7), green &5666 a8 47 ; ellipse size 4, 4 quarters from 1, green &5668 6b 08 ; fill (0, -8), green/blue &566a 89 c9 ; move (-4, -7) &566c aa c8 ; draw (-4, -8), green &566e aa 88 ; draw (-8, -8), green &5670 bb d6 ; fill (-3, -10), blue &5672 ba d2 ; draw (-3, -14), blue &5674 ba e1 ; draw (-2, -15), blue &5676 ba e5 ; draw (-2, -11), blue &5678 09 25 ; move (2, -11) &567a 3a 21 ; draw (2, -15), blue &567c 3a 32 ; draw (3, -14), blue &567e 3a 36 ; draw (3, -10), blue &5680 01 00 ; move (0, 0) &5682 80 9b ; subpicture &9b, scale 1 &5684 53 00 ; fill (0, 0), red/blue &5686 cb b6 ; fill (-5, -10), red/green &5688 00 ; end of picture ; picture_ac_data # PICTURE_ad, PICTURE_b0 &5689 89 62 ; move (-10, -14) &568b ba b9 ; draw (-5, -7), blue &568d 09 a2 ; move (10, -14) &568f 3a 59 ; draw (5, -7), blue &5691 89 8e ; move (-8, -2) &5693 a0 46 ; subpicture &46, scale 4 &5695 09 9c ; move (9, -4) &5697 a0 46 ; subpicture &46, scale 4 ; picture_af_data # PICTURE_ae, PICTURE_b1 &5699 89 3b ; move (-13, -5) &569b a8 4d ; ellipse size 4, 2 quarters from 3, green &569d 09 5b ; move (5, -5) &569f a8 4d ; ellipse size 4, 2 quarters from 3, green &56a1 00 ; end of picture ; picture_ad_data # ROOM_99, PICTURE_b0 &56a2 80 ac ; subpicture &ac, scale 2 &56a4 90 ae ; subpicture &ae, scale 2 &56a6 00 ; end of picture ; picture_b0_data # ROOM_98 &56a7 80 ac ; subpicture &ac, scale 2 &56a9 90 ad ; subpicture &ad, scale 2 &56ab 00 ; end of picture ; picture_ae_data # ROOM_9b, PICTURE_ad, PICTURE_ad &56ac 01 1a ; move (1, 10) &56ae a0 99 ; subpicture &99, scale 1 &56b0 28 43 ; circle size 4, 4 quarters from 0, green &56b2 89 62 ; move (-10, -14) &56b4 ba 96 ; draw (-7, -10), blue &56b6 10 ; start repeat &56b7 10 ; start repeat &56b8 90 08 ; subpicture &08, scale 0 &56ba 05 08 ; move +(0, 8) &56bc 0c ; end repeat after 2 copies &56bd 09 36 ; move (3, -10) &56bf 0c ; end repeat after 2 copies &56c0 81 96 ; move (-7, 6) &56c2 a8 8d ; ellipse size 8, 2 quarters from 3, green &56c4 09 a2 ; move (10, -14) &56c6 3a 76 ; draw (7, -10), blue &56c8 09 36 ; move (3, -10) &56ca aa f6 ; draw (-1, -10), green &56cc 90 b2 ; subpicture &b2, scale 3 &56ce 03 00 ; fill (0, 0), black/red &56d0 80 af ; subpicture &af, scale 2 &56d2 01 12 ; move (1, 2) &56d4 0a 16 ; draw (1, -10), black &56d6 5b 95 ; fill (9, -11), red/blue &56d8 73 4a ; fill (4, 10), black/green &56da f3 da ; fill (-3, 10), black/green &56dc db 75 ; fill (-9, -11), red/blue &56de 63 8e ; fill (8, 14), green/blue &56e0 00 ; end of picture ; picture_b1_data # ROOM_9c, ROOM_9e, ROOM_9f &56e1 80 af ; subpicture &af, scale 2 &56e3 89 77 ; move (-9, -9) &56e5 a8 9d ; ellipse size 9, 2 quarters from 3, green &56e7 5b 06 ; fill (0, -10), red/blue &56e9 63 0a ; fill (0, 10), green/blue &56eb 00 ; end of picture ; picture_b4_data # PICTURE_5b, PICTURE_40, PICTURE_5b, PICTURE_40 &56ec 89 bb ; move (-5, -5) &56ee 9a eb ; draw (-2, -5), red &56f0 9a fc ; draw (-1, -4), red &56f2 1a 1c ; draw (1, -4), red &56f4 1a 2b ; draw (2, -5), red &56f6 1a 5b ; draw (5, -5), red &56f8 00 ; end of picture ; picture_ba_data # ROOM_ae &56f9 89 60 ; move (-10, -16) &56fb 0d 0c ; move +(0, -4) &56fd b8 8c ; ellipse size 8, 1 quarters from 3, blue &56ff 89 ea ; move (-2, -6) &5701 b8 28 ; ellipse size 2, 1 quarters from 2, blue &5703 b8 31 ; ellipse size 3, 2 quarters from 0, blue &5705 89 ec ; move (-2, -4) &5707 b8 71 ; ellipse size 7, 2 quarters from 0, blue &5709 01 00 ; move (0, 0) &570b 80 9c ; subpicture &9c, scale 1 &570d 8b e6 ; fill (-2, -10), black/red &570f 0b 66 ; fill (6, -10), black/red &5711 00 ; end of picture ; picture_bb_data # a short dagger &5712 90 99 ; subpicture &99, scale 1 &5714 00 ; end of picture ; picture_b7_data # PICTURE_be, PICTURE_be, PICTURE_b9, PICTURE_be, PICTURE_be &5715 89 ac ; move (-6, -4) &5717 ba 8e ; draw (-8, -2), blue &5719 38 ee ; circle size 14, 3 quarters from 3, blue &571b ba 88 ; draw (-8, -8), blue &571d 90 b8 ; subpicture &b8, scale 3 &571f 89 c0 ; move (-4, -16) &5721 ba f0 ; draw (-1, -16), blue &5723 ba e4 ; draw (-2, -12), blue &5725 89 ec ; move (-2, -4) &5727 ba a8 ; draw (-6, -8), blue &5729 ba c4 ; draw (-4, -12), blue &572b ba ec ; draw (-2, -4), blue &572d 01 04 ; move (0, 4) &572f 38 47 ; circle size 4, 4 quarters from 1, blue &5731 01 20 ; move (2, 0) &5733 38 43 ; circle size 4, 4 quarters from 0, blue &5735 63 00 ; fill (0, 0), green/blue &5737 00 ; end of picture ; picture_b8_data # PICTURE_b7, PICTURE_b7 &5738 10 ; start repeat &5739 3e 1e ; draw +(1, -2), blue &573b be ec ; draw +(-2, -4), blue &573d 3e 1e ; draw +(1, -2), blue &573f 36 24 ; draw +(2, 4), blue &5741 0d 1e ; move +(1, -2) &5743 14 ; end repeat after 3 copies &5744 09 2c ; move (2, -4) &5746 3a 3a ; draw (3, -6), blue &5748 09 32 ; move (3, -14) &574a 3a 40 ; draw (4, -16), blue &574c 3a 64 ; draw (6, -12), blue &574e 00 ; end of picture ; picture_b9_data # a long wooden staff &574f 01 6c ; move (6, 12) &5751 a0 b7 ; subpicture &b7, scale 3 &5753 01 58 ; move (5, 8) &5755 9a 90 ; draw (-7, -16), red &5757 9a 82 ; draw (-8, -14), red &5759 12 4a ; draw (4, 10), red &575b 9b a4 ; fill (-6, -12), red &575d 10 ; start repeat &575e 05 36 ; move +(3, 6) &5760 c0 8d ; subpicture &8d, scale 0 &5762 14 ; end repeat after 3 copies &5763 10 ; start repeat &5764 8d ec ; move +(-2, -4) &5766 c0 85 ; subpicture &85, scale 0 &5768 14 ; end repeat after 3 copies &5769 00 ; end of picture ; picture_bf_data # a large cut diamond &576a 30 ; set scaling limit to 4 ; picture_bc_data # PICTURE_bc, PICTURE_bc, PICTURE_bc, PICTURE_c2, PICTURE_c3 &576b 81 80 ; move (-8, 0) &576d 92 c8 ; draw (-4, 8), red &576f 32 48 ; draw (4, 8), blue &5771 22 80 ; draw (8, 0), green &5773 1a 48 ; draw (4, -8), red &5775 ba c8 ; draw (-4, -8), blue &5777 a2 80 ; draw (-8, 0), green &5779 81 a4 ; move (-6, 4) &577b 10 ; start repeat &577c 10 ; start repeat &577d 90 bc ; subpicture &bc, scale 3 &577f 05 64 ; move +(6, 4) &5781 0c ; end repeat after 2 copies &5782 09 08 ; move (0, -8) &5784 0c ; end repeat after 2 copies &5785 89 ac ; move (-6, -4) &5787 90 bc ; subpicture &bc, scale 3 &5789 01 64 ; move (6, 4) &578b 90 bc ; subpicture &bc, scale 3 &578d 63 12 ; fill (1, 2), green/blue &578f 2b 1e ; fill (1, -2), green &5791 b3 f0 ; fill (-1, 0), blue &5793 00 ; end of picture ; picture_bd_data # a short wooden rod &5794 b0 3d ; subpicture &3d, scale 3 &5796 81 ed ; move (-2, 13) &5798 b8 2d ; ellipse size 2, 2 quarters from 3, blue &579a b2 ea ; draw (-2, 10), blue &579c b8 2d ; ellipse size 2, 2 quarters from 3, blue &579e ba e6 ; draw (-2, -10), blue &57a0 b8 2d ; ellipse size 2, 2 quarters from 3, blue &57a2 ba e3 ; draw (-2, -13), blue &57a4 b8 2f ; ellipse size 2, 4 quarters from 3, blue &57a6 09 23 ; move (2, -13) &57a8 32 2d ; draw (2, 13), blue &57aa 63 0d ; fill (0, 13), green/blue &57ac 03 08 ; fill (0, 8), black/red &57ae 0b 08 ; fill (0, -8), black/red &57b0 6b 06 ; fill (0, -10), green/blue &57b2 3b 03 ; fill (0, -13), blue &57b4 00 ; end of picture ; picture_c2_data # a crystal ball &57b5 20 ; set scaling limit to 3 &57b6 90 bc ; subpicture &bc, scale 3 &57b8 81 a0 ; move (-6, 0) &57ba 38 cf ; circle size 12, 4 quarters from 3, blue &57bc 63 50 ; fill (5, 0), green/blue &57be 00 ; end of picture ; picture_c0_data # ROOM_14, ROOM_8a, ROOM_a2, ROOM_a6, ROOM_ac &57bf 40 ; set scaling limit to 5 &57c0 89 6e ; move (-10, -2) &57c2 90 14 ; subpicture &14, scale 1 &57c4 09 ae ; move (10, -2) &57c6 90 11 ; subpicture &11, scale 1 &57c8 89 e8 ; move (-2, -8) &57ca 9a d0 ; draw (-3, -16), red &57cc 09 60 ; move (6, -16) &57ce 48 88 ; circle size 8, 1 quarters from 2, black &57d0 89 15 ; move (-15, -11) &57d2 c8 ac ; ellipse size 10, 1 quarters from 3, black &57d4 89 14 ; move (-15, -12) &57d6 c8 ac ; ellipse size 10, 1 quarters from 3, black &57d8 01 00 ; move (0, 0) &57da 90 58 ; subpicture &58, scale 5 &57dc 00 ; end of picture ; picture_c1_data # ROOM_30, ROOM_a0, ROOM_a3, ROOM_a7, ROOM_ad &57dd 40 ; set scaling limit to 5 &57de 09 0e ; move (0, -2) &57e0 80 14 ; subpicture &14, scale 1 &57e2 63 0f ; fill (0, 15), green/blue &57e4 89 c0 ; move (-4, -16) &57e6 b8 ec ; ellipse size 14, 1 quarters from 3, blue &57e8 09 40 ; move (4, -16) &57ea 38 cc ; circle size 12, 1 quarters from 3, blue &57ec 4b 01 ; fill (0, -15), red/green &57ee db c6 ; fill (-4, -10), red/blue &57f0 ba 9d ; draw (-7, -3), blue &57f2 ba 7b ; draw (-9, -5), blue &57f4 1b 91 ; fill (9, -15), red &57f6 2a 89 ; draw (8, -7), green &57f8 2a 77 ; draw (7, -9), green &57fa 00 ; end of picture ; picture_c3_data # the secret of life &57fb 90 bc ; subpicture &bc, scale 3 &57fd 00 ; end of picture ; unused &57fe 31 2d ; "1-" ; unused # Source code fragment &5800 0d # Start of BASIC program &5801 00 14 0f 2a 46 58 31 33 38 2c 30 2c 31 33 0d ; 20*FX138,0,13 # Insert value into keyboard buffer &5810 00 1e 0f 2a 46 58 31 33 38 2c 30 2c 31 33 0d ; 30*FX138,0,13 # Insert value into keyboard buffer &581f 00 28 0f 2a 46 58 31 33 38 2c 30 2c 31 33 0d ; 40*FX138,0,13 # Insert value into keyboard buffer &582e 00 2d 0f 2a 46 58 31 33 38 2c 30 2c 31 33 0d ; 45*FX138,0,13 # Insert value into keyboard buffer &583d 00 32 12 2a 4c 2e 54 2e 49 4e 49 54 20 33 30 30 ; 50*L.T.INIT 3000 &584d 30 0d &584f 00 3c 07 2a 54 2e 0d ; 60*T. &5856 00 46 14 2a 53 2e 22 54 57 49 4e 22 33 30 30 30 ; 70*S."TWIN"3000+20 &5866 2b 32 30 0d &586a 00 50 07 2a 44 2e 0d ; 80*D. ; &5871 00 5a 14 2a 4c 2e 22 54 2e 54 49 54 4c 45 22 33 ; 90*L."T.TITLE"3000 &5881 30 30 30 0d &5885 00 64 07 2a 54 2e 0d ; 100*T. &588c 00 6e 16 2a 53 2e 22 54 49 54 4c 45 22 33 30 30 ; 110*S."TITLE"3000+300 &589c 30 2b 33 30 30 0d &58a2 00 78 07 2a 44 2e 0d ; 120*D. &58a9 00 7a 11 2a 4c 2e 22 4c 56 41 4c 22 33 30 30 30 ; 122*L."LVAL"3000 &58b9 0d &58ba 00 7c 07 2a 54 2e 0d ; 124*T. &58c1 00 7e 1f 2a 53 2e 22 4c 56 41 4c 22 33 30 30 30 ; 126*S."LVAL"3000+100 7A00 7A00 &58d1 2b 31 30 30 20 37 41 30 30 20 37 41 30 30 0d &58e0 00 80 07 2a 44 2e 0d ; 128*D. &58e7 00 82 0b 2a 4c 2e 50 49 43 53 0d ; 130*L.PICS &58f2 00 8c 12 2a 4c 2e 56 41 4c 44 4f 43 20 36 30 30 ; 140*L.VALDOC 6000 &5902 30 0d &5904 00 91 14 2a 4c 2e 22 53 2f 4c 43 4f 44 45 22 35 ; 145*L."S/LCODE"5E00 &5914 45 30 30 0d &5918 00 a0 0c 2a 4c 2e 22 52 4d 53 22 0d ; 160*L."RMS" &5924 00 aa 0c 2a 4c 2e 22 57 44 53 22 0d ; 170*L."WDS" &5930 00 b4 10 2a 4c 2e 22 50 20 46 4f 52 20 52 22 0d ; 180*L."P FOR R" &5940 00 be 0d 2a 4c 2e 50 49 43 43 44 45 0d ; 190*L.PICCDE &594d 00 c8 0c 2a 4c 2e 4d 43 4f 44 45 0d ; 200*L.MCODE &5959 00 d2 11 2a 4c 2e 41 4e 43 44 45 20 37 30 30 30 ; 210*L.ANCDE 7000 &5969 0d &596a 00 dc 13 2a 4c 2e 57 4f 52 44 53 5f 32 20 37 38 ; 220*L.WORDS_2 7800 &597a 30 30 0d &597d 00 f0 0c 2a 4c 2e 46 49 4e 41 4c 0d ; 240*L.FINAL &5989 00 f5 0c 2a 4c 2e 45 4e 54 45 52 0d ; 245*L.ENTER &5995 00 fa 09 2a 54 41 50 45 0d ; 250*TAPE &599e 00 ff 22 e3 49 25 3d 30 b8 31 30 32 33 3a 49 25 ; 255FORI%=0TO1023: &59ae 3f 26 31 30 30 30 3d 49 25 3f 26 37 38 30 30 3a ; I%?&1000=I%?&7800: # Move &7800 - &7bff to &1000 - &13ff &59be ed 0d ; NEXT &59c0 01 04 31 24 26 43 30 30 3d 22 53 41 56 45 22 22 ; 260$&C00="SAVE""VALLEY "+CHR$127+""" 1000 7800 0 0" &59d0 56 41 4c 4c 45 59 20 22 2b bd 31 32 37 2b 22 22 &59e0 22 20 31 30 30 30 20 37 38 30 30 20 30 20 30 22 &59f0 0d &59f1 01 06 15 58 25 3d 30 3a 59 25 3d 31 32 3a d6 26 ; 262X%=0:Y%=12:CALL&FFF7 # OSCLI &0c00 &5a01 46 46 46 37 0d &5a06 01 08 09 e5 8d 64 55 47 0d ; 264GOTO2005 &5a0f 01 2c 0b 2a 4f 50 54 33 2c 33 0d ; 300*OPT3,3 # Set interblock gaps to 0.3 seconds &5a1a 03 84 21 43 25 3d 26 37 30 3a 54 25 3d 26 37 31 ; 900C%=&70:T%=&71:ADH=&73:ADL=&72 &5a2a 3a 41 44 48 3d 26 37 33 3a 41 44 4c 3d 26 37 32 ; T%=&71: &5a3a 0d ; ADH=&73: ; ADL=&72 &5a3b 03 e8 1f de 51 25 31 30 30 3a e3 49 3d 30 b8 31 ; 1000DIMQ%100: &5a4b 3a 50 25 3d 51 25 3a 5b 4f 50 54 49 2a 32 0d ; FORI=0TO1: ; P%=Q%: ; [OPTI*2 &5a5a 03 f2 2d 2e 53 56 20 53 54 41 43 25 3a 4c 44 41 ; 1010.SV STAC%: &5a6a 23 26 31 30 3a 53 54 41 41 44 48 3a 4c 44 41 23 ; LDA#&10: # &1000 &5a7a 30 3a 53 54 41 41 44 4c 3a 54 41 59 0d ; STAADH: ; LDA#0: ; STAADL ; TAY &5a87 03 fc 73 2e 4e 42 59 54 20 4c 44 41 28 41 44 4c ; 1020.NBYT LDA(ADL),Y: &5a97 29 2c 59 3a 53 54 59 54 25 3a 4c 44 59 43 25 3a ; STYT%: &5aa7 4a 53 52 26 46 46 44 34 3a 4c 44 59 54 25 3a 49 ; LDYC%: &5ab7 4e 59 3a 42 4e 45 4e 42 59 54 3a 4c 44 58 41 44 ; JSR&FFD4: # OSBPUT &5ac7 48 3a 49 4e 58 3a 43 50 58 23 26 37 38 3a 42 4e ; LDYT%: &5ad7 45 43 4f 4e 54 3a 52 54 53 3a 2e 43 4f 4e 54 20 ; INY: &5ae7 53 54 58 41 44 48 3a 42 4e 45 4e 42 59 54 3a 5d ; BNENBYT: &5af7 3a ed 0d ; LDXADH: ; INX: ; CPX#&78: # &7800 ; BNECONT: ; RTS: ; .CONT STXADH: ; BNENBYT: ; ]: ; NEXT &5afa 07 d0 28 41 25 3d ae 28 22 22 22 56 41 4c 4c 45 ; 2000A%=OPENOUT("""VALLEY "+CHR$127+""""): &5b0a 59 20 22 2b bd 31 32 37 2b 22 22 22 22 29 3a d6 ; CALLSV: &5b1a 53 56 3a d9 23 41 25 0d ; CLOSE#A% &5b22 07 d5 09 2a 46 58 31 38 0d ; 2005*FX18 # Reset soft keys &5b2b 07 e4 05 e0 0d ; 2020END &5b30 ff # End of BASIC program ; unused &5b31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5b41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5b51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5b61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5b71 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5b81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5b91 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5ba1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5bb1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5bc1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5bd1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5be1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5bf1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff &5c01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5c11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5c21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5c31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5c41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5c51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5c61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5c71 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5c81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5c91 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5ca1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5cb1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5cc1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5cd1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5ce1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5cf1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff &5d01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5d11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5d21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5d31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5d41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5d51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5d61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5d71 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5d81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5d91 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5da1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5db1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5dc1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5dd1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5de1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5df1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # &5e00 - &5eff is moved to &0b00 - &0bff at &7a76 ; unused &0b00 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b ; unused &0b0b 11 81 ; COLOUR 128 + 1 &0b0d 48 65 6c 70 ; "Help" &0b11 0d ; draw_picture # Called with X = picture &0b12 8a TXA &0b13 48 PHA ; picture &0b14 a0 00 LDY #&00 ; populate_row_addresses_tables_loop &0b16 98 TYA &0b17 29 07 AND #&07 &0b19 85 32 STA &32 ; row_in_group &0b1b a9 c7 LDA #&c7 &0b1d e5 32 SBC &32 ; row_in_group &0b1f 85 31 STA &31 ; last_group_address_low &0b21 a9 7e LDA #&7e &0b23 e9 00 SBC #&00 &0b25 85 32 STA &32 ; last_group_address_high &0b27 a9 00 LDA #&00 &0b29 85 33 STA &33 ; group_offset_low &0b2b 98 TYA &0b2c 29 f8 AND #&f8 &0b2e 4a LSR A &0b2f 4a LSR A &0b30 4a LSR A &0b31 85 30 STA &30 ; group_offset_high &0b33 4a LSR A &0b34 66 33 ROR &33 ; group_offset_low &0b36 4a LSR A &0b37 66 33 ROR &33 ; group_offset_low &0b39 18 CLC &0b3a 65 30 ADC &30 ; group_offset_high &0b3c 85 30 STA &30 ; group_offset_high &0b3e a5 31 LDA &31 ; last_group_address_low &0b40 38 SEC &0b41 e5 33 SBC &33 ; group_offset_low &0b43 99 00 09 STA &0900,Y ; row_addresses_low_table &0b46 a5 32 LDA &32 ; last_group_address_high &0b48 e5 30 SBC &30 ; group_offset_high &0b4a 99 00 0a STA &0a00,Y ; row_addresses_high_table &0b4d c8 INY &0b4e d0 c6 BNE &0b16 ; populate_row_addresses_tables_loop &0b50 68 PLA ; picture &0b51 aa TAX &0b52 4c 00 3c JMP &3c00 ; initialise_mode_5_screen ; handle_save &0b55 ba TSX &0b56 86 2f STX &2f ; stack_pointer_before_save &0b58 a9 00 LDA #&00 &0b5a a2 11 LDX #&11 ; initialise_file_block_loop &0b5c 9d ee 70 STA &70ee,X ; file_block &0b5f ca DEX &0b60 10 fa BPL &0b5c ; initialise_file_block_loop &0b62 a9 90 LDA #&90 &0b64 8d fc 70 STA &70fc ; file_block + 14 (end address low) &0b67 a2 fd LDX #&fd ; &0bfd = zp_filename &0b69 20 97 0b JSR &0b97 ; save_file # Save &0000 - &008f to zp &0b6c ba TSX &0b6d e8 INX &0b6e 8e f8 70 STX &70f8 ; file_block + 10 (start address low) &0b71 a2 00 LDX #&00 &0b73 8e fc 70 STX &70fc ; file_block + 14 (end address low) &0b76 e8 INX ; 1 &0b77 8e f9 70 STX &70f9 ; file_block + 11 (start address high) &0b7a e8 INX ; 2 &0b7b 8e fd 70 STX &70fd ; file_block + 15 (end address high) &0b7e a2 f9 LDX #&f9 ; &0bf9 = stk_filename &0b80 20 97 0b JSR &0b97 ; save_file # Save (stack pointer + 1) - &01ff to stk &0b83 a9 1f LDA #&1f &0b85 8d f9 70 STA &70f9 ; file_block + 11 (start address high) &0b88 a9 43 LDA #&43 &0b8a 8d fd 70 STA &70fd ; file_block + 15 (end address high) &0b8d a9 00 LDA #&00 &0b8f 8d f8 70 STA &70f8 ; file_block + 10 (start address low) &0b92 8d fc 70 STA &70fc ; file_block + 14 (end address low) &0b95 a2 f5 LDX #&f5 ; &0bf5 = dat_filename ; save_file # Save &1f00 - &42ff to dat &0b97 ad f8 70 LDA &70f8 ; file_block + 10 (start address low) &0b9a 8d f0 70 STA &70f0 ; file_block + 2 (load address low) &0b9d ad f9 70 LDA &70f9 ; file_block + 11 (start address high) &0ba0 8d f1 70 STA &70f1 ; file_block + 3 (load address high) &0ba3 a9 00 LDA #&00 ; save file ; call_osfile &0ba5 8e ee 70 STX &70ee ; file_block + 0 (filename address low) &0ba8 a2 0b LDX #&0b &0baa 8e ef 70 STX &70ef ; file_block + 1 (filename address high) &0bad a2 ee LDX #&ee ; &70ee = file_block &0baf a0 70 LDY #&70 &0bb1 4c dd ff JMP &ffdd ; OSFILE ; handle_load &0bb4 a2 fd LDX #&fd ; &0bfd = zp_filename &0bb6 20 c3 0b JSR &0bc3 ; load_file # Load zp &0bb9 a6 2f LDX &2f ; stack_pointer_before_save &0bbb 9a TXS &0bbc a2 f9 LDX #&f9 ; &0bf9 = stk_filename &0bbe 20 c3 0b JSR &0bc3 ; load_file # Load stk &0bc1 a2 f5 LDX #&f5 ; &0bf5 = dat_filename ; load_file # Load dat &0bc3 a9 ff LDA #&ff ; load file &0bc5 8d f4 70 STA &70f4 ; file_block + 6 (execution address low) # Load to address specified by file &0bc8 d0 db BNE &0ba5 ; call_osfile # Always branches ; handle_star_command &0bca 20 a0 23 JSR &23a0 ; get_byte_of_input # Doesn't return if end of input &0bcd 20 8d 23 JSR &238d ; check_if_letter # Returns carry set if character is letter &0bd0 90 09 BCC &0bdb ; to_prompt_for_input &0bd2 29 df AND #&df # Convert to uppercase &0bd4 c9 53 CMP #&53 ; "S" &0bd6 d0 06 BNE &0bde ; not_save &0bd8 20 55 0b JSR &0b55 ; handle_save ; to_prompt_for_input &0bdb 4c 9f 22 JMP &229f ; prompt_for_input ; not_save &0bde c9 4c CMP #&4c ; "L" &0be0 d0 03 BNE &0be5 ; not_load &0be2 20 b4 0b JSR &0bb4 ; handle_load ; not_load &0be5 c9 54 CMP #&54 ; "T" &0be7 d0 f2 BNE &0bdb ; to_prompt_for_input &0be9 20 6d 35 JSR &356d ; handle_text &0bec 4c db 0b JMP &0bdb ; to_prompt_for_input ; unused &0bef 10 10 10 10 10 10 ; dat_filename &0bf5 64 61 74 0d ; "dat" ; stk_filename &0bf9 73 74 6b 0d ; "stk" ; zp_filename &0bfd 7a 70 0d ; "zp" ; unused &5f00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5f10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5f20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5f30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5f40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5f50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5f60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5f70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5f80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5f90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5fb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5fd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5fe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &5ff0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; instructions_text &6000 83 57 65 6c 63 6f 6d 65 20 74 6f 20 22 54 77 69 ; "Welcome to "Twin Kingdom Valley"" &6010 6e 20 4b 69 6e 67 64 6f 6d 20 56 61 6c 6c 65 79 &6020 22 0d &6022 81 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f ; "________________________________" &6032 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f &6042 5f 0d &6044 20 20 20 41 73 20 79 6f 75 20 6d 61 79 20 68 61 ; " As you may have already guessed," &6054 76 65 20 61 6c 72 65 61 64 79 20 67 75 65 73 73 &6064 65 64 2c 0d &6068 74 68 69 73 20 69 73 20 6e 6f 74 20 6f 6e 6c 79 ; "this is not only the name of this game," &6078 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 69 &6088 73 20 67 61 6d 65 2c 0d &6090 62 75 74 20 61 6c 73 6f 20 6f 66 20 61 20 6d 79 ; "but also of a mythical place in which" &60a0 74 68 69 63 61 6c 20 70 6c 61 63 65 20 69 6e 20 &60b0 77 68 69 63 68 0d &60b6 74 77 6f 20 6b 69 6e 67 73 20 72 65 73 69 64 65 ; "two kings reside. Naturally they hate" &60c6 2e 20 4e 61 74 75 72 61 6c 6c 79 20 74 68 65 79 &60d6 20 68 61 74 65 0d &60dc 65 61 63 68 20 6f 74 68 65 72 21 0d ; "each other!" &60e8 20 20 20 54 68 69 73 20 67 61 6d 65 20 69 73 20 ; " This game is a simulation of the" &60f8 61 20 73 69 6d 75 6c 61 74 69 6f 6e 20 6f 66 20 &6108 74 68 65 0d &610c 6c 69 66 65 20 69 6e 20 74 68 61 74 20 76 61 6c ; "life in that valley. Whilst you play," &611c 6c 65 79 2e 20 57 68 69 6c 73 74 20 79 6f 75 20 &612c 70 6c 61 79 2c 0d &6132 6f 74 68 65 72 20 63 72 65 61 74 75 72 65 73 20 ; "other creatures will live their natural" &6142 77 69 6c 6c 20 6c 69 76 65 20 74 68 65 69 72 20 &6152 6e 61 74 75 72 61 6c 0d &615a 6c 69 76 65 73 20 69 6e 20 74 68 65 20 76 61 6c ; "lives in the valley. You start the game" &616a 6c 65 79 2e 20 59 6f 75 20 73 74 61 72 74 20 74 &617a 68 65 20 67 61 6d 65 0d &6182 73 6f 6d 65 77 68 65 72 65 20 69 6e 20 74 68 65 ; "somewhere in the valley." &6192 20 76 61 6c 6c 65 79 2e 0d &619b 20 20 20 49 74 20 69 73 20 61 73 73 75 6d 65 64 ; " It is assumed that you are a typical" &61ab 20 74 68 61 74 20 79 6f 75 20 61 72 65 20 61 20 &61bb 74 79 70 69 63 61 6c 0d &61c3 61 64 76 65 6e 74 75 72 6f 75 73 2c 20 62 6f 75 ; "adventurous, bounty hunting, greedy" &61d3 6e 74 79 20 68 75 6e 74 69 6e 67 2c 20 67 72 65 &61e3 65 64 79 0d &61e7 68 75 6d 61 6e 2c 20 61 6e 64 20 74 68 61 74 20 ; "human, and that your main objective is" &61f7 79 6f 75 72 20 6d 61 69 6e 20 6f 62 6a 65 63 74 &6207 69 76 65 20 69 73 0d &620e 74 6f 20 66 69 6e 69 73 68 20 74 68 65 20 67 61 ; "to finish the game with as much wealth" &621e 6d 65 20 77 69 74 68 20 61 73 20 6d 75 63 68 20 &622e 77 65 61 6c 74 68 0d &6235 61 73 20 70 6f 73 73 69 62 6c 65 2e 0d ; "as possible." &6242 20 20 20 4f 6e 20 79 6f 75 72 20 6a 6f 75 72 6e ; " On your journey here you will have" &6252 65 79 20 68 65 72 65 20 79 6f 75 20 77 69 6c 6c &6262 20 68 61 76 65 0d &6268 68 65 61 72 64 20 61 20 6c 6f 74 20 6f 66 20 67 ; "heard a lot of gossip about the region" &6278 6f 73 73 69 70 20 61 62 6f 75 74 20 74 68 65 20 &6288 72 65 67 69 6f 6e 0d &628f 61 6e 64 20 69 74 73 20 67 65 6f 67 72 61 70 68 ; "and its geography. Here is a summary of" &629f 79 2e 20 48 65 72 65 20 69 73 20 61 20 73 75 6d &62af 6d 61 72 79 20 6f 66 0d &62b7 74 68 61 74 20 22 67 6f 73 73 69 70 22 2e 0d ; "that "gossip"." &62c6 8d 86 50 72 65 73 73 20 74 68 65 20 73 70 61 63 ; "Press the space bar for the next page" &62d6 65 20 62 61 72 20 66 6f 72 20 74 68 65 20 6e 65 &62e6 78 74 20 70 61 67 65 0d &62ee 8d 86 50 72 65 73 73 20 74 68 65 20 73 70 61 63 ; "Press the space bar for the next page" &62fe 65 20 62 61 72 20 66 6f 72 20 74 68 65 20 6e 65 &630e 78 74 20 70 61 67 65 0d &6316 8d 84 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f ; "_____________________________________" &6326 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f &6336 5f 5f 5f 5f 5f 5f 5f 0d &633e 20 0d ; " " &6340 20 20 20 54 77 69 6e 20 4b 69 6e 67 64 6f 6d 20 ; " Twin Kingdom Valley is one of many" &6350 56 61 6c 6c 65 79 20 69 73 20 6f 6e 65 20 6f 66 &6360 20 6d 61 6e 79 0d &6366 76 61 6c 6c 65 79 73 20 73 75 72 72 6f 75 6e 64 ; "valleys surrounding the vast lake of" &6376 69 6e 67 20 74 68 65 20 76 61 73 74 20 6c 61 6b &6386 65 20 6f 66 0d &638b 57 61 74 65 72 73 6d 65 65 74 20 28 73 6f 20 6e ; "Watersmeet (so named because it is the" &639b 61 6d 65 64 20 62 65 63 61 75 73 65 20 69 74 20 &63ab 69 73 20 74 68 65 0d &63b2 6d 65 65 74 69 6e 67 20 70 6f 69 6e 74 20 6f 66 ; "meeting point of the many rivers and" &63c2 20 74 68 65 20 6d 61 6e 79 20 72 69 76 65 72 73 &63d2 20 61 6e 64 0d &63d7 73 74 72 65 61 6d 73 20 77 68 69 63 68 20 66 6c ; "streams which flow from the mountains" &63e7 6f 77 20 66 72 6f 6d 20 74 68 65 20 6d 6f 75 6e &63f7 74 61 69 6e 73 0d &63fd 61 6e 64 20 76 61 6c 6c 65 79 73 20 73 75 72 72 ; "and valleys surrounding it)." &640d 6f 75 6e 64 69 6e 67 20 69 74 29 2e 0d &641a 20 20 20 49 74 20 69 73 20 62 65 6c 69 65 76 65 ; " It is believed that the lake itself" &642a 64 20 74 68 61 74 20 74 68 65 20 6c 61 6b 65 20 &643a 69 74 73 65 6c 66 0d &6441 68 61 73 20 73 6f 6d 65 20 6d 79 73 74 69 63 61 ; "has some mystical properties which," &6451 6c 20 70 72 6f 70 65 72 74 69 65 73 20 77 68 69 &6461 63 68 2c 0d &6465 73 6f 6d 65 20 73 61 79 2c 20 61 72 65 20 64 65 ; "some say, are derived from the many" &6475 72 69 76 65 64 20 66 72 6f 6d 20 74 68 65 20 6d &6485 61 6e 79 0d &6489 70 6f 74 69 6f 6e 73 20 6f 66 20 77 69 74 63 68 ; "potions of witches and so forth, which" &6499 65 73 20 61 6e 64 20 73 6f 20 66 6f 72 74 68 2c &64a9 20 77 68 69 63 68 0d &64b0 68 61 76 65 20 62 65 65 6e 20 73 70 69 6c 74 20 ; "have been spilt into the rivers and" &64c0 69 6e 74 6f 20 74 68 65 20 72 69 76 65 72 73 20 &64d0 61 6e 64 0d &64d4 73 74 72 65 61 6d 73 20 74 68 72 6f 75 67 68 6f ; "streams throughout the ages." &64e4 75 74 20 74 68 65 20 61 67 65 73 2e 0d &64f1 20 20 20 49 74 20 69 73 20 61 6c 73 6f 20 73 61 ; " It is also said that a wise man may" &6501 69 64 20 74 68 61 74 20 61 20 77 69 73 65 20 6d &6511 61 6e 20 6d 61 79 0d &6518 6c 6f 6f 6b 20 75 70 6f 6e 20 74 68 65 20 73 65 ; "look upon the secret of life, which" &6528 63 72 65 74 20 6f 66 20 6c 69 66 65 2c 20 77 68 &6538 69 63 68 0d &653c 6c 69 65 73 20 6e 65 61 72 62 79 2e 0d ; "lies nearby." &6549 20 20 20 41 6c 6c 20 74 68 69 73 20 6f 66 20 63 ; " All this of course is simply gossip;" &6559 6f 75 72 73 65 20 69 73 20 73 69 6d 70 6c 79 20 &6569 67 6f 73 73 69 70 3b 0d &6571 62 65 6c 69 65 76 65 20 69 74 20 69 66 20 79 6f ; "believe it if you will." &6581 75 20 77 69 6c 6c 2e 0d &6589 20 20 20 59 6f 75 20 68 61 76 65 20 72 65 6e 74 ; " You have rented a small hut, from" &6599 65 64 20 61 20 73 6d 61 6c 6c 20 68 75 74 2c 20 &65a9 66 72 6f 6d 0d &65ae 74 68 65 20 69 6e 6e 6b 65 65 70 65 72 20 6f 66 ; "the innkeeper of "The Sword Inn", where" &65be 20 22 54 68 65 20 53 77 6f 72 64 20 49 6e 6e 22 &65ce 2c 20 77 68 65 72 65 0d &65d6 79 6f 75 72 20 69 6c 6c 20 67 6f 74 74 65 6e 20 ; "your ill gotten gains may be safely" &65e6 67 61 69 6e 73 20 6d 61 79 20 62 65 20 73 61 66 &65f6 65 6c 79 0d &65fa 73 74 61 73 68 65 64 2e 0d ; "stashed." &6603 8d 86 50 72 65 73 73 20 74 68 65 20 73 70 61 63 ; "Press the space bar for the next page" &6613 65 20 62 61 72 20 66 6f 72 20 74 68 65 20 6e 65 &6623 78 74 20 70 61 67 65 0d &662b 8d 86 50 72 65 73 73 20 74 68 65 20 73 70 61 63 ; "Press the space bar for the next page" &663b 65 20 62 61 72 20 66 6f 72 20 74 68 65 20 6e 65 &664b 78 74 20 70 61 67 65 0d &6653 8d 84 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f ; "_____________________________________" &6663 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f &6673 5f 5f 5f 5f 5f 5f 5f 0d &667b 20 0d ; " " &667d 8d 82 20 20 20 20 20 20 20 20 50 6c 61 79 69 6e ; " Playing The Game" &668d 67 20 54 68 65 20 47 61 6d 65 0d &6698 8d 82 20 20 20 20 20 20 20 20 50 6c 61 79 69 6e ; " Playing The Game" &66a8 67 20 54 68 65 20 47 61 6d 65 0d &66b3 20 20 20 20 20 20 20 20 20 82 5f 5f 5f 5f 5f 5f ; " ________________" &66c3 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 0d &66ce 20 20 20 49 20 63 61 6e 6e 6f 74 2c 20 6f 66 20 ; " I cannot, of course, place you" &66de 63 6f 75 72 73 65 2c 20 70 6c 61 63 65 20 79 6f &66ee 75 0d &66f0 62 6f 64 69 6c 79 20 69 6e 20 74 68 69 73 20 76 ; "bodily in this valley. Instead "YOU"" &6700 61 6c 6c 65 79 2e 20 49 6e 73 74 65 61 64 20 22 &6710 59 4f 55 22 0d &6715 61 72 65 20 72 65 70 72 65 73 65 6e 74 65 64 20 ; "are represented inside the computer." &6725 69 6e 73 69 64 65 20 74 68 65 20 63 6f 6d 70 75 &6735 74 65 72 2e 0d &673a 20 20 20 59 6f 75 20 61 72 65 20 61 6c 6c 6f 63 ; " You are allocated, for instance, a" &674a 61 74 65 64 2c 20 66 6f 72 20 69 6e 73 74 61 6e &675a 63 65 2c 20 61 0d &6760 63 65 72 74 61 69 6e 20 73 74 72 65 6e 67 74 68 ; "certain strength which will go down if" &6770 20 77 68 69 63 68 20 77 69 6c 6c 20 67 6f 20 64 &6780 6f 77 6e 20 69 66 0d &6787 79 6f 75 20 61 72 65 20 73 74 61 62 62 65 64 2c ; "you are stabbed, belted etc. by" &6797 20 62 65 6c 74 65 64 20 65 74 63 2e 20 62 79 0d &67a7 75 6e 66 72 69 65 6e 64 6c 79 20 63 72 65 61 74 ; "unfriendly creatures, rather like in" &67b7 75 72 65 73 2c 20 72 61 74 68 65 72 20 6c 69 6b &67c7 65 20 69 6e 0d &67cc 72 65 61 6c 20 6c 69 66 65 2e 0d ; "real life." &67d7 20 20 20 55 6e 64 65 72 20 6e 6f 72 6d 61 6c 20 ; " Under normal circumstances you will" &67e7 63 69 72 63 75 6d 73 74 61 6e 63 65 73 20 79 6f &67f7 75 20 77 69 6c 6c 0d &67fe 67 72 61 64 75 61 6c 6c 79 20 72 65 63 6f 76 65 ; "gradually recover from any hurt, but" &680e 72 20 66 72 6f 6d 20 61 6e 79 20 68 75 72 74 2c &681e 20 62 75 74 0d &6823 6c 69 6b 65 20 65 76 65 72 79 74 68 69 6e 67 20 ; "like everything in this life, there are" &6833 69 6e 20 74 68 69 73 20 6c 69 66 65 2c 20 74 68 &6843 65 72 65 20 61 72 65 0d &684b 65 78 63 65 70 74 69 6f 6e 73 20 74 6f 20 74 68 ; "exceptions to the rule." &685b 65 20 72 75 6c 65 2e 0d &6863 20 20 20 41 6c 74 68 6f 75 67 68 20 74 68 65 20 ; " Although the machine becomes your" &6873 6d 61 63 68 69 6e 65 20 62 65 63 6f 6d 65 73 20 &6883 79 6f 75 72 0d &6888 70 68 79 73 69 63 61 6c 20 62 6f 64 79 2c 20 79 ; "physical body, you are of course still" &6898 6f 75 20 61 72 65 20 6f 66 20 63 6f 75 72 73 65 &68a8 20 73 74 69 6c 6c 0d &68af 6c 65 66 74 20 77 69 74 68 20 79 6f 75 72 20 6f ; "left with your own mind! It will be" &68bf 77 6e 20 6d 69 6e 64 21 20 49 74 20 77 69 6c 6c &68cf 20 62 65 0d &68d3 79 6f 75 72 20 64 65 63 69 73 69 6f 6e 73 20 77 ; "your decisions which determine your" &68e3 68 69 63 68 20 64 65 74 65 72 6d 69 6e 65 20 79 &68f3 6f 75 72 0d &68f7 66 61 74 65 2e 0d ; "fate." &68fd 20 0d ; " " &68ff 8d 86 50 72 65 73 73 20 74 68 65 20 73 70 61 63 ; "Press the space bar for the next page" &690f 65 20 62 61 72 20 66 6f 72 20 74 68 65 20 6e 65 &691f 78 74 20 70 61 67 65 0d &6927 8d 86 50 72 65 73 73 20 74 68 65 20 73 70 61 63 ; "Press the space bar for the next page" &6937 65 20 62 61 72 20 66 6f 72 20 74 68 65 20 6e 65 &6947 78 74 20 70 61 67 65 0d &694f 8d 84 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f ; "_____________________________________" &695f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f &696f 5f 5f 5f 5f 5f 5f 5f 0d &6977 20 0d ; " " &6979 20 20 20 54 6f 20 70 6c 61 79 20 74 68 65 20 67 ; " To play the game you must therefore" &6989 61 6d 65 20 79 6f 75 20 6d 75 73 74 20 74 68 65 &6999 72 65 66 6f 72 65 0d &69a0 74 79 70 65 20 69 6e 73 74 72 75 63 74 69 6f 6e ; "type instructions into the machine, and" &69b0 73 20 69 6e 74 6f 20 74 68 65 20 6d 61 63 68 69 &69c0 6e 65 2c 20 61 6e 64 0d &69c8 61 66 74 65 72 20 6f 62 65 79 69 6e 67 20 79 6f ; "after obeying you (if possible) the" &69d8 75 20 28 69 66 20 70 6f 73 73 69 62 6c 65 29 20 &69e8 74 68 65 0d &69ec 6d 61 63 68 69 6e 65 20 77 69 6c 6c 20 70 72 6f ; "machine will prompt you for another" &69fc 6d 70 74 20 79 6f 75 20 66 6f 72 20 61 6e 6f 74 &6a0c 68 65 72 0d &6a10 69 6e 73 74 72 75 63 74 69 6f 6e 20 77 69 74 68 ; "instruction with a question mark." &6a20 20 61 20 71 75 65 73 74 69 6f 6e 20 6d 61 72 6b &6a30 2e 0d &6a32 20 20 20 59 6f 75 20 6d 61 79 2c 20 66 6f 72 20 ; " You may, for instance, choose to" &6a42 69 6e 73 74 61 6e 63 65 2c 20 63 68 6f 6f 73 65 &6a52 20 74 6f 0d &6a56 6d 6f 76 65 20 6e 6f 72 74 68 2c 20 73 6f 20 6a ; "move north, so just type" &6a66 75 73 74 20 74 79 70 65 0d &6a6f 83 4d 4f 56 45 20 4e 4f 52 54 48 20 3c 52 45 54 ; "MOVE NORTH " &6a7f 55 52 4e 20 4b 45 59 3e 0d &6a88 20 20 20 4d 6f 73 74 20 77 6f 72 64 73 20 6d 61 ; " Most words may be abbrieviated, eg." &6a98 79 20 62 65 20 61 62 62 72 69 65 76 69 61 74 65 &6aa8 64 2c 20 65 67 2e 0d &6aaf 74 68 65 20 61 62 6f 76 65 20 6d 61 79 20 62 65 ; "the above may be entered as" &6abf 20 65 6e 74 65 72 65 64 20 61 73 0d &6acb 83 4e 20 3c 52 45 54 55 52 4e 20 4b 45 59 3e 0d ; "N " &6adb 77 69 74 68 20 65 78 61 63 74 6c 79 20 74 68 65 ; "with exactly the same effect." &6aeb 20 73 61 6d 65 20 65 66 66 65 63 74 2e 0d &6af9 20 20 20 54 68 65 20 6d 61 63 68 69 6e 65 20 68 ; " The machine has its limitations," &6b09 61 73 20 69 74 73 20 6c 69 6d 69 74 61 74 69 6f &6b19 6e 73 2c 0d &6b1d 61 6e 64 20 63 61 6e 6e 6f 74 20 75 6e 64 65 72 ; "and cannot understand everything, eg." &6b2d 73 74 61 6e 64 20 65 76 65 72 79 74 68 69 6e 67 &6b3d 2c 20 65 67 2e 0d &6b43 83 49 53 20 54 48 45 52 45 20 41 20 47 4f 4f 44 ; "IS THERE A GOOD GOLF COURSE NEARBY" &6b53 20 47 4f 4c 46 20 43 4f 55 52 53 45 20 4e 45 41 &6b63 52 42 59 0d &6b67 77 69 6c 6c 20 6e 6f 74 20 6d 61 6b 65 20 61 6e ; "will not make any sense to the machine." &6b77 79 20 73 65 6e 73 65 20 74 6f 20 74 68 65 20 6d &6b87 61 63 68 69 6e 65 2e 0d &6b8f 50 6c 65 61 73 65 20 6b 65 65 70 20 79 6f 75 72 ; "Please keep your instructions short and" &6b9f 20 69 6e 73 74 72 75 63 74 69 6f 6e 73 20 73 68 &6baf 6f 72 74 20 61 6e 64 0d &6bb7 73 69 6d 70 6c 65 2e 20 45 67 2e 0d ; "simple. Eg." &6bc3 83 54 41 4b 45 20 54 48 45 20 4b 45 59 0d ; "TAKE THE KEY" &6bd1 54 79 70 69 6e 67 20 22 49 4e 56 45 4e 54 4f 52 ; "Typing "INVENTORY" will list the items" &6be1 59 22 20 77 69 6c 6c 20 6c 69 73 74 20 74 68 65 &6bf1 20 69 74 65 6d 73 0d &6bf8 69 6e 20 79 6f 75 72 20 70 6f 73 73 65 73 69 6f ; "in your possesion. "HELP" will list the" &6c08 6e 2e 20 22 48 45 4c 50 22 20 77 69 6c 6c 20 6c &6c18 69 73 74 20 74 68 65 0d &6c20 76 65 72 62 73 20 77 68 69 63 68 20 74 68 65 20 ; "verbs which the machine understands." &6c30 6d 61 63 68 69 6e 65 20 75 6e 64 65 72 73 74 61 &6c40 6e 64 73 2e 0d &6c45 8d 86 50 72 65 73 73 20 74 68 65 20 73 70 61 63 ; "Press the space bar for the next page" &6c55 65 20 62 61 72 20 66 6f 72 20 74 68 65 20 6e 65 &6c65 78 74 20 70 61 67 65 0d &6c6d 8d 86 50 72 65 73 73 20 74 68 65 20 73 70 61 63 ; "Press the space bar for the next page" &6c7d 65 20 62 61 72 20 66 6f 72 20 74 68 65 20 6e 65 &6c8d 78 74 20 70 61 67 65 0d &6c95 8d 84 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f ; "_____________________________________" &6ca5 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f &6cb5 5f 5f 5f 5f 5f 5f 5f 0d &6cbd 20 20 20 54 68 65 20 6d 61 63 68 69 6e 65 20 61 ; " The machine also has many pictures" &6ccd 6c 73 6f 20 68 61 73 20 6d 61 6e 79 20 70 69 63 &6cdd 74 75 72 65 73 0d &6ce3 6f 66 20 74 68 65 20 70 6c 61 63 65 73 20 69 6e ; "of the places in the valley. Some of" &6cf3 20 74 68 65 20 76 61 6c 6c 65 79 2e 20 53 6f 6d &6d03 65 20 6f 66 0d &6d08 74 68 65 73 65 20 68 6f 6c 64 20 75 73 65 66 75 ; "these hold useful clues." &6d18 6c 20 63 6c 75 65 73 2e 0d &6d21 20 20 20 54 68 65 20 67 61 6d 65 20 73 74 61 72 ; " The game starts off by offering you" &6d31 74 73 20 6f 66 66 20 62 79 20 6f 66 66 65 72 69 &6d41 6e 67 20 79 6f 75 0d &6d48 61 20 63 68 6f 69 63 65 20 6f 66 20 36 20 6f 70 ; "a choice of 6 options which control" &6d58 74 69 6f 6e 73 20 77 68 69 63 68 20 63 6f 6e 74 &6d68 72 6f 6c 0d &6d6c 77 68 65 6e 20 79 6f 75 20 73 65 65 20 70 69 63 ; "when you see pictures and how much" &6d7c 74 75 72 65 73 20 61 6e 64 20 68 6f 77 20 6d 75 &6d8c 63 68 0d &6d8f 64 65 73 63 72 69 70 74 69 6f 6e 20 79 6f 75 20 ; "description you get of the places you" &6d9f 67 65 74 20 6f 66 20 74 68 65 20 70 6c 61 63 65 &6daf 73 20 79 6f 75 0d &6db5 76 69 73 69 74 2e 20 4f 6e 20 79 6f 75 72 20 66 ; "visit. On your first game I recommend" &6dc5 69 72 73 74 20 67 61 6d 65 20 49 20 72 65 63 6f &6dd5 6d 6d 65 6e 64 0d &6ddb 6f 70 74 69 6f 6e 20 31 2c 20 77 68 69 63 68 20 ; "option 1, which is selected simply by" &6deb 69 73 20 73 65 6c 65 63 74 65 64 20 73 69 6d 70 &6dfb 6c 79 20 62 79 0d &6e01 70 72 65 73 73 69 6e 67 20 31 2e 20 59 6f 75 20 ; "pressing 1. You may alter the setting" &6e11 6d 61 79 20 61 6c 74 65 72 20 74 68 65 20 73 65 &6e21 74 74 69 6e 67 0d &6e27 62 79 20 74 79 70 69 6e 67 0d ; "by typing" &6e31 83 4f 50 54 49 4f 4e 20 3c 52 45 54 55 52 4e 20 ; "OPTION " &6e41 4b 45 59 3e 0d &6e46 61 74 20 61 6e 79 20 70 6f 69 6e 74 20 69 6e 20 ; "at any point in the game. Option 1 will" &6e56 74 68 65 20 67 61 6d 65 2e 20 4f 70 74 69 6f 6e &6e66 20 31 20 77 69 6c 6c 0d &6e6e 64 72 61 77 20 70 69 63 74 75 72 65 73 20 6f 66 ; "draw pictures of places which you have" &6e7e 20 70 6c 61 63 65 73 20 77 68 69 63 68 20 79 6f &6e8e 75 20 68 61 76 65 0d &6e95 6e 6f 74 20 62 65 65 6e 20 74 6f 20 62 65 66 6f ; "not been to before, as you arrive." &6ea5 72 65 2c 20 61 73 20 79 6f 75 20 61 72 72 69 76 &6eb5 65 2e 0d &6eb8 20 20 20 50 72 65 73 73 20 22 44 45 4c 45 54 45 ; " Press "DELETE" to erase any picture." &6ec8 22 20 74 6f 20 65 72 61 73 65 20 61 6e 79 20 70 &6ed8 69 63 74 75 72 65 2e 0d &6ee0 41 66 74 65 72 20 73 6f 6d 65 20 70 69 63 74 75 ; "After some pictures you are told which" &6ef0 72 65 73 20 79 6f 75 20 61 72 65 20 74 6f 6c 64 &6f00 20 77 68 69 63 68 0d &6f07 77 61 79 20 79 6f 75 20 6d 75 73 74 20 66 61 63 ; "way you must face to see the picture." &6f17 65 20 74 6f 20 73 65 65 20 74 68 65 20 70 69 63 &6f27 74 75 72 65 2e 0d &6f2d 54 68 69 73 20 77 69 6c 6c 20 6f 66 74 65 6e 20 ; "This will often help you draw a map of" &6f3d 68 65 6c 70 20 79 6f 75 20 64 72 61 77 20 61 20 &6f4d 6d 61 70 20 6f 66 0d &6f54 74 68 65 20 76 61 6c 6c 65 79 20 28 77 69 74 68 ; "the valley (without which you might" &6f64 6f 75 74 20 77 68 69 63 68 20 79 6f 75 20 6d 69 &6f74 67 68 74 0d &6f78 65 61 73 69 6c 79 20 67 65 74 20 6c 6f 73 74 29 ; "easily get lost)." &6f88 2e 0d &6f8a 20 20 20 20 20 20 20 20 20 20 20 20 20 85 48 61 ; " Happy wandering" &6f9a 70 70 79 20 77 61 6e 64 65 72 69 6e 67 0d &6fa8 8d 81 50 72 65 73 73 20 74 68 65 20 73 70 61 63 ; "Press the space bar to start the game" &6fb8 65 20 62 61 72 20 74 6f 20 73 74 61 72 74 20 74 &6fc8 68 65 20 67 61 6d 65 0d &6fd0 8d 81 50 72 65 73 73 20 74 68 65 20 73 70 61 63 ; "Press the space bar to start the game" &6fe0 65 20 62 61 72 20 74 6f 20 73 74 61 72 74 20 74 &6ff0 68 65 20 67 61 6d 65 0d &6ff8 8d 81 9d 0d ; unused &6ffc 00 00 00 00 # &7000 - &77ff is moved to &0c00 - &13ff at &7a57 ; update_turn # Called with A positive if starting turn, &0c00 85 15 STA &15 ; allow_actions # negative if ending turn &0c02 10 03 BPL &0c07 ; start_turn &0c04 4c ae 0c JMP &0cae ; end_turn ; start_turn &0c07 20 eb 3b JSR &3beb ; write_nine_spaces &0c0a a9 85 LDA #&85 ; TELETEXT_MAGENTA &0c0c 20 ee ff JSR &ffee ; OSWRCH &0c0f a2 14 LDX #&14 &0c11 a9 5f LDA #&5f ; "_" &0c13 20 ef 3b JSR &3bef ; write_X_copies_of_character_A # Write turn separator &0c16 20 51 3b JSR &3b51 ; write_newline &0c19 20 a0 42 JSR &42a0 ; update_world &0c1c a2 25 LDX #&25 ; clear_character_moved_flags_loop &0c1e bd d0 2a LDA &2ad0,X ; characters_flags &0c21 29 80 AND #&80 ; CHARACTER_FLAG_WAS_ATTACKED # Clear CHARACTER_FLAG_MOVED_AND_WAS_ATTACKED and CHARACTER_FLAG_MOVED_BUT_NOT_ATTACKED &0c23 9d d0 2a STA &2ad0,X ; characters_flags &0c26 ca DEX &0c27 10 f5 BPL &0c1e ; clear_character_moved_flags_loop &0c29 ae fe 27 LDX &27fe ; number_of_characters &0c2c ca DEX ; rehearse_update_characters_loop &0c2d 20 de 0c JSR &0cde ; update_character_if_not_dead # Unclear; no actions performed &0c30 ca DEX &0c31 d0 fa BNE &0c2d ; rehearse_update_characters_loop ; list_characters_in_room &0c33 ae fe 27 LDX &27fe ; number_of_characters &0c36 ca DEX ; list_characters_in_room_loop &0c37 2c d0 2a BIT &2ad0 ; characters_flags + 0 (CHARACTER_PLAYER) &0c3a 70 39 BVS &0c75 ; skip_listing_character # Branch if CHARACTER_FLAG_MOVED_AND_WAS_ATTACKED set &0c3c bd b4 29 LDA &29b4,X ; characters_location &0c3f c5 89 CMP &89 ; player_room &0c41 d0 32 BNE &0c75 ; skip_listing_character &0c43 86 10 STX &10 ; character_to_list &0c45 a5 8a LDA &8a ; room_picture_availability &0c47 48 PHA ; room_picture_availability &0c48 20 bd 20 JSR &20bd ; check_if_room_is_lit # Returns positive if room is lit &0c4b 30 23 BMI &0c70 ; skip_listing_character &0c4d 8a TXA ; character &0c4e 18 CLC &0c4f 69 c8 ADC #&c8 ; ROOM_CARRYING &0c51 aa TAX &0c52 86 11 STX &11 ; character_carrying &0c54 20 ea 1b JSR &1bea ; write_character_name &0c57 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &0c5a 3e 37 b3 00 ; "is here with" &0c5e a5 11 LDA &11 ; character_carrying &0c60 20 4c 16 JSR &164c ; list_objects_in_room_A &0c63 ad c0 25 LDA &25c0 ; objects_location + 0 (OBJECT_HOLDALL) &0c66 c5 11 CMP &11 ; character_carrying &0c68 d0 03 BNE &0c6d ; skip_listing_holdall &0c6a 20 3f 16 JSR &163f ; list_objects_in_holdall ; skip_listing_holdall &0c6d 20 9c 14 JSR &149c ; start_new_line ; skip_listing_character &0c70 68 PLA ; room_picture_availability &0c71 85 8a STA &8a ; room_picture_availability ; consider_next_character &0c73 a6 10 LDX &10 ; character_to_list &0c75 ca DEX &0c76 d0 bf BNE &0c37 ; list_characters_in_room_loop ; get_input &0c78 a9 00 LDA #&00 &0c7a 85 8c STA &8c ; description_based_direction # Set to zero to indicate no direction from description &0c7c 20 9f 22 JSR &229f ; prompt_for_input # Returns X = number of characters entered + 2 &0c7f e0 02 CPX #&02 &0c81 f0 f5 BEQ &0c78 ; get_input # Prompt again if no input &0c83 a5 83 LDA &83 ; input_verb # Negative if no verb found &0c85 10 07 BPL &0c8e ; have_verb &0c87 20 00 35 JSR &3500 ; check_for_description_based_direction # Sets input_verb to zero if direction found &0c8a a5 83 LDA &83 ; input_verb &0c8c d0 ea BNE &0c78 ; get_input # Keep prompting for input until verb given ; have_verb &0c8e c9 25 CMP #&25 ; "end" &0c90 90 06 BCC &0c98 ; update_characters ; is_system_verb # END, QUIT, LOOK, VIEW, PICTURE, DRAW, SCORE &0c92 20 a7 14 JSR &14a7 ; call_verb_handler # INVENTORY, OPTION and HELP don't take a turn &0c95 4c 78 0c JMP &0c78 ; get_input ; update_characters &0c98 ae fe 27 LDX &27fe ; number_of_characters &0c9b ca DEX &0c9c a9 80 LDA #&80 &0c9e 85 15 STA &15 ; allow_actions # Set to negative to allow actions ; update_characters_loop &0ca0 bd b4 29 LDA &29b4,X ; characters_location &0ca3 c5 14 CMP &14 ; player_room_at_start_of_turn &0ca5 f0 03 BEQ &0caa ; consider_next_character # Don't update characters in room until end of turn &0ca7 20 d9 0c JSR &0cd9 ; update_character_if_not_dead_and_player_not_moved_and_attacked ; consider_next_character &0caa ca DEX &0cab d0 f3 BNE &0ca0 ; update_characters_loop &0cad 60 RTS ; end_turn &0cae ae fe 27 LDX &27fe ; number_of_characters &0cb1 ca DEX ; update_characters_in_previous_room_loop &0cb2 bd b4 29 LDA &29b4,X ; characters_location &0cb5 c5 14 CMP &14 ; player_room_at_start_of_turn &0cb7 d0 03 BNE &0cbc ; consider_next_character # Update characters in room at end of turn &0cb9 20 d9 0c JSR &0cd9 ; update_character_if_not_dead_and_player_not_moved_and_attacked ; consider_next_character &0cbc ca DEX &0cbd d0 f3 BNE &0cb2 ; update_characters_in_previous_room_loop ; update_moved_characters &0cbf ae fe 27 LDX &27fe ; number_of_characters &0cc2 ca DEX ; update_moved_characters_loop &0cc3 bd 8e 29 LDA &298e,X ; characters_strength # Zero if character is dead &0cc6 f0 0d BEQ &0cd5 ; consider_next_character &0cc8 bd d0 2a LDA &2ad0,X ; characters_flags &0ccb 29 60 AND #&60 ; CHARACTER_FLAG_MOVED_AND_WAS_ATTACKED | CHARACTER_FLAG_MOVED_BUT_NOT_ATTACKED &0ccd f0 06 BEQ &0cd5 ; consider_next_character # Has the character moved? &0ccf bd d0 2b LDA &2bd0,X ; characters_new_location &0cd2 9d b4 29 STA &29b4,X ; characters_location # If so, update its location ; consider_next_character &0cd5 ca DEX &0cd6 d0 eb BNE &0cc3 ; update_moved_characters_loop &0cd8 60 RTS ; update_character_if_not_dead_and_player_not_moved_and_attacked &0cd9 2c d0 2a BIT &2ad0 ; characters_flags + 0 (CHARACTER_PLAYER) &0cdc 70 0f BVS &0ced ; leave # Branch if CHARACTER_FLAG_MOVED_AND_WAS_ATTACKED set ; update_character_if_not_dead &0cde bd 8e 29 LDA &298e,X ; characters_strength # Zero if character is dead &0ce1 f0 0a BEQ &0ced ; leave &0ce3 86 16 STX &16 ; character_to_update &0ce5 20 ee 0c JSR &0cee ; update_character &0ce8 20 9c 14 JSR &149c ; start_new_line &0ceb a6 16 LDX &16 ; character_to_update ; leave &0ced 60 RTS ; update_character &0cee bd b4 29 LDA &29b4,X ; characters_location &0cf1 85 1a STA &1a ; character_room &0cf3 bd d0 2a LDA &2ad0,X ; characters_flags &0cf6 85 13 STA &13 ; character_flags &0cf8 24 15 BIT &15 ; allow_actions # Negative if allowed &0cfa 10 05 BPL &0d01 ; skip_clearing_was_attacked &0cfc 29 7f AND #&7f ; !CHARACTER_FLAG_WAS_ATTACKED # Clear CHARACTER_FLAG_WAS_ATTACKED &0cfe 9d d0 2a STA &2ad0,X ; characters_flags ; skip_clearing_was_attacked &0d01 bd 68 29 LDA &2968,X ; characters_description # 8....... faction &0d04 85 1b STA &1b ; faction_mask &0d06 29 1f AND #&1f # ...18421 character description &0d08 a8 TAY &0d09 b9 80 28 LDA &2880,Y ; character_descriptions_permitted_regions_and_movement_probability &0d0c 85 18 STA &18 ; character_permitted_regions_and_movement_probability &0d0e b9 a0 28 LDA &28a0,Y ; character_descriptions_follows_player &0d11 85 19 STA &19 ; character_follows_player # Non-zero if character follows player &0d13 05 18 ORA &18 ; character_permitted_regions_and_movement_probability &0d15 d0 0b BNE &0d22 ; not_static ; is_static # If enemy is static, &0d17 20 8d 0d JSR &0d8d ; find_character_in_other_faction # Returns non-zero if character found &0d1a f0 03 BEQ &0d1f ; to_consider_character_picking_up_weapon # If no enemy in room, pick up weapons &0d1c 4c 5b 0e JMP &0e5b ; consider_character_using_weapon # If enemy in room, attack enemy ; to_consider_character_picking_up_weapon &0d1f 4c 99 0e JMP &0e99 ; consider_character_picking_up_weapon ; not_static # If enemy is not static, &0d22 20 8d 0d JSR &0d8d ; find_character_in_other_faction # Returns non-zero if character found &0d25 f0 47 BEQ &0d6e ; not_static_no_enemy ; not_static_has_enemy &0d27 a5 19 LDA &19 ; character_follows_player # Non-zero if character follows player &0d29 f0 0b BEQ &0d36 ; is_not_follower_has_enemy ; is_follower_has_enemy &0d2b 24 13 BIT &13 ; character_flags # Top bit set if CHARACTER_FLAG_WAS_ATTACKED &0d2d 10 26 BPL &0d55 ; is_follower_but_was_not_attacked ; is_follower_has_enemy_and_was_attacked # If attacked, don't attack &0d2f 20 3d 0d JSR &0d3d ; follow_player_or_move_randomly &0d32 a5 10 LDA &10 ; character_acted &0d34 d0 1e BNE &0d54 ; leave ; is_not_follower_has_enemy &0d36 20 5b 0e JSR &0e5b ; consider_character_using_weapon # Try to attack enemy &0d39 a5 10 LDA &10 ; character_acted # Non-zero if attack succeeded &0d3b f0 7c BEQ &0db9 ; move_character_through_random_exit # Otherwise, try to move randomly ; follow_player_or_move_randomly &0d3d a9 ff LDA #&ff &0d3f 85 10 STA &10 ; character_acted &0d41 a5 1a LDA &1a ; character_room &0d43 c5 1c CMP &1c ; player_previous_room # If the character was in previous room as player, &0d45 f0 1e BEQ &0d65 ; consider_following_player_if_player_is_moving &0d47 c5 14 CMP &14 ; player_room_at_start_of_turn &0d49 d0 2e BNE &0d79 ; consider_moving_character_with_random_probability &0d4b a5 89 LDA &89 ; player_room &0d4d 4c 67 0d JMP &0d67 ; consider_following_player_to_room_A ; no_action &0d50 a9 00 LDA #&00 &0d52 85 10 STA &10 ; character_acted ; leave &0d54 60 RTS ; is_follower_has_enemy_but_was_not_attacked &0d55 20 5b 0e JSR &0e5b ; consider_character_using_weapon # Try to attack enemy &0d58 a5 10 LDA &10 ; character_acted # Non-zero if attack succeeded &0d5a d0 f8 BNE &0d54 ; leave &0d5c 20 3d 0d JSR &0d3d ; follow_player_or_move_randomly # Otherwise, try to follow player &0d5f a5 10 LDA &10 ; character_acted # Non-zero if able to follow player &0d61 d0 f1 BNE &0d54 ; leave &0d63 f0 54 BEQ &0db9 ; move_character_through_random_exit # Always branches; try to move randomly ; consider_following_player_if_player_is_moving &0d65 a5 14 LDA &14 ; player_room_at_start_of_turn ; consider_following_player_to_room_A &0d67 c5 1a CMP &1a ; character_room &0d69 f0 e5 BEQ &0d50 ; no_action &0d6b 4c ff 0d JMP &0dff ; consider_moving_character_into_room_A ; not_static_no_enemy &0d6e 20 99 0e JSR &0e99 ; consider_character_picking_up_weapon &0d71 a5 10 LDA &10 ; character_acted &0d73 d0 df BNE &0d54 ; leave &0d75 a5 19 LDA &19 ; character_follows_player &0d77 d0 c4 BNE &0d3d ; follow_player_or_move_randomly ; consider_moving_character_with_random_probability &0d79 20 88 1c JSR &1c88 ; rnd &0d7c 29 0f AND #&0f &0d7e 85 10 STA &10 ; chance &0d80 a5 18 LDA &18 ; character_permitted_regions_and_movement_probability &0d82 29 0f AND #&0f &0d84 c5 10 CMP &10 ; chance &0d86 b0 31 BCS &0db9 ; move_character_through_random_exit ; set_character_as_not_having_acted &0d88 a9 00 LDA #&00 ; set_character_acted_to_A &0d8a 85 10 STA &10 ; character_acted &0d8c 60 RTS ; find_character_in_other_faction &0d8d a9 00 LDA #&00 &0d8f 85 10 STA &10 ; highest_strength &0d91 ae fe 27 LDX &27fe ; number_of_characters &0d94 ca DEX ; find_character_in_other_faction_loop &0d95 bd b4 29 LDA &29b4,X ; characters_location &0d98 c5 1a CMP &1a ; character_room &0d9a d0 17 BNE &0db3 ; consider_next_character &0d9c bd 68 29 LDA &2968,X ; characters_description # Top bit specifies faction &0d9f 45 1b EOR &1b ; faction_mask &0da1 10 10 BPL &0db3 ; consider_next_character # Negative if opposing faction &0da3 2c d0 2a BIT &2ad0 ; characters_flags + 0 (CHARACTER_PLAYER) &0da6 70 0b BVS &0db3 ; consider_next_character # Branch if CHARACTER_FLAG_MOVED_AND_WAS_ATTACKED set &0da8 bd 8e 29 LDA &298e,X ; characters_strength &0dab c5 10 CMP &10 ; highest_strength &0dad 90 04 BCC &0db3 ; consider_next_character &0daf 85 10 STA &10 ; highest_strength &0db1 86 17 STX &17 ; enemy_character ; consider_next_character &0db3 ca DEX &0db4 10 df BPL &0d95 ; find_character_in_other_faction_loop &0db6 a5 10 LDA &10 ; highest_strength # Leave with non-zero if character found &0db8 60 RTS ; move_character_through_random_exit &0db9 a4 1a LDY &1a ; character_room &0dbb 20 4e 12 JSR &124e ; get_room_exit_count_and_data_offset_for_room_Y &0dbe a5 7a LDA &7a ; room_description_length_and_exit_count # If the room has no exits, &0dc0 f0 c8 BEQ &0d8a ; set_character_acted_to_A # leave with zero to indicate character didn't act ; choose_random_exit_loop &0dc2 20 88 1c JSR &1c88 ; rnd &0dc5 29 07 AND #&07 &0dc7 c5 7a CMP &7a ; room_description_length_and_exit_count &0dc9 b0 f7 BCS &0dc2 ; choose_random_exit_loop # Pick a random exit &0dcb aa TAX &0dcc e8 INX &0dcd 20 e2 0d JSR &0de2 ; consider_moving_character_through_exit_X # Returns carry clear if character moved &0dd0 b0 04 BCS &0dd6 ; try_exits_in_turn ; set_character_as_having_acted &0dd2 a9 ff LDA #&ff # Non-zero to indicate character acted &0dd4 d0 b4 BNE &0d8a ; set_character_acted_to_A # Always branches ; try_exits_in_turn &0dd6 a6 7a LDX &7a ; room_description_length_and_exit_count ; try_exits_in_turn_loop &0dd8 20 e2 0d JSR &0de2 ; consider_moving_character_through_exit_X # Returns carry clear if character moved &0ddb 90 f5 BCC &0dd2 ; set_character_as_having_acted &0ddd ca DEX &0dde d0 f8 BNE &0dd8 ; try_exits_in_turn_loop # If none of the exits are any good, no action &0de0 f0 a6 BEQ &0d88 ; set_character_as_not_having_acted # Always branches ; consider_moving_character_through_exit_X # Called with X = exit number &0de2 86 10 STX &10 ; tmp_x &0de4 a4 7b LDY &7b ; room_data_offset ; find_exit_in_room_data_loop &0de6 ca DEX &0de7 f0 09 BEQ &0df2 ; found_exit &0de9 b1 77 LDA (&77),Y ; room_data_address &0deb 10 01 BPL &0dee ; not_extended_exit &0ded c8 INY ; not_extended_exit &0dee c8 INY &0def c8 INY &0df0 d0 f4 BNE &0de6 ; find_exit_in_room_data_loop ; found_exit &0df2 b1 77 LDA (&77),Y ; room_data_address # First byte of exit data &0df4 29 40 AND #&40 # .4...... set if exit is open, unset if locked &0df6 d0 04 BNE &0dfc ; is_open ; no_exit &0df8 38 SEC # Leave with carry set to indicate no exit ; leave_after_restoring_x &0df9 a6 10 LDX &10 ; tmp_x &0dfb 60 RTS ; is_open &0dfc c8 INY &0dfd b1 77 LDA (&77),Y ; room_data_address # Second byte of exit data ; consider_moving_character_into_room_A &0dff aa TAX ; destination &0e00 a5 18 LDA &18 ; character_permitted_regions_and_movement_probability &0e02 48 PHA ; permitted_regions # 8421.... permitted sets of regions &0e03 8a TXA ; destination &0e04 a0 03 LDY #&03 ; check_regions_loop &0e06 aa TAX ; destination &0e07 68 PLA ; permitted_regions &0e08 0a ASL A # Set carry if region permitted &0e09 48 PHA ; permitted_regions &0e0a 8a TXA ; destination &0e0b 90 28 BCC &0e35 ; consider_next ; consider_region_part_a &0e0d d9 63 12 CMP &1263,Y ; npc_regions_a_start_table &0e10 90 05 BCC &0e17 ; consider_region_part_b &0e12 d9 73 12 CMP &1273,Y ; npc_regions_a_end_table &0e15 90 25 BCC &0e3c ; is_permitted ; consider_region_part_b &0e17 d9 67 12 CMP &1267,Y ; npc_regions_b_start_table &0e1a 90 05 BCC &0e21 ; consider_region_part_c &0e1c d9 77 12 CMP &1277,Y ; npc_regions_b_end_table &0e1f 90 1b BCC &0e3c ; is_permitted ; consider_region_part_c &0e21 d9 6b 12 CMP &126b,Y ; npc_regions_c_start_table &0e24 90 05 BCC &0e2b ; consider_region_part_d &0e26 d9 7b 12 CMP &127b,Y ; npc_regions_c_end_table &0e29 90 11 BCC &0e3c ; is_permitted ; consider_region_part_d &0e2b d9 6f 12 CMP &126f,Y ; npc_regions_d_start_table &0e2e 90 05 BCC &0e35 ; consider_next_region &0e30 d9 7f 12 CMP &127f,Y ; npc_regions_d_end_table &0e33 90 07 BCC &0e3c ; is_permitted ; consider_next_region &0e35 88 DEY &0e36 10 ce BPL &0e06 ; check_regions_loop &0e38 68 PLA ; permitted_regions &0e39 4c f8 0d JMP &0df8 ; no_exit ; is_permitted # If the destination is in a permitted region, &0e3c aa TAX ; destination &0e3d 68 PLA ; permitted_regions &0e3e 8a TXA ; destination &0e3f 24 15 BIT &15 ; allow_actions # Negative if allowed &0e41 10 15 BPL &0e58 ; skip_moving &0e43 a6 16 LDX &16 ; character_to_update &0e45 9d d0 2b STA &2bd0,X ; characters_new_location # Move character to destination at end of turn &0e48 bd d0 2a LDA &2ad0,X ; characters_flags &0e4b 24 13 BIT &13 ; character_flags # Negative if CHARACTER_FLAG_WAS_ATTACKED set &0e4d 30 04 BMI &0e53 ; set_moved_and_was_attacked ; set_moved_but_not_attacked &0e4f 09 20 ORA #&20 ; CHARACTER_FLAG_MOVED_BUT_NOT_ATTACKED &0e51 d0 02 BNE &0e55 ; set_character_flags # Always branches ; set_moved_and_was_attacked &0e53 09 40 ORA #&40 ; CHARACTER_FLAG_MOVED_AND_WAS_ATTACKED ; set_character_flags &0e55 9d d0 2a STA &2ad0,X ; characters_flags ; skip_moving &0e58 18 CLC # Leave with carry clear to indicate exit &0e59 90 9e BCC &0df9 ; leave_after_restoring_x # Always branches ; consider_character_using_weapon &0e5b a9 00 LDA #&00 &0e5d 85 10 STA &10 ; character_acted &0e5f a2 0a LDX #&0a ; OBJECT_FLINT_STONE # First weapon ; consider_character_using_weapon_loop # For each weapon, &0e61 bd c0 25 LDA &25c0,X ; objects_location &0e64 c9 ff CMP #&ff ; ROOM_IN_HOLDALL &0e66 d0 03 BNE &0e6b ; not_in_holdall &0e68 ad c0 25 LDA &25c0 ; objects_location + 0 (OBJECT_HOLDALL) ; not_in_holdall &0e6b 38 SEC &0e6c e9 c8 SBC #&c8 ; ROOM_CARRYING &0e6e c5 16 CMP &16 ; character_to_update &0e70 d0 22 BNE &0e94 ; consider_next_weapon # Is the character holding the weapon? &0e72 86 11 STX &11 ; weapon &0e74 a5 17 LDA &17 ; enemy_character &0e76 18 CLC &0e77 69 c8 ADC #&c8 ; ROOM_CARRYING &0e79 a8 TAY ; enemy &0e7a 20 88 1c JSR &1c88 ; rnd &0e7d a6 11 LDX &11 ; weapon &0e7f c9 c0 CMP #&c0 # 1 in 4 chance of throwing weapon &0e81 90 08 BCC &0e8b ; use_weapon_by_hitting ; use_weapon_by_throwing &0e83 a5 15 LDA &15 ; allow_actions &0e85 20 40 1d JSR &1d40 ; throw_weapon_after_strength_check # Returns carry clear if weapon could be thrown &0e88 4c 90 0e JMP &0e90 ; check_if_successful_attack ; use_weapon_by_hitting &0e8b a5 15 LDA &15 ; allow_actions &0e8d 20 ca 1c JSR &1cca ; hit_weapon_after_strength_check # Returns carry clear if weapon could be hit ; check_if_successful_attack &0e90 a6 11 LDX &11 ; weapon &0e92 90 41 BCC &0ed5 ; skip_picking_up_weapon # Branch if attack successful ; consider_next_weapon &0e94 e8 INX &0e95 e0 23 CPX #&23 ; OBJECT_BROAD_SWORD + 1 # Last weapon &0e97 d0 c8 BNE &0e61 ; consider_character_using_weapon_loop ; consider_character_picking_up_weapon &0e99 a9 00 LDA #&00 &0e9b 85 10 STA &10 ; character_acted # Set to zero to indicate character hasn't acted &0e9d a2 0a LDX #&0a ; OBJECT_FLINT_STONE # First weapon ; consider_character_picking_up_weapon_loop # For each weapon, &0e9f bd c0 25 LDA &25c0,X ; objects_location &0ea2 c5 1a CMP &1a ; character_room &0ea4 d0 34 BNE &0eda ; consider_next_weapon # Is the character in the same room as the weapon? &0ea6 86 11 STX &11 ; weapon &0ea8 a5 16 LDA &16 ; character_to_update &0eaa 69 c7 ADC #&c7 ; ROOM_CARRYING - 1 &0eac a8 TAY &0ead a5 15 LDA &15 ; allow_actions # Negative if allowed &0eaf 20 6c 1b JSR &1b6c ; set_object_location # Returns carry clear if not too heavy &0eb2 a6 11 LDX &11 ; weapon &0eb4 b0 24 BCS &0eda ; consider_next_weapon &0eb6 24 15 BIT &15 ; allow_actions # Negative if allowed &0eb8 10 1b BPL &0ed5 ; skip_writing_character_takes_weapon &0eba a5 1a LDA &1a ; character_room &0ebc c5 89 CMP &89 ; player_room &0ebe d0 15 BNE &0ed5 ; skip_writing_character_takes_weapon ; write_character_takes_weapon &0ec0 a5 16 LDA &16 ; character_to_update &0ec2 69 c7 ADC #&c7 ; ROOM_CARRYING - 1 &0ec4 aa TAX &0ec5 20 ea 1b JSR &1bea ; write_character_name &0ec8 a9 bb LDA #&bb ; "takes" &0eca 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &0ecd a6 11 LDX &11 ; weapon &0ecf 20 dd 24 JSR &24dd ; write_object_name &0ed2 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; skip_writing_character_takes_weapon ; skip_picking_up_weapon &0ed5 a9 ff LDA #&ff &0ed7 85 10 STA &10 ; character_acted # Set to non-zero to indicate character acted &0ed9 60 RTS ; consider_next_weapon &0eda e8 INX &0edb e0 23 CPX #&23 ; OBJECT_BROAD_SWORD + 1 # Last weapon &0edd d0 c0 BNE &0e9f ; consider_character_picking_up_weapon_loop &0edf 60 RTS ; write_you_scramble_out_of_the_water_and_damage_player_randomly &0ee0 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &0ee3 87 bc bd 6b 5d 6c 00 ; "You scramble out of the water" &0eea 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; damage_player_randomly_from_diving_down_waterfall &0eed a0 64 LDY #&64 ; ceiling # Do 37 - 100 damage for diving down waterfall &0eef a9 3f LDA #&3f ; random ; damage_player_randomly # Called with A = random, Y = ceiling &0ef1 a6 89 LDX &89 ; player_room &0ef3 86 1a STX &1a ; character_room &0ef5 a2 c8 LDX #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) # Damage player &0ef7 4c 9e 1c JMP &1c9e ; damage_character_randomly ; damage_player # Called with A = damage &0efa a2 c8 LDX #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) # Damage player &0efc a4 89 LDY &89 ; player_room &0efe 84 1a STY &1a ; character_room &0f00 4c 02 1c JMP &1c02 ; damage_character ; update_world_part_two &0f03 a5 89 LDA &89 ; player_room &0f05 c9 33 CMP #&33 ; ROOM_33 ("diving down a dangerous fall") &0f07 d0 1a BNE &0f23 ; not_diving_down_a_dangerous_fall ; is_diving_down_a_dangerous_fall &0f09 a0 be LDY #&be ; ceiling # Do 63 - 190 damage for diving down dangerous fall &0f0b a9 7f LDA #&7f ; random &0f0d 20 f1 0e JSR &0ef1 ; damage_player_randomly &0f10 a0 05 LDY #&05 # Bug: should be LDY #&06 &0f12 a5 14 LDA &14 ; player_room_at_start_of_turn ; consider_next_entrance &0f14 88 DEY # Wraps around to become &05 eventually if in ROOM_16 &0f15 d9 83 12 CMP &1283,Y ; dangerous_fall_entrances_table &0f18 d0 fa BNE &0f14 ; consider_next_entrance &0f1a b9 89 12 LDA &1289,Y ; dangerous_fall_exits_table &0f1d 20 5a 24 JSR &245a ; set_player_room &0f20 4c 4a 0f JMP &0f4a ; update_characters_strength ; not_diving_down_a_dangerous_fall &0f23 c9 37 CMP #&37 ; ROOM_37 ("diving down a large water fall") &0f25 d0 0b BNE &0f32 ; not_diving_down_a_large_water_fall ; is_diving_down_a_large_water_fall &0f27 20 ed 0e JSR &0eed ; damage_player_randomly_from_diving_down_waterfall &0f2a a9 1a LDA #&1a ; ROOM_1a ("in a deep crocodile infested pool") &0f2c 20 5a 24 JSR &245a ; set_player_room &0f2f 4c 36 0f JMP &0f36 ; is_in_a_deep_crocodile_infested_pool ; not_diving_down_a_large_water_fall &0f32 c9 1a CMP #&1a ; ROOM_1a ("in a deep crocodile infested pool") &0f34 d0 08 BNE &0f3e ; not_in_a_deep_crocodile_infested_pool ; is_in_a_deep_crocodile_infested_pool &0f36 20 e0 0e JSR &0ee0 ; write_you_scramble_out_of_the_water_and_damage_player_randomly &0f39 a9 1b LDA #&1b ; ROOM_1b ("close by a large rock, sitting on the canyon floor") &0f3b 4c 47 0f JMP &0f47 ; set_player_room ; not_in_a_deep_crocodile_infested_pool &0f3e c9 32 CMP #&32 ; ROOM_32 ("in the moat") &0f40 d0 08 BNE &0f4a ; not_in_the_moat &0f42 20 e0 0e JSR &0ee0 ; write_you_scramble_out_of_the_water_and_damage_player_randomly &0f45 a5 14 LDA &14 ; player_room_at_start_of_turn # Return to room prior to entering moat ; to_set_player_room &0f47 20 5a 24 JSR &245a ; set_player_room ; not_in_the_moat ; update_characters_strength &0f4a ae fe 27 LDX &27fe ; number_of_characters ; update_characters_strength_loop &0f4d bd 67 29 LDA &2967,X ; characters_description - 1 &0f50 29 1f AND #&1f # ...18421 character description &0f52 a8 TAY &0f53 bd 8d 29 LDA &298d,X ; characters_strength - 1 &0f56 f0 0f BEQ &0f67 ; consider_next_character &0f58 18 CLC &0f59 79 c0 28 ADC &28c0,Y ; character_descriptions_strength_regain &0f5c d9 00 28 CMP &2800,Y ; character_descriptions_maximum_strength &0f5f 90 03 BCC &0f64 ; skip_ceiling &0f61 b9 00 28 LDA &2800,Y ; character_descriptions_maximum_strength ; skip_ceilling &0f64 9d 8d 29 STA &298d,X ; characters_strength - 1 ; consider_next_character &0f67 ca DEX &0f68 d0 e3 BNE &0f4d ; update_characters_strength_loop ; update_lamp &0f6a ad 81 25 LDA &2581 ; objects_description + 1 (OBJECT_LAMP) &0f6d d0 3f BNE &0fae ; not_lit ; is_lit &0f6f ce fb 27 DEC &27fb ; lamp_life &0f72 ad fb 27 LDA &27fb ; lamp_life &0f75 f0 28 BEQ &0f9f ; out_of_oil &0f77 c9 14 CMP #&14 ; 20 &0f79 d0 33 BNE &0fae ; not_low_on_oil &0f7b ad c1 25 LDA &25c1 ; objects_location + 1 (OBJECT_LAMP) &0f7e c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &0f80 f0 04 BEQ &0f86 ; is_present &0f82 c5 89 CMP &89 ; player_room &0f84 d0 28 BNE &0fae ; not_low_on_oil ; is_present &0f86 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &0f89 3d 5a 00 ; "Your lamp" &0f8c a9 88 LDA #&88 ; TELETEXT_FLASH &0f8e 20 ee ff JSR &ffee ; OSWRCH &0f91 a9 be LDA #&be ; "flickers" &0f93 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &0f96 4c ab 0f JMP &0fab ; end_lamp_sentence ; unused # Unused code &0f99 20 fa 20 JSR &20fa ; end_sentence_and_write_newline # &0f9c 4c ae 0f JMP &0fae ; consider_dehydration # ; out_of_oil &0f9f a9 01 LDA #&01 ; "an unlit oil lamp" &0fa1 8d 81 25 STA &2581 ; objects_description + 1 (OBJECT_LAMP) &0fa4 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &0fa7 3d 5a bf 00 ; "Your lamp dies" ; end_lamp_sentence &0fab 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; not_low_on_oil ; not_lit ; consider_dehydration &0fae a5 89 LDA &89 ; player_room &0fb0 10 04 BPL &0fb6 ; check_if_first_desert &0fb2 c9 85 CMP #&85 ; ROOM_85 ("on a cliff top") &0fb4 90 08 BCC &0fbe ; is_desert ; check_if_first_desert &0fb6 c9 20 CMP #&20 ; ROOM_20 ("by a cliff top") &0fb8 90 08 BCC &0fc2 ; not_desert &0fba c9 30 CMP #&30 ; ROOM_2f (in an arid desert") + 1 &0fbc b0 04 BCS &0fc2 ; not_desert ; is_desert &0fbe a9 07 LDA #&07 # Dehydrate seven time faster in desert &0fc0 d0 02 BNE &0fc4 ; set_dehydration # Always branches ; not_desert &0fc2 a9 01 LDA #&01 ; set_dehydration &0fc4 85 62 STA &62 ; dehydration &0fc6 c5 02 CMP &02 ; player_hydration &0fc8 b0 19 BCS &0fe3 ; is_ill_with_thirst &0fca a5 02 LDA &02 ; player_hydration &0fcc 38 SEC &0fcd e5 62 SBC &62 ; dehydration &0fcf 85 02 STA &02 ; player_hydration &0fd1 c9 28 CMP #&28 ; 40 &0fd3 b0 29 BCS &0ffe ; not_very_dry &0fd5 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &0fd8 87 48 4a 4b 00 ; "You are very dry" &0fdd 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &0fe0 4c fe 0f JMP &0ffe ; consider_witch_and_crystal_ball ; is_ill_with_thirst &0fe3 a5 02 LDA &02 ; player_hydration &0fe5 f0 10 BEQ &0ff7 ; skip_writing_you_are_ill_with_thirst &0fe7 a9 00 LDA #&00 &0fe9 85 02 STA &02 ; player_hydration &0feb 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &0fee 87 48 35 b3 c0 00 ; "You are ill with thirst" &0ff4 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; skip_writing_you_are_ill_with_thirst &0ff7 a5 62 LDA &62 ; dehydration &0ff9 0a ASL A &0ffa 0a ASL A &0ffb 20 fa 0e JSR &0efa ; damage_player ; not_very_dry ; consider_witch_and_crystal_ball &0ffe a5 14 LDA &14 ; player_room_at_start_of_turn &1000 85 1c STA &1c ; player_previous_room &1002 a5 89 LDA &89 ; player_room &1004 85 14 STA &14 ; player_room_at_start_of_turn &1006 c9 78 CMP #&78 ; ROOM_78 ("in a twisty little passage in a maze") &1008 d0 3c BNE &1046 ; not_witch_room &100a ad c8 25 LDA &25c8 ; objects_location + 8 (OBJECT_CRYSTAL_BALL) &100d c9 d8 CMP #&d8 ; ROOM_CARRYING + &10 (CHARACTER_WITCH_TWO) &100f d0 14 BNE &1025 ; consider_witch_casting_spell &1011 ad c5 25 LDA &25c5 ; objects_location + 5 (OBJECT_BRONZE_KEY) &1014 c9 d8 CMP #&d8 ; ROOM_CARRYING + &10 (CHARACTER_WITCH_TWO) &1016 d0 0a BNE &1022 ; to_consider_healing_giant &1018 a2 05 LDX #&05 ; OBJECT_BRONZE_KEY &101a 20 3d 13 JSR &133d ; give_player_object &101d a9 08 LDA #&08 ; "a witch" # Clear top bit to put witch in friendly faction &101f 8d 78 29 STA &2978 ; characters_description + &10 (CHARACTER_WITCH_TWO) ; to_consider_healing_giant &1022 4c 4a 10 JMP &104a ; consider_healing_giant ; consider_witch_casting_spell &1025 24 04 BIT &04 ; witch_spell_timer # Zero if first turn in witch room &1027 30 04 BMI &102d ; cast_spell &1029 c6 04 DEC &04 ; witch_spell_timer # Set to negative to indicate not first turn &102b 30 1d BMI &104a ; consider_healing_giant # Always branches ; cast_spell &102d a2 d8 LDX #&d8 ; ROOM_CARRYING + &10 (CHARACTER_WITCH_TWO) &102f 20 ea 1b JSR &1bea ; write_character_name &1032 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1035 c1 3a c2 1a 87 00 ; "casts a spell on you" &103b 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &103e a9 3c LDA #&3c ; 50 &1040 20 fa 0e JSR &0efa ; damage_player &1043 4c 4a 10 JMP &104a ; consider_healing_giant ; not_witch_room &1046 a9 00 LDA #&00 &1048 85 04 STA &04 ; witch_spell_timer ; consider_healing_giant &104a ad 6a 29 LDA &296a ; characters_description + 2 (CHARACTER_GIANT) &104d c9 01 CMP #&01 ; "the giant" &104f f0 23 BEQ &1074 ; skip_healing_giant # If the giant hasn't been healed, &1051 ad b6 29 LDA &29b6 ; characters_location + 2 (CHARACTER_GIANT) &1054 c9 89 CMP #&89 ; ROOM_89 ("at Watersmeet") &1056 d0 1c BNE &1074 ; skip_healing_giant # and the giant is at Watersmeet, &1058 c5 14 CMP &14 ; player_room_at_start_of_turn &105a d0 0d BNE &1069 ; skip_writing_an_ill_giant_swims &105c a2 ca LDX #&ca ; ROOM_CARRYING + 2 (CHARACTER_GIANT) &105e 20 ea 1b JSR &1bea ; write_character_name &1061 a9 c3 LDA #&c3 ; "swims" &1063 20 b8 14 JSR &14b8 ; write_word_from_dictionary_two &1066 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; skip_writing_an_ill_giant_swims &1069 a9 01 LDA #&01 ; "the giant" # heal the giant &106b 8d 6a 29 STA &296a ; characters_description + 2 (CHARACTER_GIANT) &106e ad 01 28 LDA &2801 ; character_descriptions_maximum_strength + 1 (CHARACTER_GIANT) &1071 8d 90 29 STA &2990 ; characters_strength + 2 (CHARACTER_GIANT) ; skip_healing_giant ; consider_dragon &1074 ad 97 29 LDA &2997 ; characters_strength + 9 (CHARACTER_DRAGON) &1077 f0 2b BEQ &10a4 ; consider_forest_king # If the dragon isn't dead, &1079 a9 4e LDA #&4e ; ROOM_4e ("in the north turret") &107b 85 1a STA &1a ; character_room &107d a9 89 LDA #&89 ; FACTION_ENEMY | CHARACTER_DRAGON &107f 85 1b STA &1b ; faction_mask &1081 20 8d 0d JSR &0d8d ; find_character_in_other_faction # Returns non-zero if character found &1084 f0 1e BEQ &10a4 ; consider_forest_king &1086 a5 89 LDA &89 ; player_room &1088 c9 4e CMP #&4e ; ROOM_4e ("in the north turret") &108a d0 0b BNE &1097 ; skip_writing_flames_fill_the_room &108c 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &108f c4 1d 5d 40 00 ; "Flames fill the room" &1094 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; skip_writing_flames_fill_the_room &1097 a5 17 LDA &17 ; enemy_character &1099 18 CLC &109a 69 c8 ADC #&c8 ; ROOM_CARRYING &109c aa TAX &109d a0 5a LDY #&5a ; ceiling # Do 59 - 90 damage from dragon's flames &109f a9 1f LDA #&1f ; random &10a1 20 9e 1c JSR &1c9e ; damage_character_randomly ; consider_forest_king &10a4 a5 89 LDA &89 ; player_room &10a6 c9 a9 CMP #&a9 ; ROOM_a9 ("locked up in a dungeon") &10a8 d0 6e BNE &1118 ; not_in_dungeon ; is_in_dungeon &10aa ae fc 27 LDX &27fc ; number_of_objects ; consider_forest_king_gifts_loop &10ad bd bf 25 LDA &25bf,X ; objects_location - 1 &10b0 c9 e2 CMP #&e2 ; ROOM_CARRYING + &1a (CHARACTER_FOREST_KING) &10b2 d0 5f BNE &1113 ; consider_next_object ; was_given_object &10b4 bd 7f 25 LDA &257f,X ; objects_description - 1 &10b7 a8 TAY &10b8 b9 54 26 LDA &2654,Y ; object_descriptions_score &10bb c9 1e CMP #&1e ; 30 # Accept a wooden treasure chest, a bag of gold, a large &10bd 90 32 BCC &10f1 ; was_given_inadequate_object # cut diamond, a jewelled gold crown, a jug of gold, a ; was_given_adequate_object # staff of gold, a ball of gold, or the secret of life &10bf ca DEX &10c0 a0 b0 LDY #&b0 ; ROOM_b0 ("in the strong room") &10c2 98 TYA # Set to negative to set object location &10c3 20 6c 1b JSR &1b6c ; set_object_location &10c6 e6 20 INC &20 ; amulet_state # Set to non-zero to indicate amulet received &10c8 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &10cb 3d c5 c6 3e c7 39 3c 44 c8 87 48 c9 3b ca 43 2e 5d 4e cb cc cd 87 00 ; "Your generous gift is accepted, and in return you are given an amulet to help the forest king's people recognise you" &10e2 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &10e5 a2 28 LDX #&28 ; OBJECT_AMULET &10e7 a0 c8 LDY #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &10e9 98 TYA # Set to negative to set object location &10ea 20 6c 1b JSR &1b6c ; set_object_location &10ed a9 35 LDA #&35 ; ROOM_35 ("in a cave") &10ef d0 1c BNE &110d ; set_player_room_by_forest_king # Always branches ; was_given_inadequate_object &10f1 ca DEX &10f2 a0 6f LDY #&6f ; ROOM_6f ("in a room full of bones") &10f4 a9 80 LDA #&80 # Set to negative to set object location &10f6 20 6c 1b JSR &1b6c ; set_object_location ; was_given_nothing &10f9 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &10fc 87 48 ce 8a 87 48 3a cf d0 82 d1 00 ; "You are told that you are a vagabond without any respect" &1108 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &110b a9 6f LDA #&6f ; ROOM_6f ("in a room full of bones") ; set_player_room_by_forest_king &110d 20 5a 24 JSR &245a ; set_player_room &1110 4c 92 11 JMP &1192 ; consider_princess_fleeing ; consider_next_object &1113 ca DEX &1114 d0 97 BNE &10ad ; consider_forest_king_gifts_loop &1116 f0 e1 BEQ &10f9 ; was_given_nothing # Always branches ; not_in_dungeon &1118 c9 6d CMP #&6d ; ROOM_6d ("in The Hall Of The Forest King") &111a d0 76 BNE &1192 ; consider_princess_fleeing ; is_in_hall_of_the_forest_king &111c a5 20 LDA &20 ; amulet_state # Non-zero if amulet received &111e d0 26 BNE &1146 ; has_received_amulet &1120 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1123 5d 4e cb d2 55 d3 87 b8 d4 3c d5 3a d6 d7 39 43 d8 d1 b8 5d 4f 39 44 c8 b8 3d d9 00 ; "The forest king's personal guard arrest you for trespassing and demand a suitable payment, to show respect for the king, in return for your freedom" &113f 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &1142 a9 a9 LDA #&a9 ; ROOM_a9 ("locked up in a dungeon") &1144 d0 c7 BNE &110d ; set_player_room_by_forest_king # Always branches ; has_received_amulet &1146 24 21 BIT &21 ; princess_state # Top bit set if princess fled and recognised &1148 30 0b BMI &1155 ; has_fled &114a 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &114d 87 48 da 37 00 ; "You are welcome here" &1152 4c 8f 11 JMP &118f ; end_sentence_and_consider_princess_fleeing ; has_fled &1155 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1158 87 48 db 3c c9 3a 60 32 2f 38 3e dc 3a c5 c6 00 ; "You are honoured and given a silver key. It is indeed a generous gift" &1168 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &116b 46 21 LSR &21 ; princess_state # Clear top bit to stop getting key again &116d a0 c8 LDY #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &116f 98 TYA # Set to negative to set object location &1170 a2 04 LDX #&04 ; OBJECT_SILVER_KEY &1172 20 6c 1b JSR &1b6c ; set_object_location # Returns carry clear if not too heavy &1175 90 1b BCC &1192 ; consider_princess_fleeing &1177 a2 04 LDX #&04 ; OBJECT_SILVER_KEY &1179 a0 6d LDY #&6d ; ROOM_6d ("in The Hall Of The Forest King") &117b a9 ff LDA #&ff # Set to negative to set object location &117d 20 6c 1b JSR &1b6c ; set_object_location &1180 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1183 38 b4 43 5d 56 39 dd 3d de 48 47 00 ; "It drops to the floor, because your hands are full" ; end_sentence_and_consider_princess_fleeing &118f 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; consider_princess_fleeing &1192 a5 21 LDA &21 ; princess_state # Non-zero if princess has already fled &1194 d0 4e BNE &11e4 ; skip_princess_fleeing &1196 a0 a8 LDY #&a8 ; ROOM_a8 ("in a dungeon") &1198 20 4e 12 JSR &124e ; get_room_exit_count_and_data_offset_for_room_Y &119b a4 7b LDY &7b ; room_data_offset &119d b1 77 LDA (&77),Y ; room_data_address # Get flags for first exit &119f 29 40 AND #&40 ; EXIT_DIRECTION_LOCKED # .4...... set if exit is open, unset if locked &11a1 f0 41 BEQ &11e4 ; skip_princess_fleeing &11a3 a5 20 LDA &20 ; amulet_state # Non-zero if amulet received &11a5 f0 2a BEQ &11d1 ; not_carrying_amulet &11a7 ad e8 25 LDA &25e8 ; objects_location + &28 (OBJECT_AMULET) &11aa c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &11ac d0 23 BNE &11d1 ; not_carrying_amulet ; is_carrying_amulet &11ae a9 80 LDA #&80 &11b0 85 21 STA &21 ; princess_state # Set to &80 to indicate fled and recognised &11b2 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &11b5 3a df e0 2f e1 e2 87 50 3d ca 3c e3 8a e4 e5 39 5d 4e 4f 39 e6 e7 87 e8 00 ; "A princess flees. She recognises you by your amulet and says that her father, the forest king, will reward you handsomely" &11ce 4c e1 11 JMP &11e1 ; consider_lamp_in_holdall ; not_carrying_amulet &11d1 a9 40 LDA #&40 # Set to &40 to indicate fled, but not recognised &11d3 85 21 STA &21 ; princess_state &11d5 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &11d8 3a df e0 2f e1 e9 cd 87 00 ; "A princess flees. She doesn't recognise you" &11e1 20 fa 20 JSR &20fa ; end_sentence_and_write_newline ; skip_princess_fleeing ; consider_lamp_in_holdall &11e4 ae c1 25 LDX &25c1 ; objects_location + 1 (OBJECT_LAMP) &11e7 e8 INX # &ff (ROOM_IN_HOLDALL) -> &00 &11e8 d0 1d BNE &1207 ; skip_burning_holdall # Branch if lamp not in holdall &11ea ad 81 25 LDA &2581 ; objects_description + 1 (OBJECT_LAMP) # &00 if "a lit lamp", &01 if "an unlit oil lamp" &11ed d0 18 BNE &1207 ; skip_burning_holdall # Branch if lamp not lit ; lit_lamp_in_holdall &11ef 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &11f2 5d 76 3e ea 44 c4 00 ; "The holdall is engulfed in flames" &11f9 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &11fc 20 d7 19 JSR &19d7 ; empty_holdall &11ff a9 c7 LDA #&c7 ; ROOM_DESTROYED &1201 a8 TAY # Set to negative to set object location &1202 a2 00 LDX #&00 ; OBJECT_HOLDALL &1204 20 6c 1b JSR &1b6c ; set_object_location ; skip_burning_holdall ; consider_updating_drawbridge &1207 a5 89 LDA &89 ; player_room &1209 c9 29 CMP #&29 ; ROOM_29 ("on the draw bridge") &120b f0 04 BEQ &1211 ; is_room_29_or_4d &120d c9 4d CMP #&4d ; ROOM_4d ("in a room") &120f d0 02 BNE &1213 ; not_room_29_or_4d ; is_room_29_or_4d &1211 85 24 STA &24 ; room_29_or_4d_visited # Set to non-zero to indicate room visited ; not_room_29_or_4d &1213 c9 28 CMP #&28 ; ROOM_28 ("in the desert which surrounds the castle") &1215 d0 2a BNE &1241 ; lower_draw_bridge &1217 c5 1c CMP &1c ; player_previous_room &1219 f0 32 BEQ &124d ; leave &121b a5 24 LDA &24 ; room_29_or_4d_visited # Zero if neither room visited &121d f0 22 BEQ &1241 ; lower_draw_bridge &121f ad e9 25 LDA &25e9 ; objects_location + &29 (OBJECT_UNIFORM) &1222 c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &1224 f0 1b BEQ &1241 ; lower_draw_bridge ; raise_draw_bridge &1226 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1229 87 34 5d 2a 57 16 00 ; "You see the draw bridge close" &1230 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &1233 20 5a 12 JSR &125a ; get_first_exit_destination_offset_for_draw_bridge_approach_room &1236 a9 32 LDA #&32 ; ROOM_32 ("in the moat") &1238 91 77 STA (&77),Y ; room_data_address &123a a9 0c LDA #&0c ; PICTURE_0c &123c 8d 28 1f STA &1f28 ; room_pictures_table + &28 (ROOM_28 ("in the desert which surrounds the castle")) &123f d0 0c BNE &124d ; leave # Always branches ; lower_draw_bridge &1241 20 5a 12 JSR &125a ; get_first_exit_destination_offset_for_draw_bridge_approach_room &1244 a9 29 LDA #&29 ; ROOM_29 ("on the draw bridge") &1246 91 77 STA (&77),Y ; room_data_address &1248 a9 0b LDA #&0b ; PICTURE_0b &124a 8d 28 1f STA &1f28 ; room_pictures_table + &28 (ROOM_28 ("in the desert which surrounds the castle")) ; leave &124d 60 RTS ; get_room_exit_count_and_data_offset_for_room_Y &124e a5 89 LDA &89 ; player_room &1250 48 PHA ; player_room &1251 84 89 STY &89 ; player_room &1253 20 fb 24 JSR &24fb ; get_room_exit_count_and_data_offset &1256 68 PLA ; player_room &1257 85 89 STA &89 ; player_room &1259 60 RTS ; get_first_exit_destination_offset_for_draw_bridge_approach_room &125a a0 28 LDY #&28 ; ROOM_28 ("in the desert which surrounds the castle") &125c 20 4e 12 JSR &124e ; get_room_exit_count_and_data_offset_for_room_Y &125f a4 7b LDY &7b ; room_data_offset &1261 c8 INY # Leave with Y = offset for first exit destination &1262 60 RTS # Regions # ======= # Region 1: # a: ROOM_34 ("in the castle entrance hall") # b: ROOM_38 ("in the study") - ROOM_65 ("in a dungeon") # c: ROOM_8b ("in a cave") - ROOM_97 ("on The Crystal Bridge") # d: ROOM_8b ("in a cave") - ROOM_97 ("on The Crystal Bridge") # # Region 2: # a: ROOM_20 ("by a cliff top") - ROOM_30 ("wandering through high mountains") # b: ROOM_80 ("in an arid desert") - ROOM_84 ("on a cliff top") # c: ROOM_8a ("wandering up the west mountains") # d: ROOM_31 ("wandering through high mountains") # # Region 3: # a: ROOM_35 ("in a cave" - ROOM_36 ("in a narrow passage") # b: ROOM_66 ("in a narrow shaft") - ROOM_7f ("in a passage in a turny twisty maze") # c: ROOM_66 ("in a narrow shaft") - ROOM_7f ("in a passage in a turny twisty maze") # d: ROOM_66 ("in a narrow shaft") - ROOM_7f ("in a passage in a turny twisty maze") # # Region 4: # a: ROOM_00 ("inside a wooden cabin") - ROOM_19 ("on the south edge of a deep fissure") # b: ROOM_1b ("close by a large rock, sitting on the canyon floor") - ROOM_1f ("in a very narrow fissure") # c: ROOM_85 ("on a cliff top") - ROOM_89 ("at Watersmeet") # d: ROOM_97 ("on The Crystal Bridge") - ROOM_ad ("wandering through high mountains") ; npc_regions_a_start_table 1 2 3 4 &1263 34 20 35 00 ; npc_regions_b_start_table 1 2 3 4 &1267 38 80 66 1b ; npc_regions_c_start_table 1 2 3 4 &126b 8b 8a 66 85 ; npc_regions_d_start_table 1 2 3 4 &126f 8b 31 66 97 ; npc_regions_a_end_table 1 2 3 4 &1273 35 31 37 1a ; npc_regions_b_end_table 1 2 3 4 &1277 66 85 80 20 ; npc_regions_c_end_table 1 2 3 4 &127b 98 8b 80 8a ; npc_regions_d_end_table 1 2 3 4 &127f 98 32 80 ae ; dangerous_fall_entrances_table &1283 19 ; ROOM_19 ("on the south edge of a deep fissure") &1284 23 ; ROOM_23 ("on the edge of a deep fissure") &1285 22 ; ROOM_22 ("by a cliff top") &1286 21 ; ROOM_21 ("to the north of a deep canyon") &1287 20 ; ROOM_20 ("by a cliff top") &1288 16 ; ROOM_16 ("by a cliff top") ; dangerous_fall_exits_table &1289 1f ; ROOM_1f ("in a very narrow fissure") &128a 1f ; ROOM_1f ("in a very narrow fissure") &128b 1e ; ROOM_1e ("at the west end of the canyon") &128c 1d ; ROOM_1d ("on the canyon floor") &128d 1b ; ROOM_1b ("close by a large rock, sitting on the canyon floor") &128e 1c ; ROOM_1c ("the canyon floor") ; unused # Possible source code fragment, but not really BASIC &128f 45 52 45 0d ; ... ERE &1293 2e 9a 08 80 31 37 36 0d ; 11930AND176 &129b 2e a4 06 81 8d 0d ; 11940DIV ... &12a1 2e ae 08 ; 11950 ... ; write_number # Called with X = 0 to suppress leading zeros &12a4 20 6e 18 JSR &186e ; write_space &12a7 ca DEX &12a8 86 62 STX &62 ; suppress_leading_zeros &12aa a0 04 LDY #&04 ; write_number_digit_loop &12ac a9 00 LDA #&00 &12ae 85 63 STA &63 ; digit ; division_loop &12b0 38 SEC &12b1 a5 60 LDA &60 ; number_low &12b3 f9 e5 12 SBC &12e5,Y ; powers_of_ten_low_table - 1 &12b6 aa TAX &12b7 a5 61 LDA &61 ; number_high &12b9 f9 e9 12 SBC &12e9,Y ; powers_of_ten_high_table - 1 &12bc 90 08 BCC &12c6 ; write_digit &12be 86 60 STX &60 ; number_low &12c0 85 61 STA &61 ; number_high &12c2 e6 63 INC &63 ; digit &12c4 d0 ea BNE &12b0 ; division_loop # Always branches ; write_digit &12c6 a5 63 LDA &63 ; digit &12c8 d0 04 BNE &12ce ; not_zero &12ca 24 62 BIT &62 ; suppress_leading_zeros # Negative if suppressing leading zeros &12cc 30 07 BMI &12d5 ; skip_writing_zero ; not_zero &12ce 85 62 STA &62 ; suppress_leading_zeros # Set to positive to write subsequent zeros ; write_zero &12d0 09 30 ORA #&30 ; "0" &12d2 20 ee ff JSR &ffee ; OSWRCH ; skip_writing_zero &12d5 a5 60 LDA &60 ; number_low &12d7 88 DEY &12d8 f0 f6 BEQ &12d0 ; write_zero &12da 10 d0 BPL &12ac ; write_number_digit_loop &12dc 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; check_for_object_carried_by_player &12df a9 c8 LDA #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &12e1 85 6e STA &6e ; room_to_consider &12e3 4c a7 15 JMP &15a7 ; check_for_object_in_room ; powers_of_ten_low_table # 0 : 10 ; 0 1 2 3 # 1 : 100 &12e6 0a 64 e8 10 # 2 : 1000 # 3 : 10000 ; powers_of_ten_high_table ; 0 1 2 3 &12ea 00 00 03 27 ; handle_score &12ee 20 03 13 JSR &1303 ; write_score &12f1 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &12f4 3d eb 3e 00 ; "Your strength is" &12f8 ad 8e 29 LDA &298e ; characters_strength + 0 (CHARACTER_PLAYER) &12fb 85 60 STA &60 ; number_low &12fd a2 00 LDX #&00 &12ff 86 61 STX &61 ; number_high &1301 f0 a1 BEQ &12a4 ; write_number # Always branches ; write_score &1303 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1306 3d 2b 3e 00 ; "Your score is" ; score_objects &130a a9 00 LDA #&00 &130c 85 60 STA &60 ; number_low &130e 85 61 STA &61 ; number_high &1310 ae fc 27 LDX &27fc ; number_of_objects ; score_objects_loop &1313 bd bf 25 LDA &25bf,X ; objects_location - 1 &1316 f0 0d BEQ &1325 ; is_carrying_object ; check_if_carrying &1318 c9 c8 CMP #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &131a f0 09 BEQ &1325 ; is_carrying_object &131c c9 ff CMP #&ff ; ROOM_IN_HOLDALL &131e d0 17 BNE &1337 ; consider_next_object &1320 ad c0 25 LDA &25c0 ; objects_location + 0 (OBJECT_HOLDALL) &1323 d0 f3 BNE &1318 ; check_if_carrying ; is_carrying_object &1325 bd 7f 25 LDA &257f,X ; objects_description - 1 &1328 a8 TAY &1329 b9 54 26 LDA &2654,Y ; object_descriptions_score &132c 18 CLC &132d 65 60 ADC &60 ; number_low &132f 85 60 STA &60 ; number_low &1331 90 04 BCC &1337 ; skip_overflow &1333 e6 61 INC &61 ; number_high &1335 e6 28 INC &28 ; score_high ; skip_overflow ; consider_next_object &1337 ca DEX &1338 d0 d9 BNE &1313 ; score_objects_loop &133a 4c a4 12 JMP &12a4 ; write_number ; give_player_object # Called with X = object &133d 86 10 STX &10 ; object &133f 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1342 87 48 c9 00 ; "You are given" &1346 a6 10 LDX &10 ; object &1348 20 dd 24 JSR &24dd ; write_object_name &134b 20 fa 20 JSR &20fa ; end_sentence_and_write_newline &134e a6 10 LDX &10 ; object &1350 a0 c8 LDY #&c8 ; ROOM_CARRYING + 0 (CHARACTER_PLAYER) &1352 98 TYA # Set to negative to set object location &1353 4c 6c 1b JMP &1b6c ; set_object_location ; handle_help &1356 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1359 81 ec 5d 8e 39 00 ; "I understand the following ," &135f 20 51 3b JSR &3b51 ; write_newline &1362 a9 2e LDA #&2e ; "help" &1364 85 60 STA &60 ; verb_to_list ; list_verbs_loop &1366 a5 60 LDA &60 ; verb_to_list &1368 c9 0e CMP #&0e ; "swest" + 1 &136a 90 07 BCC &1373 ; end_of_list &136c 20 d9 1f JSR &1fd9 ; write_word_from_dictionary_one &136f c6 60 DEC &60 ; verb_to_list &1371 d0 f3 BNE &1366 ; list_verbs_loop ; end_of_list &1373 20 51 3b JSR &3b51 ; write_newline &1376 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &1379 3c 82 ed 00 ; "and any direction" &137d 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; crystal_ball_pictures_table &1380 38 ; PICTURE_38 &1381 35 ; PICTURE_35 &1382 40 ; PICTURE_40 &1383 5b ; PICTURE_5b &1384 38 ; PICTURE_38 &1385 97 ; ROOM_97 ("on The Crystal Bridge") ; &1386 32 ; PICTURE_32 &1387 31 ; PICTURE_31 &1388 3e ; PICTURE_3e &1389 5a ; PICTURE_5a &138a 32 ; PICTURE_32 &138b 33 ; ROOM_33 ("diving down a dangerous fall") ; crystal_ball_rooms_table &138c 1e ; ROOM_1e ("at the west end of the canyon") &138d 1d ; ROOM_1d ("on the canyon floor") &138e 19 ; ROOM_19 ("on the south edge of a deep fissure") &138f 23 ; ROOM_23 ("on the edge of a deep fissure") &1390 87 ; ROOM_87 ("in a narrow fissure") ; handle_wave &1391 20 df 12 JSR &12df ; check_for_object_carried_by_player &1394 d0 12 BNE &13a8 ; handle_wave_carried_object &1396 a5 84 LDA &84 ; number_of_words_in_input &1398 c9 02 CMP #&02 &139a 90 03 BCC &139f ; write_nothing_happens ; handle_wave_words &139c 20 f6 15 JSR &15f6 ; write_you_havent_got_that # Doesn't return ; write_nothing_happens &139f 20 ce 14 JSR &14ce ; write_string_using_dictionary_two &13a2 8f ee 00 ; "Nothing happens" &13a5 4c fa 20 JMP &20fa ; end_sentence_and_write_newline ; handle_wave_carried_object &13a8 a5 63 LDA &63 ; input_object &13aa c9 08 CMP #&08 ; OBJECT_CRYSTAL_BALL &13ac d0 f1 BNE &139f ; write_nothing_happens ; handle_wave_crystal_ball &13ae a5 89 LDA &89 ; player_room &13b0 c9 19 CMP #&19 ; ROOM_19 ("on the south edge of a deep fissure") &13b2 f0 04 BEQ &13b8 ; handle_wave_crystal_ball_at_edge_of_fissure &13b4 c9 23 CMP #&23 ; ROOM_23 ("on the edge of a deep fissure") &13b6 d0 e7 BNE &139f ; write_nothing_happens ; handle_wave_crystal_ball_at_edge_of_fissure &13b8 a5 03 LDA &03 ; crystal_bridge_state # Non-zero if bridge is absent &13ba d0 04 BNE &13c0 ; add_bridge ; remove_bridge &13bc a2 06 LDX #&06 # Set to non-zero to indicate bridge is absent &13be d0 02 BNE &13c2 ; set_crystal_bridge_state # Always branches ; add_bridge &13c0 a2 00 LDX #&00 # Set to zero to indicate bridge is present ; set_03 &13c2 86 03 STX &03 ; crystal_bridge_state &13c4 a0 00 LDY #&00 &13c6 84 62 STY &62 ; offset ; set_pictures_loop &13c8 b9 8c 13 LDA &138c,Y ; crystal_ball_rooms_table &13cb a8 TAY &13cc bd 80 13 LDA &1380,X ; crystal_ball_pictures_table &13cf 99 00 1f STA &1f00,Y ; room_pictures_table &13d2 e6 62 INC &62 ; offset &13d4 e8 INX &13d5 a4 62 LDY &62 ; offset &13d7 c0 05 CPY #&05 &13d9 d0 ed BNE &13c8 ; set_pictures_loop &13db a5 89 LDA &89 ; player_room &13dd 48 PHA ; player_room &13de bd 80 13 LDA &1380,X ; crystal_ball_pictures_table &13e1 85 62 STA &62 ; destination &13e3 a9 19 LDA #&19 ; ROOM_19 ("on the south edge of a deep fissure") &13e5 20 f3 13 JSR &13f3 ; set_first_exit_destination &13e8 a9 23 LDA #&23 ; ROOM_23 ("on the edge of a deep fissure") &13ea 20 f3 13 JSR &13f3 ; set_first_exit_destination &13ed 68 PLA ; player_room &13ee 85 89 STA &89 ; player_room &13f0 4c 17 25 JMP &2517 ; draw_room_picture ; set_first_exit_destination # Called with A = room to change &13f3 85 89 STA &89 ; player_room &13f5 20 fb 24 JSR &24fb ; get_room_exit_count_and_data_offset &13f8 a4 7b LDY &7b ; room_data_offset &13fa c8 INY # Move to second byte (room) of first exit &13fb a5 62 LDA &62 ; destination &13fd 91 77 STA (&77),Y ; room_data_address &13ff 60 RTS