------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite6.78b.asm LEVEL 1 PASS 3 1 28000 ???? ; MACRO.H 2 28000 ???? 3 28000 ???? ; Based on the 2600 macro.h file. 4 28000 ???? ; Macros irrelevant to the 7800 have been removed, and the sleep macro 5 28000 ???? ; has been adapted to give accurate results on the 7800. 6 28000 ???? 7 28000 ???? ; Version 1.0 2019/12/11 (based on the 2600 Version 1.05, 13/NOVEMBER/2003) 8 28000 ???? 9 28000 ???? ; Available macros... 10 28000 ???? ; SLEEP n - sleep for n cycles 11 28000 ???? ; SET_POINTER - load a 16-bit absolute to a 16-bit variable 12 28000 ???? 13 28000 ???? ;------------------------------------------------------------------------------- 14 28000 ???? ; SLEEP duration 15 28000 ???? ; Original author: Thomas Jentzsch 16 28000 ???? ; Inserts code which takes the specified number of cycles to execute. This is 17 28000 ???? ; useful for code where precise timing is required. 18 28000 ???? ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS. 19 28000 ???? ; LEGAL OPCODE VERSION MAY AFFECT FLAGS 20 28000 ???? ; Uses illegal opcode (DASM 2.20.01 onwards). 21 28000 ???? 22 28000 ???? MAC sleep 23 28000 ???? .CYCLES SET {1} 24 28000 ???? 25 28000 ???? IF .CYCLES < 2 26 28000 ???? ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 27 28000 ???? ERR 28 28000 ???? ENDIF 29 28000 ???? 30 28000 ???? IF .CYCLES & 1 31 28000 ???? IFNCONST NO_ILLEGAL_OPCODES 32 28000 ???? nop $80 33 28000 ???? ELSE 34 28000 ???? bit $80 35 28000 ???? ENDIF 36 28000 ???? .CYCLES SET .CYCLES - 3 37 28000 ???? ENDIF 38 28000 ???? 39 28000 ???? REPEAT .CYCLES / 2 40 28000 ???? nop 41 28000 ???? REPEND 42 28000 ???? ENDM ;usage: SLEEP n (n>1) 43 28000 ???? 44 28000 ???? 45 28000 ???? ;------------------------------------------------------------------------------- 46 28000 ???? ; FRACSLEEP duration 47 28000 ???? ; Based on Thomas Jentzsch's SLEEP macro, but takes cycles*2 to allow for 48 28000 ???? ; 7800 based 0.5 cycle sleep. 49 28000 ???? 50 28000 ???? MAC fracsleep 51 28000 ???? .CYCLES SET {1} 52 28000 ???? 53 28000 ???? IF .CYCLES < 4 54 28000 ???? ECHO "MACRO ERROR: 'FRACSLEEP': Duration must be > 4" 55 28000 ???? ERR 56 28000 ???? ENDIF 57 28000 ???? IF .CYCLES = 5 58 28000 ???? ECHO "MACRO ERROR: 'FRACSLEEP': Duration = 5 is impossible" 59 28000 ???? ERR 60 28000 ???? ENDIF 61 28000 ???? 62 28000 ???? IF .CYCLES & 1 63 28000 ???? IFNCONST NO_ILLEGAL_OPCODES 64 28000 ???? nop $0 ; TIA access is 3.5 cycles 65 28000 ???? ELSE 66 28000 ???? bit $0 ; TIA access is 3.5 cycles 67 28000 ???? ENDIF 68 28000 ???? .CYCLES SET .CYCLES - 7 69 28000 ???? ENDIF 70 28000 ???? 71 28000 ???? IF .CYCLES & 2 72 28000 ???? IFNCONST NO_ILLEGAL_OPCODES 73 28000 ???? nop $80 74 28000 ???? ELSE 75 28000 ???? bit $80 76 28000 ???? ENDIF 77 28000 ???? .CYCLES SET .CYCLES - 6 78 28000 ???? ENDIF 79 28000 ???? 80 28000 ???? REPEAT .CYCLES / 4 81 28000 ???? nop 82 28000 ???? REPEND 83 28000 ???? ENDM ;usage: FRACSLEEP n (n>1) 84 28000 ???? 85 28000 ???? 86 28000 ???? ;------------------------------------------------------- 87 28000 ???? ; SET_POINTER 88 28000 ???? ; Original author: Manuel Rotschkar 89 28000 ???? ; 90 28000 ???? ; Sets a 2 byte RAM pointer to an absolute address. 91 28000 ???? ; 92 28000 ???? ; Usage: SET_POINTER pointer, address 93 28000 ???? ; Example: SET_POINTER SpritePTR, SpriteData 94 28000 ???? ; 95 28000 ???? ; Note: Alters the accumulator, NZ flags 96 28000 ???? ; IN 1: 2 byte RAM location reserved for pointer 97 28000 ???? ; IN 2: absolute address 98 28000 ???? 99 28000 ???? MAC set_pointer 100 28000 ???? .POINTER SET {1} 101 28000 ???? .ADDRESS SET {2} 102 28000 ???? 103 28000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address 104 28000 ???? STA .POINTER ; Store in pointer 105 28000 ???? LDA #>.ADDRESS ; Get Hibyte of Address 106 28000 ???? STA .POINTER+1 ; Store in pointer+1 107 28000 ???? 108 28000 ???? ENDM 109 28000 ???? 110 28000 ???? ; EOF 111 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 112 28000 ???? 113 28000 ???? ; 7800MACRO.H 114 28000 ???? 115 28000 ???? ;------------------------------------------------------- 116 28000 ???? ; BOXCOLLISIONCHECK 117 28000 ???? ; author: Mike Saarna 118 28000 ???? ; 119 28000 ???? ; A general bounding box collision check. compares 2 rectangles of differing size 120 28000 ???? ; and shape for overlap. Carry is set for collision detected, clear for none. 121 28000 ???? ; 122 28000 ???? ; Usage: BOXCOLLISIONCHECK x1var,y1var,w1var,h1var,x2var,y2var,w2var,h2var 123 28000 ???? ; 124 28000 ???? 125 28000 ???? MAC boxcollisioncheck 126 28000 ???? .boxx1 SET {1} 127 28000 ???? .boxy1 SET {2} 128 28000 ???? .boxw1 SET {3} 129 28000 ???? .boxh1 SET {4} 130 28000 ???? .boxx2 SET {5} 131 28000 ???? .boxy2 SET {6} 132 28000 ???? .boxw2 SET {7} 133 28000 ???? .boxh2 SET {8} 134 28000 ???? 135 28000 ???? .DoXCollisionCheck 136 28000 ???? lda .boxx1 ;3 137 28000 ???? cmp .boxx2 ;2 138 28000 ???? bcs .X1isbiggerthanX2 ;2/3 139 28000 ???? .X2isbiggerthanX1 140 28000 ???? adc #.boxw1 ;2 141 28000 ???? cmp .boxx2 ;3 142 28000 ???? bcs .DoYCollisionCheck ;3/2 143 28000 ???? bcc .noboxcollision ;3 144 28000 ???? .X1isbiggerthanX2 145 28000 ???? clc ;2 146 28000 ???? sbc #.boxw2 ;2 147 28000 ???? cmp .boxx2 ;3 148 28000 ???? bcs .noboxcollision ;3/2 149 28000 ???? .DoYCollisionCheck 150 28000 ???? lda .boxy1 ;3 151 28000 ???? cmp .boxy2 ;3 152 28000 ???? bcs .Y1isbiggerthanY2 ;3/2 153 28000 ???? .Y2isbiggerthanY1 154 28000 ???? adc #.boxh1 ;2 155 28000 ???? cmp .boxy2 ;3 156 28000 ???? jmp .checkdone ;6 157 28000 ???? .Y1isbiggerthanY2 158 28000 ???? clc ;2 159 28000 ???? sbc #.boxh2 ;2 160 28000 ???? cmp .boxy2 ;3 161 28000 ???? bcs .noboxcollision ;3/2 162 28000 ???? .boxcollision 163 28000 ???? sec ;2 164 28000 ???? .byte $24 ; hardcoded "BIT [clc opcode]", used to skip over the following clc 165 28000 ???? .noboxcollision 166 28000 ???? clc ;2 167 28000 ???? .checkdone 168 28000 ???? 169 28000 ???? ENDM 170 28000 ???? 171 28000 ???? ; QBOXCOLLISIONCHECK 172 28000 ???? ; author: unknown 173 28000 ???? ; 174 28000 ???? ; A general bounding box collision check. compares 2 rectangles of differing size 175 28000 ???? ; and shape for overlap. Carry is CLEAR for collision detected, SET for none. 176 28000 ???? ; 177 28000 ???? ; Usage: QBOXCOLLISIONCHECK x1var,y1var,w1var,h1var,x2var,y2var,w2var,h2var 178 28000 ???? ; 179 28000 ???? MAC qboxcollisioncheck 180 28000 ???? .boxx1 SET {1} 181 28000 ???? .boxy1 SET {2} 182 28000 ???? .boxw1 SET {3} 183 28000 ???? .boxh1 SET {4} 184 28000 ???? .boxx2 SET {5} 185 28000 ???? .boxy2 SET {6} 186 28000 ???? .boxw2 SET {7} 187 28000 ???? .boxh2 SET {8} 188 28000 ???? 189 28000 ???? lda .boxx2 190 28000 ???? clc 191 28000 ???? adc #.boxw2 192 28000 ???? sbc .boxx1 193 28000 ???? cmp #.boxw1+.boxw2-1 194 28000 ???? bcs .qboxcollisiondone 195 28000 ???? ;if we're here, carry is clear 196 28000 ???? lda .boxy2 197 28000 ???? adc #.boxh2 198 28000 ???? sbc .boxy1 199 28000 ???? cmp #.boxh1+.boxh2-1 200 28000 ???? .qboxcollisiondone 201 28000 ???? rol ; temp for testing - invert carry... 202 28000 ???? eor #1 203 28000 ???? ror 204 28000 ???? ENDM 205 28000 ???? 206 28000 ???? 207 28000 ???? MAC median3 208 28000 ???? 209 28000 ???? ; A median filter (for smoothing paddle jitter) 210 28000 ???? ; this macro takes the current paddle value, compares it to historic 211 28000 ???? ; values, and replaces the current paddle value with the median. 212 28000 ???? ; 213 28000 ???? ; called as: MEDIAN3 STORAGE CURRENT 214 28000 ???? ; where STORAGE points to 3 consecutive bytes of memory. The first 2 215 28000 ???? ; must be dedicated to this MEDIAN filter. The last 1 is a temp. 216 28000 ???? ; where CURRENT is memory holding the new value you wish to compare to 217 28000 ???? ; the previous values, and update with the median value. 218 28000 ???? ; 219 28000 ???? ; returns: CURRENT (modified to contain median value) 220 28000 ???? ; 221 28000 ???? ; author: Mike Saarna (aka RevEng) 222 28000 ???? 223 28000 ???? .MedianBytes SET {1} 224 28000 ???? .NewValue SET {2} 225 28000 ???? 226 28000 ???? lda #0 227 28000 ???? ldy .NewValue 228 28000 ???? sty .MedianBytes+2 ; put the new value in the most "recent" slot 229 28000 ???? 230 28000 ???? ; build an index from relative size comparisons between our 3 values. 231 28000 ???? cpy .MedianBytes 232 28000 ???? rol 233 28000 ???? cpy .MedianBytes+1 234 28000 ???? rol 235 28000 ???? ldy .MedianBytes 236 28000 ???? cpy .MedianBytes+1 237 28000 ???? rol 238 28000 ???? tay 239 28000 ???? 240 28000 ???? ldx MedianOrderLUT,y ; convert the size-comparison index to an index to the median value 241 28000 ???? lda .MedianBytes,x 242 28000 ???? sta .NewValue ; we replace the new value memory with the median value 243 28000 ???? 244 28000 ???? ; then shift values from "newer" bytes to "older" bytes, leaving the 245 28000 ???? ; newest byte (.MedianBytes+2) empty for next time. 246 28000 ???? lda .MedianBytes+1 247 28000 ???? sta .MedianBytes 248 28000 ???? lda .MedianBytes+2 249 28000 ???? sta .MedianBytes+1 250 28000 ???? ifnconst MedianOrderLUT 251 28000 ???? jmp MedianOrderLUTend 252 28000 ???? MedianOrderLUT ; converts our "comparison index" to an index to the median value 253 28000 ???? .byte 0 ; 0 B2 < B0 < B1 254 28000 ???? .byte 1 ; 1 B2 < B1 < B0 255 28000 ???? .byte 2 ; 2 impossible 256 28000 ???? .byte 2 ; 3 B1 < B2 < B0 257 28000 ???? .byte 2 ; 4 B0 < B2 < B1 258 28000 ???? .byte 2 ; 5 impossible 259 28000 ???? .byte 1 ; 6 B0 < B1 < B2 260 28000 ???? .byte 0 ; 7 B1 < B0 < B2 261 28000 ???? MedianOrderLUTend 262 28000 ???? endif 263 28000 ???? ENDM 264 28000 ???? 265 28000 ???? MAC plotsprite 266 28000 ???? 267 28000 ???? ; A macro version of the plotsprite command. 268 28000 ???? ; This trades off rom space for speed. 269 28000 ???? ; It also doesn't check if the visible screen is displayed or not. 270 28000 ???? ; It has no training wheels. It is all rusty sharp edges. 271 28000 ???? 272 28000 ???? .GFXLabel SET {1} 273 28000 ???? .Palette SET {2} ; constant 274 28000 ???? .SpriteX SET {3} ; variable 275 28000 ???? .SpriteY SET {4} ; variable 276 28000 ???? .ByteOffset SET {5} ; variable 277 28000 ???? 278 28000 ???? lda .SpriteY 279 28000 ???? lsr 280 28000 ???? lsr 281 28000 ???? asr #%11111110 ; ensure carry is clear 282 28000 ???? if WZONEHEIGHT = 16 283 28000 ???? asr #%11111110 ; ensure carry is clear 284 28000 ???? endif 285 28000 ???? 286 28000 ???? tax 287 28000 ???? 288 28000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 289 28000 ???? sta dlpnt 290 28000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 291 28000 ???? sta dlpnt+1 292 28000 ???? 293 28000 ???? ldy dlend,x ; find the next new object position in this zone 294 28000 ???? 295 28000 ???? lda .ByteOffset 296 28000 ???? if {1}_width = 2 297 28000 ???? asl 298 28000 ???? endif 299 28000 ???? if {1}_width = 3 300 28000 ???? asl 301 28000 ???? adc .ByteOffset 302 28000 ???? endif 303 28000 ???? if {1}_width = 4 304 28000 ???? asl 305 28000 ???? asl 306 28000 ???? endif 307 28000 ???? if {1}_width = 5 308 28000 ???? asl 309 28000 ???? asl 310 28000 ???? adc .ByteOffset 311 28000 ???? endif 312 28000 ???? if {1}_width = 6 313 28000 ???? asl 314 28000 ???? adc .ByteOffset 315 28000 ???? asl 316 28000 ???? endif 317 28000 ???? if {1}_width = 7 318 28000 ???? asl 319 28000 ???? adc .ByteOffset 320 28000 ???? asl 321 28000 ???? adc .ByteOffset 322 28000 ???? endif 323 28000 ???? if {1}_width = 8 324 28000 ???? asl 325 28000 ???? asl 326 28000 ???? asl 327 28000 ???? endif 328 28000 ???? if {1}_width = 9 329 28000 ???? asl 330 28000 ???? asl 331 28000 ???? asl 332 28000 ???? adc .ByteOffset 333 28000 ???? endif 334 28000 ???? if {1}_width = 10 335 28000 ???? asl 336 28000 ???? asl 337 28000 ???? adc .ByteOffset 338 28000 ???? asl 339 28000 ???? endif 340 28000 ???? if {1}_width = 11 341 28000 ???? asl 342 28000 ???? asl 343 28000 ???? adc .ByteOffset 344 28000 ???? asl 345 28000 ???? adc .ByteOffset 346 28000 ???? endif 347 28000 ???? if {1}_width = 12 348 28000 ???? asl 349 28000 ???? adc .ByteOffset 350 28000 ???? asl 351 28000 ???? asl 352 28000 ???? endif 353 28000 ???? if {1}_width = 13 354 28000 ???? asl 355 28000 ???? adc .ByteOffset 356 28000 ???? asl 357 28000 ???? asl 358 28000 ???? adc .ByteOffset 359 28000 ???? endif 360 28000 ???? if {1}_width = 14 361 28000 ???? asl 362 28000 ???? adc .ByteOffset 363 28000 ???? asl 364 28000 ???? adc .ByteOffset 365 28000 ???? asl 366 28000 ???? endif 367 28000 ???? 368 28000 ???? adc #<.GFXLabel ; carry is clear via previous asl or asr 369 28000 ???? sta (dlpnt),y ; #1 - low byte object address 370 28000 ???? 371 28000 ???? iny 372 28000 ???? 373 28000 ???? lda #({1}_mode | %01000000) 374 28000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 375 28000 ???? 376 28000 ???? iny 377 28000 ???? 378 28000 ???? lda .SpriteY 379 28000 ???? and #(WZONEHEIGHT - 1) 380 28000 ???? cmp #1 ; clear carry if our sprite is just in this zone 381 28000 ???? ora #>.GFXLabel 382 28000 ???? sta (dlpnt),y ; #3 - hi byte object address 383 28000 ???? 384 28000 ???? iny 385 28000 ???? 386 28000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 387 28000 ???? sta (dlpnt),y ; #4 - palette|width 388 28000 ???? 389 28000 ???? iny 390 28000 ???? 391 28000 ???? lda .SpriteX 392 28000 ???? sta (dlpnt),y ; #5 - x object position 393 28000 ???? 394 28000 ???? iny 395 28000 ???? sty dlend,x 396 28000 ???? 397 28000 ???? ifconst ALWAYSTERMINATE 398 28000 ???? iny 399 28000 ???? lda #0 400 28000 ???? sta (dlpnt),y 401 28000 ???? endif 402 28000 ???? 403 28000 ???? bcc .PLOTSPRITEend 404 28000 ???? 405 28000 ???? inx ; next zone 406 28000 ???? 407 28000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 408 28000 ???? sta dlpnt 409 28000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 410 28000 ???? sta dlpnt+1 411 28000 ???? 412 28000 ???? ldy dlend,x ; find the next new object position in this zone 413 28000 ???? 414 28000 ???? lda .ByteOffset 415 28000 ???? if {1}_width = 1 416 28000 ???? clc 417 28000 ???? endif 418 28000 ???? if {1}_width = 2 419 28000 ???? asl ; carry clear 420 28000 ???? endif 421 28000 ???? if {1}_width = 3 422 28000 ???? asl ; carry clear 423 28000 ???? adc .ByteOffset 424 28000 ???? endif 425 28000 ???? if {1}_width = 4 426 28000 ???? asl ; carry clear 427 28000 ???? asl 428 28000 ???? endif 429 28000 ???? if {1}_width = 5 430 28000 ???? asl ; carry clear 431 28000 ???? asl 432 28000 ???? adc .ByteOffset 433 28000 ???? endif 434 28000 ???? if {1}_width = 6 435 28000 ???? asl ; carry clear 436 28000 ???? adc .ByteOffset 437 28000 ???? asl 438 28000 ???? endif 439 28000 ???? if {1}_width = 7 440 28000 ???? asl ; carry clear 441 28000 ???? adc .ByteOffset 442 28000 ???? asl 443 28000 ???? endif 444 28000 ???? if {1}_width = 8 445 28000 ???? asl ; carry clear 446 28000 ???? asl 447 28000 ???? asl 448 28000 ???? endif 449 28000 ???? if {1}_width = 9 450 28000 ???? asl ; carry clear 451 28000 ???? asl 452 28000 ???? asl 453 28000 ???? adc .ByteOffset 454 28000 ???? endif 455 28000 ???? if {1}_width = 10 456 28000 ???? asl ; carry clear 457 28000 ???? asl 458 28000 ???? adc .ByteOffset 459 28000 ???? asl 460 28000 ???? endif 461 28000 ???? if {1}_width = 11 462 28000 ???? asl ; carry clear 463 28000 ???? asl 464 28000 ???? adc .ByteOffset 465 28000 ???? asl 466 28000 ???? adc .ByteOffset 467 28000 ???? endif 468 28000 ???? if {1}_width = 12 469 28000 ???? asl ; carry clear 470 28000 ???? adc .ByteOffset 471 28000 ???? asl 472 28000 ???? asl 473 28000 ???? endif 474 28000 ???? if {1}_width = 13 475 28000 ???? asl ; carry clear 476 28000 ???? adc .ByteOffset 477 28000 ???? asl 478 28000 ???? asl 479 28000 ???? adc .ByteOffset 480 28000 ???? endif 481 28000 ???? if {1}_width = 14 482 28000 ???? asl ; carry clear 483 28000 ???? adc .ByteOffset 484 28000 ???? asl 485 28000 ???? adc .ByteOffset 486 28000 ???? asl 487 28000 ???? endif 488 28000 ???? 489 28000 ???? adc #<.GFXLabel 490 28000 ???? sta (dlpnt),y ; #1 - low byte object address 491 28000 ???? 492 28000 ???? iny 493 28000 ???? 494 28000 ???? lda #({1}_mode | %01000000) 495 28000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 496 28000 ???? 497 28000 ???? iny 498 28000 ???? 499 28000 ???? lda .SpriteY 500 28000 ???? and #(WZONEHEIGHT - 1) 501 28000 ???? ora #>(.GFXLabel - (WZONEHEIGHT * 256)) ; start in the dma hole 502 28000 ???? sta (dlpnt),y ; #3 - hi byte object address 503 28000 ???? 504 28000 ???? iny 505 28000 ???? 506 28000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 507 28000 ???? sta (dlpnt),y ; #4 - palette|width 508 28000 ???? 509 28000 ???? iny 510 28000 ???? 511 28000 ???? lda .SpriteX 512 28000 ???? sta (dlpnt),y ; #5 - x object position 513 28000 ???? 514 28000 ???? iny 515 28000 ???? sty dlend,x 516 28000 ???? 517 28000 ???? ifconst ALWAYSTERMINATE 518 28000 ???? iny 519 28000 ???? lda #0 520 28000 ???? sta (dlpnt),y 521 28000 ???? endif 522 28000 ???? 523 28000 ???? .PLOTSPRITEend 524 28000 ???? ENDM 525 28000 ???? 526 28000 ???? MAC sizeof 527 28000 ???? 528 28000 ???? ; echo's the size difference between the current address and the 529 28000 ???? ; a label that was passed as an argument. This is a quick way to 530 28000 ???? ; determine the size of a structure. 531 28000 ???? 532 28000 ???? .NAME SETSTR {1} 533 28000 ???? echo " The Size of",.NAME,"is:",[* - {1}]d,[* - {2}]d,"bytes." 534 28000 ???? ENDM 535 28000 ???? 536 28000 ???? ; 537 28000 ???? ; speakjet.inc 538 28000 ???? ; 539 28000 ???? ; 540 28000 ???? ; AtariVox Speech Synth Driver 541 28000 ???? ; 542 28000 ???? ; By Alex Herbert, 2004 543 28000 ???? ; 544 28000 ???? 545 28000 ???? 546 28000 ???? 547 28000 ???? 548 28000 ???? ; Constants 549 28000 ???? 550 28000 ???? 551 28000 ???? 00 01 SERIAL_OUTMASK equ $01 552 28000 ???? 00 02 SERIAL_RDYMASK equ $02 553 28000 ???? 554 28000 ???? 555 28000 ???? 556 28000 ???? ; Macros 557 28000 ???? 558 28000 ???? mac spkout 559 28000 ???? 560 28000 ???? ; check buffer-full status 561 28000 ???? lda SWCHA 562 28000 ???? and #SERIAL_RDYMASK 563 28000 ???? beq .speech_done 564 28000 ???? 565 28000 ???? ; get next speech byte 566 28000 ???? ldy #$00 567 28000 ???? lda (speech_addr),y 568 28000 ???? 569 28000 ???? ; invert data and check for end of string 570 28000 ???? eor #$ff 571 28000 ???? ;sta BACKGRND ; debug - uncomment to flash the background color with vox data 572 28000 ???? beq .speech_done 573 28000 ???? sta {1} 574 28000 ???? 575 28000 ???? ; increment speech pointer 576 28000 ???? inc speech_addr 577 28000 ???? bne .incaddr_skip 578 28000 ???? inc speech_addr+1 579 28000 ???? .incaddr_skip 580 28000 ???? 581 28000 ???? ; output byte as serial data 582 28000 ???? 583 28000 ???? sec ; start bit 584 28000 ???? .byteout_loop 585 28000 ???? ; put carry flag into bit 0 of SWACNT, preserving other bits 586 28000 ???? lda SWACNT ; 4 587 28000 ???? and #$fe ; 2 6 588 28000 ???? adc #$00 ; 2 8 589 28000 ???? sta SWACNT ; 4 12 590 28000 ???? 591 28000 ???? ; 10 bits sent? (1 start bit, 8 data bits, 1 stop bit) 592 28000 ???? cpy #$09 ; 2 14 593 28000 ???? beq .speech_done ; 2 16 594 28000 ???? iny ; 2 18 595 28000 ???? 596 28000 ???? ; the 7800 is 1.5x faster than the 2600. Waste more cycles here 597 28000 ???? ; to match the original baud rate... 598 28000 ???? ;ldx #$07 ; 2600 599 28000 ???? ldx #$0D 600 28000 ???? 601 28000 ???? .delay_loop 602 28000 ???? dex ; 603 28000 ???? bne .delay_loop ; 36 54 604 28000 ???? 605 28000 ???? ; shift next data bit into carry 606 28000 ???? lsr {1} ; 5 59 607 28000 ???? 608 28000 ???? ; and loop (branch always taken) 609 28000 ???? bpl .byteout_loop ; 3 62 cycles for loop 610 28000 ???? 611 28000 ???? .speech_done 612 28000 ???? 613 28000 ???? endm 614 28000 ???? 615 28000 ???? 616 28000 ???? mac speak 617 28000 ???? 618 28000 ???? lda #<{1} 619 28000 ???? sta speech_addr 620 28000 ???? lda #>{1} 621 28000 ???? sta speech_addr+1 622 28000 ???? 623 28000 ???? endm 624 28000 ???? 625 28000 ???? 626 28000 ???? 627 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 628 28000 ???? 629 28000 ???? processor 6502 630 28000 ???? ------- FILE 7800basic.h LEVEL 2 PASS 3 0 28000 ???? include "7800basic.h" 1 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 28000 ???? 3 28000 ???? processor 6502 ------- FILE 7800.h LEVEL 3 PASS 3 0 28000 ???? include "7800.h" 1 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 28000 ???? 3 28000 ???? ; 7800.h 4 28000 ???? ; Version 1.0, 2019/12/13 5 28000 ???? 6 28000 ???? ; This file defines hardware registers and memory mapping for the 7 28000 ???? ; Atari 7800. It is distributed as a companion machine-specific support package 8 28000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are 9 28000 ???? ; available at https://github.com/dasm-assembler/dasm 10 28000 ???? 11 28000 ???? 12 28000 ???? ; ******************** 7800 Hardware Addresses *************************** 13 28000 ???? ; 14 28000 ???? ; MEMORY MAP USAGE OF THE 7800 15 28000 ???? ; 16 28000 ???? ; 00 - 1F TIA REGISTERS 17 28000 ???? ; 20 - 3F MARIA REGISTERS 18 28000 ???? ; 40 - FF RAM block 0 (zero page) 19 28000 ???? ; 100 - 11F TIA (mirror of 0000-001f) 20 28000 ???? ; 120 - 13F MARIA (mirror of 0020-003f) 21 28000 ???? ; 140 - 1FF RAM block 1 (stack) 22 28000 ???? ; 200 - 21F TIA (mirror of 0000-001f) 23 28000 ???? ; 220 - 23F MARIA (mirror of 0020-003f) 24 28000 ???? ; 240 - 27F ??? 25 28000 ???? ; 280 - 2FF RIOT I/O ports and timers 26 28000 ???? ; 300 - 31F TIA (mirror of 0000-001f) 27 28000 ???? ; 320 - 33F MARIA (mirror of 0020-003f) 28 28000 ???? ; 340 - 3FF ??? 29 28000 ???? ; 400 - 47F unused address space 30 28000 ???? ; 480 - 4FF RIOT RAM 31 28000 ???? ; 500 - 57F unused address space 32 28000 ???? ; 580 - 5FF RIOT RAM (mirror of 0480-04ff) 33 28000 ???? ; 600 - 17FF unused address space 34 28000 ???? ; 1800 - 203F RAM 35 28000 ???? ; 2040 - 20FF RAM block 0 (mirror of 0000-001f) 36 28000 ???? ; 2100 - 213F RAM 37 28000 ???? ; 2140 - 21FF RAM block 1 (mirror of 0140-01ff) 38 28000 ???? ; 2200 - 27FF RAM 39 28000 ???? ; 2800 - 2FFF unavailable to external devices (bios bus-conflict) 40 28000 ???? ; 3000 - 3FFF unused address space 41 28000 ???? ; 4000 - FF7F potential cartridge address space 42 28000 ???? ; FF80 - FFF9 RESERVED FOR ENCRYPTION 43 28000 ???? ; FFFA - FFFF 6502 VECTORS 44 28000 ???? 45 28000 ???? 46 28000 ???? ;****** 00-1F ********* TIA REGISTERS ****************** 47 28000 ???? 48 28000 ???? 00 01 INPTCTRL = $01 ;Input control. In same address space as TIA. write-only 49 28000 ???? 00 01 VBLANK = $01 ;VBLANK. D7=1:dump paddle caps to ground. write-only 50 28000 ???? 00 02 _WSYNC = $02 ;Wait for HSync write-only 51 28000 ???? 00 03 _RSYNC = $03 ;Reset HSync write-only 52 28000 ???? 00 08 INPT0 = $08 ;Paddle Control Input 0 read-only 53 28000 ???? 00 09 INPT1 = $09 ;Paddle Control Input 1 read-only 54 28000 ???? 00 0a INPT2 = $0A ;Paddle Control Input 2 read-only 55 28000 ???? 00 0b INPT3 = $0B ;Paddle Control Input 3 read-only 56 28000 ???? 57 28000 ???? ; ** some common alternate names for INPT0/1/2/3 58 28000 ???? 00 08 INPT4B = $08 ;Joystick 0 Fire 1 read-only 59 28000 ???? 00 09 INPT4A = $09 ;Joystick 0 Fire 1 read-only 60 28000 ???? 00 0a INPT5B = $0A ;Joystick 1 Fire 0 read-only 61 28000 ???? 00 0b INPT5A = $0B ;Joystick 1 Fire 1 read-only 62 28000 ???? 00 08 INPT4R = $08 ;Joystick 0 Fire 1 read-only 63 28000 ???? 00 09 INPT4L = $09 ;Joystick 0 Fire 1 read-only 64 28000 ???? 00 0a INPT5R = $0A ;Joystick 1 Fire 0 read-only 65 28000 ???? 00 0b INPT5L = $0B ;Joystick 1 Fire 1 read-only 66 28000 ???? 67 28000 ???? 00 0c INPT4 = $0C ;Player 0 Fire Button Input read-only 68 28000 ???? 00 0d INPT5 = $0D ;Player 1 Fire Button Input read-only 69 28000 ???? 70 28000 ???? 00 15 AUDC0 = $15 ;Audio Control Channel 0 write-only 71 28000 ???? 00 16 AUDC1 = $16 ;Audio Control Channel 1 write-only 72 28000 ???? 00 17 AUDF0 = $17 ;Audio Frequency Channel 0 write-only 73 28000 ???? 00 18 AUDF1 = $18 ;Audio Frequency Channel 1 write-only 74 28000 ???? 00 19 AUDV0 = $19 ;Audio Volume Channel 0 write-only 75 28000 ???? 00 1a AUDV1 = $1A ;Audio Volume Channel 1 write-only 76 28000 ???? 77 28000 ???? ;****** 20-3F ********* MARIA REGISTERS *************** 78 28000 ???? 79 28000 ???? 00 20 BACKGRND = $20 ;Background Color write-only 80 28000 ???? 00 21 P0C1 = $21 ;Palette 0 - Color 1 write-only 81 28000 ???? 00 22 P0C2 = $22 ;Palette 0 - Color 2 write-only 82 28000 ???? 00 23 P0C3 = $23 ;Palette 0 - Color 3 write-only 83 28000 ???? 00 24 WSYNC = $24 ;Wait For Sync write-only 84 28000 ???? 00 25 P1C1 = $25 ;Palette 1 - Color 1 write-only 85 28000 ???? 00 26 P1C2 = $26 ;Palette 1 - Color 2 write-only 86 28000 ???? 00 27 P1C3 = $27 ;Palette 1 - Color 3 write-only 87 28000 ???? 00 28 MSTAT = $28 ;Maria Status read-only 88 28000 ???? 00 29 P2C1 = $29 ;Palette 2 - Color 1 write-only 89 28000 ???? 00 2a P2C2 = $2A ;Palette 2 - Color 2 write-only 90 28000 ???? 00 2b P2C3 = $2B ;Palette 2 - Color 3 write-only 91 28000 ???? 00 2c DPPH = $2C ;Display List List Pointer High write-only 92 28000 ???? 00 2d P3C1 = $2D ;Palette 3 - Color 1 write-only 93 28000 ???? 00 2e P3C2 = $2E ;Palette 3 - Color 2 write-only 94 28000 ???? 00 2f P3C3 = $2F ;Palette 3 - Color 3 write-only 95 28000 ???? 00 30 DPPL = $30 ;Display List List Pointer Low write-only 96 28000 ???? 00 31 P4C1 = $31 ;Palette 4 - Color 1 write-only 97 28000 ???? 00 32 P4C2 = $32 ;Palette 4 - Color 2 write-only 98 28000 ???? 00 33 P4C3 = $33 ;Palette 4 - Color 3 write-only 99 28000 ???? 00 34 CHARBASE = $34 ;Character Base Address write-only 100 28000 ???? 00 34 CHBASE = $34 ;Character Base Address write-only 101 28000 ???? 00 35 P5C1 = $35 ;Palette 5 - Color 1 write-only 102 28000 ???? 00 36 P5C2 = $36 ;Palette 5 - Color 2 write-only 103 28000 ???? 00 37 P5C3 = $37 ;Palette 5 - Color 3 write-only 104 28000 ???? 00 38 OFFSET = $38 ;Unused - Store zero here write-only 105 28000 ???? 00 39 P6C1 = $39 ;Palette 6 - Color 1 write-only 106 28000 ???? 00 3a P6C2 = $3A ;Palette 6 - Color 2 write-only 107 28000 ???? 00 3b P6C3 = $3B ;Palette 6 - Color 3 write-only 108 28000 ???? 00 3c CTRL = $3C ;Maria Control Register write-only 109 28000 ???? 00 3d P7C1 = $3D ;Palette 7 - Color 1 write-only 110 28000 ???? 00 3e P7C2 = $3E ;Palette 7 - Color 2 write-only 111 28000 ???? 00 3f P7C3 = $3F ;Palette 7 - Color 3 write-only 112 28000 ???? 113 28000 ???? 114 28000 ???? ;****** 280-2FF ******* PIA PORTS AND TIMERS ************ 115 28000 ???? 116 28000 ???? 02 80 SWCHA = $280 ;P0+P1 Joystick Directional Input read-write 117 28000 ???? 02 81 CTLSWA = $281 ;I/O Control for SCHWA read-write 118 28000 ???? 02 81 SWACNT = $281 ;VCS name for above read-write 119 28000 ???? 02 82 SWCHB = $282 ;Console Switches read-write 120 28000 ???? 02 83 CTLSWB = $283 ;I/O Control for SCHWB read-write 121 28000 ???? 02 83 SWBCNT = $283 ;VCS name for above read-write 122 28000 ???? 123 28000 ???? 02 84 INTIM = $284 ;Interval Timer Read read-only 124 28000 ???? 02 94 TIM1T = $294 ;Set 1 CLK Interval (838 nsec/interval) write-only 125 28000 ???? 02 95 TIMINT = $295 ;Interval Timer Interrupt read-only 126 28000 ???? 02 95 TIM8T = $295 ;Set 8 CLK Interval (6.7 usec/interval) write-only 127 28000 ???? 02 96 TIM64T = $296 ;Set 64 CLK Interval (63.6 usec/interval) write-only 128 28000 ???? 02 97 T1024T = $297 ;Set 1024 CLK Interval (858.2 usec/interval) write-only 129 28000 ???? 02 9e TIM64TI = $29E ;Interrupt timer 64T write-only 130 28000 ???? 131 28000 ???? ;XM 132 28000 ???? 04 70 XCTRL = $470 ; 7=YM2151 6=RAM@6k 5=RAM@4k 4=pokey@450 3=hsc 2=cart 1=RoF_bank1 0=RoF_bank2 133 28000 ???? 04 70 XCTRL1 = $470 134 28000 ???? 04 78 XCTRL2 = $478 135 28000 ???? 04 7c XCTRL3 = $47c 136 28000 ???? 04 71 XCTRL4 = $471 137 28000 ???? 04 72 XCTRL5 = $472 138 28000 ???? 139 28000 ???? ; Pokey register relative locations, since its base may be different 140 28000 ???? ; depending on the hardware. 141 28000 ???? 00 00 PAUDF0 = $0 ; extra audio channels and frequencies 142 28000 ???? 00 01 PAUDC0 = $1 143 28000 ???? 00 02 PAUDF1 = $2 144 28000 ???? 00 03 PAUDC1 = $3 145 28000 ???? 00 04 PAUDF2 = $4 146 28000 ???? 00 05 PAUDC2 = $5 147 28000 ???? 00 06 PAUDF3 = $6 148 28000 ???? 00 07 PAUDC3 = $7 149 28000 ???? 00 08 PAUDCTL = $8 ; Audio Control 150 28000 ???? 00 09 PSTIMER = $9 151 28000 ???? 00 0a PRANDOM = $A ; 17 bit polycounter pseudo random 152 28000 ???? 00 0f PSKCTL = $F ; Serial Port control ------- FILE 7800basic.h ------- FILE 7800basic_variable_redefs.h LEVEL 3 PASS 3 0 28000 ???? include "7800basic_variable_redefs.h" 1 28000 ???? ; This file contains variable mapping and other information for the current project. 2 28000 ???? 3 28000 ???? 00 00 vertical_shooting_laser_tallsprite_01_mode = $00 4 28000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width_twoscompliment = $00 5 28000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width = $00 6 28000 ???? 00 00 vertical_shooting_laser_tallsprite_00_mode = $00 7 28000 ???? 00 1f vertical_shooting_laser_tallsprite_00_width_twoscompliment = $1f 8 28000 ???? 00 01 vertical_shooting_laser_tallsprite_00_width = $01 9 28000 ???? 00 00 vertical_shooting_laser_mode = $00 10 28000 ???? 00 1f vertical_shooting_laser_width_twoscompliment = $1f 11 28000 ???? 00 01 vertical_shooting_laser_width = $01 12 28000 ???? 00 00 vertical_shooting_demo_explosion_upd10_tallsprite_00_mode = $00 13 28000 ???? 00 1e vertical_shooting_demo_explosion_upd10_tallsprite_00_width_twoscompliment = $1e 14 28000 ???? 00 02 vertical_shooting_demo_explosion_upd10_tallsprite_00_width = $02 15 28000 ???? 00 00 vertical_shooting_demo_explosion_upd10_mode = $00 16 28000 ???? 00 1e vertical_shooting_demo_explosion_upd10_width_twoscompliment = $1e 17 28000 ???? 00 02 vertical_shooting_demo_explosion_upd10_width = $02 18 28000 ???? 00 00 vertical_shooting_demo_explosion_upd9_tallsprite_00_mode = $00 19 28000 ???? 00 1e vertical_shooting_demo_explosion_upd9_tallsprite_00_width_twoscompliment = $1e 20 28000 ???? 00 02 vertical_shooting_demo_explosion_upd9_tallsprite_00_width = $02 21 28000 ???? 00 00 vertical_shooting_demo_explosion_upd9_mode = $00 22 28000 ???? 00 1e vertical_shooting_demo_explosion_upd9_width_twoscompliment = $1e 23 28000 ???? 00 02 vertical_shooting_demo_explosion_upd9_width = $02 24 28000 ???? 00 00 vertical_shooting_demo_explosion_upd8_tallsprite_00_mode = $00 25 28000 ???? 00 1e vertical_shooting_demo_explosion_upd8_tallsprite_00_width_twoscompliment = $1e 26 28000 ???? 00 02 vertical_shooting_demo_explosion_upd8_tallsprite_00_width = $02 27 28000 ???? 00 00 vertical_shooting_demo_explosion_upd8_mode = $00 28 28000 ???? 00 1e vertical_shooting_demo_explosion_upd8_width_twoscompliment = $1e 29 28000 ???? 00 02 vertical_shooting_demo_explosion_upd8_width = $02 30 28000 ???? 00 00 vertical_shooting_demo_explosion_upd7_tallsprite_00_mode = $00 31 28000 ???? 00 1e vertical_shooting_demo_explosion_upd7_tallsprite_00_width_twoscompliment = $1e 32 28000 ???? 00 02 vertical_shooting_demo_explosion_upd7_tallsprite_00_width = $02 33 28000 ???? 00 00 vertical_shooting_demo_explosion_upd7_mode = $00 34 28000 ???? 00 1e vertical_shooting_demo_explosion_upd7_width_twoscompliment = $1e 35 28000 ???? 00 02 vertical_shooting_demo_explosion_upd7_width = $02 36 28000 ???? 00 00 vertical_shooting_demo_explosion_upd6_tallsprite_00_mode = $00 37 28000 ???? 00 1e vertical_shooting_demo_explosion_upd6_tallsprite_00_width_twoscompliment = $1e 38 28000 ???? 00 02 vertical_shooting_demo_explosion_upd6_tallsprite_00_width = $02 39 28000 ???? 00 00 vertical_shooting_demo_explosion_upd6_mode = $00 40 28000 ???? 00 1e vertical_shooting_demo_explosion_upd6_width_twoscompliment = $1e 41 28000 ???? 00 02 vertical_shooting_demo_explosion_upd6_width = $02 42 28000 ???? 00 00 vertical_shooting_demo_explosion_upd5_tallsprite_00_mode = $00 43 28000 ???? 00 1e vertical_shooting_demo_explosion_upd5_tallsprite_00_width_twoscompliment = $1e 44 28000 ???? 00 02 vertical_shooting_demo_explosion_upd5_tallsprite_00_width = $02 45 28000 ???? 00 00 vertical_shooting_demo_explosion_upd5_mode = $00 46 28000 ???? 00 1e vertical_shooting_demo_explosion_upd5_width_twoscompliment = $1e 47 28000 ???? 00 02 vertical_shooting_demo_explosion_upd5_width = $02 48 28000 ???? 00 00 vertical_shooting_demo_explosion_upd4_tallsprite_00_mode = $00 49 28000 ???? 00 1e vertical_shooting_demo_explosion_upd4_tallsprite_00_width_twoscompliment = $1e 50 28000 ???? 00 02 vertical_shooting_demo_explosion_upd4_tallsprite_00_width = $02 51 28000 ???? 00 00 vertical_shooting_demo_explosion_upd4_mode = $00 52 28000 ???? 00 1e vertical_shooting_demo_explosion_upd4_width_twoscompliment = $1e 53 28000 ???? 00 02 vertical_shooting_demo_explosion_upd4_width = $02 54 28000 ???? 00 00 vertical_shooting_demo_explosion_upd3_tallsprite_00_mode = $00 55 28000 ???? 00 1e vertical_shooting_demo_explosion_upd3_tallsprite_00_width_twoscompliment = $1e 56 28000 ???? 00 02 vertical_shooting_demo_explosion_upd3_tallsprite_00_width = $02 57 28000 ???? 00 00 vertical_shooting_demo_explosion_upd3_mode = $00 58 28000 ???? 00 1e vertical_shooting_demo_explosion_upd3_width_twoscompliment = $1e 59 28000 ???? 00 02 vertical_shooting_demo_explosion_upd3_width = $02 60 28000 ???? 00 00 vertical_shooting_demo_explosion_upd2_tallsprite_00_mode = $00 61 28000 ???? 00 1e vertical_shooting_demo_explosion_upd2_tallsprite_00_width_twoscompliment = $1e 62 28000 ???? 00 02 vertical_shooting_demo_explosion_upd2_tallsprite_00_width = $02 63 28000 ???? 00 00 vertical_shooting_demo_explosion_upd2_mode = $00 64 28000 ???? 00 1e vertical_shooting_demo_explosion_upd2_width_twoscompliment = $1e 65 28000 ???? 00 02 vertical_shooting_demo_explosion_upd2_width = $02 66 28000 ???? 00 00 vertical_shooting_demo_explosion_upd1_tallsprite_00_mode = $00 67 28000 ???? 00 1e vertical_shooting_demo_explosion_upd1_tallsprite_00_width_twoscompliment = $1e 68 28000 ???? 00 02 vertical_shooting_demo_explosion_upd1_tallsprite_00_width = $02 69 28000 ???? 00 00 vertical_shooting_demo_explosion_upd1_mode = $00 70 28000 ???? 00 1e vertical_shooting_demo_explosion_upd1_width_twoscompliment = $1e 71 28000 ???? 00 02 vertical_shooting_demo_explosion_upd1_width = $02 72 28000 ???? 00 00 vertical_shooting_demo_explosion_upd0_tallsprite_00_mode = $00 73 28000 ???? 00 1e vertical_shooting_demo_explosion_upd0_tallsprite_00_width_twoscompliment = $1e 74 28000 ???? 00 02 vertical_shooting_demo_explosion_upd0_tallsprite_00_width = $02 75 28000 ???? 00 00 vertical_shooting_demo_explosion_upd0_mode = $00 76 28000 ???? 00 1e vertical_shooting_demo_explosion_upd0_width_twoscompliment = $1e 77 28000 ???? 00 02 vertical_shooting_demo_explosion_upd0_width = $02 78 28000 ???? 00 00 vertical_shooting_1up_mode = $00 79 28000 ???? 00 1e vertical_shooting_1up_width_twoscompliment = $1e 80 28000 ???? 00 02 vertical_shooting_1up_width = $02 81 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_mode = $00 82 28000 ???? 00 1e vertical_shooting_enemy01_tallsprite_00_width_twoscompliment = $1e 83 28000 ???? 00 02 vertical_shooting_enemy01_tallsprite_00_width = $02 84 28000 ???? 00 00 vertical_shooting_enemy01_mode = $00 85 28000 ???? 00 1e vertical_shooting_enemy01_width_twoscompliment = $1e 86 28000 ???? 00 02 vertical_shooting_enemy01_width = $02 87 28000 ???? 00 00 vertical_shooting_powerup_mode = $00 88 28000 ???? 00 1e vertical_shooting_powerup_width_twoscompliment = $1e 89 28000 ???? 00 02 vertical_shooting_powerup_width = $02 90 28000 ???? 00 00 vertical_shooting_enemyshot_mode = $00 91 28000 ???? 00 1f vertical_shooting_enemyshot_width_twoscompliment = $1f 92 28000 ???? 00 01 vertical_shooting_enemyshot_width = $01 93 28000 ???? 00 00 vertical_shooting_bullet_mode = $00 94 28000 ???? 00 1f vertical_shooting_bullet_width_twoscompliment = $1f 95 28000 ???? 00 01 vertical_shooting_bullet_width = $01 96 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_mode = $00 97 28000 ???? 00 1e vertical_shooting_ship_tallsprite_00_width_twoscompliment = $1e 98 28000 ???? 00 02 vertical_shooting_ship_tallsprite_00_width = $02 99 28000 ???? 00 00 vertical_shooting_ship_mode = $00 100 28000 ???? 00 1e vertical_shooting_ship_width_twoscompliment = $1e 101 28000 ???? 00 02 vertical_shooting_ship_width = $02 102 28000 ???? 00 00 vertical_shooting_font_mode = $00 103 28000 ???? 00 13 vertical_shooting_font_width_twoscompliment = $13 104 28000 ???? 00 2d vertical_shooting_font_width = $2d 105 28000 ???? 00 90 sfx_explosion_length = .skipL0337-sfx_explosion 106 28000 ???? 107 28000 ???? 00 30 sfx_plainlaser_length = .skipL0336-sfx_plainlaser 108 28000 ???? 109 28000 ???? 00 54 sfx_pulsecannon_length = .skipL0335-sfx_pulsecannon 110 28000 ???? 111 28000 ???? 00 36 sfx_bling_length = .skipL0334-sfx_bling 112 28000 ???? 113 28000 ???? 00 01 BOXCOLLISION = 1 114 28000 ???? 00 04 vertical_shooting_laser_tallsprite_00_color3 = $04 115 28000 ???? 00 42 vertical_shooting_laser_tallsprite_00_color2 = $42 116 28000 ???? 00 0f vertical_shooting_laser_tallsprite_00_color1 = $0f 117 28000 ???? 00 00 vertical_shooting_laser_tallsprite_00_color0 = $00 118 28000 ???? 00 04 vertical_shooting_laser_color3 = $04 119 28000 ???? 00 42 vertical_shooting_laser_color2 = $42 120 28000 ???? 00 0f vertical_shooting_laser_color1 = $0f 121 28000 ???? 00 00 vertical_shooting_laser_color0 = $00 122 28000 ???? 00 33 vertical_shooting_demo_explosion_upd10_tallsprite_00_color1 = $33 123 28000 ???? 00 00 vertical_shooting_demo_explosion_upd10_tallsprite_00_color0 = $00 124 28000 ???? 00 33 vertical_shooting_demo_explosion_upd10_color1 = $33 125 28000 ???? 00 00 vertical_shooting_demo_explosion_upd10_color0 = $00 126 28000 ???? 00 00 vertical_shooting_demo_explosion_upd9_tallsprite_00_color3 = 0 127 28000 ???? 00 33 vertical_shooting_demo_explosion_upd9_tallsprite_00_color2 = $33 128 28000 ???? 00 36 vertical_shooting_demo_explosion_upd9_tallsprite_00_color1 = $36 129 28000 ???? 00 00 vertical_shooting_demo_explosion_upd9_tallsprite_00_color0 = $00 130 28000 ???? 00 00 vertical_shooting_demo_explosion_upd9_color3 = 0 131 28000 ???? 00 33 vertical_shooting_demo_explosion_upd9_color2 = $33 132 28000 ???? 00 36 vertical_shooting_demo_explosion_upd9_color1 = $36 133 28000 ???? 00 00 vertical_shooting_demo_explosion_upd9_color0 = $00 134 28000 ???? 00 00 vertical_shooting_demo_explosion_upd8_tallsprite_00_color3 = 0 135 28000 ???? 00 33 vertical_shooting_demo_explosion_upd8_tallsprite_00_color2 = $33 136 28000 ???? 00 36 vertical_shooting_demo_explosion_upd8_tallsprite_00_color1 = $36 137 28000 ???? 00 00 vertical_shooting_demo_explosion_upd8_tallsprite_00_color0 = $00 138 28000 ???? 00 00 vertical_shooting_demo_explosion_upd8_color3 = 0 139 28000 ???? 00 33 vertical_shooting_demo_explosion_upd8_color2 = $33 140 28000 ???? 00 36 vertical_shooting_demo_explosion_upd8_color1 = $36 141 28000 ???? 00 00 vertical_shooting_demo_explosion_upd8_color0 = $00 142 28000 ???? 00 2b vertical_shooting_demo_explosion_upd7_tallsprite_00_color3 = $2b 143 28000 ???? 00 33 vertical_shooting_demo_explosion_upd7_tallsprite_00_color2 = $33 144 28000 ???? 00 36 vertical_shooting_demo_explosion_upd7_tallsprite_00_color1 = $36 145 28000 ???? 00 00 vertical_shooting_demo_explosion_upd7_tallsprite_00_color0 = $00 146 28000 ???? 00 2b vertical_shooting_demo_explosion_upd7_color3 = $2b 147 28000 ???? 00 33 vertical_shooting_demo_explosion_upd7_color2 = $33 148 28000 ???? 00 36 vertical_shooting_demo_explosion_upd7_color1 = $36 149 28000 ???? 00 00 vertical_shooting_demo_explosion_upd7_color0 = $00 150 28000 ???? 00 33 vertical_shooting_demo_explosion_upd6_tallsprite_00_color3 = $33 151 28000 ???? 00 2b vertical_shooting_demo_explosion_upd6_tallsprite_00_color2 = $2b 152 28000 ???? 00 36 vertical_shooting_demo_explosion_upd6_tallsprite_00_color1 = $36 153 28000 ???? 00 00 vertical_shooting_demo_explosion_upd6_tallsprite_00_color0 = $00 154 28000 ???? 00 33 vertical_shooting_demo_explosion_upd6_color3 = $33 155 28000 ???? 00 2b vertical_shooting_demo_explosion_upd6_color2 = $2b 156 28000 ???? 00 36 vertical_shooting_demo_explosion_upd6_color1 = $36 157 28000 ???? 00 00 vertical_shooting_demo_explosion_upd6_color0 = $00 158 28000 ???? 00 33 vertical_shooting_demo_explosion_upd5_tallsprite_00_color3 = $33 159 28000 ???? 00 2b vertical_shooting_demo_explosion_upd5_tallsprite_00_color2 = $2b 160 28000 ???? 00 36 vertical_shooting_demo_explosion_upd5_tallsprite_00_color1 = $36 161 28000 ???? 00 00 vertical_shooting_demo_explosion_upd5_tallsprite_00_color0 = $00 162 28000 ???? 00 33 vertical_shooting_demo_explosion_upd5_color3 = $33 163 28000 ???? 00 2b vertical_shooting_demo_explosion_upd5_color2 = $2b 164 28000 ???? 00 36 vertical_shooting_demo_explosion_upd5_color1 = $36 165 28000 ???? 00 00 vertical_shooting_demo_explosion_upd5_color0 = $00 166 28000 ???? 00 33 vertical_shooting_demo_explosion_upd4_tallsprite_00_color3 = $33 167 28000 ???? 00 36 vertical_shooting_demo_explosion_upd4_tallsprite_00_color2 = $36 168 28000 ???? 00 2b vertical_shooting_demo_explosion_upd4_tallsprite_00_color1 = $2b 169 28000 ???? 00 00 vertical_shooting_demo_explosion_upd4_tallsprite_00_color0 = $00 170 28000 ???? 00 33 vertical_shooting_demo_explosion_upd4_color3 = $33 171 28000 ???? 00 36 vertical_shooting_demo_explosion_upd4_color2 = $36 172 28000 ???? 00 2b vertical_shooting_demo_explosion_upd4_color1 = $2b 173 28000 ???? 00 00 vertical_shooting_demo_explosion_upd4_color0 = $00 174 28000 ???? 00 00 vertical_shooting_demo_explosion_upd3_tallsprite_00_color3 = 0 175 28000 ???? 00 36 vertical_shooting_demo_explosion_upd3_tallsprite_00_color2 = $36 176 28000 ???? 00 2b vertical_shooting_demo_explosion_upd3_tallsprite_00_color1 = $2b 177 28000 ???? 00 00 vertical_shooting_demo_explosion_upd3_tallsprite_00_color0 = $00 178 28000 ???? 00 00 vertical_shooting_demo_explosion_upd3_color3 = 0 179 28000 ???? 00 36 vertical_shooting_demo_explosion_upd3_color2 = $36 180 28000 ???? 00 2b vertical_shooting_demo_explosion_upd3_color1 = $2b 181 28000 ???? 00 00 vertical_shooting_demo_explosion_upd3_color0 = $00 182 28000 ???? 00 00 vertical_shooting_demo_explosion_upd2_tallsprite_00_color3 = 0 183 28000 ???? 00 36 vertical_shooting_demo_explosion_upd2_tallsprite_00_color2 = $36 184 28000 ???? 00 2b vertical_shooting_demo_explosion_upd2_tallsprite_00_color1 = $2b 185 28000 ???? 00 00 vertical_shooting_demo_explosion_upd2_tallsprite_00_color0 = $00 186 28000 ???? 00 00 vertical_shooting_demo_explosion_upd2_color3 = 0 187 28000 ???? 00 36 vertical_shooting_demo_explosion_upd2_color2 = $36 188 28000 ???? 00 2b vertical_shooting_demo_explosion_upd2_color1 = $2b 189 28000 ???? 00 00 vertical_shooting_demo_explosion_upd2_color0 = $00 190 28000 ???? 00 00 vertical_shooting_demo_explosion_upd1_tallsprite_00_color3 = 0 191 28000 ???? 00 2b vertical_shooting_demo_explosion_upd1_tallsprite_00_color2 = $2b 192 28000 ???? 00 36 vertical_shooting_demo_explosion_upd1_tallsprite_00_color1 = $36 193 28000 ???? 00 00 vertical_shooting_demo_explosion_upd1_tallsprite_00_color0 = $00 194 28000 ???? 00 00 vertical_shooting_demo_explosion_upd1_color3 = 0 195 28000 ???? 00 2b vertical_shooting_demo_explosion_upd1_color2 = $2b 196 28000 ???? 00 36 vertical_shooting_demo_explosion_upd1_color1 = $36 197 28000 ???? 00 00 vertical_shooting_demo_explosion_upd1_color0 = $00 198 28000 ???? 00 00 vertical_shooting_demo_explosion_upd0_tallsprite_00_color1 = 0 199 28000 ???? 00 00 vertical_shooting_demo_explosion_upd0_tallsprite_00_color0 = $00 200 28000 ???? 00 00 vertical_shooting_demo_explosion_upd0_color1 = 0 201 28000 ???? 00 00 vertical_shooting_demo_explosion_upd0_color0 = $00 202 28000 ???? 00 0f vertical_shooting_1up_color3 = $0f 203 28000 ???? 00 42 vertical_shooting_1up_color2 = $42 204 28000 ???? 00 04 vertical_shooting_1up_color1 = $04 205 28000 ???? 00 00 vertical_shooting_1up_color0 = $00 206 28000 ???? 00 83 vertical_shooting_enemy01_tallsprite_00_color3 = $83 207 28000 ???? 00 a8 vertical_shooting_enemy01_tallsprite_00_color2 = $a8 208 28000 ???? 00 bc vertical_shooting_enemy01_tallsprite_00_color1 = $bc 209 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_color0 = $00 210 28000 ???? 00 83 vertical_shooting_enemy01_color3 = $83 211 28000 ???? 00 a8 vertical_shooting_enemy01_color2 = $a8 212 28000 ???? 00 bc vertical_shooting_enemy01_color1 = $bc 213 28000 ???? 00 00 vertical_shooting_enemy01_color0 = $00 214 28000 ???? 00 36 vertical_shooting_powerup_color3 = $36 215 28000 ???? 00 33 vertical_shooting_powerup_color2 = $33 216 28000 ???? 00 2b vertical_shooting_powerup_color1 = $2b 217 28000 ???? 00 00 vertical_shooting_powerup_color0 = $00 218 28000 ???? 00 bc vertical_shooting_enemyshot_color3 = $bc 219 28000 ???? 00 83 vertical_shooting_enemyshot_color2 = $83 220 28000 ???? 00 a8 vertical_shooting_enemyshot_color1 = $a8 221 28000 ???? 00 00 vertical_shooting_enemyshot_color0 = $00 222 28000 ???? 00 1d vertical_shooting_bullet_color3 = $1d 223 28000 ???? 00 18 vertical_shooting_bullet_color2 = $18 224 28000 ???? 00 0f vertical_shooting_bullet_color1 = $0f 225 28000 ???? 00 00 vertical_shooting_bullet_color0 = $00 226 28000 ???? 00 42 vertical_shooting_ship_tallsprite_00_color3 = $42 227 28000 ???? 00 04 vertical_shooting_ship_tallsprite_00_color2 = $04 228 28000 ???? 00 0f vertical_shooting_ship_tallsprite_00_color1 = $0f 229 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_color0 = $00 230 28000 ???? 00 42 vertical_shooting_ship_color3 = $42 231 28000 ???? 00 04 vertical_shooting_ship_color2 = $04 232 28000 ???? 00 0f vertical_shooting_ship_color1 = $0f 233 28000 ???? 00 00 vertical_shooting_ship_color0 = $00 234 28000 ???? 00 0f vertical_shooting_font_color1 = $0f 235 28000 ???? 00 00 vertical_shooting_font_color0 = $00 236 28000 ???? 01 9c enemy_shotFlag = var92 237 28000 ???? 238 28000 ???? 01 9b max_bullets = var91 239 28000 ???? 240 28000 ???? 01 96 Mob_Pos_Y = var86 241 28000 ???? 01 95 Mob_Pos_X = var85 242 28000 ???? 01 94 Mob_SpeedY = var84 243 28000 ???? 01 93 Mob_SpeedX = var83 244 28000 ???? 01 91 Temp_Y_speed = Temp_YSu 245 28000 ???? 01 92 Temp_YSf = var82 246 28000 ???? 247 28000 ???? 01 91 Temp_YSu = var81 248 28000 ???? 249 28000 ???? 01 8f Temp_X_speed = Temp_XSu 250 28000 ???? 01 90 Temp_XSf = var80 251 28000 ???? 252 28000 ???? 01 8f Temp_XSu = var79 253 28000 ???? 254 28000 ???? 01 8d Total_speedY = Total_YSu 255 28000 ???? 01 8e Total_YSf = var78 256 28000 ???? 257 28000 ???? 01 8d Total_YSu = var77 258 28000 ???? 259 28000 ???? 01 8b Total_speedX = Total_XSu 260 28000 ???? 01 8c Total_XSf = var76 261 28000 ???? 262 28000 ???? 01 8b Total_XSu = var75 263 28000 ???? 264 28000 ???? 22 90 enemy_shot_direction = $2290 265 28000 ???? 266 28000 ???? 22 80 enemy_shot_active = $2280 267 28000 ???? 268 28000 ???? 22 70 enemy_shot_Syf = $2270 269 28000 ???? 270 28000 ???? 22 60 enemy_shot_Sy = $2260 271 28000 ???? 272 28000 ???? 22 50 enemy_shot_Sxf = $2250 273 28000 ???? 274 28000 ???? 22 40 enemy_shot_Sx = $2240 275 28000 ???? 276 28000 ???? 22 30 enemy_shot_Yf = $2230 277 28000 ???? 278 28000 ???? 22 20 enemy_shot_ypos = $2220 279 28000 ???? 280 28000 ???? 22 10 enemy_shot_Xf = $2210 281 28000 ???? 282 28000 ???? 22 00 enemy_shot_xpos = $2200 283 28000 ???? 284 28000 ???? 01 8a twinlaser_flag = var74 285 28000 ???? 286 28000 ???? 01 89 p_twinlaser4_time = var73 287 28000 ???? 288 28000 ???? 01 88 p_twinlaser3_time = var72 289 28000 ???? 290 28000 ???? 01 87 p_twinlaser2_time = var71 291 28000 ???? 292 28000 ???? 01 86 p_twinlaser1_time = var70 293 28000 ???? 294 28000 ???? 01 7d p_twinlaser4_y = var61 295 28000 ???? 01 7c p_twinlaser3_y = var60 296 28000 ???? 01 7b p_twinlaser2_y = var59 297 28000 ???? 01 7a p_twinlaser1_y = var58 298 28000 ???? 01 79 p_twinlaser4_x = var57 299 28000 ???? 01 78 p_twinlaser3_x = var56 300 28000 ???? 01 77 p_twinlaser2_x = var55 301 28000 ???? 01 76 p_twinlaser1_x = var54 302 28000 ???? 01 75 pBullet4_time = var53 303 28000 ???? 304 28000 ???? 01 74 pBullet3_time = var52 305 28000 ???? 306 28000 ???? 01 73 pBullet2_time = var51 307 28000 ???? 308 28000 ???? 01 72 pBullet1_time = var50 309 28000 ???? 310 28000 ???? 01 71 temp_y = var49 311 28000 ???? 312 28000 ???? 01 70 temp_x = var48 313 28000 ???? 314 28000 ???? 01 6f temp_loop = var47 315 28000 ???? 316 28000 ???? 01 6e explosion_aniframe = var46 317 28000 ???? 318 28000 ???? 01 6d extra_shipFlag = var45 319 28000 ???? 320 28000 ???? 01 6c extra_shipY = var44 321 28000 ???? 322 28000 ???? 01 6b extra_shipX = var43 323 28000 ???? 324 28000 ???? 01 6a power_up_Flag = var42 325 28000 ???? 326 28000 ???? 01 69 power_upY = var41 327 28000 ???? 328 28000 ???? 01 68 power_upX = var40 329 28000 ???? 330 28000 ???? 01 67 enemy_movement = var39 331 28000 ???? 332 28000 ???? 01 66 enemy_direction = var38 333 28000 ???? 334 28000 ???? 01 65 lives = var37 335 28000 ???? 336 28000 ???? 01 64 isDead_flag = var36 337 28000 ???? 338 28000 ???? 01 63 gameover_flag = var35 339 28000 ???? 340 28000 ???? 01 62 customTemp4 = var34 341 28000 ???? 342 28000 ???? 01 61 customTemp3 = var33 343 28000 ???? 344 28000 ???? 01 60 customTemp2 = var32 345 28000 ???? 346 28000 ???? 01 5f customTemp1 = var31 347 28000 ???? 348 28000 ???? 01 57 enemy01_speed = var23 349 28000 ???? 350 28000 ???? 01 56 enemy01_Slowdown = var22 351 28000 ???? 352 28000 ???? 01 55 enemy01_Flag = var21 353 28000 ???? 354 28000 ???? 01 54 player_flag = var20 355 28000 ???? 356 28000 ???? 01 53 enemy01_ypos = var19 357 28000 ???? 358 28000 ???? 01 49 enemy01_xpos = var9 359 28000 ???? 360 28000 ???? 01 48 timer = var8 361 28000 ???? 362 28000 ???? 23 10 pBullet4_y = $2310 363 28000 ???? 364 28000 ???? 23 00 pBullet3_y = $2300 365 28000 ???? 366 28000 ???? 22 f0 pBullet2_y = $22F0 367 28000 ???? 368 28000 ???? 22 e0 pBullet1_y = $22E0 369 28000 ???? 370 28000 ???? 22 d0 pBullet4_x = $22D0 371 28000 ???? 372 28000 ???? 22 c0 pBullet3_x = $22C0 373 28000 ???? 374 28000 ???? 22 b0 pBullet2_x = $22B0 375 28000 ???? 376 28000 ???? 22 a0 pBullet1_x = $22A0 377 28000 ???? 378 28000 ???? 01 47 joyposright = var7 379 28000 ???? 380 28000 ???? 01 46 joyposleft = var6 381 28000 ???? 382 28000 ???? 01 45 joyposdown = var5 383 28000 ???? 384 28000 ???? 01 44 joyposup = var4 385 28000 ???? 386 28000 ???? 01 43 fire_debounce = var3 387 28000 ???? 388 28000 ???? 01 42 playerY = var2 389 28000 ???? 390 28000 ???? 01 41 playerX = var1 391 28000 ???? 392 28000 ???? 01 40 frameCounter = var0 393 28000 ???? 394 28000 ???? 00 00 FALSE = 0 395 28000 ???? 396 28000 ???? 00 01 TRUE = 1 397 28000 ???? 398 28000 ???? 00 0c RATEOFFIRE = 12 399 28000 ???? 400 28000 ???? 00 01 collisionwrap = 1 401 28000 ???? 00 01 NTSC = 1 402 28000 ???? 00 c0 SCREENHEIGHT = 192 403 28000 ???? 00 01 CHECKOVERWRITE = 1 404 28000 ???? 00 08 ZONEHEIGHT = 8 405 28000 ???? 00 08 bankswitchmode = 8 406 28000 ???? 00 01 ROM128K = 1 ------- FILE 7800basic.h 6 28000 ???? 7 28000 ???? ;************ 7800 overall RAM map ************** 8 28000 ???? 9 28000 ???? ; 40-FF zero page RAM 10 28000 ???? ; 140-1FF RAM (stack) 11 28000 ???? ; 1800-203F RAM 12 28000 ???? ; 2100-213F RAM 13 28000 ???? ; 2200-27FF RAM 14 28000 ???? 15 28000 ???? ;************ 7800basic RAM usage map ************** 16 28000 ???? 17 28000 ???? ; 40-FF numerous defines, listed below 18 28000 ???? ; 140-1FF RAM (stack) 19 28000 ???? 20 28000 ???? ; 1800-187F DLL (1800-18DF with page flipping enabled) 21 28000 ???? ; 1880-1FFF DLs (18E0-1FFF with page flipping enabled) 22 28000 ???? 23 28000 ???? ; 2000-203F Reserved 24 28000 ???? ; 2100-213F Reserved 25 28000 ???? ; 2200-27FF Free 26 28000 ???? 27 28000 ???? 1f e0 eeprombuffer = $1FE0 28 28000 ???? 18 00 DLLMEM = $1800 29 28000 ???? 00 70 DBOFFSET = $70 ; $E0 length DL is /2 for double-buffering 30 28000 ???? 31 28000 ???? - ifconst PLOTVALUEPAGE 32 28000 ???? -VALBUFFER = (PLOTVALUEPAGE*256) 33 28000 ???? else 34 28000 ???? 20 00 VALBUFFER = $2000 ; to $203F ** never let VALBUFFER straddle pages 35 28000 ???? endif 36 28000 ???? 37 28000 ???? 38 28000 ???? 21 00 pausestate = $2100 39 28000 ???? 21 01 dlzero = $2101 ; zero to force end of $2100 DL, which we use in vblank and overscan 40 28000 ???? 21 02 sINPT1 = $2102 ; save register for joy button joy0 41 28000 ???? 21 03 sINPT3 = $2103 ; save register for joy button joy1 42 28000 ???? 21 04 currentbank = $2104 43 28000 ???? 44 28000 ???? 21 05 currentrambank = $2105 45 28000 ???? 21 06 charactermode = $2106 46 28000 ???? 21 07 sCTRL = $2107 47 28000 ???? 21 08 pokeydetected = $2108 48 28000 ???? 21 09 paldetected = $2109 49 28000 ???? 21 0a avoxdetected = $210A 50 28000 ???? 21 0b sCHARBASE = $210B ; save register for CHARBASE 51 28000 ???? 52 28000 ???? 21 0c hsdevice = $210C 53 28000 ???? 21 0d hsdifficulty = $210D 54 28000 ???? 21 0e hserror = $210E 55 28000 ???? 21 0f hsgameslot = $210F 56 28000 ???? 21 10 hsnewscoreline = $2110 57 28000 ???? 21 11 hsnewscorerank = $2111 58 28000 ???? 21 12 HSRAMTable = $2112 ; to $212F (30 bytes) Format: III*5, SSS*5 59 28000 ???? 21 12 HSRAMInitials = $2112 ; see above 60 28000 ???? 21 21 HSRAMScores = $2121 ; see above 61 28000 ???? 62 28000 ???? 21 31 ssCTRL = $2131 63 28000 ???? 21 32 ssCHARBASE = $2132 64 28000 ???? 21 33 hsdisplaymode = $2133 65 28000 ???? 21 34 gamedifficulty = $2134 66 28000 ???? 21 35 hsinitialpos = $2135 67 28000 ???? 21 36 hsinitialhold = $2136 68 28000 ???? 21 37 hscursorx = $2137 69 28000 ???? 21 38 hsjoydebounce = $2138 70 28000 ???? 21 39 hsswcha = $2139 71 28000 ???? 21 3a hsinpt1 = $213A 72 28000 ???? 21 3b hscolorchaseindex = $213B 73 28000 ???? 21 3c visibleDLLstart = $213C 74 28000 ???? 21 3d overscanDLLstart = $213D 75 28000 ???? 21 3e frameslost = $213E 76 28000 ???? 77 28000 ???? 78 28000 ???? 00 40 rand = $40 79 28000 ???? 00 41 rand16 = $41 80 28000 ???? 00 42 temp1 = $42 81 28000 ???? 00 43 temp2 = $43 82 28000 ???? 00 44 temp3 = $44 83 28000 ???? 00 45 temp4 = $45 84 28000 ???? 00 46 temp5 = $46 85 28000 ???? 00 47 temp6 = $47 86 28000 ???? 00 48 temp7 = $48 87 28000 ???? 00 49 temp8 = $49 88 28000 ???? 00 4a temp9 = $4a 89 28000 ???? 90 28000 ???? 00 4b pokeybase = $4b 91 28000 ???? 00 4b pokeybaselo = $4b 92 28000 ???? 00 4c pokeybasehi = $4c 93 28000 ???? 94 28000 ???? 00 4d visibleover = $4d 95 28000 ???? 96 28000 ???? 00 4e sfx1pointlo = $4e 97 28000 ???? 00 4f sfx2pointlo = $4f 98 28000 ???? 00 50 sfx1pointhi = $50 99 28000 ???? 00 51 sfx2pointhi = $51 100 28000 ???? 101 28000 ???? 00 52 sfx1priority = $52 102 28000 ???? 00 53 sfx2priority = $53 103 28000 ???? 00 54 sfx1poffset = $54 104 28000 ???? 00 55 sfx2poffset = $55 105 28000 ???? 106 28000 ???? 00 56 sfx1frames = $56 107 28000 ???? 00 57 sfx2frames = $57 108 28000 ???? 00 58 sfx1tick = $58 109 28000 ???? 00 59 sfx2tick = $59 110 28000 ???? 111 28000 ???? 00 5a tempmath = $5a 112 28000 ???? 113 28000 ???? 00 5b pokey1pointlo = $5b 114 28000 ???? 00 5c pokey1pointhi = $5c 115 28000 ???? 00 5d pokey2pointlo = $5d 116 28000 ???? 00 5e pokey2pointhi = $5e 117 28000 ???? 00 5f pokey3pointlo = $5f 118 28000 ???? 00 60 pokey3pointhi = $60 119 28000 ???? 00 61 pokey4pointlo = $61 120 28000 ???? 00 62 pokey4pointhi = $62 121 28000 ???? 122 28000 ???? 00 63 dlpnt = $63 ; to $64 123 28000 ???? 00 65 dlend = $65 ; to $81 - for 28 possible visible dll entries 124 28000 ???? 00 82 dlendsave = $82 ; to $9e - for 28 possible visible dll entries 125 28000 ???? 126 28000 ???? 00 9f speech_addr = $9f 127 28000 ???? 00 a0 speech_addr_hi = $a0 128 28000 ???? 129 28000 ???? 00 a1 HSGameTableLo = $a1 130 28000 ???? 00 a2 HSGameTableHi = $a2 131 28000 ???? 00 a3 HSVoxHi = $a3 132 28000 ???? 00 a4 HSVoxLo = $a4 133 28000 ???? 134 28000 ???? ;channel pointers 135 28000 ???? 136 28000 ???? 00 a5 songchannel1layer1lo = $a5 137 28000 ???? 00 a6 songchannel2layer1lo = $a6 138 28000 ???? 00 a7 songchannel3layer1lo = $a7 139 28000 ???? 00 a8 songchannel4layer1lo = $a8 140 28000 ???? 141 28000 ???? 00 a9 songchannel1layer2lo = $a9 142 28000 ???? 00 aa songchannel2layer2lo = $aA 143 28000 ???? 00 ab songchannel3layer2lo = $aB 144 28000 ???? 00 ac songchannel4layer2lo = $aC 145 28000 ???? 146 28000 ???? 00 ad songchannel1layer3lo = $aD 147 28000 ???? 00 ae songchannel2layer3lo = $aE 148 28000 ???? 00 af songchannel3layer3lo = $aF 149 28000 ???? 00 b0 songchannel4layer3lo = $b0 150 28000 ???? 151 28000 ???? 00 b1 songchannel1layer1hi = $b1 152 28000 ???? 00 b2 songchannel2layer1hi = $b2 153 28000 ???? 00 b3 songchannel3layer1hi = $b3 154 28000 ???? 00 b4 songchannel4layer1hi = $b4 155 28000 ???? 156 28000 ???? 00 b5 songchannel1layer2hi = $b5 157 28000 ???? 00 b6 songchannel2layer2hi = $b6 158 28000 ???? 00 b7 songchannel3layer2hi = $b7 159 28000 ???? 00 b8 songchannel4layer2hi = $b8 160 28000 ???? 161 28000 ???? 00 b9 songchannel1layer3hi = $b9 162 28000 ???? 00 ba songchannel2layer3hi = $bA 163 28000 ???? 00 bb songchannel3layer3hi = $bB 164 28000 ???? 00 bc songchannel4layer3hi = $bC 165 28000 ???? 166 28000 ???? 00 bd songdatalo = $bd 167 28000 ???? 00 be songdatahi = $be 168 28000 ???? 169 28000 ???? 00 bf inactivechannelcount = $bf 170 28000 ???? 171 28000 ???? 00 c0 songchannel1transpose = $c0 172 28000 ???? 00 c1 songchannel2transpose = $c1 173 28000 ???? 00 c2 songchannel3transpose = $c2 174 28000 ???? 00 c3 songchannel4transpose = $c3 175 28000 ???? 176 28000 ???? 00 c4 songstackindex = $c4 177 28000 ???? 178 28000 ???? 00 c5 songchannel1instrumentlo = $c5 179 28000 ???? 00 c6 songchannel2instrumentlo = $c6 180 28000 ???? 00 c7 songchannel3instrumentlo = $c7 181 28000 ???? 00 c8 songchannel4instrumentlo = $c8 182 28000 ???? 183 28000 ???? 00 c9 songchannel1instrumenthi = $c9 184 28000 ???? 00 ca songchannel2instrumenthi = $ca 185 28000 ???? 00 cb songchannel3instrumenthi = $cb 186 28000 ???? 00 cc songchannel4instrumenthi = $cc 187 28000 ???? 188 28000 ???? 00 cd sfx1notedata = $cd 189 28000 ???? 00 ce sfx2notedata = $ce 190 28000 ???? 191 28000 ???? 00 cf songloops = $cf 192 28000 ???? 193 28000 ???? 00 d0 songpointerlo = $D0 194 28000 ???? 00 d1 songpointerhi = $D1 195 28000 ???? 196 28000 ???? 00 d2 voxlock = $D2 197 28000 ???? 00 d3 voxqueuesize = $D3 198 28000 ???? 199 28000 ???? 00 d4 vblankroutines = $D4 200 28000 ???? 201 28000 ???? 00 d5 doublebufferstate = $D5 202 28000 ???? 00 d6 doublebufferdloffset = $D6 203 28000 ???? 00 d7 doublebufferbufferdirty = $D7 204 28000 ???? 205 28000 ???? 00 d8 inttemp1 = $D8 206 28000 ???? 00 d9 inttemp2 = $D9 207 28000 ???? 00 da inttemp3 = $DA 208 28000 ???? 00 db inttemp4 = $DB 209 28000 ???? 00 dc inttemp5 = $DC 210 28000 ???? 00 dd inttemp6 = $DD 211 28000 ???? 212 28000 ???? 00 de sfxschedulelock = $DE 213 28000 ???? 00 df sfxschedulemissed = $DF 214 28000 ???? 00 e0 sfxinstrumentlo = $E0 215 28000 ???? 00 e1 sfxinstrumenthi = $E1 216 28000 ???? 00 e2 sfxpitchoffset = $E2 217 28000 ???? 00 e3 sfxnoteindex = $E3 218 28000 ???? 219 28000 ???? 00 e4 CTLSWAs = $E4 220 28000 ???? 00 e5 CTLSWBs = $E5 221 28000 ???? 222 28000 ???? 00 e6 A = $e6 223 28000 ???? 00 e6 a = $e6 224 28000 ???? 00 e7 B = $e7 225 28000 ???? 00 e7 b = $e7 226 28000 ???? 00 e8 C = $e8 227 28000 ???? 00 e8 c = $e8 228 28000 ???? 00 e9 D = $e9 229 28000 ???? 00 e9 d = $e9 230 28000 ???? 00 ea E = $ea 231 28000 ???? 00 ea e = $ea 232 28000 ???? 00 eb F = $eb 233 28000 ???? 00 eb f = $eb 234 28000 ???? 00 ec G = $ec 235 28000 ???? 00 ec g = $ec 236 28000 ???? 00 ed H = $ed 237 28000 ???? 00 ed h = $ed 238 28000 ???? 00 ee I = $ee 239 28000 ???? 00 ee i = $ee 240 28000 ???? 00 ef J = $ef 241 28000 ???? 00 ef j = $ef 242 28000 ???? 00 f0 K = $f0 243 28000 ???? 00 f0 k = $f0 244 28000 ???? 00 f1 L = $f1 245 28000 ???? 00 f1 l = $f1 246 28000 ???? 00 f2 M = $f2 247 28000 ???? 00 f2 m = $f2 248 28000 ???? 00 f3 N = $f3 249 28000 ???? 00 f3 n = $f3 250 28000 ???? 00 f4 O = $f4 251 28000 ???? 00 f4 o = $f4 252 28000 ???? 00 f5 P = $f5 253 28000 ???? 00 f5 p = $f5 254 28000 ???? 00 f6 Q = $f6 255 28000 ???? 00 f6 q = $f6 256 28000 ???? 00 f7 R = $f7 257 28000 ???? 00 f7 r = $f7 258 28000 ???? 00 f8 S = $f8 259 28000 ???? 00 f8 s = $f8 260 28000 ???? 00 f9 T = $f9 261 28000 ???? 00 f9 t = $f9 262 28000 ???? 00 fa U = $fa 263 28000 ???? 00 fa u = $fa 264 28000 ???? 00 fb V = $fb 265 28000 ???? 00 fb v = $fb 266 28000 ???? 00 fc W = $fc 267 28000 ???? 00 fc w = $fc 268 28000 ???? 00 fd X = $fd 269 28000 ???? 00 fd x = $fd 270 28000 ???? 00 fe Y = $fe 271 28000 ???? 00 fe y = $fe 272 28000 ???? 00 ff Z = $ff 273 28000 ???? 00 ff z = $ff 274 28000 ???? 275 28000 ???? ; var0-var99 variables use the top of the stack 276 28000 ???? 01 40 var0 = $140 277 28000 ???? 01 41 var1 = $141 278 28000 ???? 01 42 var2 = $142 279 28000 ???? 01 43 var3 = $143 280 28000 ???? 01 44 var4 = $144 281 28000 ???? 01 45 var5 = $145 282 28000 ???? 01 46 var6 = $146 283 28000 ???? 01 47 var7 = $147 284 28000 ???? 01 48 var8 = $148 285 28000 ???? 01 49 var9 = $149 286 28000 ???? 01 4a var10 = $14a 287 28000 ???? 01 4b var11 = $14b 288 28000 ???? 01 4c var12 = $14c 289 28000 ???? 01 4d var13 = $14d 290 28000 ???? 01 4e var14 = $14e 291 28000 ???? 01 4f var15 = $14f 292 28000 ???? 01 50 var16 = $150 293 28000 ???? 01 51 var17 = $151 294 28000 ???? 01 52 var18 = $152 295 28000 ???? 01 53 var19 = $153 296 28000 ???? 01 54 var20 = $154 297 28000 ???? 01 55 var21 = $155 298 28000 ???? 01 56 var22 = $156 299 28000 ???? 01 57 var23 = $157 300 28000 ???? 01 58 var24 = $158 301 28000 ???? 01 59 var25 = $159 302 28000 ???? 01 5a var26 = $15a 303 28000 ???? 01 5b var27 = $15b 304 28000 ???? 01 5c var28 = $15c 305 28000 ???? 01 5d var29 = $15d 306 28000 ???? 01 5e var30 = $15e 307 28000 ???? 01 5f var31 = $15f 308 28000 ???? 01 60 var32 = $160 309 28000 ???? 01 61 var33 = $161 310 28000 ???? 01 62 var34 = $162 311 28000 ???? 01 63 var35 = $163 312 28000 ???? 01 64 var36 = $164 313 28000 ???? 01 65 var37 = $165 314 28000 ???? 01 66 var38 = $166 315 28000 ???? 01 67 var39 = $167 316 28000 ???? 01 68 var40 = $168 317 28000 ???? 01 69 var41 = $169 318 28000 ???? 01 6a var42 = $16a 319 28000 ???? 01 6b var43 = $16b 320 28000 ???? 01 6c var44 = $16c 321 28000 ???? 01 6d var45 = $16d 322 28000 ???? 01 6e var46 = $16e 323 28000 ???? 01 6f var47 = $16f 324 28000 ???? 01 70 var48 = $170 325 28000 ???? 01 71 var49 = $171 326 28000 ???? 01 72 var50 = $172 327 28000 ???? 01 73 var51 = $173 328 28000 ???? 01 74 var52 = $174 329 28000 ???? 01 75 var53 = $175 330 28000 ???? 01 76 var54 = $176 331 28000 ???? 01 77 var55 = $177 332 28000 ???? 01 78 var56 = $178 333 28000 ???? 01 79 var57 = $179 334 28000 ???? 01 7a var58 = $17a 335 28000 ???? 01 7b var59 = $17b 336 28000 ???? 01 7c var60 = $17c 337 28000 ???? 01 7d var61 = $17d 338 28000 ???? 01 7e var62 = $17e 339 28000 ???? 01 7f var63 = $17f 340 28000 ???? 01 80 var64 = $180 341 28000 ???? 01 81 var65 = $181 342 28000 ???? 01 82 var66 = $182 343 28000 ???? 01 83 var67 = $183 344 28000 ???? 01 84 var68 = $184 345 28000 ???? 01 85 var69 = $185 346 28000 ???? 01 86 var70 = $186 347 28000 ???? 01 87 var71 = $187 348 28000 ???? 01 88 var72 = $188 349 28000 ???? 01 89 var73 = $189 350 28000 ???? 01 8a var74 = $18a 351 28000 ???? 01 8b var75 = $18b 352 28000 ???? 01 8c var76 = $18c 353 28000 ???? 01 8d var77 = $18d 354 28000 ???? 01 8e var78 = $18e 355 28000 ???? 01 8f var79 = $18f 356 28000 ???? 01 90 var80 = $190 357 28000 ???? 01 91 var81 = $191 358 28000 ???? 01 92 var82 = $192 359 28000 ???? 01 93 var83 = $193 360 28000 ???? 01 94 var84 = $194 361 28000 ???? 01 95 var85 = $195 362 28000 ???? 01 96 var86 = $196 363 28000 ???? 01 97 var87 = $197 364 28000 ???? 01 98 var88 = $198 365 28000 ???? 01 99 var89 = $199 366 28000 ???? 01 9a var90 = $19a 367 28000 ???? 01 9b var91 = $19b 368 28000 ???? 01 9c var92 = $19c 369 28000 ???? 01 9d var93 = $19d 370 28000 ???? 01 9e var94 = $19e 371 28000 ???? 01 9f var95 = $19f 372 28000 ???? 01 a0 var96 = $1a0 373 28000 ???? 01 a1 var97 = $1a1 374 28000 ???? 01 a2 var98 = $1a2 375 28000 ???? 01 a3 var99 = $1a3 376 28000 ???? 377 U01c2 ???? SEG.U "7800basicRAM" 378 U01a4 ORG $1A4 379 U01a4 380 U01a4 ; MAX allocation locations are in comments... 381 U01a4 00 framecounter DS 1 ; $1A4 382 U01a5 00 countdownseconds DS 1 ; $1A5 383 U01a6 00 00 00 score0 DS 3 ; $1A6 $1A7 $1A8 384 U01a9 00 00 00 score1 DS 3 ; $1A9 $1AA $1AB 385 U01ac 00 pausebuttonflag DS 1 ; $1AC 386 U01ad 00 valbufend DS 1 ; $1AD 387 U01ae 00 valbufendsave DS 1 ; $1AE 388 U01af 00 finescrollx DS 1 ; $1AF 389 U01b0 00 finescrolly DS 1 ; $1B0 390 U01b1 00 joybuttonmode DS 1 ; $1B1 ; track joysticks that were changed to one-button mode 391 U01b2 00 interruptindex DS 1 ; $1B2 392 U01b3 393 U01b3 - ifconst DOUBLEBUFFER 394 U01b3 -doublebufferminimumframetarget DS 1 ; $1B3 395 U01b3 -doublebufferminimumframeindex DS 1 ; $1B4 396 U01b3 endif 397 U01b3 398 U01b3 00 pausedisable DS 1 ; $1B5 399 U01b4 00 XCTRL1s DS 1 ; $1B6 400 U01b5 401 U01b5 - ifconst AVOXVOICE 402 U01b5 -avoxenable DS 1 ; $1B7 403 U01b5 -tempavox DS 1 ; $1B8 404 U01b5 endif 405 U01b5 406 U01b5 - ifconst MUSICTRACKER 407 U01b5 -songtempo DS 1 ; $1B9 408 U01b5 -songtick DS 1 ; $1BA 409 U01b5 - 410 U01b5 -songchannel1layer1loops DS 1 ; $1BB 411 U01b5 -songchannel2layer1loops DS 1 ; $1BC 412 U01b5 -songchannel3layer1loops DS 1 ; $1BD 413 U01b5 -songchannel4layer1loops DS 1 ; $1BE 414 U01b5 - 415 U01b5 -songchannel1layer2loops DS 1 ; $1BF 416 U01b5 -songchannel2layer2loops DS 1 ; $1C0 417 U01b5 -songchannel3layer2loops DS 1 ; $1C1 418 U01b5 -songchannel4layer2loops DS 1 ; $1C2 419 U01b5 - 420 U01b5 -songchannel1layer3loops DS 1 ; $1C3 421 U01b5 -songchannel2layer3loops DS 1 ; $1C4 422 U01b5 -songchannel3layer3loops DS 1 ; $1C5 423 U01b5 -songchannel4layer3loops DS 1 ; $1C6 424 U01b5 - 425 U01b5 -songchannel1busywait DS 1 ; $1C7 426 U01b5 -songchannel2busywait DS 1 ; $1C8 427 U01b5 -songchannel3busywait DS 1 ; $1C9 428 U01b5 -songchannel4busywait DS 1 ; $1CA 429 U01b5 - 430 U01b5 -songchannel1stackdepth DS 1 ; $1CB 431 U01b5 -songchannel2stackdepth DS 1 ; $1CC 432 U01b5 -songchannel3stackdepth DS 1 ; $1CD 433 U01b5 -songchannel4stackdepth DS 1 ; $1CE 434 U01b5 endif 435 U01b5 436 U01b5 00 palframes DS 1 ; $1CF 437 U01b6 00 palfastframe DS 1 ; $1D0 438 U01b7 439 U01b7 - ifconst MOUSESUPPORT 440 U01b7 -port0resolution DS 1 ; $1D1 441 U01b7 -port1resolution DS 1 ; $1D2 442 U01b7 else 443 U01b7 - ifconst TRAKBALLSUPPORT 444 U01b7 -port0resolution DS 1 ; $1D1 445 U01b7 -port1resolution DS 1 ; $1D2 446 U01b7 endif 447 U01b7 endif 448 U01b7 449 U01b7 00 port0control DS 1 ; $1D3 450 U01b8 00 port1control DS 1 ; $1D4 451 U01b9 452 U01b9 ; port#control values... 453 U01b9 ; 1 = proline 454 U01b9 ; 2 = lightgun 455 U01b9 ; 3 = paddle 456 U01b9 ; 4 = trakball 457 U01b9 ; 5 = vcs joystick 458 U01b9 ; 6 = driving 459 U01b9 ; 7 = keypad 460 U01b9 ; 8 = st mouse/cx80 461 U01b9 ; 9 = amiga mouse 462 U01b9 ; 10 = atarivox 463 U01b9 464 U01b9 ; controller 0 data... 465 U01b9 00 paddleposition0 DS 1 ; $1D5 466 U01b9 01 b9 keypadmatrix0a = paddleposition0 467 U01b9 01 b9 drivingposition0 = paddleposition0 468 U01b9 01 b9 trakballx0 = paddleposition0 469 U01b9 01 b9 mousex0 = paddleposition0 470 U01b9 01 b9 lighttgunx0 = paddleposition0 471 U01b9 01 b9 snes2atari0lo = paddleposition0 472 U01ba 473 U01ba ; controller 1 data... 474 U01ba 00 paddleposition2 DS 1 ; $1D6 475 U01ba 01 ba keypadmatrix1a = paddleposition2 476 U01ba 01 ba drivingposition1 = paddleposition2 477 U01ba 01 ba trakballx1 = paddleposition2 478 U01ba 01 ba mousex1 = paddleposition2 479 U01ba 01 ba lightgunx1 = paddleposition2 480 U01ba 01 ba snes2atari1lo = paddleposition2 481 U01bb 482 U01bb ; controller 0 altdata... 483 U01bb 00 paddleposition1 DS 1 ; $1D7 484 U01bb 01 bb keypadmatrix0b = paddleposition1 485 U01bb 01 bb trakbally0 = paddleposition1 486 U01bb 01 bb mousey0 = paddleposition1 487 U01bb 01 bb lightguny0 = paddleposition1 488 U01bb 01 bb snes2atari0hi = paddleposition1 489 U01bc 490 U01bc ; controller 1 altdata... 491 U01bc 00 paddleposition3 DS 1 ; $1D8 492 U01bc 01 bc keypadmatrix1b = paddleposition3 493 U01bc 01 bc trakbally1 = paddleposition3 494 U01bc 01 bc mousey1 = paddleposition3 495 U01bc 01 bc lightguny1 = paddleposition3 496 U01bc 01 bc snes2atari1hi = paddleposition3 497 U01bd 498 U01bd ; controller state save. for trakball state+dir codes, rotary position codes 499 U01bd 00 controller0statesave DS 1 ; $1D9 500 U01bd 01 bd paddleprevious0 = controller0statesave 501 U01bd 01 bd mousecodex0 = controller0statesave 502 U01bd 01 bd trakballcodex0 = controller0statesave 503 U01bd 01 bd keypadmatrix0c = controller0statesave 504 U01bd 01 bd snesdetected0 = controller0statesave 505 U01be 506 U01be 00 controller1statesave DS 1 ; $1DA 507 U01be 01 be paddleprevious2 = controller1statesave 508 U01be 01 be mousecodex1 = controller1statesave 509 U01be 01 be trakballcodex1 = controller1statesave 510 U01be 01 be keypadmatrix1c = controller1statesave 511 U01be 01 be snesdetected1 = controller1statesave 512 U01bf 513 U01bf 00 paddleprevious1 DS 1 ; $1DB 514 U01bf 01 bf keypadmatrix0d = paddleprevious1 515 U01bf 01 bf mousecodey0 = paddleprevious1 516 U01bf 01 bf trakballcodey0 = paddleprevious1 517 U01c0 518 U01c0 00 paddleprevious3 DS 1 ; $1DC 519 U01c0 01 c0 keypadmatrix1d = paddleprevious3 520 U01c0 01 c0 mousecodey1 = paddleprevious3 521 U01c0 01 c0 trakballcodey1 = paddleprevious3 522 U01c1 523 U01c1 - ifconst pokeysupport 524 U01c1 -pokey1frames DS 1 ; $1DD 525 U01c1 -pokey1tick DS 1 ; $1DE 526 U01c1 -pokey2frames DS 1 ; $1DF 527 U01c1 -pokey2tick DS 1 ; $1E0 528 U01c1 -pokey3frames DS 1 ; $1E1 529 U01c1 -pokey3tick DS 1 ; $1E2 530 U01c1 -pokey4frames DS 1 ; $1E3 531 U01c1 -pokey4tick DS 1 ; $1E4 532 U01c1 -pokey1priority DS 1 ; $1E5 533 U01c1 -pokey1offset DS 1 ; $1E6 534 U01c1 -pokey2priority DS 1 ; $1E7 535 U01c1 -pokey2offset DS 1 ; $1E8 536 U01c1 -pokey3priority DS 1 ; $1E9 537 U01c1 -pokey3offset DS 1 ; $1EA 538 U01c1 -pokey4priority DS 1 ; $1EB 539 U01c1 -pokey4offset DS 1 ; $1EC 540 U01c1 endif 541 U01c1 542 U01c1 - ifconst pokeykeysupport 543 U01c1 -pokeylastkeycode DS 1 544 U01c1 -pokeykeycode DS 1 545 U01c1 -pokeykeydebounce DS 1 546 U01c1 endif 547 U01c1 548 U01c1 - ifconst RMT 549 U01c1 -rasterpause DS 1 550 U01c1 endif ; RMT 551 U01c1 - ifconst RMTVOLUME 552 U01c1 -rmtvolume DS 1 553 U01c1 endif ; RMTVOLUME 554 U01c1 - ifconst TIAVOLUME 555 U01c1 -tiavolume DS 1 556 U01c1 endif ; TIAVOLUME 557 U01c1 558 U01c1 - ifconst FOURBITFADE 559 U01c1 -fourbittemp1 DS 1 560 U01c1 -fourbitfadevalue DS 1 561 U01c1 -fourbittemp1int DS 1 562 U01c1 -fourbitfadevalueint DS 1 563 U01c1 endif ; FOURBITFADE 564 U01c1 565 U01c1 - ifconst SNES2ATARISUPPORT 566 U01c1 -snesport DS 1 567 U01c1 endif 568 U01c1 569 U01c1 ; see if we need an interrupthold byte... 570 U01c1 INTERRUPTNEEDED SET 0 571 U01c1 - ifconst .topscreenroutine 572 U01c1 -INTERRUPTNEEDED SET 1 573 U01c1 endif 574 U01c1 - ifconst .bottomscreenroutine 575 U01c1 -INTERRUPTNEEDED SET 1 576 U01c1 endif 577 U01c1 - ifconst .userinterrupt 578 U01c1 -INTERRUPTNEEDED SET 1 579 U01c1 endif 580 U01c1 - if INTERRUPTNEEDED = 1 581 U01c1 -interrupthold DS 1 ; $1ED 582 U01c1 endif 583 U01c1 584 U01c1 ifnconst CANARYOFF 585 U01c1 00 canary DS 1 ; $1EF 586 U01c2 endif 587 U01c2 588 U01c2 589 U01c2 - ifnconst bankswitchmode 590 U01c2 - echo " stack allowance:",[($1FF - .)/2]d,"nested subroutines." 591 U01c2 else stack allowance: 20 nested subroutines. 592 U01c2 echo " stack allowance:",[($1FF - .)/3]d,"nested subroutines." 593 U01c2 endif 594 U01c2 ifnconst CANARYOFF the canary is situated at: $1c1 595 U01c2 echo " the canary is situated at:",[canary] 596 U01c2 - else 597 U01c2 - echo " the canary is disabled." 598 U01c2 endif 599 U01c2 600 U01c2 ; $1EE - $1FF reserved for stack 601 U01c2 602 28000 ???? SEG "GAME" 603 28000 ???? ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite6.78b.asm ------- FILE 7800basic_variable_redefs.h LEVEL 2 PASS 3 0 28000 ???? include "7800basic_variable_redefs.h" 1 28000 ???? ; This file contains variable mapping and other information for the current project. 2 28000 ???? 3 28000 ???? 00 00 vertical_shooting_laser_tallsprite_01_mode = $00 4 28000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width_twoscompliment = $00 5 28000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width = $00 6 28000 ???? 00 00 vertical_shooting_laser_tallsprite_00_mode = $00 7 28000 ???? 00 1f vertical_shooting_laser_tallsprite_00_width_twoscompliment = $1f 8 28000 ???? 00 01 vertical_shooting_laser_tallsprite_00_width = $01 9 28000 ???? 00 00 vertical_shooting_laser_mode = $00 10 28000 ???? 00 1f vertical_shooting_laser_width_twoscompliment = $1f 11 28000 ???? 00 01 vertical_shooting_laser_width = $01 12 28000 ???? 00 00 vertical_shooting_demo_explosion_upd10_tallsprite_00_mode = $00 13 28000 ???? 00 1e vertical_shooting_demo_explosion_upd10_tallsprite_00_width_twoscompliment = $1e 14 28000 ???? 00 02 vertical_shooting_demo_explosion_upd10_tallsprite_00_width = $02 15 28000 ???? 00 00 vertical_shooting_demo_explosion_upd10_mode = $00 16 28000 ???? 00 1e vertical_shooting_demo_explosion_upd10_width_twoscompliment = $1e 17 28000 ???? 00 02 vertical_shooting_demo_explosion_upd10_width = $02 18 28000 ???? 00 00 vertical_shooting_demo_explosion_upd9_tallsprite_00_mode = $00 19 28000 ???? 00 1e vertical_shooting_demo_explosion_upd9_tallsprite_00_width_twoscompliment = $1e 20 28000 ???? 00 02 vertical_shooting_demo_explosion_upd9_tallsprite_00_width = $02 21 28000 ???? 00 00 vertical_shooting_demo_explosion_upd9_mode = $00 22 28000 ???? 00 1e vertical_shooting_demo_explosion_upd9_width_twoscompliment = $1e 23 28000 ???? 00 02 vertical_shooting_demo_explosion_upd9_width = $02 24 28000 ???? 00 00 vertical_shooting_demo_explosion_upd8_tallsprite_00_mode = $00 25 28000 ???? 00 1e vertical_shooting_demo_explosion_upd8_tallsprite_00_width_twoscompliment = $1e 26 28000 ???? 00 02 vertical_shooting_demo_explosion_upd8_tallsprite_00_width = $02 27 28000 ???? 00 00 vertical_shooting_demo_explosion_upd8_mode = $00 28 28000 ???? 00 1e vertical_shooting_demo_explosion_upd8_width_twoscompliment = $1e 29 28000 ???? 00 02 vertical_shooting_demo_explosion_upd8_width = $02 30 28000 ???? 00 00 vertical_shooting_demo_explosion_upd7_tallsprite_00_mode = $00 31 28000 ???? 00 1e vertical_shooting_demo_explosion_upd7_tallsprite_00_width_twoscompliment = $1e 32 28000 ???? 00 02 vertical_shooting_demo_explosion_upd7_tallsprite_00_width = $02 33 28000 ???? 00 00 vertical_shooting_demo_explosion_upd7_mode = $00 34 28000 ???? 00 1e vertical_shooting_demo_explosion_upd7_width_twoscompliment = $1e 35 28000 ???? 00 02 vertical_shooting_demo_explosion_upd7_width = $02 36 28000 ???? 00 00 vertical_shooting_demo_explosion_upd6_tallsprite_00_mode = $00 37 28000 ???? 00 1e vertical_shooting_demo_explosion_upd6_tallsprite_00_width_twoscompliment = $1e 38 28000 ???? 00 02 vertical_shooting_demo_explosion_upd6_tallsprite_00_width = $02 39 28000 ???? 00 00 vertical_shooting_demo_explosion_upd6_mode = $00 40 28000 ???? 00 1e vertical_shooting_demo_explosion_upd6_width_twoscompliment = $1e 41 28000 ???? 00 02 vertical_shooting_demo_explosion_upd6_width = $02 42 28000 ???? 00 00 vertical_shooting_demo_explosion_upd5_tallsprite_00_mode = $00 43 28000 ???? 00 1e vertical_shooting_demo_explosion_upd5_tallsprite_00_width_twoscompliment = $1e 44 28000 ???? 00 02 vertical_shooting_demo_explosion_upd5_tallsprite_00_width = $02 45 28000 ???? 00 00 vertical_shooting_demo_explosion_upd5_mode = $00 46 28000 ???? 00 1e vertical_shooting_demo_explosion_upd5_width_twoscompliment = $1e 47 28000 ???? 00 02 vertical_shooting_demo_explosion_upd5_width = $02 48 28000 ???? 00 00 vertical_shooting_demo_explosion_upd4_tallsprite_00_mode = $00 49 28000 ???? 00 1e vertical_shooting_demo_explosion_upd4_tallsprite_00_width_twoscompliment = $1e 50 28000 ???? 00 02 vertical_shooting_demo_explosion_upd4_tallsprite_00_width = $02 51 28000 ???? 00 00 vertical_shooting_demo_explosion_upd4_mode = $00 52 28000 ???? 00 1e vertical_shooting_demo_explosion_upd4_width_twoscompliment = $1e 53 28000 ???? 00 02 vertical_shooting_demo_explosion_upd4_width = $02 54 28000 ???? 00 00 vertical_shooting_demo_explosion_upd3_tallsprite_00_mode = $00 55 28000 ???? 00 1e vertical_shooting_demo_explosion_upd3_tallsprite_00_width_twoscompliment = $1e 56 28000 ???? 00 02 vertical_shooting_demo_explosion_upd3_tallsprite_00_width = $02 57 28000 ???? 00 00 vertical_shooting_demo_explosion_upd3_mode = $00 58 28000 ???? 00 1e vertical_shooting_demo_explosion_upd3_width_twoscompliment = $1e 59 28000 ???? 00 02 vertical_shooting_demo_explosion_upd3_width = $02 60 28000 ???? 00 00 vertical_shooting_demo_explosion_upd2_tallsprite_00_mode = $00 61 28000 ???? 00 1e vertical_shooting_demo_explosion_upd2_tallsprite_00_width_twoscompliment = $1e 62 28000 ???? 00 02 vertical_shooting_demo_explosion_upd2_tallsprite_00_width = $02 63 28000 ???? 00 00 vertical_shooting_demo_explosion_upd2_mode = $00 64 28000 ???? 00 1e vertical_shooting_demo_explosion_upd2_width_twoscompliment = $1e 65 28000 ???? 00 02 vertical_shooting_demo_explosion_upd2_width = $02 66 28000 ???? 00 00 vertical_shooting_demo_explosion_upd1_tallsprite_00_mode = $00 67 28000 ???? 00 1e vertical_shooting_demo_explosion_upd1_tallsprite_00_width_twoscompliment = $1e 68 28000 ???? 00 02 vertical_shooting_demo_explosion_upd1_tallsprite_00_width = $02 69 28000 ???? 00 00 vertical_shooting_demo_explosion_upd1_mode = $00 70 28000 ???? 00 1e vertical_shooting_demo_explosion_upd1_width_twoscompliment = $1e 71 28000 ???? 00 02 vertical_shooting_demo_explosion_upd1_width = $02 72 28000 ???? 00 00 vertical_shooting_demo_explosion_upd0_tallsprite_00_mode = $00 73 28000 ???? 00 1e vertical_shooting_demo_explosion_upd0_tallsprite_00_width_twoscompliment = $1e 74 28000 ???? 00 02 vertical_shooting_demo_explosion_upd0_tallsprite_00_width = $02 75 28000 ???? 00 00 vertical_shooting_demo_explosion_upd0_mode = $00 76 28000 ???? 00 1e vertical_shooting_demo_explosion_upd0_width_twoscompliment = $1e 77 28000 ???? 00 02 vertical_shooting_demo_explosion_upd0_width = $02 78 28000 ???? 00 00 vertical_shooting_1up_mode = $00 79 28000 ???? 00 1e vertical_shooting_1up_width_twoscompliment = $1e 80 28000 ???? 00 02 vertical_shooting_1up_width = $02 81 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_mode = $00 82 28000 ???? 00 1e vertical_shooting_enemy01_tallsprite_00_width_twoscompliment = $1e 83 28000 ???? 00 02 vertical_shooting_enemy01_tallsprite_00_width = $02 84 28000 ???? 00 00 vertical_shooting_enemy01_mode = $00 85 28000 ???? 00 1e vertical_shooting_enemy01_width_twoscompliment = $1e 86 28000 ???? 00 02 vertical_shooting_enemy01_width = $02 87 28000 ???? 00 00 vertical_shooting_powerup_mode = $00 88 28000 ???? 00 1e vertical_shooting_powerup_width_twoscompliment = $1e 89 28000 ???? 00 02 vertical_shooting_powerup_width = $02 90 28000 ???? 00 00 vertical_shooting_enemyshot_mode = $00 91 28000 ???? 00 1f vertical_shooting_enemyshot_width_twoscompliment = $1f 92 28000 ???? 00 01 vertical_shooting_enemyshot_width = $01 93 28000 ???? 00 00 vertical_shooting_bullet_mode = $00 94 28000 ???? 00 1f vertical_shooting_bullet_width_twoscompliment = $1f 95 28000 ???? 00 01 vertical_shooting_bullet_width = $01 96 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_mode = $00 97 28000 ???? 00 1e vertical_shooting_ship_tallsprite_00_width_twoscompliment = $1e 98 28000 ???? 00 02 vertical_shooting_ship_tallsprite_00_width = $02 99 28000 ???? 00 00 vertical_shooting_ship_mode = $00 100 28000 ???? 00 1e vertical_shooting_ship_width_twoscompliment = $1e 101 28000 ???? 00 02 vertical_shooting_ship_width = $02 102 28000 ???? 00 00 vertical_shooting_font_mode = $00 103 28000 ???? 00 13 vertical_shooting_font_width_twoscompliment = $13 104 28000 ???? 00 2d vertical_shooting_font_width = $2d 105 28000 ???? 00 90 sfx_explosion_length = .skipL0337-sfx_explosion 106 28000 ???? 107 28000 ???? 00 30 sfx_plainlaser_length = .skipL0336-sfx_plainlaser 108 28000 ???? 109 28000 ???? 00 54 sfx_pulsecannon_length = .skipL0335-sfx_pulsecannon 110 28000 ???? 111 28000 ???? 00 36 sfx_bling_length = .skipL0334-sfx_bling 112 28000 ???? 113 28000 ???? 00 01 BOXCOLLISION = 1 114 28000 ???? 00 04 vertical_shooting_laser_tallsprite_00_color3 = $04 115 28000 ???? 00 42 vertical_shooting_laser_tallsprite_00_color2 = $42 116 28000 ???? 00 0f vertical_shooting_laser_tallsprite_00_color1 = $0f 117 28000 ???? 00 00 vertical_shooting_laser_tallsprite_00_color0 = $00 118 28000 ???? 00 04 vertical_shooting_laser_color3 = $04 119 28000 ???? 00 42 vertical_shooting_laser_color2 = $42 120 28000 ???? 00 0f vertical_shooting_laser_color1 = $0f 121 28000 ???? 00 00 vertical_shooting_laser_color0 = $00 122 28000 ???? 00 33 vertical_shooting_demo_explosion_upd10_tallsprite_00_color1 = $33 123 28000 ???? 00 00 vertical_shooting_demo_explosion_upd10_tallsprite_00_color0 = $00 124 28000 ???? 00 33 vertical_shooting_demo_explosion_upd10_color1 = $33 125 28000 ???? 00 00 vertical_shooting_demo_explosion_upd10_color0 = $00 126 28000 ???? 00 00 vertical_shooting_demo_explosion_upd9_tallsprite_00_color3 = 0 127 28000 ???? 00 33 vertical_shooting_demo_explosion_upd9_tallsprite_00_color2 = $33 128 28000 ???? 00 36 vertical_shooting_demo_explosion_upd9_tallsprite_00_color1 = $36 129 28000 ???? 00 00 vertical_shooting_demo_explosion_upd9_tallsprite_00_color0 = $00 130 28000 ???? 00 00 vertical_shooting_demo_explosion_upd9_color3 = 0 131 28000 ???? 00 33 vertical_shooting_demo_explosion_upd9_color2 = $33 132 28000 ???? 00 36 vertical_shooting_demo_explosion_upd9_color1 = $36 133 28000 ???? 00 00 vertical_shooting_demo_explosion_upd9_color0 = $00 134 28000 ???? 00 00 vertical_shooting_demo_explosion_upd8_tallsprite_00_color3 = 0 135 28000 ???? 00 33 vertical_shooting_demo_explosion_upd8_tallsprite_00_color2 = $33 136 28000 ???? 00 36 vertical_shooting_demo_explosion_upd8_tallsprite_00_color1 = $36 137 28000 ???? 00 00 vertical_shooting_demo_explosion_upd8_tallsprite_00_color0 = $00 138 28000 ???? 00 00 vertical_shooting_demo_explosion_upd8_color3 = 0 139 28000 ???? 00 33 vertical_shooting_demo_explosion_upd8_color2 = $33 140 28000 ???? 00 36 vertical_shooting_demo_explosion_upd8_color1 = $36 141 28000 ???? 00 00 vertical_shooting_demo_explosion_upd8_color0 = $00 142 28000 ???? 00 2b vertical_shooting_demo_explosion_upd7_tallsprite_00_color3 = $2b 143 28000 ???? 00 33 vertical_shooting_demo_explosion_upd7_tallsprite_00_color2 = $33 144 28000 ???? 00 36 vertical_shooting_demo_explosion_upd7_tallsprite_00_color1 = $36 145 28000 ???? 00 00 vertical_shooting_demo_explosion_upd7_tallsprite_00_color0 = $00 146 28000 ???? 00 2b vertical_shooting_demo_explosion_upd7_color3 = $2b 147 28000 ???? 00 33 vertical_shooting_demo_explosion_upd7_color2 = $33 148 28000 ???? 00 36 vertical_shooting_demo_explosion_upd7_color1 = $36 149 28000 ???? 00 00 vertical_shooting_demo_explosion_upd7_color0 = $00 150 28000 ???? 00 33 vertical_shooting_demo_explosion_upd6_tallsprite_00_color3 = $33 151 28000 ???? 00 2b vertical_shooting_demo_explosion_upd6_tallsprite_00_color2 = $2b 152 28000 ???? 00 36 vertical_shooting_demo_explosion_upd6_tallsprite_00_color1 = $36 153 28000 ???? 00 00 vertical_shooting_demo_explosion_upd6_tallsprite_00_color0 = $00 154 28000 ???? 00 33 vertical_shooting_demo_explosion_upd6_color3 = $33 155 28000 ???? 00 2b vertical_shooting_demo_explosion_upd6_color2 = $2b 156 28000 ???? 00 36 vertical_shooting_demo_explosion_upd6_color1 = $36 157 28000 ???? 00 00 vertical_shooting_demo_explosion_upd6_color0 = $00 158 28000 ???? 00 33 vertical_shooting_demo_explosion_upd5_tallsprite_00_color3 = $33 159 28000 ???? 00 2b vertical_shooting_demo_explosion_upd5_tallsprite_00_color2 = $2b 160 28000 ???? 00 36 vertical_shooting_demo_explosion_upd5_tallsprite_00_color1 = $36 161 28000 ???? 00 00 vertical_shooting_demo_explosion_upd5_tallsprite_00_color0 = $00 162 28000 ???? 00 33 vertical_shooting_demo_explosion_upd5_color3 = $33 163 28000 ???? 00 2b vertical_shooting_demo_explosion_upd5_color2 = $2b 164 28000 ???? 00 36 vertical_shooting_demo_explosion_upd5_color1 = $36 165 28000 ???? 00 00 vertical_shooting_demo_explosion_upd5_color0 = $00 166 28000 ???? 00 33 vertical_shooting_demo_explosion_upd4_tallsprite_00_color3 = $33 167 28000 ???? 00 36 vertical_shooting_demo_explosion_upd4_tallsprite_00_color2 = $36 168 28000 ???? 00 2b vertical_shooting_demo_explosion_upd4_tallsprite_00_color1 = $2b 169 28000 ???? 00 00 vertical_shooting_demo_explosion_upd4_tallsprite_00_color0 = $00 170 28000 ???? 00 33 vertical_shooting_demo_explosion_upd4_color3 = $33 171 28000 ???? 00 36 vertical_shooting_demo_explosion_upd4_color2 = $36 172 28000 ???? 00 2b vertical_shooting_demo_explosion_upd4_color1 = $2b 173 28000 ???? 00 00 vertical_shooting_demo_explosion_upd4_color0 = $00 174 28000 ???? 00 00 vertical_shooting_demo_explosion_upd3_tallsprite_00_color3 = 0 175 28000 ???? 00 36 vertical_shooting_demo_explosion_upd3_tallsprite_00_color2 = $36 176 28000 ???? 00 2b vertical_shooting_demo_explosion_upd3_tallsprite_00_color1 = $2b 177 28000 ???? 00 00 vertical_shooting_demo_explosion_upd3_tallsprite_00_color0 = $00 178 28000 ???? 00 00 vertical_shooting_demo_explosion_upd3_color3 = 0 179 28000 ???? 00 36 vertical_shooting_demo_explosion_upd3_color2 = $36 180 28000 ???? 00 2b vertical_shooting_demo_explosion_upd3_color1 = $2b 181 28000 ???? 00 00 vertical_shooting_demo_explosion_upd3_color0 = $00 182 28000 ???? 00 00 vertical_shooting_demo_explosion_upd2_tallsprite_00_color3 = 0 183 28000 ???? 00 36 vertical_shooting_demo_explosion_upd2_tallsprite_00_color2 = $36 184 28000 ???? 00 2b vertical_shooting_demo_explosion_upd2_tallsprite_00_color1 = $2b 185 28000 ???? 00 00 vertical_shooting_demo_explosion_upd2_tallsprite_00_color0 = $00 186 28000 ???? 00 00 vertical_shooting_demo_explosion_upd2_color3 = 0 187 28000 ???? 00 36 vertical_shooting_demo_explosion_upd2_color2 = $36 188 28000 ???? 00 2b vertical_shooting_demo_explosion_upd2_color1 = $2b 189 28000 ???? 00 00 vertical_shooting_demo_explosion_upd2_color0 = $00 190 28000 ???? 00 00 vertical_shooting_demo_explosion_upd1_tallsprite_00_color3 = 0 191 28000 ???? 00 2b vertical_shooting_demo_explosion_upd1_tallsprite_00_color2 = $2b 192 28000 ???? 00 36 vertical_shooting_demo_explosion_upd1_tallsprite_00_color1 = $36 193 28000 ???? 00 00 vertical_shooting_demo_explosion_upd1_tallsprite_00_color0 = $00 194 28000 ???? 00 00 vertical_shooting_demo_explosion_upd1_color3 = 0 195 28000 ???? 00 2b vertical_shooting_demo_explosion_upd1_color2 = $2b 196 28000 ???? 00 36 vertical_shooting_demo_explosion_upd1_color1 = $36 197 28000 ???? 00 00 vertical_shooting_demo_explosion_upd1_color0 = $00 198 28000 ???? 00 00 vertical_shooting_demo_explosion_upd0_tallsprite_00_color1 = 0 199 28000 ???? 00 00 vertical_shooting_demo_explosion_upd0_tallsprite_00_color0 = $00 200 28000 ???? 00 00 vertical_shooting_demo_explosion_upd0_color1 = 0 201 28000 ???? 00 00 vertical_shooting_demo_explosion_upd0_color0 = $00 202 28000 ???? 00 0f vertical_shooting_1up_color3 = $0f 203 28000 ???? 00 42 vertical_shooting_1up_color2 = $42 204 28000 ???? 00 04 vertical_shooting_1up_color1 = $04 205 28000 ???? 00 00 vertical_shooting_1up_color0 = $00 206 28000 ???? 00 83 vertical_shooting_enemy01_tallsprite_00_color3 = $83 207 28000 ???? 00 a8 vertical_shooting_enemy01_tallsprite_00_color2 = $a8 208 28000 ???? 00 bc vertical_shooting_enemy01_tallsprite_00_color1 = $bc 209 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_color0 = $00 210 28000 ???? 00 83 vertical_shooting_enemy01_color3 = $83 211 28000 ???? 00 a8 vertical_shooting_enemy01_color2 = $a8 212 28000 ???? 00 bc vertical_shooting_enemy01_color1 = $bc 213 28000 ???? 00 00 vertical_shooting_enemy01_color0 = $00 214 28000 ???? 00 36 vertical_shooting_powerup_color3 = $36 215 28000 ???? 00 33 vertical_shooting_powerup_color2 = $33 216 28000 ???? 00 2b vertical_shooting_powerup_color1 = $2b 217 28000 ???? 00 00 vertical_shooting_powerup_color0 = $00 218 28000 ???? 00 bc vertical_shooting_enemyshot_color3 = $bc 219 28000 ???? 00 83 vertical_shooting_enemyshot_color2 = $83 220 28000 ???? 00 a8 vertical_shooting_enemyshot_color1 = $a8 221 28000 ???? 00 00 vertical_shooting_enemyshot_color0 = $00 222 28000 ???? 00 1d vertical_shooting_bullet_color3 = $1d 223 28000 ???? 00 18 vertical_shooting_bullet_color2 = $18 224 28000 ???? 00 0f vertical_shooting_bullet_color1 = $0f 225 28000 ???? 00 00 vertical_shooting_bullet_color0 = $00 226 28000 ???? 00 42 vertical_shooting_ship_tallsprite_00_color3 = $42 227 28000 ???? 00 04 vertical_shooting_ship_tallsprite_00_color2 = $04 228 28000 ???? 00 0f vertical_shooting_ship_tallsprite_00_color1 = $0f 229 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_color0 = $00 230 28000 ???? 00 42 vertical_shooting_ship_color3 = $42 231 28000 ???? 00 04 vertical_shooting_ship_color2 = $04 232 28000 ???? 00 0f vertical_shooting_ship_color1 = $0f 233 28000 ???? 00 00 vertical_shooting_ship_color0 = $00 234 28000 ???? 00 0f vertical_shooting_font_color1 = $0f 235 28000 ???? 00 00 vertical_shooting_font_color0 = $00 236 28000 ???? 01 9c enemy_shotFlag = var92 237 28000 ???? 238 28000 ???? 01 9b max_bullets = var91 239 28000 ???? 240 28000 ???? 01 96 Mob_Pos_Y = var86 241 28000 ???? 01 95 Mob_Pos_X = var85 242 28000 ???? 01 94 Mob_SpeedY = var84 243 28000 ???? 01 93 Mob_SpeedX = var83 244 28000 ???? 01 91 Temp_Y_speed = Temp_YSu 245 28000 ???? 01 92 Temp_YSf = var82 246 28000 ???? 247 28000 ???? 01 91 Temp_YSu = var81 248 28000 ???? 249 28000 ???? 01 8f Temp_X_speed = Temp_XSu 250 28000 ???? 01 90 Temp_XSf = var80 251 28000 ???? 252 28000 ???? 01 8f Temp_XSu = var79 253 28000 ???? 254 28000 ???? 01 8d Total_speedY = Total_YSu 255 28000 ???? 01 8e Total_YSf = var78 256 28000 ???? 257 28000 ???? 01 8d Total_YSu = var77 258 28000 ???? 259 28000 ???? 01 8b Total_speedX = Total_XSu 260 28000 ???? 01 8c Total_XSf = var76 261 28000 ???? 262 28000 ???? 01 8b Total_XSu = var75 263 28000 ???? 264 28000 ???? 22 90 enemy_shot_direction = $2290 265 28000 ???? 266 28000 ???? 22 80 enemy_shot_active = $2280 267 28000 ???? 268 28000 ???? 22 70 enemy_shot_Syf = $2270 269 28000 ???? 270 28000 ???? 22 60 enemy_shot_Sy = $2260 271 28000 ???? 272 28000 ???? 22 50 enemy_shot_Sxf = $2250 273 28000 ???? 274 28000 ???? 22 40 enemy_shot_Sx = $2240 275 28000 ???? 276 28000 ???? 22 30 enemy_shot_Yf = $2230 277 28000 ???? 278 28000 ???? 22 20 enemy_shot_ypos = $2220 279 28000 ???? 280 28000 ???? 22 10 enemy_shot_Xf = $2210 281 28000 ???? 282 28000 ???? 22 00 enemy_shot_xpos = $2200 283 28000 ???? 284 28000 ???? 01 8a twinlaser_flag = var74 285 28000 ???? 286 28000 ???? 01 89 p_twinlaser4_time = var73 287 28000 ???? 288 28000 ???? 01 88 p_twinlaser3_time = var72 289 28000 ???? 290 28000 ???? 01 87 p_twinlaser2_time = var71 291 28000 ???? 292 28000 ???? 01 86 p_twinlaser1_time = var70 293 28000 ???? 294 28000 ???? 01 7d p_twinlaser4_y = var61 295 28000 ???? 01 7c p_twinlaser3_y = var60 296 28000 ???? 01 7b p_twinlaser2_y = var59 297 28000 ???? 01 7a p_twinlaser1_y = var58 298 28000 ???? 01 79 p_twinlaser4_x = var57 299 28000 ???? 01 78 p_twinlaser3_x = var56 300 28000 ???? 01 77 p_twinlaser2_x = var55 301 28000 ???? 01 76 p_twinlaser1_x = var54 302 28000 ???? 01 75 pBullet4_time = var53 303 28000 ???? 304 28000 ???? 01 74 pBullet3_time = var52 305 28000 ???? 306 28000 ???? 01 73 pBullet2_time = var51 307 28000 ???? 308 28000 ???? 01 72 pBullet1_time = var50 309 28000 ???? 310 28000 ???? 01 71 temp_y = var49 311 28000 ???? 312 28000 ???? 01 70 temp_x = var48 313 28000 ???? 314 28000 ???? 01 6f temp_loop = var47 315 28000 ???? 316 28000 ???? 01 6e explosion_aniframe = var46 317 28000 ???? 318 28000 ???? 01 6d extra_shipFlag = var45 319 28000 ???? 320 28000 ???? 01 6c extra_shipY = var44 321 28000 ???? 322 28000 ???? 01 6b extra_shipX = var43 323 28000 ???? 324 28000 ???? 01 6a power_up_Flag = var42 325 28000 ???? 326 28000 ???? 01 69 power_upY = var41 327 28000 ???? 328 28000 ???? 01 68 power_upX = var40 329 28000 ???? 330 28000 ???? 01 67 enemy_movement = var39 331 28000 ???? 332 28000 ???? 01 66 enemy_direction = var38 333 28000 ???? 334 28000 ???? 01 65 lives = var37 335 28000 ???? 336 28000 ???? 01 64 isDead_flag = var36 337 28000 ???? 338 28000 ???? 01 63 gameover_flag = var35 339 28000 ???? 340 28000 ???? 01 62 customTemp4 = var34 341 28000 ???? 342 28000 ???? 01 61 customTemp3 = var33 343 28000 ???? 344 28000 ???? 01 60 customTemp2 = var32 345 28000 ???? 346 28000 ???? 01 5f customTemp1 = var31 347 28000 ???? 348 28000 ???? 01 57 enemy01_speed = var23 349 28000 ???? 350 28000 ???? 01 56 enemy01_Slowdown = var22 351 28000 ???? 352 28000 ???? 01 55 enemy01_Flag = var21 353 28000 ???? 354 28000 ???? 01 54 player_flag = var20 355 28000 ???? 356 28000 ???? 01 53 enemy01_ypos = var19 357 28000 ???? 358 28000 ???? 01 49 enemy01_xpos = var9 359 28000 ???? 360 28000 ???? 01 48 timer = var8 361 28000 ???? 362 28000 ???? 23 10 pBullet4_y = $2310 363 28000 ???? 364 28000 ???? 23 00 pBullet3_y = $2300 365 28000 ???? 366 28000 ???? 22 f0 pBullet2_y = $22F0 367 28000 ???? 368 28000 ???? 22 e0 pBullet1_y = $22E0 369 28000 ???? 370 28000 ???? 22 d0 pBullet4_x = $22D0 371 28000 ???? 372 28000 ???? 22 c0 pBullet3_x = $22C0 373 28000 ???? 374 28000 ???? 22 b0 pBullet2_x = $22B0 375 28000 ???? 376 28000 ???? 22 a0 pBullet1_x = $22A0 377 28000 ???? 378 28000 ???? 01 47 joyposright = var7 379 28000 ???? 380 28000 ???? 01 46 joyposleft = var6 381 28000 ???? 382 28000 ???? 01 45 joyposdown = var5 383 28000 ???? 384 28000 ???? 01 44 joyposup = var4 385 28000 ???? 386 28000 ???? 01 43 fire_debounce = var3 387 28000 ???? 388 28000 ???? 01 42 playerY = var2 389 28000 ???? 390 28000 ???? 01 41 playerX = var1 391 28000 ???? 392 28000 ???? 01 40 frameCounter = var0 393 28000 ???? 394 28000 ???? 00 00 FALSE = 0 395 28000 ???? 396 28000 ???? 00 01 TRUE = 1 397 28000 ???? 398 28000 ???? 00 0c RATEOFFIRE = 12 399 28000 ???? 400 28000 ???? 00 01 collisionwrap = 1 401 28000 ???? 00 01 NTSC = 1 402 28000 ???? 00 c0 SCREENHEIGHT = 192 403 28000 ???? 00 01 CHECKOVERWRITE = 1 404 28000 ???? 00 08 ZONEHEIGHT = 8 405 28000 ???? 00 08 bankswitchmode = 8 406 28000 ???? 00 01 ROM128K = 1 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite6.78b.asm 633 28000 ???? 634 28000 ???? ; BEADHEADER... disabled for now 635 28000 ???? ; A BEAD header gets automatically incorportated into the ROM header. 636 28000 ???? ; For more BEAD executable info, check out the spec... 637 28000 ???? ; http://7800.8bitdev.org/index.php/The_Atari_7800_BEAD_Execuable_Specification 638 28000 ???? 639 28000 ???? 00 01 GAMEDESCRIPTIONSET = 1 640 28000 ???? 4e 61 6d 65 GAMEDESCRIPTION = "Test Name" 641 28000 ???? 642 28000 ???? 643 28000 ???? 00 40 BDHSC = %01000000 644 28000 ???? 00 20 BDYM = %00100000 645 28000 ???? 00 10 BDPOKEY = %00010000 646 28000 ???? 00 08 BDROF = %00001000 647 28000 ???? 00 00 BD16K = %00000000 648 28000 ???? 00 01 BD32K = %00000001 649 28000 ???? 00 02 BD48K = %00000010 650 28000 ???? 00 05 BD1800 = %00000101 651 28000 ???? 00 06 BD4000 = %00000110 652 28000 ???? 653 28000 ???? - ifconst BEADHEADER 654 28000 ???? -BEADHARDWARE SET 0 655 28000 ???? - ifconst ROM16K 656 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD16K) 657 28000 ???? - endif 658 28000 ???? - ifconst ROM32K 659 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD32K) 660 28000 ???? - endif 661 28000 ???? - ifconst ROM48K 662 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD48K) 663 28000 ???? - endif 664 28000 ???? - ifconst pokeysupport 665 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDPOKEY) 666 28000 ???? - endif 667 28000 ???? - ifconst HSSUPPORT 668 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDHSC) 669 28000 ???? - endif 670 28000 ???? endif 671 28000 ???? 672 28000 ???? ;start address of cart... 673 28000 ???? 674 28000 ???? BANK_WAS_SET SET 0 675 28000 ???? 676 28000 ???? - ifconst ROM8K 677 28000 ???? - ORG $E000,0 678 28000 ???? -BANK_WAS_SET SET 1 679 28000 ???? endif ; ROM8K 680 28000 ???? 681 28000 ???? - ifconst ROM16K 682 28000 ???? - ORG $C000,0 683 28000 ???? -BANK_WAS_SET SET 1 684 28000 ???? - ifconst BEADHEADER 685 28000 ???? - .byte $BE,$AD,BEADHARDWARE 686 28000 ???? - ifconst GAMEDESCRIPTION 687 28000 ???? - CLC 688 28000 ???? - BCC _SKIPDESCRIPTION 689 28000 ???? - .byte GAMEDESCRIPTION,0 690 28000 ???? -_SKIPDESCRIPTION 691 28000 ???? - endif 692 28000 ???? - jmp ($FFFC) 693 28000 ???? - endif ; GAMEDESCRIPTION 694 28000 ???? endif ; BEADHEADER 695 28000 ???? endif ; ROM16K 696 28000 ???? 697 28000 ???? - ifconst ROM32K 698 28000 ???? - ORG $8000,0 699 28000 ???? -BANK_WAS_SET SET 1 700 28000 ???? - ifconst BEADHEADER 701 28000 ???? - .byte $BE,$AD,BEADHARDWARE 702 28000 ???? - ifconst GAMEDESCRIPTION 703 28000 ???? - CLC 704 28000 ???? - BCC _SKIPDESCRIPTION 705 28000 ???? - .byte GAMEDESCRIPTION,0 706 28000 ???? -_SKIPDESCRIPTION 707 28000 ???? - endif 708 28000 ???? - jmp ($FFFC) 709 28000 ???? - endif ; GAMEDESCRIPTION 710 28000 ???? endif ; BEADHEADER 711 28000 ???? endif ; ROM32K 712 28000 ???? 713 28000 ???? - ifconst ROM48K 714 28000 ???? - ORG $4000,0 715 28000 ???? -BANK_WAS_SET SET 1 716 28000 ???? - ifconst BEADHEADER 717 28000 ???? - .byte $BE,$AD,BEADHARDWARE 718 28000 ???? - ifconst GAMEDESCRIPTIONSET 719 28000 ???? - CLC 720 28000 ???? - BCC _SKIPDESCRIPTION 721 28000 ???? - .byte GAMEDESCRIPTION,0 722 28000 ???? -_SKIPDESCRIPTION 723 28000 ???? - endif ; GAMEDESCRIPTIONSET 724 28000 ???? - jmp ($FFFC) 725 28000 ???? - endif ; BEADHEADER 726 28000 ???? endif ; ROM48K 727 28000 ???? 728 28000 ???? - ifconst ROM52K 729 28000 ???? -BANK_WAS_SET SET 1 730 28000 ???? - ORG $3000,0 731 28000 ???? endif ; ROM52K 732 28000 ???? 733 28000 ???? ifconst bankswitchmode 734 28000 ???? - ifconst ROMAT4K 735 28000 ???? -BANK_WAS_SET SET 1 736 28000 ???? - ORG $4000,0 737 28000 ???? - RORG $4000 738 28000 ???? else ; ROMAT4K 739 28000 ???? BANK_WAS_SET SET 1 740 8000 ORG $8000,0 741 8000 RORG $8000 742 8000 endif 743 8000 endif 744 8000 745 8000 - if BANK_WAS_SET = 0 746 8000 - ORG $8000,0 ; default is 32K 747 8000 endif 748 8000 749 8000 ;7800basic v0.20 Jul 29 2022 10:37:24 750 8000 SPACEOVERFLOW SET 0 751 8000 game 752 8000 . 753 8000 ;; 754 8000 755 8000 .L00 ;; set romsize 128k 756 8000 757 8000 .L01 ;; set zoneheight 8 758 8000 759 8000 .L02 ;; set zoneprotection on 760 8000 761 8000 .L03 ;; set tallsprite on 762 8000 763 8000 .L04 ;; set screenheight 192 764 8000 765 8000 .L05 ;; set basepath gfx 766 8000 767 8000 .L06 ;; set tv ntsc 768 8000 769 8000 .L07 ;; set collisionwrap on 770 8000 771 8000 .L08 ;; set doublewide off 772 8000 773 8000 .L09 ;; displaymode 160A 774 8000 775 8000 a9 40 lda #%01000000 ;Enable DMA, mode=160x2/160x4 776 8002 85 3c sta CTRL 777 8004 778 8004 8d 07 21 sta sCTRL 779 8007 780 8007 . 781 8007 ;; 782 8007 783 8007 .L010 ;; const RATEOFFIRE = 12 784 8007 785 8007 .L011 ;; const TRUE = 1 786 8007 787 8007 .L012 ;; const FALSE = 0 788 8007 789 8007 . 790 8007 ;; 791 8007 792 8007 .L013 ;; dim frameCounter = var0 793 8007 794 8007 .L014 ;; dim playerX = var1 795 8007 796 8007 .L015 ;; dim playerY = var2 797 8007 798 8007 .L016 ;; dim fire_debounce = var3 799 8007 800 8007 .L017 ;; dim joyposup = var4 801 8007 802 8007 .L018 ;; dim joyposdown = var5 803 8007 804 8007 .L019 ;; dim joyposleft = var6 805 8007 806 8007 .L020 ;; dim joyposright = var7 807 8007 808 8007 .L021 ;; dim pBullet1_x = $22A0 809 8007 810 8007 .L022 ;; dim pBullet2_x = $22B0 811 8007 812 8007 .L023 ;; dim pBullet3_x = $22C0 813 8007 814 8007 .L024 ;; dim pBullet4_x = $22D0 815 8007 816 8007 .L025 ;; dim pBullet1_y = $22E0 817 8007 818 8007 .L026 ;; dim pBullet2_y = $22F0 819 8007 820 8007 .L027 ;; dim pBullet3_y = $2300 821 8007 822 8007 .L028 ;; dim pBullet4_y = $2310 823 8007 824 8007 .L029 ;; dim timer = var8 825 8007 826 8007 .L030 ;; dim enemy01_xpos = var9 827 8007 828 8007 .L031 ;; dim enemy01_ypos = var19 829 8007 830 8007 .L032 ;; dim player_flag = var20 831 8007 832 8007 .L033 ;; dim enemy01_Flag = var21 833 8007 834 8007 .L034 ;; dim enemy01_Slowdown = var22 835 8007 836 8007 .L035 ;; dim enemy01_speed = var23 837 8007 838 8007 .L036 ;; dim customTemp1 = var31 839 8007 840 8007 .L037 ;; dim customTemp2 = var32 841 8007 842 8007 .L038 ;; dim customTemp3 = var33 843 8007 844 8007 .L039 ;; dim customTemp4 = var34 845 8007 846 8007 .L040 ;; dim gameover_flag = var35 847 8007 848 8007 .L041 ;; dim isDead_flag = var36 849 8007 850 8007 .L042 ;; dim lives = var37 851 8007 852 8007 .L043 ;; dim enemy_direction = var38 853 8007 854 8007 .L044 ;; dim enemy_movement = var39 855 8007 856 8007 .L045 ;; dim power_upX = var40 857 8007 858 8007 .L046 ;; dim power_upY = var41 859 8007 860 8007 .L047 ;; dim power_up_Flag = var42 861 8007 862 8007 .L048 ;; dim extra_shipX = var43 863 8007 864 8007 .L049 ;; dim extra_shipY = var44 865 8007 866 8007 .L050 ;; dim extra_shipFlag = var45 867 8007 868 8007 .L051 ;; dim explosion_aniframe = var46 869 8007 870 8007 .L052 ;; dim temp_loop = var47 871 8007 872 8007 .L053 ;; dim temp_x = var48 873 8007 874 8007 .L054 ;; dim temp_y = var49 875 8007 876 8007 .L055 ;; dim pBullet1_time = var50 877 8007 878 8007 .L056 ;; dim pBullet2_time = var51 879 8007 880 8007 .L057 ;; dim pBullet3_time = var52 881 8007 882 8007 .L058 ;; dim pBullet4_time = var53 883 8007 884 8007 .L059 ;; dim p_twinlaser1_x = var54.var62 885 8007 886 8007 .L060 ;; dim p_twinlaser2_x = var55.var63 887 8007 888 8007 .L061 ;; dim p_twinlaser3_x = var56.var64 889 8007 890 8007 .L062 ;; dim p_twinlaser4_x = var57.var65 891 8007 892 8007 .L063 ;; dim p_twinlaser1_y = var58.var66 893 8007 894 8007 .L064 ;; dim p_twinlaser2_y = var59.var67 895 8007 896 8007 .L065 ;; dim p_twinlaser3_y = var60.var68 897 8007 898 8007 .L066 ;; dim p_twinlaser4_y = var61.var69 899 8007 900 8007 .L067 ;; dim p_twinlaser1_time = var70 901 8007 902 8007 .L068 ;; dim p_twinlaser2_time = var71 903 8007 904 8007 .L069 ;; dim p_twinlaser3_time = var72 905 8007 906 8007 .L070 ;; dim p_twinlaser4_time = var73 907 8007 908 8007 .L071 ;; dim twinlaser_flag = var74 909 8007 910 8007 . 911 8007 ;; 912 8007 913 8007 .L072 ;; dim enemy_shot_xpos = $2200 914 8007 915 8007 .L073 ;; dim enemy_shot_Xf = $2210 916 8007 917 8007 .L074 ;; dim enemy_shot_ypos = $2220 918 8007 919 8007 .L075 ;; dim enemy_shot_Yf = $2230 920 8007 921 8007 .L076 ;; dim enemy_shot_Sx = $2240 922 8007 923 8007 .L077 ;; dim enemy_shot_Sxf = $2250 924 8007 925 8007 .L078 ;; dim enemy_shot_Sy = $2260 926 8007 927 8007 .L079 ;; dim enemy_shot_Syf = $2270 928 8007 929 8007 .L080 ;; dim enemy_shot_active = $2280 930 8007 931 8007 .L081 ;; dim enemy_shot_direction = $2290 932 8007 933 8007 .L082 ;; dim Total_XSu = var75 934 8007 935 8007 .L083 ;; dim Total_XSf = var76 936 8007 937 8007 .L084 ;; dim Total_speedX = Total_XSu.Total_XSf 938 8007 939 8007 .L085 ;; dim Total_YSu = var77 940 8007 941 8007 .L086 ;; dim Total_YSf = var78 942 8007 943 8007 .L087 ;; dim Total_speedY = Total_YSu.Total_YSf 944 8007 945 8007 .L088 ;; dim Temp_XSu = var79 946 8007 947 8007 .L089 ;; dim Temp_XSf = var80 948 8007 949 8007 .L090 ;; dim Temp_X_speed = Temp_XSu.Temp_XSf 950 8007 951 8007 .L091 ;; dim Temp_YSu = var81 952 8007 953 8007 .L092 ;; dim Temp_YSf = var82 954 8007 955 8007 .L093 ;; dim Temp_Y_speed = Temp_YSu.Temp_YSf 956 8007 957 8007 .L094 ;; dim Mob_SpeedX = var83.var87 958 8007 959 8007 .L095 ;; dim Mob_SpeedY = var84.var88 960 8007 961 8007 .L096 ;; dim Mob_Pos_X = var85.var89 962 8007 963 8007 .L097 ;; dim Mob_Pos_Y = var86.var90 964 8007 965 8007 .L098 ;; dim max_bullets = var91 966 8007 967 8007 .L099 ;; dim enemy_shotFlag = var92 968 8007 969 8007 . 970 8007 ;; 971 8007 972 8007 .L0100 ;; timer = RATEOFFIRE 973 8007 974 8007 a9 0c LDA #RATEOFFIRE 975 8009 8d 48 01 STA timer 976 800c . 977 800c ;; 978 800c 979 800c .L0101 ;; characterset vertical_shooting_font 980 800c 981 800c a9 b0 lda #>vertical_shooting_font 982 800e 8d 0b 21 sta sCHARBASE 983 8011 984 8011 85 34 sta CHARBASE 985 8013 a9 60 lda #(vertical_shooting_font_mode | %01100000) 986 8015 8d 06 21 sta charactermode 987 8018 988 8018 .L0102 ;; alphachars ' 0123456789abcdefghijklmnopqrstuvwxyz.,?!:;`"' 989 8018 990 8018 .import 991 8018 ;; import 992 8018 993 8018 .L0103 ;; incgraphic vertical_shooting_font.png 160A 994 8018 995 8018 .L0104 ;; incgraphic vertical_shooting_ship.png 160A 996 8018 997 8018 .L0105 ;; incgraphic vertical_shooting_bullet.png 160A 998 8018 999 8018 .L0106 ;; incgraphic vertical_shooting_enemyshot.png 160A 1000 8018 1001 8018 .L0107 ;; incgraphic vertical_shooting_powerup.png 160A 1002 8018 1003 8018 .L0108 ;; incgraphic vertical_shooting_enemy01.png 160A 1004 8018 1005 8018 .L0109 ;; incgraphic vertical_shooting_1up.png 160A 1006 8018 1007 8018 .L0110 ;; incgraphic vertical_shooting_demo_explosion_upd0.png 160A 1008 8018 1009 8018 .L0111 ;; incgraphic vertical_shooting_demo_explosion_upd1.png 160A 1010 8018 1011 8018 .L0112 ;; incgraphic vertical_shooting_demo_explosion_upd2.png 160A 1012 8018 1013 8018 .L0113 ;; incgraphic vertical_shooting_demo_explosion_upd3.png 160A 1014 8018 1015 8018 .L0114 ;; incgraphic vertical_shooting_demo_explosion_upd4.png 160A 1016 8018 1017 8018 .L0115 ;; incgraphic vertical_shooting_demo_explosion_upd5.png 160A 1018 8018 1019 8018 .L0116 ;; incgraphic vertical_shooting_demo_explosion_upd6.png 160A 1020 8018 1021 8018 .L0117 ;; incgraphic vertical_shooting_demo_explosion_upd7.png 160A 1022 8018 1023 8018 .L0118 ;; incgraphic vertical_shooting_demo_explosion_upd8.png 160A 1024 8018 1025 8018 .L0119 ;; incgraphic vertical_shooting_demo_explosion_upd9.png 160A 1026 8018 1027 8018 .L0120 ;; incgraphic vertical_shooting_demo_explosion_upd10.png 160A 1028 8018 1029 8018 .L0121 ;; incgraphic vertical_shooting_laser.png 160A 1030 8018 1031 8018 .palettes 1032 8018 ;; palettes 1033 8018 1034 8018 .L0122 ;; P0C1 = $0F : P0C2 = $05 : P0C3 = $32 1035 8018 1036 8018 a9 0f LDA #$0F 1037 801a 85 21 STA P0C1 1038 801c a9 05 LDA #$05 1039 801e 85 22 STA P0C2 1040 8020 a9 32 LDA #$32 1041 8022 85 23 STA P0C3 1042 8024 .L0123 ;; P1C1 = $0F : P1C2 = $EE : P1C3 = $E7 1043 8024 1044 8024 a9 0f LDA #$0F 1045 8026 85 25 STA P1C1 1046 8028 a9 ee LDA #$EE 1047 802a 85 26 STA P1C2 1048 802c a9 e7 LDA #$E7 1049 802e 85 27 STA P1C3 1050 8030 .L0124 ;; P2C1 = $9D : P2C2 = $73 : P2C3 = $88 1051 8030 1052 8030 a9 9d LDA #$9D 1053 8032 85 29 STA P2C1 1054 8034 a9 73 LDA #$73 1055 8036 85 2a STA P2C2 1056 8038 a9 88 LDA #$88 1057 803a 85 2b STA P2C3 1058 803c .L0125 ;; P3C1 = $FB : P3C2 = $F2 : P3C3 = $25 1059 803c 1060 803c a9 fb LDA #$FB 1061 803e 85 2d STA P3C1 1062 8040 a9 f2 LDA #$F2 1063 8042 85 2e STA P3C2 1064 8044 a9 25 LDA #$25 1065 8046 85 2f STA P3C3 1066 8048 . 1067 8048 ;; 1068 8048 1069 8048 .plot 1070 8048 ;; plot 1071 8048 1072 8048 .L0126 ;; frameCounter = 0 1073 8048 1074 8048 a9 00 LDA #0 1075 804a 8d 40 01 STA frameCounter 1076 804d .L0127 ;; playerX = 80 : playerY = 144 : player_flag = 0 1077 804d 1078 804d a9 50 LDA #80 1079 804f 8d 41 01 STA playerX 1080 8052 a9 90 LDA #144 1081 8054 8d 42 01 STA playerY 1082 8057 a9 00 LDA #0 1083 8059 8d 54 01 STA player_flag 1084 805c .L0128 ;; fire_debounce = 0 : joyposdown = 0 : joyposup = 0 : joyposleft = 0 : joyposright = 0 1085 805c 1086 805c a9 00 LDA #0 1087 805e 8d 43 01 STA fire_debounce 1088 8061 8d 45 01 STA joyposdown 1089 8064 8d 44 01 STA joyposup 1090 8067 8d 46 01 STA joyposleft 1091 806a 8d 47 01 STA joyposright 1092 806d .L0129 ;; enemy01_xpos = 5 : enemy01_ypos = 5 : enemy01_Flag = 0 : enemy01_speed = 3 : enemy_direction = 0 : enemy_movement = 0 1093 806d 1094 806d a9 05 LDA #5 1095 806f 8d 49 01 STA enemy01_xpos 1096 8072 8d 53 01 STA enemy01_ypos 1097 8075 a9 00 LDA #0 1098 8077 8d 55 01 STA enemy01_Flag 1099 807a a9 03 LDA #3 1100 807c 8d 57 01 STA enemy01_speed 1101 807f a9 00 LDA #0 1102 8081 8d 66 01 STA enemy_direction 1103 8084 8d 67 01 STA enemy_movement 1104 8087 .L0130 ;; power_upX = 5 : power_upY = 32 : power_up_Flag = 0 1105 8087 1106 8087 a9 05 LDA #5 1107 8089 8d 68 01 STA power_upX 1108 808c a9 20 LDA #32 1109 808e 8d 69 01 STA power_upY 1110 8091 a9 00 LDA #0 1111 8093 8d 6a 01 STA power_up_Flag 1112 8096 .L0131 ;; pBullet1_x = 200 : pBullet1_y = - 10 : pBullet2_x = 200 : pBullet2_y = - 10 1113 8096 1114 8096 a9 c8 LDA #200 1115 8098 8d a0 22 STA pBullet1_x 1116 809b a9 f6 LDA #246 1117 809d 8d e0 22 STA pBullet1_y 1118 80a0 a9 c8 LDA #200 1119 80a2 8d b0 22 STA pBullet2_x 1120 80a5 a9 f6 LDA #246 1121 80a7 8d f0 22 STA pBullet2_y 1122 80aa .L0132 ;; pBullet3_x = 200 : pBullet3_y = - 10 : pBullet4_x = 200 : pBullet4_y = - 10 1123 80aa 1124 80aa a9 c8 LDA #200 1125 80ac 8d c0 22 STA pBullet3_x 1126 80af a9 f6 LDA #246 1127 80b1 8d 00 23 STA pBullet3_y 1128 80b4 a9 c8 LDA #200 1129 80b6 8d d0 22 STA pBullet4_x 1130 80b9 a9 f6 LDA #246 1131 80bb 8d 10 23 STA pBullet4_y 1132 80be .L0133 ;; p_twinlaser1_x = 200 : p_twinlaser1_y = - 10 : p_twinlaser2_x = 200 : p_twinlaser2_y = - 10 1133 80be 1134 80be a9 00 LDA #0 1135 80c0 8d 7e 01 STA var62 1136 80c3 a9 c8 LDA #200 1137 80c5 8d 76 01 STA p_twinlaser1_x 1138 80c8 a2 00 LDX #0 1139 80ca 8e 82 01 STX var66 1140 80cd a9 f6 LDA #246 1141 80cf 8d 7a 01 STA p_twinlaser1_y 1142 80d2 a9 00 LDA #0 1143 80d4 8d 7f 01 STA var63 1144 80d7 a9 c8 LDA #200 1145 80d9 8d 77 01 STA p_twinlaser2_x 1146 80dc a2 00 LDX #0 1147 80de 8e 83 01 STX var67 1148 80e1 a9 f6 LDA #246 1149 80e3 8d 7b 01 STA p_twinlaser2_y 1150 80e6 .L0134 ;; p_twinlaser3_x = 200 : p_twinlaser3_y = - 10 : p_twinlaser4_x = 200 : p_twinlaser4_y = - 10 1151 80e6 1152 80e6 a9 00 LDA #0 1153 80e8 8d 80 01 STA var64 1154 80eb a9 c8 LDA #200 1155 80ed 8d 78 01 STA p_twinlaser3_x 1156 80f0 a2 00 LDX #0 1157 80f2 8e 84 01 STX var68 1158 80f5 a9 f6 LDA #246 1159 80f7 8d 7c 01 STA p_twinlaser3_y 1160 80fa a9 00 LDA #0 1161 80fc 8d 81 01 STA var65 1162 80ff a9 c8 LDA #200 1163 8101 8d 79 01 STA p_twinlaser4_x 1164 8104 a2 00 LDX #0 1165 8106 8e 85 01 STX var69 1166 8109 a9 f6 LDA #246 1167 810b 8d 7d 01 STA p_twinlaser4_y 1168 810e .L0135 ;; extra_shipX = 0 : extra_shipY = 0 : extra_shipFlag = 0 1169 810e 1170 810e a9 00 LDA #0 1171 8110 8d 6b 01 STA extra_shipX 1172 8113 8d 6c 01 STA extra_shipY 1173 8116 8d 6d 01 STA extra_shipFlag 1174 8119 .L0136 ;; max_bullets = 10 : twinlaser_flag = 0 1175 8119 1176 8119 a9 0a LDA #10 1177 811b 8d 9b 01 STA max_bullets 1178 811e a9 00 LDA #0 1179 8120 8d 8a 01 STA twinlaser_flag 1180 8123 .L0137 ;; customTemp1 = 0 : customTemp2 = 0 : customTemp3 = 0 : customTemp4 = 0 1181 8123 1182 8123 a9 00 LDA #0 1183 8125 8d 5f 01 STA customTemp1 1184 8128 8d 60 01 STA customTemp2 1185 812b 8d 61 01 STA customTemp3 1186 812e 8d 62 01 STA customTemp4 1187 8131 .L0138 ;; lives = 3 1188 8131 1189 8131 a9 03 LDA #3 1190 8133 8d 65 01 STA lives 1191 8136 . 1192 8136 ;; 1193 8136 1194 8136 .L0139 ;; goto titlescreen 1195 8136 1196 8136 4c c0 8c jmp .titlescreen 1197 8139 1198 8139 .main 1199 8139 ;; main 1200 8139 1201 8139 .L0140 ;; frameCounter = frameCounter + 1 1202 8139 1203 8139 ad 40 01 LDA frameCounter 1204 813c 18 CLC 1205 813d 69 01 ADC #1 1206 813f 8d 40 01 STA frameCounter 1207 8142 .L0141 ;; if frameCounter > 10 then frameCounter = 0 1208 8142 1209 8142 a9 0a LDA #10 1210 8144 cd 40 01 CMP frameCounter 1211 8147 b0 05 BCS .skipL0141 1212 8149 .condpart0 1213 8149 a9 00 LDA #0 1214 814b 8d 40 01 STA frameCounter 1215 814e .skipL0141 1216 814e .mainloop 1217 814e ;; mainloop 1218 814e 1219 814e .L0142 ;; BACKGRND = $00 1220 814e 1221 814e a9 00 LDA #$00 1222 8150 85 20 STA BACKGRND 1223 8152 .L0143 ;; if switchreset then reboot 1224 8152 1225 8152 20 b4 f4 jsr checkresetswitch 1226 8155 d0 03 BNE .skipL0143 1227 8157 .condpart1 1228 8157 4c a1 f5 JMP START 1229 815a .skipL0143 1230 815a . 1231 815a ;; 1232 815a 1233 815a .L0144 ;; if joy0up && joyposup = - 2 then gosub Set_Bullet_home 1234 815a 1235 815a a9 10 lda #$10 1236 815c 2c 80 02 bit SWCHA 1237 815f d0 10 BNE .skipL0144 1238 8161 .condpart2 1239 8161 ; complex condition detected 1240 8161 a9 fe LDA #254 1241 8163 48 PHA 1242 8164 ba TSX 1243 8165 68 PLA 1244 8166 ad 44 01 LDA joyposup 1245 8169 dd 01 01 CMP $101,x 1246 816c d0 03 BNE .skip2then 1247 816e .condpart3 1248 816e 20 8c 84 jsr .Set_Bullet_home 1249 8171 1250 8171 .skip2then 1251 8171 .skipL0144 1252 8171 .L0145 ;; if joy0down && joyposdown = - 2 then gosub Set_Bullet_home 1253 8171 1254 8171 a9 20 lda #$20 1255 8173 2c 80 02 bit SWCHA 1256 8176 d0 10 BNE .skipL0145 1257 8178 .condpart4 1258 8178 ; complex condition detected 1259 8178 a9 fe LDA #254 1260 817a 48 PHA 1261 817b ba TSX 1262 817c 68 PLA 1263 817d ad 45 01 LDA joyposdown 1264 8180 dd 01 01 CMP $101,x 1265 8183 d0 03 BNE .skip4then 1266 8185 .condpart5 1267 8185 20 8c 84 jsr .Set_Bullet_home 1268 8188 1269 8188 .skip4then 1270 8188 .skipL0145 1271 8188 .L0146 ;; if joy0left && joyposleft = - 2 then gosub Set_Bullet_home 1272 8188 1273 8188 2c 80 02 bit SWCHA 1274 818b 70 10 BVS .skipL0146 1275 818d .condpart6 1276 818d ; complex condition detected 1277 818d a9 fe LDA #254 1278 818f 48 PHA 1279 8190 ba TSX 1280 8191 68 PLA 1281 8192 ad 46 01 LDA joyposleft 1282 8195 dd 01 01 CMP $101,x 1283 8198 d0 03 BNE .skip6then 1284 819a .condpart7 1285 819a 20 8c 84 jsr .Set_Bullet_home 1286 819d 1287 819d .skip6then 1288 819d .skipL0146 1289 819d .L0147 ;; if joy0right && joyposright = - 2 then gosub Set_Bullet_home 1290 819d 1291 819d 2c 80 02 bit SWCHA 1292 81a0 30 10 BMI .skipL0147 1293 81a2 .condpart8 1294 81a2 ; complex condition detected 1295 81a2 a9 fe LDA #254 1296 81a4 48 PHA 1297 81a5 ba TSX 1298 81a6 68 PLA 1299 81a7 ad 47 01 LDA joyposright 1300 81aa dd 01 01 CMP $101,x 1301 81ad d0 03 BNE .skip8then 1302 81af .condpart9 1303 81af 20 8c 84 jsr .Set_Bullet_home 1304 81b2 1305 81b2 .skip8then 1306 81b2 .skipL0147 1307 81b2 . 1308 81b2 ;; 1309 81b2 1310 81b2 .L0148 ;; if joy0up then playerY = playerY - 1 : joyposup = 1 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 1311 81b2 1312 81b2 a9 10 lda #$10 1313 81b4 2c 80 02 bit SWCHA 1314 81b7 d0 19 BNE .skipL0148 1315 81b9 .condpart10 1316 81b9 ad 42 01 LDA playerY 1317 81bc 38 SEC 1318 81bd e9 01 SBC #1 1319 81bf 8d 42 01 STA playerY 1320 81c2 a9 01 LDA #1 1321 81c4 8d 44 01 STA joyposup 1322 81c7 a9 00 LDA #0 1323 81c9 8d 45 01 STA joyposdown 1324 81cc 8d 46 01 STA joyposleft 1325 81cf 8d 47 01 STA joyposright 1326 81d2 .skipL0148 1327 81d2 .L0149 ;; if joy0down then playerY = playerY + 1 : joyposup = 0 : joyposdown = 1 : joyposleft = 0 : joyposright = 0 1328 81d2 1329 81d2 a9 20 lda #$20 1330 81d4 2c 80 02 bit SWCHA 1331 81d7 d0 1b BNE .skipL0149 1332 81d9 .condpart11 1333 81d9 ad 42 01 LDA playerY 1334 81dc 18 CLC 1335 81dd 69 01 ADC #1 1336 81df 8d 42 01 STA playerY 1337 81e2 a9 00 LDA #0 1338 81e4 8d 44 01 STA joyposup 1339 81e7 a9 01 LDA #1 1340 81e9 8d 45 01 STA joyposdown 1341 81ec a9 00 LDA #0 1342 81ee 8d 46 01 STA joyposleft 1343 81f1 8d 47 01 STA joyposright 1344 81f4 .skipL0149 1345 81f4 .L0150 ;; if joy0left then playerX = playerX - 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 1 : joyposright = 0 1346 81f4 1347 81f4 2c 80 02 bit SWCHA 1348 81f7 70 1b BVS .skipL0150 1349 81f9 .condpart12 1350 81f9 ad 41 01 LDA playerX 1351 81fc 38 SEC 1352 81fd e9 01 SBC #1 1353 81ff 8d 41 01 STA playerX 1354 8202 a9 00 LDA #0 1355 8204 8d 44 01 STA joyposup 1356 8207 8d 45 01 STA joyposdown 1357 820a a9 01 LDA #1 1358 820c 8d 46 01 STA joyposleft 1359 820f a9 00 LDA #0 1360 8211 8d 47 01 STA joyposright 1361 8214 .skipL0150 1362 8214 .L0151 ;; if joy0right then playerX = playerX + 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 1 1363 8214 1364 8214 2c 80 02 bit SWCHA 1365 8217 30 19 BMI .skipL0151 1366 8219 .condpart13 1367 8219 ad 41 01 LDA playerX 1368 821c 18 CLC 1369 821d 69 01 ADC #1 1370 821f 8d 41 01 STA playerX 1371 8222 a9 00 LDA #0 1372 8224 8d 44 01 STA joyposup 1373 8227 8d 45 01 STA joyposdown 1374 822a 8d 46 01 STA joyposleft 1375 822d a9 01 LDA #1 1376 822f 8d 47 01 STA joyposright 1377 8232 .skipL0151 1378 8232 . 1379 8232 ;; 1380 8232 1381 8232 .L0152 ;; if joy0fire && joyposup = 1 && joyposdown = 1 && joyposleft = 1 && joyposright = 1 then pBullet1_y = pBullet1_y - 8 : pBullet2_y = pBullet2_y - 8 : pBullet3_y = pBullet3_y - 8 : pBullet4_y = pBullet4_y - 8 1382 8232 1383 8232 2c 02 21 bit sINPT1 1384 8235 10 40 BPL .skipL0152 1385 8237 .condpart14 1386 8237 ad 44 01 LDA joyposup 1387 823a c9 01 CMP #1 1388 823c d0 39 BNE .skip14then 1389 823e .condpart15 1390 823e ad 45 01 LDA joyposdown 1391 8241 c9 01 CMP #1 1392 8243 d0 32 BNE .skip15then 1393 8245 .condpart16 1394 8245 ad 46 01 LDA joyposleft 1395 8248 c9 01 CMP #1 1396 824a d0 2b BNE .skip16then 1397 824c .condpart17 1398 824c ad 47 01 LDA joyposright 1399 824f c9 01 CMP #1 1400 8251 d0 24 BNE .skip17then 1401 8253 .condpart18 1402 8253 ad e0 22 LDA pBullet1_y 1403 8256 38 SEC 1404 8257 e9 08 SBC #8 1405 8259 8d e0 22 STA pBullet1_y 1406 825c ad f0 22 LDA pBullet2_y 1407 825f 38 SEC 1408 8260 e9 08 SBC #8 1409 8262 8d f0 22 STA pBullet2_y 1410 8265 ad 00 23 LDA pBullet3_y 1411 8268 38 SEC 1412 8269 e9 08 SBC #8 1413 826b 8d 00 23 STA pBullet3_y 1414 826e ad 10 23 LDA pBullet4_y 1415 8271 38 SEC 1416 8272 e9 08 SBC #8 1417 8274 8d 10 23 STA pBullet4_y 1418 8277 .skip17then 1419 8277 .skip16then 1420 8277 .skip15then 1421 8277 .skip14then 1422 8277 .skipL0152 1423 8277 .L0153 ;; if playerX > 152 then playerX = playerX - 1 1424 8277 1425 8277 a9 98 LDA #152 1426 8279 cd 41 01 CMP playerX 1427 827c b0 09 BCS .skipL0153 1428 827e .condpart19 1429 827e ad 41 01 LDA playerX 1430 8281 38 SEC 1431 8282 e9 01 SBC #1 1432 8284 8d 41 01 STA playerX 1433 8287 .skipL0153 1434 8287 .L0154 ;; if playerX < 1 then playerX = playerX + 1 1435 8287 1436 8287 ad 41 01 LDA playerX 1437 828a c9 01 CMP #1 1438 828c b0 09 BCS .skipL0154 1439 828e .condpart20 1440 828e ad 41 01 LDA playerX 1441 8291 18 CLC 1442 8292 69 01 ADC #1 1443 8294 8d 41 01 STA playerX 1444 8297 .skipL0154 1445 8297 .L0155 ;; if playerY > 177 then playerY = playerY - 1 1446 8297 1447 8297 a9 b1 LDA #177 1448 8299 cd 42 01 CMP playerY 1449 829c b0 09 BCS .skipL0155 1450 829e .condpart21 1451 829e ad 42 01 LDA playerY 1452 82a1 38 SEC 1453 82a2 e9 01 SBC #1 1454 82a4 8d 42 01 STA playerY 1455 82a7 .skipL0155 1456 82a7 .L0156 ;; if playerY < 1 then playerY = playerY + 1 1457 82a7 1458 82a7 ad 42 01 LDA playerY 1459 82aa c9 01 CMP #1 1460 82ac b0 09 BCS .skipL0156 1461 82ae .condpart22 1462 82ae ad 42 01 LDA playerY 1463 82b1 18 CLC 1464 82b2 69 01 ADC #1 1465 82b4 8d 42 01 STA playerY 1466 82b7 .skipL0156 1467 82b7 . 1468 82b7 ;; 1469 82b7 1470 82b7 .L0157 ;; gosub check_collisions 1471 82b7 1472 82b7 20 de 84 jsr .check_collisions 1473 82ba 1474 82ba .L0158 ;; if isDead_flag then goto lose_a_life 1475 82ba 1476 82ba ad 64 01 LDA isDead_flag 1477 82bd f0 03 BEQ .skipL0158 1478 82bf .condpart23 1479 82bf 4c d9 8b jmp .lose_a_life 1480 82c2 1481 82c2 .skipL0158 1482 82c2 . 1483 82c2 ;; 1484 82c2 1485 82c2 .L0159 ;; if power_upX > 155 then power_upX = power_upX - 5 1486 82c2 1487 82c2 a9 9b LDA #155 1488 82c4 cd 68 01 CMP power_upX 1489 82c7 b0 09 BCS .skipL0159 1490 82c9 .condpart24 1491 82c9 ad 68 01 LDA power_upX 1492 82cc 38 SEC 1493 82cd e9 05 SBC #5 1494 82cf 8d 68 01 STA power_upX 1495 82d2 .skipL0159 1496 82d2 .L0160 ;; if power_upX < 1 then power_upX = power_upX + 5 1497 82d2 1498 82d2 ad 68 01 LDA power_upX 1499 82d5 c9 01 CMP #1 1500 82d7 b0 09 BCS .skipL0160 1501 82d9 .condpart25 1502 82d9 ad 68 01 LDA power_upX 1503 82dc 18 CLC 1504 82dd 69 05 ADC #5 1505 82df 8d 68 01 STA power_upX 1506 82e2 .skipL0160 1507 82e2 .L0161 ;; if power_upY > 191 then power_upY = power_upY - 5 1508 82e2 1509 82e2 a9 bf LDA #191 1510 82e4 cd 69 01 CMP power_upY 1511 82e7 b0 09 BCS .skipL0161 1512 82e9 .condpart26 1513 82e9 ad 69 01 LDA power_upY 1514 82ec 38 SEC 1515 82ed e9 05 SBC #5 1516 82ef 8d 69 01 STA power_upY 1517 82f2 .skipL0161 1518 82f2 .L0162 ;; if power_upY < 1 then power_upY = power_upY + 5 1519 82f2 1520 82f2 ad 69 01 LDA power_upY 1521 82f5 c9 01 CMP #1 1522 82f7 b0 09 BCS .skipL0162 1523 82f9 .condpart27 1524 82f9 ad 69 01 LDA power_upY 1525 82fc 18 CLC 1526 82fd 69 05 ADC #5 1527 82ff 8d 69 01 STA power_upY 1528 8302 .skipL0162 1529 8302 .L0163 ;; if enemy01_xpos > 160 then enemy01_xpos = enemy01_xpos - 1 1530 8302 1531 8302 a9 a0 LDA #160 1532 8304 cd 49 01 CMP enemy01_xpos 1533 8307 b0 09 BCS .skipL0163 1534 8309 .condpart28 1535 8309 ad 49 01 LDA enemy01_xpos 1536 830c 38 SEC 1537 830d e9 01 SBC #1 1538 830f 8d 49 01 STA enemy01_xpos 1539 8312 .skipL0163 1540 8312 .L0164 ;; if enemy01_xpos < 1 then enemy01_xpos = enemy01_xpos + 1 1541 8312 1542 8312 ad 49 01 LDA enemy01_xpos 1543 8315 c9 01 CMP #1 1544 8317 b0 09 BCS .skipL0164 1545 8319 .condpart29 1546 8319 ad 49 01 LDA enemy01_xpos 1547 831c 18 CLC 1548 831d 69 01 ADC #1 1549 831f 8d 49 01 STA enemy01_xpos 1550 8322 .skipL0164 1551 8322 .L0165 ;; if enemy01_ypos > 220 then enemy01_ypos = enemy01_ypos - 1 1552 8322 1553 8322 a9 dc LDA #220 1554 8324 cd 53 01 CMP enemy01_ypos 1555 8327 b0 09 BCS .skipL0165 1556 8329 .condpart30 1557 8329 ad 53 01 LDA enemy01_ypos 1558 832c 38 SEC 1559 832d e9 01 SBC #1 1560 832f 8d 53 01 STA enemy01_ypos 1561 8332 .skipL0165 1562 8332 .L0166 ;; if enemy01_ypos < - 16 then enemy01_ypos = enemy01_ypos + 1 1563 8332 1564 8332 ; complex condition detected 1565 8332 a9 f0 LDA #240 1566 8334 48 PHA 1567 8335 ba TSX 1568 8336 68 PLA 1569 8337 ad 53 01 LDA enemy01_ypos 1570 833a dd 01 01 CMP $101,x 1571 833d b0 09 BCS .skipL0166 1572 833f .condpart31 1573 833f ad 53 01 LDA enemy01_ypos 1574 8342 18 CLC 1575 8343 69 01 ADC #1 1576 8345 8d 53 01 STA enemy01_ypos 1577 8348 .skipL0166 1578 8348 .L0167 ;; if extra_shipX > 160 then extra_shipX = extra_shipX - 1 1579 8348 1580 8348 a9 a0 LDA #160 1581 834a cd 6b 01 CMP extra_shipX 1582 834d b0 09 BCS .skipL0167 1583 834f .condpart32 1584 834f ad 6b 01 LDA extra_shipX 1585 8352 38 SEC 1586 8353 e9 01 SBC #1 1587 8355 8d 6b 01 STA extra_shipX 1588 8358 .skipL0167 1589 8358 .L0168 ;; if extra_shipX < 1 then extra_shipX = extra_shipX + 1 1590 8358 1591 8358 ad 6b 01 LDA extra_shipX 1592 835b c9 01 CMP #1 1593 835d b0 09 BCS .skipL0168 1594 835f .condpart33 1595 835f ad 6b 01 LDA extra_shipX 1596 8362 18 CLC 1597 8363 69 01 ADC #1 1598 8365 8d 6b 01 STA extra_shipX 1599 8368 .skipL0168 1600 8368 .L0169 ;; if extra_shipY > 191 then extra_shipY = extra_shipY - 1 1601 8368 1602 8368 a9 bf LDA #191 1603 836a cd 6c 01 CMP extra_shipY 1604 836d b0 09 BCS .skipL0169 1605 836f .condpart34 1606 836f ad 6c 01 LDA extra_shipY 1607 8372 38 SEC 1608 8373 e9 01 SBC #1 1609 8375 8d 6c 01 STA extra_shipY 1610 8378 .skipL0169 1611 8378 .L0170 ;; if extra_shipY < 1 then extra_shipY = extra_shipY + 1 1612 8378 1613 8378 ad 6c 01 LDA extra_shipY 1614 837b c9 01 CMP #1 1615 837d b0 09 BCS .skipL0170 1616 837f .condpart35 1617 837f ad 6c 01 LDA extra_shipY 1618 8382 18 CLC 1619 8383 69 01 ADC #1 1620 8385 8d 6c 01 STA extra_shipY 1621 8388 .skipL0170 1622 8388 . 1623 8388 ;; 1624 8388 1625 8388 .L0171 ;; z = 15 1626 8388 1627 8388 a9 0f LDA #15 1628 838a 85 ff STA z 1629 838c .despawn_Check 1630 838c ;; despawn_Check 1631 838c 1632 838c .L0172 ;; if enemy_shot_xpos[z] > 160 || enemy_shot_ypos[z] > 192 then enemy_shot_active[z] = FALSE 1633 838c 1634 838c a9 a0 LDA #160 1635 838e a6 ff LDX z 1636 8390 dd 00 22 CMP enemy_shot_xpos,x 1637 8393 b0 03 BCS .skipL0172 1638 8395 .condpart36 1639 8395 4c a1 83 jmp .condpart37 1640 8398 .skipL0172 1641 8398 a9 c0 LDA #192 1642 839a a6 ff LDX z 1643 839c dd 20 22 CMP enemy_shot_ypos,x 1644 839f b0 07 BCS .skip8OR 1645 83a1 .condpart37 1646 83a1 a9 00 LDA #FALSE 1647 83a3 a6 ff LDX z 1648 83a5 9d 80 22 STA enemy_shot_active,x 1649 83a8 .skip8OR 1650 83a8 .L0173 ;; z = z - 1 1651 83a8 1652 83a8 a5 ff LDA z 1653 83aa 38 SEC 1654 83ab e9 01 SBC #1 1655 83ad 85 ff STA z 1656 83af .L0174 ;; if z < 15 then goto despawn_Check 1657 83af 1658 83af a5 ff LDA z 1659 83b1 c9 0f CMP #15 1660 83b3 b0 03 BCS .skipL0174 1661 83b5 .condpart38 1662 83b5 4c 8c 83 jmp .despawn_Check 1663 83b8 1664 83b8 .skipL0174 1665 83b8 . 1666 83b8 ;; 1667 83b8 1668 83b8 .L0175 ;; z = 15 1669 83b8 1670 83b8 a9 0f LDA #15 1671 83ba 85 ff STA z 1672 83bc .plot_Bullet 1673 83bc ;; plot_Bullet 1674 83bc 1675 83bc .L0176 ;; x = enemy_shot_xpos[z] 1676 83bc 1677 83bc a6 ff LDX z 1678 83be bd 00 22 LDA enemy_shot_xpos,x 1679 83c1 85 fd STA x 1680 83c3 .L0177 ;; y = enemy_shot_ypos[z] 1681 83c3 1682 83c3 a6 ff LDX z 1683 83c5 bd 20 22 LDA enemy_shot_ypos,x 1684 83c8 85 fe STA y 1685 83ca .L0178 ;; if enemy_shot_active = TRUE then plotsprite vertical_shooting_enemyshot 2 x y 1686 83ca 1687 83ca ad 80 22 LDA enemy_shot_active 1688 83cd c9 01 CMP #TRUE 1689 83cf d0 1b BNE .skipL0178 1690 83d1 .condpart39 1691 83d1 a9 32 lda #vertical_shooting_enemyshot 1695 83d7 85 43 sta temp2 1696 83d9 1697 83d9 a9 5f lda #(64|vertical_shooting_enemyshot_width_twoscompliment) 1698 83db 85 44 sta temp3 1699 83dd 1700 83dd a5 fd lda x 1701 83df 85 45 sta temp4 1702 83e1 1703 83e1 a5 fe lda y 1704 83e3 1705 83e3 85 46 sta temp5 1706 83e5 1707 83e5 a9 40 lda #(vertical_shooting_enemyshot_mode|%01000000) 1708 83e7 85 47 sta temp6 1709 83e9 1710 83e9 20 c2 f2 jsr plotsprite 1711 83ec .skipL0178 1712 83ec .L0179 ;; z = z - 1 1713 83ec 1714 83ec a5 ff LDA z 1715 83ee 38 SEC 1716 83ef e9 01 SBC #1 1717 83f1 85 ff STA z 1718 83f3 .L0180 ;; if z < 15 then goto plot_Bullet 1719 83f3 1720 83f3 a5 ff LDA z 1721 83f5 c9 0f CMP #15 1722 83f7 b0 03 BCS .skipL0180 1723 83f9 .condpart40 1724 83f9 4c bc 83 jmp .plot_Bullet 1725 83fc 1726 83fc .skipL0180 1727 83fc . 1728 83fc ;; 1729 83fc 1730 83fc . 1731 83fc ;; 1732 83fc 1733 83fc . 1734 83fc ;; 1735 83fc 1736 83fc . 1737 83fc ;; 1738 83fc 1739 83fc . 1740 83fc ;; 1741 83fc 1742 83fc . 1743 83fc ;; 1744 83fc 1745 83fc . 1746 83fc ;; 1747 83fc 1748 83fc .L0181 ;; restorescreen 1749 83fc 1750 83fc 20 91 f0 jsr restorescreen 1751 83ff .L0182 ;; gosub draw_player_bullets 1752 83ff 1753 83ff 20 8a 8b jsr .draw_player_bullets 1754 8402 1755 8402 .L0183 ;; gosub draw_sprites 1756 8402 1757 8402 20 f7 8d jsr .draw_sprites 1758 8405 1759 8405 .L0184 ;; gosub _draw_score 1760 8405 1761 8405 20 1a 84 jsr ._draw_score 1762 8408 1763 8408 .L0185 ;; gosub check_firebutton 1764 8408 1765 8408 20 11 8a jsr .check_firebutton 1766 840b 1767 840b .L0186 ;; gosub move_bullets 1768 840b 1769 840b 20 b4 8a jsr .move_bullets 1770 840e 1771 840e .L0187 ;; gosub check_bullet_time 1772 840e 1773 840e 20 fe 8a jsr .check_bullet_time 1774 8411 1775 8411 .L0188 ;; gosub check_bullet_boundary 1776 8411 1777 8411 20 34 8b jsr .check_bullet_boundary 1778 8414 1779 8414 . 1780 8414 ;; 1781 8414 1782 8414 .L0189 ;; drawscreen 1783 8414 1784 8414 20 b3 f0 jsr drawscreen 1785 8417 .L0190 ;; goto mainloop 1786 8417 1787 8417 4c 4e 81 jmp .mainloop 1788 841a 1789 841a . 1790 841a ;; 1791 841a 1792 841a . 1793 841a ;; 1794 841a 1795 841a . 1796 841a ;; 1797 841a 1798 841a . 1799 841a ;; 1800 841a 1801 841a ._draw_score 1802 841a ;; _draw_score 1803 841a 1804 841a .L0191 ;; plotvalue vertical_shooting_font 0 score0 6 25 1 1805 841a 1806 841a a9 00 lda #vertical_shooting_font 1810 8420 85 43 sta temp2 1811 8422 1812 8422 ad 06 21 lda charactermode 1813 8425 85 4a sta temp9 1814 8427 a9 60 lda #(vertical_shooting_font_mode | %01100000) 1815 8429 8d 06 21 sta charactermode 1816 842c a9 1a lda #26 ; width in two's complement 1817 842e 09 00 ora #0 ; palette left shifted 5 bits 1818 8430 85 44 sta temp3 1819 8432 a9 19 lda #25 1820 8434 85 45 sta temp4 1821 8436 1822 8436 a9 01 lda #1 1823 8438 85 46 sta temp5 1824 843a 1825 843a a9 06 lda #6 1826 843c 85 47 sta temp6 1827 843e 1828 843e a9 a6 lda #score0 1832 8444 85 49 sta temp8 1833 8446 1834 8446 20 b0 f3 jsr plotvalue 1835 8446 00 01 USED_PLOTVALUE = 1 1836 8449 a5 4a lda temp9 1837 844b 8d 06 21 sta charactermode 1838 844e .L0192 ;; plotvalue vertical_shooting_font 0 lives 1 153 1 1839 844e 1840 844e a9 00 lda #vertical_shooting_font 1844 8454 85 43 sta temp2 1845 8456 1846 8456 ad 06 21 lda charactermode 1847 8459 85 4a sta temp9 1848 845b a9 60 lda #(vertical_shooting_font_mode | %01100000) 1849 845d 8d 06 21 sta charactermode 1850 8460 a9 1f lda #31 ; width in two's complement 1851 8462 09 00 ora #0 ; palette left shifted 5 bits 1852 8464 85 44 sta temp3 1853 8466 a9 99 lda #153 1854 8468 85 45 sta temp4 1855 846a 1856 846a a9 01 lda #1 1857 846c 85 46 sta temp5 1858 846e 1859 846e a9 01 lda #1 1860 8470 85 47 sta temp6 1861 8472 1862 8472 a9 65 lda #lives 1866 8478 85 49 sta temp8 1867 847a 1868 847a 20 b0 f3 jsr plotvalue 1869 847a 00 01 USED_PLOTVALUE = 1 1870 847d a5 4a lda temp9 1871 847f 8d 06 21 sta charactermode 1872 8482 .L0193 ;; return 1873 8482 1874 8482 ba tsx 1875 8483 bd 02 01 lda $102,x 1876 8486 f0 01 beq bankswitchret1 1877 8488 60 RTS 1878 8489 bankswitchret1 1879 8489 4c a1 f4 JMP BS_return 1880 848c . 1881 848c ;; 1882 848c 1883 848c .Set_Bullet_home 1884 848c ;; Set_Bullet_home 1885 848c 1886 848c .L0194 ;; pBullet1_x = playerX - 8 : pBullet1_y = playerY - 4 1887 848c 1888 848c ad 41 01 LDA playerX 1889 848f 38 SEC 1890 8490 e9 08 SBC #8 1891 8492 8d a0 22 STA pBullet1_x 1892 8495 ad 42 01 LDA playerY 1893 8498 38 SEC 1894 8499 e9 04 SBC #4 1895 849b 8d e0 22 STA pBullet1_y 1896 849e .L0195 ;; pBullet2_x = playerX - 8 : pBullet2_y = playerY - 4 1897 849e 1898 849e ad 41 01 LDA playerX 1899 84a1 38 SEC 1900 84a2 e9 08 SBC #8 1901 84a4 8d b0 22 STA pBullet2_x 1902 84a7 ad 42 01 LDA playerY 1903 84aa 38 SEC 1904 84ab e9 04 SBC #4 1905 84ad 8d f0 22 STA pBullet2_y 1906 84b0 .L0196 ;; pBullet3_x = playerX - 8 : pBullet3_y = playerY - 4 1907 84b0 1908 84b0 ad 41 01 LDA playerX 1909 84b3 38 SEC 1910 84b4 e9 08 SBC #8 1911 84b6 8d c0 22 STA pBullet3_x 1912 84b9 ad 42 01 LDA playerY 1913 84bc 38 SEC 1914 84bd e9 04 SBC #4 1915 84bf 8d 00 23 STA pBullet3_y 1916 84c2 .L0197 ;; pBullet4_x = playerX - 8 : pBullet4_y = playerY - 4 1917 84c2 1918 84c2 ad 41 01 LDA playerX 1919 84c5 38 SEC 1920 84c6 e9 08 SBC #8 1921 84c8 8d d0 22 STA pBullet4_x 1922 84cb ad 42 01 LDA playerY 1923 84ce 38 SEC 1924 84cf e9 04 SBC #4 1925 84d1 8d 10 23 STA pBullet4_y 1926 84d4 .L0198 ;; return 1927 84d4 1928 84d4 ba tsx 1929 84d5 bd 02 01 lda $102,x 1930 84d8 f0 01 beq bankswitchret2 1931 84da 60 RTS 1932 84db bankswitchret2 1933 84db 4c a1 f4 JMP BS_return 1934 84de . 1935 84de ;; 1936 84de 1937 84de .check_collisions 1938 84de ;; check_collisions 1939 84de 1940 84de .L0199 ;; if boxcollision ( playerX , playerY , 8 , 16 , enemy_shot_xpos , enemy_shot_ypos , 4 , 8 ) then enemy_shot_xpos = 200 : enemy_shot_ypos = 200 : player_flag = 1 : lives = lives - 0 : playsfx sfx_explosion : explosion_aniframe = 0 : isDead_flag = 1 : goto _checkCollisionsExit 1941 84de 1942 84de 1943 84de 18 clc ; one clc only. If we overflow we're screwed anyway. 1944 84df a0 07 ldy #(8-1) 1945 84e1 84 44 sty temp3 1946 84e3 a0 0f ldy #(16-1) 1947 84e5 84 45 sty temp4 1948 84e7 ad 00 22 lda enemy_shot_xpos 1949 84ea 69 30 adc #48 1950 84ec 85 46 sta temp5 1951 84ee ad 20 22 lda enemy_shot_ypos 1952 84f1 69 20 adc #((256-WSCREENHEIGHT)/2) 1953 84f3 85 47 sta temp6 1954 84f5 a0 03 ldy #(4-1) 1955 84f7 84 48 sty temp7 1956 84f9 a0 07 ldy #(8-1) 1957 84fb 84 49 sty temp8 1958 84fd ad 42 01 lda playerY 1959 8500 69 20 adc #((256-WSCREENHEIGHT)/2) 1960 8502 a8 tay 1961 8503 ad 41 01 lda playerX 1962 8506 69 30 adc #48 1963 8508 20 f8 f3 jsr boxcollision 1964 850b 1965 850b 90 3c BCC .skipL0199 1966 850d .condpart41 1967 850d a9 c8 LDA #200 1968 850f 8d 00 22 STA enemy_shot_xpos 1969 8512 8d 20 22 STA enemy_shot_ypos 1970 8515 a9 01 LDA #1 1971 8517 8d 54 01 STA player_flag 1972 851a ad 65 01 LDA lives 1973 851d 38 SEC 1974 851e e9 00 SBC #0 1975 8520 8d 65 01 STA lives 1976 8523 ifnconst NOTIALOCKMUTE 1977 8523 a9 01 lda #1 1978 8525 85 de sta sfxschedulelock 1979 8527 a9 5d lda #sfx_explosion 1982 852d 85 e1 sta sfxinstrumenthi 1983 852f a9 00 lda #0 1984 8531 85 e2 sta sfxpitchoffset ; no pitch modification 1985 8533 85 e3 sta sfxnoteindex ; not a musical note 1986 8535 20 7a f2 jsr schedulesfx 1987 8538 a9 00 lda #0 1988 853a 85 de sta sfxschedulelock 1989 853c endif ; NOTIALOCKMUTE 1990 853c a9 00 LDA #0 1991 853e 8d 6e 01 STA explosion_aniframe 1992 8541 a9 01 LDA #1 1993 8543 8d 64 01 STA isDead_flag 1994 8546 4c fd 89 jmp ._checkCollisionsExit 1995 8549 1996 8549 .skipL0199 1997 8549 .L0200 ;; if boxcollision ( playerX , playerY , 8 , 16 , power_upX , power_upY , 8 , 8 ) then power_upX = 208 : power_upY = 208 : player_flag = 1 : power_up_Flag = 1 : playsfx sfx_bling : score0 = score0 + 1 : gosub power_up_obtained 1998 8549 1999 8549 2000 8549 18 clc ; one clc only. If we overflow we're screwed anyway. 2001 854a a0 07 ldy #(8-1) 2002 854c 84 44 sty temp3 2003 854e a0 0f ldy #(16-1) 2004 8550 84 45 sty temp4 2005 8552 ad 68 01 lda power_upX 2006 8555 69 30 adc #48 2007 8557 85 46 sta temp5 2008 8559 ad 69 01 lda power_upY 2009 855c 69 20 adc #((256-WSCREENHEIGHT)/2) 2010 855e 85 47 sta temp6 2011 8560 a0 07 ldy #(8-1) 2012 8562 84 48 sty temp7 2013 8564 a0 07 ldy #(8-1) 2014 8566 84 49 sty temp8 2015 8568 ad 42 01 lda playerY 2016 856b 69 20 adc #((256-WSCREENHEIGHT)/2) 2017 856d a8 tay 2018 856e ad 41 01 lda playerX 2019 8571 69 30 adc #48 2020 8573 20 f8 f3 jsr boxcollision 2021 8576 2022 8576 90 47 BCC .skipL0200 2023 8578 .condpart42 2024 8578 a9 d0 LDA #208 2025 857a 8d 68 01 STA power_upX 2026 857d 8d 69 01 STA power_upY 2027 8580 a9 01 LDA #1 2028 8582 8d 54 01 STA player_flag 2029 8585 8d 6a 01 STA power_up_Flag 2030 8588 ifnconst NOTIALOCKMUTE 2031 8588 a9 01 lda #1 2032 858a 85 de sta sfxschedulelock 2033 858c a9 9a lda #sfx_bling 2036 8592 85 e1 sta sfxinstrumenthi 2037 8594 a9 00 lda #0 2038 8596 85 e2 sta sfxpitchoffset ; no pitch modification 2039 8598 85 e3 sta sfxnoteindex ; not a musical note 2040 859a 20 7a f2 jsr schedulesfx 2041 859d a9 00 lda #0 2042 859f 85 de sta sfxschedulelock 2043 85a1 endif ; NOTIALOCKMUTE 2044 85a1 f8 SED 2045 85a2 18 CLC 2046 85a3 ad a8 01 LDA score0+2 2047 85a6 69 01 ADC #$01 2048 85a8 8d a8 01 STA score0+2 2049 85ab ad a7 01 LDA score0+1 2050 85ae 69 00 ADC #$00 2051 85b0 8d a7 01 STA score0+1 2052 85b3 ad a6 01 LDA score0 2053 85b6 69 00 ADC #$00 2054 85b8 8d a6 01 STA score0 2055 85bb d8 CLD 2056 85bc 20 e1 8d jsr .power_up_obtained 2057 85bf 2058 85bf .skipL0200 2059 85bf .L0201 ;; if boxcollision ( pBullet1_x , pBullet1_y , 4 , 8 , enemy01_xpos , enemy01_ypos , 8 , 16 ) then pBullet1_x = 200 : pBullet1_y = - 10 : enemy01_xpos = 208 : enemy01_ypos = 200 : enemy01_Flag = 1 : explosion_aniframe = 0 : playsfx sfx_explosion 2060 85bf 2061 85bf 2062 85bf 18 clc ; one clc only. If we overflow we're screwed anyway. 2063 85c0 a0 03 ldy #(4-1) 2064 85c2 84 44 sty temp3 2065 85c4 a0 07 ldy #(8-1) 2066 85c6 84 45 sty temp4 2067 85c8 ad 49 01 lda enemy01_xpos 2068 85cb 69 30 adc #48 2069 85cd 85 46 sta temp5 2070 85cf ad 53 01 lda enemy01_ypos 2071 85d2 69 20 adc #((256-WSCREENHEIGHT)/2) 2072 85d4 85 47 sta temp6 2073 85d6 a0 07 ldy #(8-1) 2074 85d8 84 48 sty temp7 2075 85da a0 0f ldy #(16-1) 2076 85dc 84 49 sty temp8 2077 85de ad e0 22 lda pBullet1_y 2078 85e1 69 20 adc #((256-WSCREENHEIGHT)/2) 2079 85e3 a8 tay 2080 85e4 ad a0 22 lda pBullet1_x 2081 85e7 69 30 adc #48 2082 85e9 20 f8 f3 jsr boxcollision 2083 85ec 2084 85ec 90 37 BCC .skipL0201 2085 85ee .condpart43 2086 85ee a9 c8 LDA #200 2087 85f0 8d a0 22 STA pBullet1_x 2088 85f3 a9 f6 LDA #246 2089 85f5 8d e0 22 STA pBullet1_y 2090 85f8 a9 d0 LDA #208 2091 85fa 8d 49 01 STA enemy01_xpos 2092 85fd a9 c8 LDA #200 2093 85ff 8d 53 01 STA enemy01_ypos 2094 8602 a9 01 LDA #1 2095 8604 8d 55 01 STA enemy01_Flag 2096 8607 a9 00 LDA #0 2097 8609 8d 6e 01 STA explosion_aniframe 2098 860c ifnconst NOTIALOCKMUTE 2099 860c a9 01 lda #1 2100 860e 85 de sta sfxschedulelock 2101 8610 a9 5d lda #sfx_explosion 2104 8616 85 e1 sta sfxinstrumenthi 2105 8618 a9 00 lda #0 2106 861a 85 e2 sta sfxpitchoffset ; no pitch modification 2107 861c 85 e3 sta sfxnoteindex ; not a musical note 2108 861e 20 7a f2 jsr schedulesfx 2109 8621 a9 00 lda #0 2110 8623 85 de sta sfxschedulelock 2111 8625 endif ; NOTIALOCKMUTE 2112 8625 .skipL0201 2113 8625 .L0202 ;; if boxcollision ( pBullet2_x , pBullet2_y , 4 , 8 , enemy01_xpos , enemy01_ypos , 8 , 16 ) then pBullet2_x = 200 : pBullet2_y = - 10 : enemy01_xpos = 208 : enemy01_ypos = 200 : enemy01_Flag = 1 : explosion_aniframe = 0 : playsfx sfx_explosion 2114 8625 2115 8625 2116 8625 18 clc ; one clc only. If we overflow we're screwed anyway. 2117 8626 a0 03 ldy #(4-1) 2118 8628 84 44 sty temp3 2119 862a a0 07 ldy #(8-1) 2120 862c 84 45 sty temp4 2121 862e ad 49 01 lda enemy01_xpos 2122 8631 69 30 adc #48 2123 8633 85 46 sta temp5 2124 8635 ad 53 01 lda enemy01_ypos 2125 8638 69 20 adc #((256-WSCREENHEIGHT)/2) 2126 863a 85 47 sta temp6 2127 863c a0 07 ldy #(8-1) 2128 863e 84 48 sty temp7 2129 8640 a0 0f ldy #(16-1) 2130 8642 84 49 sty temp8 2131 8644 ad f0 22 lda pBullet2_y 2132 8647 69 20 adc #((256-WSCREENHEIGHT)/2) 2133 8649 a8 tay 2134 864a ad b0 22 lda pBullet2_x 2135 864d 69 30 adc #48 2136 864f 20 f8 f3 jsr boxcollision 2137 8652 2138 8652 90 37 BCC .skipL0202 2139 8654 .condpart44 2140 8654 a9 c8 LDA #200 2141 8656 8d b0 22 STA pBullet2_x 2142 8659 a9 f6 LDA #246 2143 865b 8d f0 22 STA pBullet2_y 2144 865e a9 d0 LDA #208 2145 8660 8d 49 01 STA enemy01_xpos 2146 8663 a9 c8 LDA #200 2147 8665 8d 53 01 STA enemy01_ypos 2148 8668 a9 01 LDA #1 2149 866a 8d 55 01 STA enemy01_Flag 2150 866d a9 00 LDA #0 2151 866f 8d 6e 01 STA explosion_aniframe 2152 8672 ifnconst NOTIALOCKMUTE 2153 8672 a9 01 lda #1 2154 8674 85 de sta sfxschedulelock 2155 8676 a9 5d lda #sfx_explosion 2158 867c 85 e1 sta sfxinstrumenthi 2159 867e a9 00 lda #0 2160 8680 85 e2 sta sfxpitchoffset ; no pitch modification 2161 8682 85 e3 sta sfxnoteindex ; not a musical note 2162 8684 20 7a f2 jsr schedulesfx 2163 8687 a9 00 lda #0 2164 8689 85 de sta sfxschedulelock 2165 868b endif ; NOTIALOCKMUTE 2166 868b .skipL0202 2167 868b .L0203 ;; if boxcollision ( pBullet3_x , pBullet3_y , 4 , 8 , enemy01_xpos , enemy01_ypos , 8 , 16 ) then pBullet3_x = 200 : pBullet3_y = - 10 : enemy01_xpos = 208 : enemy01_ypos = 200 : enemy01_Flag = 1 : explosion_aniframe = 0 : playsfx sfx_explosion 2168 868b 2169 868b 2170 868b 18 clc ; one clc only. If we overflow we're screwed anyway. 2171 868c a0 03 ldy #(4-1) 2172 868e 84 44 sty temp3 2173 8690 a0 07 ldy #(8-1) 2174 8692 84 45 sty temp4 2175 8694 ad 49 01 lda enemy01_xpos 2176 8697 69 30 adc #48 2177 8699 85 46 sta temp5 2178 869b ad 53 01 lda enemy01_ypos 2179 869e 69 20 adc #((256-WSCREENHEIGHT)/2) 2180 86a0 85 47 sta temp6 2181 86a2 a0 07 ldy #(8-1) 2182 86a4 84 48 sty temp7 2183 86a6 a0 0f ldy #(16-1) 2184 86a8 84 49 sty temp8 2185 86aa ad 00 23 lda pBullet3_y 2186 86ad 69 20 adc #((256-WSCREENHEIGHT)/2) 2187 86af a8 tay 2188 86b0 ad c0 22 lda pBullet3_x 2189 86b3 69 30 adc #48 2190 86b5 20 f8 f3 jsr boxcollision 2191 86b8 2192 86b8 90 37 BCC .skipL0203 2193 86ba .condpart45 2194 86ba a9 c8 LDA #200 2195 86bc 8d c0 22 STA pBullet3_x 2196 86bf a9 f6 LDA #246 2197 86c1 8d 00 23 STA pBullet3_y 2198 86c4 a9 d0 LDA #208 2199 86c6 8d 49 01 STA enemy01_xpos 2200 86c9 a9 c8 LDA #200 2201 86cb 8d 53 01 STA enemy01_ypos 2202 86ce a9 01 LDA #1 2203 86d0 8d 55 01 STA enemy01_Flag 2204 86d3 a9 00 LDA #0 2205 86d5 8d 6e 01 STA explosion_aniframe 2206 86d8 ifnconst NOTIALOCKMUTE 2207 86d8 a9 01 lda #1 2208 86da 85 de sta sfxschedulelock 2209 86dc a9 5d lda #sfx_explosion 2212 86e2 85 e1 sta sfxinstrumenthi 2213 86e4 a9 00 lda #0 2214 86e6 85 e2 sta sfxpitchoffset ; no pitch modification 2215 86e8 85 e3 sta sfxnoteindex ; not a musical note 2216 86ea 20 7a f2 jsr schedulesfx 2217 86ed a9 00 lda #0 2218 86ef 85 de sta sfxschedulelock 2219 86f1 endif ; NOTIALOCKMUTE 2220 86f1 .skipL0203 2221 86f1 .L0204 ;; if boxcollision ( pBullet4_x , pBullet4_y , 4 , 8 , enemy01_xpos , enemy01_ypos , 8 , 16 ) then pBullet4_x = 200 : pBullet4_y = - 10 : enemy01_xpos = 208 : enemy01_ypos = 200 : enemy01_Flag = 1 : explosion_aniframe = 0 : playsfx sfx_explosion 2222 86f1 2223 86f1 2224 86f1 18 clc ; one clc only. If we overflow we're screwed anyway. 2225 86f2 a0 03 ldy #(4-1) 2226 86f4 84 44 sty temp3 2227 86f6 a0 07 ldy #(8-1) 2228 86f8 84 45 sty temp4 2229 86fa ad 49 01 lda enemy01_xpos 2230 86fd 69 30 adc #48 2231 86ff 85 46 sta temp5 2232 8701 ad 53 01 lda enemy01_ypos 2233 8704 69 20 adc #((256-WSCREENHEIGHT)/2) 2234 8706 85 47 sta temp6 2235 8708 a0 07 ldy #(8-1) 2236 870a 84 48 sty temp7 2237 870c a0 0f ldy #(16-1) 2238 870e 84 49 sty temp8 2239 8710 ad 10 23 lda pBullet4_y 2240 8713 69 20 adc #((256-WSCREENHEIGHT)/2) 2241 8715 a8 tay 2242 8716 ad d0 22 lda pBullet4_x 2243 8719 69 30 adc #48 2244 871b 20 f8 f3 jsr boxcollision 2245 871e 2246 871e 90 37 BCC .skipL0204 2247 8720 .condpart46 2248 8720 a9 c8 LDA #200 2249 8722 8d d0 22 STA pBullet4_x 2250 8725 a9 f6 LDA #246 2251 8727 8d 10 23 STA pBullet4_y 2252 872a a9 d0 LDA #208 2253 872c 8d 49 01 STA enemy01_xpos 2254 872f a9 c8 LDA #200 2255 8731 8d 53 01 STA enemy01_ypos 2256 8734 a9 01 LDA #1 2257 8736 8d 55 01 STA enemy01_Flag 2258 8739 a9 00 LDA #0 2259 873b 8d 6e 01 STA explosion_aniframe 2260 873e ifnconst NOTIALOCKMUTE 2261 873e a9 01 lda #1 2262 8740 85 de sta sfxschedulelock 2263 8742 a9 5d lda #sfx_explosion 2266 8748 85 e1 sta sfxinstrumenthi 2267 874a a9 00 lda #0 2268 874c 85 e2 sta sfxpitchoffset ; no pitch modification 2269 874e 85 e3 sta sfxnoteindex ; not a musical note 2270 8750 20 7a f2 jsr schedulesfx 2271 8753 a9 00 lda #0 2272 8755 85 de sta sfxschedulelock 2273 8757 endif ; NOTIALOCKMUTE 2274 8757 .skipL0204 2275 8757 .L0205 ;; if boxcollision ( playerX , playerY , 8 , 16 , extra_shipX , extra_shipY , 8 , 8 ) then extra_shipX = 208 : extra_shipY = 208 : extra_shipFlag = 1 : playsfx sfx_bling : lives = lives + 1 2276 8757 2277 8757 2278 8757 18 clc ; one clc only. If we overflow we're screwed anyway. 2279 8758 a0 07 ldy #(8-1) 2280 875a 84 44 sty temp3 2281 875c a0 0f ldy #(16-1) 2282 875e 84 45 sty temp4 2283 8760 ad 6b 01 lda extra_shipX 2284 8763 69 30 adc #48 2285 8765 85 46 sta temp5 2286 8767 ad 6c 01 lda extra_shipY 2287 876a 69 20 adc #((256-WSCREENHEIGHT)/2) 2288 876c 85 47 sta temp6 2289 876e a0 07 ldy #(8-1) 2290 8770 84 48 sty temp7 2291 8772 a0 07 ldy #(8-1) 2292 8774 84 49 sty temp8 2293 8776 ad 42 01 lda playerY 2294 8779 69 20 adc #((256-WSCREENHEIGHT)/2) 2295 877b a8 tay 2296 877c ad 41 01 lda playerX 2297 877f 69 30 adc #48 2298 8781 20 f8 f3 jsr boxcollision 2299 8784 2300 8784 90 2f BCC .skipL0205 2301 8786 .condpart47 2302 8786 a9 d0 LDA #208 2303 8788 8d 6b 01 STA extra_shipX 2304 878b 8d 6c 01 STA extra_shipY 2305 878e a9 01 LDA #1 2306 8790 8d 6d 01 STA extra_shipFlag 2307 8793 ifnconst NOTIALOCKMUTE 2308 8793 a9 01 lda #1 2309 8795 85 de sta sfxschedulelock 2310 8797 a9 9a lda #sfx_bling 2313 879d 85 e1 sta sfxinstrumenthi 2314 879f a9 00 lda #0 2315 87a1 85 e2 sta sfxpitchoffset ; no pitch modification 2316 87a3 85 e3 sta sfxnoteindex ; not a musical note 2317 87a5 20 7a f2 jsr schedulesfx 2318 87a8 a9 00 lda #0 2319 87aa 85 de sta sfxschedulelock 2320 87ac endif ; NOTIALOCKMUTE 2321 87ac ad 65 01 LDA lives 2322 87af 18 CLC 2323 87b0 69 01 ADC #1 2324 87b2 8d 65 01 STA lives 2325 87b5 .skipL0205 2326 87b5 .L0206 ;; if boxcollision ( p_twinlaser1_x , p_twinlaser1_y , 8 , 16 , enemy01_xpos , enemy01_ypos , 8 , 16 ) then p_twinlaser1_x = 200 : p_twinlaser1_y = - 10 : enemy01_xpos = 208 : enemy01_ypos = 200 : enemy01_Flag = 1 : explosion_aniframe = 0 : playsfx sfx_explosion 2327 87b5 2328 87b5 2329 87b5 18 clc ; one clc only. If we overflow we're screwed anyway. 2330 87b6 a0 07 ldy #(8-1) 2331 87b8 84 44 sty temp3 2332 87ba a0 0f ldy #(16-1) 2333 87bc 84 45 sty temp4 2334 87be ad 49 01 lda enemy01_xpos 2335 87c1 69 30 adc #48 2336 87c3 85 46 sta temp5 2337 87c5 ad 53 01 lda enemy01_ypos 2338 87c8 69 20 adc #((256-WSCREENHEIGHT)/2) 2339 87ca 85 47 sta temp6 2340 87cc a0 07 ldy #(8-1) 2341 87ce 84 48 sty temp7 2342 87d0 a0 0f ldy #(16-1) 2343 87d2 84 49 sty temp8 2344 87d4 ad 7a 01 lda p_twinlaser1_y 2345 87d7 69 20 adc #((256-WSCREENHEIGHT)/2) 2346 87d9 a8 tay 2347 87da ad 76 01 lda p_twinlaser1_x 2348 87dd 69 30 adc #48 2349 87df 20 f8 f3 jsr boxcollision 2350 87e2 2351 87e2 90 41 BCC .skipL0206 2352 87e4 .condpart48 2353 87e4 a9 00 LDA #0 2354 87e6 8d 7e 01 STA var62 2355 87e9 a9 c8 LDA #200 2356 87eb 8d 76 01 STA p_twinlaser1_x 2357 87ee a2 00 LDX #0 2358 87f0 8e 82 01 STX var66 2359 87f3 a9 f6 LDA #246 2360 87f5 8d 7a 01 STA p_twinlaser1_y 2361 87f8 a9 d0 LDA #208 2362 87fa 8d 49 01 STA enemy01_xpos 2363 87fd a9 c8 LDA #200 2364 87ff 8d 53 01 STA enemy01_ypos 2365 8802 a9 01 LDA #1 2366 8804 8d 55 01 STA enemy01_Flag 2367 8807 a9 00 LDA #0 2368 8809 8d 6e 01 STA explosion_aniframe 2369 880c ifnconst NOTIALOCKMUTE 2370 880c a9 01 lda #1 2371 880e 85 de sta sfxschedulelock 2372 8810 a9 5d lda #sfx_explosion 2375 8816 85 e1 sta sfxinstrumenthi 2376 8818 a9 00 lda #0 2377 881a 85 e2 sta sfxpitchoffset ; no pitch modification 2378 881c 85 e3 sta sfxnoteindex ; not a musical note 2379 881e 20 7a f2 jsr schedulesfx 2380 8821 a9 00 lda #0 2381 8823 85 de sta sfxschedulelock 2382 8825 endif ; NOTIALOCKMUTE 2383 8825 .skipL0206 2384 8825 .L0207 ;; if pBullet1_x > enemy01_xpos && pBullet1_x < customTemp1 && pBullet1_y > enemy01_ypos && pBullet1_y < customTemp2 then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion : goto collisions_done 2385 8825 2386 8825 ad 49 01 LDA enemy01_xpos 2387 8828 cd a0 22 CMP pBullet1_x 2388 882b b0 57 BCS .skipL0207 2389 882d .condpart49 2390 882d ad a0 22 LDA pBullet1_x 2391 8830 cd 5f 01 CMP customTemp1 2392 8833 b0 4f BCS .skip49then 2393 8835 .condpart50 2394 8835 ad 53 01 LDA enemy01_ypos 2395 8838 cd e0 22 CMP pBullet1_y 2396 883b b0 47 BCS .skip50then 2397 883d .condpart51 2398 883d ad e0 22 LDA pBullet1_y 2399 8840 cd 60 01 CMP customTemp2 2400 8843 b0 3f BCS .skip51then 2401 8845 .condpart52 2402 8845 a9 01 LDA #1 2403 8847 8d 55 01 STA enemy01_Flag 2404 884a 8d 6e 01 STA explosion_aniframe 2405 884d f8 SED 2406 884e 18 CLC 2407 884f ad a8 01 LDA score0+2 2408 8852 69 01 ADC #$01 2409 8854 8d a8 01 STA score0+2 2410 8857 ad a7 01 LDA score0+1 2411 885a 69 00 ADC #$00 2412 885c 8d a7 01 STA score0+1 2413 885f ad a6 01 LDA score0 2414 8862 69 00 ADC #$00 2415 8864 8d a6 01 STA score0 2416 8867 d8 CLD 2417 8868 ifnconst NOTIALOCKMUTE 2418 8868 a9 01 lda #1 2419 886a 85 de sta sfxschedulelock 2420 886c a9 5d lda #sfx_explosion 2423 8872 85 e1 sta sfxinstrumenthi 2424 8874 a9 00 lda #0 2425 8876 85 e2 sta sfxpitchoffset ; no pitch modification 2426 8878 85 e3 sta sfxnoteindex ; not a musical note 2427 887a 20 7a f2 jsr schedulesfx 2428 887d a9 00 lda #0 2429 887f 85 de sta sfxschedulelock 2430 8881 endif ; NOTIALOCKMUTE 2431 8881 4c 07 8a jmp .collisions_done 2432 8884 2433 8884 .skip51then 2434 8884 .skip50then 2435 8884 .skip49then 2436 8884 .skipL0207 2437 8884 .L0208 ;; if pBullet2_x > enemy01_xpos && pBullet2_x < customTemp1 && pBullet2_y > enemy01_ypos && pBullet2_y < customTemp2 then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion : goto collisions_done 2438 8884 2439 8884 ad 49 01 LDA enemy01_xpos 2440 8887 cd b0 22 CMP pBullet2_x 2441 888a b0 57 BCS .skipL0208 2442 888c .condpart53 2443 888c ad b0 22 LDA pBullet2_x 2444 888f cd 5f 01 CMP customTemp1 2445 8892 b0 4f BCS .skip53then 2446 8894 .condpart54 2447 8894 ad 53 01 LDA enemy01_ypos 2448 8897 cd f0 22 CMP pBullet2_y 2449 889a b0 47 BCS .skip54then 2450 889c .condpart55 2451 889c ad f0 22 LDA pBullet2_y 2452 889f cd 60 01 CMP customTemp2 2453 88a2 b0 3f BCS .skip55then 2454 88a4 .condpart56 2455 88a4 a9 01 LDA #1 2456 88a6 8d 55 01 STA enemy01_Flag 2457 88a9 8d 6e 01 STA explosion_aniframe 2458 88ac f8 SED 2459 88ad 18 CLC 2460 88ae ad a8 01 LDA score0+2 2461 88b1 69 01 ADC #$01 2462 88b3 8d a8 01 STA score0+2 2463 88b6 ad a7 01 LDA score0+1 2464 88b9 69 00 ADC #$00 2465 88bb 8d a7 01 STA score0+1 2466 88be ad a6 01 LDA score0 2467 88c1 69 00 ADC #$00 2468 88c3 8d a6 01 STA score0 2469 88c6 d8 CLD 2470 88c7 ifnconst NOTIALOCKMUTE 2471 88c7 a9 01 lda #1 2472 88c9 85 de sta sfxschedulelock 2473 88cb a9 5d lda #sfx_explosion 2476 88d1 85 e1 sta sfxinstrumenthi 2477 88d3 a9 00 lda #0 2478 88d5 85 e2 sta sfxpitchoffset ; no pitch modification 2479 88d7 85 e3 sta sfxnoteindex ; not a musical note 2480 88d9 20 7a f2 jsr schedulesfx 2481 88dc a9 00 lda #0 2482 88de 85 de sta sfxschedulelock 2483 88e0 endif ; NOTIALOCKMUTE 2484 88e0 4c 07 8a jmp .collisions_done 2485 88e3 2486 88e3 .skip55then 2487 88e3 .skip54then 2488 88e3 .skip53then 2489 88e3 .skipL0208 2490 88e3 .L0209 ;; if pBullet3_x > enemy01_xpos && pBullet3_x < customTemp1 && pBullet3_y > enemy01_ypos && pBullet3_y < customTemp2 then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion : goto collisions_done 2491 88e3 2492 88e3 ad 49 01 LDA enemy01_xpos 2493 88e6 cd c0 22 CMP pBullet3_x 2494 88e9 b0 57 BCS .skipL0209 2495 88eb .condpart57 2496 88eb ad c0 22 LDA pBullet3_x 2497 88ee cd 5f 01 CMP customTemp1 2498 88f1 b0 4f BCS .skip57then 2499 88f3 .condpart58 2500 88f3 ad 53 01 LDA enemy01_ypos 2501 88f6 cd 00 23 CMP pBullet3_y 2502 88f9 b0 47 BCS .skip58then 2503 88fb .condpart59 2504 88fb ad 00 23 LDA pBullet3_y 2505 88fe cd 60 01 CMP customTemp2 2506 8901 b0 3f BCS .skip59then 2507 8903 .condpart60 2508 8903 a9 01 LDA #1 2509 8905 8d 55 01 STA enemy01_Flag 2510 8908 8d 6e 01 STA explosion_aniframe 2511 890b f8 SED 2512 890c 18 CLC 2513 890d ad a8 01 LDA score0+2 2514 8910 69 01 ADC #$01 2515 8912 8d a8 01 STA score0+2 2516 8915 ad a7 01 LDA score0+1 2517 8918 69 00 ADC #$00 2518 891a 8d a7 01 STA score0+1 2519 891d ad a6 01 LDA score0 2520 8920 69 00 ADC #$00 2521 8922 8d a6 01 STA score0 2522 8925 d8 CLD 2523 8926 ifnconst NOTIALOCKMUTE 2524 8926 a9 01 lda #1 2525 8928 85 de sta sfxschedulelock 2526 892a a9 5d lda #sfx_explosion 2529 8930 85 e1 sta sfxinstrumenthi 2530 8932 a9 00 lda #0 2531 8934 85 e2 sta sfxpitchoffset ; no pitch modification 2532 8936 85 e3 sta sfxnoteindex ; not a musical note 2533 8938 20 7a f2 jsr schedulesfx 2534 893b a9 00 lda #0 2535 893d 85 de sta sfxschedulelock 2536 893f endif ; NOTIALOCKMUTE 2537 893f 4c 07 8a jmp .collisions_done 2538 8942 2539 8942 .skip59then 2540 8942 .skip58then 2541 8942 .skip57then 2542 8942 .skipL0209 2543 8942 .L0210 ;; if pBullet4_x > enemy01_xpos && pBullet4_x < customTemp1 && pBullet4_y > enemy01_ypos && pBullet4_y < customTemp2 then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion : goto collisions_done 2544 8942 2545 8942 ad 49 01 LDA enemy01_xpos 2546 8945 cd d0 22 CMP pBullet4_x 2547 8948 b0 57 BCS .skipL0210 2548 894a .condpart61 2549 894a ad d0 22 LDA pBullet4_x 2550 894d cd 5f 01 CMP customTemp1 2551 8950 b0 4f BCS .skip61then 2552 8952 .condpart62 2553 8952 ad 53 01 LDA enemy01_ypos 2554 8955 cd 10 23 CMP pBullet4_y 2555 8958 b0 47 BCS .skip62then 2556 895a .condpart63 2557 895a ad 10 23 LDA pBullet4_y 2558 895d cd 60 01 CMP customTemp2 2559 8960 b0 3f BCS .skip63then 2560 8962 .condpart64 2561 8962 a9 01 LDA #1 2562 8964 8d 55 01 STA enemy01_Flag 2563 8967 8d 6e 01 STA explosion_aniframe 2564 896a f8 SED 2565 896b 18 CLC 2566 896c ad a8 01 LDA score0+2 2567 896f 69 01 ADC #$01 2568 8971 8d a8 01 STA score0+2 2569 8974 ad a7 01 LDA score0+1 2570 8977 69 00 ADC #$00 2571 8979 8d a7 01 STA score0+1 2572 897c ad a6 01 LDA score0 2573 897f 69 00 ADC #$00 2574 8981 8d a6 01 STA score0 2575 8984 d8 CLD 2576 8985 ifnconst NOTIALOCKMUTE 2577 8985 a9 01 lda #1 2578 8987 85 de sta sfxschedulelock 2579 8989 a9 5d lda #sfx_explosion 2582 898f 85 e1 sta sfxinstrumenthi 2583 8991 a9 00 lda #0 2584 8993 85 e2 sta sfxpitchoffset ; no pitch modification 2585 8995 85 e3 sta sfxnoteindex ; not a musical note 2586 8997 20 7a f2 jsr schedulesfx 2587 899a a9 00 lda #0 2588 899c 85 de sta sfxschedulelock 2589 899e endif ; NOTIALOCKMUTE 2590 899e 4c 07 8a jmp .collisions_done 2591 89a1 2592 89a1 .skip63then 2593 89a1 .skip62then 2594 89a1 .skip61then 2595 89a1 .skipL0210 2596 89a1 .L0211 ;; if p_twinlaser1_x > enemy01_xpos && p_twinlaser1_x < customTemp1 && p_twinlaser1_y > enemy01_ypos && p_twinlaser1_y < customTemp2 then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 2 : playsfx sfx_explosion 2597 89a1 2598 89a1 ad 49 01 LDA enemy01_xpos 2599 89a4 cd 76 01 CMP p_twinlaser1_x 2600 89a7 b0 54 BCS .skipL0211 2601 89a9 .condpart65 2602 89a9 ad 76 01 LDA p_twinlaser1_x 2603 89ac cd 5f 01 CMP customTemp1 2604 89af b0 4c BCS .skip65then 2605 89b1 .condpart66 2606 89b1 ad 53 01 LDA enemy01_ypos 2607 89b4 cd 7a 01 CMP p_twinlaser1_y 2608 89b7 b0 44 BCS .skip66then 2609 89b9 .condpart67 2610 89b9 ad 7a 01 LDA p_twinlaser1_y 2611 89bc cd 60 01 CMP customTemp2 2612 89bf b0 3c BCS .skip67then 2613 89c1 .condpart68 2614 89c1 a9 01 LDA #1 2615 89c3 8d 55 01 STA enemy01_Flag 2616 89c6 8d 6e 01 STA explosion_aniframe 2617 89c9 f8 SED 2618 89ca 18 CLC 2619 89cb ad a8 01 LDA score0+2 2620 89ce 69 02 ADC #$02 2621 89d0 8d a8 01 STA score0+2 2622 89d3 ad a7 01 LDA score0+1 2623 89d6 69 00 ADC #$00 2624 89d8 8d a7 01 STA score0+1 2625 89db ad a6 01 LDA score0 2626 89de 69 00 ADC #$00 2627 89e0 8d a6 01 STA score0 2628 89e3 d8 CLD 2629 89e4 ifnconst NOTIALOCKMUTE 2630 89e4 a9 01 lda #1 2631 89e6 85 de sta sfxschedulelock 2632 89e8 a9 5d lda #sfx_explosion 2635 89ee 85 e1 sta sfxinstrumenthi 2636 89f0 a9 00 lda #0 2637 89f2 85 e2 sta sfxpitchoffset ; no pitch modification 2638 89f4 85 e3 sta sfxnoteindex ; not a musical note 2639 89f6 20 7a f2 jsr schedulesfx 2640 89f9 a9 00 lda #0 2641 89fb 85 de sta sfxschedulelock 2642 89fd endif ; NOTIALOCKMUTE 2643 89fd .skip67then 2644 89fd .skip66then 2645 89fd .skip65then 2646 89fd .skipL0211 2647 89fd ._checkCollisionsExit 2648 89fd ;; _checkCollisionsExit 2649 89fd 2650 89fd .L0212 ;; return 2651 89fd 2652 89fd ba tsx 2653 89fe bd 02 01 lda $102,x 2654 8a01 f0 01 beq bankswitchret3 2655 8a03 60 RTS 2656 8a04 bankswitchret3 2657 8a04 4c a1 f4 JMP BS_return 2658 8a07 .collisions_done 2659 8a07 ;; collisions_done 2660 8a07 2661 8a07 .L0213 ;; return 2662 8a07 2663 8a07 ba tsx 2664 8a08 bd 02 01 lda $102,x 2665 8a0b f0 01 beq bankswitchret4 2666 8a0d 60 RTS 2667 8a0e bankswitchret4 2668 8a0e 4c a1 f4 JMP BS_return 2669 8a11 . 2670 8a11 ;; 2671 8a11 2672 8a11 . 2673 8a11 ;; 2674 8a11 2675 8a11 .check_firebutton 2676 8a11 ;; check_firebutton 2677 8a11 2678 8a11 .L0214 ;; if fire_debounce > 0 && joy0fire then return 2679 8a11 2680 8a11 a9 00 LDA #0 2681 8a13 cd 43 01 CMP fire_debounce 2682 8a16 b0 0f BCS .skipL0214 2683 8a18 .condpart69 2684 8a18 2c 02 21 bit sINPT1 2685 8a1b 10 0a BPL .skip69then 2686 8a1d .condpart70 2687 8a1d ba tsx 2688 8a1e bd 02 01 lda $102,x 2689 8a21 f0 01 beq bankswitchret5 2690 8a23 60 RTS 2691 8a24 bankswitchret5 2692 8a24 4c a1 f4 JMP BS_return 2693 8a27 .skip69then 2694 8a27 .skipL0214 2695 8a27 .L0215 ;; if !joy0fire then fire_debounce = 0 : return 2696 8a27 2697 8a27 2c 02 21 bit sINPT1 2698 8a2a 30 0f BMI .skipL0215 2699 8a2c .condpart71 2700 8a2c a9 00 LDA #0 2701 8a2e 8d 43 01 STA fire_debounce 2702 8a31 ba tsx 2703 8a32 bd 02 01 lda $102,x 2704 8a35 f0 01 beq bankswitchret6 2705 8a37 60 RTS 2706 8a38 bankswitchret6 2707 8a38 4c a1 f4 JMP BS_return 2708 8a3b .skipL0215 2709 8a3b .L0216 ;; temp5 = 255 2710 8a3b 2711 8a3b a9 ff LDA #255 2712 8a3d 85 46 STA temp5 2713 8a3f .L0217 ;; for temp1 = 0 to 3 2714 8a3f 2715 8a3f a9 00 LDA #0 2716 8a41 85 42 STA temp1 2717 8a43 .L0217fortemp1 2718 8a43 .L0218 ;; if pBullet1_y[temp1]! = 200 then temp5 = temp1 2719 8a43 2720 8a43 a6 42 LDX temp1 2721 8a45 bd e0 22 LDA pBullet1_y,x 2722 8a48 c9 c8 CMP #200 2723 8a4a d0 04 BNE .skipL0218 2724 8a4c .condpart72 2725 8a4c a5 42 LDA temp1 2726 8a4e 85 46 STA temp5 2727 8a50 .skipL0218 2728 8a50 .L0219 ;; next 2729 8a50 2730 8a50 a5 42 LDA temp1 2731 8a52 c9 03 CMP #3 2732 8a54 e6 42 INC temp1 2733 8a56 if ((* - .L0217fortemp1) < 127) && ((* - .L0217fortemp1) > -128) 2734 8a56 90 eb bcc .L0217fortemp1 2735 8a58 - else 2736 8a58 - bcs .0skipL0217fortemp1 2737 8a58 - jmp .L0217fortemp1 2738 8a58 -.0skipL0217fortemp1 2739 8a58 endif 2740 8a58 .L0220 ;; if temp5 = 255 then return 2741 8a58 2742 8a58 a5 46 LDA temp5 2743 8a5a c9 ff CMP #255 2744 8a5c d0 0a BNE .skipL0220 2745 8a5e .condpart73 2746 8a5e ba tsx 2747 8a5f bd 02 01 lda $102,x 2748 8a62 f0 01 beq bankswitchret7 2749 8a64 60 RTS 2750 8a65 bankswitchret7 2751 8a65 4c a1 f4 JMP BS_return 2752 8a68 .skipL0220 2753 8a68 .L0221 ;; playsfx sfx_pulsecannon 2754 8a68 2755 8a68 ifnconst NOTIALOCKMUTE 2756 8a68 a9 01 lda #1 2757 8a6a 85 de sta sfxschedulelock 2758 8a6c a9 d3 lda #sfx_pulsecannon 2761 8a72 85 e1 sta sfxinstrumenthi 2762 8a74 a9 00 lda #0 2763 8a76 85 e2 sta sfxpitchoffset ; no pitch modification 2764 8a78 85 e3 sta sfxnoteindex ; not a musical note 2765 8a7a 20 7a f2 jsr schedulesfx 2766 8a7d a9 00 lda #0 2767 8a7f 85 de sta sfxschedulelock 2768 8a81 endif ; NOTIALOCKMUTE 2769 8a81 .L0222 ;; fire_debounce = 255 2770 8a81 2771 8a81 a9 ff LDA #255 2772 8a83 8d 43 01 STA fire_debounce 2773 8a86 .L0223 ;; pBullet1_time[temp5] = 200 2774 8a86 2775 8a86 a9 c8 LDA #200 2776 8a88 a6 46 LDX temp5 2777 8a8a 9d 72 01 STA pBullet1_time,x 2778 8a8d .L0224 ;; pBullet1_x[temp5] = playerX + 2 2779 8a8d 2780 8a8d ad 41 01 LDA playerX 2781 8a90 18 CLC 2782 8a91 69 02 ADC #2 2783 8a93 a6 46 LDX temp5 2784 8a95 9d a0 22 STA pBullet1_x,x 2785 8a98 .L0225 ;; pBullet1_y[temp5] = playerY - 8 2786 8a98 2787 8a98 ad 42 01 LDA playerY 2788 8a9b 38 SEC 2789 8a9c e9 08 SBC #8 2790 8a9e a6 46 LDX temp5 2791 8aa0 9d e0 22 STA pBullet1_y,x 2792 8aa3 . 2793 8aa3 ;; 2794 8aa3 2795 8aa3 .L0226 ;; temp5 = temp5 - 6 2796 8aa3 2797 8aa3 a5 46 LDA temp5 2798 8aa5 38 SEC 2799 8aa6 e9 06 SBC #6 2800 8aa8 85 46 STA temp5 2801 8aaa .L0227 ;; return 2802 8aaa 2803 8aaa ba tsx 2804 8aab bd 02 01 lda $102,x 2805 8aae f0 01 beq bankswitchret8 2806 8ab0 60 RTS 2807 8ab1 bankswitchret8 2808 8ab1 4c a1 f4 JMP BS_return 2809 8ab4 . 2810 8ab4 ;; 2811 8ab4 2812 8ab4 . 2813 8ab4 ;; 2814 8ab4 2815 8ab4 .move_bullets 2816 8ab4 ;; move_bullets 2817 8ab4 2818 8ab4 .L0228 ;; if pBullet1_time <> 200 then pBullet1_y = pBullet1_y - 4 2819 8ab4 2820 8ab4 ad 72 01 LDA pBullet1_time 2821 8ab7 c9 c8 CMP #200 2822 8ab9 f0 09 BEQ .skipL0228 2823 8abb .condpart74 2824 8abb ad e0 22 LDA pBullet1_y 2825 8abe 38 SEC 2826 8abf e9 04 SBC #4 2827 8ac1 8d e0 22 STA pBullet1_y 2828 8ac4 .skipL0228 2829 8ac4 .L0229 ;; if pBullet2_time <> 200 then pBullet2_y = pBullet2_y - 4 2830 8ac4 2831 8ac4 ad 73 01 LDA pBullet2_time 2832 8ac7 c9 c8 CMP #200 2833 8ac9 f0 09 BEQ .skipL0229 2834 8acb .condpart75 2835 8acb ad f0 22 LDA pBullet2_y 2836 8ace 38 SEC 2837 8acf e9 04 SBC #4 2838 8ad1 8d f0 22 STA pBullet2_y 2839 8ad4 .skipL0229 2840 8ad4 .L0230 ;; if pBullet3_time <> 200 then pBullet3_y = pBullet3_y - 4 2841 8ad4 2842 8ad4 ad 74 01 LDA pBullet3_time 2843 8ad7 c9 c8 CMP #200 2844 8ad9 f0 09 BEQ .skipL0230 2845 8adb .condpart76 2846 8adb ad 00 23 LDA pBullet3_y 2847 8ade 38 SEC 2848 8adf e9 04 SBC #4 2849 8ae1 8d 00 23 STA pBullet3_y 2850 8ae4 .skipL0230 2851 8ae4 .L0231 ;; if pBullet4_time <> 200 then pBullet4_y = pBullet4_y - 4 2852 8ae4 2853 8ae4 ad 75 01 LDA pBullet4_time 2854 8ae7 c9 c8 CMP #200 2855 8ae9 f0 09 BEQ .skipL0231 2856 8aeb .condpart77 2857 8aeb ad 10 23 LDA pBullet4_y 2858 8aee 38 SEC 2859 8aef e9 04 SBC #4 2860 8af1 8d 10 23 STA pBullet4_y 2861 8af4 .skipL0231 2862 8af4 .L0232 ;; return 2863 8af4 2864 8af4 ba tsx 2865 8af5 bd 02 01 lda $102,x 2866 8af8 f0 01 beq bankswitchret9 2867 8afa 60 RTS 2868 8afb bankswitchret9 2869 8afb 4c a1 f4 JMP BS_return 2870 8afe . 2871 8afe ;; 2872 8afe 2873 8afe .check_bullet_time 2874 8afe ;; check_bullet_time 2875 8afe 2876 8afe .L0233 ;; for temp1 = 0 to 3 2877 8afe 2878 8afe a9 00 LDA #0 2879 8b00 85 42 STA temp1 2880 8b02 .L0233fortemp1 2881 8b02 .L0234 ;; if pBullet1_time[temp1] > 0 then pBullet1_time[temp1] = pBullet1_time[temp1] - 1 else pBullet1_x[temp1] = 200 2882 8b02 2883 8b02 a9 00 LDA #0 2884 8b04 a6 42 LDX temp1 2885 8b06 dd 72 01 CMP pBullet1_time,x 2886 8b09 b0 10 BCS .skipL0234 2887 8b0b .condpart78 2888 8b0b a6 42 LDX temp1 2889 8b0d bd 72 01 LDA pBullet1_time,x 2890 8b10 38 SEC 2891 8b11 e9 01 SBC #1 2892 8b13 a6 42 LDX temp1 2893 8b15 9d 72 01 STA pBullet1_time,x 2894 8b18 4c 22 8b jmp .skipelse0 2895 8b1b .skipL0234 2896 8b1b a9 c8 LDA #200 2897 8b1d a6 42 LDX temp1 2898 8b1f 9d a0 22 STA pBullet1_x,x 2899 8b22 .skipelse0 2900 8b22 .L0235 ;; next 2901 8b22 2902 8b22 a5 42 LDA temp1 2903 8b24 c9 03 CMP #3 2904 8b26 e6 42 INC temp1 2905 8b28 if ((* - .L0233fortemp1) < 127) && ((* - .L0233fortemp1) > -128) 2906 8b28 90 d8 bcc .L0233fortemp1 2907 8b2a - else 2908 8b2a - bcs .1skipL0233fortemp1 2909 8b2a - jmp .L0233fortemp1 2910 8b2a -.1skipL0233fortemp1 2911 8b2a endif 2912 8b2a .L0236 ;; return 2913 8b2a 2914 8b2a ba tsx 2915 8b2b bd 02 01 lda $102,x 2916 8b2e f0 01 beq bankswitchret10 2917 8b30 60 RTS 2918 8b31 bankswitchret10 2919 8b31 4c a1 f4 JMP BS_return 2920 8b34 . 2921 8b34 ;; 2922 8b34 2923 8b34 .check_bullet_boundary 2924 8b34 ;; check_bullet_boundary 2925 8b34 2926 8b34 .L0237 ;; for temp1 = 0 to 3 2927 8b34 2928 8b34 a9 00 LDA #0 2929 8b36 85 42 STA temp1 2930 8b38 .L0237fortemp1 2931 8b38 .L0238 ;; temp_x = pBullet1_x[temp1] 2932 8b38 2933 8b38 a6 42 LDX temp1 2934 8b3a bd a0 22 LDA pBullet1_x,x 2935 8b3d 8d 70 01 STA temp_x 2936 8b40 .L0239 ;; temp_y = pBullet1_y[temp1] 2937 8b40 2938 8b40 a6 42 LDX temp1 2939 8b42 bd e0 22 LDA pBullet1_y,x 2940 8b45 8d 71 01 STA temp_y 2941 8b48 .L0240 ;; if temp_x < 1 || temp_x > 159 then pBullet1_y[temp1] = 200 2942 8b48 2943 8b48 ad 70 01 LDA temp_x 2944 8b4b c9 01 CMP #1 2945 8b4d b0 03 BCS .skipL0240 2946 8b4f .condpart79 2947 8b4f 4c 59 8b jmp .condpart80 2948 8b52 .skipL0240 2949 8b52 a9 9f LDA #159 2950 8b54 cd 70 01 CMP temp_x 2951 8b57 b0 07 BCS .skip25OR 2952 8b59 .condpart80 2953 8b59 a9 c8 LDA #200 2954 8b5b a6 42 LDX temp1 2955 8b5d 9d e0 22 STA pBullet1_y,x 2956 8b60 .skip25OR 2957 8b60 .L0241 ;; if temp_y < 1 || temp_y > 191 then pBullet1_y[temp1] = 200 2958 8b60 2959 8b60 ad 71 01 LDA temp_y 2960 8b63 c9 01 CMP #1 2961 8b65 b0 03 BCS .skipL0241 2962 8b67 .condpart81 2963 8b67 4c 71 8b jmp .condpart82 2964 8b6a .skipL0241 2965 8b6a a9 bf LDA #191 2966 8b6c cd 71 01 CMP temp_y 2967 8b6f b0 07 BCS .skip26OR 2968 8b71 .condpart82 2969 8b71 a9 c8 LDA #200 2970 8b73 a6 42 LDX temp1 2971 8b75 9d e0 22 STA pBullet1_y,x 2972 8b78 .skip26OR 2973 8b78 .L0242 ;; next 2974 8b78 2975 8b78 a5 42 LDA temp1 2976 8b7a c9 03 CMP #3 2977 8b7c e6 42 INC temp1 2978 8b7e if ((* - .L0237fortemp1) < 127) && ((* - .L0237fortemp1) > -128) 2979 8b7e 90 b8 bcc .L0237fortemp1 2980 8b80 - else 2981 8b80 - bcs .2skipL0237fortemp1 2982 8b80 - jmp .L0237fortemp1 2983 8b80 -.2skipL0237fortemp1 2984 8b80 endif 2985 8b80 .L0243 ;; return 2986 8b80 2987 8b80 ba tsx 2988 8b81 bd 02 01 lda $102,x 2989 8b84 f0 01 beq bankswitchret11 2990 8b86 60 RTS 2991 8b87 bankswitchret11 2992 8b87 4c a1 f4 JMP BS_return 2993 8b8a . 2994 8b8a ;; 2995 8b8a 2996 8b8a .draw_player_bullets 2997 8b8a ;; draw_player_bullets 2998 8b8a 2999 8b8a .L0244 ;; for temp_loop = 0 to 3 3000 8b8a 3001 8b8a a9 00 LDA #0 3002 8b8c 8d 6f 01 STA temp_loop 3003 8b8f .L0244fortemp_loop 3004 8b8f .L0245 ;; temp_x = pBullet1_x[temp_loop] 3005 8b8f 3006 8b8f ae 6f 01 LDX temp_loop 3007 8b92 bd a0 22 LDA pBullet1_x,x 3008 8b95 8d 70 01 STA temp_x 3009 8b98 .L0246 ;; temp_y = pBullet1_y[temp_loop] 3010 8b98 3011 8b98 ae 6f 01 LDX temp_loop 3012 8b9b bd e0 22 LDA pBullet1_y,x 3013 8b9e 8d 71 01 STA temp_y 3014 8ba1 .L0247 ;; if temp_x <> 200 then plotsprite vertical_shooting_bullet 0 temp_x temp_y 3015 8ba1 3016 8ba1 ad 70 01 LDA temp_x 3017 8ba4 c9 c8 CMP #200 3018 8ba6 f0 1d BEQ .skipL0247 3019 8ba8 .condpart83 3020 8ba8 a9 31 lda #vertical_shooting_bullet 3024 8bae 85 43 sta temp2 3025 8bb0 3026 8bb0 a9 1f lda #(0|vertical_shooting_bullet_width_twoscompliment) 3027 8bb2 85 44 sta temp3 3028 8bb4 3029 8bb4 ad 70 01 lda temp_x 3030 8bb7 85 45 sta temp4 3031 8bb9 3032 8bb9 ad 71 01 lda temp_y 3033 8bbc 3034 8bbc 85 46 sta temp5 3035 8bbe 3036 8bbe a9 40 lda #(vertical_shooting_bullet_mode|%01000000) 3037 8bc0 85 47 sta temp6 3038 8bc2 3039 8bc2 20 c2 f2 jsr plotsprite 3040 8bc5 .skipL0247 3041 8bc5 .L0248 ;; next 3042 8bc5 3043 8bc5 ad 6f 01 LDA temp_loop 3044 8bc8 c9 03 CMP #3 3045 8bca ee 6f 01 INC temp_loop 3046 8bcd if ((* - .L0244fortemp_loop) < 127) && ((* - .L0244fortemp_loop) > -128) 3047 8bcd 90 c0 bcc .L0244fortemp_loop 3048 8bcf - else 3049 8bcf - bcs .3skipL0244fortemp_loop 3050 8bcf - jmp .L0244fortemp_loop 3051 8bcf -.3skipL0244fortemp_loop 3052 8bcf endif 3053 8bcf .L0249 ;; return 3054 8bcf 3055 8bcf ba tsx 3056 8bd0 bd 02 01 lda $102,x 3057 8bd3 f0 01 beq bankswitchret12 3058 8bd5 60 RTS 3059 8bd6 bankswitchret12 3060 8bd6 4c a1 f4 JMP BS_return 3061 8bd9 . 3062 8bd9 ;; 3063 8bd9 3064 8bd9 . 3065 8bd9 ;; 3066 8bd9 3067 8bd9 .lose_a_life 3068 8bd9 ;; lose_a_life 3069 8bd9 3070 8bd9 .L0250 ;; lives = lives - 1 : isDead_flag = 0 3071 8bd9 3072 8bd9 ad 65 01 LDA lives 3073 8bdc 38 SEC 3074 8bdd e9 01 SBC #1 3075 8bdf 8d 65 01 STA lives 3076 8be2 a9 00 LDA #0 3077 8be4 8d 64 01 STA isDead_flag 3078 8be7 .L0251 ;; if player_flag = 1 && explosion_aniframe = 200 && lives > 0 then playerX = 80 : playerY = 144 : explosion_aniframe = 0 : goto main 3079 8be7 3080 8be7 ad 54 01 LDA player_flag 3081 8bea c9 01 CMP #1 3082 8bec d0 20 BNE .skipL0251 3083 8bee .condpart84 3084 8bee ad 6e 01 LDA explosion_aniframe 3085 8bf1 c9 c8 CMP #200 3086 8bf3 d0 19 BNE .skip84then 3087 8bf5 .condpart85 3088 8bf5 a9 00 LDA #0 3089 8bf7 cd 65 01 CMP lives 3090 8bfa b0 12 BCS .skip85then 3091 8bfc .condpart86 3092 8bfc a9 50 LDA #80 3093 8bfe 8d 41 01 STA playerX 3094 8c01 a9 90 LDA #144 3095 8c03 8d 42 01 STA playerY 3096 8c06 a9 00 LDA #0 3097 8c08 8d 6e 01 STA explosion_aniframe 3098 8c0b 4c 39 81 jmp .main 3099 8c0e 3100 8c0e .skip85then 3101 8c0e .skip84then 3102 8c0e .skipL0251 3103 8c0e .L0252 ;; joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 3104 8c0e 3105 8c0e a9 00 LDA #0 3106 8c10 8d 44 01 STA joyposup 3107 8c13 8d 45 01 STA joyposdown 3108 8c16 8d 46 01 STA joyposleft 3109 8c19 8d 47 01 STA joyposright 3110 8c1c . 3111 8c1c ;; 3112 8c1c 3113 8c1c . 3114 8c1c ;; 3115 8c1c 3116 8c1c .lose_a_lifeloop 3117 8c1c ;; lose_a_lifeloop 3118 8c1c 3119 8c1c .L0253 ;; restorescreen 3120 8c1c 3121 8c1c 20 91 f0 jsr restorescreen 3122 8c1f .L0254 ;; gosub _draw_score 3123 8c1f 3124 8c1f 20 1a 84 jsr ._draw_score 3125 8c22 3126 8c22 .L0255 ;; drawscreen 3127 8c22 3128 8c22 20 b3 f0 jsr drawscreen 3129 8c25 .L0256 ;; if joy0fire then fire_debounce = 2 3130 8c25 3131 8c25 2c 02 21 bit sINPT1 3132 8c28 10 05 BPL .skipL0256 3133 8c2a .condpart87 3134 8c2a a9 02 LDA #2 3135 8c2c 8d 43 01 STA fire_debounce 3136 8c2f .skipL0256 3137 8c2f .L0257 ;; if !joy0fire then fire_debounce = 1 3138 8c2f 3139 8c2f 2c 02 21 bit sINPT1 3140 8c32 30 05 BMI .skipL0257 3141 8c34 .condpart88 3142 8c34 a9 01 LDA #1 3143 8c36 8d 43 01 STA fire_debounce 3144 8c39 .skipL0257 3145 8c39 .L0258 ;; if fire_debounce = 1 && lives > 0 then clearscreen : goto main 3146 8c39 3147 8c39 ad 43 01 LDA fire_debounce 3148 8c3c c9 01 CMP #1 3149 8c3e d0 0d BNE .skipL0258 3150 8c40 .condpart89 3151 8c40 a9 00 LDA #0 3152 8c42 cd 65 01 CMP lives 3153 8c45 b0 06 BCS .skip89then 3154 8c47 .condpart90 3155 8c47 20 7f f0 jsr clearscreen 3156 8c4a 4c 39 81 jmp .main 3157 8c4d 3158 8c4d .skip89then 3159 8c4d .skipL0258 3160 8c4d .L0259 ;; if fire_debounce = 1 && lives < 1 then clearscreen : goto gameover 3161 8c4d 3162 8c4d ad 43 01 LDA fire_debounce 3163 8c50 c9 01 CMP #1 3164 8c52 d0 0d BNE .skipL0259 3165 8c54 .condpart91 3166 8c54 ad 65 01 LDA lives 3167 8c57 c9 01 CMP #1 3168 8c59 b0 06 BCS .skip91then 3169 8c5b .condpart92 3170 8c5b 20 7f f0 jsr clearscreen 3171 8c5e 4c 64 8c jmp .gameover 3172 8c61 3173 8c61 .skip91then 3174 8c61 .skipL0259 3175 8c61 .L0260 ;; goto lose_a_lifeloop 3176 8c61 3177 8c61 4c 1c 8c jmp .lose_a_lifeloop 3178 8c64 3179 8c64 . 3180 8c64 ;; 3181 8c64 3182 8c64 .gameover 3183 8c64 ;; gameover 3184 8c64 3185 8c64 .L0261 ;; gameover_flag = 0 3186 8c64 3187 8c64 a9 00 LDA #0 3188 8c66 8d 63 01 STA gameover_flag 3189 8c69 .L0262 ;; fire_debounce = 1 3190 8c69 3191 8c69 a9 01 LDA #1 3192 8c6b 8d 43 01 STA fire_debounce 3193 8c6e . 3194 8c6e ;; 3195 8c6e 3196 8c6e .gameover_loop 3197 8c6e ;; gameover_loop 3198 8c6e 3199 8c6e .L0263 ;; if lives = 0 then gameover_flag = 1 : clearscreen 3200 8c6e 3201 8c6e ad 65 01 LDA lives 3202 8c71 c9 00 CMP #0 3203 8c73 d0 08 BNE .skipL0263 3204 8c75 .condpart93 3205 8c75 a9 01 LDA #1 3206 8c77 8d 63 01 STA gameover_flag 3207 8c7a 20 7f f0 jsr clearscreen 3208 8c7d .skipL0263 3209 8c7d .L0264 ;; plotchars 'game^over!' 0 40 16 3210 8c7d 3211 8c7d 4c 8a 8c JMP skipalphadata12 3212 8c80 alphadata12 3213 8c80 11 .byte.b (alphadata12 3228 8c90 85 43 sta temp2 3229 8c92 3230 8c92 a9 16 lda #22 ; width in two's complement 3231 8c94 09 00 ora #0 ; palette left shifted 5 bits 3232 8c96 85 44 sta temp3 3233 8c98 a9 28 lda #40 3234 8c9a 85 45 sta temp4 3235 8c9c 3236 8c9c a9 10 lda #16 3237 8c9e 3238 8c9e 85 46 sta temp5 3239 8ca0 3240 8ca0 20 7b f3 jsr plotcharacters 3241 8ca3 .L0265 ;; if joy0fire && !fire_debounce then clearscreen : goto plot 3242 8ca3 3243 8ca3 2c 02 21 bit sINPT1 3244 8ca6 10 0b BPL .skipL0265 3245 8ca8 .condpart94 3246 8ca8 ad 43 01 LDA fire_debounce 3247 8cab d0 06 BNE .skip94then 3248 8cad .condpart95 3249 8cad 20 7f f0 jsr clearscreen 3250 8cb0 4c 48 80 jmp .plot 3251 8cb3 3252 8cb3 .skip94then 3253 8cb3 .skipL0265 3254 8cb3 .L0266 ;; if !joy0fire then fire_debounce = 0 3255 8cb3 3256 8cb3 2c 02 21 bit sINPT1 3257 8cb6 30 05 BMI .skipL0266 3258 8cb8 .condpart96 3259 8cb8 a9 00 LDA #0 3260 8cba 8d 43 01 STA fire_debounce 3261 8cbd .skipL0266 3262 8cbd .L0267 ;; goto gameover_loop 3263 8cbd 3264 8cbd 4c 6e 8c jmp .gameover_loop 3265 8cc0 3266 8cc0 . 3267 8cc0 ;; 3268 8cc0 3269 8cc0 .titlescreen 3270 8cc0 ;; titlescreen 3271 8cc0 3272 8cc0 .L0268 ;; plotchars 'new^vertical^shooting' 1 38 4 3273 8cc0 3274 8cc0 4c d8 8c JMP skipalphadata13 3275 8cc3 alphadata13 3276 8cc3 18 .byte.b (alphadata13 3302 8cde 85 43 sta temp2 3303 8ce0 3304 8ce0 a9 0b lda #11 ; width in two's complement 3305 8ce2 09 20 ora #32 ; palette left shifted 5 bits 3306 8ce4 85 44 sta temp3 3307 8ce6 a9 26 lda #38 3308 8ce8 85 45 sta temp4 3309 8cea 3310 8cea a9 04 lda #4 3311 8cec 3312 8cec 85 46 sta temp5 3313 8cee 3314 8cee 20 7b f3 jsr plotcharacters 3315 8cf1 .L0269 ;; plotchars 'demo' 1 72 5 3316 8cf1 3317 8cf1 4c f8 8c JMP skipalphadata14 3318 8cf4 alphadata14 3319 8cf4 0e .byte.b (alphadata14 3328 8cfe 85 43 sta temp2 3329 8d00 3330 8d00 a9 1c lda #28 ; width in two's complement 3331 8d02 09 20 ora #32 ; palette left shifted 5 bits 3332 8d04 85 44 sta temp3 3333 8d06 a9 48 lda #72 3334 8d08 85 45 sta temp4 3335 8d0a 3336 8d0a a9 05 lda #5 3337 8d0c 3338 8d0c 85 46 sta temp5 3339 8d0e 3340 8d0e 20 7b f3 jsr plotcharacters 3341 8d11 .L0270 ;; plotchars 'by^shane^skekel.' 1 48 7 3342 8d11 3343 8d11 4c 24 8d JMP skipalphadata15 3344 8d14 alphadata15 3345 8d14 0c .byte.b (alphadata15 3366 8d2a 85 43 sta temp2 3367 8d2c 3368 8d2c a9 10 lda #16 ; width in two's complement 3369 8d2e 09 20 ora #32 ; palette left shifted 5 bits 3370 8d30 85 44 sta temp3 3371 8d32 a9 30 lda #48 3372 8d34 85 45 sta temp4 3373 8d36 3374 8d36 a9 07 lda #7 3375 8d38 3376 8d38 85 46 sta temp5 3377 8d3a 3378 8d3a 20 7b f3 jsr plotcharacters 3379 8d3d .L0271 ;; plotchars 'push^fire^to^begin.' 2 42 16 3380 8d3d 3381 8d3d 4c 53 8d JMP skipalphadata16 3382 8d40 alphadata16 3383 8d40 1a .byte.b (alphadata16 3407 8d59 85 43 sta temp2 3408 8d5b 3409 8d5b a9 0d lda #13 ; width in two's complement 3410 8d5d 09 40 ora #64 ; palette left shifted 5 bits 3411 8d5f 85 44 sta temp3 3412 8d61 a9 2a lda #42 3413 8d63 85 45 sta temp4 3414 8d65 3415 8d65 a9 10 lda #16 3416 8d67 3417 8d67 85 46 sta temp5 3418 8d69 3419 8d69 20 7b f3 jsr plotcharacters 3420 8d6c .L0272 ;; savescreen 3421 8d6c 3422 8d6c 20 a3 f0 jsr savescreen 3423 8d6f .L0273 ;; drawscreen 3424 8d6f 3425 8d6f 20 b3 f0 jsr drawscreen 3426 8d72 .L0274 ;; fire_debounce = 1 3427 8d72 3428 8d72 a9 01 LDA #1 3429 8d74 8d 43 01 STA fire_debounce 3430 8d77 . 3431 8d77 ;; 3432 8d77 3433 8d77 .titlescreenloop 3434 8d77 ;; titlescreenloop 3435 8d77 3436 8d77 .L0275 ;; restorescreen 3437 8d77 3438 8d77 20 91 f0 jsr restorescreen 3439 8d7a .L0276 ;; if switchreset then reboot 3440 8d7a 3441 8d7a 20 b4 f4 jsr checkresetswitch 3442 8d7d d0 03 BNE .skipL0276 3443 8d7f .condpart97 3444 8d7f 4c a1 f5 JMP START 3445 8d82 .skipL0276 3446 8d82 .L0277 ;; if joy0fire then clearscreen : savescreen : lives = $04 : score0 = 0 : playsfx sfx_bling : goto main 3447 8d82 3448 8d82 2c 02 21 bit sINPT1 3449 8d85 10 36 BPL .skipL0277 3450 8d87 .condpart98 3451 8d87 20 7f f0 jsr clearscreen 3452 8d8a 20 a3 f0 jsr savescreen 3453 8d8d a9 04 LDA #$04 3454 8d8f 8d 65 01 STA lives 3455 8d92 a9 00 LDA #$00 3456 8d94 8d a8 01 STA score0+2 3457 8d97 a9 00 LDA #$00 3458 8d99 8d a7 01 STA score0+1 3459 8d9c a9 00 LDA #$00 3460 8d9e 8d a6 01 STA score0 3461 8da1 ifnconst NOTIALOCKMUTE 3462 8da1 a9 01 lda #1 3463 8da3 85 de sta sfxschedulelock 3464 8da5 a9 9a lda #sfx_bling 3467 8dab 85 e1 sta sfxinstrumenthi 3468 8dad a9 00 lda #0 3469 8daf 85 e2 sta sfxpitchoffset ; no pitch modification 3470 8db1 85 e3 sta sfxnoteindex ; not a musical note 3471 8db3 20 7a f2 jsr schedulesfx 3472 8db6 a9 00 lda #0 3473 8db8 85 de sta sfxschedulelock 3474 8dba endif ; NOTIALOCKMUTE 3475 8dba 4c 39 81 jmp .main 3476 8dbd 3477 8dbd .skipL0277 3478 8dbd .L0278 ;; if !joy0fire then fire_debounce = 0 3479 8dbd 3480 8dbd 2c 02 21 bit sINPT1 3481 8dc0 30 05 BMI .skipL0278 3482 8dc2 .condpart99 3483 8dc2 a9 00 LDA #0 3484 8dc4 8d 43 01 STA fire_debounce 3485 8dc7 .skipL0278 3486 8dc7 .L0279 ;; drawscreen 3487 8dc7 3488 8dc7 20 b3 f0 jsr drawscreen 3489 8dca .L0280 ;; goto titlescreenloop 3490 8dca 3491 8dca 4c 77 8d jmp .titlescreenloop 3492 8dcd 3493 8dcd . 3494 8dcd ;; 3495 8dcd 3496 8dcd . 3497 8dcd ;; 3498 8dcd 3499 8dcd .initialise_gamescreen 3500 8dcd ;; initialise_gamescreen 3501 8dcd 3502 8dcd .L0281 ;; clearscreen 3503 8dcd 3504 8dcd 20 7f f0 jsr clearscreen 3505 8dd0 .L0282 ;; BACKGRND = $00 3506 8dd0 3507 8dd0 a9 00 LDA #$00 3508 8dd2 85 20 STA BACKGRND 3509 8dd4 . 3510 8dd4 ;; 3511 8dd4 3512 8dd4 .L0283 ;; savescreen 3513 8dd4 3514 8dd4 20 a3 f0 jsr savescreen 3515 8dd7 .L0284 ;; return 3516 8dd7 3517 8dd7 ba tsx 3518 8dd8 bd 02 01 lda $102,x 3519 8ddb f0 01 beq bankswitchret18 3520 8ddd 60 RTS 3521 8dde bankswitchret18 3522 8dde 4c a1 f4 JMP BS_return 3523 8de1 . 3524 8de1 ;; 3525 8de1 3526 8de1 .power_up_obtained 3527 8de1 ;; power_up_obtained 3528 8de1 3529 8de1 .L0285 ;; if power_up_Flag = 1 then twinlaser_flag = 1 3530 8de1 3531 8de1 ad 6a 01 LDA power_up_Flag 3532 8de4 c9 01 CMP #1 3533 8de6 d0 05 BNE .skipL0285 3534 8de8 .condpart100 3535 8de8 a9 01 LDA #1 3536 8dea 8d 8a 01 STA twinlaser_flag 3537 8ded .skipL0285 3538 8ded .L0286 ;; return 3539 8ded 3540 8ded ba tsx 3541 8dee bd 02 01 lda $102,x 3542 8df1 f0 01 beq bankswitchret19 3543 8df3 60 RTS 3544 8df4 bankswitchret19 3545 8df4 4c a1 f4 JMP BS_return 3546 8df7 . 3547 8df7 ;; 3548 8df7 3549 8df7 .draw_sprites 3550 8df7 ;; draw_sprites 3551 8df7 3552 8df7 .L0287 ;; plotsprite vertical_shooting_ship 0 playerX playerY 3553 8df7 3554 8df7 a9 2d lda #vertical_shooting_ship 3558 8dfd 85 43 sta temp2 3559 8dff 3560 8dff a9 1e lda #(0|vertical_shooting_ship_width_twoscompliment) 3561 8e01 85 44 sta temp3 3562 8e03 3563 8e03 ad 41 01 lda playerX 3564 8e06 85 45 sta temp4 3565 8e08 3566 8e08 ad 42 01 lda playerY 3567 8e0b 3568 8e0b 85 46 sta temp5 3569 8e0d 3570 8e0d a9 40 lda #(vertical_shooting_ship_mode|%01000000) 3571 8e0f 85 47 sta temp6 3572 8e11 3573 8e11 20 c2 f2 jsr plotsprite 3574 8e14 ; +tall sprite replot 3575 8e14 18 clc 3576 8e15 a5 42 lda temp1 3577 8e17 69 02 adc #vertical_shooting_ship_width 3578 8e19 85 42 sta temp1 3579 8e1b a5 46 lda temp5 3580 8e1d 69 08 adc #WZONEHEIGHT 3581 8e1f 85 46 sta temp5 3582 8e21 20 c2 f2 jsr plotsprite 3583 8e24 . 3584 8e24 ;; 3585 8e24 3586 8e24 . 3587 8e24 ;; 3588 8e24 3589 8e24 .L0288 ;; plotsprite vertical_shooting_powerup 3 power_upX power_upY 3590 8e24 3591 8e24 a9 33 lda #vertical_shooting_powerup 3595 8e2a 85 43 sta temp2 3596 8e2c 3597 8e2c a9 7e lda #(96|vertical_shooting_powerup_width_twoscompliment) 3598 8e2e 85 44 sta temp3 3599 8e30 3600 8e30 ad 68 01 lda power_upX 3601 8e33 85 45 sta temp4 3602 8e35 3603 8e35 ad 69 01 lda power_upY 3604 8e38 3605 8e38 85 46 sta temp5 3606 8e3a 3607 8e3a a9 40 lda #(vertical_shooting_powerup_mode|%01000000) 3608 8e3c 85 47 sta temp6 3609 8e3e 3610 8e3e 20 c2 f2 jsr plotsprite 3611 8e41 .L0289 ;; plotsprite vertical_shooting_enemy01 2 enemy01_xpos enemy01_ypos 3612 8e41 3613 8e41 a9 35 lda #vertical_shooting_enemy01 3617 8e47 85 43 sta temp2 3618 8e49 3619 8e49 a9 5e lda #(64|vertical_shooting_enemy01_width_twoscompliment) 3620 8e4b 85 44 sta temp3 3621 8e4d 3622 8e4d ad 49 01 lda enemy01_xpos 3623 8e50 85 45 sta temp4 3624 8e52 3625 8e52 ad 53 01 lda enemy01_ypos 3626 8e55 3627 8e55 85 46 sta temp5 3628 8e57 3629 8e57 a9 40 lda #(vertical_shooting_enemy01_mode|%01000000) 3630 8e59 85 47 sta temp6 3631 8e5b 3632 8e5b 20 c2 f2 jsr plotsprite 3633 8e5e ; +tall sprite replot 3634 8e5e 18 clc 3635 8e5f a5 42 lda temp1 3636 8e61 69 02 adc #vertical_shooting_enemy01_width 3637 8e63 85 42 sta temp1 3638 8e65 a5 46 lda temp5 3639 8e67 69 08 adc #WZONEHEIGHT 3640 8e69 85 46 sta temp5 3641 8e6b 20 c2 f2 jsr plotsprite 3642 8e6e .L0290 ;; plotsprite vertical_shooting_1up 0 extra_shipX extra_shipY 3643 8e6e 3644 8e6e a9 39 lda #vertical_shooting_1up 3648 8e74 85 43 sta temp2 3649 8e76 3650 8e76 a9 1e lda #(0|vertical_shooting_1up_width_twoscompliment) 3651 8e78 85 44 sta temp3 3652 8e7a 3653 8e7a ad 6b 01 lda extra_shipX 3654 8e7d 85 45 sta temp4 3655 8e7f 3656 8e7f ad 6c 01 lda extra_shipY 3657 8e82 3658 8e82 85 46 sta temp5 3659 8e84 3660 8e84 a9 40 lda #(vertical_shooting_1up_mode|%01000000) 3661 8e86 85 47 sta temp6 3662 8e88 3663 8e88 20 c2 f2 jsr plotsprite 3664 8e8b .L0291 ;; plotsprite vertical_shooting_demo_explosion_upd0 3 playerX playerY explosion_aniframe 3665 8e8b 3666 8e8b a9 3b lda #vertical_shooting_demo_explosion_upd0 3678 8e9c 85 43 sta temp2 3679 8e9e 3680 8e9e a9 7e lda #(96|vertical_shooting_demo_explosion_upd0_width_twoscompliment) 3681 8ea0 85 44 sta temp3 3682 8ea2 3683 8ea2 ad 41 01 lda playerX 3684 8ea5 85 45 sta temp4 3685 8ea7 3686 8ea7 ad 42 01 lda playerY 3687 8eaa 85 46 sta temp5 3688 8eac 3689 8eac a9 40 lda #(vertical_shooting_demo_explosion_upd0_mode|%01000000) 3690 8eae 85 47 sta temp6 3691 8eb0 3692 8eb0 20 c2 f2 jsr plotsprite 3693 8eb3 ; +tall sprite replot 3694 8eb3 18 clc 3695 8eb4 a5 42 lda temp1 3696 8eb6 69 02 adc #vertical_shooting_demo_explosion_upd0_width 3697 8eb8 85 42 sta temp1 3698 8eba a5 46 lda temp5 3699 8ebc 69 08 adc #WZONEHEIGHT 3700 8ebe 85 46 sta temp5 3701 8ec0 20 c2 f2 jsr plotsprite 3702 8ec3 .L0292 ;; plotsprite vertical_shooting_demo_explosion_upd0 3 enemy01_xpos enemy01_ypos explosion_aniframe 3703 8ec3 3704 8ec3 a9 3b lda #vertical_shooting_demo_explosion_upd0 3716 8ed4 85 43 sta temp2 3717 8ed6 3718 8ed6 a9 7e lda #(96|vertical_shooting_demo_explosion_upd0_width_twoscompliment) 3719 8ed8 85 44 sta temp3 3720 8eda 3721 8eda ad 49 01 lda enemy01_xpos 3722 8edd 85 45 sta temp4 3723 8edf 3724 8edf ad 53 01 lda enemy01_ypos 3725 8ee2 85 46 sta temp5 3726 8ee4 3727 8ee4 a9 40 lda #(vertical_shooting_demo_explosion_upd0_mode|%01000000) 3728 8ee6 85 47 sta temp6 3729 8ee8 3730 8ee8 20 c2 f2 jsr plotsprite 3731 8eeb ; +tall sprite replot 3732 8eeb 18 clc 3733 8eec a5 42 lda temp1 3734 8eee 69 02 adc #vertical_shooting_demo_explosion_upd0_width 3735 8ef0 85 42 sta temp1 3736 8ef2 a5 46 lda temp5 3737 8ef4 69 08 adc #WZONEHEIGHT 3738 8ef6 85 46 sta temp5 3739 8ef8 20 c2 f2 jsr plotsprite 3740 8efb .L0293 ;; plotsprite vertical_shooting_laser 0 p_twinlaser1_x p_twinlaser1_y 3741 8efb 3742 8efb a9 67 lda #vertical_shooting_laser 3746 8f01 85 43 sta temp2 3747 8f03 3748 8f03 a9 1f lda #(0|vertical_shooting_laser_width_twoscompliment) 3749 8f05 85 44 sta temp3 3750 8f07 3751 8f07 ad 76 01 lda p_twinlaser1_x 3752 8f0a 85 45 sta temp4 3753 8f0c 3754 8f0c ad 7a 01 lda p_twinlaser1_y 3755 8f0f 3756 8f0f 85 46 sta temp5 3757 8f11 3758 8f11 a9 40 lda #(vertical_shooting_laser_mode|%01000000) 3759 8f13 85 47 sta temp6 3760 8f15 3761 8f15 20 c2 f2 jsr plotsprite 3762 8f18 ; +tall sprite replot 3763 8f18 18 clc 3764 8f19 a5 42 lda temp1 3765 8f1b 69 01 adc #vertical_shooting_laser_width 3766 8f1d 85 42 sta temp1 3767 8f1f a5 46 lda temp5 3768 8f21 69 08 adc #WZONEHEIGHT 3769 8f23 85 46 sta temp5 3770 8f25 20 c2 f2 jsr plotsprite 3771 8f28 .L0294 ;; if player_flag = 1 then plotsprite vertical_shooting_demo_explosion_upd0 3 playerX playerY explosion_aniframe 3772 8f28 3773 8f28 ad 54 01 LDA player_flag 3774 8f2b c9 01 CMP #1 3775 8f2d d0 38 BNE .skipL0294 3776 8f2f .condpart101 3777 8f2f a9 3b lda #vertical_shooting_demo_explosion_upd0 3789 8f40 85 43 sta temp2 3790 8f42 3791 8f42 a9 7e lda #(96|vertical_shooting_demo_explosion_upd0_width_twoscompliment) 3792 8f44 85 44 sta temp3 3793 8f46 3794 8f46 ad 41 01 lda playerX 3795 8f49 85 45 sta temp4 3796 8f4b 3797 8f4b ad 42 01 lda playerY 3798 8f4e 85 46 sta temp5 3799 8f50 3800 8f50 a9 40 lda #(vertical_shooting_demo_explosion_upd0_mode|%01000000) 3801 8f52 85 47 sta temp6 3802 8f54 3803 8f54 20 c2 f2 jsr plotsprite 3804 8f57 ; +tall sprite replot 3805 8f57 18 clc 3806 8f58 a5 42 lda temp1 3807 8f5a 69 02 adc #vertical_shooting_demo_explosion_upd0_width 3808 8f5c 85 42 sta temp1 3809 8f5e a5 46 lda temp5 3810 8f60 69 08 adc #WZONEHEIGHT 3811 8f62 85 46 sta temp5 3812 8f64 20 c2 f2 jsr plotsprite 3813 8f67 .skipL0294 3814 8f67 .L0295 ;; if enemy01_Flag = 1 then plotsprite vertical_shooting_demo_explosion_upd0 3 enemy01_xpos enemy01_ypos explosion_aniframe 3815 8f67 3816 8f67 ad 55 01 LDA enemy01_Flag 3817 8f6a c9 01 CMP #1 3818 8f6c d0 38 BNE .skipL0295 3819 8f6e .condpart102 3820 8f6e a9 3b lda #vertical_shooting_demo_explosion_upd0 3832 8f7f 85 43 sta temp2 3833 8f81 3834 8f81 a9 7e lda #(96|vertical_shooting_demo_explosion_upd0_width_twoscompliment) 3835 8f83 85 44 sta temp3 3836 8f85 3837 8f85 ad 49 01 lda enemy01_xpos 3838 8f88 85 45 sta temp4 3839 8f8a 3840 8f8a ad 53 01 lda enemy01_ypos 3841 8f8d 85 46 sta temp5 3842 8f8f 3843 8f8f a9 40 lda #(vertical_shooting_demo_explosion_upd0_mode|%01000000) 3844 8f91 85 47 sta temp6 3845 8f93 3846 8f93 20 c2 f2 jsr plotsprite 3847 8f96 ; +tall sprite replot 3848 8f96 18 clc 3849 8f97 a5 42 lda temp1 3850 8f99 69 02 adc #vertical_shooting_demo_explosion_upd0_width 3851 8f9b 85 42 sta temp1 3852 8f9d a5 46 lda temp5 3853 8f9f 69 08 adc #WZONEHEIGHT 3854 8fa1 85 46 sta temp5 3855 8fa3 20 c2 f2 jsr plotsprite 3856 8fa6 .skipL0295 3857 8fa6 .L0296 ;; return 3858 8fa6 3859 8fa6 ba tsx 3860 8fa7 bd 02 01 lda $102,x 3861 8faa f0 01 beq bankswitchret24 3862 8fac 60 RTS 3863 8fad bankswitchret24 3864 8fad 4c a1 f4 JMP BS_return 3865 8fb0 . 3866 8fb0 ;; 3867 8fb0 3868 8fb0 .shoot_enemy_bullet 3869 8fb0 ;; shoot_enemy_bullet 3870 8fb0 3871 8fb0 . 3872 8fb0 ;; 3873 8fb0 3874 8fb0 .L0297 ;; z = 15 3875 8fb0 3876 8fb0 a9 0f LDA #15 3877 8fb2 85 ff STA z 3878 8fb4 .check_enemyshot 3879 8fb4 ;; check_enemyshot 3880 8fb4 3881 8fb4 . 3882 8fb4 ;; 3883 8fb4 3884 8fb4 . 3885 8fb4 ;; 3886 8fb4 3887 8fb4 . 3888 8fb4 ;; 3889 8fb4 3890 8fb4 . 3891 8fb4 ;; 3892 8fb4 3893 8fb4 . 3894 8fb4 ;; 3895 8fb4 3896 8fb4 .L0298 ;; if enemy_shotFlag = TRUE then goto skip_enemy_shot 3897 8fb4 3898 8fb4 ad 9c 01 LDA enemy_shotFlag 3899 8fb7 c9 01 CMP #TRUE 3900 8fb9 d0 03 BNE .skipL0298 3901 8fbb .condpart103 3902 8fbb 4c 0b 91 jmp .skip_enemy_shot 3903 8fbe 3904 8fbe .skipL0298 3905 8fbe .L0299 ;; enemy_shotFlag = TRUE 3906 8fbe 3907 8fbe a9 01 LDA #TRUE 3908 8fc0 8d 9c 01 STA enemy_shotFlag 3909 8fc3 .L0300 ;; enemy_shot_xpos = enemy01_xpos + 2 3910 8fc3 3911 8fc3 ad 49 01 LDA enemy01_xpos 3912 8fc6 18 CLC 3913 8fc7 69 02 ADC #2 3914 8fc9 8d 00 22 STA enemy_shot_xpos 3915 8fcc .L0301 ;; enemy_shot_ypos = enemy01_ypos + 4 3916 8fcc 3917 8fcc ad 53 01 LDA enemy01_ypos 3918 8fcf 18 CLC 3919 8fd0 69 04 ADC #4 3920 8fd2 8d 20 22 STA enemy_shot_ypos 3921 8fd5 . 3922 8fd5 ;; 3923 8fd5 3924 8fd5 .L0302 ;; Temp_XSu = 0 3925 8fd5 3926 8fd5 a9 00 LDA #0 3927 8fd7 8d 8f 01 STA Temp_XSu 3928 8fda .L0303 ;; Temp_YSu = 0 3929 8fda 3930 8fda a9 00 LDA #0 3931 8fdc 8d 91 01 STA Temp_YSu 3932 8fdf . 3933 8fdf ;; 3934 8fdf 3935 8fdf . 3936 8fdf ;; 3937 8fdf 3938 8fdf . 3939 8fdf ;; 3940 8fdf 3941 8fdf . 3942 8fdf ;; 3943 8fdf 3944 8fdf . 3945 8fdf ;; 3946 8fdf 3947 8fdf .L0304 ;; if playerX = enemy_shot_xpos then Temp_XSf = 0 3948 8fdf 3949 8fdf ad 41 01 LDA playerX 3950 8fe2 cd 00 22 CMP enemy_shot_xpos 3951 8fe5 d0 05 BNE .skipL0304 3952 8fe7 .condpart104 3953 8fe7 a9 00 LDA #0 3954 8fe9 8d 90 01 STA Temp_XSf 3955 8fec .skipL0304 3956 8fec .L0305 ;; if playerX > enemy_shot_xpos then Temp_XSf = playerX - enemy_shot_xpos 3957 8fec 3958 8fec ad 00 22 LDA enemy_shot_xpos 3959 8fef cd 41 01 CMP playerX 3960 8ff2 b0 0a BCS .skipL0305 3961 8ff4 .condpart105 3962 8ff4 ad 41 01 LDA playerX 3963 8ff7 38 SEC 3964 8ff8 ed 00 22 SBC enemy_shot_xpos 3965 8ffb 8d 90 01 STA Temp_XSf 3966 8ffe .skipL0305 3967 8ffe .L0306 ;; if playerX < enemy_shot_xpos then Temp_XSf = enemy_shot_xpos - playerX 3968 8ffe 3969 8ffe ad 41 01 LDA playerX 3970 9001 cd 00 22 CMP enemy_shot_xpos 3971 9004 b0 0a BCS .skipL0306 3972 9006 .condpart106 3973 9006 ad 00 22 LDA enemy_shot_xpos 3974 9009 38 SEC 3975 900a ed 41 01 SBC playerX 3976 900d 8d 90 01 STA Temp_XSf 3977 9010 .skipL0306 3978 9010 . 3979 9010 ;; 3980 9010 3981 9010 . 3982 9010 ;; 3983 9010 3984 9010 . 3985 9010 ;; 3986 9010 3987 9010 . 3988 9010 ;; 3989 9010 3990 9010 . 3991 9010 ;; 3992 9010 3993 9010 .L0307 ;; if playerY = enemy_shot_ypos then Temp_YSf = 0 3994 9010 3995 9010 ad 42 01 LDA playerY 3996 9013 cd 20 22 CMP enemy_shot_ypos 3997 9016 d0 05 BNE .skipL0307 3998 9018 .condpart107 3999 9018 a9 00 LDA #0 4000 901a 8d 92 01 STA Temp_YSf 4001 901d .skipL0307 4002 901d .L0308 ;; if playerY > enemy_shot_ypos then Temp_YSf = playerY - enemy_shot_ypos 4003 901d 4004 901d ad 20 22 LDA enemy_shot_ypos 4005 9020 cd 42 01 CMP playerY 4006 9023 b0 0a BCS .skipL0308 4007 9025 .condpart108 4008 9025 ad 42 01 LDA playerY 4009 9028 38 SEC 4010 9029 ed 20 22 SBC enemy_shot_ypos 4011 902c 8d 92 01 STA Temp_YSf 4012 902f .skipL0308 4013 902f .L0309 ;; if playerY < enemy_shot_ypos then Temp_YSf = enemy_shot_ypos - playerY 4014 902f 4015 902f ad 42 01 LDA playerY 4016 9032 cd 20 22 CMP enemy_shot_ypos 4017 9035 b0 0a BCS .skipL0309 4018 9037 .condpart109 4019 9037 ad 20 22 LDA enemy_shot_ypos 4020 903a 38 SEC 4021 903b ed 42 01 SBC playerY 4022 903e 8d 92 01 STA Temp_YSf 4023 9041 .skipL0309 4024 9041 . 4025 9041 ;; 4026 9041 4027 9041 . 4028 9041 ;; 4029 9041 4030 9041 . 4031 9041 ;; 4032 9041 4033 9041 . 4034 9041 ;; 4035 9041 4036 9041 . 4037 9041 ;; 4038 9041 4039 9041 . 4040 9041 ;; 4041 9041 4042 9041 . 4043 9041 ;; 4044 9041 4045 9041 .L0310 ;; if Temp_YSf = 0 && Temp_XSf = 0 then enemy_shotFlag = FALSE : return 4046 9041 4047 9041 ad 92 01 LDA Temp_YSf 4048 9044 c9 00 CMP #0 4049 9046 d0 16 BNE .skipL0310 4050 9048 .condpart110 4051 9048 ad 90 01 LDA Temp_XSf 4052 904b c9 00 CMP #0 4053 904d d0 0f BNE .skip110then 4054 904f .condpart111 4055 904f a9 00 LDA #FALSE 4056 9051 8d 9c 01 STA enemy_shotFlag 4057 9054 ba tsx 4058 9055 bd 02 01 lda $102,x 4059 9058 f0 01 beq bankswitchret25 4060 905a 60 RTS 4061 905b bankswitchret25 4062 905b 4c a1 f4 JMP BS_return 4063 905e .skip110then 4064 905e .skipL0310 4065 905e . 4066 905e ;; 4067 905e 4068 905e . 4069 905e ;; 4070 905e 4071 905e . 4072 905e ;; 4073 905e 4074 905e . 4075 905e ;; 4076 905e 4077 905e .L0311 ;; if playerX <= enemy_shot_xpos then enemy_shot_direction = enemy_shot_direction | %00000010 else enemy_shot_direction = enemy_shot_direction & %11111101 4078 905e 4079 905e ad 00 22 LDA enemy_shot_xpos 4080 9061 cd 41 01 CMP playerX 4081 9064 90 0b BCC .skipL0311 4082 9066 .condpart112 4083 9066 ad 90 22 LDA enemy_shot_direction 4084 9069 09 02 ORA #%00000010 4085 906b 8d 90 22 STA enemy_shot_direction 4086 906e 4c 79 90 jmp .skipelse1 4087 9071 .skipL0311 4088 9071 ad 90 22 LDA enemy_shot_direction 4089 9074 29 fd AND #%11111101 4090 9076 8d 90 22 STA enemy_shot_direction 4091 9079 .skipelse1 4092 9079 .L0312 ;; if playerY <= enemy_shot_ypos then enemy_shot_direction = enemy_shot_direction | %00000001 else enemy_shot_direction = enemy_shot_direction & %11111110 4093 9079 4094 9079 ad 20 22 LDA enemy_shot_ypos 4095 907c cd 42 01 CMP playerY 4096 907f 90 0b BCC .skipL0312 4097 9081 .condpart113 4098 9081 ad 90 22 LDA enemy_shot_direction 4099 9084 09 01 ORA #%00000001 4100 9086 8d 90 22 STA enemy_shot_direction 4101 9089 4c 94 90 jmp .skipelse2 4102 908c .skipL0312 4103 908c ad 90 22 LDA enemy_shot_direction 4104 908f 29 fe AND #%11111110 4105 9091 8d 90 22 STA enemy_shot_direction 4106 9094 .skipelse2 4107 9094 . 4108 9094 ;; 4109 9094 4110 9094 .L0313 ;; Temp_XSu = 0 4111 9094 4112 9094 a9 00 LDA #0 4113 9096 8d 8f 01 STA Temp_XSu 4114 9099 .L0314 ;; Temp_YSu = 0 4115 9099 4116 9099 a9 00 LDA #0 4117 909b 8d 91 01 STA Temp_YSu 4118 909e . 4119 909e ;; 4120 909e 4121 909e .L0315 ;; Total_XSu = 0 4122 909e 4123 909e a9 00 LDA #0 4124 90a0 8d 8b 01 STA Total_XSu 4125 90a3 .L0316 ;; Total_XSf = 0 4126 90a3 4127 90a3 a9 00 LDA #0 4128 90a5 8d 8c 01 STA Total_XSf 4129 90a8 .L0317 ;; Total_YSu = 0 4130 90a8 4131 90a8 a9 00 LDA #0 4132 90aa 8d 8d 01 STA Total_YSu 4133 90ad .L0318 ;; Total_YSf = 0 4134 90ad 4135 90ad a9 00 LDA #0 4136 90af 8d 8e 01 STA Total_YSf 4137 90b2 . 4138 90b2 ;; 4139 90b2 4140 90b2 .es_SpeedIncrease 4141 90b2 ;; es_SpeedIncrease 4142 90b2 4143 90b2 .L0319 ;; Total_speedX = Total_speedX + Temp_X_speed 4144 90b2 4145 90b2 ad 8c 01 LDA Total_XSf 4146 90b5 18 CLC 4147 90b6 6d 90 01 ADC Temp_XSf 4148 90b9 8d 8c 01 STA Total_XSf 4149 90bc ad 8b 01 LDA Total_speedX 4150 90bf 6d 8f 01 ADC Temp_X_speed 4151 90c2 8d 8b 01 STA Total_speedX 4152 90c5 .L0320 ;; Total_speedY = Total_speedY + Temp_Y_speed 4153 90c5 4154 90c5 ad 8e 01 LDA Total_YSf 4155 90c8 18 CLC 4156 90c9 6d 92 01 ADC Temp_YSf 4157 90cc 8d 8e 01 STA Total_YSf 4158 90cf ad 8d 01 LDA Total_speedY 4159 90d2 6d 91 01 ADC Temp_Y_speed 4160 90d5 8d 8d 01 STA Total_speedY 4161 90d8 .L0321 ;; if Total_XSu = 0 && Total_YSu = 0 then goto es_SpeedIncrease 4162 90d8 4163 90d8 ad 8b 01 LDA Total_XSu 4164 90db c9 00 CMP #0 4165 90dd d0 0a BNE .skipL0321 4166 90df .condpart114 4167 90df ad 8d 01 LDA Total_YSu 4168 90e2 c9 00 CMP #0 4169 90e4 d0 03 BNE .skip114then 4170 90e6 .condpart115 4171 90e6 4c b2 90 jmp .es_SpeedIncrease 4172 90e9 4173 90e9 .skip114then 4174 90e9 .skipL0321 4175 90e9 . 4176 90e9 ;; 4177 90e9 4178 90e9 . 4179 90e9 ;; 4180 90e9 4181 90e9 . 4182 90e9 ;; 4183 90e9 4184 90e9 . 4185 90e9 ;; 4186 90e9 4187 90e9 . 4188 90e9 ;; 4189 90e9 4190 90e9 . 4191 90e9 ;; 4192 90e9 4193 90e9 .L0322 ;; enemy_shot_Xf = Total_XSu 4194 90e9 4195 90e9 ad 8b 01 LDA Total_XSu 4196 90ec 8d 10 22 STA enemy_shot_Xf 4197 90ef .L0323 ;; enemy_shot_Sxf = Total_XSf 4198 90ef 4199 90ef ad 8c 01 LDA Total_XSf 4200 90f2 8d 50 22 STA enemy_shot_Sxf 4201 90f5 .L0324 ;; enemy_shot_Yf = Total_YSu 4202 90f5 4203 90f5 ad 8d 01 LDA Total_YSu 4204 90f8 8d 30 22 STA enemy_shot_Yf 4205 90fb .L0325 ;; enemy_shot_Syf = Total_YSf 4206 90fb 4207 90fb ad 8e 01 LDA Total_YSf 4208 90fe 8d 70 22 STA enemy_shot_Syf 4209 9101 .L0326 ;; return 4210 9101 4211 9101 ba tsx 4212 9102 bd 02 01 lda $102,x 4213 9105 f0 01 beq bankswitchret26 4214 9107 60 RTS 4215 9108 bankswitchret26 4216 9108 4c a1 f4 JMP BS_return 4217 910b . 4218 910b ;; 4219 910b 4220 910b .skip_enemy_shot 4221 910b ;; skip_enemy_shot 4222 910b 4223 910b .L0327 ;; z = z - 1 4224 910b 4225 910b a5 ff LDA z 4226 910d 38 SEC 4227 910e e9 01 SBC #1 4228 9110 85 ff STA z 4229 9112 .L0328 ;; if z < 15 then shoot_enemy_bullet 4230 9112 4231 9112 a5 ff LDA z 4232 9114 c9 0f CMP #15 4233 9116 - if ((* - .shoot_enemy_bullet) < 127) && ((* - .shoot_enemy_bullet) > -128) 4234 9116 - bcc .shoot_enemy_bullet 4235 9116 else 4236 9116 b0 03 bcs .4skipshoot_enemy_bullet 4237 9118 4c b0 8f jmp .shoot_enemy_bullet 4238 911b .4skipshoot_enemy_bullet 4239 911b endif 4240 911b .L0329 ;; return 4241 911b 4242 911b ba tsx 4243 911c bd 02 01 lda $102,x 4244 911f f0 01 beq bankswitchret27 4245 9121 60 RTS 4246 9122 bankswitchret27 4247 9122 4c a1 f4 JMP BS_return 4248 9125 . 4249 9125 ;; 4250 9125 4251 9125 .move_enemyshot 4252 9125 ;; move_enemyshot 4253 9125 4254 9125 . 4255 9125 ;; 4256 9125 4257 9125 .L0330 ;; z = 15 4258 9125 4259 9125 a9 0f LDA #15 4260 9127 85 ff STA z 4261 9129 .update_enemyshot 4262 9129 ;; update_enemyshot 4263 9129 4264 9129 . 4265 9129 ;; 4266 9129 4267 9129 . 4268 9129 ;; 4269 9129 4270 9129 . 4271 9129 ;; 4272 9129 4273 9129 . 4274 9129 ;; 4275 9129 4276 9129 . 4277 9129 ;; 4278 9129 4279 9129 . 4280 9129 ;; 4281 9129 4282 9129 . 4283 9129 ;; 4284 9129 4285 9129 . 4286 9129 ;; 4287 9129 4288 9129 . 4289 9129 ;; 4290 9129 4291 9129 . 4292 9129 ;; 4293 9129 4294 9129 . 4295 9129 ;; 4296 9129 4297 9129 . 4298 9129 ;; 4299 9129 4300 9129 .L0331 ;; if ( enemy_shot_direction & 1 ) = 1 then Mob_Pos_Y = Mob_Pos_Y - Mob_SpeedY else Mob_Pos_Y = Mob_Pos_Y + Mob_SpeedY 4301 9129 4302 9129 ; complex condition detected 4303 9129 ; complex statement detected 4304 9129 ad 90 22 LDA enemy_shot_direction 4305 912c 29 01 AND #1 4306 912e c9 01 CMP #1 4307 9130 d0 16 BNE .skipL0331 4308 9132 .condpart116 4309 9132 ad 9a 01 LDA var90 4310 9135 38 SEC 4311 9136 ed 98 01 SBC var88 4312 9139 8d 9a 01 STA var90 4313 913c ad 96 01 LDA Mob_Pos_Y 4314 913f ed 94 01 SBC Mob_SpeedY 4315 9142 8d 96 01 STA Mob_Pos_Y 4316 9145 4c 5b 91 jmp .skipelse3 4317 9148 .skipL0331 4318 9148 ad 9a 01 LDA var90 4319 914b 18 CLC 4320 914c 6d 98 01 ADC var88 4321 914f 8d 9a 01 STA var90 4322 9152 ad 96 01 LDA Mob_Pos_Y 4323 9155 6d 94 01 ADC Mob_SpeedY 4324 9158 8d 96 01 STA Mob_Pos_Y 4325 915b .skipelse3 4326 915b .L0332 ;; if ( enemy_shot_direction & 2 ) = 2 then Mob_Pos_X = Mob_Pos_X - Mob_SpeedX else Mob_Pos_X = Mob_Pos_X + Mob_SpeedX 4327 915b 4328 915b ; complex condition detected 4329 915b ; complex statement detected 4330 915b ad 90 22 LDA enemy_shot_direction 4331 915e 29 02 AND #2 4332 9160 c9 02 CMP #2 4333 9162 d0 16 BNE .skipL0332 4334 9164 .condpart117 4335 9164 ad 99 01 LDA var89 4336 9167 38 SEC 4337 9168 ed 97 01 SBC var87 4338 916b 8d 99 01 STA var89 4339 916e ad 95 01 LDA Mob_Pos_X 4340 9171 ed 93 01 SBC Mob_SpeedX 4341 9174 8d 95 01 STA Mob_Pos_X 4342 9177 4c 8d 91 jmp .skipelse4 4343 917a .skipL0332 4344 917a ad 99 01 LDA var89 4345 917d 18 CLC 4346 917e 6d 97 01 ADC var87 4347 9181 8d 99 01 STA var89 4348 9184 ad 95 01 LDA Mob_Pos_X 4349 9187 6d 93 01 ADC Mob_SpeedX 4350 918a 8d 95 01 STA Mob_Pos_X 4351 918d .skipelse4 4352 918d . 4353 918d ;; 4354 918d 4355 918d . 4356 918d ;; 4357 918d 4358 918d . 4359 918d ;; 4360 918d 4361 918d . 4362 918d ;; 4363 918d 4364 918d . 4365 918d ;; 4366 918d 4367 918d . 4368 918d ;; 4369 918d 4370 918d .L0333 ;; return 4371 918d 4372 918d ba tsx 4373 918e bd 02 01 lda $102,x 4374 9191 f0 01 beq bankswitchret28 4375 9193 60 RTS 4376 9194 bankswitchret28 4377 9194 4c a1 f4 JMP BS_return 4378 9197 . 4379 9197 ;; 4380 9197 4381 9197 . 4382 9197 ;; 4383 9197 4384 9197 . 4385 9197 ;; 4386 9197 4387 9197 .L0334 ;; data sfx_bling 4388 9197 4389 9197 4c d0 91 JMP .skipL0334 4390 919a sfx_bling 4391 919a 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4392 919d 4393 919d 1c 04 07 .byte.b $1c,$04,$07 4394 91a0 4395 91a0 1b 04 07 .byte.b $1b,$04,$07 4396 91a3 4397 91a3 04 0f 05 .byte.b $04,$0f,$05 4398 91a6 4399 91a6 15 04 09 .byte.b $15,$04,$09 4400 91a9 4401 91a9 16 04 07 .byte.b $16,$04,$07 4402 91ac 4403 91ac 03 0f 04 .byte.b $03,$0f,$04 4404 91af 4405 91af 11 04 08 .byte.b $11,$04,$08 4406 91b2 4407 91b2 11 04 08 .byte.b $11,$04,$08 4408 91b5 4409 91b5 11 04 04 .byte.b $11,$04,$04 4410 91b8 4411 91b8 0e 04 09 .byte.b $0e,$04,$09 4412 91bb 4413 91bb 0e 04 07 .byte.b $0e,$04,$07 4414 91be 4415 91be 0e 04 04 .byte.b $0e,$04,$04 4416 91c1 4417 91c1 1c 04 07 .byte.b $1c,$04,$07 4418 91c4 4419 91c4 1b 04 05 .byte.b $1b,$04,$05 4420 91c7 4421 91c7 1c 04 04 .byte.b $1c,$04,$04 4422 91ca 4423 91ca 1b 04 02 .byte.b $1b,$04,$02 4424 91cd 4425 91cd 00 00 00 .byte.b $00,$00,$00 4426 91d0 4427 91d0 .skipL0334 4428 91d0 sfx_bling_lo SET #sfx_bling 4430 91d0 . 4431 91d0 ;; 4432 91d0 4433 91d0 .L0335 ;; data sfx_pulsecannon 4434 91d0 4435 91d0 4c 27 92 JMP .skipL0335 4436 91d3 sfx_pulsecannon 4437 91d3 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4438 91d6 4439 91d6 1e 0c 0a .byte.b $1e,$0c,$0a ; first chunk of freq,channel,volume 4440 91d9 4441 91d9 07 06 0f .byte.b $07,$06,$0f 4442 91dc 4443 91dc 07 06 0f .byte.b $07,$06,$0f 4444 91df 4445 91df 1e 06 0f .byte.b $1e,$06,$0f 4446 91e2 4447 91e2 17 0c 0b .byte.b $17,$0c,$0b 4448 91e5 4449 91e5 1b 0c 0b .byte.b $1b,$0c,$0b 4450 91e8 4451 91e8 1e 0c 0f .byte.b $1e,$0c,$0f 4452 91eb 4453 91eb 07 06 0f .byte.b $07,$06,$0f 4454 91ee 4455 91ee 07 06 0f .byte.b $07,$06,$0f 4456 91f1 4457 91f1 1e 06 08 .byte.b $1e,$06,$08 4458 91f4 4459 91f4 17 0c 06 .byte.b $17,$0c,$06 4460 91f7 4461 91f7 1b 0c 0f .byte.b $1b,$0c,$0f 4462 91fa 4463 91fa 1e 0c 0f .byte.b $1e,$0c,$0f 4464 91fd 4465 91fd 07 06 0f .byte.b $07,$06,$0f 4466 9200 4467 9200 07 06 0f .byte.b $07,$06,$0f 4468 9203 4469 9203 0a 06 0a .byte.b $0a,$06,$0a 4470 9206 4471 9206 17 0c 0a .byte.b $17,$0c,$0a 4472 9209 4473 9209 1e 0c 04 .byte.b $1e,$0c,$04 4474 920c 4475 920c 1e 06 09 .byte.b $1e,$06,$09 4476 920f 4477 920f 1b 04 05 .byte.b $1b,$04,$05 4478 9212 4479 9212 07 06 0f .byte.b $07,$06,$0f 4480 9215 4481 9215 0a 06 09 .byte.b $0a,$06,$09 4482 9218 4483 9218 17 0c 0d .byte.b $17,$0c,$0d 4484 921b 4485 921b 1b 0c 09 .byte.b $1b,$0c,$09 4486 921e 4487 921e 0a 06 05 .byte.b $0a,$06,$05 4488 9221 4489 9221 17 0c 03 .byte.b $17,$0c,$03 4490 9224 4491 9224 00 00 00 .byte.b $00,$00,$00 4492 9227 4493 9227 .skipL0335 4494 9227 sfx_pulsecannon_lo SET #sfx_pulsecannon 4496 9227 . 4497 9227 ;; 4498 9227 4499 9227 .L0336 ;; data sfx_plainlaser 4500 9227 4501 9227 4c 5a 92 JMP .skipL0336 4502 922a sfx_plainlaser 4503 922a 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4504 922d 4505 922d 10 04 06 .byte.b $10,$04,$06 ; first chunk of freq,channel,volume 4506 9230 4507 9230 13 04 08 .byte.b $13,$04,$08 4508 9233 4509 9233 16 04 08 .byte.b $16,$04,$08 4510 9236 4511 9236 16 04 07 .byte.b $16,$04,$07 4512 9239 4513 9239 1c 04 09 .byte.b $1c,$04,$09 4514 923c 4515 923c 0b 0c 0f .byte.b $0b,$0c,$0f 4516 923f 4517 923f 0d 0c 0f .byte.b $0d,$0c,$0f 4518 9242 4519 9242 0e 0c 0f .byte.b $0e,$0c,$0f 4520 9245 4521 9245 0e 0c 0f .byte.b $0e,$0c,$0f 4522 9248 4523 9248 12 0c 0f .byte.b $12,$0c,$0f 4524 924b 4525 924b 03 06 0d .byte.b $03,$06,$0d 4526 924e 4527 924e 1e 0c 0a .byte.b $1e,$0c,$0a 4528 9251 4529 9251 1e 0c 0c .byte.b $1e,$0c,$0c 4530 9254 4531 9254 0a 06 04 .byte.b $0a,$06,$04 4532 9257 4533 9257 00 00 00 .byte.b $00,$00,$00 4534 925a 4535 925a .skipL0336 4536 925a sfx_plainlaser_lo SET #sfx_plainlaser 4538 925a . 4539 925a ;; 4540 925a 4541 925a .L0337 ;; data sfx_explosion 4542 925a 4543 925a 4c ed 92 JMP .skipL0337 4544 925d sfx_explosion 4545 925d 10 10 00 .byte.b $10,$10,$00 4546 9260 4547 9260 01 08 02 .byte.b $01,$08,$02 4548 9263 4549 9263 0b 0c 05 .byte.b $0b,$0c,$05 4550 9266 4551 9266 04 06 08 .byte.b $04,$06,$08 4552 9269 4553 9269 03 0e 0f .byte.b $03,$0e,$0f 4554 926c 4555 926c 09 06 0f .byte.b $09,$06,$0f 4556 926f 4557 926f 0d 06 0f .byte.b $0d,$06,$0f 4558 9272 4559 9272 04 0e 0f .byte.b $04,$0e,$0f 4560 9275 4561 9275 0f 06 08 .byte.b $0f,$06,$08 4562 9278 4563 9278 09 06 04 .byte.b $09,$06,$04 4564 927b 4565 927b 16 01 03 .byte.b $16,$01,$03 4566 927e 4567 927e 0c 06 04 .byte.b $0c,$06,$04 4568 9281 4569 9281 09 06 05 .byte.b $09,$06,$05 4570 9284 4571 9284 0a 06 03 .byte.b $0a,$06,$03 4572 9287 4573 9287 09 06 05 .byte.b $09,$06,$05 4574 928a 4575 928a 0d 06 08 .byte.b $0d,$06,$08 4576 928d 4577 928d 09 06 04 .byte.b $09,$06,$04 4578 9290 4579 9290 04 0e 06 .byte.b $04,$0e,$06 4580 9293 4581 9293 0f 06 05 .byte.b $0f,$06,$05 4582 9296 4583 9296 0f 06 07 .byte.b $0f,$06,$07 4584 9299 4585 9299 04 0e 07 .byte.b $04,$0e,$07 4586 929c 4587 929c 08 06 06 .byte.b $08,$06,$06 4588 929f 4589 929f 03 0e 08 .byte.b $03,$0e,$08 4590 92a2 4591 92a2 0f 06 06 .byte.b $0f,$06,$06 4592 92a5 4593 92a5 09 06 05 .byte.b $09,$06,$05 4594 92a8 4595 92a8 06 06 05 .byte.b $06,$06,$05 4596 92ab 4597 92ab 03 0e 05 .byte.b $03,$0e,$05 4598 92ae 4599 92ae 0e 06 06 .byte.b $0e,$06,$06 4600 92b1 4601 92b1 02 0e 05 .byte.b $02,$0e,$05 4602 92b4 4603 92b4 0f 06 03 .byte.b $0f,$06,$03 4604 92b7 4605 92b7 0e 06 06 .byte.b $0e,$06,$06 4606 92ba 4607 92ba 09 06 05 .byte.b $09,$06,$05 4608 92bd 4609 92bd 0c 06 05 .byte.b $0c,$06,$05 4610 92c0 4611 92c0 0f 06 03 .byte.b $0f,$06,$03 4612 92c3 4613 92c3 04 0e 08 .byte.b $04,$0e,$08 4614 92c6 4615 92c6 0c 06 03 .byte.b $0c,$06,$03 4616 92c9 4617 92c9 0f 06 03 .byte.b $0f,$06,$03 4618 92cc 4619 92cc 0c 06 06 .byte.b $0c,$06,$06 4620 92cf 4621 92cf 0f 06 04 .byte.b $0f,$06,$04 4622 92d2 4623 92d2 0f 06 05 .byte.b $0f,$06,$05 4624 92d5 4625 92d5 0f 06 03 .byte.b $0f,$06,$03 4626 92d8 4627 92d8 0a 06 04 .byte.b $0a,$06,$04 4628 92db 4629 92db 0f 06 03 .byte.b $0f,$06,$03 4630 92de 4631 92de 08 06 03 .byte.b $08,$06,$03 4632 92e1 4633 92e1 0c 06 03 .byte.b $0c,$06,$03 4634 92e4 4635 92e4 0e 06 03 .byte.b $0e,$06,$03 4636 92e7 4637 92e7 08 06 03 .byte.b $08,$06,$03 4638 92ea 4639 92ea 00 00 00 .byte.b $00,$00,$00 4640 92ed 4641 92ed .skipL0337 4642 92ed sfx_explosion_lo SET #sfx_explosion 4644 92ed DMAHOLEEND0 SET . 4645 92ed gameend 4646 92ed DMAHOLEEND0 SET . 7443 bytes of ROM space left in the main area of bank 1. 4647 92ed echo " ",[($B000 - .)]d , "bytes of ROM space left in the main area of bank 1." 4648 92ed - if ($B000 - .) < 0 4649 92ed -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 4650 92ed endif 4651 92ed 4652 b000 ORG $B000,0 ; ************* 4653 b000 4654 b000 RORG $B000 ; ************* 4655 b000 4656 b000 b0 00 vertical_shooting_font = $B000 4657 b000 4658 b000 vertical_shooting_font 4659 b000 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4660 b020 00 00 00 00* HEX 00000000000000000000000000 4661 b020 b0 2d vertical_shooting_ship = $B02D 4662 b02d 4663 b02d vertical_shooting_ship 4664 b02d 07 d0 HEX 07d0 4665 b02d b0 2f vertical_shooting_ship_tallsprite_00 = $B02F 4666 b02f 4667 b02f vertical_shooting_ship_tallsprite_00 4668 b02f 80 02 HEX 8002 4669 b02f b0 31 vertical_shooting_bullet = $B031 4670 b031 4671 b031 vertical_shooting_bullet 4672 b031 28 HEX 28 4673 b031 b0 32 vertical_shooting_enemyshot = $B032 4674 b032 4675 b032 vertical_shooting_enemyshot 4676 b032 00 HEX 00 4677 b032 b0 33 vertical_shooting_powerup = $B033 4678 b033 4679 b033 vertical_shooting_powerup 4680 b033 28 00 HEX 2800 4681 b033 b0 35 vertical_shooting_enemy01 = $B035 4682 b035 4683 b035 vertical_shooting_enemy01 4684 b035 09 e0 HEX 09e0 4685 b035 b0 37 vertical_shooting_enemy01_tallsprite_00 = $B037 4686 b037 4687 b037 vertical_shooting_enemy01_tallsprite_00 4688 b037 40 03 HEX 4003 4689 b037 b0 39 vertical_shooting_1up = $B039 4690 b039 4691 b039 vertical_shooting_1up 4692 b039 15 55 HEX 1555 4693 b039 b0 3b vertical_shooting_demo_explosion_upd0 = $B03B 4694 b03b 4695 b03b vertical_shooting_demo_explosion_upd0 4696 b03b 00 00 HEX 0000 4697 b03b b0 3d vertical_shooting_demo_explosion_upd0_tallsprite_00 = $B03D 4698 b03d 4699 b03d vertical_shooting_demo_explosion_upd0_tallsprite_00 4700 b03d 00 00 HEX 0000 4701 b03d b0 3f vertical_shooting_demo_explosion_upd1 = $B03F 4702 b03f 4703 b03f vertical_shooting_demo_explosion_upd1 4704 b03f 02 80 HEX 0280 4705 b03f b0 41 vertical_shooting_demo_explosion_upd1_tallsprite_00 = $B041 4706 b041 4707 b041 vertical_shooting_demo_explosion_upd1_tallsprite_00 4708 b041 00 00 HEX 0000 4709 b041 b0 43 vertical_shooting_demo_explosion_upd2 = $B043 4710 b043 4711 b043 vertical_shooting_demo_explosion_upd2 4712 b043 05 50 HEX 0550 4713 b043 b0 45 vertical_shooting_demo_explosion_upd2_tallsprite_00 = $B045 4714 b045 4715 b045 vertical_shooting_demo_explosion_upd2_tallsprite_00 4716 b045 00 00 HEX 0000 4717 b045 b0 47 vertical_shooting_demo_explosion_upd3 = $B047 4718 b047 4719 b047 vertical_shooting_demo_explosion_upd3 4720 b047 15 54 HEX 1554 4721 b047 b0 49 vertical_shooting_demo_explosion_upd3_tallsprite_00 = $B049 4722 b049 4723 b049 vertical_shooting_demo_explosion_upd3_tallsprite_00 4724 b049 00 00 HEX 0000 4725 b049 b0 4b vertical_shooting_demo_explosion_upd4 = $B04B 4726 b04b 4727 b04b vertical_shooting_demo_explosion_upd4 4728 b04b 07 d0 HEX 07d0 4729 b04b b0 4d vertical_shooting_demo_explosion_upd4_tallsprite_00 = $B04D 4730 b04d 4731 b04d vertical_shooting_demo_explosion_upd4_tallsprite_00 4732 b04d 00 00 HEX 0000 4733 b04d b0 4f vertical_shooting_demo_explosion_upd5 = $B04F 4734 b04f 4735 b04f vertical_shooting_demo_explosion_upd5 4736 b04f 0c 30 HEX 0c30 4737 b04f b0 51 vertical_shooting_demo_explosion_upd5_tallsprite_00 = $B051 4738 b051 4739 b051 vertical_shooting_demo_explosion_upd5_tallsprite_00 4740 b051 01 40 HEX 0140 4741 b051 b0 53 vertical_shooting_demo_explosion_upd6 = $B053 4742 b053 4743 b053 vertical_shooting_demo_explosion_upd6 4744 b053 00 00 HEX 0000 4745 b053 b0 55 vertical_shooting_demo_explosion_upd6_tallsprite_00 = $B055 4746 b055 4747 b055 vertical_shooting_demo_explosion_upd6_tallsprite_00 4748 b055 01 40 HEX 0140 4749 b055 b0 57 vertical_shooting_demo_explosion_upd7 = $B057 4750 b057 4751 b057 vertical_shooting_demo_explosion_upd7 4752 b057 00 00 HEX 0000 4753 b057 b0 59 vertical_shooting_demo_explosion_upd7_tallsprite_00 = $B059 4754 b059 4755 b059 vertical_shooting_demo_explosion_upd7_tallsprite_00 4756 b059 01 40 HEX 0140 4757 b059 b0 5b vertical_shooting_demo_explosion_upd8 = $B05B 4758 b05b 4759 b05b vertical_shooting_demo_explosion_upd8 4760 b05b 00 00 HEX 0000 4761 b05b b0 5d vertical_shooting_demo_explosion_upd8_tallsprite_00 = $B05D 4762 b05d 4763 b05d vertical_shooting_demo_explosion_upd8_tallsprite_00 4764 b05d 01 40 HEX 0140 4765 b05d b0 5f vertical_shooting_demo_explosion_upd9 = $B05F 4766 b05f 4767 b05f vertical_shooting_demo_explosion_upd9 4768 b05f 00 00 HEX 0000 4769 b05f b0 61 vertical_shooting_demo_explosion_upd9_tallsprite_00 = $B061 4770 b061 4771 b061 vertical_shooting_demo_explosion_upd9_tallsprite_00 4772 b061 01 40 HEX 0140 4773 b061 b0 63 vertical_shooting_demo_explosion_upd10 = $B063 4774 b063 4775 b063 vertical_shooting_demo_explosion_upd10 4776 b063 00 00 HEX 0000 4777 b063 b0 65 vertical_shooting_demo_explosion_upd10_tallsprite_00 = $B065 4778 b065 4779 b065 vertical_shooting_demo_explosion_upd10_tallsprite_00 4780 b065 01 40 HEX 0140 4781 b065 b0 67 vertical_shooting_laser = $B067 4782 b067 4783 b067 vertical_shooting_laser 4784 b067 88 HEX 88 4785 b067 b0 68 vertical_shooting_laser_tallsprite_00 = $B068 4786 b068 4787 b068 vertical_shooting_laser_tallsprite_00 4788 b068 cc HEX cc 4789 b069 4790 b100 ORG $B100,0 ; ************* 4791 b100 4792 b100 RORG $B100 ; ************* 4793 b100 4794 b100 ;vertical_shooting_font 4795 b100 00 54 54 54* HEX 0054545454045454045404445054505440544454104454444410401444501014 4796 b120 10 44 44 10* HEX 10444410544040101040400000 4797 b12d ;vertical_shooting_ship 4798 b12d 07 d0 HEX 07d0 4799 b12f ;vertical_shooting_ship_tallsprite_00 4800 b12f 80 02 HEX 8002 4801 b131 ;vertical_shooting_bullet 4802 b131 28 HEX 28 4803 b132 ;vertical_shooting_enemyshot 4804 b132 88 HEX 88 4805 b133 ;vertical_shooting_powerup 4806 b133 78 08 HEX 7808 4807 b135 ;vertical_shooting_enemy01 4808 b135 09 e0 HEX 09e0 4809 b137 ;vertical_shooting_enemy01_tallsprite_00 4810 b137 50 0f HEX 500f 4811 b139 ;vertical_shooting_1up 4812 b139 ea a9 HEX eaa9 4813 b13b ;vertical_shooting_demo_explosion_upd0 4814 b13b 00 00 HEX 0000 4815 b13d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 4816 b13d 00 00 HEX 0000 4817 b13f ;vertical_shooting_demo_explosion_upd1 4818 b13f 01 40 HEX 0140 4819 b141 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 4820 b141 00 00 HEX 0000 4821 b143 ;vertical_shooting_demo_explosion_upd2 4822 b143 09 60 HEX 0960 4823 b145 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 4824 b145 00 00 HEX 0000 4825 b147 ;vertical_shooting_demo_explosion_upd3 4826 b147 25 58 HEX 2558 4827 b149 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 4828 b149 00 00 HEX 0000 4829 b14b ;vertical_shooting_demo_explosion_upd4 4830 b14b 05 50 HEX 0550 4831 b14d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 4832 b14d 02 80 HEX 0280 4833 b14f ;vertical_shooting_demo_explosion_upd5 4834 b14f 0b e0 HEX 0be0 4835 b151 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 4836 b151 01 40 HEX 0140 4837 b153 ;vertical_shooting_demo_explosion_upd6 4838 b153 0c 30 HEX 0c30 4839 b155 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 4840 b155 01 40 HEX 0140 4841 b157 ;vertical_shooting_demo_explosion_upd7 4842 b157 00 00 HEX 0000 4843 b159 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 4844 b159 01 40 HEX 0140 4845 b15b ;vertical_shooting_demo_explosion_upd8 4846 b15b 00 00 HEX 0000 4847 b15d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 4848 b15d 01 40 HEX 0140 4849 b15f ;vertical_shooting_demo_explosion_upd9 4850 b15f 00 00 HEX 0000 4851 b161 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 4852 b161 01 40 HEX 0140 4853 b163 ;vertical_shooting_demo_explosion_upd10 4854 b163 00 00 HEX 0000 4855 b165 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 4856 b165 00 00 HEX 0000 4857 b167 ;vertical_shooting_laser 4858 b167 88 HEX 88 4859 b168 ;vertical_shooting_laser_tallsprite_00 4860 b168 cc HEX cc 4861 b169 4862 b200 ORG $B200,0 ; ************* 4863 b200 4864 b200 RORG $B200 ; ************* 4865 b200 4866 b200 ;vertical_shooting_font 4867 b200 00 44 10 40* HEX 0044104004040444044404444440444040444410444440444444404444041044 4868 b220 10 54 44 10* HEX 10544410400010000000100000 4869 b22d ;vertical_shooting_ship 4870 b22d 03 c0 HEX 03c0 4871 b22f ;vertical_shooting_ship_tallsprite_00 4872 b22f a1 4a HEX a14a 4873 b231 ;vertical_shooting_bullet 4874 b231 3c HEX 3c 4875 b232 ;vertical_shooting_enemyshot 4876 b232 10 HEX 10 4877 b233 ;vertical_shooting_powerup 4878 b233 78 1e HEX 781e 4879 b235 ;vertical_shooting_enemy01 4880 b235 19 ec HEX 19ec 4881 b237 ;vertical_shooting_enemy01_tallsprite_00 4882 b237 5a af HEX 5aaf 4883 b239 ;vertical_shooting_1up 4884 b239 d5 58 HEX d558 4885 b23b ;vertical_shooting_demo_explosion_upd0 4886 b23b 00 00 HEX 0000 4887 b23d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 4888 b23d 00 00 HEX 0000 4889 b23f ;vertical_shooting_demo_explosion_upd1 4890 b23f 00 00 HEX 0000 4891 b241 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 4892 b241 00 00 HEX 0000 4893 b243 ;vertical_shooting_demo_explosion_upd2 4894 b243 02 80 HEX 0280 4895 b245 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 4896 b245 00 00 HEX 0000 4897 b247 ;vertical_shooting_demo_explosion_upd3 4898 b247 09 60 HEX 0960 4899 b249 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 4900 b249 00 00 HEX 0000 4901 b24b ;vertical_shooting_demo_explosion_upd4 4902 b24b 05 50 HEX 0550 4903 b24d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 4904 b24d 02 80 HEX 0280 4905 b24f ;vertical_shooting_demo_explosion_upd5 4906 b24f 0a a0 HEX 0aa0 4907 b251 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 4908 b251 05 50 HEX 0550 4909 b253 ;vertical_shooting_demo_explosion_upd6 4910 b253 0b e0 HEX 0be0 4911 b255 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 4912 b255 05 50 HEX 0550 4913 b257 ;vertical_shooting_demo_explosion_upd7 4914 b257 08 20 HEX 0820 4915 b259 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 4916 b259 05 50 HEX 0550 4917 b25b ;vertical_shooting_demo_explosion_upd8 4918 b25b 00 00 HEX 0000 4919 b25d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 4920 b25d 05 50 HEX 0550 4921 b25f ;vertical_shooting_demo_explosion_upd9 4922 b25f 00 00 HEX 0000 4923 b261 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 4924 b261 06 90 HEX 0690 4925 b263 ;vertical_shooting_demo_explosion_upd10 4926 b263 00 00 HEX 0000 4927 b265 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 4928 b265 04 10 HEX 0410 4929 b267 ;vertical_shooting_laser 4930 b267 44 HEX 44 4931 b268 ;vertical_shooting_laser_tallsprite_00 4932 b268 cc HEX cc 4933 b269 4934 b300 ORG $B300,0 ; ************* 4935 b300 4936 b300 RORG $B300 ; ************* 4937 b300 4938 b300 ;vertical_shooting_font 4939 b300 00 44 10 40* HEX 0044104004040444044404444440444040444410044440444444404444041044 4940 b320 54 54 44 10* HEX 54544410100000101000000000 4941 b32d ;vertical_shooting_ship 4942 b32d 01 40 HEX 0140 4943 b32f ;vertical_shooting_ship_tallsprite_00 4944 b32f a5 5a HEX a55a 4945 b331 ;vertical_shooting_bullet 4946 b331 3c HEX 3c 4947 b332 ;vertical_shooting_enemyshot 4948 b332 74 HEX 74 4949 b333 ;vertical_shooting_powerup 4950 b333 7a a4 HEX 7aa4 4951 b335 ;vertical_shooting_enemy01 4952 b335 59 ef HEX 59ef 4953 b337 ;vertical_shooting_enemy01_tallsprite_00 4954 b337 59 ef HEX 59ef 4955 b339 ;vertical_shooting_1up 4956 b339 35 60 HEX 3560 4957 b33b ;vertical_shooting_demo_explosion_upd0 4958 b33b 00 00 HEX 0000 4959 b33d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 4960 b33d 00 00 HEX 0000 4961 b33f ;vertical_shooting_demo_explosion_upd1 4962 b33f 00 00 HEX 0000 4963 b341 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 4964 b341 00 00 HEX 0000 4965 b343 ;vertical_shooting_demo_explosion_upd2 4966 b343 00 00 HEX 0000 4967 b345 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 4968 b345 00 00 HEX 0000 4969 b347 ;vertical_shooting_demo_explosion_upd3 4970 b347 02 80 HEX 0280 4971 b349 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 4972 b349 00 00 HEX 0000 4973 b34b ;vertical_shooting_demo_explosion_upd4 4974 b34b 09 60 HEX 0960 4975 b34d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 4976 b34d 09 60 HEX 0960 4977 b34f ;vertical_shooting_demo_explosion_upd5 4978 b34f 06 90 HEX 0690 4979 b351 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 4980 b351 06 90 HEX 0690 4981 b353 ;vertical_shooting_demo_explosion_upd6 4982 b353 06 90 HEX 0690 4983 b355 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 4984 b355 06 90 HEX 0690 4985 b357 ;vertical_shooting_demo_explosion_upd7 4986 b357 06 90 HEX 0690 4987 b359 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 4988 b359 07 d0 HEX 07d0 4989 b35b ;vertical_shooting_demo_explosion_upd8 4990 b35b 08 20 HEX 0820 4991 b35d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 4992 b35d 06 90 HEX 0690 4993 b35f ;vertical_shooting_demo_explosion_upd9 4994 b35f 00 00 HEX 0000 4995 b361 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 4996 b361 08 20 HEX 0820 4997 b363 ;vertical_shooting_demo_explosion_upd10 4998 b363 00 00 HEX 0000 4999 b365 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 5000 b365 00 00 HEX 0000 5001 b367 ;vertical_shooting_laser 5002 b367 44 HEX 44 5003 b368 ;vertical_shooting_laser_tallsprite_00 5004 b368 cc HEX cc 5005 b369 5006 b400 ORG $B400,0 ; ************* 5007 b400 5008 b400 RORG $B400 ; ************* 5009 b400 5010 b400 ;vertical_shooting_font 5011 b400 00 44 10 54* HEX 0044105454545454045454545040445454445410045040544444504450101044 5012 b420 44 44 10 10* HEX 44441010100000101000000000 5013 b42d ;vertical_shooting_ship 5014 b42d 01 40 HEX 0140 5015 b42f ;vertical_shooting_ship_tallsprite_00 5016 b42f a5 5a HEX a55a 5017 b431 ;vertical_shooting_bullet 5018 b431 14 HEX 14 5019 b432 ;vertical_shooting_enemyshot 5020 b432 74 HEX 74 5021 b433 ;vertical_shooting_powerup 5022 b433 75 7a HEX 757a 5023 b435 ;vertical_shooting_enemy01 5024 b435 59 6f HEX 596f 5025 b437 ;vertical_shooting_enemy01_tallsprite_00 5026 b437 59 ef HEX 59ef 5027 b439 ;vertical_shooting_1up 5028 b439 35 60 HEX 3560 5029 b43b ;vertical_shooting_demo_explosion_upd0 5030 b43b 00 00 HEX 0000 5031 b43d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 5032 b43d 00 00 HEX 0000 5033 b43f ;vertical_shooting_demo_explosion_upd1 5034 b43f 00 00 HEX 0000 5035 b441 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 5036 b441 00 00 HEX 0000 5037 b443 ;vertical_shooting_demo_explosion_upd2 5038 b443 00 00 HEX 0000 5039 b445 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 5040 b445 00 00 HEX 0000 5041 b447 ;vertical_shooting_demo_explosion_upd3 5042 b447 00 00 HEX 0000 5043 b449 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 5044 b449 02 80 HEX 0280 5045 b44b ;vertical_shooting_demo_explosion_upd4 5046 b44b 09 60 HEX 0960 5047 b44d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 5048 b44d 09 60 HEX 0960 5049 b44f ;vertical_shooting_demo_explosion_upd5 5050 b44f 06 90 HEX 0690 5051 b451 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 5052 b451 06 90 HEX 0690 5053 b453 ;vertical_shooting_demo_explosion_upd6 5054 b453 06 90 HEX 0690 5055 b455 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 5056 b455 06 90 HEX 0690 5057 b457 ;vertical_shooting_demo_explosion_upd7 5058 b457 07 d0 HEX 07d0 5059 b459 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 5060 b459 06 90 HEX 0690 5061 b45b ;vertical_shooting_demo_explosion_upd8 5062 b45b 06 90 HEX 0690 5063 b45d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 5064 b45d 08 20 HEX 0820 5065 b45f ;vertical_shooting_demo_explosion_upd9 5066 b45f 08 20 HEX 0820 5067 b461 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 5068 b461 00 00 HEX 0000 5069 b463 ;vertical_shooting_demo_explosion_upd10 5070 b463 00 00 HEX 0000 5071 b465 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 5072 b465 00 00 HEX 0000 5073 b467 ;vertical_shooting_laser 5074 b467 44 HEX 44 5075 b468 ;vertical_shooting_laser_tallsprite_00 5076 b468 cc HEX cc 5077 b469 5078 b500 ORG $B500,0 ; ************* 5079 b500 5080 b500 RORG $B500 ; ************* 5081 b500 5082 b500 ;vertical_shooting_font 5083 b500 00 44 10 04* HEX 0044100404444040044444444440444040404410044440544444444444401044 5084 b520 44 44 44 54* HEX 44444454100000041000000000 5085 b52d ;vertical_shooting_ship 5086 b52d 01 40 HEX 0140 5087 b52f ;vertical_shooting_ship_tallsprite_00 5088 b52f a5 5a HEX a55a 5089 b531 ;vertical_shooting_bullet 5090 b531 14 HEX 14 5091 b532 ;vertical_shooting_enemyshot 5092 b532 74 HEX 74 5093 b533 ;vertical_shooting_powerup 5094 b533 78 1e HEX 781e 5095 b535 ;vertical_shooting_enemy01 5096 b535 5a af HEX 5aaf 5097 b537 ;vertical_shooting_enemy01_tallsprite_00 5098 b537 19 ec HEX 19ec 5099 b539 ;vertical_shooting_1up 5100 b539 0d 80 HEX 0d80 5101 b53b ;vertical_shooting_demo_explosion_upd0 5102 b53b 00 00 HEX 0000 5103 b53d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 5104 b53d 00 00 HEX 0000 5105 b53f ;vertical_shooting_demo_explosion_upd1 5106 b53f 00 00 HEX 0000 5107 b541 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 5108 b541 00 00 HEX 0000 5109 b543 ;vertical_shooting_demo_explosion_upd2 5110 b543 00 00 HEX 0000 5111 b545 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 5112 b545 02 80 HEX 0280 5113 b547 ;vertical_shooting_demo_explosion_upd3 5114 b547 00 00 HEX 0000 5115 b549 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 5116 b549 09 60 HEX 0960 5117 b54b ;vertical_shooting_demo_explosion_upd4 5118 b54b 02 80 HEX 0280 5119 b54d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 5120 b54d 05 50 HEX 0550 5121 b54f ;vertical_shooting_demo_explosion_upd5 5122 b54f 05 50 HEX 0550 5123 b551 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 5124 b551 0a a0 HEX 0aa0 5125 b553 ;vertical_shooting_demo_explosion_upd6 5126 b553 05 50 HEX 0550 5127 b555 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 5128 b555 0b e0 HEX 0be0 5129 b557 ;vertical_shooting_demo_explosion_upd7 5130 b557 05 50 HEX 0550 5131 b559 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 5132 b559 08 20 HEX 0820 5133 b55b ;vertical_shooting_demo_explosion_upd8 5134 b55b 05 50 HEX 0550 5135 b55d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 5136 b55d 00 00 HEX 0000 5137 b55f ;vertical_shooting_demo_explosion_upd9 5138 b55f 06 90 HEX 0690 5139 b561 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 5140 b561 00 00 HEX 0000 5141 b563 ;vertical_shooting_demo_explosion_upd10 5142 b563 04 10 HEX 0410 5143 b565 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 5144 b565 00 00 HEX 0000 5145 b567 ;vertical_shooting_laser 5146 b567 44 HEX 44 5147 b568 ;vertical_shooting_laser_tallsprite_00 5148 b568 88 HEX 88 5149 b569 5150 b600 ORG $B600,0 ; ************* 5151 b600 5152 b600 RORG $B600 ; ************* 5153 b600 5154 b600 ;vertical_shooting_font 5155 b600 00 44 50 04* HEX 0044500404444040044444444440444040404410044440544444444444401044 5156 b620 44 44 44 44* HEX 44444444040000441000001044 5157 b62d ;vertical_shooting_ship 5158 b62d 01 40 HEX 0140 5159 b62f ;vertical_shooting_ship_tallsprite_00 5160 b62f a7 da HEX a7da 5161 b631 ;vertical_shooting_bullet 5162 b631 14 HEX 14 5163 b632 ;vertical_shooting_enemyshot 5164 b632 10 HEX 10 5165 b633 ;vertical_shooting_powerup 5166 b633 7a bc HEX 7abc 5167 b635 ;vertical_shooting_enemy01 5168 b635 50 07 HEX 5007 5169 b637 ;vertical_shooting_enemy01_tallsprite_00 5170 b637 09 e0 HEX 09e0 5171 b639 ;vertical_shooting_1up 5172 b639 0d 80 HEX 0d80 5173 b63b ;vertical_shooting_demo_explosion_upd0 5174 b63b 00 00 HEX 0000 5175 b63d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 5176 b63d 00 00 HEX 0000 5177 b63f ;vertical_shooting_demo_explosion_upd1 5178 b63f 00 00 HEX 0000 5179 b641 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 5180 b641 01 40 HEX 0140 5181 b643 ;vertical_shooting_demo_explosion_upd2 5182 b643 00 00 HEX 0000 5183 b645 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 5184 b645 09 60 HEX 0960 5185 b647 ;vertical_shooting_demo_explosion_upd3 5186 b647 00 00 HEX 0000 5187 b649 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 5188 b649 25 58 HEX 2558 5189 b64b ;vertical_shooting_demo_explosion_upd4 5190 b64b 02 80 HEX 0280 5191 b64d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 5192 b64d 05 50 HEX 0550 5193 b64f ;vertical_shooting_demo_explosion_upd5 5194 b64f 01 40 HEX 0140 5195 b651 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 5196 b651 0b e0 HEX 0be0 5197 b653 ;vertical_shooting_demo_explosion_upd6 5198 b653 01 40 HEX 0140 5199 b655 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 5200 b655 0c 30 HEX 0c30 5201 b657 ;vertical_shooting_demo_explosion_upd7 5202 b657 01 40 HEX 0140 5203 b659 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 5204 b659 00 00 HEX 0000 5205 b65b ;vertical_shooting_demo_explosion_upd8 5206 b65b 01 40 HEX 0140 5207 b65d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 5208 b65d 00 00 HEX 0000 5209 b65f ;vertical_shooting_demo_explosion_upd9 5210 b65f 01 40 HEX 0140 5211 b661 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 5212 b661 00 00 HEX 0000 5213 b663 ;vertical_shooting_demo_explosion_upd10 5214 b663 00 00 HEX 0000 5215 b665 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 5216 b665 00 00 HEX 0000 5217 b667 ;vertical_shooting_laser 5218 b667 44 HEX 44 5219 b668 ;vertical_shooting_laser_tallsprite_00 5220 b668 88 HEX 88 5221 b669 5222 b700 ORG $B700,0 ; ************* 5223 b700 5224 b700 RORG $B700 ; ************* 5225 b700 5226 b700 ;vertical_shooting_font 5227 b700 00 54 10 54* HEX 0054105454445454545454545054505454544454044440445010501050145444 5228 b720 44 44 44 44* HEX 44444444540000101040401044 5229 b72d ;vertical_shooting_ship 5230 b72d 01 40 HEX 0140 5231 b72f ;vertical_shooting_ship_tallsprite_00 5232 b72f 27 d8 HEX 27d8 5233 b731 ;vertical_shooting_bullet 5234 b731 00 HEX 00 5235 b732 ;vertical_shooting_enemyshot 5236 b732 88 HEX 88 5237 b733 ;vertical_shooting_powerup 5238 b733 55 50 HEX 5550 5239 b735 ;vertical_shooting_enemy01 5240 b735 40 01 HEX 4001 5241 b737 ;vertical_shooting_enemy01_tallsprite_00 5242 b737 09 e0 HEX 09e0 5243 b739 ;vertical_shooting_1up 5244 b739 03 00 HEX 0300 5245 b73b ;vertical_shooting_demo_explosion_upd0 5246 b73b 00 00 HEX 0000 5247 b73d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 5248 b73d 00 00 HEX 0000 5249 b73f ;vertical_shooting_demo_explosion_upd1 5250 b73f 00 00 HEX 0000 5251 b741 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 5252 b741 02 80 HEX 0280 5253 b743 ;vertical_shooting_demo_explosion_upd2 5254 b743 00 00 HEX 0000 5255 b745 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 5256 b745 05 50 HEX 0550 5257 b747 ;vertical_shooting_demo_explosion_upd3 5258 b747 00 00 HEX 0000 5259 b749 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 5260 b749 15 54 HEX 1554 5261 b74b ;vertical_shooting_demo_explosion_upd4 5262 b74b 00 00 HEX 0000 5263 b74d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 5264 b74d 07 d0 HEX 07d0 5265 b74f ;vertical_shooting_demo_explosion_upd5 5266 b74f 01 40 HEX 0140 5267 b751 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 5268 b751 0c 30 HEX 0c30 5269 b753 ;vertical_shooting_demo_explosion_upd6 5270 b753 01 40 HEX 0140 5271 b755 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 5272 b755 00 00 HEX 0000 5273 b757 ;vertical_shooting_demo_explosion_upd7 5274 b757 01 40 HEX 0140 5275 b759 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 5276 b759 00 00 HEX 0000 5277 b75b ;vertical_shooting_demo_explosion_upd8 5278 b75b 01 40 HEX 0140 5279 b75d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 5280 b75d 00 00 HEX 0000 5281 b75f ;vertical_shooting_demo_explosion_upd9 5282 b75f 01 40 HEX 0140 5283 b761 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 5284 b761 00 00 HEX 0000 5285 b763 ;vertical_shooting_demo_explosion_upd10 5286 b763 01 40 HEX 0140 5287 b765 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 5288 b765 00 00 HEX 0000 5289 b767 ;vertical_shooting_laser 5290 b767 44 HEX 44 5291 b768 ;vertical_shooting_laser_tallsprite_00 5292 b768 88 HEX 88 5293 b769 5294 b800 ORG $B800,0 ; ************* 5295 b800 5296 b800 RORG $B800 ; ************* 5297 b800 - if SPACEOVERFLOW > 0 5298 b800 - echo "" 5299 b800 - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 5300 b800 - echo "######## look above for areas with negative ROM space left." 5301 b800 - echo "######## Aborting assembly." 5302 b800 - ERR 5303 b800 endif 5304 b800 5305 b800 5306 b800 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5307 b800 5308 b800 - ifnconst bankswitchmode 5309 b800 - if ( * < $f000 ) 5310 b800 - ORG $F000 5311 b800 - endif 5312 b800 else 5313 b800 ifconst ROM128K 5314 b800 if ( * < $f000 ) 5315 27000 ORG $27000 5316 27000 RORG $F000 5317 27000 endif 5318 27000 endif 5319 27000 - ifconst ROM144K 5320 27000 - if ( * < $f000 ) 5321 27000 - ORG $27000 5322 27000 - RORG $F000 5323 27000 - endif 5324 27000 endif 5325 27000 - ifconst ROM256K 5326 27000 - if ( * < $f000 ) 5327 27000 - ORG $47000 5328 27000 - RORG $F000 5329 27000 - endif 5330 27000 endif 5331 27000 - ifconst ROM272K 5332 27000 - if ( * < $f000 ) 5333 27000 - ORG $47000 5334 27000 - RORG $F000 5335 27000 - endif 5336 27000 endif 5337 27000 - ifconst ROM512K 5338 27000 - if ( * < $f000 ) 5339 27000 - ORG $87000 5340 27000 - RORG $F000 5341 27000 - endif 5342 27000 endif 5343 27000 - ifconst ROM528K 5344 27000 - if ( * < $f000 ) 5345 27000 - ORG $87000 5346 27000 - RORG $F000 5347 27000 - endif 5348 27000 endif 5349 27000 endif 5350 27000 5351 27000 ; all of these "modules" have conditional clauses in them, so even though 5352 27000 ; they're always included here, they don't take up rom unless the user 5353 27000 ; explicitly enables support for the feature. 5354 27000 5355 27000 ifnconst included.rmtplayer.asm ------- FILE rmtplayer.asm LEVEL 2 PASS 3 0 27000 include rmtplayer.asm ; requires page alignment, so go first 1 27000 - ifconst RMT 2 27000 - 3 27000 -rmtmodulestart 4 27000 - 5 27000 - ;* 6 27000 - ;* Raster Music Tracker, RMT Atari routine version 1.20030223 7 27000 - ;* (c) Radek Sterba, Raster/C.P.U., 2002 - 2003 8 27000 - ;* http://raster.atari.org 9 27000 - ;* 10 27000 - ;* Some small changes to allow using this code with DASM cross assembler and 11 27000 - ;* to compile for cartridge based systems, like the Atari 5200 or Atari 7800, 12 27000 - ;* by Eckhard Stolberg ( http://home.arcor.de/estolberg/ ). 13 27000 - ;* 14 27000 - ;* Warnings: 15 27000 - ;* 16 27000 - ;* 1. RMT player routine needs 19 itself reserved bytes in zero page (no accessed 17 27000 - ;* from any other routines) as well as cca 1KB of memory before the "PLAYER" 18 27000 - ;* address for frequency tables and functionary variables. It's: 19 27000 - ;* a) from PLAYER-$400 to PLAYER for stereo RMTplayer 20 27000 - ;* b) from PLAYER-$380 to PLAYER for mono RMTplayer 21 27000 - ;* 22 27000 - ;* note: This has been changed for 5200 & 7800 compatibility. Now PLAYER points 23 27000 - ;* to the start of the frequency tables. The player routines follows after 24 27000 - ;* that. The variables are now independent and can be located with 25 27000 - ;* PLAYER_VAR_RAM and PLAYER_ZP_RAM (see below): 26 27000 - ;* 27 27000 - ;* 2. RMT player routine MUST (!!!) be compiled from the begin of the memory page. 28 27000 - ;* i.e. "PLAYER" address can be $..00 only! 29 27000 - ;* 30 27000 - ;* 3. Because of RMTplayer provides a lot of effects, it spent a lot of CPU time. 31 27000 - ;* 32 27000 - ;* 33 27000 - ;* Define the following equates here or in your main code file. 34 27000 - ;* Set the values according to the system you compile for. 35 27000 - ;* 36 27000 - 37 27000 -POKEY_BASE equ pokeyaddress 38 27000 -PLAYER_ZP_RAM equ songchannel1layer1lo ; player routine needs 19 bytes of zero page RAM 39 27000 -PLAYER_VAR_RAM equ RMTRAM ;variables in main RAM - 173 bytes mono - 337 stereo 40 27000 -ROM_BASED equ 1 ;using a ROM based system - no self modifying code 41 27000 -STEREO8T equ 0 ;0 => compile RMTplayer for mono 4 tracks 42 27000 - ; ;1 => compile RMTplayer for stereo 8 tracks 43 27000 - 44 27000 -rmt_ispeed equ PLAYER_ZP_RAM+19 45 27000 -rmt_intcount equ PLAYER_ZP_RAM+20 46 27000 - 47 27000 - ;* 48 27000 - 49 27000 - IF STEREO8T 50 27000 -TRACKS equ 8 51 27000 - ELSE 52 27000 -TRACKS equ 4 53 27000 - EIF 54 27000 - 55 27000 - ;* 56 27000 - ;* RMT FEATures definitions 57 27000 - ;* For optimizations of RMT player routine to concrete RMT modul only! 58 27000 - ;* --------BEGIN-------- 59 27000 -FEAT_COMMAND1 equ 1 ;* cca 8 bytes 60 27000 -FEAT_COMMAND2 equ 1 ;* cca 20 bytes (+save 1 address in zero page) and quicker whole RMT routine 61 27000 -FEAT_COMMAND3 equ 1 ;* cca 12 bytes 62 27000 -FEAT_COMMAND4 equ 1 ;* cca 15 bytes 63 27000 -FEAT_COMMAND5 equ 1 ;* cca 67 bytes 64 27000 -FEAT_COMMAND6 equ 1 ;* cca 15 bytes 65 27000 - ;* COMMAND7 SETNOTE (i.e. command 7 with parameter != $80) 66 27000 -FEAT_COMMAND7SETNOTE equ 1 ;* cca 12 bytes 67 27000 - ;* COMMAND7 VOLUMEONLY (i.e. command 7 with parameter == $80) 68 27000 -FEAT_COMMAND7VOLUMEONLY equ 1 ;* cca 74 bytes 69 27000 - ;* PORTAMENTO 70 27000 -FEAT_PORTAMENTO equ 1 ;* cca 138 bytes and quicker whole RMT routine 71 27000 - ;* FILTER 72 27000 -FEAT_FILTER equ 1 ;* cca 179 bytes and quicker whole RMT routine 73 27000 -FEAT_FILTERG0L equ 1 ;* (cca 38 bytes for each) 74 27000 -FEAT_FILTERG1L equ 1 75 27000 -FEAT_FILTERG0R equ 1 76 27000 -FEAT_FILTERG1R equ 1 77 27000 - ;* BASS16B (i.e. distortion value 6) 78 27000 -FEAT_BASS16 equ 1 ;* cca 194 bytes +128bytes freq table and quicker whole RMT routine 79 27000 -FEAT_BASS16G1L equ 1 ;* (cca 47 bytes for each) 80 27000 -FEAT_BASS16G3L equ 1 81 27000 -FEAT_BASS16G1R equ 1 82 27000 -FEAT_BASS16G3R equ 1 83 27000 - ;* VOLUME ONLY for particular generators 84 27000 -FEAT_VOLUMEONLYG0L equ 1 ;* (cca 7 bytes for each) 85 27000 -FEAT_VOLUMEONLYG2L equ 1 86 27000 -FEAT_VOLUMEONLYG3L equ 1 87 27000 -FEAT_VOLUMEONLYG0R equ 1 88 27000 -FEAT_VOLUMEONLYG2R equ 1 89 27000 -FEAT_VOLUMEONLYG3R equ 1 90 27000 - ;* TABLE TYPE (i.e. TABLETYPE=1) 91 27000 -FEAT_TABLETYPE equ 1 ;* cca 53 bytes and quicker whole RMT routine 92 27000 - ;* TABLE MODE (i.e. TABLEMODE=1) 93 27000 -FEAT_TABLEMODE equ 1 ;* cca 16 bytes and quicker whole RMT routine 94 27000 - ;* AUDCTLMANUALSET (i.e. any MANUAL AUDCTL setting to nonzero value) 95 27000 -FEAT_AUDCTLMANUALSET equ 1 ;* cca 27 bytes and quicker whole RMT routine 96 27000 - ;* --------END-------- 97 27000 - ;* 98 27000 - ;* 99 27000 - ;* RMT ZeroPage addresses 100 27000 - 101 27000 -MEMLOC SET PLAYER_ZP_RAM 102 27000 -p_tis = MEMLOC 103 27000 -p_instrstable = MEMLOC 104 27000 -MEMLOC SET (MEMLOC+2) 105 27000 -p_trackslbstable = MEMLOC 106 27000 -MEMLOC SET (MEMLOC+2) 107 27000 -p_trackshbstable = MEMLOC 108 27000 -MEMLOC SET (MEMLOC+2) 109 27000 -p_song = MEMLOC 110 27000 -MEMLOC SET (MEMLOC+2) 111 27000 - 112 27000 -_ns = MEMLOC 113 27000 -MEMLOC SET (MEMLOC+2) 114 27000 -_nr = MEMLOC 115 27000 -MEMLOC SET (MEMLOC+2) 116 27000 -_nt = MEMLOC 117 27000 -MEMLOC SET (MEMLOC+2) 118 27000 - 119 27000 -rmtreg1 = MEMLOC 120 27000 -MEMLOC SET (MEMLOC+1) 121 27000 -rmtreg2 = MEMLOC 122 27000 -MEMLOC SET (MEMLOC+1) 123 27000 -rmtreg3 = MEMLOC 124 27000 -MEMLOC SET (MEMLOC+1) 125 27000 -_tmp = MEMLOC 126 27000 -MEMLOC SET (MEMLOC+1) 127 27000 - IF FEAT_COMMAND2 128 27000 -frqaddcmd2 = MEMLOC 129 27000 -MEMLOC SET (MEMLOC+1) 130 27000 - EIF 131 27000 - 132 27000 - ;* 133 27000 - ;* Variables in main RAM used by player routine. 134 27000 - ;* 337 bytes for stereo - 173 bytes for mono 135 27000 - ;* 136 27000 - 137 27000 -MEMLOC SET PLAYER_VAR_RAM 138 27000 -track_variables = MEMLOC 139 27000 - 140 27000 -trackn_db = MEMLOC 141 27000 -MEMLOC SET (MEMLOC+TRACKS) 142 27000 -trackn_hb = MEMLOC 143 27000 -MEMLOC SET (MEMLOC+TRACKS) 144 27000 -trackn_idx = MEMLOC 145 27000 -MEMLOC SET (MEMLOC+TRACKS) 146 27000 -trackn_pause = MEMLOC 147 27000 -MEMLOC SET (MEMLOC+TRACKS) 148 27000 -trackn_note = MEMLOC 149 27000 -MEMLOC SET (MEMLOC+TRACKS) 150 27000 -trackn_volume = MEMLOC 151 27000 -MEMLOC SET (MEMLOC+TRACKS) 152 27000 -trackn_distor = MEMLOC 153 27000 -MEMLOC SET (MEMLOC+TRACKS) 154 27000 -trackn_shiftfrq = MEMLOC 155 27000 -MEMLOC SET (MEMLOC+TRACKS) 156 27000 - 157 27000 - IF FEAT_PORTAMENTO 158 27000 -trackn_portafrqc = MEMLOC 159 27000 -MEMLOC SET (MEMLOC+TRACKS) 160 27000 -trackn_portafrqa = MEMLOC 161 27000 -MEMLOC SET (MEMLOC+TRACKS) 162 27000 -trackn_portaspeed = MEMLOC 163 27000 -MEMLOC SET (MEMLOC+TRACKS) 164 27000 -trackn_portaspeeda = MEMLOC 165 27000 -MEMLOC SET (MEMLOC+TRACKS) 166 27000 -trackn_portadepth = MEMLOC 167 27000 -MEMLOC SET (MEMLOC+TRACKS) 168 27000 - EIF 169 27000 - 170 27000 -trackn_instrx2 = MEMLOC 171 27000 -MEMLOC SET (MEMLOC+TRACKS) 172 27000 -trackn_instrdb = MEMLOC 173 27000 -MEMLOC SET (MEMLOC+TRACKS) 174 27000 -trackn_instrhb = MEMLOC 175 27000 -MEMLOC SET (MEMLOC+TRACKS) 176 27000 -trackn_instridx = MEMLOC 177 27000 -MEMLOC SET (MEMLOC+TRACKS) 178 27000 -trackn_instrlen = MEMLOC 179 27000 -MEMLOC SET (MEMLOC+TRACKS) 180 27000 -trackn_instrlop = MEMLOC 181 27000 -MEMLOC SET (MEMLOC+TRACKS) 182 27000 -trackn_instrreachend = MEMLOC 183 27000 -MEMLOC SET (MEMLOC+TRACKS) 184 27000 -trackn_volumeslidedepth = MEMLOC 185 27000 -MEMLOC SET (MEMLOC+TRACKS) 186 27000 -trackn_volumeslidevalue = MEMLOC 187 27000 -MEMLOC SET (MEMLOC+TRACKS) 188 27000 -trackn_volumemin = MEMLOC 189 27000 -MEMLOC SET (MEMLOC+TRACKS) 190 27000 -trackn_effdelay = MEMLOC 191 27000 -MEMLOC SET (MEMLOC+TRACKS) 192 27000 -trackn_effvibratoa = MEMLOC 193 27000 -MEMLOC SET (MEMLOC+TRACKS) 194 27000 -trackn_effvibratobeg = MEMLOC 195 27000 -MEMLOC SET (MEMLOC+TRACKS) 196 27000 -trackn_effvibratoend = MEMLOC 197 27000 -MEMLOC SET (MEMLOC+TRACKS) 198 27000 -trackn_effshift = MEMLOC 199 27000 -MEMLOC SET (MEMLOC+TRACKS) 200 27000 -trackn_tabletypespeed = MEMLOC 201 27000 -MEMLOC SET (MEMLOC+TRACKS) 202 27000 - 203 27000 - IF FEAT_TABLEMODE 204 27000 -trackn_tablemode = MEMLOC 205 27000 -MEMLOC SET (MEMLOC+TRACKS) 206 27000 - EIF 207 27000 - 208 27000 -trackn_tablenote = MEMLOC 209 27000 -MEMLOC SET (MEMLOC+TRACKS) 210 27000 - 211 27000 -trackn_tablea = MEMLOC 212 27000 -MEMLOC SET (MEMLOC+TRACKS) 213 27000 -trackn_tableend = MEMLOC 214 27000 -MEMLOC SET (MEMLOC+TRACKS) 215 27000 -trackn_tablelop = MEMLOC 216 27000 -MEMLOC SET (MEMLOC+TRACKS) 217 27000 -trackn_tablespeeda = MEMLOC 218 27000 -MEMLOC SET (MEMLOC+TRACKS) 219 27000 -trackn_command = MEMLOC 220 27000 -MEMLOC SET (MEMLOC+TRACKS) 221 27000 - 222 27000 - IF FEAT_BASS16 223 27000 -trackn_outnote = MEMLOC 224 27000 -MEMLOC SET (MEMLOC+TRACKS) 225 27000 - EIF 226 27000 - IF FEAT_FILTER 227 27000 -trackn_filter = MEMLOC 228 27000 -MEMLOC SET (MEMLOC+TRACKS) 229 27000 - EIF 230 27000 - 231 27000 -trackn_audf = MEMLOC 232 27000 -MEMLOC SET (MEMLOC+TRACKS) 233 27000 -trackn_audc = MEMLOC 234 27000 -MEMLOC SET (MEMLOC+TRACKS) 235 27000 - 236 27000 - IF FEAT_AUDCTLMANUALSET 237 27000 -trackn_audctl = MEMLOC 238 27000 -MEMLOC SET (MEMLOC+TRACKS) 239 27000 - EIF 240 27000 - 241 27000 -v_audctl = MEMLOC 242 27000 -MEMLOC SET (MEMLOC+1) 243 27000 -v_audctl2 = MEMLOC 244 27000 -MEMLOC SET (MEMLOC+1) 245 27000 -v_speed = MEMLOC 246 27000 -MEMLOC SET (MEMLOC+1) 247 27000 -v_aspeed = MEMLOC 248 27000 -MEMLOC SET (MEMLOC+1) 249 27000 -v_bspeed = MEMLOC 250 27000 -MEMLOC SET (MEMLOC+1) 251 27000 -v_instrspeed = MEMLOC 252 27000 -MEMLOC SET (MEMLOC+1) 253 27000 -v_ainstrspeed = MEMLOC 254 27000 -MEMLOC SET (MEMLOC+1) 255 27000 -v_maxtracklen = MEMLOC 256 27000 -MEMLOC SET (MEMLOC+1) 257 27000 -v_abeat = MEMLOC 258 27000 -MEMLOC SET (MEMLOC+1) 259 27000 - 260 27000 -track_endvariables = MEMLOC 261 27000 - 262 27000 - ;* 263 27000 - ;* Data tables used by player routine. 264 27000 - ;* 265 27000 - ALIGN 256 266 27000 -PLAYER = . 267 27000 - 268 27000 -volumetab 269 27000 - dc.b $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 270 27000 - dc.b $00,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01 271 27000 - dc.b $00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$02,$02,$02,$02 272 27000 - dc.b $00,$00,$00,$01,$01,$01,$01,$01,$02,$02,$02,$02,$02,$03,$03,$03 273 27000 - dc.b $00,$00,$01,$01,$01,$01,$02,$02,$02,$02,$03,$03,$03,$03,$04,$04 274 27000 - dc.b $00,$00,$01,$01,$01,$02,$02,$02,$03,$03,$03,$04,$04,$04,$05,$05 275 27000 - dc.b $00,$00,$01,$01,$02,$02,$02,$03,$03,$04,$04,$04,$05,$05,$06,$06 276 27000 - dc.b $00,$00,$01,$01,$02,$02,$03,$03,$04,$04,$05,$05,$06,$06,$07,$07 277 27000 - dc.b $00,$01,$01,$02,$02,$03,$03,$04,$04,$05,$05,$06,$06,$07,$07,$08 278 27000 - dc.b $00,$01,$01,$02,$02,$03,$04,$04,$05,$05,$06,$07,$07,$08,$08,$09 279 27000 - dc.b $00,$01,$01,$02,$03,$03,$04,$05,$05,$06,$07,$07,$08,$09,$09,$0A 280 27000 - dc.b $00,$01,$01,$02,$03,$04,$04,$05,$06,$07,$07,$08,$09,$0A,$0A,$0B 281 27000 - dc.b $00,$01,$02,$02,$03,$04,$05,$06,$06,$07,$08,$09,$0A,$0A,$0B,$0C 282 27000 - dc.b $00,$01,$02,$03,$03,$04,$05,$06,$07,$08,$09,$0A,$0A,$0B,$0C,$0D 283 27000 - dc.b $00,$01,$02,$03,$04,$05,$06,$07,$07,$08,$09,$0A,$0B,$0C,$0D,$0E 284 27000 - dc.b $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0A,$0B,$0C,$0D,$0E,$0F 285 27000 - 286 27000 -frqtab 287 27000 - ; ERT [255 355 27000 - ldy #0 356 27000 - tya 357 27000 -rmtri0 sta track_variables,y 358 27000 - sta track_endvariables-$100,y 359 27000 - iny 360 27000 - bne rmtri0 361 27000 - ELSE 362 27000 - ldy #track_endvariables-track_variables 363 27000 - lda #0 364 27000 -rmtri0 sta track_variables-1,y 365 27000 - dey 366 27000 - bne rmtri0 367 27000 - EIF 368 27000 - ldy #4 369 27000 - lda (_ns),y 370 27000 - sta v_maxtracklen 371 27000 - iny 372 27000 - lda (_ns),y 373 27000 - sta v_speed 374 27000 - iny 375 27000 - lda (_ns),y 376 27000 - sta v_instrspeed 377 27000 - sta v_ainstrspeed 378 27000 - ldy #8 379 27000 -rmtri1 lda (_ns),y 380 27000 - sta p_tis-8,y 381 27000 - iny 382 27000 - cpy #8+8 383 27000 - bne rmtri1 384 27000 - pla 385 27000 - pha 386 27000 - IF STEREO8T 387 27000 - asl 388 27000 - asl 389 27000 - asl 390 27000 - clc 391 27000 - adc p_song 392 27000 - sta p_song 393 27000 - pla 394 27000 - and #$e0 395 27000 - asl 396 27000 - rol 397 27000 - rol 398 27000 - rol 399 27000 - ELSE 400 27000 - asl 401 27000 - asl 402 27000 - clc 403 27000 - adc p_song 404 27000 - sta p_song 405 27000 - pla 406 27000 - and #$c0 407 27000 - asl 408 27000 - rol 409 27000 - rol 410 27000 - EIF 411 27000 - adc p_song+1 412 27000 - sta p_song+1 413 27000 - jsr GetSongLine 414 27000 - jsr GetTrackLine 415 27000 - jsr InitOfNewSetInstrumentsOnly 416 27000 - jsr rmt_silence 417 27000 - lda v_instrspeed 418 27000 - rts 419 27000 -rmt_silence 420 27000 - IF STEREO8T 421 27000 - lda #0 422 27000 - sta POKEY_BASE+$08 423 27000 - sta POKEY_BASE_S+$08 424 27000 - ldy #3 425 27000 - sty POKEY_BASE+$0f 426 27000 - sty POKEY_BASE_S+$0f 427 27000 - ldy #8 428 27000 -rmtsi1 sta POKEY_BASE+$00,y 429 27000 - sta POKEY_BASE_S+$00,y 430 27000 - dey 431 27000 - bpl rmtsi1 432 27000 - ELSE 433 27000 - lda #0 434 27000 - sta POKEY_BASE+$08 435 27000 - ldy #3 436 27000 - sty POKEY_BASE+$0f 437 27000 - ldy #8 438 27000 -rmtsi1 sta POKEY_BASE+$00,y 439 27000 - dey 440 27000 - bpl rmtsi1 441 27000 - EIF 442 27000 - rts 443 27000 -GetSongLine 444 27000 - ldx #0 445 27000 - stx v_abeat 446 27000 -rmtnn0 447 27000 - ldx #0 448 27000 -rmtnn1 txa 449 27000 - tay 450 27000 - lda (p_song),y 451 27000 - cmp #$fe 452 27000 - bcs rmtnn2 453 27000 - tay 454 27000 - lda (p_trackslbstable),y 455 27000 - sta trackn_db,x 456 27000 - lda (p_trackshbstable),y 457 27000 -rmtnn1a sta trackn_hb,x 458 27000 - lda #0 459 27000 - sta trackn_idx,x 460 27000 - lda #1 461 27000 - sta trackn_pause,x 462 27000 - lda #$80 463 27000 - sta trackn_instrx2,x 464 27000 - inx 465 27000 - cpx #TRACKS 466 27000 - bne rmtnn1 467 27000 - lda p_song 468 27000 - clc 469 27000 - adc #TRACKS 470 27000 - sta p_song 471 27000 - bcc rmtnn1b 472 27000 - inc p_song+1 473 27000 -rmtnn1b 474 27000 - rts 475 27000 -rmtnn2 476 27000 - beq rmtnn3 477 27000 -rmtnn2a lda #emptytrack 480 27000 - jmp rmtnn1a 481 27000 -rmtnn3 482 27000 - ldy #2 483 27000 - lda (p_song),y 484 27000 - tax 485 27000 - iny 486 27000 - lda (p_song),y 487 27000 - sta p_song+1 488 27000 - stx p_song 489 27000 - jmp rmtnn0 490 27000 -GetTrackLine 491 27000 -rmtoo0 492 27000 -rmtoo0a 493 27000 - lda v_speed 494 27000 - sta v_bspeed 495 27000 - ldx #0 496 27000 -rmtoo1 497 27000 - lda trackn_pause,x 498 27000 - beq rmtoo1x 499 27000 - dec trackn_pause,x 500 27000 - bne rmtoo1x 501 27000 - inc trackn_pause,x 502 27000 -rmtoo1b 503 27000 - lda trackn_db,x 504 27000 - sta _ns 505 27000 - lda trackn_hb,x 506 27000 - sta _ns+1 507 27000 -rmtoo1i 508 27000 - ldy trackn_idx,x 509 27000 - lda (_ns),y 510 27000 - sta rmtreg1 511 27000 - iny 512 27000 - lda (_ns),y 513 27000 - sta rmtreg2 514 27000 - iny 515 27000 - tya 516 27000 - sta trackn_idx,x 517 27000 - lda rmtreg1 518 27000 - and #$3f 519 27000 - cmp #61 520 27000 - beq rmtoo1a 521 27000 - bcs rmtoo2 522 27000 - sta trackn_note,x 523 27000 - IF FEAT_BASS16 524 27000 - sta trackn_outnote,x 525 27000 - EIF 526 27000 - lda rmtreg2 527 27000 - lsr 528 27000 - and #$3f*2 529 27000 - sta trackn_instrx2,x 530 27000 -rmtoo1a lda rmtreg2 531 27000 - lsr 532 27000 - ror rmtreg1 533 27000 - lsr 534 27000 - ror rmtreg1 535 27000 - lda rmtreg1 536 27000 - and #$f0 537 27000 - sta trackn_volume,x 538 27000 -rmtoo1x 539 27000 - inx 540 27000 - cpx #TRACKS 541 27000 - bne rmtoo1 542 27000 - lda v_bspeed 543 27000 - sta v_speed 544 27000 - sta v_aspeed 545 27000 - rts 546 27000 -rmtoo2 547 27000 - cmp #63 548 27000 - beq rmtoo63 549 27000 - lda rmtreg1 550 27000 - and #$c0 551 27000 - beq rmtoo62_b 552 27000 - asl 553 27000 - rol 554 27000 - rol 555 27000 - sta trackn_pause,x 556 27000 - dec trackn_idx,x 557 27000 - jmp rmtoo1x 558 27000 -rmtoo62_b 559 27000 - lda rmtreg2 560 27000 - sta trackn_pause,x 561 27000 - jmp rmtoo1x 562 27000 -rmtoo63 563 27000 - lda rmtreg1 564 27000 - bmi rmtoo63_1X 565 27000 - lda rmtreg2 566 27000 - sta v_bspeed 567 27000 - jmp rmtoo1i 568 27000 -rmtoo63_1X 569 27000 - cmp #255 570 27000 - beq rmtoo63_11 571 27000 - lda rmtreg2 572 27000 - sta trackn_idx,x 573 27000 - jmp rmtoo1i 574 27000 -rmtoo63_11 575 27000 - jsr GetSongLine 576 27000 - jmp rmtoo0 577 27000 -InitOfNewSetInstrumentsOnly 578 27000 - ldx #0 579 27000 -p2x1 ldy trackn_instrx2,x 580 27000 - bmi p2x2 581 27000 - jsr SetUpInstrumentY2 582 27000 - lda #$80 583 27000 - sta trackn_instrx2,x 584 27000 -p2x2 585 27000 - inx 586 27000 - cpx #TRACKS 587 27000 - bne p2x1 588 27000 - rts 589 27000 -rmt_play 590 27000 -rmt_p0 591 27000 - jsr SetPokey 592 27000 -rmt_p1 593 27000 - dec v_ainstrspeed 594 27000 - beq rmtp1a 595 27000 - jmp rmt_p3 596 27000 -rmtp1a 597 27000 - lda v_instrspeed 598 27000 - sta v_ainstrspeed 599 27000 -rmt_p2 600 27000 - dec v_aspeed 601 27000 - bne rmt_p3 602 27000 - inc v_abeat 603 27000 - lda v_abeat 604 27000 - cmp v_maxtracklen 605 27000 - bne rmtp2o2 606 27000 - jsr GetSongLine 607 27000 -rmtp2o2 608 27000 - jsr GetTrackLine 609 27000 - jmp rmt_p2X 610 27000 -go_ppnext jmp ppnext 611 27000 -rmt_p2X 612 27000 - jsr InitOfNewSetInstrumentsOnly 613 27000 -rmt_p3 614 27000 - lda #>frqtab 615 27000 - sta _nr+1 616 27000 - ldx #0 617 27000 -rmtpp1 618 27000 - lda trackn_instrhb,x 619 27000 - beq go_ppnext 620 27000 - sta _ns+1 621 27000 - lda trackn_instrdb,x 622 27000 - sta _ns 623 27000 - ldy trackn_instridx,x 624 27000 - lda (_ns),y 625 27000 - sta rmtreg1 626 27000 - iny 627 27000 - lda (_ns),y 628 27000 - sta rmtreg2 629 27000 - iny 630 27000 - lda (_ns),y 631 27000 - sta rmtreg3 632 27000 - iny 633 27000 - tya 634 27000 - cmp trackn_instrlen,x 635 27000 - bcc rmtpp2 636 27000 - beq rmtpp2 637 27000 - lda #$80 638 27000 - sta trackn_instrreachend,x 639 27000 -rmtpp1b 640 27000 - lda trackn_instrlop,x 641 27000 -rmtpp2 sta trackn_instridx,x 642 27000 - lda rmtreg1 643 27000 - IF STEREO8T 644 27000 - cpx #4 645 27000 - bcc rmtpp2s 646 27000 - lsr 647 27000 - lsr 648 27000 - lsr 649 27000 - lsr 650 27000 -rmtpp2s 651 27000 - EIF 652 27000 - and #$0f 653 27000 - ora trackn_volume,x 654 27000 - tay 655 27000 - lda volumetab,y 656 27000 - pha 657 27000 - lda rmtreg2 658 27000 - and #$0e 659 27000 - tay 660 27000 - lda tabbeganddistor,y 661 27000 - sta _nr 662 27000 - pla 663 27000 - ora tabbeganddistor+1,y 664 27000 - sta trackn_audc,x 665 27000 - jmp InstrumentsEffects 666 27000 -returnfromInstrumentsEffects 667 27000 - IF FEAT_COMMAND2 668 27000 - lda #0 669 27000 - sta frqaddcmd2 670 27000 - EIF 671 27000 - lda rmtreg2 672 27000 - sta trackn_command,x 673 27000 - and #$70 674 27000 - lsr 675 27000 - lsr 676 27000 - IF ROM_BASED 677 27000 - lsr 678 27000 - tay 679 27000 - lda rts_tab+1,y 680 27000 - pha 681 27000 - lda rts_tab,y 682 27000 - pha 683 27000 - rts 684 27000 - ELSE 685 27000 - sta jmx+1 686 27000 -jmx bcc * 687 27000 - jmp cmd0 688 27000 - nop 689 27000 - jmp cmd1 690 27000 - nop 691 27000 - jmp cmd2 692 27000 - nop 693 27000 - jmp cmd3 694 27000 - nop 695 27000 - jmp cmd4 696 27000 - nop 697 27000 - jmp cmd5 698 27000 - nop 699 27000 - jmp cmd6 700 27000 - nop 701 27000 - jmp cmd7 702 27000 - EIF 703 27000 -cmd0 704 27000 - lda trackn_note,x 705 27000 - clc 706 27000 - adc rmtreg3 707 27000 -cmd0a 708 27000 - IF FEAT_TABLETYPE 709 27000 - ldy trackn_tabletypespeed,x 710 27000 - bmi cmd0b 711 27000 - EIF 712 27000 - clc 713 27000 - adc trackn_tablenote,x 714 27000 - cmp #61 715 27000 - bcc cmd0a1 716 27000 - lda #0 717 27000 - sta trackn_audc,x 718 27000 - lda #63 719 27000 -cmd0a1 720 27000 - IF FEAT_BASS16 721 27000 - sta trackn_outnote,x 722 27000 - EIF 723 27000 - tay 724 27000 - lda (_nr),y 725 27000 - clc 726 27000 - adc trackn_shiftfrq,x 727 27000 - IF FEAT_COMMAND2 728 27000 - clc 729 27000 - adc frqaddcmd2 730 27000 - EIF 731 27000 - sta trackn_audf,x 732 27000 - jmp rmtpp9 733 27000 - IF FEAT_TABLETYPE 734 27000 -cmd0b 735 27000 - cmp #61 736 27000 - bcc cmd0b1 737 27000 - lda #0 738 27000 - sta trackn_audc,x 739 27000 - lda #63 740 27000 -cmd0b1 741 27000 - tay 742 27000 - lda trackn_shiftfrq,x 743 27000 - clc 744 27000 - adc trackn_tablenote,x 745 27000 - clc 746 27000 - adc (_nr),y 747 27000 - IF FEAT_COMMAND2 748 27000 - clc 749 27000 - adc frqaddcmd2 750 27000 - EIF 751 27000 - sta trackn_audf,x 752 27000 - jmp rmtpp9 753 27000 - EIF 754 27000 -cmd1 755 27000 - IF FEAT_COMMAND1 756 27000 - lda rmtreg3 757 27000 - sta trackn_audf,x 758 27000 - jmp rmtpp9 759 27000 - EIF 760 27000 -cmd2 761 27000 - IF FEAT_COMMAND2 762 27000 - lda rmtreg3 763 27000 - sta frqaddcmd2 764 27000 - lda trackn_note,x 765 27000 - jmp cmd0a 766 27000 - EIF 767 27000 -cmd3 768 27000 - IF FEAT_COMMAND3 769 27000 - lda trackn_note,x 770 27000 - clc 771 27000 - adc rmtreg3 772 27000 - sta trackn_note,x 773 27000 - jmp cmd0a 774 27000 - EIF 775 27000 -cmd4 776 27000 - IF FEAT_COMMAND4 777 27000 - lda trackn_shiftfrq,x 778 27000 - clc 779 27000 - adc rmtreg3 780 27000 - sta trackn_shiftfrq,x 781 27000 - lda trackn_note,x 782 27000 - jmp cmd0a 783 27000 - EIF 784 27000 -cmd5 785 27000 - IF FEAT_COMMAND5&&FEAT_PORTAMENTO 786 27000 - IF FEAT_TABLETYPE 787 27000 - lda trackn_tabletypespeed,x 788 27000 - bpl cmd5a1 789 27000 - ldy trackn_note,x 790 27000 - lda (_nr),y 791 27000 - clc 792 27000 - adc trackn_tablenote,x 793 27000 - jmp cmd5ax 794 27000 - EIF 795 27000 -cmd5a1 796 27000 - lda trackn_note,x 797 27000 - clc 798 27000 - adc trackn_tablenote,x 799 27000 - cmp #61 800 27000 - bcc cmd5a2 801 27000 - lda #63 802 27000 -cmd5a2 803 27000 - tay 804 27000 - lda (_nr),y 805 27000 -cmd5ax 806 27000 - sta trackn_portafrqc,x 807 27000 - ldy rmtreg3 808 27000 - bne cmd5a 809 27000 - sta trackn_portafrqa,x 810 27000 -cmd5a 811 27000 - tya 812 27000 - lsr 813 27000 - lsr 814 27000 - lsr 815 27000 - lsr 816 27000 - sta trackn_portaspeed,x 817 27000 - sta trackn_portaspeeda,x 818 27000 - lda rmtreg3 819 27000 - and #$0f 820 27000 - sta trackn_portadepth,x 821 27000 - lda trackn_note,x 822 27000 - jmp cmd0a 823 27000 - ELSE 824 27000 - IF FEAT_COMMAND5 825 27000 - jmp rmtpp9 826 27000 - EIF 827 27000 - EIF 828 27000 -cmd6 829 27000 - IF FEAT_COMMAND6&&FEAT_FILTER 830 27000 - lda rmtreg3 831 27000 - clc 832 27000 - adc trackn_filter,x 833 27000 - sta trackn_filter,x 834 27000 - lda trackn_note,x 835 27000 - jmp cmd0a 836 27000 - ELSE 837 27000 - IF FEAT_COMMAND6 838 27000 - jmp rmtpp9 839 27000 - EIF 840 27000 - EIF 841 27000 -cmd7 842 27000 - IF FEAT_COMMAND7SETNOTE||FEAT_COMMAND7VOLUMEONLY 843 27000 - IF FEAT_COMMAND7SETNOTE 844 27000 - lda rmtreg3 845 27000 - IF FEAT_COMMAND7VOLUMEONLY 846 27000 - cmp #$80 847 27000 - beq cmd7a 848 27000 - EIF 849 27000 - sta trackn_note,x 850 27000 - jmp cmd0a 851 27000 - EIF 852 27000 - IF FEAT_COMMAND7VOLUMEONLY 853 27000 -cmd7a 854 27000 - lda trackn_audc,x 855 27000 - ora #$f0 856 27000 - sta trackn_audc,x 857 27000 - lda trackn_note,x 858 27000 - jmp cmd0a 859 27000 - EIF 860 27000 - EIF 861 27000 -rmtpp9 862 27000 - IF FEAT_PORTAMENTO 863 27000 - lda trackn_portaspeeda,x 864 27000 - beq rmtpp10 865 27000 - sec 866 27000 - sbc #1 867 27000 - sta trackn_portaspeeda,x 868 27000 - bne rmtpp10 869 27000 - lda trackn_portaspeed,x 870 27000 - sta trackn_portaspeeda,x 871 27000 - lda trackn_portafrqa,x 872 27000 - cmp trackn_portafrqc,x 873 27000 - beq rmtpp10 874 27000 - bcs pps1 875 27000 - adc trackn_portadepth,x 876 27000 - bcs pps8 877 27000 - cmp trackn_portafrqc,x 878 27000 - bcs pps8 879 27000 - jmp pps9 880 27000 -pps1 881 27000 - sbc trackn_portadepth,x 882 27000 - bcc pps8 883 27000 - cmp trackn_portafrqc,x 884 27000 - bcs pps9 885 27000 -pps8 886 27000 - lda trackn_portafrqc,x 887 27000 -pps9 888 27000 - sta trackn_portafrqa,x 889 27000 -rmtpp10 890 27000 - lda rmtreg2 891 27000 - and #$01 892 27000 - beq rmtpp11 893 27000 - lda trackn_portafrqa,x 894 27000 - clc 895 27000 - adc trackn_shiftfrq,x 896 27000 - sta trackn_audf,x 897 27000 -rmtpp11 898 27000 - EIF 899 27000 -ppnext 900 27000 - inx 901 27000 - cpx #TRACKS 902 27000 - beq rmt_p4 903 27000 - jmp rmtpp1 904 27000 -rmt_p4 905 27000 - IF FEAT_AUDCTLMANUALSET 906 27000 - ldx #3 907 27000 - lda #0 908 27000 -qq0 ora trackn_audctl,x 909 27000 - dex 910 27000 - bpl qq0 911 27000 - sta v_audctl 912 27000 -qq1 913 27000 - ldx v_audctl 914 27000 - ELSE 915 27000 - ldx #0 916 27000 - stx v_audctl 917 27000 - EIF 918 27000 - IF FEAT_FILTER 919 27000 - IF FEAT_FILTERG0L 920 27000 - lda trackn_command+0 921 27000 - bpl qq2 922 27000 - lda trackn_audc+0 923 27000 - and #$0f 924 27000 - beq qq2 925 27000 - lda trackn_audf+0 926 27000 - clc 927 27000 - adc trackn_filter+0 928 27000 - sta trackn_audf+2 929 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG2L 930 27000 - lda trackn_audc+2 931 27000 - and #$10 932 27000 - bne qq1a 933 27000 - EIF 934 27000 - lda #0 935 27000 - sta trackn_audc+2 936 27000 -qq1a 937 27000 - txa 938 27000 - ora #4 939 27000 - tax 940 27000 - EIF 941 27000 -qq2 942 27000 - IF FEAT_FILTERG1L 943 27000 - lda trackn_command+1 944 27000 - bpl qq3 945 27000 - lda trackn_audc+1 946 27000 - and #$0f 947 27000 - beq qq3 948 27000 - lda trackn_audf+1 949 27000 - clc 950 27000 - adc trackn_filter+1 951 27000 - sta trackn_audf+3 952 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG3L 953 27000 - lda trackn_audc+3 954 27000 - and #$10 955 27000 - bne qq2a 956 27000 - EIF 957 27000 - lda #0 958 27000 - sta trackn_audc+3 959 27000 -qq2a 960 27000 - txa 961 27000 - ora #2 962 27000 - tax 963 27000 - EIF 964 27000 -qq3 965 27000 - IF FEAT_FILTERG0L||FEAT_FILTERG1L 966 27000 - cpx v_audctl 967 27000 - bne qq5 968 27000 - EIF 969 27000 - EIF 970 27000 - IF FEAT_BASS16 971 27000 - IF FEAT_BASS16G1L 972 27000 - lda trackn_command+1 973 27000 - and #$0e 974 27000 - cmp #6 975 27000 - bne qq4 976 27000 - lda trackn_audc+1 977 27000 - and #$0f 978 27000 - beq qq4 979 27000 - ldy trackn_outnote+1 980 27000 - lda frqtabbasslo,y 981 27000 - sta trackn_audf+0 982 27000 - lda frqtabbasshi,y 983 27000 - sta trackn_audf+1 984 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG0L 985 27000 - lda trackn_audc+0 986 27000 - and #$10 987 27000 - bne qq3a 988 27000 - EIF 989 27000 - lda #0 990 27000 - sta trackn_audc+0 991 27000 -qq3a 992 27000 - txa 993 27000 - ora #$50 994 27000 - tax 995 27000 - EIF 996 27000 -qq4 997 27000 - IF FEAT_BASS16G3L 998 27000 - lda trackn_command+3 999 27000 - and #$0e 1000 27000 - cmp #6 1001 27000 - bne qq5 1002 27000 - lda trackn_audc+3 1003 27000 - and #$0f 1004 27000 - beq qq5 1005 27000 - ldy trackn_outnote+3 1006 27000 - lda frqtabbasslo,y 1007 27000 - sta trackn_audf+2 1008 27000 - lda frqtabbasshi,y 1009 27000 - sta trackn_audf+3 1010 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG2L 1011 27000 - lda trackn_audc+2 1012 27000 - and #$10 1013 27000 - bne qq4a 1014 27000 - EIF 1015 27000 - lda #0 1016 27000 - sta trackn_audc+2 1017 27000 -qq4a 1018 27000 - txa 1019 27000 - ora #$28 1020 27000 - tax 1021 27000 - EIF 1022 27000 - EIF 1023 27000 -qq5 1024 27000 - stx v_audctl 1025 27000 - IF STEREO8T 1026 27000 - IF FEAT_AUDCTLMANUALSET 1027 27000 - ldx #3 1028 27000 - lda #0 1029 27000 -qs0 ora trackn_audctl+4,x 1030 27000 - dex 1031 27000 - bpl qs0 1032 27000 - sta v_audctl2 1033 27000 -qs1 1034 27000 - ldx v_audctl2 1035 27000 - ELSE 1036 27000 - ldx #0 1037 27000 - stx v_audctl2 1038 27000 - EIF 1039 27000 - IF FEAT_FILTER 1040 27000 - IF FEAT_FILTERG0R 1041 27000 - lda trackn_command+0+4 1042 27000 - bpl qs2 1043 27000 - lda trackn_audc+0+4 1044 27000 - and #$0f 1045 27000 - beq qs2 1046 27000 - lda trackn_audf+0+4 1047 27000 - clc 1048 27000 - adc trackn_filter+0+4 1049 27000 - sta trackn_audf+2+4 1050 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG2R 1051 27000 - lda trackn_audc+2+4 1052 27000 - and #$10 1053 27000 - bne qs1a 1054 27000 - EIF 1055 27000 - lda #0 1056 27000 - sta trackn_audc+2+4 1057 27000 -qs1a 1058 27000 - txa 1059 27000 - ora #4 1060 27000 - tax 1061 27000 - EIF 1062 27000 -qs2 1063 27000 - IF FEAT_FILTERG1R 1064 27000 - lda trackn_command+1+4 1065 27000 - bpl qs3 1066 27000 - lda trackn_audc+1+4 1067 27000 - and #$0f 1068 27000 - beq qs3 1069 27000 - lda trackn_audf+1+4 1070 27000 - clc 1071 27000 - adc trackn_filter+1+4 1072 27000 - sta trackn_audf+3+4 1073 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG3R 1074 27000 - lda trackn_audc+3+4 1075 27000 - and #$10 1076 27000 - bne qs2a 1077 27000 - EIF 1078 27000 - lda #0 1079 27000 - sta trackn_audc+3+4 1080 27000 -qs2a 1081 27000 - txa 1082 27000 - ora #2 1083 27000 - tax 1084 27000 - EIF 1085 27000 -qs3 1086 27000 - IF FEAT_FILTERG0R||FEAT_FILTERG1R 1087 27000 - cpx v_audctl2 1088 27000 - bne qs5 1089 27000 - EIF 1090 27000 - EIF 1091 27000 - IF FEAT_BASS16 1092 27000 - IF FEAT_BASS16G1R 1093 27000 - lda trackn_command+1+4 1094 27000 - and #$0e 1095 27000 - cmp #6 1096 27000 - bne qs4 1097 27000 - lda trackn_audc+1+4 1098 27000 - and #$0f 1099 27000 - beq qs4 1100 27000 - ldy trackn_outnote+1+4 1101 27000 - lda frqtabbasslo,y 1102 27000 - sta trackn_audf+0+4 1103 27000 - lda frqtabbasshi,y 1104 27000 - sta trackn_audf+1+4 1105 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG0R 1106 27000 - lda trackn_audc+0+4 1107 27000 - and #$10 1108 27000 - bne qs3a 1109 27000 - EIF 1110 27000 - lda #0 1111 27000 - sta trackn_audc+0+4 1112 27000 -qs3a 1113 27000 - txa 1114 27000 - ora #$50 1115 27000 - tax 1116 27000 - EIF 1117 27000 -qs4 1118 27000 - IF FEAT_BASS16G3R 1119 27000 - lda trackn_command+3+4 1120 27000 - and #$0e 1121 27000 - cmp #6 1122 27000 - bne qs5 1123 27000 - lda trackn_audc+3+4 1124 27000 - and #$0f 1125 27000 - beq qs5 1126 27000 - ldy trackn_outnote+3+4 1127 27000 - lda frqtabbasslo,y 1128 27000 - sta trackn_audf+2+4 1129 27000 - lda frqtabbasshi,y 1130 27000 - sta trackn_audf+3+4 1131 27000 - IF FEAT_COMMAND7VOLUMEONLY&&FEAT_VOLUMEONLYG2R 1132 27000 - lda trackn_audc+2+4 1133 27000 - and #$10 1134 27000 - bne qs4a 1135 27000 - EIF 1136 27000 - lda #0 1137 27000 - sta trackn_audc+2+4 1138 27000 -qs4a 1139 27000 - txa 1140 27000 - ora #$28 1141 27000 - tax 1142 27000 - EIF 1143 27000 - EIF 1144 27000 -qs5 1145 27000 - stx v_audctl2 1146 27000 - EIF 1147 27000 -rmt_p5 1148 27000 - lda v_ainstrspeed 1149 27000 - rts 1150 27000 -SetPokey 1151 27000 - IF STEREO8T 1152 27000 - ldy v_audctl2 1153 27000 - lda trackn_audf+0+4 1154 27000 - ldx trackn_audf+0 1155 27000 - sta POKEY_BASE_S+$00 1156 27000 - stx POKEY_BASE+$00 1157 27000 - lda trackn_audc+0+4 1158 27000 - ldx trackn_audc+0 1159 27000 - sta POKEY_BASE_S+$01 1160 27000 - stx POKEY_BASE+$01 1161 27000 - lda trackn_audf+1+4 1162 27000 - ldx trackn_audf+1 1163 27000 - sta POKEY_BASE_S+$02 1164 27000 - stx POKEY_BASE+$02 1165 27000 - lda trackn_audc+1+4 1166 27000 - ldx trackn_audc+1 1167 27000 - sta POKEY_BASE_S+$03 1168 27000 - stx POKEY_BASE+$03 1169 27000 - lda trackn_audf+2+4 1170 27000 - ldx trackn_audf+2 1171 27000 - sta POKEY_BASE_S+$04 1172 27000 - stx POKEY_BASE+$04 1173 27000 - lda trackn_audc+2+4 1174 27000 - ldx trackn_audc+2 1175 27000 - sta POKEY_BASE_S+$05 1176 27000 - stx POKEY_BASE+$05 1177 27000 - lda trackn_audf+3+4 1178 27000 - ldx trackn_audf+3 1179 27000 - sta POKEY_BASE_S+$06 1180 27000 - stx POKEY_BASE+$06 1181 27000 - lda trackn_audc+3+4 1182 27000 - ldx trackn_audc+3 1183 27000 - sta POKEY_BASE_S+$07 1184 27000 - stx POKEY_BASE+$07 1185 27000 - lda v_audctl 1186 27000 - sty POKEY_BASE_S+$08 1187 27000 - sta POKEY_BASE+$08 1188 27000 - ELSE 1189 27000 - 1190 27000 - ifconst RMTVOLUME 1191 27000 - lda rmtvolume 1192 27000 - sta fourbitfadevalueint 1193 27000 - endif 1194 27000 - ldy v_audctl 1195 27000 - ldx trackn_audf+0 1196 27000 - lda trackn_audc+0 1197 27000 - ifconst RMTVOLUME 1198 27000 - jsr fourbitfadeint 1199 27000 - endif 1200 27000 - stx POKEY_BASE+$00+0 1201 27000 - sta POKEY_BASE+$01+0 1202 27000 - 1203 27000 - ldx trackn_audf+1 1204 27000 - lda trackn_audc+1 1205 27000 - ifconst RMTVOLUME 1206 27000 - jsr fourbitfadeint 1207 27000 - endif 1208 27000 - stx POKEY_BASE+$00+2 1209 27000 - sta POKEY_BASE+$01+2 1210 27000 - 1211 27000 - ldx trackn_audf+2 1212 27000 - lda trackn_audc+2 1213 27000 - ifconst RMTVOLUME 1214 27000 - jsr fourbitfadeint 1215 27000 - endif 1216 27000 - stx POKEY_BASE+$00+4 1217 27000 - sta POKEY_BASE+$01+4 1218 27000 - 1219 27000 - ldx trackn_audf+3 1220 27000 - lda trackn_audc+3 1221 27000 - ifconst RMTVOLUME 1222 27000 - jsr fourbitfadeint 1223 27000 - endif 1224 27000 - stx POKEY_BASE+$00+6 1225 27000 - sta POKEY_BASE+$01+6 1226 27000 - 1227 27000 - sty POKEY_BASE+$08 1228 27000 - 1229 27000 - EIF 1230 27000 - rts 1231 27000 -SetUpInstrumentY2 1232 27000 - lda (p_instrstable),y 1233 27000 - sta trackn_instrdb,x 1234 27000 - sta _nt 1235 27000 - iny 1236 27000 - lda (p_instrstable),y 1237 27000 - sta trackn_instrhb,x 1238 27000 - sta _nt+1 1239 27000 - ldy #0 1240 27000 - lda (_nt),y 1241 27000 - sta trackn_tableend,x 1242 27000 - clc 1243 27000 - adc #1 1244 27000 - sta trackn_instridx,x 1245 27000 - iny 1246 27000 - lda (_nt),y 1247 27000 - sta trackn_tablelop,x 1248 27000 - iny 1249 27000 - lda (_nt),y 1250 27000 - sta trackn_instrlen,x 1251 27000 - iny 1252 27000 - lda (_nt),y 1253 27000 - sta trackn_instrlop,x 1254 27000 - iny 1255 27000 - lda (_nt),y 1256 27000 - sta trackn_tabletypespeed,x 1257 27000 - IF FEAT_TABLETYPE||FEAT_TABLEMODE 1258 27000 - and #$3f 1259 27000 - EIF 1260 27000 - sta trackn_tablespeeda,x 1261 27000 - IF FEAT_TABLEMODE 1262 27000 - lda (_nt),y 1263 27000 - and #$40 1264 27000 - sta trackn_tablemode,x 1265 27000 - EIF 1266 27000 - iny 1267 27000 - IF FEAT_AUDCTLMANUALSET 1268 27000 - lda (_nt),y 1269 27000 - sta trackn_audctl,x 1270 27000 - EIF 1271 27000 - iny 1272 27000 - lda (_nt),y 1273 27000 - sta trackn_volumeslidedepth,x 1274 27000 - iny 1275 27000 - lda (_nt),y 1276 27000 - sta trackn_volumemin,x 1277 27000 - iny 1278 27000 - lda (_nt),y 1279 27000 - sta trackn_effdelay,x 1280 27000 - iny 1281 27000 - lda (_nt),y 1282 27000 - tay 1283 27000 - lda vibtabbeg,y 1284 27000 - sta trackn_effvibratoa,x 1285 27000 - sta trackn_effvibratobeg,x 1286 27000 - lda vibtabbeg+1,y 1287 27000 - sta trackn_effvibratoend,x 1288 27000 - ldy #10 1289 27000 - lda (_nt),y 1290 27000 - sta trackn_effshift,x 1291 27000 - lda #128 1292 27000 - sta trackn_volumeslidevalue,x 1293 27000 - lda #0 1294 27000 - sta trackn_instrreachend,x 1295 27000 - sta trackn_shiftfrq,x 1296 27000 - lda #INSTRPAR 1297 27000 - sta trackn_tablea,x 1298 27000 - tay 1299 27000 - lda (_nt),y 1300 27000 - sta trackn_tablenote,x 1301 27000 - IF FEAT_FILTER 1302 27000 - lda #1 1303 27000 - sta trackn_filter,x 1304 27000 - EIF 1305 27000 - rts 1306 27000 -InstrumentsEffects 1307 27000 - lda trackn_effdelay,x 1308 27000 - beq ei2 1309 27000 - tay 1310 27000 - dey 1311 27000 - bne ei1 1312 27000 - lda trackn_shiftfrq,x 1313 27000 - clc 1314 27000 - adc trackn_effshift,x 1315 27000 - clc 1316 27000 - ldy trackn_effvibratoa,x 1317 27000 - adc vib0,y 1318 27000 - sta trackn_shiftfrq,x 1319 27000 - iny 1320 27000 - tya 1321 27000 - cmp trackn_effvibratoend,x 1322 27000 - bne ei1a 1323 27000 - lda trackn_effvibratobeg,x 1324 27000 -ei1a 1325 27000 - sta trackn_effvibratoa,x 1326 27000 - jmp ei2 1327 27000 -ei1 1328 27000 - tya 1329 27000 - sta trackn_effdelay,x 1330 27000 -ei2 1331 27000 - lda trackn_tableend,x 1332 27000 - cmp #INSTRPAR 1333 27000 - beq ei3 1334 27000 - lda trackn_tablespeeda,x 1335 27000 - bpl ei2f 1336 27000 -ei2c 1337 27000 - lda trackn_tablea,x 1338 27000 - clc 1339 27000 - adc #1 1340 27000 - cmp trackn_tableend,x 1341 27000 - bcc ei2a 1342 27000 - beq ei2a 1343 27000 - lda trackn_tablelop,x 1344 27000 -ei2a 1345 27000 - sta trackn_tablea,x 1346 27000 - lda trackn_instrdb,x 1347 27000 - sta _nt 1348 27000 - lda trackn_instrhb,x 1349 27000 - sta _nt+1 1350 27000 - ldy trackn_tablea,x 1351 27000 - lda (_nt),y 1352 27000 - IF FEAT_TABLEMODE 1353 27000 - ldy trackn_tablemode,x 1354 27000 - beq ei2e 1355 27000 - clc 1356 27000 - adc trackn_tablenote,x 1357 27000 -ei2e 1358 27000 - EIF 1359 27000 - sta trackn_tablenote,x 1360 27000 - lda trackn_tabletypespeed,x 1361 27000 - IF FEAT_TABLETYPE||FEAT_TABLEMODE 1362 27000 - and #$3f 1363 27000 - EIF 1364 27000 -ei2f 1365 27000 - sec 1366 27000 - sbc #1 1367 27000 - sta trackn_tablespeeda,x 1368 27000 -ei3 1369 27000 - lda trackn_instrreachend,x 1370 27000 - bpl ei4 1371 27000 - lda trackn_volume,x 1372 27000 - beq ei4 1373 27000 - cmp trackn_volumemin,x 1374 27000 - beq ei4 1375 27000 - bcc ei4 1376 27000 - tay 1377 27000 - lda trackn_volumeslidevalue,x 1378 27000 - clc 1379 27000 - adc trackn_volumeslidedepth,x 1380 27000 - sta trackn_volumeslidevalue,x 1381 27000 - bcc ei4 1382 27000 - tya 1383 27000 - sbc #16 1384 27000 - sta trackn_volume,x 1385 27000 -ei4 1386 27000 - jmp returnfromInstrumentsEffects 1387 27000 - 1388 27000 -rmtmoduleend 1389 27000 - echo " (rmtplayer module is using ",[(rmtmoduleend-rmtmodulestart)]d," bytes)" 1390 27000 - 1391 27000 endif ; RMT ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite6.78b.asm 5357 27000 endif 5358 27000 ifnconst included.7800vox.asm ------- FILE 7800vox.asm LEVEL 2 PASS 3 0 27000 include 7800vox.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 ; AtariVox 7800basic wrapper 4 27000 5 27000 ; to be called with 6 27000 ; A=# of bytes 7 27000 ; 8 27000 9 27000 - ifconst HSSUPPORT 10 27000 - 11 27000 -_7800voxstart 12 27000 - 13 27000 -AVoxReadBytes 14 27000 - sta temp8 15 27000 - jsr i2c_startwrite 16 27000 - bcs eeprom_error 17 27000 - 18 27000 - lda HSVoxHi 19 27000 - jsr i2c_txbyte 20 27000 - lda HSVoxLo 21 27000 - jsr i2c_txbyte 22 27000 - jsr i2c_stopwrite 23 27000 - 24 27000 - jsr i2c_startread 25 27000 - 26 27000 - ldx #0 27 27000 -AVoxReadBytesLoop 28 27000 - jsr i2c_rxbyte 29 27000 - sta eeprombuffer,x 30 27000 - inx 31 27000 - cpx temp8 32 27000 - bne AVoxReadBytesLoop 33 27000 - jsr i2c_stopread 34 27000 - lda #0 35 27000 - rts 36 27000 - 37 27000 - ; to be called with 38 27000 - ; A=# of bytes 39 27000 - ; 40 27000 - 41 27000 -AVoxWriteBytes 42 27000 - sta temp8 43 27000 - jsr i2c_startwrite 44 27000 - bcs eeprom_error 45 27000 - 46 27000 - lda HSVoxHi 47 27000 - jsr i2c_txbyte 48 27000 - lda HSVoxLo 49 27000 - jsr i2c_txbyte 50 27000 - 51 27000 - ldx #$00 52 27000 -AVoxWriteBytesLoop 53 27000 - lda eeprombuffer,x 54 27000 - jsr i2c_txbyte 55 27000 - inx 56 27000 - cpx temp8 57 27000 - bne AVoxWriteBytesLoop 58 27000 - jsr i2c_stopwrite 59 27000 - 60 27000 - lda #0 61 27000 - rts 62 27000 - 63 27000 -eeprom_error 64 27000 - lda #$ff 65 27000 - rts 66 27000 - 67 27000 -AVoxDetect 68 27000 - 69 27000 - jsr i2c_startwrite 70 27000 - bcs eeprom_error 71 27000 - lda #$30 72 27000 - jsr i2c_txbyte 73 27000 - lda #$00 74 27000 - jsr i2c_txbyte 75 27000 - jsr i2c_stopwrite 76 27000 - rts 77 27000 - 78 27000 - include "i2c7800.inc" 79 27000 - I2C_SUBS temp9 80 27000 - 81 27000 -_7800voxend 82 27000 - 83 27000 - echo " (7800vox module is using ",[(_7800voxend-_7800voxstart)]d," bytes)" 84 27000 - 85 27000 endif 86 27000 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite6.78b.asm 5360 27000 endif 5361 27000 ifnconst included.pokeysound.asm ------- FILE pokeysound.asm LEVEL 2 PASS 3 0 27000 include pokeysound.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 4 27000 - ifconst pokeysupport 5 27000 - 6 27000 -pokeysoundmodulestart 7 27000 - 8 27000 -mutepokey 9 27000 - lda #0 10 27000 - ldy #7 11 27000 -mutepokeyloop 12 27000 - sta pokey1pointlo,y 13 27000 - sta (pokeybaselo),y 14 27000 - dey 15 27000 - bpl mutepokeyloop 16 27000 - rts 17 27000 - 18 27000 -checkpokeyplaying 19 27000 - ldx #6 20 27000 -checkpokeyplayingloop 21 27000 - lda pokey1pointlo,x 22 27000 - ora pokey1pointhi,x 23 27000 - beq pokeychannelinactive 24 27000 - jsr playpokeysfxA ; x=channel*2 25 27000 -pokeychannelinactive 26 27000 - dex 27 27000 - dex 28 27000 - bpl checkpokeyplayingloop 29 27000 - rts 30 27000 - 31 27000 -playpokeysfxA 32 27000 - txa 33 27000 - tay 34 27000 - lda pokey1tick,x 35 27000 - beq playpokeysfxAcont 36 27000 - sec 37 27000 - sbc #1 38 27000 - sta pokey1tick,x ; sound resolution is >1 frame, and we're mid-tock... 39 27000 - rts 40 27000 - 41 27000 -playpokeysfxAcont 42 27000 - lda pokey1frames,x ; set the frame countdown for this sound chunk 43 27000 - sta pokey1tick,x 44 27000 - 45 27000 - lda pokey1priority,x ; decrease the sound's priority if its non-zero 46 27000 - beq playpokeysfxAcont2 47 27000 - sec 48 27000 - sbc #1 49 27000 - sta pokey1priority,x 50 27000 -playpokeysfxAcont2 51 27000 - 52 27000 - ; *** FREQUENCY 53 27000 - lda (pokey1pointlo,x) 54 27000 - sta inttemp1 55 27000 - clc 56 27000 - adc pokey1offset,x ; take into account any pitch modification 57 27000 - sta (pokeybaselo),y ; PAUDF0,0 58 27000 - 59 27000 - ;advance the data pointer +1 60 27000 - inc pokey1pointlo,x 61 27000 - bne skippokeyhiinc1 62 27000 - inc pokey1pointhi,x 63 27000 -skippokeyhiinc1 64 27000 - 65 27000 - ; *** WAVE 66 27000 - lda (pokey1pointlo,x) 67 27000 - asl 68 27000 - asl 69 27000 - asl 70 27000 - asl ; x16 71 27000 - 72 27000 - ;advance the data pointer +1 73 27000 - inc pokey1pointlo,x 74 27000 - bne skippokeyhiinc2 75 27000 - inc pokey1pointhi,x 76 27000 -skippokeyhiinc2 77 27000 - 78 27000 - ora (pokey1pointlo,x) 79 27000 - iny 80 27000 - sta (pokeybaselo),y 81 27000 - 82 27000 - ora inttemp1 ; check if F|C|V=0 83 27000 - beq zeropokeypoint ; if so, we're at the end of the sound. 84 27000 - 85 27000 - ; advance the pointer +1, on to the next sound chunk 86 27000 - inc pokey1pointlo,x 87 27000 - bne skippokeyhiinc3 88 27000 - inc pokey1pointhi,x 89 27000 -skippokeyhiinc3 90 27000 - rts 91 27000 - 92 27000 -zeropokeypoint 93 27000 - sta pokey1pointlo,x 94 27000 - sta pokey1pointhi,x 95 27000 - sta pokey1priority,x 96 27000 - rts 97 27000 - 98 27000 -schedulepokeysfx 99 27000 - ldx #6 100 27000 -schedulepokeysfxloop 101 27000 - lda pokey1pointlo,x 102 27000 - ora pokey1pointhi,x 103 27000 - bne schedulespokeysearch 104 27000 - jmp schedulepokeyX ; we found an unused channel, so use it... 105 27000 -schedulespokeysearch 106 27000 - dex 107 27000 - dex 108 27000 - bpl schedulepokeysfxloop 109 27000 - 110 27000 - ; if we're here, all 4 channels are presently playing a sound... 111 27000 - ldy #1 112 27000 - lda (sfxinstrumentlo),y ; peek at the priority of this sfx... 113 27000 - bne schedulepokeysfxcont1 114 27000 - rts ; ...and skip it if it's 0 priority 115 27000 -schedulepokeysfxcont1 116 27000 - 117 27000 - ; figure out which current sound has the lowest priority... 118 27000 - lda #0 119 27000 - sta temp8 120 27000 - lda pokey1priority 121 27000 - sta temp9 122 27000 - ldx #6 123 27000 -findlowprioritypokeyloop 124 27000 - lda pokey1priority,x 125 27000 - cmp temp9 126 27000 - bcs findlowprioritypokeyloopcontinue 127 27000 - sta temp9 128 27000 - stx temp8 129 27000 -findlowprioritypokeyloopcontinue 130 27000 - dex 131 27000 - dex 132 27000 - bne findlowprioritypokeyloop 133 27000 - ldx temp8 ; the low priority channel we'll interrupt 134 27000 - 135 27000 -schedulepokeyX 136 27000 - ;called with X=2*pokey channel to play on... 137 27000 - ldy #1 ; get priority and sound-resolution (in frames) 138 27000 - lda (sfxinstrumentlo),y 139 27000 - sta pokey1priority,x 140 27000 - iny 141 27000 - lda (sfxinstrumentlo),y 142 27000 - sta pokey1frames,x 143 27000 - 144 27000 - lda sfxinstrumentlo 145 27000 - clc 146 27000 - adc #3 147 27000 - sta pokey1pointlo,x 148 27000 - lda sfxinstrumenthi 149 27000 - adc #0 150 27000 - sta pokey1pointhi,x 151 27000 - lda temp3 152 27000 - sta pokey1offset,x 153 27000 - lda #0 154 27000 - sta pokey1tick,x 155 27000 - rts 156 27000 - 157 27000 - ; pokey detection routine. we check for pokey in the XBOARD/XM location, 158 27000 - ; and the standard $4000 location. 159 27000 - ; if pokey the pokey is present, this routine will reset it. 160 27000 - ifconst pokeyaddress 161 27000 -detectpokeylocation 162 27000 - lda #pokeyaddress 165 27000 - sta pokeybasehi 166 27000 - lda #$ff 167 27000 - sta pokeydetected 168 27000 - 169 27000 - if pokeyaddress = $450 170 27000 - lda XCTRL1s 171 27000 - ora #%00010100 172 27000 - sta XCTRL1s 173 27000 - sta XCTRL1 174 27000 - endif 175 27000 - 176 27000 - 177 27000 - lda #0 178 27000 - ldy #15 179 27000 -clearpokeyloop 180 27000 - sta (pokeybase),y 181 27000 - dey 182 27000 - bpl clearpokeyloop 183 27000 - ; take pokey out of reset... 184 27000 - ldy #PSKCTL 185 27000 - lda #3 186 27000 - sta (pokeybase),y 187 27000 - ldy #PAUDCTL 188 27000 - lda #0 189 27000 - sta (pokeybase),y 190 27000 - rts 191 27000 - else ; !pokeyaddress 192 27000 -detectpokeylocation 193 27000 - ;XBoard/XM... 194 27000 - ldx #2 195 27000 -detectpokeyloop 196 27000 - lda XCTRL1s 197 27000 - ora #%00010100 198 27000 - and POKEYXMMASK,x 199 27000 - sta XCTRL1s 200 27000 - sta XCTRL1 201 27000 - 202 27000 - lda POKEYCHECKLO,x 203 27000 - sta pokeybaselo 204 27000 - lda POKEYCHECKHI,x 205 27000 - sta pokeybasehi 206 27000 - jsr checkforpokey 207 27000 - lda pokeydetected 208 27000 - beq foundpokeychip 209 27000 - dex 210 27000 - bpl detectpokeyloop 211 27000 -foundpokeychip 212 27000 - eor #$ff ; invert state for 7800basic if...then test 213 27000 - sta pokeydetected 214 27000 - rts 215 27000 - 216 27000 -POKEYXMMASK 217 27000 - ; XM POKEY on XM POKEY off XM POKEY off 218 27000 - .byte %11111111, %11101111, %11101111 219 27000 - 220 27000 -POKEYCHECKLO 221 27000 - .byte <$0450, <$0450, <$4000 222 27000 -POKEYCHECKHI 223 27000 - .byte >$0450, >$0450, >$4000 224 27000 - 225 27000 -checkforpokey 226 27000 - ldy #$0f 227 27000 - lda #$00 228 27000 - sta pokeydetected ; start off by assuming pokey will be detected 229 27000 -resetpokeyregistersloop 230 27000 - sta (pokeybase),y 231 27000 - dey 232 27000 - bpl resetpokeyregistersloop 233 27000 - 234 27000 - ldy #PAUDCTL 235 27000 - sta (pokeybase),y 236 27000 - ldy #PSKCTL 237 27000 - sta (pokeybase),y 238 27000 - 239 27000 - ; let the dust settle... 240 27000 - nop 241 27000 - nop 242 27000 - nop 243 27000 - 244 27000 - lda #4 245 27000 - sta temp9 246 27000 -pokeycheckloop1 247 27000 - ; we're in reset, so the RANDOM register should read $ff... 248 27000 - ldy #PRANDOM 249 27000 - lda (pokeybase),y 250 27000 - cmp #$ff 251 27000 - bne nopokeydetected 252 27000 - dec temp9 253 27000 - bne pokeycheckloop1 254 27000 - 255 27000 - ; take pokey out of reset... 256 27000 - ldy #PSKCTL 257 27000 - lda #3 258 27000 - sta (pokeybase),y 259 27000 - ldy #PAUDCTL 260 27000 - lda #0 261 27000 - sta (pokeybase),y 262 27000 - 263 27000 - ; let the dust settle again... 264 27000 - nop 265 27000 - nop 266 27000 - nop 267 27000 - 268 27000 - lda #4 269 27000 - sta temp9 270 27000 -pokeycheckloop2 271 27000 - ; we're out of reset, so RANDOM should read non-$ff... 272 27000 - ldy #PRANDOM 273 27000 - lda (pokeybase),y 274 27000 - cmp #$ff 275 27000 - beq skippokeycheckreturn 276 27000 - rts 277 27000 -skippokeycheckreturn 278 27000 - dec temp9 279 27000 - bne pokeycheckloop2 280 27000 -nopokeydetected 281 27000 - dec pokeydetected ; pokeydetected=#$ff 282 27000 - rts 283 27000 - 284 27000 - endif ; !pokeyaddress 285 27000 - 286 27000 -pokeysoundmoduleend 287 27000 - 288 27000 - echo " (pokeysound module is using ",[(pokeysoundmoduleend-pokeysoundmodulestart)]d," bytes)" 289 27000 - 290 27000 endif ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite6.78b.asm 5363 27000 endif 5364 27000 ifnconst included.tracker.asm ------- FILE tracker.asm LEVEL 2 PASS 3 0 27000 include tracker.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 4 27000 - ifconst MUSICTRACKER 5 27000 - 6 27000 -trackerstart 7 27000 - 8 27000 - ; ** songtempo lists how many 256ths of a frame a 16th note lasts 9 27000 - ; ** the player operates on a 16th note grid. 10 27000 - 11 27000 -servicesongover 12 27000 - rts 13 27000 -servicesong 14 27000 - lda songtempo 15 27000 - beq servicesongover ; ** if song is off/paused then return 16 27000 -servicesongcontinue 17 27000 - lda sfxschedulelock 18 27000 - sta sfxschedulemissed 19 27000 - bne servicesongover 20 27000 - lda songtempo 21 27000 - clc 22 27000 - adc songtick ; add songtempo to songtick until it rolls over 23 27000 - sta songtick ; this is how we break away from 50/60Hz timing. 24 27000 - bcc servicesongover 25 27000 - ; ** if we're here a new 16th note has passed 26 27000 - ; ** check if a new note is due on any of the 4 channels 27 27000 -servicesongredo 28 27000 - ldx #3 29 27000 -checkchannelloop 30 27000 - dec songchannel1busywait,x 31 27000 - bpl carryoncheckingchannel 32 27000 - txa 33 27000 - pha ; save X for the loop 34 27000 - jsr processsongdata 35 27000 - pla ; restore X for the loop 36 27000 - tax 37 27000 -carryoncheckingchannel 38 27000 - dex 39 27000 - bpl checkchannelloop 40 27000 - lda inactivechannelcount 41 27000 - cmp #15 42 27000 - bne skipstopsong 43 27000 - lda songloops 44 27000 - bne doasongloop 45 27000 - ;lda #0 46 27000 - sta songtempo ; all channels are done. stop the song 47 27000 - rts 48 27000 -doasongloop 49 27000 - bmi skipsongloopadjust 50 27000 - dec songloops 51 27000 -skipsongloopadjust 52 27000 - jsr setsongchannels 53 27000 - jmp servicesongredo 54 27000 -skipstopsong 55 27000 - rts 56 27000 - 57 27000 -processsongdata 58 27000 - ; channel needs processing 59 27000 - ; X=channel # 60 27000 - 61 27000 - txa 62 27000 - clc 63 27000 - adc songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 64 27000 - tay 65 27000 - 66 27000 - 67 27000 - ; ** indirect x is cumbersome with mult-byte commands. 68 27000 - ; ** setup a pointer to the song data for indirect y addressing. 69 27000 - lda songchannel1layer1lo,y 70 27000 - sta songdatalo 71 27000 - lda songchannel1layer1hi,y 72 27000 - sta songdatahi 73 27000 - ora songdatalo 74 27000 - bne channelhasdata 75 27000 - ;channel data is pointing at $0000 76 27000 - lda #$7F 77 27000 - sta songchannel1busywait,x ; skip a bunch of notes 78 27000 -setchannelcountbits 79 27000 - lda channel2bits,x 80 27000 - ora inactivechannelcount 81 27000 - sta inactivechannelcount 82 27000 - rts 83 27000 -channelhasdata 84 27000 - 85 27000 - sty songstackindex 86 27000 - ldy #0 87 27000 - lda (songdatalo),y ; ** load in the next byte of song data, so we can decode it 88 27000 - cmp #$ff 89 27000 - bne carryoncheckingdatatype ; ** $ff=pattern end marker 90 27000 - jmp handlechannelEOD 91 27000 - 92 27000 -carryoncheckingdatatype 93 27000 - and #$F0 94 27000 - cmp #$C0 95 27000 - beq handlechannelrest ; 0000XXXX=rest 96 27000 - cmp #$F0 97 27000 - beq handlemultibytecommand 98 27000 - cmp #$D0 99 27000 - beq handlesemiup 100 27000 - cmp #$E0 101 27000 - beq handlesemidown 102 27000 -handlenotedata 103 27000 - ; ** TODO: note playing is a terrible choice for fall-through 104 27000 - 105 27000 - ; ** its simple note data, prepare arguments for schedulesfx 106 27000 - 107 27000 - ; ** set the note length 108 27000 - lda (songdatalo),y 109 27000 - and #$0F 110 27000 - sta songchannel1busywait,x 111 27000 - 112 27000 - ; ** load the instrument 113 27000 - lda songchannel1instrumentlo,x 114 27000 - sta sfxinstrumentlo 115 27000 - lda songchannel1instrumenthi,x 116 27000 - sta sfxinstrumenthi 117 27000 - 118 27000 - ; ** get the note, and transpose 119 27000 - lda (songdatalo),y 120 27000 - lsr 121 27000 - lsr 122 27000 - lsr 123 27000 - lsr 124 27000 - clc 125 27000 - adc songchannel1transpose,x ; ** add it to the transpose index 126 27000 - ; ** its up the respective SFX scheduler to handle and save the note data 127 27000 - sta sfxnoteindex 128 27000 - 129 27000 - lda #0 130 27000 - sta sfxpitchoffset 131 27000 - 132 27000 - jsr schedulesfx 133 27000 - 134 27000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 135 27000 - 136 27000 -handlechannelrest 137 27000 - ; ** set the note length 138 27000 - lda (songdatalo),y 139 27000 - and #$0F 140 27000 - sta songchannel1busywait,x 141 27000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 142 27000 - 143 27000 -handlesemiup 144 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 145 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 146 27000 - clc 147 27000 -handlesemidownentry 148 27000 - adc songchannel1transpose,x ; ** add it to the transpose index 149 27000 - sta songchannel1transpose,x 150 27000 - jsr advancethesongpointer1byte 151 27000 - jmp processsongdata ; semi doesn't have note length, so process the next data byte... 152 27000 - 153 27000 -handlesemidown 154 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 155 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 156 27000 - eor #$ff ; ** its easier if we negate it, and then add it instead. 157 27000 - sec 158 27000 - jmp handlesemidownentry 159 27000 - 160 27000 -handlemultibytecommand 161 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 162 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 163 27000 - cmp #$08 ; ** load new instrument? 164 27000 - bne nothandleinstrumentchange 165 27000 -handleinstrumentchange 166 27000 - iny 167 27000 - lda (songdatalo),y 168 27000 - sta songchannel1instrumentlo,x 169 27000 - iny 170 27000 - lda (songdatalo),y 171 27000 - sta songchannel1instrumenthi,x 172 27000 - lda #3 173 27000 - jsr advancethesongpointerNbytes ; advance 3 bytes 174 27000 - jmp processsongdata 175 27000 - 176 27000 -nothandleinstrumentchange 177 27000 - cmp #$09 ; ** absolute tempo change? 178 27000 - bne nothandletempochange 179 27000 - lda #0 180 27000 - sta songtempo 181 27000 -handlerelativetempochange 182 27000 - iny 183 27000 - lda (songdatalo),y 184 27000 - clc 185 27000 - adc songtempo 186 27000 - sta songtempo 187 27000 - lda #2 188 27000 - jsr advancethesongpointerNbytes ; advance 2 bytes 189 27000 - jmp processsongdata 190 27000 - 191 27000 -nothandletempochange 192 27000 - cmp #$0A ; ** relative tempo change?: 193 27000 - beq handlerelativetempochange 194 27000 - cmp #$0B ; ** octave/semi change? 195 27000 - beq handleoctavesemichange 196 27000 -handlepatterndata 197 27000 - ; ** if we're here its a pattern/loop "subroutine" 198 27000 - ; ** move the channel's "stack" pointer and populate the new stack level 199 27000 - 200 27000 - lda #4 201 27000 - clc 202 27000 - adc songchannel1stackdepth,x 203 27000 - sta songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 204 27000 - 205 27000 - stx inttemp6 ; about to invalidate x. save it. 206 27000 - lda songstackindex 207 27000 - adc #4 208 27000 - tax 209 27000 - 210 27000 - lda (songdatalo),y 211 27000 - and #$7 212 27000 - sta songchannel1layer1loops,x 213 27000 - iny 214 27000 - lda (songdatalo),y 215 27000 - sta songchannel1layer1lo,x 216 27000 - iny 217 27000 - lda (songdatalo),y 218 27000 - sta songchannel1layer1hi,x 219 27000 - 220 27000 - ldx inttemp6 ; restore x with the channel # 221 27000 - 222 27000 - ; ** advance will operate on the old stack level, since we didn't store the updated songstackindex... 223 27000 - lda #3 224 27000 - jsr advancethesongpointerNbytes ; advance 3 bytes 225 27000 - 226 27000 - ; ** ...but the new stack level will be correctly picked up when we process the next byte. 227 27000 - jmp processsongdata 228 27000 - 229 27000 -handlechannelEOD 230 27000 - ; ** check if there are loops remaining on the pattern 231 27000 - stx inttemp6 232 27000 - ldx songstackindex 233 27000 - dec songchannel1layer1loops,x 234 27000 - bmi handlechannelEODnoloop 235 27000 - ; ** loops are remaining. set the pattern pointer to the pattern start, which is contained after the EOD 236 27000 - iny 237 27000 - lda (songdatalo),y 238 27000 - sta songchannel1layer1lo,x 239 27000 - iny 240 27000 - lda (songdatalo),y 241 27000 - sta songchannel1layer1hi,x 242 27000 - ldx inttemp6 243 27000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 244 27000 - 245 27000 -handlechannelEODnoloop 246 27000 - ; this pattern/loop is done playing. "pop" the stack 247 27000 - ldx inttemp6 248 27000 - lda songchannel1stackdepth,x 249 27000 - beq handlerootchannelEOD 250 27000 - sec 251 27000 - sbc #4 252 27000 - sta songchannel1stackdepth,x 253 27000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 254 27000 - 255 27000 -handlerootchannelEOD 256 27000 - ; this channel is done. point it to $ff data so we no longer process this channel. 257 27000 - lda #0 258 27000 - sta songchannel1layer1lo,x 259 27000 - sta songchannel1layer1hi,x 260 27000 - sta songchannel1busywait,x 261 27000 - jmp setchannelcountbits 262 27000 - rts 263 27000 - 264 27000 -nothandlepatternchange 265 27000 -handleoctavesemichange 266 27000 - iny 267 27000 - lda (songdatalo),y 268 27000 - sta songchannel1transpose,x 269 27000 - lda #2 270 27000 - jsr advancethesongpointerNbytes ; advance 2 bytes 271 27000 - jmp processsongdata 272 27000 - 273 27000 -advancethesongpointer1byte 274 27000 - txa 275 27000 - ldx songstackindex 276 27000 - inc songchannel1layer1lo,x 277 27000 - bne skiphiadvancethesongpointer1byte 278 27000 - inc songchannel1layer1hi,x 279 27000 -skiphiadvancethesongpointer1byte 280 27000 - tax 281 27000 - rts 282 27000 - 283 27000 -advancethesongpointerNbytes 284 27000 - ; entered with A=# of byte to advance 285 27000 - stx inttemp6 286 27000 - ldx songstackindex 287 27000 - clc 288 27000 - adc songchannel1layer1lo,x 289 27000 - sta songchannel1layer1lo,x 290 27000 - lda #0 291 27000 - adc songchannel1layer1hi,x 292 27000 - sta songchannel1layer1hi,x 293 27000 - ldx inttemp6 294 27000 - rts 295 27000 - 296 27000 -clearsongmemory 297 27000 - lda #0 298 27000 - ldx #(songchannel4instrumenthi-songchannel1layer1lo) 299 27000 -clearsongmemoryloop1 300 27000 - sta songchannel1layer1lo,x 301 27000 - dex 302 27000 - bpl clearsongmemoryloop1 303 27000 - 304 27000 - ldx #(songchannel4stackdepth-songchannel1layer1loops) 305 27000 -clearsongmemoryloop2 306 27000 - sta songchannel1layer1loops,x 307 27000 - dex 308 27000 - bpl clearsongmemoryloop2 309 27000 - 310 27000 - lda #$ff 311 27000 - ldx #3 312 27000 -clearsongmemoryloop3 313 27000 - sta songchannel1busywait,x 314 27000 - dex 315 27000 - bpl clearsongmemoryloop3 316 27000 - rts 317 27000 - 318 27000 -setsongchannels 319 27000 - jsr clearsongmemory 320 27000 - ldy #7 321 27000 - ldx #3 322 27000 -setsongchannelsloop 323 27000 - lda (songpointerlo),y 324 27000 - sta songchannel1layer1hi,x 325 27000 - dey 326 27000 - lda (songpointerlo),y 327 27000 - sta songchannel1layer1lo,x 328 27000 - dex 329 27000 - dey 330 27000 - bpl setsongchannelsloop 331 27000 - rts 332 27000 - 333 27000 -channel2bits 334 27000 - .byte 1,2,4,8 335 27000 - 336 27000 -tiatrackeroctavenotes 337 27000 - ifconst BUZZBASS 338 27000 -LOWC = 15 339 27000 - else 340 27000 -LOWC = 14 341 27000 - endif 342 27000 - ; ****** ELECTRONIC (0 to 11) 343 27000 - .byte LOWC,20 ; c0 16.1Hz 344 27000 - .byte LOWC,18 ; c#0 345 27000 - .byte LOWC,17 ; d0 346 27000 - .byte LOWC,16 ; d#0 347 27000 - .byte LOWC,15 ; e0 348 27000 - .byte LOWC,14 ; f0 (very off) 349 27000 - .byte LOWC,14 ; f#0 350 27000 - .byte LOWC,13 ; g0 351 27000 - .byte LOWC,12 ; g#0 352 27000 - .byte LOWC,11 ; a0 353 27000 - .byte LOWC,11 ; a#0 (very off) 354 27000 - .byte LOWC,10 ; b0 30.7Hz 355 27000 - 356 27000 - ; ****** SLIGHTLY BUZZY (12 to 23) 357 27000 - .byte 6,30 ; c1 32.7Hz 358 27000 - .byte 6,28 ; c#1 359 27000 - .byte 6,27 ; d1 360 27000 - .byte 6,25 ; d#1 361 27000 - .byte 6,24 ; e1 362 27000 - .byte 6,22 ; f1 363 27000 - .byte 6,21 ; f#1 364 27000 - .byte 6,20 ; g1 365 27000 - .byte 6,18 ; g#1 366 27000 - .byte 6,17 ; a1 367 27000 - .byte 6,16 ; a#1 368 27000 - .byte 6,15 ; b1 63.4Hz 369 27000 - 370 27000 - ; ****** BUZZY (24 to 39) 371 27000 - .byte 1,31 ; c2 65.5 372 27000 - .byte 1,30 ; c#2 67.6 373 27000 - .byte 1,27 ; d2 72.3 374 27000 - .byte 1,26 ; d#2 77.6 375 27000 - .byte 1,24 ; e2 376 27000 - .byte 1,23 ; f2 377 27000 - .byte 1,22 ; f#2 378 27000 - .byte 1,20 ; g2 379 27000 - .byte 1,19 ; g#2 380 27000 - .byte 1,18 ; a2 381 27000 - .byte 1,17 ; a#2 382 27000 - .byte 1,16 ; b2 383 27000 - .byte 1,15 ; c3 126.8Hz 384 27000 - .byte 1,14 ; c#3 385 27000 - .byte 1,13 ; d3 149.7Hz 386 27000 - .byte 1,12 ; d#3 161.2Hz (very off) 387 27000 - ; ****** PURE (40 to 71) - best key is A3 Major 388 27000 - .byte 12,31 ; e3 163.8Hz 389 27000 - .byte 12,29 ; f3 390 27000 - .byte 12,28 ; f#3 391 27000 - .byte 12,26 ; g3 392 27000 - .byte 12,24 ; g#3 393 27000 - .byte 12,23 ; a3 songs in key of A benefit from Perceptual Tuning 394 27000 - .byte 12,22 ; a#3 395 27000 - .byte 12,20 ; b3 396 27000 - .byte 12,19 ; c4 (middle C) 397 27000 - .byte 12,18 ; c#4 398 27000 - .byte 12,17 ; d4 399 27000 - .byte 12,16 ; d#4 400 27000 - .byte 12,15 ; e4 401 27000 - .byte 12,14 ; f4 402 27000 - .byte 12,13 ; f#4 403 27000 - .byte 12,12 ; g4 (very off) 404 27000 - .byte 12,12 ; g#4 405 27000 - .byte 12,11 ; a4 406 27000 - .byte 12,10 ; a#4 407 27000 - .byte 4,31 ; b4 408 27000 - .byte 4,29 ; c5 409 27000 - .byte 4,28 ; c#5 410 27000 - .byte 4,26 ; d5 411 27000 - .byte 4,24 ; d#5 412 27000 - .byte 4,23 ; e5 413 27000 - .byte 4,22 ; f5 414 27000 - .byte 4,20 ; f#5 415 27000 - .byte 4,19 ; g5 416 27000 - .byte 4,18 ; g#5 417 27000 - .byte 4,17 ; a5 418 27000 - .byte 4,16 ; a#5 419 27000 - .byte 4,15 ; b5 420 27000 - 421 27000 - ; ****** TUNED WIND (72 to 83) 422 27000 - .byte 8,30 ; c 423 27000 - .byte 8,28 ; c# 424 27000 - .byte 8,27 ; d 425 27000 - .byte 8,25 ; d# 426 27000 - .byte 8,24 ; e 427 27000 - .byte 8,22 ; f 428 27000 - .byte 8,21 ; f# 429 27000 - .byte 8,20 ; g 430 27000 - .byte 8,18 ; g# 431 27000 - .byte 8,17 ; a 432 27000 - .byte 8,16 ; a# 433 27000 - .byte 8,15 ; b 434 27000 - 435 27000 - include "tiadrumkit.asm" 436 27000 - 437 27000 -trackerend 438 27000 - 439 27000 - echo " (tracker module is using ",[(trackerend-trackerstart)]d," bytes)" 440 27000 - 441 27000 endif ;MUSICTRACKER ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite6.78b.asm 5366 27000 endif 5367 27000 ifnconst included.hiscore.asm ------- FILE hiscore.asm LEVEL 2 PASS 3 0 27000 include hiscore.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 - ifconst HSSUPPORT 4 27000 - 5 27000 -hiscorestart 6 27000 - 7 27000 -detectatarivoxeeprom 8 27000 -hiscoremodulestart 9 27000 - ; do a test to see if atarivox eeprom can be accessed, and save results 10 27000 - jsr AVoxDetect 11 27000 - eor #$ff ; invert for easy 7800basic if...then logic 12 27000 - sta avoxdetected 13 27000 - lda #$0 14 27000 - sta SWACNT 15 27000 - lda avoxdetected 16 27000 - rts 17 27000 - 18 27000 -detecthsc 19 27000 - ; check for the HSC ROM signature... 20 27000 - lda XCTRL1s 21 27000 - ora #%00001100 22 27000 - sta XCTRL1s 23 27000 - sta XCTRL1 24 27000 - lda $3900 25 27000 - eor #$C6 26 27000 - bne detecthscfail 27 27000 - lda $3904 28 27000 - eor #$FE 29 27000 - bne detecthscfail 30 27000 - ; check if it's initialized... 31 27000 - ldy #0 32 27000 - lda #$ff 33 27000 -checkhscinit 34 27000 - and $1000,y 35 27000 - dey 36 27000 - bpl checkhscinit 37 27000 - cmp #$ff 38 27000 - bne hscisalreadyinit 39 27000 - ; if we're here, we need to do a minimal HSC init... 40 27000 - ldy #$28 41 27000 -hscinitloop1 42 27000 - lda hscheader,y 43 27000 - sta $1000,y 44 27000 - dey 45 27000 - bpl hscinitloop1 46 27000 - ldy #$89 47 27000 - lda #$7F 48 27000 -hscinitloop2 49 27000 - sta $10B3,y 50 27000 - dey 51 27000 - cpy #$ff 52 27000 - bne hscinitloop2 53 27000 -hscisalreadyinit 54 27000 - lda #$ff 55 27000 - rts 56 27000 -hscheader 57 27000 - .byte $00,$00,$68,$83,$AA,$55,$9C,$FF,$07,$12,$02,$1F,$00,$00,$00,$00 58 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 59 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$03 60 27000 -detecthscfail 61 27000 - lda XCTRL1s 62 27000 - and #%11110111 63 27000 - sta XCTRL1s 64 27000 - lda #0 65 27000 - rts 66 27000 endif ; HSSUPPORT 67 27000 68 27000 - ifconst HSSUPPORT 69 27000 - ifnconst hiscorefont 70 27000 - echo "" 71 27000 - echo "WARNING: High score support is enabled, but the hiscorefont.png was" 72 27000 - echo " NOT imported with incgraphic. The high score display code" 73 27000 - echo " has been omitted from this build." 74 27000 - echo "" 75 27000 - else 76 27000 -hscdrawscreen 77 27000 - 78 27000 - ; we use 20 lines on a 24 line display 79 27000 - ; HSSCOREY to dynamically centers based on 80 27000 - ;HSSCOREY = 0 81 27000 -HSSCOREY = ((WZONECOUNT*WZONEHEIGHT/8)-22)/2 82 27000 -HSCURSORY = ((HSSCOREY/(WZONEHEIGHT/8))*WZONEHEIGHT) 83 27000 - 84 27000 - ifconst HSSCORESIZE 85 27000 -SCORESIZE = HSSCORESIZE 86 27000 - else 87 27000 -SCORESIZE = 6 88 27000 - endif 89 27000 - 90 27000 - ;save shadow registers for later return... 91 27000 - lda sCTRL 92 27000 - sta ssCTRL 93 27000 - lda sCHARBASE 94 27000 - sta ssCHARBASE 95 27000 - lda #$60 96 27000 - sta charactermode 97 27000 - jsr drawwait 98 27000 - jsr blacken320colors 99 27000 - jsr clearscreen 100 27000 - 101 27000 - ;set the character base to the HSC font 102 27000 - lda #>hiscorefont 103 27000 - sta CHARBASE 104 27000 - sta sCHARBASE 105 27000 - lda #%01000011 ;Enable DMA, mode=320A 106 27000 - sta CTRL 107 27000 - sta sCTRL 108 27000 - 109 27000 - lda #60 110 27000 - sta hsjoydebounce 111 27000 - 112 27000 - lda #0 113 27000 - sta hscursorx 114 27000 - sta framecounter 115 27000 - ifnconst HSCOLORCHASESTART 116 27000 - lda #$8D ; default is blue. why not? 117 27000 - else 118 27000 - lda #HSCOLORCHASESTART 119 27000 - endif 120 27000 - sta hscolorchaseindex 121 27000 - 122 27000 - lda #$0F 123 27000 - sta P0C2 ; base text is white 124 27000 - 125 27000 - jsr hschasecolors 126 27000 - ; ** plot all of the initials 127 27000 - lda #HSRAMInitials 130 27000 - sta temp2 ; charmaphi 131 27000 - lda #32+29 ; palette=0-29 | 32-(width=3) 132 27000 - sta temp3 ; palette/width 133 27000 - lda #104 134 27000 - sta temp4 ; X 135 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 136 27000 - sta temp5 ; Y 137 27000 -plothsinitialsloop 138 27000 - jsr plotcharacters 139 27000 - clc 140 27000 - lda temp3 141 27000 - adc #32 142 27000 - sta temp3 143 27000 - inc temp5 144 27000 - if WZONEHEIGHT = 8 145 27000 - inc temp5 146 27000 - endif 147 27000 - clc 148 27000 - lda #3 149 27000 - adc temp1 150 27000 - sta temp1 151 27000 - cmp #(<(HSRAMInitials+15)) 152 27000 - bcc plothsinitialsloop 153 27000 - 154 27000 - ifconst HSGAMENAMELEN 155 27000 - ;plot the game name... 156 27000 - lda #HSGAMENAMEtable 159 27000 - sta temp2 ; charmaphi 160 27000 - lda #(32-HSGAMENAMELEN) ; palette=0*29 | 32-(width=3) 161 27000 - sta temp3 ; palette/width 162 27000 - lda #(80-(HSGAMENAMELEN*2)) 163 27000 - sta temp4 ; X 164 27000 - lda #((HSSCOREY+0)/(WZONEHEIGHT/8)) 165 27000 - sta temp5 ; Y 166 27000 - jsr plotcharacters 167 27000 - endif ; HSGAMENAMELEN 168 27000 - 169 27000 - ;plot "difficulty"... 170 27000 - ldy gamedifficulty 171 27000 - ifnconst HSNOLEVELNAMES 172 27000 - lda highscoredifficultytextlo,y 173 27000 - sta temp1 174 27000 - lda highscoredifficultytexthi,y 175 27000 - sta temp2 176 27000 - sec 177 27000 - lda #32 178 27000 - sbc highscoredifficultytextlen,y 179 27000 - sta temp3 ; palette/width 180 27000 - sec 181 27000 - lda #40 182 27000 - sbc highscoredifficultytextlen,y 183 27000 - asl 184 27000 - sta temp4 ; X 185 27000 - else 186 27000 - lda #HSHIGHSCOREStext 189 27000 - sta temp2 ; charmaphi 190 27000 - lda #(32-11) ; palette=0*29 | 32-(width=3) 191 27000 - sta temp3 ; palette/width 192 27000 - lda #(80-(11*2)) 193 27000 - sta temp4 ; X 194 27000 - endif ; HSNOLEVELNAMES 195 27000 - 196 27000 - lda #((HSSCOREY+2)/(WZONEHEIGHT/8)) 197 27000 - sta temp5 ; Y 198 27000 - jsr plotcharacters 199 27000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval, 4=player 2 player evel (joy1) 200 27000 - bne carronwithscoreevaluation 201 27000 - jmp donoscoreevaluation 202 27000 -carronwithscoreevaluation 203 27000 - dey 204 27000 - lda highscorelabeltextlo,y 205 27000 - sta temp1 206 27000 - lda highscorelabeltexthi,y 207 27000 - sta temp2 208 27000 - sec 209 27000 - lda #(32-15) ; palette=0*29 | 32-(width=3) 210 27000 - sta temp3 ; palette/width 211 27000 - lda highscorelabeladjust1,y 212 27000 - sta temp4 ; X 213 27000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 214 27000 - sta temp5 ; Y 215 27000 - jsr plotcharacters 216 27000 - 217 27000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval, 4=player 2 player evel (joy1) 218 27000 - dey 219 27000 - ;plot the current player score... 220 27000 - lda #(32-SCORESIZE) ; palette=0*32 221 27000 - sta temp3 ; palette/width 222 27000 - lda highscorelabeladjust2,y 223 27000 - sta temp4 ; X 224 27000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 225 27000 - sta temp5 ; Y 226 27000 - 227 27000 - lda scorevarlo,y 228 27000 - sta temp7 ; score variable lo 229 27000 - lda scorevarhi,y 230 27000 - sta temp8 ; score variable hi 231 27000 - 232 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 233 27000 - sta temp9 234 27000 - 235 27000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 236 27000 - sta temp1 ; charmaplo 237 27000 - lda #>(hiscorefont+33) 238 27000 - sta temp2 ; charmaphi 239 27000 - lda #SCORESIZE 240 27000 - sta temp6 241 27000 - ifnconst DOUBLEWIDE 242 27000 - jsr plotvalue 243 27000 - else 244 27000 - jsr plotvaluedw 245 27000 - endif 246 27000 - 247 27000 -USED_PLOTVALUE = 1 ; ensure that plotvalue gets compiled in 248 27000 - 249 27000 - ifconst HSGAMERANKS 250 27000 - 251 27000 - ldx #$ff ; start at 0 after the inx... 252 27000 -comparescore2rankloop 253 27000 - inx 254 27000 - ldy #0 255 27000 - lda rankvalue_0,x 256 27000 - cmp (temp7),y 257 27000 - bcc score2rankloopdone 258 27000 - bne comparescore2rankloop 259 27000 - iny 260 27000 - lda rankvalue_1,x 261 27000 - cmp (temp7),y 262 27000 - bcc score2rankloopdone 263 27000 - bne comparescore2rankloop 264 27000 - iny 265 27000 - lda (temp7),y 266 27000 - cmp rankvalue_2,x 267 27000 - bcs score2rankloopdone 268 27000 - jmp comparescore2rankloop 269 27000 -score2rankloopdone 270 27000 - stx hsnewscorerank 271 27000 - 272 27000 - lda ranklabello,x 273 27000 - sta temp1 274 27000 - lda ranklabelhi,x 275 27000 - sta temp2 276 27000 - sec 277 27000 - lda #32 ; palette=0*29 | 32-(width=3) 278 27000 - sbc ranklabellengths,x 279 27000 - sta temp3 ; palette/width 280 27000 - sec 281 27000 - lda #(40+6) 282 27000 - sbc ranklabellengths,x 283 27000 - asl 284 27000 - sta temp4 ; X 285 27000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 286 27000 - sta temp5 ; Y 287 27000 - jsr plotcharacters 288 27000 - 289 27000 - ldx hsnewscorerank 290 27000 - 291 27000 - lda #highscoreranklabel 294 27000 - sta temp2 295 27000 - 296 27000 - lda #(32-5) ; palette=0*29 | 32-(width=3) 297 27000 - sta temp3 ; palette/width 298 27000 - lda #(40-6) 299 27000 - sec 300 27000 - sbc ranklabellengths,x 301 27000 - asl 302 27000 - sta temp4 ; X 303 27000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 304 27000 - sta temp5 ; Y 305 27000 - jsr plotcharacters 306 27000 - endif 307 27000 - 308 27000 - 309 27000 - ; ** which line did this player beat? 310 27000 - lda #$ff 311 27000 - sta hsnewscoreline 312 27000 - ldx #$fd 313 27000 -comparescoreadd2x 314 27000 - inx 315 27000 -comparescoreadd1x 316 27000 - inx 317 27000 -comparescore2lineloop 318 27000 - inc hsnewscoreline 319 27000 - inx ; initialrun, x=0 320 27000 - cpx #15 321 27000 - beq nohighscoreforyou 322 27000 - ldy #0 323 27000 - lda HSRAMScores,x 324 27000 - cmp (temp7),y ; first score digit 325 27000 - bcc score2lineloopdonedel1x 326 27000 - bne comparescoreadd2x 327 27000 - iny 328 27000 - inx 329 27000 - lda HSRAMScores,x 330 27000 - cmp (temp7),y 331 27000 - bcc score2lineloopdonedel2x 332 27000 - bne comparescoreadd1x 333 27000 - iny 334 27000 - inx 335 27000 - lda (temp7),y 336 27000 - cmp HSRAMScores,x 337 27000 - bcs score2lineloopdonedel3x 338 27000 - jmp comparescore2lineloop 339 27000 -nohighscoreforyou 340 27000 - lda #$ff 341 27000 - sta hsnewscoreline 342 27000 - sta countdownseconds 343 27000 - jmp donoscoreevaluation 344 27000 -score2lineloopdonedel3x 345 27000 - dex 346 27000 -score2lineloopdonedel2x 347 27000 - dex 348 27000 -score2lineloopdonedel1x 349 27000 - dex 350 27000 - 351 27000 - ; 0 1 2 352 27000 - ; 3 4 5 353 27000 - ; 6 7 8 354 27000 - ; 9 0 1 355 27000 - ; 2 3 4 356 27000 - 357 27000 - stx temp9 358 27000 - cpx #11 359 27000 - beq postsortscoresuploop 360 27000 - ldx #11 361 27000 -sortscoresuploop 362 27000 - lda HSRAMScores,x 363 27000 - sta HSRAMScores+3,x 364 27000 - lda HSRAMInitials,x 365 27000 - sta HSRAMInitials+3,x 366 27000 - dex 367 27000 - cpx temp9 368 27000 - bne sortscoresuploop 369 27000 -postsortscoresuploop 370 27000 - 371 27000 - ;stick the score and cleared initials in the slot... 372 27000 - inx 373 27000 - ldy #0 374 27000 - sty hsinitialhold 375 27000 - lda (temp7),y 376 27000 - sta HSRAMScores,x 377 27000 - iny 378 27000 - lda (temp7),y 379 27000 - sta HSRAMScores+1,x 380 27000 - iny 381 27000 - lda (temp7),y 382 27000 - sta HSRAMScores+2,x 383 27000 - lda #0 384 27000 - sta HSRAMInitials,x 385 27000 - lda #29 386 27000 - sta HSRAMInitials+1,x 387 27000 - sta HSRAMInitials+2,x 388 27000 - 389 27000 - stx hsinitialpos 390 27000 - 391 27000 - ifconst vox_highscore 392 27000 - lda <#vox_highscore 393 27000 - sta speech_addr 394 27000 - lda >#vox_highscore 395 27000 - sta speech_addr+1 396 27000 - endif 397 27000 - ifconst sfx_highscore 398 27000 - lda <#sfx_highscore 399 27000 - sta temp1 400 27000 - lda >#sfx_highscore 401 27000 - sta temp2 402 27000 - lda #0 403 27000 - sta temp3 404 27000 - jsr schedulesfx 405 27000 - endif 406 27000 - ifconst songdatastart_song_highscore 407 27000 - lda #songchanneltable_song_highscore 410 27000 - sta songpointerhi 411 27000 - lda #73 412 27000 - sta songtempo 413 27000 - jsr setsongchannels 414 27000 - endif 415 27000 - 416 27000 - 417 27000 -donoscoreevaluation 418 27000 - 419 27000 - lda #(32+(32-SCORESIZE)) ; palette=0*32 | 32-(width=6) 420 27000 - sta temp3 ; palette/width 421 27000 - lda #(72+(4*(6-SCORESIZE))) 422 27000 - sta temp4 ; X 423 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 424 27000 - sta temp5 ; Y 425 27000 - lda #HSRAMScores 428 27000 - sta temp8 ; score variable hi 429 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 430 27000 - sta temp9 431 27000 -plothsscoresloop 432 27000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 433 27000 - sta temp1 ; charmaplo 434 27000 - lda #>(hiscorefont+33) 435 27000 - sta temp2 ; charmaphi 436 27000 - lda #6 437 27000 - sta temp6 438 27000 - ifnconst DOUBLEWIDE 439 27000 - jsr plotvalue 440 27000 - else 441 27000 - jsr plotvaluedw 442 27000 - endif 443 27000 - clc 444 27000 - lda temp3 445 27000 - adc #32 446 27000 - sta temp3 447 27000 - inc temp5 448 27000 - if WZONEHEIGHT = 8 449 27000 - inc temp5 450 27000 - endif 451 27000 - clc 452 27000 - lda #3 453 27000 - adc temp7 454 27000 - sta temp7 455 27000 - cmp #(<(HSRAMScores+15)) 456 27000 - bcc plothsscoresloop 457 27000 -plothsindex 458 27000 - lda #32+31 ; palette=0*32 | 32-(width=1) 459 27000 - sta temp3 ; palette/width 460 27000 - lda #44 461 27000 - sta temp4 ; X 462 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 463 27000 - sta temp5 ; Y 464 27000 - lda #hsgameslotnumbers 467 27000 - sta temp8 ; score variable hi 468 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 469 27000 - sta temp9 470 27000 -plothsindexloop 471 27000 - lda #<(hiscorefont+33) 472 27000 - sta temp1 ; charmaplo 473 27000 - lda #>(hiscorefont+33) 474 27000 - sta temp2 ; charmaphi 475 27000 - lda #1 476 27000 - sta temp6 ; number of characters 477 27000 - ifnconst DOUBLEWIDE 478 27000 - jsr plotvalue 479 27000 - else 480 27000 - jsr plotvaluedw 481 27000 - endif 482 27000 - clc 483 27000 - lda temp3 484 27000 - adc #32 485 27000 - sta temp3 486 27000 - inc temp5 487 27000 - if WZONEHEIGHT = 8 488 27000 - inc temp5 489 27000 - endif 490 27000 - inc temp7 491 27000 - lda temp7 492 27000 - cmp #(<(hsgameslotnumbers+5)) 493 27000 - bcc plothsindexloop 494 27000 - 495 27000 - jsr savescreen 496 27000 - ifnconst HSSECONDS 497 27000 - lda #6 498 27000 - else 499 27000 - lda #HSSECONDS 500 27000 - endif 501 27000 - 502 27000 - sta countdownseconds 503 27000 - 504 27000 -keepdisplayinghs 505 27000 - jsr restorescreen 506 27000 - 507 27000 - jsr setuphsinpt1 508 27000 - 509 27000 - lda hsnewscoreline 510 27000 - bpl carryonkeepdisplayinghs 511 27000 - jmp skipenterscorecontrol 512 27000 -carryonkeepdisplayinghs 513 27000 - 514 27000 - 515 27000 - ifnconst HSSECONDS 516 27000 - lda #6 517 27000 - else 518 27000 - lda #HSSECONDS 519 27000 - endif 520 27000 - 521 27000 - sta countdownseconds 522 27000 - 523 27000 - ;plot the "cursor" initial sprite... 524 27000 - lda hsinitialhold 525 27000 - 526 27000 - sta temp1 527 27000 - lda #>(hiscorefont+32) 528 27000 - sta temp2 529 27000 - lda #31 ; palette=0*32 | 32-(width=1) 530 27000 - sta temp3 ; palette/width 531 27000 - lda hscursorx 532 27000 - asl 533 27000 - asl 534 27000 - clc 535 27000 - adc #104 536 27000 - sta temp4 ; X 537 27000 - lda hsnewscoreline 538 27000 - asl 539 27000 - asl 540 27000 - asl 541 27000 - asl 542 27000 - adc #((3*16)+HSCURSORY) 543 27000 - sta temp5 ; Y 544 27000 - lda #%01000000 545 27000 - sta temp6 546 27000 - jsr plotsprite 547 27000 - 548 27000 - ldx hscursorx 549 27000 - ldy hsdisplaymode 550 27000 - lda SWCHA 551 27000 - cpy #3 552 27000 - bne hsskipadjustjoystick1 553 27000 - asl 554 27000 - asl 555 27000 - asl 556 27000 - asl 557 27000 -hsskipadjustjoystick1 558 27000 - sta hsswcha 559 27000 - lda SWCHB 560 27000 - and #%00000010 561 27000 - bne hsskipselectswitch 562 27000 - lda #%00010000 563 27000 - sta hsswcha 564 27000 - bne hsdodebouncecheck 565 27000 -hsskipselectswitch 566 27000 - lda hsswcha 567 27000 - and #%00110000 568 27000 - cmp #%00110000 569 27000 - beq hsjoystickskipped 570 27000 -hsdodebouncecheck 571 27000 - lda hsjoydebounce 572 27000 - beq hsdontdebounce 573 27000 - jmp hspostjoystick 574 27000 -hsdontdebounce 575 27000 - ldx #1 ; small tick sound 576 27000 - jsr playhssfx 577 27000 - lda hsswcha 578 27000 - and #%00110000 579 27000 - ldx hscursorx 580 27000 - cmp #%00100000 ; check down 581 27000 - bne hsjoycheckup 582 27000 - ldy hsinitialhold 583 27000 - cpx #0 584 27000 - bne skipavoid31_1 585 27000 - cpy #0 ; if we're about to change to the <- char (#31) then double-decrement to skip over it 586 27000 - bne skipavoid31_1 587 27000 - dey 588 27000 -skipavoid31_1 589 27000 - dey 590 27000 - jmp hssetdebounce 591 27000 -hsjoycheckup 592 27000 - cmp #%00010000 ; check up 593 27000 - bne hsjoystickskipped 594 27000 - ldy hsinitialhold 595 27000 - cpx #0 596 27000 - bne skipavoid31_2 597 27000 - cpy #30 ; if we're about to change to the <- char (#31) then double-increment to skip over it 598 27000 - bne skipavoid31_2 599 27000 - iny 600 27000 -skipavoid31_2 601 27000 - iny 602 27000 -hssetdebounce 603 27000 - tya 604 27000 - and #31 605 27000 - sta hsinitialhold 606 27000 - lda #15 607 27000 - sta hsjoydebounce 608 27000 - bne hspostjoystick 609 27000 -hsjoystickskipped 610 27000 - ; check the fire button only when the stick isn't engaged 611 27000 - lda hsinpt1 612 27000 - bpl hsbuttonskipped 613 27000 - lda hsjoydebounce 614 27000 - beq hsfiredontdebounce 615 27000 - bne hspostjoystick 616 27000 -hsfiredontdebounce 617 27000 - lda hsinitialhold 618 27000 - cmp #31 619 27000 - beq hsmovecursorback 620 27000 - inc hscursorx 621 27000 - inc hsinitialpos 622 27000 - lda hscursorx 623 27000 - cmp #3 624 27000 - bne skiphsentryisdone 625 27000 - lda #0 626 27000 - sta framecounter 627 27000 - lda #$ff 628 27000 - sta hsnewscoreline 629 27000 - dec hsinitialpos 630 27000 - bne skiphsentryisdone 631 27000 -hsmovecursorback 632 27000 - lda hscursorx 633 27000 - beq skiphsmovecursorback 634 27000 - lda #29 635 27000 - ldx hsinitialpos 636 27000 - sta HSRAMInitials,x 637 27000 - dec hsinitialpos 638 27000 - dec hscursorx 639 27000 - dex 640 27000 - lda HSRAMInitials,x 641 27000 - sta hsinitialhold 642 27000 -skiphsmovecursorback 643 27000 -skiphsentryisdone 644 27000 - ldx #0 645 27000 - jsr playhssfx 646 27000 - lda #20 647 27000 - sta hsjoydebounce 648 27000 - bne hspostjoystick 649 27000 - 650 27000 -hsbuttonskipped 651 27000 - lda #0 652 27000 - sta hsjoydebounce 653 27000 -hspostjoystick 654 27000 - 655 27000 - ldx hsinitialpos 656 27000 - lda hsinitialhold 657 27000 - sta HSRAMInitials,x 658 27000 - 659 27000 - jmp skiphschasecolors 660 27000 - 661 27000 -skipenterscorecontrol 662 27000 - jsr hschasecolors 663 27000 - jsr setuphsinpt1 664 27000 - lda hsjoydebounce 665 27000 - bne skiphschasecolors 666 27000 - lda hsinpt1 667 27000 - bmi returnfromhs 668 27000 -skiphschasecolors 669 27000 - 670 27000 - jsr drawscreen 671 27000 - 672 27000 - lda countdownseconds 673 27000 - beq returnfromhs 674 27000 - jmp keepdisplayinghs 675 27000 -returnfromhs 676 27000 - 677 27000 - ifconst songdatastart_song_highscore 678 27000 - lda hsdisplaymode 679 27000 - beq skipclearHSCsong 680 27000 - lda #0 681 27000 - sta songtempo 682 27000 -skipclearHSCsong 683 27000 - endif 684 27000 - jsr drawwait 685 27000 - jsr clearscreen 686 27000 - lda #0 687 27000 - ldy #7 688 27000 - jsr blacken320colors 689 27000 - lda ssCTRL 690 27000 - sta sCTRL 691 27000 - lda ssCHARBASE 692 27000 - sta sCHARBASE 693 27000 - rts 694 27000 - 695 27000 -setuphsinpt1 696 27000 - lda #$ff 697 27000 - sta hsinpt1 698 27000 - lda hsjoydebounce 699 27000 - beq skipdebounceadjust 700 27000 - dec hsjoydebounce 701 27000 - bne skipstorefirebuttonstatus 702 27000 -skipdebounceadjust 703 27000 - lda SWCHB 704 27000 - and #%00000001 705 27000 - bne hscheckresetover 706 27000 - lda #$ff 707 27000 - sta hsinpt1 708 27000 - rts 709 27000 -hscheckresetover 710 27000 - ldx hsdisplaymode 711 27000 - cpx #3 712 27000 - bne hsskipadjustjoyfire1 713 27000 - lda sINPT3 714 27000 - jmp hsskipadjustjoyfire1done 715 27000 -hsskipadjustjoyfire1 716 27000 - lda sINPT1 717 27000 -hsskipadjustjoyfire1done 718 27000 - sta hsinpt1 719 27000 -skipstorefirebuttonstatus 720 27000 - rts 721 27000 - 722 27000 -blacken320colors 723 27000 - ldy #7 724 27000 -blacken320colorsloop 725 27000 - sta P0C2,y 726 27000 - dey 727 27000 - bpl blacken320colorsloop 728 27000 - rts 729 27000 - 730 27000 -hschasecolors 731 27000 - lda framecounter 732 27000 - and #3 733 27000 - bne hschasecolorsreturn 734 27000 - inc hscolorchaseindex 735 27000 - lda hscolorchaseindex 736 27000 - 737 27000 - sta P5C2 738 27000 - sbc #$02 739 27000 - sta P4C2 740 27000 - sbc #$02 741 27000 - sta P3C2 742 27000 - sbc #$02 743 27000 - sta P2C2 744 27000 - sbc #$02 745 27000 - sta P1C2 746 27000 -hschasecolorsreturn 747 27000 - rts 748 27000 - 749 27000 -playhssfx 750 27000 - lda hssfx_lo,x 751 27000 - sta temp1 752 27000 - lda hssfx_hi,x 753 27000 - sta temp2 754 27000 - lda #0 755 27000 - sta temp3 756 27000 - jmp schedulesfx 757 27000 - 758 27000 -hssfx_lo 759 27000 - .byte sfx_hsletterpositionchange, >sfx_hslettertick 762 27000 - 763 27000 -sfx_hsletterpositionchange 764 27000 - .byte $10,$18,$00 765 27000 - .byte $02,$06,$08 766 27000 - .byte $02,$06,$04 767 27000 - .byte $00,$00,$00 768 27000 -sfx_hslettertick 769 27000 - .byte $10,$18,$00 770 27000 - .byte $00,$00,$0a 771 27000 - .byte $00,$00,$00 772 27000 - 773 27000 -highscorelabeladjust1 774 27000 - .byte (80-(14*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)) 775 27000 -highscorelabeladjust2 776 27000 - .byte (80+(14*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)) 777 27000 - 778 27000 -scorevarlo 779 27000 - .byte <(score0+((6-SCORESIZE)/2)),<(score0+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)) 780 27000 -scorevarhi 781 27000 - .byte >(score0+((6-SCORESIZE)/2)),>(score0+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)) 782 27000 - 783 27000 - ifnconst HSNOLEVELNAMES 784 27000 -highscoredifficultytextlo 785 27000 - .byte easylevelname, >mediumlevelname, >hardlevelname, >expertlevelname 788 27000 - ifnconst HSCUSTOMLEVELNAMES 789 27000 -highscoredifficultytextlen 790 27000 - .byte 22, 30, 26, 24 791 27000 - 792 27000 -easylevelname 793 27000 - .byte $04,$00,$12,$18,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 794 27000 -mediumlevelname 795 27000 - .byte $08,$0d,$13,$04,$11,$0c,$04,$03,$08,$00,$13,$04,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 796 27000 -hardlevelname 797 27000 - .byte $00,$03,$15,$00,$0d,$02,$04,$03,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 798 27000 -expertlevelname 799 27000 - .byte $04,$17,$0f,$04,$11,$13,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 800 27000 - else 801 27000 - include "7800hsgamediffnames.asm" 802 27000 - endif ; HSCUSTOMLEVELNAMES 803 27000 - else 804 27000 -HSHIGHSCOREStext 805 27000 - .byte $07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 806 27000 - endif ; HSNOLEVELNAMES 807 27000 - 808 27000 -highscorelabeltextlo 809 27000 - .byte player0label, >player1label, >player2label, >player2label 812 27000 - 813 27000 -player0label 814 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$12,$02,$0e,$11,$04,$1a,$1d,$1d 815 27000 - 816 27000 -player1label 817 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$22,$1d,$12,$02,$0e,$11,$04,$1a 818 27000 - 819 27000 -player2label 820 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$23,$1d,$12,$02,$0e,$11,$04,$1a 821 27000 - 822 27000 - 823 27000 - ifconst HSGAMENAMELEN 824 27000 -HSGAMENAMEtable 825 27000 - include "7800hsgamename.asm" 826 27000 - endif 827 27000 - ifconst HSGAMERANKS 828 27000 - include "7800hsgameranks.asm" 829 27000 -highscoreranklabel 830 27000 - .byte $11,$00,$0d,$0a,$1a 831 27000 - endif 832 27000 - 833 27000 - ;ensure our table doesn't wrap a page... 834 27000 - if ((<*)>251) 835 27000 - align 256 836 27000 - endif 837 27000 -hsgameslotnumbers 838 27000 - .byte 33,34,35,36,37 839 27000 - endif 840 27000 - 841 27000 -loaddifficultytable 842 27000 - lda gamedifficulty 843 27000 - and #$03 ; ensure the user hasn't selected an invalid difficulty 844 27000 - sta gamedifficulty 845 27000 - cmp hsdifficulty ; check game difficulty is the same as RAM table 846 27000 - bne loaddifficultytablecontinue1 847 27000 - rts ; this high score difficulty table is already loaded 848 27000 -loaddifficultytablecontinue1 849 27000 - lda gamedifficulty 850 27000 - sta hsdifficulty 851 27000 - ;we need to check the device for the table 852 27000 - lda hsdevice 853 27000 - bne loaddifficultytablecontinue2 854 27000 - ; there's no save device. clear out this table. 855 27000 - jmp cleardifficultytablemem 856 27000 -loaddifficultytablecontinue2 857 27000 - lda hsdevice 858 27000 - and #1 859 27000 - beq memdeviceisntHSC 860 27000 - jmp loaddifficultytableHSC 861 27000 -memdeviceisntHSC 862 27000 - jmp loaddifficultytableAVOX 863 27000 - 864 27000 -savedifficultytable 865 27000 - ;*** we need to check which device we should use... 866 27000 - lda hsdevice 867 27000 - bne savedifficultytablerealdevice 868 27000 - rts ; its a ram device 869 27000 -savedifficultytablerealdevice 870 27000 - and #1 871 27000 - beq savememdeviceisntHSC 872 27000 - jmp savedifficultytableHSC 873 27000 -savememdeviceisntHSC 874 27000 - jmp savedifficultytableAVOX 875 27000 - 876 27000 -savedifficultytableAVOX 877 27000 - ; the load call already setup the memory structure and atarivox memory location 878 27000 - jsr savealoadedHSCtablecontinue 879 27000 -savedifficultytableAVOXskipconvert 880 27000 - lda #HSIDHI 881 27000 - sta eeprombuffer 882 27000 - lda #HSIDLO 883 27000 - sta eeprombuffer+1 884 27000 - lda hsdifficulty 885 27000 - sta eeprombuffer+2 886 27000 - lda #32 887 27000 - jsr AVoxWriteBytes 888 27000 - rts 889 27000 - 890 27000 -savedifficultytableHSC 891 27000 - ;we always load a table before reaching here, so the 892 27000 - ;memory structures from the load should be intact... 893 27000 - ldy hsgameslot 894 27000 - bpl savealoadedHSCtable 895 27000 - rts 896 27000 -savealoadedHSCtable 897 27000 - lda HSCGameDifficulty,y 898 27000 - cmp #$7F 899 27000 - bne savealoadedHSCtablecontinue 900 27000 - jsr initializeHSCtableentry 901 27000 -savealoadedHSCtablecontinue 902 27000 - ;convert our RAM table to HSC format and write it out... 903 27000 - ldy #0 904 27000 - ldx #0 905 27000 -savedifficultytableScores 906 27000 - 907 27000 - lda HSRAMInitials,x 908 27000 - sta temp3 909 27000 - lda HSRAMInitials+1,x 910 27000 - sta temp4 911 27000 - lda HSRAMInitials+2,x 912 27000 - sta temp5 913 27000 - jsr encodeHSCInitials ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 914 27000 - 915 27000 - lda temp1 916 27000 - sta (HSGameTableLo),y 917 27000 - iny 918 27000 - lda temp2 919 27000 - sta (HSGameTableLo),y 920 27000 - iny 921 27000 - 922 27000 - lda HSRAMScores,x 923 27000 - sta (HSGameTableLo),y 924 27000 - iny 925 27000 - lda HSRAMScores+1,x 926 27000 - sta (HSGameTableLo),y 927 27000 - iny 928 27000 - lda HSRAMScores+2,x 929 27000 - sta (HSGameTableLo),y 930 27000 - iny 931 27000 - inx 932 27000 - inx 933 27000 - inx ; +3 934 27000 - cpx #15 935 27000 - bne savedifficultytableScores 936 27000 - rts 937 27000 - 938 27000 -loaddifficultytableHSC 939 27000 - ; routine responsible for loading the difficulty table from HSC 940 27000 - jsr findindexHSC 941 27000 - ldy hsgameslot 942 27000 - lda HSCGameDifficulty,y 943 27000 - cmp #$7F 944 27000 - bne loaddifficultytableHSCcontinue 945 27000 - ;there was an error. use a new RAM table instead... 946 27000 - jsr initializeHSCtableentry 947 27000 - jmp cleardifficultytablemem 948 27000 -loaddifficultytableHSCcontinue 949 27000 - ; parse the data into the HS memory... 950 27000 - ldy #0 951 27000 - ldx #0 952 27000 -loaddifficultytableScores 953 27000 - lda (HSGameTableLo),y 954 27000 - sta temp1 955 27000 - iny 956 27000 - lda (HSGameTableLo),y 957 27000 - sta temp2 958 27000 - jsr decodeHSCInitials ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 959 27000 - iny 960 27000 - lda (HSGameTableLo),y 961 27000 - sta HSRAMScores,x 962 27000 - lda temp3 963 27000 - sta HSRAMInitials,x 964 27000 - inx 965 27000 - iny 966 27000 - lda (HSGameTableLo),y 967 27000 - sta HSRAMScores,x 968 27000 - lda temp4 969 27000 - sta HSRAMInitials,x 970 27000 - inx 971 27000 - iny 972 27000 - lda (HSGameTableLo),y 973 27000 - sta HSRAMScores,x 974 27000 - lda temp5 975 27000 - sta HSRAMInitials,x 976 27000 - inx 977 27000 - iny 978 27000 - cpx #15 979 27000 - bne loaddifficultytableScores 980 27000 - rts 981 27000 - 982 27000 -decodeHSCInitials 983 27000 - ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 984 27000 - ; 2 bytes are packed in the form: 22211111 22_33333 985 27000 - lda #0 986 27000 - sta temp4 987 27000 - lda temp1 988 27000 - and #%00011111 989 27000 - sta temp3 990 27000 - 991 27000 - lda temp2 992 27000 - and #%00011111 993 27000 - sta temp5 994 27000 - 995 27000 - lda temp1 996 27000 - asl 997 27000 - rol temp4 998 27000 - asl 999 27000 - rol temp4 1000 27000 - asl 1001 27000 - rol temp4 1002 27000 - lda temp2 1003 27000 - asl 1004 27000 - rol temp4 1005 27000 - asl 1006 27000 - rol temp4 1007 27000 - rts 1008 27000 -encodeHSCInitials 1009 27000 - ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 1010 27000 - ; 2 bytes are packed in the form: 22211111 22_33333 1011 27000 - ; start with packing temp1... 1012 27000 - lda temp4 1013 27000 - and #%00011100 1014 27000 - sta temp1 1015 27000 - asl temp1 1016 27000 - asl temp1 1017 27000 - asl temp1 1018 27000 - lda temp3 1019 27000 - and #%00011111 1020 27000 - ora temp1 1021 27000 - sta temp1 1022 27000 - ; ...temp1 is now packed, on to temp2... 1023 27000 - lda temp5 1024 27000 - asl 1025 27000 - asl 1026 27000 - ror temp4 1027 27000 - ror 1028 27000 - ror temp4 1029 27000 - ror 1030 27000 - sta temp2 1031 27000 - rts 1032 27000 - 1033 27000 -findindexHSCerror 1034 27000 - ;the HSC is stuffed. return the bad slot flag 1035 27000 - ldy #$ff 1036 27000 - sty hsgameslot 1037 27000 - rts 1038 27000 - 1039 27000 -findindexHSC 1040 27000 -HSCGameID1 = $1029 1041 27000 -HSCGameID2 = $106E 1042 27000 -HSCGameDifficulty = $10B3 1043 27000 -HSCGameIndex = $10F8 1044 27000 - ; routine responsible for finding the game index from HSC 1045 27000 - ; call with x=0 to create a new table if none exist, call with x=$ff to avoid creating new tables 1046 27000 - ; the HS loading routine will use x=$ff, the HS saving routine will use x=0 1047 27000 - ldy #69 ; start +1 to account for the dey 1048 27000 -findindexHSCloop 1049 27000 - dey 1050 27000 - bmi findindexHSCerror 1051 27000 - lda HSCGameDifficulty,y 1052 27000 - cmp #$7F 1053 27000 - beq findourindexHSC 1054 27000 - cmp gamedifficulty 1055 27000 - bne findindexHSCloop 1056 27000 - lda HSCGameID1,y 1057 27000 - cmp #HSIDHI 1058 27000 - bne findindexHSCloop 1059 27000 - lda HSCGameID2,y 1060 27000 - cmp #HSIDLO 1061 27000 - bne findindexHSCloop 1062 27000 -findourindexHSC 1063 27000 - ; if we're here we found our index in the table 1064 27000 - ; or we found the first empty one 1065 27000 - sty hsgameslot 1066 27000 - jsr setupHSCGamepointer ; setup the pointer to the HS Table for this game... 1067 27000 - rts 1068 27000 - 1069 27000 - 1070 27000 -initializeHSCtableentry 1071 27000 - ldy hsgameslot 1072 27000 - ; we need to make a new entry... 1073 27000 - lda #HSIDHI 1074 27000 - sta HSCGameID1,y 1075 27000 - lda #HSIDLO 1076 27000 - sta HSCGameID2,y 1077 27000 - lda gamedifficulty 1078 27000 - sta HSCGameDifficulty,y 1079 27000 - ldx #0 1080 27000 -fixHSDGameDifficultylistLoop 1081 27000 - inx 1082 27000 - txa 1083 27000 - sta HSCGameIndex,y 1084 27000 - iny 1085 27000 - cpy #69 1086 27000 - bne fixHSDGameDifficultylistLoop 1087 27000 - rts 1088 27000 - 1089 27000 -setupHSCGamepointer 1090 27000 - ; this routines sets (HSGameTableLo) pointing to the game's HS table 1091 27000 - lda #$17 1092 27000 - sta HSGameTableHi 1093 27000 - lda #$FA 1094 27000 - sta HSGameTableLo 1095 27000 -setupHSCGamepointerLoop 1096 27000 - lda HSGameTableLo 1097 27000 - sec 1098 27000 - sbc #25 1099 27000 - sta HSGameTableLo 1100 27000 - lda HSGameTableHi 1101 27000 - sbc #0 1102 27000 - sta HSGameTableHi 1103 27000 - iny 1104 27000 - cpy #69 1105 27000 - bne setupHSCGamepointerLoop 1106 27000 - rts 1107 27000 - 1108 27000 -loaddifficultytableAVOX 1109 27000 - ; routine responsible for loading the difficulty table from Avox 1110 27000 - ; we reuse HSC routines to format data to/from our Avox RAM buffer... 1111 27000 - lda #>(eeprombuffer+3) 1112 27000 - sta HSGameTableHi 1113 27000 - lda #<(eeprombuffer+3) 1114 27000 - sta HSGameTableLo 1115 27000 - 1116 27000 - ; the start location in EEPROM, subtract 32... 1117 27000 - lda #$5F 1118 27000 - sta HSVoxHi 1119 27000 - lda #$E0 1120 27000 - sta HSVoxLo 1121 27000 - lda #0 1122 27000 - sta temp1 1123 27000 -loaddifficultytableAVOXloop 1124 27000 - inc temp1 1125 27000 - beq loaddifficultytableAVOXfull 1126 27000 - clc 1127 27000 - lda HSVoxLo 1128 27000 - adc #32 1129 27000 - sta HSVoxLo 1130 27000 - lda HSVoxHi 1131 27000 - adc #0 1132 27000 - sta HSVoxHi 1133 27000 - lda #3 1134 27000 - jsr AVoxReadBytes ; read in 3 bytes, ID1,ID2,Difficulty 1135 27000 - lda eeprombuffer 1136 27000 - cmp #$FF 1137 27000 - beq loaddifficultytableAVOXempty 1138 27000 - cmp #HSIDHI 1139 27000 - bne loaddifficultytableAVOXloop 1140 27000 - lda eeprombuffer+1 1141 27000 - cmp #HSIDLO 1142 27000 - bne loaddifficultytableAVOXloop 1143 27000 - lda eeprombuffer+2 1144 27000 - cmp gamedifficulty 1145 27000 - bne loaddifficultytableAVOXloop 1146 27000 -loaddifficultytableAVOXdone 1147 27000 - lda #32 1148 27000 - jsr AVoxReadBytes 1149 27000 - jsr loaddifficultytableHSCcontinue 1150 27000 - rts 1151 27000 -loaddifficultytableAVOXfull 1152 27000 - lda #0 1153 27000 - sta hsdevice ; looks like all 255 entries are taken... disable it. 1154 27000 -loaddifficultytableAVOXempty 1155 27000 - jmp cleardifficultytablemem 1156 27000 - rts 1157 27000 - 1158 27000 -cleardifficultytablemem 1159 27000 - ldy #29 1160 27000 - lda #0 1161 27000 -cleardifficultytablememloop 1162 27000 - sta HSRAMTable,y 1163 27000 - dey 1164 27000 - bpl cleardifficultytablememloop 1165 27000 - rts 1166 27000 -hiscoremoduleend 1167 27000 - 1168 27000 - ifconst DOUBLEWIDE 1169 27000 -plotvaluedw 1170 27000 -plotdigitcount = temp6 1171 27000 - lda #0 1172 27000 - tay 1173 27000 - ldx valbufend 1174 27000 - 1175 27000 - lda plotdigitcount 1176 27000 - and #1 1177 27000 - beq pvnibble2chardw 1178 27000 - lda #0 1179 27000 - sta VALBUFFER,x ; just in case we skip this digit 1180 27000 - beq pvnibble2char_skipnibbledw 1181 27000 - 1182 27000 -pvnibble2chardw 1183 27000 - ; high nibble... 1184 27000 - lda (temp7),y 1185 27000 - and #$f0 1186 27000 - lsr 1187 27000 - lsr 1188 27000 - lsr 1189 27000 - lsr 1190 27000 - 1191 27000 - clc 1192 27000 - adc temp1 ; add the offset to character graphics to our value 1193 27000 - sta VALBUFFER,x 1194 27000 - inx 1195 27000 - dec plotdigitcount 1196 27000 -pvnibble2char_skipnibbledw 1197 27000 - ; low nibble... 1198 27000 - lda (temp7),y 1199 27000 - and #$0f 1200 27000 - clc 1201 27000 - adc temp1 ; add the offset to character graphics to our value 1202 27000 - sta VALBUFFER,x 1203 27000 - inx 1204 27000 - iny 1205 27000 - 1206 27000 - dec plotdigitcount 1207 27000 - bne pvnibble2chardw 1208 27000 - ;point to the start of our valuebuffer 1209 27000 - clc 1210 27000 - lda #VALBUFFER 1214 27000 - adc #0 1215 27000 - sta temp2 1216 27000 - 1217 27000 - ;advance valbufend to the end of our value buffer 1218 27000 - stx valbufend 1219 27000 - 1220 27000 - ifnconst plotvalueonscreen 1221 27000 - jmp plotcharacters 1222 27000 - else 1223 27000 - jmp plotcharacterslive 1224 27000 - endif 1225 27000 - endif ; DOUBLEWIDE 1226 27000 - 1227 27000 -hiscoreend 1228 27000 - echo " (hiscore module is using ",[(hiscoreend-hiscorestart)]d," bytes)" 1229 27000 endif ; HSSUPPORT 1230 27000 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite6.78b.asm 5369 27000 endif 5370 27000 ifnconst included.fourbitfade.asm ------- FILE fourbitfade.asm LEVEL 2 PASS 3 0 27000 include fourbitfade.asm 1 27000 ; ** fourbit fade, which is useful for audio levels and brightness fades 2 27000 ; ** input: A=value to fade, fourbitfadevalue=global fade value 3 27000 ; ** N.B. the global fade value is in the upper nibble. i.e. $Fx-0x 4 27000 ; ** output: A=faded value in lo nibble. orig top nibble is preserved, 5 27000 ; ** other registers are preserved 6 27000 7 27000 - ifconst FOURBITFADE 8 27000 - 9 27000 - ; non-interrupt routine 10 27000 - 11 27000 -fourbitfade 12 27000 - sty fourbittemp1 13 27000 - pha 14 27000 - and #$0F 15 27000 - ora fourbitfadevalue 16 27000 - tay 17 27000 - pla 18 27000 - and #$F0 19 27000 - ora fourbitfadelut,y 20 27000 - ldy fourbittemp1 ; restore Y 21 27000 - rts 22 27000 - 23 27000 - ; interrupt routine 24 27000 - 25 27000 -fourbitfadeint 26 27000 - sty fourbittemp1int 27 27000 - pha 28 27000 - and #$0F 29 27000 - ora fourbitfadevalueint 30 27000 - tay 31 27000 - pla 32 27000 - and #$F0 33 27000 - ora fourbitfadelut,y 34 27000 - ldy fourbittemp1int ; restore Y 35 27000 - rts 36 27000 - 37 27000 -fourbitfadelut 38 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 39 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01 40 27000 - .byte $00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$02,$02,$02,$02,$02 41 27000 - .byte $00,$00,$00,$00,$01,$01,$01,$01,$02,$02,$02,$02,$03,$03,$03,$03 42 27000 - .byte $00,$00,$00,$00,$01,$01,$01,$02,$02,$02,$03,$03,$03,$04,$04,$04 43 27000 - .byte $00,$00,$00,$01,$01,$01,$02,$02,$03,$03,$03,$04,$04,$04,$05,$05 44 27000 - .byte $00,$00,$00,$01,$01,$02,$02,$03,$03,$03,$04,$04,$05,$05,$06,$06 45 27000 - .byte $00,$00,$01,$01,$02,$02,$03,$03,$04,$04,$05,$05,$06,$06,$07,$07 46 27000 - .byte $00,$00,$01,$01,$02,$02,$03,$03,$04,$05,$05,$06,$06,$07,$07,$08 47 27000 - .byte $00,$00,$01,$01,$02,$03,$03,$04,$05,$05,$06,$06,$07,$08,$08,$09 48 27000 - .byte $00,$00,$01,$02,$02,$03,$04,$04,$05,$06,$06,$07,$08,$08,$09,$0a 49 27000 - .byte $00,$00,$01,$02,$03,$03,$04,$05,$06,$06,$07,$08,$09,$09,$0a,$0b 50 27000 - .byte $00,$00,$01,$02,$03,$04,$04,$05,$06,$07,$08,$08,$09,$0a,$0b,$0c 51 27000 - .byte $00,$00,$01,$02,$03,$04,$05,$06,$07,$07,$08,$09,$0a,$0b,$0c,$0d 52 27000 - .byte $00,$00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0d,$0e 53 27000 - .byte $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0d,$0e,$0f 54 27000 - 55 27000 -fourbitfadeend 56 27000 - 57 27000 - echo " (fourbitfade module is using ",[(fourbitfadeend-fourbitfade)]d," bytes)" 58 27000 - 59 27000 endif ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite6.78b.asm 5372 27000 endif 5373 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5374 27000 5375 27000 ;standard routimes needed for pretty much all games 5376 27000 5377 27000 ; some definitions used with "set debug color" 5378 27000 00 91 DEBUGCALC = $91 5379 27000 00 41 DEBUGWASTE = $41 5380 27000 00 c1 DEBUGDRAW = $C1 5381 27000 5382 27000 ;NMI and IRQ handlers 5383 27000 NMI 5384 27000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 5385 27000 48 pha ; save A 5386 27001 d8 cld 5387 27002 a5 4d lda visibleover 5388 27004 49 ff eor #255 5389 27006 85 4d sta visibleover 5390 27008 - ifconst DEBUGINTERRUPT 5391 27008 - and #$93 5392 27008 - sta BACKGRND 5393 27008 endif 5394 27008 8a txa ; save X 5395 27009 48 pha 5396 2700a 98 tya ; save Y 5397 2700b 48 pha 5398 2700c ce b2 01 dec interruptindex 5399 2700f d0 03 bne skipreallyoffvisible 5400 27011 4c 6b f0 jmp reallyoffvisible 5401 27014 skipreallyoffvisible 5402 27014 a5 4d lda visibleover 5403 27016 d0 03 bne carryontopscreenroutine 5404 27018 - ifconst .bottomscreenroutine 5405 27018 - lda interrupthold 5406 27018 - beq skipbottomroutine 5407 27018 - jsr .bottomscreenroutine 5408 27018 -skipbottomroutine 5409 27018 endif 5410 27018 4c 79 f0 jmp NMIexit 5411 2701b carryontopscreenroutine 5412 2701b - ifconst .topscreenroutine 5413 2701b - lda interrupthold 5414 2701b - beq skiptoproutine 5415 2701b - jsr .topscreenroutine 5416 2701b -skiptoproutine 5417 2701b endif 5418 2701b ifnconst CANARYOFF 5419 2701b ad c1 01 lda canary 5420 2701e f0 07 beq skipcanarytriggered 5421 27020 a9 45 lda #$45 5422 27022 85 20 sta BACKGRND 5423 27024 4c 63 f0 jmp skipbrkolorset ; common crash dump routine, if available 5424 27027 skipcanarytriggered 5425 27027 endif 5426 27027 5427 27027 ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 5428 2702a 5429 2702a ; ** Other important routines that need to regularly run, and can run onscreen. 5430 2702a ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 5431 2702a 5432 2702a - ifconst LONGCONTROLLERREAD 5433 2702a -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 5434 2702a - ldy port1control 5435 2702a - lda longreadtype,y 5436 2702a - beq LLRET1 5437 2702a - tay 5438 2702a - lda longreadroutinehiP1,y 5439 2702a - sta inttemp4 5440 2702a - lda longreadroutineloP1,y 5441 2702a - sta inttemp3 5442 2702a - jmp (inttemp3) 5443 2702a -LLRET1 5444 2702a - ldy port0control 5445 2702a - lda longreadtype,y 5446 2702a - beq LLRET0 5447 2702a - tay 5448 2702a - lda longreadroutinehiP0,y 5449 2702a - sta inttemp4 5450 2702a - lda longreadroutineloP0,y 5451 2702a - sta inttemp3 5452 2702a - jmp (inttemp3) 5453 2702a -LLRET0 5454 2702a - 5455 2702a - 5456 2702a - ifconst PADDLERANGE 5457 2702a -TIMEVAL = PADDLERANGE 5458 2702a - else 5459 2702a -TIMEVAL = 160 5460 2702a - endif 5461 2702a -TIMEOFFSET = 10 5462 2702a - 5463 2702a endif ; LONGCONTROLLERREAD 5464 2702a 5465 2702a 5466 2702a 20 e0 f1 jsr servicesfxchannels 5467 2702d - ifconst MUSICTRACKER 5468 2702d - jsr servicesong 5469 2702d endif ; MUSICTRACKER 5470 2702d - ifconst RMT 5471 2702d - lda rasterpause 5472 2702d - beq skiprasterupdate 5473 2702d - jsr RASTERMUSICTRACKER+3 5474 2702d -skiprasterupdate 5475 2702d -RMT_Iend 5476 2702d endif 5477 2702d 5478 2702d ee a4 01 inc framecounter 5479 27030 ad a4 01 lda framecounter 5480 27033 29 3f and #63 5481 27035 d0 08 bne skipcountdownseconds 5482 27037 ad a5 01 lda countdownseconds 5483 2703a f0 03 beq skipcountdownseconds 5484 2703c ce a5 01 dec countdownseconds 5485 2703f skipcountdownseconds 5486 2703f 5487 2703f a2 01 ldx #1 5488 27041 buttonreadloop 5489 27041 8a txa 5490 27042 48 pha 5491 27043 bc b7 01 ldy port0control,x 5492 27046 b9 bd f1 lda buttonhandlerlo,y 5493 27049 85 da sta inttemp3 5494 2704b b9 b1 f1 lda buttonhandlerhi,y 5495 2704e 85 db sta inttemp4 5496 27050 05 da ora inttemp3 5497 27052 f0 03 beq buttonreadloopreturn 5498 27054 6c da 00 jmp (inttemp3) 5499 27057 buttonreadloopreturn 5500 27057 68 pla 5501 27058 aa tax 5502 27059 ca dex 5503 2705a 10 e5 bpl buttonreadloop 5504 2705c 5505 2705c - ifconst KEYPADSUPPORT 5506 2705c - jsr keypadrowselect 5507 2705c endif ; KEYPADSUPPORT 5508 2705c 5509 2705c 5510 2705c - ifconst DOUBLEBUFFER 5511 2705c - lda doublebufferminimumframeindex 5512 2705c - beq skipdoublebufferminimumframeindexadjust 5513 2705c - dec doublebufferminimumframeindex 5514 2705c -skipdoublebufferminimumframeindexadjust 5515 2705c endif 5516 2705c 5517 2705c 4c 79 f0 jmp NMIexit 5518 2705f 5519 2705f IRQ ; the only source of non-nmi interrupt should be the BRK opcode. 5520 2705f ifnconst BREAKPROTECTOFF 5521 2705f a9 1a lda #$1A 5522 27061 85 20 sta BACKGRND 5523 27063 skipbrkolorset 5524 27063 skipbrkdetected 5525 27063 a9 60 lda #$60 5526 27065 8d 07 21 sta sCTRL 5527 27068 85 3c sta CTRL 5528 2706a ifnconst hiscorefont 5529 2706a 02 .byte.b $02 ; KIL/JAM 5530 2706b - else ; hiscorefont is present 5531 2706b - ifconst CRASHDUMP 5532 2706b - bit MSTAT 5533 2706b - bpl skipbrkdetected ; wait for vblank to ensure we're clear of NMI 5534 2706b - 5535 2706b - ifconst dumpbankswitch 5536 2706b - lda dumpbankswitch 5537 2706b - pha 5538 2706b - endif 5539 2706b - 5540 2706b - ; bankswitch if needed, to get to the hiscore font 5541 2706b - ifconst bankswitchmode 5542 2706b - ifconst included.hiscore.asm.bank 5543 2706b - ifconst MCPDEVCART 5544 2706b - lda #($18 | included.hiscore.asm.bank) 5545 2706b - sta $3000 5546 2706b - else 5547 2706b - lda #(included.hiscore.asm.bank) 5548 2706b - sta $8000 5549 2706b - endif 5550 2706b - endif ; included.hiscore.asm.bank 5551 2706b - endif ; bankswitchmode 5552 2706b - 5553 2706b - ifconst DOUBLEBUFFER 5554 2706b - ;turn off double-buffering, if on... 5555 2706b - lda #>DLLMEM 5556 2706b - sta DPPH 5557 2706b - lda #hiscorefont 5601 2706b - sta CHARBASE 5602 2706b - sta sCHARBASE 5603 2706b - lda #%01000011 ;Enable DMA, mode=320A 5604 2706b - sta CTRL 5605 2706b - sta sCTRL 5606 2706b - .byte $02 ; KIL/JAM 5607 2706b -hiscorehexlut 5608 2706b - ; 0 1 2 3 4 5 6 7 8 9 A B C D E F 5609 2706b - .byte 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 1, 2, 3, 4, 5 5610 2706b -show2700 5611 2706b - ; lo mode hi width=29 x EODL 5612 2706b - .byte $00, %01100000, $27, 3, 20, 0,0,0 5613 2706b - else ; CRASHDUMP 5614 2706b - .byte $02 ; KIL/JAM 5615 2706b - endif ; crashdump 5616 2706b endif ; hiscorefont 5617 2706b - else 5618 2706b - RTI 5619 2706b endif 5620 2706b 5621 2706b - ifconst LONGCONTROLLERREAD 5622 2706b - 5623 2706b -longreadtype 5624 2706b - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 5625 2706b - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 5626 2706b - .byte 3, 3, 0, 0 ; STMOUSE AMOUSE ATARIVOX SNES 5627 2706b - 5628 2706b -longreadroutineloP0 5629 2706b - .byte LLRET0 ; 0 = no routine 5636 2706b - .byte >paddleport0update ; 1 = paddle 5637 2706b - .byte >trakball0update ; 2 = trackball 5638 2706b - .byte >mouse0update ; 3 = mouse 5639 2706b - 5640 2706b -longreadroutineloP1 5641 2706b - .byte LLRET1 ; 0 = no routine 5648 2706b - .byte >paddleport1update ; 1 = paddle 5649 2706b - .byte >trakball1update ; 2 = trackball 5650 2706b - .byte >mouse1update ; 3 = mouse 5651 2706b - 5652 2706b - 5653 2706b -SETTIM64T 5654 2706b - bne skipdefaulttime 5655 2706b - ifnconst PADDLESMOOTHINGOFF 5656 2706b - lda #(TIMEVAL+TIMEOFFSET+1) 5657 2706b - else 5658 2706b - lda #(TIMEVAL+TIMEOFFSET) 5659 2706b - endif 5660 2706b -skipdefaulttime 5661 2706b - tay 5662 2706b - dey 5663 2706b -.setTIM64Tloop 5664 2706b - sta TIM64T 5665 2706b - cpy INTIM 5666 2706b - bne .setTIM64Tloop 5667 2706b - rts 5668 2706b endif ; LONGCONTROLLERREAD 5669 2706b 5670 2706b reallyoffvisible 5671 2706b 85 24 sta WSYNC 5672 2706d 5673 2706d a9 00 lda #0 5674 2706f 85 4d sta visibleover 5675 27071 - ifconst DEBUGINTERRUPT 5676 27071 - sta BACKGRND 5677 27071 endif 5678 27071 5679 27071 a9 03 lda #3 5680 27073 8d b2 01 sta interruptindex 5681 27076 5682 27076 20 52 f1 jsr uninterruptableroutines 5683 27079 5684 27079 - ifconst .userinterrupt 5685 27079 - lda interrupthold 5686 27079 - beq skipuserintroutine 5687 27079 - jsr .userinterrupt 5688 27079 -skipuserintroutine 5689 27079 endif 5690 27079 5691 27079 - ifconst KEYPADSUPPORT 5692 27079 - jsr keypadcolumnread 5693 27079 endif 5694 27079 5695 27079 NMIexit 5696 27079 68 pla 5697 2707a a8 tay 5698 2707b 68 pla 5699 2707c aa tax 5700 2707d 68 pla 5701 2707e 40 RTI 5702 2707f 5703 2707f clearscreen 5704 2707f a2 17 ldx #(WZONECOUNT-1) 5705 27081 a9 00 lda #0 5706 27083 clearscreenloop 5707 27083 95 65 sta dlend,x 5708 27085 ca dex 5709 27086 10 fb bpl clearscreenloop 5710 27088 a9 00 lda #0 5711 2708a 8d ad 01 sta valbufend ; clear the bcd value buffer 5712 2708d 8d ae 01 sta valbufendsave 5713 27090 60 rts 5714 27091 5715 27091 restorescreen 5716 27091 a2 17 ldx #(WZONECOUNT-1) 5717 27093 a9 00 lda #0 5718 27095 restorescreenloop 5719 27095 b5 82 lda dlendsave,x 5720 27097 95 65 sta dlend,x 5721 27099 ca dex 5722 2709a 10 f9 bpl restorescreenloop 5723 2709c ad ae 01 lda valbufendsave 5724 2709f 8d ad 01 sta valbufend 5725 270a2 60 rts 5726 270a3 5727 270a3 savescreen 5728 270a3 a2 17 ldx #(WZONECOUNT-1) 5729 270a5 savescreenloop 5730 270a5 b5 65 lda dlend,x 5731 270a7 95 82 sta dlendsave,x 5732 270a9 ca dex 5733 270aa 10 f9 bpl savescreenloop 5734 270ac ad ad 01 lda valbufend 5735 270af 8d ae 01 sta valbufendsave 5736 270b2 - ifconst DOUBLEBUFFER 5737 270b2 - lda doublebufferstate 5738 270b2 - beq savescreenrts 5739 270b2 - lda #1 5740 270b2 - sta doublebufferbufferdirty 5741 270b2 -savescreenrts 5742 270b2 endif ; DOUBLEBUFFER 5743 270b2 60 rts 5744 270b3 5745 270b3 drawscreen 5746 270b3 5747 270b3 - ifconst interrupthold 5748 270b3 - lda #$FF 5749 270b3 - sta interrupthold ; if the user called drawscreen, we're ready for interrupts 5750 270b3 endif 5751 270b3 5752 270b3 a9 00 lda #0 5753 270b5 85 42 sta temp1 ; not B&W if we're here... 5754 270b7 5755 270b7 drawscreenwait 5756 270b7 a5 4d lda visibleover 5757 270b9 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 5758 270bb 5759 270bb ;restore some registers in case the game changed them mid-screen... 5760 270bb ad 07 21 lda sCTRL 5761 270be 05 42 ora temp1 5762 270c0 85 3c sta CTRL 5763 270c2 ad 0b 21 lda sCHARBASE 5764 270c5 85 34 sta CHARBASE 5765 270c7 5766 270c7 ;ensure all of the display list is terminated... 5767 270c7 20 38 f1 jsr terminatedisplaylist 5768 270ca 5769 270ca ifnconst pauseroutineoff 5770 270ca 20 d5 f0 jsr pauseroutine 5771 270cd endif ; pauseroutineoff 5772 270cd 5773 270cd ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 5774 270cd ; delaying a full frame, but still allowing time for basic calculations. 5775 270cd visiblescreenstartedwait 5776 270cd a5 4d lda visibleover 5777 270cf f0 fc beq visiblescreenstartedwait 5778 270d1 visiblescreenstartedwaitdone 5779 270d1 ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 5780 270d4 60 rts 5781 270d5 5782 270d5 ifnconst pauseroutineoff 5783 270d5 ; check to see if pause was pressed and released 5784 270d5 pauseroutine 5785 270d5 ad b3 01 lda pausedisable 5786 270d8 d0 4e bne leavepauseroutine 5787 270da a9 08 lda #8 5788 270dc 2c 82 02 bit SWCHB 5789 270df f0 29 beq pausepressed 5790 270e1 5791 270e1 ifnconst SOFTRESETASPAUSEOFF 5792 270e1 ifnconst MOUSESUPPORT 5793 270e1 ifnconst TRAKBALLSUPPORT 5794 270e1 ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 5795 270e4 29 70 and #%01110000 ; _LDU 5796 270e6 f0 22 beq pausepressed 5797 270e8 endif 5798 270e8 endif 5799 270e8 endif 5800 270e8 5801 270e8 ;pause isn't pressed 5802 270e8 a9 00 lda #0 5803 270ea 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 5804 270ed 5805 270ed ;check if we're in an already paused state 5806 270ed ad 00 21 lda pausestate 5807 270f0 f0 36 beq leavepauseroutine ; nope, leave 5808 270f2 5809 270f2 c9 01 cmp #1 ; last frame was the start of pausing 5810 270f4 f0 2b beq enterpausestate2 ; move from state 1 to 2 5811 270f6 5812 270f6 c9 02 cmp #2 5813 270f8 f0 34 beq carryonpausing 5814 270fa 5815 270fa ;pausestate must be >2, which means we're ending an unpause 5816 270fa a9 00 lda #0 5817 270fc 8d ac 01 sta pausebuttonflag 5818 270ff 8d 00 21 sta pausestate 5819 27102 ad 07 21 lda sCTRL 5820 27105 85 3c sta CTRL 5821 27107 4c 28 f1 jmp leavepauseroutine 5822 2710a 5823 2710a pausepressed 5824 2710a ;pause is pressed 5825 2710a ad ac 01 lda pausebuttonflag 5826 2710d c9 ff cmp #$ff 5827 2710f f0 1d beq carryonpausing 5828 27111 5829 27111 ;its a new press, increment the state 5830 27111 ee 00 21 inc pausestate 5831 27114 5832 27114 ;silence volume at the start and end of pausing 5833 27114 a9 00 lda #0 5834 27116 85 19 sta AUDV0 5835 27118 85 1a sta AUDV1 5836 2711a 5837 2711a - ifconst pokeysupport 5838 2711a - ldy #7 5839 2711a -pausesilencepokeyaudioloop 5840 2711a - sta (pokeybase),y 5841 2711a - dey 5842 2711a - bpl pausesilencepokeyaudioloop 5843 2711a endif ; pokeysupport 5844 2711a 5845 2711a a9 ff lda #$ff 5846 2711c 8d ac 01 sta pausebuttonflag 5847 2711f d0 0d bne carryonpausing 5848 27121 5849 27121 enterpausestate2 5850 27121 a9 02 lda #2 5851 27123 8d 00 21 sta pausestate 5852 27126 d0 06 bne carryonpausing 5853 27128 leavepauseroutine 5854 27128 ad 07 21 lda sCTRL 5855 2712b 85 3c sta CTRL 5856 2712d 60 rts 5857 2712e carryonpausing 5858 2712e - ifconst .pause 5859 2712e - jsr .pause 5860 2712e endif ; .pause 5861 2712e ad 07 21 lda sCTRL 5862 27131 09 80 ora #%10000000 ; turn off colorburst during pause... 5863 27133 85 3c sta CTRL 5864 27135 4c d5 f0 jmp pauseroutine 5865 27138 endif ; pauseroutineoff 5866 27138 5867 27138 5868 27138 - ifconst DOUBLEBUFFER 5869 27138 -skipterminatedisplaylistreturn 5870 27138 - rts 5871 27138 endif ; DOUBLEBUFFER 5872 27138 terminatedisplaylist 5873 27138 - ifconst DOUBLEBUFFER 5874 27138 - lda doublebufferstate 5875 27138 - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 5876 27138 endif ; DOUBLEBUFFER 5877 27138 terminatedisplaybuffer 5878 27138 ;add DL end entry on each DL 5879 27138 a2 17 ldx #(WZONECOUNT-1) 5880 2713a dlendloop 5881 2713a bd 3c f6 lda DLPOINTL,x 5882 2713d - ifconst DOUBLEBUFFER 5883 2713d - clc 5884 2713d - adc doublebufferdloffset 5885 2713d endif ; DOUBLEBUFFER 5886 2713d 85 63 sta dlpnt 5887 2713f bd 24 f6 lda DLPOINTH,x 5888 27142 - ifconst DOUBLEBUFFER 5889 27142 - adc #0 5890 27142 endif ; DOUBLEBUFFER 5891 27142 85 64 sta dlpnt+1 5892 27144 b4 65 ldy dlend,x 5893 27146 a9 00 lda #$00 5894 27148 dlendmoreloops 5895 27148 c8 iny 5896 27149 91 63 sta (dlpnt),y 5897 2714b - ifconst FRAMESKIPGLITCHFIXWEAK 5898 2714b - cpy #DLLASTOBJ+1 5899 2714b - beq dlendthiszonedone 5900 2714b - iny 5901 2714b - iny 5902 2714b - iny 5903 2714b - iny 5904 2714b - iny 5905 2714b - sta (dlpnt),y 5906 2714b -dlendthiszonedone 5907 2714b endif FRAMESKIPGLITCHFIXWEAK 5908 2714b - ifconst FRAMESKIPGLITCHFIX 5909 2714b - iny 5910 2714b - iny 5911 2714b - iny 5912 2714b - iny 5913 2714b - cpy #DLLASTOBJ-1 5914 2714b - bcc dlendmoreloops 5915 2714b endif ; FRAMESKIPGLITCHFIX 5916 2714b ca dex 5917 2714c 10 ec bpl dlendloop 5918 2714e 5919 2714e ifnconst pauseroutineoff 5920 2714e 20 d5 f0 jsr pauseroutine 5921 27151 endif ; pauseroutineoff 5922 27151 60 rts 5923 27152 5924 27152 uninterruptableroutines 5925 27152 ; this is for routines that must happen off the visible screen, each frame. 5926 27152 5927 27152 - ifconst AVOXVOICE 5928 27152 - jsr serviceatarivoxqueue 5929 27152 endif 5930 27152 5931 27152 a9 00 lda #0 5932 27154 8d b6 01 sta palfastframe 5933 27157 ad 09 21 lda paldetected 5934 2715a f0 10 beq skippalframeadjusting 5935 2715c ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 5936 2715c ae b5 01 ldx palframes 5937 2715f e8 inx 5938 27160 e0 05 cpx #5 5939 27162 d0 05 bne palframeskipdone 5940 27164 ee b6 01 inc palfastframe 5941 27167 a2 00 ldx #0 5942 27169 palframeskipdone 5943 27169 8e b5 01 stx palframes 5944 2716c skippalframeadjusting 5945 2716c 5946 2716c - ifconst MUSICTRACKER 5947 2716c - ; We normally run the servicesong routine from the top-screen interrupt, but if it 5948 2716c - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 5949 2716c - ; If that happens, we try again here. Chances are very small we'll run into the same 5950 2716c - ; problem twice, and if we do, we just drop a musical note or two. 5951 2716c - lda sfxschedulemissed 5952 2716c - beq servicesongwasnotmissed 5953 2716c - jsr servicesong 5954 2716c -servicesongwasnotmissed 5955 2716c endif ; MUSICTRACKER 5956 2716c 5957 2716c 60 rts 5958 2716d 5959 2716d serviceatarivoxqueue 5960 2716d - ifconst AVOXVOICE 5961 2716d - lda voxlock 5962 2716d - bne skipvoxprocessing ; the vox is in the middle of speech address update 5963 2716d -skipvoxqueuesizedec 5964 2716d - jmp processavoxvoice 5965 2716d -skipvoxprocessing 5966 2716d - rts 5967 2716d - 5968 2716d -processavoxvoice 5969 2716d - lda avoxenable 5970 2716d - bne avoxfixport 5971 2716d - SPKOUT tempavox 5972 2716d - rts 5973 2716d -avoxfixport 5974 2716d - lda #0 ; restore the port to all bits as inputs... 5975 2716d - sta CTLSWA 5976 2716d - rts 5977 2716d -silenceavoxvoice 5978 2716d - SPEAK avoxsilentdata 5979 2716d - rts 5980 2716d -avoxsilentdata 5981 2716d - .byte 31,255 5982 2716d else 5983 2716d 60 rts 5984 2716e endif ; AVOXVOICE 5985 2716e 5986 2716e joybuttonhandler 5987 2716e 8a txa 5988 2716f 0a asl 5989 27170 a8 tay 5990 27171 b9 08 00 lda INPT0,y 5991 27174 4a lsr 5992 27175 9d 02 21 sta sINPT1,x 5993 27178 b9 09 00 lda INPT1,y 5994 2717b 29 80 and #%10000000 5995 2717d 1d 02 21 ora sINPT1,x 5996 27180 9d 02 21 sta sINPT1,x 5997 27183 5998 27183 b5 0c lda INPT4,x 5999 27185 30 19 bmi .skip1bjoyfirecheck 6000 27187 ;one button joystick is down 6001 27187 49 80 eor #%10000000 6002 27189 9d 02 21 sta sINPT1,x 6003 2718c 6004 2718c ad b1 01 lda joybuttonmode 6005 2718f 3d a3 f1 and twobuttonmask,x 6006 27192 f0 0c beq .skip1bjoyfirecheck 6007 27194 ad b1 01 lda joybuttonmode 6008 27197 1d a3 f1 ora twobuttonmask,x 6009 2719a 8d b1 01 sta joybuttonmode 6010 2719d 8d 82 02 sta SWCHB 6011 271a0 .skip1bjoyfirecheck 6012 271a0 4c 57 f0 jmp buttonreadloopreturn 6013 271a3 6014 271a3 twobuttonmask 6015 271a3 04 10 .byte.b %00000100,%00010000 6016 271a5 6017 271a5 - ifconst SNES2ATARISUPPORT 6018 271a5 - 6019 271a5 -SNES_CLOCK_PORT_BIT 6020 271a5 - .byte $10,$01 6021 271a5 -SNES_CTLSWA_MASK 6022 271a5 - .byte $30,$03 6023 271a5 -SNES_CTLSWA_SIGNAL 6024 271a5 - .byte $C0,$0C 6025 271a5 -SWCHA_DIRMASK 6026 271a5 - .byte $F0,$0F 6027 271a5 -SWCHA_INVDIRMASK 6028 271a5 - .byte $0F,$F0 6029 271a5 - 6030 271a5 - ; Probe each port for SNES, and see if autodetection succeeds anywhere. 6031 271a5 -SNES_AUTODETECT 6032 271a5 - ldx #1 6033 271a5 -SNES_AUTODETECT_LOOP 6034 271a5 - lda #1 ; proline 6035 271a5 - sta port0control,x 6036 271a5 - jsr setportforinput 6037 271a5 - jsr setonebuttonmode 6038 271a5 - jsr SNES_READ 6039 271a5 - lda snesdetected0,x 6040 271a5 - bne SNES_AUTODETECT_FOUND 6041 271a5 - ; detection failed 6042 271a5 - jsr setportforinput 6043 271a5 - jsr settwobuttonmode 6044 271a5 - dex 6045 271a5 - bpl SNES_AUTODETECT_LOOP 6046 271a5 - rts 6047 271a5 -SNES_AUTODETECT_FOUND 6048 271a5 - lda #11 ; formally set the snes controller 6049 271a5 - sta port0control,x 6050 271a5 - stx snesport 6051 271a5 - rts 6052 271a5 endif ; SNES2ATARISUPPORT 6053 271a5 6054 271a5 snes2atarihandler 6055 271a5 - ifconst SNES2ATARISUPPORT 6056 271a5 -SNES2ATARI 6057 271a5 - jsr SNES_READ 6058 271a5 - jmp buttonreadloopreturn 6059 271a5 - 6060 271a5 -SNES_READ 6061 271a5 - ; x=0 for left port, x=1 for right 6062 271a5 - 6063 271a5 - ; Start by checking if any port directions are pressed. 6064 271a5 - ; Abort the autodetect for this port if so, as snes2atari doesn't ground any 6065 271a5 - ; direction pins. if directions are pressed and the port is changed to output, 6066 271a5 - ; that means the output is direct-shorted, and nobody seems to know if riot's 6067 271a5 - ; output mode has current protection. 6068 271a5 - 6069 271a5 - lda SWCHA 6070 271a5 - ora SWCHA_INVDIRMASK,x 6071 271a5 - eor SWCHA_DIRMASK,x 6072 271a5 - beq SNES_ABORT 6073 271a5 - 6074 271a5 - lda port0control,x 6075 271a5 - cmp #11 ; snes 6076 271a5 - bne snes2atari_signal_go ; if this is a first auto-detection read, go ahead and signal 6077 271a5 - lda snesdetected0,x 6078 271a5 - bne snes2atari_signal_skip ; if snes was available in previous frames, skip signalling 6079 271a5 -snes2atari_signal_go 6080 271a5 - jsr SNES2ATARI_SIGNAL 6081 271a5 -snes2atari_signal_skip 6082 271a5 - 6083 271a5 - lda SNES_CTLSWA_MASK,x 6084 271a5 - sta CTLSWA ; enable pins UP/DOWN to work as outputs 6085 271a5 - lda #$0 6086 271a5 - sta SWCHA ; make both latch and clock down 6087 271a5 - ldy #16 ; 16 bits 6088 271a5 -SNES2ATARILOOP 6089 271a5 - rol INPT4,x ; sample data into carry 6090 271a5 - lda SNES_CLOCK_PORT_BIT,x 6091 271a5 - sta SWCHA ; clock low 6092 271a5 - rol snes2atari0lo,x 6093 271a5 - rol snes2atari0hi,x 6094 271a5 - lda #0 6095 271a5 - sta SWCHA ; clock high 6096 271a5 - dey ; next bit 6097 271a5 - bne SNES2ATARILOOP 6098 271a5 - rol INPT4,x ; 17th bit should be lo if controller is there. 6099 271a5 - rol ; 17th snes bit into A low bit 6100 271a5 - eor snes2atari0lo,x ; 16th bit should be hi if controller is there. 6101 271a5 - and #1 6102 271a5 - sta snesdetected0,x 6103 271a5 - beq SNES_STOP_CLOCK ; if snes isn't detected, leave port in default state 6104 271a5 - stx snesport ; snesport keeps the index of the latest autodetected controller 6105 271a5 - lda SNES_CLOCK_PORT_BIT,x 6106 271a5 -SNES_STOP_CLOCK 6107 271a5 - sta SWCHA ; clock low 6108 271a5 - sta CTLSWA ; set port bits to input avoid conflict with other drivers 6109 271a5 - rts 6110 271a5 -SNES_ABORT 6111 271a5 - sta snesdetected0,x 6112 271a5 - rts 6113 271a5 -SNES2ATARI_SIGNAL 6114 271a5 - ; signal to SNES2ATARI++ that we want SNES mode... 6115 271a5 - lda SNES_CTLSWA_SIGNAL,x 6116 271a5 - sta CTLSWA 6117 271a5 - lda #0 6118 271a5 - sta SWCHA 6119 271a5 - ldy #0 6120 271a5 -SNES_SIGNAL_LOOP 6121 271a5 - dey 6122 271a5 - bne SNES_SIGNAL_LOOP 6123 271a5 - lda #$FF 6124 271a5 - sta SWCHA 6125 271a5 - rts 6126 271a5 endif 6127 271a5 6128 271a5 gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 6129 271a5 - ifconst LIGHTGUNSUPPORT 6130 271a5 - cpx #0 6131 271a5 - bne secondportgunhandler 6132 271a5 -firstportgunhandler 6133 271a5 - lda SWCHA 6134 271a5 - asl 6135 271a5 - asl 6136 271a5 - asl ; shift D4 to D7 6137 271a5 - and #%10000000 6138 271a5 - eor #%10000000 6139 271a5 - sta sINPT1 6140 271a5 - jmp buttonreadloopreturn 6141 271a5 -secondportgunhandler 6142 271a5 - lda SWCHA 6143 271a5 - lsr ; shift D0 into carry 6144 271a5 - lsr ; shift carry into D7 6145 271a5 - and #%10000000 6146 271a5 - eor #%10000000 6147 271a5 - sta sINPT3 6148 271a5 - jmp buttonreadloopreturn 6149 271a5 endif ; LIGHTGUNSUPPORT 6150 271a5 6151 271a5 controlsusing2buttoncode 6152 271a5 00 .byte.b 0 ; 00=no controller plugged in 6153 271a6 01 .byte.b 1 ; 01=proline joystick 6154 271a7 00 .byte.b 0 ; 02=lightgun 6155 271a8 00 .byte.b 0 ; 03=paddle 6156 271a9 01 .byte.b 1 ; 04=trakball 6157 271aa 01 .byte.b 1 ; 05=vcs joystick 6158 271ab 01 .byte.b 1 ; 06=driving control 6159 271ac 00 .byte.b 0 ; 07=keypad control 6160 271ad 00 .byte.b 0 ; 08=st mouse/cx80 6161 271ae 00 .byte.b 0 ; 09=amiga mouse 6162 271af 01 .byte.b 1 ; 10=atarivox 6163 271b0 00 .byte.b 0 ; 11=snes2atari 6164 271b1 6165 271b1 buttonhandlerhi 6166 271b1 00 .byte.b 0 ; 00=no controller plugged in 6167 271b2 f1 .byte.b >joybuttonhandler ; 01=proline joystick 6168 271b3 f1 .byte.b >gunbuttonhandler ; 02=lightgun 6169 271b4 f5 .byte.b >paddlebuttonhandler ; 03=paddle 6170 271b5 f1 .byte.b >joybuttonhandler ; 04=trakball 6171 271b6 f1 .byte.b >joybuttonhandler ; 05=vcs joystick 6172 271b7 f1 .byte.b >joybuttonhandler ; 06=driving control 6173 271b8 00 .byte.b 0 ; 07=keypad 6174 271b9 f5 .byte.b >mousebuttonhandler ; 08=st mouse 6175 271ba f5 .byte.b >mousebuttonhandler ; 09=amiga mouse 6176 271bb f1 .byte.b >joybuttonhandler ; 10=atarivox 6177 271bc f1 .byte.b >snes2atarihandler ; 11=snes 6178 271bd buttonhandlerlo 6179 271bd 00 .byte.b 0 ; 00=no controller plugged in 6180 271be 6e .byte.b $0F means the sound is looped while priority is active 6320 27248 6321 27248 05 d9 ora inttemp2 6322 2724a 05 d8 ora inttemp1 ; check if F|C|V=0 6323 2724c f0 23 beq zerosfx ; if so, we're at the end of the sound. 6324 2724e 6325 2724e advancesfxpointer 6326 2724e ; advance the pointer to the next sound chunk 6327 2724e c8 iny 6328 2724f 84 da sty inttemp3 6329 27251 18 clc 6330 27252 b5 4e lda sfx1pointlo,x 6331 27254 65 da adc inttemp3 6332 27256 95 4e sta sfx1pointlo,x 6333 27258 b5 50 lda sfx1pointhi,x 6334 2725a 69 00 adc #0 6335 2725c 95 50 sta sfx1pointhi,x 6336 2725e 4c e2 f1 jmp servicesfxchannelsloop 6337 27261 6338 27261 sfxsoundloop 6339 27261 48 pha 6340 27262 b5 52 lda sfx1priority,x 6341 27264 d0 04 bne sfxsoundloop_carryon 6342 27266 68 pla ; fix the stack before we go 6343 27267 4c 4e f2 jmp advancesfxpointer 6344 2726a sfxsoundloop_carryon 6345 2726a 68 pla 6346 2726b 29 f0 and #$F0 6347 2726d 4a lsr 6348 2726e 4a lsr 6349 2726f 4a lsr 6350 27270 4a lsr 6351 27271 6352 27271 zerosfx 6353 27271 95 4e sta sfx1pointlo,x 6354 27273 95 50 sta sfx1pointhi,x 6355 27275 95 52 sta sfx1priority,x 6356 27277 4c e2 f1 jmp servicesfxchannelsloop 6357 2727a 6358 2727a 6359 2727a schedulesfx 6360 2727a ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 6361 2727a a0 00 ldy #0 6362 2727c b1 e0 lda (sfxinstrumentlo),y 6363 2727e - ifconst pokeysupport 6364 2727e - cmp #$20 ; POKEY? 6365 2727e - bne scheduletiasfx 6366 2727e - jmp schedulepokeysfx 6367 2727e endif 6368 2727e scheduletiasfx 6369 2727e ;cmp #$10 ; TIA? 6370 2727e ;beq continuescheduletiasfx 6371 2727e ; rts ; unhandled!!! 6372 2727e continuescheduletiasfx 6373 2727e ifnconst TIASFXMONO 6374 2727e a5 4e lda sfx1pointlo 6375 27280 05 50 ora sfx1pointhi 6376 27282 f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 6377 27284 a5 4f lda sfx2pointlo 6378 27286 05 51 ora sfx2pointhi 6379 27288 f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 6380 2728a ; Both channels are scheduled. 6381 2728a a0 01 ldy #1 6382 2728c b1 e0 lda (sfxinstrumentlo),y 6383 2728e d0 01 bne interruptsfx 6384 27290 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 6385 27291 interruptsfx 6386 27291 ;Compare which active sound has a lower priority. We'll interrupt the lower one. 6387 27291 a5 52 lda sfx1priority 6388 27293 c5 53 cmp sfx2priority 6389 27295 b0 04 bcs schedulesfx2 6390 27297 endif ; !TIASFXMONO 6391 27297 6392 27297 schedulesfx1 6393 27297 a2 00 ldx #0 ; channel 1 6394 27299 ifnconst TIASFXMONO 6395 27299 f0 02 beq skipschedulesfx2 6396 2729b schedulesfx2 6397 2729b a2 01 ldx #1 ; channel 2 6398 2729d skipschedulesfx2 6399 2729d endif ; !TIASFXMONO 6400 2729d 6401 2729d - ifconst MUSICTRACKER 6402 2729d - lda sfxnoteindex 6403 2729d - bpl skipdrumkitoverride 6404 2729d - and #$7F ; subtract 128 6405 2729d - sec 6406 2729d - sbc #4 ; drums start at 132, i.e. octave 10 6407 2729d - asl 6408 2729d - tay 6409 2729d - lda tiadrumkitdefinition,y 6410 2729d - sta sfxinstrumentlo 6411 2729d - iny 6412 2729d - lda tiadrumkitdefinition,y 6413 2729d - sta sfxinstrumenthi 6414 2729d - lda #0 6415 2729d - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 6416 2729d -skipdrumkitoverride 6417 2729d endif ; MUSICTRACKER 6418 2729d a0 01 ldy #1 ; get priority and sound-resolution (in frames) 6419 2729f b1 e0 lda (sfxinstrumentlo),y 6420 272a1 95 52 sta sfx1priority,x 6421 272a3 c8 iny 6422 272a4 b1 e0 lda (sfxinstrumentlo),y 6423 272a6 95 56 sta sfx1frames,x 6424 272a8 a5 e0 lda sfxinstrumentlo 6425 272aa 18 clc 6426 272ab 69 03 adc #3 6427 272ad 95 4e sta sfx1pointlo,x 6428 272af a5 e1 lda sfxinstrumenthi 6429 272b1 69 00 adc #0 6430 272b3 95 50 sta sfx1pointhi,x 6431 272b5 a5 e2 lda sfxpitchoffset 6432 272b7 95 54 sta sfx1poffset,x 6433 272b9 a9 00 lda #0 6434 272bb 95 58 sta sfx1tick,x 6435 272bd a5 e3 lda sfxnoteindex 6436 272bf 95 cd sta sfx1notedata,x 6437 272c1 60 rts 6438 272c2 6439 272c2 plotsprite 6440 272c2 ifnconst NODRAWWAIT 6441 272c2 - ifconst DOUBLEBUFFER 6442 272c2 - lda doublebufferstate 6443 272c2 - bne skipplotspritewait 6444 272c2 endif ; DOUBLEBUFFER 6445 272c2 - ifconst DEBUGWAITCOLOR 6446 272c2 - lda #$41 6447 272c2 - sta BACKGRND 6448 272c2 endif 6449 272c2 plotspritewait 6450 272c2 a5 4d lda visibleover 6451 272c4 d0 fc bne plotspritewait 6452 272c6 skipplotspritewait 6453 272c6 - ifconst DEBUGWAITCOLOR 6454 272c6 - lda #$0 6455 272c6 - sta BACKGRND 6456 272c6 endif 6457 272c6 endif 6458 272c6 6459 272c6 ;arguments: 6460 272c6 ; temp1=lo graphicdata 6461 272c6 ; temp2=hi graphicdata 6462 272c6 ; temp3=palette | width byte 6463 272c6 ; temp4=x 6464 272c6 ; temp5=y 6465 272c6 ; temp6=mode 6466 272c6 a5 46 lda temp5 ;Y position 6467 272c8 4a lsr ; 2 - Divide by 8 or 16 6468 272c9 4a lsr ; 2 6469 272ca 4a lsr ; 2 6470 272cb - if WZONEHEIGHT = 16 6471 272cb - lsr ; 2 6472 272cb endif 6473 272cb 6474 272cb aa tax 6475 272cc 6476 272cc ifnconst NOLIMITCHECKING 6477 272cc 6478 272cc ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 6479 272cc 6480 272cc c9 18 cmp #WZONECOUNT 6481 272ce 6482 272ce 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 6483 272d0 ; otherwise, check to see if the bottom half is in zone 0... 6484 272d0 6485 272d0 - if WZONEHEIGHT = 16 6486 272d0 - cmp #15 6487 272d0 else 6488 272d0 c9 1f cmp #31 6489 272d2 endif 6490 272d2 6491 272d2 d0 05 bne exitplotsprite1 6492 272d4 a2 00 ldx #0 6493 272d6 4c 13 f3 jmp continueplotsprite2 6494 272d9 exitplotsprite1 6495 272d9 60 rts 6496 272da 6497 272da continueplotsprite1 6498 272da endif 6499 272da 6500 272da bd 3c f6 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 6501 272dd - ifconst DOUBLEBUFFER 6502 272dd - clc 6503 272dd - adc doublebufferdloffset 6504 272dd endif ; DOUBLEBUFFER 6505 272dd 85 63 sta dlpnt 6506 272df bd 24 f6 lda DLPOINTH,x 6507 272e2 - ifconst DOUBLEBUFFER 6508 272e2 - adc #0 6509 272e2 endif ; DOUBLEBUFFER 6510 272e2 85 64 sta dlpnt+1 6511 272e4 6512 272e4 ;Create DL entry for upper part of sprite 6513 272e4 6514 272e4 b4 65 ldy dlend,x ;Get the index to the end of this DL 6515 272e6 6516 272e6 ifconst CHECKOVERWRITE 6517 272e6 c0 4b cpy #DLLASTOBJ 6518 272e8 f0 21 beq checkcontinueplotsprite2 6519 272ea continueplotsprite1a 6520 272ea endif 6521 272ea 6522 272ea a5 42 lda temp1 ; graphic data, lo byte 6523 272ec 91 63 sta (dlpnt),y ;Low byte of data address 6524 272ee 6525 272ee ifnconst ATOMICSPRITEUPDATE 6526 272ee c8 iny 6527 272ef a5 47 lda temp6 6528 272f1 91 63 sta (dlpnt),y 6529 272f3 - else 6530 272f3 - iny 6531 272f3 - sty temp8 6532 272f3 endif 6533 272f3 6534 272f3 c8 iny 6535 272f4 6536 272f4 a5 46 lda temp5 ;Y position 6537 272f6 29 07 and #(WZONEHEIGHT - 1) 6538 272f8 c9 01 cmp #1 ; clear carry if our sprite is just in this zone 6539 272fa 05 43 ora temp2 ; graphic data, hi byte 6540 272fc 91 63 sta (dlpnt),y 6541 272fe 6542 272fe 6543 272fe c8 iny 6544 272ff a5 44 lda temp3 ;palette|width 6545 27301 91 63 sta (dlpnt),y 6546 27303 6547 27303 c8 iny 6548 27304 a5 45 lda temp4 ;Horizontal position 6549 27306 91 63 sta (dlpnt),y 6550 27308 6551 27308 c8 iny 6552 27309 94 65 sty dlend,x 6553 2730b 6554 2730b - ifconst ALWAYSTERMINATE 6555 2730b - iny 6556 2730b - lda #0 6557 2730b - sta (dlpnt),y 6558 2730b endif 6559 2730b 6560 2730b - ifconst ATOMICSPRITEUPDATE 6561 2730b - ldy temp8 6562 2730b - lda temp6 6563 2730b - sta (dlpnt),y 6564 2730b endif 6565 2730b 6566 2730b checkcontinueplotsprite2 6567 2730b 6568 2730b 90 38 bcc doneSPDL ;branch if the sprite was fully in the last zone 6569 2730d 6570 2730d ;Create DL entry for lower part of sprite 6571 2730d 6572 2730d e8 inx ;Next region 6573 2730e 6574 2730e ifnconst NOLIMITCHECKING 6575 2730e e0 18 cpx #WZONECOUNT 6576 27310 6577 27310 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 6578 27312 60 rts 6579 27313 continueplotsprite2 6580 27313 endif 6581 27313 6582 27313 bd 3c f6 lda DLPOINTL,x ;Get pointer to next DL 6583 27316 - ifconst DOUBLEBUFFER 6584 27316 - clc 6585 27316 - adc doublebufferdloffset 6586 27316 endif ; DOUBLEBUFFER 6587 27316 85 63 sta dlpnt 6588 27318 bd 24 f6 lda DLPOINTH,x 6589 2731b - ifconst DOUBLEBUFFER 6590 2731b - adc #0 6591 2731b endif ; DOUBLEBUFFER 6592 2731b 85 64 sta dlpnt+1 6593 2731d b4 65 ldy dlend,x ;Get the index to the end of this DL 6594 2731f 6595 2731f ifconst CHECKOVERWRITE 6596 2731f c0 4b cpy #DLLASTOBJ 6597 27321 d0 01 bne continueplotsprite2a 6598 27323 60 rts 6599 27324 continueplotsprite2a 6600 27324 endif 6601 27324 6602 27324 a5 42 lda temp1 ; graphic data, lo byte 6603 27326 91 63 sta (dlpnt),y 6604 27328 6605 27328 ifnconst ATOMICSPRITEUPDATE 6606 27328 c8 iny 6607 27329 a5 47 lda temp6 6608 2732b 91 63 sta (dlpnt),y 6609 2732d - else 6610 2732d - iny 6611 2732d - sty temp8 6612 2732d endif 6613 2732d 6614 2732d c8 iny 6615 2732e 6616 2732e a5 46 lda temp5 ;Y position 6617 27330 0b 07 anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 6618 27332 05 43 ora temp2 ; graphic data, hi byte 6619 27334 e9 07 sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 6620 27336 91 63 sta (dlpnt),y 6621 27338 6622 27338 c8 iny 6623 27339 6624 27339 a5 44 lda temp3 ;palette|width 6625 2733b 91 63 sta (dlpnt),y 6626 2733d 6627 2733d c8 iny 6628 2733e 6629 2733e a5 45 lda temp4 ;Horizontal position 6630 27340 91 63 sta (dlpnt),y 6631 27342 6632 27342 c8 iny 6633 27343 94 65 sty dlend,x 6634 27345 6635 27345 - ifconst ALWAYSTERMINATE 6636 27345 - iny 6637 27345 - lda #0 6638 27345 - sta (dlpnt),y 6639 27345 endif 6640 27345 6641 27345 - ifconst ATOMICSPRITEUPDATE 6642 27345 - ldy temp8 6643 27345 - lda temp6 6644 27345 - sta (dlpnt),y 6645 27345 endif 6646 27345 6647 27345 doneSPDL 6648 27345 60 rts 6649 27346 6650 27346 6651 27346 lockzonex 6652 27346 - ifconst ZONELOCKS 6653 27346 - ldy dlend,x 6654 27346 - cpy #DLLASTOBJ 6655 27346 - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 6656 27346 - lda DLPOINTL,x 6657 27346 - ifconst DOUBLEBUFFER 6658 27346 - clc 6659 27346 - adc doublebufferdloffset 6660 27346 - endif ; DOUBLEBUFFER 6661 27346 - sta dlpnt 6662 27346 - lda DLPOINTH,x 6663 27346 - ifconst DOUBLEBUFFER 6664 27346 - adc #0 6665 27346 - endif ; DOUBLEBUFFER 6666 27346 - sta dlpnt+1 6667 27346 - iny 6668 27346 - lda #0 6669 27346 - sta (dlpnt),y 6670 27346 - dey 6671 27346 - tya 6672 27346 - ldy #(DLLASTOBJ-1) 6673 27346 - sta (dlpnt),y 6674 27346 - iny 6675 27346 - sty dlend,x 6676 27346 -lockzonexreturn 6677 27346 - rts 6678 27346 endif ; ZONELOCKS 6679 27346 unlockzonex 6680 27346 - ifconst ZONELOCKS 6681 27346 - ldy dlend,x 6682 27346 - cpy #DLLASTOBJ 6683 27346 - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 6684 27346 - lda DLPOINTL,x 6685 27346 - ifconst DOUBLEBUFFER 6686 27346 - clc 6687 27346 - adc doublebufferdloffset 6688 27346 - endif ; DOUBLEBUFFER 6689 27346 - sta dlpnt 6690 27346 - lda DLPOINTH,x 6691 27346 - ifconst DOUBLEBUFFER 6692 27346 - adc #0 6693 27346 - endif ; DOUBLEBUFFER 6694 27346 - sta dlpnt+1 6695 27346 - dey 6696 27346 - ;ldy #(DLLASTOBJ-1) 6697 27346 - lda (dlpnt),y 6698 27346 - tay 6699 27346 - sty dlend,x 6700 27346 -unlockzonexreturn 6701 27346 endif ; ZONELOCKS 6702 27346 60 rts 6703 27347 6704 27347 plotcharloop 6705 27347 ; ** read from a data indirectly pointed to from temp8,temp9 6706 27347 ; ** format is: lo_data, hi_data, palette|width, x, y 6707 27347 ; ** format ends with lo_data | hi_data = 0 6708 27347 6709 27347 - ifconst DOUBLEBUFFER 6710 27347 - lda doublebufferstate 6711 27347 - bne skipplotcharloopwait 6712 27347 endif ; DOUBLEBUFFER 6713 27347 - ifconst DEBUGWAITCOLOR 6714 27347 - lda #$61 6715 27347 - sta BACKGRND 6716 27347 endif 6717 27347 plotcharloopwait 6718 27347 a5 4d lda visibleover 6719 27349 d0 fc bne plotcharloopwait 6720 2734b - ifconst DEBUGWAITCOLOR 6721 2734b - lda #0 6722 2734b - sta BACKGRND 6723 2734b endif 6724 2734b skipplotcharloopwait 6725 2734b plotcharlooploop 6726 2734b a0 00 ldy #0 6727 2734d b1 49 lda (temp8),y 6728 2734f 85 42 sta temp1 6729 27351 c8 iny 6730 27352 b1 49 lda (temp8),y 6731 27354 85 43 sta temp2 6732 27356 05 42 ora temp1 6733 27358 d0 01 bne plotcharloopcontinue 6734 2735a ;the pointer=0, so return 6735 2735a 60 rts 6736 2735b plotcharloopcontinue 6737 2735b c8 iny 6738 2735c b1 49 lda (temp8),y 6739 2735e 85 44 sta temp3 6740 27360 c8 iny 6741 27361 b1 49 lda (temp8),y 6742 27363 85 45 sta temp4 6743 27365 c8 iny 6744 27366 b1 49 lda (temp8),y 6745 27368 ;sta temp5 ; not needed with our late entry. 6746 27368 20 81 f3 jsr plotcharactersskipentry 6747 2736b a5 49 lda temp8 6748 2736d 18 clc 6749 2736e 69 05 adc #5 6750 27370 85 49 sta temp8 6751 27372 a5 4a lda temp9 6752 27374 69 00 adc #0 6753 27376 85 4a sta temp9 6754 27378 4c 4b f3 jmp plotcharlooploop 6755 2737b 6756 2737b plotcharacters 6757 2737b - ifconst DOUBLEBUFFER 6758 2737b - lda doublebufferstate 6759 2737b - bne skipplotcharacterswait 6760 2737b endif ; DOUBLEBUFFER 6761 2737b - ifconst DEBUGWAITCOLOR 6762 2737b - lda #$41 6763 2737b - sta BACKGRND 6764 2737b endif 6765 2737b plotcharacterswait 6766 2737b a5 4d lda visibleover 6767 2737d d0 fc bne plotcharacterswait 6768 2737f - ifconst DEBUGWAITCOLOR 6769 2737f - sta BACKGRND 6770 2737f endif 6771 2737f skipplotcharacterswait 6772 2737f ;arguments: 6773 2737f ; temp1=lo charactermap 6774 2737f ; temp2=hi charactermap 6775 2737f ; temp3=palette | width byte 6776 2737f ; temp4=x 6777 2737f ; temp5=y 6778 2737f 6779 2737f a5 46 lda temp5 ;Y position 6780 27381 6781 27381 plotcharactersskipentry 6782 27381 6783 27381 ;ifconst ZONEHEIGHT 6784 27381 ; if ZONEHEIGHT = 16 6785 27381 ; and #$0F 6786 27381 ; endif 6787 27381 ; if ZONEHEIGHT = 8 6788 27381 ; and #$1F 6789 27381 ; endif 6790 27381 ;else 6791 27381 ; and #$0F 6792 27381 ;endif 6793 27381 6794 27381 aa tax 6795 27382 bd 3c f6 lda DLPOINTL,x ;Get pointer to DL that the characters are in 6796 27385 - ifconst DOUBLEBUFFER 6797 27385 - clc 6798 27385 - adc doublebufferdloffset 6799 27385 endif ; DOUBLEBUFFER 6800 27385 85 63 sta dlpnt 6801 27387 bd 24 f6 lda DLPOINTH,x 6802 2738a - ifconst DOUBLEBUFFER 6803 2738a - adc #0 6804 2738a endif ; DOUBLEBUFFER 6805 2738a 85 64 sta dlpnt+1 6806 2738c 6807 2738c ;Create DL entry for the characters 6808 2738c 6809 2738c b4 65 ldy dlend,x ;Get the index to the end of this DL 6810 2738e 6811 2738e ifconst CHECKOVERWRITE 6812 2738e c0 4b cpy #DLLASTOBJ 6813 27390 d0 01 bne continueplotcharacters 6814 27392 60 rts 6815 27393 continueplotcharacters 6816 27393 endif 6817 27393 6818 27393 a5 42 lda temp1 ; character map data, lo byte 6819 27395 91 63 sta (dlpnt),y ;(1) store low address 6820 27397 6821 27397 c8 iny 6822 27398 ad 06 21 lda charactermode 6823 2739b 91 63 sta (dlpnt),y ;(2) store mode 6824 2739d 6825 2739d c8 iny 6826 2739e a5 43 lda temp2 ; character map, hi byte 6827 273a0 91 63 sta (dlpnt),y ;(3) store high address 6828 273a2 6829 273a2 c8 iny 6830 273a3 a5 44 lda temp3 ;palette|width 6831 273a5 91 63 sta (dlpnt),y ;(4) store palette|width 6832 273a7 6833 273a7 c8 iny 6834 273a8 a5 45 lda temp4 ;Horizontal position 6835 273aa 91 63 sta (dlpnt),y ;(5) store horizontal position 6836 273ac 6837 273ac c8 iny 6838 273ad 94 65 sty dlend,x ; save display list end byte 6839 273af 60 rts 6840 273b0 6841 273b0 6842 273b0 - ifconst plotvalueonscreen 6843 273b0 -plotcharacterslive 6844 273b0 - ; a version of plotcharacters that draws live and minimally disrupts the screen... 6845 273b0 - 6846 273b0 - ;arguments: 6847 273b0 - ; temp1=lo charactermap 6848 273b0 - ; temp2=hi charactermap 6849 273b0 - ; temp3=palette | width byte 6850 273b0 - ; temp4=x 6851 273b0 - ; temp5=y 6852 273b0 - 6853 273b0 - lda temp5 ;Y position 6854 273b0 - 6855 273b0 - tax 6856 273b0 - lda DLPOINTL,x ;Get pointer to DL that the characters are in 6857 273b0 - ifconst DOUBLEBUFFER 6858 273b0 - clc 6859 273b0 - adc doublebufferdloffset 6860 273b0 - endif ; DOUBLEBUFFER 6861 273b0 - sta dlpnt 6862 273b0 - lda DLPOINTH,x 6863 273b0 - ifconst DOUBLEBUFFER 6864 273b0 - adc #0 6865 273b0 - endif ; DOUBLEBUFFER 6866 273b0 - sta dlpnt+1 6867 273b0 - 6868 273b0 - ;Create DL entry for the characters 6869 273b0 - 6870 273b0 - ldy dlend,x ;Get the index to the end of this DL 6871 273b0 - 6872 273b0 - ifconst CHECKOVERWRITE 6873 273b0 - cpy #DLLASTOBJ 6874 273b0 - bne continueplotcharacterslive 6875 273b0 - rts 6876 273b0 -continueplotcharacterslive 6877 273b0 - endif 6878 273b0 - 6879 273b0 - lda temp1 ; character map data, lo byte 6880 273b0 - sta (dlpnt),y ;(1) store low address 6881 273b0 - 6882 273b0 - iny 6883 273b0 - ; we don't add the second byte yet, since the charmap could briefly 6884 273b0 - ; render without a proper character map address, width, or position. 6885 273b0 - lda charactermode 6886 273b0 - sta (dlpnt),y ;(2) store mode 6887 273b0 - 6888 273b0 - iny 6889 273b0 - lda temp2 ; character map, hi byte 6890 273b0 - sta (dlpnt),y ;(3) store high address 6891 273b0 - 6892 273b0 - iny 6893 273b0 - lda temp3 ;palette|width 6894 273b0 - sta (dlpnt),y ;(4) store palette|width 6895 273b0 - 6896 273b0 - iny 6897 273b0 - lda temp4 ;Horizontal position 6898 273b0 - sta (dlpnt),y ;(5) store horizontal position 6899 273b0 - 6900 273b0 - iny 6901 273b0 - sty dlend,x ; save display list end byte 6902 273b0 - 6903 273b0 - rts 6904 273b0 endif ;plotcharacterslive 6905 273b0 6906 273b0 ifconst USED_PLOTVALUE 6907 273b0 plotvalue 6908 273b0 ; calling 7800basic command: 6909 273b0 ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6910 273b0 ; ...displays the variable as BCD digits 6911 273b0 ; 6912 273b0 ; asm sub arguments: 6913 273b0 ; temp1=lo charactermap 6914 273b0 ; temp2=hi charactermap 6915 273b0 ; temp3=palette | width byte 6916 273b0 ; temp4=x 6917 273b0 ; temp5=y 6918 273b0 ; temp6=number of digits 6919 273b0 ; temp7=lo variable 6920 273b0 ; temp8=hi variable 6921 273b0 ; temp9=character mode 6922 273b0 6923 273b0 00 47 plotdigitcount = temp6 6924 273b0 6925 273b0 - ifconst ZONELOCKS 6926 273b0 - ldx temp5 6927 273b0 - ldy dlend,x 6928 273b0 - cpy #DLLASTOBJ 6929 273b0 - bne carryonplotvalue 6930 273b0 - rts 6931 273b0 -carryonplotvalue 6932 273b0 endif 6933 273b0 6934 273b0 a9 00 lda #0 6935 273b2 a8 tay 6936 273b3 ae ad 01 ldx valbufend 6937 273b6 6938 273b6 a5 47 lda plotdigitcount 6939 273b8 29 01 and #1 6940 273ba f0 07 beq pvnibble2char 6941 273bc a9 00 lda #0 6942 273be 9d 00 20 sta VALBUFFER,x ; just in case we skip this digit 6943 273c1 f0 11 beq pvnibble2char_skipnibble 6944 273c3 6945 273c3 pvnibble2char 6946 273c3 ; high nibble... 6947 273c3 b1 48 lda (temp7),y 6948 273c5 29 f0 and #$f0 6949 273c7 4a lsr 6950 273c8 4a lsr 6951 273c9 4a lsr 6952 273ca ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6953 273ca 4a lsr 6954 273cb endif 6955 273cb 6956 273cb 18 clc 6957 273cc 65 42 adc temp1 ; add the offset to character graphics to our value 6958 273ce 9d 00 20 sta VALBUFFER,x 6959 273d1 e8 inx 6960 273d2 c6 47 dec plotdigitcount 6961 273d4 6962 273d4 pvnibble2char_skipnibble 6963 273d4 ; low nibble... 6964 273d4 b1 48 lda (temp7),y 6965 273d6 29 0f and #$0f 6966 273d8 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6967 273d8 - asl 6968 273d8 endif 6969 273d8 18 clc 6970 273d9 65 42 adc temp1 ; add the offset to character graphics to our value 6971 273db 9d 00 20 sta VALBUFFER,x 6972 273de e8 inx 6973 273df c8 iny 6974 273e0 6975 273e0 c6 47 dec plotdigitcount 6976 273e2 d0 df bne pvnibble2char 6977 273e4 6978 273e4 ;point to the start of our valuebuffer 6979 273e4 18 clc 6980 273e5 a9 00 lda #VALBUFFER 6984 273ee 69 00 adc #0 6985 273f0 85 43 sta temp2 6986 273f2 6987 273f2 ;advance valbufend to the end of our value buffer 6988 273f2 8e ad 01 stx valbufend 6989 273f5 6990 273f5 ifnconst plotvalueonscreen 6991 273f5 4c 7b f3 jmp plotcharacters 6992 273f8 - else 6993 273f8 - jmp plotcharacterslive 6994 273f8 endif 6995 273f8 6996 273f8 endif ; USED_PLOTVALUE 6997 273f8 6998 273f8 6999 273f8 - ifconst USED_PLOTVALUEEXTRA 7000 273f8 -plotdigitcount = temp6 7001 273f8 -plotvalueextra 7002 273f8 - ; calling 7800basic command: 7003 273f8 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 7004 273f8 - ; ...displays the variable as BCD digits 7005 273f8 - ; 7006 273f8 - ; asm sub arguments: 7007 273f8 - ; temp1=lo charactermap 7008 273f8 - ; temp2=hi charactermap 7009 273f8 - ; temp3=palette | width byte 7010 273f8 - ; temp4=x 7011 273f8 - ; temp5=y 7012 273f8 - ; temp6=number of digits 7013 273f8 - ; temp7=lo variable 7014 273f8 - ; temp8=hi variable 7015 273f8 - 7016 273f8 - lda #0 7017 273f8 - tay 7018 273f8 - ldx valbufend 7019 273f8 - ifnconst plotvalueonscreen 7020 273f8 - sta VALBUFFER,x 7021 273f8 - endif 7022 273f8 - 7023 273f8 - lda plotdigitcount 7024 273f8 - and #1 7025 273f8 - 7026 273f8 - bne pvnibble2char_skipnibbleextra 7027 273f8 - 7028 273f8 -pvnibble2charextra 7029 273f8 - ; high nibble... 7030 273f8 - lda (temp7),y 7031 273f8 - and #$f0 7032 273f8 - lsr 7033 273f8 - lsr 7034 273f8 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 7035 273f8 - lsr 7036 273f8 - endif 7037 273f8 - clc 7038 273f8 - adc temp1 ; add the offset to character graphics to our value 7039 273f8 - sta VALBUFFER,x 7040 273f8 - inx 7041 273f8 - 7042 273f8 - ; second half of the digit 7043 273f8 - clc 7044 273f8 - adc #1 7045 273f8 - sta VALBUFFER,x 7046 273f8 - inx 7047 273f8 - 7048 273f8 -pvnibble2char_skipnibbleextra 7049 273f8 - ; low nibble... 7050 273f8 - lda (temp7),y 7051 273f8 - and #$0f 7052 273f8 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 7053 273f8 - asl 7054 273f8 - endif 7055 273f8 - asl 7056 273f8 - 7057 273f8 - clc 7058 273f8 - adc temp1 ; add the offset to character graphics to our value 7059 273f8 - sta VALBUFFER,x 7060 273f8 - inx 7061 273f8 - 7062 273f8 - clc 7063 273f8 - adc #1 7064 273f8 - sta VALBUFFER,x 7065 273f8 - inx 7066 273f8 - iny 7067 273f8 - 7068 273f8 - dec plotdigitcount 7069 273f8 - bne pvnibble2charextra 7070 273f8 - 7071 273f8 - ;point to the start of our valuebuffer 7072 273f8 - clc 7073 273f8 - lda #VALBUFFER 7077 273f8 - adc #0 7078 273f8 - sta temp2 7079 273f8 - 7080 273f8 - ;advance valbufend to the end of our value buffer 7081 273f8 - stx valbufend 7082 273f8 - 7083 273f8 - ifnconst plotvalueonscreen 7084 273f8 - jmp plotcharacters 7085 273f8 - else 7086 273f8 - jmp plotcharacterslive 7087 273f8 - endif 7088 273f8 endif ; USED_PLOTVALUEEXTRA 7089 273f8 7090 273f8 boxcollision 7091 273f8 ifconst BOXCOLLISION 7092 273f8 ; the worst case cycle-time for the code below is 43 cycles. 7093 273f8 ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 7094 273f8 7095 273f8 ;__boxx1 = accumulator 7096 273f8 ;__boxy1 = y 7097 273f8 00 44 __boxw1 = temp3 7098 273f8 00 45 __boxh1 = temp4 7099 273f8 7100 273f8 00 46 __boxx2 = temp5 7101 273f8 00 47 __boxy2 = temp6 7102 273f8 00 48 __boxw2 = temp7 7103 273f8 00 49 __boxh2 = temp8 7104 273f8 7105 273f8 DoXCollisionCheck 7106 273f8 ;lda __boxx1 ; skipped. already in the accumulator 7107 273f8 c5 46 cmp __boxx2 ;3 7108 273fa b0 07 bcs X1isbiggerthanX2 ;2/3 7109 273fc X2isbiggerthanX1 7110 273fc ; carry is clear 7111 273fc 65 44 adc __boxw1 ;3 7112 273fe c5 46 cmp __boxx2 ;3 7113 27400 b0 08 bcs DoYCollisionCheck ;3/2 7114 27402 60 rts ;6 - carry clear, no collision 7115 27403 X1isbiggerthanX2 7116 27403 18 clc ;2 7117 27404 e5 48 sbc __boxw2 ;3 7118 27406 c5 46 cmp __boxx2 ;3 7119 27408 b0 13 bcs noboxcollision ;3/2 7120 2740a DoYCollisionCheck 7121 2740a 98 tya ; 2 ; use to be "lda __boxy1" 7122 2740b c5 47 cmp __boxy2 ;3 7123 2740d b0 05 bcs Y1isbiggerthanY2 ;3/2 7124 2740f Y2isbiggerthanY1 7125 2740f ; carry is clear 7126 2740f 65 45 adc __boxh1 ;3 7127 27411 c5 47 cmp __boxy2 ;3 7128 27413 60 rts ;6 7129 27414 Y1isbiggerthanY2 7130 27414 18 clc ;2 7131 27415 e5 49 sbc __boxh2 ;3 7132 27417 c5 47 cmp __boxy2 ;3 7133 27419 b0 02 bcs noboxcollision ;3/2 7134 2741b yesboxcollision 7135 2741b 38 sec ;2 7136 2741c 60 rts ;6 7137 2741d noboxcollision 7138 2741d 18 clc ;2 7139 2741e 60 rts ;6 7140 2741f endif ; BOXCOLLISION 7141 2741f 7142 2741f randomize 7143 2741f a5 40 lda rand 7144 27421 4a lsr 7145 27422 26 41 rol rand16 7146 27424 90 02 bcc noeor 7147 27426 49 b4 eor #$B4 7148 27428 noeor 7149 27428 85 40 sta rand 7150 2742a 45 41 eor rand16 7151 2742c 60 rts 7152 2742d 7153 2742d ; *** bcd conversion routine courtesy Omegamatrix 7154 2742d ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 7155 2742d converttobcd 7156 2742d ;value to convert is in the accumulator 7157 2742d 85 42 sta temp1 7158 2742f 4a lsr 7159 27430 65 42 adc temp1 7160 27432 6a ror 7161 27433 4a lsr 7162 27434 4a lsr 7163 27435 65 42 adc temp1 7164 27437 6a ror 7165 27438 65 42 adc temp1 7166 2743a 6a ror 7167 2743b 4a lsr 7168 2743c 29 3c and #$3C 7169 2743e 85 43 sta temp2 7170 27440 4a lsr 7171 27441 65 43 adc temp2 7172 27443 65 42 adc temp1 7173 27445 60 rts ; return the result in the accumulator 7174 27446 7175 27446 ; Y and A contain multiplicands, result in A 7176 27446 mul8 7177 27446 84 42 sty temp1 7178 27448 85 43 sta temp2 7179 2744a a9 00 lda #0 7180 2744c reptmul8 7181 2744c 46 43 lsr temp2 7182 2744e 90 03 bcc skipmul8 7183 27450 18 clc 7184 27451 65 42 adc temp1 7185 27453 ;bcs donemul8 might save cycles? 7186 27453 skipmul8 7187 27453 ;beq donemul8 might save cycles? 7188 27453 06 42 asl temp1 7189 27455 d0 f5 bne reptmul8 7190 27457 donemul8 7191 27457 60 rts 7192 27458 7193 27458 div8 7194 27458 ; A=numerator Y=denominator, result in A 7195 27458 c0 02 cpy #2 7196 2745a 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 7197 2745c 84 42 sty temp1 7198 2745e a0 ff ldy #$ff 7199 27460 div8loop 7200 27460 e5 42 sbc temp1 7201 27462 c8 iny 7202 27463 b0 fb bcs div8loop 7203 27465 div8end 7204 27465 98 tya 7205 27466 ; result in A 7206 27466 60 rts 7207 27467 7208 27467 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 7209 27467 mul16 7210 27467 84 42 sty temp1 7211 27469 85 43 sta temp2 7212 2746b 7213 2746b a9 00 lda #0 7214 2746d a2 08 ldx #8 7215 2746f 46 42 lsr temp1 7216 27471 mul16_1 7217 27471 90 03 bcc mul16_2 7218 27473 18 clc 7219 27474 65 43 adc temp2 7220 27476 mul16_2 7221 27476 6a ror 7222 27477 66 42 ror temp1 7223 27479 ca dex 7224 2747a d0 f5 bne mul16_1 7225 2747c 85 43 sta temp2 7226 2747e 60 rts 7227 2747f 7228 2747f ; div int/int 7229 2747f ; numerator in A, denom in temp1 7230 2747f ; returns with quotient in A, remainder in temp1 7231 2747f div16 7232 2747f 85 43 sta temp2 7233 27481 84 42 sty temp1 7234 27483 a9 00 lda #0 7235 27485 a2 08 ldx #8 7236 27487 06 43 asl temp2 7237 27489 div16_1 7238 27489 2a rol 7239 2748a c5 42 cmp temp1 7240 2748c 90 02 bcc div16_2 7241 2748e e5 42 sbc temp1 7242 27490 div16_2 7243 27490 26 43 rol temp2 7244 27492 ca dex 7245 27493 d0 f4 bne div16_1 7246 27495 85 42 sta temp1 7247 27497 a5 43 lda temp2 7248 27499 60 rts 7249 2749a 7250 2749a ifconst bankswitchmode 7251 2749a BS_jsr 7252 2749a - ifconst dumpbankswitch 7253 2749a - sta dumpbankswitch 7254 2749a endif 7255 2749a - ifconst MCPDEVCART 7256 2749a - ora #$18 7257 2749a - sta $3000 7258 2749a else 7259 2749a 8d 00 80 sta $8000 7260 2749d endif 7261 2749d 68 pla 7262 2749e aa tax 7263 2749f 68 pla 7264 274a0 60 rts 7265 274a1 7266 274a1 BS_return 7267 274a1 68 pla ; bankswitch bank 7268 274a2 - ifconst dumpbankswitch 7269 274a2 - sta dumpbankswitch 7270 274a2 endif 7271 274a2 - ifconst BANKRAM 7272 274a2 - sta currentbank 7273 274a2 - ora currentrambank 7274 274a2 endif 7275 274a2 - ifconst MCPDEVCART 7276 274a2 - ora #$18 7277 274a2 - sta $3000 7278 274a2 else 7279 274a2 8d 00 80 sta $8000 7280 274a5 endif 7281 274a5 68 pla ; bankswitch $0 flag 7282 274a6 60 rts 7283 274a7 endif 7284 274a7 7285 274a7 checkselectswitch 7286 274a7 ad 82 02 lda SWCHB ; first check the real select switch... 7287 274aa 29 02 and #%00000010 7288 274ac ifnconst MOUSESUPPORT 7289 274ac ifnconst TRAKBALLSUPPORT 7290 274ac f0 05 beq checkselectswitchreturn ; switch is pressed 7291 274ae ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 7292 274b1 29 b0 and #%10110000 ; R_DU 7293 274b3 endif ; TRAKBALLSUPPORT 7294 274b3 endif ; MOUSESUPPORT 7295 274b3 checkselectswitchreturn 7296 274b3 60 rts 7297 274b4 7298 274b4 checkresetswitch 7299 274b4 ad 82 02 lda SWCHB ; first check the real reset switch... 7300 274b7 29 01 and #%00000001 7301 274b9 ifnconst MOUSESUPPORT 7302 274b9 ifnconst TRAKBALLSUPPORT 7303 274b9 f0 05 beq checkresetswitchreturn ; switch is pressed 7304 274bb ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 7305 274be 29 70 and #%01110000 ; _LDU 7306 274c0 endif ; TRAKBALLSUPPORT 7307 274c0 endif ; MOUSESUPPORT 7308 274c0 checkresetswitchreturn 7309 274c0 60 rts 7310 274c1 7311 274c1 - ifconst FINESCROLLENABLED 7312 274c1 -finescrolldlls 7313 274c1 - ldx temp1 ; first DLL index x3 7314 274c1 - lda DLLMEM,x 7315 274c1 - and #%11110000 7316 274c1 - ora finescrolly 7317 274c1 - sta DLLMEM,x 7318 274c1 - 7319 274c1 - ldx temp2 ; last DLL index x3 7320 274c1 - lda DLLMEM,x 7321 274c1 - and #%11110000 7322 274c1 - ora finescrolly 7323 274c1 - eor #(WZONEHEIGHT-1) 7324 274c1 - sta DLLMEM,x 7325 274c1 - rts 7326 274c1 endif ; FINESCROLLENABLED 7327 274c1 7328 274c1 - ifconst USED_ADJUSTVISIBLE 7329 274c1 -adjustvisible 7330 274c1 - ; called with temp1=first visible zone *3, temp2=last visible zone *3 7331 274c1 - jsr waitforvblankstart ; ensure vblank just started 7332 274c1 - ldx visibleDLLstart 7333 274c1 -findfirstinterrupt 7334 274c1 - lda DLLMEM,x 7335 274c1 - bmi foundfirstinterrupt 7336 274c1 - inx 7337 274c1 - inx 7338 274c1 - inx 7339 274c1 - bne findfirstinterrupt 7340 274c1 -foundfirstinterrupt 7341 274c1 - and #%01111111 ; clear the interrupt bit 7342 274c1 - sta DLLMEM,x 7343 274c1 - ifconst DOUBLEBUFFER 7344 274c1 - sta DLLMEM+DBOFFSET,x 7345 274c1 - endif ; DOUBLEBUFFER 7346 274c1 - ldx overscanDLLstart 7347 274c1 -findlastinterrupt 7348 274c1 - lda DLLMEM,x 7349 274c1 - bmi foundlastinterrupt 7350 274c1 - dex 7351 274c1 - dex 7352 274c1 - dex 7353 274c1 - bne findlastinterrupt 7354 274c1 -foundlastinterrupt 7355 274c1 - and #%01111111 ; clear the interrupt bit 7356 274c1 - sta DLLMEM,x 7357 274c1 - ifconst DOUBLEBUFFER 7358 274c1 - sta DLLMEM+DBOFFSET,x 7359 274c1 - endif ; DOUBLEBUFFER 7360 274c1 - ;now we need to set the new interrupts 7361 274c1 - clc 7362 274c1 - lda temp1 7363 274c1 - adc visibleDLLstart 7364 274c1 - tax 7365 274c1 - lda DLLMEM,x 7366 274c1 - ora #%10000000 7367 274c1 - sta DLLMEM,x 7368 274c1 - ifconst DOUBLEBUFFER 7369 274c1 - sta DLLMEM+DBOFFSET,x 7370 274c1 - endif ; DOUBLEBUFFER 7371 274c1 - clc 7372 274c1 - lda temp2 7373 274c1 - adc visibleDLLstart 7374 274c1 - tax 7375 274c1 - lda DLLMEM,x 7376 274c1 - ora #%10000000 7377 274c1 - sta DLLMEM,x 7378 274c1 - ifconst DOUBLEBUFFER 7379 274c1 - sta DLLMEM+DBOFFSET,x 7380 274c1 - endif ; DOUBLEBUFFER 7381 274c1 - jsr vblankresync 7382 274c1 - rts 7383 274c1 endif ; USED_ADJUSTVISIBLE 7384 274c1 7385 274c1 vblankresync 7386 274c1 20 5f f5 jsr waitforvblankstart ; ensure vblank just started 7387 274c4 a9 00 lda #0 7388 274c6 85 4d sta visibleover 7389 274c8 a9 03 lda #3 7390 274ca 8d b2 01 sta interruptindex 7391 274cd 60 rts 7392 274ce 7393 274ce createallgamedlls 7394 274ce a2 00 ldx #0 7395 274d0 a9 19 lda #NVLINES 7396 274d2 ac 09 21 ldy paldetected 7397 274d5 f0 03 beq skipcreatePALpadding 7398 274d7 18 clc 7399 274d8 69 15 adc #21 7400 274da skipcreatePALpadding 7401 274da 20 0f f5 jsr createnonvisibledlls 7402 274dd 8e 3c 21 stx visibleDLLstart 7403 274e0 20 40 f5 jsr createvisiblezones 7404 274e3 8e 3d 21 stx overscanDLLstart 7405 274e6 createallgamedllscontinue 7406 274e6 a9 50 lda #(NVLINES+55) ; extras for PAL 7407 274e8 20 0f f5 jsr createnonvisibledlls 7408 274eb 7409 274eb ae 3c 21 ldx visibleDLLstart 7410 274ee bd 00 18 lda DLLMEM,x 7411 274f1 09 80 ora #%10000000 ; NMI 1 - start of visible screen 7412 274f3 9d 00 18 sta DLLMEM,x 7413 274f6 - ifconst DOUBLEBUFFER 7414 274f6 - sta DLLMEM+DBOFFSET,x 7415 274f6 endif ; DOUBLEBUFFER 7416 274f6 7417 274f6 ae 3d 21 ldx overscanDLLstart 7418 274f9 bd 00 18 lda DLLMEM,x 7419 274fc 09 83 ora #%10000011 ; NMI 2 - end of visible screen 7420 274fe 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 7421 27500 9d 00 18 sta DLLMEM,x 7422 27503 - ifconst DOUBLEBUFFER 7423 27503 - sta DLLMEM+DBOFFSET,x 7424 27503 endif ; DOUBLEBUFFER 7425 27503 7426 27503 e8 inx 7427 27504 e8 inx 7428 27505 e8 inx 7429 27506 7430 27506 bd 00 18 lda DLLMEM,x 7431 27509 09 80 ora #%10000000 ; NMI 3 - deeper overscan 7432 2750b 9d 00 18 sta DLLMEM,x 7433 2750e - ifconst DOUBLEBUFFER 7434 2750e - sta DLLMEM+DBOFFSET,x 7435 2750e endif ; DOUBLEBUFFER 7436 2750e 7437 2750e 60 rts 7438 2750f 7439 2750f createnonvisibledlls 7440 2750f 85 42 sta temp1 7441 27511 4a lsr 7442 27512 4a lsr 7443 27513 4a lsr 7444 27514 4a lsr ; /16 7445 27515 f0 09 beq skipcreatenonvisibledlls1loop 7446 27517 a8 tay 7447 27518 createnonvisibledlls1loop 7448 27518 a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 7449 2751a 20 2f f5 jsr createblankdllentry 7450 2751d 88 dey 7451 2751e d0 f8 bne createnonvisibledlls1loop 7452 27520 skipcreatenonvisibledlls1loop 7453 27520 a5 42 lda temp1 7454 27522 29 0f and #%00001111 7455 27524 f0 08 beq createnonvisibledllsreturn 7456 27526 38 sec 7457 27527 e9 01 sbc #1 7458 27529 09 40 ora #%01000000 7459 2752b 20 2f f5 jsr createblankdllentry 7460 2752e createnonvisibledllsreturn 7461 2752e 60 rts 7462 2752f 7463 2752f createblankdllentry 7464 2752f 9d 00 18 sta DLLMEM,x 7465 27532 - ifconst DOUBLEBUFFER 7466 27532 - sta DLLMEM+DBOFFSET,x 7467 27532 endif ; DOUBLEBUFFER 7468 27532 e8 inx 7469 27533 a9 21 lda #$21 ; blank 7470 27535 9d 00 18 sta DLLMEM,x 7471 27538 - ifconst DOUBLEBUFFER 7472 27538 - sta DLLMEM+DBOFFSET,x 7473 27538 endif ; DOUBLEBUFFER 7474 27538 e8 inx 7475 27539 a9 00 lda #$00 7476 2753b 9d 00 18 sta DLLMEM,x 7477 2753e - ifconst DOUBLEBUFFER 7478 2753e - sta DLLMEM+DBOFFSET,x 7479 2753e endif ; DOUBLEBUFFER 7480 2753e e8 inx 7481 2753f 60 rts 7482 27540 7483 27540 createvisiblezones 7484 27540 a0 00 ldy #0 7485 27542 createvisiblezonesloop 7486 27542 b9 54 f6 lda.w DLHEIGHT,y 7487 27545 09 20 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 7488 27547 9d 00 18 sta DLLMEM,x 7489 2754a - ifconst DOUBLEBUFFER 7490 2754a - sta DLLMEM+DBOFFSET,x 7491 2754a endif ; DOUBLEBUFFER 7492 2754a e8 inx 7493 2754b b9 24 f6 lda DLPOINTH,y 7494 2754e 9d 00 18 sta DLLMEM,x 7495 27551 - ifconst DOUBLEBUFFER 7496 27551 - sta DLLMEM+DBOFFSET,x 7497 27551 endif ; DOUBLEBUFFER 7498 27551 e8 inx 7499 27552 b9 3c f6 lda DLPOINTL,y 7500 27555 9d 00 18 sta DLLMEM,x 7501 27558 - ifconst DOUBLEBUFFER 7502 27558 - clc 7503 27558 - adc #DOUBLEBUFFEROFFSET 7504 27558 - sta DLLMEM+DBOFFSET,x 7505 27558 - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 7506 27558 - inc DLLMEM+DBOFFSET-1,x 7507 27558 -skiphidoublebufferadjust 7508 27558 endif ; DOUBLEBUFFER 7509 27558 e8 inx 7510 27559 c8 iny 7511 2755a c0 18 cpy #WZONECOUNT 7512 2755c d0 e4 bne createvisiblezonesloop 7513 2755e 60 rts 7514 2755f 7515 2755f waitforvblankstart 7516 2755f vblankendwait 7517 2755f 24 28 BIT MSTAT 7518 27561 30 fc bmi vblankendwait 7519 27563 vblankstartwait 7520 27563 24 28 BIT MSTAT 7521 27565 10 fc bpl vblankstartwait 7522 27567 60 rts 7523 27568 7524 27568 - ifconst DOUBLEBUFFER 7525 27568 -flipdisplaybufferreturn 7526 27568 - rts 7527 27568 -flipdisplaybuffer 7528 27568 - ifconst interrupthold 7529 27568 - lda #$FF 7530 27568 - sta interrupthold 7531 27568 - endif 7532 27568 - lda doublebufferstate 7533 27568 - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 7534 27568 - 7535 27568 - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 7536 27568 - 7537 27568 - lda doublebufferstate 7538 27568 - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 7539 27568 - tax 7540 27568 - 7541 27568 - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 7542 27568 - 7543 27568 -flipdisplaybufferwait1 7544 27568 - lda visibleover 7545 27568 - beq flipdisplaybufferwait1 7546 27568 - 7547 27568 -flipdisplaybufferwait 7548 27568 - lda visibleover 7549 27568 - bne flipdisplaybufferwait 7550 27568 - 7551 27568 - lda doublebufferminimumframetarget 7552 27568 - beq skipminimumframecode 7553 27568 - lda doublebufferminimumframeindex 7554 27568 - bne flipdisplaybufferwait1 7555 27568 - lda doublebufferminimumframetarget 7556 27568 - sta doublebufferminimumframeindex 7557 27568 -skipminimumframecode 7558 27568 - 7559 27568 - lda DLLMEMLutHi,x 7560 27568 - sta DPPH 7561 27568 - lda DLLMEMLutLo,x 7562 27568 - sta DPPL 7563 27568 - 7564 27568 - lda NewPageflipstate,x 7565 27568 - sta doublebufferstate 7566 27568 - lda NewPageflipoffset,x 7567 27568 - sta doublebufferdloffset 7568 27568 - 7569 27568 - lda doublebufferbufferdirty 7570 27568 - beq flipdisplaybufferreturn 7571 27568 - 7572 27568 - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 7573 27568 - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 7574 27568 - ; from the displayed buffer to the working buffer... 7575 27568 - 7576 27568 - lda doublebufferdloffset 7577 27568 - eor #DOUBLEBUFFEROFFSET 7578 27568 - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 7579 27568 - 7580 27568 - ldx #(WZONECOUNT-1) 7581 27568 -copybufferzoneloop 7582 27568 - 7583 27568 - lda DLPOINTL,x 7584 27568 - clc 7585 27568 - adc doublebufferdloffset 7586 27568 - sta temp1 7587 27568 - lda DLPOINTH,x 7588 27568 - adc #0 7589 27568 - sta temp2 7590 27568 - 7591 27568 - lda DLPOINTL,x 7592 27568 - clc 7593 27568 - adc temp6 7594 27568 - sta temp3 7595 27568 - lda DLPOINTH,x 7596 27568 - adc #0 7597 27568 - sta temp4 7598 27568 - 7599 27568 - lda dlendsave,x 7600 27568 - tay 7601 27568 -copybuffercharsloop 7602 27568 - lda (temp3),y 7603 27568 - sta (temp1),y 7604 27568 - dey 7605 27568 - bpl copybuffercharsloop 7606 27568 - dex 7607 27568 - bpl copybufferzoneloop 7608 27568 - lda #0 7609 27568 - sta doublebufferbufferdirty 7610 27568 - rts 7611 27568 - 7612 27568 -doublebufferoff 7613 27568 - lda #1 7614 27568 - sta doublebufferstate 7615 27568 - jsr flipdisplaybuffer 7616 27568 - lda #0 7617 27568 - sta doublebufferstate 7618 27568 - sta doublebufferdloffset 7619 27568 - rts 7620 27568 - 7621 27568 -DLLMEMLutLo 7622 27568 - .byte DLLMEM,>(DLLMEM+DBOFFSET) 7625 27568 -NewPageflipstate 7626 27568 - .byte 3,1 7627 27568 -NewPageflipoffset 7628 27568 - .byte DOUBLEBUFFEROFFSET,0 7629 27568 - 7630 27568 endif ; DOUBLEBUFFER 7631 27568 7632 27568 - ifconst MOUSESUPPORT 7633 27568 - 7634 27568 -rotationalcompare 7635 27568 - ; old = 00 01 10 11 7636 27568 - .byte $00, $01, $ff, $00 ; new=00 7637 27568 - .byte $ff, $00, $00, $01 ; new=01 7638 27568 - .byte $01, $00, $00, $ff ; new=10 7639 27568 - .byte $00, $ff, $01, $00 ; new=11 7640 27568 - 7641 27568 - ; 0000YyXx st mouse 7642 27568 - 7643 27568 - ; 0000xyXY amiga mouse 7644 27568 - 7645 27568 - ifconst MOUSEXONLY 7646 27568 -amigatoataribits ; swap bits 1 and 4... 7647 27568 - .byte %0000, %0000, %0010, %0010 7648 27568 - .byte %0000, %0000, %0010, %0010 7649 27568 - .byte %0001, %0001, %0011, %0011 7650 27568 - .byte %0001, %0001, %0011, %0011 7651 27568 - 7652 27568 - ; null change bits 7653 27568 - .byte %0000, %0001, %0010, %0011 7654 27568 - .byte %0000, %0001, %0010, %0011 7655 27568 - .byte %0000, %0001, %0010, %0011 7656 27568 - .byte %0000, %0001, %0010, %0011 7657 27568 - 7658 27568 - else ; !MOUSEXONLY 7659 27568 - 7660 27568 -amigatoataribits ; swap bits 1 and 4... 7661 27568 - .byte %0000, %1000, %0010, %1010 7662 27568 - .byte %0100, %1100, %0110, %1110 7663 27568 - .byte %0001, %1001, %0011, %1011 7664 27568 - .byte %0101, %1101, %0111, %1111 7665 27568 - ; null change bits 7666 27568 - .byte %0000, %0001, %0010, %0011 7667 27568 - .byte %0100, %0101, %0110, %0111 7668 27568 - .byte %1000, %1001, %1010, %1011 7669 27568 - .byte %1100, %1101, %1110, %1111 7670 27568 - endif ; !MOUSEXONLY 7671 27568 - 7672 27568 endif ; MOUSESUPPORT 7673 27568 7674 27568 mouse0update 7675 27568 - ifconst MOUSE0SUPPORT 7676 27568 - 7677 27568 -mousetableselect = inttemp2 7678 27568 -mousexdelta = inttemp3 7679 27568 -mouseydelta = inttemp4 7680 27568 -lastSWCHA = inttemp6 7681 27568 - 7682 27568 - ; 0000YyXx st mouse 7683 27568 - ; 0000xyXY amiga mouse 7684 27568 - 7685 27568 - lda #$ff 7686 27568 - sta lastSWCHA 7687 27568 - 7688 27568 - ldy port0control 7689 27568 - 7690 27568 - lda #%00010000 7691 27568 - cpy #9 ; AMIGA? 7692 27568 - bne skipamigabitsfix0 7693 27568 - lda #0 7694 27568 -skipamigabitsfix0 7695 27568 - sta mousetableselect 7696 27568 - ifconst DRIVINGBOOST 7697 27568 - cpy #6 ; DRIVING? 7698 27568 - bne skipdriving0setup 7699 27568 - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 7700 27568 - ; trails the actual mousex0, so we can smoothly interpolate toward 7701 27568 - ; the actual position. This actual position is stored in mousey0 7702 27568 - ; after the driver has run. 7703 27568 - ldx mousex0 7704 27568 - lda mousey0 7705 27568 - stx mousey0 7706 27568 - sta mousex0 7707 27568 -skipdriving0setup 7708 27568 - endif ; DRIVINGBOOST 7709 27568 - 7710 27568 - lda #0 7711 27568 - sta mousexdelta 7712 27568 - sta mouseydelta 7713 27568 - 7714 27568 - ifnconst MOUSETIME 7715 27568 - ifnconst MOUSEXONLY 7716 27568 - lda #180 ; minimum for x+y 7717 27568 - else 7718 27568 - lda #100 ; minimum for just x 7719 27568 - endif 7720 27568 - else 7721 27568 - lda #MOUSETIME 7722 27568 - endif 7723 27568 - jsr SETTIM64T ; INTIM is in Y 7724 27568 - 7725 27568 -mouse0updateloop 7726 27568 - lda SWCHA 7727 27568 - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 7728 27568 - cmp lastSWCHA 7729 27568 - beq mouse0loopcondition 7730 27568 - sta lastSWCHA 7731 27568 - lsr 7732 27568 - lsr 7733 27568 - lsr 7734 27568 - 7735 27568 - ora mousetableselect ; atari/amiga decoding table selection 7736 27568 - 7737 27568 - ; st mice encode on different bits/joystick-lines than amiga mice... 7738 27568 - ; 0000YyXx st mouse 7739 27568 - ; 0000xyXY amiga mouse 7740 27568 - ; ...so can shuffle the amiga bits to reuse the st driver. 7741 27568 - tay 7742 27568 - lax amigatoataribits,y 7743 27568 - 7744 27568 - ifnconst MOUSEXONLY 7745 27568 - ; first the Y... 7746 27568 - and #%00001100 7747 27568 - ora mousecodey0 7748 27568 - tay 7749 27568 - lda rotationalcompare,y 7750 27568 - clc 7751 27568 - adc mouseydelta 7752 27568 - sta mouseydelta 7753 27568 - tya 7754 27568 - lsr 7755 27568 - lsr 7756 27568 - sta mousecodey0 7757 27568 - txa 7758 27568 - ; ...then the X... 7759 27568 - and #%00000011 7760 27568 - tax 7761 27568 - endif ; !MOUSEXONLY 7762 27568 - 7763 27568 - asl 7764 27568 - asl 7765 27568 - ora mousecodex0 7766 27568 - tay 7767 27568 - lda rotationalcompare,y 7768 27568 - adc mousexdelta ; carry was clear by previous ASL 7769 27568 - sta mousexdelta 7770 27568 - stx mousecodex0 7771 27568 -mouse0loopcondition 7772 27568 - lda TIMINT 7773 27568 - bpl mouse0updateloop 7774 27568 - 7775 27568 - ; *** adapt to selected device resolution. 7776 27568 - ldx port0control 7777 27568 - 7778 27568 - ifconst PRECISIONMOUSING 7779 27568 - ldy port0resolution 7780 27568 - bne mouse0halveddone 7781 27568 - cpx #6 ; half-resolution is no good for driving wheels 7782 27568 - beq mouse0halveddone 7783 27568 - ; resolution=0 is half mouse resolution, necessary for precision 7784 27568 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7785 27568 - 7786 27568 - lda mousexdelta 7787 27568 - cmp #$80 7788 27568 - ror ; do a signed divide by 2. 7789 27568 - clc 7790 27568 - adc mousex0 7791 27568 - sta mousex0 7792 27568 - ifnconst MOUSEXONLY 7793 27568 - lda mouseydelta 7794 27568 - clc 7795 27568 - adc mousey0 7796 27568 - sta mousey0 7797 27568 - endif 7798 27568 - ; at half resolution we just exit after updating x and y 7799 27568 - jmp LLRET0 7800 27568 -mouse0halveddone 7801 27568 - endif ; PRECISIONMOUSING 7802 27568 - 7803 27568 - ifnconst MOUSEXONLY 7804 27568 - asl mouseydelta ; *2 because Y resolution is finer 7805 27568 - ldy port0resolution 7806 27568 - dey 7807 27568 - lda #0 7808 27568 -mousey0resolutionfix 7809 27568 - clc 7810 27568 - adc mouseydelta 7811 27568 - dey 7812 27568 - bpl mousey0resolutionfix 7813 27568 - clc 7814 27568 - adc mousey0 7815 27568 - sta mousey0 7816 27568 - endif ; MOUSEXONLY 7817 27568 - 7818 27568 - ldy port0resolution 7819 27568 - dey 7820 27568 - lda #0 7821 27568 -mousex0resolutionfix 7822 27568 - clc 7823 27568 - adc mousexdelta 7824 27568 - dey 7825 27568 - bpl mousex0resolutionfix 7826 27568 - ifnconst DRIVINGBOOST 7827 27568 - clc 7828 27568 - adc mousex0 7829 27568 - sta mousex0 7830 27568 - else 7831 27568 - cpx #6 7832 27568 - beq carryonmouse0boost 7833 27568 - clc 7834 27568 - adc mousex0 7835 27568 - sta mousex0 7836 27568 - jmp LLRET0 7837 27568 -carryonmouse0boost 7838 27568 - sta mousexdelta 7839 27568 - clc 7840 27568 - adc mousecodey0 7841 27568 - sta mousecodey0 7842 27568 - clc 7843 27568 - adc mousex0 7844 27568 - tay ; save the target X 7845 27568 - adc mousey0 ; average in the smoothly-trailing X 7846 27568 - ror 7847 27568 - sta mousex0 ; mousex0 now has the smoothly trailing X 7848 27568 - sty mousey0 ; and mousey0 has the the target X 7849 27568 - 7850 27568 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7851 27568 - ; A has mousex0, the smoothly trailing X 7852 27568 - sbc mousey0 ; less the target X 7853 27568 - bpl skipabsolutedrive0 7854 27568 - eor #$ff 7855 27568 -skipabsolutedrive0 7856 27568 - cmp #64 ; just an unreasonably large change 7857 27568 - bcc skipdrivewrapfix0 7858 27568 - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 7859 27568 -skipdrivewrapfix0 7860 27568 - 7861 27568 - ; get rid of the tweening if the distance travelled was very small 7862 27568 - lda mousexdelta 7863 27568 - cmp port0resolution 7864 27568 - bcs skipbetweenfix0 7865 27568 - lda mousex0 7866 27568 - sta mousey0 7867 27568 -skipbetweenfix0 7868 27568 - 7869 27568 -drivingboostreductioncheck0 7870 27568 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7871 27568 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7872 27568 - ; negated again because truncation during BCD math results in 7873 27568 - ; differing magnitudes, depending if the value is +ve or -ve. 7874 27568 -driving0fix 7875 27568 - lax mousecodey0 7876 27568 - cmp #$80 7877 27568 - bcs driving0skipnegate1 7878 27568 - eor #$FF 7879 27568 - adc #1 7880 27568 - sta mousecodey0 7881 27568 -driving0skipnegate1 7882 27568 - cmp #$80 7883 27568 - ror 7884 27568 - cmp #$80 7885 27568 - ror 7886 27568 - cmp #$80 7887 27568 - ror 7888 27568 - sta inttemp1 7889 27568 - lda mousecodey0 7890 27568 - sec 7891 27568 - sbc inttemp1 7892 27568 - cpx #$80 7893 27568 - bcs driving0skipnegate2 7894 27568 - eor #$FF 7895 27568 - adc #1 7896 27568 -driving0skipnegate2 7897 27568 - sta mousecodey0 7898 27568 -drivingboostdone0 7899 27568 - endif ; DRIVINGBOOST 7900 27568 - 7901 27568 - jmp LLRET0 7902 27568 - 7903 27568 endif ; MOUSE0SUPPORT 7904 27568 7905 27568 mouse1update 7906 27568 - ifconst MOUSE1SUPPORT 7907 27568 - 7908 27568 -mousetableselect = inttemp2 7909 27568 -mousexdelta = inttemp3 7910 27568 -mouseydelta = inttemp4 7911 27568 -lastSWCHA = inttemp6 7912 27568 - 7913 27568 - ; 0000YyXx st mouse 7914 27568 - ; 0000xyXY amiga mouse 7915 27568 - 7916 27568 - lda #$ff 7917 27568 - sta lastSWCHA 7918 27568 - 7919 27568 - ldy port1control 7920 27568 - 7921 27568 - lda #%00010000 7922 27568 - cpy #9 ; AMIGA? 7923 27568 - bne skipamigabitsfix1 7924 27568 - lda #0 7925 27568 -skipamigabitsfix1 7926 27568 - sta mousetableselect 7927 27568 - ifconst DRIVINGBOOST 7928 27568 - cpy #6 ; DRIVING? 7929 27568 - bne skipdriving1setup 7930 27568 - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 7931 27568 - ; trails the actual mousex1, so we can smoothly interpolate toward 7932 27568 - ; the actual position. This actual position is stored in mousey1 7933 27568 - ; after the driver has run. 7934 27568 - ldx mousex1 7935 27568 - lda mousey1 7936 27568 - stx mousey1 7937 27568 - sta mousex1 7938 27568 -skipdriving1setup 7939 27568 - endif ; DRIVINGBOOST 7940 27568 - 7941 27568 - lda #0 7942 27568 - sta mousexdelta 7943 27568 - sta mouseydelta 7944 27568 - 7945 27568 - ifnconst MOUSETIME 7946 27568 - ifnconst MOUSEXONLY 7947 27568 - lda #180 ; minimum for x+y 7948 27568 - else 7949 27568 - lda #100 ; minimum for just x 7950 27568 - endif 7951 27568 - else 7952 27568 - lda #MOUSETIME 7953 27568 - endif 7954 27568 - jsr SETTIM64T ; INTIM is in Y 7955 27568 - 7956 27568 -mouse1updateloop 7957 27568 - lda SWCHA 7958 27568 - and #%00001111 7959 27568 - cmp lastSWCHA 7960 27568 - beq mouse1loopcondition 7961 27568 - sta lastSWCHA 7962 27568 - 7963 27568 - ora mousetableselect ; atari/amiga decoding table selection 7964 27568 - 7965 27568 - ; st mice encode on different bits/joystick-lines than amiga mice... 7966 27568 - ; 0000YyXx st mouse 7967 27568 - ; 0000xyXY amiga mouse 7968 27568 - ; ...so can shuffle the amiga bits to reuse the st driver. 7969 27568 - tay 7970 27568 - lax amigatoataribits,y 7971 27568 - 7972 27568 - ifnconst MOUSEXONLY 7973 27568 - ; first the Y... 7974 27568 - and #%00001100 7975 27568 - ora mousecodey1 7976 27568 - tay 7977 27568 - lda rotationalcompare,y 7978 27568 - clc 7979 27568 - adc mouseydelta 7980 27568 - sta mouseydelta 7981 27568 - tya 7982 27568 - lsr 7983 27568 - lsr 7984 27568 - sta mousecodey1 7985 27568 - txa 7986 27568 - ; ...then the X... 7987 27568 - and #%00000011 7988 27568 - tax 7989 27568 - endif ; !MOUSEXONLY 7990 27568 - 7991 27568 - asl 7992 27568 - asl 7993 27568 - ora mousecodex1 7994 27568 - tay 7995 27568 - lda rotationalcompare,y 7996 27568 - adc mousexdelta ; carry was clear by previous ASL 7997 27568 - sta mousexdelta 7998 27568 - stx mousecodex1 7999 27568 -mouse1loopcondition 8000 27568 - lda TIMINT 8001 27568 - bpl mouse1updateloop 8002 27568 - 8003 27568 - ; *** adapt to selected device resolution. 8004 27568 - ldx port1control 8005 27568 - 8006 27568 - ifconst PRECISIONMOUSING 8007 27568 - ldy port1resolution 8008 27568 - bne mouse1halveddone 8009 27568 - cpx #6 ; half-resolution is no good for driving wheels 8010 27568 - beq mouse1halveddone 8011 27568 - ; resolution=0 is half mouse resolution, necessary for precision 8012 27568 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 8013 27568 - 8014 27568 - lda mousexdelta 8015 27568 - cmp #$80 8016 27568 - ror ; do a signed divide by 2. 8017 27568 - clc 8018 27568 - adc mousex1 8019 27568 - sta mousex1 8020 27568 - ifnconst MOUSEXONLY 8021 27568 - lda mouseydelta 8022 27568 - clc 8023 27568 - adc mousey1 8024 27568 - sta mousey1 8025 27568 - endif 8026 27568 - ; at half resolution we just exit after updating x and y 8027 27568 - jmp LLRET1 8028 27568 -mouse1halveddone 8029 27568 - endif ; PRECISIONMOUSING 8030 27568 - 8031 27568 - ifnconst MOUSEXONLY 8032 27568 - asl mouseydelta ; *2 because Y resolution is finer 8033 27568 - ldy port1resolution 8034 27568 - dey 8035 27568 - lda #0 8036 27568 -mousey1resolutionfix 8037 27568 - clc 8038 27568 - adc mouseydelta 8039 27568 - dey 8040 27568 - bpl mousey1resolutionfix 8041 27568 - clc 8042 27568 - adc mousey1 8043 27568 - sta mousey1 8044 27568 - endif ; MOUSEXONLY 8045 27568 - 8046 27568 - ldy port1resolution 8047 27568 - dey 8048 27568 - lda #0 8049 27568 -mousex1resolutionfix 8050 27568 - clc 8051 27568 - adc mousexdelta 8052 27568 - dey 8053 27568 - bpl mousex1resolutionfix 8054 27568 - ifnconst DRIVINGBOOST 8055 27568 - clc 8056 27568 - adc mousex1 8057 27568 - sta mousex1 8058 27568 - else 8059 27568 - cpx #6 8060 27568 - beq carryonmouse1boost 8061 27568 - clc 8062 27568 - adc mousex1 8063 27568 - sta mousex1 8064 27568 - jmp LLRET1 8065 27568 -carryonmouse1boost 8066 27568 - sta mousexdelta 8067 27568 - clc 8068 27568 - adc mousecodey1 8069 27568 - sta mousecodey1 8070 27568 - clc 8071 27568 - adc mousex1 8072 27568 - tay ; save the target X 8073 27568 - adc mousey1 ; average in the smoothly-trailing X 8074 27568 - ror 8075 27568 - sta mousex1 ; mousex0 now has the smoothly trailing X 8076 27568 - sty mousey1 ; and mousey0 has the the target X 8077 27568 - 8078 27568 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 8079 27568 - ; A has mousex1, the smoothly trailing X 8080 27568 - sbc mousey1 ; less the target X 8081 27568 - bpl skipabsolutedrive1 8082 27568 - eor #$ff 8083 27568 -skipabsolutedrive1 8084 27568 - cmp #64 ; just an unreasonably large change 8085 27568 - bcc skipdrivewrapfix1 8086 27568 - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 8087 27568 -skipdrivewrapfix1 8088 27568 - 8089 27568 - ; get rid of the tweening if the distance travelled was very small 8090 27568 - lda mousexdelta 8091 27568 - cmp port1resolution 8092 27568 - bcs skipbetweenfix1 8093 27568 - lda mousex1 8094 27568 - sta mousey1 8095 27568 -skipbetweenfix1 8096 27568 - 8097 27568 -drivingboostreductioncheck1 8098 27568 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 8099 27568 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 8100 27568 - ; negated again because truncation during BCD math results in 8101 27568 - ; differing magnitudes, depending if the value is +ve or -ve. 8102 27568 -driving1fix 8103 27568 - lax mousecodey1 8104 27568 - cmp #$80 8105 27568 - bcs driving0skipnegate1 8106 27568 - eor #$FF 8107 27568 - adc #1 8108 27568 - sta mousecodey1 8109 27568 -driving0skipnegate1 8110 27568 - cmp #$80 8111 27568 - ror 8112 27568 - cmp #$80 8113 27568 - ror 8114 27568 - cmp #$80 8115 27568 - ror 8116 27568 - sta inttemp1 8117 27568 - lda mousecodey1 8118 27568 - sec 8119 27568 - sbc inttemp1 8120 27568 - cpx #$80 8121 27568 - bcs driving1skipnegate2 8122 27568 - eor #$FF 8123 27568 - adc #1 8124 27568 -driving1skipnegate2 8125 27568 - sta mousecodey1 8126 27568 -drivingboostdone1 8127 27568 - endif ; DRIVINGBOOST 8128 27568 - 8129 27568 - jmp LLRET1 8130 27568 - 8131 27568 endif ; MOUSE1SUPPORT 8132 27568 8133 27568 8134 27568 trakball0update 8135 27568 - ifconst TRAKBALL0SUPPORT 8136 27568 - ifnconst TRAKTIME 8137 27568 - ifnconst TRAKXONLY 8138 27568 - lda #180 ; minimum for x+y 8139 27568 - else ; !TRAKXONLY 8140 27568 - lda #100 ; minimum for just x 8141 27568 - endif ; !TRAKXONLY 8142 27568 - else ; !TRAKTIME 8143 27568 - lda #TRAKTIME 8144 27568 - endif ; !TRAKTIME 8145 27568 - jsr SETTIM64T ; INTIM is in Y 8146 27568 - ldx #0 8147 27568 - ifnconst TRAKXONLY 8148 27568 - ldy #0 8149 27568 - endif ; TRAKXONLY 8150 27568 -trakball0updateloop 8151 27568 - lda SWCHA 8152 27568 - and #%00110000 8153 27568 - cmp trakballcodex0 8154 27568 - sta trakballcodex0 8155 27568 - beq trakball0movementXdone 8156 27568 - and #%00010000 8157 27568 - beq trakball0negativeX 8158 27568 -trakball0positiveX 8159 27568 - ;(2 from beq) 8160 27568 - inx ; 2 8161 27568 - jmp trakball0movementXdone ; 3 8162 27568 -trakball0negativeX 8163 27568 - ;(3 from beq) 8164 27568 - dex ; 2 8165 27568 - nop ; 2 8166 27568 -trakball0movementXdone 8167 27568 - 8168 27568 - ifnconst TRAKXONLY 8169 27568 - lda SWCHA 8170 27568 - and #%11000000 8171 27568 - cmp trakballcodey0 8172 27568 - sta trakballcodey0 8173 27568 - beq trakball0movementYdone 8174 27568 - and #%01000000 8175 27568 - beq trakball0negativeY 8176 27568 -trakball0positiveY 8177 27568 - ;(2 from beq) 8178 27568 - iny ; 2 8179 27568 - jmp trakball0movementYdone ; 3 8180 27568 -trakball0negativeY 8181 27568 - ;(3 from beq) 8182 27568 - dey ; 2 8183 27568 - nop ; 2 8184 27568 -trakball0movementYdone 8185 27568 - endif ; !TRAKXONLY 8186 27568 - 8187 27568 - lda TIMINT 8188 27568 - bpl trakball0updateloop 8189 27568 - lda #0 8190 27568 - cpx #0 8191 27568 - beq trakball0skipXadjust 8192 27568 - clc 8193 27568 -trakball0Xloop 8194 27568 - adc port0resolution 8195 27568 - dex 8196 27568 - bne trakball0Xloop 8197 27568 - clc 8198 27568 - adc trakballx0 8199 27568 - sta trakballx0 8200 27568 -trakball0skipXadjust 8201 27568 - ifnconst TRAKXONLY 8202 27568 - lda #0 8203 27568 - cpy #0 8204 27568 - beq trakball0skipYadjust 8205 27568 - clc 8206 27568 -trakball0yloop 8207 27568 - adc port0resolution 8208 27568 - dey 8209 27568 - bne trakball0yloop 8210 27568 - clc 8211 27568 - adc trakbally0 8212 27568 - sta trakbally0 8213 27568 -trakball0skipYadjust 8214 27568 - endif ; !TRAKXONLY 8215 27568 - 8216 27568 - jmp LLRET0 8217 27568 endif 8218 27568 8219 27568 8220 27568 8221 27568 trakball1update 8222 27568 - ifconst TRAKBALL1SUPPORT 8223 27568 - ifnconst TRAKTIME 8224 27568 - ifnconst TRAKXONLY 8225 27568 - lda #180 ; minimum for x+y 8226 27568 - else ; !TRAKXONLY 8227 27568 - lda #100 ; minimum for just x 8228 27568 - endif ; !TRAKXONLY 8229 27568 - else ; !TRAKTIME 8230 27568 - lda #TRAKTIME 8231 27568 - endif ; !TRAKTIME 8232 27568 - jsr SETTIM64T ; INTIM is in Y 8233 27568 - ldx #0 8234 27568 - ifnconst TRAKXONLY 8235 27568 - ldy #0 8236 27568 - endif ; TRAKXONLY 8237 27568 -trakball1updateloop 8238 27568 - lda SWCHA 8239 27568 - and #%00000011 8240 27568 - cmp trakballcodex1 8241 27568 - sta trakballcodex1 8242 27568 - beq trakball1movementXdone 8243 27568 - and #%00000001 8244 27568 - beq trakball1negativeX 8245 27568 -trakball1positiveX 8246 27568 - ;(2 from beq) 8247 27568 - inx ; 2 8248 27568 - jmp trakball1movementXdone ; 3 8249 27568 -trakball1negativeX 8250 27568 - ;(3 from beq) 8251 27568 - dex ; 2 8252 27568 - nop ; 2 8253 27568 -trakball1movementXdone 8254 27568 - 8255 27568 - ifnconst TRAKXONLY 8256 27568 - lda SWCHA 8257 27568 - and #%00001100 8258 27568 - cmp trakballcodey1 8259 27568 - sta trakballcodey1 8260 27568 - beq trakball1movementYdone 8261 27568 - and #%00000100 8262 27568 - beq trakball1negativeY 8263 27568 -trakball1positiveY 8264 27568 - ;(2 from beq) 8265 27568 - iny ; 2 8266 27568 - jmp trakball1movementYdone ; 3 8267 27568 -trakball1negativeY 8268 27568 - ;(3 from beq) 8269 27568 - dey ; 2 8270 27568 - nop ; 2 8271 27568 -trakball1movementYdone 8272 27568 - endif ; !TRAKXONLY 8273 27568 - 8274 27568 - lda TIMINT 8275 27568 - bpl trakball1updateloop 8276 27568 - lda #0 8277 27568 - cpx #0 8278 27568 - beq trakball1skipXadjust 8279 27568 - clc 8280 27568 -trakball1Xloop 8281 27568 - adc port1resolution 8282 27568 - dex 8283 27568 - bne trakball1Xloop 8284 27568 - clc 8285 27568 - adc trakballx1 8286 27568 - sta trakballx1 8287 27568 -trakball1skipXadjust 8288 27568 - ifnconst TRAKXONLY 8289 27568 - lda #0 8290 27568 - cpy #0 8291 27568 - beq trakball1skipYadjust 8292 27568 - clc 8293 27568 -trakball1yloop 8294 27568 - adc port1resolution 8295 27568 - dey 8296 27568 - bne trakball1yloop 8297 27568 - clc 8298 27568 - adc trakbally1 8299 27568 - sta trakbally1 8300 27568 -trakball1skipYadjust 8301 27568 - endif ; !TRAKXONLY 8302 27568 - 8303 27568 - jmp LLRET1 8304 27568 endif 8305 27568 8306 27568 8307 27568 paddleport0update 8308 27568 - ifconst PADDLE0SUPPORT 8309 27568 - lda #6 8310 27568 - sta VBLANK ; start charging the paddle caps 8311 27568 - lda #0 ; use PADDLE timing 8312 27568 - jsr SETTIM64T ; INTIM is in Y 8313 27568 - 8314 27568 -paddleport0updateloop 8315 27568 - lda INPT0 8316 27568 - bmi skippaddle0setposition 8317 27568 - sty paddleposition0 8318 27568 -skippaddle0setposition 8319 27568 - ifconst TWOPADDLESUPPORT 8320 27568 - lda INPT1 8321 27568 - bmi skippaddle1setposition 8322 27568 - sty paddleposition1 8323 27568 -skippaddle1setposition 8324 27568 - endif 8325 27568 - ldy INTIM 8326 27568 - cpy #TIMEOFFSET 8327 27568 - bcs paddleport0updateloop 8328 27568 - 8329 27568 - lda #%10000110 8330 27568 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8331 27568 - sec 8332 27568 - lda paddleposition0 8333 27568 - sbc #TIMEOFFSET 8334 27568 - ifconst PADDLESCALEX2 8335 27568 - asl 8336 27568 - endif 8337 27568 - 8338 27568 - ifnconst PADDLESMOOTHINGOFF 8339 27568 - clc 8340 27568 - adc paddleprevious0 8341 27568 - ror 8342 27568 - sta paddleprevious0 8343 27568 - endif 8344 27568 - 8345 27568 - sta paddleposition0 8346 27568 - 8347 27568 - ifconst TWOPADDLESUPPORT 8348 27568 - sec 8349 27568 - lda paddleposition1 8350 27568 - sbc #TIMEOFFSET 8351 27568 - ifconst PADDLESCALEX2 8352 27568 - asl 8353 27568 - endif 8354 27568 - 8355 27568 - ifnconst PADDLESMOOTHINGOFF 8356 27568 - clc 8357 27568 - adc paddleprevious1 8358 27568 - ror 8359 27568 - sta paddleprevious1 8360 27568 - endif 8361 27568 - sta paddleposition1 8362 27568 - endif ; TWOPADDLESUPPORT 8363 27568 - 8364 27568 - jmp LLRET0 8365 27568 endif 8366 27568 8367 27568 paddleport1update 8368 27568 - ifconst PADDLE1SUPPORT 8369 27568 - lda #6 8370 27568 - sta VBLANK ; start charging the paddle caps 8371 27568 - 8372 27568 - lda #0 ; use PADDLE timing 8373 27568 - jsr SETTIM64T ; INTIM is in Y 8374 27568 - 8375 27568 -paddleport1updateloop 8376 27568 - lda INPT2 8377 27568 - bmi skippaddle2setposition 8378 27568 - sty paddleposition2 8379 27568 -skippaddle2setposition 8380 27568 - ifconst TWOPADDLESUPPORT 8381 27568 - lda INPT3 8382 27568 - bmi skippaddle3setposition 8383 27568 - sty paddleposition3 8384 27568 -skippaddle3setposition 8385 27568 - endif 8386 27568 - ldy INTIM 8387 27568 - cpy #TIMEOFFSET 8388 27568 - bcs paddleport1updateloop 8389 27568 - 8390 27568 - lda #%10000110 8391 27568 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8392 27568 - sec 8393 27568 - lda paddleposition2 8394 27568 - sbc #TIMEOFFSET 8395 27568 - ifconst PADDLESCALEX2 8396 27568 - asl 8397 27568 - endif 8398 27568 - 8399 27568 - ifnconst PADDLESMOOTHINGOFF 8400 27568 - clc 8401 27568 - adc paddleprevious2 8402 27568 - ror 8403 27568 - sta paddleprevious2 8404 27568 - endif 8405 27568 - 8406 27568 - sta paddleposition2 8407 27568 - 8408 27568 - ifconst TWOPADDLESUPPORT 8409 27568 - sec 8410 27568 - lda paddleposition3 8411 27568 - sbc #TIMEOFFSET 8412 27568 - ifconst PADDLESCALEX2 8413 27568 - asl 8414 27568 - endif 8415 27568 - 8416 27568 - ifnconst PADDLESMOOTHINGOFF 8417 27568 - clc 8418 27568 - adc paddleprevious3 8419 27568 - ror 8420 27568 - sta paddleprevious3 8421 27568 - endif 8422 27568 - sta paddleposition3 8423 27568 - endif ; TWOPADDLESUPPORT 8424 27568 - 8425 27568 - jmp LLRET1 8426 27568 endif 8427 27568 8428 27568 8429 27568 paddlebuttonhandler ; outside of conditional, for button-handler LUT 8430 27568 - ifconst PADDLESUPPORT 8431 27568 - ; x=0|1 for port, rather than paddle #. 8432 27568 - ; Only the first paddle button will integrate into "joy0fire" testing. If the 8433 27568 - ; game wants to support 2 paddles, up to the game to instead test the 8434 27568 - ; joystick right+left directions instead. 8435 27568 - lda SWCHA ; top of nibble is first paddle button 8436 27568 - cpx #0 ; port 0? 8437 27568 - beq skippaddleport2shift 8438 27568 - asl ; shift second port to upper nibble 8439 27568 - asl 8440 27568 - asl 8441 27568 - asl 8442 27568 -skippaddleport2shift 8443 27568 - and #%10000000 8444 27568 - eor #%10000000 ; invert 8445 27568 - sta sINPT1,x 8446 27568 - jmp buttonreadloopreturn 8447 27568 endif ; PADDLESUPPORT 8448 27568 8449 27568 mousebuttonhandler ; outside of conditional, for button-handler LUT 8450 27568 - ifconst MOUSESUPPORT 8451 27568 - ; stick the mouse buttons in the correct shadow register... 8452 27568 - txa 8453 27568 - asl 8454 27568 - tay ; y=x*2 8455 27568 - lda INPT4,x 8456 27568 - eor #%10000000 8457 27568 - lsr 8458 27568 - sta sINPT1,x 8459 27568 - 8460 27568 - lda INPT1,y 8461 27568 - and #%10000000 8462 27568 - eor #%10000000 8463 27568 - ora sINPT1,x 8464 27568 - sta sINPT1,x 8465 27568 - jmp buttonreadloopreturn 8466 27568 endif ; MOUSESUPPORT 8467 27568 8468 27568 - ifconst KEYPADSUPPORT 8469 27568 - ; ** select keypad rows 0 to 3 over 4 frames... 8470 27568 -keypadrowselect 8471 27568 - ldy #0 8472 27568 - lda port0control 8473 27568 - cmp #7 8474 27568 - bne skipport0val 8475 27568 - iny ; y=y+1 8476 27568 -skipport0val 8477 27568 - lda port1control 8478 27568 - cmp #7 8479 27568 - bne skipport1val 8480 27568 - iny 8481 27568 - iny ; y=y+2 8482 27568 -skipport1val 8483 27568 - lda keyrowdirectionmask,y 8484 27568 - sta CTLSWA 8485 27568 - tya 8486 27568 - asl 8487 27568 - asl 8488 27568 - sta inttemp1 8489 27568 - lda framecounter 8490 27568 - and #3 8491 27568 - ora inttemp1 8492 27568 - tax 8493 27568 - lda keyrowselectvalue,x 8494 27568 - sta SWCHA 8495 27568 - rts 8496 27568 - 8497 27568 -keyrowdirectionmask 8498 27568 - .byte #%00000000 ; 0 : port0=input port1=input 8499 27568 - .byte #%11110000 ; 1 : port0=output port1=input 8500 27568 - .byte #%00001111 ; 2 : port0=input port1=output 8501 27568 - .byte #%11111111 ; 3 : port0=output port1=output 8502 27568 - 8503 27568 -keyrowselectvalue 8504 27568 - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 8505 27568 - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 8506 27568 - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 8507 27568 - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 8508 27568 endif ; KEYPADSUPPORT 8509 27568 8510 27568 - ifconst KEYPADSUPPORT 8511 27568 - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 8512 27568 -keypadcolumnread 8513 27568 - lda port0control 8514 27568 - cmp #7 8515 27568 - bne skipkeypadcolumnread0 8516 27568 - lda framecounter 8517 27568 - and #3 8518 27568 - asl ; x2 because keypad variables are interleaved 8519 27568 - tax 8520 27568 - lda #0 8521 27568 - sta keypadmatrix0a,x 8522 27568 - lda INPT0 8523 27568 - cmp #$80 8524 27568 - rol keypadmatrix0a,x 8525 27568 - lda INPT1 8526 27568 - cmp #$80 8527 27568 - rol keypadmatrix0a,x 8528 27568 - lda INPT4 8529 27568 - cmp #$80 8530 27568 - rol keypadmatrix0a,x 8531 27568 - lda keypadmatrix0a,x 8532 27568 - eor #%00000111 8533 27568 - sta keypadmatrix0a,x 8534 27568 -skipkeypadcolumnread0 8535 27568 - 8536 27568 - lda port1control 8537 27568 - cmp #7 8538 27568 - bne skipkeypadcolumnread1 8539 27568 - lda framecounter 8540 27568 - and #3 8541 27568 - asl ; x2 because keypad variables are interleaved 8542 27568 - tax 8543 27568 - lda #0 8544 27568 - sta keypadmatrix1a,x 8545 27568 - rol keypadmatrix1a,x 8546 27568 - lda INPT2 8547 27568 - cmp #$80 8548 27568 - rol keypadmatrix1a,x 8549 27568 - lda INPT3 8550 27568 - cmp #$80 8551 27568 - rol keypadmatrix1a,x 8552 27568 - lda INPT5 8553 27568 - cmp #$80 8554 27568 - rol keypadmatrix1a,x 8555 27568 - lda keypadmatrix1a,x 8556 27568 - eor #%00000111 8557 27568 - sta keypadmatrix1a,x 8558 27568 -skipkeypadcolumnread1 8559 27568 - rts 8560 27568 endif ; KEYPADSUPPORT 8561 27568 8562 27568 setportforinput 8563 27568 a5 e4 lda CTLSWAs 8564 2756a 3d 73 f5 and allpinsinputlut,x 8565 2756d 85 e4 sta CTLSWAs 8566 2756f 8d 81 02 sta CTLSWA 8567 27572 60 rts 8568 27573 8569 27573 allpinsinputlut 8570 27573 0f f0 .byte.b $0F, $F0 8571 27575 8572 27575 setonebuttonmode 8573 27575 a9 06 lda #6 ; in case we're in unlocked-bios mode 8574 27577 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8575 27579 a9 14 lda #$14 8576 2757b 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8577 2757e a5 e5 lda CTLSWBs 8578 27580 1d 89 f5 ora thisjoy2buttonbit,x 8579 27583 85 e5 sta CTLSWBs 8580 27585 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 8581 27588 60 rts 8582 27589 8583 27589 thisjoy2buttonbit 8584 27589 04 10 .byte.b $04, $10 8585 2758b 8586 2758b settwobuttonmode 8587 2758b a9 06 lda #6 ; in case we're in unlocked-bios mode 8588 2758d 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8589 2758f a9 14 lda #$14 8590 27591 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8591 27594 a5 e5 lda CTLSWBs 8592 27596 3d 9f f5 and thisjoy2buttonmask,x 8593 27599 85 e5 sta CTLSWBs 8594 2759b 8d 82 02 sta SWCHB 8595 2759e 60 rts 8596 2759f 8597 2759f thisjoy2buttonmask 8598 2759f fb ef .byte.b $fb, $ef 8599 275a1 8600 275a1 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8601 275a1 8602 275a1 START 8603 275a1 start 8604 275a1 8605 275a1 ;******** more or less the Atari recommended startup procedure 8606 275a1 8607 275a1 78 sei 8608 275a2 d8 cld 8609 275a3 8610 275a3 ifnconst NOTIALOCK 8611 275a3 a9 07 lda #$07 8612 275a5 - else 8613 275a5 - lda #$06 8614 275a5 endif 8615 275a5 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 8616 275a7 a9 7f lda #$7F 8617 275a9 85 3c sta CTRL ;disable DMA 8618 275ab a9 00 lda #$00 8619 275ad 85 38 sta OFFSET 8620 275af ifnconst NOTIALOCK 8621 275af 85 01 sta INPTCTRL 8622 275b1 85 20 sta BACKGRND ; black default, in case a flash cart is using something else 8623 275b3 endif 8624 275b3 a2 ff ldx #$FF 8625 275b5 9a txs 8626 275b6 8627 275b6 ;************** Clear Memory 8628 275b6 8629 275b6 ; ** Clear 1800-27FF, pg0+pg1 memory. 8630 275b6 ClearMemPages 8631 275b6 a9 00 lda #0 8632 275b8 a8 tay ; y=0 8633 275b9 85 80 sta $80 8634 275bb a2 18 ldx #$18 8635 275bd ClearMemPagesLoop 8636 275bd 86 81 stx $81 ; needed for when we step on ZP memory 8637 275bf 91 80 sta ($80),y ;Store data 8638 275c1 c8 iny ;Next byte 8639 275c2 d0 f9 bne ClearMemPagesLoop 8640 275c4 e8 inx 8641 275c5 e0 28 cpx #$28 8642 275c7 d0 f4 bne ClearMemPagesLoop 8643 275c9 85 81 sta $81 8644 275cb 8645 275cb ;seed random number with hopefully-random timer value 8646 275cb a9 01 lda #1 8647 275cd 0d 84 02 ora INTIM 8648 275d0 85 40 sta rand 8649 275d2 8650 275d2 ; detect the console type... 8651 275d2 pndetectvblankstart 8652 275d2 a5 28 lda MSTAT 8653 275d4 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 8654 275d6 pndetectvblankover 8655 275d6 a5 28 lda MSTAT 8656 275d8 30 fc bmi pndetectvblankover ; then wait for it to be over 8657 275da a0 00 ldy #$00 8658 275dc a2 00 ldx #$00 8659 275de pndetectvblankhappening 8660 275de a5 28 lda MSTAT 8661 275e0 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 8662 275e2 85 24 sta WSYNC 8663 275e4 85 24 sta WSYNC 8664 275e6 e8 inx 8665 275e7 d0 f5 bne pndetectvblankhappening 8666 275e9 pndetectinvblank 8667 275e9 e0 7d cpx #125 8668 275eb 90 02 bcc pndetecispal 8669 275ed a0 01 ldy #$01 8670 275ef pndetecispal 8671 275ef 8c 09 21 sty paldetected 8672 275f2 8673 275f2 20 ce f4 jsr createallgamedlls 8674 275f5 8675 275f5 a9 18 lda #>DLLMEM 8676 275f7 85 2c sta DPPH 8677 275f9 a9 00 lda # 255 8862 27624 -DOUBLEBUFFEROFFSET = 255 8863 27624 else 8864 27624 00 4d DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 8865 27624 endif 8866 27624 8867 27624 - ifconst EXTRADLMEMORY 8868 27624 -SECONDDLHALFSTART SET $2300 8869 27624 endif 8870 27624 8871 27624 DLPOINTH 8872 27624 DLINDEX SET 0 8873 27624 REPEAT WZONECOUNT 8874 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27624 - ifconst EXTRADLMEMORY 8876 27624 - if TMPMEMADDRESS > $1FFF 8877 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27624 - else 8879 27624 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27624 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27624 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27624 - endif 8883 27624 - endif ; TMPMEMADDRESS > $1FFF 8884 27624 endif ; EXTRADLMEMORY 8885 27624 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27624 18 .byte.b >TMPMEMADDRESS 8887 27624 DLINDEX SET DLINDEX + 1 8873 27624 REPEND 8874 27624 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27625 - ifconst EXTRADLMEMORY 8876 27625 - if TMPMEMADDRESS > $1FFF 8877 27625 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27625 - else 8879 27625 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27625 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27625 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27625 - endif 8883 27625 - endif ; TMPMEMADDRESS > $1FFF 8884 27625 endif ; EXTRADLMEMORY 8885 27625 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27625 18 .byte.b >TMPMEMADDRESS 8887 27625 DLINDEX SET DLINDEX + 1 8873 27625 REPEND 8874 27625 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27626 - ifconst EXTRADLMEMORY 8876 27626 - if TMPMEMADDRESS > $1FFF 8877 27626 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27626 - else 8879 27626 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27626 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27626 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27626 - endif 8883 27626 - endif ; TMPMEMADDRESS > $1FFF 8884 27626 endif ; EXTRADLMEMORY 8885 27626 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27626 19 .byte.b >TMPMEMADDRESS 8887 27626 DLINDEX SET DLINDEX + 1 8873 27626 REPEND 8874 27626 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27627 - ifconst EXTRADLMEMORY 8876 27627 - if TMPMEMADDRESS > $1FFF 8877 27627 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27627 - else 8879 27627 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27627 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27627 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27627 - endif 8883 27627 - endif ; TMPMEMADDRESS > $1FFF 8884 27627 endif ; EXTRADLMEMORY 8885 27627 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27627 19 .byte.b >TMPMEMADDRESS 8887 27627 DLINDEX SET DLINDEX + 1 8873 27627 REPEND 8874 27627 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27628 - ifconst EXTRADLMEMORY 8876 27628 - if TMPMEMADDRESS > $1FFF 8877 27628 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27628 - else 8879 27628 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27628 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27628 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27628 - endif 8883 27628 - endif ; TMPMEMADDRESS > $1FFF 8884 27628 endif ; EXTRADLMEMORY 8885 27628 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27628 19 .byte.b >TMPMEMADDRESS 8887 27628 DLINDEX SET DLINDEX + 1 8873 27628 REPEND 8874 27628 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27629 - ifconst EXTRADLMEMORY 8876 27629 - if TMPMEMADDRESS > $1FFF 8877 27629 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27629 - else 8879 27629 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27629 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27629 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27629 - endif 8883 27629 - endif ; TMPMEMADDRESS > $1FFF 8884 27629 endif ; EXTRADLMEMORY 8885 27629 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27629 1a .byte.b >TMPMEMADDRESS 8887 27629 DLINDEX SET DLINDEX + 1 8873 27629 REPEND 8874 27629 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 2762a - ifconst EXTRADLMEMORY 8876 2762a - if TMPMEMADDRESS > $1FFF 8877 2762a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 2762a - else 8879 2762a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 2762a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 2762a -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 2762a - endif 8883 2762a - endif ; TMPMEMADDRESS > $1FFF 8884 2762a endif ; EXTRADLMEMORY 8885 2762a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 2762a 1a .byte.b >TMPMEMADDRESS 8887 2762a DLINDEX SET DLINDEX + 1 8873 2762a REPEND 8874 2762a TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 2762b - ifconst EXTRADLMEMORY 8876 2762b - if TMPMEMADDRESS > $1FFF 8877 2762b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 2762b - else 8879 2762b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 2762b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 2762b -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 2762b - endif 8883 2762b - endif ; TMPMEMADDRESS > $1FFF 8884 2762b endif ; EXTRADLMEMORY 8885 2762b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 2762b 1a .byte.b >TMPMEMADDRESS 8887 2762b DLINDEX SET DLINDEX + 1 8873 2762b REPEND 8874 2762b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 2762c - ifconst EXTRADLMEMORY 8876 2762c - if TMPMEMADDRESS > $1FFF 8877 2762c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 2762c - else 8879 2762c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 2762c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 2762c -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 2762c - endif 8883 2762c - endif ; TMPMEMADDRESS > $1FFF 8884 2762c endif ; EXTRADLMEMORY 8885 2762c ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 2762c 1b .byte.b >TMPMEMADDRESS 8887 2762c DLINDEX SET DLINDEX + 1 8873 2762c REPEND 8874 2762c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 2762d - ifconst EXTRADLMEMORY 8876 2762d - if TMPMEMADDRESS > $1FFF 8877 2762d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 2762d - else 8879 2762d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 2762d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 2762d -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 2762d - endif 8883 2762d - endif ; TMPMEMADDRESS > $1FFF 8884 2762d endif ; EXTRADLMEMORY 8885 2762d ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 2762d 1b .byte.b >TMPMEMADDRESS 8887 2762d DLINDEX SET DLINDEX + 1 8873 2762d REPEND 8874 2762d TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 2762e - ifconst EXTRADLMEMORY 8876 2762e - if TMPMEMADDRESS > $1FFF 8877 2762e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 2762e - else 8879 2762e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 2762e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 2762e -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 2762e - endif 8883 2762e - endif ; TMPMEMADDRESS > $1FFF 8884 2762e endif ; EXTRADLMEMORY 8885 2762e ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 2762e 1b .byte.b >TMPMEMADDRESS 8887 2762e DLINDEX SET DLINDEX + 1 8873 2762e REPEND 8874 2762e TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 2762f - ifconst EXTRADLMEMORY 8876 2762f - if TMPMEMADDRESS > $1FFF 8877 2762f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 2762f - else 8879 2762f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 2762f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 2762f -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 2762f - endif 8883 2762f - endif ; TMPMEMADDRESS > $1FFF 8884 2762f endif ; EXTRADLMEMORY 8885 2762f ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 2762f 1b .byte.b >TMPMEMADDRESS 8887 2762f DLINDEX SET DLINDEX + 1 8873 2762f REPEND 8874 2762f TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27630 - ifconst EXTRADLMEMORY 8876 27630 - if TMPMEMADDRESS > $1FFF 8877 27630 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27630 - else 8879 27630 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27630 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27630 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27630 - endif 8883 27630 - endif ; TMPMEMADDRESS > $1FFF 8884 27630 endif ; EXTRADLMEMORY 8885 27630 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27630 1c .byte.b >TMPMEMADDRESS 8887 27630 DLINDEX SET DLINDEX + 1 8873 27630 REPEND 8874 27630 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27631 - ifconst EXTRADLMEMORY 8876 27631 - if TMPMEMADDRESS > $1FFF 8877 27631 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27631 - else 8879 27631 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27631 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27631 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27631 - endif 8883 27631 - endif ; TMPMEMADDRESS > $1FFF 8884 27631 endif ; EXTRADLMEMORY 8885 27631 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27631 1c .byte.b >TMPMEMADDRESS 8887 27631 DLINDEX SET DLINDEX + 1 8873 27631 REPEND 8874 27631 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27632 - ifconst EXTRADLMEMORY 8876 27632 - if TMPMEMADDRESS > $1FFF 8877 27632 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27632 - else 8879 27632 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27632 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27632 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27632 - endif 8883 27632 - endif ; TMPMEMADDRESS > $1FFF 8884 27632 endif ; EXTRADLMEMORY 8885 27632 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27632 1c .byte.b >TMPMEMADDRESS 8887 27632 DLINDEX SET DLINDEX + 1 8873 27632 REPEND 8874 27632 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27633 - ifconst EXTRADLMEMORY 8876 27633 - if TMPMEMADDRESS > $1FFF 8877 27633 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27633 - else 8879 27633 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27633 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27633 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27633 - endif 8883 27633 - endif ; TMPMEMADDRESS > $1FFF 8884 27633 endif ; EXTRADLMEMORY 8885 27633 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27633 1d .byte.b >TMPMEMADDRESS 8887 27633 DLINDEX SET DLINDEX + 1 8873 27633 REPEND 8874 27633 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27634 - ifconst EXTRADLMEMORY 8876 27634 - if TMPMEMADDRESS > $1FFF 8877 27634 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27634 - else 8879 27634 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27634 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27634 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27634 - endif 8883 27634 - endif ; TMPMEMADDRESS > $1FFF 8884 27634 endif ; EXTRADLMEMORY 8885 27634 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27634 1d .byte.b >TMPMEMADDRESS 8887 27634 DLINDEX SET DLINDEX + 1 8873 27634 REPEND 8874 27634 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27635 - ifconst EXTRADLMEMORY 8876 27635 - if TMPMEMADDRESS > $1FFF 8877 27635 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27635 - else 8879 27635 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27635 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27635 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27635 - endif 8883 27635 - endif ; TMPMEMADDRESS > $1FFF 8884 27635 endif ; EXTRADLMEMORY 8885 27635 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27635 1d .byte.b >TMPMEMADDRESS 8887 27635 DLINDEX SET DLINDEX + 1 8873 27635 REPEND 8874 27635 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27636 - ifconst EXTRADLMEMORY 8876 27636 - if TMPMEMADDRESS > $1FFF 8877 27636 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27636 - else 8879 27636 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27636 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27636 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27636 - endif 8883 27636 - endif ; TMPMEMADDRESS > $1FFF 8884 27636 endif ; EXTRADLMEMORY 8885 27636 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27636 1e .byte.b >TMPMEMADDRESS 8887 27636 DLINDEX SET DLINDEX + 1 8873 27636 REPEND 8874 27636 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27637 - ifconst EXTRADLMEMORY 8876 27637 - if TMPMEMADDRESS > $1FFF 8877 27637 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27637 - else 8879 27637 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27637 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27637 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27637 - endif 8883 27637 - endif ; TMPMEMADDRESS > $1FFF 8884 27637 endif ; EXTRADLMEMORY 8885 27637 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27637 1e .byte.b >TMPMEMADDRESS 8887 27637 DLINDEX SET DLINDEX + 1 8873 27637 REPEND 8874 27637 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27638 - ifconst EXTRADLMEMORY 8876 27638 - if TMPMEMADDRESS > $1FFF 8877 27638 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27638 - else 8879 27638 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27638 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27638 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27638 - endif 8883 27638 - endif ; TMPMEMADDRESS > $1FFF 8884 27638 endif ; EXTRADLMEMORY 8885 27638 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27638 1e .byte.b >TMPMEMADDRESS 8887 27638 DLINDEX SET DLINDEX + 1 8873 27638 REPEND 8874 27638 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 27639 - ifconst EXTRADLMEMORY 8876 27639 - if TMPMEMADDRESS > $1FFF 8877 27639 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 27639 - else 8879 27639 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 27639 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 27639 -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 27639 - endif 8883 27639 - endif ; TMPMEMADDRESS > $1FFF 8884 27639 endif ; EXTRADLMEMORY 8885 27639 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 27639 1f .byte.b >TMPMEMADDRESS 8887 27639 DLINDEX SET DLINDEX + 1 8873 27639 REPEND 8874 27639 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 2763a - ifconst EXTRADLMEMORY 8876 2763a - if TMPMEMADDRESS > $1FFF 8877 2763a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 2763a - else 8879 2763a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 2763a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 2763a -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 2763a - endif 8883 2763a - endif ; TMPMEMADDRESS > $1FFF 8884 2763a endif ; EXTRADLMEMORY 8885 2763a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 2763a 1f .byte.b >TMPMEMADDRESS 8887 2763a DLINDEX SET DLINDEX + 1 8873 2763a REPEND 8874 2763a TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8875 2763b - ifconst EXTRADLMEMORY 8876 2763b - if TMPMEMADDRESS > $1FFF 8877 2763b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8878 2763b - else 8879 2763b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8880 2763b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8881 2763b -SECONDDLHALFSTART SET TMPMEMADDRESS 8882 2763b - endif 8883 2763b - endif ; TMPMEMADDRESS > $1FFF 8884 2763b endif ; EXTRADLMEMORY 8885 2763b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8886 2763b 1f .byte.b >TMPMEMADDRESS 8887 2763b DLINDEX SET DLINDEX + 1 8888 2763c REPEND 8889 2763c 8890 2763c - ifconst EXTRADLMEMORY 8891 2763c - echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 8892 2763c endif 8893 2763c 8894 2763c 8895 2763c DLPOINTL 8896 2763c DLINDEX SET 0 8897 2763c REPEAT WZONECOUNT 8898 2763c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8899 2763c - ifconst EXTRADLMEMORY 8900 2763c - if TMPMEMADDRESS > $1FFF 8901 2763c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 2763c - else 8903 2763c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 2763c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 2763c - endif 8906 2763c - endif ; TMPMEMADDRESS > $1FFF 8907 2763c endif ; EXTRADLMEMORY 8908 2763c 80 .byte.b $1FFF 8901 2763d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 2763d - else 8903 2763d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 2763d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 2763d - endif 8906 2763d - endif ; TMPMEMADDRESS > $1FFF 8907 2763d endif ; EXTRADLMEMORY 8908 2763d d0 .byte.b $1FFF 8901 2763e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 2763e - else 8903 2763e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 2763e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 2763e - endif 8906 2763e - endif ; TMPMEMADDRESS > $1FFF 8907 2763e endif ; EXTRADLMEMORY 8908 2763e 20 .byte.b $1FFF 8901 2763f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 2763f - else 8903 2763f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 2763f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 2763f - endif 8906 2763f - endif ; TMPMEMADDRESS > $1FFF 8907 2763f endif ; EXTRADLMEMORY 8908 2763f 70 .byte.b $1FFF 8901 27640 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27640 - else 8903 27640 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27640 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27640 - endif 8906 27640 - endif ; TMPMEMADDRESS > $1FFF 8907 27640 endif ; EXTRADLMEMORY 8908 27640 c0 .byte.b $1FFF 8901 27641 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27641 - else 8903 27641 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27641 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27641 - endif 8906 27641 - endif ; TMPMEMADDRESS > $1FFF 8907 27641 endif ; EXTRADLMEMORY 8908 27641 10 .byte.b $1FFF 8901 27642 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27642 - else 8903 27642 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27642 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27642 - endif 8906 27642 - endif ; TMPMEMADDRESS > $1FFF 8907 27642 endif ; EXTRADLMEMORY 8908 27642 60 .byte.b $1FFF 8901 27643 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27643 - else 8903 27643 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27643 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27643 - endif 8906 27643 - endif ; TMPMEMADDRESS > $1FFF 8907 27643 endif ; EXTRADLMEMORY 8908 27643 b0 .byte.b $1FFF 8901 27644 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27644 - else 8903 27644 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27644 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27644 - endif 8906 27644 - endif ; TMPMEMADDRESS > $1FFF 8907 27644 endif ; EXTRADLMEMORY 8908 27644 00 .byte.b $1FFF 8901 27645 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27645 - else 8903 27645 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27645 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27645 - endif 8906 27645 - endif ; TMPMEMADDRESS > $1FFF 8907 27645 endif ; EXTRADLMEMORY 8908 27645 50 .byte.b $1FFF 8901 27646 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27646 - else 8903 27646 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27646 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27646 - endif 8906 27646 - endif ; TMPMEMADDRESS > $1FFF 8907 27646 endif ; EXTRADLMEMORY 8908 27646 a0 .byte.b $1FFF 8901 27647 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27647 - else 8903 27647 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27647 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27647 - endif 8906 27647 - endif ; TMPMEMADDRESS > $1FFF 8907 27647 endif ; EXTRADLMEMORY 8908 27647 f0 .byte.b $1FFF 8901 27648 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27648 - else 8903 27648 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27648 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27648 - endif 8906 27648 - endif ; TMPMEMADDRESS > $1FFF 8907 27648 endif ; EXTRADLMEMORY 8908 27648 40 .byte.b $1FFF 8901 27649 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27649 - else 8903 27649 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27649 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27649 - endif 8906 27649 - endif ; TMPMEMADDRESS > $1FFF 8907 27649 endif ; EXTRADLMEMORY 8908 27649 90 .byte.b $1FFF 8901 2764a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 2764a - else 8903 2764a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 2764a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 2764a - endif 8906 2764a - endif ; TMPMEMADDRESS > $1FFF 8907 2764a endif ; EXTRADLMEMORY 8908 2764a e0 .byte.b $1FFF 8901 2764b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 2764b - else 8903 2764b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 2764b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 2764b - endif 8906 2764b - endif ; TMPMEMADDRESS > $1FFF 8907 2764b endif ; EXTRADLMEMORY 8908 2764b 30 .byte.b $1FFF 8901 2764c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 2764c - else 8903 2764c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 2764c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 2764c - endif 8906 2764c - endif ; TMPMEMADDRESS > $1FFF 8907 2764c endif ; EXTRADLMEMORY 8908 2764c 80 .byte.b $1FFF 8901 2764d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 2764d - else 8903 2764d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 2764d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 2764d - endif 8906 2764d - endif ; TMPMEMADDRESS > $1FFF 8907 2764d endif ; EXTRADLMEMORY 8908 2764d d0 .byte.b $1FFF 8901 2764e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 2764e - else 8903 2764e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 2764e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 2764e - endif 8906 2764e - endif ; TMPMEMADDRESS > $1FFF 8907 2764e endif ; EXTRADLMEMORY 8908 2764e 20 .byte.b $1FFF 8901 2764f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 2764f - else 8903 2764f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 2764f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 2764f - endif 8906 2764f - endif ; TMPMEMADDRESS > $1FFF 8907 2764f endif ; EXTRADLMEMORY 8908 2764f 70 .byte.b $1FFF 8901 27650 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27650 - else 8903 27650 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27650 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27650 - endif 8906 27650 - endif ; TMPMEMADDRESS > $1FFF 8907 27650 endif ; EXTRADLMEMORY 8908 27650 c0 .byte.b $1FFF 8901 27651 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27651 - else 8903 27651 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27651 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27651 - endif 8906 27651 - endif ; TMPMEMADDRESS > $1FFF 8907 27651 endif ; EXTRADLMEMORY 8908 27651 10 .byte.b $1FFF 8901 27652 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27652 - else 8903 27652 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27652 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27652 - endif 8906 27652 - endif ; TMPMEMADDRESS > $1FFF 8907 27652 endif ; EXTRADLMEMORY 8908 27652 60 .byte.b $1FFF 8901 27653 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8902 27653 - else 8903 27653 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8904 27653 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8905 27653 - endif 8906 27653 - endif ; TMPMEMADDRESS > $1FFF 8907 27653 endif ; EXTRADLMEMORY 8908 27653 b0 .byte.b $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 18 80 ZONE0ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 18 d0 ZONE1ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 19 20 ZONE2ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 19 70 ZONE3ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 19 c0 ZONE4ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1a 10 ZONE5ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1a 60 ZONE6ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1a b0 ZONE7ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1b 00 ZONE8ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1b 50 ZONE9ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1b a0 ZONE10ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1b f0 ZONE11ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1c 40 ZONE12ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1c 90 ZONE13ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1c e0 ZONE14ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1d 30 ZONE15ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1d 80 ZONE16ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1d d0 ZONE17ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1e 20 ZONE18ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1e 70 ZONE19ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1e c0 ZONE20ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1f 10 ZONE21ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1f 60 ZONE22ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8914 27654 REPEND 8915 27654 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8916 27654 - ifconst EXTRADLMEMORY 8917 27654 - if TMPMEMADDRESS > $1FFF 8918 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8919 27654 - else 8920 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8921 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8922 27654 - endif 8923 27654 - endif ; TMPMEMADDRESS > $1FFF 8924 27654 endif ; EXTRADLMEMORY 8925 27654 8926 27654 1f b0 ZONE23ADDRESS = TMPMEMADDRESS 8927 27654 8928 27654 DLINDEX SET DLINDEX + 1 8929 27654 REPEND 8930 27654 8931 27654 $1880 to $1fff used as zone memory, allowing 15 display objects per zone. 8932 27654 echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 8933 27654 8934 27654 DLHEIGHT 8935 27654 REPEAT WZONECOUNT 8936 27654 07 .byte.b (WZONEHEIGHT-1) 8935 27654 REPEND 8936 27655 07 .byte.b (WZONEHEIGHT-1) 8935 27655 REPEND 8936 27656 07 .byte.b (WZONEHEIGHT-1) 8935 27656 REPEND 8936 27657 07 .byte.b (WZONEHEIGHT-1) 8935 27657 REPEND 8936 27658 07 .byte.b (WZONEHEIGHT-1) 8935 27658 REPEND 8936 27659 07 .byte.b (WZONEHEIGHT-1) 8935 27659 REPEND 8936 2765a 07 .byte.b (WZONEHEIGHT-1) 8935 2765a REPEND 8936 2765b 07 .byte.b (WZONEHEIGHT-1) 8935 2765b REPEND 8936 2765c 07 .byte.b (WZONEHEIGHT-1) 8935 2765c REPEND 8936 2765d 07 .byte.b (WZONEHEIGHT-1) 8935 2765d REPEND 8936 2765e 07 .byte.b (WZONEHEIGHT-1) 8935 2765e REPEND 8936 2765f 07 .byte.b (WZONEHEIGHT-1) 8935 2765f REPEND 8936 27660 07 .byte.b (WZONEHEIGHT-1) 8935 27660 REPEND 8936 27661 07 .byte.b (WZONEHEIGHT-1) 8935 27661 REPEND 8936 27662 07 .byte.b (WZONEHEIGHT-1) 8935 27662 REPEND 8936 27663 07 .byte.b (WZONEHEIGHT-1) 8935 27663 REPEND 8936 27664 07 .byte.b (WZONEHEIGHT-1) 8935 27664 REPEND 8936 27665 07 .byte.b (WZONEHEIGHT-1) 8935 27665 REPEND 8936 27666 07 .byte.b (WZONEHEIGHT-1) 8935 27666 REPEND 8936 27667 07 .byte.b (WZONEHEIGHT-1) 8935 27667 REPEND 8936 27668 07 .byte.b (WZONEHEIGHT-1) 8935 27668 REPEND 8936 27669 07 .byte.b (WZONEHEIGHT-1) 8935 27669 REPEND 8936 2766a 07 .byte.b (WZONEHEIGHT-1) 8935 2766a REPEND 8936 2766b 07 .byte.b (WZONEHEIGHT-1) 8937 2766c REPEND 8938 2766c 8939 2766c ; Provided under the CC0 license. See the included LICENSE.txt for details. 8940 2766c 8941 2766c ; a simple guard, than ensures the 7800basic code hasn't 8942 2766c ; spilled into the encryption area... 2322 bytes left in the 7800basic reserved area. 8943 2766c echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 8944 2766c - if (*>$FF7D) 8945 2766c - ERR ; abort the assembly 8946 2766c endif 8947 2766c ; Provided under the CC0 license. See the included LICENSE.txt for details. 8948 2766c 8949 2766c - ifconst DEV 8950 2766c - ifnconst ZONEHEIGHT 8951 2766c - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8952 2766c - else 8953 2766c - if ZONEHEIGHT = 8 8954 2766c - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8955 2766c - else 8956 2766c - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8957 2766c - endif 8958 2766c - endif 8959 2766c endif 8960 2766c 8961 2766c ; FF7E/FF7F contains the 7800basic crc checksum word 8962 2766c 8963 2766c ; FF80 - FFF7 contains the 7800 encryption key 8964 2766c 8965 2766c - ifnconst bankswitchmode 8966 2766c - ORG $FFF8 8967 2766c else 8968 2766c ifconst ROM128K 8969 27ff8 ORG $27FF8 8970 27ff8 RORG $FFF8 8971 27ff8 endif 8972 27ff8 - ifconst ROM144K 8973 27ff8 - ORG $27FF8 8974 27ff8 - RORG $FFF8 8975 27ff8 endif 8976 27ff8 - ifconst ROM256K 8977 27ff8 - ORG $47FF8 8978 27ff8 - RORG $FFF8 8979 27ff8 endif 8980 27ff8 - ifconst ROM272K 8981 27ff8 - ORG $47FF8 8982 27ff8 - RORG $FFF8 8983 27ff8 endif 8984 27ff8 - ifconst ROM512K 8985 27ff8 - ORG $87FF8 8986 27ff8 - RORG $FFF8 8987 27ff8 endif 8988 27ff8 - ifconst ROM528K 8989 27ff8 - ORG $87FF8 8990 27ff8 - RORG $FFF8 8991 27ff8 endif 8992 27ff8 endif 8993 27ff8 8994 27ff8 8995 27ff8 ff .byte.b $FF ; region verification. $FF=all regions 8996 27ff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 8997 27ffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 8998 27ffa 8999 27ffa ;Vectors 9000 27ffa 00 f0 .word.w NMI 9001 27ffc a1 f5 .word.w START 9002 27ffe 5f f0 .word.w IRQ 9003 28000