Citadel disassembly =================== Citadel was written by Michael Jakobsen and published by Superior Software in 1985. A platform game requiring the player to solve puzzles in a castle, it is widely considered as one of the classic graphical adventures for the BBC Micro. The following disassembly was created by reverse engineering binary images, without access to any source code. It is nevertheless reasonably complete, allowing the technical approaches used to be understood. The author of this disassembly imposes no additional copyright restrictions beyond those already present on the game itself. It is provided for educational purposes only, and it is hoped that the original authors will accept it in the good faith it was intended - as a tribute to their skills. Technical notes =============== Sprites are stored packed, using either 2 bits (four colours) or 1 bit (two colours) per pixel. Each sprite can contain several frames. A palette for each frame is prepared prior to use, which allows the same bitmap to be plotted in different colours. A frame can use the bitmap data of its predecessor or flip it horizontally. On screen, the sixteen colours of a custom-sized MODE 2 are divided into two identical sets of eight. This allows the top two bits of each pixel pair to be used to store data about how the sprite affects the player. Rooms are plotted using a combination of OS routines and the sprite routine. A background of sprites is plotted first, from which rectangles and triangles are removed. Further sprites and features such as ropes and pillars are then added. A screenshot map may be found at: http://www.level7.org.uk/miscellany/citadel-map.png Interesting Pokes ================= &301b = &60 player never loses energy &3907 = &00 player can walk through doors &4126 = &18 view rooms being plotted Sprite data format ================== For each sprite: 84218421 ........ ........ offset to next sprite ........ 8....... ........ sprite is painful ........ .42..... ........ sprite type: 00 background 20 climbable 40 (unused) 60 obstacle ........ ...1.... ........ unused flag (set only for LIFT) ........ ....8421 ........ enemy type ........ ........ ....8421 animation type ........ ........ 8421.... animation cooldown (via lookup table) Then, for each frame: ......21 ........ number of 4-pixel high blocks - 1 ...184.. ........ colour one 842..... ........ colour two ........ 84218421 if zero, sprite is tall; add 4 blocks, use a third byte ........ ......21 frame type: 0 use same bitmap data as previous frame 1 bitmap data follows frame header 2 flip previous frame's bitmap horizontally 3 clone bitmap with offset set by third byte ........ ...184.. colour three ........ 842..... width in bytes - 1 bitmap data, if first frame or frame type = 1 two colour using colours one and two if colour three is black four colours using black and colours one through three otherwise Room data format ================ For each room: 84218421 offset to next room 1 room is a clone of room &00 2 room is a clone of another room; get another byte for number 84218421 ........ sprite to use for background ........ .......1 room has sprites ........ ......2. room has object ........ .....4.. room has ropes and/or ladders ........ ....8... room has stars ........ ...1.... room has door ........ ..2..... room has pillars ........ .4...... room has enemies ........ 8....... (unused) If the room has sprites: .....421 number of lines of sprites before rectangles and triangles 84218... number of lines of sprites after rectangles and triangles For each line of sprites before rectangle and triangles: 0000.... ........ set sprite, frame and offsets ..21 ........ y offset 84.. ........ x offset .... 8421842. sprite number .... .......1 frame number 0001.... horizontal line of sprites 8421 number of sprites in horizontal line 0010.... vertical line of sprites 8421 number of sprites in vertical line 0011.... set frame 8421 frame number otherwise: start plotting sprites ....8421 x position 8421.... y position For all rooms: 84218... number of rectangles - 1 .....421 number of triangles For each rectangle: 0000.... ........ set plotting mode and colour (default black) 8421 ........ plotting mode: 0 STA, 1 ORA, 2 AND, 3 EOR .... 84218421 colour if &70, get two more bytes for water settings: 84218421 ........ water height ........ ....8421 water x minimum ........ 8421.... water y minimum if &09, discard two further bytes for starport otherwise: ....8421 ........ x position 8421.... ........ y position ........ ....8421 x size - 1 ........ 8421.... y size - 1 For each triangle: 0000.... ........ set plotting mode and colour (default black) 8421 ........ plotting mode: 0 STA, 1 ORA, 2 AND, 3 EOR .... 84218421 colour otherwise: ....8421 ........ ........ first x position 8421.... ........ ........ first y position ........ ....8421 ........ second x position ........ 8421.... ........ second y position ........ ........ ....8421 third x position ........ ........ 8421.... third y position If the room has an object: ....8421 x position 8421.... y position If the room has sprites: For each line of sprites after rectangle and triangles, as above. If the room has ropes and/or ladders: ....8421 number of ropes 8421.... number of ladders For each rope: ....8421 x position of base 8421.... y position of base For each ladder: ....8421 ........ x position of base 8421.... ........ y position of base ........ 842184.. length ........ ......21 colour If the room has a door: 84218421 ........ type ........ ....8421 x position ........ 8421.... y position If the room has pillars: ....8421 number of pillars 84...... colour ..21.... (unused) For each pillar: 00...... set colour and offset 21.... colour ..8421 offset otherwise: ....8421 x position 8421.... y position If the room has enemies: ....8421 number of enemy sprites - 1 8421.... number of enemies - 1 For each enemy sprite: 84218421 sprite number For each enemy: 8421.... sprite slot to use ....8421 enemy settings: &f use previous settings otherwise, consider type of sprite slot If type = 0 or 7 (horizontal range): 8421 ........ horizontal speed .... ....8421 x minimum .... 8421.... x maximum If type = 1 (vertical range): 8421 ........ vertical speed .... ....8421 y minimum .... 8421.... y maximum If type = 2 (diagonal range): 8421 ........ ........ horizontal and vertical speeds from table .... ....8421 ........ x minimum .... 8421.... ........ y minimum .... ........ ....8421 x maximum .... ........ 8421.... y maximum If type = 3 (BLOCK): 84.. speed ..21 direction: 0 up, 1 right, 2 down, 3 left If type = 4 or 5 (MUMMY or homing enemy): ...1 speed ..2. enemy can levitate If type = 6 (MONK): 21.. colour BASIC Loader ============ The BASIC loader can be reduced to the following: 10 ?&80=?&E0:?&81=?&E1 20 ?&82=0 # For male player 20 ?&82=1 # For female player 30 ?&8A=&C8:?&8B=&C2:?&8C=&E8:?&8D=&E1:?&8E=&C9 # Keyboard: Z, X, *, ?, Return 30 ?&8A=&D7:?&8B=&81:?&8C=&E7:?&8D=&C0:?&8E=&C8 # Keyboard: Caps, Ctrl, ;, >, * 30 ?&8A=&D3:?&8B=&E9:?&8C=&E4:?&8D=&D9:?&8E=&C3 # Keyboard: Delete, Copy, G, B, F 30 ?&8A=&C7:?&8B=&E3:?&8C=&D7:?&8D=&D2:?&8E=&B8 # Keyboard: C, V, @, ;, [ 30 ?&8A=0 # Joystick 40 # Standard: red energy gives 35, green gives 50 40 ?&85=&29:?&86=&23:?&87=&19:&88=?&17 # Cheat: red and green energy gives 65 40 ?&85=&89:?&86=&23:?&87=&19:&88=?&17:?&89=&97 # Cheat: red and green energy gives 95 50 *RUN CITAL Tape protection disassembly =========================== CITAL loads CITAM using a tape-based copy-protection routine, which it then decodes with a simple EOR-based encryption routine. After moving memory around, it sets up a custom screen mode before jumping into the main binary. ; CITAL ; 005400 005436 0002ff &5400 43 49 54 41 44 45 4c 20 50 6c 65 61 73 65 20 64 ; "CITADEL Please do not copy my Program ! MJ. 16-11-1985" &5410 6f 20 6e 6f 74 20 63 6f 70 79 20 6d 79 20 50 72 &5420 6f 67 72 61 6d 20 21 20 4d 4a 2e 20 31 36 2d 31 &5430 31 2d 31 39 38 35 ; cital_entry_point &5436 a9 a9 LDA #&a9 # Pointless confusion &5438 85 0a STA &0a ; unused_0a &543a a9 03 LDA #&03 &543c 85 0b STA &0b ; unused_0b &543e a9 09 LDA #&09 &5440 85 0c STA &0c ; unused_0c &5442 4c 49 54 JMP &5449 ; skip_false_loop ; false_loop # Attempt to throw off naive disassembly? #5443 EOR #&54 &5445 54 # invalid opcode &5446 88 DEY &5447 d0 fa BNE &5443 ; false_loop ; skip_false_loop &5449 85 0c STA &0c ; unused_0c # Pointless confusion &544b a9 60 LDA #&60 ; RTS &544d 8d 56 56 STA &5656 ; fake_routine # Self-modifying code &5450 a9 0b LDA #&0b ; Auto Repeat Delay &5452 a2 00 LDX #&00 ; disable &5454 20 60 56 JSR &5660 ; osbyte_with_zero_y &5457 a9 04 LDA #&04 ; Define action of cursor editing keys &5459 a2 01 LDX #&01 ; Cursor keys return ASCII values 135-139 &545b 20 60 56 JSR &5660 ; osbyte_with_zero_y &545e a9 c8 LDA #&c8 ; Read/Write BREAK/ESCAPE effect &5460 a2 03 LDX #&03 ; Memory cleared on next reset, Normal ESCAPE effect &5462 20 60 56 JSR &5660 ; osbyte_with_zero_y &5465 a9 e5 LDA #&e5 ; Read/Write ESCAPE key status &5467 a2 ff LDX #&ff ; treat ESCAPE as ASCII code &5469 20 60 56 JSR &5660 ; osbyte_with_zero_y &546c a9 e1 LDA #&e1 ; Read/Write Interpretation of F-Keys &546e a2 30 LDX #&30 ; treat F-keys as ASCII codes &5470 20 60 56 JSR &5660 ; osbyte_with_zero_y &5473 20 ce 56 JSR &56ce ; modify_various_instructions &5476 a2 04 LDX #&04 &5478 a9 00 LDA #&00 ; zero_clock_block_loop # Reset system clock &547a 95 00 STA &00,X ; clock_block &547c ca DEX &547d 10 fb BPL &547a ; zero_clock_block_loop &547f a9 02 LDA #&02 ; Write system clock &5481 20 f1 56 JSR &56f1 ; osword_with_zero_x_and_y &5484 a5 95 LDA &95 ; protection_tripped # ? &5486 49 80 EOR #&80 &5488 85 95 STA &95 ; protection_tripped &548a ad cd 03 LDA &03cd ; block_spare_byte_2 # Trip protection if not loaded from tape &548d d0 02 BNE &5491 ; not_tripped_by_spare_byte_2 &548f e6 95 INC &95 ; protection_tripped ; not_tripped_by_spare_byte_2 &5491 a9 0d LDA #&0d ; Disable Event # Disable any existing vsync event &5493 a2 04 LDX #&04 ; vsync event &5495 20 60 56 JSR &5660 ; osbyte_with_zero_y &5498 a9 9b LDA #&9b # Setup tape unprotection routine &549a 8d 20 02 STA &0220 ; event_vector_low ; accumulator_instruction &549d a9 55 LDA #&55 # actually LDA #&56 ; &569b = cital_event_routine &549f 8d 21 02 STA &0221 ; event_vector_high &54a2 a9 00 LDA #&00 # ? &54a4 8d d8 03 STA &03d8 ; filename being searched for + 6 &54a7 a9 0e LDA #&0e ; Enable Event # Enable tape unprotection routine, calling every vsync &54a9 a2 04 LDX #&04 ; vsync event &54ab 20 60 56 JSR &5660 ; osbyte_with_zero_y &54ae a2 83 LDX #&83 &54b0 a0 56 LDY #&56 ; &5683 = osfile_controlblock &54b2 a9 ff LDA #&ff ; Load a file into memory &54b4 20 dd ff JSR &ffdd ; OSFILE # Load CITAM into memory at &1300 &54b7 a9 0d LDA #&0d ; Disable Event # Disable tape unprotection routine &54b9 a2 04 LDX #&04 ; vsync event &54bb 20 60 56 JSR &5660 ; osbyte_with_zero_y &54be a5 0a LDA &0a ; unused_0a # Pointless confusion &54c0 d0 02 BNE &54c4 ; not_zero_is_not_zero &54c2 a9 00 LDA #&00 ; not_zero_is_not_zero &54c4 85 0d STA &0d ; unused_0d &54c6 a5 02 LDA &02 ; spare_byte_2_of_last_block # Trip protection if details of blocks weren't right &54c8 d0 06 BNE &54d0 ; tripped &54ca a5 03 LDA &03 ; spare_byte_2_of_particular_block &54cc c9 7f CMP #&7f &54ce f0 02 BEQ &54d2 ; not_tripped ; tripped &54d0 e6 95 INC &95 ; protection_tripped ; not_tripped &54d2 a9 15 LDA #&15 ; Flush Selected Buffer # ? &54d4 a2 07 LDX #&07 ; Sound channel 3 &54d6 20 f4 ff JSR &fff4 ; OSBYTE &54d9 ad 66 35 LDA &3566 ; &3b # Pointless confusion &54dc 85 0e STA &0e ; unused_0e &54de a0 00 LDY #&00 &54e0 84 00 STY &00 ; checksum &54e2 ad ff 53 LDA &53ff ; checksum_from_citam # Read and then remove checksum from CITAM &54e5 85 02 STA &02 ; required_checksum &54e7 8c ff 53 STY &53ff ; checksum_from_citam &54ea a9 59 LDA #&59 # Pointless confusion &54ec 85 06 STA &06 ; unused_06 ; move_memory_1300_loop # Move &1300-&53ff to &0400-&44ff &54ee b9 00 13 LDA &1300,Y # actually LDA source_address &54f1 84 01 STY &01 ; eor_instruction &54f3 45 06 EOR &06 ; unused_06 # actually EOR &01 # EORing &xxyy with &yy; decodes CITAM binary &54f5 99 00 04 STA &0400,Y # actually STA target_address &54f8 45 00 EOR &00 ; checksum &54fa 85 00 STA &00 ; checksum &54fc 88 DEY &54fd d0 ef BNE &54ee ; move_memory_1300_loop &54ff ee f0 54 INC &54f0 ; source_address_high &5502 ee f7 54 INC &54f7 ; target_address_high &5505 ad f7 54 LDA &54f7 ; target_address_high &5508 c9 45 CMP #&45 &550a 90 e2 BCC &54ee ; move_memory_1300_loop &550c a5 00 LDA &00 ; checksum # Trip protection if checksum doesn't match &550e 49 ff EOR #&ff &5510 c5 02 CMP &02 ; required_checksum &5512 f0 02 BEQ &5516 ; skip_inc &5514 e6 95 INC &95 ; protection_tripped ; skip_inc &5516 a9 01 LDA #&01 ; Read system clock # Read system clock into clock_block &5518 20 f1 56 JSR &56f1 ; osword_with_zero_x_and_y &551b a5 02 LDA &02 ; clock_block + 2 &551d d0 08 BNE &5527 ; skip_inc_two &551f a5 01 LDA &01 ; block_block + 1 &5521 c9 09 CMP #&09 &5523 b0 02 BCS &5527 ; skip_inc_two &5525 e6 95 INC &95 ; protection_tripped # Trip protection if loading was too quick ; skip_inc_two &5527 a9 0f LDA #&0f ; Flush all buffers/input buffer &5529 a2 01 LDX #&01 ; Flushes just the input buffer &552b 20 60 56 JSR &5660 ; osbyte_with_zero_y &552e a5 82 LDA &82 ; player_sex &5530 f0 1f BEQ &5551 ; player_is_male # If the player is female, then &5532 a0 10 LDY #&10 ; move_memory_0540_loop # move &0540-&054f to &05c4-&05d3 &5534 b9 3f 05 LDA &053f,Y ; female_player_palette_table - 1 &5537 99 c3 05 STA &05c3,Y ; player_palette_table - 1 &553a 88 DEY &553b d0 f7 BNE &5534 ; move_memory_0540_loop ; move_memory_0400_loop # move &0400-&04ff to &0610-&070f &553d b9 00 04 LDA &0400,Y ; female_player_sprites &5540 99 10 06 STA &0610,Y ; player_sprites &5543 88 DEY &5544 d0 f7 BNE &553d ; move_memory_0400_loop &5546 a0 3f LDY #&3f ; move_memory_0500_loop # move &0500-&053f to &0710-&074f &5548 b9 00 05 LDA &0500,Y ; female_player_sprites + &100 &554b 99 10 07 STA &0710,Y ; player_sprites + &100 &554e 88 DEY &554f 10 f7 BPL &5548 ; move_memory_0500_loop ; player_is_male &5551 a2 27 LDX #&27 # Regardless of the player, ; move_memory_0590_loop # move &0590-&05b7 to &04c8-&4ef &5553 bd 90 05 LDA &0590,X ; initial_object_sprite_table_before_move &5556 9d c8 04 STA &04c8,X ; initial_object_sprite_table &5559 ca DEX &555a 10 f7 BPL &5553 ; move_memory_0590_loop &555c a5 95 LDA &95 ; protection_tripped &555e d0 c7 BNE &5527 ; skip_inc_two # Infinite loop if protection tripped &5560 a9 90 LDA #&90 ; Set TV offset and interlacing &5562 a2 fd LDX #&fd ; vertical screen shift &5564 a0 01 LDY #&01 ; turn on interlacing &5566 20 f4 ff JSR &fff4 ; OSBYTE &5569 a9 16 LDA #&16 &556b 20 ee ff JSR &ffee : OSWRCH &556e a9 04 LDA #&04 # MODE 4 &5570 20 ee ff JSR &ffee : OSWRCH &5573 a5 95 LDA &95 ; protection_tripped # If protection was tripped, use bad CITAM entry point &5575 8d 54 56 STA &5654 ; final_jmp_instruction_low # If not, &4400 = citam_entry_point &5578 f0 05 BEQ &557f ; setup_screen_mode &557a a9 26 LDA #&26 # If protection was tripped, use bad CITAM entry point &557c 8d 55 56 STA &5655 ; final_jmp_instruction_high ; setup_screen_mode # Setup the special screen mode used &557f a9 06 LDA #&06 # R6: Vertical displayed register &5581 8d 00 fe STA &fe00 ; video register number &5584 a9 01 LDA #&01 &5586 8d 01 fe STA &fe01 ; video register value &5589 a9 9a LDA #&9a ; Write to Video ULA control register and RAM copy; reset flashing colours &558b a2 f4 LDX #&f4 &558d 20 f4 ff JSR &fff4 ; OSBYTE &5590 a9 80 LDA #&80 &5592 8d 4c 03 STA &034c ; Text window width in bytes (low) &5595 a2 02 LDX #&02 &5597 8e 4d 03 STX &034d ; Text window width in bytes (high) &559a a9 20 LDA #&20 &559c 8d 4f 03 STA &034f ; Number of bytes per character &559f a9 80 LDA #&80 &55a1 8d 52 03 STA &0352 ; Number of bytes per line (low) &55a4 8e 53 03 STX &0353 ; Number of bytes per line (high) &55a7 a0 30 LDY #&30 &55a9 8c 4e 03 STY &034e ; High byte of screen memory start address &55ac a9 50 LDA #&50 &55ae 8d 54 03 STA &0354 ; Screen memory length (low) &55b1 8e 55 03 STX &0355 ; Screen memory length (high) &55b4 a2 00 LDX #&00 &55b6 8e 56 03 STX &0356 ; Screen memory map type &55b9 8e 58 03 STX &0358 ; Background text colour &55bc 8e 59 03 STX &0359 ; Graphics foreground mask &55bf 8e 5a 03 STX &035a ; Graphics background mask &55c2 a9 0f LDA #&0f &55c4 8d 60 03 STA &0360 ; Number of colours available &55c7 a9 01 LDA #&01 &55c9 8d 61 03 STA &0361 ; Number of pixels per byte &55cc a9 aa LDA #&aa &55ce 8d 62 03 STA &0362 ; Left colour mask &55d1 a9 55 LDA #&55 &55d3 8d 63 03 STA &0363 ; Right colour mask &55d6 85 d1 STA &d1 ; Byte mask for current graphics point &55d8 8e 50 03 STX &0350 ; Address of top-left of screen (low) &55db 8c 51 03 STY &0351 ; Address of top-left of screen (high) ; # R0: horizontal total register &55de 8e 00 fe STX &fe00 ; video register number &55e1 a9 7f LDA #&7f &55e3 8d 01 fe STA &fe01 ; video register value ; &55e6 e8 INX # R1: horizontal displayed register &55e7 8e 00 fe STX &fe00 ; video register number &55ea a9 50 LDA #&50 &55ec 8d 01 fe STA &fe01 ; video register value ; &55ef e8 INX # R2: horizontal sync position register &55f0 8e 00 fe STX &fe00 ; video register number &55f3 a9 62 LDA #&62 &55f5 8d 01 fe STA &fe01 ; video register value ; &55f8 e8 INX # R3: sync width register &55f9 8e 00 fe STX &fe00 ; video register number &55fc a9 28 LDA #&28 # horizontal 8, vertical 2 &55fe 8d 01 fe STA &fe01 ; video register value ; &5601 a5 80 LDA &80 ; copy_of_e0_from_loader # Restore row multiplication table pointer &5603 85 e0 STA &e0 ; pointer to row multiplication table low &5605 a5 81 LDA &81 ; copy_of_e1_from_loader &5607 85 e1 STA &e1 ; pointer to row multiplication table high ; changing_osbyte &5609 a9 10 LDA #&10 ; Set maximum number of ADC channel (exits with X=old value) # actually LDA #&c8 ; Read/Write BREAK/ESCAPE effect &560b a2 03 LDX #&03 &560d 20 60 56 JSR &5660 ; osbyte_with_zero_y &5610 a2 1d LDX #&1d &5612 a0 00 LDY #&00 ; write_characters_loop # Define text and graphics windows, as below &5614 b9 65 56 LDA &5665,Y ; vdu_characters &5617 20 ee ff JSR &ffee ; OSWRCH &561a c8 INY &561b ca DEX &561c 10 f6 BPL &5614 ; write_characters_loop ; &561e a2 0c LDX #&0c # R12: Displayed screen start address register (high) &5620 8e 00 fe STX &fe00 ; video register number &5623 a9 08 LDA #&08 &5625 8d 01 fe STA &fe01 ; video register value &5628 e8 INX ; &0d # R13: Displayed screen start address register (low) &5629 8e 00 fe STX &fe00 ; video register number &562c a9 80 LDA #&80 # Set screen start address to &4400 &562e 8d 01 fe STA &fe01 ; video register value &5631 a9 f0 LDA #&f0 ; write_palette_loop &5633 8d 21 fe STA &fe21 ; video ULA palette register &5636 38 SEC &5637 e9 0f SBC #&0f &5639 30 f8 BMI &5633 ; write_palette_loop &563b a9 0d LDA #&0d ; Disable Event &563d a2 04 LDX #&04 ; vsync event &563f 20 60 56 JSR &5660 ; osbyte_with_zero_y &5642 a9 00 LDA #&00 &5644 8d 20 02 STA &0220 ; event_vector_low &5647 a9 25 LDA #&25 ; &2500 = citam_event_routine &5649 8d 21 02 STA &0221 ; event_vector_high &564c a9 0e LDA #&0e ; Enable Event # Enable CITAM event routine &564e a2 04 LDX #&04 ; vsync event &5650 20 60 56 JSR &5660 ; osbyte_with_zero_y ; final_jump_instruction &5653 4c 80 32 JMP &3280 # Bad entry point # actually JMP &4400 ; citam_entry_point # Finally jump into CITAM! ; fake_routine &5656 18 CLC # actually RTS &5657 65 00 ADC &00 &5659 85 01 STA &01 &565b d0 f6 BNE &5653 ; final_jump_instruction &565d 4c 00 36 JMP &3600 # Bad entry point ; osbyte_with_zero_y &5660 a0 00 LDY #&00 &5662 4c f4 ff JMP &fff4 ; OSBYTE ; vdu_characters &5665 14 # Restore default logical colours &5666 1c 00 1f 13 08 # Define text window x:&00-&13, y:&08-&1f &566b 18 00 00 00 00 f8 04 c0 02 # Define graphics window x:&0000-&04f8, y:&0000-&02c0 &5674 1d 00 00 e0 ff # Define graphics origin x:&0000, y:&ffe0 &5679 17 00 0a 20 00 00 00 00 00 00 # Set CRTC register &a (cursor start register) to &20 # (disables cursor) ; osfile_control_block &5683 95 56 ; &5695 = filename &5685 00 13 ; &1300 = load address &5651 00 00 &5653 00 00 &5655 00 00 &5657 00 00 &5659 00 00 &565b 00 00 &565d 00 00 ; filename &5695 43 49 54 41 4d 0d ; "CITAM\r" ; cital_event_routine &569b ad ca 03 LDA &03ca ; Block flag byte # Remove protection bit from block &569e 29 fe AND #&fe # (allowing it to be loaded, rather than run) &56a0 8d ca 03 STA &03ca ; Block flag byte &56a3 a2 00 LDX #&00 # Even numbered blocks have upper-case filenames &56a5 ad c6 03 LDA &03c6 ; Block number (low) &56a8 a8 TAY &56a9 4a LSR A &56aa 90 02 BCC &56ae ; skip_change &56ac a2 20 LDX #&20 # Odd numbered blocks have lower-case filenames ; skip_change &56ae 8e d7 03 STX &03d7 ; Block number(high) &56b1 86 00 STX &00 ; case &56b3 a2 04 LDX #&04 ; modify_filename_loop &56b5 bd d2 03 LDA &03d2,X ; Filename of file being searched for &56b8 29 df AND #&df &56ba 05 00 ORA &00 ; case # Change the filename that's being searched for &56bc 9d d2 03 STA &03d2,X ; Filename of file being searched for &56bf ca DEX &56c0 10 f3 BPL &56b5 ; modify_filename_loop &56c2 ad cd 03 LDA &03cd ; block_spare_byte_2 ; compare_instruction &56c5 c0 17 CPY #&17 # actually CPY #&08 &56c7 d0 02 BNE &56cb ; skip_store &56c9 85 03 STA &03 ; spare_byte_2_of_particular_block # Note details about certain blocks ; skip_store &56cb 85 02 STA &02 ; spare_byte_2_of_last_block &56cd 60 RTS ; modify_various_instructions &56ce a5 88 LDA &88 ; cheat_4 &56d0 20 56 56 JSR &5656 ; fake_routine &56d3 49 17 EOR #&17 # Obfuscate the pokes needed for energy cheat &56d5 85 88 STA &88 ; cheat_4 &56d7 a9 c8 LDA #&c8 &56d9 8d 0a 56 STA &560a ; changing_osbyte_type &56dc a9 44 LDA #&44 # &4400 = citam_entry_point &56de 8d 55 56 STA &5655 ; final_jmp_instruction_high &56e1 a9 01 LDA #&01 &56e3 8d f4 54 STA &54f4 ; eor_instruction_value &56e6 a9 08 LDA #&08 &56e8 8d c6 56 STA &56c6 ; compare_instruction_value &56eb a9 56 LDA #&56 &56ed 8d 9e 54 STA &549e ; accumulator_instruction_value &56f0 60 RTS ; osword_with_zero_x_and_y &56f1 a2 00 LDX #&00 &56f3 a0 00 LDY #&00 &56f5 4c f1 ff JMP &fff1 ; OSWORD ; unused &56f8 39 35 44 36 37 20 20 00 ; "95D67 " # Unclear Game disassembly ================ ; CITAM ; 008000 00a3b0 004100 # Loaded at &1300, actual entry point &4400 ; &0073 - &007a enemies_minimum_x # Maximum of 8 enemies ; &007b - &0082 enemies_minimum_y ; &0083 - &008a enemies_sprite_slot ; &008b - &0092 enemies_frame ; &0100 - &0107 enemies_frame_countdown ; &0108 - &010f enemies_secondary_frame_countdown ; &0110 - &0117 enemies_maximum_x ; &0118 - &011f enemies_maximum_y ; &0120 event_timer ; &0121 player_sprite_frame ; &0122 player_sprite_on_entry_to_room ; &0123 player_jump_up_speed_on_entry_to_room ; &0124 player_entry_x ; &0125 player_entry_y ; &0126 energy_number ; &0127 energy_x ; &0128 energy_y ; &0129 door_x ; &012a door_y ; &012b room_door_type ; &012c radiation_countdown ; &012d room_x ; &012e room_y ; &012f - &013a sprite_slots_height_in_blocks # Maximum of 12 sprites / frames ; &013b - &0146 sprite_slots_painfulness ; &0147 - &0152 sprite_slots_animation_type ; &0153 - &015e sprite_slots_animation_speed ; &015f - &016a sprite_slots_unused_flag ; &016b - &0176 sprite_slots_enemy_type ; &0177 - &0182 sprite_slots_offset_of_last_byte ; &0183 - &018e sprite_slots_palette_start ; &018f - &019a sprite_slots_type ; &019b - &01a6 sprite_slots_data_low ; &01a7 - &01b2 sprite_slots_data_high ; &0380 - &03a7 object_room_table ; &03a8 - &03cf object_sprite_table ; &0400 - &04c7 flipped_packed_sprite_data # After moving memory around, the area used by the ; &04c8 - &04ef initial_object_sprite_table # female player sprites is reused for other purposes ; &04f0 - &04ff energy_collected_table ; &0500 - &05c3 palette_table ; &4400 - &7fff screen memory # &1300 - &53ff is moved to &0400 - &44ff at &55ee of CITAL ; female_player_sprites ; female_player_sprite_0 &0400 00 00 a8 45 aa 80 2a aa 00 00 00 00 44 0c 55 ff # &0400-&053f gets copied over &0610-&074f &0410 aa ab 00 00 88 00 ff 0c 3c ff bb b3 00 00 00 08 # by CITAL if the player is female &0420 ff fa c0 00 ff 00 02 22 # (replacing male player sprites with female ones) ; female_player_sprite_1 &0428 00 00 a8 45 aa 80 2a aa 00 00 00 00 44 00 55 ff &0438 aa ab 00 00 00 00 ee 00 f3 cf bb b3 00 00 00 00 &0448 00 80 ff aa 33 32 00 00 ; female_player_sprite_2 &0450 00 00 8a aa aa 20 a2 15 00 00 00 00 aa ae 55 ff &0460 11 03 00 00 00 00 ee ec c3 ff ff 03 22 00 08 88 &0470 ff 00 30 00 ff fa 00 02 ; female_player_sprite_3 &0478 00 00 8a aa aa 20 a2 15 00 00 00 00 aa ae 55 ff &0488 11 00 00 00 00 00 ee ec fc 3f bb 00 00 00 00 00 &0498 cc c8 ff aa 00 20 00 00 ; female_player_sprite_4 &04a0 00 00 8a aa aa aa 2a aa 00 00 00 00 aa ee ff ff &04b0 aa bb 00 00 00 00 6e ec 5f ff 9b b3 00 00 00 00 &04c0 cc c4 73 31 10 00 00 00 ; female_player_sprite_5 &04c8 00 00 8a aa aa aa 2a aa 00 00 00 00 aa ee ff ff &04d8 aa bb 00 00 00 00 6e ec 5f ff 9b b3 00 00 00 00 &04e8 40 00 dc c4 33 31 00 00 ; female_player_sprite_6 &04f0 00 00 a8 45 aa 80 2a aa 00 00 00 00 44 0e 55 fc &0500 a9 bf 22 22 00 00 ec 00 ff f0 ff cf a8 00 88 80 &0510 cf f0 ff f0 33 00 00 00 ; female_player_sprite_7 &0518 00 00 8a aa aa 20 a2 15 00 00 88 88 a6 ef 55 f3 &0528 11 0b 00 00 a2 00 ff 3f ff f0 b3 00 00 00 00 00 &0538 cc 00 ff f0 3f f0 22 20 ; female_player_palette_table # &0540-&054f gets copied over &05c4-&05d3 &0540 00 14 05 11 28 3c 2d 39 0a 1e 0f 1b 22 36 27 33 # by CITAL if the player is female ; unused &0550 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0560 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0570 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0580 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; initial_object_sprite_table_before_move &0590 3c 3c 0e 15 1c 1d 1b 00 01 03 04 48 49 4a 4b 4c # &0590-&05b7 gets copied over &04c8-&4ef &05a0 4d 4e 4f ff 09 14 ff 18 3a 11 13 24 ff ff 3a 1e # by CITAL, making initial_object_sprite_table &05b0 1e 1e 1e 21 22 23 1a 1a ; unused &05b8 00 00 00 00 00 00 00 00 00 00 00 00 ; player_palette_table &05c4 00 05 11 14 0a 0f 1b 1e 22 27 33 36 28 2d 39 3c ; star_port_destroyed_string &05d4 65 6e 6f 44 20 6c 6c 65 57 0e 06 1f 64 65 79 6f ; TAB(&06, &07); "StarPort" &05e4 72 74 73 65 44 09 06 1f 74 72 6f 50 72 61 74 53 ; TAB(&06, &09); "Destroyed" &05f4 07 06 1f ; TAB(&06, &0e); "Well Done" ; unused &05f7 00 ; text_colour_table ; WG MR YG WC YR CG YW CY &05f8 e2 ec f2 c2 f8 e3 e0 e1 ; player_sprites_address_low_table &0600 10 38 60 88 b0 d8 00 28 ; player_sprites_address_high_table &0608 06 06 06 06 06 06 07 07 ; player_sprites ; player_sprite_0 &0610 00 00 a8 45 aa 00 2a aa 00 00 00 04 44 0f 55 ff &0620 a1 33 00 00 40 00 f0 cf 3c ff 33 33 00 00 00 04 &0630 ff f5 cc 00 ff 00 01 11 ; player_sprite_1 &0638 00 00 a8 45 aa 00 2a aa 00 00 00 00 44 00 55 ff &0648 a1 33 00 00 00 00 dd 00 f3 cf 33 33 00 00 00 00 &0658 00 40 ff 55 33 31 00 00 ; player_sprite_2 &0660 00 00 8a aa aa 00 a2 15 00 00 00 00 a4 cc 55 ff &0670 11 0f 00 01 00 00 cc cc c3 ff f0 3f 10 00 04 44 &0680 ff 00 33 00 ff f5 00 01 ; player_sprite_3 &0688 00 00 8a aa aa 00 a2 15 00 00 00 00 a4 cc 55 ff &0698 11 00 00 00 00 00 cc cc fc 3f 77 00 00 00 00 00 &06a8 cc c4 ff 55 00 10 00 00 ; player_sprite_4 &06b0 00 00 8a aa aa aa 2a aa 00 00 00 00 a8 8f aa af &06c0 a2 2f 00 00 00 00 ff fc ff ff ff f3 00 00 00 00 &06d0 cc c4 73 31 10 00 00 00 ; player_sprite_5 &06d8 00 00 8a aa aa aa 2a aa 00 00 00 00 a8 8f aa af &06e8 a2 2f 00 00 00 00 ff fc ff ff ff f3 00 00 00 00 &06f8 40 00 dc c4 33 31 00 00 ; player_sprite_6 &0700 00 00 a8 45 aa 00 2a aa 00 00 00 00 44 0d 55 fc &0710 a1 33 00 00 00 00 dc 00 ff f0 3f cf 00 00 44 40 &0720 cf f0 ff f0 ff 30 00 00 ; player_sprite_7 &0728 00 00 8a aa aa 00 a2 15 00 00 00 00 a4 cc 55 f3 &0738 11 07 00 00 00 00 cf 3f ff f0 73 00 00 00 00 00 &0758 ff c0 ff f0 3f f0 11 10 ; title_screen_rooms &0750 ca 1c 80 95 17 c4 6e 6a 71 01 a3 d5 92 5d 47 ed &0760 94 30 cb 9d 1a 4a 68 72 6b 5a b7 65 97 15 91 5c ; title_screen_text # &0770-&07b2 also used for decrypted completion message &0770 30 30 11 09 1f 65 72 6f 63 53 20 68 67 69 48 10 ; VDU 5; GCOL(0, 7); MOVE &00e8, &0270; "C I T A D E L"; &0780 05 1f 02 11 6e 6f 69 74 63 41 20 73 73 65 72 50 ; GCOL(0, 6); MOVE &00e0, &0270; "C I T A D E L"; &0790 14 04 1f 06 11 65 72 61 77 74 66 6f 53 0b 06 1f ; VDU 4; COLOUR &8a; COLOUR &0c; TAB(&02, &17); "Michael Jakobsen"; &07a0 72 6f 69 72 65 70 75 53 0a 06 1f 03 11 80 11 6e ; COLOUR &80; COLOUR &03; TAB(&06, &0a); "Superior"; &07b0 65 73 62 6f 6b 61 4a 20 6c 65 61 68 63 69 4d 17 ; TAB(&06, &0b); "Software"; &07c0 02 1f 0c 11 8a 11 04 4c 20 45 20 44 20 41 20 54 ; COLOUR &06; TAB(&04, &14); "Press Action"; &07d0 20 49 20 43 02 70 00 e0 04 19 06 00 12 4c 20 45 ; COLOUR &02; TAB(&05, &10); "High Score"; &07e0 20 44 20 41 20 54 20 49 20 43 02 70 00 e8 04 19 ; TAB(&09, &11) "00" &07f0 07 00 12 05 ; puzzle_states ; switch_states &07f4 00 00 ; crystals_in_sanctuary &07f6 00 00 00 00 00 ; cannon_fired &07fb 00 ; temple_guardian_has_been_fed &07fc 00 ; bones_still_needed_in_cauldron &07fd 00 ; star_port_destroyed &07fe 00 ; unused &07ff 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 ; OS channel buffers &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 ; initial_object_room_table &0880 72 d5 97 6e 01 5e 1c 6f 0b a6 c4 84 68 81 36 6c &0890 87 95 05 86 85 5c 64 82 cb e4 ea 17 70 e1 58 83 &08a0 a3 29 5a 90 94 d6 00 00 ; doors_opened &08a8 00 00 00 00 00 00 00 00 ; rooms_that_contain_energy ; G G G G G G G G G G R R R R R R &08b0 5b 6e 71 80 9d a3 a9 ec 01 d5 36 30 92 c3 48 86 ; OS envelope storage area &08c0 08 00 00 00 00 00 00 7e 00 ff f6 7e 7e 00 00 00 ; envelope 1 &08d0 01 02 00 00 64 00 00 7e ff 00 f8 7e 00 00 00 00 ; envelope 2 &08e0 04 02 fe 00 06 05 00 7e 00 00 fb 7e 00 00 00 00 ; envelope 3 ; energy_coordinates_table &08f0 bc e8 81 8e b5 c2 de e5 ca ec e6 d3 9e 8f 92 89 ; encrypted_completion_message &0900 25 b5 d5 c3 cd d5 f1 ad aa b3 c3 cb cd c9 df c3 ; VDU 28,3,26,16,17; COLOUR 129; COLOUR 3; CLS ; VDU 28,0,31,19,8 &0910 f6 94 d1 d9 a0 b5 ac c5 d2 f2 9f db cb f9 9b cf ; TAB(&04, &0a) ; "Incredible !" &0920 ea dd 8a 82 9e a1 a3 e7 e1 ee e6 ea ec fa e8 e4 ; TAB(&04, &0d) ; "You Are Now" &0930 dc 9e 93 89 99 83 8c 92 81 90 9c 8f 18 89 8a 8a ; TAB(&05, &11) ; "of Citadel" &0940 ff e7 fb ; TAB(&07, &0f) ; "Ruler" ; VDU 17,128 ; reprogramming_string &0943 67 6e 69 6d 6d 61 72 67 6f 72 50 65 52 09 04 1f ; COLOUR 5; TAB(&04, &09); "ReProgramming" &0953 05 11 ; sprite_data ; sprite &00 (CRYSTAL_RKM) &0955 23 00 00 ; background, type 0, animation 0, countdown 1 &0958 06 95 ; 10x12 pixels, four colours: KRKM, new bitmap &095a 00 00 00 c4 f5 f5 00 31 00 00 00 c4 f5 f5 f5 f5 &096a f5 f5 00 31 c4 88 f5 f6 f5 f5 f5 f9 31 22 ; sprite &01 (CRYSTAL_YKW) &0978 06 00 00 ; background, type 0, animation 0, countdown 1 &097b 0e 9f 23 ; 10x12 pixels, four colours: KYKW, clone bitmap ; sprite &02 (CRYSTAL_CKM) &097e 06 00 00 ; background, type 0, animation 0, countdown 1 &0981 1a 97 29 ; 10x12 pixels, four colours: KCKM, clone bitmap ; sprite &03 (CRYSTAL_CKG) &0984 06 00 00 ; background, type 0, animation 0, countdown 1 &0987 1a 8b 2f ; 10x12 pixels, four colours: KCKG, clone bitmap ; sprite &04 (CRYSTAL_GKY) &098a 06 00 00 ; background, type 0, animation 0, countdown 1 &098d 0a 8f 35 ; 10x12 pixels, four colours: KGKY, clone bitmap ; sprite &05 # Unused sprite, possibly a sixth crystal &0990 06 80 00 ; painful background, type 0, animation 0, countdown 1 &0993 ae 6f 3b ; 8x12 pixels, four colours: KYMY, clone bitmap ; sprite &06 (OBJECT_PLINTH) &0996 0c 60 00 ; obstacle, type 0, animation 0, countdown 1 &0999 64 81 ; 10x4 pixels, two colours: YR, new bitmap &099b d7 c3 c3 c3 eb &09a0 c8 80 ; 10x4 pixels, two colours: CG, keep bitmap ; sprite &07 (ENERGY_GREEN) &09a2 1d 00 00 ; background, type 0, animation 0, countdown 1 &09a5 8b 59 ; 6x16 pixels, four colours: KGBC, new bitmap &09a7 c0 0c 77 77 10 01 f7 7b 55 5a 55 56 b7 77 55 a5 &09b7 66 66 bb 77 5a 55 66 55 ; sprite &08 (ENERGY_RED) &09bf 06 00 00 ; background, type 0, animation 0, countdown 1 &09c2 87 57 1d ; 6x16 pixels, four colours: KRBM, clone bitmap ; sprite &09 (EMPTY_BUCKET) &09c5 2d 00 00 ; background, type 0, animation 0, countdown 1 &09c8 0b 89 ; 10x16 pixels, four colours: KGKG, new bitmap &09ca 00 dd 00 ff aa ff 00 ff 00 77 dd d5 ff ff ff ff &09da ff ff 77 75 44 44 ff fd ff ff ff f7 11 11 00 00 &09ea dd d5 ff f5 77 75 00 00 ; sprite &0a (FULL_BUCKET) &09f2 06 00 00 ; background, type 0, animation 0, countdown 1 &09f5 0b 93 2d ; 10x16 pixels, four colours: KGKB, clone bitmap ; sprite &0b (WELL_BUCKET) &09f8 06 20 30 ; climbable, type 0, animation 0, countdown 4 &09fb 27 97 33 ; 10x16 pixels, four colours: KRRM, clone bitmap ; sprite &0c (WATER_SURFACE) &09fe 0f 00 00 ; background, type 0, animation 0, countdown 1 &0a01 d1 81 ; 10x8 pixels, two colours: CB, new bitmap &0a03 90 90 90 90 90 00 00 00 00 00 ; sprite &0d (FROZEN_WATER_SURFACE) &0a0d 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &0a10 f9 83 0f ; 10x8 pixels, two colours: WC, clone bitmap ; sprite &0e (ICE_CRYSTAL) &0a13 19 00 00 ; background, type 0, animation 0, countdown 1 &0a16 1f 81 ; 10x16 pixels, two colours: KW, new bitmap &0a18 f7 fe 5d ff f6 fd d6 96 96 fc ff 5e 59 5b fe 7f &0a28 ff d7 ff 7f ; sprite &0f (SWITCH) &0a2c 17 00 00 ; background, type 0, animation 0, countdown 1 &0a2f 09 35 ; 4x8 pixels, four colours: KGKM, new bitmap &0a31 ff 40 00 15 00 00 48 8a &0a39 09 35 ; 4x8 pixels, four colours: KGKM, new bitmap &0a3b 00 00 00 04 04 ff 51 00 ; sprite &10 (ANTENNA) &0a43 06 00 00 ; background, type 0, animation 0, countdown 1 &0a46 cd 3f 17 ; 4x8 pixels, four colours: KYCW, clone bitmap ; sprite &11 (IMP_STATUE) &0a49 11 00 00 ; background, type 0, animation 0, countdown 1 &0a4c 0a 61 ; 8x12 pixels, two colours: KG, new bitmap &0a4e fc c7 02 ff 5f 45 8a e8 fd 2a 8f ea ; sprite &12 (CHAIN_LINK) &0a5a 0b 20 00 ; climbable, type 0, animation 0, countdown 1 &0a5d 18 49 ; 6x4 pixels, four colours: KCKG, new bitmap &0a5f c8 cc 5f 5a 32 33 ; sprite &13 (CANNONBALL) &0a65 1d 20 00 ; climbable, type 0, animation 0, countdown 1 &0a68 1a 79 ; 8x12 pixels, four colours: KCKC, new bitmap &0a6a 00 00 a8 cf aa ff 20 03 0c cc b6 66 f5 75 3f ff &0a7a c8 00 eb be 77 ff fb 32 ; sprite &14 (GUNPOWDER) &0a82 06 00 00 ; background, type 0, animation 0, countdown 1 &0a85 2e 77 1d ; 8x12 pixels, four colours: KYRM, clone bitmap ; sprite &15 (RAW_CHICKEN) &0a88 0f 00 00 ; background, type 0, animation 0, countdown 1 &0a8b 0d 81 ; 10x8 pixels, two colours: KY, new bitmap &0a8d 07 f8 d0 c6 f8 ff 77 18 0c 52 ; sprite &16 (COOKED_CHICKEN) &0a97 06 00 00 ; background, type 0, animation 0, countdown 1 &0a9a 05 83 0f ; 10x8 pixels, two colours: KR, clone bitmap ; sprite &17 (PAINFUL_SPHERE) &0a9d 2f 84 02 ; painful background, type 4, animation 2, countdown 1 &0aa0 37 85 ; 10x16 pixels, four colours: KMRR, new bitmap &0aa2 00 c8 c7 da d7 da 17 da 00 12 d7 a7 d7 a7 d7 a7 &0ab2 d7 a7 d7 a7 da d7 da d7 da d7 da d7 da d7 84 00 &0ac2 a7 d4 a7 d7 a7 d3 23 00 &0aca 5b 88 ; 10x16 pixels, four colours: KCGG, keep bitmap ; sprite &18 (BARREL) &0acc 06 20 00 ; climbable, type 0, animation 0, countdown 1 &0acf 8b 9b 2f ; 10x16 pixels, four colours: KGBC, clone bitmap ; sprite &19 (SNOWBALL) &0ad2 06 80 70 ; painful background, type 0, animation 0, countdown 13 &0ad5 ff 9b 35 ; 10x16 pixels, four colours: KWWC, clone bitmap ; sprite &1a (BLOCK_BLACK) &0ad8 0b 00 00 ; background, type 0, animation 0, countdown 1 &0adb 01 41 ; 6x8 pixels, two colours: KK, new bitmap &0add d5 04 84 7f 88 2a ; sprite &1b (SKULL) &0ae3 06 00 00 ; background, type 0, animation 0, countdown 1 &0ae6 09 43 0b ; 6x8 pixels, two colours: KG, clone bitmap ; sprite &1c (BONE_CYAN) &0ae9 08 00 00 ; background, type 0, animation 0, countdown 1 &0aec 18 41 ; 6x4 pixels, two colours: KC, new bitmap &0aee 82 c3 41 ; sprite &1d (BONE_MAGENTA) &0af1 06 00 00 ; background, type 0, animation 0, countdown 1 &0af4 14 43 08 ; 6x4 pixels, two colours: KM, clone bitmap ; sprite &1e (IRON_BAR) &0af7 06 20 00 ; climbable, type 0, animation 0, countdown 1 &0afa d8 43 0e ; 6x4 pixels, two colours: CC, clone bitmap ; sprite &1f # Unused sprite, possibly intended as a gold bar &0afd 06 20 00 ; climbable, type 0, animation 0, countdown 1 &0b00 6c 43 14 ; 6x4 pixels, two colours: YY, clone bitmap ; sprite &20 (PILLAR) &0b03 23 00 00 ; background, type 0, animation 0, countdown 1 &0b06 08 99 ; 10x4 pixels, four colours: KGKC, new bitmap &0b08 cc 00 51 7c 57 5f 5c 53 11 00 &0b12 18 8d ; 10x4 pixels, four colours: KCKY, new bitmap &0b14 00 0c 4c 77 9f 55 13 55 00 01 &0b1e 04 55 ; 6x4 pixels, four colours: KRKM, new bitmap &0b20 cc 8c 95 56 12 11 2d 00 00 af ; sprite &21 (CROWN_YMR) &0b26 2d 00 00 ; background, type 0, animation 0, countdown 1 &0b29 af 85 ; 10x16 pixels, four colours: KYMR, new bitmap &0b2b 00 31 00 04 f5 55 00 01 00 c4 55 11 44 0c a5 55 &0b3b 11 03 55 44 1d 55 77 55 aa a5 dd 55 47 55 99 54 &0b4b 66 65 ff f5 99 95 66 51 ; sprite &22 (CROWN_GYY) &0b53 06 00 00 ; background, type 0, animation 0, countdown 1 &0b56 6b 8f 2d ; 10x16 pixels, four colours: KGYY, clone bitmap ; sprite &23 (CROWN_RMM) &0b59 06 00 00 ; background, type 0, animation 0, countdown 1 &0b5c a7 97 33 ; 10x16 pixels, four colours: KRMM, clone bitmap ; sprite &24 (DRAGON_FIGURINE) &0b5f 2d 00 00 ; background, type 0, animation 0, countdown 1 &0b62 67 95 ; 10x16 pixels, four colours: KRYM, new bitmap &0b64 21 3d 00 88 0a 55 00 22 84 c7 7d 7c 00 31 a5 55 &0b74 00 c4 d7 d3 40 0c be be 55 5e fe be 10 02 8c ba &0b84 be 00 be b0 be 00 32 ba ; sprite &25 (TOP_OF_ROPE) &0b8c 19 20 00 ; climbable, type 0, animation 0, countdown 1 &0b8f 66 55 ; 6x12 pixels, four colours: KRYM, new bitmap &0b91 eb eb 6f 6f 7d 7d eb eb 6f 6f 00 31 00 00 40 00 &0ba1 7d 7c &0ba3 66 56 ; 6x12 pixels, four colours: KRYM, flip bitmap ; sprite &26 (SPARK) &0ba5 0b 00 02 ; background, type 0, animation 2, countdown 1 &0ba8 0e 21 ; 4x12 pixels, two colours: KY, new bitmap &0baa 7d a2 1d e2 1d e2 ; sprite &27 (LIFT) &0bb0 13 f1 17 ; painful obstacle, unused_flag, type 1, animation 7, countdown 2 &0bb3 64 95 ; 10x4 pixels, four colours: KRYM, new bitmap &0bb5 5a f5 5a f5 5a f5 5a f5 5a f5 &0bbf ac 84 ; 10x4 pixels, four colours: KYMR, keep bitmap &0bc1 34 8c ; 10x4 pixels, four colours: KMRY, keep bitmap ; sprite &28 (GOOGLY_FACE) &0bc3 2f 81 42 ; painful background, type 1, animation 2, countdown 5 &0bc6 5b 8d ; 10x16 pixels, four colours: KCGY, new bitmap &0bc8 86 40 02 9a 00 0a 08 aa 02 94 44 55 98 05 aa aa &0bd8 64 05 11 55 55 68 df 33 ff ff 7c cf 99 a2 88 00 &0be8 e0 a8 f0 8a b8 a2 22 00 &0bf0 5b 8e ; 10x16 pixels, four colours: KCGY, flip bitmap ; sprite &29 (ROPE_CLIMBER) &0bf2 2f 81 28 ; painful background, type 1, animation 8, countdown 3 &0bf5 67 99 ; 10x16 pixels, four colours: KRYC, new bitmap &0bf7 00 04 04 5d 40 10 54 07 01 11 44 00 09 4b 69 69 &0c07 45 21 00 00 00 00 4b 4b 69 69 e1 e1 00 00 00 00 &0c17 4f 00 69 cc e3 c0 00 00 &0c1f e3 9e ; 10x16 pixels, previous colours, flip bitmap ; sprite &2a (MAGIC) &0c21 47 82 06 ; painful background, type 2, animation 6, countdown 1 &0c24 aa 85 ; 10x12 pixels, four colours: KGMR, new bitmap &0c26 00 08 45 40 01 00 0c 00 3f 30 a8 00 20 00 cf c0 &0c36 03 00 00 02 0c fc 00 30 04 54 80 10 a2 00 &0c44 5e 8e ; 10x12 pixels, four colours: KWGY, flip bitmap &0c46 a6 85 ; 10x12 pixels, four colours: KRMR, new bitmap &0c48 0c 00 3f 30 00 80 02 a2 00 00 04 54 00 10 08 a8 &0c58 04 20 15 10 00 00 0c fc 00 30 8a 80 02 00 &0c66 7a 8a ; 10x12 pixels, four colours: KCYG, flip bitmap ; sprite &2b (SNAKE) &0c68 33 80 43 ; painful background, type 0, animation 3, countdown 5 &0c6b 0b 81 ; 10x16 pixels, two colours: KG, new bitmap &0c6d ff f6 f1 f8 ff 47 8f 0d 00 aa f5 40 0b 2f f4 5f &0c7d 81 f0 42 af &0c81 e3 82 ; 10x16 pixels, previous colours, flip bitmap &0c83 e3 81 ; 10x16 pixels, previous colours, new bitmap &0c85 f4 68 10 80 fa 5f fd d0 02 bf f5 40 2f ff fd 5f &0c95 01 e0 d0 2b &0c99 e3 82 ; 10x16 pixels, previous colours, flip bitmap ; sprite &2c (PULSING_CIRCLES) &0c9b 31 82 19 ; painful background, type 2, animation 9, countdown 2 &0c9e 87 8d ; 10x16 pixels, four colours: KRBY, new bitmap &0ca0 04 45 45 df 55 ff 15 7f 01 15 dd dd ba 66 a5 5f &0cb0 ea 99 77 77 dd dd 66 ab f5 5a 99 ae 77 77 54 40 &0cc0 fd 54 ff 55 f7 51 51 10 &0cc8 2f 88 ; 10x16 pixels, four colours: KYRG, keep bitmap &0cca 73 84 ; 10x16 pixels, four colours: KBYR, keep bitmap ; sprite &2d (FIRE) &0ccc 5b 87 13 ; painful background, type 7, animation 3, countdown 2 &0ccf 2f 95 ; 10x16 pixels, four colours: KYRM, new bitmap &0cd1 00 00 00 cb 0f aa da 37 04 03 00 00 bb bb aa a6 &0ce1 8a aa 73 3e cc c8 a6 aa 66 55 69 aa e3 ee cc cc &0cf1 55 66 55 55 a9 ee e3 00 &0cf9 e3 9e ; 10x16 pixels, previous colours, flip bitmap &0cfb e3 9d ; 10x16 pixels, previous colours, new bitmap &0cfd 0c c0 be ea 34 07 c8 aa 13 37 cc cc aa aa aa a6 &0d0d ee ee 00 00 bb bb aa a9 99 55 aa 65 33 ee bc cc &0d1d 56 66 55 55 9a 99 e3 33 &0d25 e3 9e ; 10x16 pixels, previous colours, flip bitmap ; sprite &2e (BENDY_LEGS) &0d27 5b 84 13 ; painful background, type 4, animation 3, countdown 2 &0d2a 2f 89 ; 10x16 pixels, four colours: KYRG, new bitmap &0d2c 80 04 11 96 80 96 11 96 00 02 84 84 96 92 96 80 &0d3c 96 96 12 12 00 00 9c cc 90 00 93 33 00 00 00 00 &0d4c cc c5 00 04 33 31 00 00 &0d54 e3 9e ; 10x16 pixels, previous colours, flip bitmap &0d56 2f 99 ; 10x16 pixels, four colours: KYRC, new bitmap &0d58 08 00 01 19 08 09 01 19 00 00 48 48 69 69 69 68 &0d68 69 69 21 21 40 00 29 c3 09 0c 69 30 20 00 cc 04 &0d78 00 31 3c 00 00 35 00 00 &0d80 e3 9e ; 10x16 pixels, previous colours, flip bitmap ; sprite &2f (BLOCK) &0d82 1d 83 05 ; painful background, type 3, animation 5, countdown 1 &0d85 af 81 ; 10x16 pixels, two colours: MY, new bitmap &0d87 4a 3f 3f 3f 85 aa ff ff ff 55 aa ff ff ff 55 a1 &0d97 fc fc fc 52 &0d9b 2f 80 ; 10x16 pixels, two colours: RY, keep bitmap &0d9d cf 80 ; 10x16 pixels, two colours: CY, keep bitmap ; sprite &30 (BLOCK_BLUE) &0d9f 06 e3 00 ; painful obstacle, type 3, animation 0, countdown 1 &0da2 9b 83 1d ; 10x16 pixels, two colours: BC, clone bitmap ; sprite &31 (TENTACLES) &0da5 2f 80 22 ; painful background, type 0, animation 2, countdown 3 &0da8 5b 8d ; 10x16 pixels, four colours: KCGY, new bitmap &0daa 00 08 00 fb c0 03 fb 80 03 af ca fa e3 00 2f cc &0dba 00 00 af af fa fc 00 be 00 0a 0c be af 22 08 69 &0dca ba 95 56 9a aa 65 02 96 &0dd2 5b 8e ; 10x16 pixels, four colours: KCGY, flip bitmap ; sprite &32 (STEAM) &0dd4 15 80 16 ; painful background, type 0, animation 6, countdown 2 &0dd7 14 81 ; 10x4 pixels, two colours: KM, new bitmap &0dd9 ed b7 df de f7 &0dde 18 82 ; 10x4 pixels, two colours: KC, flip bitmap &0de0 04 81 ; 10x4 pixels, two colours: KR, new bitmap &0de2 f7 fe bd e7 ed &0de7 08 82 ; 10x4 pixels, two colours: KG, flip bitmap ; sprite &33 (CAULDRON) &0de9 27 80 00 ; painful background, type 0, animation 0, countdown 1 &0dec a6 8d ; 10x12 pixels, four colours: KRMY, new bitmap &0dee bb bb 66 62 55 56 55 54 55 55 bb bb 26 66 60 55 &0dfe 45 55 55 55 cc cc aa 20 55 00 55 80 11 12 &0e0c ca 8c ; 10x12 pixels, four colours: KGCY, keep bitmap &0e0e ee 9c ; 10x12 pixels, four colours: KYWW, keep bitmap ; sprite &34 (LOTUS_FLOWER) &0e10 27 80 00 ; painful background, type 0, animation 0, countdown 1 &0e13 17 e1 ; 16x16 pixels, two colours: KM, new bitmap &0e15 fd e5 86 99 66 49 da fe 70 86 18 86 49 24 49 b0 &0e25 c7 18 61 06 09 92 24 cb 1f 43 60 0c 0c 90 83 2f &0e35 97 e0 ; 16x16 pixels, two colours: BM, keep bitmap ; sprite &35 (LOTUS_STEM) &0e37 0d 80 00 ; painful background, type 0, animation 0, countdown 1 &0e3a 99 61 ; 8x8 pixels, two colours: BC, new bitmap &0e3c f4 01 12 f8 f4 21 02 f8 ; sprite &36 (MUMMY) &0e44 33 e5 34 ; painful obstacle, type 5, animation 4, countdown 4 &0e47 1b 9d ; 10x16 pixels, four colours: KCKW, new bitmap &0e49 00 00 c5 b9 f5 b9 01 31 00 00 00 31 f5 c4 f5 e5 &0e59 31 00 00 00 f4 00 f5 f5 f5 f4 f5 31 01 31 00 00 &0e69 f5 50 c4 c4 31 31 00 00 &0e71 e3 9e ; 10x16 pixels, previous colours, flip bitmap &0e73 fb 9c ; 10x16 pixels, four colours: KCWW, keep bitmap &0e75 e3 9e ; 10x16 pixels, previous colours, flip bitmap ; sprite &37 (CHAIR) &0e77 10 20 00 ; climbable, type 0, animation 0, countdown 1 &0e7a 0a 41 ; 6x12 pixels, two colours: KG, new bitmap &0e7c ff ff 55 f2 f3 51 8a cf 45 &0e85 0e 42 ; 6x12 pixels, two colours: KY, flip bitmap ; sprite &38 # Unused sprite, cyan chair &0e87 06 20 00 ; climbable, type 0, animation 0, countdown 1 &0e8a 1a 43 10 ; 6x12 pixels, two colours: KC, clone bitmap ; sprite &39 (SHIELD) &0e8d 23 00 00 ; background, type 0, animation 0, countdown 1 &0e90 bb 49 ; 6x16 pixels, four colours: KCMG, new bitmap &0e92 5a aa 5a aa 11 11 aa ff aa ff 11 11 ff ff f7 75 &0ea2 11 00 f7 51 11 00 00 00 &0eaa 4b 48 ; 6x16 pixels, four colours: KGGG, keep bitmap &0eac 7b 46 ; 6x16 pixels, four colours: KCYR, flip bitmap &0eae 4b 48 ; 6x16 pixels, four colours: KGGG, keep bitmap ; sprite &3a (TRAMPOLINE) &0eb0 19 20 00 ; climbable, type 0, animation 0, countdown 1 &0eb3 5d 8d ; 10x8 pixels, four colours: KWGY, new bitmap &0eb5 d8 08 dc 2c d0 00 d2 82 d3 03 28 08 0c 2c f0 00 &0ec5 02 82 c3 03 ; sprite &3b (C) &0ec9 15 00 00 ; background, type 0, animation 0, countdown 1 &0ecc 19 7d ; 8x8 pixels, four colours: KCKW, new bitmap &0ece c7 a0 51 a2 5c ec 15 55 0a 7c 2a 15 ce c5 55 51 ; sprite &3c (PHARAOH_MASK) &0ede 2d 00 00 ; background, type 0, animation 0, countdown 1 &0ee1 57 9d ; 10x16 pixels, four colours: KMGW, new bitmap &0ee3 00 44 45 a0 ff 5a 15 a0 00 11 05 05 22 aa aa aa &0ef3 88 aa 05 05 05 05 a8 88 a0 aa a2 22 05 05 01 00 &0f03 00 00 a5 a5 00 00 04 00 ; sprite &3d (HORNED_SKULL) &0f0b 1b 80 00 ; painful background, type 0, animation 0, countdown 1 &0f0e 0f 81 ; 10x16 pixels, two colours: KY, new bitmap &0f10 55 f8 ff fd 50 ff 12 01 03 ba ff 05 40 40 af ff &0f20 57 10 12 ff &0f24 17 80 ; 10x16 pixels, two colours: KM, keep bitmap ; sprite &3e (TEMPLE_GUARDIAN) &0f26 06 84 00 ; painful background, type 4, animation 0, countdown 1 &0f29 07 83 1b ; 10x16 pixels, two colours: KR, clone bitmap ; sprite &3f # Unused sprite, padding to align doors on nibble &0f2c 01 ; sprite &40 (DOOR_MW) # Obstacle state of doors is set when plotting &0f2d 19 20 00 ; climbable, type 0, animation 0, countdown 1 &0f30 f7 81 ; 10x16 pixels, two colours: WM, new bitmap &0f32 00 2b 55 e8 ff 2b fd 5a 01 e8 e8 7f a5 40 2b 00 &0f42 e8 55 2b ff ; sprite &41 (DOOR_GY) &0f46 06 20 00 ; climbable, type 0, animation 0, countdown 1 &0f49 6b 83 19 ; 10x16 pixels, two colours: YG, clone bitmap ; sprite &42 (DOOR_RY) &0f4c 06 20 00 ; climbable, type 0, animation 0, countdown 1 &0f4f 67 83 1f ; 10x16 pixels, two colours: YR, clone bitmap ; sprite &43 (DOOR_GC) &0f52 06 20 00 ; climbable, type 0, animation 0, countdown 1 &0f55 cb 83 25 ; 10x16 pixels, two colours: CG, clone bitmap ; sprite &44 (DOOR_CW) &0f58 06 20 00 ; climbable, type 0, animation 0, countdown 1 &0f5b fb 83 2b ; 10x16 pixels, two colours: WC, clone bitmap ; sprite &45 (DOOR_RM) &0f5e 06 20 00 ; climbable, type 0, animation 0, countdown 1 &0f61 a7 83 31 ; 10x16 pixels, two colours: MR, clone bitmap ; sprite &46 (DOOR_BC) &0f64 06 20 00 ; climbable, type 0, animation 0, countdown 1 &0f67 d3 83 37 ; 10x16 pixels, two colours: CB, clone bitmap ; sprite &47 (DOOR_RW) &0f6a 06 20 00 ; climbable, type 0, animation 0, countdown 1 &0f6d e7 83 3d ; 10x16 pixels, two colours: WR, clone bitmap ; sprite &48 (KEY_MW) &0f70 1d 00 00 ; background, type 0, animation 0, countdown 1 &0f73 17 5d ; 6x16 pixels, four colours: KMKW, new bitmap &0f75 c7 77 5d aa 15 77 7c 00 d5 77 51 00 00 00 77 77 &0f85 00 55 00 00 77 77 00 55 ; sprite &49 (KEY_GY) &0f8d 06 00 00 ; background, type 0, animation 0, countdown 1 &0f90 6b 4f 1d ; 6x16 pixels, four colours: KGYY, clone bitmap ; sprite &4a (KEY_RY) &0f93 06 00 00 ; background, type 0, animation 0, countdown 1 &0f96 67 4f 23 ; 6x16 pixels, four colours: KRYY, clone bitmap ; sprite &4b (KEY_GC) &0f99 06 00 00 ; background, type 0, animation 0, countdown 1 &0f9c cb 5b 29 ; 6x16 pixels, four colours: KGCC, clone bitmap ; sprite &4c (KEY_CW) &0f9f 06 00 00 ; background, type 0, animation 0, countdown 1 &0fa2 1b 5f 2f ; 6x16 pixels, four colours: KCKW, clone bitmap ; sprite &4d (KEY_RM) &0fa5 06 00 00 ; background, type 0, animation 0, countdown 1 &0fa8 07 57 35 ; 6x16 pixels, four colours: KRKM, clone bitmap ; sprite &4e (KEY_BC) &0fab 06 00 00 ; background, type 0, animation 0, countdown 1 &0fae 9b 53 3b ; 6x16 pixels, four colours: KCBB, clone bitmap ; sprite &4f (KEY_RW) &0fb1 06 00 00 ; background, type 0, animation 0, countdown 1 &0fb4 27 5f 41 ; 6x16 pixels, four colours: KRRW, clone bitmap ; sprite &50 (MONK) &0fb7 af 86 23 ; painful background, type 6, animation 3, countdown 3 &0fba 67 00 95 ; 10x32 pixels, four colours: KRYM, new bitmap &0fbd 00 cc 07 ff 05 55 00 15 00 11 ff 3b fc 08 55 54 &0fcd 55 11 10 00 33 3f 00 0c 44 77 11 15 00 00 ff ff &0fdd ff 75 75 df 55 57 00 00 fc cc 7f ff fd dd 77 77 &0fed 01 11 cc cc f7 77 df ff 77 7d 11 11 cc cc 7f ff &0ffd f5 ff df ff 11 55 c7 ff ff 57 f7 5f f5 75 55 55 &100d 6b 00 8e ; 10x32 pixels, four colours: KGYY, flip bitmap &1010 7b 00 9d ; 10x32 pixels, four colours: KCYW, new bitmap &1013 0c cf 77 ff 55 55 01 55 00 01 f3 b3 c0 80 55 44 &1023 51 11 11 00 33 ff 00 cf 45 77 11 55 00 00 ff ff &1033 ff 55 75 ff 55 55 00 00 cc cc ff f7 dd df 77 77 &1043 11 11 cc 4c 7d fd ff f7 77 df 11 11 cc cc 7f ff &1053 df ff ff f7 15 55 c7 ff ff ff ff ff 57 77 55 55 &1063 6b 00 9a ; 10x32 pixels, four colours: KGYC, flip bitmap ; sprite &51 (STONES_RYM) &1066 45 68 00 ; obstacle, type 8, animation 0, countdown 1 &1069 67 f5 ; 16x16 pixels, four colours: KRYM, new bitmap &106b bb a5 ff ea bf fa ea ee a6 6a 59 9a ea bf ff a6 &107b 59 ab 5a fa ee ff ff ff fa ee ee ff bb ba 65 af &108b ba 55 99 55 fe ee a6 ab a9 95 fb a9 ee fa fb ba &109b 55 6a 9a ee ab bb ab ff 5a bb 55 55 6a 9a 55 af ; sprite &52 (STONES_RKM) &10ab 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &10ae 07 f7 45 ; 16x16 pixels, four colours: KRKM, clone bitmap ; sprite &53 (STONES_CBC) &10b1 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &10b4 9b fb 4b ; 16x16 pixels, four colours: KCBC, clone bitmap ; sprite &54 (STONES_GYG) &10b7 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &10ba 6b eb 51 ; 16x16 pixels, four colours: KGYG, clone bitmap ; sprite &55 (STONES_YCG) &10bd 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &10c0 cf eb 57 ; 16x16 pixels, four colours: KYCG, clone bitmap ; sprite &56 (STONES_CKG) &10c3 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &10c6 1b eb 5d ; 16x16 pixels, four colours: KCKG, clone bitmap ; sprite &57 (STONES_MRM) &10c9 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &10cc 37 f7 63 ; 16x16 pixels, four colours: KMRM, clone bitmap ; sprite &58 (BRICKS_RYM) &10cf 2d 68 00 ; obstacle, type 8, animation 0, countdown 1 &10d2 67 95 ; 10x16 pixels, four colours: KRYM, new bitmap &10d4 af ff ab bb af ff af ff ae ee a5 55 a5 55 a5 55 &10e4 a6 66 a5 55 af ff af ff af ff af ff af ff a9 99 &10f4 a5 55 a5 55 a5 55 a5 55 ; sprite &59 (BRICKS_GYR) &10fc 06 61 00 ; obstacle, type 1, animation 0, countdown 1 &10ff 6b 87 2d ; 10x16 pixels, four colours: KGYR, clone bitmap ; sprite &5a (BRICKS_MBG) &1102 06 62 00 ; obstacle, type 2, animation 0, countdown 1 &1105 97 8b 33 ; 10x16 pixels, four colours: KMBG, clone bitmap ; sprite &5b (BRICKS_CKG) &1108 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &110b 1b 8b 39 ; 10x16 pixels, four colours: KCKG, clone bitmap ; sprite &5c (BRICKS_RY) &110e 0d 60 00 ; obstacle, type 0, animation 0, countdown 1 &1111 65 61 ; 8x8 pixels, two colours: YR, new bitmap &1113 ea c0 c0 c0 c0 c0 ea c0 ; sprite &5d (BRICKS_MR) &111b 06 61 00 ; obstacle, type 1, animation 0, countdown 1 &111e 35 63 0d ; 8x8 pixels, two colours: RM, clone bitmap ; sprite &5e (BRICKS_GC) &1121 06 62 00 ; obstacle, type 2, animation 0, countdown 1 &1124 c9 63 13 ; 8x8 pixels, two colours: CG, clone bitmap ; sprite &5f (BRICKS_CB) &1127 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &112a 99 63 19 ; 8x8 pixels, two colours: BC, clone bitmap ; sprite &60 (STRIPES_BC) &112d 0d 60 00 ; obstacle, type 0, animation 0, countdown 1 &1130 d1 61 ; 8x8 pixels, two colours: CB, new bitmap &1132 0b bf f4 40 f4 40 0b bf ; sprite &61 (STRIPES_CG) &113a 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &113d 59 63 0d ; 8x8 pixels, two colours: GC, clone bitmap ; sprite &62 (URN) &1140 35 20 00 ; climbable, type 0, animation 0, countdown 1 &1143 77 85 ; 10x16 pixels, four colours: KMYR, new bitmap &1145 00 00 d4 c7 d7 d7 d3 17 00 00 cb e7 d7 eb d7 db &1155 db e7 17 eb db e7 d7 eb e7 db db e7 d7 eb c4 00 &1165 d7 d7 e7 d7 d7 d7 13 00 &116d 6b 8a ; 10x16 pixels, four colours: KGYG, flip bitmap &116f 4b 98 ; 10x16 pixels, four colours: KGGC, keep bitmap &1171 ff 8c ; 10x16 pixels, four colours: KWWY, keep bitmap &1173 2f 8c ; 10x16 pixels, four colours: KYRY, keep bitmap ; sprite &63 (TABLE) &1175 1d 20 00 ; climbable, type 0, animation 0, countdown 1 &1178 1a e1 ; 16x12 pixels, two colours: KC, new bitmap &117a 07 00 03 03 03 03 00 0b ff 00 f0 f0 f0 f0 00 ff &118a ff 00 ff ff ff ff 00 ff ; sprite &64 (WELL_WHEEL) &1192 23 20 00 ; climbable, type 0, animation 0, countdown 1 &1195 0a 61 ; 8x12 pixels, two colours: KG, new bitmap &1197 02 81 f8 ff aa ff 05 ea 81 f0 50 00 &11a3 e2 62 ; 8x12 pixels, previous colours, flip bitmap &11a5 e2 61 ; 8x12 pixels, previous colours, new bitmap &11a7 42 0f 05 00 aa ff 50 ab 80 42 2f ff &11b3 e2 62 ; 8x12 pixels, previous colours, flip bitmap ; sprite &65 (WITCH) &11b5 2f 84 00 ; painful background, type 4, animation 0, countdown 1 &11b8 4f 95 ; 10x16 pixels, four colours: KYGM, new bitmap &11ba 00 88 8a aa a6 d1 a0 15 00 00 88 8a a6 ec 55 15 &11ca 55 05 10 00 0c cc ff fc ff 0f 10 03 00 00 dd 50 &11da c3 f4 f0 f5 55 01 51 00 &11e2 1f 98 ; 10x16 pixels, four colours: KWKC, keep bitmap ; sprite &66 (OCTOPUS) &11e4 0f 84 12 ; painful background, type 4, animation 2, countdown 2 &11e7 05 61 ; 8x8 pixels, two colours: KR, new bitmap &11e9 c5 04 08 e2 3f 5f a1 8f &11f1 15 62 ; 8x8 pixels, two colours: KM, flip bitmap ; sprite &67 (STARFISH) &11f3 0f 82 12 ; painful background, type 2, animation 2, countdown 2 &11f6 09 61 ; 8x8 pixels, two colours: KG, new bitmap &11f8 ff 95 fe f6 da 3f 29 ff &1200 19 62 ; 8x8 pixels, two colours: KC, flip bitmap ; sprite &68 (STRIPED_PILLAR) &1202 13 20 00 ; climbable, type 0, animation 0, countdown 1 &1205 f9 81 ; 10x8 pixels, two colours: WC, new bitmap &1207 aa 00 ff 00 55 aa 00 ff 00 55 &1211 ad 80 ; 10x8 pixels, two colours: MY, keep bitmap &1213 49 80 ; 10x8 pixels, two colours: GG, keep bitmap ; sprite &69 (STATUE) &1215 33 00 4a ; background, type 0, animation a, countdown 5 &1218 17 81 ; 10x16 pixels, two colours: KM, new bitmap &121a 80 fc ff fc 40 55 0f 00 2f aa 7f 82 00 41 bf ff &122a 85 c0 4a ff &122e e3 82 ; 10x16 pixels, previous colours, flip bitmap &1230 07 81 ; 10x16 pixels, two colours: KR, new bitmap &1232 d0 41 00 82 e0 00 55 98 e3 03 ab 00 0f 00 ff f4 &1242 00 ff 00 f8 &1246 e3 82 ; 10x16 pixels, previous colours, flip bitmap ; sprite &6a (CANNON) &1248 49 20 00 ; climbable, type 0, animation 0, countdown 1 &124b a7 e9 ; 16x16 pixels, four colours: KRMG, new bitmap &124d fc 84 06 96 96 96 96 96 16 96 02 96 00 96 04 96 &125d 86 96 96 96 df 77 bf dd 96 96 96 96 96 96 96 96 &126d 96 80 96 96 fe de f7 b7 96 96 96 92 96 90 96 94 &127d 00 cf cf ff f3 f0 fc f0 3f ff 00 3f 00 00 00 00 &128d 5b ee ; 16x16 pixels, four colours: KCGY, flip bitmap &128f 7f f8 ; 16x16 pixels, four colours: KWYC, keep bitmap ; sprite &6b (DITHER_YYG) &1291 19 60 00 ; obstacle, type 0, animation 0, countdown 1 &1294 6d 89 ; 10x8 pixels, four colours: KYYG, new bitmap &1296 7d 5e d6 7d b7 d7 7d 6d b5 fd 7d db bd 7d d9 7d &12a6 5f 97 7d 57 ; sprite &6c (DITHER_GCC) &12aa 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &12ad c9 9b 19 ; 10x8 pixels, four colours: KGCC, clone bitmap ; sprite &6d (DITHER_RKM) &12b0 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &12b3 05 97 1f ; 10x8 pixels, four colours: KRKM, clone bitmap ; sprite &6e (DITHER_YKY) &12b6 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &12b9 0d 8f 25 ; 10x8 pixels, four colours: KYKY, clone bitmap ; sprite &6f (DITHER_CWW) &12bc 06 60 00 ; obstacle, type 0, animation 0, countdown 1 &12bf f9 9f 2b ; 10x8 pixels, four colours: KCWW, clone bitmap ; sprite &70 (CURVED_PLATFORM) &12c2 1f 20 00 ; climbable, type 0, animation 0, countdown 1 &12c5 a5 95 ; 10x8 pixels, four colours: KRMM, new bitmap &12c7 aa bf 56 aa 55 56 55 55 55 55 c0 00 bf c0 aa b0 &12d7 56 20 10 00 &12db 4d 88 ; 10x8 pixels, four colours: KYGG, keep bitmap &12dd dd 9a ; 10x8 pixels, four colours: KWCC, flip bitmap &12df 75 8c ; 10x8 pixels, four colours: KMYY, keep bitmap ; sprite &71 (FLAG) &12e1 2b 00 f2 ; background, type 0, animation 2, countdown 100 &12e4 9a a9 ; 12x12 pixels, four colours: KCBG, new bitmap &12e6 55 5a ae dd ff fc bf cc 66 59 99 9a aa aa ea ed &12f6 f3 fc fb fc aa a9 aa aa 55 5a de aa 03 fa cf ba &1306 56 6a 99 9a &130a e2 be ; 12x12 pixels, previous colours, flip bitmap ; sprite &72 (SPLASH) &130c 11 00 02 ; background, type 0, animation 2, countdown 1 &130f 18 81 ; 10x4 pixels, two colours: KC, new bitmap &1311 fe f9 fb f6 fe &1316 e0 81 ; 10x4 pixels, previous colours, new bitmap &1318 79 66 6c 59 d9 ; sprite &73 (SPIKES_MULTICOLOURED) &131d 1f 80 26 ; painful background, type 0, animation 6, countdown 3 &1320 35 8d ; 10x8 pixels, four colours: KMRY, new bitmap &1322 a1 6c a9 4d a1 01 a9 64 a2 00 45 5c 10 00 15 4c &1332 d1 00 11 5c &1336 4d 86 ; 10x8 pixels, four colours: KYGR, flip bitmap &1338 c9 84 ; 10x8 pixels, four colours: KGCR, keep bitmap &133a dd 9a ; 10x8 pixels, four colours: KWCC, flip bitmap ; sprite &74 (SPIKES_MONOCHROME) &133c 15 80 26 ; painful background, type 0, animation 6, countdown 3 &133f 05 81 ; 10x8 pixels, two colours: KR, new bitmap &1341 f5 4b fe d2 ad 68 85 95 1e 68 &134b 15 82 ; 10x8 pixels, two colours: KM, flip bitmap &134d 0d 80 ; 10x8 pixels, two colours: KY, keep bitmap &134f 19 82 ; 10x8 pixels, two colours: KC, flip bitmap ; sprite &75 (TORCH) &1351 3b 80 16 ; painful background, type 0, animation 6, countdown 2 &1354 47 4d ; 6x16 pixels, four colours: KRGY, new bitmap &1356 c3 d7 0f d5 01 d3 78 88 5a aa d2 22 88 88 aa aa &1366 22 22 80 00 aa aa 20 00 &136e e3 5e ; 6x16 pixels, previous colours, flip bitmap &1370 57 4d ; 6x16 pixels, four colours: KMGY, new bitmap &1372 0c 4f 0c 75 03 f5 78 88 5a aa d2 22 88 88 aa aa &1382 22 22 80 00 aa aa 20 00 &138a e3 5e ; 6x16 pixels, previous colours, flip bitmap ; unused &138c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &139c 00 00 00 00 ; room_data ; room &00 &13a0 07 80 ; " " &13a2 18 ; background sprite: &18 (BARREL) &13a3 08 ; room has stars &13a4 00 ; 1 rectangle, 0 triangles &13a5 40 bf ; rectangle: (&0, &4), size (&f, &b) ; room &01 &13a7 38 81 ; "The Pyramid" &13a9 6e ; background sprite: &6e (DITHER_YKY) &13aa 67 ; room has sprites, object, ropes/ladders, pillars, enemies &13ab 30 ; 0 sprites before, 6 sprites after &13ac 28 ; 6 rectangles, 0 triangles &13ad 48 10 ; rectangle: (&8, &4), size (&0, &1) &13af 62 1c ; rectangle: (&2, &6), size (&c, &1) &13b1 c4 02 ; rectangle: (&4, &c), size (&2, &0) &13b3 ca 02 ; rectangle: (&a, &c), size (&2, &0) &13b5 e6 04 ; rectangle: (&6, &e), size (&4, &0) &13b7 a8 00 ; rectangle: (&8, &a), size (&0, &0) &13b9 88 ; object: (&8, &8) &13ba 0c 22 63 ; sprite: &11 (IMP_STATUE) frame 0, y_offset 12, (&3, &6) &13bd 6d ; sprite: (&d, &6) &13be 15 00 e7 62 ; sprite: 6 sprites horizontally, &73 (SPIKES_MULTICOLOURED) frame 1, (&2, &6) &13c2 69 ; sprite: (&9, &6) &13c3 12 08 e9 72 ; sprite: 3 sprites horizontally, &74 (SPIKES_MONOCHROME) frame 1, y_offset 8, (&2, &7) &13c7 7c ; sprite: (&c, &7) &13c8 31 ; 1 rope, 3 ladders &13c9 68 ; rope: (&8, &6) &13ca e5 34 ; ladder, (&5, &e), length &0d, colour 1 &13cc eb 34 ; ladder, (&b, &e), length &0d, colour 3 &13ce f8 27 ; ladder, (&8, &f), length &09, colour 0 &13d0 41 ; 2 pillars, colour 1 &13d1 66 ; pillar: (&6, &6) &13d2 6a ; pillar: (&a, &6) &13d3 31 ; 4 enemies using 2 sprites &13d4 36 ; enemy sprite: &36 (MUMMY) (type &5), slots &1-&4 &13d5 2b ; enemy sprite: &2b (SNAKE) (type &0), slots &5-&8 &13d6 08 c6 ; enemy: slot 1 (MUMMY), (&6, &c), type 5, half_speed &13d8 08 cc ; enemy: slot 1 (MUMMY), (&c, &c), type 5, half_speed &13da 08 a8 ; enemy: slot 1 (MUMMY), (&8, &a), type 5, half_speed &13dc 42 e7 5c ; enemy: slot 5 (SNAKE), (&7, &e), type 0, x_range (&c, &5), x_speed 2 ; room &02 &13df 01 ; copy of room &00 ; room &03 &13e0 01 ; copy of room &00 ; room &04 &13e1 01 ; copy of room &00 ; room &05 &13e2 02 a3 ; copy of room &a3 ; room &06 &13e4 12 82 ; "The Palace" &13e6 55 ; background sprite: &55 (STONES_YCG) &13e7 4c ; room has ropes/ladders, stars, enemies &13e8 10 ; 3 rectangles, 0 triangles &13e9 40 1f ; rectangle: (&0, &4), size (&f, &1) &13eb 60 6c ; rectangle: (&0, &6), size (&c, &6) &13ed b3 3b ; rectangle: (&3, &b), size (&b, &3) &13ef 10 ; 0 ropes, 1 ladder &13f0 fe 08 ; ladder, (&e, &f), length &02, colour 2 &13f2 00 ; 1 enemy using 1 sprite &13f3 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &13f4 08 d6 ; enemy: slot 1 (MONK), (&6, &d), type 6, colour 2 ; room &07 &13f6 01 ; copy of room &00 ; room &08 &13f7 01 ; copy of room &00 ; room &09 &13f8 01 ; copy of room &00 ; room &0a &13f9 01 ; copy of room &00 ; room &0b &13fa 26 83 ; "Central Tower" &13fc 5c ; background sprite: &5c (BRICKS_RY) &13fd 66 ; room has object, ropes/ladders, pillars, enemies &13fe 20 ; 5 rectangles, 0 triangles &13ff 00 bc 40 bf ; rectangle: STA &bc, (&0, &4), size (&f, &b) &1403 00 00 87 22 ; rectangle: STA &00, (&7, &8), size (&2, &2) &1407 b5 06 ; rectangle: (&5, &b), size (&6, &0) &1409 c3 2a ; rectangle: (&3, &c), size (&a, &2) &140b 00 0c 98 00 ; rectangle: STA &0c, (&8, &9), size (&0, &0) &140f f3 ; object: (&3, &f) &1410 10 ; 0 ropes, 1 ladder &1411 e8 25 ; ladder, (&8, &e), length &09, colour 0 &1413 30 ; 1 pillar, colour 0 &1414 ba ; pillar: (&a, &b) &1415 21 ; 3 enemies using 2 sprites &1416 2a ; enemy sprite: &2a (MAGIC) (type &2), slots &1-&4 &1417 2f ; enemy sprite: &2f (BLOCK) (type &3), slots &5-&7 &1418 06 b9 a7 fa ; enemy: slot 1 (MAGIC), (&9, &b), type 2, x_range (&7, &a), y_range (&a, &f), speed (2, 2) &141c 4b c6 ; enemy: slot 5 (BLOCK), (&6, &c), type 3, direction 3, speed 2 &141e 49 e9 ; enemy: slot 5 (BLOCK), (&9, &e), type 3, direction 1, speed 2 ; room &0c &1420 01 ; copy of room &00 ; room &0d &1421 01 ; copy of room &00 ; room &0e &1422 01 ; copy of room &00 ; room &0f &1423 01 ; copy of room &00 ; room &10 &1424 01 ; copy of room &00 ; room &11 &1425 01 ; copy of room &00 ; room &12 &1426 01 ; copy of room &00 ; room &13 &1427 01 ; copy of room &00 ; room &14 &1428 01 ; copy of room &00 ; room &15 &1429 2b 81 ; "The Pyramid" &142b 6e ; background sprite: &6e (DITHER_YKY) &142c 45 ; room has sprites, ropes/ladders, enemies &142d 10 ; 0 sprites before, 2 sprites after &142e 30 ; 7 rectangles, 0 triangles &142f 54 90 ; rectangle: (&4, &5), size (&0, &9) &1431 5b 90 ; rectangle: (&b, &5), size (&0, &9) &1433 7d 50 ; rectangle: (&d, &7), size (&0, &5) &1435 63 0b ; rectangle: (&3, &6), size (&b, &0) &1437 95 15 ; rectangle: (&5, &9), size (&5, &1) &1439 d3 0b ; rectangle: (&3, &d), size (&b, &0) &143b e8 10 ; rectangle: (&8, &e), size (&0, &1) &143d 00 7a 69 ; sprite: &3d (HORNED_SKULL) frame 0, (&9, &6) &1440 a4 ; sprite: (&4, &a) &1441 14 ; 4 ropes, 1 ladder &1442 94 ; rope: (&4, &9) &1443 ab ; rope: (&b, &a) &1444 cd ; rope: (&d, &c) &1445 f8 ; rope: (&8, &f) &1446 68 13 ; ladder, (&8, &6), length &04, colour 0 &1448 30 ; 4 enemies using 1 sprite &1449 30 ; enemy sprite: &30 (BLOCK_BLUE) (type &3), slots &1-&3 &144a 09 67 ; enemy: slot 1 (BLOCK_BLUE), (&7, &6), type 3, direction 1, speed 2 &144c 08 94 ; enemy: slot 1 (BLOCK_BLUE), (&4, &9), type 3, direction 0, speed 2 &144e 06 7b ; enemy: slot 1 (BLOCK_BLUE), (&b, &7), type 3, direction 2, speed 1 &1450 0b dd ; enemy: slot 1 (BLOCK_BLUE), (&d, &d), type 3, direction 3, speed 2 &1452 01 f8 ; unused ; room &16 &1454 1d 82 ; "The Palace" &1456 55 ; background sprite: &55 (STONES_YCG) &1457 21 ; room has sprites, pillars &1458 28 ; 0 sprites before, 5 sprites after &1459 11 ; 3 rectangles, 1 triangle &145a 67 51 ; rectangle: (&7, &6), size (&1, &5) &145c c7 28 ; rectangle: (&7, &c), size (&8, &2) &145e 4f 70 ; rectangle: (&f, &4), size (&0, &7) &1460 ce cf 4f ; triangle: (&e-, &c-), (&f, &c), (&f, &4) &1463 00 a0 16 60 ; sprite: &50 (MONK) frame 0, 7 sprites horizontally, (&0, &6) &1467 32 90 ; sprite: frame 2, (&0, &9) &1469 00 2e c0 ; sprite: &17 (PAINFUL_BALL) frame 0, (&0, &c) &146c d0 ; sprite: (&0, &d) &146d e0 ; sprite: (&0, &e) &146e 01 ; 2 pillars, colour 0 &146f c9 ; pillar: (&9, &c) &1470 cd ; pillar: (&d, &c) ; room &17 &1471 55 82 ; "The Palace" &1473 51 ; background sprite: &51 (STONES_RYM) &1474 63 ; room has sprites, object, pillars, enemies &1475 6a ; 2 sprites before, 13 sprites after &1476 00 a2 1a d0 ; sprite: &51 (STONES_RYM) frame 0, 10 sprites horizontally, (&0, &d) &147a f0 ; sprite: (&0, &f) &147b 42 ; 9 rectangles, 2 triangles &147c 40 44 ; rectangle: (&0, &4), size (&4, &4) &147e 4b 44 ; rectangle: (&b, &4), size (&4, &4) &1480 90 2f ; rectangle: (&0, &9), size (&f, &2) &1482 c0 04 ; rectangle: (&0, &c), size (&4, &0) &1484 d0 03 ; rectangle: (&0, &d), size (&3, &0) &1486 e0 02 ; rectangle: (&0, &e), size (&2, &0) &1488 cb 04 ; rectangle: (&b, &c), size (&4, &0) &148a dc 03 ; rectangle: (&c, &d), size (&3, &0) &148c ed 02 ; rectangle: (&d, &e), size (&2, &0) &148e 94 4a 45 ; triangle: (&4-, &9-), (&a, &4), (&5, &4) &1491 4b 9b 45 ; triangle: (&b, &4), (&b, &9), (&5, &4) &1494 b0 ; object: (&0, &b) &1495 08 2f 72 ; sprite: &17 (PAINFUL_BALL) frame 1, y_offset 8, (&2, &7) &1498 7d ; sprite: (&d, &7) &1499 02 76 87 ; sprite: &3b (C) frame 0, x_offset 4, (&7, &8) &149c 00 d2 32 c1 ; sprite: &69 (STATUE) frame 0, frame 2, (&1, &c) &14a0 33 ce ; sprite: frame 3, (&e, &c) &14a2 02 d0 21 b7 ; sprite: &68 (STRIPED_PILLAR) frame 0, x_offset 4, 2 sprites vertically, (&7, &b) &14a6 00 d0 23 d1 ; sprite: &68 (STRIPED_PILLAR) frame 0, 4 sprites vertically, (&1, &d) &14aa de ; sprite: (&e, &d) &14ab 09 24 2b 42 ; sprite: &12 (CHAIN_LINK) frame 0, x_offset 2, y_offset 8, 12 sprites vertically, (&2, &4) &14af 4d ; sprite: (&d, &4) &14b0 10 00 0d d1 ; sprite: 1 sprite horizontally, &06 (OBJECT_PLINTH) frame 1, (&1, &d) &14b4 de ; sprite: (&e, &d) &14b5 02 0d b7 ; sprite: &06 (OBJECT_PLINTH) frame 1, x_offset 4, (&7, &b) &14b8 a1 ; 2 pillars, colour 2 &14b9 95 ; pillar: (&5, &9) &14ba 99 ; pillar: (&9, &9) &14bb 31 ; 4 enemies using 2 sprites &14bc 75 ; enemy sprite: &75 (TORCH) (type &0), slots &1-&4 &14bd 69 ; enemy sprite: &69 (STATUE) (type &0), slots &5-&8 &14be 0f a3 ; enemy: slot 1 (TORCH), (&3, &a), type 0 &14c0 0f ac ; enemy: slot 1 (TORCH), (&c, &a), type 0 &14c2 4f b1 ; enemy: slot 5 (STATUE), (&1, &b), type 0 &14c4 4f be ; enemy: slot 5 (STATUE), (&e, &b), type 0 ; room &18 &14c6 38 82 ; "The Palace" &14c8 52 ; background sprite: &52 (STONES_RKM) &14c9 71 ; room has sprites, door, pillars, enemies &14ca 58 ; 0 sprites before, 11 sprites after &14cb 31 ; 7 rectangles, 1 triangle &14cc 40 70 ; rectangle: (&0, &4), size (&0, &7) &14ce 55 28 ; rectangle: (&5, &5), size (&8, &2) &14d0 73 32 ; rectangle: (&3, &7), size (&2, &3) &14d2 b4 00 ; rectangle: (&4, &b), size (&0, &0) &14d4 89 01 ; rectangle: (&9, &8), size (&1, &0) &14d6 97 26 ; rectangle: (&7, &9), size (&6, &2) &14d8 c0 2f ; rectangle: (&0, &c), size (&f, &2) &14da 41 c1 c2 ; triangle: (&1-, &4-), (&1+, &c), (&2, &c) &14dd 08 74 a5 ; sprite: &3a (TRAMPOLINE) frame 0, y_offset 8, (&5, &a) &14e0 e4 ; sprite: (&4, &e) &14e1 e8 ; sprite: (&8, &e) &14e2 00 50 98 ; sprite: &28 (GOOGLY_FACE) frame 0, (&8, &9) &14e5 c6 ; sprite: (&6, &c) &14e6 e1 ; sprite: (&1, &e) &14e7 ed ; sprite: (&d, &e) &14e8 12 e5 ; sprite: 3 sprites horizontally, (&5, &e) &14ea e9 ; sprite: (&9, &e) &14eb 02 50 11 d5 ; sprite: &28 (GOOGLY_FACE) frame 0, x_offset 4, 2 sprites horizontally, (&5, &d) &14ef d9 ; sprite: (&9, &d) &14f0 07 b4; door: type &07, (&4, &b) &14f2 10 ; 1 pillar, colour 0 &14f3 ce ; pillar: (&e, &c) &14f4 21 ; 3 enemies using 2 sprites &14f5 27 ; enemy sprite: &27 (LIFT) (type &1), slots &1-&3 &14f6 2f ; enemy sprite: &2f (BLOCK) (type &3), slots &4-&6 &14f7 02 cc af ; enemy: slot 1 (LIFT), (&c, &c), type 1, y_range (&5, &3), y_speed 2 &14fa 35 5a ; enemy: slot 4 (BLOCK), (&a, &5), type 3, direction 1, speed 1 &14fc 36 93 ; enemy: slot 4 (BLOCK), (&3, &9), type 3, direction 2, speed 1 ; room &19 &14fe 02 b7 ; copy of room &b7 ; room &1a &1500 35 82 ; "The Palace" &1502 54 ; background sprite: &54 (STONES_GYG) &1503 65 ; room has sprites, ropes/ladders, pillars, enemies &1504 38 ; 0 sprites before, 7 sprites after &1505 20 ; 5 rectangles, 0 triangles &1506 57 26 ; rectangle: (&7, &5), size (&6, &2) &1508 72 39 ; rectangle: (&2, &7), size (&9, &3) &150a a7 16 ; rectangle: (&7, &a), size (&6, &1) &150c c0 1f ; rectangle: (&0, &c), size (&f, &1) &150e e2 0d ; rectangle: (&2, &e), size (&d, &0) &1510 00 7a e2 ; sprite: &3d (HORNED_SKULL) frame 0, (&2, &e) &1513 e5 ; sprite: (&5, &e) &1514 12 cd ; sprite: 3 sprites horizontally, (&d, &c) &1516 dd ; sprite: (&d, &d) &1517 ed ; sprite: (&d, &e) &1518 31 98 ; sprite: frame 1, (&8, &9) &151a d7 ; sprite: (&7, &d) &151b 20 ; 0 ropes, 2 ladders &151c 7e 18 ; ladder, (&e, &7), length &06, colour 2 &151e eb 3b ; ladder, (&b, &e), length &0e, colour 3 &1520 02 ; 3 pillars, colour 0 &1521 76 ; pillar: (&6, &7) &1522 c6 ; pillar: (&6, &c) &1523 ac ; pillar: (&c, &a) &1524 42 ; 5 enemies using 3 sprites &1525 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &1526 28 ; enemy sprite: &28 (GOOGLY_FACE) (type &1), slots &5-&6 &1527 27 ; enemy sprite: &27 (LIFT) (type &1), slots &7-&9 &1528 00 bb ; enemy: slot 1 (MONK), (&b, &b), type 6, colour 0 &152a 41 c2 cf ; enemy: slot 5 (GOOGLY_FACE), (&2, &c), type 1, y_range (&f, &4), y_speed 1 &152d 4f 9b ; enemy: slot 5 (GOOGLY_FACE), (&b, &9), type 1 &152f 61 e8 df ; enemy: slot 7 (LIFT), (&8, &e), type 1, y_range (&2, &6), y_speed 1 &1532 62 78 5a ; enemy: slot 7 (LIFT), (&8, &7), type 1, y_range (&9, &0), y_speed 2 ; room &1b &1535 09 80 ; " " &1537 5c ; background sprite: &5c (BRICKS_RY) &1538 08 ; room has stars &1539 08 ; 2 rectangles, 0 triangles &153a 40 8f ; rectangle: (&0, &4), size (&f, &8) &153c d0 2d ; rectangle: (&0, &d), size (&d, &2) ; room &1c &153e 36 84 ; "West Tower" &1540 5c ; background sprite: &5c (BRICKS_RY) &1541 4f ; room has sprites, object, ropes/ladders, stars, enemies &1542 48 ; 0 sprites before, 9 sprites after &1543 18 ; 4 rectangles, 0 triangles &1544 40 8f ; rectangle: (&0, &4), size (&f, &8) &1546 d3 03 ; rectangle: (&3, &d), size (&3, &0) &1548 e1 15 ; rectangle: (&1, &e), size (&5, &1) &154a 00 4c 68 80 ; rectangle: STA &4c, (&8, &6), size (&0, &8) &154e 68 ; object: (&8, &6) &154f 00 e0 f5 ; sprite: &70 (CURVED_PLATFORM) frame 0, (&5, &f) &1552 01 d4 c1 ; sprite: &6a (CANNON) frame 0, x_offset 2, (&1, &c) &1555 31 cd ; sprite: frame 1, (&d, &c) &1557 02 73 87 ; sprite: &39 (SHIELD) frame 1, x_offset 4, (&7, &8) &155a 00 72 33 89 ; sprite: &39 (SHIELD) frame 0, frame 3, (&9, &8) &155e 04 76 88 ; sprite: &3b (C) frame 0, y_offset 4, (&8, &8) &1561 00 58 ca ; sprite: &2c (PULSING_CIRCLES) frame 0, (&a, &c) &1564 13 d9 ; sprite: 4 sprites horizontally, (&9, &d) &1566 e9 ; sprite: (&9, &e) &1567 11 ; 1 rope, 1 ladder &1568 f1 ; rope: (&1, &f) &1569 fe 17 ; ladder, (&e, &f), length &05, colour 2 &156b 11 ; 2 enemies using 2 sprites &156c 2a ; enemy sprite: &2a (MAGIC) (type &2), slots &1-&4 &156d 71 ; enemy sprite: &71 (FLAG) (type &0), slots &5-&6 &156e 02 a7 67 da ; enemy: slot 1 (MAGIC), (&7, &a), type 2, x_range (&7, &a), y_range (&6, &d), speed (1, 2) &1572 4f 69 ; enemy: slot 5 (FLAG), (&9, &6), type 0 ; room &1d &1574 09 80 ; " " &1576 5c ; background sprite: &5c (BRICKS_RY) &1577 08 ; room has stars &1578 08 ; 2 rectangles, 0 triangles &1579 40 8f ; rectangle: (&0, &4), size (&f, &8) &157b d2 2d ; rectangle: (&2, &d), size (&d, &2) ; room &1e &157d 01 ; copy of room &00 ; room &1f &157e 01 ; copy of room &00 ; room &20 &157f 01 ; copy of room &00 ; room &21 &1580 02 1b ; copy of room &1b ; room &22 &1582 28 85 ; "East Tower" &1584 5c ; background sprite: &5c (BRICKS_RY) &1585 4d ; room has sprites, ropes/ladders, stars, enemies &1586 20 ; 0 sprites before, 4 sprites after &1587 18 ; 4 rectangles, 0 triangles &1588 40 4f ; rectangle: (&0, &4), size (&f, &4) &158a 90 3c ; rectangle: (&0, &9), size (&c, &3) &158c bc 22 ; rectangle: (&c, &b), size (&2, &2) &158e 00 40 d3 20 ; rectangle: STA &40, (&3, &d), size (&0, &2) &1592 00 4a d3 ; sprite: &25 (TOP_OF_ROPE) frame 0, (&3, &d) &1595 02 c4 dc ; sprite: &62 (URN) frame 0, x_offset 4, (&c, &d) &1598 00 e0 ab ; sprite: &70 (CURVED_PLATFORM) frame 0, (&b, &a) &159b 03 d5 8d ; sprite: &6a (CANNON) frame 1, x_offset 6, (&d, &8) &159e 11 ; 1 rope, 1 ladder &159f f3 ; rope: (&3, &f) &15a0 fe 1c ; ladder, (&e, &f), length &07, colour 2 &15a2 11 ; 2 enemies using 2 sprites &15a3 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &15a4 28 ; enemy sprite: &28 (GOOGLY_FACE) (type &1), slots &5-&6 &15a5 08 b7 ; enemy: slot 1 (MONK), (&7, &b), type 6, colour 2 &15a7 44 ce be ; enemy: slot 5 (GOOGLY_FACE), (&e, &c), type 1, y_range (&9, &0), y_speed 4 ; room &23 &15aa 09 80 ; " " &15ac 5c ; background sprite: &5c (BRICKS_RY) &15ad 08 ; room has stars &15ae 08 ; 2 rectangles, 0 triangles &15af 40 4f ; rectangle: (&0, &4), size (&f, &4) &15b1 92 6d ; rectangle: (&2, &9), size (&d, &6) ; room &24 &15b3 01 ; copy of room &00 ; room &25 &15b4 01 ; copy of room &00 ; room &26 &15b5 01 ; copy of room &00 ; room &27 &15b6 01 ; copy of room &00 ; room &28 &15b7 01 ; copy of room &00 ; room &29 &15b8 02 01 ; copy of room &01 ; room &2a &15ba 01 ; copy of room &00 ; room &2b &15bb 01 ; copy of room &00 ; room &2c &15bc 01 ; copy of room &00 ; room &2d &15bd 01 ; copy of room &00 ; room &2e &15be 01 ; copy of room &00 ; room &2f &15bf 07 80 ; " " &15c1 5c ; background sprite: &5c (BRICKS_RY) &15c2 08 ; room has stars &15c3 00 ; 1 rectangle, 0 triangles &15c4 40 bd ; rectangle: (&0, &4), size (&d, &b) ; room &30 &15c6 25 84 ; "West Tower" &15c8 5c ; background sprite: &5c (BRICKS_RY) &15c9 44 ; room has ropes/ladders, enemies &15ca 19 ; 4 rectangles, 1 triangle &15cb 41 15 ; rectangle: (&1, &4), size (&5, &1) &15cd 61 72 ; rectangle: (&1, &6), size (&2, &7) &15cf e1 15 ; rectangle: (&1, &e), size (&5, &1) &15d1 6a 23 ; rectangle: (&a, &6), size (&3, &2) &15d3 e1 ed 6d ; triangle: (&1-, &e-), (&d, &e), (&d, &6) &15d6 21 ; 1 rope, 2 ladders &15d7 e1 ; rope: (&1, &e) &15d8 8e 23 ; ladder, (&e, &8), length &08, colour 2 &15da fc 35 ; ladder, (&c, &f), length &0d, colour 0 &15dc 31 ; 4 enemies using 2 sprites &15dd 2d ; enemy sprite: &2d (FIRE) (type &7), slots &1-&4 &15de 2c ; enemy sprite: &2c (PULSING_CIRCLES) (type &2), slots &5-&7 &15df 02 d9 7d ; enemy: slot 1 (FIRE), (&9, &d), type 7, x_range (&d, &7), x_speed 2 &15e2 02 db d7 ; enemy: slot 1 (FIRE), (&b, &d), type 7, x_range (&7, &d), x_speed 2 &15e5 4f c7 ; enemy: slot 5 (PULSING_CIRCLES), (&7, &c), type 2 &15e7 46 7c 6c 9f ; enemy: slot 5 (PULSING_CIRCLES), (&c, &7), type 2, x_range (&c, &f), y_range (&6, &9), speed (2, 2) ; room &31 &15eb 07 80 ; " " &15ed 5c ; background sprite: &5c (BRICKS_RY) &15ee 08 ; room has stars &15ef 00 ; 1 rectangle, 0 triangles &15f0 42 bd ; rectangle: (&2, &4), size (&d, &b) ; room &32 &15f2 01 ; copy of room &00 ; room &33 &15f3 07 80 ; " " &15f5 5c ; background sprite: &5c (BRICKS_RY) &15f6 08 ; room has stars &15f7 00 ; 1 rectangle, 0 triangles &15f8 40 bf ; rectangle: (&0, &4), size (&f, &b) ; room &34 &15fa 01 ; copy of room &00 ; room &35 &15fb 02 2f ; copy of room &2f ; room &36 &15fd 21 85 ; "East Tower" &15ff 5c ; background sprite: &5c (BRICKS_RY) &1600 47 ; room has sprites, object, ropes/ladders, enemies &1601 08 ; 0 sprites before, 1 sprite after &1602 11 ; 3 rectangles, 1 triangle &1603 43 20 ; rectangle: (&3, &4), size (&0, &2) &1605 81 3a ; rectangle: (&1, &8), size (&a, &3) &1607 00 70 c0 c0 c1 2a ; rectangle: STA &70, water level &c0 x:&0-&c, (&1, &c), size (&a, &2) &160d 81 8b 63 ; triangle: (&1-, &8-), (&b, &8), (&3, &6) &1610 a9 ; object: (&9, &a) &1611 1a 00 18 c1 ; sprite: 11 sprites horizontally, &0c (WATER_SURFACE) frame 0, (&1, &c) &1615 11 ; 1 rope, 1 ladder &1616 a3 ; rope: (&3, &a) &1617 fe 58 ; ladder, (&e, &f), length &16, colour 2 &1619 01 ; 1 enemy using 2 sprites &161a 72 ; enemy sprite: &72 (SPLASH) (type &0), slots &1-&2 &161b 66 ; enemy sprite: &66 (OCTOPUS) (type &4), slots &3-&4 &161c 21 d8 ; enemy: slot 3 (OCTOPUS), (&8, &d), type 4, full_speed ; room &37 &161e 02 31 ; copy of room &31 ; room &38 &1620 01 ; copy of room &00 ; room &39 &1621 01 ; copy of room &00 ; room &3a &1622 01 ; copy of room &00 ; room &3b &1623 01 ; copy of room &00 ; room &3c &1624 01 ; copy of room &00 ; room &3d &1625 35 81 ; "The Pyramid" &1627 6e ; background sprite: &6e (DITHER_YKY) &1628 45 ; room has sprites, ropes/ladders, enemies &1629 39 ; 1 sprite before, 7 sprites after &162a 00 b6 19 e3 ; sprite: &5b (BRICKS_CKG) frame 0, 9 sprites horizontally, (&3, &e) &162e 23 ; 5 rectangles, 3 triangles &162f 48 10 ; rectangle: (&8, &4), size (&0, &1) &1631 63 0b ; rectangle: (&3, &6), size (&b, &0) &1633 5d 60 ; rectangle: (&d, &5), size (&0, &6) &1635 8c 02 ; rectangle: (&c, &8), size (&2, &0) &1637 c3 19 ; rectangle: (&3, &c), size (&9, &1) &1639 c1 ce 88 ; triangle: (&1-, &c-), (&e, &c), (&8, &8) &163c f3 c4 c1 ; triangle: (&3, &f-), (&4, &c), (&1, &c) &163f fd ce cb ; triangle: (&d, &f-), (&e, &c), (&b, &c) &1642 05 22 65 ; sprite: &11 (IMP_STATUE) frame 0, x_offset 2, y_offset 4, (&5, &6) &1645 6b ; sprite: (&b, &6) &1646 08 78 a5 ; sprite: &3c (PHARAOH_MASK) frame 0, y_offset 8, (&5, &a) &1649 aa ; sprite: (&a, &a) &164a 00 6c d4 ; sprite: &36 (MUMMY) frame 0, (&4, &d) &164d db ; sprite: (&b, &d) &164e 02 a2 11 d6 ; sprite: &51 (STONES_RYM) frame 0, x_offset 4, 2 sprites horizontally, (&6, &d) &1652 11 ; 1 rope, 1 ladder &1653 ad ; rope: (&d, &a) &1654 68 13 ; ladder, (&8, &6), length &04, colour 0 &1656 00 ; 1 enemy using 1 sprite &1657 30 ; enemy sprite: &30 (BLOCK_BLUE) (type &3), slots &1-&3 &1658 09 66 ; enemy: slot 1 (BLOCK_BLUE), (&6, &6), type 3, direction 1, speed 2 ; room &3e &165a 01 ; copy of room &00 ; room &3f &165b 01 ; copy of room &00 ; room &40 &165c 01 ; copy of room &00 ; room &41 &165d 01 ; copy of room &00 ; room &42 &165e 01 ; copy of room &00 ; room &43 &165f 02 2f ; copy of room &2f ; room &44 &1661 33 84 ; "West Tower" &1663 55 ; background sprite: &55 (STONES_YCG) &1664 55 ; room has sprites, ropes/ladders, door, enemies &1665 20 ; 0 sprites before, 4 sprites after &1666 28 ; 6 rectangles, 0 triangles &1667 41 65 ; rectangle: (&1, &4), size (&5, &6) &1669 5a 01 ; rectangle: (&a, &5), size (&1, &0) &166b 6a 00 ; rectangle: (&a, &6), size (&0, &0) &166d 7a 25 ; rectangle: (&a, &7), size (&5, &2) &166f aa 24 ; rectangle: (&a, &a), size (&4, &2) &1671 d1 1d ; rectangle: (&1, &d), size (&d, &1) &1673 00 7a 61 ; sprite: &3d (HORNED_SKULL) frame 0, (&1, &6) &1676 66 ; sprite: (&6, &6) &1677 15 00 e8 32 b1 ; sprite: 6 sprites horizontally, &74 (SPIKES_MONOCHROME) frame 0, frame 2, (&1, &b) &167c 11 00 74 b2 ; sprite: 2 sprites horizontally, &3a (TRAMPOLINE) frame 0, (&2, &b) &1680 22 ; 2 ropes, 2 ladders &1681 ba ; rope: (&a, &b) &1682 cc ; rope: (&c, &c) &1683 5c 09 ; ladder, (&c, &5), length &02, colour 0 &1685 f1 0a ; ladder, (&1, &f), length &02, colour 1 &1687 01 5b; door: type &01, (&b, &5) &1689 21 ; 3 enemies using 2 sprites &168a 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &168b 29 ; enemy sprite: &29 (ROPE_CLIMBER) (type &1), slots &5-&6 &168c 08 d8 ; enemy: slot 1 (MONK), (&8, &d), type 6, colour 2 &168e 42 8a 7c ; enemy: slot 5 (ROPE_CLIMBER), (&a, &8), type 1, y_range (&5, &4), y_speed 2 &1691 45 9c d7 ; enemy: slot 5 (ROPE_CLIMBER), (&c, &9), type 1, y_range (&c, &0), y_speed 5 ; room &45 &1694 0c 80 ; " " &1696 5c ; background sprite: &5c (BRICKS_RY) &1697 09 ; room has sprites, stars &1698 00 ; 0 sprites before, 0 sprites after &1699 10 ; 3 rectangles, 0 triangles &169a 42 2d ; rectangle: (&2, &4), size (&d, &2) &169c 70 2f ; rectangle: (&0, &7), size (&f, &2) &169e a4 4b ; rectangle: (&4, &a), size (&b, &4) ; room &46 &16a0 19 80 ; " " &16a2 5c ; background sprite: &5c (BRICKS_RY) &16a3 49 ; room has sprites, stars, enemies &16a4 08 ; 0 sprites before, 1 sprite after &16a5 18 ; 4 rectangles, 0 triangles &16a6 40 6f ; rectangle: (&0, &4), size (&f, &6) &16a8 b0 31 ; rectangle: (&0, &b), size (&1, &3) &16aa b5 3a ; rectangle: (&5, &b), size (&a, &3) &16ac 03 ff b2 32 ; rectangle: EOR &ff, (&2, &b), size (&2, &3) &16b0 00 c4 33 e8 ; sprite: &62 (URN) frame 0, frame 3, (&8, &e) &16b4 00 ; 1 enemy using 1 sprite &16b5 27 ; enemy sprite: &27 (LIFT) (type &1), slots &1-&3 &16b6 04 ab d8 ; enemy: slot 1 (LIFT), (&b, &a), type 1, y_range (&1, &3), y_speed 4 ; room &47 &16b9 31 83 ; "Central Tower" &16bb 5c ; background sprite: &5c (BRICKS_RY) &16bc 49 ; room has sprites, stars, enemies &16bd 48 ; 0 sprites before, 9 sprites after &16be 40 ; 9 rectangles, 0 triangles &16bf 40 af ; rectangle: (&0, &4), size (&f, &a) &16c1 f3 00 ; rectangle: (&3, &f), size (&0, &0) &16c3 00 3c b1 3d ; rectangle: STA &3c, (&1, &b), size (&d, &3) &16c7 a4 08 ; rectangle: (&4, &a), size (&8, &0) &16c9 76 24 ; rectangle: (&6, &7), size (&4, &2) &16cb 66 00 ; rectangle: (&6, &6), size (&0, &0) &16cd 68 00 ; rectangle: (&8, &6), size (&0, &0) &16cf 6a 00 ; rectangle: (&a, &6), size (&0, &0) &16d1 00 0c 98 00 ; rectangle: STA &0c, (&8, &9), size (&0, &0) &16d5 05 76 98 ; sprite: &3b (C) frame 0, x_offset 2, y_offset 4, (&8, &9) &16d8 03 d4 a1 ; sprite: &6a (CANNON) frame 0, x_offset 6, (&1, &a) &16db 00 d1 66 ; sprite: &68 (STRIPED_PILLAR) frame 1, (&6, &6) &16de 68 ; sprite: (&8, &6) &16df 6a ; sprite: (&a, &6) &16e0 77 ; sprite: (&7, &7) &16e1 79 ; sprite: (&9, &7) &16e2 1d b1 ; sprite: 14 sprites horizontally, (&1, &b) &16e4 18 a4 ; sprite: 9 sprites horizontally, (&4, &a) &16e6 00 ; 1 enemy using 1 sprite &16e7 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &16e8 00 da ; enemy: slot 1 (MONK), (&a, &d), type 6, colour 0 ; room &48 &16ea 1e 80 ; " " &16ec 5c ; background sprite: &5c (BRICKS_RY) &16ed 49 ; room has sprites, stars, enemies &16ee 08 ; 0 sprites before, 1 sprite after &16ef 21 ; 5 rectangles, 1 triangle &16f0 40 a5 ; rectangle: (&0, &4), size (&5, &a) &16f2 46 69 ; rectangle: (&6, &4), size (&9, &6) &16f4 b9 33 ; rectangle: (&9, &b), size (&3, &3) &16f6 e8 00 ; rectangle: (&8, &e), size (&0, &0) &16f8 03 33 bf 40 ; rectangle: EOR &33, (&f, &b), size (&0, &4) &16fc fd be bd ; triangle: (&d, &f-), (&e, &b), (&d, &b) &16ff 04 1e e8 ; sprite: &0f (SWITCH) frame 0, y_offset 4, (&8, &e) &1702 01 ; 1 enemy using 2 sprites &1703 2b ; enemy sprite: &2b (SNAKE) (type &0), slots &1-&4 &1704 0f ; enemy sprite: &0f (SWITCH) (type &0), slots &5-&6 &1705 03 e2 15 ; enemy: slot 1 (SNAKE), (&2, &e), type 0, x_range (&5, &1), x_speed 3 ; room &49 &1708 1f 86 ; "Top of Castle" &170a 5c ; background sprite: &5c (BRICKS_RY) &170b 4d ; room has sprites, ropes/ladders, stars, enemies &170c 08 ; 0 sprites before, 1 sprite after &170d 28 ; 6 rectangles, 0 triangles &170e 40 4d ; rectangle: (&0, &4), size (&d, &4) &1710 90 1f ; rectangle: (&0, &9), size (&f, &1) &1712 b3 29 ; rectangle: (&3, &b), size (&9, &2) &1714 e7 10 ; rectangle: (&7, &e), size (&0, &1) &1716 03 33 b0 42 ; rectangle: EOR &33, (&0, &b), size (&2, &4) &171a 00 54 b1 40 ; rectangle: STA &54, (&1, &b), size (&0, &4) &171e 00 4a e7 ; sprite: &25 (TOP_OF_ROPE) frame 0, (&7, &e) &1721 01 ; 1 rope, 0 ladders &1722 f7 ; rope: (&7, &f) &1723 00 ; 1 enemy using 1 sprite &1724 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &1725 08 cc ; enemy: slot 1 (MONK), (&c, &c), type 6, colour 2 ; room &4a &1727 31 85 ; "East Tower" &1729 51 ; background sprite: &51 (STONES_RYM) &172a 55 ; room has sprites, ropes/ladders, door, enemies &172b 10 ; 0 sprites before, 2 sprites after &172c 28 ; 6 rectangles, 0 triangles &172d 62 1a ; rectangle: (&2, &6), size (&a, &1) &172f 7d 00 ; rectangle: (&d, &7), size (&0, &0) &1731 82 03 ; rectangle: (&2, &8), size (&3, &0) &1733 90 1e ; rectangle: (&0, &9), size (&e, &1) &1735 b2 1c ; rectangle: (&2, &b), size (&c, &1) &1737 d4 28 ; rectangle: (&4, &d), size (&8, &2) &1739 03 d4 77 ; sprite: &6a (CANNON) frame 0, x_offset 6, (&7, &7) &173c 02 24 27 66 ; sprite: &12 (CHAIN_LINK) frame 0, x_offset 4, 8 sprites vertically, (&6, &6) &1740 15 ; 5 ropes, 1 ladder &1741 a4 ; rope: (&4, &a) &1742 d6 ; rope: (&6, &d) &1743 d8 ; rope: (&8, &d) &1744 da ; rope: (&a, &d) &1745 fc ; rope: (&c, &f) &1746 7e 18 ; ladder, (&e, &7), length &06, colour 2 &1748 02 7d; door: type &02, (&d, &7) &174a 30 ; 4 enemies using 1 sprite &174b 29 ; enemy sprite: &29 (ROPE_CLIMBER) (type &1), slots &1-&2 &174c 02 c6 9e ; enemy: slot 1 (ROPE_CLIMBER), (&6, &c), type 1, y_range (&2, &0), y_speed 2 &174f 02 b8 e9 ; enemy: slot 1 (ROPE_CLIMBER), (&8, &b), type 1, y_range (&2, &0), y_speed 2 &1752 02 9a 9e ; enemy: slot 1 (ROPE_CLIMBER), (&a, &9), type 1, y_range (&2, &0), y_speed 2 &1755 02 cc 9f ; enemy: slot 1 (ROPE_CLIMBER), (&c, &c), type 1, y_range (&2, &0), y_speed 2 ; room &4b &1758 02 31 ; copy of room &31 ; room &4c &175a 01 ; copy of room &00 ; room &4d &175b 01 ; copy of room &00 ; room &4e &175c 01 ; copy of room &00 ; room &4f &175d 01 ; copy of room &00 ; room &50 &175e 01 ; copy of room &00 ; room &51 &175f 01 ; copy of room &00 ; room &52 &1760 01 ; copy of room &00 ; room &53 &1761 01 ; copy of room &00 ; room &54 &1762 01 ; copy of room &00 ; room &55 &1763 01 ; copy of room &00 ; room &56 &1764 01 ; copy of room &00 ; room &57 &1765 0d 80 ; " " &1767 5c ; background sprite: &5c (BRICKS_RY) &1768 09 ; room has sprites, stars &1769 08 ; 0 sprites before, 1 sprite after &176a 08 ; 2 rectangles, 0 triangles &176b 40 bd ; rectangle: (&0, &4), size (&d, &b) &176d ae 11 ; rectangle: (&e, &a), size (&1, &1) &176f 01 d4 be ; sprite: &6a (CANNON) frame 0, x_offset 2, (&e, &b) ; room &58 &1772 36 87 ; "West Wing" &1774 5a ; background sprite: &5a (BRICKS_MBG) &1775 67 ; room has sprites, object, ropes/ladders, pillars, enemies &1776 20 ; 0 sprites before, 4 sprites after &1777 40 ; 9 rectangles, 0 triangles &1778 62 2a ; rectangle: (&2, &6), size (&a, &2) &177a 6d 11 ; rectangle: (&d, &6), size (&1, &1) &177c a0 07 ; rectangle: (&0, &a), size (&7, &0) &177e b7 00 ; rectangle: (&7, &b), size (&0, &0) &1780 b0 03 ; rectangle: (&0, &b), size (&3, &0) &1782 c1 30 ; rectangle: (&1, &c), size (&0, &3) &1784 c3 2b ; rectangle: (&3, &c), size (&b, &2) &1786 8e 10 ; rectangle: (&e, &8), size (&0, &1) &1788 ae 11 ; rectangle: (&e, &a), size (&1, &1) &178a f7 ; object: (&7, &f) &178b 0e 72 63 ; sprite: &39 (SHIELD) frame 0, x_offset 4, y_offset 12, (&3, &6) &178e 6a ; sprite: (&a, &6) &178f 0c 72 32 64 ; sprite: &39 (SHIELD) frame 0, y_offset 12, frame 2, (&4, &6) &1793 6b ; sprite: (&b, &6) &1794 22 ; 2 ropes, 2 ladders &1795 f1 ; rope: (&1, &f) &1796 c7 ; rope: (&7, &c) &1797 81 21 ; ladder, (&1, &8), length &08, colour 1 &1799 e9 30 ; ladder, (&9, &e), length &0c, colour 1 &179b 05 ; 6 pillars, colour 0 &179c 65 ; pillar: (&5, &6) &179d 6d ; pillar: (&d, &6) &179e a2 ; pillar: (&2, &a) &179f a5 ; pillar: (&5, &a) &17a0 c5 ; pillar: (&5, &c) &17a1 cb ; pillar: (&b, &c) &17a2 10 ; 2 enemies using 1 sprite &17a3 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &17a4 01 d8 ; enemy: slot 1 (MONK), (&8, &d), type 6, colour 0 &17a6 0c 7a ; enemy: slot 1 (MONK), (&a, &7), type 6, colour 3 ; room &59 &17a8 19 87 ; "West Wing" &17aa 5f ; background sprite: &5f (BRICKS_CB) &17ab 41 ; room has sprites, enemies &17ac 10 ; 0 sprites before, 2 sprites after &17ad 10 ; 3 rectangles, 0 triangles &17ae 82 2c ; rectangle: (&2, &8), size (&c, &2) &17b0 a0 11 ; rectangle: (&0, &a), size (&1, &1) &17b2 b1 1e ; rectangle: (&1, &b), size (&e, &1) &17b4 00 e8 12 d3 ; sprite: &74 (SPIKES_MONOCHROME) frame 0, 3 sprites horizontally, (&3, &d) &17b8 db ; sprite: (&b, &d) &17b9 10 ; 2 enemies using 1 sprite &17ba 2b ; enemy sprite: &2b (SNAKE) (type &0), slots &1-&4 &17bb 03 c4 3d ; enemy: slot 1 (SNAKE), (&4, &c), type 0, x_range (&d, &3), x_speed 3 &17be 03 cc 3d ; enemy: slot 1 (SNAKE), (&c, &c), type 0, x_range (&d, &3), x_speed 3 ; room &5a &17c1 44 88 ; "The Kitchen" &17c3 51 ; background sprite: &51 (STONES_RYM) &17c4 67 ; room has sprites, object, ropes/ladders, pillars, enemies &17c5 48 ; 0 sprites before, 9 sprites after &17c6 29 ; 6 rectangles, 1 triangle &17c7 00 d3 42 52 ; rectangle: STA &d3, (&2, &4), size (&2, &5) &17cb 55 10 ; rectangle: (&5, &5), size (&0, &1) &17cd 00 00 56 18 ; rectangle: STA &00, (&6, &5), size (&8, &1) &17d1 73 2b ; rectangle: (&3, &7), size (&b, &2) &17d3 b0 1f ; rectangle: (&0, &b), size (&f, &1) &17d5 d2 1b ; rectangle: (&2, &d), size (&b, &1) &17d7 55 56 76 ; triangle: (&5-, &5-), (&6, &5), (&6, &7) &17da a3 ; object: (&3, &a) &17db 06 c6 9a ; sprite: &63 (TABLE) frame 0, x_offset 4, y_offset 4, (&a, &9) &17de e2 ; sprite: (&2, &e) &17df 02 c4 ec ; sprite: &62 (URN) frame 0, x_offset 4, (&c, &e) &17e2 32 9d ; sprite: frame 2, (&d, &9) &17e4 33 c0 ; sprite: frame 3, (&0, &c) &17e6 04 66 98 ; sprite: &33 (CAULDRON) frame 0, y_offset 4, (&8, &9) &17e9 ea ; sprite: (&a, &e) &17ea 31 e6 ; sprite: frame 1, (&6, &e) &17ec 08 34 24 43 ; sprite: &1a (BLOCK_BLACK) frame 0, y_offset 8, 5 sprites vertically, (&3, &4) &17f0 10 ; 0 ropes, 1 ladder &17f1 fe 32 ; ladder, (&e, &f), length &0c, colour 2 &17f3 01 ; 2 pillars, colour 0 &17f4 b1 ; pillar: (&1, &b) &17f5 bf ; pillar: (&f, &b) &17f6 41 ; 5 enemies using 2 sprites &17f7 2d ; enemy sprite: &2d (FIRE) (type &7), slots &1-&4 &17f8 32 ; enemy sprite: &32 (STEAM) (type &0), slots &5-&8 &17f9 04 e8 4c ; enemy: slot 1 (FIRE), (&8, &e), type 7, x_range (&c, &4), x_speed 4 &17fc 4f 98 ; enemy: slot 5 (STEAM), (&8, &9), type 0 &17fe 4f e6 ; enemy: slot 5 (STEAM), (&6, &e), type 0 &1800 4f ea ; enemy: slot 5 (STEAM), (&a, &e), type 0 &1802 02 95 38 ; enemy: slot 1 (FIRE), (&5, &9), type 7, x_range (&8, &3), x_speed 2 ; room &5b &1805 4c 89 ; "Thorn Maze" &1807 58 ; background sprite: &58 (BRICKS_RYM) &1808 65 ; room has sprites, ropes/ladders, pillars, enemies &1809 58 ; 0 sprites before, 11 sprites after &180a 60 ; 13 rectangles, 0 triangles &180b 43 00 ; rectangle: (&3, &4), size (&0, &0) &180d 51 2d ; rectangle: (&1, &5), size (&d, &2) &180f 81 14 ; rectangle: (&1, &8), size (&4, &1) &1811 87 13 ; rectangle: (&7, &8), size (&3, &1) &1813 a4 01 ; rectangle: (&4, &a), size (&1, &0) &1815 a8 02 ; rectangle: (&8, &a), size (&2, &0) &1817 b8 01 ; rectangle: (&8, &b), size (&1, &0) &1819 8c 30 ; rectangle: (&c, &8), size (&0, &3) &181b b0 16 ; rectangle: (&0, &b), size (&6, &1) &181d d2 14 ; rectangle: (&2, &d), size (&4, &1) &181f c8 24 ; rectangle: (&8, &c), size (&4, &2) &1821 9f 30 ; rectangle: (&f, &9), size (&0, &3) &1823 ee 01 ; rectangle: (&e, &e), size (&1, &0) &1825 00 e6 52 ; sprite: &73 (SPIKES_MULTICOLOURED) frame 0, (&2, &5) &1828 5a ; sprite: (&a, &5) &1829 ca ; sprite: (&a, &c) &182a 31 5c ; sprite: frame 1, (&c, &5) &182c 08 e9 7b ; sprite: &74 (SPIKES_MONOCHROME) frame 1, y_offset 8, (&b, &7) &182f 16 08 e8 e2 ; sprite: 7 sprites horizontally, &74 (SPIKES_MONOCHROME) frame 0, y_offset 8, (&2, &e) &1833 10 00 74 a2 ; sprite: 1 sprite horizontally, &3a (TRAMPOLINE) frame 0, (&2, &a) &1837 08 74 aa ; sprite: &3a (TRAMPOLINE) frame 0, y_offset 8, (&a, &a) &183a 9c ; sprite: (&c, &9) &183b e5 ; sprite: (&5, &e) &183c e9 ; sprite: (&9, &e) &183d 22 ; 2 ropes, 2 ladders &183e 66 ; rope: (&6, &6) &183f 59 ; rope: (&9, &5) &1840 ce 29 ; ladder, (&e, &c), length &0a, colour 2 &1842 fe 0b ; ladder, (&e, &f), length &02, colour 2 &1844 41 ; 2 pillars, colour 1 &1845 b1 ; pillar: (&1, &b) &1846 9f ; pillar: (&f, &9) &1847 30 ; 4 enemies using 1 sprite &1848 2c ; enemy sprite: &2c (PULSING_CIRCLES) (type &2), slots &1-&3 &1849 0f 75 ; enemy: slot 1 (PULSING_CIRCLES), (&5, &7), type 2 &184b 0f a4 ; enemy: slot 1 (PULSING_CIRCLES), (&4, &a), type 2 &184d 0f 89 ; enemy: slot 1 (PULSING_CIRCLES), (&9, &8), type 2 &184f 0f 97 ; enemy: slot 1 (PULSING_CIRCLES), (&7, &9), type 2 ; room &5c &1851 25 87 ; "West Wing" &1853 5f ; background sprite: &5f (BRICKS_CB) &1854 67 ; room has sprites, object, ropes/ladders, pillars, enemies &1855 10 ; 0 sprites before, 2 sprites after &1856 20 ; 5 rectangles, 0 triangles &1857 73 1b ; rectangle: (&3, &7), size (&b, &1) &1859 90 3b ; rectangle: (&0, &9), size (&b, &3) &185b e0 0b ; rectangle: (&0, &e), size (&b, &0) &185d fb 00 ; rectangle: (&b, &f), size (&0, &0) &185f 00 d3 4f 80 ; rectangle: STA &d3, (&f, &4), size (&0, &8) &1863 9d ; object: (&d, &9) &1864 08 e9 c3 ; sprite: &74 (SPIKES_MONOCHROME) frame 1, y_offset 8, (&3, &c) &1867 ca ; sprite: (&a, &c) &1868 01 ; 1 rope, 0 ladders &1869 fb ; rope: (&b, &f) &186a 01 ; 2 pillars, colour 0 &186b 92 ; pillar: (&2, &9) &186c 7c ; pillar: (&c, &7) &186d 11 ; 2 enemies using 2 sprites &186e 27 ; enemy sprite: &27 (LIFT) (type &1), slots &1-&3 &186f 2d ; enemy sprite: &2d (FIRE) (type &7), slots &4-&7 &1870 04 a9 7c ; enemy: slot 1 (LIFT), (&9, &a), type 1, y_range (&4, &3), y_speed 4 &1873 34 c6 29 ; enemy: slot 4 (FIRE), (&6, &c), type 7, x_range (&9, &2), x_speed 4 ; room &5d &1876 53 65 65 63 61 6c 70 65 72 69 46 20 74 73 61 ; "East Fireplace" &1885 52 ; background sprite: &52 (STONES_RKM) &1886 45 ; room has sprites, ropes/ladders, enemies &1887 58 ; 0 sprites before, 11 sprites after &1888 48 ; 10 rectangles, 0 triangles &1889 00 d3 40 72 ; rectangle: STA &d3, (&0, &4), size (&2, &7) &188d a3 00 ; rectangle: (&3, &a), size (&0, &0) &188f 00 53 41 50 ; rectangle: STA &53, (&1, &4), size (&0, &5) &1893 00 00 53 4c ; rectangle: STA &00, (&3, &5), size (&c, &4) &1897 a1 00 ; rectangle: (&1, &a), size (&0, &0) &1899 a4 0b ; rectangle: (&4, &a), size (&b, &0) &189b b1 0e ; rectangle: (&1, &b), size (&e, &0) &189d d2 1b ; rectangle: (&2, &d), size (&b, &1) &189f 47 00 ; rectangle: (&7, &4), size (&0, &0) &18a1 f3 00 ; rectangle: (&3, &f), size (&0, &0) &18a3 00 74 c7 ; sprite: &3a (TRAMPOLINE) frame 0, (&7, &c) &18a6 cd ; sprite: (&d, &c) &18a7 08 7b 67 ; sprite: &3d (HORNED_SKULL) frame 1, y_offset 8, (&7, &6) &18aa 6d ; sprite: (&d, &6) &18ab 99 ; sprite: (&9, &9) &18ac 9b ; sprite: (&b, &9) &18ad 06 c6 b4 ; sprite: &63 (TABLE) frame 0, x_offset 4, y_offset 4, (&4, &b) &18b0 b8 ; sprite: (&8, &b) &18b1 be ; sprite: (&e, &b) &18b2 02 c4 ea ; sprite: &62 (URN) frame 0, x_offset 4, (&a, &e) &18b5 08 e8 12 ba ; sprite: &74 (SPIKES_MONOCHROME) frame 0, y_offset 8, 3 sprites horizontally, (&a, &b) &18b9 12 ; 2 ropes, 1 ladder &18ba 57 ; rope: (&7, &5) &18bb f3 ; rope: (&3, &f) &18bc e6 1a ; ladder, (&6, &e), length &06, colour 2 &18be 20 ; 3 enemies using 1 sprite &18bf 2d ; enemy sprite: &2d (FIRE) (type &7), slots &1-&4 &18c0 06 b2 41 ; enemy: slot 1 (FIRE), (&2, &b), type 7, x_range (&1, &4), x_speed 6 &18c3 02 b2 41 ; enemy: slot 1 (FIRE), (&2, &b), type 7, x_range (&1, &4), x_speed 2 &18c6 04 b1 14 ; enemy: slot 1 (FIRE), (&1, &b), type 7, x_range (&4, &1), x_speed 4 ; room &5e &18c9 2b 8a ; "East Wing" &18cb 5b ; background sprite: &5b (BRICKS_CKG) &18cc 67 ; room has sprites, object, ropes/ladders, pillars, enemies &18cd 28 ; 0 sprites before, 5 sprites after &18ce 10 ; 3 rectangles, 0 triangles &18cf 44 a8 ; rectangle: (&4, &4), size (&8, &a) &18d1 50 61 ; rectangle: (&0, &5), size (&1, &6) &18d3 a2 2c ; rectangle: (&2, &a), size (&c, &2) &18d5 c1 ; object: (&1, &c) &18d6 00 e0 95 ; sprite: &70 (CURVED_PLATFORM) frame 0, (&5, &9) &18d9 31 bb ; sprite: frame 1, (&b, &b) &18db 32 7c ; sprite: frame 2, (&c, &7) &18dd c7 ; sprite: (&7, &c) &18de 33 78 ; sprite: frame 3, (&8, &7) &18e0 11 ; 1 rope, 1 ladder &18e1 5c ; rope: (&c, &5) &18e2 fe 14 ; ladder, (&e, &f), length &05, colour 2 &18e4 41 ; 2 pillars, colour 1 &18e5 a3 ; pillar: (&3, &a) &18e6 ad ; pillar: (&d, &a) &18e7 21 ; 3 enemies using 2 sprites &18e8 2e ; enemy sprite: &2e (BENDY_LEGS) (type &4), slots &1-&4 &18e9 2a ; enemy sprite: &2a (MAGIC) (type &2), slots &5-&8 &18ea 00 e8 ; enemy: slot 1 (BENDY_LEGS), (&8, &e), type 4, half_speed &18ec 47 8a 54 fd ; enemy: slot 5 (MAGIC), (&a, &8), type 2, x_range (&4, &d), y_range (&5, &f), speed (2, 4) &18f0 43 97 54 fd ; enemy: slot 5 (MAGIC), (&7, &9), type 2, x_range (&4, &d), y_range (&5, &f), speed (1, 4) ; room &5f &18f4 02 31 ; copy of room &31 ; room &60 &18f6 01 ; copy of room &00 ; room &61 &18f7 01 ; copy of room &00 ; room &62 &18f8 01 ; copy of room &00 ; room &63 &18f9 01 ; copy of room &00 ; room &64 &18fa 15 8b ; "The Desert" &18fc 6b ; background sprite: &6b (DITHER_YYG) &18fd 0b ; room has sprites, object, stars &18fe 02 ; 2 sprites before, 0 sprites after &18ff 16 00 dc f0 ; sprite: 6 sprites horizontally, &6e (DITHER_YKY) frame 0, (&0, &f) &1903 08 dc f0 ; sprite: &6e (DITHER_YKY) frame 0, y_offset 8, (&0, &f) &1906 09 ; 2 rectangles, 1 triangle &1907 40 9f ; rectangle: (&0, &4), size (&f, &9) &1909 e0 06 ; rectangle: (&0, &e), size (&6, &0) &190b f7 ed e7 ; triangle: (&7, &f-), (&d, &e), (&7, &e) &190e ed ; object: (&d, &e) ; room &65 &190f 20 8c ; "Stonehenge" &1911 6b ; background sprite: &6b (DITHER_YYG) &1912 48 ; room has stars, enemies &1913 29 ; 6 rectangles, 1 triangle &1914 40 9f ; rectangle: (&0, &4), size (&f, &9) &1916 00 3c b3 04 ; rectangle: STA &3c, (&3, &b), size (&4, &0) &191a c4 10 ; rectangle: (&4, &c), size (&0, &1) &191c c6 10 ; rectangle: (&6, &c), size (&0, &1) &191e d9 00 ; rectangle: (&9, &d), size (&0, &0) &1920 cd 10 ; rectangle: (&d, &c), size (&0, &1) &1922 c8 c2 c3 ; triangle: (&8, &c), (&2+, &c), (&3, &c) &1925 21 ; 3 enemies using 2 sprites &1926 28 ; enemy sprite: &28 (GOOGLY_FACE) (type &1), slots &1-&2 &1927 31 ; enemy sprite: &31 (TENTACLES) (type &0), slots &3-&4 &1928 02 ab 9e ; enemy: slot 1 (GOOGLY_FACE), (&b, &a), type 1, y_range (&f, &2), y_speed 2 &192b 2f da ; enemy: slot 3 (TENTACLES), (&a, &d), type 0 &192d 2f dc ; enemy: slot 3 (TENTACLES), (&c, &d), type 0 ; room &66 &192f 02 69 ; copy of room &69 ; room &67 &1931 14 8d ; "The Wasteland" &1933 6b ; background sprite: &6b (DITHER_YYG) &1934 48 ; room has stars, enemies &1935 09 ; 2 rectangles, 1 triangle &1936 40 9f ; rectangle: (&0, &4), size (&f, &9) &1938 00 c3 b7 00 ; rectangle: STA &c3, (&7, &b), size (&0, &0) &193c 00 c3 e5 e9 b8 ; triangle: STA &c3, (&5-, &e-), (&9, &e), (&8, &b) &1941 00 ; 1 enemy using 1 sprite &1942 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &1943 05 97 ; enemy: slot 1 (MONK), (&7, &9), type 6, colour 1 ; room &68 &1945 1f 8e ; "Witch's House" &1947 6b ; background sprite: &6b (DITHER_YYG) &1948 4a ; room has object, stars, enemies &1949 21 ; 5 rectangles, 1 triangle &194a 40 9f ; rectangle: (&0, &4), size (&f, &9) &194c 00 0f b5 25 ; rectangle: STA &0f, (&5, &b), size (&5, &2) &1950 96 00 ; rectangle: (&6, &9), size (&0, &0) &1952 00 32 c9 10 ; rectangle: STA &32, (&9, &c), size (&0, &1) &1956 00 04 c6 00 ; rectangle: STA &04, (&6, &c), size (&0, &0) &195a 00 a3 b4 bb 98 ; triangle: STA &a3, (&4-, &b-), (&b, &b), (&8, &9) &195f ed ; object: (&d, &e) &1960 00 ; 1 enemy using 1 sprite &1961 31 ; enemy sprite: &31 (TENTACLES) (type &0), slots &1-&2 &1962 0f d3 ; enemy: slot 1 (TENTACLES), (&3, &d), type 0 ; room &69 &1964 0b 8d ; "The Wasteland" &1966 6b ; background sprite: &6b (DITHER_YYG) &1967 48 ; room has stars, enemies &1968 00 ; 1 rectangle, 0 triangles &1969 40 9f ; rectangle: (&0, &4), size (&f, &9) &196b 00 ; 1 enemy using 1 sprite &196c 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &196d 08 c8 ; enemy: slot 1 (MONK), (&8, &c), type 6, colour 2 ; room &6a &196f 21 8d ; "The Wasteland" &1971 6b ; background sprite: &6b (DITHER_YYG) &1972 79 ; room has sprites, stars, door, pillars, enemies &1973 40 ; 0 sprites before, 8 sprites after &1974 00 ; 1 rectangle, 0 triangles &1975 40 9f ; rectangle: (&0, &4), size (&f, &9) &1977 00 d4 63 ; sprite: &6a (CANNON) frame 0, (&3, &6) &197a 00 a4 73 ; sprite: &52 (STONES_RKM) frame 0, (&3, &7) &197d 12 83 ; sprite: 3 sprites horizontally, (&3, &8) &197f 93 ; sprite: (&3, &9) &1980 a3 ; sprite: (&3, &a) &1981 b3 ; sprite: (&3, &b) &1982 d3 ; sprite: (&3, &d) &1983 10 0c 76 95 ; sprite: 1 sprite horizontally, &3b (C) frame 0, y_offset 12, (&5, &9) &1987 00 c5; door: type &00, (&5, &c) &1989 81 ; 2 pillars, colour 2 &198a c4 ; pillar: (&4, &c) &198b c6 ; pillar: (&6, &c) &198c 00 ; 1 enemy using 1 sprite &198d 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &198e 04 65 ; enemy: slot 1 (MONK), (&5, &6), type 6, colour 1 ; room &6b &1990 4e 65 65 74 61 47 20 74 73 65 ; "West Gate" &199a 5c ; background sprite: &5c (BRICKS_RY) &199b 49 ; room has sprites, stars, enemies &199c 24 ; 4 sprites before, 4 sprites after &199d 19 00 d6 e0 ; sprite: 9 sprites horizontally, &6b (DITHER_YYG) frame 0, (&0, &e) &19a1 f0 ; sprite: (&0, &f) &19a2 08 d6 e0 ; sprite: &6b (DITHER_YYG) frame 0, y_offset 8, (&0, &e) &19a5 f0 ; sprite: (&0, &f) &19a6 2b ; 6 rectangles, 3 triangles &19a7 40 5d ; rectangle: (&0, &4), size (&d, &5) &19a9 a0 2f ; rectangle: (&0, &a), size (&f, &2) &19ab d0 0c ; rectangle: (&0, &d), size (&c, &0) &19ad e5 07 ; rectangle: (&5, &e), size (&7, &0) &19af 5f 00 ; rectangle: (&f, &5), size (&0, &0) &19b1 00 9c 6f 30 ; rectangle: STA &9c, (&f, &6), size (&0, &3) &19b5 00 8d e0 e5 d5 ; triangle: STA &8d, (&0-, &e-), (&5, &e), (&5, &d) &19ba d9 e5 d5 ; triangle: (&9, &d), (&5, &e), (&5, &d) &19bd 00 1e d8 d8 6e ; triangle: STA &1e, (&8-, &d-), (&8+, &d), (&e, &6) &19c2 01 d4 c5 ; sprite: &6a (CANNON) frame 0, x_offset 2, (&5, &c) &19c5 23 01 24 5f ; sprite: 4 sprites vertically, &12 (CHAIN_LINK) frame 0, x_offset 2, (&f, &5) &19c9 17 00 18 f5 ; sprite: 8 sprites horizontally, &0c (WATER_SURFACE) frame 0, (&5, &f) &19cd 16 00 0d d7 ; sprite: 7 sprites horizontally, &06 (OBJECT_PLINTH) frame 1, (&7, &d) &19d1 21 ; 3 enemies using 2 sprites &19d2 2a ; enemy sprite: &2a (MAGIC) (type &2), slots &1-&4 &19d3 2b ; enemy sprite: &2b (SNAKE) (type &0), slots &5-&8 &19d4 03 a5 a5 de ; enemy: slot 1 (MAGIC), (&5, &a), type 2, x_range (&5, &e), y_range (&a, &d), speed (1, 4) &19d8 42 c9 e5 ; enemy: slot 5 (SNAKE), (&9, &c), type 0, x_range (&5, &e), x_speed 2 &19db 42 cb 5e ; enemy: slot 5 (SNAKE), (&b, &c), type 0, x_range (&e, &5), x_speed 2 ; room &6c &19de 2b 87 ; "West Wing" &19e0 61 ; background sprite: &61 (STRIPES_CG) &19e1 67 ; room has sprites, object, ropes/ladders, pillars, enemies &19e2 10 ; 0 sprites before, 2 sprites after &19e3 30 ; 7 rectangles, 0 triangles &19e4 41 00 ; rectangle: (&1, &4), size (&0, &0) &19e6 51 2d ; rectangle: (&1, &5), size (&d, &2) &19e8 8b 13 ; rectangle: (&b, &8), size (&3, &1) &19ea a0 2e ; rectangle: (&0, &a), size (&e, &2) &19ec d3 0b ; rectangle: (&3, &d), size (&b, &0) &19ee e4 0a ; rectangle: (&4, &e), size (&a, &0) &19f0 f7 02 ; rectangle: (&7, &f), size (&2, &0) &19f2 88 ; object: (&8, &8) &19f3 0f e0 e8 ; sprite: &70 (CURVED_PLATFORM) frame 0, x_offset 6, y_offset 12, (&8, &e) &19f6 08 74 13 eb ; sprite: &3a (TRAMPOLINE) frame 0, y_offset 8, 4 sprites horizontally, (&b, &e) &19fa 01 ; 1 rope, 0 ladders &19fb 61 ; rope: (&1, &6) &19fc 45 ; 6 pillars, colour 1 &19fd 52 ; pillar: (&2, &5) &19fe 56 ; pillar: (&6, &5) &19ff 5a ; pillar: (&a, &5) &1a00 a2 ; pillar: (&2, &a) &1a01 a6 ; pillar: (&6, &a) &1a02 aa ; pillar: (&a, &a) &1a03 00 ; 1 enemy using 1 sprite &1a04 2c ; enemy sprite: &2c (PULSING_CIRCLES) (type &2), slots &1-&3 &1a05 01 cd fb 5f ; enemy: slot 1 (PULSING_CIRCLES), (&d, &c), type 2, x_range (&b, &f), y_range (&f, &5), speed (1, 1) ; room &6d &1a09 29 8f ; "FrEeZeR" &1a0b 6f ; background sprite: &6f (DITHER_CWW) &1a0c 65 ; room has sprites, ropes/ladders, pillars, enemies &1a0d 00 ; 0 sprites before, 0 sprites after &1a0e 28 ; 6 rectangles, 0 triangles &1a0f 00 fe 82 4d ; rectangle: STA &fe, (&2, &8), size (&d, &4) &1a13 00 00 51 2e ; rectangle: STA &00, (&1, &5), size (&e, &2) &1a17 85 1a ; rectangle: (&5, &8), size (&a, &1) &1a19 a6 13 ; rectangle: (&6, &a), size (&3, &1) &1a1b c8 10 ; rectangle: (&8, &c), size (&0, &1) &1a1d e1 0e ; rectangle: (&1, &e), size (&e, &0) &1a1f 10 ; 0 ropes, 1 ladder &1a20 e1 3b ; ladder, (&1, &e), length &0e, colour 1 &1a22 73 ; 4 pillars, colour 1 &1a23 e2 ; pillar: (&2, &e) &1a24 e6 ; pillar: (&6, &e) &1a25 e9 ; pillar: (&9, &e) &1a26 ed ; pillar: (&d, &e) &1a27 20 ; 3 enemies using 1 sprite &1a28 19 ; enemy sprite: &19 (SNOWBALL) (type &0), slots &1-&2 &1a29 04 96 5d ; enemy: slot 1 (SNOWBALL), (&6, &9), type 0, x_range (&d, &5), x_speed 4 &1a2c 02 b8 6a ; enemy: slot 1 (SNOWBALL), (&8, &b), type 0, x_range (&a, &6), x_speed 2 &1a2f 02 ed 1f ; enemy: slot 1 (SNOWBALL), (&d, &e), type 0, x_range (&f, &1), x_speed 2 ; room &6e &1a32 3c 8f ; "FrEeZeR" &1a34 6f ; background sprite: &6f (DITHER_CWW) &1a35 67 ; room has sprites, object, ropes/ladders, pillars, enemies &1a36 10 ; 0 sprites before, 2 sprites after &1a37 50 ; 11 rectangles, 0 triangles &1a38 5f 00 ; rectangle: (&f, &5), size (&0, &0) &1a3a 50 2c ; rectangle: (&0, &5), size (&c, &2) &1a3c 80 12 ; rectangle: (&0, &8), size (&2, &1) &1a3e e0 0e ; rectangle: (&0, &e), size (&e, &0) &1a40 00 fe 7a 02 ; rectangle: STA &fe, (&a, &7), size (&2, &0) &1a44 a1 2d ; rectangle: (&1, &a), size (&d, &2) &1a46 00 00 92 1c ; rectangle: STA &00, (&2, &9), size (&c, &1) &1a4a b5 09 ; rectangle: (&5, &b), size (&9, &0) &1a4c c3 10 ; rectangle: (&3, &c), size (&0, &1) &1a4e 00 05 af 00 ; rectangle: STA &05, (&f, &a), size (&0, &0) &1a52 ef 00 ; rectangle: (&f, &e), size (&0, &0) &1a54 7b ; object: (&b, &7) &1a55 00 e8 33 12 84 ; sprite: &74 (SPIKES_MONOCHROME) frame 0, frame 3, 3 sprites horizontally, (&4, &8) &1a5a c7 ; sprite: (&7, &c) &1a5b 10 ; 0 ropes, 1 ladder &1a5c 5e 0a ; ladder, (&e, &5), length &02, colour 2 &1a5e 63 ; 4 pillars, colour 1 &1a5f 93 ; pillar: (&3, &9) &1a60 e1 ; pillar: (&1, &e) &1a61 e7 ; pillar: (&7, &e) &1a62 ed ; pillar: (&d, &e) &1a63 20 ; 3 enemies using 1 sprite &1a64 19 ; enemy sprite: &19 (SNOWBALL) (type &0), slots &1-&2 &1a65 02 76 3a ; enemy: slot 1 (SNOWBALL), (&6, &7), type 0, x_range (&a, &3), x_speed 2 &1a68 04 b8 f5 ; enemy: slot 1 (SNOWBALL), (&8, &b), type 0, x_range (&5, &f), x_speed 4 &1a6b 02 e6 1f ; enemy: slot 1 (SNOWBALL), (&6, &e), type 0, x_range (&f, &1), x_speed 2 ; room &6f &1a6e 3a 90 ; "Central Castle" &1a70 55 ; background sprite: &55 (STONES_YCG) &1a71 77 ; room has sprites, object, ropes/ladders, door, pillars, enemies &1a72 18 ; 0 sprites before, 3 sprites after &1a73 40 ; 9 rectangles, 0 triangles &1a74 50 02 ; rectangle: (&0, &5), size (&2, &0) &1a76 53 1b ; rectangle: (&3, &5), size (&b, &1) &1a78 4e 00 ; rectangle: (&e, &4), size (&0, &0) &1a7a a0 0f ; rectangle: (&0, &a), size (&f, &0) &1a7c 83 1b ; rectangle: (&3, &8), size (&b, &1) &1a7e b7 26 ; rectangle: (&7, &b), size (&6, &2) &1a80 e7 11 ; rectangle: (&7, &e), size (&1, &1) &1a82 e0 00 ; rectangle: (&0, &e), size (&0, &0) &1a84 c1 23 ; rectangle: (&1, &c), size (&3, &2) &1a86 f3 ; object: (&3, &f) &1a87 02 4b e8 ; sprite: &25 (TOP_OF_ROPE) frame 1, x_offset 4, (&8, &e) &1a8a 06 7a b7 ; sprite: &3d (HORNED_SKULL) frame 0, x_offset 4, y_offset 4, (&7, &b) &1a8d bb ; sprite: (&b, &b) &1a8e 11 ; 1 rope, 1 ladder &1a8f f8 ; rope: (&8, &f) &1a90 6e 13 ; ladder, (&e, &6), length &04, colour 2 &1a92 04 a2; door: type &04, (&2, &a) &1a94 03 ; 4 pillars, colour 0 &1a95 52 ; pillar: (&2, &5) &1a96 55 ; pillar: (&5, &5) &1a97 58 ; pillar: (&8, &5) &1a98 5b ; pillar: (&b, &5) &1a99 31 ; 4 enemies using 2 sprites &1a9a 27 ; enemy sprite: &27 (LIFT) (type &1), slots &1-&3 &1a9b 2b ; enemy sprite: &2b (SNAKE) (type &0), slots &4-&7 &1a9c 04 ba 8e ; enemy: slot 1 (LIFT), (&a, &b), type 1, y_range (&2, &3), y_speed 4 &1a9f 32 66 6b ; enemy: slot 4 (SNAKE), (&6, &6), type 0, x_range (&b, &6), x_speed 2 &1aa2 32 d8 8e ; enemy: slot 4 (SNAKE), (&8, &d), type 0, x_range (&e, &8), x_speed 2 &1aa5 32 69 b6 ; enemy: slot 4 (SNAKE), (&9, &6), type 0, x_range (&6, &b), x_speed 2 ; room &70 &1aa8 40 61 61 6e 65 72 ; "Arena" &1aae 5a ; background sprite: &5a (BRICKS_MBG) &1aaf 66 ; room has object, ropes/ladders, pillars, enemies &1ab0 88 ; 18 rectangles, 0 triangles &1ab1 52 01 ; rectangle: (&2, &5), size (&1, &0) &1ab3 56 02 ; rectangle: (&6, &5), size (&2, &0) &1ab5 5a 02 ; rectangle: (&a, &5), size (&2, &0) &1ab7 61 1c ; rectangle: (&1, &6), size (&c, &1) &1ab9 72 2c ; rectangle: (&2, &7), size (&c, &2) &1abb 91 27 ; rectangle: (&1, &9), size (&7, &2) &1abd aa 03 ; rectangle: (&a, &a), size (&3, &0) &1abf b6 28 ; rectangle: (&6, &b), size (&8, &2) &1ac1 c2 01 ; rectangle: (&2, &c), size (&1, &0) &1ac3 d2 0c ; rectangle: (&2, &d), size (&c, &0) &1ac5 e3 03 ; rectangle: (&3, &e), size (&3, &0) &1ac7 e8 02 ; rectangle: (&8, &e), size (&2, &0) &1ac9 ec 01 ; rectangle: (&c, &e), size (&1, &0) &1acb a0 00 ; rectangle: (&0, &a), size (&0, &0) &1acd f4 00 ; rectangle: (&4, &f), size (&0, &0) &1acf cf 00 ; rectangle: (&f, &c), size (&0, &0) &1ad1 8f 00 ; rectangle: (&f, &8), size (&0, &0) &1ad3 4b 00 ; rectangle: (&b, &4), size (&0, &0) &1ad5 85 ; object: (&5, &8) &1ad6 12 ; 2 ropes, 1 ladder &1ad7 97 ; rope: (&7, &9) &1ad8 8b ; rope: (&b, &8) &1ad9 f4 09 ; ladder, (&4, &f), length &02, colour 0 &1adb 01 ; 2 pillars, colour 0 &1adc 69 ; pillar: (&9, &6) &1add b9 ; pillar: (&9, &b) &1ade 30 ; 4 enemies using 1 sprite &1adf 2f ; enemy sprite: &2f (BLOCK) (type &3), slots &1-&3 &1ae0 05 e5 ; enemy: slot 1 (BLOCK), (&5, &e), type 3, direction 1, speed 1 &1ae2 05 db ; enemy: slot 1 (BLOCK), (&b, &d), type 3, direction 1, speed 1 &1ae4 0e 9d ; enemy: slot 1 (BLOCK), (&d, &9), type 3, direction 2, speed 3 &1ae6 0b 6c ; enemy: slot 1 (BLOCK), (&c, &6), type 3, direction 3, speed 2 ; room &71 &1ae8 5c 91 ; "The Well Wheel" &1aea 5f ; background sprite: &5f (BRICKS_CB) &1aeb 75 ; room has sprites, ropes/ladders, door, pillars, enemies &1aec 52 ; 2 sprites before, 10 sprites after &1aed 00 b6 21 e6 ; sprite: &5b (BRICKS_CKG) frame 0, 1 sprite vertically, (&6, &e) &1af1 e9 ; sprite: (&9, &e) &1af2 58 ; 12 rectangles, 0 triangles &1af3 80 01 ; rectangle: (&0, &8), size (&1, &0) &1af5 43 50 ; rectangle: (&3, &4), size (&0, &5) &1af7 a2 43 ; rectangle: (&2, &a), size (&3, &4) &1af9 b1 00 ; rectangle: (&1, &b), size (&0, &0) &1afb c0 01 ; rectangle: (&0, &c), size (&1, &0) &1afd c6 13 ; rectangle: (&6, &c), size (&3, &1) &1aff aa 44 ; rectangle: (&a, &a), size (&4, &4) &1b01 bf 10 ; rectangle: (&f, &b), size (&0, &1) &1b03 e7 11 ; rectangle: (&7, &e), size (&1, &1) &1b05 56 33 ; rectangle: (&6, &5), size (&3, &3) &1b07 97 11 ; rectangle: (&7, &9), size (&1, &1) &1b09 75 0a ; rectangle: (&5, &7), size (&a, &0) &1b0b 04 1e 75 ; sprite: &0f (SWITCH) frame 0, y_offset 4, (&5, &7) &1b0e 00 e6 b1 ; sprite: &73 (SPIKES_MULTICOLOURED) frame 0, (&1, &b) &1b11 00 72 bc ; sprite: &39 (SHIELD) frame 0, (&c, &b) &1b14 03 72 32 bc ; sprite: &39 (SHIELD) frame 0, x_offset 6, frame 2, (&c, &b) &1b18 05 c8 67 ; sprite: &64 (WELL_WHEEL) frame 0, x_offset 2, y_offset 4, (&7, &6) &1b1b 04 c9 68 ; sprite: &64 (WELL_WHEEL) frame 1, y_offset 4, (&8, &6) &1b1e 01 c8 32 77 ; sprite: &64 (WELL_WHEEL) frame 0, x_offset 2, frame 2, (&7, &7) &1b22 00 c8 33 78 ; sprite: &64 (WELL_WHEEL) frame 0, frame 3, (&8, &7) &1b26 13 08 e9 e2 ; sprite: 4 sprites horizontally, &74 (SPIKES_MONOCHROME) frame 1, y_offset 8, (&2, &e) &1b2a 01 34 21 b8 ; sprite: &1a (BLOCK_BLACK) frame 0, x_offset 2, 2 sprites vertically, (&8, &b) &1b2e 02 ; 2 ropes, 0 ladders &1b2f 53 ; rope: (&3, &5) &1b30 f8 ; rope: (&8, &f) &1b31 03 7d; door: type &03, (&d, &7) &1b33 02 ; 3 pillars, colour 0 &1b34 7b ; pillar: (&b, &7) &1b35 c6 ; pillar: (&6, &c) &1b36 c9 ; pillar: (&9, &c) &1b37 22 ; 3 enemies using 3 sprites &1b38 2b ; enemy sprite: &2b (SNAKE) (type &0), slots &1-&4 &1b39 0f ; enemy sprite: &0f (SWITCH) (type &0), slots &5-&6 &1b3a 27 ; enemy sprite: &27 (LIFT) (type &1), slots &7-&9 &1b3b 02 ea af ; enemy: slot 1 (SNAKE), (&a, &e), type 0, x_range (&f, &a), x_speed 2 &1b3e 02 ed af ; enemy: slot 1 (SNAKE), (&d, &e), type 0, x_range (&f, &a), x_speed 2 &1b41 64 c3 f9 ; enemy: slot 7 (LIFT), (&3, &c), type 1, y_range (&b, &3), y_speed 4 ; room &72 &1b44 3b 8a ; "East Wing" &1b46 5e ; background sprite: &5e (BRICKS_GC) &1b47 67 ; room has sprites, object, ropes/ladders, pillars, enemies &1b48 28 ; 0 sprites before, 5 sprites after &1b49 38 ; 8 rectangles, 0 triangles &1b4a 51 83 ; rectangle: (&1, &5), size (&3, &8) &1b4c 56 06 ; rectangle: (&6, &5), size (&6, &0) &1b4e 65 48 ; rectangle: (&5, &6), size (&8, &4) &1b50 70 00 ; rectangle: (&0, &7), size (&0, &0) &1b52 b0 10 ; rectangle: (&0, &b), size (&0, &1) &1b54 f7 00 ; rectangle: (&7, &f), size (&0, &0) &1b56 fb 00 ; rectangle: (&b, &f), size (&0, &0) &1b58 d7 14 ; rectangle: (&7, &d), size (&4, &1) &1b5a f9 ; object: (&9, &f) &1b5b 0c 7a 88 ; sprite: &3d (HORNED_SKULL) frame 0, y_offset 12, (&8, &8) &1b5e 0d 7a 8a ; sprite: &3d (HORNED_SKULL) frame 0, x_offset 2, y_offset 12, (&a, &8) &1b61 82 ; sprite: (&2, &8) &1b62 01 24 29 d7 ; sprite: &12 (CHAIN_LINK) frame 0, x_offset 2, 10 sprites vertically, (&7, &d) &1b66 08 e8 12 d1 ; sprite: &74 (SPIKES_MONOCHROME) frame 0, y_offset 8, 3 sprites horizontally, (&1, &d) &1b6a 11 ; 1 rope, 1 ladder &1b6b 71 ; rope: (&1, &7) &1b6c fe 58 ; ladder, (&e, &f), length &16, colour 2 &1b6e 03 ; 4 pillars, colour 0 &1b6f 65 ; pillar: (&5, &6) &1b70 6d ; pillar: (&d, &6) &1b71 70 ; pillar: (&0, &7) &1b72 b0 ; pillar: (&0, &b) &1b73 21 ; 3 enemies using 2 sprites &1b74 2d ; enemy sprite: &2d (FIRE) (type &7), slots &1-&4 &1b75 27 ; enemy sprite: &27 (LIFT) (type &1), slots &5-&7 &1b76 42 a4 9e ; enemy: slot 5 (LIFT), (&4, &a), type 1, y_range (&2, &0), y_speed 2 &1b79 02 a7 6c ; enemy: slot 1 (FIRE), (&7, &a), type 7, x_range (&c, &6), x_speed 2 &1b7c 02 aa 9f ; enemy: slot 1 (FIRE), (&a, &a), type 7, x_range (&f, &9), x_speed 2 ; room &73 &1b7f 02 31 ; copy of room &31 ; room &74 &1b81 01 ; copy of room &00 ; room &75 &1b82 01 ; copy of room &00 ; room &76 &1b83 01 ; copy of room &00 ; room &77 &1b84 01 ; copy of room &00 ; room &78 &1b85 14 92 ; "The Island" &1b87 6d ; background sprite: &6d (DITHER_RKM) &1b88 0d ; room has sprites, ropes/ladders, stars &1b89 08 ; 0 sprites before, 1 sprite after &1b8a 11 ; 3 rectangles, 1 triangle &1b8b 40 8f ; rectangle: (&0, &4), size (&f, &8) &1b8d d0 2b ; rectangle: (&0, &d), size (&b, &2) &1b8f df 00 ; rectangle: (&f, &d), size (&0, &0) &1b91 df ee d9 ; triangle: (&f, &d), (&e, &e), (&9, &d) &1b94 0a 4b db ; sprite: &25 (TOP_OF_ROPE) frame 1, x_offset 4, y_offset 8, (&b, &d) &1b97 01 ; 1 rope, 0 ladders &1b98 fb ; rope: (&b, &f) ; room &79 &1b99 1b 92 ; "The Island" &1b9b 6d ; background sprite: &6d (DITHER_RKM) &1b9c 69 ; room has sprites, stars, pillars, enemies &1b9d 08 ; 0 sprites before, 1 sprite after &1b9e 10 ; 3 rectangles, 0 triangles &1b9f 40 9f ; rectangle: (&0, &4), size (&f, &9) &1ba1 00 dc 95 04 ; rectangle: STA &dc, (&5, &9), size (&4, &0) &1ba5 c6 12 ; rectangle: (&6, &c), size (&2, &1) &1ba7 04 76 97 ; sprite: &3b (C) frame 0, y_offset 4, (&7, &9) &1baa 01 ; 2 pillars, colour 0 &1bab a6 ; pillar: (&6, &a) &1bac a8 ; pillar: (&8, &a) &1bad 11 ; 2 enemies using 2 sprites &1bae 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &1baf 31 ; enemy sprite: &31 (TENTACLES) (type &0), slots &5-&6 &1bb0 05 a7 ; enemy: slot 1 (MONK), (&7, &a), type 6, colour 1 &1bb2 4f dc ; enemy: slot 5 (TENTACLES), (&c, &d), type 0 ; room &7a &1bb4 01 ; copy of room &00 ; room &7b &1bb5 01 ; copy of room &00 ; room &7c &1bb6 01 ; copy of room &00 ; room &7d &1bb7 01 ; copy of room &00 ; room &7e &1bb8 01 ; copy of room &00 ; room &7f &1bb9 01 ; copy of room &00 ; room &80 &1bba 3e 87 ; "West Wing" &1bbc 5b ; background sprite: &5b (BRICKS_CKG) &1bbd 65 ; room has sprites, ropes/ladders, pillars, enemies &1bbe 40 ; 0 sprites before, 8 sprites after &1bbf 38 ; 8 rectangles, 0 triangles &1bc0 47 82 ; rectangle: (&7, &4), size (&2, &8) &1bc2 52 13 ; rectangle: (&2, &5), size (&3, &1) &1bc4 5b 13 ; rectangle: (&b, &5), size (&3, &1) &1bc6 75 19 ; rectangle: (&5, &7), size (&9, &1) &1bc8 b2 13 ; rectangle: (&2, &b), size (&3, &1) &1bca ac 13 ; rectangle: (&c, &a), size (&3, &1) &1bcc bb 13 ; rectangle: (&b, &b), size (&3, &1) &1bce d1 1d ; rectangle: (&1, &d), size (&d, &1) &1bd0 04 1e d1 ; sprite: &0f (SWITCH) frame 0, y_offset 4, (&1, &d) &1bd3 0b 7b dd ; sprite: &3d (HORNED_SKULL) frame 1, x_offset 6, y_offset 8, (&d, &d) &1bd6 c3 ; sprite: (&3, &c) &1bd7 02 c4 7c ; sprite: &62 (URN) frame 0, x_offset 4, (&c, &7) &1bda 00 c5 8c ; sprite: &62 (URN) frame 1, (&c, &8) &1bdd 32 8d ; sprite: frame 2, (&d, &8) &1bdf 00 30 12 72 ; sprite: &18 (BARREL) frame 0, 3 sprites horizontally, (&2, &7) &1be3 82 ; sprite: (&2, &8) &1be4 10 ; 0 ropes, 1 ladder &1be5 e9 2c ; ladder, (&9, &e), length &0b, colour 1 &1be7 03 ; 4 pillars, colour 0 &1be8 76 ; pillar: (&6, &7) &1be9 7a ; pillar: (&a, &7) &1bea d6 ; pillar: (&6, &d) &1beb da ; pillar: (&a, &d) &1bec 22 ; 3 enemies using 3 sprites &1bed 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &1bee 0f ; enemy sprite: &0f (SWITCH) (type &0), slots &5-&6 &1bef 27 ; enemy sprite: &27 (LIFT) (type &1), slots &7-&9 &1bf0 04 52 ; enemy: slot 1 (MONK), (&2, &5), type 6, colour 1 &1bf2 60 69 59 ; enemy: slot 7 (LIFT), (&9, &6), type 1, y_range (&0, &6), y_speed 0 &1bf5 60 ce af ; enemy: slot 7 (LIFT), (&e, &c), type 1, y_range (&3, &2), y_speed 0 ; room &81 &1bf8 23 87 ; "West Wing" &1bfa 51 ; background sprite: &51 (STONES_RYM) &1bfb 47 ; room has sprites, object, ropes/ladders, enemies &1bfc 10 ; 0 sprites before, 2 sprites after &1bfd 10 ; 3 rectangles, 0 triangles &1bfe 52 2d ; rectangle: (&2, &5), size (&d, &2) &1c00 a0 18 ; rectangle: (&0, &a), size (&8, &1) &1c02 b3 1c ; rectangle: (&3, &b), size (&c, &1) &1c04 de ; object: (&e, &d) &1c05 08 7a b6 ; sprite: &3d (HORNED_SKULL) frame 0, y_offset 8, (&6, &b) &1c08 bc ; sprite: (&c, &b) &1c09 20 ; 0 ropes, 2 ladders &1c0a c2 29 ; ladder, (&2, &c), length &0a, colour 2 &1c0c ca 2a ; ladder, (&a, &c), length &0a, colour 2 &1c0e 32 ; 4 enemies using 3 sprites &1c0f 2e ; enemy sprite: &2e (BENDY_LEGS) (type &4), slots &1-&4 &1c10 2b ; enemy sprite: &2b (SNAKE) (type &0), slots &5-&8 &1c11 31 ; enemy sprite: &31 (TENTACLES) (type &0), slots &9-&a &1c12 00 c5 ; enemy: slot 1 (BENDY_LEGS), (&5, &c), type 4, half_speed &1c14 42 77 29 ; enemy: slot 5 (SNAKE), (&7, &7), type 0, x_range (&9, &2), x_speed 2 &1c17 8f 75 ; enemy: slot 9 (TENTACLES), (&5, &7), type 0 &1c19 8f 7d ; enemy: slot 9 (TENTACLES), (&d, &7), type 0 ; room &82 &1c1b 37 90 ; "Central Castle" &1c1d 59 ; background sprite: &59 (BRICKS_GYR) &1c1e 67 ; room has sprites, object, ropes/ladders, pillars, enemies &1c1f 28 ; 0 sprites before, 5 sprites after &1c20 28 ; 6 rectangles, 0 triangles &1c21 50 2c ; rectangle: (&0, &5), size (&c, &2) &1c23 63 3b ; rectangle: (&3, &6), size (&b, &3) &1c25 a7 07 ; rectangle: (&7, &a), size (&7, &0) &1c27 b0 15 ; rectangle: (&0, &b), size (&5, &1) &1c29 c4 1b ; rectangle: (&4, &c), size (&b, &1) &1c2b b7 08 ; rectangle: (&7, &b), size (&8, &0) &1c2d e5 ; object: (&5, &e) &1c2e 00 e6 c6 ; sprite: &73 (SPIKES_MULTICOLOURED) frame 0, (&6, &c) &1c31 06 7b b8 ; sprite: &3d (HORNED_SKULL) frame 1, x_offset 4, y_offset 4, (&8, &b) &1c34 bb ; sprite: (&b, &b) &1c35 08 74 de ; sprite: &3a (TRAMPOLINE) frame 0, y_offset 8, (&e, &d) &1c38 13 08 e8 33 93 ; sprite: 4 sprites horizontally, &74 (SPIKES_MONOCHROME) frame 0, y_offset 8, frame 3, (&3, &9) &1c3d 13 ; 3 ropes, 1 ladder &1c3e 75 ; rope: (&5, &7) &1c3f a8 ; rope: (&8, &a) &1c40 ab ; rope: (&b, &a) &1c41 fd 0f ; ladder, (&d, &f), length &03, colour 1 &1c43 02 ; 3 pillars, colour 0 &1c44 52 ; pillar: (&2, &5) &1c45 56 ; pillar: (&6, &5) &1c46 c6 ; pillar: (&6, &c) &1c47 21 ; 3 enemies using 2 sprites &1c48 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &1c49 29 ; enemy sprite: &29 (ROPE_CLIMBER) (type &1), slots &5-&6 &1c4a 01 b3 ; enemy: slot 1 (MONK), (&3, &b), type 6, colour 0 &1c4c 42 78 5b ; enemy: slot 5 (ROPE_CLIMBER), (&8, &7), type 1, y_range (&4, &4), y_speed 2 &1c4f 44 8b b5 ; enemy: slot 5 (ROPE_CLIMBER), (&b, &8), type 1, y_range (&b, &3), y_speed 4 ; room &83 &1c52 3b 93 ; "Main Hall" &1c54 58 ; background sprite: &58 (BRICKS_RYM) &1c55 67 ; room has sprites, object, ropes/ladders, pillars, enemies &1c56 18 ; 0 sprites before, 3 sprites after &1c57 1d ; 4 rectangles, 5 triangles &1c58 47 11 ; rectangle: (&7, &4), size (&1, &1) &1c5a 64 17 ; rectangle: (&4, &6), size (&7, &1) &1c5c 82 2b ; rectangle: (&2, &8), size (&b, &2) &1c5e b0 2f ; rectangle: (&0, &b), size (&f, &2) &1c60 64 6b 58 ; triangle: (&4-, &6-), (&b, &6), (&8, &5) &1c63 84 82 64 ; triangle: (&4, &8-), (&2+, &8), (&4, &6) &1c66 b2 b1 82 ; triangle: (&2, &b-), (&1+, &b), (&2, &8) &1c69 8c 8d 6c ; triangle: (&c, &8-), (&d, &8), (&c, &6) &1c6c bf be 8e ; triangle: (&f, &b-), (&e, &b), (&e, &8) &1c6f e9 ; object: (&9, &e) &1c70 00 c5 d3 ; sprite: &62 (URN) frame 1, (&3, &d) &1c73 06 72 a9 ; sprite: &39 (SHIELD) frame 0, x_offset 4, y_offset 4, (&9, &a) &1c76 04 72 32 aa ; sprite: &39 (SHIELD) frame 0, y_offset 4, frame 2, (&a, &a) &1c7a 02 ; 2 ropes, 0 ladders &1c7b b6 ; rope: (&6, &b) &1c7c 78 ; rope: (&8, &7) &1c7d 41 ; 2 pillars, colour 1 &1c7e b0 ; pillar: (&0, &b) &1c7f bf ; pillar: (&f, &b) &1c80 32 ; 4 enemies using 3 sprites &1c81 75 ; enemy sprite: &75 (TORCH) (type &0), slots &1-&4 &1c82 29 ; enemy sprite: &29 (ROPE_CLIMBER) (type &1), slots &5-&6 &1c83 31 ; enemy sprite: &31 (TENTACLES) (type &0), slots &7-&8 &1c84 0f 93 ; enemy: slot 1 (TORCH), (&3, &9), type 0 &1c86 0f 9c ; enemy: slot 1 (TORCH), (&c, &9), type 0 &1c88 42 b6 c6 ; enemy: slot 5 (ROPE_CLIMBER), (&6, &b), type 1, y_range (&f, &6), y_speed 2 &1c8b 6f dd ; enemy: slot 7 (TENTACLES), (&d, &d), type 0 ; room &84 &1c8d 30 90 ; "Central Castle" &1c8f 53 ; background sprite: &53 (STONES_CBC) &1c90 67 ; room has sprites, object, ropes/ladders, pillars, enemies &1c91 20 ; 0 sprites before, 4 sprites after &1c92 10 ; 3 rectangles, 0 triangles &1c93 52 29 ; rectangle: (&2, &5), size (&9, &2) &1c95 75 2a ; rectangle: (&5, &7), size (&a, &2) &1c97 b0 2f ; rectangle: (&0, &b), size (&f, &2) &1c99 ea ; object: (&a, &e) &1c9a 0e 7a 78 ; sprite: &3d (HORNED_SKULL) frame 0, x_offset 4, y_offset 12, (&8, &7) &1c9d 04 66 d5 ; sprite: &33 (CAULDRON) frame 0, y_offset 4, (&5, &d) &1ca0 dd ; sprite: (&d, &d) &1ca1 31 d8 ; sprite: frame 1, (&8, &d) &1ca3 10 ; 0 ropes, 1 ladder &1ca4 74 19 ; ladder, (&4, &7), length &06, colour 0 &1ca6 03 ; 4 pillars, colour 0 &1ca7 7e ; pillar: (&e, &7) &1ca8 b4 ; pillar: (&4, &b) &1ca9 b9 ; pillar: (&9, &b) &1caa be ; pillar: (&e, &b) &1cab 51 ; 6 enemies using 2 sprites &1cac 32 ; enemy sprite: &32 (STEAM) (type &0), slots &1-&4 &1cad 2d ; enemy sprite: &2d (FIRE) (type &7), slots &5-&8 &1cae 0f d5 ; enemy: slot 1 (STEAM), (&5, &d), type 0 &1cb0 0f d8 ; enemy: slot 1 (STEAM), (&8, &d), type 0 &1cb2 0f dd ; enemy: slot 1 (STEAM), (&d, &d), type 0 &1cb4 42 d3 2a ; enemy: slot 5 (FIRE), (&3, &d), type 7, x_range (&a, &2), x_speed 2 &1cb7 42 98 6b ; enemy: slot 5 (FIRE), (&8, &9), type 7, x_range (&b, &6), x_speed 2 &1cba 42 9b 9e ; enemy: slot 5 (FIRE), (&b, &9), type 7, x_range (&e, &9), x_speed 2 ; room &85 &1cbd 27 94 ; "The Well" &1cbf 60 ; background sprite: &60 (STRIPES_BC) &1cc0 67 ; room has sprites, object, ropes/ladders, pillars, enemies &1cc1 02 ; 2 sprites before, 0 sprites after &1cc2 08 b6 2a 46 ; sprite: &5b (BRICKS_CKG) frame 0, y_offset 8, 10 sprites vertically, (&6, &4) &1cc6 49 ; sprite: (&9, &4) &1cc7 30 ; 7 rectangles, 0 triangles &1cc8 70 24 ; rectangle: (&0, &7), size (&4, &2) &1cca b0 24 ; rectangle: (&0, &b), size (&4, &2) &1ccc 92 33 ; rectangle: (&2, &9), size (&3, &3) &1cce a6 13 ; rectangle: (&6, &a), size (&3, &1) &1cd0 9a 30 ; rectangle: (&a, &9), size (&0, &3) &1cd2 7b 63 ; rectangle: (&b, &7), size (&3, &6) &1cd4 47 b1 ; rectangle: (&7, &4), size (&1, &b) &1cd6 a1 ; object: (&1, &a) &1cd7 01 ; 1 rope, 0 ladders &1cd8 f8 ; rope: (&8, &f) &1cd9 01 ; 2 pillars, colour 0 &1cda a6 ; pillar: (&6, &a) &1cdb a9 ; pillar: (&9, &a) &1cdc 10 ; 2 enemies using 1 sprite &1cdd 28 ; enemy sprite: &28 (GOOGLY_FACE) (type &1), slots &1-&2 &1cde 08 b2 ae ; enemy: slot 1 (GOOGLY_FACE), (&2, &b), type 1, y_range (&1, &0), y_speed 8 &1ce1 01 d4 be ; enemy: slot 1 (GOOGLY_FACE), (&4, &d), type 1, y_range (&4, &3), y_speed 1 ; room &86 &1ce4 34 95 ; "The Prison" &1ce6 59 ; background sprite: &59 (BRICKS_GYR) &1ce7 57 ; room has sprites, object, ropes/ladders, door, enemies &1ce8 38 ; 0 sprites before, 7 sprites after &1ce9 2a ; 6 rectangles, 2 triangles &1cea 47 40 ; rectangle: (&7, &4), size (&0, &4) &1cec 4b 00 ; rectangle: (&b, &4), size (&0, &0) &1cee 5b 12 ; rectangle: (&b, &5), size (&2, &1) &1cf0 9f 00 ; rectangle: (&f, &9), size (&0, &0) &1cf2 ad 02 ; rectangle: (&d, &a), size (&2, &0) &1cf4 a2 3a ; rectangle: (&2, &a), size (&a, &3) &1cf6 a2 a7 57 ; triangle: (&2-, &a-), (&7, &a), (&7, &5) &1cf9 a8 ac 58 ; triangle: (&8, &a-), (&c, &a), (&8, &5) &1cfc e4 ; object: (&4, &e) &1cfd 06 c6 d2 ; sprite: &63 (TABLE) frame 0, x_offset 4, y_offset 4, (&2, &d) &1d00 04 6f d5 ; sprite: &37 (CHAIR) frame 1, y_offset 4, (&5, &d) &1d03 00 c4 db ; sprite: &62 (URN) frame 0, (&b, &d) &1d06 00 7b a5 ; sprite: &3d (HORNED_SKULL) frame 1, (&5, &a) &1d09 a9 ; sprite: (&9, &a) &1d0a 09 24 29 47 ; sprite: &12 (CHAIN_LINK) frame 0, x_offset 2, y_offset 8, 10 sprites vertically, (&7, &4) &1d0e 67 ; sprite: (&7, &6) &1d0f 10 ; 0 ropes, 1 ladder &1d10 ae 30 ; ladder, (&e, &a), length &0c, colour 2 &1d12 06 ad; door: type &06, (&d, &a) &1d14 00 ; 1 enemy using 1 sprite &1d15 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &1d16 00 c6 ; enemy: slot 1 (MONK), (&6, &c), type 6, colour 0 ; room &87 &1d18 27 96 ; "On The Beach" &1d1a 5c ; background sprite: &5c (BRICKS_RY) &1d1b 0b ; room has sprites, object, stars &1d1c 25 ; 5 sprites before, 4 sprites after &1d1d 1d 00 d6 c2 ; sprite: 13 sprites horizontally, &6b (DITHER_YYG) frame 0, (&2, &c) &1d21 d2 ; sprite: (&2, &d) &1d22 e2 ; sprite: (&2, &e) &1d23 f2 ; sprite: (&2, &f) &1d24 08 d6 c2 ; sprite: &6b (DITHER_YYG) frame 0, y_offset 8, (&2, &c) &1d27 19 ; 4 rectangles, 1 triangle &1d28 42 7d ; rectangle: (&2, &4), size (&d, &7) &1d2a 90 11 ; rectangle: (&0, &9), size (&1, &1) &1d2c cf 00 ; rectangle: (&f, &c), size (&0, &0) &1d2e 00 9c 60 20 ; rectangle: STA &9c, (&0, &6), size (&0, &2) &1d32 cf df c7 ; triangle: (&f, &c), (&f, &d), (&7, &c) &1d35 c6 ; object: (&6, &c) &1d36 03 76 50 ; sprite: &3b (C) frame 0, x_offset 6, (&0, &5) &1d39 1d 08 d6 d2 ; sprite: 14 sprites horizontally, &6b (DITHER_YYG) frame 0, y_offset 8, (&2, &d) &1d3d e2 ; sprite: (&2, &e) &1d3e f2 ; sprite: (&2, &f) ; room &88 &1d3f 27 96 ; "On The Beach" &1d41 6b ; background sprite: &6b (DITHER_YYG) &1d42 49 ; room has sprites, stars, enemies &1d43 18 ; 0 sprites before, 3 sprites after &1d44 11 ; 3 rectangles, 1 triangle &1d45 40 8f ; rectangle: (&0, &4), size (&f, &8) &1d47 d8 07 ; rectangle: (&8, &d), size (&7, &0) &1d49 00 70 e0 f0 e8 17 ; rectangle: STA &70, water level &e0 x:&0-&f, (&8, &e), size (&7, &1) &1d4f da e9 d0 ; triangle: (&a, &d), (&9, &e), (&0, &d) &1d52 03 68 dc ; sprite: &34 (LOTUS_FLOWER) frame 0, x_offset 6, (&c, &d) &1d55 17 00 18 e8 ; sprite: 8 sprites horizontally, &0c (WATER_SURFACE) frame 0, (&8, &e) &1d59 00 6a 22 ed ; sprite: &35 (LOTUS_STEM) frame 0, 3 sprites vertically, (&d, &e) &1d5d 11 ; 2 enemies using 2 sprites &1d5e 72 ; enemy sprite: &72 (SPLASH) (type &0), slots &1-&2 &1d5f 28 ; enemy sprite: &28 (GOOGLY_FACE) (type &1), slots &3-&4 &1d60 24 a5 ad ; enemy: slot 3 (GOOGLY_FACE), (&5, &a), type 1, y_range (&4, &2), y_speed 4 &1d63 24 c6 ad ; enemy: slot 3 (GOOGLY_FACE), (&6, &c), type 1, y_range (&4, &2), y_speed 4 ; room &89 &1d66 24 97 ; "The Ocean" &1d68 5c ; background sprite: &5c (BRICKS_RY) &1d69 49 ; room has sprites, stars, enemies &1d6a 38 ; 0 sprites before, 7 sprites after &1d6b 08 ; 2 rectangles, 0 triangles &1d6c 40 9f ; rectangle: (&0, &4), size (&f, &9) &1d6e 00 70 e0 f0 e0 1f ; rectangle: STA &70, water level &e0 x:&0-&f, (&0, &e), size (&f, &1) &1d74 01 68 d3 ; sprite: &34 (LOTUS_FLOWER) frame 0, x_offset 2, (&3, &d) &1d77 d5 ; sprite: (&5, &d) &1d78 da ; sprite: (&a, &d) &1d79 00 18 1f e0 ; sprite: &0c (WATER_SURFACE) frame 0, 16 sprites horizontally, (&0, &e) &1d7d 03 6a 22 e3 ; sprite: &35 (LOTUS_STEM) frame 0, x_offset 6, 3 sprites vertically, (&3, &e) &1d81 e5 ; sprite: (&5, &e) &1d82 ea ; sprite: (&a, &e) &1d83 01 ; 1 enemy using 2 sprites &1d84 72 ; enemy sprite: &72 (SPLASH) (type &0), slots &1-&2 &1d85 67 ; enemy sprite: &67 (STARFISH) (type &2), slots &3-&4 &1d86 22 e8 e6 fb ; enemy: slot 3 (STARFISH), (&8, &e), type 2, x_range (&6, &b), y_range (&e, &f), speed (1, 2) ; room &8a &1d8a 26 92 ; "The Island" &1d8c 6d ; background sprite: &6d (DITHER_RKM) &1d8d 49 ; room has sprites, stars, enemies &1d8e 30 ; 0 sprites before, 6 sprites after &1d8f 10 ; 3 rectangles, 0 triangles &1d90 40 5f ; rectangle: (&0, &4), size (&f, &5) &1d92 a0 3a ; rectangle: (&0, &a), size (&a, &3) &1d94 00 70 e0 f0 e0 1a ; rectangle: STA &70, water level &e0 x:&0-&f, (&0, &e), size (&a, &1) &1d9a 00 e1 c9 ; sprite: &70 (CURVED_PLATFORM) frame 1, (&9, &c) &1d9d 01 68 d2 ; sprite: &34 (LOTUS_FLOWER) frame 0, x_offset 2, (&2, &d) &1da0 d7 ; sprite: (&7, &d) &1da1 1a 00 18 e0 ; sprite: 11 sprites horizontally, &0c (WATER_SURFACE) frame 0, (&0, &e) &1da5 22 03 6a e2 ; sprite: 3 sprites vertically, &35 (LOTUS_STEM) frame 0, x_offset 6, (&2, &e) &1da9 e7 ; sprite: (&7, &e) &1daa 01 ; 1 enemy using 2 sprites &1dab 72 ; enemy sprite: &72 (SPLASH) (type &0), slots &1-&2 &1dac 2b ; enemy sprite: &2b (SNAKE) (type &0), slots &3-&6 &1dad 23 9c bf ; enemy: slot 3 (SNAKE), (&c, &9), type 0, x_range (&f, &b), x_speed 3 ; room &8b &1db0 0f 92 ; "The Island" &1db2 6d ; background sprite: &6d (DITHER_RKM) &1db3 48 ; room has stars, enemies &1db4 08 ; 2 rectangles, 0 triangles &1db5 40 5f ; rectangle: (&0, &4), size (&f, &5) &1db7 00 dc 86 12 ; rectangle: STA &dc, (&6, &8), size (&2, &1) &1dbb 00 ; 1 enemy using 1 sprite &1dbc 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &1dbd 05 67 ; enemy: slot 1 (MONK), (&7, &6), type 6, colour 1 ; room &8c &1dbf 13 92 ; "The Island" &1dc1 6d ; background sprite: &6d (DITHER_RKM) &1dc2 0d ; room has sprites, ropes/ladders, stars &1dc3 08 ; 0 sprites before, 1 sprite after &1dc4 02 ; 1 rectangle, 2 triangles &1dc5 40 3b ; rectangle: (&0, &4), size (&b, &3) &1dc7 8d 8c 5c ; triangle: (&d, &8-), (&c, &8), (&c, &5) &1dca a0 87 80 ; triangle: (&0, &a-), (&7, &8), (&0, &8) &1dcd 04 36 85 ; sprite: &1b (SKULL) frame 0, y_offset 4, (&5, &8) &1dd0 01 ; 1 rope, 0 ladders &1dd1 5b ; rope: (&b, &5) ; room &8d &1dd2 01 ; copy of room &00 ; room &8e &1dd3 01 ; copy of room &00 ; room &8f &1dd4 01 ; copy of room &00 ; room &90 &1dd5 0a 80 ; " " &1dd7 6b ; background sprite: &6b (DITHER_YYG) &1dd8 02 ; room has object &1dd9 08 ; 2 rectangles, 0 triangles &1dda 53 0c ; rectangle: (&3, &5), size (&c, &0) &1ddc 63 18 ; rectangle: (&3, &6), size (&8, &1) &1dde 87 ; object: (&7, &8) ; room &91 &1ddf 3c 8e ; "Witch's House" &1de1 6b ; background sprite: &6b (DITHER_YYG) &1de2 65 ; room has sprites, ropes/ladders, pillars, enemies &1de3 40 ; 0 sprites before, 8 sprites after &1de4 28 ; 6 rectangles, 0 triangles &1de5 46 00 ; rectangle: (&6, &4), size (&0, &0) &1de7 51 2b ; rectangle: (&1, &5), size (&b, &2) &1de9 b2 2c ; rectangle: (&2, &b), size (&c, &2) &1deb 7c 23 ; rectangle: (&c, &7), size (&3, &2) &1ded ac 02 ; rectangle: (&c, &a), size (&2, &0) &1def 02 7f 50 00 ; rectangle: AND &7f, (&0, &5), size (&0, &0) &1df3 0c 7a 7c ; sprite: &3d (HORNED_SKULL) frame 0, y_offset 12, (&c, &7) &1df6 cd ; sprite: (&d, &c) &1df7 08 74 dc ; sprite: &3a (TRAMPOLINE) frame 0, y_offset 8, (&c, &d) &1dfa 04 66 76 ; sprite: &33 (CAULDRON) frame 0, y_offset 4, (&6, &7) &1dfd d5 ; sprite: (&5, &d) &1dfe db ; sprite: (&b, &d) &1dff 31 74 ; sprite: frame 1, (&4, &7) &1e01 d7 ; sprite: (&7, &d) &1e02 11 ; 1 rope, 1 ladder &1e03 56 ; rope: (&6, &5) &1e04 d1 30 ; ladder, (&1, &d), length &0c, colour 1 &1e06 04 ; 5 pillars, colour 0 &1e07 53 ; pillar: (&3, &5) &1e08 5a ; pillar: (&a, &5) &1e09 7d ; pillar: (&d, &7) &1e0a b3 ; pillar: (&3, &b) &1e0b ba ; pillar: (&a, &b) &1e0c 51 ; 6 enemies using 2 sprites &1e0d 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &1e0e 32 ; enemy sprite: &32 (STEAM) (type &0), slots &5-&8 &1e0f 04 91 ; enemy: slot 1 (MONK), (&1, &9), type 6, colour 1 &1e11 4f 74 ; enemy: slot 5 (STEAM), (&4, &7), type 0 &1e13 4f 76 ; enemy: slot 5 (STEAM), (&6, &7), type 0 &1e15 4f d5 ; enemy: slot 5 (STEAM), (&5, &d), type 0 &1e17 4f d7 ; enemy: slot 5 (STEAM), (&7, &d), type 0 &1e19 4f db ; enemy: slot 5 (STEAM), (&b, &d), type 0 ; room &92 &1e1b 32 8e ; "Witch's House" &1e1d 6b ; background sprite: &6b (DITHER_YYG) &1e1e 45 ; room has sprites, ropes/ladders, enemies &1e1f 28 ; 0 sprites before, 5 sprites after &1e20 12 ; 3 rectangles, 2 triangles &1e21 70 2e ; rectangle: (&0, &7), size (&e, &2) &1e23 a9 51 ; rectangle: (&9, &a), size (&1, &5) &1e25 00 c1 a3 12 ; rectangle: STA &c1, (&3, &a), size (&2, &1) &1e29 58 7e 70 ; triangle: (&8, &5-), (&e, &7), (&0, &7) &1e2c e9 ab a7 ; triangle: (&9, &e-), (&b, &a), (&7, &a) &1e2f 04 66 9d ; sprite: &33 (CAULDRON) frame 0, y_offset 4, (&d, &9) &1e32 32 94 ; sprite: frame 2, (&4, &9) &1e34 08 36 92 ; sprite: &1b (SKULL) frame 0, y_offset 8, (&2, &9) &1e37 ab ; sprite: (&b, &a) &1e38 0a 4b ba ; sprite: &25 (TOP_OF_ROPE) frame 1, x_offset 4, y_offset 8, (&a, &b) &1e3b 01 ; 1 rope, 0 ladders &1e3c fa ; rope: (&a, &f) &1e3d 42 ; 5 enemies using 3 sprites &1e3e 2d ; enemy sprite: &2d (FIRE) (type &7), slots &1-&4 &1e3f 65 ; enemy sprite: &65 (WITCH) (type &4), slots &5-&6 &1e40 32 ; enemy sprite: &32 (STEAM) (type &0), slots &7-&a &1e41 42 9e ; enemy: slot 5 (WITCH), (&e, &9), type 4, half_speed, levitates &1e43 6f 9d ; enemy: slot 7 (STEAM), (&d, &9), type 0 &1e45 6f 94 ; enemy: slot 7 (STEAM), (&4, &9), type 0 &1e47 02 b5 36 ; enemy: slot 1 (FIRE), (&5, &b), type 7, x_range (&6, &3), x_speed 2 &1e4a 02 b3 36 ; enemy: slot 1 (FIRE), (&3, &b), type 7, x_range (&6, &3), x_speed 2 ; room &93 &1e4d 01 ; copy of room &00 ; room &94 &1e4e 13 80 ; " " &1e50 6c ; background sprite: &6c (DITHER_GCC) &1e51 03 ; room has sprites, object &1e52 05 ; 5 sprites before, 0 sprites after &1e53 09 ac 17 43 ; sprite: &56 (STONES_CKG) frame 0, x_offset 2, y_offset 8, 7 sprites horizontally, (&3, &4) &1e57 53 ; sprite: (&3, &5) &1e58 63 ; sprite: (&3, &6) &1e59 73 ; sprite: (&3, &7) &1e5a 83 ; sprite: (&3, &8) &1e5b 08 ; 2 rectangles, 0 triangles &1e5c 56 09 ; rectangle: (&6, &5), size (&9, &0) &1e5e 66 16 ; rectangle: (&6, &6), size (&6, &1) &1e60 89 ; object: (&9, &8) ; room &95 &1e61 42 98 ; "The Cellar" &1e63 56 ; background sprite: &56 (STONES_CKG) &1e64 63 ; room has sprites, object, pillars, enemies &1e65 28 ; 0 sprites before, 5 sprites after &1e66 40 ; 9 rectangles, 0 triangles &1e67 67 06 ; rectangle: (&7, &6), size (&6, &0) &1e69 62 53 ; rectangle: (&2, &6), size (&3, &5) &1e6b 71 3d ; rectangle: (&1, &7), size (&d, &3) &1e6d 9f 20 ; rectangle: (&f, &9), size (&0, &2) &1e6f b7 17 ; rectangle: (&7, &b), size (&7, &1) &1e71 c2 00 ; rectangle: (&2, &c), size (&0, &0) &1e73 00 70 cc f0 d2 20 ; rectangle: STA &70, water level &cc x:&0-&f, (&2, &d), size (&0, &2) &1e79 d7 27 ; rectangle: (&7, &d), size (&7, &2) &1e7b 02 7f 50 08 ; rectangle: AND &7f, (&0, &5), size (&8, &0) &1e7f a9 ; object: (&9, &a) &1e80 0f 68 bb ; sprite: &34 (LOTUS_FLOWER) frame 0, x_offset 6, y_offset 12, (&b, &b) &1e83 31 e8 ; sprite: frame 1, (&8, &e) &1e85 0c 18 c2 ; sprite: &0c (WATER_SURFACE) frame 0, y_offset 12, (&2, &c) &1e88 17 c7 ; sprite: 8 sprites horizontally, (&7, &c) &1e8a 0c 6a 25 cc ; sprite: &35 (LOTUS_STEM) frame 0, y_offset 12, 6 sprites vertically, (&c, &c) &1e8e 01 ; 2 pillars, colour 0 &1e8f 76 ; pillar: (&6, &7) &1e90 9f ; pillar: (&f, &9) &1e91 52 ; 6 enemies using 3 sprites &1e92 72 ; enemy sprite: &72 (SPLASH) (type &0), slots &1-&2 &1e93 67 ; enemy sprite: &67 (STARFISH) (type &2), slots &3-&4 &1e94 2c ; enemy sprite: &2c (PULSING_CIRCLES) (type &2), slots &5-&7 &1e95 22 da d7 ec ; enemy: slot 3 (STARFISH), (&a, &d), type 2, x_range (&7, &c), y_range (&d, &e), speed (1, 2) &1e99 4f 8b ; enemy: slot 5 (PULSING_CIRCLES), (&b, &8), type 2 &1e9b 4f a8 ; enemy: slot 5 (PULSING_CIRCLES), (&8, &a), type 2 &1e9d 4f aa ; enemy: slot 5 (PULSING_CIRCLES), (&a, &a), type 2 &1e9f 4f ad ; enemy: slot 5 (PULSING_CIRCLES), (&d, &a), type 2 &1ea1 4f b7 ; enemy: slot 5 (PULSING_CIRCLES), (&7, &b), type 2 ; room &96 &1ea3 2f 98 ; "The Cellar" &1ea5 56 ; background sprite: &56 (STONES_CKG) &1ea6 75 ; room has sprites, ropes/ladders, door, pillars, enemies &1ea7 40 ; 0 sprites before, 8 sprites after &1ea8 10 ; 3 rectangles, 0 triangles &1ea9 51 3a ; rectangle: (&1, &5), size (&a, &3) &1eab 6e 10 ; rectangle: (&e, &6), size (&0, &1) &1ead 90 2f ; rectangle: (&0, &9), size (&f, &2) &1eaf 06 30 12 91 ; sprite: &18 (BARREL) frame 0, x_offset 4, y_offset 4, 3 sprites horizontally, (&1, &9) &1eb3 88 ; sprite: (&8, &8) &1eb4 08 e8 32 b5 ; sprite: &74 (SPIKES_MONOCHROME) frame 0, y_offset 8, frame 2, (&5, &b) &1eb8 00 30 13 a1 ; sprite: &18 (BARREL) frame 0, 4 sprites horizontally, (&1, &a) &1ebc b1 ; sprite: (&1, &b) &1ebd 98 ; sprite: (&8, &9) &1ebe a8 ; sprite: (&8, &a) &1ebf b8 ; sprite: (&8, &b) &1ec0 20 ; 0 ropes, 2 ladders &1ec1 7d 1b ; ladder, (&d, &7), length &06, colour 1 &1ec3 be 1e ; ladder, (&e, &b), length &07, colour 2 &1ec5 05 7e; door: type &05, (&e, &7) &1ec7 01 ; 2 pillars, colour 0 &1ec8 90 ; pillar: (&0, &9) &1ec9 9c ; pillar: (&c, &9) &1eca 10 ; 2 enemies using 1 sprite &1ecb 28 ; enemy sprite: &28 (GOOGLY_FACE) (type &1), slots &1-&2 &1ecc 06 a7 8c ; enemy: slot 1 (GOOGLY_FACE), (&7, &a), type 1, y_range (&4, &0), y_speed 6 &1ecf 04 ae 9c ; enemy: slot 1 (GOOGLY_FACE), (&e, &a), type 1, y_range (&4, &4), y_speed 4 ; room &97 &1ed2 44 98 ; "The Cellar" &1ed4 5e ; background sprite: &5e (BRICKS_GC) &1ed5 47 ; room has sprites, object, ropes/ladders, enemies &1ed6 30 ; 0 sprites before, 6 sprites after &1ed7 58 ; 12 rectangles, 0 triangles &1ed8 51 0b ; rectangle: (&1, &5), size (&b, &0) &1eda 61 00 ; rectangle: (&1, &6), size (&0, &0) &1edc 71 03 ; rectangle: (&1, &7), size (&3, &0) &1ede 84 01 ; rectangle: (&4, &8), size (&1, &0) &1ee0 6c 42 ; rectangle: (&c, &6), size (&2, &4) &1ee2 78 02 ; rectangle: (&8, &7), size (&2, &0) &1ee4 87 13 ; rectangle: (&7, &8), size (&3, &1) &1ee6 90 22 ; rectangle: (&0, &9), size (&2, &2) &1ee8 a1 24 ; rectangle: (&1, &a), size (&4, &2) &1eea b7 17 ; rectangle: (&7, &b), size (&7, &1) &1eec d8 06 ; rectangle: (&8, &d), size (&6, &0) &1eee ea 03 ; rectangle: (&a, &e), size (&3, &0) &1ef0 e9 ; object: (&9, &e) &1ef1 00 c4 ea ; sprite: &62 (URN) frame 0, (&a, &e) &1ef4 33 d8 ; sprite: frame 3, (&8, &d) &1ef6 08 74 de ; sprite: &3a (TRAMPOLINE) frame 0, y_offset 8, (&e, &d) &1ef9 eb ; sprite: (&b, &e) &1efa 0c 72 79 ; sprite: &39 (SHIELD) frame 0, y_offset 12, (&9, &7) &1efd 0f 72 32 79 ; sprite: &39 (SHIELD) frame 0, x_offset 6, y_offset 12, frame 2, (&9, &7) &1f01 30 ; 0 ropes, 3 ladders &1f02 c3 29 ; ladder, (&3, &c), length &0a, colour 3 &1f04 c6 38 ; ladder, (&6, &c), length &0e, colour 2 &1f06 9b 22 ; ladder, (&b, &9), length &08, colour 3 &1f08 22 ; 3 enemies using 3 sprites &1f09 2e ; enemy sprite: &2e (BENDY_LEGS) (type &4), slots &1-&4 &1f0a 2a ; enemy sprite: &2a (MAGIC) (type &2), slots &5-&8 &1f0b 2c ; enemy sprite: &2c (PULSING_CIRCLES) (type &2), slots &9-&b &1f0c 00 99 ; enemy: slot 1 (BENDY_LEGS), (&9, &9), type 4, half_speed &1f0e 43 b1 a1 d7 ; enemy: slot 5 (MAGIC), (&1, &b), type 2, x_range (&1, &7), y_range (&a, &d), speed (1, 4) &1f12 8f 9c ; enemy: slot 9 (PULSING_CIRCLES), (&c, &9), type 2 &1f14 00 bd ; unused ; room &98 &1f16 01 ; copy of room &00 ; room &99 &1f17 28 94 ; "The Well" &1f19 6c ; background sprite: &6c (DITHER_GCC) &1f1a 45 ; room has sprites, ropes/ladders, enemies &1f1b 02 ; 2 sprites before, 0 sprites after &1f1c 08 b6 2a 46 ; sprite: &5b (BRICKS_CKG) frame 0, y_offset 8, 10 sprites vertically, (&6, &4) &1f20 49 ; sprite: (&9, &4) &1f21 50 ; 11 rectangles, 0 triangles &1f22 60 02 ; rectangle: (&0, &6), size (&2, &0) &1f24 72 21 ; rectangle: (&2, &7), size (&1, &2) &1f26 94 00 ; rectangle: (&4, &9), size (&0, &0) &1f28 a4 02 ; rectangle: (&4, &a), size (&2, &0) &1f2a 47 b1 ; rectangle: (&7, &4), size (&1, &b) &1f2c d9 10 ; rectangle: (&9, &d), size (&0, &1) &1f2e da 01 ; rectangle: (&a, &d), size (&1, &0) &1f30 eb 10 ; rectangle: (&b, &e), size (&0, &1) &1f32 cb 01 ; rectangle: (&b, &c), size (&1, &0) &1f34 ac 10 ; rectangle: (&c, &a), size (&0, &1) &1f36 9c 03 ; rectangle: (&c, &9), size (&3, &0) &1f38 01 ; 1 rope, 0 ladders &1f39 f8 ; rope: (&8, &f) &1f3a 00 ; 1 enemy using 1 sprite &1f3b 29 ; enemy sprite: &29 (ROPE_CLIMBER) (type &1), slots &1-&2 &1f3c 03 98 5e ; enemy: slot 1 (ROPE_CLIMBER), (&8, &9), type 1, y_range (&1, &0), y_speed 3 ; room &9a &1f3f 01 ; copy of room &00 ; room &9b &1f40 01 ; copy of room &00 ; room &9c &1f41 1d 97 ; "The Ocean" &1f43 6c ; background sprite: &6c (DITHER_GCC) &1f44 41 ; room has sprites, enemies &1f45 08 ; 0 sprites before, 1 sprite after &1f46 09 ; 2 rectangles, 1 triangle &1f47 00 70 00 f8 48 17 ; rectangle: STA &70, water level &00 x:&8-&f, (&8, &4), size (&7, &1) &1f4d 6f 40 ; rectangle: (&f, &6), size (&0, &4) &1f4f 00 70 6f be 68 ; triangle: STA &70, (&f, &6), (&e, &b), (&8, &6) &1f54 08 6a 26 4d ; sprite: &35 (LOTUS_STEM) frame 0, y_offset 8, 7 sprites vertically, (&d, &4) &1f58 00 ; 1 enemy using 1 sprite &1f59 67 ; enemy sprite: &67 (STARFISH) (type &2), slots &1-&2 &1f5a 06 7e 6c 9f ; enemy: slot 1 (STARFISH), (&e, &7), type 2, x_range (&c, &f), y_range (&6, &9), speed (2, 2) ; room &9d &1f5e 31 97 ; "The Ocean" &1f60 6c ; background sprite: &6c (DITHER_GCC) &1f61 41 ; room has sprites, enemies &1f62 30 ; 0 sprites before, 6 sprites after &1f63 09 ; 2 rectangles, 1 triangle &1f64 00 70 00 f0 40 6f ; rectangle: STA &70, water level &00 x:&0-&f, (&0, &4), size (&f, &6) &1f6a bc 13 ; rectangle: (&c, &b), size (&3, &1) &1f6c 00 70 ac db b2 ; triangle: STA &70, (&c, &a-), (&b, &d), (&2, &b) &1f71 0a 36 ce ; sprite: &1b (SKULL) frame 0, x_offset 4, y_offset 8, (&e, &c) &1f74 0b 69 57 ; sprite: &34 (LOTUS_FLOWER) frame 1, x_offset 6, y_offset 8, (&7, &5) &1f77 08 6a 29 68 ; sprite: &35 (LOTUS_STEM) frame 0, y_offset 8, 10 sprites vertically, (&8, &6) &1f7b 0b 6a 45 ; sprite: &35 (LOTUS_STEM) frame 0, x_offset 6, y_offset 8, (&5, &4) &1f7e 22 43 ; sprite: 3 sprites vertically, (&3, &4) &1f80 2c 4a ; sprite: 13 sprites vertically, (&a, &4) &1f82 21 ; 3 enemies using 2 sprites &1f83 66 ; enemy sprite: &66 (OCTOPUS) (type &4), slots &1-&2 &1f84 67 ; enemy sprite: &67 (STARFISH) (type &2), slots &3-&4 &1f85 01 97 ; enemy: slot 1 (OCTOPUS), (&7, &9), type 4, full_speed &1f87 22 94 93 b8 ; enemy: slot 3 (STARFISH), (&4, &9), type 2, x_range (&3, &8), y_range (&9, &b), speed (1, 2) &1f8b 26 ac 99 cd ; enemy: slot 3 (STARFISH), (&c, &a), type 2, x_range (&9, &d), y_range (&9, &c), speed (2, 2) ; room &9e &1f8f 26 97 ; "The Ocean" &1f91 6d ; background sprite: &6d (DITHER_RKM) &1f92 41 ; room has sprites, enemies &1f93 20 ; 0 sprites before, 4 sprites after &1f94 0a ; 2 rectangles, 2 triangles &1f95 00 70 00 f0 40 3a ; rectangle: STA &70, water level &00 x:&0-&f, (&0, &4), size (&a, &3) &1f9b 80 29 ; rectangle: (&0, &8), size (&9, &2) &1f9d 00 70 7a ba 8b ; triangle: STA &70, (&a-, &7-), (&a+, &b), (&b, &8) &1fa2 d0 b9 b0 ; triangle: (&0, &d-), (&9, &b), (&0, &b) &1fa5 0b 69 64 ; sprite: &34 (LOTUS_FLOWER) frame 1, x_offset 6, y_offset 8, (&4, &6) &1fa8 08 6a 26 75 ; sprite: &35 (LOTUS_STEM) frame 0, y_offset 8, 7 sprites vertically, (&5, &7) &1fac 0b 6a 47 ; sprite: &35 (LOTUS_STEM) frame 0, x_offset 6, y_offset 8, (&7, &4) &1faf 2a 42 ; sprite: 11 sprites vertically, (&2, &4) &1fb1 00 ; 1 enemy using 1 sprite &1fb2 66 ; enemy sprite: &66 (OCTOPUS) (type &4), slots &1-&2 &1fb3 01 85 ; enemy: slot 1 (OCTOPUS), (&5, &8), type 4, full_speed ; room &9f &1fb5 01 ; copy of room &00 ; room &a0 &1fb6 01 ; copy of room &00 ; room &a1 &1fb7 01 ; copy of room &00 ; room &a2 &1fb8 01 ; copy of room &00 ; room &a3 &1fb9 36 99 ; "Star Port" &1fbb 57 ; background sprite: &57 (STONES_MRM) &1fbc 0b ; room has sprites, object, stars &1fbd 10 ; 0 sprites before, 2 sprites after &1fbe 35 ; 7 rectangles, 5 triangles &1fbf 00 cb d6 24 ; rectangle: STA &cb, (&6, &d), size (&4, &2) &1fc3 00 00 42 8d ; rectangle: STA &00, (&2, &4), size (&d, &8) &1fc7 d3 03 ; rectangle: (&3, &d), size (&3, &0) &1fc9 da 04 ; rectangle: (&a, &d), size (&4, &0) &1fcb eb 03 ; rectangle: (&b, &e), size (&3, &0) &1fcd 00 09 e4 01 00 03 ; rectangle: STA &09, (&0, &0), size (&3, &0) &1fd3 a8 20 ; rectangle: (&8, &a), size (&0, &2) &1fd5 00 3c b9 99 a8 ; triangle: STA &3c, (&9, &b-), (&9, &9), (&8, &a) &1fda 68 78 a9 ; triangle: (&8-, &6-), (&8+, &7), (&9, &a) &1fdd bb bb 68 ; triangle: (&b, &b-), (&b, &b), (&8, &6) &1fe0 a9 ba 68 ; triangle: (&9, &a-), (&a, &b), (&8, &6) &1fe3 00 00 6c 66 cc ; triangle: STA &00, (&c, &6-), (&6+, &6), (&c, &c) &1fe8 f4 ; object: (&4, &f) &1fe9 09 20 8a ; sprite: &10 (ANTENNA) frame 0, x_offset 2, y_offset 8, (&a, &8) &1fec 04 76 e8 ; sprite: &3b (C) frame 0, y_offset 4, (&8, &e) ; room &a4 &1fef 0f 80 ; " " &1ff1 5d ; background sprite: &5d (BRICKS_MR) &1ff2 0d ; room has sprites, ropes/ladders, stars &1ff3 08 ; 0 sprites before, 1 sprite after &1ff4 08 ; 2 rectangles, 0 triangles &1ff5 40 8f ; rectangle: (&0, &4), size (&f, &8) &1ff7 d1 2e ; rectangle: (&1, &d), size (&e, &2) &1ff9 00 4a d1 ; sprite: &25 (TOP_OF_ROPE) frame 0, (&1, &d) &1ffc 01 ; 1 rope, 0 ladders &1ffd f1 ; rope: (&1, &f) ; room &a5 &1ffe 01 ; copy of room &00 ; room &a6 &1fff 20 8e ; "Witch's House" &2001 6b ; background sprite: &6b (DITHER_YYG) &2002 47 ; room has sprites, object, ropes/ladders, enemies &2003 18 ; 0 sprites before, 3 sprites after &2004 18 ; 4 rectangles, 0 triangles &2005 49 11 ; rectangle: (&9, &4), size (&1, &1) &2007 61 2c ; rectangle: (&1, &6), size (&c, &2) &2009 93 3a ; rectangle: (&3, &9), size (&a, &3) &200b d7 06 ; rectangle: (&7, &d), size (&6, &0) &200d 91 ; object: (&1, &9) &200e 06 c6 d9 ; sprite: &63 (TABLE) frame 0, x_offset 4, y_offset 4, (&9, &d) &2011 0e 7a 93 ; sprite: &3d (HORNED_SKULL) frame 0, x_offset 4, y_offset 12, (&3, &9) &2014 9c ; sprite: (&c, &9) &2015 01 ; 1 rope, 0 ladders &2016 9a ; rope: (&a, &9) &2017 11 ; 2 enemies using 2 sprites &2018 50 ; enemy sprite: &50 (MONK) (type &6), slots &1-&4 &2019 27 ; enemy sprite: &27 (LIFT) (type &1), slots &5-&7 &201a 00 b4 ; enemy: slot 1 (MONK), (&4, &b), type 6, colour 0 &201c 44 a6 6d ; enemy: slot 5 (LIFT), (&6, &a), type 1, y_range (&1, &0), y_speed 4 ; room &a7 &201f 01 ; copy of room &00 ; room &a8 &2020 01 ; copy of room &00 ; room &a9 &2021 32 98 ; "The Cellar" &2023 56 ; background sprite: &56 (STONES_CKG) &2024 61 ; room has sprites, pillars, enemies &2025 10 ; 0 sprites before, 2 sprites after &2026 38 ; 8 rectangles, 0 triangles &2027 00 70 00 f0 42 20 ; rectangle: STA &70, water level &00 x:&0-&f, (&2, &4), size (&0, &2) &202d 47 27 ; rectangle: (&7, &4), size (&7, &2) &202f 72 2c ; rectangle: (&2, &7), size (&c, &2) &2031 a2 02 ; rectangle: (&2, &a), size (&2, &0) &2033 a8 01 ; rectangle: (&8, &a), size (&1, &0) &2035 b1 0c ; rectangle: (&1, &b), size (&c, &0) &2037 c6 18 ; rectangle: (&6, &c), size (&8, &1) &2039 e8 04 ; rectangle: (&8, &e), size (&4, &0) &203b 08 6a 2b 49 ; sprite: &35 (LOTUS_STEM) frame 0, y_offset 8, 12 sprites vertically, (&9, &4) &203f 26 4c ; sprite: 7 sprites vertically, (&c, &4) &2041 83 ; 4 pillars, colour 2 &2042 75 ; pillar: (&5, &7) &2043 b5 ; pillar: (&5, &b) &2044 b7 ; pillar: (&7, &b) &2045 ba ; pillar: (&a, &b) &2046 21 ; 3 enemies using 2 sprites &2047 66 ; enemy sprite: &66 (OCTOPUS) (type &4), slots &1-&2 &2048 67 ; enemy sprite: &67 (STARFISH) (type &2), slots &3-&4 &2049 01 b1 ; enemy: slot 1 (OCTOPUS), (&1, &b), type 4, full_speed &204b 26 7b 7a af ; enemy: slot 3 (STARFISH), (&b, &7), type 2, x_range (&a, &f), y_range (&7, &a), speed (2, 2) &204f 22 93 72 a5 ; enemy: slot 3 (STARFISH), (&3, &9), type 2, x_range (&2, &5), y_range (&7, &a), speed (1, 2) ; room &aa &2053 01 ; copy of room &00 ; room &ab &2054 01 ; copy of room &00 ; room &ac &2055 01 ; copy of room &00 ; room &ad &2056 38 94 ; "The Well" &2058 6c ; background sprite: &6c (DITHER_GCC) &2059 45 ; room has sprites, ropes/ladders, enemies &205a 12 ; 2 sprites before, 2 sprites after &205b 08 b6 2a 46 ; sprite: &5b (BRICKS_CKG) frame 0, y_offset 8, 10 sprites vertically, (&6, &4) &205f 49 ; sprite: (&9, &4) &2060 60 ; 13 rectangles, 0 triangles &2061 47 31 ; rectangle: (&7, &4), size (&1, &3) &2063 60 02 ; rectangle: (&0, &6), size (&2, &0) &2065 63 11 ; rectangle: (&3, &6), size (&1, &1) &2067 69 02 ; rectangle: (&9, &6), size (&2, &0) &2069 4b 10 ; rectangle: (&b, &4), size (&0, &1) &206b 00 f0 87 71 ; rectangle: STA &f0, (&7, &8), size (&1, &7) &206f 83 21 ; rectangle: (&3, &8), size (&1, &2) &2071 b3 40 ; rectangle: (&3, &b), size (&0, &4) &2073 a5 11 ; rectangle: (&5, &a), size (&1, &1) &2075 d9 01 ; rectangle: (&9, &d), size (&1, &0) &2077 ea 12 ; rectangle: (&a, &e), size (&2, &1) &2079 cd 20 ; rectangle: (&d, &c), size (&0, &2) &207b bd 02 ; rectangle: (&d, &b), size (&2, &0) &207d 11 00 18 83 ; sprite: 2 sprites horizontally, &0c (WATER_SURFACE) frame 0, (&3, &8) &2081 87 ; sprite: (&7, &8) &2082 02 ; 2 ropes, 0 ladders &2083 78 ; rope: (&8, &7) &2084 f8 ; rope: (&8, &f) &2085 21 ; 3 enemies using 2 sprites &2086 72 ; enemy sprite: &72 (SPLASH) (type &0), slots &1-&2 &2087 31 ; enemy sprite: &31 (TENTACLES) (type &0), slots &3-&4 &2088 2f 73 ; enemy: slot 3 (TENTACLES), (&3, &7), type 0 &208a 2f 77 ; enemy: slot 3 (TENTACLES), (&7, &7), type 0 &208c 2f 78 ; enemy: slot 3 (TENTACLES), (&8, &7), type 0 ; room &ae &208e 01 ; copy of room &00 ; room &af &208f 01 ; copy of room &00 ; room &b0 &2090 01 ; copy of room &00 ; room &b1 &2091 01 ; copy of room &00 ; room &b2 &2092 01 ; copy of room &00 ; room &b3 &2093 01 ; copy of room &00 ; room &b4 &2094 01 ; copy of room &00 ; room &b5 &2095 09 80 ; " " &2097 5d ; background sprite: &5d (BRICKS_MR) &2098 08 ; room has stars &2099 08 ; 2 rectangles, 0 triangles &209a 40 be ; rectangle: (&0, &4), size (&e, &b) &209c cf 10 ; rectangle: (&f, &c), size (&0, &1) ; room &b6 &209e 35 79 79 72 61 75 74 63 6e 61 53 ; "The Sanctuary" &20a9 5d ; background sprite: &5d (BRICKS_MR) &20aa 01 ; room has sprites &20ab 78 ; 0 sprites before, 15 sprites after &20ac 01 ; 1 rectangle, 1 triangle &20ad c0 1f ; rectangle: (&0, &c), size (&f, &1) &20af c1 ce 48 ; triangle: (&1-, &c-), (&e, &c), (&8, &4) &20b2 06 00 b3 ; sprite: &00 (CRYSTAL_RKM) frame 0, x_offset 4, y_offset 4, (&3, &b) &20b5 06 02 bb ; sprite: &01 (CRYSTAL_YKW) frame 0, x_offset 4, y_offset 4, (&b, &b) &20b8 06 04 95 ; sprite: &02 (CRYSTAL_CKM) frame 0, x_offset 4, y_offset 4, (&5, &9) &20bb 06 06 99 ; sprite: &03 (CRYSTAL_CKG) frame 0, x_offset 4, y_offset 4, (&9, &9) &20be 06 08 77 ; sprite: &04 (CRYSTAL_GKY) frame 0, x_offset 4, y_offset 4, (&7, &7) &20c1 02 d0 23 c3 ; sprite: &68 (STRIPED_PILLAR) frame 0, x_offset 4, 4 sprites vertically, (&3, &c) &20c5 cb ; sprite: (&b, &c) &20c6 27 a5 ; sprite: 8 sprites vertically, (&5, &a) &20c8 a9 ; sprite: (&9, &a) &20c9 2b 87 ; sprite: 12 sprites vertically, (&7, &8) &20cb 10 02 0d c3 ; sprite: 1 sprite horizontally, &06 (OBJECT_PLINTH) frame 1, x_offset 4, (&3, &c) &20cf cb ; sprite: (&b, &c) &20d0 a5 ; sprite: (&5, &a) &20d1 a9 ; sprite: (&9, &a) &20d2 87 ; sprite: (&7, &8) ; room &b7 &20d3 3c 99 ; "Star Port" &20d5 57 ; background sprite: &57 (STONES_MRM) &20d6 25 ; room has sprites, ropes/ladders, pillars &20d7 20 ; 0 sprites before, 4 sprites after &20d8 43 ; 9 rectangles, 3 triangles &20d9 00 cb 46 94 ; rectangle: STA &cb, (&6, &4), size (&4, &9) &20dd 00 00 63 22 ; rectangle: STA &00, (&3, &6), size (&2, &2) &20e1 6b 22 ; rectangle: (&b, &6), size (&2, &2) &20e3 93 2a ; rectangle: (&3, &9), size (&a, &2) &20e5 c0 0f ; rectangle: (&0, &c), size (&f, &0) &20e7 d0 05 ; rectangle: (&0, &d), size (&5, &0) &20e9 db 04 ; rectangle: (&b, &d), size (&4, &0) &20eb e3 0a ; rectangle: (&3, &e), size (&a, &0) &20ed 00 09 f3 01 e5 c9 ; rectangle: STA &09, (&5, &e), size (&9, &c) &20f3 66 c7 6b ; triangle: (&6-, &6), (&7+, &c), (&b, &6) &20f6 ec 00 00 ; triangle: (&c, &e-), (&0, &0), (&0, &0) &20f9 59 85 cc ; triangle: (&9-, &5-), (&5+, &8), (&c, &c) &20fc 02 4c 98 ; sprite: &26 (SPARK) frame 0, x_offset 4, (&8, &9) &20ff 00 4a e3 ; sprite: &25 (TOP_OF_ROPE) frame 0, (&3, &e) &2102 00 0d d8 ; sprite: &06 (OBJECT_PLINTH) frame 1, (&8, &d) &2105 f8 ; sprite: (&8, &f) &2106 01 ; 1 rope, 0 ladders &2107 f3 ; rope: (&3, &f) &2108 03 ; 4 pillars, colour 0 &2109 c1 ; pillar: (&1, &c) &210a cf ; pillar: (&f, &c) &210b 26 e6 ; pillar: colour 2, offset 6, (&6, &e) &210d 24 e9 ; pillar: colour 2, offset 4, (&9, &e) ; room &b8 &210f 0b 80 ; " " &2111 5d ; background sprite: &5d (BRICKS_MR) &2112 0c ; room has ropes/ladders, stars &2113 08 ; 2 rectangles, 0 triangles &2114 41 be ; rectangle: (&1, &4), size (&e, &b) &2116 c0 10 ; rectangle: (&0, &c), size (&0, &1) &2118 01 ; 1 rope, 0 ladders &2119 f1 ; rope: (&1, &f) ; room &b9 &211a 01 ; copy of room &00 ; room &ba &211b 01 ; copy of room &00 ; room &bb &211c 01 ; copy of room &00 ; room &bc &211d 01 ; copy of room &00 ; room &bd &211e 01 ; copy of room &00 ; room &be &211f 01 ; copy of room &00 ; room &bf &2120 01 ; copy of room &00 ; room &c0 &2121 0b 9a ; "The Drain" &2123 6c ; background sprite: &6c (DITHER_GCC) &2124 00 ; room has &2125 10 ; 3 rectangles, 0 triangles &2126 50 0d ; rectangle: (&0, &5), size (&d, &0) &2128 6c 10 ; rectangle: (&c, &6), size (&0, &1) &212a 8c 03 ; rectangle: (&c, &8), size (&3, &0) ; room &c1 &212c 43 94 ; "The Well" &212e 6c ; background sprite: &6c (DITHER_GCC) &212f 45 ; room has sprites, ropes/ladders, enemies &2130 0a ; 2 sprites before, 1 sprite after &2131 08 b6 2a 46 ; sprite: &5b (BRICKS_CKG) frame 0, y_offset 8, 10 sprites vertically, (&6, &4) &2135 49 ; sprite: (&9, &4) &2136 80 ; 17 rectangles, 0 triangles &2137 47 b1 ; rectangle: (&7, &4), size (&1, &b) &2139 43 30 ; rectangle: (&3, &4), size (&0, &3) &213b 80 04 ; rectangle: (&0, &8), size (&4, &0) &213d 92 14 ; rectangle: (&2, &9), size (&4, &1) &213f 89 01 ; rectangle: (&9, &8), size (&1, &0) &2141 4a 12 ; rectangle: (&a, &4), size (&2, &1) &2143 6a 10 ; rectangle: (&a, &6), size (&0, &1) &2145 6c 20 ; rectangle: (&c, &6), size (&0, &2) &2147 5d 10 ; rectangle: (&d, &5), size (&0, &1) &2149 8e 01 ; rectangle: (&e, &8), size (&1, &0) &214b 9c 12 ; rectangle: (&c, &9), size (&2, &1) &214d ab 12 ; rectangle: (&b, &a), size (&2, &1) &214f cc 01 ; rectangle: (&c, &c), size (&1, &0) &2151 d9 14 ; rectangle: (&9, &d), size (&4, &1) &2153 d0 01 ; rectangle: (&0, &d), size (&1, &0) &2155 e1 10 ; rectangle: (&1, &e), size (&0, &1) &2157 00 70 b0 53 b3 02 ; rectangle: STA &70, water level &b0 x:&3-&5, (&3, &b), size (&2, &0) &215d 00 18 12 b3 ; sprite: &0c (WATER_SURFACE) frame 0, 3 sprites horizontally, (&3, &b) &2161 01 ; 1 rope, 0 ladders &2162 f8 ; rope: (&8, &f) &2163 22 ; 3 enemies using 3 sprites &2164 72 ; enemy sprite: &72 (SPLASH) (type &0), slots &1-&2 &2165 28 ; enemy sprite: &28 (GOOGLY_FACE) (type &1), slots &3-&4 &2166 31 ; enemy sprite: &31 (TENTACLES) (type &0), slots &5-&6 &2167 28 98 f5 ; enemy: slot 3 (GOOGLY_FACE), (&8, &9), type 1, y_range (&4, &2), y_speed 8 &216a 24 7c 6e ; enemy: slot 3 (GOOGLY_FACE), (&c, &7), type 1, y_range (&f, &4), y_speed 4 &216d 4f a4 ; enemy: slot 5 (TENTACLES), (&4, &a), type 0 ; room &c2 &216f 1a 9b ; "The lab" &2171 54 ; background sprite: &54 (STONES_GYG) &2172 41 ; room has sprites, enemies &2173 08 ; 0 sprites before, 1 sprite after &2174 18 ; 4 rectangles, 0 triangles &2175 80 03 ; rectangle: (&0, &8), size (&3, &0) &2177 64 2b ; rectangle: (&4, &6), size (&b, &2) &2179 9b 14 ; rectangle: (&b, &9), size (&4, &1) &217b 00 53 71 21 ; rectangle: STA &53, (&1, &7), size (&1, &2) &217f 00 d4 32 87 ; sprite: &6a (CANNON) frame 0, frame 2, (&7, &8) &2183 02 ; 1 enemy using 3 sprites &2184 2d ; enemy sprite: &2d (FIRE) (type &7), slots &1-&4 &2185 13 ; enemy sprite: &13 (CANNONBALL) (type &0), slot &5 &2186 75 ; enemy sprite: &75 (TORCH) (type &0), slots &6-&9 &2187 5f 7d ; enemy: slot 6 (TORCH), (&d, &7), type 0 ; room &c3 &2189 29 9b ; "The lab" &218b 54 ; background sprite: &54 (STONES_GYG) &218c 41 ; room has sprites, enemies &218d 50 ; 0 sprites before, 10 sprites after &218e 10 ; 3 rectangles, 0 triangles &218f 60 42 ; rectangle: (&0, &6), size (&2, &4) &2191 63 72 ; rectangle: (&3, &6), size (&2, &7) &2193 56 39 ; rectangle: (&6, &5), size (&9, &3) &2195 00 74 e3 ; sprite: &3a (TRAMPOLINE) frame 0, (&3, &e) &2198 24 00 52 98 ; sprite: 5 sprites vertically, &29 (ROPE_CLIMBER) frame 0, (&8, &9) &219c 99 ; sprite: (&9, &9) &219d 9a ; sprite: (&a, &9) &219e 00 56 9c ; sprite: &2b (SNAKE) frame 0, (&c, &9) &21a1 9d ; sprite: (&d, &9) &21a2 9e ; sprite: (&e, &9) &21a3 10 00 b0 82 ; sprite: 1 sprite horizontally, &58 (BRICKS_RYM) frame 0, (&2, &8) &21a7 21 62 ; sprite: 2 sprites vertically, (&2, &6) &21a9 92 ; sprite: (&2, &9) &21aa 10 ; 2 enemies using 1 sprite &21ab 28 ; enemy sprite: &28 (GOOGLY_FACE) (type &1), slots &1-&2 &21ac 02 66 59 ; enemy: slot 1 (GOOGLY_FACE), (&6, &6), type 1, y_range (&2, &0), y_speed 2 &21af 02 6b 95 ; enemy: slot 1 (GOOGLY_FACE), (&b, &6), type 1, y_range (&9, &3), y_speed 2 ; room &c4 &21b2 39 9b ; "The lab" &21b4 54 ; background sprite: &54 (STONES_GYG) &21b5 43 ; room has sprites, object, enemies &21b6 58 ; 0 sprites before, 11 sprites after &21b7 20 ; 5 rectangles, 0 triangles &21b8 50 3e ; rectangle: (&0, &5), size (&e, &3) &21ba 91 2c ; rectangle: (&1, &9), size (&c, &2) &21bc c1 14 ; rectangle: (&1, &c), size (&4, &1) &21be cb 11 ; rectangle: (&b, &c), size (&1, &1) &21c0 c7 02 ; rectangle: (&7, &c), size (&2, &0) &21c2 7c ; object: (&c, &7) &21c3 02 4c 58 ; sprite: &26 (SPARK) frame 0, x_offset 4, (&8, &5) &21c6 00 e0 98 ; sprite: &70 (CURVED_PLATFORM) frame 0, (&8, &9) &21c9 00 7a 8c ; sprite: &3d (HORNED_SKULL) frame 0, (&c, &8) &21cc 00 74 e5 ; sprite: &3a (TRAMPOLINE) frame 0, (&5, &e) &21cf eb ; sprite: (&b, &e) &21d0 05 26 8e ; sprite: &13 (CANNONBALL) frame 0, x_offset 2, y_offset 4, (&e, &8) &21d3 12 00 5c c7 ; sprite: 3 sprites horizontally, &2e (BENDY_LEGS) frame 0, (&7, &c) &21d7 d7 ; sprite: (&7, &d) &21d8 e7 ; sprite: (&7, &e) &21d9 00 54 c1 ; sprite: &2a (MAGIC) frame 0, (&1, &c) &21dc d1 ; sprite: (&1, &d) &21dd 31 ; 4 enemies using 2 sprites &21de 28 ; enemy sprite: &28 (GOOGLY_FACE) (type &1), slots &1-&2 &21df 2c ; enemy sprite: &2c (PULSING_CIRCLES) (type &2), slots &3-&5 &21e0 04 87 d5 ; enemy: slot 1 (GOOGLY_FACE), (&7, &8), type 1, y_range (&4, &0), y_speed 4 &21e3 04 68 5d ; enemy: slot 1 (GOOGLY_FACE), (&8, &6), type 1, y_range (&4, &0), y_speed 4 &21e6 04 99 d5 ; enemy: slot 1 (GOOGLY_FACE), (&9, &9), type 1, y_range (&f, &2), y_speed 4 &21e9 2f 85 ; enemy: slot 3 (PULSING_CIRCLES), (&5, &8), type 2 ; room &c5 &21eb 01 ; copy of room &00 ; room &c6 &21ec 01 ; copy of room &00 ; room &c7 &21ed 01 ; copy of room &00 ; room &c8 &21ee 01 ; copy of room &00 ; room &c9 &21ef 1a 92 ; "The Island" &21f1 5d ; background sprite: &5d (BRICKS_MR) &21f2 09 ; room has sprites, stars &21f3 04 ; 4 sprites before, 0 sprites after &21f4 00 da 1e e0 ; sprite: &6d (DITHER_RKM) frame 0, 14 sprites horizontally, (&0, &e) &21f8 f0 ; sprite: (&0, &f) &21f9 08 da e0 ; sprite: &6d (DITHER_RKM) frame 0, y_offset 8, (&0, &e) &21fc f0 ; sprite: (&0, &f) &21fd 19 ; 4 rectangles, 1 triangle &21fe 40 5e ; rectangle: (&0, &4), size (&e, &5) &2200 a0 0d ; rectangle: (&0, &a), size (&d, &0) &2202 b0 2b ; rectangle: (&0, &b), size (&b, &2) &2204 bc 13 ; rectangle: (&c, &b), size (&3, &1) &2206 df ec dc ; triangle: (&f, &d), (&c, &e), (&c, &d) ; room &ca &2209 3d 9c ; "The Temple" &220b 5d ; background sprite: &5d (BRICKS_MR) &220c 41 ; room has sprites, enemies &220d 40 ; 0 sprites before, 8 sprites after &220e 1a ; 4 rectangles, 2 triangles &220f 73 6c ; rectangle: (&3, &7), size (&c, &6) &2211 b0 12 ; rectangle: (&0, &b), size (&2, &1) &2213 00 c0 94 00 ; rectangle: STA &c0, (&4, &9), size (&0, &0) &2217 a5 03 ; rectangle: (&5, &a), size (&3, &0) &2219 b1 b3 73 ; triangle: (&1-, &b-), (&3, &b), (&3, &7) &221c d3 e2 d0 ; triangle: (&3, &d), (&2, &e), (&0, &d) &221f 06 72 8f ; sprite: &39 (SHIELD) frame 0, x_offset 4, y_offset 4, (&f, &8) &2222 00 0d e8 ; sprite: &06 (OBJECT_PLINTH) frame 1, (&8, &e) &2225 00 d2 32 d3 ; sprite: &69 (STATUE) frame 0, frame 2, (&3, &d) &2229 d6 ; sprite: (&6, &d) &222a 33 da ; sprite: frame 3, (&a, &d) &222c dd ; sprite: (&d, &d) &222d 00 2e 98 ; sprite: &17 (PAINFUL_BALL) frame 0, (&8, &9) &2230 01 24 27 78 ; sprite: &12 (CHAIN_LINK) frame 0, x_offset 2, 8 sprites vertically, (&8, &7) &2234 62 ; 7 enemies using 3 sprites &2235 75 ; enemy sprite: &75 (TORCH) (type &0), slots &1-&4 &2236 69 ; enemy sprite: &69 (STATUE) (type &0), slots &5-&8 &2237 3e ; enemy sprite: &3e (TEMPLE_GUARDIAN) (type &4), slots &9-&a &2238 82 98 ; enemy: slot 9 (TEMPLE_GUARDIAN), (&8, &9), type 4, half_speed, levitates &223a 4f c3 ; enemy: slot 5 (STATUE), (&3, &c), type 0 &223c 4f c6 ; enemy: slot 5 (STATUE), (&6, &c), type 0 &223e 4f ca ; enemy: slot 5 (STATUE), (&a, &c), type 0 &2240 4f cd ; enemy: slot 5 (STATUE), (&d, &c), type 0 &2242 0f 93 ; enemy: slot 1 (TORCH), (&3, &9), type 0 &2244 0f 9d ; enemy: slot 1 (TORCH), (&d, &9), type 0 ; room &cb &2246 36 9c ; "The Temple" &2248 5d ; background sprite: &5d (BRICKS_MR) &2249 47 ; room has sprites, object, ropes/ladders, enemies &224a 20 ; 0 sprites before, 4 sprites after &224b 23 ; 5 rectangles, 3 triangles &224c 43 01 ; rectangle: (&3, &4), size (&1, &0) &224e 53 07 ; rectangle: (&3, &5), size (&7, &0) &2250 63 1b ; rectangle: (&3, &6), size (&b, &1) &2252 70 6b ; rectangle: (&0, &7), size (&b, &6) &2254 00 9c d5 02 ; rectangle: STA &9c, (&5, &d), size (&2, &0) &2258 ee ec 8c ; triangle: (&e, &e-), (&c, &e), (&c, &8) &225b 71 73 53 ; triangle: (&1-, &7-), (&3, &7), (&3, &5) &225e 6b 6e 5b ; triangle: (&b, &6-), (&e, &6), (&b, &5) &2261 d6 ; object: (&6, &d) &2262 04 72 32 80 ; sprite: &39 (SHIELD) frame 0, y_offset 4, frame 2, (&0, &8) &2266 05 6f 7d ; sprite: &37 (CHAIR) frame 1, x_offset 2, y_offset 4, (&d, &7) &2269 00 d2 32 d2 ; sprite: &69 (STATUE) frame 0, frame 2, (&2, &d) &226d 33 da ; sprite: frame 3, (&a, &d) &226f 01 ; 1 rope, 0 ladders &2270 a3 ; rope: (&3, &a) &2271 31 ; 4 enemies using 2 sprites &2272 75 ; enemy sprite: &75 (TORCH) (type &0), slots &1-&4 &2273 69 ; enemy sprite: &69 (STATUE) (type &0), slots &5-&8 &2274 4f c2 ; enemy: slot 5 (STATUE), (&2, &c), type 0 &2276 4f ca ; enemy: slot 5 (STATUE), (&a, &c), type 0 &2278 0f 92 ; enemy: slot 1 (TORCH), (&2, &9), type 0 &227a 0f 9a ; enemy: slot 1 (TORCH), (&a, &9), type 0 ; room &cc &227c 13 92 ; "The Island" &227e 5d ; background sprite: &5d (BRICKS_MR) &227f 0d ; room has sprites, ropes/ladders, stars &2280 04 ; 4 sprites before, 0 sprites after &2281 00 da 1e e1 ; sprite: &6d (DITHER_RKM) frame 0, 14 sprites horizontally, (&1, &e) &2285 f1 ; sprite: (&1, &f) &2286 08 da e1 ; sprite: &6d (DITHER_RKM) frame 0, y_offset 8, (&1, &e) &2289 f1 ; sprite: (&1, &f) &228a 00 ; 1 rectangle, 0 triangles &228b 41 9e ; rectangle: (&1, &4), size (&e, &9) &228d 01 ; 1 rope, 0 ladders &228e b1 ; rope: (&1, &b) ; room &cd &228f 02 79 ; copy of room &79 ; room &ce &2291 0c 92 ; "The Island" &2293 6d ; background sprite: &6d (DITHER_RKM) &2294 08 ; room has stars &2295 09 ; 2 rectangles, 1 triangle &2296 40 9f ; rectangle: (&0, &4), size (&f, &9) &2298 e8 17 ; rectangle: (&8, &e), size (&7, &1) &229a e8 f7 e2 ; triangle: (&8, &e), (&7, &f), (&2, &e) ; room &cf &229d 01 ; copy of room &00 ; room &d0 &229e 69 2e 2e 2e 6f 74 20 65 6d 6f 63 6c 65 ; "Welcome to.." &22ab 6d ; background sprite: &6d (DITHER_RKM) &22ac 41 ; room has sprites, enemies &22ad c8 ; 0 sprites before, 25 sprites after &22ae 08 ; 2 rectangles, 0 triangles &22af 40 9f ; rectangle: (&0, &4), size (&f, &9) &22b1 e2 0a ; rectangle: (&2, &e), size (&a, &0) &22b3 0f 46 45 ; sprite: &23 (CROWN_RMM) frame 0, x_offset 6, y_offset 12, (&5, &4) &22b6 0f 44 49 ; sprite: &22 (CROWN_GYY) frame 0, x_offset 6, y_offset 12, (&9, &4) &22b9 0f 42 47 ; sprite: &21 (CROWN_YMR) frame 0, x_offset 6, y_offset 12, (&7, &4) &22bc 0b ca 5e ; sprite: &65 (WITCH) frame 0, x_offset 6, y_offset 8, (&e, &5) &22bf 02 a0 c0 ; sprite: &50 (MONK) frame 0, x_offset 4, (&0, &c) &22c2 00 6c a5 ; sprite: &36 (MUMMY) frame 0, (&5, &a) &22c5 0a 72 ad ; sprite: &39 (SHIELD) frame 0, x_offset 4, y_offset 8, (&d, &a) &22c8 08 72 32 ae ; sprite: &39 (SHIELD) frame 0, y_offset 8, frame 2, (&e, &a) &22cc 02 d5 de ; sprite: &6a (CANNON) frame 1, x_offset 4, (&e, &d) &22cf 05 26 ea ; sprite: &13 (CANNONBALL) frame 0, x_offset 2, y_offset 4, (&a, &e) &22d2 05 28 dd ; sprite: &14 (GUNPOWDER) frame 0, x_offset 2, y_offset 4, (&d, &d) &22d5 0e 7a 91 ; sprite: &3d (HORNED_SKULL) frame 0, x_offset 4, y_offset 12, (&1, &9) &22d8 0a 2c a9 ; sprite: &16 (COOKED_CHICKEN) frame 0, x_offset 4, y_offset 8, (&9, &a) &22db 0e 38 5c ; sprite: &1c (BONE_CYAN) frame 0, x_offset 4, y_offset 12, (&c, &5) &22de 04 66 32 77 ; sprite: &33 (CAULDRON) frame 0, y_offset 4, frame 2, (&7, &7) &22e2 08 24 2d 44 ; sprite: &12 (CHAIN_LINK) frame 0, y_offset 8, 14 sprites vertically, (&4, &4) &22e6 74 ; sprite: (&4, &7) &22e7 0b 24 4b ; sprite: &12 (CHAIN_LINK) frame 0, x_offset 6, y_offset 8, (&b, &4) &22ea 7b ; sprite: (&b, &7) &22eb 00 ba 1e 62 ; sprite: &5d (BRICKS_MR) frame 0, 15 sprites horizontally, (&2, &6) &22ef 08 ba 62 ; sprite: &5d (BRICKS_MR) frame 0, y_offset 8, (&2, &6) &22f2 01 ac 15 83 ; sprite: &56 (STONES_CKG) frame 0, x_offset 2, 6 sprites horizontally, (&3, &8) &22f6 93 ; sprite: (&3, &9) &22f7 01 ae b3 ; sprite: &57 (STONES_MRM) frame 0, x_offset 2, (&3, &b) &22fa c3 ; sprite: (&3, &c) &22fb 32 ; 4 enemies using 3 sprites &22fc 75 ; enemy sprite: &75 (TORCH) (type &0), slots &1-&4 &22fd 28 ; enemy sprite: &28 (GOOGLY_FACE) (type &1), slots &5-&6 &22fe 32 ; enemy sprite: &32 (STEAM) (type &0), slots &7-&a &22ff 4f 50 ; enemy: slot 5 (GOOGLY_FACE), (&0, &5), type 1 &2301 0f 81 ; enemy: slot 1 (TORCH), (&1, &8), type 0 &2303 0f 8e ; enemy: slot 1 (TORCH), (&e, &8), type 0 &2305 6f 77 ; enemy: slot 7 (STEAM), (&7, &7), type 0 ; room &d1 &2307 01 ; copy of room &00 ; room &d2 &2308 01 ; copy of room &00 ; room &d3 &2309 01 ; copy of room &00 ; room &d4 &230a 01 ; copy of room &00 ; room &d5 &230b 34 94 ; "The Well" &230d 6c ; background sprite: &6c (DITHER_GCC) &230e 47 ; room has sprites, object, ropes/ladders, enemies &230f 12 ; 2 sprites before, 2 sprites after &2310 08 b6 21 46 ; sprite: &5b (BRICKS_CKG) frame 0, y_offset 8, 1 sprite vertically, (&6, &4) &2314 49 ; sprite: (&9, &4) &2315 40 ; 9 rectangles, 0 triangles &2316 41 10 ; rectangle: (&1, &4), size (&0, &1) &2318 61 08 ; rectangle: (&1, &6), size (&8, &0) &231a 47 11 ; rectangle: (&7, &4), size (&1, &1) &231c 76 13 ; rectangle: (&6, &7), size (&3, &1) &231e 93 29 ; rectangle: (&3, &9), size (&9, &2) &2320 7d 02 ; rectangle: (&d, &7), size (&2, &0) &2322 8d 10 ; rectangle: (&d, &8), size (&0, &1) &2324 00 70 c0 f0 c3 29 ; rectangle: STA &70, water level &c0 x:&0-&f, (&3, &c), size (&9, &2) &232a 00 d4 b0 02 ; rectangle: STA &d4, (&0, &b), size (&2, &0) &232e b4 ; object: (&4, &b) &232f 00 16 a8 ; sprite: &0b (WELL_BUCKET) frame 0, (&8, &a) &2332 19 00 18 c3 ; sprite: 10 sprites horizontally, &0c (WATER_SURFACE) frame 0, (&3, &c) &2336 01 ; 1 rope, 0 ladders &2337 98 ; rope: (&8, &9) &2338 11 ; 2 enemies using 2 sprites &2339 72 ; enemy sprite: &72 (SPLASH) (type &0), slots &1-&2 &233a 31 ; enemy sprite: &31 (TENTACLES) (type &0), slots &3-&4 &233b 2f b5 ; enemy: slot 3 (TENTACLES), (&5, &b), type 0 &233d 2f bb ; enemy: slot 3 (TENTACLES), (&b, &b), type 0 ; room &d6 &233f 1e 94 ; "The Well" &2341 6c ; background sprite: &6c (DITHER_GCC) &2342 03 ; room has sprites, object &2343 10 ; 0 sprites before, 2 sprites after &2344 18 ; 4 rectangles, 0 triangles &2345 70 0d ; rectangle: (&0, &7), size (&d, &0) &2347 5c 12 ; rectangle: (&c, &5), size (&2, &1) &2349 00 53 6a 21 ; rectangle: STA &53, (&a, &6), size (&1, &2) &234d 00 70 80 80 82 15 ; rectangle: STA &70, water level &80 x:&0-&8, (&2, &8), size (&5, &1) &2353 7e ; object: (&e, &7) &2354 00 e6 32 12 74 ; sprite: &73 (SPIKES_MULTICOLOURED) frame 0, frame 2, 3 sprites horizontally, (&4, &7) &2359 15 00 18 82 ; sprite: 6 sprites horizontally, &0c (WATER_SURFACE) frame 0, (&2, &8) ; room &d7 &235d 01 ; copy of room &00 ; room &d8 &235e 01 ; copy of room &00 ; room &d9 &235f 01 ; copy of room &00 ; room &da &2360 01 ; copy of room &00 ; room &db &2361 01 ; copy of room &00 ; room &dc &2362 01 ; copy of room &00 ; room &dd &2363 01 ; copy of room &00 ; room &de &2364 01 ; copy of room &00 ; room &df &2365 01 ; copy of room &00 ; room &e0 &2366 01 ; copy of room &00 ; room &e1 &2367 01 ; copy of room &00 ; room &e2 &2368 0c 92 ; "The Island" &236a 6d ; background sprite: &6d (DITHER_RKM) &236b 08 ; room has stars &236c 09 ; 2 rectangles, 1 triangle &236d 48 07 ; rectangle: (&8, &4), size (&7, &0) &236f 5d 42 ; rectangle: (&d, &5), size (&2, &4) &2371 5d ac 58 ; triangle: (&d, &5), (&c, &a), (&8, &5) ; room &e3 &2374 02 8b ; copy of room &8b ; room &e4 &2376 1a 97 ; "The Ocean" &2378 6d ; background sprite: &6d (DITHER_RKM) &2379 43 ; room has sprites, object, enemies &237a 08 ; 0 sprites before, 1 sprite after &237b 10 ; 3 rectangles, 0 triangles &237c 40 5f ; rectangle: (&0, &4), size (&f, &5) &237e a9 36 ; rectangle: (&9, &a), size (&6, &3) &2380 00 f0 e9 16 ; rectangle: STA &f0, (&9, &e), size (&6, &1) &2384 a2 ; object: (&2, &a) &2385 16 00 18 e9 ; sprite: 7 sprites horizontally, &0c (WATER_SURFACE) frame 0, (&9, &e) &2389 11 ; 2 enemies using 2 sprites &238a 66 ; enemy sprite: &66 (OCTOPUS) (type &4), slots &1-&2 &238b 17 ; enemy sprite: &17 (PAINFUL_BALL) (type &4), slots &3-&4 &238c 00 ec ; enemy: slot 1 (OCTOPUS), (&c, &e), type 4, half_speed &238e 22 bc ; enemy: slot 3 (PAINFUL_BALL), (&c, &b), type 4, half_speed, levitates ; room &e5 &2390 01 ; copy of room &00 ; room &e6 &2391 01 ; copy of room &00 ; room &e7 &2392 01 ; copy of room &00 ; room &e8 &2393 01 ; copy of room &00 ; room &e9 &2394 01 ; copy of room &00 ; room &ea &2395 20 73 73 6e 69 61 74 6e 75 6f 4d ; "The Mountains" &23a0 6d ; background sprite: &6d (DITHER_RKM) &23a1 03 ; room has sprites, object &23a2 01 ; 1 sprite before, 0 sprites after &23a3 00 dc 12 fd ; sprite: &6e (DITHER_YKY) frame 0, 2 sprites horizontally, (&d, &f) &23a7 12 ; 3 rectangles, 2 triangles &23a8 43 3c ; rectangle: (&3, &4), size (&c, &3) &23aa 86 39 ; rectangle: (&6, &8), size (&9, &3) &23ac cb 24 ; rectangle: (&b, &c), size (&4, &2) &23ae 76 c5 83 ; triangle: (&6, &7-), (&5, &c), (&3, &8) &23b1 cb ea c8 ; triangle: (&b, &c), (&a, &e), (&8, &c) &23b4 fc ; object: (&c, &f) ; room &eb &23b5 02 ef ; copy of room &ef ; room &ec &23b7 02 ef ; copy of room &ef ; room &ed &23b9 3b 81 ; "The Pyramid" &23bb 6e ; background sprite: &6e (DITHER_YKY) &23bc 48 ; room has stars, enemies &23bd 5b ; 12 rectangles, 3 triangles &23be 40 af ; rectangle: (&0, &4), size (&f, &a) &23c0 00 80 69 00 ; rectangle: STA &80, (&9, &6), size (&0, &0) &23c4 77 13 ; rectangle: (&7, &7), size (&3, &1) &23c6 86 11 ; rectangle: (&6, &8), size (&1, &1) &23c8 a5 05 ; rectangle: (&5, &a), size (&5, &0) &23ca ba 00 ; rectangle: (&a, &b), size (&0, &0) &23cc c4 07 ; rectangle: (&4, &c), size (&7, &0) &23ce d4 00 ; rectangle: (&4, &d), size (&0, &0) &23d0 db 00 ; rectangle: (&b, &d), size (&0, &0) &23d2 e4 07 ; rectangle: (&4, &e), size (&7, &0) &23d4 00 83 e8 00 ; rectangle: STA &83, (&8, &e), size (&0, &0) &23d8 02 7e f8 00 ; rectangle: AND &7e, (&8, &f), size (&0, &0) &23dc 03 cf f1 fe 58 ; triangle: EOR &cf, (&1-, &f-), (&e, &f), (&8, &5) &23e1 00 00 51 f1 58 ; triangle: STA &00, (&1-, &5), (&1+, &f), (&8, &5) &23e6 5f fe 58 ; triangle: (&f, &5), (&e, &f), (&8, &5) &23e9 21 ; 3 enemies using 2 sprites &23ea 2b ; enemy sprite: &2b (SNAKE) (type &0), slots &1-&4 &23eb 30 ; enemy sprite: &30 (BLOCK_BLUE) (type &3), slots &5-&7 &23ec 49 c8 ; enemy: slot 5 (BLOCK_BLUE), (&8, &c), type 3, direction 1, speed 2 &23ee 02 a7 b5 ; enemy: slot 1 (SNAKE), (&7, &a), type 0, x_range (&5, &b), x_speed 2 &23f1 02 88 6a ; enemy: slot 1 (SNAKE), (&8, &8), type 0, x_range (&a, &6), x_speed 2 ; room &ee &23f4 02 ef ; copy of room &ef ; room &ef &23f6 07 8b ; "The Desert" &23f8 6e ; background sprite: &6e (DITHER_YKY) &23f9 08 ; room has stars &23fa 00 ; 1 rectangle, 0 triangles &23fb 40 af ; rectangle: (&0, &4), size (&f, &a) ; unused &23fd 00 00 00 ; room_titles &2400 00 ; unused &2401 a0 ; " " (&80) &2402 e4 69 6d 61 72 79 50 00 ; "The Pyramid" (&81) &240a e5 63 61 6c 61 50 00 ; "The Palace" (&82) &2411 f2 65 77 6f 54 20 6c 61 72 74 6e 65 43 ; "Central Tower" (&83) &241e f2 65 77 6f 54 20 74 73 65 57 ; "West Tower" (&84) &2428 f2 65 77 6f 54 20 74 73 61 45 ; "East Tower" (&85) &2432 e5 6c 74 73 61 43 20 66 6f 20 70 6f 54 ; "Top of Castle" (&86) &243f e7 6e 69 57 20 74 73 65 57 ; "West Wing" (&87) &2448 ee 65 68 63 74 69 4b 00 ; "The Kitchen" (&88) &2450 e5 7a 61 4d 20 6e 72 6f 68 54 ; "Thorn Maze" (&89) &245a e7 6e 69 57 20 74 73 61 45 ; "East Wing" (&8a) &2463 f4 72 65 73 65 44 00 ; "The Desert" (&8b) &246a e5 67 6e 65 68 65 6e 6f 74 53 ; "Stonehenge" (&8c) &2474 e4 6e 61 6c 65 74 73 61 57 00 ; "The Wasteland" (&8d) &247e e5 73 75 6f 48 20 73 27 68 63 74 69 57 ; "Witch's House" (&8e) &248b d2 65 5a 65 45 72 46 ; "FrEeZeR" (&8f) &2492 e5 6c 74 73 61 43 20 6c 61 72 74 6e 65 43 ; "Central Castle" (&90) &24a0 ec 65 65 68 57 20 6c 6c 65 57 00 ; "The Well Wheel" (&91) &24ab e4 6e 61 6c 73 49 00 ; "The Island" (&92) &24b2 ec 6c 61 48 20 6e 69 61 4d ; "Main Hall" (&93) &24bb ec 6c 65 57 00 ; "The Well" (&94) &24c0 ee 6f 73 69 72 50 00 ; "The Prison" (&95) &24c7 e8 63 61 65 42 20 65 68 54 20 6e 4f ; "On The Beach" (&96) &24d3 ee 61 65 63 4f 00 ; "The Ocean" (&97) &24d9 f2 61 6c 6c 65 43 00 ; "The Cellar" (&98) &24e0 f4 72 6f 50 20 72 61 74 53 ; "Star Port" (&99) &24e9 ee 69 61 72 44 00 ; "The Drain" (&9a) &24ef e2 61 6c 00 ; "The lab" (&9b) &24f3 e5 6c 70 6d 65 54 00 ; "The Temple" (&9c) ; unused &24fa 65 68 54 ; "The" &24fd 00 00 00 ; citam_event_routine &2500 ee 20 01 INC &0120 ; event_timer &2503 60 RTS ; calculate_screen_address_from_X_and_Y &2504 84 01 STY &01 ; y &2506 86 00 STX &00 ; x ; calculate_screen_address &2508 a0 32 LDY #&32 # 160x192 pixels, &280 bytes per eight lines &250a a5 00 LDA &00 ; x &250c 29 fe AND #&fe &250e 0a ASL A &250f 90 02 BCC &2513 &2511 a0 34 LDY #&34 &2513 0a ASL A &2514 85 02 STA &02 ; screen_address_low &2516 90 01 BCC &2519 &2518 c8 INY &2519 a5 01 LDA &01 ; y &251b 29 f8 AND #&f8 &251d 4a LSR A &251e 85 03 STA &03 ; screen_address_high &2520 4a LSR A &2521 4a LSR A &2522 65 03 ADC &03 ; screen_address_high &2524 4a LSR A &2525 85 03 STA &03 ; screen_address_high &2527 a5 01 LDA &01 ; y &2529 29 04 AND #&04 &252b 90 02 BCC &252f &252d 69 7f ADC #&7f &252f 65 02 ADC &02 ; screen_address_low &2531 90 03 BCC &2536 &2533 e6 03 INC &03 ; screen_address_high &2535 18 CLC &2536 69 80 ADC #&80 &2538 85 02 STA &02 ; screen_address_low &253a 98 TYA &253b 65 03 ADC &03 &253d 85 03 STA &03 ; screen_address_high &253f c9 44 CMP #&44 # Never write above start of screen memory, &4400 &2541 b0 04 BCS &2547 ; skip_floor &2543 a9 44 LDA #&44 &2545 85 03 STA &03 ; screen_address_high ; skip_floor &2547 18 CLC &2548 60 RTS ; set_plot_mode_to_EOR &2549 a9 51 LDA #&51 ; EOR ; set_plot_mode # Self-modifying code &254b 8d e4 25 STA &25e4 ; eor_first_byte_of_two_colour_sprite_and_screen_instruction &254e 8d f5 25 STA &25f5 ; eor_second_byte_of_two_colour_sprite_and_screen_instruction &2551 8d 08 26 STA &2608 ; eor_third_byte_of_two_colour_sprite_and_screen_instruction &2554 8d 15 26 STA &2615 ; eor_fourth_byte_of_two_colour_sprite_and_screen_instruction &2557 8d 9f 26 STA &269f ; eor_first_byte_of_four_colour_sprite_and_screen_instruction &255a 8d ae 26 STA &26ae ; eor_second_byte_of_four_colour_sprite_and_screen_instruction &255d 8d bd 26 STA &26bd ; eor_third_byte_of_four_colour_sprite_and_screen_instruction &2560 8d cc 26 STA &26cc ; eor_fourth_byte_of_four_colour_sprite_and_screen_instruction &2563 60 RTS ; plot_object_in_pocket_one &2564 a2 8a LDX #&8a ; x ; plot_object_in_pocket &2566 a9 38 LDA #&38 &2568 85 01 STA &01 ; y &256a a0 0f LDY #&0f ; remove_top_bits_of_palette_loop &256c b9 00 05 LDA &0500,Y ; palette_table &256f 29 3f AND #&3f &2571 99 00 05 STA &0500,Y ; palette_table &2574 88 DEY &2575 10 f5 BPL &256c ; remove_top_bits_of_palette_loop ; plot_sprite_in_slot_zero_adjusting_position # Plots objects centred at bottom of square &2577 a9 03 LDA #&03 &2579 38 SEC &257a ed 2f 01 SBC &012f ; sprite_slots_height_in_blocks &257d 0a ASL A &257e 0a ASL A &257f 65 01 ADC &01 ; y &2581 85 01 STA &01 ; y &2583 ad 77 01 LDA &0177 ; sprite_slots_offset_of_last_byte &2586 c9 13 CMP #&13 &2588 f0 04 BEQ &258e ; add_two_to_x &258a b0 04 BCS &2590 ; plot_sprite_in_slot_zero &258c e8 INX &258d e8 INX ; add_two_to_x &258e e8 INX &258f e8 INX ; plot_sprite_in_slot_zero &2590 a0 00 LDY #&00 ; plot_sprite_in_slot_Y &2592 b9 8f 01 LDA &018f,Y ; sprite_slots_type # Contains the sprite's third colour &2595 f0 03 BEQ &259a ; plot_two_colour_sprite # (zero if the sprite only has two colours) &2597 4c 46 26 JMP &2646 ; plot_four_colour_sprite_with_previous_y ; plot_two_colour_sprite &259a 86 00 STX &00 ; x ; plot_two_colour_sprite_with_previous_x &259c b9 9b 01 LDA &019b,Y ; sprite_slots_data_low &259f 8d da 25 STA &25da ; two_colour_sprite_data_address_low # Self-modifying code &25a2 b9 a7 01 LDA &01a7,Y ; sprite_slots_data_high &25a5 8d db 25 STA &25db ; two_colour_sprite_data_address_high # Self-modifying code &25a8 b9 3b 01 LDA &013b,Y ; sprite_slots_painfulness &25ab 8d 06 26 STA &2606 ; two_colour_sprite_painfulness # Self-modifying code &25ae b9 77 01 LDA &0177,Y ; sprite_slots_offset_of_last_byte &25b1 8d d6 25 STA &25d6 ; two_colour_sprite_offset_of_last_byte # Self-modifying code &25b4 b9 2f 01 LDA &012f,Y ; sprite_slots_height_in_blocks &25b7 85 04 STA &04 ; blocks_remaining &25b9 b9 83 01 LDA &0183,Y ; sprite_slots_palette_start # Self-modifying code &25bc 8d e2 25 STA &25e2 ; read_first_byte_from_two_colour_palette_address_low &25bf 8d f2 25 STA &25f2 ; read_second_byte_from_two_colour_palette_address_low &25c2 8d 03 26 STA &2603 ; read_third_byte_from_two_colour_palette_address_low &25c5 8d 12 26 STA &2612 ; read_fourth_byte_from_two_colour_palette_address_low &25c8 20 08 25 JSR &2508 ; calculate_screen_address &25cb a9 00 LDA #&00 &25cd 85 08 STA &08 ; sprite_data_offset &25cf a5 01 LDA &01 ; y &25d1 29 04 AND #&04 &25d3 85 06 STA &06 ; row_in_group ; two_colour_block_loop &25d5 a0 23 LDY #&23 # actually LDY two_colour_sprite_offset_of_last_byte ; two_colour_byte_loop # Each block is four screen bytes vertically &25d7 a6 08 LDX &08 ; sprite_data_offset &25d9 bd e7 03 LDA &03e7,X # actually LDA two_colour_sprite_data_address,X # Read a byte of packed sprite data &25dc 85 05 STA &05 ; sprite_data_byte &25de 29 03 AND #&03 &25e0 aa TAX # Lowest two bits is fourth byte of block ; read_first_byte_from_two_colour_palette &25e1 bd 00 05 LDA &0500,X ; palette_table # actually LDA (palette_table + palette_start),X ; eor_first_byte_of_two_colour_sprite_and_screen &25e4 51 02 EOR (&02),Y ; screen_address # EOR or STA depending on plot mode # also STA (&02),Y ; screen_address &25e6 91 02 STA (&02),Y ; screen_address &25e8 a5 05 LDA &05 ; sprite_data_byte &25ea 4a LSR A &25eb 4a LSR A &25ec 85 05 STA &05 ; sprite_data_byte &25ee 29 03 AND #&03 &25f0 aa TAX # Next two bits is third byte of block ; read_second_byte_from_two_colour_palette &25f1 bd 00 05 LDA &0500,X ; palette_table # actually LDA (palette_table + palette_start),X &25f4 88 DEY ; eor_second_byte_of_two_colour_sprite_and_screen &25f5 51 02 EOR (&02),Y ; screen_address # EOR or STA depending on plot mode # also STA (&02),Y ; screen_address &25f7 91 02 STA (&02),Y ; screen_address &25f9 a5 05 LDA &05 ; sprite_data_byte &25fb 4a LSR A &25fc 4a LSR A &25fd 85 05 STA &05 ; sprite_data_byte &25ff 29 03 AND #&03 &2601 aa TAX # Next two bits is second byte of block ; read_third_byte_from_two_colour_palette &2602 bd 00 05 LDA &0500,X ; palette_table # actually LDA (palette_table + palette_start),X &2605 09 00 ORA #&00 # actually ORA two_colour_sprite_painfulness # Second byte of block is marked with painfulness &2607 88 DEY ; eor_third_byte_of_two_colour_sprite_and_screen &2608 51 02 EOR (&02),Y ; screen_address # EOR or STA depending on plot mode # also STA (&02),Y ; screen_address &260a 91 02 STA (&02),Y ; screen_address &260c a5 05 LDA &05 ; sprite_data_byte &260e 4a LSR A &260f 4a LSR A &2610 aa TAX # Highest two bits is first byte of block ; read_fourth_byte_from_two_colour_palette &2611 bd 00 05 LDA &0500,X ; palette_table # actually LDA (palette_table + palette_start),X &2614 88 DEY ; eor_fourth_byte_of_two_colour_sprite_and_screen &2615 51 02 EOR (&02),Y ; screen_address # EOR or STA depending on plot mode # also STA (&02),Y ; screen_address &2617 91 02 STA (&02),Y ; screen_address &2619 e6 08 INC &08 ; sprite_data_offset &261b 98 TYA &261c 38 SEC &261d e9 05 SBC #&05 # Move right two pixels &261f a8 TAY &2620 10 b5 BPL &25d7 ; two_colour_byte_loop &2622 c6 04 DEC &04 ; blocks_remaining &2624 30 1d BMI &2643 ; leave &2626 a5 06 LDA &06 ; row_in_group # Move down four pixels &2628 49 04 EOR #&04 &262a 85 06 STA &06 ; row_in_group &262c f0 06 BEQ &2634 ; next_group &262e 05 02 ORA &02 ; screen_address_low &2630 85 02 STA &02 ; screen_address_low &2632 d0 a1 BNE &25d5 ; two_colour_block_loop ; next_group &2634 a5 02 LDA &02 ; screen_address_low # Move to next group of eight screen lines &2636 18 CLC &2637 69 7c ADC #&7c &2639 85 02 STA &02 ; screen_address_low &263b a5 03 LDA &03 ; screen_address_high &263d 69 02 ADC #&02 &263f 85 03 STA &03 ; screen_address_high &2641 d0 92 BNE &25d5 ; two_colour_block_loop ; leave &2643 60 RTS ; plot_four_colour_sprite &2644 85 01 STA &01 ; y ; plot_four_colour_sprite_with_previous_y &2646 86 00 STX &00 ; x ; plot_four_colour_sprite_with_previous_x_and_y &2648 b9 9b 01 LDA &019b,Y ; sprite_slots_data_low &264b 8d 8c 26 STA &268c ; four_colour_sprite_data_address_low_one # Self-modifying code &264e 8d 92 26 STA &2692 ; four_colour_sprite_data_address_low_two # Self-modifying code &2651 b9 a7 01 LDA &01a7,Y ; sprite_slots_data_high &2654 8d 8d 26 STA &268d ; four_colour_sprite_data_address_high_one # Self-modifying code &2657 8d 93 26 STA &2693 ; four_colour_sprite_data_address_high_two # Self-modifying code &265a b9 2f 01 LDA &012f,Y ; sprite_slots_height_in_blocks &265d 85 04 STA &04 ; blocks_remaining &265f b9 77 01 LDA &0177,Y ; sprite_slots_offset_of_last_byte &2662 8d 88 26 STA &2688 ; four_colour_sprite_offset_of_last_byte # Self-modifying code &2665 b9 3b 01 LDA &013b,Y ; sprite_slots_painfulness &2668 8d bc 26 STA &26bc ; four_colour_sprite_painfulness # Self-modifying code &266b b9 83 01 LDA &0183,Y ; sprite_slots_palette_start ; plot_previous_four_colour_sprite_with_given_palette # Self-modifying code &266e 8d 9d 26 STA &269d ; read_first_byte_from_four_colour_palette_address_low &2671 8d ac 26 STA &26ac ; read_second_byte_from_four_colour_palette_address_low &2674 8d b9 26 STA &26b9 ; read_third_byte_from_four_colour_palette_address_low &2677 8d ca 26 STA &26ca ; read_fourth_byte_from_four_colour_palette_address_low ; plot_previous_four_colour_sprite &267a 20 08 25 JSR &2508 ; calculate_screen_address &267d a9 00 LDA #&00 &267f 85 08 STA &08 ; sprite_data_offset &2681 a5 01 LDA &01 ; y &2683 29 04 AND #&04 &2685 85 07 STA &07 ; row_in_group ; four_colour_block_loop &2687 a0 23 LDY #&23 # actually LDY four_colour_sprite_offset_of_last_byte ; four_colour_byte_loop # Each block is four screen bytes vertically &2689 a6 08 LDX &08 ; sprite_data_offset &268b bd e7 03 LDA &03e7,X # actually LDA four_colour_sprite_data_address,X &268e 85 06 STA &06 ; sprite_data_one # Read two bytes of packed sprite data &2690 e8 INX &2691 bd e7 03 LDA &03e7,X # actually LDA four_colour_sprite_data_address,X &2694 85 05 STA &05 ; sprite_data_two &2696 e8 INX &2697 86 08 STX &08 ; sprite_data_offset &2699 29 0f AND #&0f &269b aa TAX # Low nibble of second byte is fourth byte of block ; read_first_byte_from_four_colour_palette &269c bd 00 05 LDA &0500,X ; palette_table # actually LDA (palette_table + palette_start),X ; eor_first_byte_of_four_colour_sprite_and_screen &269f 51 02 EOR (&02),Y ; screen_address # EOR or STA depending on plot mode # also STA (&02),Y ; screen_address &26a1 91 02 STA (&02),Y ; screen_address &26a3 88 DEY &26a4 a5 05 LDA &05 ; sprite_data_two &26a6 4a LSR A &26a7 4a LSR A &26a8 4a LSR A &26a9 4a LSR A &26aa aa TAX # High nibble of second byte is third byte of block ; read_second_byte_from_four_colour_palette &26ab bd 00 05 LDA &0500,X ; palette_table # actually LDA (palette_table + palette_start),X ; eor_second_byte_of_four_colour_sprite_and_screen &26ae 51 02 EOR (&02),Y ; screen_address # EOR or STA depending on plot mode # also STA (&02),Y ; screen_address &26b0 91 02 STA (&02),Y ; screen_address &26b2 88 DEY &26b3 a5 06 LDA &06 ; sprite_data_one &26b5 29 0f AND #&0f &26b7 aa TAX # Low nibble of first byte is second byte of block ; read_third_byte_from_four_colour_palette &26b8 bd 00 05 LDA &0500,X ; palette_table # actually LDA (palette_table + palette_start),X &26bb 09 00 ORA #&00 # actually ORA four_colour_sprite_painfulness # Second byte of block is marked with painfulness ; eor_third_byte_of_four_colour_sprite_and_screen &26bd 51 02 EOR (&02),Y ; screen_address # EOR or STA depending on plot mode # also STA (&02),Y ; screen_address &26bf 91 02 STA (&02),Y ; screen_address &26c1 88 DEY &26c2 a5 06 LDA &06 ; sprite_data_one &26c4 4a LSR A &26c5 4a LSR A &26c6 4a LSR A &26c7 4a LSR A &26c8 aa TAX # High nibble of first byte is first byte of block ; read_fourth_byte_from_four_colour_palette &26c9 bd 00 05 LDA &0500,X ; palette_table # actually LDA (palette_table + palette_start),X ; eor_fourth_byte_of_four_colour_sprite_and_screen &26cc 51 02 EOR (&02),Y ; screen_address # EOR or STA depending on plot mode # also STA (&02),Y ; screen_address &26ce 91 02 STA (&02),Y ; screen_address &26d0 98 TYA &26d1 38 SEC &26d2 e9 05 SBC #&05 # Move right two pixels &26d4 a8 TAY &26d5 10 b2 BPL &2689 ; four_colour_byte_loop &26d7 c6 04 DEC &04 ; blocks_remaining &26d9 30 1d BMI &26f8 ; leave &26db a5 07 LDA &07 ; row_in_group # Move down four pixels &26dd 49 04 EOR #&04 &26df 85 07 STA &07 ; row_in_group &26e1 f0 06 BEQ &26e9 ; next_group &26e3 05 02 ORA &02 ; screen_address_low &26e5 85 02 STA &02 ; screen_address_low &26e7 d0 9e BNE &2687 ; four_colour_block_loop ; next_group # Move to next group of eight lines &26e9 a5 02 LDA &02 ; screen_address_low &26eb 18 CLC &26ec 69 7c ADC #&7c &26ee 85 02 STA &02 ; screen_address_low &26f0 a5 03 LDA &03 ; screen_address_high &26f2 69 02 ADC #&02 &26f4 85 03 STA &03 ; screen_address_high &26f6 d0 8f BNE &2687 ; four_colour_block_loop ; leave &26f8 60 RTS ; handle_player_input &26f9 a2 00 LDX #&00 &26fb a0 00 LDY #&00 &26fd a9 81 LDA #&81 ; Read Key with Time Limit &26ff 20 f4 ff JSR &fff4 ; OSBYTE &2702 90 02 BCC &2706 ; key_was_pressed &2704 a2 00 LDX #&00 ; key_was_pressed &2706 8a TXA &2707 09 20 ORA #&20 # Convert to lower case &2709 e0 1b CPX #&1b ; ESCAPE # actually LDA escape_key &270b d0 0b BNE &2718 ; not_escape &270d a9 ff LDA #&ff &270f 85 9a STA &9a ; pain_level &2711 a9 08 LDA #&08 # Pressing ESCAPE drains eight energy, immediate pain &2713 20 1b 30 JSR &301b ; drain_player_energy &2716 a9 20 LDA #&20 ; not_escape &2718 c9 70 CMP #&70 ; "p" &271a d0 03 BNE &271f ; not_p &271c 20 e0 ff JSR &ffe0 ; OSRDCH # Pressing P pauses until another key is pressed ; not_p &271f c9 71 CMP #&71 ; "q" &2721 f0 06 BEQ &2729 ; mute_sound # Pressing Q mutes sound &2723 c9 73 CMP #&73 ; "s" &2725 d0 0a BNE &2731 ; joystick_handling_routine # Pressing S unmutes sound ; unmute_sound &2727 a9 00 LDA #&00 ; mute_sound &2729 aa TAX &272a a9 d2 LDA #&d2 ; Read/Write sound supression flag &272c a0 00 LDY #&00 &272e 20 f4 ff JSR &fff4 ; OSBYTE ; joystick_handling_routine # Overwritten by keyboard_handling_routine &2731 a2 00 LDX #&00 # if player selected keyboard control &2733 a0 00 LDY #&00 &2735 ad bb 02 LDA &02bb ; High bytes of most recent analogue converter values 2 &2738 c9 55 CMP #&55 &273a b0 03 BCS &273f ; joystick_not_down &273c c8 INY &273d d0 05 BNE &2744 ; joystick_not_up ; joystick_not_down &273f c9 aa CMP #&aa &2741 90 01 BCC &2744 ; joystick_not_up &2743 e8 INX ; joystick_not_up &2744 86 31 STX &31 ; player_pressed_up &2746 84 33 STY &33 ; player_pressed_down &2748 a2 00 LDX #&00 &274a a0 00 LDY #&00 &274c ad ba 02 LDA &02ba ; High bytes of most recent analogue converter values 1 &274f c9 55 CMP #&55 &2751 b0 03 BCS &2756 ; joystick_not_left &2753 e8 INX &2754 d0 05 BNE &275b ; joystick_not_right ; joystick_not_left &2756 c9 aa CMP #&aa &2758 90 01 BCC &275b ; joystick_not_right &275a c8 INY ; joystick_not_right &275b 86 32 STX &32 ; player_pressed_right &275d 84 34 STY &34 ; player_pressed_left &275f ad 40 fe LDA &fe40 ; System VIA port B input/ouput register ; key_table &2762 29 10 AND #&10 &2764 85 35 STA &35 ; player_pressed_action &2766 60 RTS ; handle_player_update &2767 a6 9a LDX &9a ; pain_level &2769 10 6a BPL &27d5 ; player_not_in_agony # If the player has incurred too much pain, &276b a2 3d LDX #&3d &276d 20 33 3f JSR &3f33 ; play_sound_from_x_and_a &2770 a5 9b LDA &9b ; pain_sound &2772 38 SEC &2773 e9 04 SBC #&04 &2775 85 9b STA &9b ; pain_sound &2777 a0 00 LDY #&00 &2779 20 54 3f JSR &3f54 ; play_previous_sound_with_new_pitch &277c a9 72 LDA #&72 &277e 20 31 3f JSR &3f31 ; play_sound_full_volume_noise &2781 a0 01 LDY #&01 ; head_towards_entry_position_loop # make them move towards where they entered the room &2783 a5 24 LDA &24 ; player_x &2785 cd 24 01 CMP &0124 ; player_entry_x &2788 f0 12 BEQ &279c ; player_at_entry_x &278a b0 06 BCS &2792 ; player_not_left_of_entry_position &278c 69 02 ADC #&02 &278e a2 00 LDX #&00 &2790 f0 04 BEQ &2796 ; change_player_x ; player_not_left_of_entry_position &2792 69 fd ADC #&fd &2794 a2 02 LDX #&02 ; change_player_x &2796 29 fe AND #&fe &2798 85 24 STA &24 ; player_x &279a 86 26 STX &26 ; player_sprite ; player_at_entry_x &279c aa TAX &279d a5 25 LDA &25 ; player_y &279f cd 25 01 CMP &0125 ; player_entry_y &27a2 f0 0c BEQ &27b0 ; player_at_entry_y &27a4 b0 04 BCS &27aa ; player_not_below_entry_position &27a6 69 04 ADC #&04 &27a8 d0 02 BNE &27ac ; change_player_y ; player_not_below_entry_position &27aa 69 fb ADC #&fb ; change_player_y &27ac 29 fc AND #&fc &27ae 85 25 STA &25 ; player_y ; player_at_entry_y &27b0 88 DEY &27b1 10 d0 BPL &2783 ; head_towards_entry_position_loop &27b3 cd 25 01 CMP &0125 ; player_entry_y &27b6 d0 1a BNE &27d2 ; player_not_at_entry_position &27b8 ec 24 01 CPX &0124 ; player_entry_x &27bb d0 15 BNE &27d2 ; player_not_at_entry_position # When the player reaches their entry position, &27bd e6 9a INC &9a ; pain_level # take a few frames to remove their agony &27bf d0 11 BNE &27d2 ; player_not_at_entry_position &27c1 ad 22 01 LDA &0122 ; player_sprite_on_entry_to_room # then restore sprite and speed to how they entered &27c4 85 26 STA &26 ; player_sprite &27c6 ad 23 01 LDA &0123 ; player_jump_up_speed_on_entry_to_room &27c9 85 2a STA &2a ; player_jump_up_speed &27cb a9 00 LDA #&00 &27cd 85 29 STA &29 ; duration_of_player_fall &27cf 20 26 3f JSR &3f26 ; set_background_colour_to_black &27d2 4c 2a 2c JMP &2c2a ; unplot_and_plot_player ; player_not_at_entry_position ; player_not_in_agony &27d5 46 9a LSR &9a ; pain_level # Reduce pain level by one when not being hurt &27d7 a5 25 LDA &25 ; player_y &27d9 c5 2c CMP &2c ; object_y &27db d0 1e BNE &27fb ; player_not_on_object # If the player is on the room's object plinth, &27dd a5 24 LDA &24 ; player_x &27df 18 CLC &27e0 69 03 ADC #&03 &27e2 e5 2b SBC &2b ; object_x &27e4 c9 05 CMP #&05 &27e6 b0 13 BCS &27fb ; player_not_on_object &27e8 a5 35 LDA &35 ; player_pressed_action &27ea d0 0f BNE &27fb ; player_not_on_object # and they pressed ACTION, &27ec a6 31 LDX &31 ; player_pressed_up &27ee d0 0b BNE &27fb ; player_not_on_object # but not UP (to avoid picking up TRAMPOLINE?), &27f0 ca DEX &27f1 86 35 STX &35 ; player_pressed_action # Stop player jumping on object &27f3 a5 30 LDA &30 ; acting_on_object_cooldown &27f5 d0 04 BNE &27fb ; player_not_on_object # and they haven't recently done this, &27f7 a5 2a LDA &2a ; player_jump_up_speed &27f9 f0 05 BEQ &2800 ; player_acted_on_object # then act on the object ; player_not_on_object &27fb 46 30 LSR &30 ; acting_on_object_cooldown &27fd 4c 89 28 JMP &2889 ; player_not_acting_on_object ; player_acted_on_object &2800 a9 e1 LDA #&e1 ; CY &2802 85 d2 STA &d2 ; text_colour_byte_or &2804 85 d3 STA &d3 ; text_colour_byte_eor &2806 a2 0f LDX #&0f &2808 86 30 STX &30 ; acting_on_object_cooldown &280a 20 a0 40 JSR &40a0 ; tab_to_x_1 &280d a4 2d LDY &2d ; object_in_room &280f 84 20 STY &20 ; temporary_object &2811 a9 00 LDA #&00 &2813 99 80 03 STA &0380,Y ; object_room_table # Mark the object as being held by the player &2816 be a8 03 LDX &03a8,Y ; object_sprite_table &2819 8a TXA &281a 20 9b 30 JSR &309b ; plot_object_letter # Plot any letter for the object now in the first pocket &281d 8a TXA &281e 30 0f BMI &282f ; skip_unplotting_object_in_room &2820 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &2823 a5 2c LDA &2c ; object_y &2825 85 01 STA &01 ; y &2827 a6 2b LDX &2b ; object_x # Unplot the object from the room &2829 20 77 25 JSR &2577 ; plot_sprite_in_slot_zero_adjusting_position &282c 20 64 25 JSR &2564 ; plot_object_in_pocket_one # and plot it in pocket one ; skip_unplotting_object_in_room &282f a4 2f LDY &2f ; object_in_pocket_two &2831 84 2d STY &2d ; object_in_room &2833 a5 37 LDA &37 ; player_room &2835 99 80 03 STA &0380,Y ; object_room_table # Mark the object in pocket two as being in the room &2838 be a8 03 LDX &03a8,Y ; object_sprite_table &283b 30 11 BMI &284e ; skip_plotting_object_in_room &283d 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &2840 a5 2c LDA &2c ; object_y &2842 85 01 STA &01 ; y &2844 a6 2b LDX &2b ; object_x # Plot it in the room &2846 20 77 25 JSR &2577 ; plot_sprite_in_slot_zero_adjusting_position &2849 a2 96 LDX #&96 &284b 20 66 25 JSR &2566 ; plot_object_in_pocket # and unplot it from pocket two ; skip_plotting_object_in_room &284e a4 2e LDY &2e ; object_in_pocket_one &2850 84 2f STY &2f ; object_in_pocket_two # Move the object in pocket one into pocket two &2852 be a8 03 LDX &03a8,Y ; object_sprite_table &2855 8a TXA &2856 20 9b 30 JSR &309b ; plot_object_letter # Move any letter associated with it &2859 8a TXA &285a 30 0b BMI &2867 ; skip_replotting_object_in_pocket &285c 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &285f 20 64 25 JSR &2564 ; plot_object_in_pocket_one # Unplot it from pocket one &2862 a2 96 LDX #&96 &2864 20 66 25 JSR &2566 ; plot_object_in_pocket # Replot it in pocket two ; skip_replotting_object_in_pocket &2867 a5 20 LDA &20 ; temporary_object &2869 85 2e STA &2e ; object_in_pocket_one # Move the object that was in the room into pocket one &286b aa TAX &286c bd a8 03 LDA &03a8,X ; object_sprite_table &286f a8 TAY &2870 38 SEC &2871 e9 21 SBC #&21 ; CROWN_YMR &2873 c9 03 CMP #&03 &2875 b0 0b BCS &2882 ; isn't_crown # If the newly pocketed object was a CROWN, &2877 98 TYA &2878 20 30 40 JSR &4030 ; check_if_player_has_object_A_and_remove_it &287b a9 02 LDA #&02 &287d a2 20 LDX #&20 &287f 20 09 30 JSR &3009 ; gain_A_score_and_X_energy # Remove it, gaining 2 points and 20 energy ; isn't_crown &2882 a9 01 LDA #&01 &2884 a2 45 LDX #&45 &2886 20 33 3f JSR &3f33 ; play_sound_from_x_and_a ; player_not_acting_on_object &2889 20 c0 2c JSR &2cc0 ; handle_location_based_actions # Handle any actions that depend on player's location &288c a6 24 LDX &24 ; player_x &288e a5 25 LDA &25 ; player_y &2890 c9 e8 CMP #&e8 # If the player isn't at the very bottom of the screen, &2892 b0 26 BCS &28ba ; player's_feet_aren't_in_obstacle &2894 69 0c ADC #&0c # check if there is anything surrounding their feet &2896 a8 TAY &2897 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &289a a0 0b LDY #&0b # +2 pixels right, +3 pixels down &289c b1 02 LDA (&02),Y ; screen_address # (third byte of block, so top bit set if obstacle) &289e a0 1b LDY #&1b # +4 pixels right, +3 pixels down &28a0 11 02 ORA (&02),Y ; screen_address # (third byte of block, so top bit set if obstacle) &28a2 10 16 BPL &28ba ; player's_feet_aren't_in_obstacle &28a4 a5 03 LDA &03 ; screen_address_high &28a6 e9 04 SBC #&04 &28a8 85 03 STA &03 ; screen_address_high &28aa a0 00 LDY #&00 &28ac b1 02 LDA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &28ae a0 20 LDY #&20 # +8 pixels right &28b0 11 02 ORA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &28b2 30 3e BMI &28f2 ; to_player_is_supported_below &28b4 a5 25 LDA &25 ; player_y &28b6 e9 04 SBC #&04 # Move player up four pixels, out of obstacle &28b8 85 25 STA &25 ; player_y # (this lifts the player with a rising LIFT) ; player's_feet_aren't_in_obstacle &28ba a5 2a LDA &2a ; player_jump_up_speed &28bc f0 03 BEQ &28c1 ; player_isn't_jumping_up &28be 4c fc 29 JMP &29fc ; player_is_jumping_up ; player_isn't_jumping_up # If the player isn't jumping up &28c1 a6 24 LDX &24 ; player_x &28c3 a4 25 LDY &25 ; player_y &28c5 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &28c8 a0 08 LDY #&08 # +2 pixels right &28ca b1 02 LDA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &28cc a0 10 LDY #&10 # +4 pixels right &28ce 11 02 ORA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &28d0 a0 18 LDY #&18 # +6 pixels right &28d2 11 02 ORA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &28d4 29 c0 AND #&c0 # Check if the player's head is supported by anything &28d6 d0 1a BNE &28f2 ; to_player_is_supported # (including climbable objects like ropes) &28d8 a5 25 LDA &25 ; player_y &28da c9 e8 CMP #&e8 # If the player is at the bottom of the screen, &28dc b0 16 BCS &28f4 ; player_isn't_supported # they aren't supported by anything &28de a5 03 LDA &03 ; screen_address_high &28e0 69 05 ADC #&05 &28e2 85 03 STA &03 ; screen_address_high &28e4 a0 0b LDY #&0b # +2 pixels right, +3 pixels down &28e6 b1 02 LDA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &28e8 a0 13 LDY #&13 # +4 pixels right, +3 pixels down &28ea 11 02 ORA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &28ec a0 1b LDY #&1b # +6 pixels right, +3 pixels down &28ee 11 02 ORA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &28f0 29 c0 AND #&c0 # Check if the player's feet are similarly supported ; to_player_is_supported &28f2 d0 3f BNE &2933 ; player_is_supported ; player_isn't_supported # If the player isn't supported, they fall &28f4 e6 29 INC &29 ; duration_of_player_fall &28f6 a5 29 LDA &29 ; duration_of_player_fall &28f8 a0 01 LDY #&01 &28fa c9 06 CMP #&06 &28fc 90 0c BCC &290a ; set_player_downward_speed &28fe c8 INY # with increasing speed &28ff c9 0c CMP #&0c &2901 90 07 BCC &290a ; set_player_downward_speed &2903 c8 INY &2904 c9 14 CMP #&14 &2906 90 02 BCC &290a ; set_player_downward_speed &2908 c8 INY &2909 18 CLC &290a 84 0b STY &0b ; player_downward_speed ; fall_loop # Make the player fall &290c a5 01 LDA &01 ; y &290e 69 02 ADC #&02 &2910 85 01 STA &01 ; y &2912 85 25 STA &25 ; player_y &2914 20 08 25 JSR &2508 ; calculate_screen_address &2917 a5 03 LDA &03 ; screen_address_high &2919 69 05 ADC #&05 # +16 pixels down &291b 85 03 STA &03 ; screen_address_high &291d 30 0c BMI &292b ; player_hit_bottom_of_screen &291f a0 03 LDY #&03 # +3 pixels down &2921 b1 02 LDA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &2923 a0 23 LDY #&23 # +8 pixels right, +3 pixels down &2925 11 02 ORA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &2927 29 c0 AND #&c0 &2929 d0 08 BNE &2933 ; player_is_supported_below # until they hit something ; player_hit_bottom_of_screen &292b c6 0b DEC &0b ; player_downward_speed &292d 10 dd BPL &290c ; fall_loop # or the speed for this frame has been met, &292f 30 66 BMI &2997 ; to_check_for_left_and_right # then consider player's horizontal movement ; set_duration_of_player_fall &2931 86 29 STX &29 ; duration_of_player_fall ; player_is_supported # If the player is supported, &2933 a6 29 LDX &29 ; duration_of_player_fall &2935 d0 03 BNE &293a ; player_fell_onto_something # have they just been falling? &2937 4c e0 29 JMP &29e0 ; player_didn't_fall ; player_fell_onto_something &293a ca DEX &293b f0 f4 BEQ &2931 ; set_duration_of_player_fall &293d a0 08 LDY #&08 # +2 pixels right &293f b1 02 LDA (&02),Y ; screen_address &2941 c9 5f CMP #&5f ; YW = TRAMPOLINE top &2943 f0 08 BEQ &294d ; player_fell_onto_trampoline &2945 a0 18 LDY #&18 # +6 pixels right &2947 b1 02 LDA (&02),Y ; screen_address &2949 c9 5f CMP #&5f ; YW = TRAMPOLINE top &294b d0 4d BNE &299a ; not_trampoline # If so, have they fallen onto a TRAMPOLINE? ; player_fell_onto_trampoline &294d a5 33 LDA &33 ; player_pressed_down &294f f0 03 BEQ &2954 ; down_not_pressed &2951 ca DEX # Reduce the bounce if DOWN was pressed &2952 ca DEX &2953 ca DEX ; down_not_pressed &2954 ca DEX &2955 ca DEX &2956 10 02 BPL &295a ; skip_floor &2958 a2 00 LDX #&00 ; skip_floor &295a a5 35 LDA &35 ; player_pressed_action &295c d0 08 BNE &2966 ; action_not_pressed &295e e8 INX # Increase the bounce if ACTION was pressed &295f e8 INX &2960 e0 06 CPX #&06 &2962 b0 02 BCS &2966 ; skip_ceiling_down &2964 a2 06 LDX #&06 ; skip_ceiling_down ; action_not_pressed &2966 a5 31 LDA &31 ; player_pressed_up &2968 f0 01 BEQ &296b ; up_not_pressed &296a e8 INX # Increase the bounce if UP was pressed ; up_not_pressed &296b e0 11 CPX #&11 &296d 90 02 BCC &2971 ; skip_ceiling_up &296f a2 10 LDX #&10 ; skip_ceiling_up &2971 86 2a STX &2a ; player_jump_up_speed # Set the player jumping upwards as a result &2973 e0 07 CPX #&07 &2975 90 0c BCC &2983 ; skip_change_in_player_y &2977 a5 25 LDA &25 ; player_y &2979 69 03 ADC #&03 # Player falls halfway into TRAMPOLINE when fast &297b e0 0d CPX #&0d &297d 90 02 BCC &2981 ; set_new_player_y &297f 69 03 ADC #&03 # Player falls fully into TRAMPOLINE when even faster ; set_new_player_y &2981 85 25 STA &25 ; player_y ; skip_change_in_player_y &2983 a9 31 LDA #&31 &2985 a2 40 LDX #&40 &2987 20 33 3f JSR &3f33 ; play_sound_from_x_and_a # Play sound for trampoline bounce &298a e6 4b INC &4b ; channel &298c a5 2a LDA &2a ; player_jump_up_speed &298e 0a ASL A &298f 0a ASL A &2990 a0 00 LDY #&00 &2992 84 29 STY &29 ; duration_of_player_fall &2994 20 54 3f JSR &3f54 ; play_previous_sound_with_new_pitch ; to_check_for_left_and_right &2997 4c ad 2a JMP &2aad ; check_for_left_and_right # then consider player's horizontal movement ; not_trampoline &299a c9 70 CMP #&70 ; BB &299c d0 18 BNE &29b6 ; not_water # Did the player fall into WATER? &299e e0 02 CPX #&02 &29a0 90 32 BCC &29d4 ; skip_bump_from_fall &29a2 a9 44 LDA #&44 &29a4 a2 40 LDX #&40 &29a6 20 33 3f JSR &3f33 ; play_sound_from_x_and_a # Play sound for water splash &29a9 a9 03 LDA #&03 &29ab 85 45 STA &45 ; splash_countdown # Note the need to plot a splash &29ad 38 SEC &29ae 65 25 ADC &25 ; player_y &29b0 85 44 STA &44 ; splash_y &29b2 a5 24 LDA &24 ; player_x &29b4 85 43 STA &43 ; splash_x ; not_water &29b6 a5 29 LDA &29 ; duration_of_player_fall &29b8 38 SEC &29b9 e9 0b SBC #&0b &29bb 90 17 BCC &29d4 ; skip_bump_from_fall # Has the player fallen too far? &29bd 4a LSR A &29be 4a LSR A # If so, bump the screen proportional to the drop &29bf f0 13 BEQ &29d4 ; skip_bump_from_fall &29c1 c9 08 CMP #&08 &29c3 90 02 BCC &29c7 ; skip_ceiling &29c5 a9 07 LDA #&07 ; skip_ceiling &29c7 a2 05 LDX #&05 # R5: Vertical total adjust register &29c9 8e 00 fe STX &fe00 ; video register number &29cc 0a ASL A &29cd 8d 01 fe STA &fe01 ; video register value &29d0 4a LSR A &29d1 20 1b 30 JSR &301b ; drain_player_energy # and hurt the player to a similar extent ; skip_bump_from_fall &29d4 a5 25 LDA &25 ; player_y &29d6 29 fc AND #&fc # Align the player with a four pixel block vertically &29d8 85 25 STA &25 ; player_y &29da a9 00 LDA #&00 &29dc 85 29 STA &29 ; duration_of_player_fall &29de f0 b7 BEQ &2997 ; to_check_for_left_and_right # then consider player's horizontal movement ; player_didn't_fall &29e0 a5 35 LDA &35 ; player_pressed_action # If the player didn't fall, &29e2 05 33 ORA &33 ; player_pressed_down &29e4 d0 49 BNE &2a2f ; player_didn't_press_jump # but did press ACTION, but not DOWN &29e6 a9 44 LDA #&44 &29e8 a2 45 LDX #&45 &29ea 20 33 3f JSR &3f33 ; play_sound_from_x_and_a n # Play sound for jump &29ed a9 06 LDA #&06 &29ef 85 2a STA &2a ; player_jump_up_speed # Set the player jumping up with speed 6 &29f1 a5 26 LDA &26 ; player_sprite &29f3 29 fe AND #&fe &29f5 85 26 STA &26 ; player_sprite &29f7 a9 01 LDA #&01 # Closes player's legs when falling from jump &29f9 8d 21 01 STA &0121 ; player_sprite_frame ; player_is_jumping_up # If the player is jumping, &29fc c6 2a DEC &2a ; player_jump_up_speed # slow their jump &29fe a5 2a LDA &2a ; player_jump_up_speed &2a00 4a LSR A &2a01 f0 2c BEQ &2a2f ; player_didn't_press_jump # Except on final frame of jump, &2a03 a9 01 LDA #&01 # move the player up eight pixels a frame &2a05 85 0b STA &0b ; loop_counter &2a07 a5 25 LDA &25 ; player_y &2a09 18 CLC ; jump_upwards_loop # checking every four pixels for collisions &2a0a e9 03 SBC #&03 &2a0c a8 TAY &2a0d c9 3c CMP #&3c &2a0f 90 1b BCC &2a2c ; stop_the_jump # Stop the jump (for this frame) at the top of screen &2a11 a6 24 LDX &24 ; player_x &2a13 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &2a16 a0 00 LDY #&00 # +0 pixels right &2a18 b1 02 LDA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2a1a a0 10 LDY #&10 # +4 pixels right &2a1c 11 02 ORA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2a1e a0 20 LDY #&20 # +8 pixels right &2a20 11 02 ORA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2a22 30 08 BMI &2a2c ; stop_the_jump # or if the player's head has hit something &2a24 a5 01 LDA &01 ; y &2a26 85 25 STA &25 ; player_y # Otherwise, move the player up four pixels &2a28 c6 0b DEC &0b ; loop_counter &2a2a 10 de BPL &2a0a ; jump_upwards_loop ; stop_the_jump &2a2c 4c ad 2a JMP &2aad ; check_for_left_and_right # then consider player's horizontal movement ; player_didn't_press_jump &2a2f a5 31 LDA &31 ; player_pressed_up &2a31 f0 44 BEQ &2a77 ; consider_if_player_pressed_down # If the player pressed UP, &2a33 a5 2a LDA &2a ; player_jump_up_speed &2a35 d0 40 BNE &2a77 ; consider_if_player_pressed_down # and they're not jumping, &2a37 a5 25 LDA &25 ; player_y &2a39 38 SEC &2a3a e9 04 SBC #&04 # consider what's four pixels above them &2a3c a8 TAY &2a3d a6 24 LDX &24 ; player_x &2a3f 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &2a42 a0 00 LDY #&00 # +0 pixels right &2a44 b1 02 LDA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2a46 a0 20 LDY #&20 # +8 pixels right &2a48 11 02 ORA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2a4a a0 10 LDY #&10 # +4 pixels right &2a4c 11 02 ORA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2a4e 30 27 BMI &2a77 ; consider_if_player_pressed_down &2a50 a5 02 LDA &02 ; screen_address_low &2a52 85 04 STA &04 ; feet_screen_address_low &2a54 a5 03 LDA &03 ; screen_address_high &2a56 69 05 ADC #&05 # +16 pixels down &2a58 85 05 STA &05 ; feet_screen_address_high &2a5a b1 02 LDA (&02),Y ; screen_address # +4 pixels right &2a5c 11 04 ORA (&04),Y ; feet_screen_address # (first byte of block, so top bit set if obstacle) &2a5e a0 08 LDY #&08 # +2 pixels right &2a60 11 02 ORA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2a62 11 04 ORA (&04),Y ; feet_screen_address &2a64 a0 18 LDY #&18 # +6 pixels right &2a66 11 02 ORA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2a68 11 04 ORA (&04),Y ; feet_screen_address &2a6a 29 c0 AND #&c0 &2a6c f0 09 BEQ &2a77 ; consider_if_player_pressed_down # checking this keeps them on something climbable &2a6e a5 01 LDA &01 ; y &2a70 85 25 STA &25 ; player_y # If it does, move the player up four pixels &2a72 d0 35 BNE &2aa9 ; set_player_sprite_up # and set their sprite accordingly ; to_unplot_and_plot_player &2a74 4c 2a 2c JMP &2c2a ; unplot_and_plot_player ; consider_if_player_pressed_down &2a77 a5 33 LDA &33 ; player_pressed_down &2a79 f0 32 BEQ &2aad ; check_for_left_and_right # If the player pressed DOWN, &2a7b a9 00 LDA #&00 &2a7d 85 2a STA &2a ; player_jump_up_speed # end any upwards jump ; consider_moving_player_down &2a7f a5 25 LDA &25 ; player_y &2a81 c9 e8 CMP #&e8 # If they're not at the bottom of the screen, &2a83 b0 14 BCS &2a99 ; player_isn't_supported_below &2a85 69 10 ADC #&10 # Consider what's just beneath their feet &2a87 a8 TAY &2a88 a6 24 LDX &24 ; player_x &2a8a 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &2a8d a0 03 LDY #&03 # +3 pixels down &2a8f b1 02 LDA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &2a91 a0 23 LDY #&23 # +8 pixels right, +3 pixels down &2a93 11 02 ORA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &2a95 30 16 BMI &2aad ; check_for_left_and_right &2a97 a5 25 LDA &25 ; player_y ; player_isn't_supported_below # If they're not blocked by something, &2a99 69 04 ADC #&04 &2a9b 85 25 STA &25 ; player_y # Move the player down four pixels &2a9d c9 f8 CMP #&f8 &2a9f b0 d3 BCS &2a74 ; to_unplot_and_plot_player # If they're not off the bottom of the screen, &2aa1 a5 35 LDA &35 ; player_pressed_action &2aa3 d0 04 BNE &2aa9 ; set_player_sprite_up # If the player didn't press ACTION, set their sprite &2aa5 e6 35 INC &35 ; player_pressed_action &2aa7 d0 d6 BNE &2a7f ; consider_moving_player_down # otherwise, consider moving player down again ; set_player_sprite_up &2aa9 a9 04 LDA #&04 ; up/down &2aab 85 26 STA &26 ; player_sprite ; check_for_left_and_right &2aad a6 24 LDX &24 ; player_x &2aaf a5 34 LDA &34 ; player_pressed_left &2ab1 f0 08 BEQ &2abb ; left_not_pressed # If the player pressed LEFT, &2ab3 ca DEX &2ab4 ca DEX # consider moving two pixels left &2ab5 86 0c STX &0c ; new_player_x &2ab7 a9 02 LDA #&02 ; left &2ab9 d0 0f BNE &2aca ; consider_moving_left_or_right ; left_not_pressed &2abb a5 32 LDA &32 ; player_pressed_right &2abd f0 5b BEQ &2b1a ; no_horizontal_movement # If the player pressed RIGHT, &2abf e8 INX &2ac0 e8 INX # consider moving two pixels right &2ac1 86 0c STX &0c ; new_player_x &2ac3 8a TXA &2ac4 18 CLC &2ac5 69 08 ADC #&08 &2ac7 aa TAX &2ac8 a9 00 LDA #&00 ; right ; consider_moving_left_or_right &2aca 85 0b STA &0b ; new_player_sprite &2acc a4 25 LDY &25 ; player_y &2ace 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &2ad1 a0 00 LDY #&00 # +0 pixels &2ad3 b1 02 LDA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2ad5 30 43 BMI &2b1a ; no_horizontal_movement # Would this collide the player's head with anything? &2ad7 a5 02 LDA &02 ; screen_address_low &2ad9 69 80 ADC #&80 &2adb 85 02 STA &02 ; screen_address_low &2add a5 03 LDA &03 ; screen_address_high &2adf 69 02 ADC #&02 # +8 pixels down &2ae1 85 03 STA &03 ; screen_address_high &2ae3 30 04 BMI &2ae9 ; skip_middle_check # Don't check if this goes off the bottom of the screen &2ae5 b1 02 LDA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2ae7 30 31 BMI &2b1a ; no_horizontal_movement # Or their middle? ; skip_middle_check &2ae9 a5 25 LDA &25 ; player_y &2aeb 69 04 ADC #&04 &2aed 85 01 STA &01 ; y &2aef 20 08 25 JSR &2508 ; calculate_screen_address &2af2 a0 00 LDY #&00 # +4 pixels down &2af4 b1 02 LDA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2af6 30 22 BMI &2b1a ; no_horizontal_movement # Or their neck? &2af8 a5 02 LDA &02 ; screen_address_low &2afa 69 80 ADC #&80 &2afc 85 02 STA &02 ; screen_address_low &2afe a5 03 LDA &03 ; screen_address_high &2b00 69 02 ADC #&02 # +12 pixels down &2b02 85 03 STA &03 ; screen_address_high &2b04 30 04 BMI &2b0a ; skip_feet_check # Don't check if this goes off the bottom of the screen &2b06 b1 02 LDA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2b08 30 10 BMI &2b1a ; no_horizontal_movement # Or their feet? ; skip_feet_check &2b0a a5 0c LDA &0c ; new_player_x &2b0c 29 fe AND #&fe &2b0e c9 97 CMP #&97 # If the player isn't past the right of the screen, &2b10 b0 08 BCS &2b1a ; no_horizontal_movement &2b12 85 24 STA &24 ; player_x # move them, &2b14 a5 0b LDA &0b ; new_player_sprite &2b16 85 26 STA &26 ; player_sprite # set their sprite, &2b18 90 4d BCC &2b67 ; consider_if_player_is_touching_energy # and see how that affects them ; no_horizontal_movement &2b1a a6 24 LDX &24 ; player_x &2b1c a4 25 LDY &25 ; player_y &2b1e 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y # Consider if the player is sliding down a slope &2b21 a0 08 LDY #&08 # +2 pixels right &2b23 b1 02 LDA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2b25 a0 10 LDY #&10 # +4 pixels right &2b27 11 02 ORA (&02),Y ; screen_address # (first byte of block, so top bit set if obstacle) &2b29 a0 1b LDY #&1b # +6 pixels right, +3 pixels down &2b2b 11 02 ORA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &2b2d 29 c0 AND #&c0 # Skip their head is on something climbable &2b2f d0 36 BNE &2b67 ; consider_if_player_is_touching_energy &2b31 a5 03 LDA &03 ; screen_address_high &2b33 69 05 ADC #&05 # +16 pixels down &2b35 85 03 STA &03 ; screen_address_high &2b37 30 2e BMI &2b67 ; consider_if_player_is_touching_energy # Skip if this goes off the bottom of the screen &2b39 b1 02 LDA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &2b3b a0 13 LDY #&13 # +4 pixels right, +3 pixels down &2b3d 11 02 ORA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &2b3f a0 0b LDY #&0b # +2 pixels right, +3 pixels down &2b41 11 02 ORA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &2b43 29 c0 AND #&c0 &2b45 d0 20 BNE &2b67 ; consider_if_player_is_touching_energy # Is there ground beneath the player? If not, &2b47 a0 23 LDY #&23 # +8 pixels right, +3 pixels down &2b49 b1 02 LDA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &2b4b a0 03 LDY #&03 # +0 pixels right, +3 pixels down &2b4d 11 02 ORA (&02),Y ; screen_address # (fourth byte of block, so top bit set if obstacle) &2b4f 29 c0 AND #&c0 &2b51 f0 14 BEQ &2b67 ; consider_if_player_is_touching_energy # Is there ground to one or other side? &2b53 b1 02 LDA (&02),Y ; screen_address &2b55 d0 08 BNE &2b5f ; slide_right # If there is ground to the right, &2b57 c6 24 DEC &24 ; player_x # Move the player left two pixels &2b59 c6 24 DEC &24 ; player_x &2b5b a9 02 LDA #&02 ; left &2b5d d0 06 BNE &2b65 ; set_player_sprite ; slide_right # If there is ground to the left, &2b5f e6 24 INC &24 ; player_x # Move the player right two pixels &2b61 e6 24 INC &24 ; player_x &2b63 a9 00 LDA #&00 ; right ; set_player_sprite &2b65 85 26 STA &26 ; player_sprite ; consider_if_player_is_touching_energy &2b67 ad 27 01 LDA &0127 ; energy_x &2b6a f0 3e BEQ &2baa ; consider_if_player_is_touching_door # Is there ENERGY in the room? &2b6c 18 CLC &2b6d 69 03 ADC #&03 &2b6f e5 24 SBC &24 ; player_x &2b71 c9 09 CMP #&09 &2b73 b0 35 BCS &2baa ; consider_if_player_is_touching_door &2b75 ad 28 01 LDA &0128 ; energy_y &2b78 69 09 ADC #&09 &2b7a e5 25 SBC &25 ; player_y &2b7c c9 11 CMP #&11 &2b7e b0 2a BCS &2baa ; consider_if_player_is_touching_door # If so, is the player touching it? &2b80 ac 26 01 LDY &0126 ; energy_number &2b83 a9 01 LDA #&01 &2b85 99 f0 04 STA &04f0,Y ; energy_collected_table # Mark as collected &2b88 a2 30 LDX #&30 # Gain 30 energy for ENERGY_GREEN # actually LDX green_energy_boost &2b8a c0 0a CPY #&0a &2b8c 90 04 BCC &2b92a ; gain_energy &2b8e a2 50 LDX #&50 # Gain 50 energy for ENERGY_RED # actually LDX red_energy_boost &2b90 a9 02 LDA #&02 ; gain_energy &2b92 20 09 30 JSR &3009 ; gain_A_score_and_X_energy # Gain 2 points for collecting ENERGY &2b95 a2 63 LDX #&63 # actually LDX energy_sprite &2b97 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &2b9a ad 28 01 LDA &0128 ; energy_y &2b9d 85 01 STA &01 ; y &2b9f ae 27 01 LDX &0127 ; energy_x &2ba2 20 90 25 JSR &2590 ; plot_sprite_in_slot_zero # Unplot ENERGY from room &2ba5 a9 00 LDA #&00 &2ba7 8d 27 01 STA &0127 ; energy_x ; consider_if_player_is_touching_door &2baa ad 29 01 LDA &0129 ; door_x # Is the player touching a DOOR? &2bad c5 24 CMP &24 ; player_x &2baf d0 43 BNE &2bf4 ; consider_if_player_is_touching_something_painful &2bb1 aa TAX &2bb2 a5 25 LDA &25 ; player_y &2bb4 29 f0 AND #&f0 &2bb6 cd 2a 01 CMP &012a ; door_y &2bb9 d0 39 BNE &2bf4 ; consider_if_player_is_touching_something_painful &2bbb ac 2b 01 LDY &012b ; room_door_type &2bbe 99 a8 08 STA &08a8,Y ; doors_opened # If so, mark DOOR as having been opened &2bc1 98 TYA &2bc2 09 40 ORA #&40 # DOOR sprites start at &40 &2bc4 aa TAX &2bc5 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &2bc8 ac 2a 01 LDY &012a ; door_y &2bcb 84 01 STY &01 ; y &2bcd ae 29 01 LDX &0129 ; door_x &2bd0 20 90 25 JSR &2590 ; plot_sprite_in_slot_zero # Unplot DOOR from room &2bd3 ad 2b 01 LDA &012b ; room_door_type &2bd6 09 48 ORA #&48 # KEY sprites start at &48; remove key from pocket &2bd8 20 30 40 JSR &4030 ; check_if_player_has_object_A_and_remove_it &2bdb a5 21 LDA &21 ; pocket_x &2bdd a2 0f LDX #&0f &2bdf 8e 2a 01 STX &012a ; door_y &2be2 c9 8c CMP #&8c &2be4 90 01 BCC &2be7 ; key_wasn't_in_pocket_two &2be6 e8 INX ; key_wasn't_in_pocket_two &2be7 20 a0 40 JSR &40a0 ; tab_to_x_1 # Remove letter associated with key &2bea a9 20 LDA #&20 ; " " &2bec 20 ee ff JSR &ffee ; OSWRCH &2bef a9 02 LDA #&02 &2bf1 20 07 30 JSR &3007 ; gain_A_score_and_ten_energy # Gain 2 score and 10 energy for unlocking DOOR ; consider_if_player_is_touching_something_painful &2bf4 a5 25 LDA &25 ; player_y &2bf6 c9 f8 CMP #&f8 &2bf8 b0 30 BCS &2c2a ; unplot_and_plot_player # If they're not off the bottom of the screen, &2bfa a8 TAY &2bfb a6 24 LDX &24 ; player_x &2bfd 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &2c00 a0 09 LDY #&09 # +2 pixels right, +1 pixel down &2c02 b1 02 LDA (&02),Y ; screen_address # (second byte of block, so top bit set if painful) &2c04 a0 19 LDY #&19 # +6 pixels right, +1 pixel down &2c06 11 02 ORA (&02),Y ; screen_address # (second byte of block, so top bit set if painful) &2c08 30 1b BMI &2c25 ; incur_damage_from_contact # Is the player's head in something painful? &2c0a a5 01 LDA &01 ; y &2c0c 69 08 ADC #&08 # +8 pixels down &2c0e c9 f8 CMP #&f8 # If their feet aren't off the bottom of the screen, &2c10 b0 18 BCS &2c2a ; unplot_and_plot_player &2c12 85 01 STA &01 ; y &2c14 20 08 25 JSR &2508 ; calculate_screen_address &2c17 a0 11 LDY #&11 # +4 pixels right, +1 pixel down &2c19 b1 02 LDA (&02),Y ; screen_address # (second byte of block, so top bit set if painful) &2c1b a0 21 LDY #&21 # +8 pixels right, +1 pixel down &2c1d 11 02 ORA (&02),Y ; screen_address # (second byte of block, so top bit set if painful) &2c1f a0 01 LDY #&01 # +1 pixel down &2c21 11 02 ORA (&02),Y ; screen_address &2c23 10 05 BPL &2c2a ; unplot_and_plot_player # Are the player's feet in something painful? ; incur_damage_from_contact &2c25 a9 01 LDA #&01 # If so, drain 1 energy &2c27 20 1b 30 JSR &301b ; drain_player_energy ; unplot_and_plot_player # Set up the player's sprite for unplotting &2c2a a9 23 LDA #&23 # Player sprite offset_of_last_byte &2c2c 8d 88 26 STA &2688 ; four_colour_sprite_offset_of_last_byte &2c2f a9 00 LDA #&00 # Player sprite or_value &2c31 8d bc 26 STA &26bc ; four_colour_sprite_painfulness &2c34 a9 09 LDA #&09 # Player sprite height in blocks # actually LDA player_sprite_height &2c36 85 04 STA &04 ; blocks_remaining &2c38 a9 10 LDA #&10 # actually LDA player_sprite_data_address_low &2c3a 8d 8c 26 STA &268c ; four_colour_sprite_data_address_low_one # Self-modifying code &2c3d 8d 92 26 STA &2692 ; four_colour_sprite_data_address_low_two # Self-modifying code &2c40 a9 06 LDA #&06 # actually LDA player_sprite_data_address_high &2c42 8d 8d 26 STA &268d ; four_colour_sprite_data_address_high_one # Self-modifying code &2c45 8d 93 26 STA &2693 ; four_colour_sprite_data_address_high_two # Self-modifying code &2c48 a5 27 LDA &27 ; previous_player_x &2c4a 85 00 STA &00 ; x &2c4c a5 28 LDA &28 ; previous_player_y &2c4e 85 01 STA &01 ; y &2c50 a9 c4 LDA #&c4 ; player_palette_table_low # &5c4 = player_palette_table &2c52 20 6e 26 JSR &266e ; plot_previous_four_colour_sprite_with_given_palette # Unplot previous player sprite &2c55 a5 24 LDA &24 ; player_x &2c57 85 00 STA &00 ; x &2c59 c5 27 CMP &27 ; previous_player_x &2c5b f0 0d BEQ &2c6a ; player_didn't_move_in_x # If the player has moved horizontally, &2c5d 85 27 STA &27 ; previous_player_x &2c5f a5 2a LDA &2a ; player_jump_up_speed &2c61 f0 0d BEQ &2c70 ; player_isn't_jumping &2c63 a5 26 LDA &26 ; player_sprite # and they are jumping, &2c65 4a LSR A # get direction of player &2c66 09 06 ORA #&06 ; jumping # and use this to determine jumping sprite &2c68 d0 1b BNE &2c85 ; set_player_sprite_for_plotting ; player_didn't_move_in_x &2c6a a5 26 LDA &26 ; player_sprite &2c6c a6 2a LDX &2a ; player_jump_up_speed &2c6e d0 17 BNE &2c87 ; setup_player_sprite_for_plotting ; player_isn't_jumping &2c70 a5 26 LDA &26 ; player_sprite &2c72 c9 06 CMP #&06 ; jumping &2c74 90 05 BCC &2c7b ; player_wasn't_jumping # If the player was, but now isn't jumping, &2c76 e9 06 SBC #&06 # use the previous sprite to determine their direction &2c78 0a ASL A &2c79 10 0a BPL &2c85 ; set_player_sprite_for_plotting ; player_wasn't_jumping &2c7b ad 21 01 LDA &0121 ; player_sprite_frame # If the player has moved horizontally (but isn't &2c7e 49 01 EOR #&01 # jumping), alternate the frame to move their feet &2c80 8d 21 01 STA &0121 ; player_sprite_frame &2c83 05 26 ORA &26 ; player_sprite ; set_player_sprite_for_plotting &2c85 85 26 STA &26 ; player_sprite ; setup_player_sprite_for_plotting # Set up the player's sprite for plotting &2c87 aa TAX &2c88 bd 08 06 LDA &0608,X ; player_sprites_address_high_table &2c8b 8d 41 2c STA &2c41 ; player_sprite_data_address_high &2c8e 8d 8d 26 STA &268d ; four_colour_sprite_data_address_high_one &2c91 8d 93 26 STA &2693 ; four_colour_sprite_data_address_high_two &2c94 bd 00 06 LDA &0600,X ; player_sprites_address_low_table &2c97 a2 03 LDX #&03 &2c99 a4 25 LDY &25 ; player_y &2c9b c0 48 CPY #&48 &2c9d b0 0c BCS &2cab ; player_entirely_on_screen # If the player isn't entirely on screen, &2c9f 69 0a ADC #&0a # skip bytes of sprite data &2ca1 ca DEX # and remove a block of height &2ca2 c0 42 CPY #&42 &2ca4 b0 03 BCS &2ca9 ; set_y &2ca6 69 0a ADC #&0a # twice, if necessary &2ca8 ca DEX ; set_y &2ca9 a0 48 LDY #&48 ; player_entirely_on_screen &2cab 84 01 STY &01 ; y &2cad 84 28 STY &28 ; previous_player_y &2caf 8d 8c 26 STA &268c ; four_colour_sprite_data_address_low_one &2cb2 8d 92 26 STA &2692 ; four_colour_sprite_data_address_low_two &2cb5 8d 39 2c STA &2c39 ; player_sprite_data_address_low &2cb8 86 04 STX &04 ; blocks_remaining &2cba 8e 35 2c STX &2c35 ; player_sprite_height &2cbd 4c 7a 26 JMP &267a ; plot_previous_four_colour_sprite # Plot player ; handle_location_based_actions &2cc0 a5 25 LDA &25 ; player_y &2cc2 c5 49 CMP &49 ; water_minimum_y # Is the player in WATER? &2cc4 90 39 BCC &2cff ; not_in_water &2cc6 a5 24 LDA &24 ; player_x &2cc8 c5 9c CMP &9c ; water_minimum_x &2cca 90 33 BCC &2cff ; not_in_water &2ccc c5 9d CMP &9d ; water_maximum_x &2cce b0 2f BCS &2cff ; not_in_water &2cd0 a9 09 LDA #&09 ; EMPTY_BUCKET # If so, convert an EMPTY_BUCKET into a FULL_BUCKET &2cd2 a2 0a LDX #&0a ; FULL_BUCKET &2cd4 20 32 40 JSR &4032 ; check_if_player_has_object_A_and_change_it_into_X &2cd7 a5 98 LDA &98 ; player_maximum_breath &2cd9 d0 06 BNE &2ce1 ; skip_breath_reset # Handle holding breath underwater &2cdb a9 be LDA #&be &2cdd 85 98 STA &98 ; player_maximum_breath &2cdf 85 99 STA &99 ; player_breath ; skip_breath_reset &2ce1 c6 99 DEC &99 ; player_breath &2ce3 d0 1e BNE &2d03 ; player_hasn't_run_out_of_breath &2ce5 46 98 LSR &98 ; player_maximum_breath # Player can hold their breath less and less &2ce7 46 98 LSR &98 ; player_maximum_breath &2ce9 d0 04 BNE &2cef ; player_isn't_drowning &2ceb a9 ff LDA #&ff # Retreat to the surface when maximum breath runs out &2ced 85 9a STA &9a ; pain_level ; player_isn't_drowning &2cef a9 02 LDA #&02 # Hurt player for running out of breath &2cf1 20 1b 30 JSR &301b ; drain_player_energy &2cf4 a5 98 LDA &98 ; player_maximum_breath &2cf6 85 99 STA &99 ; player_breath &2cf8 a9 14 LDA #&14 &2cfa a2 01 LDX #&01 &2cfc 4c 33 3f JMP &3f33 ; play_sound_from_x_and_a # Play sound for running out of breath ; not_in_water &2cff a9 00 LDA #&00 # Recover breath when out of water &2d01 85 98 STA &98 ; player_breath ; player_hasn't_run_out_of_breath &2d03 a9 63 LDA #&63 # actually LDA switch_x &2d05 c5 24 CMP &24 ; player_x # Has the player touched a SWITCH? &2d07 d0 50 BNE &2d59 ; switch_not_pressed &2d09 a9 63 LDA #&63 # actually LDA switch_y &2d0b c5 25 CMP &25 ; player_y &2d0d d0 4a BNE &2d59 ; switch_not_pressed &2d0f a5 35 LDA &35 ; player_pressed_action &2d11 d0 46 BNE &2d59 ; switch_not_pressed &2d13 a4 37 LDY &37 ; player_room &2d15 c0 80 CPY #&80 ; West Wing # SWITCH in West Wing enables/disables platforms &2d17 d0 0e BNE &2d27 ; not_west_wing_switch &2d19 a9 04 LDA #&04 &2d1b a6 6b LDX &6b ; enemies_speed_y + 0 &2d1d f0 02 BEQ &2d21 ; activate_platform &2d1f a9 00 LDA #&00 ; activate_platform &2d21 85 6b STA &6b ; enemies_speed_y + 0 &2d23 85 6c STA &6c ; enemies_speed_y + 1 &2d25 10 1d BPL &2d44 ; update_switch ; not_west_wing_switch &2d27 a2 00 LDX #&00 &2d29 c0 48 CPY #&48 ; right of Central Tower &2d2b f0 05 BEQ &2d32 ; central_tower_switch &2d2d e8 INX &2d2e c0 71 CPY #&71 ; The Well Wheel &2d30 f0 0a BEQ &2d3c ; well_wheel_switch ; central_tower_switch # SWITCH right of Central Tower can be toggled &2d32 bd f4 07 LDA &07f4,X ; switch_states &2d35 49 01 EOR #&01 &2d37 9d f4 07 STA &07f4,X; switch_states &2d3a 10 08 BPL &2d44 ; update_switch ; well_wheel_switch # The Well Wheel SWITCH can be set &2d3c bd f4 07 LDA &07f4,X; switch_states &2d3f 09 01 ORA #&01 &2d41 9d f4 07 STA &07f4,X; switch_states ; update_switch &2d44 a5 25 LDA &25 ; player_y &2d46 09 04 ORA #&04 &2d48 a6 24 LDX &24 ; player_x &2d4a a0 05 LDY #&05 ; SWITCH_UP # SWITCH is always in sprite slots 5 and 6 &2d4c 20 44 26 JSR &2644 ; plot_four_colour_sprite # Plot both up and down frames, &2d4f a0 06 LDY #&06 ; SWITCH_DOWN # changing what's shown on screen &2d51 20 48 26 JSR &2648 ; plot_four_colour_sprite_with_previous_x_and_y &2d54 a9 41 LDA #&41 &2d56 20 31 3f JSR &3f31 ; play_sound_full_volume_noise # Play a sound for toggling a switch ; switch_not_pressed &2d59 a5 37 LDA &37 ; player_room &2d5b c9 0b CMP #&0b ; Central Tower (inside) # Is the player in one of the two Central Towers? &2d5d f0 04 BEQ &2d63 ; consider_central_tower_actions &2d5f c9 47 CMP #&47 ; Central Tower (outside) &2d61 d0 15 BNE &2d78 ; consider_pyramid_actions ; consider_central_tower_actions &2d63 a6 25 LDX &25 ; player_y &2d65 e0 90 CPX #&90 &2d67 d0 0f BNE &2d78 ; consider_pyramid_actions &2d69 a6 24 LDX &24 ; player_x &2d6b e0 50 CPX #&50 &2d6d d0 09 BNE &2d78 ; consider_pyramid_actions &2d6f a6 35 LDX &35 ; player_pressed_action &2d71 d0 05 BNE &2d78 ; consider_pyramid_actions &2d73 49 4c EOR #&4c # Move between the two Central Tower rooms &2d75 aa TAX # when the player presses ACTION in the doorway &2d76 d0 3c BNE &2db4 ; change_room_and_leave_to_replot ; consider_pyramid_actions &2d78 c9 3d CMP #&3d ; The Pyramid # Is the player at the bottom of The Pyramid? &2d7a d0 16 BNE &2d92 ; consider_witch's_house_outside_actions &2d7c a5 24 LDA &24 ; player_x &2d7e c9 46 CMP #&46 &2d80 d0 3b BNE &2dbd ; leave &2d82 a5 25 LDA &25 ; player_y &2d84 10 37 BPL &2dbd ; leave &2d86 a9 11 LDA #&11 ; PYRAMID_FIGURINE # Convert the FIGURINE into the third CRYSTAL &2d88 a2 02 LDX #&02 ; CRYSTAL_CKM &2d8a 20 32 40 JSR &4032 ; check_if_player_has_object_A_and_change_it_into_X &2d8d 90 2e BCC &2dbd ; leave &2d8f 4c 05 30 JMP &3005 ; gain_three_score_and_ten_energy # Gain 3 score and 10 energy for converting figurine ; consider_witch's_house_outside_actions &2d92 c9 68 CMP #&68 ; Witch's House (outside) # Is the player outside Witch's House? &2d94 d0 28 BNE &2dbe ; consider_lab_actions &2d96 a5 24 LDA &24 ; player_x &2d98 c9 3c CMP #&3c &2d9a d0 21 BNE &2dbd ; leave &2d9c a5 25 LDA &25 ; player_y &2d9e 09 07 ORA #&07 &2da0 c9 87 CMP #&87 &2da2 d0 19 BNE &2dbd ; leave &2da4 a9 00 LDA #&00 &2da6 85 2a STA &2a ; player_jump_up_speed &2da8 a9 45 LDA #&45 &2daa 85 25 STA &25 ; player_y &2dac 20 31 3f JSR &3f31 ; play_sound_full_volume_noise &2daf ce 2e 01 DEC &012e ; room_y # Move the player inside Witch's House &2db2 a2 91 LDX #&91 ; Witch's House (inside) # when standing on top of the chimney ; change_room_and_leave_to_replot &2db4 86 37 STX &37 ; player_room &2db6 68 PLA # Remove handle_location_based_actions &2db7 68 PLA &2db8 68 PLA # and handle_player_update from stack &2db9 68 PLA &2dba 4c ab 42 JMP &42ab ; change_room_number_prior_to_entry ; leave &2dbd 60 RTS ; consider_lab_actions &2dbe c9 c2 CMP #&c2 ; The lab # Is the player in The lab? &2dc0 d0 4f BNE &2e11 ; consider_temple_actions &2dc2 a5 24 LDA &24 ; player_x &2dc4 c9 46 CMP #&46 # If the player is standing by the lab cannon, &2dc6 d0 48 BNE &2e10 ; leave &2dc8 a5 25 LDA &25 ; player_y &2dca c9 78 CMP #&78 &2dcc 90 42 BCC &2e10 ; leave &2dce a9 13 LDA #&13 ; CANNONBALL # add CANNONBALL or GUNPOWDER to the cannon if carried &2dd0 20 30 40 JSR &4030 ; check_if_player_has_object_A_and_remove_it &2dd3 b0 07 BCS &2ddc ; added_to_cannon &2dd5 a9 14 LDA #&14 ; GUNPOWDER &2dd7 20 30 40 JSR &4030 ; check_if_player_has_object_A_and_remove_it &2dda 90 34 BCC &2e10 ; leave ; added_to_cannon &2ddc ae fb 07 LDX &07fb ; cannon_fired &2ddf f0 28 BEQ &2e09 ; only_one_ingredient_for_cannon # Does the cannon contain both CANNONBALL and GUNPOWDER? &2de1 a9 6f LDA #&6f &2de3 a2 40 LDX #&40 &2de5 20 33 3f JSR &3f33 ; play_sound_from_x_and_a # If so, play a sound for the cannon firing &2de8 a9 80 LDA #&80 &2dea 85 01 STA &01 ; y &2dec a9 56 LDA #&56 &2dee 85 00 STA &00 ; x ; cannonball_animation_loop # and animate the CANNONBALL leaving the cannon &2df0 a0 05 LDY #&05 &2df2 20 48 26 JSR &2648 ; plot_four_colour_sprite_with_previous_x_and_y &2df5 a9 13 LDA #&13 ; Wait for Vertical Retrace &2df7 20 f4 ff JSR &fff4 ; OSBYTE &2dfa a0 05 LDY #&05 # Sprite slot 5 contains CANNONBALL &2dfc 20 48 26 JSR &2648 ; plot_four_colour_sprite_with_previous_x_and_y &2dff a6 00 LDX &00 ; x &2e01 e8 INX &2e02 e8 INX &2e03 86 00 STX &00 ; x &2e05 e0 9a CPX #&9a &2e07 90 e7 BCC &2df0 ; cannonball_animation_loop ; only_one_ingredient_for_cannon &2e09 e8 INX &2e0a 8e fb 07 STX &07fb ; cannon_fired &2e0d 4c 05 30 JMP &3005 ; gain_three_score_and_ten_energy # Gain 3 score and 10 energy for adding to cannon ; leave &2e10 60 RTS ; consider_temple_actions &2e11 c9 ca CMP #&ca ; The Temple (with guardian) # Is the player in The Temple? &2e13 d0 1e BNE &2e33 ; consider_kitchen_actions &2e15 a5 24 LDA &24 ; player_x &2e17 c9 50 CMP #&50 # Is the player to the right of the object plinth? &2e19 90 f5 BCC &2e10 ; leave &2e1b ad fc 07 LDA &07fc ; temple_guardian_has_been_fed &2e1e d0 f0 BNE &2e10 ; leave &2e20 a9 16 LDA #&16 ; CHICKEN_COOKED # If the player isn't carrying CHICKEN_COOKED, &2e22 20 30 40 JSR &4030 ; check_if_player_has_object_A_and_remove_it &2e25 b0 06 BCS &2e2d ; feed_temple_guardian &2e27 a9 06 LDA #&06 # activate enemy 6, which is TEMPLE_GUARDIAN &2e29 85 36 STA &36 ; number_of_enemies_in_room &2e2b d0 e3 BNE &2e10 ; leave ; feed_temple_guardian &2e2d ee fc 07 INC &07fc ; temple_guardian_has_been_fed &2e30 4c 05 30 JMP &3005 ; gain_three_score_and_ten_energy # Gain 3 score and 10 energy for feeding temple guardian ; consider_kitchen_actions &2e33 c9 5a CMP #&5a ; The Kitchen # Is the player in The Kitchen? &2e35 d0 2c BNE &2e63 ; consider_witch's_house_actions &2e37 a5 53 LDA &53 ; enemies_x + 0 # Is the topmost FIRE over the object plinth? &2e39 c9 20 CMP #&20 &2e3b b0 d3 BCS &2e10 ; leave &2e3d a5 5b LDA &5b ; enemies_y + 0 &2e3f c9 c0 CMP #&c0 &2e41 b0 cd BCS &2e10 ; leave &2e43 a4 2d LDY &2d ; object_in_room &2e45 be a8 03 LDX &03a8,Y ; object_sprite_table &2e48 e0 15 CPX #&15 ; CHICKEN_RAW # If so, is the object on the plinth CHICKEN_RAW? &2e4a d0 c4 BNE &2e10 ; leave &2e4c 20 57 2e JSR &2e57 ; plot_or_unplot_chicken # Unplot CHICKEN_RAW &2e4f 20 05 30 JSR &3005 ; gain_three_score_and_ten_energy # Gain 3 score and 10 energy for cooking chicken &2e52 a2 16 LDX #&16 ; CHICKEN_COOKED # Change object in room to CHICKEN_COOKED &2e54 8e ab 03 STX &03ab ; object_sprite_table + 3 ; gain_three_score_and_ten_energy &2e57 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero # and plot it again &2e5a a9 90 LDA #&90 &2e5c 85 01 STA &01 ; y &2e5e a2 1e LDX #&1e ; x &2e60 4c 77 25 JMP &2577 ; plot_sprite_in_slot_zero_adjusting_position ; consider_witch's_house_actions &2e63 c9 92 CMP #&92 ; Witch's House (inside) # Is the player inside Witch's House (with the witch)? &2e65 d0 5e BNE &2ec5 ; consider_stonehenge_actions &2e67 a5 24 LDA &24 ; player_x &2e69 c9 28 CMP #&28 &2e6b 90 11 BCC &2e7e ; player_not_past_cauldron &2e6d a2 1b LDX #&1b ; SKULL # Are they carrying SKULL, BONE_CYAN or BONE_MAGENTA ; check_skull_and_bones_loop &2e6f 86 0b STX &0b ; object_to_check &2e71 8a TXA &2e72 20 30 40 JSR &4030 ; check_if_player_has_object_A_and_remove_it &2e75 b0 48 BCS &2ebf ; has_skull_or_bone &2e77 a6 0b LDX &0b ; object_to_check &2e79 e8 INX &2e7a e0 1e CPX #&1e &2e7c 90 f1 BCC &2e6f ; check_skull_and_bones_loop ; player_not_past_cauldron &2e7e ad fd 07 LDA &07fd ; bones_still_needed_in_cauldron &2e81 d0 58 BNE &2edb ; leave # Does the cauldron contain all three parts? &2e83 a6 57 LDX &57 ; enemies_x + 4 &2e85 e0 2a CPX #&2a # If so, and the WITCH is over the cauldron, &2e87 b0 52 BCS &2edb ; leave &2e89 a5 5f LDA &5f ; enemies_y + 4 &2e8b 85 01 STA &01 ; y &2e8d a0 06 LDY #&06 # Sprite slots 5 and 6 contain WITCH &2e8f 84 17 STY &17 ; sprite_slot &2e91 88 DEY &2e92 20 46 26 JSR &2646 ; plot_four_colour_sprite_with_previous_y # Unplot the WITCH &2e95 a9 5f LDA #&5f &2e97 a2 49 LDX #&49 &2e99 20 33 3f JSR &3f33 ; play_sound_from_x_and_a # Play a sound for the WITCH's death, then animate it ; witch_death_animation_loop &2e9c a4 17 LDY &17 ; sprite_slot # Plot WITCH or FIRE &2e9e 20 48 26 JSR &2648 ; plot_four_colour_sprite_with_previous_x_and_y &2ea1 20 10 41 JSR &4110 ; brief_delay &2ea4 a4 17 LDY &17 ; sprite_slot # Unplot again after a brief delay &2ea6 20 48 26 JSR &2648 ; plot_four_colour_sprite_with_previous_x_and_y &2ea9 c6 01 DEC &01 ; y &2eab a6 01 LDX &01 ; y &2ead e0 60 CPX #&60 &2eaf b0 08 BCS &2eb9 ; skip_sprite_change &2eb1 a5 17 LDA &17 ; sprite_slot &2eb3 29 03 AND #&03 # Sprites slots 1-4 contain FIRE &2eb5 69 01 ADC #&01 &2eb7 85 17 STA &17 ; sprite_slot # Set WITCH on FIRE above a certain point ; skip_sprite_change &2eb9 e0 38 CPX #&38 &2ebb b0 df BCS &2e9c ; witch_death_animation_loop &2ebd c6 36 DEC &36 ; number_of_enemies_in_room # Remove WITCH from room ; has_skull_or_bone # Gain 3 points and 10 energy for killing witch &2ebf ce fd 07 DEC &07fd ; bones_still_needed_in_cauldron &2ec2 4c 05 30 JMP &3005 ; gain_three_score_and_ten_energy # Gain 3 points and 10 energy for depositing bones ; consider_stonehenge_actions &2ec5 c9 65 CMP #&65 ; Stonehenge # Is the player in Stonehenge? &2ec7 d0 13 BNE &2edc ; consider_temple_actions &2ec9 a5 24 LDA &24 ; player_x &2ecb c9 32 CMP #&32 # If so, is the player in the middle of the archway? &2ecd d0 0c BNE &2edb ; leave &2ecf a9 1e LDA #&1e ; IRON_BAR &2ed1 20 30 40 JSR &4030 ; check_if_player_has_object_A_and_remove_it &2ed4 90 05 BCC &2edb ; leave &2ed6 a9 40 LDA #&40 # Gain 40 energy for IRON_BAR &2ed8 4c 0f 30 JMP &300f ; boost_player_energy ; leave &2edb 60 RTS ; consider_temple_actions &2edc c9 cb CMP #&cb ; The Temple # Is the player in The Temple? &2ede d0 20 BNE &2f00 ; consider_star_port_actions &2ee0 a4 2d LDY &2d ; object_in_room &2ee2 be a8 03 LDX &03a8,Y ; object_sprite_table &2ee5 e0 05 CPX #&05 # If so, have they put down a CRYSTAL? &2ee7 b0 f2 BCS &2edb ; leave &2ee9 9d f6 07 STA &07f6,X ; crystals_in_sanctuary # Add the CRYSTAL to The Sanctuary &2eec 99 a8 03 STA &03a8,Y ; object_sprite_table # Remove it from The Temple &2eef 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &2ef2 a9 c0 LDA #&c0 &2ef4 85 01 STA &01 ; y &2ef6 a2 3c LDX #&3c ; x &2ef8 20 77 25 JSR &2577 ; plot_sprite_in_slot_zero_adjusting_position # Unplot it from the screen &2efb a9 05 LDA #&05 # Gain 5 score and 10 energy for depositing crystal &2efd 4c 07 30 JMP &3007 ; gain_A_score_and_ten_energy ; consider_star_port_actions &2f00 ae fe 07 LDX &07fe ; star_port_destroyed # If the Star Port hasn't been destroyed, &2f03 d0 7b BNE &2f80 ; leave &2f05 c9 b7 CMP #&b7 ; Star Port (world side) # Is the player on the world side of Star Port? &2f07 d0 78 BNE &2f81 ; not_world_side_of_star_port &2f09 a9 24 LDA #&24 ; DRAGON_FIGURINE # Is the player carrying the DRAGON_FIGURINE? &2f0b aa TAX # (keep it if they are) &2f0c 20 32 40 JSR &4032 ; check_if_player_has_object_A_and_change_it_into_X &2f0f 90 74 BCC &2f85 ; teleport_player # If not, consider teleporting the player &2f11 ee fe 07 INC &07fe ; star_port_destroyed &2f14 a0 11 LDY #&11 ; plot_reprogramming_loop # Display "ReProgramming" on screen &2f16 b9 43 09 LDA &0943,Y ; reprogramming_string &2f19 20 ee ff JSR &ffee ; OSWRCH &2f1c 88 DEY &2f1d 10 f7 BPL &2f16 ; plot_reprogramming_loop &2f1f 20 07 41 JSR &4107 ; longer_delay &2f22 a9 00 LDA #&00 &2f24 85 0b STA &0b ; pixels_to_tweak &2f26 85 0c STA &0c ; reprogramming_loops_low &2f28 a9 0a LDA #&0a &2f2a 85 0d STA &0d ; reprogramming_loops_high ; reprogramming_effect_loop &2f2c 20 af 40 JSR &40af ; random_number_generator # Pick a random screen address &2f2f 29 7f AND #&7f &2f31 c9 49 CMP #&49 &2f33 b0 02 BCS &2f37 ; skip_floor &2f35 69 49 ADC #&49 ; skip_floor &2f37 85 3b STA &3b ; screen_address_high &2f39 a4 39 LDY &39 ; rnd_2 &2f3b b1 3a LDA (&3a),Y ; screen_address # and tweak the colour of both pixels there &2f3d 69 11 ADC #&11 &2f3f 91 3a STA (&3a),Y ; screen_address &2f41 c6 0b DEC &0b ; pixels_to_tweak # Repeat for 256 pixels &2f43 d0 e7 BNE &2f2c ; reprogramming_effect_loop &2f45 29 3d AND #&3d &2f47 aa TAX &2f48 a5 38 LDA &38 ; rnd_1 &2f4a 20 33 3f JSR &3f33 ; play_sound_from_x_and_a # Play a random sound &2f4d c6 0c DEC &0c ; reprogramming_loops_low &2f4f d0 db BNE &2f2c ; reprogramming_effect_loop &2f51 c6 0d DEC &0d ; reprogramming_loops_high &2f53 d0 d7 BNE &2f2c ; reprogramming_effect_loop # And repeat the whole process 2560 times &2f55 a2 b7 LDX #&b7 ; Star Port &2f57 20 1d 41 JSR &411d ; plot_room # Replot the room &2f5a a9 fc LDA #&fc &2f5c 85 28 STA &28 ; previous_player_y &2f5e 20 2a 2c JSR &2c2a ; plot_player # Plot (but not unplot) the player &2f61 a0 22 LDY #&22 ; plot_star_port_destroyed_loop # Display "StarPort Destroyed Well Done" &2f63 98 TYA &2f64 29 07 AND #&07 # in different colours &2f66 aa TAX &2f67 bd f8 05 LDA &05f8,X ; text_colour_table &2f6a 85 d2 STA &d2 ; text_colour_byte_or &2f6c 85 d3 STA &d3 ; text_colour_byte_eor &2f6e 20 10 41 JSR &4110 ; brief_delay &2f71 b9 d4 05 LDA &05d4,Y ; star_port_destroyed_string &2f74 20 ee ff JSR &ffee ; OSWRCH &2f77 88 DEY &2f78 10 e9 BPL &2f63 ; plot_star_port_destroyed_loop &2f7a 20 05 30 JSR &3005 ; gain_three_score_and_ten_energy # Gain 3 score and 10 energy for destroying Star Port &2f7d 20 07 41 JSR &4107 ; longer_delay ; leave &2f80 60 RTS ; not_world_side_of_star_port &2f81 c9 19 CMP #&19 ; Star Port (palace side) # Is the player on the palace side of Star Port? &2f83 d0 fb BNE &2f80 ; leave ; teleport_player # For either side, &2f85 a5 37 LDA &37 ; player_room &2f87 49 ae EOR #&ae &2f89 85 0c STA &0c ; destination_room &2f8b a2 04 LDX #&04 ; check_for_crystals_in_sanctuary_loop &2f8d bd f6 07 LDA &07f6,X ; crystals_in_sanctuary &2f90 f0 ee BEQ &2f80 ; leave # If the player hasn't collected all the CRYSTALs, leave &2f92 86 0b STX &0b &2f94 ca DEX &2f95 10 f6 BPL &2f8d ; check_for_crystals_in_sanctuary_loop &2f97 a5 24 LDA &24 ; player_x &2f99 c9 50 CMP #&50 # If the player isn't on the teleport pad, leave &2f9b d0 e3 BNE &2f80 ; leave &2f9d a5 25 LDA &25 ; player_y &2f9f c9 d0 CMP #&d0 &2fa1 b0 dd BCS &2f80 ; leave &2fa3 ad 2d 01 LDA &012d ; room_x # Fix room co-ordinates &2fa6 49 13 EOR #&13 &2fa8 8d 2d 01 STA &012d ; room_x &2fab ad 2e 01 LDA &012e ; room_y &2fae 49 02 EOR #&02 &2fb0 8d 2e 01 STA &012e ; room_y ; teleport_loop # Visual effects for teleporting &2fb3 a9 7f LDA #&7f &2fb5 20 31 3f JSR &3f31 ; play_sound_full_volume_noise &2fb8 a2 45 LDX #&45 &2fba 20 33 3f JSR &3f33 ; play_sound_from_x_and_a &2fbd a5 0b LDA &0b ; teleport_frame &2fbf a0 1f LDY #&1f &2fc1 20 54 3f JSR &3f54 ; play_previous_sound_with_new_pitch &2fc4 a2 52 LDX #&52 &2fc6 a0 90 LDY #&90 &2fc8 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &2fcb a6 0b LDX &0b ; teleport_frame &2fcd a9 07 LDA #&07 ; plot_teleport_beam_outer_loop &2fcf 18 CLC &2fd0 69 10 ADC #&10 &2fd2 85 04 STA &04 ; beam_width &2fd4 a8 TAY ; plot_teleport_beam_inner_loop &2fd5 ca DEX &2fd6 8a TXA &2fd7 91 02 STA (&02),Y ; screen_address &2fd9 88 DEY &2fda d0 f9 BNE &2fd5 ; plot_teleport_beam_inner_loop &2fdc a5 02 LDA &02 ; screen_address_low &2fde 69 78 ADC #&78 &2fe0 85 02 STA &02 ; screen_address_low &2fe2 a5 03 LDA &03 ; screen_address_high &2fe4 69 02 ADC #&02 &2fe6 85 03 STA &03 ; screen_address_high &2fe8 a5 04 LDA &04 ; beam_width &2fea 10 e3 BPL &2fcf ; plot_teleport_beam_outer_loop &2fec a6 0b LDX &0b ; teleport_frame ; teleport_outer_delay_loop &2fee a0 30 LDY #&30 ; teleport_inner_delay_loop &2ff0 88 DEY &2ff1 d0 fd BNE &2ff0 ; teleport_inner_delay_loop &2ff3 e8 INX &2ff4 d0 f8 BNE &2fee ; teleport_outer_delay_loop &2ff6 e6 0b INC &0b ; teleport_frame &2ff8 d0 b9 BNE &2fb3 ; teleport_loop &2ffa 86 2a STX &2a ; player_jump_up_speed &2ffc a9 e0 LDA #&e0 &2ffe 85 25 STA &25 ; player_y &3000 a6 0c LDX &0c ; destination_room &3002 4c b4 2d JMP &2db4 ; change_room_and_leave_to_replot ; gain_three_score_and_ten_energy &3005 a9 03 LDA #&03 ; gain_A_score_and_ten_energy &3007 a2 10 LDX #&10 ; gain_A_score_and_X_energy &3009 18 CLC &300a 65 3f ADC &3f ; player_score_to_be_added &300c 85 3f STA &3f ; player_score_to_be_added &300e 8a TXA ; boost_player_energy &300f f8 SED &3010 18 CLC &3011 65 96 ADC &96 ; player_energy_low &3013 85 96 STA &96 ; player_energy_low &3015 90 44 BCC &305b ; plot_player_energy &3017 e6 97 INC &97 ; player_energy_high &3019 d0 40 BNE &305b ; plot_player_energy ; drain_player_energy &301b 85 00 STA &00 ; drain &301d a9 32 LDA #&32 &301f 20 31 3f JSR &3f31 ; play_sound_full_volume_noise # Play sounds for draining energy &3022 a9 50 LDA #&50 &3024 a2 3d LDX #&3d &3026 20 33 3f JSR &3f33 ; play_sound_from_x_and_a &3029 f8 SED &302a a5 96 LDA &96 ; player_energy_low &302c 38 SEC &302d e5 00 SBC &00 ; drain &302f 85 96 STA &96 ; player_energy_low &3031 b0 14 BCS &3047 ; player_didn't_die_from_drain &3033 c6 97 DEC &97 ; player_energy_high &3035 10 10 BPL &3047 ; player_didn't_die_from_drain # If the player has run out of energy, &3037 a2 00 LDX #&00 &3039 86 96 STX &96 ; player_energy_low &303b 86 97 STX &97 ; player_energy_high &303d ca DEX &303e 8e 02 40 STX &4002 ; spell_should_end # Stop any spell &3041 a9 50 LDA #&50 &3043 85 42 STA &42 ; player_death_countdown # and start them sinking into the ground &3045 d0 14 BNE &305b ; plot_player_energy ; player_didn't_die_from_drain &3047 38 SEC &3048 26 9a ROL &9a ; pain_level # Draining energy shifts the pain level up by two &304a 26 9a ROL &9a ; pain_level &304c 10 0d BPL &305b ; plot_player_energy # If it reaches eight, set the background to red &304e a9 06 LDA #&06 ; red &3050 20 28 3f JSR &3f28 ; set_background_colour &3053 a9 d0 LDA #&d0 &3055 85 9b STA &9b ; pain_sound &3057 a9 fa LDA #&fa # Tweak the pain level for fixed recovery period &3059 85 9a STA &9a ; pain_level ; plot_player_energy &305b d8 CLD &305c a9 f0 LDA #&f0 ; YY &305e 85 d2 STA &d2 ; text_colour_byte_or &3060 85 d3 STA &d3 ; text_colour_byte_eor &3062 a2 01 LDX #&01 &3064 20 a0 40 JSR &40a0 ; tab_to_x_1 &3067 a5 97 LDA &97 ; player_energy_high &3069 f0 04 BEQ &306f ; skip_hundreds &306b 09 30 ORA #&30 ; "0" &306d d0 02 BNE &3071 ; plot_hundreds ; skip_hundreds &306f a9 20 LDA #&20 ; " " ; plot_hundreds &3071 20 ee ff JSR &ffee ; OSWRCH &3074 a5 96 LDA &96 ; player_energy_low &3076 4a LSR A &3077 4a LSR A &3078 4a LSR A &3079 4a LSR A &307a d0 10 BNE &308c ; zero_tens &307c a9 30 LDA #&30 ; "0" &307e a6 97 LDX &97 ; player_energy_high &3080 d0 0a BNE &308c ; zero_tens &3082 a9 cc LDA #&cc ; MM # Plot energy in magenta if down to single digit &3084 85 d2 STA &d2 ; text_colour_byte_or &3086 85 d3 STA &d3 ; text_colour_byte_eor &3088 a9 20 LDA #&20 ; " " &308a d0 02 BNE &308e ; plot_tens ; zero_tens &308c 09 30 ORA #&30 ; "0" ; plot_tens &308e 20 ee ff JSR &ffee ; OSWRCH &3091 a5 96 LDA &96 ; player_energy_low &3093 29 0f AND #&0f &3095 09 30 ORA #&30 ; "0" &3097 20 ee ff JSR &ffee ; OSWRCH &309a 60 RTS ; plot_object_letter &309b 38 SEC &309c e9 47 SBC #&47 &309e 90 08 BCC &30a8 ; use_space &30a0 c9 09 CMP #&09 &30a2 b0 04 BCS &30a8 ; use_space &30a4 09 40 ORA #&40 ; "@" &30a6 d0 02 BNE &30aa ; to_oswrch ; use_space &30a8 a9 20 LDA #&20 ; " " ; to_oswrch &30aa 4c ee ff JMP &ffee ; OSWRCH ; prepare_sprite_in_slot_zero # X = sprite number &30ad a9 00 LDA #&00 &30af 85 17 STA &17 ; sprite_slot &30b1 85 18 STA &18 ; palette_table_offset &30b3 85 19 STA &19 ; last_palette_table_offset &30b5 a9 00 LDA #&00 &30b7 85 0f STA &0f ; flipped_packed_sprite_data_address_low &30b9 a9 04 LDA #&04 ; &0400 = flipped_packed_sprite_data # &0400 is used as a storage area for flipped sprites &30bb 85 10 STA &10 ; flipped_packed_sprite_data_address_high ; prepare_sprite_in_next_slot &30bd a9 55 LDA #&55 &30bf 85 0b STA &0b ; packed_sprite_data_address_low &30c1 a9 09 LDA #&09 ; &0955 = packed_sprite_data &30c3 85 0c STA &0c ; packed_sprite_data_address_high &30c5 a0 00 LDY #&00 # Colour zero is always black &30c7 84 06 STY &06 ; colour_zero_as_pixel_value &30c9 84 12 STY &12 ; where_the_bitmap_data_comes_from # Force the first frame to be considered ; find_sprite_data_loop_with_clear &30cb 18 CLC ; find_sprite_data_loop &30cc b1 0b LDA (&0b),Y ; packed_sprite_data_address # First byte of the header (+0) is the data length &30ce 65 0b ADC &0b ; packed_sprite_data_address_low &30d0 ca DEX &30d1 30 08 BMI &30db ; found_data_for_this_sprite &30d3 85 0b STA &0b ; packed_sprite_data_address_low &30d5 90 f5 BCC &30cc ; find_sprite_data_loop &30d7 e6 0c INC &0c ; packed_sprite_data_address_high &30d9 d0 f0 BNE &30cb ; find_sprite_data_loop_with_clear ; found_data_for_this_sprite &30db 85 11 STA &11 ; end_of_packed_sprite_data_low &30dd a0 01 LDY #&01 &30df b1 0b LDA (&0b),Y ; packed_sprite_data_address # Consider the second byte of the header (+1) &30e1 a8 TAY &30e2 29 0f AND #&0f &30e4 a6 17 LDX &17 ; sprite_slot &30e6 9d 6b 01 STA &016b,X ; sprite_slots_enemy_type # Low nibble determines enemy behaviour &30e9 98 TYA &30ea 29 10 AND #&10 &30ec 9d 5f 01 STA &015f,X ; sprite_slots_unused_flag # Next bit is stored but not used. Only LIFT has this &30ef 98 TYA &30f0 29 80 AND #&80 &30f2 85 0a STA &0a ; sprite_is_painful # Top bit is set if the sprite is painful to the player &30f4 98 TYA &30f5 0a ASL A &30f6 29 c0 AND #&c0 &30f8 85 15 STA &15 ; sprite_is_climbable_or_obstacle # Next two bits are later ORed with palette table values &30fa a0 02 LDY #&02 &30fc b1 0b LDA (&0b),Y ; packed_sprite_data_address # Consider the third byte of the header (+2) &30fe 29 0f AND #&0f &3100 9d 47 01 STA &0147,X ; sprite_slots_animation_type # Low nibble determines sprite animation &3103 b1 0b LDA (&0b),Y ; packed_sprite_data_address &3105 4a LSR A &3106 4a LSR A &3107 4a LSR A &3108 4a LSR A &3109 aa TAX &310a bd d1 40 LDA &40d1,X ; sprite_animation_speed_table # High nibble determine speed of animation &310d a6 17 LDX &17 ; sprite_slot &310f 9d 53 01 STA &0153,X ; sprite_slots_animation_speed &3112 98 TYA ; 2 &3113 20 ea 32 JSR &32ea ; skip_bytes_of_packed_sprite_data # Move past the sprite header ; consider_next_frame &3116 a5 12 LDA &12 ; where_the_bitmap_data_comes_from # Consider the previous frame (0 if this is the first) &3118 c9 03 CMP #&03 ; clone bitmap &311a f0 06 BEQ &3122 ; leave # If it cloned another sprite, then finish &311c a5 11 LDA &11 ; end_of_packed_sprite_data_low &311e c5 0b CMP &0b ; packed_sprite_data_address_low # If this is the end of the sprite, then finish &3120 d0 01 BNE &3123 ; process_sprite_frame # Otherwise, consider the next frame ; leave &3122 60 RTS ; process_sprite_frame &3123 a6 17 LDX &17 ; sprite_slot &3125 a0 00 LDY #&00 &3127 b1 0b LDA (&0b),Y ; packed_sprite_data_address # Consider the first byte of the frame (+0) &3129 a8 TAY &312a 29 03 AND #&03 &312c 85 13 STA &13 ; number_of_blocks_in_sprite # Lowest two bits are number of blocks - 1 &312e 9d 2f 01 STA &012f,X ; sprite_slots_height_in_blocks # Sprite height is thus (low_two_bits + 1) * 4 pixels &3131 98 TYA &3132 4a LSR A &3133 4a LSR A &3134 a8 TAY &3135 29 07 AND #&07 # Next three bits are colour one &3137 85 07 STA &07 ; colour_one_as_number &3139 98 TYA &313a 4a LSR A &313b 4a LSR A &313c 4a LSR A # Highest three bits are colour two &313d 85 08 STA &08 ; colour_two_as_number &313f a5 0a LDA &0a ; sprite_is_painful &3141 9d 3b 01 STA &013b,X ; sprite_slots_painfulness &3144 a0 01 LDY #&01 &3146 84 00 STY &00 ; bytes_to_skip &3148 b1 0b LDA (&0b),Y ; packed_sprite_data_address # Consider the second byte of the frame (+1) &314a d0 0e BNE &315a ; sprite_isn't_tall &314c a5 13 LDA &13 ; number_of_blocks_in_sprite # If this is zero, sprite is tall &314e 09 04 ORA #&04 # (+4 blocks, +16 pixels) &3150 85 13 STA &13 ; number_of_blocks_in_sprite &3152 9d 2f 01 STA &012f,X ; sprite_slots_height_in_blocks &3155 c8 INY &3156 84 00 STY &00 ; bytes_to_skip &3158 b1 0b LDA (&0b),Y ; packed_sprite_data_address # Use the next byte in its place ; sprite_isn't_tall &315a a8 TAY &315b 29 03 AND #&03 # Lowest three bits &315d 85 12 STA &12 ; where_the_bitmap_data_comes_from &315f 98 TYA &3160 4a LSR A &3161 4a LSR A &3162 a8 TAY &3163 29 07 AND #&07 # Next three bits are colour three &3165 85 09 STA &09 ; colour_three_as_number &3167 9d 8f 01 STA &018f,X ; sprite_slots_type &316a 98 TYA &316b 4a LSR A &316c 4a LSR A &316d 4a LSR A &316e aa TAX &316f e8 INX # Highest three bits are sprite width in bytes - 1 &3170 86 14 STX &14 ; sprite_width_in_bytes # Sprite width is thus (high_three_bits + 1) * 2 pixels &3172 a5 00 LDA &00 ; bytes_to_skip &3174 20 ea 32 JSR &32ea ; skip_bytes_of_packed_sprite_data # Move past the frame header &3177 a5 07 LDA &07 ; colour_one_as_number &3179 d0 04 BNE &317f ; build_palette_table # If colour one is black, and colour two isn't black &317b a5 08 LDA &08 ; colour_two_as_number &317d d0 77 BNE &31f6 ; finished_building_palette_table # then use previous palette table ; build_palette_table &317f a5 19 LDA &19 ; last_palette_table_offset &3181 85 18 STA &18 ; palette_table_offset &3183 a6 07 LDX &07 ; colour_one_as_number &3185 bd c1 40 LDA &40c1,X ; colours_as_pixel_values_table &3188 85 07 STA &07 ; colour_one_as_pixel_value &318a a6 08 LDX &08 ; colour_two_as_number &318c bd c1 40 LDA &40c1,X ; colours_as_pixel_values_table &318f 85 08 STA &08 ; colour_two_as_pixel_value &3191 a6 09 LDX &09 ; colour_three_as_number # If colour three is black, this is a two colour sprite &3193 f0 37 BEQ &31cc ; only_two_colours &3195 bd c1 40 LDA &40c1,X ; colours_as_pixel_values_table # Otherwise, it is a four colour sprite &3198 85 09 STA &09 ; colour_three_as_pixel_value &319a a5 18 LDA &18 ; palette_table_offset &319c 8d b9 31 STA &31b9 ; write_palette_table_address_low # Self-modifying code &319f a9 0f LDA #&0f &31a1 85 00 STA &00 ; offset # Construct 16 byte palette table: &31a3 a9 03 LDA #&03 # 00, 01, 02, 03, 10, 11, 12, 13 &31a5 85 01 STA &01 ; left_colour # 20, 21, 22, 23, 30, 31, 32, 33 ; four_colour_palette_table_left_loop &31a7 a6 01 LDX &01 ; left_colour &31a9 b5 06 LDA &06,X ; colours_as_pixel_values &31ab 0a ASL A &31ac 85 02 STA &02 ; left_pixel &31ae a2 03 LDX #&03 ; four_colour_palette_table_right_loop &31b0 a5 02 LDA &02 ; left_pixel &31b2 15 06 ORA &06,X ; colours_as_pixel_values &31b4 05 15 ORA &15 ; sprite_is_climbable_or_obstacle # All pixel pairs have climbable / obstacle state &31b6 a4 00 LDY &00 ; offset ; write_palette_table &31b8 99 00 05 STA &0500,Y ; palette_table # actually STA (&0500 + palette_table_offset),Y &31bb c6 00 DEC &00 ; offset &31bd ca DEX &31be 10 f0 BPL &31b0 ; four_colour_palette_table_right_loop &31c0 c6 01 DEC &01 ; left_colour &31c2 10 e3 BPL &31a7 ; four_colour_palette_table_left_loop &31c4 a5 18 LDA &18 ; palette_table_offset &31c6 69 10 ADC #&10 &31c8 85 19 STA &19 ; last_palette_table_offset &31ca d0 2a BNE &31f6 ; finished_building_palette_table ; only_two_colours &31cc a4 18 LDY &18 ; palette_table_offset # Construct 4 byte palette table: &31ce a5 07 LDA &07 ; colour_one_as_pixel # 11, 12, 21, 22 &31d0 0a ASL A &31d1 05 15 ORA &15 ; sprite_is_climbable_or_obstacle # All pixel pairs have climbable / obstacle state &31d3 aa TAX &31d4 05 07 ORA &07 ; colour_one_as_pixel &31d6 99 00 05 STA &0500,Y ; palette_table &31d9 c8 INY &31da 8a TXA &31db 05 08 ORA &08 ; colour_two_as_pixel &31dd 99 00 05 STA &0500,Y ; palette_table &31e0 c8 INY &31e1 a5 08 LDA &08 ; colour_two_as_pixel &31e3 0a ASL A &31e4 05 15 ORA &15 ; sprite_is_climbable_or_obstacle &31e6 aa TAX &31e7 05 07 ORA &07 ; colour_one_as_pixel &31e9 99 00 05 STA &0500,Y ; palette_table &31ec c8 INY &31ed 8a TXA &31ee 05 08 ORA &08 ; colour_two_as_pixel &31f0 99 00 05 STA &0500,Y ; palette_table &31f3 c8 INY &31f4 84 19 STY &19 ; last_palette_table_offset ; finished_building_palette_table &31f6 a4 17 LDY &17 ; sprite_slot &31f8 a5 18 LDA &18 ; palette_table_offset &31fa 99 83 01 STA &0183,Y ; sprite_slots_palette_start # Note the start of the palette table for this slot &31fd a5 14 LDA &14 ; sprite_width_in_bytes # Calculate the on-screen offset of the last byte &31ff 0a ASL A &3200 0a ASL A &3201 0a ASL A &3202 e9 04 SBC #&04 &3204 99 77 01 STA &0177,Y ; sprite_slots_offset_of_last_byte &3207 a5 12 LDA &12 ; where_the_bitmap_data_comes_from # Consider the value from the current frame &3209 f0 23 BEQ &322e ; use_previous_bitmap_data # 0 = use previous bitmap data &320b 4a LSR A &320c d0 2e BNE &323c ; clone_or_flip_bitmap_data ; block_has_bitmap_data # 1 = block has new bitmap data &320e a5 0b LDA &0b ; packed_sprite_data_address_low &3210 85 0d STA &0d ; previous_packed_sprite_data_address_low &3212 a5 0c LDA &0c ; packed_sprite_data_address_high &3214 85 0e STA &0e ; previous_packed_sprite_data_address_high &3216 18 CLC &3217 a5 14 LDA &14 ; sprite_width_in_bytes # Calculate the number of bytes the bitmap data uses &3219 a6 09 LDX &09 ; colour_three_as_pixel &321b f0 01 BEQ &321e ; two_colour_sprite &321d 0a ASL A # Twice as many for four colour sprites ; two_colour_sprite &321e a6 13 LDX &13 ; number_of_blocks_in_sprite &3220 f0 07 BEQ &3229 ; skip_multiplication &3222 85 00 STA &00 ; tmp ; multiplication_loop &3224 65 00 ADC &00 ; tmp # number_of_blocks_in_sprite * sprite_width_in_bytes &3226 ca DEX &3227 d0 fb BNE &3224 ; multiplication_loop ; skip_multiplication &3229 e9 00 SBC #&00 &322b 20 ea 32 JSR &32ea ; skip_bytes_of_packed_sprite_data # Move past the bitmap data ; use_previous_bitmap_data &322e a4 17 LDY &17 ; sprite_slot &3230 a5 0d LDA &0d ; previous_packed_sprite_data_address_low &3232 99 9b 01 STA &019b,Y ; sprite_slots_data_low # Note where the bitmap data is for this slot &3235 a5 0e LDA &0e ; previous_packed_sprite_data_address_high &3237 99 a7 01 STA &01a7,Y ; sprite_slots_data_high &323a d0 5b BNE &3297 ; move_to_next_sprite_slot # Then move onto the next slot ; clone_or_flip_bitmap_data &323c b0 5e BCS &329c ; backtrack_bytes_of_packed_sprite_data # 3 = use bitmap data from another sprite &323e a5 13 LDA &13 ; number_of_blocks_in_sprite # 2 = flip previous bitmap data horizontally &3240 85 00 STA &00 ; blocks_remaining &3242 a5 0d LDA &0d ; previous_packed_sprite_data_address_low # Self-modifying code &3244 8d 78 32 STA &3278 ; read_byte_of_two_colour_sprite_one_address_low &3247 8d 80 32 STA &3280 ; read_byte_of_two_colour_sprite_two_address_low &324a 8d b2 32 STA &32b2 ; read_byte_of_four_colour_sprite_one_address_low &324d 8d c7 32 STA &32c7 ; read_byte_of_four_colour_sprite_two_address_low &3250 a5 0e LDA &0e ; previous_packed_sprite_data_address_high # Self-modifying code &3252 8d 79 32 STA &3279 ; read_byte_of_two_colour_sprite_one_address_high &3255 8d 81 32 STA &3281 ; read_byte_of_two_colour_sprite_two_address_high &3258 8d b3 32 STA &32b3 ; read_byte_of_four_colour_sprite_one_address_high &325b 8d c8 32 STA &32c8 ; read_byte_of_four_colour_sprite_two_address_high &325e a4 17 LDY &17 ; sprite_slot &3260 a5 0f LDA &0f ; flipped_packed_sprite_data_address_low &3262 85 0d STA &0d ; previous_packed_sprite_data_address_low # Use the flipped data for this slot &3264 99 9b 01 STA &019b,Y ; sprite_slots_data_low &3267 a5 10 LDA &10 ; flipped_packed_sprite_data_address_high &3269 85 0e STA &0e ; previous_packed_sprite_data_address_high &326b 99 a7 01 STA &01a7,Y ; sprite_slots_data_high &326e a2 00 LDX #&00 &3270 a5 09 LDA &09 ; colour_three_as_pixel &3272 d0 37 BNE &32ab ; flip_four_colour_sprite ; flip_two_colour_sprite ; flip_two_colour_sprite_block_loop &3274 a4 14 LDY &14 ; sprite_width_in_bytes &3276 88 DEY ; flip_two_colour_sprite_byte_loop ; read_byte_of_two_colour_sprite_one &3277 bd e7 03 LDA &03e7,X # actually LDA previous_packed_sprite_data_address,X # Get a byte of two colour sprite data &327a 29 55 AND #&55 # Extract the bits corresponding to left pixels &327c 0a ASL A # Convert them to right pixels &327d 85 01 STA &01 ; other_half ; read_byte_of_two_colour_sprite_two &327f bd e7 03 LDA &03e7,X # actually LDA previous_packed_sprite_data_address,X # Get the same byte of two colour sprite data &3282 29 aa AND #&aa # Extract the bits corresponding to right pixels &3284 4a LSR A # Convert them to left pixels &3285 05 01 ORA &01 ; other_half # Merge the two &3287 91 0f STA (&0f),Y ; flipped_packed_sprite_data_address # and store in the flipped data area &3289 e8 INX &328a 88 DEY &328b 10 ea BPL &3277 ; flip_two_colour_sprite_byte_loop &328d a5 0f LDA &0f ; flipped_packed_sprite_data_address_low &328f 65 14 ADC &14 ; sprite_width_in_bytes &3291 85 0f STA &0f ; flipped_packed_sprite_data_address_low &3293 c6 00 DEC &00 ; blocks_remaining &3295 10 dd BPL &3274 ; flip_two_colour_sprite_block_loop ; move_to_next_sprite_slot &3297 e6 17 INC &17 ; sprite_slot &3299 4c 16 31 JMP &3116 ; consider_next_frame ; backtrack_bytes_of_packed_sprite_data &329c a0 00 LDY #&00 &329e a5 0b LDA &0b ; packed_sprite_data_address_low &32a0 f1 0b SBC (&0b),Y ; packed_sprite_data_address &32a2 85 0b STA &0b ; packed_sprite_data_address_low &32a4 b0 02 BCS &32a8 &32a6 c6 0c DEC &0c ; packed_sprite_data_address_high &32a8 4c 0e 32 JMP &320e ; block_has_bitmap_data ; flip_four_colour_sprite ; flip_four_colour_sprite_block_loop &32ab a5 14 LDA &14 ; sprite_width_in_bytes &32ad 0a ASL A &32ae a8 TAY ; flip_four_colour_sprite_byte_loop &32af 88 DEY &32b0 88 DEY ; read_byte_of_four_colour_sprite_one &32b1 bd e7 03 LDA &03e7,X # actually LDA previous_packed_sprite_data_address,X # Get a byte of four colour sprite data &32b4 48 PHA # (store it on the stack rather than read it twice) &32b5 29 33 AND #&33 # Extract the bits corresponding to left pixels &32b7 0a ASL A # Convert them to right pixels &32b8 0a ASL A &32b9 85 01 STA &01 ; other_half &32bb 68 PLA # Get the same byte of sprite data from the stack &32bc 29 cc AND #&cc # Extract the bits corresponding to right pixels &32be 4a LSR A # Convert them to left pixels &32bf 4a LSR A &32c0 05 01 ORA &01 ; other_half &32c2 91 0f STA (&0f),Y ; flipped_packed_sprite_data_address # and store in the flipped data area &32c4 e8 INX &32c5 c8 INY ; read_byte_of_four_colour_sprite_two # Repeat the same process for a second byte of data &32c6 bd e7 03 LDA &03e7,X # actually LDA previous_packed_sprite_data_address,X &32c9 48 PHA &32ca 29 33 AND #&33 &32cc 0a ASL A &32cd 0a ASL A &32ce 85 01 STA &01A ; other_half &32d0 68 PLA &32d1 29 cc AND #&cc &32d3 4a LSR A &32d4 4a LSR A &32d5 05 01 ORA &01 ; other_half &32d7 91 0f STA (&0f),Y ; flipped_packed_sprite_data_address &32d9 e8 INX &32da 88 DEY &32db d0 d2 BNE &32af ; flip_four_colour_sprite_byte_loop &32dd a5 14 LDA &14 ; sprite_width_in_bytes &32df 0a ASL A &32e0 65 0f ADC &0f ; flipped_packed_sprite_data_address_low &32e2 85 0f STA &0f ; flipped_packed_sprite_data_address_low &32e4 c6 00 DEC &00 ; blocks_remaining &32e6 10 c3 BPL &32ab ; flip_four_colour_sprite_block_loop &32e8 30 ad BMI &3297 ; move_to_next_sprite_slot ; skip_bytes_of_packed_sprite_data &32ea 38 SEC # Skip the current byte too &32eb 65 0b ADC &0b ; packed_sprite_data_address_low &32ed 85 0b STA &0b ; packed_sprite_data_address_low &32ef 90 02 BCC &32f3 &32f1 e6 0c INC &0c ; packed_sprite_data_address_high &32f3 60 RTS ; plot_sprites_from_room_data &32f4 85 20 STA &20 ; number_of_lines_remaining &32f6 a9 00 LDA #&00 &32f8 85 23 STA &23 ; start_count ; consider_next_byte &32fa 20 7f 40 JSR &407f ; split_byte_of_room_data # Get a byte of room data &32fd 98 TYA &32fe f0 1e BEQ &331e ; set_offsets_and_sprite # If high nibble == &0, set offsets and sprite &3300 c9 40 CMP #&40 &3302 b0 3e BCS &3342 ; plot_line_of_sprites # If high nibble >= &4, start plotting &3304 c9 30 CMP #&30 &3306 d0 09 BNE &3311 ; set_tiling_direction_and_count # If high nibble == &3, low nibble sets frame to use &3308 a5 04 LDA &04 ; low_nibble_of_first_byte &330a 29 0f AND #&0f &330c 8d 4f 33 STA &334f ; sprite_frame_to_use &330f 10 e9 BPL &32fa ; consider_next_byte ; set_tiling_direction_and_count # If high nibble == &1 or &2, set tiling direction &3311 29 20 AND #&20 # (&1 = horizontally, &2 = vertically) &3313 8d 59 33 STA &3359 ; direction_to_tile_sprites &3316 a5 04 LDA &04 ; low_nibble_of_first_byte # and low nibble sets number of sprites to plot &3318 29 0f AND #&0f &331a 85 23 STA &23 ; number_of_sprites_to_plot &331c 10 dc BPL &32fa ; consider_next_byte ; set_offsets_and_sprite # If high nibble == &0, low nibble sets x and y offsets &331e a5 04 LDA &04 ; low_bits_of_byte &3320 85 21 STA &21 ; copy_of_low_bits_of_byte &3322 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a second byte for the sprite &3325 29 01 AND #&01 &3327 8d 4f 33 STA &334f ; sprite_frame_to_use # Lowest bit is which frame to use &332a 98 TYA &332b 4a LSR A &332c aa TAX # Remaining bits are which sprite to use &332d 20 84 33 JSR &3384 ; change_room_sprite_depending_on_game_state &3330 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &3333 a5 21 LDA &21 ; copy_of_low_bits_of_byte &3335 29 03 AND #&03 &3337 0a ASL A &3338 85 0b STA &0b ; x_offset # x_offset = lowest_two_bits * 2 &333a a5 21 LDA &21 ; copy_of_low_bits_of_byte &333c 29 0c AND #&0c &333e 85 0c STA &0c ; y_offset # y_offset = next_two_bits &3340 10 b8 BPL &32fa ; consider_next_byte ; plot_line_of_sprites &3342 a4 23 LDY &23 ; number_of_sprites_to_plot &3344 84 21 STY &21 ; count &3346 65 0c ADC &0c ; y_offset &3348 85 01 STA &01 ; y &334a 8a TXA &334b 65 0b ADC &0b ; x_offset ; plot_line_of_sprites_loop &334d aa TAX ; x &334e a0 00 LDY #&00 # actually LDY sprite_frame_to_use &3350 20 92 25 JSR &2592 ; plot_sprite_in_slot_Y &3353 c6 21 DEC &21 ; count &3355 30 25 BMI &337c ; continue_to_next_line &3357 18 CLC &3358 a9 00 LDA #&00 # actually LDA direction_to_tile_sprites &335a d0 0f BNE &336b ; tile_vertically ; tile_horizontally &335c ac 4f 33 LDY &334f ; sprite_frame_to_use &335f b9 77 01 LDA &0177,Y ; sprite_slots_offset_of_last_byte &3362 4a LSR A &3363 4a LSR A &3364 18 CLC &3365 69 02 ADC #&02 &3367 65 00 ADC &00 ; x &3369 d0 e2 BNE &334d ; plot_line_of_sprites_loop ; tile_vertically &336b a0 00 LDY #&00 &336d b9 2f 01 LDA &012f,Y ; sprite_slots_height_in_blocks &3370 69 01 ADC #&01 &3372 0a ASL A &3373 0a ASL A &3374 65 01 ADC &01 ; y &3376 85 01 STA &01 ; y &3378 a5 00 LDA &00 ; x &337a d0 d1 BNE &334d ; plot_line_of_sprites_loop ; continue_to_next_line &337c c6 20 DEC &20 ; number_of_lines_remaining &337e f0 03 BEQ &3383 ; leave &3380 4c fa 32 JMP &32fa ; consider_next_byte ; leave &3383 60 RTS ; change_room_sprite_depending_on_game_state &3384 e0 0c CPX #&0c : WATER_SURFACE &3386 d0 22 BNE &33aa ; not_water &3388 a5 37 LDA &37 ; player_room &338a c9 ad CMP #&ad ; The Well # If the player is in The Well, &338c d0 12 BNE &33a0 ; not_well_water &338e ad f5 07 LDA &07f5 ; well_wheel_switch_state &3391 f0 0d BEQ &33a0 ; not_well_water # and the Well Wheel switch has been switched, &3393 20 98 40 JSR &4098 ; get_byte_of_room_data # Skip two bytes of room data corresponding to &3396 20 98 40 JSR &4098 ; get_byte_of_room_data # plotting the line of WATER_SURFACE sprites &3399 68 PLA # Leave plot_sprites_from_room_data on return &339a 68 PLA &339b a9 01 LDA #&01 # Room has ropes, but no enemies &339d 85 53 STA &53 ; room_flags ; leave &339f 60 RTS ; not_room_ad &33a0 ad 82 03 LDA &0382 ; object_room_table + 2 # Where is the ICE_CRYSTAL? &33a3 f0 04 BEQ &33a9 ; player_is_carrying_ice_crystal # If the player is carrying it, &33a5 c5 37 CMP &37 ; player_room &33a7 d0 01 BNE &33aa ; not_water # or it is in the same room as the player, ; player_is_carrying_ice_crystal &33a9 e8 INX ; FROZEN_WATER_SURFACE # freeze the water ; not_water &33aa e0 0f CPX #&0f ; SWITCH &33ac d0 35 BNE &33e3 ; not_switch &33ae a5 37 LDA &37 ; player_room &33b0 c9 48 CMP #&48 ; right of Central Tower &33b2 d0 0b BNE &33bf ; not_central_tower_switch &33b4 a2 50 LDX #&50 # Set Central Tower switch depending on state &33b6 a0 e0 LDY #&e0 &33b8 ad f4 07 LDA &07f4 ; central_tower_switch_state &33bb f0 1e BEQ &33db ; set_switch_coordinates &33bd d0 19 BNE &33d8 ; set_switch_coordinates_and_switch_state ; not_central_tower_switch &33bf c9 71 CMP #&71 ; The Well Wheel &33c1 d0 0b BNE &33ce ; not_well_wheel_switch &33c3 a2 32 LDX #&32 # Set The Well Wheel switch depending on state &33c5 a0 70 LDY #&70 &33c7 ad f5 07 LDA &07f5 ; well_wheel_switch_state &33ca f0 0f BEQ &33db ; set_switch_coordinates &33cc d0 0a BNE &33d8 ; set_switch_coordinates_and_switch_state ; not_well_wheel_switch &33ce c9 80 CMP #&80 ; West Wing &33d0 d0 0f BNE &33e1 ; not_west_wing_switch &33d2 a2 0a LDX #&0a # The West Wing switch is always initially off &33d4 a0 d0 LDY #&d0 &33d6 d0 03 BNE &33db ; set_switch_coordinates ; set_switch_coordinates_and_switch_state &33d8 ee 4f 33 INC &334f ; sprite_frame_to_use # Use frame 1 when SWITCH is switched ; set_switch_coordinates &33db 8e 04 2d STX &2d04 ; switch_x # Self-modifying code &33de 8c 0a 2d STY &2d0a ; switch_y # Self-modifying code ; not_west_wing_switch &33e1 a2 0f LDX #&0f ; SWITCH ; not_switch &33e3 e0 05 CPX #&05 &33e5 b0 05 BCS &33ec ; not_crystal &33e7 bd f6 07 LDA &07f6,X ; crystals_in_sanctuary # If a CRYSTAL hasn't been collected, &33ea f0 17 BEQ &3403 ; use_block_black # don't plot it in The Sanctuary ; not_crystal &33ec e0 25 CPX #&25 ; TOP_OF_ROPE &33ee d0 06 BNE &33f6 &33f0 a5 37 LDA &37 ; player_room &33f2 c9 19 CMP #&19 ; Star Port (palace side) # The palace Star Port doesn't have a rope &33f4 f0 0d BEQ &3403 ; use_block_black ; &33f6 ad fe 07 LDA &07fe ; star_port_destroyed &33f9 f0 0a BEQ &3405 ; keep_sprite &33fb e0 26 CPX #&26 ; SPARK # The destroyed Star Port doesn't have spark or antenna &33fd f0 04 BEQ &3403 ; use_block_black &33ff e0 10 CPX #&10 ; ANTENNA &3401 d0 02 BNE &3405 ; keep_sprite ; use_block_black &3403 a2 1a LDX #&1a ; BLOCK_BLACK ; use_block_black &3405 e0 58 CPX #&58 ; BRICKS_RYM &3407 d0 96 BNE &339f ; leave &3409 ad fb 07 LDA &07fb ; cannon_fired # If the cannon in The lab has been fired, &340c 10 91 BPL &339f ; leave # change position of first BRICKS_RYM sprite &340e 68 PLA # Leave plot_sprites_from_room_data on return &340f 68 PLA &3410 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &3413 20 98 40 JSR &4098 ; get_byte_of_room_data # Skip byte corresponding to original position &3416 a9 00 LDA #&00 # Set up sprite using these values instead, &3418 85 0b STA &0b ; x_offset &341a 85 0c STA &0c ; y_offset &341c a2 30 LDX #&30 ; x # moving it right and down &341e a9 d0 LDA #&d0 ; y &3420 4c 42 33 JMP &3342 ; plot_line_of_sprites # then jump later into plotting routine ; initialise_room_from_room_data # X = room number &3423 a9 a0 LDA #&a0 &3425 85 1d STA &1d ; room_data_address_low &3427 a9 13 LDA #&13 ; &13a0 = room_data &3429 85 1e STA &1e ; room_data_address_high &342b a0 00 LDY #&00 &342d 18 CLC &342e 8a TXA &342f f0 0e BEQ &343f ; found_room ; search_for_room_loop &3431 b1 1d LDA (&1d),Y ; room_data_address # One byte for room data length &3433 65 1d ADC &1d ; room_data_address_low &3435 85 1d STA &1d ; room_data_address_low &3437 90 03 BCC &343c &3439 e6 1e INC &1e ; room_data_address_high &343b 18 CLC &343c ca DEX &343d d0 f2 BNE &3431 ; search_for_room_loop ; found_room &343f b1 1d LDA (&1d),Y ; room_data_address # If the length is two, &3441 c9 02 CMP #&02 &3443 d0 06 BNE &344b ; room_isn't_a_copy_of_another &3445 c8 INY &3446 b1 1d LDA (&1d),Y ; room_data_address # then the next byte is the room number to use &3448 aa TAX &3449 d0 d8 BNE &3423 ; initialise_room_from_room_data ; room_isn't_a_copy_of_another &344b b0 04 BCS &3451 ; found_actual_room # If the length is one, use room &00 (empty stars) &344d a2 00 LDX #&00 &344f f0 d2 BEQ &3423 ; initialise_room_from_room_data ; found_actual_room &3451 a5 37 LDA &37 ; player_room &3453 18 CLC &3454 6d 2e 01 ADC &012e ; room_y &3457 29 07 AND #&07 &3459 aa TAX &345a bd f8 05 LDA &05f8,X ; text_colour_table &345d 85 d2 STA &d2 ; text_colour_byte_or # Colour depends on room location &345f 85 d3 STA &d3 ; text_colour_byte_eor &3461 a2 00 LDX #&00 &3463 a0 00 LDY #&00 &3465 20 a2 40 JSR &40a2 ; tab_to_x_y # TAB(&00, &00) &3468 a9 20 LDA #&20 ; " " &346a a2 10 LDX #&10 ; wipe_room_title_loop # Clear the previous room title &346c 20 ee ff JSR &ffee ; OSWRCH &346f ca DEX &3470 10 fa BPL &346c ; wipe_room_title_loop &3472 c8 INY ; 1 &3473 84 1f STY &1f ; room_data_offset &3475 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte to determine room title &3478 30 0c BMI &3486 ; copy_room_title_from_room_titles # If top bit set, use table of room titles ; copy_room_title_from_room_data # if not set, use further bytes from room data &347a e8 INX &347b 48 PHA &347c a8 TAY &347d 30 2f BMI &34ae ; plot_room_title # Title ends with byte with top bit set &347f 20 98 40 JSR &4098 ; get_byte_of_room_data &3482 f0 1a BEQ &349e ; prepend_room_title_with_The # or zero byte to prefix with The &3484 d0 f4 BNE &347a ; copy_room_title_from_room_data ; copy_room_title_from_room_titles # Low seven bits are number of title &3486 29 7f AND #&7f &3488 aa TAX &3489 a0 ff LDY #&ff ; search_for_room_title &348b c8 INY &348c b9 00 24 LDA &2400,Y ; room_titles &348f 10 fa BPL &348b ; search_for_room_title &3491 ca DEX &3492 10 f7 BPL &348b ; search_for_room_title ; copy_room_title_from_room_titles_loop &3494 48 PHA &3495 e8 INX &3496 c8 INY &3497 b9 00 24 LDA &2400,Y ; room_titles &349a 30 12 BMI &34ae ; plot_room_title # Title ends with byte with top bit set &349c d0 f6 BNE &3494 ; copy_room_title_from_room_titles_loop # or zero byte to prefix with The ; prepend_room_title_with_The &349e a9 20 LDA #&20 ; " " &34a0 48 PHA &34a1 a9 65 LDA #&65 ; "e" &34a3 48 PHA &34a4 a9 68 LDA #&68 ; "h" &34a6 48 PHA &34a7 a9 54 LDA #&54 ; "T" &34a9 48 PHA &34aa e8 INX &34ab e8 INX &34ac e8 INX &34ad e8 INX ; plot_room_title &34ae 86 00 STX &00 ; title_length &34b0 8a TXA &34b1 4a LSR A &34b2 38 SEC &34b3 e9 09 SBC #&09 &34b5 49 ff EOR #&ff &34b7 aa TAX &34b8 a0 00 LDY #&00 # TAB(8 - (title_length / 2), &00); &34ba 20 a2 40 JSR &40a2 ; tab_to_x_y &34bd a6 00 LDX &00 ; title_length ; plot_room_title_loop # Plot room title &34bf 68 PLA &34c0 29 7f AND #&7f &34c2 20 ee ff JSR &ffee ; OSWRCH &34c5 ca DEX &34c6 10 f7 BPL &34bf ; plot_room_title_loop &34c8 a2 09 LDX #&09 # TAB(&09, &01); &34ca 20 a0 40 JSR &40a0 ; tab_to_x_1 &34cd a2 d3 LDX #&d3 ; GC &34cf ad 2d 01 LDA &012d ; room_x &34d2 10 0a BPL &34de ; set_text_colour_for_x &34d4 f8 SED &34d5 a9 00 LDA #&00 &34d7 38 SEC &34d8 ed 2d 01 SBC &012d ; room_x &34db d8 CLD &34dc a2 dc LDX #&dc ; RM ; set_text_colour_for_x &34de 86 d2 STX &d2 ; text_colour_byte_or &34e0 86 d3 STX &d3 ; text_colour_byte_eor &34e2 a8 TAY &34e3 29 0f AND #&0f &34e5 09 30 ORA #&30 ; "0" &34e7 aa TAX &34e8 98 TYA &34e9 29 f0 AND #&f0 &34eb 4a LSR A &34ec 4a LSR A &34ed 4a LSR A &34ee 4a LSR A &34ef f0 02 BEQ &34f3 ; leading_zero &34f1 09 10 ORA #&10 ; "0" - " " ; leading_zero &34f3 09 20 ORA #&20 ; " " &34f5 a0 09 LDY #&09 ; cursor right &34f7 20 a4 40 JSR &40a4 ; plot_a_x_y_characters # Plot room x position &34fa a2 d3 LDX #&d3 ; GC &34fc ad 2e 01 LDA &012e ; room_y &34ff 10 07 BPL &3508 ; set_text_colour_for_y &3501 49 ff EOR #&ff &3503 18 CLC &3504 69 01 ADC #&01 &3506 a2 dc LDX #&dc ; RM ; set_text_colour_for_y &3508 86 d2 STX &d2 ; text_colour_byte_or &350a 86 d3 STX &d3 ; text_colour_byte_eor &350c 09 30 ORA #&30 ; "0" &350e 20 ee ff JSR &ffee ; OSWRCH # Plot room y position ; initialise_room_variables &3511 a2 ff LDX #&ff &3513 86 36 STX &36 ; number_of_enemies_in_room &3515 86 2d STX &2d ; object_in_room &3517 86 49 STX &49 ; water_minimum_y &3519 e8 INX ; 0 &351a 86 47 STX &47 ; spell_y &351c 8e 02 40 STX &4002 ; spell_should_end &351f 8e 27 01 STX &0127 ; energy_x &3522 a9 d2 LDA #&d2 # Off-screen &3524 85 2b STA &2b ; object_x &3526 8d 29 01 STA &0129 ; door_x &3529 8d 04 2d STA &2d04 ; switch_x &352c 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte for the background sprite &352f aa TAX &3530 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &3533 a9 91 LDA #&91 ; STA &3535 20 4b 25 JSR &254b ; set_plot_mode &3538 ad 77 01 LDA &0177 ; sprite_slots_offset_of_last_byte &353b 09 04 ORA #&04 &353d 85 0b STA &0b ; sprite_offset_of_last_byte &353f a9 48 LDA #&48 &3541 85 01 STA &01 ; y &3543 a2 00 LDX #&00 ; x &3545 20 90 25 JSR &2590 ; plot_sprite_in_slot_zero # Plot that sprite once in top left corner of room &3548 20 08 25 JSR &2508 ; calculate_screen_address &354b a5 02 LDA &02 ; screen_address_low &354d 85 04 STA &04 ; vertical_source_address_low &354f a5 03 LDA &03 ; screen_address_high &3551 85 05 STA &05 ; vertical_source_address_high &3553 ae 2f 01 LDX &012f ; sprite_slots_height_in_blocks &3556 a5 01 LDA &01 ; y # Move down by height of sprite ; move_down_for_blocks_loop &3558 69 04 ADC #&04 &355a ca DEX &355b 10 fb BPL &3558 ; move_down_for_blocks_loop &355d 85 01 STA &01 ; y &355f 20 08 25 JSR &2508 ; calculate_screen_address ; vertical_copy_loop # Make a copy of the sprite below itself &3562 a4 0b LDY &0b ; sprite_offset_of_last_byte ; vertical_source_copy_loop &3564 b1 04 LDA (&04),Y ; vertical_source_address &3566 91 02 STA (&02),Y ; screen_address &3568 88 DEY &3569 10 f9 BPL &3564 ; vertical_source_copy_loop &356b a5 04 LDA &04 ; vertical_source_address_low &356d 85 06 STA &06 ; horizontal_source_address_low &356f a5 05 LDA &05 ; vertical_source_address_high &3571 85 07 STA &07 ; horizontal_source_address_high &3573 a9 00 LDA #&00 &3575 85 08 STA &08 ; copied_width ; horizontal_copy_loop &3577 a5 04 LDA &04 ; vertical_source_address_low # Actually horizontal target by this stage &3579 38 SEC &357a 65 0b ADC &0b ; sprite_offset_of_last_byte &357c 85 04 STA &04 ; vertical_source_address_low &357e 90 03 BCC &3583 &3580 e6 05 INC &05 ; vertical_source_address_high &3582 18 CLC &3583 a5 08 LDA &08 ; copied_width &3585 65 14 ADC &14 ; sprite_width_in_bytes &3587 85 08 STA &08 ; copied_width &3589 c9 50 CMP #&50 &358b b0 0b BCS &3598 ; reached_right_of_screen &358d a4 0b LDY &0b ; sprite_offset_of_last_byte ; horizontal_source_copy_loop # Make a copy of the sprite to its right &358f b1 06 LDA (&06),Y ; horizontal_source_address &3591 91 04 STA (&04),Y ; vertical_source_address &3593 88 DEY &3594 10 f9 BPL &358f ; horizontal_source_copy_loop &3596 30 df BMI &3577 ; horizontal_copy_loop # Repeat until this reaches the right of the screen ; reached_right_of_screen &3598 a5 02 LDA &02 ; screen_address_low &359a 69 7f ADC #&7f &359c 85 02 STA &02 ; screen_address_low &359e a5 03 LDA &03 ; screen_address_high &35a0 69 02 ADC #&02 &35a2 85 03 STA &03 ; screen_address_high &35a4 a5 05 LDA &05 ; vertical_source_address_high &35a6 10 ba BPL &3562 ; vertical_copy_loop # Continue until this reaches the bottom of the screen ; get_room_flags &35a8 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte for what the room contains &35ab 85 53 STA &53 ; room_flags ; consider_sprites &35ad a9 00 LDA #&00 &35af 85 22 STA &22 ; lines_of_sprites_afterwards &35b1 46 53 LSR &53 ; room_flags # If bit 0 of room_flags is set, room has sprites &35b3 90 0c BCC &35c1 ; room_doesn't_have_sprites &35b5 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte for how many sprites the room contains &35b8 85 22 STA &22 ; lines_of_sprites_afterwards # High nibble is number of sprites plotted later &35ba 29 07 AND #&07 &35bc f0 03 BEQ &35c1 ; room_doesn't_have_sprites # Low nibble is number of sprites plotted now &35be 20 f4 32 JSR &32f4 ; plot_sprites_from_room_data # Plot any sprites before rectangles and triangles ; room_doesn't_have_sprites &35c1 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte for number of rectangles and triangles &35c4 85 21 STA &21 ; number_of_triangles_and_rectangles # Low three bits are number of triangles &35c6 29 f8 AND #&f8 &35c8 4a LSR A &35c9 4a LSR A &35ca 4a LSR A &35cb 85 0f STA &0f ; rectangles_still_to_plot # High five bits are number of rectangles - 1 &35cd a9 91 LDA #&91 ; STA &35cf 8d 6d 36 STA &366d ; rectangle_fill_instruction &35d2 a9 00 LDA #&00 ; set_rectangle_pixel_value &35d4 8d 6c 36 STA &366c ; rectangle_pixel_value ; consider_next_rectangle # For each rectangle, &35d7 20 7f 40 JSR &407f ; split_byte_of_room_data # Get a byte for start position of rectangle &35da 86 00 STX &00 ; x # Low nibble is x &35dc 84 01 STY &01 ; y # High nibble is y &35de 98 TYA &35df d0 68 BNE &3649 ; skip_rectangle_setup &35e1 a6 04 LDX &04 ; low_nibble # If high nibble == &00, low nibble sets plotting mode &35e3 bd f6 40 LDA &40f6,X ; instruction_type_table # 0 = STA, 1 = ORA, 2 = AND, 3 = EOR &35e6 8d 6d 36 STA &366d ; rectangle_fill_instruction &35e9 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte for the pixel value &35ec c9 70 CMP #&70 ; BB &35ee d0 18 BNE &3608 ; not_water # If this is two blue pixels, i.e. water, &35f0 20 98 40 JSR &4098 ; get_byte_of_room_data # Get another byte for top of water &35f3 85 49 STA &49 ; water_minimum_y &35f5 20 7f 40 JSR &407f ; split_byte_of_room_data # And another byte for left and right edges of water &35f8 86 9c STX &9c ; water_minimum_x &35fa 98 TYA &35fb 4a LSR A &35fc 85 04 STA &04 ; tmp &35fe 4a LSR A &35ff 4a LSR A &3600 65 04 ADC &04 ; tmp &3602 69 0a ADC #&0a &3604 85 9d STA &9d ; water_maximum_x &3606 a9 70 LDA #&70 ; BB ; not_water &3608 a6 37 LDX &37 ; player_room &360a c9 09 CMP #&09 ; GR # If the rectangle is a special colour (used only in &360c d0 1e BNE &362c ; not_starport_black # Star Port), then it will actually be black &360e 8a TXA &360f 30 19 BMI &362a ; is_world_side_star_port # but depend on whether it is world or palace side &3611 20 98 40 JSR &4098 ; get_byte_of_room_data # Skip the next rectangle if it is palace side &3614 20 98 40 JSR &4098 ; get_byte_of_room_data # (removing rope opening / jagged left edge) &3617 a0 14 LDY #&14 &3619 e0 05 CPX #&05 ; "Star Port" &361b f0 02 BEQ &361f ; is_star_port_antenna_room &361d a0 00 LDY #&00 ; is_star_port_antenna_room &361f 84 00 STY &00 ; x # and adjust position of this rectangle &3621 a9 d0 LDA #&d0 &3623 85 01 STA &01 ; y &3625 a9 13 LDA #&13 &3627 a8 TAY &3628 d0 22 BNE &364c ; skip_size_setup # then jump straight into plotting it ; is_world_side_star_port &362a a9 00 LDA #&00 # Regardless, use black instead for this rectangle ; not_starport_black &362c c9 cb CMP #&cb ; obstacle_YR &362e d0 07 BNE &3637 ; not_starport_colour # If the rectangle is the yellow/red combination used &3630 ac fe 07 LDY &07fe ; star_port_destroyed # for the Star Port, change it to magenta/blue if the &3633 f0 02 BEQ &3637 ; not_starport_colour # the Star Port has been destroyed &3635 a9 f2 LDA #&f2 ; obstacle_MB ; not_starport_colour &3637 c9 f0 CMP #&f0 ; obstacle_BB # If the rectangle is the blue used for the water in &3639 d0 0b BNE &3646 ; to_store_base_value # The Well, change it to black if The Well Wheel switch &363b e0 ad CPX #&ad ; "The Well" # has been activated (i.e. the well has been drained) &363d d0 07 BNE &3646 ; to_store_base_value &363f ae f5 07 LDX &07f5 ; well_wheel_switch_state &3642 f0 02 BEQ &3646 ; to_store_base_value &3644 a9 00 LDA #&00 ; KK ; to_store_base_value &3646 4c d4 35 JMP &35d4 ; store_base_value # Go back for another byte of room data ; skip_rectangle_setup &3649 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte for size of rectangle ; skip_size_setup &364c 29 0f AND #&0f &364e 85 0b STA &0b ; width # Low nibble is width, high nibble is height &3650 98 TYA &3651 4a LSR A &3652 4a LSR A &3653 4a LSR A &3654 09 01 ORA #&01 &3656 a4 01 LDY &01 ; y &3658 c0 48 CPY #&48 &365a b0 06 BCS &3662 ; skip_floor &365c a0 48 LDY #&48 &365e 84 01 STY &01 ; y &3660 29 fe AND #&fe ; skip_floor &3662 85 0c STA &0c ; height ; fill_rectangle_vertical_loop # Plot the rectangle as a series of sub-rectangles &3664 20 08 25 JSR &2508 ; calculate_screen_address &3667 a6 0b LDX &0b ; width ; fill_rectangle_horizontal_loop &3669 a0 27 LDY #&27 # 10 pixels per sub-rectangle ; fill_rectangle_subrectangle_loop &366b a9 00 LDA #&00 # actually LDA rectangle_pixel_value ; rectangle_fill_instruction &366d 91 02 STA (&02),Y ; screen_address # also AND, ORA, EOR (&02), Y &366f 91 02 STA (&02),Y ; screen_address &3671 88 DEY &3672 10 f7 BPL &366b ; fill_rectangle_subrectangle_loop &3674 a5 02 LDA &02 ; screen_address_low # Move down eight pixels &3676 69 28 ADC #&28 &3678 85 02 STA &02 ; screen_address_low &367a 90 03 BCC &367f &367c e6 03 INC &03 ; screen_address_high &367e 18 CLC &367f ca DEX &3680 10 e7 BPL &3669 ; fill_rectangle_horizontal_loop &3682 a5 01 LDA &01 ; y &3684 69 08 ADC #&08 &3686 85 01 STA &01 ; y &3688 c6 0c DEC &0c ; height &368a 10 d8 BPL &3664 ; fill_rectangle_vertical_loop &368c c6 0f DEC &0f ; rectangles_still_to_plot &368e 30 03 BMI &3693 ; finished_plotting_rectangles &3690 4c d7 35 JMP &35d7 ; consider_next_rectangle # Repeat for any remaining rectangles ; finished_plotting_rectangles &3693 a5 21 LDA &21 ; number_of_triangles_and_rectangles &3695 29 07 AND #&07 &3697 d0 03 BNE &369c ; plot_triangles # If there are triangles to plot, &3699 4c 33 37 JMP &3733 ; consider_if_room_has_object ; plot_triangles # For each triangle, &369c 85 21 STA &21 ; number_of_triangles &369e a9 00 LDA #&00 # Start with sensible defaults: &36a0 8d 59 03 STA &0359 ; Graphics foreground mask # 0 = KK, black &36a3 8d 5b 03 STA &035b ; Graphics foreground modifier # 0 = set ; consider_next_triangle &36a6 20 7f 40 JSR &407f ; split_byte_of_room_data # Get a byte for first point co-ordinates &36a9 84 0e STY &0e ; first_point_y &36ab 98 TYA &36ac d0 0e BNE &36bc ; skip_triangle_setup # If high nibble == &0, define colours &36ae a5 04 LDA &04 ; low_nibble &36b0 8d 5b 03 STA &035b ; Graphics foreground modifier # 0 = STA, 1 = ORA, 2 = AND, 3 = EOR &36b3 20 98 40 JSR &4098 ; get_byte_of_room_data # Get another byte for the pixel value &36b6 8d 59 03 STA &0359 ; Graphics foreground mask ; to_consider_next_triangle &36b9 4c a6 36 JMP &36a6 ; consider_next_triangle # and go back for another byte ; skip_triangle_setup &36bc 8e 24 03 STX &0324 ; current_graphics_cursor_x_low # Low nibble of first byte is first point x &36bf 20 7f 40 JSR &407f ; split_byte_of_room_data # Get a second byte for second point co-ordinates &36c2 8e 14 03 STX &0314 ; old_graphics_cursor_x_low # Low nibble of second byte is second point x &36c5 88 DEY &36c6 98 TYA &36c7 69 08 ADC #&08 &36c9 49 ff EOR #&ff &36cb 8d 16 03 STA &0316 ; old_graphics_cursor_y_low # High nibble of second byte is second point y &36ce 20 7f 40 JSR &407f ; split_byte_of_room_data # Get a third byte for third point co-ordinates &36d1 98 TYA &36d2 05 04 ORA &04 ; low_nibble &36d4 c9 cc CMP #&cc # The two Star Port rooms (&a3 and &b7) each have a &36d6 d0 05 BNE &36dd ; not_star_port_destruction_triangle # triangle that is only plotted when the Star Port is &36d8 ad fe 07 LDA &07fe ; star_port_destroyed # destroyed; this has a third co-ordinate of (&c, &c) &36db f0 52 BEQ &372f ; skip_plotting_triangle ; not_star_port_destruction_triangle &36dd ec 24 03 CPX &0324 ; current_graphics_cursor_x_low # If third point x > first point x &36e0 b0 03 BCS &36e5 ; don't_change_first_point_x &36e2 ce 24 03 DEC &0324 ; current_graphics_cursor_x_low # reduce first point x by 1 ; don't_change_first_point_x &36e5 ec 14 03 CPX &0314 ; old_graphics_cursor_x_low # If third point x > second point x, &36e8 b0 08 BCS &36f2 ; don't_change_second_point_x &36ea ad 14 03 LDA &0314 ; old_graphics_cursor_x_low &36ed 69 09 ADC #&09 # increase second point x by 9 &36ef 8d 14 03 STA &0314 ; old_graphics_cursor_x_low ; don't_change_second_point_x &36f2 c4 0e CPY &0e ; first_point_y # If third point y != first point y, &36f4 f0 02 BEQ &36f8 ; don't_change_first_point_y &36f6 c6 0e DEC &0e ; first_point_y # reduce first point y by 1 ; don't_change_first_point_y &36f8 8a TXA # Push X into x co-ordinate of VDU string &36f9 4a LSR A # (low nibble of third byte is third point x) &36fa 4a LSR A &36fb 4a LSR A &36fc 4a LSR A &36fd 4a LSR A &36fe 8d e3 40 STA &40e3 ; plot_line_vdu_string + 2 &3701 8a TXA &3702 0a ASL A &3703 0a ASL A &3704 0a ASL A &3705 8d e4 40 STA &40e4 ; plot_line_vdu_string + 3 &3708 98 TYA # Push Y into y co-ordinate of VDU string &3709 49 ff EOR #&ff # (high nibble of third byte third point y) &370b a8 TAY &370c 4a LSR A &370d 4a LSR A &370e 4a LSR A &370f 4a LSR A &3710 4a LSR A &3711 4a LSR A &3712 8d e1 40 STA &40e1 ; plot_line_vdu_string &3715 98 TYA &3716 0a ASL A &3717 0a ASL A &3718 8d e2 40 STA &40e2 ; plot_line_vdu_string + 1 &371b a5 0e LDA &0e ; first_point_y &371d 69 08 ADC #&08 &371f 49 ff EOR #&ff &3721 8d 26 03 STA &0326 ; current_graphics_cursor_y_low # High nibble of first byte is first point y &3724 a2 05 LDX #&05 ; plot_line_vdu_loop # Plot VDU string, and thus plot the triangle, having &3726 bd e1 40 LDA &40e1,X ; plot_line_vdu_string # pushed the first two points into internal OS &3729 20 ee ff JSR &ffee ; OSWRCH # variables, and the third into the VDU string &372c ca DEX &372d 10 f7 BPL &3726 ; plot_line_vdu_loop ; skip_plotting_triangle &372f c6 21 DEC &21 ; number_of_triangles &3731 d0 86 BNE &36b9 ; to_consider_next_triangle # Repeat for any remaining triangles ; consider_if_room_has_object &3733 46 53 LSR &53 ; room_flags # If bit 1 of room_flags set, room has an object &3735 90 3c BCC &3773 ; skip_object &3737 a2 06 LDX #&06 ; OBJECT_PLINTH &3739 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &373c 20 7f 40 JSR &407f ; split_byte_of_room_data # Get a byte for its position &373f 84 01 STY &01 ; y &3741 98 TYA &3742 38 SEC &3743 e9 10 SBC #&10 &3745 85 2c STA &2c ; object_y &3747 8a TXA &3748 d0 02 BNE &374c ; not_zero &374a a2 4a LDX #&4a ; x # The plinth in The Palace is centred ; not_zero &374c 86 2b STX &2b ; object_x &374e 20 90 25 JSR &2590 ; plot_sprite_in_slot_zero # Plot the OBJECT_PLINTH &3751 20 49 25 JSR &2549 ; set_plot_mode_to_EOR &3754 a0 27 LDY #&27 ; check_for_objects_in_this_room # Find which object is in the room &3756 b9 80 03 LDA &0380,Y ; object_room_table &3759 c5 37 CMP &37 ; player_room &375b f0 03 BEQ &3760 ; found_object_in_this_room &375d 88 DEY &375e 10 f6 BPL &3756 ; check_for_objects_in_this_room ; found_object_in_this_room &3760 84 2d STY &2d ; object_in_room &3762 be a8 03 LDX &03a8,Y ; object_sprite_table &3765 30 0c BMI &3773 ; skip_plotting_object &3767 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero # If the object has a sprite, prepare and plot it &376a a6 2b LDX &2b ; object_x &376c a4 2c LDY &2c ; object_y &376e 84 01 STY &01 ; y &3770 20 77 25 JSR &2577 ; plot_sprite_in_slot_zero_adjusting_position ; skip_object &3773 a9 91 LDA #&91 ; STA &3775 20 4b 25 JSR &254b ; set_plot_mode &3778 a5 22 LDA &22 ; lines_of_sprites_afterwards &377a 4a LSR A &377b 4a LSR A &377c 4a LSR A &377d f0 03 BEQ &3782 ; no_sprites_to_plot_afterwards &377f 20 f4 32 JSR &32f4 ; plot_sprites_from_room_data # Plot any sprites before rectangles and triangles ; no_sprites_to_plot_afterwards &3782 20 49 25 JSR &2549 ; set_plot_mode_to_EOR &3785 46 53 LSR &53 ; room_flags # If bit 2 of room_flags is set, room has ropes/ladders &3787 90 4e BCC &37d7 ; no_ropes_or_ladders &3789 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte for the number of ropes and ladders &378c 85 22 STA &22 ; ropes_and_ladders # High nibble is number of ladders &378e 29 0f AND #&0f # Low nibble is number of ropes &3790 f0 3d BEQ &37cf ; skip_ropes # If there are ropes, &3792 85 21 STA &21 ; ropes_remaining ; consider_next_rope # For each rope, &3794 20 7f 40 JSR &407f ; split_byte_of_room_data # Get a byte for the position of its base &3797 69 04 ADC #&04 # Move the rope horizontally &3799 aa TAX &379a 98 TYA &379b c9 f0 CMP #&f0 &379d b0 03 BCS &37a2 ; skip_tweak # For ropes that don't go off the bottom of the screen, &379f 09 08 ORA #&08 # lengthen by half a block &37a1 a8 TAY ; skip_tweak &37a2 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &37a5 a2 6c LDX #&6c; climbable_CG ; plot_rope_loop &37a7 a0 07 LDY #&07 ; plot_rope_within_group_loop &37a9 b1 02 LDA (&02),Y ; screen_address # See what's on the screen already &37ab 29 3f AND #&3f &37ad d0 1c BNE &37cb ; end_of_rope # If it's an obstacle, that's the end of the rope &37af 8a TXA &37b0 91 02 STA (&02),Y ; screen_address # Otherwise, plot the rope &37b2 88 DEY &37b3 a9 5c LDA #&5c ; climbable_GC &37b5 91 02 STA (&02),Y ; screen_address # two pixels vertically at a time &37b7 88 DEY &37b8 10 ef BPL &37a9 ; plot_rope_within_group_loop &37ba 38 SEC &37bb a5 02 LDA &02 ; screen_address_low # Move up a group of 8 pixels &37bd e9 80 SBC #&80 &37bf 85 02 STA &02 ; screen_address_low &37c1 a5 03 LDA &03 ; screen_address_high &37c3 e9 02 SBC #&02 &37c5 85 03 STA &03 ; screen_address_high &37c7 c9 49 CMP #&49 &37c9 b0 dc BCS &37a7 ; plot_rope_loop # Don't plot rope above top edge of room ; end_of_rope &37cb c6 21 DEC &21 ; ropes_remaining &37cd d0 c5 BNE &3794 ; consider_next_rope # Repeat for any remaining ropes ; skip_ropes &37cf a5 22 LDA &22 ; ropes_and_ladders &37d1 4a LSR A &37d2 4a LSR A &37d3 4a LSR A &37d4 4a LSR A &37d5 d0 03 BNE &37da ; plot_ladders ; no_ropes_or_ladders &37d7 4c 42 38 JMP &3842 ; check_for_stars ; plot_ladders # For each ladder, &37da 85 21 STA &21 ; ladders_remaining ; consider_next_ladder &37dc 20 7f 40 JSR &407f ; split_byte_of_room_data # Get a byte for the position of its base &37df 98 TYA &37e0 69 08 ADC #&08 # Add half a block &37e2 a8 TAY &37e3 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &37e6 20 98 40 JSR &4098 ; get_byte_of_room_data # Get another byte for length and colour &37e9 29 7c AND #&7c # Highest six bits set the length of the ladder &37eb 4a LSR A &37ec 4a LSR A &37ed 85 0b STA &0b ; ladder_length &37ef 98 TYA &37f0 29 03 AND #&03 # Lowest two bits set the colour &37f2 0a ASL A # 0 = GC, 1 = CY, 2 = RM, 3 = CG &37f3 aa TAX &37f4 a0 01 LDY #&01 ; set_ladder_pixel_values_loop # Copy ladder pixel values from table into zero page &37f6 bd c9 40 LDA &40c9,X ; ladder_pixel_values_table # This is overkill for two bytes, suggesting that the &37f9 99 04 00 STA &0004,Y ; ladder_pixel_values # ladders may once have previously had more bytes &37fc e8 INX &37fd 88 DEY &37fe 10 f6 BPL &37f6 ; set_ladder_pixel_values_loop &3800 30 0c BMI &380e ; plot_ladder_within_group_loop ; plot_ladder_loop &3802 a5 02 LDA &02 ; screen_address_low # Move up a group of eight pixels &3804 e9 7f SBC #&7f &3806 85 02 STA &02 ; screen_address_low &3808 a5 03 LDA &03 ; screen_address_high &380a e9 02 SBC #&02 &380c 85 03 STA &03 ; screen_address_high ; plot_ladder_within_group_loop # Plot ladder in eight pixel groups &380e a9 40 LDA #&40 ; climbable_KK &3810 a0 1f LDY #&1f ; wipe_ladder_area_loop # Plot a line of climbable black &3812 91 02 STA (&02),Y ; screen_address &3814 88 DEY &3815 10 fb BPL &3812 ; wipe_ladder_area_loop &3817 a6 04 LDX &04 ; ladder_rung_pixel_value &3819 a0 1c LDY #&1c &381b 20 74 40 JSR &4074 ; plot_ladder_rung # Plot lower rung of ladder &381e a5 0b LDA &0b ; ladder_length &3820 f0 05 BEQ &3827 ; skip_top_rung # If this isn't the top of the ladder, &3822 a0 18 LDY #&18 &3824 20 74 40 JSR &4074 ; plot_ladder_rung # Plot upper rung of ladder ; skip_top_rung &3827 a5 05 LDA &05 ; ladder_side_pixel_value &3829 a2 07 LDX #&07 &382b a0 27 LDY #&27 ; plot_ladder_right_side_loop # Plot right side of ladder &382d 91 02 STA (&02),Y ; screen_address &382f 88 DEY &3830 ca DEX &3831 10 fa BPL &382d ; plot_ladder_right_side_loop &3833 a0 07 LDY #&07 ; plot_ladder_left_side_loop # Plot left side of ladder &3835 91 02 STA (&02),Y ; screen_address &3837 88 DEY &3838 10 fb BPL &3835 ; plot_ladder_left_side_loop &383a c6 0b DEC &0b ; ladder_length &383c 10 c4 BPL &3802 ; plot_ladder_loop &383e c6 21 DEC &21 ; ladders_remaining &3840 d0 9a BNE &37dc ; consider_next_ladder # Repeat for any remaining ladders ; check_for_stars &3842 46 53 LSR &53 ; room_flags # If bit 3 of room_flags is set, room has stars &3844 90 58 BCC &389e ; check_for_energy &3846 a2 03 LDX #&03 ; seed_rnd_loop &3848 b5 37 LDA &37,X ; rng_state # Seed random number generator, &384a 95 5a STA &5a,X ; backup_of_rnd_state + 1 # storing previous state &384c a9 20 LDA #&20 &384e 95 37 STA &37,X ; rnd_state + 1 &3850 ca DEX &3851 d0 f5 BNE &3848 ; seed_rnd_loop &3853 8e 8f 38 STX &388f &3856 a9 ff LDA #&ff # 255 stars &3858 85 20 STA &20 ; stars_remaining ; plot_stars_loop &385a 20 af 40 JSR &40af ; random_number_generator # Generate a random screen address for the star &385d 29 7f AND #&7f &385f 09 40 ORA #&40 # ensuring that it lies between &4900 and &7fff &3861 c9 49 CMP #&49 &3863 b0 02 BCS &3867 ; skip_floor # (i.e. within the room) &3865 69 09 ADC #&09 ; skip_floor &3867 8d 7b 38 STA &387b ; star_screen_address_read_high # Self-modifying code &386a 8d 90 38 STA &3890 ; star_screen_address_write_high # Self-modifying code &386d 20 af 40 JSR &40af ; random_number_generator &3870 6d 8f 38 ADC &388f ; star_screen_address_write_low # Self-modifying code. Ensure different to last time? &3873 8d 7a 38 STA &387a ; star_screen_address_read_low # Self-modifying code &3876 8d 8f 38 STA &388f ; star_screen_address_write_low # Self-modifying code &3879 ae e7 03 LDX &03e7 # actually LDX star_screen_address_read &387c d0 13 BNE &3891 ; skip_plotting_star # Only plot a star if there's nothing there &387e 86 00 STX &00 ; unused # Unused variable &3880 29 01 AND #&01 &3882 d0 06 BNE &388a ; use_left_pixel &3884 a5 39 LDA &39 ; rnd_2 &3886 29 15 AND #&15 ; KW &3888 10 04 BPL &388e ; plot_star ; use_left_pixel &388a a5 39 LDA &39 ; rnd_2 &388c 29 2a AND #&2a ; WK ; plot_star &388e 8d e7 03 STA &03e7 # actually STA star_screen_address_write ; skip_plotting_star &3891 c6 20 DEC &20 ; stars_remaining &3893 d0 c5 BNE &385a ; plot_stars_loop &3895 a2 02 LDX #&02 ; restore_rnd_state_loop # Restore the previous random number generator state &3897 b5 5b LDA &5b,X ; backup_of_rnd_state &3899 95 38 STA &38,X ; rnd_state &389b ca DEX &389c 10 f9 BPL &3897 ; restore_rnd_state_loop ; check_for_energy # Does the room contain ENERGY? &389e a0 0f LDY #&0f &38a0 a5 37 LDA &37 ; player_room ; check_for_energy_loop &38a2 d9 b0 08 CMP &08b0,Y ; rooms_that_contain_energy &38a5 f0 05 BEQ &38ac ; room_contains_energy &38a7 88 DEY &38a8 10 f8 BPL &38a2 ; check_for_energy_loop &38aa 30 2b BMI &38d7 ; check_for_door ; room_contains_energy &38ac b9 f0 04 LDA &04f0,Y ; energy_collected_table &38af d0 26 BNE &38d7 ; check_for_door # If so, has it already been collected? &38b1 8c 26 01 STY &0126 ; energy_number &38b4 a2 07 LDX #&07 ; ENERGY_GREEN &38b6 c0 0a CPY #&0a # The last six ENERGYs are ENERGY_RED &38b8 90 01 BCC &38bb ; green_energy &38ba e8 INX ; &08 = ENERGY_RED ; green_energy &38bb 8e 96 2b STX &2b96 ; energy_sprite &38be 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero # Prepare and plot the ENERGY &38c1 ac 26 01 LDY &0126 ; energy_number &38c4 b9 f0 08 LDA &08f0,Y ; energy_coordinates_table &38c7 20 85 40 JSR &4085 ; split_byte_into_x_and_y &38ca 8c 28 01 STY &0128 ; energy_y &38cd 84 01 STY &01 ; y &38cf e8 INX &38d0 e8 INX &38d1 8e 27 01 STX &0127 ; energy_x &38d4 20 90 25 JSR &2590 ; plot_sprite_in_slot_zero ; check_for_door &38d7 46 53 LSR &53 ; room_flags # If bit 4 of room_flags is set, room contains a door &38d9 90 44 BCC &391f ; check_for_pillars &38db 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte for the type of door &38de 8d 2b 01 STA &012b ; room_door_type &38e1 be a8 08 LDX &08a8,Y ; doors_opened &38e4 f0 05 BEQ &38eb ; door_still_closed &38e6 20 98 40 JSR &4098 ; get_byte_of_room_data # If the door has been already opened, discard a byte &38e9 d0 34 BNE &391f ; check_for_pillars # for its location and move on ; door_still_closed &38eb 09 40 ORA #&40 # Door sprites start at &40 &38ed aa TAX &38ee 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &38f1 ad 2b 01 LDA &012b ; room_door_type &38f4 09 48 ORA #&48 # Key sprites start at &48 &38f6 a6 2e LDX &2e ; object_in_pocket_one &38f8 dd a8 03 CMP &03a8,X ; object_sprite_table # Is the player holding the corresponding key? &38fb f0 14 BEQ &3911 ; key_matches &38fd a6 2f LDX &2f ; object_in_pocket_two &38ff dd a8 03 CMP &03a8,X ; object_sprite_table &3902 f0 0d BEQ &3911 ; key_matches &3904 a2 0f LDX #&0f ; make_door_impenetrable_loop &3906 a9 c0 LDA #&c0 # If not, make the door sprite an obstacle &3908 1d 00 05 ORA &0500,X ; palette_table &390b 9d 00 05 STA &0500,X ; palette_table &390e ca DEX &390f 10 f5 BPL &3906 ; make_door_impenetrable_loop ; key_matches &3911 20 7f 40 JSR &407f ; split_byte_of_room_data # Get a byte for the position of the door &3914 8c 2a 01 STY &012a ; door_y &3917 84 01 STY &01 ; y &3919 8e 29 01 STX &0129 ; door_x &391c 20 90 25 JSR &2590 ; plot_sprite_in_slot_zero # Plot door ; check_for_pillars &391f 46 53 LSR &53 ; room_flags # If bit 5 of room_data is set, the room has pillars &3921 90 62 BCC &3985 ; check_for_enemies &3923 a2 20 LDX #&20 ; PILLAR &3925 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &3928 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte for number of pillars and colour &392b 29 0f AND #&0f &392d 85 21 STA &21 ; pillars_remaining # Low nibble is number of pillars - 1 &392f 98 TYA &3930 4a LSR A &3931 4a LSR A &3932 85 0b STA &0b ; pillar_colour # Highest two bits are colour of pillar &3934 4a LSR A &3935 29 06 AND #&06 &3937 85 0c STA &0c ; pillar_offset # Bug: default offset of pillar is always zero ; consider_next_pillar &3939 20 7f 40 JSR &407f ; split_byte_of_room_data # Get a byte &393c c0 40 CPY #&40 &393e b0 08 BCS &3948 ; skip_pillar_settings # If high nibble < 4, set colour and offset &3940 84 0b STY &0b ; pillar_colour # High nibble is colour of pillar &3942 a5 04 LDA &04 ; low_nibble &3944 85 0c STA &0c ; pillar_offset # Low nibble is horizontal offset &3946 10 f1 BPL &3939 ; consider_next_pillar &3948 8a TXA ; skip_pillar_settings &3949 65 0c ADC &0c ; pillar_offset &394b aa TAX &394c 84 01 STY &01 ; y &394e a5 0b LDA &0b ; pillar_colour # PILLAR has three frames, each with a different palette &3950 29 30 AND #&30 &3952 a0 04 LDY #&04 ; set_pillar_palette_table_loop &3954 99 82 01 STA &0182,Y ; sprite_slots_palette_start - 1 # Use the palette corresponding to the pillar's colour &3957 88 DEY &3958 d0 fa BNE &3954 ; set_pillar_palette_table_loop &395a 20 46 26 JSR &2646 ; plot_four_colour_sprite_with_previous_y # Plot top of pillar &395d e6 00 INC &00 ; x ; plot_pillar_column_loop &395f a5 01 LDA &01 ; y &3961 18 CLC &3962 69 08 ADC #&08 &3964 85 01 STA &01 ; y &3966 20 08 25 JSR &2508 ; calculate_screen_address # Has the pillar reached something? &3969 a5 01 LDA &01 ; y &396b e9 03 SBC #&03 &396d 85 01 STA &01 ; y &396f a0 02 LDY #&02 &3971 b1 02 LDA (&02),Y ; screen_address &3973 30 05 BMI &397a ; bottom_of_pillar # If not, plot a four pixel section of column &3975 20 48 26 JSR &2648 ; plot_four_colour_sprite_with_previous_x_and_y &3978 30 e5 BMI &395f ; plot_pillar_column_loop ; bottom_of_pillar &397a c6 00 DEC &00 ; x &397c a0 01 LDY #&01 # Plot bottom of pillar &397e 20 48 26 JSR &2648 ; plot_four_colour_sprite_with_previous_x_and_y &3981 c6 21 DEC &21 ; pillars_remaining &3983 10 b4 BPL &3939 ; consider_next_pillar # Repeat for any remaining pillars ; check_for_enemies &3985 46 53 LSR &53 ; room_flags # If bit 6 of room_flags is set, the room has enemies &3987 b0 01 BCS &398a ; room_has_enemies &3989 60 RTS ; room_has_enemies &398a a9 00 LDA #&00 # Reset start of flipped packed sprite data to &0400 &398c 85 0f STA &0f ; flipped_packed_sprite_data_address_low &398e a9 04 LDA #&04 &3990 85 10 STA &10 ; flipped_packed_sprite_data_address_high &3992 a2 00 LDX #&00 &3994 8e 12 3e STX &3e12 ; full_bucket_removes_all_fires &3997 e8 INX &3998 86 17 STX &17 ; sprite_slot # Set up enemy sprites from slot 1, &399a a9 10 LDA #&10 # palette table offset &10 onwards &399c 85 18 STA &18 ; palette_table_offset &399e 85 19 STA &19 ; last_palette_table_offset &39a0 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte for number of enemies and enemy sprites &39a3 85 20 STA &20 ; enemies_remaining # High nibble is number of enemies &39a5 29 0f AND #&0f &39a7 85 21 STA &21 ; number_of_enemy_sprites # Low nibble is number of sprites used for enemies ; consider_next_enemy_sprite # For each sprite used for enemies, &39a9 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte for the sprite number &39ac aa TAX &39ad 20 bd 30 JSR &30bd ; prepare_sprite_in_next_slot # and prepare this sprite in the next slot &39b0 c6 21 DEC &21 ; number_of_enemy_sprites &39b2 10 f5 BPL &39a9 ; consider_next_enemy_sprite &39b4 a5 20 LDA &20 ; enemies_remaining &39b6 4a LSR A &39b7 4a LSR A &39b8 4a LSR A &39b9 4a LSR A &39ba 85 20 STA &20 ; enemies_remaining &39bc 85 36 STA &36 ; number_of_enemies_in_room ; consider_next_enemy # For each enemy, &39be 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a first byte of enemy data &39c1 85 0b STA &0b ; enemy_first_byte &39c3 a6 20 LDX &20 ; enemy_offset &39c5 29 f0 AND #&f0 &39c7 4a LSR A &39c8 4a LSR A &39c9 4a LSR A &39ca 4a LSR A &39cb a8 TAY # High nibble determines sprite slot &39cc c8 INY &39cd 94 83 STY &83,X ; enemies_sprite_slot # enemy_sprite_slot = high nibble + 1 &39cf b9 6b 01 LDA &016b,Y ; sprite_slots_enemy_type # which in turn determines type of enemy &39d2 a8 TAY &39d3 b9 63 3b LDA &3b63,Y ; enemy_initialisation_routines_low_table &39d6 8d 0c 3a STA &3a0c ; enemy_initialisation_routine_low # Self-modifying code &39d9 b9 6b 3b LDA &3b6b,Y ; enemy_initialisation_routines_high_table &39dc 8d 0d 3a STA &3a0d ; enemy_initialisation_routine_high # Self-modifying code &39df a9 00 LDA #&00 &39e1 95 63 STA &63,X ; enemies_speed_x # Set sensible defaults &39e3 95 6b STA &6b,X ; enemies_speed_y &39e5 85 06 STA &06 ; enemy_minimum_x &39e7 85 08 STA &08 ; enemy_minimum_y &39e9 9d 08 01 STA &0108,X ; enemies_secondary_frame_countdown &39ec 95 8b STA &8b,X ; enemies_frame &39ee a9 01 LDA #&01 &39f0 9d 00 01 STA &0100,X ; enemies_frame_countdown &39f3 a9 ff LDA #&ff &39f5 85 07 STA &07 ; enemy_maximum_x &39f7 85 09 STA &09 ; enemy_maximum_y &39f9 20 7f 40 JSR &407f ; split_byte_of_room_data # Get a second byte of enemy data for position &39fc a6 20 LDX &20 ; enemy_offset &39fe 95 53 STA &53,X ; enemies_x # Low nibble sets x position &3a00 94 5b STY &5b,X ; enemies_y # High nibble sets y position &3a02 a5 0b LDA &0b ; enemy_first_byte &3a04 29 0f AND #&0f # Low nibble of first byte is used in initialisation &3a06 c9 0f CMP #&0f # routines, unless &f, in which case, use the same &3a08 f0 04 BEQ &3a0e ; skip_enemy_initialisation # values as the previous enemy &3a0a a8 TAY &3a0b 20 e7 03 JSR &03e7 # actually JSR enemy_initialisation_routine # Initialise enemy, possibly getting more data ; skip_enemy_initialisation &3a0e a6 20 LDX &20 ; enemy_offset &3a10 a4 06 LDY &06 ; enemy_minimum_x &3a12 a5 07 LDA &07 ; enemy_maximum_x &3a14 c5 06 CMP &06 ; enemy_minimum_x &3a16 b0 0a BCS &3a22 ; skip_inversion_x # If enemy_minimum_x > enemy_maximum_x, &3a18 a9 01 LDA #&01 # set enemy moving left rather than right &3a1a f5 63 SBC &63,X ; enemies_speed_x &3a1c 95 63 STA &63,X ; enemies_speed_x &3a1e a4 07 LDY &07 ; enemy_maximum_x &3a20 a5 06 LDA &06 ; enemy_minimum_x ; skip_inversion_x &3a22 9d 10 01 STA &0110,X ; enemies_maximum_x &3a25 94 73 STY &73,X ; enemies_minimum_x &3a27 a4 08 LDY &08 ; enemy_minimum_y &3a29 a5 09 LDA &09 ; enemy_maximum_y &3a2b c5 08 CMP &08 ; enemy_minimum_y &3a2d b0 0a BCS &3a39 ; skip_inversion_y # If enemy_minimum_y > enemy_maximum_y, &3a2f a9 01 LDA #&01 # set enemy moving up rather than down &3a31 f5 6b SBC &6b,X ; enemies_speed_y &3a33 95 6b STA &6b,X ; enemies_speed_y &3a35 a4 09 LDY &09 ; enemy_maximum_y &3a37 a5 08 LDA &08 ; enemy_minimum_y ; skip_inversion_y &3a39 9d 18 01 STA &0118,X ; enemies_maximum_y &3a3c 94 7b STY &7b,X ; enemies_minimum_y &3a3e b4 83 LDY &83,X ; enemies_sprite_slot &3a40 b9 77 01 LDA &0177,Y ; sprite_slots_offset_of_last_byte # Account for width of sprite in maximum_x &3a43 4a LSR A &3a44 4a LSR A &3a45 29 fe AND #&fe &3a47 49 ff EOR #&ff &3a49 7d 10 01 ADC &0110,X ; enemies_maximum_x &3a4c 9d 10 01 STA &0110,X ; enemies_maximum_x &3a4f b9 2f 01 LDA &012f,Y ; sprite_slots_height_in_blocks # and height of sprite in maximum_y &3a52 0a ASL A &3a53 0a ASL A &3a54 49 ff EOR #&ff &3a56 7d 18 01 ADC &0118,X ; enemies_maximum_y &3a59 9d 18 01 STA &0118,X ; enemies_maximum_y ; continue_to_next_enemy &3a5c c6 20 DEC &20 ; enemy_offset &3a5e 30 03 BMI &3a63 ; consider_room_specific_enemy_tweaks # Have we initialised all the room's enemies? &3a60 4c be 39 JMP &39be ; consider_next_enemy ; consider_room_specific_enemy_tweaks # Room specific enemy tweaks &3a63 a5 37 LDA &37 ; player_room &3a65 c9 46 CMP #&46 ; room left of Central Tower &3a67 d0 09 BNE &3a72 ; not_central_tower_platform # Is the player in the room left of Central Tower? &3a69 ae f4 07 LDX &07f4 ; central_tower_switch_state &3a6c d0 13 BNE &3a81 ; tweak_enemy_positions &3a6e a2 00 LDX #&00 # Switch off platform unless switch is pressed &3a70 86 6b STX &6b ; enemies_speed_y + 0 ; not_central_tower_platform &3a72 c9 ca CMP #&ca ; The Temple # Is the player in The Temple? &3a74 f0 09 BEQ &3a7f ; remove_last_enemy # If so, the TEMPLE_GUARDIAN is initially inactive &3a76 c9 92 CMP #&92 ; Witch's House &3a78 d0 07 BNE &3a81 ; tweak_enemy_positions # Is the player in Witch's House? &3a7a ae fd 07 LDX &07fd ; bones_still_needed_in_cauldron &3a7d 10 02 BPL &3a81 ; tweak_enemy_positions # If so, have they filled the cauldron? ; remove_last_enemy &3a7f c6 36 DEC &36 ; number_of_enemies_in_room # If so, remove the WITCH ; tweak_enemy_positions &3a81 a2 04 LDX #&04 &3a83 a5 24 LDA &24 ; player_x &3a85 48 PHA # Note the player's entry position &3a86 30 02 BMI &3a8a ; player_entered_from_the_right # Then temporary put them on the opposite side of the ; player_entered_from_the_left # room, so that any enemies that would be attracted to &3a88 a2 92 LDX #&92 # them are actually repulsed during initialisation ; player_entered_from_the_right &3a8a 86 24 STX &24 ; player_x &3a8c a2 4c LDX #&4c &3a8e a5 25 LDA &25 ; player_y &3a90 48 PHA &3a91 30 02 BMI &3a95 ; player_entered_from_below ; player_entered_from_above &3a93 a2 e4 LDX #&e4 ; player_entered_from_below &3a95 86 25 STX &25 ; player_y &3a97 a5 36 LDA &36 ; number_of_enemies_in_room &3a99 85 1d STA &1d ; enemy_to_consider ; desync_enemy_animations_loop # Ensure enemy animations aren't in phase &3a9b a5 1d LDA &1d ; enemy_to_consider &3a9d 29 03 AND #&03 &3a9f 85 1e STA &1e ; number_of_updates ; desync_enemy_animations_inner_loop &3aa1 20 57 3e JSR &3e57 ; update_enemy_animation # by updating each a different number of times &3aa4 a4 1d LDY &1d ; enemy_to_consider &3aa6 99 8b 00 STA &008b,Y ; enemies_frame &3aa9 c6 1e DEC &1e ; number_of_updates &3aab 10 f4 BPL &3aa1 ; desync_enemy_animations_inner_loop &3aad c6 1d DEC &1d ; enemy_to_consider &3aaf 10 ea BPL &3a9b ; desync_enemy_animations_loop &3ab1 a5 38 LDA &38 ; rnd_1 &3ab3 29 3f AND #&3f &3ab5 85 1e STA &1e ; number_of_updates &3ab7 a9 4c LDA #&4c ; JMP # Self-modifying code: &3ab9 8d a3 3b STA &3ba3 ; jmp_or_jsr_to_enemy_move_routine # Update enemies without plotting them &3abc 8d bd 3b STA &3bbd ; jmp_or_jsr_to_plot_enemy_sprite # Don't unplot enemies (even when plotting them) ; position_enemies_loop &3abf a5 36 LDA &36 ; number_of_enemies_in_room # Update the enemies a random number of times, to put &3ac1 85 1d STA &1d ; enemy_to_consider # them in different positions every time the player ; position_enemies_inner_loop # enters the room &3ac3 a9 20 LDA #&20 ; green_and_yellow_monk &3ac5 8d 17 3d STA &3d17 ; palette_value_of_green_monk # Keep the MONKs where they start &3ac8 20 7a 3b JSR &3b7a ; update_enemies_partial &3acb c6 1d DEC &1d ; enemy_to_consider &3acd 10 f4 BPL &3ac3 ; position_enemies_inner_loop &3acf c6 1e DEC &1e ; number_of_updates # Bug: this isn't randomly reset for later enemies &3ad1 10 ec BPL &3abf ; position_enemies_loop &3ad3 68 PLA ; previous_player_y # Restore the player's original entry position &3ad4 85 25 STA &25 ; player_y &3ad6 68 PLA ; previous_player_x &3ad7 85 24 STA &24 ; player_x &3ad9 a9 20 LDA #&20 ; JSR # Plot, but don't unplot enemies &3adb 8d a3 3b STA &3ba3 ; jmp_or_jsr_to_enemy_move_routine # Self-modifying code &3ade 8d 17 3d STA &3d17 ; palette_value_of_green_monk &3ae1 a5 36 LDA &36 ; number_of_enemies_in_room &3ae3 85 1d STA &1d ; enemy_to_consider ; plot_initial_enemies_loop # Plot the enemies in their starting positions &3ae5 20 7a 3b JSR &3b7a ; update_enemies_partial &3ae8 c6 1d DEC &1d ; enemy_to_consider &3aea 10 f9 BPL &3ae5 ; plot_initial_enemies_loop &3aec a9 20 LDA #&20 ; JSR # Subsequently plot and unplot enemies &3aee 8d bd 3b STA &3bbd ; jmp_or_jsr_to_plot_enemy_sprite # Self-modifying code &3af1 60 RTS ; enemy_initialisation_routine_zero # Used for SNOWBALL and SNAKE ; enemy_initialisation_routine_seven # Used for FIRE &3af2 95 63 STA &63,X ; enemies_speed_x # Low nibble of enemy_first_byte is horizontal speed &3af4 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte of room data for horizontal range &3af7 29 0f AND #&0f &3af9 0a ASL A &3afa 85 00 STA &00 ; tmp &3afc 0a ASL A &3afd 0a ASL A &3afe 65 00 ADC &00 ; tmp &3b00 85 06 STA &06 ; enemy_minimum_x # minimum_x = low nibble * 10 &3b02 98 TYA &3b03 29 f0 AND #&f0 &3b05 4a LSR A &3b06 85 00 STA &00 ; tmp &3b08 4a LSR A &3b09 4a LSR A &3b0a 65 00 ADC &00 ; tmp &3b0c 85 07 STA &07 ; enemy_maximum_x # maximum_x = high nibble * 10 &3b0e 60 RTS ; enemy_initialisation_routine_one # Used for LIFT, GOOGLY_FACE and ROPE_CLIMBER &3b0f 95 6b STA &6b,X ; enemies_speed_y # Low nibble of enemy_first_byte is vertical speed &3b11 20 98 40 JSR &4098 ; get_byte_of_room_data # Get a byte of room data for vertical range &3b14 29 f0 AND #&f0 &3b16 85 09 STA &09 ; enemy_maximum_y # maximum_y = high nibble * 16 &3b18 98 TYA &3b19 0a ASL A &3b1a 0a ASL A &3b1b 0a ASL A &3b1c 0a ASL A &3b1d 85 08 STA &08 ; enemy_minimum_y # minimum_y = low nibble * 16 &3b1f 60 RTS ; enemy_initialisation_routine_two # Used for MAGIC, PULSING_CIRCLES and STARFISH &3b20 b9 e7 40 LDA &40e7,Y ; diagonally_moving_enemy_speed_table # Low nibble of enemy_first_byte is used as a lookup &3b23 a8 TAY # in diagonally_moving_enemy_speed_table &3b24 29 0f AND #&0f &3b26 95 63 STA &63,X ; enemies_speed_x # speed_x = low nibble of speed table &3b28 98 TYA &3b29 29 f0 AND #&f0 &3b2b 4a LSR A &3b2c 4a LSR A &3b2d 4a LSR A &3b2e 95 6b STA &6b,X ; enemies_speed_y # speed_y = high nibble of speed table * 2 &3b30 20 7f 40 JSR &407f ; split_byte_of_room_data # Get two bytes of room data for ranges &3b33 85 06 STA &06 ; enemy_minimum_x # minimum_x = low nibble of first byte * 10 &3b35 84 08 STY &08 ; enemy_minimum_y # minimum_y = high nibble of first byte * 16 &3b37 20 7f 40 JSR &407f ; split_byte_of_room_data &3b3a 85 07 STA &07 ; enemy_maximum_x # maximum_x = low nibble of second byte * 10 &3b3c 84 09 STY &09 ; enemy_maximum_y # maximum_y = high nibble of second byte * 16 &3b3e 60 RTS ; enemy_initialisation_routine_three # Used for BLOCK and BLOCK_BLUE &3b3f 29 03 AND #&03 &3b41 95 73 STA &73,X ; enemies_minimum_x # Lowest two bits of enemy_first_byte sets direction &3b43 98 TYA &3b44 4a LSR A &3b45 4a LSR A &3b46 9d 10 01 STA &0110,X ; enemies_maximum_x # Remaining bits of enemy_first_byte sets speed &3b49 10 13 BPL &3b5e ; abandon_further_initialisation # Always branches; no further initialisation ; enemy_initialisation_routine_four # Used for PAINFUL_BALL, BENDY_LEGS, TEMPLE_GUARDIAN # WITCH and OCTOPUS ; enemy_initialisation_routine_five # Used for MUMMY ; enemy_initialisation_routine_six # Used for MONK &3b4b 29 01 AND #&01 &3b4d 9d 10 01 STA &0110,X ; enemies_maximum_x # Lowest bit of enemy_first_byte sets enemy speed &3b50 98 TYA # (0 = moves every frame, 1 = moves every two frames) &3b51 29 02 AND #&02 &3b53 95 73 STA &73,X ; enemies_minimum_x # Next lowest bit sets whether enemy can levitate &3b55 98 TYA &3b56 29 0c AND #&0c &3b58 0a ASL A &3b59 0a ASL A &3b5a 69 10 ADC #&10 &3b5c 95 7b STA &7b,X ; enemies_minimum_y # Remaining bits set colour of MONK ; abandon_further_initialisation &3b5e 68 PLA &3b5f 68 PLA &3b60 4c 5c 3a JMP &3a5c ; continue_to_next_enemy ; enemy_initialisation_routines_low_table &3b63 f2 0f 20 3f 4b 4b 4b f2 ; enemy_initialisation_routines_high_table &3b6b 3a 3b 3b 3b 3b 3b 3b 3a ; leave &3b73 60 RTS ; update_enemies &3b74 a4 36 LDY &36 ; number_of_enemies_in_room &3b76 30 fb BMI &3b73 ; leave &3b78 84 1d STY &1d ; enemy_to_consider ; update_enemies_partial &3b7a a4 1d LDY &1d ; enemy_to_consider &3b7c b9 53 00 LDA &0053,Y ; enemies_x &3b7f 85 93 STA &93 ; enemy_previous_x &3b81 b9 5b 00 LDA &005b,Y ; enemies_y &3b84 85 94 STA &94 ; enemy_previous_y &3b86 b9 83 00 LDA &0083,Y ; enemies_sprite_slot &3b89 aa TAX &3b8a 18 CLC &3b8b 79 8b 00 ADC &008b,Y ; enemies_frame &3b8e 85 95 STA &95 ; enemy_previous_sprite &3b90 bc 6b 01 LDY &016b,X ; sprite_slots_enemy_type &3b93 b9 47 3e LDA &3e47,Y ; enemy_move_routines_low_table &3b96 8d a4 3b STA &3ba4 ; enemy_move_routine_low &3b99 b9 4f 3e LDA &3e4f,Y ; enemy_move_routines_high_table &3b9c 8d a5 3b STA &3ba5 ; enemy_move_routine_high &3b9f a9 00 LDA #&00 &3ba1 a6 1d LDX &1d ; enemy_to_consider ; jmp_or_jsr_to_enemy_move_routine &3ba3 20 e7 03 JSR &03e7 # actually JSR enemy_move_routine # or JMP enemy_move_routine # JMP instead of JSR when updating without plotting &3ba6 20 57 3e JSR &3e57 ; update_enemy_animation &3ba9 a4 1d LDY &1d ; enemy_to_consider &3bab 99 8b 00 STA &008b,Y ; enemies_frame &3bae b6 53 LDX &53,Y ; enemies_x &3bb0 b9 5b 00 LDA &005b,Y ; enemies_y &3bb3 85 01 STA &01 ; y &3bb5 b9 83 00 LDA &0083,Y ; enemies_sprite_slot &3bb8 18 CLC &3bb9 79 8b 00 ADC &008b,Y ; enemies_frame &3bbc a8 TAY ; jmp_or_jsr_to_plot_enemy_sprite &3bbd 20 92 25 JSR &2592 ; plot_sprite_in_slot_Y # Plot current sprite # also JMP &2592 ; plot_sprite_in_slot_Y # JMP instead of JSR when initially plotting &3bc0 a6 93 LDX &93 ; enemy_previous_x &3bc2 a5 94 LDA &94 ; enemy_previous_y &3bc4 85 01 STA &01 ; y &3bc6 a4 95 LDY &95 ; enemy_previous_sprite &3bc8 20 92 25 JSR &2592 ; plot_sprite_in_slot_Y # Unplot previous sprite ; consider_next_enemy &3bcb c6 1d DEC &1d ; enemy_to_consider &3bcd 10 ab BPL &3b7a ; update_enemies_partial &3bcf 60 RTS ; enemy_move_routine_two # Used for MAGIC, PULSING_CIRCLES and STARFISH &3bd0 20 f1 3b JSR &3bf1 ; enemy_move_routine_one # Move diagonally within limits &3bd3 18 CLC ; enemy_move_routine_zero # Used for SNOWBALL and SNAKE &3bd4 b5 53 LDA &53,X ; enemies_x # Move horizontally within limits &3bd6 75 63 ADC &63,X ; enemies_speed_x &3bd8 d5 73 CMP &73,X ; enemies_minimum_x &3bda 90 08 BCC &3be4 ; change_direction_x_plus &3bdc dd 10 01 CMP &0110,X ; enemies_maximum_x &3bdf b0 04 BCS &3be5 ; change_direction_x_minus &3be1 95 53 STA &53,X ; enemies_x &3be3 60 RTS ; change_direction_x_plus &3be4 38 SEC ; change_direction_x_minus &3be5 a9 00 LDA #&00 &3be7 f5 63 SBC &63,X ; enemies_speed_x &3be9 95 63 STA &63,X ; enemies_speed_x &3beb a9 01 LDA #&01 &3bed 9d 00 01 STA &0100,X ; enemies_frame_countdown &3bf0 60 RTS ; enemy_move_routine_one # Used for LIFT, GOOGLY_FACE and ROPE_CLIMBER &3bf1 b5 5b LDA &5b,X ; enemies_y # Move vertically within limits &3bf3 75 6b ADC &6b,X ; enemies_speed_y &3bf5 d5 7b CMP &7b,X ; enemies_minimum_y &3bf7 90 08 BCC &3c01 ; change_direction_y_plus &3bf9 dd 18 01 CMP &0118,X ; enemies_maximum_y &3bfc b0 04 BCS &3c02 ; change_direction_y_minus &3bfe 95 5b STA &5b,X ; enemies_y &3c00 60 RTS ; change_direction_y_plus &3c01 38 SEC ; change_direction_y_minus &3c02 a9 00 LDA #&00 &3c04 f5 6b SBC &6b,X ; enemies_speed_y &3c06 95 6b STA &6b,X ; enemies_speed_y &3c08 60 RTS ; enemy_move_routine_three # Used for BLOCK and BLOCK_BLUE, bounces between walls &3c09 bd 10 01 LDA &0110,X ; enemies_maximum_x # Actually enemy speed &3c0c 85 13 STA &13 ; enemy_speed ; move_block_loop &3c0e a6 1d LDX &1d ; enemy_to_consider &3c10 20 18 3c JSR &3c18 ; move_block &3c13 c6 13 DEC &13 ; enemy_speed &3c15 d0 f7 BNE &3c0e ; move_block_loop &3c17 60 RTS ; move_block &3c18 20 d0 3d JSR &3dd0 ; calculate_enemy_screen_addresses &3c1b a5 11 LDA &11 ; enemy_minimum_x # Actually direction of BLOCK &3c1d f0 3b BEQ &3c5a ; consider_moving_block_up # 0 = up, 1 = right, 2 = down, 3 = left &3c1f 4a LSR A &3c20 f0 0e BEQ &3c30 ; consider_moving_block_right &3c22 90 44 BCC &3c68 ; consider_moving_block_down # If BLOCK is moving left, &3c24 a0 00 LDY #&00 # Is there a wall to the left? &3c26 b1 02 LDA (&02),Y ; enemy_screen_address &3c28 11 04 ORA (&04),Y ; enemy_screen_address_middle &3c2a 30 17 BMI &3c43 ; collided_with_wall_horizontally ; move_block_left &3c2c a9 fe LDA #&fe # If not, keep moving left &3c2e d0 0a BNE &3c3a ; change_block_x_position ; consider_moving_block_right # If BLOCK is moving right, &3c30 a0 30 LDY #&30 # Is there a wall to the right? &3c32 b1 02 LDA (&02),Y ; enemy_screen_address &3c34 11 04 ORA (&04),Y ; enemy_screen_address_middle &3c36 30 0b BMI &3c43 ; collided_with_wall_horizontally ; move_block_right &3c38 a9 02 LDA #&02 # If not, keep moving right ; change_block_x_position &3c3a 18 CLC &3c3b a4 1d LDY &1d ; enemy_to_consider &3c3d 65 0f ADC &0f ; enemy_x &3c3f 99 53 00 STA &0053,Y ; enemies_x &3c42 60 RTS ; collided_with_wall_horizontally # If BLOCK collided with left or right wall, &3c43 a0 08 LDY #&08 # Is there a wall above? &3c45 b1 08 LDA (&08),Y ; enemy_screen_address_above &3c47 a0 28 LDY #&28 &3c49 11 08 ORA (&08),Y ; enemy_screen_address_above &3c4b 30 04 BMI &3c51 ; set_block_moving_down &3c4d a9 00 LDA #&00 ; up # If not, set it moving up &3c4f f0 02 BEQ &3c53 ; set_block_direction_vertically ; set_block_moving_down &3c51 a9 02 LDA #&02 ; down # If so, set it moving down ; set_block_direction_vertically &3c53 a4 1d LDY &1d ; enemy_to_consider &3c55 99 73 00 STA &0073,Y ; enemies_minimum_x # Set new direction &3c58 10 36 BPL &3c90 ; play_block_collision_sound # and leave with collision sound ; consider_moving_block_up # If BLOCK is moving up, &3c5a a0 08 LDY #&08 # Is there a wall above? &3c5c b1 08 LDA (&08),Y ; enemy_screen_address_above &3c5e a0 28 LDY #&28 &3c60 11 08 ORA (&08),Y ; enemy_screen_address_above &3c62 30 19 BMI &3c7d ; collided_with_wall_vertically ; move_block_up &3c64 a9 fc LDA #&fc # If not, keep moving up &3c66 d0 0c BNE &3c74 ; change_block_y_position ; consider_moving_block_down # If BLOCK is moving down, &3c68 a0 08 LDY #&08 # Is there a wall below? &3c6a b1 06 LDA (&06),Y ; enemy_screen_address_below &3c6c a0 28 LDY #&28 &3c6e 11 06 ORA (&06),Y ; enemy_screen_address_below &3c70 30 0b BMI &3c7d ; collided_with_wall_vertically &3c72 a9 04 LDA #&04 # If not, keep moving down ; change_block_y_position &3c74 18 CLC &3c75 a4 1d LDY &1d ; enemy_to_consider &3c77 65 10 ADC &10 ; enemy_y &3c79 99 5b 00 STA &005b,Y ; enemies_y &3c7c 60 RTS ; collided_with_wall_vertically # If BLOCK collided with wall above or below, &3c7d a0 00 LDY #&00 # Is there a wall to the left? &3c7f b1 02 LDA (&02),Y ; enemy_screen_address &3c81 11 04 ORA (&04),Y ; enemy_screen_address_middle &3c83 30 04 BMI &3c89 ; set_block_moving_right &3c85 a9 03 LDA #&03 ; left # If not, set moving left &3c87 d0 02 BNE &3c8b ; set_block_direction_horizontally &3c89 a9 01 LDA #&01 ; right # If so, set moving right ; set_block_direction_horizontally &3c8b a4 1d LDY &1d ; enemy_to_consider &3c8d 99 73 00 STA &0073,Y ; enemies_minimum_x # Set new direction ; play_block_collision_sound # and leave with collision sound &3c90 a9 01 LDA #&01 &3c92 a2 44 LDX #&44 &3c94 4c 33 3f JMP &3f33 ; play_sound_from_x_and_a ; enemy_move_routine_six # Used for MONK &3c97 b5 7b LDA &7b,X ; enemies_minimum_y # Actually palette for MONK &3c99 a0 01 LDY #&01 &3c9b 99 83 01 STA &0183,Y ; sprite_slots_palette_start # Set palette of all four MONK sprite slots &3c9e c8 INY &3c9f 99 83 01 STA &0183,Y ; sprite_slots_palette_start &3ca2 c8 INY &3ca3 99 83 01 STA &0183,Y ; sprite_slots_palette_start &3ca6 c8 INY &3ca7 99 83 01 STA &0183,Y ; sprite_slots_palette_start &3caa 20 d0 3d JSR &3dd0 ; calculate_enemy_screen_addresses &3cad a6 1d LDX &1d ; enemy_to_consider &3caf a5 11 LDA &11 ; enemy_minimum_x # Actually whether MONK is sinking into floor &3cb1 30 2a BMI &3cdd ; monk_is_sinking &3cb3 a5 47 LDA &47 ; spell_y # If MONK hasn't already been hit, &3cb5 38 SEC &3cb6 e9 04 SBC #&04 &3cb8 e5 10 SBC &10 ; enemy_y &3cba c9 08 CMP #&08 &3cbc b0 42 BCS &3d00 ; spell_didn't_hit &3cbe a5 46 LDA &46 ; spell_x &3cc0 b4 63 LDY &63,X ; enemies_speed_x &3cc2 30 02 BMI &3cc6 ; skip_subtraction # Account for movement of MONK &3cc4 e9 03 SBC #&03 ; skip_subtraction &3cc6 e5 0f SBC &0f ; enemy_x &3cc8 c9 06 CMP #&06 &3cca b0 34 BCS &3d00 ; spell_didn't_hit # Check if MONK has been hit &3ccc a9 ff LDA #&ff &3cce 95 73 STA &73,X ; enemies_minimum_x # If so, mark MONK as sinking into floor &3cd0 8d 02 40 STA &4002 ; spell_should_end # Mark spell as finished &3cd3 85 1d STA &1d ; enemy_to_consider # and don't update any other enemies &3cd5 a9 01 LDA #&01 &3cd7 20 0f 30 JSR &300f ; boost_player_energy &3cda 4c e5 3c JMP &3ce5 ; skip_replotting_monk ; monk_is_sinking &3cdd a5 10 LDA &10 ; enemy_y &3cdf 69 08 ADC #&08 &3ce1 29 f8 AND #&f8 &3ce3 d0 05 BNE &3cea ; set_monk_y ; skip_replotting_monk &3ce5 68 PLA # Don't replot MONK &3ce6 68 PLA &3ce7 4c cb 3b JMP &3bcb ; consider_next_enemy # but leave update_enemies ; set_monk_y &3cea 95 5b STA &5b,X ; enemies_y &3cec 29 f0 AND #&f0 &3cee 49 f1 EOR #&f1 &3cf0 a2 49 LDX #&49 &3cf2 20 33 3f JSR &3f33 ; play_sound_from_x_and_a # Play a sound for sinking MONK &3cf5 a5 4f LDA &4f ; pitch &3cf7 4a LSR A &3cf8 4a LSR A &3cf9 69 20 ADC #&20 &3cfb 85 4f STA &4f ; pitch &3cfd 4c 5b 3f JMP &3f5b ; play_sound_from_block ; spell_didn't_hit &3d00 a5 05 LDA &05 ; enemy_screen_address_middle_high # Allow for MONK being bigger than other enemies &3d02 69 04 ADC #&04 &3d04 85 05 STA &05 ; enemy_screen_address_middle_high &3d06 a5 07 LDA &07 ; enemy_screen_address_below_high &3d08 69 05 ADC #&05 &3d0a 85 07 STA &07 ; enemy_screen_address_below_high &3d0c a5 10 LDA &10 ; enemy_y &3d0e 69 10 ADC #&10 &3d10 85 10 STA &10 ; enemy_y &3d12 a6 1d LDX &1d ; enemy_to_consider &3d14 b5 7b LDA &7b,X ; enemies_minimum_y # Actually palette for MONK &3d16 c9 20 CMP #&20 # actually CMP palette_value_of_green_monk &3d18 f0 1c BEQ &3d36 ; check_whether_to_activate_green_monk &3d1a b0 30 BCS &3d4c ; enemy_move_routine_four_too # The green/cyan and cyan/white MONKs are always active &3d1c b5 5b LDA &5b,X ; enemies_y # The red/mangenta MONK &3d1e 69 24 ADC #&24 &3d20 e5 25 SBC &25 ; player_y &3d22 c9 40 CMP #&40 &3d24 b0 0f BCS &3d35 ; leave # needs both vertical &3d26 b5 53 LDA &53,X ; enemies_x &3d28 69 3e ADC #&3e &3d2a e5 24 SBC &24 ; player_x &3d2c c9 7a CMP #&7a &3d2e b0 05 BCS &3d35 ; leave # and horizontal proximity to be activated ; make_monk_active &3d30 a9 00 LDA #&00 &3d32 8d 17 3d STA &3d17 ; palette_value_of_green_monk ; leave &3d35 60 RTS ; check_whether_to_activate_green_monk # The green/yellow MONK &3d36 b5 53 LDA &53,X ; enemies_x &3d38 69 29 ADC #&29 # is activated by horizontal proximity &3d3a e5 24 SBC &24 ; player_x &3d3c c9 48 CMP #&48 &3d3e 90 f0 BCC &3d30 ; make_monk_active &3d40 60 RTS ; enemy_move_routine_five # Used for MUMMY &3d41 a5 2d LDA &2d ; object_in_room &3d43 c9 02 CMP #&02 # Is there a PHARAOH_MASK in the room? &3d45 90 ee BCC &3d35 ; leave # If so, MUMMY does not move ; enemy_move_routine_four # Used for PAINFUL_BALL, BENDY_LEGS, TEMPLE_GUARDIAN &3d47 20 d0 3d JSR &3dd0 ; calculate_enemy_screen_addresses # WITCH and OCTOPUS &3d4a a6 1d LDX &1d ; enemy_to_consider # Homes in on player, but doesn't go through walls ; enemy_move_routine_four_too &3d4c bd 10 01 LDA &0110,X ; enemies_maximum_x # Actually enemy speed &3d4f 25 41 AND &41 ; frame_timer &3d51 d0 e2 BNE &3d35 ; leave &3d53 a6 0f LDX &0f ; enemy_x &3d55 e4 24 CPX &24 ; player_x &3d57 f0 10 BEQ &3d69 ; no_horizontal_movement # No horizontal movement if aligned with player &3d59 b0 12 BCS &3d6d ; enemy_right_of_player ; enemy_left_of_player &3d5b a0 30 LDY #&30 # Is there a wall to the right? &3d5d b1 02 LDA (&02),Y ; enemy_screen_address &3d5f 11 04 ORA (&04),Y ; enemy_screen_address_middle &3d61 30 06 BMI &3d69 ; no_horizontal_movement &3d63 e8 INX # If not, move right two pixels &3d64 e8 INX &3d65 a9 10 LDA #&10 ; 4 pixels &3d67 d0 0f BNE &3d78 ; set_enemy_x ; no_horizontal_movement &3d69 a9 08 LDA #&08 ; 2 pixels &3d6b d0 13 BNE &3d80 ; set_left_offset ; enemy_right_of_player &3d6d a0 00 LDY #&00 # Is there a wall to the left? &3d6f b1 02 LDA (&02),Y ; enemy_screen_address &3d71 11 04 ORA (&04),Y ; enemy_screen_address_middle &3d73 30 f4 BMI &3d69 ; no_horizontal_movement &3d75 ca DEX # If not, move left two pixels &3d76 ca DEX &4d77 98 TYA ; 0 ; set_enemy_x &3d78 a4 1d LDY &1d ; enemy_to_consider &3d7a 96 53 STX &53,Y ; enemies_x &3d7c aa TAX &3d7d ca DEX &3d7e 96 63 STX &63,Y ; enemies_speed_x ; set_left_offset &3d80 85 12 STA &12 ; offset_of_left_of_sprite # Both offsets account for any horizontal move &3d82 09 20 ORA #&20 # + 8 pixels right &3d84 85 13 STA &13 ; offset_of_right_of_sprite &3d86 a8 TAY &3d87 b1 06 LDA (&06),Y ; enemy_screen_address_below # Is there anything below the enemy? &3d89 a4 12 LDY &12 ; offset_of_left_of_sprite &3d8b 11 06 ORA (&06),Y ; enemy_screen_address_below &3d8d a4 11 LDY &11 ; enemy_minimum_x # Actually whether enemy can levitate &3d8f d0 04 BNE &3d95 ; enemy_is_supported &3d91 29 c0 AND #&c0 &3d93 f0 08 BEQ &3d9d ; enemy_isn't_supported # If the enemy isn't supported, they fall ; enemy_is_supported &3d95 a4 10 LDY &10 ; enemy_y &3d97 c4 25 CPY &25 ; player_y &3d99 f0 34 BEQ &3dcf ; no_vertical_movement &3d9b b0 0b BCS &3da8 ; enemy_below_player ; enemy_isn't_supported ; enemy_above_player &3d9d a8 TAY &3d9e 30 2f BMI &3dcf ; leave # If there is nothing below the enemy, &3da0 a5 07 LDA &07 ; enemy_screen_address_below_high &3da2 30 2b BMI &3dcf ; leave # and the enemy isn't at the bottom of the screen, &3da4 a9 04 LDA #&04 # then move down four pixels &3da6 d0 20 BNE &3dc8 ; change_enemy_y ; enemy_below_player &3da8 a5 09 LDA &09 ; enemy_screen_address_above_high &3daa c9 49 CMP #&49 &3dac 90 21 BCC &3dcf ; leave # If the enemy isn't at the top of the screen, &3dae a4 12 LDY &12 ; offset_of_left_of_sprite &3db0 b1 08 LDA (&08),Y ; enemy_screen_address_above &3db2 a4 13 LDY &13 ; offset_of_right_of_sprite &3db4 11 08 ORA (&08),Y ; enemy_screen_address_above &3db6 30 17 BMI &3dcf ; leave # and there is nothing above the enemy, &3db8 a5 11 LDA &11 ; enemy_minimum_x &3dba d0 0a BNE &3dc6 ; move_enemy_up # If the enemy can't levitate, &3dbc b1 04 LDA (&04),Y ; enemy_screen_address_middle &3dbe a4 12 LDY &12 ; offset_of_left_of_sprite &3dc0 11 04 ORA (&04),Y ; enemy_screen_address_middle # is there something they can climb? &3dc2 29 c0 AND #&c0 &3dc4 f0 09 BEQ &3dcf ; leave ; move_enemy_up &3dc6 a9 fc LDA #&fc # Move up four pixels ; change_enemy_y &3dc8 18 CLC &3dc9 a6 1d LDX &1d ; enemy_to_consider &3dcb 75 5b ADC &5b,X ; enemies_y &3dcd 95 5b STA &5b,X ; enemies_y ; leave &3dcf 60 RTS ; calculate_enemy_screen_addresses &3dd0 b5 73 LDA &73,X ; enemies_minimum_x &3dd2 85 11 STA &11 ; enemy_minimum_x &3dd4 b4 5b LDY &5b,X ; enemies_y &3dd6 84 10 STY &10 ; enemy_y &3dd8 b5 53 LDA &53,X ; enemies_x &3dda 85 0f STA &0f ; enemy_x &3ddc aa TAX &3ddd ca DEX # Calculate the address two pixels to the left &3dde ca DEX &3ddf 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &3de2 a4 02 LDY &02 ; screen_address_low &3de4 84 06 STY &06 ; enemy_screen_address_below_low &3de6 a5 01 LDA &01 ; y &3de8 29 04 AND #&04 &3dea d0 0b BNE &3df7 ; not_on_group_boundary &3dec 98 TYA &3ded 69 84 ADC #&84 &3def 85 04 STA &04 ; enemy_screen_address_middle_low &3df1 a5 03 LDA &03 ; screen_address_high &3df3 69 02 ADC #&02 &3df5 d0 09 BNE &3e00 ; calculate_other_addresses ; not_on_group_boundary &3df7 98 TYA &3df8 29 f8 AND #&f8 &3dfa 85 04 STA &04 ; enemy_screen_address_middle_low &3dfc a5 03 LDA &03 ; screen_address_high &3dfe 69 05 ADC #&05 ; calculate_other_addresses &3e00 85 05 STA &05 ; enemy_screen_address_middle_high &3e02 e9 04 SBC #&04 &3e04 85 09 STA &09 ; enemy_screen_address_above_high &3e06 a5 03 LDA &03 ; screen_address_high &3e08 69 04 ADC #&04 &3e0a 85 07 STA &07 ; enemy_screen_address_below_high &3e0c a5 04 LDA &04 ; enemy_screen_address_low_one &3e0e 85 08 STA &08 ; enemy_screen_address_above_low &3e10 60 RTS ; enemy_move_routine_seven # Used for FIRE &3e11 a9 00 LDA #&00 # actually LDA full_bucket_removes_all_fires # If the player has put out one of the FIREs &3e13 d0 28 BNE &3e3d ; remove_enemy # in the East Fireplace, remove all of them &3e15 a5 24 LDA &24 ; player_x &3e17 69 11 ADC #&11 &3e19 f5 53 SBC &53,X ; enemies_x &3e1b c9 21 CMP #&21 &3e1d b0 24 BCS &3e43 ; to_enemy_move_routine_zero # Otherwise, check if the player is touching the FIRE &3e1f a5 25 LDA &25 ; player_y &3e21 69 18 ADC #&18 &3e23 f5 5b SBC &5b,X ; enemies_y &3e25 c9 28 CMP #&28 &3e27 b0 1a BCS &3e43 ; to_enemy_move_routine_zero &3e29 a9 0a LDA #&0a ; FULL_BUCKET # If so, are they carrying a FULL_BUCKET? &3e2b a2 09 LDX #&09 ; EMPTY_BUCKET &3e2d 20 32 40 JSR &4032 ; check_if_player_has_object_A_and_change_it_into_X &3e30 90 0f BCC &3e41 ; to_enemy_move_routine_zero_too # If so, change it to EMPTY_BUCKET and put out the FIRE &3e32 a5 37 LDA &37 ; player_room &3e34 c9 5d CMP #&5d ; East Fireplace # If the player is in East Fireplace, &3e36 d0 03 BNE &3e3b ; skip_all_fires # remove all the fires, not just the one that's touched &3e38 8d 12 3e STA &3e12 ; full_bucket_removes_all_fires ; skip_all_fires &3e3b a6 1d LDX &1d ; enemy_to_consider ; remove_enemy &3e3d a9 fc LDA #&fc # Remove the FIRE by putting it off-screen &3e3f 95 5b STA &5b,X ; enemies_y ; to_enemy_move_routine_zero_too &3e41 a6 1d LDX &1d ; enemy_to_consider ; to_enemy_move_routine_zero &3e43 18 CLC &3e44 4c d4 3b JMP &3bd4 ; enemy_move_routine_zero # Otherwise, move horizontally within limits ; enemy_move_routines_low_table &3e47 d4 f1 d0 09 47 41 97 11 ; enemy_move_routines_high_table &3e4f 3b 3b 3b 3c 3d 3d 3c 3e ; update_enemy_animation &3e57 a6 1d LDX &1d ; enemy_to_consider &3e59 de 00 01 DEC &0100,X ; enemies_frame_countdown &3e5c f0 03 BEQ &3e61 ; update_frame &3e5e b5 8b LDA &8b,X ; enemies_frame &3e60 60 RTS ; update_frame &3e61 b4 83 LDY &83,X ; enemies_sprite_slot &3e63 b9 53 01 LDA &0153,Y ; sprite_slots_animation_speed &3e66 9d 00 01 STA &0100,X ; enemies_frame_countdown &3e69 be 47 01 LDX &0147,Y ; sprite_slots_animation_type &3e6c bd 10 3f LDA &3f10,X ; enemy_animation_routines_low_table &3e6f 8d 8b 3e STA &3e8b ; enemy_animation_routine_low &3e72 bd 1b 3f LDA &3f1b,X ; enemy_animation_routines_high_table &3e75 8d 8c 3e STA &3e8c ; enemy_animation_routine_high &3e78 a2 00 LDX #&00 &3e7a a4 1d LDY &1d ; enemy_to_consider &3e7c b9 63 00 LDA &0063,Y ; enemies_speed_x &3e7f 30 05 BMI &3e86 ; moving_left &3e81 b9 6b 00 LDA &006b,Y ; enemies_speed_y &3e84 10 01 BPL &3e87 ; moving_up ; moving_left &3e86 e8 INX ; moving_up &3e87 86 00 STX &00 ; unused # Unused variable &3e89 18 CLC &3e8a 4c e7 03 JMP &03e7 # actually JMP enemy_animation_routine ; enemy_animation_routine_zero &3e8d a9 00 LDA #&00 # Sprite is always frame 0 &3e8f 60 RTS ; enemy_animation_routine_one # Unused code &3e90 8a TXA # Sprite depends on x and y direction &3e91 60 RTS ; enemy_animation_routine_two # Used for PAINFUL_BALL, GOOGLY_FACE, TENTACLES, &3e92 b9 8b 00 LDA &008b,Y ; enemies_frame # OCTOPUS, STARFISH and FLAG &3e95 49 01 EOR #&01 # Sprite flips between frames 0 and 1 &3e97 60 RTS ; enemy_animation_routine_three # Used for SNAKE, FIRE, BENDY_LEGS and MONK &3e98 b9 8b 00 LDA &008b,Y ; enemies_frame &3e9b 29 02 AND #&02 &3e9d 49 02 EOR #&02 # Sprite flips between frames 0 and 2 &3e9f b6 63 LDX &63,Y ; enemies_speed_x &3ea1 10 02 BPL &3ea5 ; leave &3ea3 69 01 ADC #&01 # or frames 1 and 3, depending on x direction ; leave &3ea5 60 RTS ; enemy_animation_routine_four # Used for MUMMY &3ea6 b9 8b 00 LDA &008b,Y ; enemies_frame &3ea9 29 01 AND #&01 &3eab 49 01 EOR #&01 # Sprite flips between frames 0 and 1 &3ead b6 6b LDX &6b,Y ; enemies_speed_y &3eaf 10 02 BPL &3eb3 ; leave &3eb1 69 02 ADC #&02 # or frames 2 and 3, depending on y direction ; leave &3eb3 60 RTS ; enemy_animation_routine_five # Used for BLOCK &3eb4 b9 08 01 LDA &0108,Y ; enemies_secondary_frame_countdown &3eb7 69 01 ADC #&01 &3eb9 29 03 AND #&03 &3ebb 99 08 01 STA &0108,Y ; enemies_secondary_frame_countdown &3ebe c9 03 CMP #&03 &3ec0 d0 02 BNE &3ec4 ; leave &3ec2 a9 01 LDA #&01 # Sprite rotates through frames 0, 1, 2 and 1 ; leave &3ec4 60 RTS ; enemy_animation_routine_six # Used for MAGIC, STEAM and TORCH &3ec5 b9 8b 00 LDA &008b,Y ; enemies_frame &3ec8 69 01 ADC #&01 # Sprite rotates through frames 0 to 3 &3eca 29 03 AND #&03 &3ecc 60 RTS ; enemy_animation_routine_seven # Used for LIFT &3ecd b6 8b LDX &8b,Y ; enemies_frame &3ecf 98 TYA # Bug: the LIFT always animates as though moving down &3ed0 30 09 BMI &3edb ; lift_moving_up &3ed2 e8 INX # If moving down, &3ed3 e0 03 CPX #&03 &3ed5 90 09 BCC &3ee0 ; set_lift_frame &3ed7 a2 00 LDX #&00 # Sprite rotates through frames 0 to 2 &3ed9 b0 05 BCS &3ee0 ; set_lift_frame ; lift_moving_up &3edb ca DEX # If moving up, &3edc 10 02 BPL &3ee0 ; set_lift_frame &3ede a2 02 LDX #&02 # Sprite rotates through frames 2 to 0 ; set_lift_frame &3ee0 8a TXA &3ee1 60 RTS ; enemy_animation_routine_eight # Used for ROPE_CLIMBER &3ee2 a2 00 LDX #&00 &3ee4 b9 6b 00 LDA &006b,Y ; enemies_speed_y &3ee7 10 10 BPL &3ef9 ; use_frame_zero # Sprite uses frame 0 if climbing down &3ee9 b9 08 01 LDA &0108,Y ; enemies_secondary_frame_countdown &3eec 38 SEC &3eed e9 01 SBC #&01 &3eef 10 02 BPL &3ef3 ; skip_reset &3ef1 a9 02 LDA #&02 ; skip_reset &3ef3 99 08 01 STA &0108,Y ; enemies_secondary_frame_countdown &3ef6 f0 01 BEQ &3ef9 ; use_frame_zero &3ef8 e8 INX # but frame 1 one in three times when climbing up ; use_frame_zero &3ef9 8a TXA &3efa 60 RTS ; enemy_animation_routine_nine # Used for PULSING_CIRCLES &3efb b6 8b LDX &8b,Y ; enemies_frame &3efd ca DEX # Sprite rotates through frames 2 to 0 &3efe 10 02 BPL &3f02 ; skip_reset &3f00 a2 02 LDX #&02 ; skip_reset &3f02 8a TXA &3f03 60 RTS ; enemy_animation_routine_ten # Used for STATUE &3f04 a2 00 LDX #&00 &3f06 b9 53 00 LDA &0053,Y ; enemies_x &3f09 c5 24 CMP &24 ; player_x # Sprite is chosen to face the player &3f0b b0 01 BCS &3f0e ; enemy_facing_left &3f0d e8 INX ; enemy_facing_left &3f0e 8a TXA &3f0f 60 RTS ; enemy_animation_routines_low_table &3f10 8d 90 92 98 a6 b4 c5 cd e2 fb 04 ; enemy_animation_routines_high_table &3f1b 3e 3e 3e 3e 3e 3e 3e 3e 3e 3e 3f ; set_background_colour_to_black &3f26 a9 07 LDA #&07 ; black ; set_background_colour &3f28 8d 21 fe STA &fe21 ; video ULA palette register &3f2b 09 80 ORA #&80 &3f2d 8d 21 fe STA &fe21 ; video ULA palette register &3f30 60 RTS ; play_sound_full_volume_noise &3f31 a2 00 LDX #&00 ; play_sound_from_x_and_a &3f33 a8 TAY &3f34 8a TXA # Highest six bits of X set volume &3f35 4a LSR A &3f36 4a LSR A &3f37 18 CLC &3f38 69 f1 ADC #&f1 &3f3a 85 4d STA &4d ; volume_low &3f3c a9 ff LDA #&ff &3f3e 69 00 ADC #&00 &3f40 85 4e STA &4e ; volume_high &3f42 8a TXA # Lowest two bits of X set channel &3f43 29 03 AND #&03 &3f45 aa TAX &3f46 09 10 ORA #&10 # Flush channel; play sound immediately &3f48 85 4b STA &4b ; channel &3f4a 98 TYA &3f4b 29 f0 AND #&f0 # High nibble of A sets pitch &3f4d ca DEX &3f4e 10 04 BPL &3f54 ; play_previous_sound_with_new_pitch # If channel 0 (noise), shift the pitch &3f50 4a LSR A &3f51 4a LSR A &3f52 4a LSR A &3f53 4a LSR A ; play_previous_sound_with_new_pitch &3f54 85 4f STA &4f ; pitch &3f56 98 TYA # Low nibble of A sets duration &3f57 29 0f AND #&0f &3f59 85 51 STA &51 ; duration ; play_sound_from_block &3f5b a2 4b LDX #&4b &3f5d a0 00 LDY #&00 ; &004b = sound_block &3f5f a9 07 LDA #&07 ; Generate a sound &3f61 4c f1 ff JMP &fff1 ; OSWORD ; handle_spell &3f64 46 4a LSR &4a ; spell_cooldown &3f66 a9 79 LDA #&79 ; Keyboard Scan &3f68 a2 e2 LDX #&e2 ; SPACE &3f6a 20 f4 ff JSR &fff4 ; OSBYTE &3f6d ca DEX &3f6e e8 INX &3f6f 30 08 BMI &3f79 ; player_pressed_spell # Has the player pressed SPACE &3f71 a2 80 LDX #&80 ; SHIFT &3f73 20 f4 ff JSR &fff4 ; OSBYTE &3f76 8a TXA &3f77 10 54 BPL &3fcd ; player_didn't_press_spell # or SHIFT? ; player_pressed_spell &3f79 a4 47 LDY &47 ; spell_y &3f7b f0 0f BEQ &3f8c ; no_spell_active &3f7d a5 4a LDA &4a ; spell_cooldown # If a spell is still active, &3f7f d0 4c BNE &3fcd ; player_didn't_press_spell # but wasn't recently fired, &3f81 a6 46 LDX &46 ; spell_x &3f83 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &3f86 20 1a 40 JSR &401a ; plot_spell # unplot it from the screen &3f89 20 12 40 JSR &4012 ; end_spell # and end it ; no_spell_active &3f8c a9 10 LDA #&10 &3f8e 85 4a STA &4a ; spell_cooldown &3f90 a5 26 LDA &26 ; player_sprite &3f92 c9 06 CMP #&06 ; jumping &3f94 b0 05 BCS &3f9b ; player_has_legs_up &3f96 c9 04 CMP #&04 ; up/down # Can't fire spell when climbing &3f98 b0 37 BCS &3fd1 ; leave &3f9a 4a LSR A # Calculate direction from player sprite ; player_has_legs_up &3f9b 4a LSR A &3f9c b0 06 BCS &3fa4 ; fire_spell_left ; fire_spell_right &3f9e a2 04 LDX #&04 # Spell move right 4 pixels per frame &3fa0 a9 06 LDA #&06 &3fa2 d0 05 BNE &3fa9 ; fire_spell ; fire_spell_left &3fa4 a2 fc LDX #&fc # Spell moves left 4 pixels per frame &3fa6 a9 00 LDA #&00 &3fa8 18 CLC ; fire_spell &3fa9 86 48 STX &48 ; spell_speed_x &3fab 65 24 ADC &24 ; player_x &3fad c9 9d CMP #&9d # Can't fire off sides of screen &3faf b0 20 BCS &3fd1 ; leave &3fb1 85 46 STA &46 ; spell_x &3fb3 a5 25 LDA &25 ; player_y &3fb5 18 CLC &3fb6 69 04 ADC #&04 &3fb8 c9 48 CMP #&48 # Can't fire when player's head is off screen &3fba 90 15 BCC &3fd1 ; leave &3fbc 85 47 STA &47 ; spell_y &3fbe a9 01 LDA #&01 &3fc0 20 1b 30 JSR &301b ; drain_player_energy # Firing spell drains 1 energy &3fc3 a9 42 LDA #&42 &3fc5 a2 08 LDX #&08 &3fc7 20 33 3f JSR &3f33 ; play_sound_from_x_and_a # Play sound for firing spell &3fca 4c 01 40 JMP &4001 ; update_or_end_spell ; player_didn't_press_spell &3fcd a5 47 LDA &47 ; spell_y &3fcf d0 01 BNE &3fd2 ; spell_active &3fd1 60 RTS ; spell_active &3fd2 a6 46 LDX &46 ; spell_x # Update any active spell &3fd4 a4 47 LDY &47 ; spell_y &3fd6 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &3fd9 a5 47 LDA &47 ; spell_y &3fdb 29 03 AND #&03 &3fdd a8 TAY &3fde b1 02 LDA (&02),Y ; screen_address # Unplot the spell from its previous position &3fe0 49 0f EOR #&0f ; YY &3fe2 91 02 STA (&02),Y ; screen_address &3fe4 98 TYA &3fe5 09 08 ORA #&08 # +2 pixels right &3fe7 a8 TAY &3fe8 b1 02 LDA (&02),Y ; screen_address &3fea 49 0f EOR #&0f ; YY &3fec 91 02 STA (&02),Y ; screen_address &3fee a5 46 LDA &46 ; spell_x &3ff0 65 48 ADC &48 ; spell_speed_x &3ff2 c9 9d CMP #&9d &3ff4 b0 1c BCS &4012 ; end_spell # Spell ends at left and right edges of screen &3ff6 85 46 STA &46 ; spell_x &3ff8 a4 01 LDY &01 ; y &3ffa c8 INY # Spell sinks a pixel per frame &3ffb c0 f8 CPY #&f8 &3ffd b0 13 BCS &4012 ; end_spell # Spell ends at bottom of screen &3fff 84 47 STY &47 ; spell_y ; update_or_end_spell &4001 a9 00 LDA #&00 # actually LDA spell_should_end &4003 30 0d BMI &4012 ; end_spell # End the spell if it hit a MONK &4005 a6 46 LDX &46 ; spell_x &4007 a4 47 LDY &47 ; spell_y &4009 20 04 25 JSR &2504 ; calculate_screen_address_from_X_and_Y &400c a0 00 LDY #&00 &400e b1 02 LDA (&02),Y ; screen_address &4010 10 08 BPL &401a ; plot_spell # Has the spell hit an obstacle? ; end_spell &4012 a9 00 LDA #&00 # If so, end spell &4014 85 47 STA &47 ; spell_y &4016 8d 02 40 STA &4002 ; spell_should_end &4019 60 RTS ; plot_spell &401a a5 47 LDA &47 ; spell_y &401c 29 03 AND #&03 &401e a8 TAY &401f b1 02 LDA (&02),Y ; screen_address # Plot the spell in its new position &4021 49 0f EOR #&0f ; YY &4023 91 02 STA (&02),Y ; screen_address &4025 98 TYA &4026 09 08 ORA #&08 # +2 pixels right &4028 a8 TAY &4029 b1 02 LDA (&02),Y ; screen_address &402b 49 0f EOR #&0f ; YY &402d 91 02 STA (&02),Y ; screen_address &402f 60 RTS ; check_if_player_has_object_A_and_remove_it &4030 a2 ff LDX #&ff ; check_if_player_has_object_A_and_change_it_into_X &4032 86 20 STX &20 ; replacement_object &4034 a4 2e LDY &2e ; object_in_pocket_one &4036 30 05 BMI &403d ; pocket_one_is_empty &4038 d9 a8 03 CMP &03a8,Y ; object_sprite_table &403b f0 0b BEQ &4048 ; pocket_one_matches # Is the player carrying object in either pocket? ; pocket_one_is_empty &403d a4 2f LDY &2f ; object_in_pocket_two &403f 30 05 BMI &4046 ; pocket_two_is_empty &4041 d9 a8 03 CMP &03a8,Y ; object_sprite_table &4044 f0 06 BEQ &404c ; pocket_two_matches ; object_in_pocket_two &4046 18 CLC # Carry clear = player wasn't carrying object &4047 60 RTS ; pocket_one_matches &4048 a2 8a LDX #&8a &404a d0 02 BNE &404e ; set_x ; pocket_two_matches &404c a2 96 LDX #&96 ; set_x &404e 86 21 STX &21 ; pocket_x &4050 84 22 STY &22 ; pocket_object &4052 aa TAX &4053 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &4056 a6 21 LDX &21 ; pocket_x &4058 20 66 25 JSR &2566 ; plot_object_in_pocket # Unplot the object from whichever pocket it was in &405b a6 22 LDX &22 ; pocket_object &405d a5 20 LDA &20 ; replacement_object &405f 9d a8 03 STA &03a8,X ; object_sprite_table &4062 aa TAX &4063 30 08 BMI &406d ; no_new_object &4065 20 ad 30 JSR &30ad ; prepare_sprite_in_slot_zero &4068 a6 21 LDX &21 ; pocket_x &406a 20 66 25 JSR &2566 ; plot_object_in_pocket # Plot the replacement object in that pocket ; no_new_object &406d a9 22 LDA #&22 &406f 20 31 3f JSR &3f31 ; play_sound_full_volume_noise # Play a sound to signal the change of object &4072 38 SEC # Carry set = player was carrying object &4073 60 RTS ; plot_ladder_rung &4074 38 SEC ; plot_ladder_rung_loop &4075 8a TXA &4076 91 02 STA (&02),Y ; screen_address &4078 98 TYA &4079 e9 08 SBC #&08 # Move left two pixels &407b a8 TAY &407c 10 f7 BPL &4075 ; plot_ladder_rung &407e 60 RTS ; split_byte_of_room_data &407f a4 1f LDY &1f ; room_data_offset &4081 b1 1d LDA (&1d),Y ; room_data_address # Get the next byte of room data &4083 e6 1f INC &1f ; room_data_offset ; split_byte_into_x_and_y &4085 aa TAX &4086 29 f0 AND #&f0 &4088 a8 TAY # Y = high nibble * 16 &4089 8a TXA &408a 29 0f AND #&0f &408c aa TAX &408d 0a ASL A &408e 85 04 STA &04 &4090 0a ASL A &4091 0a ASL A &4092 65 04 ADC &04 &4094 86 04 STX &04 ; low_nibble &4096 aa TAX # A = X = low_nibble * 10 &4097 60 RTS ; get_byte_of_room_data &4098 a4 1f LDY &1f ; room_data_offset &409a b1 1d LDA (&1d),Y ; room_data_address # Get the next byte of room data &409c e6 1f INC &1f ; room_data_offset &409e a8 TAY &409f 60 RTS ; tab_to_x_1 &40a0 a0 01 LDY #&01 # TAB(x, &01); ; tab_to_x_y &40a2 a9 1f LDA #&1f # TAB(x, y); ; plot_a_x_y_characters &40a4 20 ee ff JSR &ffee ; OSWRCH &40a7 8a TXA &40a8 20 ee ff JSR &ffee ; OSWRCH &40ab 98 TYA &40ac 4c ee ff JMP &ffee ; OSWRCH ; random_number_generator &40af a5 38 LDA &38 ; rnd_1 &40b1 29 48 AND #&48 &40b3 18 CLC &40b4 69 38 ADC #&38 &40b6 0a ASL A &40b7 0a ASL A &40b8 26 3a ROL &3a ; rnd_3 &40ba 26 39 ROL &39 ; rnd_2 &40bc 26 38 ROL &38 ; rnd_1 &40be a5 38 LDA &38 ; rnd_1 &40c0 60 RTS ; colours_as_pixel_values_table ; K R G Y B M C W &40c1 00 01 04 05 10 11 14 15 ; ladder_pixel_values_table &40c9 5c 4c ; climbable_GC climbable_GG &40cb 6d 4f ; climbable_CY climbable_YY &40cd 53 73 ; climbable_RM climbable_MM &40cf 5c 7c ; climbable_GC climbable_CC ; sprite_animation_speed_table ; + + + + + + - + - - - - - - - + # Many of these are unused &40d1 01 02 03 04 05 07 0a 0d 10 14 19 1e 28 3c 50 64 ; plot_line_vdu_string &40e1 00 00 00 00 55 19 ; VDU 23, &55 ; draw triangle, absolute co-ordinates, plot in background colour ; diagonally_moving_enemy_speed_table ; - + + + - - + + - - - - - - - # Most of these are unused &40e7 00 11 12 14 16 21 22 24 26 41 42 44 46 62 64 ; instruction_type_table &40f6 91 : STA (&??),Y &40f7 11 ; ORA (&??),Y # Unused &40f8 31 ; AND (&??),Y &40f9 51 ; EOR (&??),Y ; game_over_string &40fa 52 45 56 4f 20 20 45 4d 41 47 0c 05 1f ; TAB(&05, &0c); "GAME OVER" ; longer_delay &4107 a0 5a LDY #&5a ; longer_delay_loop &4109 20 10 41 JSR &4110 ; brief_delay &410c 88 DEY &410d d0 fa BNE &4109 ; longer_delay_loop &410f 60 RTS ; brief_delay &4110 ad 20 01 LDA &0120 ; event_timer &4113 c9 04 CMP #&04 &4115 90 f9 BCC &4110 ; brief_delay &4117 a9 00 LDA #&00 &4119 8d 20 01 STA &0120 ; event_timer &411c 60 RTS ; plot_room &411d 20 26 3f JSR &3f26 ; set_background_colour_to_black &4120 a9 06 LDA #&06 # R6: Vertical displayed register &4122 8d 00 fe STA &fe00 ; video register number &4125 a9 02 LDA #&02 # Limit display to title and status bar &4127 8d 01 fe STA &fe01 ; video register value &412a 20 23 34 JSR &3423 ; initialise_room_from_room_data &412d a9 d0 LDA #&d0 ; Welcome to.. &412f 85 45 STA &45 ; splash_countdown &4131 c5 37 CMP &37 ; player_room &4133 d0 0b BNE &4140 ; skip_title_screen_text &4135 a2 84 LDX #&84 # Plot text on title screen ; plot_title_screen_text_loop &4137 bd 6f 07 LDA &076f,X ; title_screen_text - 1 &413a 20 ee ff JSR &ffee ; OSWRCH &413d ca DEX &413e d0 f7 BNE &4137 ; plot_title_screen_text_loop ; skip_title_screen_text &4140 a9 06 LDA #&06 # R6: Vertical displayed register &4142 8d 00 fe STA &fe00 ; video register number &4145 a9 18 LDA #&18 # Restore display to room &4147 8d 01 fe STA &fe01 ; video register value &414a 60 RTS ; plot_splash &414b 29 01 AND #&01 # In rooms where there is a water surface, &414d a8 TAY # the SPLASH sprite always occupies slots 1 and 2 &414e c8 INY &414f 84 0b STY &0b ; splash_sprite_slot &4151 a5 44 LDA &44 ; splash_y &4153 85 01 STA &01 ; y &4155 a6 43 LDX &43 ; splash_x &4157 20 9a 25 JSR &259a ; plot_two_colour_sprite &415a a5 01 LDA &01 ; y &415c 18 CLC &415d 69 04 ADC #&04 &415f 85 01 STA &01 ; y &4161 a4 0b LDY &0b ; splash_sprite_slot &4163 4c 9c 25 JMP &259c ; plot_two_colour_sprite_with_previous_x ; update_score &4166 a5 40 LDA &40 ; score_pitch &4168 18 CLC &4169 69 10 ADC #&10 &416b 85 40 STA &40 ; score_pitch &416d a2 41 LDX #&41 &416f 20 33 3f JSR &3f33 ; play_sound_from_x_and_a # Play sounds of increasing pitch as score increases &4172 f8 SED &4173 18 CLC &4174 a5 3e LDA &3e ; player_score_as_bcd &4176 69 01 ADC #&01 &4178 85 3e STA &3e ; player_score_as_bcd &417a d8 CLD ; plot_score &417b a2 06 LDX #&06 &417d 86 00 STX &00 ; six &417f 20 a0 40 JSR &40a0 ; tab_to_x_1 &4182 a9 c3 LDA #&c3 ; CC &4184 85 d2 STA &d2 ; text_colour_byte_or &4186 85 d3 STA &d3 ; text_colour_byte_eor &4188 a5 3e LDA &3e ; player_score_as_bcd &418a 29 f0 AND #&f0 &418c 4a LSR A &418d 4a LSR A &418e 4a LSR A &418f 4a LSR A &4190 f0 02 BEQ &4194 ; leading_space &4192 09 10 ORA #&10 ; "0" - " " ; leading_space &4194 09 20 ORA #&20 ; " " &4196 a8 TAY &4197 20 ee ff JSR &ffee ; OSWRCH &419a a5 3e LDA &3e ; player_score_as_bcd &419c 29 0f AND #&0f &419e 09 30 ORA #&30 ; "0" &41a0 20 ee ff JSR &ffee ; OSWRCH &41a3 c6 3f DEC &3f ; player_score_to_be_added &41a5 d0 04 BNE &41ab ; more_score_still_to_be_added &41a7 a2 35 LDX #&35 # Reset pitch at end of scoring run &41a9 86 40 STX &40 ; score_pitch &41ab a6 3e LDX &3e ; player_score_as_bcd ; more_score_still_to_be_added &41ad e0 01 CPX #&01 # actually CPY high_score &41af b0 01 BCS &41b2 ; new_high_score # Is this a new high score? ; leave &41b1 60 RTS ; new_high_score &41b2 8d 70 07 STA &0770 ; high_score_low # If so, store it in the title screen text &41b5 8c 71 07 STY &0771 ; high_score_high &41b8 8e ae 41 STX &41ae ; high_score &41bb 8a TXA &41bc 45 00 EOR &00 ; six &41be c9 9f CMP #&9f # Has the player scored 99? (obfuscated check) &41c0 d0 ef BNE &41b1 ; leave &41c2 a2 55 LDX #&55 &41c4 a9 00 LDA #&00 ; zero_title_screen_text_loop # Wipe most of title screen text &41c6 9d 70 07 STA &0770,X ; title_screen_text # (keeping the two "CITADEL"s) &41c9 ca DEX &41ca 10 fa BPL &41c6 ; zero_title_screen_text_loop &41cc a2 42 LDX #&42 ; decrypt_completion_message_loop # Decrypt the (shorter) completion message &41ce 8a TXA &41cf 5d 00 09 EOR &0900,X ; encrypted_completion_message &41d2 49 a5 EOR #&a5 &41d4 9d 70 07 STA &0770,X ; title_screen_text # into the title screen text &41d7 ca DEX &41d8 10 f4 BPL &41ce ; decrypt_completion_message_loop &41da 20 07 41 JSR &4107 ; longer_delay &41dd 68 PLA # Remove update_score from stack &41de 68 PLA ; start_new_game # A new game starts here, via the title screen &41df a9 0e LDA #&0e # Unclear what this does &41e1 8d 08 03 STA &0308 ; left side of text window &41e4 a9 0c LDA #&0c ; CLS # Clear the screen &41e6 20 ee ff JSR &ffee ; OSWRCH &41e9 a9 00 LDA #&00 &41eb 8d 08 03 STA &0308 ; left side of text window &41ee a2 27 LDX #&27 ; initialise_objects_loop &41f0 bd 80 08 LDA &0880,X ; initial_object_room_table # Reset location and sprites of objects &41f3 9d 80 03 STA &0380,X ; object_room_table &41f6 bd c8 04 LDA &04c8,X ; initial_object_sprite_table &41f9 9d a8 03 STA &03a8,X ; object_sprite_table &41fc ca DEX &41fd 10 f1 BPL &41f0 ; initialise_objects_loop &41ff a2 27 LDX #&27 # Player starts with two null objects in pockets &4201 86 2e STX &2e ; object_in_pocket_one &4203 ca DEX &4204 86 2f STX &2f ; object_in_pocket_two &4206 a9 00 LDA #&00 &4208 a2 0a LDX #&0a ; reset_puzzle_states_loop # Mark all switches unset, all crystals uncollected, &420a 9d f4 07 STA &07f4,X ; puzzle_states # and all puzzled uncompleted &420d ca DEX &420e 10 fa BPL &420a ; reset_puzzle_states_loop &4210 a2 07 LDX #&07 ; reset_doors_opened_loop # Mark all doors as unopened &4212 9d a8 08 STA &08a8,X ; doors_opened &4215 ca DEX &4216 10 fa BPL &4212 ; reset_doors_opened_loop &4218 a2 0f LDX #&0f ; reset_energy_collected_loop # Mark all energy as uncollected &421a 9d f0 04 STA &04f0,X ; energy_collected_table &421d ca DEX &421e 10 fa BPL &421a ; reset_energy_collected_loop &4220 8d 2c 01 STA &012c ; radiation_countdown # Reset various other game state &4223 85 42 STA &42 ; player_death_countdown &4225 85 9a STA &9a ; pain_level &4227 85 47 STA &47 ; spell_y &4229 85 26 STA &26 ; player_sprite &422b a9 03 LDA #&03 &422d 8d fd 07 STA &07fd ; bones_still_needed_in_cauldron &4230 a9 46 LDA #&46 &4232 85 24 STA &24 ; player_x &4234 a9 d0 LDA #&d0 &4236 85 25 STA &25 ; player_y &4238 a9 00 LDA #&00 &423a 85 2a STA &2a ; player_jump_up_speed &423c 85 29 STA &29 ; duration_of_player_fall &423e 8d 2d 01 STA &012d ; room_x &4241 8d 2e 01 STA &012e ; room_y &4244 a9 ff LDA #&ff # Player can't press ESCAPE in title screen &4246 8d 0a 27 STA &270a ; escape_key ; use_welcome_screen_room &4249 a2 d0 LDX #&d0 ; Welcome to.. # Title screen starts on "Welcome to.." room &424b d0 17 BNE &4264 ; set_title_screen_room ; new_title_screen &424d a0 1f LDY #&1f # actually LDY title_screen_room_offset &424f c8 INY &4250 98 TYA &4251 29 1f AND #&1f &4253 a8 TAY &4254 a6 37 LDX &37 ; player_room &4256 e0 d0 CPX #&d0 ; "Welcome to.." &4258 f0 04 BEQ &425e ; set_title_screen_room_offset &425a 29 03 AND #&03 &425c f0 eb BEQ &4249 ; use_welcome_screen_room # Every four rooms, insert "Welcome to.." room ; set_title_screen_room_offset &425e 8c 4e 42 STY &424e ; title_screen_room_offset &4261 be 50 07 LDX &0750,Y ; title_screen_rooms ; set_title_screen_room &4264 86 37 STX &37 ; player_room &4266 20 1d 41 JSR &411d ; plot_room &4269 a9 46 LDA #&46 &426b 85 23 STA &23 ; title_screen_timer # Display each room for a fixed length of time ; title_screen_loop &426d 20 10 41 JSR &4110 ; brief_delay &4270 20 74 3b JSR &3b74 ; update_enemies &4273 e6 41 INC &41 ; frame_timer &4275 20 af 40 JSR &40af ; random_number_generator &4278 20 f9 26 JSR &26f9 ; handle_player_input # Check if the player has pressed anything &427b a5 35 LDA &35 ; player_pressed_action &427d f0 06 BEQ &4285 ; start_game # If they pressed ACTION, start the game &427f c6 23 DEC &23 ; title_screen_timer &4281 d0 ea BNE &426d ; title_screen_loop &4283 f0 c8 BEQ &424d ; new_title_screen # Otherwise, continue looping through rooms ; start_game &4285 a9 50 LDA #&50 # Player starts with 150 energy &4287 85 96 STA &96 ; player_energy_low &4289 a9 01 LDA #&01 &428b 85 97 STA &97 ; player_energy_high &428d 85 3f STA &3f ; player_score_to_be_added &428f a9 00 LDA #&00 # Player starts with 0 score &4291 85 3e STA &3e ; player_score_as_bcd &4293 20 0f 30 JSR &300f ; boost_player_energy &4296 20 7b 41 JSR &417b ; plot_score &4299 a9 1b LDA #&1b &429b 8d 0a 27 STA &270a ; escape_key # Enable ESCAPE when playing game &429e a2 83 LDX #&83 ; "Main Hall" # Player starts in Main Hall &42a0 8a TXA &42a1 45 3e EOR &3e ; player_score_as_bcd &42a3 45 96 EOR &96 ; player_energy_low &42a5 45 97 EOR &97 ; player_energy_high &42a7 c9 d2 CMP #&d2 # Check no cheating has occurred &42a9 d0 da BNE &4285 ; start_game # Infinite loop if starting position modified ; change_room_number_prior_to_entry # Stick various edges of the map together &42ab e0 7a CPX #&7a ; east of "The Island" &42ad d0 02 BNE &42b1 ; not_island_east &42af a2 c9 LDX #&c9 ; "The Island" ; not_island_east &42b1 e0 c8 CPX #&c8 ; west of "The Island" &42b3 d0 02 BNE &42b7 ; not_island_west &42b5 a2 79 LDX #&79 ; "The Island" ; not_island_west &42b7 e0 63 CPX #&63 ; west of "The Desert" &42b9 d0 02 BNE &42bd ; not_desert_west &42bb a2 ef LDX #&ef ; "The Desert" ; not_desert_west &42bd e0 f0 CPX #&f0 ; east of "The Desert" &42bf d0 02 BNE &42c3 ; not_desert_east &42c1 a2 64 LDX #&64 ; "The Desert" ; not_desert_east &42c3 e0 7d CPX #&7d ; above "Witch's House" (inside) &42c5 d0 0a BNE &42d1 ; set_player_room # If the player is leaving Witch's House, &42c7 a2 68 LDX #&68 ; "Witch's House" (outside) &42c9 a9 5a LDA #&5a # put them in the doorway &42cb 85 24 STA &24 ; player_x &42cd a9 d0 LDA #&d0 &42cf 85 25 STA &25 ; player_y ; set_player_room &42d1 86 37 STX &37 ; player_room &42d3 20 1d 41 JSR &411d ; plot_room &42d6 a5 2a LDA &2a ; player_jump_up_speed &42d8 8d 23 01 STA &0123 ; player_jump_up_speed_on_entry_to_room &42db a5 26 LDA &26 ; player_sprite &42dd 8d 22 01 STA &0122 ; player_sprite_on_entry_to_room &42e0 a5 24 LDA &24 ; player_x &42e2 8d 24 01 STA &0124 ; player_entry_x &42e5 85 27 STA &27 ; previous_player_x &42e7 a9 fc LDA #&fc # No need to unplot the player on entry &42e9 85 28 STA &28 ; previous_player_y &42eb 25 25 AND &25 ; player_y &42ed 8d 25 01 STA &0125 ; player_entry_y &42f0 a9 00 LDA #&00 &42f2 8d 21 01 STA &0121 ; player_sprite_frame &42f5 20 2a 2c JSR &2c2a ; plot_player ; main_game_loop &42f8 20 f9 26 JSR &26f9 ; handle_player_input # Check if the player has pressed anything &42fb a5 9a LDA &9a ; pain_level &42fd 30 4e BMI &434d ; not_changing_room &42ff a5 25 LDA &25 ; player_y # If the player has gone beyond the edge of a room, &4301 c9 40 CMP #&40 # change rooms accordingly &4303 b0 09 BCS &430e ; not_at_top_edge_of_room &4305 ee 2e 01 INC &012e ; room_y &4308 a0 f0 LDY #&f0 &430a a9 ec LDA #&ec &430c d0 0b BNE &4319 ; change_room_vertically ; not_at_top_edge_of_room &430e c9 f4 CMP #&f4 &4310 90 0e BCC &4320 ; not_at_bottom_edge_of_room &4312 ce 2e 01 DEC &012e ; room_y &4315 a0 40 LDY #&40 &4317 a9 13 LDA #&13 ; change_room_vertically &4319 65 37 ADC &37 ; player_room &431b aa TAX &431c 84 25 STY &25 ; player_y &431e d0 2a BNE &434a ; to_change_room_number_prior_to_entry ; not_at_bottom_edge_of_room &4320 a5 24 LDA &24 ; player_x &4322 d0 0e BNE &4332 ; not_at_left_edge_of_room &4324 a5 34 LDA &34 ; player_pressed_left &4326 f0 25 BEQ &434d ; not_changing_room &4328 a6 37 LDX &37 ; player_room &432a ca DEX &432b a0 96 LDY #&96 &432d 18 CLC &432e a9 99 LDA #&99 &4330 d0 0e BNE &4340 ; change_room_horizontally ; not_at_left_edge_of_room &4332 c9 96 CMP #&96 &4334 90 17 BCC &434d ; not_at_right_edge_of_room &4336 a5 32 LDA &32 ; player_pressed_right &4338 f0 13 BEQ &434d ; not_changing_room &433a a6 37 LDX &37 ; player_room &433c e8 INX &433d a0 00 LDY #&00 &433f 98 TYA ; change_room_horizontally &4340 f8 SED &4341 6d 2d 01 ADC &012d ; room_x &4344 8d 2d 01 STA &012d ; room_x &4347 d8 CLD &4348 84 24 STY &24 ; player_x ; to_change_room_number_prior_to_entry &434a 4c ab 42 JMP &42ab ; change_room_number_prior_to_entry ; not_at_right_edge_of_room ; not_changing_room &434d a5 42 LDA &42 ; player_death_countdown # If the player is dying, &434f f0 43 BEQ &4394 ; player_still_alive &4351 a9 ff LDA #&ff # Player can't press ESCAPE &4353 8d 0a 27 STA &270a ; escape_key &4356 20 26 3f JSR &3f26 ; set_background_colour_to_black &4359 a9 c1 LDA #&c1 ; CW &435b 85 d2 STA &d2 ; text_colour_byte_or &435d 85 d3 STA &d3 ; text_colour_byte_eor &435f a2 0c LDX #&0c ; plot_game_over_loop # Plot "GAME OVER" &4361 bd fa 40 LDA &40fa,X ; game_over_string &4364 20 ee ff JSR &ffee ; OSWRCH &4367 ca DEX &4368 10 f7 BPL &4361 ; plot_game_over_loop &436a a9 00 LDA #&00 &436c a2 45 LDX #&45 &436e 20 33 3f JSR &3f33 ; play_sound_from_x_and_a &4371 a5 25 LDA &25 ; player_y &4373 69 04 ADC #&04 &4375 b0 13 BCS &438a ; player_has_sunk_off_screen &4377 85 25 STA &25 ; player_y &4379 85 9a STA &9a ; pain_level &437b 49 ff EOR #&ff &437d a0 0f LDY #&0f &437f 20 54 3f JSR &3f54 ; play_previous_sound_with_new_pitch # Play sound for sinking player &4382 a9 7f LDA #&7f &4384 20 31 3f JSR &3f31 ; play_sound_full_volume_noise &4387 20 2a 2c JSR &2c2a ; plot_player # Update sinking player ; player_has_sunk_off_screen &438a c6 42 DEC &42 ; player_death_countdown &438c d0 03 BNE &4391 ; to_next_frame &438e 4c df 41 JMP &41df ; start_new_game # Return to the title screen when player finally dies ; to_next_frame &4391 4c b0 43 JMP &43b0 ; next_frame # Otherwise update death animation ; player_still_alive # If the player is still alive, &4394 a9 13 LDA #&13 ; Wait for Vertical Retrace &4396 20 f4 ff JSR &fff4 ; OSBYTE &4399 20 67 27 JSR &2767 ; handle_player_update # Handle their movement &439c ce 2c 01 DEC &012c ; radiation_countdown &439f d0 0c BNE &43ad ; skip_drain_from_radiation &43a1 a9 01 LDA #&01 &43a3 20 1b 30 JSR &301b ; drain_player_energy # Drain 1 energy every 256 frames &43a6 a9 c1 LDA #&c1 &43a8 a2 49 LDX #&49 &43aa 20 33 3f JSR &3f33 ; play_sound_from_x_and_a # Play sound for radiation energy loss ; skip_drain_from_radiation &43ad 20 64 3f JSR &3f64 ; handle_spell # Update any spell ; next_frame &43b0 e6 41 INC &41 ; frame_timer &43b2 a5 41 LDA &41 ; frame_timer &43b4 4a LSR A &43b5 b0 07 BCS &43be ; skip_score_change # Score gets updated one in every two frames &43b7 a5 3f LDA &3f ; player_score_to_be_added &43b9 f0 03 BEQ &43be ; skip_score_change # But only if it has changed &43bb 20 66 41 JSR &4166 ; update_score ; skip_score_change &43be 20 af 40 JSR &40af ; random_number_generator # Encourage the random generator to be random &43c1 a5 45 LDA &45 ; splash_countdown &43c3 30 10 BMI &43d5 ; skip_plotting_splash # If the player has splashed water, &43c5 c9 03 CMP #&03 &43c7 f0 03 BEQ &43cc ; skip_unplotting_splash &43c9 20 4b 41 JSR &414b ; plot_splash # Unplot the previous splash ; skip_unplotting_splash &43cc c6 45 DEC &45 ; splash_countdown &43ce 30 05 BMI &43d5 ; skip_plotting_splash &43d0 a5 45 LDA &45 ; splash_countdown &43d2 20 4b 41 JSR &414b ; plot_splash # Plot a new splash ; skip_plotting_splash &43d5 20 10 41 JSR &4110 ; brief_delay &43d8 20 74 3b JSR &3b74 ; update_enemies # Handle enemy movement &43db a9 05 LDA #&05 # R5: Vertical total adjust register &43dd 8d 00 fe STA &fe00 ; video register number &43e0 a9 00 LDA #&00 # Reset any offset added from "bump" &43e2 8d 01 fe STA &fe01 ; video register value &43e5 4c f8 42 JMP &42f8 ; main_game_loop ; unused &43e8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &43f8 00 00 00 00 00 00 00 00 ; citam_entry_point # This is where CITAL enters CITAM &4400 a5 8a LDA &8a ; keys_from_loader # &4400 - &7fff is subsequently used as screen memory &4402 f0 16 BEQ &441a ; use_joystick # If the player has chosen to use keyboard control, &4404 a0 04 LDY #&04 ; copy_key_table_loop # copy the keys chosen &4406 b9 8a 00 LDA &008a,Y ; keys_from_loader &4409 99 62 27 STA &2762,Y ; key_table &440c 88 DEY &440d 10 f7 BPL &4406 ; copy_key_table_loop &440f a0 21 LDY #&21 ; copy_keyboard_handling_routine_loop # and a keyboard handling routine over the joystick one &4411 b9 9e 44 LDA &449e,Y ; keyboard_handling_routine &4414 99 31 27 STA &2731,Y ; joystick_handling_routine &4417 88 DEY &4418 10 f7 BPL &4411 ; copy_keyboard_handling_routine_loop ; use_joystick &441a a5 88 LDA &88 ; cheat_4 # By default, ENERGY_GREEN gains 30 energy &441c d0 26 BNE &4444 ; skip_changing_energy_boosts # and ENERGY_RED gains 50 energy &441e a5 86 LDA &86 ; cheat_2 &4420 c9 23 CMP #&23 # Setting various zero page values before running &4422 d0 20 BNE &4444 ; skip_changing_energy_boosts # CITAL allows these values to be increased; a cheat &4424 a5 87 LDA &87 ; cheat_3 &4426 c9 19 CMP #&19 &4428 d0 1a BNE &4444 ; skip_changing_energy_boosts # If &85 = &29, &86 = &23, &87 = &19 and &88 = &17, &442a a2 65 LDX #&65 # ENERGY_GREEN and ENERGY_RED both gain 65 energy &442c a5 85 LDA &85 ; cheat_1 &442e c9 29 CMP #&29 &4430 f0 0c BEQ &443e ; set_energy_boosts &4432 c9 89 CMP #&89 &4434 d0 0e BNE &4444 ; skip_changing_energy_boosts &4436 a5 89 LDA &89 ; cheat_5 &4438 c9 97 CMP #&97 &443a d0 08 BNE &4444 ; skip_changing_energy_boosts # If &85 = &89 instead, and &89 = &97 as well, &443c a2 95 LDX #&95 # ENERGY_GREEN and ENERGY_RED both gain 95 energy ; set_energy_boosts &443e 8e 89 2b STX &2b89 ; green_energy_boost &4441 8e 8f 2b STX &2b8f ; red_energy_boost ; skip_changing_energy_boosts &4444 a9 00 LDA #&00 &4446 a2 9f LDX #&9f ; wipe_zero_page_loop # Wipe &0000 - &009e &4448 ca DEX &4449 95 00 STA &00,X &444b d0 fb BNE &4448 ; wipe_zero_page_loop &444d a2 c0 LDX #&c0 ; wipe_first_page_loop # Wipe &0100 - &01bf &444f ca DEX &4450 9d 00 01 STA &0100,X &4453 d0 fa BNE &444f ; wipe_first_page_loop &4455 a9 ff LDA #&ff # Initialise random number generator &4457 85 38 STA &38 ; rnd_1 &4459 a9 0f LDA #&0f &445b 85 39 STA &39 ; rnd_2 &445d 85 3a STA &3a ; rnd_3 &445f a9 50 LDA #&50 # Set initial energy and score for title screen &4461 85 96 STA &96 ; player_energy_low &4463 a9 01 LDA #&01 &4465 85 97 STA &97 ; player_energy_high &4467 85 3f STA &3f ; player_score_to_be_added &4469 a9 00 LDA #&00 &446b 85 3e STA &3e ; player_score_as_bcd &446d a0 1f LDY #&1f ; move_memory_4481_loop # Move &4481 - &44a0 to &0380 -&039f &446f b9 81 44 LDA &4481,Y ; unrelocated_initialisation_code &4472 99 80 03 STA &0380,Y ; initialisation_code &4475 88 DEY &4476 10 f7 BPL &446f ; move_memory_4481_loop &4478 a9 f3 LDA #&f3 ; GG &447a 85 d2 STA &d2 ; text_colour_byte_or &447c 85 d3 STA &d3 ; text_colour_byte_eor &447e 4c 80 03 JMP &0380 ; initialisation_code # then run it # &4481 - &44a0 is moved to &0380 - &039f at &446f ; initialisation_code &0380 a0 04 LDY #&04 # Clear the screen, and plot a ":" ; loop &0382 b9 98 03 LDA &0398,Y ; characters &0385 20 ee ff JSR &ffee ; OSWRCH &0388 88 DEY &0389 10 f7 BPL &0380 ; code_to_copy &038b a5 3e LDA &3e ; player_score_as_bcd # Another check for cheating? &038d d0 f1 BNE &0382 ; loop # Infinite loop &038f 20 0f 30 JSR &300f ; boost_player_energy &0392 20 7b 41 JSR &417b ; plot_score # Plot energy and score for title screen &0395 4c df 41 JMP &41df ; start_new_game # Start title screen loop ; characters &0398 3a 01 0b 1f 0c ; CLS; TAB(&0b, &01); ":" ; keyboard_handling_routine # Copied over joystick_handling_routine &449e a0 04 LDY #&04 &44a0 84 01 STY &01 ; check_for_keys_loop &44a2 a9 79 LDA #&79 ; Keyboard Scan &44a4 a4 01 LDY &01 &44a6 be 62 27 LDX &2762,Y ; key_table &44a9 20 f4 ff JSR &fff4 ; OSBYTE &44ac 8a TXA &44ad 29 80 AND #&80 &44af a4 01 LDY &01 &44b1 99 31 00 STA &0031,Y ; player_pressed_keys &44b4 c6 01 DEC &01 &44b6 10 ea BPL &44a2 ; check_for_keys_loop &44b8 a5 35 LDA &35 ; player_pressed_action &44ba 49 80 EOR #&80 &44bc 85 35 STA &35 ; player_pressed_action &44be 60 RTS ; unused # Not meaningful as code, encoded or decoded &44bf 8e c4 93 6e f0 79 85 58 b0 c0 26 91 36 89 ca f7 &44cf 05 7f a9 b6 5b 81 ab de 77 74 6b 5b 74 8c 8e b7 &44df 5f 05 0e 64 6b 8f d2 31 0e 31 6b f9 e6 47 e3 93 &44ef 85 8f f3 20 eb 5f 8d cf b4 f8 a3 5b 58 44 e1 75 ; checksum_from_citam &44ff 15