------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_VerticalShooter_Test_sprani.78b.asm LEVEL 1 PASS 3 1 10000 ???? ; MACRO.H 2 10000 ???? 3 10000 ???? ; Based on the 2600 macro.h file. 4 10000 ???? ; Macros irrelevant to the 7800 have been removed, and the sleep macro 5 10000 ???? ; has been adapted to give accurate results on the 7800. 6 10000 ???? 7 10000 ???? ; Version 1.0 2019/12/11 (based on the 2600 Version 1.05, 13/NOVEMBER/2003) 8 10000 ???? 9 10000 ???? ; Available macros... 10 10000 ???? ; SLEEP n - sleep for n cycles 11 10000 ???? ; SET_POINTER - load a 16-bit absolute to a 16-bit variable 12 10000 ???? 13 10000 ???? ;------------------------------------------------------------------------------- 14 10000 ???? ; SLEEP duration 15 10000 ???? ; Original author: Thomas Jentzsch 16 10000 ???? ; Inserts code which takes the specified number of cycles to execute. This is 17 10000 ???? ; useful for code where precise timing is required. 18 10000 ???? ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS. 19 10000 ???? ; LEGAL OPCODE VERSION MAY AFFECT FLAGS 20 10000 ???? ; Uses illegal opcode (DASM 2.20.01 onwards). 21 10000 ???? 22 10000 ???? MAC sleep 23 10000 ???? .CYCLES SET {1} 24 10000 ???? 25 10000 ???? IF .CYCLES < 2 26 10000 ???? ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 27 10000 ???? ERR 28 10000 ???? ENDIF 29 10000 ???? 30 10000 ???? IF .CYCLES & 1 31 10000 ???? IFNCONST NO_ILLEGAL_OPCODES 32 10000 ???? nop $80 33 10000 ???? ELSE 34 10000 ???? bit $80 35 10000 ???? ENDIF 36 10000 ???? .CYCLES SET .CYCLES - 3 37 10000 ???? ENDIF 38 10000 ???? 39 10000 ???? REPEAT .CYCLES / 2 40 10000 ???? nop 41 10000 ???? REPEND 42 10000 ???? ENDM ;usage: SLEEP n (n>1) 43 10000 ???? 44 10000 ???? ;------------------------------------------------------- 45 10000 ???? ; SET_POINTER 46 10000 ???? ; Original author: Manuel Rotschkar 47 10000 ???? ; 48 10000 ???? ; Sets a 2 byte RAM pointer to an absolute address. 49 10000 ???? ; 50 10000 ???? ; Usage: SET_POINTER pointer, address 51 10000 ???? ; Example: SET_POINTER SpritePTR, SpriteData 52 10000 ???? ; 53 10000 ???? ; Note: Alters the accumulator, NZ flags 54 10000 ???? ; IN 1: 2 byte RAM location reserved for pointer 55 10000 ???? ; IN 2: absolute address 56 10000 ???? 57 10000 ???? MAC set_pointer 58 10000 ???? .POINTER SET {1} 59 10000 ???? .ADDRESS SET {2} 60 10000 ???? 61 10000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address 62 10000 ???? STA .POINTER ; Store in pointer 63 10000 ???? LDA #>.ADDRESS ; Get Hibyte of Address 64 10000 ???? STA .POINTER+1 ; Store in pointer+1 65 10000 ???? 66 10000 ???? ENDM 67 10000 ???? 68 10000 ???? ; EOF 69 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 70 10000 ???? 71 10000 ???? ; 7800MACRO.H 72 10000 ???? 73 10000 ???? ;------------------------------------------------------- 74 10000 ???? ; BOXCOLLISIONCHECK 75 10000 ???? ; author: Mike Saarna 76 10000 ???? ; 77 10000 ???? ; A general bounding box collision check. compares 2 rectangles of differing size 78 10000 ???? ; and shape for overlap. Carry is set for collision detected, clear for none. 79 10000 ???? ; 80 10000 ???? ; Usage: BOXCOLLISIONCHECK x1var,y1var,w1var,h1var,x2var,y2var,w2var,h2var 81 10000 ???? ; 82 10000 ???? 83 10000 ???? MAC boxcollisioncheck 84 10000 ???? .boxx1 SET {1} 85 10000 ???? .boxy1 SET {2} 86 10000 ???? .boxw1 SET {3} 87 10000 ???? .boxh1 SET {4} 88 10000 ???? .boxx2 SET {5} 89 10000 ???? .boxy2 SET {6} 90 10000 ???? .boxw2 SET {7} 91 10000 ???? .boxh2 SET {8} 92 10000 ???? 93 10000 ???? .DoXCollisionCheck 94 10000 ???? lda .boxx1 ;3 95 10000 ???? cmp .boxx2 ;2 96 10000 ???? bcs .X1isbiggerthanX2 ;2/3 97 10000 ???? .X2isbiggerthanX1 98 10000 ???? adc #.boxw1 ;2 99 10000 ???? cmp .boxx2 ;3 100 10000 ???? bcs .DoYCollisionCheck ;3/2 101 10000 ???? bcc .noboxcollision ;3 102 10000 ???? .X1isbiggerthanX2 103 10000 ???? clc ;2 104 10000 ???? sbc #.boxw2 ;2 105 10000 ???? cmp .boxx2 ;3 106 10000 ???? bcs .noboxcollision ;3/2 107 10000 ???? .DoYCollisionCheck 108 10000 ???? lda .boxy1 ;3 109 10000 ???? cmp .boxy2 ;3 110 10000 ???? bcs .Y1isbiggerthanY2 ;3/2 111 10000 ???? .Y2isbiggerthanY1 112 10000 ???? adc #.boxh1 ;2 113 10000 ???? cmp .boxy2 ;3 114 10000 ???? jmp .checkdone ;6 115 10000 ???? .Y1isbiggerthanY2 116 10000 ???? clc ;2 117 10000 ???? sbc #.boxh2 ;2 118 10000 ???? cmp .boxy2 ;3 119 10000 ???? bcs .noboxcollision ;3/2 120 10000 ???? .boxcollision 121 10000 ???? sec ;2 122 10000 ???? .byte $24 ; hardcoded "BIT [clc opcode]", used to skip over the following clc 123 10000 ???? .noboxcollision 124 10000 ???? clc ;2 125 10000 ???? .checkdone 126 10000 ???? 127 10000 ???? ENDM 128 10000 ???? 129 10000 ???? MAC median3 130 10000 ???? 131 10000 ???? ; A median filter (for smoothing paddle jitter) 132 10000 ???? ; this macro takes the current paddle value, compares it to historic 133 10000 ???? ; values, and replaces the current paddle value with the median. 134 10000 ???? ; 135 10000 ???? ; called as: MEDIAN3 STORAGE CURRENT 136 10000 ???? ; where STORAGE points to 3 consecutive bytes of memory. The first 2 137 10000 ???? ; must be dedicated to this MEDIAN filter. The last 1 is a temp. 138 10000 ???? ; where CURRENT is memory holding the new value you wish to compare to 139 10000 ???? ; the previous values, and update with the median value. 140 10000 ???? ; 141 10000 ???? ; returns: CURRENT (modified to contain median value) 142 10000 ???? ; 143 10000 ???? ; author: Mike Saarna (aka RevEng) 144 10000 ???? 145 10000 ???? .MedianBytes SET {1} 146 10000 ???? .NewValue SET {2} 147 10000 ???? 148 10000 ???? lda #0 149 10000 ???? ldy .NewValue 150 10000 ???? sty .MedianBytes+2 ; put the new value in the most "recent" slot 151 10000 ???? 152 10000 ???? ; build an index from relative size comparisons between our 3 values. 153 10000 ???? cpy .MedianBytes 154 10000 ???? rol 155 10000 ???? cpy .MedianBytes+1 156 10000 ???? rol 157 10000 ???? ldy .MedianBytes 158 10000 ???? cpy .MedianBytes+1 159 10000 ???? rol 160 10000 ???? tay 161 10000 ???? 162 10000 ???? ldx MedianOrderLUT,y ; convert the size-comparison index to an index to the median value 163 10000 ???? lda .MedianBytes,x 164 10000 ???? sta .NewValue ; we replace the new value memory with the median value 165 10000 ???? 166 10000 ???? ; then shift values from "newer" bytes to "older" bytes, leaving the 167 10000 ???? ; newest byte (.MedianBytes+2) empty for next time. 168 10000 ???? lda .MedianBytes+1 169 10000 ???? sta .MedianBytes 170 10000 ???? lda .MedianBytes+2 171 10000 ???? sta .MedianBytes+1 172 10000 ???? ifnconst MedianOrderLUT 173 10000 ???? jmp MedianOrderLUTend 174 10000 ???? MedianOrderLUT ; converts our "comparison index" to an index to the median value 175 10000 ???? .byte 0 ; 0 B2 < B0 < B1 176 10000 ???? .byte 1 ; 1 B2 < B1 < B0 177 10000 ???? .byte 2 ; 2 impossible 178 10000 ???? .byte 2 ; 3 B1 < B2 < B0 179 10000 ???? .byte 2 ; 4 B0 < B2 < B1 180 10000 ???? .byte 2 ; 5 impossible 181 10000 ???? .byte 1 ; 6 B0 < B1 < B2 182 10000 ???? .byte 0 ; 7 B1 < B0 < B2 183 10000 ???? MedianOrderLUTend 184 10000 ???? endif 185 10000 ???? ENDM 186 10000 ???? 187 10000 ???? MAC plotsprite 188 10000 ???? 189 10000 ???? ; A macro version of the plotsprite command. 190 10000 ???? ; This trades off rom space for speed. 191 10000 ???? ; It also doesn't check if the visible screen is displayed or not. 192 10000 ???? ; It has no training wheels. It is all rusty sharp edges. 193 10000 ???? 194 10000 ???? .GFXLabel SET {1} 195 10000 ???? .Palette SET {2} ; constant 196 10000 ???? .SpriteX SET {3} ; variable 197 10000 ???? .SpriteY SET {4} ; variable 198 10000 ???? .ByteOffset SET {5} ; variable 199 10000 ???? 200 10000 ???? lda .SpriteY 201 10000 ???? lsr 202 10000 ???? lsr 203 10000 ???? asr #%11111110 ; ensure carry is clear 204 10000 ???? if WZONEHEIGHT = 16 205 10000 ???? asr #%11111110 ; ensure carry is clear 206 10000 ???? endif 207 10000 ???? 208 10000 ???? tax 209 10000 ???? 210 10000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 211 10000 ???? sta dlpnt 212 10000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 213 10000 ???? sta dlpnt+1 214 10000 ???? 215 10000 ???? ldy dlend,x ; find the next new object position in this zone 216 10000 ???? 217 10000 ???? lda .ByteOffset 218 10000 ???? if {1}_width = 2 219 10000 ???? asl 220 10000 ???? endif 221 10000 ???? if {1}_width = 3 222 10000 ???? asl 223 10000 ???? adc .ByteOffset 224 10000 ???? endif 225 10000 ???? if {1}_width = 4 226 10000 ???? asl 227 10000 ???? asl 228 10000 ???? endif 229 10000 ???? if {1}_width = 5 230 10000 ???? asl 231 10000 ???? asl 232 10000 ???? adc .ByteOffset 233 10000 ???? endif 234 10000 ???? if {1}_width = 6 235 10000 ???? asl 236 10000 ???? adc .ByteOffset 237 10000 ???? asl 238 10000 ???? endif 239 10000 ???? if {1}_width = 7 240 10000 ???? asl 241 10000 ???? adc .ByteOffset 242 10000 ???? asl 243 10000 ???? adc .ByteOffset 244 10000 ???? endif 245 10000 ???? if {1}_width = 8 246 10000 ???? asl 247 10000 ???? asl 248 10000 ???? asl 249 10000 ???? endif 250 10000 ???? if {1}_width = 9 251 10000 ???? asl 252 10000 ???? asl 253 10000 ???? asl 254 10000 ???? adc .ByteOffset 255 10000 ???? endif 256 10000 ???? if {1}_width = 10 257 10000 ???? asl 258 10000 ???? asl 259 10000 ???? adc .ByteOffset 260 10000 ???? asl 261 10000 ???? endif 262 10000 ???? if {1}_width = 11 263 10000 ???? asl 264 10000 ???? asl 265 10000 ???? adc .ByteOffset 266 10000 ???? asl 267 10000 ???? adc .ByteOffset 268 10000 ???? endif 269 10000 ???? if {1}_width = 12 270 10000 ???? asl 271 10000 ???? adc .ByteOffset 272 10000 ???? asl 273 10000 ???? asl 274 10000 ???? endif 275 10000 ???? if {1}_width = 13 276 10000 ???? asl 277 10000 ???? adc .ByteOffset 278 10000 ???? asl 279 10000 ???? asl 280 10000 ???? adc .ByteOffset 281 10000 ???? endif 282 10000 ???? if {1}_width = 14 283 10000 ???? asl 284 10000 ???? adc .ByteOffset 285 10000 ???? asl 286 10000 ???? adc .ByteOffset 287 10000 ???? asl 288 10000 ???? endif 289 10000 ???? 290 10000 ???? adc #<.GFXLabel ; carry is clear via previous asl or asr 291 10000 ???? sta (dlpnt),y ; #1 - low byte object address 292 10000 ???? 293 10000 ???? iny 294 10000 ???? 295 10000 ???? lda #({1}_mode | %01000000) 296 10000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 297 10000 ???? 298 10000 ???? iny 299 10000 ???? 300 10000 ???? lda .SpriteY 301 10000 ???? and #(WZONEHEIGHT - 1) 302 10000 ???? cmp #1 ; clear carry if our sprite is just in this zone 303 10000 ???? ora #>.GFXLabel 304 10000 ???? sta (dlpnt),y ; #3 - hi byte object address 305 10000 ???? 306 10000 ???? iny 307 10000 ???? 308 10000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 309 10000 ???? sta (dlpnt),y ; #4 - palette|width 310 10000 ???? 311 10000 ???? iny 312 10000 ???? 313 10000 ???? lda .SpriteX 314 10000 ???? sta (dlpnt),y ; #5 - x object position 315 10000 ???? 316 10000 ???? iny 317 10000 ???? sty dlend,x 318 10000 ???? 319 10000 ???? ifconst ALWAYSTERMINATE 320 10000 ???? iny 321 10000 ???? lda #0 322 10000 ???? sta (dlpnt),y 323 10000 ???? endif 324 10000 ???? 325 10000 ???? bcc .PLOTSPRITEend 326 10000 ???? 327 10000 ???? inx ; next zone 328 10000 ???? 329 10000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 330 10000 ???? sta dlpnt 331 10000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 332 10000 ???? sta dlpnt+1 333 10000 ???? 334 10000 ???? ldy dlend,x ; find the next new object position in this zone 335 10000 ???? 336 10000 ???? lda .ByteOffset 337 10000 ???? if {1}_width = 1 338 10000 ???? clc 339 10000 ???? endif 340 10000 ???? if {1}_width = 2 341 10000 ???? asl ; carry clear 342 10000 ???? endif 343 10000 ???? if {1}_width = 3 344 10000 ???? asl ; carry clear 345 10000 ???? adc .ByteOffset 346 10000 ???? endif 347 10000 ???? if {1}_width = 4 348 10000 ???? asl ; carry clear 349 10000 ???? asl 350 10000 ???? endif 351 10000 ???? if {1}_width = 5 352 10000 ???? asl ; carry clear 353 10000 ???? asl 354 10000 ???? adc .ByteOffset 355 10000 ???? endif 356 10000 ???? if {1}_width = 6 357 10000 ???? asl ; carry clear 358 10000 ???? adc .ByteOffset 359 10000 ???? asl 360 10000 ???? endif 361 10000 ???? if {1}_width = 7 362 10000 ???? asl ; carry clear 363 10000 ???? adc .ByteOffset 364 10000 ???? asl 365 10000 ???? endif 366 10000 ???? if {1}_width = 8 367 10000 ???? asl ; carry clear 368 10000 ???? asl 369 10000 ???? asl 370 10000 ???? endif 371 10000 ???? if {1}_width = 9 372 10000 ???? asl ; carry clear 373 10000 ???? asl 374 10000 ???? asl 375 10000 ???? adc .ByteOffset 376 10000 ???? endif 377 10000 ???? if {1}_width = 10 378 10000 ???? asl ; carry clear 379 10000 ???? asl 380 10000 ???? adc .ByteOffset 381 10000 ???? asl 382 10000 ???? endif 383 10000 ???? if {1}_width = 11 384 10000 ???? asl ; carry clear 385 10000 ???? asl 386 10000 ???? adc .ByteOffset 387 10000 ???? asl 388 10000 ???? adc .ByteOffset 389 10000 ???? endif 390 10000 ???? if {1}_width = 12 391 10000 ???? asl ; carry clear 392 10000 ???? adc .ByteOffset 393 10000 ???? asl 394 10000 ???? asl 395 10000 ???? endif 396 10000 ???? if {1}_width = 13 397 10000 ???? asl ; carry clear 398 10000 ???? adc .ByteOffset 399 10000 ???? asl 400 10000 ???? asl 401 10000 ???? adc .ByteOffset 402 10000 ???? endif 403 10000 ???? if {1}_width = 14 404 10000 ???? asl ; carry clear 405 10000 ???? adc .ByteOffset 406 10000 ???? asl 407 10000 ???? adc .ByteOffset 408 10000 ???? asl 409 10000 ???? endif 410 10000 ???? 411 10000 ???? adc #<.GFXLabel 412 10000 ???? sta (dlpnt),y ; #1 - low byte object address 413 10000 ???? 414 10000 ???? iny 415 10000 ???? 416 10000 ???? lda #({1}_mode | %01000000) 417 10000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 418 10000 ???? 419 10000 ???? iny 420 10000 ???? 421 10000 ???? lda .SpriteY 422 10000 ???? and #(WZONEHEIGHT - 1) 423 10000 ???? ora #>(.GFXLabel - (WZONEHEIGHT * 256)) ; start in the dma hole 424 10000 ???? sta (dlpnt),y ; #3 - hi byte object address 425 10000 ???? 426 10000 ???? iny 427 10000 ???? 428 10000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 429 10000 ???? sta (dlpnt),y ; #4 - palette|width 430 10000 ???? 431 10000 ???? iny 432 10000 ???? 433 10000 ???? lda .SpriteX 434 10000 ???? sta (dlpnt),y ; #5 - x object position 435 10000 ???? 436 10000 ???? iny 437 10000 ???? sty dlend,x 438 10000 ???? 439 10000 ???? ifconst ALWAYSTERMINATE 440 10000 ???? iny 441 10000 ???? lda #0 442 10000 ???? sta (dlpnt),y 443 10000 ???? endif 444 10000 ???? 445 10000 ???? .PLOTSPRITEend 446 10000 ???? ENDM 447 10000 ???? 448 10000 ???? ; 449 10000 ???? ; speakjet.inc 450 10000 ???? ; 451 10000 ???? ; 452 10000 ???? ; AtariVox Speech Synth Driver 453 10000 ???? ; 454 10000 ???? ; By Alex Herbert, 2004 455 10000 ???? ; 456 10000 ???? 457 10000 ???? 458 10000 ???? 459 10000 ???? 460 10000 ???? ; Constants 461 10000 ???? 462 10000 ???? 463 10000 ???? 00 01 SERIAL_OUTMASK equ $01 464 10000 ???? 00 02 SERIAL_RDYMASK equ $02 465 10000 ???? 466 10000 ???? 467 10000 ???? 468 10000 ???? ; Macros 469 10000 ???? 470 10000 ???? mac spkout 471 10000 ???? 472 10000 ???? ; check buffer-full status 473 10000 ???? lda SWCHA 474 10000 ???? and #SERIAL_RDYMASK 475 10000 ???? beq .speech_done 476 10000 ???? 477 10000 ???? ; get next speech byte 478 10000 ???? ldy #$00 479 10000 ???? lda (speech_addr),y 480 10000 ???? 481 10000 ???? ; invert data and check for end of string 482 10000 ???? eor #$ff 483 10000 ???? ;sta BACKGRND ; debug - uncomment to flash the background color with vox data 484 10000 ???? beq .speech_done 485 10000 ???? sta {1} 486 10000 ???? 487 10000 ???? ; increment speech pointer 488 10000 ???? inc speech_addr 489 10000 ???? bne .incaddr_skip 490 10000 ???? inc speech_addr+1 491 10000 ???? .incaddr_skip 492 10000 ???? 493 10000 ???? ; output byte as serial data 494 10000 ???? 495 10000 ???? sec ; start bit 496 10000 ???? .byteout_loop 497 10000 ???? ; put carry flag into bit 0 of SWACNT, perserving other bits 498 10000 ???? lda SWACNT ; 4 499 10000 ???? and #$fe ; 2 6 500 10000 ???? adc #$00 ; 2 8 501 10000 ???? sta SWACNT ; 4 12 502 10000 ???? 503 10000 ???? ; 10 bits sent? (1 start bit, 8 data bits, 1 stop bit) 504 10000 ???? cpy #$09 ; 2 14 505 10000 ???? beq .speech_done ; 2 16 506 10000 ???? iny ; 2 18 507 10000 ???? 508 10000 ???? ; the 7800 is 1.5x faster than the 2600. Waste more cycles here 509 10000 ???? ; to match the original baud rate... 510 10000 ???? ;ldx #$07 ; 2600 511 10000 ???? ldx #$0D 512 10000 ???? 513 10000 ???? .delay_loop 514 10000 ???? dex ; 515 10000 ???? bne .delay_loop ; 36 54 516 10000 ???? 517 10000 ???? ; shift next data bit into carry 518 10000 ???? lsr {1} ; 5 59 519 10000 ???? 520 10000 ???? ; and loop (branch always taken) 521 10000 ???? bpl .byteout_loop ; 3 62 cycles for loop 522 10000 ???? 523 10000 ???? .speech_done 524 10000 ???? 525 10000 ???? endm 526 10000 ???? 527 10000 ???? 528 10000 ???? mac speak 529 10000 ???? 530 10000 ???? lda #<{1} 531 10000 ???? sta speech_addr 532 10000 ???? lda #>{1} 533 10000 ???? sta speech_addr+1 534 10000 ???? 535 10000 ???? endm 536 10000 ???? 537 10000 ???? 538 10000 ???? 539 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 540 10000 ???? 541 10000 ???? processor 6502 542 10000 ???? ------- FILE 7800basic.h LEVEL 2 PASS 3 0 10000 ???? include "7800basic.h" 1 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 10000 ???? 3 10000 ???? processor 6502 ------- FILE 7800.h LEVEL 3 PASS 3 0 10000 ???? include "7800.h" 1 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 10000 ???? 3 10000 ???? ; 7800.h 4 10000 ???? ; Version 1.0, 2019/12/13 5 10000 ???? 6 10000 ???? ; This file defines hardware registers and memory mapping for the 7 10000 ???? ; Atari 7800. It is distributed as a companion machine-specific support package 8 10000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are 9 10000 ???? ; available at https://github.com/dasm-assembler/dasm 10 10000 ???? 11 10000 ???? 12 10000 ???? ; ******************** 7800 Hardware Adresses *************************** 13 10000 ???? ; 14 10000 ???? ; MEMORY MAP USAGE OF THE 7800 15 10000 ???? ; 16 10000 ???? ; 00 - 1F TIA REGISTERS 17 10000 ???? ; 20 - 3F MARIA REGISTERS 18 10000 ???? ; 40 - FF RAM block 0 (zero page) 19 10000 ???? ; 100 - 11F TIA (mirror of 0000-001f) 20 10000 ???? ; 120 - 13F MARIA (mirror of 0020-003f) 21 10000 ???? ; 140 - 1FF RAM block 1 (stack) 22 10000 ???? ; 200 - 21F TIA (mirror of 0000-001f) 23 10000 ???? ; 220 - 23F MARIA (mirror of 0020-003f) 24 10000 ???? ; 240 - 27F ??? 25 10000 ???? ; 280 - 2FF RIOT I/O ports and timers 26 10000 ???? ; 300 - 31F TIA (mirror of 0000-001f) 27 10000 ???? ; 320 - 33F MARIA (mirror of 0020-003f) 28 10000 ???? ; 340 - 3FF ??? 29 10000 ???? ; 400 - 47F unused address space 30 10000 ???? ; 480 - 4FF RIOT RAM 31 10000 ???? ; 500 - 57F unused address space 32 10000 ???? ; 580 - 5FF RIOT RAM (mirror of 0480-04ff) 33 10000 ???? ; 600 - 17FF unused address space 34 10000 ???? ; 1800 - 203F RAM 35 10000 ???? ; 2040 - 20FF RAM block 0 (mirror of 0000-001f) 36 10000 ???? ; 2100 - 213F RAM 37 10000 ???? ; 2140 - 21FF RAM block 1 (mirror of 0140-01ff) 38 10000 ???? ; 2200 - 27FF RAM 39 10000 ???? ; 2800 - 2FFF mirror of 1800-27ff 40 10000 ???? ; 3000 - 3FFF unused address space 41 10000 ???? ; 4000 - FF7F potential cartridge address space 42 10000 ???? ; FF80 - FFF9 RESERVED FOR ENCRYPTION 43 10000 ???? ; FFFA - FFFF 6502 VECTORS 44 10000 ???? 45 10000 ???? 46 10000 ???? ;****** 00-1F ********* TIA REGISTERS ****************** 47 10000 ???? 48 10000 ???? 00 01 INPTCTRL = $01 ;Input control. In same address space as TIA. write-only 49 10000 ???? 00 01 VBLANK = $01 ;VBLANK. D7=1:dump paddle caps to ground. write-only 50 10000 ???? 00 08 INPT0 = $08 ;Paddle Control Input 0 read-only 51 10000 ???? 00 09 INPT1 = $09 ;Paddle Control Input 1 read-only 52 10000 ???? 00 0a INPT2 = $0A ;Paddle Control Input 2 read-only 53 10000 ???? 00 0b INPT3 = $0B ;Paddle Control Input 3 read-only 54 10000 ???? 55 10000 ???? ; ** some common alternate names for INPT0/1/2/3 56 10000 ???? 00 08 INPT4B = $08 ;Joystick 0 Fire 1 read-only 57 10000 ???? 00 09 INPT4A = $09 ;Joystick 0 Fire 1 read-only 58 10000 ???? 00 0a INPT5B = $0A ;Joystick 1 Fire 0 read-only 59 10000 ???? 00 0b INPT5A = $0B ;Joystick 1 Fire 1 read-only 60 10000 ???? 00 08 INPT4R = $08 ;Joystick 0 Fire 1 read-only 61 10000 ???? 00 09 INPT4L = $09 ;Joystick 0 Fire 1 read-only 62 10000 ???? 00 0a INPT5R = $0A ;Joystick 1 Fire 0 read-only 63 10000 ???? 00 0b INPT5L = $0B ;Joystick 1 Fire 1 read-only 64 10000 ???? 65 10000 ???? 00 0c INPT4 = $0C ;Player 0 Fire Button Input read-only 66 10000 ???? 00 0d INPT5 = $0D ;Player 1 Fire Button Input read-only 67 10000 ???? 68 10000 ???? 00 15 AUDC0 = $15 ;Audio Control Channel 0 write-only 69 10000 ???? 00 16 AUDC1 = $16 ;Audio Control Channel 1 write-only 70 10000 ???? 00 17 AUDF0 = $17 ;Audio Frequency Channel 0 write-only 71 10000 ???? 00 18 AUDF1 = $18 ;Audio Frequency Channel 1 write-only 72 10000 ???? 00 19 AUDV0 = $19 ;Audio Volume Channel 0 write-only 73 10000 ???? 00 1a AUDV1 = $1A ;Audio Volume Channel 1 write-only 74 10000 ???? 75 10000 ???? ;****** 20-3F ********* MARIA REGISTERS *************** 76 10000 ???? 77 10000 ???? 00 20 BACKGRND = $20 ;Background Color write-only 78 10000 ???? 00 21 P0C1 = $21 ;Palette 0 - Color 1 write-only 79 10000 ???? 00 22 P0C2 = $22 ;Palette 0 - Color 2 write-only 80 10000 ???? 00 23 P0C3 = $23 ;Palette 0 - Color 3 write-only 81 10000 ???? 00 24 WSYNC = $24 ;Wait For Sync write-only 82 10000 ???? 00 25 P1C1 = $25 ;Palette 1 - Color 1 write-only 83 10000 ???? 00 26 P1C2 = $26 ;Palette 1 - Color 2 write-only 84 10000 ???? 00 27 P1C3 = $27 ;Palette 1 - Color 3 write-only 85 10000 ???? 00 28 MSTAT = $28 ;Maria Status read-only 86 10000 ???? 00 29 P2C1 = $29 ;Palette 2 - Color 1 write-only 87 10000 ???? 00 2a P2C2 = $2A ;Palette 2 - Color 2 write-only 88 10000 ???? 00 2b P2C3 = $2B ;Palette 2 - Color 3 write-only 89 10000 ???? 00 2c DPPH = $2C ;Display List List Pointer High write-only 90 10000 ???? 00 2d P3C1 = $2D ;Palette 3 - Color 1 write-only 91 10000 ???? 00 2e P3C2 = $2E ;Palette 3 - Color 2 write-only 92 10000 ???? 00 2f P3C3 = $2F ;Palette 3 - Color 3 write-only 93 10000 ???? 00 30 DPPL = $30 ;Display List List Pointer Low write-only 94 10000 ???? 00 31 P4C1 = $31 ;Palette 4 - Color 1 write-only 95 10000 ???? 00 32 P4C2 = $32 ;Palette 4 - Color 2 write-only 96 10000 ???? 00 33 P4C3 = $33 ;Palette 4 - Color 3 write-only 97 10000 ???? 00 34 CHARBASE = $34 ;Character Base Address write-only 98 10000 ???? 00 34 CHBASE = $34 ;Character Base Address write-only 99 10000 ???? 00 35 P5C1 = $35 ;Palette 5 - Color 1 write-only 100 10000 ???? 00 36 P5C2 = $36 ;Palette 5 - Color 2 write-only 101 10000 ???? 00 37 P5C3 = $37 ;Palette 5 - Color 3 write-only 102 10000 ???? 00 38 OFFSET = $38 ;Unused - Store zero here write-only 103 10000 ???? 00 39 P6C1 = $39 ;Palette 6 - Color 1 write-only 104 10000 ???? 00 3a P6C2 = $3A ;Palette 6 - Color 2 write-only 105 10000 ???? 00 3b P6C3 = $3B ;Palette 6 - Color 3 write-only 106 10000 ???? 00 3c CTRL = $3C ;Maria Control Register write-only 107 10000 ???? 00 3d P7C1 = $3D ;Palette 7 - Color 1 write-only 108 10000 ???? 00 3e P7C2 = $3E ;Palette 7 - Color 2 write-only 109 10000 ???? 00 3f P7C3 = $3F ;Palette 7 - Color 3 write-only 110 10000 ???? 111 10000 ???? 112 10000 ???? ;****** 280-2FF ******* PIA PORTS AND TIMERS ************ 113 10000 ???? 114 10000 ???? 02 80 SWCHA = $280 ;P0+P1 Joystick Directional Input read-write 115 10000 ???? 02 81 CTLSWA = $281 ;I/O Control for SCHWA read-write 116 10000 ???? 02 81 SWACNT = $281 ;VCS name for above read-write 117 10000 ???? 02 82 SWCHB = $282 ;Console Switches read-write 118 10000 ???? 02 83 CTLSWB = $283 ;I/O Control for SCHWB read-write 119 10000 ???? 02 83 SWBCNT = $283 ;VCS name for above read-write 120 10000 ???? 121 10000 ???? 02 84 INTIM = $284 ;Interval Timer Read read-only 122 10000 ???? 02 94 TIM1T = $294 ;Set 1 CLK Interval (838 nsec/interval) write-only 123 10000 ???? 02 95 TIMINT = $295 ;Interval Timer Interrupt read-only 124 10000 ???? 02 95 TIM8T = $295 ;Set 8 CLK Interval (6.7 usec/interval) write-only 125 10000 ???? 02 96 TIM64T = $296 ;Set 64 CLK Interval (63.6 usec/interval) write-only 126 10000 ???? 02 97 T1024T = $297 ;Set 1024 CLK Interval (858.2 usec/interval) write-only 127 10000 ???? 02 9e TIM64TI = $29E ;Interrupt timer 64T write-only 128 10000 ???? 129 10000 ???? ;XM 130 10000 ???? 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 10000 ???? 04 70 XCTRL1 = $470 132 10000 ???? 04 78 XCTRL2 = $478 133 10000 ???? 04 7c XCTRL3 = $47c 134 10000 ???? 04 71 XCTRL4 = $471 135 10000 ???? 04 72 XCTRL5 = $472 136 10000 ???? 137 10000 ???? ; Pokey register relative locations, since its base may be different 138 10000 ???? ; depending on the hardware. 139 10000 ???? 00 00 PAUDF0 = $0 ; extra audio channels and frequencies 140 10000 ???? 00 01 PAUDC0 = $1 141 10000 ???? 00 02 PAUDF1 = $2 142 10000 ???? 00 03 PAUDC1 = $3 143 10000 ???? 00 04 PAUDF2 = $4 144 10000 ???? 00 05 PAUDC2 = $5 145 10000 ???? 00 06 PAUDF3 = $6 146 10000 ???? 00 07 PAUDC3 = $7 147 10000 ???? 00 08 PAUDCTL = $8 ; Audio Control 148 10000 ???? 00 09 PSTIMER = $9 149 10000 ???? 00 0a PRANDOM = $A ; 17 bit polycounter pseudo random 150 10000 ???? 00 0f PSKCTL = $F ; Serial Port control ------- FILE 7800basic.h ------- FILE 7800basic_variable_redefs.h LEVEL 3 PASS 3 0 10000 ???? include "7800basic_variable_redefs.h" 1 10000 ???? ; This file contains variable mapping and other information for the current project. 2 10000 ???? 3 10000 ???? 00 00 vertical_shooting_laser_tallsprite_01_mode = $00 4 10000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width_twoscompliment = $00 5 10000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width = $00 6 10000 ???? 00 00 vertical_shooting_laser_tallsprite_00_mode = $00 7 10000 ???? 00 1f vertical_shooting_laser_tallsprite_00_width_twoscompliment = $1f 8 10000 ???? 00 01 vertical_shooting_laser_tallsprite_00_width = $01 9 10000 ???? 00 00 vertical_shooting_laser_mode = $00 10 10000 ???? 00 1f vertical_shooting_laser_width_twoscompliment = $1f 11 10000 ???? 00 01 vertical_shooting_laser_width = $01 12 10000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_mode = $00 13 10000 ???? 00 0c vertical_shooting_explosion_10_tallsprite_00_width_twoscompliment = $0c 14 10000 ???? 00 14 vertical_shooting_explosion_10_tallsprite_00_width = $14 15 10000 ???? 00 00 vertical_shooting_explosion_10_mode = $00 16 10000 ???? 00 0c vertical_shooting_explosion_10_width_twoscompliment = $0c 17 10000 ???? 00 14 vertical_shooting_explosion_10_width = $14 18 10000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_mode = $00 19 10000 ???? 00 0c vertical_shooting_explosion_09_tallsprite_00_width_twoscompliment = $0c 20 10000 ???? 00 14 vertical_shooting_explosion_09_tallsprite_00_width = $14 21 10000 ???? 00 00 vertical_shooting_explosion_09_mode = $00 22 10000 ???? 00 0c vertical_shooting_explosion_09_width_twoscompliment = $0c 23 10000 ???? 00 14 vertical_shooting_explosion_09_width = $14 24 10000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_mode = $00 25 10000 ???? 00 0c vertical_shooting_explosion_08_tallsprite_00_width_twoscompliment = $0c 26 10000 ???? 00 14 vertical_shooting_explosion_08_tallsprite_00_width = $14 27 10000 ???? 00 00 vertical_shooting_explosion_08_mode = $00 28 10000 ???? 00 0c vertical_shooting_explosion_08_width_twoscompliment = $0c 29 10000 ???? 00 14 vertical_shooting_explosion_08_width = $14 30 10000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_mode = $00 31 10000 ???? 00 0c vertical_shooting_explosion_07_tallsprite_00_width_twoscompliment = $0c 32 10000 ???? 00 14 vertical_shooting_explosion_07_tallsprite_00_width = $14 33 10000 ???? 00 00 vertical_shooting_explosion_07_mode = $00 34 10000 ???? 00 0c vertical_shooting_explosion_07_width_twoscompliment = $0c 35 10000 ???? 00 14 vertical_shooting_explosion_07_width = $14 36 10000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_mode = $00 37 10000 ???? 00 1e vertical_shooting_explosion_06_tallsprite_00_width_twoscompliment = $1e 38 10000 ???? 00 02 vertical_shooting_explosion_06_tallsprite_00_width = $02 39 10000 ???? 00 00 vertical_shooting_explosion_06_mode = $00 40 10000 ???? 00 1e vertical_shooting_explosion_06_width_twoscompliment = $1e 41 10000 ???? 00 02 vertical_shooting_explosion_06_width = $02 42 10000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_mode = $00 43 10000 ???? 00 1e vertical_shooting_explosion_05_tallsprite_00_width_twoscompliment = $1e 44 10000 ???? 00 02 vertical_shooting_explosion_05_tallsprite_00_width = $02 45 10000 ???? 00 00 vertical_shooting_explosion_05_mode = $00 46 10000 ???? 00 1e vertical_shooting_explosion_05_width_twoscompliment = $1e 47 10000 ???? 00 02 vertical_shooting_explosion_05_width = $02 48 10000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_mode = $00 49 10000 ???? 00 1e vertical_shooting_explosion_04_tallsprite_00_width_twoscompliment = $1e 50 10000 ???? 00 02 vertical_shooting_explosion_04_tallsprite_00_width = $02 51 10000 ???? 00 00 vertical_shooting_explosion_04_mode = $00 52 10000 ???? 00 1e vertical_shooting_explosion_04_width_twoscompliment = $1e 53 10000 ???? 00 02 vertical_shooting_explosion_04_width = $02 54 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_mode = $00 55 10000 ???? 00 1e vertical_shooting_explosion_03_tallsprite_00_width_twoscompliment = $1e 56 10000 ???? 00 02 vertical_shooting_explosion_03_tallsprite_00_width = $02 57 10000 ???? 00 00 vertical_shooting_explosion_03_mode = $00 58 10000 ???? 00 1e vertical_shooting_explosion_03_width_twoscompliment = $1e 59 10000 ???? 00 02 vertical_shooting_explosion_03_width = $02 60 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_mode = $00 61 10000 ???? 00 1e vertical_shooting_explosion_02_tallsprite_00_width_twoscompliment = $1e 62 10000 ???? 00 02 vertical_shooting_explosion_02_tallsprite_00_width = $02 63 10000 ???? 00 00 vertical_shooting_explosion_02_mode = $00 64 10000 ???? 00 1e vertical_shooting_explosion_02_width_twoscompliment = $1e 65 10000 ???? 00 02 vertical_shooting_explosion_02_width = $02 66 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_mode = $00 67 10000 ???? 00 1e vertical_shooting_explosion_01_tallsprite_00_width_twoscompliment = $1e 68 10000 ???? 00 02 vertical_shooting_explosion_01_tallsprite_00_width = $02 69 10000 ???? 00 00 vertical_shooting_explosion_01_mode = $00 70 10000 ???? 00 1e vertical_shooting_explosion_01_width_twoscompliment = $1e 71 10000 ???? 00 02 vertical_shooting_explosion_01_width = $02 72 10000 ???? 00 00 vertical_shooting_1up_mode = $00 73 10000 ???? 00 1e vertical_shooting_1up_width_twoscompliment = $1e 74 10000 ???? 00 02 vertical_shooting_1up_width = $02 75 10000 ???? 00 00 vertical_shooting_score_10_digits_mode = $00 76 10000 ???? 00 16 vertical_shooting_score_10_digits_width_twoscompliment = $16 77 10000 ???? 00 0a vertical_shooting_score_10_digits_width = $0a 78 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_mode = $00 79 10000 ???? 00 1e vertical_shooting_enemy01_tallsprite_00_width_twoscompliment = $1e 80 10000 ???? 00 02 vertical_shooting_enemy01_tallsprite_00_width = $02 81 10000 ???? 00 00 vertical_shooting_enemy01_mode = $00 82 10000 ???? 00 1e vertical_shooting_enemy01_width_twoscompliment = $1e 83 10000 ???? 00 02 vertical_shooting_enemy01_width = $02 84 10000 ???? 00 00 vertical_shooting_powerup_mode = $00 85 10000 ???? 00 1e vertical_shooting_powerup_width_twoscompliment = $1e 86 10000 ???? 00 02 vertical_shooting_powerup_width = $02 87 10000 ???? 00 00 vertical_shooting_enemyshot_mode = $00 88 10000 ???? 00 1f vertical_shooting_enemyshot_width_twoscompliment = $1f 89 10000 ???? 00 01 vertical_shooting_enemyshot_width = $01 90 10000 ???? 00 00 vertical_shooting_bullet_mode = $00 91 10000 ???? 00 1f vertical_shooting_bullet_width_twoscompliment = $1f 92 10000 ???? 00 01 vertical_shooting_bullet_width = $01 93 10000 ???? 00 00 vertical_shooting_ship_tallsprite_00_mode = $00 94 10000 ???? 00 1e vertical_shooting_ship_tallsprite_00_width_twoscompliment = $1e 95 10000 ???? 00 02 vertical_shooting_ship_tallsprite_00_width = $02 96 10000 ???? 00 00 vertical_shooting_ship_mode = $00 97 10000 ???? 00 1e vertical_shooting_ship_width_twoscompliment = $1e 98 10000 ???? 00 02 vertical_shooting_ship_width = $02 99 10000 ???? 00 00 vertical_shooting_font_mode = $00 100 10000 ???? 00 13 vertical_shooting_font_width_twoscompliment = $13 101 10000 ???? 00 2d vertical_shooting_font_width = $2d 102 10000 ???? 00 00 atascii_mode = $00 103 10000 ???? 00 0a atascii_width_twoscompliment = $0a 104 10000 ???? 00 f6 atascii_width = $f6 105 10000 ???? 00 90 sfx_explosion_length = .skipL0240-sfx_explosion 106 10000 ???? 107 10000 ???? 00 30 sfx_plainlaser_length = .skipL0239-sfx_plainlaser 108 10000 ???? 109 10000 ???? 00 54 sfx_pulsecannon_length = .skipL0238-sfx_pulsecannon 110 10000 ???? 111 10000 ???? 00 36 sfx_bling_length = .skipL0237-sfx_bling 112 10000 ???? 113 10000 ???? 00 04 vertical_shooting_laser_tallsprite_00_color3 = $04 114 10000 ???? 00 42 vertical_shooting_laser_tallsprite_00_color2 = $42 115 10000 ???? 00 0f vertical_shooting_laser_tallsprite_00_color1 = $0f 116 10000 ???? 00 00 vertical_shooting_laser_tallsprite_00_color0 = $00 117 10000 ???? 00 04 vertical_shooting_laser_color3 = $04 118 10000 ???? 00 42 vertical_shooting_laser_color2 = $42 119 10000 ???? 00 0f vertical_shooting_laser_color1 = $0f 120 10000 ???? 00 00 vertical_shooting_laser_color0 = $00 121 10000 ???? 00 33 vertical_shooting_explosion_10_tallsprite_00_color3 = $33 122 10000 ???? 00 2b vertical_shooting_explosion_10_tallsprite_00_color2 = $2b 123 10000 ???? 00 36 vertical_shooting_explosion_10_tallsprite_00_color1 = $36 124 10000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_color0 = $00 125 10000 ???? 00 33 vertical_shooting_explosion_10_color3 = $33 126 10000 ???? 00 2b vertical_shooting_explosion_10_color2 = $2b 127 10000 ???? 00 36 vertical_shooting_explosion_10_color1 = $36 128 10000 ???? 00 00 vertical_shooting_explosion_10_color0 = $00 129 10000 ???? 00 33 vertical_shooting_explosion_09_tallsprite_00_color3 = $33 130 10000 ???? 00 2b vertical_shooting_explosion_09_tallsprite_00_color2 = $2b 131 10000 ???? 00 36 vertical_shooting_explosion_09_tallsprite_00_color1 = $36 132 10000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_color0 = $00 133 10000 ???? 00 33 vertical_shooting_explosion_09_color3 = $33 134 10000 ???? 00 2b vertical_shooting_explosion_09_color2 = $2b 135 10000 ???? 00 36 vertical_shooting_explosion_09_color1 = $36 136 10000 ???? 00 00 vertical_shooting_explosion_09_color0 = $00 137 10000 ???? 00 33 vertical_shooting_explosion_08_tallsprite_00_color3 = $33 138 10000 ???? 00 2b vertical_shooting_explosion_08_tallsprite_00_color2 = $2b 139 10000 ???? 00 36 vertical_shooting_explosion_08_tallsprite_00_color1 = $36 140 10000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_color0 = $00 141 10000 ???? 00 33 vertical_shooting_explosion_08_color3 = $33 142 10000 ???? 00 2b vertical_shooting_explosion_08_color2 = $2b 143 10000 ???? 00 36 vertical_shooting_explosion_08_color1 = $36 144 10000 ???? 00 00 vertical_shooting_explosion_08_color0 = $00 145 10000 ???? 00 33 vertical_shooting_explosion_07_tallsprite_00_color3 = $33 146 10000 ???? 00 2b vertical_shooting_explosion_07_tallsprite_00_color2 = $2b 147 10000 ???? 00 36 vertical_shooting_explosion_07_tallsprite_00_color1 = $36 148 10000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_color0 = $00 149 10000 ???? 00 33 vertical_shooting_explosion_07_color3 = $33 150 10000 ???? 00 2b vertical_shooting_explosion_07_color2 = $2b 151 10000 ???? 00 36 vertical_shooting_explosion_07_color1 = $36 152 10000 ???? 00 00 vertical_shooting_explosion_07_color0 = $00 153 10000 ???? 00 33 vertical_shooting_explosion_06_tallsprite_00_color3 = $33 154 10000 ???? 00 2b vertical_shooting_explosion_06_tallsprite_00_color2 = $2b 155 10000 ???? 00 36 vertical_shooting_explosion_06_tallsprite_00_color1 = $36 156 10000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_color0 = $00 157 10000 ???? 00 33 vertical_shooting_explosion_06_color3 = $33 158 10000 ???? 00 2b vertical_shooting_explosion_06_color2 = $2b 159 10000 ???? 00 36 vertical_shooting_explosion_06_color1 = $36 160 10000 ???? 00 00 vertical_shooting_explosion_06_color0 = $00 161 10000 ???? 00 33 vertical_shooting_explosion_05_tallsprite_00_color3 = $33 162 10000 ???? 00 2b vertical_shooting_explosion_05_tallsprite_00_color2 = $2b 163 10000 ???? 00 36 vertical_shooting_explosion_05_tallsprite_00_color1 = $36 164 10000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_color0 = $00 165 10000 ???? 00 33 vertical_shooting_explosion_05_color3 = $33 166 10000 ???? 00 2b vertical_shooting_explosion_05_color2 = $2b 167 10000 ???? 00 36 vertical_shooting_explosion_05_color1 = $36 168 10000 ???? 00 00 vertical_shooting_explosion_05_color0 = $00 169 10000 ???? 00 33 vertical_shooting_explosion_04_tallsprite_00_color3 = $33 170 10000 ???? 00 36 vertical_shooting_explosion_04_tallsprite_00_color2 = $36 171 10000 ???? 00 2b vertical_shooting_explosion_04_tallsprite_00_color1 = $2b 172 10000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_color0 = $00 173 10000 ???? 00 33 vertical_shooting_explosion_04_color3 = $33 174 10000 ???? 00 36 vertical_shooting_explosion_04_color2 = $36 175 10000 ???? 00 2b vertical_shooting_explosion_04_color1 = $2b 176 10000 ???? 00 00 vertical_shooting_explosion_04_color0 = $00 177 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color3 = 0 178 10000 ???? 00 36 vertical_shooting_explosion_03_tallsprite_00_color2 = $36 179 10000 ???? 00 2b vertical_shooting_explosion_03_tallsprite_00_color1 = $2b 180 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color0 = $00 181 10000 ???? 00 00 vertical_shooting_explosion_03_color3 = 0 182 10000 ???? 00 36 vertical_shooting_explosion_03_color2 = $36 183 10000 ???? 00 2b vertical_shooting_explosion_03_color1 = $2b 184 10000 ???? 00 00 vertical_shooting_explosion_03_color0 = $00 185 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color3 = 0 186 10000 ???? 00 36 vertical_shooting_explosion_02_tallsprite_00_color2 = $36 187 10000 ???? 00 2b vertical_shooting_explosion_02_tallsprite_00_color1 = $2b 188 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color0 = $00 189 10000 ???? 00 00 vertical_shooting_explosion_02_color3 = 0 190 10000 ???? 00 36 vertical_shooting_explosion_02_color2 = $36 191 10000 ???? 00 2b vertical_shooting_explosion_02_color1 = $2b 192 10000 ???? 00 00 vertical_shooting_explosion_02_color0 = $00 193 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color3 = 0 194 10000 ???? 00 2b vertical_shooting_explosion_01_tallsprite_00_color2 = $2b 195 10000 ???? 00 36 vertical_shooting_explosion_01_tallsprite_00_color1 = $36 196 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color0 = $00 197 10000 ???? 00 00 vertical_shooting_explosion_01_color3 = 0 198 10000 ???? 00 2b vertical_shooting_explosion_01_color2 = $2b 199 10000 ???? 00 36 vertical_shooting_explosion_01_color1 = $36 200 10000 ???? 00 00 vertical_shooting_explosion_01_color0 = $00 201 10000 ???? 00 0f vertical_shooting_1up_color3 = $0f 202 10000 ???? 00 42 vertical_shooting_1up_color2 = $42 203 10000 ???? 00 04 vertical_shooting_1up_color1 = $04 204 10000 ???? 00 00 vertical_shooting_1up_color0 = $00 205 10000 ???? 00 33 vertical_shooting_score_10_digits_color3 = $33 206 10000 ???? 00 2b vertical_shooting_score_10_digits_color2 = $2b 207 10000 ???? 00 36 vertical_shooting_score_10_digits_color1 = $36 208 10000 ???? 00 00 vertical_shooting_score_10_digits_color0 = $00 209 10000 ???? 00 83 vertical_shooting_enemy01_tallsprite_00_color3 = $83 210 10000 ???? 00 a8 vertical_shooting_enemy01_tallsprite_00_color2 = $a8 211 10000 ???? 00 bc vertical_shooting_enemy01_tallsprite_00_color1 = $bc 212 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_color0 = $00 213 10000 ???? 00 83 vertical_shooting_enemy01_color3 = $83 214 10000 ???? 00 a8 vertical_shooting_enemy01_color2 = $a8 215 10000 ???? 00 bc vertical_shooting_enemy01_color1 = $bc 216 10000 ???? 00 00 vertical_shooting_enemy01_color0 = $00 217 10000 ???? 00 36 vertical_shooting_powerup_color3 = $36 218 10000 ???? 00 33 vertical_shooting_powerup_color2 = $33 219 10000 ???? 00 2b vertical_shooting_powerup_color1 = $2b 220 10000 ???? 00 00 vertical_shooting_powerup_color0 = $00 221 10000 ???? 00 bc vertical_shooting_enemyshot_color3 = $bc 222 10000 ???? 00 83 vertical_shooting_enemyshot_color2 = $83 223 10000 ???? 00 a8 vertical_shooting_enemyshot_color1 = $a8 224 10000 ???? 00 00 vertical_shooting_enemyshot_color0 = $00 225 10000 ???? 00 1d vertical_shooting_bullet_color3 = $1d 226 10000 ???? 00 18 vertical_shooting_bullet_color2 = $18 227 10000 ???? 00 0f vertical_shooting_bullet_color1 = $0f 228 10000 ???? 00 00 vertical_shooting_bullet_color0 = $00 229 10000 ???? 00 42 vertical_shooting_ship_tallsprite_00_color3 = $42 230 10000 ???? 00 04 vertical_shooting_ship_tallsprite_00_color2 = $04 231 10000 ???? 00 0f vertical_shooting_ship_tallsprite_00_color1 = $0f 232 10000 ???? 00 00 vertical_shooting_ship_tallsprite_00_color0 = $00 233 10000 ???? 00 42 vertical_shooting_ship_color3 = $42 234 10000 ???? 00 04 vertical_shooting_ship_color2 = $04 235 10000 ???? 00 0f vertical_shooting_ship_color1 = $0f 236 10000 ???? 00 00 vertical_shooting_ship_color0 = $00 237 10000 ???? 00 0f vertical_shooting_font_color1 = $0f 238 10000 ???? 00 00 vertical_shooting_font_color0 = $00 239 10000 ???? 00 00 atascii_color1 = $00 240 10000 ???? 00 0f atascii_color0 = $0f 241 10000 ???? 01 68 twinlaser_Slowdown = var40 242 10000 ???? 243 10000 ???? 01 67 twinlaser_flag = var39 244 10000 ???? 245 10000 ???? 01 66 twinlaserY = var38 246 10000 ???? 247 10000 ???? 01 65 twinlaserX = var37 248 10000 ???? 249 10000 ???? 01 64 lives = var36 250 10000 ???? 251 10000 ???? 01 63 explosion_aniframe = var35 252 10000 ???? 253 10000 ???? 01 62 extra_shipFlag = var34 254 10000 ???? 255 10000 ???? 01 61 extra_shipY = var33 256 10000 ???? 257 10000 ???? 01 60 extra_shipX = var32 258 10000 ???? 259 10000 ???? 01 5f gameover_flag = var31 260 10000 ???? 261 10000 ???? 01 5e enemy01_speed = var30 262 10000 ???? 263 10000 ???? 01 5d rMovement6 = var29 264 10000 ???? 265 10000 ???? 01 5c rMovement5 = var28 266 10000 ???? 267 10000 ???? 01 5b rMovement4 = var27 268 10000 ???? 269 10000 ???? 01 5a rMovement3 = var26 270 10000 ???? 271 10000 ???? 01 59 enemy01_Flag = var25 272 10000 ???? 273 10000 ???? 01 58 enemy01_Y = var24 274 10000 ???? 275 10000 ???? 01 57 enemy01_X = var23 276 10000 ???? 277 10000 ???? 01 56 enemy_shotSlowdown = var22 278 10000 ???? 279 10000 ???? 01 55 bulletSlowdown = var21 280 10000 ???? 281 10000 ???? 01 54 power_upSlowdown = var20 282 10000 ???? 283 10000 ???? 01 53 rMovement2 = var19 284 10000 ???? 285 10000 ???? 01 52 power_upFlag = var18 286 10000 ???? 287 10000 ???? 01 51 power_upY = var17 288 10000 ???? 289 10000 ???? 01 50 power_upX = var16 290 10000 ???? 291 10000 ???? 01 4f rDirection = var15 292 10000 ???? 293 10000 ???? 01 4e rMovement1 = var14 294 10000 ???? 295 10000 ???? 01 4d playerFlag = var13 296 10000 ???? 297 10000 ???? 01 4c enemy_shotFlag = var12 298 10000 ???? 299 10000 ???? 01 4b enemy_shotY = var11 300 10000 ???? 301 10000 ???? 01 4a enemy_shotX = var10 302 10000 ???? 303 10000 ???? 01 49 bulletY = var9 304 10000 ???? 305 10000 ???? 01 48 bulletX = var8 306 10000 ???? 307 10000 ???? 01 47 joyposright = var7 308 10000 ???? 309 10000 ???? 01 46 joyposleft = var6 310 10000 ???? 311 10000 ???? 01 45 joyposdown = var5 312 10000 ???? 313 10000 ???? 01 44 joyposup = var4 314 10000 ???? 315 10000 ???? 01 43 fire_debounce = var3 316 10000 ???? 317 10000 ???? 01 42 playerY = var2 318 10000 ???? 319 10000 ???? 01 41 playerX = var1 320 10000 ???? 321 10000 ???? 01 40 frameCounter = var0 322 10000 ???? 323 10000 ???? 00 01 DOUBLEWIDE = 1 324 10000 ???? 00 01 collisionwrap = 1 325 10000 ???? 00 01 NTSC = 1 326 10000 ???? 00 c0 SCREENHEIGHT = 192 327 10000 ???? 00 01 CHECKOVERWRITE = 1 328 10000 ???? 00 08 ZONEHEIGHT = 8 329 10000 ???? 00 01 ROM16K = 1 ------- FILE 7800basic.h 6 10000 ???? 7 10000 ???? ;************ 7800 overall RAM map ************** 8 10000 ???? 9 10000 ???? ; 40-FF zero page RAM 10 10000 ???? ; 140-1FF RAM (stack) 11 10000 ???? ; 1800-203F RAM 12 10000 ???? ; 2100-213F RAM 13 10000 ???? ; 2200-27FF RAM 14 10000 ???? 15 10000 ???? ;************ 7800basic RAM usage map ************** 16 10000 ???? 17 10000 ???? ; 40-FF numerous defines, listed below 18 10000 ???? ; 140-1FF RAM (stack) 19 10000 ???? 20 10000 ???? ; 1800-187F DLL (1800-18DF with page flipping enabled) 21 10000 ???? ; 1880-1FFF DLs (18E0-1FFF with page flipping enabled) 22 10000 ???? 23 10000 ???? ; 2000-203F Reserved 24 10000 ???? ; 2100-213F Reserved 25 10000 ???? ; 2200-27FF Free 26 10000 ???? 27 10000 ???? 1f e0 eeprombuffer = $1FE0 28 10000 ???? 18 00 DLLMEM = $1800 29 10000 ???? 00 70 DBOFFSET = $70 ; $E0 length DL is /2 for double-buffering 30 10000 ???? 31 10000 ???? - ifconst PLOTVALUEPAGE 32 10000 ???? -VALBUFFER = (PLOTVALUEPAGE*256) 33 10000 ???? else 34 10000 ???? 20 00 VALBUFFER = $2000 ; to $203F ** never let VALBUFFER straddle pages 35 10000 ???? endif 36 10000 ???? 37 10000 ???? 38 10000 ???? 21 00 pausestate = $2100 39 10000 ???? 21 01 dlzero = $2101 ; zero to force end of $2100 DL, which we use in vblank and overscan 40 10000 ???? 21 02 sINPT1 = $2102 ; save register for joy button joy0 41 10000 ???? 21 03 sINPT3 = $2103 ; save register for joy button joy1 42 10000 ???? 21 04 currentbank = $2104 43 10000 ???? 44 10000 ???? 21 05 currentrambank = $2105 45 10000 ???? 21 06 charactermode = $2106 46 10000 ???? 21 07 sCTRL = $2107 47 10000 ???? 21 08 pokeydetected = $2108 48 10000 ???? 21 09 paldetected = $2109 49 10000 ???? 21 0a avoxdetected = $210A 50 10000 ???? 21 0b sCHARBASE = $210B ; save register for CHARBASE 51 10000 ???? 52 10000 ???? 21 0c hsdevice = $210C 53 10000 ???? 21 0d hsdifficulty = $210D 54 10000 ???? 21 0e hserror = $210E 55 10000 ???? 21 0f hsgameslot = $210F 56 10000 ???? 21 10 hsnewscoreline = $2110 57 10000 ???? 21 11 hsnewscorerank = $2111 58 10000 ???? 21 12 HSRAMTable = $2112 ; to $212F (30 bytes) Format: III*5, SSS*5 59 10000 ???? 21 12 HSRAMInitials = $2112 ; see above 60 10000 ???? 21 21 HSRAMScores = $2121 ; see above 61 10000 ???? 62 10000 ???? 21 31 ssCTRL = $2131 63 10000 ???? 21 32 ssCHARBASE = $2132 64 10000 ???? 21 33 hsdisplaymode = $2133 65 10000 ???? 21 34 gamedifficulty = $2134 66 10000 ???? 21 35 hsinitialpos = $2135 67 10000 ???? 21 36 hsinitialhold = $2136 68 10000 ???? 21 37 hscursorx = $2137 69 10000 ???? 21 38 hsjoydebounce = $2138 70 10000 ???? 21 39 hsswcha = $2139 71 10000 ???? 21 3a hsinpt1 = $213A 72 10000 ???? 21 3b hscolorchaseindex = $213B 73 10000 ???? 21 3c visibleDLLstart = $213C 74 10000 ???? 21 3d overscanDLLstart = $213D 75 10000 ???? 21 3e frameslost = $213E 76 10000 ???? 77 10000 ???? 78 10000 ???? 00 40 rand = $40 79 10000 ???? 00 41 rand16 = $41 80 10000 ???? 00 42 temp1 = $42 81 10000 ???? 00 43 temp2 = $43 82 10000 ???? 00 44 temp3 = $44 83 10000 ???? 00 45 temp4 = $45 84 10000 ???? 00 46 temp5 = $46 85 10000 ???? 00 47 temp6 = $47 86 10000 ???? 00 48 temp7 = $48 87 10000 ???? 00 49 temp8 = $49 88 10000 ???? 00 4a temp9 = $4a 89 10000 ???? 90 10000 ???? 00 4b pokeybase = $4b 91 10000 ???? 00 4b pokeybaselo = $4b 92 10000 ???? 00 4c pokeybasehi = $4c 93 10000 ???? 94 10000 ???? 00 4d visibleover = $4d 95 10000 ???? 96 10000 ???? 00 4e sfx1pointlo = $4e 97 10000 ???? 00 4f sfx2pointlo = $4f 98 10000 ???? 00 50 sfx1pointhi = $50 99 10000 ???? 00 51 sfx2pointhi = $51 100 10000 ???? 101 10000 ???? 00 52 sfx1priority = $52 102 10000 ???? 00 53 sfx2priority = $53 103 10000 ???? 00 54 sfx1poffset = $54 104 10000 ???? 00 55 sfx2poffset = $55 105 10000 ???? 106 10000 ???? 00 56 sfx1frames = $56 107 10000 ???? 00 57 sfx2frames = $57 108 10000 ???? 00 58 sfx1tick = $58 109 10000 ???? 00 59 sfx2tick = $59 110 10000 ???? 111 10000 ???? 00 5a tempmath = $5a 112 10000 ???? 113 10000 ???? 00 5b pokey1pointlo = $5b 114 10000 ???? 00 5c pokey1pointhi = $5c 115 10000 ???? 00 5d pokey2pointlo = $5d 116 10000 ???? 00 5e pokey2pointhi = $5e 117 10000 ???? 00 5f pokey3pointlo = $5f 118 10000 ???? 00 60 pokey3pointhi = $60 119 10000 ???? 00 61 pokey4pointlo = $61 120 10000 ???? 00 62 pokey4pointhi = $62 121 10000 ???? 122 10000 ???? 00 63 dlpnt = $63 ; to $64 123 10000 ???? 00 65 dlend = $65 ; to $81 - for 28 possible visible dll entries 124 10000 ???? 00 82 dlendsave = $82 ; to $9e - for 28 possible visible dll entries 125 10000 ???? 126 10000 ???? 00 9f speech_addr = $9f 127 10000 ???? 00 a0 speech_addr_hi = $a0 128 10000 ???? 129 10000 ???? 00 a1 HSGameTableLo = $a1 130 10000 ???? 00 a2 HSGameTableHi = $a2 131 10000 ???? 00 a3 HSVoxHi = $a3 132 10000 ???? 00 a4 HSVoxLo = $a4 133 10000 ???? 134 10000 ???? ;channel pointers 135 10000 ???? 136 10000 ???? 00 a5 songchannel1layer1lo = $a5 137 10000 ???? 00 a6 songchannel2layer1lo = $a6 138 10000 ???? 00 a7 songchannel3layer1lo = $a7 139 10000 ???? 00 a8 songchannel4layer1lo = $a8 140 10000 ???? 141 10000 ???? 00 a9 songchannel1layer2lo = $a9 142 10000 ???? 00 aa songchannel2layer2lo = $aA 143 10000 ???? 00 ab songchannel3layer2lo = $aB 144 10000 ???? 00 ac songchannel4layer2lo = $aC 145 10000 ???? 146 10000 ???? 00 ad songchannel1layer3lo = $aD 147 10000 ???? 00 ae songchannel2layer3lo = $aE 148 10000 ???? 00 af songchannel3layer3lo = $aF 149 10000 ???? 00 b0 songchannel4layer3lo = $b0 150 10000 ???? 151 10000 ???? 00 b1 songchannel1layer1hi = $b1 152 10000 ???? 00 b2 songchannel2layer1hi = $b2 153 10000 ???? 00 b3 songchannel3layer1hi = $b3 154 10000 ???? 00 b4 songchannel4layer1hi = $b4 155 10000 ???? 156 10000 ???? 00 b5 songchannel1layer2hi = $b5 157 10000 ???? 00 b6 songchannel2layer2hi = $b6 158 10000 ???? 00 b7 songchannel3layer2hi = $b7 159 10000 ???? 00 b8 songchannel4layer2hi = $b8 160 10000 ???? 161 10000 ???? 00 b9 songchannel1layer3hi = $b9 162 10000 ???? 00 ba songchannel2layer3hi = $bA 163 10000 ???? 00 bb songchannel3layer3hi = $bB 164 10000 ???? 00 bc songchannel4layer3hi = $bC 165 10000 ???? 166 10000 ???? 00 bd songdatalo = $bd 167 10000 ???? 00 be songdatahi = $be 168 10000 ???? 169 10000 ???? 00 bf inactivechannelcount = $bf 170 10000 ???? 171 10000 ???? 172 10000 ???? 00 c0 songchannel1transpose = $c0 173 10000 ???? 00 c1 songchannel2transpose = $c1 174 10000 ???? 00 c2 songchannel3transpose = $c2 175 10000 ???? 00 c3 songchannel4transpose = $c3 176 10000 ???? 177 10000 ???? 00 c4 songstackindex = $c4 178 10000 ???? 179 10000 ???? 00 c5 songchannel1instrumentlo = $c5 180 10000 ???? 00 c6 songchannel2instrumentlo = $c6 181 10000 ???? 00 c7 songchannel3instrumentlo = $c7 182 10000 ???? 00 c8 songchannel4instrumentlo = $c8 183 10000 ???? 184 10000 ???? 00 c9 songchannel1instrumenthi = $c9 185 10000 ???? 00 ca songchannel2instrumenthi = $ca 186 10000 ???? 00 cb songchannel3instrumenthi = $cb 187 10000 ???? 00 cc songchannel4instrumenthi = $cc 188 10000 ???? 189 10000 ???? 00 cd sfx1notedata = $cd 190 10000 ???? 00 ce sfx2notedata = $ce 191 10000 ???? 192 10000 ???? 00 cf songloops = $cf 193 10000 ???? 194 10000 ???? 00 d0 songpointerlo = $D0 195 10000 ???? 00 d1 songpointerhi = $D1 196 10000 ???? 197 10000 ???? 00 d2 voxlock = $D2 198 10000 ???? 00 d3 voxqueuesize = $D3 199 10000 ???? 200 10000 ???? 00 d4 vblankroutines = $D4 201 10000 ???? 202 10000 ???? 00 d5 doublebufferstate = $D5 203 10000 ???? 00 d6 doublebufferdloffset = $D6 204 10000 ???? 00 d7 doublebufferbufferdirty = $D7 205 10000 ???? 206 10000 ???? 00 d8 inttemp1 = $D8 207 10000 ???? 00 d9 inttemp2 = $D9 208 10000 ???? 00 da inttemp3 = $DA 209 10000 ???? 00 db inttemp4 = $DB 210 10000 ???? 00 dc inttemp5 = $DC 211 10000 ???? 00 dd inttemp6 = $DD 212 10000 ???? 213 10000 ???? 00 de sfxschedulelock = $DE 214 10000 ???? 00 df sfxschedulemissed = $DF 215 10000 ???? 00 e0 sfxinstrumentlo = $E0 216 10000 ???? 00 e1 sfxinstrumenthi = $E1 217 10000 ???? 00 e2 sfxpitchoffset = $E2 218 10000 ???? 00 e3 sfxnoteindex = $E3 219 10000 ???? 220 10000 ???? 00 e4 CTLSWAs = $E4 221 10000 ???? 00 e5 CTLSWBs = $E5 222 10000 ???? 223 10000 ???? 00 e6 A = $e6 224 10000 ???? 00 e6 a = $e6 225 10000 ???? 00 e7 B = $e7 226 10000 ???? 00 e7 b = $e7 227 10000 ???? 00 e8 C = $e8 228 10000 ???? 00 e8 c = $e8 229 10000 ???? 00 e9 D = $e9 230 10000 ???? 00 e9 d = $e9 231 10000 ???? 00 ea E = $ea 232 10000 ???? 00 ea e = $ea 233 10000 ???? 00 eb F = $eb 234 10000 ???? 00 eb f = $eb 235 10000 ???? 00 ec G = $ec 236 10000 ???? 00 ec g = $ec 237 10000 ???? 00 ed H = $ed 238 10000 ???? 00 ed h = $ed 239 10000 ???? 00 ee I = $ee 240 10000 ???? 00 ee i = $ee 241 10000 ???? 00 ef J = $ef 242 10000 ???? 00 ef j = $ef 243 10000 ???? 00 f0 K = $f0 244 10000 ???? 00 f0 k = $f0 245 10000 ???? 00 f1 L = $f1 246 10000 ???? 00 f1 l = $f1 247 10000 ???? 00 f2 M = $f2 248 10000 ???? 00 f2 m = $f2 249 10000 ???? 00 f3 N = $f3 250 10000 ???? 00 f3 n = $f3 251 10000 ???? 00 f4 O = $f4 252 10000 ???? 00 f4 o = $f4 253 10000 ???? 00 f5 P = $f5 254 10000 ???? 00 f5 p = $f5 255 10000 ???? 00 f6 Q = $f6 256 10000 ???? 00 f6 q = $f6 257 10000 ???? 00 f7 R = $f7 258 10000 ???? 00 f7 r = $f7 259 10000 ???? 00 f8 S = $f8 260 10000 ???? 00 f8 s = $f8 261 10000 ???? 00 f9 T = $f9 262 10000 ???? 00 f9 t = $f9 263 10000 ???? 00 fa U = $fa 264 10000 ???? 00 fa u = $fa 265 10000 ???? 00 fb V = $fb 266 10000 ???? 00 fb v = $fb 267 10000 ???? 00 fc W = $fc 268 10000 ???? 00 fc w = $fc 269 10000 ???? 00 fd X = $fd 270 10000 ???? 00 fd x = $fd 271 10000 ???? 00 fe Y = $fe 272 10000 ???? 00 fe y = $fe 273 10000 ???? 00 ff Z = $ff 274 10000 ???? 00 ff z = $ff 275 10000 ???? 276 10000 ???? ; var0-var99 variables use the top of the stack 277 10000 ???? 01 40 var0 = $140 278 10000 ???? 01 41 var1 = $141 279 10000 ???? 01 42 var2 = $142 280 10000 ???? 01 43 var3 = $143 281 10000 ???? 01 44 var4 = $144 282 10000 ???? 01 45 var5 = $145 283 10000 ???? 01 46 var6 = $146 284 10000 ???? 01 47 var7 = $147 285 10000 ???? 01 48 var8 = $148 286 10000 ???? 01 49 var9 = $149 287 10000 ???? 01 4a var10 = $14a 288 10000 ???? 01 4b var11 = $14b 289 10000 ???? 01 4c var12 = $14c 290 10000 ???? 01 4d var13 = $14d 291 10000 ???? 01 4e var14 = $14e 292 10000 ???? 01 4f var15 = $14f 293 10000 ???? 01 50 var16 = $150 294 10000 ???? 01 51 var17 = $151 295 10000 ???? 01 52 var18 = $152 296 10000 ???? 01 53 var19 = $153 297 10000 ???? 01 54 var20 = $154 298 10000 ???? 01 55 var21 = $155 299 10000 ???? 01 56 var22 = $156 300 10000 ???? 01 57 var23 = $157 301 10000 ???? 01 58 var24 = $158 302 10000 ???? 01 59 var25 = $159 303 10000 ???? 01 5a var26 = $15a 304 10000 ???? 01 5b var27 = $15b 305 10000 ???? 01 5c var28 = $15c 306 10000 ???? 01 5d var29 = $15d 307 10000 ???? 01 5e var30 = $15e 308 10000 ???? 01 5f var31 = $15f 309 10000 ???? 01 60 var32 = $160 310 10000 ???? 01 61 var33 = $161 311 10000 ???? 01 62 var34 = $162 312 10000 ???? 01 63 var35 = $163 313 10000 ???? 01 64 var36 = $164 314 10000 ???? 01 65 var37 = $165 315 10000 ???? 01 66 var38 = $166 316 10000 ???? 01 67 var39 = $167 317 10000 ???? 01 68 var40 = $168 318 10000 ???? 01 69 var41 = $169 319 10000 ???? 01 6a var42 = $16a 320 10000 ???? 01 6b var43 = $16b 321 10000 ???? 01 6c var44 = $16c 322 10000 ???? 01 6d var45 = $16d 323 10000 ???? 01 6e var46 = $16e 324 10000 ???? 01 6f var47 = $16f 325 10000 ???? 01 70 var48 = $170 326 10000 ???? 01 71 var49 = $171 327 10000 ???? 01 72 var50 = $172 328 10000 ???? 01 73 var51 = $173 329 10000 ???? 01 74 var52 = $174 330 10000 ???? 01 75 var53 = $175 331 10000 ???? 01 76 var54 = $176 332 10000 ???? 01 77 var55 = $177 333 10000 ???? 01 78 var56 = $178 334 10000 ???? 01 79 var57 = $179 335 10000 ???? 01 7a var58 = $17a 336 10000 ???? 01 7b var59 = $17b 337 10000 ???? 01 7c var60 = $17c 338 10000 ???? 01 7d var61 = $17d 339 10000 ???? 01 7e var62 = $17e 340 10000 ???? 01 7f var63 = $17f 341 10000 ???? 01 80 var64 = $180 342 10000 ???? 01 81 var65 = $181 343 10000 ???? 01 82 var66 = $182 344 10000 ???? 01 83 var67 = $183 345 10000 ???? 01 84 var68 = $184 346 10000 ???? 01 85 var69 = $185 347 10000 ???? 01 86 var70 = $186 348 10000 ???? 01 87 var71 = $187 349 10000 ???? 01 88 var72 = $188 350 10000 ???? 01 89 var73 = $189 351 10000 ???? 01 8a var74 = $18a 352 10000 ???? 01 8b var75 = $18b 353 10000 ???? 01 8c var76 = $18c 354 10000 ???? 01 8d var77 = $18d 355 10000 ???? 01 8e var78 = $18e 356 10000 ???? 01 8f var79 = $18f 357 10000 ???? 01 90 var80 = $190 358 10000 ???? 01 91 var81 = $191 359 10000 ???? 01 92 var82 = $192 360 10000 ???? 01 93 var83 = $193 361 10000 ???? 01 94 var84 = $194 362 10000 ???? 01 95 var85 = $195 363 10000 ???? 01 96 var86 = $196 364 10000 ???? 01 97 var87 = $197 365 10000 ???? 01 98 var88 = $198 366 10000 ???? 01 99 var89 = $199 367 10000 ???? 01 9a var90 = $19a 368 10000 ???? 01 9b var91 = $19b 369 10000 ???? 01 9c var92 = $19c 370 10000 ???? 01 9d var93 = $19d 371 10000 ???? 01 9e var94 = $19e 372 10000 ???? 01 9f var95 = $19f 373 10000 ???? 01 a0 var96 = $1a0 374 10000 ???? 01 a1 var97 = $1a1 375 10000 ???? 01 a2 var98 = $1a2 376 10000 ???? 01 a3 var99 = $1a3 377 10000 ???? 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 stack allowance: 30 nested subroutines. 542 U01c2 echo " stack allowance:",[($1FF - .)/2]d,"nested subroutines." 543 U01c2 - else 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 10000 ???? SEG "GAME" 555 10000 ???? ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_VerticalShooter_Test_sprani.78b.asm ------- FILE 7800basic_variable_redefs.h LEVEL 2 PASS 3 0 10000 ???? include "7800basic_variable_redefs.h" 1 10000 ???? ; This file contains variable mapping and other information for the current project. 2 10000 ???? 3 10000 ???? 00 00 vertical_shooting_laser_tallsprite_01_mode = $00 4 10000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width_twoscompliment = $00 5 10000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width = $00 6 10000 ???? 00 00 vertical_shooting_laser_tallsprite_00_mode = $00 7 10000 ???? 00 1f vertical_shooting_laser_tallsprite_00_width_twoscompliment = $1f 8 10000 ???? 00 01 vertical_shooting_laser_tallsprite_00_width = $01 9 10000 ???? 00 00 vertical_shooting_laser_mode = $00 10 10000 ???? 00 1f vertical_shooting_laser_width_twoscompliment = $1f 11 10000 ???? 00 01 vertical_shooting_laser_width = $01 12 10000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_mode = $00 13 10000 ???? 00 0c vertical_shooting_explosion_10_tallsprite_00_width_twoscompliment = $0c 14 10000 ???? 00 14 vertical_shooting_explosion_10_tallsprite_00_width = $14 15 10000 ???? 00 00 vertical_shooting_explosion_10_mode = $00 16 10000 ???? 00 0c vertical_shooting_explosion_10_width_twoscompliment = $0c 17 10000 ???? 00 14 vertical_shooting_explosion_10_width = $14 18 10000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_mode = $00 19 10000 ???? 00 0c vertical_shooting_explosion_09_tallsprite_00_width_twoscompliment = $0c 20 10000 ???? 00 14 vertical_shooting_explosion_09_tallsprite_00_width = $14 21 10000 ???? 00 00 vertical_shooting_explosion_09_mode = $00 22 10000 ???? 00 0c vertical_shooting_explosion_09_width_twoscompliment = $0c 23 10000 ???? 00 14 vertical_shooting_explosion_09_width = $14 24 10000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_mode = $00 25 10000 ???? 00 0c vertical_shooting_explosion_08_tallsprite_00_width_twoscompliment = $0c 26 10000 ???? 00 14 vertical_shooting_explosion_08_tallsprite_00_width = $14 27 10000 ???? 00 00 vertical_shooting_explosion_08_mode = $00 28 10000 ???? 00 0c vertical_shooting_explosion_08_width_twoscompliment = $0c 29 10000 ???? 00 14 vertical_shooting_explosion_08_width = $14 30 10000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_mode = $00 31 10000 ???? 00 0c vertical_shooting_explosion_07_tallsprite_00_width_twoscompliment = $0c 32 10000 ???? 00 14 vertical_shooting_explosion_07_tallsprite_00_width = $14 33 10000 ???? 00 00 vertical_shooting_explosion_07_mode = $00 34 10000 ???? 00 0c vertical_shooting_explosion_07_width_twoscompliment = $0c 35 10000 ???? 00 14 vertical_shooting_explosion_07_width = $14 36 10000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_mode = $00 37 10000 ???? 00 1e vertical_shooting_explosion_06_tallsprite_00_width_twoscompliment = $1e 38 10000 ???? 00 02 vertical_shooting_explosion_06_tallsprite_00_width = $02 39 10000 ???? 00 00 vertical_shooting_explosion_06_mode = $00 40 10000 ???? 00 1e vertical_shooting_explosion_06_width_twoscompliment = $1e 41 10000 ???? 00 02 vertical_shooting_explosion_06_width = $02 42 10000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_mode = $00 43 10000 ???? 00 1e vertical_shooting_explosion_05_tallsprite_00_width_twoscompliment = $1e 44 10000 ???? 00 02 vertical_shooting_explosion_05_tallsprite_00_width = $02 45 10000 ???? 00 00 vertical_shooting_explosion_05_mode = $00 46 10000 ???? 00 1e vertical_shooting_explosion_05_width_twoscompliment = $1e 47 10000 ???? 00 02 vertical_shooting_explosion_05_width = $02 48 10000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_mode = $00 49 10000 ???? 00 1e vertical_shooting_explosion_04_tallsprite_00_width_twoscompliment = $1e 50 10000 ???? 00 02 vertical_shooting_explosion_04_tallsprite_00_width = $02 51 10000 ???? 00 00 vertical_shooting_explosion_04_mode = $00 52 10000 ???? 00 1e vertical_shooting_explosion_04_width_twoscompliment = $1e 53 10000 ???? 00 02 vertical_shooting_explosion_04_width = $02 54 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_mode = $00 55 10000 ???? 00 1e vertical_shooting_explosion_03_tallsprite_00_width_twoscompliment = $1e 56 10000 ???? 00 02 vertical_shooting_explosion_03_tallsprite_00_width = $02 57 10000 ???? 00 00 vertical_shooting_explosion_03_mode = $00 58 10000 ???? 00 1e vertical_shooting_explosion_03_width_twoscompliment = $1e 59 10000 ???? 00 02 vertical_shooting_explosion_03_width = $02 60 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_mode = $00 61 10000 ???? 00 1e vertical_shooting_explosion_02_tallsprite_00_width_twoscompliment = $1e 62 10000 ???? 00 02 vertical_shooting_explosion_02_tallsprite_00_width = $02 63 10000 ???? 00 00 vertical_shooting_explosion_02_mode = $00 64 10000 ???? 00 1e vertical_shooting_explosion_02_width_twoscompliment = $1e 65 10000 ???? 00 02 vertical_shooting_explosion_02_width = $02 66 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_mode = $00 67 10000 ???? 00 1e vertical_shooting_explosion_01_tallsprite_00_width_twoscompliment = $1e 68 10000 ???? 00 02 vertical_shooting_explosion_01_tallsprite_00_width = $02 69 10000 ???? 00 00 vertical_shooting_explosion_01_mode = $00 70 10000 ???? 00 1e vertical_shooting_explosion_01_width_twoscompliment = $1e 71 10000 ???? 00 02 vertical_shooting_explosion_01_width = $02 72 10000 ???? 00 00 vertical_shooting_1up_mode = $00 73 10000 ???? 00 1e vertical_shooting_1up_width_twoscompliment = $1e 74 10000 ???? 00 02 vertical_shooting_1up_width = $02 75 10000 ???? 00 00 vertical_shooting_score_10_digits_mode = $00 76 10000 ???? 00 16 vertical_shooting_score_10_digits_width_twoscompliment = $16 77 10000 ???? 00 0a vertical_shooting_score_10_digits_width = $0a 78 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_mode = $00 79 10000 ???? 00 1e vertical_shooting_enemy01_tallsprite_00_width_twoscompliment = $1e 80 10000 ???? 00 02 vertical_shooting_enemy01_tallsprite_00_width = $02 81 10000 ???? 00 00 vertical_shooting_enemy01_mode = $00 82 10000 ???? 00 1e vertical_shooting_enemy01_width_twoscompliment = $1e 83 10000 ???? 00 02 vertical_shooting_enemy01_width = $02 84 10000 ???? 00 00 vertical_shooting_powerup_mode = $00 85 10000 ???? 00 1e vertical_shooting_powerup_width_twoscompliment = $1e 86 10000 ???? 00 02 vertical_shooting_powerup_width = $02 87 10000 ???? 00 00 vertical_shooting_enemyshot_mode = $00 88 10000 ???? 00 1f vertical_shooting_enemyshot_width_twoscompliment = $1f 89 10000 ???? 00 01 vertical_shooting_enemyshot_width = $01 90 10000 ???? 00 00 vertical_shooting_bullet_mode = $00 91 10000 ???? 00 1f vertical_shooting_bullet_width_twoscompliment = $1f 92 10000 ???? 00 01 vertical_shooting_bullet_width = $01 93 10000 ???? 00 00 vertical_shooting_ship_tallsprite_00_mode = $00 94 10000 ???? 00 1e vertical_shooting_ship_tallsprite_00_width_twoscompliment = $1e 95 10000 ???? 00 02 vertical_shooting_ship_tallsprite_00_width = $02 96 10000 ???? 00 00 vertical_shooting_ship_mode = $00 97 10000 ???? 00 1e vertical_shooting_ship_width_twoscompliment = $1e 98 10000 ???? 00 02 vertical_shooting_ship_width = $02 99 10000 ???? 00 00 vertical_shooting_font_mode = $00 100 10000 ???? 00 13 vertical_shooting_font_width_twoscompliment = $13 101 10000 ???? 00 2d vertical_shooting_font_width = $2d 102 10000 ???? 00 00 atascii_mode = $00 103 10000 ???? 00 0a atascii_width_twoscompliment = $0a 104 10000 ???? 00 f6 atascii_width = $f6 105 10000 ???? 00 90 sfx_explosion_length = .skipL0240-sfx_explosion 106 10000 ???? 107 10000 ???? 00 30 sfx_plainlaser_length = .skipL0239-sfx_plainlaser 108 10000 ???? 109 10000 ???? 00 54 sfx_pulsecannon_length = .skipL0238-sfx_pulsecannon 110 10000 ???? 111 10000 ???? 00 36 sfx_bling_length = .skipL0237-sfx_bling 112 10000 ???? 113 10000 ???? 00 04 vertical_shooting_laser_tallsprite_00_color3 = $04 114 10000 ???? 00 42 vertical_shooting_laser_tallsprite_00_color2 = $42 115 10000 ???? 00 0f vertical_shooting_laser_tallsprite_00_color1 = $0f 116 10000 ???? 00 00 vertical_shooting_laser_tallsprite_00_color0 = $00 117 10000 ???? 00 04 vertical_shooting_laser_color3 = $04 118 10000 ???? 00 42 vertical_shooting_laser_color2 = $42 119 10000 ???? 00 0f vertical_shooting_laser_color1 = $0f 120 10000 ???? 00 00 vertical_shooting_laser_color0 = $00 121 10000 ???? 00 33 vertical_shooting_explosion_10_tallsprite_00_color3 = $33 122 10000 ???? 00 2b vertical_shooting_explosion_10_tallsprite_00_color2 = $2b 123 10000 ???? 00 36 vertical_shooting_explosion_10_tallsprite_00_color1 = $36 124 10000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_color0 = $00 125 10000 ???? 00 33 vertical_shooting_explosion_10_color3 = $33 126 10000 ???? 00 2b vertical_shooting_explosion_10_color2 = $2b 127 10000 ???? 00 36 vertical_shooting_explosion_10_color1 = $36 128 10000 ???? 00 00 vertical_shooting_explosion_10_color0 = $00 129 10000 ???? 00 33 vertical_shooting_explosion_09_tallsprite_00_color3 = $33 130 10000 ???? 00 2b vertical_shooting_explosion_09_tallsprite_00_color2 = $2b 131 10000 ???? 00 36 vertical_shooting_explosion_09_tallsprite_00_color1 = $36 132 10000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_color0 = $00 133 10000 ???? 00 33 vertical_shooting_explosion_09_color3 = $33 134 10000 ???? 00 2b vertical_shooting_explosion_09_color2 = $2b 135 10000 ???? 00 36 vertical_shooting_explosion_09_color1 = $36 136 10000 ???? 00 00 vertical_shooting_explosion_09_color0 = $00 137 10000 ???? 00 33 vertical_shooting_explosion_08_tallsprite_00_color3 = $33 138 10000 ???? 00 2b vertical_shooting_explosion_08_tallsprite_00_color2 = $2b 139 10000 ???? 00 36 vertical_shooting_explosion_08_tallsprite_00_color1 = $36 140 10000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_color0 = $00 141 10000 ???? 00 33 vertical_shooting_explosion_08_color3 = $33 142 10000 ???? 00 2b vertical_shooting_explosion_08_color2 = $2b 143 10000 ???? 00 36 vertical_shooting_explosion_08_color1 = $36 144 10000 ???? 00 00 vertical_shooting_explosion_08_color0 = $00 145 10000 ???? 00 33 vertical_shooting_explosion_07_tallsprite_00_color3 = $33 146 10000 ???? 00 2b vertical_shooting_explosion_07_tallsprite_00_color2 = $2b 147 10000 ???? 00 36 vertical_shooting_explosion_07_tallsprite_00_color1 = $36 148 10000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_color0 = $00 149 10000 ???? 00 33 vertical_shooting_explosion_07_color3 = $33 150 10000 ???? 00 2b vertical_shooting_explosion_07_color2 = $2b 151 10000 ???? 00 36 vertical_shooting_explosion_07_color1 = $36 152 10000 ???? 00 00 vertical_shooting_explosion_07_color0 = $00 153 10000 ???? 00 33 vertical_shooting_explosion_06_tallsprite_00_color3 = $33 154 10000 ???? 00 2b vertical_shooting_explosion_06_tallsprite_00_color2 = $2b 155 10000 ???? 00 36 vertical_shooting_explosion_06_tallsprite_00_color1 = $36 156 10000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_color0 = $00 157 10000 ???? 00 33 vertical_shooting_explosion_06_color3 = $33 158 10000 ???? 00 2b vertical_shooting_explosion_06_color2 = $2b 159 10000 ???? 00 36 vertical_shooting_explosion_06_color1 = $36 160 10000 ???? 00 00 vertical_shooting_explosion_06_color0 = $00 161 10000 ???? 00 33 vertical_shooting_explosion_05_tallsprite_00_color3 = $33 162 10000 ???? 00 2b vertical_shooting_explosion_05_tallsprite_00_color2 = $2b 163 10000 ???? 00 36 vertical_shooting_explosion_05_tallsprite_00_color1 = $36 164 10000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_color0 = $00 165 10000 ???? 00 33 vertical_shooting_explosion_05_color3 = $33 166 10000 ???? 00 2b vertical_shooting_explosion_05_color2 = $2b 167 10000 ???? 00 36 vertical_shooting_explosion_05_color1 = $36 168 10000 ???? 00 00 vertical_shooting_explosion_05_color0 = $00 169 10000 ???? 00 33 vertical_shooting_explosion_04_tallsprite_00_color3 = $33 170 10000 ???? 00 36 vertical_shooting_explosion_04_tallsprite_00_color2 = $36 171 10000 ???? 00 2b vertical_shooting_explosion_04_tallsprite_00_color1 = $2b 172 10000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_color0 = $00 173 10000 ???? 00 33 vertical_shooting_explosion_04_color3 = $33 174 10000 ???? 00 36 vertical_shooting_explosion_04_color2 = $36 175 10000 ???? 00 2b vertical_shooting_explosion_04_color1 = $2b 176 10000 ???? 00 00 vertical_shooting_explosion_04_color0 = $00 177 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color3 = 0 178 10000 ???? 00 36 vertical_shooting_explosion_03_tallsprite_00_color2 = $36 179 10000 ???? 00 2b vertical_shooting_explosion_03_tallsprite_00_color1 = $2b 180 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color0 = $00 181 10000 ???? 00 00 vertical_shooting_explosion_03_color3 = 0 182 10000 ???? 00 36 vertical_shooting_explosion_03_color2 = $36 183 10000 ???? 00 2b vertical_shooting_explosion_03_color1 = $2b 184 10000 ???? 00 00 vertical_shooting_explosion_03_color0 = $00 185 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color3 = 0 186 10000 ???? 00 36 vertical_shooting_explosion_02_tallsprite_00_color2 = $36 187 10000 ???? 00 2b vertical_shooting_explosion_02_tallsprite_00_color1 = $2b 188 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color0 = $00 189 10000 ???? 00 00 vertical_shooting_explosion_02_color3 = 0 190 10000 ???? 00 36 vertical_shooting_explosion_02_color2 = $36 191 10000 ???? 00 2b vertical_shooting_explosion_02_color1 = $2b 192 10000 ???? 00 00 vertical_shooting_explosion_02_color0 = $00 193 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color3 = 0 194 10000 ???? 00 2b vertical_shooting_explosion_01_tallsprite_00_color2 = $2b 195 10000 ???? 00 36 vertical_shooting_explosion_01_tallsprite_00_color1 = $36 196 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color0 = $00 197 10000 ???? 00 00 vertical_shooting_explosion_01_color3 = 0 198 10000 ???? 00 2b vertical_shooting_explosion_01_color2 = $2b 199 10000 ???? 00 36 vertical_shooting_explosion_01_color1 = $36 200 10000 ???? 00 00 vertical_shooting_explosion_01_color0 = $00 201 10000 ???? 00 0f vertical_shooting_1up_color3 = $0f 202 10000 ???? 00 42 vertical_shooting_1up_color2 = $42 203 10000 ???? 00 04 vertical_shooting_1up_color1 = $04 204 10000 ???? 00 00 vertical_shooting_1up_color0 = $00 205 10000 ???? 00 33 vertical_shooting_score_10_digits_color3 = $33 206 10000 ???? 00 2b vertical_shooting_score_10_digits_color2 = $2b 207 10000 ???? 00 36 vertical_shooting_score_10_digits_color1 = $36 208 10000 ???? 00 00 vertical_shooting_score_10_digits_color0 = $00 209 10000 ???? 00 83 vertical_shooting_enemy01_tallsprite_00_color3 = $83 210 10000 ???? 00 a8 vertical_shooting_enemy01_tallsprite_00_color2 = $a8 211 10000 ???? 00 bc vertical_shooting_enemy01_tallsprite_00_color1 = $bc 212 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_color0 = $00 213 10000 ???? 00 83 vertical_shooting_enemy01_color3 = $83 214 10000 ???? 00 a8 vertical_shooting_enemy01_color2 = $a8 215 10000 ???? 00 bc vertical_shooting_enemy01_color1 = $bc 216 10000 ???? 00 00 vertical_shooting_enemy01_color0 = $00 217 10000 ???? 00 36 vertical_shooting_powerup_color3 = $36 218 10000 ???? 00 33 vertical_shooting_powerup_color2 = $33 219 10000 ???? 00 2b vertical_shooting_powerup_color1 = $2b 220 10000 ???? 00 00 vertical_shooting_powerup_color0 = $00 221 10000 ???? 00 bc vertical_shooting_enemyshot_color3 = $bc 222 10000 ???? 00 83 vertical_shooting_enemyshot_color2 = $83 223 10000 ???? 00 a8 vertical_shooting_enemyshot_color1 = $a8 224 10000 ???? 00 00 vertical_shooting_enemyshot_color0 = $00 225 10000 ???? 00 1d vertical_shooting_bullet_color3 = $1d 226 10000 ???? 00 18 vertical_shooting_bullet_color2 = $18 227 10000 ???? 00 0f vertical_shooting_bullet_color1 = $0f 228 10000 ???? 00 00 vertical_shooting_bullet_color0 = $00 229 10000 ???? 00 42 vertical_shooting_ship_tallsprite_00_color3 = $42 230 10000 ???? 00 04 vertical_shooting_ship_tallsprite_00_color2 = $04 231 10000 ???? 00 0f vertical_shooting_ship_tallsprite_00_color1 = $0f 232 10000 ???? 00 00 vertical_shooting_ship_tallsprite_00_color0 = $00 233 10000 ???? 00 42 vertical_shooting_ship_color3 = $42 234 10000 ???? 00 04 vertical_shooting_ship_color2 = $04 235 10000 ???? 00 0f vertical_shooting_ship_color1 = $0f 236 10000 ???? 00 00 vertical_shooting_ship_color0 = $00 237 10000 ???? 00 0f vertical_shooting_font_color1 = $0f 238 10000 ???? 00 00 vertical_shooting_font_color0 = $00 239 10000 ???? 00 00 atascii_color1 = $00 240 10000 ???? 00 0f atascii_color0 = $0f 241 10000 ???? 01 68 twinlaser_Slowdown = var40 242 10000 ???? 243 10000 ???? 01 67 twinlaser_flag = var39 244 10000 ???? 245 10000 ???? 01 66 twinlaserY = var38 246 10000 ???? 247 10000 ???? 01 65 twinlaserX = var37 248 10000 ???? 249 10000 ???? 01 64 lives = var36 250 10000 ???? 251 10000 ???? 01 63 explosion_aniframe = var35 252 10000 ???? 253 10000 ???? 01 62 extra_shipFlag = var34 254 10000 ???? 255 10000 ???? 01 61 extra_shipY = var33 256 10000 ???? 257 10000 ???? 01 60 extra_shipX = var32 258 10000 ???? 259 10000 ???? 01 5f gameover_flag = var31 260 10000 ???? 261 10000 ???? 01 5e enemy01_speed = var30 262 10000 ???? 263 10000 ???? 01 5d rMovement6 = var29 264 10000 ???? 265 10000 ???? 01 5c rMovement5 = var28 266 10000 ???? 267 10000 ???? 01 5b rMovement4 = var27 268 10000 ???? 269 10000 ???? 01 5a rMovement3 = var26 270 10000 ???? 271 10000 ???? 01 59 enemy01_Flag = var25 272 10000 ???? 273 10000 ???? 01 58 enemy01_Y = var24 274 10000 ???? 275 10000 ???? 01 57 enemy01_X = var23 276 10000 ???? 277 10000 ???? 01 56 enemy_shotSlowdown = var22 278 10000 ???? 279 10000 ???? 01 55 bulletSlowdown = var21 280 10000 ???? 281 10000 ???? 01 54 power_upSlowdown = var20 282 10000 ???? 283 10000 ???? 01 53 rMovement2 = var19 284 10000 ???? 285 10000 ???? 01 52 power_upFlag = var18 286 10000 ???? 287 10000 ???? 01 51 power_upY = var17 288 10000 ???? 289 10000 ???? 01 50 power_upX = var16 290 10000 ???? 291 10000 ???? 01 4f rDirection = var15 292 10000 ???? 293 10000 ???? 01 4e rMovement1 = var14 294 10000 ???? 295 10000 ???? 01 4d playerFlag = var13 296 10000 ???? 297 10000 ???? 01 4c enemy_shotFlag = var12 298 10000 ???? 299 10000 ???? 01 4b enemy_shotY = var11 300 10000 ???? 301 10000 ???? 01 4a enemy_shotX = var10 302 10000 ???? 303 10000 ???? 01 49 bulletY = var9 304 10000 ???? 305 10000 ???? 01 48 bulletX = var8 306 10000 ???? 307 10000 ???? 01 47 joyposright = var7 308 10000 ???? 309 10000 ???? 01 46 joyposleft = var6 310 10000 ???? 311 10000 ???? 01 45 joyposdown = var5 312 10000 ???? 313 10000 ???? 01 44 joyposup = var4 314 10000 ???? 315 10000 ???? 01 43 fire_debounce = var3 316 10000 ???? 317 10000 ???? 01 42 playerY = var2 318 10000 ???? 319 10000 ???? 01 41 playerX = var1 320 10000 ???? 321 10000 ???? 01 40 frameCounter = var0 322 10000 ???? 323 10000 ???? 00 01 DOUBLEWIDE = 1 324 10000 ???? 00 01 collisionwrap = 1 325 10000 ???? 00 01 NTSC = 1 326 10000 ???? 00 c0 SCREENHEIGHT = 192 327 10000 ???? 00 01 CHECKOVERWRITE = 1 328 10000 ???? 00 08 ZONEHEIGHT = 8 329 10000 ???? 00 01 ROM16K = 1 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_VerticalShooter_Test_sprani.78b.asm 545 10000 ???? 546 10000 ???? ; A BEAD header gets automatically incorportated into the ROM header. 547 10000 ???? ; For more BEAD executable info, check out the spec... 548 10000 ???? ; http://7800.8bitdev.org/index.php/The_Atari_7800_BEAD_Execuable_Specification 549 10000 ???? 550 10000 ???? 00 01 GAMEDESCRIPTIONSET = 1 551 10000 ???? 4e 61 6d 65 GAMEDESCRIPTION = "Test Name" 552 10000 ???? 553 10000 ???? 00 40 BDHSC = %01000000 554 10000 ???? 00 20 BDYM = %00100000 555 10000 ???? 00 10 BDPOKEY = %00010000 556 10000 ???? 00 08 BDROF = %00001000 557 10000 ???? 00 00 BD16K = %00000000 558 10000 ???? 00 01 BD32K = %00000001 559 10000 ???? 00 02 BD48K = %00000010 560 10000 ???? 00 05 BD1800 = %00000101 561 10000 ???? 00 06 BD4000 = %00000110 562 10000 ???? 563 10000 ???? ifconst ROM16K 564 10000 ???? 00 01 BEADHEADER = 1 565 10000 ???? endif 566 10000 ???? - ifconst ROM32K 567 10000 ???? -BEADHEADER = 1 568 10000 ???? endif 569 10000 ???? - ifconst ROM48K 570 10000 ???? -BEADHEADER = 1 571 10000 ???? endif 572 10000 ???? 573 10000 ???? ifconst BEADHEADER 574 10000 ???? BEADHARDWARE SET 0 575 10000 ???? ifconst ROM16K 576 10000 ???? BEADHARDWARE SET (BEADHARDWARE|BD16K) 577 10000 ???? endif 578 10000 ???? - ifconst ROM32K 579 10000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD32K) 580 10000 ???? endif 581 10000 ???? - ifconst ROM48K 582 10000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD48K) 583 10000 ???? endif 584 10000 ???? - ifconst pokeysupport 585 10000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDPOKEY) 586 10000 ???? endif 587 10000 ???? - ifconst HSSUPPORT 588 10000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDHSC) 589 10000 ???? endif 590 10000 ???? endif 591 10000 ???? 592 10000 ???? ;start address of cart... 593 10000 ???? - ifconst ROM48K 594 10000 ???? - ORG $4000,0 595 10000 ???? - ifconst BEADHEADER 596 10000 ???? - .byte $BE,$AD,BEADHARDWARE 597 10000 ???? - ifconst GAMEDESCRIPTIONSET 598 10000 ???? - CLC 599 10000 ???? - BCC _SKIPDESCRIPTION 600 10000 ???? - .byte GAMEDESCRIPTION,0 601 10000 ???? -_SKIPDESCRIPTION 602 10000 ???? - endif 603 10000 ???? - jmp ($FFFC) 604 10000 ???? - endif 605 10000 ???? else 606 10000 ???? - ifconst bankswitchmode 607 10000 ???? - ifconst ROMAT4K 608 10000 ???? - ORG $4000,0 609 10000 ???? - RORG $4000 610 10000 ???? - else 611 10000 ???? - ORG $8000,0 612 10000 ???? - RORG $8000 613 10000 ???? - endif 614 10000 ???? else ; not bankswitchmode 615 10000 ???? ifconst ROM16K 616 c000 ORG $C000,0 617 c000 ifconst BEADHEADER 618 c000 be ad 00 .byte.b $BE,$AD,BEADHARDWARE 619 c003 - ifconst GAMEDESCRIPTION 620 c003 - CLC 621 c003 - BCC _SKIPDESCRIPTION 622 c003 - .byte GAMEDESCRIPTION,0 623 c003 -_SKIPDESCRIPTION 624 c003 endif 625 c003 6c fc ff jmp ($FFFC) 626 c006 endif 627 c006 - else 628 c006 - ifconst ROM8K 629 c006 - ORG $E000,0 630 c006 - else 631 c006 - ORG $8000,0 632 c006 - ifconst BEADHEADER 633 c006 - .byte $BE,$AD,BEADHARDWARE 634 c006 - ifconst GAMEDESCRIPTION 635 c006 - CLC 636 c006 - BCC _SKIPDESCRIPTION 637 c006 - .byte GAMEDESCRIPTION,0 638 c006 -_SKIPDESCRIPTION 639 c006 - endif 640 c006 - jmp ($FFFC) 641 c006 - endif 642 c006 - endif 643 c006 endif 644 c006 endif 645 c006 endif 646 c006 647 c006 ;7800basic v0.16 Nov 21 2020 15:38:52 648 c006 SPACEOVERFLOW SET 0 649 c006 game 650 c006 . 651 c006 ;; 652 c006 653 c006 . 654 c006 ;; 655 c006 656 c006 .L00 ;; set romsize 16k 657 c006 658 c006 .L01 ;; set zoneheight 8 659 c006 660 c006 .L02 ;; set zoneprotection on 661 c006 662 c006 .L03 ;; set tallsprite on 663 c006 664 c006 .L04 ;; set screenheight 192 665 c006 666 c006 .L05 ;; set basepath gfx 667 c006 668 c006 .L06 ;; set tv ntsc 669 c006 670 c006 .L07 ;; set collisionwrap on 671 c006 672 c006 .L08 ;; set doublewide on 673 c006 674 c006 .L09 ;; displaymode 160A 675 c006 676 c006 a9 50 lda #%01010000 ;Enable DMA, mode=160x2/160x4, 2x character width 677 c008 85 3c sta CTRL 678 c00a 679 c00a 8d 07 21 sta sCTRL 680 c00d 681 c00d . 682 c00d ;; 683 c00d 684 c00d .L010 ;; dim frameCounter = var0 685 c00d 686 c00d .L011 ;; dim playerX = var1 687 c00d 688 c00d .L012 ;; dim playerY = var2 689 c00d 690 c00d .L013 ;; dim fire_debounce = var3 691 c00d 692 c00d .L014 ;; dim joyposup = var4 693 c00d 694 c00d .L015 ;; dim joyposdown = var5 695 c00d 696 c00d .L016 ;; dim joyposleft = var6 697 c00d 698 c00d .L017 ;; dim joyposright = var7 699 c00d 700 c00d .L018 ;; dim bulletX = var8 701 c00d 702 c00d .L019 ;; dim bulletY = var9 703 c00d 704 c00d .L020 ;; dim enemy_shotX = var10 705 c00d 706 c00d .L021 ;; dim enemy_shotY = var11 707 c00d 708 c00d .L022 ;; dim enemy_shotFlag = var12 709 c00d 710 c00d .L023 ;; dim playerFlag = var13 711 c00d 712 c00d .L024 ;; dim rMovement1 = var14 713 c00d 714 c00d .L025 ;; dim rDirection = var15 715 c00d 716 c00d .L026 ;; dim power_upX = var16 717 c00d 718 c00d .L027 ;; dim power_upY = var17 719 c00d 720 c00d .L028 ;; dim power_upFlag = var18 721 c00d 722 c00d .L029 ;; dim rMovement2 = var19 723 c00d 724 c00d .L030 ;; dim power_upSlowdown = var20 725 c00d 726 c00d .L031 ;; dim bulletSlowdown = var21 727 c00d 728 c00d .L032 ;; dim enemy_shotSlowdown = var22 729 c00d 730 c00d .L033 ;; dim enemy01_X = var23 731 c00d 732 c00d .L034 ;; dim enemy01_Y = var24 733 c00d 734 c00d .L035 ;; dim enemy01_Flag = var25 735 c00d 736 c00d .L036 ;; dim rMovement3 = var26 737 c00d 738 c00d .L037 ;; dim rMovement4 = var27 739 c00d 740 c00d .L038 ;; dim rMovement5 = var28 741 c00d 742 c00d .L039 ;; dim rMovement6 = var29 743 c00d 744 c00d .L040 ;; dim enemy01_speed = var30 745 c00d 746 c00d .L041 ;; dim gameover_flag = var31 747 c00d 748 c00d .L042 ;; dim extra_shipX = var32 749 c00d 750 c00d .L043 ;; dim extra_shipY = var33 751 c00d 752 c00d .L044 ;; dim extra_shipFlag = var34 753 c00d 754 c00d .L045 ;; dim explosion_aniframe = var35 755 c00d 756 c00d .L046 ;; dim lives = var36 757 c00d 758 c00d .L047 ;; dim twinlaserX = var37 759 c00d 760 c00d .L048 ;; dim twinlaserY = var38 761 c00d 762 c00d .L049 ;; dim twinlaser_flag = var39 763 c00d 764 c00d .L050 ;; dim twinlaser_Slowdown = var40 765 c00d 766 c00d .palettes 767 c00d ;; palettes 768 c00d 769 c00d .L051 ;; P0C1 = $0F : P0C2 = $05 : P0C3 = $32 770 c00d 771 c00d a9 0f LDA #$0F 772 c00f 85 21 STA P0C1 773 c011 a9 05 LDA #$05 774 c013 85 22 STA P0C2 775 c015 a9 32 LDA #$32 776 c017 85 23 STA P0C3 777 c019 .L052 ;; P1C1 = $0F : P1C2 = $EE : P1C3 = $E7 778 c019 779 c019 a9 0f LDA #$0F 780 c01b 85 25 STA P1C1 781 c01d a9 ee LDA #$EE 782 c01f 85 26 STA P1C2 783 c021 a9 e7 LDA #$E7 784 c023 85 27 STA P1C3 785 c025 .L053 ;; P2C1 = $9D : P2C2 = $73 : P2C3 = $88 786 c025 787 c025 a9 9d LDA #$9D 788 c027 85 29 STA P2C1 789 c029 a9 73 LDA #$73 790 c02b 85 2a STA P2C2 791 c02d a9 88 LDA #$88 792 c02f 85 2b STA P2C3 793 c031 .L054 ;; P3C1 = $FB : P3C2 = $F2 : P3C3 = $25 794 c031 795 c031 a9 fb LDA #$FB 796 c033 85 2d STA P3C1 797 c035 a9 f2 LDA #$F2 798 c037 85 2e STA P3C2 799 c039 a9 25 LDA #$25 800 c03b 85 2f STA P3C3 801 c03d . 802 c03d ;; 803 c03d 804 c03d .import 805 c03d ;; import 806 c03d 807 c03d .L055 ;; incgraphic atascii.png 160A 808 c03d 809 c03d .L056 ;; incgraphic vertical_shooting_font.png 160A 810 c03d 811 c03d .L057 ;; incgraphic vertical_shooting_ship.png 160A 812 c03d 813 c03d .L058 ;; incgraphic vertical_shooting_bullet.png 160A 814 c03d 815 c03d .L059 ;; incgraphic vertical_shooting_enemyshot.png 160A 816 c03d 817 c03d .L060 ;; incgraphic vertical_shooting_powerup.png 160A 818 c03d 819 c03d .L061 ;; incgraphic vertical_shooting_enemy01.png 160A 820 c03d 821 c03d .L062 ;; incgraphic vertical_shooting_score_10_digits.png 160A 822 c03d 823 c03d .L063 ;; incgraphic vertical_shooting_1up.png 160A 824 c03d 825 c03d .L064 ;; incgraphic vertical_shooting_explosion_01.png 160A 826 c03d 827 c03d .L065 ;; incgraphic vertical_shooting_explosion_02.png 160A 828 c03d 829 c03d .L066 ;; incgraphic vertical_shooting_explosion_03.png 160A 830 c03d 831 c03d .L067 ;; incgraphic vertical_shooting_explosion_04.png 160A 832 c03d 833 c03d .L068 ;; incgraphic vertical_shooting_explosion_05.png 160A 834 c03d 835 c03d .L069 ;; incgraphic vertical_shooting_explosion_06.png 160A 836 c03d 837 c03d .L070 ;; incgraphic vertical_shooting_explosion_07.png 160A 838 c03d 839 c03d .L071 ;; incgraphic vertical_shooting_explosion_08.png 160A 840 c03d 841 c03d .L072 ;; incgraphic vertical_shooting_explosion_09.png 160A 842 c03d 843 c03d .L073 ;; incgraphic vertical_shooting_explosion_10.png 160A 844 c03d 845 c03d .L074 ;; incgraphic vertical_shooting_laser.png 160A 846 c03d 847 c03d .plot 848 c03d ;; plot 849 c03d 850 c03d .L075 ;; clearscreen 851 c03d 852 c03d 20 8c f0 jsr clearscreen 853 c040 .L076 ;; characterset atascii 854 c040 855 c040 a9 d0 lda #>atascii 856 c042 8d 0b 21 sta sCHARBASE 857 c045 858 c045 85 34 sta CHARBASE 859 c047 a9 60 lda #(atascii_mode | %01100000) 860 c049 8d 06 21 sta charactermode 861 c04c 862 c04c .L077 ;; alphachars ASCII 863 c04c 864 c04c .L078 ;; plotchars 'New^Vertical^Shooting' 1 8 4 865 c04c 866 c04c 4c 64 c0 JMP skipalphadata0 867 c04f alphadata0 868 c04f 9c .byte.b (alphadata0 894 c06a 85 43 sta temp2 895 c06c 896 c06c a9 0b lda #11 ; width in two's complement 897 c06e 09 20 ora #32 ; palette left shifted 5 bits 898 c070 85 44 sta temp3 899 c072 a9 08 lda #8 900 c074 85 45 sta temp4 901 c076 902 c076 a9 04 lda #4 903 c078 904 c078 85 46 sta temp5 905 c07a 906 c07a 20 59 f3 jsr plotcharacters 907 c07d .L079 ;; plotchars 'Demo' 1 16 5 908 c07d 909 c07d 4c 84 c0 JMP skipalphadata1 910 c080 alphadata1 911 c080 88 .byte.b (alphadata1 920 c08a 85 43 sta temp2 921 c08c 922 c08c a9 1c lda #28 ; width in two's complement 923 c08e 09 20 ora #32 ; palette left shifted 5 bits 924 c090 85 44 sta temp3 925 c092 a9 10 lda #16 926 c094 85 45 sta temp4 927 c096 928 c096 a9 05 lda #5 929 c098 930 c098 85 46 sta temp5 931 c09a 932 c09a 20 59 f3 jsr plotcharacters 933 c09d .L080 ;; plotchars 'by^Shane^Skekel.' 1 16 7 934 c09d 935 c09d 4c b0 c0 JMP skipalphadata2 936 c0a0 alphadata2 937 c0a0 c4 .byte.b (alphadata2 958 c0b6 85 43 sta temp2 959 c0b8 960 c0b8 a9 10 lda #16 ; width in two's complement 961 c0ba 09 20 ora #32 ; palette left shifted 5 bits 962 c0bc 85 44 sta temp3 963 c0be a9 10 lda #16 964 c0c0 85 45 sta temp4 965 c0c2 966 c0c2 a9 07 lda #7 967 c0c4 968 c0c4 85 46 sta temp5 969 c0c6 970 c0c6 20 59 f3 jsr plotcharacters 971 c0c9 .L081 ;; plotchars 'Push^Fire^to^Begin.' 2 8 16 972 c0c9 973 c0c9 4c df c0 JMP skipalphadata3 974 c0cc alphadata3 975 c0cc a0 .byte.b (alphadata3 999 c0e5 85 43 sta temp2 1000 c0e7 1001 c0e7 a9 0d lda #13 ; width in two's complement 1002 c0e9 09 40 ora #64 ; palette left shifted 5 bits 1003 c0eb 85 44 sta temp3 1004 c0ed a9 08 lda #8 1005 c0ef 85 45 sta temp4 1006 c0f1 1007 c0f1 a9 10 lda #16 1008 c0f3 1009 c0f3 85 46 sta temp5 1010 c0f5 1011 c0f5 20 59 f3 jsr plotcharacters 1012 c0f8 .L082 ;; savescreen 1013 c0f8 1014 c0f8 20 b0 f0 jsr savescreen 1015 c0fb .L083 ;; drawscreen 1016 c0fb 1017 c0fb 20 c0 f0 jsr drawscreen 1018 c0fe . 1019 c0fe ;; 1020 c0fe 1021 c0fe .L084 ;; playerX = 80 : playerY = 144 : playerFlag = 0 : fire_debounce = 0 1022 c0fe 1023 c0fe a9 50 LDA #80 1024 c100 8d 41 01 STA playerX 1025 c103 a9 90 LDA #144 1026 c105 8d 42 01 STA playerY 1027 c108 a9 00 LDA #0 1028 c10a 8d 4d 01 STA playerFlag 1029 c10d 8d 43 01 STA fire_debounce 1030 c110 .L085 ;; joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 1031 c110 1032 c110 a9 00 LDA #0 1033 c112 8d 44 01 STA joyposup 1034 c115 8d 45 01 STA joyposdown 1035 c118 8d 46 01 STA joyposleft 1036 c11b 8d 47 01 STA joyposright 1037 c11e .L086 ;; bulletX = 0 : bulletY = 0 : lives = 3 1038 c11e 1039 c11e a9 00 LDA #0 1040 c120 8d 48 01 STA bulletX 1041 c123 8d 49 01 STA bulletY 1042 c126 a9 03 LDA #3 1043 c128 8d 64 01 STA lives 1044 c12b .L087 ;; enemy_shotX = 0 : enemy_shotY = 0 : enemy_shotFlag = 0 1045 c12b 1046 c12b a9 00 LDA #0 1047 c12d 8d 4a 01 STA enemy_shotX 1048 c130 8d 4b 01 STA enemy_shotY 1049 c133 8d 4c 01 STA enemy_shotFlag 1050 c136 .L088 ;; rMovement1 = 1 : rMovement2 = 1 : rMovement3 = 1 : rMovement4 = 1 1051 c136 1052 c136 a9 01 LDA #1 1053 c138 8d 4e 01 STA rMovement1 1054 c13b 8d 53 01 STA rMovement2 1055 c13e 8d 5a 01 STA rMovement3 1056 c141 8d 5b 01 STA rMovement4 1057 c144 .L089 ;; rMovement5 = 1 : rMovement6 = 1 : rDirection = 1 1058 c144 1059 c144 a9 01 LDA #1 1060 c146 8d 5c 01 STA rMovement5 1061 c149 8d 5d 01 STA rMovement6 1062 c14c 8d 4f 01 STA rDirection 1063 c14f .L090 ;; power_upX = 5 : power_upY = 32 : power_upFlag = 0 1064 c14f 1065 c14f a9 05 LDA #5 1066 c151 8d 50 01 STA power_upX 1067 c154 a9 20 LDA #32 1068 c156 8d 51 01 STA power_upY 1069 c159 a9 00 LDA #0 1070 c15b 8d 52 01 STA power_upFlag 1071 c15e .L091 ;; enemy_shotSlowdown = 0 : bulletSlowdown = 0 : power_upSlowdown = 0 1072 c15e 1073 c15e a9 00 LDA #0 1074 c160 8d 56 01 STA enemy_shotSlowdown 1075 c163 8d 55 01 STA bulletSlowdown 1076 c166 8d 54 01 STA power_upSlowdown 1077 c169 .L092 ;; enemy01_X = 0 : enemy01_Y = 0 : enemy01_Flag = 0 : enemy01_speed = 6 1078 c169 1079 c169 a9 00 LDA #0 1080 c16b 8d 57 01 STA enemy01_X 1081 c16e 8d 58 01 STA enemy01_Y 1082 c171 8d 59 01 STA enemy01_Flag 1083 c174 a9 06 LDA #6 1084 c176 8d 5e 01 STA enemy01_speed 1085 c179 .L093 ;; frameCounter = 0 : gameover_flag = 0 1086 c179 1087 c179 a9 00 LDA #0 1088 c17b 8d 40 01 STA frameCounter 1089 c17e 8d 5f 01 STA gameover_flag 1090 c181 .L094 ;; extra_shipX = 0 : extra_shipY = 0 : extra_shipFlag = 0 1091 c181 1092 c181 a9 00 LDA #0 1093 c183 8d 60 01 STA extra_shipX 1094 c186 8d 61 01 STA extra_shipY 1095 c189 8d 62 01 STA extra_shipFlag 1096 c18c .L095 ;; twinlaserX = 0 : twinlaserY = 0 1097 c18c 1098 c18c a9 00 LDA #0 1099 c18e 8d 65 01 STA twinlaserX 1100 c191 8d 66 01 STA twinlaserY 1101 c194 . 1102 c194 ;; 1103 c194 1104 c194 .titlescreenloop 1105 c194 ;; titlescreenloop 1106 c194 1107 c194 .L096 ;; restorescreen 1108 c194 1109 c194 20 9e f0 jsr restorescreen 1110 c197 .L097 ;; if switchreset then reboot 1111 c197 1112 c197 20 85 f4 jsr checkresetswitch 1113 c19a d0 03 BNE .skipL097 1114 c19c .condpart0 1115 c19c 4c 72 f5 JMP START 1116 c19f .skipL097 1117 c19f .L098 ;; if joy0fire then clearscreen : savescreen : lives = $04 : score0 = 0 : goto main : playsfx sfx_bling 1118 c19f 1119 c19f 2c 02 21 bit sINPT1 1120 c1a2 10 36 BPL .skipL098 1121 c1a4 .condpart1 1122 c1a4 20 8c f0 jsr clearscreen 1123 c1a7 20 b0 f0 jsr savescreen 1124 c1aa a9 04 LDA #$04 1125 c1ac 8d 64 01 STA lives 1126 c1af a9 00 LDA #$00 1127 c1b1 8d a8 01 STA score0+2 1128 c1b4 a9 00 LDA #$00 1129 c1b6 8d a7 01 STA score0+1 1130 c1b9 a9 00 LDA #$00 1131 c1bb 8d a6 01 STA score0 1132 c1be 4c e0 c1 jmp .main 1133 c1c1 a9 01 lda #1 1134 c1c3 85 de sta sfxschedulelock 1135 c1c5 a9 f2 lda #sfx_bling 1138 c1cb 85 e1 sta sfxinstrumenthi 1139 c1cd a9 00 lda #0 1140 c1cf 85 e2 sta sfxpitchoffset ; no pitch modification 1141 c1d1 85 e3 sta sfxnoteindex ; not a musical note 1142 c1d3 20 58 f2 jsr schedulesfx 1143 c1d6 a9 00 lda #0 1144 c1d8 85 de sta sfxschedulelock 1145 c1da .skipL098 1146 c1da . 1147 c1da ;; 1148 c1da 1149 c1da . 1150 c1da ;; 1151 c1da 1152 c1da . 1153 c1da ;; 1154 c1da 1155 c1da .L099 ;; drawscreen 1156 c1da 1157 c1da 20 c0 f0 jsr drawscreen 1158 c1dd .L0100 ;; goto titlescreenloop 1159 c1dd 1160 c1dd 4c 94 c1 jmp .titlescreenloop 1161 c1e0 1162 c1e0 . 1163 c1e0 ;; 1164 c1e0 1165 c1e0 . 1166 c1e0 ;; 1167 c1e0 1168 c1e0 .main 1169 c1e0 ;; main 1170 c1e0 1171 c1e0 .L0101 ;; frameCounter = frameCounter + 1 1172 c1e0 1173 c1e0 ad 40 01 LDA frameCounter 1174 c1e3 18 CLC 1175 c1e4 69 01 ADC #1 1176 c1e6 8d 40 01 STA frameCounter 1177 c1e9 .L0102 ;; if frameCounter > 10 then frameCounter = 0 1178 c1e9 1179 c1e9 a9 0a LDA #10 1180 c1eb cd 40 01 CMP frameCounter 1181 c1ee b0 05 BCS .skipL0102 1182 c1f0 .condpart2 1183 c1f0 a9 00 LDA #0 1184 c1f2 8d 40 01 STA frameCounter 1185 c1f5 .skipL0102 1186 c1f5 .mainloop 1187 c1f5 ;; mainloop 1188 c1f5 1189 c1f5 .L0103 ;; BACKGRND = $00 1190 c1f5 1191 c1f5 a9 00 LDA #$00 1192 c1f7 85 20 STA BACKGRND 1193 c1f9 .L0104 ;; restorescreen 1194 c1f9 1195 c1f9 20 9e f0 jsr restorescreen 1196 c1fc .L0105 ;; rMovement1 = ( rand & 7 ) - 2 1197 c1fc 1198 c1fc ; complex statement detected 1199 c1fc 20 fd f3 jsr randomize 1200 c1ff 29 07 AND #7 1201 c201 38 SEC 1202 c202 e9 02 SBC #2 1203 c204 8d 4e 01 STA rMovement1 1204 c207 .L0106 ;; rMovement2 = ( rand & 6 ) 1205 c207 1206 c207 ; complex statement detected 1207 c207 20 fd f3 jsr randomize 1208 c20a 29 06 AND #6 1209 c20c 8d 53 01 STA rMovement2 1210 c20f .L0107 ;; rMovement3 = ( rand & 3 ) + 1 1211 c20f 1212 c20f ; complex statement detected 1213 c20f 20 fd f3 jsr randomize 1214 c212 29 03 AND #3 1215 c214 18 CLC 1216 c215 69 01 ADC #1 1217 c217 8d 5a 01 STA rMovement3 1218 c21a .L0108 ;; rMovement4 = ( rand & 5 ) + 2 1219 c21a 1220 c21a ; complex statement detected 1221 c21a 20 fd f3 jsr randomize 1222 c21d 29 05 AND #5 1223 c21f 18 CLC 1224 c220 69 02 ADC #2 1225 c222 8d 5b 01 STA rMovement4 1226 c225 .L0109 ;; rMovement5 = ( rand & 5 ) + 1 1227 c225 1228 c225 ; complex statement detected 1229 c225 20 fd f3 jsr randomize 1230 c228 29 05 AND #5 1231 c22a 18 CLC 1232 c22b 69 01 ADC #1 1233 c22d 8d 5c 01 STA rMovement5 1234 c230 .L0110 ;; rMovement6 = ( rand & 6 ) - 1 1235 c230 1236 c230 ; complex statement detected 1237 c230 20 fd f3 jsr randomize 1238 c233 29 06 AND #6 1239 c235 38 SEC 1240 c236 e9 01 SBC #1 1241 c238 8d 5d 01 STA rMovement6 1242 c23b .L0111 ;; rDirection = ( rand & 4 ) 1243 c23b 1244 c23b ; complex statement detected 1245 c23b 20 fd f3 jsr randomize 1246 c23e 29 04 AND #4 1247 c240 8d 4f 01 STA rDirection 1248 c243 .L0112 ;; if switchreset then reboot 1249 c243 1250 c243 20 85 f4 jsr checkresetswitch 1251 c246 d0 03 BNE .skipL0112 1252 c248 .condpart3 1253 c248 4c 72 f5 JMP START 1254 c24b .skipL0112 1255 c24b . 1256 c24b ;; 1257 c24b 1258 c24b . 1259 c24b ;; 1260 c24b 1261 c24b .L0113 ;; enemy_shotSlowdown = enemy_shotSlowdown + 1 1262 c24b 1263 c24b ad 56 01 LDA enemy_shotSlowdown 1264 c24e 18 CLC 1265 c24f 69 01 ADC #1 1266 c251 8d 56 01 STA enemy_shotSlowdown 1267 c254 .L0114 ;; if enemy_shotSlowdown > 8 then enemy_shotSlowdown = 0 1268 c254 1269 c254 a9 08 LDA #8 1270 c256 cd 56 01 CMP enemy_shotSlowdown 1271 c259 b0 05 BCS .skipL0114 1272 c25b .condpart4 1273 c25b a9 00 LDA #0 1274 c25d 8d 56 01 STA enemy_shotSlowdown 1275 c260 .skipL0114 1276 c260 . 1277 c260 ;; 1278 c260 1279 c260 .L0115 ;; bulletSlowdown = bulletSlowdown + 1 1280 c260 1281 c260 ad 55 01 LDA bulletSlowdown 1282 c263 18 CLC 1283 c264 69 01 ADC #1 1284 c266 8d 55 01 STA bulletSlowdown 1285 c269 .L0116 ;; if bulletSlowdown > 6 then bulletSlowdown = 0 1286 c269 1287 c269 a9 06 LDA #6 1288 c26b cd 55 01 CMP bulletSlowdown 1289 c26e b0 05 BCS .skipL0116 1290 c270 .condpart5 1291 c270 a9 00 LDA #0 1292 c272 8d 55 01 STA bulletSlowdown 1293 c275 .skipL0116 1294 c275 . 1295 c275 ;; 1296 c275 1297 c275 .L0117 ;; power_upSlowdown = power_upSlowdown + 1 1298 c275 1299 c275 ad 54 01 LDA power_upSlowdown 1300 c278 18 CLC 1301 c279 69 01 ADC #1 1302 c27b 8d 54 01 STA power_upSlowdown 1303 c27e .L0118 ;; if power_upSlowdown > 7 then power_upSlowdown = 0 1304 c27e 1305 c27e a9 07 LDA #7 1306 c280 cd 54 01 CMP power_upSlowdown 1307 c283 b0 05 BCS .skipL0118 1308 c285 .condpart6 1309 c285 a9 00 LDA #0 1310 c287 8d 54 01 STA power_upSlowdown 1311 c28a .skipL0118 1312 c28a . 1313 c28a ;; 1314 c28a 1315 c28a .L0119 ;; twinlaser_Slowdown = twinlaser_Slowdown + 1 1316 c28a 1317 c28a ad 68 01 LDA twinlaser_Slowdown 1318 c28d 18 CLC 1319 c28e 69 01 ADC #1 1320 c290 8d 68 01 STA twinlaser_Slowdown 1321 c293 .L0120 ;; if twinlaser_Slowdown > 5 then twinlaser_Slowdown = 0 1322 c293 1323 c293 a9 05 LDA #5 1324 c295 cd 68 01 CMP twinlaser_Slowdown 1325 c298 b0 05 BCS .skipL0120 1326 c29a .condpart7 1327 c29a a9 00 LDA #0 1328 c29c 8d 68 01 STA twinlaser_Slowdown 1329 c29f .skipL0120 1330 c29f . 1331 c29f ;; 1332 c29f 1333 c29f .L0121 ;; if joy0up && joyposup = - 2 then gosub SetBulletHome 1334 c29f 1335 c29f a9 10 lda #$10 1336 c2a1 2c 80 02 bit SWCHA 1337 c2a4 d0 10 BNE .skipL0121 1338 c2a6 .condpart8 1339 c2a6 ; complex condition detected 1340 c2a6 a9 fe LDA #254 1341 c2a8 48 PHA 1342 c2a9 ba TSX 1343 c2aa 68 PLA 1344 c2ab ad 44 01 LDA joyposup 1345 c2ae dd 01 01 CMP $101,x 1346 c2b1 d0 03 BNE .skip8then 1347 c2b3 .condpart9 1348 c2b3 20 00 d8 jsr .SetBulletHome 1349 c2b6 1350 c2b6 .skip8then 1351 c2b6 .skipL0121 1352 c2b6 .L0122 ;; if joy0down && joyposdown = - 2 then gosub SetBulletHome 1353 c2b6 1354 c2b6 a9 20 lda #$20 1355 c2b8 2c 80 02 bit SWCHA 1356 c2bb d0 10 BNE .skipL0122 1357 c2bd .condpart10 1358 c2bd ; complex condition detected 1359 c2bd a9 fe LDA #254 1360 c2bf 48 PHA 1361 c2c0 ba TSX 1362 c2c1 68 PLA 1363 c2c2 ad 45 01 LDA joyposdown 1364 c2c5 dd 01 01 CMP $101,x 1365 c2c8 d0 03 BNE .skip10then 1366 c2ca .condpart11 1367 c2ca 20 00 d8 jsr .SetBulletHome 1368 c2cd 1369 c2cd .skip10then 1370 c2cd .skipL0122 1371 c2cd .L0123 ;; if joy0up && joyposleft = - 2 then gosub SetBulletHome 1372 c2cd 1373 c2cd a9 10 lda #$10 1374 c2cf 2c 80 02 bit SWCHA 1375 c2d2 d0 10 BNE .skipL0123 1376 c2d4 .condpart12 1377 c2d4 ; complex condition detected 1378 c2d4 a9 fe LDA #254 1379 c2d6 48 PHA 1380 c2d7 ba TSX 1381 c2d8 68 PLA 1382 c2d9 ad 46 01 LDA joyposleft 1383 c2dc dd 01 01 CMP $101,x 1384 c2df d0 03 BNE .skip12then 1385 c2e1 .condpart13 1386 c2e1 20 00 d8 jsr .SetBulletHome 1387 c2e4 1388 c2e4 .skip12then 1389 c2e4 .skipL0123 1390 c2e4 .L0124 ;; if joy0down && joyposright = - 2 then gosub SetBulletHome 1391 c2e4 1392 c2e4 a9 20 lda #$20 1393 c2e6 2c 80 02 bit SWCHA 1394 c2e9 d0 10 BNE .skipL0124 1395 c2eb .condpart14 1396 c2eb ; complex condition detected 1397 c2eb a9 fe LDA #254 1398 c2ed 48 PHA 1399 c2ee ba TSX 1400 c2ef 68 PLA 1401 c2f0 ad 47 01 LDA joyposright 1402 c2f3 dd 01 01 CMP $101,x 1403 c2f6 d0 03 BNE .skip14then 1404 c2f8 .condpart15 1405 c2f8 20 00 d8 jsr .SetBulletHome 1406 c2fb 1407 c2fb .skip14then 1408 c2fb .skipL0124 1409 c2fb .L0125 ;; if joy0up then playerY = playerY - 1 : joyposup = 1 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 1410 c2fb 1411 c2fb a9 10 lda #$10 1412 c2fd 2c 80 02 bit SWCHA 1413 c300 d0 19 BNE .skipL0125 1414 c302 .condpart16 1415 c302 ad 42 01 LDA playerY 1416 c305 38 SEC 1417 c306 e9 01 SBC #1 1418 c308 8d 42 01 STA playerY 1419 c30b a9 01 LDA #1 1420 c30d 8d 44 01 STA joyposup 1421 c310 a9 00 LDA #0 1422 c312 8d 45 01 STA joyposdown 1423 c315 8d 46 01 STA joyposleft 1424 c318 8d 47 01 STA joyposright 1425 c31b .skipL0125 1426 c31b .L0126 ;; if joy0down then playerY = playerY + 1 : joyposup = 0 : joyposdown = 1 : joyposleft = 0 : joyposright = 0 1427 c31b 1428 c31b a9 20 lda #$20 1429 c31d 2c 80 02 bit SWCHA 1430 c320 d0 1b BNE .skipL0126 1431 c322 .condpart17 1432 c322 ad 42 01 LDA playerY 1433 c325 18 CLC 1434 c326 69 01 ADC #1 1435 c328 8d 42 01 STA playerY 1436 c32b a9 00 LDA #0 1437 c32d 8d 44 01 STA joyposup 1438 c330 a9 01 LDA #1 1439 c332 8d 45 01 STA joyposdown 1440 c335 a9 00 LDA #0 1441 c337 8d 46 01 STA joyposleft 1442 c33a 8d 47 01 STA joyposright 1443 c33d .skipL0126 1444 c33d .L0127 ;; if joy0left then playerX = playerX - 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 1 : joyposright = 0 1445 c33d 1446 c33d 2c 80 02 bit SWCHA 1447 c340 70 1b BVS .skipL0127 1448 c342 .condpart18 1449 c342 ad 41 01 LDA playerX 1450 c345 38 SEC 1451 c346 e9 01 SBC #1 1452 c348 8d 41 01 STA playerX 1453 c34b a9 00 LDA #0 1454 c34d 8d 44 01 STA joyposup 1455 c350 8d 45 01 STA joyposdown 1456 c353 a9 01 LDA #1 1457 c355 8d 46 01 STA joyposleft 1458 c358 a9 00 LDA #0 1459 c35a 8d 47 01 STA joyposright 1460 c35d .skipL0127 1461 c35d .L0128 ;; if joy0right then playerX = playerX + 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 1 1462 c35d 1463 c35d 2c 80 02 bit SWCHA 1464 c360 30 19 BMI .skipL0128 1465 c362 .condpart19 1466 c362 ad 41 01 LDA playerX 1467 c365 18 CLC 1468 c366 69 01 ADC #1 1469 c368 8d 41 01 STA playerX 1470 c36b a9 00 LDA #0 1471 c36d 8d 44 01 STA joyposup 1472 c370 8d 45 01 STA joyposdown 1473 c373 8d 46 01 STA joyposleft 1474 c376 a9 01 LDA #1 1475 c378 8d 47 01 STA joyposright 1476 c37b .skipL0128 1477 c37b .L0129 ;; if joy0fire && joyposup = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1478 c37b 1479 c37b 2c 02 21 bit sINPT1 1480 c37e 10 29 BPL .skipL0129 1481 c380 .condpart20 1482 c380 ad 44 01 LDA joyposup 1483 c383 c9 01 CMP #1 1484 c385 d0 22 BNE .skip20then 1485 c387 .condpart21 1486 c387 ad 49 01 LDA bulletY 1487 c38a 38 SEC 1488 c38b e9 05 SBC #5 1489 c38d 8d 49 01 STA bulletY 1490 c390 a9 01 lda #1 1491 c392 85 de sta sfxschedulelock 1492 c394 a9 2b lda #sfx_pulsecannon 1495 c39a 85 e1 sta sfxinstrumenthi 1496 c39c a9 00 lda #0 1497 c39e 85 e2 sta sfxpitchoffset ; no pitch modification 1498 c3a0 85 e3 sta sfxnoteindex ; not a musical note 1499 c3a2 20 58 f2 jsr schedulesfx 1500 c3a5 a9 00 lda #0 1501 c3a7 85 de sta sfxschedulelock 1502 c3a9 .skip20then 1503 c3a9 .skipL0129 1504 c3a9 .L0130 ;; if joy0fire && joyposdown = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1505 c3a9 1506 c3a9 2c 02 21 bit sINPT1 1507 c3ac 10 29 BPL .skipL0130 1508 c3ae .condpart22 1509 c3ae ad 45 01 LDA joyposdown 1510 c3b1 c9 01 CMP #1 1511 c3b3 d0 22 BNE .skip22then 1512 c3b5 .condpart23 1513 c3b5 ad 49 01 LDA bulletY 1514 c3b8 38 SEC 1515 c3b9 e9 05 SBC #5 1516 c3bb 8d 49 01 STA bulletY 1517 c3be a9 01 lda #1 1518 c3c0 85 de sta sfxschedulelock 1519 c3c2 a9 2b lda #sfx_pulsecannon 1522 c3c8 85 e1 sta sfxinstrumenthi 1523 c3ca a9 00 lda #0 1524 c3cc 85 e2 sta sfxpitchoffset ; no pitch modification 1525 c3ce 85 e3 sta sfxnoteindex ; not a musical note 1526 c3d0 20 58 f2 jsr schedulesfx 1527 c3d3 a9 00 lda #0 1528 c3d5 85 de sta sfxschedulelock 1529 c3d7 .skip22then 1530 c3d7 .skipL0130 1531 c3d7 .L0131 ;; if joy0fire && joyposleft = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1532 c3d7 1533 c3d7 2c 02 21 bit sINPT1 1534 c3da 10 29 BPL .skipL0131 1535 c3dc .condpart24 1536 c3dc ad 46 01 LDA joyposleft 1537 c3df c9 01 CMP #1 1538 c3e1 d0 22 BNE .skip24then 1539 c3e3 .condpart25 1540 c3e3 ad 49 01 LDA bulletY 1541 c3e6 38 SEC 1542 c3e7 e9 05 SBC #5 1543 c3e9 8d 49 01 STA bulletY 1544 c3ec a9 01 lda #1 1545 c3ee 85 de sta sfxschedulelock 1546 c3f0 a9 2b lda #sfx_pulsecannon 1549 c3f6 85 e1 sta sfxinstrumenthi 1550 c3f8 a9 00 lda #0 1551 c3fa 85 e2 sta sfxpitchoffset ; no pitch modification 1552 c3fc 85 e3 sta sfxnoteindex ; not a musical note 1553 c3fe 20 58 f2 jsr schedulesfx 1554 c401 a9 00 lda #0 1555 c403 85 de sta sfxschedulelock 1556 c405 .skip24then 1557 c405 .skipL0131 1558 c405 .L0132 ;; if joy0fire && joyposright = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1559 c405 1560 c405 2c 02 21 bit sINPT1 1561 c408 10 29 BPL .skipL0132 1562 c40a .condpart26 1563 c40a ad 47 01 LDA joyposright 1564 c40d c9 01 CMP #1 1565 c40f d0 22 BNE .skip26then 1566 c411 .condpart27 1567 c411 ad 49 01 LDA bulletY 1568 c414 38 SEC 1569 c415 e9 05 SBC #5 1570 c417 8d 49 01 STA bulletY 1571 c41a a9 01 lda #1 1572 c41c 85 de sta sfxschedulelock 1573 c41e a9 2b lda #sfx_pulsecannon 1576 c424 85 e1 sta sfxinstrumenthi 1577 c426 a9 00 lda #0 1578 c428 85 e2 sta sfxpitchoffset ; no pitch modification 1579 c42a 85 e3 sta sfxnoteindex ; not a musical note 1580 c42c 20 58 f2 jsr schedulesfx 1581 c42f a9 00 lda #0 1582 c431 85 de sta sfxschedulelock 1583 c433 .skip26then 1584 c433 .skipL0132 1585 c433 .L0133 ;; if !joy0fire then bulletX = playerX + 2 : bulletY = playerY - 8 1586 c433 1587 c433 2c 02 21 bit sINPT1 1588 c436 30 12 BMI .skipL0133 1589 c438 .condpart28 1590 c438 ad 41 01 LDA playerX 1591 c43b 18 CLC 1592 c43c 69 02 ADC #2 1593 c43e 8d 48 01 STA bulletX 1594 c441 ad 42 01 LDA playerY 1595 c444 38 SEC 1596 c445 e9 08 SBC #8 1597 c447 8d 49 01 STA bulletY 1598 c44a .skipL0133 1599 c44a . 1600 c44a ;; 1601 c44a 1602 c44a . 1603 c44a ;; 1604 c44a 1605 c44a . 1606 c44a ;; 1607 c44a 1608 c44a .L0134 ;; if playerX > 152 then playerX = playerX - 1 1609 c44a 1610 c44a a9 98 LDA #152 1611 c44c cd 41 01 CMP playerX 1612 c44f b0 09 BCS .skipL0134 1613 c451 .condpart29 1614 c451 ad 41 01 LDA playerX 1615 c454 38 SEC 1616 c455 e9 01 SBC #1 1617 c457 8d 41 01 STA playerX 1618 c45a .skipL0134 1619 c45a .L0135 ;; if playerX < 1 then playerX = playerX + 1 1620 c45a 1621 c45a ad 41 01 LDA playerX 1622 c45d c9 01 CMP #1 1623 c45f b0 09 BCS .skipL0135 1624 c461 .condpart30 1625 c461 ad 41 01 LDA playerX 1626 c464 18 CLC 1627 c465 69 01 ADC #1 1628 c467 8d 41 01 STA playerX 1629 c46a .skipL0135 1630 c46a .L0136 ;; if playerY > 177 then playerY = playerY - 1 1631 c46a 1632 c46a a9 b1 LDA #177 1633 c46c cd 42 01 CMP playerY 1634 c46f b0 09 BCS .skipL0136 1635 c471 .condpart31 1636 c471 ad 42 01 LDA playerY 1637 c474 38 SEC 1638 c475 e9 01 SBC #1 1639 c477 8d 42 01 STA playerY 1640 c47a .skipL0136 1641 c47a .L0137 ;; if playerY < 1 then playerY = playerY + 1 1642 c47a 1643 c47a ad 42 01 LDA playerY 1644 c47d c9 01 CMP #1 1645 c47f b0 09 BCS .skipL0137 1646 c481 .condpart32 1647 c481 ad 42 01 LDA playerY 1648 c484 18 CLC 1649 c485 69 01 ADC #1 1650 c487 8d 42 01 STA playerY 1651 c48a .skipL0137 1652 c48a .L0138 ;; if bulletY > 183 then bulletY = bulletY - 1 1653 c48a 1654 c48a a9 b7 LDA #183 1655 c48c cd 49 01 CMP bulletY 1656 c48f b0 09 BCS .skipL0138 1657 c491 .condpart33 1658 c491 ad 49 01 LDA bulletY 1659 c494 38 SEC 1660 c495 e9 01 SBC #1 1661 c497 8d 49 01 STA bulletY 1662 c49a .skipL0138 1663 c49a .L0139 ;; if bulletY < 1 then bulletY = bulletY + 1 1664 c49a 1665 c49a ad 49 01 LDA bulletY 1666 c49d c9 01 CMP #1 1667 c49f b0 09 BCS .skipL0139 1668 c4a1 .condpart34 1669 c4a1 ad 49 01 LDA bulletY 1670 c4a4 18 CLC 1671 c4a5 69 01 ADC #1 1672 c4a7 8d 49 01 STA bulletY 1673 c4aa .skipL0139 1674 c4aa .L0140 ;; if twinlaserY > 183 then twinlaserY = twinlaserY - 1 1675 c4aa 1676 c4aa a9 b7 LDA #183 1677 c4ac cd 66 01 CMP twinlaserY 1678 c4af b0 09 BCS .skipL0140 1679 c4b1 .condpart35 1680 c4b1 ad 66 01 LDA twinlaserY 1681 c4b4 38 SEC 1682 c4b5 e9 01 SBC #1 1683 c4b7 8d 66 01 STA twinlaserY 1684 c4ba .skipL0140 1685 c4ba .L0141 ;; if twinlaserY < 1 then twinlaserY = twinlaserY + 1 1686 c4ba 1687 c4ba ad 66 01 LDA twinlaserY 1688 c4bd c9 01 CMP #1 1689 c4bf b0 09 BCS .skipL0141 1690 c4c1 .condpart36 1691 c4c1 ad 66 01 LDA twinlaserY 1692 c4c4 18 CLC 1693 c4c5 69 01 ADC #1 1694 c4c7 8d 66 01 STA twinlaserY 1695 c4ca .skipL0141 1696 c4ca . 1697 c4ca ;; 1698 c4ca 1699 c4ca .L0142 ;; if boxcollision ( playerX , playerY , 8 , 16 , enemy_shotX , enemy_shotY , 4 , 8 ) then enemy_shotX = 200 : enemy_shotY = 200 : playerFlag = 1 : lives = lives - 1 : playsfx sfx_explosion : goto lose_a_life 1700 c4ca 1701 c4ca 1702 c4ca 18 clc ; one clc only. If we overflow we're screwed anyway. 1703 c4cb a0 07 ldy #(8-1) 1704 c4cd 84 44 sty temp3 1705 c4cf a0 0f ldy #(16-1) 1706 c4d1 84 45 sty temp4 1707 c4d3 ad 4a 01 lda enemy_shotX 1708 c4d6 69 30 adc #48 1709 c4d8 85 46 sta temp5 1710 c4da ad 4b 01 lda enemy_shotY 1711 c4dd 69 20 adc #((256-WSCREENHEIGHT)/2) 1712 c4df 85 47 sta temp6 1713 c4e1 a0 03 ldy #(4-1) 1714 c4e3 84 48 sty temp7 1715 c4e5 a0 07 ldy #(8-1) 1716 c4e7 84 49 sty temp8 1717 c4e9 ad 42 01 lda playerY 1718 c4ec 69 20 adc #((256-WSCREENHEIGHT)/2) 1719 c4ee a8 tay 1720 c4ef ad 41 01 lda playerX 1721 c4f2 69 30 adc #48 1722 c4f4 20 d6 f3 jsr boxcollision 1723 c4f7 1724 c4f7 90 32 BCC .skipL0142 1725 c4f9 .condpart37 1726 c4f9 a9 c8 LDA #200 1727 c4fb 8d 4a 01 STA enemy_shotX 1728 c4fe 8d 4b 01 STA enemy_shotY 1729 c501 a9 01 LDA #1 1730 c503 8d 4d 01 STA playerFlag 1731 c506 ad 64 01 LDA lives 1732 c509 38 SEC 1733 c50a e9 01 SBC #1 1734 c50c 8d 64 01 STA lives 1735 c50f a9 01 lda #1 1736 c511 85 de sta sfxschedulelock 1737 c513 a9 b5 lda #sfx_explosion 1740 c519 85 e1 sta sfxinstrumenthi 1741 c51b a9 00 lda #0 1742 c51d 85 e2 sta sfxpitchoffset ; no pitch modification 1743 c51f 85 e3 sta sfxnoteindex ; not a musical note 1744 c521 20 58 f2 jsr schedulesfx 1745 c524 a9 00 lda #0 1746 c526 85 de sta sfxschedulelock 1747 c528 4c 5d d9 jmp .lose_a_life 1748 c52b 1749 c52b .skipL0142 1750 c52b .L0143 ;; if boxcollision ( playerX , playerY , 8 , 16 , power_upX , power_upY , 8 , 8 ) then power_upX = 208 : power_upY = 208 : playerFlag = 1 : playsfx sfx_bling : goto power_up_obtained 1751 c52b 1752 c52b 1753 c52b 18 clc ; one clc only. If we overflow we're screwed anyway. 1754 c52c a0 07 ldy #(8-1) 1755 c52e 84 44 sty temp3 1756 c530 a0 0f ldy #(16-1) 1757 c532 84 45 sty temp4 1758 c534 ad 50 01 lda power_upX 1759 c537 69 30 adc #48 1760 c539 85 46 sta temp5 1761 c53b ad 51 01 lda power_upY 1762 c53e 69 20 adc #((256-WSCREENHEIGHT)/2) 1763 c540 85 47 sta temp6 1764 c542 a0 07 ldy #(8-1) 1765 c544 84 48 sty temp7 1766 c546 a0 07 ldy #(8-1) 1767 c548 84 49 sty temp8 1768 c54a ad 42 01 lda playerY 1769 c54d 69 20 adc #((256-WSCREENHEIGHT)/2) 1770 c54f a8 tay 1771 c550 ad 41 01 lda playerX 1772 c553 69 30 adc #48 1773 c555 20 d6 f3 jsr boxcollision 1774 c558 1775 c558 90 29 BCC .skipL0143 1776 c55a .condpart38 1777 c55a a9 d0 LDA #208 1778 c55c 8d 50 01 STA power_upX 1779 c55f 8d 51 01 STA power_upY 1780 c562 a9 01 LDA #1 1781 c564 8d 4d 01 STA playerFlag 1782 c567 a9 01 lda #1 1783 c569 85 de sta sfxschedulelock 1784 c56b a9 f2 lda #sfx_bling 1787 c571 85 e1 sta sfxinstrumenthi 1788 c573 a9 00 lda #0 1789 c575 85 e2 sta sfxpitchoffset ; no pitch modification 1790 c577 85 e3 sta sfxnoteindex ; not a musical note 1791 c579 20 58 f2 jsr schedulesfx 1792 c57c a9 00 lda #0 1793 c57e 85 de sta sfxschedulelock 1794 c580 4c 26 d8 jmp .power_up_obtained 1795 c583 1796 c583 .skipL0143 1797 c583 .L0144 ;; if boxcollision ( playerX , playerY , 8 , 16 , enemy01_X , enemy01_Y , 8 , 16 ) then enemy01_X = 200 : enemy01_Y = 200 : playerFlag = 1 : lives = lives - 1 : playsfx sfx_explosion : goto lose_a_life 1798 c583 1799 c583 1800 c583 18 clc ; one clc only. If we overflow we're screwed anyway. 1801 c584 a0 07 ldy #(8-1) 1802 c586 84 44 sty temp3 1803 c588 a0 0f ldy #(16-1) 1804 c58a 84 45 sty temp4 1805 c58c ad 57 01 lda enemy01_X 1806 c58f 69 30 adc #48 1807 c591 85 46 sta temp5 1808 c593 ad 58 01 lda enemy01_Y 1809 c596 69 20 adc #((256-WSCREENHEIGHT)/2) 1810 c598 85 47 sta temp6 1811 c59a a0 07 ldy #(8-1) 1812 c59c 84 48 sty temp7 1813 c59e a0 0f ldy #(16-1) 1814 c5a0 84 49 sty temp8 1815 c5a2 ad 42 01 lda playerY 1816 c5a5 69 20 adc #((256-WSCREENHEIGHT)/2) 1817 c5a7 a8 tay 1818 c5a8 ad 41 01 lda playerX 1819 c5ab 69 30 adc #48 1820 c5ad 20 d6 f3 jsr boxcollision 1821 c5b0 1822 c5b0 90 32 BCC .skipL0144 1823 c5b2 .condpart39 1824 c5b2 a9 c8 LDA #200 1825 c5b4 8d 57 01 STA enemy01_X 1826 c5b7 8d 58 01 STA enemy01_Y 1827 c5ba a9 01 LDA #1 1828 c5bc 8d 4d 01 STA playerFlag 1829 c5bf ad 64 01 LDA lives 1830 c5c2 38 SEC 1831 c5c3 e9 01 SBC #1 1832 c5c5 8d 64 01 STA lives 1833 c5c8 a9 01 lda #1 1834 c5ca 85 de sta sfxschedulelock 1835 c5cc a9 b5 lda #sfx_explosion 1838 c5d2 85 e1 sta sfxinstrumenthi 1839 c5d4 a9 00 lda #0 1840 c5d6 85 e2 sta sfxpitchoffset ; no pitch modification 1841 c5d8 85 e3 sta sfxnoteindex ; not a musical note 1842 c5da 20 58 f2 jsr schedulesfx 1843 c5dd a9 00 lda #0 1844 c5df 85 de sta sfxschedulelock 1845 c5e1 4c 5d d9 jmp .lose_a_life 1846 c5e4 1847 c5e4 .skipL0144 1848 c5e4 .L0145 ;; 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 1849 c5e4 1850 c5e4 1851 c5e4 18 clc ; one clc only. If we overflow we're screwed anyway. 1852 c5e5 a0 07 ldy #(8-1) 1853 c5e7 84 44 sty temp3 1854 c5e9 a0 0f ldy #(16-1) 1855 c5eb 84 45 sty temp4 1856 c5ed ad 60 01 lda extra_shipX 1857 c5f0 69 30 adc #48 1858 c5f2 85 46 sta temp5 1859 c5f4 ad 61 01 lda extra_shipY 1860 c5f7 69 20 adc #((256-WSCREENHEIGHT)/2) 1861 c5f9 85 47 sta temp6 1862 c5fb a0 07 ldy #(8-1) 1863 c5fd 84 48 sty temp7 1864 c5ff a0 07 ldy #(8-1) 1865 c601 84 49 sty temp8 1866 c603 ad 42 01 lda playerY 1867 c606 69 20 adc #((256-WSCREENHEIGHT)/2) 1868 c608 a8 tay 1869 c609 ad 41 01 lda playerX 1870 c60c 69 30 adc #48 1871 c60e 20 d6 f3 jsr boxcollision 1872 c611 1873 c611 90 2f BCC .skipL0145 1874 c613 .condpart40 1875 c613 a9 c8 LDA #200 1876 c615 8d 60 01 STA extra_shipX 1877 c618 8d 61 01 STA extra_shipY 1878 c61b a9 01 LDA #1 1879 c61d 8d 62 01 STA extra_shipFlag 1880 c620 ad 64 01 LDA lives 1881 c623 18 CLC 1882 c624 69 01 ADC #1 1883 c626 8d 64 01 STA lives 1884 c629 a9 01 lda #1 1885 c62b 85 de sta sfxschedulelock 1886 c62d a9 f2 lda #sfx_bling 1889 c633 85 e1 sta sfxinstrumenthi 1890 c635 a9 00 lda #0 1891 c637 85 e2 sta sfxpitchoffset ; no pitch modification 1892 c639 85 e3 sta sfxnoteindex ; not a musical note 1893 c63b 20 58 f2 jsr schedulesfx 1894 c63e a9 00 lda #0 1895 c640 85 de sta sfxschedulelock 1896 c642 .skipL0145 1897 c642 .L0146 ;; if boxcollision ( bulletX , bulletY , 4 , 8 , enemy01_X , enemy01_Y , 8 , 16 ) then bulletX = - 8 : bulletY = 0 : enemy01_Flag = 1 1898 c642 1899 c642 1900 c642 18 clc ; one clc only. If we overflow we're screwed anyway. 1901 c643 a0 03 ldy #(4-1) 1902 c645 84 44 sty temp3 1903 c647 a0 07 ldy #(8-1) 1904 c649 84 45 sty temp4 1905 c64b ad 57 01 lda enemy01_X 1906 c64e 69 30 adc #48 1907 c650 85 46 sta temp5 1908 c652 ad 58 01 lda enemy01_Y 1909 c655 69 20 adc #((256-WSCREENHEIGHT)/2) 1910 c657 85 47 sta temp6 1911 c659 a0 07 ldy #(8-1) 1912 c65b 84 48 sty temp7 1913 c65d a0 0f ldy #(16-1) 1914 c65f 84 49 sty temp8 1915 c661 ad 49 01 lda bulletY 1916 c664 69 20 adc #((256-WSCREENHEIGHT)/2) 1917 c666 a8 tay 1918 c667 ad 48 01 lda bulletX 1919 c66a 69 30 adc #48 1920 c66c 20 d6 f3 jsr boxcollision 1921 c66f 1922 c66f 90 0f BCC .skipL0146 1923 c671 .condpart41 1924 c671 a9 f8 LDA #248 1925 c673 8d 48 01 STA bulletX 1926 c676 a9 00 LDA #0 1927 c678 8d 49 01 STA bulletY 1928 c67b a9 01 LDA #1 1929 c67d 8d 59 01 STA enemy01_Flag 1930 c680 .skipL0146 1931 c680 .L0147 ;; if boxcollision ( twinlaserX , twinlaserY , 4 , 16 , enemy01_X , enemy01_Y , 8 , 16 ) then twinlaserX = - 8 : twinlaserY = 0 : enemy01_Flag = 1 1932 c680 1933 c680 1934 c680 18 clc ; one clc only. If we overflow we're screwed anyway. 1935 c681 a0 03 ldy #(4-1) 1936 c683 84 44 sty temp3 1937 c685 a0 0f ldy #(16-1) 1938 c687 84 45 sty temp4 1939 c689 ad 57 01 lda enemy01_X 1940 c68c 69 30 adc #48 1941 c68e 85 46 sta temp5 1942 c690 ad 58 01 lda enemy01_Y 1943 c693 69 20 adc #((256-WSCREENHEIGHT)/2) 1944 c695 85 47 sta temp6 1945 c697 a0 07 ldy #(8-1) 1946 c699 84 48 sty temp7 1947 c69b a0 0f ldy #(16-1) 1948 c69d 84 49 sty temp8 1949 c69f ad 66 01 lda twinlaserY 1950 c6a2 69 20 adc #((256-WSCREENHEIGHT)/2) 1951 c6a4 a8 tay 1952 c6a5 ad 65 01 lda twinlaserX 1953 c6a8 69 30 adc #48 1954 c6aa 20 d6 f3 jsr boxcollision 1955 c6ad 1956 c6ad 90 0f BCC .skipL0147 1957 c6af .condpart42 1958 c6af a9 f8 LDA #248 1959 c6b1 8d 65 01 STA twinlaserX 1960 c6b4 a9 00 LDA #0 1961 c6b6 8d 66 01 STA twinlaserY 1962 c6b9 a9 01 LDA #1 1963 c6bb 8d 59 01 STA enemy01_Flag 1964 c6be .skipL0147 1965 c6be . 1966 c6be ;; 1967 c6be 1968 c6be .L0148 ;; if bulletX > enemy01_X && bulletX < ( enemy01_X + 16 ) && bulletY > enemy01_Y && bulletY < ( enemy01_Y + 16 ) then enemy01_Flag = 1 : score0 = score0 + 1 : playsfx sfx_explosion 1969 c6be 1970 c6be ad 57 01 LDA enemy01_X 1971 c6c1 cd 48 01 CMP bulletX 1972 c6c4 b0 63 BCS .skipL0148 1973 c6c6 .condpart43 1974 c6c6 ; complex condition detected 1975 c6c6 ; complex statement detected 1976 c6c6 ad 57 01 LDA enemy01_X 1977 c6c9 18 CLC 1978 c6ca 69 10 ADC #16 1979 c6cc 48 PHA 1980 c6cd ba TSX 1981 c6ce 68 PLA 1982 c6cf ad 48 01 LDA bulletX 1983 c6d2 dd 01 01 CMP $101,x 1984 c6d5 b0 52 BCS .skip43then 1985 c6d7 .condpart44 1986 c6d7 ad 58 01 LDA enemy01_Y 1987 c6da cd 49 01 CMP bulletY 1988 c6dd b0 4a BCS .skip44then 1989 c6df .condpart45 1990 c6df ; complex condition detected 1991 c6df ; complex statement detected 1992 c6df ad 58 01 LDA enemy01_Y 1993 c6e2 18 CLC 1994 c6e3 69 10 ADC #16 1995 c6e5 48 PHA 1996 c6e6 ba TSX 1997 c6e7 68 PLA 1998 c6e8 ad 49 01 LDA bulletY 1999 c6eb dd 01 01 CMP $101,x 2000 c6ee b0 39 BCS .skip45then 2001 c6f0 .condpart46 2002 c6f0 a9 01 LDA #1 2003 c6f2 8d 59 01 STA enemy01_Flag 2004 c6f5 f8 SED 2005 c6f6 18 CLC 2006 c6f7 ad a8 01 LDA score0+2 2007 c6fa 69 01 ADC #$01 2008 c6fc 8d a8 01 STA score0+2 2009 c6ff ad a7 01 LDA score0+1 2010 c702 69 00 ADC #$00 2011 c704 8d a7 01 STA score0+1 2012 c707 ad a6 01 LDA score0 2013 c70a 69 00 ADC #$00 2014 c70c 8d a6 01 STA score0 2015 c70f d8 CLD 2016 c710 a9 01 lda #1 2017 c712 85 de sta sfxschedulelock 2018 c714 a9 b5 lda #sfx_explosion 2021 c71a 85 e1 sta sfxinstrumenthi 2022 c71c a9 00 lda #0 2023 c71e 85 e2 sta sfxpitchoffset ; no pitch modification 2024 c720 85 e3 sta sfxnoteindex ; not a musical note 2025 c722 20 58 f2 jsr schedulesfx 2026 c725 a9 00 lda #0 2027 c727 85 de sta sfxschedulelock 2028 c729 .skip45then 2029 c729 .skip44then 2030 c729 .skip43then 2031 c729 .skipL0148 2032 c729 .L0149 ;; if twinlaserX > enemy01_X && twinlaserX < ( enemy01_X + 16 ) && twinlaserY > enemy01_Y && twinlaserY < ( enemy01_Y + 16 ) then enemy01_Flag = 1 : score0 = score0 + 1 : playsfx sfx_explosion 2033 c729 2034 c729 ad 57 01 LDA enemy01_X 2035 c72c cd 65 01 CMP twinlaserX 2036 c72f b0 63 BCS .skipL0149 2037 c731 .condpart47 2038 c731 ; complex condition detected 2039 c731 ; complex statement detected 2040 c731 ad 57 01 LDA enemy01_X 2041 c734 18 CLC 2042 c735 69 10 ADC #16 2043 c737 48 PHA 2044 c738 ba TSX 2045 c739 68 PLA 2046 c73a ad 65 01 LDA twinlaserX 2047 c73d dd 01 01 CMP $101,x 2048 c740 b0 52 BCS .skip47then 2049 c742 .condpart48 2050 c742 ad 58 01 LDA enemy01_Y 2051 c745 cd 66 01 CMP twinlaserY 2052 c748 b0 4a BCS .skip48then 2053 c74a .condpart49 2054 c74a ; complex condition detected 2055 c74a ; complex statement detected 2056 c74a ad 58 01 LDA enemy01_Y 2057 c74d 18 CLC 2058 c74e 69 10 ADC #16 2059 c750 48 PHA 2060 c751 ba TSX 2061 c752 68 PLA 2062 c753 ad 66 01 LDA twinlaserY 2063 c756 dd 01 01 CMP $101,x 2064 c759 b0 39 BCS .skip49then 2065 c75b .condpart50 2066 c75b a9 01 LDA #1 2067 c75d 8d 59 01 STA enemy01_Flag 2068 c760 f8 SED 2069 c761 18 CLC 2070 c762 ad a8 01 LDA score0+2 2071 c765 69 01 ADC #$01 2072 c767 8d a8 01 STA score0+2 2073 c76a ad a7 01 LDA score0+1 2074 c76d 69 00 ADC #$00 2075 c76f 8d a7 01 STA score0+1 2076 c772 ad a6 01 LDA score0 2077 c775 69 00 ADC #$00 2078 c777 8d a6 01 STA score0 2079 c77a d8 CLD 2080 c77b a9 01 lda #1 2081 c77d 85 de sta sfxschedulelock 2082 c77f a9 b5 lda #sfx_explosion 2085 c785 85 e1 sta sfxinstrumenthi 2086 c787 a9 00 lda #0 2087 c789 85 e2 sta sfxpitchoffset ; no pitch modification 2088 c78b 85 e3 sta sfxnoteindex ; not a musical note 2089 c78d 20 58 f2 jsr schedulesfx 2090 c790 a9 00 lda #0 2091 c792 85 de sta sfxschedulelock 2092 c794 .skip49then 2093 c794 .skip48then 2094 c794 .skip47then 2095 c794 .skipL0149 2096 c794 . 2097 c794 ;; 2098 c794 2099 c794 .L0150 ;; if enemy_shotX > 160 then enemy_shotX = enemy_shotX - 1 2100 c794 2101 c794 a9 a0 LDA #160 2102 c796 cd 4a 01 CMP enemy_shotX 2103 c799 b0 09 BCS .skipL0150 2104 c79b .condpart51 2105 c79b ad 4a 01 LDA enemy_shotX 2106 c79e 38 SEC 2107 c79f e9 01 SBC #1 2108 c7a1 8d 4a 01 STA enemy_shotX 2109 c7a4 .skipL0150 2110 c7a4 .L0151 ;; if enemy_shotX < 1 then enemy_shotX = enemy_shotX + 1 2111 c7a4 2112 c7a4 ad 4a 01 LDA enemy_shotX 2113 c7a7 c9 01 CMP #1 2114 c7a9 b0 09 BCS .skipL0151 2115 c7ab .condpart52 2116 c7ab ad 4a 01 LDA enemy_shotX 2117 c7ae 18 CLC 2118 c7af 69 01 ADC #1 2119 c7b1 8d 4a 01 STA enemy_shotX 2120 c7b4 .skipL0151 2121 c7b4 .L0152 ;; if enemy_shotY > 191 then enemy_shotY = enemy_shotY - 1 2122 c7b4 2123 c7b4 a9 bf LDA #191 2124 c7b6 cd 4b 01 CMP enemy_shotY 2125 c7b9 b0 09 BCS .skipL0152 2126 c7bb .condpart53 2127 c7bb ad 4b 01 LDA enemy_shotY 2128 c7be 38 SEC 2129 c7bf e9 01 SBC #1 2130 c7c1 8d 4b 01 STA enemy_shotY 2131 c7c4 .skipL0152 2132 c7c4 .L0153 ;; if enemy_shotY < 1 then enemy_shotY = enemy_shotY + 1 2133 c7c4 2134 c7c4 ad 4b 01 LDA enemy_shotY 2135 c7c7 c9 01 CMP #1 2136 c7c9 b0 09 BCS .skipL0153 2137 c7cb .condpart54 2138 c7cb ad 4b 01 LDA enemy_shotY 2139 c7ce 18 CLC 2140 c7cf 69 01 ADC #1 2141 c7d1 8d 4b 01 STA enemy_shotY 2142 c7d4 .skipL0153 2143 c7d4 .L0154 ;; if power_upX > 155 then power_upX = power_upX - 5 2144 c7d4 2145 c7d4 a9 9b LDA #155 2146 c7d6 cd 50 01 CMP power_upX 2147 c7d9 b0 09 BCS .skipL0154 2148 c7db .condpart55 2149 c7db ad 50 01 LDA power_upX 2150 c7de 38 SEC 2151 c7df e9 05 SBC #5 2152 c7e1 8d 50 01 STA power_upX 2153 c7e4 .skipL0154 2154 c7e4 .L0155 ;; if power_upX < 1 then power_upX = power_upX + 5 2155 c7e4 2156 c7e4 ad 50 01 LDA power_upX 2157 c7e7 c9 01 CMP #1 2158 c7e9 b0 09 BCS .skipL0155 2159 c7eb .condpart56 2160 c7eb ad 50 01 LDA power_upX 2161 c7ee 18 CLC 2162 c7ef 69 05 ADC #5 2163 c7f1 8d 50 01 STA power_upX 2164 c7f4 .skipL0155 2165 c7f4 .L0156 ;; if power_upY > 191 then power_upY = power_upY - 5 2166 c7f4 2167 c7f4 a9 bf LDA #191 2168 c7f6 cd 51 01 CMP power_upY 2169 c7f9 b0 09 BCS .skipL0156 2170 c7fb .condpart57 2171 c7fb ad 51 01 LDA power_upY 2172 c7fe 38 SEC 2173 c7ff e9 05 SBC #5 2174 c801 8d 51 01 STA power_upY 2175 c804 .skipL0156 2176 c804 .L0157 ;; if power_upY < 1 then power_upY = power_upY + 5 2177 c804 2178 c804 ad 51 01 LDA power_upY 2179 c807 c9 01 CMP #1 2180 c809 b0 09 BCS .skipL0157 2181 c80b .condpart58 2182 c80b ad 51 01 LDA power_upY 2183 c80e 18 CLC 2184 c80f 69 05 ADC #5 2185 c811 8d 51 01 STA power_upY 2186 c814 .skipL0157 2187 c814 .L0158 ;; if enemy01_X > 160 then enemy01_X = enemy01_X - 1 2188 c814 2189 c814 a9 a0 LDA #160 2190 c816 cd 57 01 CMP enemy01_X 2191 c819 b0 09 BCS .skipL0158 2192 c81b .condpart59 2193 c81b ad 57 01 LDA enemy01_X 2194 c81e 38 SEC 2195 c81f e9 01 SBC #1 2196 c821 8d 57 01 STA enemy01_X 2197 c824 .skipL0158 2198 c824 .L0159 ;; if enemy01_X < 1 then enemy01_X = enemy01_X + 1 2199 c824 2200 c824 ad 57 01 LDA enemy01_X 2201 c827 c9 01 CMP #1 2202 c829 b0 09 BCS .skipL0159 2203 c82b .condpart60 2204 c82b ad 57 01 LDA enemy01_X 2205 c82e 18 CLC 2206 c82f 69 01 ADC #1 2207 c831 8d 57 01 STA enemy01_X 2208 c834 .skipL0159 2209 c834 .L0160 ;; if enemy01_Y > 220 then enemy01_Y = enemy01_Y - 1 2210 c834 2211 c834 a9 dc LDA #220 2212 c836 cd 58 01 CMP enemy01_Y 2213 c839 b0 09 BCS .skipL0160 2214 c83b .condpart61 2215 c83b ad 58 01 LDA enemy01_Y 2216 c83e 38 SEC 2217 c83f e9 01 SBC #1 2218 c841 8d 58 01 STA enemy01_Y 2219 c844 .skipL0160 2220 c844 .L0161 ;; if enemy01_Y < - 16 then enemy01_Y = enemy01_Y + 1 2221 c844 2222 c844 ; complex condition detected 2223 c844 a9 f0 LDA #240 2224 c846 48 PHA 2225 c847 ba TSX 2226 c848 68 PLA 2227 c849 ad 58 01 LDA enemy01_Y 2228 c84c dd 01 01 CMP $101,x 2229 c84f b0 09 BCS .skipL0161 2230 c851 .condpart62 2231 c851 ad 58 01 LDA enemy01_Y 2232 c854 18 CLC 2233 c855 69 01 ADC #1 2234 c857 8d 58 01 STA enemy01_Y 2235 c85a .skipL0161 2236 c85a .L0162 ;; if extra_shipX > 160 then extra_shipX = extra_shipX - 1 2237 c85a 2238 c85a a9 a0 LDA #160 2239 c85c cd 60 01 CMP extra_shipX 2240 c85f b0 09 BCS .skipL0162 2241 c861 .condpart63 2242 c861 ad 60 01 LDA extra_shipX 2243 c864 38 SEC 2244 c865 e9 01 SBC #1 2245 c867 8d 60 01 STA extra_shipX 2246 c86a .skipL0162 2247 c86a .L0163 ;; if extra_shipX < 1 then extra_shipX = extra_shipX + 1 2248 c86a 2249 c86a ad 60 01 LDA extra_shipX 2250 c86d c9 01 CMP #1 2251 c86f b0 09 BCS .skipL0163 2252 c871 .condpart64 2253 c871 ad 60 01 LDA extra_shipX 2254 c874 18 CLC 2255 c875 69 01 ADC #1 2256 c877 8d 60 01 STA extra_shipX 2257 c87a .skipL0163 2258 c87a .L0164 ;; if extra_shipY > 191 then extra_shipY = extra_shipY - 1 2259 c87a 2260 c87a a9 bf LDA #191 2261 c87c cd 61 01 CMP extra_shipY 2262 c87f b0 09 BCS .skipL0164 2263 c881 .condpart65 2264 c881 ad 61 01 LDA extra_shipY 2265 c884 38 SEC 2266 c885 e9 01 SBC #1 2267 c887 8d 61 01 STA extra_shipY 2268 c88a .skipL0164 2269 c88a .L0165 ;; if extra_shipY < 1 then extra_shipY = extra_shipY + 1 2270 c88a 2271 c88a ad 61 01 LDA extra_shipY 2272 c88d c9 01 CMP #1 2273 c88f b0 09 BCS .skipL0165 2274 c891 .condpart66 2275 c891 ad 61 01 LDA extra_shipY 2276 c894 18 CLC 2277 c895 69 01 ADC #1 2278 c897 8d 61 01 STA extra_shipY 2279 c89a .skipL0165 2280 c89a . 2281 c89a ;; 2282 c89a 2283 c89a .L0166 ;; if rDirection = 0 then enemy_shotX = enemy_shotX + rMovement1 : enemy_shotY = enemy_shotY + rMovement2 2284 c89a 2285 c89a ad 4f 01 LDA rDirection 2286 c89d c9 00 CMP #0 2287 c89f d0 14 BNE .skipL0166 2288 c8a1 .condpart67 2289 c8a1 ad 4a 01 LDA enemy_shotX 2290 c8a4 18 CLC 2291 c8a5 6d 4e 01 ADC rMovement1 2292 c8a8 8d 4a 01 STA enemy_shotX 2293 c8ab ad 4b 01 LDA enemy_shotY 2294 c8ae 18 CLC 2295 c8af 6d 53 01 ADC rMovement2 2296 c8b2 8d 4b 01 STA enemy_shotY 2297 c8b5 .skipL0166 2298 c8b5 .L0167 ;; if rDirection = 1 then enemy_shotX = enemy_shotX + rMovement3 : enemy_shotY = enemy_shotY + rMovement4 2299 c8b5 2300 c8b5 ad 4f 01 LDA rDirection 2301 c8b8 c9 01 CMP #1 2302 c8ba d0 14 BNE .skipL0167 2303 c8bc .condpart68 2304 c8bc ad 4a 01 LDA enemy_shotX 2305 c8bf 18 CLC 2306 c8c0 6d 5a 01 ADC rMovement3 2307 c8c3 8d 4a 01 STA enemy_shotX 2308 c8c6 ad 4b 01 LDA enemy_shotY 2309 c8c9 18 CLC 2310 c8ca 6d 5b 01 ADC rMovement4 2311 c8cd 8d 4b 01 STA enemy_shotY 2312 c8d0 .skipL0167 2313 c8d0 .L0168 ;; if rDirection = 2 then enemy_shotX = enemy_shotX + rMovement5 : enemy_shotY = enemy_shotY + rMovement6 2314 c8d0 2315 c8d0 ad 4f 01 LDA rDirection 2316 c8d3 c9 02 CMP #2 2317 c8d5 d0 14 BNE .skipL0168 2318 c8d7 .condpart69 2319 c8d7 ad 4a 01 LDA enemy_shotX 2320 c8da 18 CLC 2321 c8db 6d 5c 01 ADC rMovement5 2322 c8de 8d 4a 01 STA enemy_shotX 2323 c8e1 ad 4b 01 LDA enemy_shotY 2324 c8e4 18 CLC 2325 c8e5 6d 5d 01 ADC rMovement6 2326 c8e8 8d 4b 01 STA enemy_shotY 2327 c8eb .skipL0168 2328 c8eb .L0169 ;; if rDirection = 3 then enemy_shotX = enemy_shotX + rMovement4 : enemy_shotY = enemy_shotY + rMovement2 2329 c8eb 2330 c8eb ad 4f 01 LDA rDirection 2331 c8ee c9 03 CMP #3 2332 c8f0 d0 14 BNE .skipL0169 2333 c8f2 .condpart70 2334 c8f2 ad 4a 01 LDA enemy_shotX 2335 c8f5 18 CLC 2336 c8f6 6d 5b 01 ADC rMovement4 2337 c8f9 8d 4a 01 STA enemy_shotX 2338 c8fc ad 4b 01 LDA enemy_shotY 2339 c8ff 18 CLC 2340 c900 6d 53 01 ADC rMovement2 2341 c903 8d 4b 01 STA enemy_shotY 2342 c906 .skipL0169 2343 c906 . 2344 c906 ;; 2345 c906 2346 c906 .L0170 ;; if rDirection = 0 then power_upX = power_upX + rMovement5 : power_upY = power_upY + rMovement2 2347 c906 2348 c906 ad 4f 01 LDA rDirection 2349 c909 c9 00 CMP #0 2350 c90b d0 14 BNE .skipL0170 2351 c90d .condpart71 2352 c90d ad 50 01 LDA power_upX 2353 c910 18 CLC 2354 c911 6d 5c 01 ADC rMovement5 2355 c914 8d 50 01 STA power_upX 2356 c917 ad 51 01 LDA power_upY 2357 c91a 18 CLC 2358 c91b 6d 53 01 ADC rMovement2 2359 c91e 8d 51 01 STA power_upY 2360 c921 .skipL0170 2361 c921 .L0171 ;; if rDirection = 1 then power_upX = power_upX + rMovement3 : power_upY = power_upY + rMovement4 2362 c921 2363 c921 ad 4f 01 LDA rDirection 2364 c924 c9 01 CMP #1 2365 c926 d0 14 BNE .skipL0171 2366 c928 .condpart72 2367 c928 ad 50 01 LDA power_upX 2368 c92b 18 CLC 2369 c92c 6d 5a 01 ADC rMovement3 2370 c92f 8d 50 01 STA power_upX 2371 c932 ad 51 01 LDA power_upY 2372 c935 18 CLC 2373 c936 6d 5b 01 ADC rMovement4 2374 c939 8d 51 01 STA power_upY 2375 c93c .skipL0171 2376 c93c .L0172 ;; if rDirection = 2 then power_upX = power_upX + rMovement1 : power_upY = power_upY + rMovement6 2377 c93c 2378 c93c ad 4f 01 LDA rDirection 2379 c93f c9 02 CMP #2 2380 c941 d0 14 BNE .skipL0172 2381 c943 .condpart73 2382 c943 ad 50 01 LDA power_upX 2383 c946 18 CLC 2384 c947 6d 4e 01 ADC rMovement1 2385 c94a 8d 50 01 STA power_upX 2386 c94d ad 51 01 LDA power_upY 2387 c950 18 CLC 2388 c951 6d 5d 01 ADC rMovement6 2389 c954 8d 51 01 STA power_upY 2390 c957 .skipL0172 2391 c957 . 2392 c957 ;; 2393 c957 2394 c957 .L0173 ;; if rDirection = 0 then enemy01_X = enemy01_X + rMovement4 : enemy01_Y = enemy01_Y + rMovement2 2395 c957 2396 c957 ad 4f 01 LDA rDirection 2397 c95a c9 00 CMP #0 2398 c95c d0 14 BNE .skipL0173 2399 c95e .condpart74 2400 c95e ad 57 01 LDA enemy01_X 2401 c961 18 CLC 2402 c962 6d 5b 01 ADC rMovement4 2403 c965 8d 57 01 STA enemy01_X 2404 c968 ad 58 01 LDA enemy01_Y 2405 c96b 18 CLC 2406 c96c 6d 53 01 ADC rMovement2 2407 c96f 8d 58 01 STA enemy01_Y 2408 c972 .skipL0173 2409 c972 .L0174 ;; if rDirection = 1 then enemy01_X = enemy01_X + rMovement3 : enemy01_Y = enemy01_Y + rMovement4 2410 c972 2411 c972 ad 4f 01 LDA rDirection 2412 c975 c9 01 CMP #1 2413 c977 d0 14 BNE .skipL0174 2414 c979 .condpart75 2415 c979 ad 57 01 LDA enemy01_X 2416 c97c 18 CLC 2417 c97d 6d 5a 01 ADC rMovement3 2418 c980 8d 57 01 STA enemy01_X 2419 c983 ad 58 01 LDA enemy01_Y 2420 c986 18 CLC 2421 c987 6d 5b 01 ADC rMovement4 2422 c98a 8d 58 01 STA enemy01_Y 2423 c98d .skipL0174 2424 c98d .L0175 ;; if rDirection = 2 then enemy01_X = enemy01_X + rMovement6 : enemy01_Y = enemy01_Y + rMovement6 2425 c98d 2426 c98d ad 4f 01 LDA rDirection 2427 c990 c9 02 CMP #2 2428 c992 d0 14 BNE .skipL0175 2429 c994 .condpart76 2430 c994 ad 57 01 LDA enemy01_X 2431 c997 18 CLC 2432 c998 6d 5d 01 ADC rMovement6 2433 c99b 8d 57 01 STA enemy01_X 2434 c99e ad 58 01 LDA enemy01_Y 2435 c9a1 18 CLC 2436 c9a2 6d 5d 01 ADC rMovement6 2437 c9a5 8d 58 01 STA enemy01_Y 2438 c9a8 .skipL0175 2439 c9a8 . 2440 c9a8 ;; 2441 c9a8 2442 c9a8 .L0176 ;; if rDirection = 0 then extra_shipX = extra_shipX + rMovement5 : extra_shipY = extra_shipY + rMovement2 2443 c9a8 2444 c9a8 ad 4f 01 LDA rDirection 2445 c9ab c9 00 CMP #0 2446 c9ad d0 14 BNE .skipL0176 2447 c9af .condpart77 2448 c9af ad 60 01 LDA extra_shipX 2449 c9b2 18 CLC 2450 c9b3 6d 5c 01 ADC rMovement5 2451 c9b6 8d 60 01 STA extra_shipX 2452 c9b9 ad 61 01 LDA extra_shipY 2453 c9bc 18 CLC 2454 c9bd 6d 53 01 ADC rMovement2 2455 c9c0 8d 61 01 STA extra_shipY 2456 c9c3 .skipL0176 2457 c9c3 . 2458 c9c3 ;; 2459 c9c3 2460 c9c3 .L0177 ;; if playerFlag = 1 && explosion_aniframe = 1 then playsfx sfx_explosion 2461 c9c3 2462 c9c3 ad 4d 01 LDA playerFlag 2463 c9c6 c9 01 CMP #1 2464 c9c8 d0 20 BNE .skipL0177 2465 c9ca .condpart78 2466 c9ca ad 63 01 LDA explosion_aniframe 2467 c9cd c9 01 CMP #1 2468 c9cf d0 19 BNE .skip78then 2469 c9d1 .condpart79 2470 c9d1 a9 01 lda #1 2471 c9d3 85 de sta sfxschedulelock 2472 c9d5 a9 b5 lda #sfx_explosion 2475 c9db 85 e1 sta sfxinstrumenthi 2476 c9dd a9 00 lda #0 2477 c9df 85 e2 sta sfxpitchoffset ; no pitch modification 2478 c9e1 85 e3 sta sfxnoteindex ; not a musical note 2479 c9e3 20 58 f2 jsr schedulesfx 2480 c9e6 a9 00 lda #0 2481 c9e8 85 de sta sfxschedulelock 2482 c9ea .skip78then 2483 c9ea .skipL0177 2484 c9ea .L0178 ;; if playerFlag = 1 then enemy_shotSlowdown = enemy_shotSlowdown + 1 2485 c9ea 2486 c9ea ad 4d 01 LDA playerFlag 2487 c9ed c9 01 CMP #1 2488 c9ef d0 09 BNE .skipL0178 2489 c9f1 .condpart80 2490 c9f1 ad 56 01 LDA enemy_shotSlowdown 2491 c9f4 18 CLC 2492 c9f5 69 01 ADC #1 2493 c9f7 8d 56 01 STA enemy_shotSlowdown 2494 c9fa .skipL0178 2495 c9fa .L0179 ;; if playerFlag = 1 && enemy_shotSlowdown = 8 then enemy_shotSlowdown = 0 2496 c9fa 2497 c9fa ad 4d 01 LDA playerFlag 2498 c9fd c9 01 CMP #1 2499 c9ff d0 0c BNE .skipL0179 2500 ca01 .condpart81 2501 ca01 ad 56 01 LDA enemy_shotSlowdown 2502 ca04 c9 08 CMP #8 2503 ca06 d0 05 BNE .skip81then 2504 ca08 .condpart82 2505 ca08 a9 00 LDA #0 2506 ca0a 8d 56 01 STA enemy_shotSlowdown 2507 ca0d .skip81then 2508 ca0d .skipL0179 2509 ca0d .L0180 ;; if playerFlag = 1 && enemy_shotSlowdown = 2 then explosion_aniframe = explosion_aniframe + 1 2510 ca0d 2511 ca0d ad 4d 01 LDA playerFlag 2512 ca10 c9 01 CMP #1 2513 ca12 d0 10 BNE .skipL0180 2514 ca14 .condpart83 2515 ca14 ad 56 01 LDA enemy_shotSlowdown 2516 ca17 c9 02 CMP #2 2517 ca19 d0 09 BNE .skip83then 2518 ca1b .condpart84 2519 ca1b ad 63 01 LDA explosion_aniframe 2520 ca1e 18 CLC 2521 ca1f 69 01 ADC #1 2522 ca21 8d 63 01 STA explosion_aniframe 2523 ca24 .skip83then 2524 ca24 .skipL0180 2525 ca24 .L0181 ;; if playerFlag = 1 && explosion_aniframe > 11 then explosion_aniframe = 200 2526 ca24 2527 ca24 ad 4d 01 LDA playerFlag 2528 ca27 c9 01 CMP #1 2529 ca29 d0 0c BNE .skipL0181 2530 ca2b .condpart85 2531 ca2b a9 0b LDA #11 2532 ca2d cd 63 01 CMP explosion_aniframe 2533 ca30 b0 05 BCS .skip85then 2534 ca32 .condpart86 2535 ca32 a9 c8 LDA #200 2536 ca34 8d 63 01 STA explosion_aniframe 2537 ca37 .skip85then 2538 ca37 .skipL0181 2539 ca37 . 2540 ca37 ;; 2541 ca37 2542 ca37 .L0182 ;; plotsprite vertical_shooting_ship 0 playerX playerY 2543 ca37 2544 ca37 a9 2d lda #vertical_shooting_ship 2548 ca3d 85 43 sta temp2 2549 ca3f 2550 ca3f a9 1e lda #(0|vertical_shooting_ship_width_twoscompliment) 2551 ca41 85 44 sta temp3 2552 ca43 2553 ca43 ad 41 01 lda playerX 2554 ca46 85 45 sta temp4 2555 ca48 2556 ca48 ad 42 01 lda playerY 2557 ca4b 2558 ca4b 85 46 sta temp5 2559 ca4d 2560 ca4d a9 40 lda #(vertical_shooting_ship_mode|%01000000) 2561 ca4f 85 47 sta temp6 2562 ca51 2563 ca51 20 a0 f2 jsr plotsprite 2564 ca54 ; +tall sprite replot 2565 ca54 18 clc 2566 ca55 a5 42 lda temp1 2567 ca57 69 02 adc #vertical_shooting_ship_width 2568 ca59 85 42 sta temp1 2569 ca5b a5 46 lda temp5 2570 ca5d 69 08 adc #WZONEHEIGHT 2571 ca5f 85 46 sta temp5 2572 ca61 20 a0 f2 jsr plotsprite 2573 ca64 .L0183 ;; plotsprite vertical_shooting_bullet 1 bulletX bulletY 2574 ca64 2575 ca64 a9 31 lda #vertical_shooting_bullet 2579 ca6a 85 43 sta temp2 2580 ca6c 2581 ca6c a9 3f lda #(32|vertical_shooting_bullet_width_twoscompliment) 2582 ca6e 85 44 sta temp3 2583 ca70 2584 ca70 ad 48 01 lda bulletX 2585 ca73 85 45 sta temp4 2586 ca75 2587 ca75 ad 49 01 lda bulletY 2588 ca78 2589 ca78 85 46 sta temp5 2590 ca7a 2591 ca7a a9 40 lda #(vertical_shooting_bullet_mode|%01000000) 2592 ca7c 85 47 sta temp6 2593 ca7e 2594 ca7e 20 a0 f2 jsr plotsprite 2595 ca81 .L0184 ;; plotsprite vertical_shooting_enemyshot 2 enemy_shotX enemy_shotY 2596 ca81 2597 ca81 a9 32 lda #vertical_shooting_enemyshot 2601 ca87 85 43 sta temp2 2602 ca89 2603 ca89 a9 5f lda #(64|vertical_shooting_enemyshot_width_twoscompliment) 2604 ca8b 85 44 sta temp3 2605 ca8d 2606 ca8d ad 4a 01 lda enemy_shotX 2607 ca90 85 45 sta temp4 2608 ca92 2609 ca92 ad 4b 01 lda enemy_shotY 2610 ca95 2611 ca95 85 46 sta temp5 2612 ca97 2613 ca97 a9 40 lda #(vertical_shooting_enemyshot_mode|%01000000) 2614 ca99 85 47 sta temp6 2615 ca9b 2616 ca9b 20 a0 f2 jsr plotsprite 2617 ca9e .L0185 ;; plotsprite vertical_shooting_powerup 3 power_upX power_upY 2618 ca9e 2619 ca9e a9 33 lda #vertical_shooting_powerup 2623 caa4 85 43 sta temp2 2624 caa6 2625 caa6 a9 7e lda #(96|vertical_shooting_powerup_width_twoscompliment) 2626 caa8 85 44 sta temp3 2627 caaa 2628 caaa ad 50 01 lda power_upX 2629 caad 85 45 sta temp4 2630 caaf 2631 caaf ad 51 01 lda power_upY 2632 cab2 2633 cab2 85 46 sta temp5 2634 cab4 2635 cab4 a9 40 lda #(vertical_shooting_powerup_mode|%01000000) 2636 cab6 85 47 sta temp6 2637 cab8 2638 cab8 20 a0 f2 jsr plotsprite 2639 cabb .L0186 ;; plotsprite vertical_shooting_enemy01 2 enemy01_X enemy01_Y 2640 cabb 2641 cabb a9 35 lda #vertical_shooting_enemy01 2645 cac1 85 43 sta temp2 2646 cac3 2647 cac3 a9 5e lda #(64|vertical_shooting_enemy01_width_twoscompliment) 2648 cac5 85 44 sta temp3 2649 cac7 2650 cac7 ad 57 01 lda enemy01_X 2651 caca 85 45 sta temp4 2652 cacc 2653 cacc ad 58 01 lda enemy01_Y 2654 cacf 2655 cacf 85 46 sta temp5 2656 cad1 2657 cad1 a9 40 lda #(vertical_shooting_enemy01_mode|%01000000) 2658 cad3 85 47 sta temp6 2659 cad5 2660 cad5 20 a0 f2 jsr plotsprite 2661 cad8 ; +tall sprite replot 2662 cad8 18 clc 2663 cad9 a5 42 lda temp1 2664 cadb 69 02 adc #vertical_shooting_enemy01_width 2665 cadd 85 42 sta temp1 2666 cadf a5 46 lda temp5 2667 cae1 69 08 adc #WZONEHEIGHT 2668 cae3 85 46 sta temp5 2669 cae5 20 a0 f2 jsr plotsprite 2670 cae8 .L0187 ;; plotsprite vertical_shooting_1up 0 extra_shipX extra_shipY 2671 cae8 2672 cae8 a9 43 lda #vertical_shooting_1up 2676 caee 85 43 sta temp2 2677 caf0 2678 caf0 a9 1e lda #(0|vertical_shooting_1up_width_twoscompliment) 2679 caf2 85 44 sta temp3 2680 caf4 2681 caf4 ad 60 01 lda extra_shipX 2682 caf7 85 45 sta temp4 2683 caf9 2684 caf9 ad 61 01 lda extra_shipY 2685 cafc 2686 cafc 85 46 sta temp5 2687 cafe 2688 cafe a9 40 lda #(vertical_shooting_1up_mode|%01000000) 2689 cb00 85 47 sta temp6 2690 cb02 2691 cb02 20 a0 f2 jsr plotsprite 2692 cb05 .L0188 ;; plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 2693 cb05 2694 cb05 a9 45 lda #vertical_shooting_explosion_01 2706 cb16 85 43 sta temp2 2707 cb18 2708 cb18 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2709 cb1a 85 44 sta temp3 2710 cb1c 2711 cb1c ad 41 01 lda playerX 2712 cb1f 85 45 sta temp4 2713 cb21 2714 cb21 ad 42 01 lda playerY 2715 cb24 85 46 sta temp5 2716 cb26 2717 cb26 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2718 cb28 85 47 sta temp6 2719 cb2a 2720 cb2a 20 a0 f2 jsr plotsprite 2721 cb2d ; +tall sprite replot 2722 cb2d 18 clc 2723 cb2e a5 42 lda temp1 2724 cb30 69 02 adc #vertical_shooting_explosion_01_width 2725 cb32 85 42 sta temp1 2726 cb34 a5 46 lda temp5 2727 cb36 69 08 adc #WZONEHEIGHT 2728 cb38 85 46 sta temp5 2729 cb3a 20 a0 f2 jsr plotsprite 2730 cb3d .L0189 ;; plotsprite vertical_shooting_explosion_01 3 enemy01_X enemy01_Y explosion_aniframe 2731 cb3d 2732 cb3d a9 45 lda #vertical_shooting_explosion_01 2744 cb4e 85 43 sta temp2 2745 cb50 2746 cb50 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2747 cb52 85 44 sta temp3 2748 cb54 2749 cb54 ad 57 01 lda enemy01_X 2750 cb57 85 45 sta temp4 2751 cb59 2752 cb59 ad 58 01 lda enemy01_Y 2753 cb5c 85 46 sta temp5 2754 cb5e 2755 cb5e a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2756 cb60 85 47 sta temp6 2757 cb62 2758 cb62 20 a0 f2 jsr plotsprite 2759 cb65 ; +tall sprite replot 2760 cb65 18 clc 2761 cb66 a5 42 lda temp1 2762 cb68 69 02 adc #vertical_shooting_explosion_01_width 2763 cb6a 85 42 sta temp1 2764 cb6c a5 46 lda temp5 2765 cb6e 69 08 adc #WZONEHEIGHT 2766 cb70 85 46 sta temp5 2767 cb72 20 a0 f2 jsr plotsprite 2768 cb75 .L0190 ;; plotsprite vertical_shooting_laser 0 twinlaserX twinlaserY 2769 cb75 2770 cb75 a9 fd lda #vertical_shooting_laser 2774 cb7b 85 43 sta temp2 2775 cb7d 2776 cb7d a9 1f lda #(0|vertical_shooting_laser_width_twoscompliment) 2777 cb7f 85 44 sta temp3 2778 cb81 2779 cb81 ad 65 01 lda twinlaserX 2780 cb84 85 45 sta temp4 2781 cb86 2782 cb86 ad 66 01 lda twinlaserY 2783 cb89 2784 cb89 85 46 sta temp5 2785 cb8b 2786 cb8b a9 40 lda #(vertical_shooting_laser_mode|%01000000) 2787 cb8d 85 47 sta temp6 2788 cb8f 2789 cb8f 20 a0 f2 jsr plotsprite 2790 cb92 ; +tall sprite replot 2791 cb92 18 clc 2792 cb93 a5 42 lda temp1 2793 cb95 69 01 adc #vertical_shooting_laser_width 2794 cb97 85 42 sta temp1 2795 cb99 a5 46 lda temp5 2796 cb9b 69 08 adc #WZONEHEIGHT 2797 cb9d 85 46 sta temp5 2798 cb9f 20 a0 f2 jsr plotsprite 2799 cba2 .L0191 ;; plotvalue vertical_shooting_font 0 score0 6 25 1 2800 cba2 2801 cba2 a9 00 lda #vertical_shooting_font 2805 cba8 85 43 sta temp2 2806 cbaa 2807 cbaa ad 06 21 lda charactermode 2808 cbad 85 4a sta temp9 2809 cbaf a9 60 lda #(vertical_shooting_font_mode | %01100000) 2810 cbb1 8d 06 21 sta charactermode 2811 cbb4 a9 1a lda #26 ; width in two's complement 2812 cbb6 09 00 ora #0 ; palette left shifted 5 bits 2813 cbb8 85 44 sta temp3 2814 cbba a9 19 lda #25 2815 cbbc 85 45 sta temp4 2816 cbbe 2817 cbbe a9 01 lda #1 2818 cbc0 85 46 sta temp5 2819 cbc2 2820 cbc2 a9 06 lda #6 2821 cbc4 85 47 sta temp6 2822 cbc6 2823 cbc6 a9 a6 lda #score0 2827 cbcc 85 49 sta temp8 2828 cbce 2829 cbce 20 8e f3 jsr plotvalue 2830 cbce 00 01 USED_PLOTVALUE = 1 2831 cbd1 a5 4a lda temp9 2832 cbd3 8d 06 21 sta charactermode 2833 cbd6 .L0192 ;; plotvalue vertical_shooting_font 0 score1 1 153 1 2834 cbd6 2835 cbd6 a9 00 lda #vertical_shooting_font 2839 cbdc 85 43 sta temp2 2840 cbde 2841 cbde ad 06 21 lda charactermode 2842 cbe1 85 4a sta temp9 2843 cbe3 a9 60 lda #(vertical_shooting_font_mode | %01100000) 2844 cbe5 8d 06 21 sta charactermode 2845 cbe8 a9 1f lda #31 ; width in two's complement 2846 cbea 09 00 ora #0 ; palette left shifted 5 bits 2847 cbec 85 44 sta temp3 2848 cbee a9 99 lda #153 2849 cbf0 85 45 sta temp4 2850 cbf2 2851 cbf2 a9 01 lda #1 2852 cbf4 85 46 sta temp5 2853 cbf6 2854 cbf6 a9 01 lda #1 2855 cbf8 85 47 sta temp6 2856 cbfa 2857 cbfa a9 a9 lda #score1 2861 cc00 85 49 sta temp8 2862 cc02 2863 cc02 20 8e f3 jsr plotvalue 2864 cc02 00 01 USED_PLOTVALUE = 1 2865 cc05 a5 4a lda temp9 2866 cc07 8d 06 21 sta charactermode 2867 cc0a .L0193 ;; if playerFlag = 1 then plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 2868 cc0a 2869 cc0a ad 4d 01 LDA playerFlag 2870 cc0d c9 01 CMP #1 2871 cc0f d0 38 BNE .skipL0193 2872 cc11 .condpart87 2873 cc11 a9 45 lda #vertical_shooting_explosion_01 2885 cc22 85 43 sta temp2 2886 cc24 2887 cc24 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2888 cc26 85 44 sta temp3 2889 cc28 2890 cc28 ad 41 01 lda playerX 2891 cc2b 85 45 sta temp4 2892 cc2d 2893 cc2d ad 42 01 lda playerY 2894 cc30 85 46 sta temp5 2895 cc32 2896 cc32 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2897 cc34 85 47 sta temp6 2898 cc36 2899 cc36 20 a0 f2 jsr plotsprite 2900 cc39 ; +tall sprite replot 2901 cc39 18 clc 2902 cc3a a5 42 lda temp1 2903 cc3c 69 02 adc #vertical_shooting_explosion_01_width 2904 cc3e 85 42 sta temp1 2905 cc40 a5 46 lda temp5 2906 cc42 69 08 adc #WZONEHEIGHT 2907 cc44 85 46 sta temp5 2908 cc46 20 a0 f2 jsr plotsprite 2909 cc49 .skipL0193 2910 cc49 .L0194 ;; if enemy01_Flag = 1 then plotsprite vertical_shooting_explosion_01 3 enemy01_X enemy01_Y explosion_aniframe 2911 cc49 2912 cc49 ad 59 01 LDA enemy01_Flag 2913 cc4c c9 01 CMP #1 2914 cc4e d0 38 BNE .skipL0194 2915 cc50 .condpart88 2916 cc50 a9 45 lda #vertical_shooting_explosion_01 2928 cc61 85 43 sta temp2 2929 cc63 2930 cc63 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2931 cc65 85 44 sta temp3 2932 cc67 2933 cc67 ad 57 01 lda enemy01_X 2934 cc6a 85 45 sta temp4 2935 cc6c 2936 cc6c ad 58 01 lda enemy01_Y 2937 cc6f 85 46 sta temp5 2938 cc71 2939 cc71 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2940 cc73 85 47 sta temp6 2941 cc75 2942 cc75 20 a0 f2 jsr plotsprite 2943 cc78 ; +tall sprite replot 2944 cc78 18 clc 2945 cc79 a5 42 lda temp1 2946 cc7b 69 02 adc #vertical_shooting_explosion_01_width 2947 cc7d 85 42 sta temp1 2948 cc7f a5 46 lda temp5 2949 cc81 69 08 adc #WZONEHEIGHT 2950 cc83 85 46 sta temp5 2951 cc85 20 a0 f2 jsr plotsprite 2952 cc88 .skipL0194 2953 cc88 .L0195 ;; drawscreen 2954 cc88 2955 cc88 20 c0 f0 jsr drawscreen 2956 cc8b . 2957 cc8b ;; 2958 cc8b 2959 cc8b .L0196 ;; goto mainloop 2960 cc8b 2961 cc8b 4c f5 c1 jmp .mainloop 2962 cc8e 2963 cc8e .L0197 ;; dmahole 0 2964 cc8e 2965 cc8e 4c 00 d8 jmp dmahole_0 2966 cc91 gameend 2967 cc91 DMAHOLEEND0 SET . 879 bytes of ROM space left in the main area. 2968 cc91 echo " ",[($D000 - gameend)]d , "bytes of ROM space left in the main area." 2969 cc91 - if ($D000 - gameend) < 0 2970 cc91 -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 2971 cc91 endif 2972 cc91 2973 d000 ORG $D000,0 ; ************* 2974 d000 2975 d000 atascii 2976 d000 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 2977 d020 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 2978 d040 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000500000000000000 2979 d060 00 00 00 00* HEX 0000000000000000000000000000000000000000000005000000000000000000 2980 d080 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 2981 d0a0 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 2982 d0c0 00 00 00 00* HEX 0000000000000000000000000000155000000000055000000000000000000000 2983 d0e0 14 00 00 14* HEX 14000014000000000000000000000000000015400000 2984 d0f6 2985 d100 ORG $D100,0 ; ************* 2986 d100 2987 d100 ;atascii 2988 d100 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 2989 d120 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 2990 d140 00 00 01 40* HEX 0000014000001414014010140545000000541500000000000140000001401000 2991 d160 05 50 15 54* HEX 0550155415540550005005500550050005500540014001400014000014000140 2992 d180 05 54 14 14* HEX 0554141415500550154015541400055414141554055014141554140514140550 2993 d1a0 14 00 05 14* HEX 1400051414140550014015540140140514140140155401540014154000005555 2994 d1c0 00 00 05 54* HEX 0000055415500550055405500140001414140550001414140550140514140550 2995 d1e0 14 00 00 14* HEX 14000014140015500054055401400514141400501554 2996 d1f6 2997 d200 ORG $D200,0 ; ************* 2998 d200 2999 d200 ;atascii 3000 d200 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3001 d220 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3002 d240 00 00 00 00* HEX 0000000000005555155014141414000001500540141401400140000001401400 3003 d260 14 14 01 40* HEX 1414014005001414155414141414050014140050014001400050155405000000 3004 d280 14 00 15 54* HEX 1400155414141414145014001400141414140140141414501400140514541414 3005 d2a0 14 00 14 50* HEX 1400145014500014014014140550151514140140140001400050014000000000 3006 d2c0 00 00 14 14* HEX 0000141414141400141414000140055414140140001414500140144514141414 3007 d2e0 15 50 05 54* HEX 15500554140000140140141405500554055005540500 3008 d2f6 3009 d300 ORG $D300,0 ; ************* 3010 d300 3011 d300 ;atascii 3012 d300 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3013 d320 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3014 d340 00 00 01 40* HEX 0000014000001414001405001455000001400140055001400000000000000500 3015 d360 15 14 01 40* HEX 1514014001400050145000141414014014140014000000000140000001400140 3016 d380 14 54 14 14* HEX 1454141414141400141414001400145414140140001415401400144515541414 3017 d3a0 15 50 14 14* HEX 1550141415500014014014141414155505500140050001400140014014050000 3018 d3c0 00 00 05 54* HEX 0000055414141400141415540140141414140140001415400140155514141414 3019 d3e0 14 14 14 14* HEX 14141414140005500140141414141555014014140140 3020 d3f6 3021 d400 ORG $D400,0 ; ************* 3022 d400 3023 d400 ;atascii 3024 d400 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3025 d420 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3026 d440 00 00 01 40* HEX 0000014014141414055001400540014001400140555515540000155400000140 3027 d460 14 54 01 40* HEX 1454014000500140055015501550005005500554014001400500000000500050 3028 d480 14 54 14 14* HEX 1454141415501400141415501550140015540140001415401400155515541414 3029 d4a0 14 14 14 14* HEX 1414141414140550014014141414144505500550014001400500014005140000 3030 d4c0 01 40 00 14* HEX 0140001415501400055414140554141415500540001414500140155514141414 3031 d4e0 14 14 14 14* HEX 14141414141414000140141414141445055014140050 3032 d4f6 3033 d500 ORG $D500,0 ; ************* 3034 d500 3035 d500 ;atascii 3036 d500 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3037 d520 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3038 d540 00 00 01 40* HEX 0000014014145555140014500150014001500540055001400000000000000050 3039 d560 14 14 05 40* HEX 1414054014140050015014001400001414141414014001400140155401401414 3040 d580 14 14 05 50* HEX 1414055014141414145014001400140014140140001414501400151515141414 3041 d5a0 14 14 14 14* HEX 1414141414141400014014141414140514141414005001401400014001500000 3042 d5c0 01 40 05 50* HEX 0140055014000550001405500140055414000000000014000140141415500550 3043 d5e0 15 50 05 54* HEX 15500554155005541554141414141405141414141554 3044 d5f6 3045 d600 ORG $D600,0 ; ************* 3046 d600 3047 d600 ;atascii 3048 d600 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3049 d620 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3050 d640 00 00 01 40* HEX 0000014014141414055414140514014000541500141401400000000000000014 3051 d660 05 50 01 40* HEX 0550014005501554005015540550155405500550000000000050000005000550 3052 d680 05 50 01 40* HEX 0550014015500550154015541554055414141554001414141400140514140550 3053 d6a0 15 50 05 50* HEX 1550055015500550155414141414140514141414155401541000154000400000 3054 d6c0 01 40 00 00* HEX 0140000014000000001400000054000014000140001414000540000000000000 3055 d6e0 00 00 00 00* HEX 00000000000000000140000000000000000000000000 3056 d6f6 3057 d700 ORG $D700,0 ; ************* 3058 d700 3059 d700 ;atascii 3060 d700 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3061 d720 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3062 d740 00 00 00 00* HEX 0000000000000000014000000150000000000000000000000000000000000000 3063 d760 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000014000014000000 3064 d780 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3065 d7a0 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3066 d7c0 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3067 d7e0 00 00 00 00* HEX 00000000000000000000000000000000000000000000 3068 d7f6 3069 d800 ORG $D800,0 ; ************* 3070 d800 dmahole_0 3071 d800 DMAHOLESTART0 SET . 3072 d800 . 3073 d800 ;; 3074 d800 3075 d800 .SetBulletHome 3076 d800 ;; SetBulletHome 3077 d800 3078 d800 .L0198 ;; bulletX = playerX + 4 : bulletY = playerY - 2 3079 d800 3080 d800 ad 41 01 LDA playerX 3081 d803 18 CLC 3082 d804 69 04 ADC #4 3083 d806 8d 48 01 STA bulletX 3084 d809 ad 42 01 LDA playerY 3085 d80c 38 SEC 3086 d80d e9 02 SBC #2 3087 d80f 8d 49 01 STA bulletY 3088 d812 .L0199 ;; return 3089 d812 3090 d812 60 RTS 3091 d813 . 3092 d813 ;; 3093 d813 3094 d813 .SetLaserHome 3095 d813 ;; SetLaserHome 3096 d813 3097 d813 .L0200 ;; twinlaserX = playerX + 4 : twinlaserY = playerY - 2 3098 d813 3099 d813 ad 41 01 LDA playerX 3100 d816 18 CLC 3101 d817 69 04 ADC #4 3102 d819 8d 65 01 STA twinlaserX 3103 d81c ad 42 01 LDA playerY 3104 d81f 38 SEC 3105 d820 e9 02 SBC #2 3106 d822 8d 66 01 STA twinlaserY 3107 d825 .L0201 ;; return 3108 d825 3109 d825 60 RTS 3110 d826 . 3111 d826 ;; 3112 d826 3113 d826 .power_up_obtained 3114 d826 ;; power_up_obtained 3115 d826 3116 d826 .L0202 ;; if power_upFlag = 1 then twinlaser_flag = 1 3117 d826 3118 d826 ad 52 01 LDA power_upFlag 3119 d829 c9 01 CMP #1 3120 d82b d0 05 BNE .skipL0202 3121 d82d .condpart89 3122 d82d a9 01 LDA #1 3123 d82f 8d 67 01 STA twinlaser_flag 3124 d832 .skipL0202 3125 d832 .L0203 ;; if joy0up && joyposup = - 2 then gosub SetLaserHome 3126 d832 3127 d832 a9 10 lda #$10 3128 d834 2c 80 02 bit SWCHA 3129 d837 d0 10 BNE .skipL0203 3130 d839 .condpart90 3131 d839 ; complex condition detected 3132 d839 a9 fe LDA #254 3133 d83b 48 PHA 3134 d83c ba TSX 3135 d83d 68 PLA 3136 d83e ad 44 01 LDA joyposup 3137 d841 dd 01 01 CMP $101,x 3138 d844 d0 03 BNE .skip90then 3139 d846 .condpart91 3140 d846 20 13 d8 jsr .SetLaserHome 3141 d849 3142 d849 .skip90then 3143 d849 .skipL0203 3144 d849 .L0204 ;; if joy0down && joyposdown = - 2 then gosub SetLaserHome 3145 d849 3146 d849 a9 20 lda #$20 3147 d84b 2c 80 02 bit SWCHA 3148 d84e d0 10 BNE .skipL0204 3149 d850 .condpart92 3150 d850 ; complex condition detected 3151 d850 a9 fe LDA #254 3152 d852 48 PHA 3153 d853 ba TSX 3154 d854 68 PLA 3155 d855 ad 45 01 LDA joyposdown 3156 d858 dd 01 01 CMP $101,x 3157 d85b d0 03 BNE .skip92then 3158 d85d .condpart93 3159 d85d 20 13 d8 jsr .SetLaserHome 3160 d860 3161 d860 .skip92then 3162 d860 .skipL0204 3163 d860 .L0205 ;; if joy0up && joyposleft = - 2 then gosub SetLaserHome 3164 d860 3165 d860 a9 10 lda #$10 3166 d862 2c 80 02 bit SWCHA 3167 d865 d0 10 BNE .skipL0205 3168 d867 .condpart94 3169 d867 ; complex condition detected 3170 d867 a9 fe LDA #254 3171 d869 48 PHA 3172 d86a ba TSX 3173 d86b 68 PLA 3174 d86c ad 46 01 LDA joyposleft 3175 d86f dd 01 01 CMP $101,x 3176 d872 d0 03 BNE .skip94then 3177 d874 .condpart95 3178 d874 20 13 d8 jsr .SetLaserHome 3179 d877 3180 d877 .skip94then 3181 d877 .skipL0205 3182 d877 .L0206 ;; if joy0down && joyposright = - 2 then gosub SetLaserHome 3183 d877 3184 d877 a9 20 lda #$20 3185 d879 2c 80 02 bit SWCHA 3186 d87c d0 10 BNE .skipL0206 3187 d87e .condpart96 3188 d87e ; complex condition detected 3189 d87e a9 fe LDA #254 3190 d880 48 PHA 3191 d881 ba TSX 3192 d882 68 PLA 3193 d883 ad 47 01 LDA joyposright 3194 d886 dd 01 01 CMP $101,x 3195 d889 d0 03 BNE .skip96then 3196 d88b .condpart97 3197 d88b 20 13 d8 jsr .SetLaserHome 3198 d88e 3199 d88e .skip96then 3200 d88e .skipL0206 3201 d88e .L0207 ;; if joy0fire && joyposup = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3202 d88e 3203 d88e 2c 02 21 bit sINPT1 3204 d891 10 29 BPL .skipL0207 3205 d893 .condpart98 3206 d893 ad 44 01 LDA joyposup 3207 d896 c9 01 CMP #1 3208 d898 d0 22 BNE .skip98then 3209 d89a .condpart99 3210 d89a ad 66 01 LDA twinlaserY 3211 d89d 38 SEC 3212 d89e e9 0a SBC #10 3213 d8a0 8d 66 01 STA twinlaserY 3214 d8a3 a9 01 lda #1 3215 d8a5 85 de sta sfxschedulelock 3216 d8a7 a9 82 lda #sfx_plainlaser 3219 d8ad 85 e1 sta sfxinstrumenthi 3220 d8af a9 00 lda #0 3221 d8b1 85 e2 sta sfxpitchoffset ; no pitch modification 3222 d8b3 85 e3 sta sfxnoteindex ; not a musical note 3223 d8b5 20 58 f2 jsr schedulesfx 3224 d8b8 a9 00 lda #0 3225 d8ba 85 de sta sfxschedulelock 3226 d8bc .skip98then 3227 d8bc .skipL0207 3228 d8bc .L0208 ;; if joy0fire && joyposdown = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3229 d8bc 3230 d8bc 2c 02 21 bit sINPT1 3231 d8bf 10 29 BPL .skipL0208 3232 d8c1 .condpart100 3233 d8c1 ad 45 01 LDA joyposdown 3234 d8c4 c9 01 CMP #1 3235 d8c6 d0 22 BNE .skip100then 3236 d8c8 .condpart101 3237 d8c8 ad 66 01 LDA twinlaserY 3238 d8cb 38 SEC 3239 d8cc e9 0a SBC #10 3240 d8ce 8d 66 01 STA twinlaserY 3241 d8d1 a9 01 lda #1 3242 d8d3 85 de sta sfxschedulelock 3243 d8d5 a9 82 lda #sfx_plainlaser 3246 d8db 85 e1 sta sfxinstrumenthi 3247 d8dd a9 00 lda #0 3248 d8df 85 e2 sta sfxpitchoffset ; no pitch modification 3249 d8e1 85 e3 sta sfxnoteindex ; not a musical note 3250 d8e3 20 58 f2 jsr schedulesfx 3251 d8e6 a9 00 lda #0 3252 d8e8 85 de sta sfxschedulelock 3253 d8ea .skip100then 3254 d8ea .skipL0208 3255 d8ea .L0209 ;; if joy0fire && joyposleft = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3256 d8ea 3257 d8ea 2c 02 21 bit sINPT1 3258 d8ed 10 29 BPL .skipL0209 3259 d8ef .condpart102 3260 d8ef ad 46 01 LDA joyposleft 3261 d8f2 c9 01 CMP #1 3262 d8f4 d0 22 BNE .skip102then 3263 d8f6 .condpart103 3264 d8f6 ad 66 01 LDA twinlaserY 3265 d8f9 38 SEC 3266 d8fa e9 0a SBC #10 3267 d8fc 8d 66 01 STA twinlaserY 3268 d8ff a9 01 lda #1 3269 d901 85 de sta sfxschedulelock 3270 d903 a9 82 lda #sfx_plainlaser 3273 d909 85 e1 sta sfxinstrumenthi 3274 d90b a9 00 lda #0 3275 d90d 85 e2 sta sfxpitchoffset ; no pitch modification 3276 d90f 85 e3 sta sfxnoteindex ; not a musical note 3277 d911 20 58 f2 jsr schedulesfx 3278 d914 a9 00 lda #0 3279 d916 85 de sta sfxschedulelock 3280 d918 .skip102then 3281 d918 .skipL0209 3282 d918 .L0210 ;; if joy0fire && joyposright = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3283 d918 3284 d918 2c 02 21 bit sINPT1 3285 d91b 10 29 BPL .skipL0210 3286 d91d .condpart104 3287 d91d ad 47 01 LDA joyposright 3288 d920 c9 01 CMP #1 3289 d922 d0 22 BNE .skip104then 3290 d924 .condpart105 3291 d924 ad 66 01 LDA twinlaserY 3292 d927 38 SEC 3293 d928 e9 0a SBC #10 3294 d92a 8d 66 01 STA twinlaserY 3295 d92d a9 01 lda #1 3296 d92f 85 de sta sfxschedulelock 3297 d931 a9 82 lda #sfx_plainlaser 3300 d937 85 e1 sta sfxinstrumenthi 3301 d939 a9 00 lda #0 3302 d93b 85 e2 sta sfxpitchoffset ; no pitch modification 3303 d93d 85 e3 sta sfxnoteindex ; not a musical note 3304 d93f 20 58 f2 jsr schedulesfx 3305 d942 a9 00 lda #0 3306 d944 85 de sta sfxschedulelock 3307 d946 .skip104then 3308 d946 .skipL0210 3309 d946 .L0211 ;; if !joy0fire then twinlaserX = playerX + 2 : twinlaserY = playerY - 8 3310 d946 3311 d946 2c 02 21 bit sINPT1 3312 d949 30 12 BMI .skipL0211 3313 d94b .condpart106 3314 d94b ad 41 01 LDA playerX 3315 d94e 18 CLC 3316 d94f 69 02 ADC #2 3317 d951 8d 65 01 STA twinlaserX 3318 d954 ad 42 01 LDA playerY 3319 d957 38 SEC 3320 d958 e9 08 SBC #8 3321 d95a 8d 66 01 STA twinlaserY 3322 d95d .skipL0211 3323 d95d . 3324 d95d ;; 3325 d95d 3326 d95d .lose_a_life 3327 d95d ;; lose_a_life 3328 d95d 3329 d95d .L0212 ;; lives = lives - 1 3330 d95d 3331 d95d ad 64 01 LDA lives 3332 d960 38 SEC 3333 d961 e9 01 SBC #1 3334 d963 8d 64 01 STA lives 3335 d966 .L0213 ;; if enemy01_Flag <> 1 then enemy01_X = 32 : enemy01_Y = 0 3336 d966 3337 d966 ad 59 01 LDA enemy01_Flag 3338 d969 c9 01 CMP #1 3339 d96b f0 0a BEQ .skipL0213 3340 d96d .condpart107 3341 d96d a9 20 LDA #32 3342 d96f 8d 57 01 STA enemy01_X 3343 d972 a9 00 LDA #0 3344 d974 8d 58 01 STA enemy01_Y 3345 d977 .skipL0213 3346 d977 .L0214 ;; if enemy_shotFlag <> 1 then enemy_shotX = 0 : enemy_shotY = 0 3347 d977 3348 d977 ad 4c 01 LDA enemy_shotFlag 3349 d97a c9 01 CMP #1 3350 d97c f0 08 BEQ .skipL0214 3351 d97e .condpart108 3352 d97e a9 00 LDA #0 3353 d980 8d 4a 01 STA enemy_shotX 3354 d983 8d 4b 01 STA enemy_shotY 3355 d986 .skipL0214 3356 d986 .L0215 ;; if playerFlag = 1 && explosion_aniframe = 200 && lives > 0 then playerX = 80 : playerY = 144 : playerFlag = 0 : explosion_aniframe = 0 : goto main 3357 d986 3358 d986 ad 4d 01 LDA playerFlag 3359 d989 c9 01 CMP #1 3360 d98b d0 23 BNE .skipL0215 3361 d98d .condpart109 3362 d98d ad 63 01 LDA explosion_aniframe 3363 d990 c9 c8 CMP #200 3364 d992 d0 1c BNE .skip109then 3365 d994 .condpart110 3366 d994 a9 00 LDA #0 3367 d996 cd 64 01 CMP lives 3368 d999 b0 15 BCS .skip110then 3369 d99b .condpart111 3370 d99b a9 50 LDA #80 3371 d99d 8d 41 01 STA playerX 3372 d9a0 a9 90 LDA #144 3373 d9a2 8d 42 01 STA playerY 3374 d9a5 a9 00 LDA #0 3375 d9a7 8d 4d 01 STA playerFlag 3376 d9aa 8d 63 01 STA explosion_aniframe 3377 d9ad 4c e0 c1 jmp .main 3378 d9b0 3379 d9b0 .skip110then 3380 d9b0 .skip109then 3381 d9b0 .skipL0215 3382 d9b0 .L0216 ;; joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 3383 d9b0 3384 d9b0 a9 00 LDA #0 3385 d9b2 8d 44 01 STA joyposup 3386 d9b5 8d 45 01 STA joyposdown 3387 d9b8 8d 46 01 STA joyposleft 3388 d9bb 8d 47 01 STA joyposright 3389 d9be .L0217 ;; fire_debounce = 0 : bulletX = 0 : bulletY = 0 3390 d9be 3391 d9be a9 00 LDA #0 3392 d9c0 8d 43 01 STA fire_debounce 3393 d9c3 8d 48 01 STA bulletX 3394 d9c6 8d 49 01 STA bulletY 3395 d9c9 .L0218 ;; enemy01_X = 0 : enemy01_Y = 0 : enemy01_Flag = 0 3396 d9c9 3397 d9c9 a9 00 LDA #0 3398 d9cb 8d 57 01 STA enemy01_X 3399 d9ce 8d 58 01 STA enemy01_Y 3400 d9d1 8d 59 01 STA enemy01_Flag 3401 d9d4 .L0219 ;; playerFlag = 0 : gameover_flag = 0 3402 d9d4 3403 d9d4 a9 00 LDA #0 3404 d9d6 8d 4d 01 STA playerFlag 3405 d9d9 8d 5f 01 STA gameover_flag 3406 d9dc .L0220 ;; power_upFlag = 0 : twinlaser_flag = 0 3407 d9dc 3408 d9dc a9 00 LDA #0 3409 d9de 8d 52 01 STA power_upFlag 3410 d9e1 8d 67 01 STA twinlaser_flag 3411 d9e4 . 3412 d9e4 ;; 3413 d9e4 3414 d9e4 . 3415 d9e4 ;; 3416 d9e4 3417 d9e4 .lose_a_lifeloop 3418 d9e4 ;; lose_a_lifeloop 3419 d9e4 3420 d9e4 .L0221 ;; restorescreen 3421 d9e4 3422 d9e4 20 9e f0 jsr restorescreen 3423 d9e7 .L0222 ;; plotvalue vertical_shooting_score_10_digits 3 score0 6 25 8 3424 d9e7 3425 d9e7 a9 39 lda #vertical_shooting_score_10_digits 3429 d9ed 85 43 sta temp2 3430 d9ef 3431 d9ef ad 06 21 lda charactermode 3432 d9f2 85 4a sta temp9 3433 d9f4 a9 60 lda #(vertical_shooting_score_10_digits_mode | %01100000) 3434 d9f6 8d 06 21 sta charactermode 3435 d9f9 a9 1a lda #26 ; width in two's complement 3436 d9fb 09 60 ora #96 ; palette left shifted 5 bits 3437 d9fd 85 44 sta temp3 3438 d9ff a9 19 lda #25 3439 da01 85 45 sta temp4 3440 da03 3441 da03 a9 08 lda #8 3442 da05 85 46 sta temp5 3443 da07 3444 da07 a9 06 lda #6 3445 da09 85 47 sta temp6 3446 da0b 3447 da0b a9 a6 lda #score0 3451 da11 85 49 sta temp8 3452 da13 3453 da13 20 8e f3 jsr plotvalue 3454 da13 00 01 USED_PLOTVALUE = 1 3455 da16 a5 4a lda temp9 3456 da18 8d 06 21 sta charactermode 3457 da1b .L0223 ;; plotvalue vertical_shooting_score_10_digits 3 score1 1 153 8 3458 da1b 3459 da1b a9 39 lda #vertical_shooting_score_10_digits 3463 da21 85 43 sta temp2 3464 da23 3465 da23 ad 06 21 lda charactermode 3466 da26 85 4a sta temp9 3467 da28 a9 60 lda #(vertical_shooting_score_10_digits_mode | %01100000) 3468 da2a 8d 06 21 sta charactermode 3469 da2d a9 1f lda #31 ; width in two's complement 3470 da2f 09 60 ora #96 ; palette left shifted 5 bits 3471 da31 85 44 sta temp3 3472 da33 a9 99 lda #153 3473 da35 85 45 sta temp4 3474 da37 3475 da37 a9 08 lda #8 3476 da39 85 46 sta temp5 3477 da3b 3478 da3b a9 01 lda #1 3479 da3d 85 47 sta temp6 3480 da3f 3481 da3f a9 a9 lda #score1 3485 da45 85 49 sta temp8 3486 da47 3487 da47 20 8e f3 jsr plotvalue 3488 da47 00 01 USED_PLOTVALUE = 1 3489 da4a a5 4a lda temp9 3490 da4c 8d 06 21 sta charactermode 3491 da4f .L0224 ;; drawscreen 3492 da4f 3493 da4f 20 c0 f0 jsr drawscreen 3494 da52 .L0225 ;; if joy0fire then fire_debounce = 2 3495 da52 3496 da52 2c 02 21 bit sINPT1 3497 da55 10 05 BPL .skipL0225 3498 da57 .condpart112 3499 da57 a9 02 LDA #2 3500 da59 8d 43 01 STA fire_debounce 3501 da5c .skipL0225 3502 da5c .L0226 ;; if !joy0fire then fire_debounce = 1 3503 da5c 3504 da5c 2c 02 21 bit sINPT1 3505 da5f 30 05 BMI .skipL0226 3506 da61 .condpart113 3507 da61 a9 01 LDA #1 3508 da63 8d 43 01 STA fire_debounce 3509 da66 .skipL0226 3510 da66 .L0227 ;; if fire_debounce = 1 && lives > 0 then clearscreen : goto main 3511 da66 3512 da66 ad 43 01 LDA fire_debounce 3513 da69 c9 01 CMP #1 3514 da6b d0 0d BNE .skipL0227 3515 da6d .condpart114 3516 da6d a9 00 LDA #0 3517 da6f cd 64 01 CMP lives 3518 da72 b0 06 BCS .skip114then 3519 da74 .condpart115 3520 da74 20 8c f0 jsr clearscreen 3521 da77 4c e0 c1 jmp .main 3522 da7a 3523 da7a .skip114then 3524 da7a .skipL0227 3525 da7a .L0228 ;; if fire_debounce = 1 && lives < 1 then clearscreen : goto gameover 3526 da7a 3527 da7a ad 43 01 LDA fire_debounce 3528 da7d c9 01 CMP #1 3529 da7f d0 0d BNE .skipL0228 3530 da81 .condpart116 3531 da81 ad 64 01 LDA lives 3532 da84 c9 01 CMP #1 3533 da86 b0 06 BCS .skip116then 3534 da88 .condpart117 3535 da88 20 8c f0 jsr clearscreen 3536 da8b 4c 91 da jmp .gameover 3537 da8e 3538 da8e .skip116then 3539 da8e .skipL0228 3540 da8e .L0229 ;; goto lose_a_lifeloop 3541 da8e 3542 da8e 4c e4 d9 jmp .lose_a_lifeloop 3543 da91 3544 da91 . 3545 da91 ;; 3546 da91 3547 da91 .gameover 3548 da91 ;; gameover 3549 da91 3550 da91 .L0230 ;; gameover_flag = 0 3551 da91 3552 da91 a9 00 LDA #0 3553 da93 8d 5f 01 STA gameover_flag 3554 da96 .gameover_loop 3555 da96 ;; gameover_loop 3556 da96 3557 da96 .L0231 ;; if lives = 0 then gameover_flag = 1 : clearscreen 3558 da96 3559 da96 ad 64 01 LDA lives 3560 da99 c9 00 CMP #0 3561 da9b d0 08 BNE .skipL0231 3562 da9d .condpart118 3563 da9d a9 01 LDA #1 3564 da9f 8d 5f 01 STA gameover_flag 3565 daa2 20 8c f0 jsr clearscreen 3566 daa5 .skipL0231 3567 daa5 .L0232 ;; plotchars 'Game^Over!' 0 40 16 3568 daa5 3569 daa5 4c b2 da JMP skipalphadata8 3570 daa8 alphadata8 3571 daa8 8e .byte.b (alphadata8 3586 dab8 85 43 sta temp2 3587 daba 3588 daba a9 16 lda #22 ; width in two's complement 3589 dabc 09 00 ora #0 ; palette left shifted 5 bits 3590 dabe 85 44 sta temp3 3591 dac0 a9 28 lda #40 3592 dac2 85 45 sta temp4 3593 dac4 3594 dac4 a9 10 lda #16 3595 dac6 3596 dac6 85 46 sta temp5 3597 dac8 3598 dac8 20 59 f3 jsr plotcharacters 3599 dacb .L0233 ;; if joy0fire then fire_debounce = 1 3600 dacb 3601 dacb 2c 02 21 bit sINPT1 3602 dace 10 05 BPL .skipL0233 3603 dad0 .condpart119 3604 dad0 a9 01 LDA #1 3605 dad2 8d 43 01 STA fire_debounce 3606 dad5 .skipL0233 3607 dad5 .L0234 ;; if !joy0fire then fire_debounce = 0 3608 dad5 3609 dad5 2c 02 21 bit sINPT1 3610 dad8 30 05 BMI .skipL0234 3611 dada .condpart120 3612 dada a9 00 LDA #0 3613 dadc 8d 43 01 STA fire_debounce 3614 dadf .skipL0234 3615 dadf .L0235 ;; if fire_debounce = 1 then clearscreen : goto plot 3616 dadf 3617 dadf ad 43 01 LDA fire_debounce 3618 dae2 c9 01 CMP #1 3619 dae4 d0 06 BNE .skipL0235 3620 dae6 .condpart121 3621 dae6 20 8c f0 jsr clearscreen 3622 dae9 4c 3d c0 jmp .plot 3623 daec 3624 daec .skipL0235 3625 daec .L0236 ;; goto gameover_loop 3626 daec 3627 daec 4c 96 da jmp .gameover_loop 3628 daef 3629 daef . 3630 daef ;; 3631 daef 3632 daef . 3633 daef ;; 3634 daef 3635 daef .L0237 ;; data sfx_bling 3636 daef 3637 daef 4c 28 db JMP .skipL0237 3638 daf2 sfx_bling 3639 daf2 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 3640 daf5 3641 daf5 1c 04 07 .byte.b $1c,$04,$07 3642 daf8 3643 daf8 1b 04 07 .byte.b $1b,$04,$07 3644 dafb 3645 dafb 04 0f 05 .byte.b $04,$0f,$05 3646 dafe 3647 dafe 15 04 09 .byte.b $15,$04,$09 3648 db01 3649 db01 16 04 07 .byte.b $16,$04,$07 3650 db04 3651 db04 03 0f 04 .byte.b $03,$0f,$04 3652 db07 3653 db07 11 04 08 .byte.b $11,$04,$08 3654 db0a 3655 db0a 11 04 08 .byte.b $11,$04,$08 3656 db0d 3657 db0d 11 04 04 .byte.b $11,$04,$04 3658 db10 3659 db10 0e 04 09 .byte.b $0e,$04,$09 3660 db13 3661 db13 0e 04 07 .byte.b $0e,$04,$07 3662 db16 3663 db16 0e 04 04 .byte.b $0e,$04,$04 3664 db19 3665 db19 1c 04 07 .byte.b $1c,$04,$07 3666 db1c 3667 db1c 1b 04 05 .byte.b $1b,$04,$05 3668 db1f 3669 db1f 1c 04 04 .byte.b $1c,$04,$04 3670 db22 3671 db22 1b 04 02 .byte.b $1b,$04,$02 3672 db25 3673 db25 00 00 00 .byte.b $00,$00,$00 3674 db28 3675 db28 .skipL0237 3676 db28 00 f2 sfx_bling_lo = #sfx_bling 3678 db28 . 3679 db28 ;; 3680 db28 3681 db28 .L0238 ;; data sfx_pulsecannon 3682 db28 3683 db28 4c 7f db JMP .skipL0238 3684 db2b sfx_pulsecannon 3685 db2b 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 3686 db2e 3687 db2e 1e 0c 0a .byte.b $1e,$0c,$0a ; first chunk of freq,channel,volume 3688 db31 3689 db31 07 06 0f .byte.b $07,$06,$0f 3690 db34 3691 db34 07 06 0f .byte.b $07,$06,$0f 3692 db37 3693 db37 1e 06 0f .byte.b $1e,$06,$0f 3694 db3a 3695 db3a 17 0c 0b .byte.b $17,$0c,$0b 3696 db3d 3697 db3d 1b 0c 0b .byte.b $1b,$0c,$0b 3698 db40 3699 db40 1e 0c 0f .byte.b $1e,$0c,$0f 3700 db43 3701 db43 07 06 0f .byte.b $07,$06,$0f 3702 db46 3703 db46 07 06 0f .byte.b $07,$06,$0f 3704 db49 3705 db49 1e 06 08 .byte.b $1e,$06,$08 3706 db4c 3707 db4c 17 0c 06 .byte.b $17,$0c,$06 3708 db4f 3709 db4f 1b 0c 0f .byte.b $1b,$0c,$0f 3710 db52 3711 db52 1e 0c 0f .byte.b $1e,$0c,$0f 3712 db55 3713 db55 07 06 0f .byte.b $07,$06,$0f 3714 db58 3715 db58 07 06 0f .byte.b $07,$06,$0f 3716 db5b 3717 db5b 0a 06 0a .byte.b $0a,$06,$0a 3718 db5e 3719 db5e 17 0c 0a .byte.b $17,$0c,$0a 3720 db61 3721 db61 1e 0c 04 .byte.b $1e,$0c,$04 3722 db64 3723 db64 1e 06 09 .byte.b $1e,$06,$09 3724 db67 3725 db67 1b 04 05 .byte.b $1b,$04,$05 3726 db6a 3727 db6a 07 06 0f .byte.b $07,$06,$0f 3728 db6d 3729 db6d 0a 06 09 .byte.b $0a,$06,$09 3730 db70 3731 db70 17 0c 0d .byte.b $17,$0c,$0d 3732 db73 3733 db73 1b 0c 09 .byte.b $1b,$0c,$09 3734 db76 3735 db76 0a 06 05 .byte.b $0a,$06,$05 3736 db79 3737 db79 17 0c 03 .byte.b $17,$0c,$03 3738 db7c 3739 db7c 00 00 00 .byte.b $00,$00,$00 3740 db7f 3741 db7f .skipL0238 3742 db7f 00 2b sfx_pulsecannon_lo = #sfx_pulsecannon 3744 db7f . 3745 db7f ;; 3746 db7f 3747 db7f .L0239 ;; data sfx_plainlaser 3748 db7f 3749 db7f 4c b2 db JMP .skipL0239 3750 db82 sfx_plainlaser 3751 db82 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 3752 db85 3753 db85 10 04 06 .byte.b $10,$04,$06 ; first chunk of freq,channel,volume 3754 db88 3755 db88 13 04 08 .byte.b $13,$04,$08 3756 db8b 3757 db8b 16 04 08 .byte.b $16,$04,$08 3758 db8e 3759 db8e 16 04 07 .byte.b $16,$04,$07 3760 db91 3761 db91 1c 04 09 .byte.b $1c,$04,$09 3762 db94 3763 db94 0b 0c 0f .byte.b $0b,$0c,$0f 3764 db97 3765 db97 0d 0c 0f .byte.b $0d,$0c,$0f 3766 db9a 3767 db9a 0e 0c 0f .byte.b $0e,$0c,$0f 3768 db9d 3769 db9d 0e 0c 0f .byte.b $0e,$0c,$0f 3770 dba0 3771 dba0 12 0c 0f .byte.b $12,$0c,$0f 3772 dba3 3773 dba3 03 06 0d .byte.b $03,$06,$0d 3774 dba6 3775 dba6 1e 0c 0a .byte.b $1e,$0c,$0a 3776 dba9 3777 dba9 1e 0c 0c .byte.b $1e,$0c,$0c 3778 dbac 3779 dbac 0a 06 04 .byte.b $0a,$06,$04 3780 dbaf 3781 dbaf 00 00 00 .byte.b $00,$00,$00 3782 dbb2 3783 dbb2 .skipL0239 3784 dbb2 00 82 sfx_plainlaser_lo = #sfx_plainlaser 3786 dbb2 . 3787 dbb2 ;; 3788 dbb2 3789 dbb2 .L0240 ;; data sfx_explosion 3790 dbb2 3791 dbb2 4c 45 dc JMP .skipL0240 3792 dbb5 sfx_explosion 3793 dbb5 10 10 00 .byte.b $10,$10,$00 3794 dbb8 3795 dbb8 01 08 02 .byte.b $01,$08,$02 3796 dbbb 3797 dbbb 0b 0c 05 .byte.b $0b,$0c,$05 3798 dbbe 3799 dbbe 04 06 08 .byte.b $04,$06,$08 3800 dbc1 3801 dbc1 03 0e 0f .byte.b $03,$0e,$0f 3802 dbc4 3803 dbc4 09 06 0f .byte.b $09,$06,$0f 3804 dbc7 3805 dbc7 0d 06 0f .byte.b $0d,$06,$0f 3806 dbca 3807 dbca 04 0e 0f .byte.b $04,$0e,$0f 3808 dbcd 3809 dbcd 0f 06 08 .byte.b $0f,$06,$08 3810 dbd0 3811 dbd0 09 06 04 .byte.b $09,$06,$04 3812 dbd3 3813 dbd3 16 01 03 .byte.b $16,$01,$03 3814 dbd6 3815 dbd6 0c 06 04 .byte.b $0c,$06,$04 3816 dbd9 3817 dbd9 09 06 05 .byte.b $09,$06,$05 3818 dbdc 3819 dbdc 0a 06 03 .byte.b $0a,$06,$03 3820 dbdf 3821 dbdf 09 06 05 .byte.b $09,$06,$05 3822 dbe2 3823 dbe2 0d 06 08 .byte.b $0d,$06,$08 3824 dbe5 3825 dbe5 09 06 04 .byte.b $09,$06,$04 3826 dbe8 3827 dbe8 04 0e 06 .byte.b $04,$0e,$06 3828 dbeb 3829 dbeb 0f 06 05 .byte.b $0f,$06,$05 3830 dbee 3831 dbee 0f 06 07 .byte.b $0f,$06,$07 3832 dbf1 3833 dbf1 04 0e 07 .byte.b $04,$0e,$07 3834 dbf4 3835 dbf4 08 06 06 .byte.b $08,$06,$06 3836 dbf7 3837 dbf7 03 0e 08 .byte.b $03,$0e,$08 3838 dbfa 3839 dbfa 0f 06 06 .byte.b $0f,$06,$06 3840 dbfd 3841 dbfd 09 06 05 .byte.b $09,$06,$05 3842 dc00 3843 dc00 06 06 05 .byte.b $06,$06,$05 3844 dc03 3845 dc03 03 0e 05 .byte.b $03,$0e,$05 3846 dc06 3847 dc06 0e 06 06 .byte.b $0e,$06,$06 3848 dc09 3849 dc09 02 0e 05 .byte.b $02,$0e,$05 3850 dc0c 3851 dc0c 0f 06 03 .byte.b $0f,$06,$03 3852 dc0f 3853 dc0f 0e 06 06 .byte.b $0e,$06,$06 3854 dc12 3855 dc12 09 06 05 .byte.b $09,$06,$05 3856 dc15 3857 dc15 0c 06 05 .byte.b $0c,$06,$05 3858 dc18 3859 dc18 0f 06 03 .byte.b $0f,$06,$03 3860 dc1b 3861 dc1b 04 0e 08 .byte.b $04,$0e,$08 3862 dc1e 3863 dc1e 0c 06 03 .byte.b $0c,$06,$03 3864 dc21 3865 dc21 0f 06 03 .byte.b $0f,$06,$03 3866 dc24 3867 dc24 0c 06 06 .byte.b $0c,$06,$06 3868 dc27 3869 dc27 0f 06 04 .byte.b $0f,$06,$04 3870 dc2a 3871 dc2a 0f 06 05 .byte.b $0f,$06,$05 3872 dc2d 3873 dc2d 0f 06 03 .byte.b $0f,$06,$03 3874 dc30 3875 dc30 0a 06 04 .byte.b $0a,$06,$04 3876 dc33 3877 dc33 0f 06 03 .byte.b $0f,$06,$03 3878 dc36 3879 dc36 08 06 03 .byte.b $08,$06,$03 3880 dc39 3881 dc39 0c 06 03 .byte.b $0c,$06,$03 3882 dc3c 3883 dc3c 0e 06 03 .byte.b $0e,$06,$03 3884 dc3f 3885 dc3f 08 06 03 .byte.b $08,$06,$03 3886 dc42 3887 dc42 00 00 00 .byte.b $00,$00,$00 3888 dc45 3889 dc45 .skipL0240 3890 dc45 00 b5 sfx_explosion_lo = #sfx_explosion 3892 dc45 DMAHOLEEND0 SET . 955 bytes of ROM space left in DMA hole 0. 3893 dc45 echo " "," "," "," ",[(256*WZONEHEIGHT)-(DMAHOLEEND0 - DMAHOLESTART0)]d , "bytes of ROM space left in DMA hole 0." 3894 dc45 - if ((256*WZONEHEIGHT)-(DMAHOLEEND0 - DMAHOLESTART0)) < 0 3895 dc45 -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 3896 dc45 endif 3897 dc45 3898 e000 ORG $E000,0 ; ************* 3899 e000 3900 e000 vertical_shooting_font 3901 e000 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 3902 e020 00 00 00 00* HEX 00000000000000000000000000 3903 e02d vertical_shooting_ship 3904 e02d 07 d0 HEX 07d0 3905 e02f vertical_shooting_ship_tallsprite_00 3906 e02f 80 02 HEX 8002 3907 e031 vertical_shooting_bullet 3908 e031 28 HEX 28 3909 e032 vertical_shooting_enemyshot 3910 e032 00 HEX 00 3911 e033 vertical_shooting_powerup 3912 e033 28 00 HEX 2800 3913 e035 vertical_shooting_enemy01 3914 e035 09 e0 HEX 09e0 3915 e037 vertical_shooting_enemy01_tallsprite_00 3916 e037 40 03 HEX 4003 3917 e039 vertical_shooting_score_10_digits 3918 e039 00 00 00 00* HEX 00000000000000000000 3919 e043 vertical_shooting_1up 3920 e043 15 55 HEX 1555 3921 e045 vertical_shooting_explosion_01 3922 e045 02 80 HEX 0280 3923 e047 vertical_shooting_explosion_01_tallsprite_00 3924 e047 00 00 HEX 0000 3925 e049 vertical_shooting_explosion_02 3926 e049 05 50 HEX 0550 3927 e04b vertical_shooting_explosion_02_tallsprite_00 3928 e04b 00 00 HEX 0000 3929 e04d vertical_shooting_explosion_03 3930 e04d 15 54 HEX 1554 3931 e04f vertical_shooting_explosion_03_tallsprite_00 3932 e04f 00 00 HEX 0000 3933 e051 vertical_shooting_explosion_04 3934 e051 07 d0 HEX 07d0 3935 e053 vertical_shooting_explosion_04_tallsprite_00 3936 e053 00 00 HEX 0000 3937 e055 vertical_shooting_explosion_05 3938 e055 0c 30 HEX 0c30 3939 e057 vertical_shooting_explosion_05_tallsprite_00 3940 e057 01 40 HEX 0140 3941 e059 vertical_shooting_explosion_06 3942 e059 00 00 HEX 0000 3943 e05b vertical_shooting_explosion_06_tallsprite_00 3944 e05b 01 40 HEX 0140 3945 e05d vertical_shooting_explosion_07 3946 e05d 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 3947 e071 vertical_shooting_explosion_07_tallsprite_00 3948 e071 00 00 00 00* HEX 00000000000000000140014001400140014003c0 3949 e085 vertical_shooting_explosion_08 3950 e085 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 3951 e099 vertical_shooting_explosion_08_tallsprite_00 3952 e099 00 00 00 00* HEX 00000000000000000140014001400140014003c0 3953 e0ad vertical_shooting_explosion_09 3954 e0ad 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 3955 e0c1 vertical_shooting_explosion_09_tallsprite_00 3956 e0c1 00 00 00 00* HEX 00000000000000000140014001400140014003c0 3957 e0d5 vertical_shooting_explosion_10 3958 e0d5 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 3959 e0e9 vertical_shooting_explosion_10_tallsprite_00 3960 e0e9 00 00 00 00* HEX 00000000000000000140014001400140014003c0 3961 e0fd vertical_shooting_laser 3962 e0fd 88 HEX 88 3963 e0fe vertical_shooting_laser_tallsprite_00 3964 e0fe cc HEX cc 3965 e0ff 3966 e100 ORG $E100,0 ; ************* 3967 e100 3968 e100 ;vertical_shooting_font 3969 e100 00 54 54 54* HEX 0054545454045454045404445054505440544454104454444410401444501014 3970 e120 10 44 44 10* HEX 10444410544040101040400000 3971 e12d ;vertical_shooting_ship 3972 e12d 07 d0 HEX 07d0 3973 e12f ;vertical_shooting_ship_tallsprite_00 3974 e12f 80 02 HEX 8002 3975 e131 ;vertical_shooting_bullet 3976 e131 28 HEX 28 3977 e132 ;vertical_shooting_enemyshot 3978 e132 88 HEX 88 3979 e133 ;vertical_shooting_powerup 3980 e133 78 08 HEX 7808 3981 e135 ;vertical_shooting_enemy01 3982 e135 09 e0 HEX 09e0 3983 e137 ;vertical_shooting_enemy01_tallsprite_00 3984 e137 50 0f HEX 500f 3985 e139 ;vertical_shooting_score_10_digits 3986 e139 54 54 54 10* HEX 54545410041054041010 3987 e143 ;vertical_shooting_1up 3988 e143 ea a9 HEX eaa9 3989 e145 ;vertical_shooting_explosion_01 3990 e145 01 40 HEX 0140 3991 e147 ;vertical_shooting_explosion_01_tallsprite_00 3992 e147 00 00 HEX 0000 3993 e149 ;vertical_shooting_explosion_02 3994 e149 09 60 HEX 0960 3995 e14b ;vertical_shooting_explosion_02_tallsprite_00 3996 e14b 00 00 HEX 0000 3997 e14d ;vertical_shooting_explosion_03 3998 e14d 25 58 HEX 2558 3999 e14f ;vertical_shooting_explosion_03_tallsprite_00 4000 e14f 00 00 HEX 0000 4001 e151 ;vertical_shooting_explosion_04 4002 e151 05 50 HEX 0550 4003 e153 ;vertical_shooting_explosion_04_tallsprite_00 4004 e153 02 80 HEX 0280 4005 e155 ;vertical_shooting_explosion_05 4006 e155 0b e0 HEX 0be0 4007 e157 ;vertical_shooting_explosion_05_tallsprite_00 4008 e157 01 40 HEX 0140 4009 e159 ;vertical_shooting_explosion_06 4010 e159 0c 30 HEX 0c30 4011 e15b ;vertical_shooting_explosion_06_tallsprite_00 4012 e15b 01 40 HEX 0140 4013 e15d ;vertical_shooting_explosion_07 4014 e15d 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 4015 e171 ;vertical_shooting_explosion_07_tallsprite_00 4016 e171 00 00 00 00* HEX 0000000000000140014001400140014001400000 4017 e185 ;vertical_shooting_explosion_08 4018 e185 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 4019 e199 ;vertical_shooting_explosion_08_tallsprite_00 4020 e199 00 00 00 00* HEX 0000000000000140014001400140014001400000 4021 e1ad ;vertical_shooting_explosion_09 4022 e1ad 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 4023 e1c1 ;vertical_shooting_explosion_09_tallsprite_00 4024 e1c1 00 00 00 00* HEX 0000000000000140014001400140014001400000 4025 e1d5 ;vertical_shooting_explosion_10 4026 e1d5 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 4027 e1e9 ;vertical_shooting_explosion_10_tallsprite_00 4028 e1e9 00 00 00 00* HEX 0000000000000140014001400140014001400000 4029 e1fd ;vertical_shooting_laser 4030 e1fd 88 HEX 88 4031 e1fe ;vertical_shooting_laser_tallsprite_00 4032 e1fe cc HEX cc 4033 e1ff 4034 e200 ORG $E200,0 ; ************* 4035 e200 4036 e200 ;vertical_shooting_font 4037 e200 00 44 10 40* HEX 0044104004040444044404444440444040444410444440444444404444041044 4038 e220 10 54 44 10* HEX 10544410400010000000100000 4039 e22d ;vertical_shooting_ship 4040 e22d 03 c0 HEX 03c0 4041 e22f ;vertical_shooting_ship_tallsprite_00 4042 e22f a1 4a HEX a14a 4043 e231 ;vertical_shooting_bullet 4044 e231 3c HEX 3c 4045 e232 ;vertical_shooting_enemyshot 4046 e232 10 HEX 10 4047 e233 ;vertical_shooting_powerup 4048 e233 78 1e HEX 781e 4049 e235 ;vertical_shooting_enemy01 4050 e235 19 ec HEX 19ec 4051 e237 ;vertical_shooting_enemy01_tallsprite_00 4052 e237 5a af HEX 5aaf 4053 e239 ;vertical_shooting_score_10_digits 4054 e239 cc 30 c0 cc* HEX cc30c0cc0ccccc0ccc0c 4055 e243 ;vertical_shooting_1up 4056 e243 d5 58 HEX d558 4057 e245 ;vertical_shooting_explosion_01 4058 e245 00 00 HEX 0000 4059 e247 ;vertical_shooting_explosion_01_tallsprite_00 4060 e247 00 00 HEX 0000 4061 e249 ;vertical_shooting_explosion_02 4062 e249 02 80 HEX 0280 4063 e24b ;vertical_shooting_explosion_02_tallsprite_00 4064 e24b 00 00 HEX 0000 4065 e24d ;vertical_shooting_explosion_03 4066 e24d 09 60 HEX 0960 4067 e24f ;vertical_shooting_explosion_03_tallsprite_00 4068 e24f 00 00 HEX 0000 4069 e251 ;vertical_shooting_explosion_04 4070 e251 05 50 HEX 0550 4071 e253 ;vertical_shooting_explosion_04_tallsprite_00 4072 e253 02 80 HEX 0280 4073 e255 ;vertical_shooting_explosion_05 4074 e255 0a a0 HEX 0aa0 4075 e257 ;vertical_shooting_explosion_05_tallsprite_00 4076 e257 05 50 HEX 0550 4077 e259 ;vertical_shooting_explosion_06 4078 e259 0b e0 HEX 0be0 4079 e25b ;vertical_shooting_explosion_06_tallsprite_00 4080 e25b 05 50 HEX 0550 4081 e25d ;vertical_shooting_explosion_07 4082 e25d 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 4083 e271 ;vertical_shooting_explosion_07_tallsprite_00 4084 e271 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 4085 e285 ;vertical_shooting_explosion_08 4086 e285 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 4087 e299 ;vertical_shooting_explosion_08_tallsprite_00 4088 e299 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 4089 e2ad ;vertical_shooting_explosion_09 4090 e2ad 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 4091 e2c1 ;vertical_shooting_explosion_09_tallsprite_00 4092 e2c1 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 4093 e2d5 ;vertical_shooting_explosion_10 4094 e2d5 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 4095 e2e9 ;vertical_shooting_explosion_10_tallsprite_00 4096 e2e9 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 4097 e2fd ;vertical_shooting_laser 4098 e2fd 44 HEX 44 4099 e2fe ;vertical_shooting_laser_tallsprite_00 4100 e2fe cc HEX cc 4101 e2ff 4102 e300 ORG $E300,0 ; ************* 4103 e300 4104 e300 ;vertical_shooting_font 4105 e300 00 44 10 40* HEX 0044104004040444044404444440444040444410044440444444404444041044 4106 e320 54 54 44 10* HEX 54544410100000101000000000 4107 e32d ;vertical_shooting_ship 4108 e32d 01 40 HEX 0140 4109 e32f ;vertical_shooting_ship_tallsprite_00 4110 e32f a5 5a HEX a55a 4111 e331 ;vertical_shooting_bullet 4112 e331 3c HEX 3c 4113 e332 ;vertical_shooting_enemyshot 4114 e332 74 HEX 74 4115 e333 ;vertical_shooting_powerup 4116 e333 7a a4 HEX 7aa4 4117 e335 ;vertical_shooting_enemy01 4118 e335 59 ef HEX 59ef 4119 e337 ;vertical_shooting_enemy01_tallsprite_00 4120 e337 59 ef HEX 59ef 4121 e339 ;vertical_shooting_score_10_digits 4122 e339 44 10 40 04* HEX 44104004040444044404 4123 e343 ;vertical_shooting_1up 4124 e343 35 60 HEX 3560 4125 e345 ;vertical_shooting_explosion_01 4126 e345 00 00 HEX 0000 4127 e347 ;vertical_shooting_explosion_01_tallsprite_00 4128 e347 00 00 HEX 0000 4129 e349 ;vertical_shooting_explosion_02 4130 e349 00 00 HEX 0000 4131 e34b ;vertical_shooting_explosion_02_tallsprite_00 4132 e34b 00 00 HEX 0000 4133 e34d ;vertical_shooting_explosion_03 4134 e34d 02 80 HEX 0280 4135 e34f ;vertical_shooting_explosion_03_tallsprite_00 4136 e34f 00 00 HEX 0000 4137 e351 ;vertical_shooting_explosion_04 4138 e351 09 60 HEX 0960 4139 e353 ;vertical_shooting_explosion_04_tallsprite_00 4140 e353 09 60 HEX 0960 4141 e355 ;vertical_shooting_explosion_05 4142 e355 06 90 HEX 0690 4143 e357 ;vertical_shooting_explosion_05_tallsprite_00 4144 e357 06 90 HEX 0690 4145 e359 ;vertical_shooting_explosion_06 4146 e359 06 90 HEX 0690 4147 e35b ;vertical_shooting_explosion_06_tallsprite_00 4148 e35b 06 90 HEX 0690 4149 e35d ;vertical_shooting_explosion_07 4150 e35d 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 4151 e371 ;vertical_shooting_explosion_07_tallsprite_00 4152 e371 00 00 00 00* HEX 000000000000069006900690069007d00c300000 4153 e385 ;vertical_shooting_explosion_08 4154 e385 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 4155 e399 ;vertical_shooting_explosion_08_tallsprite_00 4156 e399 00 00 00 00* HEX 000000000000069006900690069007d00c300000 4157 e3ad ;vertical_shooting_explosion_09 4158 e3ad 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 4159 e3c1 ;vertical_shooting_explosion_09_tallsprite_00 4160 e3c1 00 00 00 00* HEX 000000000000069006900690069007d00c300000 4161 e3d5 ;vertical_shooting_explosion_10 4162 e3d5 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 4163 e3e9 ;vertical_shooting_explosion_10_tallsprite_00 4164 e3e9 00 00 00 00* HEX 000000000000069006900690069007d00c300000 4165 e3fd ;vertical_shooting_laser 4166 e3fd 44 HEX 44 4167 e3fe ;vertical_shooting_laser_tallsprite_00 4168 e3fe cc HEX cc 4169 e3ff 4170 e400 ORG $E400,0 ; ************* 4171 e400 4172 e400 ;vertical_shooting_font 4173 e400 00 44 10 54* HEX 0044105454545454045454545040445454445410045040544444504450101044 4174 e420 44 44 10 10* HEX 44441010100000101000000000 4175 e42d ;vertical_shooting_ship 4176 e42d 01 40 HEX 0140 4177 e42f ;vertical_shooting_ship_tallsprite_00 4178 e42f a5 5a HEX a55a 4179 e431 ;vertical_shooting_bullet 4180 e431 14 HEX 14 4181 e432 ;vertical_shooting_enemyshot 4182 e432 74 HEX 74 4183 e433 ;vertical_shooting_powerup 4184 e433 75 7a HEX 757a 4185 e435 ;vertical_shooting_enemy01 4186 e435 59 6f HEX 596f 4187 e437 ;vertical_shooting_enemy01_tallsprite_00 4188 e437 59 ef HEX 59ef 4189 e439 ;vertical_shooting_score_10_digits 4190 e439 44 10 10 10* HEX 44101010540454041014 4191 e443 ;vertical_shooting_1up 4192 e443 35 60 HEX 3560 4193 e445 ;vertical_shooting_explosion_01 4194 e445 00 00 HEX 0000 4195 e447 ;vertical_shooting_explosion_01_tallsprite_00 4196 e447 00 00 HEX 0000 4197 e449 ;vertical_shooting_explosion_02 4198 e449 00 00 HEX 0000 4199 e44b ;vertical_shooting_explosion_02_tallsprite_00 4200 e44b 00 00 HEX 0000 4201 e44d ;vertical_shooting_explosion_03 4202 e44d 00 00 HEX 0000 4203 e44f ;vertical_shooting_explosion_03_tallsprite_00 4204 e44f 02 80 HEX 0280 4205 e451 ;vertical_shooting_explosion_04 4206 e451 09 60 HEX 0960 4207 e453 ;vertical_shooting_explosion_04_tallsprite_00 4208 e453 09 60 HEX 0960 4209 e455 ;vertical_shooting_explosion_05 4210 e455 06 90 HEX 0690 4211 e457 ;vertical_shooting_explosion_05_tallsprite_00 4212 e457 06 90 HEX 0690 4213 e459 ;vertical_shooting_explosion_06 4214 e459 06 90 HEX 0690 4215 e45b ;vertical_shooting_explosion_06_tallsprite_00 4216 e45b 06 90 HEX 0690 4217 e45d ;vertical_shooting_explosion_07 4218 e45d 00 00 00 00* HEX 000000000000069006900690069007d00c300000 4219 e471 ;vertical_shooting_explosion_07_tallsprite_00 4220 e471 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 4221 e485 ;vertical_shooting_explosion_08 4222 e485 00 00 00 00* HEX 000000000000069006900690069007d00c300000 4223 e499 ;vertical_shooting_explosion_08_tallsprite_00 4224 e499 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 4225 e4ad ;vertical_shooting_explosion_09 4226 e4ad 00 00 00 00* HEX 000000000000069006900690069007d00c300000 4227 e4c1 ;vertical_shooting_explosion_09_tallsprite_00 4228 e4c1 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 4229 e4d5 ;vertical_shooting_explosion_10 4230 e4d5 00 00 00 00* HEX 000000000000069006900690069007d00c300000 4231 e4e9 ;vertical_shooting_explosion_10_tallsprite_00 4232 e4e9 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 4233 e4fd ;vertical_shooting_laser 4234 e4fd 44 HEX 44 4235 e4fe ;vertical_shooting_laser_tallsprite_00 4236 e4fe cc HEX cc 4237 e4ff 4238 e500 ORG $E500,0 ; ************* 4239 e500 4240 e500 ;vertical_shooting_font 4241 e500 00 44 10 04* HEX 0044100404444040044444444440444040404410044440544444444444401044 4242 e520 44 44 44 54* HEX 44444454100000041000000000 4243 e52d ;vertical_shooting_ship 4244 e52d 01 40 HEX 0140 4245 e52f ;vertical_shooting_ship_tallsprite_00 4246 e52f a5 5a HEX a55a 4247 e531 ;vertical_shooting_bullet 4248 e531 14 HEX 14 4249 e532 ;vertical_shooting_enemyshot 4250 e532 74 HEX 74 4251 e533 ;vertical_shooting_powerup 4252 e533 78 1e HEX 781e 4253 e535 ;vertical_shooting_enemy01 4254 e535 5a af HEX 5aaf 4255 e537 ;vertical_shooting_enemy01_tallsprite_00 4256 e537 19 ec HEX 19ec 4257 e539 ;vertical_shooting_score_10_digits 4258 e539 88 20 08 08* HEX 8820080888a080088888 4259 e543 ;vertical_shooting_1up 4260 e543 0d 80 HEX 0d80 4261 e545 ;vertical_shooting_explosion_01 4262 e545 00 00 HEX 0000 4263 e547 ;vertical_shooting_explosion_01_tallsprite_00 4264 e547 00 00 HEX 0000 4265 e549 ;vertical_shooting_explosion_02 4266 e549 00 00 HEX 0000 4267 e54b ;vertical_shooting_explosion_02_tallsprite_00 4268 e54b 02 80 HEX 0280 4269 e54d ;vertical_shooting_explosion_03 4270 e54d 00 00 HEX 0000 4271 e54f ;vertical_shooting_explosion_03_tallsprite_00 4272 e54f 09 60 HEX 0960 4273 e551 ;vertical_shooting_explosion_04 4274 e551 02 80 HEX 0280 4275 e553 ;vertical_shooting_explosion_04_tallsprite_00 4276 e553 05 50 HEX 0550 4277 e555 ;vertical_shooting_explosion_05 4278 e555 05 50 HEX 0550 4279 e557 ;vertical_shooting_explosion_05_tallsprite_00 4280 e557 0a a0 HEX 0aa0 4281 e559 ;vertical_shooting_explosion_06 4282 e559 05 50 HEX 0550 4283 e55b ;vertical_shooting_explosion_06_tallsprite_00 4284 e55b 0b e0 HEX 0be0 4285 e55d ;vertical_shooting_explosion_07 4286 e55d 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 4287 e571 ;vertical_shooting_explosion_07_tallsprite_00 4288 e571 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 4289 e585 ;vertical_shooting_explosion_08 4290 e585 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 4291 e599 ;vertical_shooting_explosion_08_tallsprite_00 4292 e599 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 4293 e5ad ;vertical_shooting_explosion_09 4294 e5ad 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 4295 e5c1 ;vertical_shooting_explosion_09_tallsprite_00 4296 e5c1 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 4297 e5d5 ;vertical_shooting_explosion_10 4298 e5d5 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 4299 e5e9 ;vertical_shooting_explosion_10_tallsprite_00 4300 e5e9 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 4301 e5fd ;vertical_shooting_laser 4302 e5fd 44 HEX 44 4303 e5fe ;vertical_shooting_laser_tallsprite_00 4304 e5fe 88 HEX 88 4305 e5ff 4306 e600 ORG $E600,0 ; ************* 4307 e600 4308 e600 ;vertical_shooting_font 4309 e600 00 44 50 04* HEX 0044500404444040044444444440444040404410044440544444444444401044 4310 e620 44 44 44 44* HEX 44444444040000441000001044 4311 e62d ;vertical_shooting_ship 4312 e62d 01 40 HEX 0140 4313 e62f ;vertical_shooting_ship_tallsprite_00 4314 e62f a7 da HEX a7da 4315 e631 ;vertical_shooting_bullet 4316 e631 14 HEX 14 4317 e632 ;vertical_shooting_enemyshot 4318 e632 10 HEX 10 4319 e633 ;vertical_shooting_powerup 4320 e633 7a bc HEX 7abc 4321 e635 ;vertical_shooting_enemy01 4322 e635 50 07 HEX 5007 4323 e637 ;vertical_shooting_enemy01_tallsprite_00 4324 e637 09 e0 HEX 09e0 4325 e639 ;vertical_shooting_score_10_digits 4326 e639 88 a0 88 08* HEX 88a08808888080088888 4327 e643 ;vertical_shooting_1up 4328 e643 0d 80 HEX 0d80 4329 e645 ;vertical_shooting_explosion_01 4330 e645 00 00 HEX 0000 4331 e647 ;vertical_shooting_explosion_01_tallsprite_00 4332 e647 01 40 HEX 0140 4333 e649 ;vertical_shooting_explosion_02 4334 e649 00 00 HEX 0000 4335 e64b ;vertical_shooting_explosion_02_tallsprite_00 4336 e64b 09 60 HEX 0960 4337 e64d ;vertical_shooting_explosion_03 4338 e64d 00 00 HEX 0000 4339 e64f ;vertical_shooting_explosion_03_tallsprite_00 4340 e64f 25 58 HEX 2558 4341 e651 ;vertical_shooting_explosion_04 4342 e651 02 80 HEX 0280 4343 e653 ;vertical_shooting_explosion_04_tallsprite_00 4344 e653 05 50 HEX 0550 4345 e655 ;vertical_shooting_explosion_05 4346 e655 01 40 HEX 0140 4347 e657 ;vertical_shooting_explosion_05_tallsprite_00 4348 e657 0b e0 HEX 0be0 4349 e659 ;vertical_shooting_explosion_06 4350 e659 01 40 HEX 0140 4351 e65b ;vertical_shooting_explosion_06_tallsprite_00 4352 e65b 0c 30 HEX 0c30 4353 e65d ;vertical_shooting_explosion_07 4354 e65d 00 00 00 00* HEX 0000000000000140014001400140014001400000 4355 e671 ;vertical_shooting_explosion_07_tallsprite_00 4356 e671 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 4357 e685 ;vertical_shooting_explosion_08 4358 e685 00 00 00 00* HEX 0000000000000140014001400140014001400000 4359 e699 ;vertical_shooting_explosion_08_tallsprite_00 4360 e699 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 4361 e6ad ;vertical_shooting_explosion_09 4362 e6ad 00 00 00 00* HEX 0000000000000140014001400140014001400000 4363 e6c1 ;vertical_shooting_explosion_09_tallsprite_00 4364 e6c1 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 4365 e6d5 ;vertical_shooting_explosion_10 4366 e6d5 00 00 00 00* HEX 0000000000000140014001400140014001400000 4367 e6e9 ;vertical_shooting_explosion_10_tallsprite_00 4368 e6e9 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 4369 e6fd ;vertical_shooting_laser 4370 e6fd 44 HEX 44 4371 e6fe ;vertical_shooting_laser_tallsprite_00 4372 e6fe 88 HEX 88 4373 e6ff 4374 e700 ORG $E700,0 ; ************* 4375 e700 4376 e700 ;vertical_shooting_font 4377 e700 00 54 10 54* HEX 0054105454445454545454545054505454544454044440445010501050145444 4378 e720 44 44 44 44* HEX 44444444540000101040401044 4379 e72d ;vertical_shooting_ship 4380 e72d 01 40 HEX 0140 4381 e72f ;vertical_shooting_ship_tallsprite_00 4382 e72f 27 d8 HEX 27d8 4383 e731 ;vertical_shooting_bullet 4384 e731 00 HEX 00 4385 e732 ;vertical_shooting_enemyshot 4386 e732 88 HEX 88 4387 e733 ;vertical_shooting_powerup 4388 e733 55 50 HEX 5550 4389 e735 ;vertical_shooting_enemy01 4390 e735 40 01 HEX 4001 4391 e737 ;vertical_shooting_enemy01_tallsprite_00 4392 e737 09 e0 HEX 09e0 4393 e739 ;vertical_shooting_score_10_digits 4394 e739 54 10 10 54* HEX 54101054445454541010 4395 e743 ;vertical_shooting_1up 4396 e743 03 00 HEX 0300 4397 e745 ;vertical_shooting_explosion_01 4398 e745 00 00 HEX 0000 4399 e747 ;vertical_shooting_explosion_01_tallsprite_00 4400 e747 02 80 HEX 0280 4401 e749 ;vertical_shooting_explosion_02 4402 e749 00 00 HEX 0000 4403 e74b ;vertical_shooting_explosion_02_tallsprite_00 4404 e74b 05 50 HEX 0550 4405 e74d ;vertical_shooting_explosion_03 4406 e74d 00 00 HEX 0000 4407 e74f ;vertical_shooting_explosion_03_tallsprite_00 4408 e74f 15 54 HEX 1554 4409 e751 ;vertical_shooting_explosion_04 4410 e751 00 00 HEX 0000 4411 e753 ;vertical_shooting_explosion_04_tallsprite_00 4412 e753 07 d0 HEX 07d0 4413 e755 ;vertical_shooting_explosion_05 4414 e755 01 40 HEX 0140 4415 e757 ;vertical_shooting_explosion_05_tallsprite_00 4416 e757 0c 30 HEX 0c30 4417 e759 ;vertical_shooting_explosion_06 4418 e759 01 40 HEX 0140 4419 e75b ;vertical_shooting_explosion_06_tallsprite_00 4420 e75b 00 00 HEX 0000 4421 e75d ;vertical_shooting_explosion_07 4422 e75d 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4423 e771 ;vertical_shooting_explosion_07_tallsprite_00 4424 e771 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4425 e785 ;vertical_shooting_explosion_08 4426 e785 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4427 e799 ;vertical_shooting_explosion_08_tallsprite_00 4428 e799 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4429 e7ad ;vertical_shooting_explosion_09 4430 e7ad 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4431 e7c1 ;vertical_shooting_explosion_09_tallsprite_00 4432 e7c1 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4433 e7d5 ;vertical_shooting_explosion_10 4434 e7d5 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4435 e7e9 ;vertical_shooting_explosion_10_tallsprite_00 4436 e7e9 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4437 e7fd ;vertical_shooting_laser 4438 e7fd 44 HEX 44 4439 e7fe ;vertical_shooting_laser_tallsprite_00 4440 e7fe 88 HEX 88 4441 e7ff - if SPACEOVERFLOW > 0 4442 e7ff - echo "" 4443 e7ff - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 4444 e7ff - echo "######## look above for areas with negative ROM space left." 4445 e7ff - echo "######## Aborting assembly." 4446 e7ff - ERR 4447 e7ff endif 4448 e7ff 4449 e7ff 4450 e7ff ; Provided under the CC0 license. See the included LICENSE.txt for details. 4451 e7ff 4452 e7ff ifnconst bankswitchmode 4453 e7ff if ( * < $f000 ) 4454 f000 ORG $F000 4455 f000 endif 4456 f000 - else 4457 f000 - ifconst ROM128K 4458 f000 - if ( * < $f000 ) 4459 f000 - ORG $27000 4460 f000 - RORG $F000 4461 f000 - endif 4462 f000 - endif 4463 f000 - ifconst ROM144K 4464 f000 - if ( * < $f000 ) 4465 f000 - ORG $27000 4466 f000 - RORG $F000 4467 f000 - endif 4468 f000 - endif 4469 f000 - ifconst ROM256K 4470 f000 - if ( * < $f000 ) 4471 f000 - ORG $47000 4472 f000 - RORG $F000 4473 f000 - endif 4474 f000 - endif 4475 f000 - ifconst ROM272K 4476 f000 - if ( * < $f000 ) 4477 f000 - ORG $47000 4478 f000 - RORG $F000 4479 f000 - endif 4480 f000 - endif 4481 f000 - ifconst ROM512K 4482 f000 - if ( * < $f000 ) 4483 f000 - ORG $87000 4484 f000 - RORG $F000 4485 f000 - endif 4486 f000 - endif 4487 f000 - ifconst ROM528K 4488 f000 - if ( * < $f000 ) 4489 f000 - ORG $87000 4490 f000 - RORG $F000 4491 f000 - endif 4492 f000 - endif 4493 f000 endif 4494 f000 4495 f000 ; all of these "modules" have conditional clauses in them, so even though 4496 f000 ; they're always included here, they don't take up rom unless the user 4497 f000 ; explicitly enables support for the feature. 4498 f000 4499 f000 ifnconst included.7800vox.asm ------- FILE 7800vox.asm LEVEL 2 PASS 3 0 f000 include 7800vox.asm 1 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 f000 3 f000 ; AtariVox 7800basic wrapper 4 f000 5 f000 ; to be called with 6 f000 ; A=# of bytes 7 f000 ; 8 f000 9 f000 - ifconst HSSUPPORT 10 f000 - 11 f000 -AVoxReadBytes 12 f000 - sta temp8 13 f000 - jsr i2c_startwrite 14 f000 - bcs eeprom_error 15 f000 - 16 f000 - lda HSVoxHi 17 f000 - jsr i2c_txbyte 18 f000 - lda HSVoxLo 19 f000 - jsr i2c_txbyte 20 f000 - jsr i2c_stopwrite 21 f000 - 22 f000 - jsr i2c_startread 23 f000 - 24 f000 - ldx #0 25 f000 -AVoxReadBytesLoop 26 f000 - jsr i2c_rxbyte 27 f000 - sta eeprombuffer,x 28 f000 - inx 29 f000 - cpx temp8 30 f000 - bne AVoxReadBytesLoop 31 f000 - jsr i2c_stopread 32 f000 - lda #0 33 f000 - rts 34 f000 - 35 f000 - ; to be called with 36 f000 - ; A=# of bytes 37 f000 - ; 38 f000 - 39 f000 -AVoxWriteBytes 40 f000 - sta temp8 41 f000 - jsr i2c_startwrite 42 f000 - bcs eeprom_error 43 f000 - 44 f000 - lda HSVoxHi 45 f000 - jsr i2c_txbyte 46 f000 - lda HSVoxLo 47 f000 - jsr i2c_txbyte 48 f000 - 49 f000 - ldx #$00 50 f000 -AVoxWriteBytesLoop 51 f000 - lda eeprombuffer,x 52 f000 - jsr i2c_txbyte 53 f000 - inx 54 f000 - cpx temp8 55 f000 - bne AVoxWriteBytesLoop 56 f000 - jsr i2c_stopwrite 57 f000 - 58 f000 - lda #0 59 f000 - rts 60 f000 - 61 f000 -eeprom_error 62 f000 - lda #$ff 63 f000 - rts 64 f000 - 65 f000 -AVoxDetect 66 f000 - 67 f000 - jsr i2c_startwrite 68 f000 - bcs eeprom_error 69 f000 - lda #$30 70 f000 - jsr i2c_txbyte 71 f000 - lda #$00 72 f000 - jsr i2c_txbyte 73 f000 - jsr i2c_stopwrite 74 f000 - rts 75 f000 - 76 f000 - include "i2c7800.inc" 77 f000 - I2C_SUBS temp9 78 f000 - 79 f000 endif 80 f000 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_VerticalShooter_Test_sprani.78b.asm 4501 f000 endif 4502 f000 ifnconst included.pokeysound.asm ------- FILE pokeysound.asm LEVEL 2 PASS 3 0 f000 include pokeysound.asm 1 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 f000 3 f000 4 f000 - ifconst pokeysupport 5 f000 - 6 f000 -pokeysoundmodulestart 7 f000 - 8 f000 -mutepokey 9 f000 - lda #0 10 f000 - ldy #7 11 f000 -mutepokeyloop 12 f000 - sta pokey1pointlo,y 13 f000 - sta (pokeybaselo),y 14 f000 - dey 15 f000 - bpl mutepokeyloop 16 f000 - rts 17 f000 - 18 f000 -checkpokeyplaying 19 f000 - ldx #6 20 f000 -checkpokeyplayingloop 21 f000 - lda pokey1pointlo,x 22 f000 - ora pokey1pointhi,x 23 f000 - beq pokeychannelinactive 24 f000 - jsr playpokeysfxA ; x=channel*2 25 f000 -pokeychannelinactive 26 f000 - dex 27 f000 - dex 28 f000 - bpl checkpokeyplayingloop 29 f000 - rts 30 f000 - 31 f000 -playpokeysfxA 32 f000 - txa 33 f000 - tay 34 f000 - lda pokey1tick,x 35 f000 - beq playpokeysfxAcont 36 f000 - sec 37 f000 - sbc #1 38 f000 - sta pokey1tick,x ; sound resolution is >1 frame, and we're mid-tock... 39 f000 - rts 40 f000 - 41 f000 -playpokeysfxAcont 42 f000 - lda pokey1frames,x ; set the frame countdown for this sound chunk 43 f000 - sta pokey1tick,x 44 f000 - 45 f000 - lda pokey1priority,x ; decrease the sound's priority if its non-zero 46 f000 - beq playpokeysfxAcont2 47 f000 - sec 48 f000 - sbc #1 49 f000 - sta pokey1priority,x 50 f000 -playpokeysfxAcont2 51 f000 - 52 f000 - ; *** FREQUENCY 53 f000 - lda (pokey1pointlo,x) 54 f000 - sta temp1 55 f000 - clc 56 f000 - adc pokey1offset,x ; take into account any pitch modification 57 f000 - sta (pokeybaselo),y ; PAUDF0,0 58 f000 - 59 f000 - ;advance the data pointer +1 60 f000 - inc pokey1pointlo,x 61 f000 - bne skippokeyhiinc1 62 f000 - inc pokey1pointhi,x 63 f000 -skippokeyhiinc1 64 f000 - 65 f000 - ; *** WAVE 66 f000 - lda (pokey1pointlo,x) 67 f000 - asl 68 f000 - asl 69 f000 - asl 70 f000 - asl ; x16 71 f000 - 72 f000 - ;advance the data pointer +1 73 f000 - inc pokey1pointlo,x 74 f000 - bne skippokeyhiinc2 75 f000 - inc pokey1pointhi,x 76 f000 -skippokeyhiinc2 77 f000 - 78 f000 - ora (pokey1pointlo,x) 79 f000 - iny 80 f000 - sta (pokeybaselo),y 81 f000 - 82 f000 - ora temp1 ; check if F|C|V=0 83 f000 - beq zeropokeypoint ; if so, we're at the end of the sound. 84 f000 - 85 f000 - ; advance the pointer +1, on to the next sound chunk 86 f000 - inc pokey1pointlo,x 87 f000 - bne skippokeyhiinc3 88 f000 - inc pokey1pointhi,x 89 f000 -skippokeyhiinc3 90 f000 - rts 91 f000 - 92 f000 -zeropokeypoint 93 f000 - sta pokey1pointlo,x 94 f000 - sta pokey1pointhi,x 95 f000 - sta pokey1priority,x 96 f000 - rts 97 f000 - 98 f000 -schedulepokeysfx 99 f000 - ldx #6 100 f000 -schedulepokeysfxloop 101 f000 - lda pokey1pointlo,x 102 f000 - ora pokey1pointhi,x 103 f000 - bne schedulespokeysearch 104 f000 - jmp schedulepokeyX ; we found an unused channel, so use it... 105 f000 -schedulespokeysearch 106 f000 - dex 107 f000 - dex 108 f000 - bpl schedulepokeysfxloop 109 f000 - 110 f000 - ; if we're here, all 4 channels are presently playing a sound... 111 f000 - ldy #1 112 f000 - lda (temp1),y ; peek at the priority of this sfx... 113 f000 - bne schedulepokeysfxcont1 114 f000 - rts ; ...and skip it if it's 0 priority 115 f000 -schedulepokeysfxcont1 116 f000 - 117 f000 - ; figure out which current sound has the lowest priority... 118 f000 - lda #0 119 f000 - sta temp8 120 f000 - lda pokey1priority 121 f000 - sta temp9 122 f000 - ldx #6 123 f000 -findlowprioritypokeyloop 124 f000 - lda pokey1priority,x 125 f000 - cmp temp9 126 f000 - bcs findlowprioritypokeyloopcontinue 127 f000 - sta temp9 128 f000 - stx temp8 129 f000 -findlowprioritypokeyloopcontinue 130 f000 - dex 131 f000 - dex 132 f000 - bne findlowprioritypokeyloop 133 f000 - ldx temp8 ; the low priority channel we'll interrupt 134 f000 - 135 f000 -schedulepokeyX 136 f000 - ;called with X=2*pokey channel to play on... 137 f000 - ldy #1 ; get priority and sound-resolution (in frames) 138 f000 - lda (temp1),y 139 f000 - sta pokey1priority,x 140 f000 - iny 141 f000 - lda (temp1),y 142 f000 - sta pokey1frames,x 143 f000 - 144 f000 - lda temp1 145 f000 - clc 146 f000 - adc #3 147 f000 - sta pokey1pointlo,x 148 f000 - lda temp2 149 f000 - adc #0 150 f000 - sta pokey1pointhi,x 151 f000 - lda temp3 152 f000 - sta pokey1offset,x 153 f000 - lda #0 154 f000 - sta pokey1tick,x 155 f000 - rts 156 f000 - 157 f000 - ; pokey detection routine. we check for pokey in the XBOARD/XM location, 158 f000 - ; and the standard $4000 location. 159 f000 - ; if pokey the pokey is present, this routine will reset it. 160 f000 - 161 f000 -detectpokeylocation 162 f000 - ;XBoard/XM... 163 f000 - ldx #2 164 f000 -detectpokeyloop 165 f000 - lda XCTRL1s 166 f000 - ora #%00010100 167 f000 - and POKEYXMMASK,x 168 f000 - sta XCTRL1s 169 f000 - sta XCTRL1 170 f000 - 171 f000 - lda POKEYCHECKLO,x 172 f000 - sta pokeybaselo 173 f000 - lda POKEYCHECKHI,x 174 f000 - sta pokeybasehi 175 f000 - jsr checkforpokey 176 f000 - lda pokeydetected 177 f000 - beq foundpokeychip 178 f000 - dex 179 f000 - bpl detectpokeyloop 180 f000 -foundpokeychip 181 f000 - eor #$ff ; invert state for 7800basic if...then test 182 f000 - sta pokeydetected 183 f000 - rts 184 f000 - 185 f000 -POKEYXMMASK 186 f000 - ; XM POKEY on XM POKEY off XM POKEY off 187 f000 - .byte %11111111, %11101111, %11101111 188 f000 - 189 f000 -POKEYCHECKLO 190 f000 - .byte <$0450, <$0450, <$4000 191 f000 -POKEYCHECKHI 192 f000 - .byte >$0450, >$0450, >$4000 193 f000 - 194 f000 -checkforpokey 195 f000 - ldy #$0f 196 f000 - lda #$00 197 f000 - sta pokeydetected ; start off by assuming pokey will be detected 198 f000 -resetpokeyregistersloop 199 f000 - sta (pokeybase),y 200 f000 - dey 201 f000 - bpl resetpokeyregistersloop 202 f000 - 203 f000 - ldy #PAUDCTL 204 f000 - sta (pokeybase),y 205 f000 - ldy #PSKCTL 206 f000 - sta (pokeybase),y 207 f000 - 208 f000 - ; let the dust settle... 209 f000 - nop 210 f000 - nop 211 f000 - nop 212 f000 - 213 f000 - lda #4 214 f000 - sta temp9 215 f000 -pokeycheckloop1 216 f000 - ; we're in reset, so the RANDOM register should read $ff... 217 f000 - ldy #PRANDOM 218 f000 - lda (pokeybase),y 219 f000 - cmp #$ff 220 f000 - bne nopokeydetected 221 f000 - dec temp9 222 f000 - bne pokeycheckloop1 223 f000 - 224 f000 - ; take pokey out of reset... 225 f000 - ldy #PSKCTL 226 f000 - lda #3 227 f000 - sta (pokeybase),y 228 f000 - ldy #PAUDCTL 229 f000 - lda #0 230 f000 - sta (pokeybase),y 231 f000 - 232 f000 - ; let the dust settle again... 233 f000 - nop 234 f000 - nop 235 f000 - nop 236 f000 - 237 f000 - lda #4 238 f000 - sta temp9 239 f000 -pokeycheckloop2 240 f000 - ; we're out of reset, so RANDOM should read non-$ff... 241 f000 - ldy #PRANDOM 242 f000 - lda (pokeybase),y 243 f000 - cmp #$ff 244 f000 - beq skippokeycheckreturn 245 f000 - rts 246 f000 -skippokeycheckreturn 247 f000 - dec temp9 248 f000 - bne pokeycheckloop2 249 f000 -nopokeydetected 250 f000 - dec pokeydetected ; pokeydetected=#$ff 251 f000 - rts 252 f000 - 253 f000 -pokeysoundmoduleend 254 f000 - 255 f000 - echo " pokeysound assembly: ",[(pokeysoundmoduleend-pokeysoundmodulestart)]d," bytes" 256 f000 - 257 f000 endif ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_VerticalShooter_Test_sprani.78b.asm 4504 f000 endif 4505 f000 ifnconst included.tracker.asm ------- FILE tracker.asm LEVEL 2 PASS 3 0 f000 include tracker.asm 1 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 f000 3 f000 4 f000 - ifconst MUSICTRACKER 5 f000 - ; ** songtempo lists how many 256ths of a frame a 16th note lasts 6 f000 - ; ** the player operates on a 16th note grid. 7 f000 - 8 f000 -servicesongover 9 f000 - rts 10 f000 -servicesong 11 f000 - lda songtempo 12 f000 - beq servicesongover ; ** if song is off/paused then return 13 f000 -servicesongcontinue 14 f000 - lda sfxschedulelock 15 f000 - sta sfxschedulemissed 16 f000 - bne servicesongover 17 f000 - lda songtempo 18 f000 - clc 19 f000 - adc songtick ; add songtempo to songtick until it rolls over 20 f000 - sta songtick ; this is how we break away from 50/60Hz timing. 21 f000 - bcc servicesongover 22 f000 - ; ** if we're here a new 16th note has passed 23 f000 - ; ** check if a new note is due on any of the 4 channels 24 f000 -servicesongredo 25 f000 - ldx #3 26 f000 -checkchannelloop 27 f000 - dec songchannel1busywait,x 28 f000 - bpl carryoncheckingchannel 29 f000 - txa 30 f000 - pha ; save X for the loop 31 f000 - jsr processsongdata 32 f000 - pla ; restore X for the loop 33 f000 - tax 34 f000 -carryoncheckingchannel 35 f000 - dex 36 f000 - bpl checkchannelloop 37 f000 - lda inactivechannelcount 38 f000 - cmp #15 39 f000 - bne skipstopsong 40 f000 - lda songloops 41 f000 - bne doasongloop 42 f000 - ;lda #0 43 f000 - sta songtempo ; all channels are done. stop the song 44 f000 - rts 45 f000 -doasongloop 46 f000 - bmi skipsongloopadjust 47 f000 - dec songloops 48 f000 -skipsongloopadjust 49 f000 - jsr setsongchannels 50 f000 - jmp servicesongredo 51 f000 -skipstopsong 52 f000 - rts 53 f000 - 54 f000 -processsongdata 55 f000 - ; channel needs processing 56 f000 - ; X=channel # 57 f000 - 58 f000 - txa 59 f000 - clc 60 f000 - adc songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 61 f000 - tay 62 f000 - 63 f000 - 64 f000 - ; ** indirect x is cumbersome with mult-byte commands. 65 f000 - ; ** setup a pointer to the song data for indirect y addressing. 66 f000 - lda songchannel1layer1lo,y 67 f000 - sta songdatalo 68 f000 - lda songchannel1layer1hi,y 69 f000 - sta songdatahi 70 f000 - ora songdatalo 71 f000 - bne channelhasdata 72 f000 - ;channel data is pointing at $0000 73 f000 - lda #$7F 74 f000 - sta songchannel1busywait,x ; skip a bunch of notes 75 f000 -setchannelcountbits 76 f000 - lda channel2bits,x 77 f000 - ora inactivechannelcount 78 f000 - sta inactivechannelcount 79 f000 - rts 80 f000 -channelhasdata 81 f000 - 82 f000 - sty songstackindex 83 f000 - ldy #0 84 f000 - lda (songdatalo),y ; ** load in the next byte of song data, so we can decode it 85 f000 - cmp #$ff 86 f000 - bne carryoncheckingdatatype ; ** $ff=pattern end marker 87 f000 - jmp handlechannelEOD 88 f000 - 89 f000 -carryoncheckingdatatype 90 f000 - and #$F0 91 f000 - cmp #$C0 92 f000 - beq handlechannelrest ; 0000XXXX=rest 93 f000 - cmp #$F0 94 f000 - beq handlemultibytecommand 95 f000 - cmp #$D0 96 f000 - beq handlesemiup 97 f000 - cmp #$E0 98 f000 - beq handlesemidown 99 f000 -handlenotedata 100 f000 - ; ** TODO: note playing is a terrible choice for fall-through 101 f000 - 102 f000 - ; ** its simple note data, prepare arguments for schedulesfx 103 f000 - 104 f000 - ; ** set the note length 105 f000 - lda (songdatalo),y 106 f000 - and #$0F 107 f000 - sta songchannel1busywait,x 108 f000 - 109 f000 - ; ** load the instrument 110 f000 - lda songchannel1instrumentlo,x 111 f000 - sta sfxinstrumentlo 112 f000 - lda songchannel1instrumenthi,x 113 f000 - sta sfxinstrumenthi 114 f000 - 115 f000 - ; ** get the note, and transpose 116 f000 - lda (songdatalo),y 117 f000 - lsr 118 f000 - lsr 119 f000 - lsr 120 f000 - lsr 121 f000 - clc 122 f000 - adc songchannel1transpose,x ; ** add it to the transpose index 123 f000 - ; ** its up the respective SFX scheduler to handle and save the note data 124 f000 - sta sfxnoteindex 125 f000 - 126 f000 - lda #0 127 f000 - sta sfxpitchoffset 128 f000 - 129 f000 - jsr schedulesfx 130 f000 - 131 f000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 132 f000 - 133 f000 -handlechannelrest 134 f000 - ; ** set the note length 135 f000 - lda (songdatalo),y 136 f000 - and #$0F 137 f000 - sta songchannel1busywait,x 138 f000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 139 f000 - 140 f000 -handlesemiup 141 f000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 142 f000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 143 f000 - clc 144 f000 -handlesemidownentry 145 f000 - adc songchannel1transpose,x ; ** add it to the transpose index 146 f000 - sta songchannel1transpose,x 147 f000 - jsr advancethesongpointer1byte 148 f000 - jmp processsongdata ; semi doesn't have note length, so process the next data byte... 149 f000 - 150 f000 -handlesemidown 151 f000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 152 f000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 153 f000 - eor #$ff ; ** its easier if we negate it, and then add it instead. 154 f000 - sec 155 f000 - jmp handlesemidownentry 156 f000 - 157 f000 -handlemultibytecommand 158 f000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 159 f000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 160 f000 - cmp #$08 ; ** load new instrument? 161 f000 - bne nothandleinstrumentchange 162 f000 -handleinstrumentchange 163 f000 - iny 164 f000 - lda (songdatalo),y 165 f000 - sta songchannel1instrumentlo,x 166 f000 - iny 167 f000 - lda (songdatalo),y 168 f000 - sta songchannel1instrumenthi,x 169 f000 - lda #3 170 f000 - jsr advancethesongpointerNbytes ; advance 3 bytes 171 f000 - jmp processsongdata 172 f000 - 173 f000 -nothandleinstrumentchange 174 f000 - cmp #$09 ; ** absolute tempo change? 175 f000 - bne nothandletempochange 176 f000 - lda #0 177 f000 - sta songtempo 178 f000 -handlerelativetempochange 179 f000 - iny 180 f000 - lda (songdatalo),y 181 f000 - clc 182 f000 - adc songtempo 183 f000 - sta songtempo 184 f000 - lda #2 185 f000 - jsr advancethesongpointerNbytes ; advance 2 bytes 186 f000 - jmp processsongdata 187 f000 - 188 f000 -nothandletempochange 189 f000 - cmp #$0A ; ** relative tempo change?: 190 f000 - beq handlerelativetempochange 191 f000 - cmp #$0B ; ** octave/semi change? 192 f000 - beq handleoctavesemichange 193 f000 -handlepatterndata 194 f000 - ; ** if we're here its a pattern/loop "subroutine" 195 f000 - ; ** move the channel's "stack" pointer and populate the new stack level 196 f000 - 197 f000 - lda #4 198 f000 - clc 199 f000 - adc songchannel1stackdepth,x 200 f000 - sta songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 201 f000 - 202 f000 - stx inttemp6 ; about to invalidate x. save it. 203 f000 - lda songstackindex 204 f000 - adc #4 205 f000 - tax 206 f000 - 207 f000 - lda (songdatalo),y 208 f000 - and #$7 209 f000 - sta songchannel1layer1loops,x 210 f000 - iny 211 f000 - lda (songdatalo),y 212 f000 - sta songchannel1layer1lo,x 213 f000 - iny 214 f000 - lda (songdatalo),y 215 f000 - sta songchannel1layer1hi,x 216 f000 - 217 f000 - ldx inttemp6 ; restore x with the channel # 218 f000 - 219 f000 - ; ** advance will operate on the old stack level, since we didn't store the updated songstackindex... 220 f000 - lda #3 221 f000 - jsr advancethesongpointerNbytes ; advance 3 bytes 222 f000 - 223 f000 - ; ** ...but the new stack level will be correctly picked up when we process the next byte. 224 f000 - jmp processsongdata 225 f000 - 226 f000 -handlechannelEOD 227 f000 - ; ** check if there are loops remaining on the pattern 228 f000 - stx inttemp6 229 f000 - ldx songstackindex 230 f000 - dec songchannel1layer1loops,x 231 f000 - bmi handlechannelEODnoloop 232 f000 - ; ** loops are remaining. set the pattern pointer to the pattern start, which is contained after the EOD 233 f000 - iny 234 f000 - lda (songdatalo),y 235 f000 - sta songchannel1layer1lo,x 236 f000 - iny 237 f000 - lda (songdatalo),y 238 f000 - sta songchannel1layer1hi,x 239 f000 - ldx inttemp6 240 f000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 241 f000 - 242 f000 -handlechannelEODnoloop 243 f000 - ; this pattern/loop is done playing. "pop" the stack 244 f000 - ldx inttemp6 245 f000 - lda songchannel1stackdepth,x 246 f000 - beq handlerootchannelEOD 247 f000 - sec 248 f000 - sbc #4 249 f000 - sta songchannel1stackdepth,x 250 f000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 251 f000 - 252 f000 -handlerootchannelEOD 253 f000 - ; this channel is done. point it to $ff data so we no longer process this channel. 254 f000 - lda #0 255 f000 - sta songchannel1layer1lo,x 256 f000 - sta songchannel1layer1hi,x 257 f000 - sta songchannel1busywait,x 258 f000 - jmp setchannelcountbits 259 f000 - rts 260 f000 - 261 f000 -nothandlepatternchange 262 f000 -handleoctavesemichange 263 f000 - iny 264 f000 - lda (songdatalo),y 265 f000 - sta songchannel1transpose,x 266 f000 - lda #2 267 f000 - jsr advancethesongpointerNbytes ; advance 2 bytes 268 f000 - jmp processsongdata 269 f000 - 270 f000 -advancethesongpointer1byte 271 f000 - txa 272 f000 - ldx songstackindex 273 f000 - inc songchannel1layer1lo,x 274 f000 - bne skiphiadvancethesongpointer1byte 275 f000 - inc songchannel1layer1hi,x 276 f000 -skiphiadvancethesongpointer1byte 277 f000 - tax 278 f000 - rts 279 f000 - 280 f000 -advancethesongpointerNbytes 281 f000 - ; entered with A=# of byte to advance 282 f000 - stx inttemp6 283 f000 - ldx songstackindex 284 f000 - clc 285 f000 - adc songchannel1layer1lo,x 286 f000 - sta songchannel1layer1lo,x 287 f000 - lda #0 288 f000 - adc songchannel1layer1hi,x 289 f000 - sta songchannel1layer1hi,x 290 f000 - ldx inttemp6 291 f000 - rts 292 f000 - 293 f000 -clearsongmemory 294 f000 - lda #0 295 f000 - ldx #(songchannel4instrumenthi-songchannel1layer1lo) 296 f000 -clearsongmemoryloop1 297 f000 - sta songchannel1layer1lo,x 298 f000 - dex 299 f000 - bpl clearsongmemoryloop1 300 f000 - 301 f000 - ldx #(songchannel4stackdepth-songchannel1layer1loops) 302 f000 -clearsongmemoryloop2 303 f000 - sta songchannel1layer1loops,x 304 f000 - dex 305 f000 - bpl clearsongmemoryloop2 306 f000 - 307 f000 - lda #$ff 308 f000 - ldx #3 309 f000 -clearsongmemoryloop3 310 f000 - sta songchannel1busywait,x 311 f000 - dex 312 f000 - bpl clearsongmemoryloop3 313 f000 - rts 314 f000 - 315 f000 -setsongchannels 316 f000 - jsr clearsongmemory 317 f000 - ldy #7 318 f000 - ldx #3 319 f000 -setsongchannelsloop 320 f000 - lda (songpointerlo),y 321 f000 - sta songchannel1layer1hi,x 322 f000 - dey 323 f000 - lda (songpointerlo),y 324 f000 - sta songchannel1layer1lo,x 325 f000 - dex 326 f000 - dey 327 f000 - bpl setsongchannelsloop 328 f000 - rts 329 f000 - 330 f000 -channel2bits 331 f000 - .byte 1,2,4,8 332 f000 - 333 f000 -tiatrackeroctavenotes 334 f000 - ifconst BUZZBASS 335 f000 -LOWC = 15 336 f000 - else 337 f000 -LOWC = 14 338 f000 - endif 339 f000 - ; ****** ELECTRONIC (0 to 11) 340 f000 - .byte LOWC,20 ; c0 16.1Hz 341 f000 - .byte LOWC,18 ; c#0 342 f000 - .byte LOWC,17 ; d0 343 f000 - .byte LOWC,16 ; d#0 344 f000 - .byte LOWC,15 ; e0 345 f000 - .byte LOWC,14 ; f0 (very off) 346 f000 - .byte LOWC,14 ; f#0 347 f000 - .byte LOWC,13 ; g0 348 f000 - .byte LOWC,12 ; g#0 349 f000 - .byte LOWC,11 ; a0 350 f000 - .byte LOWC,11 ; a#0 (very off) 351 f000 - .byte LOWC,10 ; b0 30.7Hz 352 f000 - 353 f000 - ; ****** SLIGHTLY BUZZY (12 to 23) 354 f000 - .byte 6,30 ; c1 32.7Hz 355 f000 - .byte 6,28 ; c#1 356 f000 - .byte 6,27 ; d1 357 f000 - .byte 6,25 ; d#1 358 f000 - .byte 6,24 ; e1 359 f000 - .byte 6,22 ; f1 360 f000 - .byte 6,21 ; f#1 361 f000 - .byte 6,20 ; g1 362 f000 - .byte 6,18 ; g#1 363 f000 - .byte 6,17 ; a1 364 f000 - .byte 6,16 ; a#1 365 f000 - .byte 6,15 ; b1 63.4Hz 366 f000 - 367 f000 - ; ****** BUZZY (24 to 39) 368 f000 - .byte 1,31 ; c2 65.5 369 f000 - .byte 1,30 ; c#2 67.6 370 f000 - .byte 1,27 ; d2 72.3 371 f000 - .byte 1,26 ; d#2 77.6 372 f000 - .byte 1,24 ; e2 373 f000 - .byte 1,23 ; f2 374 f000 - .byte 1,22 ; f#2 375 f000 - .byte 1,20 ; g2 376 f000 - .byte 1,19 ; g#2 377 f000 - .byte 1,18 ; a2 378 f000 - .byte 1,17 ; a#2 379 f000 - .byte 1,16 ; b2 380 f000 - .byte 1,15 ; c3 126.8Hz 381 f000 - .byte 1,14 ; c#3 382 f000 - .byte 1,13 ; d3 149.7Hz 383 f000 - .byte 1,12 ; d#3 161.2Hz (very off) 384 f000 - ; ****** PURE (40 to 71) - best key is A3 Major 385 f000 - .byte 12,31 ; e3 163.8Hz 386 f000 - .byte 12,29 ; f3 387 f000 - .byte 12,28 ; f#3 388 f000 - .byte 12,26 ; g3 389 f000 - .byte 12,24 ; g#3 390 f000 - .byte 12,23 ; a3 songs in key of A benefit from Perceptual Tuning 391 f000 - .byte 12,22 ; a#3 392 f000 - .byte 12,20 ; b3 393 f000 - .byte 12,19 ; c4 (middle C) 394 f000 - .byte 12,18 ; c#4 395 f000 - .byte 12,17 ; d4 396 f000 - .byte 12,16 ; d#4 397 f000 - .byte 12,15 ; e4 398 f000 - .byte 12,14 ; f4 399 f000 - .byte 12,13 ; f#4 400 f000 - .byte 12,12 ; g4 (very off) 401 f000 - .byte 12,12 ; g#4 402 f000 - .byte 12,11 ; a4 403 f000 - .byte 12,10 ; a#4 404 f000 - .byte 4,31 ; b4 405 f000 - .byte 4,29 ; c5 406 f000 - .byte 4,28 ; c#5 407 f000 - .byte 4,26 ; d5 408 f000 - .byte 4,24 ; d#5 409 f000 - .byte 4,23 ; e5 410 f000 - .byte 4,22 ; f5 411 f000 - .byte 4,20 ; f#5 412 f000 - .byte 4,19 ; g5 413 f000 - .byte 4,18 ; g#5 414 f000 - .byte 4,17 ; a5 415 f000 - .byte 4,16 ; a#5 416 f000 - .byte 4,15 ; b5 417 f000 - 418 f000 - ; ****** TUNED WIND (72 to 83) 419 f000 - .byte 8,30 ; c 420 f000 - .byte 8,28 ; c# 421 f000 - .byte 8,27 ; d 422 f000 - .byte 8,25 ; d# 423 f000 - .byte 8,24 ; e 424 f000 - .byte 8,22 ; f 425 f000 - .byte 8,21 ; f# 426 f000 - .byte 8,20 ; g 427 f000 - .byte 8,18 ; g# 428 f000 - .byte 8,17 ; a 429 f000 - .byte 8,16 ; a# 430 f000 - .byte 8,15 ; b 431 f000 - 432 f000 - include "tiadrumkit.asm" 433 f000 - 434 f000 endif ;MUSICTRACKER ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_VerticalShooter_Test_sprani.78b.asm 4507 f000 endif 4508 f000 ifnconst included.hiscore.asm ------- FILE hiscore.asm LEVEL 2 PASS 3 0 f000 include hiscore.asm 1 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 f000 3 f000 - ifconst HSSUPPORT 4 f000 -detectatarivoxeeprom 5 f000 -hiscoremodulestart 6 f000 - ; do a test to see if atarivox eeprom can be accessed, and save results 7 f000 - jsr AVoxDetect 8 f000 - eor #$ff ; invert for easy 7800basic if...then logic 9 f000 - sta avoxdetected 10 f000 - lda #$0 11 f000 - sta SWACNT 12 f000 - lda avoxdetected 13 f000 - rts 14 f000 - 15 f000 -detecthsc 16 f000 - ; check for the HSC ROM signature... 17 f000 - lda XCTRL1s 18 f000 - ora #%00001100 19 f000 - sta XCTRL1s 20 f000 - sta XCTRL1 21 f000 - lda $3900 22 f000 - cmp #$C6 23 f000 - bne detecthscfail 24 f000 - lda $3904 25 f000 - cmp #$FE 26 f000 - bne detecthscfail 27 f000 - ; check if it's initialized... 28 f000 - ldy #0 29 f000 - lda #$ff 30 f000 -checkhscinit 31 f000 - and $1000,y 32 f000 - dey 33 f000 - bpl checkhscinit 34 f000 - cmp #$ff 35 f000 - bne hscisalreadyinit 36 f000 - ; if we're here, we need to do a minimal HSC init... 37 f000 - ldy #$28 38 f000 -hscinitloop1 39 f000 - lda hscheader,y 40 f000 - sta $1000,y 41 f000 - dey 42 f000 - bpl hscinitloop1 43 f000 - ldy #$89 44 f000 - lda #$7F 45 f000 -hscinitloop2 46 f000 - sta $10B3,y 47 f000 - dey 48 f000 - cpy #$ff 49 f000 - bne hscinitloop2 50 f000 -hscisalreadyinit 51 f000 - lda #$ff 52 f000 - rts 53 f000 -hscheader 54 f000 - .byte $00,$00,$68,$83,$AA,$55,$9C,$FF,$07,$12,$02,$1F,$00,$00,$00,$00 55 f000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 56 f000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$03 57 f000 -detecthscfail 58 f000 - lda XCTRL1s 59 f000 - and #%11110111 60 f000 - sta XCTRL1s 61 f000 - lda #0 62 f000 - rts 63 f000 endif ; HSSUPPORT 64 f000 65 f000 - ifconst HSSUPPORT 66 f000 - ifnconst hiscorefont 67 f000 - echo "" 68 f000 - echo "WARNING: High score support is enabled, but the hiscorefont.png was" 69 f000 - echo " NOT imported with incgraphic. The high score display code" 70 f000 - echo " has been omitted from this build." 71 f000 - echo "" 72 f000 - else 73 f000 -hscdrawscreen 74 f000 - 75 f000 - ; we use 20 lines on a 24 line display 76 f000 - ; HSSCOREY to dynamically centers based on 77 f000 - ;HSSCOREY = 0 78 f000 -HSSCOREY = ((WZONECOUNT*WZONEHEIGHT/8)-22)/2 79 f000 -HSCURSORY = ((HSSCOREY/(WZONEHEIGHT/8))*WZONEHEIGHT) 80 f000 - 81 f000 - ifconst HSSCORESIZE 82 f000 -SCORESIZE = HSSCORESIZE 83 f000 - else 84 f000 -SCORESIZE = 6 85 f000 - endif 86 f000 - 87 f000 - ;save shadow registers for later return... 88 f000 - lda sCTRL 89 f000 - sta ssCTRL 90 f000 - lda sCHARBASE 91 f000 - sta ssCHARBASE 92 f000 - lda #$60 93 f000 - sta charactermode 94 f000 - jsr drawwait 95 f000 - jsr blacken320colors 96 f000 - jsr clearscreen 97 f000 - 98 f000 - ;set the character base to the HSC font 99 f000 - lda #>hiscorefont 100 f000 - sta CHARBASE 101 f000 - sta sCHARBASE 102 f000 - lda #%01000011 ;Enable DMA, mode=320A 103 f000 - sta CTRL 104 f000 - sta sCTRL 105 f000 - 106 f000 - lda #60 107 f000 - sta hsjoydebounce 108 f000 - 109 f000 - lda #0 110 f000 - sta hscursorx 111 f000 - sta framecounter 112 f000 - ifnconst HSCOLORCHASESTART 113 f000 - lda #$8D ; default is blue. why not? 114 f000 - else 115 f000 - lda #HSCOLORCHASESTART 116 f000 - endif 117 f000 - sta hscolorchaseindex 118 f000 - 119 f000 - lda #$0F 120 f000 - sta P0C2 ; base text is white 121 f000 - 122 f000 - jsr hschasecolors 123 f000 - ; ** plot all of the initials 124 f000 - lda #HSRAMInitials 127 f000 - sta temp2 ; charmaphi 128 f000 - lda #32+29 ; palette=0-29 | 32-(width=3) 129 f000 - sta temp3 ; palette/width 130 f000 - lda #104 131 f000 - sta temp4 ; X 132 f000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 133 f000 - sta temp5 ; Y 134 f000 -plothsinitialsloop 135 f000 - jsr plotcharacters 136 f000 - clc 137 f000 - lda temp3 138 f000 - adc #32 139 f000 - sta temp3 140 f000 - inc temp5 141 f000 - if WZONEHEIGHT = 8 142 f000 - inc temp5 143 f000 - endif 144 f000 - clc 145 f000 - lda #3 146 f000 - adc temp1 147 f000 - sta temp1 148 f000 - cmp #(<(HSRAMInitials+15)) 149 f000 - bcc plothsinitialsloop 150 f000 - 151 f000 - ifconst HSGAMENAMELEN 152 f000 - ;plot the game name... 153 f000 - lda #HSGAMENAMEtable 156 f000 - sta temp2 ; charmaphi 157 f000 - lda #(32-HSGAMENAMELEN) ; palette=0*29 | 32-(width=3) 158 f000 - sta temp3 ; palette/width 159 f000 - lda #(80-(HSGAMENAMELEN*2)) 160 f000 - sta temp4 ; X 161 f000 - lda #((HSSCOREY+0)/(WZONEHEIGHT/8)) 162 f000 - sta temp5 ; Y 163 f000 - jsr plotcharacters 164 f000 - endif ; HSGAMENAMELEN 165 f000 - 166 f000 - ;plot "difficulty"... 167 f000 - ldy gamedifficulty 168 f000 - ifnconst HSNOLEVELNAMES 169 f000 - lda highscoredifficultytextlo,y 170 f000 - sta temp1 171 f000 - lda highscoredifficultytexthi,y 172 f000 - sta temp2 173 f000 - sec 174 f000 - lda #32 175 f000 - sbc highscoredifficultytextlen,y 176 f000 - sta temp3 ; palette/width 177 f000 - sec 178 f000 - lda #40 179 f000 - sbc highscoredifficultytextlen,y 180 f000 - asl 181 f000 - sta temp4 ; X 182 f000 - else 183 f000 - lda #HSHIGHSCOREStext 186 f000 - sta temp2 ; charmaphi 187 f000 - lda #(32-11) ; palette=0*29 | 32-(width=3) 188 f000 - sta temp3 ; palette/width 189 f000 - lda #(80-(11*2)) 190 f000 - sta temp4 ; X 191 f000 - endif ; HSNOLEVELNAMES 192 f000 - 193 f000 - lda #((HSSCOREY+2)/(WZONEHEIGHT/8)) 194 f000 - sta temp5 ; Y 195 f000 - jsr plotcharacters 196 f000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval 197 f000 - bne carronwithscoreevaluation 198 f000 - jmp donoscoreevaluation 199 f000 -carronwithscoreevaluation 200 f000 - dey 201 f000 - lda highscorelabeltextlo,y 202 f000 - sta temp1 203 f000 - lda highscorelabeltexthi,y 204 f000 - sta temp2 205 f000 - sec 206 f000 - lda #(32-15) ; palette=0*29 | 32-(width=3) 207 f000 - sta temp3 ; palette/width 208 f000 - lda highscorelabeladjust1,y 209 f000 - sta temp4 ; X 210 f000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 211 f000 - sta temp5 ; Y 212 f000 - jsr plotcharacters 213 f000 - 214 f000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval 215 f000 - dey 216 f000 - ;plot the current player score... 217 f000 - lda #(32-SCORESIZE) ; palette=0*32 218 f000 - sta temp3 ; palette/width 219 f000 - lda highscorelabeladjust2,y 220 f000 - sta temp4 ; X 221 f000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 222 f000 - sta temp5 ; Y 223 f000 - 224 f000 - lda scorevarlo,y 225 f000 - sta temp7 ; score variable lo 226 f000 - lda scorevarhi,y 227 f000 - sta temp8 ; score variable hi 228 f000 - 229 f000 - lda #(hiscorefont_mode | %01100000) ; charactermode 230 f000 - sta temp9 231 f000 - 232 f000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 233 f000 - sta temp1 ; charmaplo 234 f000 - lda #>(hiscorefont+33) 235 f000 - sta temp2 ; charmaphi 236 f000 - lda #SCORESIZE 237 f000 - sta temp6 238 f000 - ifnconst DOUBLEWIDE 239 f000 - jsr plotvalue 240 f000 - else 241 f000 - jsr plotvaluedw 242 f000 - endif 243 f000 - 244 f000 -USED_PLOTVALUE = 1 ; ensure that plotvalue gets compiled in 245 f000 - 246 f000 - ifconst HSGAMERANKS 247 f000 - 248 f000 - ldx #$ff ; start at 0 after the inx... 249 f000 -comparescore2rankloop 250 f000 - inx 251 f000 - ldy #0 252 f000 - lda rankvalue_0,x 253 f000 - cmp (temp7),y 254 f000 - bcc score2rankloopdone 255 f000 - bne comparescore2rankloop 256 f000 - iny 257 f000 - lda rankvalue_1,x 258 f000 - cmp (temp7),y 259 f000 - bcc score2rankloopdone 260 f000 - bne comparescore2rankloop 261 f000 - iny 262 f000 - lda (temp7),y 263 f000 - cmp rankvalue_2,x 264 f000 - bcs score2rankloopdone 265 f000 - jmp comparescore2rankloop 266 f000 -score2rankloopdone 267 f000 - stx hsnewscorerank 268 f000 - 269 f000 - lda ranklabello,x 270 f000 - sta temp1 271 f000 - lda ranklabelhi,x 272 f000 - sta temp2 273 f000 - sec 274 f000 - lda #32 ; palette=0*29 | 32-(width=3) 275 f000 - sbc ranklabellengths,x 276 f000 - sta temp3 ; palette/width 277 f000 - sec 278 f000 - lda #(40+6) 279 f000 - sbc ranklabellengths,x 280 f000 - asl 281 f000 - sta temp4 ; X 282 f000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 283 f000 - sta temp5 ; Y 284 f000 - jsr plotcharacters 285 f000 - 286 f000 - ldx hsnewscorerank 287 f000 - 288 f000 - lda #highscoreranklabel 291 f000 - sta temp2 292 f000 - 293 f000 - lda #(32-5) ; palette=0*29 | 32-(width=3) 294 f000 - sta temp3 ; palette/width 295 f000 - lda #(40-6) 296 f000 - sec 297 f000 - sbc ranklabellengths,x 298 f000 - asl 299 f000 - sta temp4 ; X 300 f000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 301 f000 - sta temp5 ; Y 302 f000 - jsr plotcharacters 303 f000 - endif 304 f000 - 305 f000 - 306 f000 - ; ** which line did this player beat? 307 f000 - lda #$ff 308 f000 - sta hsnewscoreline 309 f000 - ldx #$fd 310 f000 -comparescoreadd2x 311 f000 - inx 312 f000 -comparescoreadd1x 313 f000 - inx 314 f000 -comparescore2lineloop 315 f000 - inc hsnewscoreline 316 f000 - inx ; initialrun, x=0 317 f000 - cpx #15 318 f000 - beq nohighscoreforyou 319 f000 - ldy #0 320 f000 - lda HSRAMScores,x 321 f000 - cmp (temp7),y ; first score digit 322 f000 - bcc score2lineloopdonedel1x 323 f000 - bne comparescoreadd2x 324 f000 - iny 325 f000 - inx 326 f000 - lda HSRAMScores,x 327 f000 - cmp (temp7),y 328 f000 - bcc score2lineloopdonedel2x 329 f000 - bne comparescoreadd1x 330 f000 - iny 331 f000 - inx 332 f000 - lda (temp7),y 333 f000 - cmp HSRAMScores,x 334 f000 - bcs score2lineloopdonedel3x 335 f000 - jmp comparescore2lineloop 336 f000 -nohighscoreforyou 337 f000 - lda #$ff 338 f000 - sta hsnewscoreline 339 f000 - sta countdownseconds 340 f000 - jmp donoscoreevaluation 341 f000 -score2lineloopdonedel3x 342 f000 - dex 343 f000 -score2lineloopdonedel2x 344 f000 - dex 345 f000 -score2lineloopdonedel1x 346 f000 - dex 347 f000 - 348 f000 - ; 0 1 2 349 f000 - ; 3 4 5 350 f000 - ; 6 7 8 351 f000 - ; 9 0 1 352 f000 - ; 2 3 4 353 f000 - 354 f000 - stx temp9 355 f000 - cpx #11 356 f000 - beq postsortscoresuploop 357 f000 - ldx #11 358 f000 -sortscoresuploop 359 f000 - lda HSRAMScores,x 360 f000 - sta HSRAMScores+3,x 361 f000 - lda HSRAMInitials,x 362 f000 - sta HSRAMInitials+3,x 363 f000 - dex 364 f000 - cpx temp9 365 f000 - bne sortscoresuploop 366 f000 -postsortscoresuploop 367 f000 - 368 f000 - ;stick the score and cleared initials in the slot... 369 f000 - inx 370 f000 - ldy #0 371 f000 - sty hsinitialhold 372 f000 - lda (temp7),y 373 f000 - sta HSRAMScores,x 374 f000 - iny 375 f000 - lda (temp7),y 376 f000 - sta HSRAMScores+1,x 377 f000 - iny 378 f000 - lda (temp7),y 379 f000 - sta HSRAMScores+2,x 380 f000 - lda #0 381 f000 - sta HSRAMInitials,x 382 f000 - lda #29 383 f000 - sta HSRAMInitials+1,x 384 f000 - sta HSRAMInitials+2,x 385 f000 - 386 f000 - stx hsinitialpos 387 f000 - 388 f000 - ifconst vox_highscore 389 f000 - lda <#vox_highscore 390 f000 - sta speech_addr 391 f000 - lda >#vox_highscore 392 f000 - sta speech_addr+1 393 f000 - endif 394 f000 - ifconst sfx_highscore 395 f000 - lda <#sfx_highscore 396 f000 - sta temp1 397 f000 - lda >#sfx_highscore 398 f000 - sta temp2 399 f000 - lda #0 400 f000 - sta temp3 401 f000 - jsr schedulesfx 402 f000 - endif 403 f000 - ifconst songdatastart_song_highscore 404 f000 - lda #songchanneltable_song_highscore 407 f000 - sta songpointerhi 408 f000 - lda #73 409 f000 - sta songtempo 410 f000 - jsr setsongchannels 411 f000 - endif 412 f000 - 413 f000 - 414 f000 -donoscoreevaluation 415 f000 - 416 f000 - lda #(32+(32-SCORESIZE)) ; palette=0*32 | 32-(width=6) 417 f000 - sta temp3 ; palette/width 418 f000 - lda #(72+(4*(6-SCORESIZE))) 419 f000 - sta temp4 ; X 420 f000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 421 f000 - sta temp5 ; Y 422 f000 - lda #HSRAMScores 425 f000 - sta temp8 ; score variable hi 426 f000 - lda #(hiscorefont_mode | %01100000) ; charactermode 427 f000 - sta temp9 428 f000 -plothsscoresloop 429 f000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 430 f000 - sta temp1 ; charmaplo 431 f000 - lda #>(hiscorefont+33) 432 f000 - sta temp2 ; charmaphi 433 f000 - lda #6 434 f000 - sta temp6 435 f000 - ifnconst DOUBLEWIDE 436 f000 - jsr plotvalue 437 f000 - else 438 f000 - jsr plotvaluedw 439 f000 - endif 440 f000 - clc 441 f000 - lda temp3 442 f000 - adc #32 443 f000 - sta temp3 444 f000 - inc temp5 445 f000 - if WZONEHEIGHT = 8 446 f000 - inc temp5 447 f000 - endif 448 f000 - clc 449 f000 - lda #3 450 f000 - adc temp7 451 f000 - sta temp7 452 f000 - cmp #(<(HSRAMScores+15)) 453 f000 - bcc plothsscoresloop 454 f000 -plothsindex 455 f000 - lda #32+31 ; palette=0*32 | 32-(width=1) 456 f000 - sta temp3 ; palette/width 457 f000 - lda #44 458 f000 - sta temp4 ; X 459 f000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 460 f000 - sta temp5 ; Y 461 f000 - lda #hsgameslotnumbers 464 f000 - sta temp8 ; score variable hi 465 f000 - lda #(hiscorefont_mode | %01100000) ; charactermode 466 f000 - sta temp9 467 f000 -plothsindexloop 468 f000 - lda #<(hiscorefont+33) 469 f000 - sta temp1 ; charmaplo 470 f000 - lda #>(hiscorefont+33) 471 f000 - sta temp2 ; charmaphi 472 f000 - lda #1 473 f000 - sta temp6 ; number of characters 474 f000 - ifnconst DOUBLEWIDE 475 f000 - jsr plotvalue 476 f000 - else 477 f000 - jsr plotvaluedw 478 f000 - endif 479 f000 - clc 480 f000 - lda temp3 481 f000 - adc #32 482 f000 - sta temp3 483 f000 - inc temp5 484 f000 - if WZONEHEIGHT = 8 485 f000 - inc temp5 486 f000 - endif 487 f000 - inc temp7 488 f000 - lda temp7 489 f000 - cmp #(<(hsgameslotnumbers+5)) 490 f000 - bcc plothsindexloop 491 f000 - 492 f000 - jsr savescreen 493 f000 - ifnconst HSSECONDS 494 f000 - lda #6 495 f000 - else 496 f000 - lda #HSSECONDS 497 f000 - endif 498 f000 - 499 f000 - sta countdownseconds 500 f000 - 501 f000 -keepdisplayinghs 502 f000 - jsr restorescreen 503 f000 - 504 f000 - jsr setuphsinpt1 505 f000 - 506 f000 - lda hsnewscoreline 507 f000 - bpl carryonkeepdisplayinghs 508 f000 - jmp skipenterscorecontrol 509 f000 -carryonkeepdisplayinghs 510 f000 - 511 f000 - 512 f000 - ifnconst HSSECONDS 513 f000 - lda #6 514 f000 - else 515 f000 - lda #HSSECONDS 516 f000 - endif 517 f000 - 518 f000 - sta countdownseconds 519 f000 - 520 f000 - ;plot the "cursor" initial sprite... 521 f000 - lda hsinitialhold 522 f000 - 523 f000 - sta temp1 524 f000 - lda #>(hiscorefont+32) 525 f000 - sta temp2 526 f000 - lda #31 ; palette=0*32 | 32-(width=1) 527 f000 - sta temp3 ; palette/width 528 f000 - lda hscursorx 529 f000 - asl 530 f000 - asl 531 f000 - clc 532 f000 - adc #104 533 f000 - sta temp4 ; X 534 f000 - lda hsnewscoreline 535 f000 - asl 536 f000 - asl 537 f000 - asl 538 f000 - asl 539 f000 - adc #((3*16)+HSCURSORY) 540 f000 - sta temp5 ; Y 541 f000 - lda #%01000000 542 f000 - sta temp6 543 f000 - jsr plotsprite 544 f000 - 545 f000 - ldx hscursorx 546 f000 - ldy hsdisplaymode 547 f000 - lda SWCHA 548 f000 - cpy #3 549 f000 - bne hsskipadjustjoystick1 550 f000 - asl 551 f000 - asl 552 f000 - asl 553 f000 - asl 554 f000 -hsskipadjustjoystick1 555 f000 - sta hsswcha 556 f000 - lda SWCHB 557 f000 - and #%00000010 558 f000 - bne hsskipselectswitch 559 f000 - lda #%00010000 560 f000 - sta hsswcha 561 f000 - bne hsdodebouncecheck 562 f000 -hsskipselectswitch 563 f000 - lda hsswcha 564 f000 - and #%00110000 565 f000 - cmp #%00110000 566 f000 - beq hsjoystickskipped 567 f000 -hsdodebouncecheck 568 f000 - lda hsjoydebounce 569 f000 - beq hsdontdebounce 570 f000 - jmp hspostjoystick 571 f000 -hsdontdebounce 572 f000 - ldx #1 ; small tick sound 573 f000 - jsr playhssfx 574 f000 - lda hsswcha 575 f000 - and #%00110000 576 f000 - ldx hscursorx 577 f000 - cmp #%00100000 ; check down 578 f000 - bne hsjoycheckup 579 f000 - ldy hsinitialhold 580 f000 - cpx #0 581 f000 - bne skipavoid31_1 582 f000 - cpy #0 ; if we're about to change to the <- char (#31) then double-decrement to skip over it 583 f000 - bne skipavoid31_1 584 f000 - dey 585 f000 -skipavoid31_1 586 f000 - dey 587 f000 - jmp hssetdebounce 588 f000 -hsjoycheckup 589 f000 - cmp #%00010000 ; check up 590 f000 - bne hsjoystickskipped 591 f000 - ldy hsinitialhold 592 f000 - cpx #0 593 f000 - bne skipavoid31_2 594 f000 - cpy #30 ; if we're about to change to the <- char (#31) then double-increment to skip over it 595 f000 - bne skipavoid31_2 596 f000 - iny 597 f000 -skipavoid31_2 598 f000 - iny 599 f000 -hssetdebounce 600 f000 - tya 601 f000 - and #31 602 f000 - sta hsinitialhold 603 f000 - lda #15 604 f000 - sta hsjoydebounce 605 f000 - bne hspostjoystick 606 f000 -hsjoystickskipped 607 f000 - ; check the fire button only when the stick isn't engaged 608 f000 - lda hsinpt1 609 f000 - bpl hsbuttonskipped 610 f000 - lda hsjoydebounce 611 f000 - beq hsfiredontdebounce 612 f000 - bne hspostjoystick 613 f000 -hsfiredontdebounce 614 f000 - lda hsinitialhold 615 f000 - cmp #31 616 f000 - beq hsmovecursorback 617 f000 - inc hscursorx 618 f000 - inc hsinitialpos 619 f000 - lda hscursorx 620 f000 - cmp #3 621 f000 - bne skiphsentryisdone 622 f000 - lda #0 623 f000 - sta framecounter 624 f000 - lda #$ff 625 f000 - sta hsnewscoreline 626 f000 - dec hsinitialpos 627 f000 - bne skiphsentryisdone 628 f000 -hsmovecursorback 629 f000 - lda hscursorx 630 f000 - beq skiphsmovecursorback 631 f000 - lda #29 632 f000 - ldx hsinitialpos 633 f000 - sta HSRAMInitials,x 634 f000 - dec hsinitialpos 635 f000 - dec hscursorx 636 f000 - dex 637 f000 - lda HSRAMInitials,x 638 f000 - sta hsinitialhold 639 f000 -skiphsmovecursorback 640 f000 -skiphsentryisdone 641 f000 - ldx #0 642 f000 - jsr playhssfx 643 f000 - lda #20 644 f000 - sta hsjoydebounce 645 f000 - bne hspostjoystick 646 f000 - 647 f000 -hsbuttonskipped 648 f000 - lda #0 649 f000 - sta hsjoydebounce 650 f000 -hspostjoystick 651 f000 - 652 f000 - ldx hsinitialpos 653 f000 - lda hsinitialhold 654 f000 - sta HSRAMInitials,x 655 f000 - 656 f000 - jmp skiphschasecolors 657 f000 - 658 f000 -skipenterscorecontrol 659 f000 - jsr hschasecolors 660 f000 - jsr setuphsinpt1 661 f000 - lda hsjoydebounce 662 f000 - bne skiphschasecolors 663 f000 - lda hsinpt1 664 f000 - bmi returnfromhs 665 f000 -skiphschasecolors 666 f000 - 667 f000 - jsr drawscreen 668 f000 - 669 f000 - lda countdownseconds 670 f000 - beq returnfromhs 671 f000 - jmp keepdisplayinghs 672 f000 -returnfromhs 673 f000 - 674 f000 - ifconst songdatastart_song_highscore 675 f000 - lda hsdisplaymode 676 f000 - beq skipclearHSCsong 677 f000 - lda #0 678 f000 - sta songtempo 679 f000 -skipclearHSCsong 680 f000 - endif 681 f000 - jsr drawwait 682 f000 - jsr clearscreen 683 f000 - lda #0 684 f000 - ldy #7 685 f000 - jsr blacken320colors 686 f000 - lda ssCTRL 687 f000 - sta sCTRL 688 f000 - lda ssCHARBASE 689 f000 - sta sCHARBASE 690 f000 - rts 691 f000 - 692 f000 -setuphsinpt1 693 f000 - lda #$ff 694 f000 - sta hsinpt1 695 f000 - lda hsjoydebounce 696 f000 - beq skipdebounceadjust 697 f000 - dec hsjoydebounce 698 f000 - bne skipstorefirebuttonstatus 699 f000 -skipdebounceadjust 700 f000 - lda SWCHB 701 f000 - and #%00000001 702 f000 - bne hscheckresetover 703 f000 - lda #$ff 704 f000 - sta hsinpt1 705 f000 - rts 706 f000 -hscheckresetover 707 f000 - ldx hsdisplaymode 708 f000 - cpx #3 709 f000 - bne hsskipadjustjoyfire1 710 f000 - lda sINPT3 711 f000 - jmp hsskipadjustjoyfire1done 712 f000 -hsskipadjustjoyfire1 713 f000 - lda sINPT1 714 f000 -hsskipadjustjoyfire1done 715 f000 - sta hsinpt1 716 f000 -skipstorefirebuttonstatus 717 f000 - rts 718 f000 - 719 f000 -blacken320colors 720 f000 - ldy #7 721 f000 -blacken320colorsloop 722 f000 - sta P0C2,y 723 f000 - dey 724 f000 - bpl blacken320colorsloop 725 f000 - rts 726 f000 - 727 f000 -hschasecolors 728 f000 - lda framecounter 729 f000 - and #3 730 f000 - bne hschasecolorsreturn 731 f000 - inc hscolorchaseindex 732 f000 - lda hscolorchaseindex 733 f000 - 734 f000 - sta P5C2 735 f000 - sbc #$02 736 f000 - sta P4C2 737 f000 - sbc #$02 738 f000 - sta P3C2 739 f000 - sbc #$02 740 f000 - sta P2C2 741 f000 - sbc #$02 742 f000 - sta P1C2 743 f000 -hschasecolorsreturn 744 f000 - rts 745 f000 - 746 f000 -playhssfx 747 f000 - lda hssfx_lo,x 748 f000 - sta temp1 749 f000 - lda hssfx_hi,x 750 f000 - sta temp2 751 f000 - lda #0 752 f000 - sta temp3 753 f000 - jmp schedulesfx 754 f000 - 755 f000 -hssfx_lo 756 f000 - .byte sfx_hsletterpositionchange, >sfx_hslettertick 759 f000 - 760 f000 -sfx_hsletterpositionchange 761 f000 - .byte $10,$18,$00 762 f000 - .byte $02,$06,$08 763 f000 - .byte $02,$06,$04 764 f000 - .byte $00,$00,$00 765 f000 -sfx_hslettertick 766 f000 - .byte $10,$18,$00 767 f000 - .byte $00,$00,$0a 768 f000 - .byte $00,$00,$00 769 f000 - 770 f000 -highscorelabeladjust1 771 f000 - .byte (80-(14*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)) 772 f000 -highscorelabeladjust2 773 f000 - .byte (80+(14*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)) 774 f000 - 775 f000 -scorevarlo 776 f000 - .byte <(score0+((6-SCORESIZE)/2)),<(score0+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)) 777 f000 -scorevarhi 778 f000 - .byte >(score0+((6-SCORESIZE)/2)),>(score0+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)) 779 f000 - 780 f000 - ifnconst HSNOLEVELNAMES 781 f000 -highscoredifficultytextlo 782 f000 - .byte easylevelname, >mediumlevelname, >hardlevelname, >expertlevelname 785 f000 - ifnconst HSCUSTOMLEVELNAMES 786 f000 -highscoredifficultytextlen 787 f000 - .byte 22, 30, 26, 24 788 f000 - 789 f000 -easylevelname 790 f000 - .byte $04,$00,$12,$18,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 791 f000 -mediumlevelname 792 f000 - .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 f000 -hardlevelname 794 f000 - .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 f000 -expertlevelname 796 f000 - .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 f000 - else 798 f000 - include "7800hsgamediffnames.asm" 799 f000 - endif ; HSCUSTOMLEVELNAMES 800 f000 - else 801 f000 -HSHIGHSCOREStext 802 f000 - .byte $07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 803 f000 - endif ; HSNOLEVELNAMES 804 f000 - 805 f000 -highscorelabeltextlo 806 f000 - .byte player0label, >player1label, >player2label 809 f000 - 810 f000 -player0label 811 f000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$12,$02,$0e,$11,$04,$1a,$1d,$1d 812 f000 - 813 f000 -player1label 814 f000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$22,$1d,$12,$02,$0e,$11,$04,$1a 815 f000 - 816 f000 -player2label 817 f000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$23,$1d,$12,$02,$0e,$11,$04,$1a 818 f000 - 819 f000 - 820 f000 - ifconst HSGAMENAMELEN 821 f000 -HSGAMENAMEtable 822 f000 - include "7800hsgamename.asm" 823 f000 - endif 824 f000 - ifconst HSGAMERANKS 825 f000 - include "7800hsgameranks.asm" 826 f000 -highscoreranklabel 827 f000 - .byte $11,$00,$0d,$0a,$1a 828 f000 - endif 829 f000 - 830 f000 - ;ensure our table doesn't wrap a page... 831 f000 - if ((<*)>251) 832 f000 - align 256 833 f000 - endif 834 f000 -hsgameslotnumbers 835 f000 - .byte 33,34,35,36,37 836 f000 - endif 837 f000 - 838 f000 -loaddifficultytable 839 f000 - lda gamedifficulty 840 f000 - and #$03 ; ensure the user hasn't selected an invalid difficulty 841 f000 - sta gamedifficulty 842 f000 - cmp hsdifficulty ; check game difficulty is the same as RAM table 843 f000 - bne loaddifficultytablecontinue1 844 f000 - rts ; this high score difficulty table is already loaded 845 f000 -loaddifficultytablecontinue1 846 f000 - lda gamedifficulty 847 f000 - sta hsdifficulty 848 f000 - ;we need to check the device for the table 849 f000 - lda hsdevice 850 f000 - bne loaddifficultytablecontinue2 851 f000 - ; there's no save device. clear out this table. 852 f000 - jmp cleardifficultytablemem 853 f000 -loaddifficultytablecontinue2 854 f000 - lda hsdevice 855 f000 - and #1 856 f000 - beq memdeviceisntHSC 857 f000 - jmp loaddifficultytableHSC 858 f000 -memdeviceisntHSC 859 f000 - jmp loaddifficultytableAVOX 860 f000 - 861 f000 -savedifficultytable 862 f000 - ;*** we need to check wich device we should use... 863 f000 - lda hsdevice 864 f000 - bne savedifficultytablerealdevice 865 f000 - rts ; its a ram device 866 f000 -savedifficultytablerealdevice 867 f000 - and #1 868 f000 - beq savememdeviceisntHSC 869 f000 - jmp savedifficultytableHSC 870 f000 -savememdeviceisntHSC 871 f000 - jmp savedifficultytableAVOX 872 f000 - 873 f000 -savedifficultytableAVOX 874 f000 - ; the load call already setup the memory structure and atarivox memory location 875 f000 - jsr savealoadedHSCtablecontinue 876 f000 -savedifficultytableAVOXskipconvert 877 f000 - lda #HSIDHI 878 f000 - sta eeprombuffer 879 f000 - lda #HSIDLO 880 f000 - sta eeprombuffer+1 881 f000 - lda hsdifficulty 882 f000 - sta eeprombuffer+2 883 f000 - lda #32 884 f000 - jsr AVoxWriteBytes 885 f000 - rts 886 f000 - 887 f000 -savedifficultytableHSC 888 f000 - ;we always load a table before reaching here, so the 889 f000 - ;memory structures from the load should be intact... 890 f000 - ldy hsgameslot 891 f000 - bpl savealoadedHSCtable 892 f000 - rts 893 f000 -savealoadedHSCtable 894 f000 - lda HSCGameDifficulty,y 895 f000 - cmp #$7F 896 f000 - bne savealoadedHSCtablecontinue 897 f000 - jsr initializeHSCtableentry 898 f000 -savealoadedHSCtablecontinue 899 f000 - ;convert our RAM table to HSC format and write it out... 900 f000 - ldy #0 901 f000 - ldx #0 902 f000 -savedifficultytableScores 903 f000 - 904 f000 - lda HSRAMInitials,x 905 f000 - sta temp3 906 f000 - lda HSRAMInitials+1,x 907 f000 - sta temp4 908 f000 - lda HSRAMInitials+2,x 909 f000 - sta temp5 910 f000 - jsr encodeHSCInitials ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 911 f000 - 912 f000 - lda temp1 913 f000 - sta (HSGameTableLo),y 914 f000 - iny 915 f000 - lda temp2 916 f000 - sta (HSGameTableLo),y 917 f000 - iny 918 f000 - 919 f000 - lda HSRAMScores,x 920 f000 - sta (HSGameTableLo),y 921 f000 - iny 922 f000 - lda HSRAMScores+1,x 923 f000 - sta (HSGameTableLo),y 924 f000 - iny 925 f000 - lda HSRAMScores+2,x 926 f000 - sta (HSGameTableLo),y 927 f000 - iny 928 f000 - inx 929 f000 - inx 930 f000 - inx ; +3 931 f000 - cpx #15 932 f000 - bne savedifficultytableScores 933 f000 - rts 934 f000 - 935 f000 -loaddifficultytableHSC 936 f000 - ; routine responsible for loading the difficulty table from HSC 937 f000 - jsr findindexHSC 938 f000 - ldy hsgameslot 939 f000 - lda HSCGameDifficulty,y 940 f000 - cmp #$7F 941 f000 - bne loaddifficultytableHSCcontinue 942 f000 - ;there was an error. use a new RAM table instead... 943 f000 - jmp cleardifficultytablemem 944 f000 -loaddifficultytableHSCcontinue 945 f000 - ; parse the data into the HS memory... 946 f000 - ldy #0 947 f000 - ldx #0 948 f000 -loaddifficultytableScores 949 f000 - lda (HSGameTableLo),y 950 f000 - sta temp1 951 f000 - iny 952 f000 - lda (HSGameTableLo),y 953 f000 - sta temp2 954 f000 - jsr decodeHSCInitials ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 955 f000 - iny 956 f000 - lda (HSGameTableLo),y 957 f000 - sta HSRAMScores,x 958 f000 - lda temp3 959 f000 - sta HSRAMInitials,x 960 f000 - inx 961 f000 - iny 962 f000 - lda (HSGameTableLo),y 963 f000 - sta HSRAMScores,x 964 f000 - lda temp4 965 f000 - sta HSRAMInitials,x 966 f000 - inx 967 f000 - iny 968 f000 - lda (HSGameTableLo),y 969 f000 - sta HSRAMScores,x 970 f000 - lda temp5 971 f000 - sta HSRAMInitials,x 972 f000 - inx 973 f000 - iny 974 f000 - cpx #15 975 f000 - bne loaddifficultytableScores 976 f000 - rts 977 f000 - 978 f000 -decodeHSCInitials 979 f000 - ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 980 f000 - ; 2 bytes are packed in the form: 22211111 22_33333 981 f000 - lda #0 982 f000 - sta temp4 983 f000 - lda temp1 984 f000 - and #%00011111 985 f000 - sta temp3 986 f000 - 987 f000 - lda temp2 988 f000 - and #%00011111 989 f000 - sta temp5 990 f000 - 991 f000 - lda temp1 992 f000 - asl 993 f000 - rol temp4 994 f000 - asl 995 f000 - rol temp4 996 f000 - asl 997 f000 - rol temp4 998 f000 - lda temp2 999 f000 - asl 1000 f000 - rol temp4 1001 f000 - asl 1002 f000 - rol temp4 1003 f000 - rts 1004 f000 -encodeHSCInitials 1005 f000 - ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 1006 f000 - ; 2 bytes are packed in the form: 22211111 22_33333 1007 f000 - ; start with packing temp1... 1008 f000 - lda temp4 1009 f000 - and #%00011100 1010 f000 - sta temp1 1011 f000 - asl temp1 1012 f000 - asl temp1 1013 f000 - asl temp1 1014 f000 - lda temp3 1015 f000 - and #%00011111 1016 f000 - ora temp1 1017 f000 - sta temp1 1018 f000 - ; ...temp1 is now packed, on to temp2... 1019 f000 - lda temp5 1020 f000 - asl 1021 f000 - asl 1022 f000 - ror temp4 1023 f000 - ror 1024 f000 - ror temp4 1025 f000 - ror 1026 f000 - sta temp2 1027 f000 - rts 1028 f000 - 1029 f000 -findindexHSCerror 1030 f000 - ;the HSC is stuffed. return the bad slot flag 1031 f000 - ldy #$ff 1032 f000 - sty hsgameslot 1033 f000 - rts 1034 f000 - 1035 f000 -findindexHSC 1036 f000 -HSCGameID1 = $1029 1037 f000 -HSCGameID2 = $106E 1038 f000 -HSCGameDifficulty = $10B3 1039 f000 -HSCGameIndex = $10F8 1040 f000 - ; routine responsible for finding the game index from HSC 1041 f000 - ; call with x=0 to create a new table if none exist, call with x=$ff to avoid creating new tables 1042 f000 - ; the HS loading routine will use x=$ff, the HS saving routine will use x=0 1043 f000 - ldy #69 ; start +1 to account for the dey 1044 f000 -findindexHSCloop 1045 f000 - dey 1046 f000 - bmi findindexHSCerror 1047 f000 - lda HSCGameDifficulty,y 1048 f000 - cmp #$7F 1049 f000 - beq findourindexHSC 1050 f000 - cmp gamedifficulty 1051 f000 - bne findindexHSCloop 1052 f000 - lda HSCGameID1,y 1053 f000 - cmp #HSIDHI 1054 f000 - bne findindexHSCloop 1055 f000 - lda HSCGameID2,y 1056 f000 - cmp #HSIDLO 1057 f000 - bne findindexHSCloop 1058 f000 -findourindexHSC 1059 f000 - ; if we're here we found our index in the table 1060 f000 - ; or we found the first empty one 1061 f000 - sty hsgameslot 1062 f000 - jsr setupHSCGamepointer ; setup the pointer to the HS Table for this game... 1063 f000 - rts 1064 f000 - 1065 f000 - 1066 f000 -initializeHSCtableentry 1067 f000 - ldy hsgameslot 1068 f000 - ; we need to make a new entry... 1069 f000 - lda #HSIDHI 1070 f000 - sta HSCGameID1,y 1071 f000 - lda #HSIDLO 1072 f000 - sta HSCGameID2,y 1073 f000 - lda gamedifficulty 1074 f000 - sta HSCGameDifficulty,y 1075 f000 - ldx #0 1076 f000 -fixHSDGameDifficultylistLoop 1077 f000 - inx 1078 f000 - txa 1079 f000 - sta HSCGameIndex,y 1080 f000 - iny 1081 f000 - cpy #69 1082 f000 - bne fixHSDGameDifficultylistLoop 1083 f000 - rts 1084 f000 - 1085 f000 -setupHSCGamepointer 1086 f000 - ; this routines sets (HSGameTableLo) pointing to the game's HS table 1087 f000 - lda #$17 1088 f000 - sta HSGameTableHi 1089 f000 - lda #$FA 1090 f000 - sta HSGameTableLo 1091 f000 -setupHSCGamepointerLoop 1092 f000 - lda HSGameTableLo 1093 f000 - sec 1094 f000 - sbc #25 1095 f000 - sta HSGameTableLo 1096 f000 - lda HSGameTableHi 1097 f000 - sbc #0 1098 f000 - sta HSGameTableHi 1099 f000 - iny 1100 f000 - cpy #69 1101 f000 - bne setupHSCGamepointerLoop 1102 f000 - rts 1103 f000 - 1104 f000 -loaddifficultytableAVOX 1105 f000 - ; routine responsible for loading the difficulty table from Avox 1106 f000 - ; we reuse HSC routines to format data to/from our Avox RAM buffer... 1107 f000 - lda #>(eeprombuffer+3) 1108 f000 - sta HSGameTableHi 1109 f000 - lda #<(eeprombuffer+3) 1110 f000 - sta HSGameTableLo 1111 f000 - 1112 f000 - ; the start location in EEPROM, subtract 32... 1113 f000 - lda #$5F 1114 f000 - sta HSVoxHi 1115 f000 - lda #$E0 1116 f000 - sta HSVoxLo 1117 f000 - lda #0 1118 f000 - sta temp1 1119 f000 -loaddifficultytableAVOXloop 1120 f000 - inc temp1 1121 f000 - beq loaddifficultytableAVOXfull 1122 f000 - clc 1123 f000 - lda HSVoxLo 1124 f000 - adc #32 1125 f000 - sta HSVoxLo 1126 f000 - lda HSVoxHi 1127 f000 - adc #0 1128 f000 - sta HSVoxHi 1129 f000 - lda #3 1130 f000 - jsr AVoxReadBytes ; read in 3 bytes, ID1,ID2,Difficulty 1131 f000 - lda eeprombuffer 1132 f000 - cmp #$FF 1133 f000 - beq loaddifficultytableAVOXempty 1134 f000 - cmp #HSIDHI 1135 f000 - bne loaddifficultytableAVOXloop 1136 f000 - lda eeprombuffer+1 1137 f000 - cmp #HSIDLO 1138 f000 - bne loaddifficultytableAVOXloop 1139 f000 - lda eeprombuffer+2 1140 f000 - cmp gamedifficulty 1141 f000 - bne loaddifficultytableAVOXloop 1142 f000 -loaddifficultytableAVOXdone 1143 f000 - lda #32 1144 f000 - jsr AVoxReadBytes 1145 f000 - jsr loaddifficultytableHSCcontinue 1146 f000 - rts 1147 f000 -loaddifficultytableAVOXfull 1148 f000 - lda #0 1149 f000 - sta hsdevice ; looks like all 255 entries are taken... disable it. 1150 f000 -loaddifficultytableAVOXempty 1151 f000 - jmp cleardifficultytablemem 1152 f000 - rts 1153 f000 - 1154 f000 -cleardifficultytablemem 1155 f000 - ldy #29 1156 f000 - lda #0 1157 f000 -cleardifficultytablememloop 1158 f000 - sta HSRAMTable,y 1159 f000 - dey 1160 f000 - bpl cleardifficultytablememloop 1161 f000 - rts 1162 f000 -hiscoremoduleend 1163 f000 - 1164 f000 - echo " hiscore assembly: ",[(hiscoremoduleend-hiscoremodulestart)]d," bytes" 1165 f000 - 1166 f000 - ifconst DOUBLEWIDE 1167 f000 -plotvaluedw 1168 f000 -plotdigitcount = temp6 1169 f000 - lda #0 1170 f000 - tay 1171 f000 - ldx valbufend 1172 f000 - 1173 f000 - lda plotdigitcount 1174 f000 - and #1 1175 f000 - beq pvnibble2chardw 1176 f000 - lda #0 1177 f000 - sta VALBUFFER,x ; just in case we skip this digit 1178 f000 - beq pvnibble2char_skipnibbledw 1179 f000 - 1180 f000 -pvnibble2chardw 1181 f000 - ; high nibble... 1182 f000 - lda (temp7),y 1183 f000 - and #$f0 1184 f000 - lsr 1185 f000 - lsr 1186 f000 - lsr 1187 f000 - lsr 1188 f000 - 1189 f000 - clc 1190 f000 - adc temp1 ; add the offset to character graphics to our value 1191 f000 - sta VALBUFFER,x 1192 f000 - inx 1193 f000 - dec plotdigitcount 1194 f000 -pvnibble2char_skipnibbledw 1195 f000 - ; low nibble... 1196 f000 - lda (temp7),y 1197 f000 - and #$0f 1198 f000 - clc 1199 f000 - adc temp1 ; add the offset to character graphics to our value 1200 f000 - sta VALBUFFER,x 1201 f000 - inx 1202 f000 - iny 1203 f000 - 1204 f000 - dec plotdigitcount 1205 f000 - bne pvnibble2chardw 1206 f000 - ;point to the start of our valuebuffer 1207 f000 - clc 1208 f000 - lda #VALBUFFER 1212 f000 - adc #0 1213 f000 - sta temp2 1214 f000 - 1215 f000 - ;advance valbufend to the end of our value buffer 1216 f000 - stx valbufend 1217 f000 - 1218 f000 - ifnconst plotvalueonscreen 1219 f000 - jmp plotcharacters 1220 f000 - else 1221 f000 - jmp plotcharacterslive 1222 f000 - endif 1223 f000 - endif ; DOUBLEWIDE 1224 f000 - 1225 f000 endif ; HSSUPPORT 1226 f000 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_VerticalShooter_Test_sprani.78b.asm 4510 f000 endif 4511 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 4512 f000 4513 f000 ;standard routimes needed for pretty much all games 4514 f000 4515 f000 ; some definitions used with "set debug color" 4516 f000 00 91 DEBUGCALC = $91 4517 f000 00 41 DEBUGWASTE = $41 4518 f000 00 c1 DEBUGDRAW = $C1 4519 f000 4520 f000 ;NMI and IRQ handlers 4521 f000 NMI 4522 f000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 4523 f000 48 pha ; save A 4524 f001 a5 4d lda visibleover 4525 f003 49 ff eor #255 4526 f005 85 4d sta visibleover 4527 f007 - ifconst DEBUGINTERRUPT 4528 f007 - and #$93 4529 f007 - sta BACKGRND 4530 f007 endif 4531 f007 ce b2 01 dec interruptindex 4532 f00a d0 03 bne skipreallyoffvisible 4533 f00c 4c 73 f0 jmp reallyoffvisible 4534 f00f skipreallyoffvisible 4535 f00f a5 4d lda visibleover 4536 f011 d0 03 bne carryontopscreenroutine 4537 f013 - ifconst .bottomscreenroutine 4538 f013 - jsr .bottomscreenroutine 4539 f013 endif 4540 f013 4541 f013 4c 65 f0 jmp skiptopscreenroutine 4542 f016 carryontopscreenroutine 4543 f016 8a txa ; save X+Y 4544 f017 48 pha 4545 f018 98 tya 4546 f019 48 pha 4547 f01a d8 cld 4548 f01b - ifconst .topscreenroutine 4549 f01b - jsr .topscreenroutine 4550 f01b endif 4551 f01b ifnconst CANARYOFF 4552 f01b ad c1 01 lda canary 4553 f01e f0 0c beq skipcanarytriggered 4554 f020 a9 45 lda #$45 4555 f022 85 20 sta BACKGRND 4556 f024 a9 60 lda #$60 4557 f026 85 3c sta CTRL 4558 f028 8d 07 21 sta sCTRL 4559 f02b 02 .byte.b $02 ; KIL/JAM 4560 f02c endif 4561 f02c skipcanarytriggered 4562 f02c ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 4563 f02f 4564 f02f ; ** Other important routines that need to regularly run, and can run onscreen. 4565 f02f ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 4566 f02f 4567 f02f - ifconst LONGCONTROLLERREAD 4568 f02f -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 4569 f02f - ldy port1control 4570 f02f - lda longreadtype,y 4571 f02f - beq LLRET1 4572 f02f - tay 4573 f02f - lda longreadroutinehiP1,y 4574 f02f - sta inttemp4 4575 f02f - lda longreadroutineloP1,y 4576 f02f - sta inttemp3 4577 f02f - jmp (inttemp3) 4578 f02f -LLRET1 4579 f02f - ldy port0control 4580 f02f - lda longreadtype,y 4581 f02f - beq LLRET0 4582 f02f - tay 4583 f02f - lda longreadroutinehiP0,y 4584 f02f - sta inttemp4 4585 f02f - lda longreadroutineloP0,y 4586 f02f - sta inttemp3 4587 f02f - jmp (inttemp3) 4588 f02f -LLRET0 4589 f02f - 4590 f02f - 4591 f02f - ifconst PADDLERANGE 4592 f02f -TIMEVAL = PADDLERANGE 4593 f02f - else 4594 f02f -TIMEVAL = 160 4595 f02f - endif 4596 f02f -TIMEOFFSET = 10 4597 f02f - 4598 f02f endif ; LONGCONTROLLERREAD 4599 f02f 4600 f02f 4601 f02f 20 e5 f1 jsr servicesfxchannels 4602 f032 - ifconst MUSICTRACKER 4603 f032 - jsr servicesong 4604 f032 endif ; MUSICTRACKER 4605 f032 4606 f032 ee a4 01 inc framecounter 4607 f035 ad a4 01 lda framecounter 4608 f038 29 3f and #63 4609 f03a d0 08 bne skipcountdownseconds 4610 f03c ad a5 01 lda countdownseconds 4611 f03f f0 03 beq skipcountdownseconds 4612 f041 ce a5 01 dec countdownseconds 4613 f044 skipcountdownseconds 4614 f044 4615 f044 a2 01 ldx #1 4616 f046 buttonreadloop 4617 f046 8a txa 4618 f047 48 pha 4619 f048 bc b7 01 ldy port0control,x 4620 f04b b9 c8 f1 lda buttonhandlerlo,y 4621 f04e 85 da sta inttemp3 4622 f050 b9 bd f1 lda buttonhandlerhi,y 4623 f053 85 db sta inttemp4 4624 f055 05 da ora inttemp3 4625 f057 f0 03 beq buttonreadloopreturn 4626 f059 6c da 00 jmp (inttemp3) 4627 f05c buttonreadloopreturn 4628 f05c 68 pla 4629 f05d aa tax 4630 f05e ca dex 4631 f05f 10 e5 bpl buttonreadloop 4632 f061 4633 f061 - ifconst KEYPADSUPPORT 4634 f061 - jsr keypadrowselect 4635 f061 endif ; KEYPADSUPPORT 4636 f061 4637 f061 4638 f061 - ifconst DOUBLEBUFFER 4639 f061 - lda doublebufferminimumframeindex 4640 f061 - beq skipdoublebufferminimumframeindexadjust 4641 f061 - dec doublebufferminimumframeindex 4642 f061 -skipdoublebufferminimumframeindexadjust 4643 f061 endif 4644 f061 4645 f061 68 pla 4646 f062 a8 tay 4647 f063 68 pla 4648 f064 aa tax 4649 f065 skiptopscreenroutine 4650 f065 68 pla 4651 f066 40 RTI 4652 f067 4653 f067 IRQ ; the only source of non-nmi is the BRK opcode. The only 4654 f067 ifnconst BREAKPROTECTOFF 4655 f067 a9 1a lda #$1A 4656 f069 85 20 sta BACKGRND 4657 f06b a9 60 lda #$60 4658 f06d 85 3c sta CTRL 4659 f06f 8d 07 21 sta sCTRL 4660 f072 02 .byte.b $02 ; KIL/JAM 4661 f073 - else 4662 f073 - RTI 4663 f073 endif 4664 f073 4665 f073 - ifconst LONGCONTROLLERREAD 4666 f073 - 4667 f073 -longreadtype 4668 f073 - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 4669 f073 - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 4670 f073 - .byte 3, 3, 0 ; STMOUSE AMOUSE ATARIVOX 4671 f073 - 4672 f073 -longreadroutineloP0 4673 f073 - .byte LLRET0 ; 0 = no routine 4680 f073 - .byte >paddleport0update ; 1 = paddle 4681 f073 - .byte >trakball0update ; 2 = trackball 4682 f073 - .byte >mouse0update ; 3 = mouse 4683 f073 - 4684 f073 -longreadroutineloP1 4685 f073 - .byte LLRET1 ; 0 = no routine 4692 f073 - .byte >paddleport1update ; 1 = paddle 4693 f073 - .byte >trakball1update ; 2 = trackball 4694 f073 - .byte >mouse1update ; 3 = mouse 4695 f073 - 4696 f073 - 4697 f073 -SETTIM64T 4698 f073 - bne skipdefaulttime 4699 f073 - ifnconst PADDLESMOOTHINGOFF 4700 f073 - lda #(TIMEVAL+TIMEOFFSET+1) 4701 f073 - else 4702 f073 - lda #(TIMEVAL+TIMEOFFSET) 4703 f073 - endif 4704 f073 -skipdefaulttime 4705 f073 - tay 4706 f073 - dey 4707 f073 -.setTIM64Tloop 4708 f073 - sta TIM64T 4709 f073 - cpy INTIM 4710 f073 - bne .setTIM64Tloop 4711 f073 - rts 4712 f073 endif ; LONGCONTROLLERREAD 4713 f073 4714 f073 reallyoffvisible 4715 f073 85 24 sta WSYNC 4716 f075 4717 f075 a9 00 lda #0 4718 f077 85 4d sta visibleover 4719 f079 - ifconst DEBUGINTERRUPT 4720 f079 - sta BACKGRND 4721 f079 endif 4722 f079 4723 f079 a9 03 lda #3 4724 f07b 8d b2 01 sta interruptindex 4725 f07e 4726 f07e 8a txa 4727 f07f 48 pha 4728 f080 98 tya 4729 f081 48 pha 4730 f082 d8 cld 4731 f083 4732 f083 4733 f083 20 5f f1 jsr uninterruptableroutines 4734 f086 4735 f086 - ifconst .userinterrupt 4736 f086 - jsr .userinterrupt 4737 f086 endif 4738 f086 4739 f086 - ifconst KEYPADSUPPORT 4740 f086 - jsr keypadcolumnread 4741 f086 endif 4742 f086 4743 f086 68 pla 4744 f087 a8 tay 4745 f088 68 pla 4746 f089 aa tax 4747 f08a 68 pla 4748 f08b 40 RTI 4749 f08c 4750 f08c clearscreen 4751 f08c a2 17 ldx #(WZONECOUNT-1) 4752 f08e a9 00 lda #0 4753 f090 clearscreenloop 4754 f090 95 65 sta dlend,x 4755 f092 ca dex 4756 f093 10 fb bpl clearscreenloop 4757 f095 a9 00 lda #0 4758 f097 8d ad 01 sta valbufend ; clear the bcd value buffer 4759 f09a 8d ae 01 sta valbufendsave 4760 f09d 60 rts 4761 f09e 4762 f09e restorescreen 4763 f09e a2 17 ldx #(WZONECOUNT-1) 4764 f0a0 a9 00 lda #0 4765 f0a2 restorescreenloop 4766 f0a2 b5 82 lda dlendsave,x 4767 f0a4 95 65 sta dlend,x 4768 f0a6 ca dex 4769 f0a7 10 f9 bpl restorescreenloop 4770 f0a9 ad ae 01 lda valbufendsave 4771 f0ac 8d ad 01 sta valbufend 4772 f0af 60 rts 4773 f0b0 4774 f0b0 savescreen 4775 f0b0 a2 17 ldx #(WZONECOUNT-1) 4776 f0b2 savescreenloop 4777 f0b2 b5 65 lda dlend,x 4778 f0b4 95 82 sta dlendsave,x 4779 f0b6 ca dex 4780 f0b7 10 f9 bpl savescreenloop 4781 f0b9 ad ad 01 lda valbufend 4782 f0bc 8d ae 01 sta valbufendsave 4783 f0bf - ifconst DOUBLEBUFFER 4784 f0bf - lda doublebufferstate 4785 f0bf - beq savescreenrts 4786 f0bf - lda #1 4787 f0bf - sta doublebufferbufferdirty 4788 f0bf -savescreenrts 4789 f0bf endif ; DOUBLEBUFFER 4790 f0bf 60 rts 4791 f0c0 4792 f0c0 drawscreen 4793 f0c0 4794 f0c0 a9 00 lda #0 4795 f0c2 85 42 sta temp1 ; not B&W if we're here... 4796 f0c4 4797 f0c4 drawscreenwait 4798 f0c4 a5 4d lda visibleover 4799 f0c6 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 4800 f0c8 4801 f0c8 ;restore some registers in case the game changed them mid-screen... 4802 f0c8 ad 07 21 lda sCTRL 4803 f0cb 05 42 ora temp1 4804 f0cd 85 3c sta CTRL 4805 f0cf ad 0b 21 lda sCHARBASE 4806 f0d2 85 34 sta CHARBASE 4807 f0d4 4808 f0d4 ;ensure all of the display list is terminated... 4809 f0d4 20 45 f1 jsr terminatedisplaylist 4810 f0d7 4811 f0d7 ifnconst pauseroutineoff 4812 f0d7 20 e2 f0 jsr pauseroutine 4813 f0da endif ; pauseroutineoff 4814 f0da 4815 f0da ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 4816 f0da ; delaying a full frame, but still allowing time for basic calculations. 4817 f0da visiblescreenstartedwait 4818 f0da a5 4d lda visibleover 4819 f0dc f0 fc beq visiblescreenstartedwait 4820 f0de visiblescreenstartedwaitdone 4821 f0de ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 4822 f0e1 60 rts 4823 f0e2 4824 f0e2 ifnconst pauseroutineoff 4825 f0e2 ; check to see if pause was pressed and released 4826 f0e2 pauseroutine 4827 f0e2 ad b3 01 lda pausedisable 4828 f0e5 d0 4e bne leavepauseroutine 4829 f0e7 a9 08 lda #8 4830 f0e9 2c 82 02 bit SWCHB 4831 f0ec f0 29 beq pausepressed 4832 f0ee 4833 f0ee ifnconst SOFTRESETASPAUSEOFF 4834 f0ee ifnconst MOUSESUPPORT 4835 f0ee ifnconst TRAKBALLSUPPORT 4836 f0ee ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 4837 f0f1 29 70 and #%01110000 ; _LDU 4838 f0f3 f0 22 beq pausepressed 4839 f0f5 endif 4840 f0f5 endif 4841 f0f5 endif 4842 f0f5 4843 f0f5 ;pause isn't pressed 4844 f0f5 a9 00 lda #0 4845 f0f7 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 4846 f0fa 4847 f0fa ;check if we're in an already paused state 4848 f0fa ad 00 21 lda pausestate 4849 f0fd f0 36 beq leavepauseroutine ; nope, leave 4850 f0ff 4851 f0ff c9 01 cmp #1 ; last frame was the start of pausing 4852 f101 f0 2b beq enterpausestate2 ; move from state 1 to 2 4853 f103 4854 f103 c9 02 cmp #2 4855 f105 f0 34 beq carryonpausing 4856 f107 4857 f107 ;pausestate must be >2, which means we're ending an unpause 4858 f107 a9 00 lda #0 4859 f109 8d ac 01 sta pausebuttonflag 4860 f10c 8d 00 21 sta pausestate 4861 f10f ad 07 21 lda sCTRL 4862 f112 85 3c sta CTRL 4863 f114 4c 35 f1 jmp leavepauseroutine 4864 f117 4865 f117 pausepressed 4866 f117 ;pause is pressed 4867 f117 ad ac 01 lda pausebuttonflag 4868 f11a c9 ff cmp #$ff 4869 f11c f0 1d beq carryonpausing 4870 f11e 4871 f11e ;its a new press, increment the state 4872 f11e ee 00 21 inc pausestate 4873 f121 4874 f121 ;silence volume at the start and end of pausing 4875 f121 a9 00 lda #0 4876 f123 85 19 sta AUDV0 4877 f125 85 1a sta AUDV1 4878 f127 4879 f127 - ifconst pokeysupport 4880 f127 - ldy #7 4881 f127 -pausesilencepokeyaudioloop 4882 f127 - sta (pokeybase),y 4883 f127 - dey 4884 f127 - bpl pausesilencepokeyaudioloop 4885 f127 endif ; pokeysupport 4886 f127 4887 f127 a9 ff lda #$ff 4888 f129 8d ac 01 sta pausebuttonflag 4889 f12c d0 0d bne carryonpausing 4890 f12e 4891 f12e enterpausestate2 4892 f12e a9 02 lda #2 4893 f130 8d 00 21 sta pausestate 4894 f133 d0 06 bne carryonpausing 4895 f135 leavepauseroutine 4896 f135 ad 07 21 lda sCTRL 4897 f138 85 3c sta CTRL 4898 f13a 60 rts 4899 f13b carryonpausing 4900 f13b - ifconst .pause 4901 f13b - jsr .pause 4902 f13b endif ; .pause 4903 f13b ad 07 21 lda sCTRL 4904 f13e 09 80 ora #%10000000 ; turn off colorburst during pause... 4905 f140 85 3c sta CTRL 4906 f142 4c e2 f0 jmp pauseroutine 4907 f145 endif ; pauseroutineoff 4908 f145 4909 f145 4910 f145 - ifconst DOUBLEBUFFER 4911 f145 -skipterminatedisplaylistreturn 4912 f145 - rts 4913 f145 endif ; DOUBLEBUFFER 4914 f145 terminatedisplaylist 4915 f145 - ifconst DOUBLEBUFFER 4916 f145 - lda doublebufferstate 4917 f145 - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 4918 f145 endif ; DOUBLEBUFFER 4919 f145 terminatedisplaybuffer 4920 f145 ;add DL end entry on each DL 4921 f145 a2 17 ldx #(WZONECOUNT-1) 4922 f147 dlendloop 4923 f147 bd 48 f6 lda DLPOINTL,x 4924 f14a - ifconst DOUBLEBUFFER 4925 f14a - clc 4926 f14a - adc doublebufferdloffset 4927 f14a endif ; DOUBLEBUFFER 4928 f14a 85 63 sta dlpnt 4929 f14c bd 30 f6 lda DLPOINTH,x 4930 f14f - ifconst DOUBLEBUFFER 4931 f14f - adc #0 4932 f14f endif ; DOUBLEBUFFER 4933 f14f 85 64 sta dlpnt+1 4934 f151 b4 65 ldy dlend,x 4935 f153 a9 00 lda #$00 4936 f155 dlendmoreloops 4937 f155 c8 iny 4938 f156 91 63 sta (dlpnt),y 4939 f158 - ifconst FRAMESKIPGLITCHFIXWEAK 4940 f158 - cpy #DLLASTOBJ+1 4941 f158 - beq dlendthiszonedone 4942 f158 - iny 4943 f158 - iny 4944 f158 - iny 4945 f158 - iny 4946 f158 - iny 4947 f158 - sta (dlpnt),y 4948 f158 -dlendthiszonedone 4949 f158 endif FRAMESKIPGLITCHFIXWEAK 4950 f158 - ifconst FRAMESKIPGLITCHFIX 4951 f158 - iny 4952 f158 - iny 4953 f158 - iny 4954 f158 - iny 4955 f158 - cpy #DLLASTOBJ-1 4956 f158 - bcc dlendmoreloops 4957 f158 endif ; FRAMESKIPGLITCHFIX 4958 f158 ca dex 4959 f159 10 ec bpl dlendloop 4960 f15b 4961 f15b ifnconst pauseroutineoff 4962 f15b 20 e2 f0 jsr pauseroutine 4963 f15e endif ; pauseroutineoff 4964 f15e 60 rts 4965 f15f 4966 f15f uninterruptableroutines 4967 f15f ; this is for routines that must happen off the visible screen, each frame. 4968 f15f 4969 f15f - ifconst AVOXVOICE 4970 f15f - jsr serviceatarivoxqueue 4971 f15f endif 4972 f15f 4973 f15f a9 00 lda #0 4974 f161 8d b6 01 sta palfastframe 4975 f164 ad 09 21 lda paldetected 4976 f167 f0 10 beq skippalframeadjusting 4977 f169 ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 4978 f169 ae b5 01 ldx palframes 4979 f16c e8 inx 4980 f16d e0 05 cpx #5 4981 f16f d0 05 bne palframeskipdone 4982 f171 ee b6 01 inc palfastframe 4983 f174 a2 00 ldx #0 4984 f176 palframeskipdone 4985 f176 8e b5 01 stx palframes 4986 f179 skippalframeadjusting 4987 f179 4988 f179 - ifconst MUSICTRACKER 4989 f179 - ; We normally run the servicesong routine from the top-screen interrupt, but if it 4990 f179 - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 4991 f179 - ; If that happens, we try again here. Chances are very small we'll run into the same 4992 f179 - ; problem twice, and if we do, we just drop a musical note or two. 4993 f179 - lda sfxschedulemissed 4994 f179 - beq servicesongwasnotmissed 4995 f179 - jsr servicesong 4996 f179 -servicesongwasnotmissed 4997 f179 endif ; MUSICTRACKER 4998 f179 4999 f179 60 rts 5000 f17a 5001 f17a serviceatarivoxqueue 5002 f17a - ifconst AVOXVOICE 5003 f17a - lda voxlock 5004 f17a - bne skipvoxprocessing ; the vox is in the middle of speech address update 5005 f17a -skipvoxqueuesizedec 5006 f17a - jmp processavoxvoice 5007 f17a -skipvoxprocessing 5008 f17a - rts 5009 f17a - 5010 f17a -processavoxvoice 5011 f17a - lda avoxenable 5012 f17a - bne avoxfixport 5013 f17a - SPKOUT tempavox 5014 f17a - rts 5015 f17a -avoxfixport 5016 f17a - lda #0 ; restore the port to all bits as inputs... 5017 f17a - sta CTLSWA 5018 f17a - rts 5019 f17a -silenceavoxvoice 5020 f17a - SPEAK avoxsilentdata 5021 f17a - rts 5022 f17a -avoxsilentdata 5023 f17a - .byte 31,255 5024 f17a else 5025 f17a 60 rts 5026 f17b endif ; AVOXVOICE 5027 f17b 5028 f17b joybuttonhandler 5029 f17b 8a txa 5030 f17c 0a asl 5031 f17d a8 tay 5032 f17e b9 08 00 lda INPT0,y 5033 f181 4a lsr 5034 f182 9d 02 21 sta sINPT1,x 5035 f185 b9 09 00 lda INPT1,y 5036 f188 29 80 and #%10000000 5037 f18a 1d 02 21 ora sINPT1,x 5038 f18d 9d 02 21 sta sINPT1,x 5039 f190 5040 f190 b5 0c lda INPT4,x 5041 f192 30 19 bmi .skip1bjoyfirecheck 5042 f194 ;one button joystick is down 5043 f194 49 80 eor #%10000000 5044 f196 9d 02 21 sta sINPT1,x 5045 f199 5046 f199 ad b1 01 lda joybuttonmode 5047 f19c 3d b0 f1 and twobuttonmask,x 5048 f19f f0 0c beq .skip1bjoyfirecheck 5049 f1a1 ad b1 01 lda joybuttonmode 5050 f1a4 1d b0 f1 ora twobuttonmask,x 5051 f1a7 8d b1 01 sta joybuttonmode 5052 f1aa 8d 82 02 sta SWCHB 5053 f1ad .skip1bjoyfirecheck 5054 f1ad 4c 5c f0 jmp buttonreadloopreturn 5055 f1b0 5056 f1b0 twobuttonmask 5057 f1b0 04 10 .byte.b %00000100,%00010000 5058 f1b2 5059 f1b2 gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 5060 f1b2 - ifconst LIGHTGUNSUPPORT 5061 f1b2 - cpx #0 5062 f1b2 - bne secondportgunhandler 5063 f1b2 -firstportgunhandler 5064 f1b2 - lda SWCHA 5065 f1b2 - asl 5066 f1b2 - asl 5067 f1b2 - asl ; shift D4 to D7 5068 f1b2 - and #%10000000 5069 f1b2 - eor #%10000000 5070 f1b2 - sta sINPT1 5071 f1b2 - jmp buttonreadloopreturn 5072 f1b2 -secondportgunhandler 5073 f1b2 - lda SWCHA 5074 f1b2 - lsr ; shift D0 into carry 5075 f1b2 - lsr ; shift carry into D7 5076 f1b2 - and #%10000000 5077 f1b2 - eor #%10000000 5078 f1b2 - sta sINPT3 5079 f1b2 - jmp buttonreadloopreturn 5080 f1b2 endif ; LIGHTGUNSUPPORT 5081 f1b2 5082 f1b2 controlsusing2buttoncode 5083 f1b2 00 .byte.b 0 ; 00=no controller plugged in 5084 f1b3 01 .byte.b 1 ; 01=proline joystick 5085 f1b4 00 .byte.b 0 ; 02=lightgun 5086 f1b5 00 .byte.b 0 ; 03=paddle 5087 f1b6 01 .byte.b 1 ; 04=trakball 5088 f1b7 01 .byte.b 1 ; 05=vcs joystick 5089 f1b8 01 .byte.b 1 ; 06=driving control 5090 f1b9 00 .byte.b 0 ; 07=keypad control 5091 f1ba 00 .byte.b 0 ; 08=st mouse/cx80 5092 f1bb 00 .byte.b 0 ; 09=amiga mouse 5093 f1bc 01 .byte.b 1 ; 10=atarivox 5094 f1bd 5095 f1bd buttonhandlerhi 5096 f1bd 00 .byte.b 0 ; 00=no controller plugged in 5097 f1be f1 .byte.b >joybuttonhandler ; 01=proline joystick 5098 f1bf f1 .byte.b >gunbuttonhandler ; 02=lightgun 5099 f1c0 f5 .byte.b >paddlebuttonhandler ; 03=paddle 5100 f1c1 f1 .byte.b >joybuttonhandler ; 04=trakball 5101 f1c2 f1 .byte.b >joybuttonhandler ; 05=vcs joystick 5102 f1c3 f1 .byte.b >joybuttonhandler ; 06=driving control 5103 f1c4 00 .byte.b 0 ; 07=keypad 5104 f1c5 f5 .byte.b >mousebuttonhandler ; 08=st mouse 5105 f1c6 f5 .byte.b >mousebuttonhandler ; 09=amiga mouse 5106 f1c7 f1 .byte.b >joybuttonhandler ; 10=atarivox 5107 f1c8 buttonhandlerlo 5108 f1c8 00 .byte.b 0 ; 00=no controller plugged in 5109 f1c9 7b .byte.b $0F means the sound is looped while priority is active 5210 f226 5211 f226 05 d9 ora inttemp2 5212 f228 05 d8 ora inttemp1 ; check if F|C|V=0 5213 f22a f0 23 beq zerosfx ; if so, we're at the end of the sound. 5214 f22c 5215 f22c advancesfxpointer 5216 f22c ; advance the pointer to the next sound chunk 5217 f22c c8 iny 5218 f22d 84 da sty inttemp3 5219 f22f 18 clc 5220 f230 b5 4e lda sfx1pointlo,x 5221 f232 65 da adc inttemp3 5222 f234 95 4e sta sfx1pointlo,x 5223 f236 b5 50 lda sfx1pointhi,x 5224 f238 69 00 adc #0 5225 f23a 95 50 sta sfx1pointhi,x 5226 f23c 4c e7 f1 jmp servicesfxchannelsloop 5227 f23f 5228 f23f sfxsoundloop 5229 f23f 48 pha 5230 f240 b5 52 lda sfx1priority,x 5231 f242 d0 04 bne sfxsoundloop_carryon 5232 f244 68 pla ; fix the stack before we go 5233 f245 4c 2c f2 jmp advancesfxpointer 5234 f248 sfxsoundloop_carryon 5235 f248 68 pla 5236 f249 29 f0 and #$F0 5237 f24b 4a lsr 5238 f24c 4a lsr 5239 f24d 4a lsr 5240 f24e 4a lsr 5241 f24f 5242 f24f zerosfx 5243 f24f 95 4e sta sfx1pointlo,x 5244 f251 95 50 sta sfx1pointhi,x 5245 f253 95 52 sta sfx1priority,x 5246 f255 4c e7 f1 jmp servicesfxchannelsloop 5247 f258 5248 f258 5249 f258 schedulesfx 5250 f258 ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 5251 f258 a0 00 ldy #0 5252 f25a b1 e0 lda (sfxinstrumentlo),y 5253 f25c - ifconst pokeysupport 5254 f25c - cmp #$20 ; POKEY? 5255 f25c - bne scheduletiasfx 5256 f25c - jmp schedulepokeysfx 5257 f25c endif 5258 f25c scheduletiasfx 5259 f25c ;cmp #$10 ; TIA? 5260 f25c ;beq continuescheduletiasfx 5261 f25c ; rts ; unhandled!!! 5262 f25c continuescheduletiasfx 5263 f25c ifnconst TIASFXMONO 5264 f25c a5 4e lda sfx1pointlo 5265 f25e 05 50 ora sfx1pointhi 5266 f260 f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 5267 f262 a5 4f lda sfx2pointlo 5268 f264 05 51 ora sfx2pointhi 5269 f266 f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 5270 f268 ; Both channels are scheduled. 5271 f268 a0 01 ldy #1 5272 f26a b1 e0 lda (sfxinstrumentlo),y 5273 f26c d0 01 bne interruptsfx 5274 f26e 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 5275 f26f interruptsfx 5276 f26f ;Compare which active sound has a lower priority. We'll interrupt the lower one. 5277 f26f a5 52 lda sfx1priority 5278 f271 c5 53 cmp sfx2priority 5279 f273 b0 04 bcs schedulesfx2 5280 f275 endif ; !TIASFXMONO 5281 f275 5282 f275 schedulesfx1 5283 f275 a2 00 ldx #0 ; channel 1 5284 f277 ifnconst TIASFXMONO 5285 f277 f0 02 beq skipschedulesfx2 5286 f279 schedulesfx2 5287 f279 a2 01 ldx #1 ; channel 2 5288 f27b skipschedulesfx2 5289 f27b endif ; !TIASFXMONO 5290 f27b 5291 f27b - ifconst MUSICTRACKER 5292 f27b - lda sfxnoteindex 5293 f27b - bpl skipdrumkitoverride 5294 f27b - and #$7F ; subtract 128 5295 f27b - sec 5296 f27b - sbc #4 ; drums start at 132, i.e. octave 10 5297 f27b - asl 5298 f27b - tay 5299 f27b - lda tiadrumkitdefinition,y 5300 f27b - sta sfxinstrumentlo 5301 f27b - iny 5302 f27b - lda tiadrumkitdefinition,y 5303 f27b - sta sfxinstrumenthi 5304 f27b - lda #0 5305 f27b - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 5306 f27b -skipdrumkitoverride 5307 f27b endif ; MUSICTRACKER 5308 f27b a0 01 ldy #1 ; get priority and sound-resolution (in frames) 5309 f27d b1 e0 lda (sfxinstrumentlo),y 5310 f27f 95 52 sta sfx1priority,x 5311 f281 c8 iny 5312 f282 b1 e0 lda (sfxinstrumentlo),y 5313 f284 95 56 sta sfx1frames,x 5314 f286 a5 e0 lda sfxinstrumentlo 5315 f288 18 clc 5316 f289 69 03 adc #3 5317 f28b 95 4e sta sfx1pointlo,x 5318 f28d a5 e1 lda sfxinstrumenthi 5319 f28f 69 00 adc #0 5320 f291 95 50 sta sfx1pointhi,x 5321 f293 a5 e2 lda sfxpitchoffset 5322 f295 95 54 sta sfx1poffset,x 5323 f297 a9 00 lda #0 5324 f299 95 58 sta sfx1tick,x 5325 f29b a5 e3 lda sfxnoteindex 5326 f29d 95 cd sta sfx1notedata,x 5327 f29f 60 rts 5328 f2a0 5329 f2a0 plotsprite 5330 f2a0 ifnconst NODRAWWAIT 5331 f2a0 - ifconst DOUBLEBUFFER 5332 f2a0 - lda doublebufferstate 5333 f2a0 - bne skipplotspritewait 5334 f2a0 endif ; DOUBLEBUFFER 5335 f2a0 - ifconst DEBUGWAITCOLOR 5336 f2a0 - lda #$41 5337 f2a0 - sta BACKGRND 5338 f2a0 endif 5339 f2a0 plotspritewait 5340 f2a0 a5 4d lda visibleover 5341 f2a2 d0 fc bne plotspritewait 5342 f2a4 skipplotspritewait 5343 f2a4 - ifconst DEBUGWAITCOLOR 5344 f2a4 - lda #$0 5345 f2a4 - sta BACKGRND 5346 f2a4 endif 5347 f2a4 endif 5348 f2a4 5349 f2a4 ;arguments: 5350 f2a4 ; temp1=lo graphicdata 5351 f2a4 ; temp2=hi graphicdata 5352 f2a4 ; temp3=palette | width byte 5353 f2a4 ; temp4=x 5354 f2a4 ; temp5=y 5355 f2a4 ; temp6=mode 5356 f2a4 a5 46 lda temp5 ;Y position 5357 f2a6 4a lsr ; 2 - Divide by 8 or 16 5358 f2a7 4a lsr ; 2 5359 f2a8 4a lsr ; 2 5360 f2a9 - if WZONEHEIGHT = 16 5361 f2a9 - lsr ; 2 5362 f2a9 endif 5363 f2a9 5364 f2a9 aa tax 5365 f2aa 5366 f2aa ifnconst NOLIMITCHECKING 5367 f2aa 5368 f2aa ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 5369 f2aa 5370 f2aa c9 18 cmp #WZONECOUNT 5371 f2ac 5372 f2ac 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 5373 f2ae ; otherwise, check to see if the bottom half is in zone 0... 5374 f2ae 5375 f2ae - if WZONEHEIGHT = 16 5376 f2ae - cmp #15 5377 f2ae else 5378 f2ae c9 1f cmp #31 5379 f2b0 endif 5380 f2b0 5381 f2b0 d0 05 bne exitplotsprite1 5382 f2b2 a2 00 ldx #0 5383 f2b4 4c f1 f2 jmp continueplotsprite2 5384 f2b7 exitplotsprite1 5385 f2b7 60 rts 5386 f2b8 5387 f2b8 continueplotsprite1 5388 f2b8 endif 5389 f2b8 5390 f2b8 bd 48 f6 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 5391 f2bb - ifconst DOUBLEBUFFER 5392 f2bb - clc 5393 f2bb - adc doublebufferdloffset 5394 f2bb endif ; DOUBLEBUFFER 5395 f2bb 85 63 sta dlpnt 5396 f2bd bd 30 f6 lda DLPOINTH,x 5397 f2c0 - ifconst DOUBLEBUFFER 5398 f2c0 - adc #0 5399 f2c0 endif ; DOUBLEBUFFER 5400 f2c0 85 64 sta dlpnt+1 5401 f2c2 5402 f2c2 ;Create DL entry for upper part of sprite 5403 f2c2 5404 f2c2 b4 65 ldy dlend,x ;Get the index to the end of this DL 5405 f2c4 5406 f2c4 ifconst CHECKOVERWRITE 5407 f2c4 c0 4b cpy #DLLASTOBJ 5408 f2c6 f0 21 beq checkcontinueplotsprite2 5409 f2c8 continueplotsprite1a 5410 f2c8 endif 5411 f2c8 5412 f2c8 a5 42 lda temp1 ; graphic data, lo byte 5413 f2ca 91 63 sta (dlpnt),y ;Low byte of data address 5414 f2cc 5415 f2cc ifnconst ATOMICSPRITEUPDATE 5416 f2cc c8 iny 5417 f2cd a5 47 lda temp6 5418 f2cf 91 63 sta (dlpnt),y 5419 f2d1 - else 5420 f2d1 - iny 5421 f2d1 - sty temp8 5422 f2d1 endif 5423 f2d1 5424 f2d1 c8 iny 5425 f2d2 5426 f2d2 a5 46 lda temp5 ;Y position 5427 f2d4 29 07 and #(WZONEHEIGHT - 1) 5428 f2d6 c9 01 cmp #1 ; clear carry if our sprite is just in this zone 5429 f2d8 05 43 ora temp2 ; graphic data, hi byte 5430 f2da 91 63 sta (dlpnt),y 5431 f2dc 5432 f2dc 5433 f2dc c8 iny 5434 f2dd a5 44 lda temp3 ;palette|width 5435 f2df 91 63 sta (dlpnt),y 5436 f2e1 5437 f2e1 c8 iny 5438 f2e2 a5 45 lda temp4 ;Horizontal position 5439 f2e4 91 63 sta (dlpnt),y 5440 f2e6 5441 f2e6 c8 iny 5442 f2e7 94 65 sty dlend,x 5443 f2e9 5444 f2e9 - ifconst ALWAYSTERMINATE 5445 f2e9 - iny 5446 f2e9 - lda #0 5447 f2e9 - sta (dlpnt),y 5448 f2e9 endif 5449 f2e9 5450 f2e9 - ifconst ATOMICSPRITEUPDATE 5451 f2e9 - ldy temp8 5452 f2e9 - lda temp6 5453 f2e9 - sta (dlpnt),y 5454 f2e9 endif 5455 f2e9 5456 f2e9 checkcontinueplotsprite2 5457 f2e9 5458 f2e9 90 38 bcc doneSPDL ;branch if the sprite was fully in the last zone 5459 f2eb 5460 f2eb ;Create DL entry for lower part of sprite 5461 f2eb 5462 f2eb e8 inx ;Next region 5463 f2ec 5464 f2ec ifnconst NOLIMITCHECKING 5465 f2ec e0 18 cpx #WZONECOUNT 5466 f2ee 5467 f2ee 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 5468 f2f0 60 rts 5469 f2f1 continueplotsprite2 5470 f2f1 endif 5471 f2f1 5472 f2f1 bd 48 f6 lda DLPOINTL,x ;Get pointer to next DL 5473 f2f4 - ifconst DOUBLEBUFFER 5474 f2f4 - clc 5475 f2f4 - adc doublebufferdloffset 5476 f2f4 endif ; DOUBLEBUFFER 5477 f2f4 85 63 sta dlpnt 5478 f2f6 bd 30 f6 lda DLPOINTH,x 5479 f2f9 - ifconst DOUBLEBUFFER 5480 f2f9 - adc #0 5481 f2f9 endif ; DOUBLEBUFFER 5482 f2f9 85 64 sta dlpnt+1 5483 f2fb b4 65 ldy dlend,x ;Get the index to the end of this DL 5484 f2fd 5485 f2fd ifconst CHECKOVERWRITE 5486 f2fd c0 4b cpy #DLLASTOBJ 5487 f2ff d0 01 bne continueplotsprite2a 5488 f301 60 rts 5489 f302 continueplotsprite2a 5490 f302 endif 5491 f302 5492 f302 a5 42 lda temp1 ; graphic data, lo byte 5493 f304 91 63 sta (dlpnt),y 5494 f306 5495 f306 ifnconst ATOMICSPRITEUPDATE 5496 f306 c8 iny 5497 f307 a5 47 lda temp6 5498 f309 91 63 sta (dlpnt),y 5499 f30b - else 5500 f30b - iny 5501 f30b - sty temp8 5502 f30b endif 5503 f30b 5504 f30b c8 iny 5505 f30c 5506 f30c a5 46 lda temp5 ;Y position 5507 f30e 0b 07 anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 5508 f310 05 43 ora temp2 ; graphic data, hi byte 5509 f312 e9 07 sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 5510 f314 91 63 sta (dlpnt),y 5511 f316 5512 f316 c8 iny 5513 f317 5514 f317 a5 44 lda temp3 ;palette|width 5515 f319 91 63 sta (dlpnt),y 5516 f31b 5517 f31b c8 iny 5518 f31c 5519 f31c a5 45 lda temp4 ;Horizontal position 5520 f31e 91 63 sta (dlpnt),y 5521 f320 5522 f320 c8 iny 5523 f321 94 65 sty dlend,x 5524 f323 5525 f323 - ifconst ALWAYSTERMINATE 5526 f323 - iny 5527 f323 - lda #0 5528 f323 - sta (dlpnt),y 5529 f323 endif 5530 f323 5531 f323 - ifconst ATOMICSPRITEUPDATE 5532 f323 - ldy temp8 5533 f323 - lda temp6 5534 f323 - sta (dlpnt),y 5535 f323 endif 5536 f323 5537 f323 doneSPDL 5538 f323 60 rts 5539 f324 5540 f324 5541 f324 lockzonex 5542 f324 - ifconst ZONELOCKS 5543 f324 - ldy dlend,x 5544 f324 - cpy #DLLASTOBJ 5545 f324 - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 5546 f324 - lda DLPOINTL,x 5547 f324 - ifconst DOUBLEBUFFER 5548 f324 - clc 5549 f324 - adc doublebufferdloffset 5550 f324 - endif ; DOUBLEBUFFER 5551 f324 - sta dlpnt 5552 f324 - lda DLPOINTH,x 5553 f324 - ifconst DOUBLEBUFFER 5554 f324 - adc #0 5555 f324 - endif ; DOUBLEBUFFER 5556 f324 - sta dlpnt+1 5557 f324 - iny 5558 f324 - lda #0 5559 f324 - sta (dlpnt),y 5560 f324 - dey 5561 f324 - tya 5562 f324 - ldy #(DLLASTOBJ-1) 5563 f324 - sta (dlpnt),y 5564 f324 - iny 5565 f324 - sty dlend,x 5566 f324 -lockzonexreturn 5567 f324 - rts 5568 f324 endif ; ZONELOCKS 5569 f324 unlockzonex 5570 f324 - ifconst ZONELOCKS 5571 f324 - ldy dlend,x 5572 f324 - cpy #DLLASTOBJ 5573 f324 - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 5574 f324 - lda DLPOINTL,x 5575 f324 - ifconst DOUBLEBUFFER 5576 f324 - clc 5577 f324 - adc doublebufferdloffset 5578 f324 - endif ; DOUBLEBUFFER 5579 f324 - sta dlpnt 5580 f324 - lda DLPOINTH,x 5581 f324 - ifconst DOUBLEBUFFER 5582 f324 - adc #0 5583 f324 - endif ; DOUBLEBUFFER 5584 f324 - sta dlpnt+1 5585 f324 - dey 5586 f324 - ;ldy #(DLLASTOBJ-1) 5587 f324 - lda (dlpnt),y 5588 f324 - tay 5589 f324 - sty dlend,x 5590 f324 -unlockzonexreturn 5591 f324 endif ; ZONELOCKS 5592 f324 60 rts 5593 f325 5594 f325 plotcharloop 5595 f325 ; ** read from a data indirectly pointed to from temp8,temp9 5596 f325 ; ** format is: lo_data, hi_data, palette|width, x, y 5597 f325 ; ** format ends with lo_data | hi_data = 0 5598 f325 5599 f325 - ifconst DOUBLEBUFFER 5600 f325 - lda doublebufferstate 5601 f325 - bne skipplotcharloopwait 5602 f325 endif ; DOUBLEBUFFER 5603 f325 - ifconst DEBUGWAITCOLOR 5604 f325 - lda #$61 5605 f325 - sta BACKGRND 5606 f325 endif 5607 f325 plotcharloopwait 5608 f325 a5 4d lda visibleover 5609 f327 d0 fc bne plotcharloopwait 5610 f329 - ifconst DEBUGWAITCOLOR 5611 f329 - lda #0 5612 f329 - sta BACKGRND 5613 f329 endif 5614 f329 skipplotcharloopwait 5615 f329 plotcharlooploop 5616 f329 a0 00 ldy #0 5617 f32b b1 49 lda (temp8),y 5618 f32d 85 42 sta temp1 5619 f32f c8 iny 5620 f330 b1 49 lda (temp8),y 5621 f332 85 43 sta temp2 5622 f334 05 42 ora temp1 5623 f336 d0 01 bne plotcharloopcontinue 5624 f338 ;the pointer=0, so return 5625 f338 60 rts 5626 f339 plotcharloopcontinue 5627 f339 c8 iny 5628 f33a b1 49 lda (temp8),y 5629 f33c 85 44 sta temp3 5630 f33e c8 iny 5631 f33f b1 49 lda (temp8),y 5632 f341 85 45 sta temp4 5633 f343 c8 iny 5634 f344 b1 49 lda (temp8),y 5635 f346 ;sta temp5 ; not needed with our late entry. 5636 f346 20 5f f3 jsr plotcharactersskipentry 5637 f349 a5 49 lda temp8 5638 f34b 18 clc 5639 f34c 69 05 adc #5 5640 f34e 85 49 sta temp8 5641 f350 a5 4a lda temp9 5642 f352 69 00 adc #0 5643 f354 85 4a sta temp9 5644 f356 4c 29 f3 jmp plotcharlooploop 5645 f359 5646 f359 plotcharacters 5647 f359 - ifconst DOUBLEBUFFER 5648 f359 - lda doublebufferstate 5649 f359 - bne skipplotcharacterswait 5650 f359 endif ; DOUBLEBUFFER 5651 f359 - ifconst DEBUGWAITCOLOR 5652 f359 - lda #$41 5653 f359 - sta BACKGRND 5654 f359 endif 5655 f359 plotcharacterswait 5656 f359 a5 4d lda visibleover 5657 f35b d0 fc bne plotcharacterswait 5658 f35d - ifconst DEBUGWAITCOLOR 5659 f35d - sta BACKGRND 5660 f35d endif 5661 f35d skipplotcharacterswait 5662 f35d ;arguments: 5663 f35d ; temp1=lo charactermap 5664 f35d ; temp2=hi charactermap 5665 f35d ; temp3=palette | width byte 5666 f35d ; temp4=x 5667 f35d ; temp5=y 5668 f35d 5669 f35d a5 46 lda temp5 ;Y position 5670 f35f 5671 f35f plotcharactersskipentry 5672 f35f 5673 f35f ;ifconst ZONEHEIGHT 5674 f35f ; if ZONEHEIGHT = 16 5675 f35f ; and #$0F 5676 f35f ; endif 5677 f35f ; if ZONEHEIGHT = 8 5678 f35f ; and #$1F 5679 f35f ; endif 5680 f35f ;else 5681 f35f ; and #$0F 5682 f35f ;endif 5683 f35f 5684 f35f aa tax 5685 f360 bd 48 f6 lda DLPOINTL,x ;Get pointer to DL that the characters are in 5686 f363 - ifconst DOUBLEBUFFER 5687 f363 - clc 5688 f363 - adc doublebufferdloffset 5689 f363 endif ; DOUBLEBUFFER 5690 f363 85 63 sta dlpnt 5691 f365 bd 30 f6 lda DLPOINTH,x 5692 f368 - ifconst DOUBLEBUFFER 5693 f368 - adc #0 5694 f368 endif ; DOUBLEBUFFER 5695 f368 85 64 sta dlpnt+1 5696 f36a 5697 f36a ;Create DL entry for the characters 5698 f36a 5699 f36a b4 65 ldy dlend,x ;Get the index to the end of this DL 5700 f36c 5701 f36c ifconst CHECKOVERWRITE 5702 f36c c0 4b cpy #DLLASTOBJ 5703 f36e d0 01 bne continueplotcharacters 5704 f370 60 rts 5705 f371 continueplotcharacters 5706 f371 endif 5707 f371 5708 f371 a5 42 lda temp1 ; character map data, lo byte 5709 f373 91 63 sta (dlpnt),y ;(1) store low address 5710 f375 5711 f375 c8 iny 5712 f376 ad 06 21 lda charactermode 5713 f379 91 63 sta (dlpnt),y ;(2) store mode 5714 f37b 5715 f37b c8 iny 5716 f37c a5 43 lda temp2 ; character map, hi byte 5717 f37e 91 63 sta (dlpnt),y ;(3) store high address 5718 f380 5719 f380 c8 iny 5720 f381 a5 44 lda temp3 ;palette|width 5721 f383 91 63 sta (dlpnt),y ;(4) store palette|width 5722 f385 5723 f385 c8 iny 5724 f386 a5 45 lda temp4 ;Horizontal position 5725 f388 91 63 sta (dlpnt),y ;(5) store horizontal position 5726 f38a 5727 f38a c8 iny 5728 f38b 94 65 sty dlend,x ; save display list end byte 5729 f38d 60 rts 5730 f38e 5731 f38e 5732 f38e - ifconst plotvalueonscreen 5733 f38e -plotcharacterslive 5734 f38e - ; a version of plotcharacters that draws live and minimally disrupts the screen... 5735 f38e - 5736 f38e - ;arguments: 5737 f38e - ; temp1=lo charactermap 5738 f38e - ; temp2=hi charactermap 5739 f38e - ; temp3=palette | width byte 5740 f38e - ; temp4=x 5741 f38e - ; temp5=y 5742 f38e - 5743 f38e - lda temp5 ;Y position 5744 f38e - 5745 f38e - tax 5746 f38e - lda DLPOINTL,x ;Get pointer to DL that the characters are in 5747 f38e - ifconst DOUBLEBUFFER 5748 f38e - clc 5749 f38e - adc doublebufferdloffset 5750 f38e - endif ; DOUBLEBUFFER 5751 f38e - sta dlpnt 5752 f38e - lda DLPOINTH,x 5753 f38e - ifconst DOUBLEBUFFER 5754 f38e - adc #0 5755 f38e - endif ; DOUBLEBUFFER 5756 f38e - sta dlpnt+1 5757 f38e - 5758 f38e - ;Create DL entry for the characters 5759 f38e - 5760 f38e - ldy dlend,x ;Get the index to the end of this DL 5761 f38e - 5762 f38e - ifconst CHECKOVERWRITE 5763 f38e - cpy #DLLASTOBJ 5764 f38e - bne continueplotcharacterslive 5765 f38e - rts 5766 f38e -continueplotcharacterslive 5767 f38e - endif 5768 f38e - 5769 f38e - lda temp1 ; character map data, lo byte 5770 f38e - sta (dlpnt),y ;(1) store low address 5771 f38e - 5772 f38e - iny 5773 f38e - ; we don't add the second byte yet, since the charmap could briefly 5774 f38e - ; render without a proper character map address, width, or position. 5775 f38e - lda charactermode 5776 f38e - sta (dlpnt),y ;(2) store mode 5777 f38e - 5778 f38e - iny 5779 f38e - lda temp2 ; character map, hi byte 5780 f38e - sta (dlpnt),y ;(3) store high address 5781 f38e - 5782 f38e - iny 5783 f38e - lda temp3 ;palette|width 5784 f38e - sta (dlpnt),y ;(4) store palette|width 5785 f38e - 5786 f38e - iny 5787 f38e - lda temp4 ;Horizontal position 5788 f38e - sta (dlpnt),y ;(5) store horizontal position 5789 f38e - 5790 f38e - iny 5791 f38e - sty dlend,x ; save display list end byte 5792 f38e - 5793 f38e - rts 5794 f38e endif ;plotcharacterslive 5795 f38e 5796 f38e ifconst USED_PLOTVALUE 5797 f38e plotvalue 5798 f38e ; calling 7800basic command: 5799 f38e ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 5800 f38e ; ...displays the variable as BCD digits 5801 f38e ; 5802 f38e ; asm sub arguments: 5803 f38e ; temp1=lo charactermap 5804 f38e ; temp2=hi charactermap 5805 f38e ; temp3=palette | width byte 5806 f38e ; temp4=x 5807 f38e ; temp5=y 5808 f38e ; temp6=number of digits 5809 f38e ; temp7=lo variable 5810 f38e ; temp8=hi variable 5811 f38e ; temp9=character mode 5812 f38e 5813 f38e 00 47 plotdigitcount = temp6 5814 f38e 5815 f38e - ifconst ZONELOCKS 5816 f38e - ldx temp5 5817 f38e - ldy dlend,x 5818 f38e - cpy #DLLASTOBJ 5819 f38e - bne carryonplotvalue 5820 f38e - rts 5821 f38e -carryonplotvalue 5822 f38e endif 5823 f38e 5824 f38e a9 00 lda #0 5825 f390 a8 tay 5826 f391 ae ad 01 ldx valbufend 5827 f394 5828 f394 a5 47 lda plotdigitcount 5829 f396 29 01 and #1 5830 f398 f0 07 beq pvnibble2char 5831 f39a a9 00 lda #0 5832 f39c 9d 00 20 sta VALBUFFER,x ; just in case we skip this digit 5833 f39f f0 10 beq pvnibble2char_skipnibble 5834 f3a1 5835 f3a1 pvnibble2char 5836 f3a1 ; high nibble... 5837 f3a1 b1 48 lda (temp7),y 5838 f3a3 29 f0 and #$f0 5839 f3a5 4a lsr 5840 f3a6 4a lsr 5841 f3a7 4a lsr 5842 f3a8 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 5843 f3a8 - lsr 5844 f3a8 endif 5845 f3a8 5846 f3a8 18 clc 5847 f3a9 65 42 adc temp1 ; add the offset to character graphics to our value 5848 f3ab 9d 00 20 sta VALBUFFER,x 5849 f3ae e8 inx 5850 f3af c6 47 dec plotdigitcount 5851 f3b1 5852 f3b1 pvnibble2char_skipnibble 5853 f3b1 ; low nibble... 5854 f3b1 b1 48 lda (temp7),y 5855 f3b3 29 0f and #$0f 5856 f3b5 ifconst DOUBLEWIDE ; multiply value by 2 for double-width 5857 f3b5 0a asl 5858 f3b6 endif 5859 f3b6 18 clc 5860 f3b7 65 42 adc temp1 ; add the offset to character graphics to our value 5861 f3b9 9d 00 20 sta VALBUFFER,x 5862 f3bc e8 inx 5863 f3bd c8 iny 5864 f3be 5865 f3be c6 47 dec plotdigitcount 5866 f3c0 d0 df bne pvnibble2char 5867 f3c2 5868 f3c2 ;point to the start of our valuebuffer 5869 f3c2 18 clc 5870 f3c3 a9 00 lda #VALBUFFER 5874 f3cc 69 00 adc #0 5875 f3ce 85 43 sta temp2 5876 f3d0 5877 f3d0 ;advance valbufend to the end of our value buffer 5878 f3d0 8e ad 01 stx valbufend 5879 f3d3 5880 f3d3 ifnconst plotvalueonscreen 5881 f3d3 4c 59 f3 jmp plotcharacters 5882 f3d6 - else 5883 f3d6 - jmp plotcharacterslive 5884 f3d6 endif 5885 f3d6 5886 f3d6 endif ; USED_PLOTVALUE 5887 f3d6 5888 f3d6 5889 f3d6 - ifconst USED_PLOTVALUEEXTRA 5890 f3d6 -plotdigitcount = temp6 5891 f3d6 -plotvalueextra 5892 f3d6 - ; calling 7800basic command: 5893 f3d6 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 5894 f3d6 - ; ...displays the variable as BCD digits 5895 f3d6 - ; 5896 f3d6 - ; asm sub arguments: 5897 f3d6 - ; temp1=lo charactermap 5898 f3d6 - ; temp2=hi charactermap 5899 f3d6 - ; temp3=palette | width byte 5900 f3d6 - ; temp4=x 5901 f3d6 - ; temp5=y 5902 f3d6 - ; temp6=number of digits 5903 f3d6 - ; temp7=lo variable 5904 f3d6 - ; temp8=hi variable 5905 f3d6 - 5906 f3d6 - lda #0 5907 f3d6 - tay 5908 f3d6 - ldx valbufend 5909 f3d6 - ifnconst plotvalueonscreen 5910 f3d6 - sta VALBUFFER,x 5911 f3d6 - endif 5912 f3d6 - 5913 f3d6 - lda plotdigitcount 5914 f3d6 - and #1 5915 f3d6 - 5916 f3d6 - bne pvnibble2char_skipnibbleextra 5917 f3d6 - 5918 f3d6 -pvnibble2charextra 5919 f3d6 - ; high nibble... 5920 f3d6 - lda (temp7),y 5921 f3d6 - and #$f0 5922 f3d6 - lsr 5923 f3d6 - lsr 5924 f3d6 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 5925 f3d6 - lsr 5926 f3d6 - endif 5927 f3d6 - clc 5928 f3d6 - adc temp1 ; add the offset to character graphics to our value 5929 f3d6 - sta VALBUFFER,x 5930 f3d6 - inx 5931 f3d6 - 5932 f3d6 - ; second half of the digit 5933 f3d6 - clc 5934 f3d6 - adc #1 5935 f3d6 - sta VALBUFFER,x 5936 f3d6 - inx 5937 f3d6 - 5938 f3d6 -pvnibble2char_skipnibbleextra 5939 f3d6 - ; low nibble... 5940 f3d6 - lda (temp7),y 5941 f3d6 - and #$0f 5942 f3d6 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 5943 f3d6 - asl 5944 f3d6 - endif 5945 f3d6 - asl 5946 f3d6 - 5947 f3d6 - clc 5948 f3d6 - adc temp1 ; add the offset to character graphics to our value 5949 f3d6 - sta VALBUFFER,x 5950 f3d6 - inx 5951 f3d6 - 5952 f3d6 - clc 5953 f3d6 - adc #1 5954 f3d6 - sta VALBUFFER,x 5955 f3d6 - inx 5956 f3d6 - iny 5957 f3d6 - 5958 f3d6 - dec plotdigitcount 5959 f3d6 - bne pvnibble2charextra 5960 f3d6 - 5961 f3d6 - ;point to the start of our valuebuffer 5962 f3d6 - clc 5963 f3d6 - lda #VALBUFFER 5967 f3d6 - adc #0 5968 f3d6 - sta temp2 5969 f3d6 - 5970 f3d6 - ;advance valbufend to the end of our value buffer 5971 f3d6 - stx valbufend 5972 f3d6 - 5973 f3d6 - ifnconst plotvalueonscreen 5974 f3d6 - jmp plotcharacters 5975 f3d6 - else 5976 f3d6 - jmp plotcharacterslive 5977 f3d6 - endif 5978 f3d6 endif ; USED_PLOTVALUEEXTRA 5979 f3d6 5980 f3d6 boxcollision 5981 f3d6 ; the worst case cycle-time for the code below is 43 cycles. 5982 f3d6 ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 5983 f3d6 5984 f3d6 ;__boxx1 = accumulator 5985 f3d6 ;__boxy1 = y 5986 f3d6 00 44 __boxw1 = temp3 5987 f3d6 00 45 __boxh1 = temp4 5988 f3d6 5989 f3d6 00 46 __boxx2 = temp5 5990 f3d6 00 47 __boxy2 = temp6 5991 f3d6 00 48 __boxw2 = temp7 5992 f3d6 00 49 __boxh2 = temp8 5993 f3d6 5994 f3d6 DoXCollisionCheck 5995 f3d6 ;lda __boxx1 ; skipped. already in the accumulator 5996 f3d6 c5 46 cmp __boxx2 ;3 5997 f3d8 b0 07 bcs X1isbiggerthanX2 ;2/3 5998 f3da X2isbiggerthanX1 5999 f3da ; carry is clear 6000 f3da 65 44 adc __boxw1 ;3 6001 f3dc c5 46 cmp __boxx2 ;3 6002 f3de b0 08 bcs DoYCollisionCheck ;3/2 6003 f3e0 60 rts ;6 - carry clear, no collision 6004 f3e1 X1isbiggerthanX2 6005 f3e1 18 clc ;2 6006 f3e2 e5 48 sbc __boxw2 ;3 6007 f3e4 c5 46 cmp __boxx2 ;3 6008 f3e6 b0 13 bcs noboxcollision ;3/2 6009 f3e8 DoYCollisionCheck 6010 f3e8 98 tya ; 2 ; use to be "lda __boxy1" 6011 f3e9 c5 47 cmp __boxy2 ;3 6012 f3eb b0 05 bcs Y1isbiggerthanY2 ;3/2 6013 f3ed Y2isbiggerthanY1 6014 f3ed ; carry is clear 6015 f3ed 65 45 adc __boxh1 ;3 6016 f3ef c5 47 cmp __boxy2 ;3 6017 f3f1 60 rts ;6 6018 f3f2 Y1isbiggerthanY2 6019 f3f2 18 clc ;2 6020 f3f3 e5 49 sbc __boxh2 ;3 6021 f3f5 c5 47 cmp __boxy2 ;3 6022 f3f7 b0 02 bcs noboxcollision ;3/2 6023 f3f9 yesboxcollision 6024 f3f9 38 sec ;2 6025 f3fa 60 rts ;6 6026 f3fb noboxcollision 6027 f3fb 18 clc ;2 6028 f3fc 60 rts ;6 6029 f3fd 6030 f3fd randomize 6031 f3fd a5 40 lda rand 6032 f3ff 4a lsr 6033 f400 26 41 rol rand16 6034 f402 90 02 bcc noeor 6035 f404 49 b4 eor #$B4 6036 f406 noeor 6037 f406 85 40 sta rand 6038 f408 45 41 eor rand16 6039 f40a 60 rts 6040 f40b 6041 f40b ; *** bcd conversion routine courtesy Omegamatrix 6042 f40b ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 6043 f40b converttobcd 6044 f40b ;value to convert is in the accumulator 6045 f40b 85 42 sta temp1 6046 f40d 4a lsr 6047 f40e 65 42 adc temp1 6048 f410 6a ror 6049 f411 4a lsr 6050 f412 4a lsr 6051 f413 65 42 adc temp1 6052 f415 6a ror 6053 f416 65 42 adc temp1 6054 f418 6a ror 6055 f419 4a lsr 6056 f41a 29 3c and #$3C 6057 f41c 85 43 sta temp2 6058 f41e 4a lsr 6059 f41f 65 43 adc temp2 6060 f421 65 42 adc temp1 6061 f423 60 rts ; return the result in the accumulator 6062 f424 6063 f424 ; Y and A contain multiplicands, result in A 6064 f424 mul8 6065 f424 84 42 sty temp1 6066 f426 85 43 sta temp2 6067 f428 a9 00 lda #0 6068 f42a reptmul8 6069 f42a 46 43 lsr temp2 6070 f42c 90 03 bcc skipmul8 6071 f42e 18 clc 6072 f42f 65 42 adc temp1 6073 f431 ;bcs donemul8 might save cycles? 6074 f431 skipmul8 6075 f431 ;beq donemul8 might save cycles? 6076 f431 06 42 asl temp1 6077 f433 d0 f5 bne reptmul8 6078 f435 donemul8 6079 f435 60 rts 6080 f436 6081 f436 div8 6082 f436 ; A=numerator Y=denominator, result in A 6083 f436 c0 02 cpy #2 6084 f438 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 6085 f43a 84 42 sty temp1 6086 f43c a0 ff ldy #$ff 6087 f43e div8loop 6088 f43e e5 42 sbc temp1 6089 f440 c8 iny 6090 f441 b0 fb bcs div8loop 6091 f443 div8end 6092 f443 98 tya 6093 f444 ; result in A 6094 f444 60 rts 6095 f445 6096 f445 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 6097 f445 mul16 6098 f445 84 42 sty temp1 6099 f447 85 43 sta temp2 6100 f449 6101 f449 a9 00 lda #0 6102 f44b a2 08 ldx #8 6103 f44d 46 42 lsr temp1 6104 f44f mul16_1 6105 f44f 90 03 bcc mul16_2 6106 f451 18 clc 6107 f452 65 43 adc temp2 6108 f454 mul16_2 6109 f454 6a ror 6110 f455 66 42 ror temp1 6111 f457 ca dex 6112 f458 d0 f5 bne mul16_1 6113 f45a 85 43 sta temp2 6114 f45c 60 rts 6115 f45d 6116 f45d ; div int/int 6117 f45d ; numerator in A, denom in temp1 6118 f45d ; returns with quotient in A, remainder in temp1 6119 f45d div16 6120 f45d 85 43 sta temp2 6121 f45f 84 42 sty temp1 6122 f461 a9 00 lda #0 6123 f463 a2 08 ldx #8 6124 f465 06 43 asl temp2 6125 f467 div16_1 6126 f467 2a rol 6127 f468 c5 42 cmp temp1 6128 f46a 90 02 bcc div16_2 6129 f46c e5 42 sbc temp1 6130 f46e div16_2 6131 f46e 26 43 rol temp2 6132 f470 ca dex 6133 f471 d0 f4 bne div16_1 6134 f473 85 42 sta temp1 6135 f475 a5 43 lda temp2 6136 f477 60 rts 6137 f478 6138 f478 - ifconst bankswitchmode 6139 f478 -BS_jsr 6140 f478 - ifconst MCPDEVCART 6141 f478 - ora #$18 6142 f478 - sta $3000 6143 f478 - else 6144 f478 - sta $8000 6145 f478 - endif 6146 f478 - pla 6147 f478 - tax 6148 f478 - pla 6149 f478 - rts 6150 f478 - 6151 f478 -BS_return 6152 f478 - pla ; bankswitch bank 6153 f478 - ifconst BANKRAM 6154 f478 - sta currentbank 6155 f478 - ora currentrambank 6156 f478 - endif 6157 f478 - ifconst MCPDEVCART 6158 f478 - ora #$18 6159 f478 - sta $3000 6160 f478 - else 6161 f478 - sta $8000 6162 f478 - endif 6163 f478 - pla ; bankswitch $0 flag 6164 f478 - rts 6165 f478 endif 6166 f478 6167 f478 checkselectswitch 6168 f478 ad 82 02 lda SWCHB ; first check the real select switch... 6169 f47b 29 02 and #%00000010 6170 f47d ifnconst MOUSESUPPORT 6171 f47d f0 05 beq checkselectswitchreturn ; switch is pressed 6172 f47f ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 6173 f482 29 b0 and #%10110000 ; R_DU 6174 f484 endif ; MOUSESUPPORT 6175 f484 checkselectswitchreturn 6176 f484 60 rts 6177 f485 6178 f485 checkresetswitch 6179 f485 ad 82 02 lda SWCHB ; first check the real reset switch... 6180 f488 29 01 and #%00000001 6181 f48a ifnconst MOUSESUPPORT 6182 f48a f0 05 beq checkresetswitchreturn ; switch is pressed 6183 f48c ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 6184 f48f 29 70 and #%01110000 ; _LDU 6185 f491 endif ; MOUSESUPPORT 6186 f491 checkresetswitchreturn 6187 f491 60 rts 6188 f492 6189 f492 - ifconst FINESCROLLENABLED 6190 f492 -finescrolldlls 6191 f492 - ldx temp1 ; first DLL index x3 6192 f492 - lda DLLMEM,x 6193 f492 - and #%11110000 6194 f492 - ora finescrolly 6195 f492 - sta DLLMEM,x 6196 f492 - 6197 f492 - ldx temp2 ; last DLL index x3 6198 f492 - lda DLLMEM,x 6199 f492 - and #%11110000 6200 f492 - ora finescrolly 6201 f492 - eor #(WZONEHEIGHT-1) 6202 f492 - sta DLLMEM,x 6203 f492 - rts 6204 f492 endif ; FINESCROLLENABLED 6205 f492 6206 f492 - ifconst USED_ADJUSTVISIBLE 6207 f492 -adjustvisible 6208 f492 - ; called with temp1=first visible zone *3, temp2=last visible zone *3 6209 f492 - jsr waitforvblankstart ; ensure vblank just started 6210 f492 - ldx visibleDLLstart 6211 f492 -findfirstinterrupt 6212 f492 - lda DLLMEM,x 6213 f492 - bmi foundfirstinterrupt 6214 f492 - inx 6215 f492 - inx 6216 f492 - inx 6217 f492 - bne findfirstinterrupt 6218 f492 -foundfirstinterrupt 6219 f492 - and #%01111111 ; clear the interrupt bit 6220 f492 - sta DLLMEM,x 6221 f492 - ifconst DOUBLEBUFFER 6222 f492 - sta DLLMEM+DBOFFSET,x 6223 f492 - endif ; DOUBLEBUFFER 6224 f492 - ldx overscanDLLstart 6225 f492 -findlastinterrupt 6226 f492 - lda DLLMEM,x 6227 f492 - bmi foundlastinterrupt 6228 f492 - dex 6229 f492 - dex 6230 f492 - dex 6231 f492 - bne findlastinterrupt 6232 f492 -foundlastinterrupt 6233 f492 - and #%01111111 ; clear the interrupt bit 6234 f492 - sta DLLMEM,x 6235 f492 - ifconst DOUBLEBUFFER 6236 f492 - sta DLLMEM+DBOFFSET,x 6237 f492 - endif ; DOUBLEBUFFER 6238 f492 - ;now we need to set the new interrupts 6239 f492 - clc 6240 f492 - lda temp1 6241 f492 - adc visibleDLLstart 6242 f492 - tax 6243 f492 - lda DLLMEM,x 6244 f492 - ora #%10000000 6245 f492 - sta DLLMEM,x 6246 f492 - ifconst DOUBLEBUFFER 6247 f492 - sta DLLMEM+DBOFFSET,x 6248 f492 - endif ; DOUBLEBUFFER 6249 f492 - clc 6250 f492 - lda temp2 6251 f492 - adc visibleDLLstart 6252 f492 - tax 6253 f492 - lda DLLMEM,x 6254 f492 - ora #%10000000 6255 f492 - sta DLLMEM,x 6256 f492 - ifconst DOUBLEBUFFER 6257 f492 - sta DLLMEM+DBOFFSET,x 6258 f492 - endif ; DOUBLEBUFFER 6259 f492 - jsr vblankresync 6260 f492 - rts 6261 f492 endif ; USED_ADJUSTVISIBLE 6262 f492 6263 f492 vblankresync 6264 f492 20 30 f5 jsr waitforvblankstart ; ensure vblank just started 6265 f495 a9 00 lda #0 6266 f497 85 4d sta visibleover 6267 f499 a9 03 lda #3 6268 f49b 8d b2 01 sta interruptindex 6269 f49e 60 rts 6270 f49f 6271 f49f createallgamedlls 6272 f49f a2 00 ldx #0 6273 f4a1 a9 19 lda #NVLINES 6274 f4a3 ac 09 21 ldy paldetected 6275 f4a6 f0 03 beq skipcreatePALpadding 6276 f4a8 18 clc 6277 f4a9 69 15 adc #21 6278 f4ab skipcreatePALpadding 6279 f4ab 20 e0 f4 jsr createnonvisibledlls 6280 f4ae 8e 3c 21 stx visibleDLLstart 6281 f4b1 20 11 f5 jsr createvisiblezones 6282 f4b4 8e 3d 21 stx overscanDLLstart 6283 f4b7 createallgamedllscontinue 6284 f4b7 a9 50 lda #(NVLINES+55) ; extras for PAL 6285 f4b9 20 e0 f4 jsr createnonvisibledlls 6286 f4bc 6287 f4bc ae 3c 21 ldx visibleDLLstart 6288 f4bf bd 00 18 lda DLLMEM,x 6289 f4c2 09 80 ora #%10000000 ; NMI 1 - start of visible screen 6290 f4c4 9d 00 18 sta DLLMEM,x 6291 f4c7 - ifconst DOUBLEBUFFER 6292 f4c7 - sta DLLMEM+DBOFFSET,x 6293 f4c7 endif ; DOUBLEBUFFER 6294 f4c7 6295 f4c7 ae 3d 21 ldx overscanDLLstart 6296 f4ca bd 00 18 lda DLLMEM,x 6297 f4cd 09 83 ora #%10000011 ; NMI 2 - end of visible screen 6298 f4cf 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 6299 f4d1 9d 00 18 sta DLLMEM,x 6300 f4d4 - ifconst DOUBLEBUFFER 6301 f4d4 - sta DLLMEM+DBOFFSET,x 6302 f4d4 endif ; DOUBLEBUFFER 6303 f4d4 6304 f4d4 e8 inx 6305 f4d5 e8 inx 6306 f4d6 e8 inx 6307 f4d7 6308 f4d7 bd 00 18 lda DLLMEM,x 6309 f4da 09 80 ora #%10000000 ; NMI 3 - deeper overscan 6310 f4dc 9d 00 18 sta DLLMEM,x 6311 f4df - ifconst DOUBLEBUFFER 6312 f4df - sta DLLMEM+DBOFFSET,x 6313 f4df endif ; DOUBLEBUFFER 6314 f4df 6315 f4df 60 rts 6316 f4e0 6317 f4e0 createnonvisibledlls 6318 f4e0 85 42 sta temp1 6319 f4e2 4a lsr 6320 f4e3 4a lsr 6321 f4e4 4a lsr 6322 f4e5 4a lsr ; /16 6323 f4e6 f0 09 beq skipcreatenonvisibledlls1loop 6324 f4e8 a8 tay 6325 f4e9 createnonvisibledlls1loop 6326 f4e9 a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 6327 f4eb 20 00 f5 jsr createblankdllentry 6328 f4ee 88 dey 6329 f4ef d0 f8 bne createnonvisibledlls1loop 6330 f4f1 skipcreatenonvisibledlls1loop 6331 f4f1 a5 42 lda temp1 6332 f4f3 29 0f and #%00001111 6333 f4f5 f0 08 beq createnonvisibledllsreturn 6334 f4f7 38 sec 6335 f4f8 e9 01 sbc #1 6336 f4fa 09 40 ora #%01000000 6337 f4fc 20 00 f5 jsr createblankdllentry 6338 f4ff createnonvisibledllsreturn 6339 f4ff 60 rts 6340 f500 6341 f500 createblankdllentry 6342 f500 9d 00 18 sta DLLMEM,x 6343 f503 - ifconst DOUBLEBUFFER 6344 f503 - sta DLLMEM+DBOFFSET,x 6345 f503 endif ; DOUBLEBUFFER 6346 f503 e8 inx 6347 f504 a9 21 lda #$21 ; blank 6348 f506 9d 00 18 sta DLLMEM,x 6349 f509 - ifconst DOUBLEBUFFER 6350 f509 - sta DLLMEM+DBOFFSET,x 6351 f509 endif ; DOUBLEBUFFER 6352 f509 e8 inx 6353 f50a a9 00 lda #$00 6354 f50c 9d 00 18 sta DLLMEM,x 6355 f50f - ifconst DOUBLEBUFFER 6356 f50f - sta DLLMEM+DBOFFSET,x 6357 f50f endif ; DOUBLEBUFFER 6358 f50f e8 inx 6359 f510 60 rts 6360 f511 6361 f511 createvisiblezones 6362 f511 a0 00 ldy #0 6363 f513 createvisiblezonesloop 6364 f513 b9 60 f6 lda.w DLHEIGHT,y 6365 f516 09 20 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 6366 f518 9d 00 18 sta DLLMEM,x 6367 f51b - ifconst DOUBLEBUFFER 6368 f51b - sta DLLMEM+DBOFFSET,x 6369 f51b endif ; DOUBLEBUFFER 6370 f51b e8 inx 6371 f51c b9 30 f6 lda DLPOINTH,y 6372 f51f 9d 00 18 sta DLLMEM,x 6373 f522 - ifconst DOUBLEBUFFER 6374 f522 - sta DLLMEM+DBOFFSET,x 6375 f522 endif ; DOUBLEBUFFER 6376 f522 e8 inx 6377 f523 b9 48 f6 lda DLPOINTL,y 6378 f526 9d 00 18 sta DLLMEM,x 6379 f529 - ifconst DOUBLEBUFFER 6380 f529 - clc 6381 f529 - adc #DOUBLEBUFFEROFFSET 6382 f529 - sta DLLMEM+DBOFFSET,x 6383 f529 - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 6384 f529 - inc DLLMEM+DBOFFSET-1,x 6385 f529 -skiphidoublebufferadjust 6386 f529 endif ; DOUBLEBUFFER 6387 f529 e8 inx 6388 f52a c8 iny 6389 f52b c0 18 cpy #WZONECOUNT 6390 f52d d0 e4 bne createvisiblezonesloop 6391 f52f 60 rts 6392 f530 6393 f530 waitforvblankstart 6394 f530 visibleoverwait 6395 f530 24 28 BIT MSTAT 6396 f532 10 fc bpl visibleoverwait 6397 f534 vblankstartwait 6398 f534 24 28 BIT MSTAT 6399 f536 30 fc bmi vblankstartwait 6400 f538 60 rts 6401 f539 6402 f539 - ifconst DOUBLEBUFFER 6403 f539 -flipdisplaybufferreturn 6404 f539 - rts 6405 f539 -flipdisplaybuffer 6406 f539 - lda doublebufferstate 6407 f539 - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 6408 f539 - 6409 f539 - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 6410 f539 - 6411 f539 - lda doublebufferstate 6412 f539 - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 6413 f539 - tax 6414 f539 - 6415 f539 - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 6416 f539 - 6417 f539 -flipdisplaybufferwait1 6418 f539 - lda visibleover 6419 f539 - beq flipdisplaybufferwait1 6420 f539 - 6421 f539 -flipdisplaybufferwait 6422 f539 - lda visibleover 6423 f539 - bne flipdisplaybufferwait 6424 f539 - 6425 f539 - lda doublebufferminimumframetarget 6426 f539 - beq skipminimumframecode 6427 f539 - lda doublebufferminimumframeindex 6428 f539 - bne flipdisplaybufferwait1 6429 f539 - lda doublebufferminimumframetarget 6430 f539 - sta doublebufferminimumframeindex 6431 f539 -skipminimumframecode 6432 f539 - 6433 f539 - lda DLLMEMLutHi,x 6434 f539 - sta DPPH 6435 f539 - lda DLLMEMLutLo,x 6436 f539 - sta DPPL 6437 f539 - 6438 f539 - lda NewPageflipstate,x 6439 f539 - sta doublebufferstate 6440 f539 - lda NewPageflipoffset,x 6441 f539 - sta doublebufferdloffset 6442 f539 - 6443 f539 - lda doublebufferbufferdirty 6444 f539 - beq flipdisplaybufferreturn 6445 f539 - 6446 f539 - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 6447 f539 - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 6448 f539 - ; from the displayed buffer to the working buffer... 6449 f539 - 6450 f539 - lda doublebufferdloffset 6451 f539 - eor #DOUBLEBUFFEROFFSET 6452 f539 - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 6453 f539 - 6454 f539 - ldx #(WZONECOUNT-1) 6455 f539 -copybufferzoneloop 6456 f539 - 6457 f539 - lda DLPOINTL,x 6458 f539 - clc 6459 f539 - adc doublebufferdloffset 6460 f539 - sta temp1 6461 f539 - lda DLPOINTH,x 6462 f539 - adc #0 6463 f539 - sta temp2 6464 f539 - 6465 f539 - lda DLPOINTL,x 6466 f539 - clc 6467 f539 - adc temp6 6468 f539 - sta temp3 6469 f539 - lda DLPOINTH,x 6470 f539 - adc #0 6471 f539 - sta temp4 6472 f539 - 6473 f539 - lda dlendsave,x 6474 f539 - tay 6475 f539 -copybuffercharsloop 6476 f539 - lda (temp3),y 6477 f539 - sta (temp1),y 6478 f539 - dey 6479 f539 - bpl copybuffercharsloop 6480 f539 - dex 6481 f539 - bpl copybufferzoneloop 6482 f539 - lda #0 6483 f539 - sta doublebufferbufferdirty 6484 f539 - rts 6485 f539 - 6486 f539 -doublebufferoff 6487 f539 - lda #1 6488 f539 - sta doublebufferstate 6489 f539 - jsr flipdisplaybuffer 6490 f539 - lda #0 6491 f539 - sta doublebufferstate 6492 f539 - sta doublebufferdloffset 6493 f539 - rts 6494 f539 - 6495 f539 -DLLMEMLutLo 6496 f539 - .byte DLLMEM,>(DLLMEM+DBOFFSET) 6499 f539 -NewPageflipstate 6500 f539 - .byte 3,1 6501 f539 -NewPageflipoffset 6502 f539 - .byte DOUBLEBUFFEROFFSET,0 6503 f539 - 6504 f539 endif ; DOUBLEBUFFER 6505 f539 6506 f539 - ifconst MOUSESUPPORT 6507 f539 - 6508 f539 -rotationalcompare 6509 f539 - ; old = 00 01 10 11 6510 f539 - .byte $00, $01, $ff, $00 ; new=00 6511 f539 - .byte $ff, $00, $00, $01 ; new=01 6512 f539 - .byte $01, $00, $00, $ff ; new=10 6513 f539 - .byte $00, $ff, $01, $00 ; new=11 6514 f539 - 6515 f539 - ; 0000YyXx st mouse 6516 f539 - 6517 f539 - ; 0000xyXY amiga mouse 6518 f539 - 6519 f539 - ifconst MOUSEXONLY 6520 f539 -amigatoataribits ; swap bits 1 and 4... 6521 f539 - .byte %0000, %0000, %0010, %0010 6522 f539 - .byte %0000, %0000, %0010, %0010 6523 f539 - .byte %0001, %0001, %0011, %0011 6524 f539 - .byte %0001, %0001, %0011, %0011 6525 f539 - 6526 f539 - ; null change bits 6527 f539 - .byte %0000, %0001, %0010, %0011 6528 f539 - .byte %0000, %0001, %0010, %0011 6529 f539 - .byte %0000, %0001, %0010, %0011 6530 f539 - .byte %0000, %0001, %0010, %0011 6531 f539 - 6532 f539 - else ; !MOUSEXONLY 6533 f539 - 6534 f539 -amigatoataribits ; swap bits 1 and 4... 6535 f539 - .byte %0000, %1000, %0010, %1010 6536 f539 - .byte %0100, %1100, %0110, %1110 6537 f539 - .byte %0001, %1001, %0011, %1011 6538 f539 - .byte %0101, %1101, %0111, %1111 6539 f539 - ; null change bits 6540 f539 - .byte %0000, %0001, %0010, %0011 6541 f539 - .byte %0100, %0101, %0110, %0111 6542 f539 - .byte %1000, %1001, %1010, %1011 6543 f539 - .byte %1100, %1101, %1110, %1111 6544 f539 - endif ; !MOUSEXONLY 6545 f539 - 6546 f539 endif ; MOUSESUPPORT 6547 f539 6548 f539 mouse0update 6549 f539 - ifconst MOUSE0SUPPORT 6550 f539 - 6551 f539 -mousetableselect = inttemp2 6552 f539 -mousexdelta = inttemp3 6553 f539 -mouseydelta = inttemp4 6554 f539 -lastSWCHA = inttemp6 6555 f539 - 6556 f539 - ; 0000YyXx st mouse 6557 f539 - ; 0000xyXY amiga mouse 6558 f539 - 6559 f539 - lda #$ff 6560 f539 - sta lastSWCHA 6561 f539 - 6562 f539 - ldy port0control 6563 f539 - 6564 f539 - lda #%00010000 6565 f539 - cpy #9 ; AMIGA? 6566 f539 - bne skipamigabitsfix0 6567 f539 - lda #0 6568 f539 -skipamigabitsfix0 6569 f539 - sta mousetableselect 6570 f539 - ifconst DRIVINGBOOST 6571 f539 - cpy #6 ; DRIVING? 6572 f539 - bne skipdriving0setup 6573 f539 - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 6574 f539 - ; trails the actual mousex0, so we can smoothly interpolate toward 6575 f539 - ; the actual position. This actual position is stored in mousey0 6576 f539 - ; after the driver has run. 6577 f539 - ldx mousex0 6578 f539 - lda mousey0 6579 f539 - stx mousey0 6580 f539 - sta mousex0 6581 f539 -skipdriving0setup 6582 f539 - endif ; DRIVINGBOOST 6583 f539 - 6584 f539 - lda #0 6585 f539 - sta mousexdelta 6586 f539 - sta mouseydelta 6587 f539 - 6588 f539 - ifnconst MOUSETIME 6589 f539 - ifnconst MOUSEXONLY 6590 f539 - lda #180 ; minimum for x+y 6591 f539 - else 6592 f539 - lda #100 ; minimum for just x 6593 f539 - endif 6594 f539 - else 6595 f539 - lda #MOUSETIME 6596 f539 - endif 6597 f539 - jsr SETTIM64T ; INTIM is in Y 6598 f539 - 6599 f539 -mouse0updateloop 6600 f539 - lda SWCHA 6601 f539 - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 6602 f539 - cmp lastSWCHA 6603 f539 - beq mouse0loopcondition 6604 f539 - sta lastSWCHA 6605 f539 - lsr 6606 f539 - lsr 6607 f539 - lsr 6608 f539 - 6609 f539 - ora mousetableselect ; atari/amiga decoding table selection 6610 f539 - 6611 f539 - ; st mice encode on different bits/joystick-lines than amiga mice... 6612 f539 - ; 0000YyXx st mouse 6613 f539 - ; 0000xyXY amiga mouse 6614 f539 - ; ...so can shuffle the amiga bits to reuse the st driver. 6615 f539 - tay 6616 f539 - lax amigatoataribits,y 6617 f539 - 6618 f539 - ifnconst MOUSEXONLY 6619 f539 - ; first the Y... 6620 f539 - and #%00001100 6621 f539 - ora mousecodey0 6622 f539 - tay 6623 f539 - lda rotationalcompare,y 6624 f539 - clc 6625 f539 - adc mouseydelta 6626 f539 - sta mouseydelta 6627 f539 - tya 6628 f539 - lsr 6629 f539 - lsr 6630 f539 - sta mousecodey0 6631 f539 - txa 6632 f539 - ; ...then the X... 6633 f539 - and #%00000011 6634 f539 - tax 6635 f539 - endif ; !MOUSEXONLY 6636 f539 - 6637 f539 - asl 6638 f539 - asl 6639 f539 - ora mousecodex0 6640 f539 - tay 6641 f539 - lda rotationalcompare,y 6642 f539 - adc mousexdelta ; carry was clear by previous ASL 6643 f539 - sta mousexdelta 6644 f539 - stx mousecodex0 6645 f539 -mouse0loopcondition 6646 f539 - lda TIMINT 6647 f539 - bpl mouse0updateloop 6648 f539 - 6649 f539 - ; *** adapt to selected device resolution. 6650 f539 - ldx port0control 6651 f539 - 6652 f539 - ifconst PRECISIONMOUSING 6653 f539 - ldy port0resolution 6654 f539 - bne mouse0halveddone 6655 f539 - cpx #6 ; half-resolution is no good for driving wheels 6656 f539 - beq mouse0halveddone 6657 f539 - ; resolution=0 is half mouse resolution, necessary for precision 6658 f539 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 6659 f539 - 6660 f539 - lda mousexdelta 6661 f539 - cmp #$80 6662 f539 - ror ; do a signed divide by 2. 6663 f539 - clc 6664 f539 - adc mousex0 6665 f539 - sta mousex0 6666 f539 - ifnconst MOUSEXONLY 6667 f539 - lda mouseydelta 6668 f539 - clc 6669 f539 - adc mousey0 6670 f539 - sta mousey0 6671 f539 - endif 6672 f539 - ; at half resolution we just exit after updating x and y 6673 f539 - jmp LLRET0 6674 f539 -mouse0halveddone 6675 f539 - endif ; PRECISIONMOUSING 6676 f539 - 6677 f539 - ifnconst MOUSEXONLY 6678 f539 - asl mouseydelta ; *2 because Y resolution is finer 6679 f539 - ldy port0resolution 6680 f539 - dey 6681 f539 - lda #0 6682 f539 -mousey0resolutionfix 6683 f539 - clc 6684 f539 - adc mouseydelta 6685 f539 - dey 6686 f539 - bpl mousey0resolutionfix 6687 f539 - clc 6688 f539 - adc mousey0 6689 f539 - sta mousey0 6690 f539 - endif ; MOUSEXONLY 6691 f539 - 6692 f539 - ldy port0resolution 6693 f539 - dey 6694 f539 - lda #0 6695 f539 -mousex0resolutionfix 6696 f539 - clc 6697 f539 - adc mousexdelta 6698 f539 - dey 6699 f539 - bpl mousex0resolutionfix 6700 f539 - ifnconst DRIVINGBOOST 6701 f539 - clc 6702 f539 - adc mousex0 6703 f539 - sta mousex0 6704 f539 - else 6705 f539 - cpx #6 6706 f539 - beq carryonmouse0boost 6707 f539 - clc 6708 f539 - adc mousex0 6709 f539 - sta mousex0 6710 f539 - jmp LLRET0 6711 f539 -carryonmouse0boost 6712 f539 - sta mousexdelta 6713 f539 - clc 6714 f539 - adc mousecodey0 6715 f539 - sta mousecodey0 6716 f539 - clc 6717 f539 - adc mousex0 6718 f539 - tay ; save the target X 6719 f539 - adc mousey0 ; average in the smoothly-trailing X 6720 f539 - ror 6721 f539 - sta mousex0 ; mousex0 now has the smoothly trailing X 6722 f539 - sty mousey0 ; and mousey0 has the the target X 6723 f539 - 6724 f539 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 6725 f539 - ; A has mousex0, the smoothly trailing X 6726 f539 - sbc mousey0 ; less the target X 6727 f539 - bpl skipabsolutedrive0 6728 f539 - eor #$ff 6729 f539 -skipabsolutedrive0 6730 f539 - cmp #64 ; just an unreasonably large change 6731 f539 - bcc skipdrivewrapfix0 6732 f539 - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 6733 f539 -skipdrivewrapfix0 6734 f539 - 6735 f539 - ; get rid of the tweening if the distance travelled was very small 6736 f539 - lda mousexdelta 6737 f539 - cmp port0resolution 6738 f539 - bcs skipbetweenfix0 6739 f539 - lda mousex0 6740 f539 - sta mousey0 6741 f539 -skipbetweenfix0 6742 f539 - 6743 f539 -drivingboostreductioncheck0 6744 f539 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 6745 f539 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 6746 f539 - ; negated again because truncation during BCD math results in 6747 f539 - ; differing magnitudes, depending if the value is +ve or -ve. 6748 f539 -driving0fix 6749 f539 - lax mousecodey0 6750 f539 - cmp #$80 6751 f539 - bcs driving0skipnegate1 6752 f539 - eor #$FF 6753 f539 - adc #1 6754 f539 - sta mousecodey0 6755 f539 -driving0skipnegate1 6756 f539 - cmp #$80 6757 f539 - ror 6758 f539 - cmp #$80 6759 f539 - ror 6760 f539 - cmp #$80 6761 f539 - ror 6762 f539 - sta inttemp1 6763 f539 - lda mousecodey0 6764 f539 - sec 6765 f539 - sbc inttemp1 6766 f539 - cpx #$80 6767 f539 - bcs driving0skipnegate2 6768 f539 - eor #$FF 6769 f539 - adc #1 6770 f539 -driving0skipnegate2 6771 f539 - sta mousecodey0 6772 f539 -drivingboostdone0 6773 f539 - endif ; DRIVINGBOOST 6774 f539 - 6775 f539 - jmp LLRET0 6776 f539 - 6777 f539 endif ; MOUSE0SUPPORT 6778 f539 6779 f539 mouse1update 6780 f539 - ifconst MOUSE1SUPPORT 6781 f539 - 6782 f539 -mousetableselect = inttemp2 6783 f539 -mousexdelta = inttemp3 6784 f539 -mouseydelta = inttemp4 6785 f539 -lastSWCHA = inttemp6 6786 f539 - 6787 f539 - ; 0000YyXx st mouse 6788 f539 - ; 0000xyXY amiga mouse 6789 f539 - 6790 f539 - lda #$ff 6791 f539 - sta lastSWCHA 6792 f539 - 6793 f539 - ldy port1control 6794 f539 - 6795 f539 - lda #%00010000 6796 f539 - cpy #9 ; AMIGA? 6797 f539 - bne skipamigabitsfix1 6798 f539 - lda #0 6799 f539 -skipamigabitsfix1 6800 f539 - sta mousetableselect 6801 f539 - ifconst DRIVINGBOOST 6802 f539 - cpy #6 ; DRIVING? 6803 f539 - bne skipdriving1setup 6804 f539 - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 6805 f539 - ; trails the actual mousex1, so we can smoothly interpolate toward 6806 f539 - ; the actual position. This actual position is stored in mousey1 6807 f539 - ; after the driver has run. 6808 f539 - ldx mousex1 6809 f539 - lda mousey1 6810 f539 - stx mousey1 6811 f539 - sta mousex1 6812 f539 -skipdriving1setup 6813 f539 - endif ; DRIVINGBOOST 6814 f539 - 6815 f539 - lda #0 6816 f539 - sta mousexdelta 6817 f539 - sta mouseydelta 6818 f539 - 6819 f539 - ifnconst MOUSETIME 6820 f539 - ifnconst MOUSEXONLY 6821 f539 - lda #180 ; minimum for x+y 6822 f539 - else 6823 f539 - lda #100 ; minimum for just x 6824 f539 - endif 6825 f539 - else 6826 f539 - lda #MOUSETIME 6827 f539 - endif 6828 f539 - jsr SETTIM64T ; INTIM is in Y 6829 f539 - 6830 f539 -mouse1updateloop 6831 f539 - lda SWCHA 6832 f539 - and #%00001111 6833 f539 - cmp lastSWCHA 6834 f539 - beq mouse1loopcondition 6835 f539 - sta lastSWCHA 6836 f539 - 6837 f539 - ora mousetableselect ; atari/amiga decoding table selection 6838 f539 - 6839 f539 - ; st mice encode on different bits/joystick-lines than amiga mice... 6840 f539 - ; 0000YyXx st mouse 6841 f539 - ; 0000xyXY amiga mouse 6842 f539 - ; ...so can shuffle the amiga bits to reuse the st driver. 6843 f539 - tay 6844 f539 - lax amigatoataribits,y 6845 f539 - 6846 f539 - ifnconst MOUSEXONLY 6847 f539 - ; first the Y... 6848 f539 - and #%00001100 6849 f539 - ora mousecodey1 6850 f539 - tay 6851 f539 - lda rotationalcompare,y 6852 f539 - clc 6853 f539 - adc mouseydelta 6854 f539 - sta mouseydelta 6855 f539 - tya 6856 f539 - lsr 6857 f539 - lsr 6858 f539 - sta mousecodey1 6859 f539 - txa 6860 f539 - ; ...then the X... 6861 f539 - and #%00000011 6862 f539 - tax 6863 f539 - endif ; !MOUSEXONLY 6864 f539 - 6865 f539 - asl 6866 f539 - asl 6867 f539 - ora mousecodex1 6868 f539 - tay 6869 f539 - lda rotationalcompare,y 6870 f539 - adc mousexdelta ; carry was clear by previous ASL 6871 f539 - sta mousexdelta 6872 f539 - stx mousecodex1 6873 f539 -mouse1loopcondition 6874 f539 - lda TIMINT 6875 f539 - bpl mouse1updateloop 6876 f539 - 6877 f539 - ; *** adapt to selected device resolution. 6878 f539 - ldx port1control 6879 f539 - 6880 f539 - ifconst PRECISIONMOUSING 6881 f539 - ldy port1resolution 6882 f539 - bne mouse1halveddone 6883 f539 - cpx #6 ; half-resolution is no good for driving wheels 6884 f539 - beq mouse1halveddone 6885 f539 - ; resolution=0 is half mouse resolution, necessary for precision 6886 f539 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 6887 f539 - 6888 f539 - lda mousexdelta 6889 f539 - cmp #$80 6890 f539 - ror ; do a signed divide by 2. 6891 f539 - clc 6892 f539 - adc mousex1 6893 f539 - sta mousex1 6894 f539 - ifnconst MOUSEXONLY 6895 f539 - lda mouseydelta 6896 f539 - clc 6897 f539 - adc mousey1 6898 f539 - sta mousey1 6899 f539 - endif 6900 f539 - ; at half resolution we just exit after updating x and y 6901 f539 - jmp LLRET1 6902 f539 -mouse1halveddone 6903 f539 - endif ; PRECISIONMOUSING 6904 f539 - 6905 f539 - ifnconst MOUSEXONLY 6906 f539 - asl mouseydelta ; *2 because Y resolution is finer 6907 f539 - ldy port1resolution 6908 f539 - dey 6909 f539 - lda #0 6910 f539 -mousey1resolutionfix 6911 f539 - clc 6912 f539 - adc mouseydelta 6913 f539 - dey 6914 f539 - bpl mousey1resolutionfix 6915 f539 - clc 6916 f539 - adc mousey1 6917 f539 - sta mousey1 6918 f539 - endif ; MOUSEXONLY 6919 f539 - 6920 f539 - ldy port1resolution 6921 f539 - dey 6922 f539 - lda #0 6923 f539 -mousex1resolutionfix 6924 f539 - clc 6925 f539 - adc mousexdelta 6926 f539 - dey 6927 f539 - bpl mousex1resolutionfix 6928 f539 - ifnconst DRIVINGBOOST 6929 f539 - clc 6930 f539 - adc mousex1 6931 f539 - sta mousex1 6932 f539 - else 6933 f539 - cpx #6 6934 f539 - beq carryonmouse1boost 6935 f539 - clc 6936 f539 - adc mousex1 6937 f539 - sta mousex1 6938 f539 - jmp LLRET1 6939 f539 -carryonmouse1boost 6940 f539 - sta mousexdelta 6941 f539 - clc 6942 f539 - adc mousecodey1 6943 f539 - sta mousecodey1 6944 f539 - clc 6945 f539 - adc mousex1 6946 f539 - tay ; save the target X 6947 f539 - adc mousey1 ; average in the smoothly-trailing X 6948 f539 - ror 6949 f539 - sta mousex1 ; mousex0 now has the smoothly trailing X 6950 f539 - sty mousey1 ; and mousey0 has the the target X 6951 f539 - 6952 f539 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 6953 f539 - ; A has mousex1, the smoothly trailing X 6954 f539 - sbc mousey1 ; less the target X 6955 f539 - bpl skipabsolutedrive1 6956 f539 - eor #$ff 6957 f539 -skipabsolutedrive1 6958 f539 - cmp #64 ; just an unreasonably large change 6959 f539 - bcc skipdrivewrapfix1 6960 f539 - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 6961 f539 -skipdrivewrapfix1 6962 f539 - 6963 f539 - ; get rid of the tweening if the distance travelled was very small 6964 f539 - lda mousexdelta 6965 f539 - cmp port1resolution 6966 f539 - bcs skipbetweenfix1 6967 f539 - lda mousex1 6968 f539 - sta mousey1 6969 f539 -skipbetweenfix1 6970 f539 - 6971 f539 -drivingboostreductioncheck1 6972 f539 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 6973 f539 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 6974 f539 - ; negated again because truncation during BCD math results in 6975 f539 - ; differing magnitudes, depending if the value is +ve or -ve. 6976 f539 -driving1fix 6977 f539 - lax mousecodey1 6978 f539 - cmp #$80 6979 f539 - bcs driving0skipnegate1 6980 f539 - eor #$FF 6981 f539 - adc #1 6982 f539 - sta mousecodey1 6983 f539 -driving0skipnegate1 6984 f539 - cmp #$80 6985 f539 - ror 6986 f539 - cmp #$80 6987 f539 - ror 6988 f539 - cmp #$80 6989 f539 - ror 6990 f539 - sta inttemp1 6991 f539 - lda mousecodey1 6992 f539 - sec 6993 f539 - sbc inttemp1 6994 f539 - cpx #$80 6995 f539 - bcs driving1skipnegate2 6996 f539 - eor #$FF 6997 f539 - adc #1 6998 f539 -driving1skipnegate2 6999 f539 - sta mousecodey1 7000 f539 -drivingboostdone1 7001 f539 - endif ; DRIVINGBOOST 7002 f539 - 7003 f539 - jmp LLRET1 7004 f539 - 7005 f539 endif ; MOUSE1SUPPORT 7006 f539 7007 f539 7008 f539 trakball0update 7009 f539 - ifconst TRAKBALL0SUPPORT 7010 f539 - ifnconst TRAKTIME 7011 f539 - ifnconst TRAKXONLY 7012 f539 - lda #180 ; minimum for x+y 7013 f539 - else ; !TRAKXONLY 7014 f539 - lda #100 ; minimum for just x 7015 f539 - endif ; !TRAKXONLY 7016 f539 - else ; !TRAKTIME 7017 f539 - lda #TRAKTIME 7018 f539 - endif ; !TRAKTIME 7019 f539 - jsr SETTIM64T ; INTIM is in Y 7020 f539 - ldx #0 7021 f539 - ifnconst TRAKXONLY 7022 f539 - ldy #0 7023 f539 - endif ; TRAKXONLY 7024 f539 -trakball0updateloop 7025 f539 - lda SWCHA 7026 f539 - and #%00110000 7027 f539 - cmp trakballcodex0 7028 f539 - sta trakballcodex0 7029 f539 - beq trakball0movementXdone 7030 f539 - and #%00010000 7031 f539 - beq trakball0negativeX 7032 f539 -trakball0positiveX 7033 f539 - ;(2 from beq) 7034 f539 - inx ; 2 7035 f539 - jmp trakball0movementXdone ; 3 7036 f539 -trakball0negativeX 7037 f539 - ;(3 from beq) 7038 f539 - dex ; 2 7039 f539 - nop ; 2 7040 f539 -trakball0movementXdone 7041 f539 - 7042 f539 - ifnconst TRAKXONLY 7043 f539 - lda SWCHA 7044 f539 - and #%11000000 7045 f539 - cmp trakballcodey0 7046 f539 - sta trakballcodey0 7047 f539 - beq trakball0movementYdone 7048 f539 - and #%01000000 7049 f539 - beq trakball0negativeY 7050 f539 -trakball0positiveY 7051 f539 - ;(2 from beq) 7052 f539 - iny ; 2 7053 f539 - jmp trakball0movementYdone ; 3 7054 f539 -trakball0negativeY 7055 f539 - ;(3 from beq) 7056 f539 - dey ; 2 7057 f539 - nop ; 2 7058 f539 -trakball0movementYdone 7059 f539 - endif ; !TRAKXONLY 7060 f539 - 7061 f539 - lda TIMINT 7062 f539 - bpl trakball0updateloop 7063 f539 - lda #0 7064 f539 - cpx #0 7065 f539 - beq trakball0skipXadjust 7066 f539 - clc 7067 f539 -trakball0Xloop 7068 f539 - adc port0resolution 7069 f539 - dex 7070 f539 - bne trakball0Xloop 7071 f539 - clc 7072 f539 - adc trakballx0 7073 f539 - sta trakballx0 7074 f539 -trakball0skipXadjust 7075 f539 - ifnconst TRAKXONLY 7076 f539 - lda #0 7077 f539 - cpy #0 7078 f539 - beq trakball0skipYadjust 7079 f539 - clc 7080 f539 -trakball0yloop 7081 f539 - adc port0resolution 7082 f539 - dey 7083 f539 - bne trakball0yloop 7084 f539 - clc 7085 f539 - adc trakbally0 7086 f539 - sta trakbally0 7087 f539 -trakball0skipYadjust 7088 f539 - endif ; !TRAKXONLY 7089 f539 - 7090 f539 - jmp LLRET0 7091 f539 endif 7092 f539 7093 f539 7094 f539 7095 f539 trakball1update 7096 f539 - ifconst TRAKBALL1SUPPORT 7097 f539 - ifnconst TRAKTIME 7098 f539 - ifnconst TRAKXONLY 7099 f539 - lda #180 ; minimum for x+y 7100 f539 - else ; !TRAKXONLY 7101 f539 - lda #100 ; minimum for just x 7102 f539 - endif ; !TRAKXONLY 7103 f539 - else ; !TRAKTIME 7104 f539 - lda #TRAKTIME 7105 f539 - endif ; !TRAKTIME 7106 f539 - jsr SETTIM64T ; INTIM is in Y 7107 f539 - ldx #0 7108 f539 - ifnconst TRAKXONLY 7109 f539 - ldy #0 7110 f539 - endif ; TRAKXONLY 7111 f539 -trakball1updateloop 7112 f539 - lda SWCHA 7113 f539 - and #%00000011 7114 f539 - cmp trakballcodex1 7115 f539 - sta trakballcodex1 7116 f539 - beq trakball1movementXdone 7117 f539 - and #%00000001 7118 f539 - beq trakball1negativeX 7119 f539 -trakball1positiveX 7120 f539 - ;(2 from beq) 7121 f539 - inx ; 2 7122 f539 - jmp trakball1movementXdone ; 3 7123 f539 -trakball1negativeX 7124 f539 - ;(3 from beq) 7125 f539 - dex ; 2 7126 f539 - nop ; 2 7127 f539 -trakball1movementXdone 7128 f539 - 7129 f539 - ifnconst TRAKXONLY 7130 f539 - lda SWCHA 7131 f539 - and #%00001100 7132 f539 - cmp trakballcodey1 7133 f539 - sta trakballcodey1 7134 f539 - beq trakball1movementYdone 7135 f539 - and #%00000100 7136 f539 - beq trakball1negativeY 7137 f539 -trakball1positiveY 7138 f539 - ;(2 from beq) 7139 f539 - iny ; 2 7140 f539 - jmp trakball1movementYdone ; 3 7141 f539 -trakball1negativeY 7142 f539 - ;(3 from beq) 7143 f539 - dey ; 2 7144 f539 - nop ; 2 7145 f539 -trakball1movementYdone 7146 f539 - endif ; !TRAKXONLY 7147 f539 - 7148 f539 - lda TIMINT 7149 f539 - bpl trakball1updateloop 7150 f539 - lda #0 7151 f539 - cpx #0 7152 f539 - beq trakball1skipXadjust 7153 f539 - clc 7154 f539 -trakball1Xloop 7155 f539 - adc port1resolution 7156 f539 - dex 7157 f539 - bne trakball1Xloop 7158 f539 - clc 7159 f539 - adc trakballx1 7160 f539 - sta trakballx1 7161 f539 -trakball1skipXadjust 7162 f539 - ifnconst TRAKXONLY 7163 f539 - lda #0 7164 f539 - cpy #0 7165 f539 - beq trakball1skipYadjust 7166 f539 - clc 7167 f539 -trakball1yloop 7168 f539 - adc port1resolution 7169 f539 - dey 7170 f539 - bne trakball1yloop 7171 f539 - clc 7172 f539 - adc trakbally1 7173 f539 - sta trakbally1 7174 f539 -trakball1skipYadjust 7175 f539 - endif ; !TRAKXONLY 7176 f539 - 7177 f539 - jmp LLRET1 7178 f539 endif 7179 f539 7180 f539 7181 f539 paddleport0update 7182 f539 - ifconst PADDLE0SUPPORT 7183 f539 - lda #6 7184 f539 - sta VBLANK ; start charging the paddle caps 7185 f539 - lda #0 ; use PADDLE timing 7186 f539 - jsr SETTIM64T ; INTIM is in Y 7187 f539 - 7188 f539 -paddleport0updateloop 7189 f539 - lda INPT0 7190 f539 - bmi skippaddle0setposition 7191 f539 - sty paddleposition0 7192 f539 -skippaddle0setposition 7193 f539 - ifconst TWOPADDLESUPPORT 7194 f539 - lda INPT1 7195 f539 - bmi skippaddle1setposition 7196 f539 - sty paddleposition1 7197 f539 -skippaddle1setposition 7198 f539 - endif 7199 f539 - ldy INTIM 7200 f539 - cpy #TIMEOFFSET 7201 f539 - bcs paddleport0updateloop 7202 f539 - 7203 f539 - lda #%10000110 7204 f539 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 7205 f539 - sec 7206 f539 - lda paddleposition0 7207 f539 - sbc #TIMEOFFSET 7208 f539 - ifconst PADDLESCALEX2 7209 f539 - asl 7210 f539 - endif 7211 f539 - 7212 f539 - ifnconst PADDLESMOOTHINGOFF 7213 f539 - clc 7214 f539 - adc paddleprevious0 7215 f539 - ror 7216 f539 - sta paddleprevious0 7217 f539 - endif 7218 f539 - 7219 f539 - sta paddleposition0 7220 f539 - 7221 f539 - ifconst TWOPADDLESUPPORT 7222 f539 - sec 7223 f539 - lda paddleposition1 7224 f539 - sbc #TIMEOFFSET 7225 f539 - ifconst PADDLESCALEX2 7226 f539 - asl 7227 f539 - endif 7228 f539 - 7229 f539 - ifnconst PADDLESMOOTHINGOFF 7230 f539 - clc 7231 f539 - adc paddleprevious1 7232 f539 - ror 7233 f539 - sta paddleprevious1 7234 f539 - endif 7235 f539 - sta paddleposition1 7236 f539 - endif ; TWOPADDLESUPPORT 7237 f539 - 7238 f539 - jmp LLRET0 7239 f539 endif 7240 f539 7241 f539 paddleport1update 7242 f539 - ifconst PADDLE1SUPPORT 7243 f539 - lda #6 7244 f539 - sta VBLANK ; start charging the paddle caps 7245 f539 - 7246 f539 - lda #0 ; use PADDLE timing 7247 f539 - jsr SETTIM64T ; INTIM is in Y 7248 f539 - 7249 f539 -paddleport1updateloop 7250 f539 - lda INPT2 7251 f539 - bmi skippaddle2setposition 7252 f539 - sty paddleposition2 7253 f539 -skippaddle2setposition 7254 f539 - ifconst TWOPADDLESUPPORT 7255 f539 - lda INPT3 7256 f539 - bmi skippaddle3setposition 7257 f539 - sty paddleposition3 7258 f539 -skippaddle3setposition 7259 f539 - endif 7260 f539 - ldy INTIM 7261 f539 - cpy #TIMEOFFSET 7262 f539 - bcs paddleport1updateloop 7263 f539 - 7264 f539 - lda #%10000110 7265 f539 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 7266 f539 - sec 7267 f539 - lda paddleposition2 7268 f539 - sbc #TIMEOFFSET 7269 f539 - ifconst PADDLESCALEX2 7270 f539 - asl 7271 f539 - endif 7272 f539 - 7273 f539 - ifnconst PADDLESMOOTHINGOFF 7274 f539 - clc 7275 f539 - adc paddleprevious2 7276 f539 - ror 7277 f539 - sta paddleprevious2 7278 f539 - endif 7279 f539 - 7280 f539 - sta paddleposition2 7281 f539 - 7282 f539 - ifconst TWOPADDLESUPPORT 7283 f539 - sec 7284 f539 - lda paddleposition3 7285 f539 - sbc #TIMEOFFSET 7286 f539 - ifconst PADDLESCALEX2 7287 f539 - asl 7288 f539 - endif 7289 f539 - 7290 f539 - ifnconst PADDLESMOOTHINGOFF 7291 f539 - clc 7292 f539 - adc paddleprevious3 7293 f539 - ror 7294 f539 - sta paddleprevious3 7295 f539 - endif 7296 f539 - sta paddleposition3 7297 f539 - endif ; TWOPADDLESUPPORT 7298 f539 - 7299 f539 - jmp LLRET1 7300 f539 endif 7301 f539 7302 f539 7303 f539 paddlebuttonhandler ; outside of conditional, for button-handler LUT 7304 f539 - ifconst PADDLESUPPORT 7305 f539 - ; x=0|1 for port, rather than paddle #. 7306 f539 - ; Only the first paddle button will integrate into "joy0fire" testing. If the 7307 f539 - ; game wants to support 2 paddles, up to the game to instead test the 7308 f539 - ; joystick right+left directions instead. 7309 f539 - lda SWCHA ; top of nibble is first paddle button 7310 f539 - cpx #0 ; port 0? 7311 f539 - beq skippaddleport2shift 7312 f539 - asl ; shift second port to upper nibble 7313 f539 - asl 7314 f539 - asl 7315 f539 - asl 7316 f539 -skippaddleport2shift 7317 f539 - and #%10000000 7318 f539 - eor #%10000000 ; invert 7319 f539 - sta sINPT1,x 7320 f539 - jmp buttonreadloopreturn 7321 f539 endif ; PADDLESUPPORT 7322 f539 7323 f539 mousebuttonhandler ; outside of conditional, for button-handler LUT 7324 f539 - ifconst MOUSESUPPORT 7325 f539 - ; stick the mouse buttons in the correct shadow register... 7326 f539 - txa 7327 f539 - asl 7328 f539 - tay ; y=x*2 7329 f539 - lda INPT4,x 7330 f539 - eor #%10000000 7331 f539 - lsr 7332 f539 - sta sINPT1,x 7333 f539 - 7334 f539 - lda INPT1,y 7335 f539 - and #%10000000 7336 f539 - eor #%10000000 7337 f539 - ora sINPT1,x 7338 f539 - sta sINPT1,x 7339 f539 - jmp buttonreadloopreturn 7340 f539 endif ; MOUSESUPPORT 7341 f539 7342 f539 - ifconst KEYPADSUPPORT 7343 f539 - ; ** select keypad rows 0 to 3 over 4 frames... 7344 f539 -keypadrowselect 7345 f539 - ldy #0 7346 f539 - lda port0control 7347 f539 - cmp #7 7348 f539 - bne skipport0val 7349 f539 - iny ; y=y+1 7350 f539 -skipport0val 7351 f539 - lda port1control 7352 f539 - cmp #7 7353 f539 - bne skipport1val 7354 f539 - iny 7355 f539 - iny ; y=y+2 7356 f539 -skipport1val 7357 f539 - lda keyrowdirectionmask,y 7358 f539 - sta CTLSWA 7359 f539 - tya 7360 f539 - asl 7361 f539 - asl 7362 f539 - sta inttemp1 7363 f539 - lda framecounter 7364 f539 - and #3 7365 f539 - ora inttemp1 7366 f539 - tax 7367 f539 - lda keyrowselectvalue,x 7368 f539 - sta SWCHA 7369 f539 - rts 7370 f539 - 7371 f539 -keyrowdirectionmask 7372 f539 - .byte #%00000000 ; 0 : port0=input port1=input 7373 f539 - .byte #%11110000 ; 1 : port0=output port1=input 7374 f539 - .byte #%00001111 ; 2 : port0=input port1=output 7375 f539 - .byte #%11111111 ; 3 : port0=output port1=output 7376 f539 - 7377 f539 -keyrowselectvalue 7378 f539 - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 7379 f539 - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 7380 f539 - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 7381 f539 - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 7382 f539 endif ; KEYPADSUPPORT 7383 f539 7384 f539 - ifconst KEYPADSUPPORT 7385 f539 - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 7386 f539 -keypadcolumnread 7387 f539 - lda port0control 7388 f539 - cmp #7 7389 f539 - bne skipkeypadcolumnread0 7390 f539 - lda framecounter 7391 f539 - and #3 7392 f539 - asl ; x2 because keypad variables are interleaved 7393 f539 - tax 7394 f539 - lda #0 7395 f539 - sta keypadmatrix0a,x 7396 f539 - lda INPT0 7397 f539 - cmp #$80 7398 f539 - rol keypadmatrix0a,x 7399 f539 - lda INPT1 7400 f539 - cmp #$80 7401 f539 - rol keypadmatrix0a,x 7402 f539 - lda INPT4 7403 f539 - cmp #$80 7404 f539 - rol keypadmatrix0a,x 7405 f539 - lda keypadmatrix0a,x 7406 f539 - eor #%00000111 7407 f539 - sta keypadmatrix0a,x 7408 f539 -skipkeypadcolumnread0 7409 f539 - 7410 f539 - lda port1control 7411 f539 - cmp #7 7412 f539 - bne skipkeypadcolumnread1 7413 f539 - lda framecounter 7414 f539 - and #3 7415 f539 - asl ; x2 because keypad variables are interleaved 7416 f539 - tax 7417 f539 - lda #0 7418 f539 - sta keypadmatrix1a,x 7419 f539 - rol keypadmatrix1a,x 7420 f539 - lda INPT2 7421 f539 - cmp #$80 7422 f539 - rol keypadmatrix1a,x 7423 f539 - lda INPT3 7424 f539 - cmp #$80 7425 f539 - rol keypadmatrix1a,x 7426 f539 - lda INPT5 7427 f539 - cmp #$80 7428 f539 - rol keypadmatrix1a,x 7429 f539 - lda keypadmatrix1a,x 7430 f539 - eor #%00000111 7431 f539 - sta keypadmatrix1a,x 7432 f539 -skipkeypadcolumnread1 7433 f539 - rts 7434 f539 endif ; KEYPADSUPPORT 7435 f539 7436 f539 setportforinput 7437 f539 a5 e4 lda CTLSWAs 7438 f53b 3d 44 f5 and allpinsinputlut,x 7439 f53e 85 e4 sta CTLSWAs 7440 f540 8d 81 02 sta CTLSWA 7441 f543 60 rts 7442 f544 7443 f544 allpinsinputlut 7444 f544 0f f0 .byte.b $0F, $F0 7445 f546 7446 f546 setonebuttonmode 7447 f546 a9 06 lda #6 ; in case we're in unlocked-bios mode 7448 f548 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 7449 f54a a9 14 lda #$14 7450 f54c 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 7451 f54f a5 e5 lda CTLSWBs 7452 f551 1d 5a f5 ora thisjoy2buttonbit,x 7453 f554 85 e5 sta CTLSWBs 7454 f556 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 7455 f559 60 rts 7456 f55a 7457 f55a thisjoy2buttonbit 7458 f55a 04 10 .byte.b $04, $10 7459 f55c 7460 f55c settwobuttonmode 7461 f55c a9 06 lda #6 ; in case we're in unlocked-bios mode 7462 f55e 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 7463 f560 a9 14 lda #$14 7464 f562 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 7465 f565 a5 e5 lda CTLSWBs 7466 f567 3d 70 f5 and thisjoy2buttonmask,x 7467 f56a 85 e5 sta CTLSWBs 7468 f56c 8d 82 02 sta SWCHB 7469 f56f 60 rts 7470 f570 7471 f570 thisjoy2buttonmask 7472 f570 fb ef .byte.b $fb, $ef 7473 f572 7474 f572 ; Provided under the CC0 license. See the included LICENSE.txt for details. 7475 f572 7476 f572 START 7477 f572 start 7478 f572 7479 f572 ;******** more or less the Atari recommended startup procedure 7480 f572 7481 f572 78 sei 7482 f573 d8 cld 7483 f574 7484 f574 ifnconst NOTIALOCK 7485 f574 a9 07 lda #$07 7486 f576 - else 7487 f576 - lda #$06 7488 f576 endif 7489 f576 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 7490 f578 a9 7f lda #$7F 7491 f57a 85 3c sta CTRL ;disable DMA 7492 f57c a9 00 lda #$00 7493 f57e 85 38 sta OFFSET 7494 f580 ifnconst NOTIALOCK 7495 f580 85 01 sta INPTCTRL 7496 f582 endif 7497 f582 a2 ff ldx #$FF 7498 f584 9a txs 7499 f585 7500 f585 ;************** Clear Memory 7501 f585 7502 f585 a2 40 ldx #$40 7503 f587 a9 00 lda #$00 7504 f589 crloop1 7505 f589 95 00 sta $00,x ;Clear zero page 7506 f58b 9d 00 01 sta $100,x ;Clear page 1 7507 f58e e8 inx 7508 f58f d0 f8 bne crloop1 7509 f591 7510 f591 7511 f591 a0 00 ldy #$00 ;Clear Ram 7512 f593 a9 18 lda #$18 ;Start at $1800 7513 f595 85 81 sta $81 7514 f597 a9 00 lda #$00 7515 f599 85 80 sta $80 7516 f59b crloop3 7517 f59b a9 00 lda #$00 7518 f59d 91 80 sta ($80),y ;Store data 7519 f59f c8 iny ;Next byte 7520 f5a0 d0 f9 bne crloop3 ;Branch if not done page 7521 f5a2 e6 81 inc $81 ;Next page 7522 f5a4 a5 81 lda $81 7523 f5a6 c9 20 cmp #$20 ;End at $1FFF 7524 f5a8 d0 f1 bne crloop3 ;Branch if not 7525 f5aa 7526 f5aa a0 00 ldy #$00 ;Clear Ram 7527 f5ac a9 22 lda #$22 ;Start at $2200 7528 f5ae 85 81 sta $81 7529 f5b0 a9 00 lda #$00 7530 f5b2 85 80 sta $80 7531 f5b4 crloop4 7532 f5b4 a9 00 lda #$00 7533 f5b6 91 80 sta ($80),y ;Store data 7534 f5b8 c8 iny ;Next byte 7535 f5b9 d0 f9 bne crloop4 ;Branch if not done page 7536 f5bb e6 81 inc $81 ;Next page 7537 f5bd a5 81 lda $81 7538 f5bf c9 27 cmp #$27 ;End at $27FF 7539 f5c1 d0 f1 bne crloop4 ;Branch if not 7540 f5c3 7541 f5c3 a2 00 ldx #$00 7542 f5c5 a9 00 lda #$00 7543 f5c7 crloop5 ;Clear 2100-213F, 2000-203F 7544 f5c7 9d 00 20 sta $2000,x 7545 f5ca 9d 00 21 sta $2100,x 7546 f5cd e8 inx 7547 f5ce e0 40 cpx #$40 7548 f5d0 d0 f5 bne crloop5 7549 f5d2 7550 f5d2 85 80 sta $80 7551 f5d4 85 81 sta $81 7552 f5d6 85 82 sta $82 7553 f5d8 85 83 sta $83 7554 f5da 7555 f5da ;seed random number with hopefully-random timer value 7556 f5da a9 01 lda #1 7557 f5dc 0d 84 02 ora INTIM 7558 f5df 85 40 sta rand 7559 f5e1 7560 f5e1 ; detect the console type... 7561 f5e1 pndetectvblankstart 7562 f5e1 a5 28 lda MSTAT 7563 f5e3 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 7564 f5e5 pndetectvblankover 7565 f5e5 a5 28 lda MSTAT 7566 f5e7 30 fc bmi pndetectvblankover ; then wait for it to be over 7567 f5e9 a0 00 ldy #$00 7568 f5eb a2 00 ldx #$00 7569 f5ed pndetectvblankhappening 7570 f5ed a5 28 lda MSTAT 7571 f5ef 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 7572 f5f1 85 24 sta WSYNC 7573 f5f3 85 24 sta WSYNC 7574 f5f5 e8 inx 7575 f5f6 d0 f5 bne pndetectvblankhappening 7576 f5f8 pndetectinvblank 7577 f5f8 e0 7d cpx #125 7578 f5fa 90 02 bcc pndetecispal 7579 f5fc a0 01 ldy #$01 7580 f5fe pndetecispal 7581 f5fe 8c 09 21 sty paldetected 7582 f601 7583 f601 20 9f f4 jsr createallgamedlls 7584 f604 7585 f604 a9 18 lda #>DLLMEM 7586 f606 85 2c sta DPPH 7587 f608 a9 00 lda # 255 7756 f630 -DOUBLEBUFFEROFFSET = 255 7757 f630 else 7758 f630 00 4d DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 7759 f630 endif 7760 f630 7761 f630 - ifconst EXTRADLMEMORY 7762 f630 -SECONDDLHALFSTART SET $2300 7763 f630 endif 7764 f630 7765 f630 DLPOINTH 7766 f630 DLINDEX SET 0 7767 f630 REPEAT WZONECOUNT 7768 f630 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f630 - ifconst EXTRADLMEMORY 7770 f630 - if TMPMEMADDRESS > $1FFF 7771 f630 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f630 - else 7773 f630 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f630 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f630 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f630 - endif 7777 f630 - endif ; TMPMEMADDRESS > $1FFF 7778 f630 endif ; EXTRADLMEMORY 7779 f630 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f630 18 .byte.b >TMPMEMADDRESS 7781 f630 DLINDEX SET DLINDEX + 1 7767 f630 REPEND 7768 f630 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f631 - ifconst EXTRADLMEMORY 7770 f631 - if TMPMEMADDRESS > $1FFF 7771 f631 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f631 - else 7773 f631 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f631 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f631 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f631 - endif 7777 f631 - endif ; TMPMEMADDRESS > $1FFF 7778 f631 endif ; EXTRADLMEMORY 7779 f631 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f631 18 .byte.b >TMPMEMADDRESS 7781 f631 DLINDEX SET DLINDEX + 1 7767 f631 REPEND 7768 f631 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f632 - ifconst EXTRADLMEMORY 7770 f632 - if TMPMEMADDRESS > $1FFF 7771 f632 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f632 - else 7773 f632 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f632 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f632 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f632 - endif 7777 f632 - endif ; TMPMEMADDRESS > $1FFF 7778 f632 endif ; EXTRADLMEMORY 7779 f632 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f632 19 .byte.b >TMPMEMADDRESS 7781 f632 DLINDEX SET DLINDEX + 1 7767 f632 REPEND 7768 f632 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f633 - ifconst EXTRADLMEMORY 7770 f633 - if TMPMEMADDRESS > $1FFF 7771 f633 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f633 - else 7773 f633 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f633 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f633 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f633 - endif 7777 f633 - endif ; TMPMEMADDRESS > $1FFF 7778 f633 endif ; EXTRADLMEMORY 7779 f633 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f633 19 .byte.b >TMPMEMADDRESS 7781 f633 DLINDEX SET DLINDEX + 1 7767 f633 REPEND 7768 f633 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f634 - ifconst EXTRADLMEMORY 7770 f634 - if TMPMEMADDRESS > $1FFF 7771 f634 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f634 - else 7773 f634 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f634 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f634 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f634 - endif 7777 f634 - endif ; TMPMEMADDRESS > $1FFF 7778 f634 endif ; EXTRADLMEMORY 7779 f634 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f634 19 .byte.b >TMPMEMADDRESS 7781 f634 DLINDEX SET DLINDEX + 1 7767 f634 REPEND 7768 f634 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f635 - ifconst EXTRADLMEMORY 7770 f635 - if TMPMEMADDRESS > $1FFF 7771 f635 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f635 - else 7773 f635 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f635 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f635 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f635 - endif 7777 f635 - endif ; TMPMEMADDRESS > $1FFF 7778 f635 endif ; EXTRADLMEMORY 7779 f635 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f635 1a .byte.b >TMPMEMADDRESS 7781 f635 DLINDEX SET DLINDEX + 1 7767 f635 REPEND 7768 f635 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f636 - ifconst EXTRADLMEMORY 7770 f636 - if TMPMEMADDRESS > $1FFF 7771 f636 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f636 - else 7773 f636 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f636 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f636 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f636 - endif 7777 f636 - endif ; TMPMEMADDRESS > $1FFF 7778 f636 endif ; EXTRADLMEMORY 7779 f636 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f636 1a .byte.b >TMPMEMADDRESS 7781 f636 DLINDEX SET DLINDEX + 1 7767 f636 REPEND 7768 f636 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f637 - ifconst EXTRADLMEMORY 7770 f637 - if TMPMEMADDRESS > $1FFF 7771 f637 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f637 - else 7773 f637 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f637 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f637 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f637 - endif 7777 f637 - endif ; TMPMEMADDRESS > $1FFF 7778 f637 endif ; EXTRADLMEMORY 7779 f637 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f637 1a .byte.b >TMPMEMADDRESS 7781 f637 DLINDEX SET DLINDEX + 1 7767 f637 REPEND 7768 f637 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f638 - ifconst EXTRADLMEMORY 7770 f638 - if TMPMEMADDRESS > $1FFF 7771 f638 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f638 - else 7773 f638 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f638 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f638 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f638 - endif 7777 f638 - endif ; TMPMEMADDRESS > $1FFF 7778 f638 endif ; EXTRADLMEMORY 7779 f638 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f638 1b .byte.b >TMPMEMADDRESS 7781 f638 DLINDEX SET DLINDEX + 1 7767 f638 REPEND 7768 f638 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f639 - ifconst EXTRADLMEMORY 7770 f639 - if TMPMEMADDRESS > $1FFF 7771 f639 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f639 - else 7773 f639 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f639 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f639 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f639 - endif 7777 f639 - endif ; TMPMEMADDRESS > $1FFF 7778 f639 endif ; EXTRADLMEMORY 7779 f639 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f639 1b .byte.b >TMPMEMADDRESS 7781 f639 DLINDEX SET DLINDEX + 1 7767 f639 REPEND 7768 f639 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f63a - ifconst EXTRADLMEMORY 7770 f63a - if TMPMEMADDRESS > $1FFF 7771 f63a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f63a - else 7773 f63a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f63a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f63a -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f63a - endif 7777 f63a - endif ; TMPMEMADDRESS > $1FFF 7778 f63a endif ; EXTRADLMEMORY 7779 f63a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f63a 1b .byte.b >TMPMEMADDRESS 7781 f63a DLINDEX SET DLINDEX + 1 7767 f63a REPEND 7768 f63a TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f63b - ifconst EXTRADLMEMORY 7770 f63b - if TMPMEMADDRESS > $1FFF 7771 f63b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f63b - else 7773 f63b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f63b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f63b -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f63b - endif 7777 f63b - endif ; TMPMEMADDRESS > $1FFF 7778 f63b endif ; EXTRADLMEMORY 7779 f63b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f63b 1b .byte.b >TMPMEMADDRESS 7781 f63b DLINDEX SET DLINDEX + 1 7767 f63b REPEND 7768 f63b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f63c - ifconst EXTRADLMEMORY 7770 f63c - if TMPMEMADDRESS > $1FFF 7771 f63c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f63c - else 7773 f63c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f63c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f63c -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f63c - endif 7777 f63c - endif ; TMPMEMADDRESS > $1FFF 7778 f63c endif ; EXTRADLMEMORY 7779 f63c ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f63c 1c .byte.b >TMPMEMADDRESS 7781 f63c DLINDEX SET DLINDEX + 1 7767 f63c REPEND 7768 f63c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f63d - ifconst EXTRADLMEMORY 7770 f63d - if TMPMEMADDRESS > $1FFF 7771 f63d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f63d - else 7773 f63d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f63d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f63d -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f63d - endif 7777 f63d - endif ; TMPMEMADDRESS > $1FFF 7778 f63d endif ; EXTRADLMEMORY 7779 f63d ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f63d 1c .byte.b >TMPMEMADDRESS 7781 f63d DLINDEX SET DLINDEX + 1 7767 f63d REPEND 7768 f63d TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f63e - ifconst EXTRADLMEMORY 7770 f63e - if TMPMEMADDRESS > $1FFF 7771 f63e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f63e - else 7773 f63e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f63e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f63e -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f63e - endif 7777 f63e - endif ; TMPMEMADDRESS > $1FFF 7778 f63e endif ; EXTRADLMEMORY 7779 f63e ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f63e 1c .byte.b >TMPMEMADDRESS 7781 f63e DLINDEX SET DLINDEX + 1 7767 f63e REPEND 7768 f63e TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f63f - ifconst EXTRADLMEMORY 7770 f63f - if TMPMEMADDRESS > $1FFF 7771 f63f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f63f - else 7773 f63f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f63f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f63f -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f63f - endif 7777 f63f - endif ; TMPMEMADDRESS > $1FFF 7778 f63f endif ; EXTRADLMEMORY 7779 f63f ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f63f 1d .byte.b >TMPMEMADDRESS 7781 f63f DLINDEX SET DLINDEX + 1 7767 f63f REPEND 7768 f63f TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f640 - ifconst EXTRADLMEMORY 7770 f640 - if TMPMEMADDRESS > $1FFF 7771 f640 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f640 - else 7773 f640 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f640 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f640 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f640 - endif 7777 f640 - endif ; TMPMEMADDRESS > $1FFF 7778 f640 endif ; EXTRADLMEMORY 7779 f640 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f640 1d .byte.b >TMPMEMADDRESS 7781 f640 DLINDEX SET DLINDEX + 1 7767 f640 REPEND 7768 f640 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f641 - ifconst EXTRADLMEMORY 7770 f641 - if TMPMEMADDRESS > $1FFF 7771 f641 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f641 - else 7773 f641 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f641 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f641 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f641 - endif 7777 f641 - endif ; TMPMEMADDRESS > $1FFF 7778 f641 endif ; EXTRADLMEMORY 7779 f641 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f641 1d .byte.b >TMPMEMADDRESS 7781 f641 DLINDEX SET DLINDEX + 1 7767 f641 REPEND 7768 f641 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f642 - ifconst EXTRADLMEMORY 7770 f642 - if TMPMEMADDRESS > $1FFF 7771 f642 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f642 - else 7773 f642 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f642 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f642 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f642 - endif 7777 f642 - endif ; TMPMEMADDRESS > $1FFF 7778 f642 endif ; EXTRADLMEMORY 7779 f642 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f642 1e .byte.b >TMPMEMADDRESS 7781 f642 DLINDEX SET DLINDEX + 1 7767 f642 REPEND 7768 f642 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f643 - ifconst EXTRADLMEMORY 7770 f643 - if TMPMEMADDRESS > $1FFF 7771 f643 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f643 - else 7773 f643 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f643 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f643 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f643 - endif 7777 f643 - endif ; TMPMEMADDRESS > $1FFF 7778 f643 endif ; EXTRADLMEMORY 7779 f643 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f643 1e .byte.b >TMPMEMADDRESS 7781 f643 DLINDEX SET DLINDEX + 1 7767 f643 REPEND 7768 f643 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f644 - ifconst EXTRADLMEMORY 7770 f644 - if TMPMEMADDRESS > $1FFF 7771 f644 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f644 - else 7773 f644 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f644 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f644 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f644 - endif 7777 f644 - endif ; TMPMEMADDRESS > $1FFF 7778 f644 endif ; EXTRADLMEMORY 7779 f644 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f644 1e .byte.b >TMPMEMADDRESS 7781 f644 DLINDEX SET DLINDEX + 1 7767 f644 REPEND 7768 f644 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f645 - ifconst EXTRADLMEMORY 7770 f645 - if TMPMEMADDRESS > $1FFF 7771 f645 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f645 - else 7773 f645 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f645 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f645 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f645 - endif 7777 f645 - endif ; TMPMEMADDRESS > $1FFF 7778 f645 endif ; EXTRADLMEMORY 7779 f645 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f645 1f .byte.b >TMPMEMADDRESS 7781 f645 DLINDEX SET DLINDEX + 1 7767 f645 REPEND 7768 f645 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f646 - ifconst EXTRADLMEMORY 7770 f646 - if TMPMEMADDRESS > $1FFF 7771 f646 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f646 - else 7773 f646 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f646 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f646 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f646 - endif 7777 f646 - endif ; TMPMEMADDRESS > $1FFF 7778 f646 endif ; EXTRADLMEMORY 7779 f646 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f646 1f .byte.b >TMPMEMADDRESS 7781 f646 DLINDEX SET DLINDEX + 1 7767 f646 REPEND 7768 f646 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7769 f647 - ifconst EXTRADLMEMORY 7770 f647 - if TMPMEMADDRESS > $1FFF 7771 f647 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7772 f647 - else 7773 f647 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7774 f647 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7775 f647 -SECONDDLHALFSTART SET TMPMEMADDRESS 7776 f647 - endif 7777 f647 - endif ; TMPMEMADDRESS > $1FFF 7778 f647 endif ; EXTRADLMEMORY 7779 f647 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 7780 f647 1f .byte.b >TMPMEMADDRESS 7781 f647 DLINDEX SET DLINDEX + 1 7782 f648 REPEND 7783 f648 7784 f648 - ifconst EXTRADLMEMORY 7785 f648 - echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 7786 f648 endif 7787 f648 7788 f648 7789 f648 DLPOINTL 7790 f648 DLINDEX SET 0 7791 f648 REPEAT WZONECOUNT 7792 f648 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7793 f648 - ifconst EXTRADLMEMORY 7794 f648 - if TMPMEMADDRESS > $1FFF 7795 f648 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f648 - else 7797 f648 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f648 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f648 - endif 7800 f648 - endif ; TMPMEMADDRESS > $1FFF 7801 f648 endif ; EXTRADLMEMORY 7802 f648 80 .byte.b $1FFF 7795 f649 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f649 - else 7797 f649 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f649 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f649 - endif 7800 f649 - endif ; TMPMEMADDRESS > $1FFF 7801 f649 endif ; EXTRADLMEMORY 7802 f649 d0 .byte.b $1FFF 7795 f64a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f64a - else 7797 f64a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f64a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f64a - endif 7800 f64a - endif ; TMPMEMADDRESS > $1FFF 7801 f64a endif ; EXTRADLMEMORY 7802 f64a 20 .byte.b $1FFF 7795 f64b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f64b - else 7797 f64b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f64b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f64b - endif 7800 f64b - endif ; TMPMEMADDRESS > $1FFF 7801 f64b endif ; EXTRADLMEMORY 7802 f64b 70 .byte.b $1FFF 7795 f64c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f64c - else 7797 f64c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f64c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f64c - endif 7800 f64c - endif ; TMPMEMADDRESS > $1FFF 7801 f64c endif ; EXTRADLMEMORY 7802 f64c c0 .byte.b $1FFF 7795 f64d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f64d - else 7797 f64d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f64d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f64d - endif 7800 f64d - endif ; TMPMEMADDRESS > $1FFF 7801 f64d endif ; EXTRADLMEMORY 7802 f64d 10 .byte.b $1FFF 7795 f64e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f64e - else 7797 f64e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f64e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f64e - endif 7800 f64e - endif ; TMPMEMADDRESS > $1FFF 7801 f64e endif ; EXTRADLMEMORY 7802 f64e 60 .byte.b $1FFF 7795 f64f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f64f - else 7797 f64f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f64f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f64f - endif 7800 f64f - endif ; TMPMEMADDRESS > $1FFF 7801 f64f endif ; EXTRADLMEMORY 7802 f64f b0 .byte.b $1FFF 7795 f650 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f650 - else 7797 f650 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f650 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f650 - endif 7800 f650 - endif ; TMPMEMADDRESS > $1FFF 7801 f650 endif ; EXTRADLMEMORY 7802 f650 00 .byte.b $1FFF 7795 f651 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f651 - else 7797 f651 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f651 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f651 - endif 7800 f651 - endif ; TMPMEMADDRESS > $1FFF 7801 f651 endif ; EXTRADLMEMORY 7802 f651 50 .byte.b $1FFF 7795 f652 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f652 - else 7797 f652 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f652 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f652 - endif 7800 f652 - endif ; TMPMEMADDRESS > $1FFF 7801 f652 endif ; EXTRADLMEMORY 7802 f652 a0 .byte.b $1FFF 7795 f653 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f653 - else 7797 f653 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f653 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f653 - endif 7800 f653 - endif ; TMPMEMADDRESS > $1FFF 7801 f653 endif ; EXTRADLMEMORY 7802 f653 f0 .byte.b $1FFF 7795 f654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f654 - else 7797 f654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f654 - endif 7800 f654 - endif ; TMPMEMADDRESS > $1FFF 7801 f654 endif ; EXTRADLMEMORY 7802 f654 40 .byte.b $1FFF 7795 f655 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f655 - else 7797 f655 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f655 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f655 - endif 7800 f655 - endif ; TMPMEMADDRESS > $1FFF 7801 f655 endif ; EXTRADLMEMORY 7802 f655 90 .byte.b $1FFF 7795 f656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f656 - else 7797 f656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f656 - endif 7800 f656 - endif ; TMPMEMADDRESS > $1FFF 7801 f656 endif ; EXTRADLMEMORY 7802 f656 e0 .byte.b $1FFF 7795 f657 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f657 - else 7797 f657 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f657 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f657 - endif 7800 f657 - endif ; TMPMEMADDRESS > $1FFF 7801 f657 endif ; EXTRADLMEMORY 7802 f657 30 .byte.b $1FFF 7795 f658 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f658 - else 7797 f658 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f658 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f658 - endif 7800 f658 - endif ; TMPMEMADDRESS > $1FFF 7801 f658 endif ; EXTRADLMEMORY 7802 f658 80 .byte.b $1FFF 7795 f659 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f659 - else 7797 f659 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f659 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f659 - endif 7800 f659 - endif ; TMPMEMADDRESS > $1FFF 7801 f659 endif ; EXTRADLMEMORY 7802 f659 d0 .byte.b $1FFF 7795 f65a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f65a - else 7797 f65a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f65a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f65a - endif 7800 f65a - endif ; TMPMEMADDRESS > $1FFF 7801 f65a endif ; EXTRADLMEMORY 7802 f65a 20 .byte.b $1FFF 7795 f65b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f65b - else 7797 f65b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f65b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f65b - endif 7800 f65b - endif ; TMPMEMADDRESS > $1FFF 7801 f65b endif ; EXTRADLMEMORY 7802 f65b 70 .byte.b $1FFF 7795 f65c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f65c - else 7797 f65c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f65c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f65c - endif 7800 f65c - endif ; TMPMEMADDRESS > $1FFF 7801 f65c endif ; EXTRADLMEMORY 7802 f65c c0 .byte.b $1FFF 7795 f65d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f65d - else 7797 f65d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f65d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f65d - endif 7800 f65d - endif ; TMPMEMADDRESS > $1FFF 7801 f65d endif ; EXTRADLMEMORY 7802 f65d 10 .byte.b $1FFF 7795 f65e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f65e - else 7797 f65e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f65e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f65e - endif 7800 f65e - endif ; TMPMEMADDRESS > $1FFF 7801 f65e endif ; EXTRADLMEMORY 7802 f65e 60 .byte.b $1FFF 7795 f65f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7796 f65f - else 7797 f65f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7798 f65f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7799 f65f - endif 7800 f65f - endif ; TMPMEMADDRESS > $1FFF 7801 f65f endif ; EXTRADLMEMORY 7802 f65f b0 .byte.b $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 18 80 ZONE0ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 18 d0 ZONE1ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 19 20 ZONE2ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 19 70 ZONE3ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 19 c0 ZONE4ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1a 10 ZONE5ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1a 60 ZONE6ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1a b0 ZONE7ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1b 00 ZONE8ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1b 50 ZONE9ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1b a0 ZONE10ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1b f0 ZONE11ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1c 40 ZONE12ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1c 90 ZONE13ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1c e0 ZONE14ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1d 30 ZONE15ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1d 80 ZONE16ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1d d0 ZONE17ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1e 20 ZONE18ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1e 70 ZONE19ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1e c0 ZONE20ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1f 10 ZONE21ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1f 60 ZONE22ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7808 f660 REPEND 7809 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 7810 f660 - ifconst EXTRADLMEMORY 7811 f660 - if TMPMEMADDRESS > $1FFF 7812 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7813 f660 - else 7814 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 7815 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 7816 f660 - endif 7817 f660 - endif ; TMPMEMADDRESS > $1FFF 7818 f660 endif ; EXTRADLMEMORY 7819 f660 7820 f660 1f b0 ZONE23ADDRESS = TMPMEMADDRESS 7821 f660 7822 f660 DLINDEX SET DLINDEX + 1 7823 f660 REPEND 7824 f660 7825 f660 $1880 to $1fff used as zone memory, allowing 15 display objects per zone. 7826 f660 echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 7827 f660 7828 f660 DLHEIGHT 7829 f660 REPEAT WZONECOUNT 7830 f660 07 .byte.b (WZONEHEIGHT-1) 7829 f660 REPEND 7830 f661 07 .byte.b (WZONEHEIGHT-1) 7829 f661 REPEND 7830 f662 07 .byte.b (WZONEHEIGHT-1) 7829 f662 REPEND 7830 f663 07 .byte.b (WZONEHEIGHT-1) 7829 f663 REPEND 7830 f664 07 .byte.b (WZONEHEIGHT-1) 7829 f664 REPEND 7830 f665 07 .byte.b (WZONEHEIGHT-1) 7829 f665 REPEND 7830 f666 07 .byte.b (WZONEHEIGHT-1) 7829 f666 REPEND 7830 f667 07 .byte.b (WZONEHEIGHT-1) 7829 f667 REPEND 7830 f668 07 .byte.b (WZONEHEIGHT-1) 7829 f668 REPEND 7830 f669 07 .byte.b (WZONEHEIGHT-1) 7829 f669 REPEND 7830 f66a 07 .byte.b (WZONEHEIGHT-1) 7829 f66a REPEND 7830 f66b 07 .byte.b (WZONEHEIGHT-1) 7829 f66b REPEND 7830 f66c 07 .byte.b (WZONEHEIGHT-1) 7829 f66c REPEND 7830 f66d 07 .byte.b (WZONEHEIGHT-1) 7829 f66d REPEND 7830 f66e 07 .byte.b (WZONEHEIGHT-1) 7829 f66e REPEND 7830 f66f 07 .byte.b (WZONEHEIGHT-1) 7829 f66f REPEND 7830 f670 07 .byte.b (WZONEHEIGHT-1) 7829 f670 REPEND 7830 f671 07 .byte.b (WZONEHEIGHT-1) 7829 f671 REPEND 7830 f672 07 .byte.b (WZONEHEIGHT-1) 7829 f672 REPEND 7830 f673 07 .byte.b (WZONEHEIGHT-1) 7829 f673 REPEND 7830 f674 07 .byte.b (WZONEHEIGHT-1) 7829 f674 REPEND 7830 f675 07 .byte.b (WZONEHEIGHT-1) 7829 f675 REPEND 7830 f676 07 .byte.b (WZONEHEIGHT-1) 7829 f676 REPEND 7830 f677 07 .byte.b (WZONEHEIGHT-1) 7831 f678 REPEND 7832 f678 7833 f678 ; Provided under the CC0 license. See the included LICENSE.txt for details. 7834 f678 7835 f678 ; a simple guard, than ensures the 7800basic code hasn't 7836 f678 ; spilled into the encryption area... 2310 bytes left in the 7800basic reserved area. 7837 f678 echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 7838 f678 - if (*>$FF7D) 7839 f678 - ERR ; abort the assembly 7840 f678 endif 7841 f678 ; Provided under the CC0 license. See the included LICENSE.txt for details. 7842 f678 7843 f678 - ifconst DEV 7844 f678 - ifnconst ZONEHEIGHT 7845 f678 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 7846 f678 - else 7847 f678 - if ZONEHEIGHT = 8 7848 f678 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 7849 f678 - else 7850 f678 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 7851 f678 - endif 7852 f678 - endif 7853 f678 endif 7854 f678 7855 f678 ; FF7E/FF7F contains the 7800basic crc checksum word 7856 f678 7857 f678 ; FF80 - FFF7 contains the 7800 encryption key 7858 f678 7859 f678 ifnconst bankswitchmode 7860 fff8 ORG $FFF8 7861 fff8 - else 7862 fff8 - ifconst ROM128K 7863 fff8 - ORG $27FF8 7864 fff8 - RORG $FFF8 7865 fff8 - endif 7866 fff8 - ifconst ROM144K 7867 fff8 - ORG $27FF8 7868 fff8 - RORG $FFF8 7869 fff8 - endif 7870 fff8 - ifconst ROM256K 7871 fff8 - ORG $47FF8 7872 fff8 - RORG $FFF8 7873 fff8 - endif 7874 fff8 - ifconst ROM272K 7875 fff8 - ORG $47FF8 7876 fff8 - RORG $FFF8 7877 fff8 - endif 7878 fff8 - ifconst ROM512K 7879 fff8 - ORG $87FF8 7880 fff8 - RORG $FFF8 7881 fff8 - endif 7882 fff8 - ifconst ROM528K 7883 fff8 - ORG $87FF8 7884 fff8 - RORG $FFF8 7885 fff8 - endif 7886 fff8 endif 7887 fff8 7888 fff8 7889 fff8 ff .byte.b $FF ; region verification. $FF=all regions 7890 fff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 7891 fffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 7892 fffa 7893 fffa ;Vectors 7894 fffa 00 f0 .word.w NMI 7895 fffc 72 f5 .word.w START 7896 fffe 67 f0 .word.w IRQ 7897 10000