------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite5.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 ???? MAC median3 172 28000 ???? 173 28000 ???? ; A median filter (for smoothing paddle jitter) 174 28000 ???? ; this macro takes the current paddle value, compares it to historic 175 28000 ???? ; values, and replaces the current paddle value with the median. 176 28000 ???? ; 177 28000 ???? ; called as: MEDIAN3 STORAGE CURRENT 178 28000 ???? ; where STORAGE points to 3 consecutive bytes of memory. The first 2 179 28000 ???? ; must be dedicated to this MEDIAN filter. The last 1 is a temp. 180 28000 ???? ; where CURRENT is memory holding the new value you wish to compare to 181 28000 ???? ; the previous values, and update with the median value. 182 28000 ???? ; 183 28000 ???? ; returns: CURRENT (modified to contain median value) 184 28000 ???? ; 185 28000 ???? ; author: Mike Saarna (aka RevEng) 186 28000 ???? 187 28000 ???? .MedianBytes SET {1} 188 28000 ???? .NewValue SET {2} 189 28000 ???? 190 28000 ???? lda #0 191 28000 ???? ldy .NewValue 192 28000 ???? sty .MedianBytes+2 ; put the new value in the most "recent" slot 193 28000 ???? 194 28000 ???? ; build an index from relative size comparisons between our 3 values. 195 28000 ???? cpy .MedianBytes 196 28000 ???? rol 197 28000 ???? cpy .MedianBytes+1 198 28000 ???? rol 199 28000 ???? ldy .MedianBytes 200 28000 ???? cpy .MedianBytes+1 201 28000 ???? rol 202 28000 ???? tay 203 28000 ???? 204 28000 ???? ldx MedianOrderLUT,y ; convert the size-comparison index to an index to the median value 205 28000 ???? lda .MedianBytes,x 206 28000 ???? sta .NewValue ; we replace the new value memory with the median value 207 28000 ???? 208 28000 ???? ; then shift values from "newer" bytes to "older" bytes, leaving the 209 28000 ???? ; newest byte (.MedianBytes+2) empty for next time. 210 28000 ???? lda .MedianBytes+1 211 28000 ???? sta .MedianBytes 212 28000 ???? lda .MedianBytes+2 213 28000 ???? sta .MedianBytes+1 214 28000 ???? ifnconst MedianOrderLUT 215 28000 ???? jmp MedianOrderLUTend 216 28000 ???? MedianOrderLUT ; converts our "comparison index" to an index to the median value 217 28000 ???? .byte 0 ; 0 B2 < B0 < B1 218 28000 ???? .byte 1 ; 1 B2 < B1 < B0 219 28000 ???? .byte 2 ; 2 impossible 220 28000 ???? .byte 2 ; 3 B1 < B2 < B0 221 28000 ???? .byte 2 ; 4 B0 < B2 < B1 222 28000 ???? .byte 2 ; 5 impossible 223 28000 ???? .byte 1 ; 6 B0 < B1 < B2 224 28000 ???? .byte 0 ; 7 B1 < B0 < B2 225 28000 ???? MedianOrderLUTend 226 28000 ???? endif 227 28000 ???? ENDM 228 28000 ???? 229 28000 ???? MAC plotsprite 230 28000 ???? 231 28000 ???? ; A macro version of the plotsprite command. 232 28000 ???? ; This trades off rom space for speed. 233 28000 ???? ; It also doesn't check if the visible screen is displayed or not. 234 28000 ???? ; It has no training wheels. It is all rusty sharp edges. 235 28000 ???? 236 28000 ???? .GFXLabel SET {1} 237 28000 ???? .Palette SET {2} ; constant 238 28000 ???? .SpriteX SET {3} ; variable 239 28000 ???? .SpriteY SET {4} ; variable 240 28000 ???? .ByteOffset SET {5} ; variable 241 28000 ???? 242 28000 ???? lda .SpriteY 243 28000 ???? lsr 244 28000 ???? lsr 245 28000 ???? asr #%11111110 ; ensure carry is clear 246 28000 ???? if WZONEHEIGHT = 16 247 28000 ???? asr #%11111110 ; ensure carry is clear 248 28000 ???? endif 249 28000 ???? 250 28000 ???? tax 251 28000 ???? 252 28000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 253 28000 ???? sta dlpnt 254 28000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 255 28000 ???? sta dlpnt+1 256 28000 ???? 257 28000 ???? ldy dlend,x ; find the next new object position in this zone 258 28000 ???? 259 28000 ???? lda .ByteOffset 260 28000 ???? if {1}_width = 2 261 28000 ???? asl 262 28000 ???? endif 263 28000 ???? if {1}_width = 3 264 28000 ???? asl 265 28000 ???? adc .ByteOffset 266 28000 ???? endif 267 28000 ???? if {1}_width = 4 268 28000 ???? asl 269 28000 ???? asl 270 28000 ???? endif 271 28000 ???? if {1}_width = 5 272 28000 ???? asl 273 28000 ???? asl 274 28000 ???? adc .ByteOffset 275 28000 ???? endif 276 28000 ???? if {1}_width = 6 277 28000 ???? asl 278 28000 ???? adc .ByteOffset 279 28000 ???? asl 280 28000 ???? endif 281 28000 ???? if {1}_width = 7 282 28000 ???? asl 283 28000 ???? adc .ByteOffset 284 28000 ???? asl 285 28000 ???? adc .ByteOffset 286 28000 ???? endif 287 28000 ???? if {1}_width = 8 288 28000 ???? asl 289 28000 ???? asl 290 28000 ???? asl 291 28000 ???? endif 292 28000 ???? if {1}_width = 9 293 28000 ???? asl 294 28000 ???? asl 295 28000 ???? asl 296 28000 ???? adc .ByteOffset 297 28000 ???? endif 298 28000 ???? if {1}_width = 10 299 28000 ???? asl 300 28000 ???? asl 301 28000 ???? adc .ByteOffset 302 28000 ???? asl 303 28000 ???? endif 304 28000 ???? if {1}_width = 11 305 28000 ???? asl 306 28000 ???? asl 307 28000 ???? adc .ByteOffset 308 28000 ???? asl 309 28000 ???? adc .ByteOffset 310 28000 ???? endif 311 28000 ???? if {1}_width = 12 312 28000 ???? asl 313 28000 ???? adc .ByteOffset 314 28000 ???? asl 315 28000 ???? asl 316 28000 ???? endif 317 28000 ???? if {1}_width = 13 318 28000 ???? asl 319 28000 ???? adc .ByteOffset 320 28000 ???? asl 321 28000 ???? asl 322 28000 ???? adc .ByteOffset 323 28000 ???? endif 324 28000 ???? if {1}_width = 14 325 28000 ???? asl 326 28000 ???? adc .ByteOffset 327 28000 ???? asl 328 28000 ???? adc .ByteOffset 329 28000 ???? asl 330 28000 ???? endif 331 28000 ???? 332 28000 ???? adc #<.GFXLabel ; carry is clear via previous asl or asr 333 28000 ???? sta (dlpnt),y ; #1 - low byte object address 334 28000 ???? 335 28000 ???? iny 336 28000 ???? 337 28000 ???? lda #({1}_mode | %01000000) 338 28000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 339 28000 ???? 340 28000 ???? iny 341 28000 ???? 342 28000 ???? lda .SpriteY 343 28000 ???? and #(WZONEHEIGHT - 1) 344 28000 ???? cmp #1 ; clear carry if our sprite is just in this zone 345 28000 ???? ora #>.GFXLabel 346 28000 ???? sta (dlpnt),y ; #3 - hi byte object address 347 28000 ???? 348 28000 ???? iny 349 28000 ???? 350 28000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 351 28000 ???? sta (dlpnt),y ; #4 - palette|width 352 28000 ???? 353 28000 ???? iny 354 28000 ???? 355 28000 ???? lda .SpriteX 356 28000 ???? sta (dlpnt),y ; #5 - x object position 357 28000 ???? 358 28000 ???? iny 359 28000 ???? sty dlend,x 360 28000 ???? 361 28000 ???? ifconst ALWAYSTERMINATE 362 28000 ???? iny 363 28000 ???? lda #0 364 28000 ???? sta (dlpnt),y 365 28000 ???? endif 366 28000 ???? 367 28000 ???? bcc .PLOTSPRITEend 368 28000 ???? 369 28000 ???? inx ; next zone 370 28000 ???? 371 28000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 372 28000 ???? sta dlpnt 373 28000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 374 28000 ???? sta dlpnt+1 375 28000 ???? 376 28000 ???? ldy dlend,x ; find the next new object position in this zone 377 28000 ???? 378 28000 ???? lda .ByteOffset 379 28000 ???? if {1}_width = 1 380 28000 ???? clc 381 28000 ???? endif 382 28000 ???? if {1}_width = 2 383 28000 ???? asl ; carry clear 384 28000 ???? endif 385 28000 ???? if {1}_width = 3 386 28000 ???? asl ; carry clear 387 28000 ???? adc .ByteOffset 388 28000 ???? endif 389 28000 ???? if {1}_width = 4 390 28000 ???? asl ; carry clear 391 28000 ???? asl 392 28000 ???? endif 393 28000 ???? if {1}_width = 5 394 28000 ???? asl ; carry clear 395 28000 ???? asl 396 28000 ???? adc .ByteOffset 397 28000 ???? endif 398 28000 ???? if {1}_width = 6 399 28000 ???? asl ; carry clear 400 28000 ???? adc .ByteOffset 401 28000 ???? asl 402 28000 ???? endif 403 28000 ???? if {1}_width = 7 404 28000 ???? asl ; carry clear 405 28000 ???? adc .ByteOffset 406 28000 ???? asl 407 28000 ???? endif 408 28000 ???? if {1}_width = 8 409 28000 ???? asl ; carry clear 410 28000 ???? asl 411 28000 ???? asl 412 28000 ???? endif 413 28000 ???? if {1}_width = 9 414 28000 ???? asl ; carry clear 415 28000 ???? asl 416 28000 ???? asl 417 28000 ???? adc .ByteOffset 418 28000 ???? endif 419 28000 ???? if {1}_width = 10 420 28000 ???? asl ; carry clear 421 28000 ???? asl 422 28000 ???? adc .ByteOffset 423 28000 ???? asl 424 28000 ???? endif 425 28000 ???? if {1}_width = 11 426 28000 ???? asl ; carry clear 427 28000 ???? asl 428 28000 ???? adc .ByteOffset 429 28000 ???? asl 430 28000 ???? adc .ByteOffset 431 28000 ???? endif 432 28000 ???? if {1}_width = 12 433 28000 ???? asl ; carry clear 434 28000 ???? adc .ByteOffset 435 28000 ???? asl 436 28000 ???? asl 437 28000 ???? endif 438 28000 ???? if {1}_width = 13 439 28000 ???? asl ; carry clear 440 28000 ???? adc .ByteOffset 441 28000 ???? asl 442 28000 ???? asl 443 28000 ???? adc .ByteOffset 444 28000 ???? endif 445 28000 ???? if {1}_width = 14 446 28000 ???? asl ; carry clear 447 28000 ???? adc .ByteOffset 448 28000 ???? asl 449 28000 ???? adc .ByteOffset 450 28000 ???? asl 451 28000 ???? endif 452 28000 ???? 453 28000 ???? adc #<.GFXLabel 454 28000 ???? sta (dlpnt),y ; #1 - low byte object address 455 28000 ???? 456 28000 ???? iny 457 28000 ???? 458 28000 ???? lda #({1}_mode | %01000000) 459 28000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 460 28000 ???? 461 28000 ???? iny 462 28000 ???? 463 28000 ???? lda .SpriteY 464 28000 ???? and #(WZONEHEIGHT - 1) 465 28000 ???? ora #>(.GFXLabel - (WZONEHEIGHT * 256)) ; start in the dma hole 466 28000 ???? sta (dlpnt),y ; #3 - hi byte object address 467 28000 ???? 468 28000 ???? iny 469 28000 ???? 470 28000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 471 28000 ???? sta (dlpnt),y ; #4 - palette|width 472 28000 ???? 473 28000 ???? iny 474 28000 ???? 475 28000 ???? lda .SpriteX 476 28000 ???? sta (dlpnt),y ; #5 - x object position 477 28000 ???? 478 28000 ???? iny 479 28000 ???? sty dlend,x 480 28000 ???? 481 28000 ???? ifconst ALWAYSTERMINATE 482 28000 ???? iny 483 28000 ???? lda #0 484 28000 ???? sta (dlpnt),y 485 28000 ???? endif 486 28000 ???? 487 28000 ???? .PLOTSPRITEend 488 28000 ???? ENDM 489 28000 ???? 490 28000 ???? MAC sizeof 491 28000 ???? 492 28000 ???? ; echo's the size difference between the current address and the 493 28000 ???? ; a label that was passed as an argument. This is a quick way to 494 28000 ???? ; determine the size of a structure. 495 28000 ???? 496 28000 ???? .NAME SETSTR {1} 497 28000 ???? echo " The Size of",.NAME,"is:",[* - {1}]d,[* - {2}]d,"bytes." 498 28000 ???? ENDM 499 28000 ???? 500 28000 ???? ; 501 28000 ???? ; speakjet.inc 502 28000 ???? ; 503 28000 ???? ; 504 28000 ???? ; AtariVox Speech Synth Driver 505 28000 ???? ; 506 28000 ???? ; By Alex Herbert, 2004 507 28000 ???? ; 508 28000 ???? 509 28000 ???? 510 28000 ???? 511 28000 ???? 512 28000 ???? ; Constants 513 28000 ???? 514 28000 ???? 515 28000 ???? 00 01 SERIAL_OUTMASK equ $01 516 28000 ???? 00 02 SERIAL_RDYMASK equ $02 517 28000 ???? 518 28000 ???? 519 28000 ???? 520 28000 ???? ; Macros 521 28000 ???? 522 28000 ???? mac spkout 523 28000 ???? 524 28000 ???? ; check buffer-full status 525 28000 ???? lda SWCHA 526 28000 ???? and #SERIAL_RDYMASK 527 28000 ???? beq .speech_done 528 28000 ???? 529 28000 ???? ; get next speech byte 530 28000 ???? ldy #$00 531 28000 ???? lda (speech_addr),y 532 28000 ???? 533 28000 ???? ; invert data and check for end of string 534 28000 ???? eor #$ff 535 28000 ???? ;sta BACKGRND ; debug - uncomment to flash the background color with vox data 536 28000 ???? beq .speech_done 537 28000 ???? sta {1} 538 28000 ???? 539 28000 ???? ; increment speech pointer 540 28000 ???? inc speech_addr 541 28000 ???? bne .incaddr_skip 542 28000 ???? inc speech_addr+1 543 28000 ???? .incaddr_skip 544 28000 ???? 545 28000 ???? ; output byte as serial data 546 28000 ???? 547 28000 ???? sec ; start bit 548 28000 ???? .byteout_loop 549 28000 ???? ; put carry flag into bit 0 of SWACNT, perserving other bits 550 28000 ???? lda SWACNT ; 4 551 28000 ???? and #$fe ; 2 6 552 28000 ???? adc #$00 ; 2 8 553 28000 ???? sta SWACNT ; 4 12 554 28000 ???? 555 28000 ???? ; 10 bits sent? (1 start bit, 8 data bits, 1 stop bit) 556 28000 ???? cpy #$09 ; 2 14 557 28000 ???? beq .speech_done ; 2 16 558 28000 ???? iny ; 2 18 559 28000 ???? 560 28000 ???? ; the 7800 is 1.5x faster than the 2600. Waste more cycles here 561 28000 ???? ; to match the original baud rate... 562 28000 ???? ;ldx #$07 ; 2600 563 28000 ???? ldx #$0D 564 28000 ???? 565 28000 ???? .delay_loop 566 28000 ???? dex ; 567 28000 ???? bne .delay_loop ; 36 54 568 28000 ???? 569 28000 ???? ; shift next data bit into carry 570 28000 ???? lsr {1} ; 5 59 571 28000 ???? 572 28000 ???? ; and loop (branch always taken) 573 28000 ???? bpl .byteout_loop ; 3 62 cycles for loop 574 28000 ???? 575 28000 ???? .speech_done 576 28000 ???? 577 28000 ???? endm 578 28000 ???? 579 28000 ???? 580 28000 ???? mac speak 581 28000 ???? 582 28000 ???? lda #<{1} 583 28000 ???? sta speech_addr 584 28000 ???? lda #>{1} 585 28000 ???? sta speech_addr+1 586 28000 ???? 587 28000 ???? endm 588 28000 ???? 589 28000 ???? 590 28000 ???? 591 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 592 28000 ???? 593 28000 ???? processor 6502 594 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 Adresses *************************** 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 mirror of 1800-27ff 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 5e enemy01_speed = var30 349 28000 ???? 350 28000 ???? 01 5d enemy01_Slowdown = var29 351 28000 ???? 352 28000 ???? 01 5c enemy01_Flag = var28 353 28000 ???? 354 28000 ???? 01 5b player_flag = var27 355 28000 ???? 356 28000 ???? 01 5a enemy01_ypos = var26 357 28000 ???? 358 28000 ???? 01 59 enemy01_xpos = var25 359 28000 ???? 360 28000 ???? 01 58 timer = var24 361 28000 ???? 362 28000 ???? 01 4f pBullet4_y = var15 363 28000 ???? 01 4e pBullet3_y = var14 364 28000 ???? 01 4d pBullet2_y = var13 365 28000 ???? 01 4c pBullet1_y = var12 366 28000 ???? 01 4b pBullet4_x = var11 367 28000 ???? 01 4a pBullet3_x = var10 368 28000 ???? 01 49 pBullet2_x = var9 369 28000 ???? 01 48 pBullet1_x = var8 370 28000 ???? 01 47 joyposright = var7 371 28000 ???? 372 28000 ???? 01 46 joyposleft = var6 373 28000 ???? 374 28000 ???? 01 45 joyposdown = var5 375 28000 ???? 376 28000 ???? 01 44 joyposup = var4 377 28000 ???? 378 28000 ???? 01 43 fire_debounce = var3 379 28000 ???? 380 28000 ???? 01 42 playerY = var2 381 28000 ???? 382 28000 ???? 01 41 playerX = var1 383 28000 ???? 384 28000 ???? 01 40 frameCounter = var0 385 28000 ???? 386 28000 ???? 00 00 FALSE = 0 387 28000 ???? 388 28000 ???? 00 01 TRUE = 1 389 28000 ???? 390 28000 ???? 00 0c RATEOFFIRE = 12 391 28000 ???? 392 28000 ???? 00 01 collisionwrap = 1 393 28000 ???? 00 01 NTSC = 1 394 28000 ???? 00 c0 SCREENHEIGHT = 192 395 28000 ???? 00 01 CHECKOVERWRITE = 1 396 28000 ???? 00 08 ZONEHEIGHT = 8 397 28000 ???? 00 08 bankswitchmode = 8 398 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 ???? 172 28000 ???? 00 c0 songchannel1transpose = $c0 173 28000 ???? 00 c1 songchannel2transpose = $c1 174 28000 ???? 00 c2 songchannel3transpose = $c2 175 28000 ???? 00 c3 songchannel4transpose = $c3 176 28000 ???? 177 28000 ???? 00 c4 songstackindex = $c4 178 28000 ???? 179 28000 ???? 00 c5 songchannel1instrumentlo = $c5 180 28000 ???? 00 c6 songchannel2instrumentlo = $c6 181 28000 ???? 00 c7 songchannel3instrumentlo = $c7 182 28000 ???? 00 c8 songchannel4instrumentlo = $c8 183 28000 ???? 184 28000 ???? 00 c9 songchannel1instrumenthi = $c9 185 28000 ???? 00 ca songchannel2instrumenthi = $ca 186 28000 ???? 00 cb songchannel3instrumenthi = $cb 187 28000 ???? 00 cc songchannel4instrumenthi = $cc 188 28000 ???? 189 28000 ???? 00 cd sfx1notedata = $cd 190 28000 ???? 00 ce sfx2notedata = $ce 191 28000 ???? 192 28000 ???? 00 cf songloops = $cf 193 28000 ???? 194 28000 ???? 00 d0 songpointerlo = $D0 195 28000 ???? 00 d1 songpointerhi = $D1 196 28000 ???? 197 28000 ???? 00 d2 voxlock = $D2 198 28000 ???? 00 d3 voxqueuesize = $D3 199 28000 ???? 200 28000 ???? 00 d4 vblankroutines = $D4 201 28000 ???? 202 28000 ???? 00 d5 doublebufferstate = $D5 203 28000 ???? 00 d6 doublebufferdloffset = $D6 204 28000 ???? 00 d7 doublebufferbufferdirty = $D7 205 28000 ???? 206 28000 ???? 00 d8 inttemp1 = $D8 207 28000 ???? 00 d9 inttemp2 = $D9 208 28000 ???? 00 da inttemp3 = $DA 209 28000 ???? 00 db inttemp4 = $DB 210 28000 ???? 00 dc inttemp5 = $DC 211 28000 ???? 00 dd inttemp6 = $DD 212 28000 ???? 213 28000 ???? 00 de sfxschedulelock = $DE 214 28000 ???? 00 df sfxschedulemissed = $DF 215 28000 ???? 00 e0 sfxinstrumentlo = $E0 216 28000 ???? 00 e1 sfxinstrumenthi = $E1 217 28000 ???? 00 e2 sfxpitchoffset = $E2 218 28000 ???? 00 e3 sfxnoteindex = $E3 219 28000 ???? 220 28000 ???? 00 e4 CTLSWAs = $E4 221 28000 ???? 00 e5 CTLSWBs = $E5 222 28000 ???? 223 28000 ???? 00 e6 A = $e6 224 28000 ???? 00 e6 a = $e6 225 28000 ???? 00 e7 B = $e7 226 28000 ???? 00 e7 b = $e7 227 28000 ???? 00 e8 C = $e8 228 28000 ???? 00 e8 c = $e8 229 28000 ???? 00 e9 D = $e9 230 28000 ???? 00 e9 d = $e9 231 28000 ???? 00 ea E = $ea 232 28000 ???? 00 ea e = $ea 233 28000 ???? 00 eb F = $eb 234 28000 ???? 00 eb f = $eb 235 28000 ???? 00 ec G = $ec 236 28000 ???? 00 ec g = $ec 237 28000 ???? 00 ed H = $ed 238 28000 ???? 00 ed h = $ed 239 28000 ???? 00 ee I = $ee 240 28000 ???? 00 ee i = $ee 241 28000 ???? 00 ef J = $ef 242 28000 ???? 00 ef j = $ef 243 28000 ???? 00 f0 K = $f0 244 28000 ???? 00 f0 k = $f0 245 28000 ???? 00 f1 L = $f1 246 28000 ???? 00 f1 l = $f1 247 28000 ???? 00 f2 M = $f2 248 28000 ???? 00 f2 m = $f2 249 28000 ???? 00 f3 N = $f3 250 28000 ???? 00 f3 n = $f3 251 28000 ???? 00 f4 O = $f4 252 28000 ???? 00 f4 o = $f4 253 28000 ???? 00 f5 P = $f5 254 28000 ???? 00 f5 p = $f5 255 28000 ???? 00 f6 Q = $f6 256 28000 ???? 00 f6 q = $f6 257 28000 ???? 00 f7 R = $f7 258 28000 ???? 00 f7 r = $f7 259 28000 ???? 00 f8 S = $f8 260 28000 ???? 00 f8 s = $f8 261 28000 ???? 00 f9 T = $f9 262 28000 ???? 00 f9 t = $f9 263 28000 ???? 00 fa U = $fa 264 28000 ???? 00 fa u = $fa 265 28000 ???? 00 fb V = $fb 266 28000 ???? 00 fb v = $fb 267 28000 ???? 00 fc W = $fc 268 28000 ???? 00 fc w = $fc 269 28000 ???? 00 fd X = $fd 270 28000 ???? 00 fd x = $fd 271 28000 ???? 00 fe Y = $fe 272 28000 ???? 00 fe y = $fe 273 28000 ???? 00 ff Z = $ff 274 28000 ???? 00 ff z = $ff 275 28000 ???? 276 28000 ???? ; var0-var99 variables use the top of the stack 277 28000 ???? 01 40 var0 = $140 278 28000 ???? 01 41 var1 = $141 279 28000 ???? 01 42 var2 = $142 280 28000 ???? 01 43 var3 = $143 281 28000 ???? 01 44 var4 = $144 282 28000 ???? 01 45 var5 = $145 283 28000 ???? 01 46 var6 = $146 284 28000 ???? 01 47 var7 = $147 285 28000 ???? 01 48 var8 = $148 286 28000 ???? 01 49 var9 = $149 287 28000 ???? 01 4a var10 = $14a 288 28000 ???? 01 4b var11 = $14b 289 28000 ???? 01 4c var12 = $14c 290 28000 ???? 01 4d var13 = $14d 291 28000 ???? 01 4e var14 = $14e 292 28000 ???? 01 4f var15 = $14f 293 28000 ???? 01 50 var16 = $150 294 28000 ???? 01 51 var17 = $151 295 28000 ???? 01 52 var18 = $152 296 28000 ???? 01 53 var19 = $153 297 28000 ???? 01 54 var20 = $154 298 28000 ???? 01 55 var21 = $155 299 28000 ???? 01 56 var22 = $156 300 28000 ???? 01 57 var23 = $157 301 28000 ???? 01 58 var24 = $158 302 28000 ???? 01 59 var25 = $159 303 28000 ???? 01 5a var26 = $15a 304 28000 ???? 01 5b var27 = $15b 305 28000 ???? 01 5c var28 = $15c 306 28000 ???? 01 5d var29 = $15d 307 28000 ???? 01 5e var30 = $15e 308 28000 ???? 01 5f var31 = $15f 309 28000 ???? 01 60 var32 = $160 310 28000 ???? 01 61 var33 = $161 311 28000 ???? 01 62 var34 = $162 312 28000 ???? 01 63 var35 = $163 313 28000 ???? 01 64 var36 = $164 314 28000 ???? 01 65 var37 = $165 315 28000 ???? 01 66 var38 = $166 316 28000 ???? 01 67 var39 = $167 317 28000 ???? 01 68 var40 = $168 318 28000 ???? 01 69 var41 = $169 319 28000 ???? 01 6a var42 = $16a 320 28000 ???? 01 6b var43 = $16b 321 28000 ???? 01 6c var44 = $16c 322 28000 ???? 01 6d var45 = $16d 323 28000 ???? 01 6e var46 = $16e 324 28000 ???? 01 6f var47 = $16f 325 28000 ???? 01 70 var48 = $170 326 28000 ???? 01 71 var49 = $171 327 28000 ???? 01 72 var50 = $172 328 28000 ???? 01 73 var51 = $173 329 28000 ???? 01 74 var52 = $174 330 28000 ???? 01 75 var53 = $175 331 28000 ???? 01 76 var54 = $176 332 28000 ???? 01 77 var55 = $177 333 28000 ???? 01 78 var56 = $178 334 28000 ???? 01 79 var57 = $179 335 28000 ???? 01 7a var58 = $17a 336 28000 ???? 01 7b var59 = $17b 337 28000 ???? 01 7c var60 = $17c 338 28000 ???? 01 7d var61 = $17d 339 28000 ???? 01 7e var62 = $17e 340 28000 ???? 01 7f var63 = $17f 341 28000 ???? 01 80 var64 = $180 342 28000 ???? 01 81 var65 = $181 343 28000 ???? 01 82 var66 = $182 344 28000 ???? 01 83 var67 = $183 345 28000 ???? 01 84 var68 = $184 346 28000 ???? 01 85 var69 = $185 347 28000 ???? 01 86 var70 = $186 348 28000 ???? 01 87 var71 = $187 349 28000 ???? 01 88 var72 = $188 350 28000 ???? 01 89 var73 = $189 351 28000 ???? 01 8a var74 = $18a 352 28000 ???? 01 8b var75 = $18b 353 28000 ???? 01 8c var76 = $18c 354 28000 ???? 01 8d var77 = $18d 355 28000 ???? 01 8e var78 = $18e 356 28000 ???? 01 8f var79 = $18f 357 28000 ???? 01 90 var80 = $190 358 28000 ???? 01 91 var81 = $191 359 28000 ???? 01 92 var82 = $192 360 28000 ???? 01 93 var83 = $193 361 28000 ???? 01 94 var84 = $194 362 28000 ???? 01 95 var85 = $195 363 28000 ???? 01 96 var86 = $196 364 28000 ???? 01 97 var87 = $197 365 28000 ???? 01 98 var88 = $198 366 28000 ???? 01 99 var89 = $199 367 28000 ???? 01 9a var90 = $19a 368 28000 ???? 01 9b var91 = $19b 369 28000 ???? 01 9c var92 = $19c 370 28000 ???? 01 9d var93 = $19d 371 28000 ???? 01 9e var94 = $19e 372 28000 ???? 01 9f var95 = $19f 373 28000 ???? 01 a0 var96 = $1a0 374 28000 ???? 01 a1 var97 = $1a1 375 28000 ???? 01 a2 var98 = $1a2 376 28000 ???? 01 a3 var99 = $1a3 377 28000 ???? 378 U01c2 ???? SEG.U "7800basicRAM" 379 U01a4 ORG $1A4 380 U01a4 381 U01a4 ; MAX allocation locations are in comments... 382 U01a4 00 framecounter DS 1 ; $1A4 383 U01a5 00 countdownseconds DS 1 ; $1A5 384 U01a6 00 00 00 score0 DS 3 ; $1A6 $1A7 $1A8 385 U01a9 00 00 00 score1 DS 3 ; $1A9 $1AA $1AB 386 U01ac 00 pausebuttonflag DS 1 ; $1AC 387 U01ad 00 valbufend DS 1 ; $1AD 388 U01ae 00 valbufendsave DS 1 ; $1AE 389 U01af 00 finescrollx DS 1 ; $1AF 390 U01b0 00 finescrolly DS 1 ; $1B0 391 U01b1 00 joybuttonmode DS 1 ; $1B1 ; track joysticks that were changed to one-button mode 392 U01b2 00 interruptindex DS 1 ; $1B2 393 U01b3 394 U01b3 - ifconst DOUBLEBUFFER 395 U01b3 -doublebufferminimumframetarget DS 1 ; $1B3 396 U01b3 -doublebufferminimumframeindex DS 1 ; $1B4 397 U01b3 endif 398 U01b3 399 U01b3 00 pausedisable DS 1 ; $1B5 400 U01b4 00 XCTRL1s DS 1 ; $1B6 401 U01b5 402 U01b5 - ifconst AVOXVOICE 403 U01b5 -avoxenable DS 1 ; $1B7 404 U01b5 -tempavox DS 1 ; $1B8 405 U01b5 endif 406 U01b5 407 U01b5 - ifconst MUSICTRACKER 408 U01b5 -songtempo DS 1 ; $1B9 409 U01b5 -songtick DS 1 ; $1BA 410 U01b5 - 411 U01b5 -songchannel1layer1loops DS 1 ; $1BB 412 U01b5 -songchannel2layer1loops DS 1 ; $1BC 413 U01b5 -songchannel3layer1loops DS 1 ; $1BD 414 U01b5 -songchannel4layer1loops DS 1 ; $1BE 415 U01b5 - 416 U01b5 -songchannel1layer2loops DS 1 ; $1BF 417 U01b5 -songchannel2layer2loops DS 1 ; $1C0 418 U01b5 -songchannel3layer2loops DS 1 ; $1C1 419 U01b5 -songchannel4layer2loops DS 1 ; $1C2 420 U01b5 - 421 U01b5 -songchannel1layer3loops DS 1 ; $1C3 422 U01b5 -songchannel2layer3loops DS 1 ; $1C4 423 U01b5 -songchannel3layer3loops DS 1 ; $1C5 424 U01b5 -songchannel4layer3loops DS 1 ; $1C6 425 U01b5 - 426 U01b5 -songchannel1busywait DS 1 ; $1C7 427 U01b5 -songchannel2busywait DS 1 ; $1C8 428 U01b5 -songchannel3busywait DS 1 ; $1C9 429 U01b5 -songchannel4busywait DS 1 ; $1CA 430 U01b5 - 431 U01b5 -songchannel1stackdepth DS 1 ; $1CB 432 U01b5 -songchannel2stackdepth DS 1 ; $1CC 433 U01b5 -songchannel3stackdepth DS 1 ; $1CD 434 U01b5 -songchannel4stackdepth DS 1 ; $1CE 435 U01b5 endif 436 U01b5 437 U01b5 00 palframes DS 1 ; $1CF 438 U01b6 00 palfastframe DS 1 ; $1D0 439 U01b7 440 U01b7 - ifconst MOUSESUPPORT 441 U01b7 -port0resolution DS 1 ; $1D1 442 U01b7 -port1resolution DS 1 ; $1D2 443 U01b7 else 444 U01b7 - ifconst TRAKBALLSUPPORT 445 U01b7 -port0resolution DS 1 ; $1D1 446 U01b7 -port1resolution DS 1 ; $1D2 447 U01b7 endif 448 U01b7 endif 449 U01b7 450 U01b7 00 port0control DS 1 ; $1D3 451 U01b8 00 port1control DS 1 ; $1D4 452 U01b9 453 U01b9 ; port#control values... 454 U01b9 ; 1 = proline 455 U01b9 ; 2 = lightgun 456 U01b9 ; 3 = paddle 457 U01b9 ; 4 = trakball 458 U01b9 ; 5 = vcs joystick 459 U01b9 ; 6 = driving 460 U01b9 ; 7 = keypad 461 U01b9 ; 8 = st mouse/cx80 462 U01b9 ; 9 = amiga mouse 463 U01b9 ; 10 = atarivox 464 U01b9 465 U01b9 ; controller 0 data... 466 U01b9 00 paddleposition0 DS 1 ; $1D5 467 U01b9 01 b9 keypadmatrix0a = paddleposition0 468 U01b9 01 b9 drivingposition0 = paddleposition0 469 U01b9 01 b9 trakballx0 = paddleposition0 470 U01b9 01 b9 mousex0 = paddleposition0 471 U01b9 01 b9 lighttgunx0 = 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 U01bb 481 U01bb ; controller 0 altdata... 482 U01bb 00 paddleposition1 DS 1 ; $1D7 483 U01bb 01 bb keypadmatrix0b = paddleposition1 484 U01bb 01 bb trakbally0 = paddleposition1 485 U01bb 01 bb mousey0 = paddleposition1 486 U01bb 01 bb lightguny0 = paddleposition1 487 U01bc 488 U01bc ; controller 1 altdata... 489 U01bc 00 paddleposition3 DS 1 ; $1D8 490 U01bc 01 bc keypadmatrix1b = paddleposition3 491 U01bc 01 bc trakbally1 = paddleposition3 492 U01bc 01 bc mousey1 = paddleposition3 493 U01bc 01 bc lightguny1 = paddleposition3 494 U01bd 495 U01bd ; controller state save. for trakball state+dir codes, rotary position codes 496 U01bd 00 controller0statesave DS 1 ; $1D9 497 U01bd 01 bd paddleprevious0 = controller0statesave 498 U01bd 01 bd mousecodex0 = controller0statesave 499 U01bd 01 bd trakballcodex0 = controller0statesave 500 U01bd 01 bd keypadmatrix0c = controller0statesave 501 U01be 502 U01be 00 controller1statesave DS 1 ; $1DA 503 U01be 01 be paddleprevious2 = controller1statesave 504 U01be 01 be mousecodex1 = controller1statesave 505 U01be 01 be trakballcodex1 = controller1statesave 506 U01be 01 be keypadmatrix1c = controller1statesave 507 U01bf 508 U01bf 00 paddleprevious1 DS 1 ; $1DB 509 U01bf 01 bf keypadmatrix0d = paddleprevious1 510 U01bf 01 bf mousecodey0 = paddleprevious1 511 U01bf 01 bf trakballcodey0 = paddleprevious1 512 U01c0 513 U01c0 00 paddleprevious3 DS 1 ; $1DC 514 U01c0 01 c0 keypadmatrix1d = paddleprevious3 515 U01c0 01 c0 mousecodey1 = paddleprevious3 516 U01c0 01 c0 trakballcodey1 = paddleprevious3 517 U01c1 518 U01c1 - ifconst pokeysupport 519 U01c1 -pokey1frames DS 1 ; $1DD 520 U01c1 -pokey1tick DS 1 ; $1DE 521 U01c1 -pokey2frames DS 1 ; $1DF 522 U01c1 -pokey2tick DS 1 ; $1E0 523 U01c1 -pokey3frames DS 1 ; $1E1 524 U01c1 -pokey3tick DS 1 ; $1E2 525 U01c1 -pokey4frames DS 1 ; $1E3 526 U01c1 -pokey4tick DS 1 ; $1E4 527 U01c1 -pokey1priority DS 1 ; $1E5 528 U01c1 -pokey1offset DS 1 ; $1E6 529 U01c1 -pokey2priority DS 1 ; $1E7 530 U01c1 -pokey2offset DS 1 ; $1E8 531 U01c1 -pokey3priority DS 1 ; $1E9 532 U01c1 -pokey3offset DS 1 ; $1EA 533 U01c1 -pokey4priority DS 1 ; $1EB 534 U01c1 -pokey4offset DS 1 ; $1EC 535 U01c1 endif 536 U01c1 537 U01c1 - ifconst pokeykeysupport 538 U01c1 -pokeylastkeycode DS 1 539 U01c1 -pokeykeycode DS 1 540 U01c1 -pokeykeydebounce DS 1 541 U01c1 endif 542 U01c1 543 U01c1 ; see if we need an interrupthold byte... 544 U01c1 INTERRUPTNEEDED SET 0 545 U01c1 - ifconst .topscreenroutine 546 U01c1 -INTERRUPTNEEDED SET 1 547 U01c1 endif 548 U01c1 - ifconst .bottomscreenroutine 549 U01c1 -INTERRUPTNEEDED SET 1 550 U01c1 endif 551 U01c1 - ifconst .userinterrupt 552 U01c1 -INTERRUPTNEEDED SET 1 553 U01c1 endif 554 U01c1 - if INTERRUPTNEEDED = 1 555 U01c1 -interrupthold DS 1 ; $1ED 556 U01c1 endif 557 U01c1 558 U01c1 ifnconst CANARYOFF 559 U01c1 00 canary DS 1 ; $1EF 560 U01c2 endif 561 U01c2 562 U01c2 563 U01c2 - ifnconst bankswitchmode 564 U01c2 - echo " stack allowance:",[($1FF - .)/2]d,"nested subroutines." 565 U01c2 else stack allowance: 20 nested subroutines. 566 U01c2 echo " stack allowance:",[($1FF - .)/3]d,"nested subroutines." 567 U01c2 endif 568 U01c2 ifnconst CANARYOFF the canary is situated at: $1c1 569 U01c2 echo " the canary is situated at:",[canary] 570 U01c2 - else 571 U01c2 - echo " the canary is disabled." 572 U01c2 endif 573 U01c2 574 U01c2 ; $1EE - $1FF reserved for stack 575 U01c2 576 28000 ???? SEG "GAME" 577 28000 ???? ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite5.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 5e enemy01_speed = var30 349 28000 ???? 350 28000 ???? 01 5d enemy01_Slowdown = var29 351 28000 ???? 352 28000 ???? 01 5c enemy01_Flag = var28 353 28000 ???? 354 28000 ???? 01 5b player_flag = var27 355 28000 ???? 356 28000 ???? 01 5a enemy01_ypos = var26 357 28000 ???? 358 28000 ???? 01 59 enemy01_xpos = var25 359 28000 ???? 360 28000 ???? 01 58 timer = var24 361 28000 ???? 362 28000 ???? 01 4f pBullet4_y = var15 363 28000 ???? 01 4e pBullet3_y = var14 364 28000 ???? 01 4d pBullet2_y = var13 365 28000 ???? 01 4c pBullet1_y = var12 366 28000 ???? 01 4b pBullet4_x = var11 367 28000 ???? 01 4a pBullet3_x = var10 368 28000 ???? 01 49 pBullet2_x = var9 369 28000 ???? 01 48 pBullet1_x = var8 370 28000 ???? 01 47 joyposright = var7 371 28000 ???? 372 28000 ???? 01 46 joyposleft = var6 373 28000 ???? 374 28000 ???? 01 45 joyposdown = var5 375 28000 ???? 376 28000 ???? 01 44 joyposup = var4 377 28000 ???? 378 28000 ???? 01 43 fire_debounce = var3 379 28000 ???? 380 28000 ???? 01 42 playerY = var2 381 28000 ???? 382 28000 ???? 01 41 playerX = var1 383 28000 ???? 384 28000 ???? 01 40 frameCounter = var0 385 28000 ???? 386 28000 ???? 00 00 FALSE = 0 387 28000 ???? 388 28000 ???? 00 01 TRUE = 1 389 28000 ???? 390 28000 ???? 00 0c RATEOFFIRE = 12 391 28000 ???? 392 28000 ???? 00 01 collisionwrap = 1 393 28000 ???? 00 01 NTSC = 1 394 28000 ???? 00 c0 SCREENHEIGHT = 192 395 28000 ???? 00 01 CHECKOVERWRITE = 1 396 28000 ???? 00 08 ZONEHEIGHT = 8 397 28000 ???? 00 08 bankswitchmode = 8 398 28000 ???? 00 01 ROM128K = 1 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite5.78b.asm 597 28000 ???? 598 28000 ???? ; A BEAD header gets automatically incorportated into the ROM header. 599 28000 ???? ; For more BEAD executable info, check out the spec... 600 28000 ???? ; http://7800.8bitdev.org/index.php/The_Atari_7800_BEAD_Execuable_Specification 601 28000 ???? 602 28000 ???? 00 01 GAMEDESCRIPTIONSET = 1 603 28000 ???? 4e 61 6d 65 GAMEDESCRIPTION = "Test Name" 604 28000 ???? 605 28000 ???? 00 40 BDHSC = %01000000 606 28000 ???? 00 20 BDYM = %00100000 607 28000 ???? 00 10 BDPOKEY = %00010000 608 28000 ???? 00 08 BDROF = %00001000 609 28000 ???? 00 00 BD16K = %00000000 610 28000 ???? 00 01 BD32K = %00000001 611 28000 ???? 00 02 BD48K = %00000010 612 28000 ???? 00 05 BD1800 = %00000101 613 28000 ???? 00 06 BD4000 = %00000110 614 28000 ???? 615 28000 ???? - ifconst ROM32K 616 28000 ???? -BEADHEADER = 1 617 28000 ???? endif 618 28000 ???? - ifconst ROM48K 619 28000 ???? -BEADHEADER = 1 620 28000 ???? endif 621 28000 ???? 622 28000 ???? - ifconst BEADHEADER 623 28000 ???? -BEADHARDWARE SET 0 624 28000 ???? - ifconst ROM16K 625 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD16K) 626 28000 ???? - endif 627 28000 ???? - ifconst ROM32K 628 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD32K) 629 28000 ???? - endif 630 28000 ???? - ifconst ROM48K 631 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD48K) 632 28000 ???? - endif 633 28000 ???? - ifconst pokeysupport 634 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDPOKEY) 635 28000 ???? - endif 636 28000 ???? - ifconst HSSUPPORT 637 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDHSC) 638 28000 ???? - endif 639 28000 ???? endif 640 28000 ???? 641 28000 ???? ;start address of cart... 642 28000 ???? - ifconst ROM48K 643 28000 ???? - ORG $4000,0 644 28000 ???? - ifconst BEADHEADER 645 28000 ???? - .byte $BE,$AD,BEADHARDWARE 646 28000 ???? - ifconst GAMEDESCRIPTIONSET 647 28000 ???? - CLC 648 28000 ???? - BCC _SKIPDESCRIPTION 649 28000 ???? - .byte GAMEDESCRIPTION,0 650 28000 ???? -_SKIPDESCRIPTION 651 28000 ???? - endif 652 28000 ???? - jmp ($FFFC) 653 28000 ???? - endif 654 28000 ???? else 655 28000 ???? ifconst bankswitchmode 656 28000 ???? - ifconst ROMAT4K 657 28000 ???? - ORG $4000,0 658 28000 ???? - RORG $4000 659 28000 ???? else 660 8000 ORG $8000,0 661 8000 RORG $8000 662 8000 endif 663 8000 - else ; not bankswitchmode 664 8000 - ifconst ROM16K 665 8000 - ORG $C000,0 666 8000 - ifconst BEADHEADER 667 8000 - .byte $BE,$AD,BEADHARDWARE 668 8000 - ifconst GAMEDESCRIPTION 669 8000 - CLC 670 8000 - BCC _SKIPDESCRIPTION 671 8000 - .byte GAMEDESCRIPTION,0 672 8000 -_SKIPDESCRIPTION 673 8000 - endif 674 8000 - jmp ($FFFC) 675 8000 - endif 676 8000 - else 677 8000 - ifconst ROM8K 678 8000 - ORG $E000,0 679 8000 - else 680 8000 - ORG $8000,0 681 8000 - ifconst BEADHEADER 682 8000 - .byte $BE,$AD,BEADHARDWARE 683 8000 - ifconst GAMEDESCRIPTION 684 8000 - CLC 685 8000 - BCC _SKIPDESCRIPTION 686 8000 - .byte GAMEDESCRIPTION,0 687 8000 -_SKIPDESCRIPTION 688 8000 - endif 689 8000 - jmp ($FFFC) 690 8000 - endif 691 8000 - endif 692 8000 - endif 693 8000 endif 694 8000 endif 695 8000 696 8000 ;7800basic v0.19 Dec 31 2021 00:14:23 697 8000 SPACEOVERFLOW SET 0 698 8000 game 699 8000 . 700 8000 ;; 701 8000 702 8000 .L00 ;; set romsize 128k 703 8000 704 8000 .L01 ;; set zoneheight 8 705 8000 706 8000 .L02 ;; set zoneprotection on 707 8000 708 8000 .L03 ;; set tallsprite on 709 8000 710 8000 .L04 ;; set screenheight 192 711 8000 712 8000 .L05 ;; set basepath gfx 713 8000 714 8000 .L06 ;; set tv ntsc 715 8000 716 8000 .L07 ;; set collisionwrap on 717 8000 718 8000 .L08 ;; set doublewide off 719 8000 720 8000 . 721 8000 ;; 722 8000 723 8000 .L09 ;; displaymode 160A 724 8000 725 8000 a9 40 lda #%01000000 ;Enable DMA, mode=160x2/160x4 726 8002 85 3c sta CTRL 727 8004 728 8004 8d 07 21 sta sCTRL 729 8007 730 8007 . 731 8007 ;; 732 8007 733 8007 .L010 ;; const RATEOFFIRE = 12 734 8007 735 8007 .L011 ;; const TRUE = 1 736 8007 737 8007 .L012 ;; const FALSE = 0 738 8007 739 8007 . 740 8007 ;; 741 8007 742 8007 .L013 ;; dim frameCounter = var0 743 8007 744 8007 .L014 ;; dim playerX = var1 745 8007 746 8007 .L015 ;; dim playerY = var2 747 8007 748 8007 .L016 ;; dim fire_debounce = var3 749 8007 750 8007 .L017 ;; dim joyposup = var4 751 8007 752 8007 .L018 ;; dim joyposdown = var5 753 8007 754 8007 .L019 ;; dim joyposleft = var6 755 8007 756 8007 .L020 ;; dim joyposright = var7 757 8007 758 8007 .L021 ;; dim pBullet1_x = var8.var16 759 8007 760 8007 .L022 ;; dim pBullet2_x = var9.var17 761 8007 762 8007 .L023 ;; dim pBullet3_x = var10.var18 763 8007 764 8007 .L024 ;; dim pBullet4_x = var11.var19 765 8007 766 8007 .L025 ;; dim pBullet1_y = var12.var20 767 8007 768 8007 .L026 ;; dim pBullet2_y = var13.var21 769 8007 770 8007 .L027 ;; dim pBullet3_y = var14.var22 771 8007 772 8007 .L028 ;; dim pBullet4_y = var15.var23 773 8007 774 8007 .L029 ;; dim timer = var24 775 8007 776 8007 .L030 ;; dim enemy01_xpos = var25 777 8007 778 8007 .L031 ;; dim enemy01_ypos = var26 779 8007 780 8007 .L032 ;; dim player_flag = var27 781 8007 782 8007 .L033 ;; dim enemy01_Flag = var28 783 8007 784 8007 .L034 ;; dim enemy01_Slowdown = var29 785 8007 786 8007 .L035 ;; dim enemy01_speed = var30 787 8007 788 8007 .L036 ;; dim customTemp1 = var31 789 8007 790 8007 .L037 ;; dim customTemp2 = var32 791 8007 792 8007 .L038 ;; dim customTemp3 = var33 793 8007 794 8007 .L039 ;; dim customTemp4 = var34 795 8007 796 8007 .L040 ;; dim gameover_flag = var35 797 8007 798 8007 .L041 ;; dim isDead_flag = var36 799 8007 800 8007 .L042 ;; dim lives = var37 801 8007 802 8007 .L043 ;; dim enemy_direction = var38 803 8007 804 8007 .L044 ;; dim enemy_movement = var39 805 8007 806 8007 .L045 ;; dim power_upX = var40 807 8007 808 8007 .L046 ;; dim power_upY = var41 809 8007 810 8007 .L047 ;; dim power_up_Flag = var42 811 8007 812 8007 .L048 ;; dim extra_shipX = var43 813 8007 814 8007 .L049 ;; dim extra_shipY = var44 815 8007 816 8007 .L050 ;; dim extra_shipFlag = var45 817 8007 818 8007 .L051 ;; dim explosion_aniframe = var46 819 8007 820 8007 .L052 ;; dim temp_loop = var47 821 8007 822 8007 .L053 ;; dim temp_x = var48 823 8007 824 8007 .L054 ;; dim temp_y = var49 825 8007 826 8007 .L055 ;; dim pBullet1_time = var50 827 8007 828 8007 .L056 ;; dim pBullet2_time = var51 829 8007 830 8007 .L057 ;; dim pBullet3_time = var52 831 8007 832 8007 .L058 ;; dim pBullet4_time = var53 833 8007 834 8007 .L059 ;; dim p_twinlaser1_x = var54.var62 835 8007 836 8007 .L060 ;; dim p_twinlaser2_x = var55.var63 837 8007 838 8007 .L061 ;; dim p_twinlaser3_x = var56.var64 839 8007 840 8007 .L062 ;; dim p_twinlaser4_x = var57.var65 841 8007 842 8007 .L063 ;; dim p_twinlaser1_y = var58.var66 843 8007 844 8007 .L064 ;; dim p_twinlaser2_y = var59.var67 845 8007 846 8007 .L065 ;; dim p_twinlaser3_y = var60.var68 847 8007 848 8007 .L066 ;; dim p_twinlaser4_y = var61.var69 849 8007 850 8007 .L067 ;; dim p_twinlaser1_time = var70 851 8007 852 8007 .L068 ;; dim p_twinlaser2_time = var71 853 8007 854 8007 .L069 ;; dim p_twinlaser3_time = var72 855 8007 856 8007 .L070 ;; dim p_twinlaser4_time = var73 857 8007 858 8007 .L071 ;; dim twinlaser_flag = var74 859 8007 860 8007 . 861 8007 ;; 862 8007 863 8007 .L072 ;; dim enemy_shot_xpos = $2200 864 8007 865 8007 .L073 ;; dim enemy_shot_Xf = $2210 866 8007 867 8007 .L074 ;; dim enemy_shot_ypos = $2220 868 8007 869 8007 .L075 ;; dim enemy_shot_Yf = $2230 870 8007 871 8007 .L076 ;; dim enemy_shot_Sx = $2240 872 8007 873 8007 .L077 ;; dim enemy_shot_Sxf = $2250 874 8007 875 8007 .L078 ;; dim enemy_shot_Sy = $2260 876 8007 877 8007 .L079 ;; dim enemy_shot_Syf = $2270 878 8007 879 8007 .L080 ;; dim enemy_shot_active = $2280 880 8007 881 8007 .L081 ;; dim enemy_shot_direction = $2290 882 8007 883 8007 .L082 ;; dim Total_XSu = var75 884 8007 885 8007 .L083 ;; dim Total_XSf = var76 886 8007 887 8007 .L084 ;; dim Total_speedX = Total_XSu.Total_XSf 888 8007 889 8007 .L085 ;; dim Total_YSu = var77 890 8007 891 8007 .L086 ;; dim Total_YSf = var78 892 8007 893 8007 .L087 ;; dim Total_speedY = Total_YSu.Total_YSf 894 8007 895 8007 .L088 ;; dim Temp_XSu = var79 896 8007 897 8007 .L089 ;; dim Temp_XSf = var80 898 8007 899 8007 .L090 ;; dim Temp_X_speed = Temp_XSu.Temp_XSf 900 8007 901 8007 .L091 ;; dim Temp_YSu = var81 902 8007 903 8007 .L092 ;; dim Temp_YSf = var82 904 8007 905 8007 .L093 ;; dim Temp_Y_speed = Temp_YSu.Temp_YSf 906 8007 907 8007 .L094 ;; dim Mob_SpeedX = var83.var87 908 8007 909 8007 .L095 ;; dim Mob_SpeedY = var84.var88 910 8007 911 8007 .L096 ;; dim Mob_Pos_X = var85.var89 912 8007 913 8007 .L097 ;; dim Mob_Pos_Y = var86.var90 914 8007 915 8007 .L098 ;; dim max_bullets = var91 916 8007 917 8007 .L099 ;; dim enemy_shotFlag = var92 918 8007 919 8007 . 920 8007 ;; 921 8007 922 8007 .L0100 ;; timer = RATEOFFIRE 923 8007 924 8007 a9 0c LDA #RATEOFFIRE 925 8009 8d 58 01 STA timer 926 800c . 927 800c ;; 928 800c 929 800c .L0101 ;; characterset vertical_shooting_font 930 800c 931 800c a9 b0 lda #>vertical_shooting_font 932 800e 8d 0b 21 sta sCHARBASE 933 8011 934 8011 85 34 sta CHARBASE 935 8013 a9 60 lda #(vertical_shooting_font_mode | %01100000) 936 8015 8d 06 21 sta charactermode 937 8018 938 8018 .L0102 ;; alphachars ' 0123456789abcdefghijklmnopqrstuvwxyz.,?!:;`"' 939 8018 940 8018 .import 941 8018 ;; import 942 8018 943 8018 .L0103 ;; incgraphic vertical_shooting_font.png 160A 944 8018 945 8018 .L0104 ;; incgraphic vertical_shooting_ship.png 160A 946 8018 947 8018 .L0105 ;; incgraphic vertical_shooting_bullet.png 160A 948 8018 949 8018 .L0106 ;; incgraphic vertical_shooting_enemyshot.png 160A 950 8018 951 8018 .L0107 ;; incgraphic vertical_shooting_powerup.png 160A 952 8018 953 8018 .L0108 ;; incgraphic vertical_shooting_enemy01.png 160A 954 8018 955 8018 .L0109 ;; incgraphic vertical_shooting_1up.png 160A 956 8018 957 8018 .L0110 ;; incgraphic vertical_shooting_demo_explosion_upd0.png 160A 958 8018 959 8018 .L0111 ;; incgraphic vertical_shooting_demo_explosion_upd1.png 160A 960 8018 961 8018 .L0112 ;; incgraphic vertical_shooting_demo_explosion_upd2.png 160A 962 8018 963 8018 .L0113 ;; incgraphic vertical_shooting_demo_explosion_upd3.png 160A 964 8018 965 8018 .L0114 ;; incgraphic vertical_shooting_demo_explosion_upd4.png 160A 966 8018 967 8018 .L0115 ;; incgraphic vertical_shooting_demo_explosion_upd5.png 160A 968 8018 969 8018 .L0116 ;; incgraphic vertical_shooting_demo_explosion_upd6.png 160A 970 8018 971 8018 .L0117 ;; incgraphic vertical_shooting_demo_explosion_upd7.png 160A 972 8018 973 8018 .L0118 ;; incgraphic vertical_shooting_demo_explosion_upd8.png 160A 974 8018 975 8018 .L0119 ;; incgraphic vertical_shooting_demo_explosion_upd9.png 160A 976 8018 977 8018 .L0120 ;; incgraphic vertical_shooting_demo_explosion_upd10.png 160A 978 8018 979 8018 .L0121 ;; incgraphic vertical_shooting_laser.png 160A 980 8018 981 8018 .palettes 982 8018 ;; palettes 983 8018 984 8018 .L0122 ;; P0C1 = $0F : P0C2 = $05 : P0C3 = $32 985 8018 986 8018 a9 0f LDA #$0F 987 801a 85 21 STA P0C1 988 801c a9 05 LDA #$05 989 801e 85 22 STA P0C2 990 8020 a9 32 LDA #$32 991 8022 85 23 STA P0C3 992 8024 .L0123 ;; P1C1 = $0F : P1C2 = $EE : P1C3 = $E7 993 8024 994 8024 a9 0f LDA #$0F 995 8026 85 25 STA P1C1 996 8028 a9 ee LDA #$EE 997 802a 85 26 STA P1C2 998 802c a9 e7 LDA #$E7 999 802e 85 27 STA P1C3 1000 8030 .L0124 ;; P2C1 = $9D : P2C2 = $73 : P2C3 = $88 1001 8030 1002 8030 a9 9d LDA #$9D 1003 8032 85 29 STA P2C1 1004 8034 a9 73 LDA #$73 1005 8036 85 2a STA P2C2 1006 8038 a9 88 LDA #$88 1007 803a 85 2b STA P2C3 1008 803c .L0125 ;; P3C1 = $FB : P3C2 = $F2 : P3C3 = $25 1009 803c 1010 803c a9 fb LDA #$FB 1011 803e 85 2d STA P3C1 1012 8040 a9 f2 LDA #$F2 1013 8042 85 2e STA P3C2 1014 8044 a9 25 LDA #$25 1015 8046 85 2f STA P3C3 1016 8048 . 1017 8048 ;; 1018 8048 1019 8048 .plot 1020 8048 ;; plot 1021 8048 1022 8048 .L0126 ;; frameCounter = 0 1023 8048 1024 8048 a9 00 LDA #0 1025 804a 8d 40 01 STA frameCounter 1026 804d .L0127 ;; playerX = 80 : playerY = 144 : player_flag = 0 1027 804d 1028 804d a9 50 LDA #80 1029 804f 8d 41 01 STA playerX 1030 8052 a9 90 LDA #144 1031 8054 8d 42 01 STA playerY 1032 8057 a9 00 LDA #0 1033 8059 8d 5b 01 STA player_flag 1034 805c .L0128 ;; fire_debounce = 0 : joyposdown = 0 : joyposup = 0 : joyposleft = 0 : joyposright = 0 1035 805c 1036 805c a9 00 LDA #0 1037 805e 8d 43 01 STA fire_debounce 1038 8061 8d 45 01 STA joyposdown 1039 8064 8d 44 01 STA joyposup 1040 8067 8d 46 01 STA joyposleft 1041 806a 8d 47 01 STA joyposright 1042 806d .L0129 ;; enemy01_xpos = 5 : enemy01_ypos = 5 : enemy01_Flag = 0 : enemy01_speed = 3 : enemy_direction = 0 : enemy_movement = 0 1043 806d 1044 806d a9 05 LDA #5 1045 806f 8d 59 01 STA enemy01_xpos 1046 8072 8d 5a 01 STA enemy01_ypos 1047 8075 a9 00 LDA #0 1048 8077 8d 5c 01 STA enemy01_Flag 1049 807a a9 03 LDA #3 1050 807c 8d 5e 01 STA enemy01_speed 1051 807f a9 00 LDA #0 1052 8081 8d 66 01 STA enemy_direction 1053 8084 8d 67 01 STA enemy_movement 1054 8087 .L0130 ;; power_upX = 5 : power_upY = 32 : power_up_Flag = 0 1055 8087 1056 8087 a9 05 LDA #5 1057 8089 8d 68 01 STA power_upX 1058 808c a9 20 LDA #32 1059 808e 8d 69 01 STA power_upY 1060 8091 a9 00 LDA #0 1061 8093 8d 6a 01 STA power_up_Flag 1062 8096 .L0131 ;; pBullet1_x = 200 : pBullet1_y = - 10 : pBullet2_x = 200 : pBullet2_y = - 10 1063 8096 1064 8096 a9 00 LDA #0 1065 8098 8d 50 01 STA var16 1066 809b a9 c8 LDA #200 1067 809d 8d 48 01 STA pBullet1_x 1068 80a0 a2 00 LDX #0 1069 80a2 8e 54 01 STX var20 1070 80a5 a9 f6 LDA #246 1071 80a7 8d 4c 01 STA pBullet1_y 1072 80aa a9 00 LDA #0 1073 80ac 8d 51 01 STA var17 1074 80af a9 c8 LDA #200 1075 80b1 8d 49 01 STA pBullet2_x 1076 80b4 a2 00 LDX #0 1077 80b6 8e 55 01 STX var21 1078 80b9 a9 f6 LDA #246 1079 80bb 8d 4d 01 STA pBullet2_y 1080 80be .L0132 ;; pBullet3_x = 200 : pBullet3_y = - 10 : pBullet4_x = 200 : pBullet4_y = - 10 1081 80be 1082 80be a9 00 LDA #0 1083 80c0 8d 52 01 STA var18 1084 80c3 a9 c8 LDA #200 1085 80c5 8d 4a 01 STA pBullet3_x 1086 80c8 a2 00 LDX #0 1087 80ca 8e 56 01 STX var22 1088 80cd a9 f6 LDA #246 1089 80cf 8d 4e 01 STA pBullet3_y 1090 80d2 a9 00 LDA #0 1091 80d4 8d 53 01 STA var19 1092 80d7 a9 c8 LDA #200 1093 80d9 8d 4b 01 STA pBullet4_x 1094 80dc a2 00 LDX #0 1095 80de 8e 57 01 STX var23 1096 80e1 a9 f6 LDA #246 1097 80e3 8d 4f 01 STA pBullet4_y 1098 80e6 .L0133 ;; p_twinlaser1_x = 200 : p_twinlaser1_y = - 10 : p_twinlaser2_x = 200 : p_twinlaser2_y = - 10 1099 80e6 1100 80e6 a9 00 LDA #0 1101 80e8 8d 7e 01 STA var62 1102 80eb a9 c8 LDA #200 1103 80ed 8d 76 01 STA p_twinlaser1_x 1104 80f0 a2 00 LDX #0 1105 80f2 8e 82 01 STX var66 1106 80f5 a9 f6 LDA #246 1107 80f7 8d 7a 01 STA p_twinlaser1_y 1108 80fa a9 00 LDA #0 1109 80fc 8d 7f 01 STA var63 1110 80ff a9 c8 LDA #200 1111 8101 8d 77 01 STA p_twinlaser2_x 1112 8104 a2 00 LDX #0 1113 8106 8e 83 01 STX var67 1114 8109 a9 f6 LDA #246 1115 810b 8d 7b 01 STA p_twinlaser2_y 1116 810e .L0134 ;; p_twinlaser3_x = 200 : p_twinlaser3_y = - 10 : p_twinlaser4_x = 200 : p_twinlaser4_y = - 10 1117 810e 1118 810e a9 00 LDA #0 1119 8110 8d 80 01 STA var64 1120 8113 a9 c8 LDA #200 1121 8115 8d 78 01 STA p_twinlaser3_x 1122 8118 a2 00 LDX #0 1123 811a 8e 84 01 STX var68 1124 811d a9 f6 LDA #246 1125 811f 8d 7c 01 STA p_twinlaser3_y 1126 8122 a9 00 LDA #0 1127 8124 8d 81 01 STA var65 1128 8127 a9 c8 LDA #200 1129 8129 8d 79 01 STA p_twinlaser4_x 1130 812c a2 00 LDX #0 1131 812e 8e 85 01 STX var69 1132 8131 a9 f6 LDA #246 1133 8133 8d 7d 01 STA p_twinlaser4_y 1134 8136 .L0135 ;; extra_shipX = 0 : extra_shipY = 0 : extra_shipFlag = 0 1135 8136 1136 8136 a9 00 LDA #0 1137 8138 8d 6b 01 STA extra_shipX 1138 813b 8d 6c 01 STA extra_shipY 1139 813e 8d 6d 01 STA extra_shipFlag 1140 8141 .L0136 ;; max_bullets = 10 : twinlaser_flag = 0 1141 8141 1142 8141 a9 0a LDA #10 1143 8143 8d 9b 01 STA max_bullets 1144 8146 a9 00 LDA #0 1145 8148 8d 8a 01 STA twinlaser_flag 1146 814b .L0137 ;; customTemp1 = 0 : customTemp2 = 0 : customTemp3 = 0 : customTemp4 = 0 1147 814b 1148 814b a9 00 LDA #0 1149 814d 8d 5f 01 STA customTemp1 1150 8150 8d 60 01 STA customTemp2 1151 8153 8d 61 01 STA customTemp3 1152 8156 8d 62 01 STA customTemp4 1153 8159 .L0138 ;; lives = 3 1154 8159 1155 8159 a9 03 LDA #3 1156 815b 8d 65 01 STA lives 1157 815e . 1158 815e ;; 1159 815e 1160 815e .L0139 ;; goto titlescreen 1161 815e 1162 815e 4c e0 8c jmp .titlescreen 1163 8161 1164 8161 .main 1165 8161 ;; main 1166 8161 1167 8161 .L0140 ;; frameCounter = frameCounter + 1 1168 8161 1169 8161 ad 40 01 LDA frameCounter 1170 8164 18 CLC 1171 8165 69 01 ADC #1 1172 8167 8d 40 01 STA frameCounter 1173 816a .L0141 ;; if frameCounter > 10 then frameCounter = 0 1174 816a 1175 816a a9 0a LDA #10 1176 816c cd 40 01 CMP frameCounter 1177 816f b0 05 BCS .skipL0141 1178 8171 .condpart0 1179 8171 a9 00 LDA #0 1180 8173 8d 40 01 STA frameCounter 1181 8176 .skipL0141 1182 8176 .mainloop 1183 8176 ;; mainloop 1184 8176 1185 8176 .L0142 ;; BACKGRND = $00 1186 8176 1187 8176 a9 00 LDA #$00 1188 8178 85 20 STA BACKGRND 1189 817a .L0143 ;; if switchreset then reboot 1190 817a 1191 817a 20 b1 f4 jsr checkresetswitch 1192 817d d0 03 BNE .skipL0143 1193 817f .condpart1 1194 817f 4c 9e f5 JMP START 1195 8182 .skipL0143 1196 8182 . 1197 8182 ;; 1198 8182 1199 8182 .L0144 ;; if joy0up && joyposup = - 2 then gosub Set_Bullet_home 1200 8182 1201 8182 a9 10 lda #$10 1202 8184 2c 80 02 bit SWCHA 1203 8187 d0 10 BNE .skipL0144 1204 8189 .condpart2 1205 8189 ; complex condition detected 1206 8189 a9 fe LDA #254 1207 818b 48 PHA 1208 818c ba TSX 1209 818d 68 PLA 1210 818e ad 44 01 LDA joyposup 1211 8191 dd 01 01 CMP $101,x 1212 8194 d0 03 BNE .skip2then 1213 8196 .condpart3 1214 8196 20 a8 84 jsr .Set_Bullet_home 1215 8199 1216 8199 .skip2then 1217 8199 .skipL0144 1218 8199 .L0145 ;; if joy0down && joyposdown = - 2 then gosub Set_Bullet_home 1219 8199 1220 8199 a9 20 lda #$20 1221 819b 2c 80 02 bit SWCHA 1222 819e d0 10 BNE .skipL0145 1223 81a0 .condpart4 1224 81a0 ; complex condition detected 1225 81a0 a9 fe LDA #254 1226 81a2 48 PHA 1227 81a3 ba TSX 1228 81a4 68 PLA 1229 81a5 ad 45 01 LDA joyposdown 1230 81a8 dd 01 01 CMP $101,x 1231 81ab d0 03 BNE .skip4then 1232 81ad .condpart5 1233 81ad 20 a8 84 jsr .Set_Bullet_home 1234 81b0 1235 81b0 .skip4then 1236 81b0 .skipL0145 1237 81b0 .L0146 ;; if joy0left && joyposleft = - 2 then gosub Set_Bullet_home 1238 81b0 1239 81b0 2c 80 02 bit SWCHA 1240 81b3 70 10 BVS .skipL0146 1241 81b5 .condpart6 1242 81b5 ; complex condition detected 1243 81b5 a9 fe LDA #254 1244 81b7 48 PHA 1245 81b8 ba TSX 1246 81b9 68 PLA 1247 81ba ad 46 01 LDA joyposleft 1248 81bd dd 01 01 CMP $101,x 1249 81c0 d0 03 BNE .skip6then 1250 81c2 .condpart7 1251 81c2 20 a8 84 jsr .Set_Bullet_home 1252 81c5 1253 81c5 .skip6then 1254 81c5 .skipL0146 1255 81c5 .L0147 ;; if joy0right && joyposright = - 2 then gosub Set_Bullet_home 1256 81c5 1257 81c5 2c 80 02 bit SWCHA 1258 81c8 30 10 BMI .skipL0147 1259 81ca .condpart8 1260 81ca ; complex condition detected 1261 81ca a9 fe LDA #254 1262 81cc 48 PHA 1263 81cd ba TSX 1264 81ce 68 PLA 1265 81cf ad 47 01 LDA joyposright 1266 81d2 dd 01 01 CMP $101,x 1267 81d5 d0 03 BNE .skip8then 1268 81d7 .condpart9 1269 81d7 20 a8 84 jsr .Set_Bullet_home 1270 81da 1271 81da .skip8then 1272 81da .skipL0147 1273 81da . 1274 81da ;; 1275 81da 1276 81da .L0148 ;; if joy0up then playerY = playerY - 1 : joyposup = 1 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 1277 81da 1278 81da a9 10 lda #$10 1279 81dc 2c 80 02 bit SWCHA 1280 81df d0 19 BNE .skipL0148 1281 81e1 .condpart10 1282 81e1 ad 42 01 LDA playerY 1283 81e4 38 SEC 1284 81e5 e9 01 SBC #1 1285 81e7 8d 42 01 STA playerY 1286 81ea a9 01 LDA #1 1287 81ec 8d 44 01 STA joyposup 1288 81ef a9 00 LDA #0 1289 81f1 8d 45 01 STA joyposdown 1290 81f4 8d 46 01 STA joyposleft 1291 81f7 8d 47 01 STA joyposright 1292 81fa .skipL0148 1293 81fa .L0149 ;; if joy0down then playerY = playerY + 1 : joyposup = 0 : joyposdown = 1 : joyposleft = 0 : joyposright = 0 1294 81fa 1295 81fa a9 20 lda #$20 1296 81fc 2c 80 02 bit SWCHA 1297 81ff d0 1b BNE .skipL0149 1298 8201 .condpart11 1299 8201 ad 42 01 LDA playerY 1300 8204 18 CLC 1301 8205 69 01 ADC #1 1302 8207 8d 42 01 STA playerY 1303 820a a9 00 LDA #0 1304 820c 8d 44 01 STA joyposup 1305 820f a9 01 LDA #1 1306 8211 8d 45 01 STA joyposdown 1307 8214 a9 00 LDA #0 1308 8216 8d 46 01 STA joyposleft 1309 8219 8d 47 01 STA joyposright 1310 821c .skipL0149 1311 821c .L0150 ;; if joy0left then playerX = playerX - 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 1 : joyposright = 0 1312 821c 1313 821c 2c 80 02 bit SWCHA 1314 821f 70 1b BVS .skipL0150 1315 8221 .condpart12 1316 8221 ad 41 01 LDA playerX 1317 8224 38 SEC 1318 8225 e9 01 SBC #1 1319 8227 8d 41 01 STA playerX 1320 822a a9 00 LDA #0 1321 822c 8d 44 01 STA joyposup 1322 822f 8d 45 01 STA joyposdown 1323 8232 a9 01 LDA #1 1324 8234 8d 46 01 STA joyposleft 1325 8237 a9 00 LDA #0 1326 8239 8d 47 01 STA joyposright 1327 823c .skipL0150 1328 823c .L0151 ;; if joy0right then playerX = playerX + 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 1 1329 823c 1330 823c 2c 80 02 bit SWCHA 1331 823f 30 19 BMI .skipL0151 1332 8241 .condpart13 1333 8241 ad 41 01 LDA playerX 1334 8244 18 CLC 1335 8245 69 01 ADC #1 1336 8247 8d 41 01 STA playerX 1337 824a a9 00 LDA #0 1338 824c 8d 44 01 STA joyposup 1339 824f 8d 45 01 STA joyposdown 1340 8252 8d 46 01 STA joyposleft 1341 8255 a9 01 LDA #1 1342 8257 8d 47 01 STA joyposright 1343 825a .skipL0151 1344 825a . 1345 825a ;; 1346 825a 1347 825a .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 1348 825a 1349 825a 2c 02 21 bit sINPT1 1350 825d 10 34 BPL .skipL0152 1351 825f .condpart14 1352 825f ad 44 01 LDA joyposup 1353 8262 c9 01 CMP #1 1354 8264 d0 2d BNE .skip14then 1355 8266 .condpart15 1356 8266 ad 45 01 LDA joyposdown 1357 8269 c9 01 CMP #1 1358 826b d0 26 BNE .skip15then 1359 826d .condpart16 1360 826d ad 46 01 LDA joyposleft 1361 8270 c9 01 CMP #1 1362 8272 d0 1f BNE .skip16then 1363 8274 .condpart17 1364 8274 ad 47 01 LDA joyposright 1365 8277 c9 01 CMP #1 1366 8279 d0 18 BNE .skip17then 1367 827b .condpart18 1368 827b 38 SEC 1369 827c e9 08 SBC #8 1370 827e 8d 4c 01 STA pBullet1_y 1371 8281 38 SEC 1372 8282 e9 08 SBC #8 1373 8284 8d 4d 01 STA pBullet2_y 1374 8287 38 SEC 1375 8288 e9 08 SBC #8 1376 828a 8d 4e 01 STA pBullet3_y 1377 828d 38 SEC 1378 828e e9 08 SBC #8 1379 8290 8d 4f 01 STA pBullet4_y 1380 8293 .skip17then 1381 8293 .skip16then 1382 8293 .skip15then 1383 8293 .skip14then 1384 8293 .skipL0152 1385 8293 .L0153 ;; if playerX > 152 then playerX = playerX - 1 1386 8293 1387 8293 a9 98 LDA #152 1388 8295 cd 41 01 CMP playerX 1389 8298 b0 09 BCS .skipL0153 1390 829a .condpart19 1391 829a ad 41 01 LDA playerX 1392 829d 38 SEC 1393 829e e9 01 SBC #1 1394 82a0 8d 41 01 STA playerX 1395 82a3 .skipL0153 1396 82a3 .L0154 ;; if playerX < 1 then playerX = playerX + 1 1397 82a3 1398 82a3 ad 41 01 LDA playerX 1399 82a6 c9 01 CMP #1 1400 82a8 b0 09 BCS .skipL0154 1401 82aa .condpart20 1402 82aa ad 41 01 LDA playerX 1403 82ad 18 CLC 1404 82ae 69 01 ADC #1 1405 82b0 8d 41 01 STA playerX 1406 82b3 .skipL0154 1407 82b3 .L0155 ;; if playerY > 177 then playerY = playerY - 1 1408 82b3 1409 82b3 a9 b1 LDA #177 1410 82b5 cd 42 01 CMP playerY 1411 82b8 b0 09 BCS .skipL0155 1412 82ba .condpart21 1413 82ba ad 42 01 LDA playerY 1414 82bd 38 SEC 1415 82be e9 01 SBC #1 1416 82c0 8d 42 01 STA playerY 1417 82c3 .skipL0155 1418 82c3 .L0156 ;; if playerY < 1 then playerY = playerY + 1 1419 82c3 1420 82c3 ad 42 01 LDA playerY 1421 82c6 c9 01 CMP #1 1422 82c8 b0 09 BCS .skipL0156 1423 82ca .condpart22 1424 82ca ad 42 01 LDA playerY 1425 82cd 18 CLC 1426 82ce 69 01 ADC #1 1427 82d0 8d 42 01 STA playerY 1428 82d3 .skipL0156 1429 82d3 . 1430 82d3 ;; 1431 82d3 1432 82d3 .L0157 ;; gosub check_collisions 1433 82d3 1434 82d3 20 e2 84 jsr .check_collisions 1435 82d6 1436 82d6 .L0158 ;; if isDead_flag then goto lose_a_life 1437 82d6 1438 82d6 ad 64 01 LDA isDead_flag 1439 82d9 f0 03 BEQ .skipL0158 1440 82db .condpart23 1441 82db 4c f9 8b jmp .lose_a_life 1442 82de 1443 82de .skipL0158 1444 82de . 1445 82de ;; 1446 82de 1447 82de .L0159 ;; if power_upX > 155 then power_upX = power_upX - 5 1448 82de 1449 82de a9 9b LDA #155 1450 82e0 cd 68 01 CMP power_upX 1451 82e3 b0 09 BCS .skipL0159 1452 82e5 .condpart24 1453 82e5 ad 68 01 LDA power_upX 1454 82e8 38 SEC 1455 82e9 e9 05 SBC #5 1456 82eb 8d 68 01 STA power_upX 1457 82ee .skipL0159 1458 82ee .L0160 ;; if power_upX < 1 then power_upX = power_upX + 5 1459 82ee 1460 82ee ad 68 01 LDA power_upX 1461 82f1 c9 01 CMP #1 1462 82f3 b0 09 BCS .skipL0160 1463 82f5 .condpart25 1464 82f5 ad 68 01 LDA power_upX 1465 82f8 18 CLC 1466 82f9 69 05 ADC #5 1467 82fb 8d 68 01 STA power_upX 1468 82fe .skipL0160 1469 82fe .L0161 ;; if power_upY > 191 then power_upY = power_upY - 5 1470 82fe 1471 82fe a9 bf LDA #191 1472 8300 cd 69 01 CMP power_upY 1473 8303 b0 09 BCS .skipL0161 1474 8305 .condpart26 1475 8305 ad 69 01 LDA power_upY 1476 8308 38 SEC 1477 8309 e9 05 SBC #5 1478 830b 8d 69 01 STA power_upY 1479 830e .skipL0161 1480 830e .L0162 ;; if power_upY < 1 then power_upY = power_upY + 5 1481 830e 1482 830e ad 69 01 LDA power_upY 1483 8311 c9 01 CMP #1 1484 8313 b0 09 BCS .skipL0162 1485 8315 .condpart27 1486 8315 ad 69 01 LDA power_upY 1487 8318 18 CLC 1488 8319 69 05 ADC #5 1489 831b 8d 69 01 STA power_upY 1490 831e .skipL0162 1491 831e .L0163 ;; if enemy01_xpos > 160 then enemy01_xpos = enemy01_xpos - 1 1492 831e 1493 831e a9 a0 LDA #160 1494 8320 cd 59 01 CMP enemy01_xpos 1495 8323 b0 09 BCS .skipL0163 1496 8325 .condpart28 1497 8325 ad 59 01 LDA enemy01_xpos 1498 8328 38 SEC 1499 8329 e9 01 SBC #1 1500 832b 8d 59 01 STA enemy01_xpos 1501 832e .skipL0163 1502 832e .L0164 ;; if enemy01_xpos < 1 then enemy01_xpos = enemy01_xpos + 1 1503 832e 1504 832e ad 59 01 LDA enemy01_xpos 1505 8331 c9 01 CMP #1 1506 8333 b0 09 BCS .skipL0164 1507 8335 .condpart29 1508 8335 ad 59 01 LDA enemy01_xpos 1509 8338 18 CLC 1510 8339 69 01 ADC #1 1511 833b 8d 59 01 STA enemy01_xpos 1512 833e .skipL0164 1513 833e .L0165 ;; if enemy01_ypos > 220 then enemy01_ypos = enemy01_ypos - 1 1514 833e 1515 833e a9 dc LDA #220 1516 8340 cd 5a 01 CMP enemy01_ypos 1517 8343 b0 09 BCS .skipL0165 1518 8345 .condpart30 1519 8345 ad 5a 01 LDA enemy01_ypos 1520 8348 38 SEC 1521 8349 e9 01 SBC #1 1522 834b 8d 5a 01 STA enemy01_ypos 1523 834e .skipL0165 1524 834e .L0166 ;; if enemy01_ypos < - 16 then enemy01_ypos = enemy01_ypos + 1 1525 834e 1526 834e ; complex condition detected 1527 834e a9 f0 LDA #240 1528 8350 48 PHA 1529 8351 ba TSX 1530 8352 68 PLA 1531 8353 ad 5a 01 LDA enemy01_ypos 1532 8356 dd 01 01 CMP $101,x 1533 8359 b0 09 BCS .skipL0166 1534 835b .condpart31 1535 835b ad 5a 01 LDA enemy01_ypos 1536 835e 18 CLC 1537 835f 69 01 ADC #1 1538 8361 8d 5a 01 STA enemy01_ypos 1539 8364 .skipL0166 1540 8364 .L0167 ;; if extra_shipX > 160 then extra_shipX = extra_shipX - 1 1541 8364 1542 8364 a9 a0 LDA #160 1543 8366 cd 6b 01 CMP extra_shipX 1544 8369 b0 09 BCS .skipL0167 1545 836b .condpart32 1546 836b ad 6b 01 LDA extra_shipX 1547 836e 38 SEC 1548 836f e9 01 SBC #1 1549 8371 8d 6b 01 STA extra_shipX 1550 8374 .skipL0167 1551 8374 .L0168 ;; if extra_shipX < 1 then extra_shipX = extra_shipX + 1 1552 8374 1553 8374 ad 6b 01 LDA extra_shipX 1554 8377 c9 01 CMP #1 1555 8379 b0 09 BCS .skipL0168 1556 837b .condpart33 1557 837b ad 6b 01 LDA extra_shipX 1558 837e 18 CLC 1559 837f 69 01 ADC #1 1560 8381 8d 6b 01 STA extra_shipX 1561 8384 .skipL0168 1562 8384 .L0169 ;; if extra_shipY > 191 then extra_shipY = extra_shipY - 1 1563 8384 1564 8384 a9 bf LDA #191 1565 8386 cd 6c 01 CMP extra_shipY 1566 8389 b0 09 BCS .skipL0169 1567 838b .condpart34 1568 838b ad 6c 01 LDA extra_shipY 1569 838e 38 SEC 1570 838f e9 01 SBC #1 1571 8391 8d 6c 01 STA extra_shipY 1572 8394 .skipL0169 1573 8394 .L0170 ;; if extra_shipY < 1 then extra_shipY = extra_shipY + 1 1574 8394 1575 8394 ad 6c 01 LDA extra_shipY 1576 8397 c9 01 CMP #1 1577 8399 b0 09 BCS .skipL0170 1578 839b .condpart35 1579 839b ad 6c 01 LDA extra_shipY 1580 839e 18 CLC 1581 839f 69 01 ADC #1 1582 83a1 8d 6c 01 STA extra_shipY 1583 83a4 .skipL0170 1584 83a4 . 1585 83a4 ;; 1586 83a4 1587 83a4 .L0171 ;; z = 15 1588 83a4 1589 83a4 a9 0f LDA #15 1590 83a6 85 ff STA z 1591 83a8 .despawn_Check 1592 83a8 ;; despawn_Check 1593 83a8 1594 83a8 .L0172 ;; if enemy_shot_xpos[z] > 160 || enemy_shot_ypos[z] > 192 then enemy_shot_active[z] = FALSE 1595 83a8 1596 83a8 a9 a0 LDA #160 1597 83aa a6 ff LDX z 1598 83ac dd 00 22 CMP enemy_shot_xpos,x 1599 83af b0 03 BCS .skipL0172 1600 83b1 .condpart36 1601 83b1 4c bd 83 jmp .condpart37 1602 83b4 .skipL0172 1603 83b4 a9 c0 LDA #192 1604 83b6 a6 ff LDX z 1605 83b8 dd 20 22 CMP enemy_shot_ypos,x 1606 83bb b0 07 BCS .skip8OR 1607 83bd .condpart37 1608 83bd a9 00 LDA #FALSE 1609 83bf a6 ff LDX z 1610 83c1 9d 80 22 STA enemy_shot_active,x 1611 83c4 .skip8OR 1612 83c4 .L0173 ;; z = z - 1 1613 83c4 1614 83c4 a5 ff LDA z 1615 83c6 38 SEC 1616 83c7 e9 01 SBC #1 1617 83c9 85 ff STA z 1618 83cb .L0174 ;; if z < 15 then goto despawn_Check 1619 83cb 1620 83cb a5 ff LDA z 1621 83cd c9 0f CMP #15 1622 83cf b0 03 BCS .skipL0174 1623 83d1 .condpart38 1624 83d1 4c a8 83 jmp .despawn_Check 1625 83d4 1626 83d4 .skipL0174 1627 83d4 . 1628 83d4 ;; 1629 83d4 1630 83d4 .L0175 ;; z = 15 1631 83d4 1632 83d4 a9 0f LDA #15 1633 83d6 85 ff STA z 1634 83d8 .plot_Bullet 1635 83d8 ;; plot_Bullet 1636 83d8 1637 83d8 .L0176 ;; x = enemy_shot_xpos[z] 1638 83d8 1639 83d8 a6 ff LDX z 1640 83da bd 00 22 LDA enemy_shot_xpos,x 1641 83dd 85 fd STA x 1642 83df .L0177 ;; y = enemy_shot_ypos[z] 1643 83df 1644 83df a6 ff LDX z 1645 83e1 bd 20 22 LDA enemy_shot_ypos,x 1646 83e4 85 fe STA y 1647 83e6 .L0178 ;; if enemy_shot_active = TRUE then plotsprite vertical_shooting_enemyshot 2 x y 1648 83e6 1649 83e6 ad 80 22 LDA enemy_shot_active 1650 83e9 c9 01 CMP #TRUE 1651 83eb d0 1b BNE .skipL0178 1652 83ed .condpart39 1653 83ed a9 32 lda #vertical_shooting_enemyshot 1657 83f3 85 43 sta temp2 1658 83f5 1659 83f5 a9 5f lda #(64|vertical_shooting_enemyshot_width_twoscompliment) 1660 83f7 85 44 sta temp3 1661 83f9 1662 83f9 a5 fd lda x 1663 83fb 85 45 sta temp4 1664 83fd 1665 83fd a5 fe lda y 1666 83ff 1667 83ff 85 46 sta temp5 1668 8401 1669 8401 a9 40 lda #(vertical_shooting_enemyshot_mode|%01000000) 1670 8403 85 47 sta temp6 1671 8405 1672 8405 20 bf f2 jsr plotsprite 1673 8408 .skipL0178 1674 8408 .L0179 ;; z = z - 1 1675 8408 1676 8408 a5 ff LDA z 1677 840a 38 SEC 1678 840b e9 01 SBC #1 1679 840d 85 ff STA z 1680 840f .L0180 ;; if z < 15 then goto plot_Bullet 1681 840f 1682 840f a5 ff LDA z 1683 8411 c9 0f CMP #15 1684 8413 b0 03 BCS .skipL0180 1685 8415 .condpart40 1686 8415 4c d8 83 jmp .plot_Bullet 1687 8418 1688 8418 .skipL0180 1689 8418 . 1690 8418 ;; 1691 8418 1692 8418 . 1693 8418 ;; 1694 8418 1695 8418 . 1696 8418 ;; 1697 8418 1698 8418 . 1699 8418 ;; 1700 8418 1701 8418 . 1702 8418 ;; 1703 8418 1704 8418 . 1705 8418 ;; 1706 8418 1707 8418 . 1708 8418 ;; 1709 8418 1710 8418 .L0181 ;; restorescreen 1711 8418 1712 8418 20 91 f0 jsr restorescreen 1713 841b .L0182 ;; gosub draw_player_bullets 1714 841b 1715 841b 20 aa 8b jsr .draw_player_bullets 1716 841e 1717 841e .L0183 ;; gosub draw_sprites 1718 841e 1719 841e 20 17 8e jsr .draw_sprites 1720 8421 1721 8421 .L0184 ;; gosub _draw_score 1722 8421 1723 8421 20 36 84 jsr ._draw_score 1724 8424 1725 8424 .L0185 ;; gosub check_firebutton 1726 8424 1727 8424 20 3d 8a jsr .check_firebutton 1728 8427 1729 8427 .L0186 ;; gosub move_bullets 1730 8427 1731 8427 20 e0 8a jsr .move_bullets 1732 842a 1733 842a .L0187 ;; gosub check_bullet_time 1734 842a 1735 842a 20 1e 8b jsr .check_bullet_time 1736 842d 1737 842d .L0188 ;; gosub check_bullet_boundary 1738 842d 1739 842d 20 54 8b jsr .check_bullet_boundary 1740 8430 1741 8430 . 1742 8430 ;; 1743 8430 1744 8430 .L0189 ;; drawscreen 1745 8430 1746 8430 20 b3 f0 jsr drawscreen 1747 8433 .L0190 ;; goto mainloop 1748 8433 1749 8433 4c 76 81 jmp .mainloop 1750 8436 1751 8436 . 1752 8436 ;; 1753 8436 1754 8436 . 1755 8436 ;; 1756 8436 1757 8436 . 1758 8436 ;; 1759 8436 1760 8436 . 1761 8436 ;; 1762 8436 1763 8436 ._draw_score 1764 8436 ;; _draw_score 1765 8436 1766 8436 .L0191 ;; plotvalue vertical_shooting_font 0 score0 6 25 1 1767 8436 1768 8436 a9 00 lda #vertical_shooting_font 1772 843c 85 43 sta temp2 1773 843e 1774 843e ad 06 21 lda charactermode 1775 8441 85 4a sta temp9 1776 8443 a9 60 lda #(vertical_shooting_font_mode | %01100000) 1777 8445 8d 06 21 sta charactermode 1778 8448 a9 1a lda #26 ; width in two's complement 1779 844a 09 00 ora #0 ; palette left shifted 5 bits 1780 844c 85 44 sta temp3 1781 844e a9 19 lda #25 1782 8450 85 45 sta temp4 1783 8452 1784 8452 a9 01 lda #1 1785 8454 85 46 sta temp5 1786 8456 1787 8456 a9 06 lda #6 1788 8458 85 47 sta temp6 1789 845a 1790 845a a9 a6 lda #score0 1794 8460 85 49 sta temp8 1795 8462 1796 8462 20 ad f3 jsr plotvalue 1797 8462 00 01 USED_PLOTVALUE = 1 1798 8465 a5 4a lda temp9 1799 8467 8d 06 21 sta charactermode 1800 846a .L0192 ;; plotvalue vertical_shooting_font 0 lives 1 153 1 1801 846a 1802 846a a9 00 lda #vertical_shooting_font 1806 8470 85 43 sta temp2 1807 8472 1808 8472 ad 06 21 lda charactermode 1809 8475 85 4a sta temp9 1810 8477 a9 60 lda #(vertical_shooting_font_mode | %01100000) 1811 8479 8d 06 21 sta charactermode 1812 847c a9 1f lda #31 ; width in two's complement 1813 847e 09 00 ora #0 ; palette left shifted 5 bits 1814 8480 85 44 sta temp3 1815 8482 a9 99 lda #153 1816 8484 85 45 sta temp4 1817 8486 1818 8486 a9 01 lda #1 1819 8488 85 46 sta temp5 1820 848a 1821 848a a9 01 lda #1 1822 848c 85 47 sta temp6 1823 848e 1824 848e a9 65 lda #lives 1828 8494 85 49 sta temp8 1829 8496 1830 8496 20 ad f3 jsr plotvalue 1831 8496 00 01 USED_PLOTVALUE = 1 1832 8499 a5 4a lda temp9 1833 849b 8d 06 21 sta charactermode 1834 849e .L0193 ;; return 1835 849e 1836 849e ba tsx 1837 849f bd 02 01 lda $102,x 1838 84a2 f0 01 beq bankswitchret1 1839 84a4 60 RTS 1840 84a5 bankswitchret1 1841 84a5 4c 9e f4 JMP BS_return 1842 84a8 . 1843 84a8 ;; 1844 84a8 1845 84a8 .Set_Bullet_home 1846 84a8 ;; Set_Bullet_home 1847 84a8 1848 84a8 .L0194 ;; pBullet1_x = playerX - 8 : pBullet1_y = playerY - 4 1849 84a8 1850 84a8 38 SEC 1851 84a9 e9 08 SBC #8 1852 84ab 8d 48 01 STA pBullet1_x 1853 84ae 38 SEC 1854 84af e9 04 SBC #4 1855 84b1 8d 4c 01 STA pBullet1_y 1856 84b4 .L0195 ;; pBullet2_x = playerX - 8 : pBullet2_y = playerY - 4 1857 84b4 1858 84b4 38 SEC 1859 84b5 e9 08 SBC #8 1860 84b7 8d 49 01 STA pBullet2_x 1861 84ba 38 SEC 1862 84bb e9 04 SBC #4 1863 84bd 8d 4d 01 STA pBullet2_y 1864 84c0 .L0196 ;; pBullet3_x = playerX - 8 : pBullet3_y = playerY - 4 1865 84c0 1866 84c0 38 SEC 1867 84c1 e9 08 SBC #8 1868 84c3 8d 4a 01 STA pBullet3_x 1869 84c6 38 SEC 1870 84c7 e9 04 SBC #4 1871 84c9 8d 4e 01 STA pBullet3_y 1872 84cc .L0197 ;; pBullet4_x = playerX - 8 : pBullet4_y = playerY - 4 1873 84cc 1874 84cc 38 SEC 1875 84cd e9 08 SBC #8 1876 84cf 8d 4b 01 STA pBullet4_x 1877 84d2 38 SEC 1878 84d3 e9 04 SBC #4 1879 84d5 8d 4f 01 STA pBullet4_y 1880 84d8 .L0198 ;; return 1881 84d8 1882 84d8 ba tsx 1883 84d9 bd 02 01 lda $102,x 1884 84dc f0 01 beq bankswitchret2 1885 84de 60 RTS 1886 84df bankswitchret2 1887 84df 4c 9e f4 JMP BS_return 1888 84e2 . 1889 84e2 ;; 1890 84e2 1891 84e2 .check_collisions 1892 84e2 ;; check_collisions 1893 84e2 1894 84e2 .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 1895 84e2 1896 84e2 1897 84e2 18 clc ; one clc only. If we overflow we're screwed anyway. 1898 84e3 a0 07 ldy #(8-1) 1899 84e5 84 44 sty temp3 1900 84e7 a0 0f ldy #(16-1) 1901 84e9 84 45 sty temp4 1902 84eb ad 00 22 lda enemy_shot_xpos 1903 84ee 69 30 adc #48 1904 84f0 85 46 sta temp5 1905 84f2 ad 20 22 lda enemy_shot_ypos 1906 84f5 69 20 adc #((256-WSCREENHEIGHT)/2) 1907 84f7 85 47 sta temp6 1908 84f9 a0 03 ldy #(4-1) 1909 84fb 84 48 sty temp7 1910 84fd a0 07 ldy #(8-1) 1911 84ff 84 49 sty temp8 1912 8501 ad 42 01 lda playerY 1913 8504 69 20 adc #((256-WSCREENHEIGHT)/2) 1914 8506 a8 tay 1915 8507 ad 41 01 lda playerX 1916 850a 69 30 adc #48 1917 850c 20 f5 f3 jsr boxcollision 1918 850f 1919 850f 90 3c BCC .skipL0199 1920 8511 .condpart41 1921 8511 a9 c8 LDA #200 1922 8513 8d 00 22 STA enemy_shot_xpos 1923 8516 8d 20 22 STA enemy_shot_ypos 1924 8519 a9 01 LDA #1 1925 851b 8d 5b 01 STA player_flag 1926 851e ad 65 01 LDA lives 1927 8521 38 SEC 1928 8522 e9 00 SBC #0 1929 8524 8d 65 01 STA lives 1930 8527 ifnconst NOTIALOCKMUTE 1931 8527 a9 01 lda #1 1932 8529 85 de sta sfxschedulelock 1933 852b a9 7d lda #sfx_explosion 1936 8531 85 e1 sta sfxinstrumenthi 1937 8533 a9 00 lda #0 1938 8535 85 e2 sta sfxpitchoffset ; no pitch modification 1939 8537 85 e3 sta sfxnoteindex ; not a musical note 1940 8539 20 77 f2 jsr schedulesfx 1941 853c a9 00 lda #0 1942 853e 85 de sta sfxschedulelock 1943 8540 endif ; NOTIALOCKMUTE 1944 8540 a9 00 LDA #0 1945 8542 8d 6e 01 STA explosion_aniframe 1946 8545 a9 01 LDA #1 1947 8547 8d 64 01 STA isDead_flag 1948 854a 4c 29 8a jmp ._checkCollisionsExit 1949 854d 1950 854d .skipL0199 1951 854d .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 1952 854d 1953 854d 1954 854d 18 clc ; one clc only. If we overflow we're screwed anyway. 1955 854e a0 07 ldy #(8-1) 1956 8550 84 44 sty temp3 1957 8552 a0 0f ldy #(16-1) 1958 8554 84 45 sty temp4 1959 8556 ad 68 01 lda power_upX 1960 8559 69 30 adc #48 1961 855b 85 46 sta temp5 1962 855d ad 69 01 lda power_upY 1963 8560 69 20 adc #((256-WSCREENHEIGHT)/2) 1964 8562 85 47 sta temp6 1965 8564 a0 07 ldy #(8-1) 1966 8566 84 48 sty temp7 1967 8568 a0 07 ldy #(8-1) 1968 856a 84 49 sty temp8 1969 856c ad 42 01 lda playerY 1970 856f 69 20 adc #((256-WSCREENHEIGHT)/2) 1971 8571 a8 tay 1972 8572 ad 41 01 lda playerX 1973 8575 69 30 adc #48 1974 8577 20 f5 f3 jsr boxcollision 1975 857a 1976 857a 90 47 BCC .skipL0200 1977 857c .condpart42 1978 857c a9 d0 LDA #208 1979 857e 8d 68 01 STA power_upX 1980 8581 8d 69 01 STA power_upY 1981 8584 a9 01 LDA #1 1982 8586 8d 5b 01 STA player_flag 1983 8589 8d 6a 01 STA power_up_Flag 1984 858c ifnconst NOTIALOCKMUTE 1985 858c a9 01 lda #1 1986 858e 85 de sta sfxschedulelock 1987 8590 a9 ba lda #sfx_bling 1990 8596 85 e1 sta sfxinstrumenthi 1991 8598 a9 00 lda #0 1992 859a 85 e2 sta sfxpitchoffset ; no pitch modification 1993 859c 85 e3 sta sfxnoteindex ; not a musical note 1994 859e 20 77 f2 jsr schedulesfx 1995 85a1 a9 00 lda #0 1996 85a3 85 de sta sfxschedulelock 1997 85a5 endif ; NOTIALOCKMUTE 1998 85a5 f8 SED 1999 85a6 18 CLC 2000 85a7 ad a8 01 LDA score0+2 2001 85aa 69 01 ADC #$01 2002 85ac 8d a8 01 STA score0+2 2003 85af ad a7 01 LDA score0+1 2004 85b2 69 00 ADC #$00 2005 85b4 8d a7 01 STA score0+1 2006 85b7 ad a6 01 LDA score0 2007 85ba 69 00 ADC #$00 2008 85bc 8d a6 01 STA score0 2009 85bf d8 CLD 2010 85c0 20 01 8e jsr .power_up_obtained 2011 85c3 2012 85c3 .skipL0200 2013 85c3 .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 2014 85c3 2015 85c3 2016 85c3 18 clc ; one clc only. If we overflow we're screwed anyway. 2017 85c4 a0 03 ldy #(4-1) 2018 85c6 84 44 sty temp3 2019 85c8 a0 07 ldy #(8-1) 2020 85ca 84 45 sty temp4 2021 85cc ad 59 01 lda enemy01_xpos 2022 85cf 69 30 adc #48 2023 85d1 85 46 sta temp5 2024 85d3 ad 5a 01 lda enemy01_ypos 2025 85d6 69 20 adc #((256-WSCREENHEIGHT)/2) 2026 85d8 85 47 sta temp6 2027 85da a0 07 ldy #(8-1) 2028 85dc 84 48 sty temp7 2029 85de a0 0f ldy #(16-1) 2030 85e0 84 49 sty temp8 2031 85e2 ad 4c 01 lda pBullet1_y 2032 85e5 69 20 adc #((256-WSCREENHEIGHT)/2) 2033 85e7 a8 tay 2034 85e8 ad 48 01 lda pBullet1_x 2035 85eb 69 30 adc #48 2036 85ed 20 f5 f3 jsr boxcollision 2037 85f0 2038 85f0 90 41 BCC .skipL0201 2039 85f2 .condpart43 2040 85f2 a9 00 LDA #0 2041 85f4 8d 50 01 STA var16 2042 85f7 a9 c8 LDA #200 2043 85f9 8d 48 01 STA pBullet1_x 2044 85fc a2 00 LDX #0 2045 85fe 8e 54 01 STX var20 2046 8601 a9 f6 LDA #246 2047 8603 8d 4c 01 STA pBullet1_y 2048 8606 a9 d0 LDA #208 2049 8608 8d 59 01 STA enemy01_xpos 2050 860b a9 c8 LDA #200 2051 860d 8d 5a 01 STA enemy01_ypos 2052 8610 a9 01 LDA #1 2053 8612 8d 5c 01 STA enemy01_Flag 2054 8615 a9 00 LDA #0 2055 8617 8d 6e 01 STA explosion_aniframe 2056 861a ifnconst NOTIALOCKMUTE 2057 861a a9 01 lda #1 2058 861c 85 de sta sfxschedulelock 2059 861e a9 7d lda #sfx_explosion 2062 8624 85 e1 sta sfxinstrumenthi 2063 8626 a9 00 lda #0 2064 8628 85 e2 sta sfxpitchoffset ; no pitch modification 2065 862a 85 e3 sta sfxnoteindex ; not a musical note 2066 862c 20 77 f2 jsr schedulesfx 2067 862f a9 00 lda #0 2068 8631 85 de sta sfxschedulelock 2069 8633 endif ; NOTIALOCKMUTE 2070 8633 .skipL0201 2071 8633 .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 2072 8633 2073 8633 2074 8633 18 clc ; one clc only. If we overflow we're screwed anyway. 2075 8634 a0 03 ldy #(4-1) 2076 8636 84 44 sty temp3 2077 8638 a0 07 ldy #(8-1) 2078 863a 84 45 sty temp4 2079 863c ad 59 01 lda enemy01_xpos 2080 863f 69 30 adc #48 2081 8641 85 46 sta temp5 2082 8643 ad 5a 01 lda enemy01_ypos 2083 8646 69 20 adc #((256-WSCREENHEIGHT)/2) 2084 8648 85 47 sta temp6 2085 864a a0 07 ldy #(8-1) 2086 864c 84 48 sty temp7 2087 864e a0 0f ldy #(16-1) 2088 8650 84 49 sty temp8 2089 8652 ad 4d 01 lda pBullet2_y 2090 8655 69 20 adc #((256-WSCREENHEIGHT)/2) 2091 8657 a8 tay 2092 8658 ad 49 01 lda pBullet2_x 2093 865b 69 30 adc #48 2094 865d 20 f5 f3 jsr boxcollision 2095 8660 2096 8660 90 41 BCC .skipL0202 2097 8662 .condpart44 2098 8662 a9 00 LDA #0 2099 8664 8d 51 01 STA var17 2100 8667 a9 c8 LDA #200 2101 8669 8d 49 01 STA pBullet2_x 2102 866c a2 00 LDX #0 2103 866e 8e 55 01 STX var21 2104 8671 a9 f6 LDA #246 2105 8673 8d 4d 01 STA pBullet2_y 2106 8676 a9 d0 LDA #208 2107 8678 8d 59 01 STA enemy01_xpos 2108 867b a9 c8 LDA #200 2109 867d 8d 5a 01 STA enemy01_ypos 2110 8680 a9 01 LDA #1 2111 8682 8d 5c 01 STA enemy01_Flag 2112 8685 a9 00 LDA #0 2113 8687 8d 6e 01 STA explosion_aniframe 2114 868a ifnconst NOTIALOCKMUTE 2115 868a a9 01 lda #1 2116 868c 85 de sta sfxschedulelock 2117 868e a9 7d lda #sfx_explosion 2120 8694 85 e1 sta sfxinstrumenthi 2121 8696 a9 00 lda #0 2122 8698 85 e2 sta sfxpitchoffset ; no pitch modification 2123 869a 85 e3 sta sfxnoteindex ; not a musical note 2124 869c 20 77 f2 jsr schedulesfx 2125 869f a9 00 lda #0 2126 86a1 85 de sta sfxschedulelock 2127 86a3 endif ; NOTIALOCKMUTE 2128 86a3 .skipL0202 2129 86a3 .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 2130 86a3 2131 86a3 2132 86a3 18 clc ; one clc only. If we overflow we're screwed anyway. 2133 86a4 a0 03 ldy #(4-1) 2134 86a6 84 44 sty temp3 2135 86a8 a0 07 ldy #(8-1) 2136 86aa 84 45 sty temp4 2137 86ac ad 59 01 lda enemy01_xpos 2138 86af 69 30 adc #48 2139 86b1 85 46 sta temp5 2140 86b3 ad 5a 01 lda enemy01_ypos 2141 86b6 69 20 adc #((256-WSCREENHEIGHT)/2) 2142 86b8 85 47 sta temp6 2143 86ba a0 07 ldy #(8-1) 2144 86bc 84 48 sty temp7 2145 86be a0 0f ldy #(16-1) 2146 86c0 84 49 sty temp8 2147 86c2 ad 4e 01 lda pBullet3_y 2148 86c5 69 20 adc #((256-WSCREENHEIGHT)/2) 2149 86c7 a8 tay 2150 86c8 ad 4a 01 lda pBullet3_x 2151 86cb 69 30 adc #48 2152 86cd 20 f5 f3 jsr boxcollision 2153 86d0 2154 86d0 90 41 BCC .skipL0203 2155 86d2 .condpart45 2156 86d2 a9 00 LDA #0 2157 86d4 8d 52 01 STA var18 2158 86d7 a9 c8 LDA #200 2159 86d9 8d 4a 01 STA pBullet3_x 2160 86dc a2 00 LDX #0 2161 86de 8e 56 01 STX var22 2162 86e1 a9 f6 LDA #246 2163 86e3 8d 4e 01 STA pBullet3_y 2164 86e6 a9 d0 LDA #208 2165 86e8 8d 59 01 STA enemy01_xpos 2166 86eb a9 c8 LDA #200 2167 86ed 8d 5a 01 STA enemy01_ypos 2168 86f0 a9 01 LDA #1 2169 86f2 8d 5c 01 STA enemy01_Flag 2170 86f5 a9 00 LDA #0 2171 86f7 8d 6e 01 STA explosion_aniframe 2172 86fa ifnconst NOTIALOCKMUTE 2173 86fa a9 01 lda #1 2174 86fc 85 de sta sfxschedulelock 2175 86fe a9 7d lda #sfx_explosion 2178 8704 85 e1 sta sfxinstrumenthi 2179 8706 a9 00 lda #0 2180 8708 85 e2 sta sfxpitchoffset ; no pitch modification 2181 870a 85 e3 sta sfxnoteindex ; not a musical note 2182 870c 20 77 f2 jsr schedulesfx 2183 870f a9 00 lda #0 2184 8711 85 de sta sfxschedulelock 2185 8713 endif ; NOTIALOCKMUTE 2186 8713 .skipL0203 2187 8713 .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 2188 8713 2189 8713 2190 8713 18 clc ; one clc only. If we overflow we're screwed anyway. 2191 8714 a0 03 ldy #(4-1) 2192 8716 84 44 sty temp3 2193 8718 a0 07 ldy #(8-1) 2194 871a 84 45 sty temp4 2195 871c ad 59 01 lda enemy01_xpos 2196 871f 69 30 adc #48 2197 8721 85 46 sta temp5 2198 8723 ad 5a 01 lda enemy01_ypos 2199 8726 69 20 adc #((256-WSCREENHEIGHT)/2) 2200 8728 85 47 sta temp6 2201 872a a0 07 ldy #(8-1) 2202 872c 84 48 sty temp7 2203 872e a0 0f ldy #(16-1) 2204 8730 84 49 sty temp8 2205 8732 ad 4f 01 lda pBullet4_y 2206 8735 69 20 adc #((256-WSCREENHEIGHT)/2) 2207 8737 a8 tay 2208 8738 ad 4b 01 lda pBullet4_x 2209 873b 69 30 adc #48 2210 873d 20 f5 f3 jsr boxcollision 2211 8740 2212 8740 90 41 BCC .skipL0204 2213 8742 .condpart46 2214 8742 a9 00 LDA #0 2215 8744 8d 53 01 STA var19 2216 8747 a9 c8 LDA #200 2217 8749 8d 4b 01 STA pBullet4_x 2218 874c a2 00 LDX #0 2219 874e 8e 57 01 STX var23 2220 8751 a9 f6 LDA #246 2221 8753 8d 4f 01 STA pBullet4_y 2222 8756 a9 d0 LDA #208 2223 8758 8d 59 01 STA enemy01_xpos 2224 875b a9 c8 LDA #200 2225 875d 8d 5a 01 STA enemy01_ypos 2226 8760 a9 01 LDA #1 2227 8762 8d 5c 01 STA enemy01_Flag 2228 8765 a9 00 LDA #0 2229 8767 8d 6e 01 STA explosion_aniframe 2230 876a ifnconst NOTIALOCKMUTE 2231 876a a9 01 lda #1 2232 876c 85 de sta sfxschedulelock 2233 876e a9 7d lda #sfx_explosion 2236 8774 85 e1 sta sfxinstrumenthi 2237 8776 a9 00 lda #0 2238 8778 85 e2 sta sfxpitchoffset ; no pitch modification 2239 877a 85 e3 sta sfxnoteindex ; not a musical note 2240 877c 20 77 f2 jsr schedulesfx 2241 877f a9 00 lda #0 2242 8781 85 de sta sfxschedulelock 2243 8783 endif ; NOTIALOCKMUTE 2244 8783 .skipL0204 2245 8783 .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 2246 8783 2247 8783 2248 8783 18 clc ; one clc only. If we overflow we're screwed anyway. 2249 8784 a0 07 ldy #(8-1) 2250 8786 84 44 sty temp3 2251 8788 a0 0f ldy #(16-1) 2252 878a 84 45 sty temp4 2253 878c ad 6b 01 lda extra_shipX 2254 878f 69 30 adc #48 2255 8791 85 46 sta temp5 2256 8793 ad 6c 01 lda extra_shipY 2257 8796 69 20 adc #((256-WSCREENHEIGHT)/2) 2258 8798 85 47 sta temp6 2259 879a a0 07 ldy #(8-1) 2260 879c 84 48 sty temp7 2261 879e a0 07 ldy #(8-1) 2262 87a0 84 49 sty temp8 2263 87a2 ad 42 01 lda playerY 2264 87a5 69 20 adc #((256-WSCREENHEIGHT)/2) 2265 87a7 a8 tay 2266 87a8 ad 41 01 lda playerX 2267 87ab 69 30 adc #48 2268 87ad 20 f5 f3 jsr boxcollision 2269 87b0 2270 87b0 90 2f BCC .skipL0205 2271 87b2 .condpart47 2272 87b2 a9 d0 LDA #208 2273 87b4 8d 6b 01 STA extra_shipX 2274 87b7 8d 6c 01 STA extra_shipY 2275 87ba a9 01 LDA #1 2276 87bc 8d 6d 01 STA extra_shipFlag 2277 87bf ifnconst NOTIALOCKMUTE 2278 87bf a9 01 lda #1 2279 87c1 85 de sta sfxschedulelock 2280 87c3 a9 ba lda #sfx_bling 2283 87c9 85 e1 sta sfxinstrumenthi 2284 87cb a9 00 lda #0 2285 87cd 85 e2 sta sfxpitchoffset ; no pitch modification 2286 87cf 85 e3 sta sfxnoteindex ; not a musical note 2287 87d1 20 77 f2 jsr schedulesfx 2288 87d4 a9 00 lda #0 2289 87d6 85 de sta sfxschedulelock 2290 87d8 endif ; NOTIALOCKMUTE 2291 87d8 ad 65 01 LDA lives 2292 87db 18 CLC 2293 87dc 69 01 ADC #1 2294 87de 8d 65 01 STA lives 2295 87e1 .skipL0205 2296 87e1 .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 2297 87e1 2298 87e1 2299 87e1 18 clc ; one clc only. If we overflow we're screwed anyway. 2300 87e2 a0 07 ldy #(8-1) 2301 87e4 84 44 sty temp3 2302 87e6 a0 0f ldy #(16-1) 2303 87e8 84 45 sty temp4 2304 87ea ad 59 01 lda enemy01_xpos 2305 87ed 69 30 adc #48 2306 87ef 85 46 sta temp5 2307 87f1 ad 5a 01 lda enemy01_ypos 2308 87f4 69 20 adc #((256-WSCREENHEIGHT)/2) 2309 87f6 85 47 sta temp6 2310 87f8 a0 07 ldy #(8-1) 2311 87fa 84 48 sty temp7 2312 87fc a0 0f ldy #(16-1) 2313 87fe 84 49 sty temp8 2314 8800 ad 7a 01 lda p_twinlaser1_y 2315 8803 69 20 adc #((256-WSCREENHEIGHT)/2) 2316 8805 a8 tay 2317 8806 ad 76 01 lda p_twinlaser1_x 2318 8809 69 30 adc #48 2319 880b 20 f5 f3 jsr boxcollision 2320 880e 2321 880e 90 41 BCC .skipL0206 2322 8810 .condpart48 2323 8810 a9 00 LDA #0 2324 8812 8d 7e 01 STA var62 2325 8815 a9 c8 LDA #200 2326 8817 8d 76 01 STA p_twinlaser1_x 2327 881a a2 00 LDX #0 2328 881c 8e 82 01 STX var66 2329 881f a9 f6 LDA #246 2330 8821 8d 7a 01 STA p_twinlaser1_y 2331 8824 a9 d0 LDA #208 2332 8826 8d 59 01 STA enemy01_xpos 2333 8829 a9 c8 LDA #200 2334 882b 8d 5a 01 STA enemy01_ypos 2335 882e a9 01 LDA #1 2336 8830 8d 5c 01 STA enemy01_Flag 2337 8833 a9 00 LDA #0 2338 8835 8d 6e 01 STA explosion_aniframe 2339 8838 ifnconst NOTIALOCKMUTE 2340 8838 a9 01 lda #1 2341 883a 85 de sta sfxschedulelock 2342 883c a9 7d lda #sfx_explosion 2345 8842 85 e1 sta sfxinstrumenthi 2346 8844 a9 00 lda #0 2347 8846 85 e2 sta sfxpitchoffset ; no pitch modification 2348 8848 85 e3 sta sfxnoteindex ; not a musical note 2349 884a 20 77 f2 jsr schedulesfx 2350 884d a9 00 lda #0 2351 884f 85 de sta sfxschedulelock 2352 8851 endif ; NOTIALOCKMUTE 2353 8851 .skipL0206 2354 8851 .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 2355 8851 2356 8851 ad 59 01 LDA enemy01_xpos 2357 8854 cd 48 01 CMP pBullet1_x 2358 8857 b0 57 BCS .skipL0207 2359 8859 .condpart49 2360 8859 ad 48 01 LDA pBullet1_x 2361 885c cd 5f 01 CMP customTemp1 2362 885f b0 4f BCS .skip49then 2363 8861 .condpart50 2364 8861 ad 5a 01 LDA enemy01_ypos 2365 8864 cd 4c 01 CMP pBullet1_y 2366 8867 b0 47 BCS .skip50then 2367 8869 .condpart51 2368 8869 ad 4c 01 LDA pBullet1_y 2369 886c cd 60 01 CMP customTemp2 2370 886f b0 3f BCS .skip51then 2371 8871 .condpart52 2372 8871 a9 01 LDA #1 2373 8873 8d 5c 01 STA enemy01_Flag 2374 8876 8d 6e 01 STA explosion_aniframe 2375 8879 f8 SED 2376 887a 18 CLC 2377 887b ad a8 01 LDA score0+2 2378 887e 69 01 ADC #$01 2379 8880 8d a8 01 STA score0+2 2380 8883 ad a7 01 LDA score0+1 2381 8886 69 00 ADC #$00 2382 8888 8d a7 01 STA score0+1 2383 888b ad a6 01 LDA score0 2384 888e 69 00 ADC #$00 2385 8890 8d a6 01 STA score0 2386 8893 d8 CLD 2387 8894 ifnconst NOTIALOCKMUTE 2388 8894 a9 01 lda #1 2389 8896 85 de sta sfxschedulelock 2390 8898 a9 7d lda #sfx_explosion 2393 889e 85 e1 sta sfxinstrumenthi 2394 88a0 a9 00 lda #0 2395 88a2 85 e2 sta sfxpitchoffset ; no pitch modification 2396 88a4 85 e3 sta sfxnoteindex ; not a musical note 2397 88a6 20 77 f2 jsr schedulesfx 2398 88a9 a9 00 lda #0 2399 88ab 85 de sta sfxschedulelock 2400 88ad endif ; NOTIALOCKMUTE 2401 88ad 4c 33 8a jmp .collisions_done 2402 88b0 2403 88b0 .skip51then 2404 88b0 .skip50then 2405 88b0 .skip49then 2406 88b0 .skipL0207 2407 88b0 .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 2408 88b0 2409 88b0 ad 59 01 LDA enemy01_xpos 2410 88b3 cd 49 01 CMP pBullet2_x 2411 88b6 b0 57 BCS .skipL0208 2412 88b8 .condpart53 2413 88b8 ad 49 01 LDA pBullet2_x 2414 88bb cd 5f 01 CMP customTemp1 2415 88be b0 4f BCS .skip53then 2416 88c0 .condpart54 2417 88c0 ad 5a 01 LDA enemy01_ypos 2418 88c3 cd 4d 01 CMP pBullet2_y 2419 88c6 b0 47 BCS .skip54then 2420 88c8 .condpart55 2421 88c8 ad 4d 01 LDA pBullet2_y 2422 88cb cd 60 01 CMP customTemp2 2423 88ce b0 3f BCS .skip55then 2424 88d0 .condpart56 2425 88d0 a9 01 LDA #1 2426 88d2 8d 5c 01 STA enemy01_Flag 2427 88d5 8d 6e 01 STA explosion_aniframe 2428 88d8 f8 SED 2429 88d9 18 CLC 2430 88da ad a8 01 LDA score0+2 2431 88dd 69 01 ADC #$01 2432 88df 8d a8 01 STA score0+2 2433 88e2 ad a7 01 LDA score0+1 2434 88e5 69 00 ADC #$00 2435 88e7 8d a7 01 STA score0+1 2436 88ea ad a6 01 LDA score0 2437 88ed 69 00 ADC #$00 2438 88ef 8d a6 01 STA score0 2439 88f2 d8 CLD 2440 88f3 ifnconst NOTIALOCKMUTE 2441 88f3 a9 01 lda #1 2442 88f5 85 de sta sfxschedulelock 2443 88f7 a9 7d lda #sfx_explosion 2446 88fd 85 e1 sta sfxinstrumenthi 2447 88ff a9 00 lda #0 2448 8901 85 e2 sta sfxpitchoffset ; no pitch modification 2449 8903 85 e3 sta sfxnoteindex ; not a musical note 2450 8905 20 77 f2 jsr schedulesfx 2451 8908 a9 00 lda #0 2452 890a 85 de sta sfxschedulelock 2453 890c endif ; NOTIALOCKMUTE 2454 890c 4c 33 8a jmp .collisions_done 2455 890f 2456 890f .skip55then 2457 890f .skip54then 2458 890f .skip53then 2459 890f .skipL0208 2460 890f .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 2461 890f 2462 890f ad 59 01 LDA enemy01_xpos 2463 8912 cd 4a 01 CMP pBullet3_x 2464 8915 b0 57 BCS .skipL0209 2465 8917 .condpart57 2466 8917 ad 4a 01 LDA pBullet3_x 2467 891a cd 5f 01 CMP customTemp1 2468 891d b0 4f BCS .skip57then 2469 891f .condpart58 2470 891f ad 5a 01 LDA enemy01_ypos 2471 8922 cd 4e 01 CMP pBullet3_y 2472 8925 b0 47 BCS .skip58then 2473 8927 .condpart59 2474 8927 ad 4e 01 LDA pBullet3_y 2475 892a cd 60 01 CMP customTemp2 2476 892d b0 3f BCS .skip59then 2477 892f .condpart60 2478 892f a9 01 LDA #1 2479 8931 8d 5c 01 STA enemy01_Flag 2480 8934 8d 6e 01 STA explosion_aniframe 2481 8937 f8 SED 2482 8938 18 CLC 2483 8939 ad a8 01 LDA score0+2 2484 893c 69 01 ADC #$01 2485 893e 8d a8 01 STA score0+2 2486 8941 ad a7 01 LDA score0+1 2487 8944 69 00 ADC #$00 2488 8946 8d a7 01 STA score0+1 2489 8949 ad a6 01 LDA score0 2490 894c 69 00 ADC #$00 2491 894e 8d a6 01 STA score0 2492 8951 d8 CLD 2493 8952 ifnconst NOTIALOCKMUTE 2494 8952 a9 01 lda #1 2495 8954 85 de sta sfxschedulelock 2496 8956 a9 7d lda #sfx_explosion 2499 895c 85 e1 sta sfxinstrumenthi 2500 895e a9 00 lda #0 2501 8960 85 e2 sta sfxpitchoffset ; no pitch modification 2502 8962 85 e3 sta sfxnoteindex ; not a musical note 2503 8964 20 77 f2 jsr schedulesfx 2504 8967 a9 00 lda #0 2505 8969 85 de sta sfxschedulelock 2506 896b endif ; NOTIALOCKMUTE 2507 896b 4c 33 8a jmp .collisions_done 2508 896e 2509 896e .skip59then 2510 896e .skip58then 2511 896e .skip57then 2512 896e .skipL0209 2513 896e .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 2514 896e 2515 896e ad 59 01 LDA enemy01_xpos 2516 8971 cd 4b 01 CMP pBullet4_x 2517 8974 b0 57 BCS .skipL0210 2518 8976 .condpart61 2519 8976 ad 4b 01 LDA pBullet4_x 2520 8979 cd 5f 01 CMP customTemp1 2521 897c b0 4f BCS .skip61then 2522 897e .condpart62 2523 897e ad 5a 01 LDA enemy01_ypos 2524 8981 cd 4f 01 CMP pBullet4_y 2525 8984 b0 47 BCS .skip62then 2526 8986 .condpart63 2527 8986 ad 4f 01 LDA pBullet4_y 2528 8989 cd 60 01 CMP customTemp2 2529 898c b0 3f BCS .skip63then 2530 898e .condpart64 2531 898e a9 01 LDA #1 2532 8990 8d 5c 01 STA enemy01_Flag 2533 8993 8d 6e 01 STA explosion_aniframe 2534 8996 f8 SED 2535 8997 18 CLC 2536 8998 ad a8 01 LDA score0+2 2537 899b 69 01 ADC #$01 2538 899d 8d a8 01 STA score0+2 2539 89a0 ad a7 01 LDA score0+1 2540 89a3 69 00 ADC #$00 2541 89a5 8d a7 01 STA score0+1 2542 89a8 ad a6 01 LDA score0 2543 89ab 69 00 ADC #$00 2544 89ad 8d a6 01 STA score0 2545 89b0 d8 CLD 2546 89b1 ifnconst NOTIALOCKMUTE 2547 89b1 a9 01 lda #1 2548 89b3 85 de sta sfxschedulelock 2549 89b5 a9 7d lda #sfx_explosion 2552 89bb 85 e1 sta sfxinstrumenthi 2553 89bd a9 00 lda #0 2554 89bf 85 e2 sta sfxpitchoffset ; no pitch modification 2555 89c1 85 e3 sta sfxnoteindex ; not a musical note 2556 89c3 20 77 f2 jsr schedulesfx 2557 89c6 a9 00 lda #0 2558 89c8 85 de sta sfxschedulelock 2559 89ca endif ; NOTIALOCKMUTE 2560 89ca 4c 33 8a jmp .collisions_done 2561 89cd 2562 89cd .skip63then 2563 89cd .skip62then 2564 89cd .skip61then 2565 89cd .skipL0210 2566 89cd .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 2567 89cd 2568 89cd ad 59 01 LDA enemy01_xpos 2569 89d0 cd 76 01 CMP p_twinlaser1_x 2570 89d3 b0 54 BCS .skipL0211 2571 89d5 .condpart65 2572 89d5 ad 76 01 LDA p_twinlaser1_x 2573 89d8 cd 5f 01 CMP customTemp1 2574 89db b0 4c BCS .skip65then 2575 89dd .condpart66 2576 89dd ad 5a 01 LDA enemy01_ypos 2577 89e0 cd 7a 01 CMP p_twinlaser1_y 2578 89e3 b0 44 BCS .skip66then 2579 89e5 .condpart67 2580 89e5 ad 7a 01 LDA p_twinlaser1_y 2581 89e8 cd 60 01 CMP customTemp2 2582 89eb b0 3c BCS .skip67then 2583 89ed .condpart68 2584 89ed a9 01 LDA #1 2585 89ef 8d 5c 01 STA enemy01_Flag 2586 89f2 8d 6e 01 STA explosion_aniframe 2587 89f5 f8 SED 2588 89f6 18 CLC 2589 89f7 ad a8 01 LDA score0+2 2590 89fa 69 02 ADC #$02 2591 89fc 8d a8 01 STA score0+2 2592 89ff ad a7 01 LDA score0+1 2593 8a02 69 00 ADC #$00 2594 8a04 8d a7 01 STA score0+1 2595 8a07 ad a6 01 LDA score0 2596 8a0a 69 00 ADC #$00 2597 8a0c 8d a6 01 STA score0 2598 8a0f d8 CLD 2599 8a10 ifnconst NOTIALOCKMUTE 2600 8a10 a9 01 lda #1 2601 8a12 85 de sta sfxschedulelock 2602 8a14 a9 7d lda #sfx_explosion 2605 8a1a 85 e1 sta sfxinstrumenthi 2606 8a1c a9 00 lda #0 2607 8a1e 85 e2 sta sfxpitchoffset ; no pitch modification 2608 8a20 85 e3 sta sfxnoteindex ; not a musical note 2609 8a22 20 77 f2 jsr schedulesfx 2610 8a25 a9 00 lda #0 2611 8a27 85 de sta sfxschedulelock 2612 8a29 endif ; NOTIALOCKMUTE 2613 8a29 .skip67then 2614 8a29 .skip66then 2615 8a29 .skip65then 2616 8a29 .skipL0211 2617 8a29 ._checkCollisionsExit 2618 8a29 ;; _checkCollisionsExit 2619 8a29 2620 8a29 .L0212 ;; return 2621 8a29 2622 8a29 ba tsx 2623 8a2a bd 02 01 lda $102,x 2624 8a2d f0 01 beq bankswitchret3 2625 8a2f 60 RTS 2626 8a30 bankswitchret3 2627 8a30 4c 9e f4 JMP BS_return 2628 8a33 .collisions_done 2629 8a33 ;; collisions_done 2630 8a33 2631 8a33 .L0213 ;; return 2632 8a33 2633 8a33 ba tsx 2634 8a34 bd 02 01 lda $102,x 2635 8a37 f0 01 beq bankswitchret4 2636 8a39 60 RTS 2637 8a3a bankswitchret4 2638 8a3a 4c 9e f4 JMP BS_return 2639 8a3d . 2640 8a3d ;; 2641 8a3d 2642 8a3d . 2643 8a3d ;; 2644 8a3d 2645 8a3d . 2646 8a3d ;; 2647 8a3d 2648 8a3d .check_firebutton 2649 8a3d ;; check_firebutton 2650 8a3d 2651 8a3d .L0214 ;; if fire_debounce > 0 && joy0fire then return 2652 8a3d 2653 8a3d a9 00 LDA #0 2654 8a3f cd 43 01 CMP fire_debounce 2655 8a42 b0 0f BCS .skipL0214 2656 8a44 .condpart69 2657 8a44 2c 02 21 bit sINPT1 2658 8a47 10 0a BPL .skip69then 2659 8a49 .condpart70 2660 8a49 ba tsx 2661 8a4a bd 02 01 lda $102,x 2662 8a4d f0 01 beq bankswitchret5 2663 8a4f 60 RTS 2664 8a50 bankswitchret5 2665 8a50 4c 9e f4 JMP BS_return 2666 8a53 .skip69then 2667 8a53 .skipL0214 2668 8a53 .L0215 ;; if !joy0fire then fire_debounce = 0 : return 2669 8a53 2670 8a53 2c 02 21 bit sINPT1 2671 8a56 30 0f BMI .skipL0215 2672 8a58 .condpart71 2673 8a58 a9 00 LDA #0 2674 8a5a 8d 43 01 STA fire_debounce 2675 8a5d ba tsx 2676 8a5e bd 02 01 lda $102,x 2677 8a61 f0 01 beq bankswitchret6 2678 8a63 60 RTS 2679 8a64 bankswitchret6 2680 8a64 4c 9e f4 JMP BS_return 2681 8a67 .skipL0215 2682 8a67 .L0216 ;; temp5 = 255 2683 8a67 2684 8a67 a9 ff LDA #255 2685 8a69 85 46 STA temp5 2686 8a6b .L0217 ;; for temp1 = 0 to 3 2687 8a6b 2688 8a6b a9 00 LDA #0 2689 8a6d 85 42 STA temp1 2690 8a6f .L0217fortemp1 2691 8a6f .L0218 ;; if pBullet1_y[temp1]! = 200 then temp5 = temp1 2692 8a6f 2693 8a6f a6 42 LDX temp1 2694 8a71 bd 4c 01 LDA pBullet1_y,x 2695 8a74 c9 c8 CMP #200 2696 8a76 d0 04 BNE .skipL0218 2697 8a78 .condpart72 2698 8a78 a5 42 LDA temp1 2699 8a7a 85 46 STA temp5 2700 8a7c .skipL0218 2701 8a7c .L0219 ;; next 2702 8a7c 2703 8a7c a5 42 LDA temp1 2704 8a7e c9 03 CMP #3 2705 8a80 e6 42 INC temp1 2706 8a82 if ((* - .L0217fortemp1) < 127) && ((* - .L0217fortemp1) > -128) 2707 8a82 90 eb bcc .L0217fortemp1 2708 8a84 - else 2709 8a84 - bcs .0skipL0217fortemp1 2710 8a84 - jmp .L0217fortemp1 2711 8a84 -.0skipL0217fortemp1 2712 8a84 endif 2713 8a84 .L0220 ;; if temp5 = 255 then return 2714 8a84 2715 8a84 a5 46 LDA temp5 2716 8a86 c9 ff CMP #255 2717 8a88 d0 0a BNE .skipL0220 2718 8a8a .condpart73 2719 8a8a ba tsx 2720 8a8b bd 02 01 lda $102,x 2721 8a8e f0 01 beq bankswitchret7 2722 8a90 60 RTS 2723 8a91 bankswitchret7 2724 8a91 4c 9e f4 JMP BS_return 2725 8a94 .skipL0220 2726 8a94 .L0221 ;; playsfx sfx_pulsecannon 2727 8a94 2728 8a94 ifnconst NOTIALOCKMUTE 2729 8a94 a9 01 lda #1 2730 8a96 85 de sta sfxschedulelock 2731 8a98 a9 f3 lda #sfx_pulsecannon 2734 8a9e 85 e1 sta sfxinstrumenthi 2735 8aa0 a9 00 lda #0 2736 8aa2 85 e2 sta sfxpitchoffset ; no pitch modification 2737 8aa4 85 e3 sta sfxnoteindex ; not a musical note 2738 8aa6 20 77 f2 jsr schedulesfx 2739 8aa9 a9 00 lda #0 2740 8aab 85 de sta sfxschedulelock 2741 8aad endif ; NOTIALOCKMUTE 2742 8aad .L0222 ;; fire_debounce = 255 2743 8aad 2744 8aad a9 ff LDA #255 2745 8aaf 8d 43 01 STA fire_debounce 2746 8ab2 .L0223 ;; pBullet1_time[temp5] = 200 2747 8ab2 2748 8ab2 a9 c8 LDA #200 2749 8ab4 a6 46 LDX temp5 2750 8ab6 9d 72 01 STA pBullet1_time,x 2751 8ab9 .L0224 ;; pBullet1_x[temp5] = playerX + 0 2752 8ab9 2753 8ab9 ad 41 01 LDA playerX 2754 8abc 18 CLC 2755 8abd 69 00 ADC #0 2756 8abf a6 46 LDX temp5 2757 8ac1 9d 48 01 STA pBullet1_x,x 2758 8ac4 .L0225 ;; pBullet1_y[temp5] = playerY - 8 2759 8ac4 2760 8ac4 ad 42 01 LDA playerY 2761 8ac7 38 SEC 2762 8ac8 e9 08 SBC #8 2763 8aca a6 46 LDX temp5 2764 8acc 9d 4c 01 STA pBullet1_y,x 2765 8acf . 2766 8acf ;; 2767 8acf 2768 8acf .L0226 ;; temp5 = temp5 - 6 2769 8acf 2770 8acf a5 46 LDA temp5 2771 8ad1 38 SEC 2772 8ad2 e9 06 SBC #6 2773 8ad4 85 46 STA temp5 2774 8ad6 .L0227 ;; return 2775 8ad6 2776 8ad6 ba tsx 2777 8ad7 bd 02 01 lda $102,x 2778 8ada f0 01 beq bankswitchret8 2779 8adc 60 RTS 2780 8add bankswitchret8 2781 8add 4c 9e f4 JMP BS_return 2782 8ae0 . 2783 8ae0 ;; 2784 8ae0 2785 8ae0 .move_bullets 2786 8ae0 ;; move_bullets 2787 8ae0 2788 8ae0 .L0228 ;; if pBullet1_time <> 200 then pBullet1_y = pBullet1_y - 4 2789 8ae0 2790 8ae0 ad 72 01 LDA pBullet1_time 2791 8ae3 c9 c8 CMP #200 2792 8ae5 f0 06 BEQ .skipL0228 2793 8ae7 .condpart74 2794 8ae7 38 SEC 2795 8ae8 e9 04 SBC #4 2796 8aea 8d 4c 01 STA pBullet1_y 2797 8aed .skipL0228 2798 8aed .L0229 ;; if pBullet2_time <> 200 then pBullet2_y = pBullet2_y - 4 2799 8aed 2800 8aed ad 73 01 LDA pBullet2_time 2801 8af0 c9 c8 CMP #200 2802 8af2 f0 06 BEQ .skipL0229 2803 8af4 .condpart75 2804 8af4 38 SEC 2805 8af5 e9 04 SBC #4 2806 8af7 8d 4d 01 STA pBullet2_y 2807 8afa .skipL0229 2808 8afa .L0230 ;; if pBullet3_time <> 200 then pBullet3_y = pBullet3_y - 4 2809 8afa 2810 8afa ad 74 01 LDA pBullet3_time 2811 8afd c9 c8 CMP #200 2812 8aff f0 06 BEQ .skipL0230 2813 8b01 .condpart76 2814 8b01 38 SEC 2815 8b02 e9 04 SBC #4 2816 8b04 8d 4e 01 STA pBullet3_y 2817 8b07 .skipL0230 2818 8b07 .L0231 ;; if pBullet4_time <> 200 then pBullet4_y = pBullet4_y - 4 2819 8b07 2820 8b07 ad 75 01 LDA pBullet4_time 2821 8b0a c9 c8 CMP #200 2822 8b0c f0 06 BEQ .skipL0231 2823 8b0e .condpart77 2824 8b0e 38 SEC 2825 8b0f e9 04 SBC #4 2826 8b11 8d 4f 01 STA pBullet4_y 2827 8b14 .skipL0231 2828 8b14 .L0232 ;; return 2829 8b14 2830 8b14 ba tsx 2831 8b15 bd 02 01 lda $102,x 2832 8b18 f0 01 beq bankswitchret9 2833 8b1a 60 RTS 2834 8b1b bankswitchret9 2835 8b1b 4c 9e f4 JMP BS_return 2836 8b1e . 2837 8b1e ;; 2838 8b1e 2839 8b1e .check_bullet_time 2840 8b1e ;; check_bullet_time 2841 8b1e 2842 8b1e .L0233 ;; for temp1 = 0 to 3 2843 8b1e 2844 8b1e a9 00 LDA #0 2845 8b20 85 42 STA temp1 2846 8b22 .L0233fortemp1 2847 8b22 .L0234 ;; if pBullet1_time[temp1] > 0 then pBullet1_time[temp1] = pBullet1_time[temp1] - 1 else pBullet1_x[temp1] = 200 2848 8b22 2849 8b22 a9 00 LDA #0 2850 8b24 a6 42 LDX temp1 2851 8b26 dd 72 01 CMP pBullet1_time,x 2852 8b29 b0 10 BCS .skipL0234 2853 8b2b .condpart78 2854 8b2b a6 42 LDX temp1 2855 8b2d bd 72 01 LDA pBullet1_time,x 2856 8b30 38 SEC 2857 8b31 e9 01 SBC #1 2858 8b33 a6 42 LDX temp1 2859 8b35 9d 72 01 STA pBullet1_time,x 2860 8b38 4c 42 8b jmp .skipelse0 2861 8b3b .skipL0234 2862 8b3b a9 c8 LDA #200 2863 8b3d a6 42 LDX temp1 2864 8b3f 9d 48 01 STA pBullet1_x,x 2865 8b42 .skipelse0 2866 8b42 .L0235 ;; next 2867 8b42 2868 8b42 a5 42 LDA temp1 2869 8b44 c9 03 CMP #3 2870 8b46 e6 42 INC temp1 2871 8b48 if ((* - .L0233fortemp1) < 127) && ((* - .L0233fortemp1) > -128) 2872 8b48 90 d8 bcc .L0233fortemp1 2873 8b4a - else 2874 8b4a - bcs .1skipL0233fortemp1 2875 8b4a - jmp .L0233fortemp1 2876 8b4a -.1skipL0233fortemp1 2877 8b4a endif 2878 8b4a .L0236 ;; return 2879 8b4a 2880 8b4a ba tsx 2881 8b4b bd 02 01 lda $102,x 2882 8b4e f0 01 beq bankswitchret10 2883 8b50 60 RTS 2884 8b51 bankswitchret10 2885 8b51 4c 9e f4 JMP BS_return 2886 8b54 . 2887 8b54 ;; 2888 8b54 2889 8b54 .check_bullet_boundary 2890 8b54 ;; check_bullet_boundary 2891 8b54 2892 8b54 .L0237 ;; for temp1 = 0 to 3 2893 8b54 2894 8b54 a9 00 LDA #0 2895 8b56 85 42 STA temp1 2896 8b58 .L0237fortemp1 2897 8b58 .L0238 ;; temp_x = pBullet1_x[temp1] 2898 8b58 2899 8b58 a6 42 LDX temp1 2900 8b5a bd 48 01 LDA pBullet1_x,x 2901 8b5d 8d 70 01 STA temp_x 2902 8b60 .L0239 ;; temp_y = pBullet1_y[temp1] 2903 8b60 2904 8b60 a6 42 LDX temp1 2905 8b62 bd 4c 01 LDA pBullet1_y,x 2906 8b65 8d 71 01 STA temp_y 2907 8b68 .L0240 ;; if temp_x < 1 || temp_x > 159 then pBullet1_y[temp1] = 200 2908 8b68 2909 8b68 ad 70 01 LDA temp_x 2910 8b6b c9 01 CMP #1 2911 8b6d b0 03 BCS .skipL0240 2912 8b6f .condpart79 2913 8b6f 4c 79 8b jmp .condpart80 2914 8b72 .skipL0240 2915 8b72 a9 9f LDA #159 2916 8b74 cd 70 01 CMP temp_x 2917 8b77 b0 07 BCS .skip25OR 2918 8b79 .condpart80 2919 8b79 a9 c8 LDA #200 2920 8b7b a6 42 LDX temp1 2921 8b7d 9d 4c 01 STA pBullet1_y,x 2922 8b80 .skip25OR 2923 8b80 .L0241 ;; if temp_y < 1 || temp_y > 191 then pBullet1_y[temp1] = 200 2924 8b80 2925 8b80 ad 71 01 LDA temp_y 2926 8b83 c9 01 CMP #1 2927 8b85 b0 03 BCS .skipL0241 2928 8b87 .condpart81 2929 8b87 4c 91 8b jmp .condpart82 2930 8b8a .skipL0241 2931 8b8a a9 bf LDA #191 2932 8b8c cd 71 01 CMP temp_y 2933 8b8f b0 07 BCS .skip26OR 2934 8b91 .condpart82 2935 8b91 a9 c8 LDA #200 2936 8b93 a6 42 LDX temp1 2937 8b95 9d 4c 01 STA pBullet1_y,x 2938 8b98 .skip26OR 2939 8b98 .L0242 ;; next 2940 8b98 2941 8b98 a5 42 LDA temp1 2942 8b9a c9 03 CMP #3 2943 8b9c e6 42 INC temp1 2944 8b9e if ((* - .L0237fortemp1) < 127) && ((* - .L0237fortemp1) > -128) 2945 8b9e 90 b8 bcc .L0237fortemp1 2946 8ba0 - else 2947 8ba0 - bcs .2skipL0237fortemp1 2948 8ba0 - jmp .L0237fortemp1 2949 8ba0 -.2skipL0237fortemp1 2950 8ba0 endif 2951 8ba0 .L0243 ;; return 2952 8ba0 2953 8ba0 ba tsx 2954 8ba1 bd 02 01 lda $102,x 2955 8ba4 f0 01 beq bankswitchret11 2956 8ba6 60 RTS 2957 8ba7 bankswitchret11 2958 8ba7 4c 9e f4 JMP BS_return 2959 8baa . 2960 8baa ;; 2961 8baa 2962 8baa .draw_player_bullets 2963 8baa ;; draw_player_bullets 2964 8baa 2965 8baa .L0244 ;; for temp_loop = 0 to 3 2966 8baa 2967 8baa a9 00 LDA #0 2968 8bac 8d 6f 01 STA temp_loop 2969 8baf .L0244fortemp_loop 2970 8baf .L0245 ;; temp_x = pBullet1_x[temp_loop] 2971 8baf 2972 8baf ae 6f 01 LDX temp_loop 2973 8bb2 bd 48 01 LDA pBullet1_x,x 2974 8bb5 8d 70 01 STA temp_x 2975 8bb8 .L0246 ;; temp_y = pBullet1_y[temp_loop] 2976 8bb8 2977 8bb8 ae 6f 01 LDX temp_loop 2978 8bbb bd 4c 01 LDA pBullet1_y,x 2979 8bbe 8d 71 01 STA temp_y 2980 8bc1 .L0247 ;; if temp_x <> 200 then plotsprite vertical_shooting_bullet 0 temp_x temp_y 2981 8bc1 2982 8bc1 ad 70 01 LDA temp_x 2983 8bc4 c9 c8 CMP #200 2984 8bc6 f0 1d BEQ .skipL0247 2985 8bc8 .condpart83 2986 8bc8 a9 31 lda #vertical_shooting_bullet 2990 8bce 85 43 sta temp2 2991 8bd0 2992 8bd0 a9 1f lda #(0|vertical_shooting_bullet_width_twoscompliment) 2993 8bd2 85 44 sta temp3 2994 8bd4 2995 8bd4 ad 70 01 lda temp_x 2996 8bd7 85 45 sta temp4 2997 8bd9 2998 8bd9 ad 71 01 lda temp_y 2999 8bdc 3000 8bdc 85 46 sta temp5 3001 8bde 3002 8bde a9 40 lda #(vertical_shooting_bullet_mode|%01000000) 3003 8be0 85 47 sta temp6 3004 8be2 3005 8be2 20 bf f2 jsr plotsprite 3006 8be5 .skipL0247 3007 8be5 .L0248 ;; next 3008 8be5 3009 8be5 ad 6f 01 LDA temp_loop 3010 8be8 c9 03 CMP #3 3011 8bea ee 6f 01 INC temp_loop 3012 8bed if ((* - .L0244fortemp_loop) < 127) && ((* - .L0244fortemp_loop) > -128) 3013 8bed 90 c0 bcc .L0244fortemp_loop 3014 8bef - else 3015 8bef - bcs .3skipL0244fortemp_loop 3016 8bef - jmp .L0244fortemp_loop 3017 8bef -.3skipL0244fortemp_loop 3018 8bef endif 3019 8bef .L0249 ;; return 3020 8bef 3021 8bef ba tsx 3022 8bf0 bd 02 01 lda $102,x 3023 8bf3 f0 01 beq bankswitchret12 3024 8bf5 60 RTS 3025 8bf6 bankswitchret12 3026 8bf6 4c 9e f4 JMP BS_return 3027 8bf9 . 3028 8bf9 ;; 3029 8bf9 3030 8bf9 .lose_a_life 3031 8bf9 ;; lose_a_life 3032 8bf9 3033 8bf9 .L0250 ;; lives = lives - 1 : isDead_flag = 0 3034 8bf9 3035 8bf9 ad 65 01 LDA lives 3036 8bfc 38 SEC 3037 8bfd e9 01 SBC #1 3038 8bff 8d 65 01 STA lives 3039 8c02 a9 00 LDA #0 3040 8c04 8d 64 01 STA isDead_flag 3041 8c07 .L0251 ;; if player_flag = 1 && explosion_aniframe = 200 && lives > 0 then playerX = 80 : playerY = 144 : explosion_aniframe = 0 : goto main 3042 8c07 3043 8c07 ad 5b 01 LDA player_flag 3044 8c0a c9 01 CMP #1 3045 8c0c d0 20 BNE .skipL0251 3046 8c0e .condpart84 3047 8c0e ad 6e 01 LDA explosion_aniframe 3048 8c11 c9 c8 CMP #200 3049 8c13 d0 19 BNE .skip84then 3050 8c15 .condpart85 3051 8c15 a9 00 LDA #0 3052 8c17 cd 65 01 CMP lives 3053 8c1a b0 12 BCS .skip85then 3054 8c1c .condpart86 3055 8c1c a9 50 LDA #80 3056 8c1e 8d 41 01 STA playerX 3057 8c21 a9 90 LDA #144 3058 8c23 8d 42 01 STA playerY 3059 8c26 a9 00 LDA #0 3060 8c28 8d 6e 01 STA explosion_aniframe 3061 8c2b 4c 61 81 jmp .main 3062 8c2e 3063 8c2e .skip85then 3064 8c2e .skip84then 3065 8c2e .skipL0251 3066 8c2e .L0252 ;; joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 3067 8c2e 3068 8c2e a9 00 LDA #0 3069 8c30 8d 44 01 STA joyposup 3070 8c33 8d 45 01 STA joyposdown 3071 8c36 8d 46 01 STA joyposleft 3072 8c39 8d 47 01 STA joyposright 3073 8c3c . 3074 8c3c ;; 3075 8c3c 3076 8c3c . 3077 8c3c ;; 3078 8c3c 3079 8c3c .lose_a_lifeloop 3080 8c3c ;; lose_a_lifeloop 3081 8c3c 3082 8c3c .L0253 ;; restorescreen 3083 8c3c 3084 8c3c 20 91 f0 jsr restorescreen 3085 8c3f .L0254 ;; gosub _draw_score 3086 8c3f 3087 8c3f 20 36 84 jsr ._draw_score 3088 8c42 3089 8c42 .L0255 ;; drawscreen 3090 8c42 3091 8c42 20 b3 f0 jsr drawscreen 3092 8c45 .L0256 ;; if joy0fire then fire_debounce = 2 3093 8c45 3094 8c45 2c 02 21 bit sINPT1 3095 8c48 10 05 BPL .skipL0256 3096 8c4a .condpart87 3097 8c4a a9 02 LDA #2 3098 8c4c 8d 43 01 STA fire_debounce 3099 8c4f .skipL0256 3100 8c4f .L0257 ;; if !joy0fire then fire_debounce = 1 3101 8c4f 3102 8c4f 2c 02 21 bit sINPT1 3103 8c52 30 05 BMI .skipL0257 3104 8c54 .condpart88 3105 8c54 a9 01 LDA #1 3106 8c56 8d 43 01 STA fire_debounce 3107 8c59 .skipL0257 3108 8c59 .L0258 ;; if fire_debounce = 1 && lives > 0 then clearscreen : goto main 3109 8c59 3110 8c59 ad 43 01 LDA fire_debounce 3111 8c5c c9 01 CMP #1 3112 8c5e d0 0d BNE .skipL0258 3113 8c60 .condpart89 3114 8c60 a9 00 LDA #0 3115 8c62 cd 65 01 CMP lives 3116 8c65 b0 06 BCS .skip89then 3117 8c67 .condpart90 3118 8c67 20 7f f0 jsr clearscreen 3119 8c6a 4c 61 81 jmp .main 3120 8c6d 3121 8c6d .skip89then 3122 8c6d .skipL0258 3123 8c6d .L0259 ;; if fire_debounce = 1 && lives < 1 then clearscreen : goto gameover 3124 8c6d 3125 8c6d ad 43 01 LDA fire_debounce 3126 8c70 c9 01 CMP #1 3127 8c72 d0 0d BNE .skipL0259 3128 8c74 .condpart91 3129 8c74 ad 65 01 LDA lives 3130 8c77 c9 01 CMP #1 3131 8c79 b0 06 BCS .skip91then 3132 8c7b .condpart92 3133 8c7b 20 7f f0 jsr clearscreen 3134 8c7e 4c 84 8c jmp .gameover 3135 8c81 3136 8c81 .skip91then 3137 8c81 .skipL0259 3138 8c81 .L0260 ;; goto lose_a_lifeloop 3139 8c81 3140 8c81 4c 3c 8c jmp .lose_a_lifeloop 3141 8c84 3142 8c84 . 3143 8c84 ;; 3144 8c84 3145 8c84 .gameover 3146 8c84 ;; gameover 3147 8c84 3148 8c84 .L0261 ;; gameover_flag = 0 3149 8c84 3150 8c84 a9 00 LDA #0 3151 8c86 8d 63 01 STA gameover_flag 3152 8c89 .L0262 ;; fire_debounce = 1 3153 8c89 3154 8c89 a9 01 LDA #1 3155 8c8b 8d 43 01 STA fire_debounce 3156 8c8e . 3157 8c8e ;; 3158 8c8e 3159 8c8e .gameover_loop 3160 8c8e ;; gameover_loop 3161 8c8e 3162 8c8e .L0263 ;; if lives = 0 then gameover_flag = 1 : clearscreen 3163 8c8e 3164 8c8e ad 65 01 LDA lives 3165 8c91 c9 00 CMP #0 3166 8c93 d0 08 BNE .skipL0263 3167 8c95 .condpart93 3168 8c95 a9 01 LDA #1 3169 8c97 8d 63 01 STA gameover_flag 3170 8c9a 20 7f f0 jsr clearscreen 3171 8c9d .skipL0263 3172 8c9d .L0264 ;; plotchars 'game^over!' 0 40 16 3173 8c9d 3174 8c9d 4c aa 8c JMP skipalphadata12 3175 8ca0 alphadata12 3176 8ca0 11 .byte.b (alphadata12 3191 8cb0 85 43 sta temp2 3192 8cb2 3193 8cb2 a9 16 lda #22 ; width in two's complement 3194 8cb4 09 00 ora #0 ; palette left shifted 5 bits 3195 8cb6 85 44 sta temp3 3196 8cb8 a9 28 lda #40 3197 8cba 85 45 sta temp4 3198 8cbc 3199 8cbc a9 10 lda #16 3200 8cbe 3201 8cbe 85 46 sta temp5 3202 8cc0 3203 8cc0 20 78 f3 jsr plotcharacters 3204 8cc3 .L0265 ;; if joy0fire && !fire_debounce then clearscreen : goto plot 3205 8cc3 3206 8cc3 2c 02 21 bit sINPT1 3207 8cc6 10 0b BPL .skipL0265 3208 8cc8 .condpart94 3209 8cc8 ad 43 01 LDA fire_debounce 3210 8ccb d0 06 BNE .skip94then 3211 8ccd .condpart95 3212 8ccd 20 7f f0 jsr clearscreen 3213 8cd0 4c 48 80 jmp .plot 3214 8cd3 3215 8cd3 .skip94then 3216 8cd3 .skipL0265 3217 8cd3 .L0266 ;; if !joy0fire then fire_debounce = 0 3218 8cd3 3219 8cd3 2c 02 21 bit sINPT1 3220 8cd6 30 05 BMI .skipL0266 3221 8cd8 .condpart96 3222 8cd8 a9 00 LDA #0 3223 8cda 8d 43 01 STA fire_debounce 3224 8cdd .skipL0266 3225 8cdd .L0267 ;; goto gameover_loop 3226 8cdd 3227 8cdd 4c 8e 8c jmp .gameover_loop 3228 8ce0 3229 8ce0 . 3230 8ce0 ;; 3231 8ce0 3232 8ce0 .titlescreen 3233 8ce0 ;; titlescreen 3234 8ce0 3235 8ce0 .L0268 ;; plotchars 'new^vertical^shooting' 1 38 4 3236 8ce0 3237 8ce0 4c f8 8c JMP skipalphadata13 3238 8ce3 alphadata13 3239 8ce3 18 .byte.b (alphadata13 3265 8cfe 85 43 sta temp2 3266 8d00 3267 8d00 a9 0b lda #11 ; width in two's complement 3268 8d02 09 20 ora #32 ; palette left shifted 5 bits 3269 8d04 85 44 sta temp3 3270 8d06 a9 26 lda #38 3271 8d08 85 45 sta temp4 3272 8d0a 3273 8d0a a9 04 lda #4 3274 8d0c 3275 8d0c 85 46 sta temp5 3276 8d0e 3277 8d0e 20 78 f3 jsr plotcharacters 3278 8d11 .L0269 ;; plotchars 'demo' 1 72 5 3279 8d11 3280 8d11 4c 18 8d JMP skipalphadata14 3281 8d14 alphadata14 3282 8d14 0e .byte.b (alphadata14 3291 8d1e 85 43 sta temp2 3292 8d20 3293 8d20 a9 1c lda #28 ; width in two's complement 3294 8d22 09 20 ora #32 ; palette left shifted 5 bits 3295 8d24 85 44 sta temp3 3296 8d26 a9 48 lda #72 3297 8d28 85 45 sta temp4 3298 8d2a 3299 8d2a a9 05 lda #5 3300 8d2c 3301 8d2c 85 46 sta temp5 3302 8d2e 3303 8d2e 20 78 f3 jsr plotcharacters 3304 8d31 .L0270 ;; plotchars 'by^shane^skekel.' 1 48 7 3305 8d31 3306 8d31 4c 44 8d JMP skipalphadata15 3307 8d34 alphadata15 3308 8d34 0c .byte.b (alphadata15 3329 8d4a 85 43 sta temp2 3330 8d4c 3331 8d4c a9 10 lda #16 ; width in two's complement 3332 8d4e 09 20 ora #32 ; palette left shifted 5 bits 3333 8d50 85 44 sta temp3 3334 8d52 a9 30 lda #48 3335 8d54 85 45 sta temp4 3336 8d56 3337 8d56 a9 07 lda #7 3338 8d58 3339 8d58 85 46 sta temp5 3340 8d5a 3341 8d5a 20 78 f3 jsr plotcharacters 3342 8d5d .L0271 ;; plotchars 'push^fire^to^begin.' 2 42 16 3343 8d5d 3344 8d5d 4c 73 8d JMP skipalphadata16 3345 8d60 alphadata16 3346 8d60 1a .byte.b (alphadata16 3370 8d79 85 43 sta temp2 3371 8d7b 3372 8d7b a9 0d lda #13 ; width in two's complement 3373 8d7d 09 40 ora #64 ; palette left shifted 5 bits 3374 8d7f 85 44 sta temp3 3375 8d81 a9 2a lda #42 3376 8d83 85 45 sta temp4 3377 8d85 3378 8d85 a9 10 lda #16 3379 8d87 3380 8d87 85 46 sta temp5 3381 8d89 3382 8d89 20 78 f3 jsr plotcharacters 3383 8d8c .L0272 ;; savescreen 3384 8d8c 3385 8d8c 20 a3 f0 jsr savescreen 3386 8d8f .L0273 ;; drawscreen 3387 8d8f 3388 8d8f 20 b3 f0 jsr drawscreen 3389 8d92 .L0274 ;; fire_debounce = 1 3390 8d92 3391 8d92 a9 01 LDA #1 3392 8d94 8d 43 01 STA fire_debounce 3393 8d97 . 3394 8d97 ;; 3395 8d97 3396 8d97 .titlescreenloop 3397 8d97 ;; titlescreenloop 3398 8d97 3399 8d97 .L0275 ;; restorescreen 3400 8d97 3401 8d97 20 91 f0 jsr restorescreen 3402 8d9a .L0276 ;; if switchreset then reboot 3403 8d9a 3404 8d9a 20 b1 f4 jsr checkresetswitch 3405 8d9d d0 03 BNE .skipL0276 3406 8d9f .condpart97 3407 8d9f 4c 9e f5 JMP START 3408 8da2 .skipL0276 3409 8da2 .L0277 ;; if joy0fire then clearscreen : savescreen : lives = $04 : score0 = 0 : playsfx sfx_bling : goto main 3410 8da2 3411 8da2 2c 02 21 bit sINPT1 3412 8da5 10 36 BPL .skipL0277 3413 8da7 .condpart98 3414 8da7 20 7f f0 jsr clearscreen 3415 8daa 20 a3 f0 jsr savescreen 3416 8dad a9 04 LDA #$04 3417 8daf 8d 65 01 STA lives 3418 8db2 a9 00 LDA #$00 3419 8db4 8d a8 01 STA score0+2 3420 8db7 a9 00 LDA #$00 3421 8db9 8d a7 01 STA score0+1 3422 8dbc a9 00 LDA #$00 3423 8dbe 8d a6 01 STA score0 3424 8dc1 ifnconst NOTIALOCKMUTE 3425 8dc1 a9 01 lda #1 3426 8dc3 85 de sta sfxschedulelock 3427 8dc5 a9 ba lda #sfx_bling 3430 8dcb 85 e1 sta sfxinstrumenthi 3431 8dcd a9 00 lda #0 3432 8dcf 85 e2 sta sfxpitchoffset ; no pitch modification 3433 8dd1 85 e3 sta sfxnoteindex ; not a musical note 3434 8dd3 20 77 f2 jsr schedulesfx 3435 8dd6 a9 00 lda #0 3436 8dd8 85 de sta sfxschedulelock 3437 8dda endif ; NOTIALOCKMUTE 3438 8dda 4c 61 81 jmp .main 3439 8ddd 3440 8ddd .skipL0277 3441 8ddd .L0278 ;; if !joy0fire then fire_debounce = 0 3442 8ddd 3443 8ddd 2c 02 21 bit sINPT1 3444 8de0 30 05 BMI .skipL0278 3445 8de2 .condpart99 3446 8de2 a9 00 LDA #0 3447 8de4 8d 43 01 STA fire_debounce 3448 8de7 .skipL0278 3449 8de7 .L0279 ;; drawscreen 3450 8de7 3451 8de7 20 b3 f0 jsr drawscreen 3452 8dea .L0280 ;; goto titlescreenloop 3453 8dea 3454 8dea 4c 97 8d jmp .titlescreenloop 3455 8ded 3456 8ded . 3457 8ded ;; 3458 8ded 3459 8ded . 3460 8ded ;; 3461 8ded 3462 8ded .initialise_gamescreen 3463 8ded ;; initialise_gamescreen 3464 8ded 3465 8ded .L0281 ;; clearscreen 3466 8ded 3467 8ded 20 7f f0 jsr clearscreen 3468 8df0 .L0282 ;; BACKGRND = $00 3469 8df0 3470 8df0 a9 00 LDA #$00 3471 8df2 85 20 STA BACKGRND 3472 8df4 . 3473 8df4 ;; 3474 8df4 3475 8df4 .L0283 ;; savescreen 3476 8df4 3477 8df4 20 a3 f0 jsr savescreen 3478 8df7 .L0284 ;; return 3479 8df7 3480 8df7 ba tsx 3481 8df8 bd 02 01 lda $102,x 3482 8dfb f0 01 beq bankswitchret18 3483 8dfd 60 RTS 3484 8dfe bankswitchret18 3485 8dfe 4c 9e f4 JMP BS_return 3486 8e01 . 3487 8e01 ;; 3488 8e01 3489 8e01 .power_up_obtained 3490 8e01 ;; power_up_obtained 3491 8e01 3492 8e01 .L0285 ;; if power_up_Flag = 1 then twinlaser_flag = 1 3493 8e01 3494 8e01 ad 6a 01 LDA power_up_Flag 3495 8e04 c9 01 CMP #1 3496 8e06 d0 05 BNE .skipL0285 3497 8e08 .condpart100 3498 8e08 a9 01 LDA #1 3499 8e0a 8d 8a 01 STA twinlaser_flag 3500 8e0d .skipL0285 3501 8e0d .L0286 ;; return 3502 8e0d 3503 8e0d ba tsx 3504 8e0e bd 02 01 lda $102,x 3505 8e11 f0 01 beq bankswitchret19 3506 8e13 60 RTS 3507 8e14 bankswitchret19 3508 8e14 4c 9e f4 JMP BS_return 3509 8e17 . 3510 8e17 ;; 3511 8e17 3512 8e17 .draw_sprites 3513 8e17 ;; draw_sprites 3514 8e17 3515 8e17 .L0287 ;; plotsprite vertical_shooting_ship 0 playerX playerY 3516 8e17 3517 8e17 a9 2d lda #vertical_shooting_ship 3521 8e1d 85 43 sta temp2 3522 8e1f 3523 8e1f a9 1e lda #(0|vertical_shooting_ship_width_twoscompliment) 3524 8e21 85 44 sta temp3 3525 8e23 3526 8e23 ad 41 01 lda playerX 3527 8e26 85 45 sta temp4 3528 8e28 3529 8e28 ad 42 01 lda playerY 3530 8e2b 3531 8e2b 85 46 sta temp5 3532 8e2d 3533 8e2d a9 40 lda #(vertical_shooting_ship_mode|%01000000) 3534 8e2f 85 47 sta temp6 3535 8e31 3536 8e31 20 bf f2 jsr plotsprite 3537 8e34 ; +tall sprite replot 3538 8e34 18 clc 3539 8e35 a5 42 lda temp1 3540 8e37 69 02 adc #vertical_shooting_ship_width 3541 8e39 85 42 sta temp1 3542 8e3b a5 46 lda temp5 3543 8e3d 69 08 adc #WZONEHEIGHT 3544 8e3f 85 46 sta temp5 3545 8e41 20 bf f2 jsr plotsprite 3546 8e44 . 3547 8e44 ;; 3548 8e44 3549 8e44 . 3550 8e44 ;; 3551 8e44 3552 8e44 .L0288 ;; plotsprite vertical_shooting_powerup 3 power_upX power_upY 3553 8e44 3554 8e44 a9 33 lda #vertical_shooting_powerup 3558 8e4a 85 43 sta temp2 3559 8e4c 3560 8e4c a9 7e lda #(96|vertical_shooting_powerup_width_twoscompliment) 3561 8e4e 85 44 sta temp3 3562 8e50 3563 8e50 ad 68 01 lda power_upX 3564 8e53 85 45 sta temp4 3565 8e55 3566 8e55 ad 69 01 lda power_upY 3567 8e58 3568 8e58 85 46 sta temp5 3569 8e5a 3570 8e5a a9 40 lda #(vertical_shooting_powerup_mode|%01000000) 3571 8e5c 85 47 sta temp6 3572 8e5e 3573 8e5e 20 bf f2 jsr plotsprite 3574 8e61 .L0289 ;; plotsprite vertical_shooting_enemy01 2 enemy01_xpos enemy01_ypos 3575 8e61 3576 8e61 a9 35 lda #vertical_shooting_enemy01 3580 8e67 85 43 sta temp2 3581 8e69 3582 8e69 a9 5e lda #(64|vertical_shooting_enemy01_width_twoscompliment) 3583 8e6b 85 44 sta temp3 3584 8e6d 3585 8e6d ad 59 01 lda enemy01_xpos 3586 8e70 85 45 sta temp4 3587 8e72 3588 8e72 ad 5a 01 lda enemy01_ypos 3589 8e75 3590 8e75 85 46 sta temp5 3591 8e77 3592 8e77 a9 40 lda #(vertical_shooting_enemy01_mode|%01000000) 3593 8e79 85 47 sta temp6 3594 8e7b 3595 8e7b 20 bf f2 jsr plotsprite 3596 8e7e ; +tall sprite replot 3597 8e7e 18 clc 3598 8e7f a5 42 lda temp1 3599 8e81 69 02 adc #vertical_shooting_enemy01_width 3600 8e83 85 42 sta temp1 3601 8e85 a5 46 lda temp5 3602 8e87 69 08 adc #WZONEHEIGHT 3603 8e89 85 46 sta temp5 3604 8e8b 20 bf f2 jsr plotsprite 3605 8e8e .L0290 ;; plotsprite vertical_shooting_1up 0 extra_shipX extra_shipY 3606 8e8e 3607 8e8e a9 39 lda #vertical_shooting_1up 3611 8e94 85 43 sta temp2 3612 8e96 3613 8e96 a9 1e lda #(0|vertical_shooting_1up_width_twoscompliment) 3614 8e98 85 44 sta temp3 3615 8e9a 3616 8e9a ad 6b 01 lda extra_shipX 3617 8e9d 85 45 sta temp4 3618 8e9f 3619 8e9f ad 6c 01 lda extra_shipY 3620 8ea2 3621 8ea2 85 46 sta temp5 3622 8ea4 3623 8ea4 a9 40 lda #(vertical_shooting_1up_mode|%01000000) 3624 8ea6 85 47 sta temp6 3625 8ea8 3626 8ea8 20 bf f2 jsr plotsprite 3627 8eab .L0291 ;; plotsprite vertical_shooting_demo_explosion_upd0 3 playerX playerY explosion_aniframe 3628 8eab 3629 8eab a9 3b lda #vertical_shooting_demo_explosion_upd0 3641 8ebc 85 43 sta temp2 3642 8ebe 3643 8ebe a9 7e lda #(96|vertical_shooting_demo_explosion_upd0_width_twoscompliment) 3644 8ec0 85 44 sta temp3 3645 8ec2 3646 8ec2 ad 41 01 lda playerX 3647 8ec5 85 45 sta temp4 3648 8ec7 3649 8ec7 ad 42 01 lda playerY 3650 8eca 85 46 sta temp5 3651 8ecc 3652 8ecc a9 40 lda #(vertical_shooting_demo_explosion_upd0_mode|%01000000) 3653 8ece 85 47 sta temp6 3654 8ed0 3655 8ed0 20 bf f2 jsr plotsprite 3656 8ed3 ; +tall sprite replot 3657 8ed3 18 clc 3658 8ed4 a5 42 lda temp1 3659 8ed6 69 02 adc #vertical_shooting_demo_explosion_upd0_width 3660 8ed8 85 42 sta temp1 3661 8eda a5 46 lda temp5 3662 8edc 69 08 adc #WZONEHEIGHT 3663 8ede 85 46 sta temp5 3664 8ee0 20 bf f2 jsr plotsprite 3665 8ee3 .L0292 ;; plotsprite vertical_shooting_demo_explosion_upd0 3 enemy01_xpos enemy01_ypos explosion_aniframe 3666 8ee3 3667 8ee3 a9 3b lda #vertical_shooting_demo_explosion_upd0 3679 8ef4 85 43 sta temp2 3680 8ef6 3681 8ef6 a9 7e lda #(96|vertical_shooting_demo_explosion_upd0_width_twoscompliment) 3682 8ef8 85 44 sta temp3 3683 8efa 3684 8efa ad 59 01 lda enemy01_xpos 3685 8efd 85 45 sta temp4 3686 8eff 3687 8eff ad 5a 01 lda enemy01_ypos 3688 8f02 85 46 sta temp5 3689 8f04 3690 8f04 a9 40 lda #(vertical_shooting_demo_explosion_upd0_mode|%01000000) 3691 8f06 85 47 sta temp6 3692 8f08 3693 8f08 20 bf f2 jsr plotsprite 3694 8f0b ; +tall sprite replot 3695 8f0b 18 clc 3696 8f0c a5 42 lda temp1 3697 8f0e 69 02 adc #vertical_shooting_demo_explosion_upd0_width 3698 8f10 85 42 sta temp1 3699 8f12 a5 46 lda temp5 3700 8f14 69 08 adc #WZONEHEIGHT 3701 8f16 85 46 sta temp5 3702 8f18 20 bf f2 jsr plotsprite 3703 8f1b .L0293 ;; plotsprite vertical_shooting_laser 0 p_twinlaser1_x p_twinlaser1_y 3704 8f1b 3705 8f1b a9 67 lda #vertical_shooting_laser 3709 8f21 85 43 sta temp2 3710 8f23 3711 8f23 a9 1f lda #(0|vertical_shooting_laser_width_twoscompliment) 3712 8f25 85 44 sta temp3 3713 8f27 3714 8f27 ad 76 01 lda p_twinlaser1_x 3715 8f2a 85 45 sta temp4 3716 8f2c 3717 8f2c ad 7a 01 lda p_twinlaser1_y 3718 8f2f 3719 8f2f 85 46 sta temp5 3720 8f31 3721 8f31 a9 40 lda #(vertical_shooting_laser_mode|%01000000) 3722 8f33 85 47 sta temp6 3723 8f35 3724 8f35 20 bf f2 jsr plotsprite 3725 8f38 ; +tall sprite replot 3726 8f38 18 clc 3727 8f39 a5 42 lda temp1 3728 8f3b 69 01 adc #vertical_shooting_laser_width 3729 8f3d 85 42 sta temp1 3730 8f3f a5 46 lda temp5 3731 8f41 69 08 adc #WZONEHEIGHT 3732 8f43 85 46 sta temp5 3733 8f45 20 bf f2 jsr plotsprite 3734 8f48 .L0294 ;; if player_flag = 1 then plotsprite vertical_shooting_demo_explosion_upd0 3 playerX playerY explosion_aniframe 3735 8f48 3736 8f48 ad 5b 01 LDA player_flag 3737 8f4b c9 01 CMP #1 3738 8f4d d0 38 BNE .skipL0294 3739 8f4f .condpart101 3740 8f4f a9 3b lda #vertical_shooting_demo_explosion_upd0 3752 8f60 85 43 sta temp2 3753 8f62 3754 8f62 a9 7e lda #(96|vertical_shooting_demo_explosion_upd0_width_twoscompliment) 3755 8f64 85 44 sta temp3 3756 8f66 3757 8f66 ad 41 01 lda playerX 3758 8f69 85 45 sta temp4 3759 8f6b 3760 8f6b ad 42 01 lda playerY 3761 8f6e 85 46 sta temp5 3762 8f70 3763 8f70 a9 40 lda #(vertical_shooting_demo_explosion_upd0_mode|%01000000) 3764 8f72 85 47 sta temp6 3765 8f74 3766 8f74 20 bf f2 jsr plotsprite 3767 8f77 ; +tall sprite replot 3768 8f77 18 clc 3769 8f78 a5 42 lda temp1 3770 8f7a 69 02 adc #vertical_shooting_demo_explosion_upd0_width 3771 8f7c 85 42 sta temp1 3772 8f7e a5 46 lda temp5 3773 8f80 69 08 adc #WZONEHEIGHT 3774 8f82 85 46 sta temp5 3775 8f84 20 bf f2 jsr plotsprite 3776 8f87 .skipL0294 3777 8f87 .L0295 ;; if enemy01_Flag = 1 then plotsprite vertical_shooting_demo_explosion_upd0 3 enemy01_xpos enemy01_ypos explosion_aniframe 3778 8f87 3779 8f87 ad 5c 01 LDA enemy01_Flag 3780 8f8a c9 01 CMP #1 3781 8f8c d0 38 BNE .skipL0295 3782 8f8e .condpart102 3783 8f8e a9 3b lda #vertical_shooting_demo_explosion_upd0 3795 8f9f 85 43 sta temp2 3796 8fa1 3797 8fa1 a9 7e lda #(96|vertical_shooting_demo_explosion_upd0_width_twoscompliment) 3798 8fa3 85 44 sta temp3 3799 8fa5 3800 8fa5 ad 59 01 lda enemy01_xpos 3801 8fa8 85 45 sta temp4 3802 8faa 3803 8faa ad 5a 01 lda enemy01_ypos 3804 8fad 85 46 sta temp5 3805 8faf 3806 8faf a9 40 lda #(vertical_shooting_demo_explosion_upd0_mode|%01000000) 3807 8fb1 85 47 sta temp6 3808 8fb3 3809 8fb3 20 bf f2 jsr plotsprite 3810 8fb6 ; +tall sprite replot 3811 8fb6 18 clc 3812 8fb7 a5 42 lda temp1 3813 8fb9 69 02 adc #vertical_shooting_demo_explosion_upd0_width 3814 8fbb 85 42 sta temp1 3815 8fbd a5 46 lda temp5 3816 8fbf 69 08 adc #WZONEHEIGHT 3817 8fc1 85 46 sta temp5 3818 8fc3 20 bf f2 jsr plotsprite 3819 8fc6 .skipL0295 3820 8fc6 .L0296 ;; return 3821 8fc6 3822 8fc6 ba tsx 3823 8fc7 bd 02 01 lda $102,x 3824 8fca f0 01 beq bankswitchret24 3825 8fcc 60 RTS 3826 8fcd bankswitchret24 3827 8fcd 4c 9e f4 JMP BS_return 3828 8fd0 . 3829 8fd0 ;; 3830 8fd0 3831 8fd0 .shoot_enemy_bullet 3832 8fd0 ;; shoot_enemy_bullet 3833 8fd0 3834 8fd0 . 3835 8fd0 ;; 3836 8fd0 3837 8fd0 .L0297 ;; z = 15 3838 8fd0 3839 8fd0 a9 0f LDA #15 3840 8fd2 85 ff STA z 3841 8fd4 .check_enemyshot 3842 8fd4 ;; check_enemyshot 3843 8fd4 3844 8fd4 . 3845 8fd4 ;; 3846 8fd4 3847 8fd4 . 3848 8fd4 ;; 3849 8fd4 3850 8fd4 . 3851 8fd4 ;; 3852 8fd4 3853 8fd4 . 3854 8fd4 ;; 3855 8fd4 3856 8fd4 . 3857 8fd4 ;; 3858 8fd4 3859 8fd4 .L0298 ;; if enemy_shotFlag = TRUE then goto skip_enemy_shot 3860 8fd4 3861 8fd4 ad 9c 01 LDA enemy_shotFlag 3862 8fd7 c9 01 CMP #TRUE 3863 8fd9 d0 03 BNE .skipL0298 3864 8fdb .condpart103 3865 8fdb 4c 2b 91 jmp .skip_enemy_shot 3866 8fde 3867 8fde .skipL0298 3868 8fde .L0299 ;; enemy_shotFlag = TRUE 3869 8fde 3870 8fde a9 01 LDA #TRUE 3871 8fe0 8d 9c 01 STA enemy_shotFlag 3872 8fe3 .L0300 ;; enemy_shot_xpos = enemy01_xpos + 2 3873 8fe3 3874 8fe3 ad 59 01 LDA enemy01_xpos 3875 8fe6 18 CLC 3876 8fe7 69 02 ADC #2 3877 8fe9 8d 00 22 STA enemy_shot_xpos 3878 8fec .L0301 ;; enemy_shot_ypos = enemy01_ypos + 4 3879 8fec 3880 8fec ad 5a 01 LDA enemy01_ypos 3881 8fef 18 CLC 3882 8ff0 69 04 ADC #4 3883 8ff2 8d 20 22 STA enemy_shot_ypos 3884 8ff5 . 3885 8ff5 ;; 3886 8ff5 3887 8ff5 .L0302 ;; Temp_XSu = 0 3888 8ff5 3889 8ff5 a9 00 LDA #0 3890 8ff7 8d 8f 01 STA Temp_XSu 3891 8ffa .L0303 ;; Temp_YSu = 0 3892 8ffa 3893 8ffa a9 00 LDA #0 3894 8ffc 8d 91 01 STA Temp_YSu 3895 8fff . 3896 8fff ;; 3897 8fff 3898 8fff . 3899 8fff ;; 3900 8fff 3901 8fff . 3902 8fff ;; 3903 8fff 3904 8fff . 3905 8fff ;; 3906 8fff 3907 8fff . 3908 8fff ;; 3909 8fff 3910 8fff .L0304 ;; if playerX = enemy_shot_xpos then Temp_XSf = 0 3911 8fff 3912 8fff ad 41 01 LDA playerX 3913 9002 cd 00 22 CMP enemy_shot_xpos 3914 9005 d0 05 BNE .skipL0304 3915 9007 .condpart104 3916 9007 a9 00 LDA #0 3917 9009 8d 90 01 STA Temp_XSf 3918 900c .skipL0304 3919 900c .L0305 ;; if playerX > enemy_shot_xpos then Temp_XSf = playerX - enemy_shot_xpos 3920 900c 3921 900c ad 00 22 LDA enemy_shot_xpos 3922 900f cd 41 01 CMP playerX 3923 9012 b0 0a BCS .skipL0305 3924 9014 .condpart105 3925 9014 ad 41 01 LDA playerX 3926 9017 38 SEC 3927 9018 ed 00 22 SBC enemy_shot_xpos 3928 901b 8d 90 01 STA Temp_XSf 3929 901e .skipL0305 3930 901e .L0306 ;; if playerX < enemy_shot_xpos then Temp_XSf = enemy_shot_xpos - playerX 3931 901e 3932 901e ad 41 01 LDA playerX 3933 9021 cd 00 22 CMP enemy_shot_xpos 3934 9024 b0 0a BCS .skipL0306 3935 9026 .condpart106 3936 9026 ad 00 22 LDA enemy_shot_xpos 3937 9029 38 SEC 3938 902a ed 41 01 SBC playerX 3939 902d 8d 90 01 STA Temp_XSf 3940 9030 .skipL0306 3941 9030 . 3942 9030 ;; 3943 9030 3944 9030 . 3945 9030 ;; 3946 9030 3947 9030 . 3948 9030 ;; 3949 9030 3950 9030 . 3951 9030 ;; 3952 9030 3953 9030 . 3954 9030 ;; 3955 9030 3956 9030 .L0307 ;; if playerY = enemy_shot_ypos then Temp_YSf = 0 3957 9030 3958 9030 ad 42 01 LDA playerY 3959 9033 cd 20 22 CMP enemy_shot_ypos 3960 9036 d0 05 BNE .skipL0307 3961 9038 .condpart107 3962 9038 a9 00 LDA #0 3963 903a 8d 92 01 STA Temp_YSf 3964 903d .skipL0307 3965 903d .L0308 ;; if playerY > enemy_shot_ypos then Temp_YSf = playerY - enemy_shot_ypos 3966 903d 3967 903d ad 20 22 LDA enemy_shot_ypos 3968 9040 cd 42 01 CMP playerY 3969 9043 b0 0a BCS .skipL0308 3970 9045 .condpart108 3971 9045 ad 42 01 LDA playerY 3972 9048 38 SEC 3973 9049 ed 20 22 SBC enemy_shot_ypos 3974 904c 8d 92 01 STA Temp_YSf 3975 904f .skipL0308 3976 904f .L0309 ;; if playerY < enemy_shot_ypos then Temp_YSf = enemy_shot_ypos - playerY 3977 904f 3978 904f ad 42 01 LDA playerY 3979 9052 cd 20 22 CMP enemy_shot_ypos 3980 9055 b0 0a BCS .skipL0309 3981 9057 .condpart109 3982 9057 ad 20 22 LDA enemy_shot_ypos 3983 905a 38 SEC 3984 905b ed 42 01 SBC playerY 3985 905e 8d 92 01 STA Temp_YSf 3986 9061 .skipL0309 3987 9061 . 3988 9061 ;; 3989 9061 3990 9061 . 3991 9061 ;; 3992 9061 3993 9061 . 3994 9061 ;; 3995 9061 3996 9061 . 3997 9061 ;; 3998 9061 3999 9061 . 4000 9061 ;; 4001 9061 4002 9061 . 4003 9061 ;; 4004 9061 4005 9061 . 4006 9061 ;; 4007 9061 4008 9061 .L0310 ;; if Temp_YSf = 0 && Temp_XSf = 0 then enemy_shotFlag = FALSE : return 4009 9061 4010 9061 ad 92 01 LDA Temp_YSf 4011 9064 c9 00 CMP #0 4012 9066 d0 16 BNE .skipL0310 4013 9068 .condpart110 4014 9068 ad 90 01 LDA Temp_XSf 4015 906b c9 00 CMP #0 4016 906d d0 0f BNE .skip110then 4017 906f .condpart111 4018 906f a9 00 LDA #FALSE 4019 9071 8d 9c 01 STA enemy_shotFlag 4020 9074 ba tsx 4021 9075 bd 02 01 lda $102,x 4022 9078 f0 01 beq bankswitchret25 4023 907a 60 RTS 4024 907b bankswitchret25 4025 907b 4c 9e f4 JMP BS_return 4026 907e .skip110then 4027 907e .skipL0310 4028 907e . 4029 907e ;; 4030 907e 4031 907e . 4032 907e ;; 4033 907e 4034 907e . 4035 907e ;; 4036 907e 4037 907e . 4038 907e ;; 4039 907e 4040 907e .L0311 ;; if playerX <= enemy_shot_xpos then enemy_shot_direction = enemy_shot_direction | %00000010 else enemy_shot_direction = enemy_shot_direction & %11111101 4041 907e 4042 907e ad 00 22 LDA enemy_shot_xpos 4043 9081 cd 41 01 CMP playerX 4044 9084 90 0b BCC .skipL0311 4045 9086 .condpart112 4046 9086 ad 90 22 LDA enemy_shot_direction 4047 9089 09 02 ORA #%00000010 4048 908b 8d 90 22 STA enemy_shot_direction 4049 908e 4c 99 90 jmp .skipelse1 4050 9091 .skipL0311 4051 9091 ad 90 22 LDA enemy_shot_direction 4052 9094 29 fd AND #%11111101 4053 9096 8d 90 22 STA enemy_shot_direction 4054 9099 .skipelse1 4055 9099 .L0312 ;; if playerY <= enemy_shot_ypos then enemy_shot_direction = enemy_shot_direction | %00000001 else enemy_shot_direction = enemy_shot_direction & %11111110 4056 9099 4057 9099 ad 20 22 LDA enemy_shot_ypos 4058 909c cd 42 01 CMP playerY 4059 909f 90 0b BCC .skipL0312 4060 90a1 .condpart113 4061 90a1 ad 90 22 LDA enemy_shot_direction 4062 90a4 09 01 ORA #%00000001 4063 90a6 8d 90 22 STA enemy_shot_direction 4064 90a9 4c b4 90 jmp .skipelse2 4065 90ac .skipL0312 4066 90ac ad 90 22 LDA enemy_shot_direction 4067 90af 29 fe AND #%11111110 4068 90b1 8d 90 22 STA enemy_shot_direction 4069 90b4 .skipelse2 4070 90b4 . 4071 90b4 ;; 4072 90b4 4073 90b4 .L0313 ;; Temp_XSu = 0 4074 90b4 4075 90b4 a9 00 LDA #0 4076 90b6 8d 8f 01 STA Temp_XSu 4077 90b9 .L0314 ;; Temp_YSu = 0 4078 90b9 4079 90b9 a9 00 LDA #0 4080 90bb 8d 91 01 STA Temp_YSu 4081 90be . 4082 90be ;; 4083 90be 4084 90be .L0315 ;; Total_XSu = 0 4085 90be 4086 90be a9 00 LDA #0 4087 90c0 8d 8b 01 STA Total_XSu 4088 90c3 .L0316 ;; Total_XSf = 0 4089 90c3 4090 90c3 a9 00 LDA #0 4091 90c5 8d 8c 01 STA Total_XSf 4092 90c8 .L0317 ;; Total_YSu = 0 4093 90c8 4094 90c8 a9 00 LDA #0 4095 90ca 8d 8d 01 STA Total_YSu 4096 90cd .L0318 ;; Total_YSf = 0 4097 90cd 4098 90cd a9 00 LDA #0 4099 90cf 8d 8e 01 STA Total_YSf 4100 90d2 . 4101 90d2 ;; 4102 90d2 4103 90d2 .es_SpeedIncrease 4104 90d2 ;; es_SpeedIncrease 4105 90d2 4106 90d2 .L0319 ;; Total_speedX = Total_speedX + Temp_X_speed 4107 90d2 4108 90d2 ad 8c 01 LDA Total_XSf 4109 90d5 18 CLC 4110 90d6 6d 90 01 ADC Temp_XSf 4111 90d9 8d 8c 01 STA Total_XSf 4112 90dc ad 8b 01 LDA Total_speedX 4113 90df 6d 8f 01 ADC Temp_X_speed 4114 90e2 8d 8b 01 STA Total_speedX 4115 90e5 .L0320 ;; Total_speedY = Total_speedY + Temp_Y_speed 4116 90e5 4117 90e5 ad 8e 01 LDA Total_YSf 4118 90e8 18 CLC 4119 90e9 6d 92 01 ADC Temp_YSf 4120 90ec 8d 8e 01 STA Total_YSf 4121 90ef ad 8d 01 LDA Total_speedY 4122 90f2 6d 91 01 ADC Temp_Y_speed 4123 90f5 8d 8d 01 STA Total_speedY 4124 90f8 .L0321 ;; if Total_XSu = 0 && Total_YSu = 0 then goto es_SpeedIncrease 4125 90f8 4126 90f8 ad 8b 01 LDA Total_XSu 4127 90fb c9 00 CMP #0 4128 90fd d0 0a BNE .skipL0321 4129 90ff .condpart114 4130 90ff ad 8d 01 LDA Total_YSu 4131 9102 c9 00 CMP #0 4132 9104 d0 03 BNE .skip114then 4133 9106 .condpart115 4134 9106 4c d2 90 jmp .es_SpeedIncrease 4135 9109 4136 9109 .skip114then 4137 9109 .skipL0321 4138 9109 . 4139 9109 ;; 4140 9109 4141 9109 . 4142 9109 ;; 4143 9109 4144 9109 . 4145 9109 ;; 4146 9109 4147 9109 . 4148 9109 ;; 4149 9109 4150 9109 . 4151 9109 ;; 4152 9109 4153 9109 . 4154 9109 ;; 4155 9109 4156 9109 .L0322 ;; enemy_shot_Xf = Total_XSu 4157 9109 4158 9109 ad 8b 01 LDA Total_XSu 4159 910c 8d 10 22 STA enemy_shot_Xf 4160 910f .L0323 ;; enemy_shot_Sxf = Total_XSf 4161 910f 4162 910f ad 8c 01 LDA Total_XSf 4163 9112 8d 50 22 STA enemy_shot_Sxf 4164 9115 .L0324 ;; enemy_shot_Yf = Total_YSu 4165 9115 4166 9115 ad 8d 01 LDA Total_YSu 4167 9118 8d 30 22 STA enemy_shot_Yf 4168 911b .L0325 ;; enemy_shot_Syf = Total_YSf 4169 911b 4170 911b ad 8e 01 LDA Total_YSf 4171 911e 8d 70 22 STA enemy_shot_Syf 4172 9121 .L0326 ;; return 4173 9121 4174 9121 ba tsx 4175 9122 bd 02 01 lda $102,x 4176 9125 f0 01 beq bankswitchret26 4177 9127 60 RTS 4178 9128 bankswitchret26 4179 9128 4c 9e f4 JMP BS_return 4180 912b . 4181 912b ;; 4182 912b 4183 912b .skip_enemy_shot 4184 912b ;; skip_enemy_shot 4185 912b 4186 912b .L0327 ;; z = z - 1 4187 912b 4188 912b a5 ff LDA z 4189 912d 38 SEC 4190 912e e9 01 SBC #1 4191 9130 85 ff STA z 4192 9132 .L0328 ;; if z < 15 then shoot_enemy_bullet 4193 9132 4194 9132 a5 ff LDA z 4195 9134 c9 0f CMP #15 4196 9136 - if ((* - .shoot_enemy_bullet) < 127) && ((* - .shoot_enemy_bullet) > -128) 4197 9136 - bcc .shoot_enemy_bullet 4198 9136 else 4199 9136 b0 03 bcs .4skipshoot_enemy_bullet 4200 9138 4c d0 8f jmp .shoot_enemy_bullet 4201 913b .4skipshoot_enemy_bullet 4202 913b endif 4203 913b .L0329 ;; return 4204 913b 4205 913b ba tsx 4206 913c bd 02 01 lda $102,x 4207 913f f0 01 beq bankswitchret27 4208 9141 60 RTS 4209 9142 bankswitchret27 4210 9142 4c 9e f4 JMP BS_return 4211 9145 . 4212 9145 ;; 4213 9145 4214 9145 .move_enemyshot 4215 9145 ;; move_enemyshot 4216 9145 4217 9145 . 4218 9145 ;; 4219 9145 4220 9145 .L0330 ;; z = 15 4221 9145 4222 9145 a9 0f LDA #15 4223 9147 85 ff STA z 4224 9149 .update_enemyshot 4225 9149 ;; update_enemyshot 4226 9149 4227 9149 . 4228 9149 ;; 4229 9149 4230 9149 . 4231 9149 ;; 4232 9149 4233 9149 . 4234 9149 ;; 4235 9149 4236 9149 . 4237 9149 ;; 4238 9149 4239 9149 . 4240 9149 ;; 4241 9149 4242 9149 . 4243 9149 ;; 4244 9149 4245 9149 . 4246 9149 ;; 4247 9149 4248 9149 . 4249 9149 ;; 4250 9149 4251 9149 . 4252 9149 ;; 4253 9149 4254 9149 . 4255 9149 ;; 4256 9149 4257 9149 . 4258 9149 ;; 4259 9149 4260 9149 . 4261 9149 ;; 4262 9149 4263 9149 .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 4264 9149 4265 9149 ; complex condition detected 4266 9149 ; complex statement detected 4267 9149 ad 90 22 LDA enemy_shot_direction 4268 914c 29 01 AND #1 4269 914e c9 01 CMP #1 4270 9150 d0 16 BNE .skipL0331 4271 9152 .condpart116 4272 9152 ad 9a 01 LDA var90 4273 9155 38 SEC 4274 9156 ed 98 01 SBC var88 4275 9159 8d 9a 01 STA var90 4276 915c ad 96 01 LDA Mob_Pos_Y 4277 915f ed 94 01 SBC Mob_SpeedY 4278 9162 8d 96 01 STA Mob_Pos_Y 4279 9165 4c 7b 91 jmp .skipelse3 4280 9168 .skipL0331 4281 9168 ad 9a 01 LDA var90 4282 916b 18 CLC 4283 916c 6d 98 01 ADC var88 4284 916f 8d 9a 01 STA var90 4285 9172 ad 96 01 LDA Mob_Pos_Y 4286 9175 6d 94 01 ADC Mob_SpeedY 4287 9178 8d 96 01 STA Mob_Pos_Y 4288 917b .skipelse3 4289 917b .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 4290 917b 4291 917b ; complex condition detected 4292 917b ; complex statement detected 4293 917b ad 90 22 LDA enemy_shot_direction 4294 917e 29 02 AND #2 4295 9180 c9 02 CMP #2 4296 9182 d0 16 BNE .skipL0332 4297 9184 .condpart117 4298 9184 ad 99 01 LDA var89 4299 9187 38 SEC 4300 9188 ed 97 01 SBC var87 4301 918b 8d 99 01 STA var89 4302 918e ad 95 01 LDA Mob_Pos_X 4303 9191 ed 93 01 SBC Mob_SpeedX 4304 9194 8d 95 01 STA Mob_Pos_X 4305 9197 4c ad 91 jmp .skipelse4 4306 919a .skipL0332 4307 919a ad 99 01 LDA var89 4308 919d 18 CLC 4309 919e 6d 97 01 ADC var87 4310 91a1 8d 99 01 STA var89 4311 91a4 ad 95 01 LDA Mob_Pos_X 4312 91a7 6d 93 01 ADC Mob_SpeedX 4313 91aa 8d 95 01 STA Mob_Pos_X 4314 91ad .skipelse4 4315 91ad . 4316 91ad ;; 4317 91ad 4318 91ad . 4319 91ad ;; 4320 91ad 4321 91ad . 4322 91ad ;; 4323 91ad 4324 91ad . 4325 91ad ;; 4326 91ad 4327 91ad . 4328 91ad ;; 4329 91ad 4330 91ad . 4331 91ad ;; 4332 91ad 4333 91ad .L0333 ;; return 4334 91ad 4335 91ad ba tsx 4336 91ae bd 02 01 lda $102,x 4337 91b1 f0 01 beq bankswitchret28 4338 91b3 60 RTS 4339 91b4 bankswitchret28 4340 91b4 4c 9e f4 JMP BS_return 4341 91b7 . 4342 91b7 ;; 4343 91b7 4344 91b7 . 4345 91b7 ;; 4346 91b7 4347 91b7 . 4348 91b7 ;; 4349 91b7 4350 91b7 .L0334 ;; data sfx_bling 4351 91b7 4352 91b7 4c f0 91 JMP .skipL0334 4353 91ba sfx_bling 4354 91ba 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4355 91bd 4356 91bd 1c 04 07 .byte.b $1c,$04,$07 4357 91c0 4358 91c0 1b 04 07 .byte.b $1b,$04,$07 4359 91c3 4360 91c3 04 0f 05 .byte.b $04,$0f,$05 4361 91c6 4362 91c6 15 04 09 .byte.b $15,$04,$09 4363 91c9 4364 91c9 16 04 07 .byte.b $16,$04,$07 4365 91cc 4366 91cc 03 0f 04 .byte.b $03,$0f,$04 4367 91cf 4368 91cf 11 04 08 .byte.b $11,$04,$08 4369 91d2 4370 91d2 11 04 08 .byte.b $11,$04,$08 4371 91d5 4372 91d5 11 04 04 .byte.b $11,$04,$04 4373 91d8 4374 91d8 0e 04 09 .byte.b $0e,$04,$09 4375 91db 4376 91db 0e 04 07 .byte.b $0e,$04,$07 4377 91de 4378 91de 0e 04 04 .byte.b $0e,$04,$04 4379 91e1 4380 91e1 1c 04 07 .byte.b $1c,$04,$07 4381 91e4 4382 91e4 1b 04 05 .byte.b $1b,$04,$05 4383 91e7 4384 91e7 1c 04 04 .byte.b $1c,$04,$04 4385 91ea 4386 91ea 1b 04 02 .byte.b $1b,$04,$02 4387 91ed 4388 91ed 00 00 00 .byte.b $00,$00,$00 4389 91f0 4390 91f0 .skipL0334 4391 91f0 sfx_bling_lo SET #sfx_bling 4393 91f0 . 4394 91f0 ;; 4395 91f0 4396 91f0 .L0335 ;; data sfx_pulsecannon 4397 91f0 4398 91f0 4c 47 92 JMP .skipL0335 4399 91f3 sfx_pulsecannon 4400 91f3 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4401 91f6 4402 91f6 1e 0c 0a .byte.b $1e,$0c,$0a ; first chunk of freq,channel,volume 4403 91f9 4404 91f9 07 06 0f .byte.b $07,$06,$0f 4405 91fc 4406 91fc 07 06 0f .byte.b $07,$06,$0f 4407 91ff 4408 91ff 1e 06 0f .byte.b $1e,$06,$0f 4409 9202 4410 9202 17 0c 0b .byte.b $17,$0c,$0b 4411 9205 4412 9205 1b 0c 0b .byte.b $1b,$0c,$0b 4413 9208 4414 9208 1e 0c 0f .byte.b $1e,$0c,$0f 4415 920b 4416 920b 07 06 0f .byte.b $07,$06,$0f 4417 920e 4418 920e 07 06 0f .byte.b $07,$06,$0f 4419 9211 4420 9211 1e 06 08 .byte.b $1e,$06,$08 4421 9214 4422 9214 17 0c 06 .byte.b $17,$0c,$06 4423 9217 4424 9217 1b 0c 0f .byte.b $1b,$0c,$0f 4425 921a 4426 921a 1e 0c 0f .byte.b $1e,$0c,$0f 4427 921d 4428 921d 07 06 0f .byte.b $07,$06,$0f 4429 9220 4430 9220 07 06 0f .byte.b $07,$06,$0f 4431 9223 4432 9223 0a 06 0a .byte.b $0a,$06,$0a 4433 9226 4434 9226 17 0c 0a .byte.b $17,$0c,$0a 4435 9229 4436 9229 1e 0c 04 .byte.b $1e,$0c,$04 4437 922c 4438 922c 1e 06 09 .byte.b $1e,$06,$09 4439 922f 4440 922f 1b 04 05 .byte.b $1b,$04,$05 4441 9232 4442 9232 07 06 0f .byte.b $07,$06,$0f 4443 9235 4444 9235 0a 06 09 .byte.b $0a,$06,$09 4445 9238 4446 9238 17 0c 0d .byte.b $17,$0c,$0d 4447 923b 4448 923b 1b 0c 09 .byte.b $1b,$0c,$09 4449 923e 4450 923e 0a 06 05 .byte.b $0a,$06,$05 4451 9241 4452 9241 17 0c 03 .byte.b $17,$0c,$03 4453 9244 4454 9244 00 00 00 .byte.b $00,$00,$00 4455 9247 4456 9247 .skipL0335 4457 9247 sfx_pulsecannon_lo SET #sfx_pulsecannon 4459 9247 . 4460 9247 ;; 4461 9247 4462 9247 .L0336 ;; data sfx_plainlaser 4463 9247 4464 9247 4c 7a 92 JMP .skipL0336 4465 924a sfx_plainlaser 4466 924a 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4467 924d 4468 924d 10 04 06 .byte.b $10,$04,$06 ; first chunk of freq,channel,volume 4469 9250 4470 9250 13 04 08 .byte.b $13,$04,$08 4471 9253 4472 9253 16 04 08 .byte.b $16,$04,$08 4473 9256 4474 9256 16 04 07 .byte.b $16,$04,$07 4475 9259 4476 9259 1c 04 09 .byte.b $1c,$04,$09 4477 925c 4478 925c 0b 0c 0f .byte.b $0b,$0c,$0f 4479 925f 4480 925f 0d 0c 0f .byte.b $0d,$0c,$0f 4481 9262 4482 9262 0e 0c 0f .byte.b $0e,$0c,$0f 4483 9265 4484 9265 0e 0c 0f .byte.b $0e,$0c,$0f 4485 9268 4486 9268 12 0c 0f .byte.b $12,$0c,$0f 4487 926b 4488 926b 03 06 0d .byte.b $03,$06,$0d 4489 926e 4490 926e 1e 0c 0a .byte.b $1e,$0c,$0a 4491 9271 4492 9271 1e 0c 0c .byte.b $1e,$0c,$0c 4493 9274 4494 9274 0a 06 04 .byte.b $0a,$06,$04 4495 9277 4496 9277 00 00 00 .byte.b $00,$00,$00 4497 927a 4498 927a .skipL0336 4499 927a sfx_plainlaser_lo SET #sfx_plainlaser 4501 927a . 4502 927a ;; 4503 927a 4504 927a .L0337 ;; data sfx_explosion 4505 927a 4506 927a 4c 0d 93 JMP .skipL0337 4507 927d sfx_explosion 4508 927d 10 10 00 .byte.b $10,$10,$00 4509 9280 4510 9280 01 08 02 .byte.b $01,$08,$02 4511 9283 4512 9283 0b 0c 05 .byte.b $0b,$0c,$05 4513 9286 4514 9286 04 06 08 .byte.b $04,$06,$08 4515 9289 4516 9289 03 0e 0f .byte.b $03,$0e,$0f 4517 928c 4518 928c 09 06 0f .byte.b $09,$06,$0f 4519 928f 4520 928f 0d 06 0f .byte.b $0d,$06,$0f 4521 9292 4522 9292 04 0e 0f .byte.b $04,$0e,$0f 4523 9295 4524 9295 0f 06 08 .byte.b $0f,$06,$08 4525 9298 4526 9298 09 06 04 .byte.b $09,$06,$04 4527 929b 4528 929b 16 01 03 .byte.b $16,$01,$03 4529 929e 4530 929e 0c 06 04 .byte.b $0c,$06,$04 4531 92a1 4532 92a1 09 06 05 .byte.b $09,$06,$05 4533 92a4 4534 92a4 0a 06 03 .byte.b $0a,$06,$03 4535 92a7 4536 92a7 09 06 05 .byte.b $09,$06,$05 4537 92aa 4538 92aa 0d 06 08 .byte.b $0d,$06,$08 4539 92ad 4540 92ad 09 06 04 .byte.b $09,$06,$04 4541 92b0 4542 92b0 04 0e 06 .byte.b $04,$0e,$06 4543 92b3 4544 92b3 0f 06 05 .byte.b $0f,$06,$05 4545 92b6 4546 92b6 0f 06 07 .byte.b $0f,$06,$07 4547 92b9 4548 92b9 04 0e 07 .byte.b $04,$0e,$07 4549 92bc 4550 92bc 08 06 06 .byte.b $08,$06,$06 4551 92bf 4552 92bf 03 0e 08 .byte.b $03,$0e,$08 4553 92c2 4554 92c2 0f 06 06 .byte.b $0f,$06,$06 4555 92c5 4556 92c5 09 06 05 .byte.b $09,$06,$05 4557 92c8 4558 92c8 06 06 05 .byte.b $06,$06,$05 4559 92cb 4560 92cb 03 0e 05 .byte.b $03,$0e,$05 4561 92ce 4562 92ce 0e 06 06 .byte.b $0e,$06,$06 4563 92d1 4564 92d1 02 0e 05 .byte.b $02,$0e,$05 4565 92d4 4566 92d4 0f 06 03 .byte.b $0f,$06,$03 4567 92d7 4568 92d7 0e 06 06 .byte.b $0e,$06,$06 4569 92da 4570 92da 09 06 05 .byte.b $09,$06,$05 4571 92dd 4572 92dd 0c 06 05 .byte.b $0c,$06,$05 4573 92e0 4574 92e0 0f 06 03 .byte.b $0f,$06,$03 4575 92e3 4576 92e3 04 0e 08 .byte.b $04,$0e,$08 4577 92e6 4578 92e6 0c 06 03 .byte.b $0c,$06,$03 4579 92e9 4580 92e9 0f 06 03 .byte.b $0f,$06,$03 4581 92ec 4582 92ec 0c 06 06 .byte.b $0c,$06,$06 4583 92ef 4584 92ef 0f 06 04 .byte.b $0f,$06,$04 4585 92f2 4586 92f2 0f 06 05 .byte.b $0f,$06,$05 4587 92f5 4588 92f5 0f 06 03 .byte.b $0f,$06,$03 4589 92f8 4590 92f8 0a 06 04 .byte.b $0a,$06,$04 4591 92fb 4592 92fb 0f 06 03 .byte.b $0f,$06,$03 4593 92fe 4594 92fe 08 06 03 .byte.b $08,$06,$03 4595 9301 4596 9301 0c 06 03 .byte.b $0c,$06,$03 4597 9304 4598 9304 0e 06 03 .byte.b $0e,$06,$03 4599 9307 4600 9307 08 06 03 .byte.b $08,$06,$03 4601 930a 4602 930a 00 00 00 .byte.b $00,$00,$00 4603 930d 4604 930d .skipL0337 4605 930d sfx_explosion_lo SET #sfx_explosion 4607 930d DMAHOLEEND0 SET . 4608 930d gameend 4609 930d DMAHOLEEND0 SET . 7411 bytes of ROM space left in the main area of bank 1. 4610 930d echo " ",[($B000 - .)]d , "bytes of ROM space left in the main area of bank 1." 4611 930d - if ($B000 - .) < 0 4612 930d -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 4613 930d endif 4614 930d 4615 b000 ORG $B000,0 ; ************* 4616 b000 4617 b000 RORG $B000 ; ************* 4618 b000 4619 b000 vertical_shooting_font 4620 b000 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4621 b020 00 00 00 00* HEX 00000000000000000000000000 4622 b02d vertical_shooting_ship 4623 b02d 07 d0 HEX 07d0 4624 b02f vertical_shooting_ship_tallsprite_00 4625 b02f 80 02 HEX 8002 4626 b031 vertical_shooting_bullet 4627 b031 28 HEX 28 4628 b032 vertical_shooting_enemyshot 4629 b032 00 HEX 00 4630 b033 vertical_shooting_powerup 4631 b033 28 00 HEX 2800 4632 b035 vertical_shooting_enemy01 4633 b035 09 e0 HEX 09e0 4634 b037 vertical_shooting_enemy01_tallsprite_00 4635 b037 40 03 HEX 4003 4636 b039 vertical_shooting_1up 4637 b039 15 55 HEX 1555 4638 b03b vertical_shooting_demo_explosion_upd0 4639 b03b 00 00 HEX 0000 4640 b03d vertical_shooting_demo_explosion_upd0_tallsprite_00 4641 b03d 00 00 HEX 0000 4642 b03f vertical_shooting_demo_explosion_upd1 4643 b03f 02 80 HEX 0280 4644 b041 vertical_shooting_demo_explosion_upd1_tallsprite_00 4645 b041 00 00 HEX 0000 4646 b043 vertical_shooting_demo_explosion_upd2 4647 b043 05 50 HEX 0550 4648 b045 vertical_shooting_demo_explosion_upd2_tallsprite_00 4649 b045 00 00 HEX 0000 4650 b047 vertical_shooting_demo_explosion_upd3 4651 b047 15 54 HEX 1554 4652 b049 vertical_shooting_demo_explosion_upd3_tallsprite_00 4653 b049 00 00 HEX 0000 4654 b04b vertical_shooting_demo_explosion_upd4 4655 b04b 07 d0 HEX 07d0 4656 b04d vertical_shooting_demo_explosion_upd4_tallsprite_00 4657 b04d 00 00 HEX 0000 4658 b04f vertical_shooting_demo_explosion_upd5 4659 b04f 0c 30 HEX 0c30 4660 b051 vertical_shooting_demo_explosion_upd5_tallsprite_00 4661 b051 01 40 HEX 0140 4662 b053 vertical_shooting_demo_explosion_upd6 4663 b053 00 00 HEX 0000 4664 b055 vertical_shooting_demo_explosion_upd6_tallsprite_00 4665 b055 01 40 HEX 0140 4666 b057 vertical_shooting_demo_explosion_upd7 4667 b057 00 00 HEX 0000 4668 b059 vertical_shooting_demo_explosion_upd7_tallsprite_00 4669 b059 01 40 HEX 0140 4670 b05b vertical_shooting_demo_explosion_upd8 4671 b05b 00 00 HEX 0000 4672 b05d vertical_shooting_demo_explosion_upd8_tallsprite_00 4673 b05d 01 40 HEX 0140 4674 b05f vertical_shooting_demo_explosion_upd9 4675 b05f 00 00 HEX 0000 4676 b061 vertical_shooting_demo_explosion_upd9_tallsprite_00 4677 b061 01 40 HEX 0140 4678 b063 vertical_shooting_demo_explosion_upd10 4679 b063 00 00 HEX 0000 4680 b065 vertical_shooting_demo_explosion_upd10_tallsprite_00 4681 b065 01 40 HEX 0140 4682 b067 vertical_shooting_laser 4683 b067 88 HEX 88 4684 b068 vertical_shooting_laser_tallsprite_00 4685 b068 cc HEX cc 4686 b069 4687 b100 ORG $B100,0 ; ************* 4688 b100 4689 b100 RORG $B100 ; ************* 4690 b100 4691 b100 ;vertical_shooting_font 4692 b100 00 54 54 54* HEX 0054545454045454045404445054505440544454104454444410401444501014 4693 b120 10 44 44 10* HEX 10444410544040101040400000 4694 b12d ;vertical_shooting_ship 4695 b12d 07 d0 HEX 07d0 4696 b12f ;vertical_shooting_ship_tallsprite_00 4697 b12f 80 02 HEX 8002 4698 b131 ;vertical_shooting_bullet 4699 b131 28 HEX 28 4700 b132 ;vertical_shooting_enemyshot 4701 b132 88 HEX 88 4702 b133 ;vertical_shooting_powerup 4703 b133 78 08 HEX 7808 4704 b135 ;vertical_shooting_enemy01 4705 b135 09 e0 HEX 09e0 4706 b137 ;vertical_shooting_enemy01_tallsprite_00 4707 b137 50 0f HEX 500f 4708 b139 ;vertical_shooting_1up 4709 b139 ea a9 HEX eaa9 4710 b13b ;vertical_shooting_demo_explosion_upd0 4711 b13b 00 00 HEX 0000 4712 b13d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 4713 b13d 00 00 HEX 0000 4714 b13f ;vertical_shooting_demo_explosion_upd1 4715 b13f 01 40 HEX 0140 4716 b141 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 4717 b141 00 00 HEX 0000 4718 b143 ;vertical_shooting_demo_explosion_upd2 4719 b143 09 60 HEX 0960 4720 b145 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 4721 b145 00 00 HEX 0000 4722 b147 ;vertical_shooting_demo_explosion_upd3 4723 b147 25 58 HEX 2558 4724 b149 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 4725 b149 00 00 HEX 0000 4726 b14b ;vertical_shooting_demo_explosion_upd4 4727 b14b 05 50 HEX 0550 4728 b14d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 4729 b14d 02 80 HEX 0280 4730 b14f ;vertical_shooting_demo_explosion_upd5 4731 b14f 0b e0 HEX 0be0 4732 b151 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 4733 b151 01 40 HEX 0140 4734 b153 ;vertical_shooting_demo_explosion_upd6 4735 b153 0c 30 HEX 0c30 4736 b155 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 4737 b155 01 40 HEX 0140 4738 b157 ;vertical_shooting_demo_explosion_upd7 4739 b157 00 00 HEX 0000 4740 b159 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 4741 b159 01 40 HEX 0140 4742 b15b ;vertical_shooting_demo_explosion_upd8 4743 b15b 00 00 HEX 0000 4744 b15d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 4745 b15d 01 40 HEX 0140 4746 b15f ;vertical_shooting_demo_explosion_upd9 4747 b15f 00 00 HEX 0000 4748 b161 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 4749 b161 01 40 HEX 0140 4750 b163 ;vertical_shooting_demo_explosion_upd10 4751 b163 00 00 HEX 0000 4752 b165 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 4753 b165 00 00 HEX 0000 4754 b167 ;vertical_shooting_laser 4755 b167 88 HEX 88 4756 b168 ;vertical_shooting_laser_tallsprite_00 4757 b168 cc HEX cc 4758 b169 4759 b200 ORG $B200,0 ; ************* 4760 b200 4761 b200 RORG $B200 ; ************* 4762 b200 4763 b200 ;vertical_shooting_font 4764 b200 00 44 10 40* HEX 0044104004040444044404444440444040444410444440444444404444041044 4765 b220 10 54 44 10* HEX 10544410400010000000100000 4766 b22d ;vertical_shooting_ship 4767 b22d 03 c0 HEX 03c0 4768 b22f ;vertical_shooting_ship_tallsprite_00 4769 b22f a1 4a HEX a14a 4770 b231 ;vertical_shooting_bullet 4771 b231 3c HEX 3c 4772 b232 ;vertical_shooting_enemyshot 4773 b232 10 HEX 10 4774 b233 ;vertical_shooting_powerup 4775 b233 78 1e HEX 781e 4776 b235 ;vertical_shooting_enemy01 4777 b235 19 ec HEX 19ec 4778 b237 ;vertical_shooting_enemy01_tallsprite_00 4779 b237 5a af HEX 5aaf 4780 b239 ;vertical_shooting_1up 4781 b239 d5 58 HEX d558 4782 b23b ;vertical_shooting_demo_explosion_upd0 4783 b23b 00 00 HEX 0000 4784 b23d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 4785 b23d 00 00 HEX 0000 4786 b23f ;vertical_shooting_demo_explosion_upd1 4787 b23f 00 00 HEX 0000 4788 b241 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 4789 b241 00 00 HEX 0000 4790 b243 ;vertical_shooting_demo_explosion_upd2 4791 b243 02 80 HEX 0280 4792 b245 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 4793 b245 00 00 HEX 0000 4794 b247 ;vertical_shooting_demo_explosion_upd3 4795 b247 09 60 HEX 0960 4796 b249 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 4797 b249 00 00 HEX 0000 4798 b24b ;vertical_shooting_demo_explosion_upd4 4799 b24b 05 50 HEX 0550 4800 b24d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 4801 b24d 02 80 HEX 0280 4802 b24f ;vertical_shooting_demo_explosion_upd5 4803 b24f 0a a0 HEX 0aa0 4804 b251 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 4805 b251 05 50 HEX 0550 4806 b253 ;vertical_shooting_demo_explosion_upd6 4807 b253 0b e0 HEX 0be0 4808 b255 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 4809 b255 05 50 HEX 0550 4810 b257 ;vertical_shooting_demo_explosion_upd7 4811 b257 08 20 HEX 0820 4812 b259 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 4813 b259 05 50 HEX 0550 4814 b25b ;vertical_shooting_demo_explosion_upd8 4815 b25b 00 00 HEX 0000 4816 b25d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 4817 b25d 05 50 HEX 0550 4818 b25f ;vertical_shooting_demo_explosion_upd9 4819 b25f 00 00 HEX 0000 4820 b261 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 4821 b261 06 90 HEX 0690 4822 b263 ;vertical_shooting_demo_explosion_upd10 4823 b263 00 00 HEX 0000 4824 b265 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 4825 b265 04 10 HEX 0410 4826 b267 ;vertical_shooting_laser 4827 b267 44 HEX 44 4828 b268 ;vertical_shooting_laser_tallsprite_00 4829 b268 cc HEX cc 4830 b269 4831 b300 ORG $B300,0 ; ************* 4832 b300 4833 b300 RORG $B300 ; ************* 4834 b300 4835 b300 ;vertical_shooting_font 4836 b300 00 44 10 40* HEX 0044104004040444044404444440444040444410044440444444404444041044 4837 b320 54 54 44 10* HEX 54544410100000101000000000 4838 b32d ;vertical_shooting_ship 4839 b32d 01 40 HEX 0140 4840 b32f ;vertical_shooting_ship_tallsprite_00 4841 b32f a5 5a HEX a55a 4842 b331 ;vertical_shooting_bullet 4843 b331 3c HEX 3c 4844 b332 ;vertical_shooting_enemyshot 4845 b332 74 HEX 74 4846 b333 ;vertical_shooting_powerup 4847 b333 7a a4 HEX 7aa4 4848 b335 ;vertical_shooting_enemy01 4849 b335 59 ef HEX 59ef 4850 b337 ;vertical_shooting_enemy01_tallsprite_00 4851 b337 59 ef HEX 59ef 4852 b339 ;vertical_shooting_1up 4853 b339 35 60 HEX 3560 4854 b33b ;vertical_shooting_demo_explosion_upd0 4855 b33b 00 00 HEX 0000 4856 b33d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 4857 b33d 00 00 HEX 0000 4858 b33f ;vertical_shooting_demo_explosion_upd1 4859 b33f 00 00 HEX 0000 4860 b341 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 4861 b341 00 00 HEX 0000 4862 b343 ;vertical_shooting_demo_explosion_upd2 4863 b343 00 00 HEX 0000 4864 b345 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 4865 b345 00 00 HEX 0000 4866 b347 ;vertical_shooting_demo_explosion_upd3 4867 b347 02 80 HEX 0280 4868 b349 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 4869 b349 00 00 HEX 0000 4870 b34b ;vertical_shooting_demo_explosion_upd4 4871 b34b 09 60 HEX 0960 4872 b34d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 4873 b34d 09 60 HEX 0960 4874 b34f ;vertical_shooting_demo_explosion_upd5 4875 b34f 06 90 HEX 0690 4876 b351 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 4877 b351 06 90 HEX 0690 4878 b353 ;vertical_shooting_demo_explosion_upd6 4879 b353 06 90 HEX 0690 4880 b355 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 4881 b355 06 90 HEX 0690 4882 b357 ;vertical_shooting_demo_explosion_upd7 4883 b357 06 90 HEX 0690 4884 b359 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 4885 b359 07 d0 HEX 07d0 4886 b35b ;vertical_shooting_demo_explosion_upd8 4887 b35b 08 20 HEX 0820 4888 b35d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 4889 b35d 06 90 HEX 0690 4890 b35f ;vertical_shooting_demo_explosion_upd9 4891 b35f 00 00 HEX 0000 4892 b361 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 4893 b361 08 20 HEX 0820 4894 b363 ;vertical_shooting_demo_explosion_upd10 4895 b363 00 00 HEX 0000 4896 b365 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 4897 b365 00 00 HEX 0000 4898 b367 ;vertical_shooting_laser 4899 b367 44 HEX 44 4900 b368 ;vertical_shooting_laser_tallsprite_00 4901 b368 cc HEX cc 4902 b369 4903 b400 ORG $B400,0 ; ************* 4904 b400 4905 b400 RORG $B400 ; ************* 4906 b400 4907 b400 ;vertical_shooting_font 4908 b400 00 44 10 54* HEX 0044105454545454045454545040445454445410045040544444504450101044 4909 b420 44 44 10 10* HEX 44441010100000101000000000 4910 b42d ;vertical_shooting_ship 4911 b42d 01 40 HEX 0140 4912 b42f ;vertical_shooting_ship_tallsprite_00 4913 b42f a5 5a HEX a55a 4914 b431 ;vertical_shooting_bullet 4915 b431 14 HEX 14 4916 b432 ;vertical_shooting_enemyshot 4917 b432 74 HEX 74 4918 b433 ;vertical_shooting_powerup 4919 b433 75 7a HEX 757a 4920 b435 ;vertical_shooting_enemy01 4921 b435 59 6f HEX 596f 4922 b437 ;vertical_shooting_enemy01_tallsprite_00 4923 b437 59 ef HEX 59ef 4924 b439 ;vertical_shooting_1up 4925 b439 35 60 HEX 3560 4926 b43b ;vertical_shooting_demo_explosion_upd0 4927 b43b 00 00 HEX 0000 4928 b43d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 4929 b43d 00 00 HEX 0000 4930 b43f ;vertical_shooting_demo_explosion_upd1 4931 b43f 00 00 HEX 0000 4932 b441 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 4933 b441 00 00 HEX 0000 4934 b443 ;vertical_shooting_demo_explosion_upd2 4935 b443 00 00 HEX 0000 4936 b445 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 4937 b445 00 00 HEX 0000 4938 b447 ;vertical_shooting_demo_explosion_upd3 4939 b447 00 00 HEX 0000 4940 b449 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 4941 b449 02 80 HEX 0280 4942 b44b ;vertical_shooting_demo_explosion_upd4 4943 b44b 09 60 HEX 0960 4944 b44d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 4945 b44d 09 60 HEX 0960 4946 b44f ;vertical_shooting_demo_explosion_upd5 4947 b44f 06 90 HEX 0690 4948 b451 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 4949 b451 06 90 HEX 0690 4950 b453 ;vertical_shooting_demo_explosion_upd6 4951 b453 06 90 HEX 0690 4952 b455 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 4953 b455 06 90 HEX 0690 4954 b457 ;vertical_shooting_demo_explosion_upd7 4955 b457 07 d0 HEX 07d0 4956 b459 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 4957 b459 06 90 HEX 0690 4958 b45b ;vertical_shooting_demo_explosion_upd8 4959 b45b 06 90 HEX 0690 4960 b45d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 4961 b45d 08 20 HEX 0820 4962 b45f ;vertical_shooting_demo_explosion_upd9 4963 b45f 08 20 HEX 0820 4964 b461 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 4965 b461 00 00 HEX 0000 4966 b463 ;vertical_shooting_demo_explosion_upd10 4967 b463 00 00 HEX 0000 4968 b465 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 4969 b465 00 00 HEX 0000 4970 b467 ;vertical_shooting_laser 4971 b467 44 HEX 44 4972 b468 ;vertical_shooting_laser_tallsprite_00 4973 b468 cc HEX cc 4974 b469 4975 b500 ORG $B500,0 ; ************* 4976 b500 4977 b500 RORG $B500 ; ************* 4978 b500 4979 b500 ;vertical_shooting_font 4980 b500 00 44 10 04* HEX 0044100404444040044444444440444040404410044440544444444444401044 4981 b520 44 44 44 54* HEX 44444454100000041000000000 4982 b52d ;vertical_shooting_ship 4983 b52d 01 40 HEX 0140 4984 b52f ;vertical_shooting_ship_tallsprite_00 4985 b52f a5 5a HEX a55a 4986 b531 ;vertical_shooting_bullet 4987 b531 14 HEX 14 4988 b532 ;vertical_shooting_enemyshot 4989 b532 74 HEX 74 4990 b533 ;vertical_shooting_powerup 4991 b533 78 1e HEX 781e 4992 b535 ;vertical_shooting_enemy01 4993 b535 5a af HEX 5aaf 4994 b537 ;vertical_shooting_enemy01_tallsprite_00 4995 b537 19 ec HEX 19ec 4996 b539 ;vertical_shooting_1up 4997 b539 0d 80 HEX 0d80 4998 b53b ;vertical_shooting_demo_explosion_upd0 4999 b53b 00 00 HEX 0000 5000 b53d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 5001 b53d 00 00 HEX 0000 5002 b53f ;vertical_shooting_demo_explosion_upd1 5003 b53f 00 00 HEX 0000 5004 b541 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 5005 b541 00 00 HEX 0000 5006 b543 ;vertical_shooting_demo_explosion_upd2 5007 b543 00 00 HEX 0000 5008 b545 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 5009 b545 02 80 HEX 0280 5010 b547 ;vertical_shooting_demo_explosion_upd3 5011 b547 00 00 HEX 0000 5012 b549 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 5013 b549 09 60 HEX 0960 5014 b54b ;vertical_shooting_demo_explosion_upd4 5015 b54b 02 80 HEX 0280 5016 b54d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 5017 b54d 05 50 HEX 0550 5018 b54f ;vertical_shooting_demo_explosion_upd5 5019 b54f 05 50 HEX 0550 5020 b551 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 5021 b551 0a a0 HEX 0aa0 5022 b553 ;vertical_shooting_demo_explosion_upd6 5023 b553 05 50 HEX 0550 5024 b555 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 5025 b555 0b e0 HEX 0be0 5026 b557 ;vertical_shooting_demo_explosion_upd7 5027 b557 05 50 HEX 0550 5028 b559 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 5029 b559 08 20 HEX 0820 5030 b55b ;vertical_shooting_demo_explosion_upd8 5031 b55b 05 50 HEX 0550 5032 b55d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 5033 b55d 00 00 HEX 0000 5034 b55f ;vertical_shooting_demo_explosion_upd9 5035 b55f 06 90 HEX 0690 5036 b561 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 5037 b561 00 00 HEX 0000 5038 b563 ;vertical_shooting_demo_explosion_upd10 5039 b563 04 10 HEX 0410 5040 b565 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 5041 b565 00 00 HEX 0000 5042 b567 ;vertical_shooting_laser 5043 b567 44 HEX 44 5044 b568 ;vertical_shooting_laser_tallsprite_00 5045 b568 88 HEX 88 5046 b569 5047 b600 ORG $B600,0 ; ************* 5048 b600 5049 b600 RORG $B600 ; ************* 5050 b600 5051 b600 ;vertical_shooting_font 5052 b600 00 44 50 04* HEX 0044500404444040044444444440444040404410044440544444444444401044 5053 b620 44 44 44 44* HEX 44444444040000441000001044 5054 b62d ;vertical_shooting_ship 5055 b62d 01 40 HEX 0140 5056 b62f ;vertical_shooting_ship_tallsprite_00 5057 b62f a7 da HEX a7da 5058 b631 ;vertical_shooting_bullet 5059 b631 14 HEX 14 5060 b632 ;vertical_shooting_enemyshot 5061 b632 10 HEX 10 5062 b633 ;vertical_shooting_powerup 5063 b633 7a bc HEX 7abc 5064 b635 ;vertical_shooting_enemy01 5065 b635 50 07 HEX 5007 5066 b637 ;vertical_shooting_enemy01_tallsprite_00 5067 b637 09 e0 HEX 09e0 5068 b639 ;vertical_shooting_1up 5069 b639 0d 80 HEX 0d80 5070 b63b ;vertical_shooting_demo_explosion_upd0 5071 b63b 00 00 HEX 0000 5072 b63d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 5073 b63d 00 00 HEX 0000 5074 b63f ;vertical_shooting_demo_explosion_upd1 5075 b63f 00 00 HEX 0000 5076 b641 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 5077 b641 01 40 HEX 0140 5078 b643 ;vertical_shooting_demo_explosion_upd2 5079 b643 00 00 HEX 0000 5080 b645 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 5081 b645 09 60 HEX 0960 5082 b647 ;vertical_shooting_demo_explosion_upd3 5083 b647 00 00 HEX 0000 5084 b649 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 5085 b649 25 58 HEX 2558 5086 b64b ;vertical_shooting_demo_explosion_upd4 5087 b64b 02 80 HEX 0280 5088 b64d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 5089 b64d 05 50 HEX 0550 5090 b64f ;vertical_shooting_demo_explosion_upd5 5091 b64f 01 40 HEX 0140 5092 b651 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 5093 b651 0b e0 HEX 0be0 5094 b653 ;vertical_shooting_demo_explosion_upd6 5095 b653 01 40 HEX 0140 5096 b655 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 5097 b655 0c 30 HEX 0c30 5098 b657 ;vertical_shooting_demo_explosion_upd7 5099 b657 01 40 HEX 0140 5100 b659 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 5101 b659 00 00 HEX 0000 5102 b65b ;vertical_shooting_demo_explosion_upd8 5103 b65b 01 40 HEX 0140 5104 b65d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 5105 b65d 00 00 HEX 0000 5106 b65f ;vertical_shooting_demo_explosion_upd9 5107 b65f 01 40 HEX 0140 5108 b661 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 5109 b661 00 00 HEX 0000 5110 b663 ;vertical_shooting_demo_explosion_upd10 5111 b663 00 00 HEX 0000 5112 b665 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 5113 b665 00 00 HEX 0000 5114 b667 ;vertical_shooting_laser 5115 b667 44 HEX 44 5116 b668 ;vertical_shooting_laser_tallsprite_00 5117 b668 88 HEX 88 5118 b669 5119 b700 ORG $B700,0 ; ************* 5120 b700 5121 b700 RORG $B700 ; ************* 5122 b700 5123 b700 ;vertical_shooting_font 5124 b700 00 54 10 54* HEX 0054105454445454545454545054505454544454044440445010501050145444 5125 b720 44 44 44 44* HEX 44444444540000101040401044 5126 b72d ;vertical_shooting_ship 5127 b72d 01 40 HEX 0140 5128 b72f ;vertical_shooting_ship_tallsprite_00 5129 b72f 27 d8 HEX 27d8 5130 b731 ;vertical_shooting_bullet 5131 b731 00 HEX 00 5132 b732 ;vertical_shooting_enemyshot 5133 b732 88 HEX 88 5134 b733 ;vertical_shooting_powerup 5135 b733 55 50 HEX 5550 5136 b735 ;vertical_shooting_enemy01 5137 b735 40 01 HEX 4001 5138 b737 ;vertical_shooting_enemy01_tallsprite_00 5139 b737 09 e0 HEX 09e0 5140 b739 ;vertical_shooting_1up 5141 b739 03 00 HEX 0300 5142 b73b ;vertical_shooting_demo_explosion_upd0 5143 b73b 00 00 HEX 0000 5144 b73d ;vertical_shooting_demo_explosion_upd0_tallsprite_00 5145 b73d 00 00 HEX 0000 5146 b73f ;vertical_shooting_demo_explosion_upd1 5147 b73f 00 00 HEX 0000 5148 b741 ;vertical_shooting_demo_explosion_upd1_tallsprite_00 5149 b741 02 80 HEX 0280 5150 b743 ;vertical_shooting_demo_explosion_upd2 5151 b743 00 00 HEX 0000 5152 b745 ;vertical_shooting_demo_explosion_upd2_tallsprite_00 5153 b745 05 50 HEX 0550 5154 b747 ;vertical_shooting_demo_explosion_upd3 5155 b747 00 00 HEX 0000 5156 b749 ;vertical_shooting_demo_explosion_upd3_tallsprite_00 5157 b749 15 54 HEX 1554 5158 b74b ;vertical_shooting_demo_explosion_upd4 5159 b74b 00 00 HEX 0000 5160 b74d ;vertical_shooting_demo_explosion_upd4_tallsprite_00 5161 b74d 07 d0 HEX 07d0 5162 b74f ;vertical_shooting_demo_explosion_upd5 5163 b74f 01 40 HEX 0140 5164 b751 ;vertical_shooting_demo_explosion_upd5_tallsprite_00 5165 b751 0c 30 HEX 0c30 5166 b753 ;vertical_shooting_demo_explosion_upd6 5167 b753 01 40 HEX 0140 5168 b755 ;vertical_shooting_demo_explosion_upd6_tallsprite_00 5169 b755 00 00 HEX 0000 5170 b757 ;vertical_shooting_demo_explosion_upd7 5171 b757 01 40 HEX 0140 5172 b759 ;vertical_shooting_demo_explosion_upd7_tallsprite_00 5173 b759 00 00 HEX 0000 5174 b75b ;vertical_shooting_demo_explosion_upd8 5175 b75b 01 40 HEX 0140 5176 b75d ;vertical_shooting_demo_explosion_upd8_tallsprite_00 5177 b75d 00 00 HEX 0000 5178 b75f ;vertical_shooting_demo_explosion_upd9 5179 b75f 01 40 HEX 0140 5180 b761 ;vertical_shooting_demo_explosion_upd9_tallsprite_00 5181 b761 00 00 HEX 0000 5182 b763 ;vertical_shooting_demo_explosion_upd10 5183 b763 01 40 HEX 0140 5184 b765 ;vertical_shooting_demo_explosion_upd10_tallsprite_00 5185 b765 00 00 HEX 0000 5186 b767 ;vertical_shooting_laser 5187 b767 44 HEX 44 5188 b768 ;vertical_shooting_laser_tallsprite_00 5189 b768 88 HEX 88 5190 b769 5191 b800 ORG $B800,0 ; ************* 5192 b800 5193 b800 RORG $B800 ; ************* 5194 b800 - if SPACEOVERFLOW > 0 5195 b800 - echo "" 5196 b800 - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 5197 b800 - echo "######## look above for areas with negative ROM space left." 5198 b800 - echo "######## Aborting assembly." 5199 b800 - ERR 5200 b800 endif 5201 b800 5202 b800 5203 b800 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5204 b800 5205 b800 - ifnconst bankswitchmode 5206 b800 - if ( * < $f000 ) 5207 b800 - ORG $F000 5208 b800 - endif 5209 b800 else 5210 b800 ifconst ROM128K 5211 b800 if ( * < $f000 ) 5212 27000 ORG $27000 5213 27000 RORG $F000 5214 27000 endif 5215 27000 endif 5216 27000 - ifconst ROM144K 5217 27000 - if ( * < $f000 ) 5218 27000 - ORG $27000 5219 27000 - RORG $F000 5220 27000 - endif 5221 27000 endif 5222 27000 - ifconst ROM256K 5223 27000 - if ( * < $f000 ) 5224 27000 - ORG $47000 5225 27000 - RORG $F000 5226 27000 - endif 5227 27000 endif 5228 27000 - ifconst ROM272K 5229 27000 - if ( * < $f000 ) 5230 27000 - ORG $47000 5231 27000 - RORG $F000 5232 27000 - endif 5233 27000 endif 5234 27000 - ifconst ROM512K 5235 27000 - if ( * < $f000 ) 5236 27000 - ORG $87000 5237 27000 - RORG $F000 5238 27000 - endif 5239 27000 endif 5240 27000 - ifconst ROM528K 5241 27000 - if ( * < $f000 ) 5242 27000 - ORG $87000 5243 27000 - RORG $F000 5244 27000 - endif 5245 27000 endif 5246 27000 endif 5247 27000 5248 27000 ; all of these "modules" have conditional clauses in them, so even though 5249 27000 ; they're always included here, they don't take up rom unless the user 5250 27000 ; explicitly enables support for the feature. 5251 27000 5252 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 -AVoxReadBytes 12 27000 - sta temp8 13 27000 - jsr i2c_startwrite 14 27000 - bcs eeprom_error 15 27000 - 16 27000 - lda HSVoxHi 17 27000 - jsr i2c_txbyte 18 27000 - lda HSVoxLo 19 27000 - jsr i2c_txbyte 20 27000 - jsr i2c_stopwrite 21 27000 - 22 27000 - jsr i2c_startread 23 27000 - 24 27000 - ldx #0 25 27000 -AVoxReadBytesLoop 26 27000 - jsr i2c_rxbyte 27 27000 - sta eeprombuffer,x 28 27000 - inx 29 27000 - cpx temp8 30 27000 - bne AVoxReadBytesLoop 31 27000 - jsr i2c_stopread 32 27000 - lda #0 33 27000 - rts 34 27000 - 35 27000 - ; to be called with 36 27000 - ; A=# of bytes 37 27000 - ; 38 27000 - 39 27000 -AVoxWriteBytes 40 27000 - sta temp8 41 27000 - jsr i2c_startwrite 42 27000 - bcs eeprom_error 43 27000 - 44 27000 - lda HSVoxHi 45 27000 - jsr i2c_txbyte 46 27000 - lda HSVoxLo 47 27000 - jsr i2c_txbyte 48 27000 - 49 27000 - ldx #$00 50 27000 -AVoxWriteBytesLoop 51 27000 - lda eeprombuffer,x 52 27000 - jsr i2c_txbyte 53 27000 - inx 54 27000 - cpx temp8 55 27000 - bne AVoxWriteBytesLoop 56 27000 - jsr i2c_stopwrite 57 27000 - 58 27000 - lda #0 59 27000 - rts 60 27000 - 61 27000 -eeprom_error 62 27000 - lda #$ff 63 27000 - rts 64 27000 - 65 27000 -AVoxDetect 66 27000 - 67 27000 - jsr i2c_startwrite 68 27000 - bcs eeprom_error 69 27000 - lda #$30 70 27000 - jsr i2c_txbyte 71 27000 - lda #$00 72 27000 - jsr i2c_txbyte 73 27000 - jsr i2c_stopwrite 74 27000 - rts 75 27000 - 76 27000 - include "i2c7800.inc" 77 27000 - I2C_SUBS temp9 78 27000 - 79 27000 endif 80 27000 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite5.78b.asm 5254 27000 endif 5255 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 - 161 27000 -detectpokeylocation 162 27000 - ;XBoard/XM... 163 27000 - ldx #2 164 27000 -detectpokeyloop 165 27000 - lda XCTRL1s 166 27000 - ora #%00010100 167 27000 - and POKEYXMMASK,x 168 27000 - sta XCTRL1s 169 27000 - sta XCTRL1 170 27000 - 171 27000 - lda POKEYCHECKLO,x 172 27000 - sta pokeybaselo 173 27000 - lda POKEYCHECKHI,x 174 27000 - sta pokeybasehi 175 27000 - jsr checkforpokey 176 27000 - lda pokeydetected 177 27000 - beq foundpokeychip 178 27000 - dex 179 27000 - bpl detectpokeyloop 180 27000 -foundpokeychip 181 27000 - eor #$ff ; invert state for 7800basic if...then test 182 27000 - sta pokeydetected 183 27000 - rts 184 27000 - 185 27000 -POKEYXMMASK 186 27000 - ; XM POKEY on XM POKEY off XM POKEY off 187 27000 - .byte %11111111, %11101111, %11101111 188 27000 - 189 27000 -POKEYCHECKLO 190 27000 - .byte <$0450, <$0450, <$4000 191 27000 -POKEYCHECKHI 192 27000 - .byte >$0450, >$0450, >$4000 193 27000 - 194 27000 -checkforpokey 195 27000 - ldy #$0f 196 27000 - lda #$00 197 27000 - sta pokeydetected ; start off by assuming pokey will be detected 198 27000 -resetpokeyregistersloop 199 27000 - sta (pokeybase),y 200 27000 - dey 201 27000 - bpl resetpokeyregistersloop 202 27000 - 203 27000 - ldy #PAUDCTL 204 27000 - sta (pokeybase),y 205 27000 - ldy #PSKCTL 206 27000 - sta (pokeybase),y 207 27000 - 208 27000 - ; let the dust settle... 209 27000 - nop 210 27000 - nop 211 27000 - nop 212 27000 - 213 27000 - lda #4 214 27000 - sta temp9 215 27000 -pokeycheckloop1 216 27000 - ; we're in reset, so the RANDOM register should read $ff... 217 27000 - ldy #PRANDOM 218 27000 - lda (pokeybase),y 219 27000 - cmp #$ff 220 27000 - bne nopokeydetected 221 27000 - dec temp9 222 27000 - bne pokeycheckloop1 223 27000 - 224 27000 - ; take pokey out of reset... 225 27000 - ldy #PSKCTL 226 27000 - lda #3 227 27000 - sta (pokeybase),y 228 27000 - ldy #PAUDCTL 229 27000 - lda #0 230 27000 - sta (pokeybase),y 231 27000 - 232 27000 - ; let the dust settle again... 233 27000 - nop 234 27000 - nop 235 27000 - nop 236 27000 - 237 27000 - lda #4 238 27000 - sta temp9 239 27000 -pokeycheckloop2 240 27000 - ; we're out of reset, so RANDOM should read non-$ff... 241 27000 - ldy #PRANDOM 242 27000 - lda (pokeybase),y 243 27000 - cmp #$ff 244 27000 - beq skippokeycheckreturn 245 27000 - rts 246 27000 -skippokeycheckreturn 247 27000 - dec temp9 248 27000 - bne pokeycheckloop2 249 27000 -nopokeydetected 250 27000 - dec pokeydetected ; pokeydetected=#$ff 251 27000 - rts 252 27000 - 253 27000 -pokeysoundmoduleend 254 27000 - 255 27000 - echo " pokeysound assembly: ",[(pokeysoundmoduleend-pokeysoundmodulestart)]d," bytes" 256 27000 - 257 27000 endif ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite5.78b.asm 5257 27000 endif 5258 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 - ; ** songtempo lists how many 256ths of a frame a 16th note lasts 6 27000 - ; ** the player operates on a 16th note grid. 7 27000 - 8 27000 -servicesongover 9 27000 - rts 10 27000 -servicesong 11 27000 - lda songtempo 12 27000 - beq servicesongover ; ** if song is off/paused then return 13 27000 -servicesongcontinue 14 27000 - lda sfxschedulelock 15 27000 - sta sfxschedulemissed 16 27000 - bne servicesongover 17 27000 - lda songtempo 18 27000 - clc 19 27000 - adc songtick ; add songtempo to songtick until it rolls over 20 27000 - sta songtick ; this is how we break away from 50/60Hz timing. 21 27000 - bcc servicesongover 22 27000 - ; ** if we're here a new 16th note has passed 23 27000 - ; ** check if a new note is due on any of the 4 channels 24 27000 -servicesongredo 25 27000 - ldx #3 26 27000 -checkchannelloop 27 27000 - dec songchannel1busywait,x 28 27000 - bpl carryoncheckingchannel 29 27000 - txa 30 27000 - pha ; save X for the loop 31 27000 - jsr processsongdata 32 27000 - pla ; restore X for the loop 33 27000 - tax 34 27000 -carryoncheckingchannel 35 27000 - dex 36 27000 - bpl checkchannelloop 37 27000 - lda inactivechannelcount 38 27000 - cmp #15 39 27000 - bne skipstopsong 40 27000 - lda songloops 41 27000 - bne doasongloop 42 27000 - ;lda #0 43 27000 - sta songtempo ; all channels are done. stop the song 44 27000 - rts 45 27000 -doasongloop 46 27000 - bmi skipsongloopadjust 47 27000 - dec songloops 48 27000 -skipsongloopadjust 49 27000 - jsr setsongchannels 50 27000 - jmp servicesongredo 51 27000 -skipstopsong 52 27000 - rts 53 27000 - 54 27000 -processsongdata 55 27000 - ; channel needs processing 56 27000 - ; X=channel # 57 27000 - 58 27000 - txa 59 27000 - clc 60 27000 - adc songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 61 27000 - tay 62 27000 - 63 27000 - 64 27000 - ; ** indirect x is cumbersome with mult-byte commands. 65 27000 - ; ** setup a pointer to the song data for indirect y addressing. 66 27000 - lda songchannel1layer1lo,y 67 27000 - sta songdatalo 68 27000 - lda songchannel1layer1hi,y 69 27000 - sta songdatahi 70 27000 - ora songdatalo 71 27000 - bne channelhasdata 72 27000 - ;channel data is pointing at $0000 73 27000 - lda #$7F 74 27000 - sta songchannel1busywait,x ; skip a bunch of notes 75 27000 -setchannelcountbits 76 27000 - lda channel2bits,x 77 27000 - ora inactivechannelcount 78 27000 - sta inactivechannelcount 79 27000 - rts 80 27000 -channelhasdata 81 27000 - 82 27000 - sty songstackindex 83 27000 - ldy #0 84 27000 - lda (songdatalo),y ; ** load in the next byte of song data, so we can decode it 85 27000 - cmp #$ff 86 27000 - bne carryoncheckingdatatype ; ** $ff=pattern end marker 87 27000 - jmp handlechannelEOD 88 27000 - 89 27000 -carryoncheckingdatatype 90 27000 - and #$F0 91 27000 - cmp #$C0 92 27000 - beq handlechannelrest ; 0000XXXX=rest 93 27000 - cmp #$F0 94 27000 - beq handlemultibytecommand 95 27000 - cmp #$D0 96 27000 - beq handlesemiup 97 27000 - cmp #$E0 98 27000 - beq handlesemidown 99 27000 -handlenotedata 100 27000 - ; ** TODO: note playing is a terrible choice for fall-through 101 27000 - 102 27000 - ; ** its simple note data, prepare arguments for schedulesfx 103 27000 - 104 27000 - ; ** set the note length 105 27000 - lda (songdatalo),y 106 27000 - and #$0F 107 27000 - sta songchannel1busywait,x 108 27000 - 109 27000 - ; ** load the instrument 110 27000 - lda songchannel1instrumentlo,x 111 27000 - sta sfxinstrumentlo 112 27000 - lda songchannel1instrumenthi,x 113 27000 - sta sfxinstrumenthi 114 27000 - 115 27000 - ; ** get the note, and transpose 116 27000 - lda (songdatalo),y 117 27000 - lsr 118 27000 - lsr 119 27000 - lsr 120 27000 - lsr 121 27000 - clc 122 27000 - adc songchannel1transpose,x ; ** add it to the transpose index 123 27000 - ; ** its up the respective SFX scheduler to handle and save the note data 124 27000 - sta sfxnoteindex 125 27000 - 126 27000 - lda #0 127 27000 - sta sfxpitchoffset 128 27000 - 129 27000 - jsr schedulesfx 130 27000 - 131 27000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 132 27000 - 133 27000 -handlechannelrest 134 27000 - ; ** set the note length 135 27000 - lda (songdatalo),y 136 27000 - and #$0F 137 27000 - sta songchannel1busywait,x 138 27000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 139 27000 - 140 27000 -handlesemiup 141 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 142 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 143 27000 - clc 144 27000 -handlesemidownentry 145 27000 - adc songchannel1transpose,x ; ** add it to the transpose index 146 27000 - sta songchannel1transpose,x 147 27000 - jsr advancethesongpointer1byte 148 27000 - jmp processsongdata ; semi doesn't have note length, so process the next data byte... 149 27000 - 150 27000 -handlesemidown 151 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 152 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 153 27000 - eor #$ff ; ** its easier if we negate it, and then add it instead. 154 27000 - sec 155 27000 - jmp handlesemidownentry 156 27000 - 157 27000 -handlemultibytecommand 158 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 159 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 160 27000 - cmp #$08 ; ** load new instrument? 161 27000 - bne nothandleinstrumentchange 162 27000 -handleinstrumentchange 163 27000 - iny 164 27000 - lda (songdatalo),y 165 27000 - sta songchannel1instrumentlo,x 166 27000 - iny 167 27000 - lda (songdatalo),y 168 27000 - sta songchannel1instrumenthi,x 169 27000 - lda #3 170 27000 - jsr advancethesongpointerNbytes ; advance 3 bytes 171 27000 - jmp processsongdata 172 27000 - 173 27000 -nothandleinstrumentchange 174 27000 - cmp #$09 ; ** absolute tempo change? 175 27000 - bne nothandletempochange 176 27000 - lda #0 177 27000 - sta songtempo 178 27000 -handlerelativetempochange 179 27000 - iny 180 27000 - lda (songdatalo),y 181 27000 - clc 182 27000 - adc songtempo 183 27000 - sta songtempo 184 27000 - lda #2 185 27000 - jsr advancethesongpointerNbytes ; advance 2 bytes 186 27000 - jmp processsongdata 187 27000 - 188 27000 -nothandletempochange 189 27000 - cmp #$0A ; ** relative tempo change?: 190 27000 - beq handlerelativetempochange 191 27000 - cmp #$0B ; ** octave/semi change? 192 27000 - beq handleoctavesemichange 193 27000 -handlepatterndata 194 27000 - ; ** if we're here its a pattern/loop "subroutine" 195 27000 - ; ** move the channel's "stack" pointer and populate the new stack level 196 27000 - 197 27000 - lda #4 198 27000 - clc 199 27000 - adc songchannel1stackdepth,x 200 27000 - sta songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 201 27000 - 202 27000 - stx inttemp6 ; about to invalidate x. save it. 203 27000 - lda songstackindex 204 27000 - adc #4 205 27000 - tax 206 27000 - 207 27000 - lda (songdatalo),y 208 27000 - and #$7 209 27000 - sta songchannel1layer1loops,x 210 27000 - iny 211 27000 - lda (songdatalo),y 212 27000 - sta songchannel1layer1lo,x 213 27000 - iny 214 27000 - lda (songdatalo),y 215 27000 - sta songchannel1layer1hi,x 216 27000 - 217 27000 - ldx inttemp6 ; restore x with the channel # 218 27000 - 219 27000 - ; ** advance will operate on the old stack level, since we didn't store the updated songstackindex... 220 27000 - lda #3 221 27000 - jsr advancethesongpointerNbytes ; advance 3 bytes 222 27000 - 223 27000 - ; ** ...but the new stack level will be correctly picked up when we process the next byte. 224 27000 - jmp processsongdata 225 27000 - 226 27000 -handlechannelEOD 227 27000 - ; ** check if there are loops remaining on the pattern 228 27000 - stx inttemp6 229 27000 - ldx songstackindex 230 27000 - dec songchannel1layer1loops,x 231 27000 - bmi handlechannelEODnoloop 232 27000 - ; ** loops are remaining. set the pattern pointer to the pattern start, which is contained after the EOD 233 27000 - iny 234 27000 - lda (songdatalo),y 235 27000 - sta songchannel1layer1lo,x 236 27000 - iny 237 27000 - lda (songdatalo),y 238 27000 - sta songchannel1layer1hi,x 239 27000 - ldx inttemp6 240 27000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 241 27000 - 242 27000 -handlechannelEODnoloop 243 27000 - ; this pattern/loop is done playing. "pop" the stack 244 27000 - ldx inttemp6 245 27000 - lda songchannel1stackdepth,x 246 27000 - beq handlerootchannelEOD 247 27000 - sec 248 27000 - sbc #4 249 27000 - sta songchannel1stackdepth,x 250 27000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 251 27000 - 252 27000 -handlerootchannelEOD 253 27000 - ; this channel is done. point it to $ff data so we no longer process this channel. 254 27000 - lda #0 255 27000 - sta songchannel1layer1lo,x 256 27000 - sta songchannel1layer1hi,x 257 27000 - sta songchannel1busywait,x 258 27000 - jmp setchannelcountbits 259 27000 - rts 260 27000 - 261 27000 -nothandlepatternchange 262 27000 -handleoctavesemichange 263 27000 - iny 264 27000 - lda (songdatalo),y 265 27000 - sta songchannel1transpose,x 266 27000 - lda #2 267 27000 - jsr advancethesongpointerNbytes ; advance 2 bytes 268 27000 - jmp processsongdata 269 27000 - 270 27000 -advancethesongpointer1byte 271 27000 - txa 272 27000 - ldx songstackindex 273 27000 - inc songchannel1layer1lo,x 274 27000 - bne skiphiadvancethesongpointer1byte 275 27000 - inc songchannel1layer1hi,x 276 27000 -skiphiadvancethesongpointer1byte 277 27000 - tax 278 27000 - rts 279 27000 - 280 27000 -advancethesongpointerNbytes 281 27000 - ; entered with A=# of byte to advance 282 27000 - stx inttemp6 283 27000 - ldx songstackindex 284 27000 - clc 285 27000 - adc songchannel1layer1lo,x 286 27000 - sta songchannel1layer1lo,x 287 27000 - lda #0 288 27000 - adc songchannel1layer1hi,x 289 27000 - sta songchannel1layer1hi,x 290 27000 - ldx inttemp6 291 27000 - rts 292 27000 - 293 27000 -clearsongmemory 294 27000 - lda #0 295 27000 - ldx #(songchannel4instrumenthi-songchannel1layer1lo) 296 27000 -clearsongmemoryloop1 297 27000 - sta songchannel1layer1lo,x 298 27000 - dex 299 27000 - bpl clearsongmemoryloop1 300 27000 - 301 27000 - ldx #(songchannel4stackdepth-songchannel1layer1loops) 302 27000 -clearsongmemoryloop2 303 27000 - sta songchannel1layer1loops,x 304 27000 - dex 305 27000 - bpl clearsongmemoryloop2 306 27000 - 307 27000 - lda #$ff 308 27000 - ldx #3 309 27000 -clearsongmemoryloop3 310 27000 - sta songchannel1busywait,x 311 27000 - dex 312 27000 - bpl clearsongmemoryloop3 313 27000 - rts 314 27000 - 315 27000 -setsongchannels 316 27000 - jsr clearsongmemory 317 27000 - ldy #7 318 27000 - ldx #3 319 27000 -setsongchannelsloop 320 27000 - lda (songpointerlo),y 321 27000 - sta songchannel1layer1hi,x 322 27000 - dey 323 27000 - lda (songpointerlo),y 324 27000 - sta songchannel1layer1lo,x 325 27000 - dex 326 27000 - dey 327 27000 - bpl setsongchannelsloop 328 27000 - rts 329 27000 - 330 27000 -channel2bits 331 27000 - .byte 1,2,4,8 332 27000 - 333 27000 -tiatrackeroctavenotes 334 27000 - ifconst BUZZBASS 335 27000 -LOWC = 15 336 27000 - else 337 27000 -LOWC = 14 338 27000 - endif 339 27000 - ; ****** ELECTRONIC (0 to 11) 340 27000 - .byte LOWC,20 ; c0 16.1Hz 341 27000 - .byte LOWC,18 ; c#0 342 27000 - .byte LOWC,17 ; d0 343 27000 - .byte LOWC,16 ; d#0 344 27000 - .byte LOWC,15 ; e0 345 27000 - .byte LOWC,14 ; f0 (very off) 346 27000 - .byte LOWC,14 ; f#0 347 27000 - .byte LOWC,13 ; g0 348 27000 - .byte LOWC,12 ; g#0 349 27000 - .byte LOWC,11 ; a0 350 27000 - .byte LOWC,11 ; a#0 (very off) 351 27000 - .byte LOWC,10 ; b0 30.7Hz 352 27000 - 353 27000 - ; ****** SLIGHTLY BUZZY (12 to 23) 354 27000 - .byte 6,30 ; c1 32.7Hz 355 27000 - .byte 6,28 ; c#1 356 27000 - .byte 6,27 ; d1 357 27000 - .byte 6,25 ; d#1 358 27000 - .byte 6,24 ; e1 359 27000 - .byte 6,22 ; f1 360 27000 - .byte 6,21 ; f#1 361 27000 - .byte 6,20 ; g1 362 27000 - .byte 6,18 ; g#1 363 27000 - .byte 6,17 ; a1 364 27000 - .byte 6,16 ; a#1 365 27000 - .byte 6,15 ; b1 63.4Hz 366 27000 - 367 27000 - ; ****** BUZZY (24 to 39) 368 27000 - .byte 1,31 ; c2 65.5 369 27000 - .byte 1,30 ; c#2 67.6 370 27000 - .byte 1,27 ; d2 72.3 371 27000 - .byte 1,26 ; d#2 77.6 372 27000 - .byte 1,24 ; e2 373 27000 - .byte 1,23 ; f2 374 27000 - .byte 1,22 ; f#2 375 27000 - .byte 1,20 ; g2 376 27000 - .byte 1,19 ; g#2 377 27000 - .byte 1,18 ; a2 378 27000 - .byte 1,17 ; a#2 379 27000 - .byte 1,16 ; b2 380 27000 - .byte 1,15 ; c3 126.8Hz 381 27000 - .byte 1,14 ; c#3 382 27000 - .byte 1,13 ; d3 149.7Hz 383 27000 - .byte 1,12 ; d#3 161.2Hz (very off) 384 27000 - ; ****** PURE (40 to 71) - best key is A3 Major 385 27000 - .byte 12,31 ; e3 163.8Hz 386 27000 - .byte 12,29 ; f3 387 27000 - .byte 12,28 ; f#3 388 27000 - .byte 12,26 ; g3 389 27000 - .byte 12,24 ; g#3 390 27000 - .byte 12,23 ; a3 songs in key of A benefit from Perceptual Tuning 391 27000 - .byte 12,22 ; a#3 392 27000 - .byte 12,20 ; b3 393 27000 - .byte 12,19 ; c4 (middle C) 394 27000 - .byte 12,18 ; c#4 395 27000 - .byte 12,17 ; d4 396 27000 - .byte 12,16 ; d#4 397 27000 - .byte 12,15 ; e4 398 27000 - .byte 12,14 ; f4 399 27000 - .byte 12,13 ; f#4 400 27000 - .byte 12,12 ; g4 (very off) 401 27000 - .byte 12,12 ; g#4 402 27000 - .byte 12,11 ; a4 403 27000 - .byte 12,10 ; a#4 404 27000 - .byte 4,31 ; b4 405 27000 - .byte 4,29 ; c5 406 27000 - .byte 4,28 ; c#5 407 27000 - .byte 4,26 ; d5 408 27000 - .byte 4,24 ; d#5 409 27000 - .byte 4,23 ; e5 410 27000 - .byte 4,22 ; f5 411 27000 - .byte 4,20 ; f#5 412 27000 - .byte 4,19 ; g5 413 27000 - .byte 4,18 ; g#5 414 27000 - .byte 4,17 ; a5 415 27000 - .byte 4,16 ; a#5 416 27000 - .byte 4,15 ; b5 417 27000 - 418 27000 - ; ****** TUNED WIND (72 to 83) 419 27000 - .byte 8,30 ; c 420 27000 - .byte 8,28 ; c# 421 27000 - .byte 8,27 ; d 422 27000 - .byte 8,25 ; d# 423 27000 - .byte 8,24 ; e 424 27000 - .byte 8,22 ; f 425 27000 - .byte 8,21 ; f# 426 27000 - .byte 8,20 ; g 427 27000 - .byte 8,18 ; g# 428 27000 - .byte 8,17 ; a 429 27000 - .byte 8,16 ; a# 430 27000 - .byte 8,15 ; b 431 27000 - 432 27000 - include "tiadrumkit.asm" 433 27000 - 434 27000 endif ;MUSICTRACKER ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite5.78b.asm 5260 27000 endif 5261 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 -detectatarivoxeeprom 5 27000 -hiscoremodulestart 6 27000 - ; do a test to see if atarivox eeprom can be accessed, and save results 7 27000 - jsr AVoxDetect 8 27000 - eor #$ff ; invert for easy 7800basic if...then logic 9 27000 - sta avoxdetected 10 27000 - lda #$0 11 27000 - sta SWACNT 12 27000 - lda avoxdetected 13 27000 - rts 14 27000 - 15 27000 -detecthsc 16 27000 - ; check for the HSC ROM signature... 17 27000 - lda XCTRL1s 18 27000 - ora #%00001100 19 27000 - sta XCTRL1s 20 27000 - sta XCTRL1 21 27000 - lda $3900 22 27000 - eor #$C6 23 27000 - bne detecthscfail 24 27000 - lda $3904 25 27000 - eor #$FE 26 27000 - bne detecthscfail 27 27000 - ; check if it's initialized... 28 27000 - ldy #0 29 27000 - lda #$ff 30 27000 -checkhscinit 31 27000 - and $1000,y 32 27000 - dey 33 27000 - bpl checkhscinit 34 27000 - cmp #$ff 35 27000 - bne hscisalreadyinit 36 27000 - ; if we're here, we need to do a minimal HSC init... 37 27000 - ldy #$28 38 27000 -hscinitloop1 39 27000 - lda hscheader,y 40 27000 - sta $1000,y 41 27000 - dey 42 27000 - bpl hscinitloop1 43 27000 - ldy #$89 44 27000 - lda #$7F 45 27000 -hscinitloop2 46 27000 - sta $10B3,y 47 27000 - dey 48 27000 - cpy #$ff 49 27000 - bne hscinitloop2 50 27000 -hscisalreadyinit 51 27000 - lda #$ff 52 27000 - rts 53 27000 -hscheader 54 27000 - .byte $00,$00,$68,$83,$AA,$55,$9C,$FF,$07,$12,$02,$1F,$00,$00,$00,$00 55 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 56 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$03 57 27000 -detecthscfail 58 27000 - lda XCTRL1s 59 27000 - and #%11110111 60 27000 - sta XCTRL1s 61 27000 - lda #0 62 27000 - rts 63 27000 endif ; HSSUPPORT 64 27000 65 27000 - ifconst HSSUPPORT 66 27000 - ifnconst hiscorefont 67 27000 - echo "" 68 27000 - echo "WARNING: High score support is enabled, but the hiscorefont.png was" 69 27000 - echo " NOT imported with incgraphic. The high score display code" 70 27000 - echo " has been omitted from this build." 71 27000 - echo "" 72 27000 - else 73 27000 -hscdrawscreen 74 27000 - 75 27000 - ; we use 20 lines on a 24 line display 76 27000 - ; HSSCOREY to dynamically centers based on 77 27000 - ;HSSCOREY = 0 78 27000 -HSSCOREY = ((WZONECOUNT*WZONEHEIGHT/8)-22)/2 79 27000 -HSCURSORY = ((HSSCOREY/(WZONEHEIGHT/8))*WZONEHEIGHT) 80 27000 - 81 27000 - ifconst HSSCORESIZE 82 27000 -SCORESIZE = HSSCORESIZE 83 27000 - else 84 27000 -SCORESIZE = 6 85 27000 - endif 86 27000 - 87 27000 - ;save shadow registers for later return... 88 27000 - lda sCTRL 89 27000 - sta ssCTRL 90 27000 - lda sCHARBASE 91 27000 - sta ssCHARBASE 92 27000 - lda #$60 93 27000 - sta charactermode 94 27000 - jsr drawwait 95 27000 - jsr blacken320colors 96 27000 - jsr clearscreen 97 27000 - 98 27000 - ;set the character base to the HSC font 99 27000 - lda #>hiscorefont 100 27000 - sta CHARBASE 101 27000 - sta sCHARBASE 102 27000 - lda #%01000011 ;Enable DMA, mode=320A 103 27000 - sta CTRL 104 27000 - sta sCTRL 105 27000 - 106 27000 - lda #60 107 27000 - sta hsjoydebounce 108 27000 - 109 27000 - lda #0 110 27000 - sta hscursorx 111 27000 - sta framecounter 112 27000 - ifnconst HSCOLORCHASESTART 113 27000 - lda #$8D ; default is blue. why not? 114 27000 - else 115 27000 - lda #HSCOLORCHASESTART 116 27000 - endif 117 27000 - sta hscolorchaseindex 118 27000 - 119 27000 - lda #$0F 120 27000 - sta P0C2 ; base text is white 121 27000 - 122 27000 - jsr hschasecolors 123 27000 - ; ** plot all of the initials 124 27000 - lda #HSRAMInitials 127 27000 - sta temp2 ; charmaphi 128 27000 - lda #32+29 ; palette=0-29 | 32-(width=3) 129 27000 - sta temp3 ; palette/width 130 27000 - lda #104 131 27000 - sta temp4 ; X 132 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 133 27000 - sta temp5 ; Y 134 27000 -plothsinitialsloop 135 27000 - jsr plotcharacters 136 27000 - clc 137 27000 - lda temp3 138 27000 - adc #32 139 27000 - sta temp3 140 27000 - inc temp5 141 27000 - if WZONEHEIGHT = 8 142 27000 - inc temp5 143 27000 - endif 144 27000 - clc 145 27000 - lda #3 146 27000 - adc temp1 147 27000 - sta temp1 148 27000 - cmp #(<(HSRAMInitials+15)) 149 27000 - bcc plothsinitialsloop 150 27000 - 151 27000 - ifconst HSGAMENAMELEN 152 27000 - ;plot the game name... 153 27000 - lda #HSGAMENAMEtable 156 27000 - sta temp2 ; charmaphi 157 27000 - lda #(32-HSGAMENAMELEN) ; palette=0*29 | 32-(width=3) 158 27000 - sta temp3 ; palette/width 159 27000 - lda #(80-(HSGAMENAMELEN*2)) 160 27000 - sta temp4 ; X 161 27000 - lda #((HSSCOREY+0)/(WZONEHEIGHT/8)) 162 27000 - sta temp5 ; Y 163 27000 - jsr plotcharacters 164 27000 - endif ; HSGAMENAMELEN 165 27000 - 166 27000 - ;plot "difficulty"... 167 27000 - ldy gamedifficulty 168 27000 - ifnconst HSNOLEVELNAMES 169 27000 - lda highscoredifficultytextlo,y 170 27000 - sta temp1 171 27000 - lda highscoredifficultytexthi,y 172 27000 - sta temp2 173 27000 - sec 174 27000 - lda #32 175 27000 - sbc highscoredifficultytextlen,y 176 27000 - sta temp3 ; palette/width 177 27000 - sec 178 27000 - lda #40 179 27000 - sbc highscoredifficultytextlen,y 180 27000 - asl 181 27000 - sta temp4 ; X 182 27000 - else 183 27000 - lda #HSHIGHSCOREStext 186 27000 - sta temp2 ; charmaphi 187 27000 - lda #(32-11) ; palette=0*29 | 32-(width=3) 188 27000 - sta temp3 ; palette/width 189 27000 - lda #(80-(11*2)) 190 27000 - sta temp4 ; X 191 27000 - endif ; HSNOLEVELNAMES 192 27000 - 193 27000 - lda #((HSSCOREY+2)/(WZONEHEIGHT/8)) 194 27000 - sta temp5 ; Y 195 27000 - jsr plotcharacters 196 27000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval, 4=player 2 player evel (joy1) 197 27000 - bne carronwithscoreevaluation 198 27000 - jmp donoscoreevaluation 199 27000 -carronwithscoreevaluation 200 27000 - dey 201 27000 - lda highscorelabeltextlo,y 202 27000 - sta temp1 203 27000 - lda highscorelabeltexthi,y 204 27000 - sta temp2 205 27000 - sec 206 27000 - lda #(32-15) ; palette=0*29 | 32-(width=3) 207 27000 - sta temp3 ; palette/width 208 27000 - lda highscorelabeladjust1,y 209 27000 - sta temp4 ; X 210 27000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 211 27000 - sta temp5 ; Y 212 27000 - jsr plotcharacters 213 27000 - 214 27000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval, 4=player 2 player evel (joy1) 215 27000 - dey 216 27000 - ;plot the current player score... 217 27000 - lda #(32-SCORESIZE) ; palette=0*32 218 27000 - sta temp3 ; palette/width 219 27000 - lda highscorelabeladjust2,y 220 27000 - sta temp4 ; X 221 27000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 222 27000 - sta temp5 ; Y 223 27000 - 224 27000 - lda scorevarlo,y 225 27000 - sta temp7 ; score variable lo 226 27000 - lda scorevarhi,y 227 27000 - sta temp8 ; score variable hi 228 27000 - 229 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 230 27000 - sta temp9 231 27000 - 232 27000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 233 27000 - sta temp1 ; charmaplo 234 27000 - lda #>(hiscorefont+33) 235 27000 - sta temp2 ; charmaphi 236 27000 - lda #SCORESIZE 237 27000 - sta temp6 238 27000 - ifnconst DOUBLEWIDE 239 27000 - jsr plotvalue 240 27000 - else 241 27000 - jsr plotvaluedw 242 27000 - endif 243 27000 - 244 27000 -USED_PLOTVALUE = 1 ; ensure that plotvalue gets compiled in 245 27000 - 246 27000 - ifconst HSGAMERANKS 247 27000 - 248 27000 - ldx #$ff ; start at 0 after the inx... 249 27000 -comparescore2rankloop 250 27000 - inx 251 27000 - ldy #0 252 27000 - lda rankvalue_0,x 253 27000 - cmp (temp7),y 254 27000 - bcc score2rankloopdone 255 27000 - bne comparescore2rankloop 256 27000 - iny 257 27000 - lda rankvalue_1,x 258 27000 - cmp (temp7),y 259 27000 - bcc score2rankloopdone 260 27000 - bne comparescore2rankloop 261 27000 - iny 262 27000 - lda (temp7),y 263 27000 - cmp rankvalue_2,x 264 27000 - bcs score2rankloopdone 265 27000 - jmp comparescore2rankloop 266 27000 -score2rankloopdone 267 27000 - stx hsnewscorerank 268 27000 - 269 27000 - lda ranklabello,x 270 27000 - sta temp1 271 27000 - lda ranklabelhi,x 272 27000 - sta temp2 273 27000 - sec 274 27000 - lda #32 ; palette=0*29 | 32-(width=3) 275 27000 - sbc ranklabellengths,x 276 27000 - sta temp3 ; palette/width 277 27000 - sec 278 27000 - lda #(40+6) 279 27000 - sbc ranklabellengths,x 280 27000 - asl 281 27000 - sta temp4 ; X 282 27000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 283 27000 - sta temp5 ; Y 284 27000 - jsr plotcharacters 285 27000 - 286 27000 - ldx hsnewscorerank 287 27000 - 288 27000 - lda #highscoreranklabel 291 27000 - sta temp2 292 27000 - 293 27000 - lda #(32-5) ; palette=0*29 | 32-(width=3) 294 27000 - sta temp3 ; palette/width 295 27000 - lda #(40-6) 296 27000 - sec 297 27000 - sbc ranklabellengths,x 298 27000 - asl 299 27000 - sta temp4 ; X 300 27000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 301 27000 - sta temp5 ; Y 302 27000 - jsr plotcharacters 303 27000 - endif 304 27000 - 305 27000 - 306 27000 - ; ** which line did this player beat? 307 27000 - lda #$ff 308 27000 - sta hsnewscoreline 309 27000 - ldx #$fd 310 27000 -comparescoreadd2x 311 27000 - inx 312 27000 -comparescoreadd1x 313 27000 - inx 314 27000 -comparescore2lineloop 315 27000 - inc hsnewscoreline 316 27000 - inx ; initialrun, x=0 317 27000 - cpx #15 318 27000 - beq nohighscoreforyou 319 27000 - ldy #0 320 27000 - lda HSRAMScores,x 321 27000 - cmp (temp7),y ; first score digit 322 27000 - bcc score2lineloopdonedel1x 323 27000 - bne comparescoreadd2x 324 27000 - iny 325 27000 - inx 326 27000 - lda HSRAMScores,x 327 27000 - cmp (temp7),y 328 27000 - bcc score2lineloopdonedel2x 329 27000 - bne comparescoreadd1x 330 27000 - iny 331 27000 - inx 332 27000 - lda (temp7),y 333 27000 - cmp HSRAMScores,x 334 27000 - bcs score2lineloopdonedel3x 335 27000 - jmp comparescore2lineloop 336 27000 -nohighscoreforyou 337 27000 - lda #$ff 338 27000 - sta hsnewscoreline 339 27000 - sta countdownseconds 340 27000 - jmp donoscoreevaluation 341 27000 -score2lineloopdonedel3x 342 27000 - dex 343 27000 -score2lineloopdonedel2x 344 27000 - dex 345 27000 -score2lineloopdonedel1x 346 27000 - dex 347 27000 - 348 27000 - ; 0 1 2 349 27000 - ; 3 4 5 350 27000 - ; 6 7 8 351 27000 - ; 9 0 1 352 27000 - ; 2 3 4 353 27000 - 354 27000 - stx temp9 355 27000 - cpx #11 356 27000 - beq postsortscoresuploop 357 27000 - ldx #11 358 27000 -sortscoresuploop 359 27000 - lda HSRAMScores,x 360 27000 - sta HSRAMScores+3,x 361 27000 - lda HSRAMInitials,x 362 27000 - sta HSRAMInitials+3,x 363 27000 - dex 364 27000 - cpx temp9 365 27000 - bne sortscoresuploop 366 27000 -postsortscoresuploop 367 27000 - 368 27000 - ;stick the score and cleared initials in the slot... 369 27000 - inx 370 27000 - ldy #0 371 27000 - sty hsinitialhold 372 27000 - lda (temp7),y 373 27000 - sta HSRAMScores,x 374 27000 - iny 375 27000 - lda (temp7),y 376 27000 - sta HSRAMScores+1,x 377 27000 - iny 378 27000 - lda (temp7),y 379 27000 - sta HSRAMScores+2,x 380 27000 - lda #0 381 27000 - sta HSRAMInitials,x 382 27000 - lda #29 383 27000 - sta HSRAMInitials+1,x 384 27000 - sta HSRAMInitials+2,x 385 27000 - 386 27000 - stx hsinitialpos 387 27000 - 388 27000 - ifconst vox_highscore 389 27000 - lda <#vox_highscore 390 27000 - sta speech_addr 391 27000 - lda >#vox_highscore 392 27000 - sta speech_addr+1 393 27000 - endif 394 27000 - ifconst sfx_highscore 395 27000 - lda <#sfx_highscore 396 27000 - sta temp1 397 27000 - lda >#sfx_highscore 398 27000 - sta temp2 399 27000 - lda #0 400 27000 - sta temp3 401 27000 - jsr schedulesfx 402 27000 - endif 403 27000 - ifconst songdatastart_song_highscore 404 27000 - lda #songchanneltable_song_highscore 407 27000 - sta songpointerhi 408 27000 - lda #73 409 27000 - sta songtempo 410 27000 - jsr setsongchannels 411 27000 - endif 412 27000 - 413 27000 - 414 27000 -donoscoreevaluation 415 27000 - 416 27000 - lda #(32+(32-SCORESIZE)) ; palette=0*32 | 32-(width=6) 417 27000 - sta temp3 ; palette/width 418 27000 - lda #(72+(4*(6-SCORESIZE))) 419 27000 - sta temp4 ; X 420 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 421 27000 - sta temp5 ; Y 422 27000 - lda #HSRAMScores 425 27000 - sta temp8 ; score variable hi 426 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 427 27000 - sta temp9 428 27000 -plothsscoresloop 429 27000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 430 27000 - sta temp1 ; charmaplo 431 27000 - lda #>(hiscorefont+33) 432 27000 - sta temp2 ; charmaphi 433 27000 - lda #6 434 27000 - sta temp6 435 27000 - ifnconst DOUBLEWIDE 436 27000 - jsr plotvalue 437 27000 - else 438 27000 - jsr plotvaluedw 439 27000 - endif 440 27000 - clc 441 27000 - lda temp3 442 27000 - adc #32 443 27000 - sta temp3 444 27000 - inc temp5 445 27000 - if WZONEHEIGHT = 8 446 27000 - inc temp5 447 27000 - endif 448 27000 - clc 449 27000 - lda #3 450 27000 - adc temp7 451 27000 - sta temp7 452 27000 - cmp #(<(HSRAMScores+15)) 453 27000 - bcc plothsscoresloop 454 27000 -plothsindex 455 27000 - lda #32+31 ; palette=0*32 | 32-(width=1) 456 27000 - sta temp3 ; palette/width 457 27000 - lda #44 458 27000 - sta temp4 ; X 459 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 460 27000 - sta temp5 ; Y 461 27000 - lda #hsgameslotnumbers 464 27000 - sta temp8 ; score variable hi 465 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 466 27000 - sta temp9 467 27000 -plothsindexloop 468 27000 - lda #<(hiscorefont+33) 469 27000 - sta temp1 ; charmaplo 470 27000 - lda #>(hiscorefont+33) 471 27000 - sta temp2 ; charmaphi 472 27000 - lda #1 473 27000 - sta temp6 ; number of characters 474 27000 - ifnconst DOUBLEWIDE 475 27000 - jsr plotvalue 476 27000 - else 477 27000 - jsr plotvaluedw 478 27000 - endif 479 27000 - clc 480 27000 - lda temp3 481 27000 - adc #32 482 27000 - sta temp3 483 27000 - inc temp5 484 27000 - if WZONEHEIGHT = 8 485 27000 - inc temp5 486 27000 - endif 487 27000 - inc temp7 488 27000 - lda temp7 489 27000 - cmp #(<(hsgameslotnumbers+5)) 490 27000 - bcc plothsindexloop 491 27000 - 492 27000 - jsr savescreen 493 27000 - ifnconst HSSECONDS 494 27000 - lda #6 495 27000 - else 496 27000 - lda #HSSECONDS 497 27000 - endif 498 27000 - 499 27000 - sta countdownseconds 500 27000 - 501 27000 -keepdisplayinghs 502 27000 - jsr restorescreen 503 27000 - 504 27000 - jsr setuphsinpt1 505 27000 - 506 27000 - lda hsnewscoreline 507 27000 - bpl carryonkeepdisplayinghs 508 27000 - jmp skipenterscorecontrol 509 27000 -carryonkeepdisplayinghs 510 27000 - 511 27000 - 512 27000 - ifnconst HSSECONDS 513 27000 - lda #6 514 27000 - else 515 27000 - lda #HSSECONDS 516 27000 - endif 517 27000 - 518 27000 - sta countdownseconds 519 27000 - 520 27000 - ;plot the "cursor" initial sprite... 521 27000 - lda hsinitialhold 522 27000 - 523 27000 - sta temp1 524 27000 - lda #>(hiscorefont+32) 525 27000 - sta temp2 526 27000 - lda #31 ; palette=0*32 | 32-(width=1) 527 27000 - sta temp3 ; palette/width 528 27000 - lda hscursorx 529 27000 - asl 530 27000 - asl 531 27000 - clc 532 27000 - adc #104 533 27000 - sta temp4 ; X 534 27000 - lda hsnewscoreline 535 27000 - asl 536 27000 - asl 537 27000 - asl 538 27000 - asl 539 27000 - adc #((3*16)+HSCURSORY) 540 27000 - sta temp5 ; Y 541 27000 - lda #%01000000 542 27000 - sta temp6 543 27000 - jsr plotsprite 544 27000 - 545 27000 - ldx hscursorx 546 27000 - ldy hsdisplaymode 547 27000 - lda SWCHA 548 27000 - cpy #3 549 27000 - bne hsskipadjustjoystick1 550 27000 - asl 551 27000 - asl 552 27000 - asl 553 27000 - asl 554 27000 -hsskipadjustjoystick1 555 27000 - sta hsswcha 556 27000 - lda SWCHB 557 27000 - and #%00000010 558 27000 - bne hsskipselectswitch 559 27000 - lda #%00010000 560 27000 - sta hsswcha 561 27000 - bne hsdodebouncecheck 562 27000 -hsskipselectswitch 563 27000 - lda hsswcha 564 27000 - and #%00110000 565 27000 - cmp #%00110000 566 27000 - beq hsjoystickskipped 567 27000 -hsdodebouncecheck 568 27000 - lda hsjoydebounce 569 27000 - beq hsdontdebounce 570 27000 - jmp hspostjoystick 571 27000 -hsdontdebounce 572 27000 - ldx #1 ; small tick sound 573 27000 - jsr playhssfx 574 27000 - lda hsswcha 575 27000 - and #%00110000 576 27000 - ldx hscursorx 577 27000 - cmp #%00100000 ; check down 578 27000 - bne hsjoycheckup 579 27000 - ldy hsinitialhold 580 27000 - cpx #0 581 27000 - bne skipavoid31_1 582 27000 - cpy #0 ; if we're about to change to the <- char (#31) then double-decrement to skip over it 583 27000 - bne skipavoid31_1 584 27000 - dey 585 27000 -skipavoid31_1 586 27000 - dey 587 27000 - jmp hssetdebounce 588 27000 -hsjoycheckup 589 27000 - cmp #%00010000 ; check up 590 27000 - bne hsjoystickskipped 591 27000 - ldy hsinitialhold 592 27000 - cpx #0 593 27000 - bne skipavoid31_2 594 27000 - cpy #30 ; if we're about to change to the <- char (#31) then double-increment to skip over it 595 27000 - bne skipavoid31_2 596 27000 - iny 597 27000 -skipavoid31_2 598 27000 - iny 599 27000 -hssetdebounce 600 27000 - tya 601 27000 - and #31 602 27000 - sta hsinitialhold 603 27000 - lda #15 604 27000 - sta hsjoydebounce 605 27000 - bne hspostjoystick 606 27000 -hsjoystickskipped 607 27000 - ; check the fire button only when the stick isn't engaged 608 27000 - lda hsinpt1 609 27000 - bpl hsbuttonskipped 610 27000 - lda hsjoydebounce 611 27000 - beq hsfiredontdebounce 612 27000 - bne hspostjoystick 613 27000 -hsfiredontdebounce 614 27000 - lda hsinitialhold 615 27000 - cmp #31 616 27000 - beq hsmovecursorback 617 27000 - inc hscursorx 618 27000 - inc hsinitialpos 619 27000 - lda hscursorx 620 27000 - cmp #3 621 27000 - bne skiphsentryisdone 622 27000 - lda #0 623 27000 - sta framecounter 624 27000 - lda #$ff 625 27000 - sta hsnewscoreline 626 27000 - dec hsinitialpos 627 27000 - bne skiphsentryisdone 628 27000 -hsmovecursorback 629 27000 - lda hscursorx 630 27000 - beq skiphsmovecursorback 631 27000 - lda #29 632 27000 - ldx hsinitialpos 633 27000 - sta HSRAMInitials,x 634 27000 - dec hsinitialpos 635 27000 - dec hscursorx 636 27000 - dex 637 27000 - lda HSRAMInitials,x 638 27000 - sta hsinitialhold 639 27000 -skiphsmovecursorback 640 27000 -skiphsentryisdone 641 27000 - ldx #0 642 27000 - jsr playhssfx 643 27000 - lda #20 644 27000 - sta hsjoydebounce 645 27000 - bne hspostjoystick 646 27000 - 647 27000 -hsbuttonskipped 648 27000 - lda #0 649 27000 - sta hsjoydebounce 650 27000 -hspostjoystick 651 27000 - 652 27000 - ldx hsinitialpos 653 27000 - lda hsinitialhold 654 27000 - sta HSRAMInitials,x 655 27000 - 656 27000 - jmp skiphschasecolors 657 27000 - 658 27000 -skipenterscorecontrol 659 27000 - jsr hschasecolors 660 27000 - jsr setuphsinpt1 661 27000 - lda hsjoydebounce 662 27000 - bne skiphschasecolors 663 27000 - lda hsinpt1 664 27000 - bmi returnfromhs 665 27000 -skiphschasecolors 666 27000 - 667 27000 - jsr drawscreen 668 27000 - 669 27000 - lda countdownseconds 670 27000 - beq returnfromhs 671 27000 - jmp keepdisplayinghs 672 27000 -returnfromhs 673 27000 - 674 27000 - ifconst songdatastart_song_highscore 675 27000 - lda hsdisplaymode 676 27000 - beq skipclearHSCsong 677 27000 - lda #0 678 27000 - sta songtempo 679 27000 -skipclearHSCsong 680 27000 - endif 681 27000 - jsr drawwait 682 27000 - jsr clearscreen 683 27000 - lda #0 684 27000 - ldy #7 685 27000 - jsr blacken320colors 686 27000 - lda ssCTRL 687 27000 - sta sCTRL 688 27000 - lda ssCHARBASE 689 27000 - sta sCHARBASE 690 27000 - rts 691 27000 - 692 27000 -setuphsinpt1 693 27000 - lda #$ff 694 27000 - sta hsinpt1 695 27000 - lda hsjoydebounce 696 27000 - beq skipdebounceadjust 697 27000 - dec hsjoydebounce 698 27000 - bne skipstorefirebuttonstatus 699 27000 -skipdebounceadjust 700 27000 - lda SWCHB 701 27000 - and #%00000001 702 27000 - bne hscheckresetover 703 27000 - lda #$ff 704 27000 - sta hsinpt1 705 27000 - rts 706 27000 -hscheckresetover 707 27000 - ldx hsdisplaymode 708 27000 - cpx #3 709 27000 - bne hsskipadjustjoyfire1 710 27000 - lda sINPT3 711 27000 - jmp hsskipadjustjoyfire1done 712 27000 -hsskipadjustjoyfire1 713 27000 - lda sINPT1 714 27000 -hsskipadjustjoyfire1done 715 27000 - sta hsinpt1 716 27000 -skipstorefirebuttonstatus 717 27000 - rts 718 27000 - 719 27000 -blacken320colors 720 27000 - ldy #7 721 27000 -blacken320colorsloop 722 27000 - sta P0C2,y 723 27000 - dey 724 27000 - bpl blacken320colorsloop 725 27000 - rts 726 27000 - 727 27000 -hschasecolors 728 27000 - lda framecounter 729 27000 - and #3 730 27000 - bne hschasecolorsreturn 731 27000 - inc hscolorchaseindex 732 27000 - lda hscolorchaseindex 733 27000 - 734 27000 - sta P5C2 735 27000 - sbc #$02 736 27000 - sta P4C2 737 27000 - sbc #$02 738 27000 - sta P3C2 739 27000 - sbc #$02 740 27000 - sta P2C2 741 27000 - sbc #$02 742 27000 - sta P1C2 743 27000 -hschasecolorsreturn 744 27000 - rts 745 27000 - 746 27000 -playhssfx 747 27000 - lda hssfx_lo,x 748 27000 - sta temp1 749 27000 - lda hssfx_hi,x 750 27000 - sta temp2 751 27000 - lda #0 752 27000 - sta temp3 753 27000 - jmp schedulesfx 754 27000 - 755 27000 -hssfx_lo 756 27000 - .byte sfx_hsletterpositionchange, >sfx_hslettertick 759 27000 - 760 27000 -sfx_hsletterpositionchange 761 27000 - .byte $10,$18,$00 762 27000 - .byte $02,$06,$08 763 27000 - .byte $02,$06,$04 764 27000 - .byte $00,$00,$00 765 27000 -sfx_hslettertick 766 27000 - .byte $10,$18,$00 767 27000 - .byte $00,$00,$0a 768 27000 - .byte $00,$00,$00 769 27000 - 770 27000 -highscorelabeladjust1 771 27000 - .byte (80-(14*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)) 772 27000 -highscorelabeladjust2 773 27000 - .byte (80+(14*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)) 774 27000 - 775 27000 -scorevarlo 776 27000 - .byte <(score0+((6-SCORESIZE)/2)),<(score0+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)) 777 27000 -scorevarhi 778 27000 - .byte >(score0+((6-SCORESIZE)/2)),>(score0+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)) 779 27000 - 780 27000 - ifnconst HSNOLEVELNAMES 781 27000 -highscoredifficultytextlo 782 27000 - .byte easylevelname, >mediumlevelname, >hardlevelname, >expertlevelname 785 27000 - ifnconst HSCUSTOMLEVELNAMES 786 27000 -highscoredifficultytextlen 787 27000 - .byte 22, 30, 26, 24 788 27000 - 789 27000 -easylevelname 790 27000 - .byte $04,$00,$12,$18,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 791 27000 -mediumlevelname 792 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 793 27000 -hardlevelname 794 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 795 27000 -expertlevelname 796 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 797 27000 - else 798 27000 - include "7800hsgamediffnames.asm" 799 27000 - endif ; HSCUSTOMLEVELNAMES 800 27000 - else 801 27000 -HSHIGHSCOREStext 802 27000 - .byte $07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 803 27000 - endif ; HSNOLEVELNAMES 804 27000 - 805 27000 -highscorelabeltextlo 806 27000 - .byte player0label, >player1label, >player2label, >player2label 809 27000 - 810 27000 -player0label 811 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$12,$02,$0e,$11,$04,$1a,$1d,$1d 812 27000 - 813 27000 -player1label 814 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$22,$1d,$12,$02,$0e,$11,$04,$1a 815 27000 - 816 27000 -player2label 817 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$23,$1d,$12,$02,$0e,$11,$04,$1a 818 27000 - 819 27000 - 820 27000 - ifconst HSGAMENAMELEN 821 27000 -HSGAMENAMEtable 822 27000 - include "7800hsgamename.asm" 823 27000 - endif 824 27000 - ifconst HSGAMERANKS 825 27000 - include "7800hsgameranks.asm" 826 27000 -highscoreranklabel 827 27000 - .byte $11,$00,$0d,$0a,$1a 828 27000 - endif 829 27000 - 830 27000 - ;ensure our table doesn't wrap a page... 831 27000 - if ((<*)>251) 832 27000 - align 256 833 27000 - endif 834 27000 -hsgameslotnumbers 835 27000 - .byte 33,34,35,36,37 836 27000 - endif 837 27000 - 838 27000 -loaddifficultytable 839 27000 - lda gamedifficulty 840 27000 - and #$03 ; ensure the user hasn't selected an invalid difficulty 841 27000 - sta gamedifficulty 842 27000 - cmp hsdifficulty ; check game difficulty is the same as RAM table 843 27000 - bne loaddifficultytablecontinue1 844 27000 - rts ; this high score difficulty table is already loaded 845 27000 -loaddifficultytablecontinue1 846 27000 - lda gamedifficulty 847 27000 - sta hsdifficulty 848 27000 - ;we need to check the device for the table 849 27000 - lda hsdevice 850 27000 - bne loaddifficultytablecontinue2 851 27000 - ; there's no save device. clear out this table. 852 27000 - jmp cleardifficultytablemem 853 27000 -loaddifficultytablecontinue2 854 27000 - lda hsdevice 855 27000 - and #1 856 27000 - beq memdeviceisntHSC 857 27000 - jmp loaddifficultytableHSC 858 27000 -memdeviceisntHSC 859 27000 - jmp loaddifficultytableAVOX 860 27000 - 861 27000 -savedifficultytable 862 27000 - ;*** we need to check wich device we should use... 863 27000 - lda hsdevice 864 27000 - bne savedifficultytablerealdevice 865 27000 - rts ; its a ram device 866 27000 -savedifficultytablerealdevice 867 27000 - and #1 868 27000 - beq savememdeviceisntHSC 869 27000 - jmp savedifficultytableHSC 870 27000 -savememdeviceisntHSC 871 27000 - jmp savedifficultytableAVOX 872 27000 - 873 27000 -savedifficultytableAVOX 874 27000 - ; the load call already setup the memory structure and atarivox memory location 875 27000 - jsr savealoadedHSCtablecontinue 876 27000 -savedifficultytableAVOXskipconvert 877 27000 - lda #HSIDHI 878 27000 - sta eeprombuffer 879 27000 - lda #HSIDLO 880 27000 - sta eeprombuffer+1 881 27000 - lda hsdifficulty 882 27000 - sta eeprombuffer+2 883 27000 - lda #32 884 27000 - jsr AVoxWriteBytes 885 27000 - rts 886 27000 - 887 27000 -savedifficultytableHSC 888 27000 - ;we always load a table before reaching here, so the 889 27000 - ;memory structures from the load should be intact... 890 27000 - ldy hsgameslot 891 27000 - bpl savealoadedHSCtable 892 27000 - rts 893 27000 -savealoadedHSCtable 894 27000 - lda HSCGameDifficulty,y 895 27000 - cmp #$7F 896 27000 - bne savealoadedHSCtablecontinue 897 27000 - jsr initializeHSCtableentry 898 27000 -savealoadedHSCtablecontinue 899 27000 - ;convert our RAM table to HSC format and write it out... 900 27000 - ldy #0 901 27000 - ldx #0 902 27000 -savedifficultytableScores 903 27000 - 904 27000 - lda HSRAMInitials,x 905 27000 - sta temp3 906 27000 - lda HSRAMInitials+1,x 907 27000 - sta temp4 908 27000 - lda HSRAMInitials+2,x 909 27000 - sta temp5 910 27000 - jsr encodeHSCInitials ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 911 27000 - 912 27000 - lda temp1 913 27000 - sta (HSGameTableLo),y 914 27000 - iny 915 27000 - lda temp2 916 27000 - sta (HSGameTableLo),y 917 27000 - iny 918 27000 - 919 27000 - lda HSRAMScores,x 920 27000 - sta (HSGameTableLo),y 921 27000 - iny 922 27000 - lda HSRAMScores+1,x 923 27000 - sta (HSGameTableLo),y 924 27000 - iny 925 27000 - lda HSRAMScores+2,x 926 27000 - sta (HSGameTableLo),y 927 27000 - iny 928 27000 - inx 929 27000 - inx 930 27000 - inx ; +3 931 27000 - cpx #15 932 27000 - bne savedifficultytableScores 933 27000 - rts 934 27000 - 935 27000 -loaddifficultytableHSC 936 27000 - ; routine responsible for loading the difficulty table from HSC 937 27000 - jsr findindexHSC 938 27000 - ldy hsgameslot 939 27000 - lda HSCGameDifficulty,y 940 27000 - cmp #$7F 941 27000 - bne loaddifficultytableHSCcontinue 942 27000 - ;there was an error. use a new RAM table instead... 943 27000 - jsr initializeHSCtableentry 944 27000 - jmp cleardifficultytablemem 945 27000 -loaddifficultytableHSCcontinue 946 27000 - ; parse the data into the HS memory... 947 27000 - ldy #0 948 27000 - ldx #0 949 27000 -loaddifficultytableScores 950 27000 - lda (HSGameTableLo),y 951 27000 - sta temp1 952 27000 - iny 953 27000 - lda (HSGameTableLo),y 954 27000 - sta temp2 955 27000 - jsr decodeHSCInitials ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 956 27000 - iny 957 27000 - lda (HSGameTableLo),y 958 27000 - sta HSRAMScores,x 959 27000 - lda temp3 960 27000 - sta HSRAMInitials,x 961 27000 - inx 962 27000 - iny 963 27000 - lda (HSGameTableLo),y 964 27000 - sta HSRAMScores,x 965 27000 - lda temp4 966 27000 - sta HSRAMInitials,x 967 27000 - inx 968 27000 - iny 969 27000 - lda (HSGameTableLo),y 970 27000 - sta HSRAMScores,x 971 27000 - lda temp5 972 27000 - sta HSRAMInitials,x 973 27000 - inx 974 27000 - iny 975 27000 - cpx #15 976 27000 - bne loaddifficultytableScores 977 27000 - rts 978 27000 - 979 27000 -decodeHSCInitials 980 27000 - ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 981 27000 - ; 2 bytes are packed in the form: 22211111 22_33333 982 27000 - lda #0 983 27000 - sta temp4 984 27000 - lda temp1 985 27000 - and #%00011111 986 27000 - sta temp3 987 27000 - 988 27000 - lda temp2 989 27000 - and #%00011111 990 27000 - sta temp5 991 27000 - 992 27000 - lda temp1 993 27000 - asl 994 27000 - rol temp4 995 27000 - asl 996 27000 - rol temp4 997 27000 - asl 998 27000 - rol temp4 999 27000 - lda temp2 1000 27000 - asl 1001 27000 - rol temp4 1002 27000 - asl 1003 27000 - rol temp4 1004 27000 - rts 1005 27000 -encodeHSCInitials 1006 27000 - ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 1007 27000 - ; 2 bytes are packed in the form: 22211111 22_33333 1008 27000 - ; start with packing temp1... 1009 27000 - lda temp4 1010 27000 - and #%00011100 1011 27000 - sta temp1 1012 27000 - asl temp1 1013 27000 - asl temp1 1014 27000 - asl temp1 1015 27000 - lda temp3 1016 27000 - and #%00011111 1017 27000 - ora temp1 1018 27000 - sta temp1 1019 27000 - ; ...temp1 is now packed, on to temp2... 1020 27000 - lda temp5 1021 27000 - asl 1022 27000 - asl 1023 27000 - ror temp4 1024 27000 - ror 1025 27000 - ror temp4 1026 27000 - ror 1027 27000 - sta temp2 1028 27000 - rts 1029 27000 - 1030 27000 -findindexHSCerror 1031 27000 - ;the HSC is stuffed. return the bad slot flag 1032 27000 - ldy #$ff 1033 27000 - sty hsgameslot 1034 27000 - rts 1035 27000 - 1036 27000 -findindexHSC 1037 27000 -HSCGameID1 = $1029 1038 27000 -HSCGameID2 = $106E 1039 27000 -HSCGameDifficulty = $10B3 1040 27000 -HSCGameIndex = $10F8 1041 27000 - ; routine responsible for finding the game index from HSC 1042 27000 - ; call with x=0 to create a new table if none exist, call with x=$ff to avoid creating new tables 1043 27000 - ; the HS loading routine will use x=$ff, the HS saving routine will use x=0 1044 27000 - ldy #69 ; start +1 to account for the dey 1045 27000 -findindexHSCloop 1046 27000 - dey 1047 27000 - bmi findindexHSCerror 1048 27000 - lda HSCGameDifficulty,y 1049 27000 - cmp #$7F 1050 27000 - beq findourindexHSC 1051 27000 - cmp gamedifficulty 1052 27000 - bne findindexHSCloop 1053 27000 - lda HSCGameID1,y 1054 27000 - cmp #HSIDHI 1055 27000 - bne findindexHSCloop 1056 27000 - lda HSCGameID2,y 1057 27000 - cmp #HSIDLO 1058 27000 - bne findindexHSCloop 1059 27000 -findourindexHSC 1060 27000 - ; if we're here we found our index in the table 1061 27000 - ; or we found the first empty one 1062 27000 - sty hsgameslot 1063 27000 - jsr setupHSCGamepointer ; setup the pointer to the HS Table for this game... 1064 27000 - rts 1065 27000 - 1066 27000 - 1067 27000 -initializeHSCtableentry 1068 27000 - ldy hsgameslot 1069 27000 - ; we need to make a new entry... 1070 27000 - lda #HSIDHI 1071 27000 - sta HSCGameID1,y 1072 27000 - lda #HSIDLO 1073 27000 - sta HSCGameID2,y 1074 27000 - lda gamedifficulty 1075 27000 - sta HSCGameDifficulty,y 1076 27000 - ldx #0 1077 27000 -fixHSDGameDifficultylistLoop 1078 27000 - inx 1079 27000 - txa 1080 27000 - sta HSCGameIndex,y 1081 27000 - iny 1082 27000 - cpy #69 1083 27000 - bne fixHSDGameDifficultylistLoop 1084 27000 - rts 1085 27000 - 1086 27000 -setupHSCGamepointer 1087 27000 - ; this routines sets (HSGameTableLo) pointing to the game's HS table 1088 27000 - lda #$17 1089 27000 - sta HSGameTableHi 1090 27000 - lda #$FA 1091 27000 - sta HSGameTableLo 1092 27000 -setupHSCGamepointerLoop 1093 27000 - lda HSGameTableLo 1094 27000 - sec 1095 27000 - sbc #25 1096 27000 - sta HSGameTableLo 1097 27000 - lda HSGameTableHi 1098 27000 - sbc #0 1099 27000 - sta HSGameTableHi 1100 27000 - iny 1101 27000 - cpy #69 1102 27000 - bne setupHSCGamepointerLoop 1103 27000 - rts 1104 27000 - 1105 27000 -loaddifficultytableAVOX 1106 27000 - ; routine responsible for loading the difficulty table from Avox 1107 27000 - ; we reuse HSC routines to format data to/from our Avox RAM buffer... 1108 27000 - lda #>(eeprombuffer+3) 1109 27000 - sta HSGameTableHi 1110 27000 - lda #<(eeprombuffer+3) 1111 27000 - sta HSGameTableLo 1112 27000 - 1113 27000 - ; the start location in EEPROM, subtract 32... 1114 27000 - lda #$5F 1115 27000 - sta HSVoxHi 1116 27000 - lda #$E0 1117 27000 - sta HSVoxLo 1118 27000 - lda #0 1119 27000 - sta temp1 1120 27000 -loaddifficultytableAVOXloop 1121 27000 - inc temp1 1122 27000 - beq loaddifficultytableAVOXfull 1123 27000 - clc 1124 27000 - lda HSVoxLo 1125 27000 - adc #32 1126 27000 - sta HSVoxLo 1127 27000 - lda HSVoxHi 1128 27000 - adc #0 1129 27000 - sta HSVoxHi 1130 27000 - lda #3 1131 27000 - jsr AVoxReadBytes ; read in 3 bytes, ID1,ID2,Difficulty 1132 27000 - lda eeprombuffer 1133 27000 - cmp #$FF 1134 27000 - beq loaddifficultytableAVOXempty 1135 27000 - cmp #HSIDHI 1136 27000 - bne loaddifficultytableAVOXloop 1137 27000 - lda eeprombuffer+1 1138 27000 - cmp #HSIDLO 1139 27000 - bne loaddifficultytableAVOXloop 1140 27000 - lda eeprombuffer+2 1141 27000 - cmp gamedifficulty 1142 27000 - bne loaddifficultytableAVOXloop 1143 27000 -loaddifficultytableAVOXdone 1144 27000 - lda #32 1145 27000 - jsr AVoxReadBytes 1146 27000 - jsr loaddifficultytableHSCcontinue 1147 27000 - rts 1148 27000 -loaddifficultytableAVOXfull 1149 27000 - lda #0 1150 27000 - sta hsdevice ; looks like all 255 entries are taken... disable it. 1151 27000 -loaddifficultytableAVOXempty 1152 27000 - jmp cleardifficultytablemem 1153 27000 - rts 1154 27000 - 1155 27000 -cleardifficultytablemem 1156 27000 - ldy #29 1157 27000 - lda #0 1158 27000 -cleardifficultytablememloop 1159 27000 - sta HSRAMTable,y 1160 27000 - dey 1161 27000 - bpl cleardifficultytablememloop 1162 27000 - rts 1163 27000 -hiscoremoduleend 1164 27000 - 1165 27000 - echo " hiscore assembly: ",[(hiscoremoduleend-hiscoremodulestart)]d," bytes" 1166 27000 - 1167 27000 - ifconst DOUBLEWIDE 1168 27000 -plotvaluedw 1169 27000 -plotdigitcount = temp6 1170 27000 - lda #0 1171 27000 - tay 1172 27000 - ldx valbufend 1173 27000 - 1174 27000 - lda plotdigitcount 1175 27000 - and #1 1176 27000 - beq pvnibble2chardw 1177 27000 - lda #0 1178 27000 - sta VALBUFFER,x ; just in case we skip this digit 1179 27000 - beq pvnibble2char_skipnibbledw 1180 27000 - 1181 27000 -pvnibble2chardw 1182 27000 - ; high nibble... 1183 27000 - lda (temp7),y 1184 27000 - and #$f0 1185 27000 - lsr 1186 27000 - lsr 1187 27000 - lsr 1188 27000 - lsr 1189 27000 - 1190 27000 - clc 1191 27000 - adc temp1 ; add the offset to character graphics to our value 1192 27000 - sta VALBUFFER,x 1193 27000 - inx 1194 27000 - dec plotdigitcount 1195 27000 -pvnibble2char_skipnibbledw 1196 27000 - ; low nibble... 1197 27000 - lda (temp7),y 1198 27000 - and #$0f 1199 27000 - clc 1200 27000 - adc temp1 ; add the offset to character graphics to our value 1201 27000 - sta VALBUFFER,x 1202 27000 - inx 1203 27000 - iny 1204 27000 - 1205 27000 - dec plotdigitcount 1206 27000 - bne pvnibble2chardw 1207 27000 - ;point to the start of our valuebuffer 1208 27000 - clc 1209 27000 - lda #VALBUFFER 1213 27000 - adc #0 1214 27000 - sta temp2 1215 27000 - 1216 27000 - ;advance valbufend to the end of our value buffer 1217 27000 - stx valbufend 1218 27000 - 1219 27000 - ifnconst plotvalueonscreen 1220 27000 - jmp plotcharacters 1221 27000 - else 1222 27000 - jmp plotcharacterslive 1223 27000 - endif 1224 27000 - endif ; DOUBLEWIDE 1225 27000 - 1226 27000 endif ; HSSUPPORT 1227 27000 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite5.78b.asm 5263 27000 endif 5264 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5265 27000 5266 27000 ;standard routimes needed for pretty much all games 5267 27000 5268 27000 ; some definitions used with "set debug color" 5269 27000 00 91 DEBUGCALC = $91 5270 27000 00 41 DEBUGWASTE = $41 5271 27000 00 c1 DEBUGDRAW = $C1 5272 27000 5273 27000 ;NMI and IRQ handlers 5274 27000 NMI 5275 27000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 5276 27000 48 pha ; save A 5277 27001 d8 cld 5278 27002 a5 4d lda visibleover 5279 27004 49 ff eor #255 5280 27006 85 4d sta visibleover 5281 27008 - ifconst DEBUGINTERRUPT 5282 27008 - and #$93 5283 27008 - sta BACKGRND 5284 27008 endif 5285 27008 8a txa ; save X 5286 27009 48 pha 5287 2700a 98 tya ; save Y 5288 2700b 48 pha 5289 2700c ce b2 01 dec interruptindex 5290 2700f d0 03 bne skipreallyoffvisible 5291 27011 4c 6b f0 jmp reallyoffvisible 5292 27014 skipreallyoffvisible 5293 27014 a5 4d lda visibleover 5294 27016 d0 03 bne carryontopscreenroutine 5295 27018 - ifconst .bottomscreenroutine 5296 27018 - lda interrupthold 5297 27018 - beq skipbottomroutine 5298 27018 - jsr .bottomscreenroutine 5299 27018 -skipbottomroutine 5300 27018 endif 5301 27018 4c 79 f0 jmp NMIexit 5302 2701b carryontopscreenroutine 5303 2701b - ifconst .topscreenroutine 5304 2701b - lda interrupthold 5305 2701b - beq skiptoproutine 5306 2701b - jsr .topscreenroutine 5307 2701b -skiptoproutine 5308 2701b endif 5309 2701b ifnconst CANARYOFF 5310 2701b ad c1 01 lda canary 5311 2701e f0 07 beq skipcanarytriggered 5312 27020 a9 45 lda #$45 5313 27022 85 20 sta BACKGRND 5314 27024 4c 63 f0 jmp skipbrkolorset ; common crash dump routine, if available 5315 27027 skipcanarytriggered 5316 27027 endif 5317 27027 5318 27027 ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 5319 2702a 5320 2702a ; ** Other important routines that need to regularly run, and can run onscreen. 5321 2702a ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 5322 2702a 5323 2702a - ifconst LONGCONTROLLERREAD 5324 2702a -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 5325 2702a - ldy port1control 5326 2702a - lda longreadtype,y 5327 2702a - beq LLRET1 5328 2702a - tay 5329 2702a - lda longreadroutinehiP1,y 5330 2702a - sta inttemp4 5331 2702a - lda longreadroutineloP1,y 5332 2702a - sta inttemp3 5333 2702a - jmp (inttemp3) 5334 2702a -LLRET1 5335 2702a - ldy port0control 5336 2702a - lda longreadtype,y 5337 2702a - beq LLRET0 5338 2702a - tay 5339 2702a - lda longreadroutinehiP0,y 5340 2702a - sta inttemp4 5341 2702a - lda longreadroutineloP0,y 5342 2702a - sta inttemp3 5343 2702a - jmp (inttemp3) 5344 2702a -LLRET0 5345 2702a - 5346 2702a - 5347 2702a - ifconst PADDLERANGE 5348 2702a -TIMEVAL = PADDLERANGE 5349 2702a - else 5350 2702a -TIMEVAL = 160 5351 2702a - endif 5352 2702a -TIMEOFFSET = 10 5353 2702a - 5354 2702a endif ; LONGCONTROLLERREAD 5355 2702a 5356 2702a 5357 2702a 20 dd f1 jsr servicesfxchannels 5358 2702d - ifconst MUSICTRACKER 5359 2702d - jsr servicesong 5360 2702d endif ; MUSICTRACKER 5361 2702d 5362 2702d ee a4 01 inc framecounter 5363 27030 ad a4 01 lda framecounter 5364 27033 29 3f and #63 5365 27035 d0 08 bne skipcountdownseconds 5366 27037 ad a5 01 lda countdownseconds 5367 2703a f0 03 beq skipcountdownseconds 5368 2703c ce a5 01 dec countdownseconds 5369 2703f skipcountdownseconds 5370 2703f 5371 2703f a2 01 ldx #1 5372 27041 buttonreadloop 5373 27041 8a txa 5374 27042 48 pha 5375 27043 bc b7 01 ldy port0control,x 5376 27046 b9 bb f1 lda buttonhandlerlo,y 5377 27049 85 da sta inttemp3 5378 2704b b9 b0 f1 lda buttonhandlerhi,y 5379 2704e 85 db sta inttemp4 5380 27050 05 da ora inttemp3 5381 27052 f0 03 beq buttonreadloopreturn 5382 27054 6c da 00 jmp (inttemp3) 5383 27057 buttonreadloopreturn 5384 27057 68 pla 5385 27058 aa tax 5386 27059 ca dex 5387 2705a 10 e5 bpl buttonreadloop 5388 2705c 5389 2705c - ifconst KEYPADSUPPORT 5390 2705c - jsr keypadrowselect 5391 2705c endif ; KEYPADSUPPORT 5392 2705c 5393 2705c 5394 2705c - ifconst DOUBLEBUFFER 5395 2705c - lda doublebufferminimumframeindex 5396 2705c - beq skipdoublebufferminimumframeindexadjust 5397 2705c - dec doublebufferminimumframeindex 5398 2705c -skipdoublebufferminimumframeindexadjust 5399 2705c endif 5400 2705c 5401 2705c 4c 79 f0 jmp NMIexit 5402 2705f 5403 2705f IRQ ; the only source of non-nmi interrupt should be the BRK opcode. 5404 2705f ifnconst BREAKPROTECTOFF 5405 2705f a9 1a lda #$1A 5406 27061 85 20 sta BACKGRND 5407 27063 skipbrkolorset 5408 27063 skipbrkdetected 5409 27063 a9 60 lda #$60 5410 27065 8d 07 21 sta sCTRL 5411 27068 85 3c sta CTRL 5412 2706a ifnconst hiscorefont 5413 2706a 02 .byte.b $02 ; KIL/JAM 5414 2706b - else ; hiscorefont is present 5415 2706b - ifconst CRASHDUMP 5416 2706b - bit MSTAT 5417 2706b - bpl skipbrkdetected ; wait for vblank to ensure we're clear of NMI 5418 2706b - 5419 2706b - ifconst dumpbankswitch 5420 2706b - lda dumpbankswitch 5421 2706b - pha 5422 2706b - endif 5423 2706b - 5424 2706b - ; bankswitch if needed, to get to the hiscore font 5425 2706b - ifconst bankswitchmode 5426 2706b - ifconst included.hiscore.asm.bank 5427 2706b - ifconst MCPDEVCART 5428 2706b - lda #($18 | included.hiscore.asm.bank) 5429 2706b - sta $3000 5430 2706b - else 5431 2706b - lda #(included.hiscore.asm.bank) 5432 2706b - sta $8000 5433 2706b - endif 5434 2706b - endif ; included.hiscore.asm.bank 5435 2706b - endif ; bankswitchmode 5436 2706b - 5437 2706b - ifconst DOUBLEBUFFER 5438 2706b - ;turn off double-buffering, if on... 5439 2706b - lda #>DLLMEM 5440 2706b - sta DPPH 5441 2706b - lda #hiscorefont 5485 2706b - sta CHARBASE 5486 2706b - sta sCHARBASE 5487 2706b - lda #%01000011 ;Enable DMA, mode=320A 5488 2706b - sta CTRL 5489 2706b - sta sCTRL 5490 2706b - .byte $02 ; KIL/JAM 5491 2706b -hiscorehexlut 5492 2706b - ; 0 1 2 3 4 5 6 7 8 9 A B C D E F 5493 2706b - .byte 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 1, 2, 3, 4, 5 5494 2706b -show2700 5495 2706b - ; lo mode hi width=29 x EODL 5496 2706b - .byte $00, %01100000, $27, 3, 20, 0,0,0 5497 2706b - else ; CRASHDUMP 5498 2706b - .byte $02 ; KIL/JAM 5499 2706b - endif ; crashdump 5500 2706b endif ; hiscorefont 5501 2706b - else 5502 2706b - RTI 5503 2706b endif 5504 2706b 5505 2706b - ifconst LONGCONTROLLERREAD 5506 2706b - 5507 2706b -longreadtype 5508 2706b - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 5509 2706b - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 5510 2706b - .byte 3, 3, 0 ; STMOUSE AMOUSE ATARIVOX 5511 2706b - 5512 2706b -longreadroutineloP0 5513 2706b - .byte LLRET0 ; 0 = no routine 5520 2706b - .byte >paddleport0update ; 1 = paddle 5521 2706b - .byte >trakball0update ; 2 = trackball 5522 2706b - .byte >mouse0update ; 3 = mouse 5523 2706b - 5524 2706b -longreadroutineloP1 5525 2706b - .byte LLRET1 ; 0 = no routine 5532 2706b - .byte >paddleport1update ; 1 = paddle 5533 2706b - .byte >trakball1update ; 2 = trackball 5534 2706b - .byte >mouse1update ; 3 = mouse 5535 2706b - 5536 2706b - 5537 2706b -SETTIM64T 5538 2706b - bne skipdefaulttime 5539 2706b - ifnconst PADDLESMOOTHINGOFF 5540 2706b - lda #(TIMEVAL+TIMEOFFSET+1) 5541 2706b - else 5542 2706b - lda #(TIMEVAL+TIMEOFFSET) 5543 2706b - endif 5544 2706b -skipdefaulttime 5545 2706b - tay 5546 2706b - dey 5547 2706b -.setTIM64Tloop 5548 2706b - sta TIM64T 5549 2706b - cpy INTIM 5550 2706b - bne .setTIM64Tloop 5551 2706b - rts 5552 2706b endif ; LONGCONTROLLERREAD 5553 2706b 5554 2706b reallyoffvisible 5555 2706b 85 24 sta WSYNC 5556 2706d 5557 2706d a9 00 lda #0 5558 2706f 85 4d sta visibleover 5559 27071 - ifconst DEBUGINTERRUPT 5560 27071 - sta BACKGRND 5561 27071 endif 5562 27071 5563 27071 a9 03 lda #3 5564 27073 8d b2 01 sta interruptindex 5565 27076 5566 27076 20 52 f1 jsr uninterruptableroutines 5567 27079 5568 27079 - ifconst .userinterrupt 5569 27079 - lda interrupthold 5570 27079 - beq skipuserintroutine 5571 27079 - jsr .userinterrupt 5572 27079 -skipuserintroutine 5573 27079 endif 5574 27079 5575 27079 - ifconst KEYPADSUPPORT 5576 27079 - jsr keypadcolumnread 5577 27079 endif 5578 27079 5579 27079 NMIexit 5580 27079 68 pla 5581 2707a a8 tay 5582 2707b 68 pla 5583 2707c aa tax 5584 2707d 68 pla 5585 2707e 40 RTI 5586 2707f 5587 2707f clearscreen 5588 2707f a2 17 ldx #(WZONECOUNT-1) 5589 27081 a9 00 lda #0 5590 27083 clearscreenloop 5591 27083 95 65 sta dlend,x 5592 27085 ca dex 5593 27086 10 fb bpl clearscreenloop 5594 27088 a9 00 lda #0 5595 2708a 8d ad 01 sta valbufend ; clear the bcd value buffer 5596 2708d 8d ae 01 sta valbufendsave 5597 27090 60 rts 5598 27091 5599 27091 restorescreen 5600 27091 a2 17 ldx #(WZONECOUNT-1) 5601 27093 a9 00 lda #0 5602 27095 restorescreenloop 5603 27095 b5 82 lda dlendsave,x 5604 27097 95 65 sta dlend,x 5605 27099 ca dex 5606 2709a 10 f9 bpl restorescreenloop 5607 2709c ad ae 01 lda valbufendsave 5608 2709f 8d ad 01 sta valbufend 5609 270a2 60 rts 5610 270a3 5611 270a3 savescreen 5612 270a3 a2 17 ldx #(WZONECOUNT-1) 5613 270a5 savescreenloop 5614 270a5 b5 65 lda dlend,x 5615 270a7 95 82 sta dlendsave,x 5616 270a9 ca dex 5617 270aa 10 f9 bpl savescreenloop 5618 270ac ad ad 01 lda valbufend 5619 270af 8d ae 01 sta valbufendsave 5620 270b2 - ifconst DOUBLEBUFFER 5621 270b2 - lda doublebufferstate 5622 270b2 - beq savescreenrts 5623 270b2 - lda #1 5624 270b2 - sta doublebufferbufferdirty 5625 270b2 -savescreenrts 5626 270b2 endif ; DOUBLEBUFFER 5627 270b2 60 rts 5628 270b3 5629 270b3 drawscreen 5630 270b3 5631 270b3 - ifconst interrupthold 5632 270b3 - lda #$FF 5633 270b3 - sta interrupthold ; if the user called drawscreen, we're ready for interrupts 5634 270b3 endif 5635 270b3 5636 270b3 a9 00 lda #0 5637 270b5 85 42 sta temp1 ; not B&W if we're here... 5638 270b7 5639 270b7 drawscreenwait 5640 270b7 a5 4d lda visibleover 5641 270b9 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 5642 270bb 5643 270bb ;restore some registers in case the game changed them mid-screen... 5644 270bb ad 07 21 lda sCTRL 5645 270be 05 42 ora temp1 5646 270c0 85 3c sta CTRL 5647 270c2 ad 0b 21 lda sCHARBASE 5648 270c5 85 34 sta CHARBASE 5649 270c7 5650 270c7 ;ensure all of the display list is terminated... 5651 270c7 20 38 f1 jsr terminatedisplaylist 5652 270ca 5653 270ca ifnconst pauseroutineoff 5654 270ca 20 d5 f0 jsr pauseroutine 5655 270cd endif ; pauseroutineoff 5656 270cd 5657 270cd ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 5658 270cd ; delaying a full frame, but still allowing time for basic calculations. 5659 270cd visiblescreenstartedwait 5660 270cd a5 4d lda visibleover 5661 270cf f0 fc beq visiblescreenstartedwait 5662 270d1 visiblescreenstartedwaitdone 5663 270d1 ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 5664 270d4 60 rts 5665 270d5 5666 270d5 ifnconst pauseroutineoff 5667 270d5 ; check to see if pause was pressed and released 5668 270d5 pauseroutine 5669 270d5 ad b3 01 lda pausedisable 5670 270d8 d0 4e bne leavepauseroutine 5671 270da a9 08 lda #8 5672 270dc 2c 82 02 bit SWCHB 5673 270df f0 29 beq pausepressed 5674 270e1 5675 270e1 ifnconst SOFTRESETASPAUSEOFF 5676 270e1 ifnconst MOUSESUPPORT 5677 270e1 ifnconst TRAKBALLSUPPORT 5678 270e1 ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 5679 270e4 29 70 and #%01110000 ; _LDU 5680 270e6 f0 22 beq pausepressed 5681 270e8 endif 5682 270e8 endif 5683 270e8 endif 5684 270e8 5685 270e8 ;pause isn't pressed 5686 270e8 a9 00 lda #0 5687 270ea 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 5688 270ed 5689 270ed ;check if we're in an already paused state 5690 270ed ad 00 21 lda pausestate 5691 270f0 f0 36 beq leavepauseroutine ; nope, leave 5692 270f2 5693 270f2 c9 01 cmp #1 ; last frame was the start of pausing 5694 270f4 f0 2b beq enterpausestate2 ; move from state 1 to 2 5695 270f6 5696 270f6 c9 02 cmp #2 5697 270f8 f0 34 beq carryonpausing 5698 270fa 5699 270fa ;pausestate must be >2, which means we're ending an unpause 5700 270fa a9 00 lda #0 5701 270fc 8d ac 01 sta pausebuttonflag 5702 270ff 8d 00 21 sta pausestate 5703 27102 ad 07 21 lda sCTRL 5704 27105 85 3c sta CTRL 5705 27107 4c 28 f1 jmp leavepauseroutine 5706 2710a 5707 2710a pausepressed 5708 2710a ;pause is pressed 5709 2710a ad ac 01 lda pausebuttonflag 5710 2710d c9 ff cmp #$ff 5711 2710f f0 1d beq carryonpausing 5712 27111 5713 27111 ;its a new press, increment the state 5714 27111 ee 00 21 inc pausestate 5715 27114 5716 27114 ;silence volume at the start and end of pausing 5717 27114 a9 00 lda #0 5718 27116 85 19 sta AUDV0 5719 27118 85 1a sta AUDV1 5720 2711a 5721 2711a - ifconst pokeysupport 5722 2711a - ldy #7 5723 2711a -pausesilencepokeyaudioloop 5724 2711a - sta (pokeybase),y 5725 2711a - dey 5726 2711a - bpl pausesilencepokeyaudioloop 5727 2711a endif ; pokeysupport 5728 2711a 5729 2711a a9 ff lda #$ff 5730 2711c 8d ac 01 sta pausebuttonflag 5731 2711f d0 0d bne carryonpausing 5732 27121 5733 27121 enterpausestate2 5734 27121 a9 02 lda #2 5735 27123 8d 00 21 sta pausestate 5736 27126 d0 06 bne carryonpausing 5737 27128 leavepauseroutine 5738 27128 ad 07 21 lda sCTRL 5739 2712b 85 3c sta CTRL 5740 2712d 60 rts 5741 2712e carryonpausing 5742 2712e - ifconst .pause 5743 2712e - jsr .pause 5744 2712e endif ; .pause 5745 2712e ad 07 21 lda sCTRL 5746 27131 09 80 ora #%10000000 ; turn off colorburst during pause... 5747 27133 85 3c sta CTRL 5748 27135 4c d5 f0 jmp pauseroutine 5749 27138 endif ; pauseroutineoff 5750 27138 5751 27138 5752 27138 - ifconst DOUBLEBUFFER 5753 27138 -skipterminatedisplaylistreturn 5754 27138 - rts 5755 27138 endif ; DOUBLEBUFFER 5756 27138 terminatedisplaylist 5757 27138 - ifconst DOUBLEBUFFER 5758 27138 - lda doublebufferstate 5759 27138 - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 5760 27138 endif ; DOUBLEBUFFER 5761 27138 terminatedisplaybuffer 5762 27138 ;add DL end entry on each DL 5763 27138 a2 17 ldx #(WZONECOUNT-1) 5764 2713a dlendloop 5765 2713a bd 3e f6 lda DLPOINTL,x 5766 2713d - ifconst DOUBLEBUFFER 5767 2713d - clc 5768 2713d - adc doublebufferdloffset 5769 2713d endif ; DOUBLEBUFFER 5770 2713d 85 63 sta dlpnt 5771 2713f bd 26 f6 lda DLPOINTH,x 5772 27142 - ifconst DOUBLEBUFFER 5773 27142 - adc #0 5774 27142 endif ; DOUBLEBUFFER 5775 27142 85 64 sta dlpnt+1 5776 27144 b4 65 ldy dlend,x 5777 27146 a9 00 lda #$00 5778 27148 dlendmoreloops 5779 27148 c8 iny 5780 27149 91 63 sta (dlpnt),y 5781 2714b - ifconst FRAMESKIPGLITCHFIXWEAK 5782 2714b - cpy #DLLASTOBJ+1 5783 2714b - beq dlendthiszonedone 5784 2714b - iny 5785 2714b - iny 5786 2714b - iny 5787 2714b - iny 5788 2714b - iny 5789 2714b - sta (dlpnt),y 5790 2714b -dlendthiszonedone 5791 2714b endif FRAMESKIPGLITCHFIXWEAK 5792 2714b - ifconst FRAMESKIPGLITCHFIX 5793 2714b - iny 5794 2714b - iny 5795 2714b - iny 5796 2714b - iny 5797 2714b - cpy #DLLASTOBJ-1 5798 2714b - bcc dlendmoreloops 5799 2714b endif ; FRAMESKIPGLITCHFIX 5800 2714b ca dex 5801 2714c 10 ec bpl dlendloop 5802 2714e 5803 2714e ifnconst pauseroutineoff 5804 2714e 20 d5 f0 jsr pauseroutine 5805 27151 endif ; pauseroutineoff 5806 27151 60 rts 5807 27152 5808 27152 uninterruptableroutines 5809 27152 ; this is for routines that must happen off the visible screen, each frame. 5810 27152 5811 27152 - ifconst AVOXVOICE 5812 27152 - jsr serviceatarivoxqueue 5813 27152 endif 5814 27152 5815 27152 a9 00 lda #0 5816 27154 8d b6 01 sta palfastframe 5817 27157 ad 09 21 lda paldetected 5818 2715a f0 10 beq skippalframeadjusting 5819 2715c ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 5820 2715c ae b5 01 ldx palframes 5821 2715f e8 inx 5822 27160 e0 05 cpx #5 5823 27162 d0 05 bne palframeskipdone 5824 27164 ee b6 01 inc palfastframe 5825 27167 a2 00 ldx #0 5826 27169 palframeskipdone 5827 27169 8e b5 01 stx palframes 5828 2716c skippalframeadjusting 5829 2716c 5830 2716c - ifconst MUSICTRACKER 5831 2716c - ; We normally run the servicesong routine from the top-screen interrupt, but if it 5832 2716c - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 5833 2716c - ; If that happens, we try again here. Chances are very small we'll run into the same 5834 2716c - ; problem twice, and if we do, we just drop a musical note or two. 5835 2716c - lda sfxschedulemissed 5836 2716c - beq servicesongwasnotmissed 5837 2716c - jsr servicesong 5838 2716c -servicesongwasnotmissed 5839 2716c endif ; MUSICTRACKER 5840 2716c 5841 2716c 60 rts 5842 2716d 5843 2716d serviceatarivoxqueue 5844 2716d - ifconst AVOXVOICE 5845 2716d - lda voxlock 5846 2716d - bne skipvoxprocessing ; the vox is in the middle of speech address update 5847 2716d -skipvoxqueuesizedec 5848 2716d - jmp processavoxvoice 5849 2716d -skipvoxprocessing 5850 2716d - rts 5851 2716d - 5852 2716d -processavoxvoice 5853 2716d - lda avoxenable 5854 2716d - bne avoxfixport 5855 2716d - SPKOUT tempavox 5856 2716d - rts 5857 2716d -avoxfixport 5858 2716d - lda #0 ; restore the port to all bits as inputs... 5859 2716d - sta CTLSWA 5860 2716d - rts 5861 2716d -silenceavoxvoice 5862 2716d - SPEAK avoxsilentdata 5863 2716d - rts 5864 2716d -avoxsilentdata 5865 2716d - .byte 31,255 5866 2716d else 5867 2716d 60 rts 5868 2716e endif ; AVOXVOICE 5869 2716e 5870 2716e joybuttonhandler 5871 2716e 8a txa 5872 2716f 0a asl 5873 27170 a8 tay 5874 27171 b9 08 00 lda INPT0,y 5875 27174 4a lsr 5876 27175 9d 02 21 sta sINPT1,x 5877 27178 b9 09 00 lda INPT1,y 5878 2717b 29 80 and #%10000000 5879 2717d 1d 02 21 ora sINPT1,x 5880 27180 9d 02 21 sta sINPT1,x 5881 27183 5882 27183 b5 0c lda INPT4,x 5883 27185 30 19 bmi .skip1bjoyfirecheck 5884 27187 ;one button joystick is down 5885 27187 49 80 eor #%10000000 5886 27189 9d 02 21 sta sINPT1,x 5887 2718c 5888 2718c ad b1 01 lda joybuttonmode 5889 2718f 3d a3 f1 and twobuttonmask,x 5890 27192 f0 0c beq .skip1bjoyfirecheck 5891 27194 ad b1 01 lda joybuttonmode 5892 27197 1d a3 f1 ora twobuttonmask,x 5893 2719a 8d b1 01 sta joybuttonmode 5894 2719d 8d 82 02 sta SWCHB 5895 271a0 .skip1bjoyfirecheck 5896 271a0 4c 57 f0 jmp buttonreadloopreturn 5897 271a3 5898 271a3 twobuttonmask 5899 271a3 04 10 .byte.b %00000100,%00010000 5900 271a5 5901 271a5 gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 5902 271a5 - ifconst LIGHTGUNSUPPORT 5903 271a5 - cpx #0 5904 271a5 - bne secondportgunhandler 5905 271a5 -firstportgunhandler 5906 271a5 - lda SWCHA 5907 271a5 - asl 5908 271a5 - asl 5909 271a5 - asl ; shift D4 to D7 5910 271a5 - and #%10000000 5911 271a5 - eor #%10000000 5912 271a5 - sta sINPT1 5913 271a5 - jmp buttonreadloopreturn 5914 271a5 -secondportgunhandler 5915 271a5 - lda SWCHA 5916 271a5 - lsr ; shift D0 into carry 5917 271a5 - lsr ; shift carry into D7 5918 271a5 - and #%10000000 5919 271a5 - eor #%10000000 5920 271a5 - sta sINPT3 5921 271a5 - jmp buttonreadloopreturn 5922 271a5 endif ; LIGHTGUNSUPPORT 5923 271a5 5924 271a5 controlsusing2buttoncode 5925 271a5 00 .byte.b 0 ; 00=no controller plugged in 5926 271a6 01 .byte.b 1 ; 01=proline joystick 5927 271a7 00 .byte.b 0 ; 02=lightgun 5928 271a8 00 .byte.b 0 ; 03=paddle 5929 271a9 01 .byte.b 1 ; 04=trakball 5930 271aa 01 .byte.b 1 ; 05=vcs joystick 5931 271ab 01 .byte.b 1 ; 06=driving control 5932 271ac 00 .byte.b 0 ; 07=keypad control 5933 271ad 00 .byte.b 0 ; 08=st mouse/cx80 5934 271ae 00 .byte.b 0 ; 09=amiga mouse 5935 271af 01 .byte.b 1 ; 10=atarivox 5936 271b0 5937 271b0 buttonhandlerhi 5938 271b0 00 .byte.b 0 ; 00=no controller plugged in 5939 271b1 f1 .byte.b >joybuttonhandler ; 01=proline joystick 5940 271b2 f1 .byte.b >gunbuttonhandler ; 02=lightgun 5941 271b3 f5 .byte.b >paddlebuttonhandler ; 03=paddle 5942 271b4 f1 .byte.b >joybuttonhandler ; 04=trakball 5943 271b5 f1 .byte.b >joybuttonhandler ; 05=vcs joystick 5944 271b6 f1 .byte.b >joybuttonhandler ; 06=driving control 5945 271b7 00 .byte.b 0 ; 07=keypad 5946 271b8 f5 .byte.b >mousebuttonhandler ; 08=st mouse 5947 271b9 f5 .byte.b >mousebuttonhandler ; 09=amiga mouse 5948 271ba f1 .byte.b >joybuttonhandler ; 10=atarivox 5949 271bb buttonhandlerlo 5950 271bb 00 .byte.b 0 ; 00=no controller plugged in 5951 271bc 6e .byte.b $0F means the sound is looped while priority is active 6083 27245 6084 27245 05 d9 ora inttemp2 6085 27247 05 d8 ora inttemp1 ; check if F|C|V=0 6086 27249 f0 23 beq zerosfx ; if so, we're at the end of the sound. 6087 2724b 6088 2724b advancesfxpointer 6089 2724b ; advance the pointer to the next sound chunk 6090 2724b c8 iny 6091 2724c 84 da sty inttemp3 6092 2724e 18 clc 6093 2724f b5 4e lda sfx1pointlo,x 6094 27251 65 da adc inttemp3 6095 27253 95 4e sta sfx1pointlo,x 6096 27255 b5 50 lda sfx1pointhi,x 6097 27257 69 00 adc #0 6098 27259 95 50 sta sfx1pointhi,x 6099 2725b 4c df f1 jmp servicesfxchannelsloop 6100 2725e 6101 2725e sfxsoundloop 6102 2725e 48 pha 6103 2725f b5 52 lda sfx1priority,x 6104 27261 d0 04 bne sfxsoundloop_carryon 6105 27263 68 pla ; fix the stack before we go 6106 27264 4c 4b f2 jmp advancesfxpointer 6107 27267 sfxsoundloop_carryon 6108 27267 68 pla 6109 27268 29 f0 and #$F0 6110 2726a 4a lsr 6111 2726b 4a lsr 6112 2726c 4a lsr 6113 2726d 4a lsr 6114 2726e 6115 2726e zerosfx 6116 2726e 95 4e sta sfx1pointlo,x 6117 27270 95 50 sta sfx1pointhi,x 6118 27272 95 52 sta sfx1priority,x 6119 27274 4c df f1 jmp servicesfxchannelsloop 6120 27277 6121 27277 6122 27277 schedulesfx 6123 27277 ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 6124 27277 a0 00 ldy #0 6125 27279 b1 e0 lda (sfxinstrumentlo),y 6126 2727b - ifconst pokeysupport 6127 2727b - cmp #$20 ; POKEY? 6128 2727b - bne scheduletiasfx 6129 2727b - jmp schedulepokeysfx 6130 2727b endif 6131 2727b scheduletiasfx 6132 2727b ;cmp #$10 ; TIA? 6133 2727b ;beq continuescheduletiasfx 6134 2727b ; rts ; unhandled!!! 6135 2727b continuescheduletiasfx 6136 2727b ifnconst TIASFXMONO 6137 2727b a5 4e lda sfx1pointlo 6138 2727d 05 50 ora sfx1pointhi 6139 2727f f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 6140 27281 a5 4f lda sfx2pointlo 6141 27283 05 51 ora sfx2pointhi 6142 27285 f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 6143 27287 ; Both channels are scheduled. 6144 27287 a0 01 ldy #1 6145 27289 b1 e0 lda (sfxinstrumentlo),y 6146 2728b d0 01 bne interruptsfx 6147 2728d 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 6148 2728e interruptsfx 6149 2728e ;Compare which active sound has a lower priority. We'll interrupt the lower one. 6150 2728e a5 52 lda sfx1priority 6151 27290 c5 53 cmp sfx2priority 6152 27292 b0 04 bcs schedulesfx2 6153 27294 endif ; !TIASFXMONO 6154 27294 6155 27294 schedulesfx1 6156 27294 a2 00 ldx #0 ; channel 1 6157 27296 ifnconst TIASFXMONO 6158 27296 f0 02 beq skipschedulesfx2 6159 27298 schedulesfx2 6160 27298 a2 01 ldx #1 ; channel 2 6161 2729a skipschedulesfx2 6162 2729a endif ; !TIASFXMONO 6163 2729a 6164 2729a - ifconst MUSICTRACKER 6165 2729a - lda sfxnoteindex 6166 2729a - bpl skipdrumkitoverride 6167 2729a - and #$7F ; subtract 128 6168 2729a - sec 6169 2729a - sbc #4 ; drums start at 132, i.e. octave 10 6170 2729a - asl 6171 2729a - tay 6172 2729a - lda tiadrumkitdefinition,y 6173 2729a - sta sfxinstrumentlo 6174 2729a - iny 6175 2729a - lda tiadrumkitdefinition,y 6176 2729a - sta sfxinstrumenthi 6177 2729a - lda #0 6178 2729a - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 6179 2729a -skipdrumkitoverride 6180 2729a endif ; MUSICTRACKER 6181 2729a a0 01 ldy #1 ; get priority and sound-resolution (in frames) 6182 2729c b1 e0 lda (sfxinstrumentlo),y 6183 2729e 95 52 sta sfx1priority,x 6184 272a0 c8 iny 6185 272a1 b1 e0 lda (sfxinstrumentlo),y 6186 272a3 95 56 sta sfx1frames,x 6187 272a5 a5 e0 lda sfxinstrumentlo 6188 272a7 18 clc 6189 272a8 69 03 adc #3 6190 272aa 95 4e sta sfx1pointlo,x 6191 272ac a5 e1 lda sfxinstrumenthi 6192 272ae 69 00 adc #0 6193 272b0 95 50 sta sfx1pointhi,x 6194 272b2 a5 e2 lda sfxpitchoffset 6195 272b4 95 54 sta sfx1poffset,x 6196 272b6 a9 00 lda #0 6197 272b8 95 58 sta sfx1tick,x 6198 272ba a5 e3 lda sfxnoteindex 6199 272bc 95 cd sta sfx1notedata,x 6200 272be 60 rts 6201 272bf 6202 272bf plotsprite 6203 272bf ifnconst NODRAWWAIT 6204 272bf - ifconst DOUBLEBUFFER 6205 272bf - lda doublebufferstate 6206 272bf - bne skipplotspritewait 6207 272bf endif ; DOUBLEBUFFER 6208 272bf - ifconst DEBUGWAITCOLOR 6209 272bf - lda #$41 6210 272bf - sta BACKGRND 6211 272bf endif 6212 272bf plotspritewait 6213 272bf a5 4d lda visibleover 6214 272c1 d0 fc bne plotspritewait 6215 272c3 skipplotspritewait 6216 272c3 - ifconst DEBUGWAITCOLOR 6217 272c3 - lda #$0 6218 272c3 - sta BACKGRND 6219 272c3 endif 6220 272c3 endif 6221 272c3 6222 272c3 ;arguments: 6223 272c3 ; temp1=lo graphicdata 6224 272c3 ; temp2=hi graphicdata 6225 272c3 ; temp3=palette | width byte 6226 272c3 ; temp4=x 6227 272c3 ; temp5=y 6228 272c3 ; temp6=mode 6229 272c3 a5 46 lda temp5 ;Y position 6230 272c5 4a lsr ; 2 - Divide by 8 or 16 6231 272c6 4a lsr ; 2 6232 272c7 4a lsr ; 2 6233 272c8 - if WZONEHEIGHT = 16 6234 272c8 - lsr ; 2 6235 272c8 endif 6236 272c8 6237 272c8 aa tax 6238 272c9 6239 272c9 ifnconst NOLIMITCHECKING 6240 272c9 6241 272c9 ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 6242 272c9 6243 272c9 c9 18 cmp #WZONECOUNT 6244 272cb 6245 272cb 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 6246 272cd ; otherwise, check to see if the bottom half is in zone 0... 6247 272cd 6248 272cd - if WZONEHEIGHT = 16 6249 272cd - cmp #15 6250 272cd else 6251 272cd c9 1f cmp #31 6252 272cf endif 6253 272cf 6254 272cf d0 05 bne exitplotsprite1 6255 272d1 a2 00 ldx #0 6256 272d3 4c 10 f3 jmp continueplotsprite2 6257 272d6 exitplotsprite1 6258 272d6 60 rts 6259 272d7 6260 272d7 continueplotsprite1 6261 272d7 endif 6262 272d7 6263 272d7 bd 3e f6 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 6264 272da - ifconst DOUBLEBUFFER 6265 272da - clc 6266 272da - adc doublebufferdloffset 6267 272da endif ; DOUBLEBUFFER 6268 272da 85 63 sta dlpnt 6269 272dc bd 26 f6 lda DLPOINTH,x 6270 272df - ifconst DOUBLEBUFFER 6271 272df - adc #0 6272 272df endif ; DOUBLEBUFFER 6273 272df 85 64 sta dlpnt+1 6274 272e1 6275 272e1 ;Create DL entry for upper part of sprite 6276 272e1 6277 272e1 b4 65 ldy dlend,x ;Get the index to the end of this DL 6278 272e3 6279 272e3 ifconst CHECKOVERWRITE 6280 272e3 c0 4b cpy #DLLASTOBJ 6281 272e5 f0 21 beq checkcontinueplotsprite2 6282 272e7 continueplotsprite1a 6283 272e7 endif 6284 272e7 6285 272e7 a5 42 lda temp1 ; graphic data, lo byte 6286 272e9 91 63 sta (dlpnt),y ;Low byte of data address 6287 272eb 6288 272eb ifnconst ATOMICSPRITEUPDATE 6289 272eb c8 iny 6290 272ec a5 47 lda temp6 6291 272ee 91 63 sta (dlpnt),y 6292 272f0 - else 6293 272f0 - iny 6294 272f0 - sty temp8 6295 272f0 endif 6296 272f0 6297 272f0 c8 iny 6298 272f1 6299 272f1 a5 46 lda temp5 ;Y position 6300 272f3 29 07 and #(WZONEHEIGHT - 1) 6301 272f5 c9 01 cmp #1 ; clear carry if our sprite is just in this zone 6302 272f7 05 43 ora temp2 ; graphic data, hi byte 6303 272f9 91 63 sta (dlpnt),y 6304 272fb 6305 272fb 6306 272fb c8 iny 6307 272fc a5 44 lda temp3 ;palette|width 6308 272fe 91 63 sta (dlpnt),y 6309 27300 6310 27300 c8 iny 6311 27301 a5 45 lda temp4 ;Horizontal position 6312 27303 91 63 sta (dlpnt),y 6313 27305 6314 27305 c8 iny 6315 27306 94 65 sty dlend,x 6316 27308 6317 27308 - ifconst ALWAYSTERMINATE 6318 27308 - iny 6319 27308 - lda #0 6320 27308 - sta (dlpnt),y 6321 27308 endif 6322 27308 6323 27308 - ifconst ATOMICSPRITEUPDATE 6324 27308 - ldy temp8 6325 27308 - lda temp6 6326 27308 - sta (dlpnt),y 6327 27308 endif 6328 27308 6329 27308 checkcontinueplotsprite2 6330 27308 6331 27308 90 38 bcc doneSPDL ;branch if the sprite was fully in the last zone 6332 2730a 6333 2730a ;Create DL entry for lower part of sprite 6334 2730a 6335 2730a e8 inx ;Next region 6336 2730b 6337 2730b ifnconst NOLIMITCHECKING 6338 2730b e0 18 cpx #WZONECOUNT 6339 2730d 6340 2730d 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 6341 2730f 60 rts 6342 27310 continueplotsprite2 6343 27310 endif 6344 27310 6345 27310 bd 3e f6 lda DLPOINTL,x ;Get pointer to next DL 6346 27313 - ifconst DOUBLEBUFFER 6347 27313 - clc 6348 27313 - adc doublebufferdloffset 6349 27313 endif ; DOUBLEBUFFER 6350 27313 85 63 sta dlpnt 6351 27315 bd 26 f6 lda DLPOINTH,x 6352 27318 - ifconst DOUBLEBUFFER 6353 27318 - adc #0 6354 27318 endif ; DOUBLEBUFFER 6355 27318 85 64 sta dlpnt+1 6356 2731a b4 65 ldy dlend,x ;Get the index to the end of this DL 6357 2731c 6358 2731c ifconst CHECKOVERWRITE 6359 2731c c0 4b cpy #DLLASTOBJ 6360 2731e d0 01 bne continueplotsprite2a 6361 27320 60 rts 6362 27321 continueplotsprite2a 6363 27321 endif 6364 27321 6365 27321 a5 42 lda temp1 ; graphic data, lo byte 6366 27323 91 63 sta (dlpnt),y 6367 27325 6368 27325 ifnconst ATOMICSPRITEUPDATE 6369 27325 c8 iny 6370 27326 a5 47 lda temp6 6371 27328 91 63 sta (dlpnt),y 6372 2732a - else 6373 2732a - iny 6374 2732a - sty temp8 6375 2732a endif 6376 2732a 6377 2732a c8 iny 6378 2732b 6379 2732b a5 46 lda temp5 ;Y position 6380 2732d 0b 07 anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 6381 2732f 05 43 ora temp2 ; graphic data, hi byte 6382 27331 e9 07 sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 6383 27333 91 63 sta (dlpnt),y 6384 27335 6385 27335 c8 iny 6386 27336 6387 27336 a5 44 lda temp3 ;palette|width 6388 27338 91 63 sta (dlpnt),y 6389 2733a 6390 2733a c8 iny 6391 2733b 6392 2733b a5 45 lda temp4 ;Horizontal position 6393 2733d 91 63 sta (dlpnt),y 6394 2733f 6395 2733f c8 iny 6396 27340 94 65 sty dlend,x 6397 27342 6398 27342 - ifconst ALWAYSTERMINATE 6399 27342 - iny 6400 27342 - lda #0 6401 27342 - sta (dlpnt),y 6402 27342 endif 6403 27342 6404 27342 - ifconst ATOMICSPRITEUPDATE 6405 27342 - ldy temp8 6406 27342 - lda temp6 6407 27342 - sta (dlpnt),y 6408 27342 endif 6409 27342 6410 27342 doneSPDL 6411 27342 60 rts 6412 27343 6413 27343 6414 27343 lockzonex 6415 27343 - ifconst ZONELOCKS 6416 27343 - ldy dlend,x 6417 27343 - cpy #DLLASTOBJ 6418 27343 - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 6419 27343 - lda DLPOINTL,x 6420 27343 - ifconst DOUBLEBUFFER 6421 27343 - clc 6422 27343 - adc doublebufferdloffset 6423 27343 - endif ; DOUBLEBUFFER 6424 27343 - sta dlpnt 6425 27343 - lda DLPOINTH,x 6426 27343 - ifconst DOUBLEBUFFER 6427 27343 - adc #0 6428 27343 - endif ; DOUBLEBUFFER 6429 27343 - sta dlpnt+1 6430 27343 - iny 6431 27343 - lda #0 6432 27343 - sta (dlpnt),y 6433 27343 - dey 6434 27343 - tya 6435 27343 - ldy #(DLLASTOBJ-1) 6436 27343 - sta (dlpnt),y 6437 27343 - iny 6438 27343 - sty dlend,x 6439 27343 -lockzonexreturn 6440 27343 - rts 6441 27343 endif ; ZONELOCKS 6442 27343 unlockzonex 6443 27343 - ifconst ZONELOCKS 6444 27343 - ldy dlend,x 6445 27343 - cpy #DLLASTOBJ 6446 27343 - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 6447 27343 - lda DLPOINTL,x 6448 27343 - ifconst DOUBLEBUFFER 6449 27343 - clc 6450 27343 - adc doublebufferdloffset 6451 27343 - endif ; DOUBLEBUFFER 6452 27343 - sta dlpnt 6453 27343 - lda DLPOINTH,x 6454 27343 - ifconst DOUBLEBUFFER 6455 27343 - adc #0 6456 27343 - endif ; DOUBLEBUFFER 6457 27343 - sta dlpnt+1 6458 27343 - dey 6459 27343 - ;ldy #(DLLASTOBJ-1) 6460 27343 - lda (dlpnt),y 6461 27343 - tay 6462 27343 - sty dlend,x 6463 27343 -unlockzonexreturn 6464 27343 endif ; ZONELOCKS 6465 27343 60 rts 6466 27344 6467 27344 plotcharloop 6468 27344 ; ** read from a data indirectly pointed to from temp8,temp9 6469 27344 ; ** format is: lo_data, hi_data, palette|width, x, y 6470 27344 ; ** format ends with lo_data | hi_data = 0 6471 27344 6472 27344 - ifconst DOUBLEBUFFER 6473 27344 - lda doublebufferstate 6474 27344 - bne skipplotcharloopwait 6475 27344 endif ; DOUBLEBUFFER 6476 27344 - ifconst DEBUGWAITCOLOR 6477 27344 - lda #$61 6478 27344 - sta BACKGRND 6479 27344 endif 6480 27344 plotcharloopwait 6481 27344 a5 4d lda visibleover 6482 27346 d0 fc bne plotcharloopwait 6483 27348 - ifconst DEBUGWAITCOLOR 6484 27348 - lda #0 6485 27348 - sta BACKGRND 6486 27348 endif 6487 27348 skipplotcharloopwait 6488 27348 plotcharlooploop 6489 27348 a0 00 ldy #0 6490 2734a b1 49 lda (temp8),y 6491 2734c 85 42 sta temp1 6492 2734e c8 iny 6493 2734f b1 49 lda (temp8),y 6494 27351 85 43 sta temp2 6495 27353 05 42 ora temp1 6496 27355 d0 01 bne plotcharloopcontinue 6497 27357 ;the pointer=0, so return 6498 27357 60 rts 6499 27358 plotcharloopcontinue 6500 27358 c8 iny 6501 27359 b1 49 lda (temp8),y 6502 2735b 85 44 sta temp3 6503 2735d c8 iny 6504 2735e b1 49 lda (temp8),y 6505 27360 85 45 sta temp4 6506 27362 c8 iny 6507 27363 b1 49 lda (temp8),y 6508 27365 ;sta temp5 ; not needed with our late entry. 6509 27365 20 7e f3 jsr plotcharactersskipentry 6510 27368 a5 49 lda temp8 6511 2736a 18 clc 6512 2736b 69 05 adc #5 6513 2736d 85 49 sta temp8 6514 2736f a5 4a lda temp9 6515 27371 69 00 adc #0 6516 27373 85 4a sta temp9 6517 27375 4c 48 f3 jmp plotcharlooploop 6518 27378 6519 27378 plotcharacters 6520 27378 - ifconst DOUBLEBUFFER 6521 27378 - lda doublebufferstate 6522 27378 - bne skipplotcharacterswait 6523 27378 endif ; DOUBLEBUFFER 6524 27378 - ifconst DEBUGWAITCOLOR 6525 27378 - lda #$41 6526 27378 - sta BACKGRND 6527 27378 endif 6528 27378 plotcharacterswait 6529 27378 a5 4d lda visibleover 6530 2737a d0 fc bne plotcharacterswait 6531 2737c - ifconst DEBUGWAITCOLOR 6532 2737c - sta BACKGRND 6533 2737c endif 6534 2737c skipplotcharacterswait 6535 2737c ;arguments: 6536 2737c ; temp1=lo charactermap 6537 2737c ; temp2=hi charactermap 6538 2737c ; temp3=palette | width byte 6539 2737c ; temp4=x 6540 2737c ; temp5=y 6541 2737c 6542 2737c a5 46 lda temp5 ;Y position 6543 2737e 6544 2737e plotcharactersskipentry 6545 2737e 6546 2737e ;ifconst ZONEHEIGHT 6547 2737e ; if ZONEHEIGHT = 16 6548 2737e ; and #$0F 6549 2737e ; endif 6550 2737e ; if ZONEHEIGHT = 8 6551 2737e ; and #$1F 6552 2737e ; endif 6553 2737e ;else 6554 2737e ; and #$0F 6555 2737e ;endif 6556 2737e 6557 2737e aa tax 6558 2737f bd 3e f6 lda DLPOINTL,x ;Get pointer to DL that the characters are in 6559 27382 - ifconst DOUBLEBUFFER 6560 27382 - clc 6561 27382 - adc doublebufferdloffset 6562 27382 endif ; DOUBLEBUFFER 6563 27382 85 63 sta dlpnt 6564 27384 bd 26 f6 lda DLPOINTH,x 6565 27387 - ifconst DOUBLEBUFFER 6566 27387 - adc #0 6567 27387 endif ; DOUBLEBUFFER 6568 27387 85 64 sta dlpnt+1 6569 27389 6570 27389 ;Create DL entry for the characters 6571 27389 6572 27389 b4 65 ldy dlend,x ;Get the index to the end of this DL 6573 2738b 6574 2738b ifconst CHECKOVERWRITE 6575 2738b c0 4b cpy #DLLASTOBJ 6576 2738d d0 01 bne continueplotcharacters 6577 2738f 60 rts 6578 27390 continueplotcharacters 6579 27390 endif 6580 27390 6581 27390 a5 42 lda temp1 ; character map data, lo byte 6582 27392 91 63 sta (dlpnt),y ;(1) store low address 6583 27394 6584 27394 c8 iny 6585 27395 ad 06 21 lda charactermode 6586 27398 91 63 sta (dlpnt),y ;(2) store mode 6587 2739a 6588 2739a c8 iny 6589 2739b a5 43 lda temp2 ; character map, hi byte 6590 2739d 91 63 sta (dlpnt),y ;(3) store high address 6591 2739f 6592 2739f c8 iny 6593 273a0 a5 44 lda temp3 ;palette|width 6594 273a2 91 63 sta (dlpnt),y ;(4) store palette|width 6595 273a4 6596 273a4 c8 iny 6597 273a5 a5 45 lda temp4 ;Horizontal position 6598 273a7 91 63 sta (dlpnt),y ;(5) store horizontal position 6599 273a9 6600 273a9 c8 iny 6601 273aa 94 65 sty dlend,x ; save display list end byte 6602 273ac 60 rts 6603 273ad 6604 273ad 6605 273ad - ifconst plotvalueonscreen 6606 273ad -plotcharacterslive 6607 273ad - ; a version of plotcharacters that draws live and minimally disrupts the screen... 6608 273ad - 6609 273ad - ;arguments: 6610 273ad - ; temp1=lo charactermap 6611 273ad - ; temp2=hi charactermap 6612 273ad - ; temp3=palette | width byte 6613 273ad - ; temp4=x 6614 273ad - ; temp5=y 6615 273ad - 6616 273ad - lda temp5 ;Y position 6617 273ad - 6618 273ad - tax 6619 273ad - lda DLPOINTL,x ;Get pointer to DL that the characters are in 6620 273ad - ifconst DOUBLEBUFFER 6621 273ad - clc 6622 273ad - adc doublebufferdloffset 6623 273ad - endif ; DOUBLEBUFFER 6624 273ad - sta dlpnt 6625 273ad - lda DLPOINTH,x 6626 273ad - ifconst DOUBLEBUFFER 6627 273ad - adc #0 6628 273ad - endif ; DOUBLEBUFFER 6629 273ad - sta dlpnt+1 6630 273ad - 6631 273ad - ;Create DL entry for the characters 6632 273ad - 6633 273ad - ldy dlend,x ;Get the index to the end of this DL 6634 273ad - 6635 273ad - ifconst CHECKOVERWRITE 6636 273ad - cpy #DLLASTOBJ 6637 273ad - bne continueplotcharacterslive 6638 273ad - rts 6639 273ad -continueplotcharacterslive 6640 273ad - endif 6641 273ad - 6642 273ad - lda temp1 ; character map data, lo byte 6643 273ad - sta (dlpnt),y ;(1) store low address 6644 273ad - 6645 273ad - iny 6646 273ad - ; we don't add the second byte yet, since the charmap could briefly 6647 273ad - ; render without a proper character map address, width, or position. 6648 273ad - lda charactermode 6649 273ad - sta (dlpnt),y ;(2) store mode 6650 273ad - 6651 273ad - iny 6652 273ad - lda temp2 ; character map, hi byte 6653 273ad - sta (dlpnt),y ;(3) store high address 6654 273ad - 6655 273ad - iny 6656 273ad - lda temp3 ;palette|width 6657 273ad - sta (dlpnt),y ;(4) store palette|width 6658 273ad - 6659 273ad - iny 6660 273ad - lda temp4 ;Horizontal position 6661 273ad - sta (dlpnt),y ;(5) store horizontal position 6662 273ad - 6663 273ad - iny 6664 273ad - sty dlend,x ; save display list end byte 6665 273ad - 6666 273ad - rts 6667 273ad endif ;plotcharacterslive 6668 273ad 6669 273ad ifconst USED_PLOTVALUE 6670 273ad plotvalue 6671 273ad ; calling 7800basic command: 6672 273ad ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6673 273ad ; ...displays the variable as BCD digits 6674 273ad ; 6675 273ad ; asm sub arguments: 6676 273ad ; temp1=lo charactermap 6677 273ad ; temp2=hi charactermap 6678 273ad ; temp3=palette | width byte 6679 273ad ; temp4=x 6680 273ad ; temp5=y 6681 273ad ; temp6=number of digits 6682 273ad ; temp7=lo variable 6683 273ad ; temp8=hi variable 6684 273ad ; temp9=character mode 6685 273ad 6686 273ad 00 47 plotdigitcount = temp6 6687 273ad 6688 273ad - ifconst ZONELOCKS 6689 273ad - ldx temp5 6690 273ad - ldy dlend,x 6691 273ad - cpy #DLLASTOBJ 6692 273ad - bne carryonplotvalue 6693 273ad - rts 6694 273ad -carryonplotvalue 6695 273ad endif 6696 273ad 6697 273ad a9 00 lda #0 6698 273af a8 tay 6699 273b0 ae ad 01 ldx valbufend 6700 273b3 6701 273b3 a5 47 lda plotdigitcount 6702 273b5 29 01 and #1 6703 273b7 f0 07 beq pvnibble2char 6704 273b9 a9 00 lda #0 6705 273bb 9d 00 20 sta VALBUFFER,x ; just in case we skip this digit 6706 273be f0 11 beq pvnibble2char_skipnibble 6707 273c0 6708 273c0 pvnibble2char 6709 273c0 ; high nibble... 6710 273c0 b1 48 lda (temp7),y 6711 273c2 29 f0 and #$f0 6712 273c4 4a lsr 6713 273c5 4a lsr 6714 273c6 4a lsr 6715 273c7 ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6716 273c7 4a lsr 6717 273c8 endif 6718 273c8 6719 273c8 18 clc 6720 273c9 65 42 adc temp1 ; add the offset to character graphics to our value 6721 273cb 9d 00 20 sta VALBUFFER,x 6722 273ce e8 inx 6723 273cf c6 47 dec plotdigitcount 6724 273d1 6725 273d1 pvnibble2char_skipnibble 6726 273d1 ; low nibble... 6727 273d1 b1 48 lda (temp7),y 6728 273d3 29 0f and #$0f 6729 273d5 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6730 273d5 - asl 6731 273d5 endif 6732 273d5 18 clc 6733 273d6 65 42 adc temp1 ; add the offset to character graphics to our value 6734 273d8 9d 00 20 sta VALBUFFER,x 6735 273db e8 inx 6736 273dc c8 iny 6737 273dd 6738 273dd c6 47 dec plotdigitcount 6739 273df d0 df bne pvnibble2char 6740 273e1 6741 273e1 ;point to the start of our valuebuffer 6742 273e1 18 clc 6743 273e2 a9 00 lda #VALBUFFER 6747 273eb 69 00 adc #0 6748 273ed 85 43 sta temp2 6749 273ef 6750 273ef ;advance valbufend to the end of our value buffer 6751 273ef 8e ad 01 stx valbufend 6752 273f2 6753 273f2 ifnconst plotvalueonscreen 6754 273f2 4c 78 f3 jmp plotcharacters 6755 273f5 - else 6756 273f5 - jmp plotcharacterslive 6757 273f5 endif 6758 273f5 6759 273f5 endif ; USED_PLOTVALUE 6760 273f5 6761 273f5 6762 273f5 - ifconst USED_PLOTVALUEEXTRA 6763 273f5 -plotdigitcount = temp6 6764 273f5 -plotvalueextra 6765 273f5 - ; calling 7800basic command: 6766 273f5 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6767 273f5 - ; ...displays the variable as BCD digits 6768 273f5 - ; 6769 273f5 - ; asm sub arguments: 6770 273f5 - ; temp1=lo charactermap 6771 273f5 - ; temp2=hi charactermap 6772 273f5 - ; temp3=palette | width byte 6773 273f5 - ; temp4=x 6774 273f5 - ; temp5=y 6775 273f5 - ; temp6=number of digits 6776 273f5 - ; temp7=lo variable 6777 273f5 - ; temp8=hi variable 6778 273f5 - 6779 273f5 - lda #0 6780 273f5 - tay 6781 273f5 - ldx valbufend 6782 273f5 - ifnconst plotvalueonscreen 6783 273f5 - sta VALBUFFER,x 6784 273f5 - endif 6785 273f5 - 6786 273f5 - lda plotdigitcount 6787 273f5 - and #1 6788 273f5 - 6789 273f5 - bne pvnibble2char_skipnibbleextra 6790 273f5 - 6791 273f5 -pvnibble2charextra 6792 273f5 - ; high nibble... 6793 273f5 - lda (temp7),y 6794 273f5 - and #$f0 6795 273f5 - lsr 6796 273f5 - lsr 6797 273f5 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6798 273f5 - lsr 6799 273f5 - endif 6800 273f5 - clc 6801 273f5 - adc temp1 ; add the offset to character graphics to our value 6802 273f5 - sta VALBUFFER,x 6803 273f5 - inx 6804 273f5 - 6805 273f5 - ; second half of the digit 6806 273f5 - clc 6807 273f5 - adc #1 6808 273f5 - sta VALBUFFER,x 6809 273f5 - inx 6810 273f5 - 6811 273f5 -pvnibble2char_skipnibbleextra 6812 273f5 - ; low nibble... 6813 273f5 - lda (temp7),y 6814 273f5 - and #$0f 6815 273f5 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6816 273f5 - asl 6817 273f5 - endif 6818 273f5 - asl 6819 273f5 - 6820 273f5 - clc 6821 273f5 - adc temp1 ; add the offset to character graphics to our value 6822 273f5 - sta VALBUFFER,x 6823 273f5 - inx 6824 273f5 - 6825 273f5 - clc 6826 273f5 - adc #1 6827 273f5 - sta VALBUFFER,x 6828 273f5 - inx 6829 273f5 - iny 6830 273f5 - 6831 273f5 - dec plotdigitcount 6832 273f5 - bne pvnibble2charextra 6833 273f5 - 6834 273f5 - ;point to the start of our valuebuffer 6835 273f5 - clc 6836 273f5 - lda #VALBUFFER 6840 273f5 - adc #0 6841 273f5 - sta temp2 6842 273f5 - 6843 273f5 - ;advance valbufend to the end of our value buffer 6844 273f5 - stx valbufend 6845 273f5 - 6846 273f5 - ifnconst plotvalueonscreen 6847 273f5 - jmp plotcharacters 6848 273f5 - else 6849 273f5 - jmp plotcharacterslive 6850 273f5 - endif 6851 273f5 endif ; USED_PLOTVALUEEXTRA 6852 273f5 6853 273f5 boxcollision 6854 273f5 ifconst BOXCOLLISION 6855 273f5 ; the worst case cycle-time for the code below is 43 cycles. 6856 273f5 ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 6857 273f5 6858 273f5 ;__boxx1 = accumulator 6859 273f5 ;__boxy1 = y 6860 273f5 00 44 __boxw1 = temp3 6861 273f5 00 45 __boxh1 = temp4 6862 273f5 6863 273f5 00 46 __boxx2 = temp5 6864 273f5 00 47 __boxy2 = temp6 6865 273f5 00 48 __boxw2 = temp7 6866 273f5 00 49 __boxh2 = temp8 6867 273f5 6868 273f5 DoXCollisionCheck 6869 273f5 ;lda __boxx1 ; skipped. already in the accumulator 6870 273f5 c5 46 cmp __boxx2 ;3 6871 273f7 b0 07 bcs X1isbiggerthanX2 ;2/3 6872 273f9 X2isbiggerthanX1 6873 273f9 ; carry is clear 6874 273f9 65 44 adc __boxw1 ;3 6875 273fb c5 46 cmp __boxx2 ;3 6876 273fd b0 08 bcs DoYCollisionCheck ;3/2 6877 273ff 60 rts ;6 - carry clear, no collision 6878 27400 X1isbiggerthanX2 6879 27400 18 clc ;2 6880 27401 e5 48 sbc __boxw2 ;3 6881 27403 c5 46 cmp __boxx2 ;3 6882 27405 b0 13 bcs noboxcollision ;3/2 6883 27407 DoYCollisionCheck 6884 27407 98 tya ; 2 ; use to be "lda __boxy1" 6885 27408 c5 47 cmp __boxy2 ;3 6886 2740a b0 05 bcs Y1isbiggerthanY2 ;3/2 6887 2740c Y2isbiggerthanY1 6888 2740c ; carry is clear 6889 2740c 65 45 adc __boxh1 ;3 6890 2740e c5 47 cmp __boxy2 ;3 6891 27410 60 rts ;6 6892 27411 Y1isbiggerthanY2 6893 27411 18 clc ;2 6894 27412 e5 49 sbc __boxh2 ;3 6895 27414 c5 47 cmp __boxy2 ;3 6896 27416 b0 02 bcs noboxcollision ;3/2 6897 27418 yesboxcollision 6898 27418 38 sec ;2 6899 27419 60 rts ;6 6900 2741a noboxcollision 6901 2741a 18 clc ;2 6902 2741b 60 rts ;6 6903 2741c endif ; BOXCOLLISION 6904 2741c 6905 2741c randomize 6906 2741c a5 40 lda rand 6907 2741e 4a lsr 6908 2741f 26 41 rol rand16 6909 27421 90 02 bcc noeor 6910 27423 49 b4 eor #$B4 6911 27425 noeor 6912 27425 85 40 sta rand 6913 27427 45 41 eor rand16 6914 27429 60 rts 6915 2742a 6916 2742a ; *** bcd conversion routine courtesy Omegamatrix 6917 2742a ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 6918 2742a converttobcd 6919 2742a ;value to convert is in the accumulator 6920 2742a 85 42 sta temp1 6921 2742c 4a lsr 6922 2742d 65 42 adc temp1 6923 2742f 6a ror 6924 27430 4a lsr 6925 27431 4a lsr 6926 27432 65 42 adc temp1 6927 27434 6a ror 6928 27435 65 42 adc temp1 6929 27437 6a ror 6930 27438 4a lsr 6931 27439 29 3c and #$3C 6932 2743b 85 43 sta temp2 6933 2743d 4a lsr 6934 2743e 65 43 adc temp2 6935 27440 65 42 adc temp1 6936 27442 60 rts ; return the result in the accumulator 6937 27443 6938 27443 ; Y and A contain multiplicands, result in A 6939 27443 mul8 6940 27443 84 42 sty temp1 6941 27445 85 43 sta temp2 6942 27447 a9 00 lda #0 6943 27449 reptmul8 6944 27449 46 43 lsr temp2 6945 2744b 90 03 bcc skipmul8 6946 2744d 18 clc 6947 2744e 65 42 adc temp1 6948 27450 ;bcs donemul8 might save cycles? 6949 27450 skipmul8 6950 27450 ;beq donemul8 might save cycles? 6951 27450 06 42 asl temp1 6952 27452 d0 f5 bne reptmul8 6953 27454 donemul8 6954 27454 60 rts 6955 27455 6956 27455 div8 6957 27455 ; A=numerator Y=denominator, result in A 6958 27455 c0 02 cpy #2 6959 27457 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 6960 27459 84 42 sty temp1 6961 2745b a0 ff ldy #$ff 6962 2745d div8loop 6963 2745d e5 42 sbc temp1 6964 2745f c8 iny 6965 27460 b0 fb bcs div8loop 6966 27462 div8end 6967 27462 98 tya 6968 27463 ; result in A 6969 27463 60 rts 6970 27464 6971 27464 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 6972 27464 mul16 6973 27464 84 42 sty temp1 6974 27466 85 43 sta temp2 6975 27468 6976 27468 a9 00 lda #0 6977 2746a a2 08 ldx #8 6978 2746c 46 42 lsr temp1 6979 2746e mul16_1 6980 2746e 90 03 bcc mul16_2 6981 27470 18 clc 6982 27471 65 43 adc temp2 6983 27473 mul16_2 6984 27473 6a ror 6985 27474 66 42 ror temp1 6986 27476 ca dex 6987 27477 d0 f5 bne mul16_1 6988 27479 85 43 sta temp2 6989 2747b 60 rts 6990 2747c 6991 2747c ; div int/int 6992 2747c ; numerator in A, denom in temp1 6993 2747c ; returns with quotient in A, remainder in temp1 6994 2747c div16 6995 2747c 85 43 sta temp2 6996 2747e 84 42 sty temp1 6997 27480 a9 00 lda #0 6998 27482 a2 08 ldx #8 6999 27484 06 43 asl temp2 7000 27486 div16_1 7001 27486 2a rol 7002 27487 c5 42 cmp temp1 7003 27489 90 02 bcc div16_2 7004 2748b e5 42 sbc temp1 7005 2748d div16_2 7006 2748d 26 43 rol temp2 7007 2748f ca dex 7008 27490 d0 f4 bne div16_1 7009 27492 85 42 sta temp1 7010 27494 a5 43 lda temp2 7011 27496 60 rts 7012 27497 7013 27497 ifconst bankswitchmode 7014 27497 BS_jsr 7015 27497 - ifconst dumpbankswitch 7016 27497 - sta dumpbankswitch 7017 27497 endif 7018 27497 - ifconst MCPDEVCART 7019 27497 - ora #$18 7020 27497 - sta $3000 7021 27497 else 7022 27497 8d 00 80 sta $8000 7023 2749a endif 7024 2749a 68 pla 7025 2749b aa tax 7026 2749c 68 pla 7027 2749d 60 rts 7028 2749e 7029 2749e BS_return 7030 2749e 68 pla ; bankswitch bank 7031 2749f - ifconst dumpbankswitch 7032 2749f - sta dumpbankswitch 7033 2749f endif 7034 2749f - ifconst BANKRAM 7035 2749f - sta currentbank 7036 2749f - ora currentrambank 7037 2749f endif 7038 2749f - ifconst MCPDEVCART 7039 2749f - ora #$18 7040 2749f - sta $3000 7041 2749f else 7042 2749f 8d 00 80 sta $8000 7043 274a2 endif 7044 274a2 68 pla ; bankswitch $0 flag 7045 274a3 60 rts 7046 274a4 endif 7047 274a4 7048 274a4 checkselectswitch 7049 274a4 ad 82 02 lda SWCHB ; first check the real select switch... 7050 274a7 29 02 and #%00000010 7051 274a9 ifnconst MOUSESUPPORT 7052 274a9 ifnconst TRAKBALLSUPPORT 7053 274a9 f0 05 beq checkselectswitchreturn ; switch is pressed 7054 274ab ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 7055 274ae 29 b0 and #%10110000 ; R_DU 7056 274b0 endif ; TRAKBALLSUPPORT 7057 274b0 endif ; MOUSESUPPORT 7058 274b0 checkselectswitchreturn 7059 274b0 60 rts 7060 274b1 7061 274b1 checkresetswitch 7062 274b1 ad 82 02 lda SWCHB ; first check the real reset switch... 7063 274b4 29 01 and #%00000001 7064 274b6 ifnconst MOUSESUPPORT 7065 274b6 ifnconst TRAKBALLSUPPORT 7066 274b6 f0 05 beq checkresetswitchreturn ; switch is pressed 7067 274b8 ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 7068 274bb 29 70 and #%01110000 ; _LDU 7069 274bd endif ; TRAKBALLSUPPORT 7070 274bd endif ; MOUSESUPPORT 7071 274bd checkresetswitchreturn 7072 274bd 60 rts 7073 274be 7074 274be - ifconst FINESCROLLENABLED 7075 274be -finescrolldlls 7076 274be - ldx temp1 ; first DLL index x3 7077 274be - lda DLLMEM,x 7078 274be - and #%11110000 7079 274be - ora finescrolly 7080 274be - sta DLLMEM,x 7081 274be - 7082 274be - ldx temp2 ; last DLL index x3 7083 274be - lda DLLMEM,x 7084 274be - and #%11110000 7085 274be - ora finescrolly 7086 274be - eor #(WZONEHEIGHT-1) 7087 274be - sta DLLMEM,x 7088 274be - rts 7089 274be endif ; FINESCROLLENABLED 7090 274be 7091 274be - ifconst USED_ADJUSTVISIBLE 7092 274be -adjustvisible 7093 274be - ; called with temp1=first visible zone *3, temp2=last visible zone *3 7094 274be - jsr waitforvblankstart ; ensure vblank just started 7095 274be - ldx visibleDLLstart 7096 274be -findfirstinterrupt 7097 274be - lda DLLMEM,x 7098 274be - bmi foundfirstinterrupt 7099 274be - inx 7100 274be - inx 7101 274be - inx 7102 274be - bne findfirstinterrupt 7103 274be -foundfirstinterrupt 7104 274be - and #%01111111 ; clear the interrupt bit 7105 274be - sta DLLMEM,x 7106 274be - ifconst DOUBLEBUFFER 7107 274be - sta DLLMEM+DBOFFSET,x 7108 274be - endif ; DOUBLEBUFFER 7109 274be - ldx overscanDLLstart 7110 274be -findlastinterrupt 7111 274be - lda DLLMEM,x 7112 274be - bmi foundlastinterrupt 7113 274be - dex 7114 274be - dex 7115 274be - dex 7116 274be - bne findlastinterrupt 7117 274be -foundlastinterrupt 7118 274be - and #%01111111 ; clear the interrupt bit 7119 274be - sta DLLMEM,x 7120 274be - ifconst DOUBLEBUFFER 7121 274be - sta DLLMEM+DBOFFSET,x 7122 274be - endif ; DOUBLEBUFFER 7123 274be - ;now we need to set the new interrupts 7124 274be - clc 7125 274be - lda temp1 7126 274be - adc visibleDLLstart 7127 274be - tax 7128 274be - lda DLLMEM,x 7129 274be - ora #%10000000 7130 274be - sta DLLMEM,x 7131 274be - ifconst DOUBLEBUFFER 7132 274be - sta DLLMEM+DBOFFSET,x 7133 274be - endif ; DOUBLEBUFFER 7134 274be - clc 7135 274be - lda temp2 7136 274be - adc visibleDLLstart 7137 274be - tax 7138 274be - lda DLLMEM,x 7139 274be - ora #%10000000 7140 274be - sta DLLMEM,x 7141 274be - ifconst DOUBLEBUFFER 7142 274be - sta DLLMEM+DBOFFSET,x 7143 274be - endif ; DOUBLEBUFFER 7144 274be - jsr vblankresync 7145 274be - rts 7146 274be endif ; USED_ADJUSTVISIBLE 7147 274be 7148 274be vblankresync 7149 274be 20 5c f5 jsr waitforvblankstart ; ensure vblank just started 7150 274c1 a9 00 lda #0 7151 274c3 85 4d sta visibleover 7152 274c5 a9 03 lda #3 7153 274c7 8d b2 01 sta interruptindex 7154 274ca 60 rts 7155 274cb 7156 274cb createallgamedlls 7157 274cb a2 00 ldx #0 7158 274cd a9 19 lda #NVLINES 7159 274cf ac 09 21 ldy paldetected 7160 274d2 f0 03 beq skipcreatePALpadding 7161 274d4 18 clc 7162 274d5 69 15 adc #21 7163 274d7 skipcreatePALpadding 7164 274d7 20 0c f5 jsr createnonvisibledlls 7165 274da 8e 3c 21 stx visibleDLLstart 7166 274dd 20 3d f5 jsr createvisiblezones 7167 274e0 8e 3d 21 stx overscanDLLstart 7168 274e3 createallgamedllscontinue 7169 274e3 a9 50 lda #(NVLINES+55) ; extras for PAL 7170 274e5 20 0c f5 jsr createnonvisibledlls 7171 274e8 7172 274e8 ae 3c 21 ldx visibleDLLstart 7173 274eb bd 00 18 lda DLLMEM,x 7174 274ee 09 80 ora #%10000000 ; NMI 1 - start of visible screen 7175 274f0 9d 00 18 sta DLLMEM,x 7176 274f3 - ifconst DOUBLEBUFFER 7177 274f3 - sta DLLMEM+DBOFFSET,x 7178 274f3 endif ; DOUBLEBUFFER 7179 274f3 7180 274f3 ae 3d 21 ldx overscanDLLstart 7181 274f6 bd 00 18 lda DLLMEM,x 7182 274f9 09 83 ora #%10000011 ; NMI 2 - end of visible screen 7183 274fb 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 7184 274fd 9d 00 18 sta DLLMEM,x 7185 27500 - ifconst DOUBLEBUFFER 7186 27500 - sta DLLMEM+DBOFFSET,x 7187 27500 endif ; DOUBLEBUFFER 7188 27500 7189 27500 e8 inx 7190 27501 e8 inx 7191 27502 e8 inx 7192 27503 7193 27503 bd 00 18 lda DLLMEM,x 7194 27506 09 80 ora #%10000000 ; NMI 3 - deeper overscan 7195 27508 9d 00 18 sta DLLMEM,x 7196 2750b - ifconst DOUBLEBUFFER 7197 2750b - sta DLLMEM+DBOFFSET,x 7198 2750b endif ; DOUBLEBUFFER 7199 2750b 7200 2750b 60 rts 7201 2750c 7202 2750c createnonvisibledlls 7203 2750c 85 42 sta temp1 7204 2750e 4a lsr 7205 2750f 4a lsr 7206 27510 4a lsr 7207 27511 4a lsr ; /16 7208 27512 f0 09 beq skipcreatenonvisibledlls1loop 7209 27514 a8 tay 7210 27515 createnonvisibledlls1loop 7211 27515 a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 7212 27517 20 2c f5 jsr createblankdllentry 7213 2751a 88 dey 7214 2751b d0 f8 bne createnonvisibledlls1loop 7215 2751d skipcreatenonvisibledlls1loop 7216 2751d a5 42 lda temp1 7217 2751f 29 0f and #%00001111 7218 27521 f0 08 beq createnonvisibledllsreturn 7219 27523 38 sec 7220 27524 e9 01 sbc #1 7221 27526 09 40 ora #%01000000 7222 27528 20 2c f5 jsr createblankdllentry 7223 2752b createnonvisibledllsreturn 7224 2752b 60 rts 7225 2752c 7226 2752c createblankdllentry 7227 2752c 9d 00 18 sta DLLMEM,x 7228 2752f - ifconst DOUBLEBUFFER 7229 2752f - sta DLLMEM+DBOFFSET,x 7230 2752f endif ; DOUBLEBUFFER 7231 2752f e8 inx 7232 27530 a9 21 lda #$21 ; blank 7233 27532 9d 00 18 sta DLLMEM,x 7234 27535 - ifconst DOUBLEBUFFER 7235 27535 - sta DLLMEM+DBOFFSET,x 7236 27535 endif ; DOUBLEBUFFER 7237 27535 e8 inx 7238 27536 a9 00 lda #$00 7239 27538 9d 00 18 sta DLLMEM,x 7240 2753b - ifconst DOUBLEBUFFER 7241 2753b - sta DLLMEM+DBOFFSET,x 7242 2753b endif ; DOUBLEBUFFER 7243 2753b e8 inx 7244 2753c 60 rts 7245 2753d 7246 2753d createvisiblezones 7247 2753d a0 00 ldy #0 7248 2753f createvisiblezonesloop 7249 2753f b9 56 f6 lda.w DLHEIGHT,y 7250 27542 09 20 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 7251 27544 9d 00 18 sta DLLMEM,x 7252 27547 - ifconst DOUBLEBUFFER 7253 27547 - sta DLLMEM+DBOFFSET,x 7254 27547 endif ; DOUBLEBUFFER 7255 27547 e8 inx 7256 27548 b9 26 f6 lda DLPOINTH,y 7257 2754b 9d 00 18 sta DLLMEM,x 7258 2754e - ifconst DOUBLEBUFFER 7259 2754e - sta DLLMEM+DBOFFSET,x 7260 2754e endif ; DOUBLEBUFFER 7261 2754e e8 inx 7262 2754f b9 3e f6 lda DLPOINTL,y 7263 27552 9d 00 18 sta DLLMEM,x 7264 27555 - ifconst DOUBLEBUFFER 7265 27555 - clc 7266 27555 - adc #DOUBLEBUFFEROFFSET 7267 27555 - sta DLLMEM+DBOFFSET,x 7268 27555 - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 7269 27555 - inc DLLMEM+DBOFFSET-1,x 7270 27555 -skiphidoublebufferadjust 7271 27555 endif ; DOUBLEBUFFER 7272 27555 e8 inx 7273 27556 c8 iny 7274 27557 c0 18 cpy #WZONECOUNT 7275 27559 d0 e4 bne createvisiblezonesloop 7276 2755b 60 rts 7277 2755c 7278 2755c waitforvblankstart 7279 2755c vblankendwait 7280 2755c 24 28 BIT MSTAT 7281 2755e 30 fc bmi vblankendwait 7282 27560 vblankstartwait 7283 27560 24 28 BIT MSTAT 7284 27562 10 fc bpl vblankstartwait 7285 27564 60 rts 7286 27565 7287 27565 - ifconst DOUBLEBUFFER 7288 27565 -flipdisplaybufferreturn 7289 27565 - rts 7290 27565 -flipdisplaybuffer 7291 27565 - ifconst interrupthold 7292 27565 - lda #$FF 7293 27565 - sta interrupthold 7294 27565 - endif 7295 27565 - lda doublebufferstate 7296 27565 - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 7297 27565 - 7298 27565 - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 7299 27565 - 7300 27565 - lda doublebufferstate 7301 27565 - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 7302 27565 - tax 7303 27565 - 7304 27565 - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 7305 27565 - 7306 27565 -flipdisplaybufferwait1 7307 27565 - lda visibleover 7308 27565 - beq flipdisplaybufferwait1 7309 27565 - 7310 27565 -flipdisplaybufferwait 7311 27565 - lda visibleover 7312 27565 - bne flipdisplaybufferwait 7313 27565 - 7314 27565 - lda doublebufferminimumframetarget 7315 27565 - beq skipminimumframecode 7316 27565 - lda doublebufferminimumframeindex 7317 27565 - bne flipdisplaybufferwait1 7318 27565 - lda doublebufferminimumframetarget 7319 27565 - sta doublebufferminimumframeindex 7320 27565 -skipminimumframecode 7321 27565 - 7322 27565 - lda DLLMEMLutHi,x 7323 27565 - sta DPPH 7324 27565 - lda DLLMEMLutLo,x 7325 27565 - sta DPPL 7326 27565 - 7327 27565 - lda NewPageflipstate,x 7328 27565 - sta doublebufferstate 7329 27565 - lda NewPageflipoffset,x 7330 27565 - sta doublebufferdloffset 7331 27565 - 7332 27565 - lda doublebufferbufferdirty 7333 27565 - beq flipdisplaybufferreturn 7334 27565 - 7335 27565 - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 7336 27565 - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 7337 27565 - ; from the displayed buffer to the working buffer... 7338 27565 - 7339 27565 - lda doublebufferdloffset 7340 27565 - eor #DOUBLEBUFFEROFFSET 7341 27565 - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 7342 27565 - 7343 27565 - ldx #(WZONECOUNT-1) 7344 27565 -copybufferzoneloop 7345 27565 - 7346 27565 - lda DLPOINTL,x 7347 27565 - clc 7348 27565 - adc doublebufferdloffset 7349 27565 - sta temp1 7350 27565 - lda DLPOINTH,x 7351 27565 - adc #0 7352 27565 - sta temp2 7353 27565 - 7354 27565 - lda DLPOINTL,x 7355 27565 - clc 7356 27565 - adc temp6 7357 27565 - sta temp3 7358 27565 - lda DLPOINTH,x 7359 27565 - adc #0 7360 27565 - sta temp4 7361 27565 - 7362 27565 - lda dlendsave,x 7363 27565 - tay 7364 27565 -copybuffercharsloop 7365 27565 - lda (temp3),y 7366 27565 - sta (temp1),y 7367 27565 - dey 7368 27565 - bpl copybuffercharsloop 7369 27565 - dex 7370 27565 - bpl copybufferzoneloop 7371 27565 - lda #0 7372 27565 - sta doublebufferbufferdirty 7373 27565 - rts 7374 27565 - 7375 27565 -doublebufferoff 7376 27565 - lda #1 7377 27565 - sta doublebufferstate 7378 27565 - jsr flipdisplaybuffer 7379 27565 - lda #0 7380 27565 - sta doublebufferstate 7381 27565 - sta doublebufferdloffset 7382 27565 - rts 7383 27565 - 7384 27565 -DLLMEMLutLo 7385 27565 - .byte DLLMEM,>(DLLMEM+DBOFFSET) 7388 27565 -NewPageflipstate 7389 27565 - .byte 3,1 7390 27565 -NewPageflipoffset 7391 27565 - .byte DOUBLEBUFFEROFFSET,0 7392 27565 - 7393 27565 endif ; DOUBLEBUFFER 7394 27565 7395 27565 - ifconst MOUSESUPPORT 7396 27565 - 7397 27565 -rotationalcompare 7398 27565 - ; old = 00 01 10 11 7399 27565 - .byte $00, $01, $ff, $00 ; new=00 7400 27565 - .byte $ff, $00, $00, $01 ; new=01 7401 27565 - .byte $01, $00, $00, $ff ; new=10 7402 27565 - .byte $00, $ff, $01, $00 ; new=11 7403 27565 - 7404 27565 - ; 0000YyXx st mouse 7405 27565 - 7406 27565 - ; 0000xyXY amiga mouse 7407 27565 - 7408 27565 - ifconst MOUSEXONLY 7409 27565 -amigatoataribits ; swap bits 1 and 4... 7410 27565 - .byte %0000, %0000, %0010, %0010 7411 27565 - .byte %0000, %0000, %0010, %0010 7412 27565 - .byte %0001, %0001, %0011, %0011 7413 27565 - .byte %0001, %0001, %0011, %0011 7414 27565 - 7415 27565 - ; null change bits 7416 27565 - .byte %0000, %0001, %0010, %0011 7417 27565 - .byte %0000, %0001, %0010, %0011 7418 27565 - .byte %0000, %0001, %0010, %0011 7419 27565 - .byte %0000, %0001, %0010, %0011 7420 27565 - 7421 27565 - else ; !MOUSEXONLY 7422 27565 - 7423 27565 -amigatoataribits ; swap bits 1 and 4... 7424 27565 - .byte %0000, %1000, %0010, %1010 7425 27565 - .byte %0100, %1100, %0110, %1110 7426 27565 - .byte %0001, %1001, %0011, %1011 7427 27565 - .byte %0101, %1101, %0111, %1111 7428 27565 - ; null change bits 7429 27565 - .byte %0000, %0001, %0010, %0011 7430 27565 - .byte %0100, %0101, %0110, %0111 7431 27565 - .byte %1000, %1001, %1010, %1011 7432 27565 - .byte %1100, %1101, %1110, %1111 7433 27565 - endif ; !MOUSEXONLY 7434 27565 - 7435 27565 endif ; MOUSESUPPORT 7436 27565 7437 27565 mouse0update 7438 27565 - ifconst MOUSE0SUPPORT 7439 27565 - 7440 27565 -mousetableselect = inttemp2 7441 27565 -mousexdelta = inttemp3 7442 27565 -mouseydelta = inttemp4 7443 27565 -lastSWCHA = inttemp6 7444 27565 - 7445 27565 - ; 0000YyXx st mouse 7446 27565 - ; 0000xyXY amiga mouse 7447 27565 - 7448 27565 - lda #$ff 7449 27565 - sta lastSWCHA 7450 27565 - 7451 27565 - ldy port0control 7452 27565 - 7453 27565 - lda #%00010000 7454 27565 - cpy #9 ; AMIGA? 7455 27565 - bne skipamigabitsfix0 7456 27565 - lda #0 7457 27565 -skipamigabitsfix0 7458 27565 - sta mousetableselect 7459 27565 - ifconst DRIVINGBOOST 7460 27565 - cpy #6 ; DRIVING? 7461 27565 - bne skipdriving0setup 7462 27565 - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 7463 27565 - ; trails the actual mousex0, so we can smoothly interpolate toward 7464 27565 - ; the actual position. This actual position is stored in mousey0 7465 27565 - ; after the driver has run. 7466 27565 - ldx mousex0 7467 27565 - lda mousey0 7468 27565 - stx mousey0 7469 27565 - sta mousex0 7470 27565 -skipdriving0setup 7471 27565 - endif ; DRIVINGBOOST 7472 27565 - 7473 27565 - lda #0 7474 27565 - sta mousexdelta 7475 27565 - sta mouseydelta 7476 27565 - 7477 27565 - ifnconst MOUSETIME 7478 27565 - ifnconst MOUSEXONLY 7479 27565 - lda #180 ; minimum for x+y 7480 27565 - else 7481 27565 - lda #100 ; minimum for just x 7482 27565 - endif 7483 27565 - else 7484 27565 - lda #MOUSETIME 7485 27565 - endif 7486 27565 - jsr SETTIM64T ; INTIM is in Y 7487 27565 - 7488 27565 -mouse0updateloop 7489 27565 - lda SWCHA 7490 27565 - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 7491 27565 - cmp lastSWCHA 7492 27565 - beq mouse0loopcondition 7493 27565 - sta lastSWCHA 7494 27565 - lsr 7495 27565 - lsr 7496 27565 - lsr 7497 27565 - 7498 27565 - ora mousetableselect ; atari/amiga decoding table selection 7499 27565 - 7500 27565 - ; st mice encode on different bits/joystick-lines than amiga mice... 7501 27565 - ; 0000YyXx st mouse 7502 27565 - ; 0000xyXY amiga mouse 7503 27565 - ; ...so can shuffle the amiga bits to reuse the st driver. 7504 27565 - tay 7505 27565 - lax amigatoataribits,y 7506 27565 - 7507 27565 - ifnconst MOUSEXONLY 7508 27565 - ; first the Y... 7509 27565 - and #%00001100 7510 27565 - ora mousecodey0 7511 27565 - tay 7512 27565 - lda rotationalcompare,y 7513 27565 - clc 7514 27565 - adc mouseydelta 7515 27565 - sta mouseydelta 7516 27565 - tya 7517 27565 - lsr 7518 27565 - lsr 7519 27565 - sta mousecodey0 7520 27565 - txa 7521 27565 - ; ...then the X... 7522 27565 - and #%00000011 7523 27565 - tax 7524 27565 - endif ; !MOUSEXONLY 7525 27565 - 7526 27565 - asl 7527 27565 - asl 7528 27565 - ora mousecodex0 7529 27565 - tay 7530 27565 - lda rotationalcompare,y 7531 27565 - adc mousexdelta ; carry was clear by previous ASL 7532 27565 - sta mousexdelta 7533 27565 - stx mousecodex0 7534 27565 -mouse0loopcondition 7535 27565 - lda TIMINT 7536 27565 - bpl mouse0updateloop 7537 27565 - 7538 27565 - ; *** adapt to selected device resolution. 7539 27565 - ldx port0control 7540 27565 - 7541 27565 - ifconst PRECISIONMOUSING 7542 27565 - ldy port0resolution 7543 27565 - bne mouse0halveddone 7544 27565 - cpx #6 ; half-resolution is no good for driving wheels 7545 27565 - beq mouse0halveddone 7546 27565 - ; resolution=0 is half mouse resolution, necessary for precision 7547 27565 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7548 27565 - 7549 27565 - lda mousexdelta 7550 27565 - cmp #$80 7551 27565 - ror ; do a signed divide by 2. 7552 27565 - clc 7553 27565 - adc mousex0 7554 27565 - sta mousex0 7555 27565 - ifnconst MOUSEXONLY 7556 27565 - lda mouseydelta 7557 27565 - clc 7558 27565 - adc mousey0 7559 27565 - sta mousey0 7560 27565 - endif 7561 27565 - ; at half resolution we just exit after updating x and y 7562 27565 - jmp LLRET0 7563 27565 -mouse0halveddone 7564 27565 - endif ; PRECISIONMOUSING 7565 27565 - 7566 27565 - ifnconst MOUSEXONLY 7567 27565 - asl mouseydelta ; *2 because Y resolution is finer 7568 27565 - ldy port0resolution 7569 27565 - dey 7570 27565 - lda #0 7571 27565 -mousey0resolutionfix 7572 27565 - clc 7573 27565 - adc mouseydelta 7574 27565 - dey 7575 27565 - bpl mousey0resolutionfix 7576 27565 - clc 7577 27565 - adc mousey0 7578 27565 - sta mousey0 7579 27565 - endif ; MOUSEXONLY 7580 27565 - 7581 27565 - ldy port0resolution 7582 27565 - dey 7583 27565 - lda #0 7584 27565 -mousex0resolutionfix 7585 27565 - clc 7586 27565 - adc mousexdelta 7587 27565 - dey 7588 27565 - bpl mousex0resolutionfix 7589 27565 - ifnconst DRIVINGBOOST 7590 27565 - clc 7591 27565 - adc mousex0 7592 27565 - sta mousex0 7593 27565 - else 7594 27565 - cpx #6 7595 27565 - beq carryonmouse0boost 7596 27565 - clc 7597 27565 - adc mousex0 7598 27565 - sta mousex0 7599 27565 - jmp LLRET0 7600 27565 -carryonmouse0boost 7601 27565 - sta mousexdelta 7602 27565 - clc 7603 27565 - adc mousecodey0 7604 27565 - sta mousecodey0 7605 27565 - clc 7606 27565 - adc mousex0 7607 27565 - tay ; save the target X 7608 27565 - adc mousey0 ; average in the smoothly-trailing X 7609 27565 - ror 7610 27565 - sta mousex0 ; mousex0 now has the smoothly trailing X 7611 27565 - sty mousey0 ; and mousey0 has the the target X 7612 27565 - 7613 27565 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7614 27565 - ; A has mousex0, the smoothly trailing X 7615 27565 - sbc mousey0 ; less the target X 7616 27565 - bpl skipabsolutedrive0 7617 27565 - eor #$ff 7618 27565 -skipabsolutedrive0 7619 27565 - cmp #64 ; just an unreasonably large change 7620 27565 - bcc skipdrivewrapfix0 7621 27565 - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 7622 27565 -skipdrivewrapfix0 7623 27565 - 7624 27565 - ; get rid of the tweening if the distance travelled was very small 7625 27565 - lda mousexdelta 7626 27565 - cmp port0resolution 7627 27565 - bcs skipbetweenfix0 7628 27565 - lda mousex0 7629 27565 - sta mousey0 7630 27565 -skipbetweenfix0 7631 27565 - 7632 27565 -drivingboostreductioncheck0 7633 27565 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7634 27565 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7635 27565 - ; negated again because truncation during BCD math results in 7636 27565 - ; differing magnitudes, depending if the value is +ve or -ve. 7637 27565 -driving0fix 7638 27565 - lax mousecodey0 7639 27565 - cmp #$80 7640 27565 - bcs driving0skipnegate1 7641 27565 - eor #$FF 7642 27565 - adc #1 7643 27565 - sta mousecodey0 7644 27565 -driving0skipnegate1 7645 27565 - cmp #$80 7646 27565 - ror 7647 27565 - cmp #$80 7648 27565 - ror 7649 27565 - cmp #$80 7650 27565 - ror 7651 27565 - sta inttemp1 7652 27565 - lda mousecodey0 7653 27565 - sec 7654 27565 - sbc inttemp1 7655 27565 - cpx #$80 7656 27565 - bcs driving0skipnegate2 7657 27565 - eor #$FF 7658 27565 - adc #1 7659 27565 -driving0skipnegate2 7660 27565 - sta mousecodey0 7661 27565 -drivingboostdone0 7662 27565 - endif ; DRIVINGBOOST 7663 27565 - 7664 27565 - jmp LLRET0 7665 27565 - 7666 27565 endif ; MOUSE0SUPPORT 7667 27565 7668 27565 mouse1update 7669 27565 - ifconst MOUSE1SUPPORT 7670 27565 - 7671 27565 -mousetableselect = inttemp2 7672 27565 -mousexdelta = inttemp3 7673 27565 -mouseydelta = inttemp4 7674 27565 -lastSWCHA = inttemp6 7675 27565 - 7676 27565 - ; 0000YyXx st mouse 7677 27565 - ; 0000xyXY amiga mouse 7678 27565 - 7679 27565 - lda #$ff 7680 27565 - sta lastSWCHA 7681 27565 - 7682 27565 - ldy port1control 7683 27565 - 7684 27565 - lda #%00010000 7685 27565 - cpy #9 ; AMIGA? 7686 27565 - bne skipamigabitsfix1 7687 27565 - lda #0 7688 27565 -skipamigabitsfix1 7689 27565 - sta mousetableselect 7690 27565 - ifconst DRIVINGBOOST 7691 27565 - cpy #6 ; DRIVING? 7692 27565 - bne skipdriving1setup 7693 27565 - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 7694 27565 - ; trails the actual mousex1, so we can smoothly interpolate toward 7695 27565 - ; the actual position. This actual position is stored in mousey1 7696 27565 - ; after the driver has run. 7697 27565 - ldx mousex1 7698 27565 - lda mousey1 7699 27565 - stx mousey1 7700 27565 - sta mousex1 7701 27565 -skipdriving1setup 7702 27565 - endif ; DRIVINGBOOST 7703 27565 - 7704 27565 - lda #0 7705 27565 - sta mousexdelta 7706 27565 - sta mouseydelta 7707 27565 - 7708 27565 - ifnconst MOUSETIME 7709 27565 - ifnconst MOUSEXONLY 7710 27565 - lda #180 ; minimum for x+y 7711 27565 - else 7712 27565 - lda #100 ; minimum for just x 7713 27565 - endif 7714 27565 - else 7715 27565 - lda #MOUSETIME 7716 27565 - endif 7717 27565 - jsr SETTIM64T ; INTIM is in Y 7718 27565 - 7719 27565 -mouse1updateloop 7720 27565 - lda SWCHA 7721 27565 - and #%00001111 7722 27565 - cmp lastSWCHA 7723 27565 - beq mouse1loopcondition 7724 27565 - sta lastSWCHA 7725 27565 - 7726 27565 - ora mousetableselect ; atari/amiga decoding table selection 7727 27565 - 7728 27565 - ; st mice encode on different bits/joystick-lines than amiga mice... 7729 27565 - ; 0000YyXx st mouse 7730 27565 - ; 0000xyXY amiga mouse 7731 27565 - ; ...so can shuffle the amiga bits to reuse the st driver. 7732 27565 - tay 7733 27565 - lax amigatoataribits,y 7734 27565 - 7735 27565 - ifnconst MOUSEXONLY 7736 27565 - ; first the Y... 7737 27565 - and #%00001100 7738 27565 - ora mousecodey1 7739 27565 - tay 7740 27565 - lda rotationalcompare,y 7741 27565 - clc 7742 27565 - adc mouseydelta 7743 27565 - sta mouseydelta 7744 27565 - tya 7745 27565 - lsr 7746 27565 - lsr 7747 27565 - sta mousecodey1 7748 27565 - txa 7749 27565 - ; ...then the X... 7750 27565 - and #%00000011 7751 27565 - tax 7752 27565 - endif ; !MOUSEXONLY 7753 27565 - 7754 27565 - asl 7755 27565 - asl 7756 27565 - ora mousecodex1 7757 27565 - tay 7758 27565 - lda rotationalcompare,y 7759 27565 - adc mousexdelta ; carry was clear by previous ASL 7760 27565 - sta mousexdelta 7761 27565 - stx mousecodex1 7762 27565 -mouse1loopcondition 7763 27565 - lda TIMINT 7764 27565 - bpl mouse1updateloop 7765 27565 - 7766 27565 - ; *** adapt to selected device resolution. 7767 27565 - ldx port1control 7768 27565 - 7769 27565 - ifconst PRECISIONMOUSING 7770 27565 - ldy port1resolution 7771 27565 - bne mouse1halveddone 7772 27565 - cpx #6 ; half-resolution is no good for driving wheels 7773 27565 - beq mouse1halveddone 7774 27565 - ; resolution=0 is half mouse resolution, necessary for precision 7775 27565 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7776 27565 - 7777 27565 - lda mousexdelta 7778 27565 - cmp #$80 7779 27565 - ror ; do a signed divide by 2. 7780 27565 - clc 7781 27565 - adc mousex1 7782 27565 - sta mousex1 7783 27565 - ifnconst MOUSEXONLY 7784 27565 - lda mouseydelta 7785 27565 - clc 7786 27565 - adc mousey1 7787 27565 - sta mousey1 7788 27565 - endif 7789 27565 - ; at half resolution we just exit after updating x and y 7790 27565 - jmp LLRET1 7791 27565 -mouse1halveddone 7792 27565 - endif ; PRECISIONMOUSING 7793 27565 - 7794 27565 - ifnconst MOUSEXONLY 7795 27565 - asl mouseydelta ; *2 because Y resolution is finer 7796 27565 - ldy port1resolution 7797 27565 - dey 7798 27565 - lda #0 7799 27565 -mousey1resolutionfix 7800 27565 - clc 7801 27565 - adc mouseydelta 7802 27565 - dey 7803 27565 - bpl mousey1resolutionfix 7804 27565 - clc 7805 27565 - adc mousey1 7806 27565 - sta mousey1 7807 27565 - endif ; MOUSEXONLY 7808 27565 - 7809 27565 - ldy port1resolution 7810 27565 - dey 7811 27565 - lda #0 7812 27565 -mousex1resolutionfix 7813 27565 - clc 7814 27565 - adc mousexdelta 7815 27565 - dey 7816 27565 - bpl mousex1resolutionfix 7817 27565 - ifnconst DRIVINGBOOST 7818 27565 - clc 7819 27565 - adc mousex1 7820 27565 - sta mousex1 7821 27565 - else 7822 27565 - cpx #6 7823 27565 - beq carryonmouse1boost 7824 27565 - clc 7825 27565 - adc mousex1 7826 27565 - sta mousex1 7827 27565 - jmp LLRET1 7828 27565 -carryonmouse1boost 7829 27565 - sta mousexdelta 7830 27565 - clc 7831 27565 - adc mousecodey1 7832 27565 - sta mousecodey1 7833 27565 - clc 7834 27565 - adc mousex1 7835 27565 - tay ; save the target X 7836 27565 - adc mousey1 ; average in the smoothly-trailing X 7837 27565 - ror 7838 27565 - sta mousex1 ; mousex0 now has the smoothly trailing X 7839 27565 - sty mousey1 ; and mousey0 has the the target X 7840 27565 - 7841 27565 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7842 27565 - ; A has mousex1, the smoothly trailing X 7843 27565 - sbc mousey1 ; less the target X 7844 27565 - bpl skipabsolutedrive1 7845 27565 - eor #$ff 7846 27565 -skipabsolutedrive1 7847 27565 - cmp #64 ; just an unreasonably large change 7848 27565 - bcc skipdrivewrapfix1 7849 27565 - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 7850 27565 -skipdrivewrapfix1 7851 27565 - 7852 27565 - ; get rid of the tweening if the distance travelled was very small 7853 27565 - lda mousexdelta 7854 27565 - cmp port1resolution 7855 27565 - bcs skipbetweenfix1 7856 27565 - lda mousex1 7857 27565 - sta mousey1 7858 27565 -skipbetweenfix1 7859 27565 - 7860 27565 -drivingboostreductioncheck1 7861 27565 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7862 27565 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7863 27565 - ; negated again because truncation during BCD math results in 7864 27565 - ; differing magnitudes, depending if the value is +ve or -ve. 7865 27565 -driving1fix 7866 27565 - lax mousecodey1 7867 27565 - cmp #$80 7868 27565 - bcs driving0skipnegate1 7869 27565 - eor #$FF 7870 27565 - adc #1 7871 27565 - sta mousecodey1 7872 27565 -driving0skipnegate1 7873 27565 - cmp #$80 7874 27565 - ror 7875 27565 - cmp #$80 7876 27565 - ror 7877 27565 - cmp #$80 7878 27565 - ror 7879 27565 - sta inttemp1 7880 27565 - lda mousecodey1 7881 27565 - sec 7882 27565 - sbc inttemp1 7883 27565 - cpx #$80 7884 27565 - bcs driving1skipnegate2 7885 27565 - eor #$FF 7886 27565 - adc #1 7887 27565 -driving1skipnegate2 7888 27565 - sta mousecodey1 7889 27565 -drivingboostdone1 7890 27565 - endif ; DRIVINGBOOST 7891 27565 - 7892 27565 - jmp LLRET1 7893 27565 - 7894 27565 endif ; MOUSE1SUPPORT 7895 27565 7896 27565 7897 27565 trakball0update 7898 27565 - ifconst TRAKBALL0SUPPORT 7899 27565 - ifnconst TRAKTIME 7900 27565 - ifnconst TRAKXONLY 7901 27565 - lda #180 ; minimum for x+y 7902 27565 - else ; !TRAKXONLY 7903 27565 - lda #100 ; minimum for just x 7904 27565 - endif ; !TRAKXONLY 7905 27565 - else ; !TRAKTIME 7906 27565 - lda #TRAKTIME 7907 27565 - endif ; !TRAKTIME 7908 27565 - jsr SETTIM64T ; INTIM is in Y 7909 27565 - ldx #0 7910 27565 - ifnconst TRAKXONLY 7911 27565 - ldy #0 7912 27565 - endif ; TRAKXONLY 7913 27565 -trakball0updateloop 7914 27565 - lda SWCHA 7915 27565 - and #%00110000 7916 27565 - cmp trakballcodex0 7917 27565 - sta trakballcodex0 7918 27565 - beq trakball0movementXdone 7919 27565 - and #%00010000 7920 27565 - beq trakball0negativeX 7921 27565 -trakball0positiveX 7922 27565 - ;(2 from beq) 7923 27565 - inx ; 2 7924 27565 - jmp trakball0movementXdone ; 3 7925 27565 -trakball0negativeX 7926 27565 - ;(3 from beq) 7927 27565 - dex ; 2 7928 27565 - nop ; 2 7929 27565 -trakball0movementXdone 7930 27565 - 7931 27565 - ifnconst TRAKXONLY 7932 27565 - lda SWCHA 7933 27565 - and #%11000000 7934 27565 - cmp trakballcodey0 7935 27565 - sta trakballcodey0 7936 27565 - beq trakball0movementYdone 7937 27565 - and #%01000000 7938 27565 - beq trakball0negativeY 7939 27565 -trakball0positiveY 7940 27565 - ;(2 from beq) 7941 27565 - iny ; 2 7942 27565 - jmp trakball0movementYdone ; 3 7943 27565 -trakball0negativeY 7944 27565 - ;(3 from beq) 7945 27565 - dey ; 2 7946 27565 - nop ; 2 7947 27565 -trakball0movementYdone 7948 27565 - endif ; !TRAKXONLY 7949 27565 - 7950 27565 - lda TIMINT 7951 27565 - bpl trakball0updateloop 7952 27565 - lda #0 7953 27565 - cpx #0 7954 27565 - beq trakball0skipXadjust 7955 27565 - clc 7956 27565 -trakball0Xloop 7957 27565 - adc port0resolution 7958 27565 - dex 7959 27565 - bne trakball0Xloop 7960 27565 - clc 7961 27565 - adc trakballx0 7962 27565 - sta trakballx0 7963 27565 -trakball0skipXadjust 7964 27565 - ifnconst TRAKXONLY 7965 27565 - lda #0 7966 27565 - cpy #0 7967 27565 - beq trakball0skipYadjust 7968 27565 - clc 7969 27565 -trakball0yloop 7970 27565 - adc port0resolution 7971 27565 - dey 7972 27565 - bne trakball0yloop 7973 27565 - clc 7974 27565 - adc trakbally0 7975 27565 - sta trakbally0 7976 27565 -trakball0skipYadjust 7977 27565 - endif ; !TRAKXONLY 7978 27565 - 7979 27565 - jmp LLRET0 7980 27565 endif 7981 27565 7982 27565 7983 27565 7984 27565 trakball1update 7985 27565 - ifconst TRAKBALL1SUPPORT 7986 27565 - ifnconst TRAKTIME 7987 27565 - ifnconst TRAKXONLY 7988 27565 - lda #180 ; minimum for x+y 7989 27565 - else ; !TRAKXONLY 7990 27565 - lda #100 ; minimum for just x 7991 27565 - endif ; !TRAKXONLY 7992 27565 - else ; !TRAKTIME 7993 27565 - lda #TRAKTIME 7994 27565 - endif ; !TRAKTIME 7995 27565 - jsr SETTIM64T ; INTIM is in Y 7996 27565 - ldx #0 7997 27565 - ifnconst TRAKXONLY 7998 27565 - ldy #0 7999 27565 - endif ; TRAKXONLY 8000 27565 -trakball1updateloop 8001 27565 - lda SWCHA 8002 27565 - and #%00000011 8003 27565 - cmp trakballcodex1 8004 27565 - sta trakballcodex1 8005 27565 - beq trakball1movementXdone 8006 27565 - and #%00000001 8007 27565 - beq trakball1negativeX 8008 27565 -trakball1positiveX 8009 27565 - ;(2 from beq) 8010 27565 - inx ; 2 8011 27565 - jmp trakball1movementXdone ; 3 8012 27565 -trakball1negativeX 8013 27565 - ;(3 from beq) 8014 27565 - dex ; 2 8015 27565 - nop ; 2 8016 27565 -trakball1movementXdone 8017 27565 - 8018 27565 - ifnconst TRAKXONLY 8019 27565 - lda SWCHA 8020 27565 - and #%00001100 8021 27565 - cmp trakballcodey1 8022 27565 - sta trakballcodey1 8023 27565 - beq trakball1movementYdone 8024 27565 - and #%00000100 8025 27565 - beq trakball1negativeY 8026 27565 -trakball1positiveY 8027 27565 - ;(2 from beq) 8028 27565 - iny ; 2 8029 27565 - jmp trakball1movementYdone ; 3 8030 27565 -trakball1negativeY 8031 27565 - ;(3 from beq) 8032 27565 - dey ; 2 8033 27565 - nop ; 2 8034 27565 -trakball1movementYdone 8035 27565 - endif ; !TRAKXONLY 8036 27565 - 8037 27565 - lda TIMINT 8038 27565 - bpl trakball1updateloop 8039 27565 - lda #0 8040 27565 - cpx #0 8041 27565 - beq trakball1skipXadjust 8042 27565 - clc 8043 27565 -trakball1Xloop 8044 27565 - adc port1resolution 8045 27565 - dex 8046 27565 - bne trakball1Xloop 8047 27565 - clc 8048 27565 - adc trakballx1 8049 27565 - sta trakballx1 8050 27565 -trakball1skipXadjust 8051 27565 - ifnconst TRAKXONLY 8052 27565 - lda #0 8053 27565 - cpy #0 8054 27565 - beq trakball1skipYadjust 8055 27565 - clc 8056 27565 -trakball1yloop 8057 27565 - adc port1resolution 8058 27565 - dey 8059 27565 - bne trakball1yloop 8060 27565 - clc 8061 27565 - adc trakbally1 8062 27565 - sta trakbally1 8063 27565 -trakball1skipYadjust 8064 27565 - endif ; !TRAKXONLY 8065 27565 - 8066 27565 - jmp LLRET1 8067 27565 endif 8068 27565 8069 27565 8070 27565 paddleport0update 8071 27565 - ifconst PADDLE0SUPPORT 8072 27565 - lda #6 8073 27565 - sta VBLANK ; start charging the paddle caps 8074 27565 - lda #0 ; use PADDLE timing 8075 27565 - jsr SETTIM64T ; INTIM is in Y 8076 27565 - 8077 27565 -paddleport0updateloop 8078 27565 - lda INPT0 8079 27565 - bmi skippaddle0setposition 8080 27565 - sty paddleposition0 8081 27565 -skippaddle0setposition 8082 27565 - ifconst TWOPADDLESUPPORT 8083 27565 - lda INPT1 8084 27565 - bmi skippaddle1setposition 8085 27565 - sty paddleposition1 8086 27565 -skippaddle1setposition 8087 27565 - endif 8088 27565 - ldy INTIM 8089 27565 - cpy #TIMEOFFSET 8090 27565 - bcs paddleport0updateloop 8091 27565 - 8092 27565 - lda #%10000110 8093 27565 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8094 27565 - sec 8095 27565 - lda paddleposition0 8096 27565 - sbc #TIMEOFFSET 8097 27565 - ifconst PADDLESCALEX2 8098 27565 - asl 8099 27565 - endif 8100 27565 - 8101 27565 - ifnconst PADDLESMOOTHINGOFF 8102 27565 - clc 8103 27565 - adc paddleprevious0 8104 27565 - ror 8105 27565 - sta paddleprevious0 8106 27565 - endif 8107 27565 - 8108 27565 - sta paddleposition0 8109 27565 - 8110 27565 - ifconst TWOPADDLESUPPORT 8111 27565 - sec 8112 27565 - lda paddleposition1 8113 27565 - sbc #TIMEOFFSET 8114 27565 - ifconst PADDLESCALEX2 8115 27565 - asl 8116 27565 - endif 8117 27565 - 8118 27565 - ifnconst PADDLESMOOTHINGOFF 8119 27565 - clc 8120 27565 - adc paddleprevious1 8121 27565 - ror 8122 27565 - sta paddleprevious1 8123 27565 - endif 8124 27565 - sta paddleposition1 8125 27565 - endif ; TWOPADDLESUPPORT 8126 27565 - 8127 27565 - jmp LLRET0 8128 27565 endif 8129 27565 8130 27565 paddleport1update 8131 27565 - ifconst PADDLE1SUPPORT 8132 27565 - lda #6 8133 27565 - sta VBLANK ; start charging the paddle caps 8134 27565 - 8135 27565 - lda #0 ; use PADDLE timing 8136 27565 - jsr SETTIM64T ; INTIM is in Y 8137 27565 - 8138 27565 -paddleport1updateloop 8139 27565 - lda INPT2 8140 27565 - bmi skippaddle2setposition 8141 27565 - sty paddleposition2 8142 27565 -skippaddle2setposition 8143 27565 - ifconst TWOPADDLESUPPORT 8144 27565 - lda INPT3 8145 27565 - bmi skippaddle3setposition 8146 27565 - sty paddleposition3 8147 27565 -skippaddle3setposition 8148 27565 - endif 8149 27565 - ldy INTIM 8150 27565 - cpy #TIMEOFFSET 8151 27565 - bcs paddleport1updateloop 8152 27565 - 8153 27565 - lda #%10000110 8154 27565 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8155 27565 - sec 8156 27565 - lda paddleposition2 8157 27565 - sbc #TIMEOFFSET 8158 27565 - ifconst PADDLESCALEX2 8159 27565 - asl 8160 27565 - endif 8161 27565 - 8162 27565 - ifnconst PADDLESMOOTHINGOFF 8163 27565 - clc 8164 27565 - adc paddleprevious2 8165 27565 - ror 8166 27565 - sta paddleprevious2 8167 27565 - endif 8168 27565 - 8169 27565 - sta paddleposition2 8170 27565 - 8171 27565 - ifconst TWOPADDLESUPPORT 8172 27565 - sec 8173 27565 - lda paddleposition3 8174 27565 - sbc #TIMEOFFSET 8175 27565 - ifconst PADDLESCALEX2 8176 27565 - asl 8177 27565 - endif 8178 27565 - 8179 27565 - ifnconst PADDLESMOOTHINGOFF 8180 27565 - clc 8181 27565 - adc paddleprevious3 8182 27565 - ror 8183 27565 - sta paddleprevious3 8184 27565 - endif 8185 27565 - sta paddleposition3 8186 27565 - endif ; TWOPADDLESUPPORT 8187 27565 - 8188 27565 - jmp LLRET1 8189 27565 endif 8190 27565 8191 27565 8192 27565 paddlebuttonhandler ; outside of conditional, for button-handler LUT 8193 27565 - ifconst PADDLESUPPORT 8194 27565 - ; x=0|1 for port, rather than paddle #. 8195 27565 - ; Only the first paddle button will integrate into "joy0fire" testing. If the 8196 27565 - ; game wants to support 2 paddles, up to the game to instead test the 8197 27565 - ; joystick right+left directions instead. 8198 27565 - lda SWCHA ; top of nibble is first paddle button 8199 27565 - cpx #0 ; port 0? 8200 27565 - beq skippaddleport2shift 8201 27565 - asl ; shift second port to upper nibble 8202 27565 - asl 8203 27565 - asl 8204 27565 - asl 8205 27565 -skippaddleport2shift 8206 27565 - and #%10000000 8207 27565 - eor #%10000000 ; invert 8208 27565 - sta sINPT1,x 8209 27565 - jmp buttonreadloopreturn 8210 27565 endif ; PADDLESUPPORT 8211 27565 8212 27565 mousebuttonhandler ; outside of conditional, for button-handler LUT 8213 27565 - ifconst MOUSESUPPORT 8214 27565 - ; stick the mouse buttons in the correct shadow register... 8215 27565 - txa 8216 27565 - asl 8217 27565 - tay ; y=x*2 8218 27565 - lda INPT4,x 8219 27565 - eor #%10000000 8220 27565 - lsr 8221 27565 - sta sINPT1,x 8222 27565 - 8223 27565 - lda INPT1,y 8224 27565 - and #%10000000 8225 27565 - eor #%10000000 8226 27565 - ora sINPT1,x 8227 27565 - sta sINPT1,x 8228 27565 - jmp buttonreadloopreturn 8229 27565 endif ; MOUSESUPPORT 8230 27565 8231 27565 - ifconst KEYPADSUPPORT 8232 27565 - ; ** select keypad rows 0 to 3 over 4 frames... 8233 27565 -keypadrowselect 8234 27565 - ldy #0 8235 27565 - lda port0control 8236 27565 - cmp #7 8237 27565 - bne skipport0val 8238 27565 - iny ; y=y+1 8239 27565 -skipport0val 8240 27565 - lda port1control 8241 27565 - cmp #7 8242 27565 - bne skipport1val 8243 27565 - iny 8244 27565 - iny ; y=y+2 8245 27565 -skipport1val 8246 27565 - lda keyrowdirectionmask,y 8247 27565 - sta CTLSWA 8248 27565 - tya 8249 27565 - asl 8250 27565 - asl 8251 27565 - sta inttemp1 8252 27565 - lda framecounter 8253 27565 - and #3 8254 27565 - ora inttemp1 8255 27565 - tax 8256 27565 - lda keyrowselectvalue,x 8257 27565 - sta SWCHA 8258 27565 - rts 8259 27565 - 8260 27565 -keyrowdirectionmask 8261 27565 - .byte #%00000000 ; 0 : port0=input port1=input 8262 27565 - .byte #%11110000 ; 1 : port0=output port1=input 8263 27565 - .byte #%00001111 ; 2 : port0=input port1=output 8264 27565 - .byte #%11111111 ; 3 : port0=output port1=output 8265 27565 - 8266 27565 -keyrowselectvalue 8267 27565 - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 8268 27565 - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 8269 27565 - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 8270 27565 - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 8271 27565 endif ; KEYPADSUPPORT 8272 27565 8273 27565 - ifconst KEYPADSUPPORT 8274 27565 - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 8275 27565 -keypadcolumnread 8276 27565 - lda port0control 8277 27565 - cmp #7 8278 27565 - bne skipkeypadcolumnread0 8279 27565 - lda framecounter 8280 27565 - and #3 8281 27565 - asl ; x2 because keypad variables are interleaved 8282 27565 - tax 8283 27565 - lda #0 8284 27565 - sta keypadmatrix0a,x 8285 27565 - lda INPT0 8286 27565 - cmp #$80 8287 27565 - rol keypadmatrix0a,x 8288 27565 - lda INPT1 8289 27565 - cmp #$80 8290 27565 - rol keypadmatrix0a,x 8291 27565 - lda INPT4 8292 27565 - cmp #$80 8293 27565 - rol keypadmatrix0a,x 8294 27565 - lda keypadmatrix0a,x 8295 27565 - eor #%00000111 8296 27565 - sta keypadmatrix0a,x 8297 27565 -skipkeypadcolumnread0 8298 27565 - 8299 27565 - lda port1control 8300 27565 - cmp #7 8301 27565 - bne skipkeypadcolumnread1 8302 27565 - lda framecounter 8303 27565 - and #3 8304 27565 - asl ; x2 because keypad variables are interleaved 8305 27565 - tax 8306 27565 - lda #0 8307 27565 - sta keypadmatrix1a,x 8308 27565 - rol keypadmatrix1a,x 8309 27565 - lda INPT2 8310 27565 - cmp #$80 8311 27565 - rol keypadmatrix1a,x 8312 27565 - lda INPT3 8313 27565 - cmp #$80 8314 27565 - rol keypadmatrix1a,x 8315 27565 - lda INPT5 8316 27565 - cmp #$80 8317 27565 - rol keypadmatrix1a,x 8318 27565 - lda keypadmatrix1a,x 8319 27565 - eor #%00000111 8320 27565 - sta keypadmatrix1a,x 8321 27565 -skipkeypadcolumnread1 8322 27565 - rts 8323 27565 endif ; KEYPADSUPPORT 8324 27565 8325 27565 setportforinput 8326 27565 a5 e4 lda CTLSWAs 8327 27567 3d 70 f5 and allpinsinputlut,x 8328 2756a 85 e4 sta CTLSWAs 8329 2756c 8d 81 02 sta CTLSWA 8330 2756f 60 rts 8331 27570 8332 27570 allpinsinputlut 8333 27570 0f f0 .byte.b $0F, $F0 8334 27572 8335 27572 setonebuttonmode 8336 27572 a9 06 lda #6 ; in case we're in unlocked-bios mode 8337 27574 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8338 27576 a9 14 lda #$14 8339 27578 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8340 2757b a5 e5 lda CTLSWBs 8341 2757d 1d 86 f5 ora thisjoy2buttonbit,x 8342 27580 85 e5 sta CTLSWBs 8343 27582 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 8344 27585 60 rts 8345 27586 8346 27586 thisjoy2buttonbit 8347 27586 04 10 .byte.b $04, $10 8348 27588 8349 27588 settwobuttonmode 8350 27588 a9 06 lda #6 ; in case we're in unlocked-bios mode 8351 2758a 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8352 2758c a9 14 lda #$14 8353 2758e 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8354 27591 a5 e5 lda CTLSWBs 8355 27593 3d 9c f5 and thisjoy2buttonmask,x 8356 27596 85 e5 sta CTLSWBs 8357 27598 8d 82 02 sta SWCHB 8358 2759b 60 rts 8359 2759c 8360 2759c thisjoy2buttonmask 8361 2759c fb ef .byte.b $fb, $ef 8362 2759e 8363 2759e ; Provided under the CC0 license. See the included LICENSE.txt for details. 8364 2759e 8365 2759e START 8366 2759e start 8367 2759e 8368 2759e ;******** more or less the Atari recommended startup procedure 8369 2759e 8370 2759e 78 sei 8371 2759f d8 cld 8372 275a0 8373 275a0 ifnconst NOTIALOCK 8374 275a0 a9 07 lda #$07 8375 275a2 - else 8376 275a2 - lda #$06 8377 275a2 endif 8378 275a2 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 8379 275a4 a9 7f lda #$7F 8380 275a6 85 3c sta CTRL ;disable DMA 8381 275a8 a9 00 lda #$00 8382 275aa 85 38 sta OFFSET 8383 275ac ifnconst NOTIALOCK 8384 275ac 85 01 sta INPTCTRL 8385 275ae 85 20 sta BACKGRND ; black default, in case a flash cart is using something else 8386 275b0 endif 8387 275b0 a2 ff ldx #$FF 8388 275b2 9a txs 8389 275b3 8390 275b3 ;************** Clear Memory 8391 275b3 8392 275b3 ; ** Clear 1800-27FF, pg0+pg1 memory. 8393 275b3 ClearMemPages 8394 275b3 a9 00 lda #0 8395 275b5 a8 tay ; y=0 8396 275b6 85 80 sta $80 8397 275b8 a2 18 ldx #$18 8398 275ba ClearMemPagesLoop 8399 275ba 86 81 stx $81 ; needed for when we step on ZP memory 8400 275bc 91 80 sta ($80),y ;Store data 8401 275be c8 iny ;Next byte 8402 275bf d0 f9 bne ClearMemPagesLoop 8403 275c1 e8 inx 8404 275c2 e0 28 cpx #$28 8405 275c4 d0 f4 bne ClearMemPagesLoop 8406 275c6 85 81 sta $81 8407 275c8 8408 275c8 ;seed random number with hopefully-random timer value 8409 275c8 a9 01 lda #1 8410 275ca 0d 84 02 ora INTIM 8411 275cd 85 40 sta rand 8412 275cf 8413 275cf ; detect the console type... 8414 275cf pndetectvblankstart 8415 275cf a5 28 lda MSTAT 8416 275d1 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 8417 275d3 pndetectvblankover 8418 275d3 a5 28 lda MSTAT 8419 275d5 30 fc bmi pndetectvblankover ; then wait for it to be over 8420 275d7 a0 00 ldy #$00 8421 275d9 a2 00 ldx #$00 8422 275db pndetectvblankhappening 8423 275db a5 28 lda MSTAT 8424 275dd 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 8425 275df 85 24 sta WSYNC 8426 275e1 85 24 sta WSYNC 8427 275e3 e8 inx 8428 275e4 d0 f5 bne pndetectvblankhappening 8429 275e6 pndetectinvblank 8430 275e6 e0 7d cpx #125 8431 275e8 90 02 bcc pndetecispal 8432 275ea a0 01 ldy #$01 8433 275ec pndetecispal 8434 275ec 8c 09 21 sty paldetected 8435 275ef 8436 275ef 20 cb f4 jsr createallgamedlls 8437 275f2 8438 275f2 a9 18 lda #>DLLMEM 8439 275f4 85 2c sta DPPH 8440 275f6 a9 00 lda # 255 8635 27626 -DOUBLEBUFFEROFFSET = 255 8636 27626 else 8637 27626 00 4d DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 8638 27626 endif 8639 27626 8640 27626 - ifconst EXTRADLMEMORY 8641 27626 -SECONDDLHALFSTART SET $2300 8642 27626 endif 8643 27626 8644 27626 DLPOINTH 8645 27626 DLINDEX SET 0 8646 27626 REPEAT WZONECOUNT 8647 27626 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27626 - ifconst EXTRADLMEMORY 8649 27626 - if TMPMEMADDRESS > $1FFF 8650 27626 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27626 - else 8652 27626 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27626 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27626 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27626 - endif 8656 27626 - endif ; TMPMEMADDRESS > $1FFF 8657 27626 endif ; EXTRADLMEMORY 8658 27626 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27626 18 .byte.b >TMPMEMADDRESS 8660 27626 DLINDEX SET DLINDEX + 1 8646 27626 REPEND 8647 27626 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27627 - ifconst EXTRADLMEMORY 8649 27627 - if TMPMEMADDRESS > $1FFF 8650 27627 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27627 - else 8652 27627 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27627 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27627 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27627 - endif 8656 27627 - endif ; TMPMEMADDRESS > $1FFF 8657 27627 endif ; EXTRADLMEMORY 8658 27627 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27627 18 .byte.b >TMPMEMADDRESS 8660 27627 DLINDEX SET DLINDEX + 1 8646 27627 REPEND 8647 27627 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27628 - ifconst EXTRADLMEMORY 8649 27628 - if TMPMEMADDRESS > $1FFF 8650 27628 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27628 - else 8652 27628 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27628 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27628 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27628 - endif 8656 27628 - endif ; TMPMEMADDRESS > $1FFF 8657 27628 endif ; EXTRADLMEMORY 8658 27628 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27628 19 .byte.b >TMPMEMADDRESS 8660 27628 DLINDEX SET DLINDEX + 1 8646 27628 REPEND 8647 27628 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27629 - ifconst EXTRADLMEMORY 8649 27629 - if TMPMEMADDRESS > $1FFF 8650 27629 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27629 - else 8652 27629 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27629 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27629 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27629 - endif 8656 27629 - endif ; TMPMEMADDRESS > $1FFF 8657 27629 endif ; EXTRADLMEMORY 8658 27629 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27629 19 .byte.b >TMPMEMADDRESS 8660 27629 DLINDEX SET DLINDEX + 1 8646 27629 REPEND 8647 27629 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 2762a - ifconst EXTRADLMEMORY 8649 2762a - if TMPMEMADDRESS > $1FFF 8650 2762a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 2762a - else 8652 2762a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 2762a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 2762a -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 2762a - endif 8656 2762a - endif ; TMPMEMADDRESS > $1FFF 8657 2762a endif ; EXTRADLMEMORY 8658 2762a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 2762a 19 .byte.b >TMPMEMADDRESS 8660 2762a DLINDEX SET DLINDEX + 1 8646 2762a REPEND 8647 2762a TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 2762b - ifconst EXTRADLMEMORY 8649 2762b - if TMPMEMADDRESS > $1FFF 8650 2762b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 2762b - else 8652 2762b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 2762b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 2762b -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 2762b - endif 8656 2762b - endif ; TMPMEMADDRESS > $1FFF 8657 2762b endif ; EXTRADLMEMORY 8658 2762b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 2762b 1a .byte.b >TMPMEMADDRESS 8660 2762b DLINDEX SET DLINDEX + 1 8646 2762b REPEND 8647 2762b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 2762c - ifconst EXTRADLMEMORY 8649 2762c - if TMPMEMADDRESS > $1FFF 8650 2762c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 2762c - else 8652 2762c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 2762c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 2762c -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 2762c - endif 8656 2762c - endif ; TMPMEMADDRESS > $1FFF 8657 2762c endif ; EXTRADLMEMORY 8658 2762c ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 2762c 1a .byte.b >TMPMEMADDRESS 8660 2762c DLINDEX SET DLINDEX + 1 8646 2762c REPEND 8647 2762c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 2762d - ifconst EXTRADLMEMORY 8649 2762d - if TMPMEMADDRESS > $1FFF 8650 2762d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 2762d - else 8652 2762d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 2762d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 2762d -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 2762d - endif 8656 2762d - endif ; TMPMEMADDRESS > $1FFF 8657 2762d endif ; EXTRADLMEMORY 8658 2762d ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 2762d 1a .byte.b >TMPMEMADDRESS 8660 2762d DLINDEX SET DLINDEX + 1 8646 2762d REPEND 8647 2762d TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 2762e - ifconst EXTRADLMEMORY 8649 2762e - if TMPMEMADDRESS > $1FFF 8650 2762e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 2762e - else 8652 2762e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 2762e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 2762e -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 2762e - endif 8656 2762e - endif ; TMPMEMADDRESS > $1FFF 8657 2762e endif ; EXTRADLMEMORY 8658 2762e ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 2762e 1b .byte.b >TMPMEMADDRESS 8660 2762e DLINDEX SET DLINDEX + 1 8646 2762e REPEND 8647 2762e TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 2762f - ifconst EXTRADLMEMORY 8649 2762f - if TMPMEMADDRESS > $1FFF 8650 2762f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 2762f - else 8652 2762f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 2762f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 2762f -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 2762f - endif 8656 2762f - endif ; TMPMEMADDRESS > $1FFF 8657 2762f endif ; EXTRADLMEMORY 8658 2762f ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 2762f 1b .byte.b >TMPMEMADDRESS 8660 2762f DLINDEX SET DLINDEX + 1 8646 2762f REPEND 8647 2762f TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27630 - ifconst EXTRADLMEMORY 8649 27630 - if TMPMEMADDRESS > $1FFF 8650 27630 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27630 - else 8652 27630 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27630 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27630 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27630 - endif 8656 27630 - endif ; TMPMEMADDRESS > $1FFF 8657 27630 endif ; EXTRADLMEMORY 8658 27630 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27630 1b .byte.b >TMPMEMADDRESS 8660 27630 DLINDEX SET DLINDEX + 1 8646 27630 REPEND 8647 27630 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27631 - ifconst EXTRADLMEMORY 8649 27631 - if TMPMEMADDRESS > $1FFF 8650 27631 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27631 - else 8652 27631 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27631 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27631 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27631 - endif 8656 27631 - endif ; TMPMEMADDRESS > $1FFF 8657 27631 endif ; EXTRADLMEMORY 8658 27631 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27631 1b .byte.b >TMPMEMADDRESS 8660 27631 DLINDEX SET DLINDEX + 1 8646 27631 REPEND 8647 27631 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27632 - ifconst EXTRADLMEMORY 8649 27632 - if TMPMEMADDRESS > $1FFF 8650 27632 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27632 - else 8652 27632 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27632 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27632 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27632 - endif 8656 27632 - endif ; TMPMEMADDRESS > $1FFF 8657 27632 endif ; EXTRADLMEMORY 8658 27632 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27632 1c .byte.b >TMPMEMADDRESS 8660 27632 DLINDEX SET DLINDEX + 1 8646 27632 REPEND 8647 27632 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27633 - ifconst EXTRADLMEMORY 8649 27633 - if TMPMEMADDRESS > $1FFF 8650 27633 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27633 - else 8652 27633 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27633 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27633 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27633 - endif 8656 27633 - endif ; TMPMEMADDRESS > $1FFF 8657 27633 endif ; EXTRADLMEMORY 8658 27633 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27633 1c .byte.b >TMPMEMADDRESS 8660 27633 DLINDEX SET DLINDEX + 1 8646 27633 REPEND 8647 27633 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27634 - ifconst EXTRADLMEMORY 8649 27634 - if TMPMEMADDRESS > $1FFF 8650 27634 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27634 - else 8652 27634 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27634 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27634 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27634 - endif 8656 27634 - endif ; TMPMEMADDRESS > $1FFF 8657 27634 endif ; EXTRADLMEMORY 8658 27634 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27634 1c .byte.b >TMPMEMADDRESS 8660 27634 DLINDEX SET DLINDEX + 1 8646 27634 REPEND 8647 27634 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27635 - ifconst EXTRADLMEMORY 8649 27635 - if TMPMEMADDRESS > $1FFF 8650 27635 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27635 - else 8652 27635 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27635 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27635 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27635 - endif 8656 27635 - endif ; TMPMEMADDRESS > $1FFF 8657 27635 endif ; EXTRADLMEMORY 8658 27635 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27635 1d .byte.b >TMPMEMADDRESS 8660 27635 DLINDEX SET DLINDEX + 1 8646 27635 REPEND 8647 27635 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27636 - ifconst EXTRADLMEMORY 8649 27636 - if TMPMEMADDRESS > $1FFF 8650 27636 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27636 - else 8652 27636 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27636 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27636 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27636 - endif 8656 27636 - endif ; TMPMEMADDRESS > $1FFF 8657 27636 endif ; EXTRADLMEMORY 8658 27636 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27636 1d .byte.b >TMPMEMADDRESS 8660 27636 DLINDEX SET DLINDEX + 1 8646 27636 REPEND 8647 27636 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27637 - ifconst EXTRADLMEMORY 8649 27637 - if TMPMEMADDRESS > $1FFF 8650 27637 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27637 - else 8652 27637 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27637 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27637 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27637 - endif 8656 27637 - endif ; TMPMEMADDRESS > $1FFF 8657 27637 endif ; EXTRADLMEMORY 8658 27637 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27637 1d .byte.b >TMPMEMADDRESS 8660 27637 DLINDEX SET DLINDEX + 1 8646 27637 REPEND 8647 27637 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27638 - ifconst EXTRADLMEMORY 8649 27638 - if TMPMEMADDRESS > $1FFF 8650 27638 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27638 - else 8652 27638 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27638 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27638 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27638 - endif 8656 27638 - endif ; TMPMEMADDRESS > $1FFF 8657 27638 endif ; EXTRADLMEMORY 8658 27638 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27638 1e .byte.b >TMPMEMADDRESS 8660 27638 DLINDEX SET DLINDEX + 1 8646 27638 REPEND 8647 27638 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 27639 - ifconst EXTRADLMEMORY 8649 27639 - if TMPMEMADDRESS > $1FFF 8650 27639 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 27639 - else 8652 27639 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 27639 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 27639 -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 27639 - endif 8656 27639 - endif ; TMPMEMADDRESS > $1FFF 8657 27639 endif ; EXTRADLMEMORY 8658 27639 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 27639 1e .byte.b >TMPMEMADDRESS 8660 27639 DLINDEX SET DLINDEX + 1 8646 27639 REPEND 8647 27639 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 2763a - ifconst EXTRADLMEMORY 8649 2763a - if TMPMEMADDRESS > $1FFF 8650 2763a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 2763a - else 8652 2763a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 2763a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 2763a -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 2763a - endif 8656 2763a - endif ; TMPMEMADDRESS > $1FFF 8657 2763a endif ; EXTRADLMEMORY 8658 2763a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 2763a 1e .byte.b >TMPMEMADDRESS 8660 2763a DLINDEX SET DLINDEX + 1 8646 2763a REPEND 8647 2763a TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 2763b - ifconst EXTRADLMEMORY 8649 2763b - if TMPMEMADDRESS > $1FFF 8650 2763b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 2763b - else 8652 2763b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 2763b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 2763b -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 2763b - endif 8656 2763b - endif ; TMPMEMADDRESS > $1FFF 8657 2763b endif ; EXTRADLMEMORY 8658 2763b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 2763b 1f .byte.b >TMPMEMADDRESS 8660 2763b DLINDEX SET DLINDEX + 1 8646 2763b REPEND 8647 2763b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 2763c - ifconst EXTRADLMEMORY 8649 2763c - if TMPMEMADDRESS > $1FFF 8650 2763c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 2763c - else 8652 2763c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 2763c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 2763c -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 2763c - endif 8656 2763c - endif ; TMPMEMADDRESS > $1FFF 8657 2763c endif ; EXTRADLMEMORY 8658 2763c ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 2763c 1f .byte.b >TMPMEMADDRESS 8660 2763c DLINDEX SET DLINDEX + 1 8646 2763c REPEND 8647 2763c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8648 2763d - ifconst EXTRADLMEMORY 8649 2763d - if TMPMEMADDRESS > $1FFF 8650 2763d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8651 2763d - else 8652 2763d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8653 2763d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8654 2763d -SECONDDLHALFSTART SET TMPMEMADDRESS 8655 2763d - endif 8656 2763d - endif ; TMPMEMADDRESS > $1FFF 8657 2763d endif ; EXTRADLMEMORY 8658 2763d ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8659 2763d 1f .byte.b >TMPMEMADDRESS 8660 2763d DLINDEX SET DLINDEX + 1 8661 2763e REPEND 8662 2763e 8663 2763e - ifconst EXTRADLMEMORY 8664 2763e - echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 8665 2763e endif 8666 2763e 8667 2763e 8668 2763e DLPOINTL 8669 2763e DLINDEX SET 0 8670 2763e REPEAT WZONECOUNT 8671 2763e TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8672 2763e - ifconst EXTRADLMEMORY 8673 2763e - if TMPMEMADDRESS > $1FFF 8674 2763e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 2763e - else 8676 2763e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 2763e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 2763e - endif 8679 2763e - endif ; TMPMEMADDRESS > $1FFF 8680 2763e endif ; EXTRADLMEMORY 8681 2763e 80 .byte.b $1FFF 8674 2763f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 2763f - else 8676 2763f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 2763f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 2763f - endif 8679 2763f - endif ; TMPMEMADDRESS > $1FFF 8680 2763f endif ; EXTRADLMEMORY 8681 2763f d0 .byte.b $1FFF 8674 27640 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27640 - else 8676 27640 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27640 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27640 - endif 8679 27640 - endif ; TMPMEMADDRESS > $1FFF 8680 27640 endif ; EXTRADLMEMORY 8681 27640 20 .byte.b $1FFF 8674 27641 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27641 - else 8676 27641 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27641 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27641 - endif 8679 27641 - endif ; TMPMEMADDRESS > $1FFF 8680 27641 endif ; EXTRADLMEMORY 8681 27641 70 .byte.b $1FFF 8674 27642 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27642 - else 8676 27642 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27642 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27642 - endif 8679 27642 - endif ; TMPMEMADDRESS > $1FFF 8680 27642 endif ; EXTRADLMEMORY 8681 27642 c0 .byte.b $1FFF 8674 27643 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27643 - else 8676 27643 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27643 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27643 - endif 8679 27643 - endif ; TMPMEMADDRESS > $1FFF 8680 27643 endif ; EXTRADLMEMORY 8681 27643 10 .byte.b $1FFF 8674 27644 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27644 - else 8676 27644 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27644 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27644 - endif 8679 27644 - endif ; TMPMEMADDRESS > $1FFF 8680 27644 endif ; EXTRADLMEMORY 8681 27644 60 .byte.b $1FFF 8674 27645 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27645 - else 8676 27645 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27645 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27645 - endif 8679 27645 - endif ; TMPMEMADDRESS > $1FFF 8680 27645 endif ; EXTRADLMEMORY 8681 27645 b0 .byte.b $1FFF 8674 27646 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27646 - else 8676 27646 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27646 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27646 - endif 8679 27646 - endif ; TMPMEMADDRESS > $1FFF 8680 27646 endif ; EXTRADLMEMORY 8681 27646 00 .byte.b $1FFF 8674 27647 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27647 - else 8676 27647 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27647 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27647 - endif 8679 27647 - endif ; TMPMEMADDRESS > $1FFF 8680 27647 endif ; EXTRADLMEMORY 8681 27647 50 .byte.b $1FFF 8674 27648 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27648 - else 8676 27648 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27648 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27648 - endif 8679 27648 - endif ; TMPMEMADDRESS > $1FFF 8680 27648 endif ; EXTRADLMEMORY 8681 27648 a0 .byte.b $1FFF 8674 27649 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27649 - else 8676 27649 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27649 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27649 - endif 8679 27649 - endif ; TMPMEMADDRESS > $1FFF 8680 27649 endif ; EXTRADLMEMORY 8681 27649 f0 .byte.b $1FFF 8674 2764a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 2764a - else 8676 2764a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 2764a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 2764a - endif 8679 2764a - endif ; TMPMEMADDRESS > $1FFF 8680 2764a endif ; EXTRADLMEMORY 8681 2764a 40 .byte.b $1FFF 8674 2764b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 2764b - else 8676 2764b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 2764b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 2764b - endif 8679 2764b - endif ; TMPMEMADDRESS > $1FFF 8680 2764b endif ; EXTRADLMEMORY 8681 2764b 90 .byte.b $1FFF 8674 2764c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 2764c - else 8676 2764c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 2764c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 2764c - endif 8679 2764c - endif ; TMPMEMADDRESS > $1FFF 8680 2764c endif ; EXTRADLMEMORY 8681 2764c e0 .byte.b $1FFF 8674 2764d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 2764d - else 8676 2764d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 2764d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 2764d - endif 8679 2764d - endif ; TMPMEMADDRESS > $1FFF 8680 2764d endif ; EXTRADLMEMORY 8681 2764d 30 .byte.b $1FFF 8674 2764e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 2764e - else 8676 2764e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 2764e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 2764e - endif 8679 2764e - endif ; TMPMEMADDRESS > $1FFF 8680 2764e endif ; EXTRADLMEMORY 8681 2764e 80 .byte.b $1FFF 8674 2764f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 2764f - else 8676 2764f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 2764f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 2764f - endif 8679 2764f - endif ; TMPMEMADDRESS > $1FFF 8680 2764f endif ; EXTRADLMEMORY 8681 2764f d0 .byte.b $1FFF 8674 27650 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27650 - else 8676 27650 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27650 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27650 - endif 8679 27650 - endif ; TMPMEMADDRESS > $1FFF 8680 27650 endif ; EXTRADLMEMORY 8681 27650 20 .byte.b $1FFF 8674 27651 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27651 - else 8676 27651 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27651 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27651 - endif 8679 27651 - endif ; TMPMEMADDRESS > $1FFF 8680 27651 endif ; EXTRADLMEMORY 8681 27651 70 .byte.b $1FFF 8674 27652 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27652 - else 8676 27652 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27652 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27652 - endif 8679 27652 - endif ; TMPMEMADDRESS > $1FFF 8680 27652 endif ; EXTRADLMEMORY 8681 27652 c0 .byte.b $1FFF 8674 27653 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27653 - else 8676 27653 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27653 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27653 - endif 8679 27653 - endif ; TMPMEMADDRESS > $1FFF 8680 27653 endif ; EXTRADLMEMORY 8681 27653 10 .byte.b $1FFF 8674 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27654 - else 8676 27654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27654 - endif 8679 27654 - endif ; TMPMEMADDRESS > $1FFF 8680 27654 endif ; EXTRADLMEMORY 8681 27654 60 .byte.b $1FFF 8674 27655 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8675 27655 - else 8676 27655 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8677 27655 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8678 27655 - endif 8679 27655 - endif ; TMPMEMADDRESS > $1FFF 8680 27655 endif ; EXTRADLMEMORY 8681 27655 b0 .byte.b $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 18 80 ZONE0ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 18 d0 ZONE1ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 19 20 ZONE2ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 19 70 ZONE3ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 19 c0 ZONE4ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1a 10 ZONE5ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1a 60 ZONE6ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1a b0 ZONE7ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1b 00 ZONE8ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1b 50 ZONE9ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1b a0 ZONE10ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1b f0 ZONE11ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1c 40 ZONE12ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1c 90 ZONE13ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1c e0 ZONE14ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1d 30 ZONE15ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1d 80 ZONE16ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1d d0 ZONE17ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1e 20 ZONE18ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1e 70 ZONE19ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1e c0 ZONE20ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1f 10 ZONE21ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1f 60 ZONE22ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8687 27656 REPEND 8688 27656 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8689 27656 - ifconst EXTRADLMEMORY 8690 27656 - if TMPMEMADDRESS > $1FFF 8691 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8692 27656 - else 8693 27656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8694 27656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8695 27656 - endif 8696 27656 - endif ; TMPMEMADDRESS > $1FFF 8697 27656 endif ; EXTRADLMEMORY 8698 27656 8699 27656 1f b0 ZONE23ADDRESS = TMPMEMADDRESS 8700 27656 8701 27656 DLINDEX SET DLINDEX + 1 8702 27656 REPEND 8703 27656 8704 27656 $1880 to $1fff used as zone memory, allowing 15 display objects per zone. 8705 27656 echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 8706 27656 8707 27656 DLHEIGHT 8708 27656 REPEAT WZONECOUNT 8709 27656 07 .byte.b (WZONEHEIGHT-1) 8708 27656 REPEND 8709 27657 07 .byte.b (WZONEHEIGHT-1) 8708 27657 REPEND 8709 27658 07 .byte.b (WZONEHEIGHT-1) 8708 27658 REPEND 8709 27659 07 .byte.b (WZONEHEIGHT-1) 8708 27659 REPEND 8709 2765a 07 .byte.b (WZONEHEIGHT-1) 8708 2765a REPEND 8709 2765b 07 .byte.b (WZONEHEIGHT-1) 8708 2765b REPEND 8709 2765c 07 .byte.b (WZONEHEIGHT-1) 8708 2765c REPEND 8709 2765d 07 .byte.b (WZONEHEIGHT-1) 8708 2765d REPEND 8709 2765e 07 .byte.b (WZONEHEIGHT-1) 8708 2765e REPEND 8709 2765f 07 .byte.b (WZONEHEIGHT-1) 8708 2765f REPEND 8709 27660 07 .byte.b (WZONEHEIGHT-1) 8708 27660 REPEND 8709 27661 07 .byte.b (WZONEHEIGHT-1) 8708 27661 REPEND 8709 27662 07 .byte.b (WZONEHEIGHT-1) 8708 27662 REPEND 8709 27663 07 .byte.b (WZONEHEIGHT-1) 8708 27663 REPEND 8709 27664 07 .byte.b (WZONEHEIGHT-1) 8708 27664 REPEND 8709 27665 07 .byte.b (WZONEHEIGHT-1) 8708 27665 REPEND 8709 27666 07 .byte.b (WZONEHEIGHT-1) 8708 27666 REPEND 8709 27667 07 .byte.b (WZONEHEIGHT-1) 8708 27667 REPEND 8709 27668 07 .byte.b (WZONEHEIGHT-1) 8708 27668 REPEND 8709 27669 07 .byte.b (WZONEHEIGHT-1) 8708 27669 REPEND 8709 2766a 07 .byte.b (WZONEHEIGHT-1) 8708 2766a REPEND 8709 2766b 07 .byte.b (WZONEHEIGHT-1) 8708 2766b REPEND 8709 2766c 07 .byte.b (WZONEHEIGHT-1) 8708 2766c REPEND 8709 2766d 07 .byte.b (WZONEHEIGHT-1) 8710 2766e REPEND 8711 2766e 8712 2766e ; Provided under the CC0 license. See the included LICENSE.txt for details. 8713 2766e 8714 2766e ; a simple guard, than ensures the 7800basic code hasn't 8715 2766e ; spilled into the encryption area... 2320 bytes left in the 7800basic reserved area. 8716 2766e echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 8717 2766e - if (*>$FF7D) 8718 2766e - ERR ; abort the assembly 8719 2766e endif 8720 2766e ; Provided under the CC0 license. See the included LICENSE.txt for details. 8721 2766e 8722 2766e - ifconst DEV 8723 2766e - ifnconst ZONEHEIGHT 8724 2766e - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8725 2766e - else 8726 2766e - if ZONEHEIGHT = 8 8727 2766e - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8728 2766e - else 8729 2766e - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8730 2766e - endif 8731 2766e - endif 8732 2766e endif 8733 2766e 8734 2766e ; FF7E/FF7F contains the 7800basic crc checksum word 8735 2766e 8736 2766e ; FF80 - FFF7 contains the 7800 encryption key 8737 2766e 8738 2766e - ifnconst bankswitchmode 8739 2766e - ORG $FFF8 8740 2766e else 8741 2766e ifconst ROM128K 8742 27ff8 ORG $27FF8 8743 27ff8 RORG $FFF8 8744 27ff8 endif 8745 27ff8 - ifconst ROM144K 8746 27ff8 - ORG $27FF8 8747 27ff8 - RORG $FFF8 8748 27ff8 endif 8749 27ff8 - ifconst ROM256K 8750 27ff8 - ORG $47FF8 8751 27ff8 - RORG $FFF8 8752 27ff8 endif 8753 27ff8 - ifconst ROM272K 8754 27ff8 - ORG $47FF8 8755 27ff8 - RORG $FFF8 8756 27ff8 endif 8757 27ff8 - ifconst ROM512K 8758 27ff8 - ORG $87FF8 8759 27ff8 - RORG $FFF8 8760 27ff8 endif 8761 27ff8 - ifconst ROM528K 8762 27ff8 - ORG $87FF8 8763 27ff8 - RORG $FFF8 8764 27ff8 endif 8765 27ff8 endif 8766 27ff8 8767 27ff8 8768 27ff8 ff .byte.b $FF ; region verification. $FF=all regions 8769 27ff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 8770 27ffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 8771 27ffa 8772 27ffa ;Vectors 8773 27ffa 00 f0 .word.w NMI 8774 27ffc 9e f5 .word.w START 8775 27ffe 5f f0 .word.w IRQ 8776 28000