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