Contraption disassembly ======================= Contraption was written by Dave and Helen Mann, and published by Icon Software for the BBC Micro in 1985. It is a platform game in which a professor must collect golden apples to feed the machine which gives the game its title. 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. Interesting pokes ================= &1992 = &a5 infinite lives &197b = &85, &197c = &98 move to next level by pressing DELETE Tape protection disassembly =========================== ; CONTRAP ; 001900 001900 0001ab 1 *TV255 # Move display down one line 2*L.CONPIC 30VDU22,1, # Change to MODE 1 19;6;0; # Set colour 0 to cyan 19,1,0;0; # Set colour 1 to black 19,2,1,0;0, # Set colour 2 to red 19,3,3,0;0, # Set colour 3 to yellow 23;6,25,0;0;0; 31 VDU23;7,32,0;0;0; # R7: Vertical sync position 35HIMEM=&2400: Z=0:FOR X=0 TO 5*640 STEP640: # Plot contraption sprite Y%=&3F:X%=2:!&80=X+&4D10:!&84=Z+&27C0: # &27c0 = contraption_sprite + &100 CALL&2E40:Z=Z+&140:NEXT # &2e40 = copy_memory 180Z=0:FOR X=0 TO 3*640 STEP640: # Plot icon sprite Y%=&AF:X%=1:!&80=X+&35D8:!&84=Z+&2400: # &2400 = icon_sprite CALL&2E40:Z=Z+&B0:NEXT # &2e40 = copy_memory 240COLOUR1:PRINTTAB(15,6);"SOFTWARE" 250PRINTTAB(9,18);"By Dave & Helen Mann" 260 COLOUR2:PRINTTAB(15,9);"Presents" 270VDU17,3, # Change to colour 3 28,11,24,39,19,: # Define text window x:(11, 39), y:(19, 24) PRINT'''' 275 VDU23;8,&C1,0;0;0; # R8: Interlace and delay register 280 CALL&2F60 # &2f60 = load_and_run_game ; CONPIC ; 002400 002400 000bff ; icon_sprite &2400 00 00 00 01 13 37 37 37 03 37 7f ef cf 9f 1f 1f &2410 0f ff ff 0f 0f ff ff ff 0f ff ff 0f 0f cf cf cf &2420 0f ff ff 0f 0f 0f 0f 0f 0f ff ff 0f 0f 3f 7f ff &2430 0f ff ff 0f 0f ff ff ff 0f ff ff 0f 0f ef ff ff &2440 0f ff ff 0f 0f 0f 0f 8f 0f ff ff 0f 0f 0f 0f 0f &2450 0f ff ff 0f 0f 0f 0f 1f 0f ff ff 0f 0f 7f ff ff &2460 0f ff ff 0f 0f ff ff ff 0f ff ff 0f 0f cf ef ff &2470 0f ff ff 0f 0f 0f 0f 0f 0f ff ff 0f 0f 3f 3f 3f &2480 0f ff ff 0f 0f ef ff ff 0f ff ff 0f 0f 0f 0f 8f &2490 0f ff ff 0f 0f 3f 3f 3f 0f ff ff 0f 0f ff ff ff &24a0 0e ef ff 3f 1f 8f 8f 8f 00 00 08 8c ce ce ce ce &24b0 37 37 37 37 37 37 37 37 1f 1f 1f 1f 1f 1f 1f 1f &24c0 ff ff ff ff ff ff ff ff cf cf cf cf cf cf cf cf &24d0 1f 3f 7f ff ff ff ff ff ff ff ff ff ff ff ef ef &24e0 ff ff ff ff 8f 0f 0f 0f ff ff ff ff ff 7f 3f 0f &24f0 cf ef ff ff ff ff ff 0f 0f 0f 0f 9f 9f 9f 9f 1f &2500 3f 7f ff ff ff ff ff ff ff ff ff ff ff ef cf cf &2510 ff ff ff ff 1f 0f 0f 0f ff ff ff ff ff ff 7f 7f &2520 8f cf ef ff ff ff ff ff 3f 3f 3f 3f 3f 3f 3f 3f &2530 ff ff ff ff ff ff ff ff cf ef ff ff ff ff ff ff &2540 3f 3f 3f bf ff ff ff ff ff ff ff ff ff ff ff ff &2550 8f 8f 8f 8f 8f 8f 8f 8f ce ce ce ce ce ce ce ce &2560 37 37 37 37 37 37 37 37 1f 1f 1f 1f 1f 1f 1f 1f &2570 ff ff ff ff ff ff ff ff cf cf cf cf cf cf cf cf &2580 ff ff ff ff 7f 3f 1f 0f ef ff ff ff ff ff ff ff &2590 0f 0f 8f ff ff ff ff ff 3f 7f ff ff ff ff ff ff &25a0 ff ff ff ff ff ef cf 8f 9f 9f 9f 9f 0f 0f 0f 0f &25b0 ff ff ff ff ff 7f 3f 1f cf ef ff ff ff ff ff ff &25c0 0f 0f 1f ff ff ff ff ff 7f ff ff ff ff ff ff ff &25d0 ff ff ff ff ef cf 8f 0f 3f 3f 3f 3f 3f 3f 3f 3f &25e0 ff ff ff ff ff ff ff ff ff ff bf 9f 8f 8f 8f 8f &25f0 ff ff ff ff ff 7f 3f 1f ff ff ff ff ff ff ff ff &2600 8f 8f 8f 8f 8f 8f 8f 8f ce ce ce ce ce ce ce ce &2610 37 37 13 01 00 00 00 00 1f 8f cf ff 7f 07 00 00 &2620 ff 0f 0f ff ff 0f 00 00 cf 0f 0f ff ff 0f 00 00 &2630 0f 0f 0f ff ff 0f 00 00 7f 0f 0f ff ff 0f 00 00 &2640 ff 0f 0f ff ff 0f 00 00 ff 0f 0f ff ff 0f 00 00 &2650 0f 0f 0f ff ff 0f 00 00 0f 0f 0f ff ff 0f 00 00 &2660 0f 0f 0f ff ff 0f 00 00 ff 0f 0f ff ff 0f 00 00 &2670 ff 0f 0f ff ff 0f 00 00 ef 0f 0f ff ff 0f 00 00 &2680 0f 0f 0f ff ff 0f 00 00 3f 0f 0f ff ff 0f 00 00 &2690 ff 0f 0f ff ff 0f 00 00 8f 0f 0f ff ff 0f 00 00 &26a0 0f 0f 0f ff ff 0f 00 00 ff 0f 0f ff ff 0f 00 00 &26b0 8f 1f 3f ff ef 0e 00 00 ce ce 8c 08 00 00 00 00 ; contraption_sprite &26c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &26d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &26e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &26f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2700 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2710 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2720 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2730 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2740 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2750 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2760 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2770 00 00 00 00 00 00 00 00 00 00 00 00 00 01 13 13 &2780 00 00 00 04 4b 78 bc bc 00 00 00 00 08 87 e1 c2 &2790 00 00 01 16 34 1a 13 25 00 00 10 3b b1 ef 0e c2 &27a0 00 00 00 80 80 08 00 00 00 00 00 00 00 00 00 00 &27b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &27c0 00 00 00 00 00 00 00 00 00 00 03 03 25 25 69 69 &27d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &27e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &27f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2820 00 00 00 00 00 00 00 00 00 00 00 00 00 47 37 13 &2830 00 00 00 00 00 00 08 09 00 00 00 00 00 00 00 0e &2840 00 00 00 03 37 36 7f 7f 00 00 00 0c cf f7 fd fe &2850 00 00 00 00 00 08 8c ce 00 00 00 03 13 13 13 13 &2860 00 00 00 0f 8f 78 78 bc 00 00 00 07 78 f0 f0 f0 &2870 00 00 07 78 78 f0 78 b4 00 00 0e a5 f0 d2 d2 87 &2880 00 00 00 08 84 c3 f0 3c 00 00 01 13 17 7f 7f 2f &2890 00 00 0f ff ff bf df 67 00 00 0e af 7f 7f 0f 01 &28a0 00 00 00 2f cf 7f ff 6f 00 00 00 00 00 08 8c 8c &28b0 00 00 01 01 00 00 00 00 37 6f ff cf 7f 5f 7f 7f &28c0 bc de 5e de bc 78 69 69 c2 84 84 84 08 08 00 00 &28d0 34 78 78 78 34 12 12 34 e1 e1 f0 f0 f0 f0 f0 f0 &28e0 00 00 08 08 0b b7 b7 b7 00 00 00 00 03 6f 6f ef &28f0 00 00 00 00 8f af af ef 00 00 00 00 0b bf bf bf &2900 01 01 13 13 1b 93 b7 b7 e1 ed ef ef ce ce ce ce &2910 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2920 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 00 &2930 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 &2950 00 00 01 13 37 7f 6f ff 00 08 8c ce ef ff 0f ff &2960 00 00 00 00 09 9e de ef 13 03 34 69 f0 f0 f0 f0 &2970 9e bc 5e 3c f0 f0 f0 f0 e1 f0 f0 f1 f0 f0 f0 f0 &2980 1f e1 f8 f8 fc f6 f6 f1 ff ff 7f 7f b7 b7 b7 d3 &2990 ef ef ff ff ff ff ff ff 13 13 1b 9f df df df ff &29a0 bc bc cf ff ff ff fb fb c3 0c 08 08 08 08 08 08 &29b0 0f 37 37 15 15 37 37 37 6f ef ef ef ef ef ef ef &29c0 01 00 00 00 00 00 00 00 d3 5b 17 7f 6f 7f 7f 37 &29d0 6f 8e 8c ce 46 4e 8c 8c 00 00 01 01 01 01 00 01 &29e0 7f 3f cf ff 3f ff 1f ff 0c 8c 8c 08 8d 9d 9d 19 &29f0 01 13 37 7f ef de bc 8f ff ff bf 3f d3 d3 d2 7f &2a00 69 ac ac 8e af f7 ef ce 01 12 1a 3c f0 78 f0 c3 &2a10 78 f0 f0 f0 f0 c3 1f 13 f0 f0 f0 e1 1f ff ff ff &2a20 b7 b7 7f ff fe fb ff ff ff ff 8f ff ff ff ff fd &2a30 ef ff 0f ff ff ff ff ff ff ff 0f 6f ef ef df d7 &2a40 7f 7f ff ff ff ff ff ff 8c 9e bc bc 78 7f 7f 7f &2a50 0f f0 f0 f0 f0 f0 f8 fc 0e e1 e1 d3 d3 95 a6 b7 &2a60 6f dd 77 ff ff ff ff ef 08 8c ce af af 6f 6f ef &2a70 00 00 00 00 01 01 02 13 00 00 00 00 4c 8e ef ff &2a80 00 00 00 01 13 37 7f 5f 13 37 7f ff ff ff bf bf &2a90 ff ff ef ce 8c 08 08 0c ff 3f 13 01 00 00 00 00 &2aa0 ff af 9f 7f 2f 5a 34 34 78 bc bc 3c f0 f0 f0 f0 &2ab0 f0 f0 f0 f0 f0 f0 f0 f1 f0 f0 f0 f0 f4 fd fd f9 &2ac0 f1 f0 f0 f0 f0 f8 fc fc d3 d3 d3 d3 b7 b7 b7 7f &2ad0 75 77 f3 1b 1b 1b 09 09 ff ff ff ff ff ff ff ff &2ae0 fb fb ff ff ff ff ff ff 08 08 08 08 08 08 08 08 &2af0 37 37 37 37 37 37 37 37 ef ef ef ef ef ef ef ef &2b00 00 00 00 00 00 00 00 00 5f 6f 7f 17 6f 7f 7f 8f &2b10 ce 0c ce ce 4e 08 8c 8c 13 13 37 7f 7f 7f 3f 7f &2b20 df ef ef 4e 8c 08 8c 8c 3b 13 01 01 01 12 12 12 &2b30 ff ff 0f f0 f0 f0 f0 f0 ff cf 2d e1 e1 e1 e0 c2 &2b40 8d ce ce ce ce ce 4e 4e 0c 00 00 00 00 00 00 00 &2b50 01 00 00 00 00 00 00 00 ff 7f 17 01 00 00 00 00 &2b60 ff ff ff ff 7f 37 37 37 f7 ff ff ff ff ef ef ef &2b70 fd ff cf 8c 08 00 00 00 9f 1b 13 37 37 37 37 7f &2b80 ff ef ef ef ef ce ce ce 7f ff 77 76 70 f0 f0 f0 &2b90 fc fe ef e3 e3 d3 d3 b6 7f 7f bb ff ff fd ff ef &2ba0 ef df df bf bf 5b 5b d3 ef ef ef ef ef ef df df &2bb0 37 37 7f 6e ff 77 ff ff ef ef ce ce 8c 8c 08 08 &2bc0 27 13 01 01 00 00 00 00 6f df bf 7f 7f 7f 37 37 &2bd0 8c ce ce ef ef ff ff ff 00 00 00 00 01 1b bf ff &2be0 12 03 01 17 7f df ef ff f0 3c de de de af 6f 8c &2bf0 f1 f0 f0 f0 0f 00 00 00 fb f3 f0 e1 0e 00 00 00 &2c00 fc e9 97 7f 37 36 36 37 7f ff ff ff ff ff ff ef &2c10 08 08 08 08 08 08 08 08 7f 7e 36 36 13 13 01 00 &2c20 ff ff fd fb ff ef 0e 00 08 08 08 08 08 00 00 00 &2c30 37 37 36 35 36 35 36 35 ef ef ef ef ef ef ef ef &2c40 00 00 00 00 00 00 00 00 7f 37 3f cf 7f 1f 6f 3f &2c50 8c ce ce 0c ce ce 4e 6f 7f 17 37 13 01 01 00 00 &2c60 8c 0e ef ff 3f ff 5f 6f 20 01 08 8c ce 6e 8c 00 &2c70 f0 f0 f0 1e 03 00 00 00 84 84 84 08 08 00 00 00 &2c80 4e 06 02 02 02 02 02 00 00 00 00 00 00 00 00 00 &2c90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2ca0 37 37 36 35 37 37 37 37 ef eb ef ef ef ed ef ef &2cb0 00 00 01 01 01 01 01 01 7f 7f ff ff ff ff fb f0 &2cc0 ce 9c 8d 8c 8c 08 08 08 f0 f0 f0 2d 03 01 01 01 &2cd0 b7 7f 7f ff ff fd ff 3f ef e7 de de de bc ad 8c &2ce0 d3 d3 e1 e1 e1 85 1b 13 bf bf 7d 7f ff fe ff ff &2cf0 ab ef ce ce 8c 8c 08 08 00 00 00 00 00 00 00 00 &2d00 00 00 00 00 00 00 00 00 13 13 01 01 00 00 00 00 &2d10 ff 8f ff ff 7f 6f 06 00 ff 3f ef ce 0c 00 00 00 &2d20 ef 8e 08 00 00 00 00 00 08 00 00 00 00 00 00 00 &2d30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2d40 03 00 00 00 00 00 00 00 0e 00 00 00 00 00 00 00 &2d50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2d60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2d70 36 35 03 00 00 00 00 00 eb e5 0e 00 00 00 00 00 &2d80 11 01 00 00 00 00 00 00 e3 af 00 00 00 00 00 00 &2d90 be ce 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2da0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2db0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2dc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2dd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2de0 37 6f 6f 7f 07 00 00 00 ef df 3f ff 0f 00 00 00 &2df0 00 08 08 08 00 00 00 00 0f 00 00 00 00 00 00 00 &2e00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2e10 03 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 &2e20 37 37 03 00 00 00 00 00 ef eb ce 0e 00 00 00 00 &2e30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; copy_memory &2e40 b1 84 LDA (&84),Y ; source_address &2e42 91 80 STA (&80),Y ; target_address &2e44 84 7f STY &7f ; offset &2e46 88 DEY &2e47 c4 7f CPY &7f ; offset &2e49 90 f5 BCC &2e40 ; copy_memory &2e4b c6 85 DEC &85 ; source_address_high &2e4d c6 81 DEC &81 ; target_address_high &2e4f ca DEX &2e50 d0 ee BNE &2e40 ; copy_memory &2e52 60 RTS ; unused_copy_memory # &2e53 - &2e65 is a copy of &2e40 - &2e52 &2e53 b1 84 LDA (&84),Y ; source_address &2e55 91 80 STA (&80),Y ; target_address &2e57 84 7f STY &7f ; offset &2e59 88 DEY &2e5a c4 7f CPY &7f ; offset &2e5c 90 f5 BCC &2e53 ; unused_copy_memory &2e5e c6 85 DEC &85 ; source_address_high &2e60 c6 81 DEC &81 ; target_address_high &2e62 ca DEX &2e63 d0 ee BNE &2e53 ; unused_copy_memory &2e65 60 RTS ; unused # Source code fragment, corresponds to &1267 - &1282 &2e66 58 3a 4c 44 41 20 78 73 63 72 0d # ... X:LDA xscr of main binary &2e71 04 e2 0f 20 4a 53 52 20 66 61 73 74 70 6c 0d # 1250 JSR fastpl &2e80 04 e7 17 20 4c 44 41 20 23 26 34 30 3a 53 54 41 # 1255 LDA #&40:STA fsedx &2e90 20 66 73 65 64 78 0d &2e97 04 ec 0d 20 4c 44 41 20 78 73 63 72 0d # 1260 LDA xscr &2ea4 04 f6 10 20 53 45 43 3a 53 42 43 20 23 26 38 0d # 1270 SEC:SBC #&8 &2eb4 05 00 15 20 53 54 41 20 78 73 63 72 3a 43 4d 50 # 1280 STA xscr:CMP #&A &2ec4 20 23 26 41 0d &2ec9 05 0a 10 20 42 43 53 20 66 69 6e 70 6c 6f 74 0d # 1290 BCS finplot &2ed9 05 0f 18 20 4c 44 58 20 70 69 6c 65 73 3a 4a 53 # 1295 LDX piles:JSR plot1 &2ee9 52 20 70 6c 6f 74 31 0d &2ef1 05 10 17 20 4c 44 41 20 23 26 31 30 3a 53 # 1296 LDA #&10:S ... ; unused &2eff 00 ; load_trap1_string &2f00 4c 2e 54 52 41 50 31 20 34 30 30 0d 30 0d 00 00 ; "L.TRAP1 400" ; load_trap2_string &2f10 4c 2e 54 52 41 50 32 0d 00 00 00 00 00 00 00 00 ; "L.TRAP2" ; load_trap3_string &2f20 4c 2e 54 52 41 50 33 0d 32 30 30 0d 00 00 00 00 ; "L.TRAP3" ; load_trap4_string &2f30 4c 2e 54 52 41 50 34 20 37 32 30 30 0d 0d 00 00 ; "L.TRAP4 7200" ; run_lastbit_string &2f40 52 55 4e 20 4c 41 53 54 42 49 54 0d 30 0d 00 00 ; "RUN LASTBIT ; unused &2f50 52 55 4e 20 57 48 4f 50 0d 0d 00 00 00 00 00 00 ; "RUN WHOP" ; load_and_run_game &2f60 a9 c8 LDA #&c8 ; Read/Write BREAK/ESCAPE effect &2f62 a0 00 LDY #&00 &2f64 a2 03 LDX #&03 ; Clear memory on next RESET &2f66 20 f4 ff JSR &fff4 ; OSBYTE &2f69 a9 b2 LDA #&b2 &2f6b 8d 20 02 STA &0220 ; event_vector_low &2f6e a9 2f LDA #&2f ; &2fb2 = event_handler &2f70 8d 21 02 STA &0221 ; event_vector_high &2f73 a9 0e LDA #&0e ; Enable event &2f75 a2 04 LDX #&04 ; vsync event &2f77 20 f4 ff JSR &fff4 ; OSBYTE &2f7a a9 0e LDA #&0e ; Enable event &2f7c a2 05 LDX #&05 ; interval timer crossing zero event &2f7e 20 f4 ff JSR &fff4 ; OSBYTE &2f81 a0 2f LDY #&2f ; &2f00 = load_trap1_string # Load TRAP1 at &0400 - &08ff &2f83 a2 00 LDX #&00 &2f85 20 f7 ff JSR &fff7 ; OSCLI &2f88 a9 0d LDA #&0d ; Disable event &2f8a a2 04 LDX #&04 ; vsync event &2f8c 20 f4 ff JSR &fff4 ; OSBYTE &2f8f a9 0d LDA #&0d ; Disable event &2f91 a2 05 LDX #&05 ; interval timer crossing zero event &2f93 20 f4 ff JSR &fff4 ; OSBYTE &2f96 a0 2f LDY #&2f ; &2f10 = load_trap2_string # Load TRAP2 at &0b00 - &0cff &2f98 a2 10 LDX #&10 &2f9a 20 f7 ff JSR &fff7 ; OSCLI &2f9d a0 2f LDY #&2f ; &2f20 = load_trap3_string # Load TRAP3 at &0000 - &009f &2f9f a2 20 LDX #&20 &2fa1 20 f7 ff JSR &fff7 ; OSCLI &2fa4 a0 2f LDY #&2f ; &2f30 = load_trap4_string # Load TRAP4 at &7200 - &7eff &2fa6 a2 30 LDX #&30 &2fa8 20 f7 ff JSR &fff7 ; OSCLI &2fab a0 2f LDY #&2f ; &2f40 = run_lastbit_string # Load LASTBIT at &0e00 - &2fff, and run &2fad a2 40 LDX #&40 &2faf 20 f7 ff JSR &fff7 ; OSCLI # Never returns ; event_handler &2fb2 08 PHP &2fb3 48 PHA &2fb4 8a TXA &2fb5 48 PHA &2fb6 98 TYA &2fb7 48 PHA &2fb8 ad ca 03 LDA &03ca ; tape_block_flag &2fbb 29 fe AND #&fe # Remove protection bit from block &2fbd 8d ca 03 STA &03ca ; tape_block_flag # (allowing it to be loaded, rather than run) &2fc0 a9 00 LDA #&00 &2fc2 8d c7 03 STA &03c7 ; tape_block_number_high &2fc5 68 PLA &2fc6 a8 TAY &2fc7 68 PLA &2fc8 aa TAX &2fc9 68 PLA &2fca 28 PLP &2fcb 60 RTS ; unused &2fcc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2fd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2fe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2ff0 00 00 00 00 Game disassembly ================ # TRAP3 is loaded at &0000 - &009f ; unused &0000 9a 42 a2 42 00 70 00 70 00 00 01 e4 41 01 00 00 &0010 aa 03 9a 42 05 00 33 b4 40 e3 41 01 00 40 00 00 &0020 00 90 3f ff 00 00 00 0f ff 37 9d 42 00 00 00 00 &0030 85 a8 00 00 00 00 08 9d 42 05 00 00 00 85 a0 00 &0040 00 00 00 00 00 00 00 00 00 00 &004a 06 ; apples_total # All used values are overwritten &004b 08 ; contraption_screen_level_data_address_high &004c 05 ; contraption_screen_level_data_offset &004d ff ; enemy_sprite_offset &004e fa ; apples_to_drop &004f 23 ; player_can_drop_apples &0050 13 ; player_lives &0051 0a ; previous_level_data_address_high &0052 0a ; previous_level_data_offset &0053 80 ; levels_left_in_round &0054 54 ; previous_score_thousands &0055 0b ; allow_player_movement &0056 00 ; frames &0057 00 ; (unused) &0058 00 ; nibble_to_use &0059 00 ; player_is_riding_platform &005a 1d ; first_level_data_address_high &005b 08 ; first_level_data_offset &005c 13 ; player_hit_obstacle_above &005d 01 ; bird_bounce_cooldown &005e 9d ; bird_bounce_stage &005f 00 ; player_wants_to_start_game &0060 00 ; first_piston_tile_offset &0061 05 ; number_of_visible_pistons &0062 68 ; maximum_first_piston_tile_offset &0063 00 ; minimum_first_piston_tile_offset &0064 0f ; pistons_maximum_frame &0065 07 ; pistons_frame &0066 ff ; pistons_current_direction &0067 01 ; pistons_other_direction &0068 03 ; number_of_enemies &0069 01 ; enemy_to_consider &006a 09 ; enemy_flags &006b df ; jump_or_fall_initial_y &006c 11 ; maximum_safe_fall_distance &006d 05 ; apples_remaining &006e 00 ; door_tile_type &006f 09 ; sprite_y_offset &0070 00 ; (unused) &0071 00 ; player_horizontal_movement &0072 40 ; player_x &0073 d7 ; player_y &0074 08 ; player_jump_or_fall_stage &0075 00 ; (unused) &0076 03 ; maximum_player_jump_or_fall_stage_cooldown &0077 2d ; player_jump_or_fall_stage_cooldown &0078 08 ; player_initial_jump_or_fall_stage &0079 00 ; unused_variable &007a ff ; player_is_jumping &007b b8 ; byte, group, physical_colour, rank score_offset, tmp &007c 4a ; previous_player_x &007d d7 ; previous_player_y &007e 20 ; player_feet_sprite_address_low &007f 20 ; previous_player_feet_sprite_address_low &0080 7c ; level_data_offset &0081 00 ; level_data_address_low # except &0081, which must be &00 &0082 2b ; level_data_address_high &0083 fc ; tile_x, x_position &0084 10 ; tile_y &0085 1f ; tile_offset &0086 01 ; high_nibble &0087 ff ; (unused) &0088 ff ; suppress_jump &0089 00 ; previous_player_head_sprite_address_low &008a 2f ; previous_player_feet_sprite_address_high &008b 2f ; player_feet_sprite_address_high &008c 00 ; player_head_sprite_address_low &008d ff ; (unused) &008e 00 ; group &008f 01 ; player_foot_animation_cooldown &0090 f9 ; screen_address_low &0091 4f ; screen_address_high &0092 d3 ; sprite_address_low &0093 23 ; sprite_address_high &0094 40 ; sprite_size_in_bytes &0095 20 ; sprite_width_in_bytes &0096 30 ; minimum_screen_address_high &0097 73 ; (unused) &0098 74 ; player_was_killed &0099 ff ; (unused) &009a 10 ; side_tile_type &009b ff ; (unused) &009c 00 ; count, run_length, tmp_x &009d 08 ; length_of_tile_data, tmp_y &009e 01 ; direction &009f 00 ; piston_or_falling_platform_tile_offset # TRAP1 is loaded at &0400 - &08ff ; bird_left_sprite_0 &0400 01 0f 06 00 12 f0 6f 00 12 0f 6f 00 01 01 86 00 &0410 00 12 c2 00 00 34 e9 00 00 78 f0 08 00 7a f0 08 &0420 00 78 f0 08 00 f1 f0 08 00 34 e1 00 00 03 0e 00 &0430 00 00 0c 00 00 00 0c 00 00 00 06 00 00 01 0f 08 ; bird_left_sprite_1 &0440 07 0d 08 00 78 d3 8c 00 4b 1f 8c 00 04 25 08 00 &0450 00 78 08 00 01 f2 84 00 12 f0 c2 00 12 f8 c2 00 &0460 12 f0 c2 00 30 f4 c2 00 01 f0 84 00 00 0f 08 00 &0470 00 03 00 00 00 03 00 00 00 01 08 00 00 07 0e 00 ; bird_right_sprite_0 &0480 00 06 0f 08 00 6f f0 84 00 6f 0f 84 00 16 08 08 &0490 00 34 84 00 00 79 c2 00 01 f0 e1 00 01 f0 e5 00 &04a0 01 f0 e1 00 01 f0 f8 00 00 78 c2 00 00 07 0c 00 &04b0 00 03 00 00 00 03 00 00 00 06 00 00 01 0f 08 00 ; bird_right_sprite_1 &04c0 01 0b 0e 00 13 bc e1 00 13 8f 2d 00 01 4a 02 00 &04d0 01 e1 00 00 12 f4 08 00 34 f0 84 00 34 f1 84 00 &04e0 34 f0 84 00 34 f2 c0 00 12 f0 08 00 01 0f 00 00 &04f0 00 0c 00 00 00 0c 00 00 01 08 00 00 07 0e 00 00 ; chan vol pitch dur ; sound_0 # Collecting apple &0500 01 00 01 00 50 00 02 00 ; sound_1 # Walking &0508 00 00 f7 ff 02 00 01 00 ; sound_2 # Jumping &0510 12 00 02 00 64 00 02 00 ; sound_3 # Player dying one &0518 12 00 03 00 90 00 02 00 ; sound_4 # Player dying two &0520 13 00 03 00 64 00 02 00 ; unused # Unused &0528 00 00 04 00 06 00 01 00 ; unused # &0530 - &053f is a copy of &1130 - &113f &0530 a5 90 LDA &90 ; screen_address_low &0532 e9 17 SBC #&17 &0534 85 90 STA &90 ; screen_address_low &0536 b0 02 BCS &053a ; skip_page &0538 c6 91 DEC &91 ; screen_address_high ; skip_page &053a a5 93 LDA &93 ; sprite_address_high &053c 8d 50 11 STA &1150 ; source_address_high &053f a5 LDA ... # Would be LDA &92 ; sprite_address_low ; unused &0540 8c ; bathtub_sprite &0541 00 00 00 00 07 08 00 00 00 07 7f 8c 00 00 00 78 &0551 c7 ce 33 00 00 07 cf ce 11 ee 00 00 7f 8c 11 22 &0561 00 01 ff 08 11 00 00 13 ff 08 17 0f 0f 0f 0f 0e &0571 7f ff ff ff ff ef 07 f0 f0 f0 f0 86 13 ff ff ff &0581 ff 8c 13 ff ff ff ff 8c 13 f7 ff ff ff 8c 13 fb &0591 fb fb f6 8c 01 f6 fe fd fd 08 00 0f 0f 0f 0f 00 &05a1 02 ; unused # &05a2 - &05ba is similar to &1167 - &117f. Compare: &05a2 c6 91 DEC &91 ; screen_address_high &05a4 29 07 AND #&07 &05a6 c9 07 CMP #&07 &05a8 d0 e4 BNE &058e ; plot_sprite_row_loop # &116d d0 dd BNE &114c ; plot_sprite_row_loop &05aa a5 90 LDA &90 ; screen_address_low &05ac 38 SEC &05ad e9 78 SBC #&78 # &1172 e9 38 SBC #&38 &05af 85 90 STA &90 ; screen_address_low &05b1 a5 91 LDA &91 ; screen_address_high &05b3 e9 02 SBC #&02 &05b5 85 91 STA &91 ; screen_address_high &05b7 c5 97 CMP &97 # &117c c5 96 CMP &96 ; minimum_screen_address_high &05b9 b0 d3 BCS &058e ; plot_sprite_row_loop # &117e b0 cc BCS &114c ; plot_sprite_row_loop &05bb 4c 55 11 JMP &1155 # &1180 60 RTS ; unused &05be 20 ; unused &05bf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &05cf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &05df 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &05ef 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &05ff 00 ; unused # &0600 - &061f is a copy of &0620 - &063f &0600 08 PHP &0601 c9 04 CMP #&04 &0603 d0 65 BNE &066a ; leave &0605 48 PHA &0606 8a TXA &0607 48 PHA &0608 98 TYA &0609 48 PHA &060a a9 4e LDA #&4e &060c 8d 69 fe STA &fe69 ; User VIA timer 2 counter MSB &060f ad 8a 02 LDA &028a ; music_playing &0612 f0 3d BEQ &0651 ; skip_note &0614 ad 8c 06 LDA &068c ; enable_music &0617 f0 38 BEQ &0651 ; skip_note &0619 ce 97 06 DEC &0697 ; note_cooldown &061c ad 97 06 LDA &0697 ; note_cooldown &061f d0 BNE ... ; event_handler &0620 08 PHP &0621 c9 04 CMP #&04 # Is this a v-sync event? &0623 d0 65 BNE &068a ; leave &0625 48 PHA &0626 8a TXA &0627 48 PHA &0628 98 TYA &0629 48 PHA &062a a9 4e LDA #&4e # Reset timer at v-sync &062c 8d 69 fe STA &fe69 ; User VIA timer 2 counter MSB &062f ad 8a 02 LDA &028a ; music_playing &0632 f0 3d BEQ &0671 ; skip_note &0634 ad 8c 06 LDA &068c ; enable_music &0637 f0 38 BEQ &0671 ; skip_note &0639 ce 97 06 DEC &0697 ; note_cooldown &063c ad 97 06 LDA &0697 ; note_cooldown &063f d0 30 BNE &0671 ; skip_note &0641 a9 06 LDA #&06 &0643 8d 97 06 STA &0697 ; note_cooldown &0646 ae 8b 02 LDX &028b ; note_offset &0649 bd 98 06 LDA &0698,X ; music_data &064c 8d 92 06 STA &0692 ; music_sound + 4 # Set pitch of note &064f a2 8e LDX #&8e &0651 a0 06 LDY #&06 ; &068e = music_sound &0653 a9 07 LDA #&07 ; Generate a sound (SOUND) &0655 20 f1 ff JSR &fff1 ; OSWORD # Play note &0658 ad 8d 06 LDA &068d ; note_first &065b 49 ff EOR #&ff &065d 8d 8d 06 STA &068d ; note_first &0660 f0 0f BEQ &0671 ; skip_note &0662 ee 8b 02 INC &028b ; note_offset &0665 ad 8b 02 LDA &028b ; note_offset &0668 c9 a7 CMP #&a7 &066a d0 05 BNE &0671 ; skip_note # Is this the end of the tune? &066c a9 00 LDA #&00 &066e 8d 8b 02 STA &028b ; note_offset # If so, return to start ; skip_note &0671 a5 ec LDA &ec ; os_most_recently_pressed_key &0673 c9 d1 CMP #&d1 ; S &0675 d0 05 BNE &067c ; s_not_pressed &0677 a9 01 LDA #&01 # Set to non-zero to enable music &0679 8d 8c 06 STA &068c ; enable_music ; s_not_pressed &067c c9 90 CMP #&90 ; Q &067e d0 05 BNE &0685 ; q_not_pressed &0680 a9 00 LDA #&00 # Set to zero to disable music &0682 8d 8c 06 STA &068c ; enable_music ; q_not_pressed &0685 68 PLA &0686 a8 TAY &0687 68 PLA &0688 aa TAX &0689 68 PLA ; leave &068a 28 PLP &068b 60 RTS ; enable_music &068c 01 ; note_first &068d 00 ; music_sound ; chan vol pitch dur &068e 13 00 04 00 14 00 02 00 ; unused &0696 00 ; note_cooldown &0697 04 ; music_data &0698 1c 4c 38 44 1c 4c 38 44 1c 4c 38 44 1c 4c 38 44 &06a8 00 30 1c 28 08 38 24 30 0c 3c 28 3c 14 44 30 44 &06b8 00 30 1c 28 08 38 24 30 0c 3c 28 3c 14 44 30 44 &06c8 1c 4c 38 44 1c 4c 38 44 1c 4c 38 44 1c 4c 38 44 &06d8 00 30 1c 28 08 38 24 30 0c 3c 28 3c 14 44 30 44 &06e8 00 30 1c 28 08 38 24 30 0c 3c 28 3c 14 44 30 44 &06f8 1c 4c 38 44 1c 4c 38 44 1c 4c 38 44 1c 4c 38 44 &0708 28 58 28 58 28 58 28 58 14 44 14 44 14 44 14 44 &0718 0c 3c 0c 3c 14 44 14 44 28 58 28 58 28 58 28 58 &0728 28 58 28 58 28 58 28 58 14 44 14 44 14 44 14 44 &0738 0c 3c 0c 3c 14 44 14 ; unused # Possibly intended as last note of tune &073f 44 ; game_over_level_data ; 13 12 11 10 f e d c b a 9 8 7 6 5 4 3 2 1 0 &0740 00 0a 00 00 0d 0c 00 15 1b 21 1b 15 08 11 23 24 11 00 27 00 # Tile sprites &0754 16 30 ; RYCK # Colours &0756 80 # Player starts &0757 00 # No pistons &0758 00 # 1 enemy ; x y x- x+ ss f &0759 04 30 01 80 de 00 ; BIRD_RIGHT &075f 45 # Tile data is &45 bytes long &0760 f0 10 66 06 60 10 06 60 66 06 61 10 06 60 10 06 # 0000000000000000 &0770 63 10 06 61 00 66 00 06 61 66 10 06 61 00 06 60 # 0000000000000000 &0780 06 63 00 22 33 23 23 32 32 33 23 f0 f0 20 11 01 # 0011101010111000 &0790 10 00 01 11 60 11 00 11 01 11 50 11 01 10 00 01 # 0001001110110000 &07a0 10 11 f0 f0 20 # 0001001010111000 # 0000000000000000 # 0000000000000000 # 2333323223233322 # 0600006606060060 # 0666006066060060 # 0600006006060060 # 0666606006066600 # 0000000000000000 ; unused # &07a5 - &07ae is a copy of &0e65 - &0e6e &07a5 20 ee ff JSR &ffee ; OSWRCH &07a8 60 RTS &07a9 a9 15 LDA #&15 &07ab a2 00 LDX #&00 &07ad 20 f4 JSR &..f4 # Would be JSR &fff4 ; OSBYTE ; unused &07af 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &07bf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &07cf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &07df 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &07ef 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &07ff ff ; OS sound workspace and channel buffers &0800 ff 00 00 00 00 00 00 80 c0 c0 c0 2f 04 04 04 00 &0810 06 64 96 64 01 01 01 ff 00 14 14 00 00 00 00 06 &0820 05 05 05 03 30 20 20 ff 01 02 02 00 00 00 00 00 &0830 00 00 00 64 00 d3 d3 00 ff eb c1 00 00 ef 00 0d &0840 06 18 06 01 01 18 06 01 18 06 01 18 06 01 01 18 &0850 64 10 64 02 02 10 64 02 10 64 02 00 00 00 00 10 &0860 96 10 96 02 02 10 96 02 10 96 02 64 02 10 96 10 &0870 06 90 64 06 90 64 06 14 90 64 06 90 64 06 90 64 ; OS printer buffer &0880 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &0890 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &08a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &08b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; envelope_1 # Collecting apple &08c0 84 0a 00 f6 0a 00 0a 32 0a 0a f6 7e 00 00 00 00 ; envelope_2 # Jumping &08d0 84 01 00 f6 0a 00 0a 32 0a 01 ec 64 64 00 00 00 ; envelope_3 # Player dying &08e0 03 03 fe fe 05 32 78 32 0a 0a fc 7e 64 00 00 00 ; envelope_4 # Music &08f0 02 00 00 00 00 00 00 64 ec fb ec 32 6e 00 00 00 # TRAP2 is loaded at &0b00 - &0cff &0b00 00 ; contraption_level_data ; 13 12 11 10 f e d c b a 9 8 7 6 5 4 3 2 1 0 &0b01 00 0a 01 25 00 1c 1f 1d 18 23 29 05 08 00 14 03 17 10 01 00 # Tile sprites &0b15 16 30 ; RYCK # Colours &0b17 66 # Player starts &0b18 a2 a4 02 0f # Pistons &0b1c 03 # 4 enemies ; x y x- x+ ss f &0b1d 42 bf 64 c0 d2 09 ; PLATFORM &0b23 04 24 24 48 c3 05 ; SPACE # Becomes falling apple &0b29 60 80 78 e0 f1 01 ; BALL &0b2f 68 80 5c 7e f3 00 ; SPACE # Invisible, sets ball horizontal position (see &1c51) &0b35 36 # Tile data is &36 bytes long &0b36 07 43 00 d4 cc cc bc 04 d8 cc cc 3b 90 cd bc 00 # 0000000000000000 &0b46 05 44 30 aa aa 00 05 54 40 88 10 05 54 80 05 54 # e000000000000000 &0b56 80 15 11 11 04 58 e0 05 90 c0 42 19 11 04 41 11 # f411111400411194 &0b66 11 41 0f ee f0 10 # 2000000000000090 # 5000000000000000 # 5000000000411111 # 5000000000500000 # 5000000000500000 # 5008800000500000 # 50aaaa0000400000 # 50bccd0000000000 # 3bccccd000000000 # 4bcccccd40400007 ; unused &0b6c 68 3c 20 f0 8b ; jellyfish_sprite_0 &0b71 00 01 0f 00 00 00 13 ff 08 00 00 37 ff 8c 00 00 &0b81 7f ff ce 00 00 7f f3 c6 00 01 fe ff eb 00 01 f6 &0b91 fd ed 00 13 fa fd fd 08 13 fb f3 fb 08 13 f7 ff &0ba1 ff 08 13 ff ff ff 08 13 8f 0f 1f 08 01 18 f0 03 &0bb1 00 00 00 0a 00 00 00 00 a0 00 00 00 00 02 00 00 ; ball_sprite_0 &0bc1 03 0c 00 34 c2 00 7b e1 00 7b e1 00 78 e1 00 78 &0bd1 e1 00 34 c2 00 03 0c 00 ; ball_sprite_1 &0bd9 00 0f 00 01 f0 08 12 fc 84 12 fc 84 12 f0 84 12 &0be9 f0 84 01 f0 08 00 0f 00 ; unused # &0bf1 - &0bfe is a copy of &1131 - &113e &0bf1 90 ... &90 ; screen_address_low # Would be LDA &90 ; screen_address_low &0bf2 e9 17 SBC #&17 &0bf4 85 90 STA &90 ; screen_address_low &0bf6 b0 02 BCS &0bfa ; skip_page &0bf8 c6 91 DEC &91 ; screen_address_high ; skip_page &0bfa a5 93 LDA &93 ; sprite_address_high &0bfc 8d 50 11 STA &1150 ; source_address_high ; unused &0bff 10 50 28 f2 d5 2a 2a 2a 2a 00 00 50 50 40 11 40 &0c0f c0 ; cls_string &0c10 81 11 ; COLOUR &81 &0c12 0c ; CLS &0c13 80 11 ; COLOUR &80 ; unused &0c15 11 0a 11 2f 0a 11 11 0a 11 0a 09 11 ; vertical_velocity_table ; 1 2 3 4 5 6 7 8 &0c21 04 03 02 01 00 ff fd fc ; unused # &0c28 - &0c2f is a copy of &0c30 - &0c37 &0c28 0c 0d 0e 0f 10 11 12 ; stopping_heights_table ; 1 2 3 4 5 6 7 8 &0c30 0c 0d 0e 0f 0f 11 12 13 ; unused &0c38 04 05 06 07 07 11 12 13 01 ; piston_or_falling_platform_sprite_sizes ; 1 2 3 4 5 6 7 8 9 a b c d e f &0c41 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 ; tile_sprite_addresses_low_table # Values overwritten when level initialised ; 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 &0c50 00 40 c0 00 00 c0 40 00 40 c0 40 c0 00 00 00 40 00 40 80 00 ; tile_sprite_addresses_high_table &0c64 74 7c 7a 7c 7d 7c 78 76 79 7a 7c 7a 79 74 77 77 7c 7c 76 74 ; enemies_x # Values overwritten &0c78 30 0c 68 79 00 00 ; enemies_previous_x # Values overwritten, continues for three more bytes &0c7e 38 14 70 ; video_registers_and_text_window_string &0c81 00 00 00 00 00 00 21 07 00 17 # R7: Vertical sync position &0c8b 00 00 00 00 00 00 5e 02 00 17 # R2: Horizontal sync position register &0c95 00 00 00 00 00 00 48 01 00 17 # R1: Number of characters per line &0c9f 00 00 00 00 00 00 1e 06 00 17 # R6: Vertical displayed register &0ca9 00 27 1d 00 1c # Define text window x:(&00, &27) y:(&00, &1d) # video_registers_and_text_window_string is subsequently overwritten by: # # &0c7e - &0c83 enemies_previous_x # &0c84 - &0c89 enemies_previous_y # &0c8a - &0c8f enemies_position_minimum # &0c90 - &0c95 enemies_position_maximum # &0c96 - &0c9b enemies_flags # &0c9c - &0ca1 enemies_position_fraction # &0ca2 - &0ca7 enemies_speed # &0ca8 - &0cad enemies_direction ; enemies_base_sprite &0cae 00 00 00 0c 00 00 ; enemies_frame &0cb4 00 01 00 01 00 00 ; enemies_sprite &0cba 00 01 00 0f 00 00 ; sprites_y # Must be enemies_y - 1, stores player y &0cc0 97 ; enemies_y &0cc1 7e d7 52 60 00 00 ; sprites_replotted &0cc7 01 01 01 01 01 00 00 ; unused &0cce 00 ff 00 bb 00 30 00 00 a0 04 00 00 00 00 0a 04 &0cde b1 00 ; enemies_tag ; 0 1 2 3 4 5 &0ce0 05 03 04 01 02 00 ; enemies_y_top_of_bounce &0ce6 00 00 00 80 c4 40 ; unused &0cec 60 c4 40 60 00 ; score &0cf1 30 30 30 30 30 30 ; "000000" ; unused &0cf7 34 60 00 00 00 00 ff 00 00 # LASTBIT is loaded at &0e00 - &2fff ; write_high_scores &0e00 20 69 0e JSR &0e69 ; check_for_new_high_score &0e03 a0 01 LDY #&01 # Offset to high score &0e05 a9 30 LDA #&30 # Start at rank 1 &0e07 85 7b STA &7b ; rank ; write_high_scores_loop &0e09 e6 7b INC &7b ; rank &0e0b a2 36 LDX #&36 # Stop after rank 5 &0e0d e4 7b CPX &7b ; rank &0e0f f0 4d BEQ &0e5e ; leave_after_setting_text_colour_3 &0e11 a9 1f LDA #&1f # TAB(&07, rank + &30 - &1e) &0e13 20 ee ff JSR &ffee ; OSWRCH &0e16 a9 07 LDA #&07 &0e18 20 ee ff JSR &ffee ; OSWRCH &0e1b a5 7b LDA &7b ; rank &0e1d 38 SEC &0e1e e9 1e SBC #&1e &0e20 20 ee ff JSR &ffee ; OSWRCH # Write rank &0e23 a5 7b LDA &7b ; rank &0e25 20 ee ff JSR &ffee ; OSWRCH &0e28 20 2e 0e JSR &0e2e ; write_high_score &0e2b 4c 09 0e JMP &0e09 ; write_high_scores_loop ; write_high_score &0e2e a9 2e LDA #&2e ; "." &0e30 20 ee ff JSR &ffee ; OSWRCH # Write "." &0e33 a2 06 LDX #&06 &0e35 20 53 0e JSR &0e53 ; write_high_score_or_name # Write score &0e38 a9 2e LDA #&2e ; "." &0e3a 20 ee ff JSR &ffee ; OSWRCH # Write "..." &0e3d 20 ee ff JSR &ffee ; OSWRCH &0e40 20 ee ff JSR &ffee ; OSWRCH &0e43 a2 0a LDX #&0a &0e45 20 53 0e JSR &0e53 ; write_high_score_or_name # Write name &0e48 a9 0d LDA #&0d &0e4a 20 ee ff JSR &ffee ; OSWRCH # Unnecessary code: move to next line &0e4d a9 0a LDA #&0a &0e4f 20 ee ff JSR &ffee ; OSWRCH &0e52 60 RTS ; write_high_score_or_name &0e53 b9 50 0f LDA &0f50,Y ; high_scores - 1 &0e56 20 ee ff JSR &ffee ; OSWRCH &0e59 c8 INY &0e5a ca DEX &0e5b d0 f6 BNE &0e53 ; write_high_score_or_name &0e5d 60 RTS ; leave_after_setting_text_colour_3 &0e5e a9 11 LDA #&11 &0e60 20 ee ff JSR &ffee ; OSWRCH &0e63 a9 03 LDA #&03 &0e65 20 ee ff JSR &ffee ; OSWRCH &0e68 60 RTS ; check_for_new_high_score &0e69 a9 15 LDA #&15 ; Flush buffer &0e6b a2 00 LDX #&00 ; keyboard &0e6d 20 f4 ff JSR &fff4 ; OSBYTE &0e70 a9 41 LDA #&41 # Start at rank 5 &0e72 85 7b STA &7b ; score_offset ; check_high_scores_loop &0e74 a4 7b LDY &7b ; score_offset &0e76 a2 01 LDX #&01 ; check_score_loop &0e78 b9 50 0f LDA &0f50,Y ; high_scores - 1 # Is player's score better? &0e7b dd f0 0c CMP &0cf0,X ; score - 1 &0e7e d0 06 BNE &0e86 ; digits_differ &0e80 c8 INY &0e81 e8 INX &0e82 e0 06 CPX #&06 &0e84 d0 f2 BNE &0e78 ; check_score_loop ; digits_differ &0e86 b0 08 BCS &0e90 ; consider_rank &0e88 a5 7b LDA &7b ; score_offset # If so, compare against previous rank &0e8a e9 0f SBC #&0f &0e8c 85 7b STA &7b ; score_offset &0e8e b0 e4 BCS &0e74 ; check_high_scores_loop # if not at rank 1 ; consider_rank &0e90 a4 7b LDY &7b ; score_offset &0e92 c0 41 CPY #&41 # Is player's score better than rank 5? &0e94 d0 01 BNE &0e97 ; new_high_score &0e96 60 RTS ; new_high_score # If so, &0e97 a9 40 LDA #&40 # Calculate length of scores to shuffle &0e99 38 SEC &0e9a e5 7b SBC &7b ; score_offset &0e9c a8 TAY &0e9d a2 50 LDX #&50 ; shuffle_scores_loop &0e9f bd 50 0f LDA &0f50,X ; high_scores - 1 # Shuffle all ranks below player's score down a rank &0ea2 9d 60 0f STA &0f60,X ; high_scores - 1 + 16 # (including rank 5) &0ea5 ca DEX &0ea6 88 DEY &0ea7 10 f6 BPL &0e9f ; shuffle_scores_loop &0ea9 a2 01 LDX #&01 &0eab a5 7b LDA &7b ; score_offset &0ead 18 CLC &0eae 69 10 ADC #&10 &0eb0 a8 TAY ; insert_score_loop # Copy player's score into high scores &0eb1 bd f0 0c LDA &0cf0,X ; score - 1 &0eb4 99 50 0f STA &0f50,Y ; high_scores - 1 &0eb7 c8 INY &0eb8 e8 INX &0eb9 e0 06 CPX #&06 &0ebb d0 f4 BNE &0eb1 ; insert_score_loop &0ebd a2 00 LDX #&00 ; write_enter_your_name_loop # Write "Enter Your Name" &0ebf bd 30 0f LDA &0f30,X ; enter_your_name_string &0ec2 c9 0d CMP #&0d &0ec4 f0 06 BEQ &0ecc &0ec6 20 ee ff JSR &ffee ; OSWRCH &0ec9 e8 INX &0eca d0 f3 BNE &0ebf ; write_enter_your_name_loop ; enter_name &0ecc a5 7b LDA &7b ; score_offset &0ece 18 CLC &0ecf 69 16 ADC #&16 &0ed1 a8 TAY &0ed2 a2 00 LDX #&00 ; enter_name_loop &0ed4 20 0a 0f JSR &0f0a ; get_character &0ed7 30 fb BMI &0ed4 ; enter_name_loop &0ed9 c9 20 CMP #&20 ; " " &0edb b0 07 BCS &0ee4 ; valid_character &0edd c9 0d CMP #&0d ; RETURN &0edf f0 3d BEQ &0f1e ; pad_name &0ee1 4c d4 0e JMP &0ed4 ; enter_name_loop ; valid_character &0ee4 c9 7f CMP #&7f ; DELETE &0ee6 d0 0f BNE &0ef7 ; consider_adding_character &0ee8 88 DEY &0ee9 ca DEX &0eea 30 e0 BMI &0ecc ; enter_name &0eec 20 ee ff JSR &ffee ; OSWRCH &0eef a9 20 LDA #&20 ; " " &0ef1 99 50 0f STA &0f50,Y ; high_scores - 1 &0ef4 4c d4 0e JMP &0ed4 ; enter_name_loop ; consider_adding_character &0ef7 e8 INX &0ef8 e0 0b CPX #&0b &0efa d0 04 BNE &0f00 ; add_character &0efc ca DEX &0efd 4c d4 0e JMP &0ed4 ; enter_name_loop ; add_character &0f00 99 50 0f STA &0f50,Y ; high_scores - 1 &0f03 20 ee ff JSR &ffee ; OSWRCH &0f06 c8 INY &0f07 d0 cb BNE &0ed4 ; enter_name_loop &0f09 60 RTS ; get_character &0f0a 86 9c STX &9c ; tmp_x &0f0c 84 9d STY &9d ; tmp_y ; get_character_loop &0f0e a0 00 LDY #&00 &0f10 a9 81 LDA #&81 ; Wait for input character &0f12 20 f4 ff JSR &fff4 ; OSBYTE &0f15 98 TYA &0f16 d0 f6 BNE &0f0e ; get_character_loop &0f18 8a TXA &0f19 a6 9c LDX &9c ; tmp_x &0f1b a4 9d LDY &9d ; tmp_y ; leave &0f1d 60 RTS ; pad_name &0f1e a9 20 LDA #&20 ; " " &0f20 e0 0a CPX #&0a &0f22 f0 f9 BEQ &0f1d ; leave &0f24 99 50 0f STA &0f50,Y ; high_scores - 1 # Fill remainder of name with spaces &0f27 c8 INY &0f28 e8 INX &0f29 e0 0a CPX #&0a &0f2b d0 f1 BNE &0f1e ; pad_name &0f2d 60 RTS ; unused &0f2e 00 50 ; enter_your_name_string &0f30 1f 07 14 ; TAB(&07, &14) &0f33 45 6e 74 65 72 20 59 6f 75 72 20 4e 61 6d 65 ; "Enter Your Name" &0f42 1f 08 15 ; TAB(&08, &15) &0f45 0d ; unused &0f46 00 23 00 30 23 80 20 03 cc 1d 30 ; high_scores &0f51 30 30 30 35 30 30 48 65 6c 65 6e 20 20 20 20 20 ; "000500Helen "; # Rank 1 &0f61 30 30 30 35 30 30 44 61 76 65 20 20 20 20 20 20 ; "000500Dave "; # Rank 2 &0f71 30 30 30 35 30 30 49 43 4f 4e 20 20 20 20 20 20 ; "000500ICON "; # Rank 3 &0f81 30 30 30 35 30 30 49 43 4f 4e 20 20 20 20 20 20 ; "000500ICON "; # Rank 4 &0f91 30 30 30 35 30 30 42 6f 62 6f 2e 20 20 20 20 20 ; "000500Bobo. "; # Rank 5 &0fa1 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 ; "0000000000000000"; # Overwritten by previous rank 5 score ; unused &0fb1 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 &0fc1 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 &0fd1 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 &0fe1 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 &0ff1 30 30 30 30 30 30 30 30 30 30 30 30 30 30 00 12 ; wasp_sprite_0 &1001 11 44 00 00 00 22 aa 00 00 00 00 00 00 00 00 11 &1011 44 00 00 00 00 00 00 00 00 00 88 00 00 00 00 00 &1021 00 00 00 00 44 00 00 00 00 00 03 08 00 00 00 3c &1031 8c 00 2b 0f f8 ce 00 07 f0 fc e7 00 07 f0 fc e7 &1041 00 2b 0f f8 ce 00 00 00 3c 8c 00 00 00 03 08 00 &1051 00 44 00 00 00 00 00 00 00 00 00 44 00 00 00 00 &1061 00 00 00 00 00 aa 00 00 00 00 00 00 00 00 11 55 &1071 00 00 00 00 aa 00 00 00 ; unused # Unused code; compare: &1079 a9 8c LDA #&8c # &11ae a9 8c LDA #&8c &107b 85 83 STA &83 ; tile_x # &11b0 85 83 STA &83 ; tile_x &107d a6 9a LDX &9a ; side_tile_type # &127b a6 9a LDX &9a ; side_tile_type &107f 20 42 JSR &..42 # &127d 20 54 12 JSR &1254 ; plot_tile ; unused &1080 00 ; wasp_sprite_1 &1081 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &1091 00 00 00 00 00 00 aa 00 00 00 00 00 00 00 00 55 &10a1 44 00 00 00 00 00 00 00 00 22 88 0e 00 00 00 03 &10b1 e3 00 02 8f 3e f3 08 01 3c f3 f1 8c 01 3c f3 f1 &10c1 8c 02 8f 3e f3 08 00 00 03 e3 00 00 22 88 0e 00 &10d1 00 00 00 00 00 00 55 44 00 00 00 00 00 00 00 00 &10e1 00 aa 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &10f1 00 00 00 00 00 00 00 00 ; unused # &10f9 - &10fe is a copy of &1399 - &139e &10f9 d0 04 BNE &10ff # Would be BNE &139f ; skip_jump &10fb 85 7a STA &7a ; player_is_jumping &10fd 85 88 STA &88 ; suppress_jump ; unused &10ff 00 ; entry_point &1100 4c 1c 1a JMP &1a1c ; initialisation ; plot_sprite # Called with A = x_position, X = y_position &1103 4a LSR A # Calculate screen address for bottom of sprite &1104 0a ASL A &1105 26 91 ROL &91 ; screen_address_high &1107 0a ASL A &1108 26 91 ROL &91 ; screen_address_high &110a 0a ASL A &110b 26 91 ROL &91 ; screen_address_high &110d 85 90 STA &90 ; screen_address_low &110f 8a TXA &1110 29 07 AND #&07 &1112 18 CLC &1113 65 90 ADC &90 ; screen_address_low &1115 85 90 STA &90 ; screen_address_low &1117 8a TXA &1118 4a LSR A &1119 4a LSR A &111a 29 fe AND #&fe &111c aa TAX &111d a5 90 LDA &90 ; screen_address_low &111f 18 CLC &1120 7d c1 0a ADC &0ac1,X ; row_multiplication_table + 1 &1123 85 90 STA &90 ; screen_address_low &1125 a5 91 LDA &91 ; screen_address_high &1127 29 07 AND #&07 &1129 7d c0 0a ADC &0ac0,X ; row_multiplication_table &112c 69 30 ADC #&30 &112e 85 91 STA &91 ; screen_address_high &1130 a5 90 LDA &90 ; screen_address_low &1132 e9 17 SBC #&17 # Offset by 16 pixels left &1134 85 90 STA &90 ; screen_address_low &1136 b0 02 BCS &113a ; skip_page &1138 c6 91 DEC &91 ; screen_address_high ; skip_page ; plot_sprite_at_screen_address &113a a5 93 LDA &93 ; sprite_address_high # Sprite address is offset by -1 &113c 8d 50 11 STA &1150 ; source_address_high &113f a5 92 LDA &92 ; sprite_address_low &1141 8d 4f 11 STA &114f ; source_address_low &1144 a6 94 LDX &94 ; sprite_size_in_bytes &1146 a5 91 LDA &91 ; screen_address_high &1148 c5 96 CMP &96 ; minimum_screen_address_high # Is the bottom of the sprite above the top of the &114a 90 34 BCC &1180 ; leave # screen? If so, nothing to plot; leave ; plot_sprite_row_loop &114c a4 95 LDY &95 ; sprite_width_in_bytes ; plot_sprite_column_loop &114e bd bf 11 LDA &11bf,X # actually LDA source_address,X ; plot_sprite_eor_instruction &1151 51 90 EOR (&90),Y ; screen_address # or STA (&90),Y ; screen_address when plotting lives &1153 91 90 STA (&90),Y ; screen_address &1155 ca DEX &1156 f0 28 BEQ &1180 ; leave &1158 98 TYA &1159 38 SEC &115a e9 08 SBC #&08 # Move left four pixels &115c a8 TAY &115d d0 ef BNE &114e ; plot_sprite_column_loop &115f c6 90 DEC &90 ; screen_address_low # Move up one row &1161 a5 90 LDA &90 ; screen_address_low &1163 c9 ff CMP #&ff &1165 d0 02 BNE &1169 ; skip_screen_page &1167 c6 91 DEC &91 ; screen_address_high ; skip_screen_page &1169 29 07 AND #&07 &116b c9 07 CMP #&07 &116d d0 dd BNE &114c ; plot_sprite_row_loop &116f a5 90 LDA &90 ; screen_address_low &1171 38 SEC &1172 e9 38 SBC #&38 # Move up one group &1174 85 90 STA &90 ; screen_address_low &1176 a5 91 LDA &91 ; screen_address_high &1178 e9 02 SBC #&02 &117a 85 91 STA &91 ; screen_address_high &117c c5 96 CMP &96 ; minimum_screen_address_high # Is the next row above the top of the screen? &117e b0 cc BCS &114c ; plot_sprite_row_loop # If not, continue plotting the sprite ; leave &1180 60 RTS ; initialise_level_screen &1181 a2 ef LDX #&ef &1183 a9 00 LDA #&00 ; wipe_tile_table_loop &1185 9d 00 7f STA &7f00,X ; tile_table # Wipe &7f01 - &7fef with &00 &1188 ca DEX &1189 d0 fa BNE &1185 ; wipe_tile_table_loop &118b a0 04 LDY #&04 ; write_cls_string_loop &118d b9 10 0c LDA &0c10,Y ; cls_string # Clear the screen in colour 1 &1190 20 ee ff JSR &ffee ; OSWRCH &1193 88 DEY &1194 10 f7 BPL &118d ; write_cls_string_loop &1196 a4 80 LDY &80 ; level_data_offset &1198 20 80 17 JSR &1780 ; initialise_level_data # Initialise tile sprites, colours, pistons and enemies &119b 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for length of tile data &119e 85 9d STA &9d ; length_of_tile_data &11a0 84 80 STY &80 ; level_data_offset &11a2 a9 20 LDA #&20 # 16 pixels wide &11a4 85 95 STA &95 ; sprite_width_in_bytes &11a6 a9 40 LDA #&40 # 16 pixels high &11a8 85 94 STA &94 ; sprite_size_in_bytes &11aa a9 f0 LDA #&f0 # Start at bottom right tile &11ac 85 84 STA &84 ; tile_y &11ae a9 8c LDA #&8c &11b0 85 83 STA &83 ; tile_x &11b2 a9 f0 LDA #&f0 # Start at bottom right tile &11b4 85 85 STA &85 ; tile_offset &11b6 a9 07 LDA #&07 ; TILE_DOOR &11b8 85 6e STA &6e ; door_tile_type &11ba a9 00 LDA #&00 &11bc 85 6d STA &6d ; apples_remaining &11be a9 09 LDA #&09 # Use offset for regular height tile &11c0 85 6f STA &6f ; sprite_y_offset &11c2 a9 ff LDA #&ff # Non-zero to read byte of level data for first nibble &11c4 85 58 STA &58 ; nibble_to_use &11c6 85 9c STA &9c ; run_length ; add_floor_loop &11c8 a2 11 LDX #&11 ; TILE_BOTTOM # Use tile_sprite_addresses + &11 for bottom edge &11ca 86 9a STX &9a ; side_tile_type &11cc 20 54 12 JSR &1254 ; plot_tile # Set tiles for bottom edge of screen &11cf a5 84 LDA &84 ; tile_y &11d1 c9 f0 CMP #&f0 &11d3 f0 f3 BEQ &11c8 ; add_floor_loop &11d5 20 e9 11 JSR &11e9 ; add_tiles # Unpack tile data ; fill_remaining_tiles &11d8 a9 0c LDA #&0c &11da 85 83 STA &83 ; tile_x &11dc a2 00 LDX #&00 ; TILE_EMPTY # Set top left tile of inner screen to be empty &11de 20 54 12 JSR &1254 ; plot_tile &11e1 d0 f5 BNE &11d8 ; fill_remaining_tiles # Never branches &11e3 a9 00 LDA #&00 # Plot score without changing it &11e5 20 bd 1b JSR &1bbd ; increase_score &11e8 60 RTS ; add_tiles &11e9 a9 00 LDA #&00 &11eb c6 9c DEC &9c ; run_length &11ed 10 0c BPL &11fb ; set_tile &11ef 20 03 12 JSR &1203 ; get_nibble # Get a nibble of tile data &11f2 d0 07 BNE &11fb ; set_tile # If non-zero, set a single tile to be that type &11f4 20 03 12 JSR &1203 ; get_nibble # If zero, get a second nibble for run length &11f7 85 9c STA &9c ; run_length &11f9 a9 00 LDA #&00 ; TILE_EMPTY # of empty tiles ; set_tile &11fb 20 18 12 JSR &1218 ; add_tile &11fe a5 9d LDA &9d ; length_of_tile_data &1200 d0 e7 BNE &11e9 ; add_tiles # Continue until all the tile data has been processed &1202 60 RTS ; get_nibble # Returns low, then high nibble of each byte &1203 a5 58 LDA &58 ; nibble_to_use &1205 49 ff EOR #&ff &1207 85 58 STA &58 ; nibble_to_use &1209 d0 0a BNE &1215 ; leave_with_high_nibble &120b c6 9d DEC &9d ; length_of_tile_data &120d a4 80 LDY &80 ; level_data_offset &120f 20 70 17 JSR &1770 ; read_byte_of_level_data_as_two_nibbles # Leaves with low nibble of next byte &1212 84 80 STY &80 ; level_data_offset &1214 60 RTS ; leave_with_high_nibble &1215 a5 86 LDA &86 ; high_nibble &1217 60 RTS ; add_tile &1218 aa TAX &1219 29 06 AND #&06 ; TILE_SPECIAL_MASK &121b c9 06 CMP #&06 ; TILE_SPECIAL_MASK # Matches 6 (deadly), 7 (door), e (deadly) or f (apple) &121d d0 19 BNE &1238 ; not_special_tile &121f e0 07 CPX #&07 ; TILE_DOOR &1221 d0 0a BNE &122d ; not_door &1223 a6 6e LDX &6e ; door_tile_type &1225 f0 06 BEQ &122d ; not_door &1227 a9 00 LDA #&00 # Only one door per level &1229 85 6e STA &6e ; door_tile_type &122b 06 94 ASL &94 ; sprite_size_in_bytes # Door is twice the height of regular tiles ; not_door &122d e0 0f CPX #&0f ; TILE_APPLE &122f d0 02 BNE &1233 ; set_special_tile &1231 e6 6d INC &6d ; apples_remaining ; set_special_tile &1233 8a TXA &1234 09 f0 ORA #&f0 ; TILE_SPECIAL &1236 30 15 BMI &124d ; set_tile # Always branches ; not_special_tile &1238 8a TXA &1239 c9 08 CMP #&08 ; TILE_PISTON &123b d0 0a BNE &1247 ; not_piston &123d a4 64 LDY &64 ; pistons_maximum_frame # Piston starts fully extended &123f b9 40 0c LDA &0c40,Y ; piston_or_falling_platform_sprite_sizes - 1 &1242 85 94 STA &94 ; sprite_size_in_bytes &1244 98 TYA &1245 09 90 ORA #&90 ; TILE_SPECIAL_PISTON ; not_piston &1247 c9 09 CMP #&09 ; TILE_PLATFORM &1249 d0 02 BNE &124d ; set_tile &124b a9 8f LDA #&8f ; TILE_SPECIAL_PLATFORM | &f # Platform starts at highest height ; set_tile &124d c6 85 DEC &85 ; tile_offset &124f a4 85 LDY &85 ; tile_offset &1251 99 00 7f STA &7f00,Y ; tile_table ; plot_tile &1254 bd 64 0c LDA &0c64,X ; tile_sprite_addresses_high_table # Use sprite for tile &1257 85 93 STA &93 ; sprite_address_high &1259 bd 50 0c LDA &0c50,X ; tile_sprite_addresses_low_table &125c 85 92 STA &92 ; sprite_address_low &125e 8a TXA &125f 29 08 AND #&08 ; TILE_OFFSET # Tiles &8 - &f are offset by one group upwards &1261 49 ff EOR #&ff &1263 18 CLC &1264 65 84 ADC &84 ; tile_y &1266 aa TAX &1267 a5 83 LDA &83 ; tile_x &1269 20 03 11 JSR &1103 ; plot_sprite &126c a9 40 LDA #&40 # Reset default size of tile &126e 85 94 STA &94 ; sprite_size_in_bytes &1270 a5 83 LDA &83 ; tile_x &1272 38 SEC &1273 e9 08 SBC #&08 # Move left a tile &1275 85 83 STA &83 ; tile_x &1277 c9 0a CMP #&0a &1279 b0 1b BCS &1296 ; leave &127b a6 9a LDX &9a ; side_tile_type &127d 20 54 12 JSR &1254 ; plot_tile &1280 a9 10 LDA #&10 ; TILE_SIDE # Use tile_sprite_addresses + &10 for side edges &1282 85 9a STA &9a ; side_tile_type &1284 a5 84 LDA &84 ; tile_y &1286 38 SEC &1287 e9 10 SBC #&10 # Move up a tile &1289 f0 0b BEQ &1296 ; leave &128b 85 84 STA &84 ; tile_y &128d a9 8c LDA #&8c &128f 85 83 STA &83 ; tile_x &1291 a2 10 LDX #&10 ; TILE_SIDE # Use tile_sprite_addresses + &10 for side edges &1293 20 54 12 JSR &1254 ; plot_tile ; leave &1296 60 RTS ; apply_player_horizontal_movement &1297 a5 71 LDA &71 ; player_horizontal_movement &1299 18 CLC &129a 65 72 ADC &72 ; player_x # Apply horizontal movement to player &129c 85 72 STA &72 ; player_x &129e c9 02 CMP #&02 # Is the player trying to move off left edge of screen? &12a0 90 04 BCC &12a6 ; undo_horizontal_movement &12a2 c9 7d CMP #&7d # Is the player trying to move off right edge of screen? &12a4 90 05 BCC &12ab ; leave ; undo_horizontal_movement &12a6 38 SEC &12a7 e5 71 SBC &71 ; player_horizontal_movement # If so, undo horizontal movement &12a9 85 72 STA &72 ; player_x ; leave &12ab 60 RTS ; consider_if_player_can_fall &12ac a5 78 LDA &78 ; player_initial_jump_or_fall_stage # Non-zero if player is jumping or falling &12ae d0 4f BNE &12ff ; apply_player_vertical_movement &12b0 a5 59 LDA &59 ; player_is_riding_platform # Non-zero if player is riding platform &12b2 d0 17 BNE &12cb ; stop_riding_platform &12b4 20 c8 13 JSR &13c8 ; get_height_of_player_left_tile &12b7 20 df 12 JSR &12df ; check_if_tile_supports_player # Is the player supported to the left? &12ba f0 13 BEQ &12cf ; leave &12bc 20 c0 13 JSR &13c0 ; get_height_of_player_right_tile # Is the player supported to the right? &12bf 20 df 12 JSR &12df ; check_if_tile_supports_player &12c2 f0 0b BEQ &12cf ; leave &12c4 a9 04 LDA #&04 # Set player falling &12c6 a2 21 LDX #&21 # Maximum safe distance to fall &12c8 20 d0 12 JSR &12d0 ; start_jump_or_fall ; stop_riding_platform &12cb a9 00 LDA #&00 # Set to zero to indicate player not riding platform &12cd 85 59 STA &59 ; player_is_riding_platform &12cf 60 RTS ; start_jump_or_fall &12d0 85 74 STA &74 ; player_jump_or_fall_stage &12d2 85 78 STA &78 ; player_initial_jump_or_fall_stage &12d4 86 6c STX &6c ; maximum_safe_fall_distance &12d6 a5 73 LDA &73 ; player_y &12d8 85 6b STA &6b ; jump_or_fall_initial_y &12da a5 76 LDA &76 ; maximum_player_jump_or_fall_stage_cooldown &12dc 85 77 STA &77 ; player_jump_or_fall_stage_cooldown &12de 60 RTS ; check_if_tile_supports_player &12df f0 06 BEQ &12e7 ; leave_with_f # An empty tile provides no support &12e1 29 08 AND #&08 &12e3 45 73 EOR &73 ; player_y # Otherwise, consider the player's position &12e5 29 0f AND #&0f ; leave_with_f &12e7 49 0f EOR #&0f &12e9 60 RTS # Leaves with zero if tile is supporting player ; consider_if_player_is_starting_to_jump &12ea a5 7a LDA &7a ; player_is_jumping # Non-zero if player is jumping &12ec f0 10 BEQ &12fe ; leave &12ee a5 78 LDA &78 ; player_initial_jump_or_fall_stage # Non-zero if player is jumping or falling &12f0 d0 0c BNE &12fe ; leave &12f2 a9 10 LDA #&10 ; sound_2 # Play sound for jumping &12f4 20 55 1b JSR &1b55 ; play_sound &12f7 a9 08 LDA #&08 # Set player jumping &12f9 a2 11 LDX #&11 # Maximum safe distance to fall &12fb 20 d0 12 JSR &12d0 ; start_jump_or_fall ; leave &12fe 60 RTS ; apply_player_vertical_movement &12ff 20 c8 13 JSR &13c8 ; get_height_of_player_left_tile &1302 20 48 13 JSR &1348 ; check_if_tile_can_stop_player &1305 b0 08 BCS &130f ; stop_player_falling &1307 20 c0 13 JSR &13c0 ; get_height_of_player_right_tile &130a 20 48 13 JSR &1348 ; check_if_tile_can_stop_player &130d 90 20 BCC &132f ; no_obstacle ; stop_player_falling &130f 85 73 STA &73 ; player_y &1311 a2 00 LDX #&00 # Set to zero to indicate player not jumping or falling &1313 86 78 STX &78 ; player_initial_jump_or_fall_stage &1315 a5 73 LDA &73 ; player_y &1317 e5 6b SBC &6b ; jump_or_fall_initial_y &1319 90 08 BCC &1323 ; not_fallen_too_far # Did the player fall onto the obstacle? &131b c5 6c CMP &6c ; maximum_safe_fall_distance &131d 90 04 BCC &1323 ; not_fallen_too_far # If so, is it too far below? &131f a9 01 LDA #&01 # Set to positive non-zero to indicate player killed &1321 85 98 STA &98 ; player_was_killed ; not_fallen_too_far &1323 86 79 STX &79 ; unused_variable # Unused variable &1325 86 7a STX &7a ; player_is_jumping # Set to zero to indicate player not jumping &1327 ca DEX ; #&ff &1328 86 6b STX &6b ; jump_or_fall_initial_y # Set to &ff to suppress falling too far &132a a9 01 LDA #&01 &132c 85 8f STA &8f ; player_foot_animation_cooldown # Animate player's feet on next update &132e 60 RTS ; no_obstacle &132f a6 74 LDX &74 ; player_jump_or_fall_stage &1331 bd 20 0c LDA &0c20,X ; vertical_velocity_table - 1 &1334 18 CLC &1335 65 73 ADC &73 ; player_y # Apply vertical velocity &1337 85 73 STA &73 ; player_y &1339 c6 77 DEC &77 ; player_jump_or_fall_stage_cooldown &133b d0 0a BNE &1347 ; leave &133d a5 76 LDA &76 ; maximum_player_jump_or_fall_stage_cooldown &133f 85 77 STA &77 ; player_jump_or_fall_stage_cooldown &1341 c6 74 DEC &74 ; player_jump_or_fall_stage &1343 d0 02 BNE &1347 ; leave &1345 e6 74 INC &74 ; player_jump_or_fall_stage ; leave &1347 60 RTS ; check_if_tile_can_stop_player &1348 18 CLC &1349 f0 19 BEQ &1364 ; leave &134b 29 08 AND #&08 &134d 85 7b STA &7b ; group &134f 18 CLC &1350 65 74 ADC &74 ; player_jump_or_fall_stage &1352 aa TAX &1353 a5 73 LDA &73 ; player_y &1355 29 0f AND #&0f &1357 dd 2f 0c CMP &0c2f,X ; stopping_heights_table - 1 &135a 90 08 BCC &1364 ; leave &135c a5 73 LDA &73 ; player_y &135e 09 0f ORA #&0f &1360 45 7b EOR &7b ; group &1362 c5 73 CMP &73 ; player_y ; leave &1364 60 RTS ; update_game &1365 20 84 13 JSR &1384 ; check_for_player_movement &1368 20 97 12 JSR &1297 ; apply_player_horizontal_movement &136b 20 43 14 JSR &1443 ; check_for_player_touching_tiles &136e 20 ea 12 JSR &12ea ; consider_if_player_is_starting_to_jump &1371 20 cc 14 JSR &14cc ; animate_player &1374 20 ac 12 JSR &12ac ; consider_if_player_can_fall &1377 20 06 15 JSR &1506 ; check_for_player_on_falling_platforms &137a 20 7b 15 JSR &157b ; update_piston_or_falling_platforms &137d 20 ba 15 JSR &15ba ; update_enemies &1380 20 70 18 JSR &1870 ; replot_player_and_enemies &1383 60 RTS ; check_for_player_movement &1384 a5 55 LDA &55 ; allow_player_movement # Zero if not playing game &1386 f0 2d BEQ &13b5 ; check_for_space &1388 a2 b7 LDX #&b7 ; * &138a 20 e6 13 JSR &13e6 ; check_for_keypress &138d a6 88 LDX &88 ; suppress_jump # Zero if player can jump &138f f0 02 BEQ &1393 ; skip_suppression &1391 85 88 STA &88 ; suppress_jump # Set to non-zero if * pressed to prevent auto-repeat ; skip_suppression &1393 a6 78 LDX &78 ; player_initial_jump_or_fall_stage # Non-zero if player is jumping or falling &1395 d0 1e BNE &13b5 ; check_for_space # Player can't change direction if jumping or falling &1397 a6 88 LDX &88 ; suppress_jump # Zero if player can jump &1399 d0 04 BNE &139f ; skip_jump &139b 85 7a STA &7a ; player_is_jumping # Set to non-zero if * pressed to start jump &139d 85 88 STA &88 ; suppress_jump # Set to non-zero if * pressed to prevent auto-repeat ; skip_jump &139f a2 9e LDX #&9e ; Z &13a1 20 e6 13 JSR &13e6 ; check_for_keypress &13a4 29 ff AND #&ff # Set to &ff if player wants to move left &13a6 85 71 STA &71 ; player_horizontal_movement &13a8 a2 bd LDX #&bd ; X &13aa 20 e6 13 JSR &13e6 ; check_for_keypress &13ad 29 01 AND #&01 # Set to &01 if player wants to move right &13af 18 CLC &13b0 65 71 ADC &71 ; player_horizontal_movement # Set to &00 if both or neither of Z and X pressed &13b2 85 71 STA &71 ; player_horizontal_movement &13b4 60 RTS ; check_for_space &13b5 a2 9e LDX #&9e ; Z &13b7 20 e6 13 JSR &13e6 ; check_for_keypress # Unnecessary code; result is ignored &13ba a2 9d LDX #&9d ; SPACE &13bc 20 e6 13 JSR &13e6 ; check_for_keypress # Unnecessary code; result is ignored &13bf 60 RTS ; get_height_of_player_right_tile &13c0 a9 02 LDA #&02 ; get_height_of_tile_relative_to_player &13c2 18 CLC &13c3 65 72 ADC &72 ; player_x &13c5 aa TAX &13c6 d0 02 BNE &13ca ; get_height_of_player_tile # Always branches ; get_height_of_player_left_tile &13c8 a6 72 LDX &72 ; player_x ; get_height_of_player_tile &13ca a5 73 LDA &73 ; player_y # Calculate the corresponding tile address &13cc 29 f0 AND #&f0 &13ce 18 CLC &13cf 69 20 ADC #&20 &13d1 85 7b STA &7b ; tmp &13d3 8a TXA &13d4 4a LSR A &13d5 4a LSR A &13d6 4a LSR A &13d7 05 7b ORA &7b ; tmp &13d9 a8 TAY &13da b9 00 7f LDA &7f00,Y ; tile_table &13dd c9 ef CMP #&ef ; TILE_SPECIAL - 1 &13df 90 02 BCC &13e3 ; not_special &13e1 a9 00 LDA #&00 # Special tiles provide no support ; not_special &13e3 29 0f AND #&0f &13e5 60 RTS ; check_for_keypress &13e6 a0 ff LDY #&ff &13e8 a9 81 LDA #&81 ; Scan for a particular key &13ea 20 f4 ff JSR &fff4 ; OSBYTE &13ed 8a TXA &13ee 60 RTS # Returns A negative non-zero if key pressed ; replot_player &13ef a9 20 LDA #&20 # 16 pixels wide &13f1 85 95 STA &95 ; sprite_width_in_bytes &13f3 a5 8a LDA &8a ; previous_player_feet_sprite_address_high # Zero if player doesn't need unplotting &13f5 85 93 STA &93 ; sprite_address_high &13f7 f0 1c BEQ &1415 ; plot_player &13f9 a5 7f LDA &7f ; previous_player_feet_sprite_address_low &13fb 85 92 STA &92 ; sprite_address_low &13fd a9 20 LDA #&20 &13ff 85 94 STA &94 ; sprite_size_in_bytes &1401 a5 7c LDA &7c ; previous_player_x &1403 a6 7d LDX &7d ; previous_player_y &1405 20 03 11 JSR &1103 ; plot_sprite # Unplot player feet &1408 a5 89 LDA &89 ; previous_player_head_sprite_address_low &140a 85 92 STA &92 ; sprite_address_low &140c a9 58 LDA #&58 &140e 85 94 STA &94 ; sprite_size_in_bytes &1410 c6 93 DEC &93 ; sprite_address_high &1412 20 3a 11 JSR &113a ; plot_sprite_at_screen_address # Unplot player head ; plot_player &1415 a5 7e LDA &7e ; player_feet_sprite_address_low &1417 85 7f STA &7f ; previous_player_feet_sprite_address_low &1419 85 92 STA &92 ; sprite_address_low &141b a5 8b LDA &8b ; player_feet_sprite_address_high &141d 85 8a STA &8a ; previous_player_feet_sprite_address_high &141f 85 93 STA &93 ; sprite_address_high &1421 a9 20 LDA #&20 &1423 85 94 STA &94 ; sprite_size_in_bytes &1425 a5 72 LDA &72 ; player_x &1427 18 CLC &1428 69 0a ADC #&0a &142a a6 73 LDX &73 ; player_y &142c 85 7c STA &7c ; previous_player_x &142e 86 7d STX &7d ; previous_player_y &1430 20 03 11 JSR &1103 ; plot_sprite # Plot player feet &1433 a9 58 LDA #&58 &1435 85 94 STA &94 ; sprite_size_in_bytes &1437 a5 8c LDA &8c ; player_head_sprite_address_low &1439 85 89 STA &89 ; previous_player_head_sprite_address_low &143b 85 92 STA &92 ; sprite_address_low &143d c6 93 DEC &93 ; sprite_address_high &143f 20 3a 11 JSR &113a ; plot_sprite_at_screen_address # Plot player head &1442 60 RTS ; check_for_player_touching_tiles &1443 a9 00 LDA #&00 # Set to zero to indicate player hasn't hit obstacle &1445 85 5c STA &5c ; player_hit_obstacle_above &1447 a9 03 LDA #&03 # Consider tiles to right of player &1449 a6 71 LDX &71 ; player_horizontal_movement &144b e0 ff CPX #&ff &144d f0 05 BEQ &1454 ; player_moving_left # if player not moving left &144f 20 5b 14 JSR &145b ; check_tiles &1452 a6 71 LDX &71 ; player_horizontal_movement ; player_moving_left &1454 a9 fe LDA #&fe # Consider tiles to left of player &1456 e0 01 CPX #&01 &1458 d0 01 BNE &145b ; check_tiles # if player not moving right &145a 60 RTS ; check_tiles &145b 20 c2 13 JSR &13c2 ; get_height_of_tile_relative_to_player &145e a5 73 LDA &73 ; player_y &1460 29 08 AND #&08 &1462 49 08 EOR #&08 &1464 85 8e STA &8e ; group &1466 d0 09 BNE &1471 ; skip_tile &1468 20 bd 14 JSR &14bd ; check_tile &146b 29 0c AND #&0c ; TILE_OBSTACLE | TILE_OFFSET &146d c9 0c CMP #&0c ; TILE_OBSTACLE | TILE_OFFSET &146f f0 29 BEQ &149a ; no_obstacle ; skip_tile &1471 20 b8 14 JSR &14b8 ; check_tile_above &1474 29 04 AND #&04 ; TILE_OBSTACLE &1476 d0 22 BNE &149a ; no_obstacle &1478 20 b8 14 JSR &14b8 ; check_tile_above &147b 29 04 AND #&04 ; TILE_OBSTACLE &147d d0 0f BNE &148e ; hit_obstacle_above &147f a5 8e LDA &8e ; group &1481 f0 34 BEQ &14b7 ; leave &1483 20 b8 14 JSR &14b8 ; check_tile_above &1486 c5 8e CMP &8e ; group &1488 b0 2d BCS &14b7 ; leave &148a 29 04 AND #&04 ; TILE_OBSTACLE &148c f0 29 BEQ &14b7 ; leave ; hit_obstacle_above &148e e6 5c INC &5c ; player_hit_obstacle_above # Set to non-zero to indicate player hit obstacle above &1490 a5 74 LDA &74 ; player_jump_or_fall_stage &1492 c9 05 CMP #&05 # Is the player already falling? &1494 90 04 BCC &149a ; no_obstacle &1496 a9 04 LDA #&04 # If not, set player falling &1498 85 74 STA &74 ; player_jump_or_fall_stage ; no_obstacle &149a b9 00 7f LDA &7f00,Y ; tile_table &149d 10 03 BPL &14a2 ; not_special_tile &149f 4c bd 17 JMP &17bd ; check_tile_for_apple ; not_special_tile &14a2 a5 72 LDA &72 ; player_x &14a4 38 SEC &14a5 e5 71 SBC &71 ; player_horizontal_movement &14a7 85 72 STA &72 ; player_x &14a9 a5 78 LDA &78 ; player_initial_jump_or_fall_stage &14ab f0 0a BEQ &14b7 ; leave &14ad a5 74 LDA &74 ; player_jump_or_fall_stage &14af c9 05 CMP #&05 &14b1 b0 04 BCS &14b7 ; leave &14b3 a9 00 LDA #&00 &14b5 85 71 STA &71 ; player_horizontal_movement ; leave &14b7 60 RTS ; check_tile_above &14b8 98 TYA &14b9 38 SEC &14ba e9 10 SBC #&10 &14bc a8 TAY ; check_tile &14bd b9 00 7f LDA &7f00,Y ; tile_table &14c0 10 09 BPL &14cb ; leave &14c2 c9 ef CMP #&ef ; TILE_SPECIAL - 1 &14c4 90 03 BCC &14c9 ; leave_with_one &14c6 29 0f AND #&0f &14c8 60 RTS ; leave_with_one &14c9 a9 01 LDA #&01 ; leave &14cb 60 RTS ; animate_player &14cc a5 71 LDA &71 ; player_horizontal_movement # Is the player moving horizontally? &14ce f0 35 BEQ &1505 ; leave # If not, leave &14d0 29 02 AND #&02 # 0 if moving right, 2 if moving left &14d2 18 CLC &14d3 69 2d ADC #&2d ; player_right_feet_sprite_0 DIV 256 # Use sprite sprite depending on direction &14d5 85 8b STA &8b ; player_feet_sprite_address_high # &2d00 if moving right, &2f00 if moving left &14d7 a5 72 LDA &72 ; player_x &14d9 4a LSR A &14da a9 00 LDA #&00 &14dc 6a ROR A # + &80 if odd x &14dd 85 8c STA &8c ; player_head_sprite_address_low &14df c6 8f DEC &8f ; player_foot_animation_cooldown &14e1 d0 1a BNE &14fd ; set_player_head_sprite &14e3 a2 04 LDX #&04 # Animate feet every four frames &14e5 86 8f STX &8f ; player_foot_animation_cooldown &14e7 a6 78 LDX &78 ; player_initial_jump_or_fall_stage # Non-zero if player is jumping or falling &14e9 d0 12 BNE &14fd ; set_player_feet_sprite &14eb a5 59 LDA &59 ; player_is_riding_platform # Non-zero if player is riding platform &14ed 05 7a ORA &7a ; player_is_jumping # Non-zero if player is jumping &14ef d0 05 BNE &14f6 ; skip_sound &14f1 a9 08 LDA #&08 ; sound_1 # Play sound for walking &14f3 20 55 1b JSR &1b55 ; play_sound ; skip_sound &14f6 a5 7e LDA &7e ; player_feet_sprite_address_low &14f8 18 CLC &14f9 69 20 ADC #&20 &14fb 85 7e STA &7e ; player_feet_sprite_address_low ; set_player_feet_sprite &14fd a5 7e LDA &7e ; player_feet_sprite_address_low &14ff 29 7f AND #&7f &1501 05 8c ORA &8c ; player_head_sprite_address_low &1503 85 7e STA &7e ; player_feet_sprite_address_low ; leave &1505 60 RTS ; check_for_player_on_falling_platforms &1506 ad 59 0c LDA &0c59 ; tile_sprite_addresses_low_table + 9 # Use sprite for falling platform &1509 85 92 STA &92 ; sprite_address_low &150b ad 6d 0c LDA &0c6d ; tile_sprite_addresses_high_table + 9 &150e 85 93 STA &93 ; sprite_address_high &1510 20 c8 13 JSR &13c8 ; get_height_of_player_left_tile # Returns Y = tile offset &1513 20 21 15 JSR &1521 ; check_falling_platform &1516 20 c0 13 JSR &13c0 ; get_height_of_player_right_tile # Returns Y = tile offset &1519 c4 9f CPY &9f ; piston_or_falling_platform_tile_offset # Is this the same tile? &151b f0 03 BEQ &1520 ; leave # If so, don't update it twice &151d 20 21 15 JSR &1521 ; check_falling_platform ; leave &1520 60 RTS ; check_falling_platform &1521 a2 01 LDX #&01 # Falling platform falls one pixel each time &1523 84 9f STY &9f ; piston_or_falling_platform_tile_offset &1525 b9 00 7f LDA &7f00,Y ; tile_table &1528 10 29 BPL &1553 ; leave &152a 29 f0 AND #&f0 ; TILE_SPECIAL &152c f0 25 BEQ &1553 ; leave &152e c9 90 CMP #&90 ; TILE_SPECIAL_PISTON &1530 b0 21 BCS &1553 ; leave &1532 a5 78 LDA &78 ; player_initial_jump_or_fall_stage &1534 f0 06 BEQ &153c ; update_piston_or_falling_platform &1536 a5 77 LDA &77 ; player_jump_or_fall_stage_cooldown &1538 c9 04 CMP #&04 # Is the player falling? &153a 90 17 BCC &1553 ; leave ; update_piston_or_falling_platform &153c 86 9e STX &9e ; direction &153e 84 9f STY &9f ; piston_or_falling_platform_tile_offset &1540 20 54 15 JSR &1554 ; plot_partial_tile # Unplot falling platform or piston &1543 a4 9f LDY &9f ; piston_or_falling_platform_tile_offset &1545 b9 00 7f LDA &7f00,Y ; tile_table &1548 38 SEC &1549 e5 9e SBC &9e ; direction &154b 99 00 7f STA &7f00,Y ; tile_table &154e f0 03 BEQ &1553 ; leave &1550 20 54 15 JSR &1554 ; plot_partial_tile # Replot falling platform or piston ; leave &1553 60 RTS ; plot_partial_tile &1554 b9 00 7f LDA &7f00,Y ; tile_table &1557 29 0f AND #&0f &1559 f0 1a BEQ &1575 ; empty_tile &155b aa TAX &155c bd 40 0c LDA &0c40,X ; piston_or_falling_platform_sprite_sizes - 1 &155f 85 94 STA &94 ; sprite_size_in_bytes ; plot_tile &1561 98 TYA &1562 29 f0 AND #&f0 &1564 38 SEC &1565 e5 6f SBC &6f ; sprite_y_offset &1567 aa TAX &1568 98 TYA &1569 0a ASL A &156a 0a ASL A &156b 0a ASL A &156c 29 7f AND #&7f &156e 18 CLC &156f 69 0c ADC #&0c &1571 20 03 11 JSR &1103 ; plot_sprite &1574 60 RTS ; empty_tile &1575 a9 00 LDA #&00 &1577 99 00 7f STA &7f00,Y ; tile_table &157a 60 RTS ; update_piston_or_falling_platforms &157b a4 60 LDY &60 ; first_piston_tile_offset # Does the level have pistons? &157d f0 3a BEQ &15b9 ; leave &157f ad 58 0c LDA &0c58 ; tile_sprite_addresses_low_table + 8 # Use sprite for piston &1582 85 92 STA &92 ; sprite_address_low &1584 ad 6c 0c LDA &0c6c ; tile_sprite_addresses_high_table + 8 &1587 85 93 STA &93 ; sprite_address_high &1589 a6 66 LDX &66 ; pistons_current_direction &158b 20 3c 15 JSR &153c ; update_piston_or_falling_platform # Update left piston &158e a5 60 LDA &60 ; first_piston_tile_offset &1590 18 CLC &1591 65 61 ADC &61 ; number_of_visible_pistons &1593 a8 TAY &1594 a6 67 LDX &67 ; pistons_other_direction &1596 20 3c 15 JSR &153c ; update_piston_or_falling_platform # Update right piston &1599 c6 65 DEC &65 ; pistons_frame &159b d0 1c BNE &15b9 ; leave # Has one piston completely disappeared? &159d a5 64 LDA &64 ; pistons_maximum_frame &159f 85 65 STA &65 ; pistons_frame &15a1 a5 60 LDA &60 ; first_piston_tile_offset &15a3 18 CLC &15a4 65 66 ADC &66 ; pistons_current_direction # If so, move to the next &15a6 c5 62 CMP &62 ; maximum_first_piston_tile_offset &15a8 b0 04 BCS &15ae ; change_pistons_direction &15aa c5 63 CMP &63 ; minimum_first_piston_tile_offset &15ac b0 09 BCS &15b7 ; set_first_piston_tile_offset ; change_pistons_direction &15ae a5 66 LDA &66 ; pistons_current_direction # Swap direction at ends &15b0 a6 67 LDX &67 ; pistons_other_direction &15b2 85 67 STA &67 ; pistons_other_direction &15b4 86 66 STX &66 ; pistons_current_direction &15b6 60 RTS ; set_first_piston_tile_offset &15b7 85 60 STA &60 ; first_piston_tile_offset ; leave &15b9 60 RTS ; update_enemies &15ba a4 68 LDY &68 ; number_of_enemies &15bc 84 69 STY &69 ; enemy_to_consider ; update_enemies_loop &15be a4 69 LDY &69 ; enemy_to_consider &15c0 b9 96 0c LDA &0c96,Y ; enemies_flags &15c3 85 6a STA &6a ; enemy_flags &15c5 20 f8 16 JSR &16f8 ; update_enemy &15c8 c6 69 DEC &69 ; enemy_to_consider &15ca 10 f2 BPL &15be ; update_enemies_loop &15cc 60 RTS ; move_enemy # Called with Y = enemy_to_consider &15cd f0 07 BEQ &15d6 ; enemy_moving_horizontally # A = enemy_flags & ENEMY_VERTICAL ; enemy_moving_vertically &15cf 98 TYA &15d0 18 CLC &15d1 69 49 ADC #&49 ; enemies_y - enemies_x # Change enemy y position if moving vertically &15d3 aa TAX &15d4 d0 02 BNE &15d8 ; update_position ; enemy_moving_horizontally &15d6 98 TYA &15d7 aa TAX # Change enemy x position if moving horizontally ; update_position &15d8 b9 9c 0c LDA &0c9c,Y ; enemies_position_fraction # Add fraction to position &15db 18 CLC &15dc 79 a2 0c ADC &0ca2,Y ; enemies_speed &15df 99 9c 0c STA &0c9c,Y ; enemies_position_fraction &15e2 90 7a BCC &165e ; leave # Leave with carry clear if position unchanged (unused) &15e4 b9 96 0c LDA &0c96,Y ; enemies_flags &15e7 18 CLC &15e8 69 40 ADC #&40 # Top two bits of flags used as frame cooldown &15ea 99 96 0c STA &0c96,Y ; enemies_flags &15ed 90 08 BCC &15f7 ; skip_frame &15ef b9 b4 0c LDA &0cb4,Y ; enemies_frame &15f2 49 01 EOR #&01 # Alternate sprite &15f4 99 b4 0c STA &0cb4,Y ; enemies_frame ; skip_frame &15f7 bd 78 0c LDA &0c78,X ; enemies_x # Add direction to position &15fa 18 CLC &15fb 79 a8 0c ADC &0ca8,Y ; enemies_direction &15fe 9d 78 0c STA &0c78,X ; enemies_x &1601 d9 8a 0c CMP &0c8a,Y ; enemies_position_minimum &1604 b0 2a BCS &1630 ; not_at_minimum # Is the enemy at the left or top of its range? &1606 20 39 1b JSR &1b39 ; update_spider # Make spiders on level 10 wait at top of range &1609 a9 05 LDA #&05 # Reset bounce of bird when turning right &160b 85 5d STA &5d ; bird_bounce_cooldown &160d a9 08 LDA #&08 &160f 85 5e STA &5e ; bird_bounce_stage &1611 b9 ae 0c LDA &0cae,Y ; enemies_base_sprite &1614 c9 90 CMP #&90 ; SNAIL_LEFT &1616 f0 04 BEQ &161c ; flip_sprite &1618 c9 b4 CMP #&b4 ; BIRD_LEFT &161a d0 05 BNE &1621 ; skip_flipping_sprite ; flip_sprite_at_minimum &161c e9 0c SBC #&0c # Use right sprites for snail and bird &161e 99 ae 0c STA &0cae,Y ; enemies_base_sprite ; skip_flipping_sprite_at_minimum &1621 a9 02 LDA #&02 ; ENEMY_RIGHT_TO_LEFT &1623 39 96 0c AND &0c96,Y ; enemies_flags # Does the enemy only move from right to left? &1626 f0 2c BEQ &1654 ; flip_direction &1628 b9 90 0c LDA &0c90,Y ; enemies_position_maximum # If so, move the enemy to its rightmost position &162b 9d 78 0c STA &0c78,X ; enemies_x &162e d0 2d BNE &165d ; leave_with_carry_set # Always branches ; not_at_minimum &1630 d9 90 0c CMP &0c90,Y ; enemies_position_maximum # Is the enemy at the right or bottom of its range? &1633 90 28 BCC &165d ; leave_with_carry_set &1635 b9 ae 0c LDA &0cae,Y ; enemies_base_sprite &1638 c9 84 CMP #&84 ; SNAIL_RIGHT &163a f0 04 BEQ &1640 ; flip_sprite_at_maximum &163c c9 a8 CMP #&a8 ; BIRD_RIGHT &163e d0 05 BNE &1645 ; skip_flipping_sprite_at_maximum ; flip_sprite_at_maximum &1640 69 0b ADC #&0b # Use left sprites for snail and bird &1642 99 ae 0c STA &0cae,Y ; enemies_base_sprite ; skip_flipping_sprite_at_maximum &1645 a9 04 LDA #&04 ; ENEMY_LEFT_TO_RIGHT &1647 39 96 0c AND &0c96,Y ; enemies_flags # Does the enemy only move from left to right? &164a f0 08 BEQ &1654 ; flip_direction &164c b9 8a 0c LDA &0c8a,Y ; enemies_position_minimum # If so, move the enemy to its leftmost position &164f 9d 78 0c STA &0c78,X ; enemies_x &1652 d0 09 BNE &165d ; leave_with_carry_set # Always branches ; flip_direction &1654 a9 00 LDA #&00 &1656 38 SEC &1657 f9 a8 0c SBC &0ca8,Y ; enemies_direction # Invert direction &165a 99 a8 0c STA &0ca8,Y ; enemies_direction ; leave_with_carry_set &165d 38 SEC # Leave with carry set if position changed (unused) ; leave &165e 60 RTS ; replot_enemy # Called with Y = enemy to replot &165f be ba 0c LDX &0cba,Y ; enemies_sprite &1662 bd 04 09 LDA &0904,X ; enemy_sprites_address_high_table &1665 85 93 STA &93 ; sprite_address_high &1667 bd 08 09 LDA &0908,X ; enemy_sprites_address_low_table &166a 85 92 STA &92 ; sprite_address_low &166c be ae 0c LDX &0cae,Y ; enemies_base_sprite &166f bd 00 09 LDA &0900,X ; enemy_sprites_size_in_bytes &1672 85 94 STA &94 ; sprite_size_in_bytes &1674 bd 01 09 LDA &0901,X ; enemy_sprites_width_in_bytes &1677 85 95 STA &95 ; sprite_width_in_bytes &1679 be 84 0c LDX &0c84,Y ; enemies_previous_y # Zero if enemy doesn't need unplotting &167c f0 06 BEQ &1684 ; skip_unplotting_enemy &167e b9 7e 0c LDA &0c7e,Y ; enemies_previous_x &1681 20 03 11 JSR &1103 ; plot_sprite # Unplot enemy ; skip_unplotting_enemy &1684 a4 69 LDY &69 ; enemy_to_consider &1686 88 DEY &1687 b9 ae 0c LDA &0cae,Y ; enemies_base_sprite &168a 18 CLC &168b 79 b4 0c ADC &0cb4,Y ; enemies_frame &168e aa TAX &168f b9 78 0c LDA &0c78,Y ; enemies_x &1692 4a LSR A &1693 90 02 BCC &1697 ; not_odd_x &1695 e8 INX # Use second pair of sprites for odd x positions &1696 e8 INX ; not_odd_x &1697 8a TXA &1698 99 ba 0c STA &0cba,Y ; enemies_sprite &169b bd 04 09 LDA &0904,X ; enemy_sprites_address_high_table &169e 85 93 STA &93 ; sprite_address_high &16a0 bd 08 09 LDA &0908,X ; enemy_sprites_address_low_table &16a3 85 92 STA &92 ; sprite_address_low &16a5 b9 c1 0c LDA &0cc1,Y ; enemies_y &16a8 99 84 0c STA &0c84,Y ; enemies_previous_y &16ab aa TAX &16ac b9 78 0c LDA &0c78,Y ; enemies_x &16af 18 CLC &16b0 69 08 ADC #&08 # Offset enemies so enemies_x is centre of enemy &16b2 99 7e 0c STA &0c7e,Y ; enemies_previous_x &16b5 20 03 11 JSR &1103 ; plot_sprite # Replot enemy &16b8 60 RTS ; check_for_player_touching_enemy &16b9 a4 69 LDY &69 ; enemy_to_consider &16bb be ae 0c LDX &0cae,Y ; enemies_base_sprite &16be a5 72 LDA &72 ; player_x # Is the player touching the enemy? &16c0 18 CLC &16c1 69 08 ADC #&08 &16c3 d9 78 0c CMP &0c78,Y ; enemies_x &16c6 90 2f BCC &16f7 ; leave &16c8 18 CLC &16c9 7d 02 09 ADC &0902,X ; enemy_sprites_width &16cc b0 02 BCS &16d0 ; skip_ceiling &16ce a9 00 LDA #&00 ; skip_ceiling &16d0 d9 78 0c CMP &0c78,Y ; enemies_x &16d3 b0 22 BCS &16f7 ; leave &16d5 a5 73 LDA &73 ; player_y &16d7 38 SEC &16d8 e9 1d SBC #&1d &16da d9 c1 0c CMP &0cc1,Y ; enemies_y &16dd b0 18 BCS &16f7 ; leave &16df 18 CLC &16e0 7d 03 09 ADC &0903,X ; enemy_sprites_height &16e3 d9 c1 0c CMP &0cc1,Y ; enemies_y &16e6 90 0f BCC &16f7 ; leave &16e8 b9 96 0c LDA &0c96,Y ; enemies_flags &16eb 29 08 AND #&08 ; ENEMY_PLATFORM # Is the enemy a platform? &16ed f0 04 BEQ &16f3 ; kill_player # If not, kill the player &16ef 20 e3 19 JSR &19e3 ; consider_moving_player_with_platform # Otherwise, move the player &16f2 60 RTS ; kill_player &16f3 a9 01 LDA #&01 # Set to positive non-zero to indicate player killed &16f5 85 98 STA &98 ; player_was_killed ; leave &16f7 60 RTS ; update_enemy &16f8 a5 6a LDA &6a ; enemy_flags &16fa 29 01 AND #&01 ; ENEMY_VERTICAL &16fc 20 cd 15 JSR &15cd ; move_enemy &16ff 20 b9 16 JSR &16b9 ; check_for_player_touching_enemy &1702 20 f7 1a JSR &1af7 ; update_bird &1705 60 RTS ; initialise_enemies &1706 a9 05 LDA #&05 &1708 85 5d STA &5d ; bird_bounce_cooldown &170a a9 08 LDA #&08 &170c 85 5e STA &5e ; bird_bounce_stage &170e 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for number of enemies &1711 85 68 STA &68 ; number_of_enemies &1713 aa TAX ; initialise_enemies_loop # For each enemy, &1714 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for enemy x &1717 9d 78 0c STA &0c78,X ; enemies_x &171a 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for enemy y &171d 9d c1 0c STA &0cc1,X ; enemies_y &1720 9d e6 0c STA &0ce6,X ; enemies_y_top_of_bounce &1723 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for minimum enemy x or y &1726 9d 8a 0c STA &0c8a,X ; enemies_position_minimum &1729 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for maximum enemy x or y &172c 9d 90 0c STA &0c90,X ; enemies_position_maximum &172f b1 81 LDA (&81),Y ; level_data_address # Get a byte of level data &1731 29 c0 AND #&c0 # 84...... speed &1733 09 3f ORA #&3f &1735 9d a2 0c STA &0ca2,X ; enemies_speed &1738 20 70 17 JSR &1770 ; read_byte_of_level_data_as_two_nibbles # ....8421 sprite &173b 05 4d ORA &4d ; enemy_sprite_offset # &10 in contraption level, &00 in regular level &173d 85 7b STA &7b ; tmp # Multiply by 9 to get offset in enemy_sprites_data &173f 0a ASL A &1740 65 7b ADC &7b ; tmp &1742 0a ASL A &1743 0a ASL A &1744 d0 06 BNE &174c ; not_bathtub &1746 e4 68 CPX &68 ; number_of_enemies &1748 f0 02 BEQ &174c ; not_bathtub &174a a9 c0 LDA #&c0 ; BATHTUB # Set first two enemies on level 9 to be bathtubs ; not_bathtub &174c 9d ae 0c STA &0cae,X ; enemies_base_sprite &174f a5 86 LDA &86 ; high_nibble # ..21.... zero if stationary, non-zero if moving &1751 29 03 AND #&03 &1753 9d a8 0c STA &0ca8,X ; enemies_direction &1756 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for enemy flags &1759 9d 96 0c STA &0c96,X ; enemies_flags &175c a9 00 LDA #&00 &175e 9d 84 0c STA &0c84,X ; enemies_previous_y # Set to zero to indicate enemy doesn't need unplotting &1761 9d 9c 0c STA &0c9c,X ; enemies_position_fraction &1764 ca DEX &1765 10 ad BPL &1714 &1767 60 RTS ; read_byte_of_data &1768 b1 81 LDA (&81),Y ; level_data_address &176a c8 INY &176b d0 02 BNE &176f ; leave &176d e6 82 INC &82 ; level_data_address_high ; leave &176f 60 RTS ; read_byte_of_level_data_as_two_nibbles &1770 20 68 17 JSR &1768 ; read_byte_of_data &1773 85 7b STA &7b ; byte &1775 4a LSR A &1776 4a LSR A &1777 4a LSR A &1778 4a LSR A &1779 85 86 STA &86 ; high_nibble &177b a5 7b LDA &7b ; byte &177d 29 0f AND #&0f # Leave with A = low_nibble &177f 60 RTS ; initialise_level_data &1780 20 1a 18 JSR &181a ; initialise_tile_sprites_and_colours &1783 b1 81 LDA (&81),Y ; level_data_address # Get a byte of level data for player y position &1785 29 f0 AND #&f0 &1787 69 ff ADC #&ff &1789 85 73 STA &73 ; player_y &178b 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for player x position &178e 0a ASL A &178f 0a ASL A &1790 0a ASL A &1791 0a ASL A &1792 69 02 ADC #&02 &1794 85 72 STA &72 ; player_x &1796 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for first piston tile offset &1799 85 63 STA &63 ; minimum_first_piston_tile_offset &179b 85 60 STA &60 ; first_piston_tile_offset &179d aa TAX &179e f0 19 BEQ &17b9 ; skip_pistons # If zero, there are no pistons. Otherwise, &17a0 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for last piston tile offset &17a3 85 62 STA &62 ; maximum_first_piston_tile_offset &17a5 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for number of visible pistons &17a8 85 61 STA &61 ; number_of_visible_pistons &17aa 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for piston height (always &f) &17ad 85 64 STA &64 ; pistons_maximum_frame &17af 85 65 STA &65 ; pistons_frame &17b1 a9 01 LDA #&01 &17b3 85 67 STA &67 ; pistons_other_direction &17b5 a9 ff LDA #&ff # Pistons start moving left to right &17b7 85 66 STA &66 ; pistons_current_direction ; skip_pistons &17b9 20 06 17 JSR &1706 ; initialise_enemies &17bc 60 RTS ; check_tile_for_apple &17bd c9 ff CMP #&ff ; TILE_APPLE | TILE_SPECIAL # Does the tile contain an apple? &17bf d0 19 BNE &17da ; check_tile_for_deadly &17c1 a9 00 LDA #&00 ; TILE_EMPTY # If so, empty the file &17c3 99 00 7f STA &7f00,Y ; tile_table &17c6 a2 0f LDX #&0f ; TILE_APPLE # Replot apple to remove from screen &17c8 20 03 18 JSR &1803 ; replot_tile &17cb a9 04 LDA #&04 # Score 40 points for collecting apple &17cd 20 bd 1b JSR &1bbd ; increase_score &17d0 a9 00 LDA #&00 ; sound_0 # Play sound for collecting apple &17d2 20 55 1b JSR &1b55 ; play_sound &17d5 c6 6d DEC &6d ; apples_remaining &17d7 f0 0e BEQ &17e7 ; open_door # Open the door if all apples have been collected &17d9 60 RTS ; check_tile_for_deadly &17da 29 f7 AND #&f7 &17dc c9 f6 CMP #&f6 ; TILE_DEADLY | TILE_SPECIAL # Does the tile contain something deadly? &17de d0 31 BNE &1811 ; check_tile_for_door &17e0 a9 01 LDA #&01 &17e2 85 98 STA &98 ; player_was_killed # Set to positive non-zero to indicate player killed &17e4 85 4f STA &4f ; player_can_drop_apples # Set to non-zero to indicate player can drop apples in &17e6 60 RTS # contraption level (drop point isn't deadly, see &1c88) ; open_door &17e7 a0 00 LDY #&00 ; find_door_loop # Find the tile containing the top of the door &17e9 c8 INY &17ea b9 00 7f LDA &7f00,Y ; tile_table &17ed c9 f7 CMP #&f7 ; TILE_DOOR | TILE_SPECIAL &17ef d0 f8 BNE &17e9 ; find_door_loop &17f1 06 94 ASL &94 ; sprite_size_in_bytes # Door is twice the height of regular sprites &17f3 a9 01 LDA #&01 # Use offset for double height tile &17f5 85 6f STA &6f ; sprite_y_offset &17f7 a2 12 LDX #&12 ; TILE_OPEN_DOOR # Use tile_sprite_addresses + &12 for open door &17f9 20 03 18 JSR &1803 ; replot_tile # EOR open door sprite over closed door sprite &17fc 46 94 LSR &94 ; sprite_size_in_bytes # Use regular height next time &17fe a9 09 LDA #&09 # Use offset for regular height tile next tile &1800 85 6f STA &6f ; sprite_y_offset &1802 60 RTS ; replot_tile &1803 bd 50 0c LDA &0c50,X ; tile_sprite_addresses_low_table # Use sprite for tile &1806 85 92 STA &92 ; sprite_address_low &1808 bd 64 0c LDA &0c64,X ; tile_sprite_addresses_high_table &180b 85 93 STA &93 ; sprite_address_high &180d 20 61 15 JSR &1561 ; plot_tile &1810 60 RTS ; check_tile_for_door &1811 a5 6d LDA &6d ; apples_remaining # If the tile contains the door and all apples collected &1813 d0 04 BNE &1819 ; leave &1815 a9 ff LDA #&ff # Set to negative non-zero to indicate level completed &1817 85 98 STA &98 ; player_was_killed ; leave &1819 60 RTS ; initialise_tile_sprites_and_colours &181a a2 13 LDX #&13 # For each of 20 tiles, in reverse order ; initialise_tile_sprites_loop &181c 20 68 17 JSR &1768 ; read_byte_of_data # Get a byte of level data for sprite to use &181f 4a LSR A &1820 66 7b ROR &7b ; tmp &1822 4a LSR A &1823 66 7b ROR &7b ; tmp &1825 18 CLC &1826 69 74 ADC #&74 # Convert to sprite address (&7400 + sprite * &40) &1828 9d 64 0c STA &0c64,X ; tile_sprite_addresses_high_table &182b a5 7b LDA &7b ; tmp &182d 29 c0 AND #&c0 &182f 9d 50 0c STA &0c50,X ; tile_sprite_addresses_low_table &1832 ca DEX &1833 10 e7 BPL &181c ; initialise_tile_sprites_loop &1835 20 70 17 JSR &1770 ; read_byte_of_level_data_as_two_nibbles # Get a byte of level data for colours 0 and 2 &1838 a2 00 LDX #&00 &183a 20 54 18 JSR &1854 ; set_colour # Set colour 0 from low nibble &183d a5 86 LDA &86 ; high_nibble &183f a2 02 LDX #&02 &1841 20 54 18 JSR &1854 ; set_colour # Set colour 2 from high nibble &1844 20 70 17 JSR &1770 ; read_byte_of_level_data_as_two_nibbles # Get a byte of level data for colours 1 and 3 &1847 a2 01 LDX #&01 &1849 20 54 18 JSR &1854 ; set_colour # Set colour 1 from low nibble &184c a5 86 LDA &86 ; high_nibble &184e a2 03 LDX #&03 &1850 20 54 18 JSR &1854 ; set_colour # Set colour 3 from high nibble &1853 60 RTS ; set_colour # Called with X = logical colour, A = physical colour &1854 85 7b STA &7b ; physical_colour &1856 a9 13 LDA #&13 # Define colour &1858 20 ee ff JSR &ffee ; OSWRCH &185b 8a TXA ; logical_colour &185c 20 ee ff JSR &ffee ; OSWRCH &185f a5 7b LDA &7b ; physical_colour &1861 20 ee ff JSR &ffee ; OSWRCH &1864 a9 00 LDA #&00 &1866 20 ee ff JSR &ffee ; OSWRCH &1869 20 ee ff JSR &ffee ; OSWRCH &186c 20 ee ff JSR &ffee ; OSWRCH &186f 60 RTS ; replot_player_and_enemies &1870 a5 73 LDA &73 ; player_y &1872 8d c0 0c STA &0cc0 ; sprites_y, or enemies_y - 1 &1875 a9 00 LDA #&00 &1877 a4 68 LDY &68 ; number_of_enemies &1879 c8 INY &187a 8c cf 0c STY &0ccf ; sprites_needing_replotting # All enemies and player need replotting ; reset_sprites_replotted_loop &187d 99 c7 0c STA &0cc7,Y ; sprites_replotted # Set to zero to indicate sprite not replotted &1880 88 DEY &1881 10 fa BPL &187d ; reset_sprites_replotted_loop ; replot_player_and_enemies_loop &1883 c6 69 DEC &69 ; enemy_to_consider # Consider the next enemy (or player if Y = 0) &1885 88 DEY &1886 10 05 BPL &188d ; skip_wraparound &1888 a4 68 LDY &68 ; number_of_enemies &188a c8 INY &188b 84 69 STY &69 ; enemy_to_consider ; skip_wraparound &188d b9 c7 0c LDA &0cc7,Y ; sprites_replotted # Has it already been replotted? &1890 d0 f1 BNE &1883 ; replot_player_and_enemies_loop &1892 ad 69 fe LDA &fe69 ; User VIA timer 2 counter MSB # If not, calculate time elapsed since v-sync &1895 49 ff EOR #&ff &1897 38 SEC &1898 69 4e ADC #&4e # Timer started at &4e at v-sync &189a 85 7b STA &7b ; elapsed &189c 4a LSR A &189d 4a LSR A &189e 4a LSR A &189f 49 ff EOR #&ff &18a1 38 SEC &18a2 65 7b ADC &7b ; elapsed &18a4 0a ASL A &18a5 0a ASL A &18a6 85 7b STA &7b ; elapsed # Calculate elapsed * 5 - elapsed / 8 &18a8 b9 c0 0c LDA &0cc0,Y ; sprites_y, or enemies_y - 1 &18ab 18 CLC &18ac 69 28 ADC #&28 &18ae 90 03 BCC &18b3 ; skip_inversion &18b0 20 db 18 JSR &18db ; invert_elapsed ; skip_inversion &18b3 c5 7b CMP &7b ; invert_A_and_elapsed # Is the sprite in an area of the screen that is &18b5 90 0c BCC &18c3 ; sprite_is_safe_to_replot # currently being replotted? If not, plot it &18b7 38 SEC &18b8 e9 78 SBC #&78 &18ba b0 03 BCS &18bf ; skip_inversion &18bc 20 db 18 JSR &18db ; invert_elapsed ; skip_inversion &18bf c5 7b CMP &7b ; invert_A_and_elapsed &18c1 90 c0 BCC &1883 ; replot_player_and_enemies_loop # Otherwise, look for something else to plot ; sprite_is_safe_to_replot &18c3 a9 01 LDA #&01 # Set to non-zero to indicate sprite replotted &18c5 99 c7 0c STA &0cc7,Y ; sprites_replotted &18c8 20 e6 18 JSR &18e6 ; replot_player_or_enemy # Replot sprite &18cb a4 69 LDY &69 ; enemy_to_consider &18cd ce cf 0c DEC &0ccf ; sprites_needing_replotting # Does anything else need replotting? &18d0 10 b1 BPL &1883 ; replot_player_and_enemies_loop &18d2 a9 40 LDA #&40 # 16 pixels high &18d4 85 94 STA &94 ; sprite_size_in_bytes &18d6 a9 20 LDA #&20 # 16 pixels wide &18d8 85 95 STA &95 ; sprite_width_in_bytes &18da 60 RTS ; invert_A_and_elapsed &18db 49 80 EOR #&80 &18dd aa TAX &18de a5 7b LDA &7b ; tmp &18e0 49 80 EOR #&80 &18e2 85 7b STA &7b ; tmp &18e4 8a TXA &18e5 60 RTS ; replot_player_or_enemy &18e6 98 TYA # Zero for player &18e7 d0 04 BNE &18ed ; is_enemy &18e9 20 ef 13 JSR &13ef ; replot_player &18ec 60 RTS ; is_enemy &18ed 88 DEY &18ee 20 5f 16 JSR &165f ; replot_enemy &18f1 60 RTS ; reset_score_and_jump &18f2 a0 06 LDY #&06 &18f4 a9 30 LDA #&30 ; "0" ; reset_score_loop # Set score to 000000 &18f6 99 f0 0c STA &0cf0,Y ; score - 1 &18f9 88 DEY &18fa d0 fa BNE &18f6 ; reset_score_loop &18fc 85 54 STA &54 ; previous_score_thousands &18fe 84 4d STY &4d ; enemy_sprite_offset # Set to zero to indicate regular level ; reset_jump &1900 a0 00 LDY #&00 &1902 84 7a STY &7a ; player_is_jumping # Set to zero to indicate player not jumping &1904 88 DEY ; #&ff &1905 84 6b STY &6b ; jump_or_fall_initial_y # Set to &ff to suppress falling too far &1907 60 RTS ; initialise_level &1908 a9 00 LDA #&00 &190a 85 78 STA &78 ; player_initial_jump_or_fall_stage # Set to zero to indicate player not jumping or falling &190c 85 98 STA &98 ; player_was_killed # Set to zero to indicate player not yet killed &190e 85 8a STA &8a ; previous_player_feet_sprite_address_high # Set to zero to indicate player doesn't need unplotting &1910 85 4f STA &4f ; player_can_drop_apples # Set to zero to indicate player can't drop apples &1912 a9 2f LDA #&2f &1914 85 96 STA &96 ; minimum_screen_address_high # Tiles can be plotted anywhere on screen &1916 a5 82 LDA &82 ; level_data_address_high &1918 85 51 STA &51 ; previous_level_data_address_high &191a a5 80 LDA &80 ; level_data_offset &191c 85 52 STA &52 ; previous_level_data_offset &191e 20 81 11 JSR &1181 ; initialise_level_screen &1921 20 87 1b JSR &1b87 ; plot_lives &1924 a9 00 LDA #&00 # Fix last byte of player_left_feet_sprite_7 &1926 8d 00 30 STA &3000 ; player_left_odd_feet_sprite_3 + &2f &1929 a5 53 LDA &53 ; levels_left_in_round &192b a2 30 LDX #&30 # Enemies can be plotted any except very top of screen &192d c9 02 CMP #&02 &192f d0 02 BNE &1933 ; not_level_10 &1931 a2 3c LDX #&3c # Spiders on level 10 aren't plotted in top of screen ; not_level_10 &1933 86 96 STX &96 ; minimum_screen_address_high &1935 60 RTS ; start_game &1936 a9 03 LDA #&03 # Player starts with three lives &1938 85 50 STA &50 ; player_lives ; game_round_loop &193a a9 01 LDA #&01 # Non-zero to play music &193c 8d 8a 02 STA &028a ; music_playing &193f a9 00 LDA #&00 # Start at start of tune &1941 8d 8b 02 STA &028b ; note_offset &1944 a5 5a LDA &5a ; first_level_data_address_high # Start on level 1 &1946 85 82 STA &82 ; level_data_address_high &1948 a5 5b LDA &5b ; first_level_data_offset &194a 85 80 STA &80 ; level_data_offset &194c 20 00 19 JSR &1900 ; reset_jump &194f a9 01 LDA #&01 # Non-zero to allow player movement &1951 85 55 STA &55 ; allow_player_movement &1953 a9 14 LDA #&14 ; 10 * 2 # Ten levels per round &1955 85 53 STA &53 ; levels_left_in_round ; game_level_loop &1957 20 08 19 JSR &1908 ; initialise_level &195a a5 4d LDA &4d ; enemy_sprite_offset # Zero if regular level, non-zero if contraption level &195c d0 04 BNE &1962 ; skip_setting_apples_total &195e a5 6d LDA &6d ; apples_remaining &1960 85 4a STA &4a ; apples_total ; skip_setting_apples_total &1962 a5 4a LDA &4a ; apples_total &1964 85 4e STA &4e ; apples_to_drop &1966 a9 05 LDA #&05 &1968 20 73 1b JSR &1b73 ; long_delay ; game_loop &196b 20 65 13 JSR &1365 ; update_game &196e 20 4d 1c JSR &1c4d ; update_contraption_level # Add bounce from pistons, and drop apples &1971 a5 ec LDA &ec ; os_most_recently_pressed_key &1973 c9 d9 CMP #&d9 ; DELETE &1975 d0 06 BNE &197d ; delete_not_pressed # If DELETE is pressed, ; wait_for_copy &1977 a5 ec LDA &ec ; os_most_recently_pressed_key &1979 c9 e9 CMP #&e9 ; COPY &197b d0 fa BNE &1977 ; wait_for_copy # pause the game until COPY is pressed ; delete_not_pressed &197d a5 98 LDA &98 ; player_was_killed # Positive if player killed, negative if level completed &197f f0 ea BEQ &196b ; game_loop &1981 30 19 BMI &199c ; level_completed # If the player was killed, &1983 a5 51 LDA &51 ; previous_level_data_address_high # Use the same level for the next life &1985 85 82 STA &82 ; level_data_address_high &1987 a5 52 LDA &52 ; previous_level_data_offset &1989 85 80 STA &80 ; level_data_offset &198b a9 00 LDA #&00 # Set to zero to indicate level in progress &198d 85 98 STA &98 ; player_was_killed &198f 20 3a 1c JSR &1c3a ; unplot_player_and_play_dying_sounds &1992 c6 50 DEC &50 ; player_lives &1994 d0 c1 BNE &1957 ; game_level_loop &1996 20 08 1c JSR &1c08 ; game_over_screen &1999 4c 60 1a JMP &1a60 ; title_screen ; level_completed # If the level was completed, &199c 20 b5 1c JSR &1cb5 ; change_level_data_address # move to the next level &199f a9 00 LDA #&00 &19a1 85 98 STA &98 ; player_was_killed &19a3 a9 04 LDA #&04 &19a5 20 73 1b JSR &1b73 ; long_delay &19a8 c6 53 DEC &53 ; levels_left_in_round &19aa d0 ab BNE &1957 ; game_level_loop # After the tenth contraption level, &19ac 4c 3a 19 JMP &193a ; game_round_loop # start again on level 1 ; attract_screen &19af a5 82 LDA &82 ; level_data_address_high # Store first level address &19b1 85 5a STA &5a ; first_level_data_address_high &19b3 a5 80 LDA &80 ; level_data_offset &19b5 85 5b STA &5b ; first_level_data_offset &19b7 a9 00 LDA #&00 &19b9 85 71 STA &71 ; player_horizontal_movement &19bb a5 5f LDA &5f ; player_wants_to_start_game # Zero if player pressed SPACE in title screen &19bd f0 14 BEQ &19d3 ; to_start_game ; attract_screen_level_loop &19bf 20 08 19 JSR &1908 ; initialise_level &19c2 a9 00 LDA #&00 &19c4 85 56 STA &56 ; frames ; attract_screen_loop &19c6 20 65 13 JSR &1365 ; update_game &19c9 a5 98 LDA &98 ; player_was_killed &19cb d0 0d BNE &19da ; next_level # Change attract screen if player killed &19cd a5 ec LDA &ec ; os_most_recently_pressed_key &19cf c9 e2 CMP #&e2 ; SPACE # Continue attract screen until SPACE pressed &19d1 d0 03 BNE &19d6 ; next_frame ; to_start_game &19d3 4c 36 19 JMP &1936 ; start_game ; next_frame &19d6 c6 56 DEC &56 ; frames &19d8 d0 ec BNE &19c6 ; attract_screen_loop # Change attract screen after 256 frames ; next_level &19da c6 53 DEC &53 ; levels_left_in_round # Skip contraption levels &19dc c6 53 DEC &53 ; levels_left_in_round &19de d0 df BNE &19bf ; attract_screen_loop &19e0 4c 60 1a JMP &1a60 ; title_screen # Return to title screen after level 10 ; consider_moving_player_with_platform &19e3 a5 5c LDA &5c ; player_hit_obstacle_above &19e5 f0 0c BEQ &19f3 ; move_player_with_platform # Is there an obstacle above the player? &19e7 a5 72 LDA &72 ; player_x &19e9 29 07 AND #&07 # If so, &19eb c9 02 CMP #&02 &19ed f0 04 BEQ &19f3 ; move_player_with_platform # (unclear) &19ef c9 04 CMP #&04 &19f1 d0 28 BNE &1a1b ; leave # don't move player with platform in some cases ; move_player_with_platform &19f3 a5 74 LDA &74 ; player_jump_or_fall_stage &19f5 c9 04 CMP #&04 &19f7 90 04 BCC &19fd ; is_falling &19f9 a5 7a LDA &7a ; player_is_jumping # Non-zero if player is jumping &19fb d0 1e BNE &1a1b ; leave ; is_falling # If the player isn't jumping, &19fd b9 c1 0c LDA &0cc1,Y ; enemies_y &1a00 38 SEC &1a01 e9 07 SBC #&07 &1a03 c5 73 CMP &73 ; player_y &1a05 90 14 BCC &1a1b ; leave &1a07 be a8 0c LDX &0ca8,Y ; enemies_direction &1a0a 10 02 BPL &1a0e ; set_player_y # Is the platform moving down? &1a0c 69 fd ADC #&fd # If not, put player above platform ; set_player_y &1a0e 85 73 STA &73 ; player_y &1a10 20 0f 13 JSR &130f ; stop_player_falling &1a13 a5 73 LDA &73 ; player_y &1a15 85 6b STA &6b ; jump_or_fall_initial_y &1a17 a9 ff LDA #&ff # Set to non-zero to indicate player is riding platform &1a19 85 59 STA &59 ; player_is_riding_platform ; leave &1a1b 60 RTS ; initialisation &1a1c 20 e5 1a JSR &1ae5 ; relocate_7200_to_0900 &1a1f 20 32 1a JSR &1a32 ; write_video_registers_and_text_window &1a22 20 3e 1a JSR &1a3e ; initialise_event_and_irq_handlers &1a25 a9 01 LDA #&01 &1a27 a0 10 LDY #&10 ; initialise_bottom_row_of_tile_table_loop &1a29 99 f0 7f STA &7ff0,Y ; tile_table + &f0 # Set &7ff0 - &8000 to &01 (for bottom row of tiles) &1a2c 88 DEY &1a2d 10 fa BPL &1a29 ; initialise_bottom_row_of_tile_table_loop &1a2f 4c 60 1a JMP &1a60 ; title_screen ; write_video_registers_and_text_window &1a32 a2 2d LDX #&2d ; write_video_registers_and_text_window_loop &1a34 bd 80 0c LDA &0c80,X ; video_registers_and_text_window_string - 1 &1a37 20 ee ff JSR &ffee ; OSWRCH &1a3a ca DEX &1a3b d0 f7 BNE &1a34 ; write_video_registers_and_text_window_loop &1a3d 60 RTS ; initialise_event_and_irq_handlers &1a3e a9 c0 LDA #&c0 &1a40 85 e0 STA &e0 ; os_row_multiplication_table_low &1a42 a9 0a LDA #&0a ; &0ac0 = row_multiplication_table &1a44 85 e1 STA &e1 ; os_row_multiplication_table_high &1a46 a9 20 LDA #&20 &1a48 8d 20 02 STA &0220 ; event_vector_low &1a4b a9 06 LDA #&06 ; &0620 = event_handler &1a4d 8d 21 02 STA &0221 ; event_vector_high &1a50 a9 00 LDA #&00 # Set to zero to suppress music &1a52 8d 8a 02 STA &028a ; music_playing &1a55 a9 0e LDA #&0e ; Enable event &1a57 a2 04 LDX #&04 ; v-sync event &1a59 20 f4 ff JSR &fff4 ; OSBYTE &1a5c 20 80 0a JSR &0a80 ; initialise_irq1_handler &1a5f 60 RTS ; title_screen &1a60 a9 27 LDA #&27 ; &2700 = title_screen_level_data &1a62 85 82 STA &82 ; level_data_address_high &1a64 a9 00 LDA #&00 &1a66 85 80 STA &80 ; level_data_offset &1a68 85 4d STA &4d ; enemy_sprite_offset # Set to zero to indicate regular level &1a6a a9 14 LDA #&14 # Unnecessary &1a6c 85 53 STA &53 ; levels_left_in_round &1a6e 20 00 19 JSR &1900 ; reset_jump &1a71 a9 00 LDA #&00 # Set to zero to suppress player movement &1a73 85 55 STA &55 ; allow_player_movement &1a75 85 71 STA &71 ; player_horizontal_movement &1a77 a9 03 LDA #&03 # Display three lines on title screen &1a79 85 50 STA &50 ; player_lives &1a7b 20 08 19 JSR &1908 ; initialise_level # Plot title screen level &1a7e a2 00 LDX #&00 ; write_title_screen_text &1a80 bd 10 0a LDA &0a10,X ; title_screen_text_string &1a83 20 ee ff JSR &ffee ; OSWRCH &1a86 e8 INX &1a87 e0 4d CPX #&4d &1a89 d0 f5 BNE &1a80 ; write_title_screen_text &1a8b 20 00 0e JSR &0e00 ; write_high_scores ; title_screen_player_waiting_loop # Player waits &1a8e 20 66 1b JSR &1b66 ; update_game_and_check_for_space &1a91 f0 4a BEQ &1add ; leave_title_screen &1a93 ad a9 0c LDA &0ca9 ; enemies_direction + 1 # until the platform is moving down &1a96 30 f6 BMI &1a8e ; title_screen_loop &1a98 ad c2 0c LDA &0cc2 ; enemies_y + 1 &1a9b c9 60 CMP #&60 # and the platform is halfway down the screen &1a9d d0 ef BNE &1a8e ; title_screen_player_waiting_loop &1a9f a9 01 LDA #&01 # Set player moving right &1aa1 85 71 STA &71 ; player_horizontal_movement ; title_screen_player_moving_right_loop # Player moves right &1aa3 20 66 1b JSR &1b66 ; update_game_and_check_for_space &1aa6 f0 35 BEQ &1add ; leave_title_screen &1aa8 ad 78 0c LDA &0c78 ; enemies_x &1aab 38 SEC &1aac e5 72 SBC &72 ; player_x &1aae a2 00 LDX #&00 &1ab0 c9 0e CMP #&0e # jumping when near the snail &1ab2 d0 02 BNE &1ab6 ; skip_jump &1ab4 a2 ff LDX #&ff # Non-zero to set player jumping ; skip_jump &1ab6 86 7a STX &7a ; player_is_jumping &1ab8 a5 72 LDA &72 ; player_x &1aba c9 6c CMP #&6c # until the player has reached the platform &1abc 90 e5 BCC &1aa3 ; title_screen_player_moving_right_loop &1abe a9 00 LDA #&00 # Stop player moving &1ac0 85 71 STA &71 ; player_horizontal_movement ; title_screen_player_riding_platform_loop # Player rides the platform &1ac2 20 66 1b JSR &1b66 ; update_game_and_check_for_space &1ac5 f0 16 BEQ &1add ; leave_title_screen &1ac7 ad c2 0c LDA &0cc2 ; enemies_y + 1 &1aca c9 28 CMP #&28 # until the platform is near the top of the screen &1acc b0 f4 BCS &1ac2 ; title_screen_player_riding_platform_loop &1ace a9 ff LDA #&ff # Set player moving left &1ad0 85 71 STA &71 ; player_horizontal_movement ; title_screen_player_moving_left_loop # Player moves left &1ad2 20 66 1b JSR &1b66 ; update_game_and_check_for_space &1ad5 f0 06 BEQ &1add ; leave_title_screen &1ad7 a5 72 LDA &72 ; player_x &1ad9 c9 06 CMP #&06 # until the player has reached the door &1adb b0 f5 BCS &1ad2 ; title_screen_player_moving_left_loop ; leave_title_screen &1add 85 5f STA &5f ; player_wants_to_start_game &1adf 20 f2 18 JSR &18f2 ; reset_score_and_jump &1ae2 4c af 19 JMP &19af ; attract_screen ; relocate_7200_to_0900 &1ae5 a2 00 LDX #&00 ; relocate_7200_to_0900_loop # Move &7200 - &73ff to &0900 - &0aff &1ae7 bd 00 72 LDA &7200,X &1aea 9d 00 09 STA &0900,X &1aed bd 00 73 LDA &7300,X &1af0 9d 00 0a STA &0a00,X &1af3 ca DEX &1af4 d0 f1 BNE &1ae7 ; relocate_7200_to_0900_loop &1af6 60 RTS ; update_bird &1af7 a6 69 LDX &69 ; enemy_to_consider &1af9 bd ae 0c LDA &0cae,X ; enemies_base_sprite &1afc c9 a8 CMP #&a8 ; BIRD_RIGHT # Is the enemy a bird? &1afe 90 38 BCC &1b38 ; leave &1b00 c9 b5 CMP #&b5 ; BIRD_LEFT + 1 &1b02 b0 34 BCS &1b38 ; leave &1b04 a4 5e LDY &5e ; bird_bounce_stage # If so, make it bounce &1b06 c0 01 CPY #&01 &1b08 d0 06 BNE &1b10 ; skip_up &1b0a de c1 0c DEC &0cc1,X ; enemies_y &1b0d de c1 0c DEC &0cc1,X ; enemies_y ; skip_up &1b10 bd c1 0c LDA &0cc1,X ; enemies_y &1b13 18 CLC &1b14 79 20 0c ADC &0c20,Y ; vertical_velocity_table - 1 &1b17 9d c1 0c STA &0cc1,X ; enemies_y &1b1a 8a TXA &1b1b d0 1b BNE &1b38 ; leave &1b1d c6 5d DEC &5d ; bird_bounce_cooldown &1b1f d0 17 BNE &1b38 ; leave &1b21 a9 05 LDA #&05 &1b23 85 5d STA &5d ; bird_bounce_cooldown &1b25 c6 5e DEC &5e ; bird_bounce_stage &1b27 d0 0f BNE &1b38 ; leave &1b29 a9 08 LDA #&08 &1b2b 85 5e STA &5e ; bird_bounce_stage &1b2d a2 05 LDX #&05 ; reset_enemies_y_loop &1b2f bd e6 0c LDA &0ce6,X ; enemies_y_top_of_bounce &1b32 9d c1 0c STA &0cc1,X ; enemies_y &1b35 ca DEX &1b36 10 f7 BPL &1b2f ; reset_enemies_y_loop ; leave &1b38 60 RTS ; update_spider # Called with Y = enemy offset when spider at minimum y &1b39 a5 53 LDA &53 ; levels_left_in_round &1b3b c9 02 CMP #&02 # Is this level 10? &1b3d d0 15 BNE &1b54 ; leave &1b3f a9 00 LDA #&00 # Stop spider moving down &1b41 99 a8 0c STA &0ca8,Y ; enemies_direction &1b44 b9 c1 0c LDA &0cc1,Y ; enemies_y # Move spider off minimum y &1b47 69 01 ADC #&01 &1b49 99 c1 0c STA &0cc1,Y ; enemies_y &1b4c be e0 0c LDX &0ce0,Y ; enemies_tag # Pick a different spider &1b4f a9 02 LDA #&02 &1b51 9d a8 0c STA &0ca8,X ; enemies_direction # to set moving down ; leave &1b54 60 RTS ; play_sound &1b55 86 9c STX &9c ; tmp_x &1b57 84 9d STY &9d ; tmp_y &1b59 aa TAX &1b5a a0 05 LDY #&05 ; sound_0 DIV 256 &1b5c a9 07 LDA #&07 ; Generate a sound (SOUND) &1b5e 20 f1 ff JSR &fff1 ; OSWORD &1b61 a6 9c LDX &9c ; tmp_x &1b63 a4 9d LDY &9d ; tmp_y &1b65 60 RTS ; update_game_and_check_for_space &1b66 20 65 13 JSR &1365 ; update_game &1b69 a2 03 LDX #&03 &1b6b 20 7e 1b JSR &1b7e ; short_delay &1b6e a5 ec LDA &ec ; os_most_recently_pressed_key &1b70 49 e2 EOR #&e2 ; SPACE &1b72 60 RTS # Leaves with zero if SPACE pressed ; long_delay &1b73 a2 00 LDX #&00 &1b75 20 7e 1b JSR &1b7e ; short_delay &1b78 38 SEC &1b79 e9 01 SBC #&01 &1b7b d0 f6 BNE &1b73 ; long_delay &1b7d 60 RTS ; short_delay &1b7e a0 00 LDY #&00 &1b80 88 DEY &1b81 d0 fd BNE &1b80 ; short_delay &1b83 ca DEX &1b84 d0 fa BNE &1b80 ; short_delay &1b86 60 RTS ; plot_lives &1b87 a6 50 LDX &50 ; player_lives &1b89 ca DEX &1b8a f0 2c BEQ &1bb8 ; skip_plotting_lives &1b8c 86 9c STX &9c ; count &1b8e a9 91 LDA #&91 ; STA (&90),Y # Overwrite screen memory when plotting lives &1b90 8d 51 11 STA &1151 ; plot_sprite_eor_instruction &1b93 a9 04 LDA #&04 # Plot lives at left of screen &1b95 85 83 STA &83 ; x_position &1b97 a9 00 LDA #&00 &1b99 85 92 STA &92 ; sprite_address_low &1b9b a9 2c LDA #&2c ; &2c00 = maybe_life_sprite &1b9d 85 93 STA &93 ; sprite_address_high &1b9f a9 30 LDA #&30 # 12 pixels high &1ba1 85 94 STA &94 ; sprite_size_in_bytes ; plot_lives_loop &1ba3 a5 83 LDA &83 ; x_position &1ba5 18 CLC &1ba6 69 08 ADC #&08 &1ba8 85 83 STA &83 ; x_position &1baa a2 ef LDX #&ef ; y_position # Plot lives at bottom of screen &1bac 20 03 11 JSR &1103 ; plot_sprite # Plot life &1baf c6 9c DEC &9c ; count &1bb1 d0 f0 BNE &1ba3 ; plot_lives_loop &1bb3 a9 51 LDA #&51 ; EOR (&90),Y # EOR sprite to screen next time &1bb5 8d 51 11 STA &1151 ; plot_sprite_eor_instruction ; skip_plotting_lives &1bb8 a9 40 LDA #&40 # 16 pixels high &1bba 85 94 STA &94 ; sprite_size_in_bytes &1bbc 60 RTS ; increase_score # Add A * 10 to score &1bbd 86 9c STX &9c ; tmp_x &1bbf 84 9d STY &9d ; tmp_y &1bc1 a2 05 LDX #&05 ; increase_score_loop &1bc3 18 CLC &1bc4 7d f0 0c ADC &0cf0,X ; score - 1 &1bc7 c9 3a CMP #&3a &1bc9 90 0b BCC &1bd6 ; skip_overflow &1bcb 38 SEC &1bcc e9 0a SBC #&0a &1bce 9d f0 0c STA &0cf0,X ; score - 1 &1bd1 a9 01 LDA #&01 &1bd3 ca DEX &1bd4 d0 ed BNE &1bc3 ; increase_score_loop ; skip_overflow &1bd6 9d f0 0c STA &0cf0,X ; score - 1 &1bd9 a9 1f LDA #&1f # TAB(&0e, &1d) &1bdb 20 ee ff JSR &ffee ; OSWRCH &1bde a9 0e LDA #&0e &1be0 20 ee ff JSR &ffee ; OSWRCH &1be3 a9 1d LDA #&1d &1be5 20 ee ff JSR &ffee ; OSWRCH &1be8 a2 01 LDX #&01 ; plot_score_loop &1bea bd f0 0c LDA &0cf0,X ; score - 1 # Write digit of score &1bed 20 ee ff JSR &ffee ; OSWRCH &1bf0 e8 INX &1bf1 e0 07 CPX #&07 &1bf3 d0 f5 BNE &1bea ; plot_score_loop &1bf5 ad f3 0c LDA &0cf3 ; score + 2 &1bf8 c5 54 CMP &54 ; previous_score_thousands &1bfa f0 07 BEQ &1c03 ; skip_extra_life &1bfc 85 54 STA &54 ; previous_score_thousands &1bfe e6 50 INC &50 ; player_lives # Gain a life every 1000 points &1c00 20 87 1b JSR &1b87 ; plot_lives ; skip_extra_life &1c03 a6 9c LDX &9c ; tmp_x &1c05 a4 9d LDY &9d ; tmp_y &1c07 60 RTS ; game_over_screen &1c08 a9 00 LDA #&00 # Set to zero to stop music &1c0a 8d 8a 02 STA &028a ; music_playing &1c0d 85 4d STA &4d ; enemy_sprite_offset # Set to zero to indicate regular level &1c0f a9 40 LDA #&40 &1c11 85 80 STA &80 ; level_data_offset &1c13 a9 07 LDA #&07 ; &0740 = game_over_level_data &1c15 85 82 STA &82 ; level_data_address_high &1c17 a9 00 LDA #&00 # Set to zero to suppress player movement &1c19 85 55 STA &55 ; allow_player_movement &1c1b 85 55 STA &55 ; allow_player_movement # Unnecessary code &1c1d a9 01 LDA #&01 # Set player moving right &1c1f 85 71 STA &71 ; player_horizontal_movement &1c21 85 50 STA &50 ; player_lives &1c23 20 08 19 JSR &1908 ; initialise_level ; game_over_screen_loop &1c26 20 65 13 JSR &1365 ; update_game &1c29 a2 0a LDX #&0a &1c2b 20 7e 1b JSR &1b7e ; short_delay &1c2e a5 72 LDA &72 ; player_x &1c30 c9 70 CMP #&70 &1c32 d0 f2 BNE &1c26 ; game_over_screen_loop &1c34 a9 0a LDA #&0a &1c36 20 73 1b JSR &1b73 ; long_delay &1c39 60 RTS ; unplot_player_and_play_dying_sounds &1c3a a9 18 LDA #&18 ; sound_3 # Play dying sound one &1c3c 20 55 1b JSR &1b55 ; play_sound &1c3f a9 20 LDA #&20 ; sound_4 # Play dying sound two &1c41 20 55 1b JSR &1b55 ; play_sound &1c44 a9 03 LDA #&03 &1c46 20 73 1b JSR &1b73 ; long_delay &1c49 20 15 14 JSR &1415 ; plot_player &1c4c 60 RTS ; update_contraption_level &1c4d a5 4d LDA &4d ; enemy_sprite_offset # Zero if regular level, non-zero if contraption level &1c4f f0 5f BEQ &1cb0 ; leave_after_setting_player_can_drop_apples &1c51 ad 78 0c LDA &0c78 ; enemies_x # Enemy 0 is an invisible enemy that moves left to right &1c54 8d 79 0c STA &0c79 ; enemies_x + 1 # Set the ball's x position to follow it &1c57 a5 78 LDA &78 ; player_initial_jump_or_fall_stage &1c59 d0 25 BNE &1c80 ; skip_piston_jump &1c5b a5 98 LDA &98 ; player_was_killed &1c5d d0 21 BNE &1c80 ; skip_piston_jump &1c5f a2 03 LDX #&03 # Set player falling &1c61 a5 73 LDA &73 ; player_y &1c63 c9 83 CMP #&83 # Is the player on the pistons? &1c65 90 17 BCC &1c7e ; set_maximum_player_jump_or_fall_stage_cooldown &1c67 c9 9b CMP #&9b &1c69 b0 13 BCS &1c7e ; set_maximum_player_jump_or_fall_stage_cooldown &1c6b a5 72 LDA &72 ; player_x &1c6d c9 30 CMP #&30 &1c6f b0 0d BCS &1c7e ; set_maximum_player_jump_or_fall_stage_cooldown &1c71 a9 08 LDA #&08 # If so, set player jumping &1c73 a2 11 LDX #&11 # Maximum safe distance to fall &1c75 20 d0 12 JSR &12d0 ; start_jump_or_fall &1c78 a9 00 LDA #&00 # Set player jumping upwards only &1c7a 85 71 STA &71 ; player_horizontal_movement &1c7c a2 0b LDX #&0b # Player jumps faster when propelled by piston ; set_maximum_player_jump_or_fall_stage_cooldown &1c7e 86 76 STX &76 ; maximum_player_jump_or_fall_stage_cooldown ; skip_piston_jump &1c80 a2 e4 LDX #&e4 ; SPACE &1c82 a0 01 LDY #&01 # Non-zero to allow player movement &1c84 a5 4f LDA &4f ; player_can_drop_apples # Non-zero if player can drop apples into contraption &1c86 f0 23 BEQ &1cab ; not_dropping_apples &1c88 a9 00 LDA #&00 # Player doesn't die from touching apple drop point &1c8a 85 98 STA &98 ; player_was_killed # even though it is treated as a deadly tile at &17e2 &1c8c a5 4e LDA &4e ; apples_to_drop &1c8e f0 1b BEQ &1cab ; not_dropping_apples &1c90 a0 00 LDY #&00 # Set to zero to suppress player movement &1c92 84 71 STY &71 ; player_horizontal_movement &1c94 a9 02 LDA #&02 # Set apple moving down &1c96 8d aa 0c STA &0caa ; enemies_direction + 2 &1c99 ad c3 0c LDA &0cc3 ; enemies_y + 2 &1c9c c9 46 CMP #&46 # Has the apple reached the pipe? &1c9e 90 09 BCC &1ca9 ; not_next_apple &1ca0 a9 02 LDA #&02 # Score 20 points for putting apple in contraption &1ca2 20 bd 1b JSR &1bbd ; increase_score &1ca5 c6 4e DEC &4e ; apples_to_drop &1ca7 f0 02 BEQ &1cab ; not_dropping_apples ; not_next_apple &1ca9 a2 f0 LDX #&f0 ; APPLE ; not_dropping_apples &1cab 8e b0 0c STX &0cb0 ; enemies_base_sprite + 2 # Set sprite for falling apple &1cae 84 55 STY &55 ; allow_player_movement ; leave_after_setting_player_can_drop_apples &1cb0 a9 00 LDA #&00 # Set to zero to indicate player can't drop apples &1cb2 85 4f STA &4f ; player_can_drop_apples &1cb4 60 RTS ; change_level_data_address &1cb5 a2 01 LDX #&01 &1cb7 a0 0b LDY #&0b ; &0b01 = contraption_level_data &1cb9 a5 4d LDA &4d ; enemy_sprite_offset &1cbb 49 10 EOR #&10 &1cbd 85 4d STA &4d ; enemy_sprite_offset # &10 in contraption level, &00 in regular level &1cbf d0 04 BNE &1cc5 ; not_contraption_screen &1cc1 a6 4c LDX &4c ; contraption_screen_level_data_offset &1cc3 a4 4b LDY &4b ; contraption_screen_level_data_address_high ; not_contraption_screen &1cc5 a5 82 LDA &82 ; level_data_address_high &1cc7 85 4b STA &4b ; contraption_screen_level_data_address_high &1cc9 a5 80 LDA &80 ; level_data_offset &1ccb 85 4c STA &4c ; contraption_screen_level_data_offset &1ccd 86 80 STX &80 ; level_data_offset &1ccf 84 82 STY &82 ; level_data_address_high &1cd1 60 RTS ; unused &1cd2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7f &1ce2 ff ce 00 00 7f f3 c6 00 01 fe ff eb 00 01 f6 fd &1cf2 ed 00 13 fa fd fd 08 13 fb f3 fb 08 13 f7 ff ff &1d02 08 13 ff ff ff 08 13 8f 0f 1f 08 01 18 f0 03 00 &1d12 00 00 0a 00 00 00 00 a0 00 00 00 00 02 00 00 ; fish_sprite_0 &1d21 00 00 10 e0 00 00 00 00 01 3c e0 00 00 00 00 0e &1d31 f8 e0 00 07 08 03 55 55 87 00 78 08 26 8e aa aa &1d41 0f f0 08 5d 6f 55 55 55 f0 08 6a 4f aa aa aa e1 &1d51 00 3d 17 55 f1 55 c2 00 12 aa aa e0 aa e1 00 1e &1d61 55 55 55 1f f0 08 68 b8 aa ab 09 f0 08 17 74 d1 &1d71 06 00 3c 08 01 3c e1 08 00 03 08 00 10 e0 00 00 &1d81 00 00 ; fish_sprite_1 &1d83 00 00 00 00 00 00 00 00 00 07 f0 c0 00 00 00 03 &1d93 3a f0 c0 00 00 00 1d 55 65 0c 01 0f 01 ab 2a aa &1da3 8b 1e e1 13 57 9d 55 55 74 c2 02 9b 2e aa aa b8 &1db3 84 13 45 5d 74 d5 74 08 03 6e aa b8 a2 b8 84 13 &1dc3 15 55 55 47 7c c2 01 aa f0 a2 8e 34 e1 00 5d f0 &1dd3 c1 08 03 0f 00 07 f0 c2 00 00 00 00 00 00 00 00 &1de3 00 00 ; fire_sprite_0 &1de5 00 00 00 00 00 10 80 00 00 30 80 80 10 30 80 80 &1df5 10 31 d0 c0 00 30 f1 80 10 f1 f2 c0 10 f0 f0 c0 &1e05 10 f1 f2 c0 00 f5 f8 e4 50 f5 fc cc 72 f8 f4 e8 &1e15 71 f1 f1 e0 32 f8 f0 e2 10 d2 b4 c4 01 0d 0b 08 ; fire_sprite_1 &1e25 00 00 00 00 00 00 00 00 00 10 80 00 00 10 80 00 &1e35 00 30 d0 00 00 30 f0 80 10 31 f0 c0 10 b0 f1 c0 &1e45 10 f1 f0 c0 00 f4 f2 c0 50 f5 f4 e6 72 f1 f4 e4 &1e55 73 f5 f8 e8 32 f9 f9 e2 10 d2 b4 c4 01 0d 0b 08 ; cloud_sprite_0 &1e65 00 00 11 ff cc 00 00 00 00 00 33 ff ff 11 ee 00 &1e75 33 cc 77 ff ff bb ff 00 77 ff ff ff ff ff ff 00 &1e85 77 ff ff ff ff ff ff 88 77 ff ff ff ff ff ff 88 &1e95 33 ff ff ff ff ff ff 88 33 ff ff ff ff ff ff 00 &1ea5 77 ff ff ff ff ff ff 88 ff ff ff ff ff ff ff cc &1eb5 ff ff ff ff ff ff ff cc ff ff ff ff ff ff ff cc &1ec5 77 ff ff ff ff ff ff cc 33 ff 77 ff cc ff ff 88 &1ed5 00 ee 33 ff 00 33 ff 00 ; cloud_sprite_1 &1edd 00 00 00 77 ff 00 00 00 00 00 00 ff ff cc 77 88 &1eed 00 ff 11 ff ff ee ff cc 11 ff ff ff ff ff ff cc &1efd 11 ff ff ff ff ff ff ee 11 ff ff ff ff ff ff ee &1f0d 00 ff ff ff ff ff ff ee 00 ff ff ff ff ff ff cc &1f1d 11 ff ff ff ff ff ff ee 33 ff ff ff ff ff ff ff &1f2d 33 ff ff ff ff ff ff ff 33 ff ff ff ff ff ff ff &1f3d 11 ff ff ff ff ff ff ff 00 ff dd ff ff 33 ff ee &1f4d 00 33 88 ff cc 00 ff cc ; snowman_sprite_0 &1f55 00 4f 08 00 00 4f 08 00 00 4f 08 00 03 0f 0e 00 &1f65 10 f0 c0 00 30 78 68 00 30 78 68 00 30 f0 e0 00 &1f75 3c 78 79 8c 0f 5a f3 8c 00 f0 df 8c 10 5f 5f 8c &1f85 30 d2 c0 00 70 f0 f0 00 70 d2 f0 80 f0 f0 f0 80 &1f95 f0 d2 f0 80 f0 f0 f0 80 f0 f0 f0 80 f0 f0 f0 80 &1fa5 f0 f0 f0 80 70 f0 f0 00 30 f0 e0 00 10 0f 48 00 ; snowman_sprite_1 &1fb5 00 13 0e 00 00 13 0e 00 00 13 0e 00 00 0f 0f 08 &1fc5 00 70 f0 00 00 d2 d2 80 00 d2 d2 80 00 f0 f0 80 &1fd5 03 d2 d2 80 03 1e 78 00 00 30 f3 6f 00 53 5f 6f &1fe5 00 f0 78 6f 10 f0 f0 e3 10 f0 78 e0 30 f0 f0 e0 &1ff5 30 f0 78 e0 30 f0 f0 e0 30 f0 f0 e0 30 f0 f0 e0 &2005 30 f0 f0 e0 10 f0 f0 c0 00 f0 f0 80 00 43 1e 00 ; platform_sprite_0 &2015 09 0f 03 0f 03 0e 04 0f ef 1f ef 1f cf 0c 09 ef &2025 13 ef 13 ce 04 78 c3 0f 0f 0f f0 84 01 ce 00 0c &2035 01 ce 00 00 6f 00 0c 13 8c 00 00 37 0f 0f 3f 08 &2045 00 00 13 8c 0c 6f 00 00 00 01 0f 0f 0e 00 00 ; platform_sprite_1 &2054 02 07 0c 0f 0c 0f 09 03 3f 8f 7f 8f 7f 0f 02 37 &2064 8c 7f 8c 7f 09 12 f0 0f 0f 0f 3c e1 00 37 08 03 &2074 00 37 08 00 13 8c 03 00 6f 00 00 01 cf 0f 0f ce &2084 00 00 00 6f 03 13 8c 00 00 00 07 0f 0f 08 00 ; unused &2093 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &20a3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &20b3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &20c3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &20d3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &20e3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &20f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; snail_right_sprite_0 &2101 00 00 0f 09 02 00 00 01 fd 8c 0a 00 00 13 f7 ce &2111 06 00 00 37 f9 ed 06 00 00 37 1e ef 6f 00 00 36 &2121 5e e3 e7 08 00 37 d7 ef f0 08 00 13 de 3e e1 08 &2131 00 0f 3c f0 c2 00 03 f0 f0 f0 c2 00 0f 0f 0f 0f &2141 0c 00 ; snail_right_sprite_1 &2143 00 00 03 0e 04 08 00 00 37 e7 02 08 00 00 7d ff &2153 09 08 00 01 fe f7 85 08 00 01 cf 7b 9f 8c 00 01 &2163 db 78 bd 8e 00 01 fd 7f bc c2 00 00 7f 4b f8 86 &2173 00 03 0f f0 f0 08 00 3c f0 f0 f0 08 03 0f 0f 0f &2183 0f 00 ; snail_left_sprite_0 &2185 02 04 0f 08 00 00 02 09 fd 8c 00 00 03 13 ff c6 &2195 00 00 03 35 fc ef 00 00 37 3f cb 6f 00 00 3f b6 &21a5 d3 6b 00 00 78 b7 df e7 00 00 3c e3 5b ce 00 00 &21b5 12 f0 e1 0f 08 00 12 f0 f0 f0 86 00 01 0f 0f 0f &21c5 0f 08 ; snail left_sprite_1 &21c7 00 09 03 0e 00 00 00 0a 37 e7 00 00 00 0c 7f fd &21d7 08 00 00 0d f7 f3 8c 00 01 cf fe 1f 8c 00 03 ed &21e7 f8 5e 8c 00 12 e1 ff 7d 8c 00 03 f0 9e 7f 08 00 &21f7 00 78 f0 87 0e 00 00 78 f0 f0 e1 08 00 07 0f 0f &2207 0f 0e ; tortoise_sprite_0 &2209 00 0f 08 00 00 01 ff 8c 00 00 13 fa ce 00 00 13 &2219 ff ce 03 00 36 ff eb 0f 08 37 fa ef 3f 08 0f ff &2229 cf 0f 08 01 0f 0c 07 00 00 08 08 00 00 ; tortoise_sprite_1 &2236 00 01 0f 00 00 00 13 ff 08 00 00 37 f5 8c 00 00 &2246 37 ff 8c 0c 00 7d ff c7 0e 00 7f f5 cf ce 03 1f &2256 ff 8f 0e 00 03 0f 09 0c 00 24 10 08 00 ; frog_sprite_0 &2263 03 08 01 0c 37 8c 13 ce 27 8c 13 4e 27 4f 2f 4e &2273 37 f8 f3 ce 03 7a e9 0c 16 fa fa 8e 07 f5 f4 0e &2283 35 0f 0f ca 12 fa fd 84 01 f0 f0 08 00 0f 0f 00 &2293 00 48 21 00 00 48 21 00 07 0c 03 0e ; frog_sprite_1 &229f 03 08 01 0c 37 8c 13 ce 27 8c 13 4e 27 4f 2f 4e &22af 37 f8 f3 ce 03 7a e9 0c 16 fa fa 8e 07 f5 f4 0e &22bf 35 0f 0f ca 12 fa fd 84 01 f0 f0 08 08 0f 0f 01 &22cf 0d 80 10 0b 16 00 00 86 02 00 00 04 ; spider_sprite_0 &22db 00 04 00 00 04 00 01 02 00 00 09 00 02 0a 0f 0e &22eb 0a 08 04 0b f0 e1 0a 04 08 34 be d6 84 02 09 3c &22fb 0f 1e 0f 02 02 0f 0f 0f 0e 08 04 03 ef ef 08 04 &230b 04 05 ef ef 04 04 04 08 0f 0e 02 04 08 08 0c 06 &231b 02 02 00 09 08 03 02 00 00 08 0c 06 02 00 00 08 &232b 04 04 02 00 01 00 00 00 01 00 02 00 00 00 00 08 ; spider_sprite_1 &233b 00 01 00 00 01 00 00 04 08 00 02 04 00 0a 0b 0f &234b 0a 0a 01 02 3c f0 86 09 02 01 e3 f9 69 00 02 07 &235b c3 0f 4b 0c 00 0b 0f 0f 0f 0a 01 00 3f bf 8e 01 &236b 01 01 37 bf 8d 01 01 02 03 0f 08 09 02 02 03 01 &237b 08 08 00 02 06 00 0c 08 00 02 03 01 08 08 00 02 &238b 01 01 00 08 00 04 00 00 00 04 00 08 00 00 00 02 ; spider_sprite_2 &239b 00 02 00 00 08 00 01 02 00 00 09 00 02 0a 0f 0e &23ab 0a 0c 0c 0b f0 e1 0a 02 00 34 be d6 84 00 00 3c &23bb 0f 1e 0e 00 01 0f 0f 0f 0f 00 02 03 ef ef 08 08 &23cb 04 05 ef ef 04 04 04 08 0f 0e 02 04 04 04 0c 06 &23db 04 04 08 04 0c 06 04 02 00 02 04 04 08 00 00 02 &23eb 06 0c 08 00 00 06 00 00 0c 00 00 08 00 00 02 00 ; spider_sprite_3 &23fb 00 00 08 00 02 00 00 04 08 00 02 04 00 0a 0b 0f &240b 0a 0b 03 02 3c f0 86 08 04 01 e3 f9 69 00 00 03 &241b c3 0f 4b 08 00 07 0f 0f 0f 0c 00 08 3f bf 8e 02 &242b 01 01 37 bf 8d 01 01 02 03 0f 08 09 01 01 03 01 &243b 09 01 02 01 03 01 09 00 00 00 09 01 02 00 00 00 &244b 09 0b 02 00 00 01 08 00 03 00 00 02 00 00 00 08 ; unused # &245b - &24fa is similar to &1486 - &1534. Compare: &245b c5 8e CMP &8e ; group &245d b0 2b BCS &248a ; leave &245f 29 04 AND #&04 ; TILE_OBSTACLE &2461 f0 27 BEQ &248a ; leave ; hit_obstacle_above # &148e - &148f is missing here &2463 a5 74 LDA &74 ; player_jump_or_fall_stage &2465 c9 05 CMP #&05 &2467 90 04 BCC &246d ; no_obstacle &2469 a9 04 LDA #&04 &246b 85 74 STA &74 ; player_jump_or_fall_stage ; no_obstacle &246d b9 00 7f LDA &7f00,Y ; tile_table &2470 10 03 BPL &2475 ; not_special_tile &2472 4c 34 17 JMP &1734 # Would be JMP &17bd ; check_tile_for_apple ; not_special_tile &2475 a5 72 LDA &72 ; player_x &2477 38 SEC &2478 e5 71 SBC &71 ; player_horizontal_movement &247a 85 72 STA &72 ; player_x &247c a5 78 LDA &78 ; player_initial_jump_or_fall_stage &247e f0 0a BEQ &248a ; leave &2480 a5 74 LDA &74 ; player_jump_or_fall_stage &2482 c9 05 CMP #&05 &2484 b0 04 BCS &248a ; leave &2486 a9 00 LDA #&00 &2488 85 71 STA &71 ; player_horizontal_movement ; leave &248a 60 RTS ; check_tile_above &248b 98 TYA &248c 38 SEC &248d e9 10 SBC #&10 &248f a8 TAY ; check_tile &2490 b9 00 7f LDA &7f00,Y ; tile_table &2493 10 09 BPL &249e ; leave &2495 c9 ef CMP #&ef ; TILE_SPECIAL - 1 &2497 90 03 BCC &249c ; leave_with_one &2499 29 0f AND #&0f &249b 60 RTS ; leave_with_one &249c a9 01 LDA #&01 ; leave &249e 60 RTS ; animate_player &249f a5 71 LDA &71 ; player_horizontal_movement &24a1 f0 26 BEQ &24c9 ; leave &24a3 29 02 AND #&02 &24a5 18 CLC &24a6 69 2d ADC #&2d ; player_right_feet_sprite_0 DIV 256 &24a8 85 8b STA &8b ; player_feet_sprite_address_high &24aa a5 72 LDA &72 ; player_x &24ac 4a LSR A &24ad a9 00 LDA #&00 &24af 6a ROR A &24b0 85 8c STA &8c ; player_head_sprite_address_low &24b2 a5 7e LDA &7e ; player_feet_sprite_address_low # Missing at &14df &24b4 c6 8f DEC &8f ; player_foot_animation_cooldown &24b6 d0 0b BNE &24c3 ; set_player_foot_sprite &24b8 a2 04 LDX #&04 &24ba 86 8f STX &8f ; player_foot_animation_cooldown &24bc a6 78 LDX &78 ; player_initial_jump_or_fall_stage &24be d0 03 BNE &24c3 ; set_player_foot_sprite &24c0 18 CLC # &14eb - &14f7 is missing here &24c1 69 20 ADC #&20 ; set_player_foot_sprite &24c3 29 7f AND #&7f &24c5 05 8c ORA &8c ; player_head_sprite_address_low &24c7 85 7e STA &7e ; player_feet_sprite_address_low ; leave &24c9 60 RTS ; check_for_player_on_falling_platforms &24ca ad 59 0c LDA &0c59 ; tile_sprite_addresses_low_table + 9 &24cd 85 92 STA &92 ; sprite_address_low &24cf ad 6d 0c LDA &0c6d ; tile_sprite_addresses_high_table + 9 &24d2 85 93 STA &93 ; sprite_address_high &24d4 20 a8 13 JSR &13a8 # Would be JSR &13c8 ; get_height_of_player_left_tile &24d7 20 e5 14 JSR &14e5 # Would be JSR &1521 ; check_falling_platform &24da 20 a0 13 JSR &13a0 # Would be JSR &13c0 ; get_height_of_player_right_tile &24dd c4 9f CPY &9f ; piston_or_falling_platform_tile_offset &24df f0 03 BEQ &24e4 ; leave &24e1 20 e5 14 JSR &14e5 # Would be JSR &1521 ; check_falling_platform ; leave &24e4 60 RTS ; check_falling_platform # &24d7 and &24e1 suggests this code is offset by &1000 &24e5 a2 01 LDX #&01 &24e7 84 9f STY &9f ; piston_or_falling_platform_tile_offset &24e9 b9 00 7f LDA &7f00,Y ; tile_table &24ec 10 29 BPL &2517 # Would by BPL &1553 ; leave &24ee 29 f0 AND #&f0 &24f0 f0 25 BEQ &2517 # Would be BEQ &1553 ; leave &24f2 c9 90 CMP #&90 &24f4 b0 21 BCS &2517 # Would be BCS &1553 ; leave &24f6 a5 78 LDA &78 ; player_initial_jump_or_fall_stage &24f8 f0 06 BEQ &2500 # Would be BEQ &153c ; update_piston_or_falling_platform &24fa a5 LDA ... # Would be LDA &77 ; player_jump_or_fall_stage_cooldown ; devil_sprite_0 &24fb 00 01 00 08 00 00 00 10 00 80 00 00 00 00 f0 00 &250b 00 00 00 00 f0 00 00 00 00 10 fa 80 00 00 00 10 &251b f0 80 00 00 00 00 f4 00 00 00 00 10 f0 80 00 00 &252b 00 f0 f0 f0 03 0c 10 f6 f0 f6 84 00 1e 87 0f 1e &253b 87 0c 10 b0 f0 d0 84 00 00 30 f0 80 03 0c 30 e0 &254b f0 00 00 00 70 00 d0 80 00 00 20 10 80 c0 00 00 &255b 00 30 80 e0 00 00 ; unused # &2561 - &2568 is a copy of &159d - &15a4 &2561 a5 64 LDA &64 ; pistons_maximum_frame &2563 85 65 STA &65 ; pistons_frame &2565 a5 60 LDA &60 ; first_piston_tile_offset &2567 18 CLC &2568 65 ADC ... # Would be ADC &66 ; pistons_current_direction ; devil_sprite_0 &2569 00 00 04 02 00 00 00 00 40 20 00 00 00 00 30 c0 &2579 00 00 00 00 30 c0 00 00 00 00 72 e8 00 00 00 00 &2589 70 e0 00 00 00 00 31 c0 00 00 00 00 70 e0 00 00 &2599 00 30 f0 f0 c0 0f 00 71 f8 f1 e9 00 03 69 0f 0f &25a9 69 0f 00 60 f0 f0 61 00 00 00 f0 e0 00 0f 00 f0 &25b9 b0 c0 00 00 10 c0 30 60 00 00 00 80 60 30 00 00 &25c9 00 00 e0 30 80 00 ; bomb_sprite_0 &25cf 00 00 03 3b 40 00 00 04 07 40 00 00 0e 20 00 00 &25df 10 f8 00 c0 00 07 0f 0c 00 00 3f 8f 0e 00 01 7f &25ef 0f 0f 00 01 ef 0f 0f 00 03 cf 0f 0f 08 03 0f 0f &25ff 0f 08 03 0f 0f 0f 08 01 0f 0f 2d 00 01 2d 1e e1 &260f 00 00 3c f0 c2 00 00 16 e1 0c 00 00 01 0f 00 00 ; bomb_sprite_1 &261f 00 00 0e dc 00 00 01 01 1c 00 00 03 08 80 00 00 &262f 72 c0 30 00 01 0f 0f 00 00 03 ef 0f 08 00 17 cf &263f 0f 0c 00 37 8f 0f 0c 00 3f 0f 0f 0e 00 0f 0f 0f &264f 0e 00 0f 0f 0f 0e 00 07 0f 0f 84 00 07 87 78 84 &265f 00 03 f0 f0 08 00 01 78 87 00 00 00 07 0c 00 00 ; jellyfish_sprite_1 &266f 00 00 00 00 00 00 01 2f 00 00 00 5f ff 0e 00 03 &267f fd f7 ff 08 37 fb fb f1 8c 7e fd f6 fe ce 7d f7 &268f ff f5 ce 7e ff ff ff ce 7f 9f 2f 5f ce 27 b1 f5 &269f a1 8c 00 20 d5 80 00 00 20 2a 80 00 00 26 80 08 &26af 00 00 00 2a 00 00 00 26 00 08 00 00 00 08 00 00 ; unused # Source code fragment, corresponding to &0f1b - &0f1d &26bf 3a 4c 44 59 20 74 65 6d 33 0d # ... :LDY tem3 or &1b63 - &1b65 &26c9 2c 56 08 20 52 54 53 0d # 11350 RTS or &1c05 - &1c07 &26d1 2c f6 05 20 0d # 11510 &26d6 39 58 05 5d 0d # 14680] &26db 39 62 06 20 ed 0d # 14690 . ; unused &26e1 ff f6 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f &2e71 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f ; title_screen_level_data ; 13 12 11 10 f e d c b a 9 8 7 6 5 4 3 2 1 0 &2700 00 0a 21 11 0d 0c 00 15 1b 21 1b 15 08 11 23 24 20 12 02 00 # Tile sprites &2714 17 30 ; RYWK # Colours &2716 e1 # Player starts &2717 00 # No pistons &2718 02 # 3 enemies ; x y x- x+ ss f &2719 7f 66 02 80 50 02 ; FISH &271f 6e 70 10 e6 d2 09 ; PLATFORM &2725 40 e0 20 60 db 00 ; SNAIL_RIGHT &272b 18 # Tile data is &18 bytes long &272c f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 02 21 12 11 11 11 # 0000f00000f00000 &273c 12 22 e0 07 f4 40 0f 00 # 7000000000000000 # 2212111111122002 # 0000000000000000 # 0000000000000000 # 0000000000000000 # 0000000000000000 # 0000000000000000 # 0000000000000000 # 0000000000000000 # 0000000000000000 # 0000000000000000 # 0000000000000000 ; level_1_data ; 13 12 11 10 f e d c b a 9 8 7 6 5 4 3 2 1 0 &2744 00 0a 03 04 0d 0c 00 1e 02 12 07 05 08 0c 04 06 06 02 12 00 # Tile sprites &2758 12 30 ; RYGK # Colours &275a e3 # Player starts &275b 61 68 05 0f # Pistons &275f 02 # 3 enemies ; x y x- x+ ss f &2760 1d 29 04 78 57 02 ; BOMB &2766 50 c0 a0 e0 d7 01 ; BOMB &276c 0c b4 ae e0 57 01 ; BOMB &2772 36 # Tile data is &36 bytes long &2773 00 06 40 30 06 52 02 70 20 09 2b 21 12 90 02 90 # 0f0000000000f000 &2783 60 12 51 0f f1 70 06 60 15 02 20 02 15 12 51 40 # 0000000000000000 &2793 12 50 06 14 c0 11 09 87 88 88 00 a9 aa 0a b9 09 # 0000000000000000 &27a3 0f 0f f2 90 0f 00 # 9b0000000000aaaa # 9088888000000009 # 1100000000000001 # 0000060000001200 # 0005112100000022 # 021560600000000f # 00f5112000000090 # 2000000000012212 # 0000000000009000 # 7025000600004060 ; level_2_data ; 13 12 11 10 f e d c b a 9 8 7 6 5 4 3 2 1 0 &27a9 00 0a 03 25 0d 0c 00 22 1b 03 22 25 08 13 25 03 20 01 22 00 # Tile sprites &27bd 14 30 ; RYBK # Colours &27bf d7 # Player starts &27c0 00 # No pistons &27c1 04 # 5 enemies ; x y x- x+ ss f &27c2 05 1e 04 76 53 30 ; CLOUD &27c8 5c a0 30 e0 52 09 ; PLATFORM &27ce 0c c4 10 e0 d2 09 ; PLATFORM &27d4 3e 70 3a e0 d2 09 ; PLATFORM &27da 24 c4 40 e0 d2 09 ; PLATFORM &27e0 4e # Tile data is &4e bytes long &27e1 26 04 41 0f 41 40 94 00 05 41 20 05 64 00 59 50 # 000600f00060000f &27f1 05 95 00 04 55 10 04 92 30 04 52 10 05 93 04 51 # 0004004000400000 &2801 20 05 51 10 04 51 10 25 10 04 51 10 0f 41 10 05 # 7005005009500444 &2811 55 70 95 40 05 57 20 04 51 10 41 44 10 95 10 05 # 1005004000500000 &2821 51 10 07 44 20 04 41 20 0f 63 20 0f 61 30 # 0005000009500000 # 0005000000500400 # f005004002500500 # 4005005000500490 # 0005005000400009 # 0004005000000409 # 0000005000000590 # 6000005000400509 # 400000400f400426 ; level_3_data ; 13 12 11 10 f e d c b a 9 8 7 6 5 4 3 2 1 0 &282f 00 0a 21 20 0d 0c 00 15 1b 21 1b 15 08 11 23 24 20 1b 21 00 # Tile sprites &2843 12 30 ; RYGK # Colours &2845 e3 # Player starts &2846 00 # No pistons &2847 03 # 4 enemies ; x y x- x+ ss f &2848 7f 60 02 80 50 02 ; FISH &284e 68 40 30 80 d1 01 ; JELLYFISH &2854 0c c4 b0 e0 51 01 ; JELLYFISH &285a 30 80 10 98 d1 01 ; JELLYFISH &2860 32 # Tile data is &32 bytes long &2861 04 62 00 04 63 30 8a 0a 0f 90 09 90 99 40 ff 80 # 0000000000000000 &2871 8a a8 ab 03 4c 30 21 21 01 a2 0a 93 20 06 f8 03 # f000000000000007 &2881 3d 33 b0 33 88 88 b8 bb 0a 65 03 99 99 8a 07 fd # 8a99900000000003 &2891 f0 10 # 6000000abbb88888 # 3300000000000033 # 3000000000000003 # f000000000600090 # 000aa00012121000 # 0400000000000003 # aba88a000000000f # f000009990990000 # 0000000000000a8a # 0000600004060004 ; level_4_data ; 13 12 11 10 f e d c b a 9 8 7 6 5 4 3 2 1 0 &2893 00 0a 02 04 0d 0c 2a 28 12 02 12 15 08 0e 28 04 2a 12 02 00 # Tile sprites &28a7 13 70 ; RWYK # Colours &28a9 40 # Player starts &28aa 00 # No pistons &28ab 04 # 5 enemies ; x y x- x+ ss f &28ac 72 90 10 90 45 02 ; FIRE &28b2 4e 60 10 e0 45 01 ; FIRE &28b8 03 70 10 e0 45 01 ; FIRE &28be 2c d0 b0 e0 d5 01 ; FIRE &28c4 20 40 0c 34 d8 00 ; DEVIL &28ca 41 # Tile data is &41 bytes long &28cb 44 44 00 07 42 00 d4 10 0f 42 03 43 00 04 b6 10 # 000000000000f00d &28db 0b 41 30 52 00 0f 9b 00 13 02 11 01 96 00 ad aa # 0000000000000000 &28eb 90 09 90 10 09 35 21 01 50 09 90 20 12 02 62 20 # 0000000000000003 &28fb 9f b0 0f 91 b9 ca 0d 11 12 21 51 03 0f de 10 0f # 512112100dcab990 &290b 00 # 0f0000000000009f # 0006000212000909 # 5012130000009009 # 090000000000aaad # 0900000001100213 # 09000000000000f0 # 520000400b00b000 # 0000404000034000 # f00d404000704444 ; level_5_data ; 13 12 11 10 f e d c b a 9 8 7 6 5 4 3 2 1 0 &290c 00 0a 03 03 0d 19 03 16 22 15 22 1a 08 13 20 03 16 06 15 00 # Tile sprites &2920 12 30 ; RYGK # Colours &2922 e4 # Player starts &2923 00 # No pistons &2924 03 # 4 enemies ; x y x- x+ ss f &2925 4f 58 34 50 56 00 ; SPIDER &292b 30 98 30 50 56 00 ; SPIDER &2931 60 c4 20 e0 f6 01 ; SPIDER &2937 1d 70 30 e0 d2 09 ; PLATFORM &293d 34 # Tile data is &34 bytes long &293e 04 47 20 44 94 99 50 04 44 09 2d 99 20 dd dd dd # 5888888e8e8e8888 &294e 40 09 fd 09 f5 40 55 05 c0 04 fb 11 04 b1 ab ba # 000000000000000f &295e 0b 94 09 3c 09 f3 70 55 e0 f7 e0 88 88 8e 8e 8e # 7000000000000000 &296e 88 88 58 10 # 5500000000f00009 # 3000000000000099 # 00000bbaabb00411 # f0000000000004c0 # 55500000f0000009 # f000000000000009 # 00000dddddd00099 # 2000000000000009 # 4000004000000999 # 4440004000000004 ; level_6_data ; 13 12 11 10 f e d c b a 9 8 7 6 5 4 3 2 1 0 &2972 00 0a 12 25 0d 11 00 22 02 01 12 25 08 11 04 25 01 02 12 00 # Tile sprites &2986 76 30 ; WYCK # Colours &2988 e5 # Player starts &2989 00 # No pistons &298a 04 # 5 enemies ; x y x- x+ ss f &298b 68 68 44 7e 54 00 ; SNOWMAN &2991 15 30 20 a0 d2 09 ; PLATFORM &2997 1c e0 04 4b d4 00 ; SNOWMAN &299d 10 40 10 60 d2 08 ; PLATFORM &29a3 15 e0 b8 e7 d2 0b ; PLATFORM &29a9 3d # Tile data is &3d bytes long &29aa 05 52 f0 a0 99 21 21 12 23 21 11 30 09 90 00 99 # 9999999999999999 &29ba 94 99 30 99 9e 10 09 40 60 0f 90 00 f9 9e 04 14 # 00000000f000000f &29ca 93 09 90 00 99 00 04 75 70 24 31 60 09 ab 0a ac # 0000000000000000 &29da f0 0f f5 70 99 99 99 99 99 99 99 99 10 # a0000000000000aa # 0000000000009000 # 0000312400000000 # 7000000409909099 # 310000049ef9090f # 0000000409009e99 # 0000999499090900 # 0011212312212199 # 0000000000000000 # 0000000000050005 ; level_7_data ; 13 12 11 10 f e d c b a 9 8 7 6 5 4 3 2 1 0 &29e7 00 0a 03 04 0d 0c 06 24 19 1a 22 24 08 0c 06 04 20 02 03 00 # Tile sprites &29fb 12 30 ; RYGK # Colours &29fd c7 # Player starts &29fe 00 # No pistons &29ff 04 # 5 enemies ; x y x- x+ ss f &2a00 6e 43 42 c0 d9 01 ; FROG &2a06 28 80 78 b0 d9 01 ; FROG &2a0c 30 e0 0c 46 db 00 ; SNAIL_RIGHT &2a12 50 e0 2c 66 db 00 ; SNAIL_RIGHT &2a18 34 98 34 64 5a 04 ; TORTOISE &2a1e 3e # Tile data is &3e bytes long &2a1f 00 25 b0 24 22 c0 04 fd 02 81 ba ba 8a 10 a8 08 # 3331111101111333 &2a2f de 30 02 2b 50 0f 97 10 89 ab ab ab 8b 00 0f e6 # 3331111171111333 &2a3f 00 09 e0 00 0f 20 02 97 40 56 70 09 36 33 11 11 # 0000000900000000 &2a4f 17 11 11 33 33 33 11 11 00 11 11 31 33 10 # 5600000900000000 # 220f0e090e000000 # 0f08bababab89009 # 00000000f0000002 # 0000000000002000 # 0d00000000000000 # 08a8008ababa8002 # f000000000000004 # 0000000000000222 # 4000000000000250 ; level_8_data ; 13 12 11 10 f e d c b a 9 8 7 6 5 4 3 2 1 0 &2a5d 00 0a 1b 25 0d 0c 00 15 22 15 22 22 08 11 23 24 20 22 15 00 # Tile sprites &2a71 16 30 ; RYCK # Colours &2a73 31 # Player starts &2a74 59 5f 5a 0f # Pistons &2a78 02 # 2 enemies ; x y x- x+ ss f &2a79 55 3b 05 7c de 00 ; BIRD_RIGHT &2a7f 36 de 0e 5d de 00 ; BIRD_RIGHT &2a85 56 a8 56 7d de 00 ; BIRD_RIGHT &2a8b 36 # Tile data is &36 bytes long &2a8c e0 07 90 22 09 21 11 11 21 10 09 f0 10 09 91 60 # 00000000000f0000 &2a9c 0b b4 40 a8 0b 0f f0 50 ab 0b f0 10 09 96 30 09 # 0000000000000000 &2aac 22 10 ab ba 50 99 d0 0f a2 88 88 08 b0 aa aa aa # 0000000000000000 &2abc ba f0 f0 30 0f 00 # baaaaaaab088888a # 000f000000000000 # 0099000000baab00 # 2000900009000000 # 0900f0bab000000f # 0000000000000000 # 0ba800000b00000b # 0000000900900f09 # 0021111120092290 # 7000000000000000 ; level_9_data ; 13 12 11 10 f e d c b a 9 8 7 6 5 4 3 2 1 0 &2ac2 00 0a 03 00 0d 26 08 1e 27 29 1e 0f 08 13 04 25 27 0f 2b 00 # Tile sprites &2ad6 14 70 ; RWBK # Colours &2ad8 a7 # Player starts &2ad9 00 # No pistons &2ada 05 # 6 enemies ; x y x- x+ ss f &2adb 50 e0 20 60 6b 00 ; SNAIL_RIGHT &2ae1 78 50 04 80 dd 02 ; WASP &2ae7 7f 60 04 80 dd 02 ; WASP &2aed 70 40 04 80 dd 02 ; WASP &2af3 40 c0 90 d0 d0 01 ; BATHTUB # See &174a &2af9 10 90 78 a0 d0 01 ; BATHTUB &2aff 37 # Tile data is &37 bytes long &2b00 30 09 a9 10 09 90 60 09 a1 30 99 09 38 93 50 03 # 000000000000000f &2b10 f4 0a 98 40 0a 90 40 03 32 10 a3 40 03 a8 00 09 # 0f00001712000000 &2b20 24 21 20 0f a0 70 0a 97 50 0a 21 21 12 02 24 a2 # 000000a220000021 &2b30 b0 12 17 30 0f f0 f0 # 221200a000000900 # 000000a00000000a # 0f0002120000090a # 000000000300000a # 300300030000090a # 000009000000000a # f000003000000933 # 0000000009990000 # a009000000090900 # a000000000090000 ; level_10_data &2b37 00 0a 20 04 0d 26 16 24 19 1a 12 15 08 13 16 04 06 0c 02 00 # Tile sprites &2b4b 16 30 ; RYCK # Colours &2b4d 93 # Player starts &2b4e 00 # No pistons &2b4f 05 &2b50 50 27 27 90 f6 01 ; SPIDER &2b56 1e 2f 2f 98 c6 01 ; SPIDER &2b5c 32 a8 a8 d0 c6 01 ; SPIDER &2b62 40 27 27 60 f6 01 ; SPIDER &2b68 11 2f 2f 70 f6 01 ; SPIDER &2b6e 73 27 27 d0 86 01 ; SPIDER &2b74 50 &2b75 09 71 04 43 10 03 21 10 09 60 10 0f 15 9f 10 04 # a2060262c26266c6 &2b85 17 00 11 10 49 00 4d ed 00 01 f4 10 e4 41 11 11 # abacabcabaacabab &2b95 20 df 09 90 14 70 11 91 10 04 15 20 02 33 20 11 # ababdbabaedbaabb &2ba5 f0 80 0f f4 40 df bb aa db ae ab db ab ab ab ab # df00000f00000f00 &2bb5 ac ba ca ab ac ab c6 66 62 c2 62 02 60 00 a2 10 # 0000000000000000 # 0000000110003000 # 0200010000004009 # 1110000000014909 # df000111141e400f # 0000010ed4d04900 # 1101000000004009 # f1000000f0060900 # 2003004000047009 ; unused &2bc5 01 0f af 08 03 1f 5f 08 07 0e 27 08 07 0c 57 08 &2bd5 07 0c 27 0e 03 ce 07 6f 01 0e 07 0f 00 78 3c 08 &2be5 00 07 0f 00 00 13 4e 00 00 03 8e 00 00 13 0c 00 &2bf5 00 27 8c 00 00 07 6f 00 00 07 0c 2f ; player_right_even_head_sprite &2c01 00 0f 08 00 03 7f 8c 00 34 f7 cf 00 78 f3 7f 08 &2c11 34 f5 7f 08 03 7f cf 00 00 7f ce 00 00 7f 8c 00 &2c21 00 7f 08 00 01 0f 08 00 12 f0 86 00 16 f0 c2 00 &2c31 34 f0 c2 00 34 b4 c2 00 34 f0 c3 00 78 f0 e1 00 &2c41 78 b4 e1 00 78 c3 e1 00 1e f1 69 00 03 f1 ad 00 &2c51 12 7b 69 00 00 00 00 00 ; unused &2c59 00 00 00 00 bc 08 00 01 78 de 08 00 01 b5 bc 08 &2c69 00 01 e1 69 00 00 03 0f 0f 00 00 17 4f af 00 00 &2c79 2f 8c 4f 00 00 1f 08 af ; player_right_odd_head_sprite &2c81 00 03 0e 00 00 1f ef 00 01 f1 ff 0c 12 f0 df ce &2c91 01 f1 d7 ce 00 1f ff 0c 00 13 ff 08 00 13 ef 00 &2ca1 00 13 ce 00 00 07 0e 00 00 78 e1 08 01 78 f0 08 &2cb1 01 f0 f0 08 01 e1 f0 08 01 f0 f0 0c 12 f0 f0 84 &2cc1 12 e1 f0 84 12 f0 3c 84 03 78 d6 84 00 3c e7 84 &2cd1 00 5a de 84 00 00 00 00 ; unused &2cd9 00 00 00 00 &2cdd 20 6c 65 74 74 65 72 ; " letter" ; unused # Doesn't correspond to any used code &2ce4 ea NOP &2ce5 20 83 15 JSR &1583 &2ce8 a4 42 LDY &42 &2cea 20 b3 1a JSR &1ab3 &2ced a9 03 LDA #&03 &2cef 85 42 STA &42 &2cf1 a9 41 LDA #&41 ; "A" &2cf3 85 41 STA &41 &2cf5 a5 41 LDA &41 &2cf7 20 ee ff JSR &ffee ; OSWRCH &2cfa a9 08 LDA #&08 ; BACKSPACE &2cfc 20 ee ff JSR &ffee ; OSWRCH &2cff 08 PHP ; unused &2d00 0f ; player_right_even_feet_sprite_0 &2d01 12 c3 c2 00 07 5f 0e 00 2f af 0e 00 5f 09 0e 00 &2d11 2f 01 0e 00 0f 01 0f 08 3f 09 1f 8c 07 09 0f 0c ; player_right_even_feet_sprite_1 &2d21 12 c3 c2 00 01 0f 0c 00 00 5f 08 00 00 2f 08 00 &2d31 00 4f 00 00 01 af 00 00 01 1f 8c 00 01 0f 0c 00 ; player_right_even_feet_sprite_2 &2d41 12 c3 c2 00 07 2f 8e 00 0f 5f 4e 00 0f 09 8e 00 &2d51 0f 11 4e 00 0f 01 8f 08 3f 09 1f 8c 07 09 0f 0c ; player_right_even_feet_sprite_3 &2d61 12 c3 c2 00 01 0f 0c 00 00 5f 08 00 00 2f 08 00 &2d71 00 4f 00 00 01 af 00 00 01 1f 8c 00 01 0f 0c 00 ; player_right_odd_feet_sprite_0 &2d81 00 78 3c 08 01 1f 4f 08 03 af 8f 08 17 4e 07 08 &2d91 07 8c 07 08 07 0c 07 0e 03 ce 07 6f 01 0e 07 0f ; player_right_odd_feet_sprite_1 &2da1 00 78 3c 08 00 07 0f 00 00 13 4e 00 00 03 8e 00 &2db1 00 13 0c 00 00 27 8c 00 00 07 6f 00 00 07 0f 00 ; player_right_odd_feet_sprite_2 &2dc1 00 78 3c 08 01 0f af 08 03 1f 5f 08 07 0e 27 08 &2dd1 07 0c 57 08 07 0c 27 0e 03 ce 07 6f 01 0e 07 0f ; player_right_odd_feet_sprite_3 &2de1 00 78 3c 08 00 07 0f 00 00 13 4e 00 00 03 8e 00 &2df1 00 13 0c 00 00 27 8c 00 00 07 6f 00 00 07 0f 00 ; player_left_even_head_sprite &2e01 00 0f 08 00 01 ff 0e 00 17 ff e1 00 7f 6f f0 08 &2e11 7f 6d e1 00 17 ff 0e 00 13 ff 08 00 01 ff 08 00 &2e21 00 7f 08 00 00 0f 0c 00 03 f0 c2 00 12 f0 c3 00 &2e31 12 f0 e1 00 12 e1 e1 00 16 f0 e1 00 34 f0 f0 08 &2e41 34 e1 f0 08 34 96 f0 08 34 7c c3 08 25 fc 86 00 &2e51 34 7e 4a 00 00 00 00 00 ; unused &2e59 01 8f 0c 00 00 2f 8c 00 00 00 00 00 00 00 00 00 &2e69 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2e79 00 00 00 00 00 00 00 00 ; player_left_odd_head_sprite &2e81 00 03 0e 00 00 37 cf 08 01 7f fc 84 13 df bc c2 &2e91 13 df b4 84 01 7f cf 08 00 7f ce 00 00 37 ce 00 &2ea1 00 13 ce 00 00 03 0f 00 00 3c f0 08 00 78 f0 0c &2eb1 00 78 f0 84 00 78 b4 84 01 78 f0 84 01 f0 f0 c2 &2ec1 01 f0 b4 c2 01 e1 78 c2 01 d3 f0 0e 01 b7 e1 08 &2ed1 01 d3 da 08 00 00 00 00 ; unused &2ed9 00 27 0f 00 00 03 af 00 03 1f 0e 00 13 4f 2f 00 &2ee9 03 8e 5f 2b 17 4e 2f ab 27 8c 17 0e 0f 0c 03 0c &2ef9 0f 6f 01 08 03 0f 00 08 ; player_left_even_feet_sprite_0 &2f01 01 c3 e1 00 01 5f 0f 08 01 af 8f 0c 01 4e 07 0e &2f11 01 ae 03 0e 07 4e 03 0e 6f 0e 37 0c 0f 0e 07 08 ; player_left_even_feet_sprite_1 &2f21 01 c3 e1 00 00 0f 0e 00 00 27 8c 00 00 17 0c 00 &2f31 00 03 8c 00 00 13 4e 00 00 6f 0e 00 00 0f 0e 00 ; player_left_even_feet_sprite_2 &2f41 01 c3 e1 00 01 2f 8f 08 01 1f 5f 0c 01 0e 27 8e &2f51 01 0e 13 0e 07 0e 03 0e 6f 0e 37 0c 0f 0e 07 08 ; player_left_even_feet_sprite_3 &2f61 01 c3 e1 00 00 0f 0e 00 00 27 8c 00 00 17 0c 00 &2f71 00 03 8c 00 00 13 4e 00 00 6f 0e 00 00 0f 0e 00 ; player_left_odd_feet_sprite_0 &2f81 00 34 3c 84 00 17 4f 0e 00 27 af 0f 00 17 09 0f &2f91 00 27 88 0f 01 1f 08 0f 13 8f 09 cf 03 0f 09 0e ; player_left_odd_feet_sprite_1 &2fa1 00 34 3c 84 00 03 0f 08 00 01 af 00 00 01 4f 00 &2fb1 00 00 2f 00 00 00 5f 08 00 13 8f 08 00 03 0f 08 ; player_left_odd_feet_sprite_2 &2fc1 00 34 3c 84 00 07 af 0e 00 07 5f 4f 00 07 09 af &2fd1 00 07 08 4f 01 0f 08 0f 13 8f 09 cf 03 0f 09 0e ; player_left_odd_feet_sprite_3 &2fe1 00 34 3c 84 00 03 0f 08 00 01 af 00 00 01 4f 00 # Last byte is set at &1926 &2ff1 00 00 2f 00 00 00 5f 08 00 13 8f 08 00 03 00 # TRAP4 is loaded at &7200 - &7eff # &7200 - &73ff is moved to &0900 - &0aff at &1ae5 ; enemy_sprites_data ; sb wb w h ah al # Sprite addresses -1 &0900 62 38 f0 2a 1d 1d 1d 1d 20 20 82 82 ; &00 FISH &090c 50 28 f0 2a 0b 26 0b 26 70 6e 70 6e ; &01 JELLYFISH &0918 3f 38 ee 29 20 20 20 20 14 14 53 53 ; &02 PLATFORM &0924 78 40 f0 d8 1e 1e 1e 1e 64 64 dc dc ; &03 CLOUD &0930 60 20 f4 32 1f 1f 1f 1f 54 54 b4 b4 ; &04 SNOWMAN &093c 40 20 f1 2a 1e 1d 1e 1d 24 e4 24 e4 ; &05 FIRE &0948 60 30 ee 2a 23 22 23 23 9a da fa 3a ; &06 SPIDER &0954 50 28 f1 2a 26 26 25 25 1e 1e ce ce ; &07 BOMB &0960 66 30 f0 2a 24 24 25 25 fa fa 68 68 ; &08 DEVIL &096c 3c 20 f0 2a 22 22 22 22 9e 62 9e 62 ; &09 FROG &0978 2d 28 f2 22 22 22 22 22 08 08 35 35 ; &0a TORTOISE &0984 42 30 f0 22 21 21 21 21 00 00 42 42 ; &0b SNAIL_RIGHT &0990 42 30 f0 22 21 21 21 21 84 84 c6 c6 ; &0c SNAIL_LEFT &099c 78 28 f0 30 10 10 10 10 00 00 80 80 ; &0d WASP &09a8 40 20 f4 2a 04 04 04 04 bf bf 7f 7f ; &0e BIRD_RIGHT &09b4 40 20 f4 2a 04 04 03 03 3f 3f ff ff ; &0f BIRD_LEFT &09c0 60 30 ee 2a 05 05 05 05 40 40 40 40 ; &10 BATHTUB &09cc 18 18 f4 15 0b 0b 0b 0b c0 c0 d8 d8 ; &11 BALL # in contraption level &09d8 3f 38 ee 29 20 20 20 20 14 14 53 53 ; &12 PLATFORM # in contraption level &09e4 30 20 00 00 74 74 74 74 00 00 00 00 ; &13 SPACE # in contraption level &09f0 30 20 00 00 77 77 77 77 40 40 40 40 ; &14 APPLE # in contraption level ; unused &09fc 31 20 88 00 00 ; unused_event_handler # Unused code &0a01 08 PHP &0a02 48 PHA &0a03 c9 04 CMP #&04 # Is this a v-sync event? &0a05 d0 05 BNE &0a0c ; leave &0a07 a9 4e LDA #&4e # Same value as &062a &0a09 8d 69 fe STA &fe69 ; User VIA timer 2 counter MSB ; leave &0a0c 68 PLA &0a0d 28 PLP &0a0e 60 RTS ; unused &0a0f 00 ; title_screen_text_string &0a10 11 80 ; COLOUR &80 &0a12 11 01 ; COLOUR &01 &0a14 1f 0a 08 ; TAB(&0a, &08) &0a17 49 43 4f 4e 20 53 6f 66 74 77 61 72 65 ; "ICON Software" &0a24 1f 0b 0a ; TAB(&0b, &0a) &0a27 50 72 65 73 65 6e 74 73 2e 2e 2e ; "Presents..." &0a32 11 02 ; COLOUR &02 &0a34 1f 0b 0d ; TAB(&0b, &0d) &0a37 43 4f 4e 54 52 41 50 54 49 4f 4e ; "CONTRAPTION" &0a42 11 01 ; COLOUR &01 &0a44 1f 0f 0f ; TAB(&0f, &0f) &0a47 42 79 ; "By" &0a49 1f 08 11 ; TAB(&08, &11) &0a4c 44 61 76 65 20 26 20 48 65 6c 65 6e 20 4d 61 6e ; "Dave & Helen Mann" &0a5c 6e ; unused &0a5d 20 0d ; " " &0a5f 11 03 ; COLOUR &03 &0a61 20 0d ; " " ; unused &0a63 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 00 00 &0a73 00 00 00 00 00 00 00 00 00 00 00 00 00 ; initialise_irq1_handler &0a80 78 SEI &0a81 a9 93 LDA #&93 &0a83 8d b0 0a STA &0ab0 ; previous_irq1_handler_address_low &0a86 a9 dc LDA #&dc ; &dc93 = os_irq1v_handler &0a88 8d b1 0a STA &0ab1 ; previous_irq1_handler_address_high &0a8b a9 97 LDA #&97 &0a8d 8d 04 02 STA &0204 ; irq1_vector_low &0a90 a9 0a LDA #&0a ; &0a97 = irq1_handler &0a92 8d 05 02 STA &0205 ; irq1_vector_high &0a95 58 CLI &0a96 60 RTS ; irq1_handler &0a97 ad 6d fe LDA &fe6d ; User VIA interrupt flag register &0a9a 29 a0 AND #&a0 &0a9c c9 a0 CMP #&a0 # Is this a timer 2 interrupt? (never happens) &0a9e d0 0b BNE &0aab ; not_timer2_interrupt &0aa0 8d 6d fe STA &fe6d ; User VIA interrupt flag register # Clear interrupt &0aa3 a9 14 LDA #&14 # Reset timer &0aa5 8d 69 fe STA &fe69 ; User VIA timer 2 counter MSB &0aa8 a5 fc LDA &fc ; irq_accumulator &0aaa 40 RTI ; not_timer2_interrupt &0aab a5 fc LDA &fc ; irq_accumulator &0aad 6c b0 0a JMP (&0ab0) ; previous_irq1_handler_address ; previous_irq1_handler_address_low &0ab0 93 ; previous_irq1_handler_address_high &0ab1 dc ; unused &0ab2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; row_multiplication_table &0ac0 00 00 02 40 04 80 06 c0 09 00 0b 40 0d 80 0f c0 # &240 per group of eigh rows &0ad0 12 00 14 40 16 80 18 c0 1b 00 1d 40 1f 80 21 c0 &0ae0 24 00 26 40 28 80 2a c0 2d 00 2f 40 31 80 33 c0 &0af0 36 00 38 40 3a 80 3c c0 3f 00 41 40 ; unused &0afc fc 28 40 00 ; unused &7400 ff ; tile_sprite_data ; tile_sprite_00 # Space &7401 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &7411 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &7421 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &7431 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; tile_sprite_01 # Girder &7441 0f 0f 0f 0f ff ff ff ff ef 0f 0f 7f 6f 00 00 6f &7451 37 08 01 ce 13 8c 13 8c 01 ce 37 08 00 6f 6f 00 &7461 00 37 ce 00 0f 3f cf 0f ff ff ff ff 0f 0f 0f 0f &7471 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; tile_sprite_02 # Branch &7481 0f a1 0f 0f f0 96 f0 d2 0f f0 1e b4 f0 96 f0 f0 &7491 1e f0 1e 0f a1 0f a1 0f 00 00 00 00 00 00 00 00 &74a1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &74b1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; tile_sprite_03 # Bricks &74c1 f0 f2 e1 f2 77 77 ee ff e3 f0 7a e1 f2 5a e3 f0 &74d1 f2 f0 f2 b4 7f aa ff 77 d2 f2 78 f2 78 b6 e1 f2 &74e1 e1 f2 b4 f2 ee ff dd bb f2 d2 7a f0 7a 78 f2 5a &74f1 f2 e1 f2 78 ff 77 77 fe 78 7a d2 f2 d2 f2 78 f2 ; tile_sprite_04 # Trunk &7501 5a 69 d3 4a 78 69 d2 4a 78 69 d2 4a 78 b4 5b e1 &7511 3c b4 5a e1 35 a5 e1 e1 34 69 e1 ca 34 69 e1 c2 &7521 36 78 c3 c2 34 78 d2 c2 34 f0 d2 c3 34 f4 96 e1 &7531 78 b4 b4 e5 78 b4 b4 c3 35 b4 b6 c2 34 a5 d2 c2 ; tile_sprite_05 # Piston &7541 34 6f d2 86 79 ff f0 e1 0f 5a 5a 0f 52 69 69 a4 &7551 00 17 8e 00 00 13 8c 00 00 13 8c 00 00 13 8c 00 &7561 00 13 8c 00 00 13 8c 00 00 13 8c 00 00 13 8c 00 &7571 00 13 8c 00 00 13 8c 00 00 13 8c 00 00 13 8c 00 ; tile_sprite_06 # Mushroom &7581 00 03 0c 00 01 3c c3 08 16 f3 f2 86 35 f8 f3 c2 &7591 79 f3 f0 e1 7c f3 f0 ed 2d a5 d2 4b 00 35 ca 00 &75a1 00 37 ce 00 00 37 c2 00 00 37 ce 00 04 37 ca 00 &75b1 02 37 ce 02 01 37 ce 04 09 37 ce 09 06 3f 0f 06 ; tile_sprite_07 # Zigzag platform &75c1 08 02 00 08 8c 27 01 8c ce 7f 1b ce 6f df bf 6f &75d1 37 8d ef 37 13 08 4e 13 01 00 04 01 00 00 00 00 &75e1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &75f1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; tile_sprite_08 # Closed door top &7601 0f 0f 0f 0f 7f ff ff ef 7f ff ff ef 7f ff ff ef &7611 6f 1f 8f 6f 6f f5 bd e7 6f fd bf e7 6f fd bf e7 &7621 6f fd bf e7 6f fd bf e7 6f fd bf e7 6f fd bf e7 &7631 6f fd bf e7 6f f1 bc e7 7f ff ff ef 7f ff fe 6f ; tile_sprite_09 # Closed door bottom &7641 7f ff ef 6f 7f ff ff ef 6f 1f 8f 6f 6f f5 bd e7 &7651 6f fd bf e7 6f fd bf e7 6f fd bf e7 6f fd bf e7 &7661 6f fd bf e7 6f fd bf e7 6f fd bf e7 6f fd bf e7 &7671 6f f1 bc e7 7f ff ff ef 7f ff ff ef 0f 0f 0f 0f ; tile_sprite_0a # Open door top (EORed over closed door) &7681 00 00 00 00 00 00 00 00 30 f0 f0 c0 20 70 f0 c0 &7691 30 f0 80 40 30 0a b2 c8 30 82 b0 c8 30 a2 b0 c8 &76a1 30 a2 b0 c8 30 a2 b0 c8 30 a2 b0 c8 30 a2 b0 c8 &76b1 30 a2 b0 c8 30 ae b3 c8 20 00 f0 c0 20 00 f1 40 ; tile_sprite_0b # Open door bottom (EORed over closed door) &76c1 20 20 e0 40 20 00 f0 c0 30 c0 80 40 30 aa b2 c8 &76d1 30 a2 b0 c8 30 a2 b0 c8 30 a2 b0 c8 30 a2 b0 c8 &76e1 30 a2 b0 c8 30 a2 b0 c8 30 a2 b0 c8 30 82 b0 c8 &76f1 30 0e b3 c8 20 10 f0 c0 20 70 f0 c0 40 00 00 20 ; tile_sprite_0c # Plant &7701 00 00 00 00 0f 08 00 01 17 0e 00 0f 27 af 01 4f &7711 13 5f 0b af 01 0f 1b 4e 00 01 0b 0c 00 01 0c 00 &7721 0f 0c 08 00 5f 4e 08 0f 27 af 09 af 03 0f 13 4f &7731 00 01 27 8e 00 01 0b 0c 00 01 08 00 00 01 08 f0 ; tile_sprite_0d # Apple &7741 00 00 08 00 00 0e 0b 08 01 f5 7e 84 01 ff fd 84 &7751 01 ff fa 8c 01 f5 f5 84 01 fa fa 8c 00 7d f5 08 &7761 00 07 43 00 00 00 00 00 00 00 00 00 00 00 00 00 &7771 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; tile_sprite_0e # Trashcan &7781 30 f4 f2 00 3d 7a f4 86 0f 0f 0f 0e 05 05 07 04 &7791 06 c2 68 0c 05 c5 63 04 06 0a 0a 0c 03 05 05 08 &77a1 02 c2 68 08 03 c5 63 08 02 38 0a 08 03 35 05 08 &77b1 03 0a 0a 08 03 0f 0f 08 01 80 21 00 03 80 21 08 ; tile_sprite_0f # Cloud &77c1 11 ff 00 00 33 ff 88 ee ff ff ff ff ff ff ff ff &77d1 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff &77e1 ff ff ff ff ee ff ff ff 99 ff ff cc 11 ff ff 88 &77f1 11 ff ff 88 00 ff ff 00 00 77 cc 00 00 00 00 00 ; tile_sprite_10 # Pipe top &7801 00 00 00 00 00 00 00 00 0d 05 05 05 15 ff 55 c6 &7811 13 ee ba 8c 01 ff b1 08 01 ff fe 08 01 ff fd 08 &7821 01 ff fe 08 01 ff fd 08 01 ff fe 08 01 ff fd 08 &7831 01 ff fe 08 01 ff fd 08 01 ff fe 08 01 ff fd 08 ; tile_sprite_11 # Deadly coral &7841 18 24 20 0a 04 28 28 0c 02 28 24 04 30 34 14 08 &7851 03 0f 0f 08 34 f0 f0 0c 34 fc d2 84 35 f8 e1 84 &7861 35 f0 b4 84 34 d2 e1 84 12 78 f0 08 12 e1 b4 08 &7871 12 78 f0 08 34 f0 d2 84 78 f0 f0 4a 69 f0 d2 c2 ; tile_sprite_12 # Stalactites &7881 0f 0f 0b 07 f0 f0 f0 f0 f0 60 e0 f0 b0 60 f0 f0 &7891 a0 d0 f0 c3 58 3c 70 84 78 1a 70 84 25 12 f0 08 &78a1 25 12 70 08 02 01 f0 08 00 01 61 00 00 01 e1 00 &78b1 00 00 69 00 00 00 4a 00 00 00 4a 00 00 00 0e 00 ; tile_sprite_13 # Tulips &78c1 01 08 00 06 12 08 01 4e 13 84 12 ca 36 8c 35 c6 &78d1 35 c6 36 ca 36 ca 13 84 07 0c 01 0c 00 08 02 00 &78e1 00 80 20 00 00 80 20 00 00 40 40 00 04 40 40 00 &78f1 02 40 40 00 09 41 40 08 05 48 49 03 05 0a 0a 04 ; tile_sprite_14 # Pipe middle &7901 01 ff fe 08 01 ff fd 08 01 ff fe 08 01 ff fd 08 &7911 01 ff fe 08 01 ff fd 08 01 ff fe 08 01 f6 fd 08 &7921 13 ff ff 8c 01 fb f6 08 01 ff fd 08 01 ff fe 08 &7931 01 ff fd 08 01 ff fe 08 01 ff fd 08 01 ff fe 08 ; tile_sprite_15 # Chain &7941 01 0f 0e 00 13 ff ef 00 0f 8f 4f 0f ff 08 37 ff &7951 0f 8f 4f 0f 13 ff ef 00 01 0f 0e 00 00 00 00 00 &7961 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &7971 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; tile_sprite_16 # Left spiders web &7981 00 e0 40 50 00 10 c0 90 f0 10 30 90 40 e0 20 70 &7991 20 70 40 10 10 80 c0 20 90 90 30 40 60 60 00 c0 &79a1 40 20 10 00 20 d0 20 00 20 80 c0 00 70 10 c0 00 &79b1 90 20 00 00 00 c0 00 00 70 80 00 00 80 00 00 00 ; tile_sprite_17 # Curving pipe &79c1 01 ff fd 08 01 ff fe 08 01 ff fd 08 01 ff ff 0b &79d1 01 ff fe 9f 01 ff ff df 01 ff fe ff 01 ff ff df &79e1 01 fb ff ff 00 7d ff df 00 7e fb f6 00 35 f5 d7 &79f1 00 03 fa fa 00 00 0f 1f 00 00 00 03 00 00 00 00 ; tile_sprite_18 # Contraption top left &7a01 03 0f 0f 0f 34 f0 f0 f0 7b f0 f0 f0 7a f0 f0 f0 &7a11 78 c3 0f 0f 78 c3 3f 08 78 d3 bf 0f 78 d3 bf 7f &7a21 78 c3 3f 0f 78 c2 7f 8c 78 c3 ff cb 78 c3 ff db &7a31 78 c3 f7 c7 78 d3 78 8c 78 d3 bf 0f 0f 0f 0f 0f ; tile_sprite_19 # Leaves &7a41 00 0f 00 08 03 aa 0c 0f 1d 50 47 aa ba 8e a3 55 &7a51 41 09 49 aa 0e 00 34 0f 00 06 12 f0 00 2b 05 0f &7a61 09 45 08 00 09 ab 08 00 09 d5 04 01 01 fa 08 12 &7a71 03 0f 00 13 00 00 00 12 00 00 00 13 00 00 00 07 ; tile_sprite_1a # Leaves &7a81 00 03 09 0f 00 2e 9f 46 09 44 26 8b 0e cb 95 24 &7a91 5c 04 4b 68 a8 08 00 0f 43 04 00 01 0c 02 00 01 &7aa1 04 02 0c 03 0e 0f 8a 15 c5 57 42 26 c9 aa 84 34 &7ab1 c5 e4 84 12 ca 2e 08 01 84 12 08 01 08 01 00 00 ; tile_sprite_1b # Coral platform &7ac1 00 06 00 00 0c 6f 08 03 8f ff 8c 37 ff ff ce 37 &7ad1 ff fc cf 7f fc fc ff fc 7c bf df fc cf 7f 7f 7f &7ae1 0c 37 cf 3f 00 03 8f 03 00 01 08 00 00 00 00 00 &7af1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; tile_sprite_1c # Apple arrow &7b01 01 0d 0c 00 13 fd ca 00 13 ff c6 00 13 f6 ca 00 &7b11 01 fd 84 00 00 0d 08 00 00 00 00 00 00 00 00 00 &7b21 00 0f 08 00 00 7f 08 00 00 7f 08 00 03 7f 0e 00 &7b31 01 ff 8c 00 00 7f 08 00 00 27 00 00 00 02 00 00 ; tile_sprite_1d # Contraption top middle &7b41 0f 0f 0f 0f f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 f0 &7b51 0f 2d 0f 0f 01 f6 84 04 0f f4 84 04 ff 78 08 05 &7b61 0f 7f 0a 04 00 7f 0a 04 0f f7 4b 0f de f7 b0 ff &7b71 1e f7 80 c3 12 f7 80 c0 1e f7 b0 03 0f 0f 0f 0f ; tile_sprite_1e # Umbrella &7b81 00 01 00 00 00 1f 0e 00 03 df 6f 08 37 bf bf 8c &7b91 7f 7f df ce 0f 0f 0f 0e 80 81 20 20 00 01 00 00 &7ba1 00 01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 &7bb1 00 01 00 00 00 01 02 00 00 01 02 00 00 10 0c 00 ; tile_sprite_1f # Contraption top right &7bc1 0f 0f 0f 0c f0 f0 f0 c2 f0 f0 f0 e1 f0 f0 f0 e1 &7bd1 0f 0f 3c e1 85 13 bc e1 09 01 bc c2 01 00 3c 86 &7be1 03 0f 3c e1 37 d3 bc c2 3f c3 3c 86 fc c2 34 e1 &7bf1 3c c2 34 e1 03 0f 3c c2 0d ef 34 86 0f 0f 0f 0f ; tile_sprite_20 # Lattice &7c01 01 00 00 08 01 01 00 06 00 0e 02 09 0d 01 01 00 &7c11 02 00 0e 01 05 04 00 06 08 08 00 08 00 08 05 00 &7c21 08 04 02 03 04 03 02 04 03 08 0f 0a 0c 08 02 00 &7c31 00 04 02 00 00 03 0d 00 00 04 08 0c 00 08 00 02 ; tile_sprite_21 # Coral platform &7c41 00 00 00 0c 09 08 01 cf 9f 8e 07 ff ff ef 7f 7f &7c51 df ff ff ff ff bf f3 ff ef 7f f3 5f 8e 37 ff 8d &7c61 08 03 3f 08 00 00 03 00 00 00 00 00 00 00 00 00 &7c71 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; tile_sprite_22 # Coral platform &7c81 0f 08 16 0f f5 0f 3e ff ff 7f d7 fe fd 7f df f7 &7c91 ff 7e df fd fd bf 9d ff f7 3f 8d eb ef 13 08 6f &7ca1 4e 01 00 4e 04 00 00 04 00 00 00 00 00 00 00 00 &7cb1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; tile_sprite_23 # Column top &7cc1 0f ef 0f 0f 7b ff ff e5 7d ff ff eb 34 ff fa c2 &7cd1 34 f7 f4 86 7b ff ff e5 79 ff ff e9 34 f6 f8 c2 &7ce1 13 ff fd 84 01 ff fa 08 00 7a e9 00 00 7f eb 00 &7cf1 00 7f ed 00 00 7f eb 00 00 7f ed 00 00 7f eb 00 ; tile_sprite_24 # Plants &7d01 00 0c 00 0f 01 46 01 45 13 cd c1 ab 15 8b 8a 4d &7d11 13 8c 4d 06 05 08 2b 00 2b 00 15 0e 0e 00 26 2b &7d21 4d 07 13 4d 2a 4d 09 2b 0d aa 09 4d 13 55 0a 86 &7d31 03 ab 13 04 12 0f 26 08 13 c2 15 08 01 ce 37 08 ; tile_sprite_25 # Column middle &7d41 36 fd fb c6 36 fd fb c6 36 fd fb c6 36 fd fb c6 &7d51 36 fd fb c6 36 fd fb c6 36 fd fb c6 36 fd fb c6 &7d61 36 fd fb c6 36 fd fb c6 36 fd fb c6 36 fd fb c6 &7d71 36 fd fb c6 36 fd fb c6 36 fd fb c6 36 fd fb c6 ; tile_sprite_26 # Right spiders web &7d81 a0 20 70 00 90 30 80 00 90 c0 80 f0 e0 40 70 20 &7d91 80 20 e0 40 40 30 10 80 20 c0 90 90 30 00 60 60 &7da1 00 80 40 20 00 40 b0 40 00 30 10 40 00 30 80 e0 &7db1 00 00 40 90 00 00 30 00 00 00 10 e0 00 00 00 10 ; tile_sprite_27 # Balloons &7dc1 03 0c 03 0c 34 c2 37 ce 7b f0 6f ef 7a f0 5f ef &7dd1 78 f0 7f ef 78 f0 7f ef 34 c2 37 ce 03 0c 03 0c &7de1 01 08 10 80 00 08 00 80 00 04 10 00 00 02 10 00 &7df1 00 02 10 00 00 04 10 80 00 00 00 80 00 00 00 00 ; tile_sprite_28 # Curving platform left &7e01 0f 07 0d 0d f0 f0 f0 f0 f0 f0 f0 f0 d0 f0 70 d0 &7e11 f0 70 d0 f0 f0 f0 70 0f f0 d0 0f 00 f0 61 00 00 &7e21 b0 c2 00 00 f0 84 00 00 d0 08 00 00 f0 08 00 00 &7e31 61 08 00 00 e1 00 00 00 e1 00 00 00 e1 00 00 00 ; tile_sprite_29 # Ladder &7e41 17 8f 0f 0c 13 8c 37 08 13 8c 37 08 13 8c 37 08 &7e51 13 8c 37 08 13 8c 37 08 17 8f 0f 0c 37 ff ff 8c &7e61 07 0f 3f 0c 13 8c 37 08 13 8c 37 08 13 8c 37 08 &7e71 13 8c 37 08 13 8c 37 08 07 0f 3f 0c 37 ff ff 8c ; tile_sprite_2a # Curving platform right &7e81 01 0f 0f 0f 96 f0 e0 f0 78 b0 b0 f0 d0 f0 f0 f0 &7e91 f0 b0 e0 f0 78 f0 f0 e0 16 70 b0 70 01 c1 58 f0 &7ea1 00 0e 34 b0 00 00 06 f0 00 00 12 f0 00 00 01 f0 &7eb1 00 00 00 58 00 00 00 3c 00 00 00 12 00 00 00 12 ; tile_sprite_2b # Cloud; uses zero byte at &7f00 &7ec1 00 ff 00 00 bb ff 99 ff ff ff ff ff ff ff ff ff &7ed1 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff &7ee1 ff ff ff ff ff ff ee 77 77 bb cc 11 77 88 00 00 &7ef1 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00