Palace of Magic disassembly =========================== Written by Martyn Howard, Palace of Magic was published by Superior Software for the BBC Micro in 1987. Like its spiritual predecessor, Citadel, it is a platform game that requires the player to solve puzzles in a castle. The following disassembly was created by reverse engineering a binary image, 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 =============== Palace of Magic is internally much simpler than Citadel. Rooms are defined as arrays of blocks, packed using the same run-length encoding scheme as some of the sprites. Sprites for the player and enemies are stored uncompressed. Interesting Pokes ================= &314a = &60 player is invulnerable &28ba = &ea, &28bb = &ea player can open gates without keys &2080 = &12 player can jump high without magic boots &2841 = &ea, &2842 = &ea, &2846 = &ea, &2847 = &ea player destroys all enemies on contact &2ea6 = &38 player can remove puzzle obstacles without objects &3221 = &16 rooms are always illuminated Disassembly =========== &0100-0137 enemies (8x7) &0100 enemies_screen_address_low &0101 enemies_screen_address_high &0102 enemies_sprite &0103 enemies_flags 8....... enemy moves horizontally (0) or vertically (1) .4...... enemy moves slowly (0) or fast (1) ..2..... unused copy of frame ...1.... enemy moves left/up (0) or right/down (1) .....421 enemy animation (top bit determines frame) &0104 enemies_maximum &0105 enemies_minimum &0106 enemies_x &0107 enemies_y &0138-015f stack &0160-0167 sound block &0168-0169 unused &016a-016c room_colours &016d-0184 ropes (2x12; one for each column of blocks) &016d ropes_screen_address_low &016e ropes_screen_address_high 8....... rope is shortening (0) or lengthening (1) &0185-0186 unused &0187-01fe room_blocks (12x10) ; $.POM2 ff1900 ff63a0 ff4bf7 ; effects_of_objects_in_specific_rooms_table ; rx ry address &03ec 03 0d 47 2b ; &2b47 = object_dropped_in_the_west_tower_middle &03f0 03 07 af 2b ; &2baf = object_dropped_in_the_west_exit &03f4 0e 02 e9 2b ; &2be9 = object_dropped_in_the_dungeons &03f8 03 0e fe 2b ; &2bfe = object_dropped_in_the_west_tower_top &03fc 00 07 48 2c ; &2c48 = object_dropped_in_the_transporter ; magic_hat_locations ; rx ry screen &0400 07 0a 70 61 &0404 03 07 60 74 &0408 04 09 80 6f &040c 03 09 30 6e &0410 08 06 30 5c &0414 0a 06 10 61 &0418 0a 03 60 65 &041c 0a 08 b0 78 &0420 00 07 30 77 &0424 0c 02 20 78 &0428 0d 01 60 6e &042c 03 0c 00 6b &0430 05 0b e0 69 &0434 06 07 70 58 &0438 06 06 e0 69 &043c 15 07 60 77 &0440 10 08 60 5c &0444 11 05 30 77 &0448 10 01 e0 69 &044c 08 08 e0 60 ; plot_character &0450 85 93 STA &93 ; offset &0452 0a ASL A &0453 0a ASL A &0454 65 93 ADC &93 ; offset # Six bytes per character &0456 a8 TAY &0457 a2 00 LDX #&00 &0459 b9 00 06 LDA &0600,Y ; character_font ; copy_character_data_loop &045c 9d 9a 04 STA &049a,X ; character_data &045f c8 INY &0460 e8 INX &0461 e0 05 CPX #&05 &0463 d0 f4 BNE &0459 ; copy_character_data_loop &0465 a0 00 LDY #&00 &0467 a2 00 LDX #&00 &0469 a9 03 LDA #&03 &046b 85 95 STA &95 ; columns_remaining ; plot_character_horizontal_loop &046d a9 08 LDA #&08 &046f 85 94 STA &94 ; rows_remaining ; plot_character_vertical_loop &0471 a9 00 LDA #&00 &0473 1e 9a 04 ASL &049a,X ; character_data # Two bytes per column of 2x8 pixels &0476 2a ROL A &0477 1e 9b 04 ASL &049b,X ; character_data + 1 &047a 2a ROL A &047b 85 93 STA &93 ; pixel_value # Get two bits of character data for pixels &047d 09 04 ORA #&04 ; calculate_pixel_value_loop # Multiply by &55, i.e. to use colour 15 &047f 0a ASL A &0480 0a ASL A &0481 05 93 ORA &93 ; pixel_value &0483 90 fa BCC &047f ; calculate_pixel_value_loop &0485 25 92 AND &92 ; character_colour &0487 91 90 STA (&90),Y ; screen_address &0489 e6 90 INC &90 ; screen_address_low &048b d0 02 BNE &048f &048d e6 91 INC &91 ; screen_address_high &048f c6 94 DEC &94 ; rows_remaining &0491 d0 de BNE &0471 ; plot_character_vertical_loop &0493 e8 INX &0494 e8 INX &0495 c6 95 DEC &95 ; columns_remaining &0497 d0 d4 BNE &046d ; plot_character_horizontal_loop &0499 60 RTS ; character_data &049a 00 00 00 00 00 00 ; unpacked_sprite_buffer &04a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &04b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &04c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &04d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &04e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &04f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 rx ry scrad sp pl bl unused ; initial_object_table &0500 ff 00 00 00 35 00 00 00 ; object &00 SWORD &0508 11 01 50 6f 2b 00 0f 00 ; object &01 BOWL climbable &0510 0a 0a 90 77 32 00 0f 00 ; object &02 BRICK_WITH_HOLE climbable &0518 05 07 90 5c 33 c0 00 00 ; object &03 CANDLE &0520 0d 00 20 78 34 00 00 00 ; object &04 FROG &0528 04 07 50 78 36 00 0f 00 ; object &05 COILED_ROPE climbable &0530 09 09 e0 66 31 00 00 00 ; object &06 MAGIC_BOOTS &0538 1a 07 20 78 27 00 0f 00 ; object &07 TREASURE climbable &0540 08 07 00 74 29 00 00 00 ; object &08 GOLD &0548 12 08 80 78 2a 00 00 00 ; object &09 HALO &0550 04 0b c0 77 2f 00 00 00 ; object &0a FIGURINE &0558 04 08 e0 60 30 00 00 00 ; object &0b CROSS &0560 05 08 c0 77 2e 00 03 00 ; object &0c GATE_YR obstacle &0568 10 07 50 66 2d 00 00 00 ; object &0d KEY_YR &0570 12 07 90 74 2e 0c 03 00 ; object &0e GATE_RY obstacle &0578 03 0d c0 6e 2d 0c 00 00 ; object &0f KEY_RY &0580 09 06 80 60 2e 30 03 00 ; object &10 GATE_WM obstacle &0588 1a 07 f0 6e 2d 30 00 00 ; object &11 KEY_WM &0590 08 09 40 73 2e 33 03 00 ; object &12 GATE_CB obstacle &0598 03 07 60 77 2d 33 00 00 ; object &13 KEY_CB &05a0 07 06 80 5d 2e 3c 03 00 ; object &14 GATE_MW obstacle &05a8 08 0a a0 73 2d 3c 00 00 ; object &15 KEY_MW &05b0 0f 01 90 5c 2e 3f 03 00 ; object &16 GATE_BC obstacle &05b8 09 07 80 78 2d 3f 00 00 ; object &17 KEY_BC &05c0 03 08 e0 78 2e c3 03 00 ; object &18 GATE_WG obstacle &05c8 09 0a b0 6f 2d c3 00 00 ; object &19 KEY_WG &05d0 11 06 80 78 2e cf 03 00 ; object &1a GATE_GW obstacle &05d8 06 08 10 58 2d cf 00 00 ; object &1b KEY_GW ; unused &05e0 00 00 00 00 00 00 00 00 ; puzzle_block_routines_table &05e8 2e 9e 28 ; &289e ; handle_gate &05eb f5 51 2e ; &2e51 ; handle_magic_hat &05ee f6 67 2d ; &2d67 ; handle_tower_guard &05f1 f7 a8 2d ; &2da8 ; handle_priest &05f4 f8 ba 2d ; &2dba ; handle_imp &05f7 f9 e4 2d ; &2de4 ; handle_princess &05fa fa 8e 2d ; &2d8e ; handle_final_guard &05fd fc 18 2e ; &2e18 ; handle_firepit ; character_font &0600 fe 82 82 9e fe ; &00 = "0" &0605 00 1e fe 00 00 ; &01 = "1" &060a de 9e 92 92 f2 ; &02 = "2" &060f c6 92 92 fe 1e ; &03 = "3" &0614 f8 88 8e fe 08 ; &04 = "4" &0619 f6 92 92 9e 9e ; &05 = "5" &061e fe 92 92 9e de ; &06 = "6" &0623 80 80 80 9e fe ; &07 = "7" &0628 1e f2 92 fe 1e ; &08 = "8" &062d f0 90 90 9e fe ; &09 = "9" &0632 1e fe 90 f0 1e ; &0a = "A" &0637 fe 9e 92 f2 1e ; &0b = "B" &063c fe 9e 82 82 c6 ; &0c = "C" &0641 fe 9e 82 82 fe ; &0d = "D" &0646 fe 9e 92 92 92 ; &0e = "E" &064b fe 9e 90 90 90 ; &0f = "F" &0650 fe 9e 82 92 de ; &10 = "G" &0655 fe 1e 10 10 fe ; &11 = "H" &065a 00 fe 1e 00 00 ; &12 = "I" &065f 06 02 02 fe 1e ; &13 = "J" &0664 fe 1e 10 f0 1e ; &14 = "K" &0669 fe 1e 02 02 02 ; &15 = "L" &066e fe 8e e0 80 fe ; &16 = "M" &0673 fe 9e 80 80 fe ; &17 = "N" &0678 fe 82 82 e2 fe ; &18 = "O" &067d fe 9e 90 90 f0 ; &19 = "P" &0682 fe 82 86 86 fe ; &1a = "Q" &0687 fe 9e 90 f0 1e ; &1b = "R" &068c f6 92 92 9e de ; &1c = "S" &0691 80 80 fe 9e 80 ; &1d = "T" &0696 fe 3e 02 02 fe ; &1e = "U" &069b f0 fe 02 0e f8 ; &1f = "V" &06a0 fe e2 0e 02 fe ; &20 = "W" &06a5 ee 1e 10 10 ee ; &21 = "X" &06aa f0 f0 1e 10 f0 ; &22 = "Y" &06af de 9e 92 92 f6 ; &23 = "Z" &06b4 00 06 02 00 00 ; &24 = "," &06b9 66 0c 18 30 66 ; &25 = "%" &06be 00 fa 3a 00 00 ; &26 = "!" &06c3 00 66 00 00 00 ; &27 = ":" &06c8 00 00 00 00 00 ; &28 = " " ; unused &06cd 00 00 00 ; plot_sprite &06d0 a5 94 LDA &94 ; screen_address_low &06d2 29 07 AND #&07 &06d4 48 PHA &06d5 49 07 EOR #&07 &06d7 aa TAX &06d8 e8 INX &06d9 86 98 STX &98 ; rows_to_plot &06db 20 00 07 JSR &0700 ; plot_sprite_row_loop &06de 20 40 07 JSR &0740 ; move_to_next_group_of_eight_rows &06e1 68 PLA &06e2 48 PHA &06e3 f0 04 BEQ &06e9 ; skip_first_group_of_rows &06e5 aa TAX &06e6 20 00 07 JSR &0700 ; plot_sprite_row_loop ; skip_first_group_of_rows &06e9 18 CLC &06ea a5 96 LDA &96 ; sprite_address_low &06ec 69 28 ADC #&28 &06ee 85 96 STA &96 ; sprite_address_low &06f0 90 02 BCC &06f4 &06f2 e6 97 INC &97 ; sprite_address_high &06f4 a6 98 LDX &98 ; rows_to_plot &06f6 20 00 07 JSR &0700 ; plot_sprite_row_loop &06f9 20 40 07 JSR &0740 ; move_to_next_group_of_eight_rows &06fc 68 PLA &06fd f0 50 BEQ &074f ; leave &06ff aa TAX ; plot_sprite_row_loop &0700 a0 00 LDY #&00 # 0 pixels right &0702 b1 96 LDA (&96),Y ; sprite_address &0704 51 94 EOR (&94),Y ; screen_address &0706 91 94 STA (&94),Y ; screen_address &0708 a0 08 LDY #&08 # 2 pixels right &070a b1 96 LDA (&96),Y ; sprite_address &070c 51 94 EOR (&94),Y ; screen_address &070e 91 94 STA (&94),Y ; screen_address &0710 a0 10 LDY #&10 # 4 pixels right &0712 b1 96 LDA (&96),Y ; sprite_address &0714 51 94 EOR (&94),Y ; screen_address &0716 91 94 STA (&94),Y ; screen_address &0718 a0 18 LDY #&18 # 6 pixels right &071a b1 96 LDA (&96),Y ; sprite_address &071c 51 94 EOR (&94),Y ; screen_address &071e 91 94 STA (&94),Y ; screen_address &0720 a0 20 LDY #&20 # 8 pixels right &0722 b1 96 LDA (&96),Y ; sprite_address &0724 51 94 EOR (&94),Y ; screen_address &0726 91 94 STA (&94),Y ; screen_address &0728 a0 28 LDY #&28 # 10 pixels right &072a b1 96 LDA (&96),Y ; sprite_address &072c 51 94 EOR (&94),Y ; screen_address &072e 91 94 STA (&94),Y ; screen_address &0730 e6 96 INC &96 ; sprite_address_low &0732 d0 02 BNE &0736 &0734 e6 97 INC &97 ; sprite_address_high &0736 e6 94 INC &94 ; screen_address_low &0738 d0 02 BNE &073c &073a e6 95 INC &95 ; screen_address_high &073c ca DEX &073d d0 c1 BNE &0700 ; plot_sprite_row_loop &073f 60 RTS ; move_to_next_group_of_eight_rows &0740 18 CLC &0741 a5 94 LDA &94 ; screen_address_low &0743 29 f8 AND #&f8 &0745 69 38 ADC #&38 &0747 85 94 STA &94 ; screen_address_low &0749 a5 95 LDA &95 ; screen_address_high &074b 69 02 ADC #&02 &074d 85 95 STA &95 ; screen_address_high ; leave &074f 60 RTS ; packed_room_titles &0750 bf 91 94 5f 76 8d c4 cf 0a 88 98 bb 92 c8 6f 24 ; "WEST TOWER" &0760 e5 d7 9c c3 3f 47 60 93 77 31 93 f8 1b 49 f9 91 ; "GUARDHOUSE" &0770 2e f2 37 40 d8 e7 81 06 88 fc e8 1c cd ce 7f 0f ; "WEST WOOD" &0780 52 02 8c a4 0f 41 22 86 d8 fc 09 48 f9 65 d7 48 ; "TRANSPORTER" &0790 fc 04 a4 fc 9a 73 f8 13 90 f2 23 5d e4 8f 8b 65 ; "WEST EXIT &07a0 c4 d9 f4 21 d0 c8 d9 f1 11 2f 11 f1 4f 5d 24 29 : "MAIN PALACE" &07b0 ff 28 2a 89 1f 81 4a d2 a7 22 12 2f f2 8f 6e 00 ; "ROOFTOP" &07c0 fd b8 2b 89 7c 44 b4 06 f1 37 92 f2 f3 40 03 44 ; "PASSAGES" &07d0 3e 01 29 3f 0f 34 40 e4 67 d7 48 7c 10 24 f2 01 ; "BASEMENT" ; "EAST TOWER" ; "EAST WOOD" ; "EAST EXIT" ; "DUNGEONS" ; "BALCONY" ; "CHURCH" ; "FOREST" ; "RIVER" ; "CAVES" ; "FIREPIT" ; "ROYAL HOUSE" ; "CELLAR" ; "WEST PALACE" ; "EAST PALACE" ; "TOWER BASE" ; unused &07e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &07f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; OS sound workspace &0800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0830 00 00 00 00 00 00 00 00 ff 00 00 00 00 00 00 00 &0840 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0850 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0860 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0870 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; play_sound &0880 8e 64 01 STX &0164 ; sound_pitch &0883 8c 66 01 STY &0166 ; sound_duration &0886 48 PHA &0887 29 0f AND #&0f &0889 8d 62 01 STA &0162 ; sound_volume &088c 68 PLA &088d 4a LSR A &088e 4a LSR A &088f 4a LSR A &0890 4a LSR A &0891 8d 60 01 STA &0160 ; sound_channel &0894 49 03 EOR #&03 &0896 18 CLC &0897 69 f8 ADC #&f8 &0899 aa TAX &089a a9 80 LDA #&80 ; Read I/O device or buffer status &089c a0 ff LDY #&ff &089e 20 f4 ff JSR &fff4 ; OSBYTE &08a1 e0 0f CPX #&0f &08a3 b0 01 BCS &08a6 ; play_sound_then_silence &08a5 60 RTS ; play_sound_then_silence &08a6 20 b4 08 JSR &08b4 ; play_sound_from_block &08a9 a9 00 LDA #&00 &08ab 8d 62 01 STA &0162 ; sound_volume &08ae 8d 64 01 STA &0164 ; sound_pitch &08b1 8d 66 01 STA &0166 ; sound_duration ; play_sound_from_block &08b4 a2 60 LDX #&60 &08b6 a0 01 LDY #&01 ; &0160 = sound_block &08b8 a9 07 LDA #&07 ; Generate a sound &08ba 4c f1 ff JMP &fff1 ; OSWORD ; unused &08bd 00 00 00 ; OS envelope storage area &08c0 01 ff 01 01 01 02 00 7f f6 00 f6 7e 00 64 01 ff ; envelope 1 &08d0 02 01 f6 00 6e 0b 00 7f ff 00 ff 7e 00 64 3d ff ; envelope 2 &08e0 81 02 88 00 78 02 00 7e fe 00 00 7e 00 01 1d ff ; envelope 3 &08f0 03 fe 02 fe 02 07 08 14 ff 00 00 7e 00 55 6d ff ; envelope 4 ; packed_background_sprite_data ; background sprite &00 - BRICK_PLINTH &0900 43 74 90 07 78 42 00 38 c8 03 28 21 00 1c e4 01 &0910 9e 10 00 0e f2 00 4f 08 00 07 79 00 25 04 c0 83 &0920 3c c0 13 02 30 21 c0 13 02 30 21 80 12 02 10 21 &0930 c0 13 02 30 21 c0 13 02 30 21 80 12 02 30 21 c0 &0940 13 02 00 ; background sprite &01 - STONE_PLINTH &0943 4b 00 3a c8 6b 28 41 20 08 07 79 95 02 eb 01 80 &0953 83 3c 14 c1 f1 00 c0 41 9e e7 f5 04 01 70 90 57 &0963 29 b0 1e 00 3c c8 73 42 05 00 ea 89 28 00 0f 45 &0973 0b 09 72 1e 40 b0 88 00 41 c5 03 f2 7a 34 14 80 &0983 87 e2 a1 04 3d 0f 20 58 44 00 00 ; background sprite &02 - BRICK &098e 3e 4c 08 f0 84 00 4c 08 a0 84 00 44 08 f0 84 00 &099e 4c 08 f0 84 00 4c 08 a0 84 00 4c 08 f0 84 00 4c &09ae 08 f0 84 00 4c 08 a0 84 00 44 08 f0 84 00 4c 08 &09be f0 84 00 4c 08 a0 84 00 4c 08 f0 84 00 00 ; background sprite &03 - STONE &09cc 4c 40 50 89 00 c1 07 e5 51 04 59 0f 20 a8 f0 a0 &09dc 08 8e 07 e0 51 00 79 5e 0f 05 e0 51 50 54 0a ac &09ec 07 a0 f0 f0 38 9e 60 01 a0 78 40 5e 8f 86 02 f0 &09fc 50 b4 90 20 e7 01 04 8b 08 10 54 3c 20 af 47 43 &0a0c 01 78 28 5a 4a d0 f3 00 82 45 04 00 ; background sprite &04 - BRICK_BOTTOM_LEFT &0a18 2e 04 26 08 78 42 40 88 00 50 42 40 b4 f0 00 1a &0a28 4c 08 f0 84 00 4c 08 a0 84 00 44 08 f0 84 00 04 &0a38 26 08 78 42 40 88 00 50 42 40 b4 f0 00 00 ; background sprite &05 - STONE_BOTTOM_LEFT &0a46 34 00 25 0a 84 0a 9a 0e 25 f5 00 22 05 cd 03 68 &0a56 2a 0a 98 43 41 01 28 3c 41 ce 13 2c 00 41 25 08 &0a66 52 08 80 60 e1 b1 a0 b1 0a 09 20 54 50 2c 48 0f &0a76 20 5a 04 01 ; background sprite &06 - BRICK_TOP_RIGHT &0a7a 2e 0c 04 10 25 42 00 05 10 62 42 80 27 a8 00 30 &0a8a 21 c0 13 02 30 21 80 12 02 30 21 c0 13 02 1a 0c &0a9a 04 10 65 42 00 05 10 62 42 80 27 a8 00 00 ; background sprite &07 - STONE_TOP_RIGHT &0aa8 30 00 25 08 44 1f a4 87 02 08 3f 12 1c cd 43 01 &0ab8 84 8a 20 a4 08 01 14 85 d6 a3 f4 50 00 0a 1b 95 &0ac8 c6 f1 28 00 83 86 12 04 22 05 cd e3 f3 50 00 00 ; background sprite &08 - BRICK_TOP_LEFT &0ad8 2d 4c 08 f0 84 00 4c 08 a0 84 00 44 08 f0 84 00 &0ae8 4c 08 f0 04 0b 00 26 04 28 00 21 06 01 88 32 21 &0af8 c0 13 2c 00 98 10 a0 00 84 18 04 a0 0b ; background sprite &09 - STONE_TOP_LEFT &0b05 33 40 50 89 00 c1 27 d8 78 34 0a 0f c0 c3 a3 f0 &0b15 3c c1 02 40 f1 28 b4 1e 9b 02 e0 31 58 14 80 70 &0b25 11 04 a2 8a 27 58 68 45 80 e0 e3 f5 28 00 e1 07 &0b35 05 e8 00 ; background sprite &0a - BRICK_BOTTOM_RIGHT &0b38 2e 40 47 09 02 21 04 40 09 01 10 4c 10 f0 84 80 &0b48 a8 e2 01 84 10 00 25 04 04 89 20 e0 09 01 98 10 &0b58 e0 09 01 98 10 40 09 01 98 10 e0 09 01 00 ; background sprite &0b - STONE_BOTTOM_RIGHT &0b66 31 40 47 09 36 80 a0 02 d4 c8 35 7a 80 82 c7 f1 &0b76 58 7c 20 40 4c 01 84 15 af 96 0b a0 78 1c 5e a9 &0b86 c7 07 08 16 11 20 a8 28 3c 1a a5 96 02 08 16 11 &0b96 00 ; background sprite &0c - CLOUD &0b97 4e 00 d5 17 54 01 54 7f f0 01 50 bd 7e 5f 10 f0 &0ba7 fa 82 7f e4 f5 07 bf 60 45 01 a8 3c 3e af 9f e2 &0bb7 05 a8 fc d4 e0 ab 02 f8 a8 00 8a ca 47 0d be 7e &0bc7 af 8f 4a f1 ab fc 91 cf e3 a7 fa 83 85 df a7 00 &0bd7 f8 fc 00 aa df e3 07 04 2b 7f b0 0a 02 41 ; background sprite &0d - GRASS &0be5 2d 00 04 13 62 31 41 02 82 89 b8 08 4c d0 c5 44 &0bf5 08 4c 14 41 60 82 1c 26 04 40 30 11 17 c3 c5 24 &0c05 59 4c 98 c5 44 59 4c aa c3 c4 59 4c 10 ; background sprite &0e - LADDER &0c12 3f 68 9c c2 83 51 41 1e 8c 02 e0 c1 80 20 0f 06 &0c22 04 79 30 20 c8 83 01 50 3c 18 1a e4 c1 50 54 1c &0c32 8d 53 78 30 2a c8 83 51 00 3c 18 10 e4 c1 80 20 &0c42 0f 06 04 79 30 00 8a 07 43 83 3c 18 8a 8a 03 ; background sprite &0f - ROPE &0c51 0d 40 1e 8d 43 71 a0 8f c6 a1 38 90 07 ; background sprite &10 - PILLAR_BASE &0c5e 21 40 5c 8d 7f f1 23 1e c4 81 ac 42 8d 7e 1e bf &0c6e 2f a2 7a fc 8e 48 e5 f1 0b 22 af c7 0f 88 16 2a &0c7e 00 ; background sprite &11 - PILLAR_COLUMN &0c7f 13 40 5c 8d 7f f1 23 1e c4 81 bc 1a ff e2 47 3c &0c8f 88 03 71 ; background sprite &12 - PILLAR_TOP &0c92 21 2a 05 10 fd 3d 3e 6a e4 f7 50 7d 91 df a3 72 &0ca2 44 7e 8f 57 10 a9 14 80 ac 1a ff e2 47 3c 88 03 &0cb2 71 ; background sprite &13 - SHIELD &0cb3 42 8f 52 1b 3a 82 ad 07 03 43 e3 0d 41 de c3 08 &0cc3 49 c2 a0 e4 91 84 42 52 30 f4 60 90 70 bc 21 c8 &0cd3 7b 68 bc d0 12 f4 b4 94 20 10 a1 61 18 4d 50 09 &0ce3 02 8c d8 23 89 3d 70 24 86 13 2c 82 00 4f 11 04 &0cf3 22 00 ; background sprite &14 - TREE_TRUNK_BASE &0cf5 2b 40 1e 0e 91 41 18 19 84 83 58 10 44 82 83 40 &0d05 0b 04 40 c0 20 24 18 19 84 c3 24 10 0c 43 80 61 &0d12 08 40 08 0a c2 41 12 10 25 00 00 ; background sprite &15 - TREE_TRUNK_MIDDLE_ONE &0d20 2a 40 1e 46 82 91 21 38 88 85 60 18 18 16 04 42 &0d30 08 12 08 c3 00 42 04 04 83 00 14 c8 20 8c 04 87 &0d40 48 30 10 16 84 61 41 04 90 07 ; background sprite &16 - TREE_TRUNK_MIDDLE_TWO &0d4a 36 40 1e 46 06 61 24 38 82 05 e1 20 01 04 44 10 &0d5a 24 18 10 26 30 30 0c 04 83 0c 32 10 40 88 c0 80 &0d6a 83 24 20 08 07 41 70 08 44 22 80 30 30 2c 08 23 &0d7a 31 80 18 01 88 01 ; background sprite &17 - TREE_LEFT &0d80 31 40 09 09 01 61 06 06 46 62 80 10 00 0c 89 09 &0d90 c2 48 4c 90 0c 62 41 26 08 14 90 10 10 66 82 24 &0da0 18 86 00 04 61 24 18 06 09 01 18 18 18 09 0b 31 &0db0 00 ; background sprite &18 - TREE_TOP &0db1 4d 4c 90 c4 04 49 4c 10 40 20 61 41 02 82 80 04 &0dc1 99 30 12 64 82 18 32 88 21 11 00 44 90 09 92 18 &0dd1 08 20 c8 84 b1 20 1c 24 31 21 22 04 80 83 64 90 &0de1 01 60 82 64 10 0b c2 41 02 16 64 82 64 10 c6 40 &0df1 30 48 30 08 01 c0 80 83 18 26 48 00 00 ; background sprite &19 - TREE_RIGHT &0dfe 34 00 04 13 24 31 41 12 82 81 21 61 41 18 86 08 &0e0e 02 18 24 18 86 01 04 09 4c 10 0a 02 05 12 0c c3 &0e1e 84 10 00 06 06 46 62 42 44 90 04 23 61 88 20 10 &0e2e 22 82 40 19 ; background sprite &1a - SPIKES &0e32 2b 40 56 0d 02 99 2a 04 e4 91 b0 cb f1 04 91 20 &0e42 13 72 3c 41 35 88 84 9f 20 11 6e 82 4f 10 08 55 &0e52 8a e0 13 ac 82 04 46 13 7c 82 00 ; background sprite &1b - SWORDS &0e5d 39 40 18 0d 02 51 0a 8b 83 02 a2 14 16 10 45 21 &0e6d 80 30 8a c3 a2 00 61 2a 08 44 15 4f b0 00 28 b4 &0e7d 1a 4f 50 01 e0 a0 08 14 20 4c 61 71 50 40 44 e1 &0e8d 71 3c c1 02 10 29 3c 41 05 ; background sprite &1c - PRINCESS_HEAD &0e96 26 40 4c 01 50 42 4f 18 10 11 01 8a d0 03 08 45 &0ea6 66 22 a0 a8 00 82 22 20 24 7a a4 72 73 50 b4 05 &0eb6 1f 7c a4 0d 02 75 ; background sprite &1d - TOWER_GUARD &0ebc 38 40 42 09 a3 f8 e0 13 3c 83 0f 1e 1d 7c cc 76 &0ecc b3 13 0f 07 03 a8 22 40 88 02 ab fc 2a 54 38 02 &0edc c4 f9 10 4a 01 84 f8 f0 13 64 82 30 3e f4 28 10 &0eec 18 32 2a 08 44 22 54 0c ; background sprite &1e - PRIEST &0ef4 25 40 1e b4 07 e7 a0 48 0d c2 ea e0 1c fa 83 00 &0f04 28 0c 54 85 30 60 08 ad e6 e0 10 bd 0c a1 20 34 &0f14 44 80 68 10 04 ; background sprite &1f - IMP &0f19 25 00 35 08 44 fe 30 13 32 fc 80 e0 8f c0 48 0c &0f29 00 55 10 e8 30 21 24 28 86 06 06 22 04 98 83 01 &0f39 20 12 05 81 3c ; background sprite &20 - PRINCESS_BODY &0f3e 22 33 25 b8 07 95 d0 e6 f1 fa 83 4f 88 d7 fb 83 &0f4e 9f 27 04 84 8a 08 90 57 42 4f 07 08 17 c1 27 08 &0f5e c4 01 ; background sprite &21 - WATER &0f60 13 83 c5 10 05 2c 86 e8 61 88 05 16 43 54 31 c4 &0f70 02 c3 0d ; background sprite &22 - FIRE &0f73 54 40 50 40 01 48 00 29 20 28 40 05 00 90 15 40 &0f83 00 90 a4 50 bc 15 05 40 01 84 02 3d 1f 80 02 50 &0f93 05 2c 81 14 10 44 01 2a 82 4a a0 67 41 83 96 41 &0fa3 8f 0f a6 7c bc 1f 4f b0 06 7d 3d 3f d8 fb 55 7c &0fb3 7d f0 e7 fb 5d 7e 16 de ea 62 b9 fc c1 d4 ee 82 &0fc3 b2 f0 28 29 ; background sprite &23 - BRIDGE_TOP &0fc7 1b 40 34 16 01 a2 10 10 50 05 41 80 a8 4c 14 c5 &0fd8 81 38 04 04 44 41 10 20 2b c6 01 ; background sprite &24 - FINAL_GUARD &0fe2 2c 00 10 14 02 42 70 84 0f da 00 10 38 e4 9b 83 &0ff2 aa 1f 1a ce a1 00 15 a0 8a 20 83 0c 05 18 22 30 &1002 60 8c 02 10 84 a1 41 18 1a 01 f2 00 ; background sprite &25 - BRIDGE_BASE &100e 15 73 10 88 ce 21 20 32 87 81 f0 1c 06 c2 73 08 &101e 88 cc 41 e0 0a ; background sprite &26 - TELEPORTER &1023 30 73 44 04 04 23 00 31 38 87 22 73 28 06 87 40 &1033 73 48 06 87 20 22 40 14 9c 43 a2 39 12 01 92 11 &1043 11 10 05 83 4a 10 08 43 c1 22 08 84 45 11 20 0b ; background sprite &27 - TREASURE &1053 3d 40 08 8c 00 40 ba 5b 0d 06 00 01 60 09 d6 08 &1063 06 80 01 60 06 8a 0d 06 80 01 20 b5 04 07 06 80 &1073 00 21 28 02 c6 00 60 14 00 e3 51 f0 20 1c 04 c0 &1083 78 28 3a 08 07 01 30 28 0a 80 41 31 00 ; background sprite &28 - MAGIC_HAT &1090 31 40 54 05 04 05 00 0a 10 fc a9 00 28 20 18 00 &10a0 fc 41 20 44 01 82 7f 10 40 01 08 80 e0 af 02 44 &10b0 2b 40 42 8d 01 fe a0 1a 02 fc 00 7f 0c 50 c5 80 &10c0 04 ; background sprite &29 - GOLD &10c1 23 c0 09 0d f2 41 20 c4 f3 f1 7a 3c 20 c4 87 7c &10d1 3c 20 c4 eb f1 7c 3c 20 c4 eb f1 7c 3c 20 4c 05 &10e1 f9 20 00 ; background sprite &2a - HALO &10e4 2b 40 54 0d 02 21 55 15 04 c2 aa 0a 10 ad a8 80 &10f4 58 45 0d 02 f1 2a a8 02 e2 55 50 05 c4 2a 2a 20 &1104 aa aa 00 61 35 58 01 c2 15 20 06 ; background sprite &2b - BOWL &110f 3c 40 48 51 04 9f 20 10 54 14 80 d0 03 08 3e 80 &111f 70 01 08 3e 80 b0 02 08 16 14 40 e8 01 84 0a 4a &112f f0 09 2a 21 20 f2 44 14 40 f0 89 29 9e f0 61 f0 &113f 28 1c c1 25 f8 28 00 c1 22 04 44 00 ; background sprite &2c - FULL_BOWL &114b 41 40 48 51 04 9f 20 10 54 14 54 3f 55 01 08 3e &115b 00 7f 48 05 04 1f 80 3f 54 01 82 05 45 e5 57 51 &116b 00 a1 82 12 7c 82 4a 08 88 3c 11 05 10 2c 3c 51 &117b 25 f8 84 0e 83 47 e1 08 2e c1 47 01 08 16 21 20 &118b 02 ; background sprite &2d - KEY &118c 24 c0 0c 05 c4 28 40 10 0d 02 51 1e 8c 46 05 81 &119c 10 0f 06 85 80 10 0f 06 84 a9 10 14 02 01 d0 10 &11ac 18 82 00 00 ; background sprite &2e - GATE &11b0 4a 28 1e 1a e2 a1 40 00 1e 10 e2 01 41 0a 8f 0a &11c0 f1 a8 20 8a 87 86 78 68 10 c0 03 42 3c 20 48 e1 &11d0 51 21 1e 15 04 c1 c0 10 0c a4 02 c0 80 10 0c 08 &11e0 42 60 50 08 06 a9 a0 60 60 08 06 52 01 70 40 08 &11f0 06 04 29 3c 0a 14 84 41 2a 00 ; background sprite &2f - FIGURINE &11fa 2c 40 5e a1 52 a8 14 2a 85 aa f2 fa 00 c1 c2 0b &120a 68 ab 30 24 0c 49 a1 52 bc 30 24 0c e9 a3 52 a8 &121a 30 24 0c 09 08 15 30 24 0c 09 88 03 ; background sprite &30 - CROSS &1226 23 40 08 0d 03 61 1e 10 e4 01 78 54 d0 36 05 6d &1236 54 98 17 05 79 14 20 c4 43 83 3c a0 41 c5 78 54 &1246 1c c8 03 ; background sprite &31 - MAGIC_BOOTS &1249 32 40 49 8c 00 c1 19 60 0e ed 80 60 44 30 85 81 &1259 b4 18 02 c2 9b d3 66 0e 8a a1 c2 66 0e ed c1 39 &1269 28 3a cd c1 df ee f2 db 4d c1 00 e0 57 05 7f 2a &1279 20 08 ; background sprite &32 - BRICK_WITH_HOLE &127b 3a 70 08 30 87 00 70 08 10 05 81 20 14 02 22 70 &128b 08 88 c0 21 80 18 04 82 70 08 30 87 00 70 08 30 &129b 87 80 20 14 04 88 21 20 32 87 80 c8 1c 02 82 60 &12ab 10 20 86 00 70 08 30 87 00 00 ; background sprite &33 - CANDLE &12b5 23 40 5c 08 02 d1 01 6f 20 00 c3 80 00 05 00 85 &12c5 81 8e aa f2 03 23 95 9f 0a 8a a8 7e 15 20 52 51 &12d5 fd 80 38 ; background sprite &34 - FROG &12d8 3d 40 0c 01 44 19 14 20 c2 e0 00 11 06 87 c1 02 &12e8 c2 1c 06 81 01 84 09 0c 16 13 a4 30 58 4c 90 85 &12f8 04 19 2c 06 8b 41 60 10 98 20 11 44 00 18 48 98 &1308 c1 41 10 18 1c 06 81 42 04 19 04 20 06 ; background sprite &35 - SWORD &1315 22 c0 4c 01 24 51 1c 14 10 e1 31 78 40 84 c7 e0 &1325 01 11 1e 83 07 84 8a e0 13 2a 82 0a 20 a8 78 28 &1335 80 10 ; background sprite &36 - COILED_ROPE &1337 45 40 0c 05 c4 78 68 10 88 f0 80 20 15 44 01 41 &1347 1e 10 a6 a0 00 3c 20 42 41 51 41 14 00 45 41 01 &1357 50 00 1e 80 07 e0 01 78 00 1e 80 07 e0 01 78 00 &1367 1e 80 07 e0 01 78 00 1e 80 07 e0 01 78 00 0a 8a &1377 02 a0 a0 28 00 ; end of packed background sprites &137c ff ; unused &137d 00 00 00 ; enemy_sprites ; enemy sprite &00 - SPRING right frame 0 &1380 00 00 00 00 00 00 00 00 00 00 00 00 15 15 15 00 &1390 00 00 00 3f 3f 3f 3f 3f 00 00 00 3f 3f 30 30 3f &13a0 00 00 00 00 2a 2a 2a 00 00 00 00 00 00 00 00 00 &13b0 00 00 00 00 00 00 00 00 00 0c 08 0c 00 0c 08 0c &13c0 00 0c 00 0c 00 0c 00 0c 08 08 00 0c 00 0c 00 0c &13d0 00 00 00 0c 04 0c 00 0c 00 00 00 00 00 00 00 00 ; enemy sprite &01 - SPRING right frame 1 &13e0 00 00 00 00 00 00 00 00 00 15 15 15 00 00 0c 08 &13f0 3f 3f 3f 3f 3f 00 0c 00 3f 3f 30 30 3f 08 08 00 &1400 00 2a 2a 2a 00 00 00 00 00 00 00 00 00 00 00 00 &1410 00 00 00 00 00 00 00 00 08 0c 00 00 0c 08 08 0c &1420 00 0c 00 00 0c 00 00 0c 00 0c 00 00 0c 00 00 0c &1430 00 0c 04 04 0c 00 00 0c 00 00 00 00 00 00 00 00 ; enemy sprite &02 - SPRING left frame 0 &1440 00 00 00 00 00 00 00 00 00 00 00 00 15 15 15 00 &1450 00 00 00 3f 3f 30 30 3f 00 00 00 3f 3f 3f 3f 3f &1460 00 00 00 00 2a 2a 2a 00 00 00 00 00 00 00 00 00 &1470 00 00 00 00 00 00 00 00 00 00 00 0c 08 0c 00 0c &1480 04 04 00 0c 00 0c 00 0c 00 0c 00 0c 00 0c 00 0c &1490 00 0c 04 0c 00 0c 04 0c 00 00 00 00 00 00 00 00 ; enemy sprite &03 - SPRING left frame 1 &14a0 00 00 00 00 00 00 00 00 00 15 15 15 00 00 00 00 &14b0 3f 3f 30 30 3f 04 04 00 3f 3f 3f 3f 3f 00 0c 00 &14c0 00 2a 2a 2a 00 00 0c 04 00 00 00 00 00 00 00 00 &14d0 00 00 00 00 00 00 00 00 00 0c 08 08 0c 00 00 0c &14e0 00 0c 00 00 0c 00 00 0c 00 0c 00 00 0c 00 00 0c &14f0 04 0c 00 00 0c 04 04 0c 00 00 00 00 00 00 00 00 ; enemy sprite &04 - BIRD right frame 0 &1500 00 00 00 00 14 14 14 00 00 14 3c 38 34 34 30 3c &1510 3c 3c 30 34 3c 3c 30 3c 3c 28 3c 3c 38 30 34 3c &1520 00 0a 0f 3f 0f 0a 28 28 00 00 0a 2f 0a 00 00 00 &1530 00 00 2b 17 2b 17 2b 17 3c 2f 1f 02 2a 00 15 02 &1540 3c 2f 1f 01 15 01 15 01 3c 2f 1f 2b 17 2b 17 2b &1550 00 15 01 00 02 2b 17 2b 00 00 2a 01 15 2b 17 2a ; enemy sprite &05 - BIRD right frame 1 &1560 00 00 00 00 14 14 14 00 00 14 3c 38 38 34 34 34 &1570 3c 3c 30 34 3c 3c 38 38 3c 28 3c 3c 38 30 34 3c &1580 00 0a 0f 3f 0f 0a 28 28 00 00 0a 2f 0a 00 00 00 &1590 00 00 00 00 00 00 00 00 30 2f 1f 01 15 01 15 01 &15a0 34 2f 1f 2b 17 2b 17 2b 3c 2f 1f 00 02 2b 17 2b &15b0 00 2a 17 01 15 2b 17 2a 00 00 00 00 00 00 00 00 ; enemy sprite &06 - BIRD left frame 0 &15c0 00 00 05 1f 05 00 00 00 00 05 0f 3f 0f 05 14 14 &15d0 3c 14 3c 3c 34 30 38 3c 3c 3c 30 38 3c 3c 30 3c &15e0 00 28 3c 34 38 38 30 3c 00 00 00 00 28 28 28 00 &15f0 00 00 15 02 2a 17 2b 15 00 2a 02 00 01 17 2b 17 &1600 3c 1f 2f 17 2b 17 2b 17 3c 1f 2f 02 2a 02 2a 02 &1610 3c 1f 2f 01 15 00 2a 01 00 00 17 2b 17 2b 17 2b ; enemy sprite &07 - BIRD left frame 1 &1620 00 00 05 1f 05 00 00 00 00 05 0f 3f 0f 05 14 14 &1630 3c 14 3c 3c 34 30 38 3c 3c 3c 30 38 3c 3c 34 34 &1640 00 28 3c 34 34 38 38 38 00 00 00 00 28 28 28 00 &1650 00 00 00 00 00 00 00 00 00 15 2b 02 2a 17 2b 15 &1660 3c 1f 2f 00 01 17 2b 17 38 1f 2f 17 2b 17 2b 17 &1670 30 1f 2f 02 2a 02 2a 02 00 00 00 00 00 00 00 00 ; enemy sprite &08 - FIREBALL right &1680 00 00 00 00 00 00 50 cf 00 00 00 00 00 45 02 e5 &1690 00 00 00 00 50 a1 8f 0b 00 00 00 05 0f 8b 07 1b &16a0 00 00 00 0f 13 0b 47 03 00 00 00 00 0a 0a 0f 27 &16b0 a0 45 00 00 00 00 00 00 a0 05 50 00 00 00 00 00 &16c0 52 8b da 05 00 00 00 00 03 8f 47 0b 05 00 00 00 &16d0 a5 03 27 0b 0f 00 00 00 0f 0f 0a 0a 00 00 00 00 ; enemy sprite &09 - FIREBALL left &16e0 00 00 00 00 05 05 0f 1b 00 00 00 0f 23 07 8b 03 &16f0 00 00 00 0a 0f 47 0b 27 00 00 00 00 a0 52 4f 07 &1700 00 00 00 00 00 8a 01 da 00 00 00 00 00 00 a0 cf &1710 0f 0f 05 05 00 00 00 00 5a 03 1b 07 0f 00 00 00 &1720 03 4f 8b 07 0a 00 00 00 a1 47 e5 0a 00 00 00 00 &1730 50 0a a0 00 00 00 00 00 50 8a 00 00 00 00 00 00 ; enemy sprite &0a - SCOOTER_GUARD right &1740 00 00 00 00 00 00 00 00 00 14 15 14 15 00 00 04 &1750 3d 3e 3d 3e 3d 3d 0c 19 03 03 3d 00 3d 3d 08 26 &1760 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 &1770 00 00 00 00 33 33 11 00 04 04 04 00 05 27 33 33 &1780 19 0c 0c 0c 03 0b 37 37 33 33 0c 08 02 02 3f 3f &1790 0a 0a 00 3f 3f 3f 3f 00 00 00 00 00 2a 2a 00 00 ; enemy sprite &0b - SCOOTER_GUARD left &17a0 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 &17b0 03 03 3e 00 3e 3d 04 19 3e 3d 3e 3d 3e 3d 0c 26 &17c0 00 28 2a 28 2a 00 00 08 00 00 00 00 00 00 00 00 &17d0 00 00 00 00 15 15 00 00 05 05 00 3f 3f 3f 3f 00 &17e0 33 33 0c 04 01 01 3f 3f 26 0c 0c 0c 03 07 3b 3b &17f0 08 08 08 00 0a 1b 33 33 00 00 00 00 22 22 22 00 ; enemy sprite &0c - LIZARD right &1800 00 04 00 08 04 00 04 08 08 04 0c 0c 0c 0c 0c 0c &1810 04 0c 0c 2e 2e 3f 1d 1d 0c 1d 1d 0c 08 00 3f 2e &1820 08 2a 00 0c 0c 04 2e 04 00 00 00 00 08 08 0c 0c &1830 00 04 04 08 08 04 00 15 0c 04 04 19 11 04 0c 0c &1840 1d 0c 0c 33 33 0c 0c 0c 3f 3f 1d 33 33 0c 0c 0c &1850 2e 04 2a 00 00 00 08 1d 0c 0c 00 00 00 00 00 00 ; enemy sprite &0d - LIZARD left &1860 00 00 00 00 04 04 0c 0c 04 15 00 0c 0c 08 1d 08 &1870 0c 2e 2e 0c 04 00 3f 1d 08 0c 0c 1d 1d 3f 2e 2e &1880 04 08 0c 0c 0c 0c 0c 0c 00 08 00 04 08 00 08 04 &1890 0c 0c 00 00 00 00 00 00 1d 08 15 00 00 00 04 2e &18a0 3f 3f 2e 33 33 0c 0c 0c 2e 0c 0c 33 33 0c 0c 0c &18b0 0c 08 08 26 22 08 0c 0c 00 08 08 04 04 08 00 2a ; enemy sprite &0e - JUG right &18c0 04 0c 08 08 0c 1d 00 05 0c 0c 04 04 04 00 00 05 &18d0 0f 0d 08 08 08 0d 0c 0c 0f 0f 0f 0f 0a 0f 0f 0f &18e0 0f 0f 0a 00 00 0a 0f 0f 0f 00 00 00 08 0c 04 0e &18f0 0a 0a 0a 0f 05 05 00 00 0f 05 05 05 05 0a 00 00 &1900 0e 0f 0f 0f 0f 0f 05 00 0d 0d 0c 0e 0f 0f 0f 00 &1910 0f 0f 0f 0a 0f 0a 00 00 0c 0c 08 0a 0a 00 00 00 ; enemy sprite &0f - JUG left &1920 0f 00 00 00 04 04 08 0d 0f 0f 05 00 00 05 0f 0f &1930 0f 0f 0f 0f 05 0f 0f 0f 0f 0e 04 04 04 0e 0c 0c &1940 0c 0c 08 08 08 00 00 0a 08 0c 04 04 0c 2e 00 0a &1950 0c 0c 0c 05 05 00 00 00 0f 0f 0f 05 0f 05 00 00 &1960 0e 0e 0c 0d 0f 0f 0f 00 0d 0f 0f 0f 0f 0f 0a 00 &1970 0f 0a 0a 0a 0a 05 00 00 05 05 05 0f 0a 0a 00 00 ; enemy sprite &10 - RABBIT right &1980 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3f &1990 00 3f 3b 15 00 00 3f 3f 00 2a 37 3b 15 3f 3f 3f &19a0 00 00 00 2a 3f 2a 3f 3f 00 00 00 00 00 2a 2a 2a &19b0 15 15 3f 3f 3f 3f 15 00 3f 3f 2a 15 3f 3f 3f 15 &19c0 3f 3f 15 2a 2a 3f 2a 3f 3f 3f 2a 3f 3f 00 00 2a &19d0 3f 00 00 00 2a 22 00 00 00 00 00 00 00 00 00 00 ; enemy sprite &11 - RABBIT left &19e0 00 00 00 00 00 15 15 15 00 00 00 15 3f 15 3f 3f &19f0 00 15 3b 37 2a 3f 3f 3f 00 3f 37 2a 00 00 3f 3f &1a00 00 00 00 00 00 00 00 3f 00 00 00 00 00 00 00 00 &1a10 00 00 00 00 00 00 00 00 3f 00 00 00 15 11 00 00 &1a20 3f 3f 15 3f 3f 00 00 15 3f 3f 2a 15 15 3f 15 3f &1a30 3f 3f 15 2a 3f 3f 3f 2a 2a 2a 3f 3f 3f 3f 2a 00 ; enemy sprite &12 - SPACEMAN right &1a40 00 00 00 00 00 15 15 15 00 15 15 15 00 3e 3e 3e &1a50 3f 3f 3f 3f 3f 3c 34 30 30 30 30 30 3f 28 29 30 &1a60 00 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 &1a70 15 15 15 15 05 05 05 00 3e 3e 3f 3f 0a 00 00 00 &1a80 30 3c 3f 3f 14 10 10 10 30 29 3f 3f 28 00 30 30 &1a90 00 00 2a 2a 00 00 00 00 00 00 00 00 00 00 00 00 ; enemy sprite &13 - SPACEMAN left &1aa0 00 00 00 00 00 00 00 00 00 10 10 10 00 00 00 00 &1ab0 30 30 30 30 3f 14 16 30 3f 3f 3f 3f 3f 3c 38 30 &1ac0 00 2a 2a 2a 00 3d 3d 3d 00 00 00 00 00 2a 2a 2a &1ad0 00 00 00 00 00 00 00 00 00 00 15 15 00 00 00 00 &1ae0 30 16 3f 3f 14 00 30 30 30 3c 3f 3f 28 20 20 20 &1af0 3d 3d 3f 3f 05 00 00 00 2a 2a 2a 2a 0a 0a 0a 00 ; enemy sprite &14 - RAINDROP &1b00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 14 &1b10 00 00 00 14 14 3c 3c 3c 00 00 00 00 00 28 28 3e &1b20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &1b30 00 00 00 00 00 00 00 00 3c 3c 3c 3c 3c 14 14 00 &1b40 3c 3c 3c 3c 3d 3d 3d 3c 3e 3e 3e 3e 3e 2a 28 00 &1b50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; player_sprites ; player_sprite_right_frame_0 &1b60 00 00 00 00 00 00 00 00 00 00 00 00 00 04 04 04 &1b70 05 0f 0f 0f 0c 0d 0d 0d 0f 0f 1b 33 0c 0e 0e 0f &1b80 0a 20 33 22 00 08 08 1b 00 00 00 00 00 00 00 00 &1b90 00 00 00 00 00 00 00 00 04 04 00 00 04 04 04 04 &1ba0 0c 0c 0c 0f 0f 08 08 08 0f 0c 0c 0f 0f 0f 0c 0c &1bb0 1b 08 00 00 00 00 08 08 00 00 00 00 00 00 00 00 ; player_sprite_right_frame_1 &1bc0 00 00 00 00 00 00 00 00 00 00 00 00 00 04 04 04 &1bd0 05 0f 0f 0f 0c 0d 0f 0f 0f 0f 1b 33 0c 0e 0c 0c &1be0 0a 20 33 22 00 08 08 08 00 00 00 00 00 00 00 00 &1bf0 00 00 00 00 00 00 00 00 04 04 00 00 00 00 00 00 &1c00 0d 19 0c 0f 0f 05 04 04 0e 26 0c 0f 0f 0a 0c 0c &1c10 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; player_sprite_left_frame_0 &1c20 00 00 00 00 00 00 00 00 05 10 33 11 00 04 04 27 &1c30 0f 0f 27 33 0c 0d 0d 0f 0a 0f 0f 0f 0c 0e 0e 0e &1c40 00 00 00 00 00 08 08 08 00 00 00 00 00 00 00 00 &1c50 00 00 00 00 00 00 00 00 27 04 00 00 00 00 04 04 &1c60 0f 0c 0c 0f 0f 0f 0c 0c 0c 0c 0c 0f 0f 04 04 04 &1c70 08 08 00 00 08 08 08 08 00 00 00 00 00 00 00 00 ; player_sprite_left_frame_1 &1c80 00 00 00 00 00 00 00 00 05 10 33 11 00 04 04 04 &1c90 0f 0f 27 33 0c 0d 0c 0c 0a 0f 0f 0f 0c 0e 0f 0f &1ca0 00 00 00 00 00 08 08 08 00 00 00 00 00 00 00 00 &1cb0 00 00 00 00 00 00 00 00 04 04 00 00 00 00 00 00 &1cc0 0d 19 0c 0f 0f 05 0c 0c 0e 26 0c 0f 0f 0a 08 08 &1cd0 08 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; player_sprite_climbing_frame_0 &1ce0 00 00 00 00 00 00 00 00 00 05 05 05 05 00 05 0f &1cf0 0f 0f 0f 0f 0f 0f 0c 0c 0a 0f 0f 0f 0f 0a 0d 0d &1d00 00 00 00 00 00 00 00 0a 00 00 00 00 00 00 00 00 &1d10 00 00 00 00 00 00 00 00 0e 0e 0e 27 05 05 0c 0c &1d20 0c 0c 0c 0f 0a 0a 08 08 0c 0c 0c 0f 0c 0c 00 00 &1d30 0a 22 00 00 08 08 00 00 00 00 00 00 00 00 00 00 ; player_sprite_climbing_frame_1 &1d40 00 00 00 00 00 00 00 00 00 05 05 05 05 00 05 0f &1d50 0f 0f 0f 0f 0f 0f 0c 0c 0a 0f 0f 0f 0f 0a 0d 0d &1d60 00 00 00 00 00 00 00 0a 00 00 00 00 00 00 00 00 &1d70 00 00 00 00 00 00 00 00 0e 26 04 05 0c 0c 00 00 &1d80 0c 0c 0c 0f 08 08 00 00 0c 0c 0c 0f 0f 0f 0c 0c &1d90 0a 0a 0a 22 00 00 08 08 00 00 00 00 00 00 00 00 ; real_entry_point &1da0 a2 5f LDX #&5f &1da2 9a TXS &1da3 a9 ff LDA #&ff &1da5 85 87 STA &87 ; player_energy ; fill_initial_energy_loop &1da7 20 30 24 JSR &2430 ; increase_energy_by_one &1daa a5 87 LDA &87 ; player_energy &1dac c9 51 CMP #&51 &1dae d0 f7 BNE &1da7 ; fill_initial_energy_loop &1db0 a9 58 LDA #&58 &1db2 85 75 STA &75 ; block_screen_address_low &1db4 a9 50 LDA #&50 ; &5058 = screen address of pocket two &1db6 85 76 STA &76 ; block_screen_address_high &1db8 20 35 26 JSR &2635 ; wipe_block &1dbb a9 90 LDA #&90 ; &5090 = screen address of pocket one &1dbd 85 75 STA &75 ; block_screen_address_low &1dbf 20 35 26 JSR &2635 ; wipe_block &1dc2 a2 e0 LDX #&e0 ; initialise_objects_loop # Copy &0500-&05df to &0300-&03df &1dc4 bd ff 04 LDA &04ff,X ; initial_object_table - 1 # i.e. initial_object_table to object_table &1dc7 9d ff 02 STA &02ff,X ; object_table - 1 &1dca ca DEX &1dcb d0 f7 BNE &1dc4 ; initialise_objects_loop &1dcd a2 4c LDX #&4c &1dcf bd 00 04 LDA &0400,X ; magic_hat_locations ; initialise_magic_hats_loop # Mark magic hats as uncollected &1dd2 29 7f AND #&7f &1dd4 9d 00 04 STA &0400,X ; magic_hat_locations &1dd7 ca DEX &1dd8 ca DEX &1dd9 ca DEX &1dda ca DEX &1ddb 10 f2 BPL &1dcf ; initialise_magic_hats_loop &1ddd a2 0a LDX #&0a &1ddf a9 00 LDA #&00 ; initialise_puzzles_solved_loop # Mark puzzles as unsolved &1de1 95 5a STA &5a,X ; puzzles_solved &1de3 ca DEX &1de4 10 fb BPL &1de1 ; initialise_puzzles_solved_loop &1de6 a9 00 LDA #&00 &1de8 85 44 STA &44 ; bump_offset &1dea 85 45 STA &45 ; bump_speed &1dec 85 40 STA &40 ; player_jumping_timer &1dee 85 03 STA &03 ; player_falling_timer &1df0 85 46 STA &46 ; space_pressed &1df2 85 80 STA &80 ; player_frame_counter &1df4 85 02 STA &02 ; player_direction &1df6 85 47 STA &47 ; changing_colours_state &1df8 85 54 STA &54 ; sword_countdown_low &1dfa 85 55 STA &55 ; sword_countdown_high &1dfc 85 56 STA &56 ; magic_hat_timer &1dfe 20 23 2a JSR &2a23 ; plot_score &1e01 a9 ff LDA #&ff # Mark pockets as empty &1e03 85 51 STA &51 ; pocket_one &1e05 85 52 STA &52 ; pocket_two &1e07 85 7f STA &7f ; previous_sprite &1e09 20 35 31 JSR &3135 ; plot_sword_countdown &1e0c a2 07 LDX #&07 # Player starts in (7,8), THE MAIN PALACE (0,0) &1e0e 86 04 STX &04 ; room_x &1e10 e8 INX &1e11 86 05 STX &05 ; room_y &1e13 20 23 29 JSR &2923 ; display_title_screen &1e16 a9 00 LDA #&00 &1e18 85 57 STA &57 ; score &1e1a 20 23 2a JSR &2a23 ; plot_score &1e1d a9 30 LDA #&30 &1e1f 85 58 STA &58 ; player_x &1e21 a9 40 LDA #&40 &1e23 85 59 STA &59 ; player_y &1e25 a9 80 LDA #&80 &1e27 85 00 STA &00 ; player_screen_address_low &1e29 a9 78 LDA #&78 &1e2b 85 01 STA &01 ; player_screen_address_high ; entering_room &1e2d 38 SEC &1e2e 26 48 ROL &48 ; pain_tolerance # Tolerance increases one point on entering room &1e30 a9 00 LDA #&00 &1e32 85 41 STA &41 ; player_has_changed_room &1e34 85 49 STA &49 ; repelled_from_guard_timer &1e36 85 53 STA &53 ; bowl_is_in_position_to_be_filled &1e38 20 ea 31 JSR &31ea ; plot_room_from_coordinates &1e3b 20 95 2f JSR &2f95; plot_player ; main_game_loop &1e3e a9 13 LDA #&13 ; Wait for Vertical Retrace &1e40 20 f4 ff JSR &fff4 ; OSBYTE &1e43 20 ce 23 JSR &23ce ; update_changing_colours &1e46 20 9b 23 JSR &239b ; store_previous_player_details &1e49 a9 00 LDA #&00 &1e4b 85 88 STA &88 ; damage &1e4d 85 89 STA &89 ; player_has_moved &1e4f 85 41 STA &41 ; player_has_changed_room &1e51 85 43 STA &43 ; player_is_in_block_with_rope_or_ladder &1e53 a6 58 LDX &58 ; player_x &1e55 e8 INX &1e56 e8 INX &1e57 a4 59 LDY &59 ; player_y &1e59 88 DEY &1e5a 30 06 BMI &1e62 ; skip_rope_or_ladder_check # Unless the player is at the top of the screen, &1e5c 98 TYA &1e5d 20 a7 22 JSR &22a7 ; check_if_x_y_is_on_rope_or_ladder # check one pixel above them for rope or ladder &1e60 b0 04 BCS &1e66 ; use_result # (returns carry clear if so) ; skip_rope_or_ladder_check &1e62 a9 ff LDA #&ff &1e64 85 43 STA &43 ; player_is_in_block_with_rope_or_ladder # Note that player is in block with rope or ladder ; use_result &1e66 20 75 22 JSR &2275 ; check_if_player_is_on_rope_or_ladder &1e69 a5 ec LDA &ec ; Internal key number of most recently pressed key &1e6b c9 f0 CMP #&f0 ; ESCAPE &1e6d d0 04 BNE &1e73 ; escape_not_pressed &1e6f a9 55 LDA #&55 # Player suffers immense damage by pressing ESCAPE &1e71 85 88 STA &88 ; damage ; escape_not_pressed &1e73 c9 e9 CMP #&e9 ; COPY # When COPY is pressed to pause the game, &1e75 d0 06 BNE &1e7d ; copy_not_pressed &1e77 a9 d9 LDA #&d9 ; DELETE # wait for DELETE to be pressed to unpause the game ; pause_loop &1e79 c5 ec CMP &ec ; Internal key number of most recently pressed key &1e7b d0 fc BNE &1e79 ; pause_loop ; copy_not_pressed &1e7d c9 90 CMP #&90 ; Q # Q mutes the sound &1e7f d0 03 BNE &1e84 ; q_not_pressed &1e81 8d 62 02 STA &0262 ; Sound supression status ; q_not_pressed &1e84 c9 d1 CMP #&d1 ; S # S unmutes the sound &1e86 d0 05 BNE &1e8d ; s_not_pressed &1e88 a2 00 LDX #&00 &1e8a 8e 62 02 STX &0262 ; Sound supression status ; s_not_pressed &1e8d a6 49 LDX &49 ; repelled_from_guard_timer &1e8f f0 09 BEQ &1e9a ; not_being_repelled &1e91 20 dc 20 JSR &20dc ; move_player_right # If the player is being repelled, &1e94 20 87 21 JSR &2187 ; move_player_down # force them to move right and down &1e97 4c bc 1e JMP &1ebc ; skip_keyboard_handling ; not_being_repelled &1e9a a2 00 LDX #&00 &1e9c c9 e2 CMP #&e2 ; SPACE &1e9e d0 0c BNE &1eac ; space_not_pressed # If SPACE is pressed, &1ea0 a5 59 LDA &59 ; player_y &1ea2 c9 48 CMP #&48 &1ea4 f0 06 BEQ &1eac ; space_not_pressed # and the player isn't at the bottom of the screen, &1ea6 a5 46 LDA &46 ; space_pressed &1ea8 d0 04 BNE &1eae ; space_already_pressed # and SPACE has just been pressed, &1eaa a2 80 LDX #&80 # note this for later handling ; space_not_pressed &1eac 86 46 STX &46 ; space_pressed ; space_already_pressed &1eae a5 ec LDA &ec ; Internal key number of most recently pressed key &1eb0 a6 ed LDX &ed ; Internal key number of first key pressed of those still pressed &1eb2 20 e3 1f JSR &1fe3 ; consider_keypresses # Consider two keys at any time, one way around &1eb5 a5 ed LDA &ed ; Internal key number of first key pressed of those still pressed &1eb7 a6 ec LDX &ec ; Internal key number of most recently pressed key &1eb9 20 e3 1f JSR &1fe3 ; consider_keypresses # and then the other ; skip_keyboard_handling &1ebc 20 e9 21 JSR &21e9 ; handle_player_jumping_or_falling &1ebf a5 44 LDA &44 ; bump_offset # Handle any bump from falling too far &1ec1 f0 04 BEQ &1ec7 ; no_bump &1ec3 c6 44 DEC &44 ; bump_offset &1ec5 c6 44 DEC &44 ; bump_offset ; no_bump &1ec7 a5 45 LDA &45 ; bump_speed &1ec9 f0 09 BEQ &1ed4 ; no_change_of_bump &1ecb c6 45 DEC &45 ; bump_speed &1ecd a5 44 LDA &44 ; bump_offset &1ecf 18 CLC &1ed0 69 04 ADC #&04 &1ed2 85 44 STA &44 ; bump_offset ; no_change_of_bump &1ed4 a9 05 LDA #&05 # R5: Vertical total adjust register &1ed6 a6 44 LDX &44 ; bump_offset &1ed8 20 05 35 JSR &3505 ; write_to_video_controller_register &1edb a5 48 LDA &48 ; pain_tolerance &1edd d0 5a BNE &1f39 ; not_in_agony # If the player has incurred eight frames of damage, &1edf a5 41 LDA &41 ; player_has_changed_room &1ee1 d0 56 BNE &1f39 ; not_in_agony &1ee3 85 40 STA &40 ; player_jumping_timer &1ee5 a9 0f LDA #&0f ; Flush all buffers &1ee7 a2 00 LDX #&00 &1ee9 85 48 STA &48 ; pain_tolerance &1eeb 20 f4 ff JSR &fff4 ; OSBYTE &1eee a9 04 LDA #&04 &1ef0 a2 01 LDX #&01 &1ef2 a0 28 LDY #&28 &1ef4 20 80 08 JSR &0880 ; play_sound &1ef7 a9 06 LDA #&06 # Set background colour to red &1ef9 8d 21 fe STA &fe21 # Write to video ULA palette register ; run_back_to_entry_point_loop # Make the player run back to where they entered &1efc a9 13 LDA #&13 ; Wait for Vertical Retrace &1efe 20 f4 ff JSR &fff4 ; OSBYTE &1f01 20 79 2f JSR &2f79 ; update_player_sprite &1f04 20 9b 23 JSR &239b ; store_previous_player_details &1f07 e6 89 INC &89 ; player_has_moved &1f09 a0 00 LDY #&00 &1f0b a6 58 LDX &58 ; player_x &1f0d e4 65 CPX &65 ; player_entry_x &1f0f f0 0c BEQ &1f1d ; skip_horizontal_run &1f11 c8 INY # by forcing a movement horizontally &1f12 b0 06 BCS &1f1a ; run_left &1f14 20 03 21 JSR &2103 ; move_player_right_regardless_of_obstacles &1f17 4c 1d 1f JMP &1f1d ; skip_horizontal_run ; run_left &1f1a 20 b4 20 JSR &20b4 ; move_player_left_regardless_of_obstacles ; skip_horizontal_run &1f1d a6 58 LDX &58 ; player_x &1f1f a6 59 LDX &59 ; player_y &1f21 e4 66 CPX &66 ; player_entry_y &1f23 f0 0c BEQ &1f31 ; skip_vertical_run &1f25 c8 INY # and vertically, as necessary &1f26 b0 06 BCS &1f2e ; run_up &1f28 20 b2 21 JSR &21b2 ; move_player_down_regardless_of_obstacles &1f2b 4c 31 1f JMP &1f31 ; skip_vertical_run ; run_up &1f2e 20 51 21 JSR &2151 ; move_player_up_regardless_of_obstacles ; skip_vertical_run &1f31 88 DEY &1f32 10 c8 BPL &1efc ; run_back_to_entry_point_loop # Continue until the player is back where they entered &1f34 a9 07 LDA #&07 # Reset background colour to black &1f36 8d 21 fe STA &fe21 # Write to video ULA palette register ; not_in_agony &1f39 a5 49 LDA &49 ; repelled_from_guard_timer &1f3b f0 02 BEQ &1f3f ; not_being_repelled &1f3d c6 49 DEC &49 ; repelled_from_guard_timer ; not_being_repelled &1f3f a5 55 LDA &55 ; sword_countdown_high # If the player is carrying the SWORD, &1f41 f0 47 BEQ &1f8a ; skip_sword_countdown &1f43 e6 54 INC &54 ; sword_countdown_low # count down the timer &1f45 a5 54 LDA &54 ; sword_countdown_low &1f47 c9 c0 CMP #&c0 &1f49 d0 3f BNE &1f8a ; skip_sword_countdown &1f4b a9 00 LDA #&00 &1f4d 85 54 STA &54 ; sword_countdown_low &1f4f c6 55 DEC &55 ; sword_countdown_high &1f51 d0 37 BNE &1f8a ; skip_sword_countdown &1f53 a9 03 LDA #&03 &1f55 a2 01 LDX #&01 &1f57 a0 0a LDY #&0a &1f59 20 80 08 JSR &0880 ; play_sound # When the timer runs out, play a sound &1f5c a9 35 LDA #&35 ; SWORD &1f5e 20 99 2e JSR &2e99 ; remove_object_from_pocket # and remove the SWORD from either the player's pocket &1f61 b0 27 BCS &1f8a ; skip_sword_countdown &1f63 ad 00 03 LDA &0300 ; object_table &1f66 48 PHA &1f67 a9 ff LDA #&ff # or wherever it had been dropped &1f69 8d 00 03 STA &0300 ; object_table &1f6c 68 PLA &1f6d c5 04 CMP &04 ; room_x &1f6f d0 19 BNE &1f8a ; skip_sword_countdown &1f71 ad 01 03 LDA &0301 ; object_table + 1 &1f74 c5 05 CMP &05 ; room_y &1f76 d0 12 BNE &1f8a &1f78 ad 02 03 LDA &0302 ; object_table + 2 # If that's the current room, &1f7b 85 94 STA &94 ; screen_address_low &1f7d ad 03 03 LDA &0303 ; object_table + 3 &1f80 85 95 STA &95 ; screen_address_high &1f82 a9 35 LDA #&35 ; SWORD &1f84 20 92 29 JSR &2992 ; unpack_background_sprite &1f87 20 d0 06 JSR &06d0 ; plot_sprite # then remove the SWORD from the screen ; skip_sword_countdown &1f8a a5 56 LDA &56 ; magic_hat_timer &1f8c f0 04 BEQ &1f92 ; not_gaining_from_hat &1f8e c6 56 DEC &56 ; magic_hat_timer &1f90 c6 88 DEC &88 ; damage # Gain 1 energy per turn MAGIC_HAT is active ; not_gaining_from_hat &1f92 20 53 28 JSR &2853 ; check_if_player_has_touched_puzzle_block &1f95 20 c7 22 JSR &22c7 ; check_if_player_is_touching_painful_scenery &1f98 20 08 2c JSR &2c08 ; handle_rain_drop &1f9b a5 41 LDA &41 ; player_has_changed_room &1f9d f0 0f BEQ &1fae ; same_room &1f9f a5 04 LDA &04 ; room_x &1fa1 c5 0c CMP &0c ; previous_room_x &1fa3 d0 06 BNE &1fab ; to_entering_room &1fa5 a5 05 LDA &05 ; room_y &1fa7 c5 0d CMP &0d ; previous_room_y &1fa9 f0 03 BEQ &1fae ; same_room ; to_entering_room &1fab 4c 2d 1e JMP &1e2d ; entering_room # If the player has changed room, enter it ; same_room &1fae a9 13 LDA #&13 ; Wait for Vertical Retrace # Otherwise, &1fb0 20 f4 ff JSR &fff4 ; OSBYTE &1fb3 a9 80 LDA #&80 &1fb5 8d 6e fe STA &fe6e ; User VIA Interrupt control register &1fb8 a9 ff LDA #&ff &1fba 8d 69 fe STA &fe69 ; User VIA Timer 2 latch/counter MSB &1fbd 20 79 2f JSR &2f79 ; update_player_sprite # update player immediately after v-sync, &1fc0 20 6b 26 JSR &266b ; update_ropes # then ropes &1fc3 a5 46 LDA &46 ; space_pressed &1fc5 10 05 BPL &1fcc ; player_didn't_press_space &1fc7 c6 46 DEC &46 ; space_pressed &1fc9 20 d5 2f JSR &2fd5 ; handle_object_collection ; player_didn't_press_space &1fcc a9 c8 LDA #&c8 ; first_wait_loop &1fce cd 69 fe CMP &fe69 ; User VIA Timer 2 latch/counter MSB &1fd1 90 fb BCC &1fce ; first_wait_loop &1fd3 20 80 24 JSR &2480 ; update_enemies # a little later, update enemies &1fd6 a9 80 LDA #&80 ; second_wait_loop &1fd8 cd 69 fe CMP &fe69 ; User VIA Timer 2 latch/counter MSB &1fdb 90 fb BCC &1fd8 ; second_wait_loop &1fdd 20 4a 31 JSR &314a ; handle_player_damage # and a little later still, any damage &1fe0 4c 3e 1e JMP &1e3e ; main_game_loop ; consider_keypresses &1fe3 86 81 STX &81 ; second_keypress &1fe5 c9 e1 CMP #&e1 ; Z &1fe7 d0 05 BNE &1fee ; player_didn't_press_left &1fe9 e6 89 INC &89 ; player_has_moved &1feb 4c 96 20 JMP &2096 ; move_player_left ; player_didn't_press_left &1fee c9 c2 CMP #&c2 ; X &1ff0 d0 05 BNE &1ff7 ; player_didn't_press_right &1ff2 e6 89 INC &89 ; player_has_moved &1ff4 4c dc 20 JMP &20dc ; move_player_right ; player_didn't_press_right &1ff7 c9 c8 CMP #&c8 ; * &1ff9 d0 12 BNE &200d ; player_didn't_press_up &1ffb a5 42 LDA &42 ; player_is_on_rope_or_ladder &1ffd 25 43 AND &43 ; player_is_in_block_with_rope_or_ladder &1fff f0 0c BEQ &200d ; player_didn't_press_up &2001 a9 02 LDA #&02 ; CLIMBING &2003 85 02 STA &02 ; player_direction &2005 e6 89 INC &89 ; player_has_moved &2007 20 2b 21 JSR &212b ; move_player_up &200a 4c 2b 21 JMP &212b ; move_player_up ; player_didn't_press_up &200d c9 e8 CMP #&e8 ; ? &200f d0 1a BNE &202b ; player_didn't_press_down &2011 a4 42 LDY &42 ; player_is_on_rope_or_ladder &2013 f0 16 BEQ &202b ; player_didn't_press_down &2015 a9 02 LDA #&02 ; CLIMBING &2017 85 02 STA &02 ; player_direction &2019 e6 89 INC &89 ; player_has_moved &201b e0 c9 CPX #&c9 ; RETURN &201d d0 06 BNE &2025 ; player_didn't_press_down_and_jump &201f 20 87 21 JSR &2187 ; move_player_down &2022 20 87 21 JSR &2187 ; move_player_down ; player_didn't_press_down_and_jump &2025 20 87 21 JSR &2187 ; move_player_down &2028 4c 87 21 JMP &2187 ; move_player_down ; player_didn't_press_up &202b c9 c9 CMP #&c9 ; RETURN &202d d0 66 BNE &2095 ; player_didn't_press_jump &202f a6 41 LDX &41 ; player_has_changed_room &2031 d0 62 BNE &2095 ; player_didn't_press_jump &2033 a5 03 LDA &03 ; player_falling_timer &2035 d0 5e BNE &2095 ; player_didn't_press_jump &2037 a6 42 LDX &42 ; player_is_on_rope_or_ladder &2039 f0 0c BEQ &2047 ; player_isn't_on_rope_or_was_already_jumping &203b a5 40 LDA &40 ; player_jumping_timer &203d d0 08 BNE &2047 ; player_isn't_on_rope_or_was_already_jumping &203f a9 02 LDA #&02 ; CLIMBING &2041 85 02 STA &02 ; player_direction &2043 e6 89 INC &89 ; player_has_moved &2045 d0 2c BNE &2073 ; start_jump ; player_isn't_on_rope_or_was_already_jumping &2047 a5 59 LDA &59 ; player_y &2049 c9 48 CMP #&48 # If the player is at the bottom of the screen, &204b f0 48 BEQ &2095 ; player_didn't_press_jump &204d 18 CLC &204e 69 08 ADC #&08 &2050 48 PHA &2051 a8 TAY &2052 a6 58 LDX &58 ; player_x &2054 e8 INX &2055 20 04 23 JSR &2304 ; get_room_block_from_x_and_y # Consider the block beneath them, to the left &2058 68 PLA &2059 90 18 BCC &2073 ; start_jump # If it is a wall, the player can jump &205b a8 TAY &205c 48 PHA &205d a5 58 LDA &58 ; player_x &205f 69 03 ADC #&03 &2061 aa TAX &2062 20 04 23 JSR &2304 ; get_room_block_from_x_and_y # Consider the block beneath them, to the right &2065 68 PLA &2066 90 0b BCC &2073 ; start_jump # If it is a wall, the player can jump &2068 a8 TAY &2069 a5 58 LDA &58 ; player_x &206b 69 02 ADC #&02 &206d aa TAX &206e 20 04 23 JSR &2304 ; get_room_block_from_x_and_y # Consider the block beneath them, middle right ?/? &2071 b0 22 BCS &2095 ; player_didn't_press_jump # If it is a space, the player can't jump ; start_jump &2073 a5 81 LDA &81 ; second_keypress &2075 c9 e8 CMP #&e8 ; ? &2077 f0 1c BEQ &2095 ; player_didn't_press_jump &2079 a9 31 LDA #&31 ; MAGIC_BOOTS &207b 20 80 27 JSR &2780 ; check_if_pockets_contain_object &207e 08 PHP &207f a9 0a LDA #&0a &2081 28 PLP &2082 d0 02 BNE &2086 ; player_isn't_carrying_magic_boots # If the player is carrying MAGIC_BOOTS, &2084 a9 12 LDA #&12 # jump 18 instead of 10 ; player_isn't_carrying_magic_boots &2086 85 40 STA &40 ; player_jumping_timer &2088 a9 00 LDA #&00 &208a 85 03 STA &03 ; player_falling_timer &208c a9 13 LDA #&13 &208e a2 50 LDX #&50 &2090 a0 0d LDY #&0d &2092 4c 80 08 JMP &0880 ; play_sound ; player_didn't_press_jump &2095 60 RTS ; move_player_left &2096 a6 58 LDX &58 ; player_x &2098 f0 2c BEQ &20c6 ; move_left_a_room # If the player is at the left of the room, change room &209a a4 59 LDY &59 ; player_y &209c 20 fa 22 JSR &22fa ; get_room_block_from_x_and_y_considering_slope &209f 90 24 BCC &20c5 ; leave # Can't move into a wall &20a1 aa TAX &20a2 f0 21 BEQ &20c5 ; leave # Can't move into BOTTOM_LEFT &20a4 a6 58 LDX &58 ; player_x &20a6 a5 59 LDA &59 ; player_y &20a8 69 06 ADC #&06 &20aa a8 TAY &20ab 20 fa 22 JSR &22fa ; get_room_block_from_x_and_y_considering_slope &20ae 90 15 BCC &20c5 ; leave # Can't move into a wall &20b0 c9 02 CMP #&02 &20b2 f0 11 BEQ &20c5 ; leave # Can't move into TOP_LEFT ; move_player_left_regardless_of_obstacles &20b4 a9 01 LDA #&01 &20b6 85 02 STA &02 ; player_direction &20b8 c6 58 DEC &58 ; player_x &20ba 38 SEC &20bb a5 00 LDA &00 ; player_screen_address_low &20bd e9 08 SBC #&08 # 2 pixels left &20bf 85 00 STA &00 ; player_screen_address_low &20c1 b0 02 BCS &20c5 &20c3 c6 01 DEC &01 ; player_screen_address_high ; leave &20c5 60 RTS ; move_left_a_room &20c6 a9 42 LDA #&42 &20c8 85 58 STA &58 ; player_x &20ca 18 CLC &20cb a5 00 LDA &00 ; player_screen_address_low &20cd 69 10 ADC #&10 &20cf 85 00 STA &00 ; player_screen_address_low &20d1 a5 01 LDA &01 ; player_screen_address_high &20d3 69 02 ADC #&02 &20d5 85 01 STA &01 ; player_screen_address_high &20d7 c6 04 DEC &04 ; room_x &20d9 c6 41 DEC &41 ; player_has_changed_room &20db 60 RTS ; move_player_right &20dc a5 58 LDA &58 ; player_x &20de c9 42 CMP #&42 &20e0 f0 33 BEQ &2115 ; move_right_a_room # If the player is at the right of the room, change room &20e2 18 CLC &20e3 69 05 ADC #&05 &20e5 48 PHA &20e6 aa TAX &20e7 a4 59 LDY &59 ; player_y &20e9 20 fa 22 JSR &22fa ; get_room_block_from_x_and_y_considering_slope &20ec aa TAX &20ed 68 PLA &20ee 90 24 BCC &2114 ; leave # Can't move into wall &20f0 e0 03 CPX #&03 &20f2 f0 20 BEQ &2114 ; leave # Can't move into BOTTOM_RIGHT &20f4 aa TAX &20f5 a5 59 LDA &59 ; player_y &20f7 69 06 ADC #&06 &20f9 a8 TAY &20fa 20 fa 22 JSR &22fa ; get_room_block_from_x_and_y_considering_slope &20fd 90 15 BCC &2114 ; leave # Can't move into wall &20ff c9 01 CMP #&01 &2101 f0 11 BEQ &2114 ; leave # Can't move into TOP_RIGHT ; move_player_right_regardless_of_obstacles &2103 a9 00 LDA #&00 &2105 85 02 STA &02 ; player_direction &2107 e6 58 INC &58 ; player_x &2109 18 CLC &210a a5 00 LDA &00 ; player_screen_address_low &210c 69 08 ADC #&08 # 2 pixels right &210e 85 00 STA &00 ; player_screen_address_low &2110 90 02 BCC &2114 &2112 e6 01 INC &01 ; player_screen_address_high ; leave &2114 60 RTS ; move_right_a_room &2115 a9 00 LDA #&00 &2117 85 58 STA &58 ; player_x &2119 38 SEC &211a a5 00 LDA &00 ; player_screen_address_low &211c e9 10 SBC #&10 &211e 85 00 STA &00 ; player_screen_address_low &2120 a5 01 LDA &01 ; player_screen_address_high &2122 e9 02 SBC #&02 &2124 85 01 STA &01 ; player_screen_address_high &2126 e6 04 INC &04 ; room_x &2128 c6 41 DEC &41 ; player_has_changed_room &212a 60 RTS ; move_player_up &212b a4 59 LDY &59 ; player_y &212d f0 42 BEQ &2171 ; move_up_a_room # If the player is at the top of the room, change room &212f 88 DEY &2130 a6 58 LDX &58 ; player_x # Consider the player's head &2132 e8 INX &2133 20 04 23 JSR &2304 ; get_room_block_from_x_and_y &2136 90 38 BCC &2170 ; leave # Can't move into wall &2138 a4 59 LDY &59 ; player_y &213a 88 DEY &213b a5 58 LDA &58 ; player_x &213d 69 03 ADC #&03 &213f aa TAX &2140 20 04 23 JSR &2304 ; get_room_block_from_x_and_y &2143 90 2b BCC &2170 ; leave # Can't move into wall &2145 a4 59 LDY &59 ; player_y &2147 88 DEY &2148 a6 58 LDX &58 ; player_x &214a e8 INX &214b e8 INX &214c 20 04 23 JSR &2304 ; get_room_block_from_x_and_y &214f 90 1f BCC &2170 ; leave # Can't move into wall ; move_player_up_regardless_of_obstacles &2151 a5 59 LDA &59 ; player_y &2153 c6 59 DEC &59 ; player_y &2155 29 03 AND #&03 &2157 38 SEC &2158 d0 0c BNE &2166 ; same_group &215a a5 00 LDA &00 ; player_screen_address_low &215c e9 38 SBC #&38 &215e 85 00 STA &00 ; player_screen_address_low &2160 a5 01 LDA &01 ; player_screen_address_high &2162 e9 02 SBC #&02 &2164 85 01 STA &01 ; player_screen_address_high ; same_group &2166 a5 00 LDA &00 ; player_screen_address_low &2168 e9 02 SBC #&02 # 2 pixels up &216a 85 00 STA &00 ; player_screen_address_low &216c b0 02 BCS &2170 &216e c6 01 DEC &01 ; player_screen_address_high ; leave &2170 60 RTS ; move_up_a_room &2171 a9 48 LDA #&48 &2173 85 59 STA &59 ; player_y &2175 18 CLC &2176 a5 00 LDA &00 ; player_screen_address_low &2178 69 80 ADC #&80 &217a 85 00 STA &00 ; player_screen_address_low &217c a5 01 LDA &01 ; player_screen_address_high &217e 69 28 ADC #&28 &2180 85 01 STA &01 ; player_screen_address_high &2182 e6 05 INC &05 ; room_y &2184 c6 41 DEC &41 ; player_has_changed_room &2186 60 RTS ; move_player_down &2187 a5 59 LDA &59 ; player_y &2189 c9 48 CMP #&48 &218b f0 46 BEQ &21d3 ; move_down_a_room # If the player is at the bottom of the room, change room &218d 18 CLC &218e 69 08 ADC #&08 &2190 48 PHA &2191 a8 TAY &2192 a6 58 LDX &58 ; player_x &2194 e8 INX &2195 20 04 23 JSR &2304 ; get_room_block_from_x_and_y &2198 68 PLA &2199 90 36 BCC &21d1 ; leave_with_carry_set # Can't move into wall &219b 48 PHA &219c a8 TAY &219d a5 58 LDA &58 ; player_x &219f 69 03 ADC #&03 &21a1 aa TAX &21a2 20 04 23 JSR &2304 ; get_room_block_from_x_and_y &21a5 68 PLA &21a6 90 29 BCC &21d1 ; leave_with_carry_set # Can't move into wall &21a8 a8 TAY &21a9 a6 58 LDX &58 ; player_x &21ab e8 INX &21ac e8 INX &21ad 20 04 23 JSR &2304 ; get_room_block_from_x_and_y &21b0 90 1f BCC &21d1 ; leave_with_carry_set # Can't move into wall ; move_player_down_regardless_of_obstacles &21b2 e6 59 INC &59 ; player_y &21b4 a5 59 LDA &59 ; player_y &21b6 29 03 AND #&03 &21b8 18 CLC &21b9 d0 0c BNE &21c7 ; same_group &21bb a5 00 LDA &00 ; player_screen_address_low &21bd 69 38 ADC #&38 &21bf 85 00 STA &00 ; player_screen_address_low &21c1 a5 01 LDA &01 ; player_screen_address_high &21c3 69 02 ADC #&02 &21c5 85 01 STA &01 ; player_screen_address_high ; same_group &21c7 e6 00 INC &00 ; player_screen_address_low # 2 pixels down &21c9 e6 00 INC &00 ; player_screen_address_low &21cb d0 02 BNE &21cf &21cd e6 01 INC &01 ; player_screen_address_high &21cf 18 CLC # Carry unset if player could move down &21d0 60 RTS ; leave_with_carry_set &21d1 38 SEC # Carry set if player couldn't move down &21d2 60 RTS ; move_down_a_room &21d3 a9 00 LDA #&00 &21d5 85 59 STA &59 ; player_y &21d7 38 SEC &21d8 a5 00 LDA &00 ; player_screen_address_low &21da e9 80 SBC #&80 &21dc 85 00 STA &00 ; player_screen_address_low &21de a5 01 LDA &01 ; player_screen_address_high &21e0 e9 28 SBC #&28 &21e2 85 01 STA &01 ; player_screen_address_high &21e4 c6 05 DEC &05 ; room_y &21e6 c6 41 DEC &41 ; player_has_changed_room &21e8 60 RTS ; handle_player_jumping_or_falling &21e9 a5 40 LDA &40 ; player_jumping_timer &21eb f0 0d BEQ &21fa ; player_isn't_jumping_up &21ed c6 40 DEC &40 ; player_jumping_timer # If the player is jumping, &21ef c9 03 CMP #&03 &21f1 90 06 BCC &21f9 ; leave # apart from the top of the jump, &21f3 20 2b 21 JSR &212b ; move_player_up &21f6 4c 2b 21 JMP &212b ; move_player_up # move them four pixels up &21f9 60 RTS ; player_isn't_jumping_up &21fa a5 41 LDA &41 ; player_has_changed_room &21fc d0 3c BNE &223a ; leave &21fe a5 42 LDA &42 ; player_is_on_rope_or_ladder &2200 d0 38 BNE &223a ; leave # If the player isn't on a rope or ladder, &2202 a5 03 LDA &03 ; player_falling_timer &2204 a9 04 LDA #&04 &2206 85 75 STA &75 ; falling_factor # Falls once for timer < 4, twice for < 8, etc ; falling_loop &2208 06 75 ASL &75 ; falling_factor &220a 20 87 21 JSR &2187 ; move_player_down &220d a5 41 LDA &41 ; player_has_changed_room &220f d0 29 BNE &223a ; leave &2211 b0 28 BCS &223b ; player_landed_on_floor &2213 a6 58 LDX &58 ; player_x # Consider player's feet &2215 e8 INX &2216 e8 INX &2217 a5 59 LDA &59 ; player_y &2219 69 08 ADC #&08 &221b a8 TAY &221c 48 PHA &221d 20 be 22 JSR &22be ; check_if_block_is_rope_or_ladder &2220 68 PLA &2221 b0 0b BCS &222e ; not_rope_or_ladder &2223 a6 58 LDX &58 ; player_x # Consider player's head &2225 e8 INX &2226 e8 INX &2227 e8 INX &2228 a8 TAY &2229 20 be 22 JSR &22be ; check_if_block_is_rope_or_ladder &222c 90 0d BCC &223b ; player_landed_on_floor ; not_rope_or_ladder &222e a5 03 LDA &03 ; player_falling_timer &2230 c5 75 CMP &75 ; falling_factor &2232 b0 d4 BCS &2208 ; falling_loop &2234 c9 3f CMP #&3f &2236 b0 02 BCS &223a ; leave &2238 e6 03 INC &03 ; player_falling_timer ; leave &223a 60 RTS ; player_landed_on_floor # If the player hit the floor or caught a rope or ladder &223b a5 41 LDA &41 ; player_has_changed_room &223d d0 fb BNE &223a ; leave &223f a5 59 LDA &59 ; player_y &2241 c9 47 CMP #&47 &2243 b0 f5 BCS &223a ; leave # and the player isn't at the bottom of the room &2245 a5 03 LDA &03 ; player_falling_timer &2247 a2 00 LDX #&00 &2249 86 03 STX &03 ; player_falling_timer &224b c9 02 CMP #&02 &224d 90 eb BCC &223a ; leave # Consider if they fell far enough to make a sound &224f a9 01 LDA #&01 &2251 a2 02 LDX #&02 &2253 a0 02 LDY #&02 &2255 20 80 08 JSR &0880 ; play_sound &2258 a5 45 LDA &45 ; bump_speed &225a d0 de BNE &223a ; leave &225c a5 0b LDA &0b ; previous_player_falling_timer &225e c9 13 CMP #&13 &2260 90 d8 BCC &223a ; leave # and if they fell far enough to bump the screen &2262 4a LSR A &2263 4a LSR A &2264 4a LSR A &2265 29 07 AND #&07 &2267 85 45 STA &45 ; bump_speed # Bump, and damage, is falling_timer / 8 &2269 18 CLC &226a 65 88 ADC &88 ; damage &226c 85 88 STA &88 ; damage &226e a9 0f LDA #&0f ; Flush all buffers &2270 a2 00 LDX #&00 &2272 4c f4 ff JMP &fff4 ; OSBYTE ; check_if_player_is_on_rope_or_ladder &2275 a9 00 LDA #&00 &2277 85 42 STA &42 ; player_is_on_rope_or_ladder &2279 a5 58 LDA &58 ; player_x &227b 20 a4 22 JSR &22a4 ; check_if_player_is_on_rope_or_ladder &227e b0 0b BCS &228b ; left_isn't_on_rope_or_ladder &2280 a5 58 LDA &58 ; player_x &2282 69 03 ADC #&03 &2284 20 a4 22 JSR &22a4 ; check_if_player_is_on_rope_or_ladder &2287 90 10 BCC &2299 ; is_rope_or_ladder &2289 b0 0a BCS &2295 ; not_a_rope_or_ladder ; left_isn't_on_rope_or_ladder &228b 18 CLC &228c a5 58 LDA &58 ; player_x &228e 69 02 ADC #&02 &2290 20 a4 22 JSR &22a4 ; check_if_player_is_on_rope_or_ladder &2293 90 04 BCC &2299 ; is_rope_or_ladder ; not_a_rope_or_ladder &2295 a9 00 LDA #&00 &2297 f0 02 BEQ &229b ; set_player_is_on_rope_or_ladder ; is_rope_or_ladder &2299 a9 ff LDA #&ff ; set_player_is_on_rope_or_ladder &229b 85 42 STA &42 ; player_is_on_rope_or_ladder &229d 49 ff EOR #&ff &229f 25 03 AND &03 ; player_falling_timer # Zero player_falling_timer if rope or ladder is caught &22a1 85 03 STA &03 ; player_falling_timer &22a3 60 RTS ; check_if_player_is_on_rope_or_ladder &22a4 aa TAX &22a5 a5 59 LDA &59 ; player_y ; check_if_x_y_is_on_rope_or_ladder &22a7 48 PHA &22a8 a8 TAY &22a9 8a TXA &22aa 48 PHA &22ab 20 be 22 JSR &22be ; check_if_block_is_rope_or_ladder &22ae 68 PLA &22af aa TAX &22b0 68 PLA &22b1 90 0a BCC &22bd ; leave &22b3 c9 48 CMP #&48 &22b5 b0 06 BCS &22bd ; leave # Don't check off the right of the screen &22b7 69 08 ADC #&08 &22b9 a8 TAY &22ba 20 be 22 JSR &22be ; check_if_block_is_rope_or_ladder ; leave &22bd 60 RTS ; check_if_block_is_rope_or_ladder &22be 20 04 23 JSR &2304 ; get_room_block_from_x_and_y &22c1 38 SEC &22c2 e9 0f SBC #&0f &22c4 c9 02 CMP #&02 # Leave with carry clear if ROPE or LADDER &22c6 60 RTS ; check_if_player_is_touching_painful_scenery &22c7 18 CLC &22c8 a5 58 LDA &58 ; player_x &22ca 69 02 ADC #&02 &22cc 20 dd 22 JSR &22dd ; check_for_painful_scenery &22cf 90 09 BCC &22da ; leave_with_damage &22d1 a5 58 LDA &58 ; player_x &22d3 69 03 ADC #&03 &22d5 20 dd 22 JSR &22dd ; check_for_painful_scenery &22d8 b0 02 BCS &22dc ; leave ; leave_with_damage &22da e6 88 INC &88 ; damage ; leave &22dc 60 RTS ; check_for_painful_scenery &22dd 48 PHA &22de aa TAX &22df a4 59 LDY &59 ; player_y &22e1 20 f1 22 JSR &22f1 ; check_room_block_at_x_y_for_painful_scenery &22e4 68 PLA &22e5 90 09 BCC &22f0 ; leave &22e7 aa TAX &22e8 a5 59 LDA &59 ; player_y &22ea 69 04 ADC #&04 &22ec a8 TAY &22ed 20 f1 22 JSR &22f1 ; check_room_block_at_x_y_for_painful_scenery ; leave &22f0 60 RTS ; check_room_block_at_x_y_for_painful_scenery &22f1 20 04 23 JSR &2304 ; get_room_block_from_x_and_y &22f4 38 SEC &22f5 e9 1b SBC #&1b &22f7 c9 07 CMP #&07 # Leave with carry clear for SPIKES and SWORDS &22f9 60 RTS # (also WATER, FIRE and IMP, as mapped to SPIKES) ; get_room_block_from_x_and_y_considering_slope &22fa 20 04 23 JSR &2304 ; get_room_block_from_x_and_y &22fd 08 PHP &22fe 38 SEC &22ff e9 05 SBC #&05 &2301 4a LSR A &2302 28 PLP &2303 60 RTS ; get_room_block_from_x_and_y &2304 a5 41 LDA &41 ; player_has_changed_room &2306 18 CLC &2307 d0 4a BNE &2353 ; leave &2309 98 TYA &230a 29 f8 AND #&f8 &230c 85 7d STA &7d ; y_times_one_and_a_half &230e 4a LSR A &230f 65 7d ADC &7d ; y_times_one_and_a_half &2311 85 7d STA &7d ; y_times_one_and_a_half &2313 8a TXA &2314 a2 0c LDX #&0c ; divide_by_six_loop &2316 ca DEX &2317 dd fb 28 CMP &28fb,X ; table_of_sixes &231a 90 fa BCC &2316 ; divide_by_six_loop &231c fd fb 28 SBC &28fb,X ; table_of_sixes &231f c9 03 CMP #&03 &2321 69 00 ADC #&00 &2323 85 7e STA &7e ; x_offset &2325 8a TXA &2326 18 CLC &2327 65 7d ADC &7d ; y_times_one_and_a_half &2329 aa TAX &232a 98 TYA &232b 29 07 AND #&07 &232d a8 TAY &232e bd 87 01 LDA &0187,X ; room_blocks &2331 38 SEC &2332 f0 1f BEQ &2353 ; leave # Leave with carry set if SPACE &2334 29 3f AND #&3f &2336 dd 87 01 CMP &0187,X ; room_blocks &2339 d0 4b BNE &2386 ; check_dynamic_rope &233b c9 0d CMP #&0d &233d b0 12 BCS &2351 ; compare_with_rope # Leave with carry unset if CLOUD or GRASS &233f c9 05 CMP #&05 &2341 90 0e BCC &2351 ; compare_with_rope # Leave with carry unset if BRICK, STONE or PLINTH &2343 c9 07 CMP #&07 &2345 90 0d BCC &2354 ; check_bottom_left_triangle # Use slope of triangles to determine carry &2347 c9 09 CMP #&09 &2349 90 25 BCC &2370 ; check_top_right_triangle &234b c9 0b CMP #&0b &234d 90 18 BCC &2367 ; check_top_left_triangle &234f b0 09 BCS &235a ; check_bottom_right_triangle ; compare_with_rope &2351 c9 0f CMP #&0f ; ROPE # Leave with carry set if ROPE, LADDER, PILLARs, ; leave # SHIELD, TREEs, SPIKES, SWORDS, etc &2353 60 RTS ; check_bottom_left_triangle &2354 c4 7e CPY &7e ; x_offset &2356 b0 29 BCS &2381 ; leave_with_carry_clear_and_block &2358 38 SEC &2359 60 RTS ; check_bottom_right_triangle &235a 38 SEC &235b a9 06 LDA #&06 &235d e5 7e SBC &7e ; x_offset &235f 85 7e STA &7e ; x_offset &2361 c4 7e CPY &7e ; x_offset &2363 b0 1c BCS &2381 ; leave_with_carry_clear_and_block &2365 90 17 BCC &237e ; leave_with_carry_set_and_block ; check_top_left_triangle &2367 98 TYA &2368 49 07 EOR #&07 &236a c5 7e CMP &7e ; x_offset &236c b0 13 BCS &2381 ; leave_with_carry_clear_and_block &236e 90 0e BCC &237e ; leave_with_carry_set_and_block ; check_top_right_triangle &2370 38 SEC &2371 a9 06 LDA #&06 &2373 e5 7e SBC &7e ; x_offset &2375 85 7e STA &7e ; x_offset &2377 98 TYA &2378 49 07 EOR #&07 &237a c5 7e CMP &7e ; x_offset &237c b0 03 BCS &2381 ; leave_with_carry_clear_and_block ; leave_with_carry_set_and_block &237e 38 SEC &237f b0 01 BCS &2382 ; leave_with_block ; leave_with_carry_clear_and_block &2381 18 CLC ; leave_with_block &2382 bd 87 01 LDA &0187,X ; room_blocks &2385 60 RTS ; check_dynamic_rope &2386 29 07 AND #&07 &2388 38 SEC &2389 f0 0c BEQ &2397 ; leave_with_zero # Treat as SPACE if rope has fully retreated from block &238b 69 00 ADC #&00 &238d 85 7d STA &7d &238f c4 7d CPY &7d &2391 b0 04 BCS &2397 ; leave_with_zero # Treat as SPACE is rope has retreated above y position &2393 a9 0f LDA #&0f &2395 d0 ba BNE &2351 ; compare_with_rope # Treat as ROPE otherwise ; leave_with_zero &2397 a9 00 LDA #&00 &2399 f0 b8 BEQ &2353 ; leave ; store_previous_player_details &239b a2 05 LDX #&05 ; store_previous_player_details_loop &239d b5 00 LDA &00,X &239f 95 08 STA &08,X &23a1 ca DEX &23a2 10 f9 BPL &239d ; store_previous_player_details_loop &23a4 60 RTS ; eor_unpacked_sprite_with_palette_value &23a5 a8 TAY &23a6 f0 25 BEQ &23cd ; leave &23a8 a2 5f LDX #&5f &23aa 48 PHA &23ab a8 TAY &23ac bd a0 04 LDA &04a0,X ; unpacked_sprite_buffer &23af 29 15 AND #&15 &23b1 d0 04 BNE &23b7 ; left_pixel_set &23b3 98 TYA &23b4 29 aa AND #&aa ; right pixel &23b6 a8 TAY ; left_pixel_set &23b7 bd a0 04 LDA &04a0,X ; unpacked_sprite_buffer &23ba 29 2a AND #&2a &23bc d0 04 BNE &23c2 ; right_pixel_set &23be 98 TYA &23bf 29 55 AND #&55 ; left_pixel &23c1 a8 TAY &23c2 98 TYA ; right_pixel_set &23c3 5d a0 04 EOR &04a0,X ; unpacked_sprite_buffer &23c6 9d a0 04 STA &04a0,X ; unpacked_sprite_buffer &23c9 68 PLA &23ca ca DEX &23cb 10 dd BPL &23aa ; leave &23cd 60 RTS ; update_changing_colours &23ce a5 47 LDA &47 ; changing_colours_state &23d0 29 83 AND #&83 &23d2 49 80 EOR #&80 &23d4 85 47 STA &47 ; changing_colours_state &23d6 30 17 BMI &23ef ; leave &23d8 e6 47 INC &47 ; changing_colours_state &23da a8 TAY &23db b9 f0 23 LDA &23f0,Y ; changing_colours_table_one &23de 09 c0 ORA #&c0 &23e0 49 07 EOR #&07 &23e2 8d 21 fe STA &fe21 # Write to video ULA palette register &23e5 b9 f4 23 LDA &23f4,Y ; changing_colours_table_two &23e8 09 b0 ORA #&b0 &23ea 49 07 EOR #&07 &23ec 8d 21 fe STA &fe21 # Write to video ULA palette register ; leave &23ef 60 RTS ; changing_colours_table_one &23f0 01 02 03 05 ; R G Y M ; changing_colours_table_two &23f4 03 06 01 04 ; Y C R B ; set_room_block_colour &23f8 c9 0c CMP #&0c &23fa 90 15 BCC &2411 ; set_colour_of_bricks_and_stone &23fc c9 0e CMP #&0e ; LADDER &23fe f0 1d BEQ &241d ; set_colour_of_ladder_and_rope &2400 c9 0f CMP #&0f ; ROPE &2402 f0 19 BEQ &241d ; set_colour_of_ladder_and_rope &2404 c9 22 CMP #&22 ; FIRE &2406 f0 1b BEQ &2423 ; set_colour_of_fire &2408 c9 13 CMP #&13 &240a 90 04 BCC &2410 ; leave &240c c9 1c CMP #&1c &240e 90 07 BCC &2417 ; set_colour_of_trees_shields_swords_and_spikes ; leave &2410 60 RTS ; set_colour_of_bricks_and_stone &2411 ad 6a 01 LDA &016a ; room_colours # used for BRICKs and STONEs &2414 4c 25 24 JMP &2425 ; to_eor_unpacked_sprite_with_palette_value ; set_colour_of_trees_shields_swords_and_spikes &2417 ad 6b 01 LDA &016b ; room_colours + 1 # used for TREEs, SHIELD, SWORDS and SPIKES &241a 4c 25 24 JMP &2425 ; to_eor_unpacked_sprite_with_palette_value ; set_colour_of_ladder_and_rope &241d ad 6c 01 LDA &016c ; room_colours + 2 # used for LADDER and ROPE &2420 4c 25 24 JMP &2425 ; to_eor_unpacked_sprite_with_palette_value ; set_colour_of_fire &2423 a9 c0 LDA #&c0 # FIRE changes colour ; to_eor_unpacked_sprite_with_palette_value &2425 4c a5 23 JMP &23a5 ; eor_unpacked_sprite_with_palette_value ; decrease_energy_by_one &2428 a2 20 LDX #&20 ; BK &242a 20 46 24 JSR &2446 ; plot_bar_of_energy &242d c6 87 DEC &87 ; player_energy ; leave &242f 60 RTS ; increase_energy_by_one &2430 a5 87 LDA &87 ; player_energy &2432 c9 51 CMP #&51 &2434 f0 f9 BEQ &242f ; leave &2436 e6 87 INC &87 ; player_energy &2438 a2 21 LDX #&21 ; BR &243a c9 0c CMP #&0c &243c 90 08 BCC &2446 ; plot_bar_of_energy &243e a2 24 LDX #&24 ; BG &2440 c9 40 CMP #&40 &2442 90 02 BCC &2446 ; plot_bar_of_energy &2444 a2 34 LDX #&34 ; BC ; plot_bar_of_energy &2446 a9 00 LDA #&00 &2448 85 7e STA &7e ; energy_screen_address_high &244a a5 87 LDA &87 ; player_energy &244c 29 7e AND #&7e &244e 0a ASL A &244f 0a ASL A &2450 26 7e ROL &7e ; energy_screen_address_high &2452 69 81 ADC #&81 &2454 85 7d STA &7d ; energy_screen_address_low &2456 a5 7e LDA &7e ; energy_screen_address_high &2458 69 4e ADC #&4e ; &4e81 = screen address of energy bar &245a 85 7e STA &7e ; energy_screen_address_low &245c 8a TXA &245d a0 04 LDY #&04 ; plot_bar_of_energy_loop &245f 91 7d STA (&7d),Y ; energy_screen_address &2461 88 DEY &2462 10 fb BPL &245f ; plot_bar_of_energy_loop &2464 60 RTS ; plot_enemies &2465 20 cc 2a JSR &2acc ; wipe_unpacked_sprite_buffer &2468 a9 00 LDA #&00 &246a 85 81 STA &81 ; enemy_offset ; plot_enemies_loop &246c a6 81 LDX &81 ; enemy_offset &246e bd 01 01 LDA &0101,X ; enemies_screen_address_high &2471 30 0c BMI &247f ; leave &2473 20 bb 25 JSR &25bb ; plot_enemy &2476 18 CLC &2477 a5 81 LDA &81 ; enemy_offset &2479 69 08 ADC #&08 &247b 85 81 STA &81 ; enemy_offset &247d d0 ed BNE &246c ; plot_enemies_loop ; leave &247f 60 RTS ; update_enemies &2480 20 cc 2a JSR &2acc ; wipe_unpacked_sprite_buffer &2483 a9 00 LDA #&00 &2485 85 81 STA &81 ; enemy_offset ; update_enemies_loop &2487 a6 81 LDX &81 ; enemy_offset &2489 bd 01 01 LDA &0101,X ; enemies_screen_address_high &248c 30 4e BMI &24dc ; skip_enemy &248e 20 bb 25 JSR &25bb ; plot_enemy &2491 a6 81 LDX &81 ; enemy_offset &2493 bd 03 01 LDA &0103,X ; enemies_flags &2496 18 CLC &2497 69 01 ADC #&01 # Increment lowest three bits of enemies_flags &2499 29 d7 AND #&d7 # i.e. move animation on a quarter of a frame &249b 85 75 STA &75 ; enemy_flags_changed &249d 29 04 AND #&04 &249f 0a ASL A &24a0 0a ASL A &24a1 0a ASL A &24a2 05 75 ORA &75 ; enemy_flags_changed # Bit &20 of enemies_flags is unused copy of frame &24a4 9d 03 01 STA &0103,X ; enemies_flags &24a7 a8 TAY &24a8 30 23 BMI &24cd ; enemy_moves_vertically # Bit &80 of enemies_flags is set if moves vertically ; enemy_moves_horizontally &24aa bd 06 01 LDA &0106,X ; enemies_x &24ad 20 e8 24 JSR &24e8 ; toggle_enemy_direction_at_limits &24b0 20 ff 24 JSR &24ff ; move_enemy_horizontally &24b3 bd 02 01 LDA &0102,X ; enemies_sprite &24b6 c9 06 CMP #&06 &24b8 90 1c BCC &24d6 ; replot_enemy # SPRING, BIRD, FIREBALL, SCOOTER_GUARD don't bounce ; enemy_bounces # LIZARD, JUG, RABBIT, SPACEMAN do &24ba bd 03 01 LDA &0103,X ; enemies_flags &24bd 4a LSR A &24be 48 PHA &24bf a0 02 LDY #&02 # Bounce up or down by two pixels &24c1 20 4f 25 JSR &254f ; move_enemy_vertically_set_amount &24c4 68 PLA &24c5 a0 02 LDY #&02 # and then another two pixels &24c7 20 4f 25 JSR &254f ; move_enemy_vertically_set_amount &24ca 4c d6 24 JMP &24d6 ; replot_enemy ; enemy_moves_vertically &24cd bd 07 01 LDA &0107,X ; enemies_y &24d0 20 e8 24 JSR &24e8 ; toggle_enemy_direction_at_limits &24d3 20 45 25 JSR &2545 ; move_enemy_vertically ; replot_enemy &24d6 20 bb 25 JSR &25bb ; plot_enemy &24d9 20 00 28 JSR &2800 ; check_for_player_collision_with_enemy ; skip_enemy &24dc 18 CLC &24dd a5 81 LDA &81 ; enemy_offset &24df 69 08 ADC #&08 &24e1 85 81 STA &81 ; enemy_offset &24e3 c9 38 CMP #&38 &24e5 d0 a0 BNE &2487 ; update_enemies_loop &24e7 60 RTS ; toggle_enemy_direction_at_limits &24e8 dd 04 01 CMP &0104,X ; enemies_maximum &24eb f0 09 BEQ &24f6 &24ed dd 05 01 CMP &0105,X ; enemies_minimum &24f0 f0 04 BEQ &24f6 &24f2 bd 03 01 LDA &0103,X ; enemies_flags &24f5 60 RTS &24f6 bd 03 01 LDA &0103,X ; enemies_flags &24f9 49 10 EOR #&10 # Bit &10 of enemies_flags is set when moving right/down &24fb 9d 03 01 STA &0103,X ; enemies_flags &24fe 60 RTS ; move_enemy_horizontally &24ff 48 PHA &2500 a0 08 LDY #&08 # Slow enemies move 2 pixels horizontally per frame &2502 29 40 AND #&40 # Bit &40 of enemies_flags is set for fast enemies &2504 f0 02 BEQ &2508 ; enemy_is_slow ; enemy_is_fast &2506 a0 10 LDY #&10 # Fast enemies move 4 pixels horizontally per frame ; enemy_is_slow &2508 84 82 STY &82 ; change_in_screen_address &250a 98 TYA &250b 4a LSR A &250c 4a LSR A &250d 4a LSR A &250e 85 75 STA &75 ; change_in_x &2510 68 PLA &2511 29 10 AND #&10 &2513 d0 18 BNE &252d ; enemy_is_moving_right ; enemy_is_moving_left &2515 38 SEC &2516 bd 00 01 LDA &0100,X ; enemies_screen_address_low &2519 e5 82 SBC &82 ; change_in_screen_address &251b 9d 00 01 STA &0100,X ; enemies_screen_address_low &251e b0 04 BCS &2524 &2520 de 01 01 DEC &0101,X ; enemies_screen_address_high &2523 38 SEC &2524 bd 06 01 LDA &0106,X ; enemies_x &2527 e5 75 SBC &75 ; change_in_x &2529 9d 06 01 STA &0106,X ; enemies_x &252c 60 RTS ; enemy_is_moving_right &252d 18 CLC &252e bd 00 01 LDA &0100,X ; enemies_screen_address_low &2531 65 82 ADC &82 ; change_in_screen_address &2533 9d 00 01 STA &0100,X ; enemies_screen_address_low &2536 90 04 BCC &253c &2538 fe 01 01 INC &0101,X ; enemies_screen_address_high &253b 18 CLC &253c bd 06 01 LDA &0106,X ; enemies_x &253f 65 75 ADC &75 ; change_in_x &2541 9d 06 01 STA &0106,X ; enemies_x &2544 60 RTS ; move_enemy_vertically &2545 48 PHA &2546 a0 02 LDY #&02 # Slow enemies move 2 pixels vertically per frame &2548 29 40 AND #&40 # Bit &40 of enemies_flags is set for fast enemies &254a f0 02 BEQ &254e ; enemy_is_slow ; enemy_is_fast &254c a0 04 LDY #&04 # Fast enemies move 4 pixels vertically per frame ; enemy_is_slow &254e 68 PLA ; move_enemy_vertically_set_amount &254f 48 PHA &2550 84 82 STY &82 ; change_in_screen_address &2552 98 TYA &2553 4a LSR A &2554 85 75 STA &75 ; change_in_y &2556 68 PLA &2557 29 10 AND #&10 &2559 d0 30 BNE &258b ; enemy_is_moving_down ; enemy_is_moving_up &255b bd 00 01 LDA &0100,X ; enemies_screen_address_low &255e 29 07 AND #&07 &2560 d0 11 BNE &2573 ; same_group_up &2562 38 SEC &2563 bd 00 01 LDA &0100,X ; enemies_screen_address_low &2566 e9 38 SBC #&38 &2568 9d 00 01 STA &0100,X ; enemies_screen_address_low &256b bd 01 01 LDA &0101,X ; enemies_screen_address_high &256e e9 02 SBC #&02 &2570 9d 01 01 STA &0101,X ; enemies_screen_address_high ; same_group_up &2573 38 SEC &2574 bd 00 01 LDA &0100,X ; enemies_screen_address_low &2577 e5 82 SBC &82 ; change_in_screen_address &2579 9d 00 01 STA &0100,X ; enemies_screen_address_low &257c b0 04 BCS &2582 &257e de 01 01 DEC &0101,X ; enemies_screen_address_high &2581 38 SEC &2582 bd 07 01 LDA &0107,X ; enemies_y &2585 e5 75 SBC &75 ; change_in_y &2587 9d 07 01 STA &0107,X ; enemies_y &258a 60 RTS ; enemy_is_moving_down &258b 18 CLC &258c bd 00 01 LDA &0100,X ; enemies_screen_address_low &258f 65 82 ADC &82 ; change_in_screen_address &2591 9d 00 01 STA &0100,X ; enemies_screen_address_low &2594 90 03 BCC &2599 &2596 fe 01 01 INC &0101,X ; enemies_screen_address_high &2599 bd 00 01 LDA &0100,X ; enemies_screen_address_low &259c 29 07 AND #&07 &259e d0 11 BNE &25b1 ; same_group_down &25a0 18 CLC &25a1 bd 00 01 LDA &0100,X ; enemies_screen_address_low &25a4 69 38 ADC #&38 &25a6 9d 00 01 STA &0100,X ; enemies_screen_address_low &25a9 bd 01 01 LDA &0101,X ; enemies_screen_address_high &25ac 69 02 ADC #&02 &25ae 9d 01 01 STA &0101,X ; enemies_screen_address_high ; same_group_down &25b1 18 CLC &25b2 bd 07 01 LDA &0107,X ; enemies_y &25b5 65 75 ADC &75 &25b7 9d 07 01 STA &0107,X ; enemies_y &25ba 60 RTS ; plot_enemy &25bb a6 81 LDX &81 &25bd bd 00 01 LDA &0100,X ; enemies_screen_address_low &25c0 85 94 STA &94 ; screen_address_low &25c2 bd 01 01 LDA &0101,X ; enemies_screen_address_high &25c5 85 95 STA &95 ; screen_address_high &25c7 bd 03 01 LDA &0103,X ; enemies_flags &25ca 48 PHA &25cb a0 00 LDY #&00 &25cd 29 10 AND #&10 # Bit &10 of enemies_flags determines sprite flipping &25cf d0 02 BNE &25d3 ; skip_flipping_enemy_sprite &25d1 a0 20 LDY #&20 # Bit &20 of sprite set if flipped ; skip_flipping_enemy_sprite &25d3 68 PLA ; enemy_flags &25d4 29 04 AND #&04 # Bit &04 of enemies_flags determines animation frame &25d6 f0 04 BEQ &25dc ; skip_second_frame &25d8 98 TYA &25d9 09 10 ORA #&10 # Bit &10 of sprite set if second frame &25db a8 TAY ; skip_second_frame &25dc 98 TYA &25dd 1d 02 01 ORA &0102,X ; enemies_sprite &25e0 20 e6 25 JSR &25e6 ; use_enemy_sprite &25e3 4c d0 06 JMP &06d0 ; plot_sprite ; use_enemy_sprite &25e6 48 PHA &25e7 29 0f AND #&0f &25e9 a8 TAY &25ea 0a ASL A &25eb 85 76 STA &76 ; sprite_x2 # All enemies apart from RAINDROP have two versions of &25ed 68 PLA ; sprite # each frame; one facing right, one facing left &25ee 4a LSR A &25ef 4a LSR A &25f0 4a LSR A &25f1 4a LSR A &25f2 c0 0a CPY #&0a &25f4 90 04 BCC &25fa ; not_sprite_with_unpacked_flipped_version &25f6 c9 02 CMP #&02 # If sprite is set to be flipped, &25f8 b0 32 BCS &262c ; use_unpacked_sprite_buffer # use unpacked buffer; never actually used ; not_sprite_with_unpacked_flipped_version &25fa c0 04 CPY #&04 &25fc 90 01 BCC &25ff ; not_spring_or_bird &25fe 4a LSR A # Only SPRING and BIRD have second frame ; not_spring_or_bird &25ff 18 CLC # A = 1 if sprite is set to be flipped &2600 65 76 ADC &76 ; sprite_x2 &2602 a0 00 LDY #&00 &2604 84 96 STY &96 ; sprite_address_low &2606 4a LSR A &2607 66 96 ROR &96 ; sprite_address_low &2609 4a LSR A &260a 66 96 ROR &96 ; sprite_address_low &260c a4 96 LDY &96 ; sprite_address_low &260e 48 PHA &260f 4a LSR A &2610 66 96 ROR &96 ; sprite_address_low &2612 85 97 STA &97 ; sprite_address_high &2614 18 CLC &2615 98 TYA &2616 65 96 ADC &96 ; sprite_address_low &2618 85 96 STA &96 ; sprite_address_low &261a 68 PLA &261b 65 97 ADC &97 ; sprite_address_high &261d 69 13 ADC #&13 ; &1380 = enemy_sprites &261f 85 97 STA &97 ; sprite_address_high &2621 a5 96 LDA &96 ; sprite_address_low &2623 69 80 ADC #&80 &2625 85 96 STA &96 ; sprite_address_low &2627 90 02 BCC &262b &2629 e6 97 INC &97 ; sprite_address_high &262b 60 RTS ; use_unpacked_sprite_buffer &262c a9 a0 LDA #&a0 &262e 85 96 STA &96 ; sprite_address_low &2630 a9 04 LDA #&04 ; &04a0 = unpacked_sprite_buffer &2632 85 97 STA &97 ; sprite_address_high &2634 60 RTS ; wipe_block &2635 18 CLC &2636 a5 75 LDA &75 ; screen_address_low &2638 69 40 ADC #&40 &263a 85 7d STA &7d ; lower_screen_address_low &263c a5 76 LDA &76 ; screen_address_high &263e 69 02 ADC #&02 &2640 85 7e STA &7e ; lower_screen_address_high &2642 a9 00 LDA #&00 &2644 a0 2f LDY #&2f ; wipe_block_loop &2646 91 75 STA (&75),Y ; screen_address &2648 91 7d STA (&7d),Y ; lower_screen_address &264a 88 DEY &264b 10 f9 BPL &2646 ; wipe_block_loop &264d 60 RTS ; plot_unpacked_sprite &264e 18 CLC &264f a5 75 LDA &75 ; screen_address_low &2651 69 40 ADC #&40 &2653 85 7d STA &7d ; lower_screen_address_low &2655 a5 76 LDA &76 ; screen_address_high &2657 69 02 ADC #&02 &2659 85 7e STA &7e ; lower_screen_address_high &265b a0 2f LDY #&2f ; plot_unpacked_sprite_loop &265d b9 a0 04 LDA &04a0,Y ; unpacked_sprite_buffer &2660 91 75 STA (&75),Y ; screen_address &2662 b9 d0 04 LDA &04d0,Y ; unpacked_sprite_buffer + &30 &2665 91 7d STA (&7d),Y ; lower_screen_address &2667 88 DEY &2668 10 f3 BPL &265d ; plot_unpacked_sprite_loop &266a 60 RTS ; update_ropes &266b a2 00 LDX #&00 &266d 86 75 STX &75 ; rope_offset ; update_ropes_loop &266f bd 87 01 LDA &0187,X ; room_blocks &2672 10 07 BPL &267b ; block_hasn't_already_been_affected # Top bit set if a previous block has affected this one &2674 29 7f AND #&7f &2676 9d 87 01 STA &0187,X ; room_blocks # Unset it, so this block will be updated next time &2679 d0 2f BNE &26aa ; consider_next_block_for_rope ; block_hasn't_already_been_affected &267b 29 3f AND #&3f &267d c9 08 CMP #&08 &267f b0 29 BCS &26aa ; consider_next_block_for_rope &2681 dd 87 01 CMP &0187,X ; room_blocks &2684 f0 24 BEQ &26aa ; consider_next_block_for_rope # Only process block if between &40 to &47 &2686 bd 93 01 LDA &0193,X ; room_blocks + 12 &2689 29 3f AND #&3f &268b c9 08 CMP #&08 &268d f0 05 BEQ &2694 ; rope_could_extend_into_block_below # Block below is &48 if rope hasn't extended into it &268f dd 93 01 CMP &0193,X ; room_blocks + 12 &2692 d0 16 BNE &26aa ; consider_next_block_for_rope # Skip if block below is a partially extended rope ; rope_could_extend_into_block_below &2694 a4 75 LDY &75 ; rope_offset &2696 b9 6e 01 LDA &016e,Y ; ropes_screen_address_high &2699 08 PHP &269a bd 87 01 LDA &0187,X ; room_blocks &269d 29 3f AND #&3f &269f 28 PLP &26a0 30 5e BMI &2700 ; lengthen_rope # Top bit of ropes_screen_address_high &26a2 10 30 BPL &26d4 ; shorten_rope # is set if rope is lengthening, unset if shortening ; update_rope &26a4 bd 87 01 LDA &0187,X ; room_blocks ; update_rope_from_a &26a7 20 33 27 JSR &2733 ; plot_end_of_rope ; consider_next_block_for_rope &26aa e6 75 INC &75 ; rope_offset # Increase rope_offset by 2 per block &26ac e6 75 INC &75 ; rope_offset &26ae a5 75 LDA &75 ; rope_offset &26b0 c9 18 CMP #&18 &26b2 90 04 BCC &26b8 ; skip_reset &26b4 a9 00 LDA #&00 &26b6 85 75 STA &75 ; rope_offset # Reset rope_offset at start of next row of blocks ; skip_reset &26b8 e8 INX &26b9 e0 6c CPX #&6c # Continue for 9 rows of 12 blocks &26bb d0 b2 BNE &266f ; update_ropes_loop &26bd 60 RTS ; toggle_direction_of_rope &26be b9 6e 01 LDA &016e,Y ; ropes_screen_address_high &26c1 49 80 EOR #&80 # Toggle whether rope is lengthening or shortening &26c3 99 6e 01 STA &016e,Y ; ropes_screen_address_high &26c6 08 PHP &26c7 a9 40 LDA #&40 # &40 = zero length rope; &47 = full length rope &26c9 28 PLP &26ca 30 02 BMI &26ce ; rope_is_now_lengthening &26cc 09 07 ORA #&07 # Set to &40 if lengthening, &47 if shortening ; rope_is_now_lengthening &26ce 9d 87 01 STA &0187,X ; room_blocks &26d1 4c a4 26 JMP &26a4 ; update_rope ; shorten_rope &26d4 38 SEC &26d5 e9 01 SBC #&01 # Shorten the rope by one &26d7 09 40 ORA #&40 &26d9 9d 87 01 STA &0187,X ; room_blocks &26dc b0 c6 BCS &26a4 ; update_rope # If still in the same block, update it &26de bd 7b 01 LDA &017b,X ; room_blocks - 12 &26e1 29 40 AND #&40 # Otherwise, if the block above is not a rope &26e3 f0 d9 BEQ &26be ; toggle_direction_of_rope # then set the rope lengthening &26e5 a9 48 LDA #&48 # If the block above is a rope, &26e7 9d 87 01 STA &0187,X ; room_blocks # set this block to be a fully retreated rope &26ea b9 6d 01 LDA &016d,Y ; ropes_screen_address_low &26ed e9 7f SBC #&7f &26ef 99 6d 01 STA &016d,Y ; ropes_screen_address_low &26f2 b9 6e 01 LDA &016e,Y ; ropes_screen_address_high &26f5 e9 04 SBC #&04 &26f7 99 6e 01 STA &016e,Y ; ropes_screen_address_high &26fa bd 7b 01 LDA &017b,X ; room_blocks - 12 # and use the block above to update the rope &26fd 4c a7 26 JMP &26a7 ; update_rope_from_a ; lengthen_rope &2700 18 CLC &2701 69 01 ADC #&01 # Lengthen the rope by one &2703 09 40 ORA #&40 &2705 9d 87 01 STA &0187,X ; room_blocks &2708 c9 48 CMP #&48 &270a d0 98 BNE &26a4 ; update_rope # If still in the same block, update it &270c bd 93 01 LDA &0193,X ; room_blocks + 12 &270f 29 40 AND #&40 # Otherwise, if the block below is not a rope &2711 f0 ab BEQ &26be ; toggle_direction_of_rope # then set the rope shortening &2713 a9 47 LDA #&47 # If the block below is a rope, &2715 9d 87 01 STA &0187,X ; room_blocks # set this block to be a fully extended rope &2718 a9 c0 LDA #&c0 # set the block below to be zero length &271a 9d 93 01 STA &0193,X ; room_blocks + 12 # (top bit set so that it isn't updated this frame) &271d 18 CLC &271e b9 6d 01 LDA &016d,Y ; ropes_screen_address_low &2721 69 80 ADC #&80 &2723 99 6d 01 STA &016d,Y ; ropes_screen_address_low &2726 b9 6e 01 LDA &016e,Y ; ropes_screen_address_high &2729 69 04 ADC #&04 &272b 99 6e 01 STA &016e,Y ; ropes_screen_address_high &272e a9 40 LDA #&40 &2730 4c a7 26 JMP &26a7 ; update_rope_from_a # and update the rope ; plot_end_of_rope &2733 48 PHA # A is the block type of the end of the rope &2734 29 03 AND #&03 &2736 0a ASL A &2737 79 6d 01 ADC &016d,Y ; ropes_screen_address_low # Calculate a screen address, two pixels per rope length &273a 85 7d STA &7d ; rope_screen_address_low &273c b9 6e 01 LDA &016e,Y ; ropes_screen_address_high &273f 29 7f AND #&7f &2741 69 00 ADC #&00 &2743 85 7e STA &7e ; rope_screen_address_high &2745 68 PLA &2746 29 04 AND #&04 &2748 f0 0d BEQ &2757 ; same_group &274a 18 CLC &274b a5 7d LDA &7d ; rope_screen_address_low &274d 69 40 ADC #&40 &274f 85 7d STA &7d ; rope_screen_address_low &2751 a5 7e LDA &7e ; rope_screen_address_high &2753 69 02 ADC #&02 &2755 85 7e STA &7e ; rope_screen_address_high ; same_group &2757 a0 10 LDY #&10 &2759 ad 6c 01 LDA &016c ; room_colours + 2 # Plot the rope over two bytes, one pixel in each &275c 29 55 AND #&55 ; right pixel &275e 49 05 EOR #&05 &2760 48 PHA &2761 51 7d EOR (&7d),Y ; rope_screen_address &2763 91 7d STA (&7d),Y ; rope_screen_address &2765 c8 INY &2766 68 PLA ; rope_pixel_value &2767 51 7d EOR (&7d),Y ; rope_screen_address &2769 91 7d STA (&7d),Y ; rope_screen_address &276b a0 18 LDY #&18 &276d ad 6c 01 LDA &016c ; room_colours + 2 &2770 29 aa AND #&aa ; left pixel &2772 49 02 EOR #&02 &2774 48 PHA &2775 51 7d EOR (&7d),Y ; rope_screen_address &2777 91 7d STA (&7d),Y ; rope_screen_address &2779 c8 INY &277a 68 PLA ; rope_pixel_value &277b 51 7d EOR (&7d),Y ; rope_screen_address &277d 91 7d STA (&7d),Y ; rope_screen_address &277f 60 RTS ; check_if_pockets_contain_object &2780 48 PHA &2781 a5 51 LDA &51 ; pocket_one &2783 0a ASL A &2784 0a ASL A &2785 0a ASL A &2786 aa TAX &2787 68 PLA &2788 dd 04 03 CMP &0304,X ; objects_sprite &278b f0 0b BEQ &2798 ; leave &278d 48 PHA &278e a5 52 LDA &52 ; pocket_two &2790 0a ASL A &2791 0a ASL A &2792 0a ASL A &2793 aa TAX &2794 68 PLA &2795 dd 04 03 CMP &0304,X ; objects_sprite ; leave &2798 60 RTS ; calculate_room_block_offset_of_object &2799 bd 02 03 LDA &0302,X ; objects_screen_address_low &279c 85 4a STA &4a ; block_address_low &279e bd 03 03 LDA &0303,X ; objects_screen_address_high &27a1 85 4b STA &4b ; block_address_high ; calculate_room_block_offset_from_screen_address &27a3 a0 00 LDY #&00 &27a5 84 7d STY &7d ; consider_screen_address_low &27a7 a9 53 LDA #&53 &27a9 85 7e STA &7e ; consider_screen_address_high ; block_row_loop &27ab a9 0c LDA #&0c &27ad 85 75 STA &75 ; blocks_left_in_row ; block_column_loop &27af a5 4a LDA &4a ; block_address_low &27b1 c5 7d CMP &7d ; consider_screen_address_low &27b3 d0 06 BNE &27bb &27b5 a5 4b LDA &4b ; block_address_high &27b7 c5 7e CMP &7e ; consider_screen_address_high &27b9 f0 1f BEQ &27da ; leave &27bb c8 INY &27bc 18 CLC &27bd a5 7d LDA &7d ; consider_screen_address_low &27bf 69 30 ADC #&30 &27c1 85 7d STA &7d ; consider_screen_address_low &27c3 90 02 BCC &27c7 &27c5 e6 7e INC &7e ; consider_screen_address_high &27c7 c6 75 DEC &75 ; blocks_left_in_row &27c9 d0 e4 BNE &27af ; block_column_loop &27cb 18 CLC &27cc a5 7d LDA &7d ; consider_screen_address_low &27ce 69 40 ADC #&40 &27d0 85 7d STA &7d ; consider_screen_address_low &27d2 a5 7e LDA &7e ; consider_screen_address_high &27d4 69 02 ADC #&02 &27d6 85 7e STA &7e ; consider_screen_address_high &27d8 90 d1 BCC &27ab ; block_row_loop ; leave &27da 60 RTS ; calculate_puzzle_x_and_y_from_room_block &27db 98 TYA &27dc 48 PHA &27dd a0 0c LDY #&0c &27df 4a LSR A &27e0 08 PHP ; divide_by_six_loop &27e1 88 DEY &27e2 d9 fb 28 CMP &28fb,Y ; table_of_sixes &27e5 90 fa BCC &27e1 ; divide_by_six_loop &27e7 84 6a STY &6a ; puzzle_y &27e9 f9 fb 28 SBC &28fb,Y ; table_of_sixes &27ec 28 PLP &27ed 2a ROL A &27ee a8 TAY &27ef b9 fb 28 LDA &28fb,Y ; table_of_sixes &27f2 85 69 STA &69 ; puzzle_x &27f4 86 6b STX &6b ; puzzle_block_type &27f6 a5 6a LDA &6a ; puzzle_y &27f8 0a ASL A &27f9 0a ASL A &27fa 0a ASL A &27fb 85 6a STA &6a ; puzzle_y &27fd 68 PLA &27fe a8 TAY &27ff 60 RTS ; check_for_player_collision_with_enemy &2800 a6 81 LDX &81 ; enemy_offset # Is the player touching the enemy? &2802 18 CLC &2803 bd 06 01 LDA &0106,X ; enemies_x &2806 69 03 ADC #&03 &2808 c5 58 CMP &58 ; player_x &280a 90 46 BCC &2852 ; leave &280c a5 58 LDA &58 ; player_x &280e 69 02 ADC #&02 &2810 dd 06 01 CMP &0106,X ; enemies_x &2813 90 3d BCC &2852 ; leave &2815 a5 59 LDA &59 ; player_y &2817 69 06 ADC #&06 &2819 dd 07 01 CMP &0107,X ; enemies_y &281c 90 34 BCC &2852 ; leave &281e bd 07 01 LDA &0107,X ; enemies_y &2821 69 06 ADC #&06 &2823 c5 59 CMP &59 ; player_y &2825 90 2b BCC &2852 ; leave &2827 bd 02 01 LDA &0102,X ; enemies_sprite &282a a8 TAY &282b 18 CLC &282c b9 cf 2e LDA &2ecf,Y ; damage_from_enemies # If so, incur damage depending on type of enemy &282f 65 88 ADC &88 ; damage &2831 85 88 STA &88 ; damage &2833 a9 35 LDA #&35 : SWORD &2835 a4 51 LDY &51 ; pocket_one &2837 20 c1 2e JSR &2ec1 ; check_if_slot_contains_object &283a b0 07 BCS &2843 ; player_has_sword &283c a4 52 LDY &52 ; pocket_two &283e 20 c1 2e JSR &2ec1 ; check_if_slot_contains_object &2841 90 0f BCC &2852 ; leave ; player_has_sword # If the player is carrying the SWORD, &2843 bd 02 01 LDA &0102,X ; enemies_sprite &2846 d0 0a BNE &2852 ; leave # and the enemy is a SPRING, &2848 20 bb 25 JSR &25bb ; plot_enemy # remove the enemy from the screen &284b a6 81 LDX &81 ; enemy_offset &284d a9 ff LDA #&ff &284f 9d 01 01 STA &0101,X ; enemies_screen_address_high &2852 60 RTS ; check_if_player_has_touched_puzzle_block &2853 a5 41 LDA &41 ; player_has_changed_room &2855 d0 46 BNE &289d ; leave &2857 18 CLC &2858 a5 69 LDA &69 ; puzzle_x # Is the player touching the puzzle block? &285a 69 05 ADC #&05 &285c c5 58 CMP &58 ; player_x &285e 90 3d BCC &289d &2860 a5 58 LDA &58 ; player_x &2862 69 04 ADC #&04 &2864 c5 69 CMP &69 ; puzzle_x &2866 90 35 BCC &289d &2868 a5 59 LDA &59 ; player_y &286a 69 07 ADC #&07 &286c c5 6a CMP &6a ; puzzle_y &286e 90 2d BCC &289d &2870 a5 6a LDA &6a ; puzzle_y &2872 69 07 ADC #&07 &2874 c5 59 CMP &59 ; player_y &2876 90 25 BCC &289d &2878 a5 6b LDA &6b ; puzzle_block_type &287a c9 f5 CMP #&f5 &287c b0 04 BCS &2882 ; not_a_gate &287e aa TAX &287f bd 04 03 LDA &0304,X ; objects_sprite ; not_a_gate &2882 a0 fd LDY #&fd ; find_puzzle_block_routine_loop # If so, call the routine corresponding to it &2884 c8 INY &2885 c8 INY &2886 c8 INY &2887 c0 18 CPY #&18 &2889 f0 12 BEQ &289d ; leave &288b d9 e8 05 CMP &05e8,Y ; puzzle_block_routines_table &288e d0 f4 BNE &2884 ; find_puzzle_block_routine_loop &2890 b9 e9 05 LDA &05e9,Y ; puzzle_block_routines_table + 1 &2893 85 7d STA &7d ; puzzle_block_routine_address_low &2895 b9 ea 05 LDA &05ea,Y ; puzzle_block_routines_table + 2 &2898 85 7e STA &7e ; puzzle_block_routine_address_high &289a 6c 7d 00 JMP (&007d) ; puzzle_block_routine_address ; leave &289d 60 RTS ; handle_gate # If the player has touched a gate, &289e a9 58 LDA #&58 &28a0 85 75 STA &75 ; screen_address_low &28a2 a9 50 LDA #&50 ; &5058 = screen address of pocket two &28a4 85 76 STA &76 ; screen_address_high &28a6 a5 52 LDA &52 ; pocket_two &28a8 20 e0 28 JSR &28e0 ; check_if_key_matches_gate &28ab 85 52 STA &52 ; pocket_two &28ad b0 0d BCS &28bc ; key_matches_gate # do they have the corresponding key in pocket two? &28af a9 90 LDA #&90 ; &5090 = screen address of pocket one &28b1 85 75 STA &75 ; screen_address_low &28b3 a5 51 LDA &51 ; pocket_one &28b5 20 e0 28 JSR &28e0 ; check_if_key_matches_gate &28b8 85 51 STA &51 ; pocket_one &28ba 90 e1 BCC &289d ; leave # or pocket one? ; key_matches_gate &28bc 20 35 26 JSR &2635 ; wipe_block # If so, unplot key from pocket &28bf 20 99 27 JSR &2799 ; calculate_room_block_offset_of_object &28c2 a9 00 LDA #&00 ; SPACE &28c4 99 87 01 STA &0187,Y ; room_blocks &28c7 bd 02 03 LDA &0302,X ; objects_screen_address_low &28ca 85 75 STA &75 ; screen_address_low &28cc bd 03 03 LDA &0303,X ; objects_screen_address_high &28cf 85 76 STA &76 ; screen_address_high &28d1 a9 ff LDA #&ff &28d3 9d 00 03 STA &0300,X ; objects_room_x # Mark gate as having been unlocked &28d6 85 69 STA &69 ; puzzle_x &28d8 20 35 26 JSR &2635 ; wipe_block # Unplot gate &28db a9 03 LDA #&03 &28dd 4c 18 2a JMP &2a18 ; add_to_score # Score 3% for unlocking gate ; check_if_key_matches_gate &28e0 48 PHA &28e1 0a ASL A &28e2 0a ASL A &28e3 0a ASL A &28e4 a8 TAY &28e5 b9 05 03 LDA &0305,Y ; objects_palette # Does the key match the colour of the gate? &28e8 dd 05 03 CMP &0305,X ; objects_palette &28eb d0 0b BNE &28f8 ; key_doesn't_match &28ed b9 04 03 LDA &0304,Y ; objects_sprite &28f0 c9 2d CMP #&2d ; KEY &28f2 d0 04 BNE &28f8 ; key_doesn't_match &28f4 68 PLA ; key &28f5 a9 ff LDA #&ff # If so, leave with &ff and carry set &28f7 60 RTS ; key_doesn't_match &28f8 68 PLA ; key &28f9 18 CLC # If not, leave with key and carry clear &28fa 60 RTS ; table_of_sixes &28fb 00 06 0c 12 18 1e 24 2a 30 36 3c 42 ; bl sp+1 ; block_translation_table &2907 0f 03 ; block &32 (PASSABLE_BRICK) treated as LADDER, appears as BRICK &2909 0f 04 ; block &33 (PASSABLE_STONE) treated as LADDER, appears as STONE &290b 40 00 ; block &34 (ROPE_END) treated as ROPE_FULLY_RETRACTED, appears as SPACE &290d 47 10 ; block &35 (ROPE_MIDDLE) treated as ROPE_FULLY_EXTENDED, appears as ROPE &290c 00 1e ; block &36 (TOWER_GUARD) treated as SPACE, appears as TOWER_GUARD &290d 03 1f ; block &37 (PRIEST) treated as BRICK, appears as PRIEST &2913 1b 20 ; block &38 (IMP) treated as SPIKES, appears as IMP &2915 00 21 ; block &39 (PRINCESS_FEET) treated as SPACE, appears as PRINCESS_FEET &2917 00 25 ; block &3a (FINAL_GUARD) treated as SPACE, appears as FINAL_GUARD &2919 00 1d ; block &3b (PRINCESS_HEAD) treated as SPACE, appears as PRINCESS_HEAD &291b 00 00 ; block &3c (FIREPIT_ODDNESS) treated as SPACE, appears as SPACE &291d 1b 23 ; block &3d (FIRE) treated as SPIKES, appears as FIRE &291f 03 26 ; block &3e (BRIDGE_BASE) treated as BRICK, appears as BRIDGE_BASE &2921 1b 28 ; block &3f (WATER) treated as SPIKES, appears as WATER ; display_title_screen &2923 a9 51 LDA #&51 &2925 20 ec 31 JSR &31ec ; plot_room # Display title screen &2928 a2 e8 LDX #&e8 &292a a0 2e LDY #&2e ; &2ee8 ; title_screen_text &292c 20 67 29 JSR &2967 ; plot_text &292f a9 ff LDA #&ff &2931 20 54 29 JSR &2954 ; wait_for_space_or_timeout &2934 b0 30 BCS &2966 ; leave &2936 a9 01 LDA #&01 ; non_title_screen_rooms_loop &2938 c9 5a CMP #&5a &293a b0 0c BCS &2948 ; get_another_random_number &293c 48 PHA &293d 20 ec 31 JSR &31ec ; plot_room # Display screens in a pseudo-random order &2940 a9 7d LDA #&7d &2942 20 54 29 JSR &2954 ; wait_for_space_or_timeout &2945 68 PLA &2946 b0 db BCS &2923 ; display_title_screen ; get_another_random_number &2948 85 81 STA &81 ; rnd &294a 20 2c 2d JSR &2d2c ; shuffle_rnd &294d c9 51 CMP #&51 &294f d0 e7 BNE &2938 ; non_title_screen_rooms_loop &2951 4c 23 29 JMP &2923 ; display_title_screen ; wait_for_space_or_timeout &2954 85 7d STA &7d ; timer ; wait_for_space_or_timeout_loop &2956 a5 ec LDA &ec ; Internal key number of most recently pressed key &2958 c9 e2 CMP #&e2 &295a f0 0a BEQ &2966 ; leave &295c a9 13 LDA #&13 ; Wait for Vertical Retrace &295e 20 f4 ff JSR &fff4 ; OSBYTE &2961 c6 7d DEC &7d ; timer &2963 d0 f1 BNE &2956 ; wait_for_space_or_timeout &2965 18 CLC ; leave &2966 60 RTS ; plot_text &2967 86 7d STX &7d ; text_address_low &2969 84 7e STY &7e ; text_address_high &296b a0 00 LDY #&00 ; plot_text_loop &296d b1 7d LDA (&7d),Y ; text_address &296f 10 16 BPL &2987 ; is_character # Top bit set indicates next three bytes are settings &2971 c9 ff CMP #&ff &2973 f0 1c BEQ &2991 ; leave &2975 c8 INY &2976 b1 7d LDA (&7d),Y ; text_address # Two bytes for screen address to plot text at &2978 85 90 STA &90 ; screen_address_low &297a c8 INY &297b b1 7d LDA (&7d),Y ; text_address &297d 85 91 STA &91 ; screen_address_high &297f c8 INY &2980 b1 7d LDA (&7d),Y ; text_address # One byte for text colour &2982 85 92 STA &92 ; character_colour &2984 c8 INY &2985 b1 7d LDA (&7d),Y ; text_address ; is_character &2987 84 75 STY &75 ; text_offset &2989 20 50 04 JSR &0450 ; plot_character # Otherwise, treat as character &298c a4 75 LDY &75 ; text_offset &298e c8 INY &298f d0 dc BNE &296d ; plot_text_loop &2991 60 RTS ; unpack_background_sprite &2992 a2 a0 LDX #&a0 &2994 86 96 STX &96 ; sprite_address_low &2996 86 70 STX &70 ; unpacked_address_low &2998 a0 04 LDY #&04 ; &04a0 = unpacked_sprite_buffer &299a 84 97 STY &97 ; sprite_address_high &299c 84 71 STY &71 ; unpacked_address_high &299e a0 09 LDY #&09 ; &0900 = packed_background_sprite_data &29a0 84 73 STY &73 ; packed_address_high &29a2 a0 00 LDY #&00 &29a4 84 72 STY &72 ; packed_address_low &29a6 c5 7f CMP &7f ; previous_sprite &29a8 f0 56 BEQ &2a00 ; leave &29aa 85 7f STA &7f ; previous_sprite &29ac aa TAX &29ad f0 0e BEQ &29bd ; skip_finding_sprite_data ; find_sprite_data_loop &29af 18 CLC &29b0 b1 72 LDA (&72),Y ; packed_address # One byte for length of sprite data &29b2 65 72 ADC &72 ; packed_address_low &29b4 85 72 STA &72 ; packed_address_low &29b6 90 02 BCC &29ba ; find_sprite_data_loop &29b8 e6 73 INC &73 ; packed_address_high &29ba ca DEX &29bb d0 f2 BNE &29af ; loop ; skip_finding_sprite_data &29bd a9 01 LDA #&01 &29bf 85 74 STA &74 ; remaining_pages &29c1 e6 72 INC &72 ; packed_address_low &29c3 d0 02 BNE &29c7 &29c5 e6 73 INC &73 ; packed_address_high &29c7 a9 01 LDA #&01 &29c9 85 78 STA &78 ; bits_remaining &29cb a2 06 LDX #&06 ; unpack_data_with_x_bits_per_value # This is also called for room data, but with X = 7 &29cd 86 98 STX &98 ; number_of_bits &29cf a0 00 LDY #&00 ; unpack_data_loop &29d1 a6 98 LDX &98 ; number_of_bits &29d3 20 f7 29 JSR &29f7 ; get_x_bits_of_packed_data # Get number of bits data &29d6 85 82 STA &82 ; value # for the value of the next run of bytes &29d8 20 01 2a JSR &2a01 ; get_bit_of_packed_data &29db 90 06 BCC &29e3 ; single_byte_run # If the next bit is set, &29dd a2 06 LDX #&06 &29df 20 f7 29 JSR &29f7 ; get_x_bits_of_packed_data # then get six bits for the length of the run - 1 &29e2 aa TAX ; single_byte_run &29e3 e8 INX # otherwise, the run is one byte long &29e4 a5 82 LDA &82 ; value ; run_length_loop &29e6 91 70 STA (&70),Y ; unpacked_address &29e8 e6 70 INC &70 ; unpacked_address_low &29ea d0 06 BNE &29f2 ; not_crossed_page_boundary &29ec e6 71 INC &71 ; unpacked_address_high &29ee c6 74 DEC &74 ; remaining_pages # Don't allow unpacked data to cross into next page &29f0 f0 0e BEQ &2a00 ; leave # (suggests unpacking routine copied from elsewhere) ; not_crossed_page_boundary &29f2 ca DEX &29f3 d0 f1 BNE &29e6 ; run_length_loop &29f5 f0 da BEQ &29d1 ; unpack_data_loop ; get_x_bits_of_packed_data &29f7 a9 00 LDA #&00 ; get_x_bits_of_packed_data_loop &29f9 20 01 2a JSR &2a01 ; get_bit_of_packed_data &29fc 2a ROL A &29fd ca DEX &29fe d0 f9 BNE &29f9 ; get_x_bits_of_packed_data_loop ; leave &2a00 60 RTS ; get_bit_of_packed_data &2a01 c6 78 DEC &78 ; bits_remaining &2a03 d0 10 BNE &2a15 ; return_lowest_bit &2a05 48 PHA &2a06 a9 08 LDA #&08 &2a08 85 78 STA &78 ; return_lowest_bit &2a0a b1 72 LDA (&72),Y ; packed_address &2a0c 85 77 STA &77 ; byte_of_sprite_data &2a0e 68 PLA &2a0f e6 72 INC &72 ; packed_address_low &2a11 d0 02 BNE &2a15 ; return_lowest_bit &2a13 e6 73 INC &73 ; packed_address_high ; return_lowest_bit &2a15 66 77 ROR &77 ; byte_of_sprite_data &2a17 60 RTS ; add_to_score &2a18 48 PHA &2a19 a9 34 LDA #&34 &2a1b a2 32 LDX #&32 &2a1d a0 3c LDY #&3c &2a1f 20 80 08 JSR &0880 ; play_sound &2a22 68 PLA ; score_to_add ; plot_score &2a23 48 PHA &2a24 a2 d0 LDX #&d0 &2a26 a0 4f LDY #&4f ; &4fd0 = screen address of score &2a28 a9 0d LDA #&0d ; GY &2a2a 20 43 31 JSR &3143 ; set_character_address_and_colour &2a2d 68 PLA ; score_to_add &2a2e 18 CLC &2a2f f8 SED &2a30 65 57 ADC &57 ; score &2a32 d8 CLD &2a33 85 57 STA &57 ; score &2a35 a9 28 LDA #&28 ; " " &2a37 90 02 BCC &2a3b ; not_one_hundred &2a39 a9 01 LDA #&01 ; "1" ; not_one_hundred &2a3b 20 50 04 JSR &0450 ; plot_character &2a3e a5 57 LDA &57 ; score &2a40 48 PHA &2a41 4a LSR A &2a42 4a LSR A &2a43 4a LSR A &2a44 4a LSR A &2a45 20 50 04 JSR &0450 ; plot_character &2a48 68 PLA ; score &2a49 29 0f AND #&0f &2a4b 20 50 04 JSR &0450 ; plot_character &2a4e a9 25 LDA #&25A ; "%" &2a50 4c 50 04 JMP &0450 ; plot_character ; plot_room_block &2a53 bd 87 01 LDA &0187,X ; room_blocks &2a56 10 52 BPL &2aaa ; leave # If the top bit is unset, the block has been plotted &2a58 29 7f AND #&7f &2a5a a8 TAY &2a5b c9 32 CMP #&32 &2a5d 90 03 BCC &2a62 ; skip_translation &2a5f 20 93 2a JSR &2a93 ; translate_room_blocks # Translate blocks with values greater or equal to &32 ; skip_translation &2a62 c4 85 CPY &85 ; current_sprite &2a64 d0 44 BNE &2aaa ; leave # Only plot blocks with the sprite currently considered &2a66 9d 87 01 STA &0187,X ; room_blocks &2a69 98 TYA &2a6a f0 24 BEQ &2a90 ; room_block_is_space # Block &00 is filled with solid black &2a6c 38 SEC &2a6d e9 01 SBC #&01 # Otherwise, block x becomes sprite (x - 1) &2a6f c9 27 CMP #&27 ; WATER &2a71 d0 0e BNE &2a81 ; isn't_water # Block &3f becomes &28, but sprite &27 isn't used &2a73 a2 5f LDX #&5f ; fill_unpacked_sprite_buffer_with_blue_loop &2a75 a9 30 LDA #&30 ; BB # Instead, the buffer is filled with solid blue &2a77 9d a0 04 STA &04a0,X ; unpacked_sprite_buffer &2a7a ca DEX &2a7b 10 fa BPL &2a77 ; fill_unpacked_sprite_buffer_with_blue_loop &2a7d 86 7f STX &7f ; previous_sprite &2a7f 30 0c BMI &2a8d ; to_plot_unpacked_sprite ; isn't_water &2a81 c5 7f CMP &7f ; previous_sprite &2a83 f0 08 BEQ &2a8d ; to_plot_unpacked_sprite &2a85 48 PHA # If this is the first time this sprite has been used, &2a86 20 92 29 JSR &2992 ; unpack_background_sprite # unpack it &2a89 68 PLA &2a8a 20 f8 23 JSR &23f8 ; set_room_block_colour ; to_plot_unpacked_sprite &2a8d 4c 4e 26 JMP &264e ; plot_unpacked_sprite ; room_block_is_space &2a90 4c 35 26 JMP &2635 ; wipe_block ; translate_room_blocks &2a93 38 SEC &2a94 e9 32 SBC #&32 # Blocks >= &32 are translated using a lookup table &2a96 0a ASL A &2a97 a8 TAY &2a98 c9 16 CMP #&16 &2a9a d0 05 BNE &2aa1 ; not_deep_water &2a9c a9 1b LDA #&1b ; SPIKES # (block &3f makes the block above it behave as spikes) &2a9e 9d 7b 01 STA &017b,X ; room_blocks - 12 # (i.e. the surface of the water is painful too) ; not_deep_water &2aa1 b9 07 29 LDA &2907,Y ; block_translation_table # which changes the way the block is treated &2aa4 48 PHA &2aa5 b9 08 29 LDA &2908,Y ; block_translation_table + 1 # and the way it appears &2aa8 a8 TAY &2aa9 68 PLA ; leave &2aaa 60 RTS ; set_room_block_to_zero_and_return_previous_value &2aab bd 87 01 LDA &0187,X ; room_blocks &2aae 48 PHA &2aaf a9 00 LDA #&00 &2ab1 9d 87 01 STA &0187,X ; room_blocks &2ab4 68 PLA &2ab5 60 RTS ; multiply_by_six &2ab6 0a ASL A &2ab7 85 75 STA &75 ; tmp &2ab9 0a ASL A &2aba 65 75 ADC &75 ; tmp &2abc 60 RTS ; wipe_enemies &2abd a9 ff LDA #&ff &2abf a2 37 LDX #&37 ; wipe_enemies_loop &2ac1 9d 00 01 STA &0100,X ; enemies_screen_address_low &2ac4 ca DEX &2ac5 10 fa BPL &2ac1 ; wipe_enemies_loop &2ac7 a9 80 LDA #&80 &2ac9 85 69 STA &69 ; puzzle_x &2acb 60 RTS ; wipe_unpacked_sprite_buffer &2acc a0 5f LDY #&5f &2ace a9 00 LDA #&00 ; wipe_unpacked_sprite_buffer_loop &2ad0 99 a0 04 STA &04a0,Y ; unpacked_sprite_buffer &2ad3 88 DEY &2ad4 10 fa BPL &2ad0 ; wipe_unpacked_sprite_buffer_loop &2ad6 84 7f STY &7f ; previous_sprite &2ad8 60 RTS ; consider_if_room_contains_magic_hat &2ad9 a2 4c LDX #&4c &2adb bd 00 04 LDA &0400,X ; magic_hat_locations &2ade c5 04 CMP &04 ; room_x &2ae0 d0 2c BNE &2b0e ; room_doesn't_contain_magic_hat &2ae2 bd 01 04 LDA &0401,X ; magic_hat_locations + 1 &2ae5 c5 05 CMP &05 ; room_y &2ae7 d0 25 BNE &2b0e ; room_doesn't_contain_magic_hat &2ae9 bd 02 04 LDA &0402,X ; magic_hat_locations + 2 &2aec 85 94 STA &94 ; screen_address_low &2aee 85 4a STA &4a ; block_address_low &2af0 bd 03 04 LDA &0403,X ; magic_hat_locations + 3 &2af3 85 95 STA &95 ; screen_address_high &2af5 85 4b STA &4b ; block_address_high &2af7 86 6c STX &6c ; puzzle_block_offset &2af9 20 a3 27 JSR &27a3 ; calculate_room_block_offset_from_screen_address &2afc a2 f5 LDX #&f5 # MAGIC_HAT has a puzzle_block_type of &f5 &2afe 20 db 27 JSR &27db ; calculate_puzzle_x_and_y_from_room_block &2b01 a9 28 LDA #&28 ; MAGIC_HAT &2b03 20 92 29 JSR &2992 ; unpack_background_sprite &2b06 a9 c0 LDA #&c0 # Colours of MAGIC_HAT change &2b08 20 a5 23 JSR &23a5 ; eor_unpacked_sprite_with_palette_value &2b0b 4c d0 06 JMP &06d0 ; plot_sprite ; room_doesn't_contain_magic_hat &2b0e ca DEX &2b0f ca DEX &2b10 ca DEX &2b11 ca DEX &2b12 10 c7 BPL &2adb ; consider_if_room_contains_magic_hat_loop &2b14 60 RTS ; consider_effect_of_object_on_room &2b15 48 PHA &2b16 a2 fc LDX #&fc ; consider_effect_of_object_on_room_loop &2b18 e8 INX &2b19 e8 INX &2b1a e8 INX &2b1b e8 INX &2b1c e0 14 CPX #&14 &2b1e f0 25 BEQ &2b45 ; leave_after_pull &2b20 bd ec 03 LDA &03ec,X ; effects_of_objects_in_specific_rooms_table &2b23 c5 04 CMP &04 ; room_x &2b25 d0 f1 BNE &2b18 ; consider_effect_of_object_on_room_loop &2b27 bd ed 03 LDA &03ed,X ; effects_of_objects_in_specific_rooms_table + 1 &2b2a c5 05 CMP &05 ; room_y &2b2c d0 ea BNE &2b18 ; consider_effect_of_object_on_room_loop &2b2e bd ee 03 LDA &03ee,X ; effects_of_objects_in_specific_rooms_table + 2 &2b31 85 75 STA &75 ; room_specific_routine_address_low &2b33 bd ef 03 LDA &03ef,X ; effects_of_objects_in_specific_rooms_table + 3 &2b36 85 76 STA &76 ; room_specific_routine_address_high &2b38 68 PLA ; object_being_dropped # Has the object been dropped in a special room? &2b39 aa TAX &2b3a bd 04 03 LDA &0304,X ; objects_sprite &2b3d e0 ff CPX #&ff &2b3f d0 01 BNE &2b42 ; not_empty_object &2b41 8a TXA ; not_empty_object &2b42 6c 75 00 JMP (&0075) ; room_specific_routine_address # If so, call the routine corresponding to it ; leave_after_pull &2b45 68 PLA &2b46 60 RTS ; object_dropped_in_the_west_tower_middle &2b47 a6 7d LDX &7d ; block_screen_address_low &2b49 86 75 STX &75 ; screen_address_low &2b4b a6 7e LDX &7e ; block_screen_address_high &2b4d 86 76 STX &76 ; screen_address_high &2b4f a2 03 LDX #&03 ; west_tower_middle_block_loop &2b51 48 PHA &2b52 38 SEC &2b53 98 TYA # Y is initially the offset of the object block &2b54 e9 0c SBC #&0c &2b56 85 81 STA &81 ; block_offset &2b58 a8 TAY &2b59 68 PLA &2b5a 48 PHA &2b5b 20 65 2b JSR &2b65 ; affect_west_tower_middle_block &2b5e a4 81 LDY &81 ; block_offset &2b60 68 PLA &2b61 ca DEX &2b62 d0 ed BNE &2b51 ; west_tower_middle_block_loop &2b64 60 RTS ; affect_west_tower_middle_block &2b65 48 PHA &2b66 38 SEC &2b67 a5 75 LDA &75 ; screen_address_low &2b69 e9 80 SBC #&80 &2b6b 85 75 STA &75 ; screen_address_low &2b6d a5 76 LDA &76 ; screen_address_high &2b6f e9 04 SBC #&04 &2b71 85 76 STA &76 ; screen_address_high &2b73 68 PLA ; object_being_dropped &2b74 c9 36 CMP #&36 ; COILED_ROPE &2b76 f0 08 BEQ &2b80 ; is_coiled_rope &2b78 a9 00 LDA #&00 ; SPACE # Remove the extended rope if object isn't COILED_ROPE &2b7a 99 87 01 STA &0187,Y ; room_blocks &2b7d 4c 35 26 JMP &2635 ; wipe_block ; is_coiled_rope &2b80 a9 0f LDA #&0f ; ROPE &2b82 99 87 01 STA &0187,Y ; room_blocks &2b85 18 CLC &2b86 a5 75 LDA &75 ; screen_address_low &2b88 69 40 ADC #&40 &2b8a 85 7d STA &7d ; lower_screen_address_low &2b8c a5 76 LDA &76 ; screen_address_high &2b8e 69 02 ADC #&02 &2b90 85 7e STA &7e ; lower_screen_address_high &2b92 a0 10 LDY #&10 &2b94 a9 05 LDA #&05 ; KY ; plot_extended_rope_loop # Plot a single pixel rope &2b96 91 7d STA (&7d),Y ; lower_screen_address &2b98 91 75 STA (&75),Y ; screen_address &2b9a c8 INY &2b9b c0 18 CPY #&18 &2b9d d0 f7 BNE &2b96 ; plot_extended_rope_loop &2b9f a5 62 LDA &62 ; puzzles_solved + 8 &2ba1 d0 0b BNE &2bae ; leave # If the player hasn't done so already, &2ba3 c6 62 DEC &62 ; puzzles_solved + 8 &2ba5 8a TXA &2ba6 48 PHA &2ba7 a9 05 LDA #&05 # Score 5% for dropping COILED_ROPE in THE WEST TOWER &2ba9 20 18 2a JSR &2a18 ; add_to_score &2bac 68 PLA &2bad aa TAX ; leave &2bae 60 RTS ; object_dropped_in_the_west_exit &2baf 48 PHA &2bb0 38 SEC &2bb1 a5 7d LDA &7d ; block_screen_address_low &2bb3 e9 b0 SBC #&b0 &2bb5 85 75 STA &75 ; screen_address_low &2bb7 a5 7e LDA &7e ; block_screen_address_high &2bb9 e9 04 SBC #&04 &2bbb 85 76 STA &76 ; screen_address_high # screen_address is the brick in the wall &2bbd 98 TYA &2bbe e9 0d SBC #&0d # Brick is offset from object by (-1, -1) &2bc0 a8 TAY &2bc1 68 PLA ; object_dropped &2bc2 c9 32 CMP #&32 ; BRICK_WITH_HOLE &2bc4 f0 10 BEQ &2bd6 ; remove_brick ; replace_brick # Replace the brick if the object isn't BRICK_WITH_HOLE &2bc6 a9 03 LDA #&03 ; BRICK &2bc8 99 87 01 STA &0187,Y ; room_blocks &2bcb a9 02 LDA #&02 ; BRICK &2bcd 20 92 29 JSR &2992 ; unpack_background_sprite &2bd0 20 f8 23 JSR &23f8 ; set_room_block_colour &2bd3 4c 4e 26 JMP &264e ; plot_unpacked_sprite ; remove_brick &2bd6 a9 00 LDA #&00 ; SPACE &2bd8 99 87 01 STA &0187,Y ; room_blocks &2bdb a5 64 LDA &64 ; puzzles_solved + 10 &2bdd d0 07 BNE &2be6 # If the player hasn't done so already, &2bdf c6 64 DEC &64 ; puzzles_solved + 10 &2be1 a9 07 LDA #&07 # Score 7% for dropping BRICK_WITH_HOLE in THE WEST EXIT &2be3 20 18 2a JSR &2a18 ; add_to_score &2be6 4c 35 26 JMP &2635 ; wipe_block # Remove a brick from the wall ; object_dropped_in_the_dungeons &2be9 c9 2f CMP #&2f ; FIGURINE &2beb d0 5a BNE &2c47 ; leave &2bed 20 65 24 JSR &2465 ; plot_enemies # Remove all enemies from screen &2bf0 20 bd 2a JSR &2abd ; wipe_enemies # and room &2bf3 a5 63 LDA &63 ; puzzles_solved + 9 &2bf5 d0 50 BNE &2c47 ; leave # If the player hasn't done so already, &2bf7 c6 63 DEC &63 ; puzzles_solved + 9 &2bf9 a9 0a LDA #&0a # Score 10% for dropping FIGURINE in THE DUNGEONS &2bfb 4c 18 2a JMP &2a18 ; add_to_score ; object_dropped_in_the_west_tower_top &2bfe a0 00 LDY #&00 &2c00 c9 2b CMP #&2b ; BOWL &2c02 d0 01 BNE &2c05 ; not_bowl &2c04 88 DEY ; not_bowl &2c05 84 53 STY &53 ; bowl_is_in_position_to_be_filled &2c07 60 RTS ; handle_rain_drop &2c08 a5 04 LDA &04 ; room_x &2c0a c9 03 CMP #&03 &2c0c d0 39 BNE &2c47 ; leave &2c0e a5 05 LDA &05 ; room_y &2c10 c9 0e CMP #&0e &2c12 d0 33 BNE &2c47 ; leave # If the player is at the top of the West Tower, &2c14 ad 01 01 LDA &0101 ; enemies_screen_address_high &2c17 c9 6a CMP #&6a &2c19 d0 2c BNE &2c47 ; leave # If the RAINDROP (first enemy) is level with the object, &2c1b ad 03 01 LDA &0103 ; enemies_flags &2c1e 29 10 AND #&10 &2c20 f0 25 BEQ &2c47 ; leave # and the RAINDROP is moving down, &2c22 a5 53 LDA &53 ; bowl_is_in_position_to_be_filled &2c24 f0 21 BEQ &2c47 ; leave # and the BOWL has been previously dropped, &2c26 e6 53 INC &53 ; bowl_is_in_position_to_be_filled &2c28 a9 2c LDA #&2c ; FULL_BOWL &2c2a 8d 0c 03 STA &030c ; objects_sprite + 8 &2c2d a9 07 LDA #&07 # Score 7% for filling BOWL &2c2f 20 18 2a JSR &2a18 ; add_to_score &2c32 a9 2b LDA #&2b ; BOWL # Unplot the BOWL &2c34 20 39 2c JSR &2c39 ; plot_bowl &2c37 a9 2c LDA #&2c ; FULL_BOWL # Plot FULL_BOWL ; plot_bowl &2c39 a2 f0 LDX #&f0 &2c3b 86 94 STX &94 ; screen_address_low &2c3d a2 6e LDX #&6e &2c3f 86 95 STX &95 ; screen_address_high &2c41 20 92 29 JSR &2992 ; unpack_background_sprite &2c44 4c d0 06 JMP &06d0 ; plot_sprite ; leave &2c47 60 RTS ; object_dropped_in_the_transporter # Any object, even nothing, will do! &2c48 a9 0f LDA #&0f ; Flush all buffers &2c4a a2 00 LDX #&00 &2c4c 20 f4 ff JSR &fff4 ; OSBYTE &2c4f a9 04 LDA #&04 &2c51 a2 06 LDX #&06 &2c53 a0 50 LDY #&50 &2c55 20 80 08 JSR &0880 ; play_sound &2c58 a9 05 LDA #&05 # Score 5% for using transporter &2c5a 20 18 2a JSR &2a18 ; add_to_score &2c5d 20 15 2d JSR &2d15 ; transporter_visual_effects # Display red/green/blue/green pixellation &2c60 a9 88 LDA #&88 ; W/K # Change green to rapidly flashing black/white &2c62 8d 21 fe STA &fe21 # Write to video ULA palette register &2c65 a9 28 LDA #&28 &2c67 20 d2 31 JSR &31d2 ; wait_for_a_vsyncs &2c6a a9 85 LDA #&85 ; G &2c6c 8d 21 fe STA &fe21 # Write to video ULA palette register &2c6f 20 15 2d JSR &2d15 ; transporter_visual_effects # Display red/green/blue/green pixellation &2c72 a9 15 LDA #&15 &2c74 85 04 STA &04 ; room_x &2c76 85 05 STA &05 ; room_y &2c78 20 ea 31 JSR &31ea ; plot_room_from_coordinates # Display completion screen (21, 21) &2c7b a2 21 LDX #&21 &2c7d a0 2f LDY #&2f ; &2f21 = completion_text &2c7f 20 67 29 JSR &2967 ; plot_text # Display completion text &2c82 a9 c0 LDA #&c0 &2c84 85 00 STA &00 ; player_screen_address_low &2c86 a9 77 LDA #&77 &2c88 85 01 STA &01 ; player_screen_address_high &2c8a a9 40 LDA #&40 &2c8c 85 59 STA &59 ; player_y &2c8e 20 95 2f JSR &2f95; plot_player # Plot the player, standard size &2c91 a9 78 LDA #&78 &2c93 85 81 STA &81 ; bounce_state ; bounce_player_loop # Make the player bounce for a while &2c95 a5 00 LDA &00 ; player_screen_address_low &2c97 85 08 STA &08 ; previous_player_screen_address_low &2c99 a5 01 LDA &01 ; player_screen_address_high &2c9b 85 09 STA &09 ; previous_player_screen_address_high &2c9d a5 81 LDA &81 ; bounce_state &2c9f 29 04 AND #&04 &2ca1 d0 09 BNE &2cac ; bounce_down ; bounce_up &2ca3 20 2b 21 JSR &212b ; move_player_up &2ca6 20 2b 21 JSR &212b ; move_player_up &2ca9 4c b2 2c JMP &2cb2 ; update_bounce ; bounce_down &2cac 20 87 21 JSR &2187 ; move_player_down &2caf 20 87 21 JSR &2187 ; move_player_down ; update_bounce &2cb2 a9 03 LDA #&03 &2cb4 20 d2 31 JSR &31d2 ; wait_for_a_vsyncs &2cb7 20 79 2f JSR &2f79 ; update_player_sprite &2cba e6 81 INC &81 ; bounce_state &2cbc d0 d7 BNE &2c95 ; bounce_player_loop &2cbe a9 50 LDA #&50 &2cc0 20 d2 31 JSR &31d2 ; wait_for_a_vsyncs # Pause for a while &2cc3 20 a3 31 JSR &31a3 ; disintegrate_player # Remove standard size player &2cc6 a9 22 LDA #&22 &2cc8 85 81 STA &81 ; rnd ; stretch_player_loop # Replace with stretched player &2cca c9 2c CMP #&2c &2ccc b0 1e BCS &2cec ; reshuffle_stretch &2cce 29 fb AND #&fb &2cd0 c5 81 CMP &81 ; rnd &2cd2 d0 18 BNE &2cec ; reshuffle_stretch &2cd4 aa TAX &2cd5 29 f8 AND #&f8 &2cd7 85 7d STA &7d ; offset &2cd9 8a TXA &2cda 29 03 AND #&03 &2cdc 0a ASL A &2cdd 05 7d ORA &7d ; offset &2cdf a8 TAY &2ce0 20 fc 2c JSR &2cfc ; plot_scaled_player_pixels &2ce3 c8 INY &2ce4 20 fc 2c JSR &2cfc ; plot_scaled_player_pixels &2ce7 a9 02 LDA #&02 &2ce9 20 d2 31 JSR &31d2 ; wait_for_a_vsyncs ; reshuffle_stretch &2cec 20 2c 2d JSR &2d2c ; shuffle_rnd # Redraw in a pseudo-random order &2cef c9 22 CMP #&22 &2cf1 d0 d7 BNE &2cca ; stretch_player_loop &2cf3 a9 e2 LDA #&e2 ; SPACE ; wait_for_space # Wait for SPACE to be pressed, &2cf5 c5 ec CMP &ec ; Internal key number of most recently pressed key &2cf7 d0 fc BNE &2cf5 ; wait_for_space &2cf9 4c a0 1d JMP &1da0 ; real_entry_point # then return to title screen ; plot_scaled_player_pixels &2cfc bd 60 1b LDA &1b60,X ; player_sprite_right_frame_0 &2cff 99 40 73 STA &7340,Y &2d02 bd 64 1b LDA &1b64,X ; player_sprite_right_frame_0 + 4 &2d05 99 80 75 STA &7580,Y &2d08 bd 90 1b LDA &1b90,X ; player_sprite_right_frame_0 + &30 &2d0b 99 c0 77 STA &77c0,Y &2d0e bd 94 1b LDA &1b94,X ; player_sprite_right_frame_0 + &34 &2d11 99 00 7a STA &7a00,Y &2d14 60 RTS ; transporter_visual_effects &2d15 a9 03 LDA #&03 ; RR &2d17 85 92 STA &92 ; pixel_value &2d19 a9 00 LDA #&00 &2d1b 85 81 STA &81 ; rnd ; transporter_visual_effects_loop &2d1d 20 39 2d JSR &2d39 ; transport_visual_effect &2d20 20 2c 2d JSR &2d2c ; shuffle_rnd &2d23 d0 f8 BNE &2d1d ; transporter_visual_effects_loop &2d25 06 92 ASL &92 ; pixel_value # Cycle through RR, GG, BB and GG &2d27 06 92 ASL &92 ; pixel_value &2d29 90 f2 BCC &2d1d ; transporter_visual_effects_loop &2d2b 60 RTS ; shuffle_rnd &2d2c a5 81 LDA &81 ; rnd &2d2e 0a ASL A &2d2f 0a ASL A &2d30 18 CLC &2d31 65 81 ADC &81 ; rnd &2d33 18 CLC &2d34 69 15 ADC #&15 &2d36 85 81 STA &81 ; rnd &2d38 60 RTS ; transport_visual_effect &2d39 a0 00 LDY #&00 &2d3b 84 7e STY &7e ; screen_address_high &2d3d a2 04 LDX #&04 ; calculate_random_address_loop &2d3f 0a ASL A &2d40 26 7e ROL &7e ; screen_address_high # screen_address_high = (top four bits of rnd) + &53 &2d42 ca DEX &2d43 d0 fa BNE &2d3f ; calculate_random_address_loop &2d45 85 7d STA &7d ; screen_address_low # screen_address_low = (bottom four bits of rnd) * 16 &2d47 18 CLC &2d48 a5 7e LDA &7e ; screen_address_high &2d4a 69 53 ADC #&53 &2d4c 85 7e STA &7e ; screen_address_high &2d4e a2 03 LDX #&03 ; blocks_loop &2d50 a0 0f LDY #&0f &2d52 a5 92 LDA &92 ; pixel_value ; set_block_loop &2d54 91 7d STA (&7d),Y ; screen_address # Fill a 4x8 pixel block &2d56 88 DEY &2d57 10 fb BPL &2d54 ; set_block_loop &2d59 18 CLC &2d5a a5 7e LDA &7e ; screen_address_high &2d5c 69 10 ADC #&10 # Move 8 pixels right, 56 pixels down &2d5e 85 7e STA &7e ; screen_address_high ; brief_delay_loop &2d60 88 DEY &2d61 30 fd BMI &2d60 ; brief_delay_loop &2d63 ca DEX &2d64 10 ea BPL &2d50 ; blocks_loop &2d66 60 RTS ; handle_tower_guard &2d67 18 CLC &2d68 a5 69 LDA &69 ; puzzle_x &2d6a 69 04 ADC #&04 &2d6c c5 58 CMP &58 ; player_x &2d6e 90 1d BCC &2d8d ; leave &2d70 a9 2a LDA #&2a ; HALO &2d72 20 99 2e JSR &2e99 ; remove_object_from_pocket &2d75 90 0a BCC &2d81 ; repel_from_guard # If the player is carrying the HALO, &2d77 20 83 2e JSR &2e83 ; remove_puzzle_block # Remove the TOWER_GUARD from screen &2d7a c6 5a DEC &5a ; puzzles_solved + 0 &2d7c a9 05 LDA #&05 # Score 5% for giving HALO to TOWER_GUARD &2d7e 4c 18 2a JMP &2a18 ; add_to_score ; repel_from_guard # If the player is not, &2d81 a9 0a LDA #&0a &2d83 85 49 STA &49 ; repelled_from_guard_timer # Mark them as being repelled from the guard &2d85 29 00 AND #&00 &2d87 85 40 STA &40 ; player_jumping_timer &2d89 a9 05 LDA #&05 # Incur 5 damage &2d8b 85 88 STA &88 ; damage ; leave &2d8d 60 RTS ; handle_final_guard &2d8e 18 CLC &2d8f a5 69 LDA &69 ; puzzle_x &2d91 69 04 ADC #&04 &2d93 c5 58 CMP &58 ; player_x &2d95 90 f6 BCC &2d8d ; leave &2d97 a9 27 LDA #&27 ; TREASURE &2d99 20 99 2e JSR &2e99 ; remove_object_from_pocket &2d9c 90 e3 BCC &2d81 ; repel_from_guard # If the player is not carrying TREASURE, repel them &2d9e 20 83 2e JSR &2e83 ; remove_puzzle_block # Otherwise, remove FINAL_GUARD from screen &2da1 c6 5e DEC &5e ; puzzles_solved + 4 &2da3 a9 05 LDA #&05 # Score 5% for giving TREASURE to FINAL_GUARD &2da5 4c 18 2a JMP &2a18 ; add_to_score ; handle_priest &2da8 a9 30 LDA #&30 ; CROSS &2daa 20 99 2e JSR &2e99 ; remove_object_from_pocket # If the player is carrying the CROSS, &2dad 90 0a BCC &2db9 ; not_carrying_cross &2daf 20 83 2e JSR &2e83 ; remove_puzzle_block # Remove the PRIEST from screen &2db2 c6 5b DEC &5b ; puzzles_solved + 1 &2db4 a9 04 LDA #&04 # Score 4% for giving CROSS to PRIEST &2db6 4c 18 2a JMP &2a18 ; add_to_score ; not_carrying_cross &2db9 60 RTS ; handle_imp &2dba a9 29 LDA #&29 ; GOLD &2dbc 20 99 2e JSR &2e99 ; remove_object_from_pocket # If the player is carrying the GOLD, &2dbf 90 22 BCC &2de3 ; leave &2dc1 a9 09 LDA #&09 # Start the SWORD countdown &2dc3 85 55 STA &55 ; sword_countdown_high &2dc5 c6 5c DEC &5c ; puzzles_solved + 2 &2dc7 a9 00 LDA #&00 # Put the SWORD in the pocket that had contained GOLD &2dc9 95 51 STA &51,X ; pocket_one &2dcb a5 75 LDA &75 ; pocket_screen_address_low &2dcd 85 94 STA &94 ; screen_address_low &2dcf a5 76 LDA &76 ; pocket_screen_address_high &2dd1 85 95 STA &95 ; screen_address_high &2dd3 a9 35 LDA #&35 ; SWORD &2dd5 20 92 29 JSR &2992 ; unpack_background_sprite &2dd8 20 d0 06 JSR &06d0 ; plot_sprite # Plot the SWORD in the pocket &2ddb 20 83 2e JSR &2e83 ; remove_puzzle_block # Remove the IMP from screen &2dde a9 0a LDA #&0a # Score 10% for giving GOLD to IMP for SWORD &2de0 4c 18 2a JMP &2a18 ; add_to_score ; leave &2de3 60 RTS ; handle_princess &2de4 18 CLC &2de5 a5 58 LDA &58 ; player_x &2de7 69 04 ADC #&04 &2de9 c5 69 CMP &69 ; puzzle_x # If the player is left of the princess, &2deb 90 2a BCC &2e17 ; leave &2ded a9 34 LDA #&34 ; FROG &2def 20 99 2e JSR &2e99 ; remove_object_from_pocket # and the player is carrying the FROG &2df2 90 1c BCC &2e10 ; not_carrying_frog &2df4 20 83 2e JSR &2e83 ; remove_puzzle_block # Remove the princess's feet &2df7 c6 5d DEC &5d ; puzzles_solved + 3 # Mark both princess's feet &2df9 c6 5f DEC &5f ; puzzles_solved + 5 # and princess's head as removed &2dfb 38 SEC &2dfc a5 67 LDA &67 ; puzzle_screen_address_low &2dfe e9 80 SBC #&80 &2e00 85 75 STA &75 ; screen_address_low &2e02 a5 68 LDA &68 ; puzzle_screen_address_high &2e04 e9 04 SBC #&04 &2e06 85 76 STA &76 ; screen_address_high &2e08 20 35 26 JSR &2635 ; wipe_block # Remove the princess's head &2e0b a9 0a LDA #&0a # Score 10% for scaring princess with FROG &2e0d 4c 18 2a JMP &2a18 ; add_to_score ; not_carrying_frog &2e10 a9 0f LDA #&0f # Incur 15 damage for touching princess without FROG &2e12 85 88 STA &88 ; damage &2e14 4c 96 20 JMP &2096 ; move_player_left ; leave &2e17 60 RTS ; handle_firepit &2e18 a9 2c LDA #&2c ; FULL_BOWL &2e1a 20 99 2e JSR &2e99 ; remove_object_from_pocket # If the player is carrying the FULL_BOWL, &2e1d 90 31 BCC &2e50 ; leave &2e1f a9 08 LDA #&08 &2e21 85 81 STA &81 ; fires_to_remove &2e23 18 CLC &2e24 a5 6c LDA &6c ; puzzle_block_offset &2e26 69 18 ADC #&18 # The fires are two rows beneath the trigger block &2e28 85 6c STA &6c ; puzzle_block_offset &2e2a a5 68 LDA &68 ; puzzle_screen_address_high &2e2c 69 09 ADC #&09 &2e2e 85 68 STA &68 ; puzzle_screen_address_high ; remove_fires_loop &2e30 20 83 2e JSR &2e83 ; remove_puzzle_block # Set the FIRE block to SPACE &2e33 a9 00 LDA #&00 &2e35 9d 7b 01 STA &017b,X ; room_blocks - 12 # Unnecessarily set the block above the FIRE to SPACE &2e38 e6 6c INC &6c ; puzzle_block_offset &2e3a 18 CLC &2e3b a5 67 LDA &67 ; puzzle_screen_address_low &2e3d 69 30 ADC #&30 &2e3f 85 67 STA &67 ; puzzle_screen_address_low &2e41 90 02 BCC &2e45 &2e43 e6 68 INC &68 ; puzzle_screen_address_high &2e45 c6 81 DEC &81 ; fires_to_remove &2e47 d0 e7 BNE &2e30 ; remove_fires_loop &2e49 c6 61 DEC &61 ; puzzles_solved + 7 &2e4b a9 08 LDA #&08 # Score 8% for dowsing firepit with FULL_BOWL &2e4d 4c 18 2a JMP &2a18 ; add_to_score ; leave &2e50 60 RTS ; handle_magic_hat &2e51 a9 23 LDA #&23 # Each magic hat regains 35 energy &2e53 85 56 STA &56 ; magic_hat_timer &2e55 a6 6c LDX &6c ; puzzle_block_offset &2e57 bd 00 04 LDA &0400,X ; magic_hat_locations &2e5a 09 80 ORA #&80 # Mark the magic hat as being collected &2e5c 9d 00 04 STA &0400,X ; magic_hat_locations &2e5f a9 f0 LDA #&f0 &2e61 85 69 STA &69 ; puzzle_x &2e63 bd 02 04 LDA &0402,X ; magic_hat_locations + 2 &2e66 85 94 STA &94 ; screen_address_low &2e68 bd 03 04 LDA &0403,X ; magic_hat_locations + 3 &2e6b 85 95 STA &95 ; screen_address_high &2e6d a9 28 LDA #&28 ; MAGIC_HAT &2e6f 20 92 29 JSR &2992 ; unpack_background_sprite &2e72 a9 c0 LDA #&c0 &2e74 20 a5 23 JSR &23a5 ; eor_unpacked_sprite_with_palette_value &2e77 20 d0 06 JSR &06d0 ; plot_sprite # Remove the magic hat from screen &2e7a a9 22 LDA #&22 &2e7c a2 32 LDX #&32 &2e7e a0 32 LDY #&32 &2e80 4c 80 08 JMP &0880 ; play_sound ; remove_puzzle_block &2e83 a6 6c LDX &6c ; puzzle_block_offset &2e85 a9 00 LDA #&00 ; SPACE &2e87 9d 87 01 STA &0187,X ; room_blocks # Turn the block into a SPACE &2e8a a9 f0 LDA #&f0 &2e8c 85 69 STA &69 ; puzzle_x &2e8e a5 67 LDA &67 ; puzzle_screen_address_low &2e90 85 75 STA &75 ; screen_address_low &2e92 a5 68 LDA &68 ; puzzle_screen_address_high &2e94 85 76 STA &76 ; screen_address_high &2e96 4c 35 26 JMP &2635 ; wipe_block # and remove from screen ; remove_object_from_pocket &2e99 a2 01 LDX #&01 &2e9b b4 51 LDY &51,X &2e9d 20 c1 2e JSR &2ec1 ; check_if_slot_contains_object &2ea0 b0 05 BCS &2ea7 &2ea2 ca DEX &2ea3 10 f6 BPL &2e9b &2ea5 18 CLC &2ea6 60 RTS &2ea7 a9 ff LDA #&ff &2ea9 95 51 STA &51,X &2eab 99 00 03 STA &0300,Y &2eae a9 50 LDA #&50 &2eb0 85 76 STA &76 &2eb2 a9 58 LDA #&58 ; &5058 = screen address of pocket two &2eb4 e0 01 CPX #&01 &2eb6 f0 02 BEQ &2eba &2eb8 a9 90 LDA #&90 ; &5090 = screen address of pocket one &2eba 85 75 STA &75 &2ebc 20 35 26 JSR &2635 ; wipe_block &2ebf 38 SEC &2ec0 60 RTS ; check_if_slot_contains_object &2ec1 48 PHA &2ec2 98 TYA &2ec3 0a ASL A &2ec4 0a ASL A &2ec5 0a ASL A &2ec6 a8 TAY &2ec7 68 PLA &2ec8 d9 04 03 CMP &0304,Y ; objects_sprite &2ecb f0 01 BEQ &2ece ; leave &2ecd 18 CLC ; leave &2ece 60 RTS ; damage_from_enemies &2ecf 02 00 ; SPRING &2ed1 01 00 ; BIRD &2ed3 02 ; FIREBALL &2ed4 01 ; SCOOTER_GUARD &2ed5 03 ; LIZARD &2ed6 02 ; JUG &2ed7 01 ; RABBIT &2ed8 01 ; SPACEMAN &2ed9 00 ; RAINDROP ; game_over_text &2eda 80 68 63 3e &2ede 10 0a 16 0e 28 18 1f 0e 1b ; "GAME OVER" &2ee7 ff ; title_screen_text &2ee8 80 18 5a 3e &2eec 19 0a 15 0a 0c 0e 28 28 18 0f 28 28 16 0a 10 12 ; "PALACE OF MAGIC" &2eed 0c &2efd 80 a8 5e 1c &2f01 0b 22 28 16 0a 1b 1d 22 17 28 11 18 20 0a 1b 0d ; "BY MARTYN HOWARD" &2f11 80 48 7a 1b &2f15 19 1b 0e 1c 1c 28 1c 19 0a 0c 0e ; "PRESS SPACE" &2f20 ff ; completion_text &2f21 80 c0 5e 3e &2f25 20 0e 15 15 28 0d 18 17 0e 26 ; "WELL DONE!" &2f2f 80 d8 62 0e &2f33 22 18 1e 28 11 0a 1f 0e 28 1d 1b 0a 17 1c 19 18 ; "YOU HAVE TRANSPORTED" &2f43 1b 1d 0e 0d &2f47 80 48 65 0e &2f4b 22 18 1e 28 0a 1b 0e 28 11 18 16 0e 24 ; "YOU ARE HOME." &2f58 80 d0 73 09 &2f5c 19 0a 1c 1c 20 18 1b 0d 27 ; "PASSWORD:" &2f65 80 68 76 33 &2f69 16 0a 16 16 0a 15 ; "MAMMAL" &2f6f ff ; the_text &2f70 80 c0 50 00 &2f74 1d 11 0e 28 ; "THE " &2f78 ff ; update_player_sprite &2f79 a5 0a LDA &0a ; previous_player_direction &2f7b 20 a5 2f JSR &2fa5 ; calculate_player_sprite_address &2f7e a5 08 LDA &08 ; previous_player_screen_address_low &2f80 85 94 STA &94 ; screen_address_low &2f82 a5 09 LDA &09 ; previous_player_screen_address_high &2f84 85 95 STA &95 ; screen_address_high &2f86 20 d0 06 JSR &06d0 ; plot_sprite # Unplot previous player sprite &2f89 a5 89 LDA &89 ; player_has_moved &2f8b f0 08 BEQ &2f95 ; plot_player &2f8d a5 00 LDA &00 ; player_screen_address_low &2f8f c5 08 CMP &08 ; previous_player_screen_address_low &2f91 f0 02 BEQ &2f95 ; plot_player &2f93 e6 80 INC &80 ; player_frame_counter ; plot_player &2f95 20 a3 2f JSR &2fa3 ; calculate_player_sprite_address_from_player_direction ; plot_sprite_at_player_screen_address &2f98 a5 00 LDA &00 ; player_screen_address_low &2f9a 85 94 STA &94 ; screen_address_low &2f9c a5 01 LDA &01 ; player_screen_address_high &2f9e 85 95 STA &95 ; screen_address_high &2fa0 4c d0 06 JMP &06d0 ; plot_sprite # Plot new player sprite ; calculate_player_sprite_address_from_player_direction &2fa3 a5 02 LDA &02 ; player_direction ; calculate_player_sprite_address &2fa5 a2 00 LDX #&00 &2fa7 86 96 STX &96 ; sprite_address_low &2fa9 4a LSR A &2faa 66 96 ROR &96 ; sprite_address_low &2fac 48 PHA &2fad a6 96 LDX &96 ; sprite_address_low &2faf 4a LSR A &2fb0 66 96 ROR &96 ; sprite_address_low &2fb2 85 97 STA &97 ; sprite_address_high &2fb4 8a TXA &2fb5 65 96 ADC &96 ; sprite_address_low &2fb7 85 96 STA &96 ; sprite_address_low &2fb9 68 PLA &2fba 65 97 ADC &97 ; sprite_address_high &2fbc 69 1b ADC #&1b &2fbe 85 97 STA &97 ; sprite_address_high &2fc0 20 c9 2f JSR &2fc9 ; move_to_next_player_sprite &2fc3 a5 80 LDA &80 ; player_frame_counter &2fc5 29 02 AND #&02 &2fc7 f0 0b BEQ &2fd4 ; leave ; move_to_next_player_sprite &2fc9 18 CLC &2fca a5 96 LDA &96 ; sprite_address_low &2fcc 69 60 ADC #&60 &2fce 85 96 STA &96 ; sprite_address_low &2fd0 90 02 BCC &2fd4 ; leave &2fd2 e6 97 INC &97 ; sprite_address_high ; leave &2fd4 60 RTS ; handle_object_collection &2fd5 a6 58 LDX &58 ; player_x &2fd7 86 81 STX &81 ; check_x &2fd9 a5 00 LDA &00 ; player_screen_address_low &2fdb 85 75 STA &75 ; screen_address_low &2fdd a5 01 LDA &01 ; player_screen_address_high &2fdf 85 76 STA &76 ; screen_address_high &2fe1 e8 INX &2fe2 e8 INX &2fe3 18 CLC &2fe4 a5 59 LDA &59 ; player_y # Consider the block below the player's middle &2fe6 69 08 ADC #&08 &2fe8 85 82 STA &82 ; check_y &2fea a8 TAY &2feb 20 04 23 JSR &2304 ; get_room_block_from_x_and_y &2fee b0 e4 BCS &2fd4 ; leave # Leave if SPACE, ROPE, LADDER, PILLARs &2ff0 c9 03 CMP #&03 &2ff2 b0 e0 BCS &2fd4 ; leave # Leave if not BRICK_PLINTH or STONE_PLINTH &2ff4 a6 58 LDX &58 ; player_x &2ff6 a4 82 LDY &82 ; check_y &2ff8 20 04 23 JSR &2304 ; get_room_block_from_x_and_y # Consider the block below the player's left &2ffb b0 04 BCS &3001 ; not_plinth &2ffd c9 03 CMP #&03 &2fff 90 0f BCC &3010 ; is_object_plinth ; not_plinth &3001 e6 81 INC &81 ; check_x # If not BRICK_PLINTH or STONE_PLINTH, add four pixels &3003 e6 81 INC &81 ; check_x # (player is straddling block boundary; use right block) &3005 18 CLC &3006 a5 75 LDA &75 ; screen_address_low &3008 69 10 ADC #&10 &300a 85 75 STA &75 ; screen_address_low &300c 90 02 BCC &3010 ; is_object_plinth &300e e6 76 INC &76 ; screen_address_high ; is_object_plinth &3010 a5 81 LDA &81 ; check_x # Calculate the screen address of the object &3012 a2 0c LDX #&0c ; divide_by_six_loop &3014 ca DEX &3015 dd fb 28 CMP &28fb,X ; table_of_sixes &3018 90 fa BCC &3014 ; divide_by_six_loop &301a fd fb 28 SBC &28fb,X ; table_of_sixes &301d 0a ASL A &301e 0a ASL A &301f 0a ASL A &3020 85 7d STA &7d ; object_screen_address_low &3022 38 SEC &3023 a5 75 LDA &75 ; screen_address_low &3025 29 f8 AND #&f8 &3027 e5 7d SBC &7d ; object_screen_address_low &3029 85 7d STA &7d ; object_screen_address_low &302b a5 76 LDA &76 ; screen_address_high &302d e9 00 SBC #&00 &302f 85 7e STA &7e ; object_screen_address_high &3031 a9 21 LDA #&21 &3033 a2 64 LDX #&64 &3035 a0 02 LDY #&02 &3037 20 80 08 JSR &0880 ; play_sound &303a a9 ff LDA #&ff # By default, no object is being picked up &303c 85 76 STA &76 ; object_being_picked_up &303e a9 1b LDA #&1b &3040 85 75 STA &75 ; object_to_consider ; find_object_loop # unless this plinth is supporting one &3042 a5 75 LDA &75 ; object_to_consider &3044 0a ASL A &3045 0a ASL A &3046 0a ASL A &3047 aa TAX &3048 bd 00 03 LDA &0300,X ; objects_room_x &304b c5 04 CMP &04 ; room_x &304d d0 1e BNE &306d ; consider_next_object &304f bd 01 03 LDA &0301,X ; objects_room_y &3052 c5 05 CMP &05 ; room_y &3054 d0 17 BNE &306d ; consider_next_object &3056 bd 02 03 LDA &0302,X ; objects_screen_address_low &3059 c5 7d CMP &7d ; object_screen_address_low &305b d0 10 BNE &306d ; consider_next_object &305d bd 03 03 LDA &0303,X ; objects_screen_address_high &3060 c5 7e CMP &7e ; object_screen_address_high &3062 d0 09 BNE &306d ; consider_next_object &3064 a5 75 LDA &75 ; object_to_consider &3066 85 76 STA &76 ; object_being_picked_up # If so, note its number &3068 a9 80 LDA #&80 &306a 9d 00 03 STA &0300,X ; objects_room_x ; consider_next_object &306d c6 75 DEC &75 ; object_to_consider &306f 10 d1 BPL &3042 ; find_object_loop &3071 a9 ff LDA #&ff # By default, no object is being dropped &3073 85 75 STA &75 ; object_being_dropped &3075 a5 52 LDA &52 ; pocket_two &3077 08 PHP &3078 0a ASL A &3079 0a ASL A &307a 0a ASL A &307b aa TAX &307c a5 7d LDA &7d ; object_screen_address_low &307e 85 4a STA &4a ; block_address_low &3080 a5 7e LDA &7e ; object_screen_address_high &3082 85 4b STA &4b ; block_address_high &3084 20 a3 27 JSR &27a3 ; calculate_room_block_offset_from_screen_address &3087 a9 00 LDA #&00 ; SPACE # By default, set the object's block to be a space &3089 99 87 01 STA &0187,Y ; room_blocks &308c 28 PLP &308d 30 1c BMI &30ab ; pocket_two_is_empty # If there is an object in pocket two, &308f a5 04 LDA &04 ; room_x # Move it into the room &3091 9d 00 03 STA &0300,X ; objects_room_x &3094 a5 05 LDA &05 ; room_y &3096 9d 01 03 STA &0301,X ; objects_room_y &3099 a5 7d LDA &7d &309b 9d 02 03 STA &0302,X ; objects_screen_address_low &309e a5 7e LDA &7e &30a0 9d 03 03 STA &0303,X ; objects_screen_address_high &30a3 86 75 STX &75 ; object_being_dropped &30a5 bd 06 03 LDA &0306,X ; objects_room_block &30a8 99 87 01 STA &0187,Y ; room_blocks # and set its block accordingly ; pocket_two_is_empty &30ab 98 TYA &30ac 48 PHA &30ad a5 51 LDA &51 ; pocket_one &30af 85 52 STA &52 ; pocket_two # Move the contents of pocket one into pocket two &30b1 18 CLC &30b2 a5 7d LDA &7d ; object_screen_address_low &30b4 69 40 ADC #&40 &30b6 85 81 STA &81 ; lower_object_screen_address_low &30b8 a5 7e LDA &7e ; object_screen_address_high &30ba 69 02 ADC #&02 &30bc 85 82 STA &82 ; lower_object_screen_address_high &30be a0 2f LDY #&2f ; eor_pocket_two_over_room_object_loop &30c0 b9 58 50 LDA &5058,Y ; &5058 = screen address of pocket two &30c3 51 7d EOR (&7d),Y ; object_screen_address # Plot pocket two in room &30c5 91 7d STA (&7d),Y ; object_screen_address &30c7 b9 98 52 LDA &5298,Y ; &5298 = second group of pocket two &30ca 51 81 EOR (&81),Y ; lower_object_screen_address &30cc 91 81 STA (&81),Y ; lower_object_screen_address &30ce 88 DEY &30cf 10 ef BPL &30c0 ; eor_pocket_two_over_room_object_loop &30d1 a0 2f LDY #&2f ; copy_pocket_one_into_pocket_two_loop &30d3 b9 90 50 LDA &5090,Y ; &5090 = screen address of pocket one &30d6 99 58 50 STA &5058,Y ; &5058 = screen address of pocket two # Move sprite for pocket one into pocket two &30d9 a9 00 LDA #&00 &30db 99 90 50 STA &5090,Y ; &5090 = screen address of pocket one &30de b9 d0 52 LDA &52d0,Y ; &52d0 = second group of pocket one &30e1 99 98 52 STA &5298,Y ; &5298 = second group of pocket two &30e4 a9 00 LDA #&00 &30e6 99 d0 52 STA &52d0,Y ; &52d0 = second group of pocket one &30e9 88 DEY &30ea 10 e7 BPL &30d3 ; copy_pocket_two_into_pocket_one_loop &30ec a9 ff LDA #&ff # By default, pocket one is empty &30ee 85 51 STA &51 ; pocket_one &30f0 68 PLA ; room block of object &30f1 a8 TAY &30f2 a5 76 LDA &76 ; object_being_picked_up &30f4 48 PHA &30f5 a5 75 LDA &75 ; object_being_dropped &30f7 20 15 2b JSR &2b15 ; consider_effect_of_object_on_room &30fa 68 PLA ; object_being_picked_up &30fb 30 37 BMI &3134 ; leave # unless an object has been picked up &30fd 85 51 STA &51 ; pocket_one &30ff 0a ASL A &3100 0a ASL A &3101 0a ASL A &3102 aa TAX &3103 20 99 27 JSR &2799 ; calculate_room_block_offset_of_object &3106 bd 05 03 LDA &0305,X ; objects_palette &3109 48 PHA &310a bd 04 03 LDA &0304,X ; objects_sprite &310d a2 90 LDX #&90 ; &5090 = screen address of pocket one &310f 86 94 STX &94 ; screen_address_low &3111 86 7f STX &7f ; previous_sprite &3113 a2 50 LDX #&50 &3115 86 95 STX &95 ; screen_address_high &3117 20 92 29 JSR &2992 ; unpack_background_sprite &311a 68 PLA &311b 20 a5 23 JSR &23a5 ; eor_unpacked_sprite_with_palette_value &311e 20 d0 06 JSR &06d0 ; plot_sprite # If so, plot the picked up object in pocket one &3121 a2 a0 LDX #&a0 &3123 86 96 STX &96 ; sprite_address_low &3125 a2 04 LDX #&04 ; &04a0 = unpacked_sprite_buffer &3127 86 97 STX &97 ; sprite_address_high &3129 a6 7d LDX &7d ; object_screen_address_low &312b 86 94 STX &94 ; screen_address_low &312d a6 7e LDX &7e ; object_screen_address_high &312f 86 95 STX &95 ; screen_address_high &3131 20 d0 06 JSR &06d0 ; plot_sprite # and unplot it from the room ; leave &3134 60 RTS ; plot_sword_countdown &3135 a2 40 LDX #&40 &3137 a0 50 LDY #&50 ; &5040 = screen address of sword countdown &3139 a9 13 LDA #&13 ; RM &313b 20 43 31 JSR &3143 ; set_character_address_and_colour &313e a5 55 LDA &55 ; sword_countdown_high &3140 4c 50 04 JMP &0450 ; plot_character ; set_character_address_and_colour &3143 86 90 STX &90 ; screen_address_low &3145 84 91 STY &91 ; screen_address_high &3147 85 92 STA &92 ; character_colour &3149 60 RTS ; handle_player_damage &314a 20 35 31 JSR &3135 ; plot_sword_countdown &314d a5 88 LDA &88 ; damage &314f 30 1a BMI &316b ; player_is_gaining_energy &3151 d0 04 BNE &3157 ; player_is_losing_energy &3153 38 SEC &3154 26 48 ROL &48 ; pain_tolerance # Tolerance increases one point per frame unharmed &3156 60 RTS ; player_is_losing_energy &3157 06 48 ASL &48 ; pain_tolerance # Tolerance decreases one point per frame harmed ; player_is_losing_energy_loop &3159 20 28 24 JSR &2428 ; decrease_energy_by_one &315c f0 15 BEQ &3173 ; kill_player &315e c6 88 DEC &88 ; damage &3160 d0 f7 BNE &3159 ; player_is_losing_energy_loop # Incur all damage in a single frame &3162 a9 03 LDA #&03 &3164 a2 02 LDX #&02 &3166 a0 02 LDY #&02 &3168 4c 80 08 JMP &0880 ; play_sound ; player_is_gaining_energy # Player gains energy from MAGIC_HATs one point per frame &316b 20 30 24 JSR &2430 ; increase_energy_by_one &316e e6 88 INC &88 ; damage &3170 d0 f9 BNE &316b ; player_is_gaining_energy &3172 60 RTS ; kill_player # If the player has died as a result, &3173 a9 06 LDA #&06 # R6: Vertical displayed register &3175 a2 16 LDX #&16 &3177 20 05 35 JSR &3505 ; write_to_video_controller_register # Remove any effect from dark room &317a a9 05 LDA #&05 # R5: Vertical total adjust register &317c a2 00 LDX #&00 &317e 20 05 35 JSR &3505 ; write_to_video_controller_register # Remove any bump &3181 a9 15 LDA #&15 ; Flush Selected Buffer &3183 a2 04 LDX #&04 ; Sound channel 0 &3185 20 f4 ff JSR &fff4 ; OSBYTE &3188 a9 02 LDA #&02 &318a a2 14 LDX #&14 &318c a0 2d LDY #&2d &318e 20 80 08 JSR &0880 ; play_sound &3191 20 a3 31 JSR &31a3 ; disintegrate_player # Remove the player from the screen &3194 a2 da LDX #&da &3196 a0 2e LDY #&2e ; &2eda ; game_over_text &3198 20 67 29 JSR &2967 ; plot_text # Plot GAME OVER &319b a9 ff LDA #&ff &319d 20 d2 31 JSR &31d2 ; wait_for_a_vsyncs # Wait a while &31a0 4c a0 1d JMP &1da0 ; real_entry_point # then return to title screen ; disintegrate_player &31a3 20 a3 2f JSR &2fa3 ; calculate_player_sprite_address_from_player_direction &31a6 a0 5f LDY #&5f ; copy_player_sprite_loop &31a8 b1 96 LDA (&96),Y ; sprite_address &31aa 99 a0 04 STA &04a0,Y ; unpacked_sprite_buffer &31ad 88 DEY &31ae 10 f8 BPL &31a8 ; copy_player_sprite_loop &31b0 a9 5e LDA #&5e &31b2 85 81 STA &81 ; rnd ; disintegrate_player_loop # Remove pixels in a pseudo-random order &31b4 c9 5f CMP #&5f &31b6 b0 12 BCS &31ca ; skip_removing_pixel &31b8 20 df 31 JSR &31df ; plot_unpacked_sprite_at_player_screen_address &31bb a4 81 LDY &81 ; rnd &31bd a9 00 LDA #&00 &31bf 99 a0 04 STA &04a0,Y ; unpacked_sprite_buffer &31c2 20 df 31 JSR &31df ; plot_unpacked_sprite_at_player_screen_address &31c5 a9 13 LDA #&13 ; Wait for Vertical Retrace &31c7 20 f4 ff JSR &fff4 ; OSBYTE ; skip_removing_pixel &31ca 20 2c 2d JSR &2d2c ; shuffle_rnd &31cd c9 5e CMP #&5e &31cf d0 e3 BNE &31b4 ; disintegrate_player_loop &31d1 60 RTS ; wait_for_a_vsyncs &31d2 48 PHA &31d3 a9 13 LDA #&13 ; Wait for Vertical Retrace &31d5 20 f4 ff JSR &fff4 ; OSBYTE &31d8 68 PLA &31d9 38 SEC &31da e9 01 SBC #&01 &31dc b0 f4 BCS &31d2 ; wait_for_a_vsyncs &31de 60 RTS ; plot_unpacked_sprite_at_player_screen_address &31df a9 a0 LDA #&a0 &31e1 85 96 STA &96 ; sprite_address_low &31e3 a9 04 LDA #&04 ; &04a0 = unpacked_sprite_buffer &31e5 85 97 STA &97 ; sprite_address_high &31e7 4c 98 2f JMP &2f98 ; plot_sprite_at_player_screen_address ; plot_room_from_coordinates &31ea a9 00 LDA #&00 # Consider all the rooms if finding from co-ordinates ; plot_room &31ec 85 81 STA &81 ; maximum_number_of_rooms_to_consider &31ee a9 01 LDA #&01 # R1: Horizontal displayed register &31f0 a2 00 LDX #&00 # Blank screen while redrawing &31f2 20 05 35 JSR &3505 ; write_to_video_controller_register &31f5 8a TXA &31f6 a2 ec LDX #&ec ; wipe_room_title_and_coordinates_loop &31f8 9d bf 50 STA &50bf,X &31fb 9d ab 51 STA &51ab,X &31fe ca DEX &31ff d0 f7 BNE &31f8 ; wipe_room_title_and_coordinates_loop &3201 a9 06 LDA #&06 # R6: Vertical displayed register &3203 a2 16 LDX #&16 # By default, display all of room &3205 20 05 35 JSR &3505 ; write_to_video_controller_register &3208 a5 05 LDA &05 ; room_y &320a c9 06 CMP #&06 &320c b0 17 BCS &3225 ; room_isn't_dark # unless the room is dark, and there's no CANDLE &320e a9 33 LDA #&33 ; CANDLE &3210 a4 51 LDY &51 ; pocket_one &3212 20 c1 2e JSR &2ec1 ; check_if_slot_contains_object &3215 b0 0e BCS &3225 ; room_isn't_dark &3217 a4 52 LDY &52 ; pocket_two &3219 20 c1 2e JSR &2ec1 ; check_if_slot_contains_object &321c b0 07 BCS &3225 ; room_isn't_dark &321e a9 06 LDA #&06 # R6: Vertical displayed register &3220 a2 02 LDX #&02 # in which case, display only the title bar &3222 20 05 35 JSR &3505 ; write_to_video_controller_register ; room_isn't_dark &3225 a5 58 LDA &58 ; player_x &3227 85 65 STA &65 ; player_entry_x &3229 a5 59 LDA &59 ; player_y &322b 85 66 STA &66 ; player_entry_y &322d a9 50 LDA #&50 &322f 85 72 STA &72 ; room_data_address_low &3231 a9 35 LDA #&35 ; &3550 = room_data &3233 85 73 STA &73 ; room_data_address_high &3235 a6 81 LDX &81 ; maximum_number_of_rooms_to_consider ; find_room_data_loop &3237 ca DEX &3238 f0 2b BEQ &3265 ; found_room_data # Use specific room number if not using co-ordinates &323a a0 00 LDY #&00 &323c b1 72 LDA (&72),Y ; room_data_address &323e 10 0c BPL &324c ; first_byte_positive &3240 a2 77 LDX #&77 # An unmatched room is entirely space &3242 98 TYA ; wipe_room_blocks_loop &3243 9d 87 01 STA &0187,X ; room_blocks &3246 ca DEX &3247 10 fa BPL &3243 ; wipe_room_blocks_loop &3249 4c 16 33 JMP &3316 ; skip_unpacking_room_data ; first_byte_positive &324c c8 INY &324d c5 04 CMP &04 ; room_x # The first three bytes of room data specify &324f d0 06 BNE &3257 ; not_room # room_x, room_y and the length of the room's data &3251 b1 72 LDA (&72),Y ; room_data_address &3253 c5 05 CMP &05 ; room_y &3255 f0 0e BEQ &3265 ; found_room_data # If this matches the co-ordinates, use that data &3257 c8 INY &3258 b1 72 LDA (&72),Y ; room_data_address &325a 18 CLC &325b 65 72 ADC &72 ; room_data_address_low &325d 85 72 STA &72 ; room_data_address_low &325f 90 d6 BCC &3237 ; find_room_data_loop &3261 e6 73 INC &73 ; room_data_address_high &3263 d0 d2 BNE &3237 ; find_room_data_loop ; found_room_data &3265 a5 73 LDA &73 ; room_data_address_high &3267 48 PHA &3268 a5 72 LDA &72 ; room_data_address_low &326a 48 PHA &326b a0 03 LDY #&03 &326d b1 72 LDA (&72),Y ; room_data_address # The lowest five bits of the fourth byte define the &326f 29 1f AND #&1f # room's title, using a lookup table, or 0 for none &3271 f0 64 BEQ &32d7 ; skip_plotting_title_and_coordinates &3273 85 76 STA &76 ; room_title_number &3275 88 DEY &3276 b1 72 LDA (&72),Y ; room_data_address &3278 29 3f AND #&3f &327a 09 09 ORA #&09 &327c 8d 73 2f STA &2f73; the_text + 3 # Set the colour of the room's title &327f a2 70 LDX #&70 &3281 a0 2f LDY #&2f ; &2f70 = the_text &3283 20 67 29 JSR &2967 ; plot_text # Plot "THE ". &3286 a9 50 LDA #&50 &3288 85 72 STA &72 ; packed_address_low &328a a9 07 LDA #&07 ; &0750 = packed_room_titles &328c 85 73 STA &73 ; packed_address_high &328e a0 01 LDY #&01 &3290 84 78 STY &78 ; bits_remaining &3292 88 DEY ; find_room_title_loop # Room titles are packed with five bits per character, &3293 a2 05 LDX #&05 &3295 20 f7 29 JSR &29f7 ; get_x_bits_of_packed_data &3298 c9 1f CMP #&1f # &1f being used to separate titles. &329a d0 f7 BNE &3293 ; find_room_title_loop &329c c6 76 DEC &76 ; room_title_number &329e d0 f3 BNE &3293 ; find_room_title_loop ; plot_room_title_loop &32a0 a2 05 LDX #&05 &32a2 20 f7 29 JSR &29f7 ; get_x_bits_of_packed_data &32a5 c9 1f CMP #&1f &32a7 f0 08 BEQ &32b1 ; end_of_title &32a9 69 0a ADC #&0a &32ab 20 50 04 JSR &0450 ; plot_character # Plot the room's title &32ae 4c a0 32 JMP &32a0 ; plot_room_title_loop ; end_of_title &32b1 a2 48 LDX #&48 &32b3 a0 52 LDY #&52 ; &5280 = screen address of room co-ordinates &32b5 a9 0f LDA #&0f ; YY &32b7 20 43 31 JSR &3143 ; set_character_address_and_colour &32ba 38 SEC &32bb a5 04 LDA &04 ; room_x &32bd e9 07 SBC #&07 &32bf 20 0c 35 JSR &350c ; plot_coordinate # Plot the room's x co-ordinate &32c2 a9 0f LDA #&0f ; YY &32c4 85 92 STA &92 ; character_colour &32c6 a9 27 LDA #&27 ; ":" &32c8 20 50 04 JSR &0450 ; plot_character &32cb a9 70 LDA #&70 &32cd 85 90 STA &90 &32cf 38 SEC &32d0 a5 05 LDA &05 ; room_y &32d2 e9 08 SBC #&08 &32d4 20 0c 35 JSR &350c ; plot_coordinate # Plot the room's y co-ordinate ; skip_plotting_title_and_coordinates &32d7 68 PLA ; room_data_address_low &32d8 85 72 STA &72 ; room_data_address_low &32da 68 PLA ; room_data_address_high &32db 85 73 STA &73 ; room_data_address_high &32dd a0 01 LDY #&01 &32df 84 78 STY &78 ; bits_remaining &32e1 88 DEY &32e2 a2 1d LDX #&1d &32e4 20 f7 29 JSR &29f7 ; get_x_bits_of_packed_data # Skip first three bytes and five lowest bits of fourth &32e7 a2 02 LDX #&02 ; set_room_colours_loop &32e9 86 7d STX &7d ; colour_offset &32eb a2 03 LDX #&03 &32ed 20 f7 29 JSR &29f7 ; get_x_bits_of_packed_data # The top three bits of fourth byte, and onwards &32f0 85 7e STA &7e ; colour &32f2 a9 00 LDA #&00 &32f4 a2 04 LDX #&04 # define three room colours, three bits each ; calculate_room_colour_loop &32f6 46 7e LSR &7e ; colour &32f8 08 PHP &32f9 6a ROR A &32fa 28 PLP &32fb 6a ROR A &32fc ca DEX &32fd d0 f7 BNE &32f6 ; calculate_room_colour_loop &32ff a6 7d LDX &7d ; colour_offset &3301 9d 6a 01 STA &016a,X ; room_colours &3304 ca DEX &3305 10 e2 BPL &32e9 ; set_room_colours_loop &3307 a9 87 LDA #&87 &3309 85 70 STA &70 ; unpacked_address_low &330b a9 01 LDA #&01 ; &0187 = room_blocks &330d 85 71 STA &71 ; unpacked_address_high &330f 85 74 STA &74 ; remaining_pages &3311 a2 07 LDX #&07 &3313 20 cd 29 JSR &29cd ; unpack_data_with_x_bits_per_value # Unpack 7-bit run-length encoded data into room_blocks ; skip_unpacking_room_data &3316 20 bd 2a JSR &2abd ; wipe_enemies &3319 a2 00 LDX #&00 &331b 86 7d STX &7d ; block_screen_address_low &331d a9 53 LDA #&53 &331f 85 7e STA &7e ; block_screen_address_high &3321 86 81 STX &81 ; block_y &3323 86 82 STX &82 ; block_x &3325 a0 00 LDY #&00 # Y is enemy_offset ; consider_room_blocks_loop # Consider each room block &3327 bd 87 01 LDA &0187,X ; room_blocks &332a c9 36 CMP #&36 &332c 90 36 BCC &3364 ; not_puzzle_element # If >= &36 and <= &3c, it's a puzzle element &332e c9 3d CMP #&3d &3330 b0 32 BCS &3364 ; not_puzzle_element &3332 48 PHA ; block &3333 86 75 STX &75 ; block_offset &3335 aa TAX &3336 b5 24 LDA &24,X ; puzzles_solved - &36 &3338 c9 ff CMP #&ff &333a 68 PLA ; room-block &333b a6 75 LDX &75 ; block_offset &333d 90 07 BCC &3346 ; puzzle_not_solved &333f a9 00 LDA #&00 ; SPACE # If that puzzle has been solved, replace with a SPACE &3341 9d 87 01 STA &0187,X ; room_blocks &3344 f0 1e BEQ &3364 ; not_puzzle_element ; puzzle_not_solved &3346 09 c0 ORA #&c0 # If not, convert to &f6 - &fc &3348 85 6b STA &6b ; puzzle_block_type &334a a5 7d LDA &7d ; block_screen_address_low # Note its location &334c 85 67 STA &67 ; puzzle_screen_address_low &334e a5 7e LDA &7e ; block_screen_address_high &3350 85 68 STA &68 ; puzzle_screen_address_high &3352 a5 82 LDA &82 ; block_x &3354 20 b6 2a JSR &2ab6 ; multiply_by_six &3357 85 69 STA &69 ; puzzle_x &3359 a5 81 LDA &81 ; block_y &335b 0a ASL A &335c 0a ASL A &335d 0a ASL A &335e 85 6a STA &6a ; puzzle_y &3360 86 6c STX &6c ; puzzle_block_offset &3362 29 00 AND #&00 ; not_puzzle_element &3364 c9 3d CMP #&3d &3366 d0 0b BNE &3373 ; not_fire # If &3d, it's a FIRE &3368 a5 61 LDA &61 ; puzzles_solved + 7 &336a f0 05 BEQ &3371 ; not_fire &336c a9 00 LDA #&00 ; SPACE # Replace with SPACE if the firepit has been extinguished &336e 9d 87 01 STA &0187,X ; room_blocks &3371 a9 00 LDA #&00 ; not_fire &3373 c9 34 CMP #&34 # If &34, it's the end of a dynamic ROPE &3375 d0 14 BNE &338b ; not_end_of_rope &3377 8a TXA &3378 48 PHA &3379 a5 82 LDA &82 ; block_x &337b 0a ASL A &337c aa TAX &337d a5 7d LDA &7d ; block_screen_address_low # Note its location &337f 9d 6d 01 STA &016d,X ; ropes_screen_address_low &3382 a5 7e LDA &7e ; block_screen_address_high &3384 9d 6e 01 STA &016e,X ; ropes_screen_address_high &3387 68 PLA &3388 aa TAX &3389 a9 00 LDA #&00 ; not_end_of_rope &338b 29 40 AND #&40 &338d d0 03 BNE &3392 ; block_contains_an_enemy &338f 4c 17 34 JMP &3417 ; block_doesn't_contain_an_enemy ; block_contains_an_enemy # If >= &40, it's an enemy &3392 8a TXA &3393 48 PHA &3394 a5 7d LDA &7d ; block_screen_address_low # Note its location (Y is enemy_offset) &3396 99 00 01 STA &0100,Y ; enemies_screen_address_low &3399 a5 7e LDA &7e ; block_screen_address_high &339b 99 01 01 STA &0101,Y ; enemies_screen_address_high &339e a5 82 LDA &82 ; block_x &33a0 20 b6 2a JSR &2ab6 ; multiply_by_six &33a3 99 06 01 STA &0106,Y ; enemies_x &33a6 a5 81 LDA &81 ; block_y &33a8 0a ASL A &33a9 0a ASL A &33aa 0a ASL A &33ab 99 07 01 STA &0107,Y ; enemies_y &33ae 20 ab 2a JSR &2aab ; set_room_block_to_zero_and_return_previous_value &33b1 48 PHA &33b2 29 0f AND #&0f # Lowest four bits sets enemy sprite &33b4 99 02 01 STA &0102,Y ; enemies_sprite &33b7 68 PLA &33b8 29 30 AND #&30 # &30 sets top two bits of enemies_flags &33ba 0a ASL A # &20 is set if enemy is moving vertically &33bb 0a ASL A # &10 is set if enemy is fast &33bc 09 27 ORA #&27 # Set enemy in last quarter of second animation frame &33be 99 03 01 STA &0103,Y ; enemies_flags &33c1 30 26 BMI &33e9 ; enemy_data_is_in_block_below ; enemy_data_is_in_block_to_right # For horizontally moving enemies, the block to the &33c3 e8 INX # right determines additional details about the enemy &33c4 20 ab 2a JSR &2aab ; set_room_block_to_zero_and_return_previous_value &33c7 48 PHA &33c8 29 07 AND #&07 # The lowest three bits set the enemy's maximum x &33ca 38 SEC &33cb 65 82 ADC &82 ; block_x # relative to starting position &33cd 20 b6 2a JSR &2ab6 ; multiply_by_six &33d0 99 04 01 STA &0104,Y ; enemies_maximum &33d3 68 PLA ; enemy_data &33d4 4a LSR A &33d5 4a LSR A &33d6 4a LSR A &33d7 29 07 AND #&07 # The next lowest three bits set the enemy's minimum x &33d9 85 75 STA &75 ; delta &33db 18 CLC &33dc a5 82 LDA &82 ; block_x &33de e5 75 SBC &75 ; delta # relative to starting position &33e0 20 b6 2a JSR &2ab6 ; multiply_by_six &33e3 99 05 01 STA &0105,Y ; enemies_minimum &33e6 4c 10 34 JMP &3410 ; move_to_next_enemy_slot ; enemy_data_is_in_block_below # For vertically moving enemies, the block below &33e9 18 CLC # determines additional details about the enemy &33ea 8a TXA &33eb 69 0c ADC #&0c &33ed aa TAX &33ee 20 ab 2a JSR &2aab ; set_room_block_to_zero_and_return_previous_value &33f1 48 PHA &33f2 29 07 AND #&07 # The lowest three bits set the enemy's maximum y &33f4 38 SEC &33f5 65 81 ADC &81 ; block_y # relative to starting position &33f7 0a ASL A &33f8 0a ASL A &33f9 0a ASL A &33fa 99 04 01 STA &0104,Y ; enemies_maximum &33fd 68 PLA &33fe 4a LSR A &33ff 4a LSR A &3400 4a LSR A &3401 29 07 AND #&07 # The next lowest three bits set the enemy's minimum y &3403 85 75 STA &7A ; delta &3405 18 CLC &3406 a5 81 LDA &81 ; block_y &3408 e5 75 SBC &75 ; delta # relative to starting position &340a 0a ASL A &340b 0a ASL A &340c 0a ASL A &340d 99 05 01 STA &0105,Y ; enemies_minimum ; move_to_next_enemy_slot &3410 68 PLA ; room_block &3411 aa TAX &3412 18 CLC &3413 98 TYA &3414 69 08 ADC #&08 &3416 a8 TAY ; block_doesn't_contain_an_enemy &3417 18 CLC &3418 a5 7d LDA &7d ; block_screen_address_low # Move to next block &341a 69 30 ADC #&30 &341c 85 7d STA &7d ; block_screen_address_low &341e 90 02 BCC &3422 &3420 e6 7e INC &7e ; block_screen_address_high &3422 e6 82 INC &82 ; block_x &3424 a5 82 LDA &82 ; block_x &3426 c9 0c CMP #&0c &3428 d0 13 BNE &343d ; not_end_of_row &342a 18 CLC &342b a5 7d LDA &7d ; block_screen_address_low &342d 69 40 ADC #&40 &342f 85 7d STA &7d ; block_screen_address_low &3431 a5 7e LDA &7e ; block_screen_address_high &3433 69 02 ADC #&02 &3435 85 7e STA &7e ; block_screen_address_high &3437 a9 00 LDA #&00 &3439 85 82 STA &82 ; block_x &343b e6 81 INC &81 ; block_y ; not_end_of_row &343d bd 87 01 LDA &0187,X ; room_blocks &3440 09 80 ORA #&80 # Set the top bit to indicate it hasn't been plotted &3442 9d 87 01 STA &0187,X ; room_blocks &3445 e8 INX &3446 e0 78 CPX #&78 &3448 f0 03 BEQ &344d ; plot_room_blocks &344a 4c 27 33 JMP &3327 ; consider_room_blocks_loop ; plot_room_blocks &344d a9 00 LDA #&00 ; SPACE # Plot room blocks in order of sprite &344f 85 85 STA &85 ; current_sprite ; plot_room_blocks_sprite_loop &3451 a9 53 LDA #&53 &3453 85 76 STA &76 ; screen_address_high &3455 a9 0c LDA #&0c &3457 85 81 STA &81 ; blocks_left_in_row &3459 a2 00 LDX #&00 &345b 86 75 STX &75 ; screen_address_low ; plot_room_blocks_block_loop &345d 8a TXA &345e 48 PHA &345f 20 53 2a JSR &2a53 ; plot_room_block &3462 68 PLA &3463 aa TAX &3464 c6 81 DEC &81 ; blocks_left_in_row &3466 d0 11 BNE &3479 ; skip_move_to_next_column &3468 a9 0c LDA #&0c &346a 85 81 STA &81 ; blocks_left_in_row &346c 18 CLC &346d a5 75 LDA &75 ; screen_address_low &346f 69 40 ADC #&40 # Move down a block &3471 85 75 STA &75 ; screen_address_low &3473 a5 76 LDA &76 ; screen_address_high &3475 69 02 ADC #&02 &3477 85 76 STA &76 ; screen_address_high ; skip_move_to_next_column &3479 18 CLC &347a a5 75 LDA &75 ; screen_address_low &347c 69 30 ADC #&30 # Move right a block &347e 85 75 STA &75 ; screen_address_low &3480 90 02 BCC &3484 &3482 e6 76 INC &76 ; screen_address_high &3484 e8 INX &3485 e0 78 CPX #&78 &3487 d0 d4 BNE &345d ; plot_room_blocks_block_loop &3489 e6 85 INC &85 ; current_sprite &348b a5 85 LDA &85 ; current_sprite &348d c9 29 CMP #&29 # TRANSPORTER, &27 is last one actually used &348f d0 c0 BNE &3451 ; plot_room_blocks_sprite_loop &3491 20 65 24 JSR &2465 ; plot_enemies &3494 a9 d8 LDA #&d8 ; plot_objects_loop # Plot any object that is in the room &3496 48 PHA ; object_offset &3497 aa TAX &3498 bd 00 03 LDA &0300,X ; objects_room_x # Is this object in the room? &349b c5 04 CMP &04 ; room_x &349d d0 54 BNE &34f3 ; consider_next_object &349f bd 01 03 LDA &0301,X ; objects_room_y &34a2 c5 05 CMP &05 ; room_y &34a4 d0 4d BNE &34f3 ; consider_next_object &34a6 bd 04 03 LDA &0304,X ; objects_sprite &34a9 c9 33 CMP #&33 ; CANDLE &34ab d0 0a BNE &34b7 ; not candle # If so, and it is the CANDLE, &34ad a9 06 LDA #&06 &34af a2 16 LDX #&16 &34b1 20 05 35 JSR &3505 ; write_to_video_controller_register # make all of the room visible &34b4 68 PLA &34b5 48 PHA &34b6 aa TAX ; not_candle &34b7 20 99 27 JSR &2799 ; calculate_room_block_offset_of_object &34ba bd 06 03 LDA &0306,X ; objects_room_block &34bd 99 87 01 STA &0187,Y ; room_blocks # Set the object's room block &34c0 20 db 27 JSR &27db ; calculate_puzzle_x_and_y_from_room_block &34c3 bd 02 03 LDA &0302,X ; objects_screen_address_low &34c6 85 7d STA &7d ; block_screen_address_low &34c8 bd 03 03 LDA &0303,X ; objects_screen_address_high &34cb 85 7e STA &7e ; block_screen_address_high &34cd 8a TXA &34ce 48 PHA &34cf 20 15 2b JSR &2b15 ; consider_effect_of_object_on_room # Affect the room (COILED_ROPE, BRICK_WITH_HOLE, etc) &34d2 68 PLA &34d3 aa TAX &34d4 a9 ff LDA #&ff &34d6 85 7f STA &7f ; previous_sprite &34d8 bd 02 03 LDA &0302,X ; objects_screen_address_low &34db 85 94 STA &94 ; screen_address_low &34dd bd 03 03 LDA &0303,X ; objects_screen_address_high &34e0 85 95 STA &95 ; screen_address_high &34e2 bd 05 03 LDA &0305,X ; objects_palette &34e5 48 PHA &34e6 bd 04 03 LDA &0304,X ; objects_sprite &34e9 20 92 29 JSR &2992 ; unpack_background_sprite &34ec 68 PLA &34ed 20 a5 23 JSR &23a5 ; eor_unpacked_sprite_with_palette_value &34f0 20 d0 06 JSR &06d0 ; plot_sprite # Plot the object ; consider_next_object &34f3 68 PLA &34f4 38 SEC &34f5 e9 08 SBC #&08 &34f7 b0 9d BCS &3496 ; plot_objects_loop &34f9 20 d9 2a JSR &2ad9 ; consider_if_room_contains_magic_hat # Plot any MAGIC_HAT &34fc a9 13 LDA #&13 ; Wait for Vertical Retrace &34fe 20 f4 ff JSR &fff4 ; OSBYTE &3501 a9 01 LDA #&01 # R1: Horizontal displayed register &3503 a2 48 LDX #&48 # Make the newly plotted room visible ; write_to_video_controller_register &3505 8d 00 fe STA &fe00 # Write to video controller (register number) &3508 8e 01 fe STX &fe01 # Write to video controller (register value) &350b 60 RTS ; plot_coordinate &350c b0 08 BCS &3516 ; to_plot_character &350e 49 ff EOR #&ff &3510 69 01 ADC #&01 &3512 a2 03 LDX #&03 ; RR # Red if negative, yellow if positive &3514 86 92 STX &92 ; character_colour ; to_plot_character &3516 4c 50 04 JMP &0450 ; plot_character ; unused &3519 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3529 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3539 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &3549 00 00 00 00 00 00 00 ; room_data ; ; room_x 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ; room_y / -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J ; 21 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 5b .. .. .. .. .. ; 20 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 51 .. .. .. .. .. .. ; 19 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ; 18 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ; 17 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ; 16 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ; 15 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ; 14 6 .. .. .. 01 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ; 13 5 .. .. .. 02 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ; 12 4 .. .. .. 03 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ; 11 3 .. .. .. 04 17 57 .. .. .. .. 2c .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ; 10 2 .. .. .. 05 16 52 53 54 55 56 2b .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ; 9 1 .. .. .. 06 15 14 13 12 11 10 0f .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ; 8 0 .. .. .. 07 08 09 0a 5a 0c 0d 0e .. .. .. .. .. 3a 3b 3c .. .. .. .. .. .. .. .. ; 7 -1 18 19 1a 1b 1c 1d 1e 1f 20 21 22 2f 30 31 32 33 34 35 36 37 38 2e 58 59 0b 39 2d ; 6 -2 .. .. .. 23 24 25 26 27 28 29 2a .. .. .. .. .. .. 3d .. .. .. .. .. .. .. .. .. ; 5 -3 .. .. .. .. .. .. .. .. .. .. 46 .. .. .. .. .. .. 3e .. .. .. .. .. .. .. .. .. ; 4 -4 .. .. .. .. .. .. .. .. .. .. 47 .. .. .. .. .. .. 3f .. .. .. .. .. .. .. .. .. ; 3 -5 .. .. .. .. .. .. .. .. .. .. 48 49 .. .. .. .. .. 40 .. .. .. .. .. .. .. .. .. ; 2 -6 .. .. .. .. .. .. .. .. .. .. .. 4a 4b 4c 4d 4e .. 41 .. .. .. .. .. .. .. .. .. ; 1 -7 .. .. .. .. .. .. .. .. .. .. .. .. .. 4f 45 44 43 42 .. .. .. .. .. .. .. .. .. ; 0 -8 .. .. .. .. .. .. .. .. .. .. .. .. .. 50 .. .. .. .. .. .. .. .. .. .. .. .. .. ; room &01 (room_x=3, room_y=14) &3550 03 0e 54 01 2f 36 01 80 8d 00 82 d8 10 00 16 00 ; THE WEST TOWER (-4,6), colours=(5,7,0) &3560 36 08 48 60 01 80 01 80 01 80 bd 80 01 80 01 80 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 00 0d 0d ****************** **** &3570 01 80 c3 48 28 70 e0 30 00 18 12 00 19 20 44 06 ; 0d 0d 0d 00 00 0d 0d 0d 00 0d 00 0d ****** ****** ** ** &3580 08 92 01 80 01 82 44 80 10 11 20 48 04 00 07 0e ; 0d 00 00 00 00 00 00 00 00 00 0d 00 ** ** &3590 03 e1 81 43 48 80 10 1c 38 84 07 86 04 88 82 43 ; 03 00 03 00 03 7a 03 00 03 00 03 00 ## ## ##7a## ## ## &35a0 78 60 80 30 ; 03 03 03 03 09 0a 07 03 03 03 03 00 ########// \\######## ; 03 09 00 13 00 00 00 13 00 00 13 00 ##// PP PP PP ; 03 00 00 11 00 00 00 11 00 00 11 00 ## PP PP PP ; 07 03 03 03 03 01 0f 03 03 03 09 00 \\########~~LL######// ; 00 00 07 03 03 03 0f 03 09 00 00 00 \\######LL##// ; 00 00 00 03 03 03 0f 03 00 00 00 00 ######LL## ; room &02 (room_x=3, room_y=13) &35a4 03 0d 44 01 29 20 04 0e e1 81 01 62 60 48 00 78 ; THE WEST TOWER (-4,5), colours=(5,4,0) &35b4 60 80 18 18 20 88 07 06 88 81 01 80 43 80 18 18 ; 00 00 00 03 03 03 0f 03 00 00 00 00 ######LL## &35c4 20 08 07 06 88 81 01 50 00 80 01 62 60 80 10 18 ; 00 00 00 03 09 00 0f 03 00 00 00 00 ##// LL## &35d4 20 06 06 04 86 07 06 88 81 43 78 60 80 18 38 84 ; 00 00 00 03 00 00 0f 03 00 00 00 00 ## LL## &35e4 07 06 08 03 ; 00 00 00 03 00 03 03 03 00 00 00 00 ## ###### ; 00 00 00 03 00 00 07 03 00 00 00 00 ## \\## ; 00 00 00 03 00 14 00 03 00 00 00 00 ## () ## ; 00 00 00 03 00 00 00 03 00 00 00 00 ## ## ; 00 00 00 03 01 03 0f 03 00 00 00 00 ##~~##LL## ; 00 00 00 03 03 03 0f 03 00 00 00 00 ######LL## ; 00 00 00 03 03 03 0f 03 00 00 00 00 ######LL## ; room &03 (room_x=3, room_y=12) &35e8 03 0c 58 01 21 20 04 0e e1 81 01 62 e0 10 1e 18 ; THE WEST TOWER (-4,4), colours=(1,4,0) &35f8 20 8a 06 0e e1 81 41 01 42 68 e0 08 1e 38 04 05 ; 00 00 00 03 03 03 0f 03 00 00 00 00 ######LL## &3608 00 06 08 92 01 82 78 64 80 20 18 00 18 14 00 11 ; 00 00 00 03 03 03 0f 03 00 00 00 00 ######LL## &3618 20 88 47 04 80 06 06 00 07 0e 01 82 78 e0 10 12 ; 00 00 0b 03 03 03 0f 03 05 00 00 00 //######LL##\\ &3628 20 04 07 06 08 e2 81 21 01 a2 60 80 20 1e 18 20 ; 0b 03 03 03 03 03 0f 03 03 03 05 00 //##########LL######\\ &3638 06 06 08 e2 81 01 c2 00 ; 03 00 00 13 00 00 0f 13 00 00 03 00 ## PP LLPP ## ; 03 05 00 11 00 00 0f 11 00 0b 03 00 ##\\ PP LLPP //## ; 07 03 03 03 00 00 0f 03 03 03 09 00 \\###### LL######// ; 00 00 07 03 00 00 0f 03 09 00 00 00 \\## LL##// ; 00 00 00 03 00 00 0f 03 00 00 00 00 ## LL## ; 00 00 00 03 00 00 0f 03 00 00 00 00 ## LL## ; room &04 (room_x=3, room_y=11) &3640 03 0b 52 02 21 20 04 06 08 e2 81 01 62 60 50 00 ; THE GUARDHOUSE (-4,3), colours=(1,4,0) &3650 78 60 80 28 1a 18 01 00 1e 18 20 8c 06 0e 22 11 ; 00 00 00 03 00 00 0f 03 00 00 00 00 ## LL## &3660 80 43 50 80 10 18 12 20 48 00 40 00 0e 42 01 82 ; 00 00 00 03 05 00 0f 03 00 00 00 00 ##\\ LL## &3670 60 80 08 01 00 38 08 05 00 0e 02 a2 36 00 70 e0 ; 00 00 0b 03 10 00 0f 03 00 00 00 00 //##|| LL## &3680 30 20 02 06 08 82 23 80 10 38 08 80 06 4e e2 81 ; 0b 03 03 09 10 03 03 03 05 00 00 00 //####//||######\\ &3690 83 00 ; 03 09 00 00 10 00 10 03 03 05 00 00 ##// || ||####\\ ; 03 00 00 00 00 00 10 00 03 03 05 00 ## || ####\\ ; 03 03 00 00 00 00 00 00 36 00 07 03 #### 36 \\## ; 03 03 03 00 00 00 00 00 03 00 00 03 ###### ## ## ; 03 03 03 03 00 00 00 03 03 00 0b 03 ######## #### //## ; 03 03 03 03 03 03 03 03 03 0f 03 03 ##################LL#### ; room &05 (room_x=3, room_y=10) &3692 03 0a 41 38 09 38 81 07 8e 20 01 58 01 58 01 e0 ; THE TOWER BASE (-4,2), colours=(4,4,4) &36a2 81 23 80 a0 05 80 05 00 38 4c 00 88 c1 81 43 04 ; 03 03 03 03 03 03 03 03 03 0f 03 03 ##################LL#### &36b2 80 38 38 44 00 06 08 72 00 70 00 82 e0 10 01 18 ; 03 03 03 09 00 35 00 35 00 0f 03 03 ######// :: :: LL#### &36c2 20 06 0e 11 80 41 b1 23 68 e0 10 01 38 45 00 4e ; 03 03 03 00 00 34 00 34 00 03 03 03 ###### :: :: ###### &36d2 02 ; 03 10 00 00 00 00 00 00 00 07 03 03 ##|| \\#### ; 03 10 00 00 00 00 00 00 00 00 03 03 ##|| #### ; 03 10 03 00 00 1c 00 1c 00 00 03 03 ##||## %% %% #### ; 03 10 03 00 00 00 00 00 00 00 03 03 ##||## #### ; 03 10 03 05 1b 1b 1b 1b 1b 0b 03 03 ##||##\\^^^^^^^^^^//#### ; 03 10 03 03 03 03 03 03 03 03 03 03 ##||#################### ; 03 10 03 03 03 03 03 03 03 03 03 03 ##||#################### ; room &06 (room_x=3, room_y=9) &36d3 03 09 47 38 06 18 01 38 45 00 07 86 64 05 08 c1 ; THE TOWER BASE (-4,1), colours=(0,3,4) &36e3 81 43 04 80 90 15 20 0c 0e 11 00 42 56 80 30 38 ; 03 10 03 03 03 03 03 03 03 03 03 03 ##||#################### &36f3 04 08 5b 00 c2 e0 10 20 8e 07 0e 01 62 03 78 e0 ; 03 10 07 03 09 35 00 00 00 07 03 03 ##||\\##//:: \\#### &3703 30 14 40 15 20 c4 80 07 4e 02 e0 81 43 04 00 04 ; 03 10 00 00 00 35 00 00 00 00 03 03 ##|| :: #### &3713 00 04 80 10 1e 38 08 ; 03 10 00 00 00 35 00 00 00 00 03 03 ##|| :: #### ; 03 00 00 00 00 34 00 00 00 00 03 03 ## :: #### ; 03 00 00 00 00 00 00 00 00 0f 03 03 ## LL#### ; 03 00 00 00 00 00 00 00 60 0f 03 03 ## 60LL#### ; 03 03 05 00 55 00 00 00 18 0f 03 03 ####\\ 55 LL#### ; 03 03 03 03 03 03 03 03 00 0f 03 03 ################ LL#### ; 03 10 00 10 00 10 00 00 00 0f 03 03 ##|| || || LL#### ; room &07 (room_x=3, room_y=8) &371a 03 08 3a 38 09 18 01 00 01 00 01 20 84 07 0e 11 ; THE TOWER BASE (-4,0), colours=(4,4,4) &372a 00 62 78 e0 10 01 20 86 07 0e 11 00 62 78 e0 10 ; 03 10 00 10 00 10 00 00 00 0f 03 03 ##|| || || LL#### &373a 01 20 86 07 0e 01 e2 70 e0 10 20 01 0e 41 01 e2 ; 03 10 00 00 00 00 00 00 00 0f 03 03 ##|| LL#### &374a e0 30 20 54 40 06 88 80 d3 00 ; 03 10 00 00 00 00 00 00 00 0f 03 03 ##|| LL#### ; 03 10 00 00 00 00 00 00 00 0f 03 03 ##|| LL#### ; 03 10 00 00 00 00 00 00 00 0f 03 03 ##|| LL#### ; 03 00 00 00 00 00 00 00 00 07 03 03 ## \\#### ; 03 00 00 00 00 00 00 00 00 00 03 03 ## #### ; 03 05 00 00 00 00 00 00 00 00 03 03 ##\\ #### ; 03 03 00 00 00 50 13 00 00 00 00 00 #### 50 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &08 (room_x=4, room_y=8) &3754 04 08 43 36 02 38 0c 40 00 4e 42 59 c1 81 a3 48 ; THE WEST PALACE (-3,0), colours=(0,2,4) &3764 00 70 60 16 80 90 15 1c 38 08 88 5b 01 82 e0 20 ; 03 03 03 03 00 10 03 03 03 03 03 03 ######## ||############ &3774 10 38 02 60 01 08 82 21 01 c2 64 80 08 18 20 42 ; 03 03 03 03 05 35 07 03 03 03 03 03 ########\\::\\########## &3784 02 08 a1 81 21 01 42 25 28 44 80 20 1a 38 08 80 ; 03 09 00 07 03 34 00 00 00 35 07 03 ##// \\##:: ::\\## &3794 06 ae 02 ; 03 00 00 00 00 00 00 00 00 35 00 00 ## :: ; 03 03 01 03 03 03 03 03 00 34 00 00 ####~~########## :: ; 03 09 00 00 00 00 13 00 00 00 00 00 ##// PP ; 03 00 00 00 00 00 12 00 00 00 0b 03 ## PP //## ; 09 00 00 00 52 0a 11 00 00 0b 03 03 // 52 PP //#### ; 00 0b 03 03 03 03 03 03 03 03 03 03 //#################### ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &09 (room_x=5, room_y=8) &3797 05 08 48 36 09 38 86 07 0e 01 80 a3 48 78 70 e0 ; THE WEST PALACE (-2,0), colours=(4,4,4) &37a7 20 00 18 12 20 82 07 08 92 01 90 01 42 1c 80 20 ; 03 03 03 03 03 03 03 0f 03 03 03 00 ##############LL###### &37b7 1e 20 48 02 40 02 88 e2 01 82 24 00 44 80 60 09 ; 03 03 03 03 03 03 09 0f 07 03 03 00 ############//LL\\#### &37c7 54 92 08 1e 20 48 04 00 2e 20 01 a2 e0 10 20 1c ; 03 09 00 00 00 00 00 0f 00 00 13 00 ##// LL PP &37d7 80 06 08 81 43 00 e0 38 ; 13 00 00 00 1c 00 00 0f 00 00 12 00 PP %% LL PP ; 12 00 00 00 00 00 00 0f 00 00 12 00 PP LL PP ; 11 00 00 52 05 49 22 0f 00 00 11 00 PP 52 49 LL PP ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; 03 03 03 03 03 09 00 00 00 00 00 00 ##########// ; 03 03 03 00 00 00 00 40 0b 00 00 00 ###### 40 ; 03 03 03 00 03 03 03 03 03 03 03 03 ###### ################ ; room &0a (room_x=6, room_y=8) &37df 06 08 51 46 05 09 00 18 00 07 20 c8 01 00 06 40 ; THE MAIN PALACE (-1,0), colours=(0,5,2) &37ef 0a 02 80 01 a2 60 00 a4 20 00 1c 10 18 20 08 0e ; 12 00 03 00 1c 00 00 1c 00 03 00 12 PP ## %% %% ## PP &37ff 22 01 90 82 07 00 70 48 80 20 1c 12 c0 01 29 88 ; 12 00 03 00 00 00 00 00 00 03 00 12 PP ## ## PP &380f 00 08 a1 41 01 42 08 24 44 00 68 50 68 e0 20 14 ; 12 00 07 01 03 00 00 03 03 09 00 12 PP \\~~## ####// PP &381f 1a 14 00 11 38 4d 06 48 11 01 82 05 10 80 18 38 ; 12 70 00 07 09 00 00 07 09 00 70 12 PP70 \\// \\// 70PP &382f 0d ; 12 08 00 00 00 0b 05 00 00 00 08 12 PP //\\ PP ; 11 00 0b 05 0b 03 03 05 0b 05 00 11 PP //\\//####\\//\\ PP ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; 13 00 00 00 00 00 00 00 00 00 00 00 PP ; 11 00 00 50 04 00 00 00 00 00 00 00 PP 50 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &0b (room_x=24, room_y=7) &3830 18 07 16 33 31 36 08 88 63 01 d2 58 80 a3 07 a0 ; THE FIREPIT (17,-1), colours=(3,4,4) &3840 02 0e 7a e3 e0 2c ; 0d 0d 00 00 00 00 00 00 00 00 0d 00 **** ** ; 00 00 00 00 00 00 00 00 00 00 00 0d ** ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 3c 00 00 00 00 00 00 00 00 00 3c ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 03 03 3d 3d 3d 3d 3d 3d 3d 3d 03 03 ####3d3d3d3d3d3d3d3d#### ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &0c (room_x=8, room_y=8) &3846 08 08 4a 37 01 38 88 07 0e 11 80 23 80 20 1e 18 ; THE EAST PALACE (1,0), colours=(0,4,4) &3856 12 99 15 20 06 07 06 40 62 01 40 01 88 82 01 10 ; 03 03 0f 03 03 03 10 03 03 03 03 03 ####LL######||########## &3866 01 a2 e0 18 14 40 00 20 08 0e 42 11 a0 81 63 80 ; 00 00 0f 03 09 13 35 00 00 00 00 00 LL##//PP:: &3876 20 1c 01 12 19 20 41 00 40 02 08 72 00 a2 04 00 ; 00 00 07 03 00 12 34 00 14 00 00 00 \\## PP:: () &3886 44 01 20 80 30 38 44 00 8e 03 ; 00 00 00 03 00 11 00 00 00 00 00 00 ## PP ; 03 03 03 03 03 03 03 05 00 40 00 00 ##############\\ 40 ; 03 03 05 10 0b 03 03 03 03 03 03 03 ####\\||//############## ; 00 00 07 10 09 13 00 00 00 00 00 00 \\||//PP ; 00 00 00 10 00 12 00 00 1c 00 00 00 || PP %% ; 00 00 00 10 00 11 40 02 00 00 00 00 || PP40 ; 03 03 03 10 03 03 03 03 03 03 03 03 ######||################ ; room &0d (room_x=9, room_y=8) &3890 09 08 5d 37 0d 38 44 00 8e e0 81 83 64 80 a0 15 ; THE EAST PALACE (2,0), colours=(4,5,4) &38a0 00 1c 38 88 84 07 08 92 00 0c 58 01 82 e0 20 00 ; 03 03 03 10 03 03 03 03 03 0f 03 03 ######||##########LL#### &38b0 de 00 00 09 00 90 05 20 08 0e 02 e0 01 82 44 80 ; 13 00 00 35 00 07 03 03 09 0f 00 00 PP :: \\####//LL &38c0 30 1a 38 0b 08 93 01 82 04 80 10 19 00 18 14 00 ; 12 00 60 35 00 00 03 03 00 0f 60 00 PP 60:: #### LL60 &38d0 09 20 48 00 c0 01 40 02 00 0e 11 01 82 04 80 10 ; 12 00 01 34 00 00 03 03 00 0f 00 00 PP :: #### LL &38e0 11 00 01 1c 38 4c 00 0e 43 11 00 80 01 ; 11 00 00 00 00 0b 03 03 03 03 03 03 PP //############ ; 03 03 03 03 03 03 03 03 00 00 00 00 ################ ; 13 00 00 10 00 00 00 13 00 03 05 00 PP || PP ##\\ ; 12 00 00 10 00 1c 00 12 00 03 03 03 PP || %% PP ###### ; 11 00 00 10 00 00 00 11 00 10 07 03 PP || PP ||\\## ; 03 03 03 10 03 03 03 03 05 10 00 03 ######||########\\|| ## ; room &0e (room_x=10, room_y=8) &38ed 0a 08 4e 38 01 38 86 07 0e 93 01 c2 64 00 78 00 ; THE TOWER BASE (3,0), colours=(0,4,4) &38fd 64 00 60 24 80 20 07 00 09 00 1e 00 09 00 18 11 ; 03 03 03 03 03 03 03 0f 03 03 03 03 ##############LL######## &390d 20 18 40 42 04 80 07 40 04 00 ce 00 22 04 00 70 ; 13 00 00 00 00 13 00 0f 00 13 00 03 PP PP LL PP ## &391d e0 30 20 44 01 40 00 08 c2 81 c3 80 30 01 20 04 ; 12 00 00 1c 00 12 00 0f 00 12 00 03 PP %% PP LL PP ## &392d 07 0e 41 01 54 41 10 00 c2 e0 18 01 38 0a ; 11 00 00 40 12 11 00 0f 00 11 00 03 PP 40 PP LL PP ## ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; 00 00 00 00 00 10 00 07 03 03 03 03 || \\######## ; 00 00 00 14 00 10 00 00 07 03 03 03 () || \\###### ; 03 00 00 00 00 10 00 00 00 07 03 03 ## || \\#### ; 03 05 00 55 04 10 00 00 00 00 03 03 ##\\ 55 || #### ; 03 03 03 03 03 10 03 03 03 03 03 03 ##########||############ ; room &0f (room_x=10, room_y=9) &393b 0a 09 55 38 09 38 46 00 8e 20 11 00 82 04 00 04 ; THE TOWER BASE (3,1), colours=(4,4,4) &394b 70 e0 30 00 01 20 48 00 40 00 08 c2 81 83 00 04 ; 03 03 03 03 03 03 03 10 03 03 03 03 ##############||######## &395b 07 80 e0 01 20 0c 0e 02 82 48 80 20 12 c0 01 20 ; 03 09 10 00 00 10 00 10 07 03 03 03 ##//|| || ||\\###### &396b 08 0e 02 c2 55 6c 00 08 00 68 e0 20 1e 38 86 07 ; 03 00 10 00 00 10 00 10 00 00 07 03 ## || || || \\## &397b 0e e1 01 62 78 00 e0 20 1e 20 58 80 06 08 e1 a1 ; 03 00 10 70 00 00 70 00 00 00 00 03 ## ||70 70 ## &398b 81 e3 78 e0 30 ; 03 00 00 09 00 00 09 00 70 00 00 03 ## 70 ## ; 03 00 00 00 00 55 1b 00 08 00 0b 03 ## 55 //## ; 03 0f 03 03 03 03 03 03 03 0f 03 03 ##LL##############LL#### ; 03 0f 00 00 00 00 00 00 00 0f 00 03 ##LL LL ## ; 03 0f 00 00 50 0b 00 00 00 0f 0b 03 ##LL 50 LL//## ; 03 03 03 03 03 03 03 0f 03 03 03 03 ##############LL######## ; room &10 (room_x=9, room_y=9) &3990 09 09 55 37 01 38 83 04 88 c1 81 83 80 20 1a 14 ; THE EAST PALACE (2,1), colours=(0,4,4) &39a0 20 84 06 05 00 0e 02 82 60 00 05 00 05 00 60 00 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## &39b0 70 e0 20 00 38 06 05 00 0e 02 80 43 48 64 70 e0 ; 03 09 00 00 00 00 00 00 00 07 03 03 ##// \\#### &39c0 20 10 38 08 00 07 86 04 40 02 00 07 0e 43 01 10 ; 00 00 0b 05 00 00 00 0b 05 00 03 03 //\\ //\\ #### &39d0 00 82 44 80 20 1c 38 42 80 06 0e 41 01 80 23 04 ; 00 00 03 00 50 00 50 00 03 00 07 03 ## 50 50 ## \\## &39e0 e0 08 1e 38 08 ; 03 00 03 03 03 03 03 03 03 05 00 03 ## ##############\\ ## ; 03 00 03 03 03 09 13 07 03 03 01 03 ## ######//PP\\####~~## ; 03 00 07 03 09 00 12 00 07 03 03 03 ## \\##// PP \\###### ; 03 05 00 10 00 00 11 00 00 07 03 03 ##\\ || PP \\#### ; 03 03 03 10 0b 03 03 03 05 00 03 03 ######||//######\\ #### ; 03 03 03 10 03 03 03 03 03 0f 03 03 ######||##########LL#### ; room &11 (room_x=8, room_y=9) &39e5 08 09 41 37 09 38 83 c4 89 c3 81 91 71 92 64 44 ; THE EAST PALACE (1,1), colours=(4,4,4) &39f5 00 01 80 38 11 38 7c 00 36 00 76 00 36 00 46 06 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## &3a05 07 0e 02 80 01 80 01 80 01 80 91 00 c0 81 13 44 ; 03 09 1c 1c 1c 1c 1c 1c 1c 1c 07 03 ##//%%%%%%%%%%%%%%%%\\## &3a15 80 08 01 38 86 07 0e 42 11 80 63 78 e0 10 01 38 ; 13 1c 1c 1c 1c 1c 1c 1c 1c 1c 1c 13 PP%%%%%%%%%%%%%%%%%%%%PP &3a25 02 ; 11 00 40 00 00 00 00 00 00 00 00 11 PP 40 PP ; 03 03 03 03 70 03 60 03 70 03 60 03 ########70##60##70##60## ; 13 07 03 03 00 03 00 03 00 03 00 03 PP\\#### ## ## ## ## ; 12 00 07 03 03 03 03 03 03 03 03 03 PP \\################## ; 11 00 00 00 00 00 10 03 03 03 03 03 PP ||########## ; 03 03 0f 03 03 05 10 03 03 03 03 03 ####LL####\\||########## ; 03 03 0f 03 03 03 10 03 03 03 03 03 ####LL######||########## ; room &12 (room_x=7, room_y=9) &3a26 07 09 5f 26 05 38 82 07 8e 23 91 01 e0 01 90 01 ; THE MAIN PALACE (0,1), colours=(0,5,4) &3a36 82 70 60 00 04 00 24 00 78 00 24 00 14 00 64 00 ; 03 03 03 03 03 0f 03 03 03 03 03 03 ##########LL############ &3a46 04 00 24 00 78 00 24 80 10 11 00 01 00 11 00 1e ; 03 03 09 13 00 0f 00 13 00 00 07 03 ####//PP LL PP \\## &3a56 00 11 1a 38 04 40 00 00 8e 22 01 90 01 10 00 10 ; 00 10 00 12 00 0f 00 12 00 14 00 13 || PP LL PP () PP &3a66 00 42 64 80 10 09 00 01 00 01 20 44 14 00 04 40 ; 00 10 00 12 00 0f 00 12 00 00 00 11 || PP LL PP PP &3a76 04 08 11 00 82 68 e0 08 20 44 00 06 04 8e 02 ; 00 10 00 11 00 0f 00 11 0b 03 03 03 || PP LL PP//###### ; 00 10 00 03 03 03 03 03 03 09 00 13 || ############// PP ; 00 10 00 10 00 00 00 13 00 00 00 12 || || PP PP ; 00 10 00 10 00 00 00 11 40 01 00 11 || || PP40 PP ; 00 00 00 10 00 00 0b 03 03 03 03 03 || //########## ; 00 00 00 10 03 01 03 03 03 03 03 03 ||##~~############ ; room &13 (room_x=6, room_y=9) &3a85 06 09 5c c6 09 38 8b 44 00 08 13 c0 81 83 64 80 ; THE MAIN PALACE (-1,1), colours=(4,4,3) &3a95 20 01 40 1c 0a 00 01 20 48 46 02 08 12 00 c2 04 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## &3aa5 80 20 29 08 08 12 4c 01 82 53 04 80 20 29 08 08 ; 03 03 09 10 00 00 00 00 10 07 03 03 ####//|| ||\\#### &3ab5 12 00 01 82 40 04 80 20 29 08 08 12 00 c2 04 80 ; 13 00 00 10 00 47 0a 00 10 00 00 13 PP || 47 || PP &3ac5 20 29 08 80 06 0e 02 82 e0 20 14 00 29 08 00 06 ; 12 00 00 10 00 00 00 00 10 00 00 12 PP || || PP &3ad5 88 82 01 90 82 00 60 80 28 18 00 09 ; 12 00 00 10 65 00 00 65 10 00 00 12 PP ||65 65|| PP ; 12 00 00 10 01 00 00 01 10 00 00 12 PP || || PP ; 12 00 00 10 00 00 00 00 10 00 00 12 PP || || PP ; 12 00 0b 03 03 00 00 03 03 05 00 12 PP //#### ####\\ PP ; 12 00 03 00 00 00 00 00 00 03 00 12 PP ## ## PP ; 12 00 03 00 00 00 00 00 00 03 00 12 PP ## ## PP ; room &14 (room_x=5, room_y=9) &3ae1 05 09 58 36 04 38 0d 40 06 60 05 08 91 01 82 70 ; THE WEST PALACE (-2,1), colours=(0,1,4) &3af1 60 00 24 00 56 71 1c 00 24 80 08 11 80 15 20 44 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## &3b01 04 08 83 43 56 80 20 1a 18 14 20 04 0e 22 59 01 ; 00 13 00 35 00 00 00 13 00 00 07 03 PP :: PP \\## &3b11 a0 81 43 50 80 20 18 12 80 05 00 38 02 05 40 06 ; 00 12 00 35 47 1c 00 12 00 00 00 00 PP ::47 PP &3b21 08 93 01 82 70 e0 20 00 11 40 09 10 00 11 20 04 ; 00 11 00 35 00 00 00 11 00 00 00 00 PP :: PP &3b31 0e 02 80 63 78 e0 10 00 ; 03 03 03 35 00 00 0b 03 05 00 00 00 ######:: //##\\ ; 03 03 09 35 00 0b 03 03 03 05 00 00 ####//:: //######\\ ; 03 09 00 34 00 03 03 03 03 03 05 00 ##// :: ##########\\ ; 13 00 00 00 00 13 00 00 07 03 03 00 PP PP \\#### ; 11 00 52 01 00 11 00 00 00 03 03 00 PP 52 PP #### ; 03 03 03 03 03 03 03 0f 03 03 03 00 ##############LL###### ; room &15 (room_x=4, room_y=9) &3b39 04 09 57 36 09 38 84 07 4e 20 01 e0 01 90 01 22 ; THE WEST PALACE (-3,1), colours=(4,4,4) &3b49 64 60 80 20 1e 00 09 20 48 01 08 92 80 01 82 78 ; 03 03 03 0f 03 03 03 03 03 03 03 03 ######LL################ &3b59 00 44 01 14 80 10 11 18 00 1a 18 00 38 8e 07 0e ; 03 09 00 0f 00 13 00 00 00 00 00 13 ##// LL PP PP &3b69 02 c0 81 21 01 c0 81 43 78 e0 20 14 20 8c 06 0e ; 03 00 00 0f 00 12 00 00 14 00 00 12 ## LL PP () PP &3b79 e1 c1 81 a3 48 00 64 60 78 80 10 01 20 14 85 44 ; 03 00 00 0f 00 11 40 14 00 00 00 11 ## LL PP40 PP &3b89 04 0e 03 10 80 a3 00 ; 03 00 0b 03 00 03 03 03 03 03 03 03 ## //## ############## ; 03 0f 03 03 00 07 03 09 00 07 03 03 ##LL#### \\##// \\#### ; 03 0f 03 03 05 00 00 00 00 0b 03 03 ##LL####\\ //#### ; 03 0f 07 03 03 03 03 03 03 09 00 13 ##LL\\############// PP ; 03 0f 00 00 00 10 00 00 00 45 09 11 ##LL || 45 PP ; 03 03 03 03 00 10 03 03 03 03 03 03 ######## ||############ ; room &16 (room_x=4, room_y=10) &3b90 04 0a 52 36 01 38 46 00 8e 58 00 58 00 58 00 58 ; THE WEST PALACE (-3,2), colours=(0,4,4) &3ba0 00 82 04 e0 20 00 18 40 01 18 40 01 03 18 01 38 ; 03 03 03 03 03 03 03 10 03 03 03 03 ##############||######## &3bb0 08 00 8e 5b 81 83 00 56 00 56 00 56 00 56 00 16 ; 03 34 00 34 00 34 00 34 00 00 10 03 ##:: :: :: :: ||## &3bc0 e0 20 80 15 80 05 80 05 80 05 20 08 0e 02 58 00 ; 03 00 03 00 50 03 00 50 18 03 10 03 ## ## 50 50 ##||## &3bd0 e2 e0 20 20 09 0e 42 01 42 05 14 80 30 38 8c 07 ; 03 00 03 03 03 03 03 03 03 03 35 03 ## ################::## &3be0 8e 03 ; 03 00 35 00 35 00 35 00 35 00 34 03 ## :: :: :: :: ::## ; 03 00 35 00 34 00 34 00 34 00 00 03 ## :: :: :: :: ## ; 03 00 34 00 00 00 00 00 00 00 00 03 ## :: ## ; 03 00 00 00 00 00 00 00 00 00 00 03 ## ## ; 03 05 00 00 00 50 14 00 00 00 00 03 ##\\ 50 ## ; 03 03 03 0f 03 03 03 03 03 03 03 03 ######LL################ ; room &17 (room_x=4, room_y=11) &3be2 04 0b 4e 07 29 20 8b 06 8e 42 01 42 68 60 48 80 ; THE ROOFTOP (-3,3), colours=(5,4,0) &3bf2 30 1c 38 04 00 86 04 08 a2 41 01 82 70 e0 20 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 &3c02 19 20 88 86 04 07 05 08 92 01 82 44 00 68 48 80 ; 00 00 0b 03 03 03 03 03 03 05 00 00 //############\\ &3c12 20 1c 14 00 11 00 38 84 04 08 c3 81 23 48 80 28 ; 00 0b 03 09 00 00 00 00 07 03 03 03 //##// \\###### &3c22 1c 38 84 04 88 c3 81 23 40 e0 20 1e 38 0c ; 00 03 09 00 00 0b 05 00 00 07 03 03 ##// //\\ \\#### ; 00 13 00 00 0b 09 07 05 00 00 13 00 PP ////\\\\ PP ; 00 11 00 0b 09 00 00 07 05 00 11 00 PP //// \\\\ PP ; 03 03 03 09 00 00 00 00 07 03 03 03 ######// \\###### ; 03 03 09 00 00 00 00 00 00 07 03 03 ####// \\#### ; 03 09 00 00 00 00 00 00 00 00 07 03 ##// \\## ; 03 03 03 03 01 03 03 0f 03 03 03 03 ########~~####LL######## ; room &18 (room_x=0, room_y=7) &3c30 00 07 38 c4 0b 24 08 83 00 09 a1 60 40 a2 30 00 ; THE TRANSPORTER (-7,-1), colours=(4,6,3) &3c40 72 00 18 90 04 00 24 89 02 80 00 89 a3 00 42 08 ; 04 04 06 08 04 04 04 0a 0c 04 04 04 @@@@\\\\@@@@@@////@@@@@@ &3c50 28 80 10 24 88 02 88 62 40 42 28 80 20 06 08 0c ; 04 04 04 06 00 27 00 0c 04 04 04 04 @@@@@@\\ ][ //@@@@@@@@ &3c60 20 88 00 c9 01 52 90 34 ; 04 04 04 04 04 00 04 04 04 04 04 04 @@@@@@@@@@ @@@@@@@@@@@@ ; 04 04 04 04 0a 00 08 04 04 04 04 04 @@@@@@@@// \\@@@@@@@@@@ ; 04 04 04 0a 00 00 00 08 0a 00 00 00 @@@@@@// \\// ; 04 04 0a 00 00 00 00 00 00 0c 04 04 @@@@// //@@@@ ; 04 0a 00 00 0c 02 06 00 00 08 04 04 @@// //~~\\ \\@@@@ ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; 04 00 00 00 00 00 00 00 00 00 00 00 @@ ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; room &19 (room_x=1, room_y=7) &3c68 01 07 47 43 0e 24 0e 80 0d 41 e2 58 80 20 16 24 ; THE WEST WOOD (-6,-1), colours=(4,3,2) &3c78 86 02 08 43 a0 00 c2 2e 80 18 06 24 02 08 43 c2 ; 04 04 04 04 04 04 04 04 00 0d 0d 0d @@@@@@@@@@@@@@@@ ****** &3c88 28 00 64 80 20 03 13 0b 24 84 02 08 12 01 30 30 ; 04 04 04 04 04 04 04 04 0d 00 00 0d @@@@@@@@@@@@@@@@** ** &3c98 43 90 20 0a 00 06 24 04 08 d2 00 c2 18 90 30 20 ; 04 04 04 04 04 04 04 0a 00 00 00 00 @@@@@@@@@@@@@@// &3ca8 48 05 00 89 e3 c2 00 ; 04 0a 00 00 00 00 3a 00 00 00 00 00 @@// 3a ; 00 00 0c 04 04 04 04 04 00 00 00 00 //@@@@@@@@@@ ; 04 04 04 04 0a 00 13 00 00 18 19 1a @@@@@@@@// PP TTTTTT ; 04 04 04 0a 00 00 11 00 18 19 19 19 @@@@@@// PP TTTTTTTT ; 04 04 0a 00 0c 04 04 04 00 00 16 00 @@@@// //@@@@@@ TT ; 00 00 00 0c 04 04 04 04 00 00 15 00 //@@@@@@@@ TT ; 04 04 04 04 04 04 04 04 0e 0e 0e 0e @@@@@@@@@@@@@@@@======== ; room &1a (room_x=2, room_y=7) &3caf 02 07 31 43 06 b6 0e 48 22 40 00 c2 0c 4c 2c 80 ; THE WEST WOOD (-5,-1), colours=(0,3,2) &3cbf 30 02 20 c4 c0 0c b1 00 a2 0c cc 08 0b 20 c4 02 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ &3ccf 08 d3 00 52 74 80 b8 03 20 48 95 40 02 08 e3 d2 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ &3cdf 00 ; 00 00 00 00 00 00 00 00 00 00 08 04 \\@@ ; 00 00 00 00 18 19 1a 00 00 00 00 08 TTTTTT \\ ; 00 00 00 18 19 19 19 1a 00 00 00 00 TTTTTTTTTT ; 00 00 18 19 19 19 19 19 1a 00 00 00 TTTTTTTTTTTTTT ; 1a 00 00 00 00 16 00 00 00 00 00 00 TT TT ; 00 00 00 00 00 17 00 00 00 00 00 00 TT ; 00 00 38 00 00 15 48 12 00 00 00 00 38 TT48 ; 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e ======================== ; room &1b (room_x=3, room_y=7) &3ce0 03 07 59 05 31 38 87 44 06 88 92 81 83 48 00 24 ; THE WEST EXIT (-4,-1), colours=(3,4,0) &3cf0 80 20 05 20 44 02 0e 02 82 44 00 51 20 80 10 11 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## &3d00 1c 18 00 1e 38 0e 00 06 80 47 00 07 8e 02 80 01 ; 03 03 03 09 13 00 00 00 00 00 00 13 ######//PP PP &3d10 e0 11 00 80 11 00 82 70 60 00 60 00 78 04 00 60 ; 03 03 09 00 12 00 00 14 00 00 00 12 ####// PP () PP &3d20 04 60 50 00 60 00 60 00 78 04 68 60 04 e0 30 0e ; 03 03 00 00 11 00 45 02 00 00 00 11 #### PP 45 PP &3d30 18 10 18 01 38 48 00 0e 03 ; 07 03 00 0f 03 03 03 03 03 03 03 03 \\## LL################ ; 00 03 00 0f 10 07 03 03 03 03 03 03 ## LL||\\############ ; 00 03 00 0f 10 00 03 10 00 00 07 03 ## LL|| ##|| \\## ; 00 03 00 0f 10 00 03 10 03 05 00 03 ## LL|| ##||##\\ ## ; 00 03 00 0f 10 0b 03 10 03 03 03 03 ## LL||//##||######## ; 0e 03 01 03 10 03 03 10 03 03 03 03 ==##~~##||####||######## ; room &1c (room_x=4, room_y=7) &3d39 04 07 53 08 39 38 4d 06 08 91 01 a2 64 24 00 1c ; THE PASSAGES (-3,-1), colours=(7,4,0) &3d49 00 24 80 10 07 20 48 42 04 08 11 01 14 80 01 42 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## &3d59 44 60 50 00 68 e0 24 1e 38 84 04 08 92 c1 81 43 ; 13 00 00 00 13 00 00 00 00 00 00 13 PP PP PP &3d69 78 60 48 80 20 05 00 09 00 38 84 47 06 88 90 00 ; 12 00 1c 00 12 00 00 00 1c 00 00 12 PP %% PP %% PP &3d79 80 43 78 44 00 51 20 80 20 11 1a 38 84 07 0e 03 ; 11 00 00 00 11 00 50 03 00 00 00 11 PP PP 50 PP &3d89 81 c3 00 ; 03 05 00 0b 03 03 03 03 03 03 03 03 ##\\ //################ ; 03 03 0f 03 03 03 09 00 00 13 07 03 ####LL######// PP\\## ; 03 03 0f 03 09 00 00 14 00 12 00 03 ####LL##// () PP ## ; 03 03 0f 13 00 00 00 00 00 12 00 03 ####LLPP PP ## ; 03 03 0f 11 00 45 02 00 00 11 0b 03 ####LLPP 45 PP//## ; 03 03 0f 03 03 03 03 01 03 03 03 03 ####LL########~~######## ; room &1d (room_x=5, room_y=7) &3d8c 05 07 62 08 31 38 04 00 8e 93 c1 81 01 80 23 48 ; THE PASSAGES (-2,-1), colours=(3,4,0) &3d9c 80 20 09 00 18 20 0c 87 04 80 06 46 04 00 07 04 ; 03 03 03 00 03 03 03 03 03 03 03 03 ###### ################ &3dac 0e 42 01 82 68 48 64 60 80 10 19 00 1c 14 1a 12 ; 13 07 03 00 03 03 03 03 03 09 00 00 PP\\## ##########// &3dbc 00 09 18 14 20 48 02 08 82 83 80 20 09 38 08 05 ; 12 00 03 00 00 00 00 07 09 00 0b 03 PP ## \\// //## &3dcc 40 02 08 82 83 00 1c 24 e0 10 14 11 20 08 0e 02 ; 11 00 07 01 03 03 05 00 00 0b 09 13 PP \\~~####\\ ////PP &3ddc 82 24 e0 08 14 00 38 08 05 40 04 8e e2 81 43 78 ; 03 00 00 00 13 00 07 05 0b 09 00 12 ## PP \\\\//// PP &3dec 60 00 ; 03 05 00 00 12 00 00 03 03 00 00 12 ##\\ PP #### PP ; 03 03 05 00 12 00 00 03 03 00 1c 12 ####\\ PP #### %%PP ; 03 03 03 05 11 00 00 03 03 00 00 12 ######\\PP #### PP ; 03 03 03 03 03 05 00 03 03 05 00 11 ##########\\ ####\\ PP ; 03 03 03 03 03 03 0f 03 03 03 0f 03 ############LL######LL## ; room &1e (room_x=6, room_y=7) &3dee 06 07 47 08 39 38 0d 48 83 d3 64 80 08 01 20 42 ; THE PASSAGES (-1,-1), colours=(7,4,0) &3dfe 02 08 1f 10 00 a0 81 43 24 00 03 80 20 18 01 00 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## &3e0e 38 4c 02 80 04 08 11 a0 81 83 48 64 24 80 28 38 ; 00 00 00 00 00 00 00 00 00 00 00 00 &3e1e 88 04 40 42 84 06 0e 42 01 82 60 48 80 20 11 38 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## &3e2e 8a 07 06 08 e2 81 01 ; 13 00 00 00 00 00 10 00 00 00 00 00 PP || ; 12 00 00 00 00 70 10 00 0b 03 03 03 PP 70|| //###### ; 12 00 60 00 00 03 10 00 03 03 03 03 PP 60 || ######## ; 12 00 09 00 00 00 10 0b 03 03 09 13 PP ||//####//PP ; 12 00 00 00 00 00 00 03 03 09 00 12 PP ####// PP ; 11 0b 03 03 05 00 00 03 09 00 00 11 PP//####\\ ##// PP ; 03 03 03 03 03 03 0f 03 00 00 0f 03 ############LL## LL## ; room &1f (room_x=7, room_y=7) &3e35 07 07 3f 08 31 38 0d 48 83 d3 80 10 1c 38 09 05 ; THE PASSAGES (0,-1), colours=(3,4,0) &3e45 10 05 41 00 08 83 63 04 e0 10 00 18 19 20 44 06 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## &3e55 08 82 43 00 60 24 03 14 03 24 00 68 60 48 80 20 ; 00 00 00 00 00 00 00 00 00 00 00 00 &3e65 19 11 20 44 84 06 0e 42 01 82 44 e0 24 1e 18 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; 00 00 00 07 03 03 03 03 03 03 03 03 \\################ ; 03 03 05 00 45 04 10 00 00 00 00 03 ####\\ 45 || ## ; 03 03 03 03 03 03 10 03 03 03 00 03 ############||###### ## ; 13 00 00 00 13 00 00 03 03 03 00 03 PP PP ###### ## ; 12 60 14 60 12 00 0b 03 09 00 00 13 PP60()60PP //##// PP ; 11 00 00 00 11 0b 03 03 05 00 00 11 PP PP//####\\ PP ; 03 03 03 03 03 03 03 03 03 03 0f 03 ####################LL## ; room &20 (room_x=8, room_y=7) &3e74 08 07 50 08 39 38 44 00 8e 03 82 60 04 80 08 01 ; THE PASSAGES (1,-1), colours=(7,4,0) &3e84 00 38 08 80 04 08 d5 21 01 10 00 80 83 80 20 1a ; 03 03 03 10 03 03 03 03 03 03 03 03 ######||################ &3e94 38 0a 00 0e 02 a0 21 01 62 e0 20 1a 12 00 1a 38 ; 00 00 03 10 00 00 00 00 00 10 00 03 ##|| || ## &3ea4 8e 04 80 06 86 04 88 92 01 a0 81 21 01 70 00 82 ; 03 00 09 00 00 00 57 09 00 10 00 03 ## // 57 || ## &3eb4 68 e0 20 11 1a 38 08 05 08 a2 01 81 13 78 e0 08 ; 03 00 00 0b 03 03 03 03 03 03 00 03 ## //############ ## ; 03 00 0b 09 00 00 00 00 00 00 00 03 ## //// ## ; 03 0b 09 00 0b 03 03 03 03 03 03 03 ##//// //############## ; 03 09 00 0b 03 09 00 00 00 00 00 00 ##// //##// ; 13 00 0b 03 09 00 1c 00 00 0b 03 03 PP //##// %% //#### ; 11 0b 03 03 05 00 00 0b 01 03 03 03 PP//####\\ //~~###### ; 03 03 03 03 03 03 0f 03 03 03 03 03 ############LL########## ; room &21 (room_x=9, room_y=7) &3ec4 09 07 5f 0c 34 38 44 00 8e 10 00 80 c3 04 e0 30 ; THE EAST EXIT (2,-1), colours=(3,1,0) &3ed4 12 c1 15 1c 38 44 00 86 04 40 06 40 00 02 00 0e ; 03 03 03 10 03 03 03 03 03 10 00 03 ######||##########|| ## &3ee4 11 80 01 82 24 80 30 38 44 00 06 08 12 45 21 01 ; 03 03 03 10 03 03 03 03 09 10 75 07 ######||########//||75\\ &3ef4 82 e0 10 01 18 1e 38 0a 08 82 11 80 e1 81 21 c1 ; 03 03 03 10 03 09 00 13 00 10 02 00 ######||##// PP || &3f04 81 c3 00 60 04 60 78 64 80 20 1c 38 04 00 46 00 ; 03 03 03 10 03 00 00 12 00 00 00 00 ######||## PP &3f14 86 47 04 08 c1 81 83 00 60 04 e0 30 10 38 04 ; 03 03 03 10 03 00 00 11 45 09 00 00 ######||## PP45 ; 03 03 03 10 03 0f 03 03 03 03 03 03 ######||##LL############ ; 00 00 03 10 03 0f 03 09 07 03 03 03 ##||##LL##//\\###### ; 03 00 03 10 03 0f 13 00 00 07 03 03 ## ##||##LLPP \\#### ; 03 00 03 10 03 0f 11 00 00 00 07 03 ## ##||##LLPP \\## ; 03 00 03 10 03 03 03 03 01 03 03 03 ## ##||########~~###### ; room &22 (room_x=10, room_y=7) &3f23 0a 07 59 0c 39 38 42 00 8e 21 01 42 04 70 e0 08 ; THE EAST EXIT (3,-1), colours=(7,4,0) &3f33 19 20 4c 00 40 06 08 91 91 00 82 14 00 04 00 24 ; 03 03 03 03 03 10 03 03 03 03 03 03 ##########||############ &3f43 80 10 09 11 20 78 00 40 00 40 14 05 04 40 04 06 ; 03 09 00 00 00 10 07 03 03 03 03 03 ##// ||\\########## &3f53 08 92 01 10 00 80 a3 80 d0 01 20 48 06 08 c2 81 ; 13 00 00 00 00 10 00 13 00 00 00 13 PP || PP PP &3f63 83 50 80 a0 10 20 48 02 08 91 81 83 50 80 30 11 ; 12 00 00 14 00 10 00 12 00 00 00 12 PP () || PP PP &3f73 40 15 00 11 38 8e 07 0e 01 ; 11 00 00 70 00 10 00 11 45 01 00 11 PP 70 || PP45 PP ; 03 00 00 13 00 10 00 03 03 03 03 03 ## || ########## ; 03 00 00 00 70 00 00 13 00 00 07 03 ## 70 PP \\## ; 03 05 00 00 21 00 00 12 00 00 00 13 ##\\ PP PP ; 03 03 05 00 00 00 00 11 00 55 00 11 ####\\ PP 55 PP ; 03 03 03 03 03 03 03 03 0f 03 03 03 ################LL###### ; room &23 (room_x=3, room_y=6) &3f7c 03 06 54 05 3c 38 4c 00 0e 12 80 63 48 56 70 48 ; THE WEST EXIT (-4,-2), colours=(7,1,0) &3f8c 56 70 e0 08 12 80 15 20 68 05 00 07 0e 03 82 56 ; 03 03 03 03 10 03 03 10 03 03 03 03 ########||####||######## &3f9c 07 00 56 80 20 38 84 04 08 5a 01 1d 58 01 0c c0 ; 03 03 03 09 35 07 09 35 07 03 03 03 ######//::\\//::\\###### &3fac 81 83 50 03 00 16 00 08 16 00 40 68 e0 10 02 20 ; 03 03 09 00 35 00 00 35 00 07 03 03 ####// :: :: \\#### &3fbc 06 0e 43 01 82 68 50 80 20 1a 38 02 85 06 0e 42 ; 03 03 00 00 35 70 00 35 00 00 03 03 #### ::70 :: #### &3fcc a1 81 73 00 ; 03 09 00 00 35 01 70 35 00 60 07 03 ##// :: 70:: 60\\## ; 03 05 60 00 34 00 08 34 00 01 0b 03 ##\\60 :: :: //## ; 03 03 08 00 00 00 00 00 00 00 03 03 #### #### ; 03 03 05 00 00 0b 05 00 00 0b 03 03 ####\\ //\\ //#### ; 03 03 03 05 0b 03 03 05 0b 03 03 03 ######\\//####\\//###### ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &24 (room_x=4, room_y=6) &3fd0 04 06 4a 08 34 38 88 07 4e 22 e1 91 c1 81 21 01 ; THE PASSAGES (-3,-2), colours=(3,1,0) &3fe0 22 60 00 78 24 00 60 50 80 08 d8 15 1e 09 00 1c ; 03 03 0f 03 03 03 03 03 03 03 03 03 ####LL################## &3ff0 38 88 07 8e e0 91 00 c2 78 80 10 18 00 1e 11 40 ; 03 09 0f 13 07 03 09 00 00 00 00 00 ##//LLPP\\##// &4000 14 04 00 1e 20 04 06 80 07 4e 02 e0 91 01 e2 60 ; 03 00 0f 12 00 03 05 00 00 00 00 00 ## LLPP ##\\ &4010 50 78 44 00 51 10 80 08 38 0d ; 03 75 0f 12 00 07 03 03 0f 03 03 03 ##75LLPP \\####LL###### ; 03 03 0f 12 00 00 00 00 0f 00 00 00 ## LLPP LL ; 03 00 0f 11 00 45 04 00 0f 00 00 00 ## LLPP 45 LL ; 03 00 0f 03 03 03 03 03 03 03 03 03 ## LL################## ; 03 00 0f 13 00 00 00 00 00 00 00 00 ## LLPP ; 03 05 0f 11 00 45 04 00 00 00 00 00 ##\\LLPP 45 ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &25 (room_x=5, room_y=6) &401a 05 06 3d 08 3c 38 8a 07 0e e1 81 91 01 c2 64 78 ; THE PASSAGES (-2,-2), colours=(7,1,0) &402a e0 10 1e 19 11 20 4c 84 07 0e e1 11 81 13 48 78 ; 03 03 03 03 03 03 0f 03 03 03 0f 03 ############LL######LL## &403a 60 64 80 04 1e 18 11 20 58 05 06 88 e0 81 33 64 ; 13 00 00 00 00 13 0f 03 03 03 0f 13 PP PPLL######LLPP &404a 80 24 19 11 20 1c 20 06 08 13 81 d3 00 ; 11 00 00 00 00 11 0f 03 03 03 0f 11 PP PPLL######LLPP ; 03 03 03 03 03 03 03 03 03 09 0f 03 ##################//LL## ; 13 00 00 00 00 00 00 00 00 00 0f 03 PP LL## ; 11 00 00 55 03 00 00 00 00 00 0f 03 PP 55 LL## ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; 13 00 00 00 00 00 00 00 00 00 00 13 PP PP ; 11 00 00 00 00 40 23 00 00 00 00 11 PP 40 PP ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &26 (room_x=6, room_y=6) &4057 06 06 50 08 34 38 8a 07 06 08 e2 81 01 a2 78 64 ; THE PASSAGES (-1,-2), colours=(3,1,0) &4067 80 20 1e 18 20 14 45 04 80 47 02 08 e2 81 63 78 ; 03 03 03 03 03 03 0f 03 00 00 0f 03 ############LL## LL## &4077 24 80 20 1e 38 88 04 00 07 0e e2 91 00 80 c3 80 ; 00 00 00 00 00 00 0f 13 00 00 0f 03 LLPP LL## &4087 08 1e 11 00 01 1c 38 01 40 00 00 07 08 92 01 c2 ; 00 00 00 45 11 00 0f 12 00 00 0f 03 45 LLPP LL## &4097 64 00 04 53 80 10 51 15 14 20 48 04 08 83 d3 00 ; 03 03 03 03 03 03 0f 12 00 00 0f 03 ############LLPP LL## ; 03 09 00 07 03 03 0f 12 00 03 03 03 ##// \\####LLPP ###### ; 03 00 00 00 00 00 0f 11 00 10 07 03 ## LLPP ||\\## ; 03 03 03 03 03 03 03 03 00 10 00 07 ################ || \\ ; 00 00 13 00 00 00 00 13 00 10 65 00 PP PP ||65 ; 00 00 11 55 05 00 00 11 00 00 00 00 PP55 PP ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &27 (room_x=7, room_y=6) &40a7 07 06 50 08 39 38 89 07 0e 22 59 01 42 56 70 60 ; THE PASSAGES (0,-2), colours=(7,4,0) &40b7 48 78 e0 20 80 15 40 1c 92 15 20 84 07 0e 02 58 ; 03 03 03 03 03 03 03 03 03 03 0f 03 ####################LL## &40c7 01 42 56 68 e0 08 80 15 20 64 01 8e 42 59 01 a0 ; 03 09 35 00 00 00 35 07 03 09 0f 03 ##//:: ::\\##//LL## &40d7 81 01 42 70 e0 b0 05 38 88 04 c0 01 08 82 83 80 ; 03 00 35 00 47 09 35 00 00 00 0f 03 ## :: 47 :: LL## &40e7 30 19 20 8c 06 0e 02 82 01 60 44 80 20 1a 38 0f ; 03 00 35 00 00 00 35 0b 03 03 03 03 ## :: :://######## ; 03 00 35 00 00 00 34 03 03 03 03 03 ## :: ::########## ; 03 05 35 00 0b 03 00 00 00 07 03 03 ##\\:: //## \\#### ; 03 03 34 03 03 09 00 1c 00 00 03 03 ####::####// %% #### ; 00 00 00 00 13 00 00 00 00 0b 03 03 PP //#### ; 00 00 40 03 11 00 00 0b 03 03 03 03 40 PP //######## ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &28 (room_x=8, room_y=6) &40f7 08 06 52 29 36 38 8a 07 0e 21 c1 81 01 22 78 60 ; THE BASEMENT (1,-2), colours=(3,3,4) &4107 48 70 50 68 60 80 10 38 0c 85 06 0e 03 5c 01 c2 ; 03 03 03 03 03 03 0f 03 03 03 09 07 ############LL######//\\ &4117 e0 20 20 08 0e 02 42 57 00 57 e0 20 00 38 c4 06 ; 03 00 00 00 00 00 0f 03 09 07 05 0b ## LL##//\\\\// &4127 06 08 01 c1 81 01 80 23 00 60 80 08 38 88 04 07 ; 03 00 00 00 03 03 03 03 05 0b 03 03 ## ########\\//#### &4137 c6 06 06 00 06 08 a2 81 83 50 68 e0 10 1b 18 1b ; 03 03 00 75 00 00 00 00 03 03 00 00 #### 75 #### &4147 38 07 ; 03 03 00 00 00 75 00 75 03 03 00 03 #### 75 75#### ## ; 03 03 1b 03 00 00 00 01 07 03 00 03 ####^^## \\## ## ; 03 03 03 03 00 03 00 00 00 00 00 03 ######## ## ## ; 03 09 07 03 1b 03 00 03 00 00 0b 03 ##//\\##^^## ## //## ; 03 05 0b 03 03 03 1b 03 1b 03 03 03 ##\\//######^^##^^###### ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &29 (room_x=9, room_y=6) &4149 09 06 57 49 3f 18 00 18 01 38 01 48 10 00 80 93 ; THE BASEMENT (2,-2), colours=(7,7,2) &4159 04 60 80 a0 15 80 15 98 15 80 15 98 15 38 08 60 ; 03 00 03 10 03 03 03 03 03 03 03 03 ## ##||################ &4169 75 65 05 66 75 65 05 66 05 0e 02 58 01 58 81 59 ; 03 00 00 00 00 00 00 00 00 00 10 00 ## || &4179 01 58 81 59 81 83 00 16 60 16 60 16 60 16 60 16 ; 03 03 03 03 03 03 03 03 03 03 10 03 ####################||## &4189 e0 20 20 08 06 00 06 00 06 00 06 00 0e b2 83 60 ; 00 00 35 00 35 03 35 00 35 03 35 03 :: ::##:: ::##::## &4199 80 10 18 20 04 ce 00 ; 03 00 35 75 35 03 35 75 35 03 35 03 ## ::75::##::75::##::## ; 03 00 35 00 35 03 35 00 35 03 35 03 ## :: ::##:: ::##::## ; 03 00 34 03 34 03 34 03 34 03 34 03 ## ::##::##::##::##::## ; 03 00 00 03 00 03 00 03 00 03 00 03 ## ## ## ## ## ## ; 03 1b 1b 03 00 00 00 03 00 00 00 03 ##^^^^## ## ## ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &2a (room_x=10, room_y=6) &41a0 0a 06 48 09 31 38 8e 07 0e 01 a2 70 60 78 70 e0 ; THE BASEMENT (3,-2), colours=(3,4,0) &41b0 18 20 08 86 07 00 07 0e 22 01 c2 68 60 78 80 20 ; 03 03 03 03 03 03 03 03 0f 03 03 03 ################LL###### &41c0 38 85 07 0e 21 01 c0 81 83 48 00 64 78 e0 10 c0 ; 00 00 00 00 00 00 07 03 0f 07 03 03 \\##LL\\#### &41d0 14 20 3c 45 82 07 0e 41 01 a0 81 83 50 00 44 78 ; 03 03 03 03 03 00 00 03 0f 00 07 03 ########## ##LL \\## &41e0 e0 30 1e 38 85 07 8e 03 ; 03 09 00 00 00 00 0b 03 0f 00 00 03 ##// //##LL ## ; 03 03 03 03 03 03 03 03 03 03 0f 03 ####################LL## ; 03 03 09 00 07 03 03 09 00 13 0f 03 ####// \\####// PPLL## ; 03 03 00 65 00 00 00 00 65 12 0f 03 #### 65 65PPLL## ; 03 03 05 00 0b 03 03 05 00 11 0f 03 ####\\ //####\\ PPLL## ; 03 03 03 0f 03 03 03 03 03 03 03 03 ######LL################ ; 03 03 03 0f 03 03 03 03 03 03 03 03 ######LL################ ; room &2b (room_x=10, room_y=10) &41e8 0a 0a 5c 0a 2b 20 0c 46 00 46 00 06 88 81 11 80 ; THE EAST TOWER (3,2), colours=(5,6,0) &41f8 11 80 01 62 60 04 60 04 60 80 28 1a 12 01 18 01 ; 00 00 00 00 03 10 03 10 03 00 00 00 ##||##||## &4208 1c 14 20 8c 86 04 40 00 46 00 00 07 05 08 a2 21 ; 00 00 00 00 03 10 03 10 03 00 00 00 ##||##||## &4218 01 42 60 80 10 1c 14 38 08 08 4e 01 80 01 4c 01 ; 00 00 00 00 03 10 03 10 03 00 00 00 ##||##||## &4228 82 e0 10 20 88 84 06 06 85 04 08 82 43 50 80 10 ; 00 00 00 0b 09 10 03 10 07 05 00 00 ////||##||\\\\ &4238 18 01 20 88 06 0e 03 81 43 04 e0 30 ; 00 00 0b 09 00 10 03 10 00 07 05 00 //// ||##|| \\\\ ; 00 0b 09 00 00 00 03 00 00 00 07 05 //// ## \\\\ ; 03 03 00 00 65 00 03 00 65 00 00 03 #### 65 ## 65 ## ; 03 03 00 00 09 0b 03 05 09 00 00 03 #### //##\\ ## ; 03 03 05 00 00 00 03 10 00 00 0b 03 ####\\ ##|| //## ; 03 03 03 01 03 03 03 10 03 03 03 03 ######~~######||######## ; room &2c (room_x=10, room_y=11) &4244 0a 0b 5b 0a 21 36 0c 80 8d 01 60 01 60 83 00 58 ; THE EAST TOWER (3,3), colours=(1,4,0) &4254 00 58 80 20 36 08 48 60 01 82 60 00 60 00 60 00 ; 0d 0d 0d 0d 00 0d 0d 0d 0d 0d 0d 0d ******** ************** &4264 60 00 60 00 60 00 e0 14 20 48 06 08 12 00 10 00 ; 00 0d 00 0d 0d 00 0d 00 0d 00 00 0d ** **** ** ** ** &4274 42 60 80 20 11 20 48 00 40 00 10 e7 00 06 00 07 ; 0d 00 00 00 00 00 00 00 00 00 0d 00 ** ** &4284 0e 42 11 00 10 a0 81 83 48 80 10 1c 18 01 18 01 ; 00 03 00 03 00 03 00 03 00 03 00 03 ## ## ## ## ## ## &4294 18 12 20 0a 46 00 46 00 06 08 01 ; 00 03 03 03 03 03 03 03 03 03 03 03 ###################### ; 00 00 13 00 00 10 00 10 00 00 00 03 PP || || ## ; 00 00 11 00 00 10 00 10 00 47 38 03 PP || || 47 ## ; 00 07 03 03 05 10 00 10 0b 03 03 09 \\####\\|| ||//####// ; 00 00 00 07 03 10 03 10 03 09 00 00 \\##||##||##// ; 00 00 00 00 03 10 03 10 03 00 00 00 ##||##||## ; room &2d (room_x=26, room_y=7) &429f 1a 07 51 d4 21 16 20 88 05 80 05 80 8d 00 60 01 ; THE ROYAL HOUSE (19,-1), colours=(1,4,3) &42af 82 58 00 58 00 58 00 d8 20 24 06 03 08 43 e2 30 ; 0d 00 00 0d 00 0d 00 0d 0d 0d 0d 0d ** ** ** ********** &42bf 80 24 02 04 0c 20 08 89 c2 00 40 00 30 30 41 a0 ; 00 0d 00 00 0d 00 0d 00 0d 00 0d 0d ** ** ** ** **** &42cf 00 c2 10 78 10 0c cc 20 20 0c 01 02 81 07 01 08 ; 04 04 04 04 04 04 04 06 00 00 00 00 @@@@@@@@@@@@@@\\ &42df d2 01 c2 90 20 00 1e 04 20 48 05 89 82 40 82 b8 ; 04 04 04 04 04 04 04 04 06 00 00 00 @@@@@@@@@@@@@@@@\\ &42ef 10 ; 00 00 00 00 00 00 00 08 04 06 00 00 \\@@\\ ; 04 04 04 04 04 04 06 00 04 00 18 19 @@@@@@@@@@@@\\ @@ TTTT ; 04 0a 00 00 00 00 04 0f 04 18 19 19 @@// @@LL@@TTTTTT ; 00 00 00 00 04 02 04 0f 04 00 00 17 @@~~@@LL@@ TT ; 00 00 00 00 04 04 00 0f 04 00 00 15 @@@@ LL@@ TT ; 04 04 04 04 04 04 02 04 04 0e 0e 0e @@@@@@@@@@@@~~@@@@====== ; room &2e (room_x=21, room_y=7) &42f0 15 07 20 51 00 b6 0e d8 33 b1 00 42 92 18 1d 20 ; THE RIVER (14,-1), colours=(0,0,2) &4300 0c e6 8b 52 01 42 68 60 a2 28 2e 0c 0e fa a3 00 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 19 1a 00 00 00 24 24 24 24 24 24 24 TTTT <><><><><><><> ; 17 00 00 00 00 03 3e 3e 3e 3e 3e 3e TT ##------------ ; 15 00 00 00 0b 03 22 22 22 22 22 22 TT //##wwwwwwwwwwww ; 0e 0e 0e 0e 03 03 3f 3f 3f 3f 3f 3f ========####WWWWWWWWWWWW ; room &2f (room_x=11, room_y=7) &4310 0b 07 45 4b 00 38 8c 8d 83 c3 d8 38 20 48 06 08 ; THE EAST WOOD (4,-1), colours=(0,0,2) &4320 12 00 e2 24 00 03 04 80 38 11 20 48 00 88 82 23 ; 03 03 03 03 0d 0d 0d 0d 0d 0d 0d 0d ########**************** &4330 04 07 00 0c 4c 2c 00 e0 20 12 20 48 40 c2 c0 0c ; 03 03 03 03 0d 0d 0d 0d 0d 0d 0d 0d ########**************** &4340 b1 00 42 51 80 08 1d 20 84 06 0e 41 01 42 54 80 ; 00 00 13 00 00 10 00 00 00 00 00 00 PP || &4350 20 38 8a 8b 02 ; 00 00 12 00 60 10 00 00 00 00 00 00 PP 60|| ; 00 00 11 00 00 10 00 00 00 00 00 00 PP || ; 03 03 03 03 03 10 70 00 18 19 1a 00 ##########||70 TTTTTT ; 03 03 09 00 00 10 12 18 19 19 19 1a ####// || TTTTTTTTTT ; 00 00 00 45 00 00 00 00 00 17 00 00 45 TT ; 00 0b 03 03 03 05 00 00 00 15 00 00 //######\\ TT ; 03 03 03 03 03 03 0e 0e 0e 0e 0e 0e ############============ ; room &30 (room_x=12, room_y=7) &4355 0c 07 2e 4b 20 b6 0e 68 32 30 b1 00 e2 0c cc 10 ; THE EAST WOOD (5,-1), colours=(1,0,2) &4365 0b 00 03 13 0b 20 42 03 08 32 30 43 2c 80 30 1d ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ &4375 20 4c 03 88 52 35 90 01 82 54 80 10 2e 0d ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 18 19 1a 00 00 00 00 00 00 00 TTTTTT ; 00 18 19 19 19 1a 00 18 19 1a 00 00 TTTTTTTTTT TTTTTT ; 00 00 00 16 00 00 18 19 19 19 1a 00 TT TTTTTTTTTT ; 00 00 00 17 00 00 00 00 16 00 00 00 TT TT ; 00 00 00 15 58 13 00 00 15 00 00 00 TT58 TT ; 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e ======================== ; room &31 (room_x=13, room_y=7) &4383 0d 07 32 4b 00 b6 0e 28 32 30 b1 00 e2 0c cc 10 ; THE EAST WOOD (6,-1), colours=(0,0,2) &4393 0b 20 c4 c0 c4 c2 c0 8c b0 00 30 30 43 2c 80 20 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ &43a3 0d 20 4a 07 08 d3 01 a2 54 00 05 14 00 54 80 30 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ &43b3 2e 0d ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 18 19 1a 00 00 00 TTTTTT ; 00 00 00 00 00 18 19 19 19 1a 00 00 TTTTTTTTTT ; 00 18 19 1a 18 19 19 19 19 19 1a 00 TTTTTTTTTTTTTTTTTTTT ; 18 19 19 19 1a 00 00 16 00 00 00 00 TTTTTTTTTT TT ; 00 00 17 00 00 00 00 17 00 00 00 00 TT TT ; 00 00 15 00 50 14 00 15 00 00 00 00 TT 50 TT ; 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e ======================== ; room &32 (room_x=14, room_y=7) &43b5 0e 07 2c 4b 00 b6 0e 68 32 30 b1 00 e2 0c cc 10 ; THE EAST WOOD (7,-1), colours=(0,0,2) &43c5 0b 03 13 0b 20 4a 07 c0 c0 0c b1 00 22 34 80 10 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ &43d5 1d 20 46 d5 40 06 40 05 08 e3 d2 00 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 18 19 1a 00 00 00 00 00 00 00 TTTTTT ; 00 18 19 19 19 1a 18 19 1a 00 00 00 TTTTTTTTTTTTTTTT ; 00 00 00 17 00 18 19 19 19 1a 00 00 TT TTTTTTTTTT ; 00 00 00 16 00 00 00 17 00 00 00 00 TT TT ; 00 00 00 15 58 13 00 15 00 00 00 00 TT58 TT ; 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e ======================== ; room &33 (room_x=15, room_y=7) &43e1 0f 07 3f 4e 00 b6 0e 88 43 c2 80 20 03 13 0b 20 ; THE BALCONY (8,-1), colours=(0,0,2) &43f1 44 06 08 33 30 43 2c 80 20 11 20 c4 c0 8c b0 00 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ &4401 40 c2 80 10 0d 20 42 86 00 01 08 d1 01 22 24 00 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ &4411 76 80 10 55 00 19 20 44 84 01 81 4b 40 42 00 ; 00 00 00 00 00 00 00 00 04 04 04 04 @@@@@@@@ ; 00 00 18 19 1a 00 00 00 13 00 00 00 TTTTTT PP ; 00 18 19 19 19 1a 00 00 11 00 00 00 TTTTTTTTTT PP ; 18 19 19 19 19 19 1a 00 04 04 04 04 TTTTTTTTTTTTTT @@@@@@@@ ; 00 00 00 16 00 00 00 00 00 13 08 04 TT PP\\@@ ; 00 00 00 17 00 00 00 00 00 12 00 37 TT PP 37 ; 00 00 00 15 40 13 00 00 00 11 0c 04 TT40 PP//@@ ; 0e 0e 0e 0e 0e 0e 0e 0e 0e 04 04 04 ==================@@@@@@ ; room &34 (room_x=16, room_y=7) &4420 10 07 31 4f 00 a4 8d 02 08 91 01 12 1c 00 24 80 ; THE CHURCH (9,-1), colours=(0,0,2) &4430 14 11 20 04 89 81 40 22 28 80 20 19 20 4a 06 08 ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ &4440 93 00 0c 00 82 14 00 24 90 10 0c 11 20 4a 04 49 ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ &4450 03 ; 04 04 04 04 0a 00 00 00 13 00 00 00 @@@@@@@@// PP ; 00 00 00 00 00 00 1c 00 12 00 00 00 %% PP ; 00 00 00 00 00 00 00 00 11 00 00 00 PP ; 04 04 04 04 04 04 04 02 04 04 04 04 @@@@@@@@@@@@@@~~@@@@@@@@ ; 04 0a 00 00 13 00 00 00 00 00 00 13 @@// PP PP ; 00 00 00 00 12 00 60 00 00 14 00 12 PP 60 () PP ; 04 04 04 06 11 00 00 00 00 00 00 11 @@@@@@\\PP PP ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; room &35 (room_x=17, room_y=7) &4451 11 07 46 af 00 24 8e 07 49 e1 41 42 64 80 30 19 ; THE CHURCH (10,-1), colours=(0,0,5) &4461 20 88 07 09 91 00 70 00 82 24 00 03 78 90 10 11 ; 04 04 04 04 04 04 04 04 0f 04 04 04 @@@@@@@@@@@@@@@@LL@@@@@@ &4471 20 4c 04 08 e2 41 72 64 80 30 19 20 4c 40 46 02 ; 04 04 04 04 04 04 04 04 0f 04 04 04 @@@@@@@@@@@@@@@@LL@@@@@@ &4481 08 93 00 50 00 82 04 24 44 80 60 14 06 11 20 4c ; 13 00 00 00 00 13 00 00 0f 04 04 04 PP PP LL@@@@@@ &4491 40 04 49 02 40 00 ; 12 00 1c 00 00 12 00 60 0f 04 04 04 PP %% PP 60LL@@@@@@ ; 11 00 00 00 00 11 00 00 0f 04 04 04 PP PP LL@@@@@@ ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; 13 00 00 00 00 13 00 00 00 00 10 13 PP PP ||PP ; 12 00 00 00 00 12 00 14 00 00 10 12 PP PP () ||PP ; 11 00 00 45 0c 11 00 00 00 00 10 11 PP 45 PP ||PP ; 04 04 04 04 04 04 04 04 04 04 00 04 @@@@@@@@@@@@@@@@@@@@ @@ ; room &36 (room_x=18, room_y=7) &4497 12 07 50 af 00 24 8c 07 49 a2 e0 21 40 62 00 04 ; THE CHURCH (11,-1), colours=(0,0,5) &44a7 00 78 00 04 08 90 08 00 01 00 1e 00 01 00 24 32 ; 04 04 04 04 0f 04 04 04 04 04 04 04 @@@@@@@@LL@@@@@@@@@@@@@@ &44b7 60 05 80 07 60 35 00 89 80 59 41 42 56 60 08 90 ; 04 04 04 0a 0f 08 04 04 04 04 04 04 @@@@@@//LL\\@@@@@@@@@@@@ &44c7 10 19 80 15 19 00 99 15 20 88 00 09 92 00 58 90 ; 04 00 10 00 0f 00 10 08 04 04 04 04 @@ || LL ||\\@@@@@@@@ &44d7 00 90 58 00 22 44 80 20 11 00 11 20 84 01 c9 02 ; 04 00 10 00 0f 00 10 00 04 04 04 04 @@ || LL || @@@@@@@@ ; 04 60 35 00 0f 00 35 60 04 04 04 04 @@60:: LL ::60@@@@@@@@ ; 04 03 35 04 04 04 35 03 08 04 04 04 @@ ::@@@@@@:: \\@@@@@@ ; 13 00 35 13 00 13 35 00 00 08 04 04 PP ::PP PP:: \\@@@@ ; 12 00 34 12 00 12 34 00 00 00 00 00 PP ::PP PP:: ; 11 00 00 11 00 11 00 00 00 0c 04 04 PP PP PP //@@@@ ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; room &37 (room_x=19, room_y=7) &44e7 13 07 4b 50 00 24 8c 8d 43 c2 d8 38 24 84 02 88 ; THE FOREST (12,-1), colours=(0,0,2) &44f7 43 82 28 00 0c 4c 2c 80 08 24 08 c0 c0 0c b1 00 ; 04 04 04 04 0d 0d 0d 0d 0d 0d 0d 0d @@@@@@@@**************** &4507 82 0c 4c 10 28 0c cc 08 0b 03 33 88 02 08 d3 01 ; 04 04 04 04 0d 0d 0d 0d 0d 0d 0d 0d @@@@@@@@**************** &4517 30 30 b1 00 d0 00 22 34 0c cc 10 0b 1d 24 04 03 ; 04 04 04 0a 00 00 00 00 00 00 00 00 @@@@@@// &4527 40 05 08 52 01 82 54 90 30 2e 0e ; 04 04 0a 00 18 19 1a 00 00 00 00 00 @@@@// TTTTTT ; 04 04 00 18 19 19 19 1a 00 00 18 19 @@@@ TTTTTTTTTT TTTT ; 04 0a 18 19 19 19 19 19 1a 18 19 19 @@//TTTTTTTTTTTTTTTTTTTT ; 0a 00 00 00 00 17 00 18 19 1a 00 16 // TT TTTTTT TT ; 00 00 00 00 00 16 18 19 19 19 1a 17 TTTTTTTTTTTTTT ; 04 04 04 06 00 15 00 00 15 00 00 15 @@@@@@\\ TT TT TT ; 04 04 04 04 0e 0e 0e 0e 0e 0e 0e 0e @@@@@@@@================ ; room &38 (room_x=20, room_y=7) &4532 14 07 42 50 00 b6 0e 88 30 30 b1 00 e2 0c cc 08 ; THE FOREST (13,-1), colours=(0,0,2) &4542 0b 00 0b 20 c8 c0 8c b1 30 b1 30 30 b1 00 d0 30 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ &4552 30 c3 00 0c cc 10 0b 1d 20 48 07 c0 00 08 d1 01 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ &4562 82 34 80 20 0d 20 42 d5 40 46 d5 40 46 05 08 e2 ; 00 00 00 00 00 18 19 1a 00 00 00 00 TTTTTT &4572 d2 00 ; 00 00 00 00 18 19 19 19 19 19 1a 00 TTTTTTTTTTTTTT ; 1a 00 00 18 19 19 19 19 19 19 19 1a TT TTTTTTTTTTTTTTTTTT ; 19 1a 18 19 1a 00 16 18 19 19 19 19 TTTTTTTTTT TTTTTTTTTTTT ; 00 18 19 19 19 1a 17 00 00 17 00 18 TTTTTTTTTTTT TT TT ; 00 00 00 17 00 00 16 00 00 16 00 00 TT TT TT ; 00 00 00 15 58 13 15 58 13 15 00 00 TT58 TT58 TT ; 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e ======================== ; room &39 (room_x=25, room_y=7) &4574 19 07 2e 54 22 b6 0e 88 61 40 c2 80 28 06 24 02 ; THE ROYAL HOUSE (18,-1), colours=(1,2,2) &4584 88 41 82 28 80 04 24 08 80 01 01 88 41 a0 00 40 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ &4594 82 80 b8 1b 20 04 89 c2 00 38 01 42 90 34 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ ; 00 00 00 00 00 00 00 0c 04 04 04 04 //@@@@@@@@ ; 00 00 00 00 00 00 0c 04 04 04 04 04 //@@@@@@@@@@ ; 00 00 00 00 00 00 00 04 04 0a 00 00 @@@@// ; 00 00 00 00 00 00 00 04 04 00 0c 04 @@@@ //@@ ; 00 00 00 00 00 00 00 04 0a 00 04 04 @@// @@@@ ; 00 00 00 00 00 00 00 00 3b 00 00 00 3b ; 04 04 04 04 04 04 06 00 39 00 00 00 @@@@@@@@@@@@\\ 39 ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; room &3a (room_x=16, room_y=8) &45a2 10 08 4a af 04 24 8b 42 46 00 08 92 01 42 64 90 ; THE CHURCH (9,0), colours=(0,1,5) &45b2 20 00 11 01 20 48 04 08 11 41 c2 04 18 90 20 20 ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ &45c2 04 09 92 11 42 90 10 3b 04 09 92 10 82 00 90 38 ; 04 04 0a 13 10 00 00 13 00 00 00 13 @@@@//PP|| PP PP &45d2 09 01 20 08 81 02 08 93 41 90 10 00 82 64 80 08 ; 04 04 00 11 10 00 00 11 00 00 00 11 @@@@ PP|| PP PP &45e2 11 04 11 20 44 04 80 01 c9 03 ; 04 04 04 04 10 0c 04 04 00 00 00 04 @@@@@@@@||//@@@@ @@ ; 04 13 10 10 10 04 04 04 1b 1b 1b 04 @@PP||||||@@@@@@^^^^^^@@ ; 04 12 10 10 00 04 04 04 04 04 04 04 @@PP|||| @@@@@@@@@@@@@@ ; 04 12 10 00 00 04 0a 00 00 00 00 13 @@PP|| @@// PP ; 04 12 10 00 00 13 00 00 00 00 00 11 @@PP|| PP PP ; 04 11 00 00 00 11 00 0c 04 04 04 04 @@PP PP //@@@@@@@@ ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; room &3b (room_x=17, room_y=8) &45ec 11 08 3d af 00 24 4d 06 08 21 40 62 44 80 30 19 ; THE CHURCH (10,0), colours=(0,0,5) &45fc 20 42 06 01 03 08 11 01 22 44 90 0c 0a 20 48 06 ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ &460c 88 92 83 80 10 09 20 c8 01 08 91 10 01 42 24 80 ; 13 00 00 00 08 04 04 04 04 04 04 04 PP \\@@@@@@@@@@@@@@ &461c 28 09 24 04 43 04 88 12 41 e2 78 90 10 ; 11 00 00 00 00 13 00 00 00 00 00 13 PP PP PP ; 04 06 00 00 00 11 00 00 00 00 00 11 @@\\ PP PP ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; 04 0a 00 00 13 00 00 00 00 00 00 13 @@// PP PP ; 13 00 00 00 12 00 00 1c 00 00 00 12 PP PP %% PP ; 11 00 00 00 12 00 00 00 00 00 00 12 PP PP PP ; 04 04 04 06 11 00 00 00 00 00 00 11 @@@@@@\\PP PP ; 04 04 04 04 04 04 04 04 0f 04 04 04 @@@@@@@@@@@@@@@@LL@@@@@@ ; room &3c (room_x=18, room_y=8) &4629 12 08 4f af 00 a4 84 42 00 60 05 41 06 88 90 01 ; THE CHURCH (11,0), colours=(0,0,5) &4639 58 01 58 41 10 01 22 44 00 16 00 56 90 38 0c 20 ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ &4649 68 05 41 06 08 22 40 c2 80 a0 15 04 09 00 05 00 ; 04 04 04 04 04 04 04 0a 10 00 35 04 @@@@@@@@@@@@@@//|| ::@@ &4659 02 24 04 08 5a 40 90 00 c2 08 90 20 20 04 41 04 ; 13 00 00 00 00 00 13 00 35 00 35 04 PP PP :: ::@@ &4669 08 63 40 82 00 ec 20 24 82 07 09 81 40 42 00 ; 11 00 00 00 00 00 11 00 34 00 35 04 PP PP :: ::@@ ; 04 04 04 04 04 04 04 06 00 00 35 04 @@@@@@@@@@@@@@\\ ::@@ ; 13 00 00 08 04 04 04 04 00 00 35 04 PP \\@@@@@@@@ ::@@ ; 12 00 14 00 08 04 04 04 00 00 34 04 PP () \\@@@@@@ ::@@ ; 12 00 00 00 00 08 04 04 00 00 00 04 PP \\@@@@ @@ ; 11 00 00 00 00 0c 04 04 00 1b 1b 04 PP //@@@@ ^^^^@@ ; 04 04 04 04 0f 04 04 04 02 04 04 04 @@@@@@@@LL@@@@@@~~@@@@@@ ; room &3d (room_x=17, room_y=6) &4678 11 06 49 35 08 38 09 00 0e 52 00 82 70 60 80 08 ; THE CELLAR (10,-2), colours=(4,0,4) &4688 38 48 09 02 c2 68 e0 08 25 84 06 06 00 86 04 00 ; 03 03 03 03 03 03 03 03 03 03 00 03 #################### ## &4698 07 8e 02 82 60 0c 4c 2c e0 20 12 20 08 07 06 08 ; 03 14 00 00 07 03 00 00 00 00 00 03 ##() \\## ## &46a8 51 01 c0 83 80 28 18 2e 0c 05 08 83 01 80 a3 a2 ; 03 14 14 00 00 00 00 0b 03 03 03 03 ##()() //######## &46b8 30 18 20 4c 00 4e 01 80 01 ; 03 14 14 14 0b 03 00 03 09 00 07 03 ##()()()//## ##// \\## ; 03 03 03 03 03 00 00 03 18 19 1a 03 ########## ##TTTTTT## ; 03 09 00 00 07 03 00 00 00 15 00 07 ##// \\## TT \\ ; 07 00 00 00 00 00 00 03 0e 0e 0e 0e \\ ##======== ; 05 00 00 00 00 03 00 03 03 03 03 03 \\ ## ########## ; 03 22 22 22 22 03 00 00 00 00 10 03 ##wwwwwwww## ||## ; 03 03 03 03 03 03 03 03 03 03 00 03 #################### ## ; room &3e (room_x=17, room_y=5) &46c1 11 05 57 8d 0e 24 09 00 09 12 40 00 e2 90 20 01 ; THE DUNGEONS (10,-3), colours=(4,3,1) &46d1 04 0c 20 84 01 01 00 09 11 40 42 00 90 10 00 02 ; 04 04 04 04 04 04 04 04 04 04 00 04 @@@@@@@@@@@@@@@@@@@@ @@ &46e1 24 48 00 88 42 c0 00 40 82 04 18 90 18 00 24 48 ; 04 10 04 00 00 00 00 00 00 00 00 04 @@||@@ @@ &46f1 00 09 a2 00 a2 90 20 00 24 08 80 01 09 c1 00 40 ; 04 10 04 06 00 00 00 0c 04 00 04 04 @@||@@\\ //@@ @@@@ &4701 82 80 20 04 00 04 0a 01 02 04 00 24 04 00 01 00 ; 04 10 04 04 04 00 04 04 04 00 08 04 @@||@@@@@@ @@@@@@ \\@@ &4711 01 40 00 00 01 00 01 ; 04 10 00 00 00 00 00 00 04 06 00 04 @@|| @@\\ @@ ; 04 10 0c 04 04 04 04 04 04 04 00 04 @@||//@@@@@@@@@@@@@@ @@ ; 04 10 04 04 0a 00 00 00 00 00 00 04 @@||@@@@// @@ ; 04 00 04 04 00 0c 04 04 04 06 00 04 @@ @@@@ //@@@@@@\\ @@ ; 04 00 00 04 00 04 0a 10 08 04 00 04 @@ @@ @@//||\\@@ @@ ; 04 04 00 04 00 04 00 10 00 04 00 04 @@@@ @@ @@ || @@ @@ ; room &3f (room_x=17, room_y=4) &4718 11 04 5c 8d 0c 24 08 00 01 00 01 40 00 00 01 00 ; THE DUNGEONS (10,-4), colours=(4,1,1) &4728 09 b1 41 00 40 00 10 00 40 00 40 c2 28 00 90 20 ; 04 04 00 04 00 04 00 10 00 04 00 04 @@@@ @@ @@ || @@ @@ &4738 01 00 0a 00 24 84 02 08 42 a0 10 00 b0 83 90 20 ; 04 04 1b 04 00 04 00 10 00 04 00 04 @@@@^^@@ @@ || @@ @@ &4748 0a 20 44 06 60 05 00 09 03 c2 24 00 56 00 90 30 ; 04 04 04 0a 00 04 04 10 00 0a 00 04 @@@@@@// @@@@|| // @@ &4758 20 4c 04 60 01 80 00 09 01 c2 10 80 30 01 24 08 ; 04 04 0a 00 00 04 0a 10 00 1b 1b 04 @@@@// @@//|| ^^^^@@ &4768 03 08 62 40 c0 00 42 04 90 14 01 04 ; 04 0a 00 00 00 13 00 35 00 04 04 04 @@// PP :: @@@@@@ ; 04 00 00 00 00 12 00 35 00 04 04 04 @@ PP :: @@@@@@ ; 04 00 00 00 00 11 00 34 00 08 04 04 @@ PP :: \\@@@@ ; 04 00 00 00 00 04 00 00 00 00 10 04 @@ @@ ||@@ ; 04 06 00 00 0c 04 06 00 00 00 10 04 @@\\ //@@\\ ||@@ ; 04 04 04 04 04 04 04 04 04 04 10 04 @@@@@@@@@@@@@@@@@@@@||@@ ; room &40 (room_x=17, room_y=3) &4774 11 03 54 8d 0e 24 49 00 09 a2 10 00 42 16 80 30 ; THE DUNGEONS (10,-5), colours=(4,3,1) &4784 24 08 40 00 88 61 40 82 00 04 10 ec 08 24 0c 40 ; 04 04 04 04 04 04 04 04 04 04 10 04 @@@@@@@@@@@@@@@@@@@@||@@ &4794 80 00 89 a1 40 00 10 00 90 01 c2 10 28 18 10 00 ; 04 0a 10 00 00 00 34 00 00 00 00 04 @@//|| :: @@ &47a4 04 00 24 80 20 05 00 04 00 24 08 40 00 40 02 08 ; 04 00 10 00 00 00 00 00 00 00 0c 04 @@ || //@@ &47b4 43 00 40 82 30 80 20 51 0c 09 20 08 01 00 49 e0 ; 04 00 10 04 1b 1b 1b 1b 1b 04 04 04 @@ ||@@^^^^^^^^^^@@@@@@ &47c4 41 00 40 00 ; 04 00 10 08 04 04 04 04 04 04 04 0a @@ ||\\@@@@@@@@@@@@@@// ; 04 00 10 00 13 00 00 00 00 04 0a 0c @@ || PP @@//// ; 04 00 10 00 12 00 00 14 00 04 00 04 @@ || PP () @@ @@ ; 04 00 10 00 12 00 00 00 00 04 00 04 @@ || PP @@ @@ ; 04 06 00 00 11 46 12 00 00 04 00 04 @@\\ PP46 @@ @@ ; 04 04 04 04 04 04 04 04 0f 04 00 04 @@@@@@@@@@@@@@@@LL@@ @@ ; room &41 (room_x=17, room_y=2) &47c8 11 02 57 8d 0e 24 8e 07 01 00 09 12 00 82 56 80 ; THE DUNGEONS (10,-6), colours=(4,3,1) &47d8 10 1e 04 00 24 48 00 08 5a 00 42 78 10 00 90 20 ; 04 04 04 04 04 04 04 04 0f 04 00 04 @@@@@@@@@@@@@@@@LL@@ @@ &47e8 01 20 8a 07 01 00 09 5a 01 70 00 70 00 70 e0 41 ; 04 10 00 00 35 00 00 00 0f 04 00 04 @@|| :: LL@@ @@ &47f8 00 40 82 56 80 28 02 04 00 24 68 01 88 41 00 40 ; 04 10 00 00 34 00 00 00 0f 04 00 04 @@|| :: LL@@ @@ &4808 82 80 20 06 04 0c 20 04 01 00 09 82 40 a2 78 10 ; 04 10 00 00 00 00 00 00 0f 04 00 04 @@|| LL@@ @@ &4818 00 90 04 1e 04 00 04 ; 04 35 00 1c 00 1c 00 1c 0f 04 00 04 @@:: %% %% %%LL@@ @@ ; 04 35 00 00 00 00 00 00 08 04 00 04 @@:: \\@@ @@ ; 04 34 00 00 00 00 00 00 00 04 00 04 @@:: @@ @@ ; 04 00 00 0c 04 06 00 00 00 04 00 04 @@ //@@\\ @@ @@ ; 04 02 04 04 04 04 04 04 0f 04 00 04 @@~~@@@@@@@@@@@@LL@@ @@ ; 04 04 04 04 04 04 04 04 0f 04 00 04 @@@@@@@@@@@@@@@@LL@@ @@ ; room &42 (room_x=17, room_y=1) &481f 11 01 47 8d 0e 24 8e 07 01 00 41 06 88 90 01 e0 ; THE DUNGEONS (10,-7), colours=(4,3,1) &482f 41 00 40 90 00 22 44 00 78 10 00 10 44 80 30 1a ; 04 04 04 04 04 04 04 04 0f 04 00 04 @@@@@@@@@@@@@@@@LL@@ @@ &483f 18 00 1e 18 00 38 0e 80 07 06 00 06 88 c0 81 01 ; 13 00 00 00 00 00 13 00 0f 04 00 04 PP PP LL@@ @@ &484f 80 83 00 60 a2 28 18 00 38 28 02 e6 8f 82 01 81 ; 12 00 00 00 00 00 11 00 0f 04 00 04 PP PP LL@@ @@ &485f 83 7e 60 fe 34 38 0d ; 11 00 00 00 00 0b 03 00 0f 03 00 03 PP //## LL## ## ; 03 03 03 03 03 03 03 00 0f 03 00 03 ############## LL## ## ; 00 00 00 00 00 07 03 00 03 03 00 03 \\## #### ## ; 22 22 22 22 22 22 03 00 03 03 22 03 wwwwwwwwwwww## ####ww## ; 3f 3f 3f 3f 3f 3f 03 01 03 03 3f 03 WWWWWWWWWWWW##~~####WW## ; 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f WWWWWWWWWWWWWWWWWWWWWWWW ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &43 (room_x=16, room_y=1) &4866 10 01 29 4d 0a a4 80 02 88 90 83 80 24 29 08 48 ; THE DUNGEONS (9,-7), colours=(4,2,2) &4876 12 91 00 c2 35 00 68 e0 30 11 20 88 06 8e 20 01 ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ &4886 82 e0 88 28 e6 af 83 d3 00 ; 04 04 04 04 04 0a 00 00 00 00 00 13 @@@@@@@@@@// PP ; 13 00 00 00 00 00 00 00 00 00 00 12 PP PP ; 12 00 00 00 00 00 00 00 00 00 00 11 PP PP ; 12 00 00 00 00 56 00 0b 03 03 03 03 PP 56 //######## ; 11 00 00 0b 03 03 03 03 03 09 00 00 PP //##########// ; 03 03 03 03 03 22 22 22 22 22 22 22 ##########wwwwwwwwwwwwww ; 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f WWWWWWWWWWWWWWWWWWWWWWWW ; 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f WWWWWWWWWWWWWWWWWWWWWWWW ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &44 (room_x=15, room_y=1) &488f 0f 01 50 8d 0e 24 8e 07 09 91 11 20 40 c2 28 78 ; THE DUNGEONS (8,-7), colours=(4,3,1) &489f 08 90 20 09 01 20 8a 07 08 92 11 11 00 80 41 01 ; 04 04 04 04 04 04 04 04 0f 04 04 04 @@@@@@@@@@@@@@@@LL@@@@@@ &48af 42 78 80 20 09 18 01 00 38 0a 05 40 02 46 00 40 ; 13 10 08 04 04 04 04 0a 0f 08 04 04 PP||\\@@@@@@@@//LL\\@@@@ &48bf 06 08 c3 81 41 11 81 11 00 90 00 82 68 a2 20 38 ; 12 10 00 00 00 00 00 00 0f 00 00 13 PP|| LL PP &48cf 0c 08 92 00 82 60 fe 08 98 28 02 e6 8f 80 d3 00 ; 11 10 00 03 05 00 00 00 0f 00 00 12 PP|| ##\\ LL PP ; 03 10 00 03 03 03 03 03 03 05 00 12 ##|| ############\\ PP ; 03 10 00 13 00 00 00 00 07 03 05 11 ##|| PP \\##\\PP ; 03 10 00 12 00 00 0b 22 22 03 03 03 ##|| PP //wwww###### ; 03 00 00 12 00 00 03 3f 3f 3f 3f 3f ## PP ##WWWWWWWWWW ; 03 22 22 22 22 22 03 3f 3f 3f 3f 3f ##wwwwwwwwww##WWWWWWWWWW ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &45 (room_x=14, room_y=1) &48df 0e 01 36 92 0e 24 4d 06 60 01 60 05 60 01 60 05 ; THE CAVES (7,-7), colours=(4,3,1) &48ef 60 41 46 02 08 59 00 42 16 80 20 09 11 20 49 04 ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ &48ff 09 b2 01 a2 6c 90 08 1b 20 cc 06 89 b1 01 82 6c ; 13 00 34 00 35 00 34 00 35 00 34 13 PP :: :: :: :: ::PP &490f 90 04 3b 08 e9 00 ; 12 00 00 00 34 00 00 00 34 00 00 12 PP :: :: PP ; 11 00 00 00 00 00 00 00 00 00 00 11 PP PP ; 04 04 1b 00 00 00 00 00 00 1b 04 04 @@@@^^ ^^@@@@ ; 04 04 04 1b 00 00 00 00 1b 04 04 04 @@@@@@^^ ^^@@@@@@ ; 04 04 04 04 1b 00 00 1b 04 04 04 04 @@@@@@@@^^ ^^@@@@@@@@ ; 04 04 04 04 04 1b 1b 04 04 04 04 04 @@@@@@@@@@^^^^@@@@@@@@@@ ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; room &46 (room_x=10, room_y=5) &4915 0a 05 4e 8d 0c 24 84 07 49 58 01 e0 41 00 42 10 ; THE DUNGEONS (3,-3), colours=(4,1,1) &4925 80 20 24 68 85 00 81 02 00 01 00 01 30 00 09 5a ; 04 04 04 0f 04 04 04 04 04 04 04 04 @@@@@@LL@@@@@@@@@@@@@@@@ &4935 00 c2 10 00 08 30 00 90 20 00 06 04 0c 00 04 0c ; 04 35 00 0f 04 00 00 00 04 00 00 04 @@:: LL@@ @@ @@ &4945 00 02 24 09 03 08 42 82 28 80 04 24 08 08 52 00 ; 04 35 08 04 0a 00 04 00 04 00 60 04 @@::\\@@// @@ @@ 60@@ &4955 60 40 62 80 70 04 07 20 0c 49 e2 41 82 00 ; 04 34 00 00 00 00 04 00 08 06 00 04 @@:: @@ \\\\ @@ ; 04 00 0c 04 06 00 04 06 00 08 04 04 @@ //@@\\ @@\\ \\@@@@ ; 04 04 04 04 04 04 04 04 06 00 00 04 @@@@@@@@@@@@@@@@\\ @@ ; 04 0a 00 00 00 00 00 00 00 00 00 04 @@// @@ ; 04 00 00 14 00 0c 04 04 04 04 04 04 @@ () //@@@@@@@@@@@@ ; 04 00 00 00 00 44 1c 00 00 00 00 04 @@ 44 @@ ; 04 04 04 04 04 04 04 04 04 0f 04 04 @@@@@@@@@@@@@@@@@@LL@@@@ ; room &47 (room_x=10, room_y=4) &4963 0a 04 55 8d 0e 24 81 07 09 01 c2 51 20 80 20 1e ; THE DUNGEONS (3,-4), colours=(4,3,1) &4973 24 8c 07 01 08 46 21 01 40 c2 00 78 10 80 50 14 ; 04 04 04 04 04 04 04 04 04 0f 04 04 @@@@@@@@@@@@@@@@@@LL@@@@ &4983 01 00 1b 24 08 80 07 01 08 42 00 82 90 30 00 1e ; 04 00 00 00 00 45 02 00 00 0f 04 04 @@ 45 LL@@@@ &4993 04 3b 08 01 08 43 82 00 78 90 28 20 08 09 02 40 ; 04 04 0f 04 00 00 45 09 00 04 04 04 @@@@LL@@ 45 @@@@@@ &49a3 42 80 08 24 04 08 41 b0 01 b0 83 80 20 24 8c 07 ; 04 00 0f 04 00 00 00 45 10 00 1b 04 @@ LL@@ 45 ^^@@ &49b3 09 82 40 22 00 ; 04 00 0f 04 00 00 04 00 00 04 04 04 @@ LL@@ @@ @@@@@@ ; 04 00 0f 04 1b 1b 04 00 00 00 00 04 @@ LL@@^^^^@@ @@ ; 04 00 0f 04 04 04 04 04 04 00 00 04 @@ LL@@@@@@@@@@@@ @@ ; 04 00 04 04 04 00 00 00 00 00 04 04 @@ @@@@@@ @@@@ ; 04 00 00 00 04 1b 00 1b 1b 00 00 04 @@ @@^^ ^^^^ @@ ; 04 04 04 0f 04 04 02 04 04 04 04 04 @@@@@@LL@@@@~~@@@@@@@@@@ ; room &48 (room_x=10, room_y=3) &49b8 0a 03 46 8d 0e 24 84 07 49 c0 00 e0 01 a2 10 00 ; THE DUNGEONS (3,-5), colours=(4,3,1) &49c8 90 38 00 06 04 00 04 0a 20 62 05 08 42 00 40 00 ; 04 04 04 0f 04 04 04 04 04 04 04 04 @@@@@@LL@@@@@@@@@@@@@@@@ &49d8 42 31 80 a0 05 20 08 01 00 89 c2 00 60 40 82 00 ; 04 06 00 0f 00 00 00 00 00 00 04 00 @@\\ LL @@ &49e8 10 56 80 50 04 19 20 04 01 00 61 81 00 49 02 62 ; 04 04 04 04 04 04 04 04 00 0c 04 00 @@@@@@@@@@@@@@@@ //@@ &49f8 51 46 80 20 24 0d ; 04 0a 00 00 00 00 00 35 00 00 04 00 @@// :: @@ ; 04 00 00 00 46 00 00 34 00 00 04 00 @@ 46 :: @@ ; 04 04 04 04 04 04 06 00 0c 04 04 00 @@@@@@@@@@@@\\ //@@@@ ; 04 35 00 00 00 44 13 00 00 00 04 00 @@:: 44 @@ ; 04 34 08 04 04 04 04 04 04 04 04 04 @@::\\@@@@@@@@@@@@@@@@@@ ; 04 00 00 00 00 00 00 00 45 31 00 00 @@ 45 ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; room &49 (room_x=11, room_y=3) &49fe 0b 03 58 8d 0e 24 8a 82 01 09 03 58 01 82 08 28 ; THE DUNGEONS (4,-5), colours=(4,3,1) &4a0e 18 10 28 80 20 04 80 15 20 0c 81 02 08 41 00 58 ; 04 04 04 04 04 04 0a 0c 04 04 04 04 @@@@@@@@@@@@////@@@@@@@@ &4a1e 61 88 42 10 80 10 06 04 80 15 02 24 84 02 80 00 ; 00 35 00 00 08 0a 0c 04 0a 00 00 04 :: \\////@@// @@ &4a2e 82 02 01 60 01 40 06 88 58 01 40 00 42 44 80 10 ; 00 35 00 00 00 00 04 0a 00 00 00 04 :: @@// @@ &4a3e 04 80 05 00 24 82 02 80 81 02 08 41 00 a2 10 80 ; 00 35 0c 22 22 22 04 00 00 00 0c 04 :://wwwwww@@ //@@ &4a4e 20 3b 08 49 e0 41 42 00 ; 00 35 08 04 04 04 0a 00 08 02 0a 04 ::\\@@@@@@// \\~~//@@ ; 00 34 00 13 00 00 00 00 00 35 00 04 :: PP :: @@ ; 00 00 00 11 00 00 00 04 00 34 00 04 PP @@ :: @@ ; 04 04 04 04 0a 00 0c 0a 00 00 00 04 @@@@@@@@// //// @@ ; 00 00 00 00 00 00 04 00 00 1b 1b 04 @@ ^^^^@@ ; 04 04 04 04 04 04 04 04 0f 04 04 04 @@@@@@@@@@@@@@@@LL@@@@@@ ; room &4a (room_x=11, room_y=2) &4a56 0b 02 4e 8d 0e 24 8e 07 09 a3 58 01 22 78 08 90 ; THE DUNGEONS (4,-6), colours=(4,3,1) &4a66 10 80 15 20 82 07 00 81 02 01 60 05 30 00 08 e1 ; 04 04 04 04 04 04 04 04 0f 04 04 04 @@@@@@@@@@@@@@@@LL@@@@@@ &4a76 01 40 00 40 00 58 00 a0 20 40 c2 28 00 08 80 28 ; 04 0a 35 00 00 00 00 00 0f 08 04 04 @@//:: LL\\@@@@ &4a86 19 02 0a 20 08 03 88 92 00 42 18 10 a2 30 04 00 ; 04 00 35 00 00 00 00 00 0f 00 04 0a @@ :: LL @@// &4a96 09 20 88 01 09 fa c3 10 30 44 00 18 90 2c ; 04 00 35 00 60 00 00 00 0f 00 04 00 @@ :: 60 LL @@ ; 04 00 34 00 0a 08 04 04 04 04 0a 00 @@ :: \\@@@@@@@@// ; 08 00 00 00 00 00 00 13 08 0a 00 00 \\ PP\\// ; 06 00 00 00 00 00 00 12 00 00 00 0c \\ PP // ; 04 22 22 22 22 04 00 12 00 00 0c 04 @@wwwwwwww@@ PP //@@ ; 04 3f 3f 3f 3f 04 06 11 00 0c 04 04 @@WWWWWWWW@@\\PP //@@@@ ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; room &4b (room_x=12, room_y=2) &4aa4 0c 02 4f 4d 0e 24 01 03 80 01 09 a2 00 c2 90 10 ; THE DUNGEONS (5,-6), colours=(4,3,2) &4ab4 00 04 20 84 01 01 08 41 82 00 10 80 10 24 04 08 ; 04 04 04 04 04 04 04 04 04 06 00 0c @@@@@@@@@@@@@@@@@@\\ // &4ac4 41 80 40 00 42 90 30 20 04 09 02 82 18 90 08 20 ; 04 04 0a 00 00 00 00 04 04 04 00 04 @@@@// @@@@@@ @@ &4ad4 04 01 03 08 91 21 40 42 80 10 24 08 03 40 02 80 ; 00 00 00 0c 04 00 00 00 04 04 00 04 //@@ @@@@ @@ &4ae4 00 09 01 82 90 10 0c 11 20 08 09 03 40 d2 00 ; 00 00 00 04 04 04 00 00 00 04 02 04 @@@@@@ @@~~@@ ; 00 00 00 04 04 04 04 00 00 00 04 04 @@@@@@@@ @@@@ ; 00 00 0c 04 04 04 04 04 00 00 00 04 //@@@@@@@@@@ @@ ; 06 00 00 00 13 08 04 04 04 00 00 00 \\ PP\\@@@@@@ ; 04 04 06 00 12 00 08 04 04 04 00 00 @@@@\\ PP \\@@@@@@ ; 04 04 04 06 11 00 00 04 04 04 04 00 @@@@@@\\PP @@@@@@@@ ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; room &4c (room_x=13, room_y=2) &4af3 0d 02 3c 8d 0e 24 8f 02 60 05 80 00 89 12 00 82 ; THE DUNGEONS (6,-6), colours=(4,3,1) &4b03 56 80 20 01 24 42 00 08 5a 00 82 04 08 90 10 8a ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ &4b13 15 20 62 05 00 09 a2 00 58 01 82 11 48 00 56 00 ; 04 04 04 04 0a 00 35 00 08 04 04 04 @@@@@@@@// :: \\@@@@@@ &4b23 10 80 90 05 20 62 01 c8 b1 93 90 0c ; 04 04 04 10 00 00 35 00 00 10 04 04 @@@@@@|| :: ||@@@@ ; 04 04 04 10 00 00 34 00 00 10 08 04 @@@@@@|| :: ||\\@@ ; 04 04 0a 35 00 00 00 00 00 35 00 04 @@@@//:: :: @@ ; 04 0a 00 35 00 00 44 09 00 35 00 04 @@// :: 44 :: @@ ; 00 00 00 34 00 00 00 00 00 34 00 00 :: :: ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 1b 1b 1b 1b 1b 1b 1b 1b 1b 1b 04 ^^^^^^^^^^^^^^^^^^^^@@ ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; room &4d (room_x=14, room_y=2) &4b2f 0e 02 41 cd 09 24 03 48 92 41 00 82 35 00 35 00 ; THE DUNGEONS (7,-6), colours=(4,4,3) &4b3f 6c 00 6c 00 44 10 00 90 28 08 24 0c 08 5a 00 58 ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ &4b4f 00 58 00 58 00 40 42 00 35 00 35 00 35 00 35 00 ; 04 00 00 00 00 00 00 00 00 00 00 13 @@ PP &4b5f 10 00 10 9c 38 00 04 20 c8 89 03 40 82 80 24 24 ; 04 00 00 56 00 56 00 1b 00 1b 00 11 @@ 56 56 ^^ ^^ PP &4b6f 03 ; 04 00 04 04 04 04 04 04 02 04 04 04 @@ @@@@@@@@@@@@~~@@@@@@ ; 04 00 00 34 00 34 00 34 00 34 00 04 @@ :: :: :: :: @@ ; 04 04 00 56 00 56 00 56 00 56 00 04 @@@@ 56 56 56 56 @@ ; 00 04 1c 1c 1c 1c 1c 1c 1c 1c 00 04 @@%%%%%%%%%%%%%%%% @@ ; 00 00 1c 1c 1c 1c 1c 1c 1c 1c 00 04 %%%%%%%%%%%%%%%% @@ ; 04 00 00 00 00 00 00 00 00 00 00 04 @@ @@ ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ ; room &4e (room_x=15, room_y=2) &4b70 0f 02 50 8d 08 24 4d 06 00 81 02 88 22 40 10 01 ; THE DUNGEONS (8,-6), colours=(4,0,1) &4b80 40 00 42 18 28 80 10 24 08 80 00 01 02 81 02 80 ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ &4b90 01 09 c3 00 20 40 a0 00 60 40 a2 30 80 30 84 15 ; 13 00 04 0a 00 00 00 00 00 00 08 04 PP @@// \\@@ &4ba0 02 24 02 03 80 00 09 5a 01 82 90 08 0c 20 64 05 ; 11 00 04 00 00 00 0c 0a 00 00 00 04 PP @@ //// @@ &4bb0 08 42 82 80 50 05 09 00 9b 05 06 24 89 07 09 01 ; 04 00 08 04 02 04 0a 00 0c 04 04 04 @@ \\@@~~@@// //@@@@@@ ; 04 06 00 08 04 0a 00 0c 04 04 04 04 @@\\ \\@@// //@@@@@@@@ ; 04 04 06 00 00 00 00 04 35 08 04 04 @@@@\\ @@::\\@@@@ ; 04 04 04 06 00 08 04 04 35 00 00 04 @@@@@@\\ \\@@@@:: @@ ; 04 04 04 04 06 00 00 00 35 00 00 04 @@@@@@@@\\ :: @@ ; 04 00 00 00 54 12 00 1b 34 0c 04 04 @@ 54 ^^:://@@@@ ; 04 04 04 04 04 04 04 04 0f 04 04 04 @@@@@@@@@@@@@@@@LL@@@@@@ ; room &4f (room_x=13, room_y=1) &4bc0 0d 01 57 d2 0e 24 03 88 92 11 00 82 64 10 30 80 ; THE CAVES (6,-7), colours=(4,3,3) &4bd0 20 05 20 48 42 c0 01 40 02 09 c1 00 42 24 04 80 ; 04 04 04 04 04 04 04 04 04 04 04 04 @@@@@@@@@@@@@@@@@@@@@@@@ &4be0 20 11 24 02 03 40 42 00 08 42 82 28 00 08 90 20 ; 04 00 00 00 00 00 00 13 10 00 00 13 @@ PP|| PP &4bf0 0c 11 01 00 06 24 08 08 99 41 42 04 18 90 90 19 ; 04 06 00 00 14 00 00 12 10 1c 00 12 @@\\ () PP||%% PP &4c00 24 68 06 09 11 40 c2 66 10 e6 30 04 01 24 6c 06 ; 04 04 04 06 00 00 00 12 10 00 00 11 @@@@@@\\ PP|| PP &4c10 61 06 09 13 40 42 00 ; 04 04 04 04 04 06 00 12 10 00 00 04 @@@@@@@@@@\\ PP|| @@ ; 04 0a 00 08 04 04 06 11 10 00 0c 04 @@// \\@@@@\\PP|| //@@ ; 04 00 00 00 33 04 04 04 10 0c 04 04 @@ ..@@@@@@||//@@@@ ; 04 33 04 04 33 04 04 04 10 04 04 04 @@..@@@@..@@@@@@||@@@@@@ ; 04 33 04 33 33 33 33 04 10 04 04 04 @@..@@........@@||@@@@@@ ; 04 33 04 33 04 04 04 04 10 04 04 04 @@..@@..@@@@@@@@||@@@@@@ ; room &50 (room_x=13, room_y=0) &4c17 0d 00 54 d2 0c 84 19 84 19 24 4c 00 09 9b 43 90 ; THE CAVES (6,-8), colours=(4,1,3) &4c27 a0 39 48 00 80 00 09 9a a3 10 04 80 20 24 68 06 ; 04 33 04 33 04 04 04 04 10 04 04 04 @@..@@..@@@@@@@@||@@@@@@ &4c37 09 9b 41 00 82 18 90 a0 39 04 61 06 09 9b 41 82 ; 04 33 33 33 04 04 33 33 10 00 08 04 @@......@@@@....|| \\@@ &4c47 66 10 e6 08 24 68 06 09 9a 41 22 e6 30 24 68 06 ; 04 33 33 33 33 33 33 04 10 00 00 04 @@............@@|| @@ &4c57 61 0e a2 00 20 40 98 41 42 e6 10 04 20 64 0e 41 ; 04 33 04 04 04 04 33 04 00 00 0c 04 @@..@@@@@@@@..@@ //@@ &4c67 62 20 90 08 ; 04 33 33 33 04 33 04 04 04 04 33 04 @@......@@..@@@@@@@@..@@ ; 04 33 04 33 33 33 33 33 04 04 33 04 @@..@@..........@@@@..@@ ; 04 33 04 04 04 04 04 33 33 33 33 04 @@..@@@@@@@@@@........@@ ; 04 33 04 33 33 0a 00 08 04 33 04 04 @@..@@....// \\@@..@@@@ ; 04 33 33 33 04 00 00 00 33 33 33 04 @@......@@ ......@@ ; 04 04 04 04 04 04 02 04 04 04 04 04 @@@@@@@@@@@@~~@@@@@@@@@@ ; room &51 (room_x=20, room_y=20) # Title screen &4c6b 14 14 42 c0 08 36 0d 81 02 88 23 40 a0 00 92 08 ; (13,12), colours=(4,0,3) &4c7b 80 24 03 13 20 c4 c0 c4 02 08 31 30 83 80 20 03 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ &4c8b 33 c4 02 c0 c0 0c 01 c2 74 80 28 0d 14 20 44 03 ; 04 0a 00 00 00 00 00 00 00 00 08 04 @@// \\@@ &4c9b 90 00 08 26 00 d0 81 41 01 82 54 80 28 15 38 88 ; 0a 00 00 00 00 00 00 00 00 00 00 08 // \\ &4cab 4b 02 ; 00 00 00 00 00 00 00 00 00 00 18 19 TTTT ; 00 00 00 18 19 1a 00 00 00 18 19 19 TTTTTT TTTTTT ; 00 00 18 19 19 19 1a 00 18 19 19 19 TTTTTTTTTT TTTTTTTT ; 00 00 00 00 17 00 00 00 00 00 00 16 TT TT ; 05 00 00 00 16 00 48 00 00 48 00 17 \\ TT 48 48 TT ; 03 05 00 00 15 00 00 00 00 00 00 15 ##\\ TT TT ; 03 03 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e ####==================== ; room &52 (room_x=5, room_y=10) &4cad 05 0a 51 47 24 18 00 01 20 01 06 40 00 48 80 01 ; THE ROOFTOP (-2,2), colours=(1,1,2) &4cbd 10 a0 81 23 50 80 20 18 00 01 18 12 1c 18 12 1c ; 03 00 10 00 00 00 00 00 00 00 00 00 ## || &4ccd 18 20 08 06 40 40 06 08 92 01 82 64 80 20 18 00 ; 03 00 10 00 00 00 00 00 00 00 00 00 ## || &4cdd 01 09 20 48 02 08 92 00 82 60 80 20 09 20 48 04 ; 03 00 10 0b 03 03 03 03 03 05 00 00 ## ||//##########\\ &4ced 08 92 00 82 60 50 00 44 68 e0 10 14 11 20 08 ae ; 03 00 10 03 09 07 03 09 07 03 00 00 ## ||##//\\##//\\## &4cfd 03 ; 03 00 10 13 00 00 13 00 00 13 00 00 ## ||PP PP PP ; 03 00 10 12 00 00 12 00 00 12 00 00 ## ||PP PP PP ; 03 00 00 12 00 00 11 00 00 12 00 00 ## PP PP PP ; 03 05 00 11 0b 03 03 03 05 11 00 00 ##\\ PP//######\\PP ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &53 (room_x=6, room_y=10) &4cfe 06 0a 24 47 2d 60 8a 06 8e 40 01 22 e0 18 20 4a ; THE ROOFTOP (-1,2), colours=(5,5,2) &4d0e 06 08 91 01 62 24 80 10 09 20 46 94 44 06 40 04 ; 00 00 00 00 00 00 00 00 00 00 00 00 &4d1e 08 83 eb 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 0b 03 03 03 03 03 05 00 00 00 //##########\\ ; 00 00 03 03 03 03 03 03 03 00 00 00 ############## ; 00 00 00 13 00 00 00 13 00 00 00 00 PP PP ; 00 00 00 12 00 00 00 12 00 00 00 00 PP PP ; 00 00 00 11 49 13 00 11 00 00 00 00 PP49 PP ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &54 (room_x=7, room_y=10) &4d22 07 0a 24 07 21 e0 88 06 8e 40 01 22 e0 18 20 4a ; THE ROOFTOP (0,2), colours=(1,4,0) &4d32 06 08 91 01 22 49 70 44 80 10 11 20 0c 8e e0 81 ; 00 00 00 00 00 00 00 00 00 00 00 00 &4d42 53 78 e0 28 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 0b 03 03 03 03 03 05 00 00 00 //##########\\ ; 00 00 03 03 03 03 03 03 03 00 00 00 ############## ; 00 00 00 13 00 00 00 13 00 00 00 00 PP PP ; 00 49 07 11 00 00 00 11 00 00 00 00 49 PP PP ; 03 03 03 03 03 0f 03 03 03 03 03 03 ##########LL############ ; 03 03 03 03 03 0f 03 03 03 03 03 03 ##########LL############ ; room &55 (room_x=8, room_y=10) &4d46 08 0a 31 07 29 60 99 04 04 88 a3 81 c3 50 80 30 ; THE ROOFTOP (1,2), colours=(5,4,0) &4d56 18 00 18 12 20 08 07 06 08 e1 81 e1 91 01 82 1c ; 00 00 00 00 00 00 00 00 00 00 00 00 &4d66 00 64 80 10 1e 18 1e 11 20 4c 04 08 82 a3 40 e0 ; 00 00 00 00 00 00 00 00 00 00 00 00 &4d76 02 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 49 01 00 00 00 00 49 ; 00 00 00 00 0b 03 03 03 03 05 00 00 //########\\ ; 00 00 03 00 03 09 00 00 07 03 00 00 ## ##// \\## ; 00 0f 03 0f 13 00 00 1c 00 13 00 00 LL##LLPP %% PP ; 00 0f 03 0f 11 00 00 00 00 11 00 00 LL##LLPP PP ; 03 03 03 03 03 03 01 03 03 03 03 03 ############~~########## ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &56 (room_x=9, room_y=10) &4d77 09 0a 1f 47 24 e0 0f 0e 41 01 e2 64 80 20 18 14 ; THE ROOFTOP (2,2), colours=(1,1,2) &4d87 00 1a 18 40 12 10 00 11 00 1a 38 08 04 6e 02 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 03 03 03 05 00 00 00 00 ######\\ ; 00 00 00 00 13 00 00 03 05 00 0b 03 PP ##\\ //## ; 00 49 01 00 11 00 0b 03 03 01 03 03 49 PP //####~~#### ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &57 (room_x=5, room_y=11) &4d96 05 0b 27 47 2c a0 0e 0e 41 01 e2 e0 10 12 20 41 ; THE ROOFTOP (-2,3), colours=(5,1,2) &4da6 06 48 11 01 92 e0 10 20 01 86 44 00 48 80 01 10 ; 00 00 00 00 00 00 00 00 00 00 00 00 &4db6 00 12 60 00 04 80 04 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 03 03 03 05 00 00 00 00 00 00 00 00 ######\\ ; 03 03 03 09 00 00 00 00 00 00 00 00 ######// ; 00 13 00 00 00 00 00 00 00 00 00 00 PP ; 00 11 00 00 00 00 00 00 00 00 00 00 PP ; 03 03 03 00 00 00 00 00 00 00 00 00 ###### ; 03 09 10 00 00 00 00 00 00 00 00 00 ##//|| ; 03 00 10 00 00 00 00 00 00 00 00 00 ## || ; 03 00 10 00 00 00 00 00 00 00 00 00 ## || ; room &58 (room_x=22, room_y=7) &4dbd 16 07 10 51 04 b6 0e d8 4b d2 be b4 28 ed 4f 03 ; THE RIVER (15,-1), colours=(0,1,2) ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 24 24 24 24 24 24 24 24 24 24 24 24 <><><><><><><><><><><><> ; 3e 3e 3e 3e 3e 3e 3e 3e 3e 3e 3e 3e ------------------------ ; 22 22 22 22 22 22 22 22 22 22 22 22 wwwwwwwwwwwwwwwwwwwwwwww ; 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f 3f WWWWWWWWWWWWWWWWWWWWWWWW ; room &59 (room_x=23, room_y=7) &4dcd 17 07 19 51 04 b6 0e d8 4b 22 80 98 2f 0c 06 05 ; THE RIVER (16,-1), colours=(0,1,2) &4ddd 88 8a c2 e0 b8 3f 0c 8e 03 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d ************************ ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 24 24 24 24 24 00 00 00 00 00 00 00 <><><><><> ; 3e 3e 3e 3e 03 05 00 00 00 00 00 00 --------##\\ ; 22 22 22 22 03 03 03 03 03 03 03 03 wwwwwwww################ ; 3f 3f 3f 3f 03 03 03 03 03 03 03 03 WWWWWWWW################ ; room &5a (room_x=7, room_y=8) &4de6 07 08 48 26 09 20 44 00 8e 03 42 04 00 64 04 80 ; THE MAIN PALACE (0,0), colours=(4,4,4) &4df6 30 19 20 44 00 40 42 00 c0 01 08 92 00 22 44 04 ; 00 00 00 10 03 03 03 03 03 03 03 03 ||################ &4e06 80 30 11 20 8c 06 66 05 8e 00 a0 81 c3 56 80 10 ; 00 00 00 10 00 13 10 00 00 00 00 13 || PP|| PP &4e16 1c 38 82 44 66 01 40 01 08 92 01 22 24 80 08 09 ; 00 00 00 10 00 12 10 00 1c 00 00 12 || PP|| %% PP &4e26 20 42 04 88 10 81 d3 00 ; 00 00 00 00 00 11 10 00 00 00 00 11 PP|| PP ; 00 00 00 00 0b 03 35 03 03 03 03 03 //##::########## ; 00 0b 03 03 03 03 35 00 00 00 07 03 //########:: \\## ; 03 03 03 03 09 13 34 00 14 00 00 13 ########//PP:: () PP ; 00 00 00 00 00 12 00 00 00 00 00 12 PP PP ; 00 00 00 00 00 11 00 00 00 00 00 11 PP PP ; 03 03 03 03 03 03 03 03 03 03 03 03 ######################## ; room &5b (room_x=21, room_y=21) # Completion screen &4e2e 15 15 46 40 28 36 05 08 62 83 00 58 00 58 00 d8 ; (14,13), colours=(5,0,2) &4e3e 20 00 36 04 e8 32 30 b1 00 80 63 0c cc 10 0b 20 ; 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 00 ********************** &4e4e 48 06 20 07 40 06 08 d2 01 82 92 20 09 20 44 02 ; 00 0d 0d 00 0d 00 0d 00 0d 0d 00 0d **** ** ** **** ** &4e5e 08 d2 00 82 3e 60 44 80 10 11 20 48 05 08 8a 80 ; 0d 0d 00 00 00 00 00 00 00 00 00 00 **** &4e6e 43 40 e0 20 2e 02 ; 00 00 00 00 00 00 00 00 00 00 00 00 ; 00 00 00 00 00 00 00 00 18 19 1a 00 TTTTTT ; 03 03 03 03 03 03 03 18 19 19 19 1a ##############TTTTTTTTTT ; 00 00 13 00 27 00 13 00 00 17 00 00 PP ][ PP TT ; 24 24 12 00 00 00 12 00 00 16 00 00 <><>PP PP TT ; 3e 03 11 00 00 00 11 00 00 15 00 00 --##PP PP TT ; 22 03 03 03 01 03 03 0e 0e 0e 0e 0e ww######~~####========== ; end of room data &4e74 ff ; unused &4e75 00 00 00 00 00 00 00 00 00 00 00 ; &4e80-&7fff is screen memory ; unused &4e80 00 00 00 00 00 00 00 00 00 00 00 00 ; entry_point &63a0 a9 8c LDA #&8c ; *TAPE at 1200 baud &63a2 a2 0c LDX #&0c &63a4 20 a2 64 JSR &64a2 ; osbyte_with_zero_y &63a7 a2 00 LDX #&00 &63a9 8a TXA ; wipe_stack_loop &63aa 48 PHA &63ab ca DEX &63ac d0 fc BNE &63aa ; wipe_stack_loop &63ae a2 5f LDX #&5f &63b0 9a TXS &63b1 a2 03 LDX #&03 &63b3 8e 58 02 STX &0258 ; ESCAPE/BREAK effect &63b6 8e 59 02 STX &0259 ; Econet keyboard disable &63b9 8d 5e 02 STA &025e ; Econet OS call interception status &63bc 8d 5f 02 STA &025f ; Econet OSRDCH interception status &63bf 8d 60 02 STA &0260 ; Econet OSWRCH interception status &63c2 a9 0f LDA #&0f ; Flush all buffers &63c4 a2 00 LDX #&00 &63c6 20 a2 64 JSR &64a2 ; osbyte_with_zero_y &63c9 a9 09 LDA #&09 ; Set first colour duration &63cb a2 01 LDX #&01 &63cd 20 a2 64 JSR &64a2 ; osbyte_with_zero_y &63d0 a9 0a LDA #&0a ; Set second colour duration &63d2 a2 01 LDX #&01 &63d4 20 a2 64 JSR &64a2 ; osbyte_with_zero_y &63d7 a2 09 LDX #&09 ; disable_events_loop # Disable all events &63d9 8a TXA &63da 48 PHA &63db a9 0d LDA #&0d ; Disable event &63dd 20 a2 64 JSR &64a2 ; osbyte_with_zero_y &63e0 68 PLA &63e1 aa TAX &63e2 ca DEX &63e3 10 f4 BPL &63d9 ; disable_events_loop &63e5 78 SEI &63e6 a9 80 LDA #&80 &63e8 8d 6e fe STA &fe6e ; User VIA Interrupt control register &63eb a9 27 LDA #&27 &63ed 8d 45 fe STA &fe45 ; System VIA Timer 1 latch/counter MSB &63f0 8d 49 fe STA &fe49 ; System VIA Timer 2 latch/counter MSB &63f3 58 CLI &63f4 a9 90 LDA #&90 ; Set TV offset and interlacing &63f6 a2 00 LDX #&00 &63f8 20 a2 64 JSR &64a2 ; osbyte_with_zero_y &63fb a9 77 LDA #&77 ; Close all Spool/Exec files &63fd 20 f4 ff JSR &fff4 ; OSBYTE &6400 a9 e8 LDA #&e8 ; Read/Write 6850 IRQ Mask &6402 a2 00 LDX #&00 &6404 20 a2 64 JSR &64a2 ; osbyte_with_zero_y &6407 ad 8e 02 LDA &028e ; Available RAM &640a c9 40 CMP #&40 &640c d0 0d BNE &641b ; move_memory &640e a2 31 LDX #&31 ; write_not_suitable_loop # On a 16k machine, display an error message &6410 bd a7 64 LDA &64a7,X ; not_suitable_string &6413 20 e3 ff JSR &ffe3 ; OSASCI &6416 ca DEX &6417 10 f7 BPL &6410 ; write_not_suitable_loop ; infinite_loop &6419 30 fe BMI &6419 ; infinite_loop ; move_memory # Move &1900-&63ff to &03ec-&4eeb &641b a0 00 LDY #&00 &641d 84 00 STY &00 ; source_address_low &641f a9 19 LDA #&19 &6421 85 01 STA &01 ; source_address_high &6423 a9 ec LDA #&ec &6425 85 02 STA &02 ; target_address_low &6427 a9 03 LDA #&03 &6429 85 03 STA &03 ; target_address_high &642b a2 4b LDX #&4b ; move_memory_loop &642d b1 00 LDA (&00),Y ; source_address &642f 91 02 STA (&02),Y ; target_address &6431 c8 INY &6432 d0 f9 BNE &642d ; move_memory_loop &6434 e6 01 INC &01 ; source_address_high &6436 e6 03 INC &03 ; target_address_high &6438 ca DEX &6439 d0 f2 BNE &642d ; move_memory_loop &643b 8a TXA ; wipe_top_of_screen_loop # Wipe &4e80-&52ff &643c 9d 80 4e STA &4e80,X ; &4e80 = start of screen memory &643f 9d 00 4f STA &4f00,X &6442 9d 00 50 STA &5000,X &6445 9d 00 51 STA &5100,X &6448 9d 00 52 STA &5200,X &644b e8 INX &644c d0 ee BNE &643c ; wipe_top_of_screen_loop &644e a9 80 LDA #&80 &6450 85 00 STA &00 ; screen_address_low &6452 a9 4e LDA #&4e ; &4e80 = start of screen memory &6454 85 01 STA &01 ; screen_address_high &6456 a2 29 LDX #&29 ; plot_energy_bar_loop &6458 a0 00 LDY #&00 &645a a9 30 LDA #&30 ; BB &645c 91 00 STA (&00),Y ; screen_address # Plot top &645e a0 06 LDY #&06 &6460 91 00 STA (&00),Y ; screen_address # and bottom of energy bar &6462 18 CLC &6463 a5 00 LDA &00 ; screen_address_low &6465 69 08 ADC #&08 # Move right two pixels &6467 85 00 STA &00 ; screen_address_low &6469 90 02 BCC &646d &646b e6 01 INC &01 ; screen_address_high &646d ca DEX &646e d0 e8 BNE &6458 ; plot_energy_bar_loop &6470 a9 20 LDA #&20 ; BK ; plot_energy_bar_end_loop &6472 91 00 STA (&00),Y ; screen_address # Plot right of energy bar &6474 88 DEY &6475 10 fb BPL &6472 ; plot_energy_bar_end_loop ; &6477 a9 13 LDA #&13 ; Wait for Vertical Retrace &6479 20 f4 ff JSR &fff4 ; OSBYTE &647c a9 9a LDA #&9a # Write to Video ULA control register and RAM copy &647e a2 f4 LDX #&f4 # Change to MODE 2 without clearing screen &6480 20 a2 64 JSR &64a2 ; osbyte_with_zero_y &6483 a2 0f LDX #&0f ; write_video_ula_loop &6485 bd d9 64 LDA &64d9,X ; video_ula_values &6488 8d 21 fe STA &fe21 # Write to video ULA palette register &648b ca DEX &648c 10 f7 BPL &6485 ; write_video_ula_loop &648e a2 0d LDX #&0d ; write_video_registers_loop &6490 bd e9 64 LDA &64e9,X ; video_registers_values &6493 8e 00 fe STX &fe00 # Write to video controller (register number) &6496 8d 01 fe STA &fe01 # Write to video controller (register value) &6499 ca DEX &649a 10 f4 BPL &6490 ; write_video_registers_loop &649c e8 INX &649d 86 57 STX &57 ; score &649f 4c a0 1d JMP &1da0 ; real_entry_point ; osbyte_with_zero_y &64a2 a0 00 LDY #&00 &64a4 4c f4 ff JMP &fff4 ; OSBYTE ; not_suitable_string &64a7 41 20 6c 65 64 6f 4d 20 20 20 20 65 68 74 20 72 ; MODE 7 &64b7 6f 66 20 65 6c 62 61 74 69 75 73 20 74 6f 6e 20 ; "This program is not suitable for the Model A" &64c7 73 69 20 6d 61 72 67 6f 72 70 20 73 69 68 54 0d &64d7 07 16 ; video_ula_values ; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; K R G Y B M C W *G W W *R *M K K Y # Colours 12 and 13 are changed every frame &64d9 07 16 25 34 43 52 61 70 85 90 a0 b6 c2 d7 e7 f4 ; video_registers_values &64e9 7f # R0: Horizontal total register &64ea 48 # R1: Horizontal displayed register &64eb 5e # R2: Horizontal sync position register &64ec 28 # R3: Sync width register &64ed 26 # R4: Vertical total register &64ee 00 # R5: Vertical total adjust register &64ef 16 # R6: Vertical displayed register &64f0 1f # R7: Vertical sync position &64f1 00 # R8: Interlace and delay register &64f2 07 # R9: Scan lines per character register &64f3 20 # R10: Cursor start register &64f4 08 # R11: Cursor end register &64f5 09 # R12: Displayed screen start address register (low) &64f6 d0 # R13: Displayed screen start address register (high) ; unused &64f7 00