------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite2.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_enemy01_tallsprite_01_mode = $00 76 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_width_twoscompliment = $00 77 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_width = $00 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 90 sfx_explosion_length = .skipL0293-sfx_explosion 103 10000 ???? 104 10000 ???? 00 30 sfx_plainlaser_length = .skipL0292-sfx_plainlaser 105 10000 ???? 106 10000 ???? 00 54 sfx_pulsecannon_length = .skipL0291-sfx_pulsecannon 107 10000 ???? 108 10000 ???? 00 36 sfx_bling_length = .skipL0290-sfx_bling 109 10000 ???? 110 10000 ???? 00 04 vertical_shooting_laser_tallsprite_00_color3 = $04 111 10000 ???? 00 42 vertical_shooting_laser_tallsprite_00_color2 = $42 112 10000 ???? 00 0f vertical_shooting_laser_tallsprite_00_color1 = $0f 113 10000 ???? 00 00 vertical_shooting_laser_tallsprite_00_color0 = $00 114 10000 ???? 00 04 vertical_shooting_laser_color3 = $04 115 10000 ???? 00 42 vertical_shooting_laser_color2 = $42 116 10000 ???? 00 0f vertical_shooting_laser_color1 = $0f 117 10000 ???? 00 00 vertical_shooting_laser_color0 = $00 118 10000 ???? 00 33 vertical_shooting_explosion_10_tallsprite_00_color3 = $33 119 10000 ???? 00 2b vertical_shooting_explosion_10_tallsprite_00_color2 = $2b 120 10000 ???? 00 36 vertical_shooting_explosion_10_tallsprite_00_color1 = $36 121 10000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_color0 = $00 122 10000 ???? 00 33 vertical_shooting_explosion_10_color3 = $33 123 10000 ???? 00 2b vertical_shooting_explosion_10_color2 = $2b 124 10000 ???? 00 36 vertical_shooting_explosion_10_color1 = $36 125 10000 ???? 00 00 vertical_shooting_explosion_10_color0 = $00 126 10000 ???? 00 33 vertical_shooting_explosion_09_tallsprite_00_color3 = $33 127 10000 ???? 00 2b vertical_shooting_explosion_09_tallsprite_00_color2 = $2b 128 10000 ???? 00 36 vertical_shooting_explosion_09_tallsprite_00_color1 = $36 129 10000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_color0 = $00 130 10000 ???? 00 33 vertical_shooting_explosion_09_color3 = $33 131 10000 ???? 00 2b vertical_shooting_explosion_09_color2 = $2b 132 10000 ???? 00 36 vertical_shooting_explosion_09_color1 = $36 133 10000 ???? 00 00 vertical_shooting_explosion_09_color0 = $00 134 10000 ???? 00 33 vertical_shooting_explosion_08_tallsprite_00_color3 = $33 135 10000 ???? 00 2b vertical_shooting_explosion_08_tallsprite_00_color2 = $2b 136 10000 ???? 00 36 vertical_shooting_explosion_08_tallsprite_00_color1 = $36 137 10000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_color0 = $00 138 10000 ???? 00 33 vertical_shooting_explosion_08_color3 = $33 139 10000 ???? 00 2b vertical_shooting_explosion_08_color2 = $2b 140 10000 ???? 00 36 vertical_shooting_explosion_08_color1 = $36 141 10000 ???? 00 00 vertical_shooting_explosion_08_color0 = $00 142 10000 ???? 00 33 vertical_shooting_explosion_07_tallsprite_00_color3 = $33 143 10000 ???? 00 2b vertical_shooting_explosion_07_tallsprite_00_color2 = $2b 144 10000 ???? 00 36 vertical_shooting_explosion_07_tallsprite_00_color1 = $36 145 10000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_color0 = $00 146 10000 ???? 00 33 vertical_shooting_explosion_07_color3 = $33 147 10000 ???? 00 2b vertical_shooting_explosion_07_color2 = $2b 148 10000 ???? 00 36 vertical_shooting_explosion_07_color1 = $36 149 10000 ???? 00 00 vertical_shooting_explosion_07_color0 = $00 150 10000 ???? 00 33 vertical_shooting_explosion_06_tallsprite_00_color3 = $33 151 10000 ???? 00 2b vertical_shooting_explosion_06_tallsprite_00_color2 = $2b 152 10000 ???? 00 36 vertical_shooting_explosion_06_tallsprite_00_color1 = $36 153 10000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_color0 = $00 154 10000 ???? 00 33 vertical_shooting_explosion_06_color3 = $33 155 10000 ???? 00 2b vertical_shooting_explosion_06_color2 = $2b 156 10000 ???? 00 36 vertical_shooting_explosion_06_color1 = $36 157 10000 ???? 00 00 vertical_shooting_explosion_06_color0 = $00 158 10000 ???? 00 33 vertical_shooting_explosion_05_tallsprite_00_color3 = $33 159 10000 ???? 00 2b vertical_shooting_explosion_05_tallsprite_00_color2 = $2b 160 10000 ???? 00 36 vertical_shooting_explosion_05_tallsprite_00_color1 = $36 161 10000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_color0 = $00 162 10000 ???? 00 33 vertical_shooting_explosion_05_color3 = $33 163 10000 ???? 00 2b vertical_shooting_explosion_05_color2 = $2b 164 10000 ???? 00 36 vertical_shooting_explosion_05_color1 = $36 165 10000 ???? 00 00 vertical_shooting_explosion_05_color0 = $00 166 10000 ???? 00 33 vertical_shooting_explosion_04_tallsprite_00_color3 = $33 167 10000 ???? 00 36 vertical_shooting_explosion_04_tallsprite_00_color2 = $36 168 10000 ???? 00 2b vertical_shooting_explosion_04_tallsprite_00_color1 = $2b 169 10000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_color0 = $00 170 10000 ???? 00 33 vertical_shooting_explosion_04_color3 = $33 171 10000 ???? 00 36 vertical_shooting_explosion_04_color2 = $36 172 10000 ???? 00 2b vertical_shooting_explosion_04_color1 = $2b 173 10000 ???? 00 00 vertical_shooting_explosion_04_color0 = $00 174 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color3 = 0 175 10000 ???? 00 36 vertical_shooting_explosion_03_tallsprite_00_color2 = $36 176 10000 ???? 00 2b vertical_shooting_explosion_03_tallsprite_00_color1 = $2b 177 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color0 = $00 178 10000 ???? 00 00 vertical_shooting_explosion_03_color3 = 0 179 10000 ???? 00 36 vertical_shooting_explosion_03_color2 = $36 180 10000 ???? 00 2b vertical_shooting_explosion_03_color1 = $2b 181 10000 ???? 00 00 vertical_shooting_explosion_03_color0 = $00 182 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color3 = 0 183 10000 ???? 00 36 vertical_shooting_explosion_02_tallsprite_00_color2 = $36 184 10000 ???? 00 2b vertical_shooting_explosion_02_tallsprite_00_color1 = $2b 185 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color0 = $00 186 10000 ???? 00 00 vertical_shooting_explosion_02_color3 = 0 187 10000 ???? 00 36 vertical_shooting_explosion_02_color2 = $36 188 10000 ???? 00 2b vertical_shooting_explosion_02_color1 = $2b 189 10000 ???? 00 00 vertical_shooting_explosion_02_color0 = $00 190 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color3 = 0 191 10000 ???? 00 2b vertical_shooting_explosion_01_tallsprite_00_color2 = $2b 192 10000 ???? 00 36 vertical_shooting_explosion_01_tallsprite_00_color1 = $36 193 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color0 = $00 194 10000 ???? 00 00 vertical_shooting_explosion_01_color3 = 0 195 10000 ???? 00 2b vertical_shooting_explosion_01_color2 = $2b 196 10000 ???? 00 36 vertical_shooting_explosion_01_color1 = $36 197 10000 ???? 00 00 vertical_shooting_explosion_01_color0 = $00 198 10000 ???? 00 0f vertical_shooting_1up_color3 = $0f 199 10000 ???? 00 42 vertical_shooting_1up_color2 = $42 200 10000 ???? 00 04 vertical_shooting_1up_color1 = $04 201 10000 ???? 00 00 vertical_shooting_1up_color0 = $00 202 10000 ???? 00 83 vertical_shooting_enemy01_tallsprite_00_color3 = $83 203 10000 ???? 00 a8 vertical_shooting_enemy01_tallsprite_00_color2 = $a8 204 10000 ???? 00 bc vertical_shooting_enemy01_tallsprite_00_color1 = $bc 205 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_color0 = $00 206 10000 ???? 00 83 vertical_shooting_enemy01_color3 = $83 207 10000 ???? 00 a8 vertical_shooting_enemy01_color2 = $a8 208 10000 ???? 00 bc vertical_shooting_enemy01_color1 = $bc 209 10000 ???? 00 00 vertical_shooting_enemy01_color0 = $00 210 10000 ???? 00 36 vertical_shooting_powerup_color3 = $36 211 10000 ???? 00 33 vertical_shooting_powerup_color2 = $33 212 10000 ???? 00 2b vertical_shooting_powerup_color1 = $2b 213 10000 ???? 00 00 vertical_shooting_powerup_color0 = $00 214 10000 ???? 00 bc vertical_shooting_enemyshot_color3 = $bc 215 10000 ???? 00 83 vertical_shooting_enemyshot_color2 = $83 216 10000 ???? 00 a8 vertical_shooting_enemyshot_color1 = $a8 217 10000 ???? 00 00 vertical_shooting_enemyshot_color0 = $00 218 10000 ???? 00 1d vertical_shooting_bullet_color3 = $1d 219 10000 ???? 00 18 vertical_shooting_bullet_color2 = $18 220 10000 ???? 00 0f vertical_shooting_bullet_color1 = $0f 221 10000 ???? 00 00 vertical_shooting_bullet_color0 = $00 222 10000 ???? 00 42 vertical_shooting_ship_tallsprite_00_color3 = $42 223 10000 ???? 00 04 vertical_shooting_ship_tallsprite_00_color2 = $04 224 10000 ???? 00 0f vertical_shooting_ship_tallsprite_00_color1 = $0f 225 10000 ???? 00 00 vertical_shooting_ship_tallsprite_00_color0 = $00 226 10000 ???? 00 42 vertical_shooting_ship_color3 = $42 227 10000 ???? 00 04 vertical_shooting_ship_color2 = $04 228 10000 ???? 00 0f vertical_shooting_ship_color1 = $0f 229 10000 ???? 00 00 vertical_shooting_ship_color0 = $00 230 10000 ???? 00 0f vertical_shooting_font_color1 = $0f 231 10000 ???? 00 00 vertical_shooting_font_color0 = $00 232 10000 ???? 01 6f joyposdown = var47 233 10000 ???? 234 10000 ???? 01 6e joyposup = var46 235 10000 ???? 236 10000 ???? 01 6d joyposright = var45 237 10000 ???? 238 10000 ???? 01 6c joyposleft = var44 239 10000 ???? 240 10000 ???? 01 6b explosion_aniframe = var43 241 10000 ???? 242 10000 ???? 01 6a continue_flag = var42 243 10000 ???? 244 10000 ???? 01 69 gameover_flag = var41 245 10000 ???? 246 10000 ???? 01 68 isDead_flag = var40 247 10000 ???? 248 10000 ???? 01 67 lives = var39 249 10000 ???? 250 10000 ???? 01 66 twinlaser_Slowdown = var38 251 10000 ???? 252 10000 ???? 01 65 twinlaser_flag = var37 253 10000 ???? 254 10000 ???? 01 64 twinlaserY = var36 255 10000 ???? 256 10000 ???? 01 63 twinlaserX = var35 257 10000 ???? 258 10000 ???? 01 62 rDirection = var34 259 10000 ???? 260 10000 ???? 01 61 rMovement6 = var33 261 10000 ???? 262 10000 ???? 01 60 rMovement5 = var32 263 10000 ???? 264 10000 ???? 01 5f rMovement4 = var31 265 10000 ???? 266 10000 ???? 01 5e rMovement3 = var30 267 10000 ???? 268 10000 ???? 01 5d rMovement2 = var29 269 10000 ???? 270 10000 ???? 01 5c rMovement1 = var28 271 10000 ???? 272 10000 ???? 01 5b enemy_shotSlowdown = var27 273 10000 ???? 274 10000 ???? 01 5a enemy_shotFlag = var26 275 10000 ???? 276 10000 ???? 01 59 enemy_shotY = var25 277 10000 ???? 278 10000 ???? 01 58 enemy_shotX = var24 279 10000 ???? 280 10000 ???? 01 57 enemy01_speed = var23 281 10000 ???? 282 10000 ???? 01 56 enemy01_Slowdown = var22 283 10000 ???? 284 10000 ???? 01 55 enemy01_Flag = var21 285 10000 ???? 286 10000 ???? 01 54 enemy01_Y = var20 287 10000 ???? 288 10000 ???? 01 53 enemy01_X = var19 289 10000 ???? 290 10000 ???? 01 52 power_upSlowdown = var18 291 10000 ???? 292 10000 ???? 01 51 power_upFlag = var17 293 10000 ???? 294 10000 ???? 01 50 power_upY = var16 295 10000 ???? 296 10000 ???? 01 4f power_upX = var15 297 10000 ???? 298 10000 ???? 01 4e extra_shipFlag = var14 299 10000 ???? 300 10000 ???? 01 4d extra_shipY = var13 301 10000 ???? 302 10000 ???? 01 4c extra_shipX = var12 303 10000 ???? 304 10000 ???? 01 4b bulletSlowdown = var11 305 10000 ???? 306 10000 ???? 01 4a bulletY = var10 307 10000 ???? 308 10000 ???? 01 49 bulletX = var9 309 10000 ???? 310 10000 ???? 01 48 controller_button2_counter = var8 311 10000 ???? 312 10000 ???? 01 47 controller_button1_counter = var7 313 10000 ???? 314 10000 ???? 01 46 controller_button2_hold_bit6 = var6 315 10000 ???? 316 10000 ???? 01 46 controller_button2_tap_bit5 = var6 317 10000 ???? 318 10000 ???? 01 46 controller_button2_press_bit4 = var6 319 10000 ???? 320 10000 ???? 01 45 controller_button1_hold_bit3 = var5 321 10000 ???? 322 10000 ???? 01 45 controller_button1_tap_bit2 = var5 323 10000 ???? 324 10000 ???? 01 45 controller_button1_press_bit1 = var5 325 10000 ???? 326 10000 ???? 01 45 controller_button_debounce_bit0 = var5 327 10000 ???? 328 10000 ???? 01 45 controllerButtonState = var5 329 10000 ???? 330 10000 ???? 01 44 controller_down_bit4 = var4 331 10000 ???? 332 10000 ???? 01 44 controller_up_bit3 = var4 333 10000 ???? 334 10000 ???? 01 44 controller_right_bit2 = var4 335 10000 ???? 336 10000 ???? 01 44 controller_left_bit1 = var4 337 10000 ???? 338 10000 ???? 01 44 controller_debounce_bit0 = var4 339 10000 ???? 340 10000 ???? 01 44 controllerState = var4 341 10000 ???? 342 10000 ???? 01 43 playerFlag = var3 343 10000 ???? 344 10000 ???? 01 42 playerY = var2 345 10000 ???? 346 10000 ???? 01 41 playerX = var1 347 10000 ???? 348 10000 ???? 01 40 frameCounter = var0 349 10000 ???? 350 10000 ???? 00 01 collisionwrap = 1 351 10000 ???? 00 01 NTSC = 1 352 10000 ???? 00 c0 SCREENHEIGHT = 192 353 10000 ???? 00 01 CHECKOVERWRITE = 1 354 10000 ???? 00 08 ZONEHEIGHT = 8 355 10000 ???? 00 01 ROM48K = 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_Vertical_Shooter_Rewrite2.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_enemy01_tallsprite_01_mode = $00 76 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_width_twoscompliment = $00 77 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_width = $00 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 90 sfx_explosion_length = .skipL0293-sfx_explosion 103 10000 ???? 104 10000 ???? 00 30 sfx_plainlaser_length = .skipL0292-sfx_plainlaser 105 10000 ???? 106 10000 ???? 00 54 sfx_pulsecannon_length = .skipL0291-sfx_pulsecannon 107 10000 ???? 108 10000 ???? 00 36 sfx_bling_length = .skipL0290-sfx_bling 109 10000 ???? 110 10000 ???? 00 04 vertical_shooting_laser_tallsprite_00_color3 = $04 111 10000 ???? 00 42 vertical_shooting_laser_tallsprite_00_color2 = $42 112 10000 ???? 00 0f vertical_shooting_laser_tallsprite_00_color1 = $0f 113 10000 ???? 00 00 vertical_shooting_laser_tallsprite_00_color0 = $00 114 10000 ???? 00 04 vertical_shooting_laser_color3 = $04 115 10000 ???? 00 42 vertical_shooting_laser_color2 = $42 116 10000 ???? 00 0f vertical_shooting_laser_color1 = $0f 117 10000 ???? 00 00 vertical_shooting_laser_color0 = $00 118 10000 ???? 00 33 vertical_shooting_explosion_10_tallsprite_00_color3 = $33 119 10000 ???? 00 2b vertical_shooting_explosion_10_tallsprite_00_color2 = $2b 120 10000 ???? 00 36 vertical_shooting_explosion_10_tallsprite_00_color1 = $36 121 10000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_color0 = $00 122 10000 ???? 00 33 vertical_shooting_explosion_10_color3 = $33 123 10000 ???? 00 2b vertical_shooting_explosion_10_color2 = $2b 124 10000 ???? 00 36 vertical_shooting_explosion_10_color1 = $36 125 10000 ???? 00 00 vertical_shooting_explosion_10_color0 = $00 126 10000 ???? 00 33 vertical_shooting_explosion_09_tallsprite_00_color3 = $33 127 10000 ???? 00 2b vertical_shooting_explosion_09_tallsprite_00_color2 = $2b 128 10000 ???? 00 36 vertical_shooting_explosion_09_tallsprite_00_color1 = $36 129 10000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_color0 = $00 130 10000 ???? 00 33 vertical_shooting_explosion_09_color3 = $33 131 10000 ???? 00 2b vertical_shooting_explosion_09_color2 = $2b 132 10000 ???? 00 36 vertical_shooting_explosion_09_color1 = $36 133 10000 ???? 00 00 vertical_shooting_explosion_09_color0 = $00 134 10000 ???? 00 33 vertical_shooting_explosion_08_tallsprite_00_color3 = $33 135 10000 ???? 00 2b vertical_shooting_explosion_08_tallsprite_00_color2 = $2b 136 10000 ???? 00 36 vertical_shooting_explosion_08_tallsprite_00_color1 = $36 137 10000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_color0 = $00 138 10000 ???? 00 33 vertical_shooting_explosion_08_color3 = $33 139 10000 ???? 00 2b vertical_shooting_explosion_08_color2 = $2b 140 10000 ???? 00 36 vertical_shooting_explosion_08_color1 = $36 141 10000 ???? 00 00 vertical_shooting_explosion_08_color0 = $00 142 10000 ???? 00 33 vertical_shooting_explosion_07_tallsprite_00_color3 = $33 143 10000 ???? 00 2b vertical_shooting_explosion_07_tallsprite_00_color2 = $2b 144 10000 ???? 00 36 vertical_shooting_explosion_07_tallsprite_00_color1 = $36 145 10000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_color0 = $00 146 10000 ???? 00 33 vertical_shooting_explosion_07_color3 = $33 147 10000 ???? 00 2b vertical_shooting_explosion_07_color2 = $2b 148 10000 ???? 00 36 vertical_shooting_explosion_07_color1 = $36 149 10000 ???? 00 00 vertical_shooting_explosion_07_color0 = $00 150 10000 ???? 00 33 vertical_shooting_explosion_06_tallsprite_00_color3 = $33 151 10000 ???? 00 2b vertical_shooting_explosion_06_tallsprite_00_color2 = $2b 152 10000 ???? 00 36 vertical_shooting_explosion_06_tallsprite_00_color1 = $36 153 10000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_color0 = $00 154 10000 ???? 00 33 vertical_shooting_explosion_06_color3 = $33 155 10000 ???? 00 2b vertical_shooting_explosion_06_color2 = $2b 156 10000 ???? 00 36 vertical_shooting_explosion_06_color1 = $36 157 10000 ???? 00 00 vertical_shooting_explosion_06_color0 = $00 158 10000 ???? 00 33 vertical_shooting_explosion_05_tallsprite_00_color3 = $33 159 10000 ???? 00 2b vertical_shooting_explosion_05_tallsprite_00_color2 = $2b 160 10000 ???? 00 36 vertical_shooting_explosion_05_tallsprite_00_color1 = $36 161 10000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_color0 = $00 162 10000 ???? 00 33 vertical_shooting_explosion_05_color3 = $33 163 10000 ???? 00 2b vertical_shooting_explosion_05_color2 = $2b 164 10000 ???? 00 36 vertical_shooting_explosion_05_color1 = $36 165 10000 ???? 00 00 vertical_shooting_explosion_05_color0 = $00 166 10000 ???? 00 33 vertical_shooting_explosion_04_tallsprite_00_color3 = $33 167 10000 ???? 00 36 vertical_shooting_explosion_04_tallsprite_00_color2 = $36 168 10000 ???? 00 2b vertical_shooting_explosion_04_tallsprite_00_color1 = $2b 169 10000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_color0 = $00 170 10000 ???? 00 33 vertical_shooting_explosion_04_color3 = $33 171 10000 ???? 00 36 vertical_shooting_explosion_04_color2 = $36 172 10000 ???? 00 2b vertical_shooting_explosion_04_color1 = $2b 173 10000 ???? 00 00 vertical_shooting_explosion_04_color0 = $00 174 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color3 = 0 175 10000 ???? 00 36 vertical_shooting_explosion_03_tallsprite_00_color2 = $36 176 10000 ???? 00 2b vertical_shooting_explosion_03_tallsprite_00_color1 = $2b 177 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color0 = $00 178 10000 ???? 00 00 vertical_shooting_explosion_03_color3 = 0 179 10000 ???? 00 36 vertical_shooting_explosion_03_color2 = $36 180 10000 ???? 00 2b vertical_shooting_explosion_03_color1 = $2b 181 10000 ???? 00 00 vertical_shooting_explosion_03_color0 = $00 182 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color3 = 0 183 10000 ???? 00 36 vertical_shooting_explosion_02_tallsprite_00_color2 = $36 184 10000 ???? 00 2b vertical_shooting_explosion_02_tallsprite_00_color1 = $2b 185 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color0 = $00 186 10000 ???? 00 00 vertical_shooting_explosion_02_color3 = 0 187 10000 ???? 00 36 vertical_shooting_explosion_02_color2 = $36 188 10000 ???? 00 2b vertical_shooting_explosion_02_color1 = $2b 189 10000 ???? 00 00 vertical_shooting_explosion_02_color0 = $00 190 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color3 = 0 191 10000 ???? 00 2b vertical_shooting_explosion_01_tallsprite_00_color2 = $2b 192 10000 ???? 00 36 vertical_shooting_explosion_01_tallsprite_00_color1 = $36 193 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color0 = $00 194 10000 ???? 00 00 vertical_shooting_explosion_01_color3 = 0 195 10000 ???? 00 2b vertical_shooting_explosion_01_color2 = $2b 196 10000 ???? 00 36 vertical_shooting_explosion_01_color1 = $36 197 10000 ???? 00 00 vertical_shooting_explosion_01_color0 = $00 198 10000 ???? 00 0f vertical_shooting_1up_color3 = $0f 199 10000 ???? 00 42 vertical_shooting_1up_color2 = $42 200 10000 ???? 00 04 vertical_shooting_1up_color1 = $04 201 10000 ???? 00 00 vertical_shooting_1up_color0 = $00 202 10000 ???? 00 83 vertical_shooting_enemy01_tallsprite_00_color3 = $83 203 10000 ???? 00 a8 vertical_shooting_enemy01_tallsprite_00_color2 = $a8 204 10000 ???? 00 bc vertical_shooting_enemy01_tallsprite_00_color1 = $bc 205 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_color0 = $00 206 10000 ???? 00 83 vertical_shooting_enemy01_color3 = $83 207 10000 ???? 00 a8 vertical_shooting_enemy01_color2 = $a8 208 10000 ???? 00 bc vertical_shooting_enemy01_color1 = $bc 209 10000 ???? 00 00 vertical_shooting_enemy01_color0 = $00 210 10000 ???? 00 36 vertical_shooting_powerup_color3 = $36 211 10000 ???? 00 33 vertical_shooting_powerup_color2 = $33 212 10000 ???? 00 2b vertical_shooting_powerup_color1 = $2b 213 10000 ???? 00 00 vertical_shooting_powerup_color0 = $00 214 10000 ???? 00 bc vertical_shooting_enemyshot_color3 = $bc 215 10000 ???? 00 83 vertical_shooting_enemyshot_color2 = $83 216 10000 ???? 00 a8 vertical_shooting_enemyshot_color1 = $a8 217 10000 ???? 00 00 vertical_shooting_enemyshot_color0 = $00 218 10000 ???? 00 1d vertical_shooting_bullet_color3 = $1d 219 10000 ???? 00 18 vertical_shooting_bullet_color2 = $18 220 10000 ???? 00 0f vertical_shooting_bullet_color1 = $0f 221 10000 ???? 00 00 vertical_shooting_bullet_color0 = $00 222 10000 ???? 00 42 vertical_shooting_ship_tallsprite_00_color3 = $42 223 10000 ???? 00 04 vertical_shooting_ship_tallsprite_00_color2 = $04 224 10000 ???? 00 0f vertical_shooting_ship_tallsprite_00_color1 = $0f 225 10000 ???? 00 00 vertical_shooting_ship_tallsprite_00_color0 = $00 226 10000 ???? 00 42 vertical_shooting_ship_color3 = $42 227 10000 ???? 00 04 vertical_shooting_ship_color2 = $04 228 10000 ???? 00 0f vertical_shooting_ship_color1 = $0f 229 10000 ???? 00 00 vertical_shooting_ship_color0 = $00 230 10000 ???? 00 0f vertical_shooting_font_color1 = $0f 231 10000 ???? 00 00 vertical_shooting_font_color0 = $00 232 10000 ???? 01 6f joyposdown = var47 233 10000 ???? 234 10000 ???? 01 6e joyposup = var46 235 10000 ???? 236 10000 ???? 01 6d joyposright = var45 237 10000 ???? 238 10000 ???? 01 6c joyposleft = var44 239 10000 ???? 240 10000 ???? 01 6b explosion_aniframe = var43 241 10000 ???? 242 10000 ???? 01 6a continue_flag = var42 243 10000 ???? 244 10000 ???? 01 69 gameover_flag = var41 245 10000 ???? 246 10000 ???? 01 68 isDead_flag = var40 247 10000 ???? 248 10000 ???? 01 67 lives = var39 249 10000 ???? 250 10000 ???? 01 66 twinlaser_Slowdown = var38 251 10000 ???? 252 10000 ???? 01 65 twinlaser_flag = var37 253 10000 ???? 254 10000 ???? 01 64 twinlaserY = var36 255 10000 ???? 256 10000 ???? 01 63 twinlaserX = var35 257 10000 ???? 258 10000 ???? 01 62 rDirection = var34 259 10000 ???? 260 10000 ???? 01 61 rMovement6 = var33 261 10000 ???? 262 10000 ???? 01 60 rMovement5 = var32 263 10000 ???? 264 10000 ???? 01 5f rMovement4 = var31 265 10000 ???? 266 10000 ???? 01 5e rMovement3 = var30 267 10000 ???? 268 10000 ???? 01 5d rMovement2 = var29 269 10000 ???? 270 10000 ???? 01 5c rMovement1 = var28 271 10000 ???? 272 10000 ???? 01 5b enemy_shotSlowdown = var27 273 10000 ???? 274 10000 ???? 01 5a enemy_shotFlag = var26 275 10000 ???? 276 10000 ???? 01 59 enemy_shotY = var25 277 10000 ???? 278 10000 ???? 01 58 enemy_shotX = var24 279 10000 ???? 280 10000 ???? 01 57 enemy01_speed = var23 281 10000 ???? 282 10000 ???? 01 56 enemy01_Slowdown = var22 283 10000 ???? 284 10000 ???? 01 55 enemy01_Flag = var21 285 10000 ???? 286 10000 ???? 01 54 enemy01_Y = var20 287 10000 ???? 288 10000 ???? 01 53 enemy01_X = var19 289 10000 ???? 290 10000 ???? 01 52 power_upSlowdown = var18 291 10000 ???? 292 10000 ???? 01 51 power_upFlag = var17 293 10000 ???? 294 10000 ???? 01 50 power_upY = var16 295 10000 ???? 296 10000 ???? 01 4f power_upX = var15 297 10000 ???? 298 10000 ???? 01 4e extra_shipFlag = var14 299 10000 ???? 300 10000 ???? 01 4d extra_shipY = var13 301 10000 ???? 302 10000 ???? 01 4c extra_shipX = var12 303 10000 ???? 304 10000 ???? 01 4b bulletSlowdown = var11 305 10000 ???? 306 10000 ???? 01 4a bulletY = var10 307 10000 ???? 308 10000 ???? 01 49 bulletX = var9 309 10000 ???? 310 10000 ???? 01 48 controller_button2_counter = var8 311 10000 ???? 312 10000 ???? 01 47 controller_button1_counter = var7 313 10000 ???? 314 10000 ???? 01 46 controller_button2_hold_bit6 = var6 315 10000 ???? 316 10000 ???? 01 46 controller_button2_tap_bit5 = var6 317 10000 ???? 318 10000 ???? 01 46 controller_button2_press_bit4 = var6 319 10000 ???? 320 10000 ???? 01 45 controller_button1_hold_bit3 = var5 321 10000 ???? 322 10000 ???? 01 45 controller_button1_tap_bit2 = var5 323 10000 ???? 324 10000 ???? 01 45 controller_button1_press_bit1 = var5 325 10000 ???? 326 10000 ???? 01 45 controller_button_debounce_bit0 = var5 327 10000 ???? 328 10000 ???? 01 45 controllerButtonState = var5 329 10000 ???? 330 10000 ???? 01 44 controller_down_bit4 = var4 331 10000 ???? 332 10000 ???? 01 44 controller_up_bit3 = var4 333 10000 ???? 334 10000 ???? 01 44 controller_right_bit2 = var4 335 10000 ???? 336 10000 ???? 01 44 controller_left_bit1 = var4 337 10000 ???? 338 10000 ???? 01 44 controller_debounce_bit0 = var4 339 10000 ???? 340 10000 ???? 01 44 controllerState = var4 341 10000 ???? 342 10000 ???? 01 43 playerFlag = var3 343 10000 ???? 344 10000 ???? 01 42 playerY = var2 345 10000 ???? 346 10000 ???? 01 41 playerX = var1 347 10000 ???? 348 10000 ???? 01 40 frameCounter = var0 349 10000 ???? 350 10000 ???? 00 01 collisionwrap = 1 351 10000 ???? 00 01 NTSC = 1 352 10000 ???? 00 c0 SCREENHEIGHT = 192 353 10000 ???? 00 01 CHECKOVERWRITE = 1 354 10000 ???? 00 08 ZONEHEIGHT = 8 355 10000 ???? 00 01 ROM48K = 1 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite2.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 ???? -BEADHEADER = 1 565 10000 ???? endif 566 10000 ???? - ifconst ROM32K 567 10000 ???? -BEADHEADER = 1 568 10000 ???? endif 569 10000 ???? ifconst ROM48K 570 10000 ???? 00 01 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 4000 ORG $4000,0 595 4000 ifconst BEADHEADER 596 4000 be ad 02 .byte.b $BE,$AD,BEADHARDWARE 597 4003 ifconst GAMEDESCRIPTIONSET 598 4003 18 CLC 599 4004 90 0a BCC _SKIPDESCRIPTION 600 4006 54 65 73 74* .byte.b GAMEDESCRIPTION,0 601 4010 _SKIPDESCRIPTION 602 4010 endif 603 4010 6c fc ff jmp ($FFFC) 604 4013 endif 605 4013 - else 606 4013 - ifconst bankswitchmode 607 4013 - ifconst ROMAT4K 608 4013 - ORG $4000,0 609 4013 - RORG $4000 610 4013 - else 611 4013 - ORG $8000,0 612 4013 - RORG $8000 613 4013 - endif 614 4013 - else ; not bankswitchmode 615 4013 - ifconst ROM16K 616 4013 - ORG $C000,0 617 4013 - ifconst BEADHEADER 618 4013 - .byte $BE,$AD,BEADHARDWARE 619 4013 - ifconst GAMEDESCRIPTION 620 4013 - CLC 621 4013 - BCC _SKIPDESCRIPTION 622 4013 - .byte GAMEDESCRIPTION,0 623 4013 -_SKIPDESCRIPTION 624 4013 - endif 625 4013 - jmp ($FFFC) 626 4013 - endif 627 4013 - else 628 4013 - ifconst ROM8K 629 4013 - ORG $E000,0 630 4013 - else 631 4013 - ORG $8000,0 632 4013 - ifconst BEADHEADER 633 4013 - .byte $BE,$AD,BEADHARDWARE 634 4013 - ifconst GAMEDESCRIPTION 635 4013 - CLC 636 4013 - BCC _SKIPDESCRIPTION 637 4013 - .byte GAMEDESCRIPTION,0 638 4013 -_SKIPDESCRIPTION 639 4013 - endif 640 4013 - jmp ($FFFC) 641 4013 - endif 642 4013 - endif 643 4013 - endif 644 4013 - endif 645 4013 endif 646 4013 647 4013 ;7800basic v0.16 Nov 21 2020 15:38:52 648 4013 SPACEOVERFLOW SET 0 649 4013 game 650 4013 . 651 4013 ;; 652 4013 653 4013 .L00 ;; set romsize 48k 654 4013 655 4013 .L01 ;; set zoneheight 8 656 4013 657 4013 .L02 ;; set zoneprotection on 658 4013 659 4013 .L03 ;; set tallsprite on 660 4013 661 4013 .L04 ;; set screenheight 192 662 4013 663 4013 .L05 ;; set basepath gfx 664 4013 665 4013 .L06 ;; set tv ntsc 666 4013 667 4013 .L07 ;; set collisionwrap on 668 4013 669 4013 .L08 ;; set doublewide off 670 4013 671 4013 .L09 ;; displaymode 160A 672 4013 673 4013 a9 40 lda #%01000000 ;Enable DMA, mode=160x2/160x4 674 4015 85 3c sta CTRL 675 4017 676 4017 8d 07 21 sta sCTRL 677 401a 678 401a . 679 401a ;; 680 401a 681 401a .L010 ;; dim frameCounter = var0 682 401a 683 401a .L011 ;; dim playerX = var1 684 401a 685 401a .L012 ;; dim playerY = var2 686 401a 687 401a .L013 ;; dim playerFlag = var3 688 401a 689 401a . 690 401a ;; 691 401a 692 401a .L014 ;; dim controllerState = var4 693 401a 694 401a .L015 ;; dim controller_debounce_bit0 = var4 695 401a 696 401a .L016 ;; dim controller_left_bit1 = var4 697 401a 698 401a .L017 ;; dim controller_right_bit2 = var4 699 401a 700 401a .L018 ;; dim controller_up_bit3 = var4 701 401a 702 401a .L019 ;; dim controller_down_bit4 = var4 703 401a 704 401a . 705 401a ;; 706 401a 707 401a .L020 ;; dim controllerButtonState = var5 708 401a 709 401a .L021 ;; dim controller_button_debounce_bit0 = var5 710 401a 711 401a .L022 ;; dim controller_button1_press_bit1 = var5 712 401a 713 401a .L023 ;; dim controller_button1_tap_bit2 = var5 714 401a 715 401a .L024 ;; dim controller_button1_hold_bit3 = var5 716 401a 717 401a .L025 ;; dim controller_button2_press_bit4 = var6 718 401a 719 401a .L026 ;; dim controller_button2_tap_bit5 = var6 720 401a 721 401a .L027 ;; dim controller_button2_hold_bit6 = var6 722 401a 723 401a . 724 401a ;; 725 401a 726 401a .L028 ;; dim controller_button1_counter = var7 727 401a 728 401a .L029 ;; dim controller_button2_counter = var8 729 401a 730 401a .L030 ;; dim bulletX = var9 731 401a 732 401a .L031 ;; dim bulletY = var10 733 401a 734 401a .L032 ;; dim bulletSlowdown = var11 735 401a 736 401a .L033 ;; dim extra_shipX = var12 737 401a 738 401a .L034 ;; dim extra_shipY = var13 739 401a 740 401a .L035 ;; dim extra_shipFlag = var14 741 401a 742 401a .L036 ;; dim power_upX = var15 743 401a 744 401a .L037 ;; dim power_upY = var16 745 401a 746 401a .L038 ;; dim power_upFlag = var17 747 401a 748 401a .L039 ;; dim power_upSlowdown = var18 749 401a 750 401a .L040 ;; dim enemy01_X = var19 751 401a 752 401a .L041 ;; dim enemy01_Y = var20 753 401a 754 401a .L042 ;; dim enemy01_Flag = var21 755 401a 756 401a .L043 ;; dim enemy01_Slowdown = var22 757 401a 758 401a .L044 ;; dim enemy01_speed = var23 759 401a 760 401a .L045 ;; dim enemy_shotX = var24 761 401a 762 401a .L046 ;; dim enemy_shotY = var25 763 401a 764 401a .L047 ;; dim enemy_shotFlag = var26 765 401a 766 401a .L048 ;; dim enemy_shotSlowdown = var27 767 401a 768 401a .L049 ;; dim rMovement1 = var28 769 401a 770 401a .L050 ;; dim rMovement2 = var29 771 401a 772 401a .L051 ;; dim rMovement3 = var30 773 401a 774 401a .L052 ;; dim rMovement4 = var31 775 401a 776 401a .L053 ;; dim rMovement5 = var32 777 401a 778 401a .L054 ;; dim rMovement6 = var33 779 401a 780 401a .L055 ;; dim rDirection = var34 781 401a 782 401a .L056 ;; dim twinlaserX = var35 783 401a 784 401a .L057 ;; dim twinlaserY = var36 785 401a 786 401a .L058 ;; dim twinlaser_flag = var37 787 401a 788 401a .L059 ;; dim twinlaser_Slowdown = var38 789 401a 790 401a .L060 ;; dim lives = var39 791 401a 792 401a .L061 ;; dim isDead_flag = var40 793 401a 794 401a .L062 ;; dim gameover_flag = var41 795 401a 796 401a .L063 ;; dim continue_flag = var42 797 401a 798 401a .L064 ;; dim explosion_aniframe = var43 799 401a 800 401a .L065 ;; dim joyposleft = var44 801 401a 802 401a .L066 ;; dim joyposright = var45 803 401a 804 401a .L067 ;; dim joyposup = var46 805 401a 806 401a .L068 ;; dim joyposdown = var47 807 401a 808 401a . 809 401a ;; 810 401a 811 401a .L069 ;; characterset vertical_shooting_font 812 401a 813 401a a9 b0 lda #>vertical_shooting_font 814 401c 8d 0b 21 sta sCHARBASE 815 401f 816 401f 85 34 sta CHARBASE 817 4021 a9 60 lda #(vertical_shooting_font_mode | %01100000) 818 4023 8d 06 21 sta charactermode 819 4026 820 4026 .L070 ;; alphachars ' 0123456789abcdefghijklmnopqrstuvwxyz.,?!:;`"' 821 4026 822 4026 . 823 4026 ;; 824 4026 825 4026 .import 826 4026 ;; import 827 4026 828 4026 . 829 4026 ;; 830 4026 831 4026 .L071 ;; incgraphic vertical_shooting_font.png 160A 832 4026 833 4026 .L072 ;; incgraphic vertical_shooting_ship.png 160A 834 4026 835 4026 .L073 ;; incgraphic vertical_shooting_bullet.png 160A 836 4026 837 4026 .L074 ;; incgraphic vertical_shooting_enemyshot.png 160A 838 4026 839 4026 .L075 ;; incgraphic vertical_shooting_powerup.png 160A 840 4026 841 4026 .L076 ;; incgraphic vertical_shooting_enemy01.png 160A 842 4026 843 4026 .L077 ;; newblock 844 4026 845 4026 . 846 4026 ;; 847 4026 848 4026 .L078 ;; incgraphic vertical_shooting_1up.png 160A 849 4026 850 4026 .L079 ;; incgraphic vertical_shooting_explosion_01.png 160A 851 4026 852 4026 .L080 ;; incgraphic vertical_shooting_explosion_02.png 160A 853 4026 854 4026 .L081 ;; incgraphic vertical_shooting_explosion_03.png 160A 855 4026 856 4026 .L082 ;; incgraphic vertical_shooting_explosion_04.png 160A 857 4026 858 4026 .L083 ;; incgraphic vertical_shooting_explosion_05.png 160A 859 4026 860 4026 .L084 ;; incgraphic vertical_shooting_explosion_06.png 160A 861 4026 862 4026 .L085 ;; incgraphic vertical_shooting_explosion_07.png 160A 863 4026 864 4026 .L086 ;; incgraphic vertical_shooting_explosion_08.png 160A 865 4026 866 4026 .L087 ;; incgraphic vertical_shooting_explosion_09.png 160A 867 4026 868 4026 .L088 ;; incgraphic vertical_shooting_explosion_10.png 160A 869 4026 870 4026 .L089 ;; incgraphic vertical_shooting_laser.png 160A 871 4026 872 4026 . 873 4026 ;; 874 4026 875 4026 .L090 ;; newblock 876 4026 877 4026 .L091 ;; newblock 878 4026 879 4026 . 880 4026 ;; 881 4026 882 4026 . 883 4026 ;; 884 4026 885 4026 .L092 ;; dmahole 0 886 4026 887 4026 4c 00 b8 jmp dmahole_0 888 4029 gameend 889 4029 DMAHOLEEND2 SET . 28631 bytes of ROM space left in the main area. 890 4029 echo " ",[($B000 - gameend)]d , "bytes of ROM space left in the main area." 891 4029 - if ($B000 - gameend) < 0 892 4029 -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 893 4029 endif 894 4029 895 b000 ORG $B000,0 ; ************* 896 b000 897 b000 vertical_shooting_font 898 b000 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 899 b020 00 00 00 00* HEX 00000000000000000000000000 900 b02d vertical_shooting_ship 901 b02d 07 d0 HEX 07d0 902 b02f vertical_shooting_ship_tallsprite_00 903 b02f 80 02 HEX 8002 904 b031 vertical_shooting_bullet 905 b031 28 HEX 28 906 b032 vertical_shooting_enemyshot 907 b032 00 HEX 00 908 b033 vertical_shooting_powerup 909 b033 28 00 HEX 2800 910 b035 vertical_shooting_enemy01 911 b035 09 e0 HEX 09e0 912 b037 vertical_shooting_enemy01_tallsprite_00 913 b037 40 03 HEX 4003 914 b039 915 b100 ORG $B100,0 ; ************* 916 b100 917 b100 ;vertical_shooting_font 918 b100 00 54 54 54* HEX 0054545454045454045404445054505440544454104454444410401444501014 919 b120 10 44 44 10* HEX 10444410544040101040400000 920 b12d ;vertical_shooting_ship 921 b12d 07 d0 HEX 07d0 922 b12f ;vertical_shooting_ship_tallsprite_00 923 b12f 80 02 HEX 8002 924 b131 ;vertical_shooting_bullet 925 b131 28 HEX 28 926 b132 ;vertical_shooting_enemyshot 927 b132 88 HEX 88 928 b133 ;vertical_shooting_powerup 929 b133 78 08 HEX 7808 930 b135 ;vertical_shooting_enemy01 931 b135 09 e0 HEX 09e0 932 b137 ;vertical_shooting_enemy01_tallsprite_00 933 b137 50 0f HEX 500f 934 b139 935 b200 ORG $B200,0 ; ************* 936 b200 937 b200 ;vertical_shooting_font 938 b200 00 44 10 40* HEX 0044104004040444044404444440444040444410444440444444404444041044 939 b220 10 54 44 10* HEX 10544410400010000000100000 940 b22d ;vertical_shooting_ship 941 b22d 03 c0 HEX 03c0 942 b22f ;vertical_shooting_ship_tallsprite_00 943 b22f a1 4a HEX a14a 944 b231 ;vertical_shooting_bullet 945 b231 3c HEX 3c 946 b232 ;vertical_shooting_enemyshot 947 b232 10 HEX 10 948 b233 ;vertical_shooting_powerup 949 b233 78 1e HEX 781e 950 b235 ;vertical_shooting_enemy01 951 b235 19 ec HEX 19ec 952 b237 ;vertical_shooting_enemy01_tallsprite_00 953 b237 5a af HEX 5aaf 954 b239 955 b300 ORG $B300,0 ; ************* 956 b300 957 b300 ;vertical_shooting_font 958 b300 00 44 10 40* HEX 0044104004040444044404444440444040444410044440444444404444041044 959 b320 54 54 44 10* HEX 54544410100000101000000000 960 b32d ;vertical_shooting_ship 961 b32d 01 40 HEX 0140 962 b32f ;vertical_shooting_ship_tallsprite_00 963 b32f a5 5a HEX a55a 964 b331 ;vertical_shooting_bullet 965 b331 3c HEX 3c 966 b332 ;vertical_shooting_enemyshot 967 b332 74 HEX 74 968 b333 ;vertical_shooting_powerup 969 b333 7a a4 HEX 7aa4 970 b335 ;vertical_shooting_enemy01 971 b335 59 ef HEX 59ef 972 b337 ;vertical_shooting_enemy01_tallsprite_00 973 b337 59 ef HEX 59ef 974 b339 975 b400 ORG $B400,0 ; ************* 976 b400 977 b400 ;vertical_shooting_font 978 b400 00 44 10 54* HEX 0044105454545454045454545040445454445410045040544444504450101044 979 b420 44 44 10 10* HEX 44441010100000101000000000 980 b42d ;vertical_shooting_ship 981 b42d 01 40 HEX 0140 982 b42f ;vertical_shooting_ship_tallsprite_00 983 b42f a5 5a HEX a55a 984 b431 ;vertical_shooting_bullet 985 b431 14 HEX 14 986 b432 ;vertical_shooting_enemyshot 987 b432 74 HEX 74 988 b433 ;vertical_shooting_powerup 989 b433 75 7a HEX 757a 990 b435 ;vertical_shooting_enemy01 991 b435 59 6f HEX 596f 992 b437 ;vertical_shooting_enemy01_tallsprite_00 993 b437 59 ef HEX 59ef 994 b439 995 b500 ORG $B500,0 ; ************* 996 b500 997 b500 ;vertical_shooting_font 998 b500 00 44 10 04* HEX 0044100404444040044444444440444040404410044440544444444444401044 999 b520 44 44 44 54* HEX 44444454100000041000000000 1000 b52d ;vertical_shooting_ship 1001 b52d 01 40 HEX 0140 1002 b52f ;vertical_shooting_ship_tallsprite_00 1003 b52f a5 5a HEX a55a 1004 b531 ;vertical_shooting_bullet 1005 b531 14 HEX 14 1006 b532 ;vertical_shooting_enemyshot 1007 b532 74 HEX 74 1008 b533 ;vertical_shooting_powerup 1009 b533 78 1e HEX 781e 1010 b535 ;vertical_shooting_enemy01 1011 b535 5a af HEX 5aaf 1012 b537 ;vertical_shooting_enemy01_tallsprite_00 1013 b537 19 ec HEX 19ec 1014 b539 1015 b600 ORG $B600,0 ; ************* 1016 b600 1017 b600 ;vertical_shooting_font 1018 b600 00 44 50 04* HEX 0044500404444040044444444440444040404410044440544444444444401044 1019 b620 44 44 44 44* HEX 44444444040000441000001044 1020 b62d ;vertical_shooting_ship 1021 b62d 01 40 HEX 0140 1022 b62f ;vertical_shooting_ship_tallsprite_00 1023 b62f a7 da HEX a7da 1024 b631 ;vertical_shooting_bullet 1025 b631 14 HEX 14 1026 b632 ;vertical_shooting_enemyshot 1027 b632 10 HEX 10 1028 b633 ;vertical_shooting_powerup 1029 b633 7a bc HEX 7abc 1030 b635 ;vertical_shooting_enemy01 1031 b635 50 07 HEX 5007 1032 b637 ;vertical_shooting_enemy01_tallsprite_00 1033 b637 09 e0 HEX 09e0 1034 b639 1035 b700 ORG $B700,0 ; ************* 1036 b700 1037 b700 ;vertical_shooting_font 1038 b700 00 54 10 54* HEX 0054105454445454545454545054505454544454044440445010501050145444 1039 b720 44 44 44 44* HEX 44444444540000101040401044 1040 b72d ;vertical_shooting_ship 1041 b72d 01 40 HEX 0140 1042 b72f ;vertical_shooting_ship_tallsprite_00 1043 b72f 27 d8 HEX 27d8 1044 b731 ;vertical_shooting_bullet 1045 b731 00 HEX 00 1046 b732 ;vertical_shooting_enemyshot 1047 b732 88 HEX 88 1048 b733 ;vertical_shooting_powerup 1049 b733 55 50 HEX 5550 1050 b735 ;vertical_shooting_enemy01 1051 b735 40 01 HEX 4001 1052 b737 ;vertical_shooting_enemy01_tallsprite_00 1053 b737 09 e0 HEX 09e0 1054 b739 1055 b800 ORG $B800,0 ; ************* 1056 b800 dmahole_0 1057 b800 DMAHOLESTART0 SET . 1058 b800 . 1059 b800 ;; 1060 b800 1061 b800 . 1062 b800 ;; 1063 b800 1064 b800 .palettes 1065 b800 ;; palettes 1066 b800 1067 b800 .L093 ;; P0C1 = $0F : P0C2 = $05 : P0C3 = $32 1068 b800 1069 b800 a9 0f LDA #$0F 1070 b802 85 21 STA P0C1 1071 b804 a9 05 LDA #$05 1072 b806 85 22 STA P0C2 1073 b808 a9 32 LDA #$32 1074 b80a 85 23 STA P0C3 1075 b80c .L094 ;; P1C1 = $0F : P1C2 = $EE : P1C3 = $E7 1076 b80c 1077 b80c a9 0f LDA #$0F 1078 b80e 85 25 STA P1C1 1079 b810 a9 ee LDA #$EE 1080 b812 85 26 STA P1C2 1081 b814 a9 e7 LDA #$E7 1082 b816 85 27 STA P1C3 1083 b818 .L095 ;; P2C1 = $9D : P2C2 = $73 : P2C3 = $88 1084 b818 1085 b818 a9 9d LDA #$9D 1086 b81a 85 29 STA P2C1 1087 b81c a9 73 LDA #$73 1088 b81e 85 2a STA P2C2 1089 b820 a9 88 LDA #$88 1090 b822 85 2b STA P2C3 1091 b824 .L096 ;; P3C1 = $FB : P3C2 = $F2 : P3C3 = $25 1092 b824 1093 b824 a9 fb LDA #$FB 1094 b826 85 2d STA P3C1 1095 b828 a9 f2 LDA #$F2 1096 b82a 85 2e STA P3C2 1097 b82c a9 25 LDA #$25 1098 b82e 85 2f STA P3C3 1099 b830 . 1100 b830 ;; 1101 b830 1102 b830 .plot 1103 b830 ;; plot 1104 b830 1105 b830 .L097 ;; playerX = 80 : playerY = 144 : playerFlag = 0 1106 b830 1107 b830 a9 50 LDA #80 1108 b832 8d 41 01 STA playerX 1109 b835 a9 90 LDA #144 1110 b837 8d 42 01 STA playerY 1111 b83a a9 00 LDA #0 1112 b83c 8d 43 01 STA playerFlag 1113 b83f .L098 ;; controller_debounce_bit0{0} = 1 : controller_button_debounce_bit0{0} = 1 1114 b83f 1115 b83f ad 44 01 LDA controller_debounce_bit0 1116 b842 09 01 ORA #1 1117 b844 8d 44 01 STA controller_debounce_bit0 1118 b847 ad 45 01 LDA controller_button_debounce_bit0 1119 b84a 09 01 ORA #1 1120 b84c 8d 45 01 STA controller_button_debounce_bit0 1121 b84f .L099 ;; isDead_flag = 0 : gameover_flag = 0 1122 b84f 1123 b84f a9 00 LDA #0 1124 b851 8d 68 01 STA isDead_flag 1125 b854 8d 69 01 STA gameover_flag 1126 b857 .L0100 ;; bulletX = 0 : bulletY = 0 : bulletSlowdown = 0 1127 b857 1128 b857 a9 00 LDA #0 1129 b859 8d 49 01 STA bulletX 1130 b85c 8d 4a 01 STA bulletY 1131 b85f 8d 4b 01 STA bulletSlowdown 1132 b862 .L0101 ;; frameCounter = 0 1133 b862 1134 b862 a9 00 LDA #0 1135 b864 8d 40 01 STA frameCounter 1136 b867 .L0102 ;; rMovement1 = 1 : rMovement2 = 1 : rMovement3 = 1 : rMovement4 = 1 1137 b867 1138 b867 a9 01 LDA #1 1139 b869 8d 5c 01 STA rMovement1 1140 b86c 8d 5d 01 STA rMovement2 1141 b86f 8d 5e 01 STA rMovement3 1142 b872 8d 5f 01 STA rMovement4 1143 b875 .L0103 ;; rMovement5 = 1 : rMovement6 = 1 : rDirection = 1 1144 b875 1145 b875 a9 01 LDA #1 1146 b877 8d 60 01 STA rMovement5 1147 b87a 8d 61 01 STA rMovement6 1148 b87d 8d 62 01 STA rDirection 1149 b880 .L0104 ;; power_upX = 5 : power_upY = 32 : power_upFlag = 0 : power_upSlowdown = 0 1150 b880 1151 b880 a9 05 LDA #5 1152 b882 8d 4f 01 STA power_upX 1153 b885 a9 20 LDA #32 1154 b887 8d 50 01 STA power_upY 1155 b88a a9 00 LDA #0 1156 b88c 8d 51 01 STA power_upFlag 1157 b88f 8d 52 01 STA power_upSlowdown 1158 b892 .L0105 ;; twinlaserX = 0 : twinlaserY = 0 : twinlaser_flag = 0 : twinlaser_Slowdown = 0 1159 b892 1160 b892 a9 00 LDA #0 1161 b894 8d 63 01 STA twinlaserX 1162 b897 8d 64 01 STA twinlaserY 1163 b89a 8d 65 01 STA twinlaser_flag 1164 b89d 8d 66 01 STA twinlaser_Slowdown 1165 b8a0 .L0106 ;; enemy_shotX = 0 : enemy_shotY = 0 : enemy_shotFlag = 0 : enemy_shotSlowdown = 0 1166 b8a0 1167 b8a0 a9 00 LDA #0 1168 b8a2 8d 58 01 STA enemy_shotX 1169 b8a5 8d 59 01 STA enemy_shotY 1170 b8a8 8d 5a 01 STA enemy_shotFlag 1171 b8ab 8d 5b 01 STA enemy_shotSlowdown 1172 b8ae .L0107 ;; enemy01_X = 0 : enemy01_Y = 0 : enemy01_Flag = 0 : enemy01_speed = 3 : enemy01_Slowdown = 0 1173 b8ae 1174 b8ae a9 00 LDA #0 1175 b8b0 8d 53 01 STA enemy01_X 1176 b8b3 8d 54 01 STA enemy01_Y 1177 b8b6 8d 55 01 STA enemy01_Flag 1178 b8b9 a9 03 LDA #3 1179 b8bb 8d 57 01 STA enemy01_speed 1180 b8be a9 00 LDA #0 1181 b8c0 8d 56 01 STA enemy01_Slowdown 1182 b8c3 .L0108 ;; extra_shipX = 0 : extra_shipY = 0 : extra_shipFlag = 0 1183 b8c3 1184 b8c3 a9 00 LDA #0 1185 b8c5 8d 4c 01 STA extra_shipX 1186 b8c8 8d 4d 01 STA extra_shipY 1187 b8cb 8d 4e 01 STA extra_shipFlag 1188 b8ce .L0109 ;; joyposleft = 0 : joyposright = 0 : joyposup = 0 : joyposdown = 0 1189 b8ce 1190 b8ce a9 00 LDA #0 1191 b8d0 8d 6c 01 STA joyposleft 1192 b8d3 8d 6d 01 STA joyposright 1193 b8d6 8d 6e 01 STA joyposup 1194 b8d9 8d 6f 01 STA joyposdown 1195 b8dc . 1196 b8dc ;; 1197 b8dc 1198 b8dc .L0110 ;; gosub titlescreen 1199 b8dc 1200 b8dc 20 29 da jsr .titlescreen 1201 b8df 1202 b8df . 1203 b8df ;; 1204 b8df 1205 b8df .L0111 ;; gosub initialise_gamescreen 1206 b8df 1207 b8df 20 3c db jsr .initialise_gamescreen 1208 b8e2 1209 b8e2 . 1210 b8e2 ;; 1211 b8e2 1212 b8e2 . 1213 b8e2 ;; 1214 b8e2 1215 b8e2 .main 1216 b8e2 ;; main 1217 b8e2 1218 b8e2 .L0112 ;; frameCounter = frameCounter + 1 1219 b8e2 1220 b8e2 ad 40 01 LDA frameCounter 1221 b8e5 18 CLC 1222 b8e6 69 01 ADC #1 1223 b8e8 8d 40 01 STA frameCounter 1224 b8eb .L0113 ;; if frameCounter > 10 then frameCounter = 0 1225 b8eb 1226 b8eb a9 0a LDA #10 1227 b8ed cd 40 01 CMP frameCounter 1228 b8f0 b0 05 BCS .skipL0113 1229 b8f2 .condpart0 1230 b8f2 a9 00 LDA #0 1231 b8f4 8d 40 01 STA frameCounter 1232 b8f7 .skipL0113 1233 b8f7 .mainloop 1234 b8f7 ;; mainloop 1235 b8f7 1236 b8f7 . 1237 b8f7 ;; 1238 b8f7 1239 b8f7 .L0114 ;; gosub ReadController 1240 b8f7 1241 b8f7 20 47 db jsr .ReadController 1242 b8fa 1243 b8fa . 1244 b8fa ;; 1245 b8fa 1246 b8fa .L0115 ;; if controller_debounce_bit0{0} || controller_button_debounce_bit0{0} then goto _mainLoopSkipJoystickCheck 1247 b8fa 1248 b8fa ad 44 01 LDA controller_debounce_bit0 1249 b8fd 4a LSR 1250 b8fe 90 03 BCC .skipL0115 1251 b900 .condpart1 1252 b900 4c 09 b9 jmp .condpart2 1253 b903 .skipL0115 1254 b903 ad 45 01 LDA controller_button_debounce_bit0 1255 b906 4a LSR 1256 b907 90 03 BCC .skip0OR 1257 b909 .condpart2 1258 b909 4c 3e be jmp ._mainLoopSkipJoystickCheck 1259 b90c 1260 b90c .skip0OR 1261 b90c . 1262 b90c ;; 1263 b90c 1264 b90c .L0116 ;; if controller_left_bit1{1} then controller_debounce_bit0{0} = 1 : joyposleft = 1 : joyposright = 0 : joyposup = 0 : joyposdown = 0 : playerX = playerX - 1 : gosub SetBulletHome 1265 b90c 1266 b90c ad 44 01 LDA controller_left_bit1 1267 b90f 29 02 AND #2 1268 b911 f0 24 BEQ .skipL0116 1269 b913 .condpart3 1270 b913 ad 44 01 LDA controller_debounce_bit0 1271 b916 09 01 ORA #1 1272 b918 8d 44 01 STA controller_debounce_bit0 1273 b91b a9 01 LDA #1 1274 b91d 8d 6c 01 STA joyposleft 1275 b920 a9 00 LDA #0 1276 b922 8d 6d 01 STA joyposright 1277 b925 8d 6e 01 STA joyposup 1278 b928 8d 6f 01 STA joyposdown 1279 b92b ad 41 01 LDA playerX 1280 b92e 38 SEC 1281 b92f e9 01 SBC #1 1282 b931 8d 41 01 STA playerX 1283 b934 20 f3 cd jsr .SetBulletHome 1284 b937 1285 b937 .skipL0116 1286 b937 .L0117 ;; if controller_right_bit2{2} then controller_debounce_bit0{0} = 1 : joyposleft = 0 : joyposright = 1 : joyposup = 0 : joyposdown = 0 : playerX = playerX + 1 : gosub SetBulletHome 1287 b937 1288 b937 ad 44 01 LDA controller_right_bit2 1289 b93a 29 04 AND #4 1290 b93c f0 26 BEQ .skipL0117 1291 b93e .condpart4 1292 b93e ad 44 01 LDA controller_debounce_bit0 1293 b941 09 01 ORA #1 1294 b943 8d 44 01 STA controller_debounce_bit0 1295 b946 a9 00 LDA #0 1296 b948 8d 6c 01 STA joyposleft 1297 b94b a9 01 LDA #1 1298 b94d 8d 6d 01 STA joyposright 1299 b950 a9 00 LDA #0 1300 b952 8d 6e 01 STA joyposup 1301 b955 8d 6f 01 STA joyposdown 1302 b958 ad 41 01 LDA playerX 1303 b95b 18 CLC 1304 b95c 69 01 ADC #1 1305 b95e 8d 41 01 STA playerX 1306 b961 20 f3 cd jsr .SetBulletHome 1307 b964 1308 b964 .skipL0117 1309 b964 .L0118 ;; if controller_up_bit3{3} then controller_debounce_bit0{0} = 1 : joyposleft = 0 : joyposright = 0 : joyposup = 1 : joyposdown = 0 : playerY = playerY - 1 : gosub SetBulletHome 1310 b964 1311 b964 ad 44 01 LDA controller_up_bit3 1312 b967 29 08 AND #8 1313 b969 f0 26 BEQ .skipL0118 1314 b96b .condpart5 1315 b96b ad 44 01 LDA controller_debounce_bit0 1316 b96e 09 01 ORA #1 1317 b970 8d 44 01 STA controller_debounce_bit0 1318 b973 a9 00 LDA #0 1319 b975 8d 6c 01 STA joyposleft 1320 b978 8d 6d 01 STA joyposright 1321 b97b a9 01 LDA #1 1322 b97d 8d 6e 01 STA joyposup 1323 b980 a9 00 LDA #0 1324 b982 8d 6f 01 STA joyposdown 1325 b985 ad 42 01 LDA playerY 1326 b988 38 SEC 1327 b989 e9 01 SBC #1 1328 b98b 8d 42 01 STA playerY 1329 b98e 20 f3 cd jsr .SetBulletHome 1330 b991 1331 b991 .skipL0118 1332 b991 .L0119 ;; if controller_down_bit4{4} then controller_debounce_bit0{0} = 1 : joyposleft = 0 : joyposright = 0 : joyposup = 0 : joyposdown = 1 : playerY = playerY + 1 : gosub SetBulletHome 1333 b991 1334 b991 ad 44 01 LDA controller_down_bit4 1335 b994 29 10 AND #16 1336 b996 f0 24 BEQ .skipL0119 1337 b998 .condpart6 1338 b998 ad 44 01 LDA controller_debounce_bit0 1339 b99b 09 01 ORA #1 1340 b99d 8d 44 01 STA controller_debounce_bit0 1341 b9a0 a9 00 LDA #0 1342 b9a2 8d 6c 01 STA joyposleft 1343 b9a5 8d 6d 01 STA joyposright 1344 b9a8 8d 6e 01 STA joyposup 1345 b9ab a9 01 LDA #1 1346 b9ad 8d 6f 01 STA joyposdown 1347 b9b0 ad 42 01 LDA playerY 1348 b9b3 18 CLC 1349 b9b4 69 01 ADC #1 1350 b9b6 8d 42 01 STA playerY 1351 b9b9 20 f3 cd jsr .SetBulletHome 1352 b9bc 1353 b9bc .skipL0119 1354 b9bc .L0120 ;; if controller_button1_press_bit1{1} then controller_button_debounce_bit0{0} = 1 : bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1355 b9bc 1356 b9bc ad 45 01 LDA controller_button1_press_bit1 1357 b9bf 29 02 AND #2 1358 b9c1 f0 2a BEQ .skipL0120 1359 b9c3 .condpart7 1360 b9c3 ad 45 01 LDA controller_button_debounce_bit0 1361 b9c6 09 01 ORA #1 1362 b9c8 8d 45 01 STA controller_button_debounce_bit0 1363 b9cb ad 4a 01 LDA bulletY 1364 b9ce 38 SEC 1365 b9cf e9 05 SBC #5 1366 b9d1 8d 4a 01 STA bulletY 1367 b9d4 a9 01 lda #1 1368 b9d6 85 de sta sfxschedulelock 1369 b9d8 a9 b8 lda #sfx_pulsecannon 1372 b9de 85 e1 sta sfxinstrumenthi 1373 b9e0 a9 00 lda #0 1374 b9e2 85 e2 sta sfxpitchoffset ; no pitch modification 1375 b9e4 85 e3 sta sfxnoteindex ; not a musical note 1376 b9e6 20 58 f2 jsr schedulesfx 1377 b9e9 a9 00 lda #0 1378 b9eb 85 de sta sfxschedulelock 1379 b9ed .skipL0120 1380 b9ed .L0121 ;; if controller_button1_tap_bit2{2} then controller_button_debounce_bit0{0} = 1 : bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1381 b9ed 1382 b9ed ad 45 01 LDA controller_button1_tap_bit2 1383 b9f0 29 04 AND #4 1384 b9f2 f0 2a BEQ .skipL0121 1385 b9f4 .condpart8 1386 b9f4 ad 45 01 LDA controller_button_debounce_bit0 1387 b9f7 09 01 ORA #1 1388 b9f9 8d 45 01 STA controller_button_debounce_bit0 1389 b9fc ad 4a 01 LDA bulletY 1390 b9ff 38 SEC 1391 ba00 e9 05 SBC #5 1392 ba02 8d 4a 01 STA bulletY 1393 ba05 a9 01 lda #1 1394 ba07 85 de sta sfxschedulelock 1395 ba09 a9 b8 lda #sfx_pulsecannon 1398 ba0f 85 e1 sta sfxinstrumenthi 1399 ba11 a9 00 lda #0 1400 ba13 85 e2 sta sfxpitchoffset ; no pitch modification 1401 ba15 85 e3 sta sfxnoteindex ; not a musical note 1402 ba17 20 58 f2 jsr schedulesfx 1403 ba1a a9 00 lda #0 1404 ba1c 85 de sta sfxschedulelock 1405 ba1e .skipL0121 1406 ba1e .L0122 ;; if controller_button1_hold_bit3{3} then controller_button_debounce_bit0{0} = 1 : bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1407 ba1e 1408 ba1e ad 45 01 LDA controller_button1_hold_bit3 1409 ba21 29 08 AND #8 1410 ba23 f0 2a BEQ .skipL0122 1411 ba25 .condpart9 1412 ba25 ad 45 01 LDA controller_button_debounce_bit0 1413 ba28 09 01 ORA #1 1414 ba2a 8d 45 01 STA controller_button_debounce_bit0 1415 ba2d ad 4a 01 LDA bulletY 1416 ba30 38 SEC 1417 ba31 e9 05 SBC #5 1418 ba33 8d 4a 01 STA bulletY 1419 ba36 a9 01 lda #1 1420 ba38 85 de sta sfxschedulelock 1421 ba3a a9 b8 lda #sfx_pulsecannon 1424 ba40 85 e1 sta sfxinstrumenthi 1425 ba42 a9 00 lda #0 1426 ba44 85 e2 sta sfxpitchoffset ; no pitch modification 1427 ba46 85 e3 sta sfxnoteindex ; not a musical note 1428 ba48 20 58 f2 jsr schedulesfx 1429 ba4b a9 00 lda #0 1430 ba4d 85 de sta sfxschedulelock 1431 ba4f .skipL0122 1432 ba4f .L0123 ;; if controller_button_debounce_bit0{0} then gosub SetBulletHome 1433 ba4f 1434 ba4f ad 45 01 LDA controller_button_debounce_bit0 1435 ba52 4a LSR 1436 ba53 90 03 BCC .skipL0123 1437 ba55 .condpart10 1438 ba55 20 f3 cd jsr .SetBulletHome 1439 ba58 1440 ba58 .skipL0123 1441 ba58 . 1442 ba58 ;; 1443 ba58 1444 ba58 .L0124 ;; rMovement1 = ( rand & 7 ) - 2 1445 ba58 1446 ba58 ; complex statement detected 1447 ba58 20 fd f3 jsr randomize 1448 ba5b 29 07 AND #7 1449 ba5d 38 SEC 1450 ba5e e9 02 SBC #2 1451 ba60 8d 5c 01 STA rMovement1 1452 ba63 .L0125 ;; rMovement2 = ( rand & 6 ) 1453 ba63 1454 ba63 ; complex statement detected 1455 ba63 20 fd f3 jsr randomize 1456 ba66 29 06 AND #6 1457 ba68 8d 5d 01 STA rMovement2 1458 ba6b .L0126 ;; rMovement3 = ( rand & 3 ) + 1 1459 ba6b 1460 ba6b ; complex statement detected 1461 ba6b 20 fd f3 jsr randomize 1462 ba6e 29 03 AND #3 1463 ba70 18 CLC 1464 ba71 69 01 ADC #1 1465 ba73 8d 5e 01 STA rMovement3 1466 ba76 .L0127 ;; rMovement4 = ( rand & 5 ) + 2 1467 ba76 1468 ba76 ; complex statement detected 1469 ba76 20 fd f3 jsr randomize 1470 ba79 29 05 AND #5 1471 ba7b 18 CLC 1472 ba7c 69 02 ADC #2 1473 ba7e 8d 5f 01 STA rMovement4 1474 ba81 .L0128 ;; rMovement5 = ( rand & 5 ) + 1 1475 ba81 1476 ba81 ; complex statement detected 1477 ba81 20 fd f3 jsr randomize 1478 ba84 29 05 AND #5 1479 ba86 18 CLC 1480 ba87 69 01 ADC #1 1481 ba89 8d 60 01 STA rMovement5 1482 ba8c .L0129 ;; rMovement6 = ( rand & 6 ) - 1 1483 ba8c 1484 ba8c ; complex statement detected 1485 ba8c 20 fd f3 jsr randomize 1486 ba8f 29 06 AND #6 1487 ba91 38 SEC 1488 ba92 e9 01 SBC #1 1489 ba94 8d 61 01 STA rMovement6 1490 ba97 .L0130 ;; rDirection = ( rand & 4 ) 1491 ba97 1492 ba97 ; complex statement detected 1493 ba97 20 fd f3 jsr randomize 1494 ba9a 29 04 AND #4 1495 ba9c 8d 62 01 STA rDirection 1496 ba9f .L0131 ;; if switchreset then reboot 1497 ba9f 1498 ba9f 20 85 f4 jsr checkresetswitch 1499 baa2 d0 03 BNE .skipL0131 1500 baa4 .condpart11 1501 baa4 4c 72 f5 JMP START 1502 baa7 .skipL0131 1503 baa7 . 1504 baa7 ;; 1505 baa7 1506 baa7 .L0132 ;; enemy_shotSlowdown = enemy_shotSlowdown + 1 1507 baa7 1508 baa7 ad 5b 01 LDA enemy_shotSlowdown 1509 baaa 18 CLC 1510 baab 69 01 ADC #1 1511 baad 8d 5b 01 STA enemy_shotSlowdown 1512 bab0 .L0133 ;; if enemy_shotSlowdown > 8 then enemy_shotSlowdown = 0 1513 bab0 1514 bab0 a9 08 LDA #8 1515 bab2 cd 5b 01 CMP enemy_shotSlowdown 1516 bab5 b0 05 BCS .skipL0133 1517 bab7 .condpart12 1518 bab7 a9 00 LDA #0 1519 bab9 8d 5b 01 STA enemy_shotSlowdown 1520 babc .skipL0133 1521 babc . 1522 babc ;; 1523 babc 1524 babc .L0134 ;; enemy01_Slowdown = enemy01_Slowdown + 1 1525 babc 1526 babc ad 56 01 LDA enemy01_Slowdown 1527 babf 18 CLC 1528 bac0 69 01 ADC #1 1529 bac2 8d 56 01 STA enemy01_Slowdown 1530 bac5 .L0135 ;; if enemy01_Slowdown > 8 then enemy01_Slowdown = 0 1531 bac5 1532 bac5 a9 08 LDA #8 1533 bac7 cd 56 01 CMP enemy01_Slowdown 1534 baca b0 05 BCS .skipL0135 1535 bacc .condpart13 1536 bacc a9 00 LDA #0 1537 bace 8d 56 01 STA enemy01_Slowdown 1538 bad1 .skipL0135 1539 bad1 . 1540 bad1 ;; 1541 bad1 1542 bad1 .L0136 ;; bulletSlowdown = bulletSlowdown + 1 1543 bad1 1544 bad1 ad 4b 01 LDA bulletSlowdown 1545 bad4 18 CLC 1546 bad5 69 01 ADC #1 1547 bad7 8d 4b 01 STA bulletSlowdown 1548 bada .L0137 ;; if bulletSlowdown > 6 then bulletSlowdown = 0 1549 bada 1550 bada a9 06 LDA #6 1551 badc cd 4b 01 CMP bulletSlowdown 1552 badf b0 05 BCS .skipL0137 1553 bae1 .condpart14 1554 bae1 a9 00 LDA #0 1555 bae3 8d 4b 01 STA bulletSlowdown 1556 bae6 .skipL0137 1557 bae6 . 1558 bae6 ;; 1559 bae6 1560 bae6 .L0138 ;; power_upSlowdown = power_upSlowdown + 1 1561 bae6 1562 bae6 ad 52 01 LDA power_upSlowdown 1563 bae9 18 CLC 1564 baea 69 01 ADC #1 1565 baec 8d 52 01 STA power_upSlowdown 1566 baef .L0139 ;; if power_upSlowdown > 7 then power_upSlowdown = 0 1567 baef 1568 baef a9 07 LDA #7 1569 baf1 cd 52 01 CMP power_upSlowdown 1570 baf4 b0 05 BCS .skipL0139 1571 baf6 .condpart15 1572 baf6 a9 00 LDA #0 1573 baf8 8d 52 01 STA power_upSlowdown 1574 bafb .skipL0139 1575 bafb . 1576 bafb ;; 1577 bafb 1578 bafb .L0140 ;; twinlaser_Slowdown = twinlaser_Slowdown + 1 1579 bafb 1580 bafb ad 66 01 LDA twinlaser_Slowdown 1581 bafe 18 CLC 1582 baff 69 01 ADC #1 1583 bb01 8d 66 01 STA twinlaser_Slowdown 1584 bb04 .L0141 ;; if twinlaser_Slowdown > 5 then twinlaser_Slowdown = 0 1585 bb04 1586 bb04 a9 05 LDA #5 1587 bb06 cd 66 01 CMP twinlaser_Slowdown 1588 bb09 b0 05 BCS .skipL0141 1589 bb0b .condpart16 1590 bb0b a9 00 LDA #0 1591 bb0d 8d 66 01 STA twinlaser_Slowdown 1592 bb10 .skipL0141 1593 bb10 . 1594 bb10 ;; 1595 bb10 1596 bb10 .L0142 ;; if playerX > 152 then playerX = playerX - 1 1597 bb10 1598 bb10 a9 98 LDA #152 1599 bb12 cd 41 01 CMP playerX 1600 bb15 b0 09 BCS .skipL0142 1601 bb17 .condpart17 1602 bb17 ad 41 01 LDA playerX 1603 bb1a 38 SEC 1604 bb1b e9 01 SBC #1 1605 bb1d 8d 41 01 STA playerX 1606 bb20 .skipL0142 1607 bb20 .L0143 ;; if playerX < 1 then playerX = playerX + 1 1608 bb20 1609 bb20 ad 41 01 LDA playerX 1610 bb23 c9 01 CMP #1 1611 bb25 b0 09 BCS .skipL0143 1612 bb27 .condpart18 1613 bb27 ad 41 01 LDA playerX 1614 bb2a 18 CLC 1615 bb2b 69 01 ADC #1 1616 bb2d 8d 41 01 STA playerX 1617 bb30 .skipL0143 1618 bb30 .L0144 ;; if playerY > 177 then playerY = playerY - 1 1619 bb30 1620 bb30 a9 b1 LDA #177 1621 bb32 cd 42 01 CMP playerY 1622 bb35 b0 09 BCS .skipL0144 1623 bb37 .condpart19 1624 bb37 ad 42 01 LDA playerY 1625 bb3a 38 SEC 1626 bb3b e9 01 SBC #1 1627 bb3d 8d 42 01 STA playerY 1628 bb40 .skipL0144 1629 bb40 .L0145 ;; if playerY < 1 then playerY = playerY + 1 1630 bb40 1631 bb40 ad 42 01 LDA playerY 1632 bb43 c9 01 CMP #1 1633 bb45 b0 09 BCS .skipL0145 1634 bb47 .condpart20 1635 bb47 ad 42 01 LDA playerY 1636 bb4a 18 CLC 1637 bb4b 69 01 ADC #1 1638 bb4d 8d 42 01 STA playerY 1639 bb50 .skipL0145 1640 bb50 .L0146 ;; if bulletY > 183 then bulletY = bulletY - 1 1641 bb50 1642 bb50 a9 b7 LDA #183 1643 bb52 cd 4a 01 CMP bulletY 1644 bb55 b0 09 BCS .skipL0146 1645 bb57 .condpart21 1646 bb57 ad 4a 01 LDA bulletY 1647 bb5a 38 SEC 1648 bb5b e9 01 SBC #1 1649 bb5d 8d 4a 01 STA bulletY 1650 bb60 .skipL0146 1651 bb60 .L0147 ;; if bulletY < 1 then bulletY = bulletY + 1 1652 bb60 1653 bb60 ad 4a 01 LDA bulletY 1654 bb63 c9 01 CMP #1 1655 bb65 b0 09 BCS .skipL0147 1656 bb67 .condpart22 1657 bb67 ad 4a 01 LDA bulletY 1658 bb6a 18 CLC 1659 bb6b 69 01 ADC #1 1660 bb6d 8d 4a 01 STA bulletY 1661 bb70 .skipL0147 1662 bb70 .L0148 ;; if twinlaserY > 183 then twinlaserY = twinlaserY - 1 1663 bb70 1664 bb70 a9 b7 LDA #183 1665 bb72 cd 64 01 CMP twinlaserY 1666 bb75 b0 09 BCS .skipL0148 1667 bb77 .condpart23 1668 bb77 ad 64 01 LDA twinlaserY 1669 bb7a 38 SEC 1670 bb7b e9 01 SBC #1 1671 bb7d 8d 64 01 STA twinlaserY 1672 bb80 .skipL0148 1673 bb80 .L0149 ;; if twinlaserY < 1 then twinlaserY = twinlaserY + 1 1674 bb80 1675 bb80 ad 64 01 LDA twinlaserY 1676 bb83 c9 01 CMP #1 1677 bb85 b0 09 BCS .skipL0149 1678 bb87 .condpart24 1679 bb87 ad 64 01 LDA twinlaserY 1680 bb8a 18 CLC 1681 bb8b 69 01 ADC #1 1682 bb8d 8d 64 01 STA twinlaserY 1683 bb90 .skipL0149 1684 bb90 . 1685 bb90 ;; 1686 bb90 1687 bb90 . 1688 bb90 ;; 1689 bb90 1690 bb90 . 1691 bb90 ;; 1692 bb90 1693 bb90 . 1694 bb90 ;; 1695 bb90 1696 bb90 . 1697 bb90 ;; 1698 bb90 1699 bb90 .L0150 ;; gosub check_collisions 1700 bb90 1701 bb90 20 53 ca jsr .check_collisions 1702 bb93 1703 bb93 .L0151 ;; if isDead_flag then goto lose_a_life 1704 bb93 1705 bb93 ad 68 01 LDA isDead_flag 1706 bb96 f0 03 BEQ .skipL0151 1707 bb98 .condpart25 1708 bb98 4c 00 d8 jmp .lose_a_life 1709 bb9b 1710 bb9b .skipL0151 1711 bb9b . 1712 bb9b ;; 1713 bb9b 1714 bb9b . 1715 bb9b ;; 1716 bb9b 1717 bb9b . 1718 bb9b ;; 1719 bb9b 1720 bb9b .L0152 ;; if enemy_shotX > 160 then enemy_shotX = enemy_shotX - 1 1721 bb9b 1722 bb9b a9 a0 LDA #160 1723 bb9d cd 58 01 CMP enemy_shotX 1724 bba0 b0 09 BCS .skipL0152 1725 bba2 .condpart26 1726 bba2 ad 58 01 LDA enemy_shotX 1727 bba5 38 SEC 1728 bba6 e9 01 SBC #1 1729 bba8 8d 58 01 STA enemy_shotX 1730 bbab .skipL0152 1731 bbab .L0153 ;; if enemy_shotX < 1 then enemy_shotX = enemy_shotX + 1 1732 bbab 1733 bbab ad 58 01 LDA enemy_shotX 1734 bbae c9 01 CMP #1 1735 bbb0 b0 09 BCS .skipL0153 1736 bbb2 .condpart27 1737 bbb2 ad 58 01 LDA enemy_shotX 1738 bbb5 18 CLC 1739 bbb6 69 01 ADC #1 1740 bbb8 8d 58 01 STA enemy_shotX 1741 bbbb .skipL0153 1742 bbbb .L0154 ;; if enemy_shotY > 191 then enemy_shotY = enemy_shotY - 1 1743 bbbb 1744 bbbb a9 bf LDA #191 1745 bbbd cd 59 01 CMP enemy_shotY 1746 bbc0 b0 09 BCS .skipL0154 1747 bbc2 .condpart28 1748 bbc2 ad 59 01 LDA enemy_shotY 1749 bbc5 38 SEC 1750 bbc6 e9 01 SBC #1 1751 bbc8 8d 59 01 STA enemy_shotY 1752 bbcb .skipL0154 1753 bbcb .L0155 ;; if enemy_shotY < 1 then enemy_shotY = enemy_shotY + 1 1754 bbcb 1755 bbcb ad 59 01 LDA enemy_shotY 1756 bbce c9 01 CMP #1 1757 bbd0 b0 09 BCS .skipL0155 1758 bbd2 .condpart29 1759 bbd2 ad 59 01 LDA enemy_shotY 1760 bbd5 18 CLC 1761 bbd6 69 01 ADC #1 1762 bbd8 8d 59 01 STA enemy_shotY 1763 bbdb .skipL0155 1764 bbdb .L0156 ;; if power_upX > 155 then power_upX = power_upX - 5 1765 bbdb 1766 bbdb a9 9b LDA #155 1767 bbdd cd 4f 01 CMP power_upX 1768 bbe0 b0 09 BCS .skipL0156 1769 bbe2 .condpart30 1770 bbe2 ad 4f 01 LDA power_upX 1771 bbe5 38 SEC 1772 bbe6 e9 05 SBC #5 1773 bbe8 8d 4f 01 STA power_upX 1774 bbeb .skipL0156 1775 bbeb .L0157 ;; if power_upX < 1 then power_upX = power_upX + 5 1776 bbeb 1777 bbeb ad 4f 01 LDA power_upX 1778 bbee c9 01 CMP #1 1779 bbf0 b0 09 BCS .skipL0157 1780 bbf2 .condpart31 1781 bbf2 ad 4f 01 LDA power_upX 1782 bbf5 18 CLC 1783 bbf6 69 05 ADC #5 1784 bbf8 8d 4f 01 STA power_upX 1785 bbfb .skipL0157 1786 bbfb .L0158 ;; if power_upY > 191 then power_upY = power_upY - 5 1787 bbfb 1788 bbfb a9 bf LDA #191 1789 bbfd cd 50 01 CMP power_upY 1790 bc00 b0 09 BCS .skipL0158 1791 bc02 .condpart32 1792 bc02 ad 50 01 LDA power_upY 1793 bc05 38 SEC 1794 bc06 e9 05 SBC #5 1795 bc08 8d 50 01 STA power_upY 1796 bc0b .skipL0158 1797 bc0b .L0159 ;; if power_upY < 1 then power_upY = power_upY + 5 1798 bc0b 1799 bc0b ad 50 01 LDA power_upY 1800 bc0e c9 01 CMP #1 1801 bc10 b0 09 BCS .skipL0159 1802 bc12 .condpart33 1803 bc12 ad 50 01 LDA power_upY 1804 bc15 18 CLC 1805 bc16 69 05 ADC #5 1806 bc18 8d 50 01 STA power_upY 1807 bc1b .skipL0159 1808 bc1b .L0160 ;; if enemy01_X > 160 then enemy01_X = enemy01_X - 1 1809 bc1b 1810 bc1b a9 a0 LDA #160 1811 bc1d cd 53 01 CMP enemy01_X 1812 bc20 b0 09 BCS .skipL0160 1813 bc22 .condpart34 1814 bc22 ad 53 01 LDA enemy01_X 1815 bc25 38 SEC 1816 bc26 e9 01 SBC #1 1817 bc28 8d 53 01 STA enemy01_X 1818 bc2b .skipL0160 1819 bc2b .L0161 ;; if enemy01_X < 1 then enemy01_X = enemy01_X + 1 1820 bc2b 1821 bc2b ad 53 01 LDA enemy01_X 1822 bc2e c9 01 CMP #1 1823 bc30 b0 09 BCS .skipL0161 1824 bc32 .condpart35 1825 bc32 ad 53 01 LDA enemy01_X 1826 bc35 18 CLC 1827 bc36 69 01 ADC #1 1828 bc38 8d 53 01 STA enemy01_X 1829 bc3b .skipL0161 1830 bc3b .L0162 ;; if enemy01_Y > 220 then enemy01_Y = enemy01_Y - 1 1831 bc3b 1832 bc3b a9 dc LDA #220 1833 bc3d cd 54 01 CMP enemy01_Y 1834 bc40 b0 09 BCS .skipL0162 1835 bc42 .condpart36 1836 bc42 ad 54 01 LDA enemy01_Y 1837 bc45 38 SEC 1838 bc46 e9 01 SBC #1 1839 bc48 8d 54 01 STA enemy01_Y 1840 bc4b .skipL0162 1841 bc4b .L0163 ;; if enemy01_Y < - 16 then enemy01_Y = enemy01_Y + 1 1842 bc4b 1843 bc4b ; complex condition detected 1844 bc4b a9 f0 LDA #240 1845 bc4d 48 PHA 1846 bc4e ba TSX 1847 bc4f 68 PLA 1848 bc50 ad 54 01 LDA enemy01_Y 1849 bc53 dd 01 01 CMP $101,x 1850 bc56 b0 09 BCS .skipL0163 1851 bc58 .condpart37 1852 bc58 ad 54 01 LDA enemy01_Y 1853 bc5b 18 CLC 1854 bc5c 69 01 ADC #1 1855 bc5e 8d 54 01 STA enemy01_Y 1856 bc61 .skipL0163 1857 bc61 .L0164 ;; if extra_shipX > 160 then extra_shipX = extra_shipX - 1 1858 bc61 1859 bc61 a9 a0 LDA #160 1860 bc63 cd 4c 01 CMP extra_shipX 1861 bc66 b0 09 BCS .skipL0164 1862 bc68 .condpart38 1863 bc68 ad 4c 01 LDA extra_shipX 1864 bc6b 38 SEC 1865 bc6c e9 01 SBC #1 1866 bc6e 8d 4c 01 STA extra_shipX 1867 bc71 .skipL0164 1868 bc71 .L0165 ;; if extra_shipX < 1 then extra_shipX = extra_shipX + 1 1869 bc71 1870 bc71 ad 4c 01 LDA extra_shipX 1871 bc74 c9 01 CMP #1 1872 bc76 b0 09 BCS .skipL0165 1873 bc78 .condpart39 1874 bc78 ad 4c 01 LDA extra_shipX 1875 bc7b 18 CLC 1876 bc7c 69 01 ADC #1 1877 bc7e 8d 4c 01 STA extra_shipX 1878 bc81 .skipL0165 1879 bc81 .L0166 ;; if extra_shipY > 191 then extra_shipY = extra_shipY - 1 1880 bc81 1881 bc81 a9 bf LDA #191 1882 bc83 cd 4d 01 CMP extra_shipY 1883 bc86 b0 09 BCS .skipL0166 1884 bc88 .condpart40 1885 bc88 ad 4d 01 LDA extra_shipY 1886 bc8b 38 SEC 1887 bc8c e9 01 SBC #1 1888 bc8e 8d 4d 01 STA extra_shipY 1889 bc91 .skipL0166 1890 bc91 .L0167 ;; if extra_shipY < 1 then extra_shipY = extra_shipY + 1 1891 bc91 1892 bc91 ad 4d 01 LDA extra_shipY 1893 bc94 c9 01 CMP #1 1894 bc96 b0 09 BCS .skipL0167 1895 bc98 .condpart41 1896 bc98 ad 4d 01 LDA extra_shipY 1897 bc9b 18 CLC 1898 bc9c 69 01 ADC #1 1899 bc9e 8d 4d 01 STA extra_shipY 1900 bca1 .skipL0167 1901 bca1 . 1902 bca1 ;; 1903 bca1 1904 bca1 .L0168 ;; if rDirection = 0 then enemy_shotX = enemy_shotX + rMovement1 : enemy_shotY = enemy_shotY + rMovement2 1905 bca1 1906 bca1 ad 62 01 LDA rDirection 1907 bca4 c9 00 CMP #0 1908 bca6 d0 14 BNE .skipL0168 1909 bca8 .condpart42 1910 bca8 ad 58 01 LDA enemy_shotX 1911 bcab 18 CLC 1912 bcac 6d 5c 01 ADC rMovement1 1913 bcaf 8d 58 01 STA enemy_shotX 1914 bcb2 ad 59 01 LDA enemy_shotY 1915 bcb5 18 CLC 1916 bcb6 6d 5d 01 ADC rMovement2 1917 bcb9 8d 59 01 STA enemy_shotY 1918 bcbc .skipL0168 1919 bcbc .L0169 ;; if rDirection = 1 then enemy_shotX = enemy_shotX + rMovement3 : enemy_shotY = enemy_shotY + rMovement4 1920 bcbc 1921 bcbc ad 62 01 LDA rDirection 1922 bcbf c9 01 CMP #1 1923 bcc1 d0 14 BNE .skipL0169 1924 bcc3 .condpart43 1925 bcc3 ad 58 01 LDA enemy_shotX 1926 bcc6 18 CLC 1927 bcc7 6d 5e 01 ADC rMovement3 1928 bcca 8d 58 01 STA enemy_shotX 1929 bccd ad 59 01 LDA enemy_shotY 1930 bcd0 18 CLC 1931 bcd1 6d 5f 01 ADC rMovement4 1932 bcd4 8d 59 01 STA enemy_shotY 1933 bcd7 .skipL0169 1934 bcd7 .L0170 ;; if rDirection = 2 then enemy_shotX = enemy_shotX + rMovement5 : enemy_shotY = enemy_shotY + rMovement6 1935 bcd7 1936 bcd7 ad 62 01 LDA rDirection 1937 bcda c9 02 CMP #2 1938 bcdc d0 14 BNE .skipL0170 1939 bcde .condpart44 1940 bcde ad 58 01 LDA enemy_shotX 1941 bce1 18 CLC 1942 bce2 6d 60 01 ADC rMovement5 1943 bce5 8d 58 01 STA enemy_shotX 1944 bce8 ad 59 01 LDA enemy_shotY 1945 bceb 18 CLC 1946 bcec 6d 61 01 ADC rMovement6 1947 bcef 8d 59 01 STA enemy_shotY 1948 bcf2 .skipL0170 1949 bcf2 .L0171 ;; if rDirection = 3 then enemy_shotX = enemy_shotX + rMovement4 : enemy_shotY = enemy_shotY + rMovement2 1950 bcf2 1951 bcf2 ad 62 01 LDA rDirection 1952 bcf5 c9 03 CMP #3 1953 bcf7 d0 14 BNE .skipL0171 1954 bcf9 .condpart45 1955 bcf9 ad 58 01 LDA enemy_shotX 1956 bcfc 18 CLC 1957 bcfd 6d 5f 01 ADC rMovement4 1958 bd00 8d 58 01 STA enemy_shotX 1959 bd03 ad 59 01 LDA enemy_shotY 1960 bd06 18 CLC 1961 bd07 6d 5d 01 ADC rMovement2 1962 bd0a 8d 59 01 STA enemy_shotY 1963 bd0d .skipL0171 1964 bd0d . 1965 bd0d ;; 1966 bd0d 1967 bd0d .L0172 ;; if rDirection = 0 then power_upX = power_upX + rMovement5 : power_upY = power_upY + rMovement2 1968 bd0d 1969 bd0d ad 62 01 LDA rDirection 1970 bd10 c9 00 CMP #0 1971 bd12 d0 14 BNE .skipL0172 1972 bd14 .condpart46 1973 bd14 ad 4f 01 LDA power_upX 1974 bd17 18 CLC 1975 bd18 6d 60 01 ADC rMovement5 1976 bd1b 8d 4f 01 STA power_upX 1977 bd1e ad 50 01 LDA power_upY 1978 bd21 18 CLC 1979 bd22 6d 5d 01 ADC rMovement2 1980 bd25 8d 50 01 STA power_upY 1981 bd28 .skipL0172 1982 bd28 .L0173 ;; if rDirection = 1 then power_upX = power_upX + rMovement3 : power_upY = power_upY + rMovement4 1983 bd28 1984 bd28 ad 62 01 LDA rDirection 1985 bd2b c9 01 CMP #1 1986 bd2d d0 14 BNE .skipL0173 1987 bd2f .condpart47 1988 bd2f ad 4f 01 LDA power_upX 1989 bd32 18 CLC 1990 bd33 6d 5e 01 ADC rMovement3 1991 bd36 8d 4f 01 STA power_upX 1992 bd39 ad 50 01 LDA power_upY 1993 bd3c 18 CLC 1994 bd3d 6d 5f 01 ADC rMovement4 1995 bd40 8d 50 01 STA power_upY 1996 bd43 .skipL0173 1997 bd43 .L0174 ;; if rDirection = 2 then power_upX = power_upX + rMovement1 : power_upY = power_upY + rMovement6 1998 bd43 1999 bd43 ad 62 01 LDA rDirection 2000 bd46 c9 02 CMP #2 2001 bd48 d0 14 BNE .skipL0174 2002 bd4a .condpart48 2003 bd4a ad 4f 01 LDA power_upX 2004 bd4d 18 CLC 2005 bd4e 6d 5c 01 ADC rMovement1 2006 bd51 8d 4f 01 STA power_upX 2007 bd54 ad 50 01 LDA power_upY 2008 bd57 18 CLC 2009 bd58 6d 61 01 ADC rMovement6 2010 bd5b 8d 50 01 STA power_upY 2011 bd5e .skipL0174 2012 bd5e . 2013 bd5e ;; 2014 bd5e 2015 bd5e .L0175 ;; if rDirection = 0 then enemy01_X = enemy01_X + rMovement4 : enemy01_Y = enemy01_Y + rMovement2 2016 bd5e 2017 bd5e ad 62 01 LDA rDirection 2018 bd61 c9 00 CMP #0 2019 bd63 d0 14 BNE .skipL0175 2020 bd65 .condpart49 2021 bd65 ad 53 01 LDA enemy01_X 2022 bd68 18 CLC 2023 bd69 6d 5f 01 ADC rMovement4 2024 bd6c 8d 53 01 STA enemy01_X 2025 bd6f ad 54 01 LDA enemy01_Y 2026 bd72 18 CLC 2027 bd73 6d 5d 01 ADC rMovement2 2028 bd76 8d 54 01 STA enemy01_Y 2029 bd79 .skipL0175 2030 bd79 .L0176 ;; if rDirection = 1 then enemy01_X = enemy01_X + rMovement3 : enemy01_Y = enemy01_Y + rMovement4 2031 bd79 2032 bd79 ad 62 01 LDA rDirection 2033 bd7c c9 01 CMP #1 2034 bd7e d0 14 BNE .skipL0176 2035 bd80 .condpart50 2036 bd80 ad 53 01 LDA enemy01_X 2037 bd83 18 CLC 2038 bd84 6d 5e 01 ADC rMovement3 2039 bd87 8d 53 01 STA enemy01_X 2040 bd8a ad 54 01 LDA enemy01_Y 2041 bd8d 18 CLC 2042 bd8e 6d 5f 01 ADC rMovement4 2043 bd91 8d 54 01 STA enemy01_Y 2044 bd94 .skipL0176 2045 bd94 .L0177 ;; if rDirection = 2 then enemy01_X = enemy01_X + rMovement6 : enemy01_Y = enemy01_Y + rMovement6 2046 bd94 2047 bd94 ad 62 01 LDA rDirection 2048 bd97 c9 02 CMP #2 2049 bd99 d0 14 BNE .skipL0177 2050 bd9b .condpart51 2051 bd9b ad 53 01 LDA enemy01_X 2052 bd9e 18 CLC 2053 bd9f 6d 61 01 ADC rMovement6 2054 bda2 8d 53 01 STA enemy01_X 2055 bda5 ad 54 01 LDA enemy01_Y 2056 bda8 18 CLC 2057 bda9 6d 61 01 ADC rMovement6 2058 bdac 8d 54 01 STA enemy01_Y 2059 bdaf .skipL0177 2060 bdaf . 2061 bdaf ;; 2062 bdaf 2063 bdaf .L0178 ;; if rDirection = 0 then extra_shipX = extra_shipX + rMovement5 : extra_shipY = extra_shipY + rMovement2 2064 bdaf 2065 bdaf ad 62 01 LDA rDirection 2066 bdb2 c9 00 CMP #0 2067 bdb4 d0 14 BNE .skipL0178 2068 bdb6 .condpart52 2069 bdb6 ad 4c 01 LDA extra_shipX 2070 bdb9 18 CLC 2071 bdba 6d 60 01 ADC rMovement5 2072 bdbd 8d 4c 01 STA extra_shipX 2073 bdc0 ad 4d 01 LDA extra_shipY 2074 bdc3 18 CLC 2075 bdc4 6d 5d 01 ADC rMovement2 2076 bdc7 8d 4d 01 STA extra_shipY 2077 bdca .skipL0178 2078 bdca . 2079 bdca ;; 2080 bdca 2081 bdca .L0179 ;; if playerFlag = 1 && explosion_aniframe = 1 then playsfx sfx_explosion 2082 bdca 2083 bdca ad 43 01 LDA playerFlag 2084 bdcd c9 01 CMP #1 2085 bdcf d0 20 BNE .skipL0179 2086 bdd1 .condpart53 2087 bdd1 ad 6b 01 LDA explosion_aniframe 2088 bdd4 c9 01 CMP #1 2089 bdd6 d0 19 BNE .skip53then 2090 bdd8 .condpart54 2091 bdd8 a9 01 lda #1 2092 bdda 85 de sta sfxschedulelock 2093 bddc a9 42 lda #sfx_explosion 2096 bde2 85 e1 sta sfxinstrumenthi 2097 bde4 a9 00 lda #0 2098 bde6 85 e2 sta sfxpitchoffset ; no pitch modification 2099 bde8 85 e3 sta sfxnoteindex ; not a musical note 2100 bdea 20 58 f2 jsr schedulesfx 2101 bded a9 00 lda #0 2102 bdef 85 de sta sfxschedulelock 2103 bdf1 .skip53then 2104 bdf1 .skipL0179 2105 bdf1 .L0180 ;; if playerFlag = 1 then enemy_shotSlowdown = enemy_shotSlowdown + 1 2106 bdf1 2107 bdf1 ad 43 01 LDA playerFlag 2108 bdf4 c9 01 CMP #1 2109 bdf6 d0 09 BNE .skipL0180 2110 bdf8 .condpart55 2111 bdf8 ad 5b 01 LDA enemy_shotSlowdown 2112 bdfb 18 CLC 2113 bdfc 69 01 ADC #1 2114 bdfe 8d 5b 01 STA enemy_shotSlowdown 2115 be01 .skipL0180 2116 be01 .L0181 ;; if playerFlag = 1 && enemy_shotSlowdown = 8 then enemy_shotSlowdown = 0 2117 be01 2118 be01 ad 43 01 LDA playerFlag 2119 be04 c9 01 CMP #1 2120 be06 d0 0c BNE .skipL0181 2121 be08 .condpart56 2122 be08 ad 5b 01 LDA enemy_shotSlowdown 2123 be0b c9 08 CMP #8 2124 be0d d0 05 BNE .skip56then 2125 be0f .condpart57 2126 be0f a9 00 LDA #0 2127 be11 8d 5b 01 STA enemy_shotSlowdown 2128 be14 .skip56then 2129 be14 .skipL0181 2130 be14 .L0182 ;; if playerFlag = 1 && enemy_shotSlowdown = 2 then explosion_aniframe = explosion_aniframe + 1 2131 be14 2132 be14 ad 43 01 LDA playerFlag 2133 be17 c9 01 CMP #1 2134 be19 d0 10 BNE .skipL0182 2135 be1b .condpart58 2136 be1b ad 5b 01 LDA enemy_shotSlowdown 2137 be1e c9 02 CMP #2 2138 be20 d0 09 BNE .skip58then 2139 be22 .condpart59 2140 be22 ad 6b 01 LDA explosion_aniframe 2141 be25 18 CLC 2142 be26 69 01 ADC #1 2143 be28 8d 6b 01 STA explosion_aniframe 2144 be2b .skip58then 2145 be2b .skipL0182 2146 be2b .L0183 ;; if playerFlag = 1 && explosion_aniframe > 11 then explosion_aniframe = 200 2147 be2b 2148 be2b ad 43 01 LDA playerFlag 2149 be2e c9 01 CMP #1 2150 be30 d0 0c BNE .skipL0183 2151 be32 .condpart60 2152 be32 a9 0b LDA #11 2153 be34 cd 6b 01 CMP explosion_aniframe 2154 be37 b0 05 BCS .skip60then 2155 be39 .condpart61 2156 be39 a9 c8 LDA #200 2157 be3b 8d 6b 01 STA explosion_aniframe 2158 be3e .skip60then 2159 be3e .skipL0183 2160 be3e . 2161 be3e ;; 2162 be3e 2163 be3e ._mainLoopSkipJoystickCheck 2164 be3e ;; _mainLoopSkipJoystickCheck 2165 be3e 2166 be3e .L0184 ;; restorescreen 2167 be3e 2168 be3e 20 9e f0 jsr restorescreen 2169 be41 .L0185 ;; gosub draw_scores 2170 be41 2171 be41 20 ea c9 jsr .draw_scores 2172 be44 2173 be44 .L0186 ;; gosub draw_sprites 2174 be44 2175 be44 20 00 c8 jsr .draw_sprites 2176 be47 2177 be47 .L0187 ;; drawscreen 2178 be47 2179 be47 20 c0 f0 jsr drawscreen 2180 be4a . 2181 be4a ;; 2182 be4a 2183 be4a .L0188 ;; goto mainloop 2184 be4a 2185 be4a 4c f7 b8 jmp .mainloop 2186 be4d 2187 be4d .L0189 ;; dmahole 1 2188 be4d 2189 be4d 4c 00 c8 jmp dmahole_1 2190 be4d DMAHOLEEND0 SET . 432 bytes of ROM space left in DMA hole 0. 2191 be4d echo " "," "," "," ",[(256*WZONEHEIGHT)-(DMAHOLEEND0 - DMAHOLESTART0)]d , "bytes of ROM space left in DMA hole 0." 2192 be50 - if ((256*WZONEHEIGHT)-(DMAHOLEEND0 - DMAHOLESTART0)) < 0 2193 be50 -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 2194 be50 endif 2195 be50 2196 c000 ORG $C000,0 ; ************* 2197 c000 2198 c000 vertical_shooting_1up 2199 c000 15 55 HEX 1555 2200 c002 vertical_shooting_explosion_01 2201 c002 02 80 HEX 0280 2202 c004 vertical_shooting_explosion_01_tallsprite_00 2203 c004 00 00 HEX 0000 2204 c006 vertical_shooting_explosion_02 2205 c006 05 50 HEX 0550 2206 c008 vertical_shooting_explosion_02_tallsprite_00 2207 c008 00 00 HEX 0000 2208 c00a vertical_shooting_explosion_03 2209 c00a 15 54 HEX 1554 2210 c00c vertical_shooting_explosion_03_tallsprite_00 2211 c00c 00 00 HEX 0000 2212 c00e vertical_shooting_explosion_04 2213 c00e 07 d0 HEX 07d0 2214 c010 vertical_shooting_explosion_04_tallsprite_00 2215 c010 00 00 HEX 0000 2216 c012 vertical_shooting_explosion_05 2217 c012 0c 30 HEX 0c30 2218 c014 vertical_shooting_explosion_05_tallsprite_00 2219 c014 01 40 HEX 0140 2220 c016 vertical_shooting_explosion_06 2221 c016 00 00 HEX 0000 2222 c018 vertical_shooting_explosion_06_tallsprite_00 2223 c018 01 40 HEX 0140 2224 c01a vertical_shooting_explosion_07 2225 c01a 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2226 c02e vertical_shooting_explosion_07_tallsprite_00 2227 c02e 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2228 c042 vertical_shooting_explosion_08 2229 c042 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2230 c056 vertical_shooting_explosion_08_tallsprite_00 2231 c056 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2232 c06a vertical_shooting_explosion_09 2233 c06a 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2234 c07e vertical_shooting_explosion_09_tallsprite_00 2235 c07e 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2236 c092 vertical_shooting_explosion_10 2237 c092 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2238 c0a6 vertical_shooting_explosion_10_tallsprite_00 2239 c0a6 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2240 c0ba vertical_shooting_laser 2241 c0ba 88 HEX 88 2242 c0bb vertical_shooting_laser_tallsprite_00 2243 c0bb cc HEX cc 2244 c0bc 2245 c100 ORG $C100,0 ; ************* 2246 c100 2247 c100 ;vertical_shooting_1up 2248 c100 ea a9 HEX eaa9 2249 c102 ;vertical_shooting_explosion_01 2250 c102 01 40 HEX 0140 2251 c104 ;vertical_shooting_explosion_01_tallsprite_00 2252 c104 00 00 HEX 0000 2253 c106 ;vertical_shooting_explosion_02 2254 c106 09 60 HEX 0960 2255 c108 ;vertical_shooting_explosion_02_tallsprite_00 2256 c108 00 00 HEX 0000 2257 c10a ;vertical_shooting_explosion_03 2258 c10a 25 58 HEX 2558 2259 c10c ;vertical_shooting_explosion_03_tallsprite_00 2260 c10c 00 00 HEX 0000 2261 c10e ;vertical_shooting_explosion_04 2262 c10e 05 50 HEX 0550 2263 c110 ;vertical_shooting_explosion_04_tallsprite_00 2264 c110 02 80 HEX 0280 2265 c112 ;vertical_shooting_explosion_05 2266 c112 0b e0 HEX 0be0 2267 c114 ;vertical_shooting_explosion_05_tallsprite_00 2268 c114 01 40 HEX 0140 2269 c116 ;vertical_shooting_explosion_06 2270 c116 0c 30 HEX 0c30 2271 c118 ;vertical_shooting_explosion_06_tallsprite_00 2272 c118 01 40 HEX 0140 2273 c11a ;vertical_shooting_explosion_07 2274 c11a 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2275 c12e ;vertical_shooting_explosion_07_tallsprite_00 2276 c12e 00 00 00 00* HEX 0000000000000140014001400140014001400000 2277 c142 ;vertical_shooting_explosion_08 2278 c142 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2279 c156 ;vertical_shooting_explosion_08_tallsprite_00 2280 c156 00 00 00 00* HEX 0000000000000140014001400140014001400000 2281 c16a ;vertical_shooting_explosion_09 2282 c16a 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2283 c17e ;vertical_shooting_explosion_09_tallsprite_00 2284 c17e 00 00 00 00* HEX 0000000000000140014001400140014001400000 2285 c192 ;vertical_shooting_explosion_10 2286 c192 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2287 c1a6 ;vertical_shooting_explosion_10_tallsprite_00 2288 c1a6 00 00 00 00* HEX 0000000000000140014001400140014001400000 2289 c1ba ;vertical_shooting_laser 2290 c1ba 88 HEX 88 2291 c1bb ;vertical_shooting_laser_tallsprite_00 2292 c1bb cc HEX cc 2293 c1bc 2294 c200 ORG $C200,0 ; ************* 2295 c200 2296 c200 ;vertical_shooting_1up 2297 c200 d5 58 HEX d558 2298 c202 ;vertical_shooting_explosion_01 2299 c202 00 00 HEX 0000 2300 c204 ;vertical_shooting_explosion_01_tallsprite_00 2301 c204 00 00 HEX 0000 2302 c206 ;vertical_shooting_explosion_02 2303 c206 02 80 HEX 0280 2304 c208 ;vertical_shooting_explosion_02_tallsprite_00 2305 c208 00 00 HEX 0000 2306 c20a ;vertical_shooting_explosion_03 2307 c20a 09 60 HEX 0960 2308 c20c ;vertical_shooting_explosion_03_tallsprite_00 2309 c20c 00 00 HEX 0000 2310 c20e ;vertical_shooting_explosion_04 2311 c20e 05 50 HEX 0550 2312 c210 ;vertical_shooting_explosion_04_tallsprite_00 2313 c210 02 80 HEX 0280 2314 c212 ;vertical_shooting_explosion_05 2315 c212 0a a0 HEX 0aa0 2316 c214 ;vertical_shooting_explosion_05_tallsprite_00 2317 c214 05 50 HEX 0550 2318 c216 ;vertical_shooting_explosion_06 2319 c216 0b e0 HEX 0be0 2320 c218 ;vertical_shooting_explosion_06_tallsprite_00 2321 c218 05 50 HEX 0550 2322 c21a ;vertical_shooting_explosion_07 2323 c21a 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2324 c22e ;vertical_shooting_explosion_07_tallsprite_00 2325 c22e 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2326 c242 ;vertical_shooting_explosion_08 2327 c242 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2328 c256 ;vertical_shooting_explosion_08_tallsprite_00 2329 c256 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2330 c26a ;vertical_shooting_explosion_09 2331 c26a 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2332 c27e ;vertical_shooting_explosion_09_tallsprite_00 2333 c27e 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2334 c292 ;vertical_shooting_explosion_10 2335 c292 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2336 c2a6 ;vertical_shooting_explosion_10_tallsprite_00 2337 c2a6 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2338 c2ba ;vertical_shooting_laser 2339 c2ba 44 HEX 44 2340 c2bb ;vertical_shooting_laser_tallsprite_00 2341 c2bb cc HEX cc 2342 c2bc 2343 c300 ORG $C300,0 ; ************* 2344 c300 2345 c300 ;vertical_shooting_1up 2346 c300 35 60 HEX 3560 2347 c302 ;vertical_shooting_explosion_01 2348 c302 00 00 HEX 0000 2349 c304 ;vertical_shooting_explosion_01_tallsprite_00 2350 c304 00 00 HEX 0000 2351 c306 ;vertical_shooting_explosion_02 2352 c306 00 00 HEX 0000 2353 c308 ;vertical_shooting_explosion_02_tallsprite_00 2354 c308 00 00 HEX 0000 2355 c30a ;vertical_shooting_explosion_03 2356 c30a 02 80 HEX 0280 2357 c30c ;vertical_shooting_explosion_03_tallsprite_00 2358 c30c 00 00 HEX 0000 2359 c30e ;vertical_shooting_explosion_04 2360 c30e 09 60 HEX 0960 2361 c310 ;vertical_shooting_explosion_04_tallsprite_00 2362 c310 09 60 HEX 0960 2363 c312 ;vertical_shooting_explosion_05 2364 c312 06 90 HEX 0690 2365 c314 ;vertical_shooting_explosion_05_tallsprite_00 2366 c314 06 90 HEX 0690 2367 c316 ;vertical_shooting_explosion_06 2368 c316 06 90 HEX 0690 2369 c318 ;vertical_shooting_explosion_06_tallsprite_00 2370 c318 06 90 HEX 0690 2371 c31a ;vertical_shooting_explosion_07 2372 c31a 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2373 c32e ;vertical_shooting_explosion_07_tallsprite_00 2374 c32e 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2375 c342 ;vertical_shooting_explosion_08 2376 c342 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2377 c356 ;vertical_shooting_explosion_08_tallsprite_00 2378 c356 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2379 c36a ;vertical_shooting_explosion_09 2380 c36a 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2381 c37e ;vertical_shooting_explosion_09_tallsprite_00 2382 c37e 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2383 c392 ;vertical_shooting_explosion_10 2384 c392 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2385 c3a6 ;vertical_shooting_explosion_10_tallsprite_00 2386 c3a6 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2387 c3ba ;vertical_shooting_laser 2388 c3ba 44 HEX 44 2389 c3bb ;vertical_shooting_laser_tallsprite_00 2390 c3bb cc HEX cc 2391 c3bc 2392 c400 ORG $C400,0 ; ************* 2393 c400 2394 c400 ;vertical_shooting_1up 2395 c400 35 60 HEX 3560 2396 c402 ;vertical_shooting_explosion_01 2397 c402 00 00 HEX 0000 2398 c404 ;vertical_shooting_explosion_01_tallsprite_00 2399 c404 00 00 HEX 0000 2400 c406 ;vertical_shooting_explosion_02 2401 c406 00 00 HEX 0000 2402 c408 ;vertical_shooting_explosion_02_tallsprite_00 2403 c408 00 00 HEX 0000 2404 c40a ;vertical_shooting_explosion_03 2405 c40a 00 00 HEX 0000 2406 c40c ;vertical_shooting_explosion_03_tallsprite_00 2407 c40c 02 80 HEX 0280 2408 c40e ;vertical_shooting_explosion_04 2409 c40e 09 60 HEX 0960 2410 c410 ;vertical_shooting_explosion_04_tallsprite_00 2411 c410 09 60 HEX 0960 2412 c412 ;vertical_shooting_explosion_05 2413 c412 06 90 HEX 0690 2414 c414 ;vertical_shooting_explosion_05_tallsprite_00 2415 c414 06 90 HEX 0690 2416 c416 ;vertical_shooting_explosion_06 2417 c416 06 90 HEX 0690 2418 c418 ;vertical_shooting_explosion_06_tallsprite_00 2419 c418 06 90 HEX 0690 2420 c41a ;vertical_shooting_explosion_07 2421 c41a 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2422 c42e ;vertical_shooting_explosion_07_tallsprite_00 2423 c42e 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2424 c442 ;vertical_shooting_explosion_08 2425 c442 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2426 c456 ;vertical_shooting_explosion_08_tallsprite_00 2427 c456 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2428 c46a ;vertical_shooting_explosion_09 2429 c46a 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2430 c47e ;vertical_shooting_explosion_09_tallsprite_00 2431 c47e 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2432 c492 ;vertical_shooting_explosion_10 2433 c492 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2434 c4a6 ;vertical_shooting_explosion_10_tallsprite_00 2435 c4a6 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2436 c4ba ;vertical_shooting_laser 2437 c4ba 44 HEX 44 2438 c4bb ;vertical_shooting_laser_tallsprite_00 2439 c4bb cc HEX cc 2440 c4bc 2441 c500 ORG $C500,0 ; ************* 2442 c500 2443 c500 ;vertical_shooting_1up 2444 c500 0d 80 HEX 0d80 2445 c502 ;vertical_shooting_explosion_01 2446 c502 00 00 HEX 0000 2447 c504 ;vertical_shooting_explosion_01_tallsprite_00 2448 c504 00 00 HEX 0000 2449 c506 ;vertical_shooting_explosion_02 2450 c506 00 00 HEX 0000 2451 c508 ;vertical_shooting_explosion_02_tallsprite_00 2452 c508 02 80 HEX 0280 2453 c50a ;vertical_shooting_explosion_03 2454 c50a 00 00 HEX 0000 2455 c50c ;vertical_shooting_explosion_03_tallsprite_00 2456 c50c 09 60 HEX 0960 2457 c50e ;vertical_shooting_explosion_04 2458 c50e 02 80 HEX 0280 2459 c510 ;vertical_shooting_explosion_04_tallsprite_00 2460 c510 05 50 HEX 0550 2461 c512 ;vertical_shooting_explosion_05 2462 c512 05 50 HEX 0550 2463 c514 ;vertical_shooting_explosion_05_tallsprite_00 2464 c514 0a a0 HEX 0aa0 2465 c516 ;vertical_shooting_explosion_06 2466 c516 05 50 HEX 0550 2467 c518 ;vertical_shooting_explosion_06_tallsprite_00 2468 c518 0b e0 HEX 0be0 2469 c51a ;vertical_shooting_explosion_07 2470 c51a 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2471 c52e ;vertical_shooting_explosion_07_tallsprite_00 2472 c52e 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2473 c542 ;vertical_shooting_explosion_08 2474 c542 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2475 c556 ;vertical_shooting_explosion_08_tallsprite_00 2476 c556 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2477 c56a ;vertical_shooting_explosion_09 2478 c56a 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2479 c57e ;vertical_shooting_explosion_09_tallsprite_00 2480 c57e 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2481 c592 ;vertical_shooting_explosion_10 2482 c592 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2483 c5a6 ;vertical_shooting_explosion_10_tallsprite_00 2484 c5a6 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2485 c5ba ;vertical_shooting_laser 2486 c5ba 44 HEX 44 2487 c5bb ;vertical_shooting_laser_tallsprite_00 2488 c5bb 88 HEX 88 2489 c5bc 2490 c600 ORG $C600,0 ; ************* 2491 c600 2492 c600 ;vertical_shooting_1up 2493 c600 0d 80 HEX 0d80 2494 c602 ;vertical_shooting_explosion_01 2495 c602 00 00 HEX 0000 2496 c604 ;vertical_shooting_explosion_01_tallsprite_00 2497 c604 01 40 HEX 0140 2498 c606 ;vertical_shooting_explosion_02 2499 c606 00 00 HEX 0000 2500 c608 ;vertical_shooting_explosion_02_tallsprite_00 2501 c608 09 60 HEX 0960 2502 c60a ;vertical_shooting_explosion_03 2503 c60a 00 00 HEX 0000 2504 c60c ;vertical_shooting_explosion_03_tallsprite_00 2505 c60c 25 58 HEX 2558 2506 c60e ;vertical_shooting_explosion_04 2507 c60e 02 80 HEX 0280 2508 c610 ;vertical_shooting_explosion_04_tallsprite_00 2509 c610 05 50 HEX 0550 2510 c612 ;vertical_shooting_explosion_05 2511 c612 01 40 HEX 0140 2512 c614 ;vertical_shooting_explosion_05_tallsprite_00 2513 c614 0b e0 HEX 0be0 2514 c616 ;vertical_shooting_explosion_06 2515 c616 01 40 HEX 0140 2516 c618 ;vertical_shooting_explosion_06_tallsprite_00 2517 c618 0c 30 HEX 0c30 2518 c61a ;vertical_shooting_explosion_07 2519 c61a 00 00 00 00* HEX 0000000000000140014001400140014001400000 2520 c62e ;vertical_shooting_explosion_07_tallsprite_00 2521 c62e 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2522 c642 ;vertical_shooting_explosion_08 2523 c642 00 00 00 00* HEX 0000000000000140014001400140014001400000 2524 c656 ;vertical_shooting_explosion_08_tallsprite_00 2525 c656 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2526 c66a ;vertical_shooting_explosion_09 2527 c66a 00 00 00 00* HEX 0000000000000140014001400140014001400000 2528 c67e ;vertical_shooting_explosion_09_tallsprite_00 2529 c67e 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2530 c692 ;vertical_shooting_explosion_10 2531 c692 00 00 00 00* HEX 0000000000000140014001400140014001400000 2532 c6a6 ;vertical_shooting_explosion_10_tallsprite_00 2533 c6a6 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2534 c6ba ;vertical_shooting_laser 2535 c6ba 44 HEX 44 2536 c6bb ;vertical_shooting_laser_tallsprite_00 2537 c6bb 88 HEX 88 2538 c6bc 2539 c700 ORG $C700,0 ; ************* 2540 c700 2541 c700 ;vertical_shooting_1up 2542 c700 03 00 HEX 0300 2543 c702 ;vertical_shooting_explosion_01 2544 c702 00 00 HEX 0000 2545 c704 ;vertical_shooting_explosion_01_tallsprite_00 2546 c704 02 80 HEX 0280 2547 c706 ;vertical_shooting_explosion_02 2548 c706 00 00 HEX 0000 2549 c708 ;vertical_shooting_explosion_02_tallsprite_00 2550 c708 05 50 HEX 0550 2551 c70a ;vertical_shooting_explosion_03 2552 c70a 00 00 HEX 0000 2553 c70c ;vertical_shooting_explosion_03_tallsprite_00 2554 c70c 15 54 HEX 1554 2555 c70e ;vertical_shooting_explosion_04 2556 c70e 00 00 HEX 0000 2557 c710 ;vertical_shooting_explosion_04_tallsprite_00 2558 c710 07 d0 HEX 07d0 2559 c712 ;vertical_shooting_explosion_05 2560 c712 01 40 HEX 0140 2561 c714 ;vertical_shooting_explosion_05_tallsprite_00 2562 c714 0c 30 HEX 0c30 2563 c716 ;vertical_shooting_explosion_06 2564 c716 01 40 HEX 0140 2565 c718 ;vertical_shooting_explosion_06_tallsprite_00 2566 c718 00 00 HEX 0000 2567 c71a ;vertical_shooting_explosion_07 2568 c71a 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2569 c72e ;vertical_shooting_explosion_07_tallsprite_00 2570 c72e 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2571 c742 ;vertical_shooting_explosion_08 2572 c742 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2573 c756 ;vertical_shooting_explosion_08_tallsprite_00 2574 c756 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2575 c76a ;vertical_shooting_explosion_09 2576 c76a 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2577 c77e ;vertical_shooting_explosion_09_tallsprite_00 2578 c77e 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2579 c792 ;vertical_shooting_explosion_10 2580 c792 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2581 c7a6 ;vertical_shooting_explosion_10_tallsprite_00 2582 c7a6 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2583 c7ba ;vertical_shooting_laser 2584 c7ba 44 HEX 44 2585 c7bb ;vertical_shooting_laser_tallsprite_00 2586 c7bb 88 HEX 88 2587 c7bc 2588 c800 ORG $C800,0 ; ************* 2589 c800 dmahole_1 2590 c800 DMAHOLESTART1 SET . 2591 c800 . 2592 c800 ;; 2593 c800 2594 c800 .draw_sprites 2595 c800 ;; draw_sprites 2596 c800 2597 c800 .L0190 ;; plotsprite vertical_shooting_ship 0 playerX playerY 2598 c800 2599 c800 a9 2d lda #vertical_shooting_ship 2603 c806 85 43 sta temp2 2604 c808 2605 c808 a9 1e lda #(0|vertical_shooting_ship_width_twoscompliment) 2606 c80a 85 44 sta temp3 2607 c80c 2608 c80c ad 41 01 lda playerX 2609 c80f 85 45 sta temp4 2610 c811 2611 c811 ad 42 01 lda playerY 2612 c814 2613 c814 85 46 sta temp5 2614 c816 2615 c816 a9 40 lda #(vertical_shooting_ship_mode|%01000000) 2616 c818 85 47 sta temp6 2617 c81a 2618 c81a 20 a0 f2 jsr plotsprite 2619 c81d ; +tall sprite replot 2620 c81d 18 clc 2621 c81e a5 42 lda temp1 2622 c820 69 02 adc #vertical_shooting_ship_width 2623 c822 85 42 sta temp1 2624 c824 a5 46 lda temp5 2625 c826 69 08 adc #WZONEHEIGHT 2626 c828 85 46 sta temp5 2627 c82a 20 a0 f2 jsr plotsprite 2628 c82d .L0191 ;; plotsprite vertical_shooting_bullet 1 bulletX bulletY 2629 c82d 2630 c82d a9 31 lda #vertical_shooting_bullet 2634 c833 85 43 sta temp2 2635 c835 2636 c835 a9 3f lda #(32|vertical_shooting_bullet_width_twoscompliment) 2637 c837 85 44 sta temp3 2638 c839 2639 c839 ad 49 01 lda bulletX 2640 c83c 85 45 sta temp4 2641 c83e 2642 c83e ad 4a 01 lda bulletY 2643 c841 2644 c841 85 46 sta temp5 2645 c843 2646 c843 a9 40 lda #(vertical_shooting_bullet_mode|%01000000) 2647 c845 85 47 sta temp6 2648 c847 2649 c847 20 a0 f2 jsr plotsprite 2650 c84a .L0192 ;; plotsprite vertical_shooting_enemyshot 2 enemy_shotX enemy_shotY 2651 c84a 2652 c84a a9 32 lda #vertical_shooting_enemyshot 2656 c850 85 43 sta temp2 2657 c852 2658 c852 a9 5f lda #(64|vertical_shooting_enemyshot_width_twoscompliment) 2659 c854 85 44 sta temp3 2660 c856 2661 c856 ad 58 01 lda enemy_shotX 2662 c859 85 45 sta temp4 2663 c85b 2664 c85b ad 59 01 lda enemy_shotY 2665 c85e 2666 c85e 85 46 sta temp5 2667 c860 2668 c860 a9 40 lda #(vertical_shooting_enemyshot_mode|%01000000) 2669 c862 85 47 sta temp6 2670 c864 2671 c864 20 a0 f2 jsr plotsprite 2672 c867 .L0193 ;; plotsprite vertical_shooting_powerup 3 power_upX power_upY 2673 c867 2674 c867 a9 33 lda #vertical_shooting_powerup 2678 c86d 85 43 sta temp2 2679 c86f 2680 c86f a9 7e lda #(96|vertical_shooting_powerup_width_twoscompliment) 2681 c871 85 44 sta temp3 2682 c873 2683 c873 ad 4f 01 lda power_upX 2684 c876 85 45 sta temp4 2685 c878 2686 c878 ad 50 01 lda power_upY 2687 c87b 2688 c87b 85 46 sta temp5 2689 c87d 2690 c87d a9 40 lda #(vertical_shooting_powerup_mode|%01000000) 2691 c87f 85 47 sta temp6 2692 c881 2693 c881 20 a0 f2 jsr plotsprite 2694 c884 .L0194 ;; plotsprite vertical_shooting_enemy01 2 enemy01_X enemy01_Y 2695 c884 2696 c884 a9 35 lda #vertical_shooting_enemy01 2700 c88a 85 43 sta temp2 2701 c88c 2702 c88c a9 5e lda #(64|vertical_shooting_enemy01_width_twoscompliment) 2703 c88e 85 44 sta temp3 2704 c890 2705 c890 ad 53 01 lda enemy01_X 2706 c893 85 45 sta temp4 2707 c895 2708 c895 ad 54 01 lda enemy01_Y 2709 c898 2710 c898 85 46 sta temp5 2711 c89a 2712 c89a a9 40 lda #(vertical_shooting_enemy01_mode|%01000000) 2713 c89c 85 47 sta temp6 2714 c89e 2715 c89e 20 a0 f2 jsr plotsprite 2716 c8a1 ; +tall sprite replot 2717 c8a1 18 clc 2718 c8a2 a5 42 lda temp1 2719 c8a4 69 02 adc #vertical_shooting_enemy01_width 2720 c8a6 85 42 sta temp1 2721 c8a8 a5 46 lda temp5 2722 c8aa 69 08 adc #WZONEHEIGHT 2723 c8ac 85 46 sta temp5 2724 c8ae 20 a0 f2 jsr plotsprite 2725 c8b1 .L0195 ;; plotsprite vertical_shooting_1up 0 extra_shipX extra_shipY 2726 c8b1 2727 c8b1 a9 00 lda #vertical_shooting_1up 2731 c8b7 85 43 sta temp2 2732 c8b9 2733 c8b9 a9 1e lda #(0|vertical_shooting_1up_width_twoscompliment) 2734 c8bb 85 44 sta temp3 2735 c8bd 2736 c8bd ad 4c 01 lda extra_shipX 2737 c8c0 85 45 sta temp4 2738 c8c2 2739 c8c2 ad 4d 01 lda extra_shipY 2740 c8c5 2741 c8c5 85 46 sta temp5 2742 c8c7 2743 c8c7 a9 40 lda #(vertical_shooting_1up_mode|%01000000) 2744 c8c9 85 47 sta temp6 2745 c8cb 2746 c8cb 20 a0 f2 jsr plotsprite 2747 c8ce .L0196 ;; plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 2748 c8ce 2749 c8ce a9 02 lda #vertical_shooting_explosion_01 2761 c8df 85 43 sta temp2 2762 c8e1 2763 c8e1 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2764 c8e3 85 44 sta temp3 2765 c8e5 2766 c8e5 ad 41 01 lda playerX 2767 c8e8 85 45 sta temp4 2768 c8ea 2769 c8ea ad 42 01 lda playerY 2770 c8ed 85 46 sta temp5 2771 c8ef 2772 c8ef a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2773 c8f1 85 47 sta temp6 2774 c8f3 2775 c8f3 20 a0 f2 jsr plotsprite 2776 c8f6 ; +tall sprite replot 2777 c8f6 18 clc 2778 c8f7 a5 42 lda temp1 2779 c8f9 69 02 adc #vertical_shooting_explosion_01_width 2780 c8fb 85 42 sta temp1 2781 c8fd a5 46 lda temp5 2782 c8ff 69 08 adc #WZONEHEIGHT 2783 c901 85 46 sta temp5 2784 c903 20 a0 f2 jsr plotsprite 2785 c906 .L0197 ;; plotsprite vertical_shooting_explosion_01 3 enemy01_X enemy01_Y explosion_aniframe 2786 c906 2787 c906 a9 02 lda #vertical_shooting_explosion_01 2799 c917 85 43 sta temp2 2800 c919 2801 c919 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2802 c91b 85 44 sta temp3 2803 c91d 2804 c91d ad 53 01 lda enemy01_X 2805 c920 85 45 sta temp4 2806 c922 2807 c922 ad 54 01 lda enemy01_Y 2808 c925 85 46 sta temp5 2809 c927 2810 c927 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2811 c929 85 47 sta temp6 2812 c92b 2813 c92b 20 a0 f2 jsr plotsprite 2814 c92e ; +tall sprite replot 2815 c92e 18 clc 2816 c92f a5 42 lda temp1 2817 c931 69 02 adc #vertical_shooting_explosion_01_width 2818 c933 85 42 sta temp1 2819 c935 a5 46 lda temp5 2820 c937 69 08 adc #WZONEHEIGHT 2821 c939 85 46 sta temp5 2822 c93b 20 a0 f2 jsr plotsprite 2823 c93e .L0198 ;; plotsprite vertical_shooting_laser 0 twinlaserX twinlaserY 2824 c93e 2825 c93e a9 ba lda #vertical_shooting_laser 2829 c944 85 43 sta temp2 2830 c946 2831 c946 a9 1f lda #(0|vertical_shooting_laser_width_twoscompliment) 2832 c948 85 44 sta temp3 2833 c94a 2834 c94a ad 63 01 lda twinlaserX 2835 c94d 85 45 sta temp4 2836 c94f 2837 c94f ad 64 01 lda twinlaserY 2838 c952 2839 c952 85 46 sta temp5 2840 c954 2841 c954 a9 40 lda #(vertical_shooting_laser_mode|%01000000) 2842 c956 85 47 sta temp6 2843 c958 2844 c958 20 a0 f2 jsr plotsprite 2845 c95b ; +tall sprite replot 2846 c95b 18 clc 2847 c95c a5 42 lda temp1 2848 c95e 69 01 adc #vertical_shooting_laser_width 2849 c960 85 42 sta temp1 2850 c962 a5 46 lda temp5 2851 c964 69 08 adc #WZONEHEIGHT 2852 c966 85 46 sta temp5 2853 c968 20 a0 f2 jsr plotsprite 2854 c96b .L0199 ;; if playerFlag = 1 then plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 2855 c96b 2856 c96b ad 43 01 LDA playerFlag 2857 c96e c9 01 CMP #1 2858 c970 d0 38 BNE .skipL0199 2859 c972 .condpart62 2860 c972 a9 02 lda #vertical_shooting_explosion_01 2872 c983 85 43 sta temp2 2873 c985 2874 c985 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2875 c987 85 44 sta temp3 2876 c989 2877 c989 ad 41 01 lda playerX 2878 c98c 85 45 sta temp4 2879 c98e 2880 c98e ad 42 01 lda playerY 2881 c991 85 46 sta temp5 2882 c993 2883 c993 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2884 c995 85 47 sta temp6 2885 c997 2886 c997 20 a0 f2 jsr plotsprite 2887 c99a ; +tall sprite replot 2888 c99a 18 clc 2889 c99b a5 42 lda temp1 2890 c99d 69 02 adc #vertical_shooting_explosion_01_width 2891 c99f 85 42 sta temp1 2892 c9a1 a5 46 lda temp5 2893 c9a3 69 08 adc #WZONEHEIGHT 2894 c9a5 85 46 sta temp5 2895 c9a7 20 a0 f2 jsr plotsprite 2896 c9aa .skipL0199 2897 c9aa .L0200 ;; if enemy01_Flag = 1 then plotsprite vertical_shooting_explosion_01 3 enemy01_X enemy01_Y explosion_aniframe 2898 c9aa 2899 c9aa ad 55 01 LDA enemy01_Flag 2900 c9ad c9 01 CMP #1 2901 c9af d0 38 BNE .skipL0200 2902 c9b1 .condpart63 2903 c9b1 a9 02 lda #vertical_shooting_explosion_01 2915 c9c2 85 43 sta temp2 2916 c9c4 2917 c9c4 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2918 c9c6 85 44 sta temp3 2919 c9c8 2920 c9c8 ad 53 01 lda enemy01_X 2921 c9cb 85 45 sta temp4 2922 c9cd 2923 c9cd ad 54 01 lda enemy01_Y 2924 c9d0 85 46 sta temp5 2925 c9d2 2926 c9d2 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2927 c9d4 85 47 sta temp6 2928 c9d6 2929 c9d6 20 a0 f2 jsr plotsprite 2930 c9d9 ; +tall sprite replot 2931 c9d9 18 clc 2932 c9da a5 42 lda temp1 2933 c9dc 69 02 adc #vertical_shooting_explosion_01_width 2934 c9de 85 42 sta temp1 2935 c9e0 a5 46 lda temp5 2936 c9e2 69 08 adc #WZONEHEIGHT 2937 c9e4 85 46 sta temp5 2938 c9e6 20 a0 f2 jsr plotsprite 2939 c9e9 .skipL0200 2940 c9e9 .L0201 ;; return 2941 c9e9 2942 c9e9 60 RTS 2943 c9ea . 2944 c9ea ;; 2945 c9ea 2946 c9ea .draw_scores 2947 c9ea ;; draw_scores 2948 c9ea 2949 c9ea .L0202 ;; plotvalue vertical_shooting_font 0 score0 6 25 1 2950 c9ea 2951 c9ea a9 00 lda #vertical_shooting_font 2955 c9f0 85 43 sta temp2 2956 c9f2 2957 c9f2 ad 06 21 lda charactermode 2958 c9f5 85 4a sta temp9 2959 c9f7 a9 60 lda #(vertical_shooting_font_mode | %01100000) 2960 c9f9 8d 06 21 sta charactermode 2961 c9fc a9 1a lda #26 ; width in two's complement 2962 c9fe 09 00 ora #0 ; palette left shifted 5 bits 2963 ca00 85 44 sta temp3 2964 ca02 a9 19 lda #25 2965 ca04 85 45 sta temp4 2966 ca06 2967 ca06 a9 01 lda #1 2968 ca08 85 46 sta temp5 2969 ca0a 2970 ca0a a9 06 lda #6 2971 ca0c 85 47 sta temp6 2972 ca0e 2973 ca0e a9 a6 lda #score0 2977 ca14 85 49 sta temp8 2978 ca16 2979 ca16 20 8e f3 jsr plotvalue 2980 ca16 00 01 USED_PLOTVALUE = 1 2981 ca19 a5 4a lda temp9 2982 ca1b 8d 06 21 sta charactermode 2983 ca1e .L0203 ;; plotvalue vertical_shooting_font 0 lives 1 153 1 2984 ca1e 2985 ca1e a9 00 lda #vertical_shooting_font 2989 ca24 85 43 sta temp2 2990 ca26 2991 ca26 ad 06 21 lda charactermode 2992 ca29 85 4a sta temp9 2993 ca2b a9 60 lda #(vertical_shooting_font_mode | %01100000) 2994 ca2d 8d 06 21 sta charactermode 2995 ca30 a9 1f lda #31 ; width in two's complement 2996 ca32 09 00 ora #0 ; palette left shifted 5 bits 2997 ca34 85 44 sta temp3 2998 ca36 a9 99 lda #153 2999 ca38 85 45 sta temp4 3000 ca3a 3001 ca3a a9 01 lda #1 3002 ca3c 85 46 sta temp5 3003 ca3e 3004 ca3e a9 01 lda #1 3005 ca40 85 47 sta temp6 3006 ca42 3007 ca42 a9 67 lda #lives 3011 ca48 85 49 sta temp8 3012 ca4a 3013 ca4a 20 8e f3 jsr plotvalue 3014 ca4a 00 01 USED_PLOTVALUE = 1 3015 ca4d a5 4a lda temp9 3016 ca4f 8d 06 21 sta charactermode 3017 ca52 .L0204 ;; return 3018 ca52 3019 ca52 60 RTS 3020 ca53 . 3021 ca53 ;; 3022 ca53 3023 ca53 .check_collisions 3024 ca53 ;; check_collisions 3025 ca53 3026 ca53 .L0205 ;; if boxcollision ( playerX , playerY , 8 , 16 , enemy_shotX , enemy_shotY , 4 , 8 ) then enemy_shotX = 200 : enemy_shotY = 200 : playerFlag = 1 : lives = lives - 0 : playsfx sfx_explosion : isDead_flag = 1 : goto _checkCollisionsExit 3027 ca53 3028 ca53 3029 ca53 18 clc ; one clc only. If we overflow we're screwed anyway. 3030 ca54 a0 07 ldy #(8-1) 3031 ca56 84 44 sty temp3 3032 ca58 a0 0f ldy #(16-1) 3033 ca5a 84 45 sty temp4 3034 ca5c ad 58 01 lda enemy_shotX 3035 ca5f 69 30 adc #48 3036 ca61 85 46 sta temp5 3037 ca63 ad 59 01 lda enemy_shotY 3038 ca66 69 20 adc #((256-WSCREENHEIGHT)/2) 3039 ca68 85 47 sta temp6 3040 ca6a a0 03 ldy #(4-1) 3041 ca6c 84 48 sty temp7 3042 ca6e a0 07 ldy #(8-1) 3043 ca70 84 49 sty temp8 3044 ca72 ad 42 01 lda playerY 3045 ca75 69 20 adc #((256-WSCREENHEIGHT)/2) 3046 ca77 a8 tay 3047 ca78 ad 41 01 lda playerX 3048 ca7b 69 30 adc #48 3049 ca7d 20 d6 f3 jsr boxcollision 3050 ca80 3051 ca80 90 37 BCC .skipL0205 3052 ca82 .condpart64 3053 ca82 a9 c8 LDA #200 3054 ca84 8d 58 01 STA enemy_shotX 3055 ca87 8d 59 01 STA enemy_shotY 3056 ca8a a9 01 LDA #1 3057 ca8c 8d 43 01 STA playerFlag 3058 ca8f ad 67 01 LDA lives 3059 ca92 38 SEC 3060 ca93 e9 00 SBC #0 3061 ca95 8d 67 01 STA lives 3062 ca98 a9 01 lda #1 3063 ca9a 85 de sta sfxschedulelock 3064 ca9c a9 42 lda #sfx_explosion 3067 caa2 85 e1 sta sfxinstrumenthi 3068 caa4 a9 00 lda #0 3069 caa6 85 e2 sta sfxpitchoffset ; no pitch modification 3070 caa8 85 e3 sta sfxnoteindex ; not a musical note 3071 caaa 20 58 f2 jsr schedulesfx 3072 caad a9 00 lda #0 3073 caaf 85 de sta sfxschedulelock 3074 cab1 a9 01 LDA #1 3075 cab3 8d 68 01 STA isDead_flag 3076 cab6 4c 91 cd jmp ._checkCollisionsExit 3077 cab9 3078 cab9 .skipL0205 3079 cab9 .L0206 ;; if boxcollision ( playerX , playerY , 8 , 16 , power_upX , power_upY , 8 , 8 ) then power_upX = 208 : power_upY = 208 : playerFlag = 1 : power_upFlag = 1 : playsfx sfx_bling : score0 = score0 + 1 : gosub power_up_obtained 3080 cab9 3081 cab9 3082 cab9 18 clc ; one clc only. If we overflow we're screwed anyway. 3083 caba a0 07 ldy #(8-1) 3084 cabc 84 44 sty temp3 3085 cabe a0 0f ldy #(16-1) 3086 cac0 84 45 sty temp4 3087 cac2 ad 4f 01 lda power_upX 3088 cac5 69 30 adc #48 3089 cac7 85 46 sta temp5 3090 cac9 ad 50 01 lda power_upY 3091 cacc 69 20 adc #((256-WSCREENHEIGHT)/2) 3092 cace 85 47 sta temp6 3093 cad0 a0 07 ldy #(8-1) 3094 cad2 84 48 sty temp7 3095 cad4 a0 07 ldy #(8-1) 3096 cad6 84 49 sty temp8 3097 cad8 ad 42 01 lda playerY 3098 cadb 69 20 adc #((256-WSCREENHEIGHT)/2) 3099 cadd a8 tay 3100 cade ad 41 01 lda playerX 3101 cae1 69 30 adc #48 3102 cae3 20 d6 f3 jsr boxcollision 3103 cae6 3104 cae6 90 47 BCC .skipL0206 3105 cae8 .condpart65 3106 cae8 a9 d0 LDA #208 3107 caea 8d 4f 01 STA power_upX 3108 caed 8d 50 01 STA power_upY 3109 caf0 a9 01 LDA #1 3110 caf2 8d 43 01 STA playerFlag 3111 caf5 8d 51 01 STA power_upFlag 3112 caf8 a9 01 lda #1 3113 cafa 85 de sta sfxschedulelock 3114 cafc a9 7f lda #sfx_bling 3117 cb02 85 e1 sta sfxinstrumenthi 3118 cb04 a9 00 lda #0 3119 cb06 85 e2 sta sfxpitchoffset ; no pitch modification 3120 cb08 85 e3 sta sfxnoteindex ; not a musical note 3121 cb0a 20 58 f2 jsr schedulesfx 3122 cb0d a9 00 lda #0 3123 cb0f 85 de sta sfxschedulelock 3124 cb11 f8 SED 3125 cb12 18 CLC 3126 cb13 ad a8 01 LDA score0+2 3127 cb16 69 01 ADC #$01 3128 cb18 8d a8 01 STA score0+2 3129 cb1b ad a7 01 LDA score0+1 3130 cb1e 69 00 ADC #$00 3131 cb20 8d a7 01 STA score0+1 3132 cb23 ad a6 01 LDA score0 3133 cb26 69 00 ADC #$00 3134 cb28 8d a6 01 STA score0 3135 cb2b d8 CLD 3136 cb2c 20 92 cd jsr .power_up_obtained 3137 cb2f 3138 cb2f .skipL0206 3139 cb2f .L0207 ;; if boxcollision ( playerX , playerY , 8 , 16 , enemy01_X , enemy01_Y , 8 , 16 ) then enemy01_X = 200 : enemy01_Y = 200 : playerFlag = 1 : lives = lives - 0 : playsfx sfx_explosion : isDead_flag = 1 : goto _checkCollisionsExit 3140 cb2f 3141 cb2f 3142 cb2f 18 clc ; one clc only. If we overflow we're screwed anyway. 3143 cb30 a0 07 ldy #(8-1) 3144 cb32 84 44 sty temp3 3145 cb34 a0 0f ldy #(16-1) 3146 cb36 84 45 sty temp4 3147 cb38 ad 53 01 lda enemy01_X 3148 cb3b 69 30 adc #48 3149 cb3d 85 46 sta temp5 3150 cb3f ad 54 01 lda enemy01_Y 3151 cb42 69 20 adc #((256-WSCREENHEIGHT)/2) 3152 cb44 85 47 sta temp6 3153 cb46 a0 07 ldy #(8-1) 3154 cb48 84 48 sty temp7 3155 cb4a a0 0f ldy #(16-1) 3156 cb4c 84 49 sty temp8 3157 cb4e ad 42 01 lda playerY 3158 cb51 69 20 adc #((256-WSCREENHEIGHT)/2) 3159 cb53 a8 tay 3160 cb54 ad 41 01 lda playerX 3161 cb57 69 30 adc #48 3162 cb59 20 d6 f3 jsr boxcollision 3163 cb5c 3164 cb5c 90 37 BCC .skipL0207 3165 cb5e .condpart66 3166 cb5e a9 c8 LDA #200 3167 cb60 8d 53 01 STA enemy01_X 3168 cb63 8d 54 01 STA enemy01_Y 3169 cb66 a9 01 LDA #1 3170 cb68 8d 43 01 STA playerFlag 3171 cb6b ad 67 01 LDA lives 3172 cb6e 38 SEC 3173 cb6f e9 00 SBC #0 3174 cb71 8d 67 01 STA lives 3175 cb74 a9 01 lda #1 3176 cb76 85 de sta sfxschedulelock 3177 cb78 a9 42 lda #sfx_explosion 3180 cb7e 85 e1 sta sfxinstrumenthi 3181 cb80 a9 00 lda #0 3182 cb82 85 e2 sta sfxpitchoffset ; no pitch modification 3183 cb84 85 e3 sta sfxnoteindex ; not a musical note 3184 cb86 20 58 f2 jsr schedulesfx 3185 cb89 a9 00 lda #0 3186 cb8b 85 de sta sfxschedulelock 3187 cb8d a9 01 LDA #1 3188 cb8f 8d 68 01 STA isDead_flag 3189 cb92 4c 91 cd jmp ._checkCollisionsExit 3190 cb95 3191 cb95 .skipL0207 3192 cb95 .L0208 ;; 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 3193 cb95 3194 cb95 3195 cb95 18 clc ; one clc only. If we overflow we're screwed anyway. 3196 cb96 a0 07 ldy #(8-1) 3197 cb98 84 44 sty temp3 3198 cb9a a0 0f ldy #(16-1) 3199 cb9c 84 45 sty temp4 3200 cb9e ad 4c 01 lda extra_shipX 3201 cba1 69 30 adc #48 3202 cba3 85 46 sta temp5 3203 cba5 ad 4d 01 lda extra_shipY 3204 cba8 69 20 adc #((256-WSCREENHEIGHT)/2) 3205 cbaa 85 47 sta temp6 3206 cbac a0 07 ldy #(8-1) 3207 cbae 84 48 sty temp7 3208 cbb0 a0 07 ldy #(8-1) 3209 cbb2 84 49 sty temp8 3210 cbb4 ad 42 01 lda playerY 3211 cbb7 69 20 adc #((256-WSCREENHEIGHT)/2) 3212 cbb9 a8 tay 3213 cbba ad 41 01 lda playerX 3214 cbbd 69 30 adc #48 3215 cbbf 20 d6 f3 jsr boxcollision 3216 cbc2 3217 cbc2 90 2f BCC .skipL0208 3218 cbc4 .condpart67 3219 cbc4 a9 c8 LDA #200 3220 cbc6 8d 4c 01 STA extra_shipX 3221 cbc9 8d 4d 01 STA extra_shipY 3222 cbcc a9 01 LDA #1 3223 cbce 8d 4e 01 STA extra_shipFlag 3224 cbd1 ad 67 01 LDA lives 3225 cbd4 18 CLC 3226 cbd5 69 01 ADC #1 3227 cbd7 8d 67 01 STA lives 3228 cbda a9 01 lda #1 3229 cbdc 85 de sta sfxschedulelock 3230 cbde a9 7f lda #sfx_bling 3233 cbe4 85 e1 sta sfxinstrumenthi 3234 cbe6 a9 00 lda #0 3235 cbe8 85 e2 sta sfxpitchoffset ; no pitch modification 3236 cbea 85 e3 sta sfxnoteindex ; not a musical note 3237 cbec 20 58 f2 jsr schedulesfx 3238 cbef a9 00 lda #0 3239 cbf1 85 de sta sfxschedulelock 3240 cbf3 .skipL0208 3241 cbf3 .L0209 ;; if boxcollision ( bulletX , bulletY , 4 , 8 , enemy01_X , enemy01_Y , 8 , 16 ) then bulletX = - 8 : bulletY = 0 : enemy01_X = 208 : enemy01_Y = 200 : enemy01_Flag = 1 : playsfx sfx_explosion 3242 cbf3 3243 cbf3 3244 cbf3 18 clc ; one clc only. If we overflow we're screwed anyway. 3245 cbf4 a0 03 ldy #(4-1) 3246 cbf6 84 44 sty temp3 3247 cbf8 a0 07 ldy #(8-1) 3248 cbfa 84 45 sty temp4 3249 cbfc ad 53 01 lda enemy01_X 3250 cbff 69 30 adc #48 3251 cc01 85 46 sta temp5 3252 cc03 ad 54 01 lda enemy01_Y 3253 cc06 69 20 adc #((256-WSCREENHEIGHT)/2) 3254 cc08 85 47 sta temp6 3255 cc0a a0 07 ldy #(8-1) 3256 cc0c 84 48 sty temp7 3257 cc0e a0 0f ldy #(16-1) 3258 cc10 84 49 sty temp8 3259 cc12 ad 4a 01 lda bulletY 3260 cc15 69 20 adc #((256-WSCREENHEIGHT)/2) 3261 cc17 a8 tay 3262 cc18 ad 49 01 lda bulletX 3263 cc1b 69 30 adc #48 3264 cc1d 20 d6 f3 jsr boxcollision 3265 cc20 3266 cc20 90 32 BCC .skipL0209 3267 cc22 .condpart68 3268 cc22 a9 f8 LDA #248 3269 cc24 8d 49 01 STA bulletX 3270 cc27 a9 00 LDA #0 3271 cc29 8d 4a 01 STA bulletY 3272 cc2c a9 d0 LDA #208 3273 cc2e 8d 53 01 STA enemy01_X 3274 cc31 a9 c8 LDA #200 3275 cc33 8d 54 01 STA enemy01_Y 3276 cc36 a9 01 LDA #1 3277 cc38 8d 55 01 STA enemy01_Flag 3278 cc3b a9 01 lda #1 3279 cc3d 85 de sta sfxschedulelock 3280 cc3f a9 42 lda #sfx_explosion 3283 cc45 85 e1 sta sfxinstrumenthi 3284 cc47 a9 00 lda #0 3285 cc49 85 e2 sta sfxpitchoffset ; no pitch modification 3286 cc4b 85 e3 sta sfxnoteindex ; not a musical note 3287 cc4d 20 58 f2 jsr schedulesfx 3288 cc50 a9 00 lda #0 3289 cc52 85 de sta sfxschedulelock 3290 cc54 .skipL0209 3291 cc54 .L0210 ;; if boxcollision ( twinlaserX , twinlaserY , 4 , 16 , enemy01_X , enemy01_Y , 8 , 16 ) then twinlaserX = - 8 : twinlaserY = 0 : enemy01_X = 208 : enemy01_Y = 200 : enemy01_Flag = 1 : playsfx sfx_explosion 3292 cc54 3293 cc54 3294 cc54 18 clc ; one clc only. If we overflow we're screwed anyway. 3295 cc55 a0 03 ldy #(4-1) 3296 cc57 84 44 sty temp3 3297 cc59 a0 0f ldy #(16-1) 3298 cc5b 84 45 sty temp4 3299 cc5d ad 53 01 lda enemy01_X 3300 cc60 69 30 adc #48 3301 cc62 85 46 sta temp5 3302 cc64 ad 54 01 lda enemy01_Y 3303 cc67 69 20 adc #((256-WSCREENHEIGHT)/2) 3304 cc69 85 47 sta temp6 3305 cc6b a0 07 ldy #(8-1) 3306 cc6d 84 48 sty temp7 3307 cc6f a0 0f ldy #(16-1) 3308 cc71 84 49 sty temp8 3309 cc73 ad 64 01 lda twinlaserY 3310 cc76 69 20 adc #((256-WSCREENHEIGHT)/2) 3311 cc78 a8 tay 3312 cc79 ad 63 01 lda twinlaserX 3313 cc7c 69 30 adc #48 3314 cc7e 20 d6 f3 jsr boxcollision 3315 cc81 3316 cc81 90 32 BCC .skipL0210 3317 cc83 .condpart69 3318 cc83 a9 f8 LDA #248 3319 cc85 8d 63 01 STA twinlaserX 3320 cc88 a9 00 LDA #0 3321 cc8a 8d 64 01 STA twinlaserY 3322 cc8d a9 d0 LDA #208 3323 cc8f 8d 53 01 STA enemy01_X 3324 cc92 a9 c8 LDA #200 3325 cc94 8d 54 01 STA enemy01_Y 3326 cc97 a9 01 LDA #1 3327 cc99 8d 55 01 STA enemy01_Flag 3328 cc9c a9 01 lda #1 3329 cc9e 85 de sta sfxschedulelock 3330 cca0 a9 42 lda #sfx_explosion 3333 cca6 85 e1 sta sfxinstrumenthi 3334 cca8 a9 00 lda #0 3335 ccaa 85 e2 sta sfxpitchoffset ; no pitch modification 3336 ccac 85 e3 sta sfxnoteindex ; not a musical note 3337 ccae 20 58 f2 jsr schedulesfx 3338 ccb1 a9 00 lda #0 3339 ccb3 85 de sta sfxschedulelock 3340 ccb5 .skipL0210 3341 ccb5 . 3342 ccb5 ;; 3343 ccb5 3344 ccb5 .L0211 ;; if bulletX > enemy01_X && bulletX < ( enemy01_X + 16 ) && bulletY > enemy01_Y && bulletY < ( enemy01_Y + 16 ) then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion 3345 ccb5 3346 ccb5 ad 53 01 LDA enemy01_X 3347 ccb8 cd 49 01 CMP bulletX 3348 ccbb b0 66 BCS .skipL0211 3349 ccbd .condpart70 3350 ccbd ; complex condition detected 3351 ccbd ; complex statement detected 3352 ccbd ad 53 01 LDA enemy01_X 3353 ccc0 18 CLC 3354 ccc1 69 10 ADC #16 3355 ccc3 48 PHA 3356 ccc4 ba TSX 3357 ccc5 68 PLA 3358 ccc6 ad 49 01 LDA bulletX 3359 ccc9 dd 01 01 CMP $101,x 3360 cccc b0 55 BCS .skip70then 3361 ccce .condpart71 3362 ccce ad 54 01 LDA enemy01_Y 3363 ccd1 cd 4a 01 CMP bulletY 3364 ccd4 b0 4d BCS .skip71then 3365 ccd6 .condpart72 3366 ccd6 ; complex condition detected 3367 ccd6 ; complex statement detected 3368 ccd6 ad 54 01 LDA enemy01_Y 3369 ccd9 18 CLC 3370 ccda 69 10 ADC #16 3371 ccdc 48 PHA 3372 ccdd ba TSX 3373 ccde 68 PLA 3374 ccdf ad 4a 01 LDA bulletY 3375 cce2 dd 01 01 CMP $101,x 3376 cce5 b0 3c BCS .skip72then 3377 cce7 .condpart73 3378 cce7 a9 01 LDA #1 3379 cce9 8d 55 01 STA enemy01_Flag 3380 ccec 8d 6b 01 STA explosion_aniframe 3381 ccef f8 SED 3382 ccf0 18 CLC 3383 ccf1 ad a8 01 LDA score0+2 3384 ccf4 69 01 ADC #$01 3385 ccf6 8d a8 01 STA score0+2 3386 ccf9 ad a7 01 LDA score0+1 3387 ccfc 69 00 ADC #$00 3388 ccfe 8d a7 01 STA score0+1 3389 cd01 ad a6 01 LDA score0 3390 cd04 69 00 ADC #$00 3391 cd06 8d a6 01 STA score0 3392 cd09 d8 CLD 3393 cd0a a9 01 lda #1 3394 cd0c 85 de sta sfxschedulelock 3395 cd0e a9 42 lda #sfx_explosion 3398 cd14 85 e1 sta sfxinstrumenthi 3399 cd16 a9 00 lda #0 3400 cd18 85 e2 sta sfxpitchoffset ; no pitch modification 3401 cd1a 85 e3 sta sfxnoteindex ; not a musical note 3402 cd1c 20 58 f2 jsr schedulesfx 3403 cd1f a9 00 lda #0 3404 cd21 85 de sta sfxschedulelock 3405 cd23 .skip72then 3406 cd23 .skip71then 3407 cd23 .skip70then 3408 cd23 .skipL0211 3409 cd23 .L0212 ;; if twinlaserX > enemy01_X && twinlaserX < ( enemy01_X + 16 ) && twinlaserY > enemy01_Y && twinlaserY < ( enemy01_Y + 16 ) then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion 3410 cd23 3411 cd23 ad 53 01 LDA enemy01_X 3412 cd26 cd 63 01 CMP twinlaserX 3413 cd29 b0 66 BCS .skipL0212 3414 cd2b .condpart74 3415 cd2b ; complex condition detected 3416 cd2b ; complex statement detected 3417 cd2b ad 53 01 LDA enemy01_X 3418 cd2e 18 CLC 3419 cd2f 69 10 ADC #16 3420 cd31 48 PHA 3421 cd32 ba TSX 3422 cd33 68 PLA 3423 cd34 ad 63 01 LDA twinlaserX 3424 cd37 dd 01 01 CMP $101,x 3425 cd3a b0 55 BCS .skip74then 3426 cd3c .condpart75 3427 cd3c ad 54 01 LDA enemy01_Y 3428 cd3f cd 64 01 CMP twinlaserY 3429 cd42 b0 4d BCS .skip75then 3430 cd44 .condpart76 3431 cd44 ; complex condition detected 3432 cd44 ; complex statement detected 3433 cd44 ad 54 01 LDA enemy01_Y 3434 cd47 18 CLC 3435 cd48 69 10 ADC #16 3436 cd4a 48 PHA 3437 cd4b ba TSX 3438 cd4c 68 PLA 3439 cd4d ad 64 01 LDA twinlaserY 3440 cd50 dd 01 01 CMP $101,x 3441 cd53 b0 3c BCS .skip76then 3442 cd55 .condpart77 3443 cd55 a9 01 LDA #1 3444 cd57 8d 55 01 STA enemy01_Flag 3445 cd5a 8d 6b 01 STA explosion_aniframe 3446 cd5d f8 SED 3447 cd5e 18 CLC 3448 cd5f ad a8 01 LDA score0+2 3449 cd62 69 01 ADC #$01 3450 cd64 8d a8 01 STA score0+2 3451 cd67 ad a7 01 LDA score0+1 3452 cd6a 69 00 ADC #$00 3453 cd6c 8d a7 01 STA score0+1 3454 cd6f ad a6 01 LDA score0 3455 cd72 69 00 ADC #$00 3456 cd74 8d a6 01 STA score0 3457 cd77 d8 CLD 3458 cd78 a9 01 lda #1 3459 cd7a 85 de sta sfxschedulelock 3460 cd7c a9 42 lda #sfx_explosion 3463 cd82 85 e1 sta sfxinstrumenthi 3464 cd84 a9 00 lda #0 3465 cd86 85 e2 sta sfxpitchoffset ; no pitch modification 3466 cd88 85 e3 sta sfxnoteindex ; not a musical note 3467 cd8a 20 58 f2 jsr schedulesfx 3468 cd8d a9 00 lda #0 3469 cd8f 85 de sta sfxschedulelock 3470 cd91 .skip76then 3471 cd91 .skip75then 3472 cd91 .skip74then 3473 cd91 .skipL0212 3474 cd91 . 3475 cd91 ;; 3476 cd91 3477 cd91 ._checkCollisionsExit 3478 cd91 ;; _checkCollisionsExit 3479 cd91 3480 cd91 .L0213 ;; return 3481 cd91 3482 cd91 60 RTS 3483 cd92 . 3484 cd92 ;; 3485 cd92 3486 cd92 .power_up_obtained 3487 cd92 ;; power_up_obtained 3488 cd92 3489 cd92 .L0214 ;; if power_upFlag = 1 then twinlaser_flag = 1 : if twinlaser_flag = 1 then controller_button_debounce_bit0{0} : gosub SetLaserHome 3490 cd92 3491 cd92 ad 51 01 LDA power_upFlag 3492 cd95 c9 01 CMP #1 3493 cd97 d0 0c BNE .skipL0214 3494 cd99 .condpart78 3495 cd99 a9 01 LDA #1 3496 cd9b 8d 65 01 STA twinlaser_flag 3497 cd9e ad 65 01 LDA twinlaser_flag 3498 cda1 c9 01 CMP #1 3499 cda3 d0 00 BNE .skip78then 3500 cda5 .condpart79 3501 cda5 .skip78then 3502 cda5 .skipL0214 3503 cda5 .L0215 ;; if twinlaser_flag = 1 && controller_button2_press_bit4{4} && controller_button2_tap_bit5{5} && controller_button2_hold_bit6{6} then controller_button_debounce_bit0{0} = 1 : twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3504 cda5 3505 cda5 ad 65 01 LDA twinlaser_flag 3506 cda8 c9 01 CMP #1 3507 cdaa d0 3d BNE .skipL0215 3508 cdac .condpart80 3509 cdac ad 46 01 LDA controller_button2_press_bit4 3510 cdaf 29 10 AND #16 3511 cdb1 f0 36 BEQ .skip80then 3512 cdb3 .condpart81 3513 cdb3 ad 46 01 LDA controller_button2_tap_bit5 3514 cdb6 29 20 AND #32 3515 cdb8 f0 2f BEQ .skip81then 3516 cdba .condpart82 3517 cdba 2c 46 01 BIT controller_button2_hold_bit6 3518 cdbd 50 2a BVC .skip82then 3519 cdbf .condpart83 3520 cdbf ad 45 01 LDA controller_button_debounce_bit0 3521 cdc2 09 01 ORA #1 3522 cdc4 8d 45 01 STA controller_button_debounce_bit0 3523 cdc7 ad 64 01 LDA twinlaserY 3524 cdca 38 SEC 3525 cdcb e9 0a SBC #10 3526 cdcd 8d 64 01 STA twinlaserY 3527 cdd0 a9 01 lda #1 3528 cdd2 85 de sta sfxschedulelock 3529 cdd4 a9 0f lda #sfx_plainlaser 3532 cdda 85 e1 sta sfxinstrumenthi 3533 cddc a9 00 lda #0 3534 cdde 85 e2 sta sfxpitchoffset ; no pitch modification 3535 cde0 85 e3 sta sfxnoteindex ; not a musical note 3536 cde2 20 58 f2 jsr schedulesfx 3537 cde5 a9 00 lda #0 3538 cde7 85 de sta sfxschedulelock 3539 cde9 .skip82then 3540 cde9 .skip81then 3541 cde9 .skip80then 3542 cde9 .skipL0215 3543 cde9 . 3544 cde9 ;; 3545 cde9 3546 cde9 . 3547 cde9 ;; 3548 cde9 3549 cde9 .L0216 ;; if controller_button_debounce_bit0{0} then gosub SetLaserHome 3550 cde9 3551 cde9 ad 45 01 LDA controller_button_debounce_bit0 3552 cdec 4a LSR 3553 cded 90 03 BCC .skipL0216 3554 cdef .condpart84 3555 cdef 20 06 ce jsr .SetLaserHome 3556 cdf2 3557 cdf2 .skipL0216 3558 cdf2 .L0217 ;; return 3559 cdf2 3560 cdf2 60 RTS 3561 cdf3 . 3562 cdf3 ;; 3563 cdf3 3564 cdf3 .SetBulletHome 3565 cdf3 ;; SetBulletHome 3566 cdf3 3567 cdf3 .L0218 ;; bulletX = playerX + 4 : bulletY = playerY - 2 3568 cdf3 3569 cdf3 ad 41 01 LDA playerX 3570 cdf6 18 CLC 3571 cdf7 69 04 ADC #4 3572 cdf9 8d 49 01 STA bulletX 3573 cdfc ad 42 01 LDA playerY 3574 cdff 38 SEC 3575 ce00 e9 02 SBC #2 3576 ce02 8d 4a 01 STA bulletY 3577 ce05 .L0219 ;; return 3578 ce05 3579 ce05 60 RTS 3580 ce06 . 3581 ce06 ;; 3582 ce06 3583 ce06 .SetLaserHome 3584 ce06 ;; SetLaserHome 3585 ce06 3586 ce06 .L0220 ;; twinlaserX = playerX + 4 : twinlaserY = playerY - 2 3587 ce06 3588 ce06 ad 41 01 LDA playerX 3589 ce09 18 CLC 3590 ce0a 69 04 ADC #4 3591 ce0c 8d 63 01 STA twinlaserX 3592 ce0f ad 42 01 LDA playerY 3593 ce12 38 SEC 3594 ce13 e9 02 SBC #2 3595 ce15 8d 64 01 STA twinlaserY 3596 ce18 .L0221 ;; return 3597 ce18 3598 ce18 60 RTS 3599 ce19 . 3600 ce19 ;; 3601 ce19 3602 ce19 .L0222 ;; dmahole 2 3603 ce19 3604 ce19 4c 00 d8 jmp dmahole_2 3605 ce19 DMAHOLEEND1 SET . 484 bytes of ROM space left in DMA hole 1. 3606 ce19 echo " "," "," "," ",[(256*WZONEHEIGHT)-(DMAHOLEEND1 - DMAHOLESTART1)]d , "bytes of ROM space left in DMA hole 1." 3607 ce1c - if ((256*WZONEHEIGHT)-(DMAHOLEEND1 - DMAHOLESTART1)) < 0 3608 ce1c -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 3609 ce1c endif 3610 ce1c 3611 d000 ORG $D000,0 ; ************* 3612 d000 3613 d000 3614 d100 ORG $D100,0 ; ************* 3615 d100 3616 d100 3617 d200 ORG $D200,0 ; ************* 3618 d200 3619 d200 3620 d300 ORG $D300,0 ; ************* 3621 d300 3622 d300 3623 d400 ORG $D400,0 ; ************* 3624 d400 3625 d400 3626 d500 ORG $D500,0 ; ************* 3627 d500 3628 d500 3629 d600 ORG $D600,0 ; ************* 3630 d600 3631 d600 3632 d700 ORG $D700,0 ; ************* 3633 d700 3634 d700 3635 d800 ORG $D800,0 ; ************* 3636 d800 dmahole_2 3637 d800 DMAHOLESTART2 SET . 3638 d800 . 3639 d800 ;; 3640 d800 3641 d800 .lose_a_life 3642 d800 ;; lose_a_life 3643 d800 3644 d800 .L0223 ;; lives = lives - 1 : isDead_flag = 0 3645 d800 3646 d800 ad 67 01 LDA lives 3647 d803 38 SEC 3648 d804 e9 01 SBC #1 3649 d806 8d 67 01 STA lives 3650 d809 a9 00 LDA #0 3651 d80b 8d 68 01 STA isDead_flag 3652 d80e .L0224 ;; if enemy01_Flag <> 1 then enemy01_X = 32 : enemy01_Y = 0 3653 d80e 3654 d80e ad 55 01 LDA enemy01_Flag 3655 d811 c9 01 CMP #1 3656 d813 f0 0a BEQ .skipL0224 3657 d815 .condpart85 3658 d815 a9 20 LDA #32 3659 d817 8d 53 01 STA enemy01_X 3660 d81a a9 00 LDA #0 3661 d81c 8d 54 01 STA enemy01_Y 3662 d81f .skipL0224 3663 d81f .L0225 ;; if enemy_shotFlag <> 1 then enemy_shotX = 0 : enemy_shotY = 0 3664 d81f 3665 d81f ad 5a 01 LDA enemy_shotFlag 3666 d822 c9 01 CMP #1 3667 d824 f0 08 BEQ .skipL0225 3668 d826 .condpart86 3669 d826 a9 00 LDA #0 3670 d828 8d 58 01 STA enemy_shotX 3671 d82b 8d 59 01 STA enemy_shotY 3672 d82e .skipL0225 3673 d82e .L0226 ;; if playerFlag = 1 && explosion_aniframe = 200 && lives > 0 then playerX = 80 : playerY = 144 : playerFlag = 0 : explosion_aniframe = 0 : twinlaser_flag = 0 : goto main 3674 d82e 3675 d82e ad 43 01 LDA playerFlag 3676 d831 c9 01 CMP #1 3677 d833 d0 26 BNE .skipL0226 3678 d835 .condpart87 3679 d835 ad 6b 01 LDA explosion_aniframe 3680 d838 c9 c8 CMP #200 3681 d83a d0 1f BNE .skip87then 3682 d83c .condpart88 3683 d83c a9 00 LDA #0 3684 d83e cd 67 01 CMP lives 3685 d841 b0 18 BCS .skip88then 3686 d843 .condpart89 3687 d843 a9 50 LDA #80 3688 d845 8d 41 01 STA playerX 3689 d848 a9 90 LDA #144 3690 d84a 8d 42 01 STA playerY 3691 d84d a9 00 LDA #0 3692 d84f 8d 43 01 STA playerFlag 3693 d852 8d 6b 01 STA explosion_aniframe 3694 d855 8d 65 01 STA twinlaser_flag 3695 d858 4c e2 b8 jmp .main 3696 d85b 3697 d85b .skip88then 3698 d85b .skip87then 3699 d85b .skipL0226 3700 d85b .L0227 ;; joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 3701 d85b 3702 d85b a9 00 LDA #0 3703 d85d 8d 6e 01 STA joyposup 3704 d860 8d 6f 01 STA joyposdown 3705 d863 8d 6c 01 STA joyposleft 3706 d866 8d 6d 01 STA joyposright 3707 d869 .L0228 ;; bulletX = 0 : bulletY = 0 3708 d869 3709 d869 a9 00 LDA #0 3710 d86b 8d 49 01 STA bulletX 3711 d86e 8d 4a 01 STA bulletY 3712 d871 .L0229 ;; enemy01_X = 0 : enemy01_Y = 0 : enemy01_Flag = 0 3713 d871 3714 d871 a9 00 LDA #0 3715 d873 8d 53 01 STA enemy01_X 3716 d876 8d 54 01 STA enemy01_Y 3717 d879 8d 55 01 STA enemy01_Flag 3718 d87c .L0230 ;; playerFlag = 0 : gameover_flag = 0 3719 d87c 3720 d87c a9 00 LDA #0 3721 d87e 8d 43 01 STA playerFlag 3722 d881 8d 69 01 STA gameover_flag 3723 d884 .L0231 ;; power_upFlag = 0 : twinlaser_flag = 0 3724 d884 3725 d884 a9 00 LDA #0 3726 d886 8d 51 01 STA power_upFlag 3727 d889 8d 65 01 STA twinlaser_flag 3728 d88c .L0232 ;; controller_debounce_bit0{0} = 1 : controller_button_debounce_bit0{0} = 1 3729 d88c 3730 d88c ad 44 01 LDA controller_debounce_bit0 3731 d88f 09 01 ORA #1 3732 d891 8d 44 01 STA controller_debounce_bit0 3733 d894 ad 45 01 LDA controller_button_debounce_bit0 3734 d897 09 01 ORA #1 3735 d899 8d 45 01 STA controller_button_debounce_bit0 3736 d89c . 3737 d89c ;; 3738 d89c 3739 d89c .lose_a_lifeloop 3740 d89c ;; lose_a_lifeloop 3741 d89c 3742 d89c .L0233 ;; restorescreen 3743 d89c 3744 d89c 20 9e f0 jsr restorescreen 3745 d89f .L0234 ;; gosub draw_scores 3746 d89f 3747 d89f 20 ea c9 jsr .draw_scores 3748 d8a2 3749 d8a2 .L0235 ;; drawscreen 3750 d8a2 3751 d8a2 20 c0 f0 jsr drawscreen 3752 d8a5 . 3753 d8a5 ;; 3754 d8a5 3755 d8a5 . 3756 d8a5 ;; 3757 d8a5 3758 d8a5 . 3759 d8a5 ;; 3760 d8a5 3761 d8a5 . 3762 d8a5 ;; 3763 d8a5 3764 d8a5 . 3765 d8a5 ;; 3766 d8a5 3767 d8a5 .L0236 ;; if controller_button_debounce_bit0{0} && lives > 0 then clearscreen : goto main 3768 d8a5 3769 d8a5 ad 45 01 LDA controller_button_debounce_bit0 3770 d8a8 4a LSR 3771 d8a9 90 0d BCC .skipL0236 3772 d8ab .condpart90 3773 d8ab a9 00 LDA #0 3774 d8ad cd 67 01 CMP lives 3775 d8b0 b0 06 BCS .skip90then 3776 d8b2 .condpart91 3777 d8b2 20 8c f0 jsr clearscreen 3778 d8b5 4c e2 b8 jmp .main 3779 d8b8 3780 d8b8 .skip90then 3781 d8b8 .skipL0236 3782 d8b8 .L0237 ;; if controller_button_debounce_bit0{0} && lives < 1 then clearscreen : goto gameover 3783 d8b8 3784 d8b8 ad 45 01 LDA controller_button_debounce_bit0 3785 d8bb 4a LSR 3786 d8bc 90 0d BCC .skipL0237 3787 d8be .condpart92 3788 d8be ad 67 01 LDA lives 3789 d8c1 c9 01 CMP #1 3790 d8c3 b0 06 BCS .skip92then 3791 d8c5 .condpart93 3792 d8c5 20 8c f0 jsr clearscreen 3793 d8c8 4c ce d8 jmp .gameover 3794 d8cb 3795 d8cb .skip92then 3796 d8cb .skipL0237 3797 d8cb .L0238 ;; goto lose_a_lifeloop 3798 d8cb 3799 d8cb 4c 9c d8 jmp .lose_a_lifeloop 3800 d8ce 3801 d8ce . 3802 d8ce ;; 3803 d8ce 3804 d8ce .gameover 3805 d8ce ;; gameover 3806 d8ce 3807 d8ce .L0239 ;; gameover_flag = 0 3808 d8ce 3809 d8ce a9 00 LDA #0 3810 d8d0 8d 69 01 STA gameover_flag 3811 d8d3 .L0240 ;; controller_debounce_bit0{0} = 1 : controller_button_debounce_bit0{0} = 1 3812 d8d3 3813 d8d3 ad 44 01 LDA controller_debounce_bit0 3814 d8d6 09 01 ORA #1 3815 d8d8 8d 44 01 STA controller_debounce_bit0 3816 d8db ad 45 01 LDA controller_button_debounce_bit0 3817 d8de 09 01 ORA #1 3818 d8e0 8d 45 01 STA controller_button_debounce_bit0 3819 d8e3 . 3820 d8e3 ;; 3821 d8e3 3822 d8e3 .gameover_loop 3823 d8e3 ;; gameover_loop 3824 d8e3 3825 d8e3 .L0241 ;; if lives = 0 then gameover_flag = 1 : clearscreen 3826 d8e3 3827 d8e3 ad 67 01 LDA lives 3828 d8e6 c9 00 CMP #0 3829 d8e8 d0 08 BNE .skipL0241 3830 d8ea .condpart94 3831 d8ea a9 01 LDA #1 3832 d8ec 8d 69 01 STA gameover_flag 3833 d8ef 20 8c f0 jsr clearscreen 3834 d8f2 .skipL0241 3835 d8f2 .L0242 ;; plotchars 'game^over!' 0 40 16 3836 d8f2 3837 d8f2 4c ff d8 JMP skipalphadata4 3838 d8f5 alphadata4 3839 d8f5 11 .byte.b (alphadata4 3854 d905 85 43 sta temp2 3855 d907 3856 d907 a9 16 lda #22 ; width in two's complement 3857 d909 09 00 ora #0 ; palette left shifted 5 bits 3858 d90b 85 44 sta temp3 3859 d90d a9 28 lda #40 3860 d90f 85 45 sta temp4 3861 d911 3862 d911 a9 10 lda #16 3863 d913 3864 d913 85 46 sta temp5 3865 d915 3866 d915 20 59 f3 jsr plotcharacters 3867 d918 .L0243 ;; if controller_button1_press_bit1{1} then controller_button_debounce_bit0{0} = 1 : clearscreen : goto continue 3868 d918 3869 d918 ad 45 01 LDA controller_button1_press_bit1 3870 d91b 29 02 AND #2 3871 d91d f0 0e BEQ .skipL0243 3872 d91f .condpart95 3873 d91f ad 45 01 LDA controller_button_debounce_bit0 3874 d922 09 01 ORA #1 3875 d924 8d 45 01 STA controller_button_debounce_bit0 3876 d927 20 8c f0 jsr clearscreen 3877 d92a 4c 30 d9 jmp .continue 3878 d92d 3879 d92d .skipL0243 3880 d92d .L0244 ;; goto gameover_loop 3881 d92d 3882 d92d 4c e3 d8 jmp .gameover_loop 3883 d930 3884 d930 . 3885 d930 ;; 3886 d930 3887 d930 . 3888 d930 ;; 3889 d930 3890 d930 .continue 3891 d930 ;; continue 3892 d930 3893 d930 .L0245 ;; continue_flag = 0 3894 d930 3895 d930 a9 00 LDA #0 3896 d932 8d 6a 01 STA continue_flag 3897 d935 .L0246 ;; controller_debounce_bit0{0} = 1 : controller_button_debounce_bit0{0} = 1 3898 d935 3899 d935 ad 44 01 LDA controller_debounce_bit0 3900 d938 09 01 ORA #1 3901 d93a 8d 44 01 STA controller_debounce_bit0 3902 d93d ad 45 01 LDA controller_button_debounce_bit0 3903 d940 09 01 ORA #1 3904 d942 8d 45 01 STA controller_button_debounce_bit0 3905 d945 .continue_loop 3906 d945 ;; continue_loop 3907 d945 3908 d945 .L0247 ;; plotchars 'continue?' 0 40 3 3909 d945 3910 d945 4c 51 d9 JMP skipalphadata5 3911 d948 alphadata5 3912 d948 0d .byte.b (alphadata5 3926 d957 85 43 sta temp2 3927 d959 3928 d959 a9 17 lda #23 ; width in two's complement 3929 d95b 09 00 ora #0 ; palette left shifted 5 bits 3930 d95d 85 44 sta temp3 3931 d95f a9 28 lda #40 3932 d961 85 45 sta temp4 3933 d963 3934 d963 a9 03 lda #3 3935 d965 3936 d965 85 46 sta temp5 3937 d967 3938 d967 20 59 f3 jsr plotcharacters 3939 d96a .L0248 ;; plotchars 'left^button^for^yes' 0 24 4 3940 d96a 3941 d96a 4c 80 d9 JMP skipalphadata6 3942 d96d alphadata6 3943 d96d 16 .byte.b (alphadata6 3967 d986 85 43 sta temp2 3968 d988 3969 d988 a9 0d lda #13 ; width in two's complement 3970 d98a 09 00 ora #0 ; palette left shifted 5 bits 3971 d98c 85 44 sta temp3 3972 d98e a9 18 lda #24 3973 d990 85 45 sta temp4 3974 d992 3975 d992 a9 04 lda #4 3976 d994 3977 d994 85 46 sta temp5 3978 d996 3979 d996 20 59 f3 jsr plotcharacters 3980 d999 .L0249 ;; plotchars 'right^button^for^no' 0 24 5 3981 d999 3982 d999 4c af d9 JMP skipalphadata7 3983 d99c alphadata7 3984 d99c 1c .byte.b (alphadata7 4008 d9b5 85 43 sta temp2 4009 d9b7 4010 d9b7 a9 0d lda #13 ; width in two's complement 4011 d9b9 09 00 ora #0 ; palette left shifted 5 bits 4012 d9bb 85 44 sta temp3 4013 d9bd a9 18 lda #24 4014 d9bf 85 45 sta temp4 4015 d9c1 4016 d9c1 a9 05 lda #5 4017 d9c3 4018 d9c3 85 46 sta temp5 4019 d9c5 4020 d9c5 20 59 f3 jsr plotcharacters 4021 d9c8 .L0250 ;; if controller_button1_press_bit1{1} then clearscreen : playsfx sfx_plainlaser : playerX = 80 : playerY = 144 : playerFlag = 0 : explosion_aniframe = 0 : goto main 4022 d9c8 4023 d9c8 ad 45 01 LDA controller_button1_press_bit1 4024 d9cb 29 02 AND #2 4025 d9cd f0 31 BEQ .skipL0250 4026 d9cf .condpart96 4027 d9cf 20 8c f0 jsr clearscreen 4028 d9d2 a9 01 lda #1 4029 d9d4 85 de sta sfxschedulelock 4030 d9d6 a9 0f lda #sfx_plainlaser 4033 d9dc 85 e1 sta sfxinstrumenthi 4034 d9de a9 00 lda #0 4035 d9e0 85 e2 sta sfxpitchoffset ; no pitch modification 4036 d9e2 85 e3 sta sfxnoteindex ; not a musical note 4037 d9e4 20 58 f2 jsr schedulesfx 4038 d9e7 a9 00 lda #0 4039 d9e9 85 de sta sfxschedulelock 4040 d9eb a9 50 LDA #80 4041 d9ed 8d 41 01 STA playerX 4042 d9f0 a9 90 LDA #144 4043 d9f2 8d 42 01 STA playerY 4044 d9f5 a9 00 LDA #0 4045 d9f7 8d 43 01 STA playerFlag 4046 d9fa 8d 6b 01 STA explosion_aniframe 4047 d9fd 4c e2 b8 jmp .main 4048 da00 4049 da00 .skipL0250 4050 da00 .L0251 ;; if controller_button2_press_bit4{4} then clearscreen : playsfx sfx_explosion : gosub titlescreenloop 4051 da00 4052 da00 ad 46 01 LDA controller_button2_press_bit4 4053 da03 29 10 AND #16 4054 da05 f0 1f BEQ .skipL0251 4055 da07 .condpart97 4056 da07 20 8c f0 jsr clearscreen 4057 da0a a9 01 lda #1 4058 da0c 85 de sta sfxschedulelock 4059 da0e a9 42 lda #sfx_explosion 4062 da14 85 e1 sta sfxinstrumenthi 4063 da16 a9 00 lda #0 4064 da18 85 e2 sta sfxpitchoffset ; no pitch modification 4065 da1a 85 e3 sta sfxnoteindex ; not a musical note 4066 da1c 20 58 f2 jsr schedulesfx 4067 da1f a9 00 lda #0 4068 da21 85 de sta sfxschedulelock 4069 da23 20 eb da jsr .titlescreenloop 4070 da26 4071 da26 .skipL0251 4072 da26 .L0252 ;; goto continue_loop 4073 da26 4074 da26 4c 45 d9 jmp .continue_loop 4075 da29 4076 da29 . 4077 da29 ;; 4078 da29 4079 da29 . 4080 da29 ;; 4081 da29 4082 da29 . 4083 da29 ;; 4084 da29 4085 da29 .titlescreen 4086 da29 ;; titlescreen 4087 da29 4088 da29 .L0253 ;; plotchars 'new^vertical^shooting' 1 38 4 4089 da29 4090 da29 4c 41 da JMP skipalphadata8 4091 da2c alphadata8 4092 da2c 18 .byte.b (alphadata8 4118 da47 85 43 sta temp2 4119 da49 4120 da49 a9 0b lda #11 ; width in two's complement 4121 da4b 09 20 ora #32 ; palette left shifted 5 bits 4122 da4d 85 44 sta temp3 4123 da4f a9 26 lda #38 4124 da51 85 45 sta temp4 4125 da53 4126 da53 a9 04 lda #4 4127 da55 4128 da55 85 46 sta temp5 4129 da57 4130 da57 20 59 f3 jsr plotcharacters 4131 da5a .L0254 ;; plotchars 'demo' 1 72 5 4132 da5a 4133 da5a 4c 61 da JMP skipalphadata9 4134 da5d alphadata9 4135 da5d 0e .byte.b (alphadata9 4144 da67 85 43 sta temp2 4145 da69 4146 da69 a9 1c lda #28 ; width in two's complement 4147 da6b 09 20 ora #32 ; palette left shifted 5 bits 4148 da6d 85 44 sta temp3 4149 da6f a9 48 lda #72 4150 da71 85 45 sta temp4 4151 da73 4152 da73 a9 05 lda #5 4153 da75 4154 da75 85 46 sta temp5 4155 da77 4156 da77 20 59 f3 jsr plotcharacters 4157 da7a .L0255 ;; plotchars 'by^shane^skekel.' 1 48 7 4158 da7a 4159 da7a 4c 8d da JMP skipalphadata10 4160 da7d alphadata10 4161 da7d 0c .byte.b (alphadata10 4182 da93 85 43 sta temp2 4183 da95 4184 da95 a9 10 lda #16 ; width in two's complement 4185 da97 09 20 ora #32 ; palette left shifted 5 bits 4186 da99 85 44 sta temp3 4187 da9b a9 30 lda #48 4188 da9d 85 45 sta temp4 4189 da9f 4190 da9f a9 07 lda #7 4191 daa1 4192 daa1 85 46 sta temp5 4193 daa3 4194 daa3 20 59 f3 jsr plotcharacters 4195 daa6 .L0256 ;; plotchars 'push^fire^to^begin.' 2 42 16 4196 daa6 4197 daa6 4c bc da JMP skipalphadata11 4198 daa9 alphadata11 4199 daa9 1a .byte.b (alphadata11 4223 dac2 85 43 sta temp2 4224 dac4 4225 dac4 a9 0d lda #13 ; width in two's complement 4226 dac6 09 40 ora #64 ; palette left shifted 5 bits 4227 dac8 85 44 sta temp3 4228 daca a9 2a lda #42 4229 dacc 85 45 sta temp4 4230 dace 4231 dace a9 10 lda #16 4232 dad0 4233 dad0 85 46 sta temp5 4234 dad2 4235 dad2 20 59 f3 jsr plotcharacters 4236 dad5 .L0257 ;; savescreen 4237 dad5 4238 dad5 20 b0 f0 jsr savescreen 4239 dad8 .L0258 ;; drawscreen 4240 dad8 4241 dad8 20 c0 f0 jsr drawscreen 4242 dadb .L0259 ;; controller_debounce_bit0{0} = 1 : controller_button_debounce_bit0{0} = 1 4243 dadb 4244 dadb ad 44 01 LDA controller_debounce_bit0 4245 dade 09 01 ORA #1 4246 dae0 8d 44 01 STA controller_debounce_bit0 4247 dae3 ad 45 01 LDA controller_button_debounce_bit0 4248 dae6 09 01 ORA #1 4249 dae8 8d 45 01 STA controller_button_debounce_bit0 4250 daeb . 4251 daeb ;; 4252 daeb 4253 daeb .titlescreenloop 4254 daeb ;; titlescreenloop 4255 daeb 4256 daeb .L0260 ;; restorescreen 4257 daeb 4258 daeb 20 9e f0 jsr restorescreen 4259 daee .L0261 ;; if switchreset then reboot 4260 daee 4261 daee 20 85 f4 jsr checkresetswitch 4262 daf1 d0 03 BNE .skipL0261 4263 daf3 .condpart98 4264 daf3 4c 72 f5 JMP START 4265 daf6 .skipL0261 4266 daf6 .L0262 ;; gosub ReadController 4267 daf6 4268 daf6 20 47 db jsr .ReadController 4269 daf9 4270 daf9 .L0263 ;; if controller_button1_press_bit1{1} && controller_button2_press_bit4{4} then controller_button_debounce_bit0{0} = 1 : clearscreen : savescreen : lives = $04 : playsfx sfx_bling : goto main 4271 daf9 4272 daf9 ad 45 01 LDA controller_button1_press_bit1 4273 dafc 29 02 AND #2 4274 dafe f0 36 BEQ .skipL0263 4275 db00 .condpart99 4276 db00 ad 46 01 LDA controller_button2_press_bit4 4277 db03 29 10 AND #16 4278 db05 f0 2f BEQ .skip99then 4279 db07 .condpart100 4280 db07 ad 45 01 LDA controller_button_debounce_bit0 4281 db0a 09 01 ORA #1 4282 db0c 8d 45 01 STA controller_button_debounce_bit0 4283 db0f 20 8c f0 jsr clearscreen 4284 db12 20 b0 f0 jsr savescreen 4285 db15 a9 04 LDA #$04 4286 db17 8d 67 01 STA lives 4287 db1a a9 01 lda #1 4288 db1c 85 de sta sfxschedulelock 4289 db1e a9 7f lda #sfx_bling 4292 db24 85 e1 sta sfxinstrumenthi 4293 db26 a9 00 lda #0 4294 db28 85 e2 sta sfxpitchoffset ; no pitch modification 4295 db2a 85 e3 sta sfxnoteindex ; not a musical note 4296 db2c 20 58 f2 jsr schedulesfx 4297 db2f a9 00 lda #0 4298 db31 85 de sta sfxschedulelock 4299 db33 4c e2 b8 jmp .main 4300 db36 4301 db36 .skip99then 4302 db36 .skipL0263 4303 db36 . 4304 db36 ;; 4305 db36 4306 db36 . 4307 db36 ;; 4308 db36 4309 db36 . 4310 db36 ;; 4311 db36 4312 db36 .L0264 ;; drawscreen 4313 db36 4314 db36 20 c0 f0 jsr drawscreen 4315 db39 .L0265 ;; goto titlescreenloop 4316 db39 4317 db39 4c eb da jmp .titlescreenloop 4318 db3c 4319 db3c . 4320 db3c ;; 4321 db3c 4322 db3c . 4323 db3c ;; 4324 db3c 4325 db3c .initialise_gamescreen 4326 db3c ;; initialise_gamescreen 4327 db3c 4328 db3c .L0266 ;; clearscreen 4329 db3c 4330 db3c 20 8c f0 jsr clearscreen 4331 db3f .L0267 ;; BACKGRND = $00 4332 db3f 4333 db3f a9 00 LDA #$00 4334 db41 85 20 STA BACKGRND 4335 db43 . 4336 db43 ;; 4337 db43 4338 db43 .L0268 ;; savescreen 4339 db43 4340 db43 20 b0 f0 jsr savescreen 4341 db46 .L0269 ;; return 4342 db46 4343 db46 60 RTS 4344 db47 . 4345 db47 ;; 4346 db47 4347 db47 .ReadController 4348 db47 ;; ReadController 4349 db47 4350 db47 .L0270 ;; controllerState = controllerState & %00000001 4351 db47 4352 db47 ad 44 01 LDA controllerState 4353 db4a 29 01 AND #%00000001 4354 db4c 8d 44 01 STA controllerState 4355 db4f .L0271 ;; controllerButtonState = controllerButtonState & %00000001 4356 db4f 4357 db4f ad 45 01 LDA controllerButtonState 4358 db52 29 01 AND #%00000001 4359 db54 8d 45 01 STA controllerButtonState 4360 db57 . 4361 db57 ;; 4362 db57 4363 db57 .L0272 ;; if !joy0any then goto _readControllerSkipJoystickDirectionCheck 4364 db57 4365 db57 ad 80 02 lda SWCHA 4366 db5a 29 f0 and #$F0 4367 db5c 49 f0 eor #$F0 4368 db5e d0 03 BNE .skipL0272 4369 db60 .condpart101 4370 db60 4c 9b db jmp ._readControllerSkipJoystickDirectionCheck 4371 db63 4372 db63 .skipL0272 4373 db63 .L0273 ;; if joy0left then controller_left_bit1{1} = 1 4374 db63 4375 db63 2c 80 02 bit SWCHA 4376 db66 70 08 BVS .skipL0273 4377 db68 .condpart102 4378 db68 ad 44 01 LDA controller_left_bit1 4379 db6b 09 02 ORA #2 4380 db6d 8d 44 01 STA controller_left_bit1 4381 db70 .skipL0273 4382 db70 .L0274 ;; if joy0right then controller_right_bit2{2} = 1 4383 db70 4384 db70 2c 80 02 bit SWCHA 4385 db73 30 08 BMI .skipL0274 4386 db75 .condpart103 4387 db75 ad 44 01 LDA controller_right_bit2 4388 db78 09 04 ORA #4 4389 db7a 8d 44 01 STA controller_right_bit2 4390 db7d .skipL0274 4391 db7d .L0275 ;; if joy0up then controller_up_bit3{3} = 1 4392 db7d 4393 db7d a9 10 lda #$10 4394 db7f 2c 80 02 bit SWCHA 4395 db82 d0 08 BNE .skipL0275 4396 db84 .condpart104 4397 db84 ad 44 01 LDA controller_up_bit3 4398 db87 09 08 ORA #8 4399 db89 8d 44 01 STA controller_up_bit3 4400 db8c .skipL0275 4401 db8c .L0276 ;; if joy0down then controller_down_bit4{4} = 1 4402 db8c 4403 db8c a9 20 lda #$20 4404 db8e 2c 80 02 bit SWCHA 4405 db91 d0 08 BNE .skipL0276 4406 db93 .condpart105 4407 db93 ad 44 01 LDA controller_down_bit4 4408 db96 09 10 ORA #16 4409 db98 8d 44 01 STA controller_down_bit4 4410 db9b .skipL0276 4411 db9b . 4412 db9b ;; 4413 db9b 4414 db9b ._readControllerSkipJoystickDirectionCheck 4415 db9b ;; _readControllerSkipJoystickDirectionCheck 4416 db9b 4417 db9b . 4418 db9b ;; 4419 db9b 4420 db9b .L0277 ;; if joy0fire1 then controller_button1_press_bit1{1} = 1 4421 db9b 4422 db9b 2c 02 21 bit sINPT1 4423 db9e 10 08 BPL .skipL0277 4424 dba0 .condpart106 4425 dba0 ad 45 01 LDA controller_button1_press_bit1 4426 dba3 09 02 ORA #2 4427 dba5 8d 45 01 STA controller_button1_press_bit1 4428 dba8 .skipL0277 4429 dba8 . 4430 dba8 ;; 4431 dba8 4432 dba8 .L0278 ;; if joy0fire0 then controller_button2_press_bit4{4} = 1 4433 dba8 4434 dba8 2c 02 21 bit sINPT1 4435 dbab 50 08 BVC .skipL0278 4436 dbad .condpart107 4437 dbad ad 46 01 LDA controller_button2_press_bit4 4438 dbb0 09 10 ORA #16 4439 dbb2 8d 46 01 STA controller_button2_press_bit4 4440 dbb5 .skipL0278 4441 dbb5 . 4442 dbb5 ;; 4443 dbb5 4444 dbb5 .L0279 ;; if controller_button1_press_bit1{1} then controller_button1_counter = controller_button1_counter + 1 : if controller_button1_counter > 99 then controller_button1_counter = 99 4445 dbb5 4446 dbb5 ad 45 01 LDA controller_button1_press_bit1 4447 dbb8 29 02 AND #2 4448 dbba f0 15 BEQ .skipL0279 4449 dbbc .condpart108 4450 dbbc ad 47 01 LDA controller_button1_counter 4451 dbbf 18 CLC 4452 dbc0 69 01 ADC #1 4453 dbc2 8d 47 01 STA controller_button1_counter 4454 dbc5 a9 63 LDA #99 4455 dbc7 cd 47 01 CMP controller_button1_counter 4456 dbca b0 05 BCS .skip108then 4457 dbcc .condpart109 4458 dbcc a9 63 LDA #99 4459 dbce 8d 47 01 STA controller_button1_counter 4460 dbd1 .skip108then 4461 dbd1 .skipL0279 4462 dbd1 .L0280 ;; if controller_button2_press_bit4{4} then controller_button2_counter = controller_button2_counter + 1 : if controller_button2_counter > 99 then controller_button2_counter = 99 4463 dbd1 4464 dbd1 ad 46 01 LDA controller_button2_press_bit4 4465 dbd4 29 10 AND #16 4466 dbd6 f0 15 BEQ .skipL0280 4467 dbd8 .condpart110 4468 dbd8 ad 48 01 LDA controller_button2_counter 4469 dbdb 18 CLC 4470 dbdc 69 01 ADC #1 4471 dbde 8d 48 01 STA controller_button2_counter 4472 dbe1 a9 63 LDA #99 4473 dbe3 cd 48 01 CMP controller_button2_counter 4474 dbe6 b0 05 BCS .skip110then 4475 dbe8 .condpart111 4476 dbe8 a9 63 LDA #99 4477 dbea 8d 48 01 STA controller_button2_counter 4478 dbed .skip110then 4479 dbed .skipL0280 4480 dbed . 4481 dbed ;; 4482 dbed 4483 dbed .L0281 ;; if controller_button1_counter > 15 then controller_button1_hold_bit3{3} = 1 4484 dbed 4485 dbed a9 0f LDA #15 4486 dbef cd 47 01 CMP controller_button1_counter 4487 dbf2 b0 08 BCS .skipL0281 4488 dbf4 .condpart112 4489 dbf4 ad 45 01 LDA controller_button1_hold_bit3 4490 dbf7 09 08 ORA #8 4491 dbf9 8d 45 01 STA controller_button1_hold_bit3 4492 dbfc .skipL0281 4493 dbfc .L0282 ;; if controller_button2_counter > 15 then controller_button2_hold_bit6{6} = 1 4494 dbfc 4495 dbfc a9 0f LDA #15 4496 dbfe cd 48 01 CMP controller_button2_counter 4497 dc01 b0 08 BCS .skipL0282 4498 dc03 .condpart113 4499 dc03 ad 46 01 LDA controller_button2_hold_bit6 4500 dc06 09 40 ORA #64 4501 dc08 8d 46 01 STA controller_button2_hold_bit6 4502 dc0b .skipL0282 4503 dc0b . 4504 dc0b ;; 4505 dc0b 4506 dc0b .L0283 ;; if !controller_button1_press_bit1{1} && controller_button1_counter > 0 && controller_button1_counter <= 15 then controller_button1_tap_bit2{2} = 1 4507 dc0b 4508 dc0b ad 45 01 LDA controller_button1_press_bit1 4509 dc0e 29 02 AND #2 4510 dc10 d0 16 BNE .skipL0283 4511 dc12 .condpart114 4512 dc12 a9 00 LDA #0 4513 dc14 cd 47 01 CMP controller_button1_counter 4514 dc17 b0 0f BCS .skip114then 4515 dc19 .condpart115 4516 dc19 a9 0f LDA #15 4517 dc1b cd 47 01 CMP controller_button1_counter 4518 dc1e 90 08 BCC .skip115then 4519 dc20 .condpart116 4520 dc20 ad 45 01 LDA controller_button1_tap_bit2 4521 dc23 09 04 ORA #4 4522 dc25 8d 45 01 STA controller_button1_tap_bit2 4523 dc28 .skip115then 4524 dc28 .skip114then 4525 dc28 .skipL0283 4526 dc28 .L0284 ;; if !controller_button2_press_bit4{4} && controller_button2_counter > 0 && controller_button2_counter <= 15 then controller_button2_tap_bit5{5} = 1 4527 dc28 4528 dc28 ad 46 01 LDA controller_button2_press_bit4 4529 dc2b 29 10 AND #16 4530 dc2d d0 16 BNE .skipL0284 4531 dc2f .condpart117 4532 dc2f a9 00 LDA #0 4533 dc31 cd 48 01 CMP controller_button2_counter 4534 dc34 b0 0f BCS .skip117then 4535 dc36 .condpart118 4536 dc36 a9 0f LDA #15 4537 dc38 cd 48 01 CMP controller_button2_counter 4538 dc3b 90 08 BCC .skip118then 4539 dc3d .condpart119 4540 dc3d ad 46 01 LDA controller_button2_tap_bit5 4541 dc40 09 20 ORA #32 4542 dc42 8d 46 01 STA controller_button2_tap_bit5 4543 dc45 .skip118then 4544 dc45 .skip117then 4545 dc45 .skipL0284 4546 dc45 . 4547 dc45 ;; 4548 dc45 4549 dc45 .L0285 ;; if !controller_button1_press_bit1{1} then controller_button1_counter = 0 4550 dc45 4551 dc45 ad 45 01 LDA controller_button1_press_bit1 4552 dc48 29 02 AND #2 4553 dc4a d0 05 BNE .skipL0285 4554 dc4c .condpart120 4555 dc4c a9 00 LDA #0 4556 dc4e 8d 47 01 STA controller_button1_counter 4557 dc51 .skipL0285 4558 dc51 .L0286 ;; if !controller_button2_press_bit4{4} then controller_button2_counter = 0 4559 dc51 4560 dc51 ad 46 01 LDA controller_button2_press_bit4 4561 dc54 29 10 AND #16 4562 dc56 d0 05 BNE .skipL0286 4563 dc58 .condpart121 4564 dc58 a9 00 LDA #0 4565 dc5a 8d 48 01 STA controller_button2_counter 4566 dc5d .skipL0286 4567 dc5d . 4568 dc5d ;; 4569 dc5d 4570 dc5d .L0287 ;; if controllerState = %00000001 then controller_debounce_bit0{0} = 0 4571 dc5d 4572 dc5d ad 44 01 LDA controllerState 4573 dc60 c9 01 CMP #%00000001 4574 dc62 d0 08 BNE .skipL0287 4575 dc64 .condpart122 4576 dc64 ad 44 01 LDA controller_debounce_bit0 4577 dc67 29 fe AND #254 4578 dc69 8d 44 01 STA controller_debounce_bit0 4579 dc6c .skipL0287 4580 dc6c .L0288 ;; if controllerButtonState = %00000001 then controller_button_debounce_bit0{0} = 0 4581 dc6c 4582 dc6c ad 45 01 LDA controllerButtonState 4583 dc6f c9 01 CMP #%00000001 4584 dc71 d0 08 BNE .skipL0288 4585 dc73 .condpart123 4586 dc73 ad 45 01 LDA controller_button_debounce_bit0 4587 dc76 29 fe AND #254 4588 dc78 8d 45 01 STA controller_button_debounce_bit0 4589 dc7b .skipL0288 4590 dc7b .L0289 ;; return 4591 dc7b 4592 dc7b 60 RTS 4593 dc7c . 4594 dc7c ;; 4595 dc7c 4596 dc7c .L0290 ;; data sfx_bling 4597 dc7c 4598 dc7c 4c b5 dc JMP .skipL0290 4599 dc7f sfx_bling 4600 dc7f 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4601 dc82 4602 dc82 1c 04 07 .byte.b $1c,$04,$07 4603 dc85 4604 dc85 1b 04 07 .byte.b $1b,$04,$07 4605 dc88 4606 dc88 04 0f 05 .byte.b $04,$0f,$05 4607 dc8b 4608 dc8b 15 04 09 .byte.b $15,$04,$09 4609 dc8e 4610 dc8e 16 04 07 .byte.b $16,$04,$07 4611 dc91 4612 dc91 03 0f 04 .byte.b $03,$0f,$04 4613 dc94 4614 dc94 11 04 08 .byte.b $11,$04,$08 4615 dc97 4616 dc97 11 04 08 .byte.b $11,$04,$08 4617 dc9a 4618 dc9a 11 04 04 .byte.b $11,$04,$04 4619 dc9d 4620 dc9d 0e 04 09 .byte.b $0e,$04,$09 4621 dca0 4622 dca0 0e 04 07 .byte.b $0e,$04,$07 4623 dca3 4624 dca3 0e 04 04 .byte.b $0e,$04,$04 4625 dca6 4626 dca6 1c 04 07 .byte.b $1c,$04,$07 4627 dca9 4628 dca9 1b 04 05 .byte.b $1b,$04,$05 4629 dcac 4630 dcac 1c 04 04 .byte.b $1c,$04,$04 4631 dcaf 4632 dcaf 1b 04 02 .byte.b $1b,$04,$02 4633 dcb2 4634 dcb2 00 00 00 .byte.b $00,$00,$00 4635 dcb5 4636 dcb5 .skipL0290 4637 dcb5 00 7f sfx_bling_lo = #sfx_bling 4639 dcb5 . 4640 dcb5 ;; 4641 dcb5 4642 dcb5 .L0291 ;; data sfx_pulsecannon 4643 dcb5 4644 dcb5 4c 0c dd JMP .skipL0291 4645 dcb8 sfx_pulsecannon 4646 dcb8 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4647 dcbb 4648 dcbb 1e 0c 0a .byte.b $1e,$0c,$0a ; first chunk of freq,channel,volume 4649 dcbe 4650 dcbe 07 06 0f .byte.b $07,$06,$0f 4651 dcc1 4652 dcc1 07 06 0f .byte.b $07,$06,$0f 4653 dcc4 4654 dcc4 1e 06 0f .byte.b $1e,$06,$0f 4655 dcc7 4656 dcc7 17 0c 0b .byte.b $17,$0c,$0b 4657 dcca 4658 dcca 1b 0c 0b .byte.b $1b,$0c,$0b 4659 dccd 4660 dccd 1e 0c 0f .byte.b $1e,$0c,$0f 4661 dcd0 4662 dcd0 07 06 0f .byte.b $07,$06,$0f 4663 dcd3 4664 dcd3 07 06 0f .byte.b $07,$06,$0f 4665 dcd6 4666 dcd6 1e 06 08 .byte.b $1e,$06,$08 4667 dcd9 4668 dcd9 17 0c 06 .byte.b $17,$0c,$06 4669 dcdc 4670 dcdc 1b 0c 0f .byte.b $1b,$0c,$0f 4671 dcdf 4672 dcdf 1e 0c 0f .byte.b $1e,$0c,$0f 4673 dce2 4674 dce2 07 06 0f .byte.b $07,$06,$0f 4675 dce5 4676 dce5 07 06 0f .byte.b $07,$06,$0f 4677 dce8 4678 dce8 0a 06 0a .byte.b $0a,$06,$0a 4679 dceb 4680 dceb 17 0c 0a .byte.b $17,$0c,$0a 4681 dcee 4682 dcee 1e 0c 04 .byte.b $1e,$0c,$04 4683 dcf1 4684 dcf1 1e 06 09 .byte.b $1e,$06,$09 4685 dcf4 4686 dcf4 1b 04 05 .byte.b $1b,$04,$05 4687 dcf7 4688 dcf7 07 06 0f .byte.b $07,$06,$0f 4689 dcfa 4690 dcfa 0a 06 09 .byte.b $0a,$06,$09 4691 dcfd 4692 dcfd 17 0c 0d .byte.b $17,$0c,$0d 4693 dd00 4694 dd00 1b 0c 09 .byte.b $1b,$0c,$09 4695 dd03 4696 dd03 0a 06 05 .byte.b $0a,$06,$05 4697 dd06 4698 dd06 17 0c 03 .byte.b $17,$0c,$03 4699 dd09 4700 dd09 00 00 00 .byte.b $00,$00,$00 4701 dd0c 4702 dd0c .skipL0291 4703 dd0c 00 b8 sfx_pulsecannon_lo = #sfx_pulsecannon 4705 dd0c . 4706 dd0c ;; 4707 dd0c 4708 dd0c .L0292 ;; data sfx_plainlaser 4709 dd0c 4710 dd0c 4c 3f dd JMP .skipL0292 4711 dd0f sfx_plainlaser 4712 dd0f 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4713 dd12 4714 dd12 10 04 06 .byte.b $10,$04,$06 ; first chunk of freq,channel,volume 4715 dd15 4716 dd15 13 04 08 .byte.b $13,$04,$08 4717 dd18 4718 dd18 16 04 08 .byte.b $16,$04,$08 4719 dd1b 4720 dd1b 16 04 07 .byte.b $16,$04,$07 4721 dd1e 4722 dd1e 1c 04 09 .byte.b $1c,$04,$09 4723 dd21 4724 dd21 0b 0c 0f .byte.b $0b,$0c,$0f 4725 dd24 4726 dd24 0d 0c 0f .byte.b $0d,$0c,$0f 4727 dd27 4728 dd27 0e 0c 0f .byte.b $0e,$0c,$0f 4729 dd2a 4730 dd2a 0e 0c 0f .byte.b $0e,$0c,$0f 4731 dd2d 4732 dd2d 12 0c 0f .byte.b $12,$0c,$0f 4733 dd30 4734 dd30 03 06 0d .byte.b $03,$06,$0d 4735 dd33 4736 dd33 1e 0c 0a .byte.b $1e,$0c,$0a 4737 dd36 4738 dd36 1e 0c 0c .byte.b $1e,$0c,$0c 4739 dd39 4740 dd39 0a 06 04 .byte.b $0a,$06,$04 4741 dd3c 4742 dd3c 00 00 00 .byte.b $00,$00,$00 4743 dd3f 4744 dd3f .skipL0292 4745 dd3f 00 0f sfx_plainlaser_lo = #sfx_plainlaser 4747 dd3f . 4748 dd3f ;; 4749 dd3f 4750 dd3f .L0293 ;; data sfx_explosion 4751 dd3f 4752 dd3f 4c d2 dd JMP .skipL0293 4753 dd42 sfx_explosion 4754 dd42 10 10 00 .byte.b $10,$10,$00 4755 dd45 4756 dd45 01 08 02 .byte.b $01,$08,$02 4757 dd48 4758 dd48 0b 0c 05 .byte.b $0b,$0c,$05 4759 dd4b 4760 dd4b 04 06 08 .byte.b $04,$06,$08 4761 dd4e 4762 dd4e 03 0e 0f .byte.b $03,$0e,$0f 4763 dd51 4764 dd51 09 06 0f .byte.b $09,$06,$0f 4765 dd54 4766 dd54 0d 06 0f .byte.b $0d,$06,$0f 4767 dd57 4768 dd57 04 0e 0f .byte.b $04,$0e,$0f 4769 dd5a 4770 dd5a 0f 06 08 .byte.b $0f,$06,$08 4771 dd5d 4772 dd5d 09 06 04 .byte.b $09,$06,$04 4773 dd60 4774 dd60 16 01 03 .byte.b $16,$01,$03 4775 dd63 4776 dd63 0c 06 04 .byte.b $0c,$06,$04 4777 dd66 4778 dd66 09 06 05 .byte.b $09,$06,$05 4779 dd69 4780 dd69 0a 06 03 .byte.b $0a,$06,$03 4781 dd6c 4782 dd6c 09 06 05 .byte.b $09,$06,$05 4783 dd6f 4784 dd6f 0d 06 08 .byte.b $0d,$06,$08 4785 dd72 4786 dd72 09 06 04 .byte.b $09,$06,$04 4787 dd75 4788 dd75 04 0e 06 .byte.b $04,$0e,$06 4789 dd78 4790 dd78 0f 06 05 .byte.b $0f,$06,$05 4791 dd7b 4792 dd7b 0f 06 07 .byte.b $0f,$06,$07 4793 dd7e 4794 dd7e 04 0e 07 .byte.b $04,$0e,$07 4795 dd81 4796 dd81 08 06 06 .byte.b $08,$06,$06 4797 dd84 4798 dd84 03 0e 08 .byte.b $03,$0e,$08 4799 dd87 4800 dd87 0f 06 06 .byte.b $0f,$06,$06 4801 dd8a 4802 dd8a 09 06 05 .byte.b $09,$06,$05 4803 dd8d 4804 dd8d 06 06 05 .byte.b $06,$06,$05 4805 dd90 4806 dd90 03 0e 05 .byte.b $03,$0e,$05 4807 dd93 4808 dd93 0e 06 06 .byte.b $0e,$06,$06 4809 dd96 4810 dd96 02 0e 05 .byte.b $02,$0e,$05 4811 dd99 4812 dd99 0f 06 03 .byte.b $0f,$06,$03 4813 dd9c 4814 dd9c 0e 06 06 .byte.b $0e,$06,$06 4815 dd9f 4816 dd9f 09 06 05 .byte.b $09,$06,$05 4817 dda2 4818 dda2 0c 06 05 .byte.b $0c,$06,$05 4819 dda5 4820 dda5 0f 06 03 .byte.b $0f,$06,$03 4821 dda8 4822 dda8 04 0e 08 .byte.b $04,$0e,$08 4823 ddab 4824 ddab 0c 06 03 .byte.b $0c,$06,$03 4825 ddae 4826 ddae 0f 06 03 .byte.b $0f,$06,$03 4827 ddb1 4828 ddb1 0c 06 06 .byte.b $0c,$06,$06 4829 ddb4 4830 ddb4 0f 06 04 .byte.b $0f,$06,$04 4831 ddb7 4832 ddb7 0f 06 05 .byte.b $0f,$06,$05 4833 ddba 4834 ddba 0f 06 03 .byte.b $0f,$06,$03 4835 ddbd 4836 ddbd 0a 06 04 .byte.b $0a,$06,$04 4837 ddc0 4838 ddc0 0f 06 03 .byte.b $0f,$06,$03 4839 ddc3 4840 ddc3 08 06 03 .byte.b $08,$06,$03 4841 ddc6 4842 ddc6 0c 06 03 .byte.b $0c,$06,$03 4843 ddc9 4844 ddc9 0e 06 03 .byte.b $0e,$06,$03 4845 ddcc 4846 ddcc 08 06 03 .byte.b $08,$06,$03 4847 ddcf 4848 ddcf 00 00 00 .byte.b $00,$00,$00 4849 ddd2 4850 ddd2 .skipL0293 4851 ddd2 00 42 sfx_explosion_lo = #sfx_explosion 4853 ddd2 DMAHOLEEND2 SET . 558 bytes of ROM space left in DMA hole 2. 4854 ddd2 echo " "," "," "," ",[(256*WZONEHEIGHT)-(DMAHOLEEND2 - DMAHOLESTART2)]d , "bytes of ROM space left in DMA hole 2." 4855 ddd2 - if ((256*WZONEHEIGHT)-(DMAHOLEEND2 - DMAHOLESTART2)) < 0 4856 ddd2 -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 4857 ddd2 endif 4858 ddd2 4859 e000 ORG $E000,0 ; ************* 4860 e000 4861 e000 4862 e100 ORG $E100,0 ; ************* 4863 e100 4864 e100 4865 e200 ORG $E200,0 ; ************* 4866 e200 4867 e200 4868 e300 ORG $E300,0 ; ************* 4869 e300 4870 e300 4871 e400 ORG $E400,0 ; ************* 4872 e400 4873 e400 4874 e500 ORG $E500,0 ; ************* 4875 e500 4876 e500 4877 e600 ORG $E600,0 ; ************* 4878 e600 4879 e600 4880 e700 ORG $E700,0 ; ************* 4881 e700 4882 e700 - if SPACEOVERFLOW > 0 4883 e700 - echo "" 4884 e700 - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 4885 e700 - echo "######## look above for areas with negative ROM space left." 4886 e700 - echo "######## Aborting assembly." 4887 e700 - ERR 4888 e700 endif 4889 e700 4890 e700 4891 e700 ; Provided under the CC0 license. See the included LICENSE.txt for details. 4892 e700 4893 e700 ifnconst bankswitchmode 4894 e700 if ( * < $f000 ) 4895 f000 ORG $F000 4896 f000 endif 4897 f000 - else 4898 f000 - ifconst ROM128K 4899 f000 - if ( * < $f000 ) 4900 f000 - ORG $27000 4901 f000 - RORG $F000 4902 f000 - endif 4903 f000 - endif 4904 f000 - ifconst ROM144K 4905 f000 - if ( * < $f000 ) 4906 f000 - ORG $27000 4907 f000 - RORG $F000 4908 f000 - endif 4909 f000 - endif 4910 f000 - ifconst ROM256K 4911 f000 - if ( * < $f000 ) 4912 f000 - ORG $47000 4913 f000 - RORG $F000 4914 f000 - endif 4915 f000 - endif 4916 f000 - ifconst ROM272K 4917 f000 - if ( * < $f000 ) 4918 f000 - ORG $47000 4919 f000 - RORG $F000 4920 f000 - endif 4921 f000 - endif 4922 f000 - ifconst ROM512K 4923 f000 - if ( * < $f000 ) 4924 f000 - ORG $87000 4925 f000 - RORG $F000 4926 f000 - endif 4927 f000 - endif 4928 f000 - ifconst ROM528K 4929 f000 - if ( * < $f000 ) 4930 f000 - ORG $87000 4931 f000 - RORG $F000 4932 f000 - endif 4933 f000 - endif 4934 f000 endif 4935 f000 4936 f000 ; all of these "modules" have conditional clauses in them, so even though 4937 f000 ; they're always included here, they don't take up rom unless the user 4938 f000 ; explicitly enables support for the feature. 4939 f000 4940 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_Vertical_Shooter_Rewrite2.78b.asm 4942 f000 endif 4943 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_Vertical_Shooter_Rewrite2.78b.asm 4945 f000 endif 4946 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_Vertical_Shooter_Rewrite2.78b.asm 4948 f000 endif 4949 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_Vertical_Shooter_Rewrite2.78b.asm 4951 f000 endif 4952 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 4953 f000 4954 f000 ;standard routimes needed for pretty much all games 4955 f000 4956 f000 ; some definitions used with "set debug color" 4957 f000 00 91 DEBUGCALC = $91 4958 f000 00 41 DEBUGWASTE = $41 4959 f000 00 c1 DEBUGDRAW = $C1 4960 f000 4961 f000 ;NMI and IRQ handlers 4962 f000 NMI 4963 f000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 4964 f000 48 pha ; save A 4965 f001 a5 4d lda visibleover 4966 f003 49 ff eor #255 4967 f005 85 4d sta visibleover 4968 f007 - ifconst DEBUGINTERRUPT 4969 f007 - and #$93 4970 f007 - sta BACKGRND 4971 f007 endif 4972 f007 ce b2 01 dec interruptindex 4973 f00a d0 03 bne skipreallyoffvisible 4974 f00c 4c 73 f0 jmp reallyoffvisible 4975 f00f skipreallyoffvisible 4976 f00f a5 4d lda visibleover 4977 f011 d0 03 bne carryontopscreenroutine 4978 f013 - ifconst .bottomscreenroutine 4979 f013 - jsr .bottomscreenroutine 4980 f013 endif 4981 f013 4982 f013 4c 65 f0 jmp skiptopscreenroutine 4983 f016 carryontopscreenroutine 4984 f016 8a txa ; save X+Y 4985 f017 48 pha 4986 f018 98 tya 4987 f019 48 pha 4988 f01a d8 cld 4989 f01b - ifconst .topscreenroutine 4990 f01b - jsr .topscreenroutine 4991 f01b endif 4992 f01b ifnconst CANARYOFF 4993 f01b ad c1 01 lda canary 4994 f01e f0 0c beq skipcanarytriggered 4995 f020 a9 45 lda #$45 4996 f022 85 20 sta BACKGRND 4997 f024 a9 60 lda #$60 4998 f026 85 3c sta CTRL 4999 f028 8d 07 21 sta sCTRL 5000 f02b 02 .byte.b $02 ; KIL/JAM 5001 f02c endif 5002 f02c skipcanarytriggered 5003 f02c ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 5004 f02f 5005 f02f ; ** Other important routines that need to regularly run, and can run onscreen. 5006 f02f ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 5007 f02f 5008 f02f - ifconst LONGCONTROLLERREAD 5009 f02f -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 5010 f02f - ldy port1control 5011 f02f - lda longreadtype,y 5012 f02f - beq LLRET1 5013 f02f - tay 5014 f02f - lda longreadroutinehiP1,y 5015 f02f - sta inttemp4 5016 f02f - lda longreadroutineloP1,y 5017 f02f - sta inttemp3 5018 f02f - jmp (inttemp3) 5019 f02f -LLRET1 5020 f02f - ldy port0control 5021 f02f - lda longreadtype,y 5022 f02f - beq LLRET0 5023 f02f - tay 5024 f02f - lda longreadroutinehiP0,y 5025 f02f - sta inttemp4 5026 f02f - lda longreadroutineloP0,y 5027 f02f - sta inttemp3 5028 f02f - jmp (inttemp3) 5029 f02f -LLRET0 5030 f02f - 5031 f02f - 5032 f02f - ifconst PADDLERANGE 5033 f02f -TIMEVAL = PADDLERANGE 5034 f02f - else 5035 f02f -TIMEVAL = 160 5036 f02f - endif 5037 f02f -TIMEOFFSET = 10 5038 f02f - 5039 f02f endif ; LONGCONTROLLERREAD 5040 f02f 5041 f02f 5042 f02f 20 e5 f1 jsr servicesfxchannels 5043 f032 - ifconst MUSICTRACKER 5044 f032 - jsr servicesong 5045 f032 endif ; MUSICTRACKER 5046 f032 5047 f032 ee a4 01 inc framecounter 5048 f035 ad a4 01 lda framecounter 5049 f038 29 3f and #63 5050 f03a d0 08 bne skipcountdownseconds 5051 f03c ad a5 01 lda countdownseconds 5052 f03f f0 03 beq skipcountdownseconds 5053 f041 ce a5 01 dec countdownseconds 5054 f044 skipcountdownseconds 5055 f044 5056 f044 a2 01 ldx #1 5057 f046 buttonreadloop 5058 f046 8a txa 5059 f047 48 pha 5060 f048 bc b7 01 ldy port0control,x 5061 f04b b9 c8 f1 lda buttonhandlerlo,y 5062 f04e 85 da sta inttemp3 5063 f050 b9 bd f1 lda buttonhandlerhi,y 5064 f053 85 db sta inttemp4 5065 f055 05 da ora inttemp3 5066 f057 f0 03 beq buttonreadloopreturn 5067 f059 6c da 00 jmp (inttemp3) 5068 f05c buttonreadloopreturn 5069 f05c 68 pla 5070 f05d aa tax 5071 f05e ca dex 5072 f05f 10 e5 bpl buttonreadloop 5073 f061 5074 f061 - ifconst KEYPADSUPPORT 5075 f061 - jsr keypadrowselect 5076 f061 endif ; KEYPADSUPPORT 5077 f061 5078 f061 5079 f061 - ifconst DOUBLEBUFFER 5080 f061 - lda doublebufferminimumframeindex 5081 f061 - beq skipdoublebufferminimumframeindexadjust 5082 f061 - dec doublebufferminimumframeindex 5083 f061 -skipdoublebufferminimumframeindexadjust 5084 f061 endif 5085 f061 5086 f061 68 pla 5087 f062 a8 tay 5088 f063 68 pla 5089 f064 aa tax 5090 f065 skiptopscreenroutine 5091 f065 68 pla 5092 f066 40 RTI 5093 f067 5094 f067 IRQ ; the only source of non-nmi is the BRK opcode. The only 5095 f067 ifnconst BREAKPROTECTOFF 5096 f067 a9 1a lda #$1A 5097 f069 85 20 sta BACKGRND 5098 f06b a9 60 lda #$60 5099 f06d 85 3c sta CTRL 5100 f06f 8d 07 21 sta sCTRL 5101 f072 02 .byte.b $02 ; KIL/JAM 5102 f073 - else 5103 f073 - RTI 5104 f073 endif 5105 f073 5106 f073 - ifconst LONGCONTROLLERREAD 5107 f073 - 5108 f073 -longreadtype 5109 f073 - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 5110 f073 - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 5111 f073 - .byte 3, 3, 0 ; STMOUSE AMOUSE ATARIVOX 5112 f073 - 5113 f073 -longreadroutineloP0 5114 f073 - .byte LLRET0 ; 0 = no routine 5121 f073 - .byte >paddleport0update ; 1 = paddle 5122 f073 - .byte >trakball0update ; 2 = trackball 5123 f073 - .byte >mouse0update ; 3 = mouse 5124 f073 - 5125 f073 -longreadroutineloP1 5126 f073 - .byte LLRET1 ; 0 = no routine 5133 f073 - .byte >paddleport1update ; 1 = paddle 5134 f073 - .byte >trakball1update ; 2 = trackball 5135 f073 - .byte >mouse1update ; 3 = mouse 5136 f073 - 5137 f073 - 5138 f073 -SETTIM64T 5139 f073 - bne skipdefaulttime 5140 f073 - ifnconst PADDLESMOOTHINGOFF 5141 f073 - lda #(TIMEVAL+TIMEOFFSET+1) 5142 f073 - else 5143 f073 - lda #(TIMEVAL+TIMEOFFSET) 5144 f073 - endif 5145 f073 -skipdefaulttime 5146 f073 - tay 5147 f073 - dey 5148 f073 -.setTIM64Tloop 5149 f073 - sta TIM64T 5150 f073 - cpy INTIM 5151 f073 - bne .setTIM64Tloop 5152 f073 - rts 5153 f073 endif ; LONGCONTROLLERREAD 5154 f073 5155 f073 reallyoffvisible 5156 f073 85 24 sta WSYNC 5157 f075 5158 f075 a9 00 lda #0 5159 f077 85 4d sta visibleover 5160 f079 - ifconst DEBUGINTERRUPT 5161 f079 - sta BACKGRND 5162 f079 endif 5163 f079 5164 f079 a9 03 lda #3 5165 f07b 8d b2 01 sta interruptindex 5166 f07e 5167 f07e 8a txa 5168 f07f 48 pha 5169 f080 98 tya 5170 f081 48 pha 5171 f082 d8 cld 5172 f083 5173 f083 5174 f083 20 5f f1 jsr uninterruptableroutines 5175 f086 5176 f086 - ifconst .userinterrupt 5177 f086 - jsr .userinterrupt 5178 f086 endif 5179 f086 5180 f086 - ifconst KEYPADSUPPORT 5181 f086 - jsr keypadcolumnread 5182 f086 endif 5183 f086 5184 f086 68 pla 5185 f087 a8 tay 5186 f088 68 pla 5187 f089 aa tax 5188 f08a 68 pla 5189 f08b 40 RTI 5190 f08c 5191 f08c clearscreen 5192 f08c a2 17 ldx #(WZONECOUNT-1) 5193 f08e a9 00 lda #0 5194 f090 clearscreenloop 5195 f090 95 65 sta dlend,x 5196 f092 ca dex 5197 f093 10 fb bpl clearscreenloop 5198 f095 a9 00 lda #0 5199 f097 8d ad 01 sta valbufend ; clear the bcd value buffer 5200 f09a 8d ae 01 sta valbufendsave 5201 f09d 60 rts 5202 f09e 5203 f09e restorescreen 5204 f09e a2 17 ldx #(WZONECOUNT-1) 5205 f0a0 a9 00 lda #0 5206 f0a2 restorescreenloop 5207 f0a2 b5 82 lda dlendsave,x 5208 f0a4 95 65 sta dlend,x 5209 f0a6 ca dex 5210 f0a7 10 f9 bpl restorescreenloop 5211 f0a9 ad ae 01 lda valbufendsave 5212 f0ac 8d ad 01 sta valbufend 5213 f0af 60 rts 5214 f0b0 5215 f0b0 savescreen 5216 f0b0 a2 17 ldx #(WZONECOUNT-1) 5217 f0b2 savescreenloop 5218 f0b2 b5 65 lda dlend,x 5219 f0b4 95 82 sta dlendsave,x 5220 f0b6 ca dex 5221 f0b7 10 f9 bpl savescreenloop 5222 f0b9 ad ad 01 lda valbufend 5223 f0bc 8d ae 01 sta valbufendsave 5224 f0bf - ifconst DOUBLEBUFFER 5225 f0bf - lda doublebufferstate 5226 f0bf - beq savescreenrts 5227 f0bf - lda #1 5228 f0bf - sta doublebufferbufferdirty 5229 f0bf -savescreenrts 5230 f0bf endif ; DOUBLEBUFFER 5231 f0bf 60 rts 5232 f0c0 5233 f0c0 drawscreen 5234 f0c0 5235 f0c0 a9 00 lda #0 5236 f0c2 85 42 sta temp1 ; not B&W if we're here... 5237 f0c4 5238 f0c4 drawscreenwait 5239 f0c4 a5 4d lda visibleover 5240 f0c6 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 5241 f0c8 5242 f0c8 ;restore some registers in case the game changed them mid-screen... 5243 f0c8 ad 07 21 lda sCTRL 5244 f0cb 05 42 ora temp1 5245 f0cd 85 3c sta CTRL 5246 f0cf ad 0b 21 lda sCHARBASE 5247 f0d2 85 34 sta CHARBASE 5248 f0d4 5249 f0d4 ;ensure all of the display list is terminated... 5250 f0d4 20 45 f1 jsr terminatedisplaylist 5251 f0d7 5252 f0d7 ifnconst pauseroutineoff 5253 f0d7 20 e2 f0 jsr pauseroutine 5254 f0da endif ; pauseroutineoff 5255 f0da 5256 f0da ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 5257 f0da ; delaying a full frame, but still allowing time for basic calculations. 5258 f0da visiblescreenstartedwait 5259 f0da a5 4d lda visibleover 5260 f0dc f0 fc beq visiblescreenstartedwait 5261 f0de visiblescreenstartedwaitdone 5262 f0de ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 5263 f0e1 60 rts 5264 f0e2 5265 f0e2 ifnconst pauseroutineoff 5266 f0e2 ; check to see if pause was pressed and released 5267 f0e2 pauseroutine 5268 f0e2 ad b3 01 lda pausedisable 5269 f0e5 d0 4e bne leavepauseroutine 5270 f0e7 a9 08 lda #8 5271 f0e9 2c 82 02 bit SWCHB 5272 f0ec f0 29 beq pausepressed 5273 f0ee 5274 f0ee ifnconst SOFTRESETASPAUSEOFF 5275 f0ee ifnconst MOUSESUPPORT 5276 f0ee ifnconst TRAKBALLSUPPORT 5277 f0ee ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 5278 f0f1 29 70 and #%01110000 ; _LDU 5279 f0f3 f0 22 beq pausepressed 5280 f0f5 endif 5281 f0f5 endif 5282 f0f5 endif 5283 f0f5 5284 f0f5 ;pause isn't pressed 5285 f0f5 a9 00 lda #0 5286 f0f7 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 5287 f0fa 5288 f0fa ;check if we're in an already paused state 5289 f0fa ad 00 21 lda pausestate 5290 f0fd f0 36 beq leavepauseroutine ; nope, leave 5291 f0ff 5292 f0ff c9 01 cmp #1 ; last frame was the start of pausing 5293 f101 f0 2b beq enterpausestate2 ; move from state 1 to 2 5294 f103 5295 f103 c9 02 cmp #2 5296 f105 f0 34 beq carryonpausing 5297 f107 5298 f107 ;pausestate must be >2, which means we're ending an unpause 5299 f107 a9 00 lda #0 5300 f109 8d ac 01 sta pausebuttonflag 5301 f10c 8d 00 21 sta pausestate 5302 f10f ad 07 21 lda sCTRL 5303 f112 85 3c sta CTRL 5304 f114 4c 35 f1 jmp leavepauseroutine 5305 f117 5306 f117 pausepressed 5307 f117 ;pause is pressed 5308 f117 ad ac 01 lda pausebuttonflag 5309 f11a c9 ff cmp #$ff 5310 f11c f0 1d beq carryonpausing 5311 f11e 5312 f11e ;its a new press, increment the state 5313 f11e ee 00 21 inc pausestate 5314 f121 5315 f121 ;silence volume at the start and end of pausing 5316 f121 a9 00 lda #0 5317 f123 85 19 sta AUDV0 5318 f125 85 1a sta AUDV1 5319 f127 5320 f127 - ifconst pokeysupport 5321 f127 - ldy #7 5322 f127 -pausesilencepokeyaudioloop 5323 f127 - sta (pokeybase),y 5324 f127 - dey 5325 f127 - bpl pausesilencepokeyaudioloop 5326 f127 endif ; pokeysupport 5327 f127 5328 f127 a9 ff lda #$ff 5329 f129 8d ac 01 sta pausebuttonflag 5330 f12c d0 0d bne carryonpausing 5331 f12e 5332 f12e enterpausestate2 5333 f12e a9 02 lda #2 5334 f130 8d 00 21 sta pausestate 5335 f133 d0 06 bne carryonpausing 5336 f135 leavepauseroutine 5337 f135 ad 07 21 lda sCTRL 5338 f138 85 3c sta CTRL 5339 f13a 60 rts 5340 f13b carryonpausing 5341 f13b - ifconst .pause 5342 f13b - jsr .pause 5343 f13b endif ; .pause 5344 f13b ad 07 21 lda sCTRL 5345 f13e 09 80 ora #%10000000 ; turn off colorburst during pause... 5346 f140 85 3c sta CTRL 5347 f142 4c e2 f0 jmp pauseroutine 5348 f145 endif ; pauseroutineoff 5349 f145 5350 f145 5351 f145 - ifconst DOUBLEBUFFER 5352 f145 -skipterminatedisplaylistreturn 5353 f145 - rts 5354 f145 endif ; DOUBLEBUFFER 5355 f145 terminatedisplaylist 5356 f145 - ifconst DOUBLEBUFFER 5357 f145 - lda doublebufferstate 5358 f145 - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 5359 f145 endif ; DOUBLEBUFFER 5360 f145 terminatedisplaybuffer 5361 f145 ;add DL end entry on each DL 5362 f145 a2 17 ldx #(WZONECOUNT-1) 5363 f147 dlendloop 5364 f147 bd 48 f6 lda DLPOINTL,x 5365 f14a - ifconst DOUBLEBUFFER 5366 f14a - clc 5367 f14a - adc doublebufferdloffset 5368 f14a endif ; DOUBLEBUFFER 5369 f14a 85 63 sta dlpnt 5370 f14c bd 30 f6 lda DLPOINTH,x 5371 f14f - ifconst DOUBLEBUFFER 5372 f14f - adc #0 5373 f14f endif ; DOUBLEBUFFER 5374 f14f 85 64 sta dlpnt+1 5375 f151 b4 65 ldy dlend,x 5376 f153 a9 00 lda #$00 5377 f155 dlendmoreloops 5378 f155 c8 iny 5379 f156 91 63 sta (dlpnt),y 5380 f158 - ifconst FRAMESKIPGLITCHFIXWEAK 5381 f158 - cpy #DLLASTOBJ+1 5382 f158 - beq dlendthiszonedone 5383 f158 - iny 5384 f158 - iny 5385 f158 - iny 5386 f158 - iny 5387 f158 - iny 5388 f158 - sta (dlpnt),y 5389 f158 -dlendthiszonedone 5390 f158 endif FRAMESKIPGLITCHFIXWEAK 5391 f158 - ifconst FRAMESKIPGLITCHFIX 5392 f158 - iny 5393 f158 - iny 5394 f158 - iny 5395 f158 - iny 5396 f158 - cpy #DLLASTOBJ-1 5397 f158 - bcc dlendmoreloops 5398 f158 endif ; FRAMESKIPGLITCHFIX 5399 f158 ca dex 5400 f159 10 ec bpl dlendloop 5401 f15b 5402 f15b ifnconst pauseroutineoff 5403 f15b 20 e2 f0 jsr pauseroutine 5404 f15e endif ; pauseroutineoff 5405 f15e 60 rts 5406 f15f 5407 f15f uninterruptableroutines 5408 f15f ; this is for routines that must happen off the visible screen, each frame. 5409 f15f 5410 f15f - ifconst AVOXVOICE 5411 f15f - jsr serviceatarivoxqueue 5412 f15f endif 5413 f15f 5414 f15f a9 00 lda #0 5415 f161 8d b6 01 sta palfastframe 5416 f164 ad 09 21 lda paldetected 5417 f167 f0 10 beq skippalframeadjusting 5418 f169 ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 5419 f169 ae b5 01 ldx palframes 5420 f16c e8 inx 5421 f16d e0 05 cpx #5 5422 f16f d0 05 bne palframeskipdone 5423 f171 ee b6 01 inc palfastframe 5424 f174 a2 00 ldx #0 5425 f176 palframeskipdone 5426 f176 8e b5 01 stx palframes 5427 f179 skippalframeadjusting 5428 f179 5429 f179 - ifconst MUSICTRACKER 5430 f179 - ; We normally run the servicesong routine from the top-screen interrupt, but if it 5431 f179 - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 5432 f179 - ; If that happens, we try again here. Chances are very small we'll run into the same 5433 f179 - ; problem twice, and if we do, we just drop a musical note or two. 5434 f179 - lda sfxschedulemissed 5435 f179 - beq servicesongwasnotmissed 5436 f179 - jsr servicesong 5437 f179 -servicesongwasnotmissed 5438 f179 endif ; MUSICTRACKER 5439 f179 5440 f179 60 rts 5441 f17a 5442 f17a serviceatarivoxqueue 5443 f17a - ifconst AVOXVOICE 5444 f17a - lda voxlock 5445 f17a - bne skipvoxprocessing ; the vox is in the middle of speech address update 5446 f17a -skipvoxqueuesizedec 5447 f17a - jmp processavoxvoice 5448 f17a -skipvoxprocessing 5449 f17a - rts 5450 f17a - 5451 f17a -processavoxvoice 5452 f17a - lda avoxenable 5453 f17a - bne avoxfixport 5454 f17a - SPKOUT tempavox 5455 f17a - rts 5456 f17a -avoxfixport 5457 f17a - lda #0 ; restore the port to all bits as inputs... 5458 f17a - sta CTLSWA 5459 f17a - rts 5460 f17a -silenceavoxvoice 5461 f17a - SPEAK avoxsilentdata 5462 f17a - rts 5463 f17a -avoxsilentdata 5464 f17a - .byte 31,255 5465 f17a else 5466 f17a 60 rts 5467 f17b endif ; AVOXVOICE 5468 f17b 5469 f17b joybuttonhandler 5470 f17b 8a txa 5471 f17c 0a asl 5472 f17d a8 tay 5473 f17e b9 08 00 lda INPT0,y 5474 f181 4a lsr 5475 f182 9d 02 21 sta sINPT1,x 5476 f185 b9 09 00 lda INPT1,y 5477 f188 29 80 and #%10000000 5478 f18a 1d 02 21 ora sINPT1,x 5479 f18d 9d 02 21 sta sINPT1,x 5480 f190 5481 f190 b5 0c lda INPT4,x 5482 f192 30 19 bmi .skip1bjoyfirecheck 5483 f194 ;one button joystick is down 5484 f194 49 80 eor #%10000000 5485 f196 9d 02 21 sta sINPT1,x 5486 f199 5487 f199 ad b1 01 lda joybuttonmode 5488 f19c 3d b0 f1 and twobuttonmask,x 5489 f19f f0 0c beq .skip1bjoyfirecheck 5490 f1a1 ad b1 01 lda joybuttonmode 5491 f1a4 1d b0 f1 ora twobuttonmask,x 5492 f1a7 8d b1 01 sta joybuttonmode 5493 f1aa 8d 82 02 sta SWCHB 5494 f1ad .skip1bjoyfirecheck 5495 f1ad 4c 5c f0 jmp buttonreadloopreturn 5496 f1b0 5497 f1b0 twobuttonmask 5498 f1b0 04 10 .byte.b %00000100,%00010000 5499 f1b2 5500 f1b2 gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 5501 f1b2 - ifconst LIGHTGUNSUPPORT 5502 f1b2 - cpx #0 5503 f1b2 - bne secondportgunhandler 5504 f1b2 -firstportgunhandler 5505 f1b2 - lda SWCHA 5506 f1b2 - asl 5507 f1b2 - asl 5508 f1b2 - asl ; shift D4 to D7 5509 f1b2 - and #%10000000 5510 f1b2 - eor #%10000000 5511 f1b2 - sta sINPT1 5512 f1b2 - jmp buttonreadloopreturn 5513 f1b2 -secondportgunhandler 5514 f1b2 - lda SWCHA 5515 f1b2 - lsr ; shift D0 into carry 5516 f1b2 - lsr ; shift carry into D7 5517 f1b2 - and #%10000000 5518 f1b2 - eor #%10000000 5519 f1b2 - sta sINPT3 5520 f1b2 - jmp buttonreadloopreturn 5521 f1b2 endif ; LIGHTGUNSUPPORT 5522 f1b2 5523 f1b2 controlsusing2buttoncode 5524 f1b2 00 .byte.b 0 ; 00=no controller plugged in 5525 f1b3 01 .byte.b 1 ; 01=proline joystick 5526 f1b4 00 .byte.b 0 ; 02=lightgun 5527 f1b5 00 .byte.b 0 ; 03=paddle 5528 f1b6 01 .byte.b 1 ; 04=trakball 5529 f1b7 01 .byte.b 1 ; 05=vcs joystick 5530 f1b8 01 .byte.b 1 ; 06=driving control 5531 f1b9 00 .byte.b 0 ; 07=keypad control 5532 f1ba 00 .byte.b 0 ; 08=st mouse/cx80 5533 f1bb 00 .byte.b 0 ; 09=amiga mouse 5534 f1bc 01 .byte.b 1 ; 10=atarivox 5535 f1bd 5536 f1bd buttonhandlerhi 5537 f1bd 00 .byte.b 0 ; 00=no controller plugged in 5538 f1be f1 .byte.b >joybuttonhandler ; 01=proline joystick 5539 f1bf f1 .byte.b >gunbuttonhandler ; 02=lightgun 5540 f1c0 f5 .byte.b >paddlebuttonhandler ; 03=paddle 5541 f1c1 f1 .byte.b >joybuttonhandler ; 04=trakball 5542 f1c2 f1 .byte.b >joybuttonhandler ; 05=vcs joystick 5543 f1c3 f1 .byte.b >joybuttonhandler ; 06=driving control 5544 f1c4 00 .byte.b 0 ; 07=keypad 5545 f1c5 f5 .byte.b >mousebuttonhandler ; 08=st mouse 5546 f1c6 f5 .byte.b >mousebuttonhandler ; 09=amiga mouse 5547 f1c7 f1 .byte.b >joybuttonhandler ; 10=atarivox 5548 f1c8 buttonhandlerlo 5549 f1c8 00 .byte.b 0 ; 00=no controller plugged in 5550 f1c9 7b .byte.b $0F means the sound is looped while priority is active 5651 f226 5652 f226 05 d9 ora inttemp2 5653 f228 05 d8 ora inttemp1 ; check if F|C|V=0 5654 f22a f0 23 beq zerosfx ; if so, we're at the end of the sound. 5655 f22c 5656 f22c advancesfxpointer 5657 f22c ; advance the pointer to the next sound chunk 5658 f22c c8 iny 5659 f22d 84 da sty inttemp3 5660 f22f 18 clc 5661 f230 b5 4e lda sfx1pointlo,x 5662 f232 65 da adc inttemp3 5663 f234 95 4e sta sfx1pointlo,x 5664 f236 b5 50 lda sfx1pointhi,x 5665 f238 69 00 adc #0 5666 f23a 95 50 sta sfx1pointhi,x 5667 f23c 4c e7 f1 jmp servicesfxchannelsloop 5668 f23f 5669 f23f sfxsoundloop 5670 f23f 48 pha 5671 f240 b5 52 lda sfx1priority,x 5672 f242 d0 04 bne sfxsoundloop_carryon 5673 f244 68 pla ; fix the stack before we go 5674 f245 4c 2c f2 jmp advancesfxpointer 5675 f248 sfxsoundloop_carryon 5676 f248 68 pla 5677 f249 29 f0 and #$F0 5678 f24b 4a lsr 5679 f24c 4a lsr 5680 f24d 4a lsr 5681 f24e 4a lsr 5682 f24f 5683 f24f zerosfx 5684 f24f 95 4e sta sfx1pointlo,x 5685 f251 95 50 sta sfx1pointhi,x 5686 f253 95 52 sta sfx1priority,x 5687 f255 4c e7 f1 jmp servicesfxchannelsloop 5688 f258 5689 f258 5690 f258 schedulesfx 5691 f258 ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 5692 f258 a0 00 ldy #0 5693 f25a b1 e0 lda (sfxinstrumentlo),y 5694 f25c - ifconst pokeysupport 5695 f25c - cmp #$20 ; POKEY? 5696 f25c - bne scheduletiasfx 5697 f25c - jmp schedulepokeysfx 5698 f25c endif 5699 f25c scheduletiasfx 5700 f25c ;cmp #$10 ; TIA? 5701 f25c ;beq continuescheduletiasfx 5702 f25c ; rts ; unhandled!!! 5703 f25c continuescheduletiasfx 5704 f25c ifnconst TIASFXMONO 5705 f25c a5 4e lda sfx1pointlo 5706 f25e 05 50 ora sfx1pointhi 5707 f260 f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 5708 f262 a5 4f lda sfx2pointlo 5709 f264 05 51 ora sfx2pointhi 5710 f266 f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 5711 f268 ; Both channels are scheduled. 5712 f268 a0 01 ldy #1 5713 f26a b1 e0 lda (sfxinstrumentlo),y 5714 f26c d0 01 bne interruptsfx 5715 f26e 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 5716 f26f interruptsfx 5717 f26f ;Compare which active sound has a lower priority. We'll interrupt the lower one. 5718 f26f a5 52 lda sfx1priority 5719 f271 c5 53 cmp sfx2priority 5720 f273 b0 04 bcs schedulesfx2 5721 f275 endif ; !TIASFXMONO 5722 f275 5723 f275 schedulesfx1 5724 f275 a2 00 ldx #0 ; channel 1 5725 f277 ifnconst TIASFXMONO 5726 f277 f0 02 beq skipschedulesfx2 5727 f279 schedulesfx2 5728 f279 a2 01 ldx #1 ; channel 2 5729 f27b skipschedulesfx2 5730 f27b endif ; !TIASFXMONO 5731 f27b 5732 f27b - ifconst MUSICTRACKER 5733 f27b - lda sfxnoteindex 5734 f27b - bpl skipdrumkitoverride 5735 f27b - and #$7F ; subtract 128 5736 f27b - sec 5737 f27b - sbc #4 ; drums start at 132, i.e. octave 10 5738 f27b - asl 5739 f27b - tay 5740 f27b - lda tiadrumkitdefinition,y 5741 f27b - sta sfxinstrumentlo 5742 f27b - iny 5743 f27b - lda tiadrumkitdefinition,y 5744 f27b - sta sfxinstrumenthi 5745 f27b - lda #0 5746 f27b - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 5747 f27b -skipdrumkitoverride 5748 f27b endif ; MUSICTRACKER 5749 f27b a0 01 ldy #1 ; get priority and sound-resolution (in frames) 5750 f27d b1 e0 lda (sfxinstrumentlo),y 5751 f27f 95 52 sta sfx1priority,x 5752 f281 c8 iny 5753 f282 b1 e0 lda (sfxinstrumentlo),y 5754 f284 95 56 sta sfx1frames,x 5755 f286 a5 e0 lda sfxinstrumentlo 5756 f288 18 clc 5757 f289 69 03 adc #3 5758 f28b 95 4e sta sfx1pointlo,x 5759 f28d a5 e1 lda sfxinstrumenthi 5760 f28f 69 00 adc #0 5761 f291 95 50 sta sfx1pointhi,x 5762 f293 a5 e2 lda sfxpitchoffset 5763 f295 95 54 sta sfx1poffset,x 5764 f297 a9 00 lda #0 5765 f299 95 58 sta sfx1tick,x 5766 f29b a5 e3 lda sfxnoteindex 5767 f29d 95 cd sta sfx1notedata,x 5768 f29f 60 rts 5769 f2a0 5770 f2a0 plotsprite 5771 f2a0 ifnconst NODRAWWAIT 5772 f2a0 - ifconst DOUBLEBUFFER 5773 f2a0 - lda doublebufferstate 5774 f2a0 - bne skipplotspritewait 5775 f2a0 endif ; DOUBLEBUFFER 5776 f2a0 - ifconst DEBUGWAITCOLOR 5777 f2a0 - lda #$41 5778 f2a0 - sta BACKGRND 5779 f2a0 endif 5780 f2a0 plotspritewait 5781 f2a0 a5 4d lda visibleover 5782 f2a2 d0 fc bne plotspritewait 5783 f2a4 skipplotspritewait 5784 f2a4 - ifconst DEBUGWAITCOLOR 5785 f2a4 - lda #$0 5786 f2a4 - sta BACKGRND 5787 f2a4 endif 5788 f2a4 endif 5789 f2a4 5790 f2a4 ;arguments: 5791 f2a4 ; temp1=lo graphicdata 5792 f2a4 ; temp2=hi graphicdata 5793 f2a4 ; temp3=palette | width byte 5794 f2a4 ; temp4=x 5795 f2a4 ; temp5=y 5796 f2a4 ; temp6=mode 5797 f2a4 a5 46 lda temp5 ;Y position 5798 f2a6 4a lsr ; 2 - Divide by 8 or 16 5799 f2a7 4a lsr ; 2 5800 f2a8 4a lsr ; 2 5801 f2a9 - if WZONEHEIGHT = 16 5802 f2a9 - lsr ; 2 5803 f2a9 endif 5804 f2a9 5805 f2a9 aa tax 5806 f2aa 5807 f2aa ifnconst NOLIMITCHECKING 5808 f2aa 5809 f2aa ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 5810 f2aa 5811 f2aa c9 18 cmp #WZONECOUNT 5812 f2ac 5813 f2ac 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 5814 f2ae ; otherwise, check to see if the bottom half is in zone 0... 5815 f2ae 5816 f2ae - if WZONEHEIGHT = 16 5817 f2ae - cmp #15 5818 f2ae else 5819 f2ae c9 1f cmp #31 5820 f2b0 endif 5821 f2b0 5822 f2b0 d0 05 bne exitplotsprite1 5823 f2b2 a2 00 ldx #0 5824 f2b4 4c f1 f2 jmp continueplotsprite2 5825 f2b7 exitplotsprite1 5826 f2b7 60 rts 5827 f2b8 5828 f2b8 continueplotsprite1 5829 f2b8 endif 5830 f2b8 5831 f2b8 bd 48 f6 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 5832 f2bb - ifconst DOUBLEBUFFER 5833 f2bb - clc 5834 f2bb - adc doublebufferdloffset 5835 f2bb endif ; DOUBLEBUFFER 5836 f2bb 85 63 sta dlpnt 5837 f2bd bd 30 f6 lda DLPOINTH,x 5838 f2c0 - ifconst DOUBLEBUFFER 5839 f2c0 - adc #0 5840 f2c0 endif ; DOUBLEBUFFER 5841 f2c0 85 64 sta dlpnt+1 5842 f2c2 5843 f2c2 ;Create DL entry for upper part of sprite 5844 f2c2 5845 f2c2 b4 65 ldy dlend,x ;Get the index to the end of this DL 5846 f2c4 5847 f2c4 ifconst CHECKOVERWRITE 5848 f2c4 c0 4b cpy #DLLASTOBJ 5849 f2c6 f0 21 beq checkcontinueplotsprite2 5850 f2c8 continueplotsprite1a 5851 f2c8 endif 5852 f2c8 5853 f2c8 a5 42 lda temp1 ; graphic data, lo byte 5854 f2ca 91 63 sta (dlpnt),y ;Low byte of data address 5855 f2cc 5856 f2cc ifnconst ATOMICSPRITEUPDATE 5857 f2cc c8 iny 5858 f2cd a5 47 lda temp6 5859 f2cf 91 63 sta (dlpnt),y 5860 f2d1 - else 5861 f2d1 - iny 5862 f2d1 - sty temp8 5863 f2d1 endif 5864 f2d1 5865 f2d1 c8 iny 5866 f2d2 5867 f2d2 a5 46 lda temp5 ;Y position 5868 f2d4 29 07 and #(WZONEHEIGHT - 1) 5869 f2d6 c9 01 cmp #1 ; clear carry if our sprite is just in this zone 5870 f2d8 05 43 ora temp2 ; graphic data, hi byte 5871 f2da 91 63 sta (dlpnt),y 5872 f2dc 5873 f2dc 5874 f2dc c8 iny 5875 f2dd a5 44 lda temp3 ;palette|width 5876 f2df 91 63 sta (dlpnt),y 5877 f2e1 5878 f2e1 c8 iny 5879 f2e2 a5 45 lda temp4 ;Horizontal position 5880 f2e4 91 63 sta (dlpnt),y 5881 f2e6 5882 f2e6 c8 iny 5883 f2e7 94 65 sty dlend,x 5884 f2e9 5885 f2e9 - ifconst ALWAYSTERMINATE 5886 f2e9 - iny 5887 f2e9 - lda #0 5888 f2e9 - sta (dlpnt),y 5889 f2e9 endif 5890 f2e9 5891 f2e9 - ifconst ATOMICSPRITEUPDATE 5892 f2e9 - ldy temp8 5893 f2e9 - lda temp6 5894 f2e9 - sta (dlpnt),y 5895 f2e9 endif 5896 f2e9 5897 f2e9 checkcontinueplotsprite2 5898 f2e9 5899 f2e9 90 38 bcc doneSPDL ;branch if the sprite was fully in the last zone 5900 f2eb 5901 f2eb ;Create DL entry for lower part of sprite 5902 f2eb 5903 f2eb e8 inx ;Next region 5904 f2ec 5905 f2ec ifnconst NOLIMITCHECKING 5906 f2ec e0 18 cpx #WZONECOUNT 5907 f2ee 5908 f2ee 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 5909 f2f0 60 rts 5910 f2f1 continueplotsprite2 5911 f2f1 endif 5912 f2f1 5913 f2f1 bd 48 f6 lda DLPOINTL,x ;Get pointer to next DL 5914 f2f4 - ifconst DOUBLEBUFFER 5915 f2f4 - clc 5916 f2f4 - adc doublebufferdloffset 5917 f2f4 endif ; DOUBLEBUFFER 5918 f2f4 85 63 sta dlpnt 5919 f2f6 bd 30 f6 lda DLPOINTH,x 5920 f2f9 - ifconst DOUBLEBUFFER 5921 f2f9 - adc #0 5922 f2f9 endif ; DOUBLEBUFFER 5923 f2f9 85 64 sta dlpnt+1 5924 f2fb b4 65 ldy dlend,x ;Get the index to the end of this DL 5925 f2fd 5926 f2fd ifconst CHECKOVERWRITE 5927 f2fd c0 4b cpy #DLLASTOBJ 5928 f2ff d0 01 bne continueplotsprite2a 5929 f301 60 rts 5930 f302 continueplotsprite2a 5931 f302 endif 5932 f302 5933 f302 a5 42 lda temp1 ; graphic data, lo byte 5934 f304 91 63 sta (dlpnt),y 5935 f306 5936 f306 ifnconst ATOMICSPRITEUPDATE 5937 f306 c8 iny 5938 f307 a5 47 lda temp6 5939 f309 91 63 sta (dlpnt),y 5940 f30b - else 5941 f30b - iny 5942 f30b - sty temp8 5943 f30b endif 5944 f30b 5945 f30b c8 iny 5946 f30c 5947 f30c a5 46 lda temp5 ;Y position 5948 f30e 0b 07 anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 5949 f310 05 43 ora temp2 ; graphic data, hi byte 5950 f312 e9 07 sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 5951 f314 91 63 sta (dlpnt),y 5952 f316 5953 f316 c8 iny 5954 f317 5955 f317 a5 44 lda temp3 ;palette|width 5956 f319 91 63 sta (dlpnt),y 5957 f31b 5958 f31b c8 iny 5959 f31c 5960 f31c a5 45 lda temp4 ;Horizontal position 5961 f31e 91 63 sta (dlpnt),y 5962 f320 5963 f320 c8 iny 5964 f321 94 65 sty dlend,x 5965 f323 5966 f323 - ifconst ALWAYSTERMINATE 5967 f323 - iny 5968 f323 - lda #0 5969 f323 - sta (dlpnt),y 5970 f323 endif 5971 f323 5972 f323 - ifconst ATOMICSPRITEUPDATE 5973 f323 - ldy temp8 5974 f323 - lda temp6 5975 f323 - sta (dlpnt),y 5976 f323 endif 5977 f323 5978 f323 doneSPDL 5979 f323 60 rts 5980 f324 5981 f324 5982 f324 lockzonex 5983 f324 - ifconst ZONELOCKS 5984 f324 - ldy dlend,x 5985 f324 - cpy #DLLASTOBJ 5986 f324 - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 5987 f324 - lda DLPOINTL,x 5988 f324 - ifconst DOUBLEBUFFER 5989 f324 - clc 5990 f324 - adc doublebufferdloffset 5991 f324 - endif ; DOUBLEBUFFER 5992 f324 - sta dlpnt 5993 f324 - lda DLPOINTH,x 5994 f324 - ifconst DOUBLEBUFFER 5995 f324 - adc #0 5996 f324 - endif ; DOUBLEBUFFER 5997 f324 - sta dlpnt+1 5998 f324 - iny 5999 f324 - lda #0 6000 f324 - sta (dlpnt),y 6001 f324 - dey 6002 f324 - tya 6003 f324 - ldy #(DLLASTOBJ-1) 6004 f324 - sta (dlpnt),y 6005 f324 - iny 6006 f324 - sty dlend,x 6007 f324 -lockzonexreturn 6008 f324 - rts 6009 f324 endif ; ZONELOCKS 6010 f324 unlockzonex 6011 f324 - ifconst ZONELOCKS 6012 f324 - ldy dlend,x 6013 f324 - cpy #DLLASTOBJ 6014 f324 - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 6015 f324 - lda DLPOINTL,x 6016 f324 - ifconst DOUBLEBUFFER 6017 f324 - clc 6018 f324 - adc doublebufferdloffset 6019 f324 - endif ; DOUBLEBUFFER 6020 f324 - sta dlpnt 6021 f324 - lda DLPOINTH,x 6022 f324 - ifconst DOUBLEBUFFER 6023 f324 - adc #0 6024 f324 - endif ; DOUBLEBUFFER 6025 f324 - sta dlpnt+1 6026 f324 - dey 6027 f324 - ;ldy #(DLLASTOBJ-1) 6028 f324 - lda (dlpnt),y 6029 f324 - tay 6030 f324 - sty dlend,x 6031 f324 -unlockzonexreturn 6032 f324 endif ; ZONELOCKS 6033 f324 60 rts 6034 f325 6035 f325 plotcharloop 6036 f325 ; ** read from a data indirectly pointed to from temp8,temp9 6037 f325 ; ** format is: lo_data, hi_data, palette|width, x, y 6038 f325 ; ** format ends with lo_data | hi_data = 0 6039 f325 6040 f325 - ifconst DOUBLEBUFFER 6041 f325 - lda doublebufferstate 6042 f325 - bne skipplotcharloopwait 6043 f325 endif ; DOUBLEBUFFER 6044 f325 - ifconst DEBUGWAITCOLOR 6045 f325 - lda #$61 6046 f325 - sta BACKGRND 6047 f325 endif 6048 f325 plotcharloopwait 6049 f325 a5 4d lda visibleover 6050 f327 d0 fc bne plotcharloopwait 6051 f329 - ifconst DEBUGWAITCOLOR 6052 f329 - lda #0 6053 f329 - sta BACKGRND 6054 f329 endif 6055 f329 skipplotcharloopwait 6056 f329 plotcharlooploop 6057 f329 a0 00 ldy #0 6058 f32b b1 49 lda (temp8),y 6059 f32d 85 42 sta temp1 6060 f32f c8 iny 6061 f330 b1 49 lda (temp8),y 6062 f332 85 43 sta temp2 6063 f334 05 42 ora temp1 6064 f336 d0 01 bne plotcharloopcontinue 6065 f338 ;the pointer=0, so return 6066 f338 60 rts 6067 f339 plotcharloopcontinue 6068 f339 c8 iny 6069 f33a b1 49 lda (temp8),y 6070 f33c 85 44 sta temp3 6071 f33e c8 iny 6072 f33f b1 49 lda (temp8),y 6073 f341 85 45 sta temp4 6074 f343 c8 iny 6075 f344 b1 49 lda (temp8),y 6076 f346 ;sta temp5 ; not needed with our late entry. 6077 f346 20 5f f3 jsr plotcharactersskipentry 6078 f349 a5 49 lda temp8 6079 f34b 18 clc 6080 f34c 69 05 adc #5 6081 f34e 85 49 sta temp8 6082 f350 a5 4a lda temp9 6083 f352 69 00 adc #0 6084 f354 85 4a sta temp9 6085 f356 4c 29 f3 jmp plotcharlooploop 6086 f359 6087 f359 plotcharacters 6088 f359 - ifconst DOUBLEBUFFER 6089 f359 - lda doublebufferstate 6090 f359 - bne skipplotcharacterswait 6091 f359 endif ; DOUBLEBUFFER 6092 f359 - ifconst DEBUGWAITCOLOR 6093 f359 - lda #$41 6094 f359 - sta BACKGRND 6095 f359 endif 6096 f359 plotcharacterswait 6097 f359 a5 4d lda visibleover 6098 f35b d0 fc bne plotcharacterswait 6099 f35d - ifconst DEBUGWAITCOLOR 6100 f35d - sta BACKGRND 6101 f35d endif 6102 f35d skipplotcharacterswait 6103 f35d ;arguments: 6104 f35d ; temp1=lo charactermap 6105 f35d ; temp2=hi charactermap 6106 f35d ; temp3=palette | width byte 6107 f35d ; temp4=x 6108 f35d ; temp5=y 6109 f35d 6110 f35d a5 46 lda temp5 ;Y position 6111 f35f 6112 f35f plotcharactersskipentry 6113 f35f 6114 f35f ;ifconst ZONEHEIGHT 6115 f35f ; if ZONEHEIGHT = 16 6116 f35f ; and #$0F 6117 f35f ; endif 6118 f35f ; if ZONEHEIGHT = 8 6119 f35f ; and #$1F 6120 f35f ; endif 6121 f35f ;else 6122 f35f ; and #$0F 6123 f35f ;endif 6124 f35f 6125 f35f aa tax 6126 f360 bd 48 f6 lda DLPOINTL,x ;Get pointer to DL that the characters are in 6127 f363 - ifconst DOUBLEBUFFER 6128 f363 - clc 6129 f363 - adc doublebufferdloffset 6130 f363 endif ; DOUBLEBUFFER 6131 f363 85 63 sta dlpnt 6132 f365 bd 30 f6 lda DLPOINTH,x 6133 f368 - ifconst DOUBLEBUFFER 6134 f368 - adc #0 6135 f368 endif ; DOUBLEBUFFER 6136 f368 85 64 sta dlpnt+1 6137 f36a 6138 f36a ;Create DL entry for the characters 6139 f36a 6140 f36a b4 65 ldy dlend,x ;Get the index to the end of this DL 6141 f36c 6142 f36c ifconst CHECKOVERWRITE 6143 f36c c0 4b cpy #DLLASTOBJ 6144 f36e d0 01 bne continueplotcharacters 6145 f370 60 rts 6146 f371 continueplotcharacters 6147 f371 endif 6148 f371 6149 f371 a5 42 lda temp1 ; character map data, lo byte 6150 f373 91 63 sta (dlpnt),y ;(1) store low address 6151 f375 6152 f375 c8 iny 6153 f376 ad 06 21 lda charactermode 6154 f379 91 63 sta (dlpnt),y ;(2) store mode 6155 f37b 6156 f37b c8 iny 6157 f37c a5 43 lda temp2 ; character map, hi byte 6158 f37e 91 63 sta (dlpnt),y ;(3) store high address 6159 f380 6160 f380 c8 iny 6161 f381 a5 44 lda temp3 ;palette|width 6162 f383 91 63 sta (dlpnt),y ;(4) store palette|width 6163 f385 6164 f385 c8 iny 6165 f386 a5 45 lda temp4 ;Horizontal position 6166 f388 91 63 sta (dlpnt),y ;(5) store horizontal position 6167 f38a 6168 f38a c8 iny 6169 f38b 94 65 sty dlend,x ; save display list end byte 6170 f38d 60 rts 6171 f38e 6172 f38e 6173 f38e - ifconst plotvalueonscreen 6174 f38e -plotcharacterslive 6175 f38e - ; a version of plotcharacters that draws live and minimally disrupts the screen... 6176 f38e - 6177 f38e - ;arguments: 6178 f38e - ; temp1=lo charactermap 6179 f38e - ; temp2=hi charactermap 6180 f38e - ; temp3=palette | width byte 6181 f38e - ; temp4=x 6182 f38e - ; temp5=y 6183 f38e - 6184 f38e - lda temp5 ;Y position 6185 f38e - 6186 f38e - tax 6187 f38e - lda DLPOINTL,x ;Get pointer to DL that the characters are in 6188 f38e - ifconst DOUBLEBUFFER 6189 f38e - clc 6190 f38e - adc doublebufferdloffset 6191 f38e - endif ; DOUBLEBUFFER 6192 f38e - sta dlpnt 6193 f38e - lda DLPOINTH,x 6194 f38e - ifconst DOUBLEBUFFER 6195 f38e - adc #0 6196 f38e - endif ; DOUBLEBUFFER 6197 f38e - sta dlpnt+1 6198 f38e - 6199 f38e - ;Create DL entry for the characters 6200 f38e - 6201 f38e - ldy dlend,x ;Get the index to the end of this DL 6202 f38e - 6203 f38e - ifconst CHECKOVERWRITE 6204 f38e - cpy #DLLASTOBJ 6205 f38e - bne continueplotcharacterslive 6206 f38e - rts 6207 f38e -continueplotcharacterslive 6208 f38e - endif 6209 f38e - 6210 f38e - lda temp1 ; character map data, lo byte 6211 f38e - sta (dlpnt),y ;(1) store low address 6212 f38e - 6213 f38e - iny 6214 f38e - ; we don't add the second byte yet, since the charmap could briefly 6215 f38e - ; render without a proper character map address, width, or position. 6216 f38e - lda charactermode 6217 f38e - sta (dlpnt),y ;(2) store mode 6218 f38e - 6219 f38e - iny 6220 f38e - lda temp2 ; character map, hi byte 6221 f38e - sta (dlpnt),y ;(3) store high address 6222 f38e - 6223 f38e - iny 6224 f38e - lda temp3 ;palette|width 6225 f38e - sta (dlpnt),y ;(4) store palette|width 6226 f38e - 6227 f38e - iny 6228 f38e - lda temp4 ;Horizontal position 6229 f38e - sta (dlpnt),y ;(5) store horizontal position 6230 f38e - 6231 f38e - iny 6232 f38e - sty dlend,x ; save display list end byte 6233 f38e - 6234 f38e - rts 6235 f38e endif ;plotcharacterslive 6236 f38e 6237 f38e ifconst USED_PLOTVALUE 6238 f38e plotvalue 6239 f38e ; calling 7800basic command: 6240 f38e ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6241 f38e ; ...displays the variable as BCD digits 6242 f38e ; 6243 f38e ; asm sub arguments: 6244 f38e ; temp1=lo charactermap 6245 f38e ; temp2=hi charactermap 6246 f38e ; temp3=palette | width byte 6247 f38e ; temp4=x 6248 f38e ; temp5=y 6249 f38e ; temp6=number of digits 6250 f38e ; temp7=lo variable 6251 f38e ; temp8=hi variable 6252 f38e ; temp9=character mode 6253 f38e 6254 f38e 00 47 plotdigitcount = temp6 6255 f38e 6256 f38e - ifconst ZONELOCKS 6257 f38e - ldx temp5 6258 f38e - ldy dlend,x 6259 f38e - cpy #DLLASTOBJ 6260 f38e - bne carryonplotvalue 6261 f38e - rts 6262 f38e -carryonplotvalue 6263 f38e endif 6264 f38e 6265 f38e a9 00 lda #0 6266 f390 a8 tay 6267 f391 ae ad 01 ldx valbufend 6268 f394 6269 f394 a5 47 lda plotdigitcount 6270 f396 29 01 and #1 6271 f398 f0 07 beq pvnibble2char 6272 f39a a9 00 lda #0 6273 f39c 9d 00 20 sta VALBUFFER,x ; just in case we skip this digit 6274 f39f f0 11 beq pvnibble2char_skipnibble 6275 f3a1 6276 f3a1 pvnibble2char 6277 f3a1 ; high nibble... 6278 f3a1 b1 48 lda (temp7),y 6279 f3a3 29 f0 and #$f0 6280 f3a5 4a lsr 6281 f3a6 4a lsr 6282 f3a7 4a lsr 6283 f3a8 ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6284 f3a8 4a lsr 6285 f3a9 endif 6286 f3a9 6287 f3a9 18 clc 6288 f3aa 65 42 adc temp1 ; add the offset to character graphics to our value 6289 f3ac 9d 00 20 sta VALBUFFER,x 6290 f3af e8 inx 6291 f3b0 c6 47 dec plotdigitcount 6292 f3b2 6293 f3b2 pvnibble2char_skipnibble 6294 f3b2 ; low nibble... 6295 f3b2 b1 48 lda (temp7),y 6296 f3b4 29 0f and #$0f 6297 f3b6 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6298 f3b6 - asl 6299 f3b6 endif 6300 f3b6 18 clc 6301 f3b7 65 42 adc temp1 ; add the offset to character graphics to our value 6302 f3b9 9d 00 20 sta VALBUFFER,x 6303 f3bc e8 inx 6304 f3bd c8 iny 6305 f3be 6306 f3be c6 47 dec plotdigitcount 6307 f3c0 d0 df bne pvnibble2char 6308 f3c2 6309 f3c2 ;point to the start of our valuebuffer 6310 f3c2 18 clc 6311 f3c3 a9 00 lda #VALBUFFER 6315 f3cc 69 00 adc #0 6316 f3ce 85 43 sta temp2 6317 f3d0 6318 f3d0 ;advance valbufend to the end of our value buffer 6319 f3d0 8e ad 01 stx valbufend 6320 f3d3 6321 f3d3 ifnconst plotvalueonscreen 6322 f3d3 4c 59 f3 jmp plotcharacters 6323 f3d6 - else 6324 f3d6 - jmp plotcharacterslive 6325 f3d6 endif 6326 f3d6 6327 f3d6 endif ; USED_PLOTVALUE 6328 f3d6 6329 f3d6 6330 f3d6 - ifconst USED_PLOTVALUEEXTRA 6331 f3d6 -plotdigitcount = temp6 6332 f3d6 -plotvalueextra 6333 f3d6 - ; calling 7800basic command: 6334 f3d6 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6335 f3d6 - ; ...displays the variable as BCD digits 6336 f3d6 - ; 6337 f3d6 - ; asm sub arguments: 6338 f3d6 - ; temp1=lo charactermap 6339 f3d6 - ; temp2=hi charactermap 6340 f3d6 - ; temp3=palette | width byte 6341 f3d6 - ; temp4=x 6342 f3d6 - ; temp5=y 6343 f3d6 - ; temp6=number of digits 6344 f3d6 - ; temp7=lo variable 6345 f3d6 - ; temp8=hi variable 6346 f3d6 - 6347 f3d6 - lda #0 6348 f3d6 - tay 6349 f3d6 - ldx valbufend 6350 f3d6 - ifnconst plotvalueonscreen 6351 f3d6 - sta VALBUFFER,x 6352 f3d6 - endif 6353 f3d6 - 6354 f3d6 - lda plotdigitcount 6355 f3d6 - and #1 6356 f3d6 - 6357 f3d6 - bne pvnibble2char_skipnibbleextra 6358 f3d6 - 6359 f3d6 -pvnibble2charextra 6360 f3d6 - ; high nibble... 6361 f3d6 - lda (temp7),y 6362 f3d6 - and #$f0 6363 f3d6 - lsr 6364 f3d6 - lsr 6365 f3d6 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6366 f3d6 - lsr 6367 f3d6 - endif 6368 f3d6 - clc 6369 f3d6 - adc temp1 ; add the offset to character graphics to our value 6370 f3d6 - sta VALBUFFER,x 6371 f3d6 - inx 6372 f3d6 - 6373 f3d6 - ; second half of the digit 6374 f3d6 - clc 6375 f3d6 - adc #1 6376 f3d6 - sta VALBUFFER,x 6377 f3d6 - inx 6378 f3d6 - 6379 f3d6 -pvnibble2char_skipnibbleextra 6380 f3d6 - ; low nibble... 6381 f3d6 - lda (temp7),y 6382 f3d6 - and #$0f 6383 f3d6 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6384 f3d6 - asl 6385 f3d6 - endif 6386 f3d6 - asl 6387 f3d6 - 6388 f3d6 - clc 6389 f3d6 - adc temp1 ; add the offset to character graphics to our value 6390 f3d6 - sta VALBUFFER,x 6391 f3d6 - inx 6392 f3d6 - 6393 f3d6 - clc 6394 f3d6 - adc #1 6395 f3d6 - sta VALBUFFER,x 6396 f3d6 - inx 6397 f3d6 - iny 6398 f3d6 - 6399 f3d6 - dec plotdigitcount 6400 f3d6 - bne pvnibble2charextra 6401 f3d6 - 6402 f3d6 - ;point to the start of our valuebuffer 6403 f3d6 - clc 6404 f3d6 - lda #VALBUFFER 6408 f3d6 - adc #0 6409 f3d6 - sta temp2 6410 f3d6 - 6411 f3d6 - ;advance valbufend to the end of our value buffer 6412 f3d6 - stx valbufend 6413 f3d6 - 6414 f3d6 - ifnconst plotvalueonscreen 6415 f3d6 - jmp plotcharacters 6416 f3d6 - else 6417 f3d6 - jmp plotcharacterslive 6418 f3d6 - endif 6419 f3d6 endif ; USED_PLOTVALUEEXTRA 6420 f3d6 6421 f3d6 boxcollision 6422 f3d6 ; the worst case cycle-time for the code below is 43 cycles. 6423 f3d6 ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 6424 f3d6 6425 f3d6 ;__boxx1 = accumulator 6426 f3d6 ;__boxy1 = y 6427 f3d6 00 44 __boxw1 = temp3 6428 f3d6 00 45 __boxh1 = temp4 6429 f3d6 6430 f3d6 00 46 __boxx2 = temp5 6431 f3d6 00 47 __boxy2 = temp6 6432 f3d6 00 48 __boxw2 = temp7 6433 f3d6 00 49 __boxh2 = temp8 6434 f3d6 6435 f3d6 DoXCollisionCheck 6436 f3d6 ;lda __boxx1 ; skipped. already in the accumulator 6437 f3d6 c5 46 cmp __boxx2 ;3 6438 f3d8 b0 07 bcs X1isbiggerthanX2 ;2/3 6439 f3da X2isbiggerthanX1 6440 f3da ; carry is clear 6441 f3da 65 44 adc __boxw1 ;3 6442 f3dc c5 46 cmp __boxx2 ;3 6443 f3de b0 08 bcs DoYCollisionCheck ;3/2 6444 f3e0 60 rts ;6 - carry clear, no collision 6445 f3e1 X1isbiggerthanX2 6446 f3e1 18 clc ;2 6447 f3e2 e5 48 sbc __boxw2 ;3 6448 f3e4 c5 46 cmp __boxx2 ;3 6449 f3e6 b0 13 bcs noboxcollision ;3/2 6450 f3e8 DoYCollisionCheck 6451 f3e8 98 tya ; 2 ; use to be "lda __boxy1" 6452 f3e9 c5 47 cmp __boxy2 ;3 6453 f3eb b0 05 bcs Y1isbiggerthanY2 ;3/2 6454 f3ed Y2isbiggerthanY1 6455 f3ed ; carry is clear 6456 f3ed 65 45 adc __boxh1 ;3 6457 f3ef c5 47 cmp __boxy2 ;3 6458 f3f1 60 rts ;6 6459 f3f2 Y1isbiggerthanY2 6460 f3f2 18 clc ;2 6461 f3f3 e5 49 sbc __boxh2 ;3 6462 f3f5 c5 47 cmp __boxy2 ;3 6463 f3f7 b0 02 bcs noboxcollision ;3/2 6464 f3f9 yesboxcollision 6465 f3f9 38 sec ;2 6466 f3fa 60 rts ;6 6467 f3fb noboxcollision 6468 f3fb 18 clc ;2 6469 f3fc 60 rts ;6 6470 f3fd 6471 f3fd randomize 6472 f3fd a5 40 lda rand 6473 f3ff 4a lsr 6474 f400 26 41 rol rand16 6475 f402 90 02 bcc noeor 6476 f404 49 b4 eor #$B4 6477 f406 noeor 6478 f406 85 40 sta rand 6479 f408 45 41 eor rand16 6480 f40a 60 rts 6481 f40b 6482 f40b ; *** bcd conversion routine courtesy Omegamatrix 6483 f40b ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 6484 f40b converttobcd 6485 f40b ;value to convert is in the accumulator 6486 f40b 85 42 sta temp1 6487 f40d 4a lsr 6488 f40e 65 42 adc temp1 6489 f410 6a ror 6490 f411 4a lsr 6491 f412 4a lsr 6492 f413 65 42 adc temp1 6493 f415 6a ror 6494 f416 65 42 adc temp1 6495 f418 6a ror 6496 f419 4a lsr 6497 f41a 29 3c and #$3C 6498 f41c 85 43 sta temp2 6499 f41e 4a lsr 6500 f41f 65 43 adc temp2 6501 f421 65 42 adc temp1 6502 f423 60 rts ; return the result in the accumulator 6503 f424 6504 f424 ; Y and A contain multiplicands, result in A 6505 f424 mul8 6506 f424 84 42 sty temp1 6507 f426 85 43 sta temp2 6508 f428 a9 00 lda #0 6509 f42a reptmul8 6510 f42a 46 43 lsr temp2 6511 f42c 90 03 bcc skipmul8 6512 f42e 18 clc 6513 f42f 65 42 adc temp1 6514 f431 ;bcs donemul8 might save cycles? 6515 f431 skipmul8 6516 f431 ;beq donemul8 might save cycles? 6517 f431 06 42 asl temp1 6518 f433 d0 f5 bne reptmul8 6519 f435 donemul8 6520 f435 60 rts 6521 f436 6522 f436 div8 6523 f436 ; A=numerator Y=denominator, result in A 6524 f436 c0 02 cpy #2 6525 f438 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 6526 f43a 84 42 sty temp1 6527 f43c a0 ff ldy #$ff 6528 f43e div8loop 6529 f43e e5 42 sbc temp1 6530 f440 c8 iny 6531 f441 b0 fb bcs div8loop 6532 f443 div8end 6533 f443 98 tya 6534 f444 ; result in A 6535 f444 60 rts 6536 f445 6537 f445 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 6538 f445 mul16 6539 f445 84 42 sty temp1 6540 f447 85 43 sta temp2 6541 f449 6542 f449 a9 00 lda #0 6543 f44b a2 08 ldx #8 6544 f44d 46 42 lsr temp1 6545 f44f mul16_1 6546 f44f 90 03 bcc mul16_2 6547 f451 18 clc 6548 f452 65 43 adc temp2 6549 f454 mul16_2 6550 f454 6a ror 6551 f455 66 42 ror temp1 6552 f457 ca dex 6553 f458 d0 f5 bne mul16_1 6554 f45a 85 43 sta temp2 6555 f45c 60 rts 6556 f45d 6557 f45d ; div int/int 6558 f45d ; numerator in A, denom in temp1 6559 f45d ; returns with quotient in A, remainder in temp1 6560 f45d div16 6561 f45d 85 43 sta temp2 6562 f45f 84 42 sty temp1 6563 f461 a9 00 lda #0 6564 f463 a2 08 ldx #8 6565 f465 06 43 asl temp2 6566 f467 div16_1 6567 f467 2a rol 6568 f468 c5 42 cmp temp1 6569 f46a 90 02 bcc div16_2 6570 f46c e5 42 sbc temp1 6571 f46e div16_2 6572 f46e 26 43 rol temp2 6573 f470 ca dex 6574 f471 d0 f4 bne div16_1 6575 f473 85 42 sta temp1 6576 f475 a5 43 lda temp2 6577 f477 60 rts 6578 f478 6579 f478 - ifconst bankswitchmode 6580 f478 -BS_jsr 6581 f478 - ifconst MCPDEVCART 6582 f478 - ora #$18 6583 f478 - sta $3000 6584 f478 - else 6585 f478 - sta $8000 6586 f478 - endif 6587 f478 - pla 6588 f478 - tax 6589 f478 - pla 6590 f478 - rts 6591 f478 - 6592 f478 -BS_return 6593 f478 - pla ; bankswitch bank 6594 f478 - ifconst BANKRAM 6595 f478 - sta currentbank 6596 f478 - ora currentrambank 6597 f478 - endif 6598 f478 - ifconst MCPDEVCART 6599 f478 - ora #$18 6600 f478 - sta $3000 6601 f478 - else 6602 f478 - sta $8000 6603 f478 - endif 6604 f478 - pla ; bankswitch $0 flag 6605 f478 - rts 6606 f478 endif 6607 f478 6608 f478 checkselectswitch 6609 f478 ad 82 02 lda SWCHB ; first check the real select switch... 6610 f47b 29 02 and #%00000010 6611 f47d ifnconst MOUSESUPPORT 6612 f47d f0 05 beq checkselectswitchreturn ; switch is pressed 6613 f47f ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 6614 f482 29 b0 and #%10110000 ; R_DU 6615 f484 endif ; MOUSESUPPORT 6616 f484 checkselectswitchreturn 6617 f484 60 rts 6618 f485 6619 f485 checkresetswitch 6620 f485 ad 82 02 lda SWCHB ; first check the real reset switch... 6621 f488 29 01 and #%00000001 6622 f48a ifnconst MOUSESUPPORT 6623 f48a f0 05 beq checkresetswitchreturn ; switch is pressed 6624 f48c ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 6625 f48f 29 70 and #%01110000 ; _LDU 6626 f491 endif ; MOUSESUPPORT 6627 f491 checkresetswitchreturn 6628 f491 60 rts 6629 f492 6630 f492 - ifconst FINESCROLLENABLED 6631 f492 -finescrolldlls 6632 f492 - ldx temp1 ; first DLL index x3 6633 f492 - lda DLLMEM,x 6634 f492 - and #%11110000 6635 f492 - ora finescrolly 6636 f492 - sta DLLMEM,x 6637 f492 - 6638 f492 - ldx temp2 ; last DLL index x3 6639 f492 - lda DLLMEM,x 6640 f492 - and #%11110000 6641 f492 - ora finescrolly 6642 f492 - eor #(WZONEHEIGHT-1) 6643 f492 - sta DLLMEM,x 6644 f492 - rts 6645 f492 endif ; FINESCROLLENABLED 6646 f492 6647 f492 - ifconst USED_ADJUSTVISIBLE 6648 f492 -adjustvisible 6649 f492 - ; called with temp1=first visible zone *3, temp2=last visible zone *3 6650 f492 - jsr waitforvblankstart ; ensure vblank just started 6651 f492 - ldx visibleDLLstart 6652 f492 -findfirstinterrupt 6653 f492 - lda DLLMEM,x 6654 f492 - bmi foundfirstinterrupt 6655 f492 - inx 6656 f492 - inx 6657 f492 - inx 6658 f492 - bne findfirstinterrupt 6659 f492 -foundfirstinterrupt 6660 f492 - and #%01111111 ; clear the interrupt bit 6661 f492 - sta DLLMEM,x 6662 f492 - ifconst DOUBLEBUFFER 6663 f492 - sta DLLMEM+DBOFFSET,x 6664 f492 - endif ; DOUBLEBUFFER 6665 f492 - ldx overscanDLLstart 6666 f492 -findlastinterrupt 6667 f492 - lda DLLMEM,x 6668 f492 - bmi foundlastinterrupt 6669 f492 - dex 6670 f492 - dex 6671 f492 - dex 6672 f492 - bne findlastinterrupt 6673 f492 -foundlastinterrupt 6674 f492 - and #%01111111 ; clear the interrupt bit 6675 f492 - sta DLLMEM,x 6676 f492 - ifconst DOUBLEBUFFER 6677 f492 - sta DLLMEM+DBOFFSET,x 6678 f492 - endif ; DOUBLEBUFFER 6679 f492 - ;now we need to set the new interrupts 6680 f492 - clc 6681 f492 - lda temp1 6682 f492 - adc visibleDLLstart 6683 f492 - tax 6684 f492 - lda DLLMEM,x 6685 f492 - ora #%10000000 6686 f492 - sta DLLMEM,x 6687 f492 - ifconst DOUBLEBUFFER 6688 f492 - sta DLLMEM+DBOFFSET,x 6689 f492 - endif ; DOUBLEBUFFER 6690 f492 - clc 6691 f492 - lda temp2 6692 f492 - adc visibleDLLstart 6693 f492 - tax 6694 f492 - lda DLLMEM,x 6695 f492 - ora #%10000000 6696 f492 - sta DLLMEM,x 6697 f492 - ifconst DOUBLEBUFFER 6698 f492 - sta DLLMEM+DBOFFSET,x 6699 f492 - endif ; DOUBLEBUFFER 6700 f492 - jsr vblankresync 6701 f492 - rts 6702 f492 endif ; USED_ADJUSTVISIBLE 6703 f492 6704 f492 vblankresync 6705 f492 20 30 f5 jsr waitforvblankstart ; ensure vblank just started 6706 f495 a9 00 lda #0 6707 f497 85 4d sta visibleover 6708 f499 a9 03 lda #3 6709 f49b 8d b2 01 sta interruptindex 6710 f49e 60 rts 6711 f49f 6712 f49f createallgamedlls 6713 f49f a2 00 ldx #0 6714 f4a1 a9 19 lda #NVLINES 6715 f4a3 ac 09 21 ldy paldetected 6716 f4a6 f0 03 beq skipcreatePALpadding 6717 f4a8 18 clc 6718 f4a9 69 15 adc #21 6719 f4ab skipcreatePALpadding 6720 f4ab 20 e0 f4 jsr createnonvisibledlls 6721 f4ae 8e 3c 21 stx visibleDLLstart 6722 f4b1 20 11 f5 jsr createvisiblezones 6723 f4b4 8e 3d 21 stx overscanDLLstart 6724 f4b7 createallgamedllscontinue 6725 f4b7 a9 50 lda #(NVLINES+55) ; extras for PAL 6726 f4b9 20 e0 f4 jsr createnonvisibledlls 6727 f4bc 6728 f4bc ae 3c 21 ldx visibleDLLstart 6729 f4bf bd 00 18 lda DLLMEM,x 6730 f4c2 09 80 ora #%10000000 ; NMI 1 - start of visible screen 6731 f4c4 9d 00 18 sta DLLMEM,x 6732 f4c7 - ifconst DOUBLEBUFFER 6733 f4c7 - sta DLLMEM+DBOFFSET,x 6734 f4c7 endif ; DOUBLEBUFFER 6735 f4c7 6736 f4c7 ae 3d 21 ldx overscanDLLstart 6737 f4ca bd 00 18 lda DLLMEM,x 6738 f4cd 09 83 ora #%10000011 ; NMI 2 - end of visible screen 6739 f4cf 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 6740 f4d1 9d 00 18 sta DLLMEM,x 6741 f4d4 - ifconst DOUBLEBUFFER 6742 f4d4 - sta DLLMEM+DBOFFSET,x 6743 f4d4 endif ; DOUBLEBUFFER 6744 f4d4 6745 f4d4 e8 inx 6746 f4d5 e8 inx 6747 f4d6 e8 inx 6748 f4d7 6749 f4d7 bd 00 18 lda DLLMEM,x 6750 f4da 09 80 ora #%10000000 ; NMI 3 - deeper overscan 6751 f4dc 9d 00 18 sta DLLMEM,x 6752 f4df - ifconst DOUBLEBUFFER 6753 f4df - sta DLLMEM+DBOFFSET,x 6754 f4df endif ; DOUBLEBUFFER 6755 f4df 6756 f4df 60 rts 6757 f4e0 6758 f4e0 createnonvisibledlls 6759 f4e0 85 42 sta temp1 6760 f4e2 4a lsr 6761 f4e3 4a lsr 6762 f4e4 4a lsr 6763 f4e5 4a lsr ; /16 6764 f4e6 f0 09 beq skipcreatenonvisibledlls1loop 6765 f4e8 a8 tay 6766 f4e9 createnonvisibledlls1loop 6767 f4e9 a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 6768 f4eb 20 00 f5 jsr createblankdllentry 6769 f4ee 88 dey 6770 f4ef d0 f8 bne createnonvisibledlls1loop 6771 f4f1 skipcreatenonvisibledlls1loop 6772 f4f1 a5 42 lda temp1 6773 f4f3 29 0f and #%00001111 6774 f4f5 f0 08 beq createnonvisibledllsreturn 6775 f4f7 38 sec 6776 f4f8 e9 01 sbc #1 6777 f4fa 09 40 ora #%01000000 6778 f4fc 20 00 f5 jsr createblankdllentry 6779 f4ff createnonvisibledllsreturn 6780 f4ff 60 rts 6781 f500 6782 f500 createblankdllentry 6783 f500 9d 00 18 sta DLLMEM,x 6784 f503 - ifconst DOUBLEBUFFER 6785 f503 - sta DLLMEM+DBOFFSET,x 6786 f503 endif ; DOUBLEBUFFER 6787 f503 e8 inx 6788 f504 a9 21 lda #$21 ; blank 6789 f506 9d 00 18 sta DLLMEM,x 6790 f509 - ifconst DOUBLEBUFFER 6791 f509 - sta DLLMEM+DBOFFSET,x 6792 f509 endif ; DOUBLEBUFFER 6793 f509 e8 inx 6794 f50a a9 00 lda #$00 6795 f50c 9d 00 18 sta DLLMEM,x 6796 f50f - ifconst DOUBLEBUFFER 6797 f50f - sta DLLMEM+DBOFFSET,x 6798 f50f endif ; DOUBLEBUFFER 6799 f50f e8 inx 6800 f510 60 rts 6801 f511 6802 f511 createvisiblezones 6803 f511 a0 00 ldy #0 6804 f513 createvisiblezonesloop 6805 f513 b9 60 f6 lda.w DLHEIGHT,y 6806 f516 09 20 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 6807 f518 9d 00 18 sta DLLMEM,x 6808 f51b - ifconst DOUBLEBUFFER 6809 f51b - sta DLLMEM+DBOFFSET,x 6810 f51b endif ; DOUBLEBUFFER 6811 f51b e8 inx 6812 f51c b9 30 f6 lda DLPOINTH,y 6813 f51f 9d 00 18 sta DLLMEM,x 6814 f522 - ifconst DOUBLEBUFFER 6815 f522 - sta DLLMEM+DBOFFSET,x 6816 f522 endif ; DOUBLEBUFFER 6817 f522 e8 inx 6818 f523 b9 48 f6 lda DLPOINTL,y 6819 f526 9d 00 18 sta DLLMEM,x 6820 f529 - ifconst DOUBLEBUFFER 6821 f529 - clc 6822 f529 - adc #DOUBLEBUFFEROFFSET 6823 f529 - sta DLLMEM+DBOFFSET,x 6824 f529 - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 6825 f529 - inc DLLMEM+DBOFFSET-1,x 6826 f529 -skiphidoublebufferadjust 6827 f529 endif ; DOUBLEBUFFER 6828 f529 e8 inx 6829 f52a c8 iny 6830 f52b c0 18 cpy #WZONECOUNT 6831 f52d d0 e4 bne createvisiblezonesloop 6832 f52f 60 rts 6833 f530 6834 f530 waitforvblankstart 6835 f530 visibleoverwait 6836 f530 24 28 BIT MSTAT 6837 f532 10 fc bpl visibleoverwait 6838 f534 vblankstartwait 6839 f534 24 28 BIT MSTAT 6840 f536 30 fc bmi vblankstartwait 6841 f538 60 rts 6842 f539 6843 f539 - ifconst DOUBLEBUFFER 6844 f539 -flipdisplaybufferreturn 6845 f539 - rts 6846 f539 -flipdisplaybuffer 6847 f539 - lda doublebufferstate 6848 f539 - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 6849 f539 - 6850 f539 - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 6851 f539 - 6852 f539 - lda doublebufferstate 6853 f539 - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 6854 f539 - tax 6855 f539 - 6856 f539 - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 6857 f539 - 6858 f539 -flipdisplaybufferwait1 6859 f539 - lda visibleover 6860 f539 - beq flipdisplaybufferwait1 6861 f539 - 6862 f539 -flipdisplaybufferwait 6863 f539 - lda visibleover 6864 f539 - bne flipdisplaybufferwait 6865 f539 - 6866 f539 - lda doublebufferminimumframetarget 6867 f539 - beq skipminimumframecode 6868 f539 - lda doublebufferminimumframeindex 6869 f539 - bne flipdisplaybufferwait1 6870 f539 - lda doublebufferminimumframetarget 6871 f539 - sta doublebufferminimumframeindex 6872 f539 -skipminimumframecode 6873 f539 - 6874 f539 - lda DLLMEMLutHi,x 6875 f539 - sta DPPH 6876 f539 - lda DLLMEMLutLo,x 6877 f539 - sta DPPL 6878 f539 - 6879 f539 - lda NewPageflipstate,x 6880 f539 - sta doublebufferstate 6881 f539 - lda NewPageflipoffset,x 6882 f539 - sta doublebufferdloffset 6883 f539 - 6884 f539 - lda doublebufferbufferdirty 6885 f539 - beq flipdisplaybufferreturn 6886 f539 - 6887 f539 - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 6888 f539 - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 6889 f539 - ; from the displayed buffer to the working buffer... 6890 f539 - 6891 f539 - lda doublebufferdloffset 6892 f539 - eor #DOUBLEBUFFEROFFSET 6893 f539 - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 6894 f539 - 6895 f539 - ldx #(WZONECOUNT-1) 6896 f539 -copybufferzoneloop 6897 f539 - 6898 f539 - lda DLPOINTL,x 6899 f539 - clc 6900 f539 - adc doublebufferdloffset 6901 f539 - sta temp1 6902 f539 - lda DLPOINTH,x 6903 f539 - adc #0 6904 f539 - sta temp2 6905 f539 - 6906 f539 - lda DLPOINTL,x 6907 f539 - clc 6908 f539 - adc temp6 6909 f539 - sta temp3 6910 f539 - lda DLPOINTH,x 6911 f539 - adc #0 6912 f539 - sta temp4 6913 f539 - 6914 f539 - lda dlendsave,x 6915 f539 - tay 6916 f539 -copybuffercharsloop 6917 f539 - lda (temp3),y 6918 f539 - sta (temp1),y 6919 f539 - dey 6920 f539 - bpl copybuffercharsloop 6921 f539 - dex 6922 f539 - bpl copybufferzoneloop 6923 f539 - lda #0 6924 f539 - sta doublebufferbufferdirty 6925 f539 - rts 6926 f539 - 6927 f539 -doublebufferoff 6928 f539 - lda #1 6929 f539 - sta doublebufferstate 6930 f539 - jsr flipdisplaybuffer 6931 f539 - lda #0 6932 f539 - sta doublebufferstate 6933 f539 - sta doublebufferdloffset 6934 f539 - rts 6935 f539 - 6936 f539 -DLLMEMLutLo 6937 f539 - .byte DLLMEM,>(DLLMEM+DBOFFSET) 6940 f539 -NewPageflipstate 6941 f539 - .byte 3,1 6942 f539 -NewPageflipoffset 6943 f539 - .byte DOUBLEBUFFEROFFSET,0 6944 f539 - 6945 f539 endif ; DOUBLEBUFFER 6946 f539 6947 f539 - ifconst MOUSESUPPORT 6948 f539 - 6949 f539 -rotationalcompare 6950 f539 - ; old = 00 01 10 11 6951 f539 - .byte $00, $01, $ff, $00 ; new=00 6952 f539 - .byte $ff, $00, $00, $01 ; new=01 6953 f539 - .byte $01, $00, $00, $ff ; new=10 6954 f539 - .byte $00, $ff, $01, $00 ; new=11 6955 f539 - 6956 f539 - ; 0000YyXx st mouse 6957 f539 - 6958 f539 - ; 0000xyXY amiga mouse 6959 f539 - 6960 f539 - ifconst MOUSEXONLY 6961 f539 -amigatoataribits ; swap bits 1 and 4... 6962 f539 - .byte %0000, %0000, %0010, %0010 6963 f539 - .byte %0000, %0000, %0010, %0010 6964 f539 - .byte %0001, %0001, %0011, %0011 6965 f539 - .byte %0001, %0001, %0011, %0011 6966 f539 - 6967 f539 - ; null change bits 6968 f539 - .byte %0000, %0001, %0010, %0011 6969 f539 - .byte %0000, %0001, %0010, %0011 6970 f539 - .byte %0000, %0001, %0010, %0011 6971 f539 - .byte %0000, %0001, %0010, %0011 6972 f539 - 6973 f539 - else ; !MOUSEXONLY 6974 f539 - 6975 f539 -amigatoataribits ; swap bits 1 and 4... 6976 f539 - .byte %0000, %1000, %0010, %1010 6977 f539 - .byte %0100, %1100, %0110, %1110 6978 f539 - .byte %0001, %1001, %0011, %1011 6979 f539 - .byte %0101, %1101, %0111, %1111 6980 f539 - ; null change bits 6981 f539 - .byte %0000, %0001, %0010, %0011 6982 f539 - .byte %0100, %0101, %0110, %0111 6983 f539 - .byte %1000, %1001, %1010, %1011 6984 f539 - .byte %1100, %1101, %1110, %1111 6985 f539 - endif ; !MOUSEXONLY 6986 f539 - 6987 f539 endif ; MOUSESUPPORT 6988 f539 6989 f539 mouse0update 6990 f539 - ifconst MOUSE0SUPPORT 6991 f539 - 6992 f539 -mousetableselect = inttemp2 6993 f539 -mousexdelta = inttemp3 6994 f539 -mouseydelta = inttemp4 6995 f539 -lastSWCHA = inttemp6 6996 f539 - 6997 f539 - ; 0000YyXx st mouse 6998 f539 - ; 0000xyXY amiga mouse 6999 f539 - 7000 f539 - lda #$ff 7001 f539 - sta lastSWCHA 7002 f539 - 7003 f539 - ldy port0control 7004 f539 - 7005 f539 - lda #%00010000 7006 f539 - cpy #9 ; AMIGA? 7007 f539 - bne skipamigabitsfix0 7008 f539 - lda #0 7009 f539 -skipamigabitsfix0 7010 f539 - sta mousetableselect 7011 f539 - ifconst DRIVINGBOOST 7012 f539 - cpy #6 ; DRIVING? 7013 f539 - bne skipdriving0setup 7014 f539 - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 7015 f539 - ; trails the actual mousex0, so we can smoothly interpolate toward 7016 f539 - ; the actual position. This actual position is stored in mousey0 7017 f539 - ; after the driver has run. 7018 f539 - ldx mousex0 7019 f539 - lda mousey0 7020 f539 - stx mousey0 7021 f539 - sta mousex0 7022 f539 -skipdriving0setup 7023 f539 - endif ; DRIVINGBOOST 7024 f539 - 7025 f539 - lda #0 7026 f539 - sta mousexdelta 7027 f539 - sta mouseydelta 7028 f539 - 7029 f539 - ifnconst MOUSETIME 7030 f539 - ifnconst MOUSEXONLY 7031 f539 - lda #180 ; minimum for x+y 7032 f539 - else 7033 f539 - lda #100 ; minimum for just x 7034 f539 - endif 7035 f539 - else 7036 f539 - lda #MOUSETIME 7037 f539 - endif 7038 f539 - jsr SETTIM64T ; INTIM is in Y 7039 f539 - 7040 f539 -mouse0updateloop 7041 f539 - lda SWCHA 7042 f539 - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 7043 f539 - cmp lastSWCHA 7044 f539 - beq mouse0loopcondition 7045 f539 - sta lastSWCHA 7046 f539 - lsr 7047 f539 - lsr 7048 f539 - lsr 7049 f539 - 7050 f539 - ora mousetableselect ; atari/amiga decoding table selection 7051 f539 - 7052 f539 - ; st mice encode on different bits/joystick-lines than amiga mice... 7053 f539 - ; 0000YyXx st mouse 7054 f539 - ; 0000xyXY amiga mouse 7055 f539 - ; ...so can shuffle the amiga bits to reuse the st driver. 7056 f539 - tay 7057 f539 - lax amigatoataribits,y 7058 f539 - 7059 f539 - ifnconst MOUSEXONLY 7060 f539 - ; first the Y... 7061 f539 - and #%00001100 7062 f539 - ora mousecodey0 7063 f539 - tay 7064 f539 - lda rotationalcompare,y 7065 f539 - clc 7066 f539 - adc mouseydelta 7067 f539 - sta mouseydelta 7068 f539 - tya 7069 f539 - lsr 7070 f539 - lsr 7071 f539 - sta mousecodey0 7072 f539 - txa 7073 f539 - ; ...then the X... 7074 f539 - and #%00000011 7075 f539 - tax 7076 f539 - endif ; !MOUSEXONLY 7077 f539 - 7078 f539 - asl 7079 f539 - asl 7080 f539 - ora mousecodex0 7081 f539 - tay 7082 f539 - lda rotationalcompare,y 7083 f539 - adc mousexdelta ; carry was clear by previous ASL 7084 f539 - sta mousexdelta 7085 f539 - stx mousecodex0 7086 f539 -mouse0loopcondition 7087 f539 - lda TIMINT 7088 f539 - bpl mouse0updateloop 7089 f539 - 7090 f539 - ; *** adapt to selected device resolution. 7091 f539 - ldx port0control 7092 f539 - 7093 f539 - ifconst PRECISIONMOUSING 7094 f539 - ldy port0resolution 7095 f539 - bne mouse0halveddone 7096 f539 - cpx #6 ; half-resolution is no good for driving wheels 7097 f539 - beq mouse0halveddone 7098 f539 - ; resolution=0 is half mouse resolution, necessary for precision 7099 f539 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7100 f539 - 7101 f539 - lda mousexdelta 7102 f539 - cmp #$80 7103 f539 - ror ; do a signed divide by 2. 7104 f539 - clc 7105 f539 - adc mousex0 7106 f539 - sta mousex0 7107 f539 - ifnconst MOUSEXONLY 7108 f539 - lda mouseydelta 7109 f539 - clc 7110 f539 - adc mousey0 7111 f539 - sta mousey0 7112 f539 - endif 7113 f539 - ; at half resolution we just exit after updating x and y 7114 f539 - jmp LLRET0 7115 f539 -mouse0halveddone 7116 f539 - endif ; PRECISIONMOUSING 7117 f539 - 7118 f539 - ifnconst MOUSEXONLY 7119 f539 - asl mouseydelta ; *2 because Y resolution is finer 7120 f539 - ldy port0resolution 7121 f539 - dey 7122 f539 - lda #0 7123 f539 -mousey0resolutionfix 7124 f539 - clc 7125 f539 - adc mouseydelta 7126 f539 - dey 7127 f539 - bpl mousey0resolutionfix 7128 f539 - clc 7129 f539 - adc mousey0 7130 f539 - sta mousey0 7131 f539 - endif ; MOUSEXONLY 7132 f539 - 7133 f539 - ldy port0resolution 7134 f539 - dey 7135 f539 - lda #0 7136 f539 -mousex0resolutionfix 7137 f539 - clc 7138 f539 - adc mousexdelta 7139 f539 - dey 7140 f539 - bpl mousex0resolutionfix 7141 f539 - ifnconst DRIVINGBOOST 7142 f539 - clc 7143 f539 - adc mousex0 7144 f539 - sta mousex0 7145 f539 - else 7146 f539 - cpx #6 7147 f539 - beq carryonmouse0boost 7148 f539 - clc 7149 f539 - adc mousex0 7150 f539 - sta mousex0 7151 f539 - jmp LLRET0 7152 f539 -carryonmouse0boost 7153 f539 - sta mousexdelta 7154 f539 - clc 7155 f539 - adc mousecodey0 7156 f539 - sta mousecodey0 7157 f539 - clc 7158 f539 - adc mousex0 7159 f539 - tay ; save the target X 7160 f539 - adc mousey0 ; average in the smoothly-trailing X 7161 f539 - ror 7162 f539 - sta mousex0 ; mousex0 now has the smoothly trailing X 7163 f539 - sty mousey0 ; and mousey0 has the the target X 7164 f539 - 7165 f539 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7166 f539 - ; A has mousex0, the smoothly trailing X 7167 f539 - sbc mousey0 ; less the target X 7168 f539 - bpl skipabsolutedrive0 7169 f539 - eor #$ff 7170 f539 -skipabsolutedrive0 7171 f539 - cmp #64 ; just an unreasonably large change 7172 f539 - bcc skipdrivewrapfix0 7173 f539 - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 7174 f539 -skipdrivewrapfix0 7175 f539 - 7176 f539 - ; get rid of the tweening if the distance travelled was very small 7177 f539 - lda mousexdelta 7178 f539 - cmp port0resolution 7179 f539 - bcs skipbetweenfix0 7180 f539 - lda mousex0 7181 f539 - sta mousey0 7182 f539 -skipbetweenfix0 7183 f539 - 7184 f539 -drivingboostreductioncheck0 7185 f539 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7186 f539 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7187 f539 - ; negated again because truncation during BCD math results in 7188 f539 - ; differing magnitudes, depending if the value is +ve or -ve. 7189 f539 -driving0fix 7190 f539 - lax mousecodey0 7191 f539 - cmp #$80 7192 f539 - bcs driving0skipnegate1 7193 f539 - eor #$FF 7194 f539 - adc #1 7195 f539 - sta mousecodey0 7196 f539 -driving0skipnegate1 7197 f539 - cmp #$80 7198 f539 - ror 7199 f539 - cmp #$80 7200 f539 - ror 7201 f539 - cmp #$80 7202 f539 - ror 7203 f539 - sta inttemp1 7204 f539 - lda mousecodey0 7205 f539 - sec 7206 f539 - sbc inttemp1 7207 f539 - cpx #$80 7208 f539 - bcs driving0skipnegate2 7209 f539 - eor #$FF 7210 f539 - adc #1 7211 f539 -driving0skipnegate2 7212 f539 - sta mousecodey0 7213 f539 -drivingboostdone0 7214 f539 - endif ; DRIVINGBOOST 7215 f539 - 7216 f539 - jmp LLRET0 7217 f539 - 7218 f539 endif ; MOUSE0SUPPORT 7219 f539 7220 f539 mouse1update 7221 f539 - ifconst MOUSE1SUPPORT 7222 f539 - 7223 f539 -mousetableselect = inttemp2 7224 f539 -mousexdelta = inttemp3 7225 f539 -mouseydelta = inttemp4 7226 f539 -lastSWCHA = inttemp6 7227 f539 - 7228 f539 - ; 0000YyXx st mouse 7229 f539 - ; 0000xyXY amiga mouse 7230 f539 - 7231 f539 - lda #$ff 7232 f539 - sta lastSWCHA 7233 f539 - 7234 f539 - ldy port1control 7235 f539 - 7236 f539 - lda #%00010000 7237 f539 - cpy #9 ; AMIGA? 7238 f539 - bne skipamigabitsfix1 7239 f539 - lda #0 7240 f539 -skipamigabitsfix1 7241 f539 - sta mousetableselect 7242 f539 - ifconst DRIVINGBOOST 7243 f539 - cpy #6 ; DRIVING? 7244 f539 - bne skipdriving1setup 7245 f539 - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 7246 f539 - ; trails the actual mousex1, so we can smoothly interpolate toward 7247 f539 - ; the actual position. This actual position is stored in mousey1 7248 f539 - ; after the driver has run. 7249 f539 - ldx mousex1 7250 f539 - lda mousey1 7251 f539 - stx mousey1 7252 f539 - sta mousex1 7253 f539 -skipdriving1setup 7254 f539 - endif ; DRIVINGBOOST 7255 f539 - 7256 f539 - lda #0 7257 f539 - sta mousexdelta 7258 f539 - sta mouseydelta 7259 f539 - 7260 f539 - ifnconst MOUSETIME 7261 f539 - ifnconst MOUSEXONLY 7262 f539 - lda #180 ; minimum for x+y 7263 f539 - else 7264 f539 - lda #100 ; minimum for just x 7265 f539 - endif 7266 f539 - else 7267 f539 - lda #MOUSETIME 7268 f539 - endif 7269 f539 - jsr SETTIM64T ; INTIM is in Y 7270 f539 - 7271 f539 -mouse1updateloop 7272 f539 - lda SWCHA 7273 f539 - and #%00001111 7274 f539 - cmp lastSWCHA 7275 f539 - beq mouse1loopcondition 7276 f539 - sta lastSWCHA 7277 f539 - 7278 f539 - ora mousetableselect ; atari/amiga decoding table selection 7279 f539 - 7280 f539 - ; st mice encode on different bits/joystick-lines than amiga mice... 7281 f539 - ; 0000YyXx st mouse 7282 f539 - ; 0000xyXY amiga mouse 7283 f539 - ; ...so can shuffle the amiga bits to reuse the st driver. 7284 f539 - tay 7285 f539 - lax amigatoataribits,y 7286 f539 - 7287 f539 - ifnconst MOUSEXONLY 7288 f539 - ; first the Y... 7289 f539 - and #%00001100 7290 f539 - ora mousecodey1 7291 f539 - tay 7292 f539 - lda rotationalcompare,y 7293 f539 - clc 7294 f539 - adc mouseydelta 7295 f539 - sta mouseydelta 7296 f539 - tya 7297 f539 - lsr 7298 f539 - lsr 7299 f539 - sta mousecodey1 7300 f539 - txa 7301 f539 - ; ...then the X... 7302 f539 - and #%00000011 7303 f539 - tax 7304 f539 - endif ; !MOUSEXONLY 7305 f539 - 7306 f539 - asl 7307 f539 - asl 7308 f539 - ora mousecodex1 7309 f539 - tay 7310 f539 - lda rotationalcompare,y 7311 f539 - adc mousexdelta ; carry was clear by previous ASL 7312 f539 - sta mousexdelta 7313 f539 - stx mousecodex1 7314 f539 -mouse1loopcondition 7315 f539 - lda TIMINT 7316 f539 - bpl mouse1updateloop 7317 f539 - 7318 f539 - ; *** adapt to selected device resolution. 7319 f539 - ldx port1control 7320 f539 - 7321 f539 - ifconst PRECISIONMOUSING 7322 f539 - ldy port1resolution 7323 f539 - bne mouse1halveddone 7324 f539 - cpx #6 ; half-resolution is no good for driving wheels 7325 f539 - beq mouse1halveddone 7326 f539 - ; resolution=0 is half mouse resolution, necessary for precision 7327 f539 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7328 f539 - 7329 f539 - lda mousexdelta 7330 f539 - cmp #$80 7331 f539 - ror ; do a signed divide by 2. 7332 f539 - clc 7333 f539 - adc mousex1 7334 f539 - sta mousex1 7335 f539 - ifnconst MOUSEXONLY 7336 f539 - lda mouseydelta 7337 f539 - clc 7338 f539 - adc mousey1 7339 f539 - sta mousey1 7340 f539 - endif 7341 f539 - ; at half resolution we just exit after updating x and y 7342 f539 - jmp LLRET1 7343 f539 -mouse1halveddone 7344 f539 - endif ; PRECISIONMOUSING 7345 f539 - 7346 f539 - ifnconst MOUSEXONLY 7347 f539 - asl mouseydelta ; *2 because Y resolution is finer 7348 f539 - ldy port1resolution 7349 f539 - dey 7350 f539 - lda #0 7351 f539 -mousey1resolutionfix 7352 f539 - clc 7353 f539 - adc mouseydelta 7354 f539 - dey 7355 f539 - bpl mousey1resolutionfix 7356 f539 - clc 7357 f539 - adc mousey1 7358 f539 - sta mousey1 7359 f539 - endif ; MOUSEXONLY 7360 f539 - 7361 f539 - ldy port1resolution 7362 f539 - dey 7363 f539 - lda #0 7364 f539 -mousex1resolutionfix 7365 f539 - clc 7366 f539 - adc mousexdelta 7367 f539 - dey 7368 f539 - bpl mousex1resolutionfix 7369 f539 - ifnconst DRIVINGBOOST 7370 f539 - clc 7371 f539 - adc mousex1 7372 f539 - sta mousex1 7373 f539 - else 7374 f539 - cpx #6 7375 f539 - beq carryonmouse1boost 7376 f539 - clc 7377 f539 - adc mousex1 7378 f539 - sta mousex1 7379 f539 - jmp LLRET1 7380 f539 -carryonmouse1boost 7381 f539 - sta mousexdelta 7382 f539 - clc 7383 f539 - adc mousecodey1 7384 f539 - sta mousecodey1 7385 f539 - clc 7386 f539 - adc mousex1 7387 f539 - tay ; save the target X 7388 f539 - adc mousey1 ; average in the smoothly-trailing X 7389 f539 - ror 7390 f539 - sta mousex1 ; mousex0 now has the smoothly trailing X 7391 f539 - sty mousey1 ; and mousey0 has the the target X 7392 f539 - 7393 f539 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7394 f539 - ; A has mousex1, the smoothly trailing X 7395 f539 - sbc mousey1 ; less the target X 7396 f539 - bpl skipabsolutedrive1 7397 f539 - eor #$ff 7398 f539 -skipabsolutedrive1 7399 f539 - cmp #64 ; just an unreasonably large change 7400 f539 - bcc skipdrivewrapfix1 7401 f539 - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 7402 f539 -skipdrivewrapfix1 7403 f539 - 7404 f539 - ; get rid of the tweening if the distance travelled was very small 7405 f539 - lda mousexdelta 7406 f539 - cmp port1resolution 7407 f539 - bcs skipbetweenfix1 7408 f539 - lda mousex1 7409 f539 - sta mousey1 7410 f539 -skipbetweenfix1 7411 f539 - 7412 f539 -drivingboostreductioncheck1 7413 f539 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7414 f539 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7415 f539 - ; negated again because truncation during BCD math results in 7416 f539 - ; differing magnitudes, depending if the value is +ve or -ve. 7417 f539 -driving1fix 7418 f539 - lax mousecodey1 7419 f539 - cmp #$80 7420 f539 - bcs driving0skipnegate1 7421 f539 - eor #$FF 7422 f539 - adc #1 7423 f539 - sta mousecodey1 7424 f539 -driving0skipnegate1 7425 f539 - cmp #$80 7426 f539 - ror 7427 f539 - cmp #$80 7428 f539 - ror 7429 f539 - cmp #$80 7430 f539 - ror 7431 f539 - sta inttemp1 7432 f539 - lda mousecodey1 7433 f539 - sec 7434 f539 - sbc inttemp1 7435 f539 - cpx #$80 7436 f539 - bcs driving1skipnegate2 7437 f539 - eor #$FF 7438 f539 - adc #1 7439 f539 -driving1skipnegate2 7440 f539 - sta mousecodey1 7441 f539 -drivingboostdone1 7442 f539 - endif ; DRIVINGBOOST 7443 f539 - 7444 f539 - jmp LLRET1 7445 f539 - 7446 f539 endif ; MOUSE1SUPPORT 7447 f539 7448 f539 7449 f539 trakball0update 7450 f539 - ifconst TRAKBALL0SUPPORT 7451 f539 - ifnconst TRAKTIME 7452 f539 - ifnconst TRAKXONLY 7453 f539 - lda #180 ; minimum for x+y 7454 f539 - else ; !TRAKXONLY 7455 f539 - lda #100 ; minimum for just x 7456 f539 - endif ; !TRAKXONLY 7457 f539 - else ; !TRAKTIME 7458 f539 - lda #TRAKTIME 7459 f539 - endif ; !TRAKTIME 7460 f539 - jsr SETTIM64T ; INTIM is in Y 7461 f539 - ldx #0 7462 f539 - ifnconst TRAKXONLY 7463 f539 - ldy #0 7464 f539 - endif ; TRAKXONLY 7465 f539 -trakball0updateloop 7466 f539 - lda SWCHA 7467 f539 - and #%00110000 7468 f539 - cmp trakballcodex0 7469 f539 - sta trakballcodex0 7470 f539 - beq trakball0movementXdone 7471 f539 - and #%00010000 7472 f539 - beq trakball0negativeX 7473 f539 -trakball0positiveX 7474 f539 - ;(2 from beq) 7475 f539 - inx ; 2 7476 f539 - jmp trakball0movementXdone ; 3 7477 f539 -trakball0negativeX 7478 f539 - ;(3 from beq) 7479 f539 - dex ; 2 7480 f539 - nop ; 2 7481 f539 -trakball0movementXdone 7482 f539 - 7483 f539 - ifnconst TRAKXONLY 7484 f539 - lda SWCHA 7485 f539 - and #%11000000 7486 f539 - cmp trakballcodey0 7487 f539 - sta trakballcodey0 7488 f539 - beq trakball0movementYdone 7489 f539 - and #%01000000 7490 f539 - beq trakball0negativeY 7491 f539 -trakball0positiveY 7492 f539 - ;(2 from beq) 7493 f539 - iny ; 2 7494 f539 - jmp trakball0movementYdone ; 3 7495 f539 -trakball0negativeY 7496 f539 - ;(3 from beq) 7497 f539 - dey ; 2 7498 f539 - nop ; 2 7499 f539 -trakball0movementYdone 7500 f539 - endif ; !TRAKXONLY 7501 f539 - 7502 f539 - lda TIMINT 7503 f539 - bpl trakball0updateloop 7504 f539 - lda #0 7505 f539 - cpx #0 7506 f539 - beq trakball0skipXadjust 7507 f539 - clc 7508 f539 -trakball0Xloop 7509 f539 - adc port0resolution 7510 f539 - dex 7511 f539 - bne trakball0Xloop 7512 f539 - clc 7513 f539 - adc trakballx0 7514 f539 - sta trakballx0 7515 f539 -trakball0skipXadjust 7516 f539 - ifnconst TRAKXONLY 7517 f539 - lda #0 7518 f539 - cpy #0 7519 f539 - beq trakball0skipYadjust 7520 f539 - clc 7521 f539 -trakball0yloop 7522 f539 - adc port0resolution 7523 f539 - dey 7524 f539 - bne trakball0yloop 7525 f539 - clc 7526 f539 - adc trakbally0 7527 f539 - sta trakbally0 7528 f539 -trakball0skipYadjust 7529 f539 - endif ; !TRAKXONLY 7530 f539 - 7531 f539 - jmp LLRET0 7532 f539 endif 7533 f539 7534 f539 7535 f539 7536 f539 trakball1update 7537 f539 - ifconst TRAKBALL1SUPPORT 7538 f539 - ifnconst TRAKTIME 7539 f539 - ifnconst TRAKXONLY 7540 f539 - lda #180 ; minimum for x+y 7541 f539 - else ; !TRAKXONLY 7542 f539 - lda #100 ; minimum for just x 7543 f539 - endif ; !TRAKXONLY 7544 f539 - else ; !TRAKTIME 7545 f539 - lda #TRAKTIME 7546 f539 - endif ; !TRAKTIME 7547 f539 - jsr SETTIM64T ; INTIM is in Y 7548 f539 - ldx #0 7549 f539 - ifnconst TRAKXONLY 7550 f539 - ldy #0 7551 f539 - endif ; TRAKXONLY 7552 f539 -trakball1updateloop 7553 f539 - lda SWCHA 7554 f539 - and #%00000011 7555 f539 - cmp trakballcodex1 7556 f539 - sta trakballcodex1 7557 f539 - beq trakball1movementXdone 7558 f539 - and #%00000001 7559 f539 - beq trakball1negativeX 7560 f539 -trakball1positiveX 7561 f539 - ;(2 from beq) 7562 f539 - inx ; 2 7563 f539 - jmp trakball1movementXdone ; 3 7564 f539 -trakball1negativeX 7565 f539 - ;(3 from beq) 7566 f539 - dex ; 2 7567 f539 - nop ; 2 7568 f539 -trakball1movementXdone 7569 f539 - 7570 f539 - ifnconst TRAKXONLY 7571 f539 - lda SWCHA 7572 f539 - and #%00001100 7573 f539 - cmp trakballcodey1 7574 f539 - sta trakballcodey1 7575 f539 - beq trakball1movementYdone 7576 f539 - and #%00000100 7577 f539 - beq trakball1negativeY 7578 f539 -trakball1positiveY 7579 f539 - ;(2 from beq) 7580 f539 - iny ; 2 7581 f539 - jmp trakball1movementYdone ; 3 7582 f539 -trakball1negativeY 7583 f539 - ;(3 from beq) 7584 f539 - dey ; 2 7585 f539 - nop ; 2 7586 f539 -trakball1movementYdone 7587 f539 - endif ; !TRAKXONLY 7588 f539 - 7589 f539 - lda TIMINT 7590 f539 - bpl trakball1updateloop 7591 f539 - lda #0 7592 f539 - cpx #0 7593 f539 - beq trakball1skipXadjust 7594 f539 - clc 7595 f539 -trakball1Xloop 7596 f539 - adc port1resolution 7597 f539 - dex 7598 f539 - bne trakball1Xloop 7599 f539 - clc 7600 f539 - adc trakballx1 7601 f539 - sta trakballx1 7602 f539 -trakball1skipXadjust 7603 f539 - ifnconst TRAKXONLY 7604 f539 - lda #0 7605 f539 - cpy #0 7606 f539 - beq trakball1skipYadjust 7607 f539 - clc 7608 f539 -trakball1yloop 7609 f539 - adc port1resolution 7610 f539 - dey 7611 f539 - bne trakball1yloop 7612 f539 - clc 7613 f539 - adc trakbally1 7614 f539 - sta trakbally1 7615 f539 -trakball1skipYadjust 7616 f539 - endif ; !TRAKXONLY 7617 f539 - 7618 f539 - jmp LLRET1 7619 f539 endif 7620 f539 7621 f539 7622 f539 paddleport0update 7623 f539 - ifconst PADDLE0SUPPORT 7624 f539 - lda #6 7625 f539 - sta VBLANK ; start charging the paddle caps 7626 f539 - lda #0 ; use PADDLE timing 7627 f539 - jsr SETTIM64T ; INTIM is in Y 7628 f539 - 7629 f539 -paddleport0updateloop 7630 f539 - lda INPT0 7631 f539 - bmi skippaddle0setposition 7632 f539 - sty paddleposition0 7633 f539 -skippaddle0setposition 7634 f539 - ifconst TWOPADDLESUPPORT 7635 f539 - lda INPT1 7636 f539 - bmi skippaddle1setposition 7637 f539 - sty paddleposition1 7638 f539 -skippaddle1setposition 7639 f539 - endif 7640 f539 - ldy INTIM 7641 f539 - cpy #TIMEOFFSET 7642 f539 - bcs paddleport0updateloop 7643 f539 - 7644 f539 - lda #%10000110 7645 f539 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 7646 f539 - sec 7647 f539 - lda paddleposition0 7648 f539 - sbc #TIMEOFFSET 7649 f539 - ifconst PADDLESCALEX2 7650 f539 - asl 7651 f539 - endif 7652 f539 - 7653 f539 - ifnconst PADDLESMOOTHINGOFF 7654 f539 - clc 7655 f539 - adc paddleprevious0 7656 f539 - ror 7657 f539 - sta paddleprevious0 7658 f539 - endif 7659 f539 - 7660 f539 - sta paddleposition0 7661 f539 - 7662 f539 - ifconst TWOPADDLESUPPORT 7663 f539 - sec 7664 f539 - lda paddleposition1 7665 f539 - sbc #TIMEOFFSET 7666 f539 - ifconst PADDLESCALEX2 7667 f539 - asl 7668 f539 - endif 7669 f539 - 7670 f539 - ifnconst PADDLESMOOTHINGOFF 7671 f539 - clc 7672 f539 - adc paddleprevious1 7673 f539 - ror 7674 f539 - sta paddleprevious1 7675 f539 - endif 7676 f539 - sta paddleposition1 7677 f539 - endif ; TWOPADDLESUPPORT 7678 f539 - 7679 f539 - jmp LLRET0 7680 f539 endif 7681 f539 7682 f539 paddleport1update 7683 f539 - ifconst PADDLE1SUPPORT 7684 f539 - lda #6 7685 f539 - sta VBLANK ; start charging the paddle caps 7686 f539 - 7687 f539 - lda #0 ; use PADDLE timing 7688 f539 - jsr SETTIM64T ; INTIM is in Y 7689 f539 - 7690 f539 -paddleport1updateloop 7691 f539 - lda INPT2 7692 f539 - bmi skippaddle2setposition 7693 f539 - sty paddleposition2 7694 f539 -skippaddle2setposition 7695 f539 - ifconst TWOPADDLESUPPORT 7696 f539 - lda INPT3 7697 f539 - bmi skippaddle3setposition 7698 f539 - sty paddleposition3 7699 f539 -skippaddle3setposition 7700 f539 - endif 7701 f539 - ldy INTIM 7702 f539 - cpy #TIMEOFFSET 7703 f539 - bcs paddleport1updateloop 7704 f539 - 7705 f539 - lda #%10000110 7706 f539 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 7707 f539 - sec 7708 f539 - lda paddleposition2 7709 f539 - sbc #TIMEOFFSET 7710 f539 - ifconst PADDLESCALEX2 7711 f539 - asl 7712 f539 - endif 7713 f539 - 7714 f539 - ifnconst PADDLESMOOTHINGOFF 7715 f539 - clc 7716 f539 - adc paddleprevious2 7717 f539 - ror 7718 f539 - sta paddleprevious2 7719 f539 - endif 7720 f539 - 7721 f539 - sta paddleposition2 7722 f539 - 7723 f539 - ifconst TWOPADDLESUPPORT 7724 f539 - sec 7725 f539 - lda paddleposition3 7726 f539 - sbc #TIMEOFFSET 7727 f539 - ifconst PADDLESCALEX2 7728 f539 - asl 7729 f539 - endif 7730 f539 - 7731 f539 - ifnconst PADDLESMOOTHINGOFF 7732 f539 - clc 7733 f539 - adc paddleprevious3 7734 f539 - ror 7735 f539 - sta paddleprevious3 7736 f539 - endif 7737 f539 - sta paddleposition3 7738 f539 - endif ; TWOPADDLESUPPORT 7739 f539 - 7740 f539 - jmp LLRET1 7741 f539 endif 7742 f539 7743 f539 7744 f539 paddlebuttonhandler ; outside of conditional, for button-handler LUT 7745 f539 - ifconst PADDLESUPPORT 7746 f539 - ; x=0|1 for port, rather than paddle #. 7747 f539 - ; Only the first paddle button will integrate into "joy0fire" testing. If the 7748 f539 - ; game wants to support 2 paddles, up to the game to instead test the 7749 f539 - ; joystick right+left directions instead. 7750 f539 - lda SWCHA ; top of nibble is first paddle button 7751 f539 - cpx #0 ; port 0? 7752 f539 - beq skippaddleport2shift 7753 f539 - asl ; shift second port to upper nibble 7754 f539 - asl 7755 f539 - asl 7756 f539 - asl 7757 f539 -skippaddleport2shift 7758 f539 - and #%10000000 7759 f539 - eor #%10000000 ; invert 7760 f539 - sta sINPT1,x 7761 f539 - jmp buttonreadloopreturn 7762 f539 endif ; PADDLESUPPORT 7763 f539 7764 f539 mousebuttonhandler ; outside of conditional, for button-handler LUT 7765 f539 - ifconst MOUSESUPPORT 7766 f539 - ; stick the mouse buttons in the correct shadow register... 7767 f539 - txa 7768 f539 - asl 7769 f539 - tay ; y=x*2 7770 f539 - lda INPT4,x 7771 f539 - eor #%10000000 7772 f539 - lsr 7773 f539 - sta sINPT1,x 7774 f539 - 7775 f539 - lda INPT1,y 7776 f539 - and #%10000000 7777 f539 - eor #%10000000 7778 f539 - ora sINPT1,x 7779 f539 - sta sINPT1,x 7780 f539 - jmp buttonreadloopreturn 7781 f539 endif ; MOUSESUPPORT 7782 f539 7783 f539 - ifconst KEYPADSUPPORT 7784 f539 - ; ** select keypad rows 0 to 3 over 4 frames... 7785 f539 -keypadrowselect 7786 f539 - ldy #0 7787 f539 - lda port0control 7788 f539 - cmp #7 7789 f539 - bne skipport0val 7790 f539 - iny ; y=y+1 7791 f539 -skipport0val 7792 f539 - lda port1control 7793 f539 - cmp #7 7794 f539 - bne skipport1val 7795 f539 - iny 7796 f539 - iny ; y=y+2 7797 f539 -skipport1val 7798 f539 - lda keyrowdirectionmask,y 7799 f539 - sta CTLSWA 7800 f539 - tya 7801 f539 - asl 7802 f539 - asl 7803 f539 - sta inttemp1 7804 f539 - lda framecounter 7805 f539 - and #3 7806 f539 - ora inttemp1 7807 f539 - tax 7808 f539 - lda keyrowselectvalue,x 7809 f539 - sta SWCHA 7810 f539 - rts 7811 f539 - 7812 f539 -keyrowdirectionmask 7813 f539 - .byte #%00000000 ; 0 : port0=input port1=input 7814 f539 - .byte #%11110000 ; 1 : port0=output port1=input 7815 f539 - .byte #%00001111 ; 2 : port0=input port1=output 7816 f539 - .byte #%11111111 ; 3 : port0=output port1=output 7817 f539 - 7818 f539 -keyrowselectvalue 7819 f539 - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 7820 f539 - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 7821 f539 - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 7822 f539 - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 7823 f539 endif ; KEYPADSUPPORT 7824 f539 7825 f539 - ifconst KEYPADSUPPORT 7826 f539 - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 7827 f539 -keypadcolumnread 7828 f539 - lda port0control 7829 f539 - cmp #7 7830 f539 - bne skipkeypadcolumnread0 7831 f539 - lda framecounter 7832 f539 - and #3 7833 f539 - asl ; x2 because keypad variables are interleaved 7834 f539 - tax 7835 f539 - lda #0 7836 f539 - sta keypadmatrix0a,x 7837 f539 - lda INPT0 7838 f539 - cmp #$80 7839 f539 - rol keypadmatrix0a,x 7840 f539 - lda INPT1 7841 f539 - cmp #$80 7842 f539 - rol keypadmatrix0a,x 7843 f539 - lda INPT4 7844 f539 - cmp #$80 7845 f539 - rol keypadmatrix0a,x 7846 f539 - lda keypadmatrix0a,x 7847 f539 - eor #%00000111 7848 f539 - sta keypadmatrix0a,x 7849 f539 -skipkeypadcolumnread0 7850 f539 - 7851 f539 - lda port1control 7852 f539 - cmp #7 7853 f539 - bne skipkeypadcolumnread1 7854 f539 - lda framecounter 7855 f539 - and #3 7856 f539 - asl ; x2 because keypad variables are interleaved 7857 f539 - tax 7858 f539 - lda #0 7859 f539 - sta keypadmatrix1a,x 7860 f539 - rol keypadmatrix1a,x 7861 f539 - lda INPT2 7862 f539 - cmp #$80 7863 f539 - rol keypadmatrix1a,x 7864 f539 - lda INPT3 7865 f539 - cmp #$80 7866 f539 - rol keypadmatrix1a,x 7867 f539 - lda INPT5 7868 f539 - cmp #$80 7869 f539 - rol keypadmatrix1a,x 7870 f539 - lda keypadmatrix1a,x 7871 f539 - eor #%00000111 7872 f539 - sta keypadmatrix1a,x 7873 f539 -skipkeypadcolumnread1 7874 f539 - rts 7875 f539 endif ; KEYPADSUPPORT 7876 f539 7877 f539 setportforinput 7878 f539 a5 e4 lda CTLSWAs 7879 f53b 3d 44 f5 and allpinsinputlut,x 7880 f53e 85 e4 sta CTLSWAs 7881 f540 8d 81 02 sta CTLSWA 7882 f543 60 rts 7883 f544 7884 f544 allpinsinputlut 7885 f544 0f f0 .byte.b $0F, $F0 7886 f546 7887 f546 setonebuttonmode 7888 f546 a9 06 lda #6 ; in case we're in unlocked-bios mode 7889 f548 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 7890 f54a a9 14 lda #$14 7891 f54c 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 7892 f54f a5 e5 lda CTLSWBs 7893 f551 1d 5a f5 ora thisjoy2buttonbit,x 7894 f554 85 e5 sta CTLSWBs 7895 f556 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 7896 f559 60 rts 7897 f55a 7898 f55a thisjoy2buttonbit 7899 f55a 04 10 .byte.b $04, $10 7900 f55c 7901 f55c settwobuttonmode 7902 f55c a9 06 lda #6 ; in case we're in unlocked-bios mode 7903 f55e 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 7904 f560 a9 14 lda #$14 7905 f562 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 7906 f565 a5 e5 lda CTLSWBs 7907 f567 3d 70 f5 and thisjoy2buttonmask,x 7908 f56a 85 e5 sta CTLSWBs 7909 f56c 8d 82 02 sta SWCHB 7910 f56f 60 rts 7911 f570 7912 f570 thisjoy2buttonmask 7913 f570 fb ef .byte.b $fb, $ef 7914 f572 7915 f572 ; Provided under the CC0 license. See the included LICENSE.txt for details. 7916 f572 7917 f572 START 7918 f572 start 7919 f572 7920 f572 ;******** more or less the Atari recommended startup procedure 7921 f572 7922 f572 78 sei 7923 f573 d8 cld 7924 f574 7925 f574 ifnconst NOTIALOCK 7926 f574 a9 07 lda #$07 7927 f576 - else 7928 f576 - lda #$06 7929 f576 endif 7930 f576 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 7931 f578 a9 7f lda #$7F 7932 f57a 85 3c sta CTRL ;disable DMA 7933 f57c a9 00 lda #$00 7934 f57e 85 38 sta OFFSET 7935 f580 ifnconst NOTIALOCK 7936 f580 85 01 sta INPTCTRL 7937 f582 endif 7938 f582 a2 ff ldx #$FF 7939 f584 9a txs 7940 f585 7941 f585 ;************** Clear Memory 7942 f585 7943 f585 a2 40 ldx #$40 7944 f587 a9 00 lda #$00 7945 f589 crloop1 7946 f589 95 00 sta $00,x ;Clear zero page 7947 f58b 9d 00 01 sta $100,x ;Clear page 1 7948 f58e e8 inx 7949 f58f d0 f8 bne crloop1 7950 f591 7951 f591 7952 f591 a0 00 ldy #$00 ;Clear Ram 7953 f593 a9 18 lda #$18 ;Start at $1800 7954 f595 85 81 sta $81 7955 f597 a9 00 lda #$00 7956 f599 85 80 sta $80 7957 f59b crloop3 7958 f59b a9 00 lda #$00 7959 f59d 91 80 sta ($80),y ;Store data 7960 f59f c8 iny ;Next byte 7961 f5a0 d0 f9 bne crloop3 ;Branch if not done page 7962 f5a2 e6 81 inc $81 ;Next page 7963 f5a4 a5 81 lda $81 7964 f5a6 c9 20 cmp #$20 ;End at $1FFF 7965 f5a8 d0 f1 bne crloop3 ;Branch if not 7966 f5aa 7967 f5aa a0 00 ldy #$00 ;Clear Ram 7968 f5ac a9 22 lda #$22 ;Start at $2200 7969 f5ae 85 81 sta $81 7970 f5b0 a9 00 lda #$00 7971 f5b2 85 80 sta $80 7972 f5b4 crloop4 7973 f5b4 a9 00 lda #$00 7974 f5b6 91 80 sta ($80),y ;Store data 7975 f5b8 c8 iny ;Next byte 7976 f5b9 d0 f9 bne crloop4 ;Branch if not done page 7977 f5bb e6 81 inc $81 ;Next page 7978 f5bd a5 81 lda $81 7979 f5bf c9 27 cmp #$27 ;End at $27FF 7980 f5c1 d0 f1 bne crloop4 ;Branch if not 7981 f5c3 7982 f5c3 a2 00 ldx #$00 7983 f5c5 a9 00 lda #$00 7984 f5c7 crloop5 ;Clear 2100-213F, 2000-203F 7985 f5c7 9d 00 20 sta $2000,x 7986 f5ca 9d 00 21 sta $2100,x 7987 f5cd e8 inx 7988 f5ce e0 40 cpx #$40 7989 f5d0 d0 f5 bne crloop5 7990 f5d2 7991 f5d2 85 80 sta $80 7992 f5d4 85 81 sta $81 7993 f5d6 85 82 sta $82 7994 f5d8 85 83 sta $83 7995 f5da 7996 f5da ;seed random number with hopefully-random timer value 7997 f5da a9 01 lda #1 7998 f5dc 0d 84 02 ora INTIM 7999 f5df 85 40 sta rand 8000 f5e1 8001 f5e1 ; detect the console type... 8002 f5e1 pndetectvblankstart 8003 f5e1 a5 28 lda MSTAT 8004 f5e3 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 8005 f5e5 pndetectvblankover 8006 f5e5 a5 28 lda MSTAT 8007 f5e7 30 fc bmi pndetectvblankover ; then wait for it to be over 8008 f5e9 a0 00 ldy #$00 8009 f5eb a2 00 ldx #$00 8010 f5ed pndetectvblankhappening 8011 f5ed a5 28 lda MSTAT 8012 f5ef 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 8013 f5f1 85 24 sta WSYNC 8014 f5f3 85 24 sta WSYNC 8015 f5f5 e8 inx 8016 f5f6 d0 f5 bne pndetectvblankhappening 8017 f5f8 pndetectinvblank 8018 f5f8 e0 7d cpx #125 8019 f5fa 90 02 bcc pndetecispal 8020 f5fc a0 01 ldy #$01 8021 f5fe pndetecispal 8022 f5fe 8c 09 21 sty paldetected 8023 f601 8024 f601 20 9f f4 jsr createallgamedlls 8025 f604 8026 f604 a9 18 lda #>DLLMEM 8027 f606 85 2c sta DPPH 8028 f608 a9 00 lda # 255 8197 f630 -DOUBLEBUFFEROFFSET = 255 8198 f630 else 8199 f630 00 4d DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 8200 f630 endif 8201 f630 8202 f630 - ifconst EXTRADLMEMORY 8203 f630 -SECONDDLHALFSTART SET $2300 8204 f630 endif 8205 f630 8206 f630 DLPOINTH 8207 f630 DLINDEX SET 0 8208 f630 REPEAT WZONECOUNT 8209 f630 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f630 - ifconst EXTRADLMEMORY 8211 f630 - if TMPMEMADDRESS > $1FFF 8212 f630 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f630 - else 8214 f630 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f630 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f630 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f630 - endif 8218 f630 - endif ; TMPMEMADDRESS > $1FFF 8219 f630 endif ; EXTRADLMEMORY 8220 f630 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f630 18 .byte.b >TMPMEMADDRESS 8222 f630 DLINDEX SET DLINDEX + 1 8208 f630 REPEND 8209 f630 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f631 - ifconst EXTRADLMEMORY 8211 f631 - if TMPMEMADDRESS > $1FFF 8212 f631 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f631 - else 8214 f631 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f631 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f631 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f631 - endif 8218 f631 - endif ; TMPMEMADDRESS > $1FFF 8219 f631 endif ; EXTRADLMEMORY 8220 f631 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f631 18 .byte.b >TMPMEMADDRESS 8222 f631 DLINDEX SET DLINDEX + 1 8208 f631 REPEND 8209 f631 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f632 - ifconst EXTRADLMEMORY 8211 f632 - if TMPMEMADDRESS > $1FFF 8212 f632 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f632 - else 8214 f632 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f632 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f632 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f632 - endif 8218 f632 - endif ; TMPMEMADDRESS > $1FFF 8219 f632 endif ; EXTRADLMEMORY 8220 f632 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f632 19 .byte.b >TMPMEMADDRESS 8222 f632 DLINDEX SET DLINDEX + 1 8208 f632 REPEND 8209 f632 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f633 - ifconst EXTRADLMEMORY 8211 f633 - if TMPMEMADDRESS > $1FFF 8212 f633 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f633 - else 8214 f633 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f633 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f633 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f633 - endif 8218 f633 - endif ; TMPMEMADDRESS > $1FFF 8219 f633 endif ; EXTRADLMEMORY 8220 f633 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f633 19 .byte.b >TMPMEMADDRESS 8222 f633 DLINDEX SET DLINDEX + 1 8208 f633 REPEND 8209 f633 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f634 - ifconst EXTRADLMEMORY 8211 f634 - if TMPMEMADDRESS > $1FFF 8212 f634 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f634 - else 8214 f634 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f634 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f634 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f634 - endif 8218 f634 - endif ; TMPMEMADDRESS > $1FFF 8219 f634 endif ; EXTRADLMEMORY 8220 f634 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f634 19 .byte.b >TMPMEMADDRESS 8222 f634 DLINDEX SET DLINDEX + 1 8208 f634 REPEND 8209 f634 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f635 - ifconst EXTRADLMEMORY 8211 f635 - if TMPMEMADDRESS > $1FFF 8212 f635 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f635 - else 8214 f635 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f635 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f635 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f635 - endif 8218 f635 - endif ; TMPMEMADDRESS > $1FFF 8219 f635 endif ; EXTRADLMEMORY 8220 f635 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f635 1a .byte.b >TMPMEMADDRESS 8222 f635 DLINDEX SET DLINDEX + 1 8208 f635 REPEND 8209 f635 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f636 - ifconst EXTRADLMEMORY 8211 f636 - if TMPMEMADDRESS > $1FFF 8212 f636 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f636 - else 8214 f636 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f636 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f636 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f636 - endif 8218 f636 - endif ; TMPMEMADDRESS > $1FFF 8219 f636 endif ; EXTRADLMEMORY 8220 f636 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f636 1a .byte.b >TMPMEMADDRESS 8222 f636 DLINDEX SET DLINDEX + 1 8208 f636 REPEND 8209 f636 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f637 - ifconst EXTRADLMEMORY 8211 f637 - if TMPMEMADDRESS > $1FFF 8212 f637 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f637 - else 8214 f637 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f637 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f637 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f637 - endif 8218 f637 - endif ; TMPMEMADDRESS > $1FFF 8219 f637 endif ; EXTRADLMEMORY 8220 f637 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f637 1a .byte.b >TMPMEMADDRESS 8222 f637 DLINDEX SET DLINDEX + 1 8208 f637 REPEND 8209 f637 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f638 - ifconst EXTRADLMEMORY 8211 f638 - if TMPMEMADDRESS > $1FFF 8212 f638 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f638 - else 8214 f638 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f638 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f638 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f638 - endif 8218 f638 - endif ; TMPMEMADDRESS > $1FFF 8219 f638 endif ; EXTRADLMEMORY 8220 f638 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f638 1b .byte.b >TMPMEMADDRESS 8222 f638 DLINDEX SET DLINDEX + 1 8208 f638 REPEND 8209 f638 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f639 - ifconst EXTRADLMEMORY 8211 f639 - if TMPMEMADDRESS > $1FFF 8212 f639 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f639 - else 8214 f639 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f639 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f639 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f639 - endif 8218 f639 - endif ; TMPMEMADDRESS > $1FFF 8219 f639 endif ; EXTRADLMEMORY 8220 f639 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f639 1b .byte.b >TMPMEMADDRESS 8222 f639 DLINDEX SET DLINDEX + 1 8208 f639 REPEND 8209 f639 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f63a - ifconst EXTRADLMEMORY 8211 f63a - if TMPMEMADDRESS > $1FFF 8212 f63a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f63a - else 8214 f63a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f63a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f63a -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f63a - endif 8218 f63a - endif ; TMPMEMADDRESS > $1FFF 8219 f63a endif ; EXTRADLMEMORY 8220 f63a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f63a 1b .byte.b >TMPMEMADDRESS 8222 f63a DLINDEX SET DLINDEX + 1 8208 f63a REPEND 8209 f63a TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f63b - ifconst EXTRADLMEMORY 8211 f63b - if TMPMEMADDRESS > $1FFF 8212 f63b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f63b - else 8214 f63b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f63b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f63b -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f63b - endif 8218 f63b - endif ; TMPMEMADDRESS > $1FFF 8219 f63b endif ; EXTRADLMEMORY 8220 f63b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f63b 1b .byte.b >TMPMEMADDRESS 8222 f63b DLINDEX SET DLINDEX + 1 8208 f63b REPEND 8209 f63b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f63c - ifconst EXTRADLMEMORY 8211 f63c - if TMPMEMADDRESS > $1FFF 8212 f63c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f63c - else 8214 f63c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f63c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f63c -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f63c - endif 8218 f63c - endif ; TMPMEMADDRESS > $1FFF 8219 f63c endif ; EXTRADLMEMORY 8220 f63c ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f63c 1c .byte.b >TMPMEMADDRESS 8222 f63c DLINDEX SET DLINDEX + 1 8208 f63c REPEND 8209 f63c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f63d - ifconst EXTRADLMEMORY 8211 f63d - if TMPMEMADDRESS > $1FFF 8212 f63d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f63d - else 8214 f63d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f63d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f63d -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f63d - endif 8218 f63d - endif ; TMPMEMADDRESS > $1FFF 8219 f63d endif ; EXTRADLMEMORY 8220 f63d ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f63d 1c .byte.b >TMPMEMADDRESS 8222 f63d DLINDEX SET DLINDEX + 1 8208 f63d REPEND 8209 f63d TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f63e - ifconst EXTRADLMEMORY 8211 f63e - if TMPMEMADDRESS > $1FFF 8212 f63e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f63e - else 8214 f63e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f63e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f63e -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f63e - endif 8218 f63e - endif ; TMPMEMADDRESS > $1FFF 8219 f63e endif ; EXTRADLMEMORY 8220 f63e ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f63e 1c .byte.b >TMPMEMADDRESS 8222 f63e DLINDEX SET DLINDEX + 1 8208 f63e REPEND 8209 f63e TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f63f - ifconst EXTRADLMEMORY 8211 f63f - if TMPMEMADDRESS > $1FFF 8212 f63f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f63f - else 8214 f63f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f63f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f63f -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f63f - endif 8218 f63f - endif ; TMPMEMADDRESS > $1FFF 8219 f63f endif ; EXTRADLMEMORY 8220 f63f ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f63f 1d .byte.b >TMPMEMADDRESS 8222 f63f DLINDEX SET DLINDEX + 1 8208 f63f REPEND 8209 f63f TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f640 - ifconst EXTRADLMEMORY 8211 f640 - if TMPMEMADDRESS > $1FFF 8212 f640 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f640 - else 8214 f640 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f640 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f640 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f640 - endif 8218 f640 - endif ; TMPMEMADDRESS > $1FFF 8219 f640 endif ; EXTRADLMEMORY 8220 f640 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f640 1d .byte.b >TMPMEMADDRESS 8222 f640 DLINDEX SET DLINDEX + 1 8208 f640 REPEND 8209 f640 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f641 - ifconst EXTRADLMEMORY 8211 f641 - if TMPMEMADDRESS > $1FFF 8212 f641 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f641 - else 8214 f641 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f641 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f641 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f641 - endif 8218 f641 - endif ; TMPMEMADDRESS > $1FFF 8219 f641 endif ; EXTRADLMEMORY 8220 f641 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f641 1d .byte.b >TMPMEMADDRESS 8222 f641 DLINDEX SET DLINDEX + 1 8208 f641 REPEND 8209 f641 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f642 - ifconst EXTRADLMEMORY 8211 f642 - if TMPMEMADDRESS > $1FFF 8212 f642 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f642 - else 8214 f642 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f642 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f642 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f642 - endif 8218 f642 - endif ; TMPMEMADDRESS > $1FFF 8219 f642 endif ; EXTRADLMEMORY 8220 f642 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f642 1e .byte.b >TMPMEMADDRESS 8222 f642 DLINDEX SET DLINDEX + 1 8208 f642 REPEND 8209 f642 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f643 - ifconst EXTRADLMEMORY 8211 f643 - if TMPMEMADDRESS > $1FFF 8212 f643 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f643 - else 8214 f643 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f643 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f643 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f643 - endif 8218 f643 - endif ; TMPMEMADDRESS > $1FFF 8219 f643 endif ; EXTRADLMEMORY 8220 f643 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f643 1e .byte.b >TMPMEMADDRESS 8222 f643 DLINDEX SET DLINDEX + 1 8208 f643 REPEND 8209 f643 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f644 - ifconst EXTRADLMEMORY 8211 f644 - if TMPMEMADDRESS > $1FFF 8212 f644 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f644 - else 8214 f644 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f644 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f644 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f644 - endif 8218 f644 - endif ; TMPMEMADDRESS > $1FFF 8219 f644 endif ; EXTRADLMEMORY 8220 f644 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f644 1e .byte.b >TMPMEMADDRESS 8222 f644 DLINDEX SET DLINDEX + 1 8208 f644 REPEND 8209 f644 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f645 - ifconst EXTRADLMEMORY 8211 f645 - if TMPMEMADDRESS > $1FFF 8212 f645 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f645 - else 8214 f645 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f645 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f645 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f645 - endif 8218 f645 - endif ; TMPMEMADDRESS > $1FFF 8219 f645 endif ; EXTRADLMEMORY 8220 f645 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f645 1f .byte.b >TMPMEMADDRESS 8222 f645 DLINDEX SET DLINDEX + 1 8208 f645 REPEND 8209 f645 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f646 - ifconst EXTRADLMEMORY 8211 f646 - if TMPMEMADDRESS > $1FFF 8212 f646 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f646 - else 8214 f646 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f646 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f646 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f646 - endif 8218 f646 - endif ; TMPMEMADDRESS > $1FFF 8219 f646 endif ; EXTRADLMEMORY 8220 f646 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f646 1f .byte.b >TMPMEMADDRESS 8222 f646 DLINDEX SET DLINDEX + 1 8208 f646 REPEND 8209 f646 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8210 f647 - ifconst EXTRADLMEMORY 8211 f647 - if TMPMEMADDRESS > $1FFF 8212 f647 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8213 f647 - else 8214 f647 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8215 f647 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8216 f647 -SECONDDLHALFSTART SET TMPMEMADDRESS 8217 f647 - endif 8218 f647 - endif ; TMPMEMADDRESS > $1FFF 8219 f647 endif ; EXTRADLMEMORY 8220 f647 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8221 f647 1f .byte.b >TMPMEMADDRESS 8222 f647 DLINDEX SET DLINDEX + 1 8223 f648 REPEND 8224 f648 8225 f648 - ifconst EXTRADLMEMORY 8226 f648 - echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 8227 f648 endif 8228 f648 8229 f648 8230 f648 DLPOINTL 8231 f648 DLINDEX SET 0 8232 f648 REPEAT WZONECOUNT 8233 f648 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8234 f648 - ifconst EXTRADLMEMORY 8235 f648 - if TMPMEMADDRESS > $1FFF 8236 f648 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f648 - else 8238 f648 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f648 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f648 - endif 8241 f648 - endif ; TMPMEMADDRESS > $1FFF 8242 f648 endif ; EXTRADLMEMORY 8243 f648 80 .byte.b $1FFF 8236 f649 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f649 - else 8238 f649 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f649 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f649 - endif 8241 f649 - endif ; TMPMEMADDRESS > $1FFF 8242 f649 endif ; EXTRADLMEMORY 8243 f649 d0 .byte.b $1FFF 8236 f64a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f64a - else 8238 f64a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f64a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f64a - endif 8241 f64a - endif ; TMPMEMADDRESS > $1FFF 8242 f64a endif ; EXTRADLMEMORY 8243 f64a 20 .byte.b $1FFF 8236 f64b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f64b - else 8238 f64b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f64b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f64b - endif 8241 f64b - endif ; TMPMEMADDRESS > $1FFF 8242 f64b endif ; EXTRADLMEMORY 8243 f64b 70 .byte.b $1FFF 8236 f64c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f64c - else 8238 f64c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f64c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f64c - endif 8241 f64c - endif ; TMPMEMADDRESS > $1FFF 8242 f64c endif ; EXTRADLMEMORY 8243 f64c c0 .byte.b $1FFF 8236 f64d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f64d - else 8238 f64d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f64d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f64d - endif 8241 f64d - endif ; TMPMEMADDRESS > $1FFF 8242 f64d endif ; EXTRADLMEMORY 8243 f64d 10 .byte.b $1FFF 8236 f64e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f64e - else 8238 f64e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f64e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f64e - endif 8241 f64e - endif ; TMPMEMADDRESS > $1FFF 8242 f64e endif ; EXTRADLMEMORY 8243 f64e 60 .byte.b $1FFF 8236 f64f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f64f - else 8238 f64f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f64f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f64f - endif 8241 f64f - endif ; TMPMEMADDRESS > $1FFF 8242 f64f endif ; EXTRADLMEMORY 8243 f64f b0 .byte.b $1FFF 8236 f650 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f650 - else 8238 f650 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f650 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f650 - endif 8241 f650 - endif ; TMPMEMADDRESS > $1FFF 8242 f650 endif ; EXTRADLMEMORY 8243 f650 00 .byte.b $1FFF 8236 f651 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f651 - else 8238 f651 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f651 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f651 - endif 8241 f651 - endif ; TMPMEMADDRESS > $1FFF 8242 f651 endif ; EXTRADLMEMORY 8243 f651 50 .byte.b $1FFF 8236 f652 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f652 - else 8238 f652 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f652 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f652 - endif 8241 f652 - endif ; TMPMEMADDRESS > $1FFF 8242 f652 endif ; EXTRADLMEMORY 8243 f652 a0 .byte.b $1FFF 8236 f653 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f653 - else 8238 f653 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f653 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f653 - endif 8241 f653 - endif ; TMPMEMADDRESS > $1FFF 8242 f653 endif ; EXTRADLMEMORY 8243 f653 f0 .byte.b $1FFF 8236 f654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f654 - else 8238 f654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f654 - endif 8241 f654 - endif ; TMPMEMADDRESS > $1FFF 8242 f654 endif ; EXTRADLMEMORY 8243 f654 40 .byte.b $1FFF 8236 f655 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f655 - else 8238 f655 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f655 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f655 - endif 8241 f655 - endif ; TMPMEMADDRESS > $1FFF 8242 f655 endif ; EXTRADLMEMORY 8243 f655 90 .byte.b $1FFF 8236 f656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f656 - else 8238 f656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f656 - endif 8241 f656 - endif ; TMPMEMADDRESS > $1FFF 8242 f656 endif ; EXTRADLMEMORY 8243 f656 e0 .byte.b $1FFF 8236 f657 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f657 - else 8238 f657 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f657 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f657 - endif 8241 f657 - endif ; TMPMEMADDRESS > $1FFF 8242 f657 endif ; EXTRADLMEMORY 8243 f657 30 .byte.b $1FFF 8236 f658 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f658 - else 8238 f658 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f658 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f658 - endif 8241 f658 - endif ; TMPMEMADDRESS > $1FFF 8242 f658 endif ; EXTRADLMEMORY 8243 f658 80 .byte.b $1FFF 8236 f659 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f659 - else 8238 f659 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f659 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f659 - endif 8241 f659 - endif ; TMPMEMADDRESS > $1FFF 8242 f659 endif ; EXTRADLMEMORY 8243 f659 d0 .byte.b $1FFF 8236 f65a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f65a - else 8238 f65a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f65a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f65a - endif 8241 f65a - endif ; TMPMEMADDRESS > $1FFF 8242 f65a endif ; EXTRADLMEMORY 8243 f65a 20 .byte.b $1FFF 8236 f65b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f65b - else 8238 f65b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f65b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f65b - endif 8241 f65b - endif ; TMPMEMADDRESS > $1FFF 8242 f65b endif ; EXTRADLMEMORY 8243 f65b 70 .byte.b $1FFF 8236 f65c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f65c - else 8238 f65c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f65c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f65c - endif 8241 f65c - endif ; TMPMEMADDRESS > $1FFF 8242 f65c endif ; EXTRADLMEMORY 8243 f65c c0 .byte.b $1FFF 8236 f65d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f65d - else 8238 f65d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f65d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f65d - endif 8241 f65d - endif ; TMPMEMADDRESS > $1FFF 8242 f65d endif ; EXTRADLMEMORY 8243 f65d 10 .byte.b $1FFF 8236 f65e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f65e - else 8238 f65e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f65e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f65e - endif 8241 f65e - endif ; TMPMEMADDRESS > $1FFF 8242 f65e endif ; EXTRADLMEMORY 8243 f65e 60 .byte.b $1FFF 8236 f65f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8237 f65f - else 8238 f65f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8239 f65f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8240 f65f - endif 8241 f65f - endif ; TMPMEMADDRESS > $1FFF 8242 f65f endif ; EXTRADLMEMORY 8243 f65f b0 .byte.b $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 18 80 ZONE0ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 18 d0 ZONE1ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 19 20 ZONE2ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 19 70 ZONE3ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 19 c0 ZONE4ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1a 10 ZONE5ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1a 60 ZONE6ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1a b0 ZONE7ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1b 00 ZONE8ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1b 50 ZONE9ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1b a0 ZONE10ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1b f0 ZONE11ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1c 40 ZONE12ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1c 90 ZONE13ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1c e0 ZONE14ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1d 30 ZONE15ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1d 80 ZONE16ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1d d0 ZONE17ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1e 20 ZONE18ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1e 70 ZONE19ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1e c0 ZONE20ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1f 10 ZONE21ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1f 60 ZONE22ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8249 f660 REPEND 8250 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8251 f660 - ifconst EXTRADLMEMORY 8252 f660 - if TMPMEMADDRESS > $1FFF 8253 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8254 f660 - else 8255 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8256 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8257 f660 - endif 8258 f660 - endif ; TMPMEMADDRESS > $1FFF 8259 f660 endif ; EXTRADLMEMORY 8260 f660 8261 f660 1f b0 ZONE23ADDRESS = TMPMEMADDRESS 8262 f660 8263 f660 DLINDEX SET DLINDEX + 1 8264 f660 REPEND 8265 f660 8266 f660 $1880 to $1fff used as zone memory, allowing 15 display objects per zone. 8267 f660 echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 8268 f660 8269 f660 DLHEIGHT 8270 f660 REPEAT WZONECOUNT 8271 f660 07 .byte.b (WZONEHEIGHT-1) 8270 f660 REPEND 8271 f661 07 .byte.b (WZONEHEIGHT-1) 8270 f661 REPEND 8271 f662 07 .byte.b (WZONEHEIGHT-1) 8270 f662 REPEND 8271 f663 07 .byte.b (WZONEHEIGHT-1) 8270 f663 REPEND 8271 f664 07 .byte.b (WZONEHEIGHT-1) 8270 f664 REPEND 8271 f665 07 .byte.b (WZONEHEIGHT-1) 8270 f665 REPEND 8271 f666 07 .byte.b (WZONEHEIGHT-1) 8270 f666 REPEND 8271 f667 07 .byte.b (WZONEHEIGHT-1) 8270 f667 REPEND 8271 f668 07 .byte.b (WZONEHEIGHT-1) 8270 f668 REPEND 8271 f669 07 .byte.b (WZONEHEIGHT-1) 8270 f669 REPEND 8271 f66a 07 .byte.b (WZONEHEIGHT-1) 8270 f66a REPEND 8271 f66b 07 .byte.b (WZONEHEIGHT-1) 8270 f66b REPEND 8271 f66c 07 .byte.b (WZONEHEIGHT-1) 8270 f66c REPEND 8271 f66d 07 .byte.b (WZONEHEIGHT-1) 8270 f66d REPEND 8271 f66e 07 .byte.b (WZONEHEIGHT-1) 8270 f66e REPEND 8271 f66f 07 .byte.b (WZONEHEIGHT-1) 8270 f66f REPEND 8271 f670 07 .byte.b (WZONEHEIGHT-1) 8270 f670 REPEND 8271 f671 07 .byte.b (WZONEHEIGHT-1) 8270 f671 REPEND 8271 f672 07 .byte.b (WZONEHEIGHT-1) 8270 f672 REPEND 8271 f673 07 .byte.b (WZONEHEIGHT-1) 8270 f673 REPEND 8271 f674 07 .byte.b (WZONEHEIGHT-1) 8270 f674 REPEND 8271 f675 07 .byte.b (WZONEHEIGHT-1) 8270 f675 REPEND 8271 f676 07 .byte.b (WZONEHEIGHT-1) 8270 f676 REPEND 8271 f677 07 .byte.b (WZONEHEIGHT-1) 8272 f678 REPEND 8273 f678 8274 f678 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8275 f678 8276 f678 ; a simple guard, than ensures the 7800basic code hasn't 8277 f678 ; spilled into the encryption area... 2310 bytes left in the 7800basic reserved area. 8278 f678 echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 8279 f678 - if (*>$FF7D) 8280 f678 - ERR ; abort the assembly 8281 f678 endif 8282 f678 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8283 f678 8284 f678 - ifconst DEV 8285 f678 - ifnconst ZONEHEIGHT 8286 f678 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8287 f678 - else 8288 f678 - if ZONEHEIGHT = 8 8289 f678 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8290 f678 - else 8291 f678 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8292 f678 - endif 8293 f678 - endif 8294 f678 endif 8295 f678 8296 f678 ; FF7E/FF7F contains the 7800basic crc checksum word 8297 f678 8298 f678 ; FF80 - FFF7 contains the 7800 encryption key 8299 f678 8300 f678 ifnconst bankswitchmode 8301 fff8 ORG $FFF8 8302 fff8 - else 8303 fff8 - ifconst ROM128K 8304 fff8 - ORG $27FF8 8305 fff8 - RORG $FFF8 8306 fff8 - endif 8307 fff8 - ifconst ROM144K 8308 fff8 - ORG $27FF8 8309 fff8 - RORG $FFF8 8310 fff8 - endif 8311 fff8 - ifconst ROM256K 8312 fff8 - ORG $47FF8 8313 fff8 - RORG $FFF8 8314 fff8 - endif 8315 fff8 - ifconst ROM272K 8316 fff8 - ORG $47FF8 8317 fff8 - RORG $FFF8 8318 fff8 - endif 8319 fff8 - ifconst ROM512K 8320 fff8 - ORG $87FF8 8321 fff8 - RORG $FFF8 8322 fff8 - endif 8323 fff8 - ifconst ROM528K 8324 fff8 - ORG $87FF8 8325 fff8 - RORG $FFF8 8326 fff8 - endif 8327 fff8 endif 8328 fff8 8329 fff8 8330 fff8 ff .byte.b $FF ; region verification. $FF=all regions 8331 fff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 8332 fffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 8333 fffa 8334 fffa ;Vectors 8335 fffa 00 f0 .word.w NMI 8336 fffc 72 f5 .word.w START 8337 fffe 67 f0 .word.w IRQ 8338 10000