------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_VerticalShooter_Test_continue.78b.asm LEVEL 1 PASS 3 1 10000 ???? ; MACRO.H 2 10000 ???? 3 10000 ???? ; Based on the 2600 macro.h file. 4 10000 ???? ; Macros irrelevant to the 7800 have been removed, and the sleep macro 5 10000 ???? ; has been adapted to give accurate results on the 7800. 6 10000 ???? 7 10000 ???? ; Version 1.0 2019/12/11 (based on the 2600 Version 1.05, 13/NOVEMBER/2003) 8 10000 ???? 9 10000 ???? ; Available macros... 10 10000 ???? ; SLEEP n - sleep for n cycles 11 10000 ???? ; SET_POINTER - load a 16-bit absolute to a 16-bit variable 12 10000 ???? 13 10000 ???? ;------------------------------------------------------------------------------- 14 10000 ???? ; SLEEP duration 15 10000 ???? ; Original author: Thomas Jentzsch 16 10000 ???? ; Inserts code which takes the specified number of cycles to execute. This is 17 10000 ???? ; useful for code where precise timing is required. 18 10000 ???? ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS. 19 10000 ???? ; LEGAL OPCODE VERSION MAY AFFECT FLAGS 20 10000 ???? ; Uses illegal opcode (DASM 2.20.01 onwards). 21 10000 ???? 22 10000 ???? MAC sleep 23 10000 ???? .CYCLES SET {1} 24 10000 ???? 25 10000 ???? IF .CYCLES < 2 26 10000 ???? ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 27 10000 ???? ERR 28 10000 ???? ENDIF 29 10000 ???? 30 10000 ???? IF .CYCLES & 1 31 10000 ???? IFNCONST NO_ILLEGAL_OPCODES 32 10000 ???? nop $80 33 10000 ???? ELSE 34 10000 ???? bit $80 35 10000 ???? ENDIF 36 10000 ???? .CYCLES SET .CYCLES - 3 37 10000 ???? ENDIF 38 10000 ???? 39 10000 ???? REPEAT .CYCLES / 2 40 10000 ???? nop 41 10000 ???? REPEND 42 10000 ???? ENDM ;usage: SLEEP n (n>1) 43 10000 ???? 44 10000 ???? ;------------------------------------------------------- 45 10000 ???? ; SET_POINTER 46 10000 ???? ; Original author: Manuel Rotschkar 47 10000 ???? ; 48 10000 ???? ; Sets a 2 byte RAM pointer to an absolute address. 49 10000 ???? ; 50 10000 ???? ; Usage: SET_POINTER pointer, address 51 10000 ???? ; Example: SET_POINTER SpritePTR, SpriteData 52 10000 ???? ; 53 10000 ???? ; Note: Alters the accumulator, NZ flags 54 10000 ???? ; IN 1: 2 byte RAM location reserved for pointer 55 10000 ???? ; IN 2: absolute address 56 10000 ???? 57 10000 ???? MAC set_pointer 58 10000 ???? .POINTER SET {1} 59 10000 ???? .ADDRESS SET {2} 60 10000 ???? 61 10000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address 62 10000 ???? STA .POINTER ; Store in pointer 63 10000 ???? LDA #>.ADDRESS ; Get Hibyte of Address 64 10000 ???? STA .POINTER+1 ; Store in pointer+1 65 10000 ???? 66 10000 ???? ENDM 67 10000 ???? 68 10000 ???? ; EOF 69 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 70 10000 ???? 71 10000 ???? ; 7800MACRO.H 72 10000 ???? 73 10000 ???? ;------------------------------------------------------- 74 10000 ???? ; BOXCOLLISIONCHECK 75 10000 ???? ; author: Mike Saarna 76 10000 ???? ; 77 10000 ???? ; A general bounding box collision check. compares 2 rectangles of differing size 78 10000 ???? ; and shape for overlap. Carry is set for collision detected, clear for none. 79 10000 ???? ; 80 10000 ???? ; Usage: BOXCOLLISIONCHECK x1var,y1var,w1var,h1var,x2var,y2var,w2var,h2var 81 10000 ???? ; 82 10000 ???? 83 10000 ???? MAC boxcollisioncheck 84 10000 ???? .boxx1 SET {1} 85 10000 ???? .boxy1 SET {2} 86 10000 ???? .boxw1 SET {3} 87 10000 ???? .boxh1 SET {4} 88 10000 ???? .boxx2 SET {5} 89 10000 ???? .boxy2 SET {6} 90 10000 ???? .boxw2 SET {7} 91 10000 ???? .boxh2 SET {8} 92 10000 ???? 93 10000 ???? .DoXCollisionCheck 94 10000 ???? lda .boxx1 ;3 95 10000 ???? cmp .boxx2 ;2 96 10000 ???? bcs .X1isbiggerthanX2 ;2/3 97 10000 ???? .X2isbiggerthanX1 98 10000 ???? adc #.boxw1 ;2 99 10000 ???? cmp .boxx2 ;3 100 10000 ???? bcs .DoYCollisionCheck ;3/2 101 10000 ???? bcc .noboxcollision ;3 102 10000 ???? .X1isbiggerthanX2 103 10000 ???? clc ;2 104 10000 ???? sbc #.boxw2 ;2 105 10000 ???? cmp .boxx2 ;3 106 10000 ???? bcs .noboxcollision ;3/2 107 10000 ???? .DoYCollisionCheck 108 10000 ???? lda .boxy1 ;3 109 10000 ???? cmp .boxy2 ;3 110 10000 ???? bcs .Y1isbiggerthanY2 ;3/2 111 10000 ???? .Y2isbiggerthanY1 112 10000 ???? adc #.boxh1 ;2 113 10000 ???? cmp .boxy2 ;3 114 10000 ???? jmp .checkdone ;6 115 10000 ???? .Y1isbiggerthanY2 116 10000 ???? clc ;2 117 10000 ???? sbc #.boxh2 ;2 118 10000 ???? cmp .boxy2 ;3 119 10000 ???? bcs .noboxcollision ;3/2 120 10000 ???? .boxcollision 121 10000 ???? sec ;2 122 10000 ???? .byte $24 ; hardcoded "BIT [clc opcode]", used to skip over the following clc 123 10000 ???? .noboxcollision 124 10000 ???? clc ;2 125 10000 ???? .checkdone 126 10000 ???? 127 10000 ???? ENDM 128 10000 ???? 129 10000 ???? MAC median3 130 10000 ???? 131 10000 ???? ; A median filter (for smoothing paddle jitter) 132 10000 ???? ; this macro takes the current paddle value, compares it to historic 133 10000 ???? ; values, and replaces the current paddle value with the median. 134 10000 ???? ; 135 10000 ???? ; called as: MEDIAN3 STORAGE CURRENT 136 10000 ???? ; where STORAGE points to 3 consecutive bytes of memory. The first 2 137 10000 ???? ; must be dedicated to this MEDIAN filter. The last 1 is a temp. 138 10000 ???? ; where CURRENT is memory holding the new value you wish to compare to 139 10000 ???? ; the previous values, and update with the median value. 140 10000 ???? ; 141 10000 ???? ; returns: CURRENT (modified to contain median value) 142 10000 ???? ; 143 10000 ???? ; author: Mike Saarna (aka RevEng) 144 10000 ???? 145 10000 ???? .MedianBytes SET {1} 146 10000 ???? .NewValue SET {2} 147 10000 ???? 148 10000 ???? lda #0 149 10000 ???? ldy .NewValue 150 10000 ???? sty .MedianBytes+2 ; put the new value in the most "recent" slot 151 10000 ???? 152 10000 ???? ; build an index from relative size comparisons between our 3 values. 153 10000 ???? cpy .MedianBytes 154 10000 ???? rol 155 10000 ???? cpy .MedianBytes+1 156 10000 ???? rol 157 10000 ???? ldy .MedianBytes 158 10000 ???? cpy .MedianBytes+1 159 10000 ???? rol 160 10000 ???? tay 161 10000 ???? 162 10000 ???? ldx MedianOrderLUT,y ; convert the size-comparison index to an index to the median value 163 10000 ???? lda .MedianBytes,x 164 10000 ???? sta .NewValue ; we replace the new value memory with the median value 165 10000 ???? 166 10000 ???? ; then shift values from "newer" bytes to "older" bytes, leaving the 167 10000 ???? ; newest byte (.MedianBytes+2) empty for next time. 168 10000 ???? lda .MedianBytes+1 169 10000 ???? sta .MedianBytes 170 10000 ???? lda .MedianBytes+2 171 10000 ???? sta .MedianBytes+1 172 10000 ???? ifnconst MedianOrderLUT 173 10000 ???? jmp MedianOrderLUTend 174 10000 ???? MedianOrderLUT ; converts our "comparison index" to an index to the median value 175 10000 ???? .byte 0 ; 0 B2 < B0 < B1 176 10000 ???? .byte 1 ; 1 B2 < B1 < B0 177 10000 ???? .byte 2 ; 2 impossible 178 10000 ???? .byte 2 ; 3 B1 < B2 < B0 179 10000 ???? .byte 2 ; 4 B0 < B2 < B1 180 10000 ???? .byte 2 ; 5 impossible 181 10000 ???? .byte 1 ; 6 B0 < B1 < B2 182 10000 ???? .byte 0 ; 7 B1 < B0 < B2 183 10000 ???? MedianOrderLUTend 184 10000 ???? endif 185 10000 ???? ENDM 186 10000 ???? 187 10000 ???? MAC plotsprite 188 10000 ???? 189 10000 ???? ; A macro version of the plotsprite command. 190 10000 ???? ; This trades off rom space for speed. 191 10000 ???? ; It also doesn't check if the visible screen is displayed or not. 192 10000 ???? ; It has no training wheels. It is all rusty sharp edges. 193 10000 ???? 194 10000 ???? .GFXLabel SET {1} 195 10000 ???? .Palette SET {2} ; constant 196 10000 ???? .SpriteX SET {3} ; variable 197 10000 ???? .SpriteY SET {4} ; variable 198 10000 ???? .ByteOffset SET {5} ; variable 199 10000 ???? 200 10000 ???? lda .SpriteY 201 10000 ???? lsr 202 10000 ???? lsr 203 10000 ???? asr #%11111110 ; ensure carry is clear 204 10000 ???? if WZONEHEIGHT = 16 205 10000 ???? asr #%11111110 ; ensure carry is clear 206 10000 ???? endif 207 10000 ???? 208 10000 ???? tax 209 10000 ???? 210 10000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 211 10000 ???? sta dlpnt 212 10000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 213 10000 ???? sta dlpnt+1 214 10000 ???? 215 10000 ???? ldy dlend,x ; find the next new object position in this zone 216 10000 ???? 217 10000 ???? lda .ByteOffset 218 10000 ???? if {1}_width = 2 219 10000 ???? asl 220 10000 ???? endif 221 10000 ???? if {1}_width = 3 222 10000 ???? asl 223 10000 ???? adc .ByteOffset 224 10000 ???? endif 225 10000 ???? if {1}_width = 4 226 10000 ???? asl 227 10000 ???? asl 228 10000 ???? endif 229 10000 ???? if {1}_width = 5 230 10000 ???? asl 231 10000 ???? asl 232 10000 ???? adc .ByteOffset 233 10000 ???? endif 234 10000 ???? if {1}_width = 6 235 10000 ???? asl 236 10000 ???? adc .ByteOffset 237 10000 ???? asl 238 10000 ???? endif 239 10000 ???? if {1}_width = 7 240 10000 ???? asl 241 10000 ???? adc .ByteOffset 242 10000 ???? asl 243 10000 ???? adc .ByteOffset 244 10000 ???? endif 245 10000 ???? if {1}_width = 8 246 10000 ???? asl 247 10000 ???? asl 248 10000 ???? asl 249 10000 ???? endif 250 10000 ???? if {1}_width = 9 251 10000 ???? asl 252 10000 ???? asl 253 10000 ???? asl 254 10000 ???? adc .ByteOffset 255 10000 ???? endif 256 10000 ???? if {1}_width = 10 257 10000 ???? asl 258 10000 ???? asl 259 10000 ???? adc .ByteOffset 260 10000 ???? asl 261 10000 ???? endif 262 10000 ???? if {1}_width = 11 263 10000 ???? asl 264 10000 ???? asl 265 10000 ???? adc .ByteOffset 266 10000 ???? asl 267 10000 ???? adc .ByteOffset 268 10000 ???? endif 269 10000 ???? if {1}_width = 12 270 10000 ???? asl 271 10000 ???? adc .ByteOffset 272 10000 ???? asl 273 10000 ???? asl 274 10000 ???? endif 275 10000 ???? if {1}_width = 13 276 10000 ???? asl 277 10000 ???? adc .ByteOffset 278 10000 ???? asl 279 10000 ???? asl 280 10000 ???? adc .ByteOffset 281 10000 ???? endif 282 10000 ???? if {1}_width = 14 283 10000 ???? asl 284 10000 ???? adc .ByteOffset 285 10000 ???? asl 286 10000 ???? adc .ByteOffset 287 10000 ???? asl 288 10000 ???? endif 289 10000 ???? 290 10000 ???? adc #<.GFXLabel ; carry is clear via previous asl or asr 291 10000 ???? sta (dlpnt),y ; #1 - low byte object address 292 10000 ???? 293 10000 ???? iny 294 10000 ???? 295 10000 ???? lda #({1}_mode | %01000000) 296 10000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 297 10000 ???? 298 10000 ???? iny 299 10000 ???? 300 10000 ???? lda .SpriteY 301 10000 ???? and #(WZONEHEIGHT - 1) 302 10000 ???? cmp #1 ; clear carry if our sprite is just in this zone 303 10000 ???? ora #>.GFXLabel 304 10000 ???? sta (dlpnt),y ; #3 - hi byte object address 305 10000 ???? 306 10000 ???? iny 307 10000 ???? 308 10000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 309 10000 ???? sta (dlpnt),y ; #4 - palette|width 310 10000 ???? 311 10000 ???? iny 312 10000 ???? 313 10000 ???? lda .SpriteX 314 10000 ???? sta (dlpnt),y ; #5 - x object position 315 10000 ???? 316 10000 ???? iny 317 10000 ???? sty dlend,x 318 10000 ???? 319 10000 ???? ifconst ALWAYSTERMINATE 320 10000 ???? iny 321 10000 ???? lda #0 322 10000 ???? sta (dlpnt),y 323 10000 ???? endif 324 10000 ???? 325 10000 ???? bcc .PLOTSPRITEend 326 10000 ???? 327 10000 ???? inx ; next zone 328 10000 ???? 329 10000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 330 10000 ???? sta dlpnt 331 10000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 332 10000 ???? sta dlpnt+1 333 10000 ???? 334 10000 ???? ldy dlend,x ; find the next new object position in this zone 335 10000 ???? 336 10000 ???? lda .ByteOffset 337 10000 ???? if {1}_width = 1 338 10000 ???? clc 339 10000 ???? endif 340 10000 ???? if {1}_width = 2 341 10000 ???? asl ; carry clear 342 10000 ???? endif 343 10000 ???? if {1}_width = 3 344 10000 ???? asl ; carry clear 345 10000 ???? adc .ByteOffset 346 10000 ???? endif 347 10000 ???? if {1}_width = 4 348 10000 ???? asl ; carry clear 349 10000 ???? asl 350 10000 ???? endif 351 10000 ???? if {1}_width = 5 352 10000 ???? asl ; carry clear 353 10000 ???? asl 354 10000 ???? adc .ByteOffset 355 10000 ???? endif 356 10000 ???? if {1}_width = 6 357 10000 ???? asl ; carry clear 358 10000 ???? adc .ByteOffset 359 10000 ???? asl 360 10000 ???? endif 361 10000 ???? if {1}_width = 7 362 10000 ???? asl ; carry clear 363 10000 ???? adc .ByteOffset 364 10000 ???? asl 365 10000 ???? endif 366 10000 ???? if {1}_width = 8 367 10000 ???? asl ; carry clear 368 10000 ???? asl 369 10000 ???? asl 370 10000 ???? endif 371 10000 ???? if {1}_width = 9 372 10000 ???? asl ; carry clear 373 10000 ???? asl 374 10000 ???? asl 375 10000 ???? adc .ByteOffset 376 10000 ???? endif 377 10000 ???? if {1}_width = 10 378 10000 ???? asl ; carry clear 379 10000 ???? asl 380 10000 ???? adc .ByteOffset 381 10000 ???? asl 382 10000 ???? endif 383 10000 ???? if {1}_width = 11 384 10000 ???? asl ; carry clear 385 10000 ???? asl 386 10000 ???? adc .ByteOffset 387 10000 ???? asl 388 10000 ???? adc .ByteOffset 389 10000 ???? endif 390 10000 ???? if {1}_width = 12 391 10000 ???? asl ; carry clear 392 10000 ???? adc .ByteOffset 393 10000 ???? asl 394 10000 ???? asl 395 10000 ???? endif 396 10000 ???? if {1}_width = 13 397 10000 ???? asl ; carry clear 398 10000 ???? adc .ByteOffset 399 10000 ???? asl 400 10000 ???? asl 401 10000 ???? adc .ByteOffset 402 10000 ???? endif 403 10000 ???? if {1}_width = 14 404 10000 ???? asl ; carry clear 405 10000 ???? adc .ByteOffset 406 10000 ???? asl 407 10000 ???? adc .ByteOffset 408 10000 ???? asl 409 10000 ???? endif 410 10000 ???? 411 10000 ???? adc #<.GFXLabel 412 10000 ???? sta (dlpnt),y ; #1 - low byte object address 413 10000 ???? 414 10000 ???? iny 415 10000 ???? 416 10000 ???? lda #({1}_mode | %01000000) 417 10000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 418 10000 ???? 419 10000 ???? iny 420 10000 ???? 421 10000 ???? lda .SpriteY 422 10000 ???? and #(WZONEHEIGHT - 1) 423 10000 ???? ora #>(.GFXLabel - (WZONEHEIGHT * 256)) ; start in the dma hole 424 10000 ???? sta (dlpnt),y ; #3 - hi byte object address 425 10000 ???? 426 10000 ???? iny 427 10000 ???? 428 10000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 429 10000 ???? sta (dlpnt),y ; #4 - palette|width 430 10000 ???? 431 10000 ???? iny 432 10000 ???? 433 10000 ???? lda .SpriteX 434 10000 ???? sta (dlpnt),y ; #5 - x object position 435 10000 ???? 436 10000 ???? iny 437 10000 ???? sty dlend,x 438 10000 ???? 439 10000 ???? ifconst ALWAYSTERMINATE 440 10000 ???? iny 441 10000 ???? lda #0 442 10000 ???? sta (dlpnt),y 443 10000 ???? endif 444 10000 ???? 445 10000 ???? .PLOTSPRITEend 446 10000 ???? ENDM 447 10000 ???? 448 10000 ???? ; 449 10000 ???? ; speakjet.inc 450 10000 ???? ; 451 10000 ???? ; 452 10000 ???? ; AtariVox Speech Synth Driver 453 10000 ???? ; 454 10000 ???? ; By Alex Herbert, 2004 455 10000 ???? ; 456 10000 ???? 457 10000 ???? 458 10000 ???? 459 10000 ???? 460 10000 ???? ; Constants 461 10000 ???? 462 10000 ???? 463 10000 ???? 00 01 SERIAL_OUTMASK equ $01 464 10000 ???? 00 02 SERIAL_RDYMASK equ $02 465 10000 ???? 466 10000 ???? 467 10000 ???? 468 10000 ???? ; Macros 469 10000 ???? 470 10000 ???? mac spkout 471 10000 ???? 472 10000 ???? ; check buffer-full status 473 10000 ???? lda SWCHA 474 10000 ???? and #SERIAL_RDYMASK 475 10000 ???? beq .speech_done 476 10000 ???? 477 10000 ???? ; get next speech byte 478 10000 ???? ldy #$00 479 10000 ???? lda (speech_addr),y 480 10000 ???? 481 10000 ???? ; invert data and check for end of string 482 10000 ???? eor #$ff 483 10000 ???? ;sta BACKGRND ; debug - uncomment to flash the background color with vox data 484 10000 ???? beq .speech_done 485 10000 ???? sta {1} 486 10000 ???? 487 10000 ???? ; increment speech pointer 488 10000 ???? inc speech_addr 489 10000 ???? bne .incaddr_skip 490 10000 ???? inc speech_addr+1 491 10000 ???? .incaddr_skip 492 10000 ???? 493 10000 ???? ; output byte as serial data 494 10000 ???? 495 10000 ???? sec ; start bit 496 10000 ???? .byteout_loop 497 10000 ???? ; put carry flag into bit 0 of SWACNT, perserving other bits 498 10000 ???? lda SWACNT ; 4 499 10000 ???? and #$fe ; 2 6 500 10000 ???? adc #$00 ; 2 8 501 10000 ???? sta SWACNT ; 4 12 502 10000 ???? 503 10000 ???? ; 10 bits sent? (1 start bit, 8 data bits, 1 stop bit) 504 10000 ???? cpy #$09 ; 2 14 505 10000 ???? beq .speech_done ; 2 16 506 10000 ???? iny ; 2 18 507 10000 ???? 508 10000 ???? ; the 7800 is 1.5x faster than the 2600. Waste more cycles here 509 10000 ???? ; to match the original baud rate... 510 10000 ???? ;ldx #$07 ; 2600 511 10000 ???? ldx #$0D 512 10000 ???? 513 10000 ???? .delay_loop 514 10000 ???? dex ; 515 10000 ???? bne .delay_loop ; 36 54 516 10000 ???? 517 10000 ???? ; shift next data bit into carry 518 10000 ???? lsr {1} ; 5 59 519 10000 ???? 520 10000 ???? ; and loop (branch always taken) 521 10000 ???? bpl .byteout_loop ; 3 62 cycles for loop 522 10000 ???? 523 10000 ???? .speech_done 524 10000 ???? 525 10000 ???? endm 526 10000 ???? 527 10000 ???? 528 10000 ???? mac speak 529 10000 ???? 530 10000 ???? lda #<{1} 531 10000 ???? sta speech_addr 532 10000 ???? lda #>{1} 533 10000 ???? sta speech_addr+1 534 10000 ???? 535 10000 ???? endm 536 10000 ???? 537 10000 ???? 538 10000 ???? 539 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 540 10000 ???? 541 10000 ???? processor 6502 542 10000 ???? ------- FILE 7800basic.h LEVEL 2 PASS 3 0 10000 ???? include "7800basic.h" 1 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 10000 ???? 3 10000 ???? processor 6502 ------- FILE 7800.h LEVEL 3 PASS 3 0 10000 ???? include "7800.h" 1 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 10000 ???? 3 10000 ???? ; 7800.h 4 10000 ???? ; Version 1.0, 2019/12/13 5 10000 ???? 6 10000 ???? ; This file defines hardware registers and memory mapping for the 7 10000 ???? ; Atari 7800. It is distributed as a companion machine-specific support package 8 10000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are 9 10000 ???? ; available at https://github.com/dasm-assembler/dasm 10 10000 ???? 11 10000 ???? 12 10000 ???? ; ******************** 7800 Hardware Adresses *************************** 13 10000 ???? ; 14 10000 ???? ; MEMORY MAP USAGE OF THE 7800 15 10000 ???? ; 16 10000 ???? ; 00 - 1F TIA REGISTERS 17 10000 ???? ; 20 - 3F MARIA REGISTERS 18 10000 ???? ; 40 - FF RAM block 0 (zero page) 19 10000 ???? ; 100 - 11F TIA (mirror of 0000-001f) 20 10000 ???? ; 120 - 13F MARIA (mirror of 0020-003f) 21 10000 ???? ; 140 - 1FF RAM block 1 (stack) 22 10000 ???? ; 200 - 21F TIA (mirror of 0000-001f) 23 10000 ???? ; 220 - 23F MARIA (mirror of 0020-003f) 24 10000 ???? ; 240 - 27F ??? 25 10000 ???? ; 280 - 2FF RIOT I/O ports and timers 26 10000 ???? ; 300 - 31F TIA (mirror of 0000-001f) 27 10000 ???? ; 320 - 33F MARIA (mirror of 0020-003f) 28 10000 ???? ; 340 - 3FF ??? 29 10000 ???? ; 400 - 47F unused address space 30 10000 ???? ; 480 - 4FF RIOT RAM 31 10000 ???? ; 500 - 57F unused address space 32 10000 ???? ; 580 - 5FF RIOT RAM (mirror of 0480-04ff) 33 10000 ???? ; 600 - 17FF unused address space 34 10000 ???? ; 1800 - 203F RAM 35 10000 ???? ; 2040 - 20FF RAM block 0 (mirror of 0000-001f) 36 10000 ???? ; 2100 - 213F RAM 37 10000 ???? ; 2140 - 21FF RAM block 1 (mirror of 0140-01ff) 38 10000 ???? ; 2200 - 27FF RAM 39 10000 ???? ; 2800 - 2FFF mirror of 1800-27ff 40 10000 ???? ; 3000 - 3FFF unused address space 41 10000 ???? ; 4000 - FF7F potential cartridge address space 42 10000 ???? ; FF80 - FFF9 RESERVED FOR ENCRYPTION 43 10000 ???? ; FFFA - FFFF 6502 VECTORS 44 10000 ???? 45 10000 ???? 46 10000 ???? ;****** 00-1F ********* TIA REGISTERS ****************** 47 10000 ???? 48 10000 ???? 00 01 INPTCTRL = $01 ;Input control. In same address space as TIA. write-only 49 10000 ???? 00 01 VBLANK = $01 ;VBLANK. D7=1:dump paddle caps to ground. write-only 50 10000 ???? 00 08 INPT0 = $08 ;Paddle Control Input 0 read-only 51 10000 ???? 00 09 INPT1 = $09 ;Paddle Control Input 1 read-only 52 10000 ???? 00 0a INPT2 = $0A ;Paddle Control Input 2 read-only 53 10000 ???? 00 0b INPT3 = $0B ;Paddle Control Input 3 read-only 54 10000 ???? 55 10000 ???? ; ** some common alternate names for INPT0/1/2/3 56 10000 ???? 00 08 INPT4B = $08 ;Joystick 0 Fire 1 read-only 57 10000 ???? 00 09 INPT4A = $09 ;Joystick 0 Fire 1 read-only 58 10000 ???? 00 0a INPT5B = $0A ;Joystick 1 Fire 0 read-only 59 10000 ???? 00 0b INPT5A = $0B ;Joystick 1 Fire 1 read-only 60 10000 ???? 00 08 INPT4R = $08 ;Joystick 0 Fire 1 read-only 61 10000 ???? 00 09 INPT4L = $09 ;Joystick 0 Fire 1 read-only 62 10000 ???? 00 0a INPT5R = $0A ;Joystick 1 Fire 0 read-only 63 10000 ???? 00 0b INPT5L = $0B ;Joystick 1 Fire 1 read-only 64 10000 ???? 65 10000 ???? 00 0c INPT4 = $0C ;Player 0 Fire Button Input read-only 66 10000 ???? 00 0d INPT5 = $0D ;Player 1 Fire Button Input read-only 67 10000 ???? 68 10000 ???? 00 15 AUDC0 = $15 ;Audio Control Channel 0 write-only 69 10000 ???? 00 16 AUDC1 = $16 ;Audio Control Channel 1 write-only 70 10000 ???? 00 17 AUDF0 = $17 ;Audio Frequency Channel 0 write-only 71 10000 ???? 00 18 AUDF1 = $18 ;Audio Frequency Channel 1 write-only 72 10000 ???? 00 19 AUDV0 = $19 ;Audio Volume Channel 0 write-only 73 10000 ???? 00 1a AUDV1 = $1A ;Audio Volume Channel 1 write-only 74 10000 ???? 75 10000 ???? ;****** 20-3F ********* MARIA REGISTERS *************** 76 10000 ???? 77 10000 ???? 00 20 BACKGRND = $20 ;Background Color write-only 78 10000 ???? 00 21 P0C1 = $21 ;Palette 0 - Color 1 write-only 79 10000 ???? 00 22 P0C2 = $22 ;Palette 0 - Color 2 write-only 80 10000 ???? 00 23 P0C3 = $23 ;Palette 0 - Color 3 write-only 81 10000 ???? 00 24 WSYNC = $24 ;Wait For Sync write-only 82 10000 ???? 00 25 P1C1 = $25 ;Palette 1 - Color 1 write-only 83 10000 ???? 00 26 P1C2 = $26 ;Palette 1 - Color 2 write-only 84 10000 ???? 00 27 P1C3 = $27 ;Palette 1 - Color 3 write-only 85 10000 ???? 00 28 MSTAT = $28 ;Maria Status read-only 86 10000 ???? 00 29 P2C1 = $29 ;Palette 2 - Color 1 write-only 87 10000 ???? 00 2a P2C2 = $2A ;Palette 2 - Color 2 write-only 88 10000 ???? 00 2b P2C3 = $2B ;Palette 2 - Color 3 write-only 89 10000 ???? 00 2c DPPH = $2C ;Display List List Pointer High write-only 90 10000 ???? 00 2d P3C1 = $2D ;Palette 3 - Color 1 write-only 91 10000 ???? 00 2e P3C2 = $2E ;Palette 3 - Color 2 write-only 92 10000 ???? 00 2f P3C3 = $2F ;Palette 3 - Color 3 write-only 93 10000 ???? 00 30 DPPL = $30 ;Display List List Pointer Low write-only 94 10000 ???? 00 31 P4C1 = $31 ;Palette 4 - Color 1 write-only 95 10000 ???? 00 32 P4C2 = $32 ;Palette 4 - Color 2 write-only 96 10000 ???? 00 33 P4C3 = $33 ;Palette 4 - Color 3 write-only 97 10000 ???? 00 34 CHARBASE = $34 ;Character Base Address write-only 98 10000 ???? 00 34 CHBASE = $34 ;Character Base Address write-only 99 10000 ???? 00 35 P5C1 = $35 ;Palette 5 - Color 1 write-only 100 10000 ???? 00 36 P5C2 = $36 ;Palette 5 - Color 2 write-only 101 10000 ???? 00 37 P5C3 = $37 ;Palette 5 - Color 3 write-only 102 10000 ???? 00 38 OFFSET = $38 ;Unused - Store zero here write-only 103 10000 ???? 00 39 P6C1 = $39 ;Palette 6 - Color 1 write-only 104 10000 ???? 00 3a P6C2 = $3A ;Palette 6 - Color 2 write-only 105 10000 ???? 00 3b P6C3 = $3B ;Palette 6 - Color 3 write-only 106 10000 ???? 00 3c CTRL = $3C ;Maria Control Register write-only 107 10000 ???? 00 3d P7C1 = $3D ;Palette 7 - Color 1 write-only 108 10000 ???? 00 3e P7C2 = $3E ;Palette 7 - Color 2 write-only 109 10000 ???? 00 3f P7C3 = $3F ;Palette 7 - Color 3 write-only 110 10000 ???? 111 10000 ???? 112 10000 ???? ;****** 280-2FF ******* PIA PORTS AND TIMERS ************ 113 10000 ???? 114 10000 ???? 02 80 SWCHA = $280 ;P0+P1 Joystick Directional Input read-write 115 10000 ???? 02 81 CTLSWA = $281 ;I/O Control for SCHWA read-write 116 10000 ???? 02 81 SWACNT = $281 ;VCS name for above read-write 117 10000 ???? 02 82 SWCHB = $282 ;Console Switches read-write 118 10000 ???? 02 83 CTLSWB = $283 ;I/O Control for SCHWB read-write 119 10000 ???? 02 83 SWBCNT = $283 ;VCS name for above read-write 120 10000 ???? 121 10000 ???? 02 84 INTIM = $284 ;Interval Timer Read read-only 122 10000 ???? 02 94 TIM1T = $294 ;Set 1 CLK Interval (838 nsec/interval) write-only 123 10000 ???? 02 95 TIMINT = $295 ;Interval Timer Interrupt read-only 124 10000 ???? 02 95 TIM8T = $295 ;Set 8 CLK Interval (6.7 usec/interval) write-only 125 10000 ???? 02 96 TIM64T = $296 ;Set 64 CLK Interval (63.6 usec/interval) write-only 126 10000 ???? 02 97 T1024T = $297 ;Set 1024 CLK Interval (858.2 usec/interval) write-only 127 10000 ???? 02 9e TIM64TI = $29E ;Interrupt timer 64T write-only 128 10000 ???? 129 10000 ???? ;XM 130 10000 ???? 04 70 XCTRL = $470 ; 7=YM2151 6=RAM@6k 5=RAM@4k 4=pokey@450 3=hsc 2=cart 1=RoF_bank1 0=RoF_bank2 131 10000 ???? 04 70 XCTRL1 = $470 132 10000 ???? 04 78 XCTRL2 = $478 133 10000 ???? 04 7c XCTRL3 = $47c 134 10000 ???? 04 71 XCTRL4 = $471 135 10000 ???? 04 72 XCTRL5 = $472 136 10000 ???? 137 10000 ???? ; Pokey register relative locations, since its base may be different 138 10000 ???? ; depending on the hardware. 139 10000 ???? 00 00 PAUDF0 = $0 ; extra audio channels and frequencies 140 10000 ???? 00 01 PAUDC0 = $1 141 10000 ???? 00 02 PAUDF1 = $2 142 10000 ???? 00 03 PAUDC1 = $3 143 10000 ???? 00 04 PAUDF2 = $4 144 10000 ???? 00 05 PAUDC2 = $5 145 10000 ???? 00 06 PAUDF3 = $6 146 10000 ???? 00 07 PAUDC3 = $7 147 10000 ???? 00 08 PAUDCTL = $8 ; Audio Control 148 10000 ???? 00 09 PSTIMER = $9 149 10000 ???? 00 0a PRANDOM = $A ; 17 bit polycounter pseudo random 150 10000 ???? 00 0f PSKCTL = $F ; Serial Port control ------- FILE 7800basic.h ------- FILE 7800basic_variable_redefs.h LEVEL 3 PASS 3 0 10000 ???? include "7800basic_variable_redefs.h" 1 10000 ???? ; This file contains variable mapping and other information for the current project. 2 10000 ???? 3 10000 ???? 00 00 vertical_shooting_laser_tallsprite_01_mode = $00 4 10000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width_twoscompliment = $00 5 10000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width = $00 6 10000 ???? 00 00 vertical_shooting_laser_tallsprite_00_mode = $00 7 10000 ???? 00 1f vertical_shooting_laser_tallsprite_00_width_twoscompliment = $1f 8 10000 ???? 00 01 vertical_shooting_laser_tallsprite_00_width = $01 9 10000 ???? 00 00 vertical_shooting_laser_mode = $00 10 10000 ???? 00 1f vertical_shooting_laser_width_twoscompliment = $1f 11 10000 ???? 00 01 vertical_shooting_laser_width = $01 12 10000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_mode = $00 13 10000 ???? 00 0c vertical_shooting_explosion_10_tallsprite_00_width_twoscompliment = $0c 14 10000 ???? 00 14 vertical_shooting_explosion_10_tallsprite_00_width = $14 15 10000 ???? 00 00 vertical_shooting_explosion_10_mode = $00 16 10000 ???? 00 0c vertical_shooting_explosion_10_width_twoscompliment = $0c 17 10000 ???? 00 14 vertical_shooting_explosion_10_width = $14 18 10000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_mode = $00 19 10000 ???? 00 0c vertical_shooting_explosion_09_tallsprite_00_width_twoscompliment = $0c 20 10000 ???? 00 14 vertical_shooting_explosion_09_tallsprite_00_width = $14 21 10000 ???? 00 00 vertical_shooting_explosion_09_mode = $00 22 10000 ???? 00 0c vertical_shooting_explosion_09_width_twoscompliment = $0c 23 10000 ???? 00 14 vertical_shooting_explosion_09_width = $14 24 10000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_mode = $00 25 10000 ???? 00 0c vertical_shooting_explosion_08_tallsprite_00_width_twoscompliment = $0c 26 10000 ???? 00 14 vertical_shooting_explosion_08_tallsprite_00_width = $14 27 10000 ???? 00 00 vertical_shooting_explosion_08_mode = $00 28 10000 ???? 00 0c vertical_shooting_explosion_08_width_twoscompliment = $0c 29 10000 ???? 00 14 vertical_shooting_explosion_08_width = $14 30 10000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_mode = $00 31 10000 ???? 00 0c vertical_shooting_explosion_07_tallsprite_00_width_twoscompliment = $0c 32 10000 ???? 00 14 vertical_shooting_explosion_07_tallsprite_00_width = $14 33 10000 ???? 00 00 vertical_shooting_explosion_07_mode = $00 34 10000 ???? 00 0c vertical_shooting_explosion_07_width_twoscompliment = $0c 35 10000 ???? 00 14 vertical_shooting_explosion_07_width = $14 36 10000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_mode = $00 37 10000 ???? 00 1e vertical_shooting_explosion_06_tallsprite_00_width_twoscompliment = $1e 38 10000 ???? 00 02 vertical_shooting_explosion_06_tallsprite_00_width = $02 39 10000 ???? 00 00 vertical_shooting_explosion_06_mode = $00 40 10000 ???? 00 1e vertical_shooting_explosion_06_width_twoscompliment = $1e 41 10000 ???? 00 02 vertical_shooting_explosion_06_width = $02 42 10000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_mode = $00 43 10000 ???? 00 1e vertical_shooting_explosion_05_tallsprite_00_width_twoscompliment = $1e 44 10000 ???? 00 02 vertical_shooting_explosion_05_tallsprite_00_width = $02 45 10000 ???? 00 00 vertical_shooting_explosion_05_mode = $00 46 10000 ???? 00 1e vertical_shooting_explosion_05_width_twoscompliment = $1e 47 10000 ???? 00 02 vertical_shooting_explosion_05_width = $02 48 10000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_mode = $00 49 10000 ???? 00 1e vertical_shooting_explosion_04_tallsprite_00_width_twoscompliment = $1e 50 10000 ???? 00 02 vertical_shooting_explosion_04_tallsprite_00_width = $02 51 10000 ???? 00 00 vertical_shooting_explosion_04_mode = $00 52 10000 ???? 00 1e vertical_shooting_explosion_04_width_twoscompliment = $1e 53 10000 ???? 00 02 vertical_shooting_explosion_04_width = $02 54 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_mode = $00 55 10000 ???? 00 1e vertical_shooting_explosion_03_tallsprite_00_width_twoscompliment = $1e 56 10000 ???? 00 02 vertical_shooting_explosion_03_tallsprite_00_width = $02 57 10000 ???? 00 00 vertical_shooting_explosion_03_mode = $00 58 10000 ???? 00 1e vertical_shooting_explosion_03_width_twoscompliment = $1e 59 10000 ???? 00 02 vertical_shooting_explosion_03_width = $02 60 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_mode = $00 61 10000 ???? 00 1e vertical_shooting_explosion_02_tallsprite_00_width_twoscompliment = $1e 62 10000 ???? 00 02 vertical_shooting_explosion_02_tallsprite_00_width = $02 63 10000 ???? 00 00 vertical_shooting_explosion_02_mode = $00 64 10000 ???? 00 1e vertical_shooting_explosion_02_width_twoscompliment = $1e 65 10000 ???? 00 02 vertical_shooting_explosion_02_width = $02 66 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_mode = $00 67 10000 ???? 00 1e vertical_shooting_explosion_01_tallsprite_00_width_twoscompliment = $1e 68 10000 ???? 00 02 vertical_shooting_explosion_01_tallsprite_00_width = $02 69 10000 ???? 00 00 vertical_shooting_explosion_01_mode = $00 70 10000 ???? 00 1e vertical_shooting_explosion_01_width_twoscompliment = $1e 71 10000 ???? 00 02 vertical_shooting_explosion_01_width = $02 72 10000 ???? 00 00 vertical_shooting_1up_mode = $00 73 10000 ???? 00 1e vertical_shooting_1up_width_twoscompliment = $1e 74 10000 ???? 00 02 vertical_shooting_1up_width = $02 75 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_mode = $00 76 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_width_twoscompliment = $00 77 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_width = $00 78 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_mode = $00 79 10000 ???? 00 1e vertical_shooting_enemy01_tallsprite_00_width_twoscompliment = $1e 80 10000 ???? 00 02 vertical_shooting_enemy01_tallsprite_00_width = $02 81 10000 ???? 00 00 vertical_shooting_enemy01_mode = $00 82 10000 ???? 00 1e vertical_shooting_enemy01_width_twoscompliment = $1e 83 10000 ???? 00 02 vertical_shooting_enemy01_width = $02 84 10000 ???? 00 00 vertical_shooting_powerup_mode = $00 85 10000 ???? 00 1e vertical_shooting_powerup_width_twoscompliment = $1e 86 10000 ???? 00 02 vertical_shooting_powerup_width = $02 87 10000 ???? 00 00 vertical_shooting_enemyshot_mode = $00 88 10000 ???? 00 1f vertical_shooting_enemyshot_width_twoscompliment = $1f 89 10000 ???? 00 01 vertical_shooting_enemyshot_width = $01 90 10000 ???? 00 00 vertical_shooting_bullet_mode = $00 91 10000 ???? 00 1f vertical_shooting_bullet_width_twoscompliment = $1f 92 10000 ???? 00 01 vertical_shooting_bullet_width = $01 93 10000 ???? 00 00 vertical_shooting_ship_tallsprite_00_mode = $00 94 10000 ???? 00 1e vertical_shooting_ship_tallsprite_00_width_twoscompliment = $1e 95 10000 ???? 00 02 vertical_shooting_ship_tallsprite_00_width = $02 96 10000 ???? 00 00 vertical_shooting_ship_mode = $00 97 10000 ???? 00 1e vertical_shooting_ship_width_twoscompliment = $1e 98 10000 ???? 00 02 vertical_shooting_ship_width = $02 99 10000 ???? 00 00 vertical_shooting_font_mode = $00 100 10000 ???? 00 13 vertical_shooting_font_width_twoscompliment = $13 101 10000 ???? 00 2d vertical_shooting_font_width = $2d 102 10000 ???? 00 90 sfx_explosion_length = .skipL0266-sfx_explosion 103 10000 ???? 104 10000 ???? 00 30 sfx_plainlaser_length = .skipL0265-sfx_plainlaser 105 10000 ???? 106 10000 ???? 00 54 sfx_pulsecannon_length = .skipL0264-sfx_pulsecannon 107 10000 ???? 108 10000 ???? 00 36 sfx_bling_length = .skipL0263-sfx_bling 109 10000 ???? 110 10000 ???? 00 04 vertical_shooting_laser_tallsprite_00_color3 = $04 111 10000 ???? 00 42 vertical_shooting_laser_tallsprite_00_color2 = $42 112 10000 ???? 00 0f vertical_shooting_laser_tallsprite_00_color1 = $0f 113 10000 ???? 00 00 vertical_shooting_laser_tallsprite_00_color0 = $00 114 10000 ???? 00 04 vertical_shooting_laser_color3 = $04 115 10000 ???? 00 42 vertical_shooting_laser_color2 = $42 116 10000 ???? 00 0f vertical_shooting_laser_color1 = $0f 117 10000 ???? 00 00 vertical_shooting_laser_color0 = $00 118 10000 ???? 00 33 vertical_shooting_explosion_10_tallsprite_00_color3 = $33 119 10000 ???? 00 2b vertical_shooting_explosion_10_tallsprite_00_color2 = $2b 120 10000 ???? 00 36 vertical_shooting_explosion_10_tallsprite_00_color1 = $36 121 10000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_color0 = $00 122 10000 ???? 00 33 vertical_shooting_explosion_10_color3 = $33 123 10000 ???? 00 2b vertical_shooting_explosion_10_color2 = $2b 124 10000 ???? 00 36 vertical_shooting_explosion_10_color1 = $36 125 10000 ???? 00 00 vertical_shooting_explosion_10_color0 = $00 126 10000 ???? 00 33 vertical_shooting_explosion_09_tallsprite_00_color3 = $33 127 10000 ???? 00 2b vertical_shooting_explosion_09_tallsprite_00_color2 = $2b 128 10000 ???? 00 36 vertical_shooting_explosion_09_tallsprite_00_color1 = $36 129 10000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_color0 = $00 130 10000 ???? 00 33 vertical_shooting_explosion_09_color3 = $33 131 10000 ???? 00 2b vertical_shooting_explosion_09_color2 = $2b 132 10000 ???? 00 36 vertical_shooting_explosion_09_color1 = $36 133 10000 ???? 00 00 vertical_shooting_explosion_09_color0 = $00 134 10000 ???? 00 33 vertical_shooting_explosion_08_tallsprite_00_color3 = $33 135 10000 ???? 00 2b vertical_shooting_explosion_08_tallsprite_00_color2 = $2b 136 10000 ???? 00 36 vertical_shooting_explosion_08_tallsprite_00_color1 = $36 137 10000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_color0 = $00 138 10000 ???? 00 33 vertical_shooting_explosion_08_color3 = $33 139 10000 ???? 00 2b vertical_shooting_explosion_08_color2 = $2b 140 10000 ???? 00 36 vertical_shooting_explosion_08_color1 = $36 141 10000 ???? 00 00 vertical_shooting_explosion_08_color0 = $00 142 10000 ???? 00 33 vertical_shooting_explosion_07_tallsprite_00_color3 = $33 143 10000 ???? 00 2b vertical_shooting_explosion_07_tallsprite_00_color2 = $2b 144 10000 ???? 00 36 vertical_shooting_explosion_07_tallsprite_00_color1 = $36 145 10000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_color0 = $00 146 10000 ???? 00 33 vertical_shooting_explosion_07_color3 = $33 147 10000 ???? 00 2b vertical_shooting_explosion_07_color2 = $2b 148 10000 ???? 00 36 vertical_shooting_explosion_07_color1 = $36 149 10000 ???? 00 00 vertical_shooting_explosion_07_color0 = $00 150 10000 ???? 00 33 vertical_shooting_explosion_06_tallsprite_00_color3 = $33 151 10000 ???? 00 2b vertical_shooting_explosion_06_tallsprite_00_color2 = $2b 152 10000 ???? 00 36 vertical_shooting_explosion_06_tallsprite_00_color1 = $36 153 10000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_color0 = $00 154 10000 ???? 00 33 vertical_shooting_explosion_06_color3 = $33 155 10000 ???? 00 2b vertical_shooting_explosion_06_color2 = $2b 156 10000 ???? 00 36 vertical_shooting_explosion_06_color1 = $36 157 10000 ???? 00 00 vertical_shooting_explosion_06_color0 = $00 158 10000 ???? 00 33 vertical_shooting_explosion_05_tallsprite_00_color3 = $33 159 10000 ???? 00 2b vertical_shooting_explosion_05_tallsprite_00_color2 = $2b 160 10000 ???? 00 36 vertical_shooting_explosion_05_tallsprite_00_color1 = $36 161 10000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_color0 = $00 162 10000 ???? 00 33 vertical_shooting_explosion_05_color3 = $33 163 10000 ???? 00 2b vertical_shooting_explosion_05_color2 = $2b 164 10000 ???? 00 36 vertical_shooting_explosion_05_color1 = $36 165 10000 ???? 00 00 vertical_shooting_explosion_05_color0 = $00 166 10000 ???? 00 33 vertical_shooting_explosion_04_tallsprite_00_color3 = $33 167 10000 ???? 00 36 vertical_shooting_explosion_04_tallsprite_00_color2 = $36 168 10000 ???? 00 2b vertical_shooting_explosion_04_tallsprite_00_color1 = $2b 169 10000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_color0 = $00 170 10000 ???? 00 33 vertical_shooting_explosion_04_color3 = $33 171 10000 ???? 00 36 vertical_shooting_explosion_04_color2 = $36 172 10000 ???? 00 2b vertical_shooting_explosion_04_color1 = $2b 173 10000 ???? 00 00 vertical_shooting_explosion_04_color0 = $00 174 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color3 = 0 175 10000 ???? 00 36 vertical_shooting_explosion_03_tallsprite_00_color2 = $36 176 10000 ???? 00 2b vertical_shooting_explosion_03_tallsprite_00_color1 = $2b 177 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color0 = $00 178 10000 ???? 00 00 vertical_shooting_explosion_03_color3 = 0 179 10000 ???? 00 36 vertical_shooting_explosion_03_color2 = $36 180 10000 ???? 00 2b vertical_shooting_explosion_03_color1 = $2b 181 10000 ???? 00 00 vertical_shooting_explosion_03_color0 = $00 182 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color3 = 0 183 10000 ???? 00 36 vertical_shooting_explosion_02_tallsprite_00_color2 = $36 184 10000 ???? 00 2b vertical_shooting_explosion_02_tallsprite_00_color1 = $2b 185 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color0 = $00 186 10000 ???? 00 00 vertical_shooting_explosion_02_color3 = 0 187 10000 ???? 00 36 vertical_shooting_explosion_02_color2 = $36 188 10000 ???? 00 2b vertical_shooting_explosion_02_color1 = $2b 189 10000 ???? 00 00 vertical_shooting_explosion_02_color0 = $00 190 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color3 = 0 191 10000 ???? 00 2b vertical_shooting_explosion_01_tallsprite_00_color2 = $2b 192 10000 ???? 00 36 vertical_shooting_explosion_01_tallsprite_00_color1 = $36 193 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color0 = $00 194 10000 ???? 00 00 vertical_shooting_explosion_01_color3 = 0 195 10000 ???? 00 2b vertical_shooting_explosion_01_color2 = $2b 196 10000 ???? 00 36 vertical_shooting_explosion_01_color1 = $36 197 10000 ???? 00 00 vertical_shooting_explosion_01_color0 = $00 198 10000 ???? 00 0f vertical_shooting_1up_color3 = $0f 199 10000 ???? 00 42 vertical_shooting_1up_color2 = $42 200 10000 ???? 00 04 vertical_shooting_1up_color1 = $04 201 10000 ???? 00 00 vertical_shooting_1up_color0 = $00 202 10000 ???? 00 83 vertical_shooting_enemy01_tallsprite_00_color3 = $83 203 10000 ???? 00 a8 vertical_shooting_enemy01_tallsprite_00_color2 = $a8 204 10000 ???? 00 bc vertical_shooting_enemy01_tallsprite_00_color1 = $bc 205 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_color0 = $00 206 10000 ???? 00 83 vertical_shooting_enemy01_color3 = $83 207 10000 ???? 00 a8 vertical_shooting_enemy01_color2 = $a8 208 10000 ???? 00 bc vertical_shooting_enemy01_color1 = $bc 209 10000 ???? 00 00 vertical_shooting_enemy01_color0 = $00 210 10000 ???? 00 36 vertical_shooting_powerup_color3 = $36 211 10000 ???? 00 33 vertical_shooting_powerup_color2 = $33 212 10000 ???? 00 2b vertical_shooting_powerup_color1 = $2b 213 10000 ???? 00 00 vertical_shooting_powerup_color0 = $00 214 10000 ???? 00 bc vertical_shooting_enemyshot_color3 = $bc 215 10000 ???? 00 83 vertical_shooting_enemyshot_color2 = $83 216 10000 ???? 00 a8 vertical_shooting_enemyshot_color1 = $a8 217 10000 ???? 00 00 vertical_shooting_enemyshot_color0 = $00 218 10000 ???? 00 1d vertical_shooting_bullet_color3 = $1d 219 10000 ???? 00 18 vertical_shooting_bullet_color2 = $18 220 10000 ???? 00 0f vertical_shooting_bullet_color1 = $0f 221 10000 ???? 00 00 vertical_shooting_bullet_color0 = $00 222 10000 ???? 00 42 vertical_shooting_ship_tallsprite_00_color3 = $42 223 10000 ???? 00 04 vertical_shooting_ship_tallsprite_00_color2 = $04 224 10000 ???? 00 0f vertical_shooting_ship_tallsprite_00_color1 = $0f 225 10000 ???? 00 00 vertical_shooting_ship_tallsprite_00_color0 = $00 226 10000 ???? 00 42 vertical_shooting_ship_color3 = $42 227 10000 ???? 00 04 vertical_shooting_ship_color2 = $04 228 10000 ???? 00 0f vertical_shooting_ship_color1 = $0f 229 10000 ???? 00 00 vertical_shooting_ship_color0 = $00 230 10000 ???? 00 0f vertical_shooting_font_color1 = $0f 231 10000 ???? 00 00 vertical_shooting_font_color0 = $00 232 10000 ???? 01 6b enemy01_Slowdown = var43 233 10000 ???? 234 10000 ???? 01 6a isDead_flag = var42 235 10000 ???? 236 10000 ???? 01 69 continue_flag = var41 237 10000 ???? 238 10000 ???? 01 68 twinlaser_Slowdown = var40 239 10000 ???? 240 10000 ???? 01 67 twinlaser_flag = var39 241 10000 ???? 242 10000 ???? 01 66 twinlaserY = var38 243 10000 ???? 244 10000 ???? 01 65 twinlaserX = var37 245 10000 ???? 246 10000 ???? 01 64 lives = var36 247 10000 ???? 248 10000 ???? 01 63 explosion_aniframe = var35 249 10000 ???? 250 10000 ???? 01 62 extra_shipFlag = var34 251 10000 ???? 252 10000 ???? 01 61 extra_shipY = var33 253 10000 ???? 254 10000 ???? 01 60 extra_shipX = var32 255 10000 ???? 256 10000 ???? 01 5f gameover_flag = var31 257 10000 ???? 258 10000 ???? 01 5e enemy01_speed = var30 259 10000 ???? 260 10000 ???? 01 5d rMovement6 = var29 261 10000 ???? 262 10000 ???? 01 5c rMovement5 = var28 263 10000 ???? 264 10000 ???? 01 5b rMovement4 = var27 265 10000 ???? 266 10000 ???? 01 5a rMovement3 = var26 267 10000 ???? 268 10000 ???? 01 59 enemy01_Flag = var25 269 10000 ???? 270 10000 ???? 01 58 enemy01_Y = var24 271 10000 ???? 272 10000 ???? 01 57 enemy01_X = var23 273 10000 ???? 274 10000 ???? 01 56 enemy_shotSlowdown = var22 275 10000 ???? 276 10000 ???? 01 55 bulletSlowdown = var21 277 10000 ???? 278 10000 ???? 01 54 power_upSlowdown = var20 279 10000 ???? 280 10000 ???? 01 53 rMovement2 = var19 281 10000 ???? 282 10000 ???? 01 52 power_upFlag = var18 283 10000 ???? 284 10000 ???? 01 51 power_upY = var17 285 10000 ???? 286 10000 ???? 01 50 power_upX = var16 287 10000 ???? 288 10000 ???? 01 4f rDirection = var15 289 10000 ???? 290 10000 ???? 01 4e rMovement1 = var14 291 10000 ???? 292 10000 ???? 01 4d playerFlag = var13 293 10000 ???? 294 10000 ???? 01 4c enemy_shotFlag = var12 295 10000 ???? 296 10000 ???? 01 4b enemy_shotY = var11 297 10000 ???? 298 10000 ???? 01 4a enemy_shotX = var10 299 10000 ???? 300 10000 ???? 01 49 bulletY = var9 301 10000 ???? 302 10000 ???? 01 48 bulletX = var8 303 10000 ???? 304 10000 ???? 01 47 joyposright = var7 305 10000 ???? 306 10000 ???? 01 46 joyposleft = var6 307 10000 ???? 308 10000 ???? 01 45 joyposdown = var5 309 10000 ???? 310 10000 ???? 01 44 joyposup = var4 311 10000 ???? 312 10000 ???? 01 43 fire_debounce = var3 313 10000 ???? 314 10000 ???? 01 42 playerY = var2 315 10000 ???? 316 10000 ???? 01 41 playerX = var1 317 10000 ???? 318 10000 ???? 01 40 frameCounter = var0 319 10000 ???? 320 10000 ???? 00 01 collisionwrap = 1 321 10000 ???? 00 01 NTSC = 1 322 10000 ???? 00 c0 SCREENHEIGHT = 192 323 10000 ???? 00 01 CHECKOVERWRITE = 1 324 10000 ???? 00 08 ZONEHEIGHT = 8 325 10000 ???? 00 01 ROM48K = 1 ------- FILE 7800basic.h 6 10000 ???? 7 10000 ???? ;************ 7800 overall RAM map ************** 8 10000 ???? 9 10000 ???? ; 40-FF zero page RAM 10 10000 ???? ; 140-1FF RAM (stack) 11 10000 ???? ; 1800-203F RAM 12 10000 ???? ; 2100-213F RAM 13 10000 ???? ; 2200-27FF RAM 14 10000 ???? 15 10000 ???? ;************ 7800basic RAM usage map ************** 16 10000 ???? 17 10000 ???? ; 40-FF numerous defines, listed below 18 10000 ???? ; 140-1FF RAM (stack) 19 10000 ???? 20 10000 ???? ; 1800-187F DLL (1800-18DF with page flipping enabled) 21 10000 ???? ; 1880-1FFF DLs (18E0-1FFF with page flipping enabled) 22 10000 ???? 23 10000 ???? ; 2000-203F Reserved 24 10000 ???? ; 2100-213F Reserved 25 10000 ???? ; 2200-27FF Free 26 10000 ???? 27 10000 ???? 1f e0 eeprombuffer = $1FE0 28 10000 ???? 18 00 DLLMEM = $1800 29 10000 ???? 00 70 DBOFFSET = $70 ; $E0 length DL is /2 for double-buffering 30 10000 ???? 31 10000 ???? - ifconst PLOTVALUEPAGE 32 10000 ???? -VALBUFFER = (PLOTVALUEPAGE*256) 33 10000 ???? else 34 10000 ???? 20 00 VALBUFFER = $2000 ; to $203F ** never let VALBUFFER straddle pages 35 10000 ???? endif 36 10000 ???? 37 10000 ???? 38 10000 ???? 21 00 pausestate = $2100 39 10000 ???? 21 01 dlzero = $2101 ; zero to force end of $2100 DL, which we use in vblank and overscan 40 10000 ???? 21 02 sINPT1 = $2102 ; save register for joy button joy0 41 10000 ???? 21 03 sINPT3 = $2103 ; save register for joy button joy1 42 10000 ???? 21 04 currentbank = $2104 43 10000 ???? 44 10000 ???? 21 05 currentrambank = $2105 45 10000 ???? 21 06 charactermode = $2106 46 10000 ???? 21 07 sCTRL = $2107 47 10000 ???? 21 08 pokeydetected = $2108 48 10000 ???? 21 09 paldetected = $2109 49 10000 ???? 21 0a avoxdetected = $210A 50 10000 ???? 21 0b sCHARBASE = $210B ; save register for CHARBASE 51 10000 ???? 52 10000 ???? 21 0c hsdevice = $210C 53 10000 ???? 21 0d hsdifficulty = $210D 54 10000 ???? 21 0e hserror = $210E 55 10000 ???? 21 0f hsgameslot = $210F 56 10000 ???? 21 10 hsnewscoreline = $2110 57 10000 ???? 21 11 hsnewscorerank = $2111 58 10000 ???? 21 12 HSRAMTable = $2112 ; to $212F (30 bytes) Format: III*5, SSS*5 59 10000 ???? 21 12 HSRAMInitials = $2112 ; see above 60 10000 ???? 21 21 HSRAMScores = $2121 ; see above 61 10000 ???? 62 10000 ???? 21 31 ssCTRL = $2131 63 10000 ???? 21 32 ssCHARBASE = $2132 64 10000 ???? 21 33 hsdisplaymode = $2133 65 10000 ???? 21 34 gamedifficulty = $2134 66 10000 ???? 21 35 hsinitialpos = $2135 67 10000 ???? 21 36 hsinitialhold = $2136 68 10000 ???? 21 37 hscursorx = $2137 69 10000 ???? 21 38 hsjoydebounce = $2138 70 10000 ???? 21 39 hsswcha = $2139 71 10000 ???? 21 3a hsinpt1 = $213A 72 10000 ???? 21 3b hscolorchaseindex = $213B 73 10000 ???? 21 3c visibleDLLstart = $213C 74 10000 ???? 21 3d overscanDLLstart = $213D 75 10000 ???? 21 3e frameslost = $213E 76 10000 ???? 77 10000 ???? 78 10000 ???? 00 40 rand = $40 79 10000 ???? 00 41 rand16 = $41 80 10000 ???? 00 42 temp1 = $42 81 10000 ???? 00 43 temp2 = $43 82 10000 ???? 00 44 temp3 = $44 83 10000 ???? 00 45 temp4 = $45 84 10000 ???? 00 46 temp5 = $46 85 10000 ???? 00 47 temp6 = $47 86 10000 ???? 00 48 temp7 = $48 87 10000 ???? 00 49 temp8 = $49 88 10000 ???? 00 4a temp9 = $4a 89 10000 ???? 90 10000 ???? 00 4b pokeybase = $4b 91 10000 ???? 00 4b pokeybaselo = $4b 92 10000 ???? 00 4c pokeybasehi = $4c 93 10000 ???? 94 10000 ???? 00 4d visibleover = $4d 95 10000 ???? 96 10000 ???? 00 4e sfx1pointlo = $4e 97 10000 ???? 00 4f sfx2pointlo = $4f 98 10000 ???? 00 50 sfx1pointhi = $50 99 10000 ???? 00 51 sfx2pointhi = $51 100 10000 ???? 101 10000 ???? 00 52 sfx1priority = $52 102 10000 ???? 00 53 sfx2priority = $53 103 10000 ???? 00 54 sfx1poffset = $54 104 10000 ???? 00 55 sfx2poffset = $55 105 10000 ???? 106 10000 ???? 00 56 sfx1frames = $56 107 10000 ???? 00 57 sfx2frames = $57 108 10000 ???? 00 58 sfx1tick = $58 109 10000 ???? 00 59 sfx2tick = $59 110 10000 ???? 111 10000 ???? 00 5a tempmath = $5a 112 10000 ???? 113 10000 ???? 00 5b pokey1pointlo = $5b 114 10000 ???? 00 5c pokey1pointhi = $5c 115 10000 ???? 00 5d pokey2pointlo = $5d 116 10000 ???? 00 5e pokey2pointhi = $5e 117 10000 ???? 00 5f pokey3pointlo = $5f 118 10000 ???? 00 60 pokey3pointhi = $60 119 10000 ???? 00 61 pokey4pointlo = $61 120 10000 ???? 00 62 pokey4pointhi = $62 121 10000 ???? 122 10000 ???? 00 63 dlpnt = $63 ; to $64 123 10000 ???? 00 65 dlend = $65 ; to $81 - for 28 possible visible dll entries 124 10000 ???? 00 82 dlendsave = $82 ; to $9e - for 28 possible visible dll entries 125 10000 ???? 126 10000 ???? 00 9f speech_addr = $9f 127 10000 ???? 00 a0 speech_addr_hi = $a0 128 10000 ???? 129 10000 ???? 00 a1 HSGameTableLo = $a1 130 10000 ???? 00 a2 HSGameTableHi = $a2 131 10000 ???? 00 a3 HSVoxHi = $a3 132 10000 ???? 00 a4 HSVoxLo = $a4 133 10000 ???? 134 10000 ???? ;channel pointers 135 10000 ???? 136 10000 ???? 00 a5 songchannel1layer1lo = $a5 137 10000 ???? 00 a6 songchannel2layer1lo = $a6 138 10000 ???? 00 a7 songchannel3layer1lo = $a7 139 10000 ???? 00 a8 songchannel4layer1lo = $a8 140 10000 ???? 141 10000 ???? 00 a9 songchannel1layer2lo = $a9 142 10000 ???? 00 aa songchannel2layer2lo = $aA 143 10000 ???? 00 ab songchannel3layer2lo = $aB 144 10000 ???? 00 ac songchannel4layer2lo = $aC 145 10000 ???? 146 10000 ???? 00 ad songchannel1layer3lo = $aD 147 10000 ???? 00 ae songchannel2layer3lo = $aE 148 10000 ???? 00 af songchannel3layer3lo = $aF 149 10000 ???? 00 b0 songchannel4layer3lo = $b0 150 10000 ???? 151 10000 ???? 00 b1 songchannel1layer1hi = $b1 152 10000 ???? 00 b2 songchannel2layer1hi = $b2 153 10000 ???? 00 b3 songchannel3layer1hi = $b3 154 10000 ???? 00 b4 songchannel4layer1hi = $b4 155 10000 ???? 156 10000 ???? 00 b5 songchannel1layer2hi = $b5 157 10000 ???? 00 b6 songchannel2layer2hi = $b6 158 10000 ???? 00 b7 songchannel3layer2hi = $b7 159 10000 ???? 00 b8 songchannel4layer2hi = $b8 160 10000 ???? 161 10000 ???? 00 b9 songchannel1layer3hi = $b9 162 10000 ???? 00 ba songchannel2layer3hi = $bA 163 10000 ???? 00 bb songchannel3layer3hi = $bB 164 10000 ???? 00 bc songchannel4layer3hi = $bC 165 10000 ???? 166 10000 ???? 00 bd songdatalo = $bd 167 10000 ???? 00 be songdatahi = $be 168 10000 ???? 169 10000 ???? 00 bf inactivechannelcount = $bf 170 10000 ???? 171 10000 ???? 172 10000 ???? 00 c0 songchannel1transpose = $c0 173 10000 ???? 00 c1 songchannel2transpose = $c1 174 10000 ???? 00 c2 songchannel3transpose = $c2 175 10000 ???? 00 c3 songchannel4transpose = $c3 176 10000 ???? 177 10000 ???? 00 c4 songstackindex = $c4 178 10000 ???? 179 10000 ???? 00 c5 songchannel1instrumentlo = $c5 180 10000 ???? 00 c6 songchannel2instrumentlo = $c6 181 10000 ???? 00 c7 songchannel3instrumentlo = $c7 182 10000 ???? 00 c8 songchannel4instrumentlo = $c8 183 10000 ???? 184 10000 ???? 00 c9 songchannel1instrumenthi = $c9 185 10000 ???? 00 ca songchannel2instrumenthi = $ca 186 10000 ???? 00 cb songchannel3instrumenthi = $cb 187 10000 ???? 00 cc songchannel4instrumenthi = $cc 188 10000 ???? 189 10000 ???? 00 cd sfx1notedata = $cd 190 10000 ???? 00 ce sfx2notedata = $ce 191 10000 ???? 192 10000 ???? 00 cf songloops = $cf 193 10000 ???? 194 10000 ???? 00 d0 songpointerlo = $D0 195 10000 ???? 00 d1 songpointerhi = $D1 196 10000 ???? 197 10000 ???? 00 d2 voxlock = $D2 198 10000 ???? 00 d3 voxqueuesize = $D3 199 10000 ???? 200 10000 ???? 00 d4 vblankroutines = $D4 201 10000 ???? 202 10000 ???? 00 d5 doublebufferstate = $D5 203 10000 ???? 00 d6 doublebufferdloffset = $D6 204 10000 ???? 00 d7 doublebufferbufferdirty = $D7 205 10000 ???? 206 10000 ???? 00 d8 inttemp1 = $D8 207 10000 ???? 00 d9 inttemp2 = $D9 208 10000 ???? 00 da inttemp3 = $DA 209 10000 ???? 00 db inttemp4 = $DB 210 10000 ???? 00 dc inttemp5 = $DC 211 10000 ???? 00 dd inttemp6 = $DD 212 10000 ???? 213 10000 ???? 00 de sfxschedulelock = $DE 214 10000 ???? 00 df sfxschedulemissed = $DF 215 10000 ???? 00 e0 sfxinstrumentlo = $E0 216 10000 ???? 00 e1 sfxinstrumenthi = $E1 217 10000 ???? 00 e2 sfxpitchoffset = $E2 218 10000 ???? 00 e3 sfxnoteindex = $E3 219 10000 ???? 220 10000 ???? 00 e4 CTLSWAs = $E4 221 10000 ???? 00 e5 CTLSWBs = $E5 222 10000 ???? 223 10000 ???? 00 e6 A = $e6 224 10000 ???? 00 e6 a = $e6 225 10000 ???? 00 e7 B = $e7 226 10000 ???? 00 e7 b = $e7 227 10000 ???? 00 e8 C = $e8 228 10000 ???? 00 e8 c = $e8 229 10000 ???? 00 e9 D = $e9 230 10000 ???? 00 e9 d = $e9 231 10000 ???? 00 ea E = $ea 232 10000 ???? 00 ea e = $ea 233 10000 ???? 00 eb F = $eb 234 10000 ???? 00 eb f = $eb 235 10000 ???? 00 ec G = $ec 236 10000 ???? 00 ec g = $ec 237 10000 ???? 00 ed H = $ed 238 10000 ???? 00 ed h = $ed 239 10000 ???? 00 ee I = $ee 240 10000 ???? 00 ee i = $ee 241 10000 ???? 00 ef J = $ef 242 10000 ???? 00 ef j = $ef 243 10000 ???? 00 f0 K = $f0 244 10000 ???? 00 f0 k = $f0 245 10000 ???? 00 f1 L = $f1 246 10000 ???? 00 f1 l = $f1 247 10000 ???? 00 f2 M = $f2 248 10000 ???? 00 f2 m = $f2 249 10000 ???? 00 f3 N = $f3 250 10000 ???? 00 f3 n = $f3 251 10000 ???? 00 f4 O = $f4 252 10000 ???? 00 f4 o = $f4 253 10000 ???? 00 f5 P = $f5 254 10000 ???? 00 f5 p = $f5 255 10000 ???? 00 f6 Q = $f6 256 10000 ???? 00 f6 q = $f6 257 10000 ???? 00 f7 R = $f7 258 10000 ???? 00 f7 r = $f7 259 10000 ???? 00 f8 S = $f8 260 10000 ???? 00 f8 s = $f8 261 10000 ???? 00 f9 T = $f9 262 10000 ???? 00 f9 t = $f9 263 10000 ???? 00 fa U = $fa 264 10000 ???? 00 fa u = $fa 265 10000 ???? 00 fb V = $fb 266 10000 ???? 00 fb v = $fb 267 10000 ???? 00 fc W = $fc 268 10000 ???? 00 fc w = $fc 269 10000 ???? 00 fd X = $fd 270 10000 ???? 00 fd x = $fd 271 10000 ???? 00 fe Y = $fe 272 10000 ???? 00 fe y = $fe 273 10000 ???? 00 ff Z = $ff 274 10000 ???? 00 ff z = $ff 275 10000 ???? 276 10000 ???? ; var0-var99 variables use the top of the stack 277 10000 ???? 01 40 var0 = $140 278 10000 ???? 01 41 var1 = $141 279 10000 ???? 01 42 var2 = $142 280 10000 ???? 01 43 var3 = $143 281 10000 ???? 01 44 var4 = $144 282 10000 ???? 01 45 var5 = $145 283 10000 ???? 01 46 var6 = $146 284 10000 ???? 01 47 var7 = $147 285 10000 ???? 01 48 var8 = $148 286 10000 ???? 01 49 var9 = $149 287 10000 ???? 01 4a var10 = $14a 288 10000 ???? 01 4b var11 = $14b 289 10000 ???? 01 4c var12 = $14c 290 10000 ???? 01 4d var13 = $14d 291 10000 ???? 01 4e var14 = $14e 292 10000 ???? 01 4f var15 = $14f 293 10000 ???? 01 50 var16 = $150 294 10000 ???? 01 51 var17 = $151 295 10000 ???? 01 52 var18 = $152 296 10000 ???? 01 53 var19 = $153 297 10000 ???? 01 54 var20 = $154 298 10000 ???? 01 55 var21 = $155 299 10000 ???? 01 56 var22 = $156 300 10000 ???? 01 57 var23 = $157 301 10000 ???? 01 58 var24 = $158 302 10000 ???? 01 59 var25 = $159 303 10000 ???? 01 5a var26 = $15a 304 10000 ???? 01 5b var27 = $15b 305 10000 ???? 01 5c var28 = $15c 306 10000 ???? 01 5d var29 = $15d 307 10000 ???? 01 5e var30 = $15e 308 10000 ???? 01 5f var31 = $15f 309 10000 ???? 01 60 var32 = $160 310 10000 ???? 01 61 var33 = $161 311 10000 ???? 01 62 var34 = $162 312 10000 ???? 01 63 var35 = $163 313 10000 ???? 01 64 var36 = $164 314 10000 ???? 01 65 var37 = $165 315 10000 ???? 01 66 var38 = $166 316 10000 ???? 01 67 var39 = $167 317 10000 ???? 01 68 var40 = $168 318 10000 ???? 01 69 var41 = $169 319 10000 ???? 01 6a var42 = $16a 320 10000 ???? 01 6b var43 = $16b 321 10000 ???? 01 6c var44 = $16c 322 10000 ???? 01 6d var45 = $16d 323 10000 ???? 01 6e var46 = $16e 324 10000 ???? 01 6f var47 = $16f 325 10000 ???? 01 70 var48 = $170 326 10000 ???? 01 71 var49 = $171 327 10000 ???? 01 72 var50 = $172 328 10000 ???? 01 73 var51 = $173 329 10000 ???? 01 74 var52 = $174 330 10000 ???? 01 75 var53 = $175 331 10000 ???? 01 76 var54 = $176 332 10000 ???? 01 77 var55 = $177 333 10000 ???? 01 78 var56 = $178 334 10000 ???? 01 79 var57 = $179 335 10000 ???? 01 7a var58 = $17a 336 10000 ???? 01 7b var59 = $17b 337 10000 ???? 01 7c var60 = $17c 338 10000 ???? 01 7d var61 = $17d 339 10000 ???? 01 7e var62 = $17e 340 10000 ???? 01 7f var63 = $17f 341 10000 ???? 01 80 var64 = $180 342 10000 ???? 01 81 var65 = $181 343 10000 ???? 01 82 var66 = $182 344 10000 ???? 01 83 var67 = $183 345 10000 ???? 01 84 var68 = $184 346 10000 ???? 01 85 var69 = $185 347 10000 ???? 01 86 var70 = $186 348 10000 ???? 01 87 var71 = $187 349 10000 ???? 01 88 var72 = $188 350 10000 ???? 01 89 var73 = $189 351 10000 ???? 01 8a var74 = $18a 352 10000 ???? 01 8b var75 = $18b 353 10000 ???? 01 8c var76 = $18c 354 10000 ???? 01 8d var77 = $18d 355 10000 ???? 01 8e var78 = $18e 356 10000 ???? 01 8f var79 = $18f 357 10000 ???? 01 90 var80 = $190 358 10000 ???? 01 91 var81 = $191 359 10000 ???? 01 92 var82 = $192 360 10000 ???? 01 93 var83 = $193 361 10000 ???? 01 94 var84 = $194 362 10000 ???? 01 95 var85 = $195 363 10000 ???? 01 96 var86 = $196 364 10000 ???? 01 97 var87 = $197 365 10000 ???? 01 98 var88 = $198 366 10000 ???? 01 99 var89 = $199 367 10000 ???? 01 9a var90 = $19a 368 10000 ???? 01 9b var91 = $19b 369 10000 ???? 01 9c var92 = $19c 370 10000 ???? 01 9d var93 = $19d 371 10000 ???? 01 9e var94 = $19e 372 10000 ???? 01 9f var95 = $19f 373 10000 ???? 01 a0 var96 = $1a0 374 10000 ???? 01 a1 var97 = $1a1 375 10000 ???? 01 a2 var98 = $1a2 376 10000 ???? 01 a3 var99 = $1a3 377 10000 ???? 378 U01c2 ???? SEG.U "7800basicRAM" 379 U01a4 ORG $1A4 380 U01a4 381 U01a4 ; MAX allocation locations are in comments... 382 U01a4 00 framecounter DS 1 ; $1A4 383 U01a5 00 countdownseconds DS 1 ; $1A5 384 U01a6 00 00 00 score0 DS 3 ; $1A6 $1A7 $1A8 385 U01a9 00 00 00 score1 DS 3 ; $1A9 $1AA $1AB 386 U01ac 00 pausebuttonflag DS 1 ; $1AC 387 U01ad 00 valbufend DS 1 ; $1AD 388 U01ae 00 valbufendsave DS 1 ; $1AE 389 U01af 00 finescrollx DS 1 ; $1AF 390 U01b0 00 finescrolly DS 1 ; $1B0 391 U01b1 00 joybuttonmode DS 1 ; $1B1 ; track joysticks that were changed to one-button mode 392 U01b2 00 interruptindex DS 1 ; $1B2 393 U01b3 394 U01b3 - ifconst DOUBLEBUFFER 395 U01b3 -doublebufferminimumframetarget DS 1 ; $1B3 396 U01b3 -doublebufferminimumframeindex DS 1 ; $1B4 397 U01b3 endif 398 U01b3 399 U01b3 00 pausedisable DS 1 ; $1B5 400 U01b4 00 XCTRL1s DS 1 ; $1B6 401 U01b5 402 U01b5 - ifconst AVOXVOICE 403 U01b5 -avoxenable DS 1 ; $1B7 404 U01b5 -tempavox DS 1 ; $1B8 405 U01b5 endif 406 U01b5 407 U01b5 - ifconst MUSICTRACKER 408 U01b5 -songtempo DS 1 ; $1B9 409 U01b5 -songtick DS 1 ; $1BA 410 U01b5 - 411 U01b5 -songchannel1layer1loops DS 1 ; $1BB 412 U01b5 -songchannel2layer1loops DS 1 ; $1BC 413 U01b5 -songchannel3layer1loops DS 1 ; $1BD 414 U01b5 -songchannel4layer1loops DS 1 ; $1BE 415 U01b5 - 416 U01b5 -songchannel1layer2loops DS 1 ; $1BF 417 U01b5 -songchannel2layer2loops DS 1 ; $1C0 418 U01b5 -songchannel3layer2loops DS 1 ; $1C1 419 U01b5 -songchannel4layer2loops DS 1 ; $1C2 420 U01b5 - 421 U01b5 -songchannel1layer3loops DS 1 ; $1C3 422 U01b5 -songchannel2layer3loops DS 1 ; $1C4 423 U01b5 -songchannel3layer3loops DS 1 ; $1C5 424 U01b5 -songchannel4layer3loops DS 1 ; $1C6 425 U01b5 - 426 U01b5 -songchannel1busywait DS 1 ; $1C7 427 U01b5 -songchannel2busywait DS 1 ; $1C8 428 U01b5 -songchannel3busywait DS 1 ; $1C9 429 U01b5 -songchannel4busywait DS 1 ; $1CA 430 U01b5 - 431 U01b5 -songchannel1stackdepth DS 1 ; $1CB 432 U01b5 -songchannel2stackdepth DS 1 ; $1CC 433 U01b5 -songchannel3stackdepth DS 1 ; $1CD 434 U01b5 -songchannel4stackdepth DS 1 ; $1CE 435 U01b5 endif 436 U01b5 437 U01b5 00 palframes DS 1 ; $1CF 438 U01b6 00 palfastframe DS 1 ; $1D0 439 U01b7 440 U01b7 - ifconst MOUSESUPPORT 441 U01b7 -port0resolution DS 1 ; $1D1 442 U01b7 -port1resolution DS 1 ; $1D2 443 U01b7 else 444 U01b7 - ifconst TRAKBALLSUPPORT 445 U01b7 -port0resolution DS 1 ; $1D1 446 U01b7 -port1resolution DS 1 ; $1D2 447 U01b7 endif 448 U01b7 endif 449 U01b7 450 U01b7 00 port0control DS 1 ; $1D3 451 U01b8 00 port1control DS 1 ; $1D4 452 U01b9 453 U01b9 ; port#control values... 454 U01b9 ; 1 = proline 455 U01b9 ; 2 = lightgun 456 U01b9 ; 3 = paddle 457 U01b9 ; 4 = trakball 458 U01b9 ; 5 = vcs joystick 459 U01b9 ; 6 = driving 460 U01b9 ; 7 = keypad 461 U01b9 ; 8 = st mouse/cx80 462 U01b9 ; 9 = amiga mouse 463 U01b9 ; 10 = atarivox 464 U01b9 465 U01b9 ; controller 0 data... 466 U01b9 00 paddleposition0 DS 1 ; $1D5 467 U01b9 01 b9 keypadmatrix0a = paddleposition0 468 U01b9 01 b9 drivingposition0 = paddleposition0 469 U01b9 01 b9 trakballx0 = paddleposition0 470 U01b9 01 b9 mousex0 = paddleposition0 471 U01b9 01 b9 lighttgunx0 = paddleposition0 472 U01ba 473 U01ba ; controller 1 data... 474 U01ba 00 paddleposition2 DS 1 ; $1D6 475 U01ba 01 ba keypadmatrix1a = paddleposition2 476 U01ba 01 ba drivingposition1 = paddleposition2 477 U01ba 01 ba trakballx1 = paddleposition2 478 U01ba 01 ba mousex1 = paddleposition2 479 U01ba 01 ba lightgunx1 = paddleposition2 480 U01bb 481 U01bb ; controller 0 altdata... 482 U01bb 00 paddleposition1 DS 1 ; $1D7 483 U01bb 01 bb keypadmatrix0b = paddleposition1 484 U01bb 01 bb trakbally0 = paddleposition1 485 U01bb 01 bb mousey0 = paddleposition1 486 U01bb 01 bb lightguny0 = paddleposition1 487 U01bc 488 U01bc ; controller 1 altdata... 489 U01bc 00 paddleposition3 DS 1 ; $1D8 490 U01bc 01 bc keypadmatrix1b = paddleposition3 491 U01bc 01 bc trakbally1 = paddleposition3 492 U01bc 01 bc mousey1 = paddleposition3 493 U01bc 01 bc lightguny1 = paddleposition3 494 U01bd 495 U01bd ; controller state save. for trakball state+dir codes, rotary position codes 496 U01bd 00 controller0statesave DS 1 ; $1D9 497 U01bd 01 bd paddleprevious0 = controller0statesave 498 U01bd 01 bd mousecodex0 = controller0statesave 499 U01bd 01 bd trakballcodex0 = controller0statesave 500 U01bd 01 bd keypadmatrix0c = controller0statesave 501 U01be 502 U01be 00 controller1statesave DS 1 ; $1DA 503 U01be 01 be paddleprevious2 = controller1statesave 504 U01be 01 be mousecodex1 = controller1statesave 505 U01be 01 be trakballcodex1 = controller1statesave 506 U01be 01 be keypadmatrix1c = controller1statesave 507 U01bf 508 U01bf 00 paddleprevious1 DS 1 ; $1DB 509 U01bf 01 bf keypadmatrix0d = paddleprevious1 510 U01bf 01 bf mousecodey0 = paddleprevious1 511 U01bf 01 bf trakballcodey0 = paddleprevious1 512 U01c0 513 U01c0 00 paddleprevious3 DS 1 ; $1DC 514 U01c0 01 c0 keypadmatrix1d = paddleprevious3 515 U01c0 01 c0 mousecodey1 = paddleprevious3 516 U01c0 01 c0 trakballcodey1 = paddleprevious3 517 U01c1 518 U01c1 - ifconst pokeysupport 519 U01c1 -pokey1frames DS 1 ; $1DD 520 U01c1 -pokey1tick DS 1 ; $1DE 521 U01c1 -pokey2frames DS 1 ; $1DF 522 U01c1 -pokey2tick DS 1 ; $1E0 523 U01c1 -pokey3frames DS 1 ; $1E1 524 U01c1 -pokey3tick DS 1 ; $1E2 525 U01c1 -pokey4frames DS 1 ; $1E3 526 U01c1 -pokey4tick DS 1 ; $1E4 527 U01c1 -pokey1priority DS 1 ; $1E5 528 U01c1 -pokey1offset DS 1 ; $1E6 529 U01c1 -pokey2priority DS 1 ; $1E7 530 U01c1 -pokey2offset DS 1 ; $1E8 531 U01c1 -pokey3priority DS 1 ; $1E9 532 U01c1 -pokey3offset DS 1 ; $1EA 533 U01c1 -pokey4priority DS 1 ; $1EB 534 U01c1 -pokey4offset DS 1 ; $1EC 535 U01c1 endif 536 U01c1 537 U01c1 ifnconst CANARYOFF 538 U01c1 00 canary DS 1 ; $1ED 539 U01c2 endif 540 U01c2 541 U01c2 ifnconst bankswitchmode stack allowance: 30 nested subroutines. 542 U01c2 echo " stack allowance:",[($1FF - .)/2]d,"nested subroutines." 543 U01c2 - else 544 U01c2 - echo " stack allowance:",[($1FF - .)/3]d,"nested subroutines." 545 U01c2 endif 546 U01c2 ifnconst CANARYOFF the canary is situated at: $1c1 547 U01c2 echo " the canary is situated at:",[canary] 548 U01c2 - else 549 U01c2 - echo " the canary is disabled." 550 U01c2 endif 551 U01c2 552 U01c2 ; $1EE - $1FF reserved for stack 553 U01c2 554 10000 ???? SEG "GAME" 555 10000 ???? ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_VerticalShooter_Test_continue.78b.asm ------- FILE 7800basic_variable_redefs.h LEVEL 2 PASS 3 0 10000 ???? include "7800basic_variable_redefs.h" 1 10000 ???? ; This file contains variable mapping and other information for the current project. 2 10000 ???? 3 10000 ???? 00 00 vertical_shooting_laser_tallsprite_01_mode = $00 4 10000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width_twoscompliment = $00 5 10000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width = $00 6 10000 ???? 00 00 vertical_shooting_laser_tallsprite_00_mode = $00 7 10000 ???? 00 1f vertical_shooting_laser_tallsprite_00_width_twoscompliment = $1f 8 10000 ???? 00 01 vertical_shooting_laser_tallsprite_00_width = $01 9 10000 ???? 00 00 vertical_shooting_laser_mode = $00 10 10000 ???? 00 1f vertical_shooting_laser_width_twoscompliment = $1f 11 10000 ???? 00 01 vertical_shooting_laser_width = $01 12 10000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_mode = $00 13 10000 ???? 00 0c vertical_shooting_explosion_10_tallsprite_00_width_twoscompliment = $0c 14 10000 ???? 00 14 vertical_shooting_explosion_10_tallsprite_00_width = $14 15 10000 ???? 00 00 vertical_shooting_explosion_10_mode = $00 16 10000 ???? 00 0c vertical_shooting_explosion_10_width_twoscompliment = $0c 17 10000 ???? 00 14 vertical_shooting_explosion_10_width = $14 18 10000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_mode = $00 19 10000 ???? 00 0c vertical_shooting_explosion_09_tallsprite_00_width_twoscompliment = $0c 20 10000 ???? 00 14 vertical_shooting_explosion_09_tallsprite_00_width = $14 21 10000 ???? 00 00 vertical_shooting_explosion_09_mode = $00 22 10000 ???? 00 0c vertical_shooting_explosion_09_width_twoscompliment = $0c 23 10000 ???? 00 14 vertical_shooting_explosion_09_width = $14 24 10000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_mode = $00 25 10000 ???? 00 0c vertical_shooting_explosion_08_tallsprite_00_width_twoscompliment = $0c 26 10000 ???? 00 14 vertical_shooting_explosion_08_tallsprite_00_width = $14 27 10000 ???? 00 00 vertical_shooting_explosion_08_mode = $00 28 10000 ???? 00 0c vertical_shooting_explosion_08_width_twoscompliment = $0c 29 10000 ???? 00 14 vertical_shooting_explosion_08_width = $14 30 10000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_mode = $00 31 10000 ???? 00 0c vertical_shooting_explosion_07_tallsprite_00_width_twoscompliment = $0c 32 10000 ???? 00 14 vertical_shooting_explosion_07_tallsprite_00_width = $14 33 10000 ???? 00 00 vertical_shooting_explosion_07_mode = $00 34 10000 ???? 00 0c vertical_shooting_explosion_07_width_twoscompliment = $0c 35 10000 ???? 00 14 vertical_shooting_explosion_07_width = $14 36 10000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_mode = $00 37 10000 ???? 00 1e vertical_shooting_explosion_06_tallsprite_00_width_twoscompliment = $1e 38 10000 ???? 00 02 vertical_shooting_explosion_06_tallsprite_00_width = $02 39 10000 ???? 00 00 vertical_shooting_explosion_06_mode = $00 40 10000 ???? 00 1e vertical_shooting_explosion_06_width_twoscompliment = $1e 41 10000 ???? 00 02 vertical_shooting_explosion_06_width = $02 42 10000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_mode = $00 43 10000 ???? 00 1e vertical_shooting_explosion_05_tallsprite_00_width_twoscompliment = $1e 44 10000 ???? 00 02 vertical_shooting_explosion_05_tallsprite_00_width = $02 45 10000 ???? 00 00 vertical_shooting_explosion_05_mode = $00 46 10000 ???? 00 1e vertical_shooting_explosion_05_width_twoscompliment = $1e 47 10000 ???? 00 02 vertical_shooting_explosion_05_width = $02 48 10000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_mode = $00 49 10000 ???? 00 1e vertical_shooting_explosion_04_tallsprite_00_width_twoscompliment = $1e 50 10000 ???? 00 02 vertical_shooting_explosion_04_tallsprite_00_width = $02 51 10000 ???? 00 00 vertical_shooting_explosion_04_mode = $00 52 10000 ???? 00 1e vertical_shooting_explosion_04_width_twoscompliment = $1e 53 10000 ???? 00 02 vertical_shooting_explosion_04_width = $02 54 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_mode = $00 55 10000 ???? 00 1e vertical_shooting_explosion_03_tallsprite_00_width_twoscompliment = $1e 56 10000 ???? 00 02 vertical_shooting_explosion_03_tallsprite_00_width = $02 57 10000 ???? 00 00 vertical_shooting_explosion_03_mode = $00 58 10000 ???? 00 1e vertical_shooting_explosion_03_width_twoscompliment = $1e 59 10000 ???? 00 02 vertical_shooting_explosion_03_width = $02 60 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_mode = $00 61 10000 ???? 00 1e vertical_shooting_explosion_02_tallsprite_00_width_twoscompliment = $1e 62 10000 ???? 00 02 vertical_shooting_explosion_02_tallsprite_00_width = $02 63 10000 ???? 00 00 vertical_shooting_explosion_02_mode = $00 64 10000 ???? 00 1e vertical_shooting_explosion_02_width_twoscompliment = $1e 65 10000 ???? 00 02 vertical_shooting_explosion_02_width = $02 66 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_mode = $00 67 10000 ???? 00 1e vertical_shooting_explosion_01_tallsprite_00_width_twoscompliment = $1e 68 10000 ???? 00 02 vertical_shooting_explosion_01_tallsprite_00_width = $02 69 10000 ???? 00 00 vertical_shooting_explosion_01_mode = $00 70 10000 ???? 00 1e vertical_shooting_explosion_01_width_twoscompliment = $1e 71 10000 ???? 00 02 vertical_shooting_explosion_01_width = $02 72 10000 ???? 00 00 vertical_shooting_1up_mode = $00 73 10000 ???? 00 1e vertical_shooting_1up_width_twoscompliment = $1e 74 10000 ???? 00 02 vertical_shooting_1up_width = $02 75 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_mode = $00 76 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_width_twoscompliment = $00 77 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_01_width = $00 78 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_mode = $00 79 10000 ???? 00 1e vertical_shooting_enemy01_tallsprite_00_width_twoscompliment = $1e 80 10000 ???? 00 02 vertical_shooting_enemy01_tallsprite_00_width = $02 81 10000 ???? 00 00 vertical_shooting_enemy01_mode = $00 82 10000 ???? 00 1e vertical_shooting_enemy01_width_twoscompliment = $1e 83 10000 ???? 00 02 vertical_shooting_enemy01_width = $02 84 10000 ???? 00 00 vertical_shooting_powerup_mode = $00 85 10000 ???? 00 1e vertical_shooting_powerup_width_twoscompliment = $1e 86 10000 ???? 00 02 vertical_shooting_powerup_width = $02 87 10000 ???? 00 00 vertical_shooting_enemyshot_mode = $00 88 10000 ???? 00 1f vertical_shooting_enemyshot_width_twoscompliment = $1f 89 10000 ???? 00 01 vertical_shooting_enemyshot_width = $01 90 10000 ???? 00 00 vertical_shooting_bullet_mode = $00 91 10000 ???? 00 1f vertical_shooting_bullet_width_twoscompliment = $1f 92 10000 ???? 00 01 vertical_shooting_bullet_width = $01 93 10000 ???? 00 00 vertical_shooting_ship_tallsprite_00_mode = $00 94 10000 ???? 00 1e vertical_shooting_ship_tallsprite_00_width_twoscompliment = $1e 95 10000 ???? 00 02 vertical_shooting_ship_tallsprite_00_width = $02 96 10000 ???? 00 00 vertical_shooting_ship_mode = $00 97 10000 ???? 00 1e vertical_shooting_ship_width_twoscompliment = $1e 98 10000 ???? 00 02 vertical_shooting_ship_width = $02 99 10000 ???? 00 00 vertical_shooting_font_mode = $00 100 10000 ???? 00 13 vertical_shooting_font_width_twoscompliment = $13 101 10000 ???? 00 2d vertical_shooting_font_width = $2d 102 10000 ???? 00 90 sfx_explosion_length = .skipL0266-sfx_explosion 103 10000 ???? 104 10000 ???? 00 30 sfx_plainlaser_length = .skipL0265-sfx_plainlaser 105 10000 ???? 106 10000 ???? 00 54 sfx_pulsecannon_length = .skipL0264-sfx_pulsecannon 107 10000 ???? 108 10000 ???? 00 36 sfx_bling_length = .skipL0263-sfx_bling 109 10000 ???? 110 10000 ???? 00 04 vertical_shooting_laser_tallsprite_00_color3 = $04 111 10000 ???? 00 42 vertical_shooting_laser_tallsprite_00_color2 = $42 112 10000 ???? 00 0f vertical_shooting_laser_tallsprite_00_color1 = $0f 113 10000 ???? 00 00 vertical_shooting_laser_tallsprite_00_color0 = $00 114 10000 ???? 00 04 vertical_shooting_laser_color3 = $04 115 10000 ???? 00 42 vertical_shooting_laser_color2 = $42 116 10000 ???? 00 0f vertical_shooting_laser_color1 = $0f 117 10000 ???? 00 00 vertical_shooting_laser_color0 = $00 118 10000 ???? 00 33 vertical_shooting_explosion_10_tallsprite_00_color3 = $33 119 10000 ???? 00 2b vertical_shooting_explosion_10_tallsprite_00_color2 = $2b 120 10000 ???? 00 36 vertical_shooting_explosion_10_tallsprite_00_color1 = $36 121 10000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_color0 = $00 122 10000 ???? 00 33 vertical_shooting_explosion_10_color3 = $33 123 10000 ???? 00 2b vertical_shooting_explosion_10_color2 = $2b 124 10000 ???? 00 36 vertical_shooting_explosion_10_color1 = $36 125 10000 ???? 00 00 vertical_shooting_explosion_10_color0 = $00 126 10000 ???? 00 33 vertical_shooting_explosion_09_tallsprite_00_color3 = $33 127 10000 ???? 00 2b vertical_shooting_explosion_09_tallsprite_00_color2 = $2b 128 10000 ???? 00 36 vertical_shooting_explosion_09_tallsprite_00_color1 = $36 129 10000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_color0 = $00 130 10000 ???? 00 33 vertical_shooting_explosion_09_color3 = $33 131 10000 ???? 00 2b vertical_shooting_explosion_09_color2 = $2b 132 10000 ???? 00 36 vertical_shooting_explosion_09_color1 = $36 133 10000 ???? 00 00 vertical_shooting_explosion_09_color0 = $00 134 10000 ???? 00 33 vertical_shooting_explosion_08_tallsprite_00_color3 = $33 135 10000 ???? 00 2b vertical_shooting_explosion_08_tallsprite_00_color2 = $2b 136 10000 ???? 00 36 vertical_shooting_explosion_08_tallsprite_00_color1 = $36 137 10000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_color0 = $00 138 10000 ???? 00 33 vertical_shooting_explosion_08_color3 = $33 139 10000 ???? 00 2b vertical_shooting_explosion_08_color2 = $2b 140 10000 ???? 00 36 vertical_shooting_explosion_08_color1 = $36 141 10000 ???? 00 00 vertical_shooting_explosion_08_color0 = $00 142 10000 ???? 00 33 vertical_shooting_explosion_07_tallsprite_00_color3 = $33 143 10000 ???? 00 2b vertical_shooting_explosion_07_tallsprite_00_color2 = $2b 144 10000 ???? 00 36 vertical_shooting_explosion_07_tallsprite_00_color1 = $36 145 10000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_color0 = $00 146 10000 ???? 00 33 vertical_shooting_explosion_07_color3 = $33 147 10000 ???? 00 2b vertical_shooting_explosion_07_color2 = $2b 148 10000 ???? 00 36 vertical_shooting_explosion_07_color1 = $36 149 10000 ???? 00 00 vertical_shooting_explosion_07_color0 = $00 150 10000 ???? 00 33 vertical_shooting_explosion_06_tallsprite_00_color3 = $33 151 10000 ???? 00 2b vertical_shooting_explosion_06_tallsprite_00_color2 = $2b 152 10000 ???? 00 36 vertical_shooting_explosion_06_tallsprite_00_color1 = $36 153 10000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_color0 = $00 154 10000 ???? 00 33 vertical_shooting_explosion_06_color3 = $33 155 10000 ???? 00 2b vertical_shooting_explosion_06_color2 = $2b 156 10000 ???? 00 36 vertical_shooting_explosion_06_color1 = $36 157 10000 ???? 00 00 vertical_shooting_explosion_06_color0 = $00 158 10000 ???? 00 33 vertical_shooting_explosion_05_tallsprite_00_color3 = $33 159 10000 ???? 00 2b vertical_shooting_explosion_05_tallsprite_00_color2 = $2b 160 10000 ???? 00 36 vertical_shooting_explosion_05_tallsprite_00_color1 = $36 161 10000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_color0 = $00 162 10000 ???? 00 33 vertical_shooting_explosion_05_color3 = $33 163 10000 ???? 00 2b vertical_shooting_explosion_05_color2 = $2b 164 10000 ???? 00 36 vertical_shooting_explosion_05_color1 = $36 165 10000 ???? 00 00 vertical_shooting_explosion_05_color0 = $00 166 10000 ???? 00 33 vertical_shooting_explosion_04_tallsprite_00_color3 = $33 167 10000 ???? 00 36 vertical_shooting_explosion_04_tallsprite_00_color2 = $36 168 10000 ???? 00 2b vertical_shooting_explosion_04_tallsprite_00_color1 = $2b 169 10000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_color0 = $00 170 10000 ???? 00 33 vertical_shooting_explosion_04_color3 = $33 171 10000 ???? 00 36 vertical_shooting_explosion_04_color2 = $36 172 10000 ???? 00 2b vertical_shooting_explosion_04_color1 = $2b 173 10000 ???? 00 00 vertical_shooting_explosion_04_color0 = $00 174 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color3 = 0 175 10000 ???? 00 36 vertical_shooting_explosion_03_tallsprite_00_color2 = $36 176 10000 ???? 00 2b vertical_shooting_explosion_03_tallsprite_00_color1 = $2b 177 10000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color0 = $00 178 10000 ???? 00 00 vertical_shooting_explosion_03_color3 = 0 179 10000 ???? 00 36 vertical_shooting_explosion_03_color2 = $36 180 10000 ???? 00 2b vertical_shooting_explosion_03_color1 = $2b 181 10000 ???? 00 00 vertical_shooting_explosion_03_color0 = $00 182 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color3 = 0 183 10000 ???? 00 36 vertical_shooting_explosion_02_tallsprite_00_color2 = $36 184 10000 ???? 00 2b vertical_shooting_explosion_02_tallsprite_00_color1 = $2b 185 10000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color0 = $00 186 10000 ???? 00 00 vertical_shooting_explosion_02_color3 = 0 187 10000 ???? 00 36 vertical_shooting_explosion_02_color2 = $36 188 10000 ???? 00 2b vertical_shooting_explosion_02_color1 = $2b 189 10000 ???? 00 00 vertical_shooting_explosion_02_color0 = $00 190 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color3 = 0 191 10000 ???? 00 2b vertical_shooting_explosion_01_tallsprite_00_color2 = $2b 192 10000 ???? 00 36 vertical_shooting_explosion_01_tallsprite_00_color1 = $36 193 10000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color0 = $00 194 10000 ???? 00 00 vertical_shooting_explosion_01_color3 = 0 195 10000 ???? 00 2b vertical_shooting_explosion_01_color2 = $2b 196 10000 ???? 00 36 vertical_shooting_explosion_01_color1 = $36 197 10000 ???? 00 00 vertical_shooting_explosion_01_color0 = $00 198 10000 ???? 00 0f vertical_shooting_1up_color3 = $0f 199 10000 ???? 00 42 vertical_shooting_1up_color2 = $42 200 10000 ???? 00 04 vertical_shooting_1up_color1 = $04 201 10000 ???? 00 00 vertical_shooting_1up_color0 = $00 202 10000 ???? 00 83 vertical_shooting_enemy01_tallsprite_00_color3 = $83 203 10000 ???? 00 a8 vertical_shooting_enemy01_tallsprite_00_color2 = $a8 204 10000 ???? 00 bc vertical_shooting_enemy01_tallsprite_00_color1 = $bc 205 10000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_color0 = $00 206 10000 ???? 00 83 vertical_shooting_enemy01_color3 = $83 207 10000 ???? 00 a8 vertical_shooting_enemy01_color2 = $a8 208 10000 ???? 00 bc vertical_shooting_enemy01_color1 = $bc 209 10000 ???? 00 00 vertical_shooting_enemy01_color0 = $00 210 10000 ???? 00 36 vertical_shooting_powerup_color3 = $36 211 10000 ???? 00 33 vertical_shooting_powerup_color2 = $33 212 10000 ???? 00 2b vertical_shooting_powerup_color1 = $2b 213 10000 ???? 00 00 vertical_shooting_powerup_color0 = $00 214 10000 ???? 00 bc vertical_shooting_enemyshot_color3 = $bc 215 10000 ???? 00 83 vertical_shooting_enemyshot_color2 = $83 216 10000 ???? 00 a8 vertical_shooting_enemyshot_color1 = $a8 217 10000 ???? 00 00 vertical_shooting_enemyshot_color0 = $00 218 10000 ???? 00 1d vertical_shooting_bullet_color3 = $1d 219 10000 ???? 00 18 vertical_shooting_bullet_color2 = $18 220 10000 ???? 00 0f vertical_shooting_bullet_color1 = $0f 221 10000 ???? 00 00 vertical_shooting_bullet_color0 = $00 222 10000 ???? 00 42 vertical_shooting_ship_tallsprite_00_color3 = $42 223 10000 ???? 00 04 vertical_shooting_ship_tallsprite_00_color2 = $04 224 10000 ???? 00 0f vertical_shooting_ship_tallsprite_00_color1 = $0f 225 10000 ???? 00 00 vertical_shooting_ship_tallsprite_00_color0 = $00 226 10000 ???? 00 42 vertical_shooting_ship_color3 = $42 227 10000 ???? 00 04 vertical_shooting_ship_color2 = $04 228 10000 ???? 00 0f vertical_shooting_ship_color1 = $0f 229 10000 ???? 00 00 vertical_shooting_ship_color0 = $00 230 10000 ???? 00 0f vertical_shooting_font_color1 = $0f 231 10000 ???? 00 00 vertical_shooting_font_color0 = $00 232 10000 ???? 01 6b enemy01_Slowdown = var43 233 10000 ???? 234 10000 ???? 01 6a isDead_flag = var42 235 10000 ???? 236 10000 ???? 01 69 continue_flag = var41 237 10000 ???? 238 10000 ???? 01 68 twinlaser_Slowdown = var40 239 10000 ???? 240 10000 ???? 01 67 twinlaser_flag = var39 241 10000 ???? 242 10000 ???? 01 66 twinlaserY = var38 243 10000 ???? 244 10000 ???? 01 65 twinlaserX = var37 245 10000 ???? 246 10000 ???? 01 64 lives = var36 247 10000 ???? 248 10000 ???? 01 63 explosion_aniframe = var35 249 10000 ???? 250 10000 ???? 01 62 extra_shipFlag = var34 251 10000 ???? 252 10000 ???? 01 61 extra_shipY = var33 253 10000 ???? 254 10000 ???? 01 60 extra_shipX = var32 255 10000 ???? 256 10000 ???? 01 5f gameover_flag = var31 257 10000 ???? 258 10000 ???? 01 5e enemy01_speed = var30 259 10000 ???? 260 10000 ???? 01 5d rMovement6 = var29 261 10000 ???? 262 10000 ???? 01 5c rMovement5 = var28 263 10000 ???? 264 10000 ???? 01 5b rMovement4 = var27 265 10000 ???? 266 10000 ???? 01 5a rMovement3 = var26 267 10000 ???? 268 10000 ???? 01 59 enemy01_Flag = var25 269 10000 ???? 270 10000 ???? 01 58 enemy01_Y = var24 271 10000 ???? 272 10000 ???? 01 57 enemy01_X = var23 273 10000 ???? 274 10000 ???? 01 56 enemy_shotSlowdown = var22 275 10000 ???? 276 10000 ???? 01 55 bulletSlowdown = var21 277 10000 ???? 278 10000 ???? 01 54 power_upSlowdown = var20 279 10000 ???? 280 10000 ???? 01 53 rMovement2 = var19 281 10000 ???? 282 10000 ???? 01 52 power_upFlag = var18 283 10000 ???? 284 10000 ???? 01 51 power_upY = var17 285 10000 ???? 286 10000 ???? 01 50 power_upX = var16 287 10000 ???? 288 10000 ???? 01 4f rDirection = var15 289 10000 ???? 290 10000 ???? 01 4e rMovement1 = var14 291 10000 ???? 292 10000 ???? 01 4d playerFlag = var13 293 10000 ???? 294 10000 ???? 01 4c enemy_shotFlag = var12 295 10000 ???? 296 10000 ???? 01 4b enemy_shotY = var11 297 10000 ???? 298 10000 ???? 01 4a enemy_shotX = var10 299 10000 ???? 300 10000 ???? 01 49 bulletY = var9 301 10000 ???? 302 10000 ???? 01 48 bulletX = var8 303 10000 ???? 304 10000 ???? 01 47 joyposright = var7 305 10000 ???? 306 10000 ???? 01 46 joyposleft = var6 307 10000 ???? 308 10000 ???? 01 45 joyposdown = var5 309 10000 ???? 310 10000 ???? 01 44 joyposup = var4 311 10000 ???? 312 10000 ???? 01 43 fire_debounce = var3 313 10000 ???? 314 10000 ???? 01 42 playerY = var2 315 10000 ???? 316 10000 ???? 01 41 playerX = var1 317 10000 ???? 318 10000 ???? 01 40 frameCounter = var0 319 10000 ???? 320 10000 ???? 00 01 collisionwrap = 1 321 10000 ???? 00 01 NTSC = 1 322 10000 ???? 00 c0 SCREENHEIGHT = 192 323 10000 ???? 00 01 CHECKOVERWRITE = 1 324 10000 ???? 00 08 ZONEHEIGHT = 8 325 10000 ???? 00 01 ROM48K = 1 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_VerticalShooter_Test_continue.78b.asm 545 10000 ???? 546 10000 ???? ; A BEAD header gets automatically incorportated into the ROM header. 547 10000 ???? ; For more BEAD executable info, check out the spec... 548 10000 ???? ; http://7800.8bitdev.org/index.php/The_Atari_7800_BEAD_Execuable_Specification 549 10000 ???? 550 10000 ???? 00 01 GAMEDESCRIPTIONSET = 1 551 10000 ???? 4e 61 6d 65 GAMEDESCRIPTION = "Test Name" 552 10000 ???? 553 10000 ???? 00 40 BDHSC = %01000000 554 10000 ???? 00 20 BDYM = %00100000 555 10000 ???? 00 10 BDPOKEY = %00010000 556 10000 ???? 00 08 BDROF = %00001000 557 10000 ???? 00 00 BD16K = %00000000 558 10000 ???? 00 01 BD32K = %00000001 559 10000 ???? 00 02 BD48K = %00000010 560 10000 ???? 00 05 BD1800 = %00000101 561 10000 ???? 00 06 BD4000 = %00000110 562 10000 ???? 563 10000 ???? - ifconst ROM16K 564 10000 ???? -BEADHEADER = 1 565 10000 ???? endif 566 10000 ???? - ifconst ROM32K 567 10000 ???? -BEADHEADER = 1 568 10000 ???? endif 569 10000 ???? ifconst ROM48K 570 10000 ???? 00 01 BEADHEADER = 1 571 10000 ???? endif 572 10000 ???? 573 10000 ???? ifconst BEADHEADER 574 10000 ???? BEADHARDWARE SET 0 575 10000 ???? - ifconst ROM16K 576 10000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD16K) 577 10000 ???? endif 578 10000 ???? - ifconst ROM32K 579 10000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD32K) 580 10000 ???? endif 581 10000 ???? ifconst ROM48K 582 10000 ???? BEADHARDWARE SET (BEADHARDWARE|BD48K) 583 10000 ???? endif 584 10000 ???? - ifconst pokeysupport 585 10000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDPOKEY) 586 10000 ???? endif 587 10000 ???? - ifconst HSSUPPORT 588 10000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDHSC) 589 10000 ???? endif 590 10000 ???? endif 591 10000 ???? 592 10000 ???? ;start address of cart... 593 10000 ???? ifconst ROM48K 594 4000 ORG $4000,0 595 4000 ifconst BEADHEADER 596 4000 be ad 02 .byte.b $BE,$AD,BEADHARDWARE 597 4003 ifconst GAMEDESCRIPTIONSET 598 4003 18 CLC 599 4004 90 0a BCC _SKIPDESCRIPTION 600 4006 54 65 73 74* .byte.b GAMEDESCRIPTION,0 601 4010 _SKIPDESCRIPTION 602 4010 endif 603 4010 6c fc ff jmp ($FFFC) 604 4013 endif 605 4013 - else 606 4013 - ifconst bankswitchmode 607 4013 - ifconst ROMAT4K 608 4013 - ORG $4000,0 609 4013 - RORG $4000 610 4013 - else 611 4013 - ORG $8000,0 612 4013 - RORG $8000 613 4013 - endif 614 4013 - else ; not bankswitchmode 615 4013 - ifconst ROM16K 616 4013 - ORG $C000,0 617 4013 - ifconst BEADHEADER 618 4013 - .byte $BE,$AD,BEADHARDWARE 619 4013 - ifconst GAMEDESCRIPTION 620 4013 - CLC 621 4013 - BCC _SKIPDESCRIPTION 622 4013 - .byte GAMEDESCRIPTION,0 623 4013 -_SKIPDESCRIPTION 624 4013 - endif 625 4013 - jmp ($FFFC) 626 4013 - endif 627 4013 - else 628 4013 - ifconst ROM8K 629 4013 - ORG $E000,0 630 4013 - else 631 4013 - ORG $8000,0 632 4013 - ifconst BEADHEADER 633 4013 - .byte $BE,$AD,BEADHARDWARE 634 4013 - ifconst GAMEDESCRIPTION 635 4013 - CLC 636 4013 - BCC _SKIPDESCRIPTION 637 4013 - .byte GAMEDESCRIPTION,0 638 4013 -_SKIPDESCRIPTION 639 4013 - endif 640 4013 - jmp ($FFFC) 641 4013 - endif 642 4013 - endif 643 4013 - endif 644 4013 - endif 645 4013 endif 646 4013 647 4013 ;7800basic v0.16 Nov 21 2020 15:38:52 648 4013 SPACEOVERFLOW SET 0 649 4013 game 650 4013 . 651 4013 ;; 652 4013 653 4013 . 654 4013 ;; 655 4013 656 4013 .L00 ;; set romsize 48k 657 4013 658 4013 .L01 ;; set zoneheight 8 659 4013 660 4013 .L02 ;; set zoneprotection on 661 4013 662 4013 .L03 ;; set tallsprite on 663 4013 664 4013 .L04 ;; set screenheight 192 665 4013 666 4013 .L05 ;; set basepath gfx 667 4013 668 4013 .L06 ;; set tv ntsc 669 4013 670 4013 .L07 ;; set collisionwrap on 671 4013 672 4013 .L08 ;; set doublewide off 673 4013 674 4013 .L09 ;; displaymode 160A 675 4013 676 4013 a9 40 lda #%01000000 ;Enable DMA, mode=160x2/160x4 677 4015 85 3c sta CTRL 678 4017 679 4017 8d 07 21 sta sCTRL 680 401a 681 401a . 682 401a ;; 683 401a 684 401a .L010 ;; dim frameCounter = var0 685 401a 686 401a .L011 ;; dim playerX = var1 687 401a 688 401a .L012 ;; dim playerY = var2 689 401a 690 401a .L013 ;; dim fire_debounce = var3 691 401a 692 401a .L014 ;; dim joyposup = var4 693 401a 694 401a .L015 ;; dim joyposdown = var5 695 401a 696 401a .L016 ;; dim joyposleft = var6 697 401a 698 401a .L017 ;; dim joyposright = var7 699 401a 700 401a .L018 ;; dim bulletX = var8 701 401a 702 401a .L019 ;; dim bulletY = var9 703 401a 704 401a .L020 ;; dim enemy_shotX = var10 705 401a 706 401a .L021 ;; dim enemy_shotY = var11 707 401a 708 401a .L022 ;; dim enemy_shotFlag = var12 709 401a 710 401a .L023 ;; dim playerFlag = var13 711 401a 712 401a .L024 ;; dim rMovement1 = var14 713 401a 714 401a .L025 ;; dim rDirection = var15 715 401a 716 401a .L026 ;; dim power_upX = var16 717 401a 718 401a .L027 ;; dim power_upY = var17 719 401a 720 401a .L028 ;; dim power_upFlag = var18 721 401a 722 401a .L029 ;; dim rMovement2 = var19 723 401a 724 401a .L030 ;; dim power_upSlowdown = var20 725 401a 726 401a .L031 ;; dim bulletSlowdown = var21 727 401a 728 401a .L032 ;; dim enemy_shotSlowdown = var22 729 401a 730 401a .L033 ;; dim enemy01_X = var23 731 401a 732 401a .L034 ;; dim enemy01_Y = var24 733 401a 734 401a .L035 ;; dim enemy01_Flag = var25 735 401a 736 401a .L036 ;; dim rMovement3 = var26 737 401a 738 401a .L037 ;; dim rMovement4 = var27 739 401a 740 401a .L038 ;; dim rMovement5 = var28 741 401a 742 401a .L039 ;; dim rMovement6 = var29 743 401a 744 401a .L040 ;; dim enemy01_speed = var30 745 401a 746 401a .L041 ;; dim gameover_flag = var31 747 401a 748 401a .L042 ;; dim extra_shipX = var32 749 401a 750 401a .L043 ;; dim extra_shipY = var33 751 401a 752 401a .L044 ;; dim extra_shipFlag = var34 753 401a 754 401a .L045 ;; dim explosion_aniframe = var35 755 401a 756 401a .L046 ;; dim lives = var36 757 401a 758 401a .L047 ;; dim twinlaserX = var37 759 401a 760 401a .L048 ;; dim twinlaserY = var38 761 401a 762 401a .L049 ;; dim twinlaser_flag = var39 763 401a 764 401a .L050 ;; dim twinlaser_Slowdown = var40 765 401a 766 401a .L051 ;; dim continue_flag = var41 767 401a 768 401a .L052 ;; dim isDead_flag = var42 769 401a 770 401a .L053 ;; dim enemy01_Slowdown = var43 771 401a 772 401a . 773 401a ;; 774 401a 775 401a . 776 401a ;; 777 401a 778 401a .L054 ;; characterset vertical_shooting_font 779 401a 780 401a a9 b0 lda #>vertical_shooting_font 781 401c 8d 0b 21 sta sCHARBASE 782 401f 783 401f 85 34 sta CHARBASE 784 4021 a9 60 lda #(vertical_shooting_font_mode | %01100000) 785 4023 8d 06 21 sta charactermode 786 4026 787 4026 .L055 ;; alphachars ' 0123456789abcdefghijklmnopqrstuvwxyz.,?!:;`"' 788 4026 789 4026 . 790 4026 ;; 791 4026 792 4026 .import 793 4026 ;; import 794 4026 795 4026 . 796 4026 ;; 797 4026 798 4026 .L056 ;; incgraphic vertical_shooting_font.png 160A 799 4026 800 4026 .L057 ;; incgraphic vertical_shooting_ship.png 160A 801 4026 802 4026 .L058 ;; incgraphic vertical_shooting_bullet.png 160A 803 4026 804 4026 .L059 ;; incgraphic vertical_shooting_enemyshot.png 160A 805 4026 806 4026 .L060 ;; incgraphic vertical_shooting_powerup.png 160A 807 4026 808 4026 .L061 ;; incgraphic vertical_shooting_enemy01.png 160A 809 4026 810 4026 .L062 ;; newblock 811 4026 812 4026 . 813 4026 ;; 814 4026 815 4026 .L063 ;; incgraphic vertical_shooting_1up.png 160A 816 4026 817 4026 .L064 ;; incgraphic vertical_shooting_explosion_01.png 160A 818 4026 819 4026 .L065 ;; incgraphic vertical_shooting_explosion_02.png 160A 820 4026 821 4026 .L066 ;; incgraphic vertical_shooting_explosion_03.png 160A 822 4026 823 4026 .L067 ;; incgraphic vertical_shooting_explosion_04.png 160A 824 4026 825 4026 .L068 ;; incgraphic vertical_shooting_explosion_05.png 160A 826 4026 827 4026 .L069 ;; incgraphic vertical_shooting_explosion_06.png 160A 828 4026 829 4026 .L070 ;; incgraphic vertical_shooting_explosion_07.png 160A 830 4026 831 4026 .L071 ;; incgraphic vertical_shooting_explosion_08.png 160A 832 4026 833 4026 .L072 ;; incgraphic vertical_shooting_explosion_09.png 160A 834 4026 835 4026 .L073 ;; incgraphic vertical_shooting_explosion_10.png 160A 836 4026 837 4026 .L074 ;; incgraphic vertical_shooting_laser.png 160A 838 4026 839 4026 . 840 4026 ;; 841 4026 842 4026 .L075 ;; newblock 843 4026 844 4026 .L076 ;; newblock 845 4026 846 4026 . 847 4026 ;; 848 4026 849 4026 . 850 4026 ;; 851 4026 852 4026 .L077 ;; dmahole 0 853 4026 854 4026 4c 00 b8 jmp dmahole_0 855 4029 gameend 856 4029 DMAHOLEEND2 SET . 28631 bytes of ROM space left in the main area. 857 4029 echo " ",[($B000 - gameend)]d , "bytes of ROM space left in the main area." 858 4029 - if ($B000 - gameend) < 0 859 4029 -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 860 4029 endif 861 4029 862 b000 ORG $B000,0 ; ************* 863 b000 864 b000 vertical_shooting_font 865 b000 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 866 b020 00 00 00 00* HEX 00000000000000000000000000 867 b02d vertical_shooting_ship 868 b02d 07 d0 HEX 07d0 869 b02f vertical_shooting_ship_tallsprite_00 870 b02f 80 02 HEX 8002 871 b031 vertical_shooting_bullet 872 b031 28 HEX 28 873 b032 vertical_shooting_enemyshot 874 b032 00 HEX 00 875 b033 vertical_shooting_powerup 876 b033 28 00 HEX 2800 877 b035 vertical_shooting_enemy01 878 b035 09 e0 HEX 09e0 879 b037 vertical_shooting_enemy01_tallsprite_00 880 b037 40 03 HEX 4003 881 b039 882 b100 ORG $B100,0 ; ************* 883 b100 884 b100 ;vertical_shooting_font 885 b100 00 54 54 54* HEX 0054545454045454045404445054505440544454104454444410401444501014 886 b120 10 44 44 10* HEX 10444410544040101040400000 887 b12d ;vertical_shooting_ship 888 b12d 07 d0 HEX 07d0 889 b12f ;vertical_shooting_ship_tallsprite_00 890 b12f 80 02 HEX 8002 891 b131 ;vertical_shooting_bullet 892 b131 28 HEX 28 893 b132 ;vertical_shooting_enemyshot 894 b132 88 HEX 88 895 b133 ;vertical_shooting_powerup 896 b133 78 08 HEX 7808 897 b135 ;vertical_shooting_enemy01 898 b135 09 e0 HEX 09e0 899 b137 ;vertical_shooting_enemy01_tallsprite_00 900 b137 50 0f HEX 500f 901 b139 902 b200 ORG $B200,0 ; ************* 903 b200 904 b200 ;vertical_shooting_font 905 b200 00 44 10 40* HEX 0044104004040444044404444440444040444410444440444444404444041044 906 b220 10 54 44 10* HEX 10544410400010000000100000 907 b22d ;vertical_shooting_ship 908 b22d 03 c0 HEX 03c0 909 b22f ;vertical_shooting_ship_tallsprite_00 910 b22f a1 4a HEX a14a 911 b231 ;vertical_shooting_bullet 912 b231 3c HEX 3c 913 b232 ;vertical_shooting_enemyshot 914 b232 10 HEX 10 915 b233 ;vertical_shooting_powerup 916 b233 78 1e HEX 781e 917 b235 ;vertical_shooting_enemy01 918 b235 19 ec HEX 19ec 919 b237 ;vertical_shooting_enemy01_tallsprite_00 920 b237 5a af HEX 5aaf 921 b239 922 b300 ORG $B300,0 ; ************* 923 b300 924 b300 ;vertical_shooting_font 925 b300 00 44 10 40* HEX 0044104004040444044404444440444040444410044440444444404444041044 926 b320 54 54 44 10* HEX 54544410100000101000000000 927 b32d ;vertical_shooting_ship 928 b32d 01 40 HEX 0140 929 b32f ;vertical_shooting_ship_tallsprite_00 930 b32f a5 5a HEX a55a 931 b331 ;vertical_shooting_bullet 932 b331 3c HEX 3c 933 b332 ;vertical_shooting_enemyshot 934 b332 74 HEX 74 935 b333 ;vertical_shooting_powerup 936 b333 7a a4 HEX 7aa4 937 b335 ;vertical_shooting_enemy01 938 b335 59 ef HEX 59ef 939 b337 ;vertical_shooting_enemy01_tallsprite_00 940 b337 59 ef HEX 59ef 941 b339 942 b400 ORG $B400,0 ; ************* 943 b400 944 b400 ;vertical_shooting_font 945 b400 00 44 10 54* HEX 0044105454545454045454545040445454445410045040544444504450101044 946 b420 44 44 10 10* HEX 44441010100000101000000000 947 b42d ;vertical_shooting_ship 948 b42d 01 40 HEX 0140 949 b42f ;vertical_shooting_ship_tallsprite_00 950 b42f a5 5a HEX a55a 951 b431 ;vertical_shooting_bullet 952 b431 14 HEX 14 953 b432 ;vertical_shooting_enemyshot 954 b432 74 HEX 74 955 b433 ;vertical_shooting_powerup 956 b433 75 7a HEX 757a 957 b435 ;vertical_shooting_enemy01 958 b435 59 6f HEX 596f 959 b437 ;vertical_shooting_enemy01_tallsprite_00 960 b437 59 ef HEX 59ef 961 b439 962 b500 ORG $B500,0 ; ************* 963 b500 964 b500 ;vertical_shooting_font 965 b500 00 44 10 04* HEX 0044100404444040044444444440444040404410044440544444444444401044 966 b520 44 44 44 54* HEX 44444454100000041000000000 967 b52d ;vertical_shooting_ship 968 b52d 01 40 HEX 0140 969 b52f ;vertical_shooting_ship_tallsprite_00 970 b52f a5 5a HEX a55a 971 b531 ;vertical_shooting_bullet 972 b531 14 HEX 14 973 b532 ;vertical_shooting_enemyshot 974 b532 74 HEX 74 975 b533 ;vertical_shooting_powerup 976 b533 78 1e HEX 781e 977 b535 ;vertical_shooting_enemy01 978 b535 5a af HEX 5aaf 979 b537 ;vertical_shooting_enemy01_tallsprite_00 980 b537 19 ec HEX 19ec 981 b539 982 b600 ORG $B600,0 ; ************* 983 b600 984 b600 ;vertical_shooting_font 985 b600 00 44 50 04* HEX 0044500404444040044444444440444040404410044440544444444444401044 986 b620 44 44 44 44* HEX 44444444040000441000001044 987 b62d ;vertical_shooting_ship 988 b62d 01 40 HEX 0140 989 b62f ;vertical_shooting_ship_tallsprite_00 990 b62f a7 da HEX a7da 991 b631 ;vertical_shooting_bullet 992 b631 14 HEX 14 993 b632 ;vertical_shooting_enemyshot 994 b632 10 HEX 10 995 b633 ;vertical_shooting_powerup 996 b633 7a bc HEX 7abc 997 b635 ;vertical_shooting_enemy01 998 b635 50 07 HEX 5007 999 b637 ;vertical_shooting_enemy01_tallsprite_00 1000 b637 09 e0 HEX 09e0 1001 b639 1002 b700 ORG $B700,0 ; ************* 1003 b700 1004 b700 ;vertical_shooting_font 1005 b700 00 54 10 54* HEX 0054105454445454545454545054505454544454044440445010501050145444 1006 b720 44 44 44 44* HEX 44444444540000101040401044 1007 b72d ;vertical_shooting_ship 1008 b72d 01 40 HEX 0140 1009 b72f ;vertical_shooting_ship_tallsprite_00 1010 b72f 27 d8 HEX 27d8 1011 b731 ;vertical_shooting_bullet 1012 b731 00 HEX 00 1013 b732 ;vertical_shooting_enemyshot 1014 b732 88 HEX 88 1015 b733 ;vertical_shooting_powerup 1016 b733 55 50 HEX 5550 1017 b735 ;vertical_shooting_enemy01 1018 b735 40 01 HEX 4001 1019 b737 ;vertical_shooting_enemy01_tallsprite_00 1020 b737 09 e0 HEX 09e0 1021 b739 1022 b800 ORG $B800,0 ; ************* 1023 b800 dmahole_0 1024 b800 DMAHOLESTART0 SET . 1025 b800 . 1026 b800 ;; 1027 b800 1028 b800 . 1029 b800 ;; 1030 b800 1031 b800 .palettes 1032 b800 ;; palettes 1033 b800 1034 b800 .L078 ;; P0C1 = $0F : P0C2 = $05 : P0C3 = $32 1035 b800 1036 b800 a9 0f LDA #$0F 1037 b802 85 21 STA P0C1 1038 b804 a9 05 LDA #$05 1039 b806 85 22 STA P0C2 1040 b808 a9 32 LDA #$32 1041 b80a 85 23 STA P0C3 1042 b80c .L079 ;; P1C1 = $0F : P1C2 = $EE : P1C3 = $E7 1043 b80c 1044 b80c a9 0f LDA #$0F 1045 b80e 85 25 STA P1C1 1046 b810 a9 ee LDA #$EE 1047 b812 85 26 STA P1C2 1048 b814 a9 e7 LDA #$E7 1049 b816 85 27 STA P1C3 1050 b818 .L080 ;; P2C1 = $9D : P2C2 = $73 : P2C3 = $88 1051 b818 1052 b818 a9 9d LDA #$9D 1053 b81a 85 29 STA P2C1 1054 b81c a9 73 LDA #$73 1055 b81e 85 2a STA P2C2 1056 b820 a9 88 LDA #$88 1057 b822 85 2b STA P2C3 1058 b824 .L081 ;; P3C1 = $FB : P3C2 = $F2 : P3C3 = $25 1059 b824 1060 b824 a9 fb LDA #$FB 1061 b826 85 2d STA P3C1 1062 b828 a9 f2 LDA #$F2 1063 b82a 85 2e STA P3C2 1064 b82c a9 25 LDA #$25 1065 b82e 85 2f STA P3C3 1066 b830 . 1067 b830 ;; 1068 b830 1069 b830 .plot 1070 b830 ;; plot 1071 b830 1072 b830 .L082 ;; playerX = 80 : playerY = 144 : playerFlag = 0 : fire_debounce = 0 : isDead_flag = 0 1073 b830 1074 b830 a9 50 LDA #80 1075 b832 8d 41 01 STA playerX 1076 b835 a9 90 LDA #144 1077 b837 8d 42 01 STA playerY 1078 b83a a9 00 LDA #0 1079 b83c 8d 4d 01 STA playerFlag 1080 b83f 8d 43 01 STA fire_debounce 1081 b842 8d 6a 01 STA isDead_flag 1082 b845 .L083 ;; joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 1083 b845 1084 b845 a9 00 LDA #0 1085 b847 8d 44 01 STA joyposup 1086 b84a 8d 45 01 STA joyposdown 1087 b84d 8d 46 01 STA joyposleft 1088 b850 8d 47 01 STA joyposright 1089 b853 .L084 ;; bulletX = 0 : bulletY = 0 : lives = 3 1090 b853 1091 b853 a9 00 LDA #0 1092 b855 8d 48 01 STA bulletX 1093 b858 8d 49 01 STA bulletY 1094 b85b a9 03 LDA #3 1095 b85d 8d 64 01 STA lives 1096 b860 .L085 ;; enemy_shotX = 0 : enemy_shotY = 0 : enemy_shotFlag = 0 1097 b860 1098 b860 a9 00 LDA #0 1099 b862 8d 4a 01 STA enemy_shotX 1100 b865 8d 4b 01 STA enemy_shotY 1101 b868 8d 4c 01 STA enemy_shotFlag 1102 b86b .L086 ;; rMovement1 = 1 : rMovement2 = 1 : rMovement3 = 1 : rMovement4 = 1 1103 b86b 1104 b86b a9 01 LDA #1 1105 b86d 8d 4e 01 STA rMovement1 1106 b870 8d 53 01 STA rMovement2 1107 b873 8d 5a 01 STA rMovement3 1108 b876 8d 5b 01 STA rMovement4 1109 b879 .L087 ;; rMovement5 = 1 : rMovement6 = 1 : rDirection = 1 1110 b879 1111 b879 a9 01 LDA #1 1112 b87b 8d 5c 01 STA rMovement5 1113 b87e 8d 5d 01 STA rMovement6 1114 b881 8d 4f 01 STA rDirection 1115 b884 .L088 ;; power_upX = 5 : power_upY = 32 : power_upFlag = 0 1116 b884 1117 b884 a9 05 LDA #5 1118 b886 8d 50 01 STA power_upX 1119 b889 a9 20 LDA #32 1120 b88b 8d 51 01 STA power_upY 1121 b88e a9 00 LDA #0 1122 b890 8d 52 01 STA power_upFlag 1123 b893 .L089 ;; enemy_shotSlowdown = 0 : bulletSlowdown = 0 : power_upSlowdown = 0 1124 b893 1125 b893 a9 00 LDA #0 1126 b895 8d 56 01 STA enemy_shotSlowdown 1127 b898 8d 55 01 STA bulletSlowdown 1128 b89b 8d 54 01 STA power_upSlowdown 1129 b89e .L090 ;; enemy01_X = 0 : enemy01_Y = 0 : enemy01_Flag = 0 : enemy01_speed = 6 1130 b89e 1131 b89e a9 00 LDA #0 1132 b8a0 8d 57 01 STA enemy01_X 1133 b8a3 8d 58 01 STA enemy01_Y 1134 b8a6 8d 59 01 STA enemy01_Flag 1135 b8a9 a9 06 LDA #6 1136 b8ab 8d 5e 01 STA enemy01_speed 1137 b8ae .L091 ;; frameCounter = 0 : gameover_flag = 0 1138 b8ae 1139 b8ae a9 00 LDA #0 1140 b8b0 8d 40 01 STA frameCounter 1141 b8b3 8d 5f 01 STA gameover_flag 1142 b8b6 .L092 ;; extra_shipX = 0 : extra_shipY = 0 : extra_shipFlag = 0 1143 b8b6 1144 b8b6 a9 00 LDA #0 1145 b8b8 8d 60 01 STA extra_shipX 1146 b8bb 8d 61 01 STA extra_shipY 1147 b8be 8d 62 01 STA extra_shipFlag 1148 b8c1 .L093 ;; twinlaserX = 0 : twinlaserY = 0 : twinlaser_flag = 0 : twinlaser_Slowdown = 0 1149 b8c1 1150 b8c1 a9 00 LDA #0 1151 b8c3 8d 65 01 STA twinlaserX 1152 b8c6 8d 66 01 STA twinlaserY 1153 b8c9 8d 67 01 STA twinlaser_flag 1154 b8cc 8d 68 01 STA twinlaser_Slowdown 1155 b8cf .L094 ;; enemy01_Slowdown = 0 1156 b8cf 1157 b8cf a9 00 LDA #0 1158 b8d1 8d 6b 01 STA enemy01_Slowdown 1159 b8d4 . 1160 b8d4 ;; 1161 b8d4 1162 b8d4 .L095 ;; gosub titlescreen 1163 b8d4 1164 b8d4 20 a0 da jsr .titlescreen 1165 b8d7 1166 b8d7 . 1167 b8d7 ;; 1168 b8d7 1169 b8d7 .L096 ;; gosub initialise_gamescreen 1170 b8d7 1171 b8d7 20 ad db jsr .initialise_gamescreen 1172 b8da 1173 b8da . 1174 b8da ;; 1175 b8da 1176 b8da . 1177 b8da ;; 1178 b8da 1179 b8da . 1180 b8da ;; 1181 b8da 1182 b8da .main 1183 b8da ;; main 1184 b8da 1185 b8da .L097 ;; frameCounter = frameCounter + 1 1186 b8da 1187 b8da ad 40 01 LDA frameCounter 1188 b8dd 18 CLC 1189 b8de 69 01 ADC #1 1190 b8e0 8d 40 01 STA frameCounter 1191 b8e3 .L098 ;; if frameCounter > 10 then frameCounter = 0 1192 b8e3 1193 b8e3 a9 0a LDA #10 1194 b8e5 cd 40 01 CMP frameCounter 1195 b8e8 b0 05 BCS .skipL098 1196 b8ea .condpart0 1197 b8ea a9 00 LDA #0 1198 b8ec 8d 40 01 STA frameCounter 1199 b8ef .skipL098 1200 b8ef .mainloop 1201 b8ef ;; mainloop 1202 b8ef 1203 b8ef .L099 ;; rMovement1 = ( rand & 7 ) - 2 1204 b8ef 1205 b8ef ; complex statement detected 1206 b8ef 20 fd f3 jsr randomize 1207 b8f2 29 07 AND #7 1208 b8f4 38 SEC 1209 b8f5 e9 02 SBC #2 1210 b8f7 8d 4e 01 STA rMovement1 1211 b8fa .L0100 ;; rMovement2 = ( rand & 6 ) 1212 b8fa 1213 b8fa ; complex statement detected 1214 b8fa 20 fd f3 jsr randomize 1215 b8fd 29 06 AND #6 1216 b8ff 8d 53 01 STA rMovement2 1217 b902 .L0101 ;; rMovement3 = ( rand & 3 ) + 1 1218 b902 1219 b902 ; complex statement detected 1220 b902 20 fd f3 jsr randomize 1221 b905 29 03 AND #3 1222 b907 18 CLC 1223 b908 69 01 ADC #1 1224 b90a 8d 5a 01 STA rMovement3 1225 b90d .L0102 ;; rMovement4 = ( rand & 5 ) + 2 1226 b90d 1227 b90d ; complex statement detected 1228 b90d 20 fd f3 jsr randomize 1229 b910 29 05 AND #5 1230 b912 18 CLC 1231 b913 69 02 ADC #2 1232 b915 8d 5b 01 STA rMovement4 1233 b918 .L0103 ;; rMovement5 = ( rand & 5 ) + 1 1234 b918 1235 b918 ; complex statement detected 1236 b918 20 fd f3 jsr randomize 1237 b91b 29 05 AND #5 1238 b91d 18 CLC 1239 b91e 69 01 ADC #1 1240 b920 8d 5c 01 STA rMovement5 1241 b923 .L0104 ;; rMovement6 = ( rand & 6 ) - 1 1242 b923 1243 b923 ; complex statement detected 1244 b923 20 fd f3 jsr randomize 1245 b926 29 06 AND #6 1246 b928 38 SEC 1247 b929 e9 01 SBC #1 1248 b92b 8d 5d 01 STA rMovement6 1249 b92e .L0105 ;; rDirection = ( rand & 4 ) 1250 b92e 1251 b92e ; complex statement detected 1252 b92e 20 fd f3 jsr randomize 1253 b931 29 04 AND #4 1254 b933 8d 4f 01 STA rDirection 1255 b936 .L0106 ;; if switchreset then reboot 1256 b936 1257 b936 20 85 f4 jsr checkresetswitch 1258 b939 d0 03 BNE .skipL0106 1259 b93b .condpart1 1260 b93b 4c 72 f5 JMP START 1261 b93e .skipL0106 1262 b93e . 1263 b93e ;; 1264 b93e 1265 b93e . 1266 b93e ;; 1267 b93e 1268 b93e .L0107 ;; enemy_shotSlowdown = enemy_shotSlowdown + 1 1269 b93e 1270 b93e ad 56 01 LDA enemy_shotSlowdown 1271 b941 18 CLC 1272 b942 69 01 ADC #1 1273 b944 8d 56 01 STA enemy_shotSlowdown 1274 b947 .L0108 ;; if enemy_shotSlowdown > 8 then enemy_shotSlowdown = 0 1275 b947 1276 b947 a9 08 LDA #8 1277 b949 cd 56 01 CMP enemy_shotSlowdown 1278 b94c b0 05 BCS .skipL0108 1279 b94e .condpart2 1280 b94e a9 00 LDA #0 1281 b950 8d 56 01 STA enemy_shotSlowdown 1282 b953 .skipL0108 1283 b953 . 1284 b953 ;; 1285 b953 1286 b953 .L0109 ;; enemy01_Slowdown = enemy01_Slowdown + 1 1287 b953 1288 b953 ad 6b 01 LDA enemy01_Slowdown 1289 b956 18 CLC 1290 b957 69 01 ADC #1 1291 b959 8d 6b 01 STA enemy01_Slowdown 1292 b95c .L0110 ;; if enemy01_Slowdown > 8 then enemy01_Slowdown = 0 1293 b95c 1294 b95c a9 08 LDA #8 1295 b95e cd 6b 01 CMP enemy01_Slowdown 1296 b961 b0 05 BCS .skipL0110 1297 b963 .condpart3 1298 b963 a9 00 LDA #0 1299 b965 8d 6b 01 STA enemy01_Slowdown 1300 b968 .skipL0110 1301 b968 . 1302 b968 ;; 1303 b968 1304 b968 .L0111 ;; bulletSlowdown = bulletSlowdown + 1 1305 b968 1306 b968 ad 55 01 LDA bulletSlowdown 1307 b96b 18 CLC 1308 b96c 69 01 ADC #1 1309 b96e 8d 55 01 STA bulletSlowdown 1310 b971 .L0112 ;; if bulletSlowdown > 6 then bulletSlowdown = 0 1311 b971 1312 b971 a9 06 LDA #6 1313 b973 cd 55 01 CMP bulletSlowdown 1314 b976 b0 05 BCS .skipL0112 1315 b978 .condpart4 1316 b978 a9 00 LDA #0 1317 b97a 8d 55 01 STA bulletSlowdown 1318 b97d .skipL0112 1319 b97d . 1320 b97d ;; 1321 b97d 1322 b97d .L0113 ;; power_upSlowdown = power_upSlowdown + 1 1323 b97d 1324 b97d ad 54 01 LDA power_upSlowdown 1325 b980 18 CLC 1326 b981 69 01 ADC #1 1327 b983 8d 54 01 STA power_upSlowdown 1328 b986 .L0114 ;; if power_upSlowdown > 7 then power_upSlowdown = 0 1329 b986 1330 b986 a9 07 LDA #7 1331 b988 cd 54 01 CMP power_upSlowdown 1332 b98b b0 05 BCS .skipL0114 1333 b98d .condpart5 1334 b98d a9 00 LDA #0 1335 b98f 8d 54 01 STA power_upSlowdown 1336 b992 .skipL0114 1337 b992 . 1338 b992 ;; 1339 b992 1340 b992 .L0115 ;; twinlaser_Slowdown = twinlaser_Slowdown + 1 1341 b992 1342 b992 ad 68 01 LDA twinlaser_Slowdown 1343 b995 18 CLC 1344 b996 69 01 ADC #1 1345 b998 8d 68 01 STA twinlaser_Slowdown 1346 b99b .L0116 ;; if twinlaser_Slowdown > 5 then twinlaser_Slowdown = 0 1347 b99b 1348 b99b a9 05 LDA #5 1349 b99d cd 68 01 CMP twinlaser_Slowdown 1350 b9a0 b0 05 BCS .skipL0116 1351 b9a2 .condpart6 1352 b9a2 a9 00 LDA #0 1353 b9a4 8d 68 01 STA twinlaser_Slowdown 1354 b9a7 .skipL0116 1355 b9a7 . 1356 b9a7 ;; 1357 b9a7 1358 b9a7 .L0117 ;; if joy0up && joyposup = - 2 then gosub SetBulletHome 1359 b9a7 1360 b9a7 a9 10 lda #$10 1361 b9a9 2c 80 02 bit SWCHA 1362 b9ac d0 10 BNE .skipL0117 1363 b9ae .condpart7 1364 b9ae ; complex condition detected 1365 b9ae a9 fe LDA #254 1366 b9b0 48 PHA 1367 b9b1 ba TSX 1368 b9b2 68 PLA 1369 b9b3 ad 44 01 LDA joyposup 1370 b9b6 dd 01 01 CMP $101,x 1371 b9b9 d0 03 BNE .skip7then 1372 b9bb .condpart8 1373 b9bb 20 92 cd jsr .SetBulletHome 1374 b9be 1375 b9be .skip7then 1376 b9be .skipL0117 1377 b9be .L0118 ;; if joy0down && joyposdown = - 2 then gosub SetBulletHome 1378 b9be 1379 b9be a9 20 lda #$20 1380 b9c0 2c 80 02 bit SWCHA 1381 b9c3 d0 10 BNE .skipL0118 1382 b9c5 .condpart9 1383 b9c5 ; complex condition detected 1384 b9c5 a9 fe LDA #254 1385 b9c7 48 PHA 1386 b9c8 ba TSX 1387 b9c9 68 PLA 1388 b9ca ad 45 01 LDA joyposdown 1389 b9cd dd 01 01 CMP $101,x 1390 b9d0 d0 03 BNE .skip9then 1391 b9d2 .condpart10 1392 b9d2 20 92 cd jsr .SetBulletHome 1393 b9d5 1394 b9d5 .skip9then 1395 b9d5 .skipL0118 1396 b9d5 .L0119 ;; if joy0up && joyposleft = - 2 then gosub SetBulletHome 1397 b9d5 1398 b9d5 a9 10 lda #$10 1399 b9d7 2c 80 02 bit SWCHA 1400 b9da d0 10 BNE .skipL0119 1401 b9dc .condpart11 1402 b9dc ; complex condition detected 1403 b9dc a9 fe LDA #254 1404 b9de 48 PHA 1405 b9df ba TSX 1406 b9e0 68 PLA 1407 b9e1 ad 46 01 LDA joyposleft 1408 b9e4 dd 01 01 CMP $101,x 1409 b9e7 d0 03 BNE .skip11then 1410 b9e9 .condpart12 1411 b9e9 20 92 cd jsr .SetBulletHome 1412 b9ec 1413 b9ec .skip11then 1414 b9ec .skipL0119 1415 b9ec .L0120 ;; if joy0down && joyposright = - 2 then gosub SetBulletHome 1416 b9ec 1417 b9ec a9 20 lda #$20 1418 b9ee 2c 80 02 bit SWCHA 1419 b9f1 d0 10 BNE .skipL0120 1420 b9f3 .condpart13 1421 b9f3 ; complex condition detected 1422 b9f3 a9 fe LDA #254 1423 b9f5 48 PHA 1424 b9f6 ba TSX 1425 b9f7 68 PLA 1426 b9f8 ad 47 01 LDA joyposright 1427 b9fb dd 01 01 CMP $101,x 1428 b9fe d0 03 BNE .skip13then 1429 ba00 .condpart14 1430 ba00 20 92 cd jsr .SetBulletHome 1431 ba03 1432 ba03 .skip13then 1433 ba03 .skipL0120 1434 ba03 .L0121 ;; if joy0up && joyposup = - 2 then gosub SetLaserHome 1435 ba03 1436 ba03 a9 10 lda #$10 1437 ba05 2c 80 02 bit SWCHA 1438 ba08 d0 10 BNE .skipL0121 1439 ba0a .condpart15 1440 ba0a ; complex condition detected 1441 ba0a a9 fe LDA #254 1442 ba0c 48 PHA 1443 ba0d ba TSX 1444 ba0e 68 PLA 1445 ba0f ad 44 01 LDA joyposup 1446 ba12 dd 01 01 CMP $101,x 1447 ba15 d0 03 BNE .skip15then 1448 ba17 .condpart16 1449 ba17 20 a5 cd jsr .SetLaserHome 1450 ba1a 1451 ba1a .skip15then 1452 ba1a .skipL0121 1453 ba1a .L0122 ;; if joy0down && joyposdown = - 2 then gosub SetLaserHome 1454 ba1a 1455 ba1a a9 20 lda #$20 1456 ba1c 2c 80 02 bit SWCHA 1457 ba1f d0 10 BNE .skipL0122 1458 ba21 .condpart17 1459 ba21 ; complex condition detected 1460 ba21 a9 fe LDA #254 1461 ba23 48 PHA 1462 ba24 ba TSX 1463 ba25 68 PLA 1464 ba26 ad 45 01 LDA joyposdown 1465 ba29 dd 01 01 CMP $101,x 1466 ba2c d0 03 BNE .skip17then 1467 ba2e .condpart18 1468 ba2e 20 a5 cd jsr .SetLaserHome 1469 ba31 1470 ba31 .skip17then 1471 ba31 .skipL0122 1472 ba31 .L0123 ;; if joy0up && joyposleft = - 2 then gosub SetLaserHome 1473 ba31 1474 ba31 a9 10 lda #$10 1475 ba33 2c 80 02 bit SWCHA 1476 ba36 d0 10 BNE .skipL0123 1477 ba38 .condpart19 1478 ba38 ; complex condition detected 1479 ba38 a9 fe LDA #254 1480 ba3a 48 PHA 1481 ba3b ba TSX 1482 ba3c 68 PLA 1483 ba3d ad 46 01 LDA joyposleft 1484 ba40 dd 01 01 CMP $101,x 1485 ba43 d0 03 BNE .skip19then 1486 ba45 .condpart20 1487 ba45 20 a5 cd jsr .SetLaserHome 1488 ba48 1489 ba48 .skip19then 1490 ba48 .skipL0123 1491 ba48 .L0124 ;; if joy0down && joyposright = - 2 then gosub SetLaserHome 1492 ba48 1493 ba48 a9 20 lda #$20 1494 ba4a 2c 80 02 bit SWCHA 1495 ba4d d0 10 BNE .skipL0124 1496 ba4f .condpart21 1497 ba4f ; complex condition detected 1498 ba4f a9 fe LDA #254 1499 ba51 48 PHA 1500 ba52 ba TSX 1501 ba53 68 PLA 1502 ba54 ad 47 01 LDA joyposright 1503 ba57 dd 01 01 CMP $101,x 1504 ba5a d0 03 BNE .skip21then 1505 ba5c .condpart22 1506 ba5c 20 a5 cd jsr .SetLaserHome 1507 ba5f 1508 ba5f .skip21then 1509 ba5f .skipL0124 1510 ba5f .L0125 ;; if joy0up then playerY = playerY - 1 : joyposup = 1 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 1511 ba5f 1512 ba5f a9 10 lda #$10 1513 ba61 2c 80 02 bit SWCHA 1514 ba64 d0 19 BNE .skipL0125 1515 ba66 .condpart23 1516 ba66 ad 42 01 LDA playerY 1517 ba69 38 SEC 1518 ba6a e9 01 SBC #1 1519 ba6c 8d 42 01 STA playerY 1520 ba6f a9 01 LDA #1 1521 ba71 8d 44 01 STA joyposup 1522 ba74 a9 00 LDA #0 1523 ba76 8d 45 01 STA joyposdown 1524 ba79 8d 46 01 STA joyposleft 1525 ba7c 8d 47 01 STA joyposright 1526 ba7f .skipL0125 1527 ba7f .L0126 ;; if joy0down then playerY = playerY + 1 : joyposup = 0 : joyposdown = 1 : joyposleft = 0 : joyposright = 0 1528 ba7f 1529 ba7f a9 20 lda #$20 1530 ba81 2c 80 02 bit SWCHA 1531 ba84 d0 1b BNE .skipL0126 1532 ba86 .condpart24 1533 ba86 ad 42 01 LDA playerY 1534 ba89 18 CLC 1535 ba8a 69 01 ADC #1 1536 ba8c 8d 42 01 STA playerY 1537 ba8f a9 00 LDA #0 1538 ba91 8d 44 01 STA joyposup 1539 ba94 a9 01 LDA #1 1540 ba96 8d 45 01 STA joyposdown 1541 ba99 a9 00 LDA #0 1542 ba9b 8d 46 01 STA joyposleft 1543 ba9e 8d 47 01 STA joyposright 1544 baa1 .skipL0126 1545 baa1 .L0127 ;; if joy0left then playerX = playerX - 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 1 : joyposright = 0 1546 baa1 1547 baa1 2c 80 02 bit SWCHA 1548 baa4 70 1b BVS .skipL0127 1549 baa6 .condpart25 1550 baa6 ad 41 01 LDA playerX 1551 baa9 38 SEC 1552 baaa e9 01 SBC #1 1553 baac 8d 41 01 STA playerX 1554 baaf a9 00 LDA #0 1555 bab1 8d 44 01 STA joyposup 1556 bab4 8d 45 01 STA joyposdown 1557 bab7 a9 01 LDA #1 1558 bab9 8d 46 01 STA joyposleft 1559 babc a9 00 LDA #0 1560 babe 8d 47 01 STA joyposright 1561 bac1 .skipL0127 1562 bac1 .L0128 ;; if joy0right then playerX = playerX + 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 1 1563 bac1 1564 bac1 2c 80 02 bit SWCHA 1565 bac4 30 19 BMI .skipL0128 1566 bac6 .condpart26 1567 bac6 ad 41 01 LDA playerX 1568 bac9 18 CLC 1569 baca 69 01 ADC #1 1570 bacc 8d 41 01 STA playerX 1571 bacf a9 00 LDA #0 1572 bad1 8d 44 01 STA joyposup 1573 bad4 8d 45 01 STA joyposdown 1574 bad7 8d 46 01 STA joyposleft 1575 bada a9 01 LDA #1 1576 badc 8d 47 01 STA joyposright 1577 badf .skipL0128 1578 badf .L0129 ;; if joy0fire && joyposup = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1579 badf 1580 badf 2c 02 21 bit sINPT1 1581 bae2 10 29 BPL .skipL0129 1582 bae4 .condpart27 1583 bae4 ad 44 01 LDA joyposup 1584 bae7 c9 01 CMP #1 1585 bae9 d0 22 BNE .skip27then 1586 baeb .condpart28 1587 baeb ad 49 01 LDA bulletY 1588 baee 38 SEC 1589 baef e9 05 SBC #5 1590 baf1 8d 49 01 STA bulletY 1591 baf4 a9 01 lda #1 1592 baf6 85 de sta sfxschedulelock 1593 baf8 a9 f4 lda #sfx_pulsecannon 1596 bafe 85 e1 sta sfxinstrumenthi 1597 bb00 a9 00 lda #0 1598 bb02 85 e2 sta sfxpitchoffset ; no pitch modification 1599 bb04 85 e3 sta sfxnoteindex ; not a musical note 1600 bb06 20 58 f2 jsr schedulesfx 1601 bb09 a9 00 lda #0 1602 bb0b 85 de sta sfxschedulelock 1603 bb0d .skip27then 1604 bb0d .skipL0129 1605 bb0d .L0130 ;; if joy0fire && joyposdown = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1606 bb0d 1607 bb0d 2c 02 21 bit sINPT1 1608 bb10 10 29 BPL .skipL0130 1609 bb12 .condpart29 1610 bb12 ad 45 01 LDA joyposdown 1611 bb15 c9 01 CMP #1 1612 bb17 d0 22 BNE .skip29then 1613 bb19 .condpart30 1614 bb19 ad 49 01 LDA bulletY 1615 bb1c 38 SEC 1616 bb1d e9 05 SBC #5 1617 bb1f 8d 49 01 STA bulletY 1618 bb22 a9 01 lda #1 1619 bb24 85 de sta sfxschedulelock 1620 bb26 a9 f4 lda #sfx_pulsecannon 1623 bb2c 85 e1 sta sfxinstrumenthi 1624 bb2e a9 00 lda #0 1625 bb30 85 e2 sta sfxpitchoffset ; no pitch modification 1626 bb32 85 e3 sta sfxnoteindex ; not a musical note 1627 bb34 20 58 f2 jsr schedulesfx 1628 bb37 a9 00 lda #0 1629 bb39 85 de sta sfxschedulelock 1630 bb3b .skip29then 1631 bb3b .skipL0130 1632 bb3b .L0131 ;; if joy0fire && joyposleft = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1633 bb3b 1634 bb3b 2c 02 21 bit sINPT1 1635 bb3e 10 29 BPL .skipL0131 1636 bb40 .condpart31 1637 bb40 ad 46 01 LDA joyposleft 1638 bb43 c9 01 CMP #1 1639 bb45 d0 22 BNE .skip31then 1640 bb47 .condpart32 1641 bb47 ad 49 01 LDA bulletY 1642 bb4a 38 SEC 1643 bb4b e9 05 SBC #5 1644 bb4d 8d 49 01 STA bulletY 1645 bb50 a9 01 lda #1 1646 bb52 85 de sta sfxschedulelock 1647 bb54 a9 f4 lda #sfx_pulsecannon 1650 bb5a 85 e1 sta sfxinstrumenthi 1651 bb5c a9 00 lda #0 1652 bb5e 85 e2 sta sfxpitchoffset ; no pitch modification 1653 bb60 85 e3 sta sfxnoteindex ; not a musical note 1654 bb62 20 58 f2 jsr schedulesfx 1655 bb65 a9 00 lda #0 1656 bb67 85 de sta sfxschedulelock 1657 bb69 .skip31then 1658 bb69 .skipL0131 1659 bb69 .L0132 ;; if joy0fire && joyposright = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1660 bb69 1661 bb69 2c 02 21 bit sINPT1 1662 bb6c 10 29 BPL .skipL0132 1663 bb6e .condpart33 1664 bb6e ad 47 01 LDA joyposright 1665 bb71 c9 01 CMP #1 1666 bb73 d0 22 BNE .skip33then 1667 bb75 .condpart34 1668 bb75 ad 49 01 LDA bulletY 1669 bb78 38 SEC 1670 bb79 e9 05 SBC #5 1671 bb7b 8d 49 01 STA bulletY 1672 bb7e a9 01 lda #1 1673 bb80 85 de sta sfxschedulelock 1674 bb82 a9 f4 lda #sfx_pulsecannon 1677 bb88 85 e1 sta sfxinstrumenthi 1678 bb8a a9 00 lda #0 1679 bb8c 85 e2 sta sfxpitchoffset ; no pitch modification 1680 bb8e 85 e3 sta sfxnoteindex ; not a musical note 1681 bb90 20 58 f2 jsr schedulesfx 1682 bb93 a9 00 lda #0 1683 bb95 85 de sta sfxschedulelock 1684 bb97 .skip33then 1685 bb97 .skipL0132 1686 bb97 .L0133 ;; if !joy0fire then bulletX = playerX + 2 : bulletY = playerY - 8 1687 bb97 1688 bb97 2c 02 21 bit sINPT1 1689 bb9a 30 12 BMI .skipL0133 1690 bb9c .condpart35 1691 bb9c ad 41 01 LDA playerX 1692 bb9f 18 CLC 1693 bba0 69 02 ADC #2 1694 bba2 8d 48 01 STA bulletX 1695 bba5 ad 42 01 LDA playerY 1696 bba8 38 SEC 1697 bba9 e9 08 SBC #8 1698 bbab 8d 49 01 STA bulletY 1699 bbae .skipL0133 1700 bbae . 1701 bbae ;; 1702 bbae 1703 bbae . 1704 bbae ;; 1705 bbae 1706 bbae . 1707 bbae ;; 1708 bbae 1709 bbae .L0134 ;; if playerX > 152 then playerX = playerX - 1 1710 bbae 1711 bbae a9 98 LDA #152 1712 bbb0 cd 41 01 CMP playerX 1713 bbb3 b0 09 BCS .skipL0134 1714 bbb5 .condpart36 1715 bbb5 ad 41 01 LDA playerX 1716 bbb8 38 SEC 1717 bbb9 e9 01 SBC #1 1718 bbbb 8d 41 01 STA playerX 1719 bbbe .skipL0134 1720 bbbe .L0135 ;; if playerX < 1 then playerX = playerX + 1 1721 bbbe 1722 bbbe ad 41 01 LDA playerX 1723 bbc1 c9 01 CMP #1 1724 bbc3 b0 09 BCS .skipL0135 1725 bbc5 .condpart37 1726 bbc5 ad 41 01 LDA playerX 1727 bbc8 18 CLC 1728 bbc9 69 01 ADC #1 1729 bbcb 8d 41 01 STA playerX 1730 bbce .skipL0135 1731 bbce .L0136 ;; if playerY > 177 then playerY = playerY - 1 1732 bbce 1733 bbce a9 b1 LDA #177 1734 bbd0 cd 42 01 CMP playerY 1735 bbd3 b0 09 BCS .skipL0136 1736 bbd5 .condpart38 1737 bbd5 ad 42 01 LDA playerY 1738 bbd8 38 SEC 1739 bbd9 e9 01 SBC #1 1740 bbdb 8d 42 01 STA playerY 1741 bbde .skipL0136 1742 bbde .L0137 ;; if playerY < 1 then playerY = playerY + 1 1743 bbde 1744 bbde ad 42 01 LDA playerY 1745 bbe1 c9 01 CMP #1 1746 bbe3 b0 09 BCS .skipL0137 1747 bbe5 .condpart39 1748 bbe5 ad 42 01 LDA playerY 1749 bbe8 18 CLC 1750 bbe9 69 01 ADC #1 1751 bbeb 8d 42 01 STA playerY 1752 bbee .skipL0137 1753 bbee .L0138 ;; if bulletY > 183 then bulletY = bulletY - 1 1754 bbee 1755 bbee a9 b7 LDA #183 1756 bbf0 cd 49 01 CMP bulletY 1757 bbf3 b0 09 BCS .skipL0138 1758 bbf5 .condpart40 1759 bbf5 ad 49 01 LDA bulletY 1760 bbf8 38 SEC 1761 bbf9 e9 01 SBC #1 1762 bbfb 8d 49 01 STA bulletY 1763 bbfe .skipL0138 1764 bbfe .L0139 ;; if bulletY < 1 then bulletY = bulletY + 1 1765 bbfe 1766 bbfe ad 49 01 LDA bulletY 1767 bc01 c9 01 CMP #1 1768 bc03 b0 09 BCS .skipL0139 1769 bc05 .condpart41 1770 bc05 ad 49 01 LDA bulletY 1771 bc08 18 CLC 1772 bc09 69 01 ADC #1 1773 bc0b 8d 49 01 STA bulletY 1774 bc0e .skipL0139 1775 bc0e .L0140 ;; if twinlaserY > 183 then twinlaserY = twinlaserY - 1 1776 bc0e 1777 bc0e a9 b7 LDA #183 1778 bc10 cd 66 01 CMP twinlaserY 1779 bc13 b0 09 BCS .skipL0140 1780 bc15 .condpart42 1781 bc15 ad 66 01 LDA twinlaserY 1782 bc18 38 SEC 1783 bc19 e9 01 SBC #1 1784 bc1b 8d 66 01 STA twinlaserY 1785 bc1e .skipL0140 1786 bc1e .L0141 ;; if twinlaserY < 1 then twinlaserY = twinlaserY + 1 1787 bc1e 1788 bc1e ad 66 01 LDA twinlaserY 1789 bc21 c9 01 CMP #1 1790 bc23 b0 09 BCS .skipL0141 1791 bc25 .condpart43 1792 bc25 ad 66 01 LDA twinlaserY 1793 bc28 18 CLC 1794 bc29 69 01 ADC #1 1795 bc2b 8d 66 01 STA twinlaserY 1796 bc2e .skipL0141 1797 bc2e . 1798 bc2e ;; 1799 bc2e 1800 bc2e .L0142 ;; gosub check_collisions 1801 bc2e 1802 bc2e 20 53 ca jsr .check_collisions 1803 bc31 1804 bc31 .L0143 ;; if isDead_flag then goto lose_a_life 1805 bc31 1806 bc31 ad 6a 01 LDA isDead_flag 1807 bc34 f0 03 BEQ .skipL0143 1808 bc36 .condpart44 1809 bc36 4c 70 d9 jmp .lose_a_life 1810 bc39 1811 bc39 .skipL0143 1812 bc39 . 1813 bc39 ;; 1814 bc39 1815 bc39 . 1816 bc39 ;; 1817 bc39 1818 bc39 . 1819 bc39 ;; 1820 bc39 1821 bc39 .L0144 ;; if enemy_shotX > 160 then enemy_shotX = enemy_shotX - 1 1822 bc39 1823 bc39 a9 a0 LDA #160 1824 bc3b cd 4a 01 CMP enemy_shotX 1825 bc3e b0 09 BCS .skipL0144 1826 bc40 .condpart45 1827 bc40 ad 4a 01 LDA enemy_shotX 1828 bc43 38 SEC 1829 bc44 e9 01 SBC #1 1830 bc46 8d 4a 01 STA enemy_shotX 1831 bc49 .skipL0144 1832 bc49 .L0145 ;; if enemy_shotX < 1 then enemy_shotX = enemy_shotX + 1 1833 bc49 1834 bc49 ad 4a 01 LDA enemy_shotX 1835 bc4c c9 01 CMP #1 1836 bc4e b0 09 BCS .skipL0145 1837 bc50 .condpart46 1838 bc50 ad 4a 01 LDA enemy_shotX 1839 bc53 18 CLC 1840 bc54 69 01 ADC #1 1841 bc56 8d 4a 01 STA enemy_shotX 1842 bc59 .skipL0145 1843 bc59 .L0146 ;; if enemy_shotY > 191 then enemy_shotY = enemy_shotY - 1 1844 bc59 1845 bc59 a9 bf LDA #191 1846 bc5b cd 4b 01 CMP enemy_shotY 1847 bc5e b0 09 BCS .skipL0146 1848 bc60 .condpart47 1849 bc60 ad 4b 01 LDA enemy_shotY 1850 bc63 38 SEC 1851 bc64 e9 01 SBC #1 1852 bc66 8d 4b 01 STA enemy_shotY 1853 bc69 .skipL0146 1854 bc69 .L0147 ;; if enemy_shotY < 1 then enemy_shotY = enemy_shotY + 1 1855 bc69 1856 bc69 ad 4b 01 LDA enemy_shotY 1857 bc6c c9 01 CMP #1 1858 bc6e b0 09 BCS .skipL0147 1859 bc70 .condpart48 1860 bc70 ad 4b 01 LDA enemy_shotY 1861 bc73 18 CLC 1862 bc74 69 01 ADC #1 1863 bc76 8d 4b 01 STA enemy_shotY 1864 bc79 .skipL0147 1865 bc79 .L0148 ;; if power_upX > 155 then power_upX = power_upX - 5 1866 bc79 1867 bc79 a9 9b LDA #155 1868 bc7b cd 50 01 CMP power_upX 1869 bc7e b0 09 BCS .skipL0148 1870 bc80 .condpart49 1871 bc80 ad 50 01 LDA power_upX 1872 bc83 38 SEC 1873 bc84 e9 05 SBC #5 1874 bc86 8d 50 01 STA power_upX 1875 bc89 .skipL0148 1876 bc89 .L0149 ;; if power_upX < 1 then power_upX = power_upX + 5 1877 bc89 1878 bc89 ad 50 01 LDA power_upX 1879 bc8c c9 01 CMP #1 1880 bc8e b0 09 BCS .skipL0149 1881 bc90 .condpart50 1882 bc90 ad 50 01 LDA power_upX 1883 bc93 18 CLC 1884 bc94 69 05 ADC #5 1885 bc96 8d 50 01 STA power_upX 1886 bc99 .skipL0149 1887 bc99 .L0150 ;; if power_upY > 191 then power_upY = power_upY - 5 1888 bc99 1889 bc99 a9 bf LDA #191 1890 bc9b cd 51 01 CMP power_upY 1891 bc9e b0 09 BCS .skipL0150 1892 bca0 .condpart51 1893 bca0 ad 51 01 LDA power_upY 1894 bca3 38 SEC 1895 bca4 e9 05 SBC #5 1896 bca6 8d 51 01 STA power_upY 1897 bca9 .skipL0150 1898 bca9 .L0151 ;; if power_upY < 1 then power_upY = power_upY + 5 1899 bca9 1900 bca9 ad 51 01 LDA power_upY 1901 bcac c9 01 CMP #1 1902 bcae b0 09 BCS .skipL0151 1903 bcb0 .condpart52 1904 bcb0 ad 51 01 LDA power_upY 1905 bcb3 18 CLC 1906 bcb4 69 05 ADC #5 1907 bcb6 8d 51 01 STA power_upY 1908 bcb9 .skipL0151 1909 bcb9 .L0152 ;; if enemy01_X > 160 then enemy01_X = enemy01_X - 1 1910 bcb9 1911 bcb9 a9 a0 LDA #160 1912 bcbb cd 57 01 CMP enemy01_X 1913 bcbe b0 09 BCS .skipL0152 1914 bcc0 .condpart53 1915 bcc0 ad 57 01 LDA enemy01_X 1916 bcc3 38 SEC 1917 bcc4 e9 01 SBC #1 1918 bcc6 8d 57 01 STA enemy01_X 1919 bcc9 .skipL0152 1920 bcc9 .L0153 ;; if enemy01_X < 1 then enemy01_X = enemy01_X + 1 1921 bcc9 1922 bcc9 ad 57 01 LDA enemy01_X 1923 bccc c9 01 CMP #1 1924 bcce b0 09 BCS .skipL0153 1925 bcd0 .condpart54 1926 bcd0 ad 57 01 LDA enemy01_X 1927 bcd3 18 CLC 1928 bcd4 69 01 ADC #1 1929 bcd6 8d 57 01 STA enemy01_X 1930 bcd9 .skipL0153 1931 bcd9 .L0154 ;; if enemy01_Y > 220 then enemy01_Y = enemy01_Y - 1 1932 bcd9 1933 bcd9 a9 dc LDA #220 1934 bcdb cd 58 01 CMP enemy01_Y 1935 bcde b0 09 BCS .skipL0154 1936 bce0 .condpart55 1937 bce0 ad 58 01 LDA enemy01_Y 1938 bce3 38 SEC 1939 bce4 e9 01 SBC #1 1940 bce6 8d 58 01 STA enemy01_Y 1941 bce9 .skipL0154 1942 bce9 .L0155 ;; if enemy01_Y < - 16 then enemy01_Y = enemy01_Y + 1 1943 bce9 1944 bce9 ; complex condition detected 1945 bce9 a9 f0 LDA #240 1946 bceb 48 PHA 1947 bcec ba TSX 1948 bced 68 PLA 1949 bcee ad 58 01 LDA enemy01_Y 1950 bcf1 dd 01 01 CMP $101,x 1951 bcf4 b0 09 BCS .skipL0155 1952 bcf6 .condpart56 1953 bcf6 ad 58 01 LDA enemy01_Y 1954 bcf9 18 CLC 1955 bcfa 69 01 ADC #1 1956 bcfc 8d 58 01 STA enemy01_Y 1957 bcff .skipL0155 1958 bcff .L0156 ;; if extra_shipX > 160 then extra_shipX = extra_shipX - 1 1959 bcff 1960 bcff a9 a0 LDA #160 1961 bd01 cd 60 01 CMP extra_shipX 1962 bd04 b0 09 BCS .skipL0156 1963 bd06 .condpart57 1964 bd06 ad 60 01 LDA extra_shipX 1965 bd09 38 SEC 1966 bd0a e9 01 SBC #1 1967 bd0c 8d 60 01 STA extra_shipX 1968 bd0f .skipL0156 1969 bd0f .L0157 ;; if extra_shipX < 1 then extra_shipX = extra_shipX + 1 1970 bd0f 1971 bd0f ad 60 01 LDA extra_shipX 1972 bd12 c9 01 CMP #1 1973 bd14 b0 09 BCS .skipL0157 1974 bd16 .condpart58 1975 bd16 ad 60 01 LDA extra_shipX 1976 bd19 18 CLC 1977 bd1a 69 01 ADC #1 1978 bd1c 8d 60 01 STA extra_shipX 1979 bd1f .skipL0157 1980 bd1f .L0158 ;; if extra_shipY > 191 then extra_shipY = extra_shipY - 1 1981 bd1f 1982 bd1f a9 bf LDA #191 1983 bd21 cd 61 01 CMP extra_shipY 1984 bd24 b0 09 BCS .skipL0158 1985 bd26 .condpart59 1986 bd26 ad 61 01 LDA extra_shipY 1987 bd29 38 SEC 1988 bd2a e9 01 SBC #1 1989 bd2c 8d 61 01 STA extra_shipY 1990 bd2f .skipL0158 1991 bd2f .L0159 ;; if extra_shipY < 1 then extra_shipY = extra_shipY + 1 1992 bd2f 1993 bd2f ad 61 01 LDA extra_shipY 1994 bd32 c9 01 CMP #1 1995 bd34 b0 09 BCS .skipL0159 1996 bd36 .condpart60 1997 bd36 ad 61 01 LDA extra_shipY 1998 bd39 18 CLC 1999 bd3a 69 01 ADC #1 2000 bd3c 8d 61 01 STA extra_shipY 2001 bd3f .skipL0159 2002 bd3f . 2003 bd3f ;; 2004 bd3f 2005 bd3f .L0160 ;; if rDirection = 0 then enemy_shotX = enemy_shotX + rMovement1 : enemy_shotY = enemy_shotY + rMovement2 2006 bd3f 2007 bd3f ad 4f 01 LDA rDirection 2008 bd42 c9 00 CMP #0 2009 bd44 d0 14 BNE .skipL0160 2010 bd46 .condpart61 2011 bd46 ad 4a 01 LDA enemy_shotX 2012 bd49 18 CLC 2013 bd4a 6d 4e 01 ADC rMovement1 2014 bd4d 8d 4a 01 STA enemy_shotX 2015 bd50 ad 4b 01 LDA enemy_shotY 2016 bd53 18 CLC 2017 bd54 6d 53 01 ADC rMovement2 2018 bd57 8d 4b 01 STA enemy_shotY 2019 bd5a .skipL0160 2020 bd5a .L0161 ;; if rDirection = 1 then enemy_shotX = enemy_shotX + rMovement3 : enemy_shotY = enemy_shotY + rMovement4 2021 bd5a 2022 bd5a ad 4f 01 LDA rDirection 2023 bd5d c9 01 CMP #1 2024 bd5f d0 14 BNE .skipL0161 2025 bd61 .condpart62 2026 bd61 ad 4a 01 LDA enemy_shotX 2027 bd64 18 CLC 2028 bd65 6d 5a 01 ADC rMovement3 2029 bd68 8d 4a 01 STA enemy_shotX 2030 bd6b ad 4b 01 LDA enemy_shotY 2031 bd6e 18 CLC 2032 bd6f 6d 5b 01 ADC rMovement4 2033 bd72 8d 4b 01 STA enemy_shotY 2034 bd75 .skipL0161 2035 bd75 .L0162 ;; if rDirection = 2 then enemy_shotX = enemy_shotX + rMovement5 : enemy_shotY = enemy_shotY + rMovement6 2036 bd75 2037 bd75 ad 4f 01 LDA rDirection 2038 bd78 c9 02 CMP #2 2039 bd7a d0 14 BNE .skipL0162 2040 bd7c .condpart63 2041 bd7c ad 4a 01 LDA enemy_shotX 2042 bd7f 18 CLC 2043 bd80 6d 5c 01 ADC rMovement5 2044 bd83 8d 4a 01 STA enemy_shotX 2045 bd86 ad 4b 01 LDA enemy_shotY 2046 bd89 18 CLC 2047 bd8a 6d 5d 01 ADC rMovement6 2048 bd8d 8d 4b 01 STA enemy_shotY 2049 bd90 .skipL0162 2050 bd90 .L0163 ;; if rDirection = 3 then enemy_shotX = enemy_shotX + rMovement4 : enemy_shotY = enemy_shotY + rMovement2 2051 bd90 2052 bd90 ad 4f 01 LDA rDirection 2053 bd93 c9 03 CMP #3 2054 bd95 d0 14 BNE .skipL0163 2055 bd97 .condpart64 2056 bd97 ad 4a 01 LDA enemy_shotX 2057 bd9a 18 CLC 2058 bd9b 6d 5b 01 ADC rMovement4 2059 bd9e 8d 4a 01 STA enemy_shotX 2060 bda1 ad 4b 01 LDA enemy_shotY 2061 bda4 18 CLC 2062 bda5 6d 53 01 ADC rMovement2 2063 bda8 8d 4b 01 STA enemy_shotY 2064 bdab .skipL0163 2065 bdab . 2066 bdab ;; 2067 bdab 2068 bdab .L0164 ;; if rDirection = 0 then power_upX = power_upX + rMovement5 : power_upY = power_upY + rMovement2 2069 bdab 2070 bdab ad 4f 01 LDA rDirection 2071 bdae c9 00 CMP #0 2072 bdb0 d0 14 BNE .skipL0164 2073 bdb2 .condpart65 2074 bdb2 ad 50 01 LDA power_upX 2075 bdb5 18 CLC 2076 bdb6 6d 5c 01 ADC rMovement5 2077 bdb9 8d 50 01 STA power_upX 2078 bdbc ad 51 01 LDA power_upY 2079 bdbf 18 CLC 2080 bdc0 6d 53 01 ADC rMovement2 2081 bdc3 8d 51 01 STA power_upY 2082 bdc6 .skipL0164 2083 bdc6 .L0165 ;; if rDirection = 1 then power_upX = power_upX + rMovement3 : power_upY = power_upY + rMovement4 2084 bdc6 2085 bdc6 ad 4f 01 LDA rDirection 2086 bdc9 c9 01 CMP #1 2087 bdcb d0 14 BNE .skipL0165 2088 bdcd .condpart66 2089 bdcd ad 50 01 LDA power_upX 2090 bdd0 18 CLC 2091 bdd1 6d 5a 01 ADC rMovement3 2092 bdd4 8d 50 01 STA power_upX 2093 bdd7 ad 51 01 LDA power_upY 2094 bdda 18 CLC 2095 bddb 6d 5b 01 ADC rMovement4 2096 bdde 8d 51 01 STA power_upY 2097 bde1 .skipL0165 2098 bde1 .L0166 ;; if rDirection = 2 then power_upX = power_upX + rMovement1 : power_upY = power_upY + rMovement6 2099 bde1 2100 bde1 ad 4f 01 LDA rDirection 2101 bde4 c9 02 CMP #2 2102 bde6 d0 14 BNE .skipL0166 2103 bde8 .condpart67 2104 bde8 ad 50 01 LDA power_upX 2105 bdeb 18 CLC 2106 bdec 6d 4e 01 ADC rMovement1 2107 bdef 8d 50 01 STA power_upX 2108 bdf2 ad 51 01 LDA power_upY 2109 bdf5 18 CLC 2110 bdf6 6d 5d 01 ADC rMovement6 2111 bdf9 8d 51 01 STA power_upY 2112 bdfc .skipL0166 2113 bdfc . 2114 bdfc ;; 2115 bdfc 2116 bdfc .L0167 ;; if rDirection = 0 then enemy01_X = enemy01_X + rMovement4 : enemy01_Y = enemy01_Y + rMovement2 2117 bdfc 2118 bdfc ad 4f 01 LDA rDirection 2119 bdff c9 00 CMP #0 2120 be01 d0 14 BNE .skipL0167 2121 be03 .condpart68 2122 be03 ad 57 01 LDA enemy01_X 2123 be06 18 CLC 2124 be07 6d 5b 01 ADC rMovement4 2125 be0a 8d 57 01 STA enemy01_X 2126 be0d ad 58 01 LDA enemy01_Y 2127 be10 18 CLC 2128 be11 6d 53 01 ADC rMovement2 2129 be14 8d 58 01 STA enemy01_Y 2130 be17 .skipL0167 2131 be17 .L0168 ;; if rDirection = 1 then enemy01_X = enemy01_X + rMovement3 : enemy01_Y = enemy01_Y + rMovement4 2132 be17 2133 be17 ad 4f 01 LDA rDirection 2134 be1a c9 01 CMP #1 2135 be1c d0 14 BNE .skipL0168 2136 be1e .condpart69 2137 be1e ad 57 01 LDA enemy01_X 2138 be21 18 CLC 2139 be22 6d 5a 01 ADC rMovement3 2140 be25 8d 57 01 STA enemy01_X 2141 be28 ad 58 01 LDA enemy01_Y 2142 be2b 18 CLC 2143 be2c 6d 5b 01 ADC rMovement4 2144 be2f 8d 58 01 STA enemy01_Y 2145 be32 .skipL0168 2146 be32 .L0169 ;; if rDirection = 2 then enemy01_X = enemy01_X + rMovement6 : enemy01_Y = enemy01_Y + rMovement6 2147 be32 2148 be32 ad 4f 01 LDA rDirection 2149 be35 c9 02 CMP #2 2150 be37 d0 14 BNE .skipL0169 2151 be39 .condpart70 2152 be39 ad 57 01 LDA enemy01_X 2153 be3c 18 CLC 2154 be3d 6d 5d 01 ADC rMovement6 2155 be40 8d 57 01 STA enemy01_X 2156 be43 ad 58 01 LDA enemy01_Y 2157 be46 18 CLC 2158 be47 6d 5d 01 ADC rMovement6 2159 be4a 8d 58 01 STA enemy01_Y 2160 be4d .skipL0169 2161 be4d . 2162 be4d ;; 2163 be4d 2164 be4d .L0170 ;; if rDirection = 0 then extra_shipX = extra_shipX + rMovement5 : extra_shipY = extra_shipY + rMovement2 2165 be4d 2166 be4d ad 4f 01 LDA rDirection 2167 be50 c9 00 CMP #0 2168 be52 d0 14 BNE .skipL0170 2169 be54 .condpart71 2170 be54 ad 60 01 LDA extra_shipX 2171 be57 18 CLC 2172 be58 6d 5c 01 ADC rMovement5 2173 be5b 8d 60 01 STA extra_shipX 2174 be5e ad 61 01 LDA extra_shipY 2175 be61 18 CLC 2176 be62 6d 53 01 ADC rMovement2 2177 be65 8d 61 01 STA extra_shipY 2178 be68 .skipL0170 2179 be68 . 2180 be68 ;; 2181 be68 2182 be68 .L0171 ;; if playerFlag = 1 && explosion_aniframe = 1 then playsfx sfx_explosion 2183 be68 2184 be68 ad 4d 01 LDA playerFlag 2185 be6b c9 01 CMP #1 2186 be6d d0 20 BNE .skipL0171 2187 be6f .condpart72 2188 be6f ad 63 01 LDA explosion_aniframe 2189 be72 c9 01 CMP #1 2190 be74 d0 19 BNE .skip72then 2191 be76 .condpart73 2192 be76 a9 01 lda #1 2193 be78 85 de sta sfxschedulelock 2194 be7a a9 7e lda #sfx_explosion 2197 be80 85 e1 sta sfxinstrumenthi 2198 be82 a9 00 lda #0 2199 be84 85 e2 sta sfxpitchoffset ; no pitch modification 2200 be86 85 e3 sta sfxnoteindex ; not a musical note 2201 be88 20 58 f2 jsr schedulesfx 2202 be8b a9 00 lda #0 2203 be8d 85 de sta sfxschedulelock 2204 be8f .skip72then 2205 be8f .skipL0171 2206 be8f .L0172 ;; if playerFlag = 1 then enemy_shotSlowdown = enemy_shotSlowdown + 1 2207 be8f 2208 be8f ad 4d 01 LDA playerFlag 2209 be92 c9 01 CMP #1 2210 be94 d0 09 BNE .skipL0172 2211 be96 .condpart74 2212 be96 ad 56 01 LDA enemy_shotSlowdown 2213 be99 18 CLC 2214 be9a 69 01 ADC #1 2215 be9c 8d 56 01 STA enemy_shotSlowdown 2216 be9f .skipL0172 2217 be9f .L0173 ;; if playerFlag = 1 && enemy_shotSlowdown = 8 then enemy_shotSlowdown = 0 2218 be9f 2219 be9f ad 4d 01 LDA playerFlag 2220 bea2 c9 01 CMP #1 2221 bea4 d0 0c BNE .skipL0173 2222 bea6 .condpart75 2223 bea6 ad 56 01 LDA enemy_shotSlowdown 2224 bea9 c9 08 CMP #8 2225 beab d0 05 BNE .skip75then 2226 bead .condpart76 2227 bead a9 00 LDA #0 2228 beaf 8d 56 01 STA enemy_shotSlowdown 2229 beb2 .skip75then 2230 beb2 .skipL0173 2231 beb2 .L0174 ;; if playerFlag = 1 && enemy_shotSlowdown = 2 then explosion_aniframe = explosion_aniframe + 1 2232 beb2 2233 beb2 ad 4d 01 LDA playerFlag 2234 beb5 c9 01 CMP #1 2235 beb7 d0 10 BNE .skipL0174 2236 beb9 .condpart77 2237 beb9 ad 56 01 LDA enemy_shotSlowdown 2238 bebc c9 02 CMP #2 2239 bebe d0 09 BNE .skip77then 2240 bec0 .condpart78 2241 bec0 ad 63 01 LDA explosion_aniframe 2242 bec3 18 CLC 2243 bec4 69 01 ADC #1 2244 bec6 8d 63 01 STA explosion_aniframe 2245 bec9 .skip77then 2246 bec9 .skipL0174 2247 bec9 .L0175 ;; if playerFlag = 1 && explosion_aniframe > 11 then explosion_aniframe = 200 2248 bec9 2249 bec9 ad 4d 01 LDA playerFlag 2250 becc c9 01 CMP #1 2251 bece d0 0c BNE .skipL0175 2252 bed0 .condpart79 2253 bed0 a9 0b LDA #11 2254 bed2 cd 63 01 CMP explosion_aniframe 2255 bed5 b0 05 BCS .skip79then 2256 bed7 .condpart80 2257 bed7 a9 c8 LDA #200 2258 bed9 8d 63 01 STA explosion_aniframe 2259 bedc .skip79then 2260 bedc .skipL0175 2261 bedc . 2262 bedc ;; 2263 bedc 2264 bedc . 2265 bedc ;; 2266 bedc 2267 bedc .L0176 ;; restorescreen 2268 bedc 2269 bedc 20 9e f0 jsr restorescreen 2270 bedf .L0177 ;; gosub draw_scores 2271 bedf 2272 bedf 20 ea c9 jsr .draw_scores 2273 bee2 2274 bee2 .L0178 ;; gosub draw_sprites 2275 bee2 2276 bee2 20 00 c8 jsr .draw_sprites 2277 bee5 2278 bee5 .L0179 ;; drawscreen 2279 bee5 2280 bee5 20 c0 f0 jsr drawscreen 2281 bee8 . 2282 bee8 ;; 2283 bee8 2284 bee8 .L0180 ;; goto mainloop 2285 bee8 2286 bee8 4c ef b8 jmp .mainloop 2287 beeb 2288 beeb .L0181 ;; dmahole 1 2289 beeb 2290 beeb 4c 00 c8 jmp dmahole_1 2291 beeb DMAHOLEEND0 SET . 274 bytes of ROM space left in DMA hole 0. 2292 beeb echo " "," "," "," ",[(256*WZONEHEIGHT)-(DMAHOLEEND0 - DMAHOLESTART0)]d , "bytes of ROM space left in DMA hole 0." 2293 beee - if ((256*WZONEHEIGHT)-(DMAHOLEEND0 - DMAHOLESTART0)) < 0 2294 beee -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 2295 beee endif 2296 beee 2297 c000 ORG $C000,0 ; ************* 2298 c000 2299 c000 vertical_shooting_1up 2300 c000 15 55 HEX 1555 2301 c002 vertical_shooting_explosion_01 2302 c002 02 80 HEX 0280 2303 c004 vertical_shooting_explosion_01_tallsprite_00 2304 c004 00 00 HEX 0000 2305 c006 vertical_shooting_explosion_02 2306 c006 05 50 HEX 0550 2307 c008 vertical_shooting_explosion_02_tallsprite_00 2308 c008 00 00 HEX 0000 2309 c00a vertical_shooting_explosion_03 2310 c00a 15 54 HEX 1554 2311 c00c vertical_shooting_explosion_03_tallsprite_00 2312 c00c 00 00 HEX 0000 2313 c00e vertical_shooting_explosion_04 2314 c00e 07 d0 HEX 07d0 2315 c010 vertical_shooting_explosion_04_tallsprite_00 2316 c010 00 00 HEX 0000 2317 c012 vertical_shooting_explosion_05 2318 c012 0c 30 HEX 0c30 2319 c014 vertical_shooting_explosion_05_tallsprite_00 2320 c014 01 40 HEX 0140 2321 c016 vertical_shooting_explosion_06 2322 c016 00 00 HEX 0000 2323 c018 vertical_shooting_explosion_06_tallsprite_00 2324 c018 01 40 HEX 0140 2325 c01a vertical_shooting_explosion_07 2326 c01a 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2327 c02e vertical_shooting_explosion_07_tallsprite_00 2328 c02e 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2329 c042 vertical_shooting_explosion_08 2330 c042 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2331 c056 vertical_shooting_explosion_08_tallsprite_00 2332 c056 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2333 c06a vertical_shooting_explosion_09 2334 c06a 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2335 c07e vertical_shooting_explosion_09_tallsprite_00 2336 c07e 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2337 c092 vertical_shooting_explosion_10 2338 c092 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2339 c0a6 vertical_shooting_explosion_10_tallsprite_00 2340 c0a6 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2341 c0ba vertical_shooting_laser 2342 c0ba 88 HEX 88 2343 c0bb vertical_shooting_laser_tallsprite_00 2344 c0bb cc HEX cc 2345 c0bc 2346 c100 ORG $C100,0 ; ************* 2347 c100 2348 c100 ;vertical_shooting_1up 2349 c100 ea a9 HEX eaa9 2350 c102 ;vertical_shooting_explosion_01 2351 c102 01 40 HEX 0140 2352 c104 ;vertical_shooting_explosion_01_tallsprite_00 2353 c104 00 00 HEX 0000 2354 c106 ;vertical_shooting_explosion_02 2355 c106 09 60 HEX 0960 2356 c108 ;vertical_shooting_explosion_02_tallsprite_00 2357 c108 00 00 HEX 0000 2358 c10a ;vertical_shooting_explosion_03 2359 c10a 25 58 HEX 2558 2360 c10c ;vertical_shooting_explosion_03_tallsprite_00 2361 c10c 00 00 HEX 0000 2362 c10e ;vertical_shooting_explosion_04 2363 c10e 05 50 HEX 0550 2364 c110 ;vertical_shooting_explosion_04_tallsprite_00 2365 c110 02 80 HEX 0280 2366 c112 ;vertical_shooting_explosion_05 2367 c112 0b e0 HEX 0be0 2368 c114 ;vertical_shooting_explosion_05_tallsprite_00 2369 c114 01 40 HEX 0140 2370 c116 ;vertical_shooting_explosion_06 2371 c116 0c 30 HEX 0c30 2372 c118 ;vertical_shooting_explosion_06_tallsprite_00 2373 c118 01 40 HEX 0140 2374 c11a ;vertical_shooting_explosion_07 2375 c11a 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2376 c12e ;vertical_shooting_explosion_07_tallsprite_00 2377 c12e 00 00 00 00* HEX 0000000000000140014001400140014001400000 2378 c142 ;vertical_shooting_explosion_08 2379 c142 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2380 c156 ;vertical_shooting_explosion_08_tallsprite_00 2381 c156 00 00 00 00* HEX 0000000000000140014001400140014001400000 2382 c16a ;vertical_shooting_explosion_09 2383 c16a 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2384 c17e ;vertical_shooting_explosion_09_tallsprite_00 2385 c17e 00 00 00 00* HEX 0000000000000140014001400140014001400000 2386 c192 ;vertical_shooting_explosion_10 2387 c192 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2388 c1a6 ;vertical_shooting_explosion_10_tallsprite_00 2389 c1a6 00 00 00 00* HEX 0000000000000140014001400140014001400000 2390 c1ba ;vertical_shooting_laser 2391 c1ba 88 HEX 88 2392 c1bb ;vertical_shooting_laser_tallsprite_00 2393 c1bb cc HEX cc 2394 c1bc 2395 c200 ORG $C200,0 ; ************* 2396 c200 2397 c200 ;vertical_shooting_1up 2398 c200 d5 58 HEX d558 2399 c202 ;vertical_shooting_explosion_01 2400 c202 00 00 HEX 0000 2401 c204 ;vertical_shooting_explosion_01_tallsprite_00 2402 c204 00 00 HEX 0000 2403 c206 ;vertical_shooting_explosion_02 2404 c206 02 80 HEX 0280 2405 c208 ;vertical_shooting_explosion_02_tallsprite_00 2406 c208 00 00 HEX 0000 2407 c20a ;vertical_shooting_explosion_03 2408 c20a 09 60 HEX 0960 2409 c20c ;vertical_shooting_explosion_03_tallsprite_00 2410 c20c 00 00 HEX 0000 2411 c20e ;vertical_shooting_explosion_04 2412 c20e 05 50 HEX 0550 2413 c210 ;vertical_shooting_explosion_04_tallsprite_00 2414 c210 02 80 HEX 0280 2415 c212 ;vertical_shooting_explosion_05 2416 c212 0a a0 HEX 0aa0 2417 c214 ;vertical_shooting_explosion_05_tallsprite_00 2418 c214 05 50 HEX 0550 2419 c216 ;vertical_shooting_explosion_06 2420 c216 0b e0 HEX 0be0 2421 c218 ;vertical_shooting_explosion_06_tallsprite_00 2422 c218 05 50 HEX 0550 2423 c21a ;vertical_shooting_explosion_07 2424 c21a 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2425 c22e ;vertical_shooting_explosion_07_tallsprite_00 2426 c22e 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2427 c242 ;vertical_shooting_explosion_08 2428 c242 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2429 c256 ;vertical_shooting_explosion_08_tallsprite_00 2430 c256 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2431 c26a ;vertical_shooting_explosion_09 2432 c26a 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2433 c27e ;vertical_shooting_explosion_09_tallsprite_00 2434 c27e 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2435 c292 ;vertical_shooting_explosion_10 2436 c292 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2437 c2a6 ;vertical_shooting_explosion_10_tallsprite_00 2438 c2a6 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2439 c2ba ;vertical_shooting_laser 2440 c2ba 44 HEX 44 2441 c2bb ;vertical_shooting_laser_tallsprite_00 2442 c2bb cc HEX cc 2443 c2bc 2444 c300 ORG $C300,0 ; ************* 2445 c300 2446 c300 ;vertical_shooting_1up 2447 c300 35 60 HEX 3560 2448 c302 ;vertical_shooting_explosion_01 2449 c302 00 00 HEX 0000 2450 c304 ;vertical_shooting_explosion_01_tallsprite_00 2451 c304 00 00 HEX 0000 2452 c306 ;vertical_shooting_explosion_02 2453 c306 00 00 HEX 0000 2454 c308 ;vertical_shooting_explosion_02_tallsprite_00 2455 c308 00 00 HEX 0000 2456 c30a ;vertical_shooting_explosion_03 2457 c30a 02 80 HEX 0280 2458 c30c ;vertical_shooting_explosion_03_tallsprite_00 2459 c30c 00 00 HEX 0000 2460 c30e ;vertical_shooting_explosion_04 2461 c30e 09 60 HEX 0960 2462 c310 ;vertical_shooting_explosion_04_tallsprite_00 2463 c310 09 60 HEX 0960 2464 c312 ;vertical_shooting_explosion_05 2465 c312 06 90 HEX 0690 2466 c314 ;vertical_shooting_explosion_05_tallsprite_00 2467 c314 06 90 HEX 0690 2468 c316 ;vertical_shooting_explosion_06 2469 c316 06 90 HEX 0690 2470 c318 ;vertical_shooting_explosion_06_tallsprite_00 2471 c318 06 90 HEX 0690 2472 c31a ;vertical_shooting_explosion_07 2473 c31a 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2474 c32e ;vertical_shooting_explosion_07_tallsprite_00 2475 c32e 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2476 c342 ;vertical_shooting_explosion_08 2477 c342 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2478 c356 ;vertical_shooting_explosion_08_tallsprite_00 2479 c356 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2480 c36a ;vertical_shooting_explosion_09 2481 c36a 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2482 c37e ;vertical_shooting_explosion_09_tallsprite_00 2483 c37e 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2484 c392 ;vertical_shooting_explosion_10 2485 c392 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2486 c3a6 ;vertical_shooting_explosion_10_tallsprite_00 2487 c3a6 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2488 c3ba ;vertical_shooting_laser 2489 c3ba 44 HEX 44 2490 c3bb ;vertical_shooting_laser_tallsprite_00 2491 c3bb cc HEX cc 2492 c3bc 2493 c400 ORG $C400,0 ; ************* 2494 c400 2495 c400 ;vertical_shooting_1up 2496 c400 35 60 HEX 3560 2497 c402 ;vertical_shooting_explosion_01 2498 c402 00 00 HEX 0000 2499 c404 ;vertical_shooting_explosion_01_tallsprite_00 2500 c404 00 00 HEX 0000 2501 c406 ;vertical_shooting_explosion_02 2502 c406 00 00 HEX 0000 2503 c408 ;vertical_shooting_explosion_02_tallsprite_00 2504 c408 00 00 HEX 0000 2505 c40a ;vertical_shooting_explosion_03 2506 c40a 00 00 HEX 0000 2507 c40c ;vertical_shooting_explosion_03_tallsprite_00 2508 c40c 02 80 HEX 0280 2509 c40e ;vertical_shooting_explosion_04 2510 c40e 09 60 HEX 0960 2511 c410 ;vertical_shooting_explosion_04_tallsprite_00 2512 c410 09 60 HEX 0960 2513 c412 ;vertical_shooting_explosion_05 2514 c412 06 90 HEX 0690 2515 c414 ;vertical_shooting_explosion_05_tallsprite_00 2516 c414 06 90 HEX 0690 2517 c416 ;vertical_shooting_explosion_06 2518 c416 06 90 HEX 0690 2519 c418 ;vertical_shooting_explosion_06_tallsprite_00 2520 c418 06 90 HEX 0690 2521 c41a ;vertical_shooting_explosion_07 2522 c41a 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2523 c42e ;vertical_shooting_explosion_07_tallsprite_00 2524 c42e 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2525 c442 ;vertical_shooting_explosion_08 2526 c442 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2527 c456 ;vertical_shooting_explosion_08_tallsprite_00 2528 c456 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2529 c46a ;vertical_shooting_explosion_09 2530 c46a 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2531 c47e ;vertical_shooting_explosion_09_tallsprite_00 2532 c47e 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2533 c492 ;vertical_shooting_explosion_10 2534 c492 00 00 00 00* HEX 000000000000069006900690069007d00c300000 2535 c4a6 ;vertical_shooting_explosion_10_tallsprite_00 2536 c4a6 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 2537 c4ba ;vertical_shooting_laser 2538 c4ba 44 HEX 44 2539 c4bb ;vertical_shooting_laser_tallsprite_00 2540 c4bb cc HEX cc 2541 c4bc 2542 c500 ORG $C500,0 ; ************* 2543 c500 2544 c500 ;vertical_shooting_1up 2545 c500 0d 80 HEX 0d80 2546 c502 ;vertical_shooting_explosion_01 2547 c502 00 00 HEX 0000 2548 c504 ;vertical_shooting_explosion_01_tallsprite_00 2549 c504 00 00 HEX 0000 2550 c506 ;vertical_shooting_explosion_02 2551 c506 00 00 HEX 0000 2552 c508 ;vertical_shooting_explosion_02_tallsprite_00 2553 c508 02 80 HEX 0280 2554 c50a ;vertical_shooting_explosion_03 2555 c50a 00 00 HEX 0000 2556 c50c ;vertical_shooting_explosion_03_tallsprite_00 2557 c50c 09 60 HEX 0960 2558 c50e ;vertical_shooting_explosion_04 2559 c50e 02 80 HEX 0280 2560 c510 ;vertical_shooting_explosion_04_tallsprite_00 2561 c510 05 50 HEX 0550 2562 c512 ;vertical_shooting_explosion_05 2563 c512 05 50 HEX 0550 2564 c514 ;vertical_shooting_explosion_05_tallsprite_00 2565 c514 0a a0 HEX 0aa0 2566 c516 ;vertical_shooting_explosion_06 2567 c516 05 50 HEX 0550 2568 c518 ;vertical_shooting_explosion_06_tallsprite_00 2569 c518 0b e0 HEX 0be0 2570 c51a ;vertical_shooting_explosion_07 2571 c51a 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2572 c52e ;vertical_shooting_explosion_07_tallsprite_00 2573 c52e 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2574 c542 ;vertical_shooting_explosion_08 2575 c542 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2576 c556 ;vertical_shooting_explosion_08_tallsprite_00 2577 c556 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2578 c56a ;vertical_shooting_explosion_09 2579 c56a 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2580 c57e ;vertical_shooting_explosion_09_tallsprite_00 2581 c57e 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2582 c592 ;vertical_shooting_explosion_10 2583 c592 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 2584 c5a6 ;vertical_shooting_explosion_10_tallsprite_00 2585 c5a6 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 2586 c5ba ;vertical_shooting_laser 2587 c5ba 44 HEX 44 2588 c5bb ;vertical_shooting_laser_tallsprite_00 2589 c5bb 88 HEX 88 2590 c5bc 2591 c600 ORG $C600,0 ; ************* 2592 c600 2593 c600 ;vertical_shooting_1up 2594 c600 0d 80 HEX 0d80 2595 c602 ;vertical_shooting_explosion_01 2596 c602 00 00 HEX 0000 2597 c604 ;vertical_shooting_explosion_01_tallsprite_00 2598 c604 01 40 HEX 0140 2599 c606 ;vertical_shooting_explosion_02 2600 c606 00 00 HEX 0000 2601 c608 ;vertical_shooting_explosion_02_tallsprite_00 2602 c608 09 60 HEX 0960 2603 c60a ;vertical_shooting_explosion_03 2604 c60a 00 00 HEX 0000 2605 c60c ;vertical_shooting_explosion_03_tallsprite_00 2606 c60c 25 58 HEX 2558 2607 c60e ;vertical_shooting_explosion_04 2608 c60e 02 80 HEX 0280 2609 c610 ;vertical_shooting_explosion_04_tallsprite_00 2610 c610 05 50 HEX 0550 2611 c612 ;vertical_shooting_explosion_05 2612 c612 01 40 HEX 0140 2613 c614 ;vertical_shooting_explosion_05_tallsprite_00 2614 c614 0b e0 HEX 0be0 2615 c616 ;vertical_shooting_explosion_06 2616 c616 01 40 HEX 0140 2617 c618 ;vertical_shooting_explosion_06_tallsprite_00 2618 c618 0c 30 HEX 0c30 2619 c61a ;vertical_shooting_explosion_07 2620 c61a 00 00 00 00* HEX 0000000000000140014001400140014001400000 2621 c62e ;vertical_shooting_explosion_07_tallsprite_00 2622 c62e 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2623 c642 ;vertical_shooting_explosion_08 2624 c642 00 00 00 00* HEX 0000000000000140014001400140014001400000 2625 c656 ;vertical_shooting_explosion_08_tallsprite_00 2626 c656 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2627 c66a ;vertical_shooting_explosion_09 2628 c66a 00 00 00 00* HEX 0000000000000140014001400140014001400000 2629 c67e ;vertical_shooting_explosion_09_tallsprite_00 2630 c67e 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2631 c692 ;vertical_shooting_explosion_10 2632 c692 00 00 00 00* HEX 0000000000000140014001400140014001400000 2633 c6a6 ;vertical_shooting_explosion_10_tallsprite_00 2634 c6a6 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 2635 c6ba ;vertical_shooting_laser 2636 c6ba 44 HEX 44 2637 c6bb ;vertical_shooting_laser_tallsprite_00 2638 c6bb 88 HEX 88 2639 c6bc 2640 c700 ORG $C700,0 ; ************* 2641 c700 2642 c700 ;vertical_shooting_1up 2643 c700 03 00 HEX 0300 2644 c702 ;vertical_shooting_explosion_01 2645 c702 00 00 HEX 0000 2646 c704 ;vertical_shooting_explosion_01_tallsprite_00 2647 c704 02 80 HEX 0280 2648 c706 ;vertical_shooting_explosion_02 2649 c706 00 00 HEX 0000 2650 c708 ;vertical_shooting_explosion_02_tallsprite_00 2651 c708 05 50 HEX 0550 2652 c70a ;vertical_shooting_explosion_03 2653 c70a 00 00 HEX 0000 2654 c70c ;vertical_shooting_explosion_03_tallsprite_00 2655 c70c 15 54 HEX 1554 2656 c70e ;vertical_shooting_explosion_04 2657 c70e 00 00 HEX 0000 2658 c710 ;vertical_shooting_explosion_04_tallsprite_00 2659 c710 07 d0 HEX 07d0 2660 c712 ;vertical_shooting_explosion_05 2661 c712 01 40 HEX 0140 2662 c714 ;vertical_shooting_explosion_05_tallsprite_00 2663 c714 0c 30 HEX 0c30 2664 c716 ;vertical_shooting_explosion_06 2665 c716 01 40 HEX 0140 2666 c718 ;vertical_shooting_explosion_06_tallsprite_00 2667 c718 00 00 HEX 0000 2668 c71a ;vertical_shooting_explosion_07 2669 c71a 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2670 c72e ;vertical_shooting_explosion_07_tallsprite_00 2671 c72e 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2672 c742 ;vertical_shooting_explosion_08 2673 c742 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2674 c756 ;vertical_shooting_explosion_08_tallsprite_00 2675 c756 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2676 c76a ;vertical_shooting_explosion_09 2677 c76a 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2678 c77e ;vertical_shooting_explosion_09_tallsprite_00 2679 c77e 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2680 c792 ;vertical_shooting_explosion_10 2681 c792 00 00 00 00* HEX 00000000000000000140014001400140014003c0 2682 c7a6 ;vertical_shooting_explosion_10_tallsprite_00 2683 c7a6 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 2684 c7ba ;vertical_shooting_laser 2685 c7ba 44 HEX 44 2686 c7bb ;vertical_shooting_laser_tallsprite_00 2687 c7bb 88 HEX 88 2688 c7bc 2689 c800 ORG $C800,0 ; ************* 2690 c800 dmahole_1 2691 c800 DMAHOLESTART1 SET . 2692 c800 . 2693 c800 ;; 2694 c800 2695 c800 .draw_sprites 2696 c800 ;; draw_sprites 2697 c800 2698 c800 .L0182 ;; plotsprite vertical_shooting_ship 0 playerX playerY 2699 c800 2700 c800 a9 2d lda #vertical_shooting_ship 2704 c806 85 43 sta temp2 2705 c808 2706 c808 a9 1e lda #(0|vertical_shooting_ship_width_twoscompliment) 2707 c80a 85 44 sta temp3 2708 c80c 2709 c80c ad 41 01 lda playerX 2710 c80f 85 45 sta temp4 2711 c811 2712 c811 ad 42 01 lda playerY 2713 c814 2714 c814 85 46 sta temp5 2715 c816 2716 c816 a9 40 lda #(vertical_shooting_ship_mode|%01000000) 2717 c818 85 47 sta temp6 2718 c81a 2719 c81a 20 a0 f2 jsr plotsprite 2720 c81d ; +tall sprite replot 2721 c81d 18 clc 2722 c81e a5 42 lda temp1 2723 c820 69 02 adc #vertical_shooting_ship_width 2724 c822 85 42 sta temp1 2725 c824 a5 46 lda temp5 2726 c826 69 08 adc #WZONEHEIGHT 2727 c828 85 46 sta temp5 2728 c82a 20 a0 f2 jsr plotsprite 2729 c82d .L0183 ;; plotsprite vertical_shooting_bullet 1 bulletX bulletY 2730 c82d 2731 c82d a9 31 lda #vertical_shooting_bullet 2735 c833 85 43 sta temp2 2736 c835 2737 c835 a9 3f lda #(32|vertical_shooting_bullet_width_twoscompliment) 2738 c837 85 44 sta temp3 2739 c839 2740 c839 ad 48 01 lda bulletX 2741 c83c 85 45 sta temp4 2742 c83e 2743 c83e ad 49 01 lda bulletY 2744 c841 2745 c841 85 46 sta temp5 2746 c843 2747 c843 a9 40 lda #(vertical_shooting_bullet_mode|%01000000) 2748 c845 85 47 sta temp6 2749 c847 2750 c847 20 a0 f2 jsr plotsprite 2751 c84a .L0184 ;; plotsprite vertical_shooting_enemyshot 2 enemy_shotX enemy_shotY 2752 c84a 2753 c84a a9 32 lda #vertical_shooting_enemyshot 2757 c850 85 43 sta temp2 2758 c852 2759 c852 a9 5f lda #(64|vertical_shooting_enemyshot_width_twoscompliment) 2760 c854 85 44 sta temp3 2761 c856 2762 c856 ad 4a 01 lda enemy_shotX 2763 c859 85 45 sta temp4 2764 c85b 2765 c85b ad 4b 01 lda enemy_shotY 2766 c85e 2767 c85e 85 46 sta temp5 2768 c860 2769 c860 a9 40 lda #(vertical_shooting_enemyshot_mode|%01000000) 2770 c862 85 47 sta temp6 2771 c864 2772 c864 20 a0 f2 jsr plotsprite 2773 c867 .L0185 ;; plotsprite vertical_shooting_powerup 3 power_upX power_upY 2774 c867 2775 c867 a9 33 lda #vertical_shooting_powerup 2779 c86d 85 43 sta temp2 2780 c86f 2781 c86f a9 7e lda #(96|vertical_shooting_powerup_width_twoscompliment) 2782 c871 85 44 sta temp3 2783 c873 2784 c873 ad 50 01 lda power_upX 2785 c876 85 45 sta temp4 2786 c878 2787 c878 ad 51 01 lda power_upY 2788 c87b 2789 c87b 85 46 sta temp5 2790 c87d 2791 c87d a9 40 lda #(vertical_shooting_powerup_mode|%01000000) 2792 c87f 85 47 sta temp6 2793 c881 2794 c881 20 a0 f2 jsr plotsprite 2795 c884 .L0186 ;; plotsprite vertical_shooting_enemy01 2 enemy01_X enemy01_Y 2796 c884 2797 c884 a9 35 lda #vertical_shooting_enemy01 2801 c88a 85 43 sta temp2 2802 c88c 2803 c88c a9 5e lda #(64|vertical_shooting_enemy01_width_twoscompliment) 2804 c88e 85 44 sta temp3 2805 c890 2806 c890 ad 57 01 lda enemy01_X 2807 c893 85 45 sta temp4 2808 c895 2809 c895 ad 58 01 lda enemy01_Y 2810 c898 2811 c898 85 46 sta temp5 2812 c89a 2813 c89a a9 40 lda #(vertical_shooting_enemy01_mode|%01000000) 2814 c89c 85 47 sta temp6 2815 c89e 2816 c89e 20 a0 f2 jsr plotsprite 2817 c8a1 ; +tall sprite replot 2818 c8a1 18 clc 2819 c8a2 a5 42 lda temp1 2820 c8a4 69 02 adc #vertical_shooting_enemy01_width 2821 c8a6 85 42 sta temp1 2822 c8a8 a5 46 lda temp5 2823 c8aa 69 08 adc #WZONEHEIGHT 2824 c8ac 85 46 sta temp5 2825 c8ae 20 a0 f2 jsr plotsprite 2826 c8b1 .L0187 ;; plotsprite vertical_shooting_1up 0 extra_shipX extra_shipY 2827 c8b1 2828 c8b1 a9 00 lda #vertical_shooting_1up 2832 c8b7 85 43 sta temp2 2833 c8b9 2834 c8b9 a9 1e lda #(0|vertical_shooting_1up_width_twoscompliment) 2835 c8bb 85 44 sta temp3 2836 c8bd 2837 c8bd ad 60 01 lda extra_shipX 2838 c8c0 85 45 sta temp4 2839 c8c2 2840 c8c2 ad 61 01 lda extra_shipY 2841 c8c5 2842 c8c5 85 46 sta temp5 2843 c8c7 2844 c8c7 a9 40 lda #(vertical_shooting_1up_mode|%01000000) 2845 c8c9 85 47 sta temp6 2846 c8cb 2847 c8cb 20 a0 f2 jsr plotsprite 2848 c8ce .L0188 ;; plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 2849 c8ce 2850 c8ce a9 02 lda #vertical_shooting_explosion_01 2862 c8df 85 43 sta temp2 2863 c8e1 2864 c8e1 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2865 c8e3 85 44 sta temp3 2866 c8e5 2867 c8e5 ad 41 01 lda playerX 2868 c8e8 85 45 sta temp4 2869 c8ea 2870 c8ea ad 42 01 lda playerY 2871 c8ed 85 46 sta temp5 2872 c8ef 2873 c8ef a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2874 c8f1 85 47 sta temp6 2875 c8f3 2876 c8f3 20 a0 f2 jsr plotsprite 2877 c8f6 ; +tall sprite replot 2878 c8f6 18 clc 2879 c8f7 a5 42 lda temp1 2880 c8f9 69 02 adc #vertical_shooting_explosion_01_width 2881 c8fb 85 42 sta temp1 2882 c8fd a5 46 lda temp5 2883 c8ff 69 08 adc #WZONEHEIGHT 2884 c901 85 46 sta temp5 2885 c903 20 a0 f2 jsr plotsprite 2886 c906 .L0189 ;; plotsprite vertical_shooting_explosion_01 3 enemy01_X enemy01_Y explosion_aniframe 2887 c906 2888 c906 a9 02 lda #vertical_shooting_explosion_01 2900 c917 85 43 sta temp2 2901 c919 2902 c919 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2903 c91b 85 44 sta temp3 2904 c91d 2905 c91d ad 57 01 lda enemy01_X 2906 c920 85 45 sta temp4 2907 c922 2908 c922 ad 58 01 lda enemy01_Y 2909 c925 85 46 sta temp5 2910 c927 2911 c927 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2912 c929 85 47 sta temp6 2913 c92b 2914 c92b 20 a0 f2 jsr plotsprite 2915 c92e ; +tall sprite replot 2916 c92e 18 clc 2917 c92f a5 42 lda temp1 2918 c931 69 02 adc #vertical_shooting_explosion_01_width 2919 c933 85 42 sta temp1 2920 c935 a5 46 lda temp5 2921 c937 69 08 adc #WZONEHEIGHT 2922 c939 85 46 sta temp5 2923 c93b 20 a0 f2 jsr plotsprite 2924 c93e .L0190 ;; plotsprite vertical_shooting_laser 0 twinlaserX twinlaserY 2925 c93e 2926 c93e a9 ba lda #vertical_shooting_laser 2930 c944 85 43 sta temp2 2931 c946 2932 c946 a9 1f lda #(0|vertical_shooting_laser_width_twoscompliment) 2933 c948 85 44 sta temp3 2934 c94a 2935 c94a ad 65 01 lda twinlaserX 2936 c94d 85 45 sta temp4 2937 c94f 2938 c94f ad 66 01 lda twinlaserY 2939 c952 2940 c952 85 46 sta temp5 2941 c954 2942 c954 a9 40 lda #(vertical_shooting_laser_mode|%01000000) 2943 c956 85 47 sta temp6 2944 c958 2945 c958 20 a0 f2 jsr plotsprite 2946 c95b ; +tall sprite replot 2947 c95b 18 clc 2948 c95c a5 42 lda temp1 2949 c95e 69 01 adc #vertical_shooting_laser_width 2950 c960 85 42 sta temp1 2951 c962 a5 46 lda temp5 2952 c964 69 08 adc #WZONEHEIGHT 2953 c966 85 46 sta temp5 2954 c968 20 a0 f2 jsr plotsprite 2955 c96b .L0191 ;; if playerFlag = 1 then plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 2956 c96b 2957 c96b ad 4d 01 LDA playerFlag 2958 c96e c9 01 CMP #1 2959 c970 d0 38 BNE .skipL0191 2960 c972 .condpart81 2961 c972 a9 02 lda #vertical_shooting_explosion_01 2973 c983 85 43 sta temp2 2974 c985 2975 c985 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2976 c987 85 44 sta temp3 2977 c989 2978 c989 ad 41 01 lda playerX 2979 c98c 85 45 sta temp4 2980 c98e 2981 c98e ad 42 01 lda playerY 2982 c991 85 46 sta temp5 2983 c993 2984 c993 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2985 c995 85 47 sta temp6 2986 c997 2987 c997 20 a0 f2 jsr plotsprite 2988 c99a ; +tall sprite replot 2989 c99a 18 clc 2990 c99b a5 42 lda temp1 2991 c99d 69 02 adc #vertical_shooting_explosion_01_width 2992 c99f 85 42 sta temp1 2993 c9a1 a5 46 lda temp5 2994 c9a3 69 08 adc #WZONEHEIGHT 2995 c9a5 85 46 sta temp5 2996 c9a7 20 a0 f2 jsr plotsprite 2997 c9aa .skipL0191 2998 c9aa .L0192 ;; if enemy01_Flag = 1 then plotsprite vertical_shooting_explosion_01 3 enemy01_X enemy01_Y explosion_aniframe 2999 c9aa 3000 c9aa ad 59 01 LDA enemy01_Flag 3001 c9ad c9 01 CMP #1 3002 c9af d0 38 BNE .skipL0192 3003 c9b1 .condpart82 3004 c9b1 a9 02 lda #vertical_shooting_explosion_01 3016 c9c2 85 43 sta temp2 3017 c9c4 3018 c9c4 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 3019 c9c6 85 44 sta temp3 3020 c9c8 3021 c9c8 ad 57 01 lda enemy01_X 3022 c9cb 85 45 sta temp4 3023 c9cd 3024 c9cd ad 58 01 lda enemy01_Y 3025 c9d0 85 46 sta temp5 3026 c9d2 3027 c9d2 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 3028 c9d4 85 47 sta temp6 3029 c9d6 3030 c9d6 20 a0 f2 jsr plotsprite 3031 c9d9 ; +tall sprite replot 3032 c9d9 18 clc 3033 c9da a5 42 lda temp1 3034 c9dc 69 02 adc #vertical_shooting_explosion_01_width 3035 c9de 85 42 sta temp1 3036 c9e0 a5 46 lda temp5 3037 c9e2 69 08 adc #WZONEHEIGHT 3038 c9e4 85 46 sta temp5 3039 c9e6 20 a0 f2 jsr plotsprite 3040 c9e9 .skipL0192 3041 c9e9 .L0193 ;; return 3042 c9e9 3043 c9e9 60 RTS 3044 c9ea . 3045 c9ea ;; 3046 c9ea 3047 c9ea .draw_scores 3048 c9ea ;; draw_scores 3049 c9ea 3050 c9ea .L0194 ;; plotvalue vertical_shooting_font 0 score0 6 25 1 3051 c9ea 3052 c9ea a9 00 lda #vertical_shooting_font 3056 c9f0 85 43 sta temp2 3057 c9f2 3058 c9f2 ad 06 21 lda charactermode 3059 c9f5 85 4a sta temp9 3060 c9f7 a9 60 lda #(vertical_shooting_font_mode | %01100000) 3061 c9f9 8d 06 21 sta charactermode 3062 c9fc a9 1a lda #26 ; width in two's complement 3063 c9fe 09 00 ora #0 ; palette left shifted 5 bits 3064 ca00 85 44 sta temp3 3065 ca02 a9 19 lda #25 3066 ca04 85 45 sta temp4 3067 ca06 3068 ca06 a9 01 lda #1 3069 ca08 85 46 sta temp5 3070 ca0a 3071 ca0a a9 06 lda #6 3072 ca0c 85 47 sta temp6 3073 ca0e 3074 ca0e a9 a6 lda #score0 3078 ca14 85 49 sta temp8 3079 ca16 3080 ca16 20 8e f3 jsr plotvalue 3081 ca16 00 01 USED_PLOTVALUE = 1 3082 ca19 a5 4a lda temp9 3083 ca1b 8d 06 21 sta charactermode 3084 ca1e .L0195 ;; plotvalue vertical_shooting_font 0 lives 1 153 1 3085 ca1e 3086 ca1e a9 00 lda #vertical_shooting_font 3090 ca24 85 43 sta temp2 3091 ca26 3092 ca26 ad 06 21 lda charactermode 3093 ca29 85 4a sta temp9 3094 ca2b a9 60 lda #(vertical_shooting_font_mode | %01100000) 3095 ca2d 8d 06 21 sta charactermode 3096 ca30 a9 1f lda #31 ; width in two's complement 3097 ca32 09 00 ora #0 ; palette left shifted 5 bits 3098 ca34 85 44 sta temp3 3099 ca36 a9 99 lda #153 3100 ca38 85 45 sta temp4 3101 ca3a 3102 ca3a a9 01 lda #1 3103 ca3c 85 46 sta temp5 3104 ca3e 3105 ca3e a9 01 lda #1 3106 ca40 85 47 sta temp6 3107 ca42 3108 ca42 a9 64 lda #lives 3112 ca48 85 49 sta temp8 3113 ca4a 3114 ca4a 20 8e f3 jsr plotvalue 3115 ca4a 00 01 USED_PLOTVALUE = 1 3116 ca4d a5 4a lda temp9 3117 ca4f 8d 06 21 sta charactermode 3118 ca52 .L0196 ;; return 3119 ca52 3120 ca52 60 RTS 3121 ca53 . 3122 ca53 ;; 3123 ca53 3124 ca53 .check_collisions 3125 ca53 ;; check_collisions 3126 ca53 3127 ca53 .L0197 ;; if boxcollision ( playerX , playerY , 8 , 16 , enemy_shotX , enemy_shotY , 4 , 8 ) then enemy_shotX = 200 : enemy_shotY = 200 : playerFlag = 1 : lives = lives - 0 : playsfx sfx_explosion : isDead_flag = 1 : goto _checkCollisionsExit 3128 ca53 3129 ca53 3130 ca53 18 clc ; one clc only. If we overflow we're screwed anyway. 3131 ca54 a0 07 ldy #(8-1) 3132 ca56 84 44 sty temp3 3133 ca58 a0 0f ldy #(16-1) 3134 ca5a 84 45 sty temp4 3135 ca5c ad 4a 01 lda enemy_shotX 3136 ca5f 69 30 adc #48 3137 ca61 85 46 sta temp5 3138 ca63 ad 4b 01 lda enemy_shotY 3139 ca66 69 20 adc #((256-WSCREENHEIGHT)/2) 3140 ca68 85 47 sta temp6 3141 ca6a a0 03 ldy #(4-1) 3142 ca6c 84 48 sty temp7 3143 ca6e a0 07 ldy #(8-1) 3144 ca70 84 49 sty temp8 3145 ca72 ad 42 01 lda playerY 3146 ca75 69 20 adc #((256-WSCREENHEIGHT)/2) 3147 ca77 a8 tay 3148 ca78 ad 41 01 lda playerX 3149 ca7b 69 30 adc #48 3150 ca7d 20 d6 f3 jsr boxcollision 3151 ca80 3152 ca80 90 37 BCC .skipL0197 3153 ca82 .condpart83 3154 ca82 a9 c8 LDA #200 3155 ca84 8d 4a 01 STA enemy_shotX 3156 ca87 8d 4b 01 STA enemy_shotY 3157 ca8a a9 01 LDA #1 3158 ca8c 8d 4d 01 STA playerFlag 3159 ca8f ad 64 01 LDA lives 3160 ca92 38 SEC 3161 ca93 e9 00 SBC #0 3162 ca95 8d 64 01 STA lives 3163 ca98 a9 01 lda #1 3164 ca9a 85 de sta sfxschedulelock 3165 ca9c a9 7e lda #sfx_explosion 3168 caa2 85 e1 sta sfxinstrumenthi 3169 caa4 a9 00 lda #0 3170 caa6 85 e2 sta sfxpitchoffset ; no pitch modification 3171 caa8 85 e3 sta sfxnoteindex ; not a musical note 3172 caaa 20 58 f2 jsr schedulesfx 3173 caad a9 00 lda #0 3174 caaf 85 de sta sfxschedulelock 3175 cab1 a9 01 LDA #1 3176 cab3 8d 6a 01 STA isDead_flag 3177 cab6 4c 91 cd jmp ._checkCollisionsExit 3178 cab9 3179 cab9 .skipL0197 3180 cab9 .L0198 ;; if boxcollision ( playerX , playerY , 8 , 16 , power_upX , power_upY , 8 , 8 ) then power_upX = 208 : power_upY = 208 : playerFlag = 1 : power_upFlag = 1 : playsfx sfx_bling : score0 = score0 + 1 : gosub power_up_obtained 3181 cab9 3182 cab9 3183 cab9 18 clc ; one clc only. If we overflow we're screwed anyway. 3184 caba a0 07 ldy #(8-1) 3185 cabc 84 44 sty temp3 3186 cabe a0 0f ldy #(16-1) 3187 cac0 84 45 sty temp4 3188 cac2 ad 50 01 lda power_upX 3189 cac5 69 30 adc #48 3190 cac7 85 46 sta temp5 3191 cac9 ad 51 01 lda power_upY 3192 cacc 69 20 adc #((256-WSCREENHEIGHT)/2) 3193 cace 85 47 sta temp6 3194 cad0 a0 07 ldy #(8-1) 3195 cad2 84 48 sty temp7 3196 cad4 a0 07 ldy #(8-1) 3197 cad6 84 49 sty temp8 3198 cad8 ad 42 01 lda playerY 3199 cadb 69 20 adc #((256-WSCREENHEIGHT)/2) 3200 cadd a8 tay 3201 cade ad 41 01 lda playerX 3202 cae1 69 30 adc #48 3203 cae3 20 d6 f3 jsr boxcollision 3204 cae6 3205 cae6 90 47 BCC .skipL0198 3206 cae8 .condpart84 3207 cae8 a9 d0 LDA #208 3208 caea 8d 50 01 STA power_upX 3209 caed 8d 51 01 STA power_upY 3210 caf0 a9 01 LDA #1 3211 caf2 8d 4d 01 STA playerFlag 3212 caf5 8d 52 01 STA power_upFlag 3213 caf8 a9 01 lda #1 3214 cafa 85 de sta sfxschedulelock 3215 cafc a9 bb lda #sfx_bling 3218 cb02 85 e1 sta sfxinstrumenthi 3219 cb04 a9 00 lda #0 3220 cb06 85 e2 sta sfxpitchoffset ; no pitch modification 3221 cb08 85 e3 sta sfxnoteindex ; not a musical note 3222 cb0a 20 58 f2 jsr schedulesfx 3223 cb0d a9 00 lda #0 3224 cb0f 85 de sta sfxschedulelock 3225 cb11 f8 SED 3226 cb12 18 CLC 3227 cb13 ad a8 01 LDA score0+2 3228 cb16 69 01 ADC #$01 3229 cb18 8d a8 01 STA score0+2 3230 cb1b ad a7 01 LDA score0+1 3231 cb1e 69 00 ADC #$00 3232 cb20 8d a7 01 STA score0+1 3233 cb23 ad a6 01 LDA score0 3234 cb26 69 00 ADC #$00 3235 cb28 8d a6 01 STA score0 3236 cb2b d8 CLD 3237 cb2c 20 00 d8 jsr .power_up_obtained 3238 cb2f 3239 cb2f .skipL0198 3240 cb2f .L0199 ;; if boxcollision ( playerX , playerY , 8 , 16 , enemy01_X , enemy01_Y , 8 , 16 ) then enemy01_X = 200 : enemy01_Y = 200 : playerFlag = 1 : lives = lives - 0 : playsfx sfx_explosion : isDead_flag = 1 : goto _checkCollisionsExit 3241 cb2f 3242 cb2f 3243 cb2f 18 clc ; one clc only. If we overflow we're screwed anyway. 3244 cb30 a0 07 ldy #(8-1) 3245 cb32 84 44 sty temp3 3246 cb34 a0 0f ldy #(16-1) 3247 cb36 84 45 sty temp4 3248 cb38 ad 57 01 lda enemy01_X 3249 cb3b 69 30 adc #48 3250 cb3d 85 46 sta temp5 3251 cb3f ad 58 01 lda enemy01_Y 3252 cb42 69 20 adc #((256-WSCREENHEIGHT)/2) 3253 cb44 85 47 sta temp6 3254 cb46 a0 07 ldy #(8-1) 3255 cb48 84 48 sty temp7 3256 cb4a a0 0f ldy #(16-1) 3257 cb4c 84 49 sty temp8 3258 cb4e ad 42 01 lda playerY 3259 cb51 69 20 adc #((256-WSCREENHEIGHT)/2) 3260 cb53 a8 tay 3261 cb54 ad 41 01 lda playerX 3262 cb57 69 30 adc #48 3263 cb59 20 d6 f3 jsr boxcollision 3264 cb5c 3265 cb5c 90 37 BCC .skipL0199 3266 cb5e .condpart85 3267 cb5e a9 c8 LDA #200 3268 cb60 8d 57 01 STA enemy01_X 3269 cb63 8d 58 01 STA enemy01_Y 3270 cb66 a9 01 LDA #1 3271 cb68 8d 4d 01 STA playerFlag 3272 cb6b ad 64 01 LDA lives 3273 cb6e 38 SEC 3274 cb6f e9 00 SBC #0 3275 cb71 8d 64 01 STA lives 3276 cb74 a9 01 lda #1 3277 cb76 85 de sta sfxschedulelock 3278 cb78 a9 7e lda #sfx_explosion 3281 cb7e 85 e1 sta sfxinstrumenthi 3282 cb80 a9 00 lda #0 3283 cb82 85 e2 sta sfxpitchoffset ; no pitch modification 3284 cb84 85 e3 sta sfxnoteindex ; not a musical note 3285 cb86 20 58 f2 jsr schedulesfx 3286 cb89 a9 00 lda #0 3287 cb8b 85 de sta sfxschedulelock 3288 cb8d a9 01 LDA #1 3289 cb8f 8d 6a 01 STA isDead_flag 3290 cb92 4c 91 cd jmp ._checkCollisionsExit 3291 cb95 3292 cb95 .skipL0199 3293 cb95 .L0200 ;; 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 3294 cb95 3295 cb95 3296 cb95 18 clc ; one clc only. If we overflow we're screwed anyway. 3297 cb96 a0 07 ldy #(8-1) 3298 cb98 84 44 sty temp3 3299 cb9a a0 0f ldy #(16-1) 3300 cb9c 84 45 sty temp4 3301 cb9e ad 60 01 lda extra_shipX 3302 cba1 69 30 adc #48 3303 cba3 85 46 sta temp5 3304 cba5 ad 61 01 lda extra_shipY 3305 cba8 69 20 adc #((256-WSCREENHEIGHT)/2) 3306 cbaa 85 47 sta temp6 3307 cbac a0 07 ldy #(8-1) 3308 cbae 84 48 sty temp7 3309 cbb0 a0 07 ldy #(8-1) 3310 cbb2 84 49 sty temp8 3311 cbb4 ad 42 01 lda playerY 3312 cbb7 69 20 adc #((256-WSCREENHEIGHT)/2) 3313 cbb9 a8 tay 3314 cbba ad 41 01 lda playerX 3315 cbbd 69 30 adc #48 3316 cbbf 20 d6 f3 jsr boxcollision 3317 cbc2 3318 cbc2 90 2f BCC .skipL0200 3319 cbc4 .condpart86 3320 cbc4 a9 c8 LDA #200 3321 cbc6 8d 60 01 STA extra_shipX 3322 cbc9 8d 61 01 STA extra_shipY 3323 cbcc a9 01 LDA #1 3324 cbce 8d 62 01 STA extra_shipFlag 3325 cbd1 ad 64 01 LDA lives 3326 cbd4 18 CLC 3327 cbd5 69 01 ADC #1 3328 cbd7 8d 64 01 STA lives 3329 cbda a9 01 lda #1 3330 cbdc 85 de sta sfxschedulelock 3331 cbde a9 bb lda #sfx_bling 3334 cbe4 85 e1 sta sfxinstrumenthi 3335 cbe6 a9 00 lda #0 3336 cbe8 85 e2 sta sfxpitchoffset ; no pitch modification 3337 cbea 85 e3 sta sfxnoteindex ; not a musical note 3338 cbec 20 58 f2 jsr schedulesfx 3339 cbef a9 00 lda #0 3340 cbf1 85 de sta sfxschedulelock 3341 cbf3 .skipL0200 3342 cbf3 .L0201 ;; if boxcollision ( bulletX , bulletY , 4 , 8 , enemy01_X , enemy01_Y , 8 , 16 ) then bulletX = - 8 : bulletY = 0 : enemy01_X = 208 : enemy01_Y = 200 : enemy01_Flag = 1 : playsfx sfx_explosion 3343 cbf3 3344 cbf3 3345 cbf3 18 clc ; one clc only. If we overflow we're screwed anyway. 3346 cbf4 a0 03 ldy #(4-1) 3347 cbf6 84 44 sty temp3 3348 cbf8 a0 07 ldy #(8-1) 3349 cbfa 84 45 sty temp4 3350 cbfc ad 57 01 lda enemy01_X 3351 cbff 69 30 adc #48 3352 cc01 85 46 sta temp5 3353 cc03 ad 58 01 lda enemy01_Y 3354 cc06 69 20 adc #((256-WSCREENHEIGHT)/2) 3355 cc08 85 47 sta temp6 3356 cc0a a0 07 ldy #(8-1) 3357 cc0c 84 48 sty temp7 3358 cc0e a0 0f ldy #(16-1) 3359 cc10 84 49 sty temp8 3360 cc12 ad 49 01 lda bulletY 3361 cc15 69 20 adc #((256-WSCREENHEIGHT)/2) 3362 cc17 a8 tay 3363 cc18 ad 48 01 lda bulletX 3364 cc1b 69 30 adc #48 3365 cc1d 20 d6 f3 jsr boxcollision 3366 cc20 3367 cc20 90 32 BCC .skipL0201 3368 cc22 .condpart87 3369 cc22 a9 f8 LDA #248 3370 cc24 8d 48 01 STA bulletX 3371 cc27 a9 00 LDA #0 3372 cc29 8d 49 01 STA bulletY 3373 cc2c a9 d0 LDA #208 3374 cc2e 8d 57 01 STA enemy01_X 3375 cc31 a9 c8 LDA #200 3376 cc33 8d 58 01 STA enemy01_Y 3377 cc36 a9 01 LDA #1 3378 cc38 8d 59 01 STA enemy01_Flag 3379 cc3b a9 01 lda #1 3380 cc3d 85 de sta sfxschedulelock 3381 cc3f a9 7e lda #sfx_explosion 3384 cc45 85 e1 sta sfxinstrumenthi 3385 cc47 a9 00 lda #0 3386 cc49 85 e2 sta sfxpitchoffset ; no pitch modification 3387 cc4b 85 e3 sta sfxnoteindex ; not a musical note 3388 cc4d 20 58 f2 jsr schedulesfx 3389 cc50 a9 00 lda #0 3390 cc52 85 de sta sfxschedulelock 3391 cc54 .skipL0201 3392 cc54 .L0202 ;; if boxcollision ( twinlaserX , twinlaserY , 4 , 16 , enemy01_X , enemy01_Y , 8 , 16 ) then twinlaserX = - 8 : twinlaserY = 0 : enemy01_X = 208 : enemy01_Y = 200 : enemy01_Flag = 1 : playsfx sfx_explosion 3393 cc54 3394 cc54 3395 cc54 18 clc ; one clc only. If we overflow we're screwed anyway. 3396 cc55 a0 03 ldy #(4-1) 3397 cc57 84 44 sty temp3 3398 cc59 a0 0f ldy #(16-1) 3399 cc5b 84 45 sty temp4 3400 cc5d ad 57 01 lda enemy01_X 3401 cc60 69 30 adc #48 3402 cc62 85 46 sta temp5 3403 cc64 ad 58 01 lda enemy01_Y 3404 cc67 69 20 adc #((256-WSCREENHEIGHT)/2) 3405 cc69 85 47 sta temp6 3406 cc6b a0 07 ldy #(8-1) 3407 cc6d 84 48 sty temp7 3408 cc6f a0 0f ldy #(16-1) 3409 cc71 84 49 sty temp8 3410 cc73 ad 66 01 lda twinlaserY 3411 cc76 69 20 adc #((256-WSCREENHEIGHT)/2) 3412 cc78 a8 tay 3413 cc79 ad 65 01 lda twinlaserX 3414 cc7c 69 30 adc #48 3415 cc7e 20 d6 f3 jsr boxcollision 3416 cc81 3417 cc81 90 32 BCC .skipL0202 3418 cc83 .condpart88 3419 cc83 a9 f8 LDA #248 3420 cc85 8d 65 01 STA twinlaserX 3421 cc88 a9 00 LDA #0 3422 cc8a 8d 66 01 STA twinlaserY 3423 cc8d a9 d0 LDA #208 3424 cc8f 8d 57 01 STA enemy01_X 3425 cc92 a9 c8 LDA #200 3426 cc94 8d 58 01 STA enemy01_Y 3427 cc97 a9 01 LDA #1 3428 cc99 8d 59 01 STA enemy01_Flag 3429 cc9c a9 01 lda #1 3430 cc9e 85 de sta sfxschedulelock 3431 cca0 a9 7e lda #sfx_explosion 3434 cca6 85 e1 sta sfxinstrumenthi 3435 cca8 a9 00 lda #0 3436 ccaa 85 e2 sta sfxpitchoffset ; no pitch modification 3437 ccac 85 e3 sta sfxnoteindex ; not a musical note 3438 ccae 20 58 f2 jsr schedulesfx 3439 ccb1 a9 00 lda #0 3440 ccb3 85 de sta sfxschedulelock 3441 ccb5 .skipL0202 3442 ccb5 . 3443 ccb5 ;; 3444 ccb5 3445 ccb5 .L0203 ;; if bulletX > enemy01_X && bulletX < ( enemy01_X + 16 ) && bulletY > enemy01_Y && bulletY < ( enemy01_Y + 16 ) then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion 3446 ccb5 3447 ccb5 ad 57 01 LDA enemy01_X 3448 ccb8 cd 48 01 CMP bulletX 3449 ccbb b0 66 BCS .skipL0203 3450 ccbd .condpart89 3451 ccbd ; complex condition detected 3452 ccbd ; complex statement detected 3453 ccbd ad 57 01 LDA enemy01_X 3454 ccc0 18 CLC 3455 ccc1 69 10 ADC #16 3456 ccc3 48 PHA 3457 ccc4 ba TSX 3458 ccc5 68 PLA 3459 ccc6 ad 48 01 LDA bulletX 3460 ccc9 dd 01 01 CMP $101,x 3461 cccc b0 55 BCS .skip89then 3462 ccce .condpart90 3463 ccce ad 58 01 LDA enemy01_Y 3464 ccd1 cd 49 01 CMP bulletY 3465 ccd4 b0 4d BCS .skip90then 3466 ccd6 .condpart91 3467 ccd6 ; complex condition detected 3468 ccd6 ; complex statement detected 3469 ccd6 ad 58 01 LDA enemy01_Y 3470 ccd9 18 CLC 3471 ccda 69 10 ADC #16 3472 ccdc 48 PHA 3473 ccdd ba TSX 3474 ccde 68 PLA 3475 ccdf ad 49 01 LDA bulletY 3476 cce2 dd 01 01 CMP $101,x 3477 cce5 b0 3c BCS .skip91then 3478 cce7 .condpart92 3479 cce7 a9 01 LDA #1 3480 cce9 8d 59 01 STA enemy01_Flag 3481 ccec 8d 63 01 STA explosion_aniframe 3482 ccef f8 SED 3483 ccf0 18 CLC 3484 ccf1 ad a8 01 LDA score0+2 3485 ccf4 69 01 ADC #$01 3486 ccf6 8d a8 01 STA score0+2 3487 ccf9 ad a7 01 LDA score0+1 3488 ccfc 69 00 ADC #$00 3489 ccfe 8d a7 01 STA score0+1 3490 cd01 ad a6 01 LDA score0 3491 cd04 69 00 ADC #$00 3492 cd06 8d a6 01 STA score0 3493 cd09 d8 CLD 3494 cd0a a9 01 lda #1 3495 cd0c 85 de sta sfxschedulelock 3496 cd0e a9 7e lda #sfx_explosion 3499 cd14 85 e1 sta sfxinstrumenthi 3500 cd16 a9 00 lda #0 3501 cd18 85 e2 sta sfxpitchoffset ; no pitch modification 3502 cd1a 85 e3 sta sfxnoteindex ; not a musical note 3503 cd1c 20 58 f2 jsr schedulesfx 3504 cd1f a9 00 lda #0 3505 cd21 85 de sta sfxschedulelock 3506 cd23 .skip91then 3507 cd23 .skip90then 3508 cd23 .skip89then 3509 cd23 .skipL0203 3510 cd23 .L0204 ;; if twinlaserX > enemy01_X && twinlaserX < ( enemy01_X + 16 ) && twinlaserY > enemy01_Y && twinlaserY < ( enemy01_Y + 16 ) then enemy01_Flag = 1 : explosion_aniframe = 1 : score0 = score0 + 1 : playsfx sfx_explosion 3511 cd23 3512 cd23 ad 57 01 LDA enemy01_X 3513 cd26 cd 65 01 CMP twinlaserX 3514 cd29 b0 66 BCS .skipL0204 3515 cd2b .condpart93 3516 cd2b ; complex condition detected 3517 cd2b ; complex statement detected 3518 cd2b ad 57 01 LDA enemy01_X 3519 cd2e 18 CLC 3520 cd2f 69 10 ADC #16 3521 cd31 48 PHA 3522 cd32 ba TSX 3523 cd33 68 PLA 3524 cd34 ad 65 01 LDA twinlaserX 3525 cd37 dd 01 01 CMP $101,x 3526 cd3a b0 55 BCS .skip93then 3527 cd3c .condpart94 3528 cd3c ad 58 01 LDA enemy01_Y 3529 cd3f cd 66 01 CMP twinlaserY 3530 cd42 b0 4d BCS .skip94then 3531 cd44 .condpart95 3532 cd44 ; complex condition detected 3533 cd44 ; complex statement detected 3534 cd44 ad 58 01 LDA enemy01_Y 3535 cd47 18 CLC 3536 cd48 69 10 ADC #16 3537 cd4a 48 PHA 3538 cd4b ba TSX 3539 cd4c 68 PLA 3540 cd4d ad 66 01 LDA twinlaserY 3541 cd50 dd 01 01 CMP $101,x 3542 cd53 b0 3c BCS .skip95then 3543 cd55 .condpart96 3544 cd55 a9 01 LDA #1 3545 cd57 8d 59 01 STA enemy01_Flag 3546 cd5a 8d 63 01 STA explosion_aniframe 3547 cd5d f8 SED 3548 cd5e 18 CLC 3549 cd5f ad a8 01 LDA score0+2 3550 cd62 69 01 ADC #$01 3551 cd64 8d a8 01 STA score0+2 3552 cd67 ad a7 01 LDA score0+1 3553 cd6a 69 00 ADC #$00 3554 cd6c 8d a7 01 STA score0+1 3555 cd6f ad a6 01 LDA score0 3556 cd72 69 00 ADC #$00 3557 cd74 8d a6 01 STA score0 3558 cd77 d8 CLD 3559 cd78 a9 01 lda #1 3560 cd7a 85 de sta sfxschedulelock 3561 cd7c a9 7e lda #sfx_explosion 3564 cd82 85 e1 sta sfxinstrumenthi 3565 cd84 a9 00 lda #0 3566 cd86 85 e2 sta sfxpitchoffset ; no pitch modification 3567 cd88 85 e3 sta sfxnoteindex ; not a musical note 3568 cd8a 20 58 f2 jsr schedulesfx 3569 cd8d a9 00 lda #0 3570 cd8f 85 de sta sfxschedulelock 3571 cd91 .skip95then 3572 cd91 .skip94then 3573 cd91 .skip93then 3574 cd91 .skipL0204 3575 cd91 . 3576 cd91 ;; 3577 cd91 3578 cd91 ._checkCollisionsExit 3579 cd91 ;; _checkCollisionsExit 3580 cd91 3581 cd91 .L0205 ;; return 3582 cd91 3583 cd91 60 RTS 3584 cd92 . 3585 cd92 ;; 3586 cd92 3587 cd92 .SetBulletHome 3588 cd92 ;; SetBulletHome 3589 cd92 3590 cd92 .L0206 ;; bulletX = playerX + 4 : bulletY = playerY - 2 3591 cd92 3592 cd92 ad 41 01 LDA playerX 3593 cd95 18 CLC 3594 cd96 69 04 ADC #4 3595 cd98 8d 48 01 STA bulletX 3596 cd9b ad 42 01 LDA playerY 3597 cd9e 38 SEC 3598 cd9f e9 02 SBC #2 3599 cda1 8d 49 01 STA bulletY 3600 cda4 .L0207 ;; return 3601 cda4 3602 cda4 60 RTS 3603 cda5 . 3604 cda5 ;; 3605 cda5 3606 cda5 .SetLaserHome 3607 cda5 ;; SetLaserHome 3608 cda5 3609 cda5 .L0208 ;; twinlaserX = playerX + 4 : twinlaserY = playerY - 2 3610 cda5 3611 cda5 ad 41 01 LDA playerX 3612 cda8 18 CLC 3613 cda9 69 04 ADC #4 3614 cdab 8d 65 01 STA twinlaserX 3615 cdae ad 42 01 LDA playerY 3616 cdb1 38 SEC 3617 cdb2 e9 02 SBC #2 3618 cdb4 8d 66 01 STA twinlaserY 3619 cdb7 .L0209 ;; return 3620 cdb7 3621 cdb7 60 RTS 3622 cdb8 . 3623 cdb8 ;; 3624 cdb8 3625 cdb8 .L0210 ;; dmahole 2 3626 cdb8 3627 cdb8 4c 00 d8 jmp dmahole_2 3628 cdb8 DMAHOLEEND1 SET . 581 bytes of ROM space left in DMA hole 1. 3629 cdb8 echo " "," "," "," ",[(256*WZONEHEIGHT)-(DMAHOLEEND1 - DMAHOLESTART1)]d , "bytes of ROM space left in DMA hole 1." 3630 cdbb - if ((256*WZONEHEIGHT)-(DMAHOLEEND1 - DMAHOLESTART1)) < 0 3631 cdbb -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 3632 cdbb endif 3633 cdbb 3634 d000 ORG $D000,0 ; ************* 3635 d000 3636 d000 3637 d100 ORG $D100,0 ; ************* 3638 d100 3639 d100 3640 d200 ORG $D200,0 ; ************* 3641 d200 3642 d200 3643 d300 ORG $D300,0 ; ************* 3644 d300 3645 d300 3646 d400 ORG $D400,0 ; ************* 3647 d400 3648 d400 3649 d500 ORG $D500,0 ; ************* 3650 d500 3651 d500 3652 d600 ORG $D600,0 ; ************* 3653 d600 3654 d600 3655 d700 ORG $D700,0 ; ************* 3656 d700 3657 d700 3658 d800 ORG $D800,0 ; ************* 3659 d800 dmahole_2 3660 d800 DMAHOLESTART2 SET . 3661 d800 . 3662 d800 ;; 3663 d800 3664 d800 .power_up_obtained 3665 d800 ;; power_up_obtained 3666 d800 3667 d800 .L0211 ;; if power_upFlag = 1 then twinlaser_flag = 1 3668 d800 3669 d800 ad 52 01 LDA power_upFlag 3670 d803 c9 01 CMP #1 3671 d805 d0 05 BNE .skipL0211 3672 d807 .condpart97 3673 d807 a9 01 LDA #1 3674 d809 8d 67 01 STA twinlaser_flag 3675 d80c .skipL0211 3676 d80c .L0212 ;; if twinlaser_flag = 1 && joy0up && joyposup = - 2 then gosub SetLaserHome 3677 d80c 3678 d80c ad 67 01 LDA twinlaser_flag 3679 d80f c9 01 CMP #1 3680 d811 d0 17 BNE .skipL0212 3681 d813 .condpart98 3682 d813 a9 10 lda #$10 3683 d815 2c 80 02 bit SWCHA 3684 d818 d0 10 BNE .skip98then 3685 d81a .condpart99 3686 d81a ; complex condition detected 3687 d81a a9 fe LDA #254 3688 d81c 48 PHA 3689 d81d ba TSX 3690 d81e 68 PLA 3691 d81f ad 44 01 LDA joyposup 3692 d822 dd 01 01 CMP $101,x 3693 d825 d0 03 BNE .skip99then 3694 d827 .condpart100 3695 d827 20 a5 cd jsr .SetLaserHome 3696 d82a 3697 d82a .skip99then 3698 d82a .skip98then 3699 d82a .skipL0212 3700 d82a .L0213 ;; if twinlaser_flag = 1 && joy0down && joyposdown = - 2 then gosub SetLaserHome 3701 d82a 3702 d82a ad 67 01 LDA twinlaser_flag 3703 d82d c9 01 CMP #1 3704 d82f d0 17 BNE .skipL0213 3705 d831 .condpart101 3706 d831 a9 20 lda #$20 3707 d833 2c 80 02 bit SWCHA 3708 d836 d0 10 BNE .skip101then 3709 d838 .condpart102 3710 d838 ; complex condition detected 3711 d838 a9 fe LDA #254 3712 d83a 48 PHA 3713 d83b ba TSX 3714 d83c 68 PLA 3715 d83d ad 45 01 LDA joyposdown 3716 d840 dd 01 01 CMP $101,x 3717 d843 d0 03 BNE .skip102then 3718 d845 .condpart103 3719 d845 20 a5 cd jsr .SetLaserHome 3720 d848 3721 d848 .skip102then 3722 d848 .skip101then 3723 d848 .skipL0213 3724 d848 .L0214 ;; if twinlaser_flag = 1 && joy0up && joyposleft = - 2 then gosub SetLaserHome 3725 d848 3726 d848 ad 67 01 LDA twinlaser_flag 3727 d84b c9 01 CMP #1 3728 d84d d0 17 BNE .skipL0214 3729 d84f .condpart104 3730 d84f a9 10 lda #$10 3731 d851 2c 80 02 bit SWCHA 3732 d854 d0 10 BNE .skip104then 3733 d856 .condpart105 3734 d856 ; complex condition detected 3735 d856 a9 fe LDA #254 3736 d858 48 PHA 3737 d859 ba TSX 3738 d85a 68 PLA 3739 d85b ad 46 01 LDA joyposleft 3740 d85e dd 01 01 CMP $101,x 3741 d861 d0 03 BNE .skip105then 3742 d863 .condpart106 3743 d863 20 a5 cd jsr .SetLaserHome 3744 d866 3745 d866 .skip105then 3746 d866 .skip104then 3747 d866 .skipL0214 3748 d866 .L0215 ;; if twinlaser_flag = 1 && joy0down && joyposright = - 2 then gosub SetLaserHome 3749 d866 3750 d866 ad 67 01 LDA twinlaser_flag 3751 d869 c9 01 CMP #1 3752 d86b d0 17 BNE .skipL0215 3753 d86d .condpart107 3754 d86d a9 20 lda #$20 3755 d86f 2c 80 02 bit SWCHA 3756 d872 d0 10 BNE .skip107then 3757 d874 .condpart108 3758 d874 ; complex condition detected 3759 d874 a9 fe LDA #254 3760 d876 48 PHA 3761 d877 ba TSX 3762 d878 68 PLA 3763 d879 ad 47 01 LDA joyposright 3764 d87c dd 01 01 CMP $101,x 3765 d87f d0 03 BNE .skip108then 3766 d881 .condpart109 3767 d881 20 a5 cd jsr .SetLaserHome 3768 d884 3769 d884 .skip108then 3770 d884 .skip107then 3771 d884 .skipL0215 3772 d884 . 3773 d884 ;; 3774 d884 3775 d884 .L0216 ;; if twinlaser_flag = 1 && joy0fire && joyposup = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3776 d884 3777 d884 ad 67 01 LDA twinlaser_flag 3778 d887 c9 01 CMP #1 3779 d889 d0 2e BNE .skipL0216 3780 d88b .condpart110 3781 d88b 2c 02 21 bit sINPT1 3782 d88e 10 29 BPL .skip110then 3783 d890 .condpart111 3784 d890 ad 44 01 LDA joyposup 3785 d893 c9 01 CMP #1 3786 d895 d0 22 BNE .skip111then 3787 d897 .condpart112 3788 d897 ad 66 01 LDA twinlaserY 3789 d89a 38 SEC 3790 d89b e9 0a SBC #10 3791 d89d 8d 66 01 STA twinlaserY 3792 d8a0 a9 01 lda #1 3793 d8a2 85 de sta sfxschedulelock 3794 d8a4 a9 4b lda #sfx_plainlaser 3797 d8aa 85 e1 sta sfxinstrumenthi 3798 d8ac a9 00 lda #0 3799 d8ae 85 e2 sta sfxpitchoffset ; no pitch modification 3800 d8b0 85 e3 sta sfxnoteindex ; not a musical note 3801 d8b2 20 58 f2 jsr schedulesfx 3802 d8b5 a9 00 lda #0 3803 d8b7 85 de sta sfxschedulelock 3804 d8b9 .skip111then 3805 d8b9 .skip110then 3806 d8b9 .skipL0216 3807 d8b9 .L0217 ;; if twinlaser_flag = 1 && joy0fire && joyposdown = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3808 d8b9 3809 d8b9 ad 67 01 LDA twinlaser_flag 3810 d8bc c9 01 CMP #1 3811 d8be d0 2e BNE .skipL0217 3812 d8c0 .condpart113 3813 d8c0 2c 02 21 bit sINPT1 3814 d8c3 10 29 BPL .skip113then 3815 d8c5 .condpart114 3816 d8c5 ad 45 01 LDA joyposdown 3817 d8c8 c9 01 CMP #1 3818 d8ca d0 22 BNE .skip114then 3819 d8cc .condpart115 3820 d8cc ad 66 01 LDA twinlaserY 3821 d8cf 38 SEC 3822 d8d0 e9 0a SBC #10 3823 d8d2 8d 66 01 STA twinlaserY 3824 d8d5 a9 01 lda #1 3825 d8d7 85 de sta sfxschedulelock 3826 d8d9 a9 4b lda #sfx_plainlaser 3829 d8df 85 e1 sta sfxinstrumenthi 3830 d8e1 a9 00 lda #0 3831 d8e3 85 e2 sta sfxpitchoffset ; no pitch modification 3832 d8e5 85 e3 sta sfxnoteindex ; not a musical note 3833 d8e7 20 58 f2 jsr schedulesfx 3834 d8ea a9 00 lda #0 3835 d8ec 85 de sta sfxschedulelock 3836 d8ee .skip114then 3837 d8ee .skip113then 3838 d8ee .skipL0217 3839 d8ee .L0218 ;; if twinlaser_flag = 1 && joy0fire && joyposleft = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3840 d8ee 3841 d8ee ad 67 01 LDA twinlaser_flag 3842 d8f1 c9 01 CMP #1 3843 d8f3 d0 2e BNE .skipL0218 3844 d8f5 .condpart116 3845 d8f5 2c 02 21 bit sINPT1 3846 d8f8 10 29 BPL .skip116then 3847 d8fa .condpart117 3848 d8fa ad 46 01 LDA joyposleft 3849 d8fd c9 01 CMP #1 3850 d8ff d0 22 BNE .skip117then 3851 d901 .condpart118 3852 d901 ad 66 01 LDA twinlaserY 3853 d904 38 SEC 3854 d905 e9 0a SBC #10 3855 d907 8d 66 01 STA twinlaserY 3856 d90a a9 01 lda #1 3857 d90c 85 de sta sfxschedulelock 3858 d90e a9 4b lda #sfx_plainlaser 3861 d914 85 e1 sta sfxinstrumenthi 3862 d916 a9 00 lda #0 3863 d918 85 e2 sta sfxpitchoffset ; no pitch modification 3864 d91a 85 e3 sta sfxnoteindex ; not a musical note 3865 d91c 20 58 f2 jsr schedulesfx 3866 d91f a9 00 lda #0 3867 d921 85 de sta sfxschedulelock 3868 d923 .skip117then 3869 d923 .skip116then 3870 d923 .skipL0218 3871 d923 .L0219 ;; if twinlaser_flag = 1 && joy0fire && joyposright = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3872 d923 3873 d923 ad 67 01 LDA twinlaser_flag 3874 d926 c9 01 CMP #1 3875 d928 d0 2e BNE .skipL0219 3876 d92a .condpart119 3877 d92a 2c 02 21 bit sINPT1 3878 d92d 10 29 BPL .skip119then 3879 d92f .condpart120 3880 d92f ad 47 01 LDA joyposright 3881 d932 c9 01 CMP #1 3882 d934 d0 22 BNE .skip120then 3883 d936 .condpart121 3884 d936 ad 66 01 LDA twinlaserY 3885 d939 38 SEC 3886 d93a e9 0a SBC #10 3887 d93c 8d 66 01 STA twinlaserY 3888 d93f a9 01 lda #1 3889 d941 85 de sta sfxschedulelock 3890 d943 a9 4b lda #sfx_plainlaser 3893 d949 85 e1 sta sfxinstrumenthi 3894 d94b a9 00 lda #0 3895 d94d 85 e2 sta sfxpitchoffset ; no pitch modification 3896 d94f 85 e3 sta sfxnoteindex ; not a musical note 3897 d951 20 58 f2 jsr schedulesfx 3898 d954 a9 00 lda #0 3899 d956 85 de sta sfxschedulelock 3900 d958 .skip120then 3901 d958 .skip119then 3902 d958 .skipL0219 3903 d958 .L0220 ;; if !joy0fire then twinlaserX = playerX + 2 : twinlaserY = playerY - 8 3904 d958 3905 d958 2c 02 21 bit sINPT1 3906 d95b 30 12 BMI .skipL0220 3907 d95d .condpart122 3908 d95d ad 41 01 LDA playerX 3909 d960 18 CLC 3910 d961 69 02 ADC #2 3911 d963 8d 65 01 STA twinlaserX 3912 d966 ad 42 01 LDA playerY 3913 d969 38 SEC 3914 d96a e9 08 SBC #8 3915 d96c 8d 66 01 STA twinlaserY 3916 d96f .skipL0220 3917 d96f .L0221 ;; return 3918 d96f 3919 d96f 60 RTS 3920 d970 . 3921 d970 ;; 3922 d970 3923 d970 .lose_a_life 3924 d970 ;; lose_a_life 3925 d970 3926 d970 .L0222 ;; lives = lives - 1 : isDead_flag = 0 3927 d970 3928 d970 ad 64 01 LDA lives 3929 d973 38 SEC 3930 d974 e9 01 SBC #1 3931 d976 8d 64 01 STA lives 3932 d979 a9 00 LDA #0 3933 d97b 8d 6a 01 STA isDead_flag 3934 d97e .L0223 ;; if enemy01_Flag <> 1 then enemy01_X = 32 : enemy01_Y = 0 3935 d97e 3936 d97e ad 59 01 LDA enemy01_Flag 3937 d981 c9 01 CMP #1 3938 d983 f0 0a BEQ .skipL0223 3939 d985 .condpart123 3940 d985 a9 20 LDA #32 3941 d987 8d 57 01 STA enemy01_X 3942 d98a a9 00 LDA #0 3943 d98c 8d 58 01 STA enemy01_Y 3944 d98f .skipL0223 3945 d98f .L0224 ;; if enemy_shotFlag <> 1 then enemy_shotX = 0 : enemy_shotY = 0 3946 d98f 3947 d98f ad 4c 01 LDA enemy_shotFlag 3948 d992 c9 01 CMP #1 3949 d994 f0 08 BEQ .skipL0224 3950 d996 .condpart124 3951 d996 a9 00 LDA #0 3952 d998 8d 4a 01 STA enemy_shotX 3953 d99b 8d 4b 01 STA enemy_shotY 3954 d99e .skipL0224 3955 d99e .L0225 ;; if playerFlag = 1 && explosion_aniframe = 200 && lives > 0 then playerX = 80 : playerY = 144 : playerFlag = 0 : explosion_aniframe = 0 : goto main 3956 d99e 3957 d99e ad 4d 01 LDA playerFlag 3958 d9a1 c9 01 CMP #1 3959 d9a3 d0 23 BNE .skipL0225 3960 d9a5 .condpart125 3961 d9a5 ad 63 01 LDA explosion_aniframe 3962 d9a8 c9 c8 CMP #200 3963 d9aa d0 1c BNE .skip125then 3964 d9ac .condpart126 3965 d9ac a9 00 LDA #0 3966 d9ae cd 64 01 CMP lives 3967 d9b1 b0 15 BCS .skip126then 3968 d9b3 .condpart127 3969 d9b3 a9 50 LDA #80 3970 d9b5 8d 41 01 STA playerX 3971 d9b8 a9 90 LDA #144 3972 d9ba 8d 42 01 STA playerY 3973 d9bd a9 00 LDA #0 3974 d9bf 8d 4d 01 STA playerFlag 3975 d9c2 8d 63 01 STA explosion_aniframe 3976 d9c5 4c da b8 jmp .main 3977 d9c8 3978 d9c8 .skip126then 3979 d9c8 .skip125then 3980 d9c8 .skipL0225 3981 d9c8 .L0226 ;; joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 3982 d9c8 3983 d9c8 a9 00 LDA #0 3984 d9ca 8d 44 01 STA joyposup 3985 d9cd 8d 45 01 STA joyposdown 3986 d9d0 8d 46 01 STA joyposleft 3987 d9d3 8d 47 01 STA joyposright 3988 d9d6 .L0227 ;; fire_debounce = 0 : bulletX = 0 : bulletY = 0 3989 d9d6 3990 d9d6 a9 00 LDA #0 3991 d9d8 8d 43 01 STA fire_debounce 3992 d9db 8d 48 01 STA bulletX 3993 d9de 8d 49 01 STA bulletY 3994 d9e1 .L0228 ;; enemy01_X = 0 : enemy01_Y = 0 : enemy01_Flag = 0 3995 d9e1 3996 d9e1 a9 00 LDA #0 3997 d9e3 8d 57 01 STA enemy01_X 3998 d9e6 8d 58 01 STA enemy01_Y 3999 d9e9 8d 59 01 STA enemy01_Flag 4000 d9ec .L0229 ;; playerFlag = 0 : gameover_flag = 0 4001 d9ec 4002 d9ec a9 00 LDA #0 4003 d9ee 8d 4d 01 STA playerFlag 4004 d9f1 8d 5f 01 STA gameover_flag 4005 d9f4 .L0230 ;; power_upFlag = 0 : twinlaser_flag = 0 4006 d9f4 4007 d9f4 a9 00 LDA #0 4008 d9f6 8d 52 01 STA power_upFlag 4009 d9f9 8d 67 01 STA twinlaser_flag 4010 d9fc . 4011 d9fc ;; 4012 d9fc 4013 d9fc . 4014 d9fc ;; 4015 d9fc 4016 d9fc .lose_a_lifeloop 4017 d9fc ;; lose_a_lifeloop 4018 d9fc 4019 d9fc .L0231 ;; restorescreen 4020 d9fc 4021 d9fc 20 9e f0 jsr restorescreen 4022 d9ff .L0232 ;; gosub draw_scores 4023 d9ff 4024 d9ff 20 ea c9 jsr .draw_scores 4025 da02 4026 da02 .L0233 ;; drawscreen 4027 da02 4028 da02 20 c0 f0 jsr drawscreen 4029 da05 .L0234 ;; if joy0fire then fire_debounce = 2 4030 da05 4031 da05 2c 02 21 bit sINPT1 4032 da08 10 05 BPL .skipL0234 4033 da0a .condpart128 4034 da0a a9 02 LDA #2 4035 da0c 8d 43 01 STA fire_debounce 4036 da0f .skipL0234 4037 da0f .L0235 ;; if !joy0fire then fire_debounce = 1 4038 da0f 4039 da0f 2c 02 21 bit sINPT1 4040 da12 30 05 BMI .skipL0235 4041 da14 .condpart129 4042 da14 a9 01 LDA #1 4043 da16 8d 43 01 STA fire_debounce 4044 da19 .skipL0235 4045 da19 .L0236 ;; if fire_debounce = 1 && lives > 0 then clearscreen : goto main 4046 da19 4047 da19 ad 43 01 LDA fire_debounce 4048 da1c c9 01 CMP #1 4049 da1e d0 0d BNE .skipL0236 4050 da20 .condpart130 4051 da20 a9 00 LDA #0 4052 da22 cd 64 01 CMP lives 4053 da25 b0 06 BCS .skip130then 4054 da27 .condpart131 4055 da27 20 8c f0 jsr clearscreen 4056 da2a 4c da b8 jmp .main 4057 da2d 4058 da2d .skip130then 4059 da2d .skipL0236 4060 da2d .L0237 ;; if fire_debounce = 1 && lives < 1 then clearscreen : goto gameover 4061 da2d 4062 da2d ad 43 01 LDA fire_debounce 4063 da30 c9 01 CMP #1 4064 da32 d0 0d BNE .skipL0237 4065 da34 .condpart132 4066 da34 ad 64 01 LDA lives 4067 da37 c9 01 CMP #1 4068 da39 b0 06 BCS .skip132then 4069 da3b .condpart133 4070 da3b 20 8c f0 jsr clearscreen 4071 da3e 4c 44 da jmp .gameover 4072 da41 4073 da41 .skip132then 4074 da41 .skipL0237 4075 da41 .L0238 ;; goto lose_a_lifeloop 4076 da41 4077 da41 4c fc d9 jmp .lose_a_lifeloop 4078 da44 4079 da44 . 4080 da44 ;; 4081 da44 4082 da44 .gameover 4083 da44 ;; gameover 4084 da44 4085 da44 .L0239 ;; gameover_flag = 0 4086 da44 4087 da44 a9 00 LDA #0 4088 da46 8d 5f 01 STA gameover_flag 4089 da49 .L0240 ;; fire_debounce = 1 4090 da49 4091 da49 a9 01 LDA #1 4092 da4b 8d 43 01 STA fire_debounce 4093 da4e .gameover_loop 4094 da4e ;; gameover_loop 4095 da4e 4096 da4e .L0241 ;; if lives = 0 then gameover_flag = 1 : clearscreen 4097 da4e 4098 da4e ad 64 01 LDA lives 4099 da51 c9 00 CMP #0 4100 da53 d0 08 BNE .skipL0241 4101 da55 .condpart134 4102 da55 a9 01 LDA #1 4103 da57 8d 5f 01 STA gameover_flag 4104 da5a 20 8c f0 jsr clearscreen 4105 da5d .skipL0241 4106 da5d .L0242 ;; plotchars 'game^over!' 0 40 16 4107 da5d 4108 da5d 4c 6a da JMP skipalphadata4 4109 da60 alphadata4 4110 da60 11 .byte.b (alphadata4 4125 da70 85 43 sta temp2 4126 da72 4127 da72 a9 16 lda #22 ; width in two's complement 4128 da74 09 00 ora #0 ; palette left shifted 5 bits 4129 da76 85 44 sta temp3 4130 da78 a9 28 lda #40 4131 da7a 85 45 sta temp4 4132 da7c 4133 da7c a9 10 lda #16 4134 da7e 4135 da7e 85 46 sta temp5 4136 da80 4137 da80 20 59 f3 jsr plotcharacters 4138 da83 .L0243 ;; if joy0fire && !fire_debounce then clearscreen : goto plot 4139 da83 4140 da83 2c 02 21 bit sINPT1 4141 da86 10 0b BPL .skipL0243 4142 da88 .condpart135 4143 da88 ad 43 01 LDA fire_debounce 4144 da8b d0 06 BNE .skip135then 4145 da8d .condpart136 4146 da8d 20 8c f0 jsr clearscreen 4147 da90 4c 30 b8 jmp .plot 4148 da93 4149 da93 .skip135then 4150 da93 .skipL0243 4151 da93 .L0244 ;; if !joy0fire then fire_debounce = 0 4152 da93 4153 da93 2c 02 21 bit sINPT1 4154 da96 30 05 BMI .skipL0244 4155 da98 .condpart137 4156 da98 a9 00 LDA #0 4157 da9a 8d 43 01 STA fire_debounce 4158 da9d .skipL0244 4159 da9d .L0245 ;; goto gameover_loop 4160 da9d 4161 da9d 4c 4e da jmp .gameover_loop 4162 daa0 4163 daa0 . 4164 daa0 ;; 4165 daa0 4166 daa0 . 4167 daa0 ;; 4168 daa0 4169 daa0 . 4170 daa0 ;; 4171 daa0 4172 daa0 . 4173 daa0 ;; 4174 daa0 4175 daa0 . 4176 daa0 ;; 4177 daa0 4178 daa0 . 4179 daa0 ;; 4180 daa0 4181 daa0 . 4182 daa0 ;; 4183 daa0 4184 daa0 . 4185 daa0 ;; 4186 daa0 4187 daa0 . 4188 daa0 ;; 4189 daa0 4190 daa0 . 4191 daa0 ;; 4192 daa0 4193 daa0 . 4194 daa0 ;; 4195 daa0 4196 daa0 . 4197 daa0 ;; 4198 daa0 4199 daa0 . 4200 daa0 ;; 4201 daa0 4202 daa0 . 4203 daa0 ;; 4204 daa0 4205 daa0 . 4206 daa0 ;; 4207 daa0 4208 daa0 . 4209 daa0 ;; 4210 daa0 4211 daa0 . 4212 daa0 ;; 4213 daa0 4214 daa0 .titlescreen 4215 daa0 ;; titlescreen 4216 daa0 4217 daa0 .L0246 ;; plotchars 'new^vertical^shooting' 1 38 4 4218 daa0 4219 daa0 4c b8 da JMP skipalphadata5 4220 daa3 alphadata5 4221 daa3 18 .byte.b (alphadata5 4247 dabe 85 43 sta temp2 4248 dac0 4249 dac0 a9 0b lda #11 ; width in two's complement 4250 dac2 09 20 ora #32 ; palette left shifted 5 bits 4251 dac4 85 44 sta temp3 4252 dac6 a9 26 lda #38 4253 dac8 85 45 sta temp4 4254 daca 4255 daca a9 04 lda #4 4256 dacc 4257 dacc 85 46 sta temp5 4258 dace 4259 dace 20 59 f3 jsr plotcharacters 4260 dad1 .L0247 ;; plotchars 'demo' 1 72 5 4261 dad1 4262 dad1 4c d8 da JMP skipalphadata6 4263 dad4 alphadata6 4264 dad4 0e .byte.b (alphadata6 4273 dade 85 43 sta temp2 4274 dae0 4275 dae0 a9 1c lda #28 ; width in two's complement 4276 dae2 09 20 ora #32 ; palette left shifted 5 bits 4277 dae4 85 44 sta temp3 4278 dae6 a9 48 lda #72 4279 dae8 85 45 sta temp4 4280 daea 4281 daea a9 05 lda #5 4282 daec 4283 daec 85 46 sta temp5 4284 daee 4285 daee 20 59 f3 jsr plotcharacters 4286 daf1 .L0248 ;; plotchars 'by^shane^skekel.' 1 48 7 4287 daf1 4288 daf1 4c 04 db JMP skipalphadata7 4289 daf4 alphadata7 4290 daf4 0c .byte.b (alphadata7 4311 db0a 85 43 sta temp2 4312 db0c 4313 db0c a9 10 lda #16 ; width in two's complement 4314 db0e 09 20 ora #32 ; palette left shifted 5 bits 4315 db10 85 44 sta temp3 4316 db12 a9 30 lda #48 4317 db14 85 45 sta temp4 4318 db16 4319 db16 a9 07 lda #7 4320 db18 4321 db18 85 46 sta temp5 4322 db1a 4323 db1a 20 59 f3 jsr plotcharacters 4324 db1d .L0249 ;; plotchars 'push^fire^to^begin.' 2 42 16 4325 db1d 4326 db1d 4c 33 db JMP skipalphadata8 4327 db20 alphadata8 4328 db20 1a .byte.b (alphadata8 4352 db39 85 43 sta temp2 4353 db3b 4354 db3b a9 0d lda #13 ; width in two's complement 4355 db3d 09 40 ora #64 ; palette left shifted 5 bits 4356 db3f 85 44 sta temp3 4357 db41 a9 2a lda #42 4358 db43 85 45 sta temp4 4359 db45 4360 db45 a9 10 lda #16 4361 db47 4362 db47 85 46 sta temp5 4363 db49 4364 db49 20 59 f3 jsr plotcharacters 4365 db4c .L0250 ;; savescreen 4366 db4c 4367 db4c 20 b0 f0 jsr savescreen 4368 db4f .L0251 ;; drawscreen 4369 db4f 4370 db4f 20 c0 f0 jsr drawscreen 4371 db52 .L0252 ;; fire_debounce = 1 4372 db52 4373 db52 a9 01 LDA #1 4374 db54 8d 43 01 STA fire_debounce 4375 db57 . 4376 db57 ;; 4377 db57 4378 db57 .titlescreenloop 4379 db57 ;; titlescreenloop 4380 db57 4381 db57 .L0253 ;; restorescreen 4382 db57 4383 db57 20 9e f0 jsr restorescreen 4384 db5a .L0254 ;; if switchreset then reboot 4385 db5a 4386 db5a 20 85 f4 jsr checkresetswitch 4387 db5d d0 03 BNE .skipL0254 4388 db5f .condpart138 4389 db5f 4c 72 f5 JMP START 4390 db62 .skipL0254 4391 db62 .L0255 ;; if joy0fire then clearscreen : savescreen : lives = $04 : score0 = 0 : playsfx sfx_bling : goto main 4392 db62 4393 db62 2c 02 21 bit sINPT1 4394 db65 10 36 BPL .skipL0255 4395 db67 .condpart139 4396 db67 20 8c f0 jsr clearscreen 4397 db6a 20 b0 f0 jsr savescreen 4398 db6d a9 04 LDA #$04 4399 db6f 8d 64 01 STA lives 4400 db72 a9 00 LDA #$00 4401 db74 8d a8 01 STA score0+2 4402 db77 a9 00 LDA #$00 4403 db79 8d a7 01 STA score0+1 4404 db7c a9 00 LDA #$00 4405 db7e 8d a6 01 STA score0 4406 db81 a9 01 lda #1 4407 db83 85 de sta sfxschedulelock 4408 db85 a9 bb lda #sfx_bling 4411 db8b 85 e1 sta sfxinstrumenthi 4412 db8d a9 00 lda #0 4413 db8f 85 e2 sta sfxpitchoffset ; no pitch modification 4414 db91 85 e3 sta sfxnoteindex ; not a musical note 4415 db93 20 58 f2 jsr schedulesfx 4416 db96 a9 00 lda #0 4417 db98 85 de sta sfxschedulelock 4418 db9a 4c da b8 jmp .main 4419 db9d 4420 db9d .skipL0255 4421 db9d .L0256 ;; if !joy0fire then fire_debounce = 0 4422 db9d 4423 db9d 2c 02 21 bit sINPT1 4424 dba0 30 05 BMI .skipL0256 4425 dba2 .condpart140 4426 dba2 a9 00 LDA #0 4427 dba4 8d 43 01 STA fire_debounce 4428 dba7 .skipL0256 4429 dba7 . 4430 dba7 ;; 4431 dba7 4432 dba7 . 4433 dba7 ;; 4434 dba7 4435 dba7 . 4436 dba7 ;; 4437 dba7 4438 dba7 .L0257 ;; drawscreen 4439 dba7 4440 dba7 20 c0 f0 jsr drawscreen 4441 dbaa .L0258 ;; goto titlescreenloop 4442 dbaa 4443 dbaa 4c 57 db jmp .titlescreenloop 4444 dbad 4445 dbad . 4446 dbad ;; 4447 dbad 4448 dbad . 4449 dbad ;; 4450 dbad 4451 dbad .initialise_gamescreen 4452 dbad ;; initialise_gamescreen 4453 dbad 4454 dbad .L0259 ;; clearscreen 4455 dbad 4456 dbad 20 8c f0 jsr clearscreen 4457 dbb0 .L0260 ;; BACKGRND = $00 4458 dbb0 4459 dbb0 a9 00 LDA #$00 4460 dbb2 85 20 STA BACKGRND 4461 dbb4 . 4462 dbb4 ;; 4463 dbb4 4464 dbb4 .L0261 ;; savescreen 4465 dbb4 4466 dbb4 20 b0 f0 jsr savescreen 4467 dbb7 .L0262 ;; return 4468 dbb7 4469 dbb7 60 RTS 4470 dbb8 . 4471 dbb8 ;; 4472 dbb8 4473 dbb8 .L0263 ;; data sfx_bling 4474 dbb8 4475 dbb8 4c f1 db JMP .skipL0263 4476 dbbb sfx_bling 4477 dbbb 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4478 dbbe 4479 dbbe 1c 04 07 .byte.b $1c,$04,$07 4480 dbc1 4481 dbc1 1b 04 07 .byte.b $1b,$04,$07 4482 dbc4 4483 dbc4 04 0f 05 .byte.b $04,$0f,$05 4484 dbc7 4485 dbc7 15 04 09 .byte.b $15,$04,$09 4486 dbca 4487 dbca 16 04 07 .byte.b $16,$04,$07 4488 dbcd 4489 dbcd 03 0f 04 .byte.b $03,$0f,$04 4490 dbd0 4491 dbd0 11 04 08 .byte.b $11,$04,$08 4492 dbd3 4493 dbd3 11 04 08 .byte.b $11,$04,$08 4494 dbd6 4495 dbd6 11 04 04 .byte.b $11,$04,$04 4496 dbd9 4497 dbd9 0e 04 09 .byte.b $0e,$04,$09 4498 dbdc 4499 dbdc 0e 04 07 .byte.b $0e,$04,$07 4500 dbdf 4501 dbdf 0e 04 04 .byte.b $0e,$04,$04 4502 dbe2 4503 dbe2 1c 04 07 .byte.b $1c,$04,$07 4504 dbe5 4505 dbe5 1b 04 05 .byte.b $1b,$04,$05 4506 dbe8 4507 dbe8 1c 04 04 .byte.b $1c,$04,$04 4508 dbeb 4509 dbeb 1b 04 02 .byte.b $1b,$04,$02 4510 dbee 4511 dbee 00 00 00 .byte.b $00,$00,$00 4512 dbf1 4513 dbf1 .skipL0263 4514 dbf1 00 bb sfx_bling_lo = #sfx_bling 4516 dbf1 . 4517 dbf1 ;; 4518 dbf1 4519 dbf1 .L0264 ;; data sfx_pulsecannon 4520 dbf1 4521 dbf1 4c 48 dc JMP .skipL0264 4522 dbf4 sfx_pulsecannon 4523 dbf4 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4524 dbf7 4525 dbf7 1e 0c 0a .byte.b $1e,$0c,$0a ; first chunk of freq,channel,volume 4526 dbfa 4527 dbfa 07 06 0f .byte.b $07,$06,$0f 4528 dbfd 4529 dbfd 07 06 0f .byte.b $07,$06,$0f 4530 dc00 4531 dc00 1e 06 0f .byte.b $1e,$06,$0f 4532 dc03 4533 dc03 17 0c 0b .byte.b $17,$0c,$0b 4534 dc06 4535 dc06 1b 0c 0b .byte.b $1b,$0c,$0b 4536 dc09 4537 dc09 1e 0c 0f .byte.b $1e,$0c,$0f 4538 dc0c 4539 dc0c 07 06 0f .byte.b $07,$06,$0f 4540 dc0f 4541 dc0f 07 06 0f .byte.b $07,$06,$0f 4542 dc12 4543 dc12 1e 06 08 .byte.b $1e,$06,$08 4544 dc15 4545 dc15 17 0c 06 .byte.b $17,$0c,$06 4546 dc18 4547 dc18 1b 0c 0f .byte.b $1b,$0c,$0f 4548 dc1b 4549 dc1b 1e 0c 0f .byte.b $1e,$0c,$0f 4550 dc1e 4551 dc1e 07 06 0f .byte.b $07,$06,$0f 4552 dc21 4553 dc21 07 06 0f .byte.b $07,$06,$0f 4554 dc24 4555 dc24 0a 06 0a .byte.b $0a,$06,$0a 4556 dc27 4557 dc27 17 0c 0a .byte.b $17,$0c,$0a 4558 dc2a 4559 dc2a 1e 0c 04 .byte.b $1e,$0c,$04 4560 dc2d 4561 dc2d 1e 06 09 .byte.b $1e,$06,$09 4562 dc30 4563 dc30 1b 04 05 .byte.b $1b,$04,$05 4564 dc33 4565 dc33 07 06 0f .byte.b $07,$06,$0f 4566 dc36 4567 dc36 0a 06 09 .byte.b $0a,$06,$09 4568 dc39 4569 dc39 17 0c 0d .byte.b $17,$0c,$0d 4570 dc3c 4571 dc3c 1b 0c 09 .byte.b $1b,$0c,$09 4572 dc3f 4573 dc3f 0a 06 05 .byte.b $0a,$06,$05 4574 dc42 4575 dc42 17 0c 03 .byte.b $17,$0c,$03 4576 dc45 4577 dc45 00 00 00 .byte.b $00,$00,$00 4578 dc48 4579 dc48 .skipL0264 4580 dc48 00 f4 sfx_pulsecannon_lo = #sfx_pulsecannon 4582 dc48 . 4583 dc48 ;; 4584 dc48 4585 dc48 .L0265 ;; data sfx_plainlaser 4586 dc48 4587 dc48 4c 7b dc JMP .skipL0265 4588 dc4b sfx_plainlaser 4589 dc4b 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4590 dc4e 4591 dc4e 10 04 06 .byte.b $10,$04,$06 ; first chunk of freq,channel,volume 4592 dc51 4593 dc51 13 04 08 .byte.b $13,$04,$08 4594 dc54 4595 dc54 16 04 08 .byte.b $16,$04,$08 4596 dc57 4597 dc57 16 04 07 .byte.b $16,$04,$07 4598 dc5a 4599 dc5a 1c 04 09 .byte.b $1c,$04,$09 4600 dc5d 4601 dc5d 0b 0c 0f .byte.b $0b,$0c,$0f 4602 dc60 4603 dc60 0d 0c 0f .byte.b $0d,$0c,$0f 4604 dc63 4605 dc63 0e 0c 0f .byte.b $0e,$0c,$0f 4606 dc66 4607 dc66 0e 0c 0f .byte.b $0e,$0c,$0f 4608 dc69 4609 dc69 12 0c 0f .byte.b $12,$0c,$0f 4610 dc6c 4611 dc6c 03 06 0d .byte.b $03,$06,$0d 4612 dc6f 4613 dc6f 1e 0c 0a .byte.b $1e,$0c,$0a 4614 dc72 4615 dc72 1e 0c 0c .byte.b $1e,$0c,$0c 4616 dc75 4617 dc75 0a 06 04 .byte.b $0a,$06,$04 4618 dc78 4619 dc78 00 00 00 .byte.b $00,$00,$00 4620 dc7b 4621 dc7b .skipL0265 4622 dc7b 00 4b sfx_plainlaser_lo = #sfx_plainlaser 4624 dc7b . 4625 dc7b ;; 4626 dc7b 4627 dc7b .L0266 ;; data sfx_explosion 4628 dc7b 4629 dc7b 4c 0e dd JMP .skipL0266 4630 dc7e sfx_explosion 4631 dc7e 10 10 00 .byte.b $10,$10,$00 4632 dc81 4633 dc81 01 08 02 .byte.b $01,$08,$02 4634 dc84 4635 dc84 0b 0c 05 .byte.b $0b,$0c,$05 4636 dc87 4637 dc87 04 06 08 .byte.b $04,$06,$08 4638 dc8a 4639 dc8a 03 0e 0f .byte.b $03,$0e,$0f 4640 dc8d 4641 dc8d 09 06 0f .byte.b $09,$06,$0f 4642 dc90 4643 dc90 0d 06 0f .byte.b $0d,$06,$0f 4644 dc93 4645 dc93 04 0e 0f .byte.b $04,$0e,$0f 4646 dc96 4647 dc96 0f 06 08 .byte.b $0f,$06,$08 4648 dc99 4649 dc99 09 06 04 .byte.b $09,$06,$04 4650 dc9c 4651 dc9c 16 01 03 .byte.b $16,$01,$03 4652 dc9f 4653 dc9f 0c 06 04 .byte.b $0c,$06,$04 4654 dca2 4655 dca2 09 06 05 .byte.b $09,$06,$05 4656 dca5 4657 dca5 0a 06 03 .byte.b $0a,$06,$03 4658 dca8 4659 dca8 09 06 05 .byte.b $09,$06,$05 4660 dcab 4661 dcab 0d 06 08 .byte.b $0d,$06,$08 4662 dcae 4663 dcae 09 06 04 .byte.b $09,$06,$04 4664 dcb1 4665 dcb1 04 0e 06 .byte.b $04,$0e,$06 4666 dcb4 4667 dcb4 0f 06 05 .byte.b $0f,$06,$05 4668 dcb7 4669 dcb7 0f 06 07 .byte.b $0f,$06,$07 4670 dcba 4671 dcba 04 0e 07 .byte.b $04,$0e,$07 4672 dcbd 4673 dcbd 08 06 06 .byte.b $08,$06,$06 4674 dcc0 4675 dcc0 03 0e 08 .byte.b $03,$0e,$08 4676 dcc3 4677 dcc3 0f 06 06 .byte.b $0f,$06,$06 4678 dcc6 4679 dcc6 09 06 05 .byte.b $09,$06,$05 4680 dcc9 4681 dcc9 06 06 05 .byte.b $06,$06,$05 4682 dccc 4683 dccc 03 0e 05 .byte.b $03,$0e,$05 4684 dccf 4685 dccf 0e 06 06 .byte.b $0e,$06,$06 4686 dcd2 4687 dcd2 02 0e 05 .byte.b $02,$0e,$05 4688 dcd5 4689 dcd5 0f 06 03 .byte.b $0f,$06,$03 4690 dcd8 4691 dcd8 0e 06 06 .byte.b $0e,$06,$06 4692 dcdb 4693 dcdb 09 06 05 .byte.b $09,$06,$05 4694 dcde 4695 dcde 0c 06 05 .byte.b $0c,$06,$05 4696 dce1 4697 dce1 0f 06 03 .byte.b $0f,$06,$03 4698 dce4 4699 dce4 04 0e 08 .byte.b $04,$0e,$08 4700 dce7 4701 dce7 0c 06 03 .byte.b $0c,$06,$03 4702 dcea 4703 dcea 0f 06 03 .byte.b $0f,$06,$03 4704 dced 4705 dced 0c 06 06 .byte.b $0c,$06,$06 4706 dcf0 4707 dcf0 0f 06 04 .byte.b $0f,$06,$04 4708 dcf3 4709 dcf3 0f 06 05 .byte.b $0f,$06,$05 4710 dcf6 4711 dcf6 0f 06 03 .byte.b $0f,$06,$03 4712 dcf9 4713 dcf9 0a 06 04 .byte.b $0a,$06,$04 4714 dcfc 4715 dcfc 0f 06 03 .byte.b $0f,$06,$03 4716 dcff 4717 dcff 08 06 03 .byte.b $08,$06,$03 4718 dd02 4719 dd02 0c 06 03 .byte.b $0c,$06,$03 4720 dd05 4721 dd05 0e 06 03 .byte.b $0e,$06,$03 4722 dd08 4723 dd08 08 06 03 .byte.b $08,$06,$03 4724 dd0b 4725 dd0b 00 00 00 .byte.b $00,$00,$00 4726 dd0e 4727 dd0e .skipL0266 4728 dd0e 00 7e sfx_explosion_lo = #sfx_explosion 4730 dd0e DMAHOLEEND2 SET . 754 bytes of ROM space left in DMA hole 2. 4731 dd0e echo " "," "," "," ",[(256*WZONEHEIGHT)-(DMAHOLEEND2 - DMAHOLESTART2)]d , "bytes of ROM space left in DMA hole 2." 4732 dd0e - if ((256*WZONEHEIGHT)-(DMAHOLEEND2 - DMAHOLESTART2)) < 0 4733 dd0e -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 4734 dd0e endif 4735 dd0e 4736 e000 ORG $E000,0 ; ************* 4737 e000 4738 e000 4739 e100 ORG $E100,0 ; ************* 4740 e100 4741 e100 4742 e200 ORG $E200,0 ; ************* 4743 e200 4744 e200 4745 e300 ORG $E300,0 ; ************* 4746 e300 4747 e300 4748 e400 ORG $E400,0 ; ************* 4749 e400 4750 e400 4751 e500 ORG $E500,0 ; ************* 4752 e500 4753 e500 4754 e600 ORG $E600,0 ; ************* 4755 e600 4756 e600 4757 e700 ORG $E700,0 ; ************* 4758 e700 4759 e700 - if SPACEOVERFLOW > 0 4760 e700 - echo "" 4761 e700 - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 4762 e700 - echo "######## look above for areas with negative ROM space left." 4763 e700 - echo "######## Aborting assembly." 4764 e700 - ERR 4765 e700 endif 4766 e700 4767 e700 4768 e700 ; Provided under the CC0 license. See the included LICENSE.txt for details. 4769 e700 4770 e700 ifnconst bankswitchmode 4771 e700 if ( * < $f000 ) 4772 f000 ORG $F000 4773 f000 endif 4774 f000 - else 4775 f000 - ifconst ROM128K 4776 f000 - if ( * < $f000 ) 4777 f000 - ORG $27000 4778 f000 - RORG $F000 4779 f000 - endif 4780 f000 - endif 4781 f000 - ifconst ROM144K 4782 f000 - if ( * < $f000 ) 4783 f000 - ORG $27000 4784 f000 - RORG $F000 4785 f000 - endif 4786 f000 - endif 4787 f000 - ifconst ROM256K 4788 f000 - if ( * < $f000 ) 4789 f000 - ORG $47000 4790 f000 - RORG $F000 4791 f000 - endif 4792 f000 - endif 4793 f000 - ifconst ROM272K 4794 f000 - if ( * < $f000 ) 4795 f000 - ORG $47000 4796 f000 - RORG $F000 4797 f000 - endif 4798 f000 - endif 4799 f000 - ifconst ROM512K 4800 f000 - if ( * < $f000 ) 4801 f000 - ORG $87000 4802 f000 - RORG $F000 4803 f000 - endif 4804 f000 - endif 4805 f000 - ifconst ROM528K 4806 f000 - if ( * < $f000 ) 4807 f000 - ORG $87000 4808 f000 - RORG $F000 4809 f000 - endif 4810 f000 - endif 4811 f000 endif 4812 f000 4813 f000 ; all of these "modules" have conditional clauses in them, so even though 4814 f000 ; they're always included here, they don't take up rom unless the user 4815 f000 ; explicitly enables support for the feature. 4816 f000 4817 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_continue.78b.asm 4819 f000 endif 4820 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_continue.78b.asm 4822 f000 endif 4823 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_continue.78b.asm 4825 f000 endif 4826 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_continue.78b.asm 4828 f000 endif 4829 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 4830 f000 4831 f000 ;standard routimes needed for pretty much all games 4832 f000 4833 f000 ; some definitions used with "set debug color" 4834 f000 00 91 DEBUGCALC = $91 4835 f000 00 41 DEBUGWASTE = $41 4836 f000 00 c1 DEBUGDRAW = $C1 4837 f000 4838 f000 ;NMI and IRQ handlers 4839 f000 NMI 4840 f000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 4841 f000 48 pha ; save A 4842 f001 a5 4d lda visibleover 4843 f003 49 ff eor #255 4844 f005 85 4d sta visibleover 4845 f007 - ifconst DEBUGINTERRUPT 4846 f007 - and #$93 4847 f007 - sta BACKGRND 4848 f007 endif 4849 f007 ce b2 01 dec interruptindex 4850 f00a d0 03 bne skipreallyoffvisible 4851 f00c 4c 73 f0 jmp reallyoffvisible 4852 f00f skipreallyoffvisible 4853 f00f a5 4d lda visibleover 4854 f011 d0 03 bne carryontopscreenroutine 4855 f013 - ifconst .bottomscreenroutine 4856 f013 - jsr .bottomscreenroutine 4857 f013 endif 4858 f013 4859 f013 4c 65 f0 jmp skiptopscreenroutine 4860 f016 carryontopscreenroutine 4861 f016 8a txa ; save X+Y 4862 f017 48 pha 4863 f018 98 tya 4864 f019 48 pha 4865 f01a d8 cld 4866 f01b - ifconst .topscreenroutine 4867 f01b - jsr .topscreenroutine 4868 f01b endif 4869 f01b ifnconst CANARYOFF 4870 f01b ad c1 01 lda canary 4871 f01e f0 0c beq skipcanarytriggered 4872 f020 a9 45 lda #$45 4873 f022 85 20 sta BACKGRND 4874 f024 a9 60 lda #$60 4875 f026 85 3c sta CTRL 4876 f028 8d 07 21 sta sCTRL 4877 f02b 02 .byte.b $02 ; KIL/JAM 4878 f02c endif 4879 f02c skipcanarytriggered 4880 f02c ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 4881 f02f 4882 f02f ; ** Other important routines that need to regularly run, and can run onscreen. 4883 f02f ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 4884 f02f 4885 f02f - ifconst LONGCONTROLLERREAD 4886 f02f -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 4887 f02f - ldy port1control 4888 f02f - lda longreadtype,y 4889 f02f - beq LLRET1 4890 f02f - tay 4891 f02f - lda longreadroutinehiP1,y 4892 f02f - sta inttemp4 4893 f02f - lda longreadroutineloP1,y 4894 f02f - sta inttemp3 4895 f02f - jmp (inttemp3) 4896 f02f -LLRET1 4897 f02f - ldy port0control 4898 f02f - lda longreadtype,y 4899 f02f - beq LLRET0 4900 f02f - tay 4901 f02f - lda longreadroutinehiP0,y 4902 f02f - sta inttemp4 4903 f02f - lda longreadroutineloP0,y 4904 f02f - sta inttemp3 4905 f02f - jmp (inttemp3) 4906 f02f -LLRET0 4907 f02f - 4908 f02f - 4909 f02f - ifconst PADDLERANGE 4910 f02f -TIMEVAL = PADDLERANGE 4911 f02f - else 4912 f02f -TIMEVAL = 160 4913 f02f - endif 4914 f02f -TIMEOFFSET = 10 4915 f02f - 4916 f02f endif ; LONGCONTROLLERREAD 4917 f02f 4918 f02f 4919 f02f 20 e5 f1 jsr servicesfxchannels 4920 f032 - ifconst MUSICTRACKER 4921 f032 - jsr servicesong 4922 f032 endif ; MUSICTRACKER 4923 f032 4924 f032 ee a4 01 inc framecounter 4925 f035 ad a4 01 lda framecounter 4926 f038 29 3f and #63 4927 f03a d0 08 bne skipcountdownseconds 4928 f03c ad a5 01 lda countdownseconds 4929 f03f f0 03 beq skipcountdownseconds 4930 f041 ce a5 01 dec countdownseconds 4931 f044 skipcountdownseconds 4932 f044 4933 f044 a2 01 ldx #1 4934 f046 buttonreadloop 4935 f046 8a txa 4936 f047 48 pha 4937 f048 bc b7 01 ldy port0control,x 4938 f04b b9 c8 f1 lda buttonhandlerlo,y 4939 f04e 85 da sta inttemp3 4940 f050 b9 bd f1 lda buttonhandlerhi,y 4941 f053 85 db sta inttemp4 4942 f055 05 da ora inttemp3 4943 f057 f0 03 beq buttonreadloopreturn 4944 f059 6c da 00 jmp (inttemp3) 4945 f05c buttonreadloopreturn 4946 f05c 68 pla 4947 f05d aa tax 4948 f05e ca dex 4949 f05f 10 e5 bpl buttonreadloop 4950 f061 4951 f061 - ifconst KEYPADSUPPORT 4952 f061 - jsr keypadrowselect 4953 f061 endif ; KEYPADSUPPORT 4954 f061 4955 f061 4956 f061 - ifconst DOUBLEBUFFER 4957 f061 - lda doublebufferminimumframeindex 4958 f061 - beq skipdoublebufferminimumframeindexadjust 4959 f061 - dec doublebufferminimumframeindex 4960 f061 -skipdoublebufferminimumframeindexadjust 4961 f061 endif 4962 f061 4963 f061 68 pla 4964 f062 a8 tay 4965 f063 68 pla 4966 f064 aa tax 4967 f065 skiptopscreenroutine 4968 f065 68 pla 4969 f066 40 RTI 4970 f067 4971 f067 IRQ ; the only source of non-nmi is the BRK opcode. The only 4972 f067 ifnconst BREAKPROTECTOFF 4973 f067 a9 1a lda #$1A 4974 f069 85 20 sta BACKGRND 4975 f06b a9 60 lda #$60 4976 f06d 85 3c sta CTRL 4977 f06f 8d 07 21 sta sCTRL 4978 f072 02 .byte.b $02 ; KIL/JAM 4979 f073 - else 4980 f073 - RTI 4981 f073 endif 4982 f073 4983 f073 - ifconst LONGCONTROLLERREAD 4984 f073 - 4985 f073 -longreadtype 4986 f073 - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 4987 f073 - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 4988 f073 - .byte 3, 3, 0 ; STMOUSE AMOUSE ATARIVOX 4989 f073 - 4990 f073 -longreadroutineloP0 4991 f073 - .byte LLRET0 ; 0 = no routine 4998 f073 - .byte >paddleport0update ; 1 = paddle 4999 f073 - .byte >trakball0update ; 2 = trackball 5000 f073 - .byte >mouse0update ; 3 = mouse 5001 f073 - 5002 f073 -longreadroutineloP1 5003 f073 - .byte LLRET1 ; 0 = no routine 5010 f073 - .byte >paddleport1update ; 1 = paddle 5011 f073 - .byte >trakball1update ; 2 = trackball 5012 f073 - .byte >mouse1update ; 3 = mouse 5013 f073 - 5014 f073 - 5015 f073 -SETTIM64T 5016 f073 - bne skipdefaulttime 5017 f073 - ifnconst PADDLESMOOTHINGOFF 5018 f073 - lda #(TIMEVAL+TIMEOFFSET+1) 5019 f073 - else 5020 f073 - lda #(TIMEVAL+TIMEOFFSET) 5021 f073 - endif 5022 f073 -skipdefaulttime 5023 f073 - tay 5024 f073 - dey 5025 f073 -.setTIM64Tloop 5026 f073 - sta TIM64T 5027 f073 - cpy INTIM 5028 f073 - bne .setTIM64Tloop 5029 f073 - rts 5030 f073 endif ; LONGCONTROLLERREAD 5031 f073 5032 f073 reallyoffvisible 5033 f073 85 24 sta WSYNC 5034 f075 5035 f075 a9 00 lda #0 5036 f077 85 4d sta visibleover 5037 f079 - ifconst DEBUGINTERRUPT 5038 f079 - sta BACKGRND 5039 f079 endif 5040 f079 5041 f079 a9 03 lda #3 5042 f07b 8d b2 01 sta interruptindex 5043 f07e 5044 f07e 8a txa 5045 f07f 48 pha 5046 f080 98 tya 5047 f081 48 pha 5048 f082 d8 cld 5049 f083 5050 f083 5051 f083 20 5f f1 jsr uninterruptableroutines 5052 f086 5053 f086 - ifconst .userinterrupt 5054 f086 - jsr .userinterrupt 5055 f086 endif 5056 f086 5057 f086 - ifconst KEYPADSUPPORT 5058 f086 - jsr keypadcolumnread 5059 f086 endif 5060 f086 5061 f086 68 pla 5062 f087 a8 tay 5063 f088 68 pla 5064 f089 aa tax 5065 f08a 68 pla 5066 f08b 40 RTI 5067 f08c 5068 f08c clearscreen 5069 f08c a2 17 ldx #(WZONECOUNT-1) 5070 f08e a9 00 lda #0 5071 f090 clearscreenloop 5072 f090 95 65 sta dlend,x 5073 f092 ca dex 5074 f093 10 fb bpl clearscreenloop 5075 f095 a9 00 lda #0 5076 f097 8d ad 01 sta valbufend ; clear the bcd value buffer 5077 f09a 8d ae 01 sta valbufendsave 5078 f09d 60 rts 5079 f09e 5080 f09e restorescreen 5081 f09e a2 17 ldx #(WZONECOUNT-1) 5082 f0a0 a9 00 lda #0 5083 f0a2 restorescreenloop 5084 f0a2 b5 82 lda dlendsave,x 5085 f0a4 95 65 sta dlend,x 5086 f0a6 ca dex 5087 f0a7 10 f9 bpl restorescreenloop 5088 f0a9 ad ae 01 lda valbufendsave 5089 f0ac 8d ad 01 sta valbufend 5090 f0af 60 rts 5091 f0b0 5092 f0b0 savescreen 5093 f0b0 a2 17 ldx #(WZONECOUNT-1) 5094 f0b2 savescreenloop 5095 f0b2 b5 65 lda dlend,x 5096 f0b4 95 82 sta dlendsave,x 5097 f0b6 ca dex 5098 f0b7 10 f9 bpl savescreenloop 5099 f0b9 ad ad 01 lda valbufend 5100 f0bc 8d ae 01 sta valbufendsave 5101 f0bf - ifconst DOUBLEBUFFER 5102 f0bf - lda doublebufferstate 5103 f0bf - beq savescreenrts 5104 f0bf - lda #1 5105 f0bf - sta doublebufferbufferdirty 5106 f0bf -savescreenrts 5107 f0bf endif ; DOUBLEBUFFER 5108 f0bf 60 rts 5109 f0c0 5110 f0c0 drawscreen 5111 f0c0 5112 f0c0 a9 00 lda #0 5113 f0c2 85 42 sta temp1 ; not B&W if we're here... 5114 f0c4 5115 f0c4 drawscreenwait 5116 f0c4 a5 4d lda visibleover 5117 f0c6 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 5118 f0c8 5119 f0c8 ;restore some registers in case the game changed them mid-screen... 5120 f0c8 ad 07 21 lda sCTRL 5121 f0cb 05 42 ora temp1 5122 f0cd 85 3c sta CTRL 5123 f0cf ad 0b 21 lda sCHARBASE 5124 f0d2 85 34 sta CHARBASE 5125 f0d4 5126 f0d4 ;ensure all of the display list is terminated... 5127 f0d4 20 45 f1 jsr terminatedisplaylist 5128 f0d7 5129 f0d7 ifnconst pauseroutineoff 5130 f0d7 20 e2 f0 jsr pauseroutine 5131 f0da endif ; pauseroutineoff 5132 f0da 5133 f0da ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 5134 f0da ; delaying a full frame, but still allowing time for basic calculations. 5135 f0da visiblescreenstartedwait 5136 f0da a5 4d lda visibleover 5137 f0dc f0 fc beq visiblescreenstartedwait 5138 f0de visiblescreenstartedwaitdone 5139 f0de ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 5140 f0e1 60 rts 5141 f0e2 5142 f0e2 ifnconst pauseroutineoff 5143 f0e2 ; check to see if pause was pressed and released 5144 f0e2 pauseroutine 5145 f0e2 ad b3 01 lda pausedisable 5146 f0e5 d0 4e bne leavepauseroutine 5147 f0e7 a9 08 lda #8 5148 f0e9 2c 82 02 bit SWCHB 5149 f0ec f0 29 beq pausepressed 5150 f0ee 5151 f0ee ifnconst SOFTRESETASPAUSEOFF 5152 f0ee ifnconst MOUSESUPPORT 5153 f0ee ifnconst TRAKBALLSUPPORT 5154 f0ee ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 5155 f0f1 29 70 and #%01110000 ; _LDU 5156 f0f3 f0 22 beq pausepressed 5157 f0f5 endif 5158 f0f5 endif 5159 f0f5 endif 5160 f0f5 5161 f0f5 ;pause isn't pressed 5162 f0f5 a9 00 lda #0 5163 f0f7 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 5164 f0fa 5165 f0fa ;check if we're in an already paused state 5166 f0fa ad 00 21 lda pausestate 5167 f0fd f0 36 beq leavepauseroutine ; nope, leave 5168 f0ff 5169 f0ff c9 01 cmp #1 ; last frame was the start of pausing 5170 f101 f0 2b beq enterpausestate2 ; move from state 1 to 2 5171 f103 5172 f103 c9 02 cmp #2 5173 f105 f0 34 beq carryonpausing 5174 f107 5175 f107 ;pausestate must be >2, which means we're ending an unpause 5176 f107 a9 00 lda #0 5177 f109 8d ac 01 sta pausebuttonflag 5178 f10c 8d 00 21 sta pausestate 5179 f10f ad 07 21 lda sCTRL 5180 f112 85 3c sta CTRL 5181 f114 4c 35 f1 jmp leavepauseroutine 5182 f117 5183 f117 pausepressed 5184 f117 ;pause is pressed 5185 f117 ad ac 01 lda pausebuttonflag 5186 f11a c9 ff cmp #$ff 5187 f11c f0 1d beq carryonpausing 5188 f11e 5189 f11e ;its a new press, increment the state 5190 f11e ee 00 21 inc pausestate 5191 f121 5192 f121 ;silence volume at the start and end of pausing 5193 f121 a9 00 lda #0 5194 f123 85 19 sta AUDV0 5195 f125 85 1a sta AUDV1 5196 f127 5197 f127 - ifconst pokeysupport 5198 f127 - ldy #7 5199 f127 -pausesilencepokeyaudioloop 5200 f127 - sta (pokeybase),y 5201 f127 - dey 5202 f127 - bpl pausesilencepokeyaudioloop 5203 f127 endif ; pokeysupport 5204 f127 5205 f127 a9 ff lda #$ff 5206 f129 8d ac 01 sta pausebuttonflag 5207 f12c d0 0d bne carryonpausing 5208 f12e 5209 f12e enterpausestate2 5210 f12e a9 02 lda #2 5211 f130 8d 00 21 sta pausestate 5212 f133 d0 06 bne carryonpausing 5213 f135 leavepauseroutine 5214 f135 ad 07 21 lda sCTRL 5215 f138 85 3c sta CTRL 5216 f13a 60 rts 5217 f13b carryonpausing 5218 f13b - ifconst .pause 5219 f13b - jsr .pause 5220 f13b endif ; .pause 5221 f13b ad 07 21 lda sCTRL 5222 f13e 09 80 ora #%10000000 ; turn off colorburst during pause... 5223 f140 85 3c sta CTRL 5224 f142 4c e2 f0 jmp pauseroutine 5225 f145 endif ; pauseroutineoff 5226 f145 5227 f145 5228 f145 - ifconst DOUBLEBUFFER 5229 f145 -skipterminatedisplaylistreturn 5230 f145 - rts 5231 f145 endif ; DOUBLEBUFFER 5232 f145 terminatedisplaylist 5233 f145 - ifconst DOUBLEBUFFER 5234 f145 - lda doublebufferstate 5235 f145 - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 5236 f145 endif ; DOUBLEBUFFER 5237 f145 terminatedisplaybuffer 5238 f145 ;add DL end entry on each DL 5239 f145 a2 17 ldx #(WZONECOUNT-1) 5240 f147 dlendloop 5241 f147 bd 48 f6 lda DLPOINTL,x 5242 f14a - ifconst DOUBLEBUFFER 5243 f14a - clc 5244 f14a - adc doublebufferdloffset 5245 f14a endif ; DOUBLEBUFFER 5246 f14a 85 63 sta dlpnt 5247 f14c bd 30 f6 lda DLPOINTH,x 5248 f14f - ifconst DOUBLEBUFFER 5249 f14f - adc #0 5250 f14f endif ; DOUBLEBUFFER 5251 f14f 85 64 sta dlpnt+1 5252 f151 b4 65 ldy dlend,x 5253 f153 a9 00 lda #$00 5254 f155 dlendmoreloops 5255 f155 c8 iny 5256 f156 91 63 sta (dlpnt),y 5257 f158 - ifconst FRAMESKIPGLITCHFIXWEAK 5258 f158 - cpy #DLLASTOBJ+1 5259 f158 - beq dlendthiszonedone 5260 f158 - iny 5261 f158 - iny 5262 f158 - iny 5263 f158 - iny 5264 f158 - iny 5265 f158 - sta (dlpnt),y 5266 f158 -dlendthiszonedone 5267 f158 endif FRAMESKIPGLITCHFIXWEAK 5268 f158 - ifconst FRAMESKIPGLITCHFIX 5269 f158 - iny 5270 f158 - iny 5271 f158 - iny 5272 f158 - iny 5273 f158 - cpy #DLLASTOBJ-1 5274 f158 - bcc dlendmoreloops 5275 f158 endif ; FRAMESKIPGLITCHFIX 5276 f158 ca dex 5277 f159 10 ec bpl dlendloop 5278 f15b 5279 f15b ifnconst pauseroutineoff 5280 f15b 20 e2 f0 jsr pauseroutine 5281 f15e endif ; pauseroutineoff 5282 f15e 60 rts 5283 f15f 5284 f15f uninterruptableroutines 5285 f15f ; this is for routines that must happen off the visible screen, each frame. 5286 f15f 5287 f15f - ifconst AVOXVOICE 5288 f15f - jsr serviceatarivoxqueue 5289 f15f endif 5290 f15f 5291 f15f a9 00 lda #0 5292 f161 8d b6 01 sta palfastframe 5293 f164 ad 09 21 lda paldetected 5294 f167 f0 10 beq skippalframeadjusting 5295 f169 ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 5296 f169 ae b5 01 ldx palframes 5297 f16c e8 inx 5298 f16d e0 05 cpx #5 5299 f16f d0 05 bne palframeskipdone 5300 f171 ee b6 01 inc palfastframe 5301 f174 a2 00 ldx #0 5302 f176 palframeskipdone 5303 f176 8e b5 01 stx palframes 5304 f179 skippalframeadjusting 5305 f179 5306 f179 - ifconst MUSICTRACKER 5307 f179 - ; We normally run the servicesong routine from the top-screen interrupt, but if it 5308 f179 - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 5309 f179 - ; If that happens, we try again here. Chances are very small we'll run into the same 5310 f179 - ; problem twice, and if we do, we just drop a musical note or two. 5311 f179 - lda sfxschedulemissed 5312 f179 - beq servicesongwasnotmissed 5313 f179 - jsr servicesong 5314 f179 -servicesongwasnotmissed 5315 f179 endif ; MUSICTRACKER 5316 f179 5317 f179 60 rts 5318 f17a 5319 f17a serviceatarivoxqueue 5320 f17a - ifconst AVOXVOICE 5321 f17a - lda voxlock 5322 f17a - bne skipvoxprocessing ; the vox is in the middle of speech address update 5323 f17a -skipvoxqueuesizedec 5324 f17a - jmp processavoxvoice 5325 f17a -skipvoxprocessing 5326 f17a - rts 5327 f17a - 5328 f17a -processavoxvoice 5329 f17a - lda avoxenable 5330 f17a - bne avoxfixport 5331 f17a - SPKOUT tempavox 5332 f17a - rts 5333 f17a -avoxfixport 5334 f17a - lda #0 ; restore the port to all bits as inputs... 5335 f17a - sta CTLSWA 5336 f17a - rts 5337 f17a -silenceavoxvoice 5338 f17a - SPEAK avoxsilentdata 5339 f17a - rts 5340 f17a -avoxsilentdata 5341 f17a - .byte 31,255 5342 f17a else 5343 f17a 60 rts 5344 f17b endif ; AVOXVOICE 5345 f17b 5346 f17b joybuttonhandler 5347 f17b 8a txa 5348 f17c 0a asl 5349 f17d a8 tay 5350 f17e b9 08 00 lda INPT0,y 5351 f181 4a lsr 5352 f182 9d 02 21 sta sINPT1,x 5353 f185 b9 09 00 lda INPT1,y 5354 f188 29 80 and #%10000000 5355 f18a 1d 02 21 ora sINPT1,x 5356 f18d 9d 02 21 sta sINPT1,x 5357 f190 5358 f190 b5 0c lda INPT4,x 5359 f192 30 19 bmi .skip1bjoyfirecheck 5360 f194 ;one button joystick is down 5361 f194 49 80 eor #%10000000 5362 f196 9d 02 21 sta sINPT1,x 5363 f199 5364 f199 ad b1 01 lda joybuttonmode 5365 f19c 3d b0 f1 and twobuttonmask,x 5366 f19f f0 0c beq .skip1bjoyfirecheck 5367 f1a1 ad b1 01 lda joybuttonmode 5368 f1a4 1d b0 f1 ora twobuttonmask,x 5369 f1a7 8d b1 01 sta joybuttonmode 5370 f1aa 8d 82 02 sta SWCHB 5371 f1ad .skip1bjoyfirecheck 5372 f1ad 4c 5c f0 jmp buttonreadloopreturn 5373 f1b0 5374 f1b0 twobuttonmask 5375 f1b0 04 10 .byte.b %00000100,%00010000 5376 f1b2 5377 f1b2 gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 5378 f1b2 - ifconst LIGHTGUNSUPPORT 5379 f1b2 - cpx #0 5380 f1b2 - bne secondportgunhandler 5381 f1b2 -firstportgunhandler 5382 f1b2 - lda SWCHA 5383 f1b2 - asl 5384 f1b2 - asl 5385 f1b2 - asl ; shift D4 to D7 5386 f1b2 - and #%10000000 5387 f1b2 - eor #%10000000 5388 f1b2 - sta sINPT1 5389 f1b2 - jmp buttonreadloopreturn 5390 f1b2 -secondportgunhandler 5391 f1b2 - lda SWCHA 5392 f1b2 - lsr ; shift D0 into carry 5393 f1b2 - lsr ; shift carry into D7 5394 f1b2 - and #%10000000 5395 f1b2 - eor #%10000000 5396 f1b2 - sta sINPT3 5397 f1b2 - jmp buttonreadloopreturn 5398 f1b2 endif ; LIGHTGUNSUPPORT 5399 f1b2 5400 f1b2 controlsusing2buttoncode 5401 f1b2 00 .byte.b 0 ; 00=no controller plugged in 5402 f1b3 01 .byte.b 1 ; 01=proline joystick 5403 f1b4 00 .byte.b 0 ; 02=lightgun 5404 f1b5 00 .byte.b 0 ; 03=paddle 5405 f1b6 01 .byte.b 1 ; 04=trakball 5406 f1b7 01 .byte.b 1 ; 05=vcs joystick 5407 f1b8 01 .byte.b 1 ; 06=driving control 5408 f1b9 00 .byte.b 0 ; 07=keypad control 5409 f1ba 00 .byte.b 0 ; 08=st mouse/cx80 5410 f1bb 00 .byte.b 0 ; 09=amiga mouse 5411 f1bc 01 .byte.b 1 ; 10=atarivox 5412 f1bd 5413 f1bd buttonhandlerhi 5414 f1bd 00 .byte.b 0 ; 00=no controller plugged in 5415 f1be f1 .byte.b >joybuttonhandler ; 01=proline joystick 5416 f1bf f1 .byte.b >gunbuttonhandler ; 02=lightgun 5417 f1c0 f5 .byte.b >paddlebuttonhandler ; 03=paddle 5418 f1c1 f1 .byte.b >joybuttonhandler ; 04=trakball 5419 f1c2 f1 .byte.b >joybuttonhandler ; 05=vcs joystick 5420 f1c3 f1 .byte.b >joybuttonhandler ; 06=driving control 5421 f1c4 00 .byte.b 0 ; 07=keypad 5422 f1c5 f5 .byte.b >mousebuttonhandler ; 08=st mouse 5423 f1c6 f5 .byte.b >mousebuttonhandler ; 09=amiga mouse 5424 f1c7 f1 .byte.b >joybuttonhandler ; 10=atarivox 5425 f1c8 buttonhandlerlo 5426 f1c8 00 .byte.b 0 ; 00=no controller plugged in 5427 f1c9 7b .byte.b $0F means the sound is looped while priority is active 5528 f226 5529 f226 05 d9 ora inttemp2 5530 f228 05 d8 ora inttemp1 ; check if F|C|V=0 5531 f22a f0 23 beq zerosfx ; if so, we're at the end of the sound. 5532 f22c 5533 f22c advancesfxpointer 5534 f22c ; advance the pointer to the next sound chunk 5535 f22c c8 iny 5536 f22d 84 da sty inttemp3 5537 f22f 18 clc 5538 f230 b5 4e lda sfx1pointlo,x 5539 f232 65 da adc inttemp3 5540 f234 95 4e sta sfx1pointlo,x 5541 f236 b5 50 lda sfx1pointhi,x 5542 f238 69 00 adc #0 5543 f23a 95 50 sta sfx1pointhi,x 5544 f23c 4c e7 f1 jmp servicesfxchannelsloop 5545 f23f 5546 f23f sfxsoundloop 5547 f23f 48 pha 5548 f240 b5 52 lda sfx1priority,x 5549 f242 d0 04 bne sfxsoundloop_carryon 5550 f244 68 pla ; fix the stack before we go 5551 f245 4c 2c f2 jmp advancesfxpointer 5552 f248 sfxsoundloop_carryon 5553 f248 68 pla 5554 f249 29 f0 and #$F0 5555 f24b 4a lsr 5556 f24c 4a lsr 5557 f24d 4a lsr 5558 f24e 4a lsr 5559 f24f 5560 f24f zerosfx 5561 f24f 95 4e sta sfx1pointlo,x 5562 f251 95 50 sta sfx1pointhi,x 5563 f253 95 52 sta sfx1priority,x 5564 f255 4c e7 f1 jmp servicesfxchannelsloop 5565 f258 5566 f258 5567 f258 schedulesfx 5568 f258 ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 5569 f258 a0 00 ldy #0 5570 f25a b1 e0 lda (sfxinstrumentlo),y 5571 f25c - ifconst pokeysupport 5572 f25c - cmp #$20 ; POKEY? 5573 f25c - bne scheduletiasfx 5574 f25c - jmp schedulepokeysfx 5575 f25c endif 5576 f25c scheduletiasfx 5577 f25c ;cmp #$10 ; TIA? 5578 f25c ;beq continuescheduletiasfx 5579 f25c ; rts ; unhandled!!! 5580 f25c continuescheduletiasfx 5581 f25c ifnconst TIASFXMONO 5582 f25c a5 4e lda sfx1pointlo 5583 f25e 05 50 ora sfx1pointhi 5584 f260 f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 5585 f262 a5 4f lda sfx2pointlo 5586 f264 05 51 ora sfx2pointhi 5587 f266 f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 5588 f268 ; Both channels are scheduled. 5589 f268 a0 01 ldy #1 5590 f26a b1 e0 lda (sfxinstrumentlo),y 5591 f26c d0 01 bne interruptsfx 5592 f26e 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 5593 f26f interruptsfx 5594 f26f ;Compare which active sound has a lower priority. We'll interrupt the lower one. 5595 f26f a5 52 lda sfx1priority 5596 f271 c5 53 cmp sfx2priority 5597 f273 b0 04 bcs schedulesfx2 5598 f275 endif ; !TIASFXMONO 5599 f275 5600 f275 schedulesfx1 5601 f275 a2 00 ldx #0 ; channel 1 5602 f277 ifnconst TIASFXMONO 5603 f277 f0 02 beq skipschedulesfx2 5604 f279 schedulesfx2 5605 f279 a2 01 ldx #1 ; channel 2 5606 f27b skipschedulesfx2 5607 f27b endif ; !TIASFXMONO 5608 f27b 5609 f27b - ifconst MUSICTRACKER 5610 f27b - lda sfxnoteindex 5611 f27b - bpl skipdrumkitoverride 5612 f27b - and #$7F ; subtract 128 5613 f27b - sec 5614 f27b - sbc #4 ; drums start at 132, i.e. octave 10 5615 f27b - asl 5616 f27b - tay 5617 f27b - lda tiadrumkitdefinition,y 5618 f27b - sta sfxinstrumentlo 5619 f27b - iny 5620 f27b - lda tiadrumkitdefinition,y 5621 f27b - sta sfxinstrumenthi 5622 f27b - lda #0 5623 f27b - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 5624 f27b -skipdrumkitoverride 5625 f27b endif ; MUSICTRACKER 5626 f27b a0 01 ldy #1 ; get priority and sound-resolution (in frames) 5627 f27d b1 e0 lda (sfxinstrumentlo),y 5628 f27f 95 52 sta sfx1priority,x 5629 f281 c8 iny 5630 f282 b1 e0 lda (sfxinstrumentlo),y 5631 f284 95 56 sta sfx1frames,x 5632 f286 a5 e0 lda sfxinstrumentlo 5633 f288 18 clc 5634 f289 69 03 adc #3 5635 f28b 95 4e sta sfx1pointlo,x 5636 f28d a5 e1 lda sfxinstrumenthi 5637 f28f 69 00 adc #0 5638 f291 95 50 sta sfx1pointhi,x 5639 f293 a5 e2 lda sfxpitchoffset 5640 f295 95 54 sta sfx1poffset,x 5641 f297 a9 00 lda #0 5642 f299 95 58 sta sfx1tick,x 5643 f29b a5 e3 lda sfxnoteindex 5644 f29d 95 cd sta sfx1notedata,x 5645 f29f 60 rts 5646 f2a0 5647 f2a0 plotsprite 5648 f2a0 ifnconst NODRAWWAIT 5649 f2a0 - ifconst DOUBLEBUFFER 5650 f2a0 - lda doublebufferstate 5651 f2a0 - bne skipplotspritewait 5652 f2a0 endif ; DOUBLEBUFFER 5653 f2a0 - ifconst DEBUGWAITCOLOR 5654 f2a0 - lda #$41 5655 f2a0 - sta BACKGRND 5656 f2a0 endif 5657 f2a0 plotspritewait 5658 f2a0 a5 4d lda visibleover 5659 f2a2 d0 fc bne plotspritewait 5660 f2a4 skipplotspritewait 5661 f2a4 - ifconst DEBUGWAITCOLOR 5662 f2a4 - lda #$0 5663 f2a4 - sta BACKGRND 5664 f2a4 endif 5665 f2a4 endif 5666 f2a4 5667 f2a4 ;arguments: 5668 f2a4 ; temp1=lo graphicdata 5669 f2a4 ; temp2=hi graphicdata 5670 f2a4 ; temp3=palette | width byte 5671 f2a4 ; temp4=x 5672 f2a4 ; temp5=y 5673 f2a4 ; temp6=mode 5674 f2a4 a5 46 lda temp5 ;Y position 5675 f2a6 4a lsr ; 2 - Divide by 8 or 16 5676 f2a7 4a lsr ; 2 5677 f2a8 4a lsr ; 2 5678 f2a9 - if WZONEHEIGHT = 16 5679 f2a9 - lsr ; 2 5680 f2a9 endif 5681 f2a9 5682 f2a9 aa tax 5683 f2aa 5684 f2aa ifnconst NOLIMITCHECKING 5685 f2aa 5686 f2aa ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 5687 f2aa 5688 f2aa c9 18 cmp #WZONECOUNT 5689 f2ac 5690 f2ac 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 5691 f2ae ; otherwise, check to see if the bottom half is in zone 0... 5692 f2ae 5693 f2ae - if WZONEHEIGHT = 16 5694 f2ae - cmp #15 5695 f2ae else 5696 f2ae c9 1f cmp #31 5697 f2b0 endif 5698 f2b0 5699 f2b0 d0 05 bne exitplotsprite1 5700 f2b2 a2 00 ldx #0 5701 f2b4 4c f1 f2 jmp continueplotsprite2 5702 f2b7 exitplotsprite1 5703 f2b7 60 rts 5704 f2b8 5705 f2b8 continueplotsprite1 5706 f2b8 endif 5707 f2b8 5708 f2b8 bd 48 f6 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 5709 f2bb - ifconst DOUBLEBUFFER 5710 f2bb - clc 5711 f2bb - adc doublebufferdloffset 5712 f2bb endif ; DOUBLEBUFFER 5713 f2bb 85 63 sta dlpnt 5714 f2bd bd 30 f6 lda DLPOINTH,x 5715 f2c0 - ifconst DOUBLEBUFFER 5716 f2c0 - adc #0 5717 f2c0 endif ; DOUBLEBUFFER 5718 f2c0 85 64 sta dlpnt+1 5719 f2c2 5720 f2c2 ;Create DL entry for upper part of sprite 5721 f2c2 5722 f2c2 b4 65 ldy dlend,x ;Get the index to the end of this DL 5723 f2c4 5724 f2c4 ifconst CHECKOVERWRITE 5725 f2c4 c0 4b cpy #DLLASTOBJ 5726 f2c6 f0 21 beq checkcontinueplotsprite2 5727 f2c8 continueplotsprite1a 5728 f2c8 endif 5729 f2c8 5730 f2c8 a5 42 lda temp1 ; graphic data, lo byte 5731 f2ca 91 63 sta (dlpnt),y ;Low byte of data address 5732 f2cc 5733 f2cc ifnconst ATOMICSPRITEUPDATE 5734 f2cc c8 iny 5735 f2cd a5 47 lda temp6 5736 f2cf 91 63 sta (dlpnt),y 5737 f2d1 - else 5738 f2d1 - iny 5739 f2d1 - sty temp8 5740 f2d1 endif 5741 f2d1 5742 f2d1 c8 iny 5743 f2d2 5744 f2d2 a5 46 lda temp5 ;Y position 5745 f2d4 29 07 and #(WZONEHEIGHT - 1) 5746 f2d6 c9 01 cmp #1 ; clear carry if our sprite is just in this zone 5747 f2d8 05 43 ora temp2 ; graphic data, hi byte 5748 f2da 91 63 sta (dlpnt),y 5749 f2dc 5750 f2dc 5751 f2dc c8 iny 5752 f2dd a5 44 lda temp3 ;palette|width 5753 f2df 91 63 sta (dlpnt),y 5754 f2e1 5755 f2e1 c8 iny 5756 f2e2 a5 45 lda temp4 ;Horizontal position 5757 f2e4 91 63 sta (dlpnt),y 5758 f2e6 5759 f2e6 c8 iny 5760 f2e7 94 65 sty dlend,x 5761 f2e9 5762 f2e9 - ifconst ALWAYSTERMINATE 5763 f2e9 - iny 5764 f2e9 - lda #0 5765 f2e9 - sta (dlpnt),y 5766 f2e9 endif 5767 f2e9 5768 f2e9 - ifconst ATOMICSPRITEUPDATE 5769 f2e9 - ldy temp8 5770 f2e9 - lda temp6 5771 f2e9 - sta (dlpnt),y 5772 f2e9 endif 5773 f2e9 5774 f2e9 checkcontinueplotsprite2 5775 f2e9 5776 f2e9 90 38 bcc doneSPDL ;branch if the sprite was fully in the last zone 5777 f2eb 5778 f2eb ;Create DL entry for lower part of sprite 5779 f2eb 5780 f2eb e8 inx ;Next region 5781 f2ec 5782 f2ec ifnconst NOLIMITCHECKING 5783 f2ec e0 18 cpx #WZONECOUNT 5784 f2ee 5785 f2ee 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 5786 f2f0 60 rts 5787 f2f1 continueplotsprite2 5788 f2f1 endif 5789 f2f1 5790 f2f1 bd 48 f6 lda DLPOINTL,x ;Get pointer to next DL 5791 f2f4 - ifconst DOUBLEBUFFER 5792 f2f4 - clc 5793 f2f4 - adc doublebufferdloffset 5794 f2f4 endif ; DOUBLEBUFFER 5795 f2f4 85 63 sta dlpnt 5796 f2f6 bd 30 f6 lda DLPOINTH,x 5797 f2f9 - ifconst DOUBLEBUFFER 5798 f2f9 - adc #0 5799 f2f9 endif ; DOUBLEBUFFER 5800 f2f9 85 64 sta dlpnt+1 5801 f2fb b4 65 ldy dlend,x ;Get the index to the end of this DL 5802 f2fd 5803 f2fd ifconst CHECKOVERWRITE 5804 f2fd c0 4b cpy #DLLASTOBJ 5805 f2ff d0 01 bne continueplotsprite2a 5806 f301 60 rts 5807 f302 continueplotsprite2a 5808 f302 endif 5809 f302 5810 f302 a5 42 lda temp1 ; graphic data, lo byte 5811 f304 91 63 sta (dlpnt),y 5812 f306 5813 f306 ifnconst ATOMICSPRITEUPDATE 5814 f306 c8 iny 5815 f307 a5 47 lda temp6 5816 f309 91 63 sta (dlpnt),y 5817 f30b - else 5818 f30b - iny 5819 f30b - sty temp8 5820 f30b endif 5821 f30b 5822 f30b c8 iny 5823 f30c 5824 f30c a5 46 lda temp5 ;Y position 5825 f30e 0b 07 anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 5826 f310 05 43 ora temp2 ; graphic data, hi byte 5827 f312 e9 07 sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 5828 f314 91 63 sta (dlpnt),y 5829 f316 5830 f316 c8 iny 5831 f317 5832 f317 a5 44 lda temp3 ;palette|width 5833 f319 91 63 sta (dlpnt),y 5834 f31b 5835 f31b c8 iny 5836 f31c 5837 f31c a5 45 lda temp4 ;Horizontal position 5838 f31e 91 63 sta (dlpnt),y 5839 f320 5840 f320 c8 iny 5841 f321 94 65 sty dlend,x 5842 f323 5843 f323 - ifconst ALWAYSTERMINATE 5844 f323 - iny 5845 f323 - lda #0 5846 f323 - sta (dlpnt),y 5847 f323 endif 5848 f323 5849 f323 - ifconst ATOMICSPRITEUPDATE 5850 f323 - ldy temp8 5851 f323 - lda temp6 5852 f323 - sta (dlpnt),y 5853 f323 endif 5854 f323 5855 f323 doneSPDL 5856 f323 60 rts 5857 f324 5858 f324 5859 f324 lockzonex 5860 f324 - ifconst ZONELOCKS 5861 f324 - ldy dlend,x 5862 f324 - cpy #DLLASTOBJ 5863 f324 - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 5864 f324 - lda DLPOINTL,x 5865 f324 - ifconst DOUBLEBUFFER 5866 f324 - clc 5867 f324 - adc doublebufferdloffset 5868 f324 - endif ; DOUBLEBUFFER 5869 f324 - sta dlpnt 5870 f324 - lda DLPOINTH,x 5871 f324 - ifconst DOUBLEBUFFER 5872 f324 - adc #0 5873 f324 - endif ; DOUBLEBUFFER 5874 f324 - sta dlpnt+1 5875 f324 - iny 5876 f324 - lda #0 5877 f324 - sta (dlpnt),y 5878 f324 - dey 5879 f324 - tya 5880 f324 - ldy #(DLLASTOBJ-1) 5881 f324 - sta (dlpnt),y 5882 f324 - iny 5883 f324 - sty dlend,x 5884 f324 -lockzonexreturn 5885 f324 - rts 5886 f324 endif ; ZONELOCKS 5887 f324 unlockzonex 5888 f324 - ifconst ZONELOCKS 5889 f324 - ldy dlend,x 5890 f324 - cpy #DLLASTOBJ 5891 f324 - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 5892 f324 - lda DLPOINTL,x 5893 f324 - ifconst DOUBLEBUFFER 5894 f324 - clc 5895 f324 - adc doublebufferdloffset 5896 f324 - endif ; DOUBLEBUFFER 5897 f324 - sta dlpnt 5898 f324 - lda DLPOINTH,x 5899 f324 - ifconst DOUBLEBUFFER 5900 f324 - adc #0 5901 f324 - endif ; DOUBLEBUFFER 5902 f324 - sta dlpnt+1 5903 f324 - dey 5904 f324 - ;ldy #(DLLASTOBJ-1) 5905 f324 - lda (dlpnt),y 5906 f324 - tay 5907 f324 - sty dlend,x 5908 f324 -unlockzonexreturn 5909 f324 endif ; ZONELOCKS 5910 f324 60 rts 5911 f325 5912 f325 plotcharloop 5913 f325 ; ** read from a data indirectly pointed to from temp8,temp9 5914 f325 ; ** format is: lo_data, hi_data, palette|width, x, y 5915 f325 ; ** format ends with lo_data | hi_data = 0 5916 f325 5917 f325 - ifconst DOUBLEBUFFER 5918 f325 - lda doublebufferstate 5919 f325 - bne skipplotcharloopwait 5920 f325 endif ; DOUBLEBUFFER 5921 f325 - ifconst DEBUGWAITCOLOR 5922 f325 - lda #$61 5923 f325 - sta BACKGRND 5924 f325 endif 5925 f325 plotcharloopwait 5926 f325 a5 4d lda visibleover 5927 f327 d0 fc bne plotcharloopwait 5928 f329 - ifconst DEBUGWAITCOLOR 5929 f329 - lda #0 5930 f329 - sta BACKGRND 5931 f329 endif 5932 f329 skipplotcharloopwait 5933 f329 plotcharlooploop 5934 f329 a0 00 ldy #0 5935 f32b b1 49 lda (temp8),y 5936 f32d 85 42 sta temp1 5937 f32f c8 iny 5938 f330 b1 49 lda (temp8),y 5939 f332 85 43 sta temp2 5940 f334 05 42 ora temp1 5941 f336 d0 01 bne plotcharloopcontinue 5942 f338 ;the pointer=0, so return 5943 f338 60 rts 5944 f339 plotcharloopcontinue 5945 f339 c8 iny 5946 f33a b1 49 lda (temp8),y 5947 f33c 85 44 sta temp3 5948 f33e c8 iny 5949 f33f b1 49 lda (temp8),y 5950 f341 85 45 sta temp4 5951 f343 c8 iny 5952 f344 b1 49 lda (temp8),y 5953 f346 ;sta temp5 ; not needed with our late entry. 5954 f346 20 5f f3 jsr plotcharactersskipentry 5955 f349 a5 49 lda temp8 5956 f34b 18 clc 5957 f34c 69 05 adc #5 5958 f34e 85 49 sta temp8 5959 f350 a5 4a lda temp9 5960 f352 69 00 adc #0 5961 f354 85 4a sta temp9 5962 f356 4c 29 f3 jmp plotcharlooploop 5963 f359 5964 f359 plotcharacters 5965 f359 - ifconst DOUBLEBUFFER 5966 f359 - lda doublebufferstate 5967 f359 - bne skipplotcharacterswait 5968 f359 endif ; DOUBLEBUFFER 5969 f359 - ifconst DEBUGWAITCOLOR 5970 f359 - lda #$41 5971 f359 - sta BACKGRND 5972 f359 endif 5973 f359 plotcharacterswait 5974 f359 a5 4d lda visibleover 5975 f35b d0 fc bne plotcharacterswait 5976 f35d - ifconst DEBUGWAITCOLOR 5977 f35d - sta BACKGRND 5978 f35d endif 5979 f35d skipplotcharacterswait 5980 f35d ;arguments: 5981 f35d ; temp1=lo charactermap 5982 f35d ; temp2=hi charactermap 5983 f35d ; temp3=palette | width byte 5984 f35d ; temp4=x 5985 f35d ; temp5=y 5986 f35d 5987 f35d a5 46 lda temp5 ;Y position 5988 f35f 5989 f35f plotcharactersskipentry 5990 f35f 5991 f35f ;ifconst ZONEHEIGHT 5992 f35f ; if ZONEHEIGHT = 16 5993 f35f ; and #$0F 5994 f35f ; endif 5995 f35f ; if ZONEHEIGHT = 8 5996 f35f ; and #$1F 5997 f35f ; endif 5998 f35f ;else 5999 f35f ; and #$0F 6000 f35f ;endif 6001 f35f 6002 f35f aa tax 6003 f360 bd 48 f6 lda DLPOINTL,x ;Get pointer to DL that the characters are in 6004 f363 - ifconst DOUBLEBUFFER 6005 f363 - clc 6006 f363 - adc doublebufferdloffset 6007 f363 endif ; DOUBLEBUFFER 6008 f363 85 63 sta dlpnt 6009 f365 bd 30 f6 lda DLPOINTH,x 6010 f368 - ifconst DOUBLEBUFFER 6011 f368 - adc #0 6012 f368 endif ; DOUBLEBUFFER 6013 f368 85 64 sta dlpnt+1 6014 f36a 6015 f36a ;Create DL entry for the characters 6016 f36a 6017 f36a b4 65 ldy dlend,x ;Get the index to the end of this DL 6018 f36c 6019 f36c ifconst CHECKOVERWRITE 6020 f36c c0 4b cpy #DLLASTOBJ 6021 f36e d0 01 bne continueplotcharacters 6022 f370 60 rts 6023 f371 continueplotcharacters 6024 f371 endif 6025 f371 6026 f371 a5 42 lda temp1 ; character map data, lo byte 6027 f373 91 63 sta (dlpnt),y ;(1) store low address 6028 f375 6029 f375 c8 iny 6030 f376 ad 06 21 lda charactermode 6031 f379 91 63 sta (dlpnt),y ;(2) store mode 6032 f37b 6033 f37b c8 iny 6034 f37c a5 43 lda temp2 ; character map, hi byte 6035 f37e 91 63 sta (dlpnt),y ;(3) store high address 6036 f380 6037 f380 c8 iny 6038 f381 a5 44 lda temp3 ;palette|width 6039 f383 91 63 sta (dlpnt),y ;(4) store palette|width 6040 f385 6041 f385 c8 iny 6042 f386 a5 45 lda temp4 ;Horizontal position 6043 f388 91 63 sta (dlpnt),y ;(5) store horizontal position 6044 f38a 6045 f38a c8 iny 6046 f38b 94 65 sty dlend,x ; save display list end byte 6047 f38d 60 rts 6048 f38e 6049 f38e 6050 f38e - ifconst plotvalueonscreen 6051 f38e -plotcharacterslive 6052 f38e - ; a version of plotcharacters that draws live and minimally disrupts the screen... 6053 f38e - 6054 f38e - ;arguments: 6055 f38e - ; temp1=lo charactermap 6056 f38e - ; temp2=hi charactermap 6057 f38e - ; temp3=palette | width byte 6058 f38e - ; temp4=x 6059 f38e - ; temp5=y 6060 f38e - 6061 f38e - lda temp5 ;Y position 6062 f38e - 6063 f38e - tax 6064 f38e - lda DLPOINTL,x ;Get pointer to DL that the characters are in 6065 f38e - ifconst DOUBLEBUFFER 6066 f38e - clc 6067 f38e - adc doublebufferdloffset 6068 f38e - endif ; DOUBLEBUFFER 6069 f38e - sta dlpnt 6070 f38e - lda DLPOINTH,x 6071 f38e - ifconst DOUBLEBUFFER 6072 f38e - adc #0 6073 f38e - endif ; DOUBLEBUFFER 6074 f38e - sta dlpnt+1 6075 f38e - 6076 f38e - ;Create DL entry for the characters 6077 f38e - 6078 f38e - ldy dlend,x ;Get the index to the end of this DL 6079 f38e - 6080 f38e - ifconst CHECKOVERWRITE 6081 f38e - cpy #DLLASTOBJ 6082 f38e - bne continueplotcharacterslive 6083 f38e - rts 6084 f38e -continueplotcharacterslive 6085 f38e - endif 6086 f38e - 6087 f38e - lda temp1 ; character map data, lo byte 6088 f38e - sta (dlpnt),y ;(1) store low address 6089 f38e - 6090 f38e - iny 6091 f38e - ; we don't add the second byte yet, since the charmap could briefly 6092 f38e - ; render without a proper character map address, width, or position. 6093 f38e - lda charactermode 6094 f38e - sta (dlpnt),y ;(2) store mode 6095 f38e - 6096 f38e - iny 6097 f38e - lda temp2 ; character map, hi byte 6098 f38e - sta (dlpnt),y ;(3) store high address 6099 f38e - 6100 f38e - iny 6101 f38e - lda temp3 ;palette|width 6102 f38e - sta (dlpnt),y ;(4) store palette|width 6103 f38e - 6104 f38e - iny 6105 f38e - lda temp4 ;Horizontal position 6106 f38e - sta (dlpnt),y ;(5) store horizontal position 6107 f38e - 6108 f38e - iny 6109 f38e - sty dlend,x ; save display list end byte 6110 f38e - 6111 f38e - rts 6112 f38e endif ;plotcharacterslive 6113 f38e 6114 f38e ifconst USED_PLOTVALUE 6115 f38e plotvalue 6116 f38e ; calling 7800basic command: 6117 f38e ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6118 f38e ; ...displays the variable as BCD digits 6119 f38e ; 6120 f38e ; asm sub arguments: 6121 f38e ; temp1=lo charactermap 6122 f38e ; temp2=hi charactermap 6123 f38e ; temp3=palette | width byte 6124 f38e ; temp4=x 6125 f38e ; temp5=y 6126 f38e ; temp6=number of digits 6127 f38e ; temp7=lo variable 6128 f38e ; temp8=hi variable 6129 f38e ; temp9=character mode 6130 f38e 6131 f38e 00 47 plotdigitcount = temp6 6132 f38e 6133 f38e - ifconst ZONELOCKS 6134 f38e - ldx temp5 6135 f38e - ldy dlend,x 6136 f38e - cpy #DLLASTOBJ 6137 f38e - bne carryonplotvalue 6138 f38e - rts 6139 f38e -carryonplotvalue 6140 f38e endif 6141 f38e 6142 f38e a9 00 lda #0 6143 f390 a8 tay 6144 f391 ae ad 01 ldx valbufend 6145 f394 6146 f394 a5 47 lda plotdigitcount 6147 f396 29 01 and #1 6148 f398 f0 07 beq pvnibble2char 6149 f39a a9 00 lda #0 6150 f39c 9d 00 20 sta VALBUFFER,x ; just in case we skip this digit 6151 f39f f0 11 beq pvnibble2char_skipnibble 6152 f3a1 6153 f3a1 pvnibble2char 6154 f3a1 ; high nibble... 6155 f3a1 b1 48 lda (temp7),y 6156 f3a3 29 f0 and #$f0 6157 f3a5 4a lsr 6158 f3a6 4a lsr 6159 f3a7 4a lsr 6160 f3a8 ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6161 f3a8 4a lsr 6162 f3a9 endif 6163 f3a9 6164 f3a9 18 clc 6165 f3aa 65 42 adc temp1 ; add the offset to character graphics to our value 6166 f3ac 9d 00 20 sta VALBUFFER,x 6167 f3af e8 inx 6168 f3b0 c6 47 dec plotdigitcount 6169 f3b2 6170 f3b2 pvnibble2char_skipnibble 6171 f3b2 ; low nibble... 6172 f3b2 b1 48 lda (temp7),y 6173 f3b4 29 0f and #$0f 6174 f3b6 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6175 f3b6 - asl 6176 f3b6 endif 6177 f3b6 18 clc 6178 f3b7 65 42 adc temp1 ; add the offset to character graphics to our value 6179 f3b9 9d 00 20 sta VALBUFFER,x 6180 f3bc e8 inx 6181 f3bd c8 iny 6182 f3be 6183 f3be c6 47 dec plotdigitcount 6184 f3c0 d0 df bne pvnibble2char 6185 f3c2 6186 f3c2 ;point to the start of our valuebuffer 6187 f3c2 18 clc 6188 f3c3 a9 00 lda #VALBUFFER 6192 f3cc 69 00 adc #0 6193 f3ce 85 43 sta temp2 6194 f3d0 6195 f3d0 ;advance valbufend to the end of our value buffer 6196 f3d0 8e ad 01 stx valbufend 6197 f3d3 6198 f3d3 ifnconst plotvalueonscreen 6199 f3d3 4c 59 f3 jmp plotcharacters 6200 f3d6 - else 6201 f3d6 - jmp plotcharacterslive 6202 f3d6 endif 6203 f3d6 6204 f3d6 endif ; USED_PLOTVALUE 6205 f3d6 6206 f3d6 6207 f3d6 - ifconst USED_PLOTVALUEEXTRA 6208 f3d6 -plotdigitcount = temp6 6209 f3d6 -plotvalueextra 6210 f3d6 - ; calling 7800basic command: 6211 f3d6 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6212 f3d6 - ; ...displays the variable as BCD digits 6213 f3d6 - ; 6214 f3d6 - ; asm sub arguments: 6215 f3d6 - ; temp1=lo charactermap 6216 f3d6 - ; temp2=hi charactermap 6217 f3d6 - ; temp3=palette | width byte 6218 f3d6 - ; temp4=x 6219 f3d6 - ; temp5=y 6220 f3d6 - ; temp6=number of digits 6221 f3d6 - ; temp7=lo variable 6222 f3d6 - ; temp8=hi variable 6223 f3d6 - 6224 f3d6 - lda #0 6225 f3d6 - tay 6226 f3d6 - ldx valbufend 6227 f3d6 - ifnconst plotvalueonscreen 6228 f3d6 - sta VALBUFFER,x 6229 f3d6 - endif 6230 f3d6 - 6231 f3d6 - lda plotdigitcount 6232 f3d6 - and #1 6233 f3d6 - 6234 f3d6 - bne pvnibble2char_skipnibbleextra 6235 f3d6 - 6236 f3d6 -pvnibble2charextra 6237 f3d6 - ; high nibble... 6238 f3d6 - lda (temp7),y 6239 f3d6 - and #$f0 6240 f3d6 - lsr 6241 f3d6 - lsr 6242 f3d6 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6243 f3d6 - lsr 6244 f3d6 - endif 6245 f3d6 - clc 6246 f3d6 - adc temp1 ; add the offset to character graphics to our value 6247 f3d6 - sta VALBUFFER,x 6248 f3d6 - inx 6249 f3d6 - 6250 f3d6 - ; second half of the digit 6251 f3d6 - clc 6252 f3d6 - adc #1 6253 f3d6 - sta VALBUFFER,x 6254 f3d6 - inx 6255 f3d6 - 6256 f3d6 -pvnibble2char_skipnibbleextra 6257 f3d6 - ; low nibble... 6258 f3d6 - lda (temp7),y 6259 f3d6 - and #$0f 6260 f3d6 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6261 f3d6 - asl 6262 f3d6 - endif 6263 f3d6 - asl 6264 f3d6 - 6265 f3d6 - clc 6266 f3d6 - adc temp1 ; add the offset to character graphics to our value 6267 f3d6 - sta VALBUFFER,x 6268 f3d6 - inx 6269 f3d6 - 6270 f3d6 - clc 6271 f3d6 - adc #1 6272 f3d6 - sta VALBUFFER,x 6273 f3d6 - inx 6274 f3d6 - iny 6275 f3d6 - 6276 f3d6 - dec plotdigitcount 6277 f3d6 - bne pvnibble2charextra 6278 f3d6 - 6279 f3d6 - ;point to the start of our valuebuffer 6280 f3d6 - clc 6281 f3d6 - lda #VALBUFFER 6285 f3d6 - adc #0 6286 f3d6 - sta temp2 6287 f3d6 - 6288 f3d6 - ;advance valbufend to the end of our value buffer 6289 f3d6 - stx valbufend 6290 f3d6 - 6291 f3d6 - ifnconst plotvalueonscreen 6292 f3d6 - jmp plotcharacters 6293 f3d6 - else 6294 f3d6 - jmp plotcharacterslive 6295 f3d6 - endif 6296 f3d6 endif ; USED_PLOTVALUEEXTRA 6297 f3d6 6298 f3d6 boxcollision 6299 f3d6 ; the worst case cycle-time for the code below is 43 cycles. 6300 f3d6 ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 6301 f3d6 6302 f3d6 ;__boxx1 = accumulator 6303 f3d6 ;__boxy1 = y 6304 f3d6 00 44 __boxw1 = temp3 6305 f3d6 00 45 __boxh1 = temp4 6306 f3d6 6307 f3d6 00 46 __boxx2 = temp5 6308 f3d6 00 47 __boxy2 = temp6 6309 f3d6 00 48 __boxw2 = temp7 6310 f3d6 00 49 __boxh2 = temp8 6311 f3d6 6312 f3d6 DoXCollisionCheck 6313 f3d6 ;lda __boxx1 ; skipped. already in the accumulator 6314 f3d6 c5 46 cmp __boxx2 ;3 6315 f3d8 b0 07 bcs X1isbiggerthanX2 ;2/3 6316 f3da X2isbiggerthanX1 6317 f3da ; carry is clear 6318 f3da 65 44 adc __boxw1 ;3 6319 f3dc c5 46 cmp __boxx2 ;3 6320 f3de b0 08 bcs DoYCollisionCheck ;3/2 6321 f3e0 60 rts ;6 - carry clear, no collision 6322 f3e1 X1isbiggerthanX2 6323 f3e1 18 clc ;2 6324 f3e2 e5 48 sbc __boxw2 ;3 6325 f3e4 c5 46 cmp __boxx2 ;3 6326 f3e6 b0 13 bcs noboxcollision ;3/2 6327 f3e8 DoYCollisionCheck 6328 f3e8 98 tya ; 2 ; use to be "lda __boxy1" 6329 f3e9 c5 47 cmp __boxy2 ;3 6330 f3eb b0 05 bcs Y1isbiggerthanY2 ;3/2 6331 f3ed Y2isbiggerthanY1 6332 f3ed ; carry is clear 6333 f3ed 65 45 adc __boxh1 ;3 6334 f3ef c5 47 cmp __boxy2 ;3 6335 f3f1 60 rts ;6 6336 f3f2 Y1isbiggerthanY2 6337 f3f2 18 clc ;2 6338 f3f3 e5 49 sbc __boxh2 ;3 6339 f3f5 c5 47 cmp __boxy2 ;3 6340 f3f7 b0 02 bcs noboxcollision ;3/2 6341 f3f9 yesboxcollision 6342 f3f9 38 sec ;2 6343 f3fa 60 rts ;6 6344 f3fb noboxcollision 6345 f3fb 18 clc ;2 6346 f3fc 60 rts ;6 6347 f3fd 6348 f3fd randomize 6349 f3fd a5 40 lda rand 6350 f3ff 4a lsr 6351 f400 26 41 rol rand16 6352 f402 90 02 bcc noeor 6353 f404 49 b4 eor #$B4 6354 f406 noeor 6355 f406 85 40 sta rand 6356 f408 45 41 eor rand16 6357 f40a 60 rts 6358 f40b 6359 f40b ; *** bcd conversion routine courtesy Omegamatrix 6360 f40b ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 6361 f40b converttobcd 6362 f40b ;value to convert is in the accumulator 6363 f40b 85 42 sta temp1 6364 f40d 4a lsr 6365 f40e 65 42 adc temp1 6366 f410 6a ror 6367 f411 4a lsr 6368 f412 4a lsr 6369 f413 65 42 adc temp1 6370 f415 6a ror 6371 f416 65 42 adc temp1 6372 f418 6a ror 6373 f419 4a lsr 6374 f41a 29 3c and #$3C 6375 f41c 85 43 sta temp2 6376 f41e 4a lsr 6377 f41f 65 43 adc temp2 6378 f421 65 42 adc temp1 6379 f423 60 rts ; return the result in the accumulator 6380 f424 6381 f424 ; Y and A contain multiplicands, result in A 6382 f424 mul8 6383 f424 84 42 sty temp1 6384 f426 85 43 sta temp2 6385 f428 a9 00 lda #0 6386 f42a reptmul8 6387 f42a 46 43 lsr temp2 6388 f42c 90 03 bcc skipmul8 6389 f42e 18 clc 6390 f42f 65 42 adc temp1 6391 f431 ;bcs donemul8 might save cycles? 6392 f431 skipmul8 6393 f431 ;beq donemul8 might save cycles? 6394 f431 06 42 asl temp1 6395 f433 d0 f5 bne reptmul8 6396 f435 donemul8 6397 f435 60 rts 6398 f436 6399 f436 div8 6400 f436 ; A=numerator Y=denominator, result in A 6401 f436 c0 02 cpy #2 6402 f438 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 6403 f43a 84 42 sty temp1 6404 f43c a0 ff ldy #$ff 6405 f43e div8loop 6406 f43e e5 42 sbc temp1 6407 f440 c8 iny 6408 f441 b0 fb bcs div8loop 6409 f443 div8end 6410 f443 98 tya 6411 f444 ; result in A 6412 f444 60 rts 6413 f445 6414 f445 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 6415 f445 mul16 6416 f445 84 42 sty temp1 6417 f447 85 43 sta temp2 6418 f449 6419 f449 a9 00 lda #0 6420 f44b a2 08 ldx #8 6421 f44d 46 42 lsr temp1 6422 f44f mul16_1 6423 f44f 90 03 bcc mul16_2 6424 f451 18 clc 6425 f452 65 43 adc temp2 6426 f454 mul16_2 6427 f454 6a ror 6428 f455 66 42 ror temp1 6429 f457 ca dex 6430 f458 d0 f5 bne mul16_1 6431 f45a 85 43 sta temp2 6432 f45c 60 rts 6433 f45d 6434 f45d ; div int/int 6435 f45d ; numerator in A, denom in temp1 6436 f45d ; returns with quotient in A, remainder in temp1 6437 f45d div16 6438 f45d 85 43 sta temp2 6439 f45f 84 42 sty temp1 6440 f461 a9 00 lda #0 6441 f463 a2 08 ldx #8 6442 f465 06 43 asl temp2 6443 f467 div16_1 6444 f467 2a rol 6445 f468 c5 42 cmp temp1 6446 f46a 90 02 bcc div16_2 6447 f46c e5 42 sbc temp1 6448 f46e div16_2 6449 f46e 26 43 rol temp2 6450 f470 ca dex 6451 f471 d0 f4 bne div16_1 6452 f473 85 42 sta temp1 6453 f475 a5 43 lda temp2 6454 f477 60 rts 6455 f478 6456 f478 - ifconst bankswitchmode 6457 f478 -BS_jsr 6458 f478 - ifconst MCPDEVCART 6459 f478 - ora #$18 6460 f478 - sta $3000 6461 f478 - else 6462 f478 - sta $8000 6463 f478 - endif 6464 f478 - pla 6465 f478 - tax 6466 f478 - pla 6467 f478 - rts 6468 f478 - 6469 f478 -BS_return 6470 f478 - pla ; bankswitch bank 6471 f478 - ifconst BANKRAM 6472 f478 - sta currentbank 6473 f478 - ora currentrambank 6474 f478 - endif 6475 f478 - ifconst MCPDEVCART 6476 f478 - ora #$18 6477 f478 - sta $3000 6478 f478 - else 6479 f478 - sta $8000 6480 f478 - endif 6481 f478 - pla ; bankswitch $0 flag 6482 f478 - rts 6483 f478 endif 6484 f478 6485 f478 checkselectswitch 6486 f478 ad 82 02 lda SWCHB ; first check the real select switch... 6487 f47b 29 02 and #%00000010 6488 f47d ifnconst MOUSESUPPORT 6489 f47d f0 05 beq checkselectswitchreturn ; switch is pressed 6490 f47f ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 6491 f482 29 b0 and #%10110000 ; R_DU 6492 f484 endif ; MOUSESUPPORT 6493 f484 checkselectswitchreturn 6494 f484 60 rts 6495 f485 6496 f485 checkresetswitch 6497 f485 ad 82 02 lda SWCHB ; first check the real reset switch... 6498 f488 29 01 and #%00000001 6499 f48a ifnconst MOUSESUPPORT 6500 f48a f0 05 beq checkresetswitchreturn ; switch is pressed 6501 f48c ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 6502 f48f 29 70 and #%01110000 ; _LDU 6503 f491 endif ; MOUSESUPPORT 6504 f491 checkresetswitchreturn 6505 f491 60 rts 6506 f492 6507 f492 - ifconst FINESCROLLENABLED 6508 f492 -finescrolldlls 6509 f492 - ldx temp1 ; first DLL index x3 6510 f492 - lda DLLMEM,x 6511 f492 - and #%11110000 6512 f492 - ora finescrolly 6513 f492 - sta DLLMEM,x 6514 f492 - 6515 f492 - ldx temp2 ; last DLL index x3 6516 f492 - lda DLLMEM,x 6517 f492 - and #%11110000 6518 f492 - ora finescrolly 6519 f492 - eor #(WZONEHEIGHT-1) 6520 f492 - sta DLLMEM,x 6521 f492 - rts 6522 f492 endif ; FINESCROLLENABLED 6523 f492 6524 f492 - ifconst USED_ADJUSTVISIBLE 6525 f492 -adjustvisible 6526 f492 - ; called with temp1=first visible zone *3, temp2=last visible zone *3 6527 f492 - jsr waitforvblankstart ; ensure vblank just started 6528 f492 - ldx visibleDLLstart 6529 f492 -findfirstinterrupt 6530 f492 - lda DLLMEM,x 6531 f492 - bmi foundfirstinterrupt 6532 f492 - inx 6533 f492 - inx 6534 f492 - inx 6535 f492 - bne findfirstinterrupt 6536 f492 -foundfirstinterrupt 6537 f492 - and #%01111111 ; clear the interrupt bit 6538 f492 - sta DLLMEM,x 6539 f492 - ifconst DOUBLEBUFFER 6540 f492 - sta DLLMEM+DBOFFSET,x 6541 f492 - endif ; DOUBLEBUFFER 6542 f492 - ldx overscanDLLstart 6543 f492 -findlastinterrupt 6544 f492 - lda DLLMEM,x 6545 f492 - bmi foundlastinterrupt 6546 f492 - dex 6547 f492 - dex 6548 f492 - dex 6549 f492 - bne findlastinterrupt 6550 f492 -foundlastinterrupt 6551 f492 - and #%01111111 ; clear the interrupt bit 6552 f492 - sta DLLMEM,x 6553 f492 - ifconst DOUBLEBUFFER 6554 f492 - sta DLLMEM+DBOFFSET,x 6555 f492 - endif ; DOUBLEBUFFER 6556 f492 - ;now we need to set the new interrupts 6557 f492 - clc 6558 f492 - lda temp1 6559 f492 - adc visibleDLLstart 6560 f492 - tax 6561 f492 - lda DLLMEM,x 6562 f492 - ora #%10000000 6563 f492 - sta DLLMEM,x 6564 f492 - ifconst DOUBLEBUFFER 6565 f492 - sta DLLMEM+DBOFFSET,x 6566 f492 - endif ; DOUBLEBUFFER 6567 f492 - clc 6568 f492 - lda temp2 6569 f492 - adc visibleDLLstart 6570 f492 - tax 6571 f492 - lda DLLMEM,x 6572 f492 - ora #%10000000 6573 f492 - sta DLLMEM,x 6574 f492 - ifconst DOUBLEBUFFER 6575 f492 - sta DLLMEM+DBOFFSET,x 6576 f492 - endif ; DOUBLEBUFFER 6577 f492 - jsr vblankresync 6578 f492 - rts 6579 f492 endif ; USED_ADJUSTVISIBLE 6580 f492 6581 f492 vblankresync 6582 f492 20 30 f5 jsr waitforvblankstart ; ensure vblank just started 6583 f495 a9 00 lda #0 6584 f497 85 4d sta visibleover 6585 f499 a9 03 lda #3 6586 f49b 8d b2 01 sta interruptindex 6587 f49e 60 rts 6588 f49f 6589 f49f createallgamedlls 6590 f49f a2 00 ldx #0 6591 f4a1 a9 19 lda #NVLINES 6592 f4a3 ac 09 21 ldy paldetected 6593 f4a6 f0 03 beq skipcreatePALpadding 6594 f4a8 18 clc 6595 f4a9 69 15 adc #21 6596 f4ab skipcreatePALpadding 6597 f4ab 20 e0 f4 jsr createnonvisibledlls 6598 f4ae 8e 3c 21 stx visibleDLLstart 6599 f4b1 20 11 f5 jsr createvisiblezones 6600 f4b4 8e 3d 21 stx overscanDLLstart 6601 f4b7 createallgamedllscontinue 6602 f4b7 a9 50 lda #(NVLINES+55) ; extras for PAL 6603 f4b9 20 e0 f4 jsr createnonvisibledlls 6604 f4bc 6605 f4bc ae 3c 21 ldx visibleDLLstart 6606 f4bf bd 00 18 lda DLLMEM,x 6607 f4c2 09 80 ora #%10000000 ; NMI 1 - start of visible screen 6608 f4c4 9d 00 18 sta DLLMEM,x 6609 f4c7 - ifconst DOUBLEBUFFER 6610 f4c7 - sta DLLMEM+DBOFFSET,x 6611 f4c7 endif ; DOUBLEBUFFER 6612 f4c7 6613 f4c7 ae 3d 21 ldx overscanDLLstart 6614 f4ca bd 00 18 lda DLLMEM,x 6615 f4cd 09 83 ora #%10000011 ; NMI 2 - end of visible screen 6616 f4cf 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 6617 f4d1 9d 00 18 sta DLLMEM,x 6618 f4d4 - ifconst DOUBLEBUFFER 6619 f4d4 - sta DLLMEM+DBOFFSET,x 6620 f4d4 endif ; DOUBLEBUFFER 6621 f4d4 6622 f4d4 e8 inx 6623 f4d5 e8 inx 6624 f4d6 e8 inx 6625 f4d7 6626 f4d7 bd 00 18 lda DLLMEM,x 6627 f4da 09 80 ora #%10000000 ; NMI 3 - deeper overscan 6628 f4dc 9d 00 18 sta DLLMEM,x 6629 f4df - ifconst DOUBLEBUFFER 6630 f4df - sta DLLMEM+DBOFFSET,x 6631 f4df endif ; DOUBLEBUFFER 6632 f4df 6633 f4df 60 rts 6634 f4e0 6635 f4e0 createnonvisibledlls 6636 f4e0 85 42 sta temp1 6637 f4e2 4a lsr 6638 f4e3 4a lsr 6639 f4e4 4a lsr 6640 f4e5 4a lsr ; /16 6641 f4e6 f0 09 beq skipcreatenonvisibledlls1loop 6642 f4e8 a8 tay 6643 f4e9 createnonvisibledlls1loop 6644 f4e9 a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 6645 f4eb 20 00 f5 jsr createblankdllentry 6646 f4ee 88 dey 6647 f4ef d0 f8 bne createnonvisibledlls1loop 6648 f4f1 skipcreatenonvisibledlls1loop 6649 f4f1 a5 42 lda temp1 6650 f4f3 29 0f and #%00001111 6651 f4f5 f0 08 beq createnonvisibledllsreturn 6652 f4f7 38 sec 6653 f4f8 e9 01 sbc #1 6654 f4fa 09 40 ora #%01000000 6655 f4fc 20 00 f5 jsr createblankdllentry 6656 f4ff createnonvisibledllsreturn 6657 f4ff 60 rts 6658 f500 6659 f500 createblankdllentry 6660 f500 9d 00 18 sta DLLMEM,x 6661 f503 - ifconst DOUBLEBUFFER 6662 f503 - sta DLLMEM+DBOFFSET,x 6663 f503 endif ; DOUBLEBUFFER 6664 f503 e8 inx 6665 f504 a9 21 lda #$21 ; blank 6666 f506 9d 00 18 sta DLLMEM,x 6667 f509 - ifconst DOUBLEBUFFER 6668 f509 - sta DLLMEM+DBOFFSET,x 6669 f509 endif ; DOUBLEBUFFER 6670 f509 e8 inx 6671 f50a a9 00 lda #$00 6672 f50c 9d 00 18 sta DLLMEM,x 6673 f50f - ifconst DOUBLEBUFFER 6674 f50f - sta DLLMEM+DBOFFSET,x 6675 f50f endif ; DOUBLEBUFFER 6676 f50f e8 inx 6677 f510 60 rts 6678 f511 6679 f511 createvisiblezones 6680 f511 a0 00 ldy #0 6681 f513 createvisiblezonesloop 6682 f513 b9 60 f6 lda.w DLHEIGHT,y 6683 f516 09 20 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 6684 f518 9d 00 18 sta DLLMEM,x 6685 f51b - ifconst DOUBLEBUFFER 6686 f51b - sta DLLMEM+DBOFFSET,x 6687 f51b endif ; DOUBLEBUFFER 6688 f51b e8 inx 6689 f51c b9 30 f6 lda DLPOINTH,y 6690 f51f 9d 00 18 sta DLLMEM,x 6691 f522 - ifconst DOUBLEBUFFER 6692 f522 - sta DLLMEM+DBOFFSET,x 6693 f522 endif ; DOUBLEBUFFER 6694 f522 e8 inx 6695 f523 b9 48 f6 lda DLPOINTL,y 6696 f526 9d 00 18 sta DLLMEM,x 6697 f529 - ifconst DOUBLEBUFFER 6698 f529 - clc 6699 f529 - adc #DOUBLEBUFFEROFFSET 6700 f529 - sta DLLMEM+DBOFFSET,x 6701 f529 - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 6702 f529 - inc DLLMEM+DBOFFSET-1,x 6703 f529 -skiphidoublebufferadjust 6704 f529 endif ; DOUBLEBUFFER 6705 f529 e8 inx 6706 f52a c8 iny 6707 f52b c0 18 cpy #WZONECOUNT 6708 f52d d0 e4 bne createvisiblezonesloop 6709 f52f 60 rts 6710 f530 6711 f530 waitforvblankstart 6712 f530 visibleoverwait 6713 f530 24 28 BIT MSTAT 6714 f532 10 fc bpl visibleoverwait 6715 f534 vblankstartwait 6716 f534 24 28 BIT MSTAT 6717 f536 30 fc bmi vblankstartwait 6718 f538 60 rts 6719 f539 6720 f539 - ifconst DOUBLEBUFFER 6721 f539 -flipdisplaybufferreturn 6722 f539 - rts 6723 f539 -flipdisplaybuffer 6724 f539 - lda doublebufferstate 6725 f539 - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 6726 f539 - 6727 f539 - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 6728 f539 - 6729 f539 - lda doublebufferstate 6730 f539 - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 6731 f539 - tax 6732 f539 - 6733 f539 - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 6734 f539 - 6735 f539 -flipdisplaybufferwait1 6736 f539 - lda visibleover 6737 f539 - beq flipdisplaybufferwait1 6738 f539 - 6739 f539 -flipdisplaybufferwait 6740 f539 - lda visibleover 6741 f539 - bne flipdisplaybufferwait 6742 f539 - 6743 f539 - lda doublebufferminimumframetarget 6744 f539 - beq skipminimumframecode 6745 f539 - lda doublebufferminimumframeindex 6746 f539 - bne flipdisplaybufferwait1 6747 f539 - lda doublebufferminimumframetarget 6748 f539 - sta doublebufferminimumframeindex 6749 f539 -skipminimumframecode 6750 f539 - 6751 f539 - lda DLLMEMLutHi,x 6752 f539 - sta DPPH 6753 f539 - lda DLLMEMLutLo,x 6754 f539 - sta DPPL 6755 f539 - 6756 f539 - lda NewPageflipstate,x 6757 f539 - sta doublebufferstate 6758 f539 - lda NewPageflipoffset,x 6759 f539 - sta doublebufferdloffset 6760 f539 - 6761 f539 - lda doublebufferbufferdirty 6762 f539 - beq flipdisplaybufferreturn 6763 f539 - 6764 f539 - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 6765 f539 - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 6766 f539 - ; from the displayed buffer to the working buffer... 6767 f539 - 6768 f539 - lda doublebufferdloffset 6769 f539 - eor #DOUBLEBUFFEROFFSET 6770 f539 - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 6771 f539 - 6772 f539 - ldx #(WZONECOUNT-1) 6773 f539 -copybufferzoneloop 6774 f539 - 6775 f539 - lda DLPOINTL,x 6776 f539 - clc 6777 f539 - adc doublebufferdloffset 6778 f539 - sta temp1 6779 f539 - lda DLPOINTH,x 6780 f539 - adc #0 6781 f539 - sta temp2 6782 f539 - 6783 f539 - lda DLPOINTL,x 6784 f539 - clc 6785 f539 - adc temp6 6786 f539 - sta temp3 6787 f539 - lda DLPOINTH,x 6788 f539 - adc #0 6789 f539 - sta temp4 6790 f539 - 6791 f539 - lda dlendsave,x 6792 f539 - tay 6793 f539 -copybuffercharsloop 6794 f539 - lda (temp3),y 6795 f539 - sta (temp1),y 6796 f539 - dey 6797 f539 - bpl copybuffercharsloop 6798 f539 - dex 6799 f539 - bpl copybufferzoneloop 6800 f539 - lda #0 6801 f539 - sta doublebufferbufferdirty 6802 f539 - rts 6803 f539 - 6804 f539 -doublebufferoff 6805 f539 - lda #1 6806 f539 - sta doublebufferstate 6807 f539 - jsr flipdisplaybuffer 6808 f539 - lda #0 6809 f539 - sta doublebufferstate 6810 f539 - sta doublebufferdloffset 6811 f539 - rts 6812 f539 - 6813 f539 -DLLMEMLutLo 6814 f539 - .byte DLLMEM,>(DLLMEM+DBOFFSET) 6817 f539 -NewPageflipstate 6818 f539 - .byte 3,1 6819 f539 -NewPageflipoffset 6820 f539 - .byte DOUBLEBUFFEROFFSET,0 6821 f539 - 6822 f539 endif ; DOUBLEBUFFER 6823 f539 6824 f539 - ifconst MOUSESUPPORT 6825 f539 - 6826 f539 -rotationalcompare 6827 f539 - ; old = 00 01 10 11 6828 f539 - .byte $00, $01, $ff, $00 ; new=00 6829 f539 - .byte $ff, $00, $00, $01 ; new=01 6830 f539 - .byte $01, $00, $00, $ff ; new=10 6831 f539 - .byte $00, $ff, $01, $00 ; new=11 6832 f539 - 6833 f539 - ; 0000YyXx st mouse 6834 f539 - 6835 f539 - ; 0000xyXY amiga mouse 6836 f539 - 6837 f539 - ifconst MOUSEXONLY 6838 f539 -amigatoataribits ; swap bits 1 and 4... 6839 f539 - .byte %0000, %0000, %0010, %0010 6840 f539 - .byte %0000, %0000, %0010, %0010 6841 f539 - .byte %0001, %0001, %0011, %0011 6842 f539 - .byte %0001, %0001, %0011, %0011 6843 f539 - 6844 f539 - ; null change bits 6845 f539 - .byte %0000, %0001, %0010, %0011 6846 f539 - .byte %0000, %0001, %0010, %0011 6847 f539 - .byte %0000, %0001, %0010, %0011 6848 f539 - .byte %0000, %0001, %0010, %0011 6849 f539 - 6850 f539 - else ; !MOUSEXONLY 6851 f539 - 6852 f539 -amigatoataribits ; swap bits 1 and 4... 6853 f539 - .byte %0000, %1000, %0010, %1010 6854 f539 - .byte %0100, %1100, %0110, %1110 6855 f539 - .byte %0001, %1001, %0011, %1011 6856 f539 - .byte %0101, %1101, %0111, %1111 6857 f539 - ; null change bits 6858 f539 - .byte %0000, %0001, %0010, %0011 6859 f539 - .byte %0100, %0101, %0110, %0111 6860 f539 - .byte %1000, %1001, %1010, %1011 6861 f539 - .byte %1100, %1101, %1110, %1111 6862 f539 - endif ; !MOUSEXONLY 6863 f539 - 6864 f539 endif ; MOUSESUPPORT 6865 f539 6866 f539 mouse0update 6867 f539 - ifconst MOUSE0SUPPORT 6868 f539 - 6869 f539 -mousetableselect = inttemp2 6870 f539 -mousexdelta = inttemp3 6871 f539 -mouseydelta = inttemp4 6872 f539 -lastSWCHA = inttemp6 6873 f539 - 6874 f539 - ; 0000YyXx st mouse 6875 f539 - ; 0000xyXY amiga mouse 6876 f539 - 6877 f539 - lda #$ff 6878 f539 - sta lastSWCHA 6879 f539 - 6880 f539 - ldy port0control 6881 f539 - 6882 f539 - lda #%00010000 6883 f539 - cpy #9 ; AMIGA? 6884 f539 - bne skipamigabitsfix0 6885 f539 - lda #0 6886 f539 -skipamigabitsfix0 6887 f539 - sta mousetableselect 6888 f539 - ifconst DRIVINGBOOST 6889 f539 - cpy #6 ; DRIVING? 6890 f539 - bne skipdriving0setup 6891 f539 - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 6892 f539 - ; trails the actual mousex0, so we can smoothly interpolate toward 6893 f539 - ; the actual position. This actual position is stored in mousey0 6894 f539 - ; after the driver has run. 6895 f539 - ldx mousex0 6896 f539 - lda mousey0 6897 f539 - stx mousey0 6898 f539 - sta mousex0 6899 f539 -skipdriving0setup 6900 f539 - endif ; DRIVINGBOOST 6901 f539 - 6902 f539 - lda #0 6903 f539 - sta mousexdelta 6904 f539 - sta mouseydelta 6905 f539 - 6906 f539 - ifnconst MOUSETIME 6907 f539 - ifnconst MOUSEXONLY 6908 f539 - lda #180 ; minimum for x+y 6909 f539 - else 6910 f539 - lda #100 ; minimum for just x 6911 f539 - endif 6912 f539 - else 6913 f539 - lda #MOUSETIME 6914 f539 - endif 6915 f539 - jsr SETTIM64T ; INTIM is in Y 6916 f539 - 6917 f539 -mouse0updateloop 6918 f539 - lda SWCHA 6919 f539 - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 6920 f539 - cmp lastSWCHA 6921 f539 - beq mouse0loopcondition 6922 f539 - sta lastSWCHA 6923 f539 - lsr 6924 f539 - lsr 6925 f539 - lsr 6926 f539 - 6927 f539 - ora mousetableselect ; atari/amiga decoding table selection 6928 f539 - 6929 f539 - ; st mice encode on different bits/joystick-lines than amiga mice... 6930 f539 - ; 0000YyXx st mouse 6931 f539 - ; 0000xyXY amiga mouse 6932 f539 - ; ...so can shuffle the amiga bits to reuse the st driver. 6933 f539 - tay 6934 f539 - lax amigatoataribits,y 6935 f539 - 6936 f539 - ifnconst MOUSEXONLY 6937 f539 - ; first the Y... 6938 f539 - and #%00001100 6939 f539 - ora mousecodey0 6940 f539 - tay 6941 f539 - lda rotationalcompare,y 6942 f539 - clc 6943 f539 - adc mouseydelta 6944 f539 - sta mouseydelta 6945 f539 - tya 6946 f539 - lsr 6947 f539 - lsr 6948 f539 - sta mousecodey0 6949 f539 - txa 6950 f539 - ; ...then the X... 6951 f539 - and #%00000011 6952 f539 - tax 6953 f539 - endif ; !MOUSEXONLY 6954 f539 - 6955 f539 - asl 6956 f539 - asl 6957 f539 - ora mousecodex0 6958 f539 - tay 6959 f539 - lda rotationalcompare,y 6960 f539 - adc mousexdelta ; carry was clear by previous ASL 6961 f539 - sta mousexdelta 6962 f539 - stx mousecodex0 6963 f539 -mouse0loopcondition 6964 f539 - lda TIMINT 6965 f539 - bpl mouse0updateloop 6966 f539 - 6967 f539 - ; *** adapt to selected device resolution. 6968 f539 - ldx port0control 6969 f539 - 6970 f539 - ifconst PRECISIONMOUSING 6971 f539 - ldy port0resolution 6972 f539 - bne mouse0halveddone 6973 f539 - cpx #6 ; half-resolution is no good for driving wheels 6974 f539 - beq mouse0halveddone 6975 f539 - ; resolution=0 is half mouse resolution, necessary for precision 6976 f539 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 6977 f539 - 6978 f539 - lda mousexdelta 6979 f539 - cmp #$80 6980 f539 - ror ; do a signed divide by 2. 6981 f539 - clc 6982 f539 - adc mousex0 6983 f539 - sta mousex0 6984 f539 - ifnconst MOUSEXONLY 6985 f539 - lda mouseydelta 6986 f539 - clc 6987 f539 - adc mousey0 6988 f539 - sta mousey0 6989 f539 - endif 6990 f539 - ; at half resolution we just exit after updating x and y 6991 f539 - jmp LLRET0 6992 f539 -mouse0halveddone 6993 f539 - endif ; PRECISIONMOUSING 6994 f539 - 6995 f539 - ifnconst MOUSEXONLY 6996 f539 - asl mouseydelta ; *2 because Y resolution is finer 6997 f539 - ldy port0resolution 6998 f539 - dey 6999 f539 - lda #0 7000 f539 -mousey0resolutionfix 7001 f539 - clc 7002 f539 - adc mouseydelta 7003 f539 - dey 7004 f539 - bpl mousey0resolutionfix 7005 f539 - clc 7006 f539 - adc mousey0 7007 f539 - sta mousey0 7008 f539 - endif ; MOUSEXONLY 7009 f539 - 7010 f539 - ldy port0resolution 7011 f539 - dey 7012 f539 - lda #0 7013 f539 -mousex0resolutionfix 7014 f539 - clc 7015 f539 - adc mousexdelta 7016 f539 - dey 7017 f539 - bpl mousex0resolutionfix 7018 f539 - ifnconst DRIVINGBOOST 7019 f539 - clc 7020 f539 - adc mousex0 7021 f539 - sta mousex0 7022 f539 - else 7023 f539 - cpx #6 7024 f539 - beq carryonmouse0boost 7025 f539 - clc 7026 f539 - adc mousex0 7027 f539 - sta mousex0 7028 f539 - jmp LLRET0 7029 f539 -carryonmouse0boost 7030 f539 - sta mousexdelta 7031 f539 - clc 7032 f539 - adc mousecodey0 7033 f539 - sta mousecodey0 7034 f539 - clc 7035 f539 - adc mousex0 7036 f539 - tay ; save the target X 7037 f539 - adc mousey0 ; average in the smoothly-trailing X 7038 f539 - ror 7039 f539 - sta mousex0 ; mousex0 now has the smoothly trailing X 7040 f539 - sty mousey0 ; and mousey0 has the the target X 7041 f539 - 7042 f539 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7043 f539 - ; A has mousex0, the smoothly trailing X 7044 f539 - sbc mousey0 ; less the target X 7045 f539 - bpl skipabsolutedrive0 7046 f539 - eor #$ff 7047 f539 -skipabsolutedrive0 7048 f539 - cmp #64 ; just an unreasonably large change 7049 f539 - bcc skipdrivewrapfix0 7050 f539 - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 7051 f539 -skipdrivewrapfix0 7052 f539 - 7053 f539 - ; get rid of the tweening if the distance travelled was very small 7054 f539 - lda mousexdelta 7055 f539 - cmp port0resolution 7056 f539 - bcs skipbetweenfix0 7057 f539 - lda mousex0 7058 f539 - sta mousey0 7059 f539 -skipbetweenfix0 7060 f539 - 7061 f539 -drivingboostreductioncheck0 7062 f539 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7063 f539 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7064 f539 - ; negated again because truncation during BCD math results in 7065 f539 - ; differing magnitudes, depending if the value is +ve or -ve. 7066 f539 -driving0fix 7067 f539 - lax mousecodey0 7068 f539 - cmp #$80 7069 f539 - bcs driving0skipnegate1 7070 f539 - eor #$FF 7071 f539 - adc #1 7072 f539 - sta mousecodey0 7073 f539 -driving0skipnegate1 7074 f539 - cmp #$80 7075 f539 - ror 7076 f539 - cmp #$80 7077 f539 - ror 7078 f539 - cmp #$80 7079 f539 - ror 7080 f539 - sta inttemp1 7081 f539 - lda mousecodey0 7082 f539 - sec 7083 f539 - sbc inttemp1 7084 f539 - cpx #$80 7085 f539 - bcs driving0skipnegate2 7086 f539 - eor #$FF 7087 f539 - adc #1 7088 f539 -driving0skipnegate2 7089 f539 - sta mousecodey0 7090 f539 -drivingboostdone0 7091 f539 - endif ; DRIVINGBOOST 7092 f539 - 7093 f539 - jmp LLRET0 7094 f539 - 7095 f539 endif ; MOUSE0SUPPORT 7096 f539 7097 f539 mouse1update 7098 f539 - ifconst MOUSE1SUPPORT 7099 f539 - 7100 f539 -mousetableselect = inttemp2 7101 f539 -mousexdelta = inttemp3 7102 f539 -mouseydelta = inttemp4 7103 f539 -lastSWCHA = inttemp6 7104 f539 - 7105 f539 - ; 0000YyXx st mouse 7106 f539 - ; 0000xyXY amiga mouse 7107 f539 - 7108 f539 - lda #$ff 7109 f539 - sta lastSWCHA 7110 f539 - 7111 f539 - ldy port1control 7112 f539 - 7113 f539 - lda #%00010000 7114 f539 - cpy #9 ; AMIGA? 7115 f539 - bne skipamigabitsfix1 7116 f539 - lda #0 7117 f539 -skipamigabitsfix1 7118 f539 - sta mousetableselect 7119 f539 - ifconst DRIVINGBOOST 7120 f539 - cpy #6 ; DRIVING? 7121 f539 - bne skipdriving1setup 7122 f539 - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 7123 f539 - ; trails the actual mousex1, so we can smoothly interpolate toward 7124 f539 - ; the actual position. This actual position is stored in mousey1 7125 f539 - ; after the driver has run. 7126 f539 - ldx mousex1 7127 f539 - lda mousey1 7128 f539 - stx mousey1 7129 f539 - sta mousex1 7130 f539 -skipdriving1setup 7131 f539 - endif ; DRIVINGBOOST 7132 f539 - 7133 f539 - lda #0 7134 f539 - sta mousexdelta 7135 f539 - sta mouseydelta 7136 f539 - 7137 f539 - ifnconst MOUSETIME 7138 f539 - ifnconst MOUSEXONLY 7139 f539 - lda #180 ; minimum for x+y 7140 f539 - else 7141 f539 - lda #100 ; minimum for just x 7142 f539 - endif 7143 f539 - else 7144 f539 - lda #MOUSETIME 7145 f539 - endif 7146 f539 - jsr SETTIM64T ; INTIM is in Y 7147 f539 - 7148 f539 -mouse1updateloop 7149 f539 - lda SWCHA 7150 f539 - and #%00001111 7151 f539 - cmp lastSWCHA 7152 f539 - beq mouse1loopcondition 7153 f539 - sta lastSWCHA 7154 f539 - 7155 f539 - ora mousetableselect ; atari/amiga decoding table selection 7156 f539 - 7157 f539 - ; st mice encode on different bits/joystick-lines than amiga mice... 7158 f539 - ; 0000YyXx st mouse 7159 f539 - ; 0000xyXY amiga mouse 7160 f539 - ; ...so can shuffle the amiga bits to reuse the st driver. 7161 f539 - tay 7162 f539 - lax amigatoataribits,y 7163 f539 - 7164 f539 - ifnconst MOUSEXONLY 7165 f539 - ; first the Y... 7166 f539 - and #%00001100 7167 f539 - ora mousecodey1 7168 f539 - tay 7169 f539 - lda rotationalcompare,y 7170 f539 - clc 7171 f539 - adc mouseydelta 7172 f539 - sta mouseydelta 7173 f539 - tya 7174 f539 - lsr 7175 f539 - lsr 7176 f539 - sta mousecodey1 7177 f539 - txa 7178 f539 - ; ...then the X... 7179 f539 - and #%00000011 7180 f539 - tax 7181 f539 - endif ; !MOUSEXONLY 7182 f539 - 7183 f539 - asl 7184 f539 - asl 7185 f539 - ora mousecodex1 7186 f539 - tay 7187 f539 - lda rotationalcompare,y 7188 f539 - adc mousexdelta ; carry was clear by previous ASL 7189 f539 - sta mousexdelta 7190 f539 - stx mousecodex1 7191 f539 -mouse1loopcondition 7192 f539 - lda TIMINT 7193 f539 - bpl mouse1updateloop 7194 f539 - 7195 f539 - ; *** adapt to selected device resolution. 7196 f539 - ldx port1control 7197 f539 - 7198 f539 - ifconst PRECISIONMOUSING 7199 f539 - ldy port1resolution 7200 f539 - bne mouse1halveddone 7201 f539 - cpx #6 ; half-resolution is no good for driving wheels 7202 f539 - beq mouse1halveddone 7203 f539 - ; resolution=0 is half mouse resolution, necessary for precision 7204 f539 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7205 f539 - 7206 f539 - lda mousexdelta 7207 f539 - cmp #$80 7208 f539 - ror ; do a signed divide by 2. 7209 f539 - clc 7210 f539 - adc mousex1 7211 f539 - sta mousex1 7212 f539 - ifnconst MOUSEXONLY 7213 f539 - lda mouseydelta 7214 f539 - clc 7215 f539 - adc mousey1 7216 f539 - sta mousey1 7217 f539 - endif 7218 f539 - ; at half resolution we just exit after updating x and y 7219 f539 - jmp LLRET1 7220 f539 -mouse1halveddone 7221 f539 - endif ; PRECISIONMOUSING 7222 f539 - 7223 f539 - ifnconst MOUSEXONLY 7224 f539 - asl mouseydelta ; *2 because Y resolution is finer 7225 f539 - ldy port1resolution 7226 f539 - dey 7227 f539 - lda #0 7228 f539 -mousey1resolutionfix 7229 f539 - clc 7230 f539 - adc mouseydelta 7231 f539 - dey 7232 f539 - bpl mousey1resolutionfix 7233 f539 - clc 7234 f539 - adc mousey1 7235 f539 - sta mousey1 7236 f539 - endif ; MOUSEXONLY 7237 f539 - 7238 f539 - ldy port1resolution 7239 f539 - dey 7240 f539 - lda #0 7241 f539 -mousex1resolutionfix 7242 f539 - clc 7243 f539 - adc mousexdelta 7244 f539 - dey 7245 f539 - bpl mousex1resolutionfix 7246 f539 - ifnconst DRIVINGBOOST 7247 f539 - clc 7248 f539 - adc mousex1 7249 f539 - sta mousex1 7250 f539 - else 7251 f539 - cpx #6 7252 f539 - beq carryonmouse1boost 7253 f539 - clc 7254 f539 - adc mousex1 7255 f539 - sta mousex1 7256 f539 - jmp LLRET1 7257 f539 -carryonmouse1boost 7258 f539 - sta mousexdelta 7259 f539 - clc 7260 f539 - adc mousecodey1 7261 f539 - sta mousecodey1 7262 f539 - clc 7263 f539 - adc mousex1 7264 f539 - tay ; save the target X 7265 f539 - adc mousey1 ; average in the smoothly-trailing X 7266 f539 - ror 7267 f539 - sta mousex1 ; mousex0 now has the smoothly trailing X 7268 f539 - sty mousey1 ; and mousey0 has the the target X 7269 f539 - 7270 f539 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7271 f539 - ; A has mousex1, the smoothly trailing X 7272 f539 - sbc mousey1 ; less the target X 7273 f539 - bpl skipabsolutedrive1 7274 f539 - eor #$ff 7275 f539 -skipabsolutedrive1 7276 f539 - cmp #64 ; just an unreasonably large change 7277 f539 - bcc skipdrivewrapfix1 7278 f539 - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 7279 f539 -skipdrivewrapfix1 7280 f539 - 7281 f539 - ; get rid of the tweening if the distance travelled was very small 7282 f539 - lda mousexdelta 7283 f539 - cmp port1resolution 7284 f539 - bcs skipbetweenfix1 7285 f539 - lda mousex1 7286 f539 - sta mousey1 7287 f539 -skipbetweenfix1 7288 f539 - 7289 f539 -drivingboostreductioncheck1 7290 f539 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7291 f539 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7292 f539 - ; negated again because truncation during BCD math results in 7293 f539 - ; differing magnitudes, depending if the value is +ve or -ve. 7294 f539 -driving1fix 7295 f539 - lax mousecodey1 7296 f539 - cmp #$80 7297 f539 - bcs driving0skipnegate1 7298 f539 - eor #$FF 7299 f539 - adc #1 7300 f539 - sta mousecodey1 7301 f539 -driving0skipnegate1 7302 f539 - cmp #$80 7303 f539 - ror 7304 f539 - cmp #$80 7305 f539 - ror 7306 f539 - cmp #$80 7307 f539 - ror 7308 f539 - sta inttemp1 7309 f539 - lda mousecodey1 7310 f539 - sec 7311 f539 - sbc inttemp1 7312 f539 - cpx #$80 7313 f539 - bcs driving1skipnegate2 7314 f539 - eor #$FF 7315 f539 - adc #1 7316 f539 -driving1skipnegate2 7317 f539 - sta mousecodey1 7318 f539 -drivingboostdone1 7319 f539 - endif ; DRIVINGBOOST 7320 f539 - 7321 f539 - jmp LLRET1 7322 f539 - 7323 f539 endif ; MOUSE1SUPPORT 7324 f539 7325 f539 7326 f539 trakball0update 7327 f539 - ifconst TRAKBALL0SUPPORT 7328 f539 - ifnconst TRAKTIME 7329 f539 - ifnconst TRAKXONLY 7330 f539 - lda #180 ; minimum for x+y 7331 f539 - else ; !TRAKXONLY 7332 f539 - lda #100 ; minimum for just x 7333 f539 - endif ; !TRAKXONLY 7334 f539 - else ; !TRAKTIME 7335 f539 - lda #TRAKTIME 7336 f539 - endif ; !TRAKTIME 7337 f539 - jsr SETTIM64T ; INTIM is in Y 7338 f539 - ldx #0 7339 f539 - ifnconst TRAKXONLY 7340 f539 - ldy #0 7341 f539 - endif ; TRAKXONLY 7342 f539 -trakball0updateloop 7343 f539 - lda SWCHA 7344 f539 - and #%00110000 7345 f539 - cmp trakballcodex0 7346 f539 - sta trakballcodex0 7347 f539 - beq trakball0movementXdone 7348 f539 - and #%00010000 7349 f539 - beq trakball0negativeX 7350 f539 -trakball0positiveX 7351 f539 - ;(2 from beq) 7352 f539 - inx ; 2 7353 f539 - jmp trakball0movementXdone ; 3 7354 f539 -trakball0negativeX 7355 f539 - ;(3 from beq) 7356 f539 - dex ; 2 7357 f539 - nop ; 2 7358 f539 -trakball0movementXdone 7359 f539 - 7360 f539 - ifnconst TRAKXONLY 7361 f539 - lda SWCHA 7362 f539 - and #%11000000 7363 f539 - cmp trakballcodey0 7364 f539 - sta trakballcodey0 7365 f539 - beq trakball0movementYdone 7366 f539 - and #%01000000 7367 f539 - beq trakball0negativeY 7368 f539 -trakball0positiveY 7369 f539 - ;(2 from beq) 7370 f539 - iny ; 2 7371 f539 - jmp trakball0movementYdone ; 3 7372 f539 -trakball0negativeY 7373 f539 - ;(3 from beq) 7374 f539 - dey ; 2 7375 f539 - nop ; 2 7376 f539 -trakball0movementYdone 7377 f539 - endif ; !TRAKXONLY 7378 f539 - 7379 f539 - lda TIMINT 7380 f539 - bpl trakball0updateloop 7381 f539 - lda #0 7382 f539 - cpx #0 7383 f539 - beq trakball0skipXadjust 7384 f539 - clc 7385 f539 -trakball0Xloop 7386 f539 - adc port0resolution 7387 f539 - dex 7388 f539 - bne trakball0Xloop 7389 f539 - clc 7390 f539 - adc trakballx0 7391 f539 - sta trakballx0 7392 f539 -trakball0skipXadjust 7393 f539 - ifnconst TRAKXONLY 7394 f539 - lda #0 7395 f539 - cpy #0 7396 f539 - beq trakball0skipYadjust 7397 f539 - clc 7398 f539 -trakball0yloop 7399 f539 - adc port0resolution 7400 f539 - dey 7401 f539 - bne trakball0yloop 7402 f539 - clc 7403 f539 - adc trakbally0 7404 f539 - sta trakbally0 7405 f539 -trakball0skipYadjust 7406 f539 - endif ; !TRAKXONLY 7407 f539 - 7408 f539 - jmp LLRET0 7409 f539 endif 7410 f539 7411 f539 7412 f539 7413 f539 trakball1update 7414 f539 - ifconst TRAKBALL1SUPPORT 7415 f539 - ifnconst TRAKTIME 7416 f539 - ifnconst TRAKXONLY 7417 f539 - lda #180 ; minimum for x+y 7418 f539 - else ; !TRAKXONLY 7419 f539 - lda #100 ; minimum for just x 7420 f539 - endif ; !TRAKXONLY 7421 f539 - else ; !TRAKTIME 7422 f539 - lda #TRAKTIME 7423 f539 - endif ; !TRAKTIME 7424 f539 - jsr SETTIM64T ; INTIM is in Y 7425 f539 - ldx #0 7426 f539 - ifnconst TRAKXONLY 7427 f539 - ldy #0 7428 f539 - endif ; TRAKXONLY 7429 f539 -trakball1updateloop 7430 f539 - lda SWCHA 7431 f539 - and #%00000011 7432 f539 - cmp trakballcodex1 7433 f539 - sta trakballcodex1 7434 f539 - beq trakball1movementXdone 7435 f539 - and #%00000001 7436 f539 - beq trakball1negativeX 7437 f539 -trakball1positiveX 7438 f539 - ;(2 from beq) 7439 f539 - inx ; 2 7440 f539 - jmp trakball1movementXdone ; 3 7441 f539 -trakball1negativeX 7442 f539 - ;(3 from beq) 7443 f539 - dex ; 2 7444 f539 - nop ; 2 7445 f539 -trakball1movementXdone 7446 f539 - 7447 f539 - ifnconst TRAKXONLY 7448 f539 - lda SWCHA 7449 f539 - and #%00001100 7450 f539 - cmp trakballcodey1 7451 f539 - sta trakballcodey1 7452 f539 - beq trakball1movementYdone 7453 f539 - and #%00000100 7454 f539 - beq trakball1negativeY 7455 f539 -trakball1positiveY 7456 f539 - ;(2 from beq) 7457 f539 - iny ; 2 7458 f539 - jmp trakball1movementYdone ; 3 7459 f539 -trakball1negativeY 7460 f539 - ;(3 from beq) 7461 f539 - dey ; 2 7462 f539 - nop ; 2 7463 f539 -trakball1movementYdone 7464 f539 - endif ; !TRAKXONLY 7465 f539 - 7466 f539 - lda TIMINT 7467 f539 - bpl trakball1updateloop 7468 f539 - lda #0 7469 f539 - cpx #0 7470 f539 - beq trakball1skipXadjust 7471 f539 - clc 7472 f539 -trakball1Xloop 7473 f539 - adc port1resolution 7474 f539 - dex 7475 f539 - bne trakball1Xloop 7476 f539 - clc 7477 f539 - adc trakballx1 7478 f539 - sta trakballx1 7479 f539 -trakball1skipXadjust 7480 f539 - ifnconst TRAKXONLY 7481 f539 - lda #0 7482 f539 - cpy #0 7483 f539 - beq trakball1skipYadjust 7484 f539 - clc 7485 f539 -trakball1yloop 7486 f539 - adc port1resolution 7487 f539 - dey 7488 f539 - bne trakball1yloop 7489 f539 - clc 7490 f539 - adc trakbally1 7491 f539 - sta trakbally1 7492 f539 -trakball1skipYadjust 7493 f539 - endif ; !TRAKXONLY 7494 f539 - 7495 f539 - jmp LLRET1 7496 f539 endif 7497 f539 7498 f539 7499 f539 paddleport0update 7500 f539 - ifconst PADDLE0SUPPORT 7501 f539 - lda #6 7502 f539 - sta VBLANK ; start charging the paddle caps 7503 f539 - lda #0 ; use PADDLE timing 7504 f539 - jsr SETTIM64T ; INTIM is in Y 7505 f539 - 7506 f539 -paddleport0updateloop 7507 f539 - lda INPT0 7508 f539 - bmi skippaddle0setposition 7509 f539 - sty paddleposition0 7510 f539 -skippaddle0setposition 7511 f539 - ifconst TWOPADDLESUPPORT 7512 f539 - lda INPT1 7513 f539 - bmi skippaddle1setposition 7514 f539 - sty paddleposition1 7515 f539 -skippaddle1setposition 7516 f539 - endif 7517 f539 - ldy INTIM 7518 f539 - cpy #TIMEOFFSET 7519 f539 - bcs paddleport0updateloop 7520 f539 - 7521 f539 - lda #%10000110 7522 f539 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 7523 f539 - sec 7524 f539 - lda paddleposition0 7525 f539 - sbc #TIMEOFFSET 7526 f539 - ifconst PADDLESCALEX2 7527 f539 - asl 7528 f539 - endif 7529 f539 - 7530 f539 - ifnconst PADDLESMOOTHINGOFF 7531 f539 - clc 7532 f539 - adc paddleprevious0 7533 f539 - ror 7534 f539 - sta paddleprevious0 7535 f539 - endif 7536 f539 - 7537 f539 - sta paddleposition0 7538 f539 - 7539 f539 - ifconst TWOPADDLESUPPORT 7540 f539 - sec 7541 f539 - lda paddleposition1 7542 f539 - sbc #TIMEOFFSET 7543 f539 - ifconst PADDLESCALEX2 7544 f539 - asl 7545 f539 - endif 7546 f539 - 7547 f539 - ifnconst PADDLESMOOTHINGOFF 7548 f539 - clc 7549 f539 - adc paddleprevious1 7550 f539 - ror 7551 f539 - sta paddleprevious1 7552 f539 - endif 7553 f539 - sta paddleposition1 7554 f539 - endif ; TWOPADDLESUPPORT 7555 f539 - 7556 f539 - jmp LLRET0 7557 f539 endif 7558 f539 7559 f539 paddleport1update 7560 f539 - ifconst PADDLE1SUPPORT 7561 f539 - lda #6 7562 f539 - sta VBLANK ; start charging the paddle caps 7563 f539 - 7564 f539 - lda #0 ; use PADDLE timing 7565 f539 - jsr SETTIM64T ; INTIM is in Y 7566 f539 - 7567 f539 -paddleport1updateloop 7568 f539 - lda INPT2 7569 f539 - bmi skippaddle2setposition 7570 f539 - sty paddleposition2 7571 f539 -skippaddle2setposition 7572 f539 - ifconst TWOPADDLESUPPORT 7573 f539 - lda INPT3 7574 f539 - bmi skippaddle3setposition 7575 f539 - sty paddleposition3 7576 f539 -skippaddle3setposition 7577 f539 - endif 7578 f539 - ldy INTIM 7579 f539 - cpy #TIMEOFFSET 7580 f539 - bcs paddleport1updateloop 7581 f539 - 7582 f539 - lda #%10000110 7583 f539 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 7584 f539 - sec 7585 f539 - lda paddleposition2 7586 f539 - sbc #TIMEOFFSET 7587 f539 - ifconst PADDLESCALEX2 7588 f539 - asl 7589 f539 - endif 7590 f539 - 7591 f539 - ifnconst PADDLESMOOTHINGOFF 7592 f539 - clc 7593 f539 - adc paddleprevious2 7594 f539 - ror 7595 f539 - sta paddleprevious2 7596 f539 - endif 7597 f539 - 7598 f539 - sta paddleposition2 7599 f539 - 7600 f539 - ifconst TWOPADDLESUPPORT 7601 f539 - sec 7602 f539 - lda paddleposition3 7603 f539 - sbc #TIMEOFFSET 7604 f539 - ifconst PADDLESCALEX2 7605 f539 - asl 7606 f539 - endif 7607 f539 - 7608 f539 - ifnconst PADDLESMOOTHINGOFF 7609 f539 - clc 7610 f539 - adc paddleprevious3 7611 f539 - ror 7612 f539 - sta paddleprevious3 7613 f539 - endif 7614 f539 - sta paddleposition3 7615 f539 - endif ; TWOPADDLESUPPORT 7616 f539 - 7617 f539 - jmp LLRET1 7618 f539 endif 7619 f539 7620 f539 7621 f539 paddlebuttonhandler ; outside of conditional, for button-handler LUT 7622 f539 - ifconst PADDLESUPPORT 7623 f539 - ; x=0|1 for port, rather than paddle #. 7624 f539 - ; Only the first paddle button will integrate into "joy0fire" testing. If the 7625 f539 - ; game wants to support 2 paddles, up to the game to instead test the 7626 f539 - ; joystick right+left directions instead. 7627 f539 - lda SWCHA ; top of nibble is first paddle button 7628 f539 - cpx #0 ; port 0? 7629 f539 - beq skippaddleport2shift 7630 f539 - asl ; shift second port to upper nibble 7631 f539 - asl 7632 f539 - asl 7633 f539 - asl 7634 f539 -skippaddleport2shift 7635 f539 - and #%10000000 7636 f539 - eor #%10000000 ; invert 7637 f539 - sta sINPT1,x 7638 f539 - jmp buttonreadloopreturn 7639 f539 endif ; PADDLESUPPORT 7640 f539 7641 f539 mousebuttonhandler ; outside of conditional, for button-handler LUT 7642 f539 - ifconst MOUSESUPPORT 7643 f539 - ; stick the mouse buttons in the correct shadow register... 7644 f539 - txa 7645 f539 - asl 7646 f539 - tay ; y=x*2 7647 f539 - lda INPT4,x 7648 f539 - eor #%10000000 7649 f539 - lsr 7650 f539 - sta sINPT1,x 7651 f539 - 7652 f539 - lda INPT1,y 7653 f539 - and #%10000000 7654 f539 - eor #%10000000 7655 f539 - ora sINPT1,x 7656 f539 - sta sINPT1,x 7657 f539 - jmp buttonreadloopreturn 7658 f539 endif ; MOUSESUPPORT 7659 f539 7660 f539 - ifconst KEYPADSUPPORT 7661 f539 - ; ** select keypad rows 0 to 3 over 4 frames... 7662 f539 -keypadrowselect 7663 f539 - ldy #0 7664 f539 - lda port0control 7665 f539 - cmp #7 7666 f539 - bne skipport0val 7667 f539 - iny ; y=y+1 7668 f539 -skipport0val 7669 f539 - lda port1control 7670 f539 - cmp #7 7671 f539 - bne skipport1val 7672 f539 - iny 7673 f539 - iny ; y=y+2 7674 f539 -skipport1val 7675 f539 - lda keyrowdirectionmask,y 7676 f539 - sta CTLSWA 7677 f539 - tya 7678 f539 - asl 7679 f539 - asl 7680 f539 - sta inttemp1 7681 f539 - lda framecounter 7682 f539 - and #3 7683 f539 - ora inttemp1 7684 f539 - tax 7685 f539 - lda keyrowselectvalue,x 7686 f539 - sta SWCHA 7687 f539 - rts 7688 f539 - 7689 f539 -keyrowdirectionmask 7690 f539 - .byte #%00000000 ; 0 : port0=input port1=input 7691 f539 - .byte #%11110000 ; 1 : port0=output port1=input 7692 f539 - .byte #%00001111 ; 2 : port0=input port1=output 7693 f539 - .byte #%11111111 ; 3 : port0=output port1=output 7694 f539 - 7695 f539 -keyrowselectvalue 7696 f539 - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 7697 f539 - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 7698 f539 - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 7699 f539 - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 7700 f539 endif ; KEYPADSUPPORT 7701 f539 7702 f539 - ifconst KEYPADSUPPORT 7703 f539 - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 7704 f539 -keypadcolumnread 7705 f539 - lda port0control 7706 f539 - cmp #7 7707 f539 - bne skipkeypadcolumnread0 7708 f539 - lda framecounter 7709 f539 - and #3 7710 f539 - asl ; x2 because keypad variables are interleaved 7711 f539 - tax 7712 f539 - lda #0 7713 f539 - sta keypadmatrix0a,x 7714 f539 - lda INPT0 7715 f539 - cmp #$80 7716 f539 - rol keypadmatrix0a,x 7717 f539 - lda INPT1 7718 f539 - cmp #$80 7719 f539 - rol keypadmatrix0a,x 7720 f539 - lda INPT4 7721 f539 - cmp #$80 7722 f539 - rol keypadmatrix0a,x 7723 f539 - lda keypadmatrix0a,x 7724 f539 - eor #%00000111 7725 f539 - sta keypadmatrix0a,x 7726 f539 -skipkeypadcolumnread0 7727 f539 - 7728 f539 - lda port1control 7729 f539 - cmp #7 7730 f539 - bne skipkeypadcolumnread1 7731 f539 - lda framecounter 7732 f539 - and #3 7733 f539 - asl ; x2 because keypad variables are interleaved 7734 f539 - tax 7735 f539 - lda #0 7736 f539 - sta keypadmatrix1a,x 7737 f539 - rol keypadmatrix1a,x 7738 f539 - lda INPT2 7739 f539 - cmp #$80 7740 f539 - rol keypadmatrix1a,x 7741 f539 - lda INPT3 7742 f539 - cmp #$80 7743 f539 - rol keypadmatrix1a,x 7744 f539 - lda INPT5 7745 f539 - cmp #$80 7746 f539 - rol keypadmatrix1a,x 7747 f539 - lda keypadmatrix1a,x 7748 f539 - eor #%00000111 7749 f539 - sta keypadmatrix1a,x 7750 f539 -skipkeypadcolumnread1 7751 f539 - rts 7752 f539 endif ; KEYPADSUPPORT 7753 f539 7754 f539 setportforinput 7755 f539 a5 e4 lda CTLSWAs 7756 f53b 3d 44 f5 and allpinsinputlut,x 7757 f53e 85 e4 sta CTLSWAs 7758 f540 8d 81 02 sta CTLSWA 7759 f543 60 rts 7760 f544 7761 f544 allpinsinputlut 7762 f544 0f f0 .byte.b $0F, $F0 7763 f546 7764 f546 setonebuttonmode 7765 f546 a9 06 lda #6 ; in case we're in unlocked-bios mode 7766 f548 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 7767 f54a a9 14 lda #$14 7768 f54c 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 7769 f54f a5 e5 lda CTLSWBs 7770 f551 1d 5a f5 ora thisjoy2buttonbit,x 7771 f554 85 e5 sta CTLSWBs 7772 f556 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 7773 f559 60 rts 7774 f55a 7775 f55a thisjoy2buttonbit 7776 f55a 04 10 .byte.b $04, $10 7777 f55c 7778 f55c settwobuttonmode 7779 f55c a9 06 lda #6 ; in case we're in unlocked-bios mode 7780 f55e 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 7781 f560 a9 14 lda #$14 7782 f562 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 7783 f565 a5 e5 lda CTLSWBs 7784 f567 3d 70 f5 and thisjoy2buttonmask,x 7785 f56a 85 e5 sta CTLSWBs 7786 f56c 8d 82 02 sta SWCHB 7787 f56f 60 rts 7788 f570 7789 f570 thisjoy2buttonmask 7790 f570 fb ef .byte.b $fb, $ef 7791 f572 7792 f572 ; Provided under the CC0 license. See the included LICENSE.txt for details. 7793 f572 7794 f572 START 7795 f572 start 7796 f572 7797 f572 ;******** more or less the Atari recommended startup procedure 7798 f572 7799 f572 78 sei 7800 f573 d8 cld 7801 f574 7802 f574 ifnconst NOTIALOCK 7803 f574 a9 07 lda #$07 7804 f576 - else 7805 f576 - lda #$06 7806 f576 endif 7807 f576 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 7808 f578 a9 7f lda #$7F 7809 f57a 85 3c sta CTRL ;disable DMA 7810 f57c a9 00 lda #$00 7811 f57e 85 38 sta OFFSET 7812 f580 ifnconst NOTIALOCK 7813 f580 85 01 sta INPTCTRL 7814 f582 endif 7815 f582 a2 ff ldx #$FF 7816 f584 9a txs 7817 f585 7818 f585 ;************** Clear Memory 7819 f585 7820 f585 a2 40 ldx #$40 7821 f587 a9 00 lda #$00 7822 f589 crloop1 7823 f589 95 00 sta $00,x ;Clear zero page 7824 f58b 9d 00 01 sta $100,x ;Clear page 1 7825 f58e e8 inx 7826 f58f d0 f8 bne crloop1 7827 f591 7828 f591 7829 f591 a0 00 ldy #$00 ;Clear Ram 7830 f593 a9 18 lda #$18 ;Start at $1800 7831 f595 85 81 sta $81 7832 f597 a9 00 lda #$00 7833 f599 85 80 sta $80 7834 f59b crloop3 7835 f59b a9 00 lda #$00 7836 f59d 91 80 sta ($80),y ;Store data 7837 f59f c8 iny ;Next byte 7838 f5a0 d0 f9 bne crloop3 ;Branch if not done page 7839 f5a2 e6 81 inc $81 ;Next page 7840 f5a4 a5 81 lda $81 7841 f5a6 c9 20 cmp #$20 ;End at $1FFF 7842 f5a8 d0 f1 bne crloop3 ;Branch if not 7843 f5aa 7844 f5aa a0 00 ldy #$00 ;Clear Ram 7845 f5ac a9 22 lda #$22 ;Start at $2200 7846 f5ae 85 81 sta $81 7847 f5b0 a9 00 lda #$00 7848 f5b2 85 80 sta $80 7849 f5b4 crloop4 7850 f5b4 a9 00 lda #$00 7851 f5b6 91 80 sta ($80),y ;Store data 7852 f5b8 c8 iny ;Next byte 7853 f5b9 d0 f9 bne crloop4 ;Branch if not done page 7854 f5bb e6 81 inc $81 ;Next page 7855 f5bd a5 81 lda $81 7856 f5bf c9 27 cmp #$27 ;End at $27FF 7857 f5c1 d0 f1 bne crloop4 ;Branch if not 7858 f5c3 7859 f5c3 a2 00 ldx #$00 7860 f5c5 a9 00 lda #$00 7861 f5c7 crloop5 ;Clear 2100-213F, 2000-203F 7862 f5c7 9d 00 20 sta $2000,x 7863 f5ca 9d 00 21 sta $2100,x 7864 f5cd e8 inx 7865 f5ce e0 40 cpx #$40 7866 f5d0 d0 f5 bne crloop5 7867 f5d2 7868 f5d2 85 80 sta $80 7869 f5d4 85 81 sta $81 7870 f5d6 85 82 sta $82 7871 f5d8 85 83 sta $83 7872 f5da 7873 f5da ;seed random number with hopefully-random timer value 7874 f5da a9 01 lda #1 7875 f5dc 0d 84 02 ora INTIM 7876 f5df 85 40 sta rand 7877 f5e1 7878 f5e1 ; detect the console type... 7879 f5e1 pndetectvblankstart 7880 f5e1 a5 28 lda MSTAT 7881 f5e3 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 7882 f5e5 pndetectvblankover 7883 f5e5 a5 28 lda MSTAT 7884 f5e7 30 fc bmi pndetectvblankover ; then wait for it to be over 7885 f5e9 a0 00 ldy #$00 7886 f5eb a2 00 ldx #$00 7887 f5ed pndetectvblankhappening 7888 f5ed a5 28 lda MSTAT 7889 f5ef 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 7890 f5f1 85 24 sta WSYNC 7891 f5f3 85 24 sta WSYNC 7892 f5f5 e8 inx 7893 f5f6 d0 f5 bne pndetectvblankhappening 7894 f5f8 pndetectinvblank 7895 f5f8 e0 7d cpx #125 7896 f5fa 90 02 bcc pndetecispal 7897 f5fc a0 01 ldy #$01 7898 f5fe pndetecispal 7899 f5fe 8c 09 21 sty paldetected 7900 f601 7901 f601 20 9f f4 jsr createallgamedlls 7902 f604 7903 f604 a9 18 lda #>DLLMEM 7904 f606 85 2c sta DPPH 7905 f608 a9 00 lda # 255 8074 f630 -DOUBLEBUFFEROFFSET = 255 8075 f630 else 8076 f630 00 4d DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 8077 f630 endif 8078 f630 8079 f630 - ifconst EXTRADLMEMORY 8080 f630 -SECONDDLHALFSTART SET $2300 8081 f630 endif 8082 f630 8083 f630 DLPOINTH 8084 f630 DLINDEX SET 0 8085 f630 REPEAT WZONECOUNT 8086 f630 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f630 - ifconst EXTRADLMEMORY 8088 f630 - if TMPMEMADDRESS > $1FFF 8089 f630 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f630 - else 8091 f630 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f630 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f630 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f630 - endif 8095 f630 - endif ; TMPMEMADDRESS > $1FFF 8096 f630 endif ; EXTRADLMEMORY 8097 f630 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f630 18 .byte.b >TMPMEMADDRESS 8099 f630 DLINDEX SET DLINDEX + 1 8085 f630 REPEND 8086 f630 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f631 - ifconst EXTRADLMEMORY 8088 f631 - if TMPMEMADDRESS > $1FFF 8089 f631 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f631 - else 8091 f631 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f631 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f631 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f631 - endif 8095 f631 - endif ; TMPMEMADDRESS > $1FFF 8096 f631 endif ; EXTRADLMEMORY 8097 f631 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f631 18 .byte.b >TMPMEMADDRESS 8099 f631 DLINDEX SET DLINDEX + 1 8085 f631 REPEND 8086 f631 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f632 - ifconst EXTRADLMEMORY 8088 f632 - if TMPMEMADDRESS > $1FFF 8089 f632 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f632 - else 8091 f632 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f632 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f632 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f632 - endif 8095 f632 - endif ; TMPMEMADDRESS > $1FFF 8096 f632 endif ; EXTRADLMEMORY 8097 f632 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f632 19 .byte.b >TMPMEMADDRESS 8099 f632 DLINDEX SET DLINDEX + 1 8085 f632 REPEND 8086 f632 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f633 - ifconst EXTRADLMEMORY 8088 f633 - if TMPMEMADDRESS > $1FFF 8089 f633 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f633 - else 8091 f633 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f633 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f633 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f633 - endif 8095 f633 - endif ; TMPMEMADDRESS > $1FFF 8096 f633 endif ; EXTRADLMEMORY 8097 f633 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f633 19 .byte.b >TMPMEMADDRESS 8099 f633 DLINDEX SET DLINDEX + 1 8085 f633 REPEND 8086 f633 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f634 - ifconst EXTRADLMEMORY 8088 f634 - if TMPMEMADDRESS > $1FFF 8089 f634 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f634 - else 8091 f634 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f634 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f634 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f634 - endif 8095 f634 - endif ; TMPMEMADDRESS > $1FFF 8096 f634 endif ; EXTRADLMEMORY 8097 f634 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f634 19 .byte.b >TMPMEMADDRESS 8099 f634 DLINDEX SET DLINDEX + 1 8085 f634 REPEND 8086 f634 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f635 - ifconst EXTRADLMEMORY 8088 f635 - if TMPMEMADDRESS > $1FFF 8089 f635 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f635 - else 8091 f635 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f635 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f635 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f635 - endif 8095 f635 - endif ; TMPMEMADDRESS > $1FFF 8096 f635 endif ; EXTRADLMEMORY 8097 f635 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f635 1a .byte.b >TMPMEMADDRESS 8099 f635 DLINDEX SET DLINDEX + 1 8085 f635 REPEND 8086 f635 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f636 - ifconst EXTRADLMEMORY 8088 f636 - if TMPMEMADDRESS > $1FFF 8089 f636 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f636 - else 8091 f636 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f636 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f636 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f636 - endif 8095 f636 - endif ; TMPMEMADDRESS > $1FFF 8096 f636 endif ; EXTRADLMEMORY 8097 f636 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f636 1a .byte.b >TMPMEMADDRESS 8099 f636 DLINDEX SET DLINDEX + 1 8085 f636 REPEND 8086 f636 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f637 - ifconst EXTRADLMEMORY 8088 f637 - if TMPMEMADDRESS > $1FFF 8089 f637 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f637 - else 8091 f637 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f637 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f637 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f637 - endif 8095 f637 - endif ; TMPMEMADDRESS > $1FFF 8096 f637 endif ; EXTRADLMEMORY 8097 f637 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f637 1a .byte.b >TMPMEMADDRESS 8099 f637 DLINDEX SET DLINDEX + 1 8085 f637 REPEND 8086 f637 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f638 - ifconst EXTRADLMEMORY 8088 f638 - if TMPMEMADDRESS > $1FFF 8089 f638 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f638 - else 8091 f638 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f638 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f638 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f638 - endif 8095 f638 - endif ; TMPMEMADDRESS > $1FFF 8096 f638 endif ; EXTRADLMEMORY 8097 f638 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f638 1b .byte.b >TMPMEMADDRESS 8099 f638 DLINDEX SET DLINDEX + 1 8085 f638 REPEND 8086 f638 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f639 - ifconst EXTRADLMEMORY 8088 f639 - if TMPMEMADDRESS > $1FFF 8089 f639 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f639 - else 8091 f639 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f639 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f639 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f639 - endif 8095 f639 - endif ; TMPMEMADDRESS > $1FFF 8096 f639 endif ; EXTRADLMEMORY 8097 f639 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f639 1b .byte.b >TMPMEMADDRESS 8099 f639 DLINDEX SET DLINDEX + 1 8085 f639 REPEND 8086 f639 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f63a - ifconst EXTRADLMEMORY 8088 f63a - if TMPMEMADDRESS > $1FFF 8089 f63a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f63a - else 8091 f63a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f63a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f63a -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f63a - endif 8095 f63a - endif ; TMPMEMADDRESS > $1FFF 8096 f63a endif ; EXTRADLMEMORY 8097 f63a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f63a 1b .byte.b >TMPMEMADDRESS 8099 f63a DLINDEX SET DLINDEX + 1 8085 f63a REPEND 8086 f63a TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f63b - ifconst EXTRADLMEMORY 8088 f63b - if TMPMEMADDRESS > $1FFF 8089 f63b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f63b - else 8091 f63b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f63b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f63b -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f63b - endif 8095 f63b - endif ; TMPMEMADDRESS > $1FFF 8096 f63b endif ; EXTRADLMEMORY 8097 f63b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f63b 1b .byte.b >TMPMEMADDRESS 8099 f63b DLINDEX SET DLINDEX + 1 8085 f63b REPEND 8086 f63b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f63c - ifconst EXTRADLMEMORY 8088 f63c - if TMPMEMADDRESS > $1FFF 8089 f63c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f63c - else 8091 f63c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f63c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f63c -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f63c - endif 8095 f63c - endif ; TMPMEMADDRESS > $1FFF 8096 f63c endif ; EXTRADLMEMORY 8097 f63c ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f63c 1c .byte.b >TMPMEMADDRESS 8099 f63c DLINDEX SET DLINDEX + 1 8085 f63c REPEND 8086 f63c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f63d - ifconst EXTRADLMEMORY 8088 f63d - if TMPMEMADDRESS > $1FFF 8089 f63d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f63d - else 8091 f63d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f63d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f63d -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f63d - endif 8095 f63d - endif ; TMPMEMADDRESS > $1FFF 8096 f63d endif ; EXTRADLMEMORY 8097 f63d ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f63d 1c .byte.b >TMPMEMADDRESS 8099 f63d DLINDEX SET DLINDEX + 1 8085 f63d REPEND 8086 f63d TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f63e - ifconst EXTRADLMEMORY 8088 f63e - if TMPMEMADDRESS > $1FFF 8089 f63e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f63e - else 8091 f63e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f63e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f63e -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f63e - endif 8095 f63e - endif ; TMPMEMADDRESS > $1FFF 8096 f63e endif ; EXTRADLMEMORY 8097 f63e ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f63e 1c .byte.b >TMPMEMADDRESS 8099 f63e DLINDEX SET DLINDEX + 1 8085 f63e REPEND 8086 f63e TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f63f - ifconst EXTRADLMEMORY 8088 f63f - if TMPMEMADDRESS > $1FFF 8089 f63f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f63f - else 8091 f63f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f63f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f63f -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f63f - endif 8095 f63f - endif ; TMPMEMADDRESS > $1FFF 8096 f63f endif ; EXTRADLMEMORY 8097 f63f ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f63f 1d .byte.b >TMPMEMADDRESS 8099 f63f DLINDEX SET DLINDEX + 1 8085 f63f REPEND 8086 f63f TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f640 - ifconst EXTRADLMEMORY 8088 f640 - if TMPMEMADDRESS > $1FFF 8089 f640 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f640 - else 8091 f640 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f640 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f640 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f640 - endif 8095 f640 - endif ; TMPMEMADDRESS > $1FFF 8096 f640 endif ; EXTRADLMEMORY 8097 f640 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f640 1d .byte.b >TMPMEMADDRESS 8099 f640 DLINDEX SET DLINDEX + 1 8085 f640 REPEND 8086 f640 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f641 - ifconst EXTRADLMEMORY 8088 f641 - if TMPMEMADDRESS > $1FFF 8089 f641 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f641 - else 8091 f641 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f641 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f641 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f641 - endif 8095 f641 - endif ; TMPMEMADDRESS > $1FFF 8096 f641 endif ; EXTRADLMEMORY 8097 f641 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f641 1d .byte.b >TMPMEMADDRESS 8099 f641 DLINDEX SET DLINDEX + 1 8085 f641 REPEND 8086 f641 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f642 - ifconst EXTRADLMEMORY 8088 f642 - if TMPMEMADDRESS > $1FFF 8089 f642 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f642 - else 8091 f642 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f642 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f642 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f642 - endif 8095 f642 - endif ; TMPMEMADDRESS > $1FFF 8096 f642 endif ; EXTRADLMEMORY 8097 f642 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f642 1e .byte.b >TMPMEMADDRESS 8099 f642 DLINDEX SET DLINDEX + 1 8085 f642 REPEND 8086 f642 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f643 - ifconst EXTRADLMEMORY 8088 f643 - if TMPMEMADDRESS > $1FFF 8089 f643 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f643 - else 8091 f643 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f643 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f643 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f643 - endif 8095 f643 - endif ; TMPMEMADDRESS > $1FFF 8096 f643 endif ; EXTRADLMEMORY 8097 f643 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f643 1e .byte.b >TMPMEMADDRESS 8099 f643 DLINDEX SET DLINDEX + 1 8085 f643 REPEND 8086 f643 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f644 - ifconst EXTRADLMEMORY 8088 f644 - if TMPMEMADDRESS > $1FFF 8089 f644 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f644 - else 8091 f644 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f644 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f644 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f644 - endif 8095 f644 - endif ; TMPMEMADDRESS > $1FFF 8096 f644 endif ; EXTRADLMEMORY 8097 f644 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f644 1e .byte.b >TMPMEMADDRESS 8099 f644 DLINDEX SET DLINDEX + 1 8085 f644 REPEND 8086 f644 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f645 - ifconst EXTRADLMEMORY 8088 f645 - if TMPMEMADDRESS > $1FFF 8089 f645 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f645 - else 8091 f645 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f645 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f645 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f645 - endif 8095 f645 - endif ; TMPMEMADDRESS > $1FFF 8096 f645 endif ; EXTRADLMEMORY 8097 f645 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f645 1f .byte.b >TMPMEMADDRESS 8099 f645 DLINDEX SET DLINDEX + 1 8085 f645 REPEND 8086 f645 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f646 - ifconst EXTRADLMEMORY 8088 f646 - if TMPMEMADDRESS > $1FFF 8089 f646 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f646 - else 8091 f646 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f646 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f646 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f646 - endif 8095 f646 - endif ; TMPMEMADDRESS > $1FFF 8096 f646 endif ; EXTRADLMEMORY 8097 f646 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f646 1f .byte.b >TMPMEMADDRESS 8099 f646 DLINDEX SET DLINDEX + 1 8085 f646 REPEND 8086 f646 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8087 f647 - ifconst EXTRADLMEMORY 8088 f647 - if TMPMEMADDRESS > $1FFF 8089 f647 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8090 f647 - else 8091 f647 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8092 f647 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8093 f647 -SECONDDLHALFSTART SET TMPMEMADDRESS 8094 f647 - endif 8095 f647 - endif ; TMPMEMADDRESS > $1FFF 8096 f647 endif ; EXTRADLMEMORY 8097 f647 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8098 f647 1f .byte.b >TMPMEMADDRESS 8099 f647 DLINDEX SET DLINDEX + 1 8100 f648 REPEND 8101 f648 8102 f648 - ifconst EXTRADLMEMORY 8103 f648 - echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 8104 f648 endif 8105 f648 8106 f648 8107 f648 DLPOINTL 8108 f648 DLINDEX SET 0 8109 f648 REPEAT WZONECOUNT 8110 f648 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8111 f648 - ifconst EXTRADLMEMORY 8112 f648 - if TMPMEMADDRESS > $1FFF 8113 f648 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f648 - else 8115 f648 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f648 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f648 - endif 8118 f648 - endif ; TMPMEMADDRESS > $1FFF 8119 f648 endif ; EXTRADLMEMORY 8120 f648 80 .byte.b $1FFF 8113 f649 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f649 - else 8115 f649 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f649 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f649 - endif 8118 f649 - endif ; TMPMEMADDRESS > $1FFF 8119 f649 endif ; EXTRADLMEMORY 8120 f649 d0 .byte.b $1FFF 8113 f64a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f64a - else 8115 f64a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f64a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f64a - endif 8118 f64a - endif ; TMPMEMADDRESS > $1FFF 8119 f64a endif ; EXTRADLMEMORY 8120 f64a 20 .byte.b $1FFF 8113 f64b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f64b - else 8115 f64b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f64b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f64b - endif 8118 f64b - endif ; TMPMEMADDRESS > $1FFF 8119 f64b endif ; EXTRADLMEMORY 8120 f64b 70 .byte.b $1FFF 8113 f64c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f64c - else 8115 f64c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f64c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f64c - endif 8118 f64c - endif ; TMPMEMADDRESS > $1FFF 8119 f64c endif ; EXTRADLMEMORY 8120 f64c c0 .byte.b $1FFF 8113 f64d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f64d - else 8115 f64d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f64d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f64d - endif 8118 f64d - endif ; TMPMEMADDRESS > $1FFF 8119 f64d endif ; EXTRADLMEMORY 8120 f64d 10 .byte.b $1FFF 8113 f64e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f64e - else 8115 f64e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f64e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f64e - endif 8118 f64e - endif ; TMPMEMADDRESS > $1FFF 8119 f64e endif ; EXTRADLMEMORY 8120 f64e 60 .byte.b $1FFF 8113 f64f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f64f - else 8115 f64f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f64f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f64f - endif 8118 f64f - endif ; TMPMEMADDRESS > $1FFF 8119 f64f endif ; EXTRADLMEMORY 8120 f64f b0 .byte.b $1FFF 8113 f650 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f650 - else 8115 f650 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f650 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f650 - endif 8118 f650 - endif ; TMPMEMADDRESS > $1FFF 8119 f650 endif ; EXTRADLMEMORY 8120 f650 00 .byte.b $1FFF 8113 f651 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f651 - else 8115 f651 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f651 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f651 - endif 8118 f651 - endif ; TMPMEMADDRESS > $1FFF 8119 f651 endif ; EXTRADLMEMORY 8120 f651 50 .byte.b $1FFF 8113 f652 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f652 - else 8115 f652 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f652 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f652 - endif 8118 f652 - endif ; TMPMEMADDRESS > $1FFF 8119 f652 endif ; EXTRADLMEMORY 8120 f652 a0 .byte.b $1FFF 8113 f653 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f653 - else 8115 f653 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f653 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f653 - endif 8118 f653 - endif ; TMPMEMADDRESS > $1FFF 8119 f653 endif ; EXTRADLMEMORY 8120 f653 f0 .byte.b $1FFF 8113 f654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f654 - else 8115 f654 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f654 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f654 - endif 8118 f654 - endif ; TMPMEMADDRESS > $1FFF 8119 f654 endif ; EXTRADLMEMORY 8120 f654 40 .byte.b $1FFF 8113 f655 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f655 - else 8115 f655 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f655 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f655 - endif 8118 f655 - endif ; TMPMEMADDRESS > $1FFF 8119 f655 endif ; EXTRADLMEMORY 8120 f655 90 .byte.b $1FFF 8113 f656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f656 - else 8115 f656 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f656 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f656 - endif 8118 f656 - endif ; TMPMEMADDRESS > $1FFF 8119 f656 endif ; EXTRADLMEMORY 8120 f656 e0 .byte.b $1FFF 8113 f657 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f657 - else 8115 f657 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f657 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f657 - endif 8118 f657 - endif ; TMPMEMADDRESS > $1FFF 8119 f657 endif ; EXTRADLMEMORY 8120 f657 30 .byte.b $1FFF 8113 f658 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f658 - else 8115 f658 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f658 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f658 - endif 8118 f658 - endif ; TMPMEMADDRESS > $1FFF 8119 f658 endif ; EXTRADLMEMORY 8120 f658 80 .byte.b $1FFF 8113 f659 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f659 - else 8115 f659 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f659 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f659 - endif 8118 f659 - endif ; TMPMEMADDRESS > $1FFF 8119 f659 endif ; EXTRADLMEMORY 8120 f659 d0 .byte.b $1FFF 8113 f65a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f65a - else 8115 f65a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f65a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f65a - endif 8118 f65a - endif ; TMPMEMADDRESS > $1FFF 8119 f65a endif ; EXTRADLMEMORY 8120 f65a 20 .byte.b $1FFF 8113 f65b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f65b - else 8115 f65b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f65b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f65b - endif 8118 f65b - endif ; TMPMEMADDRESS > $1FFF 8119 f65b endif ; EXTRADLMEMORY 8120 f65b 70 .byte.b $1FFF 8113 f65c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f65c - else 8115 f65c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f65c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f65c - endif 8118 f65c - endif ; TMPMEMADDRESS > $1FFF 8119 f65c endif ; EXTRADLMEMORY 8120 f65c c0 .byte.b $1FFF 8113 f65d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f65d - else 8115 f65d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f65d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f65d - endif 8118 f65d - endif ; TMPMEMADDRESS > $1FFF 8119 f65d endif ; EXTRADLMEMORY 8120 f65d 10 .byte.b $1FFF 8113 f65e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f65e - else 8115 f65e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f65e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f65e - endif 8118 f65e - endif ; TMPMEMADDRESS > $1FFF 8119 f65e endif ; EXTRADLMEMORY 8120 f65e 60 .byte.b $1FFF 8113 f65f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8114 f65f - else 8115 f65f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8116 f65f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8117 f65f - endif 8118 f65f - endif ; TMPMEMADDRESS > $1FFF 8119 f65f endif ; EXTRADLMEMORY 8120 f65f b0 .byte.b $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 18 80 ZONE0ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 18 d0 ZONE1ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 19 20 ZONE2ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 19 70 ZONE3ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 19 c0 ZONE4ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1a 10 ZONE5ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1a 60 ZONE6ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1a b0 ZONE7ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1b 00 ZONE8ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1b 50 ZONE9ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1b a0 ZONE10ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1b f0 ZONE11ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1c 40 ZONE12ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1c 90 ZONE13ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1c e0 ZONE14ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1d 30 ZONE15ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1d 80 ZONE16ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1d d0 ZONE17ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1e 20 ZONE18ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1e 70 ZONE19ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1e c0 ZONE20ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1f 10 ZONE21ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1f 60 ZONE22ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8126 f660 REPEND 8127 f660 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8128 f660 - ifconst EXTRADLMEMORY 8129 f660 - if TMPMEMADDRESS > $1FFF 8130 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8131 f660 - else 8132 f660 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8133 f660 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8134 f660 - endif 8135 f660 - endif ; TMPMEMADDRESS > $1FFF 8136 f660 endif ; EXTRADLMEMORY 8137 f660 8138 f660 1f b0 ZONE23ADDRESS = TMPMEMADDRESS 8139 f660 8140 f660 DLINDEX SET DLINDEX + 1 8141 f660 REPEND 8142 f660 8143 f660 $1880 to $1fff used as zone memory, allowing 15 display objects per zone. 8144 f660 echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 8145 f660 8146 f660 DLHEIGHT 8147 f660 REPEAT WZONECOUNT 8148 f660 07 .byte.b (WZONEHEIGHT-1) 8147 f660 REPEND 8148 f661 07 .byte.b (WZONEHEIGHT-1) 8147 f661 REPEND 8148 f662 07 .byte.b (WZONEHEIGHT-1) 8147 f662 REPEND 8148 f663 07 .byte.b (WZONEHEIGHT-1) 8147 f663 REPEND 8148 f664 07 .byte.b (WZONEHEIGHT-1) 8147 f664 REPEND 8148 f665 07 .byte.b (WZONEHEIGHT-1) 8147 f665 REPEND 8148 f666 07 .byte.b (WZONEHEIGHT-1) 8147 f666 REPEND 8148 f667 07 .byte.b (WZONEHEIGHT-1) 8147 f667 REPEND 8148 f668 07 .byte.b (WZONEHEIGHT-1) 8147 f668 REPEND 8148 f669 07 .byte.b (WZONEHEIGHT-1) 8147 f669 REPEND 8148 f66a 07 .byte.b (WZONEHEIGHT-1) 8147 f66a REPEND 8148 f66b 07 .byte.b (WZONEHEIGHT-1) 8147 f66b REPEND 8148 f66c 07 .byte.b (WZONEHEIGHT-1) 8147 f66c REPEND 8148 f66d 07 .byte.b (WZONEHEIGHT-1) 8147 f66d REPEND 8148 f66e 07 .byte.b (WZONEHEIGHT-1) 8147 f66e REPEND 8148 f66f 07 .byte.b (WZONEHEIGHT-1) 8147 f66f REPEND 8148 f670 07 .byte.b (WZONEHEIGHT-1) 8147 f670 REPEND 8148 f671 07 .byte.b (WZONEHEIGHT-1) 8147 f671 REPEND 8148 f672 07 .byte.b (WZONEHEIGHT-1) 8147 f672 REPEND 8148 f673 07 .byte.b (WZONEHEIGHT-1) 8147 f673 REPEND 8148 f674 07 .byte.b (WZONEHEIGHT-1) 8147 f674 REPEND 8148 f675 07 .byte.b (WZONEHEIGHT-1) 8147 f675 REPEND 8148 f676 07 .byte.b (WZONEHEIGHT-1) 8147 f676 REPEND 8148 f677 07 .byte.b (WZONEHEIGHT-1) 8149 f678 REPEND 8150 f678 8151 f678 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8152 f678 8153 f678 ; a simple guard, than ensures the 7800basic code hasn't 8154 f678 ; spilled into the encryption area... 2310 bytes left in the 7800basic reserved area. 8155 f678 echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 8156 f678 - if (*>$FF7D) 8157 f678 - ERR ; abort the assembly 8158 f678 endif 8159 f678 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8160 f678 8161 f678 - ifconst DEV 8162 f678 - ifnconst ZONEHEIGHT 8163 f678 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8164 f678 - else 8165 f678 - if ZONEHEIGHT = 8 8166 f678 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8167 f678 - else 8168 f678 - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8169 f678 - endif 8170 f678 - endif 8171 f678 endif 8172 f678 8173 f678 ; FF7E/FF7F contains the 7800basic crc checksum word 8174 f678 8175 f678 ; FF80 - FFF7 contains the 7800 encryption key 8176 f678 8177 f678 ifnconst bankswitchmode 8178 fff8 ORG $FFF8 8179 fff8 - else 8180 fff8 - ifconst ROM128K 8181 fff8 - ORG $27FF8 8182 fff8 - RORG $FFF8 8183 fff8 - endif 8184 fff8 - ifconst ROM144K 8185 fff8 - ORG $27FF8 8186 fff8 - RORG $FFF8 8187 fff8 - endif 8188 fff8 - ifconst ROM256K 8189 fff8 - ORG $47FF8 8190 fff8 - RORG $FFF8 8191 fff8 - endif 8192 fff8 - ifconst ROM272K 8193 fff8 - ORG $47FF8 8194 fff8 - RORG $FFF8 8195 fff8 - endif 8196 fff8 - ifconst ROM512K 8197 fff8 - ORG $87FF8 8198 fff8 - RORG $FFF8 8199 fff8 - endif 8200 fff8 - ifconst ROM528K 8201 fff8 - ORG $87FF8 8202 fff8 - RORG $FFF8 8203 fff8 - endif 8204 fff8 endif 8205 fff8 8206 fff8 8207 fff8 ff .byte.b $FF ; region verification. $FF=all regions 8208 fff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 8209 fffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 8210 fffa 8211 fffa ;Vectors 8212 fffa 00 f0 .word.w NMI 8213 fffc 72 f5 .word.w START 8214 fffe 67 f0 .word.w IRQ 8215 10000