------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite3.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 ???? ; SET_POINTER 46 28000 ???? ; Original author: Manuel Rotschkar 47 28000 ???? ; 48 28000 ???? ; Sets a 2 byte RAM pointer to an absolute address. 49 28000 ???? ; 50 28000 ???? ; Usage: SET_POINTER pointer, address 51 28000 ???? ; Example: SET_POINTER SpritePTR, SpriteData 52 28000 ???? ; 53 28000 ???? ; Note: Alters the accumulator, NZ flags 54 28000 ???? ; IN 1: 2 byte RAM location reserved for pointer 55 28000 ???? ; IN 2: absolute address 56 28000 ???? 57 28000 ???? MAC set_pointer 58 28000 ???? .POINTER SET {1} 59 28000 ???? .ADDRESS SET {2} 60 28000 ???? 61 28000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address 62 28000 ???? STA .POINTER ; Store in pointer 63 28000 ???? LDA #>.ADDRESS ; Get Hibyte of Address 64 28000 ???? STA .POINTER+1 ; Store in pointer+1 65 28000 ???? 66 28000 ???? ENDM 67 28000 ???? 68 28000 ???? ; EOF 69 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 70 28000 ???? 71 28000 ???? ; 7800MACRO.H 72 28000 ???? 73 28000 ???? ;------------------------------------------------------- 74 28000 ???? ; BOXCOLLISIONCHECK 75 28000 ???? ; author: Mike Saarna 76 28000 ???? ; 77 28000 ???? ; A general bounding box collision check. compares 2 rectangles of differing size 78 28000 ???? ; and shape for overlap. Carry is set for collision detected, clear for none. 79 28000 ???? ; 80 28000 ???? ; Usage: BOXCOLLISIONCHECK x1var,y1var,w1var,h1var,x2var,y2var,w2var,h2var 81 28000 ???? ; 82 28000 ???? 83 28000 ???? MAC boxcollisioncheck 84 28000 ???? .boxx1 SET {1} 85 28000 ???? .boxy1 SET {2} 86 28000 ???? .boxw1 SET {3} 87 28000 ???? .boxh1 SET {4} 88 28000 ???? .boxx2 SET {5} 89 28000 ???? .boxy2 SET {6} 90 28000 ???? .boxw2 SET {7} 91 28000 ???? .boxh2 SET {8} 92 28000 ???? 93 28000 ???? .DoXCollisionCheck 94 28000 ???? lda .boxx1 ;3 95 28000 ???? cmp .boxx2 ;2 96 28000 ???? bcs .X1isbiggerthanX2 ;2/3 97 28000 ???? .X2isbiggerthanX1 98 28000 ???? adc #.boxw1 ;2 99 28000 ???? cmp .boxx2 ;3 100 28000 ???? bcs .DoYCollisionCheck ;3/2 101 28000 ???? bcc .noboxcollision ;3 102 28000 ???? .X1isbiggerthanX2 103 28000 ???? clc ;2 104 28000 ???? sbc #.boxw2 ;2 105 28000 ???? cmp .boxx2 ;3 106 28000 ???? bcs .noboxcollision ;3/2 107 28000 ???? .DoYCollisionCheck 108 28000 ???? lda .boxy1 ;3 109 28000 ???? cmp .boxy2 ;3 110 28000 ???? bcs .Y1isbiggerthanY2 ;3/2 111 28000 ???? .Y2isbiggerthanY1 112 28000 ???? adc #.boxh1 ;2 113 28000 ???? cmp .boxy2 ;3 114 28000 ???? jmp .checkdone ;6 115 28000 ???? .Y1isbiggerthanY2 116 28000 ???? clc ;2 117 28000 ???? sbc #.boxh2 ;2 118 28000 ???? cmp .boxy2 ;3 119 28000 ???? bcs .noboxcollision ;3/2 120 28000 ???? .boxcollision 121 28000 ???? sec ;2 122 28000 ???? .byte $24 ; hardcoded "BIT [clc opcode]", used to skip over the following clc 123 28000 ???? .noboxcollision 124 28000 ???? clc ;2 125 28000 ???? .checkdone 126 28000 ???? 127 28000 ???? ENDM 128 28000 ???? 129 28000 ???? MAC median3 130 28000 ???? 131 28000 ???? ; A median filter (for smoothing paddle jitter) 132 28000 ???? ; this macro takes the current paddle value, compares it to historic 133 28000 ???? ; values, and replaces the current paddle value with the median. 134 28000 ???? ; 135 28000 ???? ; called as: MEDIAN3 STORAGE CURRENT 136 28000 ???? ; where STORAGE points to 3 consecutive bytes of memory. The first 2 137 28000 ???? ; must be dedicated to this MEDIAN filter. The last 1 is a temp. 138 28000 ???? ; where CURRENT is memory holding the new value you wish to compare to 139 28000 ???? ; the previous values, and update with the median value. 140 28000 ???? ; 141 28000 ???? ; returns: CURRENT (modified to contain median value) 142 28000 ???? ; 143 28000 ???? ; author: Mike Saarna (aka RevEng) 144 28000 ???? 145 28000 ???? .MedianBytes SET {1} 146 28000 ???? .NewValue SET {2} 147 28000 ???? 148 28000 ???? lda #0 149 28000 ???? ldy .NewValue 150 28000 ???? sty .MedianBytes+2 ; put the new value in the most "recent" slot 151 28000 ???? 152 28000 ???? ; build an index from relative size comparisons between our 3 values. 153 28000 ???? cpy .MedianBytes 154 28000 ???? rol 155 28000 ???? cpy .MedianBytes+1 156 28000 ???? rol 157 28000 ???? ldy .MedianBytes 158 28000 ???? cpy .MedianBytes+1 159 28000 ???? rol 160 28000 ???? tay 161 28000 ???? 162 28000 ???? ldx MedianOrderLUT,y ; convert the size-comparison index to an index to the median value 163 28000 ???? lda .MedianBytes,x 164 28000 ???? sta .NewValue ; we replace the new value memory with the median value 165 28000 ???? 166 28000 ???? ; then shift values from "newer" bytes to "older" bytes, leaving the 167 28000 ???? ; newest byte (.MedianBytes+2) empty for next time. 168 28000 ???? lda .MedianBytes+1 169 28000 ???? sta .MedianBytes 170 28000 ???? lda .MedianBytes+2 171 28000 ???? sta .MedianBytes+1 172 28000 ???? ifnconst MedianOrderLUT 173 28000 ???? jmp MedianOrderLUTend 174 28000 ???? MedianOrderLUT ; converts our "comparison index" to an index to the median value 175 28000 ???? .byte 0 ; 0 B2 < B0 < B1 176 28000 ???? .byte 1 ; 1 B2 < B1 < B0 177 28000 ???? .byte 2 ; 2 impossible 178 28000 ???? .byte 2 ; 3 B1 < B2 < B0 179 28000 ???? .byte 2 ; 4 B0 < B2 < B1 180 28000 ???? .byte 2 ; 5 impossible 181 28000 ???? .byte 1 ; 6 B0 < B1 < B2 182 28000 ???? .byte 0 ; 7 B1 < B0 < B2 183 28000 ???? MedianOrderLUTend 184 28000 ???? endif 185 28000 ???? ENDM 186 28000 ???? 187 28000 ???? MAC plotsprite 188 28000 ???? 189 28000 ???? ; A macro version of the plotsprite command. 190 28000 ???? ; This trades off rom space for speed. 191 28000 ???? ; It also doesn't check if the visible screen is displayed or not. 192 28000 ???? ; It has no training wheels. It is all rusty sharp edges. 193 28000 ???? 194 28000 ???? .GFXLabel SET {1} 195 28000 ???? .Palette SET {2} ; constant 196 28000 ???? .SpriteX SET {3} ; variable 197 28000 ???? .SpriteY SET {4} ; variable 198 28000 ???? .ByteOffset SET {5} ; variable 199 28000 ???? 200 28000 ???? lda .SpriteY 201 28000 ???? lsr 202 28000 ???? lsr 203 28000 ???? asr #%11111110 ; ensure carry is clear 204 28000 ???? if WZONEHEIGHT = 16 205 28000 ???? asr #%11111110 ; ensure carry is clear 206 28000 ???? endif 207 28000 ???? 208 28000 ???? tax 209 28000 ???? 210 28000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 211 28000 ???? sta dlpnt 212 28000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 213 28000 ???? sta dlpnt+1 214 28000 ???? 215 28000 ???? ldy dlend,x ; find the next new object position in this zone 216 28000 ???? 217 28000 ???? lda .ByteOffset 218 28000 ???? if {1}_width = 2 219 28000 ???? asl 220 28000 ???? endif 221 28000 ???? if {1}_width = 3 222 28000 ???? asl 223 28000 ???? adc .ByteOffset 224 28000 ???? endif 225 28000 ???? if {1}_width = 4 226 28000 ???? asl 227 28000 ???? asl 228 28000 ???? endif 229 28000 ???? if {1}_width = 5 230 28000 ???? asl 231 28000 ???? asl 232 28000 ???? adc .ByteOffset 233 28000 ???? endif 234 28000 ???? if {1}_width = 6 235 28000 ???? asl 236 28000 ???? adc .ByteOffset 237 28000 ???? asl 238 28000 ???? endif 239 28000 ???? if {1}_width = 7 240 28000 ???? asl 241 28000 ???? adc .ByteOffset 242 28000 ???? asl 243 28000 ???? adc .ByteOffset 244 28000 ???? endif 245 28000 ???? if {1}_width = 8 246 28000 ???? asl 247 28000 ???? asl 248 28000 ???? asl 249 28000 ???? endif 250 28000 ???? if {1}_width = 9 251 28000 ???? asl 252 28000 ???? asl 253 28000 ???? asl 254 28000 ???? adc .ByteOffset 255 28000 ???? endif 256 28000 ???? if {1}_width = 10 257 28000 ???? asl 258 28000 ???? asl 259 28000 ???? adc .ByteOffset 260 28000 ???? asl 261 28000 ???? endif 262 28000 ???? if {1}_width = 11 263 28000 ???? asl 264 28000 ???? asl 265 28000 ???? adc .ByteOffset 266 28000 ???? asl 267 28000 ???? adc .ByteOffset 268 28000 ???? endif 269 28000 ???? if {1}_width = 12 270 28000 ???? asl 271 28000 ???? adc .ByteOffset 272 28000 ???? asl 273 28000 ???? asl 274 28000 ???? endif 275 28000 ???? if {1}_width = 13 276 28000 ???? asl 277 28000 ???? adc .ByteOffset 278 28000 ???? asl 279 28000 ???? asl 280 28000 ???? adc .ByteOffset 281 28000 ???? endif 282 28000 ???? if {1}_width = 14 283 28000 ???? asl 284 28000 ???? adc .ByteOffset 285 28000 ???? asl 286 28000 ???? adc .ByteOffset 287 28000 ???? asl 288 28000 ???? endif 289 28000 ???? 290 28000 ???? adc #<.GFXLabel ; carry is clear via previous asl or asr 291 28000 ???? sta (dlpnt),y ; #1 - low byte object address 292 28000 ???? 293 28000 ???? iny 294 28000 ???? 295 28000 ???? lda #({1}_mode | %01000000) 296 28000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 297 28000 ???? 298 28000 ???? iny 299 28000 ???? 300 28000 ???? lda .SpriteY 301 28000 ???? and #(WZONEHEIGHT - 1) 302 28000 ???? cmp #1 ; clear carry if our sprite is just in this zone 303 28000 ???? ora #>.GFXLabel 304 28000 ???? sta (dlpnt),y ; #3 - hi byte object address 305 28000 ???? 306 28000 ???? iny 307 28000 ???? 308 28000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 309 28000 ???? sta (dlpnt),y ; #4 - palette|width 310 28000 ???? 311 28000 ???? iny 312 28000 ???? 313 28000 ???? lda .SpriteX 314 28000 ???? sta (dlpnt),y ; #5 - x object position 315 28000 ???? 316 28000 ???? iny 317 28000 ???? sty dlend,x 318 28000 ???? 319 28000 ???? ifconst ALWAYSTERMINATE 320 28000 ???? iny 321 28000 ???? lda #0 322 28000 ???? sta (dlpnt),y 323 28000 ???? endif 324 28000 ???? 325 28000 ???? bcc .PLOTSPRITEend 326 28000 ???? 327 28000 ???? inx ; next zone 328 28000 ???? 329 28000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 330 28000 ???? sta dlpnt 331 28000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 332 28000 ???? sta dlpnt+1 333 28000 ???? 334 28000 ???? ldy dlend,x ; find the next new object position in this zone 335 28000 ???? 336 28000 ???? lda .ByteOffset 337 28000 ???? if {1}_width = 1 338 28000 ???? clc 339 28000 ???? endif 340 28000 ???? if {1}_width = 2 341 28000 ???? asl ; carry clear 342 28000 ???? endif 343 28000 ???? if {1}_width = 3 344 28000 ???? asl ; carry clear 345 28000 ???? adc .ByteOffset 346 28000 ???? endif 347 28000 ???? if {1}_width = 4 348 28000 ???? asl ; carry clear 349 28000 ???? asl 350 28000 ???? endif 351 28000 ???? if {1}_width = 5 352 28000 ???? asl ; carry clear 353 28000 ???? asl 354 28000 ???? adc .ByteOffset 355 28000 ???? endif 356 28000 ???? if {1}_width = 6 357 28000 ???? asl ; carry clear 358 28000 ???? adc .ByteOffset 359 28000 ???? asl 360 28000 ???? endif 361 28000 ???? if {1}_width = 7 362 28000 ???? asl ; carry clear 363 28000 ???? adc .ByteOffset 364 28000 ???? asl 365 28000 ???? endif 366 28000 ???? if {1}_width = 8 367 28000 ???? asl ; carry clear 368 28000 ???? asl 369 28000 ???? asl 370 28000 ???? endif 371 28000 ???? if {1}_width = 9 372 28000 ???? asl ; carry clear 373 28000 ???? asl 374 28000 ???? asl 375 28000 ???? adc .ByteOffset 376 28000 ???? endif 377 28000 ???? if {1}_width = 10 378 28000 ???? asl ; carry clear 379 28000 ???? asl 380 28000 ???? adc .ByteOffset 381 28000 ???? asl 382 28000 ???? endif 383 28000 ???? if {1}_width = 11 384 28000 ???? asl ; carry clear 385 28000 ???? asl 386 28000 ???? adc .ByteOffset 387 28000 ???? asl 388 28000 ???? adc .ByteOffset 389 28000 ???? endif 390 28000 ???? if {1}_width = 12 391 28000 ???? asl ; carry clear 392 28000 ???? adc .ByteOffset 393 28000 ???? asl 394 28000 ???? asl 395 28000 ???? endif 396 28000 ???? if {1}_width = 13 397 28000 ???? asl ; carry clear 398 28000 ???? adc .ByteOffset 399 28000 ???? asl 400 28000 ???? asl 401 28000 ???? adc .ByteOffset 402 28000 ???? endif 403 28000 ???? if {1}_width = 14 404 28000 ???? asl ; carry clear 405 28000 ???? adc .ByteOffset 406 28000 ???? asl 407 28000 ???? adc .ByteOffset 408 28000 ???? asl 409 28000 ???? endif 410 28000 ???? 411 28000 ???? adc #<.GFXLabel 412 28000 ???? sta (dlpnt),y ; #1 - low byte object address 413 28000 ???? 414 28000 ???? iny 415 28000 ???? 416 28000 ???? lda #({1}_mode | %01000000) 417 28000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 418 28000 ???? 419 28000 ???? iny 420 28000 ???? 421 28000 ???? lda .SpriteY 422 28000 ???? and #(WZONEHEIGHT - 1) 423 28000 ???? ora #>(.GFXLabel - (WZONEHEIGHT * 256)) ; start in the dma hole 424 28000 ???? sta (dlpnt),y ; #3 - hi byte object address 425 28000 ???? 426 28000 ???? iny 427 28000 ???? 428 28000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 429 28000 ???? sta (dlpnt),y ; #4 - palette|width 430 28000 ???? 431 28000 ???? iny 432 28000 ???? 433 28000 ???? lda .SpriteX 434 28000 ???? sta (dlpnt),y ; #5 - x object position 435 28000 ???? 436 28000 ???? iny 437 28000 ???? sty dlend,x 438 28000 ???? 439 28000 ???? ifconst ALWAYSTERMINATE 440 28000 ???? iny 441 28000 ???? lda #0 442 28000 ???? sta (dlpnt),y 443 28000 ???? endif 444 28000 ???? 445 28000 ???? .PLOTSPRITEend 446 28000 ???? ENDM 447 28000 ???? 448 28000 ???? MAC sizeof 449 28000 ???? 450 28000 ???? ; echo's the size difference between the current address and the 451 28000 ???? ; a label that was passed as an argument. This is a quick way to 452 28000 ???? ; determine the size of a structure. 453 28000 ???? 454 28000 ???? .NAME SETSTR {1} 455 28000 ???? echo " The Size of",.NAME,"is:",[* - {1}]d,[* - {2}]d,"bytes." 456 28000 ???? ENDM 457 28000 ???? 458 28000 ???? ; 459 28000 ???? ; speakjet.inc 460 28000 ???? ; 461 28000 ???? ; 462 28000 ???? ; AtariVox Speech Synth Driver 463 28000 ???? ; 464 28000 ???? ; By Alex Herbert, 2004 465 28000 ???? ; 466 28000 ???? 467 28000 ???? 468 28000 ???? 469 28000 ???? 470 28000 ???? ; Constants 471 28000 ???? 472 28000 ???? 473 28000 ???? 00 01 SERIAL_OUTMASK equ $01 474 28000 ???? 00 02 SERIAL_RDYMASK equ $02 475 28000 ???? 476 28000 ???? 477 28000 ???? 478 28000 ???? ; Macros 479 28000 ???? 480 28000 ???? mac spkout 481 28000 ???? 482 28000 ???? ; check buffer-full status 483 28000 ???? lda SWCHA 484 28000 ???? and #SERIAL_RDYMASK 485 28000 ???? beq .speech_done 486 28000 ???? 487 28000 ???? ; get next speech byte 488 28000 ???? ldy #$00 489 28000 ???? lda (speech_addr),y 490 28000 ???? 491 28000 ???? ; invert data and check for end of string 492 28000 ???? eor #$ff 493 28000 ???? ;sta BACKGRND ; debug - uncomment to flash the background color with vox data 494 28000 ???? beq .speech_done 495 28000 ???? sta {1} 496 28000 ???? 497 28000 ???? ; increment speech pointer 498 28000 ???? inc speech_addr 499 28000 ???? bne .incaddr_skip 500 28000 ???? inc speech_addr+1 501 28000 ???? .incaddr_skip 502 28000 ???? 503 28000 ???? ; output byte as serial data 504 28000 ???? 505 28000 ???? sec ; start bit 506 28000 ???? .byteout_loop 507 28000 ???? ; put carry flag into bit 0 of SWACNT, perserving other bits 508 28000 ???? lda SWACNT ; 4 509 28000 ???? and #$fe ; 2 6 510 28000 ???? adc #$00 ; 2 8 511 28000 ???? sta SWACNT ; 4 12 512 28000 ???? 513 28000 ???? ; 10 bits sent? (1 start bit, 8 data bits, 1 stop bit) 514 28000 ???? cpy #$09 ; 2 14 515 28000 ???? beq .speech_done ; 2 16 516 28000 ???? iny ; 2 18 517 28000 ???? 518 28000 ???? ; the 7800 is 1.5x faster than the 2600. Waste more cycles here 519 28000 ???? ; to match the original baud rate... 520 28000 ???? ;ldx #$07 ; 2600 521 28000 ???? ldx #$0D 522 28000 ???? 523 28000 ???? .delay_loop 524 28000 ???? dex ; 525 28000 ???? bne .delay_loop ; 36 54 526 28000 ???? 527 28000 ???? ; shift next data bit into carry 528 28000 ???? lsr {1} ; 5 59 529 28000 ???? 530 28000 ???? ; and loop (branch always taken) 531 28000 ???? bpl .byteout_loop ; 3 62 cycles for loop 532 28000 ???? 533 28000 ???? .speech_done 534 28000 ???? 535 28000 ???? endm 536 28000 ???? 537 28000 ???? 538 28000 ???? mac speak 539 28000 ???? 540 28000 ???? lda #<{1} 541 28000 ???? sta speech_addr 542 28000 ???? lda #>{1} 543 28000 ???? sta speech_addr+1 544 28000 ???? 545 28000 ???? endm 546 28000 ???? 547 28000 ???? 548 28000 ???? 549 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 550 28000 ???? 551 28000 ???? processor 6502 552 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 08 INPT0 = $08 ;Paddle Control Input 0 read-only 51 28000 ???? 00 09 INPT1 = $09 ;Paddle Control Input 1 read-only 52 28000 ???? 00 0a INPT2 = $0A ;Paddle Control Input 2 read-only 53 28000 ???? 00 0b INPT3 = $0B ;Paddle Control Input 3 read-only 54 28000 ???? 55 28000 ???? ; ** some common alternate names for INPT0/1/2/3 56 28000 ???? 00 08 INPT4B = $08 ;Joystick 0 Fire 1 read-only 57 28000 ???? 00 09 INPT4A = $09 ;Joystick 0 Fire 1 read-only 58 28000 ???? 00 0a INPT5B = $0A ;Joystick 1 Fire 0 read-only 59 28000 ???? 00 0b INPT5A = $0B ;Joystick 1 Fire 1 read-only 60 28000 ???? 00 08 INPT4R = $08 ;Joystick 0 Fire 1 read-only 61 28000 ???? 00 09 INPT4L = $09 ;Joystick 0 Fire 1 read-only 62 28000 ???? 00 0a INPT5R = $0A ;Joystick 1 Fire 0 read-only 63 28000 ???? 00 0b INPT5L = $0B ;Joystick 1 Fire 1 read-only 64 28000 ???? 65 28000 ???? 00 0c INPT4 = $0C ;Player 0 Fire Button Input read-only 66 28000 ???? 00 0d INPT5 = $0D ;Player 1 Fire Button Input read-only 67 28000 ???? 68 28000 ???? 00 15 AUDC0 = $15 ;Audio Control Channel 0 write-only 69 28000 ???? 00 16 AUDC1 = $16 ;Audio Control Channel 1 write-only 70 28000 ???? 00 17 AUDF0 = $17 ;Audio Frequency Channel 0 write-only 71 28000 ???? 00 18 AUDF1 = $18 ;Audio Frequency Channel 1 write-only 72 28000 ???? 00 19 AUDV0 = $19 ;Audio Volume Channel 0 write-only 73 28000 ???? 00 1a AUDV1 = $1A ;Audio Volume Channel 1 write-only 74 28000 ???? 75 28000 ???? ;****** 20-3F ********* MARIA REGISTERS *************** 76 28000 ???? 77 28000 ???? 00 20 BACKGRND = $20 ;Background Color write-only 78 28000 ???? 00 21 P0C1 = $21 ;Palette 0 - Color 1 write-only 79 28000 ???? 00 22 P0C2 = $22 ;Palette 0 - Color 2 write-only 80 28000 ???? 00 23 P0C3 = $23 ;Palette 0 - Color 3 write-only 81 28000 ???? 00 24 WSYNC = $24 ;Wait For Sync write-only 82 28000 ???? 00 25 P1C1 = $25 ;Palette 1 - Color 1 write-only 83 28000 ???? 00 26 P1C2 = $26 ;Palette 1 - Color 2 write-only 84 28000 ???? 00 27 P1C3 = $27 ;Palette 1 - Color 3 write-only 85 28000 ???? 00 28 MSTAT = $28 ;Maria Status read-only 86 28000 ???? 00 29 P2C1 = $29 ;Palette 2 - Color 1 write-only 87 28000 ???? 00 2a P2C2 = $2A ;Palette 2 - Color 2 write-only 88 28000 ???? 00 2b P2C3 = $2B ;Palette 2 - Color 3 write-only 89 28000 ???? 00 2c DPPH = $2C ;Display List List Pointer High write-only 90 28000 ???? 00 2d P3C1 = $2D ;Palette 3 - Color 1 write-only 91 28000 ???? 00 2e P3C2 = $2E ;Palette 3 - Color 2 write-only 92 28000 ???? 00 2f P3C3 = $2F ;Palette 3 - Color 3 write-only 93 28000 ???? 00 30 DPPL = $30 ;Display List List Pointer Low write-only 94 28000 ???? 00 31 P4C1 = $31 ;Palette 4 - Color 1 write-only 95 28000 ???? 00 32 P4C2 = $32 ;Palette 4 - Color 2 write-only 96 28000 ???? 00 33 P4C3 = $33 ;Palette 4 - Color 3 write-only 97 28000 ???? 00 34 CHARBASE = $34 ;Character Base Address write-only 98 28000 ???? 00 34 CHBASE = $34 ;Character Base Address write-only 99 28000 ???? 00 35 P5C1 = $35 ;Palette 5 - Color 1 write-only 100 28000 ???? 00 36 P5C2 = $36 ;Palette 5 - Color 2 write-only 101 28000 ???? 00 37 P5C3 = $37 ;Palette 5 - Color 3 write-only 102 28000 ???? 00 38 OFFSET = $38 ;Unused - Store zero here write-only 103 28000 ???? 00 39 P6C1 = $39 ;Palette 6 - Color 1 write-only 104 28000 ???? 00 3a P6C2 = $3A ;Palette 6 - Color 2 write-only 105 28000 ???? 00 3b P6C3 = $3B ;Palette 6 - Color 3 write-only 106 28000 ???? 00 3c CTRL = $3C ;Maria Control Register write-only 107 28000 ???? 00 3d P7C1 = $3D ;Palette 7 - Color 1 write-only 108 28000 ???? 00 3e P7C2 = $3E ;Palette 7 - Color 2 write-only 109 28000 ???? 00 3f P7C3 = $3F ;Palette 7 - Color 3 write-only 110 28000 ???? 111 28000 ???? 112 28000 ???? ;****** 280-2FF ******* PIA PORTS AND TIMERS ************ 113 28000 ???? 114 28000 ???? 02 80 SWCHA = $280 ;P0+P1 Joystick Directional Input read-write 115 28000 ???? 02 81 CTLSWA = $281 ;I/O Control for SCHWA read-write 116 28000 ???? 02 81 SWACNT = $281 ;VCS name for above read-write 117 28000 ???? 02 82 SWCHB = $282 ;Console Switches read-write 118 28000 ???? 02 83 CTLSWB = $283 ;I/O Control for SCHWB read-write 119 28000 ???? 02 83 SWBCNT = $283 ;VCS name for above read-write 120 28000 ???? 121 28000 ???? 02 84 INTIM = $284 ;Interval Timer Read read-only 122 28000 ???? 02 94 TIM1T = $294 ;Set 1 CLK Interval (838 nsec/interval) write-only 123 28000 ???? 02 95 TIMINT = $295 ;Interval Timer Interrupt read-only 124 28000 ???? 02 95 TIM8T = $295 ;Set 8 CLK Interval (6.7 usec/interval) write-only 125 28000 ???? 02 96 TIM64T = $296 ;Set 64 CLK Interval (63.6 usec/interval) write-only 126 28000 ???? 02 97 T1024T = $297 ;Set 1024 CLK Interval (858.2 usec/interval) write-only 127 28000 ???? 02 9e TIM64TI = $29E ;Interrupt timer 64T write-only 128 28000 ???? 129 28000 ???? ;XM 130 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 131 28000 ???? 04 70 XCTRL1 = $470 132 28000 ???? 04 78 XCTRL2 = $478 133 28000 ???? 04 7c XCTRL3 = $47c 134 28000 ???? 04 71 XCTRL4 = $471 135 28000 ???? 04 72 XCTRL5 = $472 136 28000 ???? 137 28000 ???? ; Pokey register relative locations, since its base may be different 138 28000 ???? ; depending on the hardware. 139 28000 ???? 00 00 PAUDF0 = $0 ; extra audio channels and frequencies 140 28000 ???? 00 01 PAUDC0 = $1 141 28000 ???? 00 02 PAUDF1 = $2 142 28000 ???? 00 03 PAUDC1 = $3 143 28000 ???? 00 04 PAUDF2 = $4 144 28000 ???? 00 05 PAUDC2 = $5 145 28000 ???? 00 06 PAUDF3 = $6 146 28000 ???? 00 07 PAUDC3 = $7 147 28000 ???? 00 08 PAUDCTL = $8 ; Audio Control 148 28000 ???? 00 09 PSTIMER = $9 149 28000 ???? 00 0a PRANDOM = $A ; 17 bit polycounter pseudo random 150 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_explosion_10_tallsprite_00_mode = $00 13 28000 ???? 00 0c vertical_shooting_explosion_10_tallsprite_00_width_twoscompliment = $0c 14 28000 ???? 00 14 vertical_shooting_explosion_10_tallsprite_00_width = $14 15 28000 ???? 00 00 vertical_shooting_explosion_10_mode = $00 16 28000 ???? 00 0c vertical_shooting_explosion_10_width_twoscompliment = $0c 17 28000 ???? 00 14 vertical_shooting_explosion_10_width = $14 18 28000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_mode = $00 19 28000 ???? 00 0c vertical_shooting_explosion_09_tallsprite_00_width_twoscompliment = $0c 20 28000 ???? 00 14 vertical_shooting_explosion_09_tallsprite_00_width = $14 21 28000 ???? 00 00 vertical_shooting_explosion_09_mode = $00 22 28000 ???? 00 0c vertical_shooting_explosion_09_width_twoscompliment = $0c 23 28000 ???? 00 14 vertical_shooting_explosion_09_width = $14 24 28000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_mode = $00 25 28000 ???? 00 0c vertical_shooting_explosion_08_tallsprite_00_width_twoscompliment = $0c 26 28000 ???? 00 14 vertical_shooting_explosion_08_tallsprite_00_width = $14 27 28000 ???? 00 00 vertical_shooting_explosion_08_mode = $00 28 28000 ???? 00 0c vertical_shooting_explosion_08_width_twoscompliment = $0c 29 28000 ???? 00 14 vertical_shooting_explosion_08_width = $14 30 28000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_mode = $00 31 28000 ???? 00 0c vertical_shooting_explosion_07_tallsprite_00_width_twoscompliment = $0c 32 28000 ???? 00 14 vertical_shooting_explosion_07_tallsprite_00_width = $14 33 28000 ???? 00 00 vertical_shooting_explosion_07_mode = $00 34 28000 ???? 00 0c vertical_shooting_explosion_07_width_twoscompliment = $0c 35 28000 ???? 00 14 vertical_shooting_explosion_07_width = $14 36 28000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_mode = $00 37 28000 ???? 00 1e vertical_shooting_explosion_06_tallsprite_00_width_twoscompliment = $1e 38 28000 ???? 00 02 vertical_shooting_explosion_06_tallsprite_00_width = $02 39 28000 ???? 00 00 vertical_shooting_explosion_06_mode = $00 40 28000 ???? 00 1e vertical_shooting_explosion_06_width_twoscompliment = $1e 41 28000 ???? 00 02 vertical_shooting_explosion_06_width = $02 42 28000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_mode = $00 43 28000 ???? 00 1e vertical_shooting_explosion_05_tallsprite_00_width_twoscompliment = $1e 44 28000 ???? 00 02 vertical_shooting_explosion_05_tallsprite_00_width = $02 45 28000 ???? 00 00 vertical_shooting_explosion_05_mode = $00 46 28000 ???? 00 1e vertical_shooting_explosion_05_width_twoscompliment = $1e 47 28000 ???? 00 02 vertical_shooting_explosion_05_width = $02 48 28000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_mode = $00 49 28000 ???? 00 1e vertical_shooting_explosion_04_tallsprite_00_width_twoscompliment = $1e 50 28000 ???? 00 02 vertical_shooting_explosion_04_tallsprite_00_width = $02 51 28000 ???? 00 00 vertical_shooting_explosion_04_mode = $00 52 28000 ???? 00 1e vertical_shooting_explosion_04_width_twoscompliment = $1e 53 28000 ???? 00 02 vertical_shooting_explosion_04_width = $02 54 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_mode = $00 55 28000 ???? 00 1e vertical_shooting_explosion_03_tallsprite_00_width_twoscompliment = $1e 56 28000 ???? 00 02 vertical_shooting_explosion_03_tallsprite_00_width = $02 57 28000 ???? 00 00 vertical_shooting_explosion_03_mode = $00 58 28000 ???? 00 1e vertical_shooting_explosion_03_width_twoscompliment = $1e 59 28000 ???? 00 02 vertical_shooting_explosion_03_width = $02 60 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_mode = $00 61 28000 ???? 00 1e vertical_shooting_explosion_02_tallsprite_00_width_twoscompliment = $1e 62 28000 ???? 00 02 vertical_shooting_explosion_02_tallsprite_00_width = $02 63 28000 ???? 00 00 vertical_shooting_explosion_02_mode = $00 64 28000 ???? 00 1e vertical_shooting_explosion_02_width_twoscompliment = $1e 65 28000 ???? 00 02 vertical_shooting_explosion_02_width = $02 66 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_mode = $00 67 28000 ???? 00 1e vertical_shooting_explosion_01_tallsprite_00_width_twoscompliment = $1e 68 28000 ???? 00 02 vertical_shooting_explosion_01_tallsprite_00_width = $02 69 28000 ???? 00 00 vertical_shooting_explosion_01_mode = $00 70 28000 ???? 00 1e vertical_shooting_explosion_01_width_twoscompliment = $1e 71 28000 ???? 00 02 vertical_shooting_explosion_01_width = $02 72 28000 ???? 00 00 vertical_shooting_1up_mode = $00 73 28000 ???? 00 1e vertical_shooting_1up_width_twoscompliment = $1e 74 28000 ???? 00 02 vertical_shooting_1up_width = $02 75 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_mode = $00 76 28000 ???? 00 1e vertical_shooting_enemy01_tallsprite_00_width_twoscompliment = $1e 77 28000 ???? 00 02 vertical_shooting_enemy01_tallsprite_00_width = $02 78 28000 ???? 00 00 vertical_shooting_enemy01_mode = $00 79 28000 ???? 00 1e vertical_shooting_enemy01_width_twoscompliment = $1e 80 28000 ???? 00 02 vertical_shooting_enemy01_width = $02 81 28000 ???? 00 00 vertical_shooting_powerup_mode = $00 82 28000 ???? 00 1e vertical_shooting_powerup_width_twoscompliment = $1e 83 28000 ???? 00 02 vertical_shooting_powerup_width = $02 84 28000 ???? 00 00 vertical_shooting_enemyshot_mode = $00 85 28000 ???? 00 1f vertical_shooting_enemyshot_width_twoscompliment = $1f 86 28000 ???? 00 01 vertical_shooting_enemyshot_width = $01 87 28000 ???? 00 00 vertical_shooting_bullet_mode = $00 88 28000 ???? 00 1f vertical_shooting_bullet_width_twoscompliment = $1f 89 28000 ???? 00 01 vertical_shooting_bullet_width = $01 90 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_mode = $00 91 28000 ???? 00 1e vertical_shooting_ship_tallsprite_00_width_twoscompliment = $1e 92 28000 ???? 00 02 vertical_shooting_ship_tallsprite_00_width = $02 93 28000 ???? 00 00 vertical_shooting_ship_mode = $00 94 28000 ???? 00 1e vertical_shooting_ship_width_twoscompliment = $1e 95 28000 ???? 00 02 vertical_shooting_ship_width = $02 96 28000 ???? 00 00 vertical_shooting_font_mode = $00 97 28000 ???? 00 13 vertical_shooting_font_width_twoscompliment = $13 98 28000 ???? 00 2d vertical_shooting_font_width = $2d 99 28000 ???? 00 90 sfx_explosion_length = .skipL0364-sfx_explosion 100 28000 ???? 101 28000 ???? 00 30 sfx_plainlaser_length = .skipL0363-sfx_plainlaser 102 28000 ???? 103 28000 ???? 00 54 sfx_pulsecannon_length = .skipL0362-sfx_pulsecannon 104 28000 ???? 105 28000 ???? 00 36 sfx_bling_length = .skipL0361-sfx_bling 106 28000 ???? 107 28000 ???? 00 01 BOXCOLLISION = 1 108 28000 ???? 00 00 FALSE = 0 109 28000 ???? 110 28000 ???? 00 01 TRUE = 1 111 28000 ???? 112 28000 ???? 00 0f firing_rate = 15 113 28000 ???? 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_explosion_10_tallsprite_00_color3 = $33 123 28000 ???? 00 2b vertical_shooting_explosion_10_tallsprite_00_color2 = $2b 124 28000 ???? 00 36 vertical_shooting_explosion_10_tallsprite_00_color1 = $36 125 28000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_color0 = $00 126 28000 ???? 00 33 vertical_shooting_explosion_10_color3 = $33 127 28000 ???? 00 2b vertical_shooting_explosion_10_color2 = $2b 128 28000 ???? 00 36 vertical_shooting_explosion_10_color1 = $36 129 28000 ???? 00 00 vertical_shooting_explosion_10_color0 = $00 130 28000 ???? 00 33 vertical_shooting_explosion_09_tallsprite_00_color3 = $33 131 28000 ???? 00 2b vertical_shooting_explosion_09_tallsprite_00_color2 = $2b 132 28000 ???? 00 36 vertical_shooting_explosion_09_tallsprite_00_color1 = $36 133 28000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_color0 = $00 134 28000 ???? 00 33 vertical_shooting_explosion_09_color3 = $33 135 28000 ???? 00 2b vertical_shooting_explosion_09_color2 = $2b 136 28000 ???? 00 36 vertical_shooting_explosion_09_color1 = $36 137 28000 ???? 00 00 vertical_shooting_explosion_09_color0 = $00 138 28000 ???? 00 33 vertical_shooting_explosion_08_tallsprite_00_color3 = $33 139 28000 ???? 00 2b vertical_shooting_explosion_08_tallsprite_00_color2 = $2b 140 28000 ???? 00 36 vertical_shooting_explosion_08_tallsprite_00_color1 = $36 141 28000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_color0 = $00 142 28000 ???? 00 33 vertical_shooting_explosion_08_color3 = $33 143 28000 ???? 00 2b vertical_shooting_explosion_08_color2 = $2b 144 28000 ???? 00 36 vertical_shooting_explosion_08_color1 = $36 145 28000 ???? 00 00 vertical_shooting_explosion_08_color0 = $00 146 28000 ???? 00 33 vertical_shooting_explosion_07_tallsprite_00_color3 = $33 147 28000 ???? 00 2b vertical_shooting_explosion_07_tallsprite_00_color2 = $2b 148 28000 ???? 00 36 vertical_shooting_explosion_07_tallsprite_00_color1 = $36 149 28000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_color0 = $00 150 28000 ???? 00 33 vertical_shooting_explosion_07_color3 = $33 151 28000 ???? 00 2b vertical_shooting_explosion_07_color2 = $2b 152 28000 ???? 00 36 vertical_shooting_explosion_07_color1 = $36 153 28000 ???? 00 00 vertical_shooting_explosion_07_color0 = $00 154 28000 ???? 00 33 vertical_shooting_explosion_06_tallsprite_00_color3 = $33 155 28000 ???? 00 2b vertical_shooting_explosion_06_tallsprite_00_color2 = $2b 156 28000 ???? 00 36 vertical_shooting_explosion_06_tallsprite_00_color1 = $36 157 28000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_color0 = $00 158 28000 ???? 00 33 vertical_shooting_explosion_06_color3 = $33 159 28000 ???? 00 2b vertical_shooting_explosion_06_color2 = $2b 160 28000 ???? 00 36 vertical_shooting_explosion_06_color1 = $36 161 28000 ???? 00 00 vertical_shooting_explosion_06_color0 = $00 162 28000 ???? 00 33 vertical_shooting_explosion_05_tallsprite_00_color3 = $33 163 28000 ???? 00 2b vertical_shooting_explosion_05_tallsprite_00_color2 = $2b 164 28000 ???? 00 36 vertical_shooting_explosion_05_tallsprite_00_color1 = $36 165 28000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_color0 = $00 166 28000 ???? 00 33 vertical_shooting_explosion_05_color3 = $33 167 28000 ???? 00 2b vertical_shooting_explosion_05_color2 = $2b 168 28000 ???? 00 36 vertical_shooting_explosion_05_color1 = $36 169 28000 ???? 00 00 vertical_shooting_explosion_05_color0 = $00 170 28000 ???? 00 33 vertical_shooting_explosion_04_tallsprite_00_color3 = $33 171 28000 ???? 00 36 vertical_shooting_explosion_04_tallsprite_00_color2 = $36 172 28000 ???? 00 2b vertical_shooting_explosion_04_tallsprite_00_color1 = $2b 173 28000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_color0 = $00 174 28000 ???? 00 33 vertical_shooting_explosion_04_color3 = $33 175 28000 ???? 00 36 vertical_shooting_explosion_04_color2 = $36 176 28000 ???? 00 2b vertical_shooting_explosion_04_color1 = $2b 177 28000 ???? 00 00 vertical_shooting_explosion_04_color0 = $00 178 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color3 = 0 179 28000 ???? 00 36 vertical_shooting_explosion_03_tallsprite_00_color2 = $36 180 28000 ???? 00 2b vertical_shooting_explosion_03_tallsprite_00_color1 = $2b 181 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color0 = $00 182 28000 ???? 00 00 vertical_shooting_explosion_03_color3 = 0 183 28000 ???? 00 36 vertical_shooting_explosion_03_color2 = $36 184 28000 ???? 00 2b vertical_shooting_explosion_03_color1 = $2b 185 28000 ???? 00 00 vertical_shooting_explosion_03_color0 = $00 186 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color3 = 0 187 28000 ???? 00 36 vertical_shooting_explosion_02_tallsprite_00_color2 = $36 188 28000 ???? 00 2b vertical_shooting_explosion_02_tallsprite_00_color1 = $2b 189 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color0 = $00 190 28000 ???? 00 00 vertical_shooting_explosion_02_color3 = 0 191 28000 ???? 00 36 vertical_shooting_explosion_02_color2 = $36 192 28000 ???? 00 2b vertical_shooting_explosion_02_color1 = $2b 193 28000 ???? 00 00 vertical_shooting_explosion_02_color0 = $00 194 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color3 = 0 195 28000 ???? 00 2b vertical_shooting_explosion_01_tallsprite_00_color2 = $2b 196 28000 ???? 00 36 vertical_shooting_explosion_01_tallsprite_00_color1 = $36 197 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color0 = $00 198 28000 ???? 00 00 vertical_shooting_explosion_01_color3 = 0 199 28000 ???? 00 2b vertical_shooting_explosion_01_color2 = $2b 200 28000 ???? 00 36 vertical_shooting_explosion_01_color1 = $36 201 28000 ???? 00 00 vertical_shooting_explosion_01_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 ???? 00 e9 customTemp4 = d 237 28000 ???? 238 28000 ???? 00 e8 customTemp3 = c 239 28000 ???? 240 28000 ???? 00 e7 customTemp2 = b 241 28000 ???? 242 28000 ???? 00 e6 customTemp1 = a 243 28000 ???? 244 28000 ???? 01 77 enemy01_Slowdown = var55 245 28000 ???? 246 28000 ???? 01 9c mob_X = var92 247 28000 ???? 01 9e mob_Y = var94 248 28000 ???? 01 a0 mob_speedX = var96 249 28000 ???? 01 a2 mob_speedY = var98 250 28000 ???? 01 73 temp_speedY = temp_YSu 251 28000 ???? 01 74 temp_YSf = var52 252 28000 ???? 253 28000 ???? 01 73 temp_YSu = var51 254 28000 ???? 255 28000 ???? 01 71 temp_speedX = temp_XSu 256 28000 ???? 01 72 temp_XSf = var50 257 28000 ???? 258 28000 ???? 01 71 temp_XSu = var49 259 28000 ???? 260 28000 ???? 01 6f total_speedY = total_YSu 261 28000 ???? 01 70 total_YSf = var48 262 28000 ???? 263 28000 ???? 01 6f total_YSu = var47 264 28000 ???? 265 28000 ???? 01 6d total_speedX = total_XSu 266 28000 ???? 01 6e total_XSf = var46 267 28000 ???? 268 28000 ???? 01 6d total_XSu = var45 269 28000 ???? 270 28000 ???? 22 50 enemy_shotSYf = $2250 271 28000 ???? 272 28000 ???? 22 40 enemy_shotSXf = $2240 273 28000 ???? 274 28000 ???? 22 30 enemy_shotSY = $2230 275 28000 ???? 276 28000 ???? 22 20 enemy_shotSX = $2220 277 28000 ???? 278 28000 ???? 22 10 enemy_shotYf = $2210 279 28000 ???? 280 28000 ???? 22 00 enemy_shotXf = $2200 281 28000 ???? 282 28000 ???? 01 6c enemy_shotDirection = var44 283 28000 ???? 284 28000 ???? 01 6b timer = var43 285 28000 ???? 286 28000 ???? 01 6a isDead_flag = var42 287 28000 ???? 288 28000 ???? 01 69 continue_flag = var41 289 28000 ???? 290 28000 ???? 01 68 twinlaser_Slowdown = var40 291 28000 ???? 292 28000 ???? 01 67 twinlaser_flag = var39 293 28000 ???? 294 28000 ???? 01 66 twinlaserY = var38 295 28000 ???? 296 28000 ???? 01 65 twinlaserX = var37 297 28000 ???? 298 28000 ???? 01 64 lives = var36 299 28000 ???? 300 28000 ???? 01 63 explosion_aniframe = var35 301 28000 ???? 302 28000 ???? 01 62 extra_shipFlag = var34 303 28000 ???? 304 28000 ???? 01 61 extra_shipY = var33 305 28000 ???? 306 28000 ???? 01 60 extra_shipX = var32 307 28000 ???? 308 28000 ???? 01 5f gameover_flag = var31 309 28000 ???? 310 28000 ???? 01 5e enemy01_speed = var30 311 28000 ???? 312 28000 ???? 01 5d rMovement6 = var29 313 28000 ???? 314 28000 ???? 01 5c rMovement5 = var28 315 28000 ???? 316 28000 ???? 01 5b rMovement4 = var27 317 28000 ???? 318 28000 ???? 01 5a rMovement3 = var26 319 28000 ???? 320 28000 ???? 01 59 enemy01_Flag = var25 321 28000 ???? 322 28000 ???? 01 58 enemy01_Y = var24 323 28000 ???? 324 28000 ???? 01 57 enemy01_X = var23 325 28000 ???? 326 28000 ???? 01 56 enemy_shotSlowdown = var22 327 28000 ???? 328 28000 ???? 01 55 bulletSlowdown = var21 329 28000 ???? 330 28000 ???? 01 54 power_upSlowdown = var20 331 28000 ???? 332 28000 ???? 01 53 rMovement2 = var19 333 28000 ???? 334 28000 ???? 01 52 power_upFlag = var18 335 28000 ???? 336 28000 ???? 01 51 power_upY = var17 337 28000 ???? 338 28000 ???? 01 50 power_upX = var16 339 28000 ???? 340 28000 ???? 01 4f rDirection = var15 341 28000 ???? 342 28000 ???? 01 4e rMovement1 = var14 343 28000 ???? 344 28000 ???? 01 4d playerFlag = var13 345 28000 ???? 346 28000 ???? 01 4c enemy_shotFlag = var12 347 28000 ???? 348 28000 ???? 01 4b enemy_shotY = var11 349 28000 ???? 350 28000 ???? 01 4a enemy_shotX = var10 351 28000 ???? 352 28000 ???? 01 49 bulletY = var9 353 28000 ???? 354 28000 ???? 01 48 bulletX = var8 355 28000 ???? 356 28000 ???? 01 47 joyposright = var7 357 28000 ???? 358 28000 ???? 01 46 joyposleft = var6 359 28000 ???? 360 28000 ???? 01 45 joyposdown = var5 361 28000 ???? 362 28000 ???? 01 44 joyposup = var4 363 28000 ???? 364 28000 ???? 01 43 fire_debounce = var3 365 28000 ???? 366 28000 ???? 01 42 playerY = var2 367 28000 ???? 368 28000 ???? 01 41 playerX = var1 369 28000 ???? 370 28000 ???? 01 40 frameCounter = var0 371 28000 ???? 372 28000 ???? 00 01 collisionwrap = 1 373 28000 ???? 00 01 NTSC = 1 374 28000 ???? 00 c0 SCREENHEIGHT = 192 375 28000 ???? 00 01 CHECKOVERWRITE = 1 376 28000 ???? 00 08 ZONEHEIGHT = 8 377 28000 ???? 00 01 SGRAM = 1 378 28000 ???? 00 08 bankswitchmode = 8 379 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 ifnconst CANARYOFF 538 U01c1 00 canary DS 1 ; $1ED 539 U01c2 endif 540 U01c2 541 U01c2 - ifnconst bankswitchmode 542 U01c2 - echo " stack allowance:",[($1FF - .)/2]d,"nested subroutines." 543 U01c2 else stack allowance: 20 nested subroutines. 544 U01c2 echo " stack allowance:",[($1FF - .)/3]d,"nested subroutines." 545 U01c2 endif 546 U01c2 ifnconst CANARYOFF the canary is situated at: $1c1 547 U01c2 echo " the canary is situated at:",[canary] 548 U01c2 - else 549 U01c2 - echo " the canary is disabled." 550 U01c2 endif 551 U01c2 552 U01c2 ; $1EE - $1FF reserved for stack 553 U01c2 554 28000 ???? SEG "GAME" 555 28000 ???? ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite3.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_explosion_10_tallsprite_00_mode = $00 13 28000 ???? 00 0c vertical_shooting_explosion_10_tallsprite_00_width_twoscompliment = $0c 14 28000 ???? 00 14 vertical_shooting_explosion_10_tallsprite_00_width = $14 15 28000 ???? 00 00 vertical_shooting_explosion_10_mode = $00 16 28000 ???? 00 0c vertical_shooting_explosion_10_width_twoscompliment = $0c 17 28000 ???? 00 14 vertical_shooting_explosion_10_width = $14 18 28000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_mode = $00 19 28000 ???? 00 0c vertical_shooting_explosion_09_tallsprite_00_width_twoscompliment = $0c 20 28000 ???? 00 14 vertical_shooting_explosion_09_tallsprite_00_width = $14 21 28000 ???? 00 00 vertical_shooting_explosion_09_mode = $00 22 28000 ???? 00 0c vertical_shooting_explosion_09_width_twoscompliment = $0c 23 28000 ???? 00 14 vertical_shooting_explosion_09_width = $14 24 28000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_mode = $00 25 28000 ???? 00 0c vertical_shooting_explosion_08_tallsprite_00_width_twoscompliment = $0c 26 28000 ???? 00 14 vertical_shooting_explosion_08_tallsprite_00_width = $14 27 28000 ???? 00 00 vertical_shooting_explosion_08_mode = $00 28 28000 ???? 00 0c vertical_shooting_explosion_08_width_twoscompliment = $0c 29 28000 ???? 00 14 vertical_shooting_explosion_08_width = $14 30 28000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_mode = $00 31 28000 ???? 00 0c vertical_shooting_explosion_07_tallsprite_00_width_twoscompliment = $0c 32 28000 ???? 00 14 vertical_shooting_explosion_07_tallsprite_00_width = $14 33 28000 ???? 00 00 vertical_shooting_explosion_07_mode = $00 34 28000 ???? 00 0c vertical_shooting_explosion_07_width_twoscompliment = $0c 35 28000 ???? 00 14 vertical_shooting_explosion_07_width = $14 36 28000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_mode = $00 37 28000 ???? 00 1e vertical_shooting_explosion_06_tallsprite_00_width_twoscompliment = $1e 38 28000 ???? 00 02 vertical_shooting_explosion_06_tallsprite_00_width = $02 39 28000 ???? 00 00 vertical_shooting_explosion_06_mode = $00 40 28000 ???? 00 1e vertical_shooting_explosion_06_width_twoscompliment = $1e 41 28000 ???? 00 02 vertical_shooting_explosion_06_width = $02 42 28000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_mode = $00 43 28000 ???? 00 1e vertical_shooting_explosion_05_tallsprite_00_width_twoscompliment = $1e 44 28000 ???? 00 02 vertical_shooting_explosion_05_tallsprite_00_width = $02 45 28000 ???? 00 00 vertical_shooting_explosion_05_mode = $00 46 28000 ???? 00 1e vertical_shooting_explosion_05_width_twoscompliment = $1e 47 28000 ???? 00 02 vertical_shooting_explosion_05_width = $02 48 28000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_mode = $00 49 28000 ???? 00 1e vertical_shooting_explosion_04_tallsprite_00_width_twoscompliment = $1e 50 28000 ???? 00 02 vertical_shooting_explosion_04_tallsprite_00_width = $02 51 28000 ???? 00 00 vertical_shooting_explosion_04_mode = $00 52 28000 ???? 00 1e vertical_shooting_explosion_04_width_twoscompliment = $1e 53 28000 ???? 00 02 vertical_shooting_explosion_04_width = $02 54 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_mode = $00 55 28000 ???? 00 1e vertical_shooting_explosion_03_tallsprite_00_width_twoscompliment = $1e 56 28000 ???? 00 02 vertical_shooting_explosion_03_tallsprite_00_width = $02 57 28000 ???? 00 00 vertical_shooting_explosion_03_mode = $00 58 28000 ???? 00 1e vertical_shooting_explosion_03_width_twoscompliment = $1e 59 28000 ???? 00 02 vertical_shooting_explosion_03_width = $02 60 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_mode = $00 61 28000 ???? 00 1e vertical_shooting_explosion_02_tallsprite_00_width_twoscompliment = $1e 62 28000 ???? 00 02 vertical_shooting_explosion_02_tallsprite_00_width = $02 63 28000 ???? 00 00 vertical_shooting_explosion_02_mode = $00 64 28000 ???? 00 1e vertical_shooting_explosion_02_width_twoscompliment = $1e 65 28000 ???? 00 02 vertical_shooting_explosion_02_width = $02 66 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_mode = $00 67 28000 ???? 00 1e vertical_shooting_explosion_01_tallsprite_00_width_twoscompliment = $1e 68 28000 ???? 00 02 vertical_shooting_explosion_01_tallsprite_00_width = $02 69 28000 ???? 00 00 vertical_shooting_explosion_01_mode = $00 70 28000 ???? 00 1e vertical_shooting_explosion_01_width_twoscompliment = $1e 71 28000 ???? 00 02 vertical_shooting_explosion_01_width = $02 72 28000 ???? 00 00 vertical_shooting_1up_mode = $00 73 28000 ???? 00 1e vertical_shooting_1up_width_twoscompliment = $1e 74 28000 ???? 00 02 vertical_shooting_1up_width = $02 75 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_mode = $00 76 28000 ???? 00 1e vertical_shooting_enemy01_tallsprite_00_width_twoscompliment = $1e 77 28000 ???? 00 02 vertical_shooting_enemy01_tallsprite_00_width = $02 78 28000 ???? 00 00 vertical_shooting_enemy01_mode = $00 79 28000 ???? 00 1e vertical_shooting_enemy01_width_twoscompliment = $1e 80 28000 ???? 00 02 vertical_shooting_enemy01_width = $02 81 28000 ???? 00 00 vertical_shooting_powerup_mode = $00 82 28000 ???? 00 1e vertical_shooting_powerup_width_twoscompliment = $1e 83 28000 ???? 00 02 vertical_shooting_powerup_width = $02 84 28000 ???? 00 00 vertical_shooting_enemyshot_mode = $00 85 28000 ???? 00 1f vertical_shooting_enemyshot_width_twoscompliment = $1f 86 28000 ???? 00 01 vertical_shooting_enemyshot_width = $01 87 28000 ???? 00 00 vertical_shooting_bullet_mode = $00 88 28000 ???? 00 1f vertical_shooting_bullet_width_twoscompliment = $1f 89 28000 ???? 00 01 vertical_shooting_bullet_width = $01 90 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_mode = $00 91 28000 ???? 00 1e vertical_shooting_ship_tallsprite_00_width_twoscompliment = $1e 92 28000 ???? 00 02 vertical_shooting_ship_tallsprite_00_width = $02 93 28000 ???? 00 00 vertical_shooting_ship_mode = $00 94 28000 ???? 00 1e vertical_shooting_ship_width_twoscompliment = $1e 95 28000 ???? 00 02 vertical_shooting_ship_width = $02 96 28000 ???? 00 00 vertical_shooting_font_mode = $00 97 28000 ???? 00 13 vertical_shooting_font_width_twoscompliment = $13 98 28000 ???? 00 2d vertical_shooting_font_width = $2d 99 28000 ???? 00 90 sfx_explosion_length = .skipL0364-sfx_explosion 100 28000 ???? 101 28000 ???? 00 30 sfx_plainlaser_length = .skipL0363-sfx_plainlaser 102 28000 ???? 103 28000 ???? 00 54 sfx_pulsecannon_length = .skipL0362-sfx_pulsecannon 104 28000 ???? 105 28000 ???? 00 36 sfx_bling_length = .skipL0361-sfx_bling 106 28000 ???? 107 28000 ???? 00 01 BOXCOLLISION = 1 108 28000 ???? 00 00 FALSE = 0 109 28000 ???? 110 28000 ???? 00 01 TRUE = 1 111 28000 ???? 112 28000 ???? 00 0f firing_rate = 15 113 28000 ???? 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_explosion_10_tallsprite_00_color3 = $33 123 28000 ???? 00 2b vertical_shooting_explosion_10_tallsprite_00_color2 = $2b 124 28000 ???? 00 36 vertical_shooting_explosion_10_tallsprite_00_color1 = $36 125 28000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_color0 = $00 126 28000 ???? 00 33 vertical_shooting_explosion_10_color3 = $33 127 28000 ???? 00 2b vertical_shooting_explosion_10_color2 = $2b 128 28000 ???? 00 36 vertical_shooting_explosion_10_color1 = $36 129 28000 ???? 00 00 vertical_shooting_explosion_10_color0 = $00 130 28000 ???? 00 33 vertical_shooting_explosion_09_tallsprite_00_color3 = $33 131 28000 ???? 00 2b vertical_shooting_explosion_09_tallsprite_00_color2 = $2b 132 28000 ???? 00 36 vertical_shooting_explosion_09_tallsprite_00_color1 = $36 133 28000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_color0 = $00 134 28000 ???? 00 33 vertical_shooting_explosion_09_color3 = $33 135 28000 ???? 00 2b vertical_shooting_explosion_09_color2 = $2b 136 28000 ???? 00 36 vertical_shooting_explosion_09_color1 = $36 137 28000 ???? 00 00 vertical_shooting_explosion_09_color0 = $00 138 28000 ???? 00 33 vertical_shooting_explosion_08_tallsprite_00_color3 = $33 139 28000 ???? 00 2b vertical_shooting_explosion_08_tallsprite_00_color2 = $2b 140 28000 ???? 00 36 vertical_shooting_explosion_08_tallsprite_00_color1 = $36 141 28000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_color0 = $00 142 28000 ???? 00 33 vertical_shooting_explosion_08_color3 = $33 143 28000 ???? 00 2b vertical_shooting_explosion_08_color2 = $2b 144 28000 ???? 00 36 vertical_shooting_explosion_08_color1 = $36 145 28000 ???? 00 00 vertical_shooting_explosion_08_color0 = $00 146 28000 ???? 00 33 vertical_shooting_explosion_07_tallsprite_00_color3 = $33 147 28000 ???? 00 2b vertical_shooting_explosion_07_tallsprite_00_color2 = $2b 148 28000 ???? 00 36 vertical_shooting_explosion_07_tallsprite_00_color1 = $36 149 28000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_color0 = $00 150 28000 ???? 00 33 vertical_shooting_explosion_07_color3 = $33 151 28000 ???? 00 2b vertical_shooting_explosion_07_color2 = $2b 152 28000 ???? 00 36 vertical_shooting_explosion_07_color1 = $36 153 28000 ???? 00 00 vertical_shooting_explosion_07_color0 = $00 154 28000 ???? 00 33 vertical_shooting_explosion_06_tallsprite_00_color3 = $33 155 28000 ???? 00 2b vertical_shooting_explosion_06_tallsprite_00_color2 = $2b 156 28000 ???? 00 36 vertical_shooting_explosion_06_tallsprite_00_color1 = $36 157 28000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_color0 = $00 158 28000 ???? 00 33 vertical_shooting_explosion_06_color3 = $33 159 28000 ???? 00 2b vertical_shooting_explosion_06_color2 = $2b 160 28000 ???? 00 36 vertical_shooting_explosion_06_color1 = $36 161 28000 ???? 00 00 vertical_shooting_explosion_06_color0 = $00 162 28000 ???? 00 33 vertical_shooting_explosion_05_tallsprite_00_color3 = $33 163 28000 ???? 00 2b vertical_shooting_explosion_05_tallsprite_00_color2 = $2b 164 28000 ???? 00 36 vertical_shooting_explosion_05_tallsprite_00_color1 = $36 165 28000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_color0 = $00 166 28000 ???? 00 33 vertical_shooting_explosion_05_color3 = $33 167 28000 ???? 00 2b vertical_shooting_explosion_05_color2 = $2b 168 28000 ???? 00 36 vertical_shooting_explosion_05_color1 = $36 169 28000 ???? 00 00 vertical_shooting_explosion_05_color0 = $00 170 28000 ???? 00 33 vertical_shooting_explosion_04_tallsprite_00_color3 = $33 171 28000 ???? 00 36 vertical_shooting_explosion_04_tallsprite_00_color2 = $36 172 28000 ???? 00 2b vertical_shooting_explosion_04_tallsprite_00_color1 = $2b 173 28000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_color0 = $00 174 28000 ???? 00 33 vertical_shooting_explosion_04_color3 = $33 175 28000 ???? 00 36 vertical_shooting_explosion_04_color2 = $36 176 28000 ???? 00 2b vertical_shooting_explosion_04_color1 = $2b 177 28000 ???? 00 00 vertical_shooting_explosion_04_color0 = $00 178 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color3 = 0 179 28000 ???? 00 36 vertical_shooting_explosion_03_tallsprite_00_color2 = $36 180 28000 ???? 00 2b vertical_shooting_explosion_03_tallsprite_00_color1 = $2b 181 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color0 = $00 182 28000 ???? 00 00 vertical_shooting_explosion_03_color3 = 0 183 28000 ???? 00 36 vertical_shooting_explosion_03_color2 = $36 184 28000 ???? 00 2b vertical_shooting_explosion_03_color1 = $2b 185 28000 ???? 00 00 vertical_shooting_explosion_03_color0 = $00 186 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color3 = 0 187 28000 ???? 00 36 vertical_shooting_explosion_02_tallsprite_00_color2 = $36 188 28000 ???? 00 2b vertical_shooting_explosion_02_tallsprite_00_color1 = $2b 189 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color0 = $00 190 28000 ???? 00 00 vertical_shooting_explosion_02_color3 = 0 191 28000 ???? 00 36 vertical_shooting_explosion_02_color2 = $36 192 28000 ???? 00 2b vertical_shooting_explosion_02_color1 = $2b 193 28000 ???? 00 00 vertical_shooting_explosion_02_color0 = $00 194 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color3 = 0 195 28000 ???? 00 2b vertical_shooting_explosion_01_tallsprite_00_color2 = $2b 196 28000 ???? 00 36 vertical_shooting_explosion_01_tallsprite_00_color1 = $36 197 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color0 = $00 198 28000 ???? 00 00 vertical_shooting_explosion_01_color3 = 0 199 28000 ???? 00 2b vertical_shooting_explosion_01_color2 = $2b 200 28000 ???? 00 36 vertical_shooting_explosion_01_color1 = $36 201 28000 ???? 00 00 vertical_shooting_explosion_01_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 ???? 00 e9 customTemp4 = d 237 28000 ???? 238 28000 ???? 00 e8 customTemp3 = c 239 28000 ???? 240 28000 ???? 00 e7 customTemp2 = b 241 28000 ???? 242 28000 ???? 00 e6 customTemp1 = a 243 28000 ???? 244 28000 ???? 01 77 enemy01_Slowdown = var55 245 28000 ???? 246 28000 ???? 01 9c mob_X = var92 247 28000 ???? 01 9e mob_Y = var94 248 28000 ???? 01 a0 mob_speedX = var96 249 28000 ???? 01 a2 mob_speedY = var98 250 28000 ???? 01 73 temp_speedY = temp_YSu 251 28000 ???? 01 74 temp_YSf = var52 252 28000 ???? 253 28000 ???? 01 73 temp_YSu = var51 254 28000 ???? 255 28000 ???? 01 71 temp_speedX = temp_XSu 256 28000 ???? 01 72 temp_XSf = var50 257 28000 ???? 258 28000 ???? 01 71 temp_XSu = var49 259 28000 ???? 260 28000 ???? 01 6f total_speedY = total_YSu 261 28000 ???? 01 70 total_YSf = var48 262 28000 ???? 263 28000 ???? 01 6f total_YSu = var47 264 28000 ???? 265 28000 ???? 01 6d total_speedX = total_XSu 266 28000 ???? 01 6e total_XSf = var46 267 28000 ???? 268 28000 ???? 01 6d total_XSu = var45 269 28000 ???? 270 28000 ???? 22 50 enemy_shotSYf = $2250 271 28000 ???? 272 28000 ???? 22 40 enemy_shotSXf = $2240 273 28000 ???? 274 28000 ???? 22 30 enemy_shotSY = $2230 275 28000 ???? 276 28000 ???? 22 20 enemy_shotSX = $2220 277 28000 ???? 278 28000 ???? 22 10 enemy_shotYf = $2210 279 28000 ???? 280 28000 ???? 22 00 enemy_shotXf = $2200 281 28000 ???? 282 28000 ???? 01 6c enemy_shotDirection = var44 283 28000 ???? 284 28000 ???? 01 6b timer = var43 285 28000 ???? 286 28000 ???? 01 6a isDead_flag = var42 287 28000 ???? 288 28000 ???? 01 69 continue_flag = var41 289 28000 ???? 290 28000 ???? 01 68 twinlaser_Slowdown = var40 291 28000 ???? 292 28000 ???? 01 67 twinlaser_flag = var39 293 28000 ???? 294 28000 ???? 01 66 twinlaserY = var38 295 28000 ???? 296 28000 ???? 01 65 twinlaserX = var37 297 28000 ???? 298 28000 ???? 01 64 lives = var36 299 28000 ???? 300 28000 ???? 01 63 explosion_aniframe = var35 301 28000 ???? 302 28000 ???? 01 62 extra_shipFlag = var34 303 28000 ???? 304 28000 ???? 01 61 extra_shipY = var33 305 28000 ???? 306 28000 ???? 01 60 extra_shipX = var32 307 28000 ???? 308 28000 ???? 01 5f gameover_flag = var31 309 28000 ???? 310 28000 ???? 01 5e enemy01_speed = var30 311 28000 ???? 312 28000 ???? 01 5d rMovement6 = var29 313 28000 ???? 314 28000 ???? 01 5c rMovement5 = var28 315 28000 ???? 316 28000 ???? 01 5b rMovement4 = var27 317 28000 ???? 318 28000 ???? 01 5a rMovement3 = var26 319 28000 ???? 320 28000 ???? 01 59 enemy01_Flag = var25 321 28000 ???? 322 28000 ???? 01 58 enemy01_Y = var24 323 28000 ???? 324 28000 ???? 01 57 enemy01_X = var23 325 28000 ???? 326 28000 ???? 01 56 enemy_shotSlowdown = var22 327 28000 ???? 328 28000 ???? 01 55 bulletSlowdown = var21 329 28000 ???? 330 28000 ???? 01 54 power_upSlowdown = var20 331 28000 ???? 332 28000 ???? 01 53 rMovement2 = var19 333 28000 ???? 334 28000 ???? 01 52 power_upFlag = var18 335 28000 ???? 336 28000 ???? 01 51 power_upY = var17 337 28000 ???? 338 28000 ???? 01 50 power_upX = var16 339 28000 ???? 340 28000 ???? 01 4f rDirection = var15 341 28000 ???? 342 28000 ???? 01 4e rMovement1 = var14 343 28000 ???? 344 28000 ???? 01 4d playerFlag = var13 345 28000 ???? 346 28000 ???? 01 4c enemy_shotFlag = var12 347 28000 ???? 348 28000 ???? 01 4b enemy_shotY = var11 349 28000 ???? 350 28000 ???? 01 4a enemy_shotX = var10 351 28000 ???? 352 28000 ???? 01 49 bulletY = var9 353 28000 ???? 354 28000 ???? 01 48 bulletX = var8 355 28000 ???? 356 28000 ???? 01 47 joyposright = var7 357 28000 ???? 358 28000 ???? 01 46 joyposleft = var6 359 28000 ???? 360 28000 ???? 01 45 joyposdown = var5 361 28000 ???? 362 28000 ???? 01 44 joyposup = var4 363 28000 ???? 364 28000 ???? 01 43 fire_debounce = var3 365 28000 ???? 366 28000 ???? 01 42 playerY = var2 367 28000 ???? 368 28000 ???? 01 41 playerX = var1 369 28000 ???? 370 28000 ???? 01 40 frameCounter = var0 371 28000 ???? 372 28000 ???? 00 01 collisionwrap = 1 373 28000 ???? 00 01 NTSC = 1 374 28000 ???? 00 c0 SCREENHEIGHT = 192 375 28000 ???? 00 01 CHECKOVERWRITE = 1 376 28000 ???? 00 08 ZONEHEIGHT = 8 377 28000 ???? 00 01 SGRAM = 1 378 28000 ???? 00 08 bankswitchmode = 8 379 28000 ???? 00 01 ROM128K = 1 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite3.78b.asm 555 28000 ???? 556 28000 ???? ; A BEAD header gets automatically incorportated into the ROM header. 557 28000 ???? ; For more BEAD executable info, check out the spec... 558 28000 ???? ; http://7800.8bitdev.org/index.php/The_Atari_7800_BEAD_Execuable_Specification 559 28000 ???? 560 28000 ???? 00 01 GAMEDESCRIPTIONSET = 1 561 28000 ???? 4e 61 6d 65 GAMEDESCRIPTION = "Test Name" 562 28000 ???? 563 28000 ???? 00 40 BDHSC = %01000000 564 28000 ???? 00 20 BDYM = %00100000 565 28000 ???? 00 10 BDPOKEY = %00010000 566 28000 ???? 00 08 BDROF = %00001000 567 28000 ???? 00 00 BD16K = %00000000 568 28000 ???? 00 01 BD32K = %00000001 569 28000 ???? 00 02 BD48K = %00000010 570 28000 ???? 00 05 BD1800 = %00000101 571 28000 ???? 00 06 BD4000 = %00000110 572 28000 ???? 573 28000 ???? - ifconst ROM16K 574 28000 ???? - ;BEADHEADER = 1 575 28000 ???? endif 576 28000 ???? - ifconst ROM32K 577 28000 ???? -BEADHEADER = 1 578 28000 ???? endif 579 28000 ???? - ifconst ROM48K 580 28000 ???? -BEADHEADER = 1 581 28000 ???? endif 582 28000 ???? 583 28000 ???? - ifconst BEADHEADER 584 28000 ???? -BEADHARDWARE SET 0 585 28000 ???? - ifconst ROM16K 586 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD16K) 587 28000 ???? - endif 588 28000 ???? - ifconst ROM32K 589 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD32K) 590 28000 ???? - endif 591 28000 ???? - ifconst ROM48K 592 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD48K) 593 28000 ???? - endif 594 28000 ???? - ifconst pokeysupport 595 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDPOKEY) 596 28000 ???? - endif 597 28000 ???? - ifconst HSSUPPORT 598 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDHSC) 599 28000 ???? - endif 600 28000 ???? endif 601 28000 ???? 602 28000 ???? ;start address of cart... 603 28000 ???? - ifconst ROM48K 604 28000 ???? - ORG $4000,0 605 28000 ???? - ifconst BEADHEADER 606 28000 ???? - .byte $BE,$AD,BEADHARDWARE 607 28000 ???? - ifconst GAMEDESCRIPTIONSET 608 28000 ???? - CLC 609 28000 ???? - BCC _SKIPDESCRIPTION 610 28000 ???? - .byte GAMEDESCRIPTION,0 611 28000 ???? -_SKIPDESCRIPTION 612 28000 ???? - endif 613 28000 ???? - jmp ($FFFC) 614 28000 ???? - endif 615 28000 ???? else 616 28000 ???? ifconst bankswitchmode 617 28000 ???? - ifconst ROMAT4K 618 28000 ???? - ORG $4000,0 619 28000 ???? - RORG $4000 620 28000 ???? else 621 8000 ORG $8000,0 622 8000 RORG $8000 623 8000 endif 624 8000 - else ; not bankswitchmode 625 8000 - ifconst ROM16K 626 8000 - ORG $C000,0 627 8000 - ifconst BEADHEADER 628 8000 - .byte $BE,$AD,BEADHARDWARE 629 8000 - ifconst GAMEDESCRIPTION 630 8000 - CLC 631 8000 - BCC _SKIPDESCRIPTION 632 8000 - .byte GAMEDESCRIPTION,0 633 8000 -_SKIPDESCRIPTION 634 8000 - endif 635 8000 - jmp ($FFFC) 636 8000 - endif 637 8000 - else 638 8000 - ifconst ROM8K 639 8000 - ORG $E000,0 640 8000 - else 641 8000 - ORG $8000,0 642 8000 - ifconst BEADHEADER 643 8000 - .byte $BE,$AD,BEADHARDWARE 644 8000 - ifconst GAMEDESCRIPTION 645 8000 - CLC 646 8000 - BCC _SKIPDESCRIPTION 647 8000 - .byte GAMEDESCRIPTION,0 648 8000 -_SKIPDESCRIPTION 649 8000 - endif 650 8000 - jmp ($FFFC) 651 8000 - endif 652 8000 - endif 653 8000 - endif 654 8000 endif 655 8000 endif 656 8000 657 8000 ;7800basic v0.17 Feb 14 2021 21:38:55 658 8000 SPACEOVERFLOW SET 0 659 8000 game 660 8000 . 661 8000 ;; 662 8000 663 8000 . 664 8000 ;; 665 8000 666 8000 .L00 ;; set romsize 128kRAM 667 8000 668 8000 .L01 ;; set zoneheight 8 669 8000 670 8000 .L02 ;; set zoneprotection on 671 8000 672 8000 .L03 ;; set tallsprite on 673 8000 674 8000 .L04 ;; set screenheight 192 675 8000 676 8000 .L05 ;; set basepath gfx 677 8000 678 8000 .L06 ;; set tv ntsc 679 8000 680 8000 .L07 ;; set collisionwrap on 681 8000 682 8000 .L08 ;; set doublewide off 683 8000 684 8000 .L09 ;; displaymode 160A 685 8000 686 8000 a9 40 lda #%01000000 ;Enable DMA, mode=160x2/160x4 687 8002 85 3c sta CTRL 688 8004 689 8004 8d 07 21 sta sCTRL 690 8007 691 8007 . 692 8007 ;; 693 8007 694 8007 .L010 ;; dim frameCounter = var0 695 8007 696 8007 .L011 ;; dim playerX = var1 697 8007 698 8007 .L012 ;; dim playerY = var2 699 8007 700 8007 .L013 ;; dim fire_debounce = var3 701 8007 702 8007 .L014 ;; dim joyposup = var4 703 8007 704 8007 .L015 ;; dim joyposdown = var5 705 8007 706 8007 .L016 ;; dim joyposleft = var6 707 8007 708 8007 .L017 ;; dim joyposright = var7 709 8007 710 8007 .L018 ;; dim bulletX = var8 711 8007 712 8007 .L019 ;; dim bulletY = var9 713 8007 714 8007 .L020 ;; dim enemy_shotX = var10 715 8007 716 8007 .L021 ;; dim enemy_shotY = var11 717 8007 718 8007 .L022 ;; dim enemy_shotFlag = var12 719 8007 720 8007 .L023 ;; dim playerFlag = var13 721 8007 722 8007 .L024 ;; dim rMovement1 = var14 723 8007 724 8007 .L025 ;; dim rDirection = var15 725 8007 726 8007 .L026 ;; dim power_upX = var16 727 8007 728 8007 .L027 ;; dim power_upY = var17 729 8007 730 8007 .L028 ;; dim power_upFlag = var18 731 8007 732 8007 .L029 ;; dim rMovement2 = var19 733 8007 734 8007 .L030 ;; dim power_upSlowdown = var20 735 8007 736 8007 .L031 ;; dim bulletSlowdown = var21 737 8007 738 8007 .L032 ;; dim enemy_shotSlowdown = var22 739 8007 740 8007 .L033 ;; dim enemy01_X = var23 741 8007 742 8007 .L034 ;; dim enemy01_Y = var24 743 8007 744 8007 .L035 ;; dim enemy01_Flag = var25 745 8007 746 8007 .L036 ;; dim rMovement3 = var26 747 8007 748 8007 .L037 ;; dim rMovement4 = var27 749 8007 750 8007 .L038 ;; dim rMovement5 = var28 751 8007 752 8007 .L039 ;; dim rMovement6 = var29 753 8007 754 8007 .L040 ;; dim enemy01_speed = var30 755 8007 756 8007 .L041 ;; dim gameover_flag = var31 757 8007 758 8007 .L042 ;; dim extra_shipX = var32 759 8007 760 8007 .L043 ;; dim extra_shipY = var33 761 8007 762 8007 .L044 ;; dim extra_shipFlag = var34 763 8007 764 8007 .L045 ;; dim explosion_aniframe = var35 765 8007 766 8007 .L046 ;; dim lives = var36 767 8007 768 8007 .L047 ;; dim twinlaserX = var37 769 8007 770 8007 .L048 ;; dim twinlaserY = var38 771 8007 772 8007 .L049 ;; dim twinlaser_flag = var39 773 8007 774 8007 .L050 ;; dim twinlaser_Slowdown = var40 775 8007 776 8007 .L051 ;; dim continue_flag = var41 777 8007 778 8007 .L052 ;; dim isDead_flag = var42 779 8007 780 8007 .L053 ;; dim timer = var43 781 8007 782 8007 .L054 ;; dim enemy_shotDirection = var44 783 8007 784 8007 .L055 ;; dim enemy_shotXf = $2200 785 8007 786 8007 .L056 ;; dim enemy_shotYf = $2210 787 8007 788 8007 .L057 ;; dim enemy_shotSX = $2220 789 8007 790 8007 .L058 ;; dim enemy_shotSY = $2230 791 8007 792 8007 .L059 ;; dim enemy_shotSXf = $2240 793 8007 794 8007 .L060 ;; dim enemy_shotSYf = $2250 795 8007 796 8007 .L061 ;; dim total_XSu = var45 797 8007 798 8007 .L062 ;; dim total_XSf = var46 799 8007 800 8007 .L063 ;; dim total_speedX = total_XSu.total_XSf 801 8007 802 8007 .L064 ;; dim total_YSu = var47 803 8007 804 8007 .L065 ;; dim total_YSf = var48 805 8007 806 8007 .L066 ;; dim total_speedY = total_YSu.total_YSf 807 8007 808 8007 .L067 ;; dim temp_XSu = var49 809 8007 810 8007 .L068 ;; dim temp_XSf = var50 811 8007 812 8007 .L069 ;; dim temp_speedX = temp_XSu.temp_XSf 813 8007 814 8007 .L070 ;; dim temp_YSu = var51 815 8007 816 8007 .L071 ;; dim temp_YSf = var52 817 8007 818 8007 .L072 ;; dim temp_speedY = temp_YSu.temp_YSf 819 8007 820 8007 .L073 ;; dim mob_speedY = var98.var99 821 8007 822 8007 .L074 ;; dim mob_speedX = var96.var97 823 8007 824 8007 .L075 ;; dim mob_Y = var94.var95 825 8007 826 8007 .L076 ;; dim mob_X = var92.var93 827 8007 828 8007 .L077 ;; dim enemy01_Slowdown = var55 829 8007 830 8007 .L078 ;; dim customTemp1 = a 831 8007 832 8007 .L079 ;; dim customTemp2 = b 833 8007 834 8007 .L080 ;; dim customTemp3 = c 835 8007 836 8007 .L081 ;; dim customTemp4 = d 837 8007 838 8007 . 839 8007 ;; 840 8007 841 8007 .L082 ;; characterset vertical_shooting_font 842 8007 843 8007 a9 b0 lda #>vertical_shooting_font 844 8009 8d 0b 21 sta sCHARBASE 845 800c 846 800c 85 34 sta CHARBASE 847 800e a9 60 lda #(vertical_shooting_font_mode | %01100000) 848 8010 8d 06 21 sta charactermode 849 8013 850 8013 .L083 ;; alphachars ' 0123456789abcdefghijklmnopqrstuvwxyz.,?!:;`"' 851 8013 852 8013 . 853 8013 ;; 854 8013 855 8013 .import 856 8013 ;; import 857 8013 858 8013 .L084 ;; incgraphic vertical_shooting_font.png 160A 859 8013 860 8013 .L085 ;; incgraphic vertical_shooting_ship.png 160A 861 8013 862 8013 .L086 ;; incgraphic vertical_shooting_bullet.png 160A 863 8013 864 8013 .L087 ;; incgraphic vertical_shooting_enemyshot.png 160A 865 8013 866 8013 .L088 ;; incgraphic vertical_shooting_powerup.png 160A 867 8013 868 8013 .L089 ;; incgraphic vertical_shooting_enemy01.png 160A 869 8013 870 8013 . 871 8013 ;; 872 8013 873 8013 .L090 ;; incgraphic vertical_shooting_1up.png 160A 874 8013 875 8013 .L091 ;; incgraphic vertical_shooting_explosion_01.png 160A 876 8013 877 8013 .L092 ;; incgraphic vertical_shooting_explosion_02.png 160A 878 8013 879 8013 .L093 ;; incgraphic vertical_shooting_explosion_03.png 160A 880 8013 881 8013 .L094 ;; incgraphic vertical_shooting_explosion_04.png 160A 882 8013 883 8013 .L095 ;; incgraphic vertical_shooting_explosion_05.png 160A 884 8013 885 8013 .L096 ;; incgraphic vertical_shooting_explosion_06.png 160A 886 8013 887 8013 .L097 ;; incgraphic vertical_shooting_explosion_07.png 160A 888 8013 889 8013 .L098 ;; incgraphic vertical_shooting_explosion_08.png 160A 890 8013 891 8013 .L099 ;; incgraphic vertical_shooting_explosion_09.png 160A 892 8013 893 8013 .L0100 ;; incgraphic vertical_shooting_explosion_10.png 160A 894 8013 895 8013 .L0101 ;; incgraphic vertical_shooting_laser.png 160A 896 8013 897 8013 . 898 8013 ;; 899 8013 900 8013 .L0102 ;; const firing_rate = 15 901 8013 902 8013 . 903 8013 ;; 904 8013 905 8013 .L0103 ;; const TRUE = 1 906 8013 907 8013 .L0104 ;; const FALSE = 0 908 8013 909 8013 . 910 8013 ;; 911 8013 912 8013 . 913 8013 ;; 914 8013 915 8013 .palettes 916 8013 ;; palettes 917 8013 918 8013 .L0105 ;; P0C1 = $0F : P0C2 = $05 : P0C3 = $32 919 8013 920 8013 a9 0f LDA #$0F 921 8015 85 21 STA P0C1 922 8017 a9 05 LDA #$05 923 8019 85 22 STA P0C2 924 801b a9 32 LDA #$32 925 801d 85 23 STA P0C3 926 801f .L0106 ;; P1C1 = $0F : P1C2 = $EE : P1C3 = $E7 927 801f 928 801f a9 0f LDA #$0F 929 8021 85 25 STA P1C1 930 8023 a9 ee LDA #$EE 931 8025 85 26 STA P1C2 932 8027 a9 e7 LDA #$E7 933 8029 85 27 STA P1C3 934 802b .L0107 ;; P2C1 = $9D : P2C2 = $73 : P2C3 = $88 935 802b 936 802b a9 9d LDA #$9D 937 802d 85 29 STA P2C1 938 802f a9 73 LDA #$73 939 8031 85 2a STA P2C2 940 8033 a9 88 LDA #$88 941 8035 85 2b STA P2C3 942 8037 .L0108 ;; P3C1 = $FB : P3C2 = $F2 : P3C3 = $25 943 8037 944 8037 a9 fb LDA #$FB 945 8039 85 2d STA P3C1 946 803b a9 f2 LDA #$F2 947 803d 85 2e STA P3C2 948 803f a9 25 LDA #$25 949 8041 85 2f STA P3C3 950 8043 . 951 8043 ;; 952 8043 953 8043 .plot 954 8043 ;; plot 955 8043 956 8043 .L0109 ;; playerX = 80 : playerY = 144 : playerFlag = 0 957 8043 958 8043 a9 50 LDA #80 959 8045 8d 41 01 STA playerX 960 8048 a9 90 LDA #144 961 804a 8d 42 01 STA playerY 962 804d a9 00 LDA #0 963 804f 8d 4d 01 STA playerFlag 964 8052 .L0110 ;; isDead_flag = 0 : gameover_flag = 0 965 8052 966 8052 a9 00 LDA #0 967 8054 8d 6a 01 STA isDead_flag 968 8057 8d 5f 01 STA gameover_flag 969 805a .L0111 ;; bulletX = 0 : bulletY = 0 : bulletSlowdown = 0 970 805a 971 805a a9 00 LDA #0 972 805c 8d 48 01 STA bulletX 973 805f 8d 49 01 STA bulletY 974 8062 8d 55 01 STA bulletSlowdown 975 8065 .L0112 ;; frameCounter = 0 976 8065 977 8065 a9 00 LDA #0 978 8067 8d 40 01 STA frameCounter 979 806a .L0113 ;; rMovement1 = 1 : rMovement2 = 1 : rMovement3 = 1 : rMovement4 = 1 980 806a 981 806a a9 01 LDA #1 982 806c 8d 4e 01 STA rMovement1 983 806f 8d 53 01 STA rMovement2 984 8072 8d 5a 01 STA rMovement3 985 8075 8d 5b 01 STA rMovement4 986 8078 .L0114 ;; rMovement5 = 1 : rMovement6 = 1 : rDirection = 1 987 8078 988 8078 a9 01 LDA #1 989 807a 8d 5c 01 STA rMovement5 990 807d 8d 5d 01 STA rMovement6 991 8080 8d 4f 01 STA rDirection 992 8083 .L0115 ;; power_upX = 5 : power_upY = 32 : power_upFlag = 0 : power_upSlowdown = 0 993 8083 994 8083 a9 05 LDA #5 995 8085 8d 50 01 STA power_upX 996 8088 a9 20 LDA #32 997 808a 8d 51 01 STA power_upY 998 808d a9 00 LDA #0 999 808f 8d 52 01 STA power_upFlag 1000 8092 8d 54 01 STA power_upSlowdown 1001 8095 .L0116 ;; twinlaserX = 0 : twinlaserY = 0 : twinlaser_flag = 0 : twinlaser_Slowdown = 0 1002 8095 1003 8095 a9 00 LDA #0 1004 8097 8d 65 01 STA twinlaserX 1005 809a 8d 66 01 STA twinlaserY 1006 809d 8d 67 01 STA twinlaser_flag 1007 80a0 8d 68 01 STA twinlaser_Slowdown 1008 80a3 .L0117 ;; enemy_shotX = 0 : enemy_shotY = 0 : enemy_shotFlag = 0 : enemy_shotSlowdown = 0 1009 80a3 1010 80a3 a9 00 LDA #0 1011 80a5 8d 4a 01 STA enemy_shotX 1012 80a8 8d 4b 01 STA enemy_shotY 1013 80ab 8d 4c 01 STA enemy_shotFlag 1014 80ae 8d 56 01 STA enemy_shotSlowdown 1015 80b1 .L0118 ;; enemy01_X = 0 : enemy01_Y = 0 : enemy01_Flag = 0 : enemy01_speed = 3 : enemy01_Slowdown = 0 1016 80b1 1017 80b1 a9 00 LDA #0 1018 80b3 8d 57 01 STA enemy01_X 1019 80b6 8d 58 01 STA enemy01_Y 1020 80b9 8d 59 01 STA enemy01_Flag 1021 80bc a9 03 LDA #3 1022 80be 8d 5e 01 STA enemy01_speed 1023 80c1 a9 00 LDA #0 1024 80c3 8d 77 01 STA enemy01_Slowdown 1025 80c6 .L0119 ;; extra_shipX = 0 : extra_shipY = 0 : extra_shipFlag = 0 1026 80c6 1027 80c6 a9 00 LDA #0 1028 80c8 8d 60 01 STA extra_shipX 1029 80cb 8d 61 01 STA extra_shipY 1030 80ce 8d 62 01 STA extra_shipFlag 1031 80d1 .L0120 ;; joyposleft = 0 : joyposright = 0 : joyposup = 0 : joyposdown = 0 1032 80d1 1033 80d1 a9 00 LDA #0 1034 80d3 8d 46 01 STA joyposleft 1035 80d6 8d 47 01 STA joyposright 1036 80d9 8d 44 01 STA joyposup 1037 80dc 8d 45 01 STA joyposdown 1038 80df . 1039 80df ;; 1040 80df 1041 80df .L0121 ;; gosub titlescreen 1042 80df 1043 80df 20 bc 8f jsr .titlescreen 1044 80e2 1045 80e2 . 1046 80e2 ;; 1047 80e2 1048 80e2 .L0122 ;; gosub initialise_gamescreen 1049 80e2 1050 80e2 20 c9 90 jsr .initialise_gamescreen 1051 80e5 1052 80e5 .L0123 ;; timer = firing_rate 1053 80e5 1054 80e5 a9 0f LDA #firing_rate 1055 80e7 8d 6b 01 STA timer 1056 80ea . 1057 80ea ;; 1058 80ea 1059 80ea .main 1060 80ea ;; main 1061 80ea 1062 80ea .L0124 ;; frameCounter = frameCounter + 1 1063 80ea 1064 80ea ad 40 01 LDA frameCounter 1065 80ed 18 CLC 1066 80ee 69 01 ADC #1 1067 80f0 8d 40 01 STA frameCounter 1068 80f3 .L0125 ;; if frameCounter > 10 then frameCounter = 0 1069 80f3 1070 80f3 a9 0a LDA #10 1071 80f5 cd 40 01 CMP frameCounter 1072 80f8 b0 05 BCS .skipL0125 1073 80fa .condpart0 1074 80fa a9 00 LDA #0 1075 80fc 8d 40 01 STA frameCounter 1076 80ff .skipL0125 1077 80ff .mainloop 1078 80ff ;; mainloop 1079 80ff 1080 80ff .L0126 ;; timer = timer - 1 1081 80ff 1082 80ff ad 6b 01 LDA timer 1083 8102 38 SEC 1084 8103 e9 01 SBC #1 1085 8105 8d 6b 01 STA timer 1086 8108 .L0127 ;; if timer = 0 then gosub fire_enemybullet : timer = firing_rate 1087 8108 1088 8108 ad 6b 01 LDA timer 1089 810b c9 00 CMP #0 1090 810d d0 08 BNE .skipL0127 1091 810f .condpart1 1092 810f 20 dd 90 jsr .fire_enemybullet 1093 8112 a9 0f LDA #firing_rate 1094 8114 8d 6b 01 STA timer 1095 8117 .skipL0127 1096 8117 . 1097 8117 ;; 1098 8117 1099 8117 .L0128 ;; rMovement1 = ( rand & 7 ) - 2 1100 8117 1101 8117 ; complex statement detected 1102 8117 20 f8 f3 jsr randomize 1103 811a 29 07 AND #7 1104 811c 38 SEC 1105 811d e9 02 SBC #2 1106 811f 8d 4e 01 STA rMovement1 1107 8122 .L0129 ;; rMovement2 = ( rand & 6 ) 1108 8122 1109 8122 ; complex statement detected 1110 8122 20 f8 f3 jsr randomize 1111 8125 29 06 AND #6 1112 8127 8d 53 01 STA rMovement2 1113 812a .L0130 ;; rMovement3 = ( rand & 3 ) + 1 1114 812a 1115 812a ; complex statement detected 1116 812a 20 f8 f3 jsr randomize 1117 812d 29 03 AND #3 1118 812f 18 CLC 1119 8130 69 01 ADC #1 1120 8132 8d 5a 01 STA rMovement3 1121 8135 .L0131 ;; rMovement4 = ( rand & 5 ) + 2 1122 8135 1123 8135 ; complex statement detected 1124 8135 20 f8 f3 jsr randomize 1125 8138 29 05 AND #5 1126 813a 18 CLC 1127 813b 69 02 ADC #2 1128 813d 8d 5b 01 STA rMovement4 1129 8140 .L0132 ;; rMovement5 = ( rand & 5 ) + 1 1130 8140 1131 8140 ; complex statement detected 1132 8140 20 f8 f3 jsr randomize 1133 8143 29 05 AND #5 1134 8145 18 CLC 1135 8146 69 01 ADC #1 1136 8148 8d 5c 01 STA rMovement5 1137 814b .L0133 ;; rMovement6 = ( rand & 6 ) - 1 1138 814b 1139 814b ; complex statement detected 1140 814b 20 f8 f3 jsr randomize 1141 814e 29 06 AND #6 1142 8150 38 SEC 1143 8151 e9 01 SBC #1 1144 8153 8d 5d 01 STA rMovement6 1145 8156 .L0134 ;; rDirection = ( rand & 4 ) 1146 8156 1147 8156 ; complex statement detected 1148 8156 20 f8 f3 jsr randomize 1149 8159 29 04 AND #4 1150 815b 8d 4f 01 STA rDirection 1151 815e .L0135 ;; if switchreset then reboot 1152 815e 1153 815e 20 8d f4 jsr checkresetswitch 1154 8161 d0 03 BNE .skipL0135 1155 8163 .condpart2 1156 8163 4c 7a f5 JMP START 1157 8166 .skipL0135 1158 8166 . 1159 8166 ;; 1160 8166 1161 8166 .L0136 ;; if joy0up && joyposup = - 2 then gosub SetBulletHome 1162 8166 1163 8166 a9 10 lda #$10 1164 8168 2c 80 02 bit SWCHA 1165 816b d0 10 BNE .skipL0136 1166 816d .condpart3 1167 816d ; complex condition detected 1168 816d a9 fe LDA #254 1169 816f 48 PHA 1170 8170 ba TSX 1171 8171 68 PLA 1172 8172 ad 44 01 LDA joyposup 1173 8175 dd 01 01 CMP $101,x 1174 8178 d0 03 BNE .skip3then 1175 817a .condpart4 1176 817a 20 5e 8e jsr .SetBulletHome 1177 817d 1178 817d .skip3then 1179 817d .skipL0136 1180 817d .L0137 ;; if joy0down && joyposdown = - 2 then gosub SetBulletHome 1181 817d 1182 817d a9 20 lda #$20 1183 817f 2c 80 02 bit SWCHA 1184 8182 d0 10 BNE .skipL0137 1185 8184 .condpart5 1186 8184 ; complex condition detected 1187 8184 a9 fe LDA #254 1188 8186 48 PHA 1189 8187 ba TSX 1190 8188 68 PLA 1191 8189 ad 45 01 LDA joyposdown 1192 818c dd 01 01 CMP $101,x 1193 818f d0 03 BNE .skip5then 1194 8191 .condpart6 1195 8191 20 5e 8e jsr .SetBulletHome 1196 8194 1197 8194 .skip5then 1198 8194 .skipL0137 1199 8194 .L0138 ;; if joy0up && joyposleft = - 2 then gosub SetBulletHome 1200 8194 1201 8194 a9 10 lda #$10 1202 8196 2c 80 02 bit SWCHA 1203 8199 d0 10 BNE .skipL0138 1204 819b .condpart7 1205 819b ; complex condition detected 1206 819b a9 fe LDA #254 1207 819d 48 PHA 1208 819e ba TSX 1209 819f 68 PLA 1210 81a0 ad 46 01 LDA joyposleft 1211 81a3 dd 01 01 CMP $101,x 1212 81a6 d0 03 BNE .skip7then 1213 81a8 .condpart8 1214 81a8 20 5e 8e jsr .SetBulletHome 1215 81ab 1216 81ab .skip7then 1217 81ab .skipL0138 1218 81ab .L0139 ;; if joy0down && joyposright = - 2 then gosub SetBulletHome 1219 81ab 1220 81ab a9 20 lda #$20 1221 81ad 2c 80 02 bit SWCHA 1222 81b0 d0 10 BNE .skipL0139 1223 81b2 .condpart9 1224 81b2 ; complex condition detected 1225 81b2 a9 fe LDA #254 1226 81b4 48 PHA 1227 81b5 ba TSX 1228 81b6 68 PLA 1229 81b7 ad 47 01 LDA joyposright 1230 81ba dd 01 01 CMP $101,x 1231 81bd d0 03 BNE .skip9then 1232 81bf .condpart10 1233 81bf 20 5e 8e jsr .SetBulletHome 1234 81c2 1235 81c2 .skip9then 1236 81c2 .skipL0139 1237 81c2 .L0140 ;; if joy0up && joyposup = - 2 then gosub SetLaserHome 1238 81c2 1239 81c2 a9 10 lda #$10 1240 81c4 2c 80 02 bit SWCHA 1241 81c7 d0 10 BNE .skipL0140 1242 81c9 .condpart11 1243 81c9 ; complex condition detected 1244 81c9 a9 fe LDA #254 1245 81cb 48 PHA 1246 81cc ba TSX 1247 81cd 68 PLA 1248 81ce ad 44 01 LDA joyposup 1249 81d1 dd 01 01 CMP $101,x 1250 81d4 d0 03 BNE .skip11then 1251 81d6 .condpart12 1252 81d6 20 7a 8e jsr .SetLaserHome 1253 81d9 1254 81d9 .skip11then 1255 81d9 .skipL0140 1256 81d9 .L0141 ;; if joy0down && joyposdown = - 2 then gosub SetLaserHome 1257 81d9 1258 81d9 a9 20 lda #$20 1259 81db 2c 80 02 bit SWCHA 1260 81de d0 10 BNE .skipL0141 1261 81e0 .condpart13 1262 81e0 ; complex condition detected 1263 81e0 a9 fe LDA #254 1264 81e2 48 PHA 1265 81e3 ba TSX 1266 81e4 68 PLA 1267 81e5 ad 45 01 LDA joyposdown 1268 81e8 dd 01 01 CMP $101,x 1269 81eb d0 03 BNE .skip13then 1270 81ed .condpart14 1271 81ed 20 7a 8e jsr .SetLaserHome 1272 81f0 1273 81f0 .skip13then 1274 81f0 .skipL0141 1275 81f0 .L0142 ;; if joy0up && joyposleft = - 2 then gosub SetLaserHome 1276 81f0 1277 81f0 a9 10 lda #$10 1278 81f2 2c 80 02 bit SWCHA 1279 81f5 d0 10 BNE .skipL0142 1280 81f7 .condpart15 1281 81f7 ; complex condition detected 1282 81f7 a9 fe LDA #254 1283 81f9 48 PHA 1284 81fa ba TSX 1285 81fb 68 PLA 1286 81fc ad 46 01 LDA joyposleft 1287 81ff dd 01 01 CMP $101,x 1288 8202 d0 03 BNE .skip15then 1289 8204 .condpart16 1290 8204 20 7a 8e jsr .SetLaserHome 1291 8207 1292 8207 .skip15then 1293 8207 .skipL0142 1294 8207 .L0143 ;; if joy0down && joyposright = - 2 then gosub SetLaserHome 1295 8207 1296 8207 a9 20 lda #$20 1297 8209 2c 80 02 bit SWCHA 1298 820c d0 10 BNE .skipL0143 1299 820e .condpart17 1300 820e ; complex condition detected 1301 820e a9 fe LDA #254 1302 8210 48 PHA 1303 8211 ba TSX 1304 8212 68 PLA 1305 8213 ad 47 01 LDA joyposright 1306 8216 dd 01 01 CMP $101,x 1307 8219 d0 03 BNE .skip17then 1308 821b .condpart18 1309 821b 20 7a 8e jsr .SetLaserHome 1310 821e 1311 821e .skip17then 1312 821e .skipL0143 1313 821e .L0144 ;; if joy0up then playerY = playerY - 1 : joyposup = 1 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 1314 821e 1315 821e a9 10 lda #$10 1316 8220 2c 80 02 bit SWCHA 1317 8223 d0 19 BNE .skipL0144 1318 8225 .condpart19 1319 8225 ad 42 01 LDA playerY 1320 8228 38 SEC 1321 8229 e9 01 SBC #1 1322 822b 8d 42 01 STA playerY 1323 822e a9 01 LDA #1 1324 8230 8d 44 01 STA joyposup 1325 8233 a9 00 LDA #0 1326 8235 8d 45 01 STA joyposdown 1327 8238 8d 46 01 STA joyposleft 1328 823b 8d 47 01 STA joyposright 1329 823e .skipL0144 1330 823e .L0145 ;; if joy0down then playerY = playerY + 1 : joyposup = 0 : joyposdown = 1 : joyposleft = 0 : joyposright = 0 1331 823e 1332 823e a9 20 lda #$20 1333 8240 2c 80 02 bit SWCHA 1334 8243 d0 1b BNE .skipL0145 1335 8245 .condpart20 1336 8245 ad 42 01 LDA playerY 1337 8248 18 CLC 1338 8249 69 01 ADC #1 1339 824b 8d 42 01 STA playerY 1340 824e a9 00 LDA #0 1341 8250 8d 44 01 STA joyposup 1342 8253 a9 01 LDA #1 1343 8255 8d 45 01 STA joyposdown 1344 8258 a9 00 LDA #0 1345 825a 8d 46 01 STA joyposleft 1346 825d 8d 47 01 STA joyposright 1347 8260 .skipL0145 1348 8260 .L0146 ;; if joy0left then playerX = playerX - 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 1 : joyposright = 0 1349 8260 1350 8260 2c 80 02 bit SWCHA 1351 8263 70 1b BVS .skipL0146 1352 8265 .condpart21 1353 8265 ad 41 01 LDA playerX 1354 8268 38 SEC 1355 8269 e9 01 SBC #1 1356 826b 8d 41 01 STA playerX 1357 826e a9 00 LDA #0 1358 8270 8d 44 01 STA joyposup 1359 8273 8d 45 01 STA joyposdown 1360 8276 a9 01 LDA #1 1361 8278 8d 46 01 STA joyposleft 1362 827b a9 00 LDA #0 1363 827d 8d 47 01 STA joyposright 1364 8280 .skipL0146 1365 8280 .L0147 ;; if joy0right then playerX = playerX + 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 1 1366 8280 1367 8280 2c 80 02 bit SWCHA 1368 8283 30 19 BMI .skipL0147 1369 8285 .condpart22 1370 8285 ad 41 01 LDA playerX 1371 8288 18 CLC 1372 8289 69 01 ADC #1 1373 828b 8d 41 01 STA playerX 1374 828e a9 00 LDA #0 1375 8290 8d 44 01 STA joyposup 1376 8293 8d 45 01 STA joyposdown 1377 8296 8d 46 01 STA joyposleft 1378 8299 a9 01 LDA #1 1379 829b 8d 47 01 STA joyposright 1380 829e .skipL0147 1381 829e .L0148 ;; if joy0fire && joyposup = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1382 829e 1383 829e 2c 02 21 bit sINPT1 1384 82a1 10 29 BPL .skipL0148 1385 82a3 .condpart23 1386 82a3 ad 44 01 LDA joyposup 1387 82a6 c9 01 CMP #1 1388 82a8 d0 22 BNE .skip23then 1389 82aa .condpart24 1390 82aa ad 49 01 LDA bulletY 1391 82ad 38 SEC 1392 82ae e9 05 SBC #5 1393 82b0 8d 49 01 STA bulletY 1394 82b3 ifnconst NOTIALOCKMUTE 1395 82b3 a9 01 lda #1 1396 82b5 85 de sta sfxschedulelock 1397 82b7 a9 fa lda #sfx_pulsecannon 1400 82bd 85 e1 sta sfxinstrumenthi 1401 82bf a9 00 lda #0 1402 82c1 85 e2 sta sfxpitchoffset ; no pitch modification 1403 82c3 85 e3 sta sfxnoteindex ; not a musical note 1404 82c5 20 53 f2 jsr schedulesfx 1405 82c8 a9 00 lda #0 1406 82ca 85 de sta sfxschedulelock 1407 82cc endif ; NOTIALOCKMUTE 1408 82cc .skip23then 1409 82cc .skipL0148 1410 82cc .L0149 ;; if joy0fire && joyposdown = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1411 82cc 1412 82cc 2c 02 21 bit sINPT1 1413 82cf 10 29 BPL .skipL0149 1414 82d1 .condpart25 1415 82d1 ad 45 01 LDA joyposdown 1416 82d4 c9 01 CMP #1 1417 82d6 d0 22 BNE .skip25then 1418 82d8 .condpart26 1419 82d8 ad 49 01 LDA bulletY 1420 82db 38 SEC 1421 82dc e9 05 SBC #5 1422 82de 8d 49 01 STA bulletY 1423 82e1 ifnconst NOTIALOCKMUTE 1424 82e1 a9 01 lda #1 1425 82e3 85 de sta sfxschedulelock 1426 82e5 a9 fa lda #sfx_pulsecannon 1429 82eb 85 e1 sta sfxinstrumenthi 1430 82ed a9 00 lda #0 1431 82ef 85 e2 sta sfxpitchoffset ; no pitch modification 1432 82f1 85 e3 sta sfxnoteindex ; not a musical note 1433 82f3 20 53 f2 jsr schedulesfx 1434 82f6 a9 00 lda #0 1435 82f8 85 de sta sfxschedulelock 1436 82fa endif ; NOTIALOCKMUTE 1437 82fa .skip25then 1438 82fa .skipL0149 1439 82fa .L0150 ;; if joy0fire && joyposleft = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1440 82fa 1441 82fa 2c 02 21 bit sINPT1 1442 82fd 10 29 BPL .skipL0150 1443 82ff .condpart27 1444 82ff ad 46 01 LDA joyposleft 1445 8302 c9 01 CMP #1 1446 8304 d0 22 BNE .skip27then 1447 8306 .condpart28 1448 8306 ad 49 01 LDA bulletY 1449 8309 38 SEC 1450 830a e9 05 SBC #5 1451 830c 8d 49 01 STA bulletY 1452 830f ifnconst NOTIALOCKMUTE 1453 830f a9 01 lda #1 1454 8311 85 de sta sfxschedulelock 1455 8313 a9 fa lda #sfx_pulsecannon 1458 8319 85 e1 sta sfxinstrumenthi 1459 831b a9 00 lda #0 1460 831d 85 e2 sta sfxpitchoffset ; no pitch modification 1461 831f 85 e3 sta sfxnoteindex ; not a musical note 1462 8321 20 53 f2 jsr schedulesfx 1463 8324 a9 00 lda #0 1464 8326 85 de sta sfxschedulelock 1465 8328 endif ; NOTIALOCKMUTE 1466 8328 .skip27then 1467 8328 .skipL0150 1468 8328 .L0151 ;; if joy0fire && joyposright = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1469 8328 1470 8328 2c 02 21 bit sINPT1 1471 832b 10 29 BPL .skipL0151 1472 832d .condpart29 1473 832d ad 47 01 LDA joyposright 1474 8330 c9 01 CMP #1 1475 8332 d0 22 BNE .skip29then 1476 8334 .condpart30 1477 8334 ad 49 01 LDA bulletY 1478 8337 38 SEC 1479 8338 e9 05 SBC #5 1480 833a 8d 49 01 STA bulletY 1481 833d ifnconst NOTIALOCKMUTE 1482 833d a9 01 lda #1 1483 833f 85 de sta sfxschedulelock 1484 8341 a9 fa lda #sfx_pulsecannon 1487 8347 85 e1 sta sfxinstrumenthi 1488 8349 a9 00 lda #0 1489 834b 85 e2 sta sfxpitchoffset ; no pitch modification 1490 834d 85 e3 sta sfxnoteindex ; not a musical note 1491 834f 20 53 f2 jsr schedulesfx 1492 8352 a9 00 lda #0 1493 8354 85 de sta sfxschedulelock 1494 8356 endif ; NOTIALOCKMUTE 1495 8356 .skip29then 1496 8356 .skipL0151 1497 8356 .L0152 ;; if !joy0fire then bulletX = playerX + 2 : bulletY = playerY - 8 1498 8356 1499 8356 2c 02 21 bit sINPT1 1500 8359 30 12 BMI .skipL0152 1501 835b .condpart31 1502 835b ad 41 01 LDA playerX 1503 835e 18 CLC 1504 835f 69 02 ADC #2 1505 8361 8d 48 01 STA bulletX 1506 8364 ad 42 01 LDA playerY 1507 8367 38 SEC 1508 8368 e9 08 SBC #8 1509 836a 8d 49 01 STA bulletY 1510 836d .skipL0152 1511 836d . 1512 836d ;; 1513 836d 1514 836d .L0153 ;; enemy_shotSlowdown = enemy_shotSlowdown + 1 1515 836d 1516 836d ad 56 01 LDA enemy_shotSlowdown 1517 8370 18 CLC 1518 8371 69 01 ADC #1 1519 8373 8d 56 01 STA enemy_shotSlowdown 1520 8376 .L0154 ;; if enemy_shotSlowdown > 8 then enemy_shotSlowdown = 0 1521 8376 1522 8376 a9 08 LDA #8 1523 8378 cd 56 01 CMP enemy_shotSlowdown 1524 837b b0 05 BCS .skipL0154 1525 837d .condpart32 1526 837d a9 00 LDA #0 1527 837f 8d 56 01 STA enemy_shotSlowdown 1528 8382 .skipL0154 1529 8382 . 1530 8382 ;; 1531 8382 1532 8382 .L0155 ;; enemy01_Slowdown = enemy01_Slowdown + 1 1533 8382 1534 8382 ad 77 01 LDA enemy01_Slowdown 1535 8385 18 CLC 1536 8386 69 01 ADC #1 1537 8388 8d 77 01 STA enemy01_Slowdown 1538 838b .L0156 ;; if enemy01_Slowdown > 8 then enemy01_Slowdown = 0 1539 838b 1540 838b a9 08 LDA #8 1541 838d cd 77 01 CMP enemy01_Slowdown 1542 8390 b0 05 BCS .skipL0156 1543 8392 .condpart33 1544 8392 a9 00 LDA #0 1545 8394 8d 77 01 STA enemy01_Slowdown 1546 8397 .skipL0156 1547 8397 . 1548 8397 ;; 1549 8397 1550 8397 .L0157 ;; bulletSlowdown = bulletSlowdown + 1 1551 8397 1552 8397 ad 55 01 LDA bulletSlowdown 1553 839a 18 CLC 1554 839b 69 01 ADC #1 1555 839d 8d 55 01 STA bulletSlowdown 1556 83a0 .L0158 ;; if bulletSlowdown > 6 then bulletSlowdown = 0 1557 83a0 1558 83a0 a9 06 LDA #6 1559 83a2 cd 55 01 CMP bulletSlowdown 1560 83a5 b0 05 BCS .skipL0158 1561 83a7 .condpart34 1562 83a7 a9 00 LDA #0 1563 83a9 8d 55 01 STA bulletSlowdown 1564 83ac .skipL0158 1565 83ac . 1566 83ac ;; 1567 83ac 1568 83ac .L0159 ;; power_upSlowdown = power_upSlowdown + 1 1569 83ac 1570 83ac ad 54 01 LDA power_upSlowdown 1571 83af 18 CLC 1572 83b0 69 01 ADC #1 1573 83b2 8d 54 01 STA power_upSlowdown 1574 83b5 .L0160 ;; if power_upSlowdown > 7 then power_upSlowdown = 0 1575 83b5 1576 83b5 a9 07 LDA #7 1577 83b7 cd 54 01 CMP power_upSlowdown 1578 83ba b0 05 BCS .skipL0160 1579 83bc .condpart35 1580 83bc a9 00 LDA #0 1581 83be 8d 54 01 STA power_upSlowdown 1582 83c1 .skipL0160 1583 83c1 . 1584 83c1 ;; 1585 83c1 1586 83c1 .L0161 ;; twinlaser_Slowdown = twinlaser_Slowdown + 1 1587 83c1 1588 83c1 ad 68 01 LDA twinlaser_Slowdown 1589 83c4 18 CLC 1590 83c5 69 01 ADC #1 1591 83c7 8d 68 01 STA twinlaser_Slowdown 1592 83ca .L0162 ;; if twinlaser_Slowdown > 5 then twinlaser_Slowdown = 0 1593 83ca 1594 83ca a9 05 LDA #5 1595 83cc cd 68 01 CMP twinlaser_Slowdown 1596 83cf b0 05 BCS .skipL0162 1597 83d1 .condpart36 1598 83d1 a9 00 LDA #0 1599 83d3 8d 68 01 STA twinlaser_Slowdown 1600 83d6 .skipL0162 1601 83d6 . 1602 83d6 ;; 1603 83d6 1604 83d6 .L0163 ;; if playerX > 152 then playerX = playerX - 1 1605 83d6 1606 83d6 a9 98 LDA #152 1607 83d8 cd 41 01 CMP playerX 1608 83db b0 09 BCS .skipL0163 1609 83dd .condpart37 1610 83dd ad 41 01 LDA playerX 1611 83e0 38 SEC 1612 83e1 e9 01 SBC #1 1613 83e3 8d 41 01 STA playerX 1614 83e6 .skipL0163 1615 83e6 .L0164 ;; if playerX < 1 then playerX = playerX + 1 1616 83e6 1617 83e6 ad 41 01 LDA playerX 1618 83e9 c9 01 CMP #1 1619 83eb b0 09 BCS .skipL0164 1620 83ed .condpart38 1621 83ed ad 41 01 LDA playerX 1622 83f0 18 CLC 1623 83f1 69 01 ADC #1 1624 83f3 8d 41 01 STA playerX 1625 83f6 .skipL0164 1626 83f6 .L0165 ;; if playerY > 177 then playerY = playerY - 1 1627 83f6 1628 83f6 a9 b1 LDA #177 1629 83f8 cd 42 01 CMP playerY 1630 83fb b0 09 BCS .skipL0165 1631 83fd .condpart39 1632 83fd ad 42 01 LDA playerY 1633 8400 38 SEC 1634 8401 e9 01 SBC #1 1635 8403 8d 42 01 STA playerY 1636 8406 .skipL0165 1637 8406 .L0166 ;; if playerY < 1 then playerY = playerY + 1 1638 8406 1639 8406 ad 42 01 LDA playerY 1640 8409 c9 01 CMP #1 1641 840b b0 09 BCS .skipL0166 1642 840d .condpart40 1643 840d ad 42 01 LDA playerY 1644 8410 18 CLC 1645 8411 69 01 ADC #1 1646 8413 8d 42 01 STA playerY 1647 8416 .skipL0166 1648 8416 .L0167 ;; if bulletY > 183 then bulletY = bulletY - 1 1649 8416 1650 8416 a9 b7 LDA #183 1651 8418 cd 49 01 CMP bulletY 1652 841b b0 09 BCS .skipL0167 1653 841d .condpart41 1654 841d ad 49 01 LDA bulletY 1655 8420 38 SEC 1656 8421 e9 01 SBC #1 1657 8423 8d 49 01 STA bulletY 1658 8426 .skipL0167 1659 8426 .L0168 ;; if bulletY < 1 then bulletY = bulletY + 1 1660 8426 1661 8426 ad 49 01 LDA bulletY 1662 8429 c9 01 CMP #1 1663 842b b0 09 BCS .skipL0168 1664 842d .condpart42 1665 842d ad 49 01 LDA bulletY 1666 8430 18 CLC 1667 8431 69 01 ADC #1 1668 8433 8d 49 01 STA bulletY 1669 8436 .skipL0168 1670 8436 .L0169 ;; if twinlaserY > 183 then twinlaserY = twinlaserY - 1 1671 8436 1672 8436 a9 b7 LDA #183 1673 8438 cd 66 01 CMP twinlaserY 1674 843b b0 09 BCS .skipL0169 1675 843d .condpart43 1676 843d ad 66 01 LDA twinlaserY 1677 8440 38 SEC 1678 8441 e9 01 SBC #1 1679 8443 8d 66 01 STA twinlaserY 1680 8446 .skipL0169 1681 8446 .L0170 ;; if twinlaserY < 1 then twinlaserY = twinlaserY + 1 1682 8446 1683 8446 ad 66 01 LDA twinlaserY 1684 8449 c9 01 CMP #1 1685 844b b0 09 BCS .skipL0170 1686 844d .condpart44 1687 844d ad 66 01 LDA twinlaserY 1688 8450 18 CLC 1689 8451 69 01 ADC #1 1690 8453 8d 66 01 STA twinlaserY 1691 8456 .skipL0170 1692 8456 . 1693 8456 ;; 1694 8456 1695 8456 .L0171 ;; gosub check_collisions 1696 8456 1697 8456 20 9d 89 jsr .check_collisions 1698 8459 1699 8459 .L0172 ;; if isDead_flag then goto lose_a_life 1700 8459 1701 8459 ad 6a 01 LDA isDead_flag 1702 845c f0 03 BEQ .skipL0172 1703 845e .condpart45 1704 845e 4c 96 8e jmp .lose_a_life 1705 8461 1706 8461 .skipL0172 1707 8461 . 1708 8461 ;; 1709 8461 1710 8461 . 1711 8461 ;; 1712 8461 1713 8461 .L0173 ;; if enemy_shotX > 160 then enemy_shotX = enemy_shotX - 1 1714 8461 1715 8461 a9 a0 LDA #160 1716 8463 cd 4a 01 CMP enemy_shotX 1717 8466 b0 09 BCS .skipL0173 1718 8468 .condpart46 1719 8468 ad 4a 01 LDA enemy_shotX 1720 846b 38 SEC 1721 846c e9 01 SBC #1 1722 846e 8d 4a 01 STA enemy_shotX 1723 8471 .skipL0173 1724 8471 .L0174 ;; if enemy_shotX < 1 then enemy_shotX = enemy_shotX + 1 1725 8471 1726 8471 ad 4a 01 LDA enemy_shotX 1727 8474 c9 01 CMP #1 1728 8476 b0 09 BCS .skipL0174 1729 8478 .condpart47 1730 8478 ad 4a 01 LDA enemy_shotX 1731 847b 18 CLC 1732 847c 69 01 ADC #1 1733 847e 8d 4a 01 STA enemy_shotX 1734 8481 .skipL0174 1735 8481 .L0175 ;; if enemy_shotY > 191 then enemy_shotY = enemy_shotY - 1 1736 8481 1737 8481 a9 bf LDA #191 1738 8483 cd 4b 01 CMP enemy_shotY 1739 8486 b0 09 BCS .skipL0175 1740 8488 .condpart48 1741 8488 ad 4b 01 LDA enemy_shotY 1742 848b 38 SEC 1743 848c e9 01 SBC #1 1744 848e 8d 4b 01 STA enemy_shotY 1745 8491 .skipL0175 1746 8491 .L0176 ;; if enemy_shotY < 1 then enemy_shotY = enemy_shotY + 1 1747 8491 1748 8491 ad 4b 01 LDA enemy_shotY 1749 8494 c9 01 CMP #1 1750 8496 b0 09 BCS .skipL0176 1751 8498 .condpart49 1752 8498 ad 4b 01 LDA enemy_shotY 1753 849b 18 CLC 1754 849c 69 01 ADC #1 1755 849e 8d 4b 01 STA enemy_shotY 1756 84a1 .skipL0176 1757 84a1 .L0177 ;; if power_upX > 155 then power_upX = power_upX - 5 1758 84a1 1759 84a1 a9 9b LDA #155 1760 84a3 cd 50 01 CMP power_upX 1761 84a6 b0 09 BCS .skipL0177 1762 84a8 .condpart50 1763 84a8 ad 50 01 LDA power_upX 1764 84ab 38 SEC 1765 84ac e9 05 SBC #5 1766 84ae 8d 50 01 STA power_upX 1767 84b1 .skipL0177 1768 84b1 .L0178 ;; if power_upX < 1 then power_upX = power_upX + 5 1769 84b1 1770 84b1 ad 50 01 LDA power_upX 1771 84b4 c9 01 CMP #1 1772 84b6 b0 09 BCS .skipL0178 1773 84b8 .condpart51 1774 84b8 ad 50 01 LDA power_upX 1775 84bb 18 CLC 1776 84bc 69 05 ADC #5 1777 84be 8d 50 01 STA power_upX 1778 84c1 .skipL0178 1779 84c1 .L0179 ;; if power_upY > 191 then power_upY = power_upY - 5 1780 84c1 1781 84c1 a9 bf LDA #191 1782 84c3 cd 51 01 CMP power_upY 1783 84c6 b0 09 BCS .skipL0179 1784 84c8 .condpart52 1785 84c8 ad 51 01 LDA power_upY 1786 84cb 38 SEC 1787 84cc e9 05 SBC #5 1788 84ce 8d 51 01 STA power_upY 1789 84d1 .skipL0179 1790 84d1 .L0180 ;; if power_upY < 1 then power_upY = power_upY + 5 1791 84d1 1792 84d1 ad 51 01 LDA power_upY 1793 84d4 c9 01 CMP #1 1794 84d6 b0 09 BCS .skipL0180 1795 84d8 .condpart53 1796 84d8 ad 51 01 LDA power_upY 1797 84db 18 CLC 1798 84dc 69 05 ADC #5 1799 84de 8d 51 01 STA power_upY 1800 84e1 .skipL0180 1801 84e1 .L0181 ;; if enemy01_X > 160 then enemy01_X = enemy01_X - 1 1802 84e1 1803 84e1 a9 a0 LDA #160 1804 84e3 cd 57 01 CMP enemy01_X 1805 84e6 b0 09 BCS .skipL0181 1806 84e8 .condpart54 1807 84e8 ad 57 01 LDA enemy01_X 1808 84eb 38 SEC 1809 84ec e9 01 SBC #1 1810 84ee 8d 57 01 STA enemy01_X 1811 84f1 .skipL0181 1812 84f1 .L0182 ;; if enemy01_X < 1 then enemy01_X = enemy01_X + 1 1813 84f1 1814 84f1 ad 57 01 LDA enemy01_X 1815 84f4 c9 01 CMP #1 1816 84f6 b0 09 BCS .skipL0182 1817 84f8 .condpart55 1818 84f8 ad 57 01 LDA enemy01_X 1819 84fb 18 CLC 1820 84fc 69 01 ADC #1 1821 84fe 8d 57 01 STA enemy01_X 1822 8501 .skipL0182 1823 8501 .L0183 ;; if enemy01_Y > 220 then enemy01_Y = enemy01_Y - 1 1824 8501 1825 8501 a9 dc LDA #220 1826 8503 cd 58 01 CMP enemy01_Y 1827 8506 b0 09 BCS .skipL0183 1828 8508 .condpart56 1829 8508 ad 58 01 LDA enemy01_Y 1830 850b 38 SEC 1831 850c e9 01 SBC #1 1832 850e 8d 58 01 STA enemy01_Y 1833 8511 .skipL0183 1834 8511 .L0184 ;; if enemy01_Y < - 16 then enemy01_Y = enemy01_Y + 1 1835 8511 1836 8511 ; complex condition detected 1837 8511 a9 f0 LDA #240 1838 8513 48 PHA 1839 8514 ba TSX 1840 8515 68 PLA 1841 8516 ad 58 01 LDA enemy01_Y 1842 8519 dd 01 01 CMP $101,x 1843 851c b0 09 BCS .skipL0184 1844 851e .condpart57 1845 851e ad 58 01 LDA enemy01_Y 1846 8521 18 CLC 1847 8522 69 01 ADC #1 1848 8524 8d 58 01 STA enemy01_Y 1849 8527 .skipL0184 1850 8527 .L0185 ;; if extra_shipX > 160 then extra_shipX = extra_shipX - 1 1851 8527 1852 8527 a9 a0 LDA #160 1853 8529 cd 60 01 CMP extra_shipX 1854 852c b0 09 BCS .skipL0185 1855 852e .condpart58 1856 852e ad 60 01 LDA extra_shipX 1857 8531 38 SEC 1858 8532 e9 01 SBC #1 1859 8534 8d 60 01 STA extra_shipX 1860 8537 .skipL0185 1861 8537 .L0186 ;; if extra_shipX < 1 then extra_shipX = extra_shipX + 1 1862 8537 1863 8537 ad 60 01 LDA extra_shipX 1864 853a c9 01 CMP #1 1865 853c b0 09 BCS .skipL0186 1866 853e .condpart59 1867 853e ad 60 01 LDA extra_shipX 1868 8541 18 CLC 1869 8542 69 01 ADC #1 1870 8544 8d 60 01 STA extra_shipX 1871 8547 .skipL0186 1872 8547 .L0187 ;; if extra_shipY > 191 then extra_shipY = extra_shipY - 1 1873 8547 1874 8547 a9 bf LDA #191 1875 8549 cd 61 01 CMP extra_shipY 1876 854c b0 09 BCS .skipL0187 1877 854e .condpart60 1878 854e ad 61 01 LDA extra_shipY 1879 8551 38 SEC 1880 8552 e9 01 SBC #1 1881 8554 8d 61 01 STA extra_shipY 1882 8557 .skipL0187 1883 8557 .L0188 ;; if extra_shipY < 1 then extra_shipY = extra_shipY + 1 1884 8557 1885 8557 ad 61 01 LDA extra_shipY 1886 855a c9 01 CMP #1 1887 855c b0 09 BCS .skipL0188 1888 855e .condpart61 1889 855e ad 61 01 LDA extra_shipY 1890 8561 18 CLC 1891 8562 69 01 ADC #1 1892 8564 8d 61 01 STA extra_shipY 1893 8567 .skipL0188 1894 8567 . 1895 8567 ;; 1896 8567 1897 8567 . 1898 8567 ;; 1899 8567 1900 8567 .L0189 ;; z = 15 1901 8567 1902 8567 a9 0f LDA #15 1903 8569 85 ff STA z 1904 856b .despawn_Check 1905 856b ;; despawn_Check 1906 856b 1907 856b .L0190 ;; if enemy_shotX[z] > 160 || enemy_shotY[z] > 191 then enemy_shotFlag[z] = FALSE 1908 856b 1909 856b a9 a0 LDA #160 1910 856d a6 ff LDX z 1911 856f dd 4a 01 CMP enemy_shotX,x 1912 8572 b0 03 BCS .skipL0190 1913 8574 .condpart62 1914 8574 4c 80 85 jmp .condpart63 1915 8577 .skipL0190 1916 8577 a9 bf LDA #191 1917 8579 a6 ff LDX z 1918 857b dd 4b 01 CMP enemy_shotY,x 1919 857e b0 07 BCS .skip12OR 1920 8580 .condpart63 1921 8580 a9 00 LDA #FALSE 1922 8582 a6 ff LDX z 1923 8584 9d 4c 01 STA enemy_shotFlag,x 1924 8587 .skip12OR 1925 8587 .L0191 ;; z = z - 1 1926 8587 1927 8587 a5 ff LDA z 1928 8589 38 SEC 1929 858a e9 01 SBC #1 1930 858c 85 ff STA z 1931 858e .L0192 ;; if z < 15 then goto despawn_Check 1932 858e 1933 858e a5 ff LDA z 1934 8590 c9 0f CMP #15 1935 8592 b0 03 BCS .skipL0192 1936 8594 .condpart64 1937 8594 4c 6b 85 jmp .despawn_Check 1938 8597 1939 8597 .skipL0192 1940 8597 .L0193 ;; gosub move_enemyshot 1941 8597 1942 8597 20 d8 92 jsr .move_enemyshot 1943 859a 1944 859a .L0194 ;; clearscreen 1945 859a 1946 859a 20 87 f0 jsr clearscreen 1947 859d . 1948 859d ;; 1949 859d 1950 859d .L0195 ;; z = 15 1951 859d 1952 859d a9 0f LDA #15 1953 859f 85 ff STA z 1954 85a1 .draw_enemyshot 1955 85a1 ;; draw_enemyshot 1956 85a1 1957 85a1 .L0196 ;; x = enemy_shotX[z] : y = enemy_shotY[z] 1958 85a1 1959 85a1 a6 ff LDX z 1960 85a3 bd 4a 01 LDA enemy_shotX,x 1961 85a6 85 fd STA x 1962 85a8 a6 ff LDX z 1963 85aa bd 4b 01 LDA enemy_shotY,x 1964 85ad 85 fe STA y 1965 85af .L0197 ;; if enemy_shotFlag[z] = TRUE then plotsprite vertical_shooting_enemyshot 2 x y 1966 85af 1967 85af a6 ff LDX z 1968 85b1 bd 4c 01 LDA enemy_shotFlag,x 1969 85b4 c9 01 CMP #TRUE 1970 85b6 d0 1b BNE .skipL0197 1971 85b8 .condpart65 1972 85b8 a9 32 lda #vertical_shooting_enemyshot 1976 85be 85 43 sta temp2 1977 85c0 1978 85c0 a9 5f lda #(64|vertical_shooting_enemyshot_width_twoscompliment) 1979 85c2 85 44 sta temp3 1980 85c4 1981 85c4 a5 fd lda x 1982 85c6 85 45 sta temp4 1983 85c8 1984 85c8 a5 fe lda y 1985 85ca 1986 85ca 85 46 sta temp5 1987 85cc 1988 85cc a9 40 lda #(vertical_shooting_enemyshot_mode|%01000000) 1989 85ce 85 47 sta temp6 1990 85d0 1991 85d0 20 9b f2 jsr plotsprite 1992 85d3 .skipL0197 1993 85d3 .L0198 ;; z = z - 1 1994 85d3 1995 85d3 a5 ff LDA z 1996 85d5 38 SEC 1997 85d6 e9 01 SBC #1 1998 85d8 85 ff STA z 1999 85da .L0199 ;; if z < 15 then goto draw_enemyshot 2000 85da 2001 85da a5 ff LDA z 2002 85dc c9 0f CMP #15 2003 85de b0 03 BCS .skipL0199 2004 85e0 .condpart66 2005 85e0 4c a1 85 jmp .draw_enemyshot 2006 85e3 2007 85e3 .skipL0199 2008 85e3 . 2009 85e3 ;; 2010 85e3 2011 85e3 . 2012 85e3 ;; 2013 85e3 2014 85e3 .L0200 ;; if rDirection = 0 then power_upX = power_upX + rMovement5 : power_upY = power_upY + rMovement2 2015 85e3 2016 85e3 ad 4f 01 LDA rDirection 2017 85e6 c9 00 CMP #0 2018 85e8 d0 14 BNE .skipL0200 2019 85ea .condpart67 2020 85ea ad 50 01 LDA power_upX 2021 85ed 18 CLC 2022 85ee 6d 5c 01 ADC rMovement5 2023 85f1 8d 50 01 STA power_upX 2024 85f4 ad 51 01 LDA power_upY 2025 85f7 18 CLC 2026 85f8 6d 53 01 ADC rMovement2 2027 85fb 8d 51 01 STA power_upY 2028 85fe .skipL0200 2029 85fe .L0201 ;; if rDirection = 1 then power_upX = power_upX + rMovement3 : power_upY = power_upY + rMovement4 2030 85fe 2031 85fe ad 4f 01 LDA rDirection 2032 8601 c9 01 CMP #1 2033 8603 d0 14 BNE .skipL0201 2034 8605 .condpart68 2035 8605 ad 50 01 LDA power_upX 2036 8608 18 CLC 2037 8609 6d 5a 01 ADC rMovement3 2038 860c 8d 50 01 STA power_upX 2039 860f ad 51 01 LDA power_upY 2040 8612 18 CLC 2041 8613 6d 5b 01 ADC rMovement4 2042 8616 8d 51 01 STA power_upY 2043 8619 .skipL0201 2044 8619 .L0202 ;; if rDirection = 2 then power_upX = power_upX + rMovement1 : power_upY = power_upY + rMovement6 2045 8619 2046 8619 ad 4f 01 LDA rDirection 2047 861c c9 02 CMP #2 2048 861e d0 14 BNE .skipL0202 2049 8620 .condpart69 2050 8620 ad 50 01 LDA power_upX 2051 8623 18 CLC 2052 8624 6d 4e 01 ADC rMovement1 2053 8627 8d 50 01 STA power_upX 2054 862a ad 51 01 LDA power_upY 2055 862d 18 CLC 2056 862e 6d 5d 01 ADC rMovement6 2057 8631 8d 51 01 STA power_upY 2058 8634 .skipL0202 2059 8634 . 2060 8634 ;; 2061 8634 2062 8634 .L0203 ;; for customTemp1 = 0 to 3 2063 8634 2064 8634 a9 00 LDA #0 2065 8636 85 e6 STA customTemp1 2066 8638 .L0203forcustomTemp1 2067 8638 .L0204 ;; customTemp2 = rand 2068 8638 2069 8638 20 f8 f3 jsr randomize 2070 863b 85 e7 STA customTemp2 2071 863d .L0205 ;; customTemp2 = customTemp2 2072 863d 2073 863d a5 e7 LDA customTemp2 2074 863f 85 e7 STA customTemp2 2075 8641 .L0206 ;; enemy01_Y[customTemp1] = customTemp2 2076 8641 2077 8641 a5 e7 LDA customTemp2 2078 8643 a6 e6 LDX customTemp1 2079 8645 9d 58 01 STA enemy01_Y,x 2080 8648 . 2081 8648 ;; 2082 8648 2083 8648 .L0207 ;; customTemp2 = rand & #%01111111 2084 8648 2085 8648 20 f8 f3 jsr randomize 2086 864b 29 7f AND ##%01111111 2087 864d 85 e7 STA customTemp2 2088 864f .L0208 ;; customTemp2 = customTemp2 + 16 2089 864f 2090 864f a5 e7 LDA customTemp2 2091 8651 18 CLC 2092 8652 69 10 ADC #16 2093 8654 85 e7 STA customTemp2 2094 8656 .L0209 ;; enemy01_X[customTemp1] = customTemp2 2095 8656 2096 8656 a5 e7 LDA customTemp2 2097 8658 a6 e6 LDX customTemp1 2098 865a 9d 57 01 STA enemy01_X,x 2099 865d .L0210 ;; next 2100 865d 2101 865d a5 e6 LDA customTemp1 2102 865f c9 03 CMP #3 2103 8661 e6 e6 INC customTemp1 2104 8663 if ((* - .L0203forcustomTemp1) < 127) && ((* - .L0203forcustomTemp1) > -128) 2105 8663 90 d3 bcc .L0203forcustomTemp1 2106 8665 - else 2107 8665 - bcs .0skipL0203forcustomTemp1 2108 8665 - jmp .L0203forcustomTemp1 2109 8665 -.0skipL0203forcustomTemp1 2110 8665 endif 2111 8665 . 2112 8665 ;; 2113 8665 2114 8665 .L0211 ;; for customTemp1 = 0 to 3 2115 8665 2116 8665 a9 00 LDA #0 2117 8667 85 e6 STA customTemp1 2118 8669 .L0211forcustomTemp1 2119 8669 .L0212 ;; enemy01_Y[customTemp1] = enemy01_Y[customTemp1] + 1 2120 8669 2121 8669 a6 e6 LDX customTemp1 2122 866b bd 58 01 LDA enemy01_Y,x 2123 866e 18 CLC 2124 866f 69 01 ADC #1 2125 8671 a6 e6 LDX customTemp1 2126 8673 9d 58 01 STA enemy01_Y,x 2127 8676 .L0213 ;; customTemp2 = rand & #%01111111 2128 8676 2129 8676 20 f8 f3 jsr randomize 2130 8679 29 7f AND ##%01111111 2131 867b 85 e7 STA customTemp2 2132 867d .L0214 ;; customTemp2 = customTemp2 + 16 2133 867d 2134 867d a5 e7 LDA customTemp2 2135 867f 18 CLC 2136 8680 69 10 ADC #16 2137 8682 85 e7 STA customTemp2 2138 8684 .L0215 ;; if enemy01_Y[customTemp1] = 243 then enemy01_X[customTemp1] = customTemp2 2139 8684 2140 8684 a6 e6 LDX customTemp1 2141 8686 bd 58 01 LDA enemy01_Y,x 2142 8689 c9 f3 CMP #243 2143 868b d0 07 BNE .skipL0215 2144 868d .condpart70 2145 868d a5 e7 LDA customTemp2 2146 868f a6 e6 LDX customTemp1 2147 8691 9d 57 01 STA enemy01_X,x 2148 8694 .skipL0215 2149 8694 .L0216 ;; next 2150 8694 2151 8694 a5 e6 LDA customTemp1 2152 8696 c9 03 CMP #3 2153 8698 e6 e6 INC customTemp1 2154 869a if ((* - .L0211forcustomTemp1) < 127) && ((* - .L0211forcustomTemp1) > -128) 2155 869a 90 cd bcc .L0211forcustomTemp1 2156 869c - else 2157 869c - bcs .1skipL0211forcustomTemp1 2158 869c - jmp .L0211forcustomTemp1 2159 869c -.1skipL0211forcustomTemp1 2160 869c endif 2161 869c . 2162 869c ;; 2163 869c 2164 869c . 2165 869c ;; 2166 869c 2167 869c . 2168 869c ;; 2169 869c 2170 869c . 2171 869c ;; 2172 869c 2173 869c . 2174 869c ;; 2175 869c 2176 869c .L0217 ;; if rDirection = 0 then extra_shipX = extra_shipX + rMovement5 : extra_shipY = extra_shipY + rMovement2 2177 869c 2178 869c ad 4f 01 LDA rDirection 2179 869f c9 00 CMP #0 2180 86a1 d0 14 BNE .skipL0217 2181 86a3 .condpart71 2182 86a3 ad 60 01 LDA extra_shipX 2183 86a6 18 CLC 2184 86a7 6d 5c 01 ADC rMovement5 2185 86aa 8d 60 01 STA extra_shipX 2186 86ad ad 61 01 LDA extra_shipY 2187 86b0 18 CLC 2188 86b1 6d 53 01 ADC rMovement2 2189 86b4 8d 61 01 STA extra_shipY 2190 86b7 .skipL0217 2191 86b7 .L0218 ;; if rDirection = 1 then extra_shipX = extra_shipX + rMovement1 : extra_shipY = extra_shipY + rMovement3 2192 86b7 2193 86b7 ad 4f 01 LDA rDirection 2194 86ba c9 01 CMP #1 2195 86bc d0 14 BNE .skipL0218 2196 86be .condpart72 2197 86be ad 60 01 LDA extra_shipX 2198 86c1 18 CLC 2199 86c2 6d 4e 01 ADC rMovement1 2200 86c5 8d 60 01 STA extra_shipX 2201 86c8 ad 61 01 LDA extra_shipY 2202 86cb 18 CLC 2203 86cc 6d 5a 01 ADC rMovement3 2204 86cf 8d 61 01 STA extra_shipY 2205 86d2 .skipL0218 2206 86d2 . 2207 86d2 ;; 2208 86d2 2209 86d2 .L0219 ;; if playerFlag = 1 && explosion_aniframe = 1 then playsfx sfx_explosion 2210 86d2 2211 86d2 ad 4d 01 LDA playerFlag 2212 86d5 c9 01 CMP #1 2213 86d7 d0 20 BNE .skipL0219 2214 86d9 .condpart73 2215 86d9 ad 63 01 LDA explosion_aniframe 2216 86dc c9 01 CMP #1 2217 86de d0 19 BNE .skip73then 2218 86e0 .condpart74 2219 86e0 ifnconst NOTIALOCKMUTE 2220 86e0 a9 01 lda #1 2221 86e2 85 de sta sfxschedulelock 2222 86e4 a9 84 lda #sfx_explosion 2225 86ea 85 e1 sta sfxinstrumenthi 2226 86ec a9 00 lda #0 2227 86ee 85 e2 sta sfxpitchoffset ; no pitch modification 2228 86f0 85 e3 sta sfxnoteindex ; not a musical note 2229 86f2 20 53 f2 jsr schedulesfx 2230 86f5 a9 00 lda #0 2231 86f7 85 de sta sfxschedulelock 2232 86f9 endif ; NOTIALOCKMUTE 2233 86f9 .skip73then 2234 86f9 .skipL0219 2235 86f9 .L0220 ;; if playerFlag = 1 then enemy_shotSlowdown = enemy_shotSlowdown + 1 2236 86f9 2237 86f9 ad 4d 01 LDA playerFlag 2238 86fc c9 01 CMP #1 2239 86fe d0 09 BNE .skipL0220 2240 8700 .condpart75 2241 8700 ad 56 01 LDA enemy_shotSlowdown 2242 8703 18 CLC 2243 8704 69 01 ADC #1 2244 8706 8d 56 01 STA enemy_shotSlowdown 2245 8709 .skipL0220 2246 8709 .L0221 ;; if playerFlag = 1 && enemy_shotSlowdown = 8 then enemy_shotSlowdown = 0 2247 8709 2248 8709 ad 4d 01 LDA playerFlag 2249 870c c9 01 CMP #1 2250 870e d0 0c BNE .skipL0221 2251 8710 .condpart76 2252 8710 ad 56 01 LDA enemy_shotSlowdown 2253 8713 c9 08 CMP #8 2254 8715 d0 05 BNE .skip76then 2255 8717 .condpart77 2256 8717 a9 00 LDA #0 2257 8719 8d 56 01 STA enemy_shotSlowdown 2258 871c .skip76then 2259 871c .skipL0221 2260 871c .L0222 ;; if playerFlag = 1 && enemy_shotSlowdown = 2 then explosion_aniframe = explosion_aniframe + 1 2261 871c 2262 871c ad 4d 01 LDA playerFlag 2263 871f c9 01 CMP #1 2264 8721 d0 10 BNE .skipL0222 2265 8723 .condpart78 2266 8723 ad 56 01 LDA enemy_shotSlowdown 2267 8726 c9 02 CMP #2 2268 8728 d0 09 BNE .skip78then 2269 872a .condpart79 2270 872a ad 63 01 LDA explosion_aniframe 2271 872d 18 CLC 2272 872e 69 01 ADC #1 2273 8730 8d 63 01 STA explosion_aniframe 2274 8733 .skip78then 2275 8733 .skipL0222 2276 8733 .L0223 ;; if playerFlag = 1 && explosion_aniframe > 11 then explosion_aniframe = 200 2277 8733 2278 8733 ad 4d 01 LDA playerFlag 2279 8736 c9 01 CMP #1 2280 8738 d0 0c BNE .skipL0223 2281 873a .condpart80 2282 873a a9 0b LDA #11 2283 873c cd 63 01 CMP explosion_aniframe 2284 873f b0 05 BCS .skip80then 2285 8741 .condpart81 2286 8741 a9 c8 LDA #200 2287 8743 8d 63 01 STA explosion_aniframe 2288 8746 .skip80then 2289 8746 .skipL0223 2290 8746 . 2291 8746 ;; 2292 8746 2293 8746 .L0224 ;; restorescreen 2294 8746 2295 8746 20 99 f0 jsr restorescreen 2296 8749 .L0225 ;; gosub draw_scores 2297 8749 2298 8749 20 2b 89 jsr .draw_scores 2299 874c 2300 874c .L0226 ;; gosub draw_sprites 2301 874c 2302 874c 20 55 87 jsr .draw_sprites 2303 874f 2304 874f .L0227 ;; drawscreen 2305 874f 2306 874f 20 bb f0 jsr drawscreen 2307 8752 . 2308 8752 ;; 2309 8752 2310 8752 .L0228 ;; goto mainloop 2311 8752 2312 8752 4c ff 80 jmp .mainloop 2313 8755 2314 8755 . 2315 8755 ;; 2316 8755 2317 8755 . 2318 8755 ;; 2319 8755 2320 8755 .draw_sprites 2321 8755 ;; draw_sprites 2322 8755 2323 8755 .L0229 ;; plotsprite vertical_shooting_ship 0 playerX playerY 2324 8755 2325 8755 a9 2d lda #vertical_shooting_ship 2329 875b 85 43 sta temp2 2330 875d 2331 875d a9 1e lda #(0|vertical_shooting_ship_width_twoscompliment) 2332 875f 85 44 sta temp3 2333 8761 2334 8761 ad 41 01 lda playerX 2335 8764 85 45 sta temp4 2336 8766 2337 8766 ad 42 01 lda playerY 2338 8769 2339 8769 85 46 sta temp5 2340 876b 2341 876b a9 40 lda #(vertical_shooting_ship_mode|%01000000) 2342 876d 85 47 sta temp6 2343 876f 2344 876f 20 9b f2 jsr plotsprite 2345 8772 ; +tall sprite replot 2346 8772 18 clc 2347 8773 a5 42 lda temp1 2348 8775 69 02 adc #vertical_shooting_ship_width 2349 8777 85 42 sta temp1 2350 8779 a5 46 lda temp5 2351 877b 69 08 adc #WZONEHEIGHT 2352 877d 85 46 sta temp5 2353 877f 20 9b f2 jsr plotsprite 2354 8782 .L0230 ;; plotsprite vertical_shooting_bullet 1 bulletX bulletY 2355 8782 2356 8782 a9 31 lda #vertical_shooting_bullet 2360 8788 85 43 sta temp2 2361 878a 2362 878a a9 3f lda #(32|vertical_shooting_bullet_width_twoscompliment) 2363 878c 85 44 sta temp3 2364 878e 2365 878e ad 48 01 lda bulletX 2366 8791 85 45 sta temp4 2367 8793 2368 8793 ad 49 01 lda bulletY 2369 8796 2370 8796 85 46 sta temp5 2371 8798 2372 8798 a9 40 lda #(vertical_shooting_bullet_mode|%01000000) 2373 879a 85 47 sta temp6 2374 879c 2375 879c 20 9b f2 jsr plotsprite 2376 879f . 2377 879f ;; 2378 879f 2379 879f .L0231 ;; plotsprite vertical_shooting_powerup 3 power_upX power_upY 2380 879f 2381 879f a9 33 lda #vertical_shooting_powerup 2385 87a5 85 43 sta temp2 2386 87a7 2387 87a7 a9 7e lda #(96|vertical_shooting_powerup_width_twoscompliment) 2388 87a9 85 44 sta temp3 2389 87ab 2390 87ab ad 50 01 lda power_upX 2391 87ae 85 45 sta temp4 2392 87b0 2393 87b0 ad 51 01 lda power_upY 2394 87b3 2395 87b3 85 46 sta temp5 2396 87b5 2397 87b5 a9 40 lda #(vertical_shooting_powerup_mode|%01000000) 2398 87b7 85 47 sta temp6 2399 87b9 2400 87b9 20 9b f2 jsr plotsprite 2401 87bc .L0232 ;; plotsprite vertical_shooting_enemy01 2 enemy01_X enemy01_Y 2402 87bc 2403 87bc a9 35 lda #vertical_shooting_enemy01 2407 87c2 85 43 sta temp2 2408 87c4 2409 87c4 a9 5e lda #(64|vertical_shooting_enemy01_width_twoscompliment) 2410 87c6 85 44 sta temp3 2411 87c8 2412 87c8 ad 57 01 lda enemy01_X 2413 87cb 85 45 sta temp4 2414 87cd 2415 87cd ad 58 01 lda enemy01_Y 2416 87d0 2417 87d0 85 46 sta temp5 2418 87d2 2419 87d2 a9 40 lda #(vertical_shooting_enemy01_mode|%01000000) 2420 87d4 85 47 sta temp6 2421 87d6 2422 87d6 20 9b f2 jsr plotsprite 2423 87d9 ; +tall sprite replot 2424 87d9 18 clc 2425 87da a5 42 lda temp1 2426 87dc 69 02 adc #vertical_shooting_enemy01_width 2427 87de 85 42 sta temp1 2428 87e0 a5 46 lda temp5 2429 87e2 69 08 adc #WZONEHEIGHT 2430 87e4 85 46 sta temp5 2431 87e6 20 9b f2 jsr plotsprite 2432 87e9 .L0233 ;; plotsprite vertical_shooting_1up 0 extra_shipX extra_shipY 2433 87e9 2434 87e9 a9 39 lda #vertical_shooting_1up 2438 87ef 85 43 sta temp2 2439 87f1 2440 87f1 a9 1e lda #(0|vertical_shooting_1up_width_twoscompliment) 2441 87f3 85 44 sta temp3 2442 87f5 2443 87f5 ad 60 01 lda extra_shipX 2444 87f8 85 45 sta temp4 2445 87fa 2446 87fa ad 61 01 lda extra_shipY 2447 87fd 2448 87fd 85 46 sta temp5 2449 87ff 2450 87ff a9 40 lda #(vertical_shooting_1up_mode|%01000000) 2451 8801 85 47 sta temp6 2452 8803 2453 8803 20 9b f2 jsr plotsprite 2454 8806 .L0234 ;; plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 2455 8806 2456 8806 a9 3b lda #vertical_shooting_explosion_01 2468 8817 85 43 sta temp2 2469 8819 2470 8819 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2471 881b 85 44 sta temp3 2472 881d 2473 881d ad 41 01 lda playerX 2474 8820 85 45 sta temp4 2475 8822 2476 8822 ad 42 01 lda playerY 2477 8825 85 46 sta temp5 2478 8827 2479 8827 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2480 8829 85 47 sta temp6 2481 882b 2482 882b 20 9b f2 jsr plotsprite 2483 882e ; +tall sprite replot 2484 882e 18 clc 2485 882f a5 42 lda temp1 2486 8831 69 02 adc #vertical_shooting_explosion_01_width 2487 8833 85 42 sta temp1 2488 8835 a5 46 lda temp5 2489 8837 69 08 adc #WZONEHEIGHT 2490 8839 85 46 sta temp5 2491 883b 20 9b f2 jsr plotsprite 2492 883e .L0235 ;; plotsprite vertical_shooting_explosion_01 3 enemy01_X enemy01_Y explosion_aniframe 2493 883e 2494 883e a9 3b lda #vertical_shooting_explosion_01 2506 884f 85 43 sta temp2 2507 8851 2508 8851 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2509 8853 85 44 sta temp3 2510 8855 2511 8855 ad 57 01 lda enemy01_X 2512 8858 85 45 sta temp4 2513 885a 2514 885a ad 58 01 lda enemy01_Y 2515 885d 85 46 sta temp5 2516 885f 2517 885f a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2518 8861 85 47 sta temp6 2519 8863 2520 8863 20 9b f2 jsr plotsprite 2521 8866 ; +tall sprite replot 2522 8866 18 clc 2523 8867 a5 42 lda temp1 2524 8869 69 02 adc #vertical_shooting_explosion_01_width 2525 886b 85 42 sta temp1 2526 886d a5 46 lda temp5 2527 886f 69 08 adc #WZONEHEIGHT 2528 8871 85 46 sta temp5 2529 8873 20 9b f2 jsr plotsprite 2530 8876 .L0236 ;; plotsprite vertical_shooting_laser 0 twinlaserX twinlaserY 2531 8876 2532 8876 a9 f3 lda #vertical_shooting_laser 2536 887c 85 43 sta temp2 2537 887e 2538 887e a9 1f lda #(0|vertical_shooting_laser_width_twoscompliment) 2539 8880 85 44 sta temp3 2540 8882 2541 8882 ad 65 01 lda twinlaserX 2542 8885 85 45 sta temp4 2543 8887 2544 8887 ad 66 01 lda twinlaserY 2545 888a 2546 888a 85 46 sta temp5 2547 888c 2548 888c a9 40 lda #(vertical_shooting_laser_mode|%01000000) 2549 888e 85 47 sta temp6 2550 8890 2551 8890 20 9b f2 jsr plotsprite 2552 8893 ; +tall sprite replot 2553 8893 18 clc 2554 8894 a5 42 lda temp1 2555 8896 69 01 adc #vertical_shooting_laser_width 2556 8898 85 42 sta temp1 2557 889a a5 46 lda temp5 2558 889c 69 08 adc #WZONEHEIGHT 2559 889e 85 46 sta temp5 2560 88a0 20 9b f2 jsr plotsprite 2561 88a3 .L0237 ;; if playerFlag = 1 then plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 2562 88a3 2563 88a3 ad 4d 01 LDA playerFlag 2564 88a6 c9 01 CMP #1 2565 88a8 d0 38 BNE .skipL0237 2566 88aa .condpart82 2567 88aa a9 3b lda #vertical_shooting_explosion_01 2579 88bb 85 43 sta temp2 2580 88bd 2581 88bd a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2582 88bf 85 44 sta temp3 2583 88c1 2584 88c1 ad 41 01 lda playerX 2585 88c4 85 45 sta temp4 2586 88c6 2587 88c6 ad 42 01 lda playerY 2588 88c9 85 46 sta temp5 2589 88cb 2590 88cb a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2591 88cd 85 47 sta temp6 2592 88cf 2593 88cf 20 9b f2 jsr plotsprite 2594 88d2 ; +tall sprite replot 2595 88d2 18 clc 2596 88d3 a5 42 lda temp1 2597 88d5 69 02 adc #vertical_shooting_explosion_01_width 2598 88d7 85 42 sta temp1 2599 88d9 a5 46 lda temp5 2600 88db 69 08 adc #WZONEHEIGHT 2601 88dd 85 46 sta temp5 2602 88df 20 9b f2 jsr plotsprite 2603 88e2 .skipL0237 2604 88e2 .L0238 ;; if enemy01_Flag = 1 then plotsprite vertical_shooting_explosion_01 3 enemy01_X enemy01_Y explosion_aniframe 2605 88e2 2606 88e2 ad 59 01 LDA enemy01_Flag 2607 88e5 c9 01 CMP #1 2608 88e7 d0 38 BNE .skipL0238 2609 88e9 .condpart83 2610 88e9 a9 3b lda #vertical_shooting_explosion_01 2622 88fa 85 43 sta temp2 2623 88fc 2624 88fc a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2625 88fe 85 44 sta temp3 2626 8900 2627 8900 ad 57 01 lda enemy01_X 2628 8903 85 45 sta temp4 2629 8905 2630 8905 ad 58 01 lda enemy01_Y 2631 8908 85 46 sta temp5 2632 890a 2633 890a a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2634 890c 85 47 sta temp6 2635 890e 2636 890e 20 9b f2 jsr plotsprite 2637 8911 ; +tall sprite replot 2638 8911 18 clc 2639 8912 a5 42 lda temp1 2640 8914 69 02 adc #vertical_shooting_explosion_01_width 2641 8916 85 42 sta temp1 2642 8918 a5 46 lda temp5 2643 891a 69 08 adc #WZONEHEIGHT 2644 891c 85 46 sta temp5 2645 891e 20 9b f2 jsr plotsprite 2646 8921 .skipL0238 2647 8921 .L0239 ;; return 2648 8921 2649 8921 ba tsx 2650 8922 bd 02 01 lda $102,x 2651 8925 f0 01 beq bankswitchret5 2652 8927 60 RTS 2653 8928 bankswitchret5 2654 8928 4c 7a f4 JMP BS_return 2655 892b . 2656 892b ;; 2657 892b 2658 892b .draw_scores 2659 892b ;; draw_scores 2660 892b 2661 892b .L0240 ;; plotvalue vertical_shooting_font 0 score0 6 25 1 2662 892b 2663 892b a9 00 lda #vertical_shooting_font 2667 8931 85 43 sta temp2 2668 8933 2669 8933 ad 06 21 lda charactermode 2670 8936 85 4a sta temp9 2671 8938 a9 60 lda #(vertical_shooting_font_mode | %01100000) 2672 893a 8d 06 21 sta charactermode 2673 893d a9 1a lda #26 ; width in two's complement 2674 893f 09 00 ora #0 ; palette left shifted 5 bits 2675 8941 85 44 sta temp3 2676 8943 a9 19 lda #25 2677 8945 85 45 sta temp4 2678 8947 2679 8947 a9 01 lda #1 2680 8949 85 46 sta temp5 2681 894b 2682 894b a9 06 lda #6 2683 894d 85 47 sta temp6 2684 894f 2685 894f a9 a6 lda #score0 2689 8955 85 49 sta temp8 2690 8957 2691 8957 20 89 f3 jsr plotvalue 2692 8957 00 01 USED_PLOTVALUE = 1 2693 895a a5 4a lda temp9 2694 895c 8d 06 21 sta charactermode 2695 895f .L0241 ;; plotvalue vertical_shooting_font 0 lives 1 153 1 2696 895f 2697 895f a9 00 lda #vertical_shooting_font 2701 8965 85 43 sta temp2 2702 8967 2703 8967 ad 06 21 lda charactermode 2704 896a 85 4a sta temp9 2705 896c a9 60 lda #(vertical_shooting_font_mode | %01100000) 2706 896e 8d 06 21 sta charactermode 2707 8971 a9 1f lda #31 ; width in two's complement 2708 8973 09 00 ora #0 ; palette left shifted 5 bits 2709 8975 85 44 sta temp3 2710 8977 a9 99 lda #153 2711 8979 85 45 sta temp4 2712 897b 2713 897b a9 01 lda #1 2714 897d 85 46 sta temp5 2715 897f 2716 897f a9 01 lda #1 2717 8981 85 47 sta temp6 2718 8983 2719 8983 a9 64 lda #lives 2723 8989 85 49 sta temp8 2724 898b 2725 898b 20 89 f3 jsr plotvalue 2726 898b 00 01 USED_PLOTVALUE = 1 2727 898e a5 4a lda temp9 2728 8990 8d 06 21 sta charactermode 2729 8993 .L0242 ;; return 2730 8993 2731 8993 ba tsx 2732 8994 bd 02 01 lda $102,x 2733 8997 f0 01 beq bankswitchret6 2734 8999 60 RTS 2735 899a bankswitchret6 2736 899a 4c 7a f4 JMP BS_return 2737 899d . 2738 899d ;; 2739 899d 2740 899d .check_collisions 2741 899d ;; check_collisions 2742 899d 2743 899d .L0243 ;; if boxcollision ( playerX , playerY , 8 , 16 , enemy_shotX , enemy_shotY , 4 , 8 ) then enemy_shotX = 200 : enemy_shotY = 200 : playerFlag = 1 : lives = lives - 0 : playsfx sfx_explosion : isDead_flag = 1 : goto _checkCollisionsExit 2744 899d 2745 899d 2746 899d 18 clc ; one clc only. If we overflow we're screwed anyway. 2747 899e a0 07 ldy #(8-1) 2748 89a0 84 44 sty temp3 2749 89a2 a0 0f ldy #(16-1) 2750 89a4 84 45 sty temp4 2751 89a6 ad 4a 01 lda enemy_shotX 2752 89a9 69 30 adc #48 2753 89ab 85 46 sta temp5 2754 89ad ad 4b 01 lda enemy_shotY 2755 89b0 69 20 adc #((256-WSCREENHEIGHT)/2) 2756 89b2 85 47 sta temp6 2757 89b4 a0 03 ldy #(4-1) 2758 89b6 84 48 sty temp7 2759 89b8 a0 07 ldy #(8-1) 2760 89ba 84 49 sty temp8 2761 89bc ad 42 01 lda playerY 2762 89bf 69 20 adc #((256-WSCREENHEIGHT)/2) 2763 89c1 a8 tay 2764 89c2 ad 41 01 lda playerX 2765 89c5 69 30 adc #48 2766 89c7 20 d1 f3 jsr boxcollision 2767 89ca 2768 89ca 90 37 BCC .skipL0243 2769 89cc .condpart84 2770 89cc a9 c8 LDA #200 2771 89ce 8d 4a 01 STA enemy_shotX 2772 89d1 8d 4b 01 STA enemy_shotY 2773 89d4 a9 01 LDA #1 2774 89d6 8d 4d 01 STA playerFlag 2775 89d9 ad 64 01 LDA lives 2776 89dc 38 SEC 2777 89dd e9 00 SBC #0 2778 89df 8d 64 01 STA lives 2779 89e2 ifnconst NOTIALOCKMUTE 2780 89e2 a9 01 lda #1 2781 89e4 85 de sta sfxschedulelock 2782 89e6 a9 84 lda #sfx_explosion 2785 89ec 85 e1 sta sfxinstrumenthi 2786 89ee a9 00 lda #0 2787 89f0 85 e2 sta sfxpitchoffset ; no pitch modification 2788 89f2 85 e3 sta sfxnoteindex ; not a musical note 2789 89f4 20 53 f2 jsr schedulesfx 2790 89f7 a9 00 lda #0 2791 89f9 85 de sta sfxschedulelock 2792 89fb endif ; NOTIALOCKMUTE 2793 89fb a9 01 LDA #1 2794 89fd 8d 6a 01 STA isDead_flag 2795 8a00 4c db 8c jmp ._checkCollisionsExit 2796 8a03 2797 8a03 .skipL0243 2798 8a03 .L0244 ;; if boxcollision ( playerX , playerY , 8 , 16 , power_upX , power_upY , 8 , 8 ) then power_upX = 208 : power_upY = 208 : playerFlag = 1 : power_upFlag = 1 : playsfx sfx_bling : score0 = score0 + 1 : gosub power_up_obtained 2799 8a03 2800 8a03 2801 8a03 18 clc ; one clc only. If we overflow we're screwed anyway. 2802 8a04 a0 07 ldy #(8-1) 2803 8a06 84 44 sty temp3 2804 8a08 a0 0f ldy #(16-1) 2805 8a0a 84 45 sty temp4 2806 8a0c ad 50 01 lda power_upX 2807 8a0f 69 30 adc #48 2808 8a11 85 46 sta temp5 2809 8a13 ad 51 01 lda power_upY 2810 8a16 69 20 adc #((256-WSCREENHEIGHT)/2) 2811 8a18 85 47 sta temp6 2812 8a1a a0 07 ldy #(8-1) 2813 8a1c 84 48 sty temp7 2814 8a1e a0 07 ldy #(8-1) 2815 8a20 84 49 sty temp8 2816 8a22 ad 42 01 lda playerY 2817 8a25 69 20 adc #((256-WSCREENHEIGHT)/2) 2818 8a27 a8 tay 2819 8a28 ad 41 01 lda playerX 2820 8a2b 69 30 adc #48 2821 8a2d 20 d1 f3 jsr boxcollision 2822 8a30 2823 8a30 90 47 BCC .skipL0244 2824 8a32 .condpart85 2825 8a32 a9 d0 LDA #208 2826 8a34 8d 50 01 STA power_upX 2827 8a37 8d 51 01 STA power_upY 2828 8a3a a9 01 LDA #1 2829 8a3c 8d 4d 01 STA playerFlag 2830 8a3f 8d 52 01 STA power_upFlag 2831 8a42 ifnconst NOTIALOCKMUTE 2832 8a42 a9 01 lda #1 2833 8a44 85 de sta sfxschedulelock 2834 8a46 a9 c1 lda #sfx_bling 2837 8a4c 85 e1 sta sfxinstrumenthi 2838 8a4e a9 00 lda #0 2839 8a50 85 e2 sta sfxpitchoffset ; no pitch modification 2840 8a52 85 e3 sta sfxnoteindex ; not a musical note 2841 8a54 20 53 f2 jsr schedulesfx 2842 8a57 a9 00 lda #0 2843 8a59 85 de sta sfxschedulelock 2844 8a5b endif ; NOTIALOCKMUTE 2845 8a5b f8 SED 2846 8a5c 18 CLC 2847 8a5d ad a8 01 LDA score0+2 2848 8a60 69 01 ADC #$01 2849 8a62 8d a8 01 STA score0+2 2850 8a65 ad a7 01 LDA score0+1 2851 8a68 69 00 ADC #$00 2852 8a6a 8d a7 01 STA score0+1 2853 8a6d ad a6 01 LDA score0 2854 8a70 69 00 ADC #$00 2855 8a72 8d a6 01 STA score0 2856 8a75 d8 CLD 2857 8a76 20 e5 8c jsr .power_up_obtained 2858 8a79 2859 8a79 .skipL0244 2860 8a79 .L0245 ;; if boxcollision ( playerX , playerY , 8 , 16 , enemy01_X , enemy01_Y , 8 , 16 ) then enemy01_X = 200 : enemy01_Y = 200 : playerFlag = 1 : lives = lives - 0 : playsfx sfx_explosion : isDead_flag = 1 : goto _checkCollisionsExit 2861 8a79 2862 8a79 2863 8a79 18 clc ; one clc only. If we overflow we're screwed anyway. 2864 8a7a a0 07 ldy #(8-1) 2865 8a7c 84 44 sty temp3 2866 8a7e a0 0f ldy #(16-1) 2867 8a80 84 45 sty temp4 2868 8a82 ad 57 01 lda enemy01_X 2869 8a85 69 30 adc #48 2870 8a87 85 46 sta temp5 2871 8a89 ad 58 01 lda enemy01_Y 2872 8a8c 69 20 adc #((256-WSCREENHEIGHT)/2) 2873 8a8e 85 47 sta temp6 2874 8a90 a0 07 ldy #(8-1) 2875 8a92 84 48 sty temp7 2876 8a94 a0 0f ldy #(16-1) 2877 8a96 84 49 sty temp8 2878 8a98 ad 42 01 lda playerY 2879 8a9b 69 20 adc #((256-WSCREENHEIGHT)/2) 2880 8a9d a8 tay 2881 8a9e ad 41 01 lda playerX 2882 8aa1 69 30 adc #48 2883 8aa3 20 d1 f3 jsr boxcollision 2884 8aa6 2885 8aa6 90 37 BCC .skipL0245 2886 8aa8 .condpart86 2887 8aa8 a9 c8 LDA #200 2888 8aaa 8d 57 01 STA enemy01_X 2889 8aad 8d 58 01 STA enemy01_Y 2890 8ab0 a9 01 LDA #1 2891 8ab2 8d 4d 01 STA playerFlag 2892 8ab5 ad 64 01 LDA lives 2893 8ab8 38 SEC 2894 8ab9 e9 00 SBC #0 2895 8abb 8d 64 01 STA lives 2896 8abe ifnconst NOTIALOCKMUTE 2897 8abe a9 01 lda #1 2898 8ac0 85 de sta sfxschedulelock 2899 8ac2 a9 84 lda #sfx_explosion 2902 8ac8 85 e1 sta sfxinstrumenthi 2903 8aca a9 00 lda #0 2904 8acc 85 e2 sta sfxpitchoffset ; no pitch modification 2905 8ace 85 e3 sta sfxnoteindex ; not a musical note 2906 8ad0 20 53 f2 jsr schedulesfx 2907 8ad3 a9 00 lda #0 2908 8ad5 85 de sta sfxschedulelock 2909 8ad7 endif ; NOTIALOCKMUTE 2910 8ad7 a9 01 LDA #1 2911 8ad9 8d 6a 01 STA isDead_flag 2912 8adc 4c db 8c jmp ._checkCollisionsExit 2913 8adf 2914 8adf .skipL0245 2915 8adf .L0246 ;; if boxcollision ( playerX , playerY , 8 , 16 , extra_shipX , extra_shipY , 8 , 8 ) then extra_shipX = 200 : extra_shipY = 200 : extra_shipFlag = 1 : lives = lives + 1 : playsfx sfx_bling 2916 8adf 2917 8adf 2918 8adf 18 clc ; one clc only. If we overflow we're screwed anyway. 2919 8ae0 a0 07 ldy #(8-1) 2920 8ae2 84 44 sty temp3 2921 8ae4 a0 0f ldy #(16-1) 2922 8ae6 84 45 sty temp4 2923 8ae8 ad 60 01 lda extra_shipX 2924 8aeb 69 30 adc #48 2925 8aed 85 46 sta temp5 2926 8aef ad 61 01 lda extra_shipY 2927 8af2 69 20 adc #((256-WSCREENHEIGHT)/2) 2928 8af4 85 47 sta temp6 2929 8af6 a0 07 ldy #(8-1) 2930 8af8 84 48 sty temp7 2931 8afa a0 07 ldy #(8-1) 2932 8afc 84 49 sty temp8 2933 8afe ad 42 01 lda playerY 2934 8b01 69 20 adc #((256-WSCREENHEIGHT)/2) 2935 8b03 a8 tay 2936 8b04 ad 41 01 lda playerX 2937 8b07 69 30 adc #48 2938 8b09 20 d1 f3 jsr boxcollision 2939 8b0c 2940 8b0c 90 2f BCC .skipL0246 2941 8b0e .condpart87 2942 8b0e a9 c8 LDA #200 2943 8b10 8d 60 01 STA extra_shipX 2944 8b13 8d 61 01 STA extra_shipY 2945 8b16 a9 01 LDA #1 2946 8b18 8d 62 01 STA extra_shipFlag 2947 8b1b ad 64 01 LDA lives 2948 8b1e 18 CLC 2949 8b1f 69 01 ADC #1 2950 8b21 8d 64 01 STA lives 2951 8b24 ifnconst NOTIALOCKMUTE 2952 8b24 a9 01 lda #1 2953 8b26 85 de sta sfxschedulelock 2954 8b28 a9 c1 lda #sfx_bling 2957 8b2e 85 e1 sta sfxinstrumenthi 2958 8b30 a9 00 lda #0 2959 8b32 85 e2 sta sfxpitchoffset ; no pitch modification 2960 8b34 85 e3 sta sfxnoteindex ; not a musical note 2961 8b36 20 53 f2 jsr schedulesfx 2962 8b39 a9 00 lda #0 2963 8b3b 85 de sta sfxschedulelock 2964 8b3d endif ; NOTIALOCKMUTE 2965 8b3d .skipL0246 2966 8b3d .L0247 ;; if boxcollision ( bulletX , bulletY , 4 , 8 , enemy01_X , enemy01_Y , 8 , 16 ) then bulletX = - 8 : bulletY = 0 : enemy01_X = 208 : enemy01_Y = 200 : enemy01_Flag = 1 : playsfx sfx_explosion 2967 8b3d 2968 8b3d 2969 8b3d 18 clc ; one clc only. If we overflow we're screwed anyway. 2970 8b3e a0 03 ldy #(4-1) 2971 8b40 84 44 sty temp3 2972 8b42 a0 07 ldy #(8-1) 2973 8b44 84 45 sty temp4 2974 8b46 ad 57 01 lda enemy01_X 2975 8b49 69 30 adc #48 2976 8b4b 85 46 sta temp5 2977 8b4d ad 58 01 lda enemy01_Y 2978 8b50 69 20 adc #((256-WSCREENHEIGHT)/2) 2979 8b52 85 47 sta temp6 2980 8b54 a0 07 ldy #(8-1) 2981 8b56 84 48 sty temp7 2982 8b58 a0 0f ldy #(16-1) 2983 8b5a 84 49 sty temp8 2984 8b5c ad 49 01 lda bulletY 2985 8b5f 69 20 adc #((256-WSCREENHEIGHT)/2) 2986 8b61 a8 tay 2987 8b62 ad 48 01 lda bulletX 2988 8b65 69 30 adc #48 2989 8b67 20 d1 f3 jsr boxcollision 2990 8b6a 2991 8b6a 90 32 BCC .skipL0247 2992 8b6c .condpart88 2993 8b6c a9 f8 LDA #248 2994 8b6e 8d 48 01 STA bulletX 2995 8b71 a9 00 LDA #0 2996 8b73 8d 49 01 STA bulletY 2997 8b76 a9 d0 LDA #208 2998 8b78 8d 57 01 STA enemy01_X 2999 8b7b a9 c8 LDA #200 3000 8b7d 8d 58 01 STA enemy01_Y 3001 8b80 a9 01 LDA #1 3002 8b82 8d 59 01 STA enemy01_Flag 3003 8b85 ifnconst NOTIALOCKMUTE 3004 8b85 a9 01 lda #1 3005 8b87 85 de sta sfxschedulelock 3006 8b89 a9 84 lda #sfx_explosion 3009 8b8f 85 e1 sta sfxinstrumenthi 3010 8b91 a9 00 lda #0 3011 8b93 85 e2 sta sfxpitchoffset ; no pitch modification 3012 8b95 85 e3 sta sfxnoteindex ; not a musical note 3013 8b97 20 53 f2 jsr schedulesfx 3014 8b9a a9 00 lda #0 3015 8b9c 85 de sta sfxschedulelock 3016 8b9e endif ; NOTIALOCKMUTE 3017 8b9e .skipL0247 3018 8b9e .L0248 ;; if boxcollision ( twinlaserX , twinlaserY , 4 , 16 , enemy01_X , enemy01_Y , 8 , 16 ) then twinlaserX = - 8 : twinlaserY = 0 : enemy01_X = 208 : enemy01_Y = 200 : enemy01_Flag = 1 : playsfx sfx_explosion 3019 8b9e 3020 8b9e 3021 8b9e 18 clc ; one clc only. If we overflow we're screwed anyway. 3022 8b9f a0 03 ldy #(4-1) 3023 8ba1 84 44 sty temp3 3024 8ba3 a0 0f ldy #(16-1) 3025 8ba5 84 45 sty temp4 3026 8ba7 ad 57 01 lda enemy01_X 3027 8baa 69 30 adc #48 3028 8bac 85 46 sta temp5 3029 8bae ad 58 01 lda enemy01_Y 3030 8bb1 69 20 adc #((256-WSCREENHEIGHT)/2) 3031 8bb3 85 47 sta temp6 3032 8bb5 a0 07 ldy #(8-1) 3033 8bb7 84 48 sty temp7 3034 8bb9 a0 0f ldy #(16-1) 3035 8bbb 84 49 sty temp8 3036 8bbd ad 66 01 lda twinlaserY 3037 8bc0 69 20 adc #((256-WSCREENHEIGHT)/2) 3038 8bc2 a8 tay 3039 8bc3 ad 65 01 lda twinlaserX 3040 8bc6 69 30 adc #48 3041 8bc8 20 d1 f3 jsr boxcollision 3042 8bcb 3043 8bcb 90 32 BCC .skipL0248 3044 8bcd .condpart89 3045 8bcd a9 f8 LDA #248 3046 8bcf 8d 65 01 STA twinlaserX 3047 8bd2 a9 00 LDA #0 3048 8bd4 8d 66 01 STA twinlaserY 3049 8bd7 a9 d0 LDA #208 3050 8bd9 8d 57 01 STA enemy01_X 3051 8bdc a9 c8 LDA #200 3052 8bde 8d 58 01 STA enemy01_Y 3053 8be1 a9 01 LDA #1 3054 8be3 8d 59 01 STA enemy01_Flag 3055 8be6 ifnconst NOTIALOCKMUTE 3056 8be6 a9 01 lda #1 3057 8be8 85 de sta sfxschedulelock 3058 8bea a9 84 lda #sfx_explosion 3061 8bf0 85 e1 sta sfxinstrumenthi 3062 8bf2 a9 00 lda #0 3063 8bf4 85 e2 sta sfxpitchoffset ; no pitch modification 3064 8bf6 85 e3 sta sfxnoteindex ; not a musical note 3065 8bf8 20 53 f2 jsr schedulesfx 3066 8bfb a9 00 lda #0 3067 8bfd 85 de sta sfxschedulelock 3068 8bff endif ; NOTIALOCKMUTE 3069 8bff .skipL0248 3070 8bff .L0249 ;; if bulletX > enemy01_X && bulletX < ( enemy01_X + 16 ) && bulletY > enemy01_Y && bulletY < ( enemy01_Y + 16 ) then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion 3071 8bff 3072 8bff ad 57 01 LDA enemy01_X 3073 8c02 cd 48 01 CMP bulletX 3074 8c05 b0 66 BCS .skipL0249 3075 8c07 .condpart90 3076 8c07 ; complex condition detected 3077 8c07 ; complex statement detected 3078 8c07 ad 57 01 LDA enemy01_X 3079 8c0a 18 CLC 3080 8c0b 69 10 ADC #16 3081 8c0d 48 PHA 3082 8c0e ba TSX 3083 8c0f 68 PLA 3084 8c10 ad 48 01 LDA bulletX 3085 8c13 dd 01 01 CMP $101,x 3086 8c16 b0 55 BCS .skip90then 3087 8c18 .condpart91 3088 8c18 ad 58 01 LDA enemy01_Y 3089 8c1b cd 49 01 CMP bulletY 3090 8c1e b0 4d BCS .skip91then 3091 8c20 .condpart92 3092 8c20 ; complex condition detected 3093 8c20 ; complex statement detected 3094 8c20 ad 58 01 LDA enemy01_Y 3095 8c23 18 CLC 3096 8c24 69 10 ADC #16 3097 8c26 48 PHA 3098 8c27 ba TSX 3099 8c28 68 PLA 3100 8c29 ad 49 01 LDA bulletY 3101 8c2c dd 01 01 CMP $101,x 3102 8c2f b0 3c BCS .skip92then 3103 8c31 .condpart93 3104 8c31 a9 01 LDA #1 3105 8c33 8d 59 01 STA enemy01_Flag 3106 8c36 8d 63 01 STA explosion_aniframe 3107 8c39 f8 SED 3108 8c3a 18 CLC 3109 8c3b ad a8 01 LDA score0+2 3110 8c3e 69 01 ADC #$01 3111 8c40 8d a8 01 STA score0+2 3112 8c43 ad a7 01 LDA score0+1 3113 8c46 69 00 ADC #$00 3114 8c48 8d a7 01 STA score0+1 3115 8c4b ad a6 01 LDA score0 3116 8c4e 69 00 ADC #$00 3117 8c50 8d a6 01 STA score0 3118 8c53 d8 CLD 3119 8c54 ifnconst NOTIALOCKMUTE 3120 8c54 a9 01 lda #1 3121 8c56 85 de sta sfxschedulelock 3122 8c58 a9 84 lda #sfx_explosion 3125 8c5e 85 e1 sta sfxinstrumenthi 3126 8c60 a9 00 lda #0 3127 8c62 85 e2 sta sfxpitchoffset ; no pitch modification 3128 8c64 85 e3 sta sfxnoteindex ; not a musical note 3129 8c66 20 53 f2 jsr schedulesfx 3130 8c69 a9 00 lda #0 3131 8c6b 85 de sta sfxschedulelock 3132 8c6d endif ; NOTIALOCKMUTE 3133 8c6d .skip92then 3134 8c6d .skip91then 3135 8c6d .skip90then 3136 8c6d .skipL0249 3137 8c6d .L0250 ;; if twinlaserX > enemy01_X && twinlaserX < ( enemy01_X + 16 ) && twinlaserY > enemy01_Y && twinlaserY < ( enemy01_Y + 16 ) then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion 3138 8c6d 3139 8c6d ad 57 01 LDA enemy01_X 3140 8c70 cd 65 01 CMP twinlaserX 3141 8c73 b0 66 BCS .skipL0250 3142 8c75 .condpart94 3143 8c75 ; complex condition detected 3144 8c75 ; complex statement detected 3145 8c75 ad 57 01 LDA enemy01_X 3146 8c78 18 CLC 3147 8c79 69 10 ADC #16 3148 8c7b 48 PHA 3149 8c7c ba TSX 3150 8c7d 68 PLA 3151 8c7e ad 65 01 LDA twinlaserX 3152 8c81 dd 01 01 CMP $101,x 3153 8c84 b0 55 BCS .skip94then 3154 8c86 .condpart95 3155 8c86 ad 58 01 LDA enemy01_Y 3156 8c89 cd 66 01 CMP twinlaserY 3157 8c8c b0 4d BCS .skip95then 3158 8c8e .condpart96 3159 8c8e ; complex condition detected 3160 8c8e ; complex statement detected 3161 8c8e ad 58 01 LDA enemy01_Y 3162 8c91 18 CLC 3163 8c92 69 10 ADC #16 3164 8c94 48 PHA 3165 8c95 ba TSX 3166 8c96 68 PLA 3167 8c97 ad 66 01 LDA twinlaserY 3168 8c9a dd 01 01 CMP $101,x 3169 8c9d b0 3c BCS .skip96then 3170 8c9f .condpart97 3171 8c9f a9 01 LDA #1 3172 8ca1 8d 59 01 STA enemy01_Flag 3173 8ca4 8d 63 01 STA explosion_aniframe 3174 8ca7 f8 SED 3175 8ca8 18 CLC 3176 8ca9 ad a8 01 LDA score0+2 3177 8cac 69 01 ADC #$01 3178 8cae 8d a8 01 STA score0+2 3179 8cb1 ad a7 01 LDA score0+1 3180 8cb4 69 00 ADC #$00 3181 8cb6 8d a7 01 STA score0+1 3182 8cb9 ad a6 01 LDA score0 3183 8cbc 69 00 ADC #$00 3184 8cbe 8d a6 01 STA score0 3185 8cc1 d8 CLD 3186 8cc2 ifnconst NOTIALOCKMUTE 3187 8cc2 a9 01 lda #1 3188 8cc4 85 de sta sfxschedulelock 3189 8cc6 a9 84 lda #sfx_explosion 3192 8ccc 85 e1 sta sfxinstrumenthi 3193 8cce a9 00 lda #0 3194 8cd0 85 e2 sta sfxpitchoffset ; no pitch modification 3195 8cd2 85 e3 sta sfxnoteindex ; not a musical note 3196 8cd4 20 53 f2 jsr schedulesfx 3197 8cd7 a9 00 lda #0 3198 8cd9 85 de sta sfxschedulelock 3199 8cdb endif ; NOTIALOCKMUTE 3200 8cdb .skip96then 3201 8cdb .skip95then 3202 8cdb .skip94then 3203 8cdb .skipL0250 3204 8cdb . 3205 8cdb ;; 3206 8cdb 3207 8cdb ._checkCollisionsExit 3208 8cdb ;; _checkCollisionsExit 3209 8cdb 3210 8cdb .L0251 ;; return 3211 8cdb 3212 8cdb ba tsx 3213 8cdc bd 02 01 lda $102,x 3214 8cdf f0 01 beq bankswitchret7 3215 8ce1 60 RTS 3216 8ce2 bankswitchret7 3217 8ce2 4c 7a f4 JMP BS_return 3218 8ce5 . 3219 8ce5 ;; 3220 8ce5 3221 8ce5 .power_up_obtained 3222 8ce5 ;; power_up_obtained 3223 8ce5 3224 8ce5 .L0252 ;; if power_upFlag = 1 then twinlaser_flag = 1 3225 8ce5 3226 8ce5 ad 52 01 LDA power_upFlag 3227 8ce8 c9 01 CMP #1 3228 8cea d0 05 BNE .skipL0252 3229 8cec .condpart98 3230 8cec a9 01 LDA #1 3231 8cee 8d 67 01 STA twinlaser_flag 3232 8cf1 .skipL0252 3233 8cf1 .L0253 ;; if joy0up && twinlaser_flag = 1 && joyposup = - 2 then gosub SetLaserHome 3234 8cf1 3235 8cf1 a9 10 lda #$10 3236 8cf3 2c 80 02 bit SWCHA 3237 8cf6 d0 17 BNE .skipL0253 3238 8cf8 .condpart99 3239 8cf8 ad 67 01 LDA twinlaser_flag 3240 8cfb c9 01 CMP #1 3241 8cfd d0 10 BNE .skip99then 3242 8cff .condpart100 3243 8cff ; complex condition detected 3244 8cff a9 fe LDA #254 3245 8d01 48 PHA 3246 8d02 ba TSX 3247 8d03 68 PLA 3248 8d04 ad 44 01 LDA joyposup 3249 8d07 dd 01 01 CMP $101,x 3250 8d0a d0 03 BNE .skip100then 3251 8d0c .condpart101 3252 8d0c 20 7a 8e jsr .SetLaserHome 3253 8d0f 3254 8d0f .skip100then 3255 8d0f .skip99then 3256 8d0f .skipL0253 3257 8d0f .L0254 ;; if joy0down && twinlaser_flag = 1 && joyposdown = - 2 then gosub SetLaserHome 3258 8d0f 3259 8d0f a9 20 lda #$20 3260 8d11 2c 80 02 bit SWCHA 3261 8d14 d0 17 BNE .skipL0254 3262 8d16 .condpart102 3263 8d16 ad 67 01 LDA twinlaser_flag 3264 8d19 c9 01 CMP #1 3265 8d1b d0 10 BNE .skip102then 3266 8d1d .condpart103 3267 8d1d ; complex condition detected 3268 8d1d a9 fe LDA #254 3269 8d1f 48 PHA 3270 8d20 ba TSX 3271 8d21 68 PLA 3272 8d22 ad 45 01 LDA joyposdown 3273 8d25 dd 01 01 CMP $101,x 3274 8d28 d0 03 BNE .skip103then 3275 8d2a .condpart104 3276 8d2a 20 7a 8e jsr .SetLaserHome 3277 8d2d 3278 8d2d .skip103then 3279 8d2d .skip102then 3280 8d2d .skipL0254 3281 8d2d .L0255 ;; if joy0up && twinlaser_flag = 1 && joyposleft = - 2 then gosub SetLaserHome 3282 8d2d 3283 8d2d a9 10 lda #$10 3284 8d2f 2c 80 02 bit SWCHA 3285 8d32 d0 17 BNE .skipL0255 3286 8d34 .condpart105 3287 8d34 ad 67 01 LDA twinlaser_flag 3288 8d37 c9 01 CMP #1 3289 8d39 d0 10 BNE .skip105then 3290 8d3b .condpart106 3291 8d3b ; complex condition detected 3292 8d3b a9 fe LDA #254 3293 8d3d 48 PHA 3294 8d3e ba TSX 3295 8d3f 68 PLA 3296 8d40 ad 46 01 LDA joyposleft 3297 8d43 dd 01 01 CMP $101,x 3298 8d46 d0 03 BNE .skip106then 3299 8d48 .condpart107 3300 8d48 20 7a 8e jsr .SetLaserHome 3301 8d4b 3302 8d4b .skip106then 3303 8d4b .skip105then 3304 8d4b .skipL0255 3305 8d4b .L0256 ;; if joy0down && twinlaser_flag = 1 && joyposright = - 2 then gosub SetLaserHome 3306 8d4b 3307 8d4b a9 20 lda #$20 3308 8d4d 2c 80 02 bit SWCHA 3309 8d50 d0 17 BNE .skipL0256 3310 8d52 .condpart108 3311 8d52 ad 67 01 LDA twinlaser_flag 3312 8d55 c9 01 CMP #1 3313 8d57 d0 10 BNE .skip108then 3314 8d59 .condpart109 3315 8d59 ; complex condition detected 3316 8d59 a9 fe LDA #254 3317 8d5b 48 PHA 3318 8d5c ba TSX 3319 8d5d 68 PLA 3320 8d5e ad 47 01 LDA joyposright 3321 8d61 dd 01 01 CMP $101,x 3322 8d64 d0 03 BNE .skip109then 3323 8d66 .condpart110 3324 8d66 20 7a 8e jsr .SetLaserHome 3325 8d69 3326 8d69 .skip109then 3327 8d69 .skip108then 3328 8d69 .skipL0256 3329 8d69 .L0257 ;; if joy0fire && twinlaser_flag = 1 && joyposup = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3330 8d69 3331 8d69 2c 02 21 bit sINPT1 3332 8d6c 10 30 BPL .skipL0257 3333 8d6e .condpart111 3334 8d6e ad 67 01 LDA twinlaser_flag 3335 8d71 c9 01 CMP #1 3336 8d73 d0 29 BNE .skip111then 3337 8d75 .condpart112 3338 8d75 ad 44 01 LDA joyposup 3339 8d78 c9 01 CMP #1 3340 8d7a d0 22 BNE .skip112then 3341 8d7c .condpart113 3342 8d7c ad 66 01 LDA twinlaserY 3343 8d7f 38 SEC 3344 8d80 e9 0a SBC #10 3345 8d82 8d 66 01 STA twinlaserY 3346 8d85 ifnconst NOTIALOCKMUTE 3347 8d85 a9 01 lda #1 3348 8d87 85 de sta sfxschedulelock 3349 8d89 a9 51 lda #sfx_plainlaser 3352 8d8f 85 e1 sta sfxinstrumenthi 3353 8d91 a9 00 lda #0 3354 8d93 85 e2 sta sfxpitchoffset ; no pitch modification 3355 8d95 85 e3 sta sfxnoteindex ; not a musical note 3356 8d97 20 53 f2 jsr schedulesfx 3357 8d9a a9 00 lda #0 3358 8d9c 85 de sta sfxschedulelock 3359 8d9e endif ; NOTIALOCKMUTE 3360 8d9e .skip112then 3361 8d9e .skip111then 3362 8d9e .skipL0257 3363 8d9e .L0258 ;; if joy0fire && twinlaser_flag = 1 && joyposdown = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3364 8d9e 3365 8d9e 2c 02 21 bit sINPT1 3366 8da1 10 30 BPL .skipL0258 3367 8da3 .condpart114 3368 8da3 ad 67 01 LDA twinlaser_flag 3369 8da6 c9 01 CMP #1 3370 8da8 d0 29 BNE .skip114then 3371 8daa .condpart115 3372 8daa ad 45 01 LDA joyposdown 3373 8dad c9 01 CMP #1 3374 8daf d0 22 BNE .skip115then 3375 8db1 .condpart116 3376 8db1 ad 66 01 LDA twinlaserY 3377 8db4 38 SEC 3378 8db5 e9 0a SBC #10 3379 8db7 8d 66 01 STA twinlaserY 3380 8dba ifnconst NOTIALOCKMUTE 3381 8dba a9 01 lda #1 3382 8dbc 85 de sta sfxschedulelock 3383 8dbe a9 51 lda #sfx_plainlaser 3386 8dc4 85 e1 sta sfxinstrumenthi 3387 8dc6 a9 00 lda #0 3388 8dc8 85 e2 sta sfxpitchoffset ; no pitch modification 3389 8dca 85 e3 sta sfxnoteindex ; not a musical note 3390 8dcc 20 53 f2 jsr schedulesfx 3391 8dcf a9 00 lda #0 3392 8dd1 85 de sta sfxschedulelock 3393 8dd3 endif ; NOTIALOCKMUTE 3394 8dd3 .skip115then 3395 8dd3 .skip114then 3396 8dd3 .skipL0258 3397 8dd3 .L0259 ;; if joy0fire && twinlaser_flag = 1 && joyposleft = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3398 8dd3 3399 8dd3 2c 02 21 bit sINPT1 3400 8dd6 10 30 BPL .skipL0259 3401 8dd8 .condpart117 3402 8dd8 ad 67 01 LDA twinlaser_flag 3403 8ddb c9 01 CMP #1 3404 8ddd d0 29 BNE .skip117then 3405 8ddf .condpart118 3406 8ddf ad 46 01 LDA joyposleft 3407 8de2 c9 01 CMP #1 3408 8de4 d0 22 BNE .skip118then 3409 8de6 .condpart119 3410 8de6 ad 66 01 LDA twinlaserY 3411 8de9 38 SEC 3412 8dea e9 0a SBC #10 3413 8dec 8d 66 01 STA twinlaserY 3414 8def ifnconst NOTIALOCKMUTE 3415 8def a9 01 lda #1 3416 8df1 85 de sta sfxschedulelock 3417 8df3 a9 51 lda #sfx_plainlaser 3420 8df9 85 e1 sta sfxinstrumenthi 3421 8dfb a9 00 lda #0 3422 8dfd 85 e2 sta sfxpitchoffset ; no pitch modification 3423 8dff 85 e3 sta sfxnoteindex ; not a musical note 3424 8e01 20 53 f2 jsr schedulesfx 3425 8e04 a9 00 lda #0 3426 8e06 85 de sta sfxschedulelock 3427 8e08 endif ; NOTIALOCKMUTE 3428 8e08 .skip118then 3429 8e08 .skip117then 3430 8e08 .skipL0259 3431 8e08 .L0260 ;; if joy0fire && twinlaser_flag = 1 && joyposright = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3432 8e08 3433 8e08 2c 02 21 bit sINPT1 3434 8e0b 10 30 BPL .skipL0260 3435 8e0d .condpart120 3436 8e0d ad 67 01 LDA twinlaser_flag 3437 8e10 c9 01 CMP #1 3438 8e12 d0 29 BNE .skip120then 3439 8e14 .condpart121 3440 8e14 ad 47 01 LDA joyposright 3441 8e17 c9 01 CMP #1 3442 8e19 d0 22 BNE .skip121then 3443 8e1b .condpart122 3444 8e1b ad 66 01 LDA twinlaserY 3445 8e1e 38 SEC 3446 8e1f e9 0a SBC #10 3447 8e21 8d 66 01 STA twinlaserY 3448 8e24 ifnconst NOTIALOCKMUTE 3449 8e24 a9 01 lda #1 3450 8e26 85 de sta sfxschedulelock 3451 8e28 a9 51 lda #sfx_plainlaser 3454 8e2e 85 e1 sta sfxinstrumenthi 3455 8e30 a9 00 lda #0 3456 8e32 85 e2 sta sfxpitchoffset ; no pitch modification 3457 8e34 85 e3 sta sfxnoteindex ; not a musical note 3458 8e36 20 53 f2 jsr schedulesfx 3459 8e39 a9 00 lda #0 3460 8e3b 85 de sta sfxschedulelock 3461 8e3d endif ; NOTIALOCKMUTE 3462 8e3d .skip121then 3463 8e3d .skip120then 3464 8e3d .skipL0260 3465 8e3d .L0261 ;; if !joy0fire then twinlaserX = playerX + 2 : twinlaserY = playerY - 8 3466 8e3d 3467 8e3d 2c 02 21 bit sINPT1 3468 8e40 30 12 BMI .skipL0261 3469 8e42 .condpart123 3470 8e42 ad 41 01 LDA playerX 3471 8e45 18 CLC 3472 8e46 69 02 ADC #2 3473 8e48 8d 65 01 STA twinlaserX 3474 8e4b ad 42 01 LDA playerY 3475 8e4e 38 SEC 3476 8e4f e9 08 SBC #8 3477 8e51 8d 66 01 STA twinlaserY 3478 8e54 .skipL0261 3479 8e54 .L0262 ;; return 3480 8e54 3481 8e54 ba tsx 3482 8e55 bd 02 01 lda $102,x 3483 8e58 f0 01 beq bankswitchret8 3484 8e5a 60 RTS 3485 8e5b bankswitchret8 3486 8e5b 4c 7a f4 JMP BS_return 3487 8e5e . 3488 8e5e ;; 3489 8e5e 3490 8e5e .SetBulletHome 3491 8e5e ;; SetBulletHome 3492 8e5e 3493 8e5e .L0263 ;; bulletX = playerX + 4 : bulletY = playerY - 2 3494 8e5e 3495 8e5e ad 41 01 LDA playerX 3496 8e61 18 CLC 3497 8e62 69 04 ADC #4 3498 8e64 8d 48 01 STA bulletX 3499 8e67 ad 42 01 LDA playerY 3500 8e6a 38 SEC 3501 8e6b e9 02 SBC #2 3502 8e6d 8d 49 01 STA bulletY 3503 8e70 .L0264 ;; return 3504 8e70 3505 8e70 ba tsx 3506 8e71 bd 02 01 lda $102,x 3507 8e74 f0 01 beq bankswitchret9 3508 8e76 60 RTS 3509 8e77 bankswitchret9 3510 8e77 4c 7a f4 JMP BS_return 3511 8e7a . 3512 8e7a ;; 3513 8e7a 3514 8e7a .SetLaserHome 3515 8e7a ;; SetLaserHome 3516 8e7a 3517 8e7a .L0265 ;; twinlaserX = playerX + 4 : twinlaserY = playerY - 2 3518 8e7a 3519 8e7a ad 41 01 LDA playerX 3520 8e7d 18 CLC 3521 8e7e 69 04 ADC #4 3522 8e80 8d 65 01 STA twinlaserX 3523 8e83 ad 42 01 LDA playerY 3524 8e86 38 SEC 3525 8e87 e9 02 SBC #2 3526 8e89 8d 66 01 STA twinlaserY 3527 8e8c .L0266 ;; return 3528 8e8c 3529 8e8c ba tsx 3530 8e8d bd 02 01 lda $102,x 3531 8e90 f0 01 beq bankswitchret10 3532 8e92 60 RTS 3533 8e93 bankswitchret10 3534 8e93 4c 7a f4 JMP BS_return 3535 8e96 . 3536 8e96 ;; 3537 8e96 3538 8e96 .lose_a_life 3539 8e96 ;; lose_a_life 3540 8e96 3541 8e96 .L0267 ;; lives = lives - 1 : isDead_flag = 0 3542 8e96 3543 8e96 ad 64 01 LDA lives 3544 8e99 38 SEC 3545 8e9a e9 01 SBC #1 3546 8e9c 8d 64 01 STA lives 3547 8e9f a9 00 LDA #0 3548 8ea1 8d 6a 01 STA isDead_flag 3549 8ea4 .L0268 ;; if enemy01_Flag <> 1 then enemy01_X = 32 : enemy01_Y = 0 3550 8ea4 3551 8ea4 ad 59 01 LDA enemy01_Flag 3552 8ea7 c9 01 CMP #1 3553 8ea9 f0 0a BEQ .skipL0268 3554 8eab .condpart124 3555 8eab a9 20 LDA #32 3556 8ead 8d 57 01 STA enemy01_X 3557 8eb0 a9 00 LDA #0 3558 8eb2 8d 58 01 STA enemy01_Y 3559 8eb5 .skipL0268 3560 8eb5 .L0269 ;; if enemy_shotFlag <> 1 then enemy_shotX = 0 : enemy_shotY = 0 3561 8eb5 3562 8eb5 ad 4c 01 LDA enemy_shotFlag 3563 8eb8 c9 01 CMP #1 3564 8eba f0 08 BEQ .skipL0269 3565 8ebc .condpart125 3566 8ebc a9 00 LDA #0 3567 8ebe 8d 4a 01 STA enemy_shotX 3568 8ec1 8d 4b 01 STA enemy_shotY 3569 8ec4 .skipL0269 3570 8ec4 .L0270 ;; if playerFlag = 1 && explosion_aniframe = 200 && lives > 0 then playerX = 80 : playerY = 144 : playerFlag = 0 : explosion_aniframe = 0 : twinlaser_flag = 0 : goto main 3571 8ec4 3572 8ec4 ad 4d 01 LDA playerFlag 3573 8ec7 c9 01 CMP #1 3574 8ec9 d0 26 BNE .skipL0270 3575 8ecb .condpart126 3576 8ecb ad 63 01 LDA explosion_aniframe 3577 8ece c9 c8 CMP #200 3578 8ed0 d0 1f BNE .skip126then 3579 8ed2 .condpart127 3580 8ed2 a9 00 LDA #0 3581 8ed4 cd 64 01 CMP lives 3582 8ed7 b0 18 BCS .skip127then 3583 8ed9 .condpart128 3584 8ed9 a9 50 LDA #80 3585 8edb 8d 41 01 STA playerX 3586 8ede a9 90 LDA #144 3587 8ee0 8d 42 01 STA playerY 3588 8ee3 a9 00 LDA #0 3589 8ee5 8d 4d 01 STA playerFlag 3590 8ee8 8d 63 01 STA explosion_aniframe 3591 8eeb 8d 67 01 STA twinlaser_flag 3592 8eee 4c ea 80 jmp .main 3593 8ef1 3594 8ef1 .skip127then 3595 8ef1 .skip126then 3596 8ef1 .skipL0270 3597 8ef1 .L0271 ;; joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 3598 8ef1 3599 8ef1 a9 00 LDA #0 3600 8ef3 8d 44 01 STA joyposup 3601 8ef6 8d 45 01 STA joyposdown 3602 8ef9 8d 46 01 STA joyposleft 3603 8efc 8d 47 01 STA joyposright 3604 8eff .L0272 ;; bulletX = 0 : bulletY = 0 3605 8eff 3606 8eff a9 00 LDA #0 3607 8f01 8d 48 01 STA bulletX 3608 8f04 8d 49 01 STA bulletY 3609 8f07 .L0273 ;; enemy01_X = 0 : enemy01_Y = 0 : enemy01_Flag = 0 3610 8f07 3611 8f07 a9 00 LDA #0 3612 8f09 8d 57 01 STA enemy01_X 3613 8f0c 8d 58 01 STA enemy01_Y 3614 8f0f 8d 59 01 STA enemy01_Flag 3615 8f12 .L0274 ;; playerFlag = 0 : gameover_flag = 0 3616 8f12 3617 8f12 a9 00 LDA #0 3618 8f14 8d 4d 01 STA playerFlag 3619 8f17 8d 5f 01 STA gameover_flag 3620 8f1a .L0275 ;; power_upFlag = 0 : twinlaser_flag = 0 3621 8f1a 3622 8f1a a9 00 LDA #0 3623 8f1c 8d 52 01 STA power_upFlag 3624 8f1f 8d 67 01 STA twinlaser_flag 3625 8f22 . 3626 8f22 ;; 3627 8f22 3628 8f22 .lose_a_lifeloop 3629 8f22 ;; lose_a_lifeloop 3630 8f22 3631 8f22 .L0276 ;; restorescreen 3632 8f22 3633 8f22 20 99 f0 jsr restorescreen 3634 8f25 .L0277 ;; gosub draw_scores 3635 8f25 3636 8f25 20 2b 89 jsr .draw_scores 3637 8f28 3638 8f28 .L0278 ;; drawscreen 3639 8f28 3640 8f28 20 bb f0 jsr drawscreen 3641 8f2b .L0279 ;; if joy0fire then fire_debounce = 2 3642 8f2b 3643 8f2b 2c 02 21 bit sINPT1 3644 8f2e 10 05 BPL .skipL0279 3645 8f30 .condpart129 3646 8f30 a9 02 LDA #2 3647 8f32 8d 43 01 STA fire_debounce 3648 8f35 .skipL0279 3649 8f35 .L0280 ;; if !joy0fire then fire_debounce = 1 3650 8f35 3651 8f35 2c 02 21 bit sINPT1 3652 8f38 30 05 BMI .skipL0280 3653 8f3a .condpart130 3654 8f3a a9 01 LDA #1 3655 8f3c 8d 43 01 STA fire_debounce 3656 8f3f .skipL0280 3657 8f3f .L0281 ;; if fire_debounce = 1 && lives > 0 then clearscreen : goto main 3658 8f3f 3659 8f3f ad 43 01 LDA fire_debounce 3660 8f42 c9 01 CMP #1 3661 8f44 d0 0d BNE .skipL0281 3662 8f46 .condpart131 3663 8f46 a9 00 LDA #0 3664 8f48 cd 64 01 CMP lives 3665 8f4b b0 06 BCS .skip131then 3666 8f4d .condpart132 3667 8f4d 20 87 f0 jsr clearscreen 3668 8f50 4c ea 80 jmp .main 3669 8f53 3670 8f53 .skip131then 3671 8f53 .skipL0281 3672 8f53 .L0282 ;; if fire_debounce = 1 && lives < 1 then clearscreen : goto gameover 3673 8f53 3674 8f53 ad 43 01 LDA fire_debounce 3675 8f56 c9 01 CMP #1 3676 8f58 d0 0d BNE .skipL0282 3677 8f5a .condpart133 3678 8f5a ad 64 01 LDA lives 3679 8f5d c9 01 CMP #1 3680 8f5f b0 06 BCS .skip133then 3681 8f61 .condpart134 3682 8f61 20 87 f0 jsr clearscreen 3683 8f64 4c 6a 8f jmp .gameover 3684 8f67 3685 8f67 .skip133then 3686 8f67 .skipL0282 3687 8f67 .L0283 ;; goto lose_a_lifeloop 3688 8f67 3689 8f67 4c 22 8f jmp .lose_a_lifeloop 3690 8f6a 3691 8f6a . 3692 8f6a ;; 3693 8f6a 3694 8f6a .gameover 3695 8f6a ;; gameover 3696 8f6a 3697 8f6a .L0284 ;; gameover_flag = 0 : fire_debounce = 1 3698 8f6a 3699 8f6a a9 00 LDA #0 3700 8f6c 8d 5f 01 STA gameover_flag 3701 8f6f a9 01 LDA #1 3702 8f71 8d 43 01 STA fire_debounce 3703 8f74 . 3704 8f74 ;; 3705 8f74 3706 8f74 .gameover_loop 3707 8f74 ;; gameover_loop 3708 8f74 3709 8f74 .L0285 ;; if lives = 0 then gameover_flag = 1 : clearscreen 3710 8f74 3711 8f74 ad 64 01 LDA lives 3712 8f77 c9 00 CMP #0 3713 8f79 d0 08 BNE .skipL0285 3714 8f7b .condpart135 3715 8f7b a9 01 LDA #1 3716 8f7d 8d 5f 01 STA gameover_flag 3717 8f80 20 87 f0 jsr clearscreen 3718 8f83 .skipL0285 3719 8f83 .L0286 ;; plotchars 'game^over!' 0 40 16 3720 8f83 3721 8f83 4c 90 8f JMP skipalphadata10 3722 8f86 alphadata10 3723 8f86 11 .byte.b (alphadata10 3738 8f96 85 43 sta temp2 3739 8f98 3740 8f98 a9 16 lda #22 ; width in two's complement 3741 8f9a 09 00 ora #0 ; palette left shifted 5 bits 3742 8f9c 85 44 sta temp3 3743 8f9e a9 28 lda #40 3744 8fa0 85 45 sta temp4 3745 8fa2 3746 8fa2 a9 10 lda #16 3747 8fa4 3748 8fa4 85 46 sta temp5 3749 8fa6 3750 8fa6 20 54 f3 jsr plotcharacters 3751 8fa9 .L0287 ;; if joy0fire && !fire_debounce then clearscreen : goto plot 3752 8fa9 3753 8fa9 2c 02 21 bit sINPT1 3754 8fac 10 0b BPL .skipL0287 3755 8fae .condpart136 3756 8fae ad 43 01 LDA fire_debounce 3757 8fb1 d0 06 BNE .skip136then 3758 8fb3 .condpart137 3759 8fb3 20 87 f0 jsr clearscreen 3760 8fb6 4c 43 80 jmp .plot 3761 8fb9 3762 8fb9 .skip136then 3763 8fb9 .skipL0287 3764 8fb9 .L0288 ;; goto gameover_loop 3765 8fb9 3766 8fb9 4c 74 8f jmp .gameover_loop 3767 8fbc 3768 8fbc . 3769 8fbc ;; 3770 8fbc 3771 8fbc . 3772 8fbc ;; 3773 8fbc 3774 8fbc . 3775 8fbc ;; 3776 8fbc 3777 8fbc . 3778 8fbc ;; 3779 8fbc 3780 8fbc . 3781 8fbc ;; 3782 8fbc 3783 8fbc . 3784 8fbc ;; 3785 8fbc 3786 8fbc . 3787 8fbc ;; 3788 8fbc 3789 8fbc . 3790 8fbc ;; 3791 8fbc 3792 8fbc . 3793 8fbc ;; 3794 8fbc 3795 8fbc . 3796 8fbc ;; 3797 8fbc 3798 8fbc . 3799 8fbc ;; 3800 8fbc 3801 8fbc . 3802 8fbc ;; 3803 8fbc 3804 8fbc . 3805 8fbc ;; 3806 8fbc 3807 8fbc . 3808 8fbc ;; 3809 8fbc 3810 8fbc . 3811 8fbc ;; 3812 8fbc 3813 8fbc .titlescreen 3814 8fbc ;; titlescreen 3815 8fbc 3816 8fbc .L0289 ;; plotchars 'new^vertical^shooting' 1 38 4 3817 8fbc 3818 8fbc 4c d4 8f JMP skipalphadata11 3819 8fbf alphadata11 3820 8fbf 18 .byte.b (alphadata11 3846 8fda 85 43 sta temp2 3847 8fdc 3848 8fdc a9 0b lda #11 ; width in two's complement 3849 8fde 09 20 ora #32 ; palette left shifted 5 bits 3850 8fe0 85 44 sta temp3 3851 8fe2 a9 26 lda #38 3852 8fe4 85 45 sta temp4 3853 8fe6 3854 8fe6 a9 04 lda #4 3855 8fe8 3856 8fe8 85 46 sta temp5 3857 8fea 3858 8fea 20 54 f3 jsr plotcharacters 3859 8fed .L0290 ;; plotchars 'demo' 1 72 5 3860 8fed 3861 8fed 4c f4 8f JMP skipalphadata12 3862 8ff0 alphadata12 3863 8ff0 0e .byte.b (alphadata12 3872 8ffa 85 43 sta temp2 3873 8ffc 3874 8ffc a9 1c lda #28 ; width in two's complement 3875 8ffe 09 20 ora #32 ; palette left shifted 5 bits 3876 9000 85 44 sta temp3 3877 9002 a9 48 lda #72 3878 9004 85 45 sta temp4 3879 9006 3880 9006 a9 05 lda #5 3881 9008 3882 9008 85 46 sta temp5 3883 900a 3884 900a 20 54 f3 jsr plotcharacters 3885 900d .L0291 ;; plotchars 'by^shane^skekel.' 1 48 7 3886 900d 3887 900d 4c 20 90 JMP skipalphadata13 3888 9010 alphadata13 3889 9010 0c .byte.b (alphadata13 3910 9026 85 43 sta temp2 3911 9028 3912 9028 a9 10 lda #16 ; width in two's complement 3913 902a 09 20 ora #32 ; palette left shifted 5 bits 3914 902c 85 44 sta temp3 3915 902e a9 30 lda #48 3916 9030 85 45 sta temp4 3917 9032 3918 9032 a9 07 lda #7 3919 9034 3920 9034 85 46 sta temp5 3921 9036 3922 9036 20 54 f3 jsr plotcharacters 3923 9039 .L0292 ;; plotchars 'push^fire^to^begin.' 2 42 16 3924 9039 3925 9039 4c 4f 90 JMP skipalphadata14 3926 903c alphadata14 3927 903c 1a .byte.b (alphadata14 3951 9055 85 43 sta temp2 3952 9057 3953 9057 a9 0d lda #13 ; width in two's complement 3954 9059 09 40 ora #64 ; palette left shifted 5 bits 3955 905b 85 44 sta temp3 3956 905d a9 2a lda #42 3957 905f 85 45 sta temp4 3958 9061 3959 9061 a9 10 lda #16 3960 9063 3961 9063 85 46 sta temp5 3962 9065 3963 9065 20 54 f3 jsr plotcharacters 3964 9068 .L0293 ;; savescreen 3965 9068 3966 9068 20 ab f0 jsr savescreen 3967 906b .L0294 ;; drawscreen 3968 906b 3969 906b 20 bb f0 jsr drawscreen 3970 906e .L0295 ;; fire_debounce = 1 3971 906e 3972 906e a9 01 LDA #1 3973 9070 8d 43 01 STA fire_debounce 3974 9073 . 3975 9073 ;; 3976 9073 3977 9073 .titlescreenloop 3978 9073 ;; titlescreenloop 3979 9073 3980 9073 .L0296 ;; restorescreen 3981 9073 3982 9073 20 99 f0 jsr restorescreen 3983 9076 .L0297 ;; if switchreset then reboot 3984 9076 3985 9076 20 8d f4 jsr checkresetswitch 3986 9079 d0 03 BNE .skipL0297 3987 907b .condpart138 3988 907b 4c 7a f5 JMP START 3989 907e .skipL0297 3990 907e .L0298 ;; if joy0fire then clearscreen : savescreen : lives = $04 : score0 = 0 : playsfx sfx_bling : goto main 3991 907e 3992 907e 2c 02 21 bit sINPT1 3993 9081 10 36 BPL .skipL0298 3994 9083 .condpart139 3995 9083 20 87 f0 jsr clearscreen 3996 9086 20 ab f0 jsr savescreen 3997 9089 a9 04 LDA #$04 3998 908b 8d 64 01 STA lives 3999 908e a9 00 LDA #$00 4000 9090 8d a8 01 STA score0+2 4001 9093 a9 00 LDA #$00 4002 9095 8d a7 01 STA score0+1 4003 9098 a9 00 LDA #$00 4004 909a 8d a6 01 STA score0 4005 909d ifnconst NOTIALOCKMUTE 4006 909d a9 01 lda #1 4007 909f 85 de sta sfxschedulelock 4008 90a1 a9 c1 lda #sfx_bling 4011 90a7 85 e1 sta sfxinstrumenthi 4012 90a9 a9 00 lda #0 4013 90ab 85 e2 sta sfxpitchoffset ; no pitch modification 4014 90ad 85 e3 sta sfxnoteindex ; not a musical note 4015 90af 20 53 f2 jsr schedulesfx 4016 90b2 a9 00 lda #0 4017 90b4 85 de sta sfxschedulelock 4018 90b6 endif ; NOTIALOCKMUTE 4019 90b6 4c ea 80 jmp .main 4020 90b9 4021 90b9 .skipL0298 4022 90b9 .L0299 ;; if !joy0fire then fire_debounce = 0 4023 90b9 4024 90b9 2c 02 21 bit sINPT1 4025 90bc 30 05 BMI .skipL0299 4026 90be .condpart140 4027 90be a9 00 LDA #0 4028 90c0 8d 43 01 STA fire_debounce 4029 90c3 .skipL0299 4030 90c3 .L0300 ;; drawscreen 4031 90c3 4032 90c3 20 bb f0 jsr drawscreen 4033 90c6 .L0301 ;; goto titlescreenloop 4034 90c6 4035 90c6 4c 73 90 jmp .titlescreenloop 4036 90c9 4037 90c9 . 4038 90c9 ;; 4039 90c9 4040 90c9 . 4041 90c9 ;; 4042 90c9 4043 90c9 .initialise_gamescreen 4044 90c9 ;; initialise_gamescreen 4045 90c9 4046 90c9 .L0302 ;; clearscreen 4047 90c9 4048 90c9 20 87 f0 jsr clearscreen 4049 90cc .L0303 ;; BACKGRND = $00 4050 90cc 4051 90cc a9 00 LDA #$00 4052 90ce 85 20 STA BACKGRND 4053 90d0 . 4054 90d0 ;; 4055 90d0 4056 90d0 .L0304 ;; savescreen 4057 90d0 4058 90d0 20 ab f0 jsr savescreen 4059 90d3 .L0305 ;; return 4060 90d3 4061 90d3 ba tsx 4062 90d4 bd 02 01 lda $102,x 4063 90d7 f0 01 beq bankswitchret16 4064 90d9 60 RTS 4065 90da bankswitchret16 4066 90da 4c 7a f4 JMP BS_return 4067 90dd . 4068 90dd ;; 4069 90dd 4070 90dd .fire_enemybullet 4071 90dd ;; fire_enemybullet 4072 90dd 4073 90dd . 4074 90dd ;; 4075 90dd 4076 90dd .L0306 ;; z = 15 4077 90dd 4078 90dd a9 0f LDA #15 4079 90df 85 ff STA z 4080 90e1 .check_enemyshot 4081 90e1 ;; check_enemyshot 4082 90e1 4083 90e1 . 4084 90e1 ;; 4085 90e1 4086 90e1 .L0307 ;; if enemy_shotFlag[z] = TRUE then goto skip_enemy_shot 4087 90e1 4088 90e1 a6 ff LDX z 4089 90e3 bd 4c 01 LDA enemy_shotFlag,x 4090 90e6 c9 01 CMP #TRUE 4091 90e8 d0 03 BNE .skipL0307 4092 90ea .condpart141 4093 90ea 4c be 92 jmp .skip_enemy_shot 4094 90ed 4095 90ed .skipL0307 4096 90ed .L0308 ;; enemy_shotFlag[z] = TRUE 4097 90ed 4098 90ed a9 01 LDA #TRUE 4099 90ef a6 ff LDX z 4100 90f1 9d 4c 01 STA enemy_shotFlag,x 4101 90f4 .L0309 ;; enemy_shotX[z] = enemy01_X + 2 4102 90f4 4103 90f4 ad 57 01 LDA enemy01_X 4104 90f7 18 CLC 4105 90f8 69 02 ADC #2 4106 90fa a6 ff LDX z 4107 90fc 9d 4a 01 STA enemy_shotX,x 4108 90ff .L0310 ;; enemy_shotY[z] = enemy01_Y + 4 4109 90ff 4110 90ff ad 58 01 LDA enemy01_Y 4111 9102 18 CLC 4112 9103 69 04 ADC #4 4113 9105 a6 ff LDX z 4114 9107 9d 4b 01 STA enemy_shotY,x 4115 910a . 4116 910a ;; 4117 910a 4118 910a .L0311 ;; temp_XSu = 0 4119 910a 4120 910a a9 00 LDA #0 4121 910c 8d 71 01 STA temp_XSu 4122 910f .L0312 ;; temp_YSu = 0 4123 910f 4124 910f a9 00 LDA #0 4125 9111 8d 73 01 STA temp_YSu 4126 9114 . 4127 9114 ;; 4128 9114 4129 9114 .L0313 ;; if playerX = enemy_shotX[z] then temp_XSf = 0 4130 9114 4131 9114 ad 41 01 LDA playerX 4132 9117 a6 ff LDX z 4133 9119 dd 4a 01 CMP enemy_shotX,x 4134 911c d0 05 BNE .skipL0313 4135 911e .condpart142 4136 911e a9 00 LDA #0 4137 9120 8d 72 01 STA temp_XSf 4138 9123 .skipL0313 4139 9123 .L0314 ;; if playerX > enemy_shotX[z] then temp_XSf = playerX - enemy_shotX[z] 4140 9123 4141 9123 a6 ff LDX z 4142 9125 bd 4a 01 LDA enemy_shotX,x 4143 9128 cd 41 01 CMP playerX 4144 912b b0 0c BCS .skipL0314 4145 912d .condpart143 4146 912d ad 41 01 LDA playerX 4147 9130 a6 ff LDX z 4148 9132 38 SEC 4149 9133 fd 4a 01 SBC enemy_shotX,x 4150 9136 8d 72 01 STA temp_XSf 4151 9139 .skipL0314 4152 9139 .L0315 ;; if playerX < enemy_shotX[z] then temp_XSf = enemy_shotX[z] - playerX 4153 9139 4154 9139 ad 41 01 LDA playerX 4155 913c a6 ff LDX z 4156 913e dd 4a 01 CMP enemy_shotX,x 4157 9141 b0 0c BCS .skipL0315 4158 9143 .condpart144 4159 9143 a6 ff LDX z 4160 9145 bd 4a 01 LDA enemy_shotX,x 4161 9148 38 SEC 4162 9149 ed 41 01 SBC playerX 4163 914c 8d 72 01 STA temp_XSf 4164 914f .skipL0315 4165 914f . 4166 914f ;; 4167 914f 4168 914f .L0316 ;; if playerY = enemy_shotY[z] then temp_YSf = 0 4169 914f 4170 914f ad 42 01 LDA playerY 4171 9152 a6 ff LDX z 4172 9154 dd 4b 01 CMP enemy_shotY,x 4173 9157 d0 05 BNE .skipL0316 4174 9159 .condpart145 4175 9159 a9 00 LDA #0 4176 915b 8d 74 01 STA temp_YSf 4177 915e .skipL0316 4178 915e .L0317 ;; if playerY > enemy_shotY[z] then temp_YSf = playerY - enemy_shotY[z] 4179 915e 4180 915e a6 ff LDX z 4181 9160 bd 4b 01 LDA enemy_shotY,x 4182 9163 cd 42 01 CMP playerY 4183 9166 b0 0c BCS .skipL0317 4184 9168 .condpart146 4185 9168 ad 42 01 LDA playerY 4186 916b a6 ff LDX z 4187 916d 38 SEC 4188 916e fd 4b 01 SBC enemy_shotY,x 4189 9171 8d 74 01 STA temp_YSf 4190 9174 .skipL0317 4191 9174 .L0318 ;; if playerY < enemy_shotY[z] then temp_YSf = enemy_shotY[z] - playerY 4192 9174 4193 9174 ad 42 01 LDA playerY 4194 9177 a6 ff LDX z 4195 9179 dd 4b 01 CMP enemy_shotY,x 4196 917c b0 0c BCS .skipL0318 4197 917e .condpart147 4198 917e a6 ff LDX z 4199 9180 bd 4b 01 LDA enemy_shotY,x 4200 9183 38 SEC 4201 9184 ed 42 01 SBC playerY 4202 9187 8d 74 01 STA temp_YSf 4203 918a .skipL0318 4204 918a .L0319 ;; w = ( rand / 16 ) 4205 918a 4206 918a ; complex statement detected 4207 918a 20 f8 f3 jsr randomize 4208 918d 4a lsr 4209 918e 4a lsr 4210 918f 4a lsr 4211 9190 4a lsr 4212 9191 85 fc STA w 4213 9193 .L0320 ;; if temp_XSf > 8 then temp_XSf = temp_XSf + w - 8 else temp_XSf = temp_XSf + w 4214 9193 4215 9193 a9 08 LDA #8 4216 9195 cd 72 01 CMP temp_XSf 4217 9198 b0 0f BCS .skipL0320 4218 919a .condpart148 4219 919a ; complex statement detected 4220 919a ad 72 01 LDA temp_XSf 4221 919d 18 CLC 4222 919e 65 fc ADC w 4223 91a0 38 SEC 4224 91a1 e9 08 SBC #8 4225 91a3 8d 72 01 STA temp_XSf 4226 91a6 4c b2 91 jmp .skipelse0 4227 91a9 .skipL0320 4228 91a9 ad 72 01 LDA temp_XSf 4229 91ac 18 CLC 4230 91ad 65 fc ADC w 4231 91af 8d 72 01 STA temp_XSf 4232 91b2 .skipelse0 4233 91b2 .L0321 ;; w = ( rand / 16 ) 4234 91b2 4235 91b2 ; complex statement detected 4236 91b2 20 f8 f3 jsr randomize 4237 91b5 4a lsr 4238 91b6 4a lsr 4239 91b7 4a lsr 4240 91b8 4a lsr 4241 91b9 85 fc STA w 4242 91bb .L0322 ;; if temp_YSf > 8 then temp_YSf = temp_YSf + w - 8 else temp_YSf = temp_YSf + w 4243 91bb 4244 91bb a9 08 LDA #8 4245 91bd cd 74 01 CMP temp_YSf 4246 91c0 b0 0f BCS .skipL0322 4247 91c2 .condpart149 4248 91c2 ; complex statement detected 4249 91c2 ad 74 01 LDA temp_YSf 4250 91c5 18 CLC 4251 91c6 65 fc ADC w 4252 91c8 38 SEC 4253 91c9 e9 08 SBC #8 4254 91cb 8d 74 01 STA temp_YSf 4255 91ce 4c da 91 jmp .skipelse1 4256 91d1 .skipL0322 4257 91d1 ad 74 01 LDA temp_YSf 4258 91d4 18 CLC 4259 91d5 65 fc ADC w 4260 91d7 8d 74 01 STA temp_YSf 4261 91da .skipelse1 4262 91da . 4263 91da ;; 4264 91da 4265 91da .L0323 ;; if temp_YSf = 0 && temp_XSf = 0 then enemy_shotFlag[z] = FALSE : return 4266 91da 4267 91da ad 74 01 LDA temp_YSf 4268 91dd c9 00 CMP #0 4269 91df d0 18 BNE .skipL0323 4270 91e1 .condpart150 4271 91e1 ad 72 01 LDA temp_XSf 4272 91e4 c9 00 CMP #0 4273 91e6 d0 11 BNE .skip150then 4274 91e8 .condpart151 4275 91e8 a9 00 LDA #FALSE 4276 91ea a6 ff LDX z 4277 91ec 9d 4c 01 STA enemy_shotFlag,x 4278 91ef ba tsx 4279 91f0 bd 02 01 lda $102,x 4280 91f3 f0 01 beq bankswitchret17 4281 91f5 60 RTS 4282 91f6 bankswitchret17 4283 91f6 4c 7a f4 JMP BS_return 4284 91f9 .skip150then 4285 91f9 .skipL0323 4286 91f9 . 4287 91f9 ;; 4288 91f9 4289 91f9 .L0324 ;; if playerX <= enemy_shotX[z] then enemy_shotDirection[z] = enemy_shotDirection[z] | %00000010 else enemy_shotDirection[z] = enemy_shotDirection & %11111101 4290 91f9 4291 91f9 a6 ff LDX z 4292 91fb bd 4a 01 LDA enemy_shotX,x 4293 91fe cd 41 01 CMP playerX 4294 9201 90 0f BCC .skipL0324 4295 9203 .condpart152 4296 9203 a6 ff LDX z 4297 9205 bd 6c 01 LDA enemy_shotDirection,x 4298 9208 09 02 ORA #%00000010 4299 920a a6 ff LDX z 4300 920c 9d 6c 01 STA enemy_shotDirection,x 4301 920f 4c 1c 92 jmp .skipelse2 4302 9212 .skipL0324 4303 9212 ad 6c 01 LDA enemy_shotDirection 4304 9215 29 fd AND #%11111101 4305 9217 a6 ff LDX z 4306 9219 9d 6c 01 STA enemy_shotDirection,x 4307 921c .skipelse2 4308 921c .L0325 ;; if playerY <= enemy_shotY[z] then enemy_shotDirection[z] = enemy_shotDirection[z] | %00000001 else enemy_shotDirection[z] = enemy_shotDirection & %11111110 4309 921c 4310 921c a6 ff LDX z 4311 921e bd 4b 01 LDA enemy_shotY,x 4312 9221 cd 42 01 CMP playerY 4313 9224 90 0f BCC .skipL0325 4314 9226 .condpart153 4315 9226 a6 ff LDX z 4316 9228 bd 6c 01 LDA enemy_shotDirection,x 4317 922b 09 01 ORA #%00000001 4318 922d a6 ff LDX z 4319 922f 9d 6c 01 STA enemy_shotDirection,x 4320 9232 4c 3f 92 jmp .skipelse3 4321 9235 .skipL0325 4322 9235 ad 6c 01 LDA enemy_shotDirection 4323 9238 29 fe AND #%11111110 4324 923a a6 ff LDX z 4325 923c 9d 6c 01 STA enemy_shotDirection,x 4326 923f .skipelse3 4327 923f . 4328 923f ;; 4329 923f 4330 923f .L0326 ;; temp_XSu = 0 4331 923f 4332 923f a9 00 LDA #0 4333 9241 8d 71 01 STA temp_XSu 4334 9244 .L0327 ;; temp_YSu = 0 4335 9244 4336 9244 a9 00 LDA #0 4337 9246 8d 73 01 STA temp_YSu 4338 9249 . 4339 9249 ;; 4340 9249 4341 9249 .L0328 ;; total_XSu = 0 4342 9249 4343 9249 a9 00 LDA #0 4344 924b 8d 6d 01 STA total_XSu 4345 924e .L0329 ;; total_XSf = 0 4346 924e 4347 924e a9 00 LDA #0 4348 9250 8d 6e 01 STA total_XSf 4349 9253 .L0330 ;; total_YSu = 0 4350 9253 4351 9253 a9 00 LDA #0 4352 9255 8d 6f 01 STA total_YSu 4353 9258 .L0331 ;; total_YSf = 0 4354 9258 4355 9258 a9 00 LDA #0 4356 925a 8d 70 01 STA total_YSf 4357 925d . 4358 925d ;; 4359 925d 4360 925d .es_SpeedIncrease 4361 925d ;; es_SpeedIncrease 4362 925d 4363 925d .L0332 ;; total_speedX = total_speedX + temp_speedX 4364 925d 4365 925d ad 6e 01 LDA total_XSf 4366 9260 18 CLC 4367 9261 6d 72 01 ADC temp_XSf 4368 9264 8d 6e 01 STA total_XSf 4369 9267 ad 6d 01 LDA total_speedX 4370 926a 6d 71 01 ADC temp_speedX 4371 926d 8d 6d 01 STA total_speedX 4372 9270 .L0333 ;; total_speedY = total_speedY + temp_speedY 4373 9270 4374 9270 ad 70 01 LDA total_YSf 4375 9273 18 CLC 4376 9274 6d 74 01 ADC temp_YSf 4377 9277 8d 70 01 STA total_YSf 4378 927a ad 6f 01 LDA total_speedY 4379 927d 6d 73 01 ADC temp_speedY 4380 9280 8d 6f 01 STA total_speedY 4381 9283 .L0334 ;; if total_XSu = 0 && total_YSu = 0 then goto es_SpeedIncrease 4382 9283 4383 9283 ad 6d 01 LDA total_XSu 4384 9286 c9 00 CMP #0 4385 9288 d0 0a BNE .skipL0334 4386 928a .condpart154 4387 928a ad 6f 01 LDA total_YSu 4388 928d c9 00 CMP #0 4389 928f d0 03 BNE .skip154then 4390 9291 .condpart155 4391 9291 4c 5d 92 jmp .es_SpeedIncrease 4392 9294 4393 9294 .skip154then 4394 9294 .skipL0334 4395 9294 . 4396 9294 ;; 4397 9294 4398 9294 .L0335 ;; enemy_shotXf[z] = total_XSu 4399 9294 4400 9294 ad 6d 01 LDA total_XSu 4401 9297 a6 ff LDX z 4402 9299 9d 00 22 STA enemy_shotXf,x 4403 929c .L0336 ;; enemy_shotSXf[z] = total_XSf 4404 929c 4405 929c ad 6e 01 LDA total_XSf 4406 929f a6 ff LDX z 4407 92a1 9d 40 22 STA enemy_shotSXf,x 4408 92a4 .L0337 ;; enemy_shotYf[z] = total_YSu 4409 92a4 4410 92a4 ad 6f 01 LDA total_YSu 4411 92a7 a6 ff LDX z 4412 92a9 9d 10 22 STA enemy_shotYf,x 4413 92ac .L0338 ;; enemy_shotSYf[z] = total_YSf 4414 92ac 4415 92ac ad 70 01 LDA total_YSf 4416 92af a6 ff LDX z 4417 92b1 9d 50 22 STA enemy_shotSYf,x 4418 92b4 .L0339 ;; return 4419 92b4 4420 92b4 ba tsx 4421 92b5 bd 02 01 lda $102,x 4422 92b8 f0 01 beq bankswitchret18 4423 92ba 60 RTS 4424 92bb bankswitchret18 4425 92bb 4c 7a f4 JMP BS_return 4426 92be . 4427 92be ;; 4428 92be 4429 92be .skip_enemy_shot 4430 92be ;; skip_enemy_shot 4431 92be 4432 92be .L0340 ;; z = z - 1 4433 92be 4434 92be a5 ff LDA z 4435 92c0 38 SEC 4436 92c1 e9 01 SBC #1 4437 92c3 85 ff STA z 4438 92c5 .L0341 ;; if z < 15 then fire_enemybullet 4439 92c5 4440 92c5 a5 ff LDA z 4441 92c7 c9 0f CMP #15 4442 92c9 - if ((* - .fire_enemybullet) < 127) && ((* - .fire_enemybullet) > -128) 4443 92c9 - bcc .fire_enemybullet 4444 92c9 else 4445 92c9 b0 03 bcs .2skipfire_enemybullet 4446 92cb 4c dd 90 jmp .fire_enemybullet 4447 92ce .2skipfire_enemybullet 4448 92ce endif 4449 92ce .L0342 ;; return 4450 92ce 4451 92ce ba tsx 4452 92cf bd 02 01 lda $102,x 4453 92d2 f0 01 beq bankswitchret19 4454 92d4 60 RTS 4455 92d5 bankswitchret19 4456 92d5 4c 7a f4 JMP BS_return 4457 92d8 . 4458 92d8 ;; 4459 92d8 4460 92d8 .move_enemyshot 4461 92d8 ;; move_enemyshot 4462 92d8 4463 92d8 . 4464 92d8 ;; 4465 92d8 4466 92d8 .L0343 ;; z = 15 4467 92d8 4468 92d8 a9 0f LDA #15 4469 92da 85 ff STA z 4470 92dc .update_enemyshot 4471 92dc ;; update_enemyshot 4472 92dc 4473 92dc . 4474 92dc ;; 4475 92dc 4476 92dc .L0344 ;; var54 = enemy_shotY[z] 4477 92dc 4478 92dc a6 ff LDX z 4479 92de bd 4b 01 LDA enemy_shotY,x 4480 92e1 8d 76 01 STA var54 4481 92e4 .L0345 ;; var91 = enemy_shotYf[z] 4482 92e4 4483 92e4 a6 ff LDX z 4484 92e6 bd 10 22 LDA enemy_shotYf,x 4485 92e9 8d 9b 01 STA var91 4486 92ec .L0346 ;; var53 = enemy_shotX[z] 4487 92ec 4488 92ec a6 ff LDX z 4489 92ee bd 4a 01 LDA enemy_shotX,x 4490 92f1 8d 75 01 STA var53 4491 92f4 .L0347 ;; var93 = enemy_shotXf[z] 4492 92f4 4493 92f4 a6 ff LDX z 4494 92f6 bd 00 22 LDA enemy_shotXf,x 4495 92f9 8d 9d 01 STA var93 4496 92fc . 4497 92fc ;; 4498 92fc 4499 92fc .L0348 ;; var96 = enemy_shotSX[z] 4500 92fc 4501 92fc a6 ff LDX z 4502 92fe bd 20 22 LDA enemy_shotSX,x 4503 9301 8d a0 01 STA var96 4504 9304 .L0349 ;; var97 = enemy_shotSXf[z] 4505 9304 4506 9304 a6 ff LDX z 4507 9306 bd 40 22 LDA enemy_shotSXf,x 4508 9309 8d a1 01 STA var97 4509 930c .L0350 ;; var98 = enemy_shotSY[z] 4510 930c 4511 930c a6 ff LDX z 4512 930e bd 30 22 LDA enemy_shotSY,x 4513 9311 8d a2 01 STA var98 4514 9314 .L0351 ;; var99 = enemy_shotSYf[z] 4515 9314 4516 9314 a6 ff LDX z 4517 9316 bd 50 22 LDA enemy_shotSYf,x 4518 9319 8d a3 01 STA var99 4519 931c . 4520 931c ;; 4521 931c 4522 931c .L0352 ;; if ( enemy_shotDirection[z] & 1 ) = 1 then mob_Y = mob_Y - mob_speedY else mob_Y = mob_Y + mob_speedY 4523 931c 4524 931c ; complex condition detected 4525 931c ; complex statement detected 4526 931c a6 ff LDX z 4527 931e bd 6c 01 LDA enemy_shotDirection,x 4528 9321 29 01 AND #1 4529 9323 c9 01 CMP #1 4530 9325 d0 16 BNE .skipL0352 4531 9327 .condpart156 4532 9327 ad 9f 01 LDA var95 4533 932a 38 SEC 4534 932b ed a3 01 SBC var99 4535 932e 8d 9f 01 STA var95 4536 9331 ad 9e 01 LDA mob_Y 4537 9334 ed a2 01 SBC mob_speedY 4538 9337 8d 9e 01 STA mob_Y 4539 933a 4c 50 93 jmp .skipelse4 4540 933d .skipL0352 4541 933d ad 9f 01 LDA var95 4542 9340 18 CLC 4543 9341 6d a3 01 ADC var99 4544 9344 8d 9f 01 STA var95 4545 9347 ad 9e 01 LDA mob_Y 4546 934a 6d a2 01 ADC mob_speedY 4547 934d 8d 9e 01 STA mob_Y 4548 9350 .skipelse4 4549 9350 .L0353 ;; if ( enemy_shotDirection[z] & 2 ) = 2 then mob_X = mob_X - mob_speedX else mob_X = mob_X + mob_speedX 4550 9350 4551 9350 ; complex condition detected 4552 9350 ; complex statement detected 4553 9350 a6 ff LDX z 4554 9352 bd 6c 01 LDA enemy_shotDirection,x 4555 9355 29 02 AND #2 4556 9357 c9 02 CMP #2 4557 9359 d0 16 BNE .skipL0353 4558 935b .condpart157 4559 935b ad 9d 01 LDA var93 4560 935e 38 SEC 4561 935f ed a1 01 SBC var97 4562 9362 8d 9d 01 STA var93 4563 9365 ad 9c 01 LDA mob_X 4564 9368 ed a0 01 SBC mob_speedX 4565 936b 8d 9c 01 STA mob_X 4566 936e 4c 84 93 jmp .skipelse5 4567 9371 .skipL0353 4568 9371 ad 9d 01 LDA var93 4569 9374 18 CLC 4570 9375 6d a1 01 ADC var97 4571 9378 8d 9d 01 STA var93 4572 937b ad 9c 01 LDA mob_X 4573 937e 6d a0 01 ADC mob_speedX 4574 9381 8d 9c 01 STA mob_X 4575 9384 .skipelse5 4576 9384 . 4577 9384 ;; 4578 9384 4579 9384 .L0354 ;; enemy_shotY[z] = var54 4580 9384 4581 9384 ad 76 01 LDA var54 4582 9387 a6 ff LDX z 4583 9389 9d 4b 01 STA enemy_shotY,x 4584 938c .L0355 ;; enemy_shotYf[z] = var91 4585 938c 4586 938c ad 9b 01 LDA var91 4587 938f a6 ff LDX z 4588 9391 9d 10 22 STA enemy_shotYf,x 4589 9394 .L0356 ;; enemy_shotX[z] = var53 4590 9394 4591 9394 ad 75 01 LDA var53 4592 9397 a6 ff LDX z 4593 9399 9d 4a 01 STA enemy_shotX,x 4594 939c .L0357 ;; enemy_shotXf[z] = var93 4595 939c 4596 939c ad 9d 01 LDA var93 4597 939f a6 ff LDX z 4598 93a1 9d 00 22 STA enemy_shotXf,x 4599 93a4 . 4600 93a4 ;; 4601 93a4 4602 93a4 .L0358 ;; z = z - 1 4603 93a4 4604 93a4 a5 ff LDA z 4605 93a6 38 SEC 4606 93a7 e9 01 SBC #1 4607 93a9 85 ff STA z 4608 93ab .L0359 ;; if z < 15 then goto update_enemyshot 4609 93ab 4610 93ab a5 ff LDA z 4611 93ad c9 0f CMP #15 4612 93af b0 03 BCS .skipL0359 4613 93b1 .condpart158 4614 93b1 4c dc 92 jmp .update_enemyshot 4615 93b4 4616 93b4 .skipL0359 4617 93b4 .L0360 ;; return 4618 93b4 4619 93b4 ba tsx 4620 93b5 bd 02 01 lda $102,x 4621 93b8 f0 01 beq bankswitchret20 4622 93ba 60 RTS 4623 93bb bankswitchret20 4624 93bb 4c 7a f4 JMP BS_return 4625 93be . 4626 93be ;; 4627 93be 4628 93be . 4629 93be ;; 4630 93be 4631 93be . 4632 93be ;; 4633 93be 4634 93be . 4635 93be ;; 4636 93be 4637 93be .L0361 ;; data sfx_bling 4638 93be 4639 93be 4c f7 93 JMP .skipL0361 4640 93c1 sfx_bling 4641 93c1 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4642 93c4 4643 93c4 1c 04 07 .byte.b $1c,$04,$07 4644 93c7 4645 93c7 1b 04 07 .byte.b $1b,$04,$07 4646 93ca 4647 93ca 04 0f 05 .byte.b $04,$0f,$05 4648 93cd 4649 93cd 15 04 09 .byte.b $15,$04,$09 4650 93d0 4651 93d0 16 04 07 .byte.b $16,$04,$07 4652 93d3 4653 93d3 03 0f 04 .byte.b $03,$0f,$04 4654 93d6 4655 93d6 11 04 08 .byte.b $11,$04,$08 4656 93d9 4657 93d9 11 04 08 .byte.b $11,$04,$08 4658 93dc 4659 93dc 11 04 04 .byte.b $11,$04,$04 4660 93df 4661 93df 0e 04 09 .byte.b $0e,$04,$09 4662 93e2 4663 93e2 0e 04 07 .byte.b $0e,$04,$07 4664 93e5 4665 93e5 0e 04 04 .byte.b $0e,$04,$04 4666 93e8 4667 93e8 1c 04 07 .byte.b $1c,$04,$07 4668 93eb 4669 93eb 1b 04 05 .byte.b $1b,$04,$05 4670 93ee 4671 93ee 1c 04 04 .byte.b $1c,$04,$04 4672 93f1 4673 93f1 1b 04 02 .byte.b $1b,$04,$02 4674 93f4 4675 93f4 00 00 00 .byte.b $00,$00,$00 4676 93f7 4677 93f7 .skipL0361 4678 93f7 00 c1 sfx_bling_lo = #sfx_bling 4680 93f7 . 4681 93f7 ;; 4682 93f7 4683 93f7 .L0362 ;; data sfx_pulsecannon 4684 93f7 4685 93f7 4c 4e 94 JMP .skipL0362 4686 93fa sfx_pulsecannon 4687 93fa 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4688 93fd 4689 93fd 1e 0c 0a .byte.b $1e,$0c,$0a ; first chunk of freq,channel,volume 4690 9400 4691 9400 07 06 0f .byte.b $07,$06,$0f 4692 9403 4693 9403 07 06 0f .byte.b $07,$06,$0f 4694 9406 4695 9406 1e 06 0f .byte.b $1e,$06,$0f 4696 9409 4697 9409 17 0c 0b .byte.b $17,$0c,$0b 4698 940c 4699 940c 1b 0c 0b .byte.b $1b,$0c,$0b 4700 940f 4701 940f 1e 0c 0f .byte.b $1e,$0c,$0f 4702 9412 4703 9412 07 06 0f .byte.b $07,$06,$0f 4704 9415 4705 9415 07 06 0f .byte.b $07,$06,$0f 4706 9418 4707 9418 1e 06 08 .byte.b $1e,$06,$08 4708 941b 4709 941b 17 0c 06 .byte.b $17,$0c,$06 4710 941e 4711 941e 1b 0c 0f .byte.b $1b,$0c,$0f 4712 9421 4713 9421 1e 0c 0f .byte.b $1e,$0c,$0f 4714 9424 4715 9424 07 06 0f .byte.b $07,$06,$0f 4716 9427 4717 9427 07 06 0f .byte.b $07,$06,$0f 4718 942a 4719 942a 0a 06 0a .byte.b $0a,$06,$0a 4720 942d 4721 942d 17 0c 0a .byte.b $17,$0c,$0a 4722 9430 4723 9430 1e 0c 04 .byte.b $1e,$0c,$04 4724 9433 4725 9433 1e 06 09 .byte.b $1e,$06,$09 4726 9436 4727 9436 1b 04 05 .byte.b $1b,$04,$05 4728 9439 4729 9439 07 06 0f .byte.b $07,$06,$0f 4730 943c 4731 943c 0a 06 09 .byte.b $0a,$06,$09 4732 943f 4733 943f 17 0c 0d .byte.b $17,$0c,$0d 4734 9442 4735 9442 1b 0c 09 .byte.b $1b,$0c,$09 4736 9445 4737 9445 0a 06 05 .byte.b $0a,$06,$05 4738 9448 4739 9448 17 0c 03 .byte.b $17,$0c,$03 4740 944b 4741 944b 00 00 00 .byte.b $00,$00,$00 4742 944e 4743 944e .skipL0362 4744 944e 00 fa sfx_pulsecannon_lo = #sfx_pulsecannon 4746 944e . 4747 944e ;; 4748 944e 4749 944e .L0363 ;; data sfx_plainlaser 4750 944e 4751 944e 4c 81 94 JMP .skipL0363 4752 9451 sfx_plainlaser 4753 9451 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4754 9454 4755 9454 10 04 06 .byte.b $10,$04,$06 ; first chunk of freq,channel,volume 4756 9457 4757 9457 13 04 08 .byte.b $13,$04,$08 4758 945a 4759 945a 16 04 08 .byte.b $16,$04,$08 4760 945d 4761 945d 16 04 07 .byte.b $16,$04,$07 4762 9460 4763 9460 1c 04 09 .byte.b $1c,$04,$09 4764 9463 4765 9463 0b 0c 0f .byte.b $0b,$0c,$0f 4766 9466 4767 9466 0d 0c 0f .byte.b $0d,$0c,$0f 4768 9469 4769 9469 0e 0c 0f .byte.b $0e,$0c,$0f 4770 946c 4771 946c 0e 0c 0f .byte.b $0e,$0c,$0f 4772 946f 4773 946f 12 0c 0f .byte.b $12,$0c,$0f 4774 9472 4775 9472 03 06 0d .byte.b $03,$06,$0d 4776 9475 4777 9475 1e 0c 0a .byte.b $1e,$0c,$0a 4778 9478 4779 9478 1e 0c 0c .byte.b $1e,$0c,$0c 4780 947b 4781 947b 0a 06 04 .byte.b $0a,$06,$04 4782 947e 4783 947e 00 00 00 .byte.b $00,$00,$00 4784 9481 4785 9481 .skipL0363 4786 9481 00 51 sfx_plainlaser_lo = #sfx_plainlaser 4788 9481 . 4789 9481 ;; 4790 9481 4791 9481 .L0364 ;; data sfx_explosion 4792 9481 4793 9481 4c 14 95 JMP .skipL0364 4794 9484 sfx_explosion 4795 9484 10 10 00 .byte.b $10,$10,$00 4796 9487 4797 9487 01 08 02 .byte.b $01,$08,$02 4798 948a 4799 948a 0b 0c 05 .byte.b $0b,$0c,$05 4800 948d 4801 948d 04 06 08 .byte.b $04,$06,$08 4802 9490 4803 9490 03 0e 0f .byte.b $03,$0e,$0f 4804 9493 4805 9493 09 06 0f .byte.b $09,$06,$0f 4806 9496 4807 9496 0d 06 0f .byte.b $0d,$06,$0f 4808 9499 4809 9499 04 0e 0f .byte.b $04,$0e,$0f 4810 949c 4811 949c 0f 06 08 .byte.b $0f,$06,$08 4812 949f 4813 949f 09 06 04 .byte.b $09,$06,$04 4814 94a2 4815 94a2 16 01 03 .byte.b $16,$01,$03 4816 94a5 4817 94a5 0c 06 04 .byte.b $0c,$06,$04 4818 94a8 4819 94a8 09 06 05 .byte.b $09,$06,$05 4820 94ab 4821 94ab 0a 06 03 .byte.b $0a,$06,$03 4822 94ae 4823 94ae 09 06 05 .byte.b $09,$06,$05 4824 94b1 4825 94b1 0d 06 08 .byte.b $0d,$06,$08 4826 94b4 4827 94b4 09 06 04 .byte.b $09,$06,$04 4828 94b7 4829 94b7 04 0e 06 .byte.b $04,$0e,$06 4830 94ba 4831 94ba 0f 06 05 .byte.b $0f,$06,$05 4832 94bd 4833 94bd 0f 06 07 .byte.b $0f,$06,$07 4834 94c0 4835 94c0 04 0e 07 .byte.b $04,$0e,$07 4836 94c3 4837 94c3 08 06 06 .byte.b $08,$06,$06 4838 94c6 4839 94c6 03 0e 08 .byte.b $03,$0e,$08 4840 94c9 4841 94c9 0f 06 06 .byte.b $0f,$06,$06 4842 94cc 4843 94cc 09 06 05 .byte.b $09,$06,$05 4844 94cf 4845 94cf 06 06 05 .byte.b $06,$06,$05 4846 94d2 4847 94d2 03 0e 05 .byte.b $03,$0e,$05 4848 94d5 4849 94d5 0e 06 06 .byte.b $0e,$06,$06 4850 94d8 4851 94d8 02 0e 05 .byte.b $02,$0e,$05 4852 94db 4853 94db 0f 06 03 .byte.b $0f,$06,$03 4854 94de 4855 94de 0e 06 06 .byte.b $0e,$06,$06 4856 94e1 4857 94e1 09 06 05 .byte.b $09,$06,$05 4858 94e4 4859 94e4 0c 06 05 .byte.b $0c,$06,$05 4860 94e7 4861 94e7 0f 06 03 .byte.b $0f,$06,$03 4862 94ea 4863 94ea 04 0e 08 .byte.b $04,$0e,$08 4864 94ed 4865 94ed 0c 06 03 .byte.b $0c,$06,$03 4866 94f0 4867 94f0 0f 06 03 .byte.b $0f,$06,$03 4868 94f3 4869 94f3 0c 06 06 .byte.b $0c,$06,$06 4870 94f6 4871 94f6 0f 06 04 .byte.b $0f,$06,$04 4872 94f9 4873 94f9 0f 06 05 .byte.b $0f,$06,$05 4874 94fc 4875 94fc 0f 06 03 .byte.b $0f,$06,$03 4876 94ff 4877 94ff 0a 06 04 .byte.b $0a,$06,$04 4878 9502 4879 9502 0f 06 03 .byte.b $0f,$06,$03 4880 9505 4881 9505 08 06 03 .byte.b $08,$06,$03 4882 9508 4883 9508 0c 06 03 .byte.b $0c,$06,$03 4884 950b 4885 950b 0e 06 03 .byte.b $0e,$06,$03 4886 950e 4887 950e 08 06 03 .byte.b $08,$06,$03 4888 9511 4889 9511 00 00 00 .byte.b $00,$00,$00 4890 9514 4891 9514 .skipL0364 4892 9514 00 84 sfx_explosion_lo = #sfx_explosion 4894 9514 DMAHOLEEND0 SET . 4895 9514 gameend 4896 9514 DMAHOLEEND0 SET . 6892 bytes of ROM space left in the main area of bank 1. 4897 9514 echo " ",[($B000 - .)]d , "bytes of ROM space left in the main area of bank 1." 4898 9514 - if ($B000 - .) < 0 4899 9514 -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 4900 9514 endif 4901 9514 4902 b000 ORG $B000,0 ; ************* 4903 b000 4904 b000 RORG $B000 ; ************* 4905 b000 4906 b000 vertical_shooting_font 4907 b000 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4908 b020 00 00 00 00* HEX 00000000000000000000000000 4909 b02d vertical_shooting_ship 4910 b02d 07 d0 HEX 07d0 4911 b02f vertical_shooting_ship_tallsprite_00 4912 b02f 80 02 HEX 8002 4913 b031 vertical_shooting_bullet 4914 b031 28 HEX 28 4915 b032 vertical_shooting_enemyshot 4916 b032 00 HEX 00 4917 b033 vertical_shooting_powerup 4918 b033 28 00 HEX 2800 4919 b035 vertical_shooting_enemy01 4920 b035 09 e0 HEX 09e0 4921 b037 vertical_shooting_enemy01_tallsprite_00 4922 b037 40 03 HEX 4003 4923 b039 vertical_shooting_1up 4924 b039 15 55 HEX 1555 4925 b03b vertical_shooting_explosion_01 4926 b03b 02 80 HEX 0280 4927 b03d vertical_shooting_explosion_01_tallsprite_00 4928 b03d 00 00 HEX 0000 4929 b03f vertical_shooting_explosion_02 4930 b03f 05 50 HEX 0550 4931 b041 vertical_shooting_explosion_02_tallsprite_00 4932 b041 00 00 HEX 0000 4933 b043 vertical_shooting_explosion_03 4934 b043 15 54 HEX 1554 4935 b045 vertical_shooting_explosion_03_tallsprite_00 4936 b045 00 00 HEX 0000 4937 b047 vertical_shooting_explosion_04 4938 b047 07 d0 HEX 07d0 4939 b049 vertical_shooting_explosion_04_tallsprite_00 4940 b049 00 00 HEX 0000 4941 b04b vertical_shooting_explosion_05 4942 b04b 0c 30 HEX 0c30 4943 b04d vertical_shooting_explosion_05_tallsprite_00 4944 b04d 01 40 HEX 0140 4945 b04f vertical_shooting_explosion_06 4946 b04f 00 00 HEX 0000 4947 b051 vertical_shooting_explosion_06_tallsprite_00 4948 b051 01 40 HEX 0140 4949 b053 vertical_shooting_explosion_07 4950 b053 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4951 b067 vertical_shooting_explosion_07_tallsprite_00 4952 b067 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4953 b07b vertical_shooting_explosion_08 4954 b07b 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4955 b08f vertical_shooting_explosion_08_tallsprite_00 4956 b08f 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4957 b0a3 vertical_shooting_explosion_09 4958 b0a3 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4959 b0b7 vertical_shooting_explosion_09_tallsprite_00 4960 b0b7 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4961 b0cb vertical_shooting_explosion_10 4962 b0cb 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4963 b0df vertical_shooting_explosion_10_tallsprite_00 4964 b0df 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4965 b0f3 vertical_shooting_laser 4966 b0f3 88 HEX 88 4967 b0f4 vertical_shooting_laser_tallsprite_00 4968 b0f4 cc HEX cc 4969 b0f5 4970 b100 ORG $B100,0 ; ************* 4971 b100 4972 b100 RORG $B100 ; ************* 4973 b100 4974 b100 ;vertical_shooting_font 4975 b100 00 54 54 54* HEX 0054545454045454045404445054505440544454104454444410401444501014 4976 b120 10 44 44 10* HEX 10444410544040101040400000 4977 b12d ;vertical_shooting_ship 4978 b12d 07 d0 HEX 07d0 4979 b12f ;vertical_shooting_ship_tallsprite_00 4980 b12f 80 02 HEX 8002 4981 b131 ;vertical_shooting_bullet 4982 b131 28 HEX 28 4983 b132 ;vertical_shooting_enemyshot 4984 b132 88 HEX 88 4985 b133 ;vertical_shooting_powerup 4986 b133 78 08 HEX 7808 4987 b135 ;vertical_shooting_enemy01 4988 b135 09 e0 HEX 09e0 4989 b137 ;vertical_shooting_enemy01_tallsprite_00 4990 b137 50 0f HEX 500f 4991 b139 ;vertical_shooting_1up 4992 b139 ea a9 HEX eaa9 4993 b13b ;vertical_shooting_explosion_01 4994 b13b 01 40 HEX 0140 4995 b13d ;vertical_shooting_explosion_01_tallsprite_00 4996 b13d 00 00 HEX 0000 4997 b13f ;vertical_shooting_explosion_02 4998 b13f 09 60 HEX 0960 4999 b141 ;vertical_shooting_explosion_02_tallsprite_00 5000 b141 00 00 HEX 0000 5001 b143 ;vertical_shooting_explosion_03 5002 b143 25 58 HEX 2558 5003 b145 ;vertical_shooting_explosion_03_tallsprite_00 5004 b145 00 00 HEX 0000 5005 b147 ;vertical_shooting_explosion_04 5006 b147 05 50 HEX 0550 5007 b149 ;vertical_shooting_explosion_04_tallsprite_00 5008 b149 02 80 HEX 0280 5009 b14b ;vertical_shooting_explosion_05 5010 b14b 0b e0 HEX 0be0 5011 b14d ;vertical_shooting_explosion_05_tallsprite_00 5012 b14d 01 40 HEX 0140 5013 b14f ;vertical_shooting_explosion_06 5014 b14f 0c 30 HEX 0c30 5015 b151 ;vertical_shooting_explosion_06_tallsprite_00 5016 b151 01 40 HEX 0140 5017 b153 ;vertical_shooting_explosion_07 5018 b153 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5019 b167 ;vertical_shooting_explosion_07_tallsprite_00 5020 b167 00 00 00 00* HEX 0000000000000140014001400140014001400000 5021 b17b ;vertical_shooting_explosion_08 5022 b17b 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5023 b18f ;vertical_shooting_explosion_08_tallsprite_00 5024 b18f 00 00 00 00* HEX 0000000000000140014001400140014001400000 5025 b1a3 ;vertical_shooting_explosion_09 5026 b1a3 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5027 b1b7 ;vertical_shooting_explosion_09_tallsprite_00 5028 b1b7 00 00 00 00* HEX 0000000000000140014001400140014001400000 5029 b1cb ;vertical_shooting_explosion_10 5030 b1cb 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5031 b1df ;vertical_shooting_explosion_10_tallsprite_00 5032 b1df 00 00 00 00* HEX 0000000000000140014001400140014001400000 5033 b1f3 ;vertical_shooting_laser 5034 b1f3 88 HEX 88 5035 b1f4 ;vertical_shooting_laser_tallsprite_00 5036 b1f4 cc HEX cc 5037 b1f5 5038 b200 ORG $B200,0 ; ************* 5039 b200 5040 b200 RORG $B200 ; ************* 5041 b200 5042 b200 ;vertical_shooting_font 5043 b200 00 44 10 40* HEX 0044104004040444044404444440444040444410444440444444404444041044 5044 b220 10 54 44 10* HEX 10544410400010000000100000 5045 b22d ;vertical_shooting_ship 5046 b22d 03 c0 HEX 03c0 5047 b22f ;vertical_shooting_ship_tallsprite_00 5048 b22f a1 4a HEX a14a 5049 b231 ;vertical_shooting_bullet 5050 b231 3c HEX 3c 5051 b232 ;vertical_shooting_enemyshot 5052 b232 10 HEX 10 5053 b233 ;vertical_shooting_powerup 5054 b233 78 1e HEX 781e 5055 b235 ;vertical_shooting_enemy01 5056 b235 19 ec HEX 19ec 5057 b237 ;vertical_shooting_enemy01_tallsprite_00 5058 b237 5a af HEX 5aaf 5059 b239 ;vertical_shooting_1up 5060 b239 d5 58 HEX d558 5061 b23b ;vertical_shooting_explosion_01 5062 b23b 00 00 HEX 0000 5063 b23d ;vertical_shooting_explosion_01_tallsprite_00 5064 b23d 00 00 HEX 0000 5065 b23f ;vertical_shooting_explosion_02 5066 b23f 02 80 HEX 0280 5067 b241 ;vertical_shooting_explosion_02_tallsprite_00 5068 b241 00 00 HEX 0000 5069 b243 ;vertical_shooting_explosion_03 5070 b243 09 60 HEX 0960 5071 b245 ;vertical_shooting_explosion_03_tallsprite_00 5072 b245 00 00 HEX 0000 5073 b247 ;vertical_shooting_explosion_04 5074 b247 05 50 HEX 0550 5075 b249 ;vertical_shooting_explosion_04_tallsprite_00 5076 b249 02 80 HEX 0280 5077 b24b ;vertical_shooting_explosion_05 5078 b24b 0a a0 HEX 0aa0 5079 b24d ;vertical_shooting_explosion_05_tallsprite_00 5080 b24d 05 50 HEX 0550 5081 b24f ;vertical_shooting_explosion_06 5082 b24f 0b e0 HEX 0be0 5083 b251 ;vertical_shooting_explosion_06_tallsprite_00 5084 b251 05 50 HEX 0550 5085 b253 ;vertical_shooting_explosion_07 5086 b253 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5087 b267 ;vertical_shooting_explosion_07_tallsprite_00 5088 b267 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5089 b27b ;vertical_shooting_explosion_08 5090 b27b 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5091 b28f ;vertical_shooting_explosion_08_tallsprite_00 5092 b28f 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5093 b2a3 ;vertical_shooting_explosion_09 5094 b2a3 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5095 b2b7 ;vertical_shooting_explosion_09_tallsprite_00 5096 b2b7 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5097 b2cb ;vertical_shooting_explosion_10 5098 b2cb 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5099 b2df ;vertical_shooting_explosion_10_tallsprite_00 5100 b2df 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5101 b2f3 ;vertical_shooting_laser 5102 b2f3 44 HEX 44 5103 b2f4 ;vertical_shooting_laser_tallsprite_00 5104 b2f4 cc HEX cc 5105 b2f5 5106 b300 ORG $B300,0 ; ************* 5107 b300 5108 b300 RORG $B300 ; ************* 5109 b300 5110 b300 ;vertical_shooting_font 5111 b300 00 44 10 40* HEX 0044104004040444044404444440444040444410044440444444404444041044 5112 b320 54 54 44 10* HEX 54544410100000101000000000 5113 b32d ;vertical_shooting_ship 5114 b32d 01 40 HEX 0140 5115 b32f ;vertical_shooting_ship_tallsprite_00 5116 b32f a5 5a HEX a55a 5117 b331 ;vertical_shooting_bullet 5118 b331 3c HEX 3c 5119 b332 ;vertical_shooting_enemyshot 5120 b332 74 HEX 74 5121 b333 ;vertical_shooting_powerup 5122 b333 7a a4 HEX 7aa4 5123 b335 ;vertical_shooting_enemy01 5124 b335 59 ef HEX 59ef 5125 b337 ;vertical_shooting_enemy01_tallsprite_00 5126 b337 59 ef HEX 59ef 5127 b339 ;vertical_shooting_1up 5128 b339 35 60 HEX 3560 5129 b33b ;vertical_shooting_explosion_01 5130 b33b 00 00 HEX 0000 5131 b33d ;vertical_shooting_explosion_01_tallsprite_00 5132 b33d 00 00 HEX 0000 5133 b33f ;vertical_shooting_explosion_02 5134 b33f 00 00 HEX 0000 5135 b341 ;vertical_shooting_explosion_02_tallsprite_00 5136 b341 00 00 HEX 0000 5137 b343 ;vertical_shooting_explosion_03 5138 b343 02 80 HEX 0280 5139 b345 ;vertical_shooting_explosion_03_tallsprite_00 5140 b345 00 00 HEX 0000 5141 b347 ;vertical_shooting_explosion_04 5142 b347 09 60 HEX 0960 5143 b349 ;vertical_shooting_explosion_04_tallsprite_00 5144 b349 09 60 HEX 0960 5145 b34b ;vertical_shooting_explosion_05 5146 b34b 06 90 HEX 0690 5147 b34d ;vertical_shooting_explosion_05_tallsprite_00 5148 b34d 06 90 HEX 0690 5149 b34f ;vertical_shooting_explosion_06 5150 b34f 06 90 HEX 0690 5151 b351 ;vertical_shooting_explosion_06_tallsprite_00 5152 b351 06 90 HEX 0690 5153 b353 ;vertical_shooting_explosion_07 5154 b353 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5155 b367 ;vertical_shooting_explosion_07_tallsprite_00 5156 b367 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5157 b37b ;vertical_shooting_explosion_08 5158 b37b 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5159 b38f ;vertical_shooting_explosion_08_tallsprite_00 5160 b38f 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5161 b3a3 ;vertical_shooting_explosion_09 5162 b3a3 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5163 b3b7 ;vertical_shooting_explosion_09_tallsprite_00 5164 b3b7 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5165 b3cb ;vertical_shooting_explosion_10 5166 b3cb 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5167 b3df ;vertical_shooting_explosion_10_tallsprite_00 5168 b3df 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5169 b3f3 ;vertical_shooting_laser 5170 b3f3 44 HEX 44 5171 b3f4 ;vertical_shooting_laser_tallsprite_00 5172 b3f4 cc HEX cc 5173 b3f5 5174 b400 ORG $B400,0 ; ************* 5175 b400 5176 b400 RORG $B400 ; ************* 5177 b400 5178 b400 ;vertical_shooting_font 5179 b400 00 44 10 54* HEX 0044105454545454045454545040445454445410045040544444504450101044 5180 b420 44 44 10 10* HEX 44441010100000101000000000 5181 b42d ;vertical_shooting_ship 5182 b42d 01 40 HEX 0140 5183 b42f ;vertical_shooting_ship_tallsprite_00 5184 b42f a5 5a HEX a55a 5185 b431 ;vertical_shooting_bullet 5186 b431 14 HEX 14 5187 b432 ;vertical_shooting_enemyshot 5188 b432 74 HEX 74 5189 b433 ;vertical_shooting_powerup 5190 b433 75 7a HEX 757a 5191 b435 ;vertical_shooting_enemy01 5192 b435 59 6f HEX 596f 5193 b437 ;vertical_shooting_enemy01_tallsprite_00 5194 b437 59 ef HEX 59ef 5195 b439 ;vertical_shooting_1up 5196 b439 35 60 HEX 3560 5197 b43b ;vertical_shooting_explosion_01 5198 b43b 00 00 HEX 0000 5199 b43d ;vertical_shooting_explosion_01_tallsprite_00 5200 b43d 00 00 HEX 0000 5201 b43f ;vertical_shooting_explosion_02 5202 b43f 00 00 HEX 0000 5203 b441 ;vertical_shooting_explosion_02_tallsprite_00 5204 b441 00 00 HEX 0000 5205 b443 ;vertical_shooting_explosion_03 5206 b443 00 00 HEX 0000 5207 b445 ;vertical_shooting_explosion_03_tallsprite_00 5208 b445 02 80 HEX 0280 5209 b447 ;vertical_shooting_explosion_04 5210 b447 09 60 HEX 0960 5211 b449 ;vertical_shooting_explosion_04_tallsprite_00 5212 b449 09 60 HEX 0960 5213 b44b ;vertical_shooting_explosion_05 5214 b44b 06 90 HEX 0690 5215 b44d ;vertical_shooting_explosion_05_tallsprite_00 5216 b44d 06 90 HEX 0690 5217 b44f ;vertical_shooting_explosion_06 5218 b44f 06 90 HEX 0690 5219 b451 ;vertical_shooting_explosion_06_tallsprite_00 5220 b451 06 90 HEX 0690 5221 b453 ;vertical_shooting_explosion_07 5222 b453 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5223 b467 ;vertical_shooting_explosion_07_tallsprite_00 5224 b467 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5225 b47b ;vertical_shooting_explosion_08 5226 b47b 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5227 b48f ;vertical_shooting_explosion_08_tallsprite_00 5228 b48f 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5229 b4a3 ;vertical_shooting_explosion_09 5230 b4a3 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5231 b4b7 ;vertical_shooting_explosion_09_tallsprite_00 5232 b4b7 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5233 b4cb ;vertical_shooting_explosion_10 5234 b4cb 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5235 b4df ;vertical_shooting_explosion_10_tallsprite_00 5236 b4df 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5237 b4f3 ;vertical_shooting_laser 5238 b4f3 44 HEX 44 5239 b4f4 ;vertical_shooting_laser_tallsprite_00 5240 b4f4 cc HEX cc 5241 b4f5 5242 b500 ORG $B500,0 ; ************* 5243 b500 5244 b500 RORG $B500 ; ************* 5245 b500 5246 b500 ;vertical_shooting_font 5247 b500 00 44 10 04* HEX 0044100404444040044444444440444040404410044440544444444444401044 5248 b520 44 44 44 54* HEX 44444454100000041000000000 5249 b52d ;vertical_shooting_ship 5250 b52d 01 40 HEX 0140 5251 b52f ;vertical_shooting_ship_tallsprite_00 5252 b52f a5 5a HEX a55a 5253 b531 ;vertical_shooting_bullet 5254 b531 14 HEX 14 5255 b532 ;vertical_shooting_enemyshot 5256 b532 74 HEX 74 5257 b533 ;vertical_shooting_powerup 5258 b533 78 1e HEX 781e 5259 b535 ;vertical_shooting_enemy01 5260 b535 5a af HEX 5aaf 5261 b537 ;vertical_shooting_enemy01_tallsprite_00 5262 b537 19 ec HEX 19ec 5263 b539 ;vertical_shooting_1up 5264 b539 0d 80 HEX 0d80 5265 b53b ;vertical_shooting_explosion_01 5266 b53b 00 00 HEX 0000 5267 b53d ;vertical_shooting_explosion_01_tallsprite_00 5268 b53d 00 00 HEX 0000 5269 b53f ;vertical_shooting_explosion_02 5270 b53f 00 00 HEX 0000 5271 b541 ;vertical_shooting_explosion_02_tallsprite_00 5272 b541 02 80 HEX 0280 5273 b543 ;vertical_shooting_explosion_03 5274 b543 00 00 HEX 0000 5275 b545 ;vertical_shooting_explosion_03_tallsprite_00 5276 b545 09 60 HEX 0960 5277 b547 ;vertical_shooting_explosion_04 5278 b547 02 80 HEX 0280 5279 b549 ;vertical_shooting_explosion_04_tallsprite_00 5280 b549 05 50 HEX 0550 5281 b54b ;vertical_shooting_explosion_05 5282 b54b 05 50 HEX 0550 5283 b54d ;vertical_shooting_explosion_05_tallsprite_00 5284 b54d 0a a0 HEX 0aa0 5285 b54f ;vertical_shooting_explosion_06 5286 b54f 05 50 HEX 0550 5287 b551 ;vertical_shooting_explosion_06_tallsprite_00 5288 b551 0b e0 HEX 0be0 5289 b553 ;vertical_shooting_explosion_07 5290 b553 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5291 b567 ;vertical_shooting_explosion_07_tallsprite_00 5292 b567 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5293 b57b ;vertical_shooting_explosion_08 5294 b57b 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5295 b58f ;vertical_shooting_explosion_08_tallsprite_00 5296 b58f 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5297 b5a3 ;vertical_shooting_explosion_09 5298 b5a3 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5299 b5b7 ;vertical_shooting_explosion_09_tallsprite_00 5300 b5b7 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5301 b5cb ;vertical_shooting_explosion_10 5302 b5cb 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5303 b5df ;vertical_shooting_explosion_10_tallsprite_00 5304 b5df 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5305 b5f3 ;vertical_shooting_laser 5306 b5f3 44 HEX 44 5307 b5f4 ;vertical_shooting_laser_tallsprite_00 5308 b5f4 88 HEX 88 5309 b5f5 5310 b600 ORG $B600,0 ; ************* 5311 b600 5312 b600 RORG $B600 ; ************* 5313 b600 5314 b600 ;vertical_shooting_font 5315 b600 00 44 50 04* HEX 0044500404444040044444444440444040404410044440544444444444401044 5316 b620 44 44 44 44* HEX 44444444040000441000001044 5317 b62d ;vertical_shooting_ship 5318 b62d 01 40 HEX 0140 5319 b62f ;vertical_shooting_ship_tallsprite_00 5320 b62f a7 da HEX a7da 5321 b631 ;vertical_shooting_bullet 5322 b631 14 HEX 14 5323 b632 ;vertical_shooting_enemyshot 5324 b632 10 HEX 10 5325 b633 ;vertical_shooting_powerup 5326 b633 7a bc HEX 7abc 5327 b635 ;vertical_shooting_enemy01 5328 b635 50 07 HEX 5007 5329 b637 ;vertical_shooting_enemy01_tallsprite_00 5330 b637 09 e0 HEX 09e0 5331 b639 ;vertical_shooting_1up 5332 b639 0d 80 HEX 0d80 5333 b63b ;vertical_shooting_explosion_01 5334 b63b 00 00 HEX 0000 5335 b63d ;vertical_shooting_explosion_01_tallsprite_00 5336 b63d 01 40 HEX 0140 5337 b63f ;vertical_shooting_explosion_02 5338 b63f 00 00 HEX 0000 5339 b641 ;vertical_shooting_explosion_02_tallsprite_00 5340 b641 09 60 HEX 0960 5341 b643 ;vertical_shooting_explosion_03 5342 b643 00 00 HEX 0000 5343 b645 ;vertical_shooting_explosion_03_tallsprite_00 5344 b645 25 58 HEX 2558 5345 b647 ;vertical_shooting_explosion_04 5346 b647 02 80 HEX 0280 5347 b649 ;vertical_shooting_explosion_04_tallsprite_00 5348 b649 05 50 HEX 0550 5349 b64b ;vertical_shooting_explosion_05 5350 b64b 01 40 HEX 0140 5351 b64d ;vertical_shooting_explosion_05_tallsprite_00 5352 b64d 0b e0 HEX 0be0 5353 b64f ;vertical_shooting_explosion_06 5354 b64f 01 40 HEX 0140 5355 b651 ;vertical_shooting_explosion_06_tallsprite_00 5356 b651 0c 30 HEX 0c30 5357 b653 ;vertical_shooting_explosion_07 5358 b653 00 00 00 00* HEX 0000000000000140014001400140014001400000 5359 b667 ;vertical_shooting_explosion_07_tallsprite_00 5360 b667 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5361 b67b ;vertical_shooting_explosion_08 5362 b67b 00 00 00 00* HEX 0000000000000140014001400140014001400000 5363 b68f ;vertical_shooting_explosion_08_tallsprite_00 5364 b68f 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5365 b6a3 ;vertical_shooting_explosion_09 5366 b6a3 00 00 00 00* HEX 0000000000000140014001400140014001400000 5367 b6b7 ;vertical_shooting_explosion_09_tallsprite_00 5368 b6b7 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5369 b6cb ;vertical_shooting_explosion_10 5370 b6cb 00 00 00 00* HEX 0000000000000140014001400140014001400000 5371 b6df ;vertical_shooting_explosion_10_tallsprite_00 5372 b6df 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5373 b6f3 ;vertical_shooting_laser 5374 b6f3 44 HEX 44 5375 b6f4 ;vertical_shooting_laser_tallsprite_00 5376 b6f4 88 HEX 88 5377 b6f5 5378 b700 ORG $B700,0 ; ************* 5379 b700 5380 b700 RORG $B700 ; ************* 5381 b700 5382 b700 ;vertical_shooting_font 5383 b700 00 54 10 54* HEX 0054105454445454545454545054505454544454044440445010501050145444 5384 b720 44 44 44 44* HEX 44444444540000101040401044 5385 b72d ;vertical_shooting_ship 5386 b72d 01 40 HEX 0140 5387 b72f ;vertical_shooting_ship_tallsprite_00 5388 b72f 27 d8 HEX 27d8 5389 b731 ;vertical_shooting_bullet 5390 b731 00 HEX 00 5391 b732 ;vertical_shooting_enemyshot 5392 b732 88 HEX 88 5393 b733 ;vertical_shooting_powerup 5394 b733 55 50 HEX 5550 5395 b735 ;vertical_shooting_enemy01 5396 b735 40 01 HEX 4001 5397 b737 ;vertical_shooting_enemy01_tallsprite_00 5398 b737 09 e0 HEX 09e0 5399 b739 ;vertical_shooting_1up 5400 b739 03 00 HEX 0300 5401 b73b ;vertical_shooting_explosion_01 5402 b73b 00 00 HEX 0000 5403 b73d ;vertical_shooting_explosion_01_tallsprite_00 5404 b73d 02 80 HEX 0280 5405 b73f ;vertical_shooting_explosion_02 5406 b73f 00 00 HEX 0000 5407 b741 ;vertical_shooting_explosion_02_tallsprite_00 5408 b741 05 50 HEX 0550 5409 b743 ;vertical_shooting_explosion_03 5410 b743 00 00 HEX 0000 5411 b745 ;vertical_shooting_explosion_03_tallsprite_00 5412 b745 15 54 HEX 1554 5413 b747 ;vertical_shooting_explosion_04 5414 b747 00 00 HEX 0000 5415 b749 ;vertical_shooting_explosion_04_tallsprite_00 5416 b749 07 d0 HEX 07d0 5417 b74b ;vertical_shooting_explosion_05 5418 b74b 01 40 HEX 0140 5419 b74d ;vertical_shooting_explosion_05_tallsprite_00 5420 b74d 0c 30 HEX 0c30 5421 b74f ;vertical_shooting_explosion_06 5422 b74f 01 40 HEX 0140 5423 b751 ;vertical_shooting_explosion_06_tallsprite_00 5424 b751 00 00 HEX 0000 5425 b753 ;vertical_shooting_explosion_07 5426 b753 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5427 b767 ;vertical_shooting_explosion_07_tallsprite_00 5428 b767 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5429 b77b ;vertical_shooting_explosion_08 5430 b77b 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5431 b78f ;vertical_shooting_explosion_08_tallsprite_00 5432 b78f 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5433 b7a3 ;vertical_shooting_explosion_09 5434 b7a3 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5435 b7b7 ;vertical_shooting_explosion_09_tallsprite_00 5436 b7b7 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5437 b7cb ;vertical_shooting_explosion_10 5438 b7cb 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5439 b7df ;vertical_shooting_explosion_10_tallsprite_00 5440 b7df 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5441 b7f3 ;vertical_shooting_laser 5442 b7f3 44 HEX 44 5443 b7f4 ;vertical_shooting_laser_tallsprite_00 5444 b7f4 88 HEX 88 5445 b7f5 5446 b800 ORG $B800,0 ; ************* 5447 b800 5448 b800 RORG $B800 ; ************* 5449 b800 - if SPACEOVERFLOW > 0 5450 b800 - echo "" 5451 b800 - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 5452 b800 - echo "######## look above for areas with negative ROM space left." 5453 b800 - echo "######## Aborting assembly." 5454 b800 - ERR 5455 b800 endif 5456 b800 5457 b800 5458 b800 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5459 b800 5460 b800 - ifnconst bankswitchmode 5461 b800 - if ( * < $f000 ) 5462 b800 - ORG $F000 5463 b800 - endif 5464 b800 else 5465 b800 ifconst ROM128K 5466 b800 if ( * < $f000 ) 5467 27000 ORG $27000 5468 27000 RORG $F000 5469 27000 endif 5470 27000 endif 5471 27000 - ifconst ROM144K 5472 27000 - if ( * < $f000 ) 5473 27000 - ORG $27000 5474 27000 - RORG $F000 5475 27000 - endif 5476 27000 endif 5477 27000 - ifconst ROM256K 5478 27000 - if ( * < $f000 ) 5479 27000 - ORG $47000 5480 27000 - RORG $F000 5481 27000 - endif 5482 27000 endif 5483 27000 - ifconst ROM272K 5484 27000 - if ( * < $f000 ) 5485 27000 - ORG $47000 5486 27000 - RORG $F000 5487 27000 - endif 5488 27000 endif 5489 27000 - ifconst ROM512K 5490 27000 - if ( * < $f000 ) 5491 27000 - ORG $87000 5492 27000 - RORG $F000 5493 27000 - endif 5494 27000 endif 5495 27000 - ifconst ROM528K 5496 27000 - if ( * < $f000 ) 5497 27000 - ORG $87000 5498 27000 - RORG $F000 5499 27000 - endif 5500 27000 endif 5501 27000 endif 5502 27000 5503 27000 ; all of these "modules" have conditional clauses in them, so even though 5504 27000 ; they're always included here, they don't take up rom unless the user 5505 27000 ; explicitly enables support for the feature. 5506 27000 5507 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_Rewrite3.78b.asm 5509 27000 endif 5510 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_Rewrite3.78b.asm 5512 27000 endif 5513 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_Rewrite3.78b.asm 5515 27000 endif 5516 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_Rewrite3.78b.asm 5518 27000 endif 5519 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5520 27000 5521 27000 ;standard routimes needed for pretty much all games 5522 27000 5523 27000 ; some definitions used with "set debug color" 5524 27000 00 91 DEBUGCALC = $91 5525 27000 00 41 DEBUGWASTE = $41 5526 27000 00 c1 DEBUGDRAW = $C1 5527 27000 5528 27000 ;NMI and IRQ handlers 5529 27000 NMI 5530 27000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 5531 27000 48 pha ; save A 5532 27001 a5 4d lda visibleover 5533 27003 49 ff eor #255 5534 27005 85 4d sta visibleover 5535 27007 - ifconst DEBUGINTERRUPT 5536 27007 - and #$93 5537 27007 - sta BACKGRND 5538 27007 endif 5539 27007 ce b2 01 dec interruptindex 5540 2700a d0 03 bne skipreallyoffvisible 5541 2700c 4c 6e f0 jmp reallyoffvisible 5542 2700f skipreallyoffvisible 5543 2700f a5 4d lda visibleover 5544 27011 d0 03 bne carryontopscreenroutine 5545 27013 - ifconst .bottomscreenroutine 5546 27013 - jsr .bottomscreenroutine 5547 27013 endif 5548 27013 5549 27013 4c 60 f0 jmp skiptopscreenroutine 5550 27016 carryontopscreenroutine 5551 27016 8a txa ; save X+Y 5552 27017 48 pha 5553 27018 98 tya 5554 27019 48 pha 5555 2701a d8 cld 5556 2701b - ifconst .topscreenroutine 5557 2701b - jsr .topscreenroutine 5558 2701b endif 5559 2701b ifnconst CANARYOFF 5560 2701b ad c1 01 lda canary 5561 2701e f0 07 beq skipcanarytriggered 5562 27020 a9 45 lda #$45 5563 27022 85 20 sta BACKGRND 5564 27024 4c 66 f0 jmp skipbrkolorset ; common crash dump routine, if available 5565 27027 skipcanarytriggered 5566 27027 endif 5567 27027 5568 27027 ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 5569 2702a 5570 2702a ; ** Other important routines that need to regularly run, and can run onscreen. 5571 2702a ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 5572 2702a 5573 2702a - ifconst LONGCONTROLLERREAD 5574 2702a -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 5575 2702a - ldy port1control 5576 2702a - lda longreadtype,y 5577 2702a - beq LLRET1 5578 2702a - tay 5579 2702a - lda longreadroutinehiP1,y 5580 2702a - sta inttemp4 5581 2702a - lda longreadroutineloP1,y 5582 2702a - sta inttemp3 5583 2702a - jmp (inttemp3) 5584 2702a -LLRET1 5585 2702a - ldy port0control 5586 2702a - lda longreadtype,y 5587 2702a - beq LLRET0 5588 2702a - tay 5589 2702a - lda longreadroutinehiP0,y 5590 2702a - sta inttemp4 5591 2702a - lda longreadroutineloP0,y 5592 2702a - sta inttemp3 5593 2702a - jmp (inttemp3) 5594 2702a -LLRET0 5595 2702a - 5596 2702a - 5597 2702a - ifconst PADDLERANGE 5598 2702a -TIMEVAL = PADDLERANGE 5599 2702a - else 5600 2702a -TIMEVAL = 160 5601 2702a - endif 5602 2702a -TIMEOFFSET = 10 5603 2702a - 5604 2702a endif ; LONGCONTROLLERREAD 5605 2702a 5606 2702a 5607 2702a 20 e0 f1 jsr servicesfxchannels 5608 2702d - ifconst MUSICTRACKER 5609 2702d - jsr servicesong 5610 2702d endif ; MUSICTRACKER 5611 2702d 5612 2702d ee a4 01 inc framecounter 5613 27030 ad a4 01 lda framecounter 5614 27033 29 3f and #63 5615 27035 d0 08 bne skipcountdownseconds 5616 27037 ad a5 01 lda countdownseconds 5617 2703a f0 03 beq skipcountdownseconds 5618 2703c ce a5 01 dec countdownseconds 5619 2703f skipcountdownseconds 5620 2703f 5621 2703f a2 01 ldx #1 5622 27041 buttonreadloop 5623 27041 8a txa 5624 27042 48 pha 5625 27043 bc b7 01 ldy port0control,x 5626 27046 b9 c3 f1 lda buttonhandlerlo,y 5627 27049 85 da sta inttemp3 5628 2704b b9 b8 f1 lda buttonhandlerhi,y 5629 2704e 85 db sta inttemp4 5630 27050 05 da ora inttemp3 5631 27052 f0 03 beq buttonreadloopreturn 5632 27054 6c da 00 jmp (inttemp3) 5633 27057 buttonreadloopreturn 5634 27057 68 pla 5635 27058 aa tax 5636 27059 ca dex 5637 2705a 10 e5 bpl buttonreadloop 5638 2705c 5639 2705c - ifconst KEYPADSUPPORT 5640 2705c - jsr keypadrowselect 5641 2705c endif ; KEYPADSUPPORT 5642 2705c 5643 2705c 5644 2705c - ifconst DOUBLEBUFFER 5645 2705c - lda doublebufferminimumframeindex 5646 2705c - beq skipdoublebufferminimumframeindexadjust 5647 2705c - dec doublebufferminimumframeindex 5648 2705c -skipdoublebufferminimumframeindexadjust 5649 2705c endif 5650 2705c 5651 2705c 68 pla 5652 2705d a8 tay 5653 2705e 68 pla 5654 2705f aa tax 5655 27060 skiptopscreenroutine 5656 27060 68 pla 5657 27061 40 RTI 5658 27062 5659 27062 IRQ ; the only source of non-nmi interrupt should be the BRK opcode. 5660 27062 ifnconst BREAKPROTECTOFF 5661 27062 a9 1a lda #$1A 5662 27064 85 20 sta BACKGRND 5663 27066 skipbrkolorset 5664 27066 skipbrkdetected 5665 27066 a9 60 lda #$60 5666 27068 8d 07 21 sta sCTRL 5667 2706b 85 3c sta CTRL 5668 2706d ifnconst hiscorefont 5669 2706d 02 .byte.b $02 ; KIL/JAM 5670 2706e - else ; hiscorefont is present 5671 2706e - ifconst CRASHDUMP 5672 2706e - bit MSTAT 5673 2706e - bpl skipbrkdetected ; wait for vblank to ensure we're clear of NMI 5674 2706e - 5675 2706e - ifconst dumpbankswitch 5676 2706e - lda dumpbankswitch 5677 2706e - pha 5678 2706e - endif 5679 2706e - 5680 2706e - ; bankswitch if needed, to get to the hiscore font 5681 2706e - ifconst bankswitchmode 5682 2706e - ifconst included.hiscore.asm.bank 5683 2706e - ifconst MCPDEVCART 5684 2706e - lda #($18 | included.hiscore.asm.bank) 5685 2706e - sta $3000 5686 2706e - else 5687 2706e - lda #(included.hiscore.asm.bank) 5688 2706e - sta $8000 5689 2706e - endif 5690 2706e - endif ; included.hiscore.asm.bank 5691 2706e - endif ; bankswitchmode 5692 2706e - 5693 2706e - ifconst DOUBLEBUFFER 5694 2706e - ;turn off double-buffering, if on... 5695 2706e - lda #>DLLMEM 5696 2706e - sta DPPH 5697 2706e - lda #hiscorefont 5741 2706e - sta CHARBASE 5742 2706e - sta sCHARBASE 5743 2706e - lda #%01000011 ;Enable DMA, mode=320A 5744 2706e - sta CTRL 5745 2706e - sta sCTRL 5746 2706e - .byte $02 ; KIL/JAM 5747 2706e -hiscorehexlut 5748 2706e - ; 0 1 2 3 4 5 6 7 8 9 A B C D E F 5749 2706e - .byte 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 1, 2, 3, 4, 5 5750 2706e -show2700 5751 2706e - ; lo mode hi width=29 x EODL 5752 2706e - .byte $00, %01100000, $27, 3, 20, 0,0,0 5753 2706e - else ; CRASHDUMP 5754 2706e - .byte $02 ; KIL/JAM 5755 2706e - endif ; crashdump 5756 2706e endif ; hiscorefont 5757 2706e - else 5758 2706e - RTI 5759 2706e endif 5760 2706e 5761 2706e - ifconst LONGCONTROLLERREAD 5762 2706e - 5763 2706e -longreadtype 5764 2706e - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 5765 2706e - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 5766 2706e - .byte 3, 3, 0 ; STMOUSE AMOUSE ATARIVOX 5767 2706e - 5768 2706e -longreadroutineloP0 5769 2706e - .byte LLRET0 ; 0 = no routine 5776 2706e - .byte >paddleport0update ; 1 = paddle 5777 2706e - .byte >trakball0update ; 2 = trackball 5778 2706e - .byte >mouse0update ; 3 = mouse 5779 2706e - 5780 2706e -longreadroutineloP1 5781 2706e - .byte LLRET1 ; 0 = no routine 5788 2706e - .byte >paddleport1update ; 1 = paddle 5789 2706e - .byte >trakball1update ; 2 = trackball 5790 2706e - .byte >mouse1update ; 3 = mouse 5791 2706e - 5792 2706e - 5793 2706e -SETTIM64T 5794 2706e - bne skipdefaulttime 5795 2706e - ifnconst PADDLESMOOTHINGOFF 5796 2706e - lda #(TIMEVAL+TIMEOFFSET+1) 5797 2706e - else 5798 2706e - lda #(TIMEVAL+TIMEOFFSET) 5799 2706e - endif 5800 2706e -skipdefaulttime 5801 2706e - tay 5802 2706e - dey 5803 2706e -.setTIM64Tloop 5804 2706e - sta TIM64T 5805 2706e - cpy INTIM 5806 2706e - bne .setTIM64Tloop 5807 2706e - rts 5808 2706e endif ; LONGCONTROLLERREAD 5809 2706e 5810 2706e reallyoffvisible 5811 2706e 85 24 sta WSYNC 5812 27070 5813 27070 a9 00 lda #0 5814 27072 85 4d sta visibleover 5815 27074 - ifconst DEBUGINTERRUPT 5816 27074 - sta BACKGRND 5817 27074 endif 5818 27074 5819 27074 a9 03 lda #3 5820 27076 8d b2 01 sta interruptindex 5821 27079 5822 27079 8a txa 5823 2707a 48 pha 5824 2707b 98 tya 5825 2707c 48 pha 5826 2707d d8 cld 5827 2707e 5828 2707e 5829 2707e 20 5a f1 jsr uninterruptableroutines 5830 27081 5831 27081 - ifconst .userinterrupt 5832 27081 - jsr .userinterrupt 5833 27081 endif 5834 27081 5835 27081 - ifconst KEYPADSUPPORT 5836 27081 - jsr keypadcolumnread 5837 27081 endif 5838 27081 5839 27081 68 pla 5840 27082 a8 tay 5841 27083 68 pla 5842 27084 aa tax 5843 27085 68 pla 5844 27086 40 RTI 5845 27087 5846 27087 clearscreen 5847 27087 a2 17 ldx #(WZONECOUNT-1) 5848 27089 a9 00 lda #0 5849 2708b clearscreenloop 5850 2708b 95 65 sta dlend,x 5851 2708d ca dex 5852 2708e 10 fb bpl clearscreenloop 5853 27090 a9 00 lda #0 5854 27092 8d ad 01 sta valbufend ; clear the bcd value buffer 5855 27095 8d ae 01 sta valbufendsave 5856 27098 60 rts 5857 27099 5858 27099 restorescreen 5859 27099 a2 17 ldx #(WZONECOUNT-1) 5860 2709b a9 00 lda #0 5861 2709d restorescreenloop 5862 2709d b5 82 lda dlendsave,x 5863 2709f 95 65 sta dlend,x 5864 270a1 ca dex 5865 270a2 10 f9 bpl restorescreenloop 5866 270a4 ad ae 01 lda valbufendsave 5867 270a7 8d ad 01 sta valbufend 5868 270aa 60 rts 5869 270ab 5870 270ab savescreen 5871 270ab a2 17 ldx #(WZONECOUNT-1) 5872 270ad savescreenloop 5873 270ad b5 65 lda dlend,x 5874 270af 95 82 sta dlendsave,x 5875 270b1 ca dex 5876 270b2 10 f9 bpl savescreenloop 5877 270b4 ad ad 01 lda valbufend 5878 270b7 8d ae 01 sta valbufendsave 5879 270ba - ifconst DOUBLEBUFFER 5880 270ba - lda doublebufferstate 5881 270ba - beq savescreenrts 5882 270ba - lda #1 5883 270ba - sta doublebufferbufferdirty 5884 270ba -savescreenrts 5885 270ba endif ; DOUBLEBUFFER 5886 270ba 60 rts 5887 270bb 5888 270bb drawscreen 5889 270bb 5890 270bb a9 00 lda #0 5891 270bd 85 42 sta temp1 ; not B&W if we're here... 5892 270bf 5893 270bf drawscreenwait 5894 270bf a5 4d lda visibleover 5895 270c1 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 5896 270c3 5897 270c3 ;restore some registers in case the game changed them mid-screen... 5898 270c3 ad 07 21 lda sCTRL 5899 270c6 05 42 ora temp1 5900 270c8 85 3c sta CTRL 5901 270ca ad 0b 21 lda sCHARBASE 5902 270cd 85 34 sta CHARBASE 5903 270cf 5904 270cf ;ensure all of the display list is terminated... 5905 270cf 20 40 f1 jsr terminatedisplaylist 5906 270d2 5907 270d2 ifnconst pauseroutineoff 5908 270d2 20 dd f0 jsr pauseroutine 5909 270d5 endif ; pauseroutineoff 5910 270d5 5911 270d5 ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 5912 270d5 ; delaying a full frame, but still allowing time for basic calculations. 5913 270d5 visiblescreenstartedwait 5914 270d5 a5 4d lda visibleover 5915 270d7 f0 fc beq visiblescreenstartedwait 5916 270d9 visiblescreenstartedwaitdone 5917 270d9 ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 5918 270dc 60 rts 5919 270dd 5920 270dd ifnconst pauseroutineoff 5921 270dd ; check to see if pause was pressed and released 5922 270dd pauseroutine 5923 270dd ad b3 01 lda pausedisable 5924 270e0 d0 4e bne leavepauseroutine 5925 270e2 a9 08 lda #8 5926 270e4 2c 82 02 bit SWCHB 5927 270e7 f0 29 beq pausepressed 5928 270e9 5929 270e9 ifnconst SOFTRESETASPAUSEOFF 5930 270e9 ifnconst MOUSESUPPORT 5931 270e9 ifnconst TRAKBALLSUPPORT 5932 270e9 ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 5933 270ec 29 70 and #%01110000 ; _LDU 5934 270ee f0 22 beq pausepressed 5935 270f0 endif 5936 270f0 endif 5937 270f0 endif 5938 270f0 5939 270f0 ;pause isn't pressed 5940 270f0 a9 00 lda #0 5941 270f2 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 5942 270f5 5943 270f5 ;check if we're in an already paused state 5944 270f5 ad 00 21 lda pausestate 5945 270f8 f0 36 beq leavepauseroutine ; nope, leave 5946 270fa 5947 270fa c9 01 cmp #1 ; last frame was the start of pausing 5948 270fc f0 2b beq enterpausestate2 ; move from state 1 to 2 5949 270fe 5950 270fe c9 02 cmp #2 5951 27100 f0 34 beq carryonpausing 5952 27102 5953 27102 ;pausestate must be >2, which means we're ending an unpause 5954 27102 a9 00 lda #0 5955 27104 8d ac 01 sta pausebuttonflag 5956 27107 8d 00 21 sta pausestate 5957 2710a ad 07 21 lda sCTRL 5958 2710d 85 3c sta CTRL 5959 2710f 4c 30 f1 jmp leavepauseroutine 5960 27112 5961 27112 pausepressed 5962 27112 ;pause is pressed 5963 27112 ad ac 01 lda pausebuttonflag 5964 27115 c9 ff cmp #$ff 5965 27117 f0 1d beq carryonpausing 5966 27119 5967 27119 ;its a new press, increment the state 5968 27119 ee 00 21 inc pausestate 5969 2711c 5970 2711c ;silence volume at the start and end of pausing 5971 2711c a9 00 lda #0 5972 2711e 85 19 sta AUDV0 5973 27120 85 1a sta AUDV1 5974 27122 5975 27122 - ifconst pokeysupport 5976 27122 - ldy #7 5977 27122 -pausesilencepokeyaudioloop 5978 27122 - sta (pokeybase),y 5979 27122 - dey 5980 27122 - bpl pausesilencepokeyaudioloop 5981 27122 endif ; pokeysupport 5982 27122 5983 27122 a9 ff lda #$ff 5984 27124 8d ac 01 sta pausebuttonflag 5985 27127 d0 0d bne carryonpausing 5986 27129 5987 27129 enterpausestate2 5988 27129 a9 02 lda #2 5989 2712b 8d 00 21 sta pausestate 5990 2712e d0 06 bne carryonpausing 5991 27130 leavepauseroutine 5992 27130 ad 07 21 lda sCTRL 5993 27133 85 3c sta CTRL 5994 27135 60 rts 5995 27136 carryonpausing 5996 27136 - ifconst .pause 5997 27136 - jsr .pause 5998 27136 endif ; .pause 5999 27136 ad 07 21 lda sCTRL 6000 27139 09 80 ora #%10000000 ; turn off colorburst during pause... 6001 2713b 85 3c sta CTRL 6002 2713d 4c dd f0 jmp pauseroutine 6003 27140 endif ; pauseroutineoff 6004 27140 6005 27140 6006 27140 - ifconst DOUBLEBUFFER 6007 27140 -skipterminatedisplaylistreturn 6008 27140 - rts 6009 27140 endif ; DOUBLEBUFFER 6010 27140 terminatedisplaylist 6011 27140 - ifconst DOUBLEBUFFER 6012 27140 - lda doublebufferstate 6013 27140 - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 6014 27140 endif ; DOUBLEBUFFER 6015 27140 terminatedisplaybuffer 6016 27140 ;add DL end entry on each DL 6017 27140 a2 17 ldx #(WZONECOUNT-1) 6018 27142 dlendloop 6019 27142 bd 83 f6 lda DLPOINTL,x 6020 27145 - ifconst DOUBLEBUFFER 6021 27145 - clc 6022 27145 - adc doublebufferdloffset 6023 27145 endif ; DOUBLEBUFFER 6024 27145 85 63 sta dlpnt 6025 27147 bd 6b f6 lda DLPOINTH,x 6026 2714a - ifconst DOUBLEBUFFER 6027 2714a - adc #0 6028 2714a endif ; DOUBLEBUFFER 6029 2714a 85 64 sta dlpnt+1 6030 2714c b4 65 ldy dlend,x 6031 2714e a9 00 lda #$00 6032 27150 dlendmoreloops 6033 27150 c8 iny 6034 27151 91 63 sta (dlpnt),y 6035 27153 - ifconst FRAMESKIPGLITCHFIXWEAK 6036 27153 - cpy #DLLASTOBJ+1 6037 27153 - beq dlendthiszonedone 6038 27153 - iny 6039 27153 - iny 6040 27153 - iny 6041 27153 - iny 6042 27153 - iny 6043 27153 - sta (dlpnt),y 6044 27153 -dlendthiszonedone 6045 27153 endif FRAMESKIPGLITCHFIXWEAK 6046 27153 - ifconst FRAMESKIPGLITCHFIX 6047 27153 - iny 6048 27153 - iny 6049 27153 - iny 6050 27153 - iny 6051 27153 - cpy #DLLASTOBJ-1 6052 27153 - bcc dlendmoreloops 6053 27153 endif ; FRAMESKIPGLITCHFIX 6054 27153 ca dex 6055 27154 10 ec bpl dlendloop 6056 27156 6057 27156 ifnconst pauseroutineoff 6058 27156 20 dd f0 jsr pauseroutine 6059 27159 endif ; pauseroutineoff 6060 27159 60 rts 6061 2715a 6062 2715a uninterruptableroutines 6063 2715a ; this is for routines that must happen off the visible screen, each frame. 6064 2715a 6065 2715a - ifconst AVOXVOICE 6066 2715a - jsr serviceatarivoxqueue 6067 2715a endif 6068 2715a 6069 2715a a9 00 lda #0 6070 2715c 8d b6 01 sta palfastframe 6071 2715f ad 09 21 lda paldetected 6072 27162 f0 10 beq skippalframeadjusting 6073 27164 ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 6074 27164 ae b5 01 ldx palframes 6075 27167 e8 inx 6076 27168 e0 05 cpx #5 6077 2716a d0 05 bne palframeskipdone 6078 2716c ee b6 01 inc palfastframe 6079 2716f a2 00 ldx #0 6080 27171 palframeskipdone 6081 27171 8e b5 01 stx palframes 6082 27174 skippalframeadjusting 6083 27174 6084 27174 - ifconst MUSICTRACKER 6085 27174 - ; We normally run the servicesong routine from the top-screen interrupt, but if it 6086 27174 - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 6087 27174 - ; If that happens, we try again here. Chances are very small we'll run into the same 6088 27174 - ; problem twice, and if we do, we just drop a musical note or two. 6089 27174 - lda sfxschedulemissed 6090 27174 - beq servicesongwasnotmissed 6091 27174 - jsr servicesong 6092 27174 -servicesongwasnotmissed 6093 27174 endif ; MUSICTRACKER 6094 27174 6095 27174 60 rts 6096 27175 6097 27175 serviceatarivoxqueue 6098 27175 - ifconst AVOXVOICE 6099 27175 - lda voxlock 6100 27175 - bne skipvoxprocessing ; the vox is in the middle of speech address update 6101 27175 -skipvoxqueuesizedec 6102 27175 - jmp processavoxvoice 6103 27175 -skipvoxprocessing 6104 27175 - rts 6105 27175 - 6106 27175 -processavoxvoice 6107 27175 - lda avoxenable 6108 27175 - bne avoxfixport 6109 27175 - SPKOUT tempavox 6110 27175 - rts 6111 27175 -avoxfixport 6112 27175 - lda #0 ; restore the port to all bits as inputs... 6113 27175 - sta CTLSWA 6114 27175 - rts 6115 27175 -silenceavoxvoice 6116 27175 - SPEAK avoxsilentdata 6117 27175 - rts 6118 27175 -avoxsilentdata 6119 27175 - .byte 31,255 6120 27175 else 6121 27175 60 rts 6122 27176 endif ; AVOXVOICE 6123 27176 6124 27176 joybuttonhandler 6125 27176 8a txa 6126 27177 0a asl 6127 27178 a8 tay 6128 27179 b9 08 00 lda INPT0,y 6129 2717c 4a lsr 6130 2717d 9d 02 21 sta sINPT1,x 6131 27180 b9 09 00 lda INPT1,y 6132 27183 29 80 and #%10000000 6133 27185 1d 02 21 ora sINPT1,x 6134 27188 9d 02 21 sta sINPT1,x 6135 2718b 6136 2718b b5 0c lda INPT4,x 6137 2718d 30 19 bmi .skip1bjoyfirecheck 6138 2718f ;one button joystick is down 6139 2718f 49 80 eor #%10000000 6140 27191 9d 02 21 sta sINPT1,x 6141 27194 6142 27194 ad b1 01 lda joybuttonmode 6143 27197 3d ab f1 and twobuttonmask,x 6144 2719a f0 0c beq .skip1bjoyfirecheck 6145 2719c ad b1 01 lda joybuttonmode 6146 2719f 1d ab f1 ora twobuttonmask,x 6147 271a2 8d b1 01 sta joybuttonmode 6148 271a5 8d 82 02 sta SWCHB 6149 271a8 .skip1bjoyfirecheck 6150 271a8 4c 57 f0 jmp buttonreadloopreturn 6151 271ab 6152 271ab twobuttonmask 6153 271ab 04 10 .byte.b %00000100,%00010000 6154 271ad 6155 271ad gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 6156 271ad - ifconst LIGHTGUNSUPPORT 6157 271ad - cpx #0 6158 271ad - bne secondportgunhandler 6159 271ad -firstportgunhandler 6160 271ad - lda SWCHA 6161 271ad - asl 6162 271ad - asl 6163 271ad - asl ; shift D4 to D7 6164 271ad - and #%10000000 6165 271ad - eor #%10000000 6166 271ad - sta sINPT1 6167 271ad - jmp buttonreadloopreturn 6168 271ad -secondportgunhandler 6169 271ad - lda SWCHA 6170 271ad - lsr ; shift D0 into carry 6171 271ad - lsr ; shift carry into D7 6172 271ad - and #%10000000 6173 271ad - eor #%10000000 6174 271ad - sta sINPT3 6175 271ad - jmp buttonreadloopreturn 6176 271ad endif ; LIGHTGUNSUPPORT 6177 271ad 6178 271ad controlsusing2buttoncode 6179 271ad 00 .byte.b 0 ; 00=no controller plugged in 6180 271ae 01 .byte.b 1 ; 01=proline joystick 6181 271af 00 .byte.b 0 ; 02=lightgun 6182 271b0 00 .byte.b 0 ; 03=paddle 6183 271b1 01 .byte.b 1 ; 04=trakball 6184 271b2 01 .byte.b 1 ; 05=vcs joystick 6185 271b3 01 .byte.b 1 ; 06=driving control 6186 271b4 00 .byte.b 0 ; 07=keypad control 6187 271b5 00 .byte.b 0 ; 08=st mouse/cx80 6188 271b6 00 .byte.b 0 ; 09=amiga mouse 6189 271b7 01 .byte.b 1 ; 10=atarivox 6190 271b8 6191 271b8 buttonhandlerhi 6192 271b8 00 .byte.b 0 ; 00=no controller plugged in 6193 271b9 f1 .byte.b >joybuttonhandler ; 01=proline joystick 6194 271ba f1 .byte.b >gunbuttonhandler ; 02=lightgun 6195 271bb f5 .byte.b >paddlebuttonhandler ; 03=paddle 6196 271bc f1 .byte.b >joybuttonhandler ; 04=trakball 6197 271bd f1 .byte.b >joybuttonhandler ; 05=vcs joystick 6198 271be f1 .byte.b >joybuttonhandler ; 06=driving control 6199 271bf 00 .byte.b 0 ; 07=keypad 6200 271c0 f5 .byte.b >mousebuttonhandler ; 08=st mouse 6201 271c1 f5 .byte.b >mousebuttonhandler ; 09=amiga mouse 6202 271c2 f1 .byte.b >joybuttonhandler ; 10=atarivox 6203 271c3 buttonhandlerlo 6204 271c3 00 .byte.b 0 ; 00=no controller plugged in 6205 271c4 76 .byte.b $0F means the sound is looped while priority is active 6306 27221 6307 27221 05 d9 ora inttemp2 6308 27223 05 d8 ora inttemp1 ; check if F|C|V=0 6309 27225 f0 23 beq zerosfx ; if so, we're at the end of the sound. 6310 27227 6311 27227 advancesfxpointer 6312 27227 ; advance the pointer to the next sound chunk 6313 27227 c8 iny 6314 27228 84 da sty inttemp3 6315 2722a 18 clc 6316 2722b b5 4e lda sfx1pointlo,x 6317 2722d 65 da adc inttemp3 6318 2722f 95 4e sta sfx1pointlo,x 6319 27231 b5 50 lda sfx1pointhi,x 6320 27233 69 00 adc #0 6321 27235 95 50 sta sfx1pointhi,x 6322 27237 4c e2 f1 jmp servicesfxchannelsloop 6323 2723a 6324 2723a sfxsoundloop 6325 2723a 48 pha 6326 2723b b5 52 lda sfx1priority,x 6327 2723d d0 04 bne sfxsoundloop_carryon 6328 2723f 68 pla ; fix the stack before we go 6329 27240 4c 27 f2 jmp advancesfxpointer 6330 27243 sfxsoundloop_carryon 6331 27243 68 pla 6332 27244 29 f0 and #$F0 6333 27246 4a lsr 6334 27247 4a lsr 6335 27248 4a lsr 6336 27249 4a lsr 6337 2724a 6338 2724a zerosfx 6339 2724a 95 4e sta sfx1pointlo,x 6340 2724c 95 50 sta sfx1pointhi,x 6341 2724e 95 52 sta sfx1priority,x 6342 27250 4c e2 f1 jmp servicesfxchannelsloop 6343 27253 6344 27253 6345 27253 schedulesfx 6346 27253 ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 6347 27253 a0 00 ldy #0 6348 27255 b1 e0 lda (sfxinstrumentlo),y 6349 27257 - ifconst pokeysupport 6350 27257 - cmp #$20 ; POKEY? 6351 27257 - bne scheduletiasfx 6352 27257 - jmp schedulepokeysfx 6353 27257 endif 6354 27257 scheduletiasfx 6355 27257 ;cmp #$10 ; TIA? 6356 27257 ;beq continuescheduletiasfx 6357 27257 ; rts ; unhandled!!! 6358 27257 continuescheduletiasfx 6359 27257 ifnconst TIASFXMONO 6360 27257 a5 4e lda sfx1pointlo 6361 27259 05 50 ora sfx1pointhi 6362 2725b f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 6363 2725d a5 4f lda sfx2pointlo 6364 2725f 05 51 ora sfx2pointhi 6365 27261 f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 6366 27263 ; Both channels are scheduled. 6367 27263 a0 01 ldy #1 6368 27265 b1 e0 lda (sfxinstrumentlo),y 6369 27267 d0 01 bne interruptsfx 6370 27269 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 6371 2726a interruptsfx 6372 2726a ;Compare which active sound has a lower priority. We'll interrupt the lower one. 6373 2726a a5 52 lda sfx1priority 6374 2726c c5 53 cmp sfx2priority 6375 2726e b0 04 bcs schedulesfx2 6376 27270 endif ; !TIASFXMONO 6377 27270 6378 27270 schedulesfx1 6379 27270 a2 00 ldx #0 ; channel 1 6380 27272 ifnconst TIASFXMONO 6381 27272 f0 02 beq skipschedulesfx2 6382 27274 schedulesfx2 6383 27274 a2 01 ldx #1 ; channel 2 6384 27276 skipschedulesfx2 6385 27276 endif ; !TIASFXMONO 6386 27276 6387 27276 - ifconst MUSICTRACKER 6388 27276 - lda sfxnoteindex 6389 27276 - bpl skipdrumkitoverride 6390 27276 - and #$7F ; subtract 128 6391 27276 - sec 6392 27276 - sbc #4 ; drums start at 132, i.e. octave 10 6393 27276 - asl 6394 27276 - tay 6395 27276 - lda tiadrumkitdefinition,y 6396 27276 - sta sfxinstrumentlo 6397 27276 - iny 6398 27276 - lda tiadrumkitdefinition,y 6399 27276 - sta sfxinstrumenthi 6400 27276 - lda #0 6401 27276 - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 6402 27276 -skipdrumkitoverride 6403 27276 endif ; MUSICTRACKER 6404 27276 a0 01 ldy #1 ; get priority and sound-resolution (in frames) 6405 27278 b1 e0 lda (sfxinstrumentlo),y 6406 2727a 95 52 sta sfx1priority,x 6407 2727c c8 iny 6408 2727d b1 e0 lda (sfxinstrumentlo),y 6409 2727f 95 56 sta sfx1frames,x 6410 27281 a5 e0 lda sfxinstrumentlo 6411 27283 18 clc 6412 27284 69 03 adc #3 6413 27286 95 4e sta sfx1pointlo,x 6414 27288 a5 e1 lda sfxinstrumenthi 6415 2728a 69 00 adc #0 6416 2728c 95 50 sta sfx1pointhi,x 6417 2728e a5 e2 lda sfxpitchoffset 6418 27290 95 54 sta sfx1poffset,x 6419 27292 a9 00 lda #0 6420 27294 95 58 sta sfx1tick,x 6421 27296 a5 e3 lda sfxnoteindex 6422 27298 95 cd sta sfx1notedata,x 6423 2729a 60 rts 6424 2729b 6425 2729b plotsprite 6426 2729b ifnconst NODRAWWAIT 6427 2729b - ifconst DOUBLEBUFFER 6428 2729b - lda doublebufferstate 6429 2729b - bne skipplotspritewait 6430 2729b endif ; DOUBLEBUFFER 6431 2729b - ifconst DEBUGWAITCOLOR 6432 2729b - lda #$41 6433 2729b - sta BACKGRND 6434 2729b endif 6435 2729b plotspritewait 6436 2729b a5 4d lda visibleover 6437 2729d d0 fc bne plotspritewait 6438 2729f skipplotspritewait 6439 2729f - ifconst DEBUGWAITCOLOR 6440 2729f - lda #$0 6441 2729f - sta BACKGRND 6442 2729f endif 6443 2729f endif 6444 2729f 6445 2729f ;arguments: 6446 2729f ; temp1=lo graphicdata 6447 2729f ; temp2=hi graphicdata 6448 2729f ; temp3=palette | width byte 6449 2729f ; temp4=x 6450 2729f ; temp5=y 6451 2729f ; temp6=mode 6452 2729f a5 46 lda temp5 ;Y position 6453 272a1 4a lsr ; 2 - Divide by 8 or 16 6454 272a2 4a lsr ; 2 6455 272a3 4a lsr ; 2 6456 272a4 - if WZONEHEIGHT = 16 6457 272a4 - lsr ; 2 6458 272a4 endif 6459 272a4 6460 272a4 aa tax 6461 272a5 6462 272a5 ifnconst NOLIMITCHECKING 6463 272a5 6464 272a5 ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 6465 272a5 6466 272a5 c9 18 cmp #WZONECOUNT 6467 272a7 6468 272a7 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 6469 272a9 ; otherwise, check to see if the bottom half is in zone 0... 6470 272a9 6471 272a9 - if WZONEHEIGHT = 16 6472 272a9 - cmp #15 6473 272a9 else 6474 272a9 c9 1f cmp #31 6475 272ab endif 6476 272ab 6477 272ab d0 05 bne exitplotsprite1 6478 272ad a2 00 ldx #0 6479 272af 4c ec f2 jmp continueplotsprite2 6480 272b2 exitplotsprite1 6481 272b2 60 rts 6482 272b3 6483 272b3 continueplotsprite1 6484 272b3 endif 6485 272b3 6486 272b3 bd 83 f6 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 6487 272b6 - ifconst DOUBLEBUFFER 6488 272b6 - clc 6489 272b6 - adc doublebufferdloffset 6490 272b6 endif ; DOUBLEBUFFER 6491 272b6 85 63 sta dlpnt 6492 272b8 bd 6b f6 lda DLPOINTH,x 6493 272bb - ifconst DOUBLEBUFFER 6494 272bb - adc #0 6495 272bb endif ; DOUBLEBUFFER 6496 272bb 85 64 sta dlpnt+1 6497 272bd 6498 272bd ;Create DL entry for upper part of sprite 6499 272bd 6500 272bd b4 65 ldy dlend,x ;Get the index to the end of this DL 6501 272bf 6502 272bf ifconst CHECKOVERWRITE 6503 272bf c0 4b cpy #DLLASTOBJ 6504 272c1 f0 21 beq checkcontinueplotsprite2 6505 272c3 continueplotsprite1a 6506 272c3 endif 6507 272c3 6508 272c3 a5 42 lda temp1 ; graphic data, lo byte 6509 272c5 91 63 sta (dlpnt),y ;Low byte of data address 6510 272c7 6511 272c7 ifnconst ATOMICSPRITEUPDATE 6512 272c7 c8 iny 6513 272c8 a5 47 lda temp6 6514 272ca 91 63 sta (dlpnt),y 6515 272cc - else 6516 272cc - iny 6517 272cc - sty temp8 6518 272cc endif 6519 272cc 6520 272cc c8 iny 6521 272cd 6522 272cd a5 46 lda temp5 ;Y position 6523 272cf 29 07 and #(WZONEHEIGHT - 1) 6524 272d1 c9 01 cmp #1 ; clear carry if our sprite is just in this zone 6525 272d3 05 43 ora temp2 ; graphic data, hi byte 6526 272d5 91 63 sta (dlpnt),y 6527 272d7 6528 272d7 6529 272d7 c8 iny 6530 272d8 a5 44 lda temp3 ;palette|width 6531 272da 91 63 sta (dlpnt),y 6532 272dc 6533 272dc c8 iny 6534 272dd a5 45 lda temp4 ;Horizontal position 6535 272df 91 63 sta (dlpnt),y 6536 272e1 6537 272e1 c8 iny 6538 272e2 94 65 sty dlend,x 6539 272e4 6540 272e4 - ifconst ALWAYSTERMINATE 6541 272e4 - iny 6542 272e4 - lda #0 6543 272e4 - sta (dlpnt),y 6544 272e4 endif 6545 272e4 6546 272e4 - ifconst ATOMICSPRITEUPDATE 6547 272e4 - ldy temp8 6548 272e4 - lda temp6 6549 272e4 - sta (dlpnt),y 6550 272e4 endif 6551 272e4 6552 272e4 checkcontinueplotsprite2 6553 272e4 6554 272e4 90 38 bcc doneSPDL ;branch if the sprite was fully in the last zone 6555 272e6 6556 272e6 ;Create DL entry for lower part of sprite 6557 272e6 6558 272e6 e8 inx ;Next region 6559 272e7 6560 272e7 ifnconst NOLIMITCHECKING 6561 272e7 e0 18 cpx #WZONECOUNT 6562 272e9 6563 272e9 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 6564 272eb 60 rts 6565 272ec continueplotsprite2 6566 272ec endif 6567 272ec 6568 272ec bd 83 f6 lda DLPOINTL,x ;Get pointer to next DL 6569 272ef - ifconst DOUBLEBUFFER 6570 272ef - clc 6571 272ef - adc doublebufferdloffset 6572 272ef endif ; DOUBLEBUFFER 6573 272ef 85 63 sta dlpnt 6574 272f1 bd 6b f6 lda DLPOINTH,x 6575 272f4 - ifconst DOUBLEBUFFER 6576 272f4 - adc #0 6577 272f4 endif ; DOUBLEBUFFER 6578 272f4 85 64 sta dlpnt+1 6579 272f6 b4 65 ldy dlend,x ;Get the index to the end of this DL 6580 272f8 6581 272f8 ifconst CHECKOVERWRITE 6582 272f8 c0 4b cpy #DLLASTOBJ 6583 272fa d0 01 bne continueplotsprite2a 6584 272fc 60 rts 6585 272fd continueplotsprite2a 6586 272fd endif 6587 272fd 6588 272fd a5 42 lda temp1 ; graphic data, lo byte 6589 272ff 91 63 sta (dlpnt),y 6590 27301 6591 27301 ifnconst ATOMICSPRITEUPDATE 6592 27301 c8 iny 6593 27302 a5 47 lda temp6 6594 27304 91 63 sta (dlpnt),y 6595 27306 - else 6596 27306 - iny 6597 27306 - sty temp8 6598 27306 endif 6599 27306 6600 27306 c8 iny 6601 27307 6602 27307 a5 46 lda temp5 ;Y position 6603 27309 0b 07 anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 6604 2730b 05 43 ora temp2 ; graphic data, hi byte 6605 2730d e9 07 sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 6606 2730f 91 63 sta (dlpnt),y 6607 27311 6608 27311 c8 iny 6609 27312 6610 27312 a5 44 lda temp3 ;palette|width 6611 27314 91 63 sta (dlpnt),y 6612 27316 6613 27316 c8 iny 6614 27317 6615 27317 a5 45 lda temp4 ;Horizontal position 6616 27319 91 63 sta (dlpnt),y 6617 2731b 6618 2731b c8 iny 6619 2731c 94 65 sty dlend,x 6620 2731e 6621 2731e - ifconst ALWAYSTERMINATE 6622 2731e - iny 6623 2731e - lda #0 6624 2731e - sta (dlpnt),y 6625 2731e endif 6626 2731e 6627 2731e - ifconst ATOMICSPRITEUPDATE 6628 2731e - ldy temp8 6629 2731e - lda temp6 6630 2731e - sta (dlpnt),y 6631 2731e endif 6632 2731e 6633 2731e doneSPDL 6634 2731e 60 rts 6635 2731f 6636 2731f 6637 2731f lockzonex 6638 2731f - ifconst ZONELOCKS 6639 2731f - ldy dlend,x 6640 2731f - cpy #DLLASTOBJ 6641 2731f - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 6642 2731f - lda DLPOINTL,x 6643 2731f - ifconst DOUBLEBUFFER 6644 2731f - clc 6645 2731f - adc doublebufferdloffset 6646 2731f - endif ; DOUBLEBUFFER 6647 2731f - sta dlpnt 6648 2731f - lda DLPOINTH,x 6649 2731f - ifconst DOUBLEBUFFER 6650 2731f - adc #0 6651 2731f - endif ; DOUBLEBUFFER 6652 2731f - sta dlpnt+1 6653 2731f - iny 6654 2731f - lda #0 6655 2731f - sta (dlpnt),y 6656 2731f - dey 6657 2731f - tya 6658 2731f - ldy #(DLLASTOBJ-1) 6659 2731f - sta (dlpnt),y 6660 2731f - iny 6661 2731f - sty dlend,x 6662 2731f -lockzonexreturn 6663 2731f - rts 6664 2731f endif ; ZONELOCKS 6665 2731f unlockzonex 6666 2731f - ifconst ZONELOCKS 6667 2731f - ldy dlend,x 6668 2731f - cpy #DLLASTOBJ 6669 2731f - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 6670 2731f - lda DLPOINTL,x 6671 2731f - ifconst DOUBLEBUFFER 6672 2731f - clc 6673 2731f - adc doublebufferdloffset 6674 2731f - endif ; DOUBLEBUFFER 6675 2731f - sta dlpnt 6676 2731f - lda DLPOINTH,x 6677 2731f - ifconst DOUBLEBUFFER 6678 2731f - adc #0 6679 2731f - endif ; DOUBLEBUFFER 6680 2731f - sta dlpnt+1 6681 2731f - dey 6682 2731f - ;ldy #(DLLASTOBJ-1) 6683 2731f - lda (dlpnt),y 6684 2731f - tay 6685 2731f - sty dlend,x 6686 2731f -unlockzonexreturn 6687 2731f endif ; ZONELOCKS 6688 2731f 60 rts 6689 27320 6690 27320 plotcharloop 6691 27320 ; ** read from a data indirectly pointed to from temp8,temp9 6692 27320 ; ** format is: lo_data, hi_data, palette|width, x, y 6693 27320 ; ** format ends with lo_data | hi_data = 0 6694 27320 6695 27320 - ifconst DOUBLEBUFFER 6696 27320 - lda doublebufferstate 6697 27320 - bne skipplotcharloopwait 6698 27320 endif ; DOUBLEBUFFER 6699 27320 - ifconst DEBUGWAITCOLOR 6700 27320 - lda #$61 6701 27320 - sta BACKGRND 6702 27320 endif 6703 27320 plotcharloopwait 6704 27320 a5 4d lda visibleover 6705 27322 d0 fc bne plotcharloopwait 6706 27324 - ifconst DEBUGWAITCOLOR 6707 27324 - lda #0 6708 27324 - sta BACKGRND 6709 27324 endif 6710 27324 skipplotcharloopwait 6711 27324 plotcharlooploop 6712 27324 a0 00 ldy #0 6713 27326 b1 49 lda (temp8),y 6714 27328 85 42 sta temp1 6715 2732a c8 iny 6716 2732b b1 49 lda (temp8),y 6717 2732d 85 43 sta temp2 6718 2732f 05 42 ora temp1 6719 27331 d0 01 bne plotcharloopcontinue 6720 27333 ;the pointer=0, so return 6721 27333 60 rts 6722 27334 plotcharloopcontinue 6723 27334 c8 iny 6724 27335 b1 49 lda (temp8),y 6725 27337 85 44 sta temp3 6726 27339 c8 iny 6727 2733a b1 49 lda (temp8),y 6728 2733c 85 45 sta temp4 6729 2733e c8 iny 6730 2733f b1 49 lda (temp8),y 6731 27341 ;sta temp5 ; not needed with our late entry. 6732 27341 20 5a f3 jsr plotcharactersskipentry 6733 27344 a5 49 lda temp8 6734 27346 18 clc 6735 27347 69 05 adc #5 6736 27349 85 49 sta temp8 6737 2734b a5 4a lda temp9 6738 2734d 69 00 adc #0 6739 2734f 85 4a sta temp9 6740 27351 4c 24 f3 jmp plotcharlooploop 6741 27354 6742 27354 plotcharacters 6743 27354 - ifconst DOUBLEBUFFER 6744 27354 - lda doublebufferstate 6745 27354 - bne skipplotcharacterswait 6746 27354 endif ; DOUBLEBUFFER 6747 27354 - ifconst DEBUGWAITCOLOR 6748 27354 - lda #$41 6749 27354 - sta BACKGRND 6750 27354 endif 6751 27354 plotcharacterswait 6752 27354 a5 4d lda visibleover 6753 27356 d0 fc bne plotcharacterswait 6754 27358 - ifconst DEBUGWAITCOLOR 6755 27358 - sta BACKGRND 6756 27358 endif 6757 27358 skipplotcharacterswait 6758 27358 ;arguments: 6759 27358 ; temp1=lo charactermap 6760 27358 ; temp2=hi charactermap 6761 27358 ; temp3=palette | width byte 6762 27358 ; temp4=x 6763 27358 ; temp5=y 6764 27358 6765 27358 a5 46 lda temp5 ;Y position 6766 2735a 6767 2735a plotcharactersskipentry 6768 2735a 6769 2735a ;ifconst ZONEHEIGHT 6770 2735a ; if ZONEHEIGHT = 16 6771 2735a ; and #$0F 6772 2735a ; endif 6773 2735a ; if ZONEHEIGHT = 8 6774 2735a ; and #$1F 6775 2735a ; endif 6776 2735a ;else 6777 2735a ; and #$0F 6778 2735a ;endif 6779 2735a 6780 2735a aa tax 6781 2735b bd 83 f6 lda DLPOINTL,x ;Get pointer to DL that the characters are in 6782 2735e - ifconst DOUBLEBUFFER 6783 2735e - clc 6784 2735e - adc doublebufferdloffset 6785 2735e endif ; DOUBLEBUFFER 6786 2735e 85 63 sta dlpnt 6787 27360 bd 6b f6 lda DLPOINTH,x 6788 27363 - ifconst DOUBLEBUFFER 6789 27363 - adc #0 6790 27363 endif ; DOUBLEBUFFER 6791 27363 85 64 sta dlpnt+1 6792 27365 6793 27365 ;Create DL entry for the characters 6794 27365 6795 27365 b4 65 ldy dlend,x ;Get the index to the end of this DL 6796 27367 6797 27367 ifconst CHECKOVERWRITE 6798 27367 c0 4b cpy #DLLASTOBJ 6799 27369 d0 01 bne continueplotcharacters 6800 2736b 60 rts 6801 2736c continueplotcharacters 6802 2736c endif 6803 2736c 6804 2736c a5 42 lda temp1 ; character map data, lo byte 6805 2736e 91 63 sta (dlpnt),y ;(1) store low address 6806 27370 6807 27370 c8 iny 6808 27371 ad 06 21 lda charactermode 6809 27374 91 63 sta (dlpnt),y ;(2) store mode 6810 27376 6811 27376 c8 iny 6812 27377 a5 43 lda temp2 ; character map, hi byte 6813 27379 91 63 sta (dlpnt),y ;(3) store high address 6814 2737b 6815 2737b c8 iny 6816 2737c a5 44 lda temp3 ;palette|width 6817 2737e 91 63 sta (dlpnt),y ;(4) store palette|width 6818 27380 6819 27380 c8 iny 6820 27381 a5 45 lda temp4 ;Horizontal position 6821 27383 91 63 sta (dlpnt),y ;(5) store horizontal position 6822 27385 6823 27385 c8 iny 6824 27386 94 65 sty dlend,x ; save display list end byte 6825 27388 60 rts 6826 27389 6827 27389 6828 27389 - ifconst plotvalueonscreen 6829 27389 -plotcharacterslive 6830 27389 - ; a version of plotcharacters that draws live and minimally disrupts the screen... 6831 27389 - 6832 27389 - ;arguments: 6833 27389 - ; temp1=lo charactermap 6834 27389 - ; temp2=hi charactermap 6835 27389 - ; temp3=palette | width byte 6836 27389 - ; temp4=x 6837 27389 - ; temp5=y 6838 27389 - 6839 27389 - lda temp5 ;Y position 6840 27389 - 6841 27389 - tax 6842 27389 - lda DLPOINTL,x ;Get pointer to DL that the characters are in 6843 27389 - ifconst DOUBLEBUFFER 6844 27389 - clc 6845 27389 - adc doublebufferdloffset 6846 27389 - endif ; DOUBLEBUFFER 6847 27389 - sta dlpnt 6848 27389 - lda DLPOINTH,x 6849 27389 - ifconst DOUBLEBUFFER 6850 27389 - adc #0 6851 27389 - endif ; DOUBLEBUFFER 6852 27389 - sta dlpnt+1 6853 27389 - 6854 27389 - ;Create DL entry for the characters 6855 27389 - 6856 27389 - ldy dlend,x ;Get the index to the end of this DL 6857 27389 - 6858 27389 - ifconst CHECKOVERWRITE 6859 27389 - cpy #DLLASTOBJ 6860 27389 - bne continueplotcharacterslive 6861 27389 - rts 6862 27389 -continueplotcharacterslive 6863 27389 - endif 6864 27389 - 6865 27389 - lda temp1 ; character map data, lo byte 6866 27389 - sta (dlpnt),y ;(1) store low address 6867 27389 - 6868 27389 - iny 6869 27389 - ; we don't add the second byte yet, since the charmap could briefly 6870 27389 - ; render without a proper character map address, width, or position. 6871 27389 - lda charactermode 6872 27389 - sta (dlpnt),y ;(2) store mode 6873 27389 - 6874 27389 - iny 6875 27389 - lda temp2 ; character map, hi byte 6876 27389 - sta (dlpnt),y ;(3) store high address 6877 27389 - 6878 27389 - iny 6879 27389 - lda temp3 ;palette|width 6880 27389 - sta (dlpnt),y ;(4) store palette|width 6881 27389 - 6882 27389 - iny 6883 27389 - lda temp4 ;Horizontal position 6884 27389 - sta (dlpnt),y ;(5) store horizontal position 6885 27389 - 6886 27389 - iny 6887 27389 - sty dlend,x ; save display list end byte 6888 27389 - 6889 27389 - rts 6890 27389 endif ;plotcharacterslive 6891 27389 6892 27389 ifconst USED_PLOTVALUE 6893 27389 plotvalue 6894 27389 ; calling 7800basic command: 6895 27389 ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6896 27389 ; ...displays the variable as BCD digits 6897 27389 ; 6898 27389 ; asm sub arguments: 6899 27389 ; temp1=lo charactermap 6900 27389 ; temp2=hi charactermap 6901 27389 ; temp3=palette | width byte 6902 27389 ; temp4=x 6903 27389 ; temp5=y 6904 27389 ; temp6=number of digits 6905 27389 ; temp7=lo variable 6906 27389 ; temp8=hi variable 6907 27389 ; temp9=character mode 6908 27389 6909 27389 00 47 plotdigitcount = temp6 6910 27389 6911 27389 - ifconst ZONELOCKS 6912 27389 - ldx temp5 6913 27389 - ldy dlend,x 6914 27389 - cpy #DLLASTOBJ 6915 27389 - bne carryonplotvalue 6916 27389 - rts 6917 27389 -carryonplotvalue 6918 27389 endif 6919 27389 6920 27389 a9 00 lda #0 6921 2738b a8 tay 6922 2738c ae ad 01 ldx valbufend 6923 2738f 6924 2738f a5 47 lda plotdigitcount 6925 27391 29 01 and #1 6926 27393 f0 07 beq pvnibble2char 6927 27395 a9 00 lda #0 6928 27397 9d 00 20 sta VALBUFFER,x ; just in case we skip this digit 6929 2739a f0 11 beq pvnibble2char_skipnibble 6930 2739c 6931 2739c pvnibble2char 6932 2739c ; high nibble... 6933 2739c b1 48 lda (temp7),y 6934 2739e 29 f0 and #$f0 6935 273a0 4a lsr 6936 273a1 4a lsr 6937 273a2 4a lsr 6938 273a3 ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6939 273a3 4a lsr 6940 273a4 endif 6941 273a4 6942 273a4 18 clc 6943 273a5 65 42 adc temp1 ; add the offset to character graphics to our value 6944 273a7 9d 00 20 sta VALBUFFER,x 6945 273aa e8 inx 6946 273ab c6 47 dec plotdigitcount 6947 273ad 6948 273ad pvnibble2char_skipnibble 6949 273ad ; low nibble... 6950 273ad b1 48 lda (temp7),y 6951 273af 29 0f and #$0f 6952 273b1 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6953 273b1 - asl 6954 273b1 endif 6955 273b1 18 clc 6956 273b2 65 42 adc temp1 ; add the offset to character graphics to our value 6957 273b4 9d 00 20 sta VALBUFFER,x 6958 273b7 e8 inx 6959 273b8 c8 iny 6960 273b9 6961 273b9 c6 47 dec plotdigitcount 6962 273bb d0 df bne pvnibble2char 6963 273bd 6964 273bd ;point to the start of our valuebuffer 6965 273bd 18 clc 6966 273be a9 00 lda #VALBUFFER 6970 273c7 69 00 adc #0 6971 273c9 85 43 sta temp2 6972 273cb 6973 273cb ;advance valbufend to the end of our value buffer 6974 273cb 8e ad 01 stx valbufend 6975 273ce 6976 273ce ifnconst plotvalueonscreen 6977 273ce 4c 54 f3 jmp plotcharacters 6978 273d1 - else 6979 273d1 - jmp plotcharacterslive 6980 273d1 endif 6981 273d1 6982 273d1 endif ; USED_PLOTVALUE 6983 273d1 6984 273d1 6985 273d1 - ifconst USED_PLOTVALUEEXTRA 6986 273d1 -plotdigitcount = temp6 6987 273d1 -plotvalueextra 6988 273d1 - ; calling 7800basic command: 6989 273d1 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6990 273d1 - ; ...displays the variable as BCD digits 6991 273d1 - ; 6992 273d1 - ; asm sub arguments: 6993 273d1 - ; temp1=lo charactermap 6994 273d1 - ; temp2=hi charactermap 6995 273d1 - ; temp3=palette | width byte 6996 273d1 - ; temp4=x 6997 273d1 - ; temp5=y 6998 273d1 - ; temp6=number of digits 6999 273d1 - ; temp7=lo variable 7000 273d1 - ; temp8=hi variable 7001 273d1 - 7002 273d1 - lda #0 7003 273d1 - tay 7004 273d1 - ldx valbufend 7005 273d1 - ifnconst plotvalueonscreen 7006 273d1 - sta VALBUFFER,x 7007 273d1 - endif 7008 273d1 - 7009 273d1 - lda plotdigitcount 7010 273d1 - and #1 7011 273d1 - 7012 273d1 - bne pvnibble2char_skipnibbleextra 7013 273d1 - 7014 273d1 -pvnibble2charextra 7015 273d1 - ; high nibble... 7016 273d1 - lda (temp7),y 7017 273d1 - and #$f0 7018 273d1 - lsr 7019 273d1 - lsr 7020 273d1 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 7021 273d1 - lsr 7022 273d1 - endif 7023 273d1 - clc 7024 273d1 - adc temp1 ; add the offset to character graphics to our value 7025 273d1 - sta VALBUFFER,x 7026 273d1 - inx 7027 273d1 - 7028 273d1 - ; second half of the digit 7029 273d1 - clc 7030 273d1 - adc #1 7031 273d1 - sta VALBUFFER,x 7032 273d1 - inx 7033 273d1 - 7034 273d1 -pvnibble2char_skipnibbleextra 7035 273d1 - ; low nibble... 7036 273d1 - lda (temp7),y 7037 273d1 - and #$0f 7038 273d1 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 7039 273d1 - asl 7040 273d1 - endif 7041 273d1 - asl 7042 273d1 - 7043 273d1 - clc 7044 273d1 - adc temp1 ; add the offset to character graphics to our value 7045 273d1 - sta VALBUFFER,x 7046 273d1 - inx 7047 273d1 - 7048 273d1 - clc 7049 273d1 - adc #1 7050 273d1 - sta VALBUFFER,x 7051 273d1 - inx 7052 273d1 - iny 7053 273d1 - 7054 273d1 - dec plotdigitcount 7055 273d1 - bne pvnibble2charextra 7056 273d1 - 7057 273d1 - ;point to the start of our valuebuffer 7058 273d1 - clc 7059 273d1 - lda #VALBUFFER 7063 273d1 - adc #0 7064 273d1 - sta temp2 7065 273d1 - 7066 273d1 - ;advance valbufend to the end of our value buffer 7067 273d1 - stx valbufend 7068 273d1 - 7069 273d1 - ifnconst plotvalueonscreen 7070 273d1 - jmp plotcharacters 7071 273d1 - else 7072 273d1 - jmp plotcharacterslive 7073 273d1 - endif 7074 273d1 endif ; USED_PLOTVALUEEXTRA 7075 273d1 7076 273d1 boxcollision 7077 273d1 ifconst BOXCOLLISION 7078 273d1 ; the worst case cycle-time for the code below is 43 cycles. 7079 273d1 ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 7080 273d1 7081 273d1 ;__boxx1 = accumulator 7082 273d1 ;__boxy1 = y 7083 273d1 00 44 __boxw1 = temp3 7084 273d1 00 45 __boxh1 = temp4 7085 273d1 7086 273d1 00 46 __boxx2 = temp5 7087 273d1 00 47 __boxy2 = temp6 7088 273d1 00 48 __boxw2 = temp7 7089 273d1 00 49 __boxh2 = temp8 7090 273d1 7091 273d1 DoXCollisionCheck 7092 273d1 ;lda __boxx1 ; skipped. already in the accumulator 7093 273d1 c5 46 cmp __boxx2 ;3 7094 273d3 b0 07 bcs X1isbiggerthanX2 ;2/3 7095 273d5 X2isbiggerthanX1 7096 273d5 ; carry is clear 7097 273d5 65 44 adc __boxw1 ;3 7098 273d7 c5 46 cmp __boxx2 ;3 7099 273d9 b0 08 bcs DoYCollisionCheck ;3/2 7100 273db 60 rts ;6 - carry clear, no collision 7101 273dc X1isbiggerthanX2 7102 273dc 18 clc ;2 7103 273dd e5 48 sbc __boxw2 ;3 7104 273df c5 46 cmp __boxx2 ;3 7105 273e1 b0 13 bcs noboxcollision ;3/2 7106 273e3 DoYCollisionCheck 7107 273e3 98 tya ; 2 ; use to be "lda __boxy1" 7108 273e4 c5 47 cmp __boxy2 ;3 7109 273e6 b0 05 bcs Y1isbiggerthanY2 ;3/2 7110 273e8 Y2isbiggerthanY1 7111 273e8 ; carry is clear 7112 273e8 65 45 adc __boxh1 ;3 7113 273ea c5 47 cmp __boxy2 ;3 7114 273ec 60 rts ;6 7115 273ed Y1isbiggerthanY2 7116 273ed 18 clc ;2 7117 273ee e5 49 sbc __boxh2 ;3 7118 273f0 c5 47 cmp __boxy2 ;3 7119 273f2 b0 02 bcs noboxcollision ;3/2 7120 273f4 yesboxcollision 7121 273f4 38 sec ;2 7122 273f5 60 rts ;6 7123 273f6 noboxcollision 7124 273f6 18 clc ;2 7125 273f7 60 rts ;6 7126 273f8 endif ; BOXCOLLISION 7127 273f8 7128 273f8 randomize 7129 273f8 a5 40 lda rand 7130 273fa 4a lsr 7131 273fb 26 41 rol rand16 7132 273fd 90 02 bcc noeor 7133 273ff 49 b4 eor #$B4 7134 27401 noeor 7135 27401 85 40 sta rand 7136 27403 45 41 eor rand16 7137 27405 60 rts 7138 27406 7139 27406 ; *** bcd conversion routine courtesy Omegamatrix 7140 27406 ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 7141 27406 converttobcd 7142 27406 ;value to convert is in the accumulator 7143 27406 85 42 sta temp1 7144 27408 4a lsr 7145 27409 65 42 adc temp1 7146 2740b 6a ror 7147 2740c 4a lsr 7148 2740d 4a lsr 7149 2740e 65 42 adc temp1 7150 27410 6a ror 7151 27411 65 42 adc temp1 7152 27413 6a ror 7153 27414 4a lsr 7154 27415 29 3c and #$3C 7155 27417 85 43 sta temp2 7156 27419 4a lsr 7157 2741a 65 43 adc temp2 7158 2741c 65 42 adc temp1 7159 2741e 60 rts ; return the result in the accumulator 7160 2741f 7161 2741f ; Y and A contain multiplicands, result in A 7162 2741f mul8 7163 2741f 84 42 sty temp1 7164 27421 85 43 sta temp2 7165 27423 a9 00 lda #0 7166 27425 reptmul8 7167 27425 46 43 lsr temp2 7168 27427 90 03 bcc skipmul8 7169 27429 18 clc 7170 2742a 65 42 adc temp1 7171 2742c ;bcs donemul8 might save cycles? 7172 2742c skipmul8 7173 2742c ;beq donemul8 might save cycles? 7174 2742c 06 42 asl temp1 7175 2742e d0 f5 bne reptmul8 7176 27430 donemul8 7177 27430 60 rts 7178 27431 7179 27431 div8 7180 27431 ; A=numerator Y=denominator, result in A 7181 27431 c0 02 cpy #2 7182 27433 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 7183 27435 84 42 sty temp1 7184 27437 a0 ff ldy #$ff 7185 27439 div8loop 7186 27439 e5 42 sbc temp1 7187 2743b c8 iny 7188 2743c b0 fb bcs div8loop 7189 2743e div8end 7190 2743e 98 tya 7191 2743f ; result in A 7192 2743f 60 rts 7193 27440 7194 27440 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 7195 27440 mul16 7196 27440 84 42 sty temp1 7197 27442 85 43 sta temp2 7198 27444 7199 27444 a9 00 lda #0 7200 27446 a2 08 ldx #8 7201 27448 46 42 lsr temp1 7202 2744a mul16_1 7203 2744a 90 03 bcc mul16_2 7204 2744c 18 clc 7205 2744d 65 43 adc temp2 7206 2744f mul16_2 7207 2744f 6a ror 7208 27450 66 42 ror temp1 7209 27452 ca dex 7210 27453 d0 f5 bne mul16_1 7211 27455 85 43 sta temp2 7212 27457 60 rts 7213 27458 7214 27458 ; div int/int 7215 27458 ; numerator in A, denom in temp1 7216 27458 ; returns with quotient in A, remainder in temp1 7217 27458 div16 7218 27458 85 43 sta temp2 7219 2745a 84 42 sty temp1 7220 2745c a9 00 lda #0 7221 2745e a2 08 ldx #8 7222 27460 06 43 asl temp2 7223 27462 div16_1 7224 27462 2a rol 7225 27463 c5 42 cmp temp1 7226 27465 90 02 bcc div16_2 7227 27467 e5 42 sbc temp1 7228 27469 div16_2 7229 27469 26 43 rol temp2 7230 2746b ca dex 7231 2746c d0 f4 bne div16_1 7232 2746e 85 42 sta temp1 7233 27470 a5 43 lda temp2 7234 27472 60 rts 7235 27473 7236 27473 ifconst bankswitchmode 7237 27473 BS_jsr 7238 27473 - ifconst dumpbankswitch 7239 27473 - sta dumpbankswitch 7240 27473 endif 7241 27473 - ifconst MCPDEVCART 7242 27473 - ora #$18 7243 27473 - sta $3000 7244 27473 else 7245 27473 8d 00 80 sta $8000 7246 27476 endif 7247 27476 68 pla 7248 27477 aa tax 7249 27478 68 pla 7250 27479 60 rts 7251 2747a 7252 2747a BS_return 7253 2747a 68 pla ; bankswitch bank 7254 2747b - ifconst dumpbankswitch 7255 2747b - sta dumpbankswitch 7256 2747b endif 7257 2747b - ifconst BANKRAM 7258 2747b - sta currentbank 7259 2747b - ora currentrambank 7260 2747b endif 7261 2747b - ifconst MCPDEVCART 7262 2747b - ora #$18 7263 2747b - sta $3000 7264 2747b else 7265 2747b 8d 00 80 sta $8000 7266 2747e endif 7267 2747e 68 pla ; bankswitch $0 flag 7268 2747f 60 rts 7269 27480 endif 7270 27480 7271 27480 checkselectswitch 7272 27480 ad 82 02 lda SWCHB ; first check the real select switch... 7273 27483 29 02 and #%00000010 7274 27485 ifnconst MOUSESUPPORT 7275 27485 f0 05 beq checkselectswitchreturn ; switch is pressed 7276 27487 ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 7277 2748a 29 b0 and #%10110000 ; R_DU 7278 2748c endif ; MOUSESUPPORT 7279 2748c checkselectswitchreturn 7280 2748c 60 rts 7281 2748d 7282 2748d checkresetswitch 7283 2748d ad 82 02 lda SWCHB ; first check the real reset switch... 7284 27490 29 01 and #%00000001 7285 27492 ifnconst MOUSESUPPORT 7286 27492 f0 05 beq checkresetswitchreturn ; switch is pressed 7287 27494 ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 7288 27497 29 70 and #%01110000 ; _LDU 7289 27499 endif ; MOUSESUPPORT 7290 27499 checkresetswitchreturn 7291 27499 60 rts 7292 2749a 7293 2749a - ifconst FINESCROLLENABLED 7294 2749a -finescrolldlls 7295 2749a - ldx temp1 ; first DLL index x3 7296 2749a - lda DLLMEM,x 7297 2749a - and #%11110000 7298 2749a - ora finescrolly 7299 2749a - sta DLLMEM,x 7300 2749a - 7301 2749a - ldx temp2 ; last DLL index x3 7302 2749a - lda DLLMEM,x 7303 2749a - and #%11110000 7304 2749a - ora finescrolly 7305 2749a - eor #(WZONEHEIGHT-1) 7306 2749a - sta DLLMEM,x 7307 2749a - rts 7308 2749a endif ; FINESCROLLENABLED 7309 2749a 7310 2749a - ifconst USED_ADJUSTVISIBLE 7311 2749a -adjustvisible 7312 2749a - ; called with temp1=first visible zone *3, temp2=last visible zone *3 7313 2749a - jsr waitforvblankstart ; ensure vblank just started 7314 2749a - ldx visibleDLLstart 7315 2749a -findfirstinterrupt 7316 2749a - lda DLLMEM,x 7317 2749a - bmi foundfirstinterrupt 7318 2749a - inx 7319 2749a - inx 7320 2749a - inx 7321 2749a - bne findfirstinterrupt 7322 2749a -foundfirstinterrupt 7323 2749a - and #%01111111 ; clear the interrupt bit 7324 2749a - sta DLLMEM,x 7325 2749a - ifconst DOUBLEBUFFER 7326 2749a - sta DLLMEM+DBOFFSET,x 7327 2749a - endif ; DOUBLEBUFFER 7328 2749a - ldx overscanDLLstart 7329 2749a -findlastinterrupt 7330 2749a - lda DLLMEM,x 7331 2749a - bmi foundlastinterrupt 7332 2749a - dex 7333 2749a - dex 7334 2749a - dex 7335 2749a - bne findlastinterrupt 7336 2749a -foundlastinterrupt 7337 2749a - and #%01111111 ; clear the interrupt bit 7338 2749a - sta DLLMEM,x 7339 2749a - ifconst DOUBLEBUFFER 7340 2749a - sta DLLMEM+DBOFFSET,x 7341 2749a - endif ; DOUBLEBUFFER 7342 2749a - ;now we need to set the new interrupts 7343 2749a - clc 7344 2749a - lda temp1 7345 2749a - adc visibleDLLstart 7346 2749a - tax 7347 2749a - lda DLLMEM,x 7348 2749a - ora #%10000000 7349 2749a - sta DLLMEM,x 7350 2749a - ifconst DOUBLEBUFFER 7351 2749a - sta DLLMEM+DBOFFSET,x 7352 2749a - endif ; DOUBLEBUFFER 7353 2749a - clc 7354 2749a - lda temp2 7355 2749a - adc visibleDLLstart 7356 2749a - tax 7357 2749a - lda DLLMEM,x 7358 2749a - ora #%10000000 7359 2749a - sta DLLMEM,x 7360 2749a - ifconst DOUBLEBUFFER 7361 2749a - sta DLLMEM+DBOFFSET,x 7362 2749a - endif ; DOUBLEBUFFER 7363 2749a - jsr vblankresync 7364 2749a - rts 7365 2749a endif ; USED_ADJUSTVISIBLE 7366 2749a 7367 2749a vblankresync 7368 2749a 20 38 f5 jsr waitforvblankstart ; ensure vblank just started 7369 2749d a9 00 lda #0 7370 2749f 85 4d sta visibleover 7371 274a1 a9 03 lda #3 7372 274a3 8d b2 01 sta interruptindex 7373 274a6 60 rts 7374 274a7 7375 274a7 createallgamedlls 7376 274a7 a2 00 ldx #0 7377 274a9 a9 19 lda #NVLINES 7378 274ab ac 09 21 ldy paldetected 7379 274ae f0 03 beq skipcreatePALpadding 7380 274b0 18 clc 7381 274b1 69 15 adc #21 7382 274b3 skipcreatePALpadding 7383 274b3 20 e8 f4 jsr createnonvisibledlls 7384 274b6 8e 3c 21 stx visibleDLLstart 7385 274b9 20 19 f5 jsr createvisiblezones 7386 274bc 8e 3d 21 stx overscanDLLstart 7387 274bf createallgamedllscontinue 7388 274bf a9 50 lda #(NVLINES+55) ; extras for PAL 7389 274c1 20 e8 f4 jsr createnonvisibledlls 7390 274c4 7391 274c4 ae 3c 21 ldx visibleDLLstart 7392 274c7 bd 00 18 lda DLLMEM,x 7393 274ca 09 80 ora #%10000000 ; NMI 1 - start of visible screen 7394 274cc 9d 00 18 sta DLLMEM,x 7395 274cf - ifconst DOUBLEBUFFER 7396 274cf - sta DLLMEM+DBOFFSET,x 7397 274cf endif ; DOUBLEBUFFER 7398 274cf 7399 274cf ae 3d 21 ldx overscanDLLstart 7400 274d2 bd 00 18 lda DLLMEM,x 7401 274d5 09 83 ora #%10000011 ; NMI 2 - end of visible screen 7402 274d7 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 7403 274d9 9d 00 18 sta DLLMEM,x 7404 274dc - ifconst DOUBLEBUFFER 7405 274dc - sta DLLMEM+DBOFFSET,x 7406 274dc endif ; DOUBLEBUFFER 7407 274dc 7408 274dc e8 inx 7409 274dd e8 inx 7410 274de e8 inx 7411 274df 7412 274df bd 00 18 lda DLLMEM,x 7413 274e2 09 80 ora #%10000000 ; NMI 3 - deeper overscan 7414 274e4 9d 00 18 sta DLLMEM,x 7415 274e7 - ifconst DOUBLEBUFFER 7416 274e7 - sta DLLMEM+DBOFFSET,x 7417 274e7 endif ; DOUBLEBUFFER 7418 274e7 7419 274e7 60 rts 7420 274e8 7421 274e8 createnonvisibledlls 7422 274e8 85 42 sta temp1 7423 274ea 4a lsr 7424 274eb 4a lsr 7425 274ec 4a lsr 7426 274ed 4a lsr ; /16 7427 274ee f0 09 beq skipcreatenonvisibledlls1loop 7428 274f0 a8 tay 7429 274f1 createnonvisibledlls1loop 7430 274f1 a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 7431 274f3 20 08 f5 jsr createblankdllentry 7432 274f6 88 dey 7433 274f7 d0 f8 bne createnonvisibledlls1loop 7434 274f9 skipcreatenonvisibledlls1loop 7435 274f9 a5 42 lda temp1 7436 274fb 29 0f and #%00001111 7437 274fd f0 08 beq createnonvisibledllsreturn 7438 274ff 38 sec 7439 27500 e9 01 sbc #1 7440 27502 09 40 ora #%01000000 7441 27504 20 08 f5 jsr createblankdllentry 7442 27507 createnonvisibledllsreturn 7443 27507 60 rts 7444 27508 7445 27508 createblankdllentry 7446 27508 9d 00 18 sta DLLMEM,x 7447 2750b - ifconst DOUBLEBUFFER 7448 2750b - sta DLLMEM+DBOFFSET,x 7449 2750b endif ; DOUBLEBUFFER 7450 2750b e8 inx 7451 2750c a9 21 lda #$21 ; blank 7452 2750e 9d 00 18 sta DLLMEM,x 7453 27511 - ifconst DOUBLEBUFFER 7454 27511 - sta DLLMEM+DBOFFSET,x 7455 27511 endif ; DOUBLEBUFFER 7456 27511 e8 inx 7457 27512 a9 00 lda #$00 7458 27514 9d 00 18 sta DLLMEM,x 7459 27517 - ifconst DOUBLEBUFFER 7460 27517 - sta DLLMEM+DBOFFSET,x 7461 27517 endif ; DOUBLEBUFFER 7462 27517 e8 inx 7463 27518 60 rts 7464 27519 7465 27519 createvisiblezones 7466 27519 a0 00 ldy #0 7467 2751b createvisiblezonesloop 7468 2751b b9 9b f6 lda.w DLHEIGHT,y 7469 2751e 09 20 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 7470 27520 9d 00 18 sta DLLMEM,x 7471 27523 - ifconst DOUBLEBUFFER 7472 27523 - sta DLLMEM+DBOFFSET,x 7473 27523 endif ; DOUBLEBUFFER 7474 27523 e8 inx 7475 27524 b9 6b f6 lda DLPOINTH,y 7476 27527 9d 00 18 sta DLLMEM,x 7477 2752a - ifconst DOUBLEBUFFER 7478 2752a - sta DLLMEM+DBOFFSET,x 7479 2752a endif ; DOUBLEBUFFER 7480 2752a e8 inx 7481 2752b b9 83 f6 lda DLPOINTL,y 7482 2752e 9d 00 18 sta DLLMEM,x 7483 27531 - ifconst DOUBLEBUFFER 7484 27531 - clc 7485 27531 - adc #DOUBLEBUFFEROFFSET 7486 27531 - sta DLLMEM+DBOFFSET,x 7487 27531 - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 7488 27531 - inc DLLMEM+DBOFFSET-1,x 7489 27531 -skiphidoublebufferadjust 7490 27531 endif ; DOUBLEBUFFER 7491 27531 e8 inx 7492 27532 c8 iny 7493 27533 c0 18 cpy #WZONECOUNT 7494 27535 d0 e4 bne createvisiblezonesloop 7495 27537 60 rts 7496 27538 7497 27538 waitforvblankstart 7498 27538 visibleoverwait 7499 27538 24 28 BIT MSTAT 7500 2753a 10 fc bpl visibleoverwait 7501 2753c vblankstartwait 7502 2753c 24 28 BIT MSTAT 7503 2753e 30 fc bmi vblankstartwait 7504 27540 60 rts 7505 27541 7506 27541 - ifconst DOUBLEBUFFER 7507 27541 -flipdisplaybufferreturn 7508 27541 - rts 7509 27541 -flipdisplaybuffer 7510 27541 - lda doublebufferstate 7511 27541 - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 7512 27541 - 7513 27541 - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 7514 27541 - 7515 27541 - lda doublebufferstate 7516 27541 - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 7517 27541 - tax 7518 27541 - 7519 27541 - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 7520 27541 - 7521 27541 -flipdisplaybufferwait1 7522 27541 - lda visibleover 7523 27541 - beq flipdisplaybufferwait1 7524 27541 - 7525 27541 -flipdisplaybufferwait 7526 27541 - lda visibleover 7527 27541 - bne flipdisplaybufferwait 7528 27541 - 7529 27541 - lda doublebufferminimumframetarget 7530 27541 - beq skipminimumframecode 7531 27541 - lda doublebufferminimumframeindex 7532 27541 - bne flipdisplaybufferwait1 7533 27541 - lda doublebufferminimumframetarget 7534 27541 - sta doublebufferminimumframeindex 7535 27541 -skipminimumframecode 7536 27541 - 7537 27541 - lda DLLMEMLutHi,x 7538 27541 - sta DPPH 7539 27541 - lda DLLMEMLutLo,x 7540 27541 - sta DPPL 7541 27541 - 7542 27541 - lda NewPageflipstate,x 7543 27541 - sta doublebufferstate 7544 27541 - lda NewPageflipoffset,x 7545 27541 - sta doublebufferdloffset 7546 27541 - 7547 27541 - lda doublebufferbufferdirty 7548 27541 - beq flipdisplaybufferreturn 7549 27541 - 7550 27541 - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 7551 27541 - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 7552 27541 - ; from the displayed buffer to the working buffer... 7553 27541 - 7554 27541 - lda doublebufferdloffset 7555 27541 - eor #DOUBLEBUFFEROFFSET 7556 27541 - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 7557 27541 - 7558 27541 - ldx #(WZONECOUNT-1) 7559 27541 -copybufferzoneloop 7560 27541 - 7561 27541 - lda DLPOINTL,x 7562 27541 - clc 7563 27541 - adc doublebufferdloffset 7564 27541 - sta temp1 7565 27541 - lda DLPOINTH,x 7566 27541 - adc #0 7567 27541 - sta temp2 7568 27541 - 7569 27541 - lda DLPOINTL,x 7570 27541 - clc 7571 27541 - adc temp6 7572 27541 - sta temp3 7573 27541 - lda DLPOINTH,x 7574 27541 - adc #0 7575 27541 - sta temp4 7576 27541 - 7577 27541 - lda dlendsave,x 7578 27541 - tay 7579 27541 -copybuffercharsloop 7580 27541 - lda (temp3),y 7581 27541 - sta (temp1),y 7582 27541 - dey 7583 27541 - bpl copybuffercharsloop 7584 27541 - dex 7585 27541 - bpl copybufferzoneloop 7586 27541 - lda #0 7587 27541 - sta doublebufferbufferdirty 7588 27541 - rts 7589 27541 - 7590 27541 -doublebufferoff 7591 27541 - lda #1 7592 27541 - sta doublebufferstate 7593 27541 - jsr flipdisplaybuffer 7594 27541 - lda #0 7595 27541 - sta doublebufferstate 7596 27541 - sta doublebufferdloffset 7597 27541 - rts 7598 27541 - 7599 27541 -DLLMEMLutLo 7600 27541 - .byte DLLMEM,>(DLLMEM+DBOFFSET) 7603 27541 -NewPageflipstate 7604 27541 - .byte 3,1 7605 27541 -NewPageflipoffset 7606 27541 - .byte DOUBLEBUFFEROFFSET,0 7607 27541 - 7608 27541 endif ; DOUBLEBUFFER 7609 27541 7610 27541 - ifconst MOUSESUPPORT 7611 27541 - 7612 27541 -rotationalcompare 7613 27541 - ; old = 00 01 10 11 7614 27541 - .byte $00, $01, $ff, $00 ; new=00 7615 27541 - .byte $ff, $00, $00, $01 ; new=01 7616 27541 - .byte $01, $00, $00, $ff ; new=10 7617 27541 - .byte $00, $ff, $01, $00 ; new=11 7618 27541 - 7619 27541 - ; 0000YyXx st mouse 7620 27541 - 7621 27541 - ; 0000xyXY amiga mouse 7622 27541 - 7623 27541 - ifconst MOUSEXONLY 7624 27541 -amigatoataribits ; swap bits 1 and 4... 7625 27541 - .byte %0000, %0000, %0010, %0010 7626 27541 - .byte %0000, %0000, %0010, %0010 7627 27541 - .byte %0001, %0001, %0011, %0011 7628 27541 - .byte %0001, %0001, %0011, %0011 7629 27541 - 7630 27541 - ; null change bits 7631 27541 - .byte %0000, %0001, %0010, %0011 7632 27541 - .byte %0000, %0001, %0010, %0011 7633 27541 - .byte %0000, %0001, %0010, %0011 7634 27541 - .byte %0000, %0001, %0010, %0011 7635 27541 - 7636 27541 - else ; !MOUSEXONLY 7637 27541 - 7638 27541 -amigatoataribits ; swap bits 1 and 4... 7639 27541 - .byte %0000, %1000, %0010, %1010 7640 27541 - .byte %0100, %1100, %0110, %1110 7641 27541 - .byte %0001, %1001, %0011, %1011 7642 27541 - .byte %0101, %1101, %0111, %1111 7643 27541 - ; null change bits 7644 27541 - .byte %0000, %0001, %0010, %0011 7645 27541 - .byte %0100, %0101, %0110, %0111 7646 27541 - .byte %1000, %1001, %1010, %1011 7647 27541 - .byte %1100, %1101, %1110, %1111 7648 27541 - endif ; !MOUSEXONLY 7649 27541 - 7650 27541 endif ; MOUSESUPPORT 7651 27541 7652 27541 mouse0update 7653 27541 - ifconst MOUSE0SUPPORT 7654 27541 - 7655 27541 -mousetableselect = inttemp2 7656 27541 -mousexdelta = inttemp3 7657 27541 -mouseydelta = inttemp4 7658 27541 -lastSWCHA = inttemp6 7659 27541 - 7660 27541 - ; 0000YyXx st mouse 7661 27541 - ; 0000xyXY amiga mouse 7662 27541 - 7663 27541 - lda #$ff 7664 27541 - sta lastSWCHA 7665 27541 - 7666 27541 - ldy port0control 7667 27541 - 7668 27541 - lda #%00010000 7669 27541 - cpy #9 ; AMIGA? 7670 27541 - bne skipamigabitsfix0 7671 27541 - lda #0 7672 27541 -skipamigabitsfix0 7673 27541 - sta mousetableselect 7674 27541 - ifconst DRIVINGBOOST 7675 27541 - cpy #6 ; DRIVING? 7676 27541 - bne skipdriving0setup 7677 27541 - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 7678 27541 - ; trails the actual mousex0, so we can smoothly interpolate toward 7679 27541 - ; the actual position. This actual position is stored in mousey0 7680 27541 - ; after the driver has run. 7681 27541 - ldx mousex0 7682 27541 - lda mousey0 7683 27541 - stx mousey0 7684 27541 - sta mousex0 7685 27541 -skipdriving0setup 7686 27541 - endif ; DRIVINGBOOST 7687 27541 - 7688 27541 - lda #0 7689 27541 - sta mousexdelta 7690 27541 - sta mouseydelta 7691 27541 - 7692 27541 - ifnconst MOUSETIME 7693 27541 - ifnconst MOUSEXONLY 7694 27541 - lda #180 ; minimum for x+y 7695 27541 - else 7696 27541 - lda #100 ; minimum for just x 7697 27541 - endif 7698 27541 - else 7699 27541 - lda #MOUSETIME 7700 27541 - endif 7701 27541 - jsr SETTIM64T ; INTIM is in Y 7702 27541 - 7703 27541 -mouse0updateloop 7704 27541 - lda SWCHA 7705 27541 - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 7706 27541 - cmp lastSWCHA 7707 27541 - beq mouse0loopcondition 7708 27541 - sta lastSWCHA 7709 27541 - lsr 7710 27541 - lsr 7711 27541 - lsr 7712 27541 - 7713 27541 - ora mousetableselect ; atari/amiga decoding table selection 7714 27541 - 7715 27541 - ; st mice encode on different bits/joystick-lines than amiga mice... 7716 27541 - ; 0000YyXx st mouse 7717 27541 - ; 0000xyXY amiga mouse 7718 27541 - ; ...so can shuffle the amiga bits to reuse the st driver. 7719 27541 - tay 7720 27541 - lax amigatoataribits,y 7721 27541 - 7722 27541 - ifnconst MOUSEXONLY 7723 27541 - ; first the Y... 7724 27541 - and #%00001100 7725 27541 - ora mousecodey0 7726 27541 - tay 7727 27541 - lda rotationalcompare,y 7728 27541 - clc 7729 27541 - adc mouseydelta 7730 27541 - sta mouseydelta 7731 27541 - tya 7732 27541 - lsr 7733 27541 - lsr 7734 27541 - sta mousecodey0 7735 27541 - txa 7736 27541 - ; ...then the X... 7737 27541 - and #%00000011 7738 27541 - tax 7739 27541 - endif ; !MOUSEXONLY 7740 27541 - 7741 27541 - asl 7742 27541 - asl 7743 27541 - ora mousecodex0 7744 27541 - tay 7745 27541 - lda rotationalcompare,y 7746 27541 - adc mousexdelta ; carry was clear by previous ASL 7747 27541 - sta mousexdelta 7748 27541 - stx mousecodex0 7749 27541 -mouse0loopcondition 7750 27541 - lda TIMINT 7751 27541 - bpl mouse0updateloop 7752 27541 - 7753 27541 - ; *** adapt to selected device resolution. 7754 27541 - ldx port0control 7755 27541 - 7756 27541 - ifconst PRECISIONMOUSING 7757 27541 - ldy port0resolution 7758 27541 - bne mouse0halveddone 7759 27541 - cpx #6 ; half-resolution is no good for driving wheels 7760 27541 - beq mouse0halveddone 7761 27541 - ; resolution=0 is half mouse resolution, necessary for precision 7762 27541 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7763 27541 - 7764 27541 - lda mousexdelta 7765 27541 - cmp #$80 7766 27541 - ror ; do a signed divide by 2. 7767 27541 - clc 7768 27541 - adc mousex0 7769 27541 - sta mousex0 7770 27541 - ifnconst MOUSEXONLY 7771 27541 - lda mouseydelta 7772 27541 - clc 7773 27541 - adc mousey0 7774 27541 - sta mousey0 7775 27541 - endif 7776 27541 - ; at half resolution we just exit after updating x and y 7777 27541 - jmp LLRET0 7778 27541 -mouse0halveddone 7779 27541 - endif ; PRECISIONMOUSING 7780 27541 - 7781 27541 - ifnconst MOUSEXONLY 7782 27541 - asl mouseydelta ; *2 because Y resolution is finer 7783 27541 - ldy port0resolution 7784 27541 - dey 7785 27541 - lda #0 7786 27541 -mousey0resolutionfix 7787 27541 - clc 7788 27541 - adc mouseydelta 7789 27541 - dey 7790 27541 - bpl mousey0resolutionfix 7791 27541 - clc 7792 27541 - adc mousey0 7793 27541 - sta mousey0 7794 27541 - endif ; MOUSEXONLY 7795 27541 - 7796 27541 - ldy port0resolution 7797 27541 - dey 7798 27541 - lda #0 7799 27541 -mousex0resolutionfix 7800 27541 - clc 7801 27541 - adc mousexdelta 7802 27541 - dey 7803 27541 - bpl mousex0resolutionfix 7804 27541 - ifnconst DRIVINGBOOST 7805 27541 - clc 7806 27541 - adc mousex0 7807 27541 - sta mousex0 7808 27541 - else 7809 27541 - cpx #6 7810 27541 - beq carryonmouse0boost 7811 27541 - clc 7812 27541 - adc mousex0 7813 27541 - sta mousex0 7814 27541 - jmp LLRET0 7815 27541 -carryonmouse0boost 7816 27541 - sta mousexdelta 7817 27541 - clc 7818 27541 - adc mousecodey0 7819 27541 - sta mousecodey0 7820 27541 - clc 7821 27541 - adc mousex0 7822 27541 - tay ; save the target X 7823 27541 - adc mousey0 ; average in the smoothly-trailing X 7824 27541 - ror 7825 27541 - sta mousex0 ; mousex0 now has the smoothly trailing X 7826 27541 - sty mousey0 ; and mousey0 has the the target X 7827 27541 - 7828 27541 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7829 27541 - ; A has mousex0, the smoothly trailing X 7830 27541 - sbc mousey0 ; less the target X 7831 27541 - bpl skipabsolutedrive0 7832 27541 - eor #$ff 7833 27541 -skipabsolutedrive0 7834 27541 - cmp #64 ; just an unreasonably large change 7835 27541 - bcc skipdrivewrapfix0 7836 27541 - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 7837 27541 -skipdrivewrapfix0 7838 27541 - 7839 27541 - ; get rid of the tweening if the distance travelled was very small 7840 27541 - lda mousexdelta 7841 27541 - cmp port0resolution 7842 27541 - bcs skipbetweenfix0 7843 27541 - lda mousex0 7844 27541 - sta mousey0 7845 27541 -skipbetweenfix0 7846 27541 - 7847 27541 -drivingboostreductioncheck0 7848 27541 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7849 27541 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7850 27541 - ; negated again because truncation during BCD math results in 7851 27541 - ; differing magnitudes, depending if the value is +ve or -ve. 7852 27541 -driving0fix 7853 27541 - lax mousecodey0 7854 27541 - cmp #$80 7855 27541 - bcs driving0skipnegate1 7856 27541 - eor #$FF 7857 27541 - adc #1 7858 27541 - sta mousecodey0 7859 27541 -driving0skipnegate1 7860 27541 - cmp #$80 7861 27541 - ror 7862 27541 - cmp #$80 7863 27541 - ror 7864 27541 - cmp #$80 7865 27541 - ror 7866 27541 - sta inttemp1 7867 27541 - lda mousecodey0 7868 27541 - sec 7869 27541 - sbc inttemp1 7870 27541 - cpx #$80 7871 27541 - bcs driving0skipnegate2 7872 27541 - eor #$FF 7873 27541 - adc #1 7874 27541 -driving0skipnegate2 7875 27541 - sta mousecodey0 7876 27541 -drivingboostdone0 7877 27541 - endif ; DRIVINGBOOST 7878 27541 - 7879 27541 - jmp LLRET0 7880 27541 - 7881 27541 endif ; MOUSE0SUPPORT 7882 27541 7883 27541 mouse1update 7884 27541 - ifconst MOUSE1SUPPORT 7885 27541 - 7886 27541 -mousetableselect = inttemp2 7887 27541 -mousexdelta = inttemp3 7888 27541 -mouseydelta = inttemp4 7889 27541 -lastSWCHA = inttemp6 7890 27541 - 7891 27541 - ; 0000YyXx st mouse 7892 27541 - ; 0000xyXY amiga mouse 7893 27541 - 7894 27541 - lda #$ff 7895 27541 - sta lastSWCHA 7896 27541 - 7897 27541 - ldy port1control 7898 27541 - 7899 27541 - lda #%00010000 7900 27541 - cpy #9 ; AMIGA? 7901 27541 - bne skipamigabitsfix1 7902 27541 - lda #0 7903 27541 -skipamigabitsfix1 7904 27541 - sta mousetableselect 7905 27541 - ifconst DRIVINGBOOST 7906 27541 - cpy #6 ; DRIVING? 7907 27541 - bne skipdriving1setup 7908 27541 - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 7909 27541 - ; trails the actual mousex1, so we can smoothly interpolate toward 7910 27541 - ; the actual position. This actual position is stored in mousey1 7911 27541 - ; after the driver has run. 7912 27541 - ldx mousex1 7913 27541 - lda mousey1 7914 27541 - stx mousey1 7915 27541 - sta mousex1 7916 27541 -skipdriving1setup 7917 27541 - endif ; DRIVINGBOOST 7918 27541 - 7919 27541 - lda #0 7920 27541 - sta mousexdelta 7921 27541 - sta mouseydelta 7922 27541 - 7923 27541 - ifnconst MOUSETIME 7924 27541 - ifnconst MOUSEXONLY 7925 27541 - lda #180 ; minimum for x+y 7926 27541 - else 7927 27541 - lda #100 ; minimum for just x 7928 27541 - endif 7929 27541 - else 7930 27541 - lda #MOUSETIME 7931 27541 - endif 7932 27541 - jsr SETTIM64T ; INTIM is in Y 7933 27541 - 7934 27541 -mouse1updateloop 7935 27541 - lda SWCHA 7936 27541 - and #%00001111 7937 27541 - cmp lastSWCHA 7938 27541 - beq mouse1loopcondition 7939 27541 - sta lastSWCHA 7940 27541 - 7941 27541 - ora mousetableselect ; atari/amiga decoding table selection 7942 27541 - 7943 27541 - ; st mice encode on different bits/joystick-lines than amiga mice... 7944 27541 - ; 0000YyXx st mouse 7945 27541 - ; 0000xyXY amiga mouse 7946 27541 - ; ...so can shuffle the amiga bits to reuse the st driver. 7947 27541 - tay 7948 27541 - lax amigatoataribits,y 7949 27541 - 7950 27541 - ifnconst MOUSEXONLY 7951 27541 - ; first the Y... 7952 27541 - and #%00001100 7953 27541 - ora mousecodey1 7954 27541 - tay 7955 27541 - lda rotationalcompare,y 7956 27541 - clc 7957 27541 - adc mouseydelta 7958 27541 - sta mouseydelta 7959 27541 - tya 7960 27541 - lsr 7961 27541 - lsr 7962 27541 - sta mousecodey1 7963 27541 - txa 7964 27541 - ; ...then the X... 7965 27541 - and #%00000011 7966 27541 - tax 7967 27541 - endif ; !MOUSEXONLY 7968 27541 - 7969 27541 - asl 7970 27541 - asl 7971 27541 - ora mousecodex1 7972 27541 - tay 7973 27541 - lda rotationalcompare,y 7974 27541 - adc mousexdelta ; carry was clear by previous ASL 7975 27541 - sta mousexdelta 7976 27541 - stx mousecodex1 7977 27541 -mouse1loopcondition 7978 27541 - lda TIMINT 7979 27541 - bpl mouse1updateloop 7980 27541 - 7981 27541 - ; *** adapt to selected device resolution. 7982 27541 - ldx port1control 7983 27541 - 7984 27541 - ifconst PRECISIONMOUSING 7985 27541 - ldy port1resolution 7986 27541 - bne mouse1halveddone 7987 27541 - cpx #6 ; half-resolution is no good for driving wheels 7988 27541 - beq mouse1halveddone 7989 27541 - ; resolution=0 is half mouse resolution, necessary for precision 7990 27541 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7991 27541 - 7992 27541 - lda mousexdelta 7993 27541 - cmp #$80 7994 27541 - ror ; do a signed divide by 2. 7995 27541 - clc 7996 27541 - adc mousex1 7997 27541 - sta mousex1 7998 27541 - ifnconst MOUSEXONLY 7999 27541 - lda mouseydelta 8000 27541 - clc 8001 27541 - adc mousey1 8002 27541 - sta mousey1 8003 27541 - endif 8004 27541 - ; at half resolution we just exit after updating x and y 8005 27541 - jmp LLRET1 8006 27541 -mouse1halveddone 8007 27541 - endif ; PRECISIONMOUSING 8008 27541 - 8009 27541 - ifnconst MOUSEXONLY 8010 27541 - asl mouseydelta ; *2 because Y resolution is finer 8011 27541 - ldy port1resolution 8012 27541 - dey 8013 27541 - lda #0 8014 27541 -mousey1resolutionfix 8015 27541 - clc 8016 27541 - adc mouseydelta 8017 27541 - dey 8018 27541 - bpl mousey1resolutionfix 8019 27541 - clc 8020 27541 - adc mousey1 8021 27541 - sta mousey1 8022 27541 - endif ; MOUSEXONLY 8023 27541 - 8024 27541 - ldy port1resolution 8025 27541 - dey 8026 27541 - lda #0 8027 27541 -mousex1resolutionfix 8028 27541 - clc 8029 27541 - adc mousexdelta 8030 27541 - dey 8031 27541 - bpl mousex1resolutionfix 8032 27541 - ifnconst DRIVINGBOOST 8033 27541 - clc 8034 27541 - adc mousex1 8035 27541 - sta mousex1 8036 27541 - else 8037 27541 - cpx #6 8038 27541 - beq carryonmouse1boost 8039 27541 - clc 8040 27541 - adc mousex1 8041 27541 - sta mousex1 8042 27541 - jmp LLRET1 8043 27541 -carryonmouse1boost 8044 27541 - sta mousexdelta 8045 27541 - clc 8046 27541 - adc mousecodey1 8047 27541 - sta mousecodey1 8048 27541 - clc 8049 27541 - adc mousex1 8050 27541 - tay ; save the target X 8051 27541 - adc mousey1 ; average in the smoothly-trailing X 8052 27541 - ror 8053 27541 - sta mousex1 ; mousex0 now has the smoothly trailing X 8054 27541 - sty mousey1 ; and mousey0 has the the target X 8055 27541 - 8056 27541 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 8057 27541 - ; A has mousex1, the smoothly trailing X 8058 27541 - sbc mousey1 ; less the target X 8059 27541 - bpl skipabsolutedrive1 8060 27541 - eor #$ff 8061 27541 -skipabsolutedrive1 8062 27541 - cmp #64 ; just an unreasonably large change 8063 27541 - bcc skipdrivewrapfix1 8064 27541 - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 8065 27541 -skipdrivewrapfix1 8066 27541 - 8067 27541 - ; get rid of the tweening if the distance travelled was very small 8068 27541 - lda mousexdelta 8069 27541 - cmp port1resolution 8070 27541 - bcs skipbetweenfix1 8071 27541 - lda mousex1 8072 27541 - sta mousey1 8073 27541 -skipbetweenfix1 8074 27541 - 8075 27541 -drivingboostreductioncheck1 8076 27541 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 8077 27541 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 8078 27541 - ; negated again because truncation during BCD math results in 8079 27541 - ; differing magnitudes, depending if the value is +ve or -ve. 8080 27541 -driving1fix 8081 27541 - lax mousecodey1 8082 27541 - cmp #$80 8083 27541 - bcs driving0skipnegate1 8084 27541 - eor #$FF 8085 27541 - adc #1 8086 27541 - sta mousecodey1 8087 27541 -driving0skipnegate1 8088 27541 - cmp #$80 8089 27541 - ror 8090 27541 - cmp #$80 8091 27541 - ror 8092 27541 - cmp #$80 8093 27541 - ror 8094 27541 - sta inttemp1 8095 27541 - lda mousecodey1 8096 27541 - sec 8097 27541 - sbc inttemp1 8098 27541 - cpx #$80 8099 27541 - bcs driving1skipnegate2 8100 27541 - eor #$FF 8101 27541 - adc #1 8102 27541 -driving1skipnegate2 8103 27541 - sta mousecodey1 8104 27541 -drivingboostdone1 8105 27541 - endif ; DRIVINGBOOST 8106 27541 - 8107 27541 - jmp LLRET1 8108 27541 - 8109 27541 endif ; MOUSE1SUPPORT 8110 27541 8111 27541 8112 27541 trakball0update 8113 27541 - ifconst TRAKBALL0SUPPORT 8114 27541 - ifnconst TRAKTIME 8115 27541 - ifnconst TRAKXONLY 8116 27541 - lda #180 ; minimum for x+y 8117 27541 - else ; !TRAKXONLY 8118 27541 - lda #100 ; minimum for just x 8119 27541 - endif ; !TRAKXONLY 8120 27541 - else ; !TRAKTIME 8121 27541 - lda #TRAKTIME 8122 27541 - endif ; !TRAKTIME 8123 27541 - jsr SETTIM64T ; INTIM is in Y 8124 27541 - ldx #0 8125 27541 - ifnconst TRAKXONLY 8126 27541 - ldy #0 8127 27541 - endif ; TRAKXONLY 8128 27541 -trakball0updateloop 8129 27541 - lda SWCHA 8130 27541 - and #%00110000 8131 27541 - cmp trakballcodex0 8132 27541 - sta trakballcodex0 8133 27541 - beq trakball0movementXdone 8134 27541 - and #%00010000 8135 27541 - beq trakball0negativeX 8136 27541 -trakball0positiveX 8137 27541 - ;(2 from beq) 8138 27541 - inx ; 2 8139 27541 - jmp trakball0movementXdone ; 3 8140 27541 -trakball0negativeX 8141 27541 - ;(3 from beq) 8142 27541 - dex ; 2 8143 27541 - nop ; 2 8144 27541 -trakball0movementXdone 8145 27541 - 8146 27541 - ifnconst TRAKXONLY 8147 27541 - lda SWCHA 8148 27541 - and #%11000000 8149 27541 - cmp trakballcodey0 8150 27541 - sta trakballcodey0 8151 27541 - beq trakball0movementYdone 8152 27541 - and #%01000000 8153 27541 - beq trakball0negativeY 8154 27541 -trakball0positiveY 8155 27541 - ;(2 from beq) 8156 27541 - iny ; 2 8157 27541 - jmp trakball0movementYdone ; 3 8158 27541 -trakball0negativeY 8159 27541 - ;(3 from beq) 8160 27541 - dey ; 2 8161 27541 - nop ; 2 8162 27541 -trakball0movementYdone 8163 27541 - endif ; !TRAKXONLY 8164 27541 - 8165 27541 - lda TIMINT 8166 27541 - bpl trakball0updateloop 8167 27541 - lda #0 8168 27541 - cpx #0 8169 27541 - beq trakball0skipXadjust 8170 27541 - clc 8171 27541 -trakball0Xloop 8172 27541 - adc port0resolution 8173 27541 - dex 8174 27541 - bne trakball0Xloop 8175 27541 - clc 8176 27541 - adc trakballx0 8177 27541 - sta trakballx0 8178 27541 -trakball0skipXadjust 8179 27541 - ifnconst TRAKXONLY 8180 27541 - lda #0 8181 27541 - cpy #0 8182 27541 - beq trakball0skipYadjust 8183 27541 - clc 8184 27541 -trakball0yloop 8185 27541 - adc port0resolution 8186 27541 - dey 8187 27541 - bne trakball0yloop 8188 27541 - clc 8189 27541 - adc trakbally0 8190 27541 - sta trakbally0 8191 27541 -trakball0skipYadjust 8192 27541 - endif ; !TRAKXONLY 8193 27541 - 8194 27541 - jmp LLRET0 8195 27541 endif 8196 27541 8197 27541 8198 27541 8199 27541 trakball1update 8200 27541 - ifconst TRAKBALL1SUPPORT 8201 27541 - ifnconst TRAKTIME 8202 27541 - ifnconst TRAKXONLY 8203 27541 - lda #180 ; minimum for x+y 8204 27541 - else ; !TRAKXONLY 8205 27541 - lda #100 ; minimum for just x 8206 27541 - endif ; !TRAKXONLY 8207 27541 - else ; !TRAKTIME 8208 27541 - lda #TRAKTIME 8209 27541 - endif ; !TRAKTIME 8210 27541 - jsr SETTIM64T ; INTIM is in Y 8211 27541 - ldx #0 8212 27541 - ifnconst TRAKXONLY 8213 27541 - ldy #0 8214 27541 - endif ; TRAKXONLY 8215 27541 -trakball1updateloop 8216 27541 - lda SWCHA 8217 27541 - and #%00000011 8218 27541 - cmp trakballcodex1 8219 27541 - sta trakballcodex1 8220 27541 - beq trakball1movementXdone 8221 27541 - and #%00000001 8222 27541 - beq trakball1negativeX 8223 27541 -trakball1positiveX 8224 27541 - ;(2 from beq) 8225 27541 - inx ; 2 8226 27541 - jmp trakball1movementXdone ; 3 8227 27541 -trakball1negativeX 8228 27541 - ;(3 from beq) 8229 27541 - dex ; 2 8230 27541 - nop ; 2 8231 27541 -trakball1movementXdone 8232 27541 - 8233 27541 - ifnconst TRAKXONLY 8234 27541 - lda SWCHA 8235 27541 - and #%00001100 8236 27541 - cmp trakballcodey1 8237 27541 - sta trakballcodey1 8238 27541 - beq trakball1movementYdone 8239 27541 - and #%00000100 8240 27541 - beq trakball1negativeY 8241 27541 -trakball1positiveY 8242 27541 - ;(2 from beq) 8243 27541 - iny ; 2 8244 27541 - jmp trakball1movementYdone ; 3 8245 27541 -trakball1negativeY 8246 27541 - ;(3 from beq) 8247 27541 - dey ; 2 8248 27541 - nop ; 2 8249 27541 -trakball1movementYdone 8250 27541 - endif ; !TRAKXONLY 8251 27541 - 8252 27541 - lda TIMINT 8253 27541 - bpl trakball1updateloop 8254 27541 - lda #0 8255 27541 - cpx #0 8256 27541 - beq trakball1skipXadjust 8257 27541 - clc 8258 27541 -trakball1Xloop 8259 27541 - adc port1resolution 8260 27541 - dex 8261 27541 - bne trakball1Xloop 8262 27541 - clc 8263 27541 - adc trakballx1 8264 27541 - sta trakballx1 8265 27541 -trakball1skipXadjust 8266 27541 - ifnconst TRAKXONLY 8267 27541 - lda #0 8268 27541 - cpy #0 8269 27541 - beq trakball1skipYadjust 8270 27541 - clc 8271 27541 -trakball1yloop 8272 27541 - adc port1resolution 8273 27541 - dey 8274 27541 - bne trakball1yloop 8275 27541 - clc 8276 27541 - adc trakbally1 8277 27541 - sta trakbally1 8278 27541 -trakball1skipYadjust 8279 27541 - endif ; !TRAKXONLY 8280 27541 - 8281 27541 - jmp LLRET1 8282 27541 endif 8283 27541 8284 27541 8285 27541 paddleport0update 8286 27541 - ifconst PADDLE0SUPPORT 8287 27541 - lda #6 8288 27541 - sta VBLANK ; start charging the paddle caps 8289 27541 - lda #0 ; use PADDLE timing 8290 27541 - jsr SETTIM64T ; INTIM is in Y 8291 27541 - 8292 27541 -paddleport0updateloop 8293 27541 - lda INPT0 8294 27541 - bmi skippaddle0setposition 8295 27541 - sty paddleposition0 8296 27541 -skippaddle0setposition 8297 27541 - ifconst TWOPADDLESUPPORT 8298 27541 - lda INPT1 8299 27541 - bmi skippaddle1setposition 8300 27541 - sty paddleposition1 8301 27541 -skippaddle1setposition 8302 27541 - endif 8303 27541 - ldy INTIM 8304 27541 - cpy #TIMEOFFSET 8305 27541 - bcs paddleport0updateloop 8306 27541 - 8307 27541 - lda #%10000110 8308 27541 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8309 27541 - sec 8310 27541 - lda paddleposition0 8311 27541 - sbc #TIMEOFFSET 8312 27541 - ifconst PADDLESCALEX2 8313 27541 - asl 8314 27541 - endif 8315 27541 - 8316 27541 - ifnconst PADDLESMOOTHINGOFF 8317 27541 - clc 8318 27541 - adc paddleprevious0 8319 27541 - ror 8320 27541 - sta paddleprevious0 8321 27541 - endif 8322 27541 - 8323 27541 - sta paddleposition0 8324 27541 - 8325 27541 - ifconst TWOPADDLESUPPORT 8326 27541 - sec 8327 27541 - lda paddleposition1 8328 27541 - sbc #TIMEOFFSET 8329 27541 - ifconst PADDLESCALEX2 8330 27541 - asl 8331 27541 - endif 8332 27541 - 8333 27541 - ifnconst PADDLESMOOTHINGOFF 8334 27541 - clc 8335 27541 - adc paddleprevious1 8336 27541 - ror 8337 27541 - sta paddleprevious1 8338 27541 - endif 8339 27541 - sta paddleposition1 8340 27541 - endif ; TWOPADDLESUPPORT 8341 27541 - 8342 27541 - jmp LLRET0 8343 27541 endif 8344 27541 8345 27541 paddleport1update 8346 27541 - ifconst PADDLE1SUPPORT 8347 27541 - lda #6 8348 27541 - sta VBLANK ; start charging the paddle caps 8349 27541 - 8350 27541 - lda #0 ; use PADDLE timing 8351 27541 - jsr SETTIM64T ; INTIM is in Y 8352 27541 - 8353 27541 -paddleport1updateloop 8354 27541 - lda INPT2 8355 27541 - bmi skippaddle2setposition 8356 27541 - sty paddleposition2 8357 27541 -skippaddle2setposition 8358 27541 - ifconst TWOPADDLESUPPORT 8359 27541 - lda INPT3 8360 27541 - bmi skippaddle3setposition 8361 27541 - sty paddleposition3 8362 27541 -skippaddle3setposition 8363 27541 - endif 8364 27541 - ldy INTIM 8365 27541 - cpy #TIMEOFFSET 8366 27541 - bcs paddleport1updateloop 8367 27541 - 8368 27541 - lda #%10000110 8369 27541 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8370 27541 - sec 8371 27541 - lda paddleposition2 8372 27541 - sbc #TIMEOFFSET 8373 27541 - ifconst PADDLESCALEX2 8374 27541 - asl 8375 27541 - endif 8376 27541 - 8377 27541 - ifnconst PADDLESMOOTHINGOFF 8378 27541 - clc 8379 27541 - adc paddleprevious2 8380 27541 - ror 8381 27541 - sta paddleprevious2 8382 27541 - endif 8383 27541 - 8384 27541 - sta paddleposition2 8385 27541 - 8386 27541 - ifconst TWOPADDLESUPPORT 8387 27541 - sec 8388 27541 - lda paddleposition3 8389 27541 - sbc #TIMEOFFSET 8390 27541 - ifconst PADDLESCALEX2 8391 27541 - asl 8392 27541 - endif 8393 27541 - 8394 27541 - ifnconst PADDLESMOOTHINGOFF 8395 27541 - clc 8396 27541 - adc paddleprevious3 8397 27541 - ror 8398 27541 - sta paddleprevious3 8399 27541 - endif 8400 27541 - sta paddleposition3 8401 27541 - endif ; TWOPADDLESUPPORT 8402 27541 - 8403 27541 - jmp LLRET1 8404 27541 endif 8405 27541 8406 27541 8407 27541 paddlebuttonhandler ; outside of conditional, for button-handler LUT 8408 27541 - ifconst PADDLESUPPORT 8409 27541 - ; x=0|1 for port, rather than paddle #. 8410 27541 - ; Only the first paddle button will integrate into "joy0fire" testing. If the 8411 27541 - ; game wants to support 2 paddles, up to the game to instead test the 8412 27541 - ; joystick right+left directions instead. 8413 27541 - lda SWCHA ; top of nibble is first paddle button 8414 27541 - cpx #0 ; port 0? 8415 27541 - beq skippaddleport2shift 8416 27541 - asl ; shift second port to upper nibble 8417 27541 - asl 8418 27541 - asl 8419 27541 - asl 8420 27541 -skippaddleport2shift 8421 27541 - and #%10000000 8422 27541 - eor #%10000000 ; invert 8423 27541 - sta sINPT1,x 8424 27541 - jmp buttonreadloopreturn 8425 27541 endif ; PADDLESUPPORT 8426 27541 8427 27541 mousebuttonhandler ; outside of conditional, for button-handler LUT 8428 27541 - ifconst MOUSESUPPORT 8429 27541 - ; stick the mouse buttons in the correct shadow register... 8430 27541 - txa 8431 27541 - asl 8432 27541 - tay ; y=x*2 8433 27541 - lda INPT4,x 8434 27541 - eor #%10000000 8435 27541 - lsr 8436 27541 - sta sINPT1,x 8437 27541 - 8438 27541 - lda INPT1,y 8439 27541 - and #%10000000 8440 27541 - eor #%10000000 8441 27541 - ora sINPT1,x 8442 27541 - sta sINPT1,x 8443 27541 - jmp buttonreadloopreturn 8444 27541 endif ; MOUSESUPPORT 8445 27541 8446 27541 - ifconst KEYPADSUPPORT 8447 27541 - ; ** select keypad rows 0 to 3 over 4 frames... 8448 27541 -keypadrowselect 8449 27541 - ldy #0 8450 27541 - lda port0control 8451 27541 - cmp #7 8452 27541 - bne skipport0val 8453 27541 - iny ; y=y+1 8454 27541 -skipport0val 8455 27541 - lda port1control 8456 27541 - cmp #7 8457 27541 - bne skipport1val 8458 27541 - iny 8459 27541 - iny ; y=y+2 8460 27541 -skipport1val 8461 27541 - lda keyrowdirectionmask,y 8462 27541 - sta CTLSWA 8463 27541 - tya 8464 27541 - asl 8465 27541 - asl 8466 27541 - sta inttemp1 8467 27541 - lda framecounter 8468 27541 - and #3 8469 27541 - ora inttemp1 8470 27541 - tax 8471 27541 - lda keyrowselectvalue,x 8472 27541 - sta SWCHA 8473 27541 - rts 8474 27541 - 8475 27541 -keyrowdirectionmask 8476 27541 - .byte #%00000000 ; 0 : port0=input port1=input 8477 27541 - .byte #%11110000 ; 1 : port0=output port1=input 8478 27541 - .byte #%00001111 ; 2 : port0=input port1=output 8479 27541 - .byte #%11111111 ; 3 : port0=output port1=output 8480 27541 - 8481 27541 -keyrowselectvalue 8482 27541 - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 8483 27541 - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 8484 27541 - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 8485 27541 - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 8486 27541 endif ; KEYPADSUPPORT 8487 27541 8488 27541 - ifconst KEYPADSUPPORT 8489 27541 - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 8490 27541 -keypadcolumnread 8491 27541 - lda port0control 8492 27541 - cmp #7 8493 27541 - bne skipkeypadcolumnread0 8494 27541 - lda framecounter 8495 27541 - and #3 8496 27541 - asl ; x2 because keypad variables are interleaved 8497 27541 - tax 8498 27541 - lda #0 8499 27541 - sta keypadmatrix0a,x 8500 27541 - lda INPT0 8501 27541 - cmp #$80 8502 27541 - rol keypadmatrix0a,x 8503 27541 - lda INPT1 8504 27541 - cmp #$80 8505 27541 - rol keypadmatrix0a,x 8506 27541 - lda INPT4 8507 27541 - cmp #$80 8508 27541 - rol keypadmatrix0a,x 8509 27541 - lda keypadmatrix0a,x 8510 27541 - eor #%00000111 8511 27541 - sta keypadmatrix0a,x 8512 27541 -skipkeypadcolumnread0 8513 27541 - 8514 27541 - lda port1control 8515 27541 - cmp #7 8516 27541 - bne skipkeypadcolumnread1 8517 27541 - lda framecounter 8518 27541 - and #3 8519 27541 - asl ; x2 because keypad variables are interleaved 8520 27541 - tax 8521 27541 - lda #0 8522 27541 - sta keypadmatrix1a,x 8523 27541 - rol keypadmatrix1a,x 8524 27541 - lda INPT2 8525 27541 - cmp #$80 8526 27541 - rol keypadmatrix1a,x 8527 27541 - lda INPT3 8528 27541 - cmp #$80 8529 27541 - rol keypadmatrix1a,x 8530 27541 - lda INPT5 8531 27541 - cmp #$80 8532 27541 - rol keypadmatrix1a,x 8533 27541 - lda keypadmatrix1a,x 8534 27541 - eor #%00000111 8535 27541 - sta keypadmatrix1a,x 8536 27541 -skipkeypadcolumnread1 8537 27541 - rts 8538 27541 endif ; KEYPADSUPPORT 8539 27541 8540 27541 setportforinput 8541 27541 a5 e4 lda CTLSWAs 8542 27543 3d 4c f5 and allpinsinputlut,x 8543 27546 85 e4 sta CTLSWAs 8544 27548 8d 81 02 sta CTLSWA 8545 2754b 60 rts 8546 2754c 8547 2754c allpinsinputlut 8548 2754c 0f f0 .byte.b $0F, $F0 8549 2754e 8550 2754e setonebuttonmode 8551 2754e a9 06 lda #6 ; in case we're in unlocked-bios mode 8552 27550 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8553 27552 a9 14 lda #$14 8554 27554 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8555 27557 a5 e5 lda CTLSWBs 8556 27559 1d 62 f5 ora thisjoy2buttonbit,x 8557 2755c 85 e5 sta CTLSWBs 8558 2755e 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 8559 27561 60 rts 8560 27562 8561 27562 thisjoy2buttonbit 8562 27562 04 10 .byte.b $04, $10 8563 27564 8564 27564 settwobuttonmode 8565 27564 a9 06 lda #6 ; in case we're in unlocked-bios mode 8566 27566 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8567 27568 a9 14 lda #$14 8568 2756a 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8569 2756d a5 e5 lda CTLSWBs 8570 2756f 3d 78 f5 and thisjoy2buttonmask,x 8571 27572 85 e5 sta CTLSWBs 8572 27574 8d 82 02 sta SWCHB 8573 27577 60 rts 8574 27578 8575 27578 thisjoy2buttonmask 8576 27578 fb ef .byte.b $fb, $ef 8577 2757a 8578 2757a ; Provided under the CC0 license. See the included LICENSE.txt for details. 8579 2757a 8580 2757a START 8581 2757a start 8582 2757a 8583 2757a ;******** more or less the Atari recommended startup procedure 8584 2757a 8585 2757a 78 sei 8586 2757b d8 cld 8587 2757c 8588 2757c ifnconst NOTIALOCK 8589 2757c a9 07 lda #$07 8590 2757e - else 8591 2757e - lda #$06 8592 2757e endif 8593 2757e 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 8594 27580 a9 7f lda #$7F 8595 27582 85 3c sta CTRL ;disable DMA 8596 27584 a9 00 lda #$00 8597 27586 85 38 sta OFFSET 8598 27588 ifnconst NOTIALOCK 8599 27588 85 01 sta INPTCTRL 8600 2758a 85 20 sta BACKGRND ; black default, in case a flash cart is using something else 8601 2758c endif 8602 2758c a2 ff ldx #$FF 8603 2758e 9a txs 8604 2758f 8605 2758f ;************** Clear Memory 8606 2758f 8607 2758f a2 40 ldx #$40 8608 27591 a9 00 lda #$00 8609 27593 crloop1 8610 27593 95 00 sta $00,x ;Clear zero page 8611 27595 9d 00 01 sta $100,x ;Clear page 1 8612 27598 e8 inx 8613 27599 d0 f8 bne crloop1 8614 2759b 8615 2759b 8616 2759b a0 00 ldy #$00 ;Clear Ram 8617 2759d a9 18 lda #$18 ;Start at $1800 8618 2759f 85 81 sta $81 8619 275a1 a9 00 lda #$00 8620 275a3 85 80 sta $80 8621 275a5 crloop3 8622 275a5 a9 00 lda #$00 8623 275a7 91 80 sta ($80),y ;Store data 8624 275a9 c8 iny ;Next byte 8625 275aa d0 f9 bne crloop3 ;Branch if not done page 8626 275ac e6 81 inc $81 ;Next page 8627 275ae a5 81 lda $81 8628 275b0 c9 20 cmp #$20 ;End at $1FFF 8629 275b2 d0 f1 bne crloop3 ;Branch if not 8630 275b4 8631 275b4 a0 00 ldy #$00 ;Clear Ram 8632 275b6 a9 22 lda #$22 ;Start at $2200 8633 275b8 85 81 sta $81 8634 275ba a9 00 lda #$00 8635 275bc 85 80 sta $80 8636 275be crloop4 8637 275be a9 00 lda #$00 8638 275c0 91 80 sta ($80),y ;Store data 8639 275c2 c8 iny ;Next byte 8640 275c3 d0 f9 bne crloop4 ;Branch if not done page 8641 275c5 e6 81 inc $81 ;Next page 8642 275c7 a5 81 lda $81 8643 275c9 c9 27 cmp #$27 ;End at $27FF 8644 275cb d0 f1 bne crloop4 ;Branch if not 8645 275cd 8646 275cd a2 00 ldx #$00 8647 275cf a9 00 lda #$00 8648 275d1 crloop5 ;Clear 2100-213F, 2000-203F 8649 275d1 9d 00 20 sta $2000,x 8650 275d4 9d 00 21 sta $2100,x 8651 275d7 e8 inx 8652 275d8 e0 40 cpx #$40 8653 275da d0 f5 bne crloop5 8654 275dc 8655 275dc 85 80 sta $80 8656 275de 85 81 sta $81 8657 275e0 85 82 sta $82 8658 275e2 85 83 sta $83 8659 275e4 8660 275e4 ;seed random number with hopefully-random timer value 8661 275e4 a9 01 lda #1 8662 275e6 0d 84 02 ora INTIM 8663 275e9 85 40 sta rand 8664 275eb 8665 275eb ; detect the console type... 8666 275eb pndetectvblankstart 8667 275eb a5 28 lda MSTAT 8668 275ed 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 8669 275ef pndetectvblankover 8670 275ef a5 28 lda MSTAT 8671 275f1 30 fc bmi pndetectvblankover ; then wait for it to be over 8672 275f3 a0 00 ldy #$00 8673 275f5 a2 00 ldx #$00 8674 275f7 pndetectvblankhappening 8675 275f7 a5 28 lda MSTAT 8676 275f9 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 8677 275fb 85 24 sta WSYNC 8678 275fd 85 24 sta WSYNC 8679 275ff e8 inx 8680 27600 d0 f5 bne pndetectvblankhappening 8681 27602 pndetectinvblank 8682 27602 e0 7d cpx #125 8683 27604 90 02 bcc pndetecispal 8684 27606 a0 01 ldy #$01 8685 27608 pndetecispal 8686 27608 8c 09 21 sty paldetected 8687 2760b 8688 2760b 20 a7 f4 jsr createallgamedlls 8689 2760e 8690 2760e a9 18 lda #>DLLMEM 8691 27610 85 2c sta DPPH 8692 27612 a9 00 lda # 255 8887 2766b -DOUBLEBUFFEROFFSET = 255 8888 2766b else 8889 2766b 00 4d DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 8890 2766b endif 8891 2766b 8892 2766b - ifconst EXTRADLMEMORY 8893 2766b -SECONDDLHALFSTART SET $2300 8894 2766b endif 8895 2766b 8896 2766b DLPOINTH 8897 2766b DLINDEX SET 0 8898 2766b REPEAT WZONECOUNT 8899 2766b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2766b - ifconst EXTRADLMEMORY 8901 2766b - if TMPMEMADDRESS > $1FFF 8902 2766b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2766b - else 8904 2766b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2766b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2766b -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2766b - endif 8908 2766b - endif ; TMPMEMADDRESS > $1FFF 8909 2766b endif ; EXTRADLMEMORY 8910 2766b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2766b 18 .byte.b >TMPMEMADDRESS 8912 2766b DLINDEX SET DLINDEX + 1 8898 2766b REPEND 8899 2766b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2766c - ifconst EXTRADLMEMORY 8901 2766c - if TMPMEMADDRESS > $1FFF 8902 2766c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2766c - else 8904 2766c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2766c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2766c -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2766c - endif 8908 2766c - endif ; TMPMEMADDRESS > $1FFF 8909 2766c endif ; EXTRADLMEMORY 8910 2766c ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2766c 18 .byte.b >TMPMEMADDRESS 8912 2766c DLINDEX SET DLINDEX + 1 8898 2766c REPEND 8899 2766c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2766d - ifconst EXTRADLMEMORY 8901 2766d - if TMPMEMADDRESS > $1FFF 8902 2766d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2766d - else 8904 2766d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2766d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2766d -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2766d - endif 8908 2766d - endif ; TMPMEMADDRESS > $1FFF 8909 2766d endif ; EXTRADLMEMORY 8910 2766d ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2766d 19 .byte.b >TMPMEMADDRESS 8912 2766d DLINDEX SET DLINDEX + 1 8898 2766d REPEND 8899 2766d TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2766e - ifconst EXTRADLMEMORY 8901 2766e - if TMPMEMADDRESS > $1FFF 8902 2766e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2766e - else 8904 2766e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2766e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2766e -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2766e - endif 8908 2766e - endif ; TMPMEMADDRESS > $1FFF 8909 2766e endif ; EXTRADLMEMORY 8910 2766e ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2766e 19 .byte.b >TMPMEMADDRESS 8912 2766e DLINDEX SET DLINDEX + 1 8898 2766e REPEND 8899 2766e TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2766f - ifconst EXTRADLMEMORY 8901 2766f - if TMPMEMADDRESS > $1FFF 8902 2766f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2766f - else 8904 2766f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2766f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2766f -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2766f - endif 8908 2766f - endif ; TMPMEMADDRESS > $1FFF 8909 2766f endif ; EXTRADLMEMORY 8910 2766f ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2766f 19 .byte.b >TMPMEMADDRESS 8912 2766f DLINDEX SET DLINDEX + 1 8898 2766f REPEND 8899 2766f TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27670 - ifconst EXTRADLMEMORY 8901 27670 - if TMPMEMADDRESS > $1FFF 8902 27670 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27670 - else 8904 27670 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27670 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27670 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27670 - endif 8908 27670 - endif ; TMPMEMADDRESS > $1FFF 8909 27670 endif ; EXTRADLMEMORY 8910 27670 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27670 1a .byte.b >TMPMEMADDRESS 8912 27670 DLINDEX SET DLINDEX + 1 8898 27670 REPEND 8899 27670 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27671 - ifconst EXTRADLMEMORY 8901 27671 - if TMPMEMADDRESS > $1FFF 8902 27671 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27671 - else 8904 27671 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27671 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27671 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27671 - endif 8908 27671 - endif ; TMPMEMADDRESS > $1FFF 8909 27671 endif ; EXTRADLMEMORY 8910 27671 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27671 1a .byte.b >TMPMEMADDRESS 8912 27671 DLINDEX SET DLINDEX + 1 8898 27671 REPEND 8899 27671 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27672 - ifconst EXTRADLMEMORY 8901 27672 - if TMPMEMADDRESS > $1FFF 8902 27672 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27672 - else 8904 27672 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27672 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27672 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27672 - endif 8908 27672 - endif ; TMPMEMADDRESS > $1FFF 8909 27672 endif ; EXTRADLMEMORY 8910 27672 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27672 1a .byte.b >TMPMEMADDRESS 8912 27672 DLINDEX SET DLINDEX + 1 8898 27672 REPEND 8899 27672 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27673 - ifconst EXTRADLMEMORY 8901 27673 - if TMPMEMADDRESS > $1FFF 8902 27673 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27673 - else 8904 27673 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27673 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27673 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27673 - endif 8908 27673 - endif ; TMPMEMADDRESS > $1FFF 8909 27673 endif ; EXTRADLMEMORY 8910 27673 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27673 1b .byte.b >TMPMEMADDRESS 8912 27673 DLINDEX SET DLINDEX + 1 8898 27673 REPEND 8899 27673 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27674 - ifconst EXTRADLMEMORY 8901 27674 - if TMPMEMADDRESS > $1FFF 8902 27674 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27674 - else 8904 27674 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27674 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27674 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27674 - endif 8908 27674 - endif ; TMPMEMADDRESS > $1FFF 8909 27674 endif ; EXTRADLMEMORY 8910 27674 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27674 1b .byte.b >TMPMEMADDRESS 8912 27674 DLINDEX SET DLINDEX + 1 8898 27674 REPEND 8899 27674 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27675 - ifconst EXTRADLMEMORY 8901 27675 - if TMPMEMADDRESS > $1FFF 8902 27675 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27675 - else 8904 27675 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27675 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27675 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27675 - endif 8908 27675 - endif ; TMPMEMADDRESS > $1FFF 8909 27675 endif ; EXTRADLMEMORY 8910 27675 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27675 1b .byte.b >TMPMEMADDRESS 8912 27675 DLINDEX SET DLINDEX + 1 8898 27675 REPEND 8899 27675 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27676 - ifconst EXTRADLMEMORY 8901 27676 - if TMPMEMADDRESS > $1FFF 8902 27676 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27676 - else 8904 27676 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27676 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27676 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27676 - endif 8908 27676 - endif ; TMPMEMADDRESS > $1FFF 8909 27676 endif ; EXTRADLMEMORY 8910 27676 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27676 1b .byte.b >TMPMEMADDRESS 8912 27676 DLINDEX SET DLINDEX + 1 8898 27676 REPEND 8899 27676 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27677 - ifconst EXTRADLMEMORY 8901 27677 - if TMPMEMADDRESS > $1FFF 8902 27677 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27677 - else 8904 27677 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27677 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27677 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27677 - endif 8908 27677 - endif ; TMPMEMADDRESS > $1FFF 8909 27677 endif ; EXTRADLMEMORY 8910 27677 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27677 1c .byte.b >TMPMEMADDRESS 8912 27677 DLINDEX SET DLINDEX + 1 8898 27677 REPEND 8899 27677 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27678 - ifconst EXTRADLMEMORY 8901 27678 - if TMPMEMADDRESS > $1FFF 8902 27678 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27678 - else 8904 27678 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27678 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27678 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27678 - endif 8908 27678 - endif ; TMPMEMADDRESS > $1FFF 8909 27678 endif ; EXTRADLMEMORY 8910 27678 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27678 1c .byte.b >TMPMEMADDRESS 8912 27678 DLINDEX SET DLINDEX + 1 8898 27678 REPEND 8899 27678 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27679 - ifconst EXTRADLMEMORY 8901 27679 - if TMPMEMADDRESS > $1FFF 8902 27679 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27679 - else 8904 27679 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27679 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27679 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27679 - endif 8908 27679 - endif ; TMPMEMADDRESS > $1FFF 8909 27679 endif ; EXTRADLMEMORY 8910 27679 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27679 1c .byte.b >TMPMEMADDRESS 8912 27679 DLINDEX SET DLINDEX + 1 8898 27679 REPEND 8899 27679 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2767a - ifconst EXTRADLMEMORY 8901 2767a - if TMPMEMADDRESS > $1FFF 8902 2767a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2767a - else 8904 2767a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2767a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2767a -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2767a - endif 8908 2767a - endif ; TMPMEMADDRESS > $1FFF 8909 2767a endif ; EXTRADLMEMORY 8910 2767a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2767a 1d .byte.b >TMPMEMADDRESS 8912 2767a DLINDEX SET DLINDEX + 1 8898 2767a REPEND 8899 2767a TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2767b - ifconst EXTRADLMEMORY 8901 2767b - if TMPMEMADDRESS > $1FFF 8902 2767b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2767b - else 8904 2767b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2767b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2767b -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2767b - endif 8908 2767b - endif ; TMPMEMADDRESS > $1FFF 8909 2767b endif ; EXTRADLMEMORY 8910 2767b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2767b 1d .byte.b >TMPMEMADDRESS 8912 2767b DLINDEX SET DLINDEX + 1 8898 2767b REPEND 8899 2767b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2767c - ifconst EXTRADLMEMORY 8901 2767c - if TMPMEMADDRESS > $1FFF 8902 2767c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2767c - else 8904 2767c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2767c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2767c -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2767c - endif 8908 2767c - endif ; TMPMEMADDRESS > $1FFF 8909 2767c endif ; EXTRADLMEMORY 8910 2767c ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2767c 1d .byte.b >TMPMEMADDRESS 8912 2767c DLINDEX SET DLINDEX + 1 8898 2767c REPEND 8899 2767c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2767d - ifconst EXTRADLMEMORY 8901 2767d - if TMPMEMADDRESS > $1FFF 8902 2767d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2767d - else 8904 2767d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2767d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2767d -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2767d - endif 8908 2767d - endif ; TMPMEMADDRESS > $1FFF 8909 2767d endif ; EXTRADLMEMORY 8910 2767d ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2767d 1e .byte.b >TMPMEMADDRESS 8912 2767d DLINDEX SET DLINDEX + 1 8898 2767d REPEND 8899 2767d TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2767e - ifconst EXTRADLMEMORY 8901 2767e - if TMPMEMADDRESS > $1FFF 8902 2767e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2767e - else 8904 2767e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2767e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2767e -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2767e - endif 8908 2767e - endif ; TMPMEMADDRESS > $1FFF 8909 2767e endif ; EXTRADLMEMORY 8910 2767e ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2767e 1e .byte.b >TMPMEMADDRESS 8912 2767e DLINDEX SET DLINDEX + 1 8898 2767e REPEND 8899 2767e TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2767f - ifconst EXTRADLMEMORY 8901 2767f - if TMPMEMADDRESS > $1FFF 8902 2767f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2767f - else 8904 2767f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2767f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2767f -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2767f - endif 8908 2767f - endif ; TMPMEMADDRESS > $1FFF 8909 2767f endif ; EXTRADLMEMORY 8910 2767f ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2767f 1e .byte.b >TMPMEMADDRESS 8912 2767f DLINDEX SET DLINDEX + 1 8898 2767f REPEND 8899 2767f TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27680 - ifconst EXTRADLMEMORY 8901 27680 - if TMPMEMADDRESS > $1FFF 8902 27680 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27680 - else 8904 27680 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27680 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27680 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27680 - endif 8908 27680 - endif ; TMPMEMADDRESS > $1FFF 8909 27680 endif ; EXTRADLMEMORY 8910 27680 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27680 1f .byte.b >TMPMEMADDRESS 8912 27680 DLINDEX SET DLINDEX + 1 8898 27680 REPEND 8899 27680 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27681 - ifconst EXTRADLMEMORY 8901 27681 - if TMPMEMADDRESS > $1FFF 8902 27681 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27681 - else 8904 27681 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27681 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27681 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27681 - endif 8908 27681 - endif ; TMPMEMADDRESS > $1FFF 8909 27681 endif ; EXTRADLMEMORY 8910 27681 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27681 1f .byte.b >TMPMEMADDRESS 8912 27681 DLINDEX SET DLINDEX + 1 8898 27681 REPEND 8899 27681 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27682 - ifconst EXTRADLMEMORY 8901 27682 - if TMPMEMADDRESS > $1FFF 8902 27682 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27682 - else 8904 27682 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27682 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27682 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27682 - endif 8908 27682 - endif ; TMPMEMADDRESS > $1FFF 8909 27682 endif ; EXTRADLMEMORY 8910 27682 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27682 1f .byte.b >TMPMEMADDRESS 8912 27682 DLINDEX SET DLINDEX + 1 8913 27683 REPEND 8914 27683 8915 27683 - ifconst EXTRADLMEMORY 8916 27683 - echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 8917 27683 endif 8918 27683 8919 27683 8920 27683 DLPOINTL 8921 27683 DLINDEX SET 0 8922 27683 REPEAT WZONECOUNT 8923 27683 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8924 27683 - ifconst EXTRADLMEMORY 8925 27683 - if TMPMEMADDRESS > $1FFF 8926 27683 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27683 - else 8928 27683 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27683 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27683 - endif 8931 27683 - endif ; TMPMEMADDRESS > $1FFF 8932 27683 endif ; EXTRADLMEMORY 8933 27683 80 .byte.b $1FFF 8926 27684 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27684 - else 8928 27684 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27684 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27684 - endif 8931 27684 - endif ; TMPMEMADDRESS > $1FFF 8932 27684 endif ; EXTRADLMEMORY 8933 27684 d0 .byte.b $1FFF 8926 27685 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27685 - else 8928 27685 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27685 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27685 - endif 8931 27685 - endif ; TMPMEMADDRESS > $1FFF 8932 27685 endif ; EXTRADLMEMORY 8933 27685 20 .byte.b $1FFF 8926 27686 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27686 - else 8928 27686 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27686 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27686 - endif 8931 27686 - endif ; TMPMEMADDRESS > $1FFF 8932 27686 endif ; EXTRADLMEMORY 8933 27686 70 .byte.b $1FFF 8926 27687 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27687 - else 8928 27687 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27687 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27687 - endif 8931 27687 - endif ; TMPMEMADDRESS > $1FFF 8932 27687 endif ; EXTRADLMEMORY 8933 27687 c0 .byte.b $1FFF 8926 27688 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27688 - else 8928 27688 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27688 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27688 - endif 8931 27688 - endif ; TMPMEMADDRESS > $1FFF 8932 27688 endif ; EXTRADLMEMORY 8933 27688 10 .byte.b $1FFF 8926 27689 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27689 - else 8928 27689 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27689 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27689 - endif 8931 27689 - endif ; TMPMEMADDRESS > $1FFF 8932 27689 endif ; EXTRADLMEMORY 8933 27689 60 .byte.b $1FFF 8926 2768a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2768a - else 8928 2768a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2768a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2768a - endif 8931 2768a - endif ; TMPMEMADDRESS > $1FFF 8932 2768a endif ; EXTRADLMEMORY 8933 2768a b0 .byte.b $1FFF 8926 2768b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2768b - else 8928 2768b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2768b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2768b - endif 8931 2768b - endif ; TMPMEMADDRESS > $1FFF 8932 2768b endif ; EXTRADLMEMORY 8933 2768b 00 .byte.b $1FFF 8926 2768c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2768c - else 8928 2768c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2768c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2768c - endif 8931 2768c - endif ; TMPMEMADDRESS > $1FFF 8932 2768c endif ; EXTRADLMEMORY 8933 2768c 50 .byte.b $1FFF 8926 2768d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2768d - else 8928 2768d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2768d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2768d - endif 8931 2768d - endif ; TMPMEMADDRESS > $1FFF 8932 2768d endif ; EXTRADLMEMORY 8933 2768d a0 .byte.b $1FFF 8926 2768e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2768e - else 8928 2768e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2768e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2768e - endif 8931 2768e - endif ; TMPMEMADDRESS > $1FFF 8932 2768e endif ; EXTRADLMEMORY 8933 2768e f0 .byte.b $1FFF 8926 2768f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2768f - else 8928 2768f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2768f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2768f - endif 8931 2768f - endif ; TMPMEMADDRESS > $1FFF 8932 2768f endif ; EXTRADLMEMORY 8933 2768f 40 .byte.b $1FFF 8926 27690 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27690 - else 8928 27690 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27690 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27690 - endif 8931 27690 - endif ; TMPMEMADDRESS > $1FFF 8932 27690 endif ; EXTRADLMEMORY 8933 27690 90 .byte.b $1FFF 8926 27691 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27691 - else 8928 27691 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27691 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27691 - endif 8931 27691 - endif ; TMPMEMADDRESS > $1FFF 8932 27691 endif ; EXTRADLMEMORY 8933 27691 e0 .byte.b $1FFF 8926 27692 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27692 - else 8928 27692 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27692 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27692 - endif 8931 27692 - endif ; TMPMEMADDRESS > $1FFF 8932 27692 endif ; EXTRADLMEMORY 8933 27692 30 .byte.b $1FFF 8926 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27693 - else 8928 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27693 - endif 8931 27693 - endif ; TMPMEMADDRESS > $1FFF 8932 27693 endif ; EXTRADLMEMORY 8933 27693 80 .byte.b $1FFF 8926 27694 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27694 - else 8928 27694 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27694 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27694 - endif 8931 27694 - endif ; TMPMEMADDRESS > $1FFF 8932 27694 endif ; EXTRADLMEMORY 8933 27694 d0 .byte.b $1FFF 8926 27695 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27695 - else 8928 27695 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27695 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27695 - endif 8931 27695 - endif ; TMPMEMADDRESS > $1FFF 8932 27695 endif ; EXTRADLMEMORY 8933 27695 20 .byte.b $1FFF 8926 27696 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27696 - else 8928 27696 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27696 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27696 - endif 8931 27696 - endif ; TMPMEMADDRESS > $1FFF 8932 27696 endif ; EXTRADLMEMORY 8933 27696 70 .byte.b $1FFF 8926 27697 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27697 - else 8928 27697 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27697 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27697 - endif 8931 27697 - endif ; TMPMEMADDRESS > $1FFF 8932 27697 endif ; EXTRADLMEMORY 8933 27697 c0 .byte.b $1FFF 8926 27698 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27698 - else 8928 27698 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27698 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27698 - endif 8931 27698 - endif ; TMPMEMADDRESS > $1FFF 8932 27698 endif ; EXTRADLMEMORY 8933 27698 10 .byte.b $1FFF 8926 27699 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27699 - else 8928 27699 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27699 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27699 - endif 8931 27699 - endif ; TMPMEMADDRESS > $1FFF 8932 27699 endif ; EXTRADLMEMORY 8933 27699 60 .byte.b $1FFF 8926 2769a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2769a - else 8928 2769a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2769a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2769a - endif 8931 2769a - endif ; TMPMEMADDRESS > $1FFF 8932 2769a endif ; EXTRADLMEMORY 8933 2769a b0 .byte.b $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 18 80 ZONE0ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 18 d0 ZONE1ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 19 20 ZONE2ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 19 70 ZONE3ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 19 c0 ZONE4ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1a 10 ZONE5ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1a 60 ZONE6ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1a b0 ZONE7ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1b 00 ZONE8ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1b 50 ZONE9ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1b a0 ZONE10ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1b f0 ZONE11ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1c 40 ZONE12ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1c 90 ZONE13ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1c e0 ZONE14ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1d 30 ZONE15ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1d 80 ZONE16ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1d d0 ZONE17ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1e 20 ZONE18ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1e 70 ZONE19ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1e c0 ZONE20ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1f 10 ZONE21ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1f 60 ZONE22ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8939 2769b REPEND 8940 2769b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 2769b - ifconst EXTRADLMEMORY 8942 2769b - if TMPMEMADDRESS > $1FFF 8943 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 2769b - else 8945 2769b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 2769b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 2769b - endif 8948 2769b - endif ; TMPMEMADDRESS > $1FFF 8949 2769b endif ; EXTRADLMEMORY 8950 2769b 8951 2769b 1f b0 ZONE23ADDRESS = TMPMEMADDRESS 8952 2769b 8953 2769b DLINDEX SET DLINDEX + 1 8954 2769b REPEND 8955 2769b 8956 2769b $1880 to $1fff used as zone memory, allowing 15 display objects per zone. 8957 2769b echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 8958 2769b 8959 2769b DLHEIGHT 8960 2769b REPEAT WZONECOUNT 8961 2769b 07 .byte.b (WZONEHEIGHT-1) 8960 2769b REPEND 8961 2769c 07 .byte.b (WZONEHEIGHT-1) 8960 2769c REPEND 8961 2769d 07 .byte.b (WZONEHEIGHT-1) 8960 2769d REPEND 8961 2769e 07 .byte.b (WZONEHEIGHT-1) 8960 2769e REPEND 8961 2769f 07 .byte.b (WZONEHEIGHT-1) 8960 2769f REPEND 8961 276a0 07 .byte.b (WZONEHEIGHT-1) 8960 276a0 REPEND 8961 276a1 07 .byte.b (WZONEHEIGHT-1) 8960 276a1 REPEND 8961 276a2 07 .byte.b (WZONEHEIGHT-1) 8960 276a2 REPEND 8961 276a3 07 .byte.b (WZONEHEIGHT-1) 8960 276a3 REPEND 8961 276a4 07 .byte.b (WZONEHEIGHT-1) 8960 276a4 REPEND 8961 276a5 07 .byte.b (WZONEHEIGHT-1) 8960 276a5 REPEND 8961 276a6 07 .byte.b (WZONEHEIGHT-1) 8960 276a6 REPEND 8961 276a7 07 .byte.b (WZONEHEIGHT-1) 8960 276a7 REPEND 8961 276a8 07 .byte.b (WZONEHEIGHT-1) 8960 276a8 REPEND 8961 276a9 07 .byte.b (WZONEHEIGHT-1) 8960 276a9 REPEND 8961 276aa 07 .byte.b (WZONEHEIGHT-1) 8960 276aa REPEND 8961 276ab 07 .byte.b (WZONEHEIGHT-1) 8960 276ab REPEND 8961 276ac 07 .byte.b (WZONEHEIGHT-1) 8960 276ac REPEND 8961 276ad 07 .byte.b (WZONEHEIGHT-1) 8960 276ad REPEND 8961 276ae 07 .byte.b (WZONEHEIGHT-1) 8960 276ae REPEND 8961 276af 07 .byte.b (WZONEHEIGHT-1) 8960 276af REPEND 8961 276b0 07 .byte.b (WZONEHEIGHT-1) 8960 276b0 REPEND 8961 276b1 07 .byte.b (WZONEHEIGHT-1) 8960 276b1 REPEND 8961 276b2 07 .byte.b (WZONEHEIGHT-1) 8962 276b3 REPEND 8963 276b3 8964 276b3 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8965 276b3 8966 276b3 ; a simple guard, than ensures the 7800basic code hasn't 8967 276b3 ; spilled into the encryption area... 2251 bytes left in the 7800basic reserved area. 8968 276b3 echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 8969 276b3 - if (*>$FF7D) 8970 276b3 - ERR ; abort the assembly 8971 276b3 endif 8972 276b3 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8973 276b3 8974 276b3 - ifconst DEV 8975 276b3 - ifnconst ZONEHEIGHT 8976 276b3 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8977 276b3 - else 8978 276b3 - if ZONEHEIGHT = 8 8979 276b3 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8980 276b3 - else 8981 276b3 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8982 276b3 - endif 8983 276b3 - endif 8984 276b3 endif 8985 276b3 8986 276b3 ; FF7E/FF7F contains the 7800basic crc checksum word 8987 276b3 8988 276b3 ; FF80 - FFF7 contains the 7800 encryption key 8989 276b3 8990 276b3 - ifnconst bankswitchmode 8991 276b3 - ORG $FFF8 8992 276b3 else 8993 276b3 ifconst ROM128K 8994 27ff8 ORG $27FF8 8995 27ff8 RORG $FFF8 8996 27ff8 endif 8997 27ff8 - ifconst ROM144K 8998 27ff8 - ORG $27FF8 8999 27ff8 - RORG $FFF8 9000 27ff8 endif 9001 27ff8 - ifconst ROM256K 9002 27ff8 - ORG $47FF8 9003 27ff8 - RORG $FFF8 9004 27ff8 endif 9005 27ff8 - ifconst ROM272K 9006 27ff8 - ORG $47FF8 9007 27ff8 - RORG $FFF8 9008 27ff8 endif 9009 27ff8 - ifconst ROM512K 9010 27ff8 - ORG $87FF8 9011 27ff8 - RORG $FFF8 9012 27ff8 endif 9013 27ff8 - ifconst ROM528K 9014 27ff8 - ORG $87FF8 9015 27ff8 - RORG $FFF8 9016 27ff8 endif 9017 27ff8 endif 9018 27ff8 9019 27ff8 9020 27ff8 ff .byte.b $FF ; region verification. $FF=all regions 9021 27ff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 9022 27ffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 9023 27ffa 9024 27ffa ;Vectors 9025 27ffa 00 f0 .word.w NMI 9026 27ffc 7a f5 .word.w START 9027 27ffe 62 f0 .word.w IRQ 9028 28000