------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite3.78b.asm LEVEL 1 PASS 3 1 28000 ???? ; MACRO.H 2 28000 ???? 3 28000 ???? ; Based on the 2600 macro.h file. 4 28000 ???? ; Macros irrelevant to the 7800 have been removed, and the sleep macro 5 28000 ???? ; has been adapted to give accurate results on the 7800. 6 28000 ???? 7 28000 ???? ; Version 1.0 2019/12/11 (based on the 2600 Version 1.05, 13/NOVEMBER/2003) 8 28000 ???? 9 28000 ???? ; Available macros... 10 28000 ???? ; SLEEP n - sleep for n cycles 11 28000 ???? ; SET_POINTER - load a 16-bit absolute to a 16-bit variable 12 28000 ???? 13 28000 ???? ;------------------------------------------------------------------------------- 14 28000 ???? ; SLEEP duration 15 28000 ???? ; Original author: Thomas Jentzsch 16 28000 ???? ; Inserts code which takes the specified number of cycles to execute. This is 17 28000 ???? ; useful for code where precise timing is required. 18 28000 ???? ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS. 19 28000 ???? ; LEGAL OPCODE VERSION MAY AFFECT FLAGS 20 28000 ???? ; Uses illegal opcode (DASM 2.20.01 onwards). 21 28000 ???? 22 28000 ???? MAC sleep 23 28000 ???? .CYCLES SET {1} 24 28000 ???? 25 28000 ???? IF .CYCLES < 2 26 28000 ???? ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 27 28000 ???? ERR 28 28000 ???? ENDIF 29 28000 ???? 30 28000 ???? IF .CYCLES & 1 31 28000 ???? IFNCONST NO_ILLEGAL_OPCODES 32 28000 ???? nop $80 33 28000 ???? ELSE 34 28000 ???? bit $80 35 28000 ???? ENDIF 36 28000 ???? .CYCLES SET .CYCLES - 3 37 28000 ???? ENDIF 38 28000 ???? 39 28000 ???? REPEAT .CYCLES / 2 40 28000 ???? nop 41 28000 ???? REPEND 42 28000 ???? ENDM ;usage: SLEEP n (n>1) 43 28000 ???? 44 28000 ???? ;------------------------------------------------------- 45 28000 ???? ; SET_POINTER 46 28000 ???? ; Original author: Manuel Rotschkar 47 28000 ???? ; 48 28000 ???? ; Sets a 2 byte RAM pointer to an absolute address. 49 28000 ???? ; 50 28000 ???? ; Usage: SET_POINTER pointer, address 51 28000 ???? ; Example: SET_POINTER SpritePTR, SpriteData 52 28000 ???? ; 53 28000 ???? ; Note: Alters the accumulator, NZ flags 54 28000 ???? ; IN 1: 2 byte RAM location reserved for pointer 55 28000 ???? ; IN 2: absolute address 56 28000 ???? 57 28000 ???? MAC set_pointer 58 28000 ???? .POINTER SET {1} 59 28000 ???? .ADDRESS SET {2} 60 28000 ???? 61 28000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address 62 28000 ???? STA .POINTER ; Store in pointer 63 28000 ???? LDA #>.ADDRESS ; Get Hibyte of Address 64 28000 ???? STA .POINTER+1 ; Store in pointer+1 65 28000 ???? 66 28000 ???? ENDM 67 28000 ???? 68 28000 ???? ; EOF 69 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 70 28000 ???? 71 28000 ???? ; 7800MACRO.H 72 28000 ???? 73 28000 ???? ;------------------------------------------------------- 74 28000 ???? ; BOXCOLLISIONCHECK 75 28000 ???? ; author: Mike Saarna 76 28000 ???? ; 77 28000 ???? ; A general bounding box collision check. compares 2 rectangles of differing size 78 28000 ???? ; and shape for overlap. Carry is set for collision detected, clear for none. 79 28000 ???? ; 80 28000 ???? ; Usage: BOXCOLLISIONCHECK x1var,y1var,w1var,h1var,x2var,y2var,w2var,h2var 81 28000 ???? ; 82 28000 ???? 83 28000 ???? MAC boxcollisioncheck 84 28000 ???? .boxx1 SET {1} 85 28000 ???? .boxy1 SET {2} 86 28000 ???? .boxw1 SET {3} 87 28000 ???? .boxh1 SET {4} 88 28000 ???? .boxx2 SET {5} 89 28000 ???? .boxy2 SET {6} 90 28000 ???? .boxw2 SET {7} 91 28000 ???? .boxh2 SET {8} 92 28000 ???? 93 28000 ???? .DoXCollisionCheck 94 28000 ???? lda .boxx1 ;3 95 28000 ???? cmp .boxx2 ;2 96 28000 ???? bcs .X1isbiggerthanX2 ;2/3 97 28000 ???? .X2isbiggerthanX1 98 28000 ???? adc #.boxw1 ;2 99 28000 ???? cmp .boxx2 ;3 100 28000 ???? bcs .DoYCollisionCheck ;3/2 101 28000 ???? bcc .noboxcollision ;3 102 28000 ???? .X1isbiggerthanX2 103 28000 ???? clc ;2 104 28000 ???? sbc #.boxw2 ;2 105 28000 ???? cmp .boxx2 ;3 106 28000 ???? bcs .noboxcollision ;3/2 107 28000 ???? .DoYCollisionCheck 108 28000 ???? lda .boxy1 ;3 109 28000 ???? cmp .boxy2 ;3 110 28000 ???? bcs .Y1isbiggerthanY2 ;3/2 111 28000 ???? .Y2isbiggerthanY1 112 28000 ???? adc #.boxh1 ;2 113 28000 ???? cmp .boxy2 ;3 114 28000 ???? jmp .checkdone ;6 115 28000 ???? .Y1isbiggerthanY2 116 28000 ???? clc ;2 117 28000 ???? sbc #.boxh2 ;2 118 28000 ???? cmp .boxy2 ;3 119 28000 ???? bcs .noboxcollision ;3/2 120 28000 ???? .boxcollision 121 28000 ???? sec ;2 122 28000 ???? .byte $24 ; hardcoded "BIT [clc opcode]", used to skip over the following clc 123 28000 ???? .noboxcollision 124 28000 ???? clc ;2 125 28000 ???? .checkdone 126 28000 ???? 127 28000 ???? ENDM 128 28000 ???? 129 28000 ???? MAC median3 130 28000 ???? 131 28000 ???? ; A median filter (for smoothing paddle jitter) 132 28000 ???? ; this macro takes the current paddle value, compares it to historic 133 28000 ???? ; values, and replaces the current paddle value with the median. 134 28000 ???? ; 135 28000 ???? ; called as: MEDIAN3 STORAGE CURRENT 136 28000 ???? ; where STORAGE points to 3 consecutive bytes of memory. The first 2 137 28000 ???? ; must be dedicated to this MEDIAN filter. The last 1 is a temp. 138 28000 ???? ; where CURRENT is memory holding the new value you wish to compare to 139 28000 ???? ; the previous values, and update with the median value. 140 28000 ???? ; 141 28000 ???? ; returns: CURRENT (modified to contain median value) 142 28000 ???? ; 143 28000 ???? ; author: Mike Saarna (aka RevEng) 144 28000 ???? 145 28000 ???? .MedianBytes SET {1} 146 28000 ???? .NewValue SET {2} 147 28000 ???? 148 28000 ???? lda #0 149 28000 ???? ldy .NewValue 150 28000 ???? sty .MedianBytes+2 ; put the new value in the most "recent" slot 151 28000 ???? 152 28000 ???? ; build an index from relative size comparisons between our 3 values. 153 28000 ???? cpy .MedianBytes 154 28000 ???? rol 155 28000 ???? cpy .MedianBytes+1 156 28000 ???? rol 157 28000 ???? ldy .MedianBytes 158 28000 ???? cpy .MedianBytes+1 159 28000 ???? rol 160 28000 ???? tay 161 28000 ???? 162 28000 ???? ldx MedianOrderLUT,y ; convert the size-comparison index to an index to the median value 163 28000 ???? lda .MedianBytes,x 164 28000 ???? sta .NewValue ; we replace the new value memory with the median value 165 28000 ???? 166 28000 ???? ; then shift values from "newer" bytes to "older" bytes, leaving the 167 28000 ???? ; newest byte (.MedianBytes+2) empty for next time. 168 28000 ???? lda .MedianBytes+1 169 28000 ???? sta .MedianBytes 170 28000 ???? lda .MedianBytes+2 171 28000 ???? sta .MedianBytes+1 172 28000 ???? ifnconst MedianOrderLUT 173 28000 ???? jmp MedianOrderLUTend 174 28000 ???? MedianOrderLUT ; converts our "comparison index" to an index to the median value 175 28000 ???? .byte 0 ; 0 B2 < B0 < B1 176 28000 ???? .byte 1 ; 1 B2 < B1 < B0 177 28000 ???? .byte 2 ; 2 impossible 178 28000 ???? .byte 2 ; 3 B1 < B2 < B0 179 28000 ???? .byte 2 ; 4 B0 < B2 < B1 180 28000 ???? .byte 2 ; 5 impossible 181 28000 ???? .byte 1 ; 6 B0 < B1 < B2 182 28000 ???? .byte 0 ; 7 B1 < B0 < B2 183 28000 ???? MedianOrderLUTend 184 28000 ???? endif 185 28000 ???? ENDM 186 28000 ???? 187 28000 ???? MAC plotsprite 188 28000 ???? 189 28000 ???? ; A macro version of the plotsprite command. 190 28000 ???? ; This trades off rom space for speed. 191 28000 ???? ; It also doesn't check if the visible screen is displayed or not. 192 28000 ???? ; It has no training wheels. It is all rusty sharp edges. 193 28000 ???? 194 28000 ???? .GFXLabel SET {1} 195 28000 ???? .Palette SET {2} ; constant 196 28000 ???? .SpriteX SET {3} ; variable 197 28000 ???? .SpriteY SET {4} ; variable 198 28000 ???? .ByteOffset SET {5} ; variable 199 28000 ???? 200 28000 ???? lda .SpriteY 201 28000 ???? lsr 202 28000 ???? lsr 203 28000 ???? asr #%11111110 ; ensure carry is clear 204 28000 ???? if WZONEHEIGHT = 16 205 28000 ???? asr #%11111110 ; ensure carry is clear 206 28000 ???? endif 207 28000 ???? 208 28000 ???? tax 209 28000 ???? 210 28000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 211 28000 ???? sta dlpnt 212 28000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 213 28000 ???? sta dlpnt+1 214 28000 ???? 215 28000 ???? ldy dlend,x ; find the next new object position in this zone 216 28000 ???? 217 28000 ???? lda .ByteOffset 218 28000 ???? if {1}_width = 2 219 28000 ???? asl 220 28000 ???? endif 221 28000 ???? if {1}_width = 3 222 28000 ???? asl 223 28000 ???? adc .ByteOffset 224 28000 ???? endif 225 28000 ???? if {1}_width = 4 226 28000 ???? asl 227 28000 ???? asl 228 28000 ???? endif 229 28000 ???? if {1}_width = 5 230 28000 ???? asl 231 28000 ???? asl 232 28000 ???? adc .ByteOffset 233 28000 ???? endif 234 28000 ???? if {1}_width = 6 235 28000 ???? asl 236 28000 ???? adc .ByteOffset 237 28000 ???? asl 238 28000 ???? endif 239 28000 ???? if {1}_width = 7 240 28000 ???? asl 241 28000 ???? adc .ByteOffset 242 28000 ???? asl 243 28000 ???? adc .ByteOffset 244 28000 ???? endif 245 28000 ???? if {1}_width = 8 246 28000 ???? asl 247 28000 ???? asl 248 28000 ???? asl 249 28000 ???? endif 250 28000 ???? if {1}_width = 9 251 28000 ???? asl 252 28000 ???? asl 253 28000 ???? asl 254 28000 ???? adc .ByteOffset 255 28000 ???? endif 256 28000 ???? if {1}_width = 10 257 28000 ???? asl 258 28000 ???? asl 259 28000 ???? adc .ByteOffset 260 28000 ???? asl 261 28000 ???? endif 262 28000 ???? if {1}_width = 11 263 28000 ???? asl 264 28000 ???? asl 265 28000 ???? adc .ByteOffset 266 28000 ???? asl 267 28000 ???? adc .ByteOffset 268 28000 ???? endif 269 28000 ???? if {1}_width = 12 270 28000 ???? asl 271 28000 ???? adc .ByteOffset 272 28000 ???? asl 273 28000 ???? asl 274 28000 ???? endif 275 28000 ???? if {1}_width = 13 276 28000 ???? asl 277 28000 ???? adc .ByteOffset 278 28000 ???? asl 279 28000 ???? asl 280 28000 ???? adc .ByteOffset 281 28000 ???? endif 282 28000 ???? if {1}_width = 14 283 28000 ???? asl 284 28000 ???? adc .ByteOffset 285 28000 ???? asl 286 28000 ???? adc .ByteOffset 287 28000 ???? asl 288 28000 ???? endif 289 28000 ???? 290 28000 ???? adc #<.GFXLabel ; carry is clear via previous asl or asr 291 28000 ???? sta (dlpnt),y ; #1 - low byte object address 292 28000 ???? 293 28000 ???? iny 294 28000 ???? 295 28000 ???? lda #({1}_mode | %01000000) 296 28000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 297 28000 ???? 298 28000 ???? iny 299 28000 ???? 300 28000 ???? lda .SpriteY 301 28000 ???? and #(WZONEHEIGHT - 1) 302 28000 ???? cmp #1 ; clear carry if our sprite is just in this zone 303 28000 ???? ora #>.GFXLabel 304 28000 ???? sta (dlpnt),y ; #3 - hi byte object address 305 28000 ???? 306 28000 ???? iny 307 28000 ???? 308 28000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 309 28000 ???? sta (dlpnt),y ; #4 - palette|width 310 28000 ???? 311 28000 ???? iny 312 28000 ???? 313 28000 ???? lda .SpriteX 314 28000 ???? sta (dlpnt),y ; #5 - x object position 315 28000 ???? 316 28000 ???? iny 317 28000 ???? sty dlend,x 318 28000 ???? 319 28000 ???? ifconst ALWAYSTERMINATE 320 28000 ???? iny 321 28000 ???? lda #0 322 28000 ???? sta (dlpnt),y 323 28000 ???? endif 324 28000 ???? 325 28000 ???? bcc .PLOTSPRITEend 326 28000 ???? 327 28000 ???? inx ; next zone 328 28000 ???? 329 28000 ???? lda DLPOINTL,x ; setup DL pointer for this zone 330 28000 ???? sta dlpnt 331 28000 ???? lda DLPOINTH,x ; setup DL pointer for this zone 332 28000 ???? sta dlpnt+1 333 28000 ???? 334 28000 ???? ldy dlend,x ; find the next new object position in this zone 335 28000 ???? 336 28000 ???? lda .ByteOffset 337 28000 ???? if {1}_width = 1 338 28000 ???? clc 339 28000 ???? endif 340 28000 ???? if {1}_width = 2 341 28000 ???? asl ; carry clear 342 28000 ???? endif 343 28000 ???? if {1}_width = 3 344 28000 ???? asl ; carry clear 345 28000 ???? adc .ByteOffset 346 28000 ???? endif 347 28000 ???? if {1}_width = 4 348 28000 ???? asl ; carry clear 349 28000 ???? asl 350 28000 ???? endif 351 28000 ???? if {1}_width = 5 352 28000 ???? asl ; carry clear 353 28000 ???? asl 354 28000 ???? adc .ByteOffset 355 28000 ???? endif 356 28000 ???? if {1}_width = 6 357 28000 ???? asl ; carry clear 358 28000 ???? adc .ByteOffset 359 28000 ???? asl 360 28000 ???? endif 361 28000 ???? if {1}_width = 7 362 28000 ???? asl ; carry clear 363 28000 ???? adc .ByteOffset 364 28000 ???? asl 365 28000 ???? endif 366 28000 ???? if {1}_width = 8 367 28000 ???? asl ; carry clear 368 28000 ???? asl 369 28000 ???? asl 370 28000 ???? endif 371 28000 ???? if {1}_width = 9 372 28000 ???? asl ; carry clear 373 28000 ???? asl 374 28000 ???? asl 375 28000 ???? adc .ByteOffset 376 28000 ???? endif 377 28000 ???? if {1}_width = 10 378 28000 ???? asl ; carry clear 379 28000 ???? asl 380 28000 ???? adc .ByteOffset 381 28000 ???? asl 382 28000 ???? endif 383 28000 ???? if {1}_width = 11 384 28000 ???? asl ; carry clear 385 28000 ???? asl 386 28000 ???? adc .ByteOffset 387 28000 ???? asl 388 28000 ???? adc .ByteOffset 389 28000 ???? endif 390 28000 ???? if {1}_width = 12 391 28000 ???? asl ; carry clear 392 28000 ???? adc .ByteOffset 393 28000 ???? asl 394 28000 ???? asl 395 28000 ???? endif 396 28000 ???? if {1}_width = 13 397 28000 ???? asl ; carry clear 398 28000 ???? adc .ByteOffset 399 28000 ???? asl 400 28000 ???? asl 401 28000 ???? adc .ByteOffset 402 28000 ???? endif 403 28000 ???? if {1}_width = 14 404 28000 ???? asl ; carry clear 405 28000 ???? adc .ByteOffset 406 28000 ???? asl 407 28000 ???? adc .ByteOffset 408 28000 ???? asl 409 28000 ???? endif 410 28000 ???? 411 28000 ???? adc #<.GFXLabel 412 28000 ???? sta (dlpnt),y ; #1 - low byte object address 413 28000 ???? 414 28000 ???? iny 415 28000 ???? 416 28000 ???? lda #({1}_mode | %01000000) 417 28000 ???? sta (dlpnt),y ; #2 - graphics mode , indirect 418 28000 ???? 419 28000 ???? iny 420 28000 ???? 421 28000 ???? lda .SpriteY 422 28000 ???? and #(WZONEHEIGHT - 1) 423 28000 ???? ora #>(.GFXLabel - (WZONEHEIGHT * 256)) ; start in the dma hole 424 28000 ???? sta (dlpnt),y ; #3 - hi byte object address 425 28000 ???? 426 28000 ???? iny 427 28000 ???? 428 28000 ???? lda #({1}_width_twoscompliment | (.Palette * 32)) 429 28000 ???? sta (dlpnt),y ; #4 - palette|width 430 28000 ???? 431 28000 ???? iny 432 28000 ???? 433 28000 ???? lda .SpriteX 434 28000 ???? sta (dlpnt),y ; #5 - x object position 435 28000 ???? 436 28000 ???? iny 437 28000 ???? sty dlend,x 438 28000 ???? 439 28000 ???? ifconst ALWAYSTERMINATE 440 28000 ???? iny 441 28000 ???? lda #0 442 28000 ???? sta (dlpnt),y 443 28000 ???? endif 444 28000 ???? 445 28000 ???? .PLOTSPRITEend 446 28000 ???? ENDM 447 28000 ???? 448 28000 ???? MAC sizeof 449 28000 ???? 450 28000 ???? ; echo's the size difference between the current address and the 451 28000 ???? ; a label that was passed as an argument. This is a quick way to 452 28000 ???? ; determine the size of a structure. 453 28000 ???? 454 28000 ???? .NAME SETSTR {1} 455 28000 ???? echo " The Size of",.NAME,"is:",[* - {1}]d,[* - {2}]d,"bytes." 456 28000 ???? ENDM 457 28000 ???? 458 28000 ???? ; 459 28000 ???? ; speakjet.inc 460 28000 ???? ; 461 28000 ???? ; 462 28000 ???? ; AtariVox Speech Synth Driver 463 28000 ???? ; 464 28000 ???? ; By Alex Herbert, 2004 465 28000 ???? ; 466 28000 ???? 467 28000 ???? 468 28000 ???? 469 28000 ???? 470 28000 ???? ; Constants 471 28000 ???? 472 28000 ???? 473 28000 ???? 00 01 SERIAL_OUTMASK equ $01 474 28000 ???? 00 02 SERIAL_RDYMASK equ $02 475 28000 ???? 476 28000 ???? 477 28000 ???? 478 28000 ???? ; Macros 479 28000 ???? 480 28000 ???? mac spkout 481 28000 ???? 482 28000 ???? ; check buffer-full status 483 28000 ???? lda SWCHA 484 28000 ???? and #SERIAL_RDYMASK 485 28000 ???? beq .speech_done 486 28000 ???? 487 28000 ???? ; get next speech byte 488 28000 ???? ldy #$00 489 28000 ???? lda (speech_addr),y 490 28000 ???? 491 28000 ???? ; invert data and check for end of string 492 28000 ???? eor #$ff 493 28000 ???? ;sta BACKGRND ; debug - uncomment to flash the background color with vox data 494 28000 ???? beq .speech_done 495 28000 ???? sta {1} 496 28000 ???? 497 28000 ???? ; increment speech pointer 498 28000 ???? inc speech_addr 499 28000 ???? bne .incaddr_skip 500 28000 ???? inc speech_addr+1 501 28000 ???? .incaddr_skip 502 28000 ???? 503 28000 ???? ; output byte as serial data 504 28000 ???? 505 28000 ???? sec ; start bit 506 28000 ???? .byteout_loop 507 28000 ???? ; put carry flag into bit 0 of SWACNT, perserving other bits 508 28000 ???? lda SWACNT ; 4 509 28000 ???? and #$fe ; 2 6 510 28000 ???? adc #$00 ; 2 8 511 28000 ???? sta SWACNT ; 4 12 512 28000 ???? 513 28000 ???? ; 10 bits sent? (1 start bit, 8 data bits, 1 stop bit) 514 28000 ???? cpy #$09 ; 2 14 515 28000 ???? beq .speech_done ; 2 16 516 28000 ???? iny ; 2 18 517 28000 ???? 518 28000 ???? ; the 7800 is 1.5x faster than the 2600. Waste more cycles here 519 28000 ???? ; to match the original baud rate... 520 28000 ???? ;ldx #$07 ; 2600 521 28000 ???? ldx #$0D 522 28000 ???? 523 28000 ???? .delay_loop 524 28000 ???? dex ; 525 28000 ???? bne .delay_loop ; 36 54 526 28000 ???? 527 28000 ???? ; shift next data bit into carry 528 28000 ???? lsr {1} ; 5 59 529 28000 ???? 530 28000 ???? ; and loop (branch always taken) 531 28000 ???? bpl .byteout_loop ; 3 62 cycles for loop 532 28000 ???? 533 28000 ???? .speech_done 534 28000 ???? 535 28000 ???? endm 536 28000 ???? 537 28000 ???? 538 28000 ???? mac speak 539 28000 ???? 540 28000 ???? lda #<{1} 541 28000 ???? sta speech_addr 542 28000 ???? lda #>{1} 543 28000 ???? sta speech_addr+1 544 28000 ???? 545 28000 ???? endm 546 28000 ???? 547 28000 ???? 548 28000 ???? 549 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 550 28000 ???? 551 28000 ???? processor 6502 552 28000 ???? ------- FILE 7800basic.h LEVEL 2 PASS 3 0 28000 ???? include "7800basic.h" 1 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 28000 ???? 3 28000 ???? processor 6502 ------- FILE 7800.h LEVEL 3 PASS 3 0 28000 ???? include "7800.h" 1 28000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 28000 ???? 3 28000 ???? ; 7800.h 4 28000 ???? ; Version 1.0, 2019/12/13 5 28000 ???? 6 28000 ???? ; This file defines hardware registers and memory mapping for the 7 28000 ???? ; Atari 7800. It is distributed as a companion machine-specific support package 8 28000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are 9 28000 ???? ; available at https://github.com/dasm-assembler/dasm 10 28000 ???? 11 28000 ???? 12 28000 ???? ; ******************** 7800 Hardware Adresses *************************** 13 28000 ???? ; 14 28000 ???? ; MEMORY MAP USAGE OF THE 7800 15 28000 ???? ; 16 28000 ???? ; 00 - 1F TIA REGISTERS 17 28000 ???? ; 20 - 3F MARIA REGISTERS 18 28000 ???? ; 40 - FF RAM block 0 (zero page) 19 28000 ???? ; 100 - 11F TIA (mirror of 0000-001f) 20 28000 ???? ; 120 - 13F MARIA (mirror of 0020-003f) 21 28000 ???? ; 140 - 1FF RAM block 1 (stack) 22 28000 ???? ; 200 - 21F TIA (mirror of 0000-001f) 23 28000 ???? ; 220 - 23F MARIA (mirror of 0020-003f) 24 28000 ???? ; 240 - 27F ??? 25 28000 ???? ; 280 - 2FF RIOT I/O ports and timers 26 28000 ???? ; 300 - 31F TIA (mirror of 0000-001f) 27 28000 ???? ; 320 - 33F MARIA (mirror of 0020-003f) 28 28000 ???? ; 340 - 3FF ??? 29 28000 ???? ; 400 - 47F unused address space 30 28000 ???? ; 480 - 4FF RIOT RAM 31 28000 ???? ; 500 - 57F unused address space 32 28000 ???? ; 580 - 5FF RIOT RAM (mirror of 0480-04ff) 33 28000 ???? ; 600 - 17FF unused address space 34 28000 ???? ; 1800 - 203F RAM 35 28000 ???? ; 2040 - 20FF RAM block 0 (mirror of 0000-001f) 36 28000 ???? ; 2100 - 213F RAM 37 28000 ???? ; 2140 - 21FF RAM block 1 (mirror of 0140-01ff) 38 28000 ???? ; 2200 - 27FF RAM 39 28000 ???? ; 2800 - 2FFF mirror of 1800-27ff 40 28000 ???? ; 3000 - 3FFF unused address space 41 28000 ???? ; 4000 - FF7F potential cartridge address space 42 28000 ???? ; FF80 - FFF9 RESERVED FOR ENCRYPTION 43 28000 ???? ; FFFA - FFFF 6502 VECTORS 44 28000 ???? 45 28000 ???? 46 28000 ???? ;****** 00-1F ********* TIA REGISTERS ****************** 47 28000 ???? 48 28000 ???? 00 01 INPTCTRL = $01 ;Input control. In same address space as TIA. write-only 49 28000 ???? 00 01 VBLANK = $01 ;VBLANK. D7=1:dump paddle caps to ground. write-only 50 28000 ???? 00 08 INPT0 = $08 ;Paddle Control Input 0 read-only 51 28000 ???? 00 09 INPT1 = $09 ;Paddle Control Input 1 read-only 52 28000 ???? 00 0a INPT2 = $0A ;Paddle Control Input 2 read-only 53 28000 ???? 00 0b INPT3 = $0B ;Paddle Control Input 3 read-only 54 28000 ???? 55 28000 ???? ; ** some common alternate names for INPT0/1/2/3 56 28000 ???? 00 08 INPT4B = $08 ;Joystick 0 Fire 1 read-only 57 28000 ???? 00 09 INPT4A = $09 ;Joystick 0 Fire 1 read-only 58 28000 ???? 00 0a INPT5B = $0A ;Joystick 1 Fire 0 read-only 59 28000 ???? 00 0b INPT5A = $0B ;Joystick 1 Fire 1 read-only 60 28000 ???? 00 08 INPT4R = $08 ;Joystick 0 Fire 1 read-only 61 28000 ???? 00 09 INPT4L = $09 ;Joystick 0 Fire 1 read-only 62 28000 ???? 00 0a INPT5R = $0A ;Joystick 1 Fire 0 read-only 63 28000 ???? 00 0b INPT5L = $0B ;Joystick 1 Fire 1 read-only 64 28000 ???? 65 28000 ???? 00 0c INPT4 = $0C ;Player 0 Fire Button Input read-only 66 28000 ???? 00 0d INPT5 = $0D ;Player 1 Fire Button Input read-only 67 28000 ???? 68 28000 ???? 00 15 AUDC0 = $15 ;Audio Control Channel 0 write-only 69 28000 ???? 00 16 AUDC1 = $16 ;Audio Control Channel 1 write-only 70 28000 ???? 00 17 AUDF0 = $17 ;Audio Frequency Channel 0 write-only 71 28000 ???? 00 18 AUDF1 = $18 ;Audio Frequency Channel 1 write-only 72 28000 ???? 00 19 AUDV0 = $19 ;Audio Volume Channel 0 write-only 73 28000 ???? 00 1a AUDV1 = $1A ;Audio Volume Channel 1 write-only 74 28000 ???? 75 28000 ???? ;****** 20-3F ********* MARIA REGISTERS *************** 76 28000 ???? 77 28000 ???? 00 20 BACKGRND = $20 ;Background Color write-only 78 28000 ???? 00 21 P0C1 = $21 ;Palette 0 - Color 1 write-only 79 28000 ???? 00 22 P0C2 = $22 ;Palette 0 - Color 2 write-only 80 28000 ???? 00 23 P0C3 = $23 ;Palette 0 - Color 3 write-only 81 28000 ???? 00 24 WSYNC = $24 ;Wait For Sync write-only 82 28000 ???? 00 25 P1C1 = $25 ;Palette 1 - Color 1 write-only 83 28000 ???? 00 26 P1C2 = $26 ;Palette 1 - Color 2 write-only 84 28000 ???? 00 27 P1C3 = $27 ;Palette 1 - Color 3 write-only 85 28000 ???? 00 28 MSTAT = $28 ;Maria Status read-only 86 28000 ???? 00 29 P2C1 = $29 ;Palette 2 - Color 1 write-only 87 28000 ???? 00 2a P2C2 = $2A ;Palette 2 - Color 2 write-only 88 28000 ???? 00 2b P2C3 = $2B ;Palette 2 - Color 3 write-only 89 28000 ???? 00 2c DPPH = $2C ;Display List List Pointer High write-only 90 28000 ???? 00 2d P3C1 = $2D ;Palette 3 - Color 1 write-only 91 28000 ???? 00 2e P3C2 = $2E ;Palette 3 - Color 2 write-only 92 28000 ???? 00 2f P3C3 = $2F ;Palette 3 - Color 3 write-only 93 28000 ???? 00 30 DPPL = $30 ;Display List List Pointer Low write-only 94 28000 ???? 00 31 P4C1 = $31 ;Palette 4 - Color 1 write-only 95 28000 ???? 00 32 P4C2 = $32 ;Palette 4 - Color 2 write-only 96 28000 ???? 00 33 P4C3 = $33 ;Palette 4 - Color 3 write-only 97 28000 ???? 00 34 CHARBASE = $34 ;Character Base Address write-only 98 28000 ???? 00 34 CHBASE = $34 ;Character Base Address write-only 99 28000 ???? 00 35 P5C1 = $35 ;Palette 5 - Color 1 write-only 100 28000 ???? 00 36 P5C2 = $36 ;Palette 5 - Color 2 write-only 101 28000 ???? 00 37 P5C3 = $37 ;Palette 5 - Color 3 write-only 102 28000 ???? 00 38 OFFSET = $38 ;Unused - Store zero here write-only 103 28000 ???? 00 39 P6C1 = $39 ;Palette 6 - Color 1 write-only 104 28000 ???? 00 3a P6C2 = $3A ;Palette 6 - Color 2 write-only 105 28000 ???? 00 3b P6C3 = $3B ;Palette 6 - Color 3 write-only 106 28000 ???? 00 3c CTRL = $3C ;Maria Control Register write-only 107 28000 ???? 00 3d P7C1 = $3D ;Palette 7 - Color 1 write-only 108 28000 ???? 00 3e P7C2 = $3E ;Palette 7 - Color 2 write-only 109 28000 ???? 00 3f P7C3 = $3F ;Palette 7 - Color 3 write-only 110 28000 ???? 111 28000 ???? 112 28000 ???? ;****** 280-2FF ******* PIA PORTS AND TIMERS ************ 113 28000 ???? 114 28000 ???? 02 80 SWCHA = $280 ;P0+P1 Joystick Directional Input read-write 115 28000 ???? 02 81 CTLSWA = $281 ;I/O Control for SCHWA read-write 116 28000 ???? 02 81 SWACNT = $281 ;VCS name for above read-write 117 28000 ???? 02 82 SWCHB = $282 ;Console Switches read-write 118 28000 ???? 02 83 CTLSWB = $283 ;I/O Control for SCHWB read-write 119 28000 ???? 02 83 SWBCNT = $283 ;VCS name for above read-write 120 28000 ???? 121 28000 ???? 02 84 INTIM = $284 ;Interval Timer Read read-only 122 28000 ???? 02 94 TIM1T = $294 ;Set 1 CLK Interval (838 nsec/interval) write-only 123 28000 ???? 02 95 TIMINT = $295 ;Interval Timer Interrupt read-only 124 28000 ???? 02 95 TIM8T = $295 ;Set 8 CLK Interval (6.7 usec/interval) write-only 125 28000 ???? 02 96 TIM64T = $296 ;Set 64 CLK Interval (63.6 usec/interval) write-only 126 28000 ???? 02 97 T1024T = $297 ;Set 1024 CLK Interval (858.2 usec/interval) write-only 127 28000 ???? 02 9e TIM64TI = $29E ;Interrupt timer 64T write-only 128 28000 ???? 129 28000 ???? ;XM 130 28000 ???? 04 70 XCTRL = $470 ; 7=YM2151 6=RAM@6k 5=RAM@4k 4=pokey@450 3=hsc 2=cart 1=RoF_bank1 0=RoF_bank2 131 28000 ???? 04 70 XCTRL1 = $470 132 28000 ???? 04 78 XCTRL2 = $478 133 28000 ???? 04 7c XCTRL3 = $47c 134 28000 ???? 04 71 XCTRL4 = $471 135 28000 ???? 04 72 XCTRL5 = $472 136 28000 ???? 137 28000 ???? ; Pokey register relative locations, since its base may be different 138 28000 ???? ; depending on the hardware. 139 28000 ???? 00 00 PAUDF0 = $0 ; extra audio channels and frequencies 140 28000 ???? 00 01 PAUDC0 = $1 141 28000 ???? 00 02 PAUDF1 = $2 142 28000 ???? 00 03 PAUDC1 = $3 143 28000 ???? 00 04 PAUDF2 = $4 144 28000 ???? 00 05 PAUDC2 = $5 145 28000 ???? 00 06 PAUDF3 = $6 146 28000 ???? 00 07 PAUDC3 = $7 147 28000 ???? 00 08 PAUDCTL = $8 ; Audio Control 148 28000 ???? 00 09 PSTIMER = $9 149 28000 ???? 00 0a PRANDOM = $A ; 17 bit polycounter pseudo random 150 28000 ???? 00 0f PSKCTL = $F ; Serial Port control ------- FILE 7800basic.h ------- FILE 7800basic_variable_redefs.h LEVEL 3 PASS 3 0 28000 ???? include "7800basic_variable_redefs.h" 1 28000 ???? ; This file contains variable mapping and other information for the current project. 2 28000 ???? 3 28000 ???? 00 00 vertical_shooting_laser_tallsprite_01_mode = $00 4 28000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width_twoscompliment = $00 5 28000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width = $00 6 28000 ???? 00 00 vertical_shooting_laser_tallsprite_00_mode = $00 7 28000 ???? 00 1f vertical_shooting_laser_tallsprite_00_width_twoscompliment = $1f 8 28000 ???? 00 01 vertical_shooting_laser_tallsprite_00_width = $01 9 28000 ???? 00 00 vertical_shooting_laser_mode = $00 10 28000 ???? 00 1f vertical_shooting_laser_width_twoscompliment = $1f 11 28000 ???? 00 01 vertical_shooting_laser_width = $01 12 28000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_mode = $00 13 28000 ???? 00 0c vertical_shooting_explosion_10_tallsprite_00_width_twoscompliment = $0c 14 28000 ???? 00 14 vertical_shooting_explosion_10_tallsprite_00_width = $14 15 28000 ???? 00 00 vertical_shooting_explosion_10_mode = $00 16 28000 ???? 00 0c vertical_shooting_explosion_10_width_twoscompliment = $0c 17 28000 ???? 00 14 vertical_shooting_explosion_10_width = $14 18 28000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_mode = $00 19 28000 ???? 00 0c vertical_shooting_explosion_09_tallsprite_00_width_twoscompliment = $0c 20 28000 ???? 00 14 vertical_shooting_explosion_09_tallsprite_00_width = $14 21 28000 ???? 00 00 vertical_shooting_explosion_09_mode = $00 22 28000 ???? 00 0c vertical_shooting_explosion_09_width_twoscompliment = $0c 23 28000 ???? 00 14 vertical_shooting_explosion_09_width = $14 24 28000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_mode = $00 25 28000 ???? 00 0c vertical_shooting_explosion_08_tallsprite_00_width_twoscompliment = $0c 26 28000 ???? 00 14 vertical_shooting_explosion_08_tallsprite_00_width = $14 27 28000 ???? 00 00 vertical_shooting_explosion_08_mode = $00 28 28000 ???? 00 0c vertical_shooting_explosion_08_width_twoscompliment = $0c 29 28000 ???? 00 14 vertical_shooting_explosion_08_width = $14 30 28000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_mode = $00 31 28000 ???? 00 0c vertical_shooting_explosion_07_tallsprite_00_width_twoscompliment = $0c 32 28000 ???? 00 14 vertical_shooting_explosion_07_tallsprite_00_width = $14 33 28000 ???? 00 00 vertical_shooting_explosion_07_mode = $00 34 28000 ???? 00 0c vertical_shooting_explosion_07_width_twoscompliment = $0c 35 28000 ???? 00 14 vertical_shooting_explosion_07_width = $14 36 28000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_mode = $00 37 28000 ???? 00 1e vertical_shooting_explosion_06_tallsprite_00_width_twoscompliment = $1e 38 28000 ???? 00 02 vertical_shooting_explosion_06_tallsprite_00_width = $02 39 28000 ???? 00 00 vertical_shooting_explosion_06_mode = $00 40 28000 ???? 00 1e vertical_shooting_explosion_06_width_twoscompliment = $1e 41 28000 ???? 00 02 vertical_shooting_explosion_06_width = $02 42 28000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_mode = $00 43 28000 ???? 00 1e vertical_shooting_explosion_05_tallsprite_00_width_twoscompliment = $1e 44 28000 ???? 00 02 vertical_shooting_explosion_05_tallsprite_00_width = $02 45 28000 ???? 00 00 vertical_shooting_explosion_05_mode = $00 46 28000 ???? 00 1e vertical_shooting_explosion_05_width_twoscompliment = $1e 47 28000 ???? 00 02 vertical_shooting_explosion_05_width = $02 48 28000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_mode = $00 49 28000 ???? 00 1e vertical_shooting_explosion_04_tallsprite_00_width_twoscompliment = $1e 50 28000 ???? 00 02 vertical_shooting_explosion_04_tallsprite_00_width = $02 51 28000 ???? 00 00 vertical_shooting_explosion_04_mode = $00 52 28000 ???? 00 1e vertical_shooting_explosion_04_width_twoscompliment = $1e 53 28000 ???? 00 02 vertical_shooting_explosion_04_width = $02 54 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_mode = $00 55 28000 ???? 00 1e vertical_shooting_explosion_03_tallsprite_00_width_twoscompliment = $1e 56 28000 ???? 00 02 vertical_shooting_explosion_03_tallsprite_00_width = $02 57 28000 ???? 00 00 vertical_shooting_explosion_03_mode = $00 58 28000 ???? 00 1e vertical_shooting_explosion_03_width_twoscompliment = $1e 59 28000 ???? 00 02 vertical_shooting_explosion_03_width = $02 60 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_mode = $00 61 28000 ???? 00 1e vertical_shooting_explosion_02_tallsprite_00_width_twoscompliment = $1e 62 28000 ???? 00 02 vertical_shooting_explosion_02_tallsprite_00_width = $02 63 28000 ???? 00 00 vertical_shooting_explosion_02_mode = $00 64 28000 ???? 00 1e vertical_shooting_explosion_02_width_twoscompliment = $1e 65 28000 ???? 00 02 vertical_shooting_explosion_02_width = $02 66 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_mode = $00 67 28000 ???? 00 1e vertical_shooting_explosion_01_tallsprite_00_width_twoscompliment = $1e 68 28000 ???? 00 02 vertical_shooting_explosion_01_tallsprite_00_width = $02 69 28000 ???? 00 00 vertical_shooting_explosion_01_mode = $00 70 28000 ???? 00 1e vertical_shooting_explosion_01_width_twoscompliment = $1e 71 28000 ???? 00 02 vertical_shooting_explosion_01_width = $02 72 28000 ???? 00 00 vertical_shooting_1up_mode = $00 73 28000 ???? 00 1e vertical_shooting_1up_width_twoscompliment = $1e 74 28000 ???? 00 02 vertical_shooting_1up_width = $02 75 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_mode = $00 76 28000 ???? 00 1e vertical_shooting_enemy01_tallsprite_00_width_twoscompliment = $1e 77 28000 ???? 00 02 vertical_shooting_enemy01_tallsprite_00_width = $02 78 28000 ???? 00 00 vertical_shooting_enemy01_mode = $00 79 28000 ???? 00 1e vertical_shooting_enemy01_width_twoscompliment = $1e 80 28000 ???? 00 02 vertical_shooting_enemy01_width = $02 81 28000 ???? 00 00 vertical_shooting_powerup_mode = $00 82 28000 ???? 00 1e vertical_shooting_powerup_width_twoscompliment = $1e 83 28000 ???? 00 02 vertical_shooting_powerup_width = $02 84 28000 ???? 00 00 vertical_shooting_enemyshot_mode = $00 85 28000 ???? 00 1f vertical_shooting_enemyshot_width_twoscompliment = $1f 86 28000 ???? 00 01 vertical_shooting_enemyshot_width = $01 87 28000 ???? 00 00 vertical_shooting_bullet_mode = $00 88 28000 ???? 00 1f vertical_shooting_bullet_width_twoscompliment = $1f 89 28000 ???? 00 01 vertical_shooting_bullet_width = $01 90 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_mode = $00 91 28000 ???? 00 1e vertical_shooting_ship_tallsprite_00_width_twoscompliment = $1e 92 28000 ???? 00 02 vertical_shooting_ship_tallsprite_00_width = $02 93 28000 ???? 00 00 vertical_shooting_ship_mode = $00 94 28000 ???? 00 1e vertical_shooting_ship_width_twoscompliment = $1e 95 28000 ???? 00 02 vertical_shooting_ship_width = $02 96 28000 ???? 00 00 vertical_shooting_font_mode = $00 97 28000 ???? 00 13 vertical_shooting_font_width_twoscompliment = $13 98 28000 ???? 00 2d vertical_shooting_font_width = $2d 99 28000 ???? 00 90 sfx_explosion_length = .skipL0338-sfx_explosion 100 28000 ???? 101 28000 ???? 00 30 sfx_plainlaser_length = .skipL0337-sfx_plainlaser 102 28000 ???? 103 28000 ???? 00 54 sfx_pulsecannon_length = .skipL0336-sfx_pulsecannon 104 28000 ???? 105 28000 ???? 00 36 sfx_bling_length = .skipL0335-sfx_bling 106 28000 ???? 107 28000 ???? 00 01 BOXCOLLISION = 1 108 28000 ???? 00 00 FALSE = 0 109 28000 ???? 110 28000 ???? 00 01 TRUE = 1 111 28000 ???? 112 28000 ???? 00 0f firing_rate = 15 113 28000 ???? 114 28000 ???? 00 04 vertical_shooting_laser_tallsprite_00_color3 = $04 115 28000 ???? 00 42 vertical_shooting_laser_tallsprite_00_color2 = $42 116 28000 ???? 00 0f vertical_shooting_laser_tallsprite_00_color1 = $0f 117 28000 ???? 00 00 vertical_shooting_laser_tallsprite_00_color0 = $00 118 28000 ???? 00 04 vertical_shooting_laser_color3 = $04 119 28000 ???? 00 42 vertical_shooting_laser_color2 = $42 120 28000 ???? 00 0f vertical_shooting_laser_color1 = $0f 121 28000 ???? 00 00 vertical_shooting_laser_color0 = $00 122 28000 ???? 00 33 vertical_shooting_explosion_10_tallsprite_00_color3 = $33 123 28000 ???? 00 2b vertical_shooting_explosion_10_tallsprite_00_color2 = $2b 124 28000 ???? 00 36 vertical_shooting_explosion_10_tallsprite_00_color1 = $36 125 28000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_color0 = $00 126 28000 ???? 00 33 vertical_shooting_explosion_10_color3 = $33 127 28000 ???? 00 2b vertical_shooting_explosion_10_color2 = $2b 128 28000 ???? 00 36 vertical_shooting_explosion_10_color1 = $36 129 28000 ???? 00 00 vertical_shooting_explosion_10_color0 = $00 130 28000 ???? 00 33 vertical_shooting_explosion_09_tallsprite_00_color3 = $33 131 28000 ???? 00 2b vertical_shooting_explosion_09_tallsprite_00_color2 = $2b 132 28000 ???? 00 36 vertical_shooting_explosion_09_tallsprite_00_color1 = $36 133 28000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_color0 = $00 134 28000 ???? 00 33 vertical_shooting_explosion_09_color3 = $33 135 28000 ???? 00 2b vertical_shooting_explosion_09_color2 = $2b 136 28000 ???? 00 36 vertical_shooting_explosion_09_color1 = $36 137 28000 ???? 00 00 vertical_shooting_explosion_09_color0 = $00 138 28000 ???? 00 33 vertical_shooting_explosion_08_tallsprite_00_color3 = $33 139 28000 ???? 00 2b vertical_shooting_explosion_08_tallsprite_00_color2 = $2b 140 28000 ???? 00 36 vertical_shooting_explosion_08_tallsprite_00_color1 = $36 141 28000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_color0 = $00 142 28000 ???? 00 33 vertical_shooting_explosion_08_color3 = $33 143 28000 ???? 00 2b vertical_shooting_explosion_08_color2 = $2b 144 28000 ???? 00 36 vertical_shooting_explosion_08_color1 = $36 145 28000 ???? 00 00 vertical_shooting_explosion_08_color0 = $00 146 28000 ???? 00 33 vertical_shooting_explosion_07_tallsprite_00_color3 = $33 147 28000 ???? 00 2b vertical_shooting_explosion_07_tallsprite_00_color2 = $2b 148 28000 ???? 00 36 vertical_shooting_explosion_07_tallsprite_00_color1 = $36 149 28000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_color0 = $00 150 28000 ???? 00 33 vertical_shooting_explosion_07_color3 = $33 151 28000 ???? 00 2b vertical_shooting_explosion_07_color2 = $2b 152 28000 ???? 00 36 vertical_shooting_explosion_07_color1 = $36 153 28000 ???? 00 00 vertical_shooting_explosion_07_color0 = $00 154 28000 ???? 00 33 vertical_shooting_explosion_06_tallsprite_00_color3 = $33 155 28000 ???? 00 2b vertical_shooting_explosion_06_tallsprite_00_color2 = $2b 156 28000 ???? 00 36 vertical_shooting_explosion_06_tallsprite_00_color1 = $36 157 28000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_color0 = $00 158 28000 ???? 00 33 vertical_shooting_explosion_06_color3 = $33 159 28000 ???? 00 2b vertical_shooting_explosion_06_color2 = $2b 160 28000 ???? 00 36 vertical_shooting_explosion_06_color1 = $36 161 28000 ???? 00 00 vertical_shooting_explosion_06_color0 = $00 162 28000 ???? 00 33 vertical_shooting_explosion_05_tallsprite_00_color3 = $33 163 28000 ???? 00 2b vertical_shooting_explosion_05_tallsprite_00_color2 = $2b 164 28000 ???? 00 36 vertical_shooting_explosion_05_tallsprite_00_color1 = $36 165 28000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_color0 = $00 166 28000 ???? 00 33 vertical_shooting_explosion_05_color3 = $33 167 28000 ???? 00 2b vertical_shooting_explosion_05_color2 = $2b 168 28000 ???? 00 36 vertical_shooting_explosion_05_color1 = $36 169 28000 ???? 00 00 vertical_shooting_explosion_05_color0 = $00 170 28000 ???? 00 33 vertical_shooting_explosion_04_tallsprite_00_color3 = $33 171 28000 ???? 00 36 vertical_shooting_explosion_04_tallsprite_00_color2 = $36 172 28000 ???? 00 2b vertical_shooting_explosion_04_tallsprite_00_color1 = $2b 173 28000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_color0 = $00 174 28000 ???? 00 33 vertical_shooting_explosion_04_color3 = $33 175 28000 ???? 00 36 vertical_shooting_explosion_04_color2 = $36 176 28000 ???? 00 2b vertical_shooting_explosion_04_color1 = $2b 177 28000 ???? 00 00 vertical_shooting_explosion_04_color0 = $00 178 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color3 = 0 179 28000 ???? 00 36 vertical_shooting_explosion_03_tallsprite_00_color2 = $36 180 28000 ???? 00 2b vertical_shooting_explosion_03_tallsprite_00_color1 = $2b 181 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color0 = $00 182 28000 ???? 00 00 vertical_shooting_explosion_03_color3 = 0 183 28000 ???? 00 36 vertical_shooting_explosion_03_color2 = $36 184 28000 ???? 00 2b vertical_shooting_explosion_03_color1 = $2b 185 28000 ???? 00 00 vertical_shooting_explosion_03_color0 = $00 186 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color3 = 0 187 28000 ???? 00 36 vertical_shooting_explosion_02_tallsprite_00_color2 = $36 188 28000 ???? 00 2b vertical_shooting_explosion_02_tallsprite_00_color1 = $2b 189 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color0 = $00 190 28000 ???? 00 00 vertical_shooting_explosion_02_color3 = 0 191 28000 ???? 00 36 vertical_shooting_explosion_02_color2 = $36 192 28000 ???? 00 2b vertical_shooting_explosion_02_color1 = $2b 193 28000 ???? 00 00 vertical_shooting_explosion_02_color0 = $00 194 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color3 = 0 195 28000 ???? 00 2b vertical_shooting_explosion_01_tallsprite_00_color2 = $2b 196 28000 ???? 00 36 vertical_shooting_explosion_01_tallsprite_00_color1 = $36 197 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color0 = $00 198 28000 ???? 00 00 vertical_shooting_explosion_01_color3 = 0 199 28000 ???? 00 2b vertical_shooting_explosion_01_color2 = $2b 200 28000 ???? 00 36 vertical_shooting_explosion_01_color1 = $36 201 28000 ???? 00 00 vertical_shooting_explosion_01_color0 = $00 202 28000 ???? 00 0f vertical_shooting_1up_color3 = $0f 203 28000 ???? 00 42 vertical_shooting_1up_color2 = $42 204 28000 ???? 00 04 vertical_shooting_1up_color1 = $04 205 28000 ???? 00 00 vertical_shooting_1up_color0 = $00 206 28000 ???? 00 83 vertical_shooting_enemy01_tallsprite_00_color3 = $83 207 28000 ???? 00 a8 vertical_shooting_enemy01_tallsprite_00_color2 = $a8 208 28000 ???? 00 bc vertical_shooting_enemy01_tallsprite_00_color1 = $bc 209 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_color0 = $00 210 28000 ???? 00 83 vertical_shooting_enemy01_color3 = $83 211 28000 ???? 00 a8 vertical_shooting_enemy01_color2 = $a8 212 28000 ???? 00 bc vertical_shooting_enemy01_color1 = $bc 213 28000 ???? 00 00 vertical_shooting_enemy01_color0 = $00 214 28000 ???? 00 36 vertical_shooting_powerup_color3 = $36 215 28000 ???? 00 33 vertical_shooting_powerup_color2 = $33 216 28000 ???? 00 2b vertical_shooting_powerup_color1 = $2b 217 28000 ???? 00 00 vertical_shooting_powerup_color0 = $00 218 28000 ???? 00 bc vertical_shooting_enemyshot_color3 = $bc 219 28000 ???? 00 83 vertical_shooting_enemyshot_color2 = $83 220 28000 ???? 00 a8 vertical_shooting_enemyshot_color1 = $a8 221 28000 ???? 00 00 vertical_shooting_enemyshot_color0 = $00 222 28000 ???? 00 1d vertical_shooting_bullet_color3 = $1d 223 28000 ???? 00 18 vertical_shooting_bullet_color2 = $18 224 28000 ???? 00 0f vertical_shooting_bullet_color1 = $0f 225 28000 ???? 00 00 vertical_shooting_bullet_color0 = $00 226 28000 ???? 00 42 vertical_shooting_ship_tallsprite_00_color3 = $42 227 28000 ???? 00 04 vertical_shooting_ship_tallsprite_00_color2 = $04 228 28000 ???? 00 0f vertical_shooting_ship_tallsprite_00_color1 = $0f 229 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_color0 = $00 230 28000 ???? 00 42 vertical_shooting_ship_color3 = $42 231 28000 ???? 00 04 vertical_shooting_ship_color2 = $04 232 28000 ???? 00 0f vertical_shooting_ship_color1 = $0f 233 28000 ???? 00 00 vertical_shooting_ship_color0 = $00 234 28000 ???? 00 0f vertical_shooting_font_color1 = $0f 235 28000 ???? 00 00 vertical_shooting_font_color0 = $00 236 28000 ???? 00 e9 customTemp4 = d 237 28000 ???? 238 28000 ???? 00 e8 customTemp3 = c 239 28000 ???? 240 28000 ???? 00 e7 customTemp2 = b 241 28000 ???? 242 28000 ???? 00 e6 customTemp1 = a 243 28000 ???? 244 28000 ???? 01 77 enemy01_Slowdown = var55 245 28000 ???? 246 28000 ???? 01 9c mob_X = var92 247 28000 ???? 01 9e mob_Y = var94 248 28000 ???? 01 a0 mob_speedX = var96 249 28000 ???? 01 a2 mob_speedY = var98 250 28000 ???? 01 73 temp_speedY = temp_YSu 251 28000 ???? 01 74 temp_YSf = var52 252 28000 ???? 253 28000 ???? 01 73 temp_YSu = var51 254 28000 ???? 255 28000 ???? 01 71 temp_speedX = temp_XSu 256 28000 ???? 01 72 temp_XSf = var50 257 28000 ???? 258 28000 ???? 01 71 temp_XSu = var49 259 28000 ???? 260 28000 ???? 01 6f total_speedY = total_YSu 261 28000 ???? 01 70 total_YSf = var48 262 28000 ???? 263 28000 ???? 01 6f total_YSu = var47 264 28000 ???? 265 28000 ???? 01 6d total_speedX = total_XSu 266 28000 ???? 01 6e total_XSf = var46 267 28000 ???? 268 28000 ???? 01 6d total_XSu = var45 269 28000 ???? 270 28000 ???? 22 50 enemy_shotSYf = $2250 271 28000 ???? 272 28000 ???? 22 40 enemy_shotSXf = $2240 273 28000 ???? 274 28000 ???? 22 30 enemy_shotSY = $2230 275 28000 ???? 276 28000 ???? 22 20 enemy_shotSX = $2220 277 28000 ???? 278 28000 ???? 22 10 enemy_shotYf = $2210 279 28000 ???? 280 28000 ???? 22 00 enemy_shotXf = $2200 281 28000 ???? 282 28000 ???? 01 6c enemy_shotDirection = var44 283 28000 ???? 284 28000 ???? 01 6b timer = var43 285 28000 ???? 286 28000 ???? 01 6a isDead_flag = var42 287 28000 ???? 288 28000 ???? 01 69 continue_flag = var41 289 28000 ???? 290 28000 ???? 01 68 twinlaser_Slowdown = var40 291 28000 ???? 292 28000 ???? 01 67 twinlaser_flag = var39 293 28000 ???? 294 28000 ???? 01 66 twinlaserY = var38 295 28000 ???? 296 28000 ???? 01 65 twinlaserX = var37 297 28000 ???? 298 28000 ???? 01 64 lives = var36 299 28000 ???? 300 28000 ???? 01 63 explosion_aniframe = var35 301 28000 ???? 302 28000 ???? 01 62 extra_shipFlag = var34 303 28000 ???? 304 28000 ???? 01 61 extra_shipY = var33 305 28000 ???? 306 28000 ???? 01 60 extra_shipX = var32 307 28000 ???? 308 28000 ???? 01 5f gameover_flag = var31 309 28000 ???? 310 28000 ???? 01 5e enemy01_speed = var30 311 28000 ???? 312 28000 ???? 01 5d rMovement6 = var29 313 28000 ???? 314 28000 ???? 01 5c rMovement5 = var28 315 28000 ???? 316 28000 ???? 01 5b rMovement4 = var27 317 28000 ???? 318 28000 ???? 01 5a rMovement3 = var26 319 28000 ???? 320 28000 ???? 01 59 enemy01_Flag = var25 321 28000 ???? 322 28000 ???? 01 58 enemy01_Y = var24 323 28000 ???? 324 28000 ???? 01 57 enemy01_X = var23 325 28000 ???? 326 28000 ???? 01 56 enemy_shotSlowdown = var22 327 28000 ???? 328 28000 ???? 01 55 bulletSlowdown = var21 329 28000 ???? 330 28000 ???? 01 54 power_upSlowdown = var20 331 28000 ???? 332 28000 ???? 01 53 rMovement2 = var19 333 28000 ???? 334 28000 ???? 01 52 power_upFlag = var18 335 28000 ???? 336 28000 ???? 01 51 power_upY = var17 337 28000 ???? 338 28000 ???? 01 50 power_upX = var16 339 28000 ???? 340 28000 ???? 01 4f rDirection = var15 341 28000 ???? 342 28000 ???? 01 4e rMovement1 = var14 343 28000 ???? 344 28000 ???? 01 4d playerFlag = var13 345 28000 ???? 346 28000 ???? 01 4c enemy_shotFlag = var12 347 28000 ???? 348 28000 ???? 01 4b enemy_shotY = var11 349 28000 ???? 350 28000 ???? 01 4a enemy_shotX = var10 351 28000 ???? 352 28000 ???? 01 49 bulletY = var9 353 28000 ???? 354 28000 ???? 01 48 bulletX = var8 355 28000 ???? 356 28000 ???? 01 47 joyposright = var7 357 28000 ???? 358 28000 ???? 01 46 joyposleft = var6 359 28000 ???? 360 28000 ???? 01 45 joyposdown = var5 361 28000 ???? 362 28000 ???? 01 44 joyposup = var4 363 28000 ???? 364 28000 ???? 01 43 fire_debounce = var3 365 28000 ???? 366 28000 ???? 01 42 playerY = var2 367 28000 ???? 368 28000 ???? 01 41 playerX = var1 369 28000 ???? 370 28000 ???? 01 40 frameCounter = var0 371 28000 ???? 372 28000 ???? 00 01 collisionwrap = 1 373 28000 ???? 00 01 NTSC = 1 374 28000 ???? 00 c0 SCREENHEIGHT = 192 375 28000 ???? 00 01 CHECKOVERWRITE = 1 376 28000 ???? 00 08 ZONEHEIGHT = 8 377 28000 ???? 00 01 SGRAM = 1 378 28000 ???? 00 08 bankswitchmode = 8 379 28000 ???? 00 01 ROM128K = 1 ------- FILE 7800basic.h 6 28000 ???? 7 28000 ???? ;************ 7800 overall RAM map ************** 8 28000 ???? 9 28000 ???? ; 40-FF zero page RAM 10 28000 ???? ; 140-1FF RAM (stack) 11 28000 ???? ; 1800-203F RAM 12 28000 ???? ; 2100-213F RAM 13 28000 ???? ; 2200-27FF RAM 14 28000 ???? 15 28000 ???? ;************ 7800basic RAM usage map ************** 16 28000 ???? 17 28000 ???? ; 40-FF numerous defines, listed below 18 28000 ???? ; 140-1FF RAM (stack) 19 28000 ???? 20 28000 ???? ; 1800-187F DLL (1800-18DF with page flipping enabled) 21 28000 ???? ; 1880-1FFF DLs (18E0-1FFF with page flipping enabled) 22 28000 ???? 23 28000 ???? ; 2000-203F Reserved 24 28000 ???? ; 2100-213F Reserved 25 28000 ???? ; 2200-27FF Free 26 28000 ???? 27 28000 ???? 1f e0 eeprombuffer = $1FE0 28 28000 ???? 18 00 DLLMEM = $1800 29 28000 ???? 00 70 DBOFFSET = $70 ; $E0 length DL is /2 for double-buffering 30 28000 ???? 31 28000 ???? - ifconst PLOTVALUEPAGE 32 28000 ???? -VALBUFFER = (PLOTVALUEPAGE*256) 33 28000 ???? else 34 28000 ???? 20 00 VALBUFFER = $2000 ; to $203F ** never let VALBUFFER straddle pages 35 28000 ???? endif 36 28000 ???? 37 28000 ???? 38 28000 ???? 21 00 pausestate = $2100 39 28000 ???? 21 01 dlzero = $2101 ; zero to force end of $2100 DL, which we use in vblank and overscan 40 28000 ???? 21 02 sINPT1 = $2102 ; save register for joy button joy0 41 28000 ???? 21 03 sINPT3 = $2103 ; save register for joy button joy1 42 28000 ???? 21 04 currentbank = $2104 43 28000 ???? 44 28000 ???? 21 05 currentrambank = $2105 45 28000 ???? 21 06 charactermode = $2106 46 28000 ???? 21 07 sCTRL = $2107 47 28000 ???? 21 08 pokeydetected = $2108 48 28000 ???? 21 09 paldetected = $2109 49 28000 ???? 21 0a avoxdetected = $210A 50 28000 ???? 21 0b sCHARBASE = $210B ; save register for CHARBASE 51 28000 ???? 52 28000 ???? 21 0c hsdevice = $210C 53 28000 ???? 21 0d hsdifficulty = $210D 54 28000 ???? 21 0e hserror = $210E 55 28000 ???? 21 0f hsgameslot = $210F 56 28000 ???? 21 10 hsnewscoreline = $2110 57 28000 ???? 21 11 hsnewscorerank = $2111 58 28000 ???? 21 12 HSRAMTable = $2112 ; to $212F (30 bytes) Format: III*5, SSS*5 59 28000 ???? 21 12 HSRAMInitials = $2112 ; see above 60 28000 ???? 21 21 HSRAMScores = $2121 ; see above 61 28000 ???? 62 28000 ???? 21 31 ssCTRL = $2131 63 28000 ???? 21 32 ssCHARBASE = $2132 64 28000 ???? 21 33 hsdisplaymode = $2133 65 28000 ???? 21 34 gamedifficulty = $2134 66 28000 ???? 21 35 hsinitialpos = $2135 67 28000 ???? 21 36 hsinitialhold = $2136 68 28000 ???? 21 37 hscursorx = $2137 69 28000 ???? 21 38 hsjoydebounce = $2138 70 28000 ???? 21 39 hsswcha = $2139 71 28000 ???? 21 3a hsinpt1 = $213A 72 28000 ???? 21 3b hscolorchaseindex = $213B 73 28000 ???? 21 3c visibleDLLstart = $213C 74 28000 ???? 21 3d overscanDLLstart = $213D 75 28000 ???? 21 3e frameslost = $213E 76 28000 ???? 77 28000 ???? 78 28000 ???? 00 40 rand = $40 79 28000 ???? 00 41 rand16 = $41 80 28000 ???? 00 42 temp1 = $42 81 28000 ???? 00 43 temp2 = $43 82 28000 ???? 00 44 temp3 = $44 83 28000 ???? 00 45 temp4 = $45 84 28000 ???? 00 46 temp5 = $46 85 28000 ???? 00 47 temp6 = $47 86 28000 ???? 00 48 temp7 = $48 87 28000 ???? 00 49 temp8 = $49 88 28000 ???? 00 4a temp9 = $4a 89 28000 ???? 90 28000 ???? 00 4b pokeybase = $4b 91 28000 ???? 00 4b pokeybaselo = $4b 92 28000 ???? 00 4c pokeybasehi = $4c 93 28000 ???? 94 28000 ???? 00 4d visibleover = $4d 95 28000 ???? 96 28000 ???? 00 4e sfx1pointlo = $4e 97 28000 ???? 00 4f sfx2pointlo = $4f 98 28000 ???? 00 50 sfx1pointhi = $50 99 28000 ???? 00 51 sfx2pointhi = $51 100 28000 ???? 101 28000 ???? 00 52 sfx1priority = $52 102 28000 ???? 00 53 sfx2priority = $53 103 28000 ???? 00 54 sfx1poffset = $54 104 28000 ???? 00 55 sfx2poffset = $55 105 28000 ???? 106 28000 ???? 00 56 sfx1frames = $56 107 28000 ???? 00 57 sfx2frames = $57 108 28000 ???? 00 58 sfx1tick = $58 109 28000 ???? 00 59 sfx2tick = $59 110 28000 ???? 111 28000 ???? 00 5a tempmath = $5a 112 28000 ???? 113 28000 ???? 00 5b pokey1pointlo = $5b 114 28000 ???? 00 5c pokey1pointhi = $5c 115 28000 ???? 00 5d pokey2pointlo = $5d 116 28000 ???? 00 5e pokey2pointhi = $5e 117 28000 ???? 00 5f pokey3pointlo = $5f 118 28000 ???? 00 60 pokey3pointhi = $60 119 28000 ???? 00 61 pokey4pointlo = $61 120 28000 ???? 00 62 pokey4pointhi = $62 121 28000 ???? 122 28000 ???? 00 63 dlpnt = $63 ; to $64 123 28000 ???? 00 65 dlend = $65 ; to $81 - for 28 possible visible dll entries 124 28000 ???? 00 82 dlendsave = $82 ; to $9e - for 28 possible visible dll entries 125 28000 ???? 126 28000 ???? 00 9f speech_addr = $9f 127 28000 ???? 00 a0 speech_addr_hi = $a0 128 28000 ???? 129 28000 ???? 00 a1 HSGameTableLo = $a1 130 28000 ???? 00 a2 HSGameTableHi = $a2 131 28000 ???? 00 a3 HSVoxHi = $a3 132 28000 ???? 00 a4 HSVoxLo = $a4 133 28000 ???? 134 28000 ???? ;channel pointers 135 28000 ???? 136 28000 ???? 00 a5 songchannel1layer1lo = $a5 137 28000 ???? 00 a6 songchannel2layer1lo = $a6 138 28000 ???? 00 a7 songchannel3layer1lo = $a7 139 28000 ???? 00 a8 songchannel4layer1lo = $a8 140 28000 ???? 141 28000 ???? 00 a9 songchannel1layer2lo = $a9 142 28000 ???? 00 aa songchannel2layer2lo = $aA 143 28000 ???? 00 ab songchannel3layer2lo = $aB 144 28000 ???? 00 ac songchannel4layer2lo = $aC 145 28000 ???? 146 28000 ???? 00 ad songchannel1layer3lo = $aD 147 28000 ???? 00 ae songchannel2layer3lo = $aE 148 28000 ???? 00 af songchannel3layer3lo = $aF 149 28000 ???? 00 b0 songchannel4layer3lo = $b0 150 28000 ???? 151 28000 ???? 00 b1 songchannel1layer1hi = $b1 152 28000 ???? 00 b2 songchannel2layer1hi = $b2 153 28000 ???? 00 b3 songchannel3layer1hi = $b3 154 28000 ???? 00 b4 songchannel4layer1hi = $b4 155 28000 ???? 156 28000 ???? 00 b5 songchannel1layer2hi = $b5 157 28000 ???? 00 b6 songchannel2layer2hi = $b6 158 28000 ???? 00 b7 songchannel3layer2hi = $b7 159 28000 ???? 00 b8 songchannel4layer2hi = $b8 160 28000 ???? 161 28000 ???? 00 b9 songchannel1layer3hi = $b9 162 28000 ???? 00 ba songchannel2layer3hi = $bA 163 28000 ???? 00 bb songchannel3layer3hi = $bB 164 28000 ???? 00 bc songchannel4layer3hi = $bC 165 28000 ???? 166 28000 ???? 00 bd songdatalo = $bd 167 28000 ???? 00 be songdatahi = $be 168 28000 ???? 169 28000 ???? 00 bf inactivechannelcount = $bf 170 28000 ???? 171 28000 ???? 172 28000 ???? 00 c0 songchannel1transpose = $c0 173 28000 ???? 00 c1 songchannel2transpose = $c1 174 28000 ???? 00 c2 songchannel3transpose = $c2 175 28000 ???? 00 c3 songchannel4transpose = $c3 176 28000 ???? 177 28000 ???? 00 c4 songstackindex = $c4 178 28000 ???? 179 28000 ???? 00 c5 songchannel1instrumentlo = $c5 180 28000 ???? 00 c6 songchannel2instrumentlo = $c6 181 28000 ???? 00 c7 songchannel3instrumentlo = $c7 182 28000 ???? 00 c8 songchannel4instrumentlo = $c8 183 28000 ???? 184 28000 ???? 00 c9 songchannel1instrumenthi = $c9 185 28000 ???? 00 ca songchannel2instrumenthi = $ca 186 28000 ???? 00 cb songchannel3instrumenthi = $cb 187 28000 ???? 00 cc songchannel4instrumenthi = $cc 188 28000 ???? 189 28000 ???? 00 cd sfx1notedata = $cd 190 28000 ???? 00 ce sfx2notedata = $ce 191 28000 ???? 192 28000 ???? 00 cf songloops = $cf 193 28000 ???? 194 28000 ???? 00 d0 songpointerlo = $D0 195 28000 ???? 00 d1 songpointerhi = $D1 196 28000 ???? 197 28000 ???? 00 d2 voxlock = $D2 198 28000 ???? 00 d3 voxqueuesize = $D3 199 28000 ???? 200 28000 ???? 00 d4 vblankroutines = $D4 201 28000 ???? 202 28000 ???? 00 d5 doublebufferstate = $D5 203 28000 ???? 00 d6 doublebufferdloffset = $D6 204 28000 ???? 00 d7 doublebufferbufferdirty = $D7 205 28000 ???? 206 28000 ???? 00 d8 inttemp1 = $D8 207 28000 ???? 00 d9 inttemp2 = $D9 208 28000 ???? 00 da inttemp3 = $DA 209 28000 ???? 00 db inttemp4 = $DB 210 28000 ???? 00 dc inttemp5 = $DC 211 28000 ???? 00 dd inttemp6 = $DD 212 28000 ???? 213 28000 ???? 00 de sfxschedulelock = $DE 214 28000 ???? 00 df sfxschedulemissed = $DF 215 28000 ???? 00 e0 sfxinstrumentlo = $E0 216 28000 ???? 00 e1 sfxinstrumenthi = $E1 217 28000 ???? 00 e2 sfxpitchoffset = $E2 218 28000 ???? 00 e3 sfxnoteindex = $E3 219 28000 ???? 220 28000 ???? 00 e4 CTLSWAs = $E4 221 28000 ???? 00 e5 CTLSWBs = $E5 222 28000 ???? 223 28000 ???? 00 e6 A = $e6 224 28000 ???? 00 e6 a = $e6 225 28000 ???? 00 e7 B = $e7 226 28000 ???? 00 e7 b = $e7 227 28000 ???? 00 e8 C = $e8 228 28000 ???? 00 e8 c = $e8 229 28000 ???? 00 e9 D = $e9 230 28000 ???? 00 e9 d = $e9 231 28000 ???? 00 ea E = $ea 232 28000 ???? 00 ea e = $ea 233 28000 ???? 00 eb F = $eb 234 28000 ???? 00 eb f = $eb 235 28000 ???? 00 ec G = $ec 236 28000 ???? 00 ec g = $ec 237 28000 ???? 00 ed H = $ed 238 28000 ???? 00 ed h = $ed 239 28000 ???? 00 ee I = $ee 240 28000 ???? 00 ee i = $ee 241 28000 ???? 00 ef J = $ef 242 28000 ???? 00 ef j = $ef 243 28000 ???? 00 f0 K = $f0 244 28000 ???? 00 f0 k = $f0 245 28000 ???? 00 f1 L = $f1 246 28000 ???? 00 f1 l = $f1 247 28000 ???? 00 f2 M = $f2 248 28000 ???? 00 f2 m = $f2 249 28000 ???? 00 f3 N = $f3 250 28000 ???? 00 f3 n = $f3 251 28000 ???? 00 f4 O = $f4 252 28000 ???? 00 f4 o = $f4 253 28000 ???? 00 f5 P = $f5 254 28000 ???? 00 f5 p = $f5 255 28000 ???? 00 f6 Q = $f6 256 28000 ???? 00 f6 q = $f6 257 28000 ???? 00 f7 R = $f7 258 28000 ???? 00 f7 r = $f7 259 28000 ???? 00 f8 S = $f8 260 28000 ???? 00 f8 s = $f8 261 28000 ???? 00 f9 T = $f9 262 28000 ???? 00 f9 t = $f9 263 28000 ???? 00 fa U = $fa 264 28000 ???? 00 fa u = $fa 265 28000 ???? 00 fb V = $fb 266 28000 ???? 00 fb v = $fb 267 28000 ???? 00 fc W = $fc 268 28000 ???? 00 fc w = $fc 269 28000 ???? 00 fd X = $fd 270 28000 ???? 00 fd x = $fd 271 28000 ???? 00 fe Y = $fe 272 28000 ???? 00 fe y = $fe 273 28000 ???? 00 ff Z = $ff 274 28000 ???? 00 ff z = $ff 275 28000 ???? 276 28000 ???? ; var0-var99 variables use the top of the stack 277 28000 ???? 01 40 var0 = $140 278 28000 ???? 01 41 var1 = $141 279 28000 ???? 01 42 var2 = $142 280 28000 ???? 01 43 var3 = $143 281 28000 ???? 01 44 var4 = $144 282 28000 ???? 01 45 var5 = $145 283 28000 ???? 01 46 var6 = $146 284 28000 ???? 01 47 var7 = $147 285 28000 ???? 01 48 var8 = $148 286 28000 ???? 01 49 var9 = $149 287 28000 ???? 01 4a var10 = $14a 288 28000 ???? 01 4b var11 = $14b 289 28000 ???? 01 4c var12 = $14c 290 28000 ???? 01 4d var13 = $14d 291 28000 ???? 01 4e var14 = $14e 292 28000 ???? 01 4f var15 = $14f 293 28000 ???? 01 50 var16 = $150 294 28000 ???? 01 51 var17 = $151 295 28000 ???? 01 52 var18 = $152 296 28000 ???? 01 53 var19 = $153 297 28000 ???? 01 54 var20 = $154 298 28000 ???? 01 55 var21 = $155 299 28000 ???? 01 56 var22 = $156 300 28000 ???? 01 57 var23 = $157 301 28000 ???? 01 58 var24 = $158 302 28000 ???? 01 59 var25 = $159 303 28000 ???? 01 5a var26 = $15a 304 28000 ???? 01 5b var27 = $15b 305 28000 ???? 01 5c var28 = $15c 306 28000 ???? 01 5d var29 = $15d 307 28000 ???? 01 5e var30 = $15e 308 28000 ???? 01 5f var31 = $15f 309 28000 ???? 01 60 var32 = $160 310 28000 ???? 01 61 var33 = $161 311 28000 ???? 01 62 var34 = $162 312 28000 ???? 01 63 var35 = $163 313 28000 ???? 01 64 var36 = $164 314 28000 ???? 01 65 var37 = $165 315 28000 ???? 01 66 var38 = $166 316 28000 ???? 01 67 var39 = $167 317 28000 ???? 01 68 var40 = $168 318 28000 ???? 01 69 var41 = $169 319 28000 ???? 01 6a var42 = $16a 320 28000 ???? 01 6b var43 = $16b 321 28000 ???? 01 6c var44 = $16c 322 28000 ???? 01 6d var45 = $16d 323 28000 ???? 01 6e var46 = $16e 324 28000 ???? 01 6f var47 = $16f 325 28000 ???? 01 70 var48 = $170 326 28000 ???? 01 71 var49 = $171 327 28000 ???? 01 72 var50 = $172 328 28000 ???? 01 73 var51 = $173 329 28000 ???? 01 74 var52 = $174 330 28000 ???? 01 75 var53 = $175 331 28000 ???? 01 76 var54 = $176 332 28000 ???? 01 77 var55 = $177 333 28000 ???? 01 78 var56 = $178 334 28000 ???? 01 79 var57 = $179 335 28000 ???? 01 7a var58 = $17a 336 28000 ???? 01 7b var59 = $17b 337 28000 ???? 01 7c var60 = $17c 338 28000 ???? 01 7d var61 = $17d 339 28000 ???? 01 7e var62 = $17e 340 28000 ???? 01 7f var63 = $17f 341 28000 ???? 01 80 var64 = $180 342 28000 ???? 01 81 var65 = $181 343 28000 ???? 01 82 var66 = $182 344 28000 ???? 01 83 var67 = $183 345 28000 ???? 01 84 var68 = $184 346 28000 ???? 01 85 var69 = $185 347 28000 ???? 01 86 var70 = $186 348 28000 ???? 01 87 var71 = $187 349 28000 ???? 01 88 var72 = $188 350 28000 ???? 01 89 var73 = $189 351 28000 ???? 01 8a var74 = $18a 352 28000 ???? 01 8b var75 = $18b 353 28000 ???? 01 8c var76 = $18c 354 28000 ???? 01 8d var77 = $18d 355 28000 ???? 01 8e var78 = $18e 356 28000 ???? 01 8f var79 = $18f 357 28000 ???? 01 90 var80 = $190 358 28000 ???? 01 91 var81 = $191 359 28000 ???? 01 92 var82 = $192 360 28000 ???? 01 93 var83 = $193 361 28000 ???? 01 94 var84 = $194 362 28000 ???? 01 95 var85 = $195 363 28000 ???? 01 96 var86 = $196 364 28000 ???? 01 97 var87 = $197 365 28000 ???? 01 98 var88 = $198 366 28000 ???? 01 99 var89 = $199 367 28000 ???? 01 9a var90 = $19a 368 28000 ???? 01 9b var91 = $19b 369 28000 ???? 01 9c var92 = $19c 370 28000 ???? 01 9d var93 = $19d 371 28000 ???? 01 9e var94 = $19e 372 28000 ???? 01 9f var95 = $19f 373 28000 ???? 01 a0 var96 = $1a0 374 28000 ???? 01 a1 var97 = $1a1 375 28000 ???? 01 a2 var98 = $1a2 376 28000 ???? 01 a3 var99 = $1a3 377 28000 ???? 378 U01c2 ???? SEG.U "7800basicRAM" 379 U01a4 ORG $1A4 380 U01a4 381 U01a4 ; MAX allocation locations are in comments... 382 U01a4 00 framecounter DS 1 ; $1A4 383 U01a5 00 countdownseconds DS 1 ; $1A5 384 U01a6 00 00 00 score0 DS 3 ; $1A6 $1A7 $1A8 385 U01a9 00 00 00 score1 DS 3 ; $1A9 $1AA $1AB 386 U01ac 00 pausebuttonflag DS 1 ; $1AC 387 U01ad 00 valbufend DS 1 ; $1AD 388 U01ae 00 valbufendsave DS 1 ; $1AE 389 U01af 00 finescrollx DS 1 ; $1AF 390 U01b0 00 finescrolly DS 1 ; $1B0 391 U01b1 00 joybuttonmode DS 1 ; $1B1 ; track joysticks that were changed to one-button mode 392 U01b2 00 interruptindex DS 1 ; $1B2 393 U01b3 394 U01b3 - ifconst DOUBLEBUFFER 395 U01b3 -doublebufferminimumframetarget DS 1 ; $1B3 396 U01b3 -doublebufferminimumframeindex DS 1 ; $1B4 397 U01b3 endif 398 U01b3 399 U01b3 00 pausedisable DS 1 ; $1B5 400 U01b4 00 XCTRL1s DS 1 ; $1B6 401 U01b5 402 U01b5 - ifconst AVOXVOICE 403 U01b5 -avoxenable DS 1 ; $1B7 404 U01b5 -tempavox DS 1 ; $1B8 405 U01b5 endif 406 U01b5 407 U01b5 - ifconst MUSICTRACKER 408 U01b5 -songtempo DS 1 ; $1B9 409 U01b5 -songtick DS 1 ; $1BA 410 U01b5 - 411 U01b5 -songchannel1layer1loops DS 1 ; $1BB 412 U01b5 -songchannel2layer1loops DS 1 ; $1BC 413 U01b5 -songchannel3layer1loops DS 1 ; $1BD 414 U01b5 -songchannel4layer1loops DS 1 ; $1BE 415 U01b5 - 416 U01b5 -songchannel1layer2loops DS 1 ; $1BF 417 U01b5 -songchannel2layer2loops DS 1 ; $1C0 418 U01b5 -songchannel3layer2loops DS 1 ; $1C1 419 U01b5 -songchannel4layer2loops DS 1 ; $1C2 420 U01b5 - 421 U01b5 -songchannel1layer3loops DS 1 ; $1C3 422 U01b5 -songchannel2layer3loops DS 1 ; $1C4 423 U01b5 -songchannel3layer3loops DS 1 ; $1C5 424 U01b5 -songchannel4layer3loops DS 1 ; $1C6 425 U01b5 - 426 U01b5 -songchannel1busywait DS 1 ; $1C7 427 U01b5 -songchannel2busywait DS 1 ; $1C8 428 U01b5 -songchannel3busywait DS 1 ; $1C9 429 U01b5 -songchannel4busywait DS 1 ; $1CA 430 U01b5 - 431 U01b5 -songchannel1stackdepth DS 1 ; $1CB 432 U01b5 -songchannel2stackdepth DS 1 ; $1CC 433 U01b5 -songchannel3stackdepth DS 1 ; $1CD 434 U01b5 -songchannel4stackdepth DS 1 ; $1CE 435 U01b5 endif 436 U01b5 437 U01b5 00 palframes DS 1 ; $1CF 438 U01b6 00 palfastframe DS 1 ; $1D0 439 U01b7 440 U01b7 - ifconst MOUSESUPPORT 441 U01b7 -port0resolution DS 1 ; $1D1 442 U01b7 -port1resolution DS 1 ; $1D2 443 U01b7 else 444 U01b7 - ifconst TRAKBALLSUPPORT 445 U01b7 -port0resolution DS 1 ; $1D1 446 U01b7 -port1resolution DS 1 ; $1D2 447 U01b7 endif 448 U01b7 endif 449 U01b7 450 U01b7 00 port0control DS 1 ; $1D3 451 U01b8 00 port1control DS 1 ; $1D4 452 U01b9 453 U01b9 ; port#control values... 454 U01b9 ; 1 = proline 455 U01b9 ; 2 = lightgun 456 U01b9 ; 3 = paddle 457 U01b9 ; 4 = trakball 458 U01b9 ; 5 = vcs joystick 459 U01b9 ; 6 = driving 460 U01b9 ; 7 = keypad 461 U01b9 ; 8 = st mouse/cx80 462 U01b9 ; 9 = amiga mouse 463 U01b9 ; 10 = atarivox 464 U01b9 465 U01b9 ; controller 0 data... 466 U01b9 00 paddleposition0 DS 1 ; $1D5 467 U01b9 01 b9 keypadmatrix0a = paddleposition0 468 U01b9 01 b9 drivingposition0 = paddleposition0 469 U01b9 01 b9 trakballx0 = paddleposition0 470 U01b9 01 b9 mousex0 = paddleposition0 471 U01b9 01 b9 lighttgunx0 = paddleposition0 472 U01ba 473 U01ba ; controller 1 data... 474 U01ba 00 paddleposition2 DS 1 ; $1D6 475 U01ba 01 ba keypadmatrix1a = paddleposition2 476 U01ba 01 ba drivingposition1 = paddleposition2 477 U01ba 01 ba trakballx1 = paddleposition2 478 U01ba 01 ba mousex1 = paddleposition2 479 U01ba 01 ba lightgunx1 = paddleposition2 480 U01bb 481 U01bb ; controller 0 altdata... 482 U01bb 00 paddleposition1 DS 1 ; $1D7 483 U01bb 01 bb keypadmatrix0b = paddleposition1 484 U01bb 01 bb trakbally0 = paddleposition1 485 U01bb 01 bb mousey0 = paddleposition1 486 U01bb 01 bb lightguny0 = paddleposition1 487 U01bc 488 U01bc ; controller 1 altdata... 489 U01bc 00 paddleposition3 DS 1 ; $1D8 490 U01bc 01 bc keypadmatrix1b = paddleposition3 491 U01bc 01 bc trakbally1 = paddleposition3 492 U01bc 01 bc mousey1 = paddleposition3 493 U01bc 01 bc lightguny1 = paddleposition3 494 U01bd 495 U01bd ; controller state save. for trakball state+dir codes, rotary position codes 496 U01bd 00 controller0statesave DS 1 ; $1D9 497 U01bd 01 bd paddleprevious0 = controller0statesave 498 U01bd 01 bd mousecodex0 = controller0statesave 499 U01bd 01 bd trakballcodex0 = controller0statesave 500 U01bd 01 bd keypadmatrix0c = controller0statesave 501 U01be 502 U01be 00 controller1statesave DS 1 ; $1DA 503 U01be 01 be paddleprevious2 = controller1statesave 504 U01be 01 be mousecodex1 = controller1statesave 505 U01be 01 be trakballcodex1 = controller1statesave 506 U01be 01 be keypadmatrix1c = controller1statesave 507 U01bf 508 U01bf 00 paddleprevious1 DS 1 ; $1DB 509 U01bf 01 bf keypadmatrix0d = paddleprevious1 510 U01bf 01 bf mousecodey0 = paddleprevious1 511 U01bf 01 bf trakballcodey0 = paddleprevious1 512 U01c0 513 U01c0 00 paddleprevious3 DS 1 ; $1DC 514 U01c0 01 c0 keypadmatrix1d = paddleprevious3 515 U01c0 01 c0 mousecodey1 = paddleprevious3 516 U01c0 01 c0 trakballcodey1 = paddleprevious3 517 U01c1 518 U01c1 - ifconst pokeysupport 519 U01c1 -pokey1frames DS 1 ; $1DD 520 U01c1 -pokey1tick DS 1 ; $1DE 521 U01c1 -pokey2frames DS 1 ; $1DF 522 U01c1 -pokey2tick DS 1 ; $1E0 523 U01c1 -pokey3frames DS 1 ; $1E1 524 U01c1 -pokey3tick DS 1 ; $1E2 525 U01c1 -pokey4frames DS 1 ; $1E3 526 U01c1 -pokey4tick DS 1 ; $1E4 527 U01c1 -pokey1priority DS 1 ; $1E5 528 U01c1 -pokey1offset DS 1 ; $1E6 529 U01c1 -pokey2priority DS 1 ; $1E7 530 U01c1 -pokey2offset DS 1 ; $1E8 531 U01c1 -pokey3priority DS 1 ; $1E9 532 U01c1 -pokey3offset DS 1 ; $1EA 533 U01c1 -pokey4priority DS 1 ; $1EB 534 U01c1 -pokey4offset DS 1 ; $1EC 535 U01c1 endif 536 U01c1 537 U01c1 ; see if we need an interrupthold byte... 538 U01c1 INTERRUPTNEEDED SET 0 539 U01c1 - ifconst .topscreenroutine 540 U01c1 -INTERRUPTNEEDED SET 1 541 U01c1 endif 542 U01c1 - ifconst .bottomscreenroutine 543 U01c1 -INTERRUPTNEEDED SET 1 544 U01c1 endif 545 U01c1 - ifconst .userinterrupt 546 U01c1 -INTERRUPTNEEDED SET 1 547 U01c1 endif 548 U01c1 - if INTERRUPTNEEDED = 1 549 U01c1 -interrupthold DS 1 ; $1ED 550 U01c1 endif 551 U01c1 552 U01c1 ifnconst CANARYOFF 553 U01c1 00 canary DS 1 ; $1EF 554 U01c2 endif 555 U01c2 556 U01c2 557 U01c2 - ifnconst bankswitchmode 558 U01c2 - echo " stack allowance:",[($1FF - .)/2]d,"nested subroutines." 559 U01c2 else stack allowance: 20 nested subroutines. 560 U01c2 echo " stack allowance:",[($1FF - .)/3]d,"nested subroutines." 561 U01c2 endif 562 U01c2 ifnconst CANARYOFF the canary is situated at: $1c1 563 U01c2 echo " the canary is situated at:",[canary] 564 U01c2 - else 565 U01c2 - echo " the canary is disabled." 566 U01c2 endif 567 U01c2 568 U01c2 ; $1EE - $1FF reserved for stack 569 U01c2 570 28000 ???? SEG "GAME" 571 28000 ???? ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite3.78b.asm ------- FILE 7800basic_variable_redefs.h LEVEL 2 PASS 3 0 28000 ???? include "7800basic_variable_redefs.h" 1 28000 ???? ; This file contains variable mapping and other information for the current project. 2 28000 ???? 3 28000 ???? 00 00 vertical_shooting_laser_tallsprite_01_mode = $00 4 28000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width_twoscompliment = $00 5 28000 ???? 00 00 vertical_shooting_laser_tallsprite_01_width = $00 6 28000 ???? 00 00 vertical_shooting_laser_tallsprite_00_mode = $00 7 28000 ???? 00 1f vertical_shooting_laser_tallsprite_00_width_twoscompliment = $1f 8 28000 ???? 00 01 vertical_shooting_laser_tallsprite_00_width = $01 9 28000 ???? 00 00 vertical_shooting_laser_mode = $00 10 28000 ???? 00 1f vertical_shooting_laser_width_twoscompliment = $1f 11 28000 ???? 00 01 vertical_shooting_laser_width = $01 12 28000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_mode = $00 13 28000 ???? 00 0c vertical_shooting_explosion_10_tallsprite_00_width_twoscompliment = $0c 14 28000 ???? 00 14 vertical_shooting_explosion_10_tallsprite_00_width = $14 15 28000 ???? 00 00 vertical_shooting_explosion_10_mode = $00 16 28000 ???? 00 0c vertical_shooting_explosion_10_width_twoscompliment = $0c 17 28000 ???? 00 14 vertical_shooting_explosion_10_width = $14 18 28000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_mode = $00 19 28000 ???? 00 0c vertical_shooting_explosion_09_tallsprite_00_width_twoscompliment = $0c 20 28000 ???? 00 14 vertical_shooting_explosion_09_tallsprite_00_width = $14 21 28000 ???? 00 00 vertical_shooting_explosion_09_mode = $00 22 28000 ???? 00 0c vertical_shooting_explosion_09_width_twoscompliment = $0c 23 28000 ???? 00 14 vertical_shooting_explosion_09_width = $14 24 28000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_mode = $00 25 28000 ???? 00 0c vertical_shooting_explosion_08_tallsprite_00_width_twoscompliment = $0c 26 28000 ???? 00 14 vertical_shooting_explosion_08_tallsprite_00_width = $14 27 28000 ???? 00 00 vertical_shooting_explosion_08_mode = $00 28 28000 ???? 00 0c vertical_shooting_explosion_08_width_twoscompliment = $0c 29 28000 ???? 00 14 vertical_shooting_explosion_08_width = $14 30 28000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_mode = $00 31 28000 ???? 00 0c vertical_shooting_explosion_07_tallsprite_00_width_twoscompliment = $0c 32 28000 ???? 00 14 vertical_shooting_explosion_07_tallsprite_00_width = $14 33 28000 ???? 00 00 vertical_shooting_explosion_07_mode = $00 34 28000 ???? 00 0c vertical_shooting_explosion_07_width_twoscompliment = $0c 35 28000 ???? 00 14 vertical_shooting_explosion_07_width = $14 36 28000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_mode = $00 37 28000 ???? 00 1e vertical_shooting_explosion_06_tallsprite_00_width_twoscompliment = $1e 38 28000 ???? 00 02 vertical_shooting_explosion_06_tallsprite_00_width = $02 39 28000 ???? 00 00 vertical_shooting_explosion_06_mode = $00 40 28000 ???? 00 1e vertical_shooting_explosion_06_width_twoscompliment = $1e 41 28000 ???? 00 02 vertical_shooting_explosion_06_width = $02 42 28000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_mode = $00 43 28000 ???? 00 1e vertical_shooting_explosion_05_tallsprite_00_width_twoscompliment = $1e 44 28000 ???? 00 02 vertical_shooting_explosion_05_tallsprite_00_width = $02 45 28000 ???? 00 00 vertical_shooting_explosion_05_mode = $00 46 28000 ???? 00 1e vertical_shooting_explosion_05_width_twoscompliment = $1e 47 28000 ???? 00 02 vertical_shooting_explosion_05_width = $02 48 28000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_mode = $00 49 28000 ???? 00 1e vertical_shooting_explosion_04_tallsprite_00_width_twoscompliment = $1e 50 28000 ???? 00 02 vertical_shooting_explosion_04_tallsprite_00_width = $02 51 28000 ???? 00 00 vertical_shooting_explosion_04_mode = $00 52 28000 ???? 00 1e vertical_shooting_explosion_04_width_twoscompliment = $1e 53 28000 ???? 00 02 vertical_shooting_explosion_04_width = $02 54 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_mode = $00 55 28000 ???? 00 1e vertical_shooting_explosion_03_tallsprite_00_width_twoscompliment = $1e 56 28000 ???? 00 02 vertical_shooting_explosion_03_tallsprite_00_width = $02 57 28000 ???? 00 00 vertical_shooting_explosion_03_mode = $00 58 28000 ???? 00 1e vertical_shooting_explosion_03_width_twoscompliment = $1e 59 28000 ???? 00 02 vertical_shooting_explosion_03_width = $02 60 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_mode = $00 61 28000 ???? 00 1e vertical_shooting_explosion_02_tallsprite_00_width_twoscompliment = $1e 62 28000 ???? 00 02 vertical_shooting_explosion_02_tallsprite_00_width = $02 63 28000 ???? 00 00 vertical_shooting_explosion_02_mode = $00 64 28000 ???? 00 1e vertical_shooting_explosion_02_width_twoscompliment = $1e 65 28000 ???? 00 02 vertical_shooting_explosion_02_width = $02 66 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_mode = $00 67 28000 ???? 00 1e vertical_shooting_explosion_01_tallsprite_00_width_twoscompliment = $1e 68 28000 ???? 00 02 vertical_shooting_explosion_01_tallsprite_00_width = $02 69 28000 ???? 00 00 vertical_shooting_explosion_01_mode = $00 70 28000 ???? 00 1e vertical_shooting_explosion_01_width_twoscompliment = $1e 71 28000 ???? 00 02 vertical_shooting_explosion_01_width = $02 72 28000 ???? 00 00 vertical_shooting_1up_mode = $00 73 28000 ???? 00 1e vertical_shooting_1up_width_twoscompliment = $1e 74 28000 ???? 00 02 vertical_shooting_1up_width = $02 75 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_mode = $00 76 28000 ???? 00 1e vertical_shooting_enemy01_tallsprite_00_width_twoscompliment = $1e 77 28000 ???? 00 02 vertical_shooting_enemy01_tallsprite_00_width = $02 78 28000 ???? 00 00 vertical_shooting_enemy01_mode = $00 79 28000 ???? 00 1e vertical_shooting_enemy01_width_twoscompliment = $1e 80 28000 ???? 00 02 vertical_shooting_enemy01_width = $02 81 28000 ???? 00 00 vertical_shooting_powerup_mode = $00 82 28000 ???? 00 1e vertical_shooting_powerup_width_twoscompliment = $1e 83 28000 ???? 00 02 vertical_shooting_powerup_width = $02 84 28000 ???? 00 00 vertical_shooting_enemyshot_mode = $00 85 28000 ???? 00 1f vertical_shooting_enemyshot_width_twoscompliment = $1f 86 28000 ???? 00 01 vertical_shooting_enemyshot_width = $01 87 28000 ???? 00 00 vertical_shooting_bullet_mode = $00 88 28000 ???? 00 1f vertical_shooting_bullet_width_twoscompliment = $1f 89 28000 ???? 00 01 vertical_shooting_bullet_width = $01 90 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_mode = $00 91 28000 ???? 00 1e vertical_shooting_ship_tallsprite_00_width_twoscompliment = $1e 92 28000 ???? 00 02 vertical_shooting_ship_tallsprite_00_width = $02 93 28000 ???? 00 00 vertical_shooting_ship_mode = $00 94 28000 ???? 00 1e vertical_shooting_ship_width_twoscompliment = $1e 95 28000 ???? 00 02 vertical_shooting_ship_width = $02 96 28000 ???? 00 00 vertical_shooting_font_mode = $00 97 28000 ???? 00 13 vertical_shooting_font_width_twoscompliment = $13 98 28000 ???? 00 2d vertical_shooting_font_width = $2d 99 28000 ???? 00 90 sfx_explosion_length = .skipL0338-sfx_explosion 100 28000 ???? 101 28000 ???? 00 30 sfx_plainlaser_length = .skipL0337-sfx_plainlaser 102 28000 ???? 103 28000 ???? 00 54 sfx_pulsecannon_length = .skipL0336-sfx_pulsecannon 104 28000 ???? 105 28000 ???? 00 36 sfx_bling_length = .skipL0335-sfx_bling 106 28000 ???? 107 28000 ???? 00 01 BOXCOLLISION = 1 108 28000 ???? 00 00 FALSE = 0 109 28000 ???? 110 28000 ???? 00 01 TRUE = 1 111 28000 ???? 112 28000 ???? 00 0f firing_rate = 15 113 28000 ???? 114 28000 ???? 00 04 vertical_shooting_laser_tallsprite_00_color3 = $04 115 28000 ???? 00 42 vertical_shooting_laser_tallsprite_00_color2 = $42 116 28000 ???? 00 0f vertical_shooting_laser_tallsprite_00_color1 = $0f 117 28000 ???? 00 00 vertical_shooting_laser_tallsprite_00_color0 = $00 118 28000 ???? 00 04 vertical_shooting_laser_color3 = $04 119 28000 ???? 00 42 vertical_shooting_laser_color2 = $42 120 28000 ???? 00 0f vertical_shooting_laser_color1 = $0f 121 28000 ???? 00 00 vertical_shooting_laser_color0 = $00 122 28000 ???? 00 33 vertical_shooting_explosion_10_tallsprite_00_color3 = $33 123 28000 ???? 00 2b vertical_shooting_explosion_10_tallsprite_00_color2 = $2b 124 28000 ???? 00 36 vertical_shooting_explosion_10_tallsprite_00_color1 = $36 125 28000 ???? 00 00 vertical_shooting_explosion_10_tallsprite_00_color0 = $00 126 28000 ???? 00 33 vertical_shooting_explosion_10_color3 = $33 127 28000 ???? 00 2b vertical_shooting_explosion_10_color2 = $2b 128 28000 ???? 00 36 vertical_shooting_explosion_10_color1 = $36 129 28000 ???? 00 00 vertical_shooting_explosion_10_color0 = $00 130 28000 ???? 00 33 vertical_shooting_explosion_09_tallsprite_00_color3 = $33 131 28000 ???? 00 2b vertical_shooting_explosion_09_tallsprite_00_color2 = $2b 132 28000 ???? 00 36 vertical_shooting_explosion_09_tallsprite_00_color1 = $36 133 28000 ???? 00 00 vertical_shooting_explosion_09_tallsprite_00_color0 = $00 134 28000 ???? 00 33 vertical_shooting_explosion_09_color3 = $33 135 28000 ???? 00 2b vertical_shooting_explosion_09_color2 = $2b 136 28000 ???? 00 36 vertical_shooting_explosion_09_color1 = $36 137 28000 ???? 00 00 vertical_shooting_explosion_09_color0 = $00 138 28000 ???? 00 33 vertical_shooting_explosion_08_tallsprite_00_color3 = $33 139 28000 ???? 00 2b vertical_shooting_explosion_08_tallsprite_00_color2 = $2b 140 28000 ???? 00 36 vertical_shooting_explosion_08_tallsprite_00_color1 = $36 141 28000 ???? 00 00 vertical_shooting_explosion_08_tallsprite_00_color0 = $00 142 28000 ???? 00 33 vertical_shooting_explosion_08_color3 = $33 143 28000 ???? 00 2b vertical_shooting_explosion_08_color2 = $2b 144 28000 ???? 00 36 vertical_shooting_explosion_08_color1 = $36 145 28000 ???? 00 00 vertical_shooting_explosion_08_color0 = $00 146 28000 ???? 00 33 vertical_shooting_explosion_07_tallsprite_00_color3 = $33 147 28000 ???? 00 2b vertical_shooting_explosion_07_tallsprite_00_color2 = $2b 148 28000 ???? 00 36 vertical_shooting_explosion_07_tallsprite_00_color1 = $36 149 28000 ???? 00 00 vertical_shooting_explosion_07_tallsprite_00_color0 = $00 150 28000 ???? 00 33 vertical_shooting_explosion_07_color3 = $33 151 28000 ???? 00 2b vertical_shooting_explosion_07_color2 = $2b 152 28000 ???? 00 36 vertical_shooting_explosion_07_color1 = $36 153 28000 ???? 00 00 vertical_shooting_explosion_07_color0 = $00 154 28000 ???? 00 33 vertical_shooting_explosion_06_tallsprite_00_color3 = $33 155 28000 ???? 00 2b vertical_shooting_explosion_06_tallsprite_00_color2 = $2b 156 28000 ???? 00 36 vertical_shooting_explosion_06_tallsprite_00_color1 = $36 157 28000 ???? 00 00 vertical_shooting_explosion_06_tallsprite_00_color0 = $00 158 28000 ???? 00 33 vertical_shooting_explosion_06_color3 = $33 159 28000 ???? 00 2b vertical_shooting_explosion_06_color2 = $2b 160 28000 ???? 00 36 vertical_shooting_explosion_06_color1 = $36 161 28000 ???? 00 00 vertical_shooting_explosion_06_color0 = $00 162 28000 ???? 00 33 vertical_shooting_explosion_05_tallsprite_00_color3 = $33 163 28000 ???? 00 2b vertical_shooting_explosion_05_tallsprite_00_color2 = $2b 164 28000 ???? 00 36 vertical_shooting_explosion_05_tallsprite_00_color1 = $36 165 28000 ???? 00 00 vertical_shooting_explosion_05_tallsprite_00_color0 = $00 166 28000 ???? 00 33 vertical_shooting_explosion_05_color3 = $33 167 28000 ???? 00 2b vertical_shooting_explosion_05_color2 = $2b 168 28000 ???? 00 36 vertical_shooting_explosion_05_color1 = $36 169 28000 ???? 00 00 vertical_shooting_explosion_05_color0 = $00 170 28000 ???? 00 33 vertical_shooting_explosion_04_tallsprite_00_color3 = $33 171 28000 ???? 00 36 vertical_shooting_explosion_04_tallsprite_00_color2 = $36 172 28000 ???? 00 2b vertical_shooting_explosion_04_tallsprite_00_color1 = $2b 173 28000 ???? 00 00 vertical_shooting_explosion_04_tallsprite_00_color0 = $00 174 28000 ???? 00 33 vertical_shooting_explosion_04_color3 = $33 175 28000 ???? 00 36 vertical_shooting_explosion_04_color2 = $36 176 28000 ???? 00 2b vertical_shooting_explosion_04_color1 = $2b 177 28000 ???? 00 00 vertical_shooting_explosion_04_color0 = $00 178 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color3 = 0 179 28000 ???? 00 36 vertical_shooting_explosion_03_tallsprite_00_color2 = $36 180 28000 ???? 00 2b vertical_shooting_explosion_03_tallsprite_00_color1 = $2b 181 28000 ???? 00 00 vertical_shooting_explosion_03_tallsprite_00_color0 = $00 182 28000 ???? 00 00 vertical_shooting_explosion_03_color3 = 0 183 28000 ???? 00 36 vertical_shooting_explosion_03_color2 = $36 184 28000 ???? 00 2b vertical_shooting_explosion_03_color1 = $2b 185 28000 ???? 00 00 vertical_shooting_explosion_03_color0 = $00 186 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color3 = 0 187 28000 ???? 00 36 vertical_shooting_explosion_02_tallsprite_00_color2 = $36 188 28000 ???? 00 2b vertical_shooting_explosion_02_tallsprite_00_color1 = $2b 189 28000 ???? 00 00 vertical_shooting_explosion_02_tallsprite_00_color0 = $00 190 28000 ???? 00 00 vertical_shooting_explosion_02_color3 = 0 191 28000 ???? 00 36 vertical_shooting_explosion_02_color2 = $36 192 28000 ???? 00 2b vertical_shooting_explosion_02_color1 = $2b 193 28000 ???? 00 00 vertical_shooting_explosion_02_color0 = $00 194 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color3 = 0 195 28000 ???? 00 2b vertical_shooting_explosion_01_tallsprite_00_color2 = $2b 196 28000 ???? 00 36 vertical_shooting_explosion_01_tallsprite_00_color1 = $36 197 28000 ???? 00 00 vertical_shooting_explosion_01_tallsprite_00_color0 = $00 198 28000 ???? 00 00 vertical_shooting_explosion_01_color3 = 0 199 28000 ???? 00 2b vertical_shooting_explosion_01_color2 = $2b 200 28000 ???? 00 36 vertical_shooting_explosion_01_color1 = $36 201 28000 ???? 00 00 vertical_shooting_explosion_01_color0 = $00 202 28000 ???? 00 0f vertical_shooting_1up_color3 = $0f 203 28000 ???? 00 42 vertical_shooting_1up_color2 = $42 204 28000 ???? 00 04 vertical_shooting_1up_color1 = $04 205 28000 ???? 00 00 vertical_shooting_1up_color0 = $00 206 28000 ???? 00 83 vertical_shooting_enemy01_tallsprite_00_color3 = $83 207 28000 ???? 00 a8 vertical_shooting_enemy01_tallsprite_00_color2 = $a8 208 28000 ???? 00 bc vertical_shooting_enemy01_tallsprite_00_color1 = $bc 209 28000 ???? 00 00 vertical_shooting_enemy01_tallsprite_00_color0 = $00 210 28000 ???? 00 83 vertical_shooting_enemy01_color3 = $83 211 28000 ???? 00 a8 vertical_shooting_enemy01_color2 = $a8 212 28000 ???? 00 bc vertical_shooting_enemy01_color1 = $bc 213 28000 ???? 00 00 vertical_shooting_enemy01_color0 = $00 214 28000 ???? 00 36 vertical_shooting_powerup_color3 = $36 215 28000 ???? 00 33 vertical_shooting_powerup_color2 = $33 216 28000 ???? 00 2b vertical_shooting_powerup_color1 = $2b 217 28000 ???? 00 00 vertical_shooting_powerup_color0 = $00 218 28000 ???? 00 bc vertical_shooting_enemyshot_color3 = $bc 219 28000 ???? 00 83 vertical_shooting_enemyshot_color2 = $83 220 28000 ???? 00 a8 vertical_shooting_enemyshot_color1 = $a8 221 28000 ???? 00 00 vertical_shooting_enemyshot_color0 = $00 222 28000 ???? 00 1d vertical_shooting_bullet_color3 = $1d 223 28000 ???? 00 18 vertical_shooting_bullet_color2 = $18 224 28000 ???? 00 0f vertical_shooting_bullet_color1 = $0f 225 28000 ???? 00 00 vertical_shooting_bullet_color0 = $00 226 28000 ???? 00 42 vertical_shooting_ship_tallsprite_00_color3 = $42 227 28000 ???? 00 04 vertical_shooting_ship_tallsprite_00_color2 = $04 228 28000 ???? 00 0f vertical_shooting_ship_tallsprite_00_color1 = $0f 229 28000 ???? 00 00 vertical_shooting_ship_tallsprite_00_color0 = $00 230 28000 ???? 00 42 vertical_shooting_ship_color3 = $42 231 28000 ???? 00 04 vertical_shooting_ship_color2 = $04 232 28000 ???? 00 0f vertical_shooting_ship_color1 = $0f 233 28000 ???? 00 00 vertical_shooting_ship_color0 = $00 234 28000 ???? 00 0f vertical_shooting_font_color1 = $0f 235 28000 ???? 00 00 vertical_shooting_font_color0 = $00 236 28000 ???? 00 e9 customTemp4 = d 237 28000 ???? 238 28000 ???? 00 e8 customTemp3 = c 239 28000 ???? 240 28000 ???? 00 e7 customTemp2 = b 241 28000 ???? 242 28000 ???? 00 e6 customTemp1 = a 243 28000 ???? 244 28000 ???? 01 77 enemy01_Slowdown = var55 245 28000 ???? 246 28000 ???? 01 9c mob_X = var92 247 28000 ???? 01 9e mob_Y = var94 248 28000 ???? 01 a0 mob_speedX = var96 249 28000 ???? 01 a2 mob_speedY = var98 250 28000 ???? 01 73 temp_speedY = temp_YSu 251 28000 ???? 01 74 temp_YSf = var52 252 28000 ???? 253 28000 ???? 01 73 temp_YSu = var51 254 28000 ???? 255 28000 ???? 01 71 temp_speedX = temp_XSu 256 28000 ???? 01 72 temp_XSf = var50 257 28000 ???? 258 28000 ???? 01 71 temp_XSu = var49 259 28000 ???? 260 28000 ???? 01 6f total_speedY = total_YSu 261 28000 ???? 01 70 total_YSf = var48 262 28000 ???? 263 28000 ???? 01 6f total_YSu = var47 264 28000 ???? 265 28000 ???? 01 6d total_speedX = total_XSu 266 28000 ???? 01 6e total_XSf = var46 267 28000 ???? 268 28000 ???? 01 6d total_XSu = var45 269 28000 ???? 270 28000 ???? 22 50 enemy_shotSYf = $2250 271 28000 ???? 272 28000 ???? 22 40 enemy_shotSXf = $2240 273 28000 ???? 274 28000 ???? 22 30 enemy_shotSY = $2230 275 28000 ???? 276 28000 ???? 22 20 enemy_shotSX = $2220 277 28000 ???? 278 28000 ???? 22 10 enemy_shotYf = $2210 279 28000 ???? 280 28000 ???? 22 00 enemy_shotXf = $2200 281 28000 ???? 282 28000 ???? 01 6c enemy_shotDirection = var44 283 28000 ???? 284 28000 ???? 01 6b timer = var43 285 28000 ???? 286 28000 ???? 01 6a isDead_flag = var42 287 28000 ???? 288 28000 ???? 01 69 continue_flag = var41 289 28000 ???? 290 28000 ???? 01 68 twinlaser_Slowdown = var40 291 28000 ???? 292 28000 ???? 01 67 twinlaser_flag = var39 293 28000 ???? 294 28000 ???? 01 66 twinlaserY = var38 295 28000 ???? 296 28000 ???? 01 65 twinlaserX = var37 297 28000 ???? 298 28000 ???? 01 64 lives = var36 299 28000 ???? 300 28000 ???? 01 63 explosion_aniframe = var35 301 28000 ???? 302 28000 ???? 01 62 extra_shipFlag = var34 303 28000 ???? 304 28000 ???? 01 61 extra_shipY = var33 305 28000 ???? 306 28000 ???? 01 60 extra_shipX = var32 307 28000 ???? 308 28000 ???? 01 5f gameover_flag = var31 309 28000 ???? 310 28000 ???? 01 5e enemy01_speed = var30 311 28000 ???? 312 28000 ???? 01 5d rMovement6 = var29 313 28000 ???? 314 28000 ???? 01 5c rMovement5 = var28 315 28000 ???? 316 28000 ???? 01 5b rMovement4 = var27 317 28000 ???? 318 28000 ???? 01 5a rMovement3 = var26 319 28000 ???? 320 28000 ???? 01 59 enemy01_Flag = var25 321 28000 ???? 322 28000 ???? 01 58 enemy01_Y = var24 323 28000 ???? 324 28000 ???? 01 57 enemy01_X = var23 325 28000 ???? 326 28000 ???? 01 56 enemy_shotSlowdown = var22 327 28000 ???? 328 28000 ???? 01 55 bulletSlowdown = var21 329 28000 ???? 330 28000 ???? 01 54 power_upSlowdown = var20 331 28000 ???? 332 28000 ???? 01 53 rMovement2 = var19 333 28000 ???? 334 28000 ???? 01 52 power_upFlag = var18 335 28000 ???? 336 28000 ???? 01 51 power_upY = var17 337 28000 ???? 338 28000 ???? 01 50 power_upX = var16 339 28000 ???? 340 28000 ???? 01 4f rDirection = var15 341 28000 ???? 342 28000 ???? 01 4e rMovement1 = var14 343 28000 ???? 344 28000 ???? 01 4d playerFlag = var13 345 28000 ???? 346 28000 ???? 01 4c enemy_shotFlag = var12 347 28000 ???? 348 28000 ???? 01 4b enemy_shotY = var11 349 28000 ???? 350 28000 ???? 01 4a enemy_shotX = var10 351 28000 ???? 352 28000 ???? 01 49 bulletY = var9 353 28000 ???? 354 28000 ???? 01 48 bulletX = var8 355 28000 ???? 356 28000 ???? 01 47 joyposright = var7 357 28000 ???? 358 28000 ???? 01 46 joyposleft = var6 359 28000 ???? 360 28000 ???? 01 45 joyposdown = var5 361 28000 ???? 362 28000 ???? 01 44 joyposup = var4 363 28000 ???? 364 28000 ???? 01 43 fire_debounce = var3 365 28000 ???? 366 28000 ???? 01 42 playerY = var2 367 28000 ???? 368 28000 ???? 01 41 playerX = var1 369 28000 ???? 370 28000 ???? 01 40 frameCounter = var0 371 28000 ???? 372 28000 ???? 00 01 collisionwrap = 1 373 28000 ???? 00 01 NTSC = 1 374 28000 ???? 00 c0 SCREENHEIGHT = 192 375 28000 ???? 00 01 CHECKOVERWRITE = 1 376 28000 ???? 00 08 ZONEHEIGHT = 8 377 28000 ???? 00 01 SGRAM = 1 378 28000 ???? 00 08 bankswitchmode = 8 379 28000 ???? 00 01 ROM128K = 1 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite3.78b.asm 555 28000 ???? 556 28000 ???? ; A BEAD header gets automatically incorportated into the ROM header. 557 28000 ???? ; For more BEAD executable info, check out the spec... 558 28000 ???? ; http://7800.8bitdev.org/index.php/The_Atari_7800_BEAD_Execuable_Specification 559 28000 ???? 560 28000 ???? 00 01 GAMEDESCRIPTIONSET = 1 561 28000 ???? 4e 61 6d 65 GAMEDESCRIPTION = "Test Name" 562 28000 ???? 563 28000 ???? 00 40 BDHSC = %01000000 564 28000 ???? 00 20 BDYM = %00100000 565 28000 ???? 00 10 BDPOKEY = %00010000 566 28000 ???? 00 08 BDROF = %00001000 567 28000 ???? 00 00 BD16K = %00000000 568 28000 ???? 00 01 BD32K = %00000001 569 28000 ???? 00 02 BD48K = %00000010 570 28000 ???? 00 05 BD1800 = %00000101 571 28000 ???? 00 06 BD4000 = %00000110 572 28000 ???? 573 28000 ???? - ifconst ROM32K 574 28000 ???? -BEADHEADER = 1 575 28000 ???? endif 576 28000 ???? - ifconst ROM48K 577 28000 ???? -BEADHEADER = 1 578 28000 ???? endif 579 28000 ???? 580 28000 ???? - ifconst BEADHEADER 581 28000 ???? -BEADHARDWARE SET 0 582 28000 ???? - ifconst ROM16K 583 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD16K) 584 28000 ???? - endif 585 28000 ???? - ifconst ROM32K 586 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD32K) 587 28000 ???? - endif 588 28000 ???? - ifconst ROM48K 589 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BD48K) 590 28000 ???? - endif 591 28000 ???? - ifconst pokeysupport 592 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDPOKEY) 593 28000 ???? - endif 594 28000 ???? - ifconst HSSUPPORT 595 28000 ???? -BEADHARDWARE SET (BEADHARDWARE|BDHSC) 596 28000 ???? - endif 597 28000 ???? endif 598 28000 ???? 599 28000 ???? ;start address of cart... 600 28000 ???? - ifconst ROM48K 601 28000 ???? - ORG $4000,0 602 28000 ???? - ifconst BEADHEADER 603 28000 ???? - .byte $BE,$AD,BEADHARDWARE 604 28000 ???? - ifconst GAMEDESCRIPTIONSET 605 28000 ???? - CLC 606 28000 ???? - BCC _SKIPDESCRIPTION 607 28000 ???? - .byte GAMEDESCRIPTION,0 608 28000 ???? -_SKIPDESCRIPTION 609 28000 ???? - endif 610 28000 ???? - jmp ($FFFC) 611 28000 ???? - endif 612 28000 ???? else 613 28000 ???? ifconst bankswitchmode 614 28000 ???? - ifconst ROMAT4K 615 28000 ???? - ORG $4000,0 616 28000 ???? - RORG $4000 617 28000 ???? else 618 8000 ORG $8000,0 619 8000 RORG $8000 620 8000 endif 621 8000 - else ; not bankswitchmode 622 8000 - ifconst ROM16K 623 8000 - ORG $C000,0 624 8000 - ifconst BEADHEADER 625 8000 - .byte $BE,$AD,BEADHARDWARE 626 8000 - ifconst GAMEDESCRIPTION 627 8000 - CLC 628 8000 - BCC _SKIPDESCRIPTION 629 8000 - .byte GAMEDESCRIPTION,0 630 8000 -_SKIPDESCRIPTION 631 8000 - endif 632 8000 - jmp ($FFFC) 633 8000 - endif 634 8000 - else 635 8000 - ifconst ROM8K 636 8000 - ORG $E000,0 637 8000 - else 638 8000 - ORG $8000,0 639 8000 - ifconst BEADHEADER 640 8000 - .byte $BE,$AD,BEADHARDWARE 641 8000 - ifconst GAMEDESCRIPTION 642 8000 - CLC 643 8000 - BCC _SKIPDESCRIPTION 644 8000 - .byte GAMEDESCRIPTION,0 645 8000 -_SKIPDESCRIPTION 646 8000 - endif 647 8000 - jmp ($FFFC) 648 8000 - endif 649 8000 - endif 650 8000 - endif 651 8000 endif 652 8000 endif 653 8000 654 8000 ;7800basic v0.18 Mar 14 2021 14:27:24 655 8000 SPACEOVERFLOW SET 0 656 8000 game 657 8000 . 658 8000 ;; 659 8000 660 8000 . 661 8000 ;; 662 8000 663 8000 .L00 ;; set romsize 128kRAM 664 8000 665 8000 .L01 ;; set zoneheight 8 666 8000 667 8000 .L02 ;; set zoneprotection on 668 8000 669 8000 .L03 ;; set tallsprite on 670 8000 671 8000 .L04 ;; set screenheight 192 672 8000 673 8000 .L05 ;; set basepath gfx 674 8000 675 8000 .L06 ;; set tv ntsc 676 8000 677 8000 .L07 ;; set collisionwrap on 678 8000 679 8000 .L08 ;; set doublewide off 680 8000 681 8000 .L09 ;; displaymode 160A 682 8000 683 8000 a9 40 lda #%01000000 ;Enable DMA, mode=160x2/160x4 684 8002 85 3c sta CTRL 685 8004 686 8004 8d 07 21 sta sCTRL 687 8007 688 8007 . 689 8007 ;; 690 8007 691 8007 .L010 ;; dim frameCounter = var0 692 8007 693 8007 .L011 ;; dim playerX = var1 694 8007 695 8007 .L012 ;; dim playerY = var2 696 8007 697 8007 .L013 ;; dim fire_debounce = var3 698 8007 699 8007 .L014 ;; dim joyposup = var4 700 8007 701 8007 .L015 ;; dim joyposdown = var5 702 8007 703 8007 .L016 ;; dim joyposleft = var6 704 8007 705 8007 .L017 ;; dim joyposright = var7 706 8007 707 8007 .L018 ;; dim bulletX = var8 708 8007 709 8007 .L019 ;; dim bulletY = var9 710 8007 711 8007 .L020 ;; dim enemy_shotX = var10 712 8007 713 8007 .L021 ;; dim enemy_shotY = var11 714 8007 715 8007 .L022 ;; dim enemy_shotFlag = var12 716 8007 717 8007 .L023 ;; dim playerFlag = var13 718 8007 719 8007 .L024 ;; dim rMovement1 = var14 720 8007 721 8007 .L025 ;; dim rDirection = var15 722 8007 723 8007 .L026 ;; dim power_upX = var16 724 8007 725 8007 .L027 ;; dim power_upY = var17 726 8007 727 8007 .L028 ;; dim power_upFlag = var18 728 8007 729 8007 .L029 ;; dim rMovement2 = var19 730 8007 731 8007 .L030 ;; dim power_upSlowdown = var20 732 8007 733 8007 .L031 ;; dim bulletSlowdown = var21 734 8007 735 8007 .L032 ;; dim enemy_shotSlowdown = var22 736 8007 737 8007 .L033 ;; dim enemy01_X = var23 738 8007 739 8007 .L034 ;; dim enemy01_Y = var24 740 8007 741 8007 .L035 ;; dim enemy01_Flag = var25 742 8007 743 8007 .L036 ;; dim rMovement3 = var26 744 8007 745 8007 .L037 ;; dim rMovement4 = var27 746 8007 747 8007 .L038 ;; dim rMovement5 = var28 748 8007 749 8007 .L039 ;; dim rMovement6 = var29 750 8007 751 8007 .L040 ;; dim enemy01_speed = var30 752 8007 753 8007 .L041 ;; dim gameover_flag = var31 754 8007 755 8007 .L042 ;; dim extra_shipX = var32 756 8007 757 8007 .L043 ;; dim extra_shipY = var33 758 8007 759 8007 .L044 ;; dim extra_shipFlag = var34 760 8007 761 8007 .L045 ;; dim explosion_aniframe = var35 762 8007 763 8007 .L046 ;; dim lives = var36 764 8007 765 8007 .L047 ;; dim twinlaserX = var37 766 8007 767 8007 .L048 ;; dim twinlaserY = var38 768 8007 769 8007 .L049 ;; dim twinlaser_flag = var39 770 8007 771 8007 .L050 ;; dim twinlaser_Slowdown = var40 772 8007 773 8007 .L051 ;; dim continue_flag = var41 774 8007 775 8007 .L052 ;; dim isDead_flag = var42 776 8007 777 8007 .L053 ;; dim timer = var43 778 8007 779 8007 .L054 ;; dim enemy_shotDirection = var44 780 8007 781 8007 .L055 ;; dim enemy_shotXf = $2200 782 8007 783 8007 .L056 ;; dim enemy_shotYf = $2210 784 8007 785 8007 .L057 ;; dim enemy_shotSX = $2220 786 8007 787 8007 .L058 ;; dim enemy_shotSY = $2230 788 8007 789 8007 .L059 ;; dim enemy_shotSXf = $2240 790 8007 791 8007 .L060 ;; dim enemy_shotSYf = $2250 792 8007 793 8007 .L061 ;; dim total_XSu = var45 794 8007 795 8007 .L062 ;; dim total_XSf = var46 796 8007 797 8007 .L063 ;; dim total_speedX = total_XSu.total_XSf 798 8007 799 8007 .L064 ;; dim total_YSu = var47 800 8007 801 8007 .L065 ;; dim total_YSf = var48 802 8007 803 8007 .L066 ;; dim total_speedY = total_YSu.total_YSf 804 8007 805 8007 .L067 ;; dim temp_XSu = var49 806 8007 807 8007 .L068 ;; dim temp_XSf = var50 808 8007 809 8007 .L069 ;; dim temp_speedX = temp_XSu.temp_XSf 810 8007 811 8007 .L070 ;; dim temp_YSu = var51 812 8007 813 8007 .L071 ;; dim temp_YSf = var52 814 8007 815 8007 .L072 ;; dim temp_speedY = temp_YSu.temp_YSf 816 8007 817 8007 .L073 ;; dim mob_speedY = var98.var99 818 8007 819 8007 .L074 ;; dim mob_speedX = var96.var97 820 8007 821 8007 .L075 ;; dim mob_Y = var94.var95 822 8007 823 8007 .L076 ;; dim mob_X = var92.var93 824 8007 825 8007 .L077 ;; dim enemy01_Slowdown = var55 826 8007 827 8007 .L078 ;; dim customTemp1 = a 828 8007 829 8007 .L079 ;; dim customTemp2 = b 830 8007 831 8007 .L080 ;; dim customTemp3 = c 832 8007 833 8007 .L081 ;; dim customTemp4 = d 834 8007 835 8007 . 836 8007 ;; 837 8007 838 8007 .L082 ;; characterset vertical_shooting_font 839 8007 840 8007 a9 b0 lda #>vertical_shooting_font 841 8009 8d 0b 21 sta sCHARBASE 842 800c 843 800c 85 34 sta CHARBASE 844 800e a9 60 lda #(vertical_shooting_font_mode | %01100000) 845 8010 8d 06 21 sta charactermode 846 8013 847 8013 .L083 ;; alphachars ' 0123456789abcdefghijklmnopqrstuvwxyz.,?!:;`"' 848 8013 849 8013 . 850 8013 ;; 851 8013 852 8013 .import 853 8013 ;; import 854 8013 855 8013 .L084 ;; incgraphic vertical_shooting_font.png 160A 856 8013 857 8013 .L085 ;; incgraphic vertical_shooting_ship.png 160A 858 8013 859 8013 .L086 ;; incgraphic vertical_shooting_bullet.png 160A 860 8013 861 8013 .L087 ;; incgraphic vertical_shooting_enemyshot.png 160A 862 8013 863 8013 .L088 ;; incgraphic vertical_shooting_powerup.png 160A 864 8013 865 8013 .L089 ;; incgraphic vertical_shooting_enemy01.png 160A 866 8013 867 8013 . 868 8013 ;; 869 8013 870 8013 .L090 ;; incgraphic vertical_shooting_1up.png 160A 871 8013 872 8013 .L091 ;; incgraphic vertical_shooting_explosion_01.png 160A 873 8013 874 8013 .L092 ;; incgraphic vertical_shooting_explosion_02.png 160A 875 8013 876 8013 .L093 ;; incgraphic vertical_shooting_explosion_03.png 160A 877 8013 878 8013 .L094 ;; incgraphic vertical_shooting_explosion_04.png 160A 879 8013 880 8013 .L095 ;; incgraphic vertical_shooting_explosion_05.png 160A 881 8013 882 8013 .L096 ;; incgraphic vertical_shooting_explosion_06.png 160A 883 8013 884 8013 .L097 ;; incgraphic vertical_shooting_explosion_07.png 160A 885 8013 886 8013 .L098 ;; incgraphic vertical_shooting_explosion_08.png 160A 887 8013 888 8013 .L099 ;; incgraphic vertical_shooting_explosion_09.png 160A 889 8013 890 8013 .L0100 ;; incgraphic vertical_shooting_explosion_10.png 160A 891 8013 892 8013 .L0101 ;; incgraphic vertical_shooting_laser.png 160A 893 8013 894 8013 . 895 8013 ;; 896 8013 897 8013 .L0102 ;; const firing_rate = 15 898 8013 899 8013 . 900 8013 ;; 901 8013 902 8013 .L0103 ;; const TRUE = 1 903 8013 904 8013 .L0104 ;; const FALSE = 0 905 8013 906 8013 . 907 8013 ;; 908 8013 909 8013 . 910 8013 ;; 911 8013 912 8013 .palettes 913 8013 ;; palettes 914 8013 915 8013 .L0105 ;; P0C1 = $0F : P0C2 = $05 : P0C3 = $32 916 8013 917 8013 a9 0f LDA #$0F 918 8015 85 21 STA P0C1 919 8017 a9 05 LDA #$05 920 8019 85 22 STA P0C2 921 801b a9 32 LDA #$32 922 801d 85 23 STA P0C3 923 801f .L0106 ;; P1C1 = $0F : P1C2 = $EE : P1C3 = $E7 924 801f 925 801f a9 0f LDA #$0F 926 8021 85 25 STA P1C1 927 8023 a9 ee LDA #$EE 928 8025 85 26 STA P1C2 929 8027 a9 e7 LDA #$E7 930 8029 85 27 STA P1C3 931 802b .L0107 ;; P2C1 = $9D : P2C2 = $73 : P2C3 = $88 932 802b 933 802b a9 9d LDA #$9D 934 802d 85 29 STA P2C1 935 802f a9 73 LDA #$73 936 8031 85 2a STA P2C2 937 8033 a9 88 LDA #$88 938 8035 85 2b STA P2C3 939 8037 .L0108 ;; P3C1 = $FB : P3C2 = $F2 : P3C3 = $25 940 8037 941 8037 a9 fb LDA #$FB 942 8039 85 2d STA P3C1 943 803b a9 f2 LDA #$F2 944 803d 85 2e STA P3C2 945 803f a9 25 LDA #$25 946 8041 85 2f STA P3C3 947 8043 . 948 8043 ;; 949 8043 950 8043 .plot 951 8043 ;; plot 952 8043 953 8043 .L0109 ;; playerX = 80 : playerY = 144 : playerFlag = 0 954 8043 955 8043 a9 50 LDA #80 956 8045 8d 41 01 STA playerX 957 8048 a9 90 LDA #144 958 804a 8d 42 01 STA playerY 959 804d a9 00 LDA #0 960 804f 8d 4d 01 STA playerFlag 961 8052 .L0110 ;; isDead_flag = 0 : gameover_flag = 0 962 8052 963 8052 a9 00 LDA #0 964 8054 8d 6a 01 STA isDead_flag 965 8057 8d 5f 01 STA gameover_flag 966 805a .L0111 ;; bulletX = 0 : bulletY = 0 : bulletSlowdown = 0 967 805a 968 805a a9 00 LDA #0 969 805c 8d 48 01 STA bulletX 970 805f 8d 49 01 STA bulletY 971 8062 8d 55 01 STA bulletSlowdown 972 8065 .L0112 ;; frameCounter = 0 973 8065 974 8065 a9 00 LDA #0 975 8067 8d 40 01 STA frameCounter 976 806a .L0113 ;; rMovement1 = 1 : rMovement2 = 1 : rMovement3 = 1 : rMovement4 = 1 977 806a 978 806a a9 01 LDA #1 979 806c 8d 4e 01 STA rMovement1 980 806f 8d 53 01 STA rMovement2 981 8072 8d 5a 01 STA rMovement3 982 8075 8d 5b 01 STA rMovement4 983 8078 .L0114 ;; rMovement5 = 1 : rMovement6 = 1 : rDirection = 1 984 8078 985 8078 a9 01 LDA #1 986 807a 8d 5c 01 STA rMovement5 987 807d 8d 5d 01 STA rMovement6 988 8080 8d 4f 01 STA rDirection 989 8083 .L0115 ;; power_upX = 5 : power_upY = 32 : power_upFlag = 0 : power_upSlowdown = 0 990 8083 991 8083 a9 05 LDA #5 992 8085 8d 50 01 STA power_upX 993 8088 a9 20 LDA #32 994 808a 8d 51 01 STA power_upY 995 808d a9 00 LDA #0 996 808f 8d 52 01 STA power_upFlag 997 8092 8d 54 01 STA power_upSlowdown 998 8095 .L0116 ;; twinlaserX = 0 : twinlaserY = 0 : twinlaser_flag = 0 : twinlaser_Slowdown = 0 999 8095 1000 8095 a9 00 LDA #0 1001 8097 8d 65 01 STA twinlaserX 1002 809a 8d 66 01 STA twinlaserY 1003 809d 8d 67 01 STA twinlaser_flag 1004 80a0 8d 68 01 STA twinlaser_Slowdown 1005 80a3 .L0117 ;; enemy_shotX = 0 : enemy_shotY = 0 : enemy_shotFlag = 0 : enemy_shotSlowdown = 0 1006 80a3 1007 80a3 a9 00 LDA #0 1008 80a5 8d 4a 01 STA enemy_shotX 1009 80a8 8d 4b 01 STA enemy_shotY 1010 80ab 8d 4c 01 STA enemy_shotFlag 1011 80ae 8d 56 01 STA enemy_shotSlowdown 1012 80b1 .L0118 ;; enemy01_X = 0 : enemy01_Y = 0 : enemy01_Flag = 0 : enemy01_speed = 3 : enemy01_Slowdown = 0 1013 80b1 1014 80b1 a9 00 LDA #0 1015 80b3 8d 57 01 STA enemy01_X 1016 80b6 8d 58 01 STA enemy01_Y 1017 80b9 8d 59 01 STA enemy01_Flag 1018 80bc a9 03 LDA #3 1019 80be 8d 5e 01 STA enemy01_speed 1020 80c1 a9 00 LDA #0 1021 80c3 8d 77 01 STA enemy01_Slowdown 1022 80c6 .L0119 ;; extra_shipX = 0 : extra_shipY = 0 : extra_shipFlag = 0 1023 80c6 1024 80c6 a9 00 LDA #0 1025 80c8 8d 60 01 STA extra_shipX 1026 80cb 8d 61 01 STA extra_shipY 1027 80ce 8d 62 01 STA extra_shipFlag 1028 80d1 .L0120 ;; joyposleft = 0 : joyposright = 0 : joyposup = 0 : joyposdown = 0 1029 80d1 1030 80d1 a9 00 LDA #0 1031 80d3 8d 46 01 STA joyposleft 1032 80d6 8d 47 01 STA joyposright 1033 80d9 8d 44 01 STA joyposup 1034 80dc 8d 45 01 STA joyposdown 1035 80df . 1036 80df ;; 1037 80df 1038 80df .L0121 ;; gosub titlescreen 1039 80df 1040 80df 20 78 8f jsr .titlescreen 1041 80e2 1042 80e2 . 1043 80e2 ;; 1044 80e2 1045 80e2 .L0122 ;; gosub initialise_gamescreen 1046 80e2 1047 80e2 20 85 90 jsr .initialise_gamescreen 1048 80e5 1049 80e5 .L0123 ;; timer = firing_rate 1050 80e5 1051 80e5 a9 0f LDA #firing_rate 1052 80e7 8d 6b 01 STA timer 1053 80ea . 1054 80ea ;; 1055 80ea 1056 80ea .main 1057 80ea ;; main 1058 80ea 1059 80ea .L0124 ;; frameCounter = frameCounter + 1 1060 80ea 1061 80ea ad 40 01 LDA frameCounter 1062 80ed 18 CLC 1063 80ee 69 01 ADC #1 1064 80f0 8d 40 01 STA frameCounter 1065 80f3 .L0125 ;; if frameCounter > 10 then frameCounter = 0 1066 80f3 1067 80f3 a9 0a LDA #10 1068 80f5 cd 40 01 CMP frameCounter 1069 80f8 b0 05 BCS .skipL0125 1070 80fa .condpart0 1071 80fa a9 00 LDA #0 1072 80fc 8d 40 01 STA frameCounter 1073 80ff .skipL0125 1074 80ff .mainloop 1075 80ff ;; mainloop 1076 80ff 1077 80ff .L0126 ;; timer = timer - 1 1078 80ff 1079 80ff ad 6b 01 LDA timer 1080 8102 38 SEC 1081 8103 e9 01 SBC #1 1082 8105 8d 6b 01 STA timer 1083 8108 .L0127 ;; if timer = 0 then gosub fire_enemybullet : timer = firing_rate 1084 8108 1085 8108 ad 6b 01 LDA timer 1086 810b c9 00 CMP #0 1087 810d d0 08 BNE .skipL0127 1088 810f .condpart1 1089 810f 20 99 90 jsr .fire_enemybullet 1090 8112 a9 0f LDA #firing_rate 1091 8114 8d 6b 01 STA timer 1092 8117 .skipL0127 1093 8117 . 1094 8117 ;; 1095 8117 1096 8117 .L0128 ;; rMovement1 = ( rand & 7 ) - 2 1097 8117 1098 8117 ; complex statement detected 1099 8117 20 f0 f3 jsr randomize 1100 811a 29 07 AND #7 1101 811c 38 SEC 1102 811d e9 02 SBC #2 1103 811f 8d 4e 01 STA rMovement1 1104 8122 .L0129 ;; rMovement2 = ( rand & 6 ) 1105 8122 1106 8122 ; complex statement detected 1107 8122 20 f0 f3 jsr randomize 1108 8125 29 06 AND #6 1109 8127 8d 53 01 STA rMovement2 1110 812a .L0130 ;; rMovement3 = ( rand & 3 ) + 1 1111 812a 1112 812a ; complex statement detected 1113 812a 20 f0 f3 jsr randomize 1114 812d 29 03 AND #3 1115 812f 18 CLC 1116 8130 69 01 ADC #1 1117 8132 8d 5a 01 STA rMovement3 1118 8135 .L0131 ;; rMovement4 = ( rand & 5 ) + 2 1119 8135 1120 8135 ; complex statement detected 1121 8135 20 f0 f3 jsr randomize 1122 8138 29 05 AND #5 1123 813a 18 CLC 1124 813b 69 02 ADC #2 1125 813d 8d 5b 01 STA rMovement4 1126 8140 .L0132 ;; rMovement5 = ( rand & 5 ) + 1 1127 8140 1128 8140 ; complex statement detected 1129 8140 20 f0 f3 jsr randomize 1130 8143 29 05 AND #5 1131 8145 18 CLC 1132 8146 69 01 ADC #1 1133 8148 8d 5c 01 STA rMovement5 1134 814b .L0133 ;; rMovement6 = ( rand & 6 ) - 1 1135 814b 1136 814b ; complex statement detected 1137 814b 20 f0 f3 jsr randomize 1138 814e 29 06 AND #6 1139 8150 38 SEC 1140 8151 e9 01 SBC #1 1141 8153 8d 5d 01 STA rMovement6 1142 8156 .L0134 ;; rDirection = ( rand & 4 ) 1143 8156 1144 8156 ; complex statement detected 1145 8156 20 f0 f3 jsr randomize 1146 8159 29 04 AND #4 1147 815b 8d 4f 01 STA rDirection 1148 815e .L0135 ;; if switchreset then reboot 1149 815e 1150 815e 20 85 f4 jsr checkresetswitch 1151 8161 d0 03 BNE .skipL0135 1152 8163 .condpart2 1153 8163 4c 72 f5 JMP START 1154 8166 .skipL0135 1155 8166 . 1156 8166 ;; 1157 8166 1158 8166 .L0136 ;; if joy0up && joyposup = - 2 then gosub SetBulletHome 1159 8166 1160 8166 a9 10 lda #$10 1161 8168 2c 80 02 bit SWCHA 1162 816b d0 10 BNE .skipL0136 1163 816d .condpart3 1164 816d ; complex condition detected 1165 816d a9 fe LDA #254 1166 816f 48 PHA 1167 8170 ba TSX 1168 8171 68 PLA 1169 8172 ad 44 01 LDA joyposup 1170 8175 dd 01 01 CMP $101,x 1171 8178 d0 03 BNE .skip3then 1172 817a .condpart4 1173 817a 20 13 8e jsr .SetBulletHome 1174 817d 1175 817d .skip3then 1176 817d .skipL0136 1177 817d .L0137 ;; if joy0down && joyposdown = - 2 then gosub SetBulletHome 1178 817d 1179 817d a9 20 lda #$20 1180 817f 2c 80 02 bit SWCHA 1181 8182 d0 10 BNE .skipL0137 1182 8184 .condpart5 1183 8184 ; complex condition detected 1184 8184 a9 fe LDA #254 1185 8186 48 PHA 1186 8187 ba TSX 1187 8188 68 PLA 1188 8189 ad 45 01 LDA joyposdown 1189 818c dd 01 01 CMP $101,x 1190 818f d0 03 BNE .skip5then 1191 8191 .condpart6 1192 8191 20 13 8e jsr .SetBulletHome 1193 8194 1194 8194 .skip5then 1195 8194 .skipL0137 1196 8194 .L0138 ;; if joy0up && joyposleft = - 2 then gosub SetBulletHome 1197 8194 1198 8194 a9 10 lda #$10 1199 8196 2c 80 02 bit SWCHA 1200 8199 d0 10 BNE .skipL0138 1201 819b .condpart7 1202 819b ; complex condition detected 1203 819b a9 fe LDA #254 1204 819d 48 PHA 1205 819e ba TSX 1206 819f 68 PLA 1207 81a0 ad 46 01 LDA joyposleft 1208 81a3 dd 01 01 CMP $101,x 1209 81a6 d0 03 BNE .skip7then 1210 81a8 .condpart8 1211 81a8 20 13 8e jsr .SetBulletHome 1212 81ab 1213 81ab .skip7then 1214 81ab .skipL0138 1215 81ab .L0139 ;; if joy0down && joyposright = - 2 then gosub SetBulletHome 1216 81ab 1217 81ab a9 20 lda #$20 1218 81ad 2c 80 02 bit SWCHA 1219 81b0 d0 10 BNE .skipL0139 1220 81b2 .condpart9 1221 81b2 ; complex condition detected 1222 81b2 a9 fe LDA #254 1223 81b4 48 PHA 1224 81b5 ba TSX 1225 81b6 68 PLA 1226 81b7 ad 47 01 LDA joyposright 1227 81ba dd 01 01 CMP $101,x 1228 81bd d0 03 BNE .skip9then 1229 81bf .condpart10 1230 81bf 20 13 8e jsr .SetBulletHome 1231 81c2 1232 81c2 .skip9then 1233 81c2 .skipL0139 1234 81c2 .L0140 ;; if joy0up && joyposup = - 2 then gosub SetLaserHome 1235 81c2 1236 81c2 a9 10 lda #$10 1237 81c4 2c 80 02 bit SWCHA 1238 81c7 d0 10 BNE .skipL0140 1239 81c9 .condpart11 1240 81c9 ; complex condition detected 1241 81c9 a9 fe LDA #254 1242 81cb 48 PHA 1243 81cc ba TSX 1244 81cd 68 PLA 1245 81ce ad 44 01 LDA joyposup 1246 81d1 dd 01 01 CMP $101,x 1247 81d4 d0 03 BNE .skip11then 1248 81d6 .condpart12 1249 81d6 20 2f 8e jsr .SetLaserHome 1250 81d9 1251 81d9 .skip11then 1252 81d9 .skipL0140 1253 81d9 .L0141 ;; if joy0down && joyposdown = - 2 then gosub SetLaserHome 1254 81d9 1255 81d9 a9 20 lda #$20 1256 81db 2c 80 02 bit SWCHA 1257 81de d0 10 BNE .skipL0141 1258 81e0 .condpart13 1259 81e0 ; complex condition detected 1260 81e0 a9 fe LDA #254 1261 81e2 48 PHA 1262 81e3 ba TSX 1263 81e4 68 PLA 1264 81e5 ad 45 01 LDA joyposdown 1265 81e8 dd 01 01 CMP $101,x 1266 81eb d0 03 BNE .skip13then 1267 81ed .condpart14 1268 81ed 20 2f 8e jsr .SetLaserHome 1269 81f0 1270 81f0 .skip13then 1271 81f0 .skipL0141 1272 81f0 .L0142 ;; if joy0up && joyposleft = - 2 then gosub SetLaserHome 1273 81f0 1274 81f0 a9 10 lda #$10 1275 81f2 2c 80 02 bit SWCHA 1276 81f5 d0 10 BNE .skipL0142 1277 81f7 .condpart15 1278 81f7 ; complex condition detected 1279 81f7 a9 fe LDA #254 1280 81f9 48 PHA 1281 81fa ba TSX 1282 81fb 68 PLA 1283 81fc ad 46 01 LDA joyposleft 1284 81ff dd 01 01 CMP $101,x 1285 8202 d0 03 BNE .skip15then 1286 8204 .condpart16 1287 8204 20 2f 8e jsr .SetLaserHome 1288 8207 1289 8207 .skip15then 1290 8207 .skipL0142 1291 8207 .L0143 ;; if joy0down && joyposright = - 2 then gosub SetLaserHome 1292 8207 1293 8207 a9 20 lda #$20 1294 8209 2c 80 02 bit SWCHA 1295 820c d0 10 BNE .skipL0143 1296 820e .condpart17 1297 820e ; complex condition detected 1298 820e a9 fe LDA #254 1299 8210 48 PHA 1300 8211 ba TSX 1301 8212 68 PLA 1302 8213 ad 47 01 LDA joyposright 1303 8216 dd 01 01 CMP $101,x 1304 8219 d0 03 BNE .skip17then 1305 821b .condpart18 1306 821b 20 2f 8e jsr .SetLaserHome 1307 821e 1308 821e .skip17then 1309 821e .skipL0143 1310 821e .L0144 ;; if joy0up then playerY = playerY - 1 : joyposup = 1 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 1311 821e 1312 821e a9 10 lda #$10 1313 8220 2c 80 02 bit SWCHA 1314 8223 d0 19 BNE .skipL0144 1315 8225 .condpart19 1316 8225 ad 42 01 LDA playerY 1317 8228 38 SEC 1318 8229 e9 01 SBC #1 1319 822b 8d 42 01 STA playerY 1320 822e a9 01 LDA #1 1321 8230 8d 44 01 STA joyposup 1322 8233 a9 00 LDA #0 1323 8235 8d 45 01 STA joyposdown 1324 8238 8d 46 01 STA joyposleft 1325 823b 8d 47 01 STA joyposright 1326 823e .skipL0144 1327 823e .L0145 ;; if joy0down then playerY = playerY + 1 : joyposup = 0 : joyposdown = 1 : joyposleft = 0 : joyposright = 0 1328 823e 1329 823e a9 20 lda #$20 1330 8240 2c 80 02 bit SWCHA 1331 8243 d0 1b BNE .skipL0145 1332 8245 .condpart20 1333 8245 ad 42 01 LDA playerY 1334 8248 18 CLC 1335 8249 69 01 ADC #1 1336 824b 8d 42 01 STA playerY 1337 824e a9 00 LDA #0 1338 8250 8d 44 01 STA joyposup 1339 8253 a9 01 LDA #1 1340 8255 8d 45 01 STA joyposdown 1341 8258 a9 00 LDA #0 1342 825a 8d 46 01 STA joyposleft 1343 825d 8d 47 01 STA joyposright 1344 8260 .skipL0145 1345 8260 .L0146 ;; if joy0left then playerX = playerX - 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 1 : joyposright = 0 1346 8260 1347 8260 2c 80 02 bit SWCHA 1348 8263 70 1b BVS .skipL0146 1349 8265 .condpart21 1350 8265 ad 41 01 LDA playerX 1351 8268 38 SEC 1352 8269 e9 01 SBC #1 1353 826b 8d 41 01 STA playerX 1354 826e a9 00 LDA #0 1355 8270 8d 44 01 STA joyposup 1356 8273 8d 45 01 STA joyposdown 1357 8276 a9 01 LDA #1 1358 8278 8d 46 01 STA joyposleft 1359 827b a9 00 LDA #0 1360 827d 8d 47 01 STA joyposright 1361 8280 .skipL0146 1362 8280 .L0147 ;; if joy0right then playerX = playerX + 1 : joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 1 1363 8280 1364 8280 2c 80 02 bit SWCHA 1365 8283 30 19 BMI .skipL0147 1366 8285 .condpart22 1367 8285 ad 41 01 LDA playerX 1368 8288 18 CLC 1369 8289 69 01 ADC #1 1370 828b 8d 41 01 STA playerX 1371 828e a9 00 LDA #0 1372 8290 8d 44 01 STA joyposup 1373 8293 8d 45 01 STA joyposdown 1374 8296 8d 46 01 STA joyposleft 1375 8299 a9 01 LDA #1 1376 829b 8d 47 01 STA joyposright 1377 829e .skipL0147 1378 829e .L0148 ;; if joy0fire && joyposup = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1379 829e 1380 829e 2c 02 21 bit sINPT1 1381 82a1 10 29 BPL .skipL0148 1382 82a3 .condpart23 1383 82a3 ad 44 01 LDA joyposup 1384 82a6 c9 01 CMP #1 1385 82a8 d0 22 BNE .skip23then 1386 82aa .condpart24 1387 82aa ad 49 01 LDA bulletY 1388 82ad 38 SEC 1389 82ae e9 05 SBC #5 1390 82b0 8d 49 01 STA bulletY 1391 82b3 ifnconst NOTIALOCKMUTE 1392 82b3 a9 01 lda #1 1393 82b5 85 de sta sfxschedulelock 1394 82b7 a9 ec lda #sfx_pulsecannon 1397 82bd 85 e1 sta sfxinstrumenthi 1398 82bf a9 00 lda #0 1399 82c1 85 e2 sta sfxpitchoffset ; no pitch modification 1400 82c3 85 e3 sta sfxnoteindex ; not a musical note 1401 82c5 20 4b f2 jsr schedulesfx 1402 82c8 a9 00 lda #0 1403 82ca 85 de sta sfxschedulelock 1404 82cc endif ; NOTIALOCKMUTE 1405 82cc .skip23then 1406 82cc .skipL0148 1407 82cc .L0149 ;; if joy0fire && joyposdown = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1408 82cc 1409 82cc 2c 02 21 bit sINPT1 1410 82cf 10 29 BPL .skipL0149 1411 82d1 .condpart25 1412 82d1 ad 45 01 LDA joyposdown 1413 82d4 c9 01 CMP #1 1414 82d6 d0 22 BNE .skip25then 1415 82d8 .condpart26 1416 82d8 ad 49 01 LDA bulletY 1417 82db 38 SEC 1418 82dc e9 05 SBC #5 1419 82de 8d 49 01 STA bulletY 1420 82e1 ifnconst NOTIALOCKMUTE 1421 82e1 a9 01 lda #1 1422 82e3 85 de sta sfxschedulelock 1423 82e5 a9 ec lda #sfx_pulsecannon 1426 82eb 85 e1 sta sfxinstrumenthi 1427 82ed a9 00 lda #0 1428 82ef 85 e2 sta sfxpitchoffset ; no pitch modification 1429 82f1 85 e3 sta sfxnoteindex ; not a musical note 1430 82f3 20 4b f2 jsr schedulesfx 1431 82f6 a9 00 lda #0 1432 82f8 85 de sta sfxschedulelock 1433 82fa endif ; NOTIALOCKMUTE 1434 82fa .skip25then 1435 82fa .skipL0149 1436 82fa .L0150 ;; if joy0fire && joyposleft = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1437 82fa 1438 82fa 2c 02 21 bit sINPT1 1439 82fd 10 29 BPL .skipL0150 1440 82ff .condpart27 1441 82ff ad 46 01 LDA joyposleft 1442 8302 c9 01 CMP #1 1443 8304 d0 22 BNE .skip27then 1444 8306 .condpart28 1445 8306 ad 49 01 LDA bulletY 1446 8309 38 SEC 1447 830a e9 05 SBC #5 1448 830c 8d 49 01 STA bulletY 1449 830f ifnconst NOTIALOCKMUTE 1450 830f a9 01 lda #1 1451 8311 85 de sta sfxschedulelock 1452 8313 a9 ec lda #sfx_pulsecannon 1455 8319 85 e1 sta sfxinstrumenthi 1456 831b a9 00 lda #0 1457 831d 85 e2 sta sfxpitchoffset ; no pitch modification 1458 831f 85 e3 sta sfxnoteindex ; not a musical note 1459 8321 20 4b f2 jsr schedulesfx 1460 8324 a9 00 lda #0 1461 8326 85 de sta sfxschedulelock 1462 8328 endif ; NOTIALOCKMUTE 1463 8328 .skip27then 1464 8328 .skipL0150 1465 8328 .L0151 ;; if joy0fire && joyposright = 1 then bulletY = bulletY - 5 : playsfx sfx_pulsecannon 1466 8328 1467 8328 2c 02 21 bit sINPT1 1468 832b 10 29 BPL .skipL0151 1469 832d .condpart29 1470 832d ad 47 01 LDA joyposright 1471 8330 c9 01 CMP #1 1472 8332 d0 22 BNE .skip29then 1473 8334 .condpart30 1474 8334 ad 49 01 LDA bulletY 1475 8337 38 SEC 1476 8338 e9 05 SBC #5 1477 833a 8d 49 01 STA bulletY 1478 833d ifnconst NOTIALOCKMUTE 1479 833d a9 01 lda #1 1480 833f 85 de sta sfxschedulelock 1481 8341 a9 ec lda #sfx_pulsecannon 1484 8347 85 e1 sta sfxinstrumenthi 1485 8349 a9 00 lda #0 1486 834b 85 e2 sta sfxpitchoffset ; no pitch modification 1487 834d 85 e3 sta sfxnoteindex ; not a musical note 1488 834f 20 4b f2 jsr schedulesfx 1489 8352 a9 00 lda #0 1490 8354 85 de sta sfxschedulelock 1491 8356 endif ; NOTIALOCKMUTE 1492 8356 .skip29then 1493 8356 .skipL0151 1494 8356 .L0152 ;; if !joy0fire then bulletX = playerX + 2 : bulletY = playerY - 8 1495 8356 1496 8356 2c 02 21 bit sINPT1 1497 8359 30 12 BMI .skipL0152 1498 835b .condpart31 1499 835b ad 41 01 LDA playerX 1500 835e 18 CLC 1501 835f 69 02 ADC #2 1502 8361 8d 48 01 STA bulletX 1503 8364 ad 42 01 LDA playerY 1504 8367 38 SEC 1505 8368 e9 08 SBC #8 1506 836a 8d 49 01 STA bulletY 1507 836d .skipL0152 1508 836d . 1509 836d ;; 1510 836d 1511 836d .L0153 ;; enemy_shotSlowdown = enemy_shotSlowdown + 1 1512 836d 1513 836d ad 56 01 LDA enemy_shotSlowdown 1514 8370 18 CLC 1515 8371 69 01 ADC #1 1516 8373 8d 56 01 STA enemy_shotSlowdown 1517 8376 .L0154 ;; if enemy_shotSlowdown > 8 then enemy_shotSlowdown = 0 1518 8376 1519 8376 a9 08 LDA #8 1520 8378 cd 56 01 CMP enemy_shotSlowdown 1521 837b b0 05 BCS .skipL0154 1522 837d .condpart32 1523 837d a9 00 LDA #0 1524 837f 8d 56 01 STA enemy_shotSlowdown 1525 8382 .skipL0154 1526 8382 . 1527 8382 ;; 1528 8382 1529 8382 .L0155 ;; enemy01_Slowdown = enemy01_Slowdown + 1 1530 8382 1531 8382 ad 77 01 LDA enemy01_Slowdown 1532 8385 18 CLC 1533 8386 69 01 ADC #1 1534 8388 8d 77 01 STA enemy01_Slowdown 1535 838b .L0156 ;; if enemy01_Slowdown > 8 then enemy01_Slowdown = 0 1536 838b 1537 838b a9 08 LDA #8 1538 838d cd 77 01 CMP enemy01_Slowdown 1539 8390 b0 05 BCS .skipL0156 1540 8392 .condpart33 1541 8392 a9 00 LDA #0 1542 8394 8d 77 01 STA enemy01_Slowdown 1543 8397 .skipL0156 1544 8397 . 1545 8397 ;; 1546 8397 1547 8397 .L0157 ;; bulletSlowdown = bulletSlowdown + 1 1548 8397 1549 8397 ad 55 01 LDA bulletSlowdown 1550 839a 18 CLC 1551 839b 69 01 ADC #1 1552 839d 8d 55 01 STA bulletSlowdown 1553 83a0 .L0158 ;; if bulletSlowdown > 6 then bulletSlowdown = 0 1554 83a0 1555 83a0 a9 06 LDA #6 1556 83a2 cd 55 01 CMP bulletSlowdown 1557 83a5 b0 05 BCS .skipL0158 1558 83a7 .condpart34 1559 83a7 a9 00 LDA #0 1560 83a9 8d 55 01 STA bulletSlowdown 1561 83ac .skipL0158 1562 83ac . 1563 83ac ;; 1564 83ac 1565 83ac .L0159 ;; power_upSlowdown = power_upSlowdown + 1 1566 83ac 1567 83ac ad 54 01 LDA power_upSlowdown 1568 83af 18 CLC 1569 83b0 69 01 ADC #1 1570 83b2 8d 54 01 STA power_upSlowdown 1571 83b5 .L0160 ;; if power_upSlowdown > 7 then power_upSlowdown = 0 1572 83b5 1573 83b5 a9 07 LDA #7 1574 83b7 cd 54 01 CMP power_upSlowdown 1575 83ba b0 05 BCS .skipL0160 1576 83bc .condpart35 1577 83bc a9 00 LDA #0 1578 83be 8d 54 01 STA power_upSlowdown 1579 83c1 .skipL0160 1580 83c1 . 1581 83c1 ;; 1582 83c1 1583 83c1 .L0161 ;; twinlaser_Slowdown = twinlaser_Slowdown + 1 1584 83c1 1585 83c1 ad 68 01 LDA twinlaser_Slowdown 1586 83c4 18 CLC 1587 83c5 69 01 ADC #1 1588 83c7 8d 68 01 STA twinlaser_Slowdown 1589 83ca .L0162 ;; if twinlaser_Slowdown > 5 then twinlaser_Slowdown = 0 1590 83ca 1591 83ca a9 05 LDA #5 1592 83cc cd 68 01 CMP twinlaser_Slowdown 1593 83cf b0 05 BCS .skipL0162 1594 83d1 .condpart36 1595 83d1 a9 00 LDA #0 1596 83d3 8d 68 01 STA twinlaser_Slowdown 1597 83d6 .skipL0162 1598 83d6 . 1599 83d6 ;; 1600 83d6 1601 83d6 .L0163 ;; if playerX > 152 then playerX = playerX - 1 1602 83d6 1603 83d6 a9 98 LDA #152 1604 83d8 cd 41 01 CMP playerX 1605 83db b0 09 BCS .skipL0163 1606 83dd .condpart37 1607 83dd ad 41 01 LDA playerX 1608 83e0 38 SEC 1609 83e1 e9 01 SBC #1 1610 83e3 8d 41 01 STA playerX 1611 83e6 .skipL0163 1612 83e6 .L0164 ;; if playerX < 1 then playerX = playerX + 1 1613 83e6 1614 83e6 ad 41 01 LDA playerX 1615 83e9 c9 01 CMP #1 1616 83eb b0 09 BCS .skipL0164 1617 83ed .condpart38 1618 83ed ad 41 01 LDA playerX 1619 83f0 18 CLC 1620 83f1 69 01 ADC #1 1621 83f3 8d 41 01 STA playerX 1622 83f6 .skipL0164 1623 83f6 .L0165 ;; if playerY > 177 then playerY = playerY - 1 1624 83f6 1625 83f6 a9 b1 LDA #177 1626 83f8 cd 42 01 CMP playerY 1627 83fb b0 09 BCS .skipL0165 1628 83fd .condpart39 1629 83fd ad 42 01 LDA playerY 1630 8400 38 SEC 1631 8401 e9 01 SBC #1 1632 8403 8d 42 01 STA playerY 1633 8406 .skipL0165 1634 8406 .L0166 ;; if playerY < 1 then playerY = playerY + 1 1635 8406 1636 8406 ad 42 01 LDA playerY 1637 8409 c9 01 CMP #1 1638 840b b0 09 BCS .skipL0166 1639 840d .condpart40 1640 840d ad 42 01 LDA playerY 1641 8410 18 CLC 1642 8411 69 01 ADC #1 1643 8413 8d 42 01 STA playerY 1644 8416 .skipL0166 1645 8416 .L0167 ;; if bulletY > 183 then bulletY = bulletY - 1 1646 8416 1647 8416 a9 b7 LDA #183 1648 8418 cd 49 01 CMP bulletY 1649 841b b0 09 BCS .skipL0167 1650 841d .condpart41 1651 841d ad 49 01 LDA bulletY 1652 8420 38 SEC 1653 8421 e9 01 SBC #1 1654 8423 8d 49 01 STA bulletY 1655 8426 .skipL0167 1656 8426 .L0168 ;; if bulletY < 1 then bulletY = bulletY + 1 1657 8426 1658 8426 ad 49 01 LDA bulletY 1659 8429 c9 01 CMP #1 1660 842b b0 09 BCS .skipL0168 1661 842d .condpart42 1662 842d ad 49 01 LDA bulletY 1663 8430 18 CLC 1664 8431 69 01 ADC #1 1665 8433 8d 49 01 STA bulletY 1666 8436 .skipL0168 1667 8436 .L0169 ;; if twinlaserY > 183 then twinlaserY = twinlaserY - 1 1668 8436 1669 8436 a9 b7 LDA #183 1670 8438 cd 66 01 CMP twinlaserY 1671 843b b0 09 BCS .skipL0169 1672 843d .condpart43 1673 843d ad 66 01 LDA twinlaserY 1674 8440 38 SEC 1675 8441 e9 01 SBC #1 1676 8443 8d 66 01 STA twinlaserY 1677 8446 .skipL0169 1678 8446 .L0170 ;; if twinlaserY < 1 then twinlaserY = twinlaserY + 1 1679 8446 1680 8446 ad 66 01 LDA twinlaserY 1681 8449 c9 01 CMP #1 1682 844b b0 09 BCS .skipL0170 1683 844d .condpart44 1684 844d ad 66 01 LDA twinlaserY 1685 8450 18 CLC 1686 8451 69 01 ADC #1 1687 8453 8d 66 01 STA twinlaserY 1688 8456 .skipL0170 1689 8456 . 1690 8456 ;; 1691 8456 1692 8456 .L0171 ;; gosub check_collisions 1693 8456 1694 8456 20 52 89 jsr .check_collisions 1695 8459 1696 8459 .L0172 ;; if isDead_flag then goto lose_a_life 1697 8459 1698 8459 ad 6a 01 LDA isDead_flag 1699 845c f0 03 BEQ .skipL0172 1700 845e .condpart45 1701 845e 4c 4b 8e jmp .lose_a_life 1702 8461 1703 8461 .skipL0172 1704 8461 . 1705 8461 ;; 1706 8461 1707 8461 . 1708 8461 ;; 1709 8461 1710 8461 .L0173 ;; if enemy_shotX > 160 then enemy_shotX = enemy_shotX - 1 1711 8461 1712 8461 a9 a0 LDA #160 1713 8463 cd 4a 01 CMP enemy_shotX 1714 8466 b0 09 BCS .skipL0173 1715 8468 .condpart46 1716 8468 ad 4a 01 LDA enemy_shotX 1717 846b 38 SEC 1718 846c e9 01 SBC #1 1719 846e 8d 4a 01 STA enemy_shotX 1720 8471 .skipL0173 1721 8471 .L0174 ;; if enemy_shotX < 1 then enemy_shotX = enemy_shotX + 1 1722 8471 1723 8471 ad 4a 01 LDA enemy_shotX 1724 8474 c9 01 CMP #1 1725 8476 b0 09 BCS .skipL0174 1726 8478 .condpart47 1727 8478 ad 4a 01 LDA enemy_shotX 1728 847b 18 CLC 1729 847c 69 01 ADC #1 1730 847e 8d 4a 01 STA enemy_shotX 1731 8481 .skipL0174 1732 8481 .L0175 ;; if enemy_shotY > 191 then enemy_shotY = enemy_shotY - 1 1733 8481 1734 8481 a9 bf LDA #191 1735 8483 cd 4b 01 CMP enemy_shotY 1736 8486 b0 09 BCS .skipL0175 1737 8488 .condpart48 1738 8488 ad 4b 01 LDA enemy_shotY 1739 848b 38 SEC 1740 848c e9 01 SBC #1 1741 848e 8d 4b 01 STA enemy_shotY 1742 8491 .skipL0175 1743 8491 .L0176 ;; if enemy_shotY < 1 then enemy_shotY = enemy_shotY + 1 1744 8491 1745 8491 ad 4b 01 LDA enemy_shotY 1746 8494 c9 01 CMP #1 1747 8496 b0 09 BCS .skipL0176 1748 8498 .condpart49 1749 8498 ad 4b 01 LDA enemy_shotY 1750 849b 18 CLC 1751 849c 69 01 ADC #1 1752 849e 8d 4b 01 STA enemy_shotY 1753 84a1 .skipL0176 1754 84a1 .L0177 ;; if power_upX > 155 then power_upX = power_upX - 5 1755 84a1 1756 84a1 a9 9b LDA #155 1757 84a3 cd 50 01 CMP power_upX 1758 84a6 b0 09 BCS .skipL0177 1759 84a8 .condpart50 1760 84a8 ad 50 01 LDA power_upX 1761 84ab 38 SEC 1762 84ac e9 05 SBC #5 1763 84ae 8d 50 01 STA power_upX 1764 84b1 .skipL0177 1765 84b1 .L0178 ;; if power_upX < 1 then power_upX = power_upX + 5 1766 84b1 1767 84b1 ad 50 01 LDA power_upX 1768 84b4 c9 01 CMP #1 1769 84b6 b0 09 BCS .skipL0178 1770 84b8 .condpart51 1771 84b8 ad 50 01 LDA power_upX 1772 84bb 18 CLC 1773 84bc 69 05 ADC #5 1774 84be 8d 50 01 STA power_upX 1775 84c1 .skipL0178 1776 84c1 .L0179 ;; if power_upY > 191 then power_upY = power_upY - 5 1777 84c1 1778 84c1 a9 bf LDA #191 1779 84c3 cd 51 01 CMP power_upY 1780 84c6 b0 09 BCS .skipL0179 1781 84c8 .condpart52 1782 84c8 ad 51 01 LDA power_upY 1783 84cb 38 SEC 1784 84cc e9 05 SBC #5 1785 84ce 8d 51 01 STA power_upY 1786 84d1 .skipL0179 1787 84d1 .L0180 ;; if power_upY < 1 then power_upY = power_upY + 5 1788 84d1 1789 84d1 ad 51 01 LDA power_upY 1790 84d4 c9 01 CMP #1 1791 84d6 b0 09 BCS .skipL0180 1792 84d8 .condpart53 1793 84d8 ad 51 01 LDA power_upY 1794 84db 18 CLC 1795 84dc 69 05 ADC #5 1796 84de 8d 51 01 STA power_upY 1797 84e1 .skipL0180 1798 84e1 .L0181 ;; if enemy01_X > 160 then enemy01_X = enemy01_X - 1 1799 84e1 1800 84e1 a9 a0 LDA #160 1801 84e3 cd 57 01 CMP enemy01_X 1802 84e6 b0 09 BCS .skipL0181 1803 84e8 .condpart54 1804 84e8 ad 57 01 LDA enemy01_X 1805 84eb 38 SEC 1806 84ec e9 01 SBC #1 1807 84ee 8d 57 01 STA enemy01_X 1808 84f1 .skipL0181 1809 84f1 .L0182 ;; if enemy01_X < 1 then enemy01_X = enemy01_X + 1 1810 84f1 1811 84f1 ad 57 01 LDA enemy01_X 1812 84f4 c9 01 CMP #1 1813 84f6 b0 09 BCS .skipL0182 1814 84f8 .condpart55 1815 84f8 ad 57 01 LDA enemy01_X 1816 84fb 18 CLC 1817 84fc 69 01 ADC #1 1818 84fe 8d 57 01 STA enemy01_X 1819 8501 .skipL0182 1820 8501 .L0183 ;; if enemy01_Y > 220 then enemy01_Y = enemy01_Y - 1 1821 8501 1822 8501 a9 dc LDA #220 1823 8503 cd 58 01 CMP enemy01_Y 1824 8506 b0 09 BCS .skipL0183 1825 8508 .condpart56 1826 8508 ad 58 01 LDA enemy01_Y 1827 850b 38 SEC 1828 850c e9 01 SBC #1 1829 850e 8d 58 01 STA enemy01_Y 1830 8511 .skipL0183 1831 8511 .L0184 ;; if enemy01_Y < - 16 then enemy01_Y = enemy01_Y + 1 1832 8511 1833 8511 ; complex condition detected 1834 8511 a9 f0 LDA #240 1835 8513 48 PHA 1836 8514 ba TSX 1837 8515 68 PLA 1838 8516 ad 58 01 LDA enemy01_Y 1839 8519 dd 01 01 CMP $101,x 1840 851c b0 09 BCS .skipL0184 1841 851e .condpart57 1842 851e ad 58 01 LDA enemy01_Y 1843 8521 18 CLC 1844 8522 69 01 ADC #1 1845 8524 8d 58 01 STA enemy01_Y 1846 8527 .skipL0184 1847 8527 .L0185 ;; if extra_shipX > 160 then extra_shipX = extra_shipX - 1 1848 8527 1849 8527 a9 a0 LDA #160 1850 8529 cd 60 01 CMP extra_shipX 1851 852c b0 09 BCS .skipL0185 1852 852e .condpart58 1853 852e ad 60 01 LDA extra_shipX 1854 8531 38 SEC 1855 8532 e9 01 SBC #1 1856 8534 8d 60 01 STA extra_shipX 1857 8537 .skipL0185 1858 8537 .L0186 ;; if extra_shipX < 1 then extra_shipX = extra_shipX + 1 1859 8537 1860 8537 ad 60 01 LDA extra_shipX 1861 853a c9 01 CMP #1 1862 853c b0 09 BCS .skipL0186 1863 853e .condpart59 1864 853e ad 60 01 LDA extra_shipX 1865 8541 18 CLC 1866 8542 69 01 ADC #1 1867 8544 8d 60 01 STA extra_shipX 1868 8547 .skipL0186 1869 8547 .L0187 ;; if extra_shipY > 191 then extra_shipY = extra_shipY - 1 1870 8547 1871 8547 a9 bf LDA #191 1872 8549 cd 61 01 CMP extra_shipY 1873 854c b0 09 BCS .skipL0187 1874 854e .condpart60 1875 854e ad 61 01 LDA extra_shipY 1876 8551 38 SEC 1877 8552 e9 01 SBC #1 1878 8554 8d 61 01 STA extra_shipY 1879 8557 .skipL0187 1880 8557 .L0188 ;; if extra_shipY < 1 then extra_shipY = extra_shipY + 1 1881 8557 1882 8557 ad 61 01 LDA extra_shipY 1883 855a c9 01 CMP #1 1884 855c b0 09 BCS .skipL0188 1885 855e .condpart61 1886 855e ad 61 01 LDA extra_shipY 1887 8561 18 CLC 1888 8562 69 01 ADC #1 1889 8564 8d 61 01 STA extra_shipY 1890 8567 .skipL0188 1891 8567 . 1892 8567 ;; 1893 8567 1894 8567 . 1895 8567 ;; 1896 8567 1897 8567 .L0189 ;; if rDirection = 0 then enemy01_X = enemy01_X + rMovement1 : enemy01_Y = enemy01_Y + rMovement2 1898 8567 1899 8567 ad 4f 01 LDA rDirection 1900 856a c9 00 CMP #0 1901 856c d0 14 BNE .skipL0189 1902 856e .condpart62 1903 856e ad 57 01 LDA enemy01_X 1904 8571 18 CLC 1905 8572 6d 4e 01 ADC rMovement1 1906 8575 8d 57 01 STA enemy01_X 1907 8578 ad 58 01 LDA enemy01_Y 1908 857b 18 CLC 1909 857c 6d 53 01 ADC rMovement2 1910 857f 8d 58 01 STA enemy01_Y 1911 8582 .skipL0189 1912 8582 .L0190 ;; if rDirection = 1 then enemy01_X = enemy01_X + rMovement3 : enemy01_Y = enemy01_Y + rMovement4 1913 8582 1914 8582 ad 4f 01 LDA rDirection 1915 8585 c9 01 CMP #1 1916 8587 d0 14 BNE .skipL0190 1917 8589 .condpart63 1918 8589 ad 57 01 LDA enemy01_X 1919 858c 18 CLC 1920 858d 6d 5a 01 ADC rMovement3 1921 8590 8d 57 01 STA enemy01_X 1922 8593 ad 58 01 LDA enemy01_Y 1923 8596 18 CLC 1924 8597 6d 5b 01 ADC rMovement4 1925 859a 8d 58 01 STA enemy01_Y 1926 859d .skipL0190 1927 859d .L0191 ;; if rDirection = 2 then enemy01_X = enemy01_X + rMovement5 : enemy01_Y = enemy01_Y + rMovement6 1928 859d 1929 859d ad 4f 01 LDA rDirection 1930 85a0 c9 02 CMP #2 1931 85a2 d0 14 BNE .skipL0191 1932 85a4 .condpart64 1933 85a4 ad 57 01 LDA enemy01_X 1934 85a7 18 CLC 1935 85a8 6d 5c 01 ADC rMovement5 1936 85ab 8d 57 01 STA enemy01_X 1937 85ae ad 58 01 LDA enemy01_Y 1938 85b1 18 CLC 1939 85b2 6d 5d 01 ADC rMovement6 1940 85b5 8d 58 01 STA enemy01_Y 1941 85b8 .skipL0191 1942 85b8 . 1943 85b8 ;; 1944 85b8 1945 85b8 .L0192 ;; if rDirection = 0 then extra_shipX = extra_shipX + rMovement5 : extra_shipY = extra_shipY + rMovement2 1946 85b8 1947 85b8 ad 4f 01 LDA rDirection 1948 85bb c9 00 CMP #0 1949 85bd d0 14 BNE .skipL0192 1950 85bf .condpart65 1951 85bf ad 60 01 LDA extra_shipX 1952 85c2 18 CLC 1953 85c3 6d 5c 01 ADC rMovement5 1954 85c6 8d 60 01 STA extra_shipX 1955 85c9 ad 61 01 LDA extra_shipY 1956 85cc 18 CLC 1957 85cd 6d 53 01 ADC rMovement2 1958 85d0 8d 61 01 STA extra_shipY 1959 85d3 .skipL0192 1960 85d3 .L0193 ;; if rDirection = 1 then extra_shipX = extra_shipX + rMovement1 : extra_shipY = extra_shipY + rMovement3 1961 85d3 1962 85d3 ad 4f 01 LDA rDirection 1963 85d6 c9 01 CMP #1 1964 85d8 d0 14 BNE .skipL0193 1965 85da .condpart66 1966 85da ad 60 01 LDA extra_shipX 1967 85dd 18 CLC 1968 85de 6d 4e 01 ADC rMovement1 1969 85e1 8d 60 01 STA extra_shipX 1970 85e4 ad 61 01 LDA extra_shipY 1971 85e7 18 CLC 1972 85e8 6d 5a 01 ADC rMovement3 1973 85eb 8d 61 01 STA extra_shipY 1974 85ee .skipL0193 1975 85ee . 1976 85ee ;; 1977 85ee 1978 85ee .L0194 ;; if playerFlag = 1 && explosion_aniframe = 1 then playsfx sfx_explosion 1979 85ee 1980 85ee ad 4d 01 LDA playerFlag 1981 85f1 c9 01 CMP #1 1982 85f3 d0 20 BNE .skipL0194 1983 85f5 .condpart67 1984 85f5 ad 63 01 LDA explosion_aniframe 1985 85f8 c9 01 CMP #1 1986 85fa d0 19 BNE .skip67then 1987 85fc .condpart68 1988 85fc ifnconst NOTIALOCKMUTE 1989 85fc a9 01 lda #1 1990 85fe 85 de sta sfxschedulelock 1991 8600 a9 76 lda #sfx_explosion 1994 8606 85 e1 sta sfxinstrumenthi 1995 8608 a9 00 lda #0 1996 860a 85 e2 sta sfxpitchoffset ; no pitch modification 1997 860c 85 e3 sta sfxnoteindex ; not a musical note 1998 860e 20 4b f2 jsr schedulesfx 1999 8611 a9 00 lda #0 2000 8613 85 de sta sfxschedulelock 2001 8615 endif ; NOTIALOCKMUTE 2002 8615 .skip67then 2003 8615 .skipL0194 2004 8615 .L0195 ;; if playerFlag = 1 then enemy_shotSlowdown = enemy_shotSlowdown + 1 2005 8615 2006 8615 ad 4d 01 LDA playerFlag 2007 8618 c9 01 CMP #1 2008 861a d0 09 BNE .skipL0195 2009 861c .condpart69 2010 861c ad 56 01 LDA enemy_shotSlowdown 2011 861f 18 CLC 2012 8620 69 01 ADC #1 2013 8622 8d 56 01 STA enemy_shotSlowdown 2014 8625 .skipL0195 2015 8625 .L0196 ;; if playerFlag = 1 && enemy_shotSlowdown = 8 then enemy_shotSlowdown = 0 2016 8625 2017 8625 ad 4d 01 LDA playerFlag 2018 8628 c9 01 CMP #1 2019 862a d0 0c BNE .skipL0196 2020 862c .condpart70 2021 862c ad 56 01 LDA enemy_shotSlowdown 2022 862f c9 08 CMP #8 2023 8631 d0 05 BNE .skip70then 2024 8633 .condpart71 2025 8633 a9 00 LDA #0 2026 8635 8d 56 01 STA enemy_shotSlowdown 2027 8638 .skip70then 2028 8638 .skipL0196 2029 8638 .L0197 ;; if playerFlag = 1 && enemy_shotSlowdown = 2 then explosion_aniframe = explosion_aniframe + 1 2030 8638 2031 8638 ad 4d 01 LDA playerFlag 2032 863b c9 01 CMP #1 2033 863d d0 10 BNE .skipL0197 2034 863f .condpart72 2035 863f ad 56 01 LDA enemy_shotSlowdown 2036 8642 c9 02 CMP #2 2037 8644 d0 09 BNE .skip72then 2038 8646 .condpart73 2039 8646 ad 63 01 LDA explosion_aniframe 2040 8649 18 CLC 2041 864a 69 01 ADC #1 2042 864c 8d 63 01 STA explosion_aniframe 2043 864f .skip72then 2044 864f .skipL0197 2045 864f .L0198 ;; if playerFlag = 1 && explosion_aniframe > 11 then explosion_aniframe = 200 2046 864f 2047 864f ad 4d 01 LDA playerFlag 2048 8652 c9 01 CMP #1 2049 8654 d0 0c BNE .skipL0198 2050 8656 .condpart74 2051 8656 a9 0b LDA #11 2052 8658 cd 63 01 CMP explosion_aniframe 2053 865b b0 05 BCS .skip74then 2054 865d .condpart75 2055 865d a9 c8 LDA #200 2056 865f 8d 63 01 STA explosion_aniframe 2057 8662 .skip74then 2058 8662 .skipL0198 2059 8662 . 2060 8662 ;; 2061 8662 2062 8662 . 2063 8662 ;; 2064 8662 2065 8662 .L0199 ;; if rDirection = 0 then power_upX = power_upX + rMovement5 : power_upY = power_upY + rMovement2 2066 8662 2067 8662 ad 4f 01 LDA rDirection 2068 8665 c9 00 CMP #0 2069 8667 d0 14 BNE .skipL0199 2070 8669 .condpart76 2071 8669 ad 50 01 LDA power_upX 2072 866c 18 CLC 2073 866d 6d 5c 01 ADC rMovement5 2074 8670 8d 50 01 STA power_upX 2075 8673 ad 51 01 LDA power_upY 2076 8676 18 CLC 2077 8677 6d 53 01 ADC rMovement2 2078 867a 8d 51 01 STA power_upY 2079 867d .skipL0199 2080 867d .L0200 ;; if rDirection = 1 then power_upX = power_upX + rMovement3 : power_upY = power_upY + rMovement4 2081 867d 2082 867d ad 4f 01 LDA rDirection 2083 8680 c9 01 CMP #1 2084 8682 d0 14 BNE .skipL0200 2085 8684 .condpart77 2086 8684 ad 50 01 LDA power_upX 2087 8687 18 CLC 2088 8688 6d 5a 01 ADC rMovement3 2089 868b 8d 50 01 STA power_upX 2090 868e ad 51 01 LDA power_upY 2091 8691 18 CLC 2092 8692 6d 5b 01 ADC rMovement4 2093 8695 8d 51 01 STA power_upY 2094 8698 .skipL0200 2095 8698 .L0201 ;; if rDirection = 2 then power_upX = power_upX + rMovement1 : power_upY = power_upY + rMovement6 2096 8698 2097 8698 ad 4f 01 LDA rDirection 2098 869b c9 02 CMP #2 2099 869d d0 14 BNE .skipL0201 2100 869f .condpart78 2101 869f ad 50 01 LDA power_upX 2102 86a2 18 CLC 2103 86a3 6d 4e 01 ADC rMovement1 2104 86a6 8d 50 01 STA power_upX 2105 86a9 ad 51 01 LDA power_upY 2106 86ac 18 CLC 2107 86ad 6d 5d 01 ADC rMovement6 2108 86b0 8d 51 01 STA power_upY 2109 86b3 .skipL0201 2110 86b3 . 2111 86b3 ;; 2112 86b3 2113 86b3 . 2114 86b3 ;; 2115 86b3 2116 86b3 . 2117 86b3 ;; 2118 86b3 2119 86b3 . 2120 86b3 ;; 2121 86b3 2122 86b3 . 2123 86b3 ;; 2124 86b3 2125 86b3 . 2126 86b3 ;; 2127 86b3 2128 86b3 . 2129 86b3 ;; 2130 86b3 2131 86b3 . 2132 86b3 ;; 2133 86b3 2134 86b3 . 2135 86b3 ;; 2136 86b3 2137 86b3 . 2138 86b3 ;; 2139 86b3 2140 86b3 . 2141 86b3 ;; 2142 86b3 2143 86b3 . 2144 86b3 ;; 2145 86b3 2146 86b3 . 2147 86b3 ;; 2148 86b3 2149 86b3 . 2150 86b3 ;; 2151 86b3 2152 86b3 . 2153 86b3 ;; 2154 86b3 2155 86b3 . 2156 86b3 ;; 2157 86b3 2158 86b3 . 2159 86b3 ;; 2160 86b3 2161 86b3 . 2162 86b3 ;; 2163 86b3 2164 86b3 . 2165 86b3 ;; 2166 86b3 2167 86b3 . 2168 86b3 ;; 2169 86b3 2170 86b3 .despawn_Check 2171 86b3 ;; despawn_Check 2172 86b3 2173 86b3 . 2174 86b3 ;; 2175 86b3 2176 86b3 . 2177 86b3 ;; 2178 86b3 2179 86b3 . 2180 86b3 ;; 2181 86b3 2182 86b3 . 2183 86b3 ;; 2184 86b3 2185 86b3 . 2186 86b3 ;; 2187 86b3 2188 86b3 .L0202 ;; if enemy_shotSX > 160 || enemy_shotSY > 191 then enemy_shotFlag = FALSE 2189 86b3 2190 86b3 a9 a0 LDA #160 2191 86b5 cd 20 22 CMP enemy_shotSX 2192 86b8 b0 03 BCS .skipL0202 2193 86ba .condpart79 2194 86ba 4c c4 86 jmp .condpart80 2195 86bd .skipL0202 2196 86bd a9 bf LDA #191 2197 86bf cd 30 22 CMP enemy_shotSY 2198 86c2 b0 05 BCS .skip16OR 2199 86c4 .condpart80 2200 86c4 a9 00 LDA #FALSE 2201 86c6 8d 4c 01 STA enemy_shotFlag 2202 86c9 .skip16OR 2203 86c9 .L0203 ;; gosub move_enemyshot 2204 86c9 2205 86c9 20 fa 91 jsr .move_enemyshot 2206 86cc 2207 86cc .L0204 ;; clearscreen 2208 86cc 2209 86cc 20 7f f0 jsr clearscreen 2210 86cf . 2211 86cf ;; 2212 86cf 2213 86cf . 2214 86cf ;; 2215 86cf 2216 86cf .draw_enemyshot 2217 86cf ;; draw_enemyshot 2218 86cf 2219 86cf . 2220 86cf ;; 2221 86cf 2222 86cf . 2223 86cf ;; 2224 86cf 2225 86cf . 2226 86cf ;; 2227 86cf 2228 86cf . 2229 86cf ;; 2230 86cf 2231 86cf .L0205 ;; x = enemy_shotX : y = enemy_shotY 2232 86cf 2233 86cf ad 4a 01 LDA enemy_shotX 2234 86d2 85 fd STA x 2235 86d4 ad 4b 01 LDA enemy_shotY 2236 86d7 85 fe STA y 2237 86d9 .L0206 ;; if enemy_shotFlag = TRUE then plotsprite vertical_shooting_enemyshot 2 x y 2238 86d9 2239 86d9 ad 4c 01 LDA enemy_shotFlag 2240 86dc c9 01 CMP #TRUE 2241 86de d0 1b BNE .skipL0206 2242 86e0 .condpart81 2243 86e0 a9 32 lda #vertical_shooting_enemyshot 2247 86e6 85 43 sta temp2 2248 86e8 2249 86e8 a9 5f lda #(64|vertical_shooting_enemyshot_width_twoscompliment) 2250 86ea 85 44 sta temp3 2251 86ec 2252 86ec a5 fd lda x 2253 86ee 85 45 sta temp4 2254 86f0 2255 86f0 a5 fe lda y 2256 86f2 2257 86f2 85 46 sta temp5 2258 86f4 2259 86f4 a9 40 lda #(vertical_shooting_enemyshot_mode|%01000000) 2260 86f6 85 47 sta temp6 2261 86f8 2262 86f8 20 93 f2 jsr plotsprite 2263 86fb .skipL0206 2264 86fb . 2265 86fb ;; 2266 86fb 2267 86fb .L0207 ;; restorescreen 2268 86fb 2269 86fb 20 91 f0 jsr restorescreen 2270 86fe .L0208 ;; gosub draw_scores 2271 86fe 2272 86fe 20 e0 88 jsr .draw_scores 2273 8701 2274 8701 .L0209 ;; gosub draw_sprites 2275 8701 2276 8701 20 0a 87 jsr .draw_sprites 2277 8704 2278 8704 .L0210 ;; drawscreen 2279 8704 2280 8704 20 b3 f0 jsr drawscreen 2281 8707 . 2282 8707 ;; 2283 8707 2284 8707 .L0211 ;; goto mainloop 2285 8707 2286 8707 4c ff 80 jmp .mainloop 2287 870a 2288 870a . 2289 870a ;; 2290 870a 2291 870a . 2292 870a ;; 2293 870a 2294 870a .draw_sprites 2295 870a ;; draw_sprites 2296 870a 2297 870a .L0212 ;; plotsprite vertical_shooting_ship 0 playerX playerY 2298 870a 2299 870a a9 2d lda #vertical_shooting_ship 2303 8710 85 43 sta temp2 2304 8712 2305 8712 a9 1e lda #(0|vertical_shooting_ship_width_twoscompliment) 2306 8714 85 44 sta temp3 2307 8716 2308 8716 ad 41 01 lda playerX 2309 8719 85 45 sta temp4 2310 871b 2311 871b ad 42 01 lda playerY 2312 871e 2313 871e 85 46 sta temp5 2314 8720 2315 8720 a9 40 lda #(vertical_shooting_ship_mode|%01000000) 2316 8722 85 47 sta temp6 2317 8724 2318 8724 20 93 f2 jsr plotsprite 2319 8727 ; +tall sprite replot 2320 8727 18 clc 2321 8728 a5 42 lda temp1 2322 872a 69 02 adc #vertical_shooting_ship_width 2323 872c 85 42 sta temp1 2324 872e a5 46 lda temp5 2325 8730 69 08 adc #WZONEHEIGHT 2326 8732 85 46 sta temp5 2327 8734 20 93 f2 jsr plotsprite 2328 8737 .L0213 ;; plotsprite vertical_shooting_bullet 1 bulletX bulletY 2329 8737 2330 8737 a9 31 lda #vertical_shooting_bullet 2334 873d 85 43 sta temp2 2335 873f 2336 873f a9 3f lda #(32|vertical_shooting_bullet_width_twoscompliment) 2337 8741 85 44 sta temp3 2338 8743 2339 8743 ad 48 01 lda bulletX 2340 8746 85 45 sta temp4 2341 8748 2342 8748 ad 49 01 lda bulletY 2343 874b 2344 874b 85 46 sta temp5 2345 874d 2346 874d a9 40 lda #(vertical_shooting_bullet_mode|%01000000) 2347 874f 85 47 sta temp6 2348 8751 2349 8751 20 93 f2 jsr plotsprite 2350 8754 . 2351 8754 ;; 2352 8754 2353 8754 .L0214 ;; plotsprite vertical_shooting_powerup 3 power_upX power_upY 2354 8754 2355 8754 a9 33 lda #vertical_shooting_powerup 2359 875a 85 43 sta temp2 2360 875c 2361 875c a9 7e lda #(96|vertical_shooting_powerup_width_twoscompliment) 2362 875e 85 44 sta temp3 2363 8760 2364 8760 ad 50 01 lda power_upX 2365 8763 85 45 sta temp4 2366 8765 2367 8765 ad 51 01 lda power_upY 2368 8768 2369 8768 85 46 sta temp5 2370 876a 2371 876a a9 40 lda #(vertical_shooting_powerup_mode|%01000000) 2372 876c 85 47 sta temp6 2373 876e 2374 876e 20 93 f2 jsr plotsprite 2375 8771 .L0215 ;; plotsprite vertical_shooting_enemy01 2 enemy01_X enemy01_Y 2376 8771 2377 8771 a9 35 lda #vertical_shooting_enemy01 2381 8777 85 43 sta temp2 2382 8779 2383 8779 a9 5e lda #(64|vertical_shooting_enemy01_width_twoscompliment) 2384 877b 85 44 sta temp3 2385 877d 2386 877d ad 57 01 lda enemy01_X 2387 8780 85 45 sta temp4 2388 8782 2389 8782 ad 58 01 lda enemy01_Y 2390 8785 2391 8785 85 46 sta temp5 2392 8787 2393 8787 a9 40 lda #(vertical_shooting_enemy01_mode|%01000000) 2394 8789 85 47 sta temp6 2395 878b 2396 878b 20 93 f2 jsr plotsprite 2397 878e ; +tall sprite replot 2398 878e 18 clc 2399 878f a5 42 lda temp1 2400 8791 69 02 adc #vertical_shooting_enemy01_width 2401 8793 85 42 sta temp1 2402 8795 a5 46 lda temp5 2403 8797 69 08 adc #WZONEHEIGHT 2404 8799 85 46 sta temp5 2405 879b 20 93 f2 jsr plotsprite 2406 879e .L0216 ;; plotsprite vertical_shooting_1up 0 extra_shipX extra_shipY 2407 879e 2408 879e a9 39 lda #vertical_shooting_1up 2412 87a4 85 43 sta temp2 2413 87a6 2414 87a6 a9 1e lda #(0|vertical_shooting_1up_width_twoscompliment) 2415 87a8 85 44 sta temp3 2416 87aa 2417 87aa ad 60 01 lda extra_shipX 2418 87ad 85 45 sta temp4 2419 87af 2420 87af ad 61 01 lda extra_shipY 2421 87b2 2422 87b2 85 46 sta temp5 2423 87b4 2424 87b4 a9 40 lda #(vertical_shooting_1up_mode|%01000000) 2425 87b6 85 47 sta temp6 2426 87b8 2427 87b8 20 93 f2 jsr plotsprite 2428 87bb .L0217 ;; plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 2429 87bb 2430 87bb a9 3b lda #vertical_shooting_explosion_01 2442 87cc 85 43 sta temp2 2443 87ce 2444 87ce a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2445 87d0 85 44 sta temp3 2446 87d2 2447 87d2 ad 41 01 lda playerX 2448 87d5 85 45 sta temp4 2449 87d7 2450 87d7 ad 42 01 lda playerY 2451 87da 85 46 sta temp5 2452 87dc 2453 87dc a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2454 87de 85 47 sta temp6 2455 87e0 2456 87e0 20 93 f2 jsr plotsprite 2457 87e3 ; +tall sprite replot 2458 87e3 18 clc 2459 87e4 a5 42 lda temp1 2460 87e6 69 02 adc #vertical_shooting_explosion_01_width 2461 87e8 85 42 sta temp1 2462 87ea a5 46 lda temp5 2463 87ec 69 08 adc #WZONEHEIGHT 2464 87ee 85 46 sta temp5 2465 87f0 20 93 f2 jsr plotsprite 2466 87f3 .L0218 ;; plotsprite vertical_shooting_explosion_01 3 enemy01_X enemy01_Y explosion_aniframe 2467 87f3 2468 87f3 a9 3b lda #vertical_shooting_explosion_01 2480 8804 85 43 sta temp2 2481 8806 2482 8806 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2483 8808 85 44 sta temp3 2484 880a 2485 880a ad 57 01 lda enemy01_X 2486 880d 85 45 sta temp4 2487 880f 2488 880f ad 58 01 lda enemy01_Y 2489 8812 85 46 sta temp5 2490 8814 2491 8814 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2492 8816 85 47 sta temp6 2493 8818 2494 8818 20 93 f2 jsr plotsprite 2495 881b ; +tall sprite replot 2496 881b 18 clc 2497 881c a5 42 lda temp1 2498 881e 69 02 adc #vertical_shooting_explosion_01_width 2499 8820 85 42 sta temp1 2500 8822 a5 46 lda temp5 2501 8824 69 08 adc #WZONEHEIGHT 2502 8826 85 46 sta temp5 2503 8828 20 93 f2 jsr plotsprite 2504 882b .L0219 ;; plotsprite vertical_shooting_laser 0 twinlaserX twinlaserY 2505 882b 2506 882b a9 f3 lda #vertical_shooting_laser 2510 8831 85 43 sta temp2 2511 8833 2512 8833 a9 1f lda #(0|vertical_shooting_laser_width_twoscompliment) 2513 8835 85 44 sta temp3 2514 8837 2515 8837 ad 65 01 lda twinlaserX 2516 883a 85 45 sta temp4 2517 883c 2518 883c ad 66 01 lda twinlaserY 2519 883f 2520 883f 85 46 sta temp5 2521 8841 2522 8841 a9 40 lda #(vertical_shooting_laser_mode|%01000000) 2523 8843 85 47 sta temp6 2524 8845 2525 8845 20 93 f2 jsr plotsprite 2526 8848 ; +tall sprite replot 2527 8848 18 clc 2528 8849 a5 42 lda temp1 2529 884b 69 01 adc #vertical_shooting_laser_width 2530 884d 85 42 sta temp1 2531 884f a5 46 lda temp5 2532 8851 69 08 adc #WZONEHEIGHT 2533 8853 85 46 sta temp5 2534 8855 20 93 f2 jsr plotsprite 2535 8858 .L0220 ;; if playerFlag = 1 then plotsprite vertical_shooting_explosion_01 3 playerX playerY explosion_aniframe 2536 8858 2537 8858 ad 4d 01 LDA playerFlag 2538 885b c9 01 CMP #1 2539 885d d0 38 BNE .skipL0220 2540 885f .condpart82 2541 885f a9 3b lda #vertical_shooting_explosion_01 2553 8870 85 43 sta temp2 2554 8872 2555 8872 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2556 8874 85 44 sta temp3 2557 8876 2558 8876 ad 41 01 lda playerX 2559 8879 85 45 sta temp4 2560 887b 2561 887b ad 42 01 lda playerY 2562 887e 85 46 sta temp5 2563 8880 2564 8880 a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2565 8882 85 47 sta temp6 2566 8884 2567 8884 20 93 f2 jsr plotsprite 2568 8887 ; +tall sprite replot 2569 8887 18 clc 2570 8888 a5 42 lda temp1 2571 888a 69 02 adc #vertical_shooting_explosion_01_width 2572 888c 85 42 sta temp1 2573 888e a5 46 lda temp5 2574 8890 69 08 adc #WZONEHEIGHT 2575 8892 85 46 sta temp5 2576 8894 20 93 f2 jsr plotsprite 2577 8897 .skipL0220 2578 8897 .L0221 ;; if enemy01_Flag = 1 then plotsprite vertical_shooting_explosion_01 3 enemy01_X enemy01_Y explosion_aniframe 2579 8897 2580 8897 ad 59 01 LDA enemy01_Flag 2581 889a c9 01 CMP #1 2582 889c d0 38 BNE .skipL0221 2583 889e .condpart83 2584 889e a9 3b lda #vertical_shooting_explosion_01 2596 88af 85 43 sta temp2 2597 88b1 2598 88b1 a9 7e lda #(96|vertical_shooting_explosion_01_width_twoscompliment) 2599 88b3 85 44 sta temp3 2600 88b5 2601 88b5 ad 57 01 lda enemy01_X 2602 88b8 85 45 sta temp4 2603 88ba 2604 88ba ad 58 01 lda enemy01_Y 2605 88bd 85 46 sta temp5 2606 88bf 2607 88bf a9 40 lda #(vertical_shooting_explosion_01_mode|%01000000) 2608 88c1 85 47 sta temp6 2609 88c3 2610 88c3 20 93 f2 jsr plotsprite 2611 88c6 ; +tall sprite replot 2612 88c6 18 clc 2613 88c7 a5 42 lda temp1 2614 88c9 69 02 adc #vertical_shooting_explosion_01_width 2615 88cb 85 42 sta temp1 2616 88cd a5 46 lda temp5 2617 88cf 69 08 adc #WZONEHEIGHT 2618 88d1 85 46 sta temp5 2619 88d3 20 93 f2 jsr plotsprite 2620 88d6 .skipL0221 2621 88d6 .L0222 ;; return 2622 88d6 2623 88d6 ba tsx 2624 88d7 bd 02 01 lda $102,x 2625 88da f0 01 beq bankswitchret5 2626 88dc 60 RTS 2627 88dd bankswitchret5 2628 88dd 4c 72 f4 JMP BS_return 2629 88e0 . 2630 88e0 ;; 2631 88e0 2632 88e0 .draw_scores 2633 88e0 ;; draw_scores 2634 88e0 2635 88e0 .L0223 ;; plotvalue vertical_shooting_font 0 score0 6 25 1 2636 88e0 2637 88e0 a9 00 lda #vertical_shooting_font 2641 88e6 85 43 sta temp2 2642 88e8 2643 88e8 ad 06 21 lda charactermode 2644 88eb 85 4a sta temp9 2645 88ed a9 60 lda #(vertical_shooting_font_mode | %01100000) 2646 88ef 8d 06 21 sta charactermode 2647 88f2 a9 1a lda #26 ; width in two's complement 2648 88f4 09 00 ora #0 ; palette left shifted 5 bits 2649 88f6 85 44 sta temp3 2650 88f8 a9 19 lda #25 2651 88fa 85 45 sta temp4 2652 88fc 2653 88fc a9 01 lda #1 2654 88fe 85 46 sta temp5 2655 8900 2656 8900 a9 06 lda #6 2657 8902 85 47 sta temp6 2658 8904 2659 8904 a9 a6 lda #score0 2663 890a 85 49 sta temp8 2664 890c 2665 890c 20 81 f3 jsr plotvalue 2666 890c 00 01 USED_PLOTVALUE = 1 2667 890f a5 4a lda temp9 2668 8911 8d 06 21 sta charactermode 2669 8914 .L0224 ;; plotvalue vertical_shooting_font 0 lives 1 153 1 2670 8914 2671 8914 a9 00 lda #vertical_shooting_font 2675 891a 85 43 sta temp2 2676 891c 2677 891c ad 06 21 lda charactermode 2678 891f 85 4a sta temp9 2679 8921 a9 60 lda #(vertical_shooting_font_mode | %01100000) 2680 8923 8d 06 21 sta charactermode 2681 8926 a9 1f lda #31 ; width in two's complement 2682 8928 09 00 ora #0 ; palette left shifted 5 bits 2683 892a 85 44 sta temp3 2684 892c a9 99 lda #153 2685 892e 85 45 sta temp4 2686 8930 2687 8930 a9 01 lda #1 2688 8932 85 46 sta temp5 2689 8934 2690 8934 a9 01 lda #1 2691 8936 85 47 sta temp6 2692 8938 2693 8938 a9 64 lda #lives 2697 893e 85 49 sta temp8 2698 8940 2699 8940 20 81 f3 jsr plotvalue 2700 8940 00 01 USED_PLOTVALUE = 1 2701 8943 a5 4a lda temp9 2702 8945 8d 06 21 sta charactermode 2703 8948 .L0225 ;; return 2704 8948 2705 8948 ba tsx 2706 8949 bd 02 01 lda $102,x 2707 894c f0 01 beq bankswitchret6 2708 894e 60 RTS 2709 894f bankswitchret6 2710 894f 4c 72 f4 JMP BS_return 2711 8952 . 2712 8952 ;; 2713 8952 2714 8952 .check_collisions 2715 8952 ;; check_collisions 2716 8952 2717 8952 .L0226 ;; 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 2718 8952 2719 8952 2720 8952 18 clc ; one clc only. If we overflow we're screwed anyway. 2721 8953 a0 07 ldy #(8-1) 2722 8955 84 44 sty temp3 2723 8957 a0 0f ldy #(16-1) 2724 8959 84 45 sty temp4 2725 895b ad 4a 01 lda enemy_shotX 2726 895e 69 30 adc #48 2727 8960 85 46 sta temp5 2728 8962 ad 4b 01 lda enemy_shotY 2729 8965 69 20 adc #((256-WSCREENHEIGHT)/2) 2730 8967 85 47 sta temp6 2731 8969 a0 03 ldy #(4-1) 2732 896b 84 48 sty temp7 2733 896d a0 07 ldy #(8-1) 2734 896f 84 49 sty temp8 2735 8971 ad 42 01 lda playerY 2736 8974 69 20 adc #((256-WSCREENHEIGHT)/2) 2737 8976 a8 tay 2738 8977 ad 41 01 lda playerX 2739 897a 69 30 adc #48 2740 897c 20 c9 f3 jsr boxcollision 2741 897f 2742 897f 90 37 BCC .skipL0226 2743 8981 .condpart84 2744 8981 a9 c8 LDA #200 2745 8983 8d 4a 01 STA enemy_shotX 2746 8986 8d 4b 01 STA enemy_shotY 2747 8989 a9 01 LDA #1 2748 898b 8d 4d 01 STA playerFlag 2749 898e ad 64 01 LDA lives 2750 8991 38 SEC 2751 8992 e9 00 SBC #0 2752 8994 8d 64 01 STA lives 2753 8997 ifnconst NOTIALOCKMUTE 2754 8997 a9 01 lda #1 2755 8999 85 de sta sfxschedulelock 2756 899b a9 76 lda #sfx_explosion 2759 89a1 85 e1 sta sfxinstrumenthi 2760 89a3 a9 00 lda #0 2761 89a5 85 e2 sta sfxpitchoffset ; no pitch modification 2762 89a7 85 e3 sta sfxnoteindex ; not a musical note 2763 89a9 20 4b f2 jsr schedulesfx 2764 89ac a9 00 lda #0 2765 89ae 85 de sta sfxschedulelock 2766 89b0 endif ; NOTIALOCKMUTE 2767 89b0 a9 01 LDA #1 2768 89b2 8d 6a 01 STA isDead_flag 2769 89b5 4c 90 8c jmp ._checkCollisionsExit 2770 89b8 2771 89b8 .skipL0226 2772 89b8 .L0227 ;; 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 2773 89b8 2774 89b8 2775 89b8 18 clc ; one clc only. If we overflow we're screwed anyway. 2776 89b9 a0 07 ldy #(8-1) 2777 89bb 84 44 sty temp3 2778 89bd a0 0f ldy #(16-1) 2779 89bf 84 45 sty temp4 2780 89c1 ad 50 01 lda power_upX 2781 89c4 69 30 adc #48 2782 89c6 85 46 sta temp5 2783 89c8 ad 51 01 lda power_upY 2784 89cb 69 20 adc #((256-WSCREENHEIGHT)/2) 2785 89cd 85 47 sta temp6 2786 89cf a0 07 ldy #(8-1) 2787 89d1 84 48 sty temp7 2788 89d3 a0 07 ldy #(8-1) 2789 89d5 84 49 sty temp8 2790 89d7 ad 42 01 lda playerY 2791 89da 69 20 adc #((256-WSCREENHEIGHT)/2) 2792 89dc a8 tay 2793 89dd ad 41 01 lda playerX 2794 89e0 69 30 adc #48 2795 89e2 20 c9 f3 jsr boxcollision 2796 89e5 2797 89e5 90 47 BCC .skipL0227 2798 89e7 .condpart85 2799 89e7 a9 d0 LDA #208 2800 89e9 8d 50 01 STA power_upX 2801 89ec 8d 51 01 STA power_upY 2802 89ef a9 01 LDA #1 2803 89f1 8d 4d 01 STA playerFlag 2804 89f4 8d 52 01 STA power_upFlag 2805 89f7 ifnconst NOTIALOCKMUTE 2806 89f7 a9 01 lda #1 2807 89f9 85 de sta sfxschedulelock 2808 89fb a9 b3 lda #sfx_bling 2811 8a01 85 e1 sta sfxinstrumenthi 2812 8a03 a9 00 lda #0 2813 8a05 85 e2 sta sfxpitchoffset ; no pitch modification 2814 8a07 85 e3 sta sfxnoteindex ; not a musical note 2815 8a09 20 4b f2 jsr schedulesfx 2816 8a0c a9 00 lda #0 2817 8a0e 85 de sta sfxschedulelock 2818 8a10 endif ; NOTIALOCKMUTE 2819 8a10 f8 SED 2820 8a11 18 CLC 2821 8a12 ad a8 01 LDA score0+2 2822 8a15 69 01 ADC #$01 2823 8a17 8d a8 01 STA score0+2 2824 8a1a ad a7 01 LDA score0+1 2825 8a1d 69 00 ADC #$00 2826 8a1f 8d a7 01 STA score0+1 2827 8a22 ad a6 01 LDA score0 2828 8a25 69 00 ADC #$00 2829 8a27 8d a6 01 STA score0 2830 8a2a d8 CLD 2831 8a2b 20 9a 8c jsr .power_up_obtained 2832 8a2e 2833 8a2e .skipL0227 2834 8a2e .L0228 ;; 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 2835 8a2e 2836 8a2e 2837 8a2e 18 clc ; one clc only. If we overflow we're screwed anyway. 2838 8a2f a0 07 ldy #(8-1) 2839 8a31 84 44 sty temp3 2840 8a33 a0 0f ldy #(16-1) 2841 8a35 84 45 sty temp4 2842 8a37 ad 57 01 lda enemy01_X 2843 8a3a 69 30 adc #48 2844 8a3c 85 46 sta temp5 2845 8a3e ad 58 01 lda enemy01_Y 2846 8a41 69 20 adc #((256-WSCREENHEIGHT)/2) 2847 8a43 85 47 sta temp6 2848 8a45 a0 07 ldy #(8-1) 2849 8a47 84 48 sty temp7 2850 8a49 a0 0f ldy #(16-1) 2851 8a4b 84 49 sty temp8 2852 8a4d ad 42 01 lda playerY 2853 8a50 69 20 adc #((256-WSCREENHEIGHT)/2) 2854 8a52 a8 tay 2855 8a53 ad 41 01 lda playerX 2856 8a56 69 30 adc #48 2857 8a58 20 c9 f3 jsr boxcollision 2858 8a5b 2859 8a5b 90 37 BCC .skipL0228 2860 8a5d .condpart86 2861 8a5d a9 c8 LDA #200 2862 8a5f 8d 57 01 STA enemy01_X 2863 8a62 8d 58 01 STA enemy01_Y 2864 8a65 a9 01 LDA #1 2865 8a67 8d 4d 01 STA playerFlag 2866 8a6a ad 64 01 LDA lives 2867 8a6d 38 SEC 2868 8a6e e9 00 SBC #0 2869 8a70 8d 64 01 STA lives 2870 8a73 ifnconst NOTIALOCKMUTE 2871 8a73 a9 01 lda #1 2872 8a75 85 de sta sfxschedulelock 2873 8a77 a9 76 lda #sfx_explosion 2876 8a7d 85 e1 sta sfxinstrumenthi 2877 8a7f a9 00 lda #0 2878 8a81 85 e2 sta sfxpitchoffset ; no pitch modification 2879 8a83 85 e3 sta sfxnoteindex ; not a musical note 2880 8a85 20 4b f2 jsr schedulesfx 2881 8a88 a9 00 lda #0 2882 8a8a 85 de sta sfxschedulelock 2883 8a8c endif ; NOTIALOCKMUTE 2884 8a8c a9 01 LDA #1 2885 8a8e 8d 6a 01 STA isDead_flag 2886 8a91 4c 90 8c jmp ._checkCollisionsExit 2887 8a94 2888 8a94 .skipL0228 2889 8a94 .L0229 ;; 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 2890 8a94 2891 8a94 2892 8a94 18 clc ; one clc only. If we overflow we're screwed anyway. 2893 8a95 a0 07 ldy #(8-1) 2894 8a97 84 44 sty temp3 2895 8a99 a0 0f ldy #(16-1) 2896 8a9b 84 45 sty temp4 2897 8a9d ad 60 01 lda extra_shipX 2898 8aa0 69 30 adc #48 2899 8aa2 85 46 sta temp5 2900 8aa4 ad 61 01 lda extra_shipY 2901 8aa7 69 20 adc #((256-WSCREENHEIGHT)/2) 2902 8aa9 85 47 sta temp6 2903 8aab a0 07 ldy #(8-1) 2904 8aad 84 48 sty temp7 2905 8aaf a0 07 ldy #(8-1) 2906 8ab1 84 49 sty temp8 2907 8ab3 ad 42 01 lda playerY 2908 8ab6 69 20 adc #((256-WSCREENHEIGHT)/2) 2909 8ab8 a8 tay 2910 8ab9 ad 41 01 lda playerX 2911 8abc 69 30 adc #48 2912 8abe 20 c9 f3 jsr boxcollision 2913 8ac1 2914 8ac1 90 2f BCC .skipL0229 2915 8ac3 .condpart87 2916 8ac3 a9 c8 LDA #200 2917 8ac5 8d 60 01 STA extra_shipX 2918 8ac8 8d 61 01 STA extra_shipY 2919 8acb a9 01 LDA #1 2920 8acd 8d 62 01 STA extra_shipFlag 2921 8ad0 ad 64 01 LDA lives 2922 8ad3 18 CLC 2923 8ad4 69 01 ADC #1 2924 8ad6 8d 64 01 STA lives 2925 8ad9 ifnconst NOTIALOCKMUTE 2926 8ad9 a9 01 lda #1 2927 8adb 85 de sta sfxschedulelock 2928 8add a9 b3 lda #sfx_bling 2931 8ae3 85 e1 sta sfxinstrumenthi 2932 8ae5 a9 00 lda #0 2933 8ae7 85 e2 sta sfxpitchoffset ; no pitch modification 2934 8ae9 85 e3 sta sfxnoteindex ; not a musical note 2935 8aeb 20 4b f2 jsr schedulesfx 2936 8aee a9 00 lda #0 2937 8af0 85 de sta sfxschedulelock 2938 8af2 endif ; NOTIALOCKMUTE 2939 8af2 .skipL0229 2940 8af2 .L0230 ;; 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 2941 8af2 2942 8af2 2943 8af2 18 clc ; one clc only. If we overflow we're screwed anyway. 2944 8af3 a0 03 ldy #(4-1) 2945 8af5 84 44 sty temp3 2946 8af7 a0 07 ldy #(8-1) 2947 8af9 84 45 sty temp4 2948 8afb ad 57 01 lda enemy01_X 2949 8afe 69 30 adc #48 2950 8b00 85 46 sta temp5 2951 8b02 ad 58 01 lda enemy01_Y 2952 8b05 69 20 adc #((256-WSCREENHEIGHT)/2) 2953 8b07 85 47 sta temp6 2954 8b09 a0 07 ldy #(8-1) 2955 8b0b 84 48 sty temp7 2956 8b0d a0 0f ldy #(16-1) 2957 8b0f 84 49 sty temp8 2958 8b11 ad 49 01 lda bulletY 2959 8b14 69 20 adc #((256-WSCREENHEIGHT)/2) 2960 8b16 a8 tay 2961 8b17 ad 48 01 lda bulletX 2962 8b1a 69 30 adc #48 2963 8b1c 20 c9 f3 jsr boxcollision 2964 8b1f 2965 8b1f 90 32 BCC .skipL0230 2966 8b21 .condpart88 2967 8b21 a9 f8 LDA #248 2968 8b23 8d 48 01 STA bulletX 2969 8b26 a9 00 LDA #0 2970 8b28 8d 49 01 STA bulletY 2971 8b2b a9 d0 LDA #208 2972 8b2d 8d 57 01 STA enemy01_X 2973 8b30 a9 c8 LDA #200 2974 8b32 8d 58 01 STA enemy01_Y 2975 8b35 a9 01 LDA #1 2976 8b37 8d 59 01 STA enemy01_Flag 2977 8b3a ifnconst NOTIALOCKMUTE 2978 8b3a a9 01 lda #1 2979 8b3c 85 de sta sfxschedulelock 2980 8b3e a9 76 lda #sfx_explosion 2983 8b44 85 e1 sta sfxinstrumenthi 2984 8b46 a9 00 lda #0 2985 8b48 85 e2 sta sfxpitchoffset ; no pitch modification 2986 8b4a 85 e3 sta sfxnoteindex ; not a musical note 2987 8b4c 20 4b f2 jsr schedulesfx 2988 8b4f a9 00 lda #0 2989 8b51 85 de sta sfxschedulelock 2990 8b53 endif ; NOTIALOCKMUTE 2991 8b53 .skipL0230 2992 8b53 .L0231 ;; 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 2993 8b53 2994 8b53 2995 8b53 18 clc ; one clc only. If we overflow we're screwed anyway. 2996 8b54 a0 03 ldy #(4-1) 2997 8b56 84 44 sty temp3 2998 8b58 a0 0f ldy #(16-1) 2999 8b5a 84 45 sty temp4 3000 8b5c ad 57 01 lda enemy01_X 3001 8b5f 69 30 adc #48 3002 8b61 85 46 sta temp5 3003 8b63 ad 58 01 lda enemy01_Y 3004 8b66 69 20 adc #((256-WSCREENHEIGHT)/2) 3005 8b68 85 47 sta temp6 3006 8b6a a0 07 ldy #(8-1) 3007 8b6c 84 48 sty temp7 3008 8b6e a0 0f ldy #(16-1) 3009 8b70 84 49 sty temp8 3010 8b72 ad 66 01 lda twinlaserY 3011 8b75 69 20 adc #((256-WSCREENHEIGHT)/2) 3012 8b77 a8 tay 3013 8b78 ad 65 01 lda twinlaserX 3014 8b7b 69 30 adc #48 3015 8b7d 20 c9 f3 jsr boxcollision 3016 8b80 3017 8b80 90 32 BCC .skipL0231 3018 8b82 .condpart89 3019 8b82 a9 f8 LDA #248 3020 8b84 8d 65 01 STA twinlaserX 3021 8b87 a9 00 LDA #0 3022 8b89 8d 66 01 STA twinlaserY 3023 8b8c a9 d0 LDA #208 3024 8b8e 8d 57 01 STA enemy01_X 3025 8b91 a9 c8 LDA #200 3026 8b93 8d 58 01 STA enemy01_Y 3027 8b96 a9 01 LDA #1 3028 8b98 8d 59 01 STA enemy01_Flag 3029 8b9b ifnconst NOTIALOCKMUTE 3030 8b9b a9 01 lda #1 3031 8b9d 85 de sta sfxschedulelock 3032 8b9f a9 76 lda #sfx_explosion 3035 8ba5 85 e1 sta sfxinstrumenthi 3036 8ba7 a9 00 lda #0 3037 8ba9 85 e2 sta sfxpitchoffset ; no pitch modification 3038 8bab 85 e3 sta sfxnoteindex ; not a musical note 3039 8bad 20 4b f2 jsr schedulesfx 3040 8bb0 a9 00 lda #0 3041 8bb2 85 de sta sfxschedulelock 3042 8bb4 endif ; NOTIALOCKMUTE 3043 8bb4 .skipL0231 3044 8bb4 .L0232 ;; 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 3045 8bb4 3046 8bb4 ad 57 01 LDA enemy01_X 3047 8bb7 cd 48 01 CMP bulletX 3048 8bba b0 66 BCS .skipL0232 3049 8bbc .condpart90 3050 8bbc ; complex condition detected 3051 8bbc ; complex statement detected 3052 8bbc ad 57 01 LDA enemy01_X 3053 8bbf 18 CLC 3054 8bc0 69 10 ADC #16 3055 8bc2 48 PHA 3056 8bc3 ba TSX 3057 8bc4 68 PLA 3058 8bc5 ad 48 01 LDA bulletX 3059 8bc8 dd 01 01 CMP $101,x 3060 8bcb b0 55 BCS .skip90then 3061 8bcd .condpart91 3062 8bcd ad 58 01 LDA enemy01_Y 3063 8bd0 cd 49 01 CMP bulletY 3064 8bd3 b0 4d BCS .skip91then 3065 8bd5 .condpart92 3066 8bd5 ; complex condition detected 3067 8bd5 ; complex statement detected 3068 8bd5 ad 58 01 LDA enemy01_Y 3069 8bd8 18 CLC 3070 8bd9 69 10 ADC #16 3071 8bdb 48 PHA 3072 8bdc ba TSX 3073 8bdd 68 PLA 3074 8bde ad 49 01 LDA bulletY 3075 8be1 dd 01 01 CMP $101,x 3076 8be4 b0 3c BCS .skip92then 3077 8be6 .condpart93 3078 8be6 a9 01 LDA #1 3079 8be8 8d 59 01 STA enemy01_Flag 3080 8beb 8d 63 01 STA explosion_aniframe 3081 8bee f8 SED 3082 8bef 18 CLC 3083 8bf0 ad a8 01 LDA score0+2 3084 8bf3 69 01 ADC #$01 3085 8bf5 8d a8 01 STA score0+2 3086 8bf8 ad a7 01 LDA score0+1 3087 8bfb 69 00 ADC #$00 3088 8bfd 8d a7 01 STA score0+1 3089 8c00 ad a6 01 LDA score0 3090 8c03 69 00 ADC #$00 3091 8c05 8d a6 01 STA score0 3092 8c08 d8 CLD 3093 8c09 ifnconst NOTIALOCKMUTE 3094 8c09 a9 01 lda #1 3095 8c0b 85 de sta sfxschedulelock 3096 8c0d a9 76 lda #sfx_explosion 3099 8c13 85 e1 sta sfxinstrumenthi 3100 8c15 a9 00 lda #0 3101 8c17 85 e2 sta sfxpitchoffset ; no pitch modification 3102 8c19 85 e3 sta sfxnoteindex ; not a musical note 3103 8c1b 20 4b f2 jsr schedulesfx 3104 8c1e a9 00 lda #0 3105 8c20 85 de sta sfxschedulelock 3106 8c22 endif ; NOTIALOCKMUTE 3107 8c22 .skip92then 3108 8c22 .skip91then 3109 8c22 .skip90then 3110 8c22 .skipL0232 3111 8c22 .L0233 ;; 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 3112 8c22 3113 8c22 ad 57 01 LDA enemy01_X 3114 8c25 cd 65 01 CMP twinlaserX 3115 8c28 b0 66 BCS .skipL0233 3116 8c2a .condpart94 3117 8c2a ; complex condition detected 3118 8c2a ; complex statement detected 3119 8c2a ad 57 01 LDA enemy01_X 3120 8c2d 18 CLC 3121 8c2e 69 10 ADC #16 3122 8c30 48 PHA 3123 8c31 ba TSX 3124 8c32 68 PLA 3125 8c33 ad 65 01 LDA twinlaserX 3126 8c36 dd 01 01 CMP $101,x 3127 8c39 b0 55 BCS .skip94then 3128 8c3b .condpart95 3129 8c3b ad 58 01 LDA enemy01_Y 3130 8c3e cd 66 01 CMP twinlaserY 3131 8c41 b0 4d BCS .skip95then 3132 8c43 .condpart96 3133 8c43 ; complex condition detected 3134 8c43 ; complex statement detected 3135 8c43 ad 58 01 LDA enemy01_Y 3136 8c46 18 CLC 3137 8c47 69 10 ADC #16 3138 8c49 48 PHA 3139 8c4a ba TSX 3140 8c4b 68 PLA 3141 8c4c ad 66 01 LDA twinlaserY 3142 8c4f dd 01 01 CMP $101,x 3143 8c52 b0 3c BCS .skip96then 3144 8c54 .condpart97 3145 8c54 a9 01 LDA #1 3146 8c56 8d 59 01 STA enemy01_Flag 3147 8c59 8d 63 01 STA explosion_aniframe 3148 8c5c f8 SED 3149 8c5d 18 CLC 3150 8c5e ad a8 01 LDA score0+2 3151 8c61 69 01 ADC #$01 3152 8c63 8d a8 01 STA score0+2 3153 8c66 ad a7 01 LDA score0+1 3154 8c69 69 00 ADC #$00 3155 8c6b 8d a7 01 STA score0+1 3156 8c6e ad a6 01 LDA score0 3157 8c71 69 00 ADC #$00 3158 8c73 8d a6 01 STA score0 3159 8c76 d8 CLD 3160 8c77 ifnconst NOTIALOCKMUTE 3161 8c77 a9 01 lda #1 3162 8c79 85 de sta sfxschedulelock 3163 8c7b a9 76 lda #sfx_explosion 3166 8c81 85 e1 sta sfxinstrumenthi 3167 8c83 a9 00 lda #0 3168 8c85 85 e2 sta sfxpitchoffset ; no pitch modification 3169 8c87 85 e3 sta sfxnoteindex ; not a musical note 3170 8c89 20 4b f2 jsr schedulesfx 3171 8c8c a9 00 lda #0 3172 8c8e 85 de sta sfxschedulelock 3173 8c90 endif ; NOTIALOCKMUTE 3174 8c90 .skip96then 3175 8c90 .skip95then 3176 8c90 .skip94then 3177 8c90 .skipL0233 3178 8c90 . 3179 8c90 ;; 3180 8c90 3181 8c90 ._checkCollisionsExit 3182 8c90 ;; _checkCollisionsExit 3183 8c90 3184 8c90 .L0234 ;; return 3185 8c90 3186 8c90 ba tsx 3187 8c91 bd 02 01 lda $102,x 3188 8c94 f0 01 beq bankswitchret7 3189 8c96 60 RTS 3190 8c97 bankswitchret7 3191 8c97 4c 72 f4 JMP BS_return 3192 8c9a . 3193 8c9a ;; 3194 8c9a 3195 8c9a .power_up_obtained 3196 8c9a ;; power_up_obtained 3197 8c9a 3198 8c9a .L0235 ;; if power_upFlag = 1 then twinlaser_flag = 1 3199 8c9a 3200 8c9a ad 52 01 LDA power_upFlag 3201 8c9d c9 01 CMP #1 3202 8c9f d0 05 BNE .skipL0235 3203 8ca1 .condpart98 3204 8ca1 a9 01 LDA #1 3205 8ca3 8d 67 01 STA twinlaser_flag 3206 8ca6 .skipL0235 3207 8ca6 .L0236 ;; if joy0up && twinlaser_flag = 1 && joyposup = - 2 then gosub SetLaserHome 3208 8ca6 3209 8ca6 a9 10 lda #$10 3210 8ca8 2c 80 02 bit SWCHA 3211 8cab d0 17 BNE .skipL0236 3212 8cad .condpart99 3213 8cad ad 67 01 LDA twinlaser_flag 3214 8cb0 c9 01 CMP #1 3215 8cb2 d0 10 BNE .skip99then 3216 8cb4 .condpart100 3217 8cb4 ; complex condition detected 3218 8cb4 a9 fe LDA #254 3219 8cb6 48 PHA 3220 8cb7 ba TSX 3221 8cb8 68 PLA 3222 8cb9 ad 44 01 LDA joyposup 3223 8cbc dd 01 01 CMP $101,x 3224 8cbf d0 03 BNE .skip100then 3225 8cc1 .condpart101 3226 8cc1 20 2f 8e jsr .SetLaserHome 3227 8cc4 3228 8cc4 .skip100then 3229 8cc4 .skip99then 3230 8cc4 .skipL0236 3231 8cc4 .L0237 ;; if joy0down && twinlaser_flag = 1 && joyposdown = - 2 then gosub SetLaserHome 3232 8cc4 3233 8cc4 a9 20 lda #$20 3234 8cc6 2c 80 02 bit SWCHA 3235 8cc9 d0 17 BNE .skipL0237 3236 8ccb .condpart102 3237 8ccb ad 67 01 LDA twinlaser_flag 3238 8cce c9 01 CMP #1 3239 8cd0 d0 10 BNE .skip102then 3240 8cd2 .condpart103 3241 8cd2 ; complex condition detected 3242 8cd2 a9 fe LDA #254 3243 8cd4 48 PHA 3244 8cd5 ba TSX 3245 8cd6 68 PLA 3246 8cd7 ad 45 01 LDA joyposdown 3247 8cda dd 01 01 CMP $101,x 3248 8cdd d0 03 BNE .skip103then 3249 8cdf .condpart104 3250 8cdf 20 2f 8e jsr .SetLaserHome 3251 8ce2 3252 8ce2 .skip103then 3253 8ce2 .skip102then 3254 8ce2 .skipL0237 3255 8ce2 .L0238 ;; if joy0up && twinlaser_flag = 1 && joyposleft = - 2 then gosub SetLaserHome 3256 8ce2 3257 8ce2 a9 10 lda #$10 3258 8ce4 2c 80 02 bit SWCHA 3259 8ce7 d0 17 BNE .skipL0238 3260 8ce9 .condpart105 3261 8ce9 ad 67 01 LDA twinlaser_flag 3262 8cec c9 01 CMP #1 3263 8cee d0 10 BNE .skip105then 3264 8cf0 .condpart106 3265 8cf0 ; complex condition detected 3266 8cf0 a9 fe LDA #254 3267 8cf2 48 PHA 3268 8cf3 ba TSX 3269 8cf4 68 PLA 3270 8cf5 ad 46 01 LDA joyposleft 3271 8cf8 dd 01 01 CMP $101,x 3272 8cfb d0 03 BNE .skip106then 3273 8cfd .condpart107 3274 8cfd 20 2f 8e jsr .SetLaserHome 3275 8d00 3276 8d00 .skip106then 3277 8d00 .skip105then 3278 8d00 .skipL0238 3279 8d00 .L0239 ;; if joy0down && twinlaser_flag = 1 && joyposright = - 2 then gosub SetLaserHome 3280 8d00 3281 8d00 a9 20 lda #$20 3282 8d02 2c 80 02 bit SWCHA 3283 8d05 d0 17 BNE .skipL0239 3284 8d07 .condpart108 3285 8d07 ad 67 01 LDA twinlaser_flag 3286 8d0a c9 01 CMP #1 3287 8d0c d0 10 BNE .skip108then 3288 8d0e .condpart109 3289 8d0e ; complex condition detected 3290 8d0e a9 fe LDA #254 3291 8d10 48 PHA 3292 8d11 ba TSX 3293 8d12 68 PLA 3294 8d13 ad 47 01 LDA joyposright 3295 8d16 dd 01 01 CMP $101,x 3296 8d19 d0 03 BNE .skip109then 3297 8d1b .condpart110 3298 8d1b 20 2f 8e jsr .SetLaserHome 3299 8d1e 3300 8d1e .skip109then 3301 8d1e .skip108then 3302 8d1e .skipL0239 3303 8d1e .L0240 ;; if joy0fire && twinlaser_flag = 1 && joyposup = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3304 8d1e 3305 8d1e 2c 02 21 bit sINPT1 3306 8d21 10 30 BPL .skipL0240 3307 8d23 .condpart111 3308 8d23 ad 67 01 LDA twinlaser_flag 3309 8d26 c9 01 CMP #1 3310 8d28 d0 29 BNE .skip111then 3311 8d2a .condpart112 3312 8d2a ad 44 01 LDA joyposup 3313 8d2d c9 01 CMP #1 3314 8d2f d0 22 BNE .skip112then 3315 8d31 .condpart113 3316 8d31 ad 66 01 LDA twinlaserY 3317 8d34 38 SEC 3318 8d35 e9 0a SBC #10 3319 8d37 8d 66 01 STA twinlaserY 3320 8d3a ifnconst NOTIALOCKMUTE 3321 8d3a a9 01 lda #1 3322 8d3c 85 de sta sfxschedulelock 3323 8d3e a9 43 lda #sfx_plainlaser 3326 8d44 85 e1 sta sfxinstrumenthi 3327 8d46 a9 00 lda #0 3328 8d48 85 e2 sta sfxpitchoffset ; no pitch modification 3329 8d4a 85 e3 sta sfxnoteindex ; not a musical note 3330 8d4c 20 4b f2 jsr schedulesfx 3331 8d4f a9 00 lda #0 3332 8d51 85 de sta sfxschedulelock 3333 8d53 endif ; NOTIALOCKMUTE 3334 8d53 .skip112then 3335 8d53 .skip111then 3336 8d53 .skipL0240 3337 8d53 .L0241 ;; if joy0fire && twinlaser_flag = 1 && joyposdown = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3338 8d53 3339 8d53 2c 02 21 bit sINPT1 3340 8d56 10 30 BPL .skipL0241 3341 8d58 .condpart114 3342 8d58 ad 67 01 LDA twinlaser_flag 3343 8d5b c9 01 CMP #1 3344 8d5d d0 29 BNE .skip114then 3345 8d5f .condpart115 3346 8d5f ad 45 01 LDA joyposdown 3347 8d62 c9 01 CMP #1 3348 8d64 d0 22 BNE .skip115then 3349 8d66 .condpart116 3350 8d66 ad 66 01 LDA twinlaserY 3351 8d69 38 SEC 3352 8d6a e9 0a SBC #10 3353 8d6c 8d 66 01 STA twinlaserY 3354 8d6f ifnconst NOTIALOCKMUTE 3355 8d6f a9 01 lda #1 3356 8d71 85 de sta sfxschedulelock 3357 8d73 a9 43 lda #sfx_plainlaser 3360 8d79 85 e1 sta sfxinstrumenthi 3361 8d7b a9 00 lda #0 3362 8d7d 85 e2 sta sfxpitchoffset ; no pitch modification 3363 8d7f 85 e3 sta sfxnoteindex ; not a musical note 3364 8d81 20 4b f2 jsr schedulesfx 3365 8d84 a9 00 lda #0 3366 8d86 85 de sta sfxschedulelock 3367 8d88 endif ; NOTIALOCKMUTE 3368 8d88 .skip115then 3369 8d88 .skip114then 3370 8d88 .skipL0241 3371 8d88 .L0242 ;; if joy0fire && twinlaser_flag = 1 && joyposleft = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3372 8d88 3373 8d88 2c 02 21 bit sINPT1 3374 8d8b 10 30 BPL .skipL0242 3375 8d8d .condpart117 3376 8d8d ad 67 01 LDA twinlaser_flag 3377 8d90 c9 01 CMP #1 3378 8d92 d0 29 BNE .skip117then 3379 8d94 .condpart118 3380 8d94 ad 46 01 LDA joyposleft 3381 8d97 c9 01 CMP #1 3382 8d99 d0 22 BNE .skip118then 3383 8d9b .condpart119 3384 8d9b ad 66 01 LDA twinlaserY 3385 8d9e 38 SEC 3386 8d9f e9 0a SBC #10 3387 8da1 8d 66 01 STA twinlaserY 3388 8da4 ifnconst NOTIALOCKMUTE 3389 8da4 a9 01 lda #1 3390 8da6 85 de sta sfxschedulelock 3391 8da8 a9 43 lda #sfx_plainlaser 3394 8dae 85 e1 sta sfxinstrumenthi 3395 8db0 a9 00 lda #0 3396 8db2 85 e2 sta sfxpitchoffset ; no pitch modification 3397 8db4 85 e3 sta sfxnoteindex ; not a musical note 3398 8db6 20 4b f2 jsr schedulesfx 3399 8db9 a9 00 lda #0 3400 8dbb 85 de sta sfxschedulelock 3401 8dbd endif ; NOTIALOCKMUTE 3402 8dbd .skip118then 3403 8dbd .skip117then 3404 8dbd .skipL0242 3405 8dbd .L0243 ;; if joy0fire && twinlaser_flag = 1 && joyposright = 1 then twinlaserY = twinlaserY - 10 : playsfx sfx_plainlaser 3406 8dbd 3407 8dbd 2c 02 21 bit sINPT1 3408 8dc0 10 30 BPL .skipL0243 3409 8dc2 .condpart120 3410 8dc2 ad 67 01 LDA twinlaser_flag 3411 8dc5 c9 01 CMP #1 3412 8dc7 d0 29 BNE .skip120then 3413 8dc9 .condpart121 3414 8dc9 ad 47 01 LDA joyposright 3415 8dcc c9 01 CMP #1 3416 8dce d0 22 BNE .skip121then 3417 8dd0 .condpart122 3418 8dd0 ad 66 01 LDA twinlaserY 3419 8dd3 38 SEC 3420 8dd4 e9 0a SBC #10 3421 8dd6 8d 66 01 STA twinlaserY 3422 8dd9 ifnconst NOTIALOCKMUTE 3423 8dd9 a9 01 lda #1 3424 8ddb 85 de sta sfxschedulelock 3425 8ddd a9 43 lda #sfx_plainlaser 3428 8de3 85 e1 sta sfxinstrumenthi 3429 8de5 a9 00 lda #0 3430 8de7 85 e2 sta sfxpitchoffset ; no pitch modification 3431 8de9 85 e3 sta sfxnoteindex ; not a musical note 3432 8deb 20 4b f2 jsr schedulesfx 3433 8dee a9 00 lda #0 3434 8df0 85 de sta sfxschedulelock 3435 8df2 endif ; NOTIALOCKMUTE 3436 8df2 .skip121then 3437 8df2 .skip120then 3438 8df2 .skipL0243 3439 8df2 .L0244 ;; if !joy0fire then twinlaserX = playerX + 2 : twinlaserY = playerY - 8 3440 8df2 3441 8df2 2c 02 21 bit sINPT1 3442 8df5 30 12 BMI .skipL0244 3443 8df7 .condpart123 3444 8df7 ad 41 01 LDA playerX 3445 8dfa 18 CLC 3446 8dfb 69 02 ADC #2 3447 8dfd 8d 65 01 STA twinlaserX 3448 8e00 ad 42 01 LDA playerY 3449 8e03 38 SEC 3450 8e04 e9 08 SBC #8 3451 8e06 8d 66 01 STA twinlaserY 3452 8e09 .skipL0244 3453 8e09 .L0245 ;; return 3454 8e09 3455 8e09 ba tsx 3456 8e0a bd 02 01 lda $102,x 3457 8e0d f0 01 beq bankswitchret8 3458 8e0f 60 RTS 3459 8e10 bankswitchret8 3460 8e10 4c 72 f4 JMP BS_return 3461 8e13 . 3462 8e13 ;; 3463 8e13 3464 8e13 .SetBulletHome 3465 8e13 ;; SetBulletHome 3466 8e13 3467 8e13 .L0246 ;; bulletX = playerX + 4 : bulletY = playerY - 2 3468 8e13 3469 8e13 ad 41 01 LDA playerX 3470 8e16 18 CLC 3471 8e17 69 04 ADC #4 3472 8e19 8d 48 01 STA bulletX 3473 8e1c ad 42 01 LDA playerY 3474 8e1f 38 SEC 3475 8e20 e9 02 SBC #2 3476 8e22 8d 49 01 STA bulletY 3477 8e25 .L0247 ;; return 3478 8e25 3479 8e25 ba tsx 3480 8e26 bd 02 01 lda $102,x 3481 8e29 f0 01 beq bankswitchret9 3482 8e2b 60 RTS 3483 8e2c bankswitchret9 3484 8e2c 4c 72 f4 JMP BS_return 3485 8e2f . 3486 8e2f ;; 3487 8e2f 3488 8e2f .SetLaserHome 3489 8e2f ;; SetLaserHome 3490 8e2f 3491 8e2f .L0248 ;; twinlaserX = playerX + 4 : twinlaserY = playerY - 2 3492 8e2f 3493 8e2f ad 41 01 LDA playerX 3494 8e32 18 CLC 3495 8e33 69 04 ADC #4 3496 8e35 8d 65 01 STA twinlaserX 3497 8e38 ad 42 01 LDA playerY 3498 8e3b 38 SEC 3499 8e3c e9 02 SBC #2 3500 8e3e 8d 66 01 STA twinlaserY 3501 8e41 .L0249 ;; return 3502 8e41 3503 8e41 ba tsx 3504 8e42 bd 02 01 lda $102,x 3505 8e45 f0 01 beq bankswitchret10 3506 8e47 60 RTS 3507 8e48 bankswitchret10 3508 8e48 4c 72 f4 JMP BS_return 3509 8e4b . 3510 8e4b ;; 3511 8e4b 3512 8e4b .lose_a_life 3513 8e4b ;; lose_a_life 3514 8e4b 3515 8e4b .L0250 ;; lives = lives - 1 : isDead_flag = 0 3516 8e4b 3517 8e4b ad 64 01 LDA lives 3518 8e4e 38 SEC 3519 8e4f e9 01 SBC #1 3520 8e51 8d 64 01 STA lives 3521 8e54 a9 00 LDA #0 3522 8e56 8d 6a 01 STA isDead_flag 3523 8e59 .L0251 ;; if enemy01_Flag <> 1 then enemy01_X = 32 : enemy01_Y = 0 3524 8e59 3525 8e59 ad 59 01 LDA enemy01_Flag 3526 8e5c c9 01 CMP #1 3527 8e5e f0 0a BEQ .skipL0251 3528 8e60 .condpart124 3529 8e60 a9 20 LDA #32 3530 8e62 8d 57 01 STA enemy01_X 3531 8e65 a9 00 LDA #0 3532 8e67 8d 58 01 STA enemy01_Y 3533 8e6a .skipL0251 3534 8e6a .L0252 ;; if enemy_shotFlag <> 1 then enemy_shotX = 0 : enemy_shotY = 0 3535 8e6a 3536 8e6a ad 4c 01 LDA enemy_shotFlag 3537 8e6d c9 01 CMP #1 3538 8e6f f0 08 BEQ .skipL0252 3539 8e71 .condpart125 3540 8e71 a9 00 LDA #0 3541 8e73 8d 4a 01 STA enemy_shotX 3542 8e76 8d 4b 01 STA enemy_shotY 3543 8e79 .skipL0252 3544 8e79 .L0253 ;; if playerFlag = 1 && explosion_aniframe = 200 && lives > 0 then playerX = 80 : playerY = 144 : playerFlag = 0 : explosion_aniframe = 0 : twinlaser_flag = 0 : goto main 3545 8e79 3546 8e79 ad 4d 01 LDA playerFlag 3547 8e7c c9 01 CMP #1 3548 8e7e d0 26 BNE .skipL0253 3549 8e80 .condpart126 3550 8e80 ad 63 01 LDA explosion_aniframe 3551 8e83 c9 c8 CMP #200 3552 8e85 d0 1f BNE .skip126then 3553 8e87 .condpart127 3554 8e87 a9 00 LDA #0 3555 8e89 cd 64 01 CMP lives 3556 8e8c b0 18 BCS .skip127then 3557 8e8e .condpart128 3558 8e8e a9 50 LDA #80 3559 8e90 8d 41 01 STA playerX 3560 8e93 a9 90 LDA #144 3561 8e95 8d 42 01 STA playerY 3562 8e98 a9 00 LDA #0 3563 8e9a 8d 4d 01 STA playerFlag 3564 8e9d 8d 63 01 STA explosion_aniframe 3565 8ea0 8d 67 01 STA twinlaser_flag 3566 8ea3 4c ea 80 jmp .main 3567 8ea6 3568 8ea6 .skip127then 3569 8ea6 .skip126then 3570 8ea6 .skipL0253 3571 8ea6 .L0254 ;; joyposup = 0 : joyposdown = 0 : joyposleft = 0 : joyposright = 0 3572 8ea6 3573 8ea6 a9 00 LDA #0 3574 8ea8 8d 44 01 STA joyposup 3575 8eab 8d 45 01 STA joyposdown 3576 8eae 8d 46 01 STA joyposleft 3577 8eb1 8d 47 01 STA joyposright 3578 8eb4 .L0255 ;; bulletX = 0 : bulletY = 0 3579 8eb4 3580 8eb4 a9 00 LDA #0 3581 8eb6 8d 48 01 STA bulletX 3582 8eb9 8d 49 01 STA bulletY 3583 8ebc .L0256 ;; enemy01_X = 0 : enemy01_Y = 0 : enemy01_Flag = 0 3584 8ebc 3585 8ebc a9 00 LDA #0 3586 8ebe 8d 57 01 STA enemy01_X 3587 8ec1 8d 58 01 STA enemy01_Y 3588 8ec4 8d 59 01 STA enemy01_Flag 3589 8ec7 .L0257 ;; playerFlag = 0 : gameover_flag = 0 3590 8ec7 3591 8ec7 a9 00 LDA #0 3592 8ec9 8d 4d 01 STA playerFlag 3593 8ecc 8d 5f 01 STA gameover_flag 3594 8ecf .L0258 ;; power_upFlag = 0 : twinlaser_flag = 0 3595 8ecf 3596 8ecf a9 00 LDA #0 3597 8ed1 8d 52 01 STA power_upFlag 3598 8ed4 8d 67 01 STA twinlaser_flag 3599 8ed7 . 3600 8ed7 ;; 3601 8ed7 3602 8ed7 .lose_a_lifeloop 3603 8ed7 ;; lose_a_lifeloop 3604 8ed7 3605 8ed7 . 3606 8ed7 ;; 3607 8ed7 3608 8ed7 .L0259 ;; gosub draw_scores 3609 8ed7 3610 8ed7 20 e0 88 jsr .draw_scores 3611 8eda 3612 8eda .L0260 ;; drawscreen 3613 8eda 3614 8eda 20 b3 f0 jsr drawscreen 3615 8edd .L0261 ;; if joy0fire then fire_debounce = 2 3616 8edd 3617 8edd 2c 02 21 bit sINPT1 3618 8ee0 10 05 BPL .skipL0261 3619 8ee2 .condpart129 3620 8ee2 a9 02 LDA #2 3621 8ee4 8d 43 01 STA fire_debounce 3622 8ee7 .skipL0261 3623 8ee7 .L0262 ;; if !joy0fire then fire_debounce = 1 3624 8ee7 3625 8ee7 2c 02 21 bit sINPT1 3626 8eea 30 05 BMI .skipL0262 3627 8eec .condpart130 3628 8eec a9 01 LDA #1 3629 8eee 8d 43 01 STA fire_debounce 3630 8ef1 .skipL0262 3631 8ef1 .L0263 ;; if fire_debounce = 1 && lives > 0 then clearscreen : goto main 3632 8ef1 3633 8ef1 ad 43 01 LDA fire_debounce 3634 8ef4 c9 01 CMP #1 3635 8ef6 d0 0d BNE .skipL0263 3636 8ef8 .condpart131 3637 8ef8 a9 00 LDA #0 3638 8efa cd 64 01 CMP lives 3639 8efd b0 06 BCS .skip131then 3640 8eff .condpart132 3641 8eff 20 7f f0 jsr clearscreen 3642 8f02 4c ea 80 jmp .main 3643 8f05 3644 8f05 .skip131then 3645 8f05 .skipL0263 3646 8f05 .L0264 ;; if fire_debounce = 1 && lives < 1 then clearscreen : goto gameover 3647 8f05 3648 8f05 ad 43 01 LDA fire_debounce 3649 8f08 c9 01 CMP #1 3650 8f0a d0 0d BNE .skipL0264 3651 8f0c .condpart133 3652 8f0c ad 64 01 LDA lives 3653 8f0f c9 01 CMP #1 3654 8f11 b0 06 BCS .skip133then 3655 8f13 .condpart134 3656 8f13 20 7f f0 jsr clearscreen 3657 8f16 4c 1c 8f jmp .gameover 3658 8f19 3659 8f19 .skip133then 3660 8f19 .skipL0264 3661 8f19 .L0265 ;; goto lose_a_lifeloop 3662 8f19 3663 8f19 4c d7 8e jmp .lose_a_lifeloop 3664 8f1c 3665 8f1c . 3666 8f1c ;; 3667 8f1c 3668 8f1c .gameover 3669 8f1c ;; gameover 3670 8f1c 3671 8f1c .L0266 ;; gameover_flag = 0 3672 8f1c 3673 8f1c a9 00 LDA #0 3674 8f1e 8d 5f 01 STA gameover_flag 3675 8f21 .L0267 ;; fire_debounce = 1 3676 8f21 3677 8f21 a9 01 LDA #1 3678 8f23 8d 43 01 STA fire_debounce 3679 8f26 . 3680 8f26 ;; 3681 8f26 3682 8f26 .gameover_loop 3683 8f26 ;; gameover_loop 3684 8f26 3685 8f26 .L0268 ;; if lives = 0 then gameover_flag = 1 : clearscreen 3686 8f26 3687 8f26 ad 64 01 LDA lives 3688 8f29 c9 00 CMP #0 3689 8f2b d0 08 BNE .skipL0268 3690 8f2d .condpart135 3691 8f2d a9 01 LDA #1 3692 8f2f 8d 5f 01 STA gameover_flag 3693 8f32 20 7f f0 jsr clearscreen 3694 8f35 .skipL0268 3695 8f35 .L0269 ;; plotchars 'game^over!' 0 40 16 3696 8f35 3697 8f35 4c 42 8f JMP skipalphadata10 3698 8f38 alphadata10 3699 8f38 11 .byte.b (alphadata10 3714 8f48 85 43 sta temp2 3715 8f4a 3716 8f4a a9 16 lda #22 ; width in two's complement 3717 8f4c 09 00 ora #0 ; palette left shifted 5 bits 3718 8f4e 85 44 sta temp3 3719 8f50 a9 28 lda #40 3720 8f52 85 45 sta temp4 3721 8f54 3722 8f54 a9 10 lda #16 3723 8f56 3724 8f56 85 46 sta temp5 3725 8f58 3726 8f58 20 4c f3 jsr plotcharacters 3727 8f5b .L0270 ;; if joy0fire && !fire_debounce then clearscreen : goto plot 3728 8f5b 3729 8f5b 2c 02 21 bit sINPT1 3730 8f5e 10 0b BPL .skipL0270 3731 8f60 .condpart136 3732 8f60 ad 43 01 LDA fire_debounce 3733 8f63 d0 06 BNE .skip136then 3734 8f65 .condpart137 3735 8f65 20 7f f0 jsr clearscreen 3736 8f68 4c 43 80 jmp .plot 3737 8f6b 3738 8f6b .skip136then 3739 8f6b .skipL0270 3740 8f6b .L0271 ;; if !joy0fire then fire_debounce = 0 3741 8f6b 3742 8f6b 2c 02 21 bit sINPT1 3743 8f6e 30 05 BMI .skipL0271 3744 8f70 .condpart138 3745 8f70 a9 00 LDA #0 3746 8f72 8d 43 01 STA fire_debounce 3747 8f75 .skipL0271 3748 8f75 .L0272 ;; goto gameover_loop 3749 8f75 3750 8f75 4c 26 8f jmp .gameover_loop 3751 8f78 3752 8f78 . 3753 8f78 ;; 3754 8f78 3755 8f78 . 3756 8f78 ;; 3757 8f78 3758 8f78 . 3759 8f78 ;; 3760 8f78 3761 8f78 . 3762 8f78 ;; 3763 8f78 3764 8f78 . 3765 8f78 ;; 3766 8f78 3767 8f78 . 3768 8f78 ;; 3769 8f78 3770 8f78 . 3771 8f78 ;; 3772 8f78 3773 8f78 . 3774 8f78 ;; 3775 8f78 3776 8f78 . 3777 8f78 ;; 3778 8f78 3779 8f78 . 3780 8f78 ;; 3781 8f78 3782 8f78 . 3783 8f78 ;; 3784 8f78 3785 8f78 . 3786 8f78 ;; 3787 8f78 3788 8f78 . 3789 8f78 ;; 3790 8f78 3791 8f78 . 3792 8f78 ;; 3793 8f78 3794 8f78 . 3795 8f78 ;; 3796 8f78 3797 8f78 .titlescreen 3798 8f78 ;; titlescreen 3799 8f78 3800 8f78 .L0273 ;; plotchars 'new^vertical^shooting' 1 38 4 3801 8f78 3802 8f78 4c 90 8f JMP skipalphadata11 3803 8f7b alphadata11 3804 8f7b 18 .byte.b (alphadata11 3830 8f96 85 43 sta temp2 3831 8f98 3832 8f98 a9 0b lda #11 ; width in two's complement 3833 8f9a 09 20 ora #32 ; palette left shifted 5 bits 3834 8f9c 85 44 sta temp3 3835 8f9e a9 26 lda #38 3836 8fa0 85 45 sta temp4 3837 8fa2 3838 8fa2 a9 04 lda #4 3839 8fa4 3840 8fa4 85 46 sta temp5 3841 8fa6 3842 8fa6 20 4c f3 jsr plotcharacters 3843 8fa9 .L0274 ;; plotchars 'demo' 1 72 5 3844 8fa9 3845 8fa9 4c b0 8f JMP skipalphadata12 3846 8fac alphadata12 3847 8fac 0e .byte.b (alphadata12 3856 8fb6 85 43 sta temp2 3857 8fb8 3858 8fb8 a9 1c lda #28 ; width in two's complement 3859 8fba 09 20 ora #32 ; palette left shifted 5 bits 3860 8fbc 85 44 sta temp3 3861 8fbe a9 48 lda #72 3862 8fc0 85 45 sta temp4 3863 8fc2 3864 8fc2 a9 05 lda #5 3865 8fc4 3866 8fc4 85 46 sta temp5 3867 8fc6 3868 8fc6 20 4c f3 jsr plotcharacters 3869 8fc9 .L0275 ;; plotchars 'by^shane^skekel.' 1 48 7 3870 8fc9 3871 8fc9 4c dc 8f JMP skipalphadata13 3872 8fcc alphadata13 3873 8fcc 0c .byte.b (alphadata13 3894 8fe2 85 43 sta temp2 3895 8fe4 3896 8fe4 a9 10 lda #16 ; width in two's complement 3897 8fe6 09 20 ora #32 ; palette left shifted 5 bits 3898 8fe8 85 44 sta temp3 3899 8fea a9 30 lda #48 3900 8fec 85 45 sta temp4 3901 8fee 3902 8fee a9 07 lda #7 3903 8ff0 3904 8ff0 85 46 sta temp5 3905 8ff2 3906 8ff2 20 4c f3 jsr plotcharacters 3907 8ff5 .L0276 ;; plotchars 'push^fire^to^begin.' 2 42 16 3908 8ff5 3909 8ff5 4c 0b 90 JMP skipalphadata14 3910 8ff8 alphadata14 3911 8ff8 1a .byte.b (alphadata14 3935 9011 85 43 sta temp2 3936 9013 3937 9013 a9 0d lda #13 ; width in two's complement 3938 9015 09 40 ora #64 ; palette left shifted 5 bits 3939 9017 85 44 sta temp3 3940 9019 a9 2a lda #42 3941 901b 85 45 sta temp4 3942 901d 3943 901d a9 10 lda #16 3944 901f 3945 901f 85 46 sta temp5 3946 9021 3947 9021 20 4c f3 jsr plotcharacters 3948 9024 .L0277 ;; savescreen 3949 9024 3950 9024 20 a3 f0 jsr savescreen 3951 9027 .L0278 ;; drawscreen 3952 9027 3953 9027 20 b3 f0 jsr drawscreen 3954 902a .L0279 ;; fire_debounce = 1 3955 902a 3956 902a a9 01 LDA #1 3957 902c 8d 43 01 STA fire_debounce 3958 902f . 3959 902f ;; 3960 902f 3961 902f .titlescreenloop 3962 902f ;; titlescreenloop 3963 902f 3964 902f .L0280 ;; restorescreen 3965 902f 3966 902f 20 91 f0 jsr restorescreen 3967 9032 .L0281 ;; if switchreset then reboot 3968 9032 3969 9032 20 85 f4 jsr checkresetswitch 3970 9035 d0 03 BNE .skipL0281 3971 9037 .condpart139 3972 9037 4c 72 f5 JMP START 3973 903a .skipL0281 3974 903a .L0282 ;; if joy0fire then clearscreen : savescreen : lives = $04 : score0 = 0 : playsfx sfx_bling : goto main 3975 903a 3976 903a 2c 02 21 bit sINPT1 3977 903d 10 36 BPL .skipL0282 3978 903f .condpart140 3979 903f 20 7f f0 jsr clearscreen 3980 9042 20 a3 f0 jsr savescreen 3981 9045 a9 04 LDA #$04 3982 9047 8d 64 01 STA lives 3983 904a a9 00 LDA #$00 3984 904c 8d a8 01 STA score0+2 3985 904f a9 00 LDA #$00 3986 9051 8d a7 01 STA score0+1 3987 9054 a9 00 LDA #$00 3988 9056 8d a6 01 STA score0 3989 9059 ifnconst NOTIALOCKMUTE 3990 9059 a9 01 lda #1 3991 905b 85 de sta sfxschedulelock 3992 905d a9 b3 lda #sfx_bling 3995 9063 85 e1 sta sfxinstrumenthi 3996 9065 a9 00 lda #0 3997 9067 85 e2 sta sfxpitchoffset ; no pitch modification 3998 9069 85 e3 sta sfxnoteindex ; not a musical note 3999 906b 20 4b f2 jsr schedulesfx 4000 906e a9 00 lda #0 4001 9070 85 de sta sfxschedulelock 4002 9072 endif ; NOTIALOCKMUTE 4003 9072 4c ea 80 jmp .main 4004 9075 4005 9075 .skipL0282 4006 9075 .L0283 ;; if !joy0fire then fire_debounce = 0 4007 9075 4008 9075 2c 02 21 bit sINPT1 4009 9078 30 05 BMI .skipL0283 4010 907a .condpart141 4011 907a a9 00 LDA #0 4012 907c 8d 43 01 STA fire_debounce 4013 907f .skipL0283 4014 907f .L0284 ;; drawscreen 4015 907f 4016 907f 20 b3 f0 jsr drawscreen 4017 9082 .L0285 ;; goto titlescreenloop 4018 9082 4019 9082 4c 2f 90 jmp .titlescreenloop 4020 9085 4021 9085 . 4022 9085 ;; 4023 9085 4024 9085 . 4025 9085 ;; 4026 9085 4027 9085 .initialise_gamescreen 4028 9085 ;; initialise_gamescreen 4029 9085 4030 9085 .L0286 ;; clearscreen 4031 9085 4032 9085 20 7f f0 jsr clearscreen 4033 9088 .L0287 ;; BACKGRND = $00 4034 9088 4035 9088 a9 00 LDA #$00 4036 908a 85 20 STA BACKGRND 4037 908c . 4038 908c ;; 4039 908c 4040 908c .L0288 ;; savescreen 4041 908c 4042 908c 20 a3 f0 jsr savescreen 4043 908f .L0289 ;; return 4044 908f 4045 908f ba tsx 4046 9090 bd 02 01 lda $102,x 4047 9093 f0 01 beq bankswitchret16 4048 9095 60 RTS 4049 9096 bankswitchret16 4050 9096 4c 72 f4 JMP BS_return 4051 9099 . 4052 9099 ;; 4053 9099 4054 9099 .fire_enemybullet 4055 9099 ;; fire_enemybullet 4056 9099 4057 9099 . 4058 9099 ;; 4059 9099 4060 9099 . 4061 9099 ;; 4062 9099 4063 9099 .check_enemyshot 4064 9099 ;; check_enemyshot 4065 9099 4066 9099 . 4067 9099 ;; 4068 9099 4069 9099 . 4070 9099 ;; 4071 9099 4072 9099 . 4073 9099 ;; 4074 9099 4075 9099 . 4076 9099 ;; 4077 9099 4078 9099 . 4079 9099 ;; 4080 9099 4081 9099 .L0290 ;; if enemy_shotFlag = TRUE then goto skip_enemy_shot 4082 9099 4083 9099 ad 4c 01 LDA enemy_shotFlag 4084 909c c9 01 CMP #TRUE 4085 909e d0 03 BNE .skipL0290 4086 90a0 .condpart142 4087 90a0 4c f0 91 jmp .skip_enemy_shot 4088 90a3 4089 90a3 .skipL0290 4090 90a3 .L0291 ;; enemy_shotFlag = TRUE 4091 90a3 4092 90a3 a9 01 LDA #TRUE 4093 90a5 8d 4c 01 STA enemy_shotFlag 4094 90a8 .L0292 ;; enemy_shotX = enemy01_X + 2 4095 90a8 4096 90a8 ad 57 01 LDA enemy01_X 4097 90ab 18 CLC 4098 90ac 69 02 ADC #2 4099 90ae 8d 4a 01 STA enemy_shotX 4100 90b1 .L0293 ;; enemy_shotY = enemy01_Y + 4 4101 90b1 4102 90b1 ad 58 01 LDA enemy01_Y 4103 90b4 18 CLC 4104 90b5 69 04 ADC #4 4105 90b7 8d 4b 01 STA enemy_shotY 4106 90ba . 4107 90ba ;; 4108 90ba 4109 90ba .L0294 ;; temp_XSu = 0 4110 90ba 4111 90ba a9 00 LDA #0 4112 90bc 8d 71 01 STA temp_XSu 4113 90bf .L0295 ;; temp_YSu = 0 4114 90bf 4115 90bf a9 00 LDA #0 4116 90c1 8d 73 01 STA temp_YSu 4117 90c4 . 4118 90c4 ;; 4119 90c4 4120 90c4 . 4121 90c4 ;; 4122 90c4 4123 90c4 . 4124 90c4 ;; 4125 90c4 4126 90c4 . 4127 90c4 ;; 4128 90c4 4129 90c4 . 4130 90c4 ;; 4131 90c4 4132 90c4 .L0296 ;; if playerX = enemy_shotX then temp_XSf = 0 4133 90c4 4134 90c4 ad 41 01 LDA playerX 4135 90c7 cd 4a 01 CMP enemy_shotX 4136 90ca d0 05 BNE .skipL0296 4137 90cc .condpart143 4138 90cc a9 00 LDA #0 4139 90ce 8d 72 01 STA temp_XSf 4140 90d1 .skipL0296 4141 90d1 .L0297 ;; if playerX > enemy_shotX then temp_XSf = playerX - enemy_shotX 4142 90d1 4143 90d1 ad 4a 01 LDA enemy_shotX 4144 90d4 cd 41 01 CMP playerX 4145 90d7 b0 0a BCS .skipL0297 4146 90d9 .condpart144 4147 90d9 ad 41 01 LDA playerX 4148 90dc 38 SEC 4149 90dd ed 4a 01 SBC enemy_shotX 4150 90e0 8d 72 01 STA temp_XSf 4151 90e3 .skipL0297 4152 90e3 .L0298 ;; if playerX < enemy_shotX then temp_XSf = enemy_shotX - playerX 4153 90e3 4154 90e3 ad 41 01 LDA playerX 4155 90e6 cd 4a 01 CMP enemy_shotX 4156 90e9 b0 0a BCS .skipL0298 4157 90eb .condpart145 4158 90eb ad 4a 01 LDA enemy_shotX 4159 90ee 38 SEC 4160 90ef ed 41 01 SBC playerX 4161 90f2 8d 72 01 STA temp_XSf 4162 90f5 .skipL0298 4163 90f5 . 4164 90f5 ;; 4165 90f5 4166 90f5 . 4167 90f5 ;; 4168 90f5 4169 90f5 . 4170 90f5 ;; 4171 90f5 4172 90f5 . 4173 90f5 ;; 4174 90f5 4175 90f5 . 4176 90f5 ;; 4177 90f5 4178 90f5 .L0299 ;; if playerY = enemy_shotY then temp_YSf = 0 4179 90f5 4180 90f5 ad 42 01 LDA playerY 4181 90f8 cd 4b 01 CMP enemy_shotY 4182 90fb d0 05 BNE .skipL0299 4183 90fd .condpart146 4184 90fd a9 00 LDA #0 4185 90ff 8d 74 01 STA temp_YSf 4186 9102 .skipL0299 4187 9102 .L0300 ;; if playerY > enemy_shotY then temp_YSf = playerY - enemy_shotY 4188 9102 4189 9102 ad 4b 01 LDA enemy_shotY 4190 9105 cd 42 01 CMP playerY 4191 9108 b0 0a BCS .skipL0300 4192 910a .condpart147 4193 910a ad 42 01 LDA playerY 4194 910d 38 SEC 4195 910e ed 4b 01 SBC enemy_shotY 4196 9111 8d 74 01 STA temp_YSf 4197 9114 .skipL0300 4198 9114 .L0301 ;; if playerY < enemy_shotY then temp_YSf = enemy_shotY - playerY 4199 9114 4200 9114 ad 42 01 LDA playerY 4201 9117 cd 4b 01 CMP enemy_shotY 4202 911a b0 0a BCS .skipL0301 4203 911c .condpart148 4204 911c ad 4b 01 LDA enemy_shotY 4205 911f 38 SEC 4206 9120 ed 42 01 SBC playerY 4207 9123 8d 74 01 STA temp_YSf 4208 9126 .skipL0301 4209 9126 . 4210 9126 ;; 4211 9126 4212 9126 . 4213 9126 ;; 4214 9126 4215 9126 . 4216 9126 ;; 4217 9126 4218 9126 . 4219 9126 ;; 4220 9126 4221 9126 . 4222 9126 ;; 4223 9126 4224 9126 . 4225 9126 ;; 4226 9126 4227 9126 . 4228 9126 ;; 4229 9126 4230 9126 .L0302 ;; if temp_YSf = 0 && temp_XSf = 0 then enemy_shotFlag = FALSE : return 4231 9126 4232 9126 ad 74 01 LDA temp_YSf 4233 9129 c9 00 CMP #0 4234 912b d0 16 BNE .skipL0302 4235 912d .condpart149 4236 912d ad 72 01 LDA temp_XSf 4237 9130 c9 00 CMP #0 4238 9132 d0 0f BNE .skip149then 4239 9134 .condpart150 4240 9134 a9 00 LDA #FALSE 4241 9136 8d 4c 01 STA enemy_shotFlag 4242 9139 ba tsx 4243 913a bd 02 01 lda $102,x 4244 913d f0 01 beq bankswitchret17 4245 913f 60 RTS 4246 9140 bankswitchret17 4247 9140 4c 72 f4 JMP BS_return 4248 9143 .skip149then 4249 9143 .skipL0302 4250 9143 . 4251 9143 ;; 4252 9143 4253 9143 . 4254 9143 ;; 4255 9143 4256 9143 . 4257 9143 ;; 4258 9143 4259 9143 . 4260 9143 ;; 4261 9143 4262 9143 .L0303 ;; if playerX <= enemy_shotX then enemy_shotDirection = enemy_shotDirection | %00000010 else enemy_shotDirection = enemy_shotDirection & %11111101 4263 9143 4264 9143 ad 4a 01 LDA enemy_shotX 4265 9146 cd 41 01 CMP playerX 4266 9149 90 0b BCC .skipL0303 4267 914b .condpart151 4268 914b ad 6c 01 LDA enemy_shotDirection 4269 914e 09 02 ORA #%00000010 4270 9150 8d 6c 01 STA enemy_shotDirection 4271 9153 4c 5e 91 jmp .skipelse0 4272 9156 .skipL0303 4273 9156 ad 6c 01 LDA enemy_shotDirection 4274 9159 29 fd AND #%11111101 4275 915b 8d 6c 01 STA enemy_shotDirection 4276 915e .skipelse0 4277 915e .L0304 ;; if playerY <= enemy_shotY then enemy_shotDirection = enemy_shotDirection | %00000001 else enemy_shotDirection = enemy_shotDirection & %11111110 4278 915e 4279 915e ad 4b 01 LDA enemy_shotY 4280 9161 cd 42 01 CMP playerY 4281 9164 90 0b BCC .skipL0304 4282 9166 .condpart152 4283 9166 ad 6c 01 LDA enemy_shotDirection 4284 9169 09 01 ORA #%00000001 4285 916b 8d 6c 01 STA enemy_shotDirection 4286 916e 4c 79 91 jmp .skipelse1 4287 9171 .skipL0304 4288 9171 ad 6c 01 LDA enemy_shotDirection 4289 9174 29 fe AND #%11111110 4290 9176 8d 6c 01 STA enemy_shotDirection 4291 9179 .skipelse1 4292 9179 . 4293 9179 ;; 4294 9179 4295 9179 .L0305 ;; temp_XSu = 0 4296 9179 4297 9179 a9 00 LDA #0 4298 917b 8d 71 01 STA temp_XSu 4299 917e .L0306 ;; temp_YSu = 0 4300 917e 4301 917e a9 00 LDA #0 4302 9180 8d 73 01 STA temp_YSu 4303 9183 . 4304 9183 ;; 4305 9183 4306 9183 .L0307 ;; total_XSu = 0 4307 9183 4308 9183 a9 00 LDA #0 4309 9185 8d 6d 01 STA total_XSu 4310 9188 .L0308 ;; total_XSf = 0 4311 9188 4312 9188 a9 00 LDA #0 4313 918a 8d 6e 01 STA total_XSf 4314 918d .L0309 ;; total_YSu = 0 4315 918d 4316 918d a9 00 LDA #0 4317 918f 8d 6f 01 STA total_YSu 4318 9192 .L0310 ;; total_YSf = 0 4319 9192 4320 9192 a9 00 LDA #0 4321 9194 8d 70 01 STA total_YSf 4322 9197 . 4323 9197 ;; 4324 9197 4325 9197 .es_SpeedIncrease 4326 9197 ;; es_SpeedIncrease 4327 9197 4328 9197 .L0311 ;; total_speedX = total_speedX + temp_speedX 4329 9197 4330 9197 ad 6e 01 LDA total_XSf 4331 919a 18 CLC 4332 919b 6d 72 01 ADC temp_XSf 4333 919e 8d 6e 01 STA total_XSf 4334 91a1 ad 6d 01 LDA total_speedX 4335 91a4 6d 71 01 ADC temp_speedX 4336 91a7 8d 6d 01 STA total_speedX 4337 91aa .L0312 ;; total_speedY = total_speedY + temp_speedY 4338 91aa 4339 91aa ad 70 01 LDA total_YSf 4340 91ad 18 CLC 4341 91ae 6d 74 01 ADC temp_YSf 4342 91b1 8d 70 01 STA total_YSf 4343 91b4 ad 6f 01 LDA total_speedY 4344 91b7 6d 73 01 ADC temp_speedY 4345 91ba 8d 6f 01 STA total_speedY 4346 91bd .L0313 ;; if total_XSu = 0 && total_YSu = 0 then goto es_SpeedIncrease 4347 91bd 4348 91bd ad 6d 01 LDA total_XSu 4349 91c0 c9 00 CMP #0 4350 91c2 d0 0a BNE .skipL0313 4351 91c4 .condpart153 4352 91c4 ad 6f 01 LDA total_YSu 4353 91c7 c9 00 CMP #0 4354 91c9 d0 03 BNE .skip153then 4355 91cb .condpart154 4356 91cb 4c 97 91 jmp .es_SpeedIncrease 4357 91ce 4358 91ce .skip153then 4359 91ce .skipL0313 4360 91ce . 4361 91ce ;; 4362 91ce 4363 91ce . 4364 91ce ;; 4365 91ce 4366 91ce . 4367 91ce ;; 4368 91ce 4369 91ce . 4370 91ce ;; 4371 91ce 4372 91ce . 4373 91ce ;; 4374 91ce 4375 91ce . 4376 91ce ;; 4377 91ce 4378 91ce .L0314 ;; enemy_shotXf = total_XSu 4379 91ce 4380 91ce ad 6d 01 LDA total_XSu 4381 91d1 8d 00 22 STA enemy_shotXf 4382 91d4 .L0315 ;; enemy_shotSXf = total_XSf 4383 91d4 4384 91d4 ad 6e 01 LDA total_XSf 4385 91d7 8d 40 22 STA enemy_shotSXf 4386 91da .L0316 ;; enemy_shotYf = total_YSu 4387 91da 4388 91da ad 6f 01 LDA total_YSu 4389 91dd 8d 10 22 STA enemy_shotYf 4390 91e0 .L0317 ;; enemy_shotSYf = total_YSf 4391 91e0 4392 91e0 ad 70 01 LDA total_YSf 4393 91e3 8d 50 22 STA enemy_shotSYf 4394 91e6 .L0318 ;; return 4395 91e6 4396 91e6 ba tsx 4397 91e7 bd 02 01 lda $102,x 4398 91ea f0 01 beq bankswitchret18 4399 91ec 60 RTS 4400 91ed bankswitchret18 4401 91ed 4c 72 f4 JMP BS_return 4402 91f0 . 4403 91f0 ;; 4404 91f0 4405 91f0 .skip_enemy_shot 4406 91f0 ;; skip_enemy_shot 4407 91f0 4408 91f0 . 4409 91f0 ;; 4410 91f0 4411 91f0 . 4412 91f0 ;; 4413 91f0 4414 91f0 .L0319 ;; return 4415 91f0 4416 91f0 ba tsx 4417 91f1 bd 02 01 lda $102,x 4418 91f4 f0 01 beq bankswitchret19 4419 91f6 60 RTS 4420 91f7 bankswitchret19 4421 91f7 4c 72 f4 JMP BS_return 4422 91fa . 4423 91fa ;; 4424 91fa 4425 91fa .move_enemyshot 4426 91fa ;; move_enemyshot 4427 91fa 4428 91fa . 4429 91fa ;; 4430 91fa 4431 91fa . 4432 91fa ;; 4433 91fa 4434 91fa .update_enemyshot 4435 91fa ;; update_enemyshot 4436 91fa 4437 91fa . 4438 91fa ;; 4439 91fa 4440 91fa . 4441 91fa ;; 4442 91fa 4443 91fa . 4444 91fa ;; 4445 91fa 4446 91fa . 4447 91fa ;; 4448 91fa 4449 91fa . 4450 91fa ;; 4451 91fa 4452 91fa . 4453 91fa ;; 4454 91fa 4455 91fa .L0320 ;; var54 = enemy_shotY 4456 91fa 4457 91fa ad 4b 01 LDA enemy_shotY 4458 91fd 8d 76 01 STA var54 4459 9200 .L0321 ;; var91 = enemy_shotYf 4460 9200 4461 9200 ad 10 22 LDA enemy_shotYf 4462 9203 8d 9b 01 STA var91 4463 9206 .L0322 ;; var53 = enemy_shotX 4464 9206 4465 9206 ad 4a 01 LDA enemy_shotX 4466 9209 8d 75 01 STA var53 4467 920c .L0323 ;; var93 = enemy_shotXf 4468 920c 4469 920c ad 00 22 LDA enemy_shotXf 4470 920f 8d 9d 01 STA var93 4471 9212 . 4472 9212 ;; 4473 9212 4474 9212 . 4475 9212 ;; 4476 9212 4477 9212 . 4478 9212 ;; 4479 9212 4480 9212 . 4481 9212 ;; 4482 9212 4483 9212 . 4484 9212 ;; 4485 9212 4486 9212 . 4487 9212 ;; 4488 9212 4489 9212 .L0324 ;; var96 = enemy_shotSX 4490 9212 4491 9212 ad 20 22 LDA enemy_shotSX 4492 9215 8d a0 01 STA var96 4493 9218 .L0325 ;; var97 = enemy_shotSXf 4494 9218 4495 9218 ad 40 22 LDA enemy_shotSXf 4496 921b 8d a1 01 STA var97 4497 921e .L0326 ;; var98 = enemy_shotSY 4498 921e 4499 921e ad 30 22 LDA enemy_shotSY 4500 9221 8d a2 01 STA var98 4501 9224 .L0327 ;; var99 = enemy_shotSYf 4502 9224 4503 9224 ad 50 22 LDA enemy_shotSYf 4504 9227 8d a3 01 STA var99 4505 922a . 4506 922a ;; 4507 922a 4508 922a . 4509 922a ;; 4510 922a 4511 922a . 4512 922a ;; 4513 922a 4514 922a . 4515 922a ;; 4516 922a 4517 922a .L0328 ;; if ( enemy_shotDirection & 1 ) = 1 then mob_Y = mob_Y - mob_speedY else mob_Y = mob_Y + mob_speedY 4518 922a 4519 922a ; complex condition detected 4520 922a ; complex statement detected 4521 922a ad 6c 01 LDA enemy_shotDirection 4522 922d 29 01 AND #1 4523 922f c9 01 CMP #1 4524 9231 d0 16 BNE .skipL0328 4525 9233 .condpart155 4526 9233 ad 9f 01 LDA var95 4527 9236 38 SEC 4528 9237 ed a3 01 SBC var99 4529 923a 8d 9f 01 STA var95 4530 923d ad 9e 01 LDA mob_Y 4531 9240 ed a2 01 SBC mob_speedY 4532 9243 8d 9e 01 STA mob_Y 4533 9246 4c 5c 92 jmp .skipelse2 4534 9249 .skipL0328 4535 9249 ad 9f 01 LDA var95 4536 924c 18 CLC 4537 924d 6d a3 01 ADC var99 4538 9250 8d 9f 01 STA var95 4539 9253 ad 9e 01 LDA mob_Y 4540 9256 6d a2 01 ADC mob_speedY 4541 9259 8d 9e 01 STA mob_Y 4542 925c .skipelse2 4543 925c .L0329 ;; if ( enemy_shotDirection & 2 ) = 2 then mob_X = mob_X - mob_speedX else mob_X = mob_X + mob_speedX 4544 925c 4545 925c ; complex condition detected 4546 925c ; complex statement detected 4547 925c ad 6c 01 LDA enemy_shotDirection 4548 925f 29 02 AND #2 4549 9261 c9 02 CMP #2 4550 9263 d0 16 BNE .skipL0329 4551 9265 .condpart156 4552 9265 ad 9d 01 LDA var93 4553 9268 38 SEC 4554 9269 ed a1 01 SBC var97 4555 926c 8d 9d 01 STA var93 4556 926f ad 9c 01 LDA mob_X 4557 9272 ed a0 01 SBC mob_speedX 4558 9275 8d 9c 01 STA mob_X 4559 9278 4c 8e 92 jmp .skipelse3 4560 927b .skipL0329 4561 927b ad 9d 01 LDA var93 4562 927e 18 CLC 4563 927f 6d a1 01 ADC var97 4564 9282 8d 9d 01 STA var93 4565 9285 ad 9c 01 LDA mob_X 4566 9288 6d a0 01 ADC mob_speedX 4567 928b 8d 9c 01 STA mob_X 4568 928e .skipelse3 4569 928e . 4570 928e ;; 4571 928e 4572 928e . 4573 928e ;; 4574 928e 4575 928e . 4576 928e ;; 4577 928e 4578 928e . 4579 928e ;; 4580 928e 4581 928e . 4582 928e ;; 4583 928e 4584 928e . 4585 928e ;; 4586 928e 4587 928e .L0330 ;; enemy_shotY = var54 4588 928e 4589 928e ad 76 01 LDA var54 4590 9291 8d 4b 01 STA enemy_shotY 4591 9294 .L0331 ;; enemy_shotYf = var91 4592 9294 4593 9294 ad 9b 01 LDA var91 4594 9297 8d 10 22 STA enemy_shotYf 4595 929a .L0332 ;; enemy_shotX = var53 4596 929a 4597 929a ad 75 01 LDA var53 4598 929d 8d 4a 01 STA enemy_shotX 4599 92a0 .L0333 ;; enemy_shotXf = var93 4600 92a0 4601 92a0 ad 9d 01 LDA var93 4602 92a3 8d 00 22 STA enemy_shotXf 4603 92a6 . 4604 92a6 ;; 4605 92a6 4606 92a6 . 4607 92a6 ;; 4608 92a6 4609 92a6 . 4610 92a6 ;; 4611 92a6 4612 92a6 .L0334 ;; return 4613 92a6 4614 92a6 ba tsx 4615 92a7 bd 02 01 lda $102,x 4616 92aa f0 01 beq bankswitchret20 4617 92ac 60 RTS 4618 92ad bankswitchret20 4619 92ad 4c 72 f4 JMP BS_return 4620 92b0 . 4621 92b0 ;; 4622 92b0 4623 92b0 . 4624 92b0 ;; 4625 92b0 4626 92b0 . 4627 92b0 ;; 4628 92b0 4629 92b0 . 4630 92b0 ;; 4631 92b0 4632 92b0 .L0335 ;; data sfx_bling 4633 92b0 4634 92b0 4c e9 92 JMP .skipL0335 4635 92b3 sfx_bling 4636 92b3 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4637 92b6 4638 92b6 1c 04 07 .byte.b $1c,$04,$07 4639 92b9 4640 92b9 1b 04 07 .byte.b $1b,$04,$07 4641 92bc 4642 92bc 04 0f 05 .byte.b $04,$0f,$05 4643 92bf 4644 92bf 15 04 09 .byte.b $15,$04,$09 4645 92c2 4646 92c2 16 04 07 .byte.b $16,$04,$07 4647 92c5 4648 92c5 03 0f 04 .byte.b $03,$0f,$04 4649 92c8 4650 92c8 11 04 08 .byte.b $11,$04,$08 4651 92cb 4652 92cb 11 04 08 .byte.b $11,$04,$08 4653 92ce 4654 92ce 11 04 04 .byte.b $11,$04,$04 4655 92d1 4656 92d1 0e 04 09 .byte.b $0e,$04,$09 4657 92d4 4658 92d4 0e 04 07 .byte.b $0e,$04,$07 4659 92d7 4660 92d7 0e 04 04 .byte.b $0e,$04,$04 4661 92da 4662 92da 1c 04 07 .byte.b $1c,$04,$07 4663 92dd 4664 92dd 1b 04 05 .byte.b $1b,$04,$05 4665 92e0 4666 92e0 1c 04 04 .byte.b $1c,$04,$04 4667 92e3 4668 92e3 1b 04 02 .byte.b $1b,$04,$02 4669 92e6 4670 92e6 00 00 00 .byte.b $00,$00,$00 4671 92e9 4672 92e9 .skipL0335 4673 92e9 sfx_bling_lo SET #sfx_bling 4675 92e9 . 4676 92e9 ;; 4677 92e9 4678 92e9 .L0336 ;; data sfx_pulsecannon 4679 92e9 4680 92e9 4c 40 93 JMP .skipL0336 4681 92ec sfx_pulsecannon 4682 92ec 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4683 92ef 4684 92ef 1e 0c 0a .byte.b $1e,$0c,$0a ; first chunk of freq,channel,volume 4685 92f2 4686 92f2 07 06 0f .byte.b $07,$06,$0f 4687 92f5 4688 92f5 07 06 0f .byte.b $07,$06,$0f 4689 92f8 4690 92f8 1e 06 0f .byte.b $1e,$06,$0f 4691 92fb 4692 92fb 17 0c 0b .byte.b $17,$0c,$0b 4693 92fe 4694 92fe 1b 0c 0b .byte.b $1b,$0c,$0b 4695 9301 4696 9301 1e 0c 0f .byte.b $1e,$0c,$0f 4697 9304 4698 9304 07 06 0f .byte.b $07,$06,$0f 4699 9307 4700 9307 07 06 0f .byte.b $07,$06,$0f 4701 930a 4702 930a 1e 06 08 .byte.b $1e,$06,$08 4703 930d 4704 930d 17 0c 06 .byte.b $17,$0c,$06 4705 9310 4706 9310 1b 0c 0f .byte.b $1b,$0c,$0f 4707 9313 4708 9313 1e 0c 0f .byte.b $1e,$0c,$0f 4709 9316 4710 9316 07 06 0f .byte.b $07,$06,$0f 4711 9319 4712 9319 07 06 0f .byte.b $07,$06,$0f 4713 931c 4714 931c 0a 06 0a .byte.b $0a,$06,$0a 4715 931f 4716 931f 17 0c 0a .byte.b $17,$0c,$0a 4717 9322 4718 9322 1e 0c 04 .byte.b $1e,$0c,$04 4719 9325 4720 9325 1e 06 09 .byte.b $1e,$06,$09 4721 9328 4722 9328 1b 04 05 .byte.b $1b,$04,$05 4723 932b 4724 932b 07 06 0f .byte.b $07,$06,$0f 4725 932e 4726 932e 0a 06 09 .byte.b $0a,$06,$09 4727 9331 4728 9331 17 0c 0d .byte.b $17,$0c,$0d 4729 9334 4730 9334 1b 0c 09 .byte.b $1b,$0c,$09 4731 9337 4732 9337 0a 06 05 .byte.b $0a,$06,$05 4733 933a 4734 933a 17 0c 03 .byte.b $17,$0c,$03 4735 933d 4736 933d 00 00 00 .byte.b $00,$00,$00 4737 9340 4738 9340 .skipL0336 4739 9340 sfx_pulsecannon_lo SET #sfx_pulsecannon 4741 9340 . 4742 9340 ;; 4743 9340 4744 9340 .L0337 ;; data sfx_plainlaser 4745 9340 4746 9340 4c 73 93 JMP .skipL0337 4747 9343 sfx_plainlaser 4748 9343 10 10 00 .byte.b $10,$10,$00 ; version, priority, frames per chunk 4749 9346 4750 9346 10 04 06 .byte.b $10,$04,$06 ; first chunk of freq,channel,volume 4751 9349 4752 9349 13 04 08 .byte.b $13,$04,$08 4753 934c 4754 934c 16 04 08 .byte.b $16,$04,$08 4755 934f 4756 934f 16 04 07 .byte.b $16,$04,$07 4757 9352 4758 9352 1c 04 09 .byte.b $1c,$04,$09 4759 9355 4760 9355 0b 0c 0f .byte.b $0b,$0c,$0f 4761 9358 4762 9358 0d 0c 0f .byte.b $0d,$0c,$0f 4763 935b 4764 935b 0e 0c 0f .byte.b $0e,$0c,$0f 4765 935e 4766 935e 0e 0c 0f .byte.b $0e,$0c,$0f 4767 9361 4768 9361 12 0c 0f .byte.b $12,$0c,$0f 4769 9364 4770 9364 03 06 0d .byte.b $03,$06,$0d 4771 9367 4772 9367 1e 0c 0a .byte.b $1e,$0c,$0a 4773 936a 4774 936a 1e 0c 0c .byte.b $1e,$0c,$0c 4775 936d 4776 936d 0a 06 04 .byte.b $0a,$06,$04 4777 9370 4778 9370 00 00 00 .byte.b $00,$00,$00 4779 9373 4780 9373 .skipL0337 4781 9373 sfx_plainlaser_lo SET #sfx_plainlaser 4783 9373 . 4784 9373 ;; 4785 9373 4786 9373 .L0338 ;; data sfx_explosion 4787 9373 4788 9373 4c 06 94 JMP .skipL0338 4789 9376 sfx_explosion 4790 9376 10 10 00 .byte.b $10,$10,$00 4791 9379 4792 9379 01 08 02 .byte.b $01,$08,$02 4793 937c 4794 937c 0b 0c 05 .byte.b $0b,$0c,$05 4795 937f 4796 937f 04 06 08 .byte.b $04,$06,$08 4797 9382 4798 9382 03 0e 0f .byte.b $03,$0e,$0f 4799 9385 4800 9385 09 06 0f .byte.b $09,$06,$0f 4801 9388 4802 9388 0d 06 0f .byte.b $0d,$06,$0f 4803 938b 4804 938b 04 0e 0f .byte.b $04,$0e,$0f 4805 938e 4806 938e 0f 06 08 .byte.b $0f,$06,$08 4807 9391 4808 9391 09 06 04 .byte.b $09,$06,$04 4809 9394 4810 9394 16 01 03 .byte.b $16,$01,$03 4811 9397 4812 9397 0c 06 04 .byte.b $0c,$06,$04 4813 939a 4814 939a 09 06 05 .byte.b $09,$06,$05 4815 939d 4816 939d 0a 06 03 .byte.b $0a,$06,$03 4817 93a0 4818 93a0 09 06 05 .byte.b $09,$06,$05 4819 93a3 4820 93a3 0d 06 08 .byte.b $0d,$06,$08 4821 93a6 4822 93a6 09 06 04 .byte.b $09,$06,$04 4823 93a9 4824 93a9 04 0e 06 .byte.b $04,$0e,$06 4825 93ac 4826 93ac 0f 06 05 .byte.b $0f,$06,$05 4827 93af 4828 93af 0f 06 07 .byte.b $0f,$06,$07 4829 93b2 4830 93b2 04 0e 07 .byte.b $04,$0e,$07 4831 93b5 4832 93b5 08 06 06 .byte.b $08,$06,$06 4833 93b8 4834 93b8 03 0e 08 .byte.b $03,$0e,$08 4835 93bb 4836 93bb 0f 06 06 .byte.b $0f,$06,$06 4837 93be 4838 93be 09 06 05 .byte.b $09,$06,$05 4839 93c1 4840 93c1 06 06 05 .byte.b $06,$06,$05 4841 93c4 4842 93c4 03 0e 05 .byte.b $03,$0e,$05 4843 93c7 4844 93c7 0e 06 06 .byte.b $0e,$06,$06 4845 93ca 4846 93ca 02 0e 05 .byte.b $02,$0e,$05 4847 93cd 4848 93cd 0f 06 03 .byte.b $0f,$06,$03 4849 93d0 4850 93d0 0e 06 06 .byte.b $0e,$06,$06 4851 93d3 4852 93d3 09 06 05 .byte.b $09,$06,$05 4853 93d6 4854 93d6 0c 06 05 .byte.b $0c,$06,$05 4855 93d9 4856 93d9 0f 06 03 .byte.b $0f,$06,$03 4857 93dc 4858 93dc 04 0e 08 .byte.b $04,$0e,$08 4859 93df 4860 93df 0c 06 03 .byte.b $0c,$06,$03 4861 93e2 4862 93e2 0f 06 03 .byte.b $0f,$06,$03 4863 93e5 4864 93e5 0c 06 06 .byte.b $0c,$06,$06 4865 93e8 4866 93e8 0f 06 04 .byte.b $0f,$06,$04 4867 93eb 4868 93eb 0f 06 05 .byte.b $0f,$06,$05 4869 93ee 4870 93ee 0f 06 03 .byte.b $0f,$06,$03 4871 93f1 4872 93f1 0a 06 04 .byte.b $0a,$06,$04 4873 93f4 4874 93f4 0f 06 03 .byte.b $0f,$06,$03 4875 93f7 4876 93f7 08 06 03 .byte.b $08,$06,$03 4877 93fa 4878 93fa 0c 06 03 .byte.b $0c,$06,$03 4879 93fd 4880 93fd 0e 06 03 .byte.b $0e,$06,$03 4881 9400 4882 9400 08 06 03 .byte.b $08,$06,$03 4883 9403 4884 9403 00 00 00 .byte.b $00,$00,$00 4885 9406 4886 9406 .skipL0338 4887 9406 sfx_explosion_lo SET #sfx_explosion 4889 9406 DMAHOLEEND0 SET . 4890 9406 gameend 4891 9406 DMAHOLEEND0 SET . 7162 bytes of ROM space left in the main area of bank 1. 4892 9406 echo " ",[($B000 - .)]d , "bytes of ROM space left in the main area of bank 1." 4893 9406 - if ($B000 - .) < 0 4894 9406 -SPACEOVERFLOW SET (SPACEOVERFLOW+1) 4895 9406 endif 4896 9406 4897 b000 ORG $B000,0 ; ************* 4898 b000 4899 b000 RORG $B000 ; ************* 4900 b000 4901 b000 vertical_shooting_font 4902 b000 00 00 00 00* HEX 0000000000000000000000000000000000000000000000000000000000000000 4903 b020 00 00 00 00* HEX 00000000000000000000000000 4904 b02d vertical_shooting_ship 4905 b02d 07 d0 HEX 07d0 4906 b02f vertical_shooting_ship_tallsprite_00 4907 b02f 80 02 HEX 8002 4908 b031 vertical_shooting_bullet 4909 b031 28 HEX 28 4910 b032 vertical_shooting_enemyshot 4911 b032 00 HEX 00 4912 b033 vertical_shooting_powerup 4913 b033 28 00 HEX 2800 4914 b035 vertical_shooting_enemy01 4915 b035 09 e0 HEX 09e0 4916 b037 vertical_shooting_enemy01_tallsprite_00 4917 b037 40 03 HEX 4003 4918 b039 vertical_shooting_1up 4919 b039 15 55 HEX 1555 4920 b03b vertical_shooting_explosion_01 4921 b03b 02 80 HEX 0280 4922 b03d vertical_shooting_explosion_01_tallsprite_00 4923 b03d 00 00 HEX 0000 4924 b03f vertical_shooting_explosion_02 4925 b03f 05 50 HEX 0550 4926 b041 vertical_shooting_explosion_02_tallsprite_00 4927 b041 00 00 HEX 0000 4928 b043 vertical_shooting_explosion_03 4929 b043 15 54 HEX 1554 4930 b045 vertical_shooting_explosion_03_tallsprite_00 4931 b045 00 00 HEX 0000 4932 b047 vertical_shooting_explosion_04 4933 b047 07 d0 HEX 07d0 4934 b049 vertical_shooting_explosion_04_tallsprite_00 4935 b049 00 00 HEX 0000 4936 b04b vertical_shooting_explosion_05 4937 b04b 0c 30 HEX 0c30 4938 b04d vertical_shooting_explosion_05_tallsprite_00 4939 b04d 01 40 HEX 0140 4940 b04f vertical_shooting_explosion_06 4941 b04f 00 00 HEX 0000 4942 b051 vertical_shooting_explosion_06_tallsprite_00 4943 b051 01 40 HEX 0140 4944 b053 vertical_shooting_explosion_07 4945 b053 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4946 b067 vertical_shooting_explosion_07_tallsprite_00 4947 b067 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4948 b07b vertical_shooting_explosion_08 4949 b07b 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4950 b08f vertical_shooting_explosion_08_tallsprite_00 4951 b08f 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4952 b0a3 vertical_shooting_explosion_09 4953 b0a3 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4954 b0b7 vertical_shooting_explosion_09_tallsprite_00 4955 b0b7 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4956 b0cb vertical_shooting_explosion_10 4957 b0cb 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 4958 b0df vertical_shooting_explosion_10_tallsprite_00 4959 b0df 00 00 00 00* HEX 00000000000000000140014001400140014003c0 4960 b0f3 vertical_shooting_laser 4961 b0f3 88 HEX 88 4962 b0f4 vertical_shooting_laser_tallsprite_00 4963 b0f4 cc HEX cc 4964 b0f5 4965 b100 ORG $B100,0 ; ************* 4966 b100 4967 b100 RORG $B100 ; ************* 4968 b100 4969 b100 ;vertical_shooting_font 4970 b100 00 54 54 54* HEX 0054545454045454045404445054505440544454104454444410401444501014 4971 b120 10 44 44 10* HEX 10444410544040101040400000 4972 b12d ;vertical_shooting_ship 4973 b12d 07 d0 HEX 07d0 4974 b12f ;vertical_shooting_ship_tallsprite_00 4975 b12f 80 02 HEX 8002 4976 b131 ;vertical_shooting_bullet 4977 b131 28 HEX 28 4978 b132 ;vertical_shooting_enemyshot 4979 b132 88 HEX 88 4980 b133 ;vertical_shooting_powerup 4981 b133 78 08 HEX 7808 4982 b135 ;vertical_shooting_enemy01 4983 b135 09 e0 HEX 09e0 4984 b137 ;vertical_shooting_enemy01_tallsprite_00 4985 b137 50 0f HEX 500f 4986 b139 ;vertical_shooting_1up 4987 b139 ea a9 HEX eaa9 4988 b13b ;vertical_shooting_explosion_01 4989 b13b 01 40 HEX 0140 4990 b13d ;vertical_shooting_explosion_01_tallsprite_00 4991 b13d 00 00 HEX 0000 4992 b13f ;vertical_shooting_explosion_02 4993 b13f 09 60 HEX 0960 4994 b141 ;vertical_shooting_explosion_02_tallsprite_00 4995 b141 00 00 HEX 0000 4996 b143 ;vertical_shooting_explosion_03 4997 b143 25 58 HEX 2558 4998 b145 ;vertical_shooting_explosion_03_tallsprite_00 4999 b145 00 00 HEX 0000 5000 b147 ;vertical_shooting_explosion_04 5001 b147 05 50 HEX 0550 5002 b149 ;vertical_shooting_explosion_04_tallsprite_00 5003 b149 02 80 HEX 0280 5004 b14b ;vertical_shooting_explosion_05 5005 b14b 0b e0 HEX 0be0 5006 b14d ;vertical_shooting_explosion_05_tallsprite_00 5007 b14d 01 40 HEX 0140 5008 b14f ;vertical_shooting_explosion_06 5009 b14f 0c 30 HEX 0c30 5010 b151 ;vertical_shooting_explosion_06_tallsprite_00 5011 b151 01 40 HEX 0140 5012 b153 ;vertical_shooting_explosion_07 5013 b153 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5014 b167 ;vertical_shooting_explosion_07_tallsprite_00 5015 b167 00 00 00 00* HEX 0000000000000140014001400140014001400000 5016 b17b ;vertical_shooting_explosion_08 5017 b17b 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5018 b18f ;vertical_shooting_explosion_08_tallsprite_00 5019 b18f 00 00 00 00* HEX 0000000000000140014001400140014001400000 5020 b1a3 ;vertical_shooting_explosion_09 5021 b1a3 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5022 b1b7 ;vertical_shooting_explosion_09_tallsprite_00 5023 b1b7 00 00 00 00* HEX 0000000000000140014001400140014001400000 5024 b1cb ;vertical_shooting_explosion_10 5025 b1cb 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5026 b1df ;vertical_shooting_explosion_10_tallsprite_00 5027 b1df 00 00 00 00* HEX 0000000000000140014001400140014001400000 5028 b1f3 ;vertical_shooting_laser 5029 b1f3 88 HEX 88 5030 b1f4 ;vertical_shooting_laser_tallsprite_00 5031 b1f4 cc HEX cc 5032 b1f5 5033 b200 ORG $B200,0 ; ************* 5034 b200 5035 b200 RORG $B200 ; ************* 5036 b200 5037 b200 ;vertical_shooting_font 5038 b200 00 44 10 40* HEX 0044104004040444044404444440444040444410444440444444404444041044 5039 b220 10 54 44 10* HEX 10544410400010000000100000 5040 b22d ;vertical_shooting_ship 5041 b22d 03 c0 HEX 03c0 5042 b22f ;vertical_shooting_ship_tallsprite_00 5043 b22f a1 4a HEX a14a 5044 b231 ;vertical_shooting_bullet 5045 b231 3c HEX 3c 5046 b232 ;vertical_shooting_enemyshot 5047 b232 10 HEX 10 5048 b233 ;vertical_shooting_powerup 5049 b233 78 1e HEX 781e 5050 b235 ;vertical_shooting_enemy01 5051 b235 19 ec HEX 19ec 5052 b237 ;vertical_shooting_enemy01_tallsprite_00 5053 b237 5a af HEX 5aaf 5054 b239 ;vertical_shooting_1up 5055 b239 d5 58 HEX d558 5056 b23b ;vertical_shooting_explosion_01 5057 b23b 00 00 HEX 0000 5058 b23d ;vertical_shooting_explosion_01_tallsprite_00 5059 b23d 00 00 HEX 0000 5060 b23f ;vertical_shooting_explosion_02 5061 b23f 02 80 HEX 0280 5062 b241 ;vertical_shooting_explosion_02_tallsprite_00 5063 b241 00 00 HEX 0000 5064 b243 ;vertical_shooting_explosion_03 5065 b243 09 60 HEX 0960 5066 b245 ;vertical_shooting_explosion_03_tallsprite_00 5067 b245 00 00 HEX 0000 5068 b247 ;vertical_shooting_explosion_04 5069 b247 05 50 HEX 0550 5070 b249 ;vertical_shooting_explosion_04_tallsprite_00 5071 b249 02 80 HEX 0280 5072 b24b ;vertical_shooting_explosion_05 5073 b24b 0a a0 HEX 0aa0 5074 b24d ;vertical_shooting_explosion_05_tallsprite_00 5075 b24d 05 50 HEX 0550 5076 b24f ;vertical_shooting_explosion_06 5077 b24f 0b e0 HEX 0be0 5078 b251 ;vertical_shooting_explosion_06_tallsprite_00 5079 b251 05 50 HEX 0550 5080 b253 ;vertical_shooting_explosion_07 5081 b253 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5082 b267 ;vertical_shooting_explosion_07_tallsprite_00 5083 b267 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5084 b27b ;vertical_shooting_explosion_08 5085 b27b 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5086 b28f ;vertical_shooting_explosion_08_tallsprite_00 5087 b28f 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5088 b2a3 ;vertical_shooting_explosion_09 5089 b2a3 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5090 b2b7 ;vertical_shooting_explosion_09_tallsprite_00 5091 b2b7 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5092 b2cb ;vertical_shooting_explosion_10 5093 b2cb 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5094 b2df ;vertical_shooting_explosion_10_tallsprite_00 5095 b2df 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5096 b2f3 ;vertical_shooting_laser 5097 b2f3 44 HEX 44 5098 b2f4 ;vertical_shooting_laser_tallsprite_00 5099 b2f4 cc HEX cc 5100 b2f5 5101 b300 ORG $B300,0 ; ************* 5102 b300 5103 b300 RORG $B300 ; ************* 5104 b300 5105 b300 ;vertical_shooting_font 5106 b300 00 44 10 40* HEX 0044104004040444044404444440444040444410044440444444404444041044 5107 b320 54 54 44 10* HEX 54544410100000101000000000 5108 b32d ;vertical_shooting_ship 5109 b32d 01 40 HEX 0140 5110 b32f ;vertical_shooting_ship_tallsprite_00 5111 b32f a5 5a HEX a55a 5112 b331 ;vertical_shooting_bullet 5113 b331 3c HEX 3c 5114 b332 ;vertical_shooting_enemyshot 5115 b332 74 HEX 74 5116 b333 ;vertical_shooting_powerup 5117 b333 7a a4 HEX 7aa4 5118 b335 ;vertical_shooting_enemy01 5119 b335 59 ef HEX 59ef 5120 b337 ;vertical_shooting_enemy01_tallsprite_00 5121 b337 59 ef HEX 59ef 5122 b339 ;vertical_shooting_1up 5123 b339 35 60 HEX 3560 5124 b33b ;vertical_shooting_explosion_01 5125 b33b 00 00 HEX 0000 5126 b33d ;vertical_shooting_explosion_01_tallsprite_00 5127 b33d 00 00 HEX 0000 5128 b33f ;vertical_shooting_explosion_02 5129 b33f 00 00 HEX 0000 5130 b341 ;vertical_shooting_explosion_02_tallsprite_00 5131 b341 00 00 HEX 0000 5132 b343 ;vertical_shooting_explosion_03 5133 b343 02 80 HEX 0280 5134 b345 ;vertical_shooting_explosion_03_tallsprite_00 5135 b345 00 00 HEX 0000 5136 b347 ;vertical_shooting_explosion_04 5137 b347 09 60 HEX 0960 5138 b349 ;vertical_shooting_explosion_04_tallsprite_00 5139 b349 09 60 HEX 0960 5140 b34b ;vertical_shooting_explosion_05 5141 b34b 06 90 HEX 0690 5142 b34d ;vertical_shooting_explosion_05_tallsprite_00 5143 b34d 06 90 HEX 0690 5144 b34f ;vertical_shooting_explosion_06 5145 b34f 06 90 HEX 0690 5146 b351 ;vertical_shooting_explosion_06_tallsprite_00 5147 b351 06 90 HEX 0690 5148 b353 ;vertical_shooting_explosion_07 5149 b353 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5150 b367 ;vertical_shooting_explosion_07_tallsprite_00 5151 b367 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5152 b37b ;vertical_shooting_explosion_08 5153 b37b 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5154 b38f ;vertical_shooting_explosion_08_tallsprite_00 5155 b38f 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5156 b3a3 ;vertical_shooting_explosion_09 5157 b3a3 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5158 b3b7 ;vertical_shooting_explosion_09_tallsprite_00 5159 b3b7 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5160 b3cb ;vertical_shooting_explosion_10 5161 b3cb 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5162 b3df ;vertical_shooting_explosion_10_tallsprite_00 5163 b3df 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5164 b3f3 ;vertical_shooting_laser 5165 b3f3 44 HEX 44 5166 b3f4 ;vertical_shooting_laser_tallsprite_00 5167 b3f4 cc HEX cc 5168 b3f5 5169 b400 ORG $B400,0 ; ************* 5170 b400 5171 b400 RORG $B400 ; ************* 5172 b400 5173 b400 ;vertical_shooting_font 5174 b400 00 44 10 54* HEX 0044105454545454045454545040445454445410045040544444504450101044 5175 b420 44 44 10 10* HEX 44441010100000101000000000 5176 b42d ;vertical_shooting_ship 5177 b42d 01 40 HEX 0140 5178 b42f ;vertical_shooting_ship_tallsprite_00 5179 b42f a5 5a HEX a55a 5180 b431 ;vertical_shooting_bullet 5181 b431 14 HEX 14 5182 b432 ;vertical_shooting_enemyshot 5183 b432 74 HEX 74 5184 b433 ;vertical_shooting_powerup 5185 b433 75 7a HEX 757a 5186 b435 ;vertical_shooting_enemy01 5187 b435 59 6f HEX 596f 5188 b437 ;vertical_shooting_enemy01_tallsprite_00 5189 b437 59 ef HEX 59ef 5190 b439 ;vertical_shooting_1up 5191 b439 35 60 HEX 3560 5192 b43b ;vertical_shooting_explosion_01 5193 b43b 00 00 HEX 0000 5194 b43d ;vertical_shooting_explosion_01_tallsprite_00 5195 b43d 00 00 HEX 0000 5196 b43f ;vertical_shooting_explosion_02 5197 b43f 00 00 HEX 0000 5198 b441 ;vertical_shooting_explosion_02_tallsprite_00 5199 b441 00 00 HEX 0000 5200 b443 ;vertical_shooting_explosion_03 5201 b443 00 00 HEX 0000 5202 b445 ;vertical_shooting_explosion_03_tallsprite_00 5203 b445 02 80 HEX 0280 5204 b447 ;vertical_shooting_explosion_04 5205 b447 09 60 HEX 0960 5206 b449 ;vertical_shooting_explosion_04_tallsprite_00 5207 b449 09 60 HEX 0960 5208 b44b ;vertical_shooting_explosion_05 5209 b44b 06 90 HEX 0690 5210 b44d ;vertical_shooting_explosion_05_tallsprite_00 5211 b44d 06 90 HEX 0690 5212 b44f ;vertical_shooting_explosion_06 5213 b44f 06 90 HEX 0690 5214 b451 ;vertical_shooting_explosion_06_tallsprite_00 5215 b451 06 90 HEX 0690 5216 b453 ;vertical_shooting_explosion_07 5217 b453 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5218 b467 ;vertical_shooting_explosion_07_tallsprite_00 5219 b467 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5220 b47b ;vertical_shooting_explosion_08 5221 b47b 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5222 b48f ;vertical_shooting_explosion_08_tallsprite_00 5223 b48f 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5224 b4a3 ;vertical_shooting_explosion_09 5225 b4a3 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5226 b4b7 ;vertical_shooting_explosion_09_tallsprite_00 5227 b4b7 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5228 b4cb ;vertical_shooting_explosion_10 5229 b4cb 00 00 00 00* HEX 000000000000069006900690069007d00c300000 5230 b4df ;vertical_shooting_explosion_10_tallsprite_00 5231 b4df 00 00 00 00* HEX 00000000014006900690069007d00c3000000000 5232 b4f3 ;vertical_shooting_laser 5233 b4f3 44 HEX 44 5234 b4f4 ;vertical_shooting_laser_tallsprite_00 5235 b4f4 cc HEX cc 5236 b4f5 5237 b500 ORG $B500,0 ; ************* 5238 b500 5239 b500 RORG $B500 ; ************* 5240 b500 5241 b500 ;vertical_shooting_font 5242 b500 00 44 10 04* HEX 0044100404444040044444444440444040404410044440544444444444401044 5243 b520 44 44 44 54* HEX 44444454100000041000000000 5244 b52d ;vertical_shooting_ship 5245 b52d 01 40 HEX 0140 5246 b52f ;vertical_shooting_ship_tallsprite_00 5247 b52f a5 5a HEX a55a 5248 b531 ;vertical_shooting_bullet 5249 b531 14 HEX 14 5250 b532 ;vertical_shooting_enemyshot 5251 b532 74 HEX 74 5252 b533 ;vertical_shooting_powerup 5253 b533 78 1e HEX 781e 5254 b535 ;vertical_shooting_enemy01 5255 b535 5a af HEX 5aaf 5256 b537 ;vertical_shooting_enemy01_tallsprite_00 5257 b537 19 ec HEX 19ec 5258 b539 ;vertical_shooting_1up 5259 b539 0d 80 HEX 0d80 5260 b53b ;vertical_shooting_explosion_01 5261 b53b 00 00 HEX 0000 5262 b53d ;vertical_shooting_explosion_01_tallsprite_00 5263 b53d 00 00 HEX 0000 5264 b53f ;vertical_shooting_explosion_02 5265 b53f 00 00 HEX 0000 5266 b541 ;vertical_shooting_explosion_02_tallsprite_00 5267 b541 02 80 HEX 0280 5268 b543 ;vertical_shooting_explosion_03 5269 b543 00 00 HEX 0000 5270 b545 ;vertical_shooting_explosion_03_tallsprite_00 5271 b545 09 60 HEX 0960 5272 b547 ;vertical_shooting_explosion_04 5273 b547 02 80 HEX 0280 5274 b549 ;vertical_shooting_explosion_04_tallsprite_00 5275 b549 05 50 HEX 0550 5276 b54b ;vertical_shooting_explosion_05 5277 b54b 05 50 HEX 0550 5278 b54d ;vertical_shooting_explosion_05_tallsprite_00 5279 b54d 0a a0 HEX 0aa0 5280 b54f ;vertical_shooting_explosion_06 5281 b54f 05 50 HEX 0550 5282 b551 ;vertical_shooting_explosion_06_tallsprite_00 5283 b551 0b e0 HEX 0be0 5284 b553 ;vertical_shooting_explosion_07 5285 b553 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5286 b567 ;vertical_shooting_explosion_07_tallsprite_00 5287 b567 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5288 b57b ;vertical_shooting_explosion_08 5289 b57b 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5290 b58f ;vertical_shooting_explosion_08_tallsprite_00 5291 b58f 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5292 b5a3 ;vertical_shooting_explosion_09 5293 b5a3 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5294 b5b7 ;vertical_shooting_explosion_09_tallsprite_00 5295 b5b7 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5296 b5cb ;vertical_shooting_explosion_10 5297 b5cb 00 00 00 00* HEX 0000000000000140055005500550055007d00c30 5298 b5df ;vertical_shooting_explosion_10_tallsprite_00 5299 b5df 00 00 01 40* HEX 0000014006900aa00aa00be00c30000000000000 5300 b5f3 ;vertical_shooting_laser 5301 b5f3 44 HEX 44 5302 b5f4 ;vertical_shooting_laser_tallsprite_00 5303 b5f4 88 HEX 88 5304 b5f5 5305 b600 ORG $B600,0 ; ************* 5306 b600 5307 b600 RORG $B600 ; ************* 5308 b600 5309 b600 ;vertical_shooting_font 5310 b600 00 44 50 04* HEX 0044500404444040044444444440444040404410044440544444444444401044 5311 b620 44 44 44 44* HEX 44444444040000441000001044 5312 b62d ;vertical_shooting_ship 5313 b62d 01 40 HEX 0140 5314 b62f ;vertical_shooting_ship_tallsprite_00 5315 b62f a7 da HEX a7da 5316 b631 ;vertical_shooting_bullet 5317 b631 14 HEX 14 5318 b632 ;vertical_shooting_enemyshot 5319 b632 10 HEX 10 5320 b633 ;vertical_shooting_powerup 5321 b633 7a bc HEX 7abc 5322 b635 ;vertical_shooting_enemy01 5323 b635 50 07 HEX 5007 5324 b637 ;vertical_shooting_enemy01_tallsprite_00 5325 b637 09 e0 HEX 09e0 5326 b639 ;vertical_shooting_1up 5327 b639 0d 80 HEX 0d80 5328 b63b ;vertical_shooting_explosion_01 5329 b63b 00 00 HEX 0000 5330 b63d ;vertical_shooting_explosion_01_tallsprite_00 5331 b63d 01 40 HEX 0140 5332 b63f ;vertical_shooting_explosion_02 5333 b63f 00 00 HEX 0000 5334 b641 ;vertical_shooting_explosion_02_tallsprite_00 5335 b641 09 60 HEX 0960 5336 b643 ;vertical_shooting_explosion_03 5337 b643 00 00 HEX 0000 5338 b645 ;vertical_shooting_explosion_03_tallsprite_00 5339 b645 25 58 HEX 2558 5340 b647 ;vertical_shooting_explosion_04 5341 b647 02 80 HEX 0280 5342 b649 ;vertical_shooting_explosion_04_tallsprite_00 5343 b649 05 50 HEX 0550 5344 b64b ;vertical_shooting_explosion_05 5345 b64b 01 40 HEX 0140 5346 b64d ;vertical_shooting_explosion_05_tallsprite_00 5347 b64d 0b e0 HEX 0be0 5348 b64f ;vertical_shooting_explosion_06 5349 b64f 01 40 HEX 0140 5350 b651 ;vertical_shooting_explosion_06_tallsprite_00 5351 b651 0c 30 HEX 0c30 5352 b653 ;vertical_shooting_explosion_07 5353 b653 00 00 00 00* HEX 0000000000000140014001400140014001400000 5354 b667 ;vertical_shooting_explosion_07_tallsprite_00 5355 b667 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5356 b67b ;vertical_shooting_explosion_08 5357 b67b 00 00 00 00* HEX 0000000000000140014001400140014001400000 5358 b68f ;vertical_shooting_explosion_08_tallsprite_00 5359 b68f 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5360 b6a3 ;vertical_shooting_explosion_09 5361 b6a3 00 00 00 00* HEX 0000000000000140014001400140014001400000 5362 b6b7 ;vertical_shooting_explosion_09_tallsprite_00 5363 b6b7 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5364 b6cb ;vertical_shooting_explosion_10 5365 b6cb 00 00 00 00* HEX 0000000000000140014001400140014001400000 5366 b6df ;vertical_shooting_explosion_10_tallsprite_00 5367 b6df 01 40 06 90* HEX 014006901aa40aa00be00c300000000000000000 5368 b6f3 ;vertical_shooting_laser 5369 b6f3 44 HEX 44 5370 b6f4 ;vertical_shooting_laser_tallsprite_00 5371 b6f4 88 HEX 88 5372 b6f5 5373 b700 ORG $B700,0 ; ************* 5374 b700 5375 b700 RORG $B700 ; ************* 5376 b700 5377 b700 ;vertical_shooting_font 5378 b700 00 54 10 54* HEX 0054105454445454545454545054505454544454044440445010501050145444 5379 b720 44 44 44 44* HEX 44444444540000101040401044 5380 b72d ;vertical_shooting_ship 5381 b72d 01 40 HEX 0140 5382 b72f ;vertical_shooting_ship_tallsprite_00 5383 b72f 27 d8 HEX 27d8 5384 b731 ;vertical_shooting_bullet 5385 b731 00 HEX 00 5386 b732 ;vertical_shooting_enemyshot 5387 b732 88 HEX 88 5388 b733 ;vertical_shooting_powerup 5389 b733 55 50 HEX 5550 5390 b735 ;vertical_shooting_enemy01 5391 b735 40 01 HEX 4001 5392 b737 ;vertical_shooting_enemy01_tallsprite_00 5393 b737 09 e0 HEX 09e0 5394 b739 ;vertical_shooting_1up 5395 b739 03 00 HEX 0300 5396 b73b ;vertical_shooting_explosion_01 5397 b73b 00 00 HEX 0000 5398 b73d ;vertical_shooting_explosion_01_tallsprite_00 5399 b73d 02 80 HEX 0280 5400 b73f ;vertical_shooting_explosion_02 5401 b73f 00 00 HEX 0000 5402 b741 ;vertical_shooting_explosion_02_tallsprite_00 5403 b741 05 50 HEX 0550 5404 b743 ;vertical_shooting_explosion_03 5405 b743 00 00 HEX 0000 5406 b745 ;vertical_shooting_explosion_03_tallsprite_00 5407 b745 15 54 HEX 1554 5408 b747 ;vertical_shooting_explosion_04 5409 b747 00 00 HEX 0000 5410 b749 ;vertical_shooting_explosion_04_tallsprite_00 5411 b749 07 d0 HEX 07d0 5412 b74b ;vertical_shooting_explosion_05 5413 b74b 01 40 HEX 0140 5414 b74d ;vertical_shooting_explosion_05_tallsprite_00 5415 b74d 0c 30 HEX 0c30 5416 b74f ;vertical_shooting_explosion_06 5417 b74f 01 40 HEX 0140 5418 b751 ;vertical_shooting_explosion_06_tallsprite_00 5419 b751 00 00 HEX 0000 5420 b753 ;vertical_shooting_explosion_07 5421 b753 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5422 b767 ;vertical_shooting_explosion_07_tallsprite_00 5423 b767 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5424 b77b ;vertical_shooting_explosion_08 5425 b77b 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5426 b78f ;vertical_shooting_explosion_08_tallsprite_00 5427 b78f 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5428 b7a3 ;vertical_shooting_explosion_09 5429 b7a3 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5430 b7b7 ;vertical_shooting_explosion_09_tallsprite_00 5431 b7b7 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5432 b7cb ;vertical_shooting_explosion_10 5433 b7cb 00 00 00 00* HEX 00000000000000000140014001400140014003c0 5434 b7df ;vertical_shooting_explosion_10_tallsprite_00 5435 b7df 02 80 0a a0* HEX 02800aa02aa80be00c3000000000000000000000 5436 b7f3 ;vertical_shooting_laser 5437 b7f3 44 HEX 44 5438 b7f4 ;vertical_shooting_laser_tallsprite_00 5439 b7f4 88 HEX 88 5440 b7f5 5441 b800 ORG $B800,0 ; ************* 5442 b800 5443 b800 RORG $B800 ; ************* 5444 b800 - if SPACEOVERFLOW > 0 5445 b800 - echo "" 5446 b800 - echo "######## ERROR: space overflow detected in",[SPACEOVERFLOW]d,"areas." 5447 b800 - echo "######## look above for areas with negative ROM space left." 5448 b800 - echo "######## Aborting assembly." 5449 b800 - ERR 5450 b800 endif 5451 b800 5452 b800 5453 b800 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5454 b800 5455 b800 - ifnconst bankswitchmode 5456 b800 - if ( * < $f000 ) 5457 b800 - ORG $F000 5458 b800 - endif 5459 b800 else 5460 b800 ifconst ROM128K 5461 b800 if ( * < $f000 ) 5462 27000 ORG $27000 5463 27000 RORG $F000 5464 27000 endif 5465 27000 endif 5466 27000 - ifconst ROM144K 5467 27000 - if ( * < $f000 ) 5468 27000 - ORG $27000 5469 27000 - RORG $F000 5470 27000 - endif 5471 27000 endif 5472 27000 - ifconst ROM256K 5473 27000 - if ( * < $f000 ) 5474 27000 - ORG $47000 5475 27000 - RORG $F000 5476 27000 - endif 5477 27000 endif 5478 27000 - ifconst ROM272K 5479 27000 - if ( * < $f000 ) 5480 27000 - ORG $47000 5481 27000 - RORG $F000 5482 27000 - endif 5483 27000 endif 5484 27000 - ifconst ROM512K 5485 27000 - if ( * < $f000 ) 5486 27000 - ORG $87000 5487 27000 - RORG $F000 5488 27000 - endif 5489 27000 endif 5490 27000 - ifconst ROM528K 5491 27000 - if ( * < $f000 ) 5492 27000 - ORG $87000 5493 27000 - RORG $F000 5494 27000 - endif 5495 27000 endif 5496 27000 endif 5497 27000 5498 27000 ; all of these "modules" have conditional clauses in them, so even though 5499 27000 ; they're always included here, they don't take up rom unless the user 5500 27000 ; explicitly enables support for the feature. 5501 27000 5502 27000 ifnconst included.7800vox.asm ------- FILE 7800vox.asm LEVEL 2 PASS 3 0 27000 include 7800vox.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 ; AtariVox 7800basic wrapper 4 27000 5 27000 ; to be called with 6 27000 ; A=# of bytes 7 27000 ; 8 27000 9 27000 - ifconst HSSUPPORT 10 27000 - 11 27000 -AVoxReadBytes 12 27000 - sta temp8 13 27000 - jsr i2c_startwrite 14 27000 - bcs eeprom_error 15 27000 - 16 27000 - lda HSVoxHi 17 27000 - jsr i2c_txbyte 18 27000 - lda HSVoxLo 19 27000 - jsr i2c_txbyte 20 27000 - jsr i2c_stopwrite 21 27000 - 22 27000 - jsr i2c_startread 23 27000 - 24 27000 - ldx #0 25 27000 -AVoxReadBytesLoop 26 27000 - jsr i2c_rxbyte 27 27000 - sta eeprombuffer,x 28 27000 - inx 29 27000 - cpx temp8 30 27000 - bne AVoxReadBytesLoop 31 27000 - jsr i2c_stopread 32 27000 - lda #0 33 27000 - rts 34 27000 - 35 27000 - ; to be called with 36 27000 - ; A=# of bytes 37 27000 - ; 38 27000 - 39 27000 -AVoxWriteBytes 40 27000 - sta temp8 41 27000 - jsr i2c_startwrite 42 27000 - bcs eeprom_error 43 27000 - 44 27000 - lda HSVoxHi 45 27000 - jsr i2c_txbyte 46 27000 - lda HSVoxLo 47 27000 - jsr i2c_txbyte 48 27000 - 49 27000 - ldx #$00 50 27000 -AVoxWriteBytesLoop 51 27000 - lda eeprombuffer,x 52 27000 - jsr i2c_txbyte 53 27000 - inx 54 27000 - cpx temp8 55 27000 - bne AVoxWriteBytesLoop 56 27000 - jsr i2c_stopwrite 57 27000 - 58 27000 - lda #0 59 27000 - rts 60 27000 - 61 27000 -eeprom_error 62 27000 - lda #$ff 63 27000 - rts 64 27000 - 65 27000 -AVoxDetect 66 27000 - 67 27000 - jsr i2c_startwrite 68 27000 - bcs eeprom_error 69 27000 - lda #$30 70 27000 - jsr i2c_txbyte 71 27000 - lda #$00 72 27000 - jsr i2c_txbyte 73 27000 - jsr i2c_stopwrite 74 27000 - rts 75 27000 - 76 27000 - include "i2c7800.inc" 77 27000 - I2C_SUBS temp9 78 27000 - 79 27000 endif 80 27000 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite3.78b.asm 5504 27000 endif 5505 27000 ifnconst included.pokeysound.asm ------- FILE pokeysound.asm LEVEL 2 PASS 3 0 27000 include pokeysound.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 4 27000 - ifconst pokeysupport 5 27000 - 6 27000 -pokeysoundmodulestart 7 27000 - 8 27000 -mutepokey 9 27000 - lda #0 10 27000 - ldy #7 11 27000 -mutepokeyloop 12 27000 - sta pokey1pointlo,y 13 27000 - sta (pokeybaselo),y 14 27000 - dey 15 27000 - bpl mutepokeyloop 16 27000 - rts 17 27000 - 18 27000 -checkpokeyplaying 19 27000 - ldx #6 20 27000 -checkpokeyplayingloop 21 27000 - lda pokey1pointlo,x 22 27000 - ora pokey1pointhi,x 23 27000 - beq pokeychannelinactive 24 27000 - jsr playpokeysfxA ; x=channel*2 25 27000 -pokeychannelinactive 26 27000 - dex 27 27000 - dex 28 27000 - bpl checkpokeyplayingloop 29 27000 - rts 30 27000 - 31 27000 -playpokeysfxA 32 27000 - txa 33 27000 - tay 34 27000 - lda pokey1tick,x 35 27000 - beq playpokeysfxAcont 36 27000 - sec 37 27000 - sbc #1 38 27000 - sta pokey1tick,x ; sound resolution is >1 frame, and we're mid-tock... 39 27000 - rts 40 27000 - 41 27000 -playpokeysfxAcont 42 27000 - lda pokey1frames,x ; set the frame countdown for this sound chunk 43 27000 - sta pokey1tick,x 44 27000 - 45 27000 - lda pokey1priority,x ; decrease the sound's priority if its non-zero 46 27000 - beq playpokeysfxAcont2 47 27000 - sec 48 27000 - sbc #1 49 27000 - sta pokey1priority,x 50 27000 -playpokeysfxAcont2 51 27000 - 52 27000 - ; *** FREQUENCY 53 27000 - lda (pokey1pointlo,x) 54 27000 - sta inttemp1 55 27000 - clc 56 27000 - adc pokey1offset,x ; take into account any pitch modification 57 27000 - sta (pokeybaselo),y ; PAUDF0,0 58 27000 - 59 27000 - ;advance the data pointer +1 60 27000 - inc pokey1pointlo,x 61 27000 - bne skippokeyhiinc1 62 27000 - inc pokey1pointhi,x 63 27000 -skippokeyhiinc1 64 27000 - 65 27000 - ; *** WAVE 66 27000 - lda (pokey1pointlo,x) 67 27000 - asl 68 27000 - asl 69 27000 - asl 70 27000 - asl ; x16 71 27000 - 72 27000 - ;advance the data pointer +1 73 27000 - inc pokey1pointlo,x 74 27000 - bne skippokeyhiinc2 75 27000 - inc pokey1pointhi,x 76 27000 -skippokeyhiinc2 77 27000 - 78 27000 - ora (pokey1pointlo,x) 79 27000 - iny 80 27000 - sta (pokeybaselo),y 81 27000 - 82 27000 - ora inttemp1 ; check if F|C|V=0 83 27000 - beq zeropokeypoint ; if so, we're at the end of the sound. 84 27000 - 85 27000 - ; advance the pointer +1, on to the next sound chunk 86 27000 - inc pokey1pointlo,x 87 27000 - bne skippokeyhiinc3 88 27000 - inc pokey1pointhi,x 89 27000 -skippokeyhiinc3 90 27000 - rts 91 27000 - 92 27000 -zeropokeypoint 93 27000 - sta pokey1pointlo,x 94 27000 - sta pokey1pointhi,x 95 27000 - sta pokey1priority,x 96 27000 - rts 97 27000 - 98 27000 -schedulepokeysfx 99 27000 - ldx #6 100 27000 -schedulepokeysfxloop 101 27000 - lda pokey1pointlo,x 102 27000 - ora pokey1pointhi,x 103 27000 - bne schedulespokeysearch 104 27000 - jmp schedulepokeyX ; we found an unused channel, so use it... 105 27000 -schedulespokeysearch 106 27000 - dex 107 27000 - dex 108 27000 - bpl schedulepokeysfxloop 109 27000 - 110 27000 - ; if we're here, all 4 channels are presently playing a sound... 111 27000 - ldy #1 112 27000 - lda (sfxinstrumentlo),y ; peek at the priority of this sfx... 113 27000 - bne schedulepokeysfxcont1 114 27000 - rts ; ...and skip it if it's 0 priority 115 27000 -schedulepokeysfxcont1 116 27000 - 117 27000 - ; figure out which current sound has the lowest priority... 118 27000 - lda #0 119 27000 - sta temp8 120 27000 - lda pokey1priority 121 27000 - sta temp9 122 27000 - ldx #6 123 27000 -findlowprioritypokeyloop 124 27000 - lda pokey1priority,x 125 27000 - cmp temp9 126 27000 - bcs findlowprioritypokeyloopcontinue 127 27000 - sta temp9 128 27000 - stx temp8 129 27000 -findlowprioritypokeyloopcontinue 130 27000 - dex 131 27000 - dex 132 27000 - bne findlowprioritypokeyloop 133 27000 - ldx temp8 ; the low priority channel we'll interrupt 134 27000 - 135 27000 -schedulepokeyX 136 27000 - ;called with X=2*pokey channel to play on... 137 27000 - ldy #1 ; get priority and sound-resolution (in frames) 138 27000 - lda (sfxinstrumentlo),y 139 27000 - sta pokey1priority,x 140 27000 - iny 141 27000 - lda (sfxinstrumentlo),y 142 27000 - sta pokey1frames,x 143 27000 - 144 27000 - lda sfxinstrumentlo 145 27000 - clc 146 27000 - adc #3 147 27000 - sta pokey1pointlo,x 148 27000 - lda sfxinstrumenthi 149 27000 - adc #0 150 27000 - sta pokey1pointhi,x 151 27000 - lda temp3 152 27000 - sta pokey1offset,x 153 27000 - lda #0 154 27000 - sta pokey1tick,x 155 27000 - rts 156 27000 - 157 27000 - ; pokey detection routine. we check for pokey in the XBOARD/XM location, 158 27000 - ; and the standard $4000 location. 159 27000 - ; if pokey the pokey is present, this routine will reset it. 160 27000 - 161 27000 -detectpokeylocation 162 27000 - ;XBoard/XM... 163 27000 - ldx #2 164 27000 -detectpokeyloop 165 27000 - lda XCTRL1s 166 27000 - ora #%00010100 167 27000 - and POKEYXMMASK,x 168 27000 - sta XCTRL1s 169 27000 - sta XCTRL1 170 27000 - 171 27000 - lda POKEYCHECKLO,x 172 27000 - sta pokeybaselo 173 27000 - lda POKEYCHECKHI,x 174 27000 - sta pokeybasehi 175 27000 - jsr checkforpokey 176 27000 - lda pokeydetected 177 27000 - beq foundpokeychip 178 27000 - dex 179 27000 - bpl detectpokeyloop 180 27000 -foundpokeychip 181 27000 - eor #$ff ; invert state for 7800basic if...then test 182 27000 - sta pokeydetected 183 27000 - rts 184 27000 - 185 27000 -POKEYXMMASK 186 27000 - ; XM POKEY on XM POKEY off XM POKEY off 187 27000 - .byte %11111111, %11101111, %11101111 188 27000 - 189 27000 -POKEYCHECKLO 190 27000 - .byte <$0450, <$0450, <$4000 191 27000 -POKEYCHECKHI 192 27000 - .byte >$0450, >$0450, >$4000 193 27000 - 194 27000 -checkforpokey 195 27000 - ldy #$0f 196 27000 - lda #$00 197 27000 - sta pokeydetected ; start off by assuming pokey will be detected 198 27000 -resetpokeyregistersloop 199 27000 - sta (pokeybase),y 200 27000 - dey 201 27000 - bpl resetpokeyregistersloop 202 27000 - 203 27000 - ldy #PAUDCTL 204 27000 - sta (pokeybase),y 205 27000 - ldy #PSKCTL 206 27000 - sta (pokeybase),y 207 27000 - 208 27000 - ; let the dust settle... 209 27000 - nop 210 27000 - nop 211 27000 - nop 212 27000 - 213 27000 - lda #4 214 27000 - sta temp9 215 27000 -pokeycheckloop1 216 27000 - ; we're in reset, so the RANDOM register should read $ff... 217 27000 - ldy #PRANDOM 218 27000 - lda (pokeybase),y 219 27000 - cmp #$ff 220 27000 - bne nopokeydetected 221 27000 - dec temp9 222 27000 - bne pokeycheckloop1 223 27000 - 224 27000 - ; take pokey out of reset... 225 27000 - ldy #PSKCTL 226 27000 - lda #3 227 27000 - sta (pokeybase),y 228 27000 - ldy #PAUDCTL 229 27000 - lda #0 230 27000 - sta (pokeybase),y 231 27000 - 232 27000 - ; let the dust settle again... 233 27000 - nop 234 27000 - nop 235 27000 - nop 236 27000 - 237 27000 - lda #4 238 27000 - sta temp9 239 27000 -pokeycheckloop2 240 27000 - ; we're out of reset, so RANDOM should read non-$ff... 241 27000 - ldy #PRANDOM 242 27000 - lda (pokeybase),y 243 27000 - cmp #$ff 244 27000 - beq skippokeycheckreturn 245 27000 - rts 246 27000 -skippokeycheckreturn 247 27000 - dec temp9 248 27000 - bne pokeycheckloop2 249 27000 -nopokeydetected 250 27000 - dec pokeydetected ; pokeydetected=#$ff 251 27000 - rts 252 27000 - 253 27000 -pokeysoundmoduleend 254 27000 - 255 27000 - echo " pokeysound assembly: ",[(pokeysoundmoduleend-pokeysoundmodulestart)]d," bytes" 256 27000 - 257 27000 endif ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite3.78b.asm 5507 27000 endif 5508 27000 ifnconst included.tracker.asm ------- FILE tracker.asm LEVEL 2 PASS 3 0 27000 include tracker.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 4 27000 - ifconst MUSICTRACKER 5 27000 - ; ** songtempo lists how many 256ths of a frame a 16th note lasts 6 27000 - ; ** the player operates on a 16th note grid. 7 27000 - 8 27000 -servicesongover 9 27000 - rts 10 27000 -servicesong 11 27000 - lda songtempo 12 27000 - beq servicesongover ; ** if song is off/paused then return 13 27000 -servicesongcontinue 14 27000 - lda sfxschedulelock 15 27000 - sta sfxschedulemissed 16 27000 - bne servicesongover 17 27000 - lda songtempo 18 27000 - clc 19 27000 - adc songtick ; add songtempo to songtick until it rolls over 20 27000 - sta songtick ; this is how we break away from 50/60Hz timing. 21 27000 - bcc servicesongover 22 27000 - ; ** if we're here a new 16th note has passed 23 27000 - ; ** check if a new note is due on any of the 4 channels 24 27000 -servicesongredo 25 27000 - ldx #3 26 27000 -checkchannelloop 27 27000 - dec songchannel1busywait,x 28 27000 - bpl carryoncheckingchannel 29 27000 - txa 30 27000 - pha ; save X for the loop 31 27000 - jsr processsongdata 32 27000 - pla ; restore X for the loop 33 27000 - tax 34 27000 -carryoncheckingchannel 35 27000 - dex 36 27000 - bpl checkchannelloop 37 27000 - lda inactivechannelcount 38 27000 - cmp #15 39 27000 - bne skipstopsong 40 27000 - lda songloops 41 27000 - bne doasongloop 42 27000 - ;lda #0 43 27000 - sta songtempo ; all channels are done. stop the song 44 27000 - rts 45 27000 -doasongloop 46 27000 - bmi skipsongloopadjust 47 27000 - dec songloops 48 27000 -skipsongloopadjust 49 27000 - jsr setsongchannels 50 27000 - jmp servicesongredo 51 27000 -skipstopsong 52 27000 - rts 53 27000 - 54 27000 -processsongdata 55 27000 - ; channel needs processing 56 27000 - ; X=channel # 57 27000 - 58 27000 - txa 59 27000 - clc 60 27000 - adc songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 61 27000 - tay 62 27000 - 63 27000 - 64 27000 - ; ** indirect x is cumbersome with mult-byte commands. 65 27000 - ; ** setup a pointer to the song data for indirect y addressing. 66 27000 - lda songchannel1layer1lo,y 67 27000 - sta songdatalo 68 27000 - lda songchannel1layer1hi,y 69 27000 - sta songdatahi 70 27000 - ora songdatalo 71 27000 - bne channelhasdata 72 27000 - ;channel data is pointing at $0000 73 27000 - lda #$7F 74 27000 - sta songchannel1busywait,x ; skip a bunch of notes 75 27000 -setchannelcountbits 76 27000 - lda channel2bits,x 77 27000 - ora inactivechannelcount 78 27000 - sta inactivechannelcount 79 27000 - rts 80 27000 -channelhasdata 81 27000 - 82 27000 - sty songstackindex 83 27000 - ldy #0 84 27000 - lda (songdatalo),y ; ** load in the next byte of song data, so we can decode it 85 27000 - cmp #$ff 86 27000 - bne carryoncheckingdatatype ; ** $ff=pattern end marker 87 27000 - jmp handlechannelEOD 88 27000 - 89 27000 -carryoncheckingdatatype 90 27000 - and #$F0 91 27000 - cmp #$C0 92 27000 - beq handlechannelrest ; 0000XXXX=rest 93 27000 - cmp #$F0 94 27000 - beq handlemultibytecommand 95 27000 - cmp #$D0 96 27000 - beq handlesemiup 97 27000 - cmp #$E0 98 27000 - beq handlesemidown 99 27000 -handlenotedata 100 27000 - ; ** TODO: note playing is a terrible choice for fall-through 101 27000 - 102 27000 - ; ** its simple note data, prepare arguments for schedulesfx 103 27000 - 104 27000 - ; ** set the note length 105 27000 - lda (songdatalo),y 106 27000 - and #$0F 107 27000 - sta songchannel1busywait,x 108 27000 - 109 27000 - ; ** load the instrument 110 27000 - lda songchannel1instrumentlo,x 111 27000 - sta sfxinstrumentlo 112 27000 - lda songchannel1instrumenthi,x 113 27000 - sta sfxinstrumenthi 114 27000 - 115 27000 - ; ** get the note, and transpose 116 27000 - lda (songdatalo),y 117 27000 - lsr 118 27000 - lsr 119 27000 - lsr 120 27000 - lsr 121 27000 - clc 122 27000 - adc songchannel1transpose,x ; ** add it to the transpose index 123 27000 - ; ** its up the respective SFX scheduler to handle and save the note data 124 27000 - sta sfxnoteindex 125 27000 - 126 27000 - lda #0 127 27000 - sta sfxpitchoffset 128 27000 - 129 27000 - jsr schedulesfx 130 27000 - 131 27000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 132 27000 - 133 27000 -handlechannelrest 134 27000 - ; ** set the note length 135 27000 - lda (songdatalo),y 136 27000 - and #$0F 137 27000 - sta songchannel1busywait,x 138 27000 - jmp advancethesongpointer1byte ; advance to the next data byte and exit 139 27000 - 140 27000 -handlesemiup 141 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 142 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 143 27000 - clc 144 27000 -handlesemidownentry 145 27000 - adc songchannel1transpose,x ; ** add it to the transpose index 146 27000 - sta songchannel1transpose,x 147 27000 - jsr advancethesongpointer1byte 148 27000 - jmp processsongdata ; semi doesn't have note length, so process the next data byte... 149 27000 - 150 27000 -handlesemidown 151 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 152 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 153 27000 - eor #$ff ; ** its easier if we negate it, and then add it instead. 154 27000 - sec 155 27000 - jmp handlesemidownentry 156 27000 - 157 27000 -handlemultibytecommand 158 27000 - lda (songdatalo),y ; ** reload the song data, so we can get at the lower nibble 159 27000 - and #$0f ; ** since we need to mask the nibble of the subtracted value, 160 27000 - cmp #$08 ; ** load new instrument? 161 27000 - bne nothandleinstrumentchange 162 27000 -handleinstrumentchange 163 27000 - iny 164 27000 - lda (songdatalo),y 165 27000 - sta songchannel1instrumentlo,x 166 27000 - iny 167 27000 - lda (songdatalo),y 168 27000 - sta songchannel1instrumenthi,x 169 27000 - lda #3 170 27000 - jsr advancethesongpointerNbytes ; advance 3 bytes 171 27000 - jmp processsongdata 172 27000 - 173 27000 -nothandleinstrumentchange 174 27000 - cmp #$09 ; ** absolute tempo change? 175 27000 - bne nothandletempochange 176 27000 - lda #0 177 27000 - sta songtempo 178 27000 -handlerelativetempochange 179 27000 - iny 180 27000 - lda (songdatalo),y 181 27000 - clc 182 27000 - adc songtempo 183 27000 - sta songtempo 184 27000 - lda #2 185 27000 - jsr advancethesongpointerNbytes ; advance 2 bytes 186 27000 - jmp processsongdata 187 27000 - 188 27000 -nothandletempochange 189 27000 - cmp #$0A ; ** relative tempo change?: 190 27000 - beq handlerelativetempochange 191 27000 - cmp #$0B ; ** octave/semi change? 192 27000 - beq handleoctavesemichange 193 27000 -handlepatterndata 194 27000 - ; ** if we're here its a pattern/loop "subroutine" 195 27000 - ; ** move the channel's "stack" pointer and populate the new stack level 196 27000 - 197 27000 - lda #4 198 27000 - clc 199 27000 - adc songchannel1stackdepth,x 200 27000 - sta songchannel1stackdepth,x ; stack depth value will be 0, 4, or 8 201 27000 - 202 27000 - stx inttemp6 ; about to invalidate x. save it. 203 27000 - lda songstackindex 204 27000 - adc #4 205 27000 - tax 206 27000 - 207 27000 - lda (songdatalo),y 208 27000 - and #$7 209 27000 - sta songchannel1layer1loops,x 210 27000 - iny 211 27000 - lda (songdatalo),y 212 27000 - sta songchannel1layer1lo,x 213 27000 - iny 214 27000 - lda (songdatalo),y 215 27000 - sta songchannel1layer1hi,x 216 27000 - 217 27000 - ldx inttemp6 ; restore x with the channel # 218 27000 - 219 27000 - ; ** advance will operate on the old stack level, since we didn't store the updated songstackindex... 220 27000 - lda #3 221 27000 - jsr advancethesongpointerNbytes ; advance 3 bytes 222 27000 - 223 27000 - ; ** ...but the new stack level will be correctly picked up when we process the next byte. 224 27000 - jmp processsongdata 225 27000 - 226 27000 -handlechannelEOD 227 27000 - ; ** check if there are loops remaining on the pattern 228 27000 - stx inttemp6 229 27000 - ldx songstackindex 230 27000 - dec songchannel1layer1loops,x 231 27000 - bmi handlechannelEODnoloop 232 27000 - ; ** loops are remaining. set the pattern pointer to the pattern start, which is contained after the EOD 233 27000 - iny 234 27000 - lda (songdatalo),y 235 27000 - sta songchannel1layer1lo,x 236 27000 - iny 237 27000 - lda (songdatalo),y 238 27000 - sta songchannel1layer1hi,x 239 27000 - ldx inttemp6 240 27000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 241 27000 - 242 27000 -handlechannelEODnoloop 243 27000 - ; this pattern/loop is done playing. "pop" the stack 244 27000 - ldx inttemp6 245 27000 - lda songchannel1stackdepth,x 246 27000 - beq handlerootchannelEOD 247 27000 - sec 248 27000 - sbc #4 249 27000 - sta songchannel1stackdepth,x 250 27000 - jmp processsongdata ; EOD handling doesn't have note length, so process the next data byte... 251 27000 - 252 27000 -handlerootchannelEOD 253 27000 - ; this channel is done. point it to $ff data so we no longer process this channel. 254 27000 - lda #0 255 27000 - sta songchannel1layer1lo,x 256 27000 - sta songchannel1layer1hi,x 257 27000 - sta songchannel1busywait,x 258 27000 - jmp setchannelcountbits 259 27000 - rts 260 27000 - 261 27000 -nothandlepatternchange 262 27000 -handleoctavesemichange 263 27000 - iny 264 27000 - lda (songdatalo),y 265 27000 - sta songchannel1transpose,x 266 27000 - lda #2 267 27000 - jsr advancethesongpointerNbytes ; advance 2 bytes 268 27000 - jmp processsongdata 269 27000 - 270 27000 -advancethesongpointer1byte 271 27000 - txa 272 27000 - ldx songstackindex 273 27000 - inc songchannel1layer1lo,x 274 27000 - bne skiphiadvancethesongpointer1byte 275 27000 - inc songchannel1layer1hi,x 276 27000 -skiphiadvancethesongpointer1byte 277 27000 - tax 278 27000 - rts 279 27000 - 280 27000 -advancethesongpointerNbytes 281 27000 - ; entered with A=# of byte to advance 282 27000 - stx inttemp6 283 27000 - ldx songstackindex 284 27000 - clc 285 27000 - adc songchannel1layer1lo,x 286 27000 - sta songchannel1layer1lo,x 287 27000 - lda #0 288 27000 - adc songchannel1layer1hi,x 289 27000 - sta songchannel1layer1hi,x 290 27000 - ldx inttemp6 291 27000 - rts 292 27000 - 293 27000 -clearsongmemory 294 27000 - lda #0 295 27000 - ldx #(songchannel4instrumenthi-songchannel1layer1lo) 296 27000 -clearsongmemoryloop1 297 27000 - sta songchannel1layer1lo,x 298 27000 - dex 299 27000 - bpl clearsongmemoryloop1 300 27000 - 301 27000 - ldx #(songchannel4stackdepth-songchannel1layer1loops) 302 27000 -clearsongmemoryloop2 303 27000 - sta songchannel1layer1loops,x 304 27000 - dex 305 27000 - bpl clearsongmemoryloop2 306 27000 - 307 27000 - lda #$ff 308 27000 - ldx #3 309 27000 -clearsongmemoryloop3 310 27000 - sta songchannel1busywait,x 311 27000 - dex 312 27000 - bpl clearsongmemoryloop3 313 27000 - rts 314 27000 - 315 27000 -setsongchannels 316 27000 - jsr clearsongmemory 317 27000 - ldy #7 318 27000 - ldx #3 319 27000 -setsongchannelsloop 320 27000 - lda (songpointerlo),y 321 27000 - sta songchannel1layer1hi,x 322 27000 - dey 323 27000 - lda (songpointerlo),y 324 27000 - sta songchannel1layer1lo,x 325 27000 - dex 326 27000 - dey 327 27000 - bpl setsongchannelsloop 328 27000 - rts 329 27000 - 330 27000 -channel2bits 331 27000 - .byte 1,2,4,8 332 27000 - 333 27000 -tiatrackeroctavenotes 334 27000 - ifconst BUZZBASS 335 27000 -LOWC = 15 336 27000 - else 337 27000 -LOWC = 14 338 27000 - endif 339 27000 - ; ****** ELECTRONIC (0 to 11) 340 27000 - .byte LOWC,20 ; c0 16.1Hz 341 27000 - .byte LOWC,18 ; c#0 342 27000 - .byte LOWC,17 ; d0 343 27000 - .byte LOWC,16 ; d#0 344 27000 - .byte LOWC,15 ; e0 345 27000 - .byte LOWC,14 ; f0 (very off) 346 27000 - .byte LOWC,14 ; f#0 347 27000 - .byte LOWC,13 ; g0 348 27000 - .byte LOWC,12 ; g#0 349 27000 - .byte LOWC,11 ; a0 350 27000 - .byte LOWC,11 ; a#0 (very off) 351 27000 - .byte LOWC,10 ; b0 30.7Hz 352 27000 - 353 27000 - ; ****** SLIGHTLY BUZZY (12 to 23) 354 27000 - .byte 6,30 ; c1 32.7Hz 355 27000 - .byte 6,28 ; c#1 356 27000 - .byte 6,27 ; d1 357 27000 - .byte 6,25 ; d#1 358 27000 - .byte 6,24 ; e1 359 27000 - .byte 6,22 ; f1 360 27000 - .byte 6,21 ; f#1 361 27000 - .byte 6,20 ; g1 362 27000 - .byte 6,18 ; g#1 363 27000 - .byte 6,17 ; a1 364 27000 - .byte 6,16 ; a#1 365 27000 - .byte 6,15 ; b1 63.4Hz 366 27000 - 367 27000 - ; ****** BUZZY (24 to 39) 368 27000 - .byte 1,31 ; c2 65.5 369 27000 - .byte 1,30 ; c#2 67.6 370 27000 - .byte 1,27 ; d2 72.3 371 27000 - .byte 1,26 ; d#2 77.6 372 27000 - .byte 1,24 ; e2 373 27000 - .byte 1,23 ; f2 374 27000 - .byte 1,22 ; f#2 375 27000 - .byte 1,20 ; g2 376 27000 - .byte 1,19 ; g#2 377 27000 - .byte 1,18 ; a2 378 27000 - .byte 1,17 ; a#2 379 27000 - .byte 1,16 ; b2 380 27000 - .byte 1,15 ; c3 126.8Hz 381 27000 - .byte 1,14 ; c#3 382 27000 - .byte 1,13 ; d3 149.7Hz 383 27000 - .byte 1,12 ; d#3 161.2Hz (very off) 384 27000 - ; ****** PURE (40 to 71) - best key is A3 Major 385 27000 - .byte 12,31 ; e3 163.8Hz 386 27000 - .byte 12,29 ; f3 387 27000 - .byte 12,28 ; f#3 388 27000 - .byte 12,26 ; g3 389 27000 - .byte 12,24 ; g#3 390 27000 - .byte 12,23 ; a3 songs in key of A benefit from Perceptual Tuning 391 27000 - .byte 12,22 ; a#3 392 27000 - .byte 12,20 ; b3 393 27000 - .byte 12,19 ; c4 (middle C) 394 27000 - .byte 12,18 ; c#4 395 27000 - .byte 12,17 ; d4 396 27000 - .byte 12,16 ; d#4 397 27000 - .byte 12,15 ; e4 398 27000 - .byte 12,14 ; f4 399 27000 - .byte 12,13 ; f#4 400 27000 - .byte 12,12 ; g4 (very off) 401 27000 - .byte 12,12 ; g#4 402 27000 - .byte 12,11 ; a4 403 27000 - .byte 12,10 ; a#4 404 27000 - .byte 4,31 ; b4 405 27000 - .byte 4,29 ; c5 406 27000 - .byte 4,28 ; c#5 407 27000 - .byte 4,26 ; d5 408 27000 - .byte 4,24 ; d#5 409 27000 - .byte 4,23 ; e5 410 27000 - .byte 4,22 ; f5 411 27000 - .byte 4,20 ; f#5 412 27000 - .byte 4,19 ; g5 413 27000 - .byte 4,18 ; g#5 414 27000 - .byte 4,17 ; a5 415 27000 - .byte 4,16 ; a#5 416 27000 - .byte 4,15 ; b5 417 27000 - 418 27000 - ; ****** TUNED WIND (72 to 83) 419 27000 - .byte 8,30 ; c 420 27000 - .byte 8,28 ; c# 421 27000 - .byte 8,27 ; d 422 27000 - .byte 8,25 ; d# 423 27000 - .byte 8,24 ; e 424 27000 - .byte 8,22 ; f 425 27000 - .byte 8,21 ; f# 426 27000 - .byte 8,20 ; g 427 27000 - .byte 8,18 ; g# 428 27000 - .byte 8,17 ; a 429 27000 - .byte 8,16 ; a# 430 27000 - .byte 8,15 ; b 431 27000 - 432 27000 - include "tiadrumkit.asm" 433 27000 - 434 27000 endif ;MUSICTRACKER ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite3.78b.asm 5510 27000 endif 5511 27000 ifnconst included.hiscore.asm ------- FILE hiscore.asm LEVEL 2 PASS 3 0 27000 include hiscore.asm 1 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 2 27000 3 27000 - ifconst HSSUPPORT 4 27000 -detectatarivoxeeprom 5 27000 -hiscoremodulestart 6 27000 - ; do a test to see if atarivox eeprom can be accessed, and save results 7 27000 - jsr AVoxDetect 8 27000 - eor #$ff ; invert for easy 7800basic if...then logic 9 27000 - sta avoxdetected 10 27000 - lda #$0 11 27000 - sta SWACNT 12 27000 - lda avoxdetected 13 27000 - rts 14 27000 - 15 27000 -detecthsc 16 27000 - ; check for the HSC ROM signature... 17 27000 - lda XCTRL1s 18 27000 - ora #%00001100 19 27000 - sta XCTRL1s 20 27000 - sta XCTRL1 21 27000 - lda $3900 22 27000 - eor #$C6 23 27000 - bne detecthscfail 24 27000 - lda $3904 25 27000 - eor #$FE 26 27000 - bne detecthscfail 27 27000 - ; check if it's initialized... 28 27000 - ldy #0 29 27000 - lda #$ff 30 27000 -checkhscinit 31 27000 - and $1000,y 32 27000 - dey 33 27000 - bpl checkhscinit 34 27000 - cmp #$ff 35 27000 - bne hscisalreadyinit 36 27000 - ; if we're here, we need to do a minimal HSC init... 37 27000 - ldy #$28 38 27000 -hscinitloop1 39 27000 - lda hscheader,y 40 27000 - sta $1000,y 41 27000 - dey 42 27000 - bpl hscinitloop1 43 27000 - ldy #$89 44 27000 - lda #$7F 45 27000 -hscinitloop2 46 27000 - sta $10B3,y 47 27000 - dey 48 27000 - cpy #$ff 49 27000 - bne hscinitloop2 50 27000 -hscisalreadyinit 51 27000 - lda #$ff 52 27000 - rts 53 27000 -hscheader 54 27000 - .byte $00,$00,$68,$83,$AA,$55,$9C,$FF,$07,$12,$02,$1F,$00,$00,$00,$00 55 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 56 27000 - .byte $00,$00,$00,$00,$00,$00,$00,$00,$03 57 27000 -detecthscfail 58 27000 - lda XCTRL1s 59 27000 - and #%11110111 60 27000 - sta XCTRL1s 61 27000 - lda #0 62 27000 - rts 63 27000 endif ; HSSUPPORT 64 27000 65 27000 - ifconst HSSUPPORT 66 27000 - ifnconst hiscorefont 67 27000 - echo "" 68 27000 - echo "WARNING: High score support is enabled, but the hiscorefont.png was" 69 27000 - echo " NOT imported with incgraphic. The high score display code" 70 27000 - echo " has been omitted from this build." 71 27000 - echo "" 72 27000 - else 73 27000 -hscdrawscreen 74 27000 - 75 27000 - ; we use 20 lines on a 24 line display 76 27000 - ; HSSCOREY to dynamically centers based on 77 27000 - ;HSSCOREY = 0 78 27000 -HSSCOREY = ((WZONECOUNT*WZONEHEIGHT/8)-22)/2 79 27000 -HSCURSORY = ((HSSCOREY/(WZONEHEIGHT/8))*WZONEHEIGHT) 80 27000 - 81 27000 - ifconst HSSCORESIZE 82 27000 -SCORESIZE = HSSCORESIZE 83 27000 - else 84 27000 -SCORESIZE = 6 85 27000 - endif 86 27000 - 87 27000 - ;save shadow registers for later return... 88 27000 - lda sCTRL 89 27000 - sta ssCTRL 90 27000 - lda sCHARBASE 91 27000 - sta ssCHARBASE 92 27000 - lda #$60 93 27000 - sta charactermode 94 27000 - jsr drawwait 95 27000 - jsr blacken320colors 96 27000 - jsr clearscreen 97 27000 - 98 27000 - ;set the character base to the HSC font 99 27000 - lda #>hiscorefont 100 27000 - sta CHARBASE 101 27000 - sta sCHARBASE 102 27000 - lda #%01000011 ;Enable DMA, mode=320A 103 27000 - sta CTRL 104 27000 - sta sCTRL 105 27000 - 106 27000 - lda #60 107 27000 - sta hsjoydebounce 108 27000 - 109 27000 - lda #0 110 27000 - sta hscursorx 111 27000 - sta framecounter 112 27000 - ifnconst HSCOLORCHASESTART 113 27000 - lda #$8D ; default is blue. why not? 114 27000 - else 115 27000 - lda #HSCOLORCHASESTART 116 27000 - endif 117 27000 - sta hscolorchaseindex 118 27000 - 119 27000 - lda #$0F 120 27000 - sta P0C2 ; base text is white 121 27000 - 122 27000 - jsr hschasecolors 123 27000 - ; ** plot all of the initials 124 27000 - lda #HSRAMInitials 127 27000 - sta temp2 ; charmaphi 128 27000 - lda #32+29 ; palette=0-29 | 32-(width=3) 129 27000 - sta temp3 ; palette/width 130 27000 - lda #104 131 27000 - sta temp4 ; X 132 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 133 27000 - sta temp5 ; Y 134 27000 -plothsinitialsloop 135 27000 - jsr plotcharacters 136 27000 - clc 137 27000 - lda temp3 138 27000 - adc #32 139 27000 - sta temp3 140 27000 - inc temp5 141 27000 - if WZONEHEIGHT = 8 142 27000 - inc temp5 143 27000 - endif 144 27000 - clc 145 27000 - lda #3 146 27000 - adc temp1 147 27000 - sta temp1 148 27000 - cmp #(<(HSRAMInitials+15)) 149 27000 - bcc plothsinitialsloop 150 27000 - 151 27000 - ifconst HSGAMENAMELEN 152 27000 - ;plot the game name... 153 27000 - lda #HSGAMENAMEtable 156 27000 - sta temp2 ; charmaphi 157 27000 - lda #(32-HSGAMENAMELEN) ; palette=0*29 | 32-(width=3) 158 27000 - sta temp3 ; palette/width 159 27000 - lda #(80-(HSGAMENAMELEN*2)) 160 27000 - sta temp4 ; X 161 27000 - lda #((HSSCOREY+0)/(WZONEHEIGHT/8)) 162 27000 - sta temp5 ; Y 163 27000 - jsr plotcharacters 164 27000 - endif ; HSGAMENAMELEN 165 27000 - 166 27000 - ;plot "difficulty"... 167 27000 - ldy gamedifficulty 168 27000 - ifnconst HSNOLEVELNAMES 169 27000 - lda highscoredifficultytextlo,y 170 27000 - sta temp1 171 27000 - lda highscoredifficultytexthi,y 172 27000 - sta temp2 173 27000 - sec 174 27000 - lda #32 175 27000 - sbc highscoredifficultytextlen,y 176 27000 - sta temp3 ; palette/width 177 27000 - sec 178 27000 - lda #40 179 27000 - sbc highscoredifficultytextlen,y 180 27000 - asl 181 27000 - sta temp4 ; X 182 27000 - else 183 27000 - lda #HSHIGHSCOREStext 186 27000 - sta temp2 ; charmaphi 187 27000 - lda #(32-11) ; palette=0*29 | 32-(width=3) 188 27000 - sta temp3 ; palette/width 189 27000 - lda #(80-(11*2)) 190 27000 - sta temp4 ; X 191 27000 - endif ; HSNOLEVELNAMES 192 27000 - 193 27000 - lda #((HSSCOREY+2)/(WZONEHEIGHT/8)) 194 27000 - sta temp5 ; Y 195 27000 - jsr plotcharacters 196 27000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval, 4=player 2 player evel (joy1) 197 27000 - bne carronwithscoreevaluation 198 27000 - jmp donoscoreevaluation 199 27000 -carronwithscoreevaluation 200 27000 - dey 201 27000 - lda highscorelabeltextlo,y 202 27000 - sta temp1 203 27000 - lda highscorelabeltexthi,y 204 27000 - sta temp2 205 27000 - sec 206 27000 - lda #(32-15) ; palette=0*29 | 32-(width=3) 207 27000 - sta temp3 ; palette/width 208 27000 - lda highscorelabeladjust1,y 209 27000 - sta temp4 ; X 210 27000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 211 27000 - sta temp5 ; Y 212 27000 - jsr plotcharacters 213 27000 - 214 27000 - ldy hsdisplaymode ; 0=attact mode, 1=player eval, 2=player 1 eval, 3=player 2 player eval, 4=player 2 player evel (joy1) 215 27000 - dey 216 27000 - ;plot the current player score... 217 27000 - lda #(32-SCORESIZE) ; palette=0*32 218 27000 - sta temp3 ; palette/width 219 27000 - lda highscorelabeladjust2,y 220 27000 - sta temp4 ; X 221 27000 - lda #((HSSCOREY+18)/(WZONEHEIGHT/8)) 222 27000 - sta temp5 ; Y 223 27000 - 224 27000 - lda scorevarlo,y 225 27000 - sta temp7 ; score variable lo 226 27000 - lda scorevarhi,y 227 27000 - sta temp8 ; score variable hi 228 27000 - 229 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 230 27000 - sta temp9 231 27000 - 232 27000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 233 27000 - sta temp1 ; charmaplo 234 27000 - lda #>(hiscorefont+33) 235 27000 - sta temp2 ; charmaphi 236 27000 - lda #SCORESIZE 237 27000 - sta temp6 238 27000 - ifnconst DOUBLEWIDE 239 27000 - jsr plotvalue 240 27000 - else 241 27000 - jsr plotvaluedw 242 27000 - endif 243 27000 - 244 27000 -USED_PLOTVALUE = 1 ; ensure that plotvalue gets compiled in 245 27000 - 246 27000 - ifconst HSGAMERANKS 247 27000 - 248 27000 - ldx #$ff ; start at 0 after the inx... 249 27000 -comparescore2rankloop 250 27000 - inx 251 27000 - ldy #0 252 27000 - lda rankvalue_0,x 253 27000 - cmp (temp7),y 254 27000 - bcc score2rankloopdone 255 27000 - bne comparescore2rankloop 256 27000 - iny 257 27000 - lda rankvalue_1,x 258 27000 - cmp (temp7),y 259 27000 - bcc score2rankloopdone 260 27000 - bne comparescore2rankloop 261 27000 - iny 262 27000 - lda (temp7),y 263 27000 - cmp rankvalue_2,x 264 27000 - bcs score2rankloopdone 265 27000 - jmp comparescore2rankloop 266 27000 -score2rankloopdone 267 27000 - stx hsnewscorerank 268 27000 - 269 27000 - lda ranklabello,x 270 27000 - sta temp1 271 27000 - lda ranklabelhi,x 272 27000 - sta temp2 273 27000 - sec 274 27000 - lda #32 ; palette=0*29 | 32-(width=3) 275 27000 - sbc ranklabellengths,x 276 27000 - sta temp3 ; palette/width 277 27000 - sec 278 27000 - lda #(40+6) 279 27000 - sbc ranklabellengths,x 280 27000 - asl 281 27000 - sta temp4 ; X 282 27000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 283 27000 - sta temp5 ; Y 284 27000 - jsr plotcharacters 285 27000 - 286 27000 - ldx hsnewscorerank 287 27000 - 288 27000 - lda #highscoreranklabel 291 27000 - sta temp2 292 27000 - 293 27000 - lda #(32-5) ; palette=0*29 | 32-(width=3) 294 27000 - sta temp3 ; palette/width 295 27000 - lda #(40-6) 296 27000 - sec 297 27000 - sbc ranklabellengths,x 298 27000 - asl 299 27000 - sta temp4 ; X 300 27000 - lda #((HSSCOREY+20)/(WZONEHEIGHT/8)) 301 27000 - sta temp5 ; Y 302 27000 - jsr plotcharacters 303 27000 - endif 304 27000 - 305 27000 - 306 27000 - ; ** which line did this player beat? 307 27000 - lda #$ff 308 27000 - sta hsnewscoreline 309 27000 - ldx #$fd 310 27000 -comparescoreadd2x 311 27000 - inx 312 27000 -comparescoreadd1x 313 27000 - inx 314 27000 -comparescore2lineloop 315 27000 - inc hsnewscoreline 316 27000 - inx ; initialrun, x=0 317 27000 - cpx #15 318 27000 - beq nohighscoreforyou 319 27000 - ldy #0 320 27000 - lda HSRAMScores,x 321 27000 - cmp (temp7),y ; first score digit 322 27000 - bcc score2lineloopdonedel1x 323 27000 - bne comparescoreadd2x 324 27000 - iny 325 27000 - inx 326 27000 - lda HSRAMScores,x 327 27000 - cmp (temp7),y 328 27000 - bcc score2lineloopdonedel2x 329 27000 - bne comparescoreadd1x 330 27000 - iny 331 27000 - inx 332 27000 - lda (temp7),y 333 27000 - cmp HSRAMScores,x 334 27000 - bcs score2lineloopdonedel3x 335 27000 - jmp comparescore2lineloop 336 27000 -nohighscoreforyou 337 27000 - lda #$ff 338 27000 - sta hsnewscoreline 339 27000 - sta countdownseconds 340 27000 - jmp donoscoreevaluation 341 27000 -score2lineloopdonedel3x 342 27000 - dex 343 27000 -score2lineloopdonedel2x 344 27000 - dex 345 27000 -score2lineloopdonedel1x 346 27000 - dex 347 27000 - 348 27000 - ; 0 1 2 349 27000 - ; 3 4 5 350 27000 - ; 6 7 8 351 27000 - ; 9 0 1 352 27000 - ; 2 3 4 353 27000 - 354 27000 - stx temp9 355 27000 - cpx #11 356 27000 - beq postsortscoresuploop 357 27000 - ldx #11 358 27000 -sortscoresuploop 359 27000 - lda HSRAMScores,x 360 27000 - sta HSRAMScores+3,x 361 27000 - lda HSRAMInitials,x 362 27000 - sta HSRAMInitials+3,x 363 27000 - dex 364 27000 - cpx temp9 365 27000 - bne sortscoresuploop 366 27000 -postsortscoresuploop 367 27000 - 368 27000 - ;stick the score and cleared initials in the slot... 369 27000 - inx 370 27000 - ldy #0 371 27000 - sty hsinitialhold 372 27000 - lda (temp7),y 373 27000 - sta HSRAMScores,x 374 27000 - iny 375 27000 - lda (temp7),y 376 27000 - sta HSRAMScores+1,x 377 27000 - iny 378 27000 - lda (temp7),y 379 27000 - sta HSRAMScores+2,x 380 27000 - lda #0 381 27000 - sta HSRAMInitials,x 382 27000 - lda #29 383 27000 - sta HSRAMInitials+1,x 384 27000 - sta HSRAMInitials+2,x 385 27000 - 386 27000 - stx hsinitialpos 387 27000 - 388 27000 - ifconst vox_highscore 389 27000 - lda <#vox_highscore 390 27000 - sta speech_addr 391 27000 - lda >#vox_highscore 392 27000 - sta speech_addr+1 393 27000 - endif 394 27000 - ifconst sfx_highscore 395 27000 - lda <#sfx_highscore 396 27000 - sta temp1 397 27000 - lda >#sfx_highscore 398 27000 - sta temp2 399 27000 - lda #0 400 27000 - sta temp3 401 27000 - jsr schedulesfx 402 27000 - endif 403 27000 - ifconst songdatastart_song_highscore 404 27000 - lda #songchanneltable_song_highscore 407 27000 - sta songpointerhi 408 27000 - lda #73 409 27000 - sta songtempo 410 27000 - jsr setsongchannels 411 27000 - endif 412 27000 - 413 27000 - 414 27000 -donoscoreevaluation 415 27000 - 416 27000 - lda #(32+(32-SCORESIZE)) ; palette=0*32 | 32-(width=6) 417 27000 - sta temp3 ; palette/width 418 27000 - lda #(72+(4*(6-SCORESIZE))) 419 27000 - sta temp4 ; X 420 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 421 27000 - sta temp5 ; Y 422 27000 - lda #HSRAMScores 425 27000 - sta temp8 ; score variable hi 426 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 427 27000 - sta temp9 428 27000 -plothsscoresloop 429 27000 - lda #<(hiscorefont+33) ; +33 to get to '0' character 430 27000 - sta temp1 ; charmaplo 431 27000 - lda #>(hiscorefont+33) 432 27000 - sta temp2 ; charmaphi 433 27000 - lda #6 434 27000 - sta temp6 435 27000 - ifnconst DOUBLEWIDE 436 27000 - jsr plotvalue 437 27000 - else 438 27000 - jsr plotvaluedw 439 27000 - endif 440 27000 - clc 441 27000 - lda temp3 442 27000 - adc #32 443 27000 - sta temp3 444 27000 - inc temp5 445 27000 - if WZONEHEIGHT = 8 446 27000 - inc temp5 447 27000 - endif 448 27000 - clc 449 27000 - lda #3 450 27000 - adc temp7 451 27000 - sta temp7 452 27000 - cmp #(<(HSRAMScores+15)) 453 27000 - bcc plothsscoresloop 454 27000 -plothsindex 455 27000 - lda #32+31 ; palette=0*32 | 32-(width=1) 456 27000 - sta temp3 ; palette/width 457 27000 - lda #44 458 27000 - sta temp4 ; X 459 27000 - lda #((HSSCOREY+6)/(WZONEHEIGHT/8)) 460 27000 - sta temp5 ; Y 461 27000 - lda #hsgameslotnumbers 464 27000 - sta temp8 ; score variable hi 465 27000 - lda #(hiscorefont_mode | %01100000) ; charactermode 466 27000 - sta temp9 467 27000 -plothsindexloop 468 27000 - lda #<(hiscorefont+33) 469 27000 - sta temp1 ; charmaplo 470 27000 - lda #>(hiscorefont+33) 471 27000 - sta temp2 ; charmaphi 472 27000 - lda #1 473 27000 - sta temp6 ; number of characters 474 27000 - ifnconst DOUBLEWIDE 475 27000 - jsr plotvalue 476 27000 - else 477 27000 - jsr plotvaluedw 478 27000 - endif 479 27000 - clc 480 27000 - lda temp3 481 27000 - adc #32 482 27000 - sta temp3 483 27000 - inc temp5 484 27000 - if WZONEHEIGHT = 8 485 27000 - inc temp5 486 27000 - endif 487 27000 - inc temp7 488 27000 - lda temp7 489 27000 - cmp #(<(hsgameslotnumbers+5)) 490 27000 - bcc plothsindexloop 491 27000 - 492 27000 - jsr savescreen 493 27000 - ifnconst HSSECONDS 494 27000 - lda #6 495 27000 - else 496 27000 - lda #HSSECONDS 497 27000 - endif 498 27000 - 499 27000 - sta countdownseconds 500 27000 - 501 27000 -keepdisplayinghs 502 27000 - jsr restorescreen 503 27000 - 504 27000 - jsr setuphsinpt1 505 27000 - 506 27000 - lda hsnewscoreline 507 27000 - bpl carryonkeepdisplayinghs 508 27000 - jmp skipenterscorecontrol 509 27000 -carryonkeepdisplayinghs 510 27000 - 511 27000 - 512 27000 - ifnconst HSSECONDS 513 27000 - lda #6 514 27000 - else 515 27000 - lda #HSSECONDS 516 27000 - endif 517 27000 - 518 27000 - sta countdownseconds 519 27000 - 520 27000 - ;plot the "cursor" initial sprite... 521 27000 - lda hsinitialhold 522 27000 - 523 27000 - sta temp1 524 27000 - lda #>(hiscorefont+32) 525 27000 - sta temp2 526 27000 - lda #31 ; palette=0*32 | 32-(width=1) 527 27000 - sta temp3 ; palette/width 528 27000 - lda hscursorx 529 27000 - asl 530 27000 - asl 531 27000 - clc 532 27000 - adc #104 533 27000 - sta temp4 ; X 534 27000 - lda hsnewscoreline 535 27000 - asl 536 27000 - asl 537 27000 - asl 538 27000 - asl 539 27000 - adc #((3*16)+HSCURSORY) 540 27000 - sta temp5 ; Y 541 27000 - lda #%01000000 542 27000 - sta temp6 543 27000 - jsr plotsprite 544 27000 - 545 27000 - ldx hscursorx 546 27000 - ldy hsdisplaymode 547 27000 - lda SWCHA 548 27000 - cpy #3 549 27000 - bne hsskipadjustjoystick1 550 27000 - asl 551 27000 - asl 552 27000 - asl 553 27000 - asl 554 27000 -hsskipadjustjoystick1 555 27000 - sta hsswcha 556 27000 - lda SWCHB 557 27000 - and #%00000010 558 27000 - bne hsskipselectswitch 559 27000 - lda #%00010000 560 27000 - sta hsswcha 561 27000 - bne hsdodebouncecheck 562 27000 -hsskipselectswitch 563 27000 - lda hsswcha 564 27000 - and #%00110000 565 27000 - cmp #%00110000 566 27000 - beq hsjoystickskipped 567 27000 -hsdodebouncecheck 568 27000 - lda hsjoydebounce 569 27000 - beq hsdontdebounce 570 27000 - jmp hspostjoystick 571 27000 -hsdontdebounce 572 27000 - ldx #1 ; small tick sound 573 27000 - jsr playhssfx 574 27000 - lda hsswcha 575 27000 - and #%00110000 576 27000 - ldx hscursorx 577 27000 - cmp #%00100000 ; check down 578 27000 - bne hsjoycheckup 579 27000 - ldy hsinitialhold 580 27000 - cpx #0 581 27000 - bne skipavoid31_1 582 27000 - cpy #0 ; if we're about to change to the <- char (#31) then double-decrement to skip over it 583 27000 - bne skipavoid31_1 584 27000 - dey 585 27000 -skipavoid31_1 586 27000 - dey 587 27000 - jmp hssetdebounce 588 27000 -hsjoycheckup 589 27000 - cmp #%00010000 ; check up 590 27000 - bne hsjoystickskipped 591 27000 - ldy hsinitialhold 592 27000 - cpx #0 593 27000 - bne skipavoid31_2 594 27000 - cpy #30 ; if we're about to change to the <- char (#31) then double-increment to skip over it 595 27000 - bne skipavoid31_2 596 27000 - iny 597 27000 -skipavoid31_2 598 27000 - iny 599 27000 -hssetdebounce 600 27000 - tya 601 27000 - and #31 602 27000 - sta hsinitialhold 603 27000 - lda #15 604 27000 - sta hsjoydebounce 605 27000 - bne hspostjoystick 606 27000 -hsjoystickskipped 607 27000 - ; check the fire button only when the stick isn't engaged 608 27000 - lda hsinpt1 609 27000 - bpl hsbuttonskipped 610 27000 - lda hsjoydebounce 611 27000 - beq hsfiredontdebounce 612 27000 - bne hspostjoystick 613 27000 -hsfiredontdebounce 614 27000 - lda hsinitialhold 615 27000 - cmp #31 616 27000 - beq hsmovecursorback 617 27000 - inc hscursorx 618 27000 - inc hsinitialpos 619 27000 - lda hscursorx 620 27000 - cmp #3 621 27000 - bne skiphsentryisdone 622 27000 - lda #0 623 27000 - sta framecounter 624 27000 - lda #$ff 625 27000 - sta hsnewscoreline 626 27000 - dec hsinitialpos 627 27000 - bne skiphsentryisdone 628 27000 -hsmovecursorback 629 27000 - lda hscursorx 630 27000 - beq skiphsmovecursorback 631 27000 - lda #29 632 27000 - ldx hsinitialpos 633 27000 - sta HSRAMInitials,x 634 27000 - dec hsinitialpos 635 27000 - dec hscursorx 636 27000 - dex 637 27000 - lda HSRAMInitials,x 638 27000 - sta hsinitialhold 639 27000 -skiphsmovecursorback 640 27000 -skiphsentryisdone 641 27000 - ldx #0 642 27000 - jsr playhssfx 643 27000 - lda #20 644 27000 - sta hsjoydebounce 645 27000 - bne hspostjoystick 646 27000 - 647 27000 -hsbuttonskipped 648 27000 - lda #0 649 27000 - sta hsjoydebounce 650 27000 -hspostjoystick 651 27000 - 652 27000 - ldx hsinitialpos 653 27000 - lda hsinitialhold 654 27000 - sta HSRAMInitials,x 655 27000 - 656 27000 - jmp skiphschasecolors 657 27000 - 658 27000 -skipenterscorecontrol 659 27000 - jsr hschasecolors 660 27000 - jsr setuphsinpt1 661 27000 - lda hsjoydebounce 662 27000 - bne skiphschasecolors 663 27000 - lda hsinpt1 664 27000 - bmi returnfromhs 665 27000 -skiphschasecolors 666 27000 - 667 27000 - jsr drawscreen 668 27000 - 669 27000 - lda countdownseconds 670 27000 - beq returnfromhs 671 27000 - jmp keepdisplayinghs 672 27000 -returnfromhs 673 27000 - 674 27000 - ifconst songdatastart_song_highscore 675 27000 - lda hsdisplaymode 676 27000 - beq skipclearHSCsong 677 27000 - lda #0 678 27000 - sta songtempo 679 27000 -skipclearHSCsong 680 27000 - endif 681 27000 - jsr drawwait 682 27000 - jsr clearscreen 683 27000 - lda #0 684 27000 - ldy #7 685 27000 - jsr blacken320colors 686 27000 - lda ssCTRL 687 27000 - sta sCTRL 688 27000 - lda ssCHARBASE 689 27000 - sta sCHARBASE 690 27000 - rts 691 27000 - 692 27000 -setuphsinpt1 693 27000 - lda #$ff 694 27000 - sta hsinpt1 695 27000 - lda hsjoydebounce 696 27000 - beq skipdebounceadjust 697 27000 - dec hsjoydebounce 698 27000 - bne skipstorefirebuttonstatus 699 27000 -skipdebounceadjust 700 27000 - lda SWCHB 701 27000 - and #%00000001 702 27000 - bne hscheckresetover 703 27000 - lda #$ff 704 27000 - sta hsinpt1 705 27000 - rts 706 27000 -hscheckresetover 707 27000 - ldx hsdisplaymode 708 27000 - cpx #3 709 27000 - bne hsskipadjustjoyfire1 710 27000 - lda sINPT3 711 27000 - jmp hsskipadjustjoyfire1done 712 27000 -hsskipadjustjoyfire1 713 27000 - lda sINPT1 714 27000 -hsskipadjustjoyfire1done 715 27000 - sta hsinpt1 716 27000 -skipstorefirebuttonstatus 717 27000 - rts 718 27000 - 719 27000 -blacken320colors 720 27000 - ldy #7 721 27000 -blacken320colorsloop 722 27000 - sta P0C2,y 723 27000 - dey 724 27000 - bpl blacken320colorsloop 725 27000 - rts 726 27000 - 727 27000 -hschasecolors 728 27000 - lda framecounter 729 27000 - and #3 730 27000 - bne hschasecolorsreturn 731 27000 - inc hscolorchaseindex 732 27000 - lda hscolorchaseindex 733 27000 - 734 27000 - sta P5C2 735 27000 - sbc #$02 736 27000 - sta P4C2 737 27000 - sbc #$02 738 27000 - sta P3C2 739 27000 - sbc #$02 740 27000 - sta P2C2 741 27000 - sbc #$02 742 27000 - sta P1C2 743 27000 -hschasecolorsreturn 744 27000 - rts 745 27000 - 746 27000 -playhssfx 747 27000 - lda hssfx_lo,x 748 27000 - sta temp1 749 27000 - lda hssfx_hi,x 750 27000 - sta temp2 751 27000 - lda #0 752 27000 - sta temp3 753 27000 - jmp schedulesfx 754 27000 - 755 27000 -hssfx_lo 756 27000 - .byte sfx_hsletterpositionchange, >sfx_hslettertick 759 27000 - 760 27000 -sfx_hsletterpositionchange 761 27000 - .byte $10,$18,$00 762 27000 - .byte $02,$06,$08 763 27000 - .byte $02,$06,$04 764 27000 - .byte $00,$00,$00 765 27000 -sfx_hslettertick 766 27000 - .byte $10,$18,$00 767 27000 - .byte $00,$00,$0a 768 27000 - .byte $00,$00,$00 769 27000 - 770 27000 -highscorelabeladjust1 771 27000 - .byte (80-(14*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)),(80-(16*2)-(SCORESIZE*2)) 772 27000 -highscorelabeladjust2 773 27000 - .byte (80+(14*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)),(80+(16*2)-(SCORESIZE*2)) 774 27000 - 775 27000 -scorevarlo 776 27000 - .byte <(score0+((6-SCORESIZE)/2)),<(score0+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)),<(score1+((6-SCORESIZE)/2)) 777 27000 -scorevarhi 778 27000 - .byte >(score0+((6-SCORESIZE)/2)),>(score0+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)),>(score1+((6-SCORESIZE)/2)) 779 27000 - 780 27000 - ifnconst HSNOLEVELNAMES 781 27000 -highscoredifficultytextlo 782 27000 - .byte easylevelname, >mediumlevelname, >hardlevelname, >expertlevelname 785 27000 - ifnconst HSCUSTOMLEVELNAMES 786 27000 -highscoredifficultytextlen 787 27000 - .byte 22, 30, 26, 24 788 27000 - 789 27000 -easylevelname 790 27000 - .byte $04,$00,$12,$18,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 791 27000 -mediumlevelname 792 27000 - .byte $08,$0d,$13,$04,$11,$0c,$04,$03,$08,$00,$13,$04,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 793 27000 -hardlevelname 794 27000 - .byte $00,$03,$15,$00,$0d,$02,$04,$03,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 795 27000 -expertlevelname 796 27000 - .byte $04,$17,$0f,$04,$11,$13,$1d,$0b,$04,$15,$04,$0b,$1d,$07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 797 27000 - else 798 27000 - include "7800hsgamediffnames.asm" 799 27000 - endif ; HSCUSTOMLEVELNAMES 800 27000 - else 801 27000 -HSHIGHSCOREStext 802 27000 - .byte $07,$08,$06,$07,$1d,$12,$02,$0e,$11,$04,$12 803 27000 - endif ; HSNOLEVELNAMES 804 27000 - 805 27000 -highscorelabeltextlo 806 27000 - .byte player0label, >player1label, >player2label, >player2label 809 27000 - 810 27000 -player0label 811 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$12,$02,$0e,$11,$04,$1a,$1d,$1d 812 27000 - 813 27000 -player1label 814 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$22,$1d,$12,$02,$0e,$11,$04,$1a 815 27000 - 816 27000 -player2label 817 27000 - .byte $0f,$0b,$00,$18,$04,$11,$1d,$23,$1d,$12,$02,$0e,$11,$04,$1a 818 27000 - 819 27000 - 820 27000 - ifconst HSGAMENAMELEN 821 27000 -HSGAMENAMEtable 822 27000 - include "7800hsgamename.asm" 823 27000 - endif 824 27000 - ifconst HSGAMERANKS 825 27000 - include "7800hsgameranks.asm" 826 27000 -highscoreranklabel 827 27000 - .byte $11,$00,$0d,$0a,$1a 828 27000 - endif 829 27000 - 830 27000 - ;ensure our table doesn't wrap a page... 831 27000 - if ((<*)>251) 832 27000 - align 256 833 27000 - endif 834 27000 -hsgameslotnumbers 835 27000 - .byte 33,34,35,36,37 836 27000 - endif 837 27000 - 838 27000 -loaddifficultytable 839 27000 - lda gamedifficulty 840 27000 - and #$03 ; ensure the user hasn't selected an invalid difficulty 841 27000 - sta gamedifficulty 842 27000 - cmp hsdifficulty ; check game difficulty is the same as RAM table 843 27000 - bne loaddifficultytablecontinue1 844 27000 - rts ; this high score difficulty table is already loaded 845 27000 -loaddifficultytablecontinue1 846 27000 - lda gamedifficulty 847 27000 - sta hsdifficulty 848 27000 - ;we need to check the device for the table 849 27000 - lda hsdevice 850 27000 - bne loaddifficultytablecontinue2 851 27000 - ; there's no save device. clear out this table. 852 27000 - jmp cleardifficultytablemem 853 27000 -loaddifficultytablecontinue2 854 27000 - lda hsdevice 855 27000 - and #1 856 27000 - beq memdeviceisntHSC 857 27000 - jmp loaddifficultytableHSC 858 27000 -memdeviceisntHSC 859 27000 - jmp loaddifficultytableAVOX 860 27000 - 861 27000 -savedifficultytable 862 27000 - ;*** we need to check wich device we should use... 863 27000 - lda hsdevice 864 27000 - bne savedifficultytablerealdevice 865 27000 - rts ; its a ram device 866 27000 -savedifficultytablerealdevice 867 27000 - and #1 868 27000 - beq savememdeviceisntHSC 869 27000 - jmp savedifficultytableHSC 870 27000 -savememdeviceisntHSC 871 27000 - jmp savedifficultytableAVOX 872 27000 - 873 27000 -savedifficultytableAVOX 874 27000 - ; the load call already setup the memory structure and atarivox memory location 875 27000 - jsr savealoadedHSCtablecontinue 876 27000 -savedifficultytableAVOXskipconvert 877 27000 - lda #HSIDHI 878 27000 - sta eeprombuffer 879 27000 - lda #HSIDLO 880 27000 - sta eeprombuffer+1 881 27000 - lda hsdifficulty 882 27000 - sta eeprombuffer+2 883 27000 - lda #32 884 27000 - jsr AVoxWriteBytes 885 27000 - rts 886 27000 - 887 27000 -savedifficultytableHSC 888 27000 - ;we always load a table before reaching here, so the 889 27000 - ;memory structures from the load should be intact... 890 27000 - ldy hsgameslot 891 27000 - bpl savealoadedHSCtable 892 27000 - rts 893 27000 -savealoadedHSCtable 894 27000 - lda HSCGameDifficulty,y 895 27000 - cmp #$7F 896 27000 - bne savealoadedHSCtablecontinue 897 27000 - jsr initializeHSCtableentry 898 27000 -savealoadedHSCtablecontinue 899 27000 - ;convert our RAM table to HSC format and write it out... 900 27000 - ldy #0 901 27000 - ldx #0 902 27000 -savedifficultytableScores 903 27000 - 904 27000 - lda HSRAMInitials,x 905 27000 - sta temp3 906 27000 - lda HSRAMInitials+1,x 907 27000 - sta temp4 908 27000 - lda HSRAMInitials+2,x 909 27000 - sta temp5 910 27000 - jsr encodeHSCInitials ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 911 27000 - 912 27000 - lda temp1 913 27000 - sta (HSGameTableLo),y 914 27000 - iny 915 27000 - lda temp2 916 27000 - sta (HSGameTableLo),y 917 27000 - iny 918 27000 - 919 27000 - lda HSRAMScores,x 920 27000 - sta (HSGameTableLo),y 921 27000 - iny 922 27000 - lda HSRAMScores+1,x 923 27000 - sta (HSGameTableLo),y 924 27000 - iny 925 27000 - lda HSRAMScores+2,x 926 27000 - sta (HSGameTableLo),y 927 27000 - iny 928 27000 - inx 929 27000 - inx 930 27000 - inx ; +3 931 27000 - cpx #15 932 27000 - bne savedifficultytableScores 933 27000 - rts 934 27000 - 935 27000 -loaddifficultytableHSC 936 27000 - ; routine responsible for loading the difficulty table from HSC 937 27000 - jsr findindexHSC 938 27000 - ldy hsgameslot 939 27000 - lda HSCGameDifficulty,y 940 27000 - cmp #$7F 941 27000 - bne loaddifficultytableHSCcontinue 942 27000 - ;there was an error. use a new RAM table instead... 943 27000 - jsr initializeHSCtableentry 944 27000 - jmp cleardifficultytablemem 945 27000 -loaddifficultytableHSCcontinue 946 27000 - ; parse the data into the HS memory... 947 27000 - ldy #0 948 27000 - ldx #0 949 27000 -loaddifficultytableScores 950 27000 - lda (HSGameTableLo),y 951 27000 - sta temp1 952 27000 - iny 953 27000 - lda (HSGameTableLo),y 954 27000 - sta temp2 955 27000 - jsr decodeHSCInitials ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 956 27000 - iny 957 27000 - lda (HSGameTableLo),y 958 27000 - sta HSRAMScores,x 959 27000 - lda temp3 960 27000 - sta HSRAMInitials,x 961 27000 - inx 962 27000 - iny 963 27000 - lda (HSGameTableLo),y 964 27000 - sta HSRAMScores,x 965 27000 - lda temp4 966 27000 - sta HSRAMInitials,x 967 27000 - inx 968 27000 - iny 969 27000 - lda (HSGameTableLo),y 970 27000 - sta HSRAMScores,x 971 27000 - lda temp5 972 27000 - sta HSRAMInitials,x 973 27000 - inx 974 27000 - iny 975 27000 - cpx #15 976 27000 - bne loaddifficultytableScores 977 27000 - rts 978 27000 - 979 27000 -decodeHSCInitials 980 27000 - ; takes 2 byte initials from temp1,2 and stores 3 byte initials in temp3,4,5 981 27000 - ; 2 bytes are packed in the form: 22211111 22_33333 982 27000 - lda #0 983 27000 - sta temp4 984 27000 - lda temp1 985 27000 - and #%00011111 986 27000 - sta temp3 987 27000 - 988 27000 - lda temp2 989 27000 - and #%00011111 990 27000 - sta temp5 991 27000 - 992 27000 - lda temp1 993 27000 - asl 994 27000 - rol temp4 995 27000 - asl 996 27000 - rol temp4 997 27000 - asl 998 27000 - rol temp4 999 27000 - lda temp2 1000 27000 - asl 1001 27000 - rol temp4 1002 27000 - asl 1003 27000 - rol temp4 1004 27000 - rts 1005 27000 -encodeHSCInitials 1006 27000 - ; takes 3 byte initials from temp3,4,5 and stores 2 byte initials in temp1,2 1007 27000 - ; 2 bytes are packed in the form: 22211111 22_33333 1008 27000 - ; start with packing temp1... 1009 27000 - lda temp4 1010 27000 - and #%00011100 1011 27000 - sta temp1 1012 27000 - asl temp1 1013 27000 - asl temp1 1014 27000 - asl temp1 1015 27000 - lda temp3 1016 27000 - and #%00011111 1017 27000 - ora temp1 1018 27000 - sta temp1 1019 27000 - ; ...temp1 is now packed, on to temp2... 1020 27000 - lda temp5 1021 27000 - asl 1022 27000 - asl 1023 27000 - ror temp4 1024 27000 - ror 1025 27000 - ror temp4 1026 27000 - ror 1027 27000 - sta temp2 1028 27000 - rts 1029 27000 - 1030 27000 -findindexHSCerror 1031 27000 - ;the HSC is stuffed. return the bad slot flag 1032 27000 - ldy #$ff 1033 27000 - sty hsgameslot 1034 27000 - rts 1035 27000 - 1036 27000 -findindexHSC 1037 27000 -HSCGameID1 = $1029 1038 27000 -HSCGameID2 = $106E 1039 27000 -HSCGameDifficulty = $10B3 1040 27000 -HSCGameIndex = $10F8 1041 27000 - ; routine responsible for finding the game index from HSC 1042 27000 - ; call with x=0 to create a new table if none exist, call with x=$ff to avoid creating new tables 1043 27000 - ; the HS loading routine will use x=$ff, the HS saving routine will use x=0 1044 27000 - ldy #69 ; start +1 to account for the dey 1045 27000 -findindexHSCloop 1046 27000 - dey 1047 27000 - bmi findindexHSCerror 1048 27000 - lda HSCGameDifficulty,y 1049 27000 - cmp #$7F 1050 27000 - beq findourindexHSC 1051 27000 - cmp gamedifficulty 1052 27000 - bne findindexHSCloop 1053 27000 - lda HSCGameID1,y 1054 27000 - cmp #HSIDHI 1055 27000 - bne findindexHSCloop 1056 27000 - lda HSCGameID2,y 1057 27000 - cmp #HSIDLO 1058 27000 - bne findindexHSCloop 1059 27000 -findourindexHSC 1060 27000 - ; if we're here we found our index in the table 1061 27000 - ; or we found the first empty one 1062 27000 - sty hsgameslot 1063 27000 - jsr setupHSCGamepointer ; setup the pointer to the HS Table for this game... 1064 27000 - rts 1065 27000 - 1066 27000 - 1067 27000 -initializeHSCtableentry 1068 27000 - ldy hsgameslot 1069 27000 - ; we need to make a new entry... 1070 27000 - lda #HSIDHI 1071 27000 - sta HSCGameID1,y 1072 27000 - lda #HSIDLO 1073 27000 - sta HSCGameID2,y 1074 27000 - lda gamedifficulty 1075 27000 - sta HSCGameDifficulty,y 1076 27000 - ldx #0 1077 27000 -fixHSDGameDifficultylistLoop 1078 27000 - inx 1079 27000 - txa 1080 27000 - sta HSCGameIndex,y 1081 27000 - iny 1082 27000 - cpy #69 1083 27000 - bne fixHSDGameDifficultylistLoop 1084 27000 - rts 1085 27000 - 1086 27000 -setupHSCGamepointer 1087 27000 - ; this routines sets (HSGameTableLo) pointing to the game's HS table 1088 27000 - lda #$17 1089 27000 - sta HSGameTableHi 1090 27000 - lda #$FA 1091 27000 - sta HSGameTableLo 1092 27000 -setupHSCGamepointerLoop 1093 27000 - lda HSGameTableLo 1094 27000 - sec 1095 27000 - sbc #25 1096 27000 - sta HSGameTableLo 1097 27000 - lda HSGameTableHi 1098 27000 - sbc #0 1099 27000 - sta HSGameTableHi 1100 27000 - iny 1101 27000 - cpy #69 1102 27000 - bne setupHSCGamepointerLoop 1103 27000 - rts 1104 27000 - 1105 27000 -loaddifficultytableAVOX 1106 27000 - ; routine responsible for loading the difficulty table from Avox 1107 27000 - ; we reuse HSC routines to format data to/from our Avox RAM buffer... 1108 27000 - lda #>(eeprombuffer+3) 1109 27000 - sta HSGameTableHi 1110 27000 - lda #<(eeprombuffer+3) 1111 27000 - sta HSGameTableLo 1112 27000 - 1113 27000 - ; the start location in EEPROM, subtract 32... 1114 27000 - lda #$5F 1115 27000 - sta HSVoxHi 1116 27000 - lda #$E0 1117 27000 - sta HSVoxLo 1118 27000 - lda #0 1119 27000 - sta temp1 1120 27000 -loaddifficultytableAVOXloop 1121 27000 - inc temp1 1122 27000 - beq loaddifficultytableAVOXfull 1123 27000 - clc 1124 27000 - lda HSVoxLo 1125 27000 - adc #32 1126 27000 - sta HSVoxLo 1127 27000 - lda HSVoxHi 1128 27000 - adc #0 1129 27000 - sta HSVoxHi 1130 27000 - lda #3 1131 27000 - jsr AVoxReadBytes ; read in 3 bytes, ID1,ID2,Difficulty 1132 27000 - lda eeprombuffer 1133 27000 - cmp #$FF 1134 27000 - beq loaddifficultytableAVOXempty 1135 27000 - cmp #HSIDHI 1136 27000 - bne loaddifficultytableAVOXloop 1137 27000 - lda eeprombuffer+1 1138 27000 - cmp #HSIDLO 1139 27000 - bne loaddifficultytableAVOXloop 1140 27000 - lda eeprombuffer+2 1141 27000 - cmp gamedifficulty 1142 27000 - bne loaddifficultytableAVOXloop 1143 27000 -loaddifficultytableAVOXdone 1144 27000 - lda #32 1145 27000 - jsr AVoxReadBytes 1146 27000 - jsr loaddifficultytableHSCcontinue 1147 27000 - rts 1148 27000 -loaddifficultytableAVOXfull 1149 27000 - lda #0 1150 27000 - sta hsdevice ; looks like all 255 entries are taken... disable it. 1151 27000 -loaddifficultytableAVOXempty 1152 27000 - jmp cleardifficultytablemem 1153 27000 - rts 1154 27000 - 1155 27000 -cleardifficultytablemem 1156 27000 - ldy #29 1157 27000 - lda #0 1158 27000 -cleardifficultytablememloop 1159 27000 - sta HSRAMTable,y 1160 27000 - dey 1161 27000 - bpl cleardifficultytablememloop 1162 27000 - rts 1163 27000 -hiscoremoduleend 1164 27000 - 1165 27000 - echo " hiscore assembly: ",[(hiscoremoduleend-hiscoremodulestart)]d," bytes" 1166 27000 - 1167 27000 - ifconst DOUBLEWIDE 1168 27000 -plotvaluedw 1169 27000 -plotdigitcount = temp6 1170 27000 - lda #0 1171 27000 - tay 1172 27000 - ldx valbufend 1173 27000 - 1174 27000 - lda plotdigitcount 1175 27000 - and #1 1176 27000 - beq pvnibble2chardw 1177 27000 - lda #0 1178 27000 - sta VALBUFFER,x ; just in case we skip this digit 1179 27000 - beq pvnibble2char_skipnibbledw 1180 27000 - 1181 27000 -pvnibble2chardw 1182 27000 - ; high nibble... 1183 27000 - lda (temp7),y 1184 27000 - and #$f0 1185 27000 - lsr 1186 27000 - lsr 1187 27000 - lsr 1188 27000 - lsr 1189 27000 - 1190 27000 - clc 1191 27000 - adc temp1 ; add the offset to character graphics to our value 1192 27000 - sta VALBUFFER,x 1193 27000 - inx 1194 27000 - dec plotdigitcount 1195 27000 -pvnibble2char_skipnibbledw 1196 27000 - ; low nibble... 1197 27000 - lda (temp7),y 1198 27000 - and #$0f 1199 27000 - clc 1200 27000 - adc temp1 ; add the offset to character graphics to our value 1201 27000 - sta VALBUFFER,x 1202 27000 - inx 1203 27000 - iny 1204 27000 - 1205 27000 - dec plotdigitcount 1206 27000 - bne pvnibble2chardw 1207 27000 - ;point to the start of our valuebuffer 1208 27000 - clc 1209 27000 - lda #VALBUFFER 1213 27000 - adc #0 1214 27000 - sta temp2 1215 27000 - 1216 27000 - ;advance valbufend to the end of our value buffer 1217 27000 - stx valbufend 1218 27000 - 1219 27000 - ifnconst plotvalueonscreen 1220 27000 - jmp plotcharacters 1221 27000 - else 1222 27000 - jmp plotcharacterslive 1223 27000 - endif 1224 27000 - endif ; DOUBLEWIDE 1225 27000 - 1226 27000 endif ; HSSUPPORT 1227 27000 ------- FILE c:\Users\Shane\Documents\my7800projects\shooting_demos\vertical\New_Vertical_Shooter_Rewrite3.78b.asm 5513 27000 endif 5514 27000 ; Provided under the CC0 license. See the included LICENSE.txt for details. 5515 27000 5516 27000 ;standard routimes needed for pretty much all games 5517 27000 5518 27000 ; some definitions used with "set debug color" 5519 27000 00 91 DEBUGCALC = $91 5520 27000 00 41 DEBUGWASTE = $41 5521 27000 00 c1 DEBUGDRAW = $C1 5522 27000 5523 27000 ;NMI and IRQ handlers 5524 27000 NMI 5525 27000 ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. 5526 27000 48 pha ; save A 5527 27001 d8 cld 5528 27002 a5 4d lda visibleover 5529 27004 49 ff eor #255 5530 27006 85 4d sta visibleover 5531 27008 - ifconst DEBUGINTERRUPT 5532 27008 - and #$93 5533 27008 - sta BACKGRND 5534 27008 endif 5535 27008 8a txa ; save X 5536 27009 48 pha 5537 2700a 98 tya ; save Y 5538 2700b 48 pha 5539 2700c ce b2 01 dec interruptindex 5540 2700f d0 03 bne skipreallyoffvisible 5541 27011 4c 6b f0 jmp reallyoffvisible 5542 27014 skipreallyoffvisible 5543 27014 a5 4d lda visibleover 5544 27016 d0 03 bne carryontopscreenroutine 5545 27018 - ifconst .bottomscreenroutine 5546 27018 - lda interrupthold 5547 27018 - beq skipbottomroutine 5548 27018 - jsr .bottomscreenroutine 5549 27018 -skipbottomroutine 5550 27018 endif 5551 27018 4c 79 f0 jmp NMIexit 5552 2701b carryontopscreenroutine 5553 2701b - ifconst .topscreenroutine 5554 2701b - lda interrupthold 5555 2701b - beq skiptoproutine 5556 2701b - jsr .topscreenroutine 5557 2701b -skiptoproutine 5558 2701b endif 5559 2701b ifnconst CANARYOFF 5560 2701b ad c1 01 lda canary 5561 2701e f0 07 beq skipcanarytriggered 5562 27020 a9 45 lda #$45 5563 27022 85 20 sta BACKGRND 5564 27024 4c 63 f0 jmp skipbrkolorset ; common crash dump routine, if available 5565 27027 skipcanarytriggered 5566 27027 endif 5567 27027 5568 27027 ee 3e 21 inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. 5569 2702a 5570 2702a ; ** Other important routines that need to regularly run, and can run onscreen. 5571 2702a ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. 5572 2702a 5573 2702a - ifconst LONGCONTROLLERREAD 5574 2702a -longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. 5575 2702a - ldy port1control 5576 2702a - lda longreadtype,y 5577 2702a - beq LLRET1 5578 2702a - tay 5579 2702a - lda longreadroutinehiP1,y 5580 2702a - sta inttemp4 5581 2702a - lda longreadroutineloP1,y 5582 2702a - sta inttemp3 5583 2702a - jmp (inttemp3) 5584 2702a -LLRET1 5585 2702a - ldy port0control 5586 2702a - lda longreadtype,y 5587 2702a - beq LLRET0 5588 2702a - tay 5589 2702a - lda longreadroutinehiP0,y 5590 2702a - sta inttemp4 5591 2702a - lda longreadroutineloP0,y 5592 2702a - sta inttemp3 5593 2702a - jmp (inttemp3) 5594 2702a -LLRET0 5595 2702a - 5596 2702a - 5597 2702a - ifconst PADDLERANGE 5598 2702a -TIMEVAL = PADDLERANGE 5599 2702a - else 5600 2702a -TIMEVAL = 160 5601 2702a - endif 5602 2702a -TIMEOFFSET = 10 5603 2702a - 5604 2702a endif ; LONGCONTROLLERREAD 5605 2702a 5606 2702a 5607 2702a 20 d8 f1 jsr servicesfxchannels 5608 2702d - ifconst MUSICTRACKER 5609 2702d - jsr servicesong 5610 2702d endif ; MUSICTRACKER 5611 2702d 5612 2702d ee a4 01 inc framecounter 5613 27030 ad a4 01 lda framecounter 5614 27033 29 3f and #63 5615 27035 d0 08 bne skipcountdownseconds 5616 27037 ad a5 01 lda countdownseconds 5617 2703a f0 03 beq skipcountdownseconds 5618 2703c ce a5 01 dec countdownseconds 5619 2703f skipcountdownseconds 5620 2703f 5621 2703f a2 01 ldx #1 5622 27041 buttonreadloop 5623 27041 8a txa 5624 27042 48 pha 5625 27043 bc b7 01 ldy port0control,x 5626 27046 b9 bb f1 lda buttonhandlerlo,y 5627 27049 85 da sta inttemp3 5628 2704b b9 b0 f1 lda buttonhandlerhi,y 5629 2704e 85 db sta inttemp4 5630 27050 05 da ora inttemp3 5631 27052 f0 03 beq buttonreadloopreturn 5632 27054 6c da 00 jmp (inttemp3) 5633 27057 buttonreadloopreturn 5634 27057 68 pla 5635 27058 aa tax 5636 27059 ca dex 5637 2705a 10 e5 bpl buttonreadloop 5638 2705c 5639 2705c - ifconst KEYPADSUPPORT 5640 2705c - jsr keypadrowselect 5641 2705c endif ; KEYPADSUPPORT 5642 2705c 5643 2705c 5644 2705c - ifconst DOUBLEBUFFER 5645 2705c - lda doublebufferminimumframeindex 5646 2705c - beq skipdoublebufferminimumframeindexadjust 5647 2705c - dec doublebufferminimumframeindex 5648 2705c -skipdoublebufferminimumframeindexadjust 5649 2705c endif 5650 2705c 5651 2705c 4c 79 f0 jmp NMIexit 5652 2705f 5653 2705f IRQ ; the only source of non-nmi interrupt should be the BRK opcode. 5654 2705f ifnconst BREAKPROTECTOFF 5655 2705f a9 1a lda #$1A 5656 27061 85 20 sta BACKGRND 5657 27063 skipbrkolorset 5658 27063 skipbrkdetected 5659 27063 a9 60 lda #$60 5660 27065 8d 07 21 sta sCTRL 5661 27068 85 3c sta CTRL 5662 2706a ifnconst hiscorefont 5663 2706a 02 .byte.b $02 ; KIL/JAM 5664 2706b - else ; hiscorefont is present 5665 2706b - ifconst CRASHDUMP 5666 2706b - bit MSTAT 5667 2706b - bpl skipbrkdetected ; wait for vblank to ensure we're clear of NMI 5668 2706b - 5669 2706b - ifconst dumpbankswitch 5670 2706b - lda dumpbankswitch 5671 2706b - pha 5672 2706b - endif 5673 2706b - 5674 2706b - ; bankswitch if needed, to get to the hiscore font 5675 2706b - ifconst bankswitchmode 5676 2706b - ifconst included.hiscore.asm.bank 5677 2706b - ifconst MCPDEVCART 5678 2706b - lda #($18 | included.hiscore.asm.bank) 5679 2706b - sta $3000 5680 2706b - else 5681 2706b - lda #(included.hiscore.asm.bank) 5682 2706b - sta $8000 5683 2706b - endif 5684 2706b - endif ; included.hiscore.asm.bank 5685 2706b - endif ; bankswitchmode 5686 2706b - 5687 2706b - ifconst DOUBLEBUFFER 5688 2706b - ;turn off double-buffering, if on... 5689 2706b - lda #>DLLMEM 5690 2706b - sta DPPH 5691 2706b - lda #hiscorefont 5735 2706b - sta CHARBASE 5736 2706b - sta sCHARBASE 5737 2706b - lda #%01000011 ;Enable DMA, mode=320A 5738 2706b - sta CTRL 5739 2706b - sta sCTRL 5740 2706b - .byte $02 ; KIL/JAM 5741 2706b -hiscorehexlut 5742 2706b - ; 0 1 2 3 4 5 6 7 8 9 A B C D E F 5743 2706b - .byte 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 1, 2, 3, 4, 5 5744 2706b -show2700 5745 2706b - ; lo mode hi width=29 x EODL 5746 2706b - .byte $00, %01100000, $27, 3, 20, 0,0,0 5747 2706b - else ; CRASHDUMP 5748 2706b - .byte $02 ; KIL/JAM 5749 2706b - endif ; crashdump 5750 2706b endif ; hiscorefont 5751 2706b - else 5752 2706b - RTI 5753 2706b endif 5754 2706b 5755 2706b - ifconst LONGCONTROLLERREAD 5756 2706b - 5757 2706b -longreadtype 5758 2706b - .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE 5759 2706b - .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD 5760 2706b - .byte 3, 3, 0 ; STMOUSE AMOUSE ATARIVOX 5761 2706b - 5762 2706b -longreadroutineloP0 5763 2706b - .byte LLRET0 ; 0 = no routine 5770 2706b - .byte >paddleport0update ; 1 = paddle 5771 2706b - .byte >trakball0update ; 2 = trackball 5772 2706b - .byte >mouse0update ; 3 = mouse 5773 2706b - 5774 2706b -longreadroutineloP1 5775 2706b - .byte LLRET1 ; 0 = no routine 5782 2706b - .byte >paddleport1update ; 1 = paddle 5783 2706b - .byte >trakball1update ; 2 = trackball 5784 2706b - .byte >mouse1update ; 3 = mouse 5785 2706b - 5786 2706b - 5787 2706b -SETTIM64T 5788 2706b - bne skipdefaulttime 5789 2706b - ifnconst PADDLESMOOTHINGOFF 5790 2706b - lda #(TIMEVAL+TIMEOFFSET+1) 5791 2706b - else 5792 2706b - lda #(TIMEVAL+TIMEOFFSET) 5793 2706b - endif 5794 2706b -skipdefaulttime 5795 2706b - tay 5796 2706b - dey 5797 2706b -.setTIM64Tloop 5798 2706b - sta TIM64T 5799 2706b - cpy INTIM 5800 2706b - bne .setTIM64Tloop 5801 2706b - rts 5802 2706b endif ; LONGCONTROLLERREAD 5803 2706b 5804 2706b reallyoffvisible 5805 2706b 85 24 sta WSYNC 5806 2706d 5807 2706d a9 00 lda #0 5808 2706f 85 4d sta visibleover 5809 27071 - ifconst DEBUGINTERRUPT 5810 27071 - sta BACKGRND 5811 27071 endif 5812 27071 5813 27071 a9 03 lda #3 5814 27073 8d b2 01 sta interruptindex 5815 27076 5816 27076 20 52 f1 jsr uninterruptableroutines 5817 27079 5818 27079 - ifconst .userinterrupt 5819 27079 - lda interrupthold 5820 27079 - beq skipuserintroutine 5821 27079 - jsr .userinterrupt 5822 27079 -skipuserintroutine 5823 27079 endif 5824 27079 5825 27079 - ifconst KEYPADSUPPORT 5826 27079 - jsr keypadcolumnread 5827 27079 endif 5828 27079 5829 27079 NMIexit 5830 27079 68 pla 5831 2707a a8 tay 5832 2707b 68 pla 5833 2707c aa tax 5834 2707d 68 pla 5835 2707e 40 RTI 5836 2707f 5837 2707f clearscreen 5838 2707f a2 17 ldx #(WZONECOUNT-1) 5839 27081 a9 00 lda #0 5840 27083 clearscreenloop 5841 27083 95 65 sta dlend,x 5842 27085 ca dex 5843 27086 10 fb bpl clearscreenloop 5844 27088 a9 00 lda #0 5845 2708a 8d ad 01 sta valbufend ; clear the bcd value buffer 5846 2708d 8d ae 01 sta valbufendsave 5847 27090 60 rts 5848 27091 5849 27091 restorescreen 5850 27091 a2 17 ldx #(WZONECOUNT-1) 5851 27093 a9 00 lda #0 5852 27095 restorescreenloop 5853 27095 b5 82 lda dlendsave,x 5854 27097 95 65 sta dlend,x 5855 27099 ca dex 5856 2709a 10 f9 bpl restorescreenloop 5857 2709c ad ae 01 lda valbufendsave 5858 2709f 8d ad 01 sta valbufend 5859 270a2 60 rts 5860 270a3 5861 270a3 savescreen 5862 270a3 a2 17 ldx #(WZONECOUNT-1) 5863 270a5 savescreenloop 5864 270a5 b5 65 lda dlend,x 5865 270a7 95 82 sta dlendsave,x 5866 270a9 ca dex 5867 270aa 10 f9 bpl savescreenloop 5868 270ac ad ad 01 lda valbufend 5869 270af 8d ae 01 sta valbufendsave 5870 270b2 - ifconst DOUBLEBUFFER 5871 270b2 - lda doublebufferstate 5872 270b2 - beq savescreenrts 5873 270b2 - lda #1 5874 270b2 - sta doublebufferbufferdirty 5875 270b2 -savescreenrts 5876 270b2 endif ; DOUBLEBUFFER 5877 270b2 60 rts 5878 270b3 5879 270b3 drawscreen 5880 270b3 5881 270b3 - ifconst interrupthold 5882 270b3 - lda #$FF 5883 270b3 - sta interrupthold ; if the user called drawscreen, we're ready for interrupts 5884 270b3 endif 5885 270b3 5886 270b3 a9 00 lda #0 5887 270b5 85 42 sta temp1 ; not B&W if we're here... 5888 270b7 5889 270b7 drawscreenwait 5890 270b7 a5 4d lda visibleover 5891 270b9 d0 fc bne drawscreenwait ; make sure the visible screen isn't being drawn 5892 270bb 5893 270bb ;restore some registers in case the game changed them mid-screen... 5894 270bb ad 07 21 lda sCTRL 5895 270be 05 42 ora temp1 5896 270c0 85 3c sta CTRL 5897 270c2 ad 0b 21 lda sCHARBASE 5898 270c5 85 34 sta CHARBASE 5899 270c7 5900 270c7 ;ensure all of the display list is terminated... 5901 270c7 20 38 f1 jsr terminatedisplaylist 5902 270ca 5903 270ca ifnconst pauseroutineoff 5904 270ca 20 d5 f0 jsr pauseroutine 5905 270cd endif ; pauseroutineoff 5906 270cd 5907 270cd ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen 5908 270cd ; delaying a full frame, but still allowing time for basic calculations. 5909 270cd visiblescreenstartedwait 5910 270cd a5 4d lda visibleover 5911 270cf f0 fc beq visiblescreenstartedwait 5912 270d1 visiblescreenstartedwaitdone 5913 270d1 ce 3e 21 dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen 5914 270d4 60 rts 5915 270d5 5916 270d5 ifnconst pauseroutineoff 5917 270d5 ; check to see if pause was pressed and released 5918 270d5 pauseroutine 5919 270d5 ad b3 01 lda pausedisable 5920 270d8 d0 4e bne leavepauseroutine 5921 270da a9 08 lda #8 5922 270dc 2c 82 02 bit SWCHB 5923 270df f0 29 beq pausepressed 5924 270e1 5925 270e1 ifnconst SOFTRESETASPAUSEOFF 5926 270e1 ifnconst MOUSESUPPORT 5927 270e1 ifnconst TRAKBALLSUPPORT 5928 270e1 ad 80 02 lda SWCHA ; then check the soft "RESET" joysick code... 5929 270e4 29 70 and #%01110000 ; _LDU 5930 270e6 f0 22 beq pausepressed 5931 270e8 endif 5932 270e8 endif 5933 270e8 endif 5934 270e8 5935 270e8 ;pause isn't pressed 5936 270e8 a9 00 lda #0 5937 270ea 8d ac 01 sta pausebuttonflag ; clear pause hold state in case its set 5938 270ed 5939 270ed ;check if we're in an already paused state 5940 270ed ad 00 21 lda pausestate 5941 270f0 f0 36 beq leavepauseroutine ; nope, leave 5942 270f2 5943 270f2 c9 01 cmp #1 ; last frame was the start of pausing 5944 270f4 f0 2b beq enterpausestate2 ; move from state 1 to 2 5945 270f6 5946 270f6 c9 02 cmp #2 5947 270f8 f0 34 beq carryonpausing 5948 270fa 5949 270fa ;pausestate must be >2, which means we're ending an unpause 5950 270fa a9 00 lda #0 5951 270fc 8d ac 01 sta pausebuttonflag 5952 270ff 8d 00 21 sta pausestate 5953 27102 ad 07 21 lda sCTRL 5954 27105 85 3c sta CTRL 5955 27107 4c 28 f1 jmp leavepauseroutine 5956 2710a 5957 2710a pausepressed 5958 2710a ;pause is pressed 5959 2710a ad ac 01 lda pausebuttonflag 5960 2710d c9 ff cmp #$ff 5961 2710f f0 1d beq carryonpausing 5962 27111 5963 27111 ;its a new press, increment the state 5964 27111 ee 00 21 inc pausestate 5965 27114 5966 27114 ;silence volume at the start and end of pausing 5967 27114 a9 00 lda #0 5968 27116 85 19 sta AUDV0 5969 27118 85 1a sta AUDV1 5970 2711a 5971 2711a - ifconst pokeysupport 5972 2711a - ldy #7 5973 2711a -pausesilencepokeyaudioloop 5974 2711a - sta (pokeybase),y 5975 2711a - dey 5976 2711a - bpl pausesilencepokeyaudioloop 5977 2711a endif ; pokeysupport 5978 2711a 5979 2711a a9 ff lda #$ff 5980 2711c 8d ac 01 sta pausebuttonflag 5981 2711f d0 0d bne carryonpausing 5982 27121 5983 27121 enterpausestate2 5984 27121 a9 02 lda #2 5985 27123 8d 00 21 sta pausestate 5986 27126 d0 06 bne carryonpausing 5987 27128 leavepauseroutine 5988 27128 ad 07 21 lda sCTRL 5989 2712b 85 3c sta CTRL 5990 2712d 60 rts 5991 2712e carryonpausing 5992 2712e - ifconst .pause 5993 2712e - jsr .pause 5994 2712e endif ; .pause 5995 2712e ad 07 21 lda sCTRL 5996 27131 09 80 ora #%10000000 ; turn off colorburst during pause... 5997 27133 85 3c sta CTRL 5998 27135 4c d5 f0 jmp pauseroutine 5999 27138 endif ; pauseroutineoff 6000 27138 6001 27138 6002 27138 - ifconst DOUBLEBUFFER 6003 27138 -skipterminatedisplaylistreturn 6004 27138 - rts 6005 27138 endif ; DOUBLEBUFFER 6006 27138 terminatedisplaylist 6007 27138 - ifconst DOUBLEBUFFER 6008 27138 - lda doublebufferstate 6009 27138 - bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code 6010 27138 endif ; DOUBLEBUFFER 6011 27138 terminatedisplaybuffer 6012 27138 ;add DL end entry on each DL 6013 27138 a2 17 ldx #(WZONECOUNT-1) 6014 2713a dlendloop 6015 2713a bd 7b f6 lda DLPOINTL,x 6016 2713d - ifconst DOUBLEBUFFER 6017 2713d - clc 6018 2713d - adc doublebufferdloffset 6019 2713d endif ; DOUBLEBUFFER 6020 2713d 85 63 sta dlpnt 6021 2713f bd 63 f6 lda DLPOINTH,x 6022 27142 - ifconst DOUBLEBUFFER 6023 27142 - adc #0 6024 27142 endif ; DOUBLEBUFFER 6025 27142 85 64 sta dlpnt+1 6026 27144 b4 65 ldy dlend,x 6027 27146 a9 00 lda #$00 6028 27148 dlendmoreloops 6029 27148 c8 iny 6030 27149 91 63 sta (dlpnt),y 6031 2714b - ifconst FRAMESKIPGLITCHFIXWEAK 6032 2714b - cpy #DLLASTOBJ+1 6033 2714b - beq dlendthiszonedone 6034 2714b - iny 6035 2714b - iny 6036 2714b - iny 6037 2714b - iny 6038 2714b - iny 6039 2714b - sta (dlpnt),y 6040 2714b -dlendthiszonedone 6041 2714b endif FRAMESKIPGLITCHFIXWEAK 6042 2714b - ifconst FRAMESKIPGLITCHFIX 6043 2714b - iny 6044 2714b - iny 6045 2714b - iny 6046 2714b - iny 6047 2714b - cpy #DLLASTOBJ-1 6048 2714b - bcc dlendmoreloops 6049 2714b endif ; FRAMESKIPGLITCHFIX 6050 2714b ca dex 6051 2714c 10 ec bpl dlendloop 6052 2714e 6053 2714e ifnconst pauseroutineoff 6054 2714e 20 d5 f0 jsr pauseroutine 6055 27151 endif ; pauseroutineoff 6056 27151 60 rts 6057 27152 6058 27152 uninterruptableroutines 6059 27152 ; this is for routines that must happen off the visible screen, each frame. 6060 27152 6061 27152 - ifconst AVOXVOICE 6062 27152 - jsr serviceatarivoxqueue 6063 27152 endif 6064 27152 6065 27152 a9 00 lda #0 6066 27154 8d b6 01 sta palfastframe 6067 27157 ad 09 21 lda paldetected 6068 2715a f0 10 beq skippalframeadjusting 6069 2715c ; ** PAL console is detected. we increment palframes to accurately count 5 frames, 6070 2715c ae b5 01 ldx palframes 6071 2715f e8 inx 6072 27160 e0 05 cpx #5 6073 27162 d0 05 bne palframeskipdone 6074 27164 ee b6 01 inc palfastframe 6075 27167 a2 00 ldx #0 6076 27169 palframeskipdone 6077 27169 8e b5 01 stx palframes 6078 2716c skippalframeadjusting 6079 2716c 6080 2716c - ifconst MUSICTRACKER 6081 2716c - ; We normally run the servicesong routine from the top-screen interrupt, but if it 6082 2716c - ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. 6083 2716c - ; If that happens, we try again here. Chances are very small we'll run into the same 6084 2716c - ; problem twice, and if we do, we just drop a musical note or two. 6085 2716c - lda sfxschedulemissed 6086 2716c - beq servicesongwasnotmissed 6087 2716c - jsr servicesong 6088 2716c -servicesongwasnotmissed 6089 2716c endif ; MUSICTRACKER 6090 2716c 6091 2716c 60 rts 6092 2716d 6093 2716d serviceatarivoxqueue 6094 2716d - ifconst AVOXVOICE 6095 2716d - lda voxlock 6096 2716d - bne skipvoxprocessing ; the vox is in the middle of speech address update 6097 2716d -skipvoxqueuesizedec 6098 2716d - jmp processavoxvoice 6099 2716d -skipvoxprocessing 6100 2716d - rts 6101 2716d - 6102 2716d -processavoxvoice 6103 2716d - lda avoxenable 6104 2716d - bne avoxfixport 6105 2716d - SPKOUT tempavox 6106 2716d - rts 6107 2716d -avoxfixport 6108 2716d - lda #0 ; restore the port to all bits as inputs... 6109 2716d - sta CTLSWA 6110 2716d - rts 6111 2716d -silenceavoxvoice 6112 2716d - SPEAK avoxsilentdata 6113 2716d - rts 6114 2716d -avoxsilentdata 6115 2716d - .byte 31,255 6116 2716d else 6117 2716d 60 rts 6118 2716e endif ; AVOXVOICE 6119 2716e 6120 2716e joybuttonhandler 6121 2716e 8a txa 6122 2716f 0a asl 6123 27170 a8 tay 6124 27171 b9 08 00 lda INPT0,y 6125 27174 4a lsr 6126 27175 9d 02 21 sta sINPT1,x 6127 27178 b9 09 00 lda INPT1,y 6128 2717b 29 80 and #%10000000 6129 2717d 1d 02 21 ora sINPT1,x 6130 27180 9d 02 21 sta sINPT1,x 6131 27183 6132 27183 b5 0c lda INPT4,x 6133 27185 30 19 bmi .skip1bjoyfirecheck 6134 27187 ;one button joystick is down 6135 27187 49 80 eor #%10000000 6136 27189 9d 02 21 sta sINPT1,x 6137 2718c 6138 2718c ad b1 01 lda joybuttonmode 6139 2718f 3d a3 f1 and twobuttonmask,x 6140 27192 f0 0c beq .skip1bjoyfirecheck 6141 27194 ad b1 01 lda joybuttonmode 6142 27197 1d a3 f1 ora twobuttonmask,x 6143 2719a 8d b1 01 sta joybuttonmode 6144 2719d 8d 82 02 sta SWCHB 6145 271a0 .skip1bjoyfirecheck 6146 271a0 4c 57 f0 jmp buttonreadloopreturn 6147 271a3 6148 271a3 twobuttonmask 6149 271a3 04 10 .byte.b %00000100,%00010000 6150 271a5 6151 271a5 gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid 6152 271a5 - ifconst LIGHTGUNSUPPORT 6153 271a5 - cpx #0 6154 271a5 - bne secondportgunhandler 6155 271a5 -firstportgunhandler 6156 271a5 - lda SWCHA 6157 271a5 - asl 6158 271a5 - asl 6159 271a5 - asl ; shift D4 to D7 6160 271a5 - and #%10000000 6161 271a5 - eor #%10000000 6162 271a5 - sta sINPT1 6163 271a5 - jmp buttonreadloopreturn 6164 271a5 -secondportgunhandler 6165 271a5 - lda SWCHA 6166 271a5 - lsr ; shift D0 into carry 6167 271a5 - lsr ; shift carry into D7 6168 271a5 - and #%10000000 6169 271a5 - eor #%10000000 6170 271a5 - sta sINPT3 6171 271a5 - jmp buttonreadloopreturn 6172 271a5 endif ; LIGHTGUNSUPPORT 6173 271a5 6174 271a5 controlsusing2buttoncode 6175 271a5 00 .byte.b 0 ; 00=no controller plugged in 6176 271a6 01 .byte.b 1 ; 01=proline joystick 6177 271a7 00 .byte.b 0 ; 02=lightgun 6178 271a8 00 .byte.b 0 ; 03=paddle 6179 271a9 01 .byte.b 1 ; 04=trakball 6180 271aa 01 .byte.b 1 ; 05=vcs joystick 6181 271ab 01 .byte.b 1 ; 06=driving control 6182 271ac 00 .byte.b 0 ; 07=keypad control 6183 271ad 00 .byte.b 0 ; 08=st mouse/cx80 6184 271ae 00 .byte.b 0 ; 09=amiga mouse 6185 271af 01 .byte.b 1 ; 10=atarivox 6186 271b0 6187 271b0 buttonhandlerhi 6188 271b0 00 .byte.b 0 ; 00=no controller plugged in 6189 271b1 f1 .byte.b >joybuttonhandler ; 01=proline joystick 6190 271b2 f1 .byte.b >gunbuttonhandler ; 02=lightgun 6191 271b3 f5 .byte.b >paddlebuttonhandler ; 03=paddle 6192 271b4 f1 .byte.b >joybuttonhandler ; 04=trakball 6193 271b5 f1 .byte.b >joybuttonhandler ; 05=vcs joystick 6194 271b6 f1 .byte.b >joybuttonhandler ; 06=driving control 6195 271b7 00 .byte.b 0 ; 07=keypad 6196 271b8 f5 .byte.b >mousebuttonhandler ; 08=st mouse 6197 271b9 f5 .byte.b >mousebuttonhandler ; 09=amiga mouse 6198 271ba f1 .byte.b >joybuttonhandler ; 10=atarivox 6199 271bb buttonhandlerlo 6200 271bb 00 .byte.b 0 ; 00=no controller plugged in 6201 271bc 6e .byte.b $0F means the sound is looped while priority is active 6302 27219 6303 27219 05 d9 ora inttemp2 6304 2721b 05 d8 ora inttemp1 ; check if F|C|V=0 6305 2721d f0 23 beq zerosfx ; if so, we're at the end of the sound. 6306 2721f 6307 2721f advancesfxpointer 6308 2721f ; advance the pointer to the next sound chunk 6309 2721f c8 iny 6310 27220 84 da sty inttemp3 6311 27222 18 clc 6312 27223 b5 4e lda sfx1pointlo,x 6313 27225 65 da adc inttemp3 6314 27227 95 4e sta sfx1pointlo,x 6315 27229 b5 50 lda sfx1pointhi,x 6316 2722b 69 00 adc #0 6317 2722d 95 50 sta sfx1pointhi,x 6318 2722f 4c da f1 jmp servicesfxchannelsloop 6319 27232 6320 27232 sfxsoundloop 6321 27232 48 pha 6322 27233 b5 52 lda sfx1priority,x 6323 27235 d0 04 bne sfxsoundloop_carryon 6324 27237 68 pla ; fix the stack before we go 6325 27238 4c 1f f2 jmp advancesfxpointer 6326 2723b sfxsoundloop_carryon 6327 2723b 68 pla 6328 2723c 29 f0 and #$F0 6329 2723e 4a lsr 6330 2723f 4a lsr 6331 27240 4a lsr 6332 27241 4a lsr 6333 27242 6334 27242 zerosfx 6335 27242 95 4e sta sfx1pointlo,x 6336 27244 95 50 sta sfx1pointhi,x 6337 27246 95 52 sta sfx1priority,x 6338 27248 4c da f1 jmp servicesfxchannelsloop 6339 2724b 6340 2724b 6341 2724b schedulesfx 6342 2724b ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index 6343 2724b a0 00 ldy #0 6344 2724d b1 e0 lda (sfxinstrumentlo),y 6345 2724f - ifconst pokeysupport 6346 2724f - cmp #$20 ; POKEY? 6347 2724f - bne scheduletiasfx 6348 2724f - jmp schedulepokeysfx 6349 2724f endif 6350 2724f scheduletiasfx 6351 2724f ;cmp #$10 ; TIA? 6352 2724f ;beq continuescheduletiasfx 6353 2724f ; rts ; unhandled!!! 6354 2724f continuescheduletiasfx 6355 2724f ifnconst TIASFXMONO 6356 2724f a5 4e lda sfx1pointlo 6357 27251 05 50 ora sfx1pointhi 6358 27253 f0 13 beq schedulesfx1 ;if channel 1 is idle, use it 6359 27255 a5 4f lda sfx2pointlo 6360 27257 05 51 ora sfx2pointhi 6361 27259 f0 11 beq schedulesfx2 ;if channel 2 is idle, use it 6362 2725b ; Both channels are scheduled. 6363 2725b a0 01 ldy #1 6364 2725d b1 e0 lda (sfxinstrumentlo),y 6365 2725f d0 01 bne interruptsfx 6366 27261 60 rts ; the new sound has 0 priority and both channels are busy. Skip playing it. 6367 27262 interruptsfx 6368 27262 ;Compare which active sound has a lower priority. We'll interrupt the lower one. 6369 27262 a5 52 lda sfx1priority 6370 27264 c5 53 cmp sfx2priority 6371 27266 b0 04 bcs schedulesfx2 6372 27268 endif ; !TIASFXMONO 6373 27268 6374 27268 schedulesfx1 6375 27268 a2 00 ldx #0 ; channel 1 6376 2726a ifnconst TIASFXMONO 6377 2726a f0 02 beq skipschedulesfx2 6378 2726c schedulesfx2 6379 2726c a2 01 ldx #1 ; channel 2 6380 2726e skipschedulesfx2 6381 2726e endif ; !TIASFXMONO 6382 2726e 6383 2726e - ifconst MUSICTRACKER 6384 2726e - lda sfxnoteindex 6385 2726e - bpl skipdrumkitoverride 6386 2726e - and #$7F ; subtract 128 6387 2726e - sec 6388 2726e - sbc #4 ; drums start at 132, i.e. octave 10 6389 2726e - asl 6390 2726e - tay 6391 2726e - lda tiadrumkitdefinition,y 6392 2726e - sta sfxinstrumentlo 6393 2726e - iny 6394 2726e - lda tiadrumkitdefinition,y 6395 2726e - sta sfxinstrumenthi 6396 2726e - lda #0 6397 2726e - sta sfxnoteindex ; and tell the driver it's a non-pitched instrument 6398 2726e -skipdrumkitoverride 6399 2726e endif ; MUSICTRACKER 6400 2726e a0 01 ldy #1 ; get priority and sound-resolution (in frames) 6401 27270 b1 e0 lda (sfxinstrumentlo),y 6402 27272 95 52 sta sfx1priority,x 6403 27274 c8 iny 6404 27275 b1 e0 lda (sfxinstrumentlo),y 6405 27277 95 56 sta sfx1frames,x 6406 27279 a5 e0 lda sfxinstrumentlo 6407 2727b 18 clc 6408 2727c 69 03 adc #3 6409 2727e 95 4e sta sfx1pointlo,x 6410 27280 a5 e1 lda sfxinstrumenthi 6411 27282 69 00 adc #0 6412 27284 95 50 sta sfx1pointhi,x 6413 27286 a5 e2 lda sfxpitchoffset 6414 27288 95 54 sta sfx1poffset,x 6415 2728a a9 00 lda #0 6416 2728c 95 58 sta sfx1tick,x 6417 2728e a5 e3 lda sfxnoteindex 6418 27290 95 cd sta sfx1notedata,x 6419 27292 60 rts 6420 27293 6421 27293 plotsprite 6422 27293 ifnconst NODRAWWAIT 6423 27293 - ifconst DOUBLEBUFFER 6424 27293 - lda doublebufferstate 6425 27293 - bne skipplotspritewait 6426 27293 endif ; DOUBLEBUFFER 6427 27293 - ifconst DEBUGWAITCOLOR 6428 27293 - lda #$41 6429 27293 - sta BACKGRND 6430 27293 endif 6431 27293 plotspritewait 6432 27293 a5 4d lda visibleover 6433 27295 d0 fc bne plotspritewait 6434 27297 skipplotspritewait 6435 27297 - ifconst DEBUGWAITCOLOR 6436 27297 - lda #$0 6437 27297 - sta BACKGRND 6438 27297 endif 6439 27297 endif 6440 27297 6441 27297 ;arguments: 6442 27297 ; temp1=lo graphicdata 6443 27297 ; temp2=hi graphicdata 6444 27297 ; temp3=palette | width byte 6445 27297 ; temp4=x 6446 27297 ; temp5=y 6447 27297 ; temp6=mode 6448 27297 a5 46 lda temp5 ;Y position 6449 27299 4a lsr ; 2 - Divide by 8 or 16 6450 2729a 4a lsr ; 2 6451 2729b 4a lsr ; 2 6452 2729c - if WZONEHEIGHT = 16 6453 2729c - lsr ; 2 6454 2729c endif 6455 2729c 6456 2729c aa tax 6457 2729d 6458 2729d ifnconst NOLIMITCHECKING 6459 2729d 6460 2729d ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory 6461 2729d 6462 2729d c9 18 cmp #WZONECOUNT 6463 2729f 6464 2729f 90 0a bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... 6465 272a1 ; otherwise, check to see if the bottom half is in zone 0... 6466 272a1 6467 272a1 - if WZONEHEIGHT = 16 6468 272a1 - cmp #15 6469 272a1 else 6470 272a1 c9 1f cmp #31 6471 272a3 endif 6472 272a3 6473 272a3 d0 05 bne exitplotsprite1 6474 272a5 a2 00 ldx #0 6475 272a7 4c e4 f2 jmp continueplotsprite2 6476 272aa exitplotsprite1 6477 272aa 60 rts 6478 272ab 6479 272ab continueplotsprite1 6480 272ab endif 6481 272ab 6482 272ab bd 7b f6 lda DLPOINTL,x ;Get pointer to DL that this sprite starts in 6483 272ae - ifconst DOUBLEBUFFER 6484 272ae - clc 6485 272ae - adc doublebufferdloffset 6486 272ae endif ; DOUBLEBUFFER 6487 272ae 85 63 sta dlpnt 6488 272b0 bd 63 f6 lda DLPOINTH,x 6489 272b3 - ifconst DOUBLEBUFFER 6490 272b3 - adc #0 6491 272b3 endif ; DOUBLEBUFFER 6492 272b3 85 64 sta dlpnt+1 6493 272b5 6494 272b5 ;Create DL entry for upper part of sprite 6495 272b5 6496 272b5 b4 65 ldy dlend,x ;Get the index to the end of this DL 6497 272b7 6498 272b7 ifconst CHECKOVERWRITE 6499 272b7 c0 4b cpy #DLLASTOBJ 6500 272b9 f0 21 beq checkcontinueplotsprite2 6501 272bb continueplotsprite1a 6502 272bb endif 6503 272bb 6504 272bb a5 42 lda temp1 ; graphic data, lo byte 6505 272bd 91 63 sta (dlpnt),y ;Low byte of data address 6506 272bf 6507 272bf ifnconst ATOMICSPRITEUPDATE 6508 272bf c8 iny 6509 272c0 a5 47 lda temp6 6510 272c2 91 63 sta (dlpnt),y 6511 272c4 - else 6512 272c4 - iny 6513 272c4 - sty temp8 6514 272c4 endif 6515 272c4 6516 272c4 c8 iny 6517 272c5 6518 272c5 a5 46 lda temp5 ;Y position 6519 272c7 29 07 and #(WZONEHEIGHT - 1) 6520 272c9 c9 01 cmp #1 ; clear carry if our sprite is just in this zone 6521 272cb 05 43 ora temp2 ; graphic data, hi byte 6522 272cd 91 63 sta (dlpnt),y 6523 272cf 6524 272cf 6525 272cf c8 iny 6526 272d0 a5 44 lda temp3 ;palette|width 6527 272d2 91 63 sta (dlpnt),y 6528 272d4 6529 272d4 c8 iny 6530 272d5 a5 45 lda temp4 ;Horizontal position 6531 272d7 91 63 sta (dlpnt),y 6532 272d9 6533 272d9 c8 iny 6534 272da 94 65 sty dlend,x 6535 272dc 6536 272dc - ifconst ALWAYSTERMINATE 6537 272dc - iny 6538 272dc - lda #0 6539 272dc - sta (dlpnt),y 6540 272dc endif 6541 272dc 6542 272dc - ifconst ATOMICSPRITEUPDATE 6543 272dc - ldy temp8 6544 272dc - lda temp6 6545 272dc - sta (dlpnt),y 6546 272dc endif 6547 272dc 6548 272dc checkcontinueplotsprite2 6549 272dc 6550 272dc 90 38 bcc doneSPDL ;branch if the sprite was fully in the last zone 6551 272de 6552 272de ;Create DL entry for lower part of sprite 6553 272de 6554 272de e8 inx ;Next region 6555 272df 6556 272df ifnconst NOLIMITCHECKING 6557 272df e0 18 cpx #WZONECOUNT 6558 272e1 6559 272e1 90 01 bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... 6560 272e3 60 rts 6561 272e4 continueplotsprite2 6562 272e4 endif 6563 272e4 6564 272e4 bd 7b f6 lda DLPOINTL,x ;Get pointer to next DL 6565 272e7 - ifconst DOUBLEBUFFER 6566 272e7 - clc 6567 272e7 - adc doublebufferdloffset 6568 272e7 endif ; DOUBLEBUFFER 6569 272e7 85 63 sta dlpnt 6570 272e9 bd 63 f6 lda DLPOINTH,x 6571 272ec - ifconst DOUBLEBUFFER 6572 272ec - adc #0 6573 272ec endif ; DOUBLEBUFFER 6574 272ec 85 64 sta dlpnt+1 6575 272ee b4 65 ldy dlend,x ;Get the index to the end of this DL 6576 272f0 6577 272f0 ifconst CHECKOVERWRITE 6578 272f0 c0 4b cpy #DLLASTOBJ 6579 272f2 d0 01 bne continueplotsprite2a 6580 272f4 60 rts 6581 272f5 continueplotsprite2a 6582 272f5 endif 6583 272f5 6584 272f5 a5 42 lda temp1 ; graphic data, lo byte 6585 272f7 91 63 sta (dlpnt),y 6586 272f9 6587 272f9 ifnconst ATOMICSPRITEUPDATE 6588 272f9 c8 iny 6589 272fa a5 47 lda temp6 6590 272fc 91 63 sta (dlpnt),y 6591 272fe - else 6592 272fe - iny 6593 272fe - sty temp8 6594 272fe endif 6595 272fe 6596 272fe c8 iny 6597 272ff 6598 272ff a5 46 lda temp5 ;Y position 6599 27301 0b 07 anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry 6600 27303 05 43 ora temp2 ; graphic data, hi byte 6601 27305 e9 07 sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear 6602 27307 91 63 sta (dlpnt),y 6603 27309 6604 27309 c8 iny 6605 2730a 6606 2730a a5 44 lda temp3 ;palette|width 6607 2730c 91 63 sta (dlpnt),y 6608 2730e 6609 2730e c8 iny 6610 2730f 6611 2730f a5 45 lda temp4 ;Horizontal position 6612 27311 91 63 sta (dlpnt),y 6613 27313 6614 27313 c8 iny 6615 27314 94 65 sty dlend,x 6616 27316 6617 27316 - ifconst ALWAYSTERMINATE 6618 27316 - iny 6619 27316 - lda #0 6620 27316 - sta (dlpnt),y 6621 27316 endif 6622 27316 6623 27316 - ifconst ATOMICSPRITEUPDATE 6624 27316 - ldy temp8 6625 27316 - lda temp6 6626 27316 - sta (dlpnt),y 6627 27316 endif 6628 27316 6629 27316 doneSPDL 6630 27316 60 rts 6631 27317 6632 27317 6633 27317 lockzonex 6634 27317 - ifconst ZONELOCKS 6635 27317 - ldy dlend,x 6636 27317 - cpy #DLLASTOBJ 6637 27317 - beq lockzonexreturn ; the zone is either stuffed or locked. abort! 6638 27317 - lda DLPOINTL,x 6639 27317 - ifconst DOUBLEBUFFER 6640 27317 - clc 6641 27317 - adc doublebufferdloffset 6642 27317 - endif ; DOUBLEBUFFER 6643 27317 - sta dlpnt 6644 27317 - lda DLPOINTH,x 6645 27317 - ifconst DOUBLEBUFFER 6646 27317 - adc #0 6647 27317 - endif ; DOUBLEBUFFER 6648 27317 - sta dlpnt+1 6649 27317 - iny 6650 27317 - lda #0 6651 27317 - sta (dlpnt),y 6652 27317 - dey 6653 27317 - tya 6654 27317 - ldy #(DLLASTOBJ-1) 6655 27317 - sta (dlpnt),y 6656 27317 - iny 6657 27317 - sty dlend,x 6658 27317 -lockzonexreturn 6659 27317 - rts 6660 27317 endif ; ZONELOCKS 6661 27317 unlockzonex 6662 27317 - ifconst ZONELOCKS 6663 27317 - ldy dlend,x 6664 27317 - cpy #DLLASTOBJ 6665 27317 - bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! 6666 27317 - lda DLPOINTL,x 6667 27317 - ifconst DOUBLEBUFFER 6668 27317 - clc 6669 27317 - adc doublebufferdloffset 6670 27317 - endif ; DOUBLEBUFFER 6671 27317 - sta dlpnt 6672 27317 - lda DLPOINTH,x 6673 27317 - ifconst DOUBLEBUFFER 6674 27317 - adc #0 6675 27317 - endif ; DOUBLEBUFFER 6676 27317 - sta dlpnt+1 6677 27317 - dey 6678 27317 - ;ldy #(DLLASTOBJ-1) 6679 27317 - lda (dlpnt),y 6680 27317 - tay 6681 27317 - sty dlend,x 6682 27317 -unlockzonexreturn 6683 27317 endif ; ZONELOCKS 6684 27317 60 rts 6685 27318 6686 27318 plotcharloop 6687 27318 ; ** read from a data indirectly pointed to from temp8,temp9 6688 27318 ; ** format is: lo_data, hi_data, palette|width, x, y 6689 27318 ; ** format ends with lo_data | hi_data = 0 6690 27318 6691 27318 - ifconst DOUBLEBUFFER 6692 27318 - lda doublebufferstate 6693 27318 - bne skipplotcharloopwait 6694 27318 endif ; DOUBLEBUFFER 6695 27318 - ifconst DEBUGWAITCOLOR 6696 27318 - lda #$61 6697 27318 - sta BACKGRND 6698 27318 endif 6699 27318 plotcharloopwait 6700 27318 a5 4d lda visibleover 6701 2731a d0 fc bne plotcharloopwait 6702 2731c - ifconst DEBUGWAITCOLOR 6703 2731c - lda #0 6704 2731c - sta BACKGRND 6705 2731c endif 6706 2731c skipplotcharloopwait 6707 2731c plotcharlooploop 6708 2731c a0 00 ldy #0 6709 2731e b1 49 lda (temp8),y 6710 27320 85 42 sta temp1 6711 27322 c8 iny 6712 27323 b1 49 lda (temp8),y 6713 27325 85 43 sta temp2 6714 27327 05 42 ora temp1 6715 27329 d0 01 bne plotcharloopcontinue 6716 2732b ;the pointer=0, so return 6717 2732b 60 rts 6718 2732c plotcharloopcontinue 6719 2732c c8 iny 6720 2732d b1 49 lda (temp8),y 6721 2732f 85 44 sta temp3 6722 27331 c8 iny 6723 27332 b1 49 lda (temp8),y 6724 27334 85 45 sta temp4 6725 27336 c8 iny 6726 27337 b1 49 lda (temp8),y 6727 27339 ;sta temp5 ; not needed with our late entry. 6728 27339 20 52 f3 jsr plotcharactersskipentry 6729 2733c a5 49 lda temp8 6730 2733e 18 clc 6731 2733f 69 05 adc #5 6732 27341 85 49 sta temp8 6733 27343 a5 4a lda temp9 6734 27345 69 00 adc #0 6735 27347 85 4a sta temp9 6736 27349 4c 1c f3 jmp plotcharlooploop 6737 2734c 6738 2734c plotcharacters 6739 2734c - ifconst DOUBLEBUFFER 6740 2734c - lda doublebufferstate 6741 2734c - bne skipplotcharacterswait 6742 2734c endif ; DOUBLEBUFFER 6743 2734c - ifconst DEBUGWAITCOLOR 6744 2734c - lda #$41 6745 2734c - sta BACKGRND 6746 2734c endif 6747 2734c plotcharacterswait 6748 2734c a5 4d lda visibleover 6749 2734e d0 fc bne plotcharacterswait 6750 27350 - ifconst DEBUGWAITCOLOR 6751 27350 - sta BACKGRND 6752 27350 endif 6753 27350 skipplotcharacterswait 6754 27350 ;arguments: 6755 27350 ; temp1=lo charactermap 6756 27350 ; temp2=hi charactermap 6757 27350 ; temp3=palette | width byte 6758 27350 ; temp4=x 6759 27350 ; temp5=y 6760 27350 6761 27350 a5 46 lda temp5 ;Y position 6762 27352 6763 27352 plotcharactersskipentry 6764 27352 6765 27352 ;ifconst ZONEHEIGHT 6766 27352 ; if ZONEHEIGHT = 16 6767 27352 ; and #$0F 6768 27352 ; endif 6769 27352 ; if ZONEHEIGHT = 8 6770 27352 ; and #$1F 6771 27352 ; endif 6772 27352 ;else 6773 27352 ; and #$0F 6774 27352 ;endif 6775 27352 6776 27352 aa tax 6777 27353 bd 7b f6 lda DLPOINTL,x ;Get pointer to DL that the characters are in 6778 27356 - ifconst DOUBLEBUFFER 6779 27356 - clc 6780 27356 - adc doublebufferdloffset 6781 27356 endif ; DOUBLEBUFFER 6782 27356 85 63 sta dlpnt 6783 27358 bd 63 f6 lda DLPOINTH,x 6784 2735b - ifconst DOUBLEBUFFER 6785 2735b - adc #0 6786 2735b endif ; DOUBLEBUFFER 6787 2735b 85 64 sta dlpnt+1 6788 2735d 6789 2735d ;Create DL entry for the characters 6790 2735d 6791 2735d b4 65 ldy dlend,x ;Get the index to the end of this DL 6792 2735f 6793 2735f ifconst CHECKOVERWRITE 6794 2735f c0 4b cpy #DLLASTOBJ 6795 27361 d0 01 bne continueplotcharacters 6796 27363 60 rts 6797 27364 continueplotcharacters 6798 27364 endif 6799 27364 6800 27364 a5 42 lda temp1 ; character map data, lo byte 6801 27366 91 63 sta (dlpnt),y ;(1) store low address 6802 27368 6803 27368 c8 iny 6804 27369 ad 06 21 lda charactermode 6805 2736c 91 63 sta (dlpnt),y ;(2) store mode 6806 2736e 6807 2736e c8 iny 6808 2736f a5 43 lda temp2 ; character map, hi byte 6809 27371 91 63 sta (dlpnt),y ;(3) store high address 6810 27373 6811 27373 c8 iny 6812 27374 a5 44 lda temp3 ;palette|width 6813 27376 91 63 sta (dlpnt),y ;(4) store palette|width 6814 27378 6815 27378 c8 iny 6816 27379 a5 45 lda temp4 ;Horizontal position 6817 2737b 91 63 sta (dlpnt),y ;(5) store horizontal position 6818 2737d 6819 2737d c8 iny 6820 2737e 94 65 sty dlend,x ; save display list end byte 6821 27380 60 rts 6822 27381 6823 27381 6824 27381 - ifconst plotvalueonscreen 6825 27381 -plotcharacterslive 6826 27381 - ; a version of plotcharacters that draws live and minimally disrupts the screen... 6827 27381 - 6828 27381 - ;arguments: 6829 27381 - ; temp1=lo charactermap 6830 27381 - ; temp2=hi charactermap 6831 27381 - ; temp3=palette | width byte 6832 27381 - ; temp4=x 6833 27381 - ; temp5=y 6834 27381 - 6835 27381 - lda temp5 ;Y position 6836 27381 - 6837 27381 - tax 6838 27381 - lda DLPOINTL,x ;Get pointer to DL that the characters are in 6839 27381 - ifconst DOUBLEBUFFER 6840 27381 - clc 6841 27381 - adc doublebufferdloffset 6842 27381 - endif ; DOUBLEBUFFER 6843 27381 - sta dlpnt 6844 27381 - lda DLPOINTH,x 6845 27381 - ifconst DOUBLEBUFFER 6846 27381 - adc #0 6847 27381 - endif ; DOUBLEBUFFER 6848 27381 - sta dlpnt+1 6849 27381 - 6850 27381 - ;Create DL entry for the characters 6851 27381 - 6852 27381 - ldy dlend,x ;Get the index to the end of this DL 6853 27381 - 6854 27381 - ifconst CHECKOVERWRITE 6855 27381 - cpy #DLLASTOBJ 6856 27381 - bne continueplotcharacterslive 6857 27381 - rts 6858 27381 -continueplotcharacterslive 6859 27381 - endif 6860 27381 - 6861 27381 - lda temp1 ; character map data, lo byte 6862 27381 - sta (dlpnt),y ;(1) store low address 6863 27381 - 6864 27381 - iny 6865 27381 - ; we don't add the second byte yet, since the charmap could briefly 6866 27381 - ; render without a proper character map address, width, or position. 6867 27381 - lda charactermode 6868 27381 - sta (dlpnt),y ;(2) store mode 6869 27381 - 6870 27381 - iny 6871 27381 - lda temp2 ; character map, hi byte 6872 27381 - sta (dlpnt),y ;(3) store high address 6873 27381 - 6874 27381 - iny 6875 27381 - lda temp3 ;palette|width 6876 27381 - sta (dlpnt),y ;(4) store palette|width 6877 27381 - 6878 27381 - iny 6879 27381 - lda temp4 ;Horizontal position 6880 27381 - sta (dlpnt),y ;(5) store horizontal position 6881 27381 - 6882 27381 - iny 6883 27381 - sty dlend,x ; save display list end byte 6884 27381 - 6885 27381 - rts 6886 27381 endif ;plotcharacterslive 6887 27381 6888 27381 ifconst USED_PLOTVALUE 6889 27381 plotvalue 6890 27381 ; calling 7800basic command: 6891 27381 ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6892 27381 ; ...displays the variable as BCD digits 6893 27381 ; 6894 27381 ; asm sub arguments: 6895 27381 ; temp1=lo charactermap 6896 27381 ; temp2=hi charactermap 6897 27381 ; temp3=palette | width byte 6898 27381 ; temp4=x 6899 27381 ; temp5=y 6900 27381 ; temp6=number of digits 6901 27381 ; temp7=lo variable 6902 27381 ; temp8=hi variable 6903 27381 ; temp9=character mode 6904 27381 6905 27381 00 47 plotdigitcount = temp6 6906 27381 6907 27381 - ifconst ZONELOCKS 6908 27381 - ldx temp5 6909 27381 - ldy dlend,x 6910 27381 - cpy #DLLASTOBJ 6911 27381 - bne carryonplotvalue 6912 27381 - rts 6913 27381 -carryonplotvalue 6914 27381 endif 6915 27381 6916 27381 a9 00 lda #0 6917 27383 a8 tay 6918 27384 ae ad 01 ldx valbufend 6919 27387 6920 27387 a5 47 lda plotdigitcount 6921 27389 29 01 and #1 6922 2738b f0 07 beq pvnibble2char 6923 2738d a9 00 lda #0 6924 2738f 9d 00 20 sta VALBUFFER,x ; just in case we skip this digit 6925 27392 f0 11 beq pvnibble2char_skipnibble 6926 27394 6927 27394 pvnibble2char 6928 27394 ; high nibble... 6929 27394 b1 48 lda (temp7),y 6930 27396 29 f0 and #$f0 6931 27398 4a lsr 6932 27399 4a lsr 6933 2739a 4a lsr 6934 2739b ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 6935 2739b 4a lsr 6936 2739c endif 6937 2739c 6938 2739c 18 clc 6939 2739d 65 42 adc temp1 ; add the offset to character graphics to our value 6940 2739f 9d 00 20 sta VALBUFFER,x 6941 273a2 e8 inx 6942 273a3 c6 47 dec plotdigitcount 6943 273a5 6944 273a5 pvnibble2char_skipnibble 6945 273a5 ; low nibble... 6946 273a5 b1 48 lda (temp7),y 6947 273a7 29 0f and #$0f 6948 273a9 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 6949 273a9 - asl 6950 273a9 endif 6951 273a9 18 clc 6952 273aa 65 42 adc temp1 ; add the offset to character graphics to our value 6953 273ac 9d 00 20 sta VALBUFFER,x 6954 273af e8 inx 6955 273b0 c8 iny 6956 273b1 6957 273b1 c6 47 dec plotdigitcount 6958 273b3 d0 df bne pvnibble2char 6959 273b5 6960 273b5 ;point to the start of our valuebuffer 6961 273b5 18 clc 6962 273b6 a9 00 lda #VALBUFFER 6966 273bf 69 00 adc #0 6967 273c1 85 43 sta temp2 6968 273c3 6969 273c3 ;advance valbufend to the end of our value buffer 6970 273c3 8e ad 01 stx valbufend 6971 273c6 6972 273c6 ifnconst plotvalueonscreen 6973 273c6 4c 4c f3 jmp plotcharacters 6974 273c9 - else 6975 273c9 - jmp plotcharacterslive 6976 273c9 endif 6977 273c9 6978 273c9 endif ; USED_PLOTVALUE 6979 273c9 6980 273c9 6981 273c9 - ifconst USED_PLOTVALUEEXTRA 6982 273c9 -plotdigitcount = temp6 6983 273c9 -plotvalueextra 6984 273c9 - ; calling 7800basic command: 6985 273c9 - ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y 6986 273c9 - ; ...displays the variable as BCD digits 6987 273c9 - ; 6988 273c9 - ; asm sub arguments: 6989 273c9 - ; temp1=lo charactermap 6990 273c9 - ; temp2=hi charactermap 6991 273c9 - ; temp3=palette | width byte 6992 273c9 - ; temp4=x 6993 273c9 - ; temp5=y 6994 273c9 - ; temp6=number of digits 6995 273c9 - ; temp7=lo variable 6996 273c9 - ; temp8=hi variable 6997 273c9 - 6998 273c9 - lda #0 6999 273c9 - tay 7000 273c9 - ldx valbufend 7001 273c9 - ifnconst plotvalueonscreen 7002 273c9 - sta VALBUFFER,x 7003 273c9 - endif 7004 273c9 - 7005 273c9 - lda plotdigitcount 7006 273c9 - and #1 7007 273c9 - 7008 273c9 - bne pvnibble2char_skipnibbleextra 7009 273c9 - 7010 273c9 -pvnibble2charextra 7011 273c9 - ; high nibble... 7012 273c9 - lda (temp7),y 7013 273c9 - and #$f0 7014 273c9 - lsr 7015 273c9 - lsr 7016 273c9 - ifnconst DOUBLEWIDE ; multiply value by 2 for double-width 7017 273c9 - lsr 7018 273c9 - endif 7019 273c9 - clc 7020 273c9 - adc temp1 ; add the offset to character graphics to our value 7021 273c9 - sta VALBUFFER,x 7022 273c9 - inx 7023 273c9 - 7024 273c9 - ; second half of the digit 7025 273c9 - clc 7026 273c9 - adc #1 7027 273c9 - sta VALBUFFER,x 7028 273c9 - inx 7029 273c9 - 7030 273c9 -pvnibble2char_skipnibbleextra 7031 273c9 - ; low nibble... 7032 273c9 - lda (temp7),y 7033 273c9 - and #$0f 7034 273c9 - ifconst DOUBLEWIDE ; multiply value by 2 for double-width 7035 273c9 - asl 7036 273c9 - endif 7037 273c9 - asl 7038 273c9 - 7039 273c9 - clc 7040 273c9 - adc temp1 ; add the offset to character graphics to our value 7041 273c9 - sta VALBUFFER,x 7042 273c9 - inx 7043 273c9 - 7044 273c9 - clc 7045 273c9 - adc #1 7046 273c9 - sta VALBUFFER,x 7047 273c9 - inx 7048 273c9 - iny 7049 273c9 - 7050 273c9 - dec plotdigitcount 7051 273c9 - bne pvnibble2charextra 7052 273c9 - 7053 273c9 - ;point to the start of our valuebuffer 7054 273c9 - clc 7055 273c9 - lda #VALBUFFER 7059 273c9 - adc #0 7060 273c9 - sta temp2 7061 273c9 - 7062 273c9 - ;advance valbufend to the end of our value buffer 7063 273c9 - stx valbufend 7064 273c9 - 7065 273c9 - ifnconst plotvalueonscreen 7066 273c9 - jmp plotcharacters 7067 273c9 - else 7068 273c9 - jmp plotcharacterslive 7069 273c9 - endif 7070 273c9 endif ; USED_PLOTVALUEEXTRA 7071 273c9 7072 273c9 boxcollision 7073 273c9 ifconst BOXCOLLISION 7074 273c9 ; the worst case cycle-time for the code below is 43 cycles. 7075 273c9 ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! 7076 273c9 7077 273c9 ;__boxx1 = accumulator 7078 273c9 ;__boxy1 = y 7079 273c9 00 44 __boxw1 = temp3 7080 273c9 00 45 __boxh1 = temp4 7081 273c9 7082 273c9 00 46 __boxx2 = temp5 7083 273c9 00 47 __boxy2 = temp6 7084 273c9 00 48 __boxw2 = temp7 7085 273c9 00 49 __boxh2 = temp8 7086 273c9 7087 273c9 DoXCollisionCheck 7088 273c9 ;lda __boxx1 ; skipped. already in the accumulator 7089 273c9 c5 46 cmp __boxx2 ;3 7090 273cb b0 07 bcs X1isbiggerthanX2 ;2/3 7091 273cd X2isbiggerthanX1 7092 273cd ; carry is clear 7093 273cd 65 44 adc __boxw1 ;3 7094 273cf c5 46 cmp __boxx2 ;3 7095 273d1 b0 08 bcs DoYCollisionCheck ;3/2 7096 273d3 60 rts ;6 - carry clear, no collision 7097 273d4 X1isbiggerthanX2 7098 273d4 18 clc ;2 7099 273d5 e5 48 sbc __boxw2 ;3 7100 273d7 c5 46 cmp __boxx2 ;3 7101 273d9 b0 13 bcs noboxcollision ;3/2 7102 273db DoYCollisionCheck 7103 273db 98 tya ; 2 ; use to be "lda __boxy1" 7104 273dc c5 47 cmp __boxy2 ;3 7105 273de b0 05 bcs Y1isbiggerthanY2 ;3/2 7106 273e0 Y2isbiggerthanY1 7107 273e0 ; carry is clear 7108 273e0 65 45 adc __boxh1 ;3 7109 273e2 c5 47 cmp __boxy2 ;3 7110 273e4 60 rts ;6 7111 273e5 Y1isbiggerthanY2 7112 273e5 18 clc ;2 7113 273e6 e5 49 sbc __boxh2 ;3 7114 273e8 c5 47 cmp __boxy2 ;3 7115 273ea b0 02 bcs noboxcollision ;3/2 7116 273ec yesboxcollision 7117 273ec 38 sec ;2 7118 273ed 60 rts ;6 7119 273ee noboxcollision 7120 273ee 18 clc ;2 7121 273ef 60 rts ;6 7122 273f0 endif ; BOXCOLLISION 7123 273f0 7124 273f0 randomize 7125 273f0 a5 40 lda rand 7126 273f2 4a lsr 7127 273f3 26 41 rol rand16 7128 273f5 90 02 bcc noeor 7129 273f7 49 b4 eor #$B4 7130 273f9 noeor 7131 273f9 85 40 sta rand 7132 273fb 45 41 eor rand16 7133 273fd 60 rts 7134 273fe 7135 273fe ; *** bcd conversion routine courtesy Omegamatrix 7136 273fe ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ 7137 273fe converttobcd 7138 273fe ;value to convert is in the accumulator 7139 273fe 85 42 sta temp1 7140 27400 4a lsr 7141 27401 65 42 adc temp1 7142 27403 6a ror 7143 27404 4a lsr 7144 27405 4a lsr 7145 27406 65 42 adc temp1 7146 27408 6a ror 7147 27409 65 42 adc temp1 7148 2740b 6a ror 7149 2740c 4a lsr 7150 2740d 29 3c and #$3C 7151 2740f 85 43 sta temp2 7152 27411 4a lsr 7153 27412 65 43 adc temp2 7154 27414 65 42 adc temp1 7155 27416 60 rts ; return the result in the accumulator 7156 27417 7157 27417 ; Y and A contain multiplicands, result in A 7158 27417 mul8 7159 27417 84 42 sty temp1 7160 27419 85 43 sta temp2 7161 2741b a9 00 lda #0 7162 2741d reptmul8 7163 2741d 46 43 lsr temp2 7164 2741f 90 03 bcc skipmul8 7165 27421 18 clc 7166 27422 65 42 adc temp1 7167 27424 ;bcs donemul8 might save cycles? 7168 27424 skipmul8 7169 27424 ;beq donemul8 might save cycles? 7170 27424 06 42 asl temp1 7171 27426 d0 f5 bne reptmul8 7172 27428 donemul8 7173 27428 60 rts 7174 27429 7175 27429 div8 7176 27429 ; A=numerator Y=denominator, result in A 7177 27429 c0 02 cpy #2 7178 2742b 90 0a bcc div8end+1 ;div by 0 = bad, div by 1=no calc needed, so bail out 7179 2742d 84 42 sty temp1 7180 2742f a0 ff ldy #$ff 7181 27431 div8loop 7182 27431 e5 42 sbc temp1 7183 27433 c8 iny 7184 27434 b0 fb bcs div8loop 7185 27436 div8end 7186 27436 98 tya 7187 27437 ; result in A 7188 27437 60 rts 7189 27438 7190 27438 ; Y and A contain multiplicands, result in temp2,A=low, temp1=high 7191 27438 mul16 7192 27438 84 42 sty temp1 7193 2743a 85 43 sta temp2 7194 2743c 7195 2743c a9 00 lda #0 7196 2743e a2 08 ldx #8 7197 27440 46 42 lsr temp1 7198 27442 mul16_1 7199 27442 90 03 bcc mul16_2 7200 27444 18 clc 7201 27445 65 43 adc temp2 7202 27447 mul16_2 7203 27447 6a ror 7204 27448 66 42 ror temp1 7205 2744a ca dex 7206 2744b d0 f5 bne mul16_1 7207 2744d 85 43 sta temp2 7208 2744f 60 rts 7209 27450 7210 27450 ; div int/int 7211 27450 ; numerator in A, denom in temp1 7212 27450 ; returns with quotient in A, remainder in temp1 7213 27450 div16 7214 27450 85 43 sta temp2 7215 27452 84 42 sty temp1 7216 27454 a9 00 lda #0 7217 27456 a2 08 ldx #8 7218 27458 06 43 asl temp2 7219 2745a div16_1 7220 2745a 2a rol 7221 2745b c5 42 cmp temp1 7222 2745d 90 02 bcc div16_2 7223 2745f e5 42 sbc temp1 7224 27461 div16_2 7225 27461 26 43 rol temp2 7226 27463 ca dex 7227 27464 d0 f4 bne div16_1 7228 27466 85 42 sta temp1 7229 27468 a5 43 lda temp2 7230 2746a 60 rts 7231 2746b 7232 2746b ifconst bankswitchmode 7233 2746b BS_jsr 7234 2746b - ifconst dumpbankswitch 7235 2746b - sta dumpbankswitch 7236 2746b endif 7237 2746b - ifconst MCPDEVCART 7238 2746b - ora #$18 7239 2746b - sta $3000 7240 2746b else 7241 2746b 8d 00 80 sta $8000 7242 2746e endif 7243 2746e 68 pla 7244 2746f aa tax 7245 27470 68 pla 7246 27471 60 rts 7247 27472 7248 27472 BS_return 7249 27472 68 pla ; bankswitch bank 7250 27473 - ifconst dumpbankswitch 7251 27473 - sta dumpbankswitch 7252 27473 endif 7253 27473 - ifconst BANKRAM 7254 27473 - sta currentbank 7255 27473 - ora currentrambank 7256 27473 endif 7257 27473 - ifconst MCPDEVCART 7258 27473 - ora #$18 7259 27473 - sta $3000 7260 27473 else 7261 27473 8d 00 80 sta $8000 7262 27476 endif 7263 27476 68 pla ; bankswitch $0 flag 7264 27477 60 rts 7265 27478 endif 7266 27478 7267 27478 checkselectswitch 7268 27478 ad 82 02 lda SWCHB ; first check the real select switch... 7269 2747b 29 02 and #%00000010 7270 2747d ifnconst MOUSESUPPORT 7271 2747d f0 05 beq checkselectswitchreturn ; switch is pressed 7272 2747f ad 80 02 lda SWCHA ; then check the soft "select" joysick code... 7273 27482 29 b0 and #%10110000 ; R_DU 7274 27484 endif ; MOUSESUPPORT 7275 27484 checkselectswitchreturn 7276 27484 60 rts 7277 27485 7278 27485 checkresetswitch 7279 27485 ad 82 02 lda SWCHB ; first check the real reset switch... 7280 27488 29 01 and #%00000001 7281 2748a ifnconst MOUSESUPPORT 7282 2748a f0 05 beq checkresetswitchreturn ; switch is pressed 7283 2748c ad 80 02 lda SWCHA ; then check the soft "reset" joysick code... 7284 2748f 29 70 and #%01110000 ; _LDU 7285 27491 endif ; MOUSESUPPORT 7286 27491 checkresetswitchreturn 7287 27491 60 rts 7288 27492 7289 27492 - ifconst FINESCROLLENABLED 7290 27492 -finescrolldlls 7291 27492 - ldx temp1 ; first DLL index x3 7292 27492 - lda DLLMEM,x 7293 27492 - and #%11110000 7294 27492 - ora finescrolly 7295 27492 - sta DLLMEM,x 7296 27492 - 7297 27492 - ldx temp2 ; last DLL index x3 7298 27492 - lda DLLMEM,x 7299 27492 - and #%11110000 7300 27492 - ora finescrolly 7301 27492 - eor #(WZONEHEIGHT-1) 7302 27492 - sta DLLMEM,x 7303 27492 - rts 7304 27492 endif ; FINESCROLLENABLED 7305 27492 7306 27492 - ifconst USED_ADJUSTVISIBLE 7307 27492 -adjustvisible 7308 27492 - ; called with temp1=first visible zone *3, temp2=last visible zone *3 7309 27492 - jsr waitforvblankstart ; ensure vblank just started 7310 27492 - ldx visibleDLLstart 7311 27492 -findfirstinterrupt 7312 27492 - lda DLLMEM,x 7313 27492 - bmi foundfirstinterrupt 7314 27492 - inx 7315 27492 - inx 7316 27492 - inx 7317 27492 - bne findfirstinterrupt 7318 27492 -foundfirstinterrupt 7319 27492 - and #%01111111 ; clear the interrupt bit 7320 27492 - sta DLLMEM,x 7321 27492 - ifconst DOUBLEBUFFER 7322 27492 - sta DLLMEM+DBOFFSET,x 7323 27492 - endif ; DOUBLEBUFFER 7324 27492 - ldx overscanDLLstart 7325 27492 -findlastinterrupt 7326 27492 - lda DLLMEM,x 7327 27492 - bmi foundlastinterrupt 7328 27492 - dex 7329 27492 - dex 7330 27492 - dex 7331 27492 - bne findlastinterrupt 7332 27492 -foundlastinterrupt 7333 27492 - and #%01111111 ; clear the interrupt bit 7334 27492 - sta DLLMEM,x 7335 27492 - ifconst DOUBLEBUFFER 7336 27492 - sta DLLMEM+DBOFFSET,x 7337 27492 - endif ; DOUBLEBUFFER 7338 27492 - ;now we need to set the new interrupts 7339 27492 - clc 7340 27492 - lda temp1 7341 27492 - adc visibleDLLstart 7342 27492 - tax 7343 27492 - lda DLLMEM,x 7344 27492 - ora #%10000000 7345 27492 - sta DLLMEM,x 7346 27492 - ifconst DOUBLEBUFFER 7347 27492 - sta DLLMEM+DBOFFSET,x 7348 27492 - endif ; DOUBLEBUFFER 7349 27492 - clc 7350 27492 - lda temp2 7351 27492 - adc visibleDLLstart 7352 27492 - tax 7353 27492 - lda DLLMEM,x 7354 27492 - ora #%10000000 7355 27492 - sta DLLMEM,x 7356 27492 - ifconst DOUBLEBUFFER 7357 27492 - sta DLLMEM+DBOFFSET,x 7358 27492 - endif ; DOUBLEBUFFER 7359 27492 - jsr vblankresync 7360 27492 - rts 7361 27492 endif ; USED_ADJUSTVISIBLE 7362 27492 7363 27492 vblankresync 7364 27492 20 30 f5 jsr waitforvblankstart ; ensure vblank just started 7365 27495 a9 00 lda #0 7366 27497 85 4d sta visibleover 7367 27499 a9 03 lda #3 7368 2749b 8d b2 01 sta interruptindex 7369 2749e 60 rts 7370 2749f 7371 2749f createallgamedlls 7372 2749f a2 00 ldx #0 7373 274a1 a9 19 lda #NVLINES 7374 274a3 ac 09 21 ldy paldetected 7375 274a6 f0 03 beq skipcreatePALpadding 7376 274a8 18 clc 7377 274a9 69 15 adc #21 7378 274ab skipcreatePALpadding 7379 274ab 20 e0 f4 jsr createnonvisibledlls 7380 274ae 8e 3c 21 stx visibleDLLstart 7381 274b1 20 11 f5 jsr createvisiblezones 7382 274b4 8e 3d 21 stx overscanDLLstart 7383 274b7 createallgamedllscontinue 7384 274b7 a9 50 lda #(NVLINES+55) ; extras for PAL 7385 274b9 20 e0 f4 jsr createnonvisibledlls 7386 274bc 7387 274bc ae 3c 21 ldx visibleDLLstart 7388 274bf bd 00 18 lda DLLMEM,x 7389 274c2 09 80 ora #%10000000 ; NMI 1 - start of visible screen 7390 274c4 9d 00 18 sta DLLMEM,x 7391 274c7 - ifconst DOUBLEBUFFER 7392 274c7 - sta DLLMEM+DBOFFSET,x 7393 274c7 endif ; DOUBLEBUFFER 7394 274c7 7395 274c7 ae 3d 21 ldx overscanDLLstart 7396 274ca bd 00 18 lda DLLMEM,x 7397 274cd 09 83 ora #%10000011 ; NMI 2 - end of visible screen 7398 274cf 29 f3 and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL 7399 274d1 9d 00 18 sta DLLMEM,x 7400 274d4 - ifconst DOUBLEBUFFER 7401 274d4 - sta DLLMEM+DBOFFSET,x 7402 274d4 endif ; DOUBLEBUFFER 7403 274d4 7404 274d4 e8 inx 7405 274d5 e8 inx 7406 274d6 e8 inx 7407 274d7 7408 274d7 bd 00 18 lda DLLMEM,x 7409 274da 09 80 ora #%10000000 ; NMI 3 - deeper overscan 7410 274dc 9d 00 18 sta DLLMEM,x 7411 274df - ifconst DOUBLEBUFFER 7412 274df - sta DLLMEM+DBOFFSET,x 7413 274df endif ; DOUBLEBUFFER 7414 274df 7415 274df 60 rts 7416 274e0 7417 274e0 createnonvisibledlls 7418 274e0 85 42 sta temp1 7419 274e2 4a lsr 7420 274e3 4a lsr 7421 274e4 4a lsr 7422 274e5 4a lsr ; /16 7423 274e6 f0 09 beq skipcreatenonvisibledlls1loop 7424 274e8 a8 tay 7425 274e9 createnonvisibledlls1loop 7426 274e9 a9 4f lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA 7427 274eb 20 00 f5 jsr createblankdllentry 7428 274ee 88 dey 7429 274ef d0 f8 bne createnonvisibledlls1loop 7430 274f1 skipcreatenonvisibledlls1loop 7431 274f1 a5 42 lda temp1 7432 274f3 29 0f and #%00001111 7433 274f5 f0 08 beq createnonvisibledllsreturn 7434 274f7 38 sec 7435 274f8 e9 01 sbc #1 7436 274fa 09 40 ora #%01000000 7437 274fc 20 00 f5 jsr createblankdllentry 7438 274ff createnonvisibledllsreturn 7439 274ff 60 rts 7440 27500 7441 27500 createblankdllentry 7442 27500 9d 00 18 sta DLLMEM,x 7443 27503 - ifconst DOUBLEBUFFER 7444 27503 - sta DLLMEM+DBOFFSET,x 7445 27503 endif ; DOUBLEBUFFER 7446 27503 e8 inx 7447 27504 a9 21 lda #$21 ; blank 7448 27506 9d 00 18 sta DLLMEM,x 7449 27509 - ifconst DOUBLEBUFFER 7450 27509 - sta DLLMEM+DBOFFSET,x 7451 27509 endif ; DOUBLEBUFFER 7452 27509 e8 inx 7453 2750a a9 00 lda #$00 7454 2750c 9d 00 18 sta DLLMEM,x 7455 2750f - ifconst DOUBLEBUFFER 7456 2750f - sta DLLMEM+DBOFFSET,x 7457 2750f endif ; DOUBLEBUFFER 7458 2750f e8 inx 7459 27510 60 rts 7460 27511 7461 27511 createvisiblezones 7462 27511 a0 00 ldy #0 7463 27513 createvisiblezonesloop 7464 27513 b9 93 f6 lda.w DLHEIGHT,y 7465 27516 09 20 ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones 7466 27518 9d 00 18 sta DLLMEM,x 7467 2751b - ifconst DOUBLEBUFFER 7468 2751b - sta DLLMEM+DBOFFSET,x 7469 2751b endif ; DOUBLEBUFFER 7470 2751b e8 inx 7471 2751c b9 63 f6 lda DLPOINTH,y 7472 2751f 9d 00 18 sta DLLMEM,x 7473 27522 - ifconst DOUBLEBUFFER 7474 27522 - sta DLLMEM+DBOFFSET,x 7475 27522 endif ; DOUBLEBUFFER 7476 27522 e8 inx 7477 27523 b9 7b f6 lda DLPOINTL,y 7478 27526 9d 00 18 sta DLLMEM,x 7479 27529 - ifconst DOUBLEBUFFER 7480 27529 - clc 7481 27529 - adc #DOUBLEBUFFEROFFSET 7482 27529 - sta DLLMEM+DBOFFSET,x 7483 27529 - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... 7484 27529 - inc DLLMEM+DBOFFSET-1,x 7485 27529 -skiphidoublebufferadjust 7486 27529 endif ; DOUBLEBUFFER 7487 27529 e8 inx 7488 2752a c8 iny 7489 2752b c0 18 cpy #WZONECOUNT 7490 2752d d0 e4 bne createvisiblezonesloop 7491 2752f 60 rts 7492 27530 7493 27530 waitforvblankstart 7494 27530 vblankendwait 7495 27530 24 28 BIT MSTAT 7496 27532 30 fc bmi vblankendwait 7497 27534 vblankstartwait 7498 27534 24 28 BIT MSTAT 7499 27536 10 fc bpl vblankstartwait 7500 27538 60 rts 7501 27539 7502 27539 - ifconst DOUBLEBUFFER 7503 27539 -flipdisplaybufferreturn 7504 27539 - rts 7505 27539 -flipdisplaybuffer 7506 27539 - ifconst interrupthold 7507 27539 - lda #$FF 7508 27539 - sta interrupthold 7509 27539 - endif 7510 27539 - lda doublebufferstate 7511 27539 - beq flipdisplaybufferreturn ; exit if we're not in double-buffer 7512 27539 - 7513 27539 - jsr terminatedisplaybuffer ; terminate the working buffer before we flip 7514 27539 - 7515 27539 - lda doublebufferstate 7516 27539 - lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 7517 27539 - tax 7518 27539 - 7519 27539 - ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. 7520 27539 - 7521 27539 -flipdisplaybufferwait1 7522 27539 - lda visibleover 7523 27539 - beq flipdisplaybufferwait1 7524 27539 - 7525 27539 -flipdisplaybufferwait 7526 27539 - lda visibleover 7527 27539 - bne flipdisplaybufferwait 7528 27539 - 7529 27539 - lda doublebufferminimumframetarget 7530 27539 - beq skipminimumframecode 7531 27539 - lda doublebufferminimumframeindex 7532 27539 - bne flipdisplaybufferwait1 7533 27539 - lda doublebufferminimumframetarget 7534 27539 - sta doublebufferminimumframeindex 7535 27539 -skipminimumframecode 7536 27539 - 7537 27539 - lda DLLMEMLutHi,x 7538 27539 - sta DPPH 7539 27539 - lda DLLMEMLutLo,x 7540 27539 - sta DPPL 7541 27539 - 7542 27539 - lda NewPageflipstate,x 7543 27539 - sta doublebufferstate 7544 27539 - lda NewPageflipoffset,x 7545 27539 - sta doublebufferdloffset 7546 27539 - 7547 27539 - lda doublebufferbufferdirty 7548 27539 - beq flipdisplaybufferreturn 7549 27539 - 7550 27539 - ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. 7551 27539 - ; To make savescreen work with the new working buffer, we need to copy over the saved objects 7552 27539 - ; from the displayed buffer to the working buffer... 7553 27539 - 7554 27539 - lda doublebufferdloffset 7555 27539 - eor #DOUBLEBUFFEROFFSET 7556 27539 - sta temp6 ; make temp6 the anti-doublebufferdloffset variable 7557 27539 - 7558 27539 - ldx #(WZONECOUNT-1) 7559 27539 -copybufferzoneloop 7560 27539 - 7561 27539 - lda DLPOINTL,x 7562 27539 - clc 7563 27539 - adc doublebufferdloffset 7564 27539 - sta temp1 7565 27539 - lda DLPOINTH,x 7566 27539 - adc #0 7567 27539 - sta temp2 7568 27539 - 7569 27539 - lda DLPOINTL,x 7570 27539 - clc 7571 27539 - adc temp6 7572 27539 - sta temp3 7573 27539 - lda DLPOINTH,x 7574 27539 - adc #0 7575 27539 - sta temp4 7576 27539 - 7577 27539 - lda dlendsave,x 7578 27539 - tay 7579 27539 -copybuffercharsloop 7580 27539 - lda (temp3),y 7581 27539 - sta (temp1),y 7582 27539 - dey 7583 27539 - bpl copybuffercharsloop 7584 27539 - dex 7585 27539 - bpl copybufferzoneloop 7586 27539 - lda #0 7587 27539 - sta doublebufferbufferdirty 7588 27539 - rts 7589 27539 - 7590 27539 -doublebufferoff 7591 27539 - lda #1 7592 27539 - sta doublebufferstate 7593 27539 - jsr flipdisplaybuffer 7594 27539 - lda #0 7595 27539 - sta doublebufferstate 7596 27539 - sta doublebufferdloffset 7597 27539 - rts 7598 27539 - 7599 27539 -DLLMEMLutLo 7600 27539 - .byte DLLMEM,>(DLLMEM+DBOFFSET) 7603 27539 -NewPageflipstate 7604 27539 - .byte 3,1 7605 27539 -NewPageflipoffset 7606 27539 - .byte DOUBLEBUFFEROFFSET,0 7607 27539 - 7608 27539 endif ; DOUBLEBUFFER 7609 27539 7610 27539 - ifconst MOUSESUPPORT 7611 27539 - 7612 27539 -rotationalcompare 7613 27539 - ; old = 00 01 10 11 7614 27539 - .byte $00, $01, $ff, $00 ; new=00 7615 27539 - .byte $ff, $00, $00, $01 ; new=01 7616 27539 - .byte $01, $00, $00, $ff ; new=10 7617 27539 - .byte $00, $ff, $01, $00 ; new=11 7618 27539 - 7619 27539 - ; 0000YyXx st mouse 7620 27539 - 7621 27539 - ; 0000xyXY amiga mouse 7622 27539 - 7623 27539 - ifconst MOUSEXONLY 7624 27539 -amigatoataribits ; swap bits 1 and 4... 7625 27539 - .byte %0000, %0000, %0010, %0010 7626 27539 - .byte %0000, %0000, %0010, %0010 7627 27539 - .byte %0001, %0001, %0011, %0011 7628 27539 - .byte %0001, %0001, %0011, %0011 7629 27539 - 7630 27539 - ; null change bits 7631 27539 - .byte %0000, %0001, %0010, %0011 7632 27539 - .byte %0000, %0001, %0010, %0011 7633 27539 - .byte %0000, %0001, %0010, %0011 7634 27539 - .byte %0000, %0001, %0010, %0011 7635 27539 - 7636 27539 - else ; !MOUSEXONLY 7637 27539 - 7638 27539 -amigatoataribits ; swap bits 1 and 4... 7639 27539 - .byte %0000, %1000, %0010, %1010 7640 27539 - .byte %0100, %1100, %0110, %1110 7641 27539 - .byte %0001, %1001, %0011, %1011 7642 27539 - .byte %0101, %1101, %0111, %1111 7643 27539 - ; null change bits 7644 27539 - .byte %0000, %0001, %0010, %0011 7645 27539 - .byte %0100, %0101, %0110, %0111 7646 27539 - .byte %1000, %1001, %1010, %1011 7647 27539 - .byte %1100, %1101, %1110, %1111 7648 27539 - endif ; !MOUSEXONLY 7649 27539 - 7650 27539 endif ; MOUSESUPPORT 7651 27539 7652 27539 mouse0update 7653 27539 - ifconst MOUSE0SUPPORT 7654 27539 - 7655 27539 -mousetableselect = inttemp2 7656 27539 -mousexdelta = inttemp3 7657 27539 -mouseydelta = inttemp4 7658 27539 -lastSWCHA = inttemp6 7659 27539 - 7660 27539 - ; 0000YyXx st mouse 7661 27539 - ; 0000xyXY amiga mouse 7662 27539 - 7663 27539 - lda #$ff 7664 27539 - sta lastSWCHA 7665 27539 - 7666 27539 - ldy port0control 7667 27539 - 7668 27539 - lda #%00010000 7669 27539 - cpy #9 ; AMIGA? 7670 27539 - bne skipamigabitsfix0 7671 27539 - lda #0 7672 27539 -skipamigabitsfix0 7673 27539 - sta mousetableselect 7674 27539 - ifconst DRIVINGBOOST 7675 27539 - cpy #6 ; DRIVING? 7676 27539 - bne skipdriving0setup 7677 27539 - ; swap mousex0 and mousey0. mousex seen by the 7800basic program 7678 27539 - ; trails the actual mousex0, so we can smoothly interpolate toward 7679 27539 - ; the actual position. This actual position is stored in mousey0 7680 27539 - ; after the driver has run. 7681 27539 - ldx mousex0 7682 27539 - lda mousey0 7683 27539 - stx mousey0 7684 27539 - sta mousex0 7685 27539 -skipdriving0setup 7686 27539 - endif ; DRIVINGBOOST 7687 27539 - 7688 27539 - lda #0 7689 27539 - sta mousexdelta 7690 27539 - sta mouseydelta 7691 27539 - 7692 27539 - ifnconst MOUSETIME 7693 27539 - ifnconst MOUSEXONLY 7694 27539 - lda #180 ; minimum for x+y 7695 27539 - else 7696 27539 - lda #100 ; minimum for just x 7697 27539 - endif 7698 27539 - else 7699 27539 - lda #MOUSETIME 7700 27539 - endif 7701 27539 - jsr SETTIM64T ; INTIM is in Y 7702 27539 - 7703 27539 -mouse0updateloop 7704 27539 - lda SWCHA 7705 27539 - asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. 7706 27539 - cmp lastSWCHA 7707 27539 - beq mouse0loopcondition 7708 27539 - sta lastSWCHA 7709 27539 - lsr 7710 27539 - lsr 7711 27539 - lsr 7712 27539 - 7713 27539 - ora mousetableselect ; atari/amiga decoding table selection 7714 27539 - 7715 27539 - ; st mice encode on different bits/joystick-lines than amiga mice... 7716 27539 - ; 0000YyXx st mouse 7717 27539 - ; 0000xyXY amiga mouse 7718 27539 - ; ...so can shuffle the amiga bits to reuse the st driver. 7719 27539 - tay 7720 27539 - lax amigatoataribits,y 7721 27539 - 7722 27539 - ifnconst MOUSEXONLY 7723 27539 - ; first the Y... 7724 27539 - and #%00001100 7725 27539 - ora mousecodey0 7726 27539 - tay 7727 27539 - lda rotationalcompare,y 7728 27539 - clc 7729 27539 - adc mouseydelta 7730 27539 - sta mouseydelta 7731 27539 - tya 7732 27539 - lsr 7733 27539 - lsr 7734 27539 - sta mousecodey0 7735 27539 - txa 7736 27539 - ; ...then the X... 7737 27539 - and #%00000011 7738 27539 - tax 7739 27539 - endif ; !MOUSEXONLY 7740 27539 - 7741 27539 - asl 7742 27539 - asl 7743 27539 - ora mousecodex0 7744 27539 - tay 7745 27539 - lda rotationalcompare,y 7746 27539 - adc mousexdelta ; carry was clear by previous ASL 7747 27539 - sta mousexdelta 7748 27539 - stx mousecodex0 7749 27539 -mouse0loopcondition 7750 27539 - lda TIMINT 7751 27539 - bpl mouse0updateloop 7752 27539 - 7753 27539 - ; *** adapt to selected device resolution. 7754 27539 - ldx port0control 7755 27539 - 7756 27539 - ifconst PRECISIONMOUSING 7757 27539 - ldy port0resolution 7758 27539 - bne mouse0halveddone 7759 27539 - cpx #6 ; half-resolution is no good for driving wheels 7760 27539 - beq mouse0halveddone 7761 27539 - ; resolution=0 is half mouse resolution, necessary for precision 7762 27539 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7763 27539 - 7764 27539 - lda mousexdelta 7765 27539 - cmp #$80 7766 27539 - ror ; do a signed divide by 2. 7767 27539 - clc 7768 27539 - adc mousex0 7769 27539 - sta mousex0 7770 27539 - ifnconst MOUSEXONLY 7771 27539 - lda mouseydelta 7772 27539 - clc 7773 27539 - adc mousey0 7774 27539 - sta mousey0 7775 27539 - endif 7776 27539 - ; at half resolution we just exit after updating x and y 7777 27539 - jmp LLRET0 7778 27539 -mouse0halveddone 7779 27539 - endif ; PRECISIONMOUSING 7780 27539 - 7781 27539 - ifnconst MOUSEXONLY 7782 27539 - asl mouseydelta ; *2 because Y resolution is finer 7783 27539 - ldy port0resolution 7784 27539 - dey 7785 27539 - lda #0 7786 27539 -mousey0resolutionfix 7787 27539 - clc 7788 27539 - adc mouseydelta 7789 27539 - dey 7790 27539 - bpl mousey0resolutionfix 7791 27539 - clc 7792 27539 - adc mousey0 7793 27539 - sta mousey0 7794 27539 - endif ; MOUSEXONLY 7795 27539 - 7796 27539 - ldy port0resolution 7797 27539 - dey 7798 27539 - lda #0 7799 27539 -mousex0resolutionfix 7800 27539 - clc 7801 27539 - adc mousexdelta 7802 27539 - dey 7803 27539 - bpl mousex0resolutionfix 7804 27539 - ifnconst DRIVINGBOOST 7805 27539 - clc 7806 27539 - adc mousex0 7807 27539 - sta mousex0 7808 27539 - else 7809 27539 - cpx #6 7810 27539 - beq carryonmouse0boost 7811 27539 - clc 7812 27539 - adc mousex0 7813 27539 - sta mousex0 7814 27539 - jmp LLRET0 7815 27539 -carryonmouse0boost 7816 27539 - sta mousexdelta 7817 27539 - clc 7818 27539 - adc mousecodey0 7819 27539 - sta mousecodey0 7820 27539 - clc 7821 27539 - adc mousex0 7822 27539 - tay ; save the target X 7823 27539 - adc mousey0 ; average in the smoothly-trailing X 7824 27539 - ror 7825 27539 - sta mousex0 ; mousex0 now has the smoothly trailing X 7826 27539 - sty mousey0 ; and mousey0 has the the target X 7827 27539 - 7828 27539 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 7829 27539 - ; A has mousex0, the smoothly trailing X 7830 27539 - sbc mousey0 ; less the target X 7831 27539 - bpl skipabsolutedrive0 7832 27539 - eor #$ff 7833 27539 -skipabsolutedrive0 7834 27539 - cmp #64 ; just an unreasonably large change 7835 27539 - bcc skipdrivewrapfix0 7836 27539 - sty mousex0 ; if X wrapped, we catch the trailing X up to the target X 7837 27539 -skipdrivewrapfix0 7838 27539 - 7839 27539 - ; get rid of the tweening if the distance travelled was very small 7840 27539 - lda mousexdelta 7841 27539 - cmp port0resolution 7842 27539 - bcs skipbetweenfix0 7843 27539 - lda mousex0 7844 27539 - sta mousey0 7845 27539 -skipbetweenfix0 7846 27539 - 7847 27539 -drivingboostreductioncheck0 7848 27539 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 7849 27539 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 7850 27539 - ; negated again because truncation during BCD math results in 7851 27539 - ; differing magnitudes, depending if the value is +ve or -ve. 7852 27539 -driving0fix 7853 27539 - lax mousecodey0 7854 27539 - cmp #$80 7855 27539 - bcs driving0skipnegate1 7856 27539 - eor #$FF 7857 27539 - adc #1 7858 27539 - sta mousecodey0 7859 27539 -driving0skipnegate1 7860 27539 - cmp #$80 7861 27539 - ror 7862 27539 - cmp #$80 7863 27539 - ror 7864 27539 - cmp #$80 7865 27539 - ror 7866 27539 - sta inttemp1 7867 27539 - lda mousecodey0 7868 27539 - sec 7869 27539 - sbc inttemp1 7870 27539 - cpx #$80 7871 27539 - bcs driving0skipnegate2 7872 27539 - eor #$FF 7873 27539 - adc #1 7874 27539 -driving0skipnegate2 7875 27539 - sta mousecodey0 7876 27539 -drivingboostdone0 7877 27539 - endif ; DRIVINGBOOST 7878 27539 - 7879 27539 - jmp LLRET0 7880 27539 - 7881 27539 endif ; MOUSE0SUPPORT 7882 27539 7883 27539 mouse1update 7884 27539 - ifconst MOUSE1SUPPORT 7885 27539 - 7886 27539 -mousetableselect = inttemp2 7887 27539 -mousexdelta = inttemp3 7888 27539 -mouseydelta = inttemp4 7889 27539 -lastSWCHA = inttemp6 7890 27539 - 7891 27539 - ; 0000YyXx st mouse 7892 27539 - ; 0000xyXY amiga mouse 7893 27539 - 7894 27539 - lda #$ff 7895 27539 - sta lastSWCHA 7896 27539 - 7897 27539 - ldy port1control 7898 27539 - 7899 27539 - lda #%00010000 7900 27539 - cpy #9 ; AMIGA? 7901 27539 - bne skipamigabitsfix1 7902 27539 - lda #0 7903 27539 -skipamigabitsfix1 7904 27539 - sta mousetableselect 7905 27539 - ifconst DRIVINGBOOST 7906 27539 - cpy #6 ; DRIVING? 7907 27539 - bne skipdriving1setup 7908 27539 - ; swap mousex1 and mousey1. mousex seen by the 7800basic program 7909 27539 - ; trails the actual mousex1, so we can smoothly interpolate toward 7910 27539 - ; the actual position. This actual position is stored in mousey1 7911 27539 - ; after the driver has run. 7912 27539 - ldx mousex1 7913 27539 - lda mousey1 7914 27539 - stx mousey1 7915 27539 - sta mousex1 7916 27539 -skipdriving1setup 7917 27539 - endif ; DRIVINGBOOST 7918 27539 - 7919 27539 - lda #0 7920 27539 - sta mousexdelta 7921 27539 - sta mouseydelta 7922 27539 - 7923 27539 - ifnconst MOUSETIME 7924 27539 - ifnconst MOUSEXONLY 7925 27539 - lda #180 ; minimum for x+y 7926 27539 - else 7927 27539 - lda #100 ; minimum for just x 7928 27539 - endif 7929 27539 - else 7930 27539 - lda #MOUSETIME 7931 27539 - endif 7932 27539 - jsr SETTIM64T ; INTIM is in Y 7933 27539 - 7934 27539 -mouse1updateloop 7935 27539 - lda SWCHA 7936 27539 - and #%00001111 7937 27539 - cmp lastSWCHA 7938 27539 - beq mouse1loopcondition 7939 27539 - sta lastSWCHA 7940 27539 - 7941 27539 - ora mousetableselect ; atari/amiga decoding table selection 7942 27539 - 7943 27539 - ; st mice encode on different bits/joystick-lines than amiga mice... 7944 27539 - ; 0000YyXx st mouse 7945 27539 - ; 0000xyXY amiga mouse 7946 27539 - ; ...so can shuffle the amiga bits to reuse the st driver. 7947 27539 - tay 7948 27539 - lax amigatoataribits,y 7949 27539 - 7950 27539 - ifnconst MOUSEXONLY 7951 27539 - ; first the Y... 7952 27539 - and #%00001100 7953 27539 - ora mousecodey1 7954 27539 - tay 7955 27539 - lda rotationalcompare,y 7956 27539 - clc 7957 27539 - adc mouseydelta 7958 27539 - sta mouseydelta 7959 27539 - tya 7960 27539 - lsr 7961 27539 - lsr 7962 27539 - sta mousecodey1 7963 27539 - txa 7964 27539 - ; ...then the X... 7965 27539 - and #%00000011 7966 27539 - tax 7967 27539 - endif ; !MOUSEXONLY 7968 27539 - 7969 27539 - asl 7970 27539 - asl 7971 27539 - ora mousecodex1 7972 27539 - tay 7973 27539 - lda rotationalcompare,y 7974 27539 - adc mousexdelta ; carry was clear by previous ASL 7975 27539 - sta mousexdelta 7976 27539 - stx mousecodex1 7977 27539 -mouse1loopcondition 7978 27539 - lda TIMINT 7979 27539 - bpl mouse1updateloop 7980 27539 - 7981 27539 - ; *** adapt to selected device resolution. 7982 27539 - ldx port1control 7983 27539 - 7984 27539 - ifconst PRECISIONMOUSING 7985 27539 - ldy port1resolution 7986 27539 - bne mouse1halveddone 7987 27539 - cpx #6 ; half-resolution is no good for driving wheels 7988 27539 - beq mouse1halveddone 7989 27539 - ; resolution=0 is half mouse resolution, necessary for precision 7990 27539 - ; mousing on a 160x240 screen with a 1000 dpi mouse. 7991 27539 - 7992 27539 - lda mousexdelta 7993 27539 - cmp #$80 7994 27539 - ror ; do a signed divide by 2. 7995 27539 - clc 7996 27539 - adc mousex1 7997 27539 - sta mousex1 7998 27539 - ifnconst MOUSEXONLY 7999 27539 - lda mouseydelta 8000 27539 - clc 8001 27539 - adc mousey1 8002 27539 - sta mousey1 8003 27539 - endif 8004 27539 - ; at half resolution we just exit after updating x and y 8005 27539 - jmp LLRET1 8006 27539 -mouse1halveddone 8007 27539 - endif ; PRECISIONMOUSING 8008 27539 - 8009 27539 - ifnconst MOUSEXONLY 8010 27539 - asl mouseydelta ; *2 because Y resolution is finer 8011 27539 - ldy port1resolution 8012 27539 - dey 8013 27539 - lda #0 8014 27539 -mousey1resolutionfix 8015 27539 - clc 8016 27539 - adc mouseydelta 8017 27539 - dey 8018 27539 - bpl mousey1resolutionfix 8019 27539 - clc 8020 27539 - adc mousey1 8021 27539 - sta mousey1 8022 27539 - endif ; MOUSEXONLY 8023 27539 - 8024 27539 - ldy port1resolution 8025 27539 - dey 8026 27539 - lda #0 8027 27539 -mousex1resolutionfix 8028 27539 - clc 8029 27539 - adc mousexdelta 8030 27539 - dey 8031 27539 - bpl mousex1resolutionfix 8032 27539 - ifnconst DRIVINGBOOST 8033 27539 - clc 8034 27539 - adc mousex1 8035 27539 - sta mousex1 8036 27539 - else 8037 27539 - cpx #6 8038 27539 - beq carryonmouse1boost 8039 27539 - clc 8040 27539 - adc mousex1 8041 27539 - sta mousex1 8042 27539 - jmp LLRET1 8043 27539 -carryonmouse1boost 8044 27539 - sta mousexdelta 8045 27539 - clc 8046 27539 - adc mousecodey1 8047 27539 - sta mousecodey1 8048 27539 - clc 8049 27539 - adc mousex1 8050 27539 - tay ; save the target X 8051 27539 - adc mousey1 ; average in the smoothly-trailing X 8052 27539 - ror 8053 27539 - sta mousex1 ; mousex0 now has the smoothly trailing X 8054 27539 - sty mousey1 ; and mousey0 has the the target X 8055 27539 - 8056 27539 - ; check to see if the coordinate wrapped. If so, undo the averaging code. 8057 27539 - ; A has mousex1, the smoothly trailing X 8058 27539 - sbc mousey1 ; less the target X 8059 27539 - bpl skipabsolutedrive1 8060 27539 - eor #$ff 8061 27539 -skipabsolutedrive1 8062 27539 - cmp #64 ; just an unreasonably large change 8063 27539 - bcc skipdrivewrapfix1 8064 27539 - sty mousex1 ; if X wrapped, we catch the trailing X up to the target X 8065 27539 -skipdrivewrapfix1 8066 27539 - 8067 27539 - ; get rid of the tweening if the distance travelled was very small 8068 27539 - lda mousexdelta 8069 27539 - cmp port1resolution 8070 27539 - bcs skipbetweenfix1 8071 27539 - lda mousex1 8072 27539 - sta mousey1 8073 27539 -skipbetweenfix1 8074 27539 - 8075 27539 -drivingboostreductioncheck1 8076 27539 - ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) 8077 27539 - ; +ve mousecodey0 is converted to -ve to do the calculation, and then 8078 27539 - ; negated again because truncation during BCD math results in 8079 27539 - ; differing magnitudes, depending if the value is +ve or -ve. 8080 27539 -driving1fix 8081 27539 - lax mousecodey1 8082 27539 - cmp #$80 8083 27539 - bcs driving0skipnegate1 8084 27539 - eor #$FF 8085 27539 - adc #1 8086 27539 - sta mousecodey1 8087 27539 -driving0skipnegate1 8088 27539 - cmp #$80 8089 27539 - ror 8090 27539 - cmp #$80 8091 27539 - ror 8092 27539 - cmp #$80 8093 27539 - ror 8094 27539 - sta inttemp1 8095 27539 - lda mousecodey1 8096 27539 - sec 8097 27539 - sbc inttemp1 8098 27539 - cpx #$80 8099 27539 - bcs driving1skipnegate2 8100 27539 - eor #$FF 8101 27539 - adc #1 8102 27539 -driving1skipnegate2 8103 27539 - sta mousecodey1 8104 27539 -drivingboostdone1 8105 27539 - endif ; DRIVINGBOOST 8106 27539 - 8107 27539 - jmp LLRET1 8108 27539 - 8109 27539 endif ; MOUSE1SUPPORT 8110 27539 8111 27539 8112 27539 trakball0update 8113 27539 - ifconst TRAKBALL0SUPPORT 8114 27539 - ifnconst TRAKTIME 8115 27539 - ifnconst TRAKXONLY 8116 27539 - lda #180 ; minimum for x+y 8117 27539 - else ; !TRAKXONLY 8118 27539 - lda #100 ; minimum for just x 8119 27539 - endif ; !TRAKXONLY 8120 27539 - else ; !TRAKTIME 8121 27539 - lda #TRAKTIME 8122 27539 - endif ; !TRAKTIME 8123 27539 - jsr SETTIM64T ; INTIM is in Y 8124 27539 - ldx #0 8125 27539 - ifnconst TRAKXONLY 8126 27539 - ldy #0 8127 27539 - endif ; TRAKXONLY 8128 27539 -trakball0updateloop 8129 27539 - lda SWCHA 8130 27539 - and #%00110000 8131 27539 - cmp trakballcodex0 8132 27539 - sta trakballcodex0 8133 27539 - beq trakball0movementXdone 8134 27539 - and #%00010000 8135 27539 - beq trakball0negativeX 8136 27539 -trakball0positiveX 8137 27539 - ;(2 from beq) 8138 27539 - inx ; 2 8139 27539 - jmp trakball0movementXdone ; 3 8140 27539 -trakball0negativeX 8141 27539 - ;(3 from beq) 8142 27539 - dex ; 2 8143 27539 - nop ; 2 8144 27539 -trakball0movementXdone 8145 27539 - 8146 27539 - ifnconst TRAKXONLY 8147 27539 - lda SWCHA 8148 27539 - and #%11000000 8149 27539 - cmp trakballcodey0 8150 27539 - sta trakballcodey0 8151 27539 - beq trakball0movementYdone 8152 27539 - and #%01000000 8153 27539 - beq trakball0negativeY 8154 27539 -trakball0positiveY 8155 27539 - ;(2 from beq) 8156 27539 - iny ; 2 8157 27539 - jmp trakball0movementYdone ; 3 8158 27539 -trakball0negativeY 8159 27539 - ;(3 from beq) 8160 27539 - dey ; 2 8161 27539 - nop ; 2 8162 27539 -trakball0movementYdone 8163 27539 - endif ; !TRAKXONLY 8164 27539 - 8165 27539 - lda TIMINT 8166 27539 - bpl trakball0updateloop 8167 27539 - lda #0 8168 27539 - cpx #0 8169 27539 - beq trakball0skipXadjust 8170 27539 - clc 8171 27539 -trakball0Xloop 8172 27539 - adc port0resolution 8173 27539 - dex 8174 27539 - bne trakball0Xloop 8175 27539 - clc 8176 27539 - adc trakballx0 8177 27539 - sta trakballx0 8178 27539 -trakball0skipXadjust 8179 27539 - ifnconst TRAKXONLY 8180 27539 - lda #0 8181 27539 - cpy #0 8182 27539 - beq trakball0skipYadjust 8183 27539 - clc 8184 27539 -trakball0yloop 8185 27539 - adc port0resolution 8186 27539 - dey 8187 27539 - bne trakball0yloop 8188 27539 - clc 8189 27539 - adc trakbally0 8190 27539 - sta trakbally0 8191 27539 -trakball0skipYadjust 8192 27539 - endif ; !TRAKXONLY 8193 27539 - 8194 27539 - jmp LLRET0 8195 27539 endif 8196 27539 8197 27539 8198 27539 8199 27539 trakball1update 8200 27539 - ifconst TRAKBALL1SUPPORT 8201 27539 - ifnconst TRAKTIME 8202 27539 - ifnconst TRAKXONLY 8203 27539 - lda #180 ; minimum for x+y 8204 27539 - else ; !TRAKXONLY 8205 27539 - lda #100 ; minimum for just x 8206 27539 - endif ; !TRAKXONLY 8207 27539 - else ; !TRAKTIME 8208 27539 - lda #TRAKTIME 8209 27539 - endif ; !TRAKTIME 8210 27539 - jsr SETTIM64T ; INTIM is in Y 8211 27539 - ldx #0 8212 27539 - ifnconst TRAKXONLY 8213 27539 - ldy #0 8214 27539 - endif ; TRAKXONLY 8215 27539 -trakball1updateloop 8216 27539 - lda SWCHA 8217 27539 - and #%00000011 8218 27539 - cmp trakballcodex1 8219 27539 - sta trakballcodex1 8220 27539 - beq trakball1movementXdone 8221 27539 - and #%00000001 8222 27539 - beq trakball1negativeX 8223 27539 -trakball1positiveX 8224 27539 - ;(2 from beq) 8225 27539 - inx ; 2 8226 27539 - jmp trakball1movementXdone ; 3 8227 27539 -trakball1negativeX 8228 27539 - ;(3 from beq) 8229 27539 - dex ; 2 8230 27539 - nop ; 2 8231 27539 -trakball1movementXdone 8232 27539 - 8233 27539 - ifnconst TRAKXONLY 8234 27539 - lda SWCHA 8235 27539 - and #%00001100 8236 27539 - cmp trakballcodey1 8237 27539 - sta trakballcodey1 8238 27539 - beq trakball1movementYdone 8239 27539 - and #%00000100 8240 27539 - beq trakball1negativeY 8241 27539 -trakball1positiveY 8242 27539 - ;(2 from beq) 8243 27539 - iny ; 2 8244 27539 - jmp trakball1movementYdone ; 3 8245 27539 -trakball1negativeY 8246 27539 - ;(3 from beq) 8247 27539 - dey ; 2 8248 27539 - nop ; 2 8249 27539 -trakball1movementYdone 8250 27539 - endif ; !TRAKXONLY 8251 27539 - 8252 27539 - lda TIMINT 8253 27539 - bpl trakball1updateloop 8254 27539 - lda #0 8255 27539 - cpx #0 8256 27539 - beq trakball1skipXadjust 8257 27539 - clc 8258 27539 -trakball1Xloop 8259 27539 - adc port1resolution 8260 27539 - dex 8261 27539 - bne trakball1Xloop 8262 27539 - clc 8263 27539 - adc trakballx1 8264 27539 - sta trakballx1 8265 27539 -trakball1skipXadjust 8266 27539 - ifnconst TRAKXONLY 8267 27539 - lda #0 8268 27539 - cpy #0 8269 27539 - beq trakball1skipYadjust 8270 27539 - clc 8271 27539 -trakball1yloop 8272 27539 - adc port1resolution 8273 27539 - dey 8274 27539 - bne trakball1yloop 8275 27539 - clc 8276 27539 - adc trakbally1 8277 27539 - sta trakbally1 8278 27539 -trakball1skipYadjust 8279 27539 - endif ; !TRAKXONLY 8280 27539 - 8281 27539 - jmp LLRET1 8282 27539 endif 8283 27539 8284 27539 8285 27539 paddleport0update 8286 27539 - ifconst PADDLE0SUPPORT 8287 27539 - lda #6 8288 27539 - sta VBLANK ; start charging the paddle caps 8289 27539 - lda #0 ; use PADDLE timing 8290 27539 - jsr SETTIM64T ; INTIM is in Y 8291 27539 - 8292 27539 -paddleport0updateloop 8293 27539 - lda INPT0 8294 27539 - bmi skippaddle0setposition 8295 27539 - sty paddleposition0 8296 27539 -skippaddle0setposition 8297 27539 - ifconst TWOPADDLESUPPORT 8298 27539 - lda INPT1 8299 27539 - bmi skippaddle1setposition 8300 27539 - sty paddleposition1 8301 27539 -skippaddle1setposition 8302 27539 - endif 8303 27539 - ldy INTIM 8304 27539 - cpy #TIMEOFFSET 8305 27539 - bcs paddleport0updateloop 8306 27539 - 8307 27539 - lda #%10000110 8308 27539 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8309 27539 - sec 8310 27539 - lda paddleposition0 8311 27539 - sbc #TIMEOFFSET 8312 27539 - ifconst PADDLESCALEX2 8313 27539 - asl 8314 27539 - endif 8315 27539 - 8316 27539 - ifnconst PADDLESMOOTHINGOFF 8317 27539 - clc 8318 27539 - adc paddleprevious0 8319 27539 - ror 8320 27539 - sta paddleprevious0 8321 27539 - endif 8322 27539 - 8323 27539 - sta paddleposition0 8324 27539 - 8325 27539 - ifconst TWOPADDLESUPPORT 8326 27539 - sec 8327 27539 - lda paddleposition1 8328 27539 - sbc #TIMEOFFSET 8329 27539 - ifconst PADDLESCALEX2 8330 27539 - asl 8331 27539 - endif 8332 27539 - 8333 27539 - ifnconst PADDLESMOOTHINGOFF 8334 27539 - clc 8335 27539 - adc paddleprevious1 8336 27539 - ror 8337 27539 - sta paddleprevious1 8338 27539 - endif 8339 27539 - sta paddleposition1 8340 27539 - endif ; TWOPADDLESUPPORT 8341 27539 - 8342 27539 - jmp LLRET0 8343 27539 endif 8344 27539 8345 27539 paddleport1update 8346 27539 - ifconst PADDLE1SUPPORT 8347 27539 - lda #6 8348 27539 - sta VBLANK ; start charging the paddle caps 8349 27539 - 8350 27539 - lda #0 ; use PADDLE timing 8351 27539 - jsr SETTIM64T ; INTIM is in Y 8352 27539 - 8353 27539 -paddleport1updateloop 8354 27539 - lda INPT2 8355 27539 - bmi skippaddle2setposition 8356 27539 - sty paddleposition2 8357 27539 -skippaddle2setposition 8358 27539 - ifconst TWOPADDLESUPPORT 8359 27539 - lda INPT3 8360 27539 - bmi skippaddle3setposition 8361 27539 - sty paddleposition3 8362 27539 -skippaddle3setposition 8363 27539 - endif 8364 27539 - ldy INTIM 8365 27539 - cpy #TIMEOFFSET 8366 27539 - bcs paddleport1updateloop 8367 27539 - 8368 27539 - lda #%10000110 8369 27539 - sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers 8370 27539 - sec 8371 27539 - lda paddleposition2 8372 27539 - sbc #TIMEOFFSET 8373 27539 - ifconst PADDLESCALEX2 8374 27539 - asl 8375 27539 - endif 8376 27539 - 8377 27539 - ifnconst PADDLESMOOTHINGOFF 8378 27539 - clc 8379 27539 - adc paddleprevious2 8380 27539 - ror 8381 27539 - sta paddleprevious2 8382 27539 - endif 8383 27539 - 8384 27539 - sta paddleposition2 8385 27539 - 8386 27539 - ifconst TWOPADDLESUPPORT 8387 27539 - sec 8388 27539 - lda paddleposition3 8389 27539 - sbc #TIMEOFFSET 8390 27539 - ifconst PADDLESCALEX2 8391 27539 - asl 8392 27539 - endif 8393 27539 - 8394 27539 - ifnconst PADDLESMOOTHINGOFF 8395 27539 - clc 8396 27539 - adc paddleprevious3 8397 27539 - ror 8398 27539 - sta paddleprevious3 8399 27539 - endif 8400 27539 - sta paddleposition3 8401 27539 - endif ; TWOPADDLESUPPORT 8402 27539 - 8403 27539 - jmp LLRET1 8404 27539 endif 8405 27539 8406 27539 8407 27539 paddlebuttonhandler ; outside of conditional, for button-handler LUT 8408 27539 - ifconst PADDLESUPPORT 8409 27539 - ; x=0|1 for port, rather than paddle #. 8410 27539 - ; Only the first paddle button will integrate into "joy0fire" testing. If the 8411 27539 - ; game wants to support 2 paddles, up to the game to instead test the 8412 27539 - ; joystick right+left directions instead. 8413 27539 - lda SWCHA ; top of nibble is first paddle button 8414 27539 - cpx #0 ; port 0? 8415 27539 - beq skippaddleport2shift 8416 27539 - asl ; shift second port to upper nibble 8417 27539 - asl 8418 27539 - asl 8419 27539 - asl 8420 27539 -skippaddleport2shift 8421 27539 - and #%10000000 8422 27539 - eor #%10000000 ; invert 8423 27539 - sta sINPT1,x 8424 27539 - jmp buttonreadloopreturn 8425 27539 endif ; PADDLESUPPORT 8426 27539 8427 27539 mousebuttonhandler ; outside of conditional, for button-handler LUT 8428 27539 - ifconst MOUSESUPPORT 8429 27539 - ; stick the mouse buttons in the correct shadow register... 8430 27539 - txa 8431 27539 - asl 8432 27539 - tay ; y=x*2 8433 27539 - lda INPT4,x 8434 27539 - eor #%10000000 8435 27539 - lsr 8436 27539 - sta sINPT1,x 8437 27539 - 8438 27539 - lda INPT1,y 8439 27539 - and #%10000000 8440 27539 - eor #%10000000 8441 27539 - ora sINPT1,x 8442 27539 - sta sINPT1,x 8443 27539 - jmp buttonreadloopreturn 8444 27539 endif ; MOUSESUPPORT 8445 27539 8446 27539 - ifconst KEYPADSUPPORT 8447 27539 - ; ** select keypad rows 0 to 3 over 4 frames... 8448 27539 -keypadrowselect 8449 27539 - ldy #0 8450 27539 - lda port0control 8451 27539 - cmp #7 8452 27539 - bne skipport0val 8453 27539 - iny ; y=y+1 8454 27539 -skipport0val 8455 27539 - lda port1control 8456 27539 - cmp #7 8457 27539 - bne skipport1val 8458 27539 - iny 8459 27539 - iny ; y=y+2 8460 27539 -skipport1val 8461 27539 - lda keyrowdirectionmask,y 8462 27539 - sta CTLSWA 8463 27539 - tya 8464 27539 - asl 8465 27539 - asl 8466 27539 - sta inttemp1 8467 27539 - lda framecounter 8468 27539 - and #3 8469 27539 - ora inttemp1 8470 27539 - tax 8471 27539 - lda keyrowselectvalue,x 8472 27539 - sta SWCHA 8473 27539 - rts 8474 27539 - 8475 27539 -keyrowdirectionmask 8476 27539 - .byte #%00000000 ; 0 : port0=input port1=input 8477 27539 - .byte #%11110000 ; 1 : port0=output port1=input 8478 27539 - .byte #%00001111 ; 2 : port0=input port1=output 8479 27539 - .byte #%11111111 ; 3 : port0=output port1=output 8480 27539 - 8481 27539 -keyrowselectvalue 8482 27539 - .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always 8483 27539 - .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in 8484 27539 - .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in 8485 27539 - .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in 8486 27539 endif ; KEYPADSUPPORT 8487 27539 8488 27539 - ifconst KEYPADSUPPORT 8489 27539 - ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT 8490 27539 -keypadcolumnread 8491 27539 - lda port0control 8492 27539 - cmp #7 8493 27539 - bne skipkeypadcolumnread0 8494 27539 - lda framecounter 8495 27539 - and #3 8496 27539 - asl ; x2 because keypad variables are interleaved 8497 27539 - tax 8498 27539 - lda #0 8499 27539 - sta keypadmatrix0a,x 8500 27539 - lda INPT0 8501 27539 - cmp #$80 8502 27539 - rol keypadmatrix0a,x 8503 27539 - lda INPT1 8504 27539 - cmp #$80 8505 27539 - rol keypadmatrix0a,x 8506 27539 - lda INPT4 8507 27539 - cmp #$80 8508 27539 - rol keypadmatrix0a,x 8509 27539 - lda keypadmatrix0a,x 8510 27539 - eor #%00000111 8511 27539 - sta keypadmatrix0a,x 8512 27539 -skipkeypadcolumnread0 8513 27539 - 8514 27539 - lda port1control 8515 27539 - cmp #7 8516 27539 - bne skipkeypadcolumnread1 8517 27539 - lda framecounter 8518 27539 - and #3 8519 27539 - asl ; x2 because keypad variables are interleaved 8520 27539 - tax 8521 27539 - lda #0 8522 27539 - sta keypadmatrix1a,x 8523 27539 - rol keypadmatrix1a,x 8524 27539 - lda INPT2 8525 27539 - cmp #$80 8526 27539 - rol keypadmatrix1a,x 8527 27539 - lda INPT3 8528 27539 - cmp #$80 8529 27539 - rol keypadmatrix1a,x 8530 27539 - lda INPT5 8531 27539 - cmp #$80 8532 27539 - rol keypadmatrix1a,x 8533 27539 - lda keypadmatrix1a,x 8534 27539 - eor #%00000111 8535 27539 - sta keypadmatrix1a,x 8536 27539 -skipkeypadcolumnread1 8537 27539 - rts 8538 27539 endif ; KEYPADSUPPORT 8539 27539 8540 27539 setportforinput 8541 27539 a5 e4 lda CTLSWAs 8542 2753b 3d 44 f5 and allpinsinputlut,x 8543 2753e 85 e4 sta CTLSWAs 8544 27540 8d 81 02 sta CTLSWA 8545 27543 60 rts 8546 27544 8547 27544 allpinsinputlut 8548 27544 0f f0 .byte.b $0F, $F0 8549 27546 8550 27546 setonebuttonmode 8551 27546 a9 06 lda #6 ; in case we're in unlocked-bios mode 8552 27548 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8553 2754a a9 14 lda #$14 8554 2754c 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8555 2754f a5 e5 lda CTLSWBs 8556 27551 1d 5a f5 ora thisjoy2buttonbit,x 8557 27554 85 e5 sta CTLSWBs 8558 27556 8d 82 02 sta SWCHB ; turn off the 2-button disable bits 8559 27559 60 rts 8560 2755a 8561 2755a thisjoy2buttonbit 8562 2755a 04 10 .byte.b $04, $10 8563 2755c 8564 2755c settwobuttonmode 8565 2755c a9 06 lda #6 ; in case we're in unlocked-bios mode 8566 2755e 85 01 sta VBLANK ; if we were on paddles, the line is grounded out. 8567 27560 a9 14 lda #$14 8568 27562 8d 83 02 sta CTLSWB ; set both 2-button disable bits to writable 8569 27565 a5 e5 lda CTLSWBs 8570 27567 3d 70 f5 and thisjoy2buttonmask,x 8571 2756a 85 e5 sta CTLSWBs 8572 2756c 8d 82 02 sta SWCHB 8573 2756f 60 rts 8574 27570 8575 27570 thisjoy2buttonmask 8576 27570 fb ef .byte.b $fb, $ef 8577 27572 8578 27572 ; Provided under the CC0 license. See the included LICENSE.txt for details. 8579 27572 8580 27572 START 8581 27572 start 8582 27572 8583 27572 ;******** more or less the Atari recommended startup procedure 8584 27572 8585 27572 78 sei 8586 27573 d8 cld 8587 27574 8588 27574 ifnconst NOTIALOCK 8589 27574 a9 07 lda #$07 8590 27576 - else 8591 27576 - lda #$06 8592 27576 endif 8593 27576 85 01 sta INPTCTRL ;lock 7800 into 7800 mode 8594 27578 a9 7f lda #$7F 8595 2757a 85 3c sta CTRL ;disable DMA 8596 2757c a9 00 lda #$00 8597 2757e 85 38 sta OFFSET 8598 27580 ifnconst NOTIALOCK 8599 27580 85 01 sta INPTCTRL 8600 27582 85 20 sta BACKGRND ; black default, in case a flash cart is using something else 8601 27584 endif 8602 27584 a2 ff ldx #$FF 8603 27586 9a txs 8604 27587 8605 27587 ;************** Clear Memory 8606 27587 8607 27587 a2 40 ldx #$40 8608 27589 a9 00 lda #$00 8609 2758b crloop1 8610 2758b 95 00 sta $00,x ;Clear zero page 8611 2758d 9d 00 01 sta $100,x ;Clear page 1 8612 27590 e8 inx 8613 27591 d0 f8 bne crloop1 8614 27593 8615 27593 8616 27593 a0 00 ldy #$00 ;Clear Ram 8617 27595 a9 18 lda #$18 ;Start at $1800 8618 27597 85 81 sta $81 8619 27599 a9 00 lda #$00 8620 2759b 85 80 sta $80 8621 2759d crloop3 8622 2759d a9 00 lda #$00 8623 2759f 91 80 sta ($80),y ;Store data 8624 275a1 c8 iny ;Next byte 8625 275a2 d0 f9 bne crloop3 ;Branch if not done page 8626 275a4 e6 81 inc $81 ;Next page 8627 275a6 a5 81 lda $81 8628 275a8 c9 20 cmp #$20 ;End at $1FFF 8629 275aa d0 f1 bne crloop3 ;Branch if not 8630 275ac 8631 275ac a0 00 ldy #$00 ;Clear Ram 8632 275ae a9 22 lda #$22 ;Start at $2200 8633 275b0 85 81 sta $81 8634 275b2 a9 00 lda #$00 8635 275b4 85 80 sta $80 8636 275b6 crloop4 8637 275b6 a9 00 lda #$00 8638 275b8 91 80 sta ($80),y ;Store data 8639 275ba c8 iny ;Next byte 8640 275bb d0 f9 bne crloop4 ;Branch if not done page 8641 275bd e6 81 inc $81 ;Next page 8642 275bf a5 81 lda $81 8643 275c1 c9 27 cmp #$27 ;End at $27FF 8644 275c3 d0 f1 bne crloop4 ;Branch if not 8645 275c5 8646 275c5 a2 00 ldx #$00 8647 275c7 a9 00 lda #$00 8648 275c9 crloop5 ;Clear 2100-213F, 2000-203F 8649 275c9 9d 00 20 sta $2000,x 8650 275cc 9d 00 21 sta $2100,x 8651 275cf e8 inx 8652 275d0 e0 40 cpx #$40 8653 275d2 d0 f5 bne crloop5 8654 275d4 8655 275d4 85 80 sta $80 8656 275d6 85 81 sta $81 8657 275d8 85 82 sta $82 8658 275da 85 83 sta $83 8659 275dc 8660 275dc ;seed random number with hopefully-random timer value 8661 275dc a9 01 lda #1 8662 275de 0d 84 02 ora INTIM 8663 275e1 85 40 sta rand 8664 275e3 8665 275e3 ; detect the console type... 8666 275e3 pndetectvblankstart 8667 275e3 a5 28 lda MSTAT 8668 275e5 10 fc bpl pndetectvblankstart ; if we're not in VBLANK, wait for it to start 8669 275e7 pndetectvblankover 8670 275e7 a5 28 lda MSTAT 8671 275e9 30 fc bmi pndetectvblankover ; then wait for it to be over 8672 275eb a0 00 ldy #$00 8673 275ed a2 00 ldx #$00 8674 275ef pndetectvblankhappening 8675 275ef a5 28 lda MSTAT 8676 275f1 30 07 bmi pndetectinvblank ; if VBLANK starts, exit our counting loop 8677 275f3 85 24 sta WSYNC 8678 275f5 85 24 sta WSYNC 8679 275f7 e8 inx 8680 275f8 d0 f5 bne pndetectvblankhappening 8681 275fa pndetectinvblank 8682 275fa e0 7d cpx #125 8683 275fc 90 02 bcc pndetecispal 8684 275fe a0 01 ldy #$01 8685 27600 pndetecispal 8686 27600 8c 09 21 sty paldetected 8687 27603 8688 27603 20 9f f4 jsr createallgamedlls 8689 27606 8690 27606 a9 18 lda #>DLLMEM 8691 27608 85 2c sta DPPH 8692 2760a a9 00 lda # 255 8887 27663 -DOUBLEBUFFEROFFSET = 255 8888 27663 else 8889 27663 00 4d DOUBLEBUFFEROFFSET = (DLLASTOBJ+2) 8890 27663 endif 8891 27663 8892 27663 - ifconst EXTRADLMEMORY 8893 27663 -SECONDDLHALFSTART SET $2300 8894 27663 endif 8895 27663 8896 27663 DLPOINTH 8897 27663 DLINDEX SET 0 8898 27663 REPEAT WZONECOUNT 8899 27663 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27663 - ifconst EXTRADLMEMORY 8901 27663 - if TMPMEMADDRESS > $1FFF 8902 27663 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27663 - else 8904 27663 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27663 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27663 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27663 - endif 8908 27663 - endif ; TMPMEMADDRESS > $1FFF 8909 27663 endif ; EXTRADLMEMORY 8910 27663 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27663 18 .byte.b >TMPMEMADDRESS 8912 27663 DLINDEX SET DLINDEX + 1 8898 27663 REPEND 8899 27663 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27664 - ifconst EXTRADLMEMORY 8901 27664 - if TMPMEMADDRESS > $1FFF 8902 27664 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27664 - else 8904 27664 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27664 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27664 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27664 - endif 8908 27664 - endif ; TMPMEMADDRESS > $1FFF 8909 27664 endif ; EXTRADLMEMORY 8910 27664 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27664 18 .byte.b >TMPMEMADDRESS 8912 27664 DLINDEX SET DLINDEX + 1 8898 27664 REPEND 8899 27664 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27665 - ifconst EXTRADLMEMORY 8901 27665 - if TMPMEMADDRESS > $1FFF 8902 27665 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27665 - else 8904 27665 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27665 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27665 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27665 - endif 8908 27665 - endif ; TMPMEMADDRESS > $1FFF 8909 27665 endif ; EXTRADLMEMORY 8910 27665 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27665 19 .byte.b >TMPMEMADDRESS 8912 27665 DLINDEX SET DLINDEX + 1 8898 27665 REPEND 8899 27665 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27666 - ifconst EXTRADLMEMORY 8901 27666 - if TMPMEMADDRESS > $1FFF 8902 27666 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27666 - else 8904 27666 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27666 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27666 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27666 - endif 8908 27666 - endif ; TMPMEMADDRESS > $1FFF 8909 27666 endif ; EXTRADLMEMORY 8910 27666 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27666 19 .byte.b >TMPMEMADDRESS 8912 27666 DLINDEX SET DLINDEX + 1 8898 27666 REPEND 8899 27666 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27667 - ifconst EXTRADLMEMORY 8901 27667 - if TMPMEMADDRESS > $1FFF 8902 27667 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27667 - else 8904 27667 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27667 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27667 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27667 - endif 8908 27667 - endif ; TMPMEMADDRESS > $1FFF 8909 27667 endif ; EXTRADLMEMORY 8910 27667 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27667 19 .byte.b >TMPMEMADDRESS 8912 27667 DLINDEX SET DLINDEX + 1 8898 27667 REPEND 8899 27667 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27668 - ifconst EXTRADLMEMORY 8901 27668 - if TMPMEMADDRESS > $1FFF 8902 27668 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27668 - else 8904 27668 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27668 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27668 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27668 - endif 8908 27668 - endif ; TMPMEMADDRESS > $1FFF 8909 27668 endif ; EXTRADLMEMORY 8910 27668 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27668 1a .byte.b >TMPMEMADDRESS 8912 27668 DLINDEX SET DLINDEX + 1 8898 27668 REPEND 8899 27668 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27669 - ifconst EXTRADLMEMORY 8901 27669 - if TMPMEMADDRESS > $1FFF 8902 27669 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27669 - else 8904 27669 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27669 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27669 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27669 - endif 8908 27669 - endif ; TMPMEMADDRESS > $1FFF 8909 27669 endif ; EXTRADLMEMORY 8910 27669 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27669 1a .byte.b >TMPMEMADDRESS 8912 27669 DLINDEX SET DLINDEX + 1 8898 27669 REPEND 8899 27669 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2766a - ifconst EXTRADLMEMORY 8901 2766a - if TMPMEMADDRESS > $1FFF 8902 2766a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2766a - else 8904 2766a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2766a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2766a -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2766a - endif 8908 2766a - endif ; TMPMEMADDRESS > $1FFF 8909 2766a endif ; EXTRADLMEMORY 8910 2766a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2766a 1a .byte.b >TMPMEMADDRESS 8912 2766a DLINDEX SET DLINDEX + 1 8898 2766a REPEND 8899 2766a TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2766b - ifconst EXTRADLMEMORY 8901 2766b - if TMPMEMADDRESS > $1FFF 8902 2766b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2766b - else 8904 2766b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2766b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2766b -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2766b - endif 8908 2766b - endif ; TMPMEMADDRESS > $1FFF 8909 2766b endif ; EXTRADLMEMORY 8910 2766b ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2766b 1b .byte.b >TMPMEMADDRESS 8912 2766b DLINDEX SET DLINDEX + 1 8898 2766b REPEND 8899 2766b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2766c - ifconst EXTRADLMEMORY 8901 2766c - if TMPMEMADDRESS > $1FFF 8902 2766c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2766c - else 8904 2766c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2766c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2766c -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2766c - endif 8908 2766c - endif ; TMPMEMADDRESS > $1FFF 8909 2766c endif ; EXTRADLMEMORY 8910 2766c ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2766c 1b .byte.b >TMPMEMADDRESS 8912 2766c DLINDEX SET DLINDEX + 1 8898 2766c REPEND 8899 2766c TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2766d - ifconst EXTRADLMEMORY 8901 2766d - if TMPMEMADDRESS > $1FFF 8902 2766d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2766d - else 8904 2766d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2766d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2766d -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2766d - endif 8908 2766d - endif ; TMPMEMADDRESS > $1FFF 8909 2766d endif ; EXTRADLMEMORY 8910 2766d ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2766d 1b .byte.b >TMPMEMADDRESS 8912 2766d DLINDEX SET DLINDEX + 1 8898 2766d REPEND 8899 2766d TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2766e - ifconst EXTRADLMEMORY 8901 2766e - if TMPMEMADDRESS > $1FFF 8902 2766e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2766e - else 8904 2766e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2766e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2766e -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2766e - endif 8908 2766e - endif ; TMPMEMADDRESS > $1FFF 8909 2766e endif ; EXTRADLMEMORY 8910 2766e ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2766e 1b .byte.b >TMPMEMADDRESS 8912 2766e DLINDEX SET DLINDEX + 1 8898 2766e REPEND 8899 2766e TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2766f - ifconst EXTRADLMEMORY 8901 2766f - if TMPMEMADDRESS > $1FFF 8902 2766f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2766f - else 8904 2766f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2766f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2766f -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2766f - endif 8908 2766f - endif ; TMPMEMADDRESS > $1FFF 8909 2766f endif ; EXTRADLMEMORY 8910 2766f ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2766f 1c .byte.b >TMPMEMADDRESS 8912 2766f DLINDEX SET DLINDEX + 1 8898 2766f REPEND 8899 2766f TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27670 - ifconst EXTRADLMEMORY 8901 27670 - if TMPMEMADDRESS > $1FFF 8902 27670 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27670 - else 8904 27670 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27670 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27670 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27670 - endif 8908 27670 - endif ; TMPMEMADDRESS > $1FFF 8909 27670 endif ; EXTRADLMEMORY 8910 27670 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27670 1c .byte.b >TMPMEMADDRESS 8912 27670 DLINDEX SET DLINDEX + 1 8898 27670 REPEND 8899 27670 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27671 - ifconst EXTRADLMEMORY 8901 27671 - if TMPMEMADDRESS > $1FFF 8902 27671 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27671 - else 8904 27671 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27671 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27671 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27671 - endif 8908 27671 - endif ; TMPMEMADDRESS > $1FFF 8909 27671 endif ; EXTRADLMEMORY 8910 27671 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27671 1c .byte.b >TMPMEMADDRESS 8912 27671 DLINDEX SET DLINDEX + 1 8898 27671 REPEND 8899 27671 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27672 - ifconst EXTRADLMEMORY 8901 27672 - if TMPMEMADDRESS > $1FFF 8902 27672 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27672 - else 8904 27672 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27672 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27672 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27672 - endif 8908 27672 - endif ; TMPMEMADDRESS > $1FFF 8909 27672 endif ; EXTRADLMEMORY 8910 27672 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27672 1d .byte.b >TMPMEMADDRESS 8912 27672 DLINDEX SET DLINDEX + 1 8898 27672 REPEND 8899 27672 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27673 - ifconst EXTRADLMEMORY 8901 27673 - if TMPMEMADDRESS > $1FFF 8902 27673 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27673 - else 8904 27673 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27673 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27673 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27673 - endif 8908 27673 - endif ; TMPMEMADDRESS > $1FFF 8909 27673 endif ; EXTRADLMEMORY 8910 27673 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27673 1d .byte.b >TMPMEMADDRESS 8912 27673 DLINDEX SET DLINDEX + 1 8898 27673 REPEND 8899 27673 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27674 - ifconst EXTRADLMEMORY 8901 27674 - if TMPMEMADDRESS > $1FFF 8902 27674 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27674 - else 8904 27674 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27674 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27674 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27674 - endif 8908 27674 - endif ; TMPMEMADDRESS > $1FFF 8909 27674 endif ; EXTRADLMEMORY 8910 27674 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27674 1d .byte.b >TMPMEMADDRESS 8912 27674 DLINDEX SET DLINDEX + 1 8898 27674 REPEND 8899 27674 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27675 - ifconst EXTRADLMEMORY 8901 27675 - if TMPMEMADDRESS > $1FFF 8902 27675 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27675 - else 8904 27675 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27675 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27675 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27675 - endif 8908 27675 - endif ; TMPMEMADDRESS > $1FFF 8909 27675 endif ; EXTRADLMEMORY 8910 27675 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27675 1e .byte.b >TMPMEMADDRESS 8912 27675 DLINDEX SET DLINDEX + 1 8898 27675 REPEND 8899 27675 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27676 - ifconst EXTRADLMEMORY 8901 27676 - if TMPMEMADDRESS > $1FFF 8902 27676 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27676 - else 8904 27676 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27676 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27676 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27676 - endif 8908 27676 - endif ; TMPMEMADDRESS > $1FFF 8909 27676 endif ; EXTRADLMEMORY 8910 27676 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27676 1e .byte.b >TMPMEMADDRESS 8912 27676 DLINDEX SET DLINDEX + 1 8898 27676 REPEND 8899 27676 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27677 - ifconst EXTRADLMEMORY 8901 27677 - if TMPMEMADDRESS > $1FFF 8902 27677 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27677 - else 8904 27677 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27677 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27677 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27677 - endif 8908 27677 - endif ; TMPMEMADDRESS > $1FFF 8909 27677 endif ; EXTRADLMEMORY 8910 27677 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27677 1e .byte.b >TMPMEMADDRESS 8912 27677 DLINDEX SET DLINDEX + 1 8898 27677 REPEND 8899 27677 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27678 - ifconst EXTRADLMEMORY 8901 27678 - if TMPMEMADDRESS > $1FFF 8902 27678 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27678 - else 8904 27678 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27678 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27678 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27678 - endif 8908 27678 - endif ; TMPMEMADDRESS > $1FFF 8909 27678 endif ; EXTRADLMEMORY 8910 27678 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27678 1f .byte.b >TMPMEMADDRESS 8912 27678 DLINDEX SET DLINDEX + 1 8898 27678 REPEND 8899 27678 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 27679 - ifconst EXTRADLMEMORY 8901 27679 - if TMPMEMADDRESS > $1FFF 8902 27679 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 27679 - else 8904 27679 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 27679 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 27679 -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 27679 - endif 8908 27679 - endif ; TMPMEMADDRESS > $1FFF 8909 27679 endif ; EXTRADLMEMORY 8910 27679 ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 27679 1f .byte.b >TMPMEMADDRESS 8912 27679 DLINDEX SET DLINDEX + 1 8898 27679 REPEND 8899 27679 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8900 2767a - ifconst EXTRADLMEMORY 8901 2767a - if TMPMEMADDRESS > $1FFF 8902 2767a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8903 2767a - else 8904 2767a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8905 2767a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8906 2767a -SECONDDLHALFSTART SET TMPMEMADDRESS 8907 2767a - endif 8908 2767a - endif ; TMPMEMADDRESS > $1FFF 8909 2767a endif ; EXTRADLMEMORY 8910 2767a ;echo " "," ZONE",[DLINDEX]d,"ADDRESS: ",TMPMEMADDRESS 8911 2767a 1f .byte.b >TMPMEMADDRESS 8912 2767a DLINDEX SET DLINDEX + 1 8913 2767b REPEND 8914 2767b 8915 2767b - ifconst EXTRADLMEMORY 8916 2767b - echo " ",[SECONDDLHALFSTART],"to",[$27FF],"was claimed as extra DL memory." 8917 2767b endif 8918 2767b 8919 2767b 8920 2767b DLPOINTL 8921 2767b DLINDEX SET 0 8922 2767b REPEAT WZONECOUNT 8923 2767b TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8924 2767b - ifconst EXTRADLMEMORY 8925 2767b - if TMPMEMADDRESS > $1FFF 8926 2767b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2767b - else 8928 2767b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2767b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2767b - endif 8931 2767b - endif ; TMPMEMADDRESS > $1FFF 8932 2767b endif ; EXTRADLMEMORY 8933 2767b 80 .byte.b $1FFF 8926 2767c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2767c - else 8928 2767c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2767c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2767c - endif 8931 2767c - endif ; TMPMEMADDRESS > $1FFF 8932 2767c endif ; EXTRADLMEMORY 8933 2767c d0 .byte.b $1FFF 8926 2767d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2767d - else 8928 2767d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2767d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2767d - endif 8931 2767d - endif ; TMPMEMADDRESS > $1FFF 8932 2767d endif ; EXTRADLMEMORY 8933 2767d 20 .byte.b $1FFF 8926 2767e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2767e - else 8928 2767e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2767e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2767e - endif 8931 2767e - endif ; TMPMEMADDRESS > $1FFF 8932 2767e endif ; EXTRADLMEMORY 8933 2767e 70 .byte.b $1FFF 8926 2767f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2767f - else 8928 2767f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2767f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2767f - endif 8931 2767f - endif ; TMPMEMADDRESS > $1FFF 8932 2767f endif ; EXTRADLMEMORY 8933 2767f c0 .byte.b $1FFF 8926 27680 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27680 - else 8928 27680 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27680 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27680 - endif 8931 27680 - endif ; TMPMEMADDRESS > $1FFF 8932 27680 endif ; EXTRADLMEMORY 8933 27680 10 .byte.b $1FFF 8926 27681 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27681 - else 8928 27681 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27681 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27681 - endif 8931 27681 - endif ; TMPMEMADDRESS > $1FFF 8932 27681 endif ; EXTRADLMEMORY 8933 27681 60 .byte.b $1FFF 8926 27682 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27682 - else 8928 27682 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27682 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27682 - endif 8931 27682 - endif ; TMPMEMADDRESS > $1FFF 8932 27682 endif ; EXTRADLMEMORY 8933 27682 b0 .byte.b $1FFF 8926 27683 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27683 - else 8928 27683 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27683 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27683 - endif 8931 27683 - endif ; TMPMEMADDRESS > $1FFF 8932 27683 endif ; EXTRADLMEMORY 8933 27683 00 .byte.b $1FFF 8926 27684 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27684 - else 8928 27684 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27684 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27684 - endif 8931 27684 - endif ; TMPMEMADDRESS > $1FFF 8932 27684 endif ; EXTRADLMEMORY 8933 27684 50 .byte.b $1FFF 8926 27685 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27685 - else 8928 27685 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27685 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27685 - endif 8931 27685 - endif ; TMPMEMADDRESS > $1FFF 8932 27685 endif ; EXTRADLMEMORY 8933 27685 a0 .byte.b $1FFF 8926 27686 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27686 - else 8928 27686 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27686 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27686 - endif 8931 27686 - endif ; TMPMEMADDRESS > $1FFF 8932 27686 endif ; EXTRADLMEMORY 8933 27686 f0 .byte.b $1FFF 8926 27687 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27687 - else 8928 27687 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27687 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27687 - endif 8931 27687 - endif ; TMPMEMADDRESS > $1FFF 8932 27687 endif ; EXTRADLMEMORY 8933 27687 40 .byte.b $1FFF 8926 27688 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27688 - else 8928 27688 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27688 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27688 - endif 8931 27688 - endif ; TMPMEMADDRESS > $1FFF 8932 27688 endif ; EXTRADLMEMORY 8933 27688 90 .byte.b $1FFF 8926 27689 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27689 - else 8928 27689 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27689 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27689 - endif 8931 27689 - endif ; TMPMEMADDRESS > $1FFF 8932 27689 endif ; EXTRADLMEMORY 8933 27689 e0 .byte.b $1FFF 8926 2768a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2768a - else 8928 2768a - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2768a -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2768a - endif 8931 2768a - endif ; TMPMEMADDRESS > $1FFF 8932 2768a endif ; EXTRADLMEMORY 8933 2768a 30 .byte.b $1FFF 8926 2768b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2768b - else 8928 2768b - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2768b -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2768b - endif 8931 2768b - endif ; TMPMEMADDRESS > $1FFF 8932 2768b endif ; EXTRADLMEMORY 8933 2768b 80 .byte.b $1FFF 8926 2768c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2768c - else 8928 2768c - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2768c -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2768c - endif 8931 2768c - endif ; TMPMEMADDRESS > $1FFF 8932 2768c endif ; EXTRADLMEMORY 8933 2768c d0 .byte.b $1FFF 8926 2768d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2768d - else 8928 2768d - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2768d -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2768d - endif 8931 2768d - endif ; TMPMEMADDRESS > $1FFF 8932 2768d endif ; EXTRADLMEMORY 8933 2768d 20 .byte.b $1FFF 8926 2768e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2768e - else 8928 2768e - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2768e -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2768e - endif 8931 2768e - endif ; TMPMEMADDRESS > $1FFF 8932 2768e endif ; EXTRADLMEMORY 8933 2768e 70 .byte.b $1FFF 8926 2768f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 2768f - else 8928 2768f - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 2768f -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 2768f - endif 8931 2768f - endif ; TMPMEMADDRESS > $1FFF 8932 2768f endif ; EXTRADLMEMORY 8933 2768f c0 .byte.b $1FFF 8926 27690 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27690 - else 8928 27690 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27690 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27690 - endif 8931 27690 - endif ; TMPMEMADDRESS > $1FFF 8932 27690 endif ; EXTRADLMEMORY 8933 27690 10 .byte.b $1FFF 8926 27691 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27691 - else 8928 27691 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27691 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27691 - endif 8931 27691 - endif ; TMPMEMADDRESS > $1FFF 8932 27691 endif ; EXTRADLMEMORY 8933 27691 60 .byte.b $1FFF 8926 27692 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8927 27692 - else 8928 27692 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8929 27692 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8930 27692 - endif 8931 27692 - endif ; TMPMEMADDRESS > $1FFF 8932 27692 endif ; EXTRADLMEMORY 8933 27692 b0 .byte.b $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 18 80 ZONE0ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 18 d0 ZONE1ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 19 20 ZONE2ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 19 70 ZONE3ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 19 c0 ZONE4ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1a 10 ZONE5ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1a 60 ZONE6ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1a b0 ZONE7ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1b 00 ZONE8ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1b 50 ZONE9ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1b a0 ZONE10ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1b f0 ZONE11ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1c 40 ZONE12ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1c 90 ZONE13ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1c e0 ZONE14ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1d 30 ZONE15ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1d 80 ZONE16ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1d d0 ZONE17ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1e 20 ZONE18ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1e 70 ZONE19ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1e c0 ZONE20ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1f 10 ZONE21ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1f 60 ZONE22ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8939 27693 REPEND 8940 27693 TMPMEMADDRESS SET (((DLINDEX*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) 8941 27693 - ifconst EXTRADLMEMORY 8942 27693 - if TMPMEMADDRESS > $1FFF 8943 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8944 27693 - else 8945 27693 - if ((((DLINDEX+1)*WMEMSIZE)/WZONECOUNT)+WDLMEMSTART) > $1FFF 8946 27693 -TMPMEMADDRESS SET (TMPMEMADDRESS + $300) 8947 27693 - endif 8948 27693 - endif ; TMPMEMADDRESS > $1FFF 8949 27693 endif ; EXTRADLMEMORY 8950 27693 8951 27693 1f b0 ZONE23ADDRESS = TMPMEMADDRESS 8952 27693 8953 27693 DLINDEX SET DLINDEX + 1 8954 27693 REPEND 8955 27693 8956 27693 $1880 to $1fff used as zone memory, allowing 15 display objects per zone. 8957 27693 echo " ",[WDLMEMSTART],"to",[WDLMEMEND],"used as zone memory, allowing",[(DLLASTOBJ/5)]d,"display objects per zone." 8958 27693 8959 27693 DLHEIGHT 8960 27693 REPEAT WZONECOUNT 8961 27693 07 .byte.b (WZONEHEIGHT-1) 8960 27693 REPEND 8961 27694 07 .byte.b (WZONEHEIGHT-1) 8960 27694 REPEND 8961 27695 07 .byte.b (WZONEHEIGHT-1) 8960 27695 REPEND 8961 27696 07 .byte.b (WZONEHEIGHT-1) 8960 27696 REPEND 8961 27697 07 .byte.b (WZONEHEIGHT-1) 8960 27697 REPEND 8961 27698 07 .byte.b (WZONEHEIGHT-1) 8960 27698 REPEND 8961 27699 07 .byte.b (WZONEHEIGHT-1) 8960 27699 REPEND 8961 2769a 07 .byte.b (WZONEHEIGHT-1) 8960 2769a REPEND 8961 2769b 07 .byte.b (WZONEHEIGHT-1) 8960 2769b REPEND 8961 2769c 07 .byte.b (WZONEHEIGHT-1) 8960 2769c REPEND 8961 2769d 07 .byte.b (WZONEHEIGHT-1) 8960 2769d REPEND 8961 2769e 07 .byte.b (WZONEHEIGHT-1) 8960 2769e REPEND 8961 2769f 07 .byte.b (WZONEHEIGHT-1) 8960 2769f REPEND 8961 276a0 07 .byte.b (WZONEHEIGHT-1) 8960 276a0 REPEND 8961 276a1 07 .byte.b (WZONEHEIGHT-1) 8960 276a1 REPEND 8961 276a2 07 .byte.b (WZONEHEIGHT-1) 8960 276a2 REPEND 8961 276a3 07 .byte.b (WZONEHEIGHT-1) 8960 276a3 REPEND 8961 276a4 07 .byte.b (WZONEHEIGHT-1) 8960 276a4 REPEND 8961 276a5 07 .byte.b (WZONEHEIGHT-1) 8960 276a5 REPEND 8961 276a6 07 .byte.b (WZONEHEIGHT-1) 8960 276a6 REPEND 8961 276a7 07 .byte.b (WZONEHEIGHT-1) 8960 276a7 REPEND 8961 276a8 07 .byte.b (WZONEHEIGHT-1) 8960 276a8 REPEND 8961 276a9 07 .byte.b (WZONEHEIGHT-1) 8960 276a9 REPEND 8961 276aa 07 .byte.b (WZONEHEIGHT-1) 8962 276ab REPEND 8963 276ab 8964 276ab ; Provided under the CC0 license. See the included LICENSE.txt for details. 8965 276ab 8966 276ab ; a simple guard, than ensures the 7800basic code hasn't 8967 276ab ; spilled into the encryption area... 2259 bytes left in the 7800basic reserved area. 8968 276ab echo " ",($FF7E-*)d,"bytes left in the 7800basic reserved area." 8969 276ab - if (*>$FF7D) 8970 276ab - ERR ; abort the assembly 8971 276ab endif 8972 276ab ; Provided under the CC0 license. See the included LICENSE.txt for details. 8973 276ab 8974 276ab - ifconst DEV 8975 276ab - ifnconst ZONEHEIGHT 8976 276ab - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8977 276ab - else 8978 276ab - if ZONEHEIGHT = 8 8979 276ab - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8980 276ab - else 8981 276ab - echo "* the 4k 7800basic area has",[($FF7E - *)]d,"bytes free." 8982 276ab - endif 8983 276ab - endif 8984 276ab endif 8985 276ab 8986 276ab ; FF7E/FF7F contains the 7800basic crc checksum word 8987 276ab 8988 276ab ; FF80 - FFF7 contains the 7800 encryption key 8989 276ab 8990 276ab - ifnconst bankswitchmode 8991 276ab - ORG $FFF8 8992 276ab else 8993 276ab ifconst ROM128K 8994 27ff8 ORG $27FF8 8995 27ff8 RORG $FFF8 8996 27ff8 endif 8997 27ff8 - ifconst ROM144K 8998 27ff8 - ORG $27FF8 8999 27ff8 - RORG $FFF8 9000 27ff8 endif 9001 27ff8 - ifconst ROM256K 9002 27ff8 - ORG $47FF8 9003 27ff8 - RORG $FFF8 9004 27ff8 endif 9005 27ff8 - ifconst ROM272K 9006 27ff8 - ORG $47FF8 9007 27ff8 - RORG $FFF8 9008 27ff8 endif 9009 27ff8 - ifconst ROM512K 9010 27ff8 - ORG $87FF8 9011 27ff8 - RORG $FFF8 9012 27ff8 endif 9013 27ff8 - ifconst ROM528K 9014 27ff8 - ORG $87FF8 9015 27ff8 - RORG $FFF8 9016 27ff8 endif 9017 27ff8 endif 9018 27ff8 9019 27ff8 9020 27ff8 ff .byte.b $FF ; region verification. $FF=all regions 9021 27ff9 f7 .byte.b $F7 ; high nibble: encryption check from $N000 to $FF7F. we only hash the last 4k for faster boot. 9022 27ffa ; low nibble : N=7 atari rainbow start, N=3 no atari rainbow 9023 27ffa 9024 27ffa ;Vectors 9025 27ffa 00 f0 .word.w NMI 9026 27ffc 72 f5 .word.w START 9027 27ffe 5f f0 .word.w IRQ 9028 28000