Dare Devil Denis disassembly ============================ Dare Devil Denis, also known as Daredevil Dennis, was written by Simon Pick, and was published by Visions Software for the BBC Micro in 1984. It is a platform game in which the player must jump over and avoid obstacles. The following disassembly was created by reverse engineering binary images, without access to any source code. It is nevertheless reasonably complete, allowing the technical approaches used to be understood. The author of this disassembly imposes no additional copyright restrictions beyond those already present on the game itself. It is provided for educational purposes only, and it is hoped that the original authors will accept it in the good faith it was intended - as a tribute to their skills. Technical notes =============== The first BASIC loader uses embedded control characters to hide the actual code run if listed, and instead displays alternative code intended to confuse pirates. Interesting pokes ================= &1b51 = &60 infinite takes &1550 = &4c, &1551 = &08, &1552 = 15 invulnerability Loader disassembly ================== ; DDDenis1 ; 00000e00 0000801f 03e5 &0e00 0d # Start of BASIC program # Embedded backspaces hide line number and REM # Embedded &15 character disables output &0e01 00 0a 24 20 f4 7f 7f 7f 7f 7f 7f 7f 15 2e 2e 2e ; 10 REM...................... &0e11 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e &0e21 2e 2e 2e 0d &0e25 00 14 0b 20 e5 20 8d 44 78 40 0d ; 20 GOTO 120 # Skip obfuscation # Embedded &06 character enables output &0e30 00 1e 25 20 f4 7f 7f 7f 7f 7f 06 20 20 20 20 20 ; 30 REM &0e40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &0e50 20 20 20 20 0d &0e55 00 23 85 f4 22 83 41 4e 59 4f 4e 45 20 46 4f 55 ; 35REM" ANYONE FOUND OWNING A 'PIRATE' &0e65 4e 44 20 4f 57 4e 49 4e 47 20 41 20 27 50 49 52 ; COPY OF DENIS WILL BE &0e75 41 54 45 27 20 20 20 20 20 20 20 20 83 83 43 4f ; PROSECUTED" &0e85 50 59 20 4f 46 20 44 45 4e 49 53 20 57 49 4c 4c &0e95 20 42 45 20 20 20 20 20 20 20 20 20 20 20 20 20 &0ea5 20 20 20 20 20 83 50 52 4f 53 45 43 55 54 45 44 &0eb5 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &0ec5 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &0ed5 20 20 20 20 0d &0eda 00 28 12 20 2a 42 52 4b 28 22 44 45 4e 49 53 22 ; 40 *BRK("DENIS") # Unused; obfuscation &0eea 29 0d # Only the obfuscation is listed # &0eec 00 32 3c 20 dd a4 50 69 72 61 74 65 28 4e 29 3d ; 50 DEFFNPirate(N)= # &0efc 28 3f 26 43 30 30 2b 32 35 36 2a 26 43 30 31 2b ; (?&C00+256*&C01+PAGE)+ # &0f0c 90 29 2b bb 28 24 4e 29 2b 22 44 45 4e 49 53 22 ; +VAL($N)+ # &0f1c 2b c3 28 a8 28 3f 4e 5e 32 29 29 0d ; +"DENIS"+ # ; +STR$(INT(?N^2)) # # &0f28 00 3c 23 20 e7 20 a4 50 69 72 61 74 65 28 33 29 ; 60 IF FNPirate(3)="DENIS1" # &0f38 3d 22 44 45 4e 49 53 31 22 20 f2 63 6f 72 72 75 ; PROCcorrupt # &0f48 70 74 0d # # &0f4b 00 46 08 20 d7 22 22 0d ; 70 CHAIN"" # # &0f53 00 50 0e 20 dd f2 63 6f 72 72 75 70 74 0d ; 80 DEFPROCcorrupt # # &0f61 00 5a 0d 20 2a 46 58 32 35 34 2c 30 0d ; 90 *FX254,0 # Read/write available RAM # &0f6e 00 64 06 20 e1 0d ; 100 ENDPROC # &0f74 00 65 44 f4 22 83 54 68 65 20 6e 61 6d 65 20 22 ; 101REM" The name "DARE DEVIL DENIS" is &0f84 44 41 52 45 20 44 45 56 49 4c 20 44 45 4e 49 53 ; copyright of VISIONS. &0f94 22 20 69 73 20 20 20 20 20 20 20 20 20 83 63 6f &0fa4 70 79 72 69 67 68 74 83 6f 66 81 56 49 53 49 4f &0fb4 4e 53 2e 0d # Embedded backspaces hide line number and REM # Embedded &15 character disables output &0fb8 00 6e 24 20 f4 7f 7f 7f 7f 7f 7f 7f 15 2e 2e 2e ; 110 REM...................... &0fc8 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e &0fd8 2e 2e 2e 0d &0fdc 00 78 06 20 db 0d ; 120 CLS # Replace BASIC program if BREAK pressed &0fe2 00 79 eb 20 2a 4b 45 59 31 30 2c 7c 4c 7c 4d 7c ; 121 *KEY10,|L|M|M|M|M|M &0ff2 4d 7c 4d 7c 4d 7c 4d 31 30 20 44 61 72 65 20 44 10 Dare Devil Denis. &1002 65 76 69 6c 20 44 65 6e 69 73 2e 20 20 20 20 20 By simon Pick.|M &1012 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20You are reminded that this program &1022 20 20 42 79 20 73 69 6d 6f 6e 20 50 69 63 6b 2e is copyright.Action will be taken &1032 7c 4d 32 30 59 6f 75 20 61 72 65 20 72 65 6d 69 against any person owning, or &1042 6e 64 65 64 20 74 68 61 74 20 74 68 69 73 20 70 duplicating an illegal copy.|M &1052 72 6f 67 72 61 6d 20 20 20 20 20 20 69 73 20 63 &1062 6f 70 79 72 69 67 68 74 2e 41 63 74 69 6f 6e 20 &1072 77 69 6c 6c 20 62 65 20 74 61 6b 65 6e 20 20 20 &1082 20 20 20 20 61 67 61 69 6e 73 74 20 61 6e 79 20 &1092 70 65 72 73 6f 6e 20 6f 77 6e 69 6e 67 2c 20 6f &10a2 72 20 20 20 20 20 20 20 20 20 20 20 64 75 70 6c &10b2 69 63 61 74 69 6e 67 20 61 6e 20 69 6c 6c 65 67 &10c2 61 6c 20 63 6f 70 79 2e 7c 4d 0d &10cd 00 82 2e 20 f1 20 27 22 83 20 20 20 44 61 72 65 ; 130 PRINT '" Dare Devil Denis part one loaded" &10dd 20 44 65 76 69 6c 20 44 65 6e 69 73 20 70 61 72 &10ed 74 20 6f 6e 65 20 6c 6f 61 64 65 64 22 0d &10fb 00 8c 23 20 f1 20 27 22 20 82 20 20 20 20 20 20 ; 140 PRINT '" Please wait !" &110b 20 20 20 20 50 6c 65 61 73 65 20 77 61 69 74 20 &111b 21 22 0d # Define text window &111e 00 96 14 20 ef 20 32 38 2c 31 32 2c 31 30 2c 33 ; 150 VDU 28,12,10,30,7 &112e 30 2c 37 0d # Player dying &1132 00 a0 24 20 e2 31 2c 30 2c 30 2c 30 2c 30 2c 30 ; 160 ENVELOPE1,0,0,0,0,0,0,0,0,0,0,-1,127,0 &1142 2c 30 2c 30 2c 30 2c 30 2c 30 2c 2d 31 2c 31 32 &1152 37 2c 30 0d # Collecting gold &1156 00 aa 24 20 e2 32 2c 30 2c 30 2c 30 2c 30 2c 30 ; 170 ENVELOPE2,0,0,0,0,0,0,0,0,0,0,-6,127,0 &1166 2c 30 2c 30 2c 30 2c 30 2c 30 2c 2d 36 2c 31 32 &1176 37 2c 30 0d # Extra take &117a 00 b4 28 20 e2 33 2c 31 30 2c 32 30 2c 32 30 2c ; 180 ENVELOPE3,10,20,20,16,1,1,1,0,0,0,-4,127,0 &118a 31 36 2c 31 2c 31 2c 31 2c 30 2c 30 2c 30 2c 2d &119a 34 2c 31 32 37 2c 30 0d # Define character for ground (CHARACTER_GROUND) &11a2 00 be 25 20 ef 20 32 33 2c 32 35 30 2c 32 35 35 ; 190 VDU 23,250,255,255,255,255,0,0,0,0 &11b2 2c 32 35 35 2c 32 35 35 2c 32 35 35 2c 30 2c 30 &11c2 2c 30 2c 30 0d &11c7 00 c8 0c 20 d0 3d 26 34 30 30 30 0d ; 200 PAGE=&4000 # Run DDDenis2 &11d3 00 d2 08 20 d7 22 22 0d ; 210 CHAIN"" # Embedded &06 character enables output &11db 00 dc 09 20 f4 06 20 20 0d ; 220 REM &11e4 ff # End of BASIC program ; DDDenis2 ; 00004000 00004000 0b00 &4000 0d # Start of BASIC program &4001 00 01 0e 20 2a 46 58 32 34 37 2c 37 36 0d ; 1 *FX247,76 # ?&0287 = &4c (JMP) &400f 00 02 0f 20 2a 46 58 32 34 38 2c 32 34 36 0d ; 2 *FX248,246 # ?&0288 = &f6 set break intercept code &401e 00 03 0e 20 2a 46 58 32 34 39 2c 31 34 0d ; 3 *FX249,14 # ?&0289 = &0e to &0ef6 (start_screen) &402c 00 0a 0f 20 2a 46 58 32 32 30 2c 32 35 35 0d ; 10 *FX220,255 # Set ASCII for ESCAPE to &ff &403b 00 0b 0c 20 3f 33 38 33 30 3d 30 0d ; 11 ?3830=0 # ?&EF6 = &00 (BRK) &4047 00 14 08 20 eb 20 37 0d ; 20 MODE 7 &404f 00 1e 13 20 3f 31 31 32 3d 31 3a 3f 31 31 33 3d ; 30 ?112=1: # ?&70 (tune_address_low) = &01 &405f 36 36 0d ; ?113=66 # ?&71 (tune_address_high) = &42 # &4201 = tune_data - 3 &4062 00 28 0b 20 3f 31 31 34 3d 31 0d ; 40 ?114=1 # ?&72 (tune_cooldown) = &01 &406d 00 32 2d 20 e3 20 41 3d 30 20 b8 20 31 30 32 33 ; 50 FOR A=0 TO 1023 STEP 4: &407d 20 88 20 34 3a 21 28 41 2b 26 37 43 30 30 29 3d ; !(A+&7C00)=!(A+18150):# &46e6 (loading_screen_data) &408d 21 28 41 2b 31 38 31 35 30 29 3a ed 0d ; NEXT &409a 00 46 0d 20 3f 26 32 32 30 3d 38 30 0d ; 70 ?&220=80 # event_vector = &4150 (event_handler) &40a7 00 50 0d 20 3f 26 32 32 31 3d 36 35 0d ; 80 ?&221=65 &40b4 00 5a 0c 20 2a 46 58 31 34 2c 34 0d ; 90 *FX14,4 # Enable v-sync event &40c0 00 6e 15 20 ef 20 32 38 2c 31 33 2c 32 33 2c 33 ; 110 VDU 28,13,23,39,21 # Define text window &40d0 39 2c 32 31 0d &40d5 00 78 09 20 2a 52 55 4e 0d ; 120 *RUN # Run DDDenis3 &40de ff # End of BASIC program ; unused &40df 0d 00 00 89 08 00 00 00 &40e7 4e 0d ; ... N &40e9 ff # End of BASIC program &40ea 32 00 00 8b 00 00 00 00 &40f2 32 31 0d ; ... 21 &40f5 00 78 09 20 2a 52 55 4e 0d ; 120 *RUN &40fe ff # End of BASIC program &40ff 31 33 2c 32 33 2c 33 39 2c 32 31 0d ; ... 13,23,39,21 &410b 00 78 09 20 2a 52 55 4e 0d ; 120 *RUN &4114 ff # End of BASIC program &4115 33 00 00 87 32 00 00 00 &411d 37 2c 31 35 0d ; ... 7,15 &4122 00 78 09 20 2a 52 55 4e 0d ; 120 *RUN &412b ff # End of BASIC program &412c 0d 00 00 8b 00 00 00 00 &4134 30 2c 32 30 2c 33 30 2c 31 37 0d ; ... 0,20,30,17 &413f 00 6e 09 20 2a 52 55 4e 0d ; 110 *RUN &4148 ff # End of BASIC program &4149 31 00 00 8c 75 00 00 ; event_handler &4150 c6 72 DEC &72 ; tune_cooldown &4152 a5 72 LDA &72 ; tune_cooldown &4154 c9 00 CMP #&00 &4156 f0 01 BEQ &4159 ; update_tune &4158 60 RTS ; update_tune &4159 18 CLC &415a a5 70 LDA &70 ; tune_address_low &415c 69 03 ADC #&03 &415e 85 70 STA &70 ; tune_address_low &4160 a5 71 LDA &71 ; tune_address_high &4162 69 00 ADC #&00 &4164 85 71 STA &71 ; tune_address_high &4166 a0 00 LDY #&00 &4168 b1 70 LDA (&70),Y ; tune_address # First byte of tune data specifies pitch &416a c9 00 CMP #&00 # Zero indicates end of tune &416c d0 0d BNE &417b ; not_end_of_tune ; restart_tune &416e a9 01 LDA #&01 ; &4201 = tune_data - 3 &4170 85 70 STA &70 ; tune_address_low &4172 a9 42 LDA #&42 &4174 85 71 STA &71 ; tune_address_high &4176 a9 01 LDA #&01 &4178 85 72 STA &72 ; tune_cooldown &417a 60 RTS ; not_end_of_tune &417b a9 11 LDA #&11 # Play immediately on channel 1 &417d 8d 00 0c STA &0c00 ; sound_block + 0 (channel) &4180 a9 00 LDA #&00 &4182 8d 01 0c STA &0c01 ; sound_block + 1 (channel high) &4185 a9 f1 LDA #&f1 &4187 8d 02 0c STA &0c02 ; sound_block + 2 (volume) &418a a9 ff LDA #&ff &418c 8d 03 0c STA &0c03 ; sound_block + 3 (volume high) &418f a0 00 LDY #&00 &4191 b1 70 LDA (&70),Y ; tune_address # First byte of tune data specifies first pitch &4193 8d 04 0c STA &0c04 ; sound_block + 4 (pitch) &4196 a9 00 LDA #&00 &4198 8d 05 0c STA &0c05 ; sound_block + 5 (pitch high) &419b a9 ff LDA #&ff &419d 8d 06 0c STA &0c06 ; sound_block + 6 (duration) &41a0 a9 00 LDA #&00 &41a2 8d 07 0c STA &0c07 ; sound_block + 7 (duration high) &41a5 a2 00 LDX #&00 ; &0c00 = sound_block &41a7 a0 0c LDY #&0c &41a9 a9 07 LDA #&07 ; Generate a sound &41ab 20 f1 ff JSR &fff1 ; OSWORD # Play first note in chord on channel one &41ae a9 12 LDA #&12 # Play immediately on channel 2 &41b0 8d 00 0c STA &0c00 ; sound_block + 0 (channel) &41b3 a9 00 LDA #&00 &41b5 8d 01 0c STA &0c01 ; sound_block + 1 (channel high) &41b8 a9 f1 LDA #&f1 &41ba 8d 02 0c STA &0c02 ; sound_block + 2 (volume) &41bd a9 ff LDA #&ff &41bf 8d 03 0c STA &0c03 ; sound_block + 3 (volume high) &41c2 a0 01 LDY #&01 &41c4 b1 70 LDA (&70),Y ; tune_address # Second byte of tune data specifies second pitch &41c6 8d 04 0c STA &0c04 ; sound_block + 4 (pitch) &41c9 a9 00 LDA #&00 &41cb 8d 05 0c STA &0c05 ; sound_block + 5 (pitch high) &41ce a9 ff LDA #&ff &41d0 8d 06 0c STA &0c06 ; sound_block + 6 (duration) &41d3 a9 00 LDA #&00 &41d5 8d 07 0c STA &0c07 ; sound_block + 7 (duration high) &41d8 a2 00 LDX #&00 ; &0c00 = sound_block &41da a0 0c LDY #&0c &41dc a9 07 LDA #&07 ; Generate a sound &41de 20 f1 ff JSR &fff1 ; OSWORD # Play second note in chord on channel two &41e1 a0 02 LDY #&02 &41e3 b1 70 LDA (&70),Y ; tune_address # Third byte of tune data specifies duration &41e5 85 72 STA &72 ; tune_cooldown &41e7 18 CLC &41e8 a5 72 LDA &72 ; tune_cooldown &41ea 65 72 ADC &72 ; tune_cooldown &41ec 85 72 STA &72 ; tune_cooldown &41ee 18 CLC &41ef a5 72 LDA &72 ; tune_cooldown &41f1 65 72 ADC &72 ; tune_cooldown &41f3 85 72 STA &72 ; tune_cooldown &41f5 18 CLC &41f6 a5 72 LDA &72 ; tune_cooldown &41f8 71 70 ADC (&70),Y ; tune_address &41fa 85 72 STA &72 ; tune_cooldown &41fc 18 CLC &41fd a5 72 LDA &72 ; tune_cooldown &41ff 71 70 ADC (&70),Y ; tune_address &4201 85 72 STA &72 ; tune_cooldown &4203 60 RTS ; tune_data ; p1 p2 d &4204 75 75 03 &4207 79 79 01 &420a 81 35 02 &420d 75 51 02 &4210 65 45 02 &4213 51 51 02 &4216 35 35 02 &4219 51 51 02 &421c 81 45 02 &421f 75 51 02 &4222 89 35 02 &4225 79 59 02 &4228 65 49 02 &422b 59 59 02 &422e 35 35 02 &4231 59 59 02 &4234 79 49 02 &4237 89 59 02 &423a 89 35 02 &423d 81 51 02 &4240 79 45 02 &4243 75 51 02 &4246 75 21 02 &4249 6d 49 02 &424c 65 3d 02 &424f 61 49 02 &4252 61 35 02 &4255 65 45 02 &4258 51 35 02 &425b 45 45 02 &425e 31 31 02 &4261 3d 3d 02 &4264 81 21 02 &4267 49 49 01 &426a 81 81 01 &426d 81 35 02 &4270 89 51 01 &4273 81 81 01 &4276 79 45 02 &4279 75 51 02 &427c 75 21 02 &427f 6d 49 02 &4282 65 3d 02 &4285 61 49 02 &4288 61 35 02 &428b 51 51 02 &428e 65 45 02 &4291 51 51 02 &4294 35 35 02 &4297 51 51 02 &429a 65 45 02 &429d 51 51 01 &42a0 6d 6d 01 &42a3 75 35 02 &42a6 65 51 02 &42a9 81 45 02 &42ac 75 51 02 &42af 6d 31 02 &42b2 51 51 02 &42b5 3d 3d 02 &42b8 51 51 02 &42bb 6d 29 02 &42be 65 45 02 &42c1 75 35 02 &42c4 65 45 02 &42c7 59 1d 02 &42ca 3d 3d 02 &42cd 29 29 02 &42d0 65 3d 02 &42d3 61 21 02 &42d6 9d 3d 02 &42d9 9d 31 02 &42dc 3d 3d 02 &42df 31 31 02 &42e2 51 51 02 &42e5 95 3d 02 &42e8 91 51 02 &42eb 91 35 02 &42ee 89 51 02 &42f1 89 45 02 &42f4 51 51 02 &42f7 35 35 02 &42fa 51 51 02 &42fd 91 39 02 &4300 81 59 02 &4303 9d 3d 02 &4306 59 59 02 &4309 4d 4d 02 &430c 59 59 02 &430f 95 41 02 &4312 8d 69 02 &4315 89 51 02 &4318 81 69 02 &431b 9d 3d 02 &431e 59 59 02 &4321 4d 4d 02 &4324 89 59 02 &4327 95 41 02 &432a 8d 69 02 &432d 89 51 02 &4330 81 69 02 &4333 81 3d 02 &4336 59 59 02 &4339 7d 4d 02 &433c 59 59 02 &433f 35 35 02 &4342 59 59 02 &4345 6d 4d 02 &4348 59 59 02 &434b 9d 31 02 &434e 51 51 02 &4351 9d 3d 02 &4354 51 51 01 &4357 9d 9d 01 &435a a5 31 02 &435d 9d 51 02 &4360 95 3d 02 &4363 91 51 02 &4366 95 3d 02 &4369 59 59 02 &436c 95 4d 02 &436f 59 59 01 &4372 95 95 01 &4375 95 3d 02 &4378 59 59 02 &437b 4d 4d 02 &437e 59 59 02 &4381 91 3d 02 &4384 61 61 02 &4387 89 51 02 &438a 91 61 02 &438d 95 3d 02 &4390 91 61 02 &4393 89 51 02 &4396 81 61 02 &4399 89 3d 02 &439c 59 59 02 &439f 6d 4d 02 &43a2 59 59 01 &43a5 6d 6d 01 &43a8 6d 3d 02 &43ab 35 35 02 &43ae 91 31 02 &43b1 29 29 01 &43b4 95 95 01 &43b7 9d 21 02 &43ba 3d 3d 02 &43bd 9d 31 02 &43c0 3d 3d 01 &43c3 9d 9d 01 &43c6 a5 31 02 &43c9 9d 51 02 &43cc 95 3d 02 &43cf 91 51 02 &43d2 95 3d 02 &43d5 59 59 02 &43d8 95 4d 02 &43db 59 59 01 &43de 95 95 01 &43e1 95 3d 02 &43e4 59 59 02 &43e7 4d 4d 02 &43ea 59 59 02 &43ed 91 3d 02 &43f0 61 61 02 &43f3 89 51 02 &43f6 91 61 02 &43f9 95 3d 02 &43fc 89 4d 02 &43ff 81 35 02 &4402 7d 59 02 &4405 7d 51 02 &4408 6d 6d 02 &440b 81 3d 02 &440e 6d 6d 02 &4411 61 21 02 &4414 3d 3d 02 &4417 61 31 02 &441a 3d 3d 01 &441d 65 65 01 &4420 6d 21 02 &4423 3d 3d 02 &4426 65 31 02 &4429 61 3d 02 &442c 6d 1d 02 &442f 65 3d 02 &4432 61 29 02 &4435 59 3d 02 &4438 61 21 02 &443b 81 3d 02 &443e 81 31 02 &4441 3d 3d 02 &4444 21 21 02 &4447 3d 3d 02 &444a 61 31 02 &444d 65 3d 02 &4450 75 21 02 &4453 6d 3d 02 &4456 65 31 02 &4459 61 3d 02 &445c 65 29 02 &445f 59 3d 02 &4462 51 35 02 &4465 4d 3d 02 &4468 51 21 02 &446b 3d 3d 02 &446e 31 31 02 &4471 61 3d 02 &4474 6d 1d 02 &4477 65 3d 02 &447a 59 35 02 &447d 4d 3d 02 &4480 51 21 02 &4483 3d 3d 02 &4486 31 31 02 &4489 61 3d 01 &448c 6d 6d 01 &448f 65 1d 02 &4492 59 3d 02 &4495 51 35 02 &4498 4d 3d 02 &449b 4d 21 02 &449e 3d 3d 02 &44a1 51 0d 02 &44a4 3d 3d 02 &44a7 31 21 04 &44aa 00 00 00 ; end of tune data ; unused # Unused notes, not a copy of any previous data ; p1 p2 d &44ad 65 65 01 &44b0 6d 21 02 &44b3 61 3d 02 &44b6 51 31 02 &44b9 3d 3d 02 &44bc 21 21 02 &44bf 3d 3d 02 &44c2 6d 31 02 &44c5 61 3d 02 &44c8 75 21 02 &44cb 65 45 02 &44ce 51 35 02 &44d1 45 45 02 &44d4 21 21 02 &44d7 45 45 02 &44da 75 35 02 &44dd 65 45 02 &44e0 81 21 02 &44e3 79 3d 02 &44e6 75 31 02 &44e9 6d 3d 02 &44ec 79 21 02 &44ef 75 45 02 &44f2 6d 35 02 &44f5 65 45 02 &44f8 6d 21 02 &44fb 61 3d 02 &44fe 51 31 02 &4501 3d 3d 02 &4504 21 21 02 &4507 3d 3d 02 &450a 81 1d 02 &450d 35 35 01 &4510 89 89 01 &4513 91 21 02 &4516 81 3d 02 &4519 51 31 02 &451c 3d 3d 02 &451f 21 21 02 &4522 3d 3d 02 &4525 91 31 02 &4528 81 3d 02 &452b 95 21 02 &452e 81 45 02 &4531 51 35 02 &4534 45 45 02 &4537 21 21 02 &453a 45 45 02 &453d 95 35 02 &4540 81 45 02 &4543 79 31 02 &4546 6d 51 02 &4549 3d 3d 02 &454c 79 51 02 &454f 75 35 02 &4552 65 51 02 &4555 45 45 02 &4558 75 51 02 &455b 6d 21 02 &455e 65 3d 02 &4561 61 31 02 &4564 59 3d 02 &4567 51 21 02 &456a 49 49 02 &456d 51 45 02 &4570 3d 3d 02 &4573 81 35 02 &4576 51 51 02 &4579 81 45 02 &457c 51 51 01 &457f 81 81 01 &4582 89 35 02 &4585 81 51 02 ; unused # Unused code &4588 a9 0d LDA #&0d ; Disable event &458a a2 04 LDX #&04 ; v-sync event &458c a0 00 LDY #&00 &458e 20 f4 ff JSR &fff4 ; OSBYTE &4591 a9 16 LDA #&16 # Change to MODE 7 &4593 20 ee ff JSR &ffee ; OSWRCH &4596 a9 07 LDA #&07 &4598 20 ee ff JSR &ffee ; OSWRCH &459b 20 0d 19 JSR &190d ; disable_cursor &459e a0 00 LDY #&00 &45a0 a9 00 LDA #&00 ; &7c00 = screen_memory &45a2 85 72 STA &72 ; target_address_low &45a4 a9 7c LDA #&7c &45a6 85 73 STA &73 ; target_address_high &45a8 a9 50 LDA #&50 ; &1450 = alternative_title_screen_data &45aa 85 70 STA &70 ; source_address_low &45ac a9 14 LDA #&14 &45ae 85 71 STA &71 ; source_address_high &45b0 b1 70 LDA (&70),Y ; source_address &45b2 91 72 STA (&72),Y ; target_address &45b4 18 CLC &45b5 a5 70 LDA &70 ; source_address_low &45b7 69 01 ADC #&01 &45b9 85 70 STA &70 ; source_address_low &45bb a5 71 LDA &71 ; source_address_high &45bd 69 00 ADC #&00 ; unused # Unused code &45bf a9 0d LDA #&0d ; Disable event &45c1 a2 04 LDX #&04 ; v-sync event &45c3 20 f4 ff JSR &fff4 ; OSBYTE &45c6 a9 0f LDA #&0f ; Flush all buffers &45c8 a2 00 LDX #&00 ; all buffers &45ca 20 f4 ff JSR &fff4 ; OSBYTE &45cd ea NOP &45ce ea NOP ; unused &45cf 0d ; unused # Unused code; possibly alternative title screen &45d0 a2 04 LDX #&0d ; Disable event &45d2 a0 00 LDY #&00 ; v-sync event &45d4 20 f4 ff JSR &fff4 ; OSBYTE &45d7 a9 0f LDA #&0f ; Flush input buffer &45d9 20 f4 ff JSR &fff4 ; OSBYTE &45dc a9 16 LDA #&16 # Change to MODE 7 &45de 20 ee ff JSR &ffee ; OSWRCH &45e1 a9 07 LDA #&07 &45e3 20 ee ff JSR &ffee ; OSWRCH &45e6 20 0d 19 JSR &190d ; disable_cursor &45e9 a0 00 LDY #&00 &45eb a9 00 LDA #&00 ; &7c00 = screen_memory &45ed 85 72 STA &72 ; target_address_low &45ef a9 7c LDA #&7c &45f1 85 73 STA &73 ; target_address_high &45f3 a9 50 LDA #&50 ; &1450 = alternative_title_screen_data &45f5 85 70 STA &70 ; source_address_low &45f7 a9 14 LDA #&14 &45f9 85 71 STA &71 ; source_address_high ; unused_copy_screen_loop # Would copy &1450 - &2fff to &7c00 - &97af &45fb b1 70 LDA (&70),Y ; source_address &45fd 91 72 STA (&72),Y ; target_address &45ff 18 CLC &4600 a5 70 LDA &70 ; source_address_low &4602 69 01 ADC #&01 &4604 85 70 STA &70 ; source_address_low &4606 a5 71 LDA &71 ; source_address_high &4608 69 00 ADC #&00 &460a 85 71 STA &71 ; source_address_high &460c 18 CLC &460d a5 72 LDA &72 ; target_address_low &460f 69 01 ADC #&01 &4611 85 72 STA &72 ; target_address_low &4613 a5 73 LDA &73 ; target_address_high &4615 69 00 ADC #&00 &4617 85 73 STA &73 ; target_address_high &4619 a5 71 LDA &71 ; source_address_high &461b c9 30 CMP #&30 &461d d0 dc BNE &45fb ; unused_copy_screen_loop &461f a9 1f LDA #&1f # TAB(&0b, &05) &4621 20 ee ff JSR &ffee ; OSWRCH &4624 a9 0b LDA #&0b &4626 20 ee ff JSR &ffee ; OSWRCH &4629 a9 05 LDA #&05 &462b 20 ee ff JSR &ffee ; OSWRCH &462e a9 87 LDA #&87 ; TELETEXT_WHITE &4630 20 ee ff JSR &ffee ; OSWRCH &4633 a2 00 LDX #&00 ; unused_write_wages_loop &4635 bd 3a 2f LDA &2f3a,X ; wages &4638 20 ee ff JSR &ffee ; OSWRCH &463b e8 INX &463c e0 06 CPX #&06 &463e d0 f5 BNE &4635 ; unused_write_wages_loop &4640 20 8e 21 JSR &218e &4643 20 b0 18 JSR &18b0 &4646 4c ce 13 JMP &13ce ; unused &4649 60 RTS ; unused &464a 4a e0 00 00 58 14 ; unused # Possibly unrelocated alternative_title_screen_data &4650 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; " " &4660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; ".. . ..7#4ws5ws5ws1 " &4670 20 20 20 20 20 20 20 20 91 9d 20 20 20 20 20 20 ; "..... ... . up%5 55)0up0 " &4680 9c 20 20 20 20 20 20 20 20 20 20 93 92 37 23 34 ; "..... .Last Score " &4690 77 73 35 77 73 35 77 73 31 20 20 20 20 20 20 20 &46a0 81 9d 9d 85 9d 20 94 9d 9c 20 20 20 20 20 20 20 # Teletext graphics of top of player's head and "DARE" &46b0 20 20 20 92 20 75 70 25 35 20 35 35 29 30 75 70 &46c0 30 20 20 20 20 20 20 20 81 9d 85 9d 87 20 20 20 &46d0 20 9c 4c 61 73 74 20 53 63 6f 72 65 20 20 20 20 &46e0 20 20 20 20 20 20 ; loading_screen_data &46e6 92 92 20 20 20 87 2e 20 9a 91 ff 20 35 6b 37 6a ; ".. .. ... 5k7j7#".!.#5.#5.#!. . " &46f6 37 23 22 ff 21 ff 23 35 ff 23 35 ff 23 21 87 20 ; " . ... 5j5"#. . . 5. 5#k5. .. " &4706 2e 20 20 20 20 20 20 20 20 20 96 20 20 20 20 20 ; " . . ..+?!zu`p.`.0.p5. 5pz5. . " &4716 9a 91 ff 20 35 6a 35 22 23 ff 20 ff 20 ff 20 35 ; ". . . " &4726 ff 20 35 23 6b 35 87 20 20 20 87 2e 20 20 20 20 ; " . .. SOFTWARE FACTORY . . " &4736 20 2e 20 96 20 20 20 20 9a 91 2b 3f 21 7a 75 60 ; " . . " &4746 70 ff 60 ff 30 ff 70 35 ff 20 35 70 7a 35 87 20 ; " . .*.PRESENTS.*.. .. " &4756 2e 20 20 20 20 20 20 20 96 20 9a 20 20 20 20 20 ; " . . " &4766 20 20 97 20 20 20 20 20 20 20 20 20 20 20 20 20 ; " . " &4776 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; ". .".#4.#5.#4.#! ".#4.#!. 5k7".! .. " &4786 20 20 20 20 2e 20 20 20 20 87 2e 20 53 4f 46 54 ; " . . . 5.#5.#4.#.... 5.# . 5j5 . " &4796 57 41 52 45 20 46 41 43 54 4f 52 59 20 2e 20 20 ; "... .`.p%. 5. 5.p0 `.p%.p0+?!zu`.px " &47a6 20 20 2e 20 20 20 20 20 20 20 9a 20 20 20 20 97 ; " . . " &47b6 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; " . . . ".#4.#!.#5k7j7#.. " &47c6 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; " . .. ... 5.# . 5j5"#.. . " &47d6 20 20 20 20 20 20 2e 20 20 20 20 20 20 83 2a 82 ; " . . .. .`.p%.p0. 5zu`p... .. " &47e6 50 52 45 53 45 4e 54 53 83 2a 87 2e 20 20 87 2e ; " . . .. ppppppppppppppp0 . . " &47f6 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; " . .,,,,,,,,,,,,,$ . . " &4806 20 20 2e 20 20 20 20 20 20 20 20 20 20 2e 20 20 ; " . .. .Written by Simon Pick . " &4816 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; " . . .Written by Simon Pick " &4826 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2e ; " . " &4836 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; " " &4846 20 20 20 20 20 20 20 20 9a 20 20 20 97 22 ff 23 ; " " &4856 34 ff 23 35 ff 23 34 ff 23 21 20 22 ff 23 34 ff ; " " &4866 23 21 ff 20 35 6b 37 22 ff 21 20 87 2e 20 20 20 ; " " &4876 20 20 9a 20 93 20 ff 20 35 ff 23 35 ff 23 34 ff ; " " &4886 23 87 2e 93 ff 20 35 ff 23 20 ff 20 35 6a 35 20 &4896 ff 20 20 20 20 20 20 20 9a 82 87 20 92 60 ff 70 &48a6 25 ff 20 35 ff 20 35 ff 70 30 20 60 ff 70 25 ff &48b6 70 30 2b 3f 21 7a 75 60 ff 70 78 20 20 20 20 20 &48c6 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &48d6 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &48e6 20 20 2e 20 20 20 2e 20 20 82 20 20 9a 20 20 20 &48f6 20 20 97 20 20 22 ff 23 34 ff 23 21 ff 23 35 6b &4906 37 6a 37 23 87 86 20 20 20 20 20 20 20 20 20 20 &4916 20 20 2e 20 20 9a 2e 20 20 20 20 20 9a 93 ff 20 &4926 35 ff 23 20 ff 20 35 6a 35 22 23 ff 87 20 20 2e &4936 20 20 20 20 20 20 20 20 20 82 20 20 20 9a 20 87 &4946 2e 20 20 20 92 60 ff 70 25 ff 70 30 ff 20 35 7a &4956 75 60 70 ff 86 86 20 20 20 20 87 2e 20 20 20 20 &4966 20 20 84 20 2e 20 20 20 20 20 9a 96 20 70 70 70 &4976 70 70 70 70 70 70 70 70 70 70 70 70 30 20 87 20 &4986 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4996 20 20 9a 20 20 96 2c 2c 2c 2c 2c 2c 2c 2c 2c 2c &49a6 2c 2c 2c 24 20 87 20 20 20 20 20 20 2e 20 20 20 &49b6 20 20 20 20 20 2e 20 2e 8d 20 82 57 72 69 74 74 &49c6 65 6e 20 62 79 20 53 69 6d 6f 6e 20 50 69 63 6b &49d6 20 20 20 20 20 20 2e 20 20 20 83 20 20 20 20 8d &49e6 20 20 83 57 72 69 74 74 65 6e 20 62 79 20 53 69 &49f6 6d 6f 6e 20 50 69 63 6b 20 20 20 20 20 20 20 20 &4a06 20 20 20 20 2e 20 20 20 20 20 20 20 20 20 20 20 &4a16 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4a26 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4a36 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4a46 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4a56 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4a66 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4a76 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4a86 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4a96 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4aa6 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4ab6 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4ac6 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &4ad6 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; unused &4ae6 00 ; unused # Unused code; possibly alternative main game loop &4ae7 f0 f3 BEQ &4adc &4ae9 20 6a 22 JSR &226a ; update_rotating_colour_and_enemies &4aec 20 e4 1b JSR &1be4 ; update_player &4aef 20 62 1b JSR &1b62 ; check_for_collision &4af2 20 0d 19 JSR &190d ; disable_cursor &4af5 ad 0a 0c LDA &0c0a ; player_collided &4af8 c9 00 CMP #&00 &4afa f0 d3 BEQ &4acf ; unused_main_game_loop ; unused_is_collision &4afc 20 04 1a JSR &1a04 ; kill_player &4aff ad LDA &.... Game disassembly ================ ; DDDenis3 ; 00000e00 00003475 2690 ; scrolltext &0e00 2e 2e 2e 2e 20 57 72 69 74 74 65 6e 20 62 79 20 ; ".... Written by &0e10 53 69 6d 6f 6e 20 50 69 63 6b 20 2e 2e 2e 2e 2e ; "Simon Pick ..... &0e20 2e 2e 2e 2e 2e 20 56 49 53 49 4f 4e 53 20 20 50 ; "..... VISIONS P &0e30 72 65 73 65 6e 74 73 2e 2e 2e 2e 2e 2e 2e 2e 2e ; "resents......... &0e40 2e 2e 2e 2e 44 61 72 65 20 44 65 76 69 6c 20 44 ; "....Dare Devil D &0e50 65 6e 69 73 20 2e 2e 2e ; "enis ..." ; unused &0e58 6e 6e ; highest_wages &0e5a 30 30 30 30 30 30 ; "000000" &0e60 0d ; unused &0e61 00 28 ; start_screen_text &0e63 82 &0e64 48 6f 77 20 67 6f 6f 64 20 61 72 65 20 79 6f 75 ; "How good are you" &0e74 0d &0e75 4e 6f 76 69 63 65 ; "Novice" &0e7b 0d &0e7c 45 78 70 65 72 69 65 6e 63 65 64 ; "Experienced" &0e87 0d &0e88 45 78 70 65 72 74 ; "Expert" &0e8e 0d &0e8f 4f 73 63 61 72 20 4e 6f 6d 69 6e 65 65 ; "Oscar Nominee" &0e9c 0d &0e9d 4f 73 63 61 72 20 57 69 6e 6e 65 72 ; "Oscar Winner" &0ea9 0d &0eaa 41 63 65 ; "Ace" &0ead 0d &0eae 82 ; TELETEXT_GREEN &0eaf 54 6f 20 73 74 61 72 74 20 67 61 6d 65 20 70 72 ; "To start game press" &0ebf 65 73 73 &0ec2 87 ; TELETEXT_WHITE &0ec3 41 ; "A" &0ec4 82 ; TELETEXT_GREEN &0ec5 74 6f ; "to" &0ec7 87 ; TELETEXT_WHITE &0ec8 46 ; "F" &0ec9 0d &0eca 1f 02 02 ; TAB(&02, &02) &0ecd 86 ; TELETEXT_CYAN &0ece 48 69 67 68 65 73 74 20 77 61 67 65 73 20 70 61 ; "Highest wages paid today" &0ede 69 64 20 74 6f 64 61 79 &0ee6 83 ; TELETEXT_YELLOW &0ee7 0d ; unused # Source code fragment &0ee8 3d 53 2b 39 0d ; ... =S+9 &0eed 00 50 09 ; 80 ... ; starting_levels_table # A: Novice starts on level 1 (set 1) ; A B C D E F # B: Experienced starts on level 7 (set 3) &0ef0 01 07 0d 13 19 1f # C: Expert starts on level 13 (set 5) # D: Oscar Nominee starts on level 19 (set 7) # E: Oscar Winner starts on level 25 (set 9) # F: Ace starts on level 31 (set 11) ; start_screen &0ef6 a9 0f LDA #&0f ; Flush all buffers &0ef8 a2 00 LDX #&00 ; all buffers &0efa 20 f4 ff JSR &fff4 ; OSBYTE &0efd a9 0d LDA #&0d ; Disable event &0eff a2 04 LDX #&04 ; v-sync event &0f01 20 f4 ff JSR &fff4 ; OSBYTE &0f04 a0 00 LDY #&00 &0f06 a9 dc LDA #&dc ; Read/Write ASCII for ESCAPE &0f08 a2 ff LDX #&ff # Set Escape character to &ff &0f0a 20 f4 ff JSR &fff4 ; OSBYTE &0f0d a9 16 LDA #&16 # Change to MODE 7 &0f0f 20 ee ff JSR &ffee ; OSWRCH &0f12 a9 07 LDA #&07 &0f14 20 ee ff JSR &ffee ; OSWRCH &0f17 20 0d 19 JSR &190d ; disable_cursor &0f1a a2 00 LDX #&00 &0f1c a9 1f LDA #&1f # TAB(&0a, &05) &0f1e 20 ee ff JSR &ffee ; OSWRCH &0f21 a9 0a LDA #&0a &0f23 20 ee ff JSR &ffee ; OSWRCH &0f26 a9 05 LDA #&05 &0f28 20 ee ff JSR &ffee ; OSWRCH ; write_how_good_are_you_loop &0f2b bd 63 0e LDA &0e63,X ; start_screen_text &0f2e c9 0d CMP #&0d ; CR &0f30 f0 07 BEQ &0f39 ; write_skills &0f32 20 ee ff JSR &ffee ; OSWRCH # Write "How good are you" &0f35 e8 INX &0f36 4c 2b 0f JMP &0f2b ; write_how_good_are_you_loop ; write_skills &0f39 e8 INX &0f3a a9 41 LDA #&41 ; "A" &0f3c 85 70 STA &70 ; skill_letter &0f3e a9 07 LDA #&07 &0f40 85 71 STA &71 ; skill_y ; write_skills_loop &0f42 a9 1f LDA #&1f # TAB(&0c, skill_y) &0f44 20 ee ff JSR &ffee ; OSWRCH &0f47 a9 0c LDA #&0c &0f49 20 ee ff JSR &ffee ; OSWRCH &0f4c a5 71 LDA &71 ; skill_y &0f4e 20 ee ff JSR &ffee ; OSWRCH &0f51 a9 86 LDA #&86 ; TELETEXT_CYAN &0f53 20 ee ff JSR &ffee ; OSWRCH &0f56 a5 70 LDA &70 ; skill_letter &0f58 20 ee ff JSR &ffee ; OSWRCH # Write skill letter &0f5b a9 29 LDA #&29 ; ")" &0f5d 20 ee ff JSR &ffee ; OSWRCH &0f60 a9 83 LDA #&83 ; TELETEXT_YELLOW &0f62 20 ee ff JSR &ffee ; OSWRCH ; write_skill_loop &0f65 bd 63 0e LDA &0e63,X ; start_screen_text &0f68 c9 0d CMP #&0d ; CR &0f6a f0 07 BEQ &0f73 ; consider_next_skill &0f6c 20 ee ff JSR &ffee ; OSWRCH # Write skill description &0f6f e8 INX &0f70 4c 65 0f JMP &0f65 ; write_skill_loop ; consider_next_skill &0f73 e8 INX &0f74 e6 71 INC &71 ; skill_y &0f76 e6 71 INC &71 ; skill_y &0f78 e6 70 INC &70 ; skill_letter &0f7a a5 70 LDA &70 ; skill_letter &0f7c c9 47 CMP #&47 ; "G" &0f7e d0 c2 BNE &0f42 ; write_skills_loop ; write_start_screen_text &0f80 a9 1f LDA #&1f # TAB(&04, &13) &0f82 20 ee ff JSR &ffee ; OSWRCH &0f85 a9 04 LDA #&04 &0f87 20 ee ff JSR &ffee ; OSWRCH &0f8a a9 13 LDA #&13 &0f8c 20 ee ff JSR &ffee ; OSWRCH &0f8f a9 02 LDA #&02 &0f91 85 71 STA &71 ; lines_remaining ; write_start_screen_text_loop &0f93 bd 63 0e LDA &0e63,X ; start_screen_text &0f96 c9 0d CMP #&0d ; CR &0f98 f0 07 BEQ &0fa1 ; consider_next_line &0f9a 20 ee ff JSR &ffee ; OSWRCH # Write "To start press A to F" &0f9d e8 INX # and "Highest wages paid today" &0f9e 4c 93 0f JMP &0f93 ; write_start_screen_text_loop ; consider_next_line &0fa1 e8 INX &0fa2 c6 71 DEC &71 ; lines_remaining &0fa4 d0 ed BNE &0f93 ; write_start_screen_text_loop ; check_for_new_highest_wages &0fa6 a2 00 LDX #&00 ; check_for_new_highest_wages_loop &0fa8 bd 5a 0e LDA &0e5a,X ; highest_wages &0fab dd 3a 2f CMP &2f3a,X ; wages &0fae f0 05 BEQ &0fb5 ; consider_next_digit &0fb0 90 0d BCC &0fbf ; is_new_highest_wages &0fb2 4c cc 0f JMP &0fcc ; not_new_highest_wages ; consider_next_digit &0fb5 e8 INX &0fb6 e0 06 CPX #&06 &0fb8 d0 ee BNE &0fa8 ; check_for_new_highest_wages_loop &0fba 4c cc 0f JMP &0fcc ; not_new_highest_wages ; unused &0fbd a2 00 LDX #&00 # Unused code ; is_new_highest_wages &0fbf a2 00 LDX #&00 ; set_highest_wages_loop &0fc1 bd 3a 2f LDA &2f3a,X ; wages &0fc4 9d 5a 0e STA &0e5a,X ; highest_wages &0fc7 e8 INX &0fc8 e0 06 CPX #&06 &0fca d0 f5 BNE &0fc1 ; set_highest_wages_loop ; not_new_highest_wages &0fcc a9 20 LDA #&20 ; " " &0fce 20 ee ff JSR &ffee ; OSWRCH &0fd1 a9 60 LDA #&60 ; "£" &0fd3 20 ee ff JSR &ffee ; OSWRCH &0fd6 a2 00 LDX #&00 &0fd8 a9 01 LDA #&01 &0fda 85 71 STA &71 ; suppress_leading_zeroes ; write_highest_wages_loop &0fdc bd 5a 0e LDA &0e5a,X ; highest_wages &0fdf c9 30 CMP #&30 ; "0" &0fe1 d0 0d BNE &0ff0 ; not_leading_zero &0fe3 a5 71 LDA &71 ; suppress_leading_zeroes &0fe5 c9 00 CMP #&00 &0fe7 f0 07 BEQ &0ff0 ; not_leading_zero &0fe9 e0 05 CPX #&05 &0feb f0 03 BEQ &0ff0 ; not_leading_zero &0fed 4c fa 0f JMP &0ffa ; consider_next_digit ; not_leading_zero &0ff0 a9 00 LDA #&00 &0ff2 85 71 STA &71 ; suppress_leading_zeroes &0ff4 bd 5a 0e LDA &0e5a,X ; highest_wages &0ff7 20 ee ff JSR &ffee ; OSWRCH # Write highest wages ; consider_next_digit &0ffa e8 INX &0ffb e0 06 CPX #&06 &0ffd d0 dd BNE &0fdc ; write_highest_wages_loop &0fff a2 00 LDX #&00 &1001 a9 07 LDA #&07 &1003 85 73 STA &73 ; start_screen_y &1005 a9 00 LDA #&00 &1007 85 71 STA &71 ; start_screen_colour_one &1009 a9 07 LDA #&07 &100b 85 72 STA &72 ; start_screen_colour_two &100d a9 04 LDA #&04 &100f 85 77 STA &77 ; scrolltext_cooldown ; start_screen_loop &1011 a9 81 LDA #&81 ; Wait for input character &1013 a2 02 LDX #&02 &1015 a0 00 LDY #&00 &1017 20 f4 ff JSR &fff4 ; OSBYTE &101a 8a TXA &101b 38 SEC &101c e9 41 SBC #&41 ; "A" &101e 85 70 STA &70 ; skill &1020 4c 55 10 JMP &1055 ; skip_updating_bottom_colour ; unused # Unused code; would rotate colours in "To start press A to F" &1023 a6 71 LDX &71 ; start_screen_colour_one &1025 a9 1f LDA #&1f # TAB(&19, &13) &1027 20 ee ff JSR &ffee ; OSWRCH &102a a9 19 LDA #&19 # Bug: should be LDA #&18 to set colour for "A" &102c 20 ee ff JSR &ffee ; OSWRCH &102f a9 13 LDA #&13 &1031 20 ee ff JSR &ffee ; OSWRCH &1034 bd df 2e LDA &2edf,X ; start_screen_colours_table &1037 69 80 ADC #&80 ; TELETEXT_TEXT_COLOUR &1039 20 ee ff JSR &ffee ; OSWRCH &103c a6 72 LDX &72 ; start_screen_colour_two &103e a9 1f LDA #&1f # TAB(&1e, &13) &1040 20 ee ff JSR &ffee ; OSWRCH &1043 a9 1e LDA #&1e # Bug: should be LDA #&1d to set colour for "F" &1045 20 ee ff JSR &ffee ; OSWRCH &1048 a9 13 LDA #&13 &104a 20 ee ff JSR &ffee ; OSWRCH &104d bd df 2e LDA &2edf,X ; start_screen_colours_table &1050 69 80 ADC #&80 ; TELETEXT_TEXT_COLOUR &1052 20 ee ff JSR &ffee ; OSWRCH ; skip_updating_bottom_colour &1055 a6 71 LDX &71 ; start_screen_colour_one &1057 a9 1f LDA #&1f # TAB(&0c, start_screen_y) &1059 20 ee ff JSR &ffee ; OSWRCH &105c a9 0c LDA #&0c &105e 20 ee ff JSR &ffee ; OSWRCH &1061 a5 73 LDA &73 ; start_screen_y &1063 20 ee ff JSR &ffee ; OSWRCH &1066 bd df 2e LDA &2edf,X ; start_screen_colours_table &1069 69 80 ADC #&80 ; TELETEXT_TEXT_COLOUR &106b 20 ee ff JSR &ffee ; OSWRCH &106e e6 71 INC &71 ; start_screen_colour_one &1070 a5 71 LDA &71 ; start_screen_colour_one &1072 c9 0b CMP #&0b &1074 d0 04 BNE &107a ; skip_wraparound_one &1076 a9 00 LDA #&00 &1078 85 71 STA &71 ; start_screen_colour_one ; skip_wraparound_one &107a e6 72 INC &72 ; start_screen_colour_two &107c a5 72 LDA &72 ; start_screen_colour_two &107e c9 0b CMP #&0b &1080 d0 10 BNE &1092 ; skip_wraparound_two &1082 a9 00 LDA #&00 &1084 85 72 STA &72 ; start_screen_colour_two &1086 e6 73 INC &73 ; start_screen_y &1088 a5 73 LDA &73 ; start_screen_y &108a c9 13 CMP #&13 &108c d0 04 BNE &1092 ; skip_wraparound_two &108e a9 07 LDA #&07 &1090 85 73 STA &73 ; start_screen_y ; skip_wraparound_two &1092 c6 77 DEC &77 ; scrolltext_cooldown &1094 d0 3e BNE &10d4 ; skip_updating_scrolltext ; update_scrolltext &1096 a9 07 LDA #&07 &1098 85 77 STA &77 ; scrolltext_cooldown &109a a9 1f LDA #&1f # TAB(&00, &16) &109c 20 ee ff JSR &ffee ; OSWRCH &109f a9 00 LDA #&00 &10a1 20 ee ff JSR &ffee ; OSWRCH &10a4 a9 16 LDA #&16 &10a6 20 ee ff JSR &ffee ; OSWRCH &10a9 a9 86 LDA #&86 ; TELETEXT_CYAN &10ab 20 ee ff JSR &ffee ; OSWRCH &10ae a2 00 LDX #&00 ; write_scrolltext_loop &10b0 bd 00 0e LDA &0e00,X ; scrolltext &10b3 20 ee ff JSR &ffee ; OSWRCH # Write scrolltext &10b6 e8 INX &10b7 e0 26 CPX #&26 &10b9 d0 f5 BNE &10b0 ; write_scrolltext_loop ; rotate_scrolltext &10bb ad 00 0e LDA &0e00 ; scrolltext &10be 85 74 STA &74 ; first_character &10c0 a2 00 LDX #&00 ; rotate_scrolltext_loop &10c2 e8 INX &10c3 bd 00 0e LDA &0e00,X ; scrolltext &10c6 ca DEX &10c7 9d 00 0e STA &0e00,X ; scrolltext &10ca e8 INX &10cb e0 56 CPX #&56 &10cd d0 f3 BNE &10c2 ; rotate_scrolltext_loop &10cf a5 74 LDA &74 ; first_character &10d1 9d 00 0e STA &0e00,X ; scrolltext ; skip_updating_scrolltext &10d4 a5 70 LDA &70 ; skill &10d6 c9 06 CMP #&06 &10d8 90 03 BCC &10dd ; start_game &10da 4c 11 10 JMP &1011 ; start_screen_loop ; start_game &10dd a6 70 LDX &70 ; skill &10df bd f0 0e LDA &0ef0,X ; starting_levels_table &10e2 85 70 STA &70 ; starting_level &10e4 a2 00 LDX #&00 &10e6 a9 30 LDA #&30 ; "0" ; initialise_wages_loop &10e8 9d 3a 2f STA &2f3a,X ; wages &10eb e8 INX &10ec e0 06 CPX #&06 &10ee d0 f8 BNE &10e8 ; initialise_wages_loop &10f0 a9 01 LDA #&01 &10f2 8d 1c 18 STA &181c ; next_gold_position_offset &10f5 a5 70 LDA &70 ; starting_level &10f7 8d e3 2f STA &2fe3 ; level &10fa a9 ff LDA #&ff &10fc 8d 1b 18 STA &181b ; gold_state # Set to &ff to indicate gold not falling &10ff a9 4c LDA #&4c &1101 8d 4b 17 STA &174b ; helicopter_x &1104 a9 ca LDA #&ca &1106 8d 4c 17 STA &174c ; helicopter_y &1109 a9 80 LDA #&80 &110b 8d 6f 16 STA &166f ; spider_direction # Set to &80 to indicate spider moving down &110e a9 01 LDA #&01 &1110 8d 70 16 STA &1670 ; spider_y &1113 a9 01 LDA #&01 &1115 8d 09 0c STA &0c09 ; player_can_brake # Set to &01 to indicate player can brake &1118 20 2c 19 JSR &192c ; play_tune &111b 20 b9 14 JSR &14b9 ; play_game &111e 4c f6 0e JMP &0ef6 ; start_screen ; unused &1121 60 RTS ; update_gold &1122 ad 1b 18 LDA &181b ; gold_state # &ff if gold not falling &1125 c9 ff CMP #&ff &1127 f0 03 BEQ &112c ; consider_dropping_gold &1129 4c b1 11 JMP &11b1 ; update_falling_gold ; consider_dropping_gold &112c ad 4b 17 LDA &174b ; helicopter_x &112f ae 1c 18 LDX &181c ; next_gold_position_offset &1132 dd b6 2e CMP &2eb6,X ; x_positions_table # Is the helicopter where the next gold is due? &1135 f0 01 BEQ &1138 ; drop_gold &1137 60 RTS ; drop_gold &1138 ad 4c 17 LDA &174c ; helicopter_y &113b 8d 1a 18 STA &181a ; gold_y &113e 8d e1 2f STA &2fe1 ; screen_y &1141 18 CLC &1142 ad 4b 17 LDA &174b ; helicopter_x &1145 69 04 ADC #&04 &1147 8d 19 18 STA &1819 ; gold_x &114a 8d e0 2f STA &2fe0 ; screen_x &114d 18 CLC &114e ad e1 2f LDA &2fe1 ; screen_y &1151 69 20 ADC #&20 # Consider surface of ground underneath helicopter &1153 8d e1 2f STA &2fe1 ; screen_y &1156 18 CLC &1157 ad e0 2f LDA &2fe0 ; screen_x &115a 69 02 ADC #&02 &115c 8d e0 2f STA &2fe0 ; screen_x &115f 20 42 26 JSR &2642 ; calculate_screen_address &1162 ac e2 2f LDY &2fe2 ; row_in_group &1165 b1 70 LDA (&70),Y ; screen_address &1167 c9 00 CMP #&00 # Is there anything there? &1169 d0 31 BNE &119c ; skip_dropping_gold # If so, don't drop gold &116b ad 4c 17 LDA &174c ; helicopter_y &116e c9 5f CMP #&5f # Is the helicopter on the second ground, where there &1170 f0 2a BEQ &119c ; skip_dropping_gold # is a horizontal enemy? If so, don't drop gold &1172 ad 4c 17 LDA &174c ; helicopter_y &1175 8d 1a 18 STA &181a ; gold_y &1178 8d e1 2f STA &2fe1 ; screen_y &117b 18 CLC &117c ad 4b 17 LDA &174b ; helicopter_x &117f 69 06 ADC #&06 &1181 8d e0 2f STA &2fe0 ; screen_x &1184 18 CLC &1185 ad 4c 17 LDA &174c ; helicopter_y &1188 69 21 ADC #&21 # Consider ground underneath helicopter &118a 8d e1 2f STA &2fe1 ; screen_y &118d 20 42 26 JSR &2642 ; calculate_screen_address &1190 ac e2 2f LDY &2fe2 ; row_in_group &1193 b1 70 LDA (&70),Y ; screen_address &1195 c9 00 CMP #&00 # Is there a hole there? &1197 f0 03 BEQ &119c ; is_hole # If so, don't drop gold &1199 4c a2 11 JMP &11a2 ; is_ground ; is_hole &119c a9 ff LDA #&ff &119e 8d 1b 18 STA &181b ; gold_state # Set to &ff to indicate gold not falling &11a1 60 RTS ; is_ground &11a2 ad 4b 17 LDA &174b ; helicopter_x &11a5 18 CLC &11a6 69 04 ADC #&04 &11a8 8d 19 18 STA &1819 ; gold_x &11ab ad 4c 17 LDA &174c ; helicopter_y &11ae 8d 1a 18 STA &181a ; gold_y ; update_falling_gold &11b1 ad 19 18 LDA &1819 ; gold_x &11b4 8d e0 2f STA &2fe0 ; screen_x &11b7 ad 1a 18 LDA &181a ; gold_y &11ba 8d e1 2f STA &2fe1 ; screen_y &11bd 20 42 26 JSR &2642 ; calculate_screen_address &11c0 a9 90 LDA #&90 ; &1790 = sprite_gold &11c2 85 72 STA &72 ; sprite_address_low &11c4 a9 17 LDA #&17 &11c6 85 73 STA &73 ; sprite_address_high &11c8 20 b0 26 JSR &26b0 ; plot_sprite # Plot gold &11cb ee 1a 18 INC &181a ; gold_y &11ce ee 1b 18 INC &181b ; gold_state &11d1 ad 1b 18 LDA &181b ; gold_state &11d4 c9 11 CMP #&11 &11d6 d0 14 BNE &11ec ; not_on_ground &11d8 a9 ff LDA #&ff &11da 8d 1b 18 STA &181b ; gold_state # Set to &ff to indicate gold not falling &11dd ee 1c 18 INC &181c ; next_gold_position_offset &11e0 ad 1c 18 LDA &181c ; next_gold_position_offset &11e3 c9 28 CMP #&28 &11e5 d0 05 BNE &11ec ; skip_wraparound &11e7 a9 01 LDA #&01 &11e9 8d 1c 18 STA &181c ; next_gold_position_offset ; skip_wraparound ; not_on_ground &11ec 60 RTS ; unused &11ed 73 74 61 72 74 20 67 61 6d 65 20 63 68 6f 6f 73 ; "start game choose" &11fd 65 &11fe 87 ; TELETEXT_WHITE &11ff 41 ; "A" &1200 82 ; TELETEXT_GREEN &1201 74 6f ; "to" &1203 87 ; TELETEXT_WHITE &1204 46 ; "F" &1205 0d &1206 1f 00 02 ; TAB(&00, &02) &1209 86 ; TELETEXT_CYAN &120a 48 69 67 68 65 73 74 20 77 61 67 65 73 20 70 61 ; "Highest wages paid today " &121a 69 64 20 74 6f 64 61 79 20 &1223 0d ; unused # Source code fragment &1224 58 3a 4a 4d 50 20 4c 39 ; ... X:JMP L9 ... ; unused # &122c - 71231 is a copy of &0ef0 - &0ef5 &122c 01 07 0d 13 19 1f ; unused_start_screen # &1232 - &137c is similar to &0f04 - &1121, &1232 a0 00 LDY #&00 # start_screen, but omits colour changes and scrolltext &1234 a9 dc LDA #&dc ; Read/Write ASCII for ESCAPE &1236 a2 ff LDX #&ff # Set Escape character to &ff &1238 20 f4 ff JSR &fff4 ; OSBYTE &123b a9 16 LDA #&16 &123d 20 ee ff JSR &ffee ; OSWRCH &1240 a9 07 LDA #&07 &1242 20 ee ff JSR &ffee ; OSWRCH &1245 20 0d 19 JSR &190d ; disable_cursor &1248 a2 00 LDX #&00 &124a a9 1f LDA #&1f &124c 20 ee ff JSR &ffee ; OSWRCH &124f a9 00 LDA #&00 # &0f21 a9 0a LDA #&0a &1251 20 ee ff JSR &ffee ; OSWRCH &1254 a9 05 LDA #&05 &1256 20 ee ff JSR &ffee ; OSWRCH ; unused_write_how_good_are_you_loop &1259 bd 9d 11 LDA &119d,X # &0f2b bd 63 0e LDA &0e63,X ; start_screen_text &125c c9 0d CMP #&0d ; CR &125e f0 07 BEQ &1267 ; unused_write_skills &1260 20 ee ff JSR &ffee ; OSWRCH &1263 e8 INX &1264 4c 59 12 JMP &1259 ; unused_write_how_good_are_you_loop ; unused_write_skills &1267 e8 INX &1268 a9 41 LDA #&41 ; "A" &126a 85 70 STA &70 ; skill_letter &126c a9 07 LDA #&07 &126e 85 71 STA &71 ; skill_y ; unused_write_skills_loop &1270 a9 1f LDA #&1f &1272 20 ee ff JSR &ffee ; OSWRCH &1275 a9 0c LDA #&0c &1277 20 ee ff JSR &ffee ; OSWRCH &127a a5 71 LDA &71 ; skill_y &127c 20 ee ff JSR &ffee ; OSWRCH ; # &0f51 a9 86 LDA #&86 ; TELETEXT_CYAN ; # &0f53 20 ee ff JSR &ffee ; OSWRCH &127f a5 70 LDA &70 ; skill_letter &1281 20 ee ff JSR &ffee ; OSWRCH &1284 a9 29 LDA #&29 "; ")" &1286 20 ee ff JSR &ffee ; OSWRCH &1289 a9 83 LDA #&83 ; TELETEXT_YELLOW &128b 20 ee ff JSR &ffee ; OSWRCH ; unused_write_skill_loop &128e bd 9d 11 LDA &119d,X # &0f65 bd 63 0e LDA &0e63,X ; start_screen_text &1291 c9 0d CMP #&0d ; CR &1293 f0 07 BEQ &129c ; unused_consider_next_skill &1295 20 ee ff JSR &ffee ; OSWRCH &1298 e8 INX &1299 4c 8e 12 JMP &128e ; unused_write_skill_loop ; unused_consider_next_skill &129c e8 INX &129d e6 71 INC &71 ; skill_y &129f e6 71 INC &71 ; skill_y &12a1 e6 70 INC &70 ; skill_letter &12a3 a5 70 LDA &70 ; skill_letter &12a5 c9 47 CMP #&47 ; "G" &12a7 d0 c7 BNE &1270 ; unused_write_skills_loop ; unused_write_start_screen_text &12a9 a9 1f LDA #&1f &12ab 20 ee ff JSR &ffee ; OSWRCH &12ae a9 00 LDA #&00 # &0f85 a9 04 LDA #&04 &12b0 20 ee ff JSR &ffee ; OSWRCH &12b3 a9 13 LDA #&13 &12b5 20 ee ff JSR &ffee ; OSWRCH &12b8 a9 02 LDA #&02 &12ba 85 71 STA &71 ; lines_remaining ; unused_write_start_screen_text_loop &12bc bd 9d 11 LDA &119d,X # &0f93 bd 63 0e LDA &0e63,X ; start_screen_text &12bf c9 0d CMP #&0d ; CR &12c1 f0 07 BEQ &12ca ; unused_consider_next_line &12c3 20 ee ff JSR &ffee ; OSWRCH &12c6 e8 INX &12c7 4c bc 12 JMP &12bc ; unused_write_start_screen_text_loop ; unused_consider_next_line &12ca e8 INX &12cb c6 71 DEC &71 ; lines_remaining &12cd d0 ed BNE &12bc ; unused_write_start_screen_text_loop ; unused_check_for_new_highest_wages &12cf a2 00 LDX #&00 ; unused_check_for_new_highest_wages_loop &12d1 bd 94 11 LDA &1194,X # &0fa8 bd 5a 0e LDA &0e5a,X ; highest_wages &12d4 dd 3a 2f CMP &2f3a,X ; wages &12d7 f0 02 BEQ &12db ; unused_consider_next_digit &12d9 90 0a BCC &12e5 ; unused_is_new_highest_wages ; # &0fb2 4c cc 0f JMP &0fcc ; not_new_highest_wages ; unused_consider_next_digit &12db e8 INX &12dc e0 06 CPX #&06 &12de d0 f1 BNE &12d1 ; unused_check_for_new_highest_wages_loop &12e0 4c f0 12 JMP &12f0 ; unused_not_new_highest_wages ; unused &12e3 a2 00 LDX #&00 # Unused even in the unused code! ; unused_is_new_highest_wages ; # &0fbf a2 00 LDX #&00 ; unused_set_highest_wages_loop &12e5 bd 3a 2f LDA &2f3a,X ; wages &12e8 9d 94 11 STA &1194,X # &0fc4 9d 5a 0e STA &0e5a,X ; highest_wages &12eb e8 INX &12ec e0 06 CPX #&06 &12ee d0 f5 BNE &12e5 ; unused_set_highest_wages_loop ; unused_not_new_highest_wages &12f0 a9 20 LDA #&20 ; " " &12f2 20 ee ff JSR &ffee ; OSWRCH &12f5 a9 60 LDA #&60 ; "£" &12f7 20 ee ff JSR &ffee ; OSWRCH &12fa a2 00 LDX #&00 &12fc a9 01 LDA #&01 &12fe 85 71 STA &71 ; suppress_leading_zeroes ; unused_write_highest_wages_loop &1300 bd 94 11 LDA &1194,X # &0fdc bd 5a 0e LDA &0e5a,X ; highest_wages &1303 c9 30 CMP #&30 ; "0" &1305 d0 0d BNE &1314 ; unused_not_leading_zero &1307 a5 71 LDA &71 ; suppress_leading_zeroes &1309 c9 00 CMP #&00 &130b f0 07 BEQ &1314 ; unused_not_leading_zero &130d e0 05 CPX #&05 &130f f0 03 BEQ &1314 ; unused_not_leading_zero &1311 4c 1e 13 JMP &131e ; unused_consider_next_digit ; unused_not_leading_zero &1314 a9 00 LDA #&00 &1316 85 71 STA &71 ; suppress_leading_zeroes &1318 bd 94 11 LDA &1194,X # &0ff4 bd 5a 0e LDA &0e5a,X ; highest_wages &131b 20 ee ff JSR &ffee ; OSWRCH ; unused_consider_next_digit &131e e8 INX &131f e0 06 CPX #&06 &1321 d0 dd BNE &1300 ; unused_write_highest_wages_loop ; # &0fff - &100f is omitted ; unused_start_screen_loop &1323 a9 81 LDA #&81 ; Wait for input character &1325 a2 ff LDX #&ff # &1013 a2 02 LDX #&02 &1327 a0 78 LDY #&78 # &1015 a0 00 LDY #&00 &1329 20 f4 ff JSR &fff4 ; OSBYTE &132c 8a TXA &132d 38 SEC &132e e9 41 SBC #&41 ; "A" &1330 85 70 STA &70 ; skill ; # &1020 - &10d4 is omitted &1332 a5 70 LDA &70 ; skill &1334 c9 06 CMP #&06 &1336 b0 eb BCS &1323 ; unused_start_screen_loop # &10d8 90 03 BCC &10dd ; start_game ; # &10da 4c 11 10 JMP &1011 ; start_screen_loop ; unused_start_game &1338 a6 70 LDX &70 ; skill &133a bd 2c 12 LDA &122c,X # &10df bd f0 0e LDA &0ef0,X ; starting_levels_table &133d 85 70 STA &70 ; starting_level &133f a2 00 LDX #&00 &1341 a9 30 LDA #&30 ; "0" ; unused_initialise_wages_loop &1343 9d 3a 2f STA &2f3a,X ; wages &1346 e8 INX &1347 e0 06 CPX #&06 &1349 d0 f8 BNE &1343 ; unused_initialise_wages_loop &134b a9 01 LDA #&01 &134d 8d 1c 18 STA &181c ; next_gold_position_offset &1350 a5 70 LDA &70 ; starting_level &1352 8d e3 2f STA &2fe3 ; level &1355 a9 ff LDA #&ff &1357 8d 1b 18 STA &181b ; gold_state &135a a9 4c LDA #&4c &135c 8d 4b 17 STA &174b ; helicopter_x &135f a9 ca LDA #&ca &1361 8d 4c 17 STA &174c ; helicopter_y &1364 a9 80 LDA #&80 &1366 8d 6f 16 STA &166f ; spider_direction &1369 a9 01 LDA #&01 &136b 8d 70 16 STA &1670 ; spider_y &136e a9 01 LDA #&01 &1370 8d 09 0c STA &0c09 ; player_can_brake &1373 20 2c 19 JSR &192c ; play_tune &1376 20 b9 14 JSR &14b9 ; play_game &1379 4c 32 12 JMP &1232 ; unused_start_screen ; unused &137c 60 RTS ; unused &137d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &138d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &139d 00 00 00 00 00 00 00 00 00 00 00 60 00 00 00 00 &13ad 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &13bd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &13cd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &13dd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &13ed 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &13fd 00 00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 &140d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &141d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &142d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &143d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &144d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &145d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &146d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &147d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &148d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &149d 00 00 00 00 00 00 00 00 ; you_are_fired_string &14a5 14 ; restore default logical colours &14a6 1f 03 11 ; TAB(&03, &11) &14a9 11 08 ; COLOUR 8 &14ab 59 4f 55 20 41 52 45 20 46 49 52 45 44 ; "YOU ARE FIRED" &14b8 0d ; play_game &14b9 a9 01 LDA #&01 &14bb 8d 15 0c STA &0c15 ; take &14be a9 ff LDA #&ff &14c0 8d 50 0c STA &0c50 ; previous_level &14c3 a9 cf LDA #&cf &14c5 8d 4c 17 STA &174c ; helicopter_y &14c8 a9 4c LDA #&4c &14ca 8d 4b 17 STA &174b ; helicopter_x &14cd a9 01 LDA #&01 &14cf 8d 1c 18 STA &181c ; next_gold_position_offset &14d2 a9 ff LDA #&ff &14d4 8d 1b 18 STA &181b ; gold_state # Set to &ff to indicate gold not falling &14d7 a9 80 LDA #&80 &14d9 8d 6f 16 STA &166f ; spider_direction # Set to &80 to indicate spider moving down &14dc a9 01 LDA #&01 &14de 8d 70 16 STA &1670 ; spider_y &14e1 20 a2 20 JSR &20a2 ; clapperboard_screen ; new_take &14e4 20 92 23 JSR &2392 ; initialise_level &14e7 a9 08 LDA #&08 &14e9 8d e0 2f STA &2fe0 ; screen_x &14ec a9 38 LDA #&38 &14ee 8d e1 2f STA &2fe1 ; screen_y &14f1 a9 5a LDA #&5a ; &275a = sprite_blank &14f3 85 72 STA &72 ; sprite_address_low &14f5 a9 27 LDA #&27 &14f7 85 73 STA &73 ; sprite_address_high &14f9 20 42 26 JSR &2642 ; calculate_screen_address &14fc 20 b0 26 JSR &26b0 ; plot_sprite # Clear any obstacle immediately in front of player &14ff 20 4a 1f JSR &1f4a ; clear_paths_of_enemies &1502 20 b8 1f JSR &1fb8 ; consider_plotting_holes &1505 20 0d 19 JSR &190d ; disable_cursor ; main_game_loop &1508 20 6a 22 JSR &226a ; update_rotating_colour_and_enemies &150b 20 1d 18 JSR &181d ; update_helicopter &150e 20 71 16 JSR &1671 ; update_spider &1511 20 e4 1b JSR &1be4 ; update_player &1514 ad dc 2f LDA &2fdc ; right_edge &1517 c9 1f CMP #&1f ; YW &1519 d0 03 BNE &151e ; skip_collecting_gold # Is the player touching gold? &151b 20 c9 16 JSR &16c9 ; collect_gold ; skip_collecting_gold &151e 18 CLC &151f ad 10 0c LDA &0c10 ; player_x &1522 69 04 ADC #&04 &1524 8d e0 2f STA &2fe0 ; screen_x &1527 38 SEC &1528 ae 12 0c LDX &0c12 ; player_jump_state &152b ad 11 0c LDA &0c11 ; player_ground_y &152e fd ed 2e SBC &2eed,X ; jump_offsets_table &1531 8d e1 2f STA &2fe1 ; screen_y &1534 18 CLC &1535 ad e1 2f LDA &2fe1 ; screen_y &1538 69 08 ADC #&08 &153a 8d e1 2f STA &2fe1 ; screen_y &153d 20 42 26 JSR &2642 ; calculate_screen_address &1540 ac e2 2f LDY &2fe2 ; row_in_group &1543 b1 70 LDA (&70),Y ; screen_address # Check for collision at middle right &1545 c9 00 CMP #&00 &1547 d0 07 BNE &1550 ; is_collision &1549 20 62 1b JSR &1b62 ; check_for_collision # Returns non-zero if collision &154c c9 00 CMP #&00 &154e f0 b8 BEQ &1508 ; main_game_loop ; is_collision &1550 20 04 1a JSR &1a04 ; kill_player &1553 a9 cf LDA #&cf &1555 8d 4c 17 STA &174c ; helicopter_y &1558 a9 4c LDA #&4c &155a 8d 4b 17 STA &174b ; helicopter_x &155d a9 ff LDA #&ff &155f 8d 1b 18 STA &181b ; gold_state # Set to &ff to indicate gold not falling &1562 ad 15 0c LDA &0c15 ; take &1565 c9 04 CMP #&04 &1567 f0 0b BEQ &1574 ; game_over &1569 20 a2 20 JSR &20a2 ; clapperboard_screen &156c a9 01 LDA #&01 &156e 8d 09 0c STA &0c09 ; player_can_brake # Set to &01 to indicate player can brake &1571 4c e4 14 JMP &14e4 ; new_take ; game_over &1574 a2 00 LDX #&00 ; write_you_are_fired_loop &1576 bd a5 14 LDA &14a5,X ; you_are_fired_string &1579 20 ee ff JSR &ffee ; OSWRCH &157c e8 INX &157d e0 13 CPX #&13 &157f d0 f5 BNE &1576 ; write_you_are_fired_loop &1581 a9 00 LDA #&00 &1583 8d 30 0c STA &0c30 ; game_over_count ; game_over_loop &1586 20 6a 22 JSR &226a ; update_rotating_colour_and_enemies &1589 20 71 16 JSR &1671 ; update_spider &158c ee 30 0c INC &0c30 ; game_over_count &158f ad 30 0c LDA &0c30 ; game_over_count &1592 c9 3c CMP #&3c &1594 d0 f0 BNE &1586 ; game_over_loop &1596 60 RTS ; consider_gaining_extra_take # Called with A = level ground colour &1597 8d 30 0c STA &0c30 ; level_ground_colour &159a a9 80 LDA #&80 # COLOUR 128 + 0 &159c 20 ee ff JSR &ffee ; OSWRCH # First byte was written at &2427 &159f 20 0d 19 JSR &190d ; disable_cursor &15a2 a9 11 LDA #&11 ; COLOUR &15a4 20 ee ff JSR &ffee ; OSWRCH # Second byte will be written at &2464 &15a7 ad e3 2f LDA &2fe3 ; level &15aa c9 01 CMP #&01 &15ac f0 61 BEQ &160f ; skip_gaining_extra_take &15ae ad ed 2f LDA &2fed ; level_type &15b1 c9 01 CMP #&01 &15b3 d0 5a BNE &160f ; skip_gaining_extra_take &15b5 ad 50 0c LDA &0c50 ; previous_level &15b8 cd e3 2f CMP &2fe3 ; level &15bb f0 52 BEQ &160f ; skip_gaining_extra_take # Is this a new set of levels? &15bd ad e3 2f LDA &2fe3 ; level &15c0 8d 50 0c STA &0c50 ; previous_level &15c3 ad 15 0c LDA &0c15 ; take &15c6 c9 01 CMP #&01 &15c8 f0 45 BEQ &160f ; skip_gaining_extra_take # If so, and not already on take one, ; gain_extra_take &15ca ce 15 0c DEC &0c15 ; take # Gain extra take &15cd a9 12 LDA #&12 # Play immediately on channel 2 &15cf 8d 30 0c STA &0c30 ; sound_block + 0 (channel) # Bug: this overwrites level_ground_colour, but &15d2 a9 00 LDA #&00 # COLOUR &12 is green, which works for land level &15d4 8d 31 0c STA &0c31 ; sound_block + 1 (channel high) &15d7 a9 03 LDA #&03 &15d9 8d 32 0c STA &0c32 ; sound_block + 2 (volume) &15dc a9 00 LDA #&00 &15de 8d 33 0c STA &0c33 ; sound_block + 3 (volume high) &15e1 a9 30 LDA #&30 &15e3 8d 34 0c STA &0c34 ; sound_block + 4 (pitch) &15e6 a9 00 LDA #&00 &15e8 8d 35 0c STA &0c35 ; sound_block + 5 (pitch high) &15eb a9 01 LDA #&01 &15ed 8d 36 0c STA &0c36 ; sound_block + 6 (duration) &15f0 a9 00 LDA #&00 &15f2 8d 37 0c STA &0c37 ; sound_block + 7 (duration high) &15f5 a2 30 LDX #&30 ; &0c30 = sound_block &15f7 a0 0c LDY #&0c &15f9 a9 07 LDA #&07 ; Generate a sound &15fb 20 f1 ff JSR &fff1 ; OSWORD # Play sound for gaining extra take &15fe a9 00 LDA #&00 &1600 85 70 STA &70 ; count ; gain_extra_take_delay_loop &1602 a9 13 LDA #&13 ; Wait for vertical retrace &1604 20 f4 ff JSR &fff4 ; OSBYTE &1607 e6 70 INC &70 ; count &1609 a5 70 LDA &70 ; count &160b c9 2c CMP #&2c ; 44 &160d d0 f3 BNE &1602 ; gain_extra_take_delay_loop ; skip_gaining_extra_take &160f a9 01 LDA #&01 &1611 8d 70 16 STA &1670 ; spider_y &1614 a9 80 LDA #&80 &1616 8d 6f 16 STA &166f ; spider_direction # Set to &80 to indicate spider moving down &1619 ad 30 0c LDA &0c30 ; level_ground_colour &161c 60 RTS # Leave with A = level ground colour ; unused &161d 00 00 00 4f 00 8d 00 00 83 00 00 00 ; sprite_spider &1629 00 05 00 00 00 05 00 00 00 05 00 00 00 05 00 00 &1639 00 05 00 00 00 03 02 00 01 03 03 00 03 03 03 02 &1649 07 0b 0f 02 47 a1 da 02 03 03 03 02 01 03 03 00 &1659 14 14 14 00 28 28 28 28 28 28 28 28 00 00 00 00 ; unused &1669 00 8d 00 6f 6c 64 ; spider_direction &166f 80 ; spider_y &1670 01 ; update_spider &1671 ad e3 2f LDA &2fe3 ; level &1674 c9 04 CMP #&04 &1676 90 01 BCC &1679 ; is_present # Spider only on first set of levels &1678 60 RTS ; is_present &1679 ad 6f 16 LDA &166f ; spider_direction # &00 if moving up, &80 if moving down &167c c9 80 CMP #&80 &167e d0 12 BNE &1692 ; is_moving_up ; is_moving_down &1680 ee 70 16 INC &1670 ; spider_y # Move spider down &1683 ad 70 16 LDA &1670 ; spider_y &1686 c9 1a CMP #&1a &1688 d0 17 BNE &16a1 ; replot_spider &168a a9 00 LDA #&00 &168c 8d 6f 16 STA &166f ; spider_direction # Set to &00 to indicate spider moving up &168f 4c a1 16 JMP &16a1 ; replot_spider ; is_moving_up &1692 ce 70 16 DEC &1670 ; spider_y # Move spider up &1695 ad 70 16 LDA &1670 ; spider_y &1698 c9 01 CMP #&01 &169a d0 05 BNE &16a1 ; replot_spider &169c a9 80 LDA #&80 &169e 8d 6f 16 STA &166f ; spider_direction # Set to &80 to indicate spider moving down ; replot_spider &16a1 a9 29 LDA #&29 ; &1629 = sprite_spider &16a3 85 72 STA &72 ; sprite_address_low &16a5 a9 16 LDA #&16 &16a7 85 73 STA &73 ; sprite_address_high &16a9 a9 28 LDA #&28 &16ab 8d e0 2f STA &2fe0 ; screen_x &16ae a9 bb LDA #&bb # Fourth ground &16b0 8d e1 2f STA &2fe1 ; screen_y &16b3 18 CLC &16b4 ad e1 2f LDA &2fe1 ; screen_y &16b7 6d 70 16 ADC &1670 ; spider_y &16ba 8d e1 2f STA &2fe1 ; screen_y &16bd 20 42 26 JSR &2642 ; calculate_screen_address &16c0 20 b0 26 JSR &26b0 ; plot_sprite # Plot spider &16c3 60 RTS ; unused &16c4 00 00 d0 16 31 ; collect_gold &16c9 ad 10 0c LDA &0c10 ; player_x &16cc 8d e0 2f STA &2fe0 ; screen_x &16cf 38 SEC &16d0 ad 11 0c LDA &0c11 ; player_ground_y &16d3 e9 20 SBC #&20 &16d5 8d e1 2f STA &2fe1 ; screen_y &16d8 a9 d5 LDA #&d5 ; &17d5 = sprite_eighty &16da 85 72 STA &72 ; sprite_address_low &16dc a9 17 LDA #&17 &16de 85 73 STA &73 ; sprite_address_high &16e0 20 42 26 JSR &2642 ; calculate_screen_address &16e3 20 b0 26 JSR &26b0 ; plot_sprite # Plot 80 &16e6 a9 08 LDA #&08 &16e8 85 70 STA &70 ; count ; add_eighty_to_wages_loop &16ea 20 1a 22 JSR &221a ; add_to_wages # Earn 80 (10 * 8) for collecting gold &16ed c6 70 DEC &70 ; count &16ef d0 f9 BNE &16ea ; add_eighty_to_wages_loop &16f1 a9 5a LDA #&5a ; &275a = sprite_blank &16f3 85 72 STA &72 ; sprite_address_low &16f5 a9 27 LDA #&27 &16f7 85 73 STA &73 ; sprite_address_high &16f9 ad 10 0c LDA &0c10 ; player_x &16fc 8d e0 2f STA &2fe0 ; screen_x &16ff ee e0 2f INC &2fe0 ; screen_x &1702 ee e0 2f INC &2fe0 ; screen_x &1705 ad 11 0c LDA &0c11 ; player_ground_y &1708 8d e1 2f STA &2fe1 ; screen_y &170b 20 42 26 JSR &2642 ; calculate_screen_address &170e 20 b0 26 JSR &26b0 ; plot_sprite # Unplot gold &1711 a9 12 LDA #&12 # Play immediately on channel 2 &1713 8d 30 0c STA &0c30 ; sound_block + 0 (channel) &1716 a9 00 LDA #&00 &1718 8d 31 0c STA &0c31 ; sound_block + 1 (channel high) &171b a9 02 LDA #&02 &171d 8d 32 0c STA &0c32 ; sound_block + 2 (volume) &1720 a9 00 LDA #&00 &1722 8d 33 0c STA &0c33 ; sound_block + 3 (volume high) &1725 a9 c8 LDA #&c8 &1727 8d 34 0c STA &0c34 ; sound_block + 4 (pitch) &172a a9 00 LDA #&00 &172c 8d 35 0c STA &0c35 ; sound_block + 5 (pitch high) &172f a9 01 LDA #&01 &1731 8d 36 0c STA &0c36 ; sound_block + 6 (duration) &1734 a9 00 LDA #&00 &1736 8d 37 0c STA &0c37 ; sound_block + 7 (duration high) &1739 a2 30 LDX #&30 ; &0c30 = sound_block &173b a0 0c LDY #&0c &173d a9 07 LDA #&07 ; Generate a sound &173f 20 f1 ff JSR &fff1 ; OSWORD # Play sound for collecting gold &1742 60 RTS ; unused &1743 4d 17 49 4e 00 8d 1e 40 4c ca ; sprite_helicopter &174d 00 15 2a 00 49 cd f1 ac 00 15 2a 00 00 03 03 00 &175d 15 3e 03 00 15 38 21 00 3e 30 21 15 3e 30 21 03 &176d 3e 30 21 03 16 30 03 47 03 03 03 00 01 03 02 00 &177d 00 08 08 00 04 00 08 0a 0f 0f 0f 00 00 00 00 00 ; unused &178d 00 00 99 ; sprite_gold &1790 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &17a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &17b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &17c0 00 00 00 00 00 1f 1f 00 00 1f 1f 00 00 1f 1f 00 ; unused &17d0 00 d0 00 00 1b ; sprite_eighty &17d5 00 00 00 00 c0 80 c0 80 80 80 80 80 80 80 80 80 &17e5 80 80 80 80 c0 80 80 80 80 80 80 80 80 80 80 80 &17f5 80 80 80 80 c0 80 c0 80 00 00 00 00 00 00 00 00 &1805 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; unused &1815 00 83 00 00 ; gold_x &1819 14 ; gold_y &181a a9 ; gold_state &181b ff ; next_gold_position_offset &181c 01 ; update_helicopter &181d ad e3 2f LDA &2fe3 ; level &1820 c9 04 CMP #&04 &1822 b0 01 BCS &1825 ; is_present # No helicopter on first set of levels &1824 60 RTS ; is_present &1825 ad 4b 17 LDA &174b ; helicopter_x &1828 8d e0 2f STA &2fe0 ; screen_x &182b ad 4c 17 LDA &174c ; helicopter_y &182e 8d e1 2f STA &2fe1 ; screen_y &1831 20 42 26 JSR &2642 ; calculate_screen_address &1834 a5 70 LDA &70 ; screen_address_low &1836 48 PHA ; screen_address_low &1837 a5 71 LDA &71 ; screen_address_high &1839 48 PHA ; screen_address_high &183a ad e2 2f LDA &2fe2 ; row_in_group &183d 48 PHA ; row_in_group &183e ce 4b 17 DEC &174b ; helicopter_x &1841 ad 4b 17 LDA &174b ; helicopter_x &1844 c9 00 CMP #&00 &1846 d0 20 BNE &1868 ; skip_changing_helicopter_ground &1848 a9 4c LDA #&4c &184a 8d 4b 17 STA &174b ; helicopter_x # Move to right of screen &184d 38 SEC &184e ad 4c 17 LDA &174c ; helicopter_y &1851 e9 38 SBC #&38 # Move up a ground &1853 8d 4c 17 STA &174c ; helicopter_y &1856 ad 4c 17 LDA &174c ; helicopter_y &1859 c9 ef CMP #&ef &185b d0 0b BNE &1868 ; skip_ground_wraparound # If above first ground, &185d a9 cf LDA #&cf # Move to fourth ground &185f 8d 4c 17 STA &174c ; helicopter_y &1862 ad e3 2f LDA &2fe3 ; level &1865 8d 1c 18 STA &181c ; next_gold_position_offset ; skip_ground_wraparound ; skip_changing_helicopter_ground &1868 a9 5a LDA #&5a ; &275a = sprite_blank &186a 85 72 STA &72 ; sprite_address_low &186c a9 27 LDA #&27 &186e 85 73 STA &73 ; sprite_address_high &1870 68 PLA ; row_in_group &1871 8d e2 2f STA &2fe2 ; row_in_group &1874 68 PLA ; screen_address_high &1875 85 71 STA &71 ; screen_address_high &1877 68 PLA ; screen_address_low &1878 85 70 STA &70 ; screen_address_low &187a 20 b0 26 JSR &26b0 ; plot_sprite # Unplot previous helicopter &187d ad 4b 17 LDA &174b ; helicopter_x &1880 8d e0 2f STA &2fe0 ; screen_x &1883 ad 4c 17 LDA &174c ; helicopter_y &1886 8d e1 2f STA &2fe1 ; screen_y &1889 a9 4d LDA #&4d ; &174d = sprite_helicopter &188b 85 72 STA &72 ; sprite_address_low &188d a9 17 LDA #&17 &188f 85 73 STA &73 ; sprite_address_high &1891 20 42 26 JSR &2642 ; calculate_screen_address &1894 20 b0 26 JSR &26b0 ; plot_sprite # Plot helicopter &1897 4c 22 11 JMP &1122 ; update_gold ; unused_update_gold # &189a - &18ac is identical to &1125 - &1137 ; # &1122 ad 1b 18 LDA &181b ; gold_state &189a c9 ff CMP #&ff &189c f0 03 BEQ &18a1 ; unused_consider_dropping_gold &189e 4c cb 18 JMP &18cb ; unused_update_falling_gold ; consider_dropping_gold &18a1 ad 4b 17 LDA &174b ; helicopter_x &18a4 ae 1c 18 LDX &181c ; next_gold_position_offset &18a7 dd b6 2e CMP &2eb6,X ; x_positions_table &18aa f0 01 BEQ &18ad ; unused_drop_gold &18ac 60 RTS ; unused_drop_gold # &18ad - &1907 is different to &1138 - &11ec &18ad ad 4b 17 LDA &174b ; helicopter_x &18b0 8d 19 18 STA &1819 ; gold_x &18b3 18 CLC &18b4 ad 19 18 LDA &1819 ; gold_x &18b7 69 04 ADC #&04 &18b9 8d 19 18 STA &1819 ; gold_x &18bc ad 4c 17 LDA &174c ; helicopter_y &18bf 8d 1a 18 STA &181a ; gold_y &18c2 18 CLC &18c3 ad 1a 18 LDA &181a ; gold_y &18c6 69 04 ADC #&04 &18c8 8d 1a 18 STA &181a ; gold_y ; unused_update_falling_gold &18cb ee 1b 18 INC &181b ; gold_state &18ce ee 1a 18 INC &181a ; gold_y &18d1 ad 1b 18 LDA &181b ; gold_state &18d4 c9 0d CMP #&0d # &11d4 c9 11 CMP #&11 &18d6 d0 15 BNE &18ed ; unused_not_on_ground &18d8 ee 1c 18 INC &181c ; next_gold_position_offset &18db ad 1c 18 LDA &181c ; next_gold_position_offset &18de c9 27 CMP #&27 # &11e3 c9 28 CMP #&28 &18e0 d0 05 BNE &18e7 ; unused_skip_wraparound &18e2 a9 01 LDA #&01 &18e4 8d 1c 18 STA &181c ; next_gold_position_offset ; unused_skip_wraparound &18e7 a9 ff LDA #&ff &18e9 8d 1b 18 STA &181b ; gold_state &18ec 60 RTS ; unused_not_on_ground &18ed ad 19 18 LDA &1819 ; gold_x &18f0 8d e0 2f STA &2fe0 ; screen_x &18f3 ad 1a 18 LDA &181a ; gold_y &18f6 8d e1 2f STA &2fe1 ; screen_y &18f9 a9 91 LDA #&91 ; &1791 # &11c0 a9 90 LDA #&90 ; &1790 = sprite_gold &18fb 85 72 STA &72 ; sprite_address_low &18fd a9 17 LDA #&17 &18ff 85 73 STA &73 ; sprite_address_high &1901 20 42 26 JSR &2642 ; calculate_screen_address &1904 20 b0 26 JSR &26b0 ; plot_sprite &1907 60 RTS ; unused &1908 20 4c c3 18 60 ; disable_cursor &190d a9 17 LDA #&17 &190f 20 ee ff JSR &ffee ; OSWRCH &1912 a9 00 LDA #&00 ; set CRTC register &1914 20 ee ff JSR &ffee ; OSWRCH &1917 a9 0a LDA #&0a ; R10: Cursor start register &1919 20 ee ff JSR &ffee ; OSWRCH &191c a9 20 LDA #&20 ; disable cursor &191e 20 ee ff JSR &ffee ; OSWRCH &1921 a0 08 LDY #&08 ; write_nulls_loop &1923 a9 00 LDA #&00 &1925 20 ee ff JSR &ffee ; OSWRCH &1928 88 DEY &1929 d0 f8 BNE &1923 ; write_nulls_loop &192b 60 RTS ; play_tune &192c a9 12 LDA #&12 &192e 8d e4 2f STA &2fe4 ; tune_notes_remaining &1931 a9 68 LDA #&68 ; &2f68 = tune_data &1933 85 70 STA &70 ; tune_data_address_low &1935 a9 2f LDA #&2f &1937 85 71 STA &71 ; tune_data_address_high ; play_tune_loop &1939 a0 02 LDY #&02 &193b b1 70 LDA (&70),Y ; tune_data_address # Third byte of tune data specifies duration &193d 85 72 STA &72 ; duration &193f 18 CLC &1940 a5 72 LDA &72 ; duration &1942 65 72 ADC &72 ; duration &1944 85 72 STA &72 ; duration &1946 18 CLC &1947 a5 72 LDA &72 ; duration &1949 a0 02 LDY #&02 &194b 71 70 ADC (&70),Y ; tune_data_address # Third byte of tune data specifies duration &194d 85 72 STA &72 ; duration # Multiply by three &194f a0 01 LDY #&01 &1951 b1 70 LDA (&70),Y ; tune_data_address # Second byte of tune data specifies pitch &1953 c9 00 CMP #&00 # Zero if delay &1955 d0 12 BNE &1969 ; is_note ; is_delay &1957 a9 2d LDA #&2d ; 45 &1959 8d e5 2f STA &2fe5 ; tune_delay ; tune_delay_loop &195c a9 13 LDA #&13 ; Wait for vertical retrace &195e 20 f4 ff JSR &fff4 ; OSBYTE &1961 ce e5 2f DEC &2fe5 ; tune_delay &1964 d0 f6 BNE &195c ; tune_delay_loop &1966 4c cf 19 JMP &19cf ; move_to_next_note ; is_note &1969 a9 01 LDA #&01 &196b 8d 30 0c STA &0c30 ; sound_block + 0 (channel) &196e a9 00 LDA #&00 &1970 8d 31 0c STA &0c31 ; sound_block + 1 (channel high) &1973 a9 f1 LDA #&f1 &1975 8d 32 0c STA &0c32 ; sound_block + 2 (volume) &1978 a9 ff LDA #&ff &197a 8d 33 0c STA &0c33 ; sound_block + 3 (volume high) &197d a0 00 LDY #&00 &197f b1 70 LDA (&70),Y ; tune_data_address # First byte of tune data specifies first pitch &1981 8d 34 0c STA &0c34 ; sound_block + 4 (pitch) &1984 a9 00 LDA #&00 &1986 8d 35 0c STA &0c35 ; sound_block + 5 (pitch high) &1989 a5 72 LDA &72 ; duration &198b 8d 36 0c STA &0c36 ; sound_block + 6 (duration) &198e a9 00 LDA #&00 &1990 8d 37 0c STA &0c37 ; sound_block + 7 (duration high) &1993 a2 30 LDX #&30 ; &0c30 = sound_block &1995 a0 0c LDY #&0c &1997 a9 07 LDA #&07 ; Generate a sound &1999 20 f1 ff JSR &fff1 ; OSWORD # Play first note in chord on channel one &199c a9 02 LDA #&02 &199e 8d 30 0c STA &0c30 ; sound_block + 0 (channel) &19a1 a9 00 LDA #&00 &19a3 8d 31 0c STA &0c31 ; sound_block + 1 (channel high) &19a6 a9 f1 LDA #&f1 &19a8 8d 32 0c STA &0c32 ; sound_block + 2 (volume) &19ab a9 ff LDA #&ff &19ad 8d 33 0c STA &0c33 ; sound_block + 3 (volume high) &19b0 a0 01 LDY #&01 &19b2 b1 70 LDA (&70),Y ; tune_data_address # Second byte of tune data specifies second pitch &19b4 8d 34 0c STA &0c34 ; sound_block + 4 (pitch) &19b7 a9 00 LDA #&00 &19b9 8d 35 0c STA &0c35 ; sound_block + 5 (pitch high) &19bc a5 72 LDA &72 ; duration &19be 8d 36 0c STA &0c36 ; sound_block + 6 (duration) &19c1 a9 00 LDA #&00 &19c3 8d 37 0c STA &0c37 ; sound_block + 7 (duration high) &19c6 a2 30 LDX #&30 ; &0c30 = sound_block &19c8 a0 0c LDY #&0c &19ca a9 07 LDA #&07 ; Generate a sound &19cc 20 f1 ff JSR &fff1 ; OSWORD # Play second note in chord on channel two ; move_to_next_note &19cf 18 CLC &19d0 a5 70 LDA &70 ; tune_data_address_low &19d2 69 03 ADC #&03 &19d4 85 70 STA &70 ; tune_data_address_low &19d6 a5 71 LDA &71 ; tune_data_address_high &19d8 69 00 ADC #&00 &19da 85 71 STA &71 ; tune_data_address_high &19dc ce e4 2f DEC &2fe4 ; tune_notes_remaining &19df f0 03 BEQ &19e4 ; end_of_tune &19e1 4c 39 19 JMP &1939 ; play_tune_loop ; end_of_tune &19e4 a9 32 LDA #&32 ; 50 &19e6 8d e5 2f STA &2fe5 ; tune_delay ; end_of_tune_delay_loop &19e9 a9 13 LDA #&13 ; Wait for vertical retrace &19eb 20 f4 ff JSR &fff4 ; OSBYTE &19ee ce e5 2f DEC &2fe5 ; tune_delay &19f1 d0 f6 BNE &19e9 ; end_of_tune_delay_loop &19f3 60 RTS ; unused # &19f4 - &1a03 is a copy of &1e08 - &1e17 &19f4 a5 70 LDA &70 ; screen_address_low &19f6 8d 16 0c STA &0c16 ; player_screen_address_low &19f9 a5 71 LDA &71 ; screen_address_high &19fb 8d 17 0c STA &0c17 ; player_screen_address_high &19fe ad e2 2f LDA &2fe2 ; row_in_group &1a01 8d 18 0c STA &0c18 ; player_row_in_group ; kill_player &1a04 a9 10 LDA #&10 # Play immediately on channel 0 &1a06 8d 30 0c STA &0c30 ; sound_block + 0 (channel) &1a09 a9 00 LDA #&00 &1a0b 8d 31 0c STA &0c31 ; sound_block + 1 (channel high) &1a0e a9 01 LDA #&01 &1a10 8d 32 0c STA &0c32 ; sound_block + 2 (volume) &1a13 a9 00 LDA #&00 &1a15 8d 33 0c STA &0c33 ; sound_block + 3 (volume high) &1a18 a9 06 LDA #&06 # Low frequency white noise &1a1a 8d 34 0c STA &0c34 ; sound_block + 4 (pitch) &1a1d a9 00 LDA #&00 &1a1f 8d 35 0c STA &0c35 ; sound_block + 5 (pitch high) &1a22 a9 05 LDA #&05 &1a24 8d 36 0c STA &0c36 ; sound_block + 6 (duration) &1a27 a9 00 LDA #&00 &1a29 8d 37 0c STA &0c37 ; sound_block + 7 (duration high) &1a2c a2 30 LDX #&30 ; &0c30 = sound_block &1a2e a0 0c LDY #&0c &1a30 a9 07 LDA #&07 ; Generate a sound &1a32 20 f1 ff JSR &fff1 ; OSWORD # Play sound for player dying &1a35 a9 9a LDA #&9a ; &009a # Unnecessary code; values overwritten at &1a57 &1a37 8d 00 0c STA &0c00 ; player_sprite_address_low # &1a3a a9 00 LDA #&00 # &1a3c 8d 01 0c STA &0c01 ; player_sprite_address_high # &1a3f ad 10 0c LDA &0c10 ; player_x &1a42 8d e0 2f STA &2fe0 ; screen_x &1a45 ad 11 0c LDA &0c11 ; player_ground_y &1a48 8d e1 2f STA &2fe1 ; screen_y &1a4b ae 12 0c LDX &0c12 ; player_jump_state &1a4e ad e1 2f LDA &2fe1 ; screen_y &1a51 fd ed 2e SBC &2eed,X ; jump_offsets_table &1a54 8d e1 2f STA &2fe1 ; screen_y &1a57 a9 9a LDA #&9a ; &279a = sprite_explosion &1a59 85 72 STA &72 ; sprite_address_low &1a5b a9 27 LDA #&27 &1a5d 85 73 STA &73 ; sprite_address_high &1a5f 20 42 26 JSR &2642 ; calculate_screen_address &1a62 20 b0 26 JSR &26b0 ; plot_sprite # Plot explosion &1a65 18 CLC &1a66 ad 10 0c LDA &0c10 ; player_x &1a69 69 04 ADC #&04 &1a6b 8d 10 0c STA &0c10 ; player_x &1a6e a9 12 LDA #&12 &1a70 8d 12 0c STA &0c12 ; player_jump_state # Set player starting to fall ; animate_flying_dead_player_loop &1a73 20 6a 22 JSR &226a ; update_rotating_colour_and_enemies &1a76 a9 13 LDA #&13 ; Wait for vertical retrace &1a78 20 f4 ff JSR &fff4 ; OSBYTE &1a7b ad 10 0c LDA &0c10 ; player_x &1a7e 8d e0 2f STA &2fe0 ; screen_x &1a81 ad 11 0c LDA &0c11 ; player_ground_y &1a84 8d e1 2f STA &2fe1 ; screen_y &1a87 ae 12 0c LDX &0c12 ; player_jump_state &1a8a ad e1 2f LDA &2fe1 ; screen_y &1a8d fd ed 2e SBC &2eed,X ; jump_offsets_table &1a90 8d e1 2f STA &2fe1 ; screen_y &1a93 a9 5a LDA #&5a ; &275a = sprite_blank # Unnecessary code &1a95 85 72 STA &72 ; sprite_address_low # &1a97 a9 27 LDA #&27 # &1a99 85 73 STA &73 ; sprite_address_high # &1a9b 20 42 26 JSR &2642 ; calculate_screen_address &1a9e a9 5a LDA #&5a ; &275a = sprite_blank &1aa0 85 72 STA &72 ; sprite_address_low &1aa2 a9 27 LDA #&27 &1aa4 85 73 STA &73 ; sprite_address_high &1aa6 20 b0 26 JSR &26b0 ; plot_sprite # Unplot previous flying dead player &1aa9 ee 10 0c INC &0c10 ; player_x &1aac ad 10 0c LDA &0c10 ; player_x &1aaf c9 4a CMP #&4a &1ab1 d0 05 BNE &1ab8 ; skip_ceiling &1ab3 a9 49 LDA #&49 &1ab5 8d 10 0c STA &0c10 ; player_x ; skip_ceiling &1ab8 ee 12 0c INC &0c12 ; player_jump_state &1abb ad 10 0c LDA &0c10 ; player_x &1abe 8d e0 2f STA &2fe0 ; screen_x &1ac1 ad 11 0c LDA &0c11 ; player_ground_y &1ac4 8d e1 2f STA &2fe1 ; screen_y &1ac7 ae 12 0c LDX &0c12 ; player_jump_state &1aca ad e1 2f LDA &2fe1 ; screen_y &1acd fd ed 2e SBC &2eed,X ; jump_offsets_table &1ad0 8d e1 2f STA &2fe1 ; screen_y &1ad3 ad 00 0c LDA &0c00 ; player_sprite_address_low &1ad6 85 72 STA &72 ; sprite_address_low &1ad8 ad 01 0c LDA &0c01 ; player_sprite_address_high &1adb 85 73 STA &73 ; sprite_address_high &1add 20 42 26 JSR &2642 ; calculate_screen_address &1ae0 a9 9a LDA #&9a ; &289a = sprite_dead_player_one &1ae2 85 72 STA &72 ; sprite_address_low &1ae4 a9 28 LDA #&28 &1ae6 85 73 STA &73 ; sprite_address_high &1ae8 20 b0 26 JSR &26b0 ; plot_sprite # Plot flying dead player &1aeb ad 12 0c LDA &0c12 ; player_jump_state &1aee c9 20 CMP #&20 &1af0 f0 03 BEQ &1af5 ; animate_dead_player &1af2 4c 73 1a JMP &1a73 ; animate_flying_dead_player_loop ; animate_dead_player &1af5 a9 07 LDA #&07 &1af7 8d e4 2f STA &2fe4 ; dead_player_count ; animate_dead_player_loop &1afa a9 9a LDA #&9a ; &289a = sprite_dead_player_one &1afc 85 72 STA &72 ; sprite_address_low &1afe a9 28 LDA #&28 &1b00 85 73 STA &73 ; sprite_address_high &1b02 ad 10 0c LDA &0c10 ; player_x &1b05 8d e0 2f STA &2fe0 ; screen_x &1b08 ad 11 0c LDA &0c11 ; player_ground_y &1b0b 8d e1 2f STA &2fe1 ; screen_y &1b0e 20 42 26 JSR &2642 ; calculate_screen_address &1b11 20 b0 26 JSR &26b0 ; plot_sprite # Plot dead player frame one &1b14 a9 0a LDA #&0a ; 10 &1b16 8d e6 2f STA &2fe6 ; death_delay ; death_delay_one_loop &1b19 a9 13 LDA #&13 ; Wait for vertical retrace &1b1b 20 f4 ff JSR &fff4 ; OSBYTE &1b1e ce e6 2f DEC &2fe6 ; death_delay &1b21 d0 f6 BNE &1b19 ; death_delay_one_loop &1b23 a9 5a LDA #&5a ; &285a = sprite_dead_player_two &1b25 85 72 STA &72 ; sprite_address_low &1b27 a9 28 LDA #&28 &1b29 85 73 STA &73 ; sprite_address_high &1b2b ad 10 0c LDA &0c10 ; player_x &1b2e 8d e0 2f STA &2fe0 ; screen_x &1b31 ad 11 0c LDA &0c11 ; player_ground_y &1b34 8d e1 2f STA &2fe1 ; screen_y &1b37 20 42 26 JSR &2642 ; calculate_screen_address &1b3a 20 b0 26 JSR &26b0 ; plot_sprite # Plot dead player frame two &1b3d a9 0a LDA #&0a &1b3f 8d e6 2f STA &2fe6 ; death_delay ; death_delay_two_loop &1b42 a9 13 LDA #&13 ; Wait for vertical retrace &1b44 20 f4 ff JSR &fff4 ; OSBYTE &1b47 ce e6 2f DEC &2fe6 ; death_delay &1b4a d0 f6 BNE &1b42 ; death_delay_two_loop &1b4c ce e4 2f DEC &2fe4 ; dead_player_count &1b4f d0 a9 BNE &1afa ; animate_dead_player_loop &1b51 ee 15 0c INC &0c15 ; take &1b54 60 RTS ; unused # Unused code &1b55 f0 03 BEQ &1b5a ; leave &1b57 4c d8 1a JMP &1ad8 ; leave &1b5a 60 RTS ; unused &1b5b 60 RTS ; unused # &1b5c - &1b61 is a copy of &1e0b - &1e10 &1b5c 16 0c ... &0c16 &1b5e a5 71 LDA &71 &1b60 8d 17 STA &..17 ; check_for_collision &1b62 a9 00 LDA #&00 &1b64 8d 0a 0c STA &0c0a ; player_collided # Set to zero to indicate no collision (unused) &1b67 ad dc 2f LDA &2fdc ; right_edge &1b6a c9 00 CMP #&00 &1b6c f0 06 BEQ &1b74 ; no_collision_on_right_edge &1b6e a9 01 LDA #&01 # Leave with non-zero to indicate collision &1b70 8d 0a 0c STA &0c0a ; player_collided # Unused variable &1b73 60 RTS ; no_collision_on_right_edge &1b74 ad 10 0c LDA &0c10 ; player_x # Unnecessary code &1b77 18 CLC # &1b78 69 01 ADC #&01 # &1b7a 18 CLC # &1b7b 69 01 ADC #&01 # &1b7d ad 11 0c LDA &0c11 ; player_ground_y &1b80 8d e1 2f STA &2fe1 ; screen_y &1b83 ae 12 0c LDX &0c12 ; player_jump_state &1b86 38 SEC &1b87 ad e1 2f LDA &2fe1 ; screen_y &1b8a fd ed 2e SBC &2eed,X ; jump_offsets_table &1b8d 8d e1 2f STA &2fe1 ; screen_y &1b90 ce e1 2f DEC &2fe1 ; screen_y &1b93 20 42 26 JSR &2642 ; calculate_screen_address # screen_x = player_x + 4 here (&1524) &1b96 ac e2 2f LDY &2fe2 ; row_in_group &1b99 b1 70 LDA (&70),Y ; screen_address # Check for collision at top right &1b9b c9 00 CMP #&00 &1b9d f0 06 BEQ &1ba5 ; no_collision_top_right &1b9f a9 01 LDA #&01 # Leave with non-zero to indicate collision &1ba1 8d 0a 0c STA &0c0a ; player_collided # Unused variable &1ba4 60 RTS ; no_collision_top_right &1ba5 ad 12 0c LDA &0c12 ; player_jump_state &1ba8 c9 00 CMP #&00 &1baa d0 01 BNE &1bad ; is_jumping &1bac 60 RTS ; is_jumping &1bad ad 10 0c LDA &0c10 ; player_x &1bb0 8d e0 2f STA &2fe0 ; screen_x &1bb3 ad 11 0c LDA &0c11 ; player_ground_y &1bb6 8d e1 2f STA &2fe1 ; screen_y &1bb9 ae 12 0c LDX &0c12 ; player_jump_state &1bbc 38 SEC &1bbd ad e1 2f LDA &2fe1 ; screen_y &1bc0 fd ed 2e SBC &2eed,X ; jump_offsets_table &1bc3 8d e1 2f STA &2fe1 ; screen_y &1bc6 18 CLC &1bc7 ad e1 2f LDA &2fe1 ; screen_y &1bca 69 10 ADC #&10 &1bcc 8d e1 2f STA &2fe1 ; screen_y &1bcf 20 42 26 JSR &2642 ; calculate_screen_address &1bd2 ac e2 2f LDY &2fe2 ; row_in_group &1bd5 b1 70 LDA (&70),Y ; screen_address # Check for collision below &1bd7 c9 00 CMP #&00 &1bd9 f0 06 BEQ &1be1 ; no_collision_below &1bdb a9 01 LDA #&01 # Leave with non-zero to indicate collision &1bdd 8d 0a 0c STA &0c0a ; player_collided # Unused variable &1be0 60 RTS ; no_collision_below &1be1 60 RTS # Leave with zero to indicate no collision ; unused &1be2 10 0c ; update_player &1be4 20 ec 1d JSR &1dec ; calculate_player_screen_address &1be7 18 CLC &1be8 ad 14 0c LDA &0c14 ; player_x_fraction # player_x += player_x_velocity * 3 &1beb 6d 13 0c ADC &0c13 ; player_x_velocity &1bee 8d 14 0c STA &0c14 ; player_x_fraction &1bf1 ad 10 0c LDA &0c10 ; player_x &1bf4 69 00 ADC #&00 &1bf6 8d 10 0c STA &0c10 ; player_x &1bf9 18 CLC &1bfa ad 14 0c LDA &0c14 ; player_x_fraction &1bfd 6d 13 0c ADC &0c13 ; player_x_velocity &1c00 8d 14 0c STA &0c14 ; player_x_fraction &1c03 ad 10 0c LDA &0c10 ; player_x &1c06 69 00 ADC #&00 &1c08 8d 10 0c STA &0c10 ; player_x &1c0b 18 CLC &1c0c ad 14 0c LDA &0c14 ; player_x_fraction &1c0f 6d 13 0c ADC &0c13 ; player_x_velocity &1c12 8d 14 0c STA &0c14 ; player_x_fraction &1c15 ad 10 0c LDA &0c10 ; player_x &1c18 69 00 ADC #&00 &1c1a 8d 10 0c STA &0c10 ; player_x &1c1d a9 11 LDA #&11 # Play immediately on channel 1 &1c1f 8d 30 0c STA &0c30 ; sound_block + 0 (channel) &1c22 a9 00 LDA #&00 &1c24 8d 31 0c STA &0c31 ; sound_block + 1 (channel high) &1c27 a9 00 LDA #&00 &1c29 8d 32 0c STA &0c32 ; sound_block + 2 (volume) &1c2c a9 00 LDA #&00 &1c2e 8d 33 0c STA &0c33 ; sound_block + 3 (volume high) &1c31 ad 13 0c LDA &0c13 ; player_x_velocity &1c34 8d 34 0c STA &0c34 ; sound_block + 4 (pitch) &1c37 4e 34 0c LSR &0c34 ; sound_block + 4 (pitch) &1c3a a9 00 LDA #&00 &1c3c 8d 35 0c STA &0c35 ; sound_block + 5 (pitch high) &1c3f a9 01 LDA #&01 &1c41 8d 36 0c STA &0c36 ; sound_block + 6 (duration) &1c44 a9 00 LDA #&00 &1c46 8d 37 0c STA &0c37 ; sound_block + 7 (duration high) &1c49 a2 30 LDX #&30 ; &0c30 = sound_block &1c4b a0 0c LDY #&0c &1c4d a9 07 LDA #&07 ; Generate a sound &1c4f 20 f1 ff JSR &fff1 ; OSWORD # Play sound to set pitch for channel 0 &1c52 a9 03 LDA #&03 # Unnecessary code &1c54 8d 34 0c STA &0c34 ; sound_block + 4 (pitch) # &1c57 ad 01 0c LDA &0c01 ; player_sprite_address_high &1c5a c9 2b CMP #&2b &1c5c f0 34 BEQ &1c92 ; is_snow ; not_snow &1c5e a9 10 LDA #&10 # Play immediately on channel 0 &1c60 8d 30 0c STA &0c30 ; sound_block + 0 (channel) &1c63 a9 00 LDA #&00 &1c65 8d 31 0c STA &0c31 ; sound_block + 1 (channel high) &1c68 a9 f1 LDA #&f1 &1c6a 8d 32 0c STA &0c32 ; sound_block + 2 (volume) &1c6d a9 ff LDA #&ff &1c6f 8d 33 0c STA &0c33 ; sound_block + 3 (volume high) &1c72 a9 03 LDA #&03 # Periodic noise, pitch from channel 1 &1c74 8d 34 0c STA &0c34 ; sound_block + 4 (pitch) &1c77 a9 00 LDA #&00 &1c79 8d 35 0c STA &0c35 ; sound_block + 5 (pitch high) &1c7c a9 02 LDA #&02 &1c7e 8d 36 0c STA &0c36 ; sound_block + 6 (duration) &1c81 a9 00 LDA #&00 &1c83 8d 37 0c STA &0c37 ; sound_block + 7 (duration high) &1c86 a2 30 LDX #&30 ; &0c30 = sound_block &1c88 a0 0c LDY #&0c &1c8a a9 07 LDA #&07 ; Generate a sound &1c8c 20 f1 ff JSR &fff1 ; OSWORD # Play sound for player moving on land or sea &1c8f 4c d1 1c JMP &1cd1 ; skip_snow_sound ; is_snow &1c92 ad 12 0c LDA &0c12 ; player_jump_state &1c95 c9 00 CMP #&00 &1c97 d0 38 BNE &1cd1 ; skip_snow_sound # If on snow, don't play sound if jumping &1c99 ad 13 0c LDA &0c13 ; player_x_velocity &1c9c c9 00 CMP #&00 &1c9e f0 31 BEQ &1cd1 ; skip_snow_sound # or stationary &1ca0 a9 10 LDA #&10 # Play immediately on channel 0 &1ca2 8d 30 0c STA &0c30 ; sound_block + 0 (channel) &1ca5 a9 00 LDA #&00 &1ca7 8d 31 0c STA &0c31 ; sound_block + 1 (channel high) &1caa a9 f9 LDA #&f9 &1cac 8d 32 0c STA &0c32 ; sound_block + 2 (volume) &1caf a9 ff LDA #&ff &1cb1 8d 33 0c STA &0c33 ; sound_block + 3 (volume high) &1cb4 a9 04 LDA #&04 # High frequency white noise &1cb6 8d 34 0c STA &0c34 ; sound_block + 4 (pitch) &1cb9 a9 00 LDA #&00 &1cbb 8d 35 0c STA &0c35 ; sound_block + 5 (pitch high) &1cbe a9 02 LDA #&02 &1cc0 8d 36 0c STA &0c36 ; sound_block + 6 (duration) &1cc3 a9 00 LDA #&00 &1cc5 8d 37 0c STA &0c37 ; sound_block + 7 (duration high) &1cc8 a2 30 LDX #&30 ; &0c30 = sound_block &1cca a0 0c LDY #&0c &1ccc a9 07 LDA #&07 ; Generate a sound &1cce 20 f1 ff JSR &fff1 ; OSWORD # Play sound for player moving on snow ; skip_snow_sound &1cd1 a2 ff LDX #&ff ; SHIFT &1cd3 a0 ff LDY #&ff &1cd5 a9 81 LDA #&81 ; Scan for a particular key &1cd7 20 f4 ff JSR &fff4 ; OSBYTE &1cda e0 00 CPX #&00 &1cdc f0 15 BEQ &1cf3 ; shift_not_pressed ; shift_pressed # If SHIFT pressed, &1cde ee 13 0c INC &0c13 ; player_x_velocity # player_x_velocity += 3 &1ce1 ee 13 0c INC &0c13 ; player_x_velocity &1ce4 ee 13 0c INC &0c13 ; player_x_velocity &1ce7 ad 13 0c LDA &0c13 ; player_x_velocity &1cea c9 fa CMP #&fa ; 250 &1cec 90 05 BCC &1cf3 ; skip_ceiling &1cee a9 fa LDA #&fa ; 250 &1cf0 8d 13 0c STA &0c13 ; player_x_velocity ; skip_ceiling ; shift_not_pressed &1cf3 ad 10 0c LDA &0c10 ; player_x &1cf6 c9 4d CMP #&4d &1cf8 f0 11 BEQ &1d0b ; is_end_of_ground &1cfa ad 10 0c LDA &0c10 ; player_x &1cfd c9 4c CMP #&4c &1cff f0 0a BEQ &1d0b ; is_end_of_ground &1d01 ad 10 0c LDA &0c10 ; player_x &1d04 c9 4b CMP #&4b &1d06 f0 03 BEQ &1d0b ; is_end_of_ground &1d08 4c 46 1d JMP &1d46 ; not_end_of_ground ; is_end_of_ground &1d0b ac e3 2f LDY &2fe3 ; level ; score_for_reaching_end_of_ground_loop &1d0e 20 1a 22 JSR &221a ; add_to_wages # Earn 10 * level for reaching end of ground &1d11 88 DEY &1d12 d0 fa BNE &1d0e ; score_for_reaching_end_of_ground_loop &1d14 18 CLC &1d15 ad 11 0c LDA &0c11 ; player_ground_y &1d18 69 38 ADC #&38 # Move to next ground &1d1a 8d 11 0c STA &0c11 ; player_ground_y &1d1d a9 00 LDA #&00 &1d1f 8d 10 0c STA &0c10 ; player_x &1d22 ad 11 0c LDA &0c11 ; player_ground_y &1d25 c9 18 CMP #&18 &1d27 d0 1d BNE &1d46 ; not_end_of_level &1d29 ee e3 2f INC &2fe3 ; level &1d2c ad e3 2f LDA &2fe3 ; level &1d2f c9 24 CMP #&24 ; 36 # Level 36, set 12 snow &1d31 d0 05 BNE &1d38 ; skip_wraparound &1d33 a9 21 LDA #&21 ; 33 # Level 33, set 11 snow &1d35 8d e3 2f STA &2fe3 ; level ; skip_wraparound &1d38 20 92 23 JSR &2392 ; initialise_level &1d3b 20 b8 1f JSR &1fb8 ; consider_plotting_holes &1d3e 20 4a 1f JSR &1f4a ; clear_paths_of_enemies &1d41 a9 01 LDA #&01 &1d43 8d 09 0c STA &0c09 ; player_can_brake # Set to non-zero to allow player to brake ; not_end_of_level ; not_end_of_ground &1d46 a2 9d LDX #&9d ; SPACE &1d48 a0 ff LDY #&ff &1d4a a9 81 LDA #&81 ; Scan for a particular key &1d4c 20 f4 ff JSR &fff4 ; OSBYTE &1d4f e0 00 CPX #&00 &1d51 f0 0c BEQ &1d5f ; space_not_pressed ; space_pressed # If SPACE pressed, &1d53 ad 12 0c LDA &0c12 ; player_jump_state &1d56 c9 00 CMP #&00 &1d58 d0 05 BNE &1d5f ; skip_starting_jump # and player not already jumping, &1d5a a9 01 LDA #&01 &1d5c 8d 12 0c STA &0c12 ; player_jump_state # start jump ; skip_starting_jump ; space_not_pressed &1d5f ad 12 0c LDA &0c12 ; player_jump_state &1d62 c9 00 CMP #&00 &1d64 f0 0f BEQ &1d75 ; not_jumping ; is_jumping &1d66 ee 12 0c INC &0c12 ; player_jump_state &1d69 ad 12 0c LDA &0c12 ; player_jump_state &1d6c c9 1e CMP #&1e ; 30 &1d6e d0 05 BNE &1d75 ; not_end_of_jump &1d70 a9 00 LDA #&00 &1d72 8d 12 0c STA &0c12 ; player_jump_state # Set to zero to indicate player isn't jumping ; not_end_of_jump ; not_jumping &1d75 20 19 1e JSR &1e19 ; replot_player &1d78 ad 12 0c LDA &0c12 ; player_jump_state &1d7b c9 00 CMP #&00 &1d7d d0 3b BNE &1dba ; not_falling # If the player isn't jumping, &1d7f ad 10 0c LDA &0c10 ; player_x &1d82 8d e0 2f STA &2fe0 ; screen_x &1d85 ad 11 0c LDA &0c11 ; player_ground_y &1d88 8d e1 2f STA &2fe1 ; screen_y &1d8b 18 CLC &1d8c ad e1 2f LDA &2fe1 ; screen_y &1d8f 69 10 ADC #&10 &1d91 8d e1 2f STA &2fe1 ; screen_y &1d94 ae 12 0c LDX &0c12 ; player_jump_state &1d97 ad e1 2f LDA &2fe1 ; screen_y &1d9a 38 SEC &1d9b fd ed 2e SBC &2eed,X ; jump_offsets_table &1d9e 8d e1 2f STA &2fe1 ; screen_y &1da1 20 42 26 JSR &2642 ; calculate_screen_address &1da4 ac e2 2f LDY &2fe2 ; row_in_group &1da7 b1 70 LDA (&70),Y ; screen_address &1da9 c9 00 CMP #&00 # Is there a hole beneath the player? &1dab d0 0d BNE &1dba ; not_falling &1dad 20 72 1e JSR &1e72 ; update_falling_player + 1 # Bug: should be JSR &1e71 ; update_falling_player &1db0 a9 00 LDA #&00 &1db2 8d 13 0c STA &0c13 ; player_x_velocity # Player stops after fall &1db5 a9 00 LDA #&00 &1db7 8d 12 0c STA &0c12 ; player_jump_state # Set to zero to indicate player isn't jumping ; not_falling &1dba a2 b6 LDX #&b6 ; RETURN &1dbc a0 ff LDY #&ff &1dbe a9 81 LDA #&81 ; Scan for a particular key &1dc0 20 f4 ff JSR &fff4 ; OSBYTE &1dc3 e0 00 CPX #&00 &1dc5 f0 11 BEQ &1dd8 ; return_not_pressed # If RETURN pressed, ; return_pressed &1dc7 ad 09 0c LDA &0c09 ; player_can_brake # &01 if player can brake, &00 if already braked &1dca c9 01 CMP #&01 &1dcc d0 0a BNE &1dd8 ; skip_braking # and player hasn't already braked, &1dce a9 00 LDA #&00 &1dd0 8d 09 0c STA &0c09 ; player_can_brake # Set to &00 to indicate player has already braked &1dd3 a9 00 LDA #&00 &1dd5 8d 13 0c STA &0c13 ; player_x_velocity # Stop player ; skip_braking ; return_not_pressed &1dd8 60 RTS ; unused &1dd9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &1de9 00 00 00 ; calculate_player_screen_address &1dec ad 10 0c LDA &0c10 ; player_x &1def 8d e0 2f STA &2fe0 ; screen_x &1df2 ad 11 0c LDA &0c11 ; player_ground_y &1df5 8d e1 2f STA &2fe1 ; screen_y &1df8 ae 12 0c LDX &0c12 ; player_jump_state &1dfb 38 SEC &1dfc ad e1 2f LDA &2fe1 ; screen_y &1dff fd ed 2e SBC &2eed,X ; jump_offsets_table &1e02 8d e1 2f STA &2fe1 ; screen_y &1e05 20 42 26 JSR &2642 ; calculate_screen_address &1e08 a5 70 LDA &70 ; screen_address_low &1e0a 8d 16 0c STA &0c16 ; player_screen_address_low &1e0d a5 71 LDA &71 ; screen_address_high &1e0f 8d 17 0c STA &0c17 ; player_screen_address_high &1e12 ad e2 2f LDA &2fe2 ; row_in_group &1e15 8d 18 0c STA &0c18 ; player_row_in_group &1e18 60 RTS ; replot_player &1e19 ad 10 0c LDA &0c10 ; player_x &1e1c 8d e0 2f STA &2fe0 ; screen_x &1e1f ad 11 0c LDA &0c11 ; player_ground_y &1e22 8d e1 2f STA &2fe1 ; screen_y &1e25 ae 12 0c LDX &0c12 ; player_jump_state &1e28 38 SEC &1e29 ad e1 2f LDA &2fe1 ; screen_y &1e2c fd ed 2e SBC &2eed,X ; jump_offsets_table &1e2f 8d e1 2f STA &2fe1 ; screen_y &1e32 a9 5a LDA #&5a ; &275a = sprite_blank &1e34 85 72 STA &72 ; sprite_address_low &1e36 a9 27 LDA #&27 &1e38 85 73 STA &73 ; sprite_address_high &1e3a a9 13 LDA #&13 ; Wait for vertical retrace &1e3c 20 f4 ff JSR &fff4 ; OSBYTE &1e3f ad 16 0c LDA &0c16 ; player_screen_address_low &1e42 85 70 STA &70 ; screen_address_x &1e44 ad 17 0c LDA &0c17 ; player_screen_address_high &1e47 85 71 STA &71 ; screen_address_y &1e49 ad 18 0c LDA &0c18 ; player_row_in_group &1e4c 8d e2 2f STA &2fe2 ; row_in_group &1e4f 20 b0 26 JSR &26b0 ; plot_sprite # Unplot previous player &1e52 20 42 26 JSR &2642 ; calculate_screen_address &1e55 ad 00 0c LDA &0c00 ; player_sprite_address_low &1e58 85 72 STA &72 ; sprite_address_low &1e5a ad 01 0c LDA &0c01 ; player_sprite_address_high &1e5d 85 73 STA &73 ; sprite_address_high &1e5f 20 b0 26 JSR &26b0 ; plot_sprite # Plot player &1e62 60 RTS ; unused &1e63 00 00 31 00 32 00 ; update_falling_player_if_not_jumping # Unused entry point &1e69 ad 12 0c LDA &0c12 ; player_jump_state &1e6c c9 00 CMP #&00 &1e6e f0 01 BEQ &1e71 ; update_falling_player &1e70 60 RTS ; update_falling_player # Unused entry point (see bug at &1dad) &1e71 ad d8 2f LDA &2fd8 ; bottom_edge &1e74 c9 00 CMP #&00 ; update_falling_player + 1 # Called at &1dad with A = 0 #1e72 d8 CLD #1e73 2f c9 00 RLA &00c9 # Unofficial opcode; equivalent to ROL &00c9; AND &00c9 &1e76 f0 01 BEQ &1e79 ; not_supported_to_left # Always branches &1e78 60 RTS ; not_supported_to_left &1e79 ad db 2f LDA &2fdb ; bottom_edge + 3 &1e7c c9 00 CMP #&00 &1e7e f0 01 BEQ &1e81 ; not_supported_to_right &1e80 60 RTS ; not_supported_to_right &1e81 a9 0f LDA #&0f ; Flush buffers &1e83 20 f4 ff JSR &fff4 ; OSBYTE &1e86 a9 38 LDA #&38 &1e88 8d e4 2f STA &2fe4 ; falling_timer ; update_falling_player_loop &1e8b a9 5a LDA #&5a ; &275a = sprite_blank &1e8d 85 72 STA &72 ; sprite_address_low &1e8f a9 27 LDA #&27 &1e91 85 73 STA &73 ; sprite_address_high &1e93 ad 10 0c LDA &0c10 ; player_x &1e96 8d e0 2f STA &2fe0 ; screen_x &1e99 ad 11 0c LDA &0c11 ; player_ground_y &1e9c 8d e1 2f STA &2fe1 ; screen_y &1e9f a9 13 LDA #&13 ; Wait for vertical retrace &1ea1 20 f4 ff JSR &fff4 ; OSBYTE &1ea4 20 42 26 JSR &2642 ; calculate_screen_address &1ea7 20 b0 26 JSR &26b0 ; plot_sprite # Unplot previous falling player &1eaa ee 11 0c INC &0c11 ; player_ground_y &1ead ad 00 0c LDA &0c00 ; player_sprite_address_low &1eb0 85 72 STA &72 ; sprite_address_low &1eb2 ad 01 0c LDA &0c01 ; player_sprite_address_high &1eb5 85 73 STA &73 ; sprite_address_high &1eb7 ad 10 0c LDA &0c10 ; player_x &1eba 8d e0 2f STA &2fe0 ; screen_x &1ebd ad 11 0c LDA &0c11 ; player_ground_y &1ec0 8d e1 2f STA &2fe1 ; screen_y &1ec3 20 42 26 JSR &2642 ; calculate_screen_address &1ec6 20 b0 26 JSR &26b0 ; plot_sprite # Plot falling player &1ec9 a9 5a LDA #&5a ; &275a = sprite_blank &1ecb 85 72 STA &72 ; sprite_address_low &1ecd a9 27 LDA #&27 &1ecf 85 73 STA &73 ; sprite_address_high &1ed1 ad 10 0c LDA &0c10 ; player_x &1ed4 8d e0 2f STA &2fe0 ; screen_x &1ed7 ad 11 0c LDA &0c11 ; player_ground_y &1eda 8d e1 2f STA &2fe1 ; screen_y &1edd 38 SEC &1ede ad e1 2f LDA &2fe1 ; screen_y &1ee1 e9 12 SBC #&12 &1ee3 8d e1 2f STA &2fe1 ; screen_y &1ee6 a9 13 LDA #&13 ; Wait for vertical retrace &1ee8 20 f4 ff JSR &fff4 ; OSBYTE &1eeb 20 42 26 JSR &2642 ; calculate_screen_address &1eee 20 b0 26 JSR &26b0 ; plot_sprite # Unplot previous balloon &1ef1 ad 10 0c LDA &0c10 ; player_x &1ef4 8d e0 2f STA &2fe0 ; screen_x &1ef7 ad 11 0c LDA &0c11 ; player_ground_y &1efa 8d e1 2f STA &2fe1 ; screen_y &1efd 38 SEC &1efe ad e1 2f LDA &2fe1 ; screen_y &1f01 e9 12 SBC #&12 &1f03 8d e1 2f STA &2fe1 ; screen_y &1f06 ee e1 2f INC &2fe1 ; screen_y &1f09 a9 da LDA #&da ; &27da = sprite_balloon &1f0b 85 72 STA &72 ; sprite_address_low &1f0d a9 27 LDA #&27 &1f0f 85 73 STA &73 ; sprite_address_high &1f11 20 42 26 JSR &2642 ; calculate_screen_address &1f14 20 b0 26 JSR &26b0 ; plot_sprite # Plot balloon &1f17 ce e4 2f DEC &2fe4 ; falling_timer &1f1a f0 03 BEQ &1f1f ; end_of_fall &1f1c 4c 8b 1e JMP &1e8b ; update_falling_player_loop ; end_of_fall &1f1f a9 5a LDA #&5a ; &275a = sprite_blank &1f21 85 72 STA &72 ; sprite_address_low &1f23 a9 27 LDA #&27 &1f25 85 73 STA &73 ; sprite_address_high &1f27 ad 10 0c LDA &0c10 ; player_x &1f2a 8d e0 2f STA &2fe0 ; screen_x &1f2d ad 11 0c LDA &0c11 ; player_ground_y &1f30 8d e1 2f STA &2fe1 ; screen_y &1f33 38 SEC &1f34 ad e1 2f LDA &2fe1 ; screen_y &1f37 e9 12 SBC #&12 &1f39 8d e1 2f STA &2fe1 ; screen_y &1f3c 20 42 26 JSR &2642 ; calculate_screen_address &1f3f 20 b0 26 JSR &26b0 ; plot_sprite # Unplot balloon &1f42 60 RTS ; unused &1f43 00 00 00 00 00 32 00 ; clear_paths_of_enemies &1f4a a9 00 LDA #&00 &1f4c 8d e4 2f STA &2fe4 ; wipe_x &1f4f a9 70 LDA #&70 &1f51 8d e5 2f STA &2fe5 ; wipe_y ; clear_horizontal_enemy_path_loop &1f54 a9 5a LDA #&5a ; &275a = sprite_blank &1f56 85 72 STA &72 ; sprite_address_low &1f58 a9 27 LDA #&27 &1f5a 85 73 STA &73 ; sprite_address_high &1f5c ad e4 2f LDA &2fe4 ; wipe_x &1f5f 8d e0 2f STA &2fe0 ; screen_x &1f62 ad e5 2f LDA &2fe5 ; wipe_y &1f65 8d e1 2f STA &2fe1 ; screen_y &1f68 20 42 26 JSR &2642 ; calculate_screen_address &1f6b 20 b0 26 JSR &26b0 ; plot_sprite # Unplot obstacles in path of horizontal enemy &1f6e 18 CLC &1f6f ad e4 2f LDA &2fe4 ; wipe_x &1f72 69 04 ADC #&04 &1f74 8d e4 2f STA &2fe4 ; wipe_x &1f77 ad e4 2f LDA &2fe4 ; wipe_x &1f7a c9 50 CMP #&50 &1f7c d0 d6 BNE &1f54 ; clear_horizontal_enemy_path_loop &1f7e a2 00 LDX #&00 &1f80 ac a6 2f LDY &2fa6 ; number_of_vertical_enemies &1f83 a2 00 LDX #&00 &1f85 c0 00 CPY #&00 &1f87 f0 24 BEQ &1fad ; leave ; clear_vertical_enemies_path_loop &1f89 bd a7 2f LDA &2fa7,X ; vertical_enemies_x &1f8c 8d e0 2f STA &2fe0 ; screen_x &1f8f bd a8 2f LDA &2fa8,X ; vertical_enemies_y &1f92 8d e1 2f STA &2fe1 ; screen_y &1f95 8e e4 2f STX &2fe4 ; vertical_enemy_offset &1f98 8c e5 2f STY &2fe5 ; enemies_remaining_to_unplot &1f9b 20 42 26 JSR &2642 ; calculate_screen_address &1f9e 20 b0 26 JSR &26b0 ; plot_sprite # Unplot obstacles in path of vertical enemy &1fa1 ae e4 2f LDX &2fe4 ; vertical_enemy_offset &1fa4 ac e5 2f LDY &2fe5 ; enemies_remaining_to_unplot &1fa7 e8 INX # Move to next vertical enemy &1fa8 e8 INX &1fa9 e8 INX &1faa 88 DEY &1fab d0 dc BNE &1f89 ; clear_vertical_enemies_path_loop ; leave &1fad 60 RTS ; unused &1fae 00 00 00 00 00 00 32 00 00 00 ; consider_plotting_holes &1fb8 ad e3 2f LDA &2fe3 ; level &1fbb c9 05 CMP #&05 &1fbd b0 01 BCS &1fc0 ; has_holes # Holes start on set two, sea &1fbf 60 RTS ; has_holes &1fc0 38 SEC &1fc1 ad e3 2f LDA &2fe3 ; level &1fc4 e9 01 SBC #&01 &1fc6 8d e4 2f STA &2fe4 ; holes_remaining &1fc9 4e e4 2f LSR &2fe4 ; holes_remaining # number of holes = (level - 1) DIV 4 &1fcc 4e e4 2f LSR &2fe4 ; holes_remaining &1fcf ad a6 2f LDA &2fa6 ; number_of_vertical_enemies # Unnecessary code &1fd2 ae e4 2f LDX &2fe4 ; holes_remaining &1fd5 a0 01 LDY #&01 ; find_hole_position_loop &1fd7 b9 e4 2f LDA &2fe4,Y ; variables_for_hole_position - 1 # Unclear; probably not what was intended &1fda c8 INY &1fdb c9 28 CMP #&28 &1fdd 90 f8 BCC &1fd7 ; find_hole_position_loop # Leave loop with either: &1fdf a9 38 LDA #&38 &1fe1 8d e5 2f STA &2fe5 ; hole_y &1fe4 b9 e4 2f LDA &2fe4,Y ; variables_for_hole_position - 1 # Y = 7, so A = sprite_table_offset, i.e. 1 - 3 &1fe7 8d e6 2f STA &2fe6 ; position_table_offset # or Y = 4, so A = hole_width, i.e. 0 &1fea ae e4 2f LDX &2fe4 ; holes_remaining # depending on value of last hole_x from previous take. &1fed a0 01 LDY #&01 # This means holes sometimes move between takes. ; plot_holes_loop &1fef ae e6 2f LDX &2fe6 ; position_table_offset &1ff2 bd b6 2e LDA &2eb6,X ; x_positions_table &1ff5 8d e7 2f STA &2fe7 ; hole_x &1ff8 ee e6 2f INC &2fe6 ; position_table_offset &1ffb ad e6 2f LDA &2fe6 ; position_table_offset &1ffe c9 28 CMP #&28 &2000 d0 05 BNE &2007 ; skip_wraparound &2002 a9 01 LDA #&01 &2004 8d e6 2f STA &2fe6 ; position_table_offset ; skip_wraparound &2007 ac a6 2f LDY &2fa6 ; number_of_vertical_enemies &200a a2 00 LDX #&00 &200c ad a6 2f LDA &2fa6 ; number_of_vertical_enemies &200f c9 00 CMP #&00 &2011 f0 19 BEQ &202c ; skip_checking_vertical_enemies # If the level has vertical enemies, ; check_for_overlap_with_vertical_enemies_loop &2013 bd a7 2f LDA &2fa7,X ; vertical_enemies_x &2016 cd e7 2f CMP &2fe7 ; hole_x &2019 f0 d4 BEQ &1fef ; plot_holes_loop # don't place a hole overlapping them &201b ad e7 2f LDA &2fe7 ; hole_x &201e 18 CLC &201f 69 04 ADC #&04 &2021 dd a7 2f CMP &2fa7,X ; vertical_enemies_x &2024 f0 c9 BEQ &1fef ; plot_holes_loop &2026 e8 INX # Move to next vertical enemy &2027 e8 INX &2028 e8 INX &2029 88 DEY &202a d0 e7 BNE &2013 ; check_for_overlap_with_vertical_enemies_loop ; skip_checking_vertical_enemies &202c a9 5a LDA #&5a ; &275a = sprite_blank &202e 85 72 STA &72 ; sprite_address_low &2030 a9 27 LDA #&27 &2032 85 73 STA &73 ; sprite_address_high &2034 a9 02 LDA #&02 &2036 8d e8 2f STA &2fe8 ; hole_width # Starting with left of hole, ; plot_hole_loop &2039 ad e7 2f LDA &2fe7 ; hole_x &203c 8d e0 2f STA &2fe0 ; screen_x &203f ad e5 2f LDA &2fe5 ; hole_y &2042 8d e1 2f STA &2fe1 ; screen_y &2045 20 42 26 JSR &2642 ; calculate_screen_address &2048 20 b0 26 JSR &26b0 ; plot_sprite # Plot top of hole &204b 18 CLC &204c ad e5 2f LDA &2fe5 ; hole_y &204f 69 10 ADC #&10 &2051 8d e5 2f STA &2fe5 ; hole_y &2054 ad e7 2f LDA &2fe7 ; hole_x &2057 8d e0 2f STA &2fe0 ; screen_x &205a ad e5 2f LDA &2fe5 ; hole_y &205d 8d e1 2f STA &2fe1 ; screen_y &2060 20 42 26 JSR &2642 ; calculate_screen_address &2063 20 b0 26 JSR &26b0 ; plot_sprite # Plot bottom of hole &2066 18 CLC &2067 ad e7 2f LDA &2fe7 ; hole_x &206a 69 04 ADC #&04 &206c 8d e7 2f STA &2fe7 ; hole_x &206f 38 SEC &2070 ad e5 2f LDA &2fe5 ; hole_y &2073 e9 10 SBC #&10 &2075 8d e5 2f STA &2fe5 ; hole_y &2078 ce e8 2f DEC &2fe8 ; hole_width &207b d0 bc BNE &2039 ; plot_hole_loop # Repeat for right of hole &207d 18 CLC &207e ad e5 2f LDA &2fe5 ; hole_y &2081 69 70 ADC #&70 # Move down two grounds &2083 8d e5 2f STA &2fe5 ; hole_y &2086 ad e5 2f LDA &2fe5 ; hole_y &2089 c9 18 CMP #&18 &208b d0 05 BNE &2092 ; skip_wraparound &208d a9 38 LDA #&38 &208f 8d e5 2f STA &2fe5 ; hole_y ; skip_wraparound &2092 ce e4 2f DEC &2fe4 ; holes_remaining &2095 f0 03 BEQ &209a ; leave &2097 4c ef 1f JMP &1fef ; plot_holes_loop ; leave &209a 60 RTS ; unused &209b 00 00 00 32 00 00 00 ; clapperboard_screen &20a2 a9 16 LDA #&16 # Change to MODE 2 &20a4 20 ee ff JSR &ffee ; OSWRCH &20a7 a9 02 LDA #&02 &20a9 20 ee ff JSR &ffee ; OSWRCH &20ac a9 11 LDA #&11 # COLOUR 3 &20ae 20 ee ff JSR &ffee ; OSWRCH &20b1 a9 03 LDA #&03 &20b3 20 ee ff JSR &ffee ; OSWRCH &20b6 a9 1f LDA #&1f # TAB(&06, &0f) &20b8 20 ee ff JSR &ffee ; OSWRCH &20bb a9 06 LDA #&06 &20bd 20 ee ff JSR &ffee ; OSWRCH &20c0 a9 0f LDA #&0f &20c2 20 ee ff JSR &ffee ; OSWRCH &20c5 a9 54 LDA #&54 ; "T" # Write "TAKE " &20c7 20 ee ff JSR &ffee ; OSWRCH &20ca a9 41 LDA #&41 ; "A" &20cc 20 ee ff JSR &ffee ; OSWRCH &20cf a9 4b LDA #&4b ; "K" &20d1 20 ee ff JSR &ffee ; OSWRCH &20d4 a9 45 LDA #&45 ; "E" &20d6 20 ee ff JSR &ffee ; OSWRCH &20d9 a9 20 LDA #&20 ; " " &20db 20 ee ff JSR &ffee ; OSWRCH &20de a9 05 LDA #&05 &20e0 20 ee ff JSR &ffee ; OSWRCH &20e3 a9 1a LDA #&1a ; &2a1a = sprite_open_clapperboard_one + &40 &20e5 85 72 STA &72 ; sprite_address_low &20e7 a9 2a LDA #&2a &20e9 85 73 STA &73 ; sprite_address_high &20eb a2 00 LDX #&00 ; calculate_clapperboard_sprite_address_loop &20ed 38 SEC &20ee a5 72 LDA &72 ; sprite_address_low &20f0 ed 15 0c SBC &0c15 ; take &20f3 85 72 STA &72 ; sprite_address_low &20f5 a5 73 LDA &73 ; sprite_address_high &20f7 e9 00 SBC #&00 &20f9 85 73 STA &74 ; sprite_address_high &20fb e8 INX &20fc e0 40 CPX #&40 &20fe d0 ed BNE &20ed ; calculate_clapperboard_sprite_address_loop &2100 a9 2c LDA #&2c &2102 8d e0 2f STA &2fe0 ; screen_x &2105 a9 70 LDA #&70 &2107 8d e1 2f STA &2fe1 ; screen_y &210a 20 42 26 JSR &2642 ; calculate_screen_address &210d 20 b0 26 JSR &26b0 ; plot_sprite # Plot open clapperboard &2110 a9 32 LDA #&32 ; 50 &2112 85 70 STA &70 ; count ; wait_fifty_frames_loop &2114 a9 13 LDA #&13 ; Wait for vertical retrace &2116 20 f4 ff JSR &fff4 ; OSBYTE &2119 c6 70 DEC &70 ; count &211b d0 f7 BNE &2114 ; wait_fifty_frames_loop &211d a9 2c LDA #&2c &211f 8d e0 2f STA &2fe0 ; screen_x &2122 a9 67 LDA #&67 &2124 8d e1 2f STA &2fe1 ; screen_y &2127 a9 1a LDA #&1a ; &291a = sprite_closed_clapperboard_top &2129 85 72 STA &72 ; sprite_address_low &212b a9 29 LDA #&29 &212d 85 73 STA &73 ; sprite_address_high &212f 20 42 26 JSR &2642 ; calculate_screen_address # Plot closed clapperboard top &2132 20 b0 26 JSR &26b0 ; plot_sprite &2135 a9 00 LDA #&00 &2137 8d da 2f STA &2fda ; clapperboard_sound + 0 (channel) &213a a9 00 LDA #&00 &213c 8d db 2f STA &2fdb ; clapperboard_sound + 1 (channel high) &213f a9 f1 LDA #&f1 &2141 8d dc 2f STA &2fdc ; clapperboard_sound + 2 (volume) &2144 a9 ff LDA #&ff &2146 8d dd 2f STA &2fdd ; clapperboard_sound + 3 (volume high) &2149 a9 04 LDA #&04 # High frequency white noise &214b 8d de 2f STA &2fde ; clapperboard_sound + 4 (pitch) &214e a9 00 LDA #&00 &2150 8d df 2f STA &2fdf ; clapperboard_sound + 5 (pitch high) &2153 a9 01 LDA #&01 &2155 8d e0 2f STA &2fe0 ; clapperboard_sound + 6 (duration) &2158 a9 00 LDA #&00 &215a 8d e1 2f STA &2fe1 ; clapperboard_sound + 7 (duration high) &215d a2 da LDX #&da ; &2fda = clapperboard_sound &215f a0 2f LDY #&2f &2161 a9 07 LDA #&07 ; Generate a sound &2163 20 f1 ff JSR &fff1 ; OSWORD # Play sound for clapperboard &2166 a9 1e LDA #&1e ; 30 &2168 85 70 STA &70 ; count ; wait_thirty_frames_loop &216a a9 13 LDA #&13 ; Wait for vertical retrace &216c 20 f4 ff JSR &fff4 ; OSBYTE &216f c6 70 DEC &70 ; count &2171 d0 f7 BNE &216a ; wait_thirty_frames_loop &2173 a9 16 LDA #&16 # Change to MODE 2 &2175 20 ee ff JSR &ffee ; OSWRCH &2178 a9 02 LDA #&02 &217a 20 ee ff JSR &ffee ; OSWRCH &217d a9 00 LDA #&00 &217f 8d 12 0c STA &0c12 ; player_jump_state # Set to zero to indicate player isn't jumping &2182 a9 00 LDA #&00 &2184 8d 13 0c STA &0c13 ; player_x_velocity &2187 a9 00 LDA #&00 &2189 8d 14 0c STA &0c14 ; player_x_fraction &218c 60 RTS ; unused &218d 00 ; unused &218e 59 4f 55 27 52 45 20 46 49 52 45 44 20 21 ; "YOU'RE FIRED !" &219c 0d ; unused # Unused code &219d e3 2f ... &2fe3 &219f a9 01 LDA #&01 &21a1 8d 13 0c STA &0c13 ; player_x_velocity &21a4 a9 1f LDA #&1f # TAB(&00, &17) &21a6 20 ee ff JSR &ffee ; OSWRCH &21a9 a9 00 LDA #&00 &21ab 20 ee ff JSR &ffee ; OSWRCH &21ae a9 17 LDA #&17 &21b0 20 ee ff JSR &ffee ; OSWRCH &21b3 a0 00 LDY #&00 ; unused_write_press_space_bar_to_start_loop &21b5 c8 INY &21b6 b9 d0 21 LDA &21d0,Y ; unused_press_space_bar_to_start_string &21b9 20 ee ff JSR &ffee ; OSWRCH # Write "Press space bar to start" &21bc b9 d0 21 LDA &21d0,Y ; unused_press_space_bar_to_start_string &21bf c9 0d CMP #&0d &21c1 d0 f2 BNE &21b5 ; unused_write_press_space_bar_to_start_loop ; unused_wait_for_space_loop &21c3 a0 ff LDY #&ff &21c5 a2 9d LDX #&9d ; SPACE &21c7 a9 81 LDA #&81 ; Scan for a particular key &21c9 20 f4 ff JSR &fff4 ; OSBYTE &21cc e0 00 CPX #&00 &21ce f0 f3 BEQ &21c3 ; unused_wait_for_space_loop &21d0 60 RTS ; unused_press_space_bar_to_start_string # Unused &21d1 94 9d &21d3 3e 20 20 20 20 20 ; "> " &21d9 83 ; TELETEXT_YELLOW &21da 50 72 65 73 73 ; "Press" &21df 82 ; TELETEXT_GREEN &21e0 73 70 61 63 65 20 62 61 72 ; "space bar" &21e9 83 ; TELETEXT_YELLOW &21ea 74 6f 20 73 74 61 72 74 ; "to start" &21f2 0d ; unused &21f3 00 00 00 00 00 00 00 00 00 ; unused # Unused code &21fc a0 00 LDY #&00 &21fe a9 30 LDA #&30 ; "0" ; unused_initialise_wages_loop &2200 99 3a 2f STA &2f3a,Y ; wages &2203 c8 INY &2204 c0 06 CPY #&06 &2206 d0 f8 BNE &2200 ; unused_initialise_wages_loop &2208 a9 01 LDA #&01 &220a 8d e3 2f STA &2fe3 ; level &220d a9 01 LDA #&01 &220f 8d 13 0c STA &0c13 ; player_x_velocity &2212 a9 1f LDA #&1f ; TAB &2214 20 ee ff JSR &ffee ; OSWRCH &2217 a9 00 LDA #&00 &2219 20 JSR &.... ; add_to_wages &221a a2 04 LDX #&04 ; add_to_wages_loop &221c fe 3a 2f INC &2f3a,X ; wages &221f bd 3a 2f LDA &2f3a,X ; wages &2222 c9 3a CMP #&3a ; "9" + 1 &2224 d0 0a BNE &2230 ; skip_overflow &2226 a9 30 LDA #&30 ; "0" &2228 9d 3a 2f STA &2f3a,X ; wages &222b ca DEX &222c c9 ff CMP #&ff &222e d0 ec BNE &221c ; add_to_wages_loop ; skip_overflow &2230 a9 1f LDA #&1f # TAB(&07, &01) &2232 20 ee ff JSR &ffee ; OSWRCH &2235 a9 07 LDA #&07 &2237 20 ee ff JSR &ffee ; OSWRCH &223a a9 01 LDA #&01 &223c 20 ee ff JSR &ffee ; OSWRCH &223f a9 11 LDA #&11 # COLOUR 3 &2241 20 ee ff JSR &ffee ; OSWRCH &2244 a9 03 LDA #&03 &2246 20 ee ff JSR &ffee ; OSWRCH &2249 a9 11 LDA #&11 # COLOUR 128 + 4 &224b 20 ee ff JSR &ffee ; OSWRCH &224e a9 84 LDA #&84 &2250 20 ee ff JSR &ffee ; OSWRCH &2253 a2 00 LDX #&00 ; write_wages_loop &2255 bd 3a 2f LDA &2f3a,X ; wages &2258 20 ee ff JSR &ffee ; OSWRCH # Write wages &225b e8 INX &225c e0 06 CPX #&06 &225e d0 f5 BNE &2255 ; write_wages_loop &2260 60 RTS ; unused &2261 00 00 00 00 00 00 00 00 00 ; update_rotating_colour_and_enemies &226a ae 20 0c LDX &0c20 ; rotating_colour_state &226d a9 13 LDA #&13 ; define logical colour # Set colour 8 &226f 20 ee ff JSR &ffee ; OSWRCH &2272 a9 08 LDA #&08 &2274 20 ee ff JSR &ffee ; OSWRCH &2277 bd de 2e LDA &2ede,X ; rotating_colour_table # start_screen_colours_table - 1 &227a 20 ee ff JSR &ffee ; OSWRCH &227d a9 00 LDA #&00 &227f 20 ee ff JSR &ffee ; OSWRCH &2282 a9 00 LDA #&00 &2284 20 ee ff JSR &ffee ; OSWRCH &2287 a9 00 LDA #&00 &2289 20 ee ff JSR &ffee ; OSWRCH &228c ee 20 0c INC &0c20 ; rotating_colour_state &228f ad 20 0c LDA &0c20 ; rotating_colour_state &2292 c9 0e CMP #&0e &2294 90 05 BCC &229b ; skip_wraparound &2296 a9 00 LDA #&00 &2298 8d 20 0c STA &0c20 ; rotating_colour_state ; skip_wraparound &229b ad a5 2f LDA &2fa5 ; horizontal_enemy_y &229e c9 00 CMP #&00 &22a0 d0 01 BNE &22a3 ; update_horizontal_enemy &22a2 60 RTS ; update_horizontal_enemy &22a3 a9 13 LDA #&13 ; Wait for vertical retrace &22a5 20 f4 ff JSR &fff4 ; OSBYTE &22a8 a9 5a LDA #&5a ; &275a = sprite_blank &22aa 85 72 STA &72 ; sprite_address_low &22ac a9 27 LDA #&27 &22ae 85 73 STA &73 ; sprite_address_high &22b0 ad a4 2f LDA &2fa4 ; horizontal_enemy_x &22b3 8d e0 2f STA &2fe0 ; screen_x &22b6 ad a5 2f LDA &2fa5 ; horizontal_enemy_y &22b9 8d e1 2f STA &2fe1 ; screen_y &22bc 20 42 26 JSR &2642 ; calculate_screen_address &22bf 20 b0 26 JSR &26b0 ; plot_sprite # Unplot previous horizontal enemy &22c2 ee a4 2f INC &2fa4 ; horizontal_enemy_x &22c5 ad a4 2f LDA &2fa4 ; horizontal_enemy_x &22c8 c9 4b CMP #&4b &22ca d0 05 BNE &22d1 ; skip_wraparound &22cc a9 00 LDA #&00 &22ce 8d a4 2f STA &2fa4 ; horizontal_enemy_x ; skip_wraparound &22d1 ad 04 0c LDA &0c04 ; horizontal_enemy_sprite_address_low &22d4 85 72 STA &72 ; sprite_address_low &22d6 ad 05 0c LDA &0c05 ; horizontal_enemy_sprite_address_high &22d9 85 73 STA &73 ; sprite_address_high &22db ad a4 2f LDA &2fa4 ; horizontal_enemy_x &22de 8d e0 2f STA &2fe0 ; screen_x &22e1 ad a5 2f LDA &2fa5 ; horizontal_enemy_y &22e4 8d e1 2f STA &2fe1 ; screen_y &22e7 20 42 26 JSR &2642 ; calculate_screen_address &22ea 20 b0 26 JSR &26b0 ; plot_sprite # Plot horizontal enemy &22ed a9 13 LDA #&13 ; Wait for vertical retrace &22ef 20 f4 ff JSR &fff4 ; OSBYTE &22f2 20 ff 22 JSR &22ff ; update_vertical_enemies &22f5 60 RTS ; unused &22f6 00 00 00 00 00 00 00 00 00 ; update_vertical_enemies &22ff a2 00 LDX #&00 &2301 ad a6 2f LDA &2fa6 ; number_of_vertical_enemies &2304 8d ea 2f STA &2fea ; enemies_remaining_to_update &2307 ad a6 2f LDA &2fa6 ; number_of_vertical_enemies &230a c9 00 CMP #&00 &230c d0 01 BNE &230f ; update_vertical_enemies_loop &230e 60 RTS ; update_vertical_enemies_loop &230f bd a7 2f LDA &2fa7,X ; vertical_enemies_x &2312 8d e0 2f STA &2fe0 ; screen_x &2315 bd a8 2f LDA &2fa8,X ; vertical_enemies_y &2318 8d e1 2f STA &2fe1 ; screen_y &231b bc a9 2f LDY &2fa9,X ; vertical_enemies_state &231e 38 SEC &231f ad e1 2f LDA &2fe1 ; screen_y &2322 f9 ed 2e SBC &2eed,Y ; jump_offsets_table &2325 8d e1 2f STA &2fe1 ; screen_y &2328 8e e4 2f STX &2fe4 ; vertical_enemy_offset &232b 20 42 26 JSR &2642 ; calculate_screen_address &232e a9 5a LDA #&5a ; &275a = sprite_blank &2330 85 72 STA &72 ; sprite_address_low &2332 a9 27 LDA #&27 &2334 85 73 STA &73 ; sprite_address_high &2336 20 b0 26 JSR &26b0 ; plot_sprite # Unplot previous vertical enemy &2339 ae e4 2f LDX &2fe4 ; vertical_enemy_offset &233c fe a9 2f INC &2fa9,X ; vertical_enemies_state &233f bd a9 2f LDA &2fa9,X ; vertical_enemies_state &2342 c9 20 CMP #&20 &2344 d0 05 BNE &234b ; skip_wraparound &2346 a9 01 LDA #&01 &2348 9d a9 2f STA &2fa9,X ; vertical_enemies_state ; skip_wraparound &234b ad 02 0c LDA &0c02 ; vertical_enemy_sprite_address_low &234e 85 72 STA &72 ; sprite_address_low &2350 ad 03 0c LDA &0c03 ; vertical_enemy_sprite_address_high &2353 85 73 STA &73 ; sprite_address_high &2355 bd a7 2f LDA &2fa7,X ; vertical_enemies_x &2358 8d e0 2f STA &2fe0 ; screen_x &235b bd a8 2f LDA &2fa8,X ; vertical_enemies_y &235e 8d e1 2f STA &2fe1 ; screen_y &2361 bc a9 2f LDY &2fa9,X ; vertical_enemies_state &2364 38 SEC &2365 ad e1 2f LDA &2fe1 ; screen_y &2368 f9 ed 2e SBC &2eed,Y ; jump_offsets_table &236b 8d e1 2f STA &2fe1 ; screen_y &236e 8e e4 2f STX &2fe4 ; vertical_enemy_offset &2371 20 42 26 JSR &2642 ; calculate_screen_address &2374 20 b0 26 JSR &26b0 ; plot_sprite # Plot vertical enemy &2377 ae e4 2f LDX &2fe4 ; vertical_enemy_offset &237a e8 INX # Move to next vertical enemy &237b e8 INX &237c e8 INX &237d e0 0f CPX #&0f &237f d0 01 BNE &2382 ; consider_next_enemy &2381 60 RTS ; consider_next_enemy &2382 ce ea 2f DEC &2fea ; enemies_remaining_to_update &2385 d0 88 BNE &230f ; update_vertical_enemies_loop &2387 60 RTS ; unused &2388 2f d0 84 60 00 00 00 00 00 00 ; initialise_level &2392 a9 16 LDA #&16 # Change to MODE 2 &2394 20 ee ff JSR &ffee ; OSWRCH &2397 a9 02 LDA #&02 &2399 20 ee ff JSR &ffee ; OSWRCH &239c a9 00 LDA #&00 &239e 8d 10 0c STA &0c10 ; player_x &23a1 a9 38 LDA #&38 &23a3 8d 11 0c STA &0c11 ; player_ground_y # Player starts on first ground &23a6 a9 00 LDA #&00 &23a8 8d 12 0c STA &0c12 ; player_jump_state # Set to zero to indicate player isn't jumping &23ab a9 00 LDA #&00 &23ad 8d 13 0c STA &0c13 ; player_x_velocity &23b0 a9 00 LDA #&00 &23b2 8d 14 0c STA &0c14 ; player_x_fraction ; plot_box &23b5 a9 11 LDA #&11 # COLOUR 128 + 4 &23b7 20 ee ff JSR &ffee ; OSWRCH &23ba a9 84 LDA #&84 &23bc 20 ee ff JSR &ffee ; OSWRCH &23bf a2 00 LDX #&00 ; plot_box_x_loop &23c1 a0 00 LDY #&00 ; plot_box_y_loop &23c3 a9 1f LDA #&1f # TAB(X, Y) &23c5 20 ee ff JSR &ffee ; OSWRCH &23c8 8a TXA &23c9 20 ee ff JSR &ffee ; OSWRCH &23cc 98 TYA &23cd 20 ee ff JSR &ffee ; OSWRCH &23d0 a9 20 LDA #&20 ; " " &23d2 20 ee ff JSR &ffee ; OSWRCH # Plot status box &23d5 c8 INY &23d6 c0 03 CPY #&03 &23d8 d0 e9 BNE &23c3 ; plot_box_y_loop &23da e8 INX &23db e0 14 CPX #&14 &23dd d0 e2 BNE &23c1 ; plot_box_x_loop &23df a2 0f LDX #&0f &23e1 a9 1f LDA #&1f # TAB(&01, &01) &23e3 20 ee ff JSR &ffee ; OSWRCH &23e6 a9 01 LDA #&01 &23e8 20 ee ff JSR &ffee ; OSWRCH &23eb a9 01 LDA #&01 &23ed 20 ee ff JSR &ffee ; OSWRCH &23f0 a9 57 LDA #&57 ; "W" # Write "WAGES " &23f2 20 ee ff JSR &ffee ; OSWRCH &23f5 a9 41 LDA #&41 ; "A" &23f7 20 ee ff JSR &ffee ; OSWRCH &23fa a9 47 LDA #&47 ; "G" &23fc 20 ee ff JSR &ffee ; OSWRCH &23ff a9 45 LDA #&45 ; "E" &2401 20 ee ff JSR &ffee ; OSWRCH &2404 a9 53 LDA #&53 ; "S" &2406 20 ee ff JSR &ffee ; OSWRCH &2409 a9 20 LDA #&20 ; " " &240b 20 ee ff JSR &ffee ; OSWRCH &240e a9 11 LDA #&11 # COLOUR 3 &2410 20 ee ff JSR &ffee ; OSWRCH &2413 a9 03 LDA #&03 &2415 20 ee ff JSR &ffee ; OSWRCH &2418 a2 00 LDX #&00 ; write_wages_loop &241a bd 3a 2f LDA &2f3a,X ; wages &241d 20 ee ff JSR &ffee ; OSWRCH # Write wages &2420 e8 INX &2421 e0 06 CPX #&06 &2423 d0 f5 BNE &241a ; write_wages_loop &2425 a9 11 LDA #&11 ; COLOUR &2427 20 ee ff JSR &ffee ; OSWRCH # Second byte will be written in consider_gaining_extra_take at &159c &242a ad e3 2f LDA &2fe3 ; level &242d 8d e4 2f STA &2fe4 ; tmp ; calculate_level_type_loop # Calculate ((level - 1) MOD 3) + 1 &2430 ad e4 2f LDA &2fe4 ; tmp &2433 c9 01 CMP #&01 &2435 f0 1d BEQ &2454 ; set_level_type &2437 ad e4 2f LDA &2fe4 ; tmp &243a c9 02 CMP #&02 &243c f0 16 BEQ &2454 ; set_level_type &243e ad e4 2f LDA &2fe4 ; tmp &2441 c9 03 CMP #&03 &2443 f0 0f BEQ &2454 ; set_level_type &2445 38 SEC &2446 ad e4 2f LDA &2fe4 ; tmp &2449 e9 03 SBC #&03 &244b 8d e4 2f STA &2fe4 ; tmp &244e a9 01 LDA #&01 &2450 c9 01 CMP #&01 &2452 f0 dc BEQ &2430 ; calculate_level_type_loop # Always branches ; set_level_type &2454 ad e4 2f LDA &2fe4 ; tmp &2457 8d ed 2f STA &2fed ; level_type &245a ad e4 2f LDA &2fe4 ; tmp &245d aa TAX &245e bd 36 2f LDA &2f36,X ; ground_colours_table - 1 &2461 20 97 15 JSR &1597 ; consider_gaining_extra_take # Returns A = level ground colour &2464 20 ee ff JSR &ffee ; OSWRCH # First byte was written in consider_gaining_extra_take at &15a4 ; plot_ground &2467 a2 09 LDX #&09 &2469 a0 04 LDY #&04 ; plot_ground_y_loop &246b a9 1f LDA #&1f # TAB(&00, X) &246d 20 ee ff JSR &ffee ; OSWRCH &2470 a9 00 LDA #&00 &2472 20 ee ff JSR &ffee ; OSWRCH &2475 8a TXA &2476 20 ee ff JSR &ffee ; OSWRCH &2479 a9 14 LDA #&14 &247b 8d e4 2f STA &2fe4 ; count ; plot_ground_x_loop &247e a9 fa LDA #&fa ; CHARACTER_GROUND # Defined at line 190 of DDDenis1 &2480 20 ee ff JSR &ffee ; OSWRCH # Plot ground &2483 ce e4 2f DEC &2fe4 ; count &2486 d0 f6 BNE &247e ; plot_ground_x_loop &2488 18 CLC &2489 8a TXA &248a 69 07 ADC #&07 # Move to next ground &248c aa TAX &248d 88 DEY &248e c0 00 CPY #&00 &2490 d0 d9 BNE &246b ; plot_ground_y_loop &2492 a9 14 LDA #&14 ; restore default logical colours &2494 20 ee ff JSR &ffee ; OSWRCH &2497 a9 00 LDA #&00 &2499 8d e4 2f STA &2fe4 ; level_set &249c ad e3 2f LDA &2fe3 ; level &249f 8d e5 2f STA &2fe5 ; tmp ; calculate_level_set_loop # Calculate (level - 1) DIV 3 &24a2 ad e5 2f LDA &2fe5 ; tmp &24a5 c9 01 CMP #&01 &24a7 f0 20 BEQ &24c9 ; set_level_set &24a9 ad e5 2f LDA &2fe5 ; tmp &24ac c9 02 CMP #&02 &24ae f0 19 BEQ &24c9 ; set_level_set &24b0 ad e5 2f LDA &2fe5 ; tmp &24b3 c9 03 CMP #&03 &24b5 f0 12 BEQ &24c9 ; set_level_set &24b7 38 SEC &24b8 ad e5 2f LDA &2fe5 ; tmp &24bb e9 03 SBC #&03 &24bd 8d e5 2f STA &2fe5 ; tmp &24c0 ee e4 2f INC &2fe4 ; level_set &24c3 a9 01 LDA #&01 &24c5 c9 01 CMP #&01 &24c7 f0 d9 BEQ &24a2 ; calculate_level_set_loop # Always branches ; set_level_set &24c9 ae e4 2f LDX &2fe4 ; level_set &24cc 8a TXA ; level_set &24cd 18 CLC &24ce 6d e4 2f ADC &2fe4 ; level_set &24d1 aa TAX ; level_set_times_two &24d2 8a TXA ; level_set_times_two &24d3 18 CLC &24d4 6d e4 2f ADC &2fe4 ; level_set &24d7 aa TAX ; level_set_times_three &24d8 8e e4 2f STX &2fe4 ; level_set_times_three ; plot_obstacles &24db bd 40 2f LDA &2f40,X ; level_set_data # First byte of set data specifies number of obstacles &24de 8d e9 2f STA &2fe9 ; obstacles_remaining &24e1 ad e3 2f LDA &2fe3 ; level &24e4 8d ec 2f STA &2fec ; position_table_offset &24e7 a9 01 LDA #&01 &24e9 8d eb 2f STA &2feb ; sprite_table_offset &24ec a9 38 LDA #&38 &24ee 8d ea 2f STA &2fea ; ground_y &24f1 a9 01 LDA #&01 # Unnecessary code &24f3 8d eb 2f STA &2feb ; sprite_table_offset # ; plot_obstacles_loop &24f6 ad ea 2f LDA &2fea ; ground_y &24f9 8d e1 2f STA &2fe1 ; screen_y &24fc ae ec 2f LDX &2fec ; position_table_offset &24ff bd b6 2e LDA &2eb6,X ; x_positions_table &2502 ee ec 2f INC &2fec ; position_table_offset &2505 ad ec 2f LDA &2fec ; position_table_offset &2508 c9 28 CMP #&28 &250a d0 05 BNE &2511 ; skip_wraparound &250c a9 00 LDA #&00 &250e 8d ec 2f STA &2fec ; position_table_offset ; skip_wraparound &2511 bd b6 2e LDA &2eb6,X ; x_positions_table &2514 8d e0 2f STA &2fe0 ; screen_x &2517 a9 03 LDA #&03 ; &2f03 = level_type_data_addresses_table - &c &2519 85 70 STA &70 ; level_type_data_addresses_address_low &251b a9 2f LDA #&2f &251d 85 71 STA &71 ; level_type_data_addresses_address_high &251f ae ed 2f LDX &2fed ; level_type ; calculate_level_type_data_address &2522 18 CLC &2523 a5 70 LDA &70 ; level_type_data_addresses_address_low &2525 69 0c ADC #&0c &2527 85 70 STA &70 ; level_type_data_addresses_address_low &2529 a5 71 LDA &71 ; level_type_data_addresses_address_high &252b 69 00 ADC #&00 &252d 85 71 STA &71 ; level_type_data_addresses_address_high &252f ca DEX &2530 d0 f0 BNE &2522 ; calculate_level_type_data_address &2532 a0 00 LDY #&00 &2534 b1 70 LDA (&70),Y ; level_type_data_addresses_address # First and second bytes specify player sprite &2536 8d 00 0c STA &0c00 ; player_sprite_address_low &2539 a0 01 LDY #&01 &253b b1 70 LDA (&70),Y ; level_type_data_addresses_address &253d 8d 01 0c STA &0c01 ; player_sprite_address_high &2540 a0 0a LDY #&0a # Eleventh and twelfth bytes specify vertical enemy sprite &2542 b1 70 LDA (&70),Y ; level_type_data_addresses_address &2544 8d 02 0c STA &0c02 ; vertical_enemy_sprite_address_low &2547 a0 0b LDY #&0b &2549 b1 70 LDA (&70),Y ; level_type_data_addresses_address &254b 8d 03 0c STA &0c03 ; vertical_enemy_sprite_address_high &254e a0 08 LDY #&08 # Ninth and tenth bytes specify horizontal enemy sprite &2550 b1 70 LDA (&70),Y ; level_type_data_addresses_address &2552 8d 04 0c STA &0c04 ; horizontal_enemy_sprite_address_low &2555 a0 09 LDY #&09 &2557 b1 70 LDA (&70),Y ; level_type_data_addresses_address &2559 8d 05 0c STA &0c05 ; horizontal_enemy_sprite_address_high &255c 18 CLC &255d a5 70 LDA &70 ; level_type_data_addresses_address_low &255f 6d eb 2f ADC &2feb ; sprite_table_offset # Third to eighth bytes specify three obstacle sprites &2562 85 70 STA &70 ; level_type_data_addresses_address_low &2564 a5 71 LDA &71 ; level_type_data_addresses_address_high &2566 69 00 ADC #&00 &2568 85 71 STA &71 ; level_type_data_addresses_address_high &256a 18 CLC &256b a5 70 LDA &70 ; level_type_data_addresses_address_low &256d 6d eb 2f ADC &2feb ; sprite_table_offset &2570 85 70 STA &70 ; level_type_data_addresses_address_low &2572 a5 71 LDA &71 ; level_type_data_addresses_address_high &2574 69 00 ADC #&00 &2576 85 71 STA &71 ; level_type_data_addresses_address_high &2578 a0 00 LDY #&00 &257a b1 70 LDA (&70),Y ; level_type_data_addresses_address &257c 85 72 STA &72 ; sprite_address_low &257e a0 01 LDY #&01 &2580 b1 70 LDA (&70),Y ; level_type_data_addresses_address &2582 85 73 STA &73 ; sprite_address_high &2584 20 42 26 JSR &2642 ; calculate_screen_address &2587 20 b0 26 JSR &26b0 ; plot_sprite # Plot obstacle &258a ee eb 2f INC &2feb ; sprite_table_offset &258d ad eb 2f LDA &2feb ; sprite_table_offset &2590 c9 04 CMP #&04 &2592 d0 05 BNE &2599 ; skip_wraparound &2594 a9 01 LDA #&01 &2596 8d eb 2f STA &2feb ; sprite_table_offset ; skip_wraparound &2599 18 CLC &259a ad ea 2f LDA &2fea ; ground_y &259d 69 38 ADC #&38 # Move down one ground &259f 8d ea 2f STA &2fea ; ground_y &25a2 ad ea 2f LDA &2fea ; ground_y &25a5 c9 18 CMP #&18 &25a7 d0 05 BNE &25ae ; skip_wraparound &25a9 a9 38 LDA #&38 &25ab 8d ea 2f STA &2fea ; ground_y ; skip_wraparound &25ae ce e9 2f DEC &2fe9 ; obstacles_remaining &25b1 f0 03 BEQ &25b6 ; consider_initialising_vertical_enemies &25b3 4c f6 24 JMP &24f6 ; plot_obstacles_loop ; consider_initialising_vertical_enemies &25b6 a9 38 LDA #&38 &25b8 8d e5 2f STA &2fe5 ; vertical_enemy_y &25bb ae e4 2f LDX &2fe4 ; level_set_times_three &25be e8 INX &25bf e8 INX &25c0 bd 40 2f LDA &2f40,X ; level_set_data # Third byte of level set data &25c3 8d a6 2f STA &2fa6 ; number_of_vertical_enemies &25c6 ad a6 2f LDA &2fa6 ; number_of_vertical_enemies &25c9 c9 00 CMP #&00 &25cb f0 52 BEQ &261f ; skip_initialising_vertical_enemies ; initialise_vertical_enemies &25cd a2 00 LDX #&00 &25cf ad a6 2f LDA &2fa6 ; number_of_vertical_enemies &25d2 8d e6 2f STA &2fe6 ; vertical_enemies_remaining ; initialise_vertical_enemies_loop &25d5 ac ec 2f LDY &2fec ; position_table_offset &25d8 b9 b6 2e LDA &2eb6,Y ; x_positions_table &25db ee ec 2f INC &2fec ; position_table_offset &25de 9d a7 2f STA &2fa7,X ; vertical_enemies_x &25e1 e8 INX ; +1 &25e2 ad ec 2f LDA &2fec ; position_table_offset &25e5 c9 28 CMP #&28 &25e7 d0 05 BNE &25ee ; skip_wraparound &25e9 a9 00 LDA #&00 &25eb 8d ec 2f STA &2fec ; position_table_offset ; skip_wraparound &25ee ad e5 2f LDA &2fe5 ; vertical_enemy_y &25f1 9d a7 2f STA &2fa7,X ; vertical_enemies_y - 1 &25f4 e8 INX ; +2 &25f5 18 CLC &25f6 ad e5 2f LDA &2fe5 ; vertical_enemy_y &25f9 69 38 ADC #&38 # Move down one ground &25fb 8d e5 2f STA &2fe5 ; vertical_enemy_y &25fe ad e5 2f LDA &2fe5 ; vertical_enemy_y &2601 c9 18 CMP #&18 &2603 d0 05 BNE &260a ; skip_wraparound &2605 a9 38 LDA #&38 &2607 8d e5 2f STA &2fe5 ; vertical_enemy_y ; skip_wraparound &260a ac ec 2f LDY &2fec ; position_table_offset &260d b9 b6 2e LDA &2eb6,Y ; x_positions_table &2610 9d a7 2f STA &2fa7,X ; vertical_enemies_state - 2 # state = x / 4, i.e. between &02 and &12 &2613 5e a7 2f LSR &2fa7,X ; vertical_enemies_state - 2 &2616 5e a7 2f LSR &2fa7,X ; vertical_enemies_state - 2 &2619 e8 INX # Move to next vertical enemy &261a ce e6 2f DEC &2fe6 ; vertical_enemies_remaining &261d d0 b6 BNE &25d5 ; initialise_vertical_enemies_loop ; skip_initialising_vertical_enemies &261f ae e4 2f LDX &2fe4 ; level_set_times_three &2622 e8 INX &2623 bd 40 2f LDA &2f40,X ; level_set_data # Second byte of level set data &2626 8d a4 2f STA &2fa4 ; horizontal_enemy_x &2629 8d a5 2f STA &2fa5 ; horizontal_enemy_y &262c bd 40 2f LDA &2f40,X ; level_set_data &262f c9 00 CMP #&00 &2631 f0 0a BEQ &263d ; skip_initialising_horizontal_enemy ; initialise_horizontal_enemy &2633 a9 4a LDA #&4a &2635 8d a4 2f STA &2fa4 ; horizontal_enemy_x &2638 a9 70 LDA #&70 &263a 8d a5 2f STA &2fa5 ; horizontal_enemy_y ; skip_initialising_horizontal_enemy &263d 60 RTS ; unused &263e 00 00 00 00 ; calculate_screen_address &2642 a9 00 LDA #&00 ; &3000 = screen_memory &2644 85 70 STA &70 ; screen_address_low &2646 a9 30 LDA #&30 &2648 85 71 STA &71 ; screen_address_high &264a a2 02 LDX #&02 ; add_columns_loop &264c 18 CLC &264d a5 70 LDA &70 ; screen_address_low &264f 6d e0 2f ADC &2fe0 ; screen_x # screen_address += screen_x * 8 &2652 85 70 STA &70 ; screen_address_low &2654 a5 71 LDA &71 ; screen_address_high &2656 69 00 ADC #&00 &2658 85 71 STA &71 ; screen_address_high &265a 18 CLC &265b a5 70 LDA &70 ; screen_address_low &265d 6d e0 2f ADC &2fe0 ; screen_x &2660 85 70 STA &70 ; screen_address_low &2662 a5 71 LDA &71 ; screen_address_high &2664 69 00 ADC #&00 &2666 85 71 STA &71 ; screen_address_high &2668 18 CLC &2669 a5 70 LDA &70 ; screen_address_low &266b 6d e0 2f ADC &2fe0 ; screen_x &266e 85 70 STA &70 ; screen_address_low &2670 a5 71 LDA &71 ; screen_address_high &2672 69 00 ADC #&00 &2674 85 71 STA &71 ; screen_address_high &2676 18 CLC &2677 a5 70 LDA &70 ; screen_address_low &2679 6d e0 2f ADC &2fe0 ; screen_x &267c 85 70 STA &70 ; screen_address_low &267e a5 71 LDA &71 ; screen_address_high &2680 69 00 ADC #&00 &2682 85 71 STA &71 ; screen_address_high &2684 ca DEX &2685 d0 c5 BNE &264c ; add_columns_loop &2687 ad e1 2f LDA &2fe1 ; screen_y &268a 29 07 AND #&07 &268c 8d e2 2f STA &2fe2 ; row_in_group &268f 4e e1 2f LSR &2fe1 ; screen_y &2692 4e e1 2f LSR &2fe1 ; screen_y &2695 4e e1 2f LSR &2fe1 ; screen_y &2698 ae e1 2f LDX &2fe1 ; screen_y &269b e0 00 CPX #&00 &269d f0 10 BEQ &26af ; skip_adding_groups ; add_groups_loop &269f 18 CLC &26a0 a5 70 LDA &70 ; screen_address_low &26a2 69 80 ADC #&80 &26a4 85 70 STA &70 ; screen_address_low &26a6 a5 71 LDA &71 ; screen_address_high &26a8 69 02 ADC #&02 &26aa 85 71 STA &71 ; screen_address_high &26ac ca DEX &26ad d0 f0 BNE &269f ; add_groups_loop ; skip_adding_groups &26af 60 RTS ; plot_sprite &26b0 a9 00 LDA #&00 &26b2 8d dd 2f STA &2fdd ; sprite_offset &26b5 8d de 2f STA &2fde ; rows_plotted &26b8 18 CLC &26b9 a5 70 LDA &70 ; screen_address_low &26bb 6d e2 2f ADC &2fe2 ; row_in_group &26be 85 70 STA &70 ; screen_address_low &26c0 a5 71 LDA &71 ; screen_address_high &26c2 69 00 ADC #&00 &26c4 85 71 STA &71 ; screen_address_high ; plot_sprite_row_loop &26c6 ac dd 2f LDY &2fdd ; sprite_offset &26c9 b1 72 LDA (&72),Y ; sprite_address &26cb a0 00 LDY #&00 &26cd 91 70 STA (&70),Y ; screen_address &26cf ee dd 2f INC &2fdd ; sprite_offset &26d2 ac dd 2f LDY &2fdd ; sprite_offset &26d5 b1 72 LDA (&72),Y ; sprite_address &26d7 a0 08 LDY #&08 &26d9 91 70 STA (&70),Y ; screen_address &26db ee dd 2f INC &2fdd ; sprite_offset &26de ac dd 2f LDY &2fdd ; sprite_offset &26e1 b1 72 LDA (&72),Y ; sprite_address &26e3 a0 10 LDY #&10 &26e5 91 70 STA (&70),Y ; screen_address &26e7 ee dd 2f INC &2fdd ; sprite_offset &26ea ac dd 2f LDY &2fdd ; sprite_offset &26ed b1 72 LDA (&72),Y ; sprite_address &26ef a0 18 LDY #&18 &26f1 91 70 STA (&70),Y ; screen_address &26f3 ee dd 2f INC &2fdd ; sprite_offset &26f6 ee e2 2f INC &2fe2 ; row_in_group &26f9 a0 20 LDY #&20 &26fb b1 70 LDA (&70),Y ; screen_address &26fd 8d dc 2f STA &2fdc ; right_edge &2700 18 CLC &2701 a5 70 LDA &70 ; screen_address_low &2703 69 01 ADC #&01 # Move down a row &2705 85 70 STA &70 ; screen_address_low &2707 a5 71 LDA &71 ; screen_address_high &2709 69 00 ADC #&00 &270b 85 71 STA &71 ; screen_address_high &270d ee de 2f INC &2fde ; rows_plotted &2710 a9 10 LDA #&10 &2712 cd de 2f CMP &2fde ; rows_plotted &2715 d0 06 BNE &271d ; not_end_of_sprite &2717 a9 01 LDA #&01 &2719 c9 01 CMP #&01 &271b f0 1f BEQ &273c ; leave_after_storing_bottom_edge # Always branches ; not_end_of_sprite &271d ad e2 2f LDA &2fe2 ; row_in_group &2720 c9 08 CMP #&08 &2722 d0 a2 BNE &26c6 ; plot_sprite_row_loop ; next_group &2724 18 CLC &2725 a5 70 LDA &70 ; screen_address_low &2727 69 78 ADC #&78 # Move down a group &2729 85 70 STA &70 ; screen_address_low &272b a5 71 LDA &71 ; screen_address_high &272d 69 02 ADC #&02 &272f 85 71 STA &71 ; screen_address_high &2731 a9 00 LDA #&00 &2733 8d e2 2f STA &2fe2 ; row_in_group &2736 a9 01 LDA #&01 &2738 c9 01 CMP #&01 &273a f0 8a BEQ &26c6 ; plot_sprite_row_loop # Always branches ; leave_after_storing_bottom_edge &273c a0 00 LDY #&00 &273e b1 70 LDA (&70),Y ; screen_address &2740 8d d8 2f STA &2fd8 ; bottom_edge &2743 a0 08 LDY #&08 &2745 b1 70 LDA (&70),Y ; screen_address &2747 8d d9 2f STA &2fd9 ; bottom_edge + 1 # Unused variable &274a a0 10 LDY #&10 &274c b1 70 LDA (&70),Y ; screen_address &274e 8d da 2f STA &2fda ; bottom_edge + 2 # Unused variable &2751 a0 18 LDY #&18 &2753 b1 70 LDA (&70),Y ; screen_address &2755 8d db 2f STA &2fdb ; bottom_edge + 3 &2758 60 RTS ; unused &2759 3d ; sprite_blank &275a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &276a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &277a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &278a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_explosion &279a 01 01 00 00 00 01 02 02 00 07 02 02 00 07 02 00 &27aa 00 07 02 00 01 1a 0b 02 00 07 25 02 01 1a 0b 02 &27ba 01 1e 0b 02 07 34 2d 02 07 35 2d 03 07 35 3a 0b &27ca 01 1e 2d 03 00 07 0b 02 00 01 03 00 00 00 00 00 ; sprite_balloon &27da 00 0f 0c 00 15 0f 0c 08 15 0e 0c 0c 2f 0e 0c 0c &27ea 2f 0e 0c 0c 2f 0e 0c 0c 2f 0e 0c 0c 2f 0e 0c 0c &27fa 2f 0f 0c 0c 15 0f 0f 08 15 0f 0f 08 00 3f 3f 00 &280a 00 04 08 00 00 04 08 00 00 00 2a 00 00 00 00 00 ; unused &281a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &282a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &283a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &284a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; sprite_dead_player_two &285a 00 00 00 00 00 00 03 02 03 00 0c 00 0c 00 0c 00 &286a 0c 00 0c 00 04 08 0c 00 00 0f 2d 00 11 0c 0c 22 &287a 0a 0c 0c 05 0f 0c 0c 0f 05 0e 0d 0a 00 0c 0c 00 &288a 00 13 33 00 00 13 33 22 00 03 36 00 00 03 03 00 ; sprite_dead_player_one &289a 00 00 00 00 01 03 00 00 00 0c 00 03 00 0c 00 0c &28aa 00 0c 00 0c 00 0c 04 08 22 0f 2d 11 0a 0c 0c 05 &28ba 0a 0c 0c 05 0f 0c 0c 0f 05 0e 0d 0a 00 0c 0c 00 &28ca 00 13 33 00 00 13 33 22 00 03 32 00 00 03 03 00 ; unused &28da 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f &28ea 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f &28fa 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f &290a 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f ; sprite_closed_clapperboard_top &291a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &292a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &293a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &294a 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 00 00 00 00 ; sprite_open_clapperboard_three &295a 00 00 00 0f 00 00 00 0f 00 00 00 0f 00 00 00 0f &296a 00 00 00 0f 00 00 00 0f 00 00 00 00 0f 0f 0f 0f &297a 0f 03 03 0f 0b 07 0b 07 0f 0f 0b 07 0f 0b 03 0f &298a 0f 0f 0b 07 0b 07 0b 07 0f 03 03 0f 0f 0f 0f 0f ; sprite_open_clapperboard_two &299a 00 00 00 0f 00 00 00 0f 00 00 00 0f 00 00 00 0f &29aa 00 00 00 0f 00 00 00 0f 00 00 00 00 0f 0f 0f 0f &29ba 0f 03 03 0f 0b 03 03 07 0b 07 0b 07 0f 0f 03 0f &29ca 0f 0b 07 0f 0f 03 03 07 0b 03 03 07 0f 0f 0f 0f ; sprite_open_clapperboard_one &29da 00 00 00 0f 00 00 00 0f 00 00 00 0f 00 00 00 0f &29ea 00 00 00 0f 00 00 00 0f 00 00 00 00 0f 0f 0f 0f &29fa 0f 0b 07 0f 0f 03 07 0f 0f 03 07 0f 0f 0b 07 0f &2a0a 0f 0b 07 0f 0f 03 03 0f 0f 03 03 0f 0f 0f 0f 0f ; sprite_snow_vertical_enemy # Skull &2a1a 00 3f 3f 00 15 3f 3f 2a 15 3f 3f 3f 3f 3f 3f 3f &2a2a 6a 95 6a 95 6a 95 6a 95 3f 95 6a 3f 15 3f 3f 2a &2a3a 15 2a 15 2a 15 2a 15 2a 15 3f 3f 2a 01 2b 2b 2a &2a4a 01 03 03 02 15 17 17 02 15 3f 3f 2a 00 3f 3f 00 ; sprite_snow_horizontal_enemy # Snowball &2a5a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2a6a 00 3c 3c 00 15 3f 3c 28 15 3f 3e 28 3f 3f 3e 3c &2a7a 3f 3f 3e 3c 3f 3f 3e 3c 3f 3f 3e 3c 3f 3f 3e 3c &2a8a 3f 3f 3e 3c 15 3f 3e 28 15 3f 3c 28 00 3c 3c 00 ; sprite_snow_obstacle_three # Snowman &2a9a 00 0f 0c 00 00 0f 0c 00 0f 0f 0c 0c 15 35 2a 2a &2aaa 15 35 2a 2a 15 3f 3f 2a 00 2b 17 00 15 3f 3f 2a &2aba 15 3a 15 2a 3f 3a 15 3f 3f 3f 3f 3f 3f 3a 15 3f &2aca 3f 3a 15 3f 15 3f 3f 2a 15 3f 3f 2a 15 3f 3f 2a ; sprite_snow_obstacle_two # Tree &2ada 00 04 2a 00 00 04 2a 00 00 04 08 00 00 2e 2e 00 &2aea 00 2e 1d 00 00 0c 1d 00 00 0c 0c 00 00 0c 0c 00 &2afa 15 0c 0c 2a 15 09 0c 2a 04 09 06 08 04 09 06 08 &2b0a 04 01 02 08 00 01 02 00 15 01 02 15 3f 2b 03 15 ; sprite_snow_obstacle_one # Cabin &2b1a 00 15 2a 00 00 15 02 00 00 2b 17 00 00 03 17 00 &2b2a 15 03 03 2a 15 03 03 02 2b 03 03 03 03 03 03 03 &2b3a 0f 0f 0f 0f 03 03 03 03 0f 0f 0f 0f 02 01 00 01 &2b4a 0a 05 00 05 02 01 00 2b 0a 05 0f 3f 2a 01 3f 3f ; sprite_snow_player # Player on skis &2b5a 03 03 00 00 03 12 00 00 03 33 22 00 03 33 00 00 &2b6a 04 0c 00 00 04 0e 00 00 04 0e 00 00 15 0e 00 00 &2b7a 3f 1f 3f 00 15 0c 00 00 00 04 08 00 00 04 08 00 &2b8a 00 0c 00 00 00 03 02 00 2a 03 02 15 15 3f 3f 2a ; sprite_sea_vertical_enemy # Red ball &2b9a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2baa 00 03 03 00 01 17 03 02 01 2b 03 02 03 2b 03 03 &2bba 03 2b 03 03 03 03 03 03 03 03 03 03 03 03 03 03 &2bca 03 03 03 03 01 03 03 02 01 03 03 02 00 03 03 00 ; sprite_sea_horizontal_enemy # Yacht &2bda 00 00 00 00 00 08 0a 00 04 04 0a 00 00 00 0a 00 &2bea 00 00 1e 00 00 15 14 00 00 15 14 00 00 3f 14 28 &2bfa 00 3f 14 28 15 3f 14 3c 15 3f 14 3c 00 00 0a 00 &2c0a 3f 3f 3f 3f 03 03 03 03 15 3f 3f 2a 00 3f 3f 00 ; sprite_sea_obstacle_three # Whale &2c1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2c2a 15 15 00 00 2a 2a 2a 00 00 2a 00 00 00 2a 00 00 &2c3a 00 00 00 00 14 3c 28 14 3c 3c 3c 14 3d 34 3c 3c &2c4a 3d 3e 3c 3c 3c 3c 3c 3c 00 14 3c 3c 3c 3c 3c 28 ; sprite_sea_obstacle_two # Castle &2c5a 00 00 00 00 00 00 00 00 00 2a 2a 28 00 2a 2a 28 &2c6a 00 3f 3e 28 00 3f 3e 28 00 3f 3e 28 00 3f 3e 28 &2c7a 00 3f 3e 28 00 3f 3e 28 00 2a 3e 28 00 2a 3e 28 &2c8a 00 2a 3e 08 05 0f 0c 08 0f 0e 0c 0c 0f 0c 0c 0c ; sprite_sea_obstacle_one # Lighthouse &2c9a 00 3f 0f 00 00 6a 85 00 00 6a 85 00 00 6a 85 00 &2caa 00 3f 0f 00 00 3c 30 00 00 3c 30 00 00 3f 0f 00 &2cba 00 3f 0f 00 00 3c 30 00 00 3c 30 00 00 3f 0f 08 &2cca 00 1d 0e 08 04 0c 0c 08 04 0c 0c 0c 0c 0c 0c 0c ; sprite_sea_player # Player on speedboat &2cda 03 03 00 00 03 12 00 00 03 33 22 00 03 33 00 00 &2cea 04 0c 00 00 04 0f 0f 1b 04 0f 0f 1b 04 0c 00 14 &2cfa 05 0f 00 3f 04 0c 09 3f 04 0c 3f 3f 03 03 03 03 &2d0a 3f 3f 3f 3f 35 3d 3f 3f 3c 34 3f 2a 34 3c 3c 00 ; sprite_land_vertical_enemy # Policeman &2d1a 00 15 30 00 00 10 30 00 00 14 0f 00 00 33 0f 00 &2d2a 00 11 27 00 22 30 3a 20 32 30 30 30 00 10 3a 10 &2d3a 00 10 30 10 00 10 3a 10 00 10 30 11 00 10 10 00 &2d4a 00 10 10 00 00 10 10 00 00 10 10 00 00 30 10 20 ; sprite_land_horizontal_enemy # Ambulance &2d5a 00 c0 00 00 00 c0 00 00 3f 3f 2a 00 3f 3f 2a 00 &2d6a 3f 17 3f 2a 3f 17 3e 28 2b 03 3e 28 2b 03 3e 28 &2d7a 3f 17 3e 28 3f 17 3e 28 3f 3f 3f 2f 3f 3f 3f 2f &2d8a 3c 3c 3c 28 3a 2a 3a 2a 3a 2a 3a 2a 3f 2a 3f 2a ; sprite_land_obstacle_three # Tree &2d9a 00 05 08 00 00 0f 0c 00 00 0e 0c 08 05 0e 0e 0c &2daa 0d 0e 0c 0c 0f 0c 0c 0e 0e 0e 06 0c 0b 0f 06 0c &2dba 05 07 07 08 00 01 03 00 00 01 02 00 00 01 02 00 &2dca 00 01 02 00 00 01 02 00 00 01 02 00 00 03 03 00 ; sprite_land_obstacle_two # Grave &2dda 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2dea 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2dfa 00 15 00 00 00 15 00 00 00 3f 2a 00 00 15 00 00 &2e0a 00 15 00 00 00 15 00 00 00 0c 0c 00 0c 0c 0c 0c ; sprite_land_obstacle_one # House &2e1a 00 01 02 00 00 01 02 2a 00 03 03 2a 00 03 03 2a &2e2a 01 03 03 02 01 03 03 02 03 03 03 03 03 03 03 03 &2e3a 3f 3f 3f 3f 2a 15 08 1d 2a 15 08 1d 3f 3f 3f 3f &2e4a 3a 35 08 1d 3a 35 08 1d 3a 3d 3f 3f 3a 35 3f 3f ; sprite_land_player # Player on motorbike &2e5a 03 03 00 00 03 03 00 00 03 32 00 00 13 33 22 00 &2e6a 13 33 00 00 04 0c 00 00 04 0c 15 2a 04 0f 0f 22 &2e7a 04 0f 0f 22 04 0c 00 2a 04 0c 08 2a 3c 0c 1c 2a &2e8a 3c 2c 03 3d 3a 2b 03 35 3a 2a 15 35 3f 2a 15 3f ; unused # Source code fragment &2e9a 38 39 2c 38 39 2c 32 2c 35 33 ; ... 89,89,2,53 ... ; unused &2ea4 de ; unused &2ea5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 &2eb5 00 ; x_positions_table ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &2eb6 2c 30 18 14 0c 10 3c 10 28 34 38 08 3c 38 1c 34 ; &00 &2ec6 18 34 2c 34 08 0c 48 18 48 1c 18 0c 1c 08 44 2c ; &10 &2ed6 28 14 3c 48 0c 38 38 24 ; &20 ; rotating_colour_table # Uses &2ede - &2eeb ; 0 1 2 3 4 5 6 7 8 9 a b c d &2ede 10 ; start_screen_colours_table ; 0 1 2 3 4 5 6 7 8 9 a &2edf 04 05 01 06 03 07 07 07 03 06 01 05 04 ; unused &2eec 00 ; jump_offsets_table ; 0 1 2 3 4 5 6 7 8 9 a b c d e f &2eed 00 01 03 06 08 0b 0d 0e 10 11 12 13 13 14 14 14 ; &00 &2efd 14 14 14 13 13 12 11 10 0e 0d 0b 08 06 03 01 00 ; &10 &2f0d 00 ; &20 ; unused &2f0e 00 ; level_type_data_addresses_table ; land &2f0f 5a 2e ; &2e5a = sprite_land_player &2f11 1a 2e ; &2e1a = sprite_land_obstacle_one &2f13 da 2d ; &2dda = sprite_land_obstacle_two &2f15 9a 2d ; &2d9a = sprite_land_obstacle_three &2f17 5a 2d ; &2d5a = sprite_land_horizontal_enemy &2f19 1a 2d ; &2d1a = sprite_land_vertical_enemy ; sea &2f1b da 2c ; &2cda = sprite_sea_player &2f1d 9a 2c ; &2c9a = sprite_sea_obstacle_one &2f1f 5a 2c ; &2c5a = sprite_sea_obstacle_two &2f21 1a 2c ; &2c1a = sprite_sea_obstacle_three &2f23 da 2b ; &2bda = sprite_sea_horizontal_enemy &2f25 9a 2b ; &2b9a = sprite_sea_vertical_enemy ; snow &2f27 5a 2b ; &2b5a = sprite_snow_player &2f29 1a 2b ; &2b1a = sprite_snow_obstacle_one &2f2b da 2a ; &2ada = sprite_snow_obstacle_two &2f2d 9a 2a ; &2a9a = sprite_snow_obstacle_three &2f2f 5a 2a ; &2a5a = sprite_snow_horizontal_enemy &2f31 1a 2a ; &2a1a = sprite_snow_vertical_enemy ; unused &2f33 da 29 ; &29da = sprite_open_clapperboard_one &2f35 9a 29 ; &299a = sprite_open_clapperboard_two ; ground_colours_table &2f37 02 ; land : G &2f38 04 ; sea : B &2f39 07 ; snow : W ; wages &2f3a 30 30 30 30 30 30 ; "000000" ; level_set_data ; o he ve &2f40 03 01 00 # Levels 1 - 3 &2f43 04 01 00 # Levels 4 - 6 &2f46 05 01 01 # Levels 7 - 9 &2f49 06 01 02 # Levels 10 - 12 &2f4c 07 01 02 # Levels 13 - 15 &2f4f 08 01 03 # Levels 16 - 18 &2f52 04 01 04 # Levels 19 - 21 &2f55 04 01 03 # Levels 22 - 24 &2f58 0b 01 03 # Levels 25 - 27 &2f5b 0c 01 06 # Levels 28 - 30 &2f5e 0c 01 07 # Levels 31 - 33 &2f61 0c 01 08 # Levels 34 - 36 ; unused &2f64 00 00 00 00 ; tune_data ; p1 p2 d &2f68 59 1d 02 &2f6b 4d 4d 01 &2f6e 6d 3d 02 &2f71 00 00 01 &2f74 61 21 02 &2f77 51 51 01 &2f7a 75 45 02 &2f7d 00 00 01 &2f80 6d 29 01 &2f83 69 69 01 &2f86 61 61 01 &2f89 59 45 01 &2f8c 89 89 01 &2f8f 69 69 01 &2f92 6d 3d 01 &2f95 4d 4d 01 &2f98 59 59 01 &2f9b 6d 6d 01 ; unused &2f9e 00 00 00 00 00 00 ; horizontal_enemy_x &2fa4 21 ; horizontal_enemy_y &2fa5 70 ; number_of_vertical_enemies &2fa6 04 ; vertical_enemies_x ; vertical_enemies_y ; vertical_enemies_state ; x y s &2fa7 18 38 1d &2faa 48 70 12 &2fad 1c a8 11 &2fb0 18 e0 0e &2fb3 10 38 0a ; unused &2fb6 28 70 0d 34 a8 0e 05 e0 01 04 38 00 00 70 00 00 &2fc6 a8 00 01 e0 00 03 38 01 06 70 02 08 a8 02 0b e0 &2fd6 03 0d ; bottom_edge # Uses &2fd8 - &2fdb &2fd8 0f 0f ; clapperboard_sound # Uses &2fda - &2fe1 &2fda 00 00 ; right_edge &2fdc f1 ; sprite_offset &2fdd ff ; rows_plotted &2fde 04 &2fdf 00 ; screen_x &2fe0 01 ; screen_y &2fe1 00 ; row_in_group &2fe2 07 ; level &2fe3 01 ; tune_notes_remaining ; dead_player_count ; falling_timer ; wipe_x ; vertical_enemy_offset ; holes_remaining ; tmp ; count ; level_set ; level_set_times_three &2fe4 0b ; variables_for_hole_position ; tune_delay ; wipe_y ; enemies_remaining_to_unplot ; hole_y ; tmp ; vertical_enemy_y &2fe5 29 ; death_delay ; position_table_offset ; vertical_enemies_remaining &2fe6 00 ; hole_x &2fe7 18 ; hole_width &2fe8 00 ; obstacles_remaining &2fe9 00 ; enemies_remaining_to_update ; ground_y &2fea 00 ; sprite_table_offset &2feb 02 ; x_offset &2fec 1b ; level_type &2fed 01 ; unused &2fee 02 08 ac 03 0c e4 12 48 05 8d 54 14 00 00 e4 1b &2ffe 00 00 ; unused &3000 30 30 ; "00" ; title_screen_data &3002 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; " " &3012 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; " . .VISIONS.PRESENTS . . " &3022 20 20 20 20 20 20 20 20 20 20 20 20 20 20 82 20 ; " .________________ .. . " &3032 20 20 83 56 49 53 49 4f 4e 53 82 50 52 45 53 45 ; " ..DARE DEVIL.DENIS " &3042 4e 54 53 20 20 20 20 20 20 0d 20 0d 20 20 20 20 ; " ..DARE DEVIL.DENIS " &3052 20 20 20 20 20 20 20 20 20 20 83 5f 5f 5f 5f 5f ; " .```````````````` " &3062 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 20 20 20 20 20 ; " .Written by Simon Pick " &3072 0d 0d 20 0d 20 20 20 20 20 20 20 20 20 20 20 20 ; " " &3082 20 83 8d 44 41 52 45 20 44 45 56 49 4c 83 44 45 ; ".. Dare Devil.Denis is making his debut " &3092 4e 49 53 20 20 20 20 20 20 20 20 20 20 20 20 20 ; ".in a new film as a stuntman.He must " &30a2 20 20 20 20 20 20 20 20 20 83 8d 44 41 52 45 20 ; ".pick up gold.and avoid any obstacles " &30b2 44 45 56 49 4c 83 44 45 4e 49 53 20 20 20 20 20 ; ".in his way ! " &30c2 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; ". The director will fire Denis if he " &30d2 20 20 83 60 60 60 60 60 60 60 60 60 60 60 60 60 ; ".needs more than 3 'Takes'.However, " &30e2 60 60 60 20 20 20 20 20 20 20 20 20 20 20 20 20 ; ".Denis' contract is extended if the " &30f2 20 20 20 20 20 20 20 82 57 72 69 74 74 65 6e 20 ; ".director is impressed ! ." &3102 62 79 20 20 53 69 6d 6f 6e 20 50 69 63 6b 20 20 ; " " &3112 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; " Controls: " &3122 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; " " &3132 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; " .Space Bar.........Jump " &3142 85 85 20 44 61 72 65 20 44 65 76 69 6c 85 44 65 ; " .Shift.......Accelerate " &3152 6e 69 73 20 69 73 20 6d 61 6b 69 6e 67 20 68 69 ; " .Return............Stop " &3162 73 20 64 65 62 75 74 20 85 69 6e 20 61 20 6e 65 ; " " &3172 77 20 66 69 6c 6d 20 61 73 20 61 20 73 74 75 6e ; " ..Press.Space Bar.to start " &3182 74 6d 61 6e 2e 48 65 20 6d 75 73 74 20 20 20 20 ; " " &3192 85 70 69 63 6b 20 75 70 20 67 6f 6c 64 85 61 6e ; " " &31a2 64 20 61 76 6f 69 64 20 61 6e 79 20 6f 62 73 74 &31b2 61 63 6c 65 73 20 20 20 85 69 6e 20 68 69 73 20 &31c2 77 61 79 20 21 20 20 20 20 20 20 20 20 20 20 20 &31d2 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &31e2 85 20 20 54 68 65 20 64 69 72 65 63 74 6f 72 20 &31f2 77 69 6c 6c 20 66 69 72 65 20 44 65 6e 69 73 20 &3202 69 66 20 68 65 20 20 20 85 6e 65 65 64 73 20 6d &3212 6f 72 65 20 74 68 61 6e 20 33 20 27 54 61 6b 65 &3222 73 27 2e 48 6f 77 65 76 65 72 2c 20 20 20 20 20 &3232 85 44 65 6e 69 73 27 20 63 6f 6e 74 72 61 63 74 &3242 20 69 73 20 65 78 74 65 6e 64 65 64 20 69 66 20 &3252 74 68 65 20 20 20 20 20 85 64 69 72 65 63 74 6f &3262 72 20 69 73 20 69 6d 70 72 65 73 73 65 64 20 21 &3272 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 86 &3282 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &3292 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &32a2 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &32b2 20 20 20 20 20 43 6f 6e 74 72 6f 6c 73 3a 20 20 &32c2 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &32d2 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &32e2 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &32f2 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 86 &3302 53 70 61 63 65 20 42 61 72 87 2e 2e 2e 2e 2e 2e &3312 2e 86 4a 75 6d 70 20 20 20 20 20 20 20 20 20 20 &3322 20 20 20 20 20 20 20 86 53 68 69 66 74 87 2e 2e &3332 2e 2e 2e 86 41 63 63 65 6c 65 72 61 74 65 20 20 &3342 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 86 &3352 52 65 74 75 72 6e 87 2e 2e 2e 2e 2e 2e 2e 2e 2e &3362 2e 86 53 74 6f 70 20 20 20 20 20 20 20 20 20 20 &3372 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &3382 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &3392 20 20 20 20 20 20 20 20 20 20 20 20 20 81 82 50 &33a2 72 65 73 73 83 53 70 61 63 65 20 42 61 72 82 74 &33b2 6f 20 73 74 61 72 74 20 20 20 20 20 20 20 20 20 &33c2 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &33d2 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &33e2 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 &33f2 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; unused &3402 25 25 25 25 30 30 ; "%%%%00" ; title_screen &3408 a9 16 LDA #&16 # Change to MODE 7 &340a 20 ee ff JSR &ffee ; OSWRCH &340d a9 07 LDA #&07 &340f 20 ee ff JSR &ffee ; OSWRCH &3412 20 0d 19 JSR &190d ; disable_cursor &3415 a9 00 LDA #&00 ; &7c00 = screen_memory &3417 85 70 STA &70 ; target_address_low &3419 a9 7c LDA #&7c &341b 85 71 STA &71 ; target_address_high &341d a9 02 LDA #&02 ; &3002 = title_screen_data &341f 85 72 STA &72 ; source_address_low &3421 a9 30 LDA #&30 &3423 85 73 STA &73 ; source_address_high &3425 a0 00 LDY #&00 ; copy_title_screen_loop &3427 b1 72 LDA (&72),Y ; target_address &3429 91 70 STA (&70),Y ; source_address &342b c8 INY &342c d0 f9 BNE &3427 ; copy_title_screen_loop &342e e6 73 INC &73 ; source_address_high &3430 e6 71 INC &71 ; target_address_high &3432 a5 71 LDA &71 ; target_address_high &3434 c9 80 CMP #&80 &3436 d0 ef BNE &3427 ; copy_title_screen_loop &3438 a2 00 LDX #&00 ; title_screen_loop &343a 86 70 STX &70 ; title_screen_colour &343c a2 02 LDX #&02 &343e a0 00 LDY #&00 &3440 a9 81 LDA #&81 ; Wait for input character &3442 20 f4 ff JSR &fff4 ; OSBYTE &3445 e0 20 CPX #&20 ; " " &3447 f0 29 BEQ &3472 ; to_start_screen &3449 a9 13 LDA #&13 ; Wait for vertical retrace &344b 20 f4 ff JSR &fff4 ; OSBYTE &344e a6 70 LDX &70 ; title_screen_colour &3450 a9 1f LDA #&1f # TAB(&0c, &17) &3452 20 ee ff JSR &ffee ; OSWRCH &3455 a9 0c LDA #&0c &3457 20 ee ff JSR &ffee ; OSWRCH &345a a9 17 LDA #&17 &345c 20 ee ff JSR &ffee ; OSWRCH &345f 18 CLC &3460 bd df 2e LDA &2edf,X ; start_screen_colours_table &3463 69 80 ADC #&80 ; TELETEXT_TEXT_COLOUR &3465 20 ee ff JSR &ffee ; OSWRCH &3468 e8 INX &3469 e0 0b CPX #&0b &346b d0 cd BNE &343a ; title_screen_loop &346d a2 00 LDX #&00 &346f 4c 3a 34 JMP &343a ; title_screen_loop ; to_start_screen &3472 20 f6 0e JSR &0ef6 ; start_screen ; entry_point &3475 a9 0d LDA #&0d ; Disable event &3477 a2 04 LDX #&04 ; v-sync event &3479 20 f4 ff JSR &fff4 ; OSBYTE &347c a9 0f LDA #&0f ; Flush all buffers &347e a2 00 LDX #&00 ; all buffers &3480 20 f4 ff JSR &fff4 ; OSBYTE &3483 4c 08 34 JMP &3408 ; title_screen ; unused &3486 00 00 00 00 00 00 00 00 00 00